diff --git a/.gdbinit b/.gdbinit deleted file mode 100644 index 7c58e86fda3a1..0000000000000 --- a/.gdbinit +++ /dev/null @@ -1,359 +0,0 @@ -set $zts = 0 - -define ____executor_globals - if $zts - set $eg = ((zend_executor_globals) (*((void ***) tsrm_ls))[executor_globals_id-1]) - else - set $eg = executor_globals - end -end - -document ____executor_globals - portable way of accessing executor_globals - type "set $zts = 1" if you use --enable-maintainer-zts on your configure line -end - -define dump_bt - set $t = $arg0 - while $t - printf "[0x%08x] ", $t - if $t->function_state.function->common.function_name - printf "%s() ", $t->function_state.function->common.function_name - else - printf "??? " - end - if $t->op_array != 0 - printf "%s:%d ", $t->op_array->filename, $t->opline->lineno - end - set $t = $t->prev_execute_data - printf "\n" - end -end - -document dump_bt - dumps the current execution stack. usage: dump_bt executor_globals.current_execute_data -end - -define printzv - set $ind = 1 - ____printzv $arg0 0 -end - -document printzv - prints content of zval -end - -define ____printzv_contents - ____executor_globals - set $zvalue = $arg0 - - if $zvalue.type == 0 - set $typename = "NULL" - end - if $zvalue.type == 1 - set $typename = "long" - end - if $zvalue.type == 2 - set $typename = "double" - end - if $zvalue.type == 3 - set $typename = "string" - end - if $zvalue.type == 4 - set $typename = "array" - end - if $zvalue.type == 5 - set $typename = "object" - end - if $zvalue.type == 6 - set $typename = "bool" - end - if $zvalue.type == 7 - set $typename = "resource" - end - if $zvalue.type == 8 - set $typename = "constant" - end - if $zvalue.type == 9 - set $typename = "const_array" - end - - printf "(refcount=%d) %s: ", $zvalue.refcount, $typename - if $zvalue.type == 1 - printf "%ld", $zvalue.value.lval - end - if $zvalue->type == 2 - printf "%lf", $zvalue.value.dval - end - if $zvalue.type == 3 - printf "\"%s\"(%d)", $zvalue.value.str.val, $zvalue.value.str.len - end - if $zvalue.type == 4 - if ! $arg1 - printf "{\n" - set $ind = $ind + 1 - ____print_ht $zvalue.value.ht - set $ind = $ind - 1 - set $i = $ind - while $i > 0 - printf " " - set $i = $i - 1 - end - printf "}" - end - end - if $zvalue.type == 5 - if ! $arg1 - printf "(prop examination disabled due to a gdb bug)" - if $zvalue.value.obj.handlers->get_properties -# set $ht = $zvalue->value.obj.handlers->get_properties($zvalue) -# printf "{\n" -# set $ind = $ind + 1 -# ____print_ht $ht -# set $ind = $ind - 1 -# set $i = $ind -# while $i > 0 -# printf " " -# set $i = $i - 1 -# end -# printf "}" - end - end - end - if $zvalue.type == 6 - if $zvalue.value.lval - printf "true" - else - printf "false" - end - end - if $zvalue.type == 7 - printf "#%d", $zvalue.value.lval - end - printf "\n" -end - -define ____printzv - ____executor_globals - set $zvalue = $arg0 - - printf "[0x%08x] ", $zvalue - - if $zvalue == $eg.uninitialized_zval_ptr - printf "*uninitialized* " - end - - set $zcontents = *(struct _zval_struct *) $zvalue - if $arg1 - ____printzv_contents $zcontents $arg1 - else - ____printzv_contents $zcontents 0 - end -end - -define ____print_const_table - set $ht = $arg0 - set $p = $ht->pListHead - - while $p != 0 - set $const = *(zend_constant *) $p->pData - - set $i = $ind - while $i > 0 - printf " " - set $i = $i - 1 - end - - if $p->nKeyLength > 0 - printf "\"%s\" => ", $p->arKey - else - printf "%d => ", $p->h - end - - ____printzv_contents $const.value 0 - set $p = $p->pListNext - end -end - -define print_const_table - set $ind = 1 - printf "[0x%08x] {\n", $arg0 - ____print_const_table $arg0 - printf "}\n" -end - -define ____print_ht - set $ht = $arg0 - set $p = $ht->pListHead - - while $p != 0 - set $zval = *(struct _zval_struct **)$p->pData - - set $i = $ind - while $i > 0 - printf " " - set $i = $i - 1 - end - - if $p->nKeyLength > 0 - printf "\"%s\" => ", $p->arKey - else - printf "%d => ", $p->h - end - - ____printzv $zval 1 - set $p = $p->pListNext - end -end - -define print_ht - set $ind = 1 - printf "[0x%08x] {\n", $arg0 - ____print_ht $arg0 - printf "}\n" -end - -document print_ht - dumps elements of HashTable made of zval -end - -define printzn - ____executor_globals - set $ind = 0 - set $znode = $arg0 - if $znode->op_type == 1 - set $optype = "IS_CONST" - end - if $znode->op_type == 2 - set $optype = "IS_TMP_VAR" - end - if $znode->op_type == 4 - set $optype = "IS_VAR" - end - if $znode->op_type == 8 - set $optype = "IS_UNUSED" - end - - printf "[0x%08x] %s", $znode, $optype - - if $znode->op_type == 1 - printf ": " - ____printzv &$znode->u.constant 0 - end - if $znode->op_type == 2 - printf ": " - set $tvar = (union _temp_variable *)((char *)$eg.current_execute_data->Ts + $znode->u.var) - ____printzv ((union _temp_variable *)$tvar)->tmp_var 0 - end - if $znode->op_type == 4 - printf ": " - set $tvar = (union _temp_variable *)((char *)$eg.current_execute_data->Ts + $znode->u.var) - ____printzv *$tvar->var.ptr_ptr 0 - end - if $znode->op_type == 8 - printf "\n" - end -end - -document printzn - print type and content of znode. - usage: printzn &opline->op1 -end - -define printzops - printf "op1 => " - printzn &execute_data->opline.op1 - printf "op2 => " - printzn &execute_data->opline.op2 - printf "result => " - printzn &execute_data->opline.result -end - -document printzops - dump operands of the current opline -end - -define zbacktrace - ____executor_globals - dump_bt $eg.current_execute_data -end - -document zbacktrace - prints backtrace. - This command is almost a short cut for - > (gdb) ____executor_globals - > (gdb) dump_bt $eg.current_execute_data -end - -define zmemcheck - set $p = alloc_globals.head - set $stat = "?" - set $total_size = 0 - if $arg0 != 0 - set $not_found = 1 - else - set $not_found = 0 - end - printf " block size status file:line\n" - printf "-------------------------------------------------------------------------------\n" - while $p - set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test) - if $arg0 == 0 || (void *)$aptr == (void *)$arg0 - if $p->magic == 0x7312f8dc - set $stat = "OK" - end - if $p->magic == 0x99954317 - set $stat = "FREED" - end - if $p->magic == 0xfb8277dc - set $stat = "CACHED" - end - set $filename = strrchr($p->filename, '/') - if !$filename - set $filename = $p->filename - else - set $filename = $filename + 1 - end - printf " 0x%08x ", $aptr - if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10 - printf "ZVAL?(%-2d) ", $p->size - else - printf "%-9d ", $p->size - end - set $total_size = $total_size + $p->size - printf "%-06s %s:%d", $stat, $filename, $p->lineno - if $p->orig_filename - set $orig_filename = strrchr($p->orig_filename, '/') - if !$orig_filename - set $orig_filename = $p->orig_filename - else - set $orig_filename = $orig_filename + 1 - end - printf " <= %s:%d\n", $orig_filename, $p->orig_lineno - else - printf "\n" - end - if $arg0 != 0 - set $p = 0 - set $not_found = 0 - else - set $p = $p->pNext - end - else - set $p = $p->pNext - end - end - if $not_found - printf "no such block that begins at 0x%08x.\n", $aptr - end - if $arg0 == 0 - printf "-------------------------------------------------------------------------------\n" - printf " total: %d bytes\n", $total_size - end -end - -document zmemcheck - show status of a memory block. - usage: zmemcheck [ptr]. - if ptr is 0, all blocks will be listed. -end diff --git a/CODING_STANDARDS b/CODING_STANDARDS deleted file mode 100644 index ff26a8985a50f..0000000000000 --- a/CODING_STANDARDS +++ /dev/null @@ -1,272 +0,0 @@ -PHP Coding Standards -==================== - - -This file lists several standards that any programmer, adding or changing -code in PHP, should follow. Since this file was added at a very late -stage of the development of PHP v3.0, the code base does not (yet) fully -follow it, but it's going in that general direction. Since we are now -well into the version 4 releases, many sections have been recoded to use -these rules. - - -Code Implementation -------------------- - -[0] Document your code in source files and the manual. [tm] - -[1] Functions that are given pointers to resources should not free them - -For instance, function int mail(char *to, char *from) should NOT free -to and/or from. -Exceptions: - - - The function's designated behavior is freeing that resource. E.g. efree() - - The function is given a boolean argument, that controls whether or not - the function may free its arguments (if true - the function must free its - arguments, if false - it must not) - - Low-level parser routines, that are tightly integrated with the token - cache and the bison code for minimum memory copying overhead. - -[2] Functions that are tightly integrated with other functions within the - same module, and rely on each other non-trivial behavior, should be - documented as such and declared 'static'. They should be avoided if - possible. - -[3] Use definitions and macros whenever possible, so that constants have - meaningful names and can be easily manipulated. The only exceptions - to this rule are 0 and 1, when used as false and true (respectively). - Any other use of a numeric constant to specify different behavior - or actions should be done through a #define. - -[4] When writing functions that deal with strings, be sure to remember - that PHP holds the length property of each string, and that it - shouldn't be calculated with strlen(). Write your functions in a such - a way so that they'll take advantage of the length property, both - for efficiency and in order for them to be binary-safe. - Functions that change strings and obtain their new lengths while - doing so, should return that new length, so it doesn't have to be - recalculated with strlen() (e.g. php_addslashes()) - -[5] NEVER USE strncat(). If you're absolutely sure you know what you're doing, - check its man page again, and only then, consider using it, and even then, - try avoiding it. - -[6] Use PHP_* macros in the PHP source, and ZEND_* macros in the Zend - part of the source. Although the PHP_* macro's are mostly aliased to the - ZEND_* macros it gives a better understanding on what kind of macro you're - calling. - -[7] When commenting out code using a #if statement, do NOT use 0 only. Instead - use "_0". For example, #if FOO_0, where FOO is your - cvs user foo. This allows easier tracking of why code was commented out, - especially in bundled libraries. - -[8] Do not define functions that are not available. For instance, if a - library is missing a function, do not define the PHP version of the - function, and do not raise a run-time error about the function not - existing. End users should use function_exists() to test for the - existence of a function - -[9] Prefer emalloc(), efree(), estrdup(), etc. to their standard C library - counterparts. These functions implement an internal "safety-net" - mechanism that ensures the deallocation of any unfreed memory at the - end of a request. They also provide useful allocation and overflow - information while running in debug mode. - - In almost all cases, memory returned to the engine must be allocated - using emalloc(). - - The use of malloc() should be limited to cases where a third-party - library may need to control or free the memory, or when the memory in - question needs to survive between multiple requests. - -Naming Conventions ------------------- - -[1] Function names for user-level functions should be enclosed with in - the PHP_FUNCTION() macro. They should be in lowercase, with words - underscore delimited, with care taken to minimize the letter count. - Abbreviations should not be used when they greatly decrease the - readability of the function name itself. - - Good: - 'mcrypt_enc_self_test' - 'mysql_list_fields' - - Ok: - 'mcrypt_module_get_algo_supported_key_sizes' - (could be 'mcrypt_mod_get_algo_sup_key_sizes'?) - 'get_html_translation_table' - (could be 'html_get_trans_table'?) - - Bad: - 'hw_GetObjectByQueryCollObj' - 'pg_setclientencoding' - 'jf_n_s_i' - -[2] If they are part of a "parent set" of functions, that parent should - be included in the user function name, and should be clearly related - to the parent program or function family. This should be in the form - of parent_*. - - A family of 'foo' functions, for example: - Good: - 'foo_select_bar' - 'foo_insert_baz' - 'foo_delete_baz' - - Bad: - 'fooselect_bar' - 'fooinsertbaz' - 'delete_foo_baz' - -[3] Function names used by user functions should be prefixed - with "_php_", and followed by a word or an underscore-delimited list of - words, in lowercase letters, that describes the function. If applicable, - they should be declared 'static'. - -[4] Variable names must be meaningful. One letter variable names must be - avoided, except for places where the variable has no real meaning or - a trivial meaning (e.g. for (i=0; i<100; i++) ...). - -[5] Variable names should be in lowercase. Use underscores to separate - between words. - -[6] Method names follow the 'studlyCaps' (also referred to as 'bumpy case' - or 'camel caps') naming convention, with care taken to minimize the - letter count. The initial letter of the name is lowercase, and each - letter that starts a new 'word' is capitalized. - - Good: - 'connect()' - 'getData()' - 'buildSomeWidget()' - - Bad: - 'get_Data()' - 'buildsomewidget' - 'getI()' - -[7] Classes should be given descriptive names. Avoid using abbreviations - where possible. Each word in the class name should start with a capital - letter, with words underscore delimited. The class name should be prefixed - with the name of the 'parent set'. - - Good: - 'Curl' - 'Foo_Bar' - - Bad: - 'foobar' - 'foo_bar' - 'FooBar' - - -Syntax and indentation ----------------------- - -[1] Never use C++ style comments (i.e. // comment). Always use C-style - comments instead. PHP is written in C, and is aimed at compiling - under any ANSI-C compliant compiler. Even though many compilers - accept C++-style comments in C code, you have to ensure that your - code would compile with other compilers as well. - The only exception to this rule is code that is Win32-specific, - because the Win32 port is MS-Visual C++ specific, and this compiler - is known to accept C++-style comments in C code. - -[2] Use K&R-style. Of course, we can't and don't want to - force anybody to use a style he or she is not used to, but, - at the very least, when you write code that goes into the core - of PHP or one of its standard modules, please maintain the K&R - style. This applies to just about everything, starting with - indentation and comment styles and up to function declaration - syntax. - - (see also http://www.catb.org/~esr/jargon/html/I/indent-style.html) - -[3] Be generous with whitespace and braces. Always prefer: - - if (foo) { - bar; - } - - to: - - if(foo)bar; - - Keep one empty line between the variable declaration section and - the statements in a block, as well as between logical statement - groups in a block. Maintain at least one empty line between - two functions, preferably two. - -[4] When indenting, use the tab character. A tab is expected to represent - four spaces. It is important to maintain consistency in indenture so - that definitions, comments, and control structures line up correctly. - -[5] Preprocessor statements (#if and such) MUST start at column one. To - indent preprocessor directives you should put the # at the beginning - of a line, followed by any number of whitespace. - -Documentation and Folding Hooks -------------------------------- - -In order to make sure that the online documentation stays in line with -the code, each user-level function should have its user-level function -prototype before it along with a brief one-line description of what the -function does. It would look like this: - -/* {{{ proto int abs(int number) - Returns the absolute value of the number */ -PHP_FUNCTION(abs) -{ - ... -} -/* }}} */ - -The {{{ symbols are the default folding symbols for the folding mode in -Emacs and vim (set fdm=marker). Folding is very useful when dealing with -large files because you can scroll through the file quickly and just unfold -the function you wish to work on. The }}} at the end of each function marks -the end of the fold, and should be on a separate line. - -The "proto" keyword there is just a helper for the doc/genfuncsummary script -which generates a full function summary. Having this keyword in front of the -function prototypes allows us to put folds elsewhere in the code without -messing up the function summary. - -Optional arguments are written like this: - -/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]]) - Returns a header object with the defined parameters */ - -And yes, please keep the prototype on a single line, even if that line -is massive. - -New and Experimental Functions ------------------------------------ -To reduce the problems normally associated with the first public -implementation of a new set of functions, it has been suggested -that the first implementation include a file labeled 'EXPERIMENTAL' -in the function directory, and that the functions follow the -standard prefixing conventions during their initial implementation. - -The file labelled 'EXPERIMENTAL' should include the following -information: - Any authoring information (known bugs, future directions of the module). - Ongoing status notes which may not be appropriate for CVS comments. - -Aliases & Legacy Documentation ------------------------------------ -You may also have some deprecated aliases with close to duplicate -names, for example, somedb_select_result and somedb_selectresult. For -documentation purposes, these will only be documented by the most -current name, with the aliases listed in the documentation for -the parent function. For ease of reference, user-functions with -completely different names, that alias to the same function (such as -highlight_file and show_source), will be separately documented. The -proto should still be included, describing which function is aliased. - -Backwards compatible functions and names should be maintained as long -as the code can be reasonably be kept as part of the codebase. See -/phpdoc/README for more information on documentation. diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 42549a2773377..0000000000000 --- a/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -For the list of people who've put work into PHP, please see -http://www.php.net/credits.php diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 84e2d60e380d0..0000000000000 --- a/ChangeLog +++ /dev/null @@ -1,20728 +0,0 @@ -2005-10-25 Marcus Boerger - - * (PHP_5_1) - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_extensions.h: - - MFH zend_is_callable_ex() returns zend_class_entry* if available - - * ZendEngine2/zend_API.c: - - Make the code a bit clearer - -2005-10-25 Pierre-Alain Joye - - * (PHP_5_1) - ext/gd/gd.c: - - fix #34980, divisor and offset never passed correctly (s/float/double/) - -2005-10-25 Marcus Boerger - - * ZendEngine2/zend_extensions.h: - - api was changed, also we are here in api 3.*, not 2 anymore - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h: - - Make zend_is_callable_ex() return the class netry if available - -2005-10-25 Michael Wallner - - * (PHP_5_1) - NEWS: - fix bug #34965 tidy is not binary safe - -2005-10-25 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/bz2/bz2.c: - MFH: Fixed bug #34968 (bz2 extension fails on to build on some win32 - setups). - - * ext/bz2/bz2.c: - Fixed bug #34968 (bz2 extension fails on to build on some win32 setups). - -2005-10-25 Michael Wallner - - * ext/zlib/zlib.c - ext/zlib/zlib.c: - - fix the fix - - * ext/zlib/tests/bug_34821.phpt: - - add test case too - - * ext/zlib/tests/bug_34821.phpt - ext/zlib/tests/bug_34821.phpt: - - file bug_34821.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ext/zlib/zlib.c: - - MFH: fix bug #34821 zlib encoders fail on widely varying binary data on - windows - - * ext/zlib/zlib.c: - - fix bug #34821 zlib encoders fail on widely varying binary data on - windows - -2005-10-25 Antony Dovgal - - * (PHP_5_0) - ext/standard/dns.c - ext/standard/dns.c: - MFH: apply workaround for the leak only when GLIBC is used - - * ext/standard/dns.c: - apply workaround for the leak only when GLIBC is used - - * (PHP_5_1) - NEWS: - fix the order - -2005-10-25 Michael Wallner - - * (PHP_5_1) - NEWS - ext/curl/config.m4 - ext/curl/config.w32 - ext/curl/interface.c: - - MFH: thread safe SSL crypto locks, fixes bug #33760 - - * ext/curl/config.m4 - ext/curl/config.w32 - ext/curl/interface.c: - - thread safe SSL crypto locks, fixes bug #33760 - -2005-10-25 Ilia Alshanetsky - - * ext/iconv/tests/bug16069.phpt - ext/iconv/tests/eucjp2iso2022jp.phpt - ext/iconv/tests/eucjp2sjis.phpt - ext/iconv/tests/eucjp2utf8.phpt - ext/iconv/tests/iconv001.phpt - ext/iconv/tests/iconv002.phpt - ext/iconv/tests/ob_iconv_handler.phpt - ext/iconv/tests/translit-failure.phpt - ext/iconv/tests/translit-utf8.phpt: - MFB51: Do not run tests if iconv extension is unavailable. - - * (PHP_5_1) - ext/iconv/tests/bug16069.phpt - ext/iconv/tests/eucjp2iso2022jp.phpt - ext/iconv/tests/eucjp2sjis.phpt - ext/iconv/tests/eucjp2utf8.phpt - ext/iconv/tests/iconv001.phpt - ext/iconv/tests/iconv002.phpt - ext/iconv/tests/ob_iconv_handler.phpt - ext/iconv/tests/translit-failure.phpt - ext/iconv/tests/translit-utf8.phpt: - Do not run tests if iconv extension is unavailable. - -2005-10-25 Antony Dovgal - - * (PHP_5_0) - ext/standard/dns.c - ext/standard/dns.c: - MFH: fix problem with garbage appearing in hostnames - - * ext/standard/dns.c: - fix problem with garbage appearing in hostnames - -2005-10-24 Jani Taskinen - - * ext/ldap/config.m4: - fix build - -2005-10-24 Antony Dovgal - - * (PHP_5_0) - ext/ldap/config.m4 - ext/ldap/config.m4: - MFH: fix #34970 (ldap configuration issues) - - * ext/ldap/config.m4: - fix #34970 (ldap configuration issues) - -2005-10-24 Rolland Santimano - - * unicode-progress.txt: - - strip_tags(), str[c]spn(), strpbrk(), strrchr(), strrpos(), strtok() - - * ext/standard/string.c: - - Unicode impl of strrchr() - -2005-10-24 Marcus Boerger - - * (PHP_5_1) - ext/simplexml/simplexml.c - ext/simplexml/tests/023.phpt: - - Fix issue with entities in attributes - -2005-10-24 Dmitry Stogov - - * (PHP_5_0) - NEWS - NEWS: - Fixed bug #34950 (Unable to get WSDL through proxy) - - * ZendEngine2/zend_language_scanner.l: - Unicode support (bug #31341) - - * ext/standard/array.c - ext/standard/tests/array/bug34934.phpt: - Reverted fix for bug #34934. The bug marked as bogus. - - * (PHP_5_1) - NEWS - ext/standard/array.c - ext/standard/tests/array/bug34934.phpt: - Reverted patch for bug #34934. Bug is marked as bogus. - -2005-10-23 Marcus Boerger - - * ext/simplexml/simplexml.c - ext/simplexml/tests/023.phpt: - - Fix issue with entities in attributes - - * ext/simplexml/tests/023.phpt: - - Add new test - -2005-10-23 Antony Dovgal - - * (PHP_5_0) - NEWS - NEWS - ext/standard/dns.c - ext/standard/dns.c: - MFH: fix #34938 (dns_get_record() doesn't resolve long hostnames and leaks) - - * ext/standard/dns.c: - fix #34938 (dns_get_record() doesn't resolve long hostnames and leaks) - -2005-10-23 Ilia Alshanetsky - - * ext/standard/dns.c: - MFB51: Fixed memory leak on error. - - * (PHP_5_1) - ext/standard/dns.c: - Fixed memory leak on error. - -2005-10-22 Jani Taskinen - - * (PHP_5_1) - NEWS: - keep the order! :) - -2005-10-22 Wez Furlong - - * ext/standard/filestat.c - main/streams/php_stream_plain_wrapper.h: - merge VCWD_ACCESS bugfix to head. - Test suite is unusable in HEAD, so I guess it works here too. - - * (PHP_5_1) - NEWS - ext/standard/filestat.c - main/streams/php_stream_plain_wrapper.h: - Fix #34957; file access checks should use VCWD_ACCESS() - -2005-10-22 Rolland Santimano - - * ext/standard/string.c: - - php_u_stristr: Remove leading back-slash ... sheesh - - * ext/standard/string.c: - - php_u_stristr: s/codepts/codepoints/ - make Jani happy - - * ext/standard/string.c: - - Unicode impl of strpbrk() - - * ext/standard/string.c: - - php_u_stristr: Code comments - -2005-10-21 Antony Dovgal - - * ext/standard/array.c - ext/standard/array.c: - fix ws - -2005-10-21 Dmitry Stogov - - * ext/standard/tests/array/bug34934.phpt - ext/standard/tests/array/bug34934.phpt: - - file bug34934.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug34934.phpt: - Fixed bug #34934 (offsetExists is not called from array_key_exists) - -2005-10-21 Antony Dovgal - - * (PHP_5_0) - ext/standard/dns.c - ext/standard/dns.c: - MFH: fix possible crash in dns_get_record() - cleanup code a bit - (partly fixes #34938) - - * ext/standard/dns.c: - fix possible crash in dns_get_record() - cleanup code a bit - (partly fixes #34938) - -2005-10-21 Dmitry Stogov - - * ZendEngine2/tests/bug31341.phpt - ZendEngine2/tests/bug31341.phpt: - - file bug31341.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l - ZendEngine2/tests/bug31341.phpt: - Fixed bug #31341 (escape on curly inconsistent) - - * (PHP_5_1) - NEWS - ext/standard/file.c - ext/standard/file.c - ext/standard/tests/file/fputcsv.phpt - ext/standard/tests/file/fputcsv.phpt: - Fixed fgetcsv() and fputcsv() inconsistency. - - * (PHP_5_0) - NEWS - NEWS - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l - ext/tokenizer/tokenizer.c - ext/tokenizer/tokenizer.c - ext/tokenizer/tokenizer.c: - Fixed bug #34782 (token_get_all() gives wrong result) - - * ZendEngine2/tests/bug29268.phpt - ZendEngine2/tests/bug29268.phpt: - - file bug29268.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug29268.phpt: - Fixed bug #29268 (__autoload() not called with Reflection->getClass()) - -2005-10-20 Jani Taskinen - - * NEWS: - Proper news - -2005-10-20 Rolland Santimano - - * ext/standard/php_string.h - ext/standard/string.c: - - Unicode impl of stristr() - -2005-10-20 Ilia Alshanetsky - - * ext/dom/tests/dom_xinclude.phpt - ext/zlib/tests/compress_zlib_wrapper.phpt: - MFB51: Fixed tests to work with ZTS builds - - * (PHP_5_1) - ext/dom/tests/dom_xinclude.phpt - ext/zlib/tests/compress_zlib_wrapper.phpt: - Fixed tests to work with ZTS builds - -2005-10-20 Antony Dovgal - - * ext/standard/filters.c - ext/standard/filters.c: - use proper constants - - * (PHP_5_0) - ext/iconv/iconv.c - ext/iconv/iconv.c: - MFH: use constants instead of their values - - * ext/iconv/iconv.c: - use constants instead of their values - - * ZendEngine2/zend_reflection_api.c: - copy/paste typo - -2005-10-20 Ilia Alshanetsky - - * tests/strings/001.phpt: - Fixed test for cygwin installs - -2005-10-20 Dmitry Stogov - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h: - Removed unnecesary local variable - - * ZendEngine2/tests/bug34893.phpt - ZendEngine2/tests/bug34893.phpt: - - file bug34893.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug34893.phpt: - Fixed bug #34893 (PHP5.1 overloading, Cannot access private property) - - * ZendEngine2/tests/bug34712.phpt - ZendEngine2/tests/bug34712.phpt: - - file bug34712.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/tests/bug34712.phpt: - Fixed bug #34712 (zend.ze1_compatibility_mode = on segfault) - - * ZendEngine2/tests/bug34767.phpt - ZendEngine2/tests/bug34767.phpt: - - file bug34767.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug34767.phpt: - Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects - correctly) - - * (PHP_5_1) - ZendEngine2/zend_compile.h: - Fixed bug #31177 (menory leaks and corruption because of incorrect - refcounting). - - * ZendEngine2/tests/bug31177-2.phpt - ZendEngine2/tests/bug31177-2.phpt: - - file bug31177-2.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_compile.h - ZendEngine2/zend_extensions.h - ZendEngine2/zend_extensions.h - ZendEngine2/zend_ptr_stack.h - ZendEngine2/zend_ptr_stack.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug31177-2.phpt: - Fixed bug #31177 (menory leaks and corruption because of incorrect - refcounting) - - * (PHP_5_0) - ZendEngine2/tests/bug34062.phpt: - Added forgotten test - - * (PHP_5_1) - ZendEngine2/tests/bug33512.phpt - ZendEngine2/tests/bug34062.phpt: - Added forgotten tests - - * ZendEngine2/tests/bug33512.phpt - ZendEngine2/tests/bug33512.phpt - ZendEngine2/tests/bug34062.phpt - ZendEngine2/tests/bug34062.phpt - ZendEngine2/tests/bug34062.phpt: - - Added forgotten tests - -2005-10-20 Greg Beaver - - * (PHP_5_1) - pear/CODING_STANDARDS - pear/PEAR.php - pear/README - pear/System.php - pear/catalog - pear/go-pear-list.php - pear/go-pear.bat - pear/install-pear.php - pear/make-pear-bundle.php - pear/package-Archive_Tar.xml - pear/package-Console_Getopt.xml - pear/package-PEAR.xml - pear/package.dtd - pear/template.spec - pear/Archive/Tar.php - pear/Archive/docs/Tar.txt - pear/Console/Getopt.php - pear/Console/tests/.cvsignore - pear/Console/tests/001-getopt.phpt - pear/OS/Guess.php - pear/PEAR/Autoloader.php - pear/PEAR/Builder.php - pear/PEAR/Command.php - pear/PEAR/Common.php - pear/PEAR/Config.php - pear/PEAR/Dependency.php - pear/PEAR/DependencyDB.php - pear/PEAR/Downloader.php - pear/PEAR/ErrorStack.php - pear/PEAR/Exception.php - pear/PEAR/Installer.php - pear/PEAR/Packager.php - pear/PEAR/Registry.php - pear/PEAR/Remote.php - pear/PEAR/RunTest.php - pear/PEAR/Command/Auth.php - pear/PEAR/Command/Build.php - pear/PEAR/Command/Common.php - pear/PEAR/Command/Config.php - pear/PEAR/Command/Install.php - pear/PEAR/Command/Mirror.php - pear/PEAR/Command/Package.php - pear/PEAR/Command/Registry.php - pear/PEAR/Command/Remote.php - pear/PEAR/Frontend/CLI.php - pear/docs/Archive_Tar.txt - pear/docs/rfc01_PEAR_pecl-binaries.txt - pear/docs/rfc01_PEAR_subpackages.txt - pear/packages/HTML_Template_IT-1.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/XML_RPC-1.4.0.tar - pear/scripts/.cvsignore - pear/scripts/pear.bat - pear/scripts/pear.sh - pear/scripts/pearcmd.php - pear/scripts/pearwin.php - pear/tests/.cvsignore - pear/tests/PEAR_test_mock_pearweb.php.inc - pear/tests/common_sortPkgDeps1_package.xml - pear/tests/common_sortPkgDeps2_package.xml - pear/tests/common_sortPkgDeps3_package.xml - pear/tests/common_sortPkgDeps4_package.xml - pear/tests/common_sortPkgDeps5_package.xml - pear/tests/common_sortPkgDeps6_package.xml - pear/tests/depnoreleases-1.0.tgz - pear/tests/depunstable-1.0.tgz - pear/tests/download_test.config.inc - pear/tests/download_test_classes.php.inc - pear/tests/merge.input - pear/tests/merge2.input - pear/tests/package-PEARtests.xml - pear/tests/pear1.phpt - pear/tests/pear2.phpt - pear/tests/pear_autoloader.phpt - pear/tests/pear_channelfile.phpt - pear/tests/pear_common_analyzeSC.phpt - pear/tests/pear_common_buildProvidesArray.phpt - pear/tests/pear_common_downloadHttp.phpt - pear/tests/pear_common_infoFromString.phpt - pear/tests/pear_common_sortPkgDeps.phpt - pear/tests/pear_common_validPackageVersion.phpt - pear/tests/pear_config.phpt - pear/tests/pear_config_1.1.phpt - pear/tests/pear_dependency_checkExtension.phpt - pear/tests/pear_dependency_checkPackage.phpt - pear/tests/pear_dependency_checkPackageUninstall.phpt - pear/tests/pear_downloader_invalid.phpt - pear/tests/pear_downloader_new.phpt - pear/tests/pear_downloader_old.phpt - pear/tests/pear_error.phpt - pear/tests/pear_error2.phpt - pear/tests/pear_error3.phpt - pear/tests/pear_error4.phpt - pear/tests/pear_installer1.phpt - pear/tests/pear_installer2.phpt - pear/tests/pear_installer3.phpt - pear/tests/pear_installer4.phpt - pear/tests/pear_installer5.phpt - pear/tests/pear_installer_installFile_channels.phpt - pear/tests/pear_installer_install_channels.phpt - pear/tests/pear_packager.phpt - pear/tests/pear_registry.phpt - pear/tests/pear_registry_1.1.phpt - pear/tests/pear_registry_inc.php.inc - pear/tests/pear_system.phpt - pear/tests/php.ini - pear/tests/php_dump.php.inc - pear/tests/pkg1-1.1.tgz - pear/tests/pkg1-2.0b1.tgz - pear/tests/pkg2-1.1.tgz - pear/tests/pkg3-1.1.tgz - pear/tests/pkg3-1.4.tgz - pear/tests/pkg4-1.1.tgz - pear/tests/pkg4AndAHalf-1.3.tgz - pear/tests/pkg5-1.1.tgz - pear/tests/stabilitytoolow-0.3.tgz - pear/tests/stabilitytoolow-0.5.tgz - pear/tests/stabilitytoolow-0.6beta.tgz - pear/tests/stabilitytoolow-1.0b1.tgz - pear/tests/stabilitytoolow-2.0a1.tgz - pear/tests/stabilitytoolow-2.0b1.tgz - pear/tests/stabilitytoolow-2.0dev.tgz - pear/tests/stabilitytoolow-3.0dev.tgz - pear/tests/system.input - pear/tests/testdownload.tgz - pear/tests/toonew.conf - pear/tests/user.input - pear/tests/user2.input - pear/tests/user3.input: - remove unused obsolete files from pear CVS - - -2005-10-20 John Coggeshall - - * Makefile.gcov - NEWS - configure.in - gen_php_cov: - Implementing C-level Code coverage (--enable-gcov). - - o Requires LTP 1.4+ and libgcov - -2005-10-19 Antony Dovgal - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - main/SAPI.c - sapi/cli/php_cli.c: - MFH: - fixed bug #29983 (PHP does not explicitly set mime type & charset) - + call sapi_deactivate() when called with -m switch - -2005-10-19 Ilia Alshanetsky - - * sapi/cli/php_cli.c: - Fixed -m memory leak - - * (PHP_4_4) - NEWS - NEWS - main/SAPI.c - main/SAPI.c: - MFH: Fixed bug #29983 (PHP does not explicitly set mime type & charset). - - * main/SAPI.c: - Fixed bug #29983 (PHP does not explicitly set mime type & charset). - -2005-10-19 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of str[c]spn() - -2005-10-19 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - MFH: Fixed bug #34623 (Crash in pdo_mysql on longtext fields). - -2005-10-19 Antony Dovgal - - * (PHP_5_0) - ext/standard/uniqid.c: - backport Ilia's last patch to 5.0 - -2005-10-19 Ilia Alshanetsky - - * (PHP_4_4) - ext/standard/uniqid.c - ext/standard/uniqid.c: - MFH: Change E_ERROR to E_WARNING when more_entropy flag is off on Cygwin. - - * ext/standard/uniqid.c: - Change E_ERROR to E_WARNING when more_entropy flag is off on Cygwin. - -2005-10-19 Dmitry Stogov - - * ZendEngine2/tests/bug33257.phpt - ZendEngine2/tests/bug33257.phpt - ZendEngine2/tests/bug33257.phpt: - Fixed test - -2005-10-19 Antony Dovgal - - * (PHP_5_1) - NEWS: - fix news entry - - * (PHP_5_0) - ext/standard/tests/array/array_sum.phpt: - fix test (it fails on 64-bit hosts because of too low memory_limit) - - * ext/oci8/php_oci8_int.h: - remove undef HAVE_OCI_STMT_PREPARE2 - -2005-10-18 Antony Dovgal - - * (PHP_5_1) - sapi/apache/mod_php5.c: - MFH: initialize SG(request_info).auth_digest - - * sapi/apache/mod_php5.c: - initialize SG(request_info).auth_digest to NULL and prevent segfaults - -2005-10-18 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - sapi/apache/mod_php5.c: - MFH: Fixed bug #34905 (Digest authentication does not work with Apache 1). - - * sapi/apache/mod_php5.c: - Fixed bug #34905 (Digest authentication does not work with Apache 1). - - * (PHP_5_1) - ext/sqlite/sqlite.c: - MFH: Do not set authorizer unless safe_mode or open_basedir are being used. - - * ext/sqlite/sqlite.c: - Do not set authorizer unless safe_mode or open_basedir are being used. - -2005-10-18 Derick Rethans - - * (PHP_5_1) - NEWS - ext/mime_magic/mime_magic.c: - - MFH: Fixed bug #33829 (mime_content_type() returns text/plain for gzip - and - bzip files). - -2005-10-18 Antony Dovgal - - * (PHP_5_0) - ext/sqlite/sqlite.c: - backport Ilia's fix for #34884 - - * (PHP_5_1) - ext/sqlite/sqlite.c: - unused var - - * ext/sqlite/sqlite.c: - nuke unused var and silence warnings - -2005-10-18 Ilia Alshanetsky - - * ext/sqlite/libsqlite/src/parse.c: - MFB51: Fixed bug #34899 (Fixed sqlite extension compile failure). - - * (PHP_5_1) - NEWS - ext/sqlite/libsqlite/src/parse.c: - Fixed bug #34899 (Fixed sqlite extension compile failure). - -2005-10-18 Antony Dovgal - - * (PHP_5_0) - ext/mysqli/php_mysqli.h - ext/mysqli/php_mysqli.h: - MFH: use php_error_docref() instead of php_error() everywhere - - * ext/mysqli/php_mysqli.h: - use php_error_docref() instead of php_error() everywhere - - * ext/oci8/oci8.c: - typo - -2005-10-18 Derick Rethans - - * ext/mime_magic/mime_magic.c: - - Allow mime_content_type() to work with even a slightly broken mime magic - file. - -2005-10-18 Antony Dovgal - - * ext/mime_magic/mime_magic.c - ext/mime_magic/phpmimemagic.h: - fix mime_magic problems with ZTS - - * (PHP_5_1) - NEWS - ext/mysqli/mysqli_fe.c: - MFH: fix bug #34902 (mysqli::character_set_name() - undefined method) - - * ext/mysqli/mysqli_fe.c: - fix bug #34902 (mysqli::character_set_name() - undefined method) - -2005-10-18 Ilia Alshanetsky - - * (PHP_5_1) - ext/sysvmsg/tests/001.phpt: - ZTS fixes - -2005-10-17 Ilia Alshanetsky - - * (PHP_5_1) - configure.in - main/php_version.h: - Back to dev - - * (PHP_5_1) - NEWS - configure.in - main/php_version.h: - 5.1.0RC3 - -2005-10-17 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of stripos() - - * ext/standard/string.c: - - Unicode impl of strrpos() - -2005-10-17 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/pspell/pspell.c - ext/pspell/pspell.c: - MFH: Properly fixed bug #34456 (original patch completely reverted). - - * ext/pspell/pspell.c: - Properly fixed bug #34456 (original patch completely reverted). - -2005-10-17 Derick Rethans - - * ext/standard/var.c - ext/standard/tests/array/007.phpt - ext/standard/tests/array/array_intersect_1.phpt - ext/standard/tests/array/var_export.phpt - ext/standard/tests/array/var_export3.phpt: - - MF51: Fixed bug #29361 (var_export() producing invalid code). - - * ext/standard/tests/array/var_export3.phpt - ext/standard/tests/array/var_export3.phpt: - - file var_export3.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ext/standard/var.c - ext/standard/tests/array/007.phpt - ext/standard/tests/array/array_intersect_1.phpt - ext/standard/tests/array/var_export.phpt: - - Fixed bug #29361 (var_export() producing invalid code). (Derick) - -2005-10-17 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/sqlite/sqlite.c: - MFH: Fixed bug #34884 (Possible crash in ext/sqlite when sqlite.assoc_case - is being used). - - * ext/sqlite/sqlite.c: - Fixed bug #34884 (Possible crash in ext/sqlite when sqlite.assoc_case is - being used). - -2005-10-17 Dmitry Stogov - - * (PHP_5_1) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_parser.y - ZendEngine2/tests/bug34873.phpt: - Fixed bug #34873 (Segmentation Fault on foreach in object) - -2005-10-17 Derick Rethans - - * ZendEngine2/zend_compile.c - tests/lang/type_hints_002.phpt - tests/lang/type_hints_003.phpt: - - Make sure that typehints for classes can only accept "= NULL" as default - value. - -2005-10-17 Ilia Alshanetsky - - * (PHP_4_4) - ext/curl/curl.c - ext/curl/interface.c - ext/curl/interface.c: - MFH: Further URL validations in safe_mode/open_basedir configs. - - * ext/curl/interface.c: - Further URL validations in safe_mode/open_basedir configs. - -2005-10-16 Jani Taskinen - - * Makefile.frag - ext/sqlite/Makefile.frag - ext/standard/Makefile.frag: - - Silence unnecessary output - - * (PHP_5_1) - NEWS: - NEWS file is about changes between releases. (RCs are not releases..) - -2005-10-16 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Add ability to access private properties of base classes - - Add ability to specify fully qualified name for properties - - ReflectionClass::getInterfaces89 now returns associative array - -2005-10-15 Derick Rethans - - * (PHP_5_1) - NEWS: - - Fixed timezone guessing on Windows. (Derick, Nuno) - - * NEWS - ZendEngine2/zend_compile.c: - - Changed type hints so that they take "= NULL" as default value. - - * ext/standard/string.c: - - Fixed folding markers. - -2005-10-15 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_api.c: - Fixed an error in mysqli_fetch_fields (returned NULL instead of an - array when row number > field_count). (Georg) - - * (PHP_5_1) - NEWS - ext/mysqli/mysqli_api.c: - fixed an error in mysqli_fetch_fields (function returns NULL instead of - array - when row_number > num_fields). - Thanks to Marc Deslisle and phpMyAdmin team for the report. - -2005-10-14 Antony Dovgal - - * ZendEngine2/tests/bug34873.phpt - ZendEngine2/tests/bug34873.phpt - ZendEngine2/tests/bug34873.phpt: - 1.1.4; - add test for bug #34873 - -2005-10-14 Ilia Alshanetsky - - * ext/mime_magic/mime_magic.c: - MFB51: ZTS fix - - * (PHP_5_1) - ext/mime_magic/mime_magic.c: - ZTS fix - - * (PHP_5_1) - NEWS - configure.in: - Back to dev - - * (PHP_5_1) - NEWS - configure.in: - Prepare for 5.1RC2 - -2005-10-13 Ilia Alshanetsky - - * ext/mysqli/tests/bug33491.phpt: - Fixed test failure - -2005-10-13 Rob Richards - - * acinclude.m4: - bump libxml min version to 2.6.11 - -2005-10-13 Jani Taskinen - - * ext/iconv/config.m4: - proper quoting, breaking, etc. - -2005-10-13 Antony Dovgal - - * (PHP_5_0) - NEWS - NEWS - ext/iconv/config.m4 - ext/iconv/config.m4: - MFH: fix #34856 (configure fails to detect libiconv's type) - - * ext/iconv/config.m4: - correct it one more time (grrr) - - * ext/iconv/config.m4: - correct the fix - - * ext/iconv/config.m4: - fix #34856 (configure fails to detect libiconv's type) - - * (PHP_5_0) - NEWS - NEWS - ext/interbase/ibase_service.c - ext/interbase/ibase_service.c: - MFH: fix #34855 (ibase_service_attach() segfault on AMD64) - - * ext/interbase/ibase_service.c: - fix #34855 (ibase_service_attach() segfault on AMD64) - -2005-10-13 Jani Taskinen - - * (PHP_4_4) - NEWS - sapi/cli/Makefile.frag - scripts/Makefile.frag: - MFH: - Fixed bug #34850 (--program-suffix and --program-prefix not included - in man page names) - - * sapi/cli/Makefile.frag - scripts/Makefile.frag: - MF51:- Fixed bug #34850 (--program-suffix and --program-prefix not included - in man page names) - - * (PHP_5_1) - NEWS - sapi/cli/Makefile.frag - scripts/Makefile.frag: - - Fixed bug #34850 (--program-suffix and --program-prefix not included in - man page names) - - * (PHP_5_1) - NEWS: - reorder - -2005-10-13 Antony Dovgal - - * (PHP_5_1) - ZendEngine2/zend_API.c: - ws fix - -2005-10-13 Derick Rethans - - * (PHP_4_4) - Zend/zend_execute.c: - - This is an integer in PHP 4, and not a zval* like in PHP 5.0. - -2005-10-12 Marcus Boerger - - * ext/pcre/php_pcre.c - ext/pcre/php_pcre.h: - - Drop one cache related function which is not really neccessary - - * ext/pcre/php_pcre.c - ext/pcre/php_pcre.h: - - Add/expose function to compile and access pcre_cache_entry structs - -2005-10-12 Antony Dovgal - - * sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MF51: fix bug #34581 (crash with mod_rewrite) - - * (PHP_5_1) - NEWS - sapi/apache2handler/sapi_apache2.c: - fix bug #34581 (crash with mod_rewrite) - -2005-10-12 Jani Taskinen - - * (PHP_5_1) - pear/.cvsignore: - missing entry - -2005-10-12 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - MFH: Fixed bug #34758 (PDO_DBLIB did not implement rowCount()). - - * (PHP_4_4) - ext/standard/ftp_fopen_wrapper.c: - Fixed compiler failure - -2005-10-12 Rob Richards - - * ext/xml/compat.c: - use spprintf where appropriate - -2005-10-12 Antony Dovgal - - * ext/mysqli/mysqli.c - ext/mysqli/mysqli_warning.c: - MF51: fix TS build - - * (PHP_5_1) - ext/mysqli/mysqli.c - ext/mysqli/mysqli_warning.c: - fix TS build - -2005-10-12 Derick Rethans - - * (PHP_4_4) - NEWS - Zend/zend_execute.c: - - MF50: Fixed access to an uninitialised variable. - -2005-10-12 Dmitry Stogov - - * ext/standard/string.c: - Fixed unicode support for strip_tags() - - * ZendEngine2/zend.c: - Unicode support - -2005-10-12 Rob Richards - - * (PHP_5_1) - NEWS: - BFN - - * (PHP_5_1) - ext/xml/compat.c - ext/xml/xml.c: - MFH: Fixed Bug #27908 (xml default_handlers not being called) - Fix memleak when entitydecls are parsed - remove old ifdefs - - * ext/xml/compat.c - ext/xml/xml.c: - Fixed Bug #27908 (xml default_handlers not being called) - Fix memleak when entitydecls are parsed - remove old ifdefs - -2005-10-11 Jani Taskinen - - * sapi/cli/php_cli.c: - - Removed confusing dot. - - * ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt: - fix test - -2005-10-11 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/pgsql/pgsql.c: - MFH: Fixed bug #33167 (Possible crash inside pg_fetch_array()). - - * ext/pgsql/pgsql.c: - Fixed bug #33167 (Possible crash inside pg_fetch_array()). - - * (PHP_4_4) - NEWS - NEWS - ext/standard/ftp_fopen_wrapper.c - ext/standard/ftp_fopen_wrapper.c: - MFH: Fixed bug #34742 (ftp wrapper failures caused from segmented command - transfer). - - * ext/standard/ftp_fopen_wrapper.c: - Fixed bug #34742 (ftp wrapper failures caused from segmented command - transfer). - -2005-10-11 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/iconv/iconv.c - ext/iconv/iconv.c: - MF51: fix #34757 (iconv_substr() gives "Unknown error" when offset > string - length) - - * (PHP_5_1) - NEWS - ext/iconv/iconv.c: - fix #34757 (iconv_substr() gives "Unknown error" when offset > string - length) - -2005-10-11 Dmitry Stogov - - * ZendEngine2/zend.h: - Fixed compilation on Windows - - * (PHP_5_1) - NEWS: - Fixed bug #32455 (wrong setting property to unset value) - - * (PHP_4_4) - NEWS - NEWS - NEWS - ext/pcre/php_pcre.c - ext/pcre/php_pcre.c - ext/pcre/php_pcre.c - ext/pcre/php_pcre.c - ext/pcre/tests/bug34790.phpt - ext/pcre/tests/bug34790.phpt - ext/pcre/tests/bug34790.phpt: - Fixed bug #34790 (preg_match_all(), named capturing groups, variable - assignment/return => crash) - - * ext/pcre/tests/bug34790.phpt - ext/pcre/tests/bug34790.phpt - ext/pcre/tests/bug34790.phpt - ext/pcre/tests/bug34790.phpt: - 1.1.4; 1.1.6; - Fixed bug #34790 (preg_match_all(), named capturing groups, variable - assignment/return => crash) - -2005-10-10 Antony Dovgal - - * ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_nonapi.c: - MF51: use proper macros and vars instead of strlen() - - * ext/mysqli/mysqli.c - ext/mysqli/mysqli_warning.c: - MF51: fix #34818 - - * (PHP_5_1) - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_nonapi.c: - use proper macros and vars instead of strlen() - - * (PHP_5_1) - NEWS - ext/mysqli/mysqli.c - ext/mysqli/mysqli_warning.c: - fix #34818 (new mysqli_stmt() and several others crash if the first - parameter is not a valid mysqli_link) - -2005-10-10 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - MFH: Fixed bug #34809 (FETCH_INTO in PDO crashes without a destination - object). - - * (PHP_5_1) - NEWS: - bug fixing news - - * (PHP_5_1) - ZendEngine2/zend_objects_API.c: - MFH: Fixed bug #34802 (Fixed crash on object instantiation failure). - - * ZendEngine2/zend_objects_API.c: - Fixed bug #34802 (Fixed crash on object instantiation failure). - -2005-10-10 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h - ext/mysqli/php_mysqli.h - ext/mysqli/tests/bug34810.phpt - ext/mysqli/tests/bug34810.phpt: - MF51: fix #34810 (mysqli::init() and others use wrong $this pointer without - checks) - - * ext/mysqli/tests/bug34810.phpt - ext/mysqli/tests/bug34810.phpt - ext/mysqli/tests/bug34810.phpt: - 1.1.4; - file bug34810.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h: - fix #34810 (mysqli::init() and others use wrong $this pointer without - checks) - -2005-10-10 Dmitry Stogov - - * ZendEngine2/tests/bug34786.phpt - ZendEngine2/tests/bug34786.phpt: - - file bug34786.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug34786.phpt: - Fixed bug #34786 (2 @ results in change to error_reporting() to random - value) - -2005-10-10 Antony Dovgal - - * ext/oci8/package.xml: - update changelog - - * (PHP_4_4) - NEWS - NEWS - NEWS - NEWS: - BFN - - * (PHP_5_0) - ext/oci8/oci8.c - ext/oci8/oci8.c: - MF44: fix #33383 (crash when retrieving empty LOBs) - - * (PHP_4_4) - ext/oci8/oci8.c: - fix #33383 (crash when retrieving empty LOBs) - -2005-10-10 Jani Taskinen - - * ext/mssql/config.m4 - ext/mssql/config.m4: - Fix copypastetypo - -2005-10-10 Antony Dovgal - - * ext/oci8/oci8.c - ext/oci8/oci8_interface.c - ext/oci8/oci8_lob.c: - fix #33383 (crash when retrieving empty BLOBs) - -2005-10-10 Jani Taskinen - - * ext/mssql/config.m4: - - Fix build for distros where the header files are under */include/freetds/ - -2005-10-10 Dmitry Stogov - - * ZendEngine2/tests/bug34467.phpt - ZendEngine2/tests/bug34467.phpt: - - file bug34467.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug34467.phpt: - Fixed bug #34467 (foreach + __get + __set incosistency) - -2005-10-10 Marcus Boerger - - * ext/exif/exif.c: - - Fix logic - -2005-10-10 Jani Taskinen - - * ext/exif/tests/bug34704.phpt: - fix test - - * (PHP_5_1) - ext/exif/tests/bug34704.phpt: - extra spaces removed - -2005-10-10 Rob Richards - - * (PHP_5_0) - main/main.c - main/main.c: - MFH: PHP_CONFIG_FILE_PATH needs to use strlen() due to Win build - - * main/main.c: - PHP_CONFIG_FILE_PATH needs to use strlen() due to Win build - -2005-10-09 Jani Taskinen - - * ext/ftp/config.m4: - MFB - - * (PHP_5_1) - ext/ftp/config.m4: - typofix - - * (PHP_5_1) - NEWS: - BFN - - * (PHP_5_1) - NEWS - ext/ftp/config.m4: - MFH: - Fixed bug #34796 (missing SSL linking in ext/ftp when configured as - shared). - - * ext/ftp/config.m4: - Fix properly - - * ext/ftp/config.m4: - - Fixed bug #34796 (missing SSL linking in ext/ftp when configured as - shared) - -2005-10-09 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - MFH: Fixed bug #34777 (Crash in dblib when fetching non-existent error - info). - -2005-10-09 Andrey Hristov - - * ext/mysqli/mysqli_api.c: - MFB - -2005-10-09 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Add 'overwrites' info to method dump - -2005-10-09 Andrey Hristov - - * (PHP_5_1) - ext/mysqli/mysqli_api.c: - add charsetnr and length to the object returned. this is kind of bug - because fetch_fields() and fetch_field() return that info and - fetch_field_direct() does not - -2005-10-09 Marcus Boerger - - * ext/pgsql/tests/01createdb.phpt: - - Apply workaround for test until someone fixes the issue (which is - unrelated to pg_*()) - - * (PHP_4_4) - ext/pgsql/tests/80_bug32223.phpt - ext/pgsql/tests/80_bug32223.phpt: - - MFH Make test check for PlPgSQL before using it - - * ext/pgsql/tests/80_bug32223.phpt: - - Make test check for PlPgSQL before using it - - * ext/pgsql/tests/80_bug32223.phpt - ext/pgsql/tests/80_bug32223.phpt - ext/pgsql/tests/80_bug32223.phpt: - 1.1.4; - - Add new test - - * (PHP_4_4) - NEWS - NEWS - NEWS - ext/exif/exif.c - ext/exif/exif.c - ext/exif/exif.c - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt: - - MFH Bugfix #34704 (Infinite recursion due to corrupt JPEG) - - * ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.jpg - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt - ext/exif/tests/bug34704.phpt: - 1.1.4; 1.1.6; - Bugfix #34704 (Infinite recursion due to corrupt JPEG) (Tim Starling) - - * ext/exif/exif.c: - Bugfix #34704 (Infinite recursion due to corrupt JPEG) (Tim Starling) - -2005-10-09 Dmitry Stogov - - * (PHP_5_0) - NEWS - NEWS: - Fixed bug #34788 (SOAP Client not applying correct namespace to generated - values) - -2005-10-09 Pierre-Alain Joye - - * (PHP_5_1) - ext/gd/libgd/gd.h - ext/gd/libgd/gdtables.c - ext/gd/libgd/wbmp.h: - -fix build as shared or separate from main build (bfrance) - -2005-10-09 Dmitry Stogov - - * (PHP_5_0) - NEWS - NEWS: - Fixed bug #34787 (SOAP Client not handling boolean types correctly) - -2005-10-09 Georg Richter - - * (PHP_5_1) - NEWS: - added Bugfix for #34785 - -2005-10-08 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Add ReflectionMethod::getPrototype() - - Add some usefull information to the method dump - . From where it was inherited - . The prototype - -2005-10-08 Pierre-Alain Joye - - * ext/gd/gd.c - ext/gd/gd_ctx.c: - - add compression mode argument to imagepng - (MFH to 5.1?) - -2005-10-08 Georg Richter - - * ext/mysqli/tests/bug34785.phpt - ext/mysqli/tests/bug34785.phpt: - - file bug34785.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - ext/mysqli/mysqli.c - ext/mysqli/mysqli_fe.c - ext/mysqli/tests/003.phpt - ext/mysqli/tests/006.phpt - ext/mysqli/tests/007.phpt - ext/mysqli/tests/008.phpt - ext/mysqli/tests/009.phpt - ext/mysqli/tests/010.phpt - ext/mysqli/tests/020.phpt - ext/mysqli/tests/023.phpt - ext/mysqli/tests/024.phpt - ext/mysqli/tests/025.phpt - ext/mysqli/tests/026.phpt - ext/mysqli/tests/042.phpt - ext/mysqli/tests/060.phpt - ext/mysqli/tests/065.phpt - ext/mysqli/tests/bug32405.phpt: - fix for bug 34785: - added support for parent::__construct (mysqli_statement and - mysqli_resultset) - fixed failed testcases when sql_mode is in effect - -2005-10-08 Derick Rethans - - * (PHP_5_1) - NEWS: - - MFH: Fixed bug #34676: missing support for strtotime("midnight") and - strtotime("noon"). - -2005-10-07 Marcus Boerger - - * (PHP_5_1) - NEWS: - - BFN - -2005-10-07 Dmitry Stogov - - * ZendEngine2/zend_operators.c: - Fixed memory leak - -2005-10-07 Derick Rethans - - * (PHP_4_4) - NEWS - configure.in - main/php_version.h: - - Back to dev. - - * (PHP_4_4) - NEWS - configure.in - main/php_version.h: - - Go with PHP 4.4.1RC1. - - * (PHP_4_4) - Zend/zend_compile.c: - - Fixed uninitialized value problem when an empty file is included. - - * (PHP_5_1) - NEWS: - - MFH: Fixed bug #34771 (strtotime() fails with 1-12am/pm). - -2005-10-07 Marcus Boerger - - * main/streams/memory.c: - - C vs. C++ fix - -2005-10-07 Jani Taskinen - - * (PHP_5_1) - NEWS: - maybe this month.. - -2005-10-06 Marcus Boerger - - * (PHP_5_1) - ZendEngine2/zend_reflection_api.c: - - MFH ReflectionClass::isInstantiable and abstract classes - -2005-10-06 Frank M. Kromann - - * ext/standard/php_string.h: - Fix Win32 build by adding missing function declaration. - -2005-10-06 Marcus Boerger - - * (PHP_4_4) - main/memory_streams.c - main/streams/memory.c - main/streams/memory.c: - - MFH Fix issue (endless loop) with temp/memory streams - - * main/streams/memory.c: - - Fix issue (endless loop) with temp/memory streams - -2005-10-06 Jani Taskinen - - * (PHP_5_1) - NEWS: - BFN - -2005-10-06 Johannes Schlüter - - * (PHP_4_4) - NEWS - NEWS - sapi/cgi/cgi_main.c - sapi/cgi/cgi_main.c - sapi/cgi/cgi_main.c - sapi/cli/php_cli.c - sapi/cli/php_cli.c - sapi/cli/php_cli.c: - - MFH: Fix #34557 php -m exits with "error" 1 - -2005-10-06 Ilia Alshanetsky - - * ext/curl/interface.c - ext/gd/gd.c - ext/gd/gd_ctx.c: - Added missing safe_mode checks. - -2005-10-06 Johannes Schlüter - - * sapi/cgi/cgi_main.c - sapi/cli/php_cli.c: - - Fix #34557 php -m exits with "error" 1 - -2005-10-06 Marcus Boerger - - * ext/mhash/tests/003.phpt: - - Fix test in unicode mode - - * Makefile.global: - - Use run-tests.ph -u rather then defining the ini settings one by one - - * run-tests.php: - - Show whether we execute unicode or native tests - - * ZendEngine2/zend_object_handlers.c: - - BC: php objects convert to int/double 1 with notice - - * ZendEngine2/tests/bug32322.phpt: - - Show the test finishes/dos2unix - - * ZendEngine2/tests/bug28444.phpt - ZendEngine2/tests/bug30791.phpt - ZendEngine2/tests/bug32290.phpt - ZendEngine2/tests/bug32290.phpt - tests/classes/tostring_001.phpt: - - Fix test - - * ZendEngine2/tests/bug26166.phpt: - - Fix test - - Convert to unicode - -2005-10-06 Rob Richards - - * ext/wddx/php_wddx_api.h - ext/wddx/wddx.c: - use sizeof instead of define - -2005-10-06 Marcus Boerger - - * ZendEngine2/zend_object_handlers.c: - - Any php object converts to boolean as true - - * (PHP_5_1) - tests/classes/interfaces_003.phpt - tests/classes/tostring_003.phpt: - - Add new test - - * tests/classes/interfaces_003.phpt - tests/classes/interfaces_003.phpt: - - - Add new test - -2005-10-06 Derick Rethans - - * (PHP_5_1) - ext/standard/config.w32 - ext/wddx/config.w32: - - MFH: Fixed Windows build (patch by Mike) - - * ext/standard/config.w32 - ext/wddx/config.w32: - - Fixed Windows build (patch by Mike) - -2005-10-06 Marcus Boerger - - * (PHP_5_1) - run-tests.php: - - MFH (faillog, streams, counting, .......) - - * run-tests.php: - - WS - - * run-tests.php: - - Fix redir tests, test count, faillog - -2005-10-06 Dmitry Stogov - - * ZendEngine2/zend_API.c: - Cleanup - - * ext/simplexml/simplexml.c: - Fixed compilation error - -2005-10-06 Marcus Boerger - - * run-tests.php: - - MFB use new functions - - * run-tests.php: - - Fix faillog and make it understand/handle redirected tests - -2005-10-05 Rob Richards - - * (PHP_5_1) - ext/wddx/php_wddx_api.h - ext/wddx/wddx.c: - MFH: fix buffer lengths passed to snprintf - - * ext/wddx/php_wddx_api.h - ext/wddx/wddx.c: - fix buffer lengths passed to snprintf - -2005-10-05 Antony Dovgal - - * main/streams/streams.c: - fix fwrite() and fgets() in unicode mode - -2005-10-05 Marcus Boerger - - * ext/simplexml/simplexml.c: - - Update cast_object handlers - - * ZendEngine2/zend.c - ZendEngine2/zend_API.c - ZendEngine2/zend_execute.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/zend_operators.c: - - Have __toString() be called if available in all places an object is used - as a string. - - * ZendEngine2/zend_interfaces.c: - - Fix warnings - -2005-10-05 Antony Dovgal - - * main/streams/streams.c: - fix bugs #34743 & #34118 (fseek/fread unicode related problems in HEAD) - patch by Alex - -2005-10-05 Rob Richards - - * ext/xmlrpc/xmlrpc-epi-php.c - ext/xmlrpc/xmlrpc-epi-php.c - ext/xmlrpc/xmlrpc-epi-php.c: - fix ZTS build - -2005-10-05 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/curl/curl.c - ext/curl/interface.c - ext/curl/interface.c: - MFH: Missing safe_mode/open_basedir checks for file uploads. - - * ext/curl/interface.c: - Missing safe_mode/open_basedir checks for file uploads. - -2005-10-05 Rolland Santimano - - * ext/standard/string.c: - - strip_tags(): some fixes, still AWiP - -2005-10-05 Antony Dovgal - - * ext/standard/tests/array/bug30833.phpt: - fix test - -2005-10-05 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MFH: Fixed possible INI setting leak via virtual() in Apache 2 sapi. - -2005-10-04 Antony Dovgal - - * (PHP_5_0) - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c: - MFH: fix #34723 (array_count_values() strips leading zeroes) - - * ext/standard/array.c: - fix #34723 (array_count_values() strips leading zeroes) - - * (PHP_5_0) - ext/oci8/oci8.c - ext/oci8/oci8.c: - fix #34731, patch by novicky at aarongroup dot cz - - * (PHP_4_4) - NEWS - ext/xmlrpc/xmlrpc-epi-php.c - ext/xmlrpc/xmlrpc-epi-php.c: - MFB5.1: fix #32179 (xmlrpc_encode() segfaults with recursive references) - - * (PHP_5_0) - NEWS - ext/xmlrpc/xmlrpc-epi-php.c: - MHB5.1: fix #32179 (xmlrpc_encode() segfaults with recursive references) - - * (PHP_5_1) - NEWS - ext/xmlrpc/xmlrpc-epi-php.c: - fix #32179 (xmlrpc_encode() segfaults with recursive references) - -2005-10-04 Dmitry Stogov - - * ext/standard/tests/strings/bug21453.phpt: - Unicode support - - * ext/standard/string.c: - Fixed compilation error (gcc-4). - -2005-10-03 Marcus Boerger - - * ZendEngine2/zend_execute.h: - - In a conditional statement "a ? b ? c", a and b MUST have the same type - - * ZendEngine2/zend_API.c: - - Fix ZTS Build - - * run-tests.php: - - Add easy way to test in unicode mode - -2005-10-03 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of strip_tags() - -2005-10-03 Marcus Boerger - - * (PHP_5_1) - ext/simplexml/php_simplexml_exports.h - ext/simplexml/simplexml.c: - - MFH Really allow SXE being shared by not using anything from it directly - in SPL - - * ext/simplexml/php_simplexml_exports.h - ext/simplexml/simplexml.c: - - Really allow SXE being shared by not using anything from it directly in - SPL - -2005-10-03 Ilia Alshanetsky - - * (PHP_4_4) - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c: - MFH: GLOBALS protection for extract() function. - - * ext/standard/array.c: - GLOBALS protection for extract() function. - -2005-10-03 Antony Dovgal - - * ext/oci8/package.xml: - update changelog - - * ext/oci8/oci8_collection.c - ext/oci8/oci8_lob.c - ext/oci8/oci8_statement.c: - fix PECL bug #5571 (oci_new_connect() not closed by oci_close()) - -2005-10-03 Marcus Boerger - - * ZendEngine2/zend_interfaces.c: - - Allow uncached global functions too - - * ZendEngine2/zend_API.h: - - Add propper casting - -2005-10-03 Jani Taskinen - - * NEWS: - fix BLOAT news - -2005-10-03 Johannes Schlüter - - * NEWS - sapi/cli/php_cli.c: - - Add --rclass and --rextension arguments to CLI - -2005-10-03 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.h: - - Make reflection class pointers available for others - -2005-10-03 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - Fixed memory leak - - * (PHP_5_0) - NEWS - NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/tests/bug34678.phpt - ZendEngine2/tests/bug34678.phpt: - Fixed bug #34678 (__call(), is_callable() and static methods) - - * ZendEngine2/tests/bug34678.phpt - ZendEngine2/tests/bug34678.phpt - ZendEngine2/tests/bug34678.phpt: - 1.1.4; - Fixed bug #34678 (__call(), is_callable() and static methods) - - * (PHP_5_1) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug34358.phpt: - Fixed bug #34358 (Fatal error: Cannot re-assign $this) - - * ZendEngine2/tests/bug34358.phpt - ZendEngine2/tests/bug34358.phpt: - - Fixed bug #34358 (Fatal error: Cannot re-assign $this) - -2005-10-03 Rolland Santimano - - * unicode-progress.txt: - levenshtein(), similar_text() - - * ext/standard/string.c: - - Unicode impl of similar_text() - -2005-10-02 Pierre-Alain Joye - - * ext/gd/config.w32: - - remove gdttf - - * ext/gd/gd.c - ext/gd/gdttf.c - ext/gd/gdttf.h: - - ft1 support remove, #2, gdttf.* - - * ext/gd/config.m4 - ext/gd/gd.c - ext/gd/gdcache.c - ext/gd/php_gd.h - ext/gd/libgd/gdcache.c: - - drop freetype1 support - -2005-10-02 Rob Richards - - * (PHP_4_4) - main/php_variables.c: - fix build - missing closing parenthesis - -2005-10-02 Andrei Zmievski - - * ZendEngine2/zend_operators.h: - -** empty log message *** - -2005-10-01 Greg Beaver - - * (PHP_5_1) - pear/Makefile.frag: - set error_reporting to E_ALL in Makefile.frag - -2005-10-01 Marcus Boerger - - * ext/simplexml/config.m4: - - MFB spl/simplexml integration (when sxe is shared) - - * (PHP_5_1) - ext/simplexml/config.m4: - - Allow xpl/simplexml integration with simplexml being built shared - -2005-10-01 Jani Taskinen - - * (PHP_5_1) - NEWS: - fix bfn - -2005-09-30 Pierre-Alain Joye - - * (PHP_5_1) - NEWS: - - entry for #33125 - - * ext/gd/libgd/gd.c: - - MFB: #33125, alpha emulation broken - - * (PHP_5_1) - ext/gd/libgd/gd.c: - - #33125, imagecopymergegray produces mosaic rainbow effect - at some point the alpha emulation formula has been broken - restored. - -2005-09-30 Marcus Boerger - - * (PHP_5_1) - pear/Makefile.frag: - - Try to fetch the necessary file via wget - -2005-09-30 Rolland Santimano - - * ext/standard/string.c: - - substr_replace(): call correct funcn for string conversion - -2005-09-30 Jani Taskinen - - * (PHP_5_1) - NEWS: - reorder,reword,merge - -2005-09-30 Rolland Santimano - - * ext/standard/levenshtein.c: - - Unicode impl of levenshtein() - -2005-09-29 Ilia Alshanetsky - - * (PHP_5_1) - ext/standard/basic_functions.c: - Removed unnecessary component that accidentally snuck-in - - * (PHP_4_4) - NEWS - NEWS - ext/standard/basic_functions.c - ext/standard/basic_functions.c - ext/standard/basic_functions.c: - MFH: - Fixed possible crash and/or memory corruption in - import_request_variables() - Fixed potential GLOBALS overwrite via import_request_variables(). - - * ext/standard/basic_functions.c: - Fixed possible crash and/or memory corruption in import_request_variables() - Fixed potential GLOBALS overwrite via import_request_variables(). - -2005-09-29 Rolland Santimano - - * ext/standard/basic_functions.h - ext/standard/string.c: - - Unicode impl of strtok() - - * ext/standard/string.c: - - Updated addslashes(): add codepoints directly rather than with - zend_codepoint_to_uchar() - -2005-09-28 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/standard/string.c - main/php_variables.c: - MFH: Fixed possible GLOBALS variable override when register_globals are ON. - MFH: Fixed possible register_globals toggle via parse_str(). - MFH: Fixed negative offset handling in substr_compare() function. - - * (PHP_4_4) - NEWS - ext/standard/string.c - ext/standard/string.c - main/php_variables.c - main/php_variables.c: - MFH: Fixed possible GLOBALS variable override when register_globals are ON. - MFH: Fixed possible register_globals toggle via parse_str(). - -2005-09-28 Edin Kadribasic - - * ext/oci8/oci8.dsp: - Update php4 build file, compile against istantclient - -2005-09-28 Ilia Alshanetsky - - * ext/standard/string.c - main/php_variables.c: - Fixed possible GLOBALS variable override when register_globals are ON. - Fixed possible register_globals toggle via parse_str(). - -2005-09-28 Rolland Santimano - - * ext/standard/string.c: - - Updated substr_replace() to use: - - zend_get_unified_string_type()/convert_to_explicit_type() for type - conversion - - u_countChar32() for counting codepoints - - * unicode-progress.txt: - {add,strip}slashes() - -2005-09-28 Dmitry Stogov - - * (PHP_5_0) - NEWS - NEWS: - Fixed bug #34453 (parsing http://www.w3.org/2001/xml.xsd exception) - -2005-09-28 Rolland Santimano - - * ext/standard/php_string.h - ext/standard/string.c: - - Unicode impl of {add,strip}slashes() - -2005-09-27 Andrei Zmievski - - * README.UNICODE-UPGRADES: - strrev() walkthrough - -2005-09-27 Dmitry Stogov - - * ZendEngine2/tests/bug34617.phpt - ZendEngine2/tests/bug34617.phpt - ZendEngine2/tests/bug34617.phpt: - 1.1.4; - file bug34617.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - NEWS - ZendEngine2/zend_objects_API.c - ZendEngine2/zend_objects_API.c - ZendEngine2/zend_objects_API.c - ZendEngine2/tests/bug34617.phpt - ZendEngine2/tests/bug34617.phpt: - Fixed bug #34617 (zend_deactivate: objects_store used after - zend_objects_store_destroy is called) - -2005-09-27 Andrei Zmievski - - * main/rfc1867.c: - Unicode fixes. - -2005-09-27 Dmitry Stogov - - * (PHP_5_0) - NEWS - NEWS: - Fixed bug #34643 (wsdl default value has no effect) - -2005-09-27 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - main/fopen_wrappers.c - main/fopen_wrappers.c - main/fopen_wrappers.c: - MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter). - - * main/fopen_wrappers.c: - Fixed bug #32937 (open_basedir looses trailing / in the limiter). - - Patch by Adam Conrad - -2005-09-27 Marcus Boerger - - * tests/classes/tostring_001.phpt: - - Need to rename in expectations, too - - * tests/classes/tostring.phpt - tests/classes/tostring_001.phpt: - - Rename test to be consistent - - * tests/classes/tostring_002.phpt - tests/classes/tostring_003.phpt: - - Add new tests - - * NEWS - NEWS: - - BFN - -2005-09-27 Dmitry Stogov - - * NEWS - ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug26166.phpt - tests/classes/tostring.phpt: - Changed __toString() behavior to call it in all necessary places - -2005-09-26 Ilia Alshanetsky - - * ext/standard/string.c: - Allow substr_compare() to take a negative offset to facilitate start of the - comparison from the end of string. - - * (PHP_5_1) - NEWS: - MFH: upgraded bundled libsqlite3 to version 3.2.7 - -2005-09-26 Antony Dovgal - - * ext/oci8/oci8_collection.c - ext/oci8/oci8_statement.c - ext/oci8/php_oci8_int.h: - the last 64bit fix - -2005-09-26 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - ext/ctype/ctype.c - ext/ctype/tests/bug34645.phpt: - MFH: Fixed bug #34645 (ctype corrupts memory when validating large - numbers). - - * (PHP_5_1) - NEWS: - Bug fixing news - - * (PHP_5_1) - ext/ctype/ctype.c - ext/ctype/tests/bug34645.phpt - ext/ctype/tests/bug34645.phpt - ext/ctype/tests/bug34645.phpt: - Fixed bug #34645 (ctype corrupts memory when validating large numbers). - -2005-09-25 Antony Dovgal - - * ext/oci8/php_oci8_int.h: - 2nd part of previous fix - - * ext/oci8/oci8_interface.c - ext/oci8/oci8_lob.c: - more 64-bit fixes - - * ext/oci8/oci8.c - ext/oci8/oci8_interface.c - ext/oci8/php_oci8_int.h: - fix 64bit issues caused by wrong "long" usage - - * ext/oci8/oci8.c: - fix arguments-by-ref with 5.x (problem appeared after the last 4.x compat - patch) - make sure username_len is always initialized - -2005-09-25 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - Bug fixing news - - * (PHP_5_1) - ext/standard/filters.c: - MFH: Fixed bug #34321 (Possible crash in filter code). - - * ext/standard/filters.c: - Fixed bug #34321 (Possible crash in filter code). - -2005-09-25 Pierre-Alain Joye - - * (PHP_4_4) - ext/gd/libgd/gd_gif_in.c: - - MFH #33220, infinite loop while loading invalid GIF (nlopees) - NB: It's getting really annoying to apply patches to all these branches - Can we no define 4.x and 5.0.x as dead for 99.99% of the fixes? - -2005-09-24 Jani Taskinen - - * (PHP_5_1) - NEWS: - Documentation belongs elsewhere - -2005-09-24 Edin Kadribasic - - * ext/standard/exec.h: - MFB: Allow php extensions to use php_escape_shell_cmd() and - php_escape_shell_arg(), needed for mbstring - - * (PHP_5_1) - ext/standard/exec.h: - Allow php extensions to use php_escape_shell_cmd() and - php_escape_shell_arg(), needed for mbstring - - * php.ini-dist - php.ini-recommended - ext/sqlite/config.w32: - MFB: Build PDO and SQLite as shared - - * (PHP_5_1) - NEWS - php.ini-dist - php.ini-recommended - ext/sqlite/config.w32: - Build PDO and SQLite as shared - -2005-09-24 Pierre-Alain Joye - - * (PHP_5_1) - ext/gd/libgd/gd_gif_in.c - ext/gd/libgd/gd_gif_in.c: - - MFH #33220, infinite loop while loading invalid GIF (nlopees) - - * ext/gd/libgd/gd_gif_in.c: - - #33220, fix infinite loop while loading invalid gif, this patch fixes - at least many cases (nlopess) - -2005-09-23 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Remove unused variable - - * ZendEngine2/zend_compile.h: - - WS - - * ZendEngine2/zend_API.h: - - WS fix - -2005-09-23 Andrei Zmievski - - * README.UNICODE-UPGRADES: - substr() sample case - -2005-09-23 Antony Dovgal - - * ZendEngine2/tests/error_reporting10.phpt: - fix test - - * ZendEngine2/tests/bug33771.phpt - ZendEngine2/tests/error_reporting01.phpt - ZendEngine2/tests/error_reporting02.phpt - ZendEngine2/tests/error_reporting03.phpt - ZendEngine2/tests/error_reporting04.phpt - ZendEngine2/tests/error_reporting05.phpt - ZendEngine2/tests/error_reporting06.phpt - ZendEngine2/tests/error_reporting07.phpt - ZendEngine2/tests/error_reporting08.phpt - ZendEngine2/tests/error_reporting09.phpt: - fix tests to work with HEAD and its new E_* values - -2005-09-23 Anantha Kesari H Y - - * (PHP_5_1) - ext/sockets/config.m4 - ext/sockets/config.m4 - ext/sockets/sockets.c - ext/sockets/sockets.c: - NetWare LibC don't have socketpair function. So enabling socket_create_pair - functionality only if socketpair is available in the host LibC. - --Kamesh - -2005-09-23 Jani Taskinen - - * (PHP_5_1) - acinclude.m4: - ws fix - -2005-09-23 Antony Dovgal - - * ZendEngine2/tests/bug21888.phpt: - remove double EXPECT tag - - * ZendEngine2/tests/error_reporting01.phpt - ZendEngine2/tests/error_reporting02.phpt - ZendEngine2/tests/error_reporting03.phpt - ZendEngine2/tests/error_reporting04.phpt - ZendEngine2/tests/error_reporting05.phpt - ZendEngine2/tests/error_reporting06.phpt - ZendEngine2/tests/error_reporting07.phpt - ZendEngine2/tests/error_reporting08.phpt - ZendEngine2/tests/error_reporting09.phpt - ZendEngine2/tests/error_reporting10.phpt: - add new tests - - * ZendEngine2/tests/error_reporting01.phpt - ZendEngine2/tests/error_reporting01.phpt - ZendEngine2/tests/error_reporting02.phpt - ZendEngine2/tests/error_reporting02.phpt - ZendEngine2/tests/error_reporting03.phpt - ZendEngine2/tests/error_reporting03.phpt - ZendEngine2/tests/error_reporting04.phpt - ZendEngine2/tests/error_reporting04.phpt - ZendEngine2/tests/error_reporting05.phpt - ZendEngine2/tests/error_reporting05.phpt - ZendEngine2/tests/error_reporting06.phpt - ZendEngine2/tests/error_reporting06.phpt - ZendEngine2/tests/error_reporting07.phpt - ZendEngine2/tests/error_reporting07.phpt - ZendEngine2/tests/error_reporting08.phpt - ZendEngine2/tests/error_reporting08.phpt - ZendEngine2/tests/error_reporting09.phpt - ZendEngine2/tests/error_reporting09.phpt - ZendEngine2/tests/error_reporting10.phpt - ZendEngine2/tests/error_reporting10.phpt: - - file error_reporting01.phpt was initially added on branch PHP_5_1. - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - MF5.1: - - store current value of error_reporting only if it's not stored yet - - reset old_error_reporting to NULL only it points to the tmp_var at - current opline - - * (PHP_5_1) - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - store current value of error_reporting only if it's not stored yet - - reset old_error_reporting to NULL only it points to the tmp_var at - current opline - -2005-09-23 Anantha Kesari H Y - - * (PHP_4_4) - acinclude.m4 - acinclude.m4: - In NetWare two binaries with the same name can not be loaded in kernel - address space(This is the default behaviour for NetWare apache webserver - and hence PHP extensions also get loaded in kernel address space) - simultaneoulsy. As the current autoconf built mysql extension is built as - mysql.nlm this forbids the loading of mysql client binary. To work around - this NetWare idiosyncrasy prefixing all the extensions with "php" except - php5lib(phpts.dll eqivalent of Windows). I could have named this - extensions prefixed with "php_" but "_" is eaten from the exported symbol - prefix by the GCC cross compiler for NetWare so sticking to "php". - This fixes the issue of not needing - "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" in all the extensions especially - when they need to be built shared. - - --Kamesh - - * (PHP_5_0) - acinclude.m4: - In NetWare two binaries with the same name can not be loaded in kernel - address space(This is the default behaviour for NetWare apache webserver - and hence PHP extensions also get loaded in kernel address space) - simultaneoulsy. As the current autoconf built mysql extension is built as - mysql.nlm this forbids the loading of mysql client binary. To work around - this NetWare idiosyncrasy prefixing all the extensions with "php" except - php5lib(phpts.dll eqivalent of Windows). I could have named this - extensions prefixed with "php_" but "_" is eaten by the exported symbol - prefix by the GCC cross compiler for NetWare so sticking to "php". - This fixes the issue of not needing - "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" in all the extensions especially - when they need to be built shared. - - --Kamesh - -2005-09-23 Jani Taskinen - - * ext/session/session.c: - - Improved the fix for #21306 a bit - -2005-09-23 Derick Rethans - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - - MFH: Moved the FREE_OP to after the execution of the included file, or - eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - -2005-09-22 Antony Dovgal - - * (PHP_5_0) - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_api.c: - MFH: fix #32081 (mysqli_real_connect(): mysqli.default_socket in php.ini - has no effect) for real - - * ext/mysqli/mysqli_api.c: - fix #32081 (mysqli_real_connect(): mysqli.default_socket in php.ini has no - effect) for real - - * ZendEngine2/zend_modules.h - ZendEngine2/zend_modules.h: - bump API number - - * (PHP_5_1) - NEWS: - BFN - - * (PHP_5_1) - ZendEngine2/zend_compile.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.skl - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug33771.phpt: - MFH: fix #33771 (error_reporting falls to 0 when @ was used inside - try/catch block) - - * ZendEngine2/tests/bug33771.phpt - ZendEngine2/tests/bug33771.phpt: - - fix #33771 (error_reporting falls to 0 when @ was used inside try/catch - block) - - * ZendEngine2/zend_compile.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.skl - ZendEngine2/zend_vm_opcodes.h: - fix #33771 (error_reporting falls to 0 when @ was used inside try/catch - block) - - * ext/oci8/oci8.c: - .. and the fix - - * ext/oci8/oci8.c: - fix Win32 builds for PHP_4_4 - (patch by Edin) - -2005-09-22 Jani Taskinen - - * (PHP_5_1) - configure.in - pear/Makefile.frag: - - Fixed bug #34583 ("make install" prematurely fails because of PEAR) - -2005-09-22 Antony Dovgal - - * (RELEASE_1_1_1) - ext/oci8/package.xml: - prepare to release 1.1.1 - -2005-09-21 Marcus Boerger - - * (PHP_5_1) - NEWS: - - BFN - -2005-09-21 Dmitry Stogov - - * (PHP_5_0) - ext/standard/http_fopen_wrapper.c: - Fixed memory corryption - - * ext/standard/http_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c: - Fixed memory corruption - - * ext/standard/http_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c: - Allow fopen() make HTTPS requests throug HTTP proxies - - * (PHP_5_0) - ext/standard/basic_functions.c - ext/standard/file.c - ext/standard/streamsfuncs.c - ext/standard/streamsfuncs.h: - Backport stream_socket_enable_crypto() - -2005-09-21 Ilia Alshanetsky - - * ext/mbstring/mbstring.c: - MFB: fixed compiler warnings - - * (PHP_5_1) - ext/mbstring/mbstring.c: - fixed compiler warnings - - * (PHP_4_4) - NEWS - NEWS - ext/mbstring/mbstring.c - ext/mbstring/mbstring.c: - MFH: Fixed bug #34565 (mb_send_mail does not fetch - mail.force_extra_parameters) - - * ext/mbstring/mbstring.c: - Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters) - -2005-09-21 Marcus Boerger - - * (PHP_5_0) - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_parser.y: - - MFH Fix Bug #34243 ReflectionClass::getDocComment() returns no result - - * ZendEngine2/zend_language_parser.y: - - Fix Bug #34243 ReflectionClass::getDocComment() returns no result - -2005-09-21 Derick Rethans - - * (PHP_4_4) - Zend/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - MFH: Moved the FREE_OP to after the execution of the included file, or - eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - Moved the FREE_OP to after the execution of the included file, or eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - -2005-09-20 Johannes Schlüter - - * (PHP_4_4) - ext/standard/credits.c - ext/standard/credits.c - ext/standard/credits.c: - - MFH: Remove HTML fragments from phpcredits() in CLI mode - - * ext/standard/credits.c: - - Remove HTML fragments from phpcredits() in CLI mode - -2005-09-20 Jani Taskinen - - * (PHP_4_4) - NEWS - NEWS: - BFN - - * (PHP_4_4) - ext/session/session.c - ext/session/session.c: - MFH: - Fixed bug #21306 (catch bailouts of write handler during RSHUTDOWN) - - * ext/session/session.c: - - Fixed bug #21306 (catch bailouts of write handler during RSHUTDOWN) - -2005-09-20 Stanislav Malyshev - - * ext/session/session.c - ext/session/session.c - ext/session/session.c - ext/session/session.c: - fix crash on restarting static PHP having session modules loaded - -2005-09-20 Antony Dovgal - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/standard/http.c - ext/standard/var.c - ext/wddx/wddx.c: - MF5.1: fix #34505 (Possible memory corruption when unmangling properties - with empty names) - (part 2) - - * (PHP_5_0) - ZendEngine2/zend.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_reflection_api.c: - MF5.1: fix #34505 (Possible memory corruption when unmangling properties - with empty names) - -2005-09-20 Marcus Boerger - - * Makefile.global: - - Synch utest with test - -2005-09-20 Jani Taskinen - - * (PHP_5_1) - NEWS: - no irrelevant news here (pdo was never in PHP before, no point) - -2005-09-20 Dmitry Stogov - - * (PHP_5_0) - ext/dom/php_dom.c: - Fixed access to uninitialized value - -2005-09-19 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Add eytension consts to extension output (Johannes) - - Fix WS in output - - * (PHP_5_0) - NEWS: - - MFH Renamed CachingRecursiveIterator to RecursiveCachingIterator. - - * server-tests-config.php - server-tests-config.php: - - - Fix filename - -2005-09-19 Antony Dovgal - - * (PHP_5_0) - NEWS: - fix #34548 (method append() in class extended from ArrayObject crashes PHP) - -2005-09-19 Dmitry Stogov - - * ext/dom/php_dom.c - ext/dom/php_dom.c: - Fixed access to uninitialized value - - * ZendEngine2/zend_execute.h - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute.h: - MFH (removed unnecesary call to zval_ptr_dtor) - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h: - Fixed access to memory that is already freed (in case of __call() method) - - * (PHP_4_4) - Zend/zend_execute.c: - Fixed parameter passing incompatibilities. - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug33257.phpt - ZendEngine2/tests/bug33257.phpt - ZendEngine2/tests/bug33257.phpt: - Fixed parameter passing incompatibilities. - Now it is possible to call array_pop(explode("&","1&2&3")) again. - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug33996.phpt: - Unicode support - - * ext/simplexml/tests/012.phpt: - Fixed test file - -2005-09-19 Ilia Alshanetsky - - * NEWS: - Add blame :) - -2005-09-18 Jani Taskinen - - * (PHP_5_1) - NEWS: - cleanup, typos, etc - -2005-09-18 Marcus Boerger - - * (PHP_5_1) - NEWS: - - Synch naming/move changes with HEAD - - Update tests/docu - -2005-09-18 Antony Dovgal - - * (PHP_5_0) - ZendEngine2/zend_reflection_api.c: - fix leaks - this problem is in 5.0 only, while 5.1 & HEAD work fine and I'd appreciate - if someone explain me why.. - -2005-09-16 Antony Dovgal - - * (PHP_5_0) - NEWS - NEWS - NEWS: - BFN - - * (PHP_5_0) - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c: - MFH: check class_entry of this_ptr in Reflection API - - * ZendEngine2/zend_reflection_api.c: - check class_entry of this_ptr in Reflection API, so we won't get an alien - this_ptr - when called statically in a function that is called statically too - (without being - declared as static) - -2005-09-16 Jani Taskinen - - * NEWS: - Please, only add entries for fixed bugs if they are ONLY fixed in HEAD! - -2005-09-16 Antony Dovgal - - * (PHP_5_1) - ext/standard/http.c - ext/standard/var.c - ext/wddx/wddx.c: - fix #34505 (possible memory corruption when unmangling properties with - empty names) - 2nd part - - * (PHP_5_1) - ZendEngine2/zend.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - fix #34505 (possible memory corruption when unmangling properties with - empty names) - 1st part - -2005-09-16 Dmitry Stogov - - * NEWS - NEWS - NEWS: - Fixed bug #34478 (Incorrect parsing of url's fragment (#...)) - - * ZendEngine2/tests/array_type_hint_001.phpt - tests/classes/type_hinting_001.phpt - tests/lang/bug24658.phpt - tests/lang/catchable_error_001.phpt - tests/lang/catchable_error_002.phpt - tests/lang/type_hints_001.phpt: - Fixed tests - -2005-09-16 Marcus Boerger - - * ext/sqlite/tests/sqlite_spl_001.phpt: - - MFB - -2005-09-16 Dmitry Stogov - - * ZendEngine2/tests/bug34518.phpt - ZendEngine2/tests/bug34518.phpt: - - Fixed bug #34518 (Unset doesn't separate container in CV) - - * NEWS - NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug34518.phpt: - Fixed bug #34518 (Unset doesn't separate container in CV) - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c: - MFH (overriding of protected static property) - -2005-09-16 Jani Taskinen - - * (PHP_5_1) - ext/ldap/config.m4: - correct flag - - * (PHP_5_1) - ext/ldap/config.m4: - Fixed bug #34525 - - * (PHP_5_1) - ext/sqlite/tests/sqlite_spl_001.phpt: - fix test - -2005-09-15 Jani Taskinen - - * (PHP_5_1) - ZendEngine2/tests/array_type_hint_001.phpt - ZendEngine2/tests/bug20240.phpt - ZendEngine2/tests/bug33996.phpt - ZendEngine2/tests/bug34199.phpt - tests/classes/type_hinting_001.phpt - tests/lang/bug24658.phpt - tests/lang/type_hints_001.phpt: - - Fix tests due to changes in the error messages. - -2005-09-15 Derick Rethans - - * (PHP_5_1) - NEWS - main/config.w32.h - main/snprintf.h: - - MFH: Fixed bug #34052 (date('U') returns %ld not unix timestamp). - - * NEWS - main/config.w32.h - main/snprintf.h: - - Fixed bug #34052 (date('U') returns %ld not unix timestamp). - - * tests/lang/catchable_error_001.phpt - tests/lang/catchable_error_002.phpt: - - Added tests. - - * php.ini-dist - php.ini-recommended - run-tests.php - ZendEngine2/zend.c - ZendEngine2/zend_constants.c - ZendEngine2/zend_errors.h - ZendEngine2/zend_execute.c - ZendEngine2/tests/array_type_hint_001.phpt - ZendEngine2/tests/bug33996.phpt - ext/mcrypt/mcrypt.c - ext/session/session.c - ext/simplexml/simplexml.c - ext/simplexml/tests/012.phpt - main/main.c - tests/classes/array_access_003.phpt - tests/classes/private_003.phpt - tests/classes/type_hinting_001.phpt - tests/lang/bug24658.phpt - tests/lang/type_hints_001.phpt - tests/run-test/test005.phpt - tests/run-test/test008a.phpt: - - Add E_RECOVERABLE. - -2005-09-15 Anantha Kesari H Y - - * (PHP_4_4) - main/main.c: - NetWare does not have sendmail binary to send mail. - --Kamesh - -2005-09-15 Jani Taskinen - - * ZendEngine2/zend_execute.c: - MFB - - * (PHP_5_1) - ZendEngine2/zend_execute.c: - - Fixed error message grammar - -2005-09-15 Marcus Boerger - - * (PHP_5_1) - NEWS: - - Update with latest SPLchanges - -2005-09-14 Derick Rethans - - * (PHP_5_0) - main/main.c: - - MF51: Fixed shutdown order. - - * (PHP_5_1) - main/main.c: - - Fixed shutdown order before RC2. - -2005-09-14 Marcus Boerger - - * ZendEngine2/zend_execute.c: - - Improve error message - -2005-09-14 Andrei Zmievski - - * README.UNICODE-UPGRADES: - -** empty log message *** - -2005-09-14 Jani Taskinen - - * Makefile.global: - Silence warnings under Solaris - - * ZendEngine2/acinclude.m4: - Silence some crap if bison does not exist - -2005-09-13 Jani Taskinen - - * configure.in: - ext/oracle is no more - -2005-09-13 Andrei Zmievski - - * README.UNICODE-UPGRADES - README.UNICODE-UPGRADES: - -** empty log message *** - - * ZendEngine2/zend_reflection_api.c: - Fix for Unicode access. - - * README.UNICODE-UPGRADES: - Commit work in progress. - -2005-09-13 Antony Dovgal - - * (PHP_5_0) - ext/sqlite/libsqlite/src/parse.c: - touch - -2005-09-13 Ilia Alshanetsky - - * (PHP_5_1) - ext/standard/basic_functions.c: - MFH: MFH: Make key() and current() take argument by value. - - * (PHP_4_4) - ext/standard/basic_functions.c - ext/standard/basic_functions.c: - MFH: Make key() and current() take argument by value. - - * ext/standard/basic_functions.c: - Make key() and current() take argument by value. - -2005-09-13 Jani Taskinen - - * configure.in: - Cleanup the configure mess, preparing for making unicode OPTIONAL - -2005-09-13 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli.c: - MFH: fix #34450 (Segfault when calling mysqli_close() in destructor) - - * (PHP_5_1) - NEWS: - bfn - - * ext/mysqli/mysqli.c - ext/mysqli/mysqli.c: - fix #34450 (Segfault when calling mysqli_close() in destructor) - -2005-09-13 Dmitry Stogov - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.h - ZendEngine2/tests/bug34199.phpt: - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler) - -2005-09-12 Sara Golemon - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - MFH(r-1.719) Plug leak of 1 byte when converting from string - - * (PHP_5_1) - ZendEngine2/zend_execute.c: - MFH(r-1.719) Plug leak of 1/2 bytes when converting from string/unicode - - * ZendEngine2/zend_execute.c: - Plug leak of 1/2 bytes when converting from string/unicode - -2005-09-12 Jani Taskinen - - * ext/xmlrpc/.cvsignore - ext/xmlrpc/config.m4: - - Fixed build with phpize - -2005-09-12 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/pspell/pspell.c - ext/pspell/pspell.c: - MFH: Fixed bug #34456 (Possible crash inside pspell extension). - - * ext/pspell/pspell.c: - Fixed bug #34456 (Possible crash inside pspell extension). - - -2005-09-12 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/zend_operators.c: - typo - - * ZendEngine2/tests/bug34199.phpt - ZendEngine2/tests/bug34199.phpt: - - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency) - - * NEWS - NEWS - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute.h - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.c - ZendEngine2/tests/bug34199.phpt: - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency) - - * ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c: - Additinal fix for bug #34277 (array_filter() crashes with references and - objects) - -2005-09-12 Derick Rethans - - * ZendEngine2/zend_operators.c - ext/standard/array.c - ext/standard/tests/array/locale_sort.phpt: - - Reimplement SORT_LOCALE_STRING with ICU locales. - -2005-09-12 Dmitry Stogov - - * (PHP_5_1) - ZendEngine2/zend.c: - Fixed huge memory leak in ZTS mode (backport from HEAD) - - * NEWS - NEWS - NEWS: - Fixed bug #34449 (ext/soap: XSD_ANYXML functionality not exposed) - - * ext/standard/var.c: - Fix for exceptions in __sleep() - - * (PHP_5_1) - ext/standard/var.c: - Better fix for exceptions in __sleep() - -2005-09-11 Greg Beaver - - * (PHP_5_1) - pear/go-pear.bat: - prepare for using go-pear.phar - -2005-09-11 Ilia Alshanetsky - - * (PHP_5_1) - run-tests.php: - Make use of 5.0+ features - -2005-09-10 Wez Furlong - - * (PHP_5_1) - ext/standard/var.c: - allow exceptions thrown in __sleep to interrupt the serialization process. - refs PECL #5217 - -2005-09-10 Derick Rethans - - * (PHP_5_1) - configure.in - main/php_version.h: - - Fix version numbers as discussed to help version_compare for the PEAR - folks. - -2005-09-09 Rolland Santimano - - * ext/standard/string.c: - - str_pad(): Use u_countChar32() for codepoint counting, - eumalloc/eurealloc() for Unicode mallocs. - -2005-09-09 Antony Dovgal - - * ext/oci8/oci8_statement.c: - fix problem appearing when binding empty values - -2005-09-09 Derick Rethans - - * unicode-progress.txt: - - Added Rollands latest upgrades. - -2005-09-09 Dmitry Stogov - - * ZendEngine2/zend.c: - Fixed huge memory leaks in ZTS mode - - * (PHP_5_1) - NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/catch.phpt - ZendEngine2/tests/instanceof.phpt - ZendEngine2/tests/is_a.phpt: - Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() - functions to not call __autoload(). - - * ZendEngine2/tests/is_a.phpt - ZendEngine2/tests/is_a.phpt: - - MFH (is_sublass_of("A","B") should call __autoload() for "A" and "B") - - * ZendEngine2/zend_builtin_functions.c: - MFH (is_sublass_of("A","B") should call __autoload() for "A" and "B") - -2005-09-08 Ilia Alshanetsky - - * (PHP_5_1) - ext/sqlite/sqlite.c: - MFH: Allow retrieval of query parse errors from SQLite. - - * ext/sqlite/sqlite.c: - Allow retrieval of query parse errors from SQLite. - - -2005-09-08 Dmitry Stogov - - * ZendEngine2/zend.c: - Avoid unnecessary copying/freeing - -2005-09-08 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/curl/multi.c: - MFH: Fixed bug #34420 (Possible crash inside curl_multi_remove_handle()). - - * ext/curl/multi.c: - Fixed bug #34420 (Possible crash inside curl_multi_remove_handle()). - -2005-09-08 Derick Rethans - - * ext/standard/string.c: - - Make ord() work on binary strings too. - -2005-09-08 Antony Dovgal - - * ext/oci8/oci8.c: - use "connections" instead of "links" everywhere to avoid possible confusion - -2005-09-08 Dmitry Stogov - - * ext/standard/string.c - ext/standard/tests/strings/substr_replace.phpt: - Fixed craches in substr_replace() - -2005-09-08 Antony Dovgal - - * ext/iconv/iconv.c: - fix phpinfo() output for iconv extension - (convert unicode values to string before outputting them) - -2005-09-08 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_constants.c - ZendEngine2/zend_constants.h - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ext/standard/basic_functions.c: - Unicode support for PHP constants - -2005-09-08 Rob Richards - - * ext/dom/document.c: - add save options parameter - -2005-09-08 Dmitry Stogov - - * NEWS - ZendEngine2/zend_compile.c - ZendEngine2/tests/catch.phpt: - catch operator shouldn't call __autoload () too - -2005-09-08 Rasmus Lerdorf - - * (PHP_5_1) - pear/Makefile.frag: - That line made no sense - -2005-09-08 Dmitry Stogov - - * ext/odbc/php_odbc.c - ext/odbc/php_odbc.c - ext/odbc/php_odbc.c: - Fixed crash on AIX - -2005-09-08 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of substr_replace() - -2005-09-07 Greg Beaver - - * (PHP_5_1) - pear/install-pear.phar: - install-pear.phar removed -> moved to http://pear.php.net/install-pear.phar - - * (PHP_5_1) - pear/install-pear.txt: - attempt to make new instructions clearer - - * (PHP_5_1) - pear/Makefile.frag: - change makefile to use phar and not source, if present - -2005-09-07 Dmitry Stogov - - * ext/openssl/xp_ssl.c - ext/openssl/xp_ssl.c - ext/openssl/xp_ssl.c: - Fixed memory allocation bug - -2005-09-07 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - ext/sqlite/libsqlite/VERSION - ext/sqlite/libsqlite/src/attach.c - ext/sqlite/libsqlite/src/auth.c - ext/sqlite/libsqlite/src/btree.c - ext/sqlite/libsqlite/src/btree.h - ext/sqlite/libsqlite/src/btree_rb.c - ext/sqlite/libsqlite/src/build.c - ext/sqlite/libsqlite/src/copy.c - ext/sqlite/libsqlite/src/date.c - ext/sqlite/libsqlite/src/delete.c - ext/sqlite/libsqlite/src/encode.c - ext/sqlite/libsqlite/src/expr.c - ext/sqlite/libsqlite/src/func.c - ext/sqlite/libsqlite/src/hash.c - ext/sqlite/libsqlite/src/hash.h - ext/sqlite/libsqlite/src/insert.c - ext/sqlite/libsqlite/src/main.c - ext/sqlite/libsqlite/src/os.c - ext/sqlite/libsqlite/src/pager.c - ext/sqlite/libsqlite/src/pager.h - ext/sqlite/libsqlite/src/parse.y - ext/sqlite/libsqlite/src/pragma.c - ext/sqlite/libsqlite/src/printf.c - ext/sqlite/libsqlite/src/random.c - ext/sqlite/libsqlite/src/select.c - ext/sqlite/libsqlite/src/sqlite.h.in - ext/sqlite/libsqlite/src/sqlite.w32.h - ext/sqlite/libsqlite/src/sqliteInt.h - ext/sqlite/libsqlite/src/tokenize.c - ext/sqlite/libsqlite/src/update.c - ext/sqlite/libsqlite/src/util.c - ext/sqlite/libsqlite/src/vacuum.c - ext/sqlite/libsqlite/src/vdbe.c - ext/sqlite/libsqlite/src/vdbe.h - ext/sqlite/libsqlite/src/where.c: - MFH: Upgraded SQLite 2 library in ext/sqlite to 2.8.16 - - * ext/sqlite/libsqlite/VERSION - ext/sqlite/libsqlite/src/attach.c - ext/sqlite/libsqlite/src/auth.c - ext/sqlite/libsqlite/src/btree.c - ext/sqlite/libsqlite/src/btree.h - ext/sqlite/libsqlite/src/btree_rb.c - ext/sqlite/libsqlite/src/build.c - ext/sqlite/libsqlite/src/copy.c - ext/sqlite/libsqlite/src/date.c - ext/sqlite/libsqlite/src/delete.c - ext/sqlite/libsqlite/src/encode.c - ext/sqlite/libsqlite/src/expr.c - ext/sqlite/libsqlite/src/func.c - ext/sqlite/libsqlite/src/hash.c - ext/sqlite/libsqlite/src/hash.h - ext/sqlite/libsqlite/src/insert.c - ext/sqlite/libsqlite/src/main.c - ext/sqlite/libsqlite/src/os.c - ext/sqlite/libsqlite/src/pager.c - ext/sqlite/libsqlite/src/pager.h - ext/sqlite/libsqlite/src/parse.y - ext/sqlite/libsqlite/src/pragma.c - ext/sqlite/libsqlite/src/printf.c - ext/sqlite/libsqlite/src/random.c - ext/sqlite/libsqlite/src/select.c - ext/sqlite/libsqlite/src/sqlite.h.in - ext/sqlite/libsqlite/src/sqlite.w32.h - ext/sqlite/libsqlite/src/sqliteInt.h - ext/sqlite/libsqlite/src/tokenize.c - ext/sqlite/libsqlite/src/update.c - ext/sqlite/libsqlite/src/util.c - ext/sqlite/libsqlite/src/vacuum.c - ext/sqlite/libsqlite/src/vdbe.c - ext/sqlite/libsqlite/src/vdbe.h - ext/sqlite/libsqlite/src/where.c: - Upgraded sqlite2 lib to 2.8.16 - -2005-09-07 Antony Dovgal - - * ext/oci8/package.xml: - add Andi & Wez as lead maintainers and make myself lead too - - * ext/oci8/package.xml: - I doubt that all these people are going to develop it in PECL, - so remove them and fix those complains about non-existing users. - - * ext/oci8/package.xml: - prepare to PECL release - - * (RELEASE_1_1) - ext/oci8/oci8_interface.c: - don't try to fetch resource when there is 0 args - -2005-09-07 Dmitry Stogov - - * ext/standard/string.c: - Fixed unicode support for substr_count() - -2005-09-07 Ilia Alshanetsky - - * (PHP_5_1) - TODO: - Updated TODO - -2005-09-06 Antony Dovgal - - * ext/oci8/php_oci8_int.h: - removed __FUNCTION__ (by popular demand) - - * ext/oci8/CREDITS - ext/oci8/oci8.c - ext/oci8/oci8_collection.c - ext/oci8/oci8_interface.c - ext/oci8/oci8_lob.c - ext/oci8/oci8_statement.c - ext/oci8/php_oci8.h - ext/oci8/php_oci8_int.h: - fix credits - -2005-09-06 Edin Kadribasic - - * ext/oci8/config.w32: - Sync windows build and link against instant client libs - - * ext/oci8/oci8.c - ext/oci8/oci8_collection.c - ext/oci8/oci8_interface.c - ext/oci8/oci8_lob.c - ext/oci8/oci8_statement.c - ext/oci8/php_oci8.h - ext/oci8/php_oci8_int.h: - Remove utf-8 chars - -2005-09-06 Antony Dovgal - - * ext/oci8/php_oci8_int.h: - workaround for some b0rked compilers - -2005-09-06 Ilia Alshanetsky - - * (PHP_5_1) - run-tests.php: - Simplify code by making use 5.1+ functions - -2005-09-05 Greg Beaver - - * pear/install-pear.phar - pear/install-pear.phar: - - file install-pear.phar was initially added on branch PHP_5_1. - -2005-09-05 Rolland Santimano - - * ext/standard/string.c: - Pointer arithmetic with char * rather than void * - -2005-09-05 Jani Taskinen - - * (PHP_4_4) - NEWS - NEWS - ext/standard/var_unserializer.re - ext/standard/var_unserializer.re: - MFH: - Fixed bug #34311 (unserialize() crashes with characters above 191 - dec) - - * (PHP_4_4) - ext/standard/url_scanner_ex.c: - touch with working re2c - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c: - touch - - * ext/standard/var_unserializer.re: - - Fixed bug #34311 (unserialize() crashes with characters above 191 dec) - - * (PHP_4_4) - NEWS - NEWS: - BFN - -2005-09-05 Zeev Suraski - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - Roll back to dev - -2005-09-05 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of str_pad() - -2005-09-05 Zeev Suraski - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - Roll 5.0.5 - -2005-09-05 Frank M. Kromann - - * ext/mssql/php_mssql.c - ext/mssql/php_mssql.c: - MFB: Fix for #34369 - Add extra parameter to mssql_connect to force a new connection - - * (PHP_4_4) - ext/mssql/php_mssql.c: - Fix for #34369 - Add extra parameter to mssql_connect to force a new connection - -2005-09-04 Wez Furlong - - * (PHP_5_1) - ext/mysql/package.xml - ext/mysql/php_mysql.c: - assign a version number - - * (PHP_5_1) - ext/mysql/config.m4 - ext/mysql/package.xml - ext/mysql/php_mysql.c: - Allow ext/mysql to build against PHP 4 again; update package.xml ready for - release via PECL. - - * (PHP_4_4) - scripts/phpize.in: - merge solaris portability fix - -2005-09-02 Jani Taskinen - - * (PHP_5_1) - NEWS: - reorder - - * (PHP_4_4) - NEWS: - typo - - * (PHP_4_4) - NEWS - NEWS - NEWS: - BFN - - * ZendEngine2/zend_ini.c: - MFB: - Fixed bug #34307. We were not calling on_modify handler to set the - default - value in case setting the one from .ini file failed. (Andrei) - -2005-09-02 Andrei Zmievski - - * (PHP_5_1) - ZendEngine2/zend_ini.c: - Fix bug #34307. We were not calling on_modify handler to set the default - value in case setting the one from .ini file failed. - -2005-09-02 Ilia Alshanetsky - - * ext/zlib/zlib.c: - Resolved bug #34240. - - -2005-09-02 Rob Richards - - * ext/xsl/xsltprocessor.c: - Fix crash: handler name not length needs to be passed to php_error_docref - -2005-09-02 Jani Taskinen - - * main/main.c - main/php_ini.c - main/php_ini.h: - revert - - * (PHP_5_1) - main/main.c - main/php_ini.c - main/php_ini.h: - Revert - - * sapi/apache2handler/sapi_apache2.c: - Check the status properly - -2005-09-02 Derick Rethans - - * (PHP_5_1) - NEWS: - - Fixed bug #34304 (date() doesn't have a modifier for ISO Week Day). - -2005-09-02 Jani Taskinen - - * (PHP_5_1) - NEWS - ext/mcve/.cvsignore - ext/mcve/CREDITS - ext/mcve/config.m4 - ext/mcve/config.w32 - ext/mcve/mcve.c - ext/mcve/mcve.dsp - ext/mcve/mcve.php - ext/mcve/mcve_simple_test.php - ext/mcve/mcve_test1.php - ext/mcve/mcve_test2.php - ext/mcve/php_mcve.h - ext/mcve/tests/.cvsignore - ext/mcve/tests/001.phpt - ext/ovrimos/.cvsignore - ext/ovrimos/CREDITS - ext/ovrimos/config.m4 - ext/ovrimos/ovrimos.c - ext/ovrimos/php_ovrimos.h - ext/pfpro/.cvsignore - ext/pfpro/CREDITS - ext/pfpro/TODO - ext/pfpro/config.m4 - ext/pfpro/pfpro.c - ext/pfpro/php_pfpro.h: - - Moved exts to PECL - - * ext/mcve/.cvsignore - ext/mcve/CREDITS - ext/mcve/config.m4 - ext/mcve/config.w32 - ext/mcve/mcve.c - ext/mcve/mcve.dsp - ext/mcve/mcve.php - ext/mcve/mcve_simple_test.php - ext/mcve/mcve_test1.php - ext/mcve/mcve_test2.php - ext/mcve/php_mcve.h - ext/mcve/tests/.cvsignore - ext/mcve/tests/001.phpt - ext/ovrimos/.cvsignore - ext/ovrimos/CREDITS - ext/ovrimos/config.m4 - ext/ovrimos/ovrimos.c - ext/ovrimos/php_ovrimos.h - ext/pfpro/.cvsignore - ext/pfpro/CREDITS - ext/pfpro/TODO - ext/pfpro/config.m4 - ext/pfpro/pfpro.c - ext/pfpro/php_pfpro.h: - - Moved pfpro, ovrimos and mcve to PECL - - * main/php_ini.c: - MFB: Always return something, even if it succeeds :) - - * (PHP_5_1) - main/php_ini.c: - it is good idea to return something always - -2005-09-02 Dmitry Stogov - - * ZendEngine2/tests/bug34260.phpt - ZendEngine2/tests/bug34260.phpt - ZendEngine2/tests/bug34260.phpt: - 1.1.4; - Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) - - * NEWS - NEWS - NEWS - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug34260.phpt - ZendEngine2/tests/bug34260.phpt: - Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) - -2005-09-02 Rob Richards - - * (PHP_5_1) - ext/xsl/xsltprocessor.c: - MFH: Fix key length so params passed by array can be retrieved by - getParameter() - - * ext/xsl/xsltprocessor.c: - Fix key length so params passed by array can be retrieved by getParameter() - -2005-09-01 Ilia Alshanetsky - - * (PHP_5_1) - NEWS - main/php_variables.c - main/php_variables.c: - MFH: Fixed bug #34331 (php crashes when variables_order is empty). - - * main/php_variables.c: - Fixed bug #34331 (php crashes when variables_order is empty). - -2005-09-01 Jani Taskinen - - * (PHP_5_1) - NEWS - main/main.c - main/php_ini.c - main/php_ini.h: - MFH: - Fixed bug #34307 (OnUpdateStringUnempty INI options can be set - empty) - - * main/main.c - main/php_ini.c - main/php_ini.h: - - Fixed bug #34307 (OnUpdateStringUnempty INI options can be set as empty) - - * sapi/apache2filter/config.m4 - sapi/apache2handler/config.m4: - - Revert -a to -A change, bad idea: It disables EXISTING lines too! - -2005-09-01 Wez Furlong - - * (PHP_5_1) - scripts/phpize.in: - portability fix (for solaris) - -2005-09-01 Dmitry Stogov - - * ZendEngine2/tests/bug34137.phpt - ZendEngine2/tests/bug34137.phpt - ZendEngine2/tests/bug34137.phpt: - 1.1.4; - Fixed bug #34137 (assigning array element by reference causes binary mess) - - * NEWS - NEWS - NEWS - NEWS - Zend/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/tests/bug34137.phpt - ZendEngine2/tests/bug34137.phpt: - Fixed bug #34137 (assigning array element by reference causes binary mess) - -2005-09-01 Derick Rethans - - * (PHP_5_1) - NEWS: - - MFH: Fixed bug #33414 (Comprehensive list of incorrect days returned - after - strtotime() / date() tests). - -2005-09-01 Jani Taskinen - - * NEWS: - If it is added in 5.1, is it still news for PHP 6? - - * (PHP_5_1) - NEWS: - NSF - -2005-09-01 Dmitry Stogov - - * ext/standard/tests/array/bug34227.phpt - ext/standard/tests/array/bug34227.phpt - ext/standard/tests/array/bug34227.phpt - ext/standard/tests/array/bug34227.phpt: - 1.1.4; 1.1.6; - Fixed bug #34277 (array_filter() crashes with references and objects) - - * NEWS - NEWS - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug34227.phpt - ext/standard/tests/array/bug34227.phpt - ext/standard/tests/array/bug34227.phpt: - Fixed bug #34277 (array_filter() crashes with references and objects) - - * NEWS - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug34310.phpt - ZendEngine2/tests/bug34310.phpt: - Fixed bug #34310 (foreach($arr as $c->d => $x) crashes) - - * NEWS - NEWS - ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_opcode.c - ZendEngine2/zend_opcode.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c: - Support for class constants and static members for internal classes - -2005-09-01 Anantha Kesari H Y - - * (PHP_4_4) - sapi/cli/php_getopt.h: - As NetWare LibC has optind and optarg macros defined in unistd.h our local - variables were getting mistakenly preprocessed so undeffing optind and - optarg - - --Kamesh - -2005-09-01 Jani Taskinen - - * acinclude.m4: - Bump up libxml2 version requirement to >= 2.6.8 - -2005-09-01 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - MFH: Fixed bug #34001 (pdo_mysql truncates numberic fields at 4 chars) - -2005-08-31 Jani Taskinen - - * ext/sybase/config.m4 - ext/sybase/config.m4 - ext/sybase/config.m4: - Fixed bug #34323 - -2005-08-31 Andrei Zmievski - - * main/rfc1867.c: - Further work on Unicode support in file uploads. - -2005-08-31 Rob Richards - - * (PHP_5_1) - ext/simplexml/simplexml.c: - MFH: make sxe_properties_get respect namespace scope - - * ext/simplexml/simplexml.c: - make sxe_properties_get respect namespace scope - -2005-08-31 Jani Taskinen - - * ext/standard/credits_ext.h - ext/standard/credits_ext.h: - Update credits - - * (PHP_5_1) - NEWS - ext/oracle/.cvsignore - ext/oracle/CREDITS - ext/oracle/config.m4 - ext/oracle/config.w32 - ext/oracle/oracle.c - ext/oracle/oracle.dsp - ext/oracle/package.xml - ext/oracle/php_oracle.h: - - Moved ext/oracle to PECL - - * ext/oracle/.cvsignore - ext/oracle/CREDITS - ext/oracle/config.m4 - ext/oracle/config.w32 - ext/oracle/oracle.c - ext/oracle/oracle.dsp - ext/oracle/package.xml - ext/oracle/php_oracle.h: - Moved to PECL - - * (PHP_4_4) - main/php_ini.c: - Fixed bug #32318 - -2005-08-31 Derick Rethans - - * NEWS - NEWS: - - Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week - number). - -2005-08-31 Jani Taskinen - - * (PHP_5_1) - NEWS - ext/wddx/wddx.c - ext/wddx/tests/bug34306.phpt: - MFH:- Fixed bug #34306 (wddx_serialize_value() crashes with long array - keys) - - * ext/wddx/wddx.c - ext/wddx/tests/bug34306.phpt - ext/wddx/tests/bug34306.phpt: - - Fixed bug #34306 (wddx_serialize_value() crashes with long array keys) - - * ZendEngine2/tests/bug34310.phpt: - Added test for bug #34310 - - * ZendEngine2/tests/bug34310.phpt - ZendEngine2/tests/bug34310.phpt: - - file bug34310.phpt was initially added on branch PHP_5_1. - -2005-08-31 Marcus Boerger - - * (PHP_5_1) - scripts/Makefile.frag: - - MFH run-tests-config.php was never used and now renamed - - * scripts/Makefile.frag: - - run-tests-config.php was never used and now renamed - -2005-08-31 Ilia Alshanetsky - - * NEWS - ext/standard/http.c - ext/standard/php_http.h: - Added optional parameter to http_build_query() to allow specification of - string separator. - -2005-08-30 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: Fixed bug #32589 (possible crash inside imap_mail_compose() function). - - * ext/imap/php_imap.c: - Fixed bug #32589 (possible crash inside imap_mail_compose() function). - -2005-08-30 Johannes Schlüter - - * NEWS: - News - -2005-08-30 Marcus Boerger - - * (PHP_5_1) - run-tests-config.php - server-tests-config.php - server-tests.php: - - MFH (missing run-tests2.php rename part) - - * run-tests-config.php - server-tests-config.php - server-tests-config.php - server-tests.php: - - run-tests2.php was renamed into server-tests.php (missing part) - - * ZendEngine2/zend_API.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_reflection_api.c: - - Adds module registering a function to struct zend_internal_function. - (Johannes) - -2005-08-30 Derick Rethans - - * NEWS - NEWS - NEWS - NEWS - ext/standard/datetime.c - ext/standard/datetime.c: - - Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). - -2005-08-30 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Fix const speling (correct in branshes where did it vanish here) - -2005-08-30 Dmitry Stogov - - * ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c: - Fixed possible memory leak - - * ZendEngine2/zend.c: - Fixed unicode support bug - -2005-08-30 Marcus Boerger - - * (PHP_5_0) - NEWS - NEWS: - - BFN - - * (PHP_5_0) - ZendEngine2/zend_reflection_api.c: - - MFH Fix #34299: ReflectionClass::isInstantiable() returns true for - abstract classes - -2005-08-29 Ilia Alshanetsky - - * (PHP_5_1) - EXTENSIONS: - Mark pspell as working - -2005-08-29 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Fix #34299: ReflectionClass::isInstantiable() returns true for abstract - classes - -2005-08-29 Sara Golemon - - * (PHP_5_1) - TSRM/TSRM.c: - MFH: allocate_new_resource() handles the malloc() for us. Don't leak by - mallocing twice. - - * TSRM/TSRM.c: - allocate_new_resource() handles the malloc() for us. Don't leak by - mallocing twice. - -2005-08-29 Jani Taskinen - - * php.ini-dist - php.ini-recommended: - Clean away PECled exts and added date.timezone setting - -2005-08-29 Dmitry Stogov - - * main/main.c: - Fixed SIGSEGV - - * ext/standard/string.c: - Fixed gcc 4 compatibility - -2005-08-28 Wez Furlong - - * (PHP_5_0) - ext/sqlite/config.m4: - Fixes --enable-sqlite=shared when doing so as part of the php distro - -2005-08-28 Ilia Alshanetsky - - * (PHP_5_1) - NEWS: - Upgraded bundled SQLite library for PDO:SQLite to 3.2.5 - -2005-08-28 Rob Richards - - * (PHP_5_1) - NEWS: - BFN - - * (PHP_5_1) - ext/dom/element.c - ext/dom/tests/bug34276.phpt: - MFH: Fixed bug #34276 (setAttributeNS doesn't work with default namespace) - Add test - - * ext/dom/tests/bug34276.phpt - ext/dom/tests/bug34276.phpt: - - Fixed bug #34276 (setAttributeNS doesn't work with default namespace) - Add test - - * ext/dom/element.c: - Fixed bug #34276 (setAttributeNS doesn't work with default namespace) - Add test - -2005-08-28 Jani Taskinen - - * (PHP_5_1) - NEWS: - Nuke misinformation - - * (PHP_5_1) - configure.in: - This is no longer required - - * (PHP_5_1) - NEWS - ext/standard/info.c - ext/standard/info.c: - - Fixed bug #34284 (CLI phpinfo showing html on _SERVER["argv"]) - - * ext/xmlrpc/config.m4: - - Fixed bug #34221 (Compiling xmlrpc as shared fails other parts) - -2005-08-27 Rolland Santimano - - * ext/standard/string.c: - - Unicode impl of substr_count() - -2005-08-26 Marcus Boerger - - * ext/ming/config.m4: - - Check for static libs, too - -2005-08-26 Derick Rethans - - * (PHP_5_1) - NEWS - main/streams/plain_wrapper.c: - - MFH: Fixed a bug where stream_get_meta_data() did not return the "uri" - element for files opened with tmpname(). - - * NEWS - main/streams/plain_wrapper.c: - - Fixed a bug where stream_get_meta_data() did not return the "uri" element - for - files opened with tmpname(). - -2005-08-26 Rolland Santimano - - * ext/standard/string.c: - - Updated strrev() to handle base+combining sequences - -2005-08-26 Ilia Alshanetsky - - * ext/standard/base64.c - ext/standard/base64.c: - MFH: Fixed bug #34214 (base64_decode() does not properly ignore whitespace) - - * (PHP_5_1) - ext/standard/base64.c: - Fixed bug #34214 (base64_decode() does not properly ignore whitespace) - -2005-08-25 Marcus Boerger - - * (PHP_5_1) - ext/ming/config.m4: - - MFH Fixed bug #34257 (lib64 not handled correctly in ming extension). - - * ext/ming/config.m4: - - Bugfix #34257 lib64 not handled correctly in ming extension - -2005-08-25 Zeev Suraski - - * (PHP_5_0) - configure.in - main/php_version.h: - Revert to -dev - - * (PHP_5_0) - ZendEngine2/zend.h: - Bump version - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - Roll RC2 - -2005-08-25 Dmitry Stogov - - * ZendEngine2/zend.c: - Fixed memory leaks - -2005-08-25 Jani Taskinen - - * ext/curl/streams.c: - MFB - - * (PHP_5_1) - ext/curl/streams.c: - Fix crash with e.g. stream_get_meta_data() - -2005-08-25 Dmitry Stogov - - * ZendEngine2/zend.c: - Fixed access to uninitialized variables - -2005-08-24 Andrei Zmievski - - * unicode-todo.txt: - -** empty log message *** - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_globals.h - ZendEngine2/zend_language_scanner.h - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_opcode.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - Require declare(encoding=...) to come before any opcodes. Read source - comments for more info. - - Op arrays now know which script encoding they were compiled from. - - Use this information to intelligently convert inline HTML blocks to - the output encoding. Currently it opens and closes a new converter for - each block, but we can optimize it. - -2005-08-24 Ilia Alshanetsky - - * main/output.c: - Remainder of the 34191 bug fix. - -2005-08-24 Jani Taskinen - - * (PHP_5_1) - NEWS: - PCRE lib is 6.2 - -2005-08-24 Dmitry Stogov - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h: - Fixed return-by-reference from internal functions - -2005-08-23 Andrei Zmievski - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h: - Implement Unicode support for strncasecmp(). - - * unicode-progress.txt - unicode-todo.txt: - -** empty log message *** - -2005-08-23 Jani Taskinen - - * ext/standard/tests/strings/bug34214.phpt - ext/standard/tests/strings/bug34214.phpt: - - Test for bug #34214 - -2005-08-23 Andrei Zmievski - - * ZendEngine2/zend_operators.c: - Damn. - - * ZendEngine2/zend_operators.c: - - Rewrite zend_u_binary_strncmp() to work on codepoint level. Calling - u_strCompare() doesn't help because it assumes that the input lengths - specify the number of UChar's. - - Change zend_u_binary_strcmp() to use u_strCompare() (and it's fine to - use it here, since we work with whole strings here). - - * ext/standard/var.c: - Fix verbosity for var_inspect(). - - * ZendEngine2/zend_operators.c: - This was so embarassingly silly. - -2005-08-23 Ilia Alshanetsky - - * (PHP_5_1) - ext/pcre/pcrelib/pcre_dfa_exec.c: - removed unused vars - -2005-08-23 Dmitry Stogov - - * unicode-progress.txt - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_exceptions.c - ext/standard/dir.c - ext/standard/dns.c - ext/standard/filestat.c - ext/standard/info.c - ext/standard/link.c - ext/standard/string.c - ext/standard/type.c - ext/standard/uniqid.c - ext/standard/tests/file/userdirstream.phpt - ext/standard/tests/strings/bug24098.phpt: - Unicode support - - * ZendEngine2/zend_API.h - ext/simplexml/simplexml.c - ext/sqlite/sqlite.c - ext/standard/array.c - ext/standard/basic_functions.c - ext/standard/image.c - ext/standard/md5.c - ext/standard/string.c: - Unicode support cleanup - - * NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/is_a.phpt: - Changed is_a() and is_subcalls_of() functions to not call __autoload() (in - the same way as "instanceof" operator). - - * unicode-progress.txt - ZendEngine2/zend_builtin_functions.c: - Unicode support for strncasecmp() - -2005-08-23 Derick Rethans - - * main/spprintf.c: - - Fixed another little buglet in the spprintf() formatters. - -2005-08-22 Andrei Zmievski - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h: - Unicode support for strcasecmp(). - -2005-08-22 Greg Beaver - - * (PHP_5_1) - pear/packages/XML_RPC-1.4.0.tar: - add XML_RPC 1.4.0 - - * (PHP_5_0) - pear/PEAR.php - pear/go-pear-list.php - pear/package-PEAR.xml - pear/package-PEAR.xml - pear/package-PEAR.xml - pear/PEAR/ErrorStack.php - pear/PEAR/ErrorStack.php - pear/PEAR/ErrorStack.php - pear/PEAR/Remote.php - pear/PEAR/Remote.php - pear/PEAR/Remote.php - pear/PEAR/Command/Package.php: - sync with PEAR 1.3.6 - - * (PHP_5_0) - pear/packages/XML_RPC-1.3.1.tar - pear/packages/XML_RPC-1.3.1.tar - pear/packages/XML_RPC-1.4.0.tar: - delete XML_RPC 1.3.1, add 1.4.0 - - * pear/packages/XML_RPC-1.4.0.tar - pear/packages/XML_RPC-1.4.0.tar - pear/packages/XML_RPC-1.4.0.tar - pear/packages/XML_RPC-1.4.0.tar: - 1.1.4; 1.1.6; - file XML_RPC-1.4.0.tar was initially added on branch PHP_5_0. - - * (PHP_5_1) - pear/go-pear-list.php: - move Archive_Tar 1.3.2 => 1.3.1 - 1.3.2 does not exist - -2005-08-22 Ilia Alshanetsky - - * (PHP_4_4) - ext/dba/config.m4 - ext/dba/config.m4 - ext/dba/config.m4: - MFH: Make dba extension support BerkleyDB 4.3. - - * ext/dba/config.m4: - Make dba extension support BerkleyDB 4.3. - -2005-08-22 Andrei Zmievski - - * ZendEngine2/zend_API.c: - We should use u_memcpy() whenever possible, to simplify code. - - * (PHP_5_0) - ext/pcre/config.m4 - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/README - ext/pcre/pcrelib/chartables.c - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.def - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcre_chartables.c - ext/pcre/pcrelib/pcre_compile.c - ext/pcre/pcrelib/pcre_config.c - ext/pcre/pcrelib/pcre_dfa_exec.c - ext/pcre/pcrelib/pcre_exec.c - ext/pcre/pcrelib/pcre_fullinfo.c - ext/pcre/pcrelib/pcre_get.c - ext/pcre/pcrelib/pcre_globals.c - ext/pcre/pcrelib/pcre_info.c - ext/pcre/pcrelib/pcre_internal.h - ext/pcre/pcrelib/pcre_maketables.c - ext/pcre/pcrelib/pcre_ord2utf8.c - ext/pcre/pcrelib/pcre_printint.c - ext/pcre/pcrelib/pcre_refcount.c - ext/pcre/pcrelib/pcre_scanner.cc - ext/pcre/pcrelib/pcre_scanner.h - ext/pcre/pcrelib/pcre_scanner_unittest.cc - ext/pcre/pcrelib/pcre_stringpiece.cc - ext/pcre/pcrelib/pcre_stringpiece.h - ext/pcre/pcrelib/pcre_stringpiece_unittest.cc - ext/pcre/pcrelib/pcre_study.c - ext/pcre/pcrelib/pcre_tables.c - ext/pcre/pcrelib/pcre_try_flipped.c - ext/pcre/pcrelib/pcre_ucp_findchar.c - ext/pcre/pcrelib/pcre_valid_utf8.c - ext/pcre/pcrelib/pcre_version.c - ext/pcre/pcrelib/pcre_xclass.c - ext/pcre/pcrelib/pcrecpp.cc - ext/pcre/pcrelib/pcrecpp.h - ext/pcre/pcrelib/pcrecpp_unittest.cc - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp_findchar.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/pcre.txt - ext/pcre/pcrelib/testdata/grepinput - ext/pcre/pcrelib/testdata/grepinputx - ext/pcre/pcrelib/testdata/greplist - ext/pcre/pcrelib/testdata/grepoutput - ext/pcre/pcrelib/testdata/testinput1 - ext/pcre/pcrelib/testdata/testinput2 - ext/pcre/pcrelib/testdata/testinput3 - ext/pcre/pcrelib/testdata/testinput4 - ext/pcre/pcrelib/testdata/testinput5 - ext/pcre/pcrelib/testdata/testinput6 - ext/pcre/pcrelib/testdata/testinput7 - ext/pcre/pcrelib/testdata/testinput8 - ext/pcre/pcrelib/testdata/testinput9 - ext/pcre/pcrelib/testdata/testoutput1 - ext/pcre/pcrelib/testdata/testoutput2 - ext/pcre/pcrelib/testdata/testoutput3 - ext/pcre/pcrelib/testdata/testoutput4 - ext/pcre/pcrelib/testdata/testoutput5 - ext/pcre/pcrelib/testdata/testoutput6 - ext/pcre/pcrelib/testdata/testoutput7 - ext/pcre/pcrelib/testdata/testoutput8 - ext/pcre/pcrelib/testdata/testoutput9: - Upgrade to PCRE 6.0. - -2005-08-22 Dmitry Stogov - - * ext/standard/tests/network/bug20134.phpt: - Now fread() returns bool(false) on error instead of empty string - -2005-08-22 Greg Beaver - - * (PHP_5_0) - pear/go-pear-list.php - pear/go-pear-list.php: - argh, Archive_Tar is version 1.3.1, not 1.3.2 - -2005-08-22 Dmitry Stogov - - * main/streams/streams.c: - Don't apply "unicode" filters in non-unicode mode - -2005-08-22 Derick Rethans - - * ext/xsl/xsltprocessor.c: - - Fixed typo. - -2005-08-22 Dmitry Stogov - - * ext/standard/string.c: - Fixed unicode support for ltrim() - -2005-08-22 Stanislav Malyshev - - * (PHP_5_1) - ZendEngine2/zend_builtin_functions.c: - fix crash if throw attempted outside of executable code - -2005-08-22 Dmitry Stogov - - * unicode-progress.txt - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_execute_API.c - ext/fdf/fdf.c - ext/ldap/ldap.c - ext/mysqli/mysqli_api.c - ext/pcntl/pcntl.c - ext/pcre/php_pcre.c - ext/readline/readline.c - ext/session/session.c - ext/sqlite/sqlite.c - ext/standard/array.c - ext/standard/basic_functions.c - ext/standard/type.c - ext/sybase_ct/php_sybase_ct.c - ext/xsl/xsltprocessor.c - main/output.c: - zend_is_callable() and zend_make_callable() were changed to return readable - function name as zval (instead of string). - - * ZendEngine2/zend_execute_API.c: - Fixed memory leak - -2005-08-21 Jani Taskinen - - * (PHP_5_0) - NEWS: - reorder - -2005-08-21 Zeev Suraski - - * (PHP_5_0) - NEWS: - Roll 5.0.5RC1 - - * (PHP_5_0) - NEWS - ext/standard/array.c - ext/standard/basic_functions.c - ext/standard/basic_functions.h: - Backport Mike's patch for user sort functions - -2005-08-21 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/zlib/zlib.c - ext/zlib/zlib.c - ext/zlib/zlib.c: - MFH: Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). - - * ext/zlib/zlib.c: - Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). - -2005-08-20 Greg Beaver - - * (PHP_4_4) - pear/install-pear.php - pear/install-pear.php: - add checks for extensions that must be loaded - -2005-08-19 Andrei Zmievski - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h: - Unicode support for strcmp()/strncmp(). - - * unicode-progress.txt - unicode-progress.txt - unicode-todo.txt - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_object_handlers.c: - -** empty log message *** - - * ext/standard/string.c: - Unicode support for ord() and chr(). - - * unicode-progress.txt: - This file should be used to keep track of extension upgrade progress. - Please add completed functions to the list. - - * ext/standard/string.c: - Use RETVAL_ASCII_STRINGL() here. - -2005-08-19 Jani Taskinen - - * NEWS: - Proper NEWS language that everyone should be able to understand.. - -2005-08-19 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Unicode support - -2005-08-19 Rolland Santimano - - * ext/standard/string.c: - - Unicode capable impl() of strrev() - -2005-08-19 Dmitry Stogov - - * ext/standard/http.c: - Quick fix (API was changed) - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - Unicode support cleanup - - * NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/instanceof.phpt: - nstanceof operator shouldn't call __autoload() - - * ext/standard/array.c - ext/standard/array.c: - ZTS fix - -2005-08-18 Andrei Zmievski - - * ext/standard/array.c: - Rework range() to be able to work on binary strings and also on Unicode - code points. Binary strings are not interpreted as numeric. - - * ext/standard/string.c: - Use u_totitle() instead of u_toupper() in ucwords(). - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_operators.h - ZendEngine2/zend_unicode.h: - - Implement zend_codepoint_to_uchar(). - - Rename and fix zend_get_unified_string_type() so that it does not - allow mixing of binary and Unicode types. - -2005-08-18 Edin Kadribasic - - * (PHP_4_4) - win32/php4dllts.dsp: - Sync with PCRE lib upgrade - -2005-08-18 Pierre-Alain Joye - - * (PHP_5_1) - pear/PEAR/Remote.php: - - fix bad revert and make the xmlrpc ext detections fallback - forgot that 5.1 still has pear in its branche - -2005-08-18 Wez Furlong - - * scripts/php-config.in: - mf 5.1 - - * (PHP_5_1) - scripts/php-config.in: - Add ext to the include path. - -2005-08-18 Dmitry Stogov - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_exceptions.c: - Suppoer for unicode exception messages - -2005-08-18 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - Zend/zend_alloc.c - ZendEngine2/zend_alloc.c: - MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is - reached) - - * (PHP_5_1) - NEWS - ZendEngine2/zend_alloc.c: - MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is - reached); - -2005-08-18 Dmitry Stogov - - * ZendEngine2/zend_API.h - ext/standard/array.c: - Unicode support for extract() - -2005-08-18 Antony Dovgal - - * ZendEngine2/zend_builtin_functions.c: - fix memleak - -2005-08-18 Ilia Alshanetsky - - * ZendEngine2/zend_alloc.c: - Fixed bug #34156 (memory usage remains elevated after memory limit is - reached) - -2005-08-18 Jani Taskinen - - * ext/oci8/oci8.c - ext/openssl/openssl.c - ext/oracle/oracle.c - ext/pcre/php_pcre.c - ext/session/mod_files.c - ext/simplexml/simplexml.c - ext/snmp/winsnmp.c - ext/standard/assert.c - ext/standard/php_fopen_wrapper.c - ext/sybase_ct/php_sybase_ct.c: - Nuked EOLs from error messages - - * ext/gd/libgd/gd_arc_f_buggy.c - ext/gd/libgd/gd_gd2.c - ext/gd/libgd/gd_gif_in.c - ext/gd/libgd/gd_io.c - ext/gd/libgd/gd_jpeg.c - ext/gd/libgd/gd_png.c - ext/gd/libgd/gd_ss.c - ext/gd/libgd/gd_wbmp.c - ext/gd/libgd/gdxpm.c - ext/gd/libgd/xbm.c: - Nuke EOLs from error messages - - * ext/ftp/ftp.c: - - Removed EOLs from error messages - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ext/dom/php_dom.c: - - Removed EOL from error message - -2005-08-18 Dmitry Stogov - - * ext/standard/var.c: - var_export() should escape \ and ' characters. - - * ZendEngine2/zend_exceptions.c - ext/dom/php_dom.c - ext/dom/tests/dom003.phpt - main/output.c: - Unicode support - - * ZendEngine2/zend.h: - -** empty log message *** - - * ZendEngine2/zend_API.c: - We don't need EMPY_STRING here. This function is execuited in non-unicode - context only. - - * ext/standard/tests/strings/bug29119.phpt - ext/standard/tests/strings/str_word_count.phpt: - Fixed tests - -2005-08-18 Rolland Santimano - - * ext/standard/string.c: - - Removed 'proto' from description of internal funcns: ucfirst()/ucwords() - -2005-08-18 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache - 2). - - * sapi/apache2handler/sapi_apache2.c: - Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). - -2005-08-17 Greg Beaver - - * (PHP_5_1) - pear/PEAR.php - pear/package-PEAR.xml: - add return by ref from PEAR::raiseError - - * (PHP_4_4) - pear/PEAR.php - pear/go-pear-list.php - pear/package-PEAR.xml: - re-enable XML_RPC 1.4.0 - add return by ref from PEAR::raiseError - - * (PHP_5_1) - pear/go-pear-list.php - pear/package-PEAR.xml - pear/PEAR/Remote.php: - re-enable XML_RPC 1.4.0 - -2005-08-17 Rolland Santimano - - * ext/standard/string.c: - Unicode-capable impl of ucwords() - -2005-08-17 Marcus Boerger - - * ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h: - - Fix TSRM - - * README.CVS-RULES: - - Please use the maintainer switch - -2005-08-17 Andrei Zmievski - - * ZendEngine2/zend_API.c: - Disallow mixing binary and Unicode types when T specifiers are used. - - * ext/standard/string.c: - Fix bin2hex() to work on binary data and return strings of correct type. - -2005-08-17 Rolland Santimano - - * ext/standard/string.c: - Unicode impl of ucfirst() - -2005-08-17 Andrei Zmievski - - * ZendEngine2/zend_API.c - ZendEngine2/zend_operators.c: - - Introduce 'y' specifier for functions expecting binary data. - - convert_to_binary() now uses convert_to_string() in non-Unicode mode. - -2005-08-17 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_object_handlers.c: - Unicode mode doesn't allow non-unicode properties - -2005-08-17 Jani Taskinen - - * NEWS: - News for PHP 6, nuked old news. - - * (PHP_5_1) - NEWS: - BFN - -2005-08-17 Andrei Zmievski - - * ZendEngine2/zend.h: - Bump up Zend version to 3.0.0 - - - * NEWS - unicode-todo.txt - unicode-todo.txt: - -** empty log message *** - -2005-08-17 Dmitry Stogov - - * ext/standard/array.c - ext/standard/tests/array/range.phpt: - Unicode support for range() - - * ext/standard/var.c: - Proper handling of unicode strings with \0 in the middle - - * NEWS - NEWS - NEWS - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug32981.phpt - ZendEngine2/tests/bug32981.phpt - ZendEngine2/tests/bug32981.phpt: - Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes - apache2.0.54 seg fault) - - * ext/simplexml/tests/004.phpt - ext/standard/string.c - tests/classes/tostring.phpt: - trim() should accept objects with __toString() method - -2005-08-17 Rolland Santimano - - * ext/standard/string.c: - php_u_trim_range(): Alloc UChar32 units rather than UChar - -2005-08-17 Dmitry Stogov - - * ZendEngine2/zend_API.c - ZendEngine2/zend_interfaces.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ext/ctype/ctype.c - ext/iconv/tests/eucjp2iso2022jp.phpt - ext/iconv/tests/eucjp2sjis.phpt - ext/iconv/tests/eucjp2utf8.phpt - ext/iconv/tests/iconv001.phpt - ext/iconv/tests/iconv_mime_decode_headers.phpt - ext/iconv/tests/iconv_mime_encode.phpt - ext/iconv/tests/iconv_strlen.phpt - ext/iconv/tests/iconv_strpos.phpt - ext/iconv/tests/iconv_strrpos.phpt - ext/iconv/tests/iconv_substr.phpt - ext/iconv/tests/ob_iconv_handler.phpt - ext/standard/var.c - ext/standard/tests/array/locale_sort.phpt - ext/standard/tests/serialize/006.phpt - ext/standard/tests/strings/htmlentities.phpt - ext/standard/tests/strings/htmlentities15.phpt - ext/standard/tests/strings/strtoupper.phpt - ext/xml/tests/xml006.phpt - ext/xml/tests/xml007.phpt - tests/strings/002.phpt: - Unicode support - - * ext/standard/string.c - ext/standard/tests/strings/bug22224.phpt: - Fixed implode() bugs - -2005-08-17 Jani Taskinen - - * main/main.c: - Fix EOLs under winblows - -2005-08-17 Rolland Santimano - - * ext/standard/string.c: - Updated implode() impl as per Andrei's comments - [http://news.php.net/php.cvs/33457] - -2005-08-16 Marcus Boerger - - * ext/standard/string.c: - - TSRM Fix - -2005-08-16 Andrei Zmievski - - * ext/standard/md5.c: - md5() and md5_file() should return binary strings when raw_output is - set. - - * ZendEngine2/zend_compile.c: - Fix it here too - -2005-08-16 Marcus Boerger - - * (PHP_5_0) - main/main.c: - - MFH: Prevent E_STRICT from ending up as exception - -2005-08-16 Andrei Zmievski - - * ZendEngine2/zend_builtin_functions.c: - Z_UNI* are the right macros to use. - -2005-08-16 Marcus Boerger - - * main/main.c - main/main.c: - - Prevent E_STRICT from ending up as exception - -2005-08-16 Derick Rethans - - * ext/standard/php_smart_str.h - main/spprintf.c: - - Fixed a couple of bugs in the new smart_str macros, and allow them to - allocate two extra bytes (so that we can pad them with two \0's for - UTF-16) - - Fixed usage of smart_str's in the PAD and INS_STRING macros. - -2005-08-16 Antony Dovgal - - * ext/standard/string.c: - nuke unused vars - -2005-08-16 Dmitry Stogov - - * ZendEngine2/zend_API.c - ext/dom/tests/bug28817.phpt - ext/simplexml/simplexml.c - ext/simplexml/tests/008.phpt - ext/simplexml/tests/009.phpt - ext/simplexml/tests/015.phpt - ext/simplexml/tests/022.phpt - ext/sqlite/sqlite.c - ext/sqlite/tests/sqlite_002.phpt - ext/sqlite/tests/sqlite_003.phpt - ext/sqlite/tests/sqlite_005.phpt - ext/sqlite/tests/sqlite_006.phpt - ext/sqlite/tests/sqlite_007.phpt - ext/sqlite/tests/sqlite_008.phpt - ext/sqlite/tests/sqlite_009.phpt - ext/sqlite/tests/sqlite_010.phpt - ext/sqlite/tests/sqlite_011.phpt - ext/sqlite/tests/sqlite_012.phpt - ext/sqlite/tests/sqlite_013.phpt - ext/sqlite/tests/sqlite_014.phpt - ext/sqlite/tests/sqlite_015.phpt - ext/sqlite/tests/sqlite_016.phpt - ext/sqlite/tests/sqlite_019.phpt - ext/sqlite/tests/sqlite_022.phpt - ext/sqlite/tests/sqlite_023.phpt - ext/sqlite/tests/sqlite_024.phpt - ext/sqlite/tests/sqlite_025.phpt - ext/sqlite/tests/sqlite_026.phpt - ext/sqlite/tests/sqlite_oo_002.phpt - ext/sqlite/tests/sqlite_oo_003.phpt - ext/sqlite/tests/sqlite_oo_008.phpt - ext/sqlite/tests/sqlite_oo_009.phpt - ext/sqlite/tests/sqlite_oo_010.phpt - ext/sqlite/tests/sqlite_oo_011.phpt - ext/sqlite/tests/sqlite_oo_012.phpt - ext/sqlite/tests/sqlite_oo_013.phpt - ext/sqlite/tests/sqlite_oo_014.phpt - ext/sqlite/tests/sqlite_oo_015.phpt - ext/sqlite/tests/sqlite_oo_016.phpt - ext/sqlite/tests/sqlite_oo_020.phpt - ext/sqlite/tests/sqlite_oo_021.phpt - ext/sqlite/tests/sqlite_oo_022.phpt - ext/sqlite/tests/sqlite_oo_024.phpt - ext/sqlite/tests/sqlite_oo_025.phpt - ext/sqlite/tests/sqlite_oo_026.phpt - ext/sqlite/tests/sqlite_oo_028.phpt - ext/sqlite/tests/sqlite_oo_030.phpt - ext/standard/image.c - ext/standard/md5.c - ext/standard/var.c - ext/standard/tests/array/bug25708.phpt - ext/standard/tests/array/bug26458.phpt - ext/standard/tests/image/bug13213.phpt - ext/standard/tests/image/getimagesize.phpt - ext/standard/tests/image/getimagesize_246x247.phpt - ext/standard/tests/image/getimagesize_384x385.phpt - ext/standard/tests/image/getimagesize_swc.phpt - ext/standard/tests/image/image_type_to_mime_type.phpt - ext/standard/tests/strings/explode.phpt - ext/standard/tests/strings/strcspn.phpt - ext/standard/tests/strings/strspn.phpt - ext/standard/tests/strings/strstr.phpt: - Unicode support - -2005-08-16 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - ext/standard/url.c - ext/standard/url.c - ext/standard/url.c - ext/standard/tests/strings/url_t.phpt - ext/standard/tests/strings/url_t.phpt - ext/standard/tests/strings/url_t.phpt: - MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme). - - * NEWS - ext/standard/url.c - ext/standard/tests/strings/url_t.phpt: - Fixed bug #34148 (+,- and . not supported as parts of scheme). - -2005-08-16 Rolland Santimano - - * ext/standard/string.c: - Unicode capable impl of implode() - -2005-08-16 Zeev Suraski - - * (PHP_5_1) - NEWS - configure.in - main/php_version.h: - Go back to dev - -2005-08-16 Edin Kadribasic - - * (PHP_5_1) - pear/go-pear-list.php: - Rebundle XML_RPC in the correct version for the Windows distro. - -2005-08-16 Zeev Suraski - - * (PHP_5_1) - NEWS - configure.in - main/php_version.h: - Roll RC1 - -2005-08-16 Dmitry Stogov - - * ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.c: - Fixed memory leak - -2005-08-16 Edin Kadribasic - - * (PHP_5_1) - ext/pgsql/pgsql.c: - Use free() instead of PQfreemem() to maintain compabitibility with older - PostgreSQL client libraries (bug #33813). - -2005-08-16 Rolland Santimano - - * ext/simplexml/simplexml.c - ext/standard/http_fopen_wrapper.c: - Updated calls to php_trim() to provide arg for returned string type - - * ext/standard/php_string.h - ext/standard/string.c: - php_trim() takes extra arg to determine string type to be returned - -2005-08-16 Ilia Alshanetsky - - * ext/standard/info.c: - Input validation part 2. - -2005-08-15 Jani Taskinen - - * configure.in: - Fail gracefully if icu-config is not found - -2005-08-15 Ilia Alshanetsky - - * (PHP_5_1) - ext/standard/info.c: - Chunk the output - -2005-08-15 Jani Taskinen - - * run-tests.php: - This is like a virus..spread everywhere :) - - * TODO: - DONE - - * main/main.c: - These are not defined anymore - - * Makefile.global - configure.in - makerpm - run-tests.php - server-tests.php - main/build-defs.h.in: - Goodbye PEAR - -2005-08-15 Pierre-Alain Joye - - * README.PEAR: - - if questions, rtfm - -2005-08-15 Jani Taskinen - - * pear/.cvsignore - pear/Console/Getopt.php - pear/Console/tests/.cvsignore - pear/Console/tests/001-getopt.phpt - pear/OS/Guess.php: - Nuke PEAR - -2005-08-15 Pierre-Alain Joye - - * README.PEAR: - - add a little doc to redirect people to go-pear - - * pear/PEAR/Autoloader.php - pear/PEAR/Builder.php - pear/PEAR/Command.php - pear/PEAR/Common.php - pear/PEAR/Config.php - pear/PEAR/Dependency.php - pear/PEAR/DependencyDB.php - pear/PEAR/Downloader.php - pear/PEAR/ErrorStack.php - pear/PEAR/Exception.php - pear/PEAR/Installer.php - pear/PEAR/Packager.php - pear/PEAR/Registry.php - pear/PEAR/Remote.php - pear/PEAR/RunTest.php: - - remove files - - * pear/tests/.cvsignore - pear/tests/PEAR_test_mock_pearweb.php.inc - pear/tests/common_sortPkgDeps1_package.xml - pear/tests/common_sortPkgDeps2_package.xml - pear/tests/common_sortPkgDeps3_package.xml - pear/tests/common_sortPkgDeps4_package.xml - pear/tests/common_sortPkgDeps5_package.xml - pear/tests/common_sortPkgDeps6_package.xml - pear/tests/depnoreleases-1.0.tgz - pear/tests/depunstable-1.0.tgz - pear/tests/download_test.config.inc - pear/tests/download_test_classes.php.inc - pear/tests/merge.input - pear/tests/merge2.input - pear/tests/package-PEARtests.xml - pear/tests/pear1.phpt - pear/tests/pear2.phpt - pear/tests/pear_autoloader.phpt - pear/tests/pear_channelfile.phpt - pear/tests/pear_common_analyzeSC.phpt - pear/tests/pear_common_buildProvidesArray.phpt - pear/tests/pear_common_downloadHttp.phpt - pear/tests/pear_common_infoFromString.phpt - pear/tests/pear_common_sortPkgDeps.phpt - pear/tests/pear_common_validPackageVersion.phpt - pear/tests/pear_config.phpt - pear/tests/pear_config_1.1.phpt - pear/tests/pear_dependency_checkExtension.phpt - pear/tests/pear_dependency_checkPackage.phpt - pear/tests/pear_dependency_checkPackageUninstall.phpt - pear/tests/pear_downloader_invalid.phpt - pear/tests/pear_downloader_new.phpt - pear/tests/pear_downloader_old.phpt - pear/tests/pear_error.phpt - pear/tests/pear_error2.phpt - pear/tests/pear_error3.phpt - pear/tests/pear_error4.phpt - pear/tests/pear_installer1.phpt - pear/tests/pear_installer2.phpt - pear/tests/pear_installer3.phpt - pear/tests/pear_installer4.phpt - pear/tests/pear_installer5.phpt - pear/tests/pear_installer_installFile_channels.phpt - pear/tests/pear_installer_install_channels.phpt - pear/tests/pear_packager.phpt - pear/tests/pear_registry.phpt - pear/tests/pear_registry_1.1.phpt - pear/tests/pear_registry_inc.php.inc - pear/tests/pear_system.phpt - pear/tests/php.ini - pear/tests/php_dump.php.inc - pear/tests/pkg1-1.1.tgz - pear/tests/pkg1-2.0b1.tgz - pear/tests/pkg2-1.1.tgz - pear/tests/pkg3-1.1.tgz - pear/tests/pkg3-1.4.tgz - pear/tests/pkg4-1.1.tgz - pear/tests/pkg4AndAHalf-1.3.tgz - pear/tests/pkg5-1.1.tgz - pear/tests/stabilitytoolow-0.3.tgz - pear/tests/stabilitytoolow-0.5.tgz - pear/tests/stabilitytoolow-0.6beta.tgz - pear/tests/stabilitytoolow-1.0b1.tgz - pear/tests/stabilitytoolow-2.0a1.tgz - pear/tests/stabilitytoolow-2.0b1.tgz - pear/tests/stabilitytoolow-2.0dev.tgz - pear/tests/stabilitytoolow-3.0dev.tgz - pear/tests/system.input - pear/tests/testdownload.tgz - pear/tests/toonew.conf - pear/tests/user.input - pear/tests/user2.input - pear/tests/user3.input: - - cvs delete is not recursive... - - * pear/make-pear-bundle.php: - - some other (#1 out 2) - - * pear/CODING_STANDARDS - pear/Makefile.frag - pear/PEAR.php - pear/README - pear/System.php - pear/catalog - pear/go-pear-list.php - pear/go-pear.bat - pear/install-pear.php - pear/install-pear.txt - pear/package-Archive_Tar.xml - pear/package-Console_Getopt.xml - pear/package-PEAR.xml - pear/package.dtd - pear/template.spec - pear/Archive/Tar.php - pear/Archive/docs/Tar.txt - pear/PEAR/Command/Auth.php - pear/PEAR/Command/Build.php - pear/PEAR/Command/Common.php - pear/PEAR/Command/Config.php - pear/PEAR/Command/Install.php - pear/PEAR/Command/Mirror.php - pear/PEAR/Command/Package.php - pear/PEAR/Command/Registry.php - pear/PEAR/Command/Remote.php - pear/PEAR/Frontend/CLI.php - pear/docs/Archive_Tar.txt - pear/docs/rfc01_PEAR_pecl-binaries.txt - pear/docs/rfc01_PEAR_subpackages.txt - pear/packages/HTML_Template_IT-1.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/XML_RPC-1.3.1.tar - pear/scripts/.cvsignore - pear/scripts/pear.bat - pear/scripts/pear.sh - pear/scripts/pearcmd.php - pear/scripts/pearwin.php: - - these files are outdated, /pear-core is the repository for pear and - respectivelly /pear for other pacakges. - The install procedure has to be changed as well, as planed. (#1 out 2) - -2005-08-15 Johannes Schlüter - - * ext/standard/string.c: - - Fix leak with explode of empty unicode string - -2005-08-15 Rob Richards - - * (PHP_5_1) - NEWS: - BFN - - * (PHP_5_1) - ext/dom/document.c: - MFH: Fixed bug #34103 (line numbering not maintained in dom document) - - * ext/dom/document.c: - Fixed bug #34103 (line numbering not maintained in dom document) - -2005-08-15 Dmitry Stogov - - * ZendEngine2/zend.h - ext/standard/array.c: - Unicode support - -2005-08-15 Ilia Alshanetsky - - * ext/standard/info.c: - input validation. - -2005-08-15 Dmitry Stogov - - * ext/tokenizer/tokenizer.c: - Fixed memory leak - - * ZendEngine2/zend.c - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_constants.c - ZendEngine2/zend_hash.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_objects.c - ZendEngine2/zend_operators.c: - Fixed several unicode related bugs - - * run-tests.php - ZendEngine2/tests/bug22836.phpt - ZendEngine2/tests/bug23104.phpt - ZendEngine2/tests/bug26010.phpt - ZendEngine2/tests/bug26695.phpt - ZendEngine2/tests/bug27798.phpt - ZendEngine2/tests/bug28442.phpt - ZendEngine2/tests/bug28444.phpt - ZendEngine2/tests/bug29505.phpt - ZendEngine2/tests/bug29674.phpt - ZendEngine2/tests/bug30140.phpt - ZendEngine2/tests/bug30162.phpt - ZendEngine2/tests/bug30407.phpt - ZendEngine2/tests/bug30702.phpt - ZendEngine2/tests/bug30856.phpt - ZendEngine2/tests/bug31683.phpt - ZendEngine2/tests/bug32799.phpt - ZendEngine2/tests/bug32981.phpt - ZendEngine2/tests/bug33243.phpt - ZendEngine2/tests/bug33999.phpt - ZendEngine2/tests/bug34064.phpt - ZendEngine2/tests/unset_cv11.phpt - ext/simplexml/tests/005.phpt - ext/simplexml/tests/006.phpt - ext/simplexml/tests/007.phpt - ext/simplexml/tests/009.phpt - ext/simplexml/tests/014.phpt - ext/simplexml/tests/014a.phpt - ext/simplexml/tests/014b.phpt - ext/simplexml/tests/016.phpt - ext/simplexml/tests/016a.phpt - ext/simplexml/tests/019.phpt - ext/standard/tests/array/001.phpt - ext/standard/tests/array/002.phpt - ext/standard/tests/array/003.phpt - ext/standard/tests/array/004.phpt - ext/standard/tests/array/005.phpt - ext/standard/tests/array/006.phpt - ext/standard/tests/array/007.phpt - ext/standard/tests/array/008.phpt - ext/standard/tests/array/array_change_key_case.phpt - ext/standard/tests/array/array_chunk.phpt - ext/standard/tests/array/array_count_values.phpt - ext/standard/tests/array/array_intersect_1.phpt - ext/standard/tests/array/bug20381.phpt - ext/standard/tests/array/bug21182.phpt - ext/standard/tests/array/bug21918.phpt - ext/standard/tests/array/bug21998.phpt - ext/standard/tests/array/bug22088.phpt - ext/standard/tests/array/bug24198.phpt - ext/standard/tests/array/bug24220.phpt - ext/standard/tests/array/bug24980.phpt - ext/standard/tests/array/bug25359.phpt - ext/standard/tests/array/bug25708.phpt - ext/standard/tests/array/bug28739.phpt - ext/standard/tests/array/bug29253.phpt - ext/standard/tests/array/bug29493.phpt - ext/standard/tests/array/bug30833.phpt - ext/standard/tests/array/bug31213.phpt - ext/standard/tests/general_functions/getopt.phpt - ext/standard/tests/strings/bug24208.phpt - ext/standard/tests/strings/bug27278.phpt - tests/classes/__call_001.phpt - tests/classes/__set__get_001.phpt - tests/classes/__set__get_004.phpt - tests/classes/__set__get_005.phpt - tests/classes/array_access_001.phpt - tests/classes/array_access_002.phpt - tests/classes/array_access_003.phpt - tests/classes/array_access_004.phpt - tests/classes/array_access_005.phpt - tests/classes/array_access_008.phpt - tests/classes/array_access_009.phpt - tests/classes/array_access_010.phpt - tests/classes/array_access_011.phpt - tests/classes/autoload_002.phpt - tests/classes/clone_001.phpt - tests/classes/clone_002.phpt - tests/classes/clone_004.phpt - tests/classes/inheritance_002.phpt - tests/lang/038.phpt - tests/lang/bug19943.phpt - tests/lang/bug21600.phpt - tests/lang/bug21961.phpt - tests/lang/bug22231.phpt - tests/lang/bug22592.phpt - tests/lang/bug23624.phpt - tests/strings/bug22592.phpt: - Test engine is improved to support unicode mode - -2005-08-15 Derick Rethans - - * (PHP_4_4) - NEWS - Zend/zend_compile.c - Zend/zend_execute.c: - - MFH: Fixed bug #33558 (Warning with nested calls to functions returning - by - reference). - -2005-08-15 Dmitry Stogov - - * ext/standard/string.c: - Fixed trim()'s memory leak in unicode mode - - * ext/dom/tests/dom003.phpt - ext/standard/tests/array/007.phpt - ext/standard/tests/array/array_intersect_1.phpt - tests/classes/__set__get_005.phpt - tests/classes/array_access_009.phpt - tests/classes/array_access_010.phpt - tests/classes/array_access_011.phpt - tests/classes/clone_003.phpt - tests/classes/private_members.phpt: - Tests are fixed according to new var_dump()/pront_r() format (to pass in - non-unicode mode) - - * main/spprintf.c: - Fixed var_dump() identation bug - - * ZendEngine2/zend.c: - Fixed another print_r() bug - - * ZendEngine2/zend.c: - Fixed print_r() in unicode mode. - -2005-08-14 Marcus Boerger - - * ZendEngine2/zend.c - ext/standard/var.c: - - Simplify and make work in all modes - - * main/spprintf.c: - - Need to terminate [v]uspprintf() with two \0 - -2005-08-14 Ilia Alshanetsky - - * ext/wddx/wddx.c: - Fixed build. - -2005-08-14 Marcus Boerger - - * main/spprintf.c: - - Where did my backslash vanish? - - * main/spprintf.c: - - Handle different cases of the actual strings correctly - - * ext/standard/php_smart_str.h - main/spprintf.c - main/spprintf.h: - - Initial support of easy way to generate unicode strings: [v]uspprinf() - - * ZendEngine2/zend.c: - - Treat class_name in the exact same manner as prop_name before - - * ext/standard/var.c: - - If prop_name is printed as unicode then class_name needs to be treated - in the exact same manner - - * ext/standard/var.c: - - Show classname very needed - - No 3rd " which doesn't help parsing - -2005-08-14 Wez Furlong - - * main/streams/streams.c: - tidy up implicit_mode handling; spotted by Nuno - There's probably a much more efficient way to do this than the current - strchr stuff. - -2005-08-14 Johannes Schlüter - - * sapi/cli/php_cli_readline.c: - - Fix tab-completion in unicode mode and for constants. - - * (PHP_5_1) - sapi/cli/php_cli_readline.c: - - Fix tab-completion for constants. - -2005-08-14 Jani Taskinen - - * ext/wddx/php_wddx_api.h - ext/wddx/tests/001.phpt - ext/wddx/tests/bug27287.phpt: - Missed some "de" to "un" changes - - * ext/wddx/php_wddx.h - ext/wddx/wddx.c: - - consistency fix, part 1/inf - -2005-08-13 Marcus Boerger - - * ext/standard/type.c: - - ntive is better than standard (Andrei) - -2005-08-13 Wez Furlong - - * main/streams/streams.c: - a bit of pedantic ws - - * ext/com_dotnet/com_handlers.c - ext/com_dotnet/com_variant.c: - unicode enable COM parameters (but not method/property names yet) - - * ext/standard/datetime.h: - could have sworn that I did this already - -2005-08-13 Marcus Boerger - - * ext/standard/type.c: - - IS_STRING does not necessarily mean ascii so 'standard' is better - - * ext/standard/basic_functions.c - ext/standard/php_type.h - ext/standard/type.c: - Add is_unicode(), is_binary() and is_buffer() - -2005-08-13 Wez Furlong - - * ext/com_dotnet/com_variant.c - ext/standard/basic_functions.h - ext/standard/datetime.c - ext/standard/pageinfo.c - ext/standard/pageinfo.h: - vs.net 2005 introduces 64-bit time_t. - - I can't say that I think this is a great idea, but it does highlight a - couple - of dodgy areas where we assume that ints and longs are the same thing as - time_t's. Let's try to ensure that we declare structure fields and - function - parameters with the correct type when we're talkingabout time_t's, to - avoid - possibly nasty problems with passing the wrong sized thing around. - -2005-08-13 Marcus Boerger - - * ZendEngine2/zend_exceptions.c - ZendEngine2/zend_opcode.c: - - Unicode - - * ZendEngine2/zend_alloc.h: - - This might already be defined - -2005-08-12 Wez Furlong - - * ext/standard/filters.c: - what they totally screw up on one hand, MS compilers almost compensate with - on - the other. - -2005-08-12 Antony Dovgal - - * main/streams/streams.c: - make valgrind and gcc happy - - * ZendEngine2/zend_hash.c: - initialize key type when adding next index - - * main/main.c: - allow default_charset & default_mimetype to be changed during runtime - - * ext/pcre/pcrelib/pcre_dfa_exec.c: - nuke unused variables - - * ext/standard/file.c: - fix fgetc() & compile warnings - - * ZendEngine2/zend_alloc.h: - fix typo noticed by Nuno - - * ext/standard/var.c: - change ["var_name":private"] -> ["var_name:private"] - - * I'm also not sure we want ["var_name:public"], but I left it as is. - -2005-08-12 Andrei Zmievski - - * unicode-todo.txt: - Update. - -2005-08-12 Antony Dovgal - - * ext/standard/array.c: - fix compile warnings - -2005-08-12 Andrei Zmievski - - * ZendEngine2/zend_alloc.h: - -** empty log message *** - - * ZendEngine2/zend_alloc.h: - Add unicode macros for when Zend memory manager is disabled. - -2005-08-12 Antony Dovgal - - * ext/standard/array.c: - fix array_merge() adding one superfluous byte to the key - - * ext/standard/string.c: - fix php_u_trim() and compile warnings - -2005-08-12 Jani Taskinen - - * NEWS - acinclude.m4: - MFB: - Fixed bug #33326 (Cannot build extensions with phpize on Macosx). - - * (PHP_5_1) - NEWS - acinclude.m4: - - Fixed bug #33326 (Cannot build extensions with phpize on Macosx). - -2005-08-12 Dmitry Stogov - - * ZendEngine2/zend_execute_API.c: - Fixed user function call in unicode mode - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.c: - Fixed typo (ZVAL_LONG() -> ZVAL_DOUBLE()) - -2005-08-12 Jani Taskinen - - * acinclude.m4: - MFB - - * (PHP_5_1) - acinclude.m4: - - Fixed bug #34097 (configure failed to initize RE2C="exit 0;" when re2c is - not found) - -2005-08-12 Dmitry Stogov - - * ext/standard/string.c: - Fixed str_repeat() bug - - * main/php_variables.c: - Fixed incorrect variable parsing in non-unicode mode - - * ZendEngine2/zend_object_handlers.c: - Fixed support fot provate properties in unicode mode. - - * ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.h - ZendEngine2/zend_interfaces.c - ZendEngine2/zend_interfaces.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ext/dom/attr.c - ext/dom/cdatasection.c - ext/dom/characterdata.c - ext/dom/comment.c - ext/dom/document.c - ext/dom/documentfragment.c - ext/dom/dom_iterators.c - ext/dom/domexception.c - ext/dom/domimplementation.c - ext/dom/element.c - ext/dom/entityreference.c - ext/dom/namednodemap.c - ext/dom/node.c - ext/dom/nodelist.c - ext/dom/php_dom.c - ext/dom/php_dom.c - ext/dom/processinginstruction.c - ext/dom/text.c - ext/dom/xpath.c - ext/simplexml/simplexml.c: - Unicode support - -2005-08-12 Sebastian Bergmann - - * ext/standard/string.c: - Patch by Michael Wallner, signed off by Edin Kadribasic. - -2005-08-12 Jani Taskinen - - * configure.in: - more tabs - -2005-08-12 Sebastian Bergmann - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.h - ZendEngine2/zend_reflection_api.c - ext/com_dotnet/com_extension.c - ext/dom/php_dom.c - ext/mysql/php_mysql.c - ext/mysqli/mysqli.c - ext/mysqli/mysqli_driver.c - ext/pgsql/pgsql.c - ext/simplexml/php_simplexml.h - ext/simplexml/simplexml.c - ext/sqlite/pdo_sqlite2.c - ext/sqlite/sqlite.c - ext/standard/string.c: - ZTS fixes. - -2005-08-12 Andi Gutmans - - * php.ini-dist - php.ini-recommended: - - Add unicode INI settings - -2005-08-12 Ilia Alshanetsky - - * ZendEngine2/zend.c: - Fixed build, zend_error_noreturn was being defined twice. - -2005-08-12 Jani Taskinen - - * ext/standard/credits.c: - No more versions here - - * configure.in: - No tabs in config* files! - - * configure.in - ZendEngine2/Makefile.am: - - No more zend_multibyte.* - - * sapi/apache_hooks/mod_php5.c: - Nuke unused code - - * sapi/apache/mod_php5.c: - - Unused - - * ZendEngine2/Zend.m4 - ZendEngine2/zend_highlight.c - ZendEngine2/zend_multibyte.c - ZendEngine2/zend_multibyte.h: - Nuked unneeded multibyte stuff - -2005-08-11 Jani Taskinen - - * (PHP_5_1) - ext/standard/tests/array/bug29253.phpt: - no DOS EOLs! - - * (PHP_4_4) - ext/standard/tests/array/bug29253.phpt: - - nuked DOS EOLs.. - - * (PHP_5_1) - ext/standard/tests/array/bug33940.phpt: - - Fixed test - - * ext/standard/tests/array/bug33940.phpt: - fix test - -2005-08-11 Andrei Zmievski - - * Makefile.global - README.UNICODE - configure.in - run-tests.php - unicode-issues.txt - unicode-todo.txt - ext/bz2/bz2_filter.c - ext/dom/php_dom.c - ext/dom/php_dom.h - ext/iconv/iconv.c - ext/mysql/php_mysql.c - ext/simplexml/simplexml.c - ext/sqlite/sqlite.c - ext/standard/array.c - ext/standard/assert.c - ext/standard/basic_functions.c - ext/standard/credits.c - ext/standard/file.c - ext/standard/file.h - ext/standard/filters.c - ext/standard/info.c - ext/standard/php_string.h - ext/standard/php_var.h - ext/standard/streamsfuncs.c - ext/standard/string.c - ext/standard/type.c - ext/standard/user_filters.c - ext/standard/var.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/tests/file/stream_get_line.phpt - ext/xml/xml.c - ext/zlib/zlib_filter.c - main/SAPI.c - main/SAPI.h - main/main.c - main/output.c - main/php.h - main/php_streams.h - main/php_variables.c - main/php_variables.h - main/rfc1867.c - main/spprintf.c - main/spprintf.h - main/streams/cast.c - main/streams/filter.c - main/streams/php_stream_context.h - main/streams/php_stream_filter_api.h - main/streams/streams.c - sapi/apache/mod_php5.c - sapi/apache_hooks/mod_php5.c: - Unicode support. - - * ZendEngine2/Makefile.am - ZendEngine2/Zend.m4 - ZendEngine2/flex.skl - ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_alloc.c - ZendEngine2/zend_alloc.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_constants.c - ZendEngine2/zend_constants.h - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_globals.h - ZendEngine2/zend_globals_macros.h - ZendEngine2/zend_hash.c - ZendEngine2/zend_hash.h - ZendEngine2/zend_highlight.c - ZendEngine2/zend_ini.c - ZendEngine2/zend_ini_scanner.l - ZendEngine2/zend_interfaces.c - ZendEngine2/zend_interfaces.h - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_scanner.h - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_multibyte.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_objects.c - ZendEngine2/zend_objects_API.c - ZendEngine2/zend_opcode.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.h - ZendEngine2/zend_strtod.c - ZendEngine2/zend_strtol.c - ZendEngine2/zend_unicode.c - ZendEngine2/zend_unicode.h - ZendEngine2/zend_variables.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Unicode support - -2005-08-11 Jani Taskinen - - * ext/sqlite/tests/.cvsignore: - missing entry - - * (PHP_5_1) - ext/standard/credits_ext.h: - - Regenerated. - - * (PHP_5_1) - NEWS: - BFNS - -2005-08-11 Antony Dovgal - - * (PHP_4_4) - ext/sysvmsg/sysvmsg.c: - fix proto - -2005-08-11 Marcus Boerger - - * (PHP_5_1) - ext/standard/credits.c: - - And this is version 5.1 - - * (PHP_4_4) - ext/standard/credits.c: - - This is actually 4.4 - -2005-08-11 Antony Dovgal - - * NEWS - ZendEngine2/zend_reflection_api.c: - MF5.1: fix #34078 (Reflection API problems in methods with boolean or null - default values) - - (andrei said to sara a few hours ago you may commit whatever you want - until 9pm) (c) helly - if there are any problems with this patch - please tell me, I'll revert it - immediately - - * (PHP_5_0) - NEWS - NEWS: - BFN - - * (PHP_5_0) - ZendEngine2/zend_reflection_api.c: - MF5.1: fix #34078 (Reflection API problems in methods with boolean or null - default values) - - * (PHP_5_1) - ZendEngine2/zend_reflection_api.c: - fix #34078 (Reflection API problems in methods with boolean or null default - values) - -2005-08-11 Marcus Boerger - - * ext/standard/credits_sapi.h - sapi/cli/CREDITS: - - Johannes did a great work on the shell - - * ZendEngine2/zend_compile.c: - - For internal classes we must auto generate the abstract class flags. - -2005-08-11 Rasmus Lerdorf - - * (PHP_5_1) - NEWS - configure.in - pear/go-pear-list.php - pear/package-PEAR.xml - pear/PEAR/Remote.php - pear/packages/XML_RPC-1.3.1.tar - pear/tests/PEAR_test_mock_pearweb.php.inc - pear/tests/download_test_classes.php.inc - pear/tests/package-PEARtests.xml: - Remove pear/XML_RPC dependency for the pear installer - PEAR guys, please doublecheck this. - -2005-08-11 Frank M. Kromann - - * (PHP_5_1) - ext/ming/ming.c: - Revert the last patch so we can release PHP 5.1 - -2005-08-10 Rasmus Lerdorf - - * main/php_variables.c: - MFB minor consistency cleanup - - * (PHP_5_1) - main/php_variables.c: - Minor consistency cleanup - -2005-08-10 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - NEWS - ext/wddx/wddx.c - ext/wddx/wddx.c: - MFH: Fixed bug #34068 (Numeric string as array key not cast to integer in - wddx_deserialize()). - - * ext/wddx/wddx.c: - Fixed bug #34068 (Numeric string as array key not cast to integer in - wddx_deserialize()). - -2005-08-10 Dmitry Stogov - - * NEWS - NEWS - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h: - Fixed bug #34062 (Crash in catch block when many arguments are used) - - * NEWS - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_compile.h - ext/standard/basic_functions.c - ext/standard/basic_functions.c: - Fixed bug #25359 (array_multisort() doesn't work in a function if array is - global or reference) - - * ZendEngine2/tests/bug34064.phpt - ZendEngine2/tests/bug34064.phpt: - - Fixed bug #34064 (arr[] as param to function in class gives invalid - opcode) - - * NEWS - NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug34064.phpt: - Fixed bug #34064 (arr[] as param to function in class gives invalid opcode) - - * ZendEngine2/tests/bug34064.phpt - ZendEngine2/tests/bug34064.phpt: - - file bug34064.phpt was initially added on branch PHP_5_0. - - * (PHP_4_4) - NEWS - NEWS - Zend/zend_execute.c - ZendEngine2/zend_execute.c: - Fixed bug #34064 (arr[] as param to function is allowed only if function - receives argument by reference) - -2005-08-10 Antony Dovgal - - * ext/standard/array.c: - fix build - -2005-08-10 Dmitry Stogov - - * ext/standard/tests/array/bug33940.phpt - ext/standard/tests/array/bug33940.phpt - ext/standard/tests/array/bug33940.phpt: - 1.2.4; - Fixed bug #33940 (array_map() fails to pass by reference when called - recursively) - - * NEWS - NEWS - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug33940.phpt - ext/standard/tests/array/bug33940.phpt: - Fixed bug #33940 (array_map() fails to pass by reference when called - recursively) - - * ext/standard/tests/array/bug33940.phpt - ext/standard/tests/array/bug33940.phpt: - - file bug33940.phpt was initially added on branch PHP_5_1. - - * ext/standard/tests/array/bug29253.phpt - ext/standard/tests/array/bug29253.phpt - ext/standard/tests/array/bug29253.phpt: - 1.2.4; - Fixed bug #29253 (array_diff with $GLOBALS argument fails) - - * NEWS - NEWS - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug29253.phpt - ext/standard/tests/array/bug29253.phpt: - Fixed bug #29253 (array_diff with $GLOBALS argument fails) - - * ext/standard/tests/array/bug29253.phpt - ext/standard/tests/array/bug29253.phpt: - - file bug29253.phpt was initially added on branch PHP_5_1. - - * NEWS - NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/tests/bug34045.phpt: - Fixed bug #34045 (Buffer overflow with serialized object) - - * ZendEngine2/tests/bug34045.phpt - ZendEngine2/tests/bug34045.phpt: - - file bug34045.phpt was initially added on branch PHP_5_1. - -2005-08-09 Andi Gutmans - - * (PHP_5_1) - NEWS: - - This didn't end up being included - -2005-08-09 Johannes Schlüter - - * NEWS - ext/standard/string.c - ext/standard/tests/strings/stristr.phpt - ext/standard/tests/strings/strstr.phpt: - - Added option to strstr() and stristr() to get a particular haystack - component - -2005-08-09 Ilia Alshanetsky - - * ext/standard/url.h: - Missing patch bit. - -2005-08-09 Andrei Zmievski - - * (PHP_4_4) - ext/pcre/config.m4 - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/README - ext/pcre/pcrelib/chartables.c - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/internal.h - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.def - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcre_chartables.c - ext/pcre/pcrelib/pcre_compile.c - ext/pcre/pcrelib/pcre_config.c - ext/pcre/pcrelib/pcre_dfa_exec.c - ext/pcre/pcrelib/pcre_exec.c - ext/pcre/pcrelib/pcre_fullinfo.c - ext/pcre/pcrelib/pcre_get.c - ext/pcre/pcrelib/pcre_globals.c - ext/pcre/pcrelib/pcre_info.c - ext/pcre/pcrelib/pcre_internal.h - ext/pcre/pcrelib/pcre_maketables.c - ext/pcre/pcrelib/pcre_ord2utf8.c - ext/pcre/pcrelib/pcre_printint.c - ext/pcre/pcrelib/pcre_refcount.c - ext/pcre/pcrelib/pcre_scanner.cc - ext/pcre/pcrelib/pcre_scanner.h - ext/pcre/pcrelib/pcre_scanner_unittest.cc - ext/pcre/pcrelib/pcre_stringpiece.cc - ext/pcre/pcrelib/pcre_stringpiece.h - ext/pcre/pcrelib/pcre_stringpiece_unittest.cc - ext/pcre/pcrelib/pcre_study.c - ext/pcre/pcrelib/pcre_tables.c - ext/pcre/pcrelib/pcre_try_flipped.c - ext/pcre/pcrelib/pcre_ucp_findchar.c - ext/pcre/pcrelib/pcre_valid_utf8.c - ext/pcre/pcrelib/pcre_version.c - ext/pcre/pcrelib/pcre_xclass.c - ext/pcre/pcrelib/pcrecpp.cc - ext/pcre/pcrelib/pcrecpp.h - ext/pcre/pcrelib/pcrecpp_unittest.cc - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp_findchar.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/pcre.txt - ext/pcre/pcrelib/testdata/grepinput - ext/pcre/pcrelib/testdata/grepinputx - ext/pcre/pcrelib/testdata/greplist - ext/pcre/pcrelib/testdata/grepoutput - ext/pcre/pcrelib/testdata/testinput1 - ext/pcre/pcrelib/testdata/testinput2 - ext/pcre/pcrelib/testdata/testinput3 - ext/pcre/pcrelib/testdata/testinput4 - ext/pcre/pcrelib/testdata/testinput5 - ext/pcre/pcrelib/testdata/testinput6 - ext/pcre/pcrelib/testdata/testinput7 - ext/pcre/pcrelib/testdata/testinput8 - ext/pcre/pcrelib/testdata/testinput9 - ext/pcre/pcrelib/testdata/testoutput1 - ext/pcre/pcrelib/testdata/testoutput2 - ext/pcre/pcrelib/testdata/testoutput3 - ext/pcre/pcrelib/testdata/testoutput4 - ext/pcre/pcrelib/testdata/testoutput5 - ext/pcre/pcrelib/testdata/testoutput6 - ext/pcre/pcrelib/testdata/testoutput7 - ext/pcre/pcrelib/testdata/testoutput8 - ext/pcre/pcrelib/testdata/testoutput9: - Upgrade to PCRE 6.2. - - * ext/pcre/pcrelib/internal.h: - Remove old internal.h file. - -2005-08-09 Jani Taskinen - - * NEWS: - reword - -2005-08-09 Ilia Alshanetsky - - * NEWS - ext/standard/basic_functions.c: - News and constants for parse_url(). - - * ext/standard/url.c: - Added option to parse_url() to retrieve a particular URL component. - - * ext/curl/interface.c - ext/curl/php_curl.h: - Added curl_setopt_array(), allowing setting of multiple cURL options. - Added CURLINFO_HEADER_OUT to facilitate request retrieval. - -2005-08-09 Derick Rethans - - * buildconf: - - Fixed buildconf for PHP 6. - -2005-08-09 Sebastian Bergmann - - * ext/pcre/config.w32: - MFB: Sync with config.m4. - -2005-08-09 Derick Rethans - - * configure.in - ZendEngine2/zend_extensions.h - ZendEngine2/zend_modules.h - main/php.h - main/php_version.h: - - Changing the API numbers, which might be a bit premature, but it allows - to differentiate between different branches. - - Bumbed the version number to 6.0.0-dev. I know we didn't discuss this - yet, - but I feel it should be 6.0. See mail to the mailinglist. - -2005-08-09 Jani Taskinen - - * NEWS: - UN - -2005-08-09 Sebastian Bergmann - - * (PHP_5_1) - ext/pcre/config.w32: - Sync with config.m4. - -2005-08-09 Andi Gutmans - - * (PHP_5_1) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - No release today. Found a critical bug... - - * (PHP_5_1) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - RC1 - -2005-08-08 Andrei Zmievski - - * ext/pcre/config.m4 - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/README - ext/pcre/pcrelib/chartables.c - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.def - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcre_chartables.c - ext/pcre/pcrelib/pcre_compile.c - ext/pcre/pcrelib/pcre_config.c - ext/pcre/pcrelib/pcre_dfa_exec.c - ext/pcre/pcrelib/pcre_exec.c - ext/pcre/pcrelib/pcre_fullinfo.c - ext/pcre/pcrelib/pcre_get.c - ext/pcre/pcrelib/pcre_globals.c - ext/pcre/pcrelib/pcre_info.c - ext/pcre/pcrelib/pcre_internal.h - ext/pcre/pcrelib/pcre_maketables.c - ext/pcre/pcrelib/pcre_ord2utf8.c - ext/pcre/pcrelib/pcre_printint.c - ext/pcre/pcrelib/pcre_refcount.c - ext/pcre/pcrelib/pcre_scanner.cc - ext/pcre/pcrelib/pcre_scanner.h - ext/pcre/pcrelib/pcre_scanner_unittest.cc - ext/pcre/pcrelib/pcre_stringpiece.cc - ext/pcre/pcrelib/pcre_stringpiece.h - ext/pcre/pcrelib/pcre_stringpiece_unittest.cc - ext/pcre/pcrelib/pcre_study.c - ext/pcre/pcrelib/pcre_tables.c - ext/pcre/pcrelib/pcre_try_flipped.c - ext/pcre/pcrelib/pcre_ucp_findchar.c - ext/pcre/pcrelib/pcre_valid_utf8.c - ext/pcre/pcrelib/pcre_version.c - ext/pcre/pcrelib/pcre_xclass.c - ext/pcre/pcrelib/pcrecpp.cc - ext/pcre/pcrelib/pcrecpp.h - ext/pcre/pcrelib/pcrecpp_unittest.cc - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp_findchar.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/pcre.txt - ext/pcre/pcrelib/testdata/grepinput - ext/pcre/pcrelib/testdata/grepinputx - ext/pcre/pcrelib/testdata/greplist - ext/pcre/pcrelib/testdata/grepoutput - ext/pcre/pcrelib/testdata/testinput1 - ext/pcre/pcrelib/testdata/testinput2 - ext/pcre/pcrelib/testdata/testinput3 - ext/pcre/pcrelib/testdata/testinput4 - ext/pcre/pcrelib/testdata/testinput5 - ext/pcre/pcrelib/testdata/testinput6 - ext/pcre/pcrelib/testdata/testinput7 - ext/pcre/pcrelib/testdata/testinput8 - ext/pcre/pcrelib/testdata/testinput9 - ext/pcre/pcrelib/testdata/testoutput1 - ext/pcre/pcrelib/testdata/testoutput2 - ext/pcre/pcrelib/testdata/testoutput3 - ext/pcre/pcrelib/testdata/testoutput4 - ext/pcre/pcrelib/testdata/testoutput5 - ext/pcre/pcrelib/testdata/testoutput6 - ext/pcre/pcrelib/testdata/testoutput7 - ext/pcre/pcrelib/testdata/testoutput8 - ext/pcre/pcrelib/testdata/testoutput9: - Upgrade to PCRE version 6.2. - - -2005-08-08 Frank M. Kromann - - * ext/mssql/php_mssql.c: - Make sure this works for multiple results as well - - * ext/mssql/php_mssql.c: - Remove debug code and optimize a bit - -2005-08-08 Magnus Määttä - - * ext/posix/posix.c: - makedev is a macro on several systems. - -2005-08-08 Frank M. Kromann - - * NEWS: - - News entry for Fix #32010 - - * ext/mssql/php_mssql.c - ext/mssql/php_mssql.h: - Fix #32010. Leak in mssql_fetch_batch(). - -2005-08-08 Jani Taskinen - - * NEWS: - BFNSF - -2005-08-08 Hartmut Holzgraefe - - * NEWS: - finally! - - cd some_extension - phpize - configure - make - make test # <<< THIS WORKS!!! :) - - * (php_5_1_0RC1) - Makefile.global: - put the -d extension loading options in the right place, - get rid of basename - -2005-08-08 Jani Taskinen - - * (php_5_1_0RC1) - scripts/phpize.in: - Fix cleanup - - * (php_5_1_0RC1) - ext/standard/dl.c - ext/standard/dl.h - main/php_ini.c - sapi/cli/php_cli.c: - - Fixed problem with -dextension=foobar.so not having it's MINIT run. - - * Makefile.global - configure.in - scripts/Makefile.frag - scripts/php-config.in - scripts/phpize.in - scripts/phpize.m4: - - Made it possible to do "make test" for phpized extensions - - * (php_5_1_0RC1) - ZendEngine2/zend_API.c: - - Show the dependancy name we could not find (req_mod is null here when it - is not found :) - -2005-08-08 Hartmut Holzgraefe - - * sapi/cli/php_cli.c: - fix extension loading from command line, resources didn't work - (still related to Bug #33899) - -2005-08-07 Jani Taskinen - - * NEWS: - BFN - - * ext/imap/php_imap.c - ext/standard/mail.c - win32/sendmail.c - win32/sendmail.h: - - Fixed bug #29334 (mail() provides incorrect message time header) - - * ext/gd/config.w32: - Missing entry - -2005-08-07 Hartmut Holzgraefe - - * configure.in: - configure.in scripts/Makefile.frag scripts/phpize.in - - * main/php.h: - typo fix - -2005-08-07 Jani Taskinen - - * ext/xml/tests/bug26614_libxml.phpt: - This test failed because libxml versions differ.. - -2005-08-07 Derick Rethans - - * ext/iconv/tests/bug16069.phpt: - - Fix skip-if comment. - -2005-08-06 Edin Kadribasic - - * NEWS: - Mention new library bundle on windows - -2005-08-06 Jani Taskinen - - * NEWS: - BFN - -2005-08-06 Edin Kadribasic - - * ext/gd/config.w32: - Only link zlib if we dont compile it in (#3406) - - * ext/zlib/php_zlib.def: - Add missing export - -2005-08-06 Andrey Hristov - - * (PHP_5_0) - NEWS: - BFN - - * ext/mysqli/mysqli_nonapi.c: - add a comment - - * (PHP_5_0) - ext/mysqli/mysqli_nonapi.c: - - fix int-long issue on 64bit (MFH) - - add data checking (MFH) - - add a comment - - * ext/mysqli/mysqli_nonapi.c: - add error checking - - * ext/mysqli/mysqli_nonapi.c: - fix problem on 64 bit - when asking for "l" supply long not int because - on 64 bit they differ and zend_parse_parameters makes a *(long*) cast - which means that if the variable is int 4 bytes of the variable(s) - declared before it (on the stack) will be overwritten. In this case - this is the length of the query -> made 0 and mysqli_query() returns - FALSE. - -2005-08-06 Frank M. Kromann - - * ext/sybase/php_sybase_db.c - ext/sybase_ct/php_sybase_ct.c: - Fix for #32531 - No need to alias these functions on windows or if the mssql extension is - compiled. This change will allow the use of both extensions at the same - time. - - * ext/ming/ming.c: - Cleanup to match the current cvs version of ming0.3beta - -2005-08-05 Jani Taskinen - - * ext/odbc/php_odbc.c: - No HTML output if html_errors is off (bug #34006) - - * TSRM/TSRM.h: - Fix compile failure with GCC 4.0.x - - * main/main.c: - - This ini option is only effective when set in php.ini or httpd.conf - or .htacces, etc. as GPC variables are set before any ini_set() is - called - - * ext/mbstring/tests/php_gr_jp_16242.phpt: - - Fixed bug #34015 - - * (PHP_5_0) - ext/informix/Makefile.frag: - MFB_4_4 - - * (PHP_4_4) - ext/informix/Makefile.frag: - - Fixed bug #34008 (compile failure) - -2005-08-05 Anantha Kesari H Y - - * ext/exif/exif.c - ext/exif/exif.c - ext/exif/exif.c: - NetWare specific stat structure issues. - --Kamesh - -2005-08-05 Dmitry Stogov - - * NEWS - ZendEngine2/zend_execute.c - ZendEngine2/tests/array_type_hint_001.phpt - ZendEngine2/tests/bug33996.phpt - tests/classes/type_hinting_001.phpt - tests/lang/type_hints_001.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - -2005-08-05 Jani Taskinen - - * ext/standard/tests/math/bug25665.phpt: - Skip test on solaris - -2005-08-05 Dmitry Stogov - - * NEWS - ZendEngine2/zend_operators.c - ZendEngine2/tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - -2005-08-05 Jani Taskinen - - * sapi/apache2filter/config.m4 - sapi/apache2handler/config.m4: - - Changed -a to -A to prevent enabling PHP in httpd.conf automatically. - -2005-08-05 Dmitry Stogov - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Wez Furlong - - * scripts/phpize.in: - test -e doesn't work on solaris - -2005-08-04 Antony Dovgal - - * ZendEngine2/tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov - - * ZendEngine2/zend_compile.c: - Fixed possible memory corryption during compilation of - -2005-08-04 Anantha Kesari H Y - - * (PHP_4_4) - TSRM/threads.m4: - NetWare cross compile patch from 5.0 tree. - --Kamesh - -2005-08-04 Dmitry Stogov - - * ext/standard/tests/array/bug33989.phpt - ext/standard/tests/array/bug33989.phpt - ext/standard/tests/array/bug33989.phpt: - 1.1.4; - Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP) - - * NEWS - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug33989.phpt - ext/standard/tests/array/bug33989.phpt: - Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP) - -2005-08-04 Masaki Fujimoto - - * (PHP_4_4) - Zend/zend_multibyte.c: - - fix missing encodings - -2005-08-04 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * ZendEngine2/zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Anantha Kesari H Y - - * (PHP_4_4) - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h: - NetWare LibC has lstat implemented. - --Kamesh - - * (PHP_4_4) - sapi/apache2filter/sapi_apache2.c: - NetWare specific stat structure issues. - --Kamesh - -2005-08-03 Jani Taskinen - - * run-tests.php - server-tests.php - ZendEngine2/LICENSE - build/build.mk - build/build2.mk - build/buildcheck.sh - build/mkdep.awk - ext/bcmath/bcmath.c - ext/bcmath/php_bcmath.h - ext/bz2/bz2.c - ext/bz2/bz2_filter.c - ext/bz2/php_bz2.h - ext/calendar/cal_unix.c - ext/calendar/calendar.c - ext/calendar/easter.c - ext/com_dotnet/com_com.c - ext/com_dotnet/com_dotnet.c - ext/com_dotnet/com_extension.c - ext/com_dotnet/com_handlers.c - ext/com_dotnet/com_iterator.c - ext/com_dotnet/com_misc.c - ext/com_dotnet/com_olechar.c - ext/com_dotnet/com_persist.c - ext/com_dotnet/com_saproxy.c - ext/com_dotnet/com_typeinfo.c - ext/com_dotnet/com_variant.c - ext/com_dotnet/com_wrapper.c - ext/com_dotnet/php_com_dotnet.h - ext/com_dotnet/php_com_dotnet_internal.h - ext/ctype/ctype.c - ext/ctype/php_ctype.h - ext/curl/interface.c - ext/curl/multi.c - ext/curl/php_curl.h - ext/curl/streams.c - ext/dba/dba.c - ext/dba/dba_cdb.c - ext/dba/dba_db1.c - ext/dba/dba_db2.c - ext/dba/dba_db3.c - ext/dba/dba_db4.c - ext/dba/dba_dbm.c - ext/dba/dba_flatfile.c - ext/dba/dba_gdbm.c - ext/dba/dba_inifile.c - ext/dba/dba_ndbm.c - ext/dba/dba_qdbm.c - ext/dba/php_dba.h - ext/dba/libcdb/cdb.c - ext/dba/libcdb/cdb.h - ext/dba/libcdb/cdb_make.c - ext/dba/libcdb/cdb_make.h - ext/dba/libcdb/uint32.c - ext/dba/libcdb/uint32.h - ext/dba/libflatfile/flatfile.c - ext/dba/libflatfile/flatfile.h - ext/dba/libinifile/inifile.c - ext/dba/libinifile/inifile.h - ext/dbase/dbase.c - ext/dbase/php_dbase.h - ext/dom/attr.c - ext/dom/cdatasection.c - ext/dom/characterdata.c - ext/dom/comment.c - ext/dom/document.c - ext/dom/documentfragment.c - ext/dom/documenttype.c - ext/dom/dom_ce.h - ext/dom/dom_fe.h - ext/dom/dom_iterators.c - ext/dom/dom_properties.h - ext/dom/domconfiguration.c - ext/dom/domerror.c - ext/dom/domerrorhandler.c - ext/dom/domexception.c - ext/dom/domimplementation.c - ext/dom/domimplementationlist.c - ext/dom/domimplementationsource.c - ext/dom/domlocator.c - ext/dom/domstringlist.c - ext/dom/element.c - ext/dom/entity.c - ext/dom/entityreference.c - ext/dom/namednodemap.c - ext/dom/namelist.c - ext/dom/node.c - ext/dom/nodelist.c - ext/dom/notation.c - ext/dom/php_dom.c - ext/dom/php_dom.h - ext/dom/processinginstruction.c - ext/dom/string_extend.c - ext/dom/text.c - ext/dom/typeinfo.c - ext/dom/userdatahandler.c - ext/dom/xml_common.h - ext/dom/xpath.c - ext/exif/exif.c - ext/exif/php_exif.h - ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.h - ext/fdf/fdf.c - ext/fdf/php_fdf.h - ext/filepro/filepro.c - ext/filepro/php_filepro.h - ext/ftp/ftp.c - ext/ftp/ftp.h - ext/ftp/php_ftp.c - ext/ftp/php_ftp.h - ext/gd/gd.c - ext/gd/gd_ctx.c - ext/gd/php_gd.h - ext/gd/libgd/xbm.c - ext/gettext/gettext.c - ext/gettext/php_gettext.h - ext/gmp/gmp.c - ext/gmp/php_gmp.h - ext/hwapi/hwapi.cpp - ext/hwapi/php_hwapi.h - ext/iconv/iconv.c - ext/iconv/php_iconv.h - ext/imap/php_imap.c - ext/imap/php_imap.h - ext/informix/ifx.ec - ext/informix/php_informix.h - ext/informix/php_informix_includes.h - ext/interbase/ibase_blobs.c - ext/interbase/ibase_events.c - ext/interbase/ibase_query.c - ext/interbase/ibase_service.c - ext/interbase/interbase.c - ext/interbase/interbase.rc - ext/interbase/php_ibase_includes.h - ext/interbase/php_ibase_udf.c - ext/interbase/php_interbase.h - ext/ldap/ldap.c - ext/ldap/php_ldap.h - ext/mbstring/mb_gpc.c - ext/mbstring/mbstring.c - ext/mbstring/mbstring.h - ext/mbstring/php_mbregex.c - ext/mbstring/php_mbregex.h - ext/mbstring/php_unicode.c - ext/mbstring/php_unicode.h - ext/mcrypt/mcrypt.c - ext/mcrypt/php_mcrypt.h - ext/mcve/mcve.c - ext/mcve/php_mcve.h - ext/mhash/mhash.c - ext/mhash/php_mhash.h - ext/mime_magic/mime_magic.c - ext/mime_magic/php_mime_magic.h - ext/mime_magic/phpmimemagic.h - ext/ming/ming.c - ext/ming/php_ming.h - ext/mono/php_mono.c - ext/mono/php_mono.h - ext/msession/msession.c - ext/msession/php_msession.h - ext/msession/reqclient.h - ext/msql/php_msql.c - ext/msql/php_msql.h - ext/mssql/php_mssql.c - ext/mssql/php_mssql.h - ext/mysql/php_mysql.c - ext/mysql/php_mysql.h - ext/mysqli/mysqli.c - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_driver.c - ext/mysqli/mysqli_embedded.c - ext/mysqli/mysqli_exception.c - ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/mysqli_prop.c - ext/mysqli/mysqli_repl.c - ext/mysqli/mysqli_report.c - ext/mysqli/mysqli_report.h - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h - ext/ncurses/ncurses.c - ext/ncurses/ncurses_fe.c - ext/ncurses/ncurses_functions.c - ext/ncurses/php_ncurses.h - ext/ncurses/php_ncurses_fe.h - ext/oci8/oci8.c - ext/oci8/php_oci8.h - ext/odbc/birdstep.c - ext/odbc/php_birdstep.h - ext/odbc/php_odbc.c - ext/odbc/php_odbc.h - ext/odbc/php_odbc_includes.h - ext/openssl/openssl.c - ext/openssl/php_openssl.h - ext/openssl/xp_ssl.c - ext/oracle/oracle.c - ext/ovrimos/ovrimos.c - ext/pcntl/pcntl.c - ext/pcntl/php_pcntl.h - ext/pcntl/php_signal.c - ext/pcntl/php_signal.h - ext/pcre/php_pcre.c - ext/pcre/php_pcre.h - ext/pfpro/pfpro.c - ext/pfpro/php_pfpro.h - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h - ext/posix/php_posix.h - ext/posix/posix.c - ext/pspell/php_pspell.h - ext/pspell/pspell.c - ext/readline/php_readline.h - ext/readline/readline.c - ext/recode/php_recode.h - ext/recode/recode.c - ext/session/mod_files.c - ext/session/mod_files.h - ext/session/mod_mm.c - ext/session/mod_mm.h - ext/session/mod_user.c - ext/session/mod_user.h - ext/session/php_session.h - ext/session/session.c - ext/shmop/php_shmop.h - ext/shmop/shmop.c - ext/simplexml/php_simplexml.h - ext/simplexml/php_simplexml_exports.h - ext/simplexml/simplexml.c - ext/snmp/php_snmp.h - ext/snmp/snmp.c - ext/sockets/php_sockets.h - ext/sockets/php_sockets_win.c - ext/sockets/php_sockets_win.h - ext/sockets/sockets.c - ext/sockets/unix_socket_constants.h - ext/sockets/win32_socket_constants.h - ext/sqlite/php_sqlite.h - ext/sqlite/sess_sqlite.c - ext/sqlite/sqlite.c - ext/standard/array.c - ext/standard/assert.c - ext/standard/base64.c - ext/standard/base64.h - ext/standard/basic_functions.c - ext/standard/basic_functions.h - ext/standard/browscap.c - ext/standard/crc32.c - ext/standard/crc32.h - ext/standard/credits.c - ext/standard/credits.h - ext/standard/crypt.c - ext/standard/css.c - ext/standard/css.h - ext/standard/cyr_convert.c - ext/standard/cyr_convert.h - ext/standard/datetime.c - ext/standard/datetime.h - ext/standard/dir.c - ext/standard/dl.c - ext/standard/dl.h - ext/standard/dns.c - ext/standard/dns.h - ext/standard/exec.c - ext/standard/exec.h - ext/standard/file.c - ext/standard/file.h - ext/standard/filestat.c - ext/standard/filters.c - ext/standard/flock_compat.c - ext/standard/flock_compat.h - ext/standard/formatted_print.c - ext/standard/fsock.c - ext/standard/fsock.h - ext/standard/ftok.c - ext/standard/ftp_fopen_wrapper.c - ext/standard/head.c - ext/standard/head.h - ext/standard/html.c - ext/standard/html.h - ext/standard/http.c - ext/standard/http_fopen_wrapper.c - ext/standard/image.c - ext/standard/incomplete_class.c - ext/standard/info.c - ext/standard/info.h - ext/standard/iptc.c - ext/standard/lcg.c - ext/standard/levenshtein.c - ext/standard/link.c - ext/standard/mail.c - ext/standard/math.c - ext/standard/md5.c - ext/standard/md5.h - ext/standard/metaphone.c - ext/standard/microtime.c - ext/standard/microtime.h - ext/standard/pack.c - ext/standard/pack.h - ext/standard/pageinfo.c - ext/standard/pageinfo.h - ext/standard/php_array.h - ext/standard/php_assert.h - ext/standard/php_browscap.h - ext/standard/php_crypt.h - ext/standard/php_dir.h - ext/standard/php_ext_syslog.h - ext/standard/php_filestat.h - ext/standard/php_fopen_wrapper.c - ext/standard/php_fopen_wrappers.h - ext/standard/php_ftok.h - ext/standard/php_http.h - ext/standard/php_image.h - ext/standard/php_incomplete_class.h - ext/standard/php_iptc.h - ext/standard/php_lcg.h - ext/standard/php_link.h - ext/standard/php_mail.h - ext/standard/php_math.h - ext/standard/php_metaphone.h - ext/standard/php_rand.h - ext/standard/php_smart_str.h - ext/standard/php_smart_str_public.h - ext/standard/php_standard.h - ext/standard/php_string.h - ext/standard/php_sunfuncs.h - ext/standard/php_type.h - ext/standard/php_uuencode.h - ext/standard/php_var.h - ext/standard/php_versioning.h - ext/standard/proc_open.c - ext/standard/proc_open.h - ext/standard/quot_print.c - ext/standard/quot_print.h - ext/standard/rand.c - ext/standard/reg.c - ext/standard/reg.h - ext/standard/scanf.c - ext/standard/scanf.h - ext/standard/sha1.c - ext/standard/sha1.h - ext/standard/soundex.c - ext/standard/streamsfuncs.c - ext/standard/streamsfuncs.h - ext/standard/string.c - ext/standard/sunfuncs.c - ext/standard/syslog.c - ext/standard/type.c - ext/standard/uniqid.c - ext/standard/uniqid.h - ext/standard/url.c - ext/standard/url.h - ext/standard/url_scanner.c - ext/standard/url_scanner.h - ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.h - ext/standard/url_scanner_ex.re - ext/standard/user_filters.c - ext/standard/uuencode.c - ext/standard/var.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/versioning.c - ext/sybase/php_sybase_db.c - ext/sybase/php_sybase_db.h - ext/sybase_ct/php_sybase_ct.c - ext/sybase_ct/php_sybase_ct.h - ext/sysvmsg/php_sysvmsg.h - ext/sysvmsg/sysvmsg.c - ext/sysvsem/php_sysvsem.h - ext/sysvsem/sysvsem.c - ext/sysvshm/php_sysvshm.h - ext/sysvshm/sysvshm.c - ext/tokenizer/php_tokenizer.h - ext/tokenizer/tokenizer.c - ext/wddx/php_wddx.h - ext/wddx/php_wddx_api.h - ext/wddx/wddx.c - ext/xml/compat.c - ext/xml/expat_compat.h - ext/xml/php_xml.h - ext/xml/xml.c - ext/xmlrpc/php_xmlrpc.h - ext/xmlrpc/xmlrpc-epi-php.c - ext/xsl/php_xsl.c - ext/xsl/php_xsl.h - ext/xsl/xsl_fe.h - ext/xsl/xsltprocessor.c - ext/zlib/php_zlib.h - ext/zlib/zlib.c - ext/zlib/zlib_filter.c - ext/zlib/zlib_fopen_wrapper.c - main/SAPI.c - main/SAPI.h - main/build-defs.h.in - main/fopen_wrappers.c - main/fopen_wrappers.h - main/internal_functions.c.in - main/internal_functions_nw.c - main/internal_functions_win32.c - main/logos.h - main/main.c - main/network.c - main/output.c - main/php.h - main/php3_compat.h - main/php_compat.h - main/php_content_types.c - main/php_content_types.h - main/php_globals.h - main/php_ini.c - main/php_ini.h - main/php_logos.c - main/php_logos.h - main/php_main.h - main/php_memory_streams.h - main/php_network.h - main/php_open_temporary_file.c - main/php_open_temporary_file.h - main/php_output.h - main/php_reentrancy.h - main/php_regex.h - main/php_scandir.c - main/php_scandir.h - main/php_sprintf.c - main/php_streams.h - main/php_syslog.h - main/php_ticks.c - main/php_ticks.h - main/php_variables.c - main/php_variables.h - main/reentrancy.c - main/rfc1867.c - main/rfc1867.h - main/safe_mode.c - main/safe_mode.h - main/snprintf.c - main/snprintf.h - main/spprintf.c - main/spprintf.h - main/strlcat.c - main/strlcpy.c - main/win95nt.h - main/streams/cast.c - main/streams/filter.c - main/streams/memory.c - main/streams/mmap.c - main/streams/php_stream_context.h - main/streams/php_stream_filter_api.h - main/streams/php_stream_mmap.h - main/streams/php_stream_plain_wrapper.h - main/streams/php_stream_transport.h - main/streams/php_stream_userspace.h - main/streams/php_streams_int.h - main/streams/plain_wrapper.c - main/streams/streams.c - main/streams/transports.c - main/streams/userspace.c - main/streams/xp_socket.c - netware/start.c - sapi/aolserver/aolserver.c - sapi/apache/libpre.c - sapi/apache/mod_php5.c - sapi/apache/mod_php5.h - sapi/apache/php_apache.c - sapi/apache/php_apache_http.h - sapi/apache/sapi_apache.c - sapi/apache2filter/apache_config.c - sapi/apache2filter/php_apache.h - sapi/apache2filter/php_functions.c - sapi/apache2filter/sapi_apache2.c - sapi/apache2handler/apache_config.c - sapi/apache2handler/mod_php5.c - sapi/apache2handler/php_apache.h - sapi/apache2handler/php_functions.c - sapi/apache2handler/sapi_apache2.c - sapi/apache_hooks/mod_php5.c - sapi/apache_hooks/mod_php5.h - sapi/apache_hooks/php_apache.c - sapi/apache_hooks/sapi_apache.c - sapi/caudium/caudium.c - sapi/embed/php_embed.c - sapi/embed/php_embed.h - sapi/isapi/php5isapi.c - sapi/nsapi/nsapi.c - sapi/phttpd/php_phttpd.h - sapi/phttpd/phttpd.c - sapi/pi3web/pi3web_sapi.c - sapi/roxen/roxen.c - sapi/thttpd/php_thttpd.h - sapi/thttpd/thttpd.c - sapi/tux/php_tux.c - sapi/webjames/php_webjames.h - sapi/webjames/webjames.c - scripts/dev/conv_z_macros - scripts/dev/search_underscores.php - win32/crypt_win32.c - win32/crypt_win32.h - win32/globals.c - win32/grp.h - win32/md5crypt.c - win32/md5crypt.h - win32/php5dllts.rc2 - win32/php5ts.rc2 - win32/php5ts_cli.rc2 - win32/php_win32_globals.h - win32/pwd.c - win32/pwd.h - win32/select.c - win32/select.h - win32/syslog.h - win32/winutil.c - win32/winutil.h: - - Bumber up year - - * ext/standard/credits_ext.h: - update credits - - * ZendEngine2/acconfig.h - ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_alloc.c - ZendEngine2/zend_alloc.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_config.nw.h - ZendEngine2/zend_config.w32.h - ZendEngine2/zend_constants.c - ZendEngine2/zend_constants.h - ZendEngine2/zend_default_classes.c - ZendEngine2/zend_dynamic_array.c - ZendEngine2/zend_dynamic_array.h - ZendEngine2/zend_errors.h - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_extensions.c - ZendEngine2/zend_extensions.h - ZendEngine2/zend_fast_cache.h - ZendEngine2/zend_globals.h - ZendEngine2/zend_globals_macros.h - ZendEngine2/zend_hash.c - ZendEngine2/zend_hash.h - ZendEngine2/zend_highlight.c - ZendEngine2/zend_highlight.h - ZendEngine2/zend_indent.c - ZendEngine2/zend_indent.h - ZendEngine2/zend_ini.c - ZendEngine2/zend_ini.h - ZendEngine2/zend_ini_parser.y - ZendEngine2/zend_ini_scanner.h - ZendEngine2/zend_ini_scanner.l - ZendEngine2/zend_interfaces.c - ZendEngine2/zend_interfaces.h - ZendEngine2/zend_istdiostream.h - ZendEngine2/zend_iterators.c - ZendEngine2/zend_iterators.h - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_scanner.h - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_list.c - ZendEngine2/zend_list.h - ZendEngine2/zend_llist.c - ZendEngine2/zend_llist.h - ZendEngine2/zend_mm.c - ZendEngine2/zend_mm.h - ZendEngine2/zend_modules.h - ZendEngine2/zend_multibyte.c - ZendEngine2/zend_multibyte.h - ZendEngine2/zend_multiply.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/zend_objects.c - ZendEngine2/zend_objects.h - ZendEngine2/zend_objects_API.c - ZendEngine2/zend_objects_API.h - ZendEngine2/zend_opcode.c - ZendEngine2/zend_operators.c - ZendEngine2/zend_operators.h - ZendEngine2/zend_ptr_stack.c - ZendEngine2/zend_ptr_stack.h - ZendEngine2/zend_qsort.c - ZendEngine2/zend_qsort.h - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.h - ZendEngine2/zend_sprintf.c - ZendEngine2/zend_stack.c - ZendEngine2/zend_stack.h - ZendEngine2/zend_static_allocator.c - ZendEngine2/zend_static_allocator.h - ZendEngine2/zend_stream.c - ZendEngine2/zend_stream.h - ZendEngine2/zend_strtod.h - ZendEngine2/zend_ts_hash.c - ZendEngine2/zend_ts_hash.h - ZendEngine2/zend_types.h - ZendEngine2/zend_variables.c - ZendEngine2/zend_variables.h - ZendEngine2/zend_vm.h: - Bump up the year - - * ZendEngine2/README.ZEND_VM: - Nuked DOS EOLs - - * TSRM/tsrm_nw.c - TSRM/tsrm_nw.h - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h - TSRM/tsrm_win32.c - TSRM/tsrm_win32.h: - Bump up year - - * header - sapi/cgi/cgi_main.c - sapi/cgi/getopt.c - sapi/cgi/php_getopt.h - sapi/cli/getopt.c - sapi/cli/php.1.in - sapi/cli/php_cli_readline.h - sapi/cli/php_getopt.h - sapi/milter/php_milter.c: - - 2004 -> 2005 - -2005-08-02 Hartmut Holzgraefe - - * run-tests.php: - make skipif test use ini options specified by -d command line options - -2005-08-02 Dmitry Stogov - - * ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Ilia Alshanetsky - - * NEWS - main/php_variables.c: - Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash) - -2005-08-02 Jani Taskinen - - * NEWS - ZendEngine2/zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - - * tests/lang/bug32924.phpt: - fix test when include_path does NOT have . in it - -2005-08-02 Dmitry Stogov - - * ZendEngine2/bench.php: - Removed warnings - -2005-08-02 Jani Taskinen - - * NEWS: - BFN - -2005-08-01 Edin Kadribasic - - * ext/gd/config.w32: - Allow building gd on windows systems without t1lib (M. Sisolak) #33620 - - * ext/imap/config.w32: - Allow building against the latest cclient - -2005-08-01 Dmitry Stogov - - * NEWS - NEWS - sapi/apache/mod_php5.c - sapi/apache/mod_php5.c: - Fixed bug #33723 (php_value overrides php_admin_value) - -2005-07-31 Jani Taskinen - - * ext/xml/tests/bug27908.phpt: - Added test for bug #27908 - - * ext/xml/tests/bug26614_libxml.phpt: - - Fix test. - - * tests/classes/iterators_007.phpt: - fix test - -2005-07-31 Rob Richards - - * ext/xml/compat.c: - SystemID and publicID params reversed in declaration handlers - -2005-07-31 Sebastian Bergmann - - * TODO-5.1: - Update TODO. - -2005-07-31 Ilia Alshanetsky - - * TODO-5.1: - Update todo - -2005-07-30 Jani Taskinen - - * ext/standard/tests/array/bug25359.phpt: - Added test for bug #25359 - -2005-07-29 Wez Furlong - - * regex/regerror.c: - switch to ansi declaration so that vs.net 2005 groks it. - -2005-07-29 Jani Taskinen - - * ext/informix/config.m4: - - Fixed bug #33837 (Informix ESQL version numbering schema changed) - -2005-07-29 Marcus Boerger - - * run-tests.php: - - Add ENV support (mike) - -2005-07-29 Ilia Alshanetsky - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - - * NEWS - main/php_variables.c: - Fixed bug #33904 (input array keys being escaped when magic quotes is off). - -2005-07-29 Jani Taskinen - - * main/php_ini.c: - - Fixed few logic errors in php*.ini search path creation as documented - here: - - http://fi.php.net/manual/en/configuration.php#configuration.file - - - * NEWS - ext/standard/dl.c: - - Fixed bug #33899 (CLI: setting extension_dir=some/path - extension=foobar.so does not work) - - * NEWS - ext/standard/math.c: - - Fixed bug #33917 (number_format() output with > 1 char separators) - -2005-07-29 Anantha Kesari H Y - - * (PHP_4_4) - Zend/acconfig.h - ZendEngine2/acconfig.h - ZendEngine2/acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen - - * ZendEngine2/zend_vm_execute.h: - update generated file - -2005-07-28 Ilia Alshanetsky - - * NEWS: - news file tinkering - -2005-07-28 Andi Gutmans - - * ZendEngine2/zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-28 Anantha Kesari H Y - - * (PHP_4_4) - sapi/cli/config.m4: - Merging changes from 5.0 tree - --Kamesh - - * (PHP_4_4) - win32/sendmail.c: - NetWare changes from 5.0 Tree. - --Kamesh - - * win32/sendmail.c - win32/sendmail.h: - NetWare cleanup - --Kamesh - - * ext/standard/mail.c: - defined EX_OK and EX_TEMPFAIL in ext/standard/mail.c for NETWARE rather - than including a sysexits.h. - -Kamesh - - * netware/sendmail_nw.h - netware/sysexits.h: - Cleaned up the NetWare code. - --Kamesh - - * (PHP_4_4) - netware/sendmail_nw.h: - Adding this file from 5_0 tree - -- Kamesh - - * (PHP_4_4) - netware/ZendEngine2.mak - netware/build.bat - netware/buildext.bat - netware/buildlib.bat - netware/buildsapi.bat - netware/common.mif - netware/mktemp.h - netware/php-nw.bat - netware/php4apache.mak - netware/phplib.imp - netware/phplib.mak - netware/pwd.h - netware/sendmail.c - netware/sendmail.h - netware/setbuild.bat - netware/tsrm.mak - netware/zend.mak: - NetWare can make use autoconf based build. - --Kamesh - - * (PHP_4_4) - netware/sys/stat.h: - NetWare LibC SDK has stat.h. So removing this. - --Kamesh - - * (PHP_5_0) - win32/sendmail.c - win32/sendmail.h: - Cleaned up the NetWare specific code - - * (PHP_5_0) - netware/sendmail_nw.h - netware/sysexits.h: - Cleaning up the NetWare code sitting in win32/sendmail.c. - Removing netware/sysexits.h - --Kamesh - - * (PHP_5_0) - ext/standard/mail.c: - defined EX_OK and EX_TEMPFAIL in ext/standard/mail.c for NETWARE rather - than including a sysexits.h - --Kamesh - -2005-07-27 Hartmut Holzgraefe - - * NEWS: - news entry for bug #33882 fix - -2005-07-27 Jani Taskinen - - * configure.in: - ws - -2005-07-27 Antony Dovgal - - * main/php_ini.c: - ws fix - -2005-07-27 Hartmut Holzgraefe - - * main/php_ini.c: - edge case: do not remove trailing slash for root directory (Bug #33882) - - * main/php_ini.c: - php.ini search logic needs to use the absolute path of the running binary - when looking for php.ini in the directory the php binary is installed in - -2005-07-27 Ilia Alshanetsky - - * NEWS: - Fixed bug #32139 (SOAP client does not auto-handle base64 encoding). - -2005-07-27 Anantha Kesari H Y - - * (PHP_5_0) - main/network.c: - removing redundant inclusion of headers for NETWARE - --Kamesh - - * (PHP_4_4) - acinclude.m4: - NetWare cross compile patches from 5.0 - --Kamesh - - * (PHP_4_4) - configure.in: - cross compile patches from 5.0 tree. - --Kamesh - - * configure.in - configure.in: - configure.in - moved the PHP_OS and PHP_UNAME definitions near the place other oses - define them currently it is ggeting redined to build machine values when - ./configure script is generated using autoconf version 2.13 but works fine - with autoconf 2.51. - Defining the default EXTENSION_DIR for NetWare - - --Kamesh - - * (PHP_4_4) - ext/standard/datetime.c - ext/standard/filestat.c - ext/standard/head.c - ext/standard/image.c - ext/standard/math.c - ext/standard/pageinfo.c: - ext/standard/datetime.c - Removed redundant NEW_LIBC checks - - ext/standard/head.c - Removed redundant inclusion of headers - - ext/standard/image.c - Removed redundant inclusion of headers - - ext/standard/pageinfo.c - Removed redundant CLIB_STAT_CHECK. BG(page_mtime) was giving nano seconds - portion out of timespec corrected to seconds. - - ext/standard/math.c - Not to hardcode inability as much as possible, in future NetWare LibC SDK - might have asinh that time autoconf can make this function available. - - ext/standard/filestat.c - Fixed the typo of accessing the nano seconds from a timer_spec to seconds. - - --Kamesh - - * (PHP_4_4) - ext/bcmath/libbcmath/src/config.h - ext/mcve/mcve.c - ext/pcre/pcrelib/internal.h: - NetWare can make use of autoconf based build - - * (PHP_4_4) - main/config.nw.h - main/php.h - main/php_syslog.h: - main/php_syslog.h - NetWare can make use of Autoconf based build. - - main/php.h - Removed redundant NEW_LIBC checks. - PHP_UNAME and PHP_OS has been hardcoded for NetWare inside configure.in - - Removed the config.nw.h - --Kamesh - - * (PHP_4_4) - main/php_streams.h: - Removing redundant CLIB_STAT_PATCH checks. - --Kamesh - -2005-07-26 Ilia Alshanetsky - - * NEWS: - Fixed bug #33869 (strtotime() problem with "+1days" format). - -2005-07-26 Antony Dovgal - - * (PHP_4_4) - ext/pcre/pcrelib/pcre.c: - nuke unused var - -2005-07-26 Jani Taskinen - - * ZendEngine2/zend_execute_API.c: - bug #33865 - -2005-07-26 Anantha Kesari H Y - - * (PHP_4_4) - ext/mysql/config.m4: - NetWare libmysqlclient library is available as libmysql(olden times 8.3 - limitation). - Applying the accepted patches on 5.0 tree. - --Kamesh - - * (PHP_4_4) - main/fopen_wrappers.c - main/main.c - main/network.c - main/php_scandir.c - main/user_streams.c: - main/main.c - Removing redundant NEW_LIBC checks - - main/fopen_wrappers.c - NetWare LibC SDK has sys/pwd.h and sys/param.h - Removed redundant NEW_LIBC checks - - main/user_streams.c - NetWare specific stat structure issues. - - main/php_scandir.c - Netware LibC SDK does not have search.h - - main/network.c - Removed redundant NEW_LIBC checks. - NetWare LibC SDK has sys/param.h - --Kamesh - - * (PHP_4_4) - TSRM/TSRM.c - TSRM/TSRM.h - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h: - TSRM/TSRM.h - NetWare can make use of autoconf based build. - PTHREADS implementation of NetWare is good enough so dropping the code for - NetWare specific thread implementation in preference to PTHREADS - - TSRM/TSRM.c - PTHREADS implementation of NetWare is good enough so dropping the code for - NetWare specific thread implementation in preference to PTHREADS - - TSRM/tsrm_virtual_cwd.c - NetWare can make use of autoconf based build. - Removed redundant CLIB_STAT_PATCH checks - NetWare specific fixes from PHP_5_0. - - TSRM/tsrm_virtual_cwd.h - Removed redundant CLIB_STAT_PATCH checks - NetWare specific fixes from PHP_5_0. - - --Kamesh - - * main/config.nw.h: - NetWare can make use of autoconf based build - --Kamesh - - * (PHP_5_0) - main/config.nw.h: - removed main/config.nw.h - -- Kamesh - - * (PHP_5_0) - ext/bcmath/libbcmath/src/config.h - ext/mcve/mcve.c - ext/pcre/pcrelib/internal.h - main/php_sprintf.c: - ext/pcre/pcrelib/internal.h - NetWare can make use autoconf based build. - - main/php_sprintf.c - NetWare can make use autoconf based build. - - ext/bcmath/libbcmath/src/config.h - NetWare can make use autoconf based build. - - ext/mcve/mcve.c - NetWare can make use autoconf based build. - - -- Kamesh - -2005-07-25 Ilia Alshanetsky - - * ext/pspell/README: - Updated URL leading to latest aspell. - -2005-07-25 Rasmus Lerdorf - - * NEWS - sapi/apache2handler/sapi_apache2.c: - MFB fix for bug #33690 - - * main/php_variables.c: - I could have sworn I committed this a while ago. Just a tiny NULL safety - check here. - -2005-07-25 Marcus Boerger - - * (PHP_5_0) - NEWS: - _ BFN - -2005-07-25 Rasmus Lerdorf - - * (PHP_4_4) - NEWS - sapi/apache2handler/sapi_apache2.c: - Fix for bug #33690 - -2005-07-25 Marcus Boerger - - * ZendEngine2/zend_API.c: - - Fix #33853 - - * ext/pspell/tests/01pspell_basic.phpt: - - Be flexible about spellbook - we want to test the ext not the spell - corrections available - - * sapi/cli/php_cli_readline.c: - - Bugfix #33733 - -2005-07-25 Anantha Kesari H Y - - * (PHP_4_4) - main/php.h: - NetWare LibC SDK has pwd.h and include sys/param.h - --Kamesh - - * (PHP_4_4) - ext/session/mod_files.c: - Netware specific stat structure issues. - --Kamesh - - * (PHP_4_4) - Zend/acconfig.h: - NetWare can make use of autoconf based build. - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -- Kamesh - - * ext/standard/fsock.h - ext/standard/fsock.h - ext/standard/lcg.c - ext/standard/lcg.c: - ext/standard/fsock.h - Removing redundant inclusion of headers for NetWare - - ext/standard/lcg.c - NetWare LibC SDK sys/time.h implicitly includes sys/timval.h so nothing - special needed for NetWare here. - - --Kamesh - - * (PHP_4_4) - ext/standard/dl.c - ext/standard/fsock.h - ext/standard/lcg.c - ext/standard/link.c - ext/standard/microtime.c: - ext/standard/dl.c - NetWare LibC dlsym works perfectly only thing that each of the extension - need to export a symbol with FULL capital prefix. - - ext/standard/fsock.h - Removing redundant inclusion of headers for NetWare - - ext/standard/lcg.c - NetWare LibC SDK sys/time.h implicitly includes sys/timval.h so nothing - special needed for NetWare here. - - ext/standard/link.c - NetWare LibC SDK has pwd.h. - - ext/standard/microtime.c - Removing redundant NEW_LIBC checks and nothing special about NetWare here. - including sys/time.h will do the needful. - - --Kamesh - -2005-07-24 Yasuo Ohgaki - - * (PHP_4_4) - ext/pgsql/config.m4: - fix build with older pgsql. - -2005-07-23 Ilia Alshanetsky - - * NEWS: - Fixed bug #33841 (pdo sqlite driver forgets to update affected column count - on execution of prepared statments). - -2005-07-23 Jani Taskinen - - * TODO.BUILDv5: - Removed done stuff - -2005-07-23 Ilia Alshanetsky - - * ext/standard/string.c - ext/standard/tests/strings/str_word_count.phpt: - Fixed bug in str_word_count() when charlist if specified and "word" starts - with a character found inside the charlist. - -2005-07-23 Pierre-Alain Joye - - * ext/gd/libgd/gd.c: - - fix #33794 imagerotate rotates only CCW - introduced by transparent color patch - -2005-07-23 Anantha Kesari H Y - - * (PHP_4_4) - Zend/zend.h: - NetWare can make use autoconf based build environment - - * (PHP_4_4) - main/mergesort.c - main/php_compat.h - main/php_open_temporary_file.c - main/reentrancy.c: - main/php_compat.h - NetWare can make use of Autoconf based build. - - main/php_open_temporary_file.c - NetWare LibC SDK has sys/param.h so removing the redundant NEW_LIBC - checks. - NetWare LibC has mkstemp implementation - - main/mergesort.c - Removing redundant sys/socket.h includes - - main/reentrant.c - Removing the redundant rentrant time function wrappers of NetWare - - --Kamesh - - * (PHP_4_4) - ext/standard/dl.c - ext/standard/flock_compat.c - ext/standard/lcg.c - ext/standard/pack.c: - ext/standard/dl.c - NetWare LibC SDK has sys/param.h so removing the redundant NEW_LIBC - checks. - ext/standard/flock_compat.c - Removing redundant NEW_LIBC checks - ext/standard/lcg.c - NetWare LibC SDK has sys/timeval.h so removing the redundant NEW_LIBC - checks. - ext/standard/pack.c - NetWare LibC SDK has sys/param.h so removing the redundant NEW_LIBC - checks. - --Kamesh - -2005-07-22 Jani Taskinen - - * ext/pgsql/config.m4: - revert fix that did not fix anything - -2005-07-22 Yasuo Ohgaki - - * ext/pgsql/config.m4: - fix build with older postgresql - -2005-07-22 Anantha Kesari H Y - - * (PHP_5_0) - main/php_syslog.h: - NetWare can make use of Autoconf based build - -2005-07-22 Dmitry Stogov - - * tests/lang/bug25922.phpt - tests/lang/bug25922.phpt: - $context is not longer passed by reference, so its modification has no - effect - - * ZendEngine2/tests/bug33802.phpt - ZendEngine2/tests/bug33802.phpt: - - Fixed bug #33802 (throw Exception in error handler causes crash) - - * NEWS - NEWS - ZendEngine2/zend.c - ZendEngine2/zend.c - ZendEngine2/tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger - - * ZendEngine2/zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov - - * ZendEngine2/zend_vm_def.h: - Fixed bug with returning from internal function by reference - - * ext/standard/var.c: - Recursion protection - -2005-07-20 Jani Taskinen - - * NEWS: - there is not much point in putting entries of bugs fixed when bug only - existed in CVS and not in any release.. - -2005-07-20 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - ext/standard/file.c - ext/standard/tests/file/bug32160.phpt - ext/standard/tests/file/bug32160.txt: - MFH: Fixed bug #32160 (copying a file into itself leads to data loss). - -2005-07-20 Derick Rethans - - * NEWS: - - Fixed bug #33578 (strtotime() problem with "Oct17" format). - - Fixed problems with lone years in strtotime(). - - Added functions to timelib to get a list of all abbreviations and - timezone - identifiers. - - Fixed problems with parsed dates that only have GMT offsets associated - with them. - - Fixed a Windows compile problem. - - Added special constants for different often used date formats - (DATE_ISO8601, - DATE_RFC822, DATE_RSS etc). - - Fixed date_default_timezone_get() to return the guessed timezone if none - was set yet with date_default_timezone_set(). - - Added experimental support for Date/Timezone objects as per - specifications. - -2005-07-20 Andrei Zmievski - - * NEWS - NEWS: - -** empty log message *** - -2005-07-20 Jani Taskinen - - * ext/mysqli/tests/009.phpt - ext/mysqli/tests/036.phpt: - Skip tests in 64bit systems - - * pear/tests/pear_dependency_checkExtension.phpt: - fixed skipif to really skip - -2005-07-19 Marcus Boerger - - * tests/classes/array_access_013.phpt: - - Add test to verify all ArrayAccess methods can throw - - * tests/classes/iterators_007.phpt: - - Add test to verify all iterator methods can throw - - * ZendEngine2/zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Wez Furlong - - * main/php_variables.c: - revert my last change; chasing ghosts. - - * main/php_variables.c: - Don't crash when no treat_data method has been set in the sapi module - -2005-07-19 Dmitry Stogov - - * NEWS - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-19 Brad House - - * ext/mcve/mcve.c - ext/mcve/php_mcve.h: - \#if BRAD_0'd latest changes as requested until 5.1.0 release - -2005-07-18 Jani Taskinen - - * ext/standard/reg.c - ext/standard/reg.c: - MFB4_4: Fix compile problem with --regex=system on some systems - -2005-07-18 Brad House - - * (PHP_5_0) - ext/mcve/mcve.c - ext/mcve/php_mcve.h: - BACKPORT FROM HEAD: sync missing functions from libmonetra-5 - - * ext/mcve/mcve.c - ext/mcve/php_mcve.h: - sync missing functions from libmonetra-5 - -2005-07-18 Ilia Alshanetsky - - * NEWS - main/php_variables.c: - Revert cookie patch for BC reasons. - -2005-07-18 Rasmus Lerdorf - - * ZendEngine2/zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Andrei Zmievski - - * (PHP_4_4) - ext/standard/reg.c: - Use HAVE_REGEX_T_RE_MAGIC to fix compilation problem on systems where - re_magic is not provided publicly. - -2005-07-18 Jani Taskinen - - * acinclude.m4: - fix macro - -2005-07-18 Dmitry Stogov - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ext/standard/dl.c - main/main.c: - Fixed bug in new module statrup mechanism - -2005-07-18 Wez Furlong - - * main/streams/plain_wrapper.c: - compile before commit (gah!) - -2005-07-18 Ilia Alshanetsky - - * ext/curl/interface.c: - Cleanup buffers on handle re-use. - -2005-07-18 Wez Furlong - - * main/streams/plain_wrapper.c: - Apparently our pipe detection code just above this isn't foolproof. - Catch it here. - -2005-07-18 Dmitry Stogov - - * ZendEngine2/tests/bug33558.phpt - ZendEngine2/tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * NEWS - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Ilia Alshanetsky - - * (PHP_4_4) - main/php_variables.c: - MFH: Fixed handling of HTTP requests with multiple Cookie headers. - - * NEWS - main/php_variables.c: - Fixed handling of HTTP requests with multiple Cookie headers. - -2005-07-18 Jani Taskinen - - * ZendEngine2/tests/bug33710.phpt: - typo - -2005-07-18 Frank M. Kromann - - * ext/ming/config.w32: - Make sure we build with SWFPrebuilt. - -2005-07-18 Marcus Boerger - - * run-tests.php: - - Show end of relay testing block - - * ext/ming/ming.c: - - Provide distinction and distinct tests - -2005-07-17 Marcus Boerger - - * ext/ming/config.m4 - ext/ming/ming.c: - - Compatibility with ming 0.2a and 0.3a - - * ZendEngine2/tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky - - * ZendEngine2/zend_compile.c: - Added missing init. - -2005-07-17 Marcus Boerger - - * main/streams/plain_wrapper.c: - - Fix problem with debug mode on selective machines - - * ext/xml/tests/bug26614.phpt - ext/xml/tests/bug26614_libxml.phpt: - - If you ask me both (expat and libxml) are not really accurate about byte - positions and columns...however the line number information is now - correct for both so for the moment we live with the situation that they - return different byte and column information. - -2005-07-16 Ilia Alshanetsky - - * ext/curl/interface.c: - Added 2 missing cURL options available in all versions. - -2005-07-16 Anantha Kesari H Y - - * netware/ApacheCore.imp - netware/BisonExtStandard.bat - netware/BisonFlexZend.bat - netware/ZendEngine2.mak - netware/build.bat - netware/buildext.bat - netware/buildlib.bat - netware/buildsapi.bat - netware/common.mif - netware/libpq-fe.h - netware/libpq.imp - netware/php-nw.bat - netware/php5apache.mak - netware/php5apache2filter.mak - netware/php5cli.mak - netware/phplib.imp - netware/phplib.mak - netware/phptest.ncf - netware/postgres_ext.h - netware/setbuild.bat - netware/time_nw.c - netware/tsrm.mak - netware/zend.mak: - NetWare can make use of the Autoconf based build system - - * netware/libpq/libpq-fs.h: - libpq-fs.h this file is of no use - - * (PHP_5_0) - netware/ApacheCore.imp - netware/BisonExtStandard.bat - netware/BisonFlexZend.bat - netware/ZendEngine2.mak - netware/build.bat - netware/buildext.bat - netware/buildlib.bat - netware/buildsapi.bat - netware/common.mif - netware/libpq-fe.h - netware/libpq.imp - netware/php-nw.bat - netware/php5apache.mak - netware/php5apache2filter.mak - netware/php5cli.mak - netware/phplib.imp - netware/phplib.mak - netware/phptest.ncf - netware/postgres_ext.h - netware/setbuild.bat - netware/time_nw.c - netware/tsrm.mak - netware/zend.mak: - NetWare can make use the AutoConf based build system - - * (PHP_5_0) - netware/libpq/libpq-fs.h: - removing the redundant file libpq-fs.h - - * (PHP_5_0) - sapi/apache2filter/php_apache.h - sapi/apache2filter/sapi_apache2.c: - sapi/apache2filter/php_apache.h - Removing redundant CLIB_STAT_PATCH - sapi/apache2filter/sapi_apache2.c - Removing redundant CLIB_STAT_PATCH - -- Kamesh - - * main/fopen_wrappers.c - main/main.c: - main/fopen_wrappers.c - NetWare file names are case insensitive - main/main.c - NetWare has no sendmail binary. It uses the smart host mailing code - avaiolable in php distro. Could not find a better place to put this than - main/main.c. - -- Kamesh - - * (PHP_5_0) - main/fopen_wrappers.c - main/main.c - main/php_open_temporary_file.c - main/php_streams.h - main/safe_mode.c: - main/fopen_wrappers.c - NetWare file names are case insensitive - main/main.c - NetWare has no sendmail binary. It uses the smart host mailing code - avaiolable in php distro. Could not find a better place to put this than - main/main.c. - main/php_open_temporary_file.c,v - Removed the unused variable in NetWare block. - main/php_streams.h - Removing the redundant CLIB_STAT_PATCH - main/safe_mode.c - NetWare has no uid. - -- Kamesh - - * (PHP_5_0) - TSRM/TSRM.c - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h: - TSRM/tsrm_virtual_cwd.c - Removing the redundant CLIB_STAT_PATCH - TSRM/tsrm_virtual_cwd.h - Removing the redundant CLIB_STAT_PATCH - TSRM/TSRM.c - Netware pthreads support is good enough. So removing all these fixes of - old times. - -- Kamesh - - * TSRM/TSRM.c: - Netware pthreads support is good enough. So removing all these fixes of old - times. - -- Kamesh - - * (PHP_5_0) - ext/standard/string.c: - NetWare specific dirname fixes. - --Kamesh - -2005-07-15 George Schlossnagle - - * ext/curl/interface.c - ext/curl/php_curl.h: - Darwin seems to like this much better. - - * ext/xsl/php_xsl.c - ext/xsl/xsl_fe.h: - Darwin seems to like this arrangement much better. - -2005-07-15 Sara Golemon - - * ext/standard/ftp_fopen_wrapper.c: - Pass context parameter through to xport_create - -2005-07-15 Anantha Kesari H Y - - * ext/standard/file.h - ext/standard/string.c - ext/standard/syslog.c: - ext/standard/file.h NetWare LibC has fnmatch and realpath implemented. - ext/standard/syslog.c Except LOG_SYSLOG other syslog macros are supported - by NetWare LibC. - ext/standard/string.c NetWare fix for dirname - -- Kamesh - - * (PHP_5_0) - ext/standard/file.h - ext/standard/filestat.c - ext/standard/link.c - ext/standard/pageinfo.c - ext/standard/syslog.c: - ext/standard/file.h NetWare LibC has fnmatch and realpath implemented. - ext/standard/filestat.c Removing redundant CLIB_STAT_PATCH and fixing some - NetWare specific stat structure. - ext/standard/link.c Removing redundant CLIB_STAT_PATCH. - ext/standard/pageinfo.c Removing redundant CLIB_STAT_PATCH and fixing some - NetWare specific stat structure. - ext/standard/syslog.c Except LOG_SYSLOG NetWare LibC has other macros - defined. - - -- Kamesh - -2005-07-14 Ilia Alshanetsky - - * ext/standard/http_fopen_wrapper.c: - Properly recognize redirect code 303. - When encountering redirect on POST request follow browsers and cURL and - perform GET on the specified location field. - -2005-07-14 Andi Gutmans - - * configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev - - * (php_5_1_0b3) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Beta 3 - -2005-07-14 Jani Taskinen - - * (php_5_1_0b3) - acinclude.m4 - configure.in - main/php_network.h: - - Fixed cacheing bug in PHP_SOCKADDR_SA_LEN macro - - Removed duplicate sa_len check from configure.in - - Unified the sockaddr tests into PHP_SOCKADDR_CHECKS macro - - * acinclude.m4: - Fix the re_magic test by adding missing #include - -2005-07-13 Sara Golemon - - * ext/standard/ftp_fopen_wrapper.c: - Route ftp:// wrapper via transports layer.\nFix typo in datastream crypto - startup - -2005-07-13 Ilia Alshanetsky - - * (PHP_4_4) - NEWS - main/rfc1867.c - main/rfc1867.c: - MFH: Fixed bug #33673 (Added detection for partially uploaded files). - - * NEWS - main/rfc1867.c: - Fixed bug #33673 (Added detection for partially uploaded files). - -2005-07-13 Jani Taskinen - - * acinclude.m4: - typofix - - * acinclude.m4: - - Added check whether re_magic exists in struct regex_t - - * php.ini-dist - php.ini-recommended: - fix typo - -2005-07-12 Andi Gutmans - - * (php_5_1_0b3) - NEWS: - - Update Beta 3 date - -2005-07-12 Antony Dovgal - - * (php_5_1_0b3) - ext/mysqli/mysqli_fe.c - ext/mysqli/php_mysqli.h: - add forgotten ifdefs, fix #33667 (mysqli doesn't compile) - -2005-07-12 Andi Gutmans - - * NEWS: - - Update News - - * configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev - - * (php_5_1_0b3) - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Beta 3 - -2005-07-12 Ilia Alshanetsky - - * NEWS - ext/standard/file.c: - Added support for LOCK_EX flag for file_put_contents(). - - * (php_5_1_0b3) - main/SAPI.c - main/main.c: - Fixed double-free in the digest authentication handling. - - -2005-07-12 Georg Richter - - * (php_5_1_0b3) - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h: - changed version dependency for charset functions - -2005-07-12 Antony Dovgal - - * (php_5_1_0b3) - tests/lang/bug22367.phpt - tests/lang/bug22510.phpt: - fix tests that started to fail after the last change in ZE - (noticed by Nuno) - -2005-07-12 Georg Richter - - * ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h: - removed charset structure. libmysql now provides a function - mysqli_get_character_set_info (Vers. 5.0.10) - -2005-07-12 Dmitry Stogov - - * NEWS - NEWS - NEWS - Zend/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-11 Dmitry Stogov - - * (PHP_4_4) - NEWS - ext/standard/array.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-11 Derick Rethans - - * (PHP_4_4) - configure.in - main/php_version.h: - - Back to -dev. - - * (PHP_4_4) - NEWS - configure.in - main/php_version.h: - - Go with 4.4.0. - -2005-07-11 Jon Parise - - * run-tests.php: - Removing the automake-related output. The build no longer uses automake. - - While I'm here, rewrite the PHP_AUTOCONF-related code to more closely - match the conventions used elsewhere in this section. The result should - be functionally the same as before. - -2005-07-11 Ilia Alshanetsky - - * ext/mime_magic/mime_magic.c: - Compiler warning fix. - -2005-07-10 Jani Taskinen - - * NEWS - ext/dbx/.cvsignore - ext/dbx/CREDITS - ext/dbx/INSTALL - ext/dbx/config.m4 - ext/dbx/config.w32 - ext/dbx/dbx.c - ext/dbx/dbx.dsp - ext/dbx/dbx.h - ext/dbx/dbx_fbsql.c - ext/dbx/dbx_fbsql.h - ext/dbx/dbx_mssql.c - ext/dbx/dbx_mssql.h - ext/dbx/dbx_mysql.c - ext/dbx/dbx_mysql.h - ext/dbx/dbx_oci8.c - ext/dbx/dbx_oci8.h - ext/dbx/dbx_odbc.c - ext/dbx/dbx_odbc.h - ext/dbx/dbx_pgsql.c - ext/dbx/dbx_pgsql.h - ext/dbx/dbx_sqlite.c - ext/dbx/dbx_sqlite.h - ext/dbx/dbx_sybasect.c - ext/dbx/dbx_sybasect.h - ext/dbx/howto_extend_dbx.html - ext/dbx/package.xml - ext/dbx/php_dbx.h - ext/dbx/tests/.cvsignore - ext/dbx/tests/001.phpt - ext/dbx/tests/002.phpt - ext/dbx/tests/003.phpt - ext/dbx/tests/004.phpt - ext/dbx/tests/005.phpt - ext/dbx/tests/006.phpt - ext/dbx/tests/007.phpt - ext/dbx/tests/008.phpt - ext/dbx/tests/009.phpt - ext/dbx/tests/010.phpt - ext/dbx/tests/dbx_test.p - ext/dbx/tests/dbx_test.pgsql.script - ext/dbx/tests/dbx_test.script - ext/dbx/tests/skipif.inc - ext/ircg/.cvsignore - ext/ircg/CREDITS - ext/ircg/Makefile.frag - ext/ircg/README.txt - ext/ircg/config.m4 - ext/ircg/ircg.c - ext/ircg/ircg.php - ext/ircg/ircg_common.c - ext/ircg/ircg_scanner.c - ext/ircg/ircg_scanner.re - ext/ircg/ircg_thttpd.c - ext/ircg/php_ircg.h - ext/ircg/php_ircg_alloc.h - ext/ircg/php_ircg_cache.c - ext/ircg/php_ircg_cache.h - ext/ircg/php_ircg_conversion.c - ext/ircg/php_ircg_conversion.h - ext/ircg/php_ircg_error.c - ext/ircg/php_ircg_error.h - ext/ircg/php_ircg_formats.h - ext/ircg/php_ircg_hash.h - ext/ircg/php_ircg_lock.h - ext/ircg/php_ircg_private.h - ext/ircg/php_ircg_smart_str.h - ext/ircg/php_ircg_tokenizer.c - ext/ircg/php_ircg_tokenizer.h: - - Moved ext/dbx and ext/ircg to PECL. - -2005-07-09 Jani Taskinen - - * run-tests.php: - show ugly full path for failed redirected tests - - * ext/ldap/ldap.c: - - No need to use convert_to_string_ex() when dealing with strings - - * NEWS - ext/ldap/ldap.c: - - Fixed bug #33588 (LDAP: RootDSE query not possible). - -2005-07-08 Jani Taskinen - - * run-tests.php: - Sanitazione - -2005-07-08 Marcus Boerger - - * main/snprintf.h: - - Fix *printf(%lld) under windows - -2005-07-08 Antony Dovgal - - * ext/standard/head.c: - fix tsrm build - -2005-07-08 Ilia Alshanetsky - - * ext/standard/head.c: - Missing bit of the previous patch. - - * ext/standard/head.c: - Fixed compiler warning. - -2005-07-08 Antony Dovgal - - * ext/standard/head.c: - make use of T token - - * NEWS - ext/standard/head.c: - fix #33597 (setcookie() "expires" date format doesn't comply with RFC) - -2005-07-08 Jani Taskinen - - * ext/mysqli/tests/041.phpt: - Make sure we get a WARNING and not an ERROR here :) - - * ZendEngine2/tests/unset_cv05.phpt - ZendEngine2/tests/unset_cv06.phpt - tests/basic/bug20539.phpt: - fix test when session.save_handler is "user" - -2005-07-08 Ilia Alshanetsky - - * NEWS - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: - Added pg_fetch_all_columns() function to fetch all values of a column from - a result cursor. - -2005-07-07 Jani Taskinen - - * acinclude.m4: - - Fixed stupid bug in PHP_INSTALL_HEADERS() macro: "foo bar" != foo bar - - ext/date/lib/timelib_config.h is also installed now - -2005-07-07 Dmitry Stogov - - * tests/classes/array_access_001.phpt - tests/classes/array_access_002.phpt: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods). Now empty($obj[...]) works - proper but in addition it may call offsetGet() method. - - * NEWS - ZendEngine2/zend.h - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_objects.c - ZendEngine2/zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y - - * ZendEngine2/zend_stream.c - ZendEngine2/zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Antony Dovgal - - * NEWS - ext/standard/string.c: - fix #33605 (substr_compare() crashes with negative offset & length) - -2005-07-07 Dmitry Stogov - - * NEWS - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_hash.c - ZendEngine2/zend_hash.h - ZendEngine2/tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-07 Wez Furlong - - * run-tests.php: - sort redirected tests - - * run-tests.php: - Fix 2 bugs: - - summary is only displayed if 2 or more tests were detected - - error out of a bogus test name is passed in - -2005-07-07 Rob Richards - - * ext/dom/element.c: - Allow NULL namespaceURI for getAttributeNodeNS - -2005-07-07 Jani Taskinen - - * NEWS: - reorder. Also: Documentation belongs elsewhere :) - -2005-07-07 Anantha Kesari H Y - - * (PHP_5_0) - TSRM/tsrm_virtual_cwd.c: - 1)gwtcwd of NetWare LibC gives a cwd with a volume information. - So using getcwdpath which gives with volume information. - getcwdpath gives with directory seperator as \ which is against our - DEFAULT_SLASH of /. - So finding and replacing \ with / - 2)NetWare file path normalization code in virtual_file_ex. - -- Kamesh - - * TSRM/tsrm_virtual_cwd.h: - Reverting the DEFAULT_SLASH to / as it breaks the FreeBSD derived function - of NetWare LibC like glob. - -- Kamesh - - * TSRM/tsrm_virtual_cwd.c: - gwtcwd of NetWare LibC gives a cwd with a volume information. - So using getcwdpath which gives with volume information. - getcwdpath gives with directory seperator as \ which is against our - DEFAULT_SLASH of /. So finding and replacing \ with / - - -- Kamesh - - * TSRM/tsrm_virtual_cwd.h: - COPY_WHEN_ABSOLUTE is not needed for NetWare. - -- Kamesh - - * (PHP_5_0) - TSRM/tsrm_virtual_cwd.h: - COPY_WHEN_ABSOLUTE is not needed for NetWare. - NetWare can understand the file paths with volumnename with a colon, - starting with / or \\ as absolute paths. - -- Kamesh - -2005-07-07 Dmitry Stogov - - * NEWS - acinclude.m4 - sapi/cgi/config9.m4 - sapi/cli/config.m4: - Fixed support for shared extensions on AIX - -2005-07-07 Rasmus Lerdorf - - * ext/simplexml/simplexml.c: - Missing closing folding marker - -2005-07-06 Edin Kadribasic - - * ext/zlib/php_zlib.def: - Export missing symbol - -2005-07-06 Wez Furlong - - * run-tests.php: - Add a new kind of test to the test harness. REDIRECTTEST sections allow an - extension to piggy-back on the tests defined under another dir and run - those. - - Example of its use follows shortly with pdo tests. - -2005-07-05 Jani Taskinen - - * ext/standard/incomplete_class.c - ext/standard/php_incomplete_class.h: - - Fixed crash in serialize() + classes. (64bit only) - -2005-07-05 Derick Rethans - - * NEWS: - - Fixed bug #33578 (strtotime() doesn't understand "11 Oct" format). - (Derick) - -2005-07-05 Ilia Alshanetsky - - * NEWS - ext/standard/streamsfuncs.c - ext/standard/tests/file/stream_get_line.phpt: - Fixed crash inside stream_get_line() when length parameter equals 0. - -2005-07-05 Edin Kadribasic - - * ext/pgsql/pgsql.c: - Properly detect when the copy command fails - -2005-07-05 Dmitry Stogov - - * main/main.c - main/main.c: - Fixed crash in ext\standard\tests\general_functions\bug32647.php on Windows - - * ext/session/tests/bug31454.phpt - ext/session/tests/bug31454.phpt: - Fixed test file - -2005-07-05 Derick Rethans - - * (PHP_4_4) - NEWS - ext/pgsql/pgsql.c: - - MFH: Fixed memory corruption in pg_copy_from() in case the as_null - parameter - was passed. (Derick) - - * (PHP_5_0) - NEWS - ext/pgsql/pgsql.c: - - MFH: Fixed memory corruption in pg_copy_from() in case the as_null - parameter was - passed. - - * NEWS - ext/pgsql/pgsql.c: - - Fixed memory corruption in pg_copy_from() in case the as_null parameter - was - passed. (Derick) - -2005-07-04 Jon Parise - - * run-tests.php: - If the PHP_AUTOCONF and PHP_AUTOMAKE environmental variables are set, use - them when describing the build environment. - - Support for these variables was originally added to build/build2.mk:1.36. - - As a side note, the build system uses PHP_AUTOHEADER. Perhaps it should - be listed on its own in the build environment for completeness, despite it - being a component of the autoconf package. - -2005-07-04 Dmitry Stogov - - * ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - -2005-07-04 Jani Taskinen - - * ext/session/tests/001.phpt - ext/session/tests/003.phpt - ext/session/tests/006.phpt - ext/session/tests/007.phpt - ext/session/tests/008-php4.2.3.phpt - ext/session/tests/009.phpt - ext/session/tests/012.phpt - ext/session/tests/013.phpt - ext/session/tests/014.phpt - ext/session/tests/015.phpt - ext/session/tests/017.phpt - ext/session/tests/018.phpt - ext/session/tests/019.phpt - ext/session/tests/020.phpt - ext/session/tests/021.phpt - ext/session/tests/bug24592.phpt - ext/session/tests/bug26862.phpt: - Make sure files-save handler is used always - -2005-07-04 Dmitry Stogov - - * NEWS - NEWS - sapi/aolserver/aolserver.c - sapi/aolserver/aolserver.c - sapi/apache2filter/apache_config.c - sapi/apache2filter/apache_config.c - sapi/apache2handler/apache_config.c - sapi/apache2handler/apache_config.c - sapi/nsapi/nsapi.c - sapi/nsapi/nsapi.c: - Fixed bug #33520 (crash if safe_mode is on and session.save_path is - changed) - -2005-07-04 Jani Taskinen - - * tests/lang/023.phpt: - UTC is better - -2005-07-04 Dmitry Stogov - - * ext/standard/tests/array/bug31158.phpt - ext/standard/tests/array/bug31158.phpt: - - Fixed bug #31158 (array_splice on $GLOBALS crashes) - - * NEWS - NEWS - ZendEngine2/zend_API.h - ZendEngine2/zend_execute_API.c - ext/standard/array.c - ext/standard/array.c - ext/standard/tests/array/bug31158.phpt: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-04 Jani Taskinen - - * tests/lang/023.phpt: - fix test - -2005-07-04 Derick Rethans - - * NEWS: - - Fixed bug #33562 (date("") crashes). - -2005-07-03 Derick Rethans - - * NEWS: - - Fixed bug #33536 (strtotime defaults to now even on non time string). - - * ext/standard/basic_functions.c - ext/standard/datetime.c: - - Reimplemented time(), getdate() and localtime() functions with new - datetime - library. - - * NEWS - ext/standard/basic_functions.c - ext/standard/datetime.c - ext/standard/datetime.h: - - Fixed bug #33532 (Different output for strftime() and date()). - - Re-implemented checkdate(), strftime() and gmstrftime() with the new - timelib - code. - -2005-07-03 Jani Taskinen - - * NEWS: - function style - -2005-07-03 Derick Rethans - - * ext/standard/tests/time/003.phpt - ext/standard/tests/time/bug21966.phpt - ext/standard/tests/time/bug27719.phpt - ext/standard/tests/time/mktime.phpt: - - Move mktime/gmmktime related tests from ext/standard to ext/date. - - * NEWS - ext/standard/basic_functions.c - ext/standard/datetime.c - ext/standard/datetime.h - ext/standard/tests/time/003.phpt - ext/standard/tests/time/bug27719.phpt - ext/standard/tests/time/mktime.phpt: - - Fixed bug #30096 (gmmktime does not return the corrent time). - - Re-implemented mktime and gmmktime with new date time library. - - Added testcase for bug #30096, updated test cases for E_STRICT warning - of - is_dst parameter usage for mktime/gmmktime. - -2005-07-03 Dmitry Stogov - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed memory leak - - * (PHP_5_0) - ext/session/tests/007.phpt - ext/session/tests/008-php4.2.3.phpt - ext/session/tests/009.phpt: - Fixed test fules (they assumend register_long_arrays=1) - -2005-07-02 Edin Kadribasic - - * (PHP_4_4) - NEWS: - BFN: now in the correct place :) - - * NEWS - NEWS: - BFN - - * ext/odbc/php_odbc.c: - Don't crash on exit by destroying the same hash twice - -2005-07-02 Derick Rethans - - * NEWS: - - Overhauled selecting the correct timezone. The timezone set with - "date_timezone_set" override the TZ environment variable, which on its - turn - overrides the date.timezone setting. If none of the three is set, we - fallback - to UTC. - - Added "date_timezone_set" function to set the timezone that the date - functions will use. - -2005-07-02 Greg Beaver - - * pear/packages/XML_RPC-1.3.1.tar - pear/packages/XML_RPC-1.3.1.tgz: - XML_RPC -> 1.3.1 (tar, not tgz) - - * pear/packages/XML_RPC-1.2.2.tar - pear/packages/XML_RPC-1.2.2.tar - pear/packages/XML_RPC-1.3.1.tar - pear/packages/XML_RPC-1.3.1.tgz: - XML_RPC -> 1.3.1 - -2005-07-01 Edin Kadribasic - - * php.ini-recommended: - Inconsistency noticed by Nicholas Telford - -2005-07-01 Derick Rethans - - * (PHP_4_4) - configure.in - main/php_version.h: - - Back to -dev - - * (PHP_4_4) - NEWS - configure.in - main/php_version.h: - - GO with RC2. - -2005-07-01 Pierre-Alain Joye - - * (PHP_4_4) - pear/packages/XML_RPC-1.2.2.tar: - - really remove xmp-rpc 1.2.2 - - * pear/packages/XML_RPC-1.3.1.tar - pear/packages/XML_RPC-1.3.1.tar: - 1.1.4; - file XML_RPC-1.3.1.tar was initially added on branch PHP_4_4. - - * (PHP_4_4) - pear/go-pear-list.php: - - update xmp_rpc to 1.3.1 (step #1/3) - - * pear/go-pear-list.php: - bump xml_rpc to 1.3.1, php4 win32 builds uses this list to (4.4) - -2005-07-01 Derick Rethans - - * (PHP_4_4) - ext/pgsql/config.m4: - - Backport config.m4 from HEAD so that pg_config can be used. - -2005-07-01 Anantha Kesari H Y - - * (PHP_5_0) - main/reentrancy.c: - NetWare LibC has reentrant versions of time functions this code is of no - use. - -- Kamesh from hyanantha's account - - * main/reentrancy.c: - NetWare LibC has reentrant time functions no need to have this. - -- Kamesh from hyanantha's account - - * ext/standard/proc_open.c: - As fork implementation of NetWare LibC still in experimental stages making - the procve based solution ahead of HAVE_FORK. Later When fork becomes - stable will revert this fix. - --Kamesh from hyanantha's account - - * (PHP_5_0) - ext/standard/proc_open.c: - As fork implementation of NetWare LibC still in experimental stages making - the procve based solution ahead of HAVE_FORK. Later When fork becomes - stable will revert this fix. - -2005-06-30 Ilia Alshanetsky - - * NEWS - ext/xmlrpc/xmlrpc-epi-php.c: - Fixed bug #33523 (Memory leak in xmlrpc_encode_request()). - -2005-06-30 Derick Rethans - - * NEWS - ext/standard/basic_functions.c - ext/standard/datetime.c - ext/standard/datetime.h - ext/standard/tests/time/bug27719.phpt - ext/standard/tests/time/date.phpt: - - Reimplemented date and gmdate with new timelib code. - - Removed old date/gmdate implementations. - - Moved date() related testcases to ext/date/tests. - - Implemented bug #33452. - - Fixed testcase for bug #27719 - there is no timezone called "EST5DST". - -2005-06-30 Ilia Alshanetsky - - * NEWS: - SQLite lib upgrade news. - -2005-06-30 Wez Furlong - - * ext/openssl/openssl.c: - Add optional parameter to openssl_pkcs7_verify() which specifies the name - of a file that will be filled with the verified data, but with the - signature - information stripped. - - Patch by Marton Kenyeres, mkenyeres (at) konvergencia dot hu - -2005-06-30 Jani Taskinen - - * ext/mysql/config.m4: - consistent naming: prefix always with MYSQL_ - - * ext/bcmath/libbcmath/src/config.h - ext/mcve/mcve.c - ext/pcre/pcrelib/internal.h - ext/standard/html.c - ext/xml/expat_compat.h - main/php_scandir.h - main/php_sprintf.c: - Netware also uses autoconf based config now - -2005-06-30 Dmitry Stogov - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ext/standard/dl.c: - Restored old behavior of zend_statup_module() - -2005-06-30 Jani Taskinen - - * ext/posix/config.m4: - typo - - * ext/simplexml/php_simplexml.h - ext/simplexml/simplexml.c - ext/standard/array.c: - - Unify (+ spl can't be build shared so COMPILE_DL_SPL - -2005-06-30 Derick Rethans - - * ext/posix/config.m4 - ext/posix/posix.c: - - Added check for makedev systemcall, which Netware doesn't support. - -2005-06-29 Anantha Kesari H Y - - * netware/sys/stat.h: - This file is not needed anymore - - * (PHP_5_0) - netware/sys/stat.h: - this file is not needed anymore - - * netware/geterrnoptr.c: - this file is not used at all so removing it. - - * (PHP_5_0) - netware/geterrnoptr.c: - This file is not used at all. - - * netware/mktemp.c: - Netware LibC has mktemp implementation - - * (PHP_5_0) - netware/mktemp.c: - NetWare LibC has mktemp implementation - - * netware/pwd.c - netware/pwd.c: - NetWare LibC has getpwnam, getlogin, getpwuid, getpid, this file is not - needed anymore - -2005-06-29 Antony Dovgal - - * ext/xml/tests/bug32001.phpt: - fix test - -2005-06-29 Anantha Kesari H Y - - * netware/wfile.c - netware/wfile.h: - NetWare LibC has readlink implementation. This is not needed anymore. - - * (PHP_5_0) - netware/wfile.c - netware/wfile.h: - NetWare LibC has readlink implementation - - * netware/time_nw.h: - This file does nothing so removing this file. - - * (PHP_5_0) - netware/time_nw.h: - This file does nothing so removing this file - - * netware/grp.h - netware/grp.h: - NetWare LibC has grp.h - - * netware/param.h - netware/param.h: - NetWare LibC has param.h - - * netware/pipe.h: - NetWare LibC itself has popen/pclose functionality so removing this - - * (PHP_5_0) - netware/pipe.h: - NetWare LibC itself pipe/popen/pclose implementation - -2005-06-29 Johannes Schlüter - - * ext/standard/php_incomplete_class.h: - - Fix TSRM build - -2005-06-29 Anantha Kesari H Y - - * (PHP_5_0) - ext/standard/mail.c: - NetWare LibC itself has a pip/popen support - - * netware/pipe.c: - NetWare LibC has pipe/popen support - - * (PHP_5_0) - netware/pipe.c: - NetWare LibC has a pipe and popen implentation - -2005-06-29 Stanislav Malyshev - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - fix conditions for freeing - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.c: - add comment - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - fix conditions - -2005-06-29 Anantha Kesari H Y - - * netware/mktemp.h: - mktemp functionality is part of Regular LibC - - * (PHP_5_0) - netware/mktemp.h: - mktemp functionality is part of Regular NetWare LibC - - * netware/pwd.h: - removing pwd.h as NetWare LibC itself supplies pwd.h - - * (PHP_5_0) - netware/pwd.h: - removing pwd.h as NetWare LibC itself supplies pwd.h for quite sometime - - * (PHP_5_0) - main/reentrancy.c: - removed the unwanted NetWare Code - - * (PHP_5_0) - main/php.h: - Removing unwanted NetWare Code - - * (PHP_5_0) - main/mergesort.c: - removing unwanted NetWare code - -2005-06-28 Jani Taskinen - - * ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c: - - Regenerated with re2c 0.9.8 - -2005-06-28 Antony Dovgal - - * ZendEngine2/zend_execute.c: - fix leak: when dup was ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Derick Rethans - - * NEWS: - - Added testcases for bug #14561 and #26090 and updated NEWS with those - fixed bug nr's. - -2005-06-28 Jani Taskinen - - * ext/informix/Makefile.frag - ext/informix/config.m4: - - Fixed bug #33469 also for shared builds - -2005-06-28 Derick Rethans - - * NEWS: - - Fixed bug #33415 and added test cases for #33414 and #33415. - -2005-06-28 Jani Taskinen - - * acinclude.m4: - re2c 0.98 is the current working version - -2005-06-28 Derick Rethans - - * NEWS: - - Fixed bug #33433 (strtoll not available on Tru64). - -2005-06-28 Jani Taskinen - - * (PHP_5_0) - NEWS: - Removed unnecessary entry - - * NEWS: - BFN - -2005-06-28 Brian France - - * (PHP_5_0) - NEWS - sapi/apache/mod_php5.c: - - MFH: - - Added a SG(server_context) NULL check to php_apache_getenv. - - This can get called when " = ${}:/foo" is used in a .ini file, - but has not be set yet. - You will end up with a value of ":/foo", but at least it will not crash. - - * NEWS - sapi/apache/mod_php5.c: - - Added a SG(server_context) NULL check to php_apache_getenv. - - This can get called when " = ${}:/foo" is used in a .ini file, - but has not be set yet. - You will end up with a value of ":/foo", but at least it will not - crash now. - -2005-06-28 Anantha Kesari H Y - - * (PHP_5_0) - main/php_open_temporary_file.c: - removed redundant NEW_LIBC checks - - * (PHP_5_0) - ext/standard/image.c: - removed the unwanted NetWare Code - - * (PHP_5_0) - ext/standard/microtime.c: - removing unwanted NetWare portion - - * (PHP_5_0) - ext/standard/fsock.h - ext/standard/lcg.c: - removing the redundant NEW_LIBC checks - - * (PHP_5_0) - ext/standard/head.c: - removing redundant NEW_LIBC checks for NetWare - - * (PHP_5_0) - ext/snmp/snmp.c - ext/standard/filestat.c - ext/standard/flock_compat.c: - removing redundant NEW_LIBC checks - -2005-06-28 Stanislav Malyshev - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - fix previous patch - - * ZendEngine2/zend_vm_execute.h: - update - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - - * ext/standard/php_incomplete_class.h - ext/standard/var.c: - fix handling of non-PHP classes (John Coggeshall) - - * (PHP_5_0) - ext/standard/php_incomplete_class.h - ext/standard/var.c: - fix non-PHP object handling (from John Coggeshall) - -2005-06-27 Jani Taskinen - - * ZendEngine2/zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - - * ext/mysqli/tests/bug33491.phpt: - add test case - - * NEWS - ext/informix/Makefile.frag - ext/informix/config.m4: - - Fixed bug #33469 (Compile error undefined reference to ifx_checkAPI). - - * acinclude.m4: - - Cache the xml2-config path - -2005-06-27 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli.c: - MFH: fix #33491 (crash after extending MySQLi internal class) - - * (PHP_5_0) - ext/mysqli/mysqli_nonapi.c: - MFH: fix leak appearing when connect fails - -2005-06-27 Stanislav Malyshev - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_API.h - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_exceptions.c - ZendEngine2/zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Antony Dovgal - - * NEWS: - BFN - - * ext/mysqli/mysqli.c: - fix #33491 (crash after extending MySQLi internal class) - - * ext/mysqli/mysqli_exception.c - ext/mysqli/mysqli_nonapi.c: - fix couple of leaks in MySQLi - -2005-06-27 Jani Taskinen - - * ext/mysqli/tests/065.phpt: - set_charset() is only available in mysql versions > 4.1.12 - - * ext/mysqli/tests/061.phpt: - do not pollute other directories and cleanup after test - -2005-06-27 Dmitry Stogov - - * (PHP_4_4) - Zend/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-26 Jani Taskinen - - * ext/dom/document.c - ext/dom/namednodemap.c - ext/dom/nodelist.c: - - Fixed bugs #33431, #33432 ("int" used instead of "long" in parameter - parsing) - -2005-06-26 Ilia Alshanetsky - - * NEWS - ext/curl/interface.c - ext/curl/multi.c: - Fixed bug #33475 (cURL handle is not closed on curl_close(). - -2005-06-26 Jani Taskinen - - * (PHP_5_0) - pear/go-pear-list.php: - revert the conflicting part - -2005-06-26 Holger Zimmermann - - * (PHP_4_4) - sapi/pi3web/pi3web_sapi.c - sapi/pi3web/pi3web_sapi.c: - Replaced PCHAR by CHAR * (not defined in pi3web_sapi header) - -2005-06-26 Pierre-Alain Joye - - * (PHP_5_0) - pear/go-pear-list.php: - - Bump xml_rpc version - - * pear/go-pear-list.php: - - bump xml_rpc version - -2005-06-26 Georg Richter - - * ext/mysqli/mysqli_nonapi.c: - fix for #33474 - -2005-06-24 Ilia Alshanetsky - - * NEWS: - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql, to toggle - usage of buffered queries. - -2005-06-24 Georg Richter - - * ext/mysqli/mysqli_fe.c: - reverted Ilias changes - added get_warnings methods - (forgot to commit the file in my last commit) - -2005-06-24 Dmitry Stogov - - * ZendEngine2/zend_execute.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * (PHP_4_4) - Zend/zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * ZendEngine2/tests/bug30519.phpt - ZendEngine2/tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * NEWS - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-24 Ilia Alshanetsky - - * main/streams/plain_wrapper.c: - Likely fix for bug #33140 - -2005-06-23 Dmitry Stogov - - * tests/lang/bug28377.phpt - tests/lang/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_4_4. - - * NEWS - NEWS - NEWS - Zend/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * ZendEngine2/tests/bug28377.phpt - ZendEngine2/tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * ZendEngine2/tests/bug32660.phpt - ZendEngine2/tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * NEWS - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - -2005-06-23 Rasmus Lerdorf - - * tests/classes/ctor_name_clash.phpt: - Don't really need the ZE2 check since this is in HEAD - -2005-06-23 Jani Taskinen - - * ext/dom/tests/dom003.phpt: - fix test - -2005-06-23 Rasmus Lerdorf - - * tests/classes/ctor_name_clash.phpt: - test for derived method name clashes - -2005-06-23 Dmitry Stogov - - * ext/dom/tests/dom003.phpt - ext/dom/tests/dom003.phpt: - Fixed test file according to latest debug_backtrace() fixes - - * NEWS - NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * ZendEngine2/tests/bug30828.phpt - ZendEngine2/tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - ZendEngine2/tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * ZendEngine2/tests/bug27268.phpt - ZendEngine2/tests/bug27268.phpt: - - Fixed bug #27268 (Bad references accentuated by clone). - - * NEWS - ZendEngine2/zend_execute.c: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans - - * NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev - - * (php_5_1_0b2) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Beta 2 - -2005-06-23 Ilia Alshanetsky - - * (php_5_1_0b2) - ext/mysqli/mysqli_fe.c: - temporary fix to let mysqli extension build, so we can make a release. - -2005-06-22 Rob Richards - - * NEWS: - BFN - - * (PHP_5_0) - ext/dom/dom_ce.h - ext/dom/php_dom.c - ext/dom/xml_common.h: - MFH: Fix bug #33299 (php:function no longer handles returned dom objects) - - maybe fix #33431/33432 - - * (php_5_1_0b2) - ext/dom/dom_ce.h - ext/dom/php_dom.c - ext/dom/xml_common.h: - - Fix bug #33299 (php:function no longer handles returned dom objects) - - maybe fix #33431/33432 - -2005-06-22 Ilia Alshanetsky - - * NEWS - ext/standard/file.c - ext/standard/tests/file/bug32160.phpt - ext/standard/tests/file/bug32160.txt: - Fixed bug #32160 (copying a file into itself leads to data loss). - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - ext/dom/tests/dom003.phpt - tests/lang/bug32828.phpt - tests/lang/bug32828.phpt: - Debug backtrace was fixed - - * NEWS - NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * ZendEngine2/tests/bug29896.phpt - ZendEngine2/tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Ilia Alshanetsky - - * (php_5_1_0b2) - ext/mysqli/tests/connect.inc: - Slightly more reliable current path detection. - - * (php_5_1_0b2) - ext/mysqli/tests/skipif.inc: - Skip MySQLi tests if connection could not be established and not using - embeded db. - -2005-06-22 Jani Taskinen - - * (php_5_1_0b2) - ext/standard/tests/array/array_sum.phpt: - "64M should be enough for everyone." -- Jani, 2005 :) - -2005-06-22 Stanislav Malyshev - - * (php_5_1_0b2) - ZendEngine2/zend_vm.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal - - * NEWS - ZendEngine2/zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Anantha Kesari H Y - - * (PHP_5_0) - main/main.c: - removing the redundant NEW_LIBC checks - - * (PHP_5_0) - main/fopen_wrappers.c: - NetWare LibC has sys/param.h - -2005-06-22 Georg Richter - - * (php_5_1_0b2) - ext/mysqli/tests/066.phpt: - added testcase for mysqli_warning class - - * (php_5_1_0b2) - ext/mysqli/tests/067.phpt: - added testcase for cursors (nested selects) - - * (php_5_1_0b2) - ext/mysqli/mysqli.c - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h: - changed/fixed mysqli_warning class - added prefetch support for cursors - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - ext/iconv/tests/iconv_mime_encode.phpt - ext/iconv/tests/iconv_mime_encode.phpt: - Fixed bug in test file - - * NEWS - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * ZendEngine2/tests/bug33257.phpt - ZendEngine2/tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen - - * NEWS: - BFN - - * (php_5_1_0b2) - ext/odbc/config.m4: - - Fixed bug #33427 (ext/odbc: check if unixODBC header file exists) - - * (php_5_1_0b2) - acinclude.m4: - - Never ever add /usr/lib as libpath, even if --with-libdir is used - - * (php_5_1_0b2) - ZendEngine2/tests/unset_cv05.phpt - ZendEngine2/tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov - - * ZendEngine2/tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans - - * configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - ZendEngine2/zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Jani Taskinen - - * (php_5_1_0b2) - build/genif.sh: - - Partial revert: It does not matter if awk works or not but helps if it - does :) - - * (php_5_1_0b2) - ext/sysvmsg/tests/002.phpt: - fix test - -2005-06-21 Dmitry Stogov - - * NEWS - NEWS - NEWS - ext/standard/array.c - ext/standard/array.c - ext/standard/array.c: - Fixed bug #31213 (Sideeffects caused by fix of bug #29493) - - * (PHP_5_0) - ZendEngine2/zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - ZendEngine2/zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-21 Jani Taskinen - - * (php_5_1_0b2) - acinclude.m4: - Fix configure problem in braindead systems like Solaris. - -2005-06-21 Marcus Boerger - - * (php_5_1_0b2) - tests/classes/array_access_012.phpt: - - Add new test - -2005-06-21 Dmitry Stogov - - * (PHP_5_0) - ext/standard/tests/serialize/bug31402.phpt: - Fixed test file (the bug was already fixed) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - sapi/cli/php_cli.c: - Fixed possible memory corruption. - -2005-06-19 Marcus Boerger - - * tests/classes/array_access_011.phpt: - - Add new test - -2005-06-19 Derick Rethans - - * genfiles - ext/standard/.cvsignore - ext/standard/Makefile.frag - ext/standard/config.m4 - ext/standard/config.w32 - ext/standard/datetime.c - ext/standard/parsedate.y - ext/standard/php_parsedate.h - ext/wddx/wddx.c - netware/BisonExtStandard.bat - netware/phplib.mak - win32/php5dll.dsp - win32/php5dllts.dsp: - - Added backward compability wrapper "php_parse_date()". - - Changed WDDX extension to use new date parsing code. - - Removed all remnants to the old parser. - -2005-06-19 Marcus Boerger - - * tests/classes/array_access_010.phpt: - - Add new test - -2005-06-19 Derick Rethans - - * ZendEngine2/tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-19 Marcus Boerger - - * tests/classes/array_access_009.phpt: - - Drop doubled $ - - * tests/classes/array_access_009.phpt: - - Add new test - - * tests/classes/array_access_003.phpt - tests/classes/array_access_005.phpt - tests/classes/array_access_008.phpt: - - Update tests to reflect current situation - -2005-06-19 Ilia Alshanetsky - - * ext/standard/string.c: - make substr_count() 30% when counting instances of 1 byte long strings. - -2005-06-19 Derick Rethans - - * NEWS: - - Add #20382 to the list, and expand testcase again. - -2005-06-18 Jani Taskinen - - * NEWS: - reorder + typofix :) - -2005-06-18 Derick Rethans - - * (PHP_5_0) - build/shtool: - - MFH: - Updated bundled shtool to version 2.0.2 - - * NEWS: - - Update NEWS with bugfix happyness. - - Update TODO file for ext/date. No known bugs currently. - -2005-06-18 Jani Taskinen - - * NEWS - NEWS - NEWS: - BFN - - * build/shtool: - - Updated bundled shtool to version 2.0.2 - -2005-06-18 Ilia Alshanetsky - - * NEWS - ext/standard/string.c - ext/standard/tests/strings/substr_count.phpt: - Added offset & length parameters to substr_count() function. - -2005-06-18 Andi Gutmans - - * php.ini-recommended: - - E_STRICT shouldn't be on by default on production servers. - -2005-06-18 Jani Taskinen - - * ext/dba/config.m4: - Add note how to build DBA as shared - - * ext/odbc/config.m4: - no trailing dots - - * ext/standard/tests/file/bug26615.phpt: - Make sure $_ENV is populated - - * ext/standard/tests/array/bug29992.phpt: - - This is no bug. - -2005-06-17 Ilia Alshanetsky - - * NEWS - ext/standard/streamsfuncs.c: - Added offset parameter to the stream_copy_to_stream() function. - -2005-06-17 Jani Taskinen - - * ZendEngine2/tests/bug29368.phpt - ZendEngine2/tests/bug30856.phpt - ZendEngine2/tests/bug30961.phpt - ZendEngine2/tests/bug31720.phpt - ZendEngine2/tests/bug32226.phpt - ZendEngine2/tests/bug33277.phpt: - No short-tags! - -2005-06-17 Georg Richter - - * ext/mysqli/tests/bug33263.phpt - ext/mysqli/tests/bug33263.phpt: - - fix for bug #33263 (mysqli_real_escape doesn't work in __construct) - - * ext/mysqli/mysqli_api.c: - fix for bug #33263 (mysqli_real_escape doesn't work in __construct) - -2005-06-17 Andrei Zmievski - - * NEWS: - -** empty log message *** - -2005-06-17 Jani Taskinen - - * ext/gmp/tests/bug32773.phpt: - fix test - short_tags not allowed here! - -2005-06-17 Dmitry Stogov - - * ZendEngine2/zend_compile.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - - * (PHP_4_4) - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/tests/serialize/bug31402.phpt: - Fixed bug #31402 (unserialize creates a field containing a reference when - it should not) - -2005-06-17 Jani Taskinen - - * ext/sqlite/pdo_sqlite2.c: - nuke unused variable - - * ext/xml/xml.c: - Use new dependency system - - * ext/simplexml/simplexml.c - ext/sqlite/sqlite.c - ext/xsl/php_xsl.c: - Use the new dependency system - -2005-06-17 Antony Dovgal - - * (PHP_5_0) - ZendEngine2/zend_API.c - ZendEngine2/zend_list.c: - MFH: improve error messages in internal classes - - * ZendEngine2/zend_API.c - ZendEngine2/zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - - * NEWS - ext/standard/tests/array/bug33382.phpt: - add news entry and test for bug #33382 - -2005-06-17 Dmitry Stogov - - * NEWS - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal - - * ZendEngine2/zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov - - * build/genif.sh - ext/dom/php_dom.c - ext/sqlite/sqlite.c - ext/standard/dl.c - ext/standard/dl.h - main/internal_functions.c.in - main/internal_functions_nw.c - main/internal_functions_win32.c - main/main.c - main/php.h - main/php_ini.c - main/php_ini.h - main/php_main.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts - - * NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_extensions.h - ZendEngine2/zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Internal functions/methods can now return by reference - -2005-06-16 Ilia Alshanetsky - - * ext/gd/libgd/gdxpm.c: - Fixed memory corruption. - -2005-06-16 Marcus Boerger - - * Makefile.global: - - No more memory_limit for running tests - -2005-06-16 Derick Rethans - - * ext/standard/tests/time/002-win32.phpt - ext/standard/tests/time/002.phpt - ext/standard/tests/time/bug13142.phpt - ext/standard/tests/time/bug17988.phpt - ext/standard/tests/time/bug20382.phpt - ext/standard/tests/time/bug26198.phpt - ext/standard/tests/time/bug26317.phpt - ext/standard/tests/time/bug26320.phpt - ext/standard/tests/time/bug27780.phpt - ext/standard/tests/time/bug28599.phpt: - - Move strtotime() related testcases to ext/date/tests. - -2005-06-16 Marcus Boerger - - * ZendEngine2/zend_execute.c: - - Fix TSRM build - -2005-06-16 Jani Taskinen - - * run-tests.php: - silence notices - - * NEWS: - typofix - -2005-06-16 Wez Furlong - - * ext/standard/dl.c: - Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is - widely (and safely) used. - This allows our test-suite to run in E_STRICT mode. - -2005-06-16 Dmitry Stogov - - * ZendEngine2/bench.php: - typo - -2005-06-16 Wez Furlong - - * ext/standard/array.c: - Fix compile on win32 at least. - - * sapi/cgi/cgi_main.c: - Don't crash here if there are errors (such as failing to load extensions - via - php.ini) during startup. - -2005-06-16 Dmitry Stogov - - * NEWS - ZendEngine2/zend.h - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_extensions.h - ZendEngine2/zend_modules.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov - - * NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski - - * ZendEngine2/zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Compilation warnings - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h: - export zval getters - -2005-06-16 Derick Rethans - - * EXTENSIONS - ext/standard/credits_ext.h: - - Update maintainers and credits. - -2005-06-16 Dmitry Stogov - - * ZendEngine2/zend_execute.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Andrei Zmievski - - * ext/standard/array.c: - WS fix - - * ext/standard/array.c - ext/standard/basic_functions.c - ext/standard/basic_functions.h: - Fix FCI cache for array_walk and user array compare functions. Bug - -2005-06-15 Dmitry Stogov - - * ZendEngine2/zend.c - ZendEngine2/zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen - - * scripts/phpize.in: - - This does not have to be egrep here - -2005-06-15 Georg Richter - - * (PHP_5_0) - ext/mysqli/mysqli_api.c: - fixed parameter parse string for mysqli_stmt_attr_set - -2005-06-15 Jani Taskinen - - * ZendEngine2/tests/bug32428.phpt: - typofix - - * run-tests.php: - Show borked tests in the summary - -2005-06-14 Ilia Alshanetsky - - * ZendEngine2/bench.php: - more accurate timing function. - -2005-06-14 Jani Taskinen - - * tests/lang/bug21800.phpt: - This test did not fit to the new interactive shell thing - - * NEWS: - BFN - -2005-06-14 Derick Rethans - - * NEWS - ext/standard/basic_functions.c - ext/standard/datetime.c - ext/standard/datetime.h - ext/standard/type.c - ext/standard/tests/time/002.phpt: - - Add my new timelib and ext/date. For now only strtotime() makes use of - this. - -2005-06-14 Rob Richards - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/xsl/xsltprocessor.c: - MFH: Fixed bug #33340 (CLI Crash when calling php:function from XSLT) - - * ext/xsl/xsltprocessor.c: - Fixed bug #33340 (CLI Crash when calling php:function from XSLT) - -2005-06-14 Ilia Alshanetsky - - * main/network.c: - bzero > memset - -2005-06-14 Dmitry Stogov - - * ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen - - * ZendEngine2/Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * ZendEngine2/Zend.m4: - typofix - - * ZendEngine2/Zend.m4 - ZendEngine2/acinclude.m4: - fix standalone build - -2005-06-14 Sebastian Bergmann - - * main/streams/xp_socket.c: - ZTS fix. - -2005-06-14 Ilia Alshanetsky - - * NEWS - ext/ftp/ftp.c - main/network.c - main/php_network.h - main/streams/xp_socket.c: - Added bindto socket context option. - -2005-06-14 Jani Taskinen - - * acinclude.m4: - Make this usable for header files too - - * ext/sqlite/config.m4: - use PHP_CHECK_PDO_INCLUDES - - * acinclude.m4: - Allow different things to be done when found / not-found - - * acinclude.m4: - - Added PHP_CHECK_PDO_INCLUDES macro (caches the result) - -2005-06-13 Hartmut Holzgraefe - - * NEWS: - added news item for GLOB_ERR fix - -2005-06-13 Edin Kadribasic - - * ext/bz2/bz2.c: - MFB: MSVC++ 6.0 doesn't support long long type - - * (PHP_4_4) - ext/bz2/bz2.c: - MSVC++ 6.0 doesn't support long long type - -2005-06-13 Dmitry Stogov - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Specializer optimization - -2005-06-13 Derick Rethans - - * (PHP_4_4) - configure.in - main/php_version.h: - - Back to dev - - * (PHP_4_4) - NEWS - configure.in - main/php_version.h: - - Go with 4.4.0RC1. - -2005-06-13 Jani Taskinen - - * (PHP_4_4) - ext/standard/var_unserializer.c: - touch - -2005-06-13 Derick Rethans - - * (PHP_4_4) - ext/standard/var_unserializer.re: - - MFH: Fixed bug with unserialize() with "exotic" letters in class names - -2005-06-13 Dmitry Stogov - - * NEWS - ZendEngine2/zend.c - ZendEngine2/zend.h - ZendEngine2/zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - -2005-06-13 Antony Dovgal - - * (PHP_4_4) - ext/oci8/oci8.c - ext/oci8/oci8.c: - MFH: - destroy session after destroying error handle - SQLT_CHR is allowed too - - * ext/oci8/oci8.c: - destroy session after destroying error handle - SQLT_CHR is allowed too - -2005-06-13 Jani Taskinen - - * NEWS - acinclude.m4: - - Fixed bug #31256 (PHP_EVAL_LIBLINE configure macro does not handle - -pthread) - -2005-06-13 Dmitry Stogov - - * NEWS - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-12 Ilia Alshanetsky - - * ext/standard/user_filters.c: - Removed unused var. - -2005-06-12 Hartmut Holzgraefe - - * ext/standard/dir.c: - Support for GLOB_ERR so that glob() reports permission problems (Bug - #28355) - - * ext/standard/dir.c: - thinko fix (E_COMMIT_AFTER_MIDNIGHT) - - * ext/standard/dir.c: - Removed bogus fix for bug #28355 (it was dead code anyway) - -2005-06-11 Jani Taskinen - - * (PHP_4_4) - ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c: - Revert. re2c 0.9.7 obviously does not work properly (or our .re files are - buggy) - - * ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c: - revert - - * ext/mysql/config.m4: - Another netware fix - - * NEWS: - Merge the bug fix entries from PHP_5_0 branch - - * ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c: - regenerated with re2c 0.9.7 - -2005-06-11 Andi Gutmans - - * configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev - - * (php_5_1_0b2) - NEWS - configure.in - ZendEngine2/zend.h - main/php_version.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans - - * configure.in - ZendEngine2/zend.h - main/php_version.h: - - Back to -dev - - * (php_5_1_0b1) - configure.in - ZendEngine2/zend.h - main/php_version.h: - - Go with 5.1.0b1 - - * (php_5_1_0b1) - NEWS: - - Go with Beta 1 - - Merged 5.0.x news and nuked anything prior to 5.0.0 release - -2005-06-10 Jani Taskinen - - * (php_5_1_0b1) - scripts/phpize.in: - - Fix phpize: need to eval path variables for them to be usable - -2005-06-10 Dmitry Stogov - - * NEWS: - Add some entries that was forgotten - - * (php_5_1_0b1) - ZendEngine2/tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - ZendEngine2/tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * ZendEngine2/tests/bug31177.phpt - ZendEngine2/tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - ZendEngine2/tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - ZendEngine2/zend_reflection_api.c - ZendEngine2/zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h - ZendEngine2/zend_extensions.h - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - ZendEngine2/zend_compile.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev - - * NEWS - NEWS: - - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * ZendEngine2/tests/bug33277.phpt: - add test for this TBF bug - - * (PHP_5_0) - NEWS: - RIP abstrace private - - * ZendEngine2/zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - ZendEngine2/zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov - - * ZendEngine2/zend.c - ZendEngine2/zend.c - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev - - * ZendEngine2/tests/bug33277.phpt - ZendEngine2/tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Ilia Alshanetsky - - * ext/bz2/bz2.c: - Fixed compiler warning. - -2005-06-09 Wez Furlong - - * main/main.c: - hmm, backing out this change, as it seems to cause problems with user-space - streams and filters (the ZE needs to close them before it blows away the - user-space code. - - Noticed by Dmitry. Still need to find out how to avoid double-closing - streams. - -2005-06-09 Dmitry Stogov - - * (PHP_5_0) - NEWS - Zend/zend.c - ZendEngine2/zend.c - ZendEngine2/zend.c - tests/lang/bug25922.phpt - tests/lang/bug25922.phpt - tests/lang/bug25922.phpt: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - - * ext/standard/user_filters.c - ext/standard/user_filters.c: - Fixed reference counting and probable crash on fclose() or shutdown - -2005-06-08 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/iconv/iconv.c: - MFH: Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3 - in length). - - * ext/iconv/iconv.c: - Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3 in - length) - -2005-06-08 Dmitry Stogov - - * ext/standard/array.c - ext/standard/array.c - ext/standard/array.c: - Fixed memory allocation bugs in array_reduce() with initial value (#22463 & - #24980) - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c: - Fixed valgrind errors - - * ZendEngine2/zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen - - * ZendEngine2/zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov - - * ext/standard/var.c - ext/standard/var.c: - Fixed incorrect usage of zend_mangle_property_name() (valgrind errors) - - * ZendEngine2/zend_compile.c: - Fixed lookups for previos opcodes - - * ZendEngine2/tests/bug30140.phpt - ZendEngine2/tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * (PHP_5_0) - ZendEngine2/tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * ZendEngine2/tests/bug32322.phpt - ZendEngine2/tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/classes/clone_006.phpt - tests/classes/clone_006.phpt: - Fixed test file affected by fix for bug #30820 (static member conflict with - $this->member silently ignored) - - * ZendEngine2/tests/bug30820.phpt - ZendEngine2/tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * ZendEngine2/tests/bug30961.phpt - ZendEngine2/tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_parser.y - ZendEngine2/tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - -2005-06-07 Jani Taskinen - - * scripts/Makefile.frag - scripts/phpize.in: - - Fix paths when using --libdir and --includedir configure options - - * ext/standard/tests/array/bug31213.phpt: - - It is nice to close the script with ?>.. - -2005-06-07 Dmitry Stogov - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * configure.in - ZendEngine2/Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4 - ZendEngine2/acinclude.m4 - ext/sqlite/config.m4: - - Show "none" when nothing is found - -2005-06-07 Dmitry Stogov - - * ext/sqlite/sqlite.c - ext/sqlite/sqlite.c: - Fixed memory allocation bugs. Probably this patch should fix bug #31725. - -2005-06-07 Ilia Alshanetsky - - * ZendEngine2/zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_4_4) - configure.in - configure.in - Zend/zend_alloc.h - ZendEngine2/zend_alloc.h - ext/standard/info.c - ext/standard/info.c: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * configure.in - ZendEngine2/zend_alloc.h - ext/standard/info.c: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - - * NEWS: - - Not sure why this wasn't committed... - -2005-06-07 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - -2005-06-07 Jani Taskinen - - * ext/mysql/config.m4 - ext/mysqli/config.m4: - - Allow doing --with-mysql --with-mysqli (no mysql libs are bundled atm) - - Make sure MYSQL_DIR is empty. - -2005-06-07 Dmitry Stogov - - * (PHP_4_4) - Zend/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - - * (PHP_4_4) - NEWS - Zend/zend_execute.c: - - Fixed bug #32685, #29423 (Segfault when using assignment by reference - within - function). - -2005-06-07 Dmitry Stogov - - * (PHP_4_4) - Zend/zend_compile.c - Zend/zend_execute.c - Zend/zend_language_parser.y: - Fixed memory corruptions when using references in a wrong way. - Backport $a =& func(); patch. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - main/streams/php_streams_int.h: - - MFH: Don't crash when compiled with the zend memory manager disabled. - -2005-06-07 Dmitry Stogov - - * ZendEngine2/tests/bug33243.phpt - ZendEngine2/tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_objects.c - ZendEngine2/zend_objects.c - ZendEngine2/tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - -2005-06-07 Jani Taskinen - - * scripts/Makefile.frag - scripts/phpize.in: - - Fix paths when using --libdir and --includedir configure options - - * ext/standard/tests/array/bug31213.phpt: - - It is nice to close the script with ?>.. - -2005-06-07 Dmitry Stogov - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * configure.in - ZendEngine2/Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4 - ZendEngine2/acinclude.m4 - ext/sqlite/config.m4: - - Show "none" when nothing is found - -2005-06-07 Dmitry Stogov - - * ext/sqlite/sqlite.c - ext/sqlite/sqlite.c: - Fixed memory allocation bugs. Probably this patch should fix bug #31725. - -2005-06-07 Ilia Alshanetsky - - * ZendEngine2/zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_4_4) - configure.in - configure.in - Zend/zend_alloc.h - ZendEngine2/zend_alloc.h - ext/standard/info.c - ext/standard/info.c: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * configure.in - ZendEngine2/zend_alloc.h - ext/standard/info.c: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - - * NEWS: - - Not sure why this wasn't committed... - -2005-06-07 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - -2005-06-07 Jani Taskinen - - * ext/mysql/config.m4 - ext/mysqli/config.m4: - - Allow doing --with-mysql --with-mysqli (no mysql libs are bundled atm) - - Make sure MYSQL_DIR is empty. - -2005-06-07 Dmitry Stogov - - * (PHP_4_4) - Zend/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - - * (PHP_4_4) - NEWS - Zend/zend_execute.c: - - Fixed bug #32685, #29423 (Segfault when using assignment by reference - within - function). - -2005-06-07 Dmitry Stogov - - * (PHP_4_4) - Zend/zend_compile.c - Zend/zend_execute.c - Zend/zend_language_parser.y: - Fixed memory corruptions when using references in a wrong way. - Backport $a =& func(); patch. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - main/streams/php_streams_int.h: - - MFH: Don't crash when compiled with the zend memory manager disabled. - -2005-06-07 Dmitry Stogov - - * ZendEngine2/tests/bug33243.phpt - ZendEngine2/tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_objects.c - ZendEngine2/zend_objects.c - ZendEngine2/tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - -2005-06-06 Wez Furlong - - * ext/posix/config.m4 - ext/posix/posix.c: - fix build on Solaris - -2005-06-06 Jani Taskinen - - * main/main.c: - silence warning - -2005-06-06 Brad House - - * (PHP_5_0) - ext/mcve/mcve.c - ext/mcve/php_mcve.h: - libmonetra 5.0 sync. - added m_validateidentifier, which is enabled by default to keep invalid - pointer addresses from causing PHP to crash - kept compatability with older versions of libmonetra. - - * ext/mcve/mcve.c - ext/mcve/php_mcve.h: - libmonetra-5.0 sync. - added m_validateidentifier, which is enabled by default to keep invalid - pointer addresses from causing PHP to crash - kept compatability with older versions of libmonetra. - -2005-06-06 Ilia Alshanetsky - - * (PHP_4_4) - ext/bz2/bz2.c - ext/bz2/bz2.c: - MFH: Better storage size for output length. - - * ext/bz2/bz2.c: - Better storage size for output length. - -2005-06-06 Derick Rethans - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Ilia Alshanetsky - - * (PHP_4_4) - ext/standard/type.c: - MFH: Fixed strval to not print notices on strval(array()). - -2005-06-06 Derick Rethans - - * (PHP_4_4) - NEWS - ext/standard/http_fopen_wrapper.c: - - MFH: Fixed bug #33242 (Mangled error message when stream fails). - - * (PHP_5_0) - NEWS - ext/standard/http_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c: - - Fixed bug #33242 (Mangled error message when stream fails). - -2005-06-06 Jani Taskinen - - * (PHP_5_0) - scripts/Makefile.frag: - ws - -2005-06-06 Derick Rethans - - * (PHP_4_4) - Zend/zend_execute.c: - - Swap lines so that user defined error handlers don't cause memory errors - - * (PHP_4_4) - scripts/Makefile.frag: - - We've man pages just fine - -2005-06-06 Dmitry Stogov - - * NEWS - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - -2005-06-06 Derick Rethans - - * (PHP_4_4) - NEWS: - - Update NEWS with the bz fix - -2005-06-06 Uwe Schindler - - * (PHP_4_4) - scripts/Makefile.frag: - MFH: Fix bug #33166 for other branches and new bug #33255, no man pages for - 4.4 - - * (PHP_5_0) - scripts/Makefile.frag: - Fix bug #33166 for other branches and new bug #33255 - -2005-06-06 Derick Rethans - - * (PHP_4_4) - ext/bz2/bz2.c: - - Merge back changes which where in 4.3 but somehow didn't make it into the - new - branch. - -2005-06-06 Dmitry Stogov - - * ZendEngine2/tests/bug32799.phpt - ZendEngine2/tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_objects_API.c - ZendEngine2/zend_objects_API.c - ZendEngine2/tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * ZendEngine2/tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * ZendEngine2/tests/bug32596.phpt - ZendEngine2/tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - -2005-06-06 Derick Rethans - - * (PHP_4_4) - Zend/zend_extensions.h: - - Bumb ZEND EXT API NO for Stanislav - -2005-06-06 Edin Kadribasic - - * (PHP_4_4) - win32/php4dllts.dsp: - Sync with recent config.m4 changes - -2005-06-06 Derick Rethans - - * (PHP_4_4) - NEWS - Zend/zend_compile.c - Zend/zend_compile.h - Zend/zend_execute.c - Zend/zend_execute_globals.h - Zend/zend_language_parser.y: - - Commit the reference problem bug fix. - - * (PHP_4_4) - configure.in - main/php_version.h: - - Rename version. - -2005-06-06 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * ZendEngine2/tests/bug32993.phpt - ZendEngine2/tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * ZendEngine2/tests/bug33171.phpt - ZendEngine2/tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - -2005-06-06 Marcus Boerger - - * sapi/cli/php_cli.c: - - Expose -a as special mode and show whether it is a shell or not - -2005-06-06 Wez Furlong - - * main/streams/php_streams_int.h: - Don't crash when compiled with the zend memory manager disabled. - - * ZendEngine2/zend_language_scanner.l - main/main.c: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-05 Wez Furlong - - * ext/mysql/config.w32 - ext/mysqli/config.w32 - ext/pgsql/config.w32: - fixes for #33251 - -2005-06-05 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/bz2/bz2.c - ext/bz2/bz2.c: - MFH: Fixed bug #33070 (Improved performance of bzdecompress() by several - orders of magnitude). - - * ext/bz2/bz2.c: - Fixed bug #33070 (Improved performance of bzdecompress() by several orders - of magnitude). - -2005-06-05 Jani Taskinen - - * scripts/phpize.in - scripts/phpize.m4: - - Proper fix for phpize when dealing with PECL - -2005-06-04 Zeev Suraski - - * main/main.c: - __halt_compiler() patch interface - - * ZendEngine2/zend_compile.h - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_stream.c - ZendEngine2/zend_stream.h - ZendEngine2/tests/halt01.phpt - ZendEngine2/tests/halt02.phpt - ZendEngine2/tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Jani Taskinen - - * ext/xml/tests/bug32001.phpt: - nuke crap, end scripts always with ?> - - * sapi/cgi/cgi_main.c: - cs + ws - -2005-06-03 Magnus Määttä - - * ext/xml/tests/bug32001.phpt: - Add skipif, test requires iconv. - -2005-06-03 Jani Taskinen - - * ext/session/session.c: - nuke duplicate code - -2005-06-03 Dmitry Stogov - - * ZendEngine2/tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * ZendEngine2/tests/bug30394.phpt - ZendEngine2/tests/bug30394.phpt: - - file bug30394.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend.c - ZendEngine2/zend_execute_API.c: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * ZendEngine2/tests/bug30080.phpt - ZendEngine2/tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * ZendEngine2/tests/bug27598.phpt - ZendEngine2/tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_execute.c - ZendEngine2/tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * ZendEngine2/tests/object_handlers.phpt - ZendEngine2/tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-03 Georg Richter - - * NEWS - ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h: - added new function mysqli_get_charset - -2005-06-02 Jani Taskinen - - * acinclude.m4 - build/libtool.m4: - - Revert previous change in build/libtool.m4 and make sure - the PATH_SEPARATOR check is only done under autoconf 2.13. - - * (PHP_4_3) - NEWS - NEWS - configure.in - configure.in: - MFH: - Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs) - - * configure.in: - - Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs) - -2005-06-02 Antony Dovgal - - * (PHP_4_3) - NEWS - ext/curl/curl.c - ext/curl/php_curl.h: - MFH: fix bug #33222 (segfault when CURL handle is closed in a callback). - - * (PHP_5_0) - NEWS - ext/curl/interface.c - ext/curl/php_curl.h: - MFH: fix bug #33222 (segfault when CURL handle is closed in a callback). - fix segfaults when CURL callback functions throw exception. - - * ext/curl/interface.c - ext/curl/php_curl.h: - fix bug #33222 (segfault when CURL handle is closed in a callback). - fix segfaults when CURL callback functions throw exception. - -2005-06-02 Jani Taskinen - - * ext/sqlite/config.m4: - We only need LEMON for bundled stuff - -2005-06-02 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - ext/odbc/php_odbc.c - ext/odbc/php_odbc.c: - MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with - 2-statement SQL batches). - Path by rich at kastle dot com. - - * ext/odbc/php_odbc.c: - fix bug #33214 (odbc_next_result does not signal SQL errors with - 2-statement SQL batches). - Path by rich at kastle dot com. - -2005-06-02 Derick Rethans - - * ext/standard/string.c - ext/standard/string.c - ext/standard/string.c: - - That should have been removed, not commented out. - - * (PHP_4_3) - NEWS - NEWS - ext/standard/string.c - ext/standard/string.c: - - MFH: Fixed memory corruption in stristr(). - - * ext/standard/string.c: - - Fixed memory corruption in stristr(). - -2005-06-02 Jani Taskinen - - * ext/standard/var_unserializer.c: - touch - -2005-06-01 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - ext/standard/image.c: - MFH: Fixed bug #33210 (relax jpeg recursive loop protection). - - * (PHP_5_0) - NEWS - ext/standard/image.c: - MFH: Fixed bug #33210 (relax jpeg recursive loop protection). - - * ext/standard/image.c: - Fixed bug #33210 (relax jpeg recursive loop protection). - -2005-06-01 Antony Dovgal - - * ext/session/session.c: - fix typo - (see details here: http://news.php.net/php.internals/16350) - -2005-06-01 Dmitry Stogov - - * main/streams/streams.c - main/streams/streams.c: - Disabled search of recored separator outside of buffer - - * (PHP_5_0) - NEWS: - Fixed bug #32941 (Sending structured SOAP fault kills a php) - - * (PHP_5_0) - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug30791.phpt - ZendEngine2/tests/bug30791.phpt - ZendEngine2/tests/bug30791.phpt - ext/standard/var.c - ext/standard/var.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/var_unserializer.re: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * main/php_variables.c - main/php_variables.c: - Fixed "refcount" counting for autoglobals - -2005-06-01 Ilia Alshanetsky - - * ext/pcre/pcrelib/pcre.c: - kill unused var. - -2005-05-31 Dmitry Stogov - - * main/php_variables.c - main/php_variables.c: - Fixed possible memory corruption on request shutdown - `valgrind -q --tool=memcheck sapi/cli/php tests/reflection/001.phpt` - -2005-05-31 Magnus Määttä - - * ZendEngine2/tests/bug27304.phpt: - Fix test - -2005-05-31 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - ext/pcre/php_pcre.c - ext/pcre/php_pcre.c - ext/pcre/tests/bug33200.phpt - ext/pcre/tests/bug33200.phpt - ext/standard/php_string.h - ext/standard/php_string.h - ext/standard/string.c - ext/standard/string.c: - MFH: - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' - modifier misbehave) - - * ext/pcre/tests/bug33200.phpt - ext/pcre/tests/bug33200.phpt - ext/pcre/tests/bug33200.phpt - ext/standard/php_string.h - ext/standard/string.c: - 1.1.4; - - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' - modifier misbehave) - - * ext/pcre/php_pcre.c: - - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' - modifier misbehave) - -2005-05-31 Dmitry Stogov - - * ZendEngine2/zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Jani Taskinen - - * ext/standard/var_unserializer.c: - Touch - - * ext/standard/var_unserializer.re - ext/standard/tests/serialize/006.phpt: - - Fixed bug with unserialize() with "exotic" letters in class names - -2005-05-31 Marcus Boerger - - * ZendEngine2/zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-30 Ilia Alshanetsky - - * (PHP_5_0) - NEWS: - MFH: Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). - -2005-05-30 Hartmut Holzgraefe - - * ext/sqlite/config.m4: - typo fix - -2005-05-30 Jani Taskinen - - * (PHP_5_0) - NEWS - ext/sqlite/sess_sqlite.c - ext/sqlite/sess_sqlite.c - ext/sqlite/sqlite.c - ext/sqlite/sqlite.c - ext/wddx/wddx.c - ext/wddx/wddx.c: - - Fixed bug #33185 (--enable-session=shared does not build) - -2005-05-30 Hartmut Holzgraefe - - * ext/sqlite/Makefile.frag - ext/sqlite/config.m4: - gracefully handle changes of the parse.y lemon file, - process it with lemon if available, else just keep the .c file from CVS - not doing so leads to make using its implicit .y->.c rule here and - bison doesn't really understand lemon syntax - -2005-05-30 Jani Taskinen - - * acinclude.m4: - - Use libtool also for completely static builds - - * acinclude.m4 - build/libtool.m4 - scripts/phpize.in: - - Changed the PATH_SEPARATOR check to a macro - - Made sure we're generating aclocal.m4 in same way with both buildconf - and phpize. - - * scripts/Makefile.frag: - Removed the empty $bin_src_SCRIPTS (no longer needed), bug #33166 - -2005-05-29 Jani Taskinen - - * configure.in - TSRM/tsrm.m4 - ZendEngine2/Zend.m4 - ext/bcmath/config.m4 - ext/dba/config.m4 - ext/dbase/config.m4 - ext/dom/config.m4 - ext/fbsql/config.m4 - ext/fdf/config.m4 - ext/filepro/config.m4 - ext/gd/config.m4 - ext/gettext/config.m4 - ext/imap/config.m4 - ext/informix/config.m4 - ext/ldap/config.m4 - ext/mcrypt/config.m4 - ext/mcve/config.m4 - ext/mhash/config.m4 - ext/msql/config.m4 - ext/mssql/config.m4 - ext/mysql/config.m4 - ext/mysqli/config.m4 - ext/ncurses/config.m4 - ext/oci8/config.m4 - ext/odbc/config.m4 - ext/oracle/config.m4 - ext/ovrimos/config.m4 - ext/pfpro/config.m4 - ext/pgsql/config.m4 - ext/pspell/config.m4 - ext/readline/config.m4 - ext/recode/config.m4 - ext/session/config.m4 - ext/snmp/config.m4 - ext/sqlite/config.m4 - ext/standard/config.m4 - ext/sybase/config.m4 - ext/sybase_ct/config.m4 - ext/sysvsem/config.m4 - ext/sysvshm/config.m4 - ext/wddx/config.m4 - ext/xml/config.m4 - ext/xmlrpc/config.m4 - ext/xsl/config.m4 - ext/zlib/config0.m4 - sapi/apache/config.m4 - sapi/apache2filter/config.m4 - sapi/apache2handler/config.m4 - sapi/apache_hooks/config.m4 - sapi/caudium/config.m4 - sapi/cgi/config9.m4 - sapi/cli/config.m4 - sapi/isapi/config.m4 - sapi/roxen/config.m4: - - Unify the "configure --help" texts - - * ext/mbstring/config.m4: - Fix VPATH build - -2005-05-29 Hartmut Holzgraefe - - * acinclude.m4: - simplify flex version test - - * ZendEngine2/acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * ZendEngine2/acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * acinclude.m4 - configure.in - ZendEngine2/Zend.m4 - ZendEngine2/acinclude.m4: - avoid code duplication in bison version test - - * acinclude.m4: - added .cxx extension for C++ for completeness reasons - -2005-05-29 Ilia Alshanetsky - - * NEWS - ext/session/session.c: - Added an optional remove old session parameter to session_regenerate_id(). - -2005-05-29 Hartmut Holzgraefe - - * build/libtool.m4: - m4 comments start with 'dnl', *not* with '#' - -2005-05-28 Marcus Boerger - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-28 Sebastian Bergmann - - * ext/pcre/config.w32: - Sync with config.m4 (missing MATCH_LIMIT broke the Win32 build). - -2005-05-27 Andrei Zmievski - - * (PHP_5_0) - NEWS - ext/pcre/config.m4 - ext/pcre/config.m4 - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/README - ext/pcre/pcrelib/README - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/internal.h - ext/pcre/pcrelib/internal.h - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcredemo.c - ext/pcre/pcrelib/pcredemo.c - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucpinternal.h - ext/pcre/pcrelib/ucpinternal.h - ext/pcre/pcrelib/ucptable.c - ext/pcre/pcrelib/ucptable.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/pcre.txt - ext/pcre/pcrelib/doc/pcre.txt: - Upgrade PCRE library to 5.0. - - * ext/pcre/config.m4: - No need to include ucp.c and ucptypetable.c here. - - * ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcre.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/libpcreposix.def - ext/pcre/pcrelib/maketables.c - ext/pcre/pcrelib/pcre.c - ext/pcre/pcrelib/pcre.h - ext/pcre/pcrelib/pcredemo.c - ext/pcre/pcrelib/pcredemo.c - ext/pcre/pcrelib/pcredemo.c - ext/pcre/pcrelib/pcregrep.c - ext/pcre/pcrelib/pcreposix.c - ext/pcre/pcrelib/pcreposix.h - ext/pcre/pcrelib/pcretest.c - ext/pcre/pcrelib/study.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.c - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucp.h - ext/pcre/pcrelib/ucpinternal.h - ext/pcre/pcrelib/ucpinternal.h - ext/pcre/pcrelib/ucpinternal.h - ext/pcre/pcrelib/ucptable.c - ext/pcre/pcrelib/ucptable.c - ext/pcre/pcrelib/ucptable.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/ucptypetable.c - ext/pcre/pcrelib/doc/Tech.Notes - ext/pcre/pcrelib/doc/pcre.txt: - 1.1.4; - Upgrade library to version 5.0. - - * NEWS - ext/pcre/config.m4 - ext/pcre/pcrelib/AUTHORS - ext/pcre/pcrelib/COPYING - ext/pcre/pcrelib/ChangeLog - ext/pcre/pcrelib/LICENCE - ext/pcre/pcrelib/NEWS - ext/pcre/pcrelib/NON-UNIX-USE - ext/pcre/pcrelib/README - ext/pcre/pcrelib/dftables.c - ext/pcre/pcrelib/get.c - ext/pcre/pcrelib/internal.h: - Upgrade library to version 5.0. - -2005-05-27 Dmitry Stogov - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug22836.phpt - ZendEngine2/tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-27 Jani Taskinen - - * scripts/phpize.m4: - - Make sure EGREP and SED get set early enough. - - * Makefile.global - acinclude.m4: - - Use $SED and $EGREP where possible - - * config.guess - config.sub - ltmain.sh - build/libtool.m4: - - Update bundled libtool to 1.5.18 (latest atm) - - * (PHP_5_0) - NEWS: - Move BFN to correct version.. - -2005-05-27 Ilia Alshanetsky - - * (PHP_5_0) - ext/standard/pack.c: - Fixed bug #33080 (missing MFH of a fix for bug #31465) - -2005-05-26 Andrei Zmievski - - * ext/standard/reg.c: - Do a cache flush if we detect possible cache corruption (same as for - PCRE). - -2005-05-26 Dmitry Stogov - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * ZendEngine2/tests/bug33116.phpt - ZendEngine2/tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * ZendEngine2/zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * NEWS - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_reflection_api.c - ZendEngine2/tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger - - * (PHP_5_0) - ZendEngine2/tests/bug27304.phpt - ZendEngine2/tests/bug32981.phpt: - - Add new tests - - * ZendEngine2/tests/bug27304.phpt - ZendEngine2/tests/bug27304.phpt - ZendEngine2/tests/bug32981.phpt - ZendEngine2/tests/bug32981.phpt: - - - Add new tests - - * (PHP_5_0) - NEWS: - - BFN - - * ext/sqlite/sqlite.c: - - Make SQLiteDatabase derivable by dropping final tag from class and - making the ctor final to ensure it is being called, which is the - problem. - -2005-05-26 Ilia Alshanetsky - - * (PHP_4_3) - ext/standard/url.c - ext/standard/url.c: - MFH: Added scheme validation for parse_url(). - - * ext/standard/url.c: - Added scheme validation for parse_url(). - -2005-05-25 Dmitry Stogov - - * tests/basic/bug29971.phpt - tests/basic/bug29971.phpt: - - file bug29971.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - main/php_variables.c - main/php_variables.c - tests/basic/bug29971.phpt: - Fixed bug #29971 (variables_order behaviour) - -2005-05-25 Stanislav Malyshev - - * (PHP_5_0) - ext/standard/type.c: - fix is_object on non-php objects - - * ext/standard/type.c: - fix is_object() on non-php objects - -2005-05-25 Ilia Alshanetsky - - * (PHP_5_0) - ext/mime_magic/mime_magic.c: - MFH: Return error on an invalid input to mime_content_type() function. - - * ext/mime_magic/mime_magic.c: - Return error on an invalid input to mime_content_type() function. - -2005-05-24 Andrei Zmievski - - * ext/pcre/php_pcre.c: - Flush regexp cache if we detect corruption. - -2005-05-24 Jani Taskinen - - * ext/standard/basic_functions.c - main/internal_functions.c.in - main/internal_functions_nw.c - main/internal_functions_win32.c: - nuked unused header file - - * win32/php5dll.dsp - win32/php5dllts.dsp: - nuked file - - * main/internal_functions_registry.h: - - Remove unused file - -2005-05-24 Antony Dovgal - - * main/streams/plain_wrapper.c: - make it compile on Win32 (thanks to Sebastian for noticing) - -2005-05-24 Jani Taskinen - - * NEWS - ext/ingres_ii/.cvsignore - ext/ingres_ii/CREDITS - ext/ingres_ii/EXPERIMENTAL - ext/ingres_ii/README - ext/ingres_ii/config.m4 - ext/ingres_ii/config.w32 - ext/ingres_ii/ii.c - ext/ingres_ii/ii.h - ext/ingres_ii/ingres.dsp - ext/ingres_ii/php_ii.h: - - Moved ingres_ii to PECL - -2005-05-23 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - main/streams.c - main/streams/plain_wrapper.c: - MFH: Fixed bug #32810 (temporary files not using plain file wrapper). - - * main/streams/plain_wrapper.c: - Fixed bug #32810 (temporary files not using plain file wrapper). - -2005-05-23 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - main/streams.c - main/streams/streams.c - main/streams/streams.c: - revert by Wez's request - -2005-05-23 Grant Croker - - * ext/ingres_ii/config.m4 - ext/ingres_ii/php_ii.h: - - Allows the Ingres extenstion to be built on Linux/UNIX as well as - Windows. - - * ext/ingres_ii/config.m4: - - Fixed bug #30593 (--with-ingres option generates broken Makefile). - -2005-05-23 Antony Dovgal - - * (PHP_4_3) - NEWS - main/streams.c - main/streams/streams.c: - MFH: fix bug #32810 (fread after tmpfile() reads only 8192 bytes) - - * (PHP_5_0) - NEWS: - BFN - - * main/streams/streams.c: - fix bug #32810 (fread after tmpfile() reads only 8192 bytes) - - * tests/strings/bug26703.phpt: - fix test - -2005-05-23 Jani Taskinen - - * (PHP_4_3) - Makefile.global - Makefile.global - NEWS - NEWS: - MFH: - Fixed bug #33017 ("make distclean" gives an error with VPATH build). - - * Makefile.global: - - Fixed bug #33017 (make distclean give error outside of php-src) - - * (PHP_5_0) - NEWS: - Missed the bus now.. - - * ext/session/session.c: - CS fix - -2005-05-22 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - Zend/zend_highlight.c - ZendEngine2/zend_highlight.c - tests/strings/004.phpt: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * tests/strings/004.phpt: - Adjust highlight test. - - * ZendEngine2/zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Antony Dovgal - - * ext/session/session.c: - fix compile warning - -2005-05-22 Stanislav Malyshev - - * (PHP_4_3) - Zend/zend.c - ZendEngine2/zend.c - ZendEngine2/zend.c: - fix leak - -2005-05-21 Rasmus Lerdorf - - * (PHP_4_3) - NEWS - ext/session/session.c: - Fixed bug #33072 - Add a safemode/open_basedir check for runtime save_path - change - - * (PHP_5_0) - NEWS - ext/session/session.c: - MFH Fixed bug 33072 - safemode/open_basedir check for runtime save_path - change - - * acinclude.m4: - Avoid syntax errors on some operating systems - - * (PHP_5_0) - main/main.c: - Ah, never mind. Didn't notice a conflict on my last checkout. Jani's MFH - was fine. - - * (PHP_5_0) - main/main.c: - Roll back Jani's blind MFH here. zend_call_destructors() is PHP 5.1 only. - - * ext/session/session.c: - Fixed bug 33072 - safemode/open_basedir check for runtime save_path change - -2005-05-21 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_api.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/bug33090.phpt: - MFH: - - fix for bug #33090 (mysqli_prepare doesn't return an error) - - mysql_set_charset now works for MySQL >= 5.0.6 - - * ext/mysqli/tests/bug33090.phpt - ext/mysqli/tests/bug33090.phpt: - - enabled set_charset for MySQL Versions >= 5.0.6 - added testcase for bug #33090 - - * ext/mysqli/php_mysqli.h: - enabled set_charset for MySQL Versions >= 5.0.6 - added testcase for bug #33090 - - * ext/mysqli/mysqli_api.c: - fix for bug #33090 (mysql_prepare doesn't return error) - -2005-05-20 Grant Croker - - * (PHP_4_3) - ext/ingres_ii/config.m4 - ext/ingres_ii/config.m4: - - Fixed bug #30593 (--with-ingres option generates broken Makefile). - -2005-05-20 Rob Richards - - * (PHP_5_0) - ext/dom/element.c - ext/dom/node.c: - MFH: correct fix for bug #33059 - - fix issue in other methods - - * ext/dom/element.c - ext/dom/node.c: - - correct fix for bug #33059 - - fix issue in other methods - -2005-05-20 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/standard/string.c - ext/standard/tests/strings/bug33076.phpt: - MFH: - fix bug #33076 (str_ireplace() incorrectly counts result string length and - may cause segfault) - add test - - * ext/standard/tests/strings/bug33076.phpt - ext/standard/tests/strings/bug33076.phpt: - - fix bug #33076 (str_ireplace() incorrectly counts result string length and - may cause segfault) - add test - - * ext/standard/string.c: - fix bug #33076 (str_ireplace() incorrectly counts result string length and - may cause segfault) - add test - -2005-05-20 Jani Taskinen - - * build/shtool: - Update bundled shtool to 2.0.1 (see also bug #33023) - -2005-05-20 Derick Rethans - - * (PHP_4_3) - NEWS: - Update NEWS - - * (PHP_5_0) - NEWS: - - Update NEWS - - * (PHP_5_0) - ext/standard/parsedate.y: - - MFH: Fixed bug #33013: "next month" was handled wrong. - - * (PHP_4_3) - ext/standard/parsedate.y: - - Fixed bug #33013: "next month" was done wrong. - -2005-05-20 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - ext/session/session.c - ext/session/session.c: - MFH: fix bug #32944 (Disabling session.use_cookies doesn't prevent reading - session cookies) - - * ext/session/session.c: - fix bug #32944 (Disabling session.use_cookies doesn't prevent reading - session cookies) - -2005-05-20 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - reorder - -2005-05-19 Rasmus Lerdorf - - * (PHP_5_0) - NEWS: - . - - * (PHP_4_3) - NEWS: - NEWS file update for Jani - - * (PHP_4_3) - sapi/apache/mod_php4.c - sapi/apache/mod_php5.c: - Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as per - RFC 2616 section 10.3.5 - - * (PHP_5_0) - sapi/apache/mod_php5.c: - MFH Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as - per - RFC 2616 section 10.3.5 - -2005-05-19 George Schlossnagle - - * (PHP_5_0) - ext/mysql/config.m4: - support building on new-fangled 64bit linux distros that stick - libraries in /usr/lib64 - -2005-05-19 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/dom/element.c: - MFH: Fixed bug #33059 (crash when moving xml attribute set in dtd). - - * ext/dom/element.c: - Fixed bug #33059 (crash when moving xml attribute set in dtd). - -2005-05-19 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/zend_object_handlers.c: - Backported fix for bug #30451 - - * ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug32080.phpt - ZendEngine2/tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev - - * (PHP_4_3) - Zend/zend.c - ZendEngine2/zend.c - ZendEngine2/zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - ZendEngine2/tests/bug29890.phpt: - test - - * ZendEngine2/tests/bug29890.phpt - ZendEngine2/tests/bug29890.phpt: - - test - - * ZendEngine2/zend_execute_API.c - ZendEngine2/zend_execute_API.c: - fix #29890 - crash when function call fails - - * (PHP_4_3) - Zend/zend_execute_API.c: - fix #29890 - stack corruption when function call fails - - * ZendEngine2/zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * ZendEngine2/zend_object_handlers.c: - fix #30451 static properties don't work properly - - * ZendEngine2/tests/bug29689.phpt - ZendEngine2/tests/bug30451.phpt: - tests - - * ZendEngine2/tests/bug29689.phpt - ZendEngine2/tests/bug29689.phpt - ZendEngine2/tests/bug30451.phpt - ZendEngine2/tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Määttä - - * ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug32080.phpt: - Fix tests. - -2005-05-17 Johannes Schlüter - - * sapi/cli/php_cli.c - sapi/cli/php_cli_readline.c: - - Fix readline loop-condition - - Fix cli_is_valid_code detection - -2005-05-17 Antony Dovgal - - * (PHP_4_3) - ext/gd/config.m4 - ext/gd/config.m4: - MFH: gdImageGifCtx() is always available in bundled lib - - * ext/gd/config.m4: - gdImageGifCtx() is always available in bundled lib - -2005-05-16 Sara Golemon - - * TSRM/TSRM.c: - Unterminated paren group in BETHREADS definition of tsrm_tls_set() macro - -2005-05-16 Antony Dovgal - - * (PHP_4_3) - NEWS - ext/standard/basic_functions.c - main/main.c - main/php_streams.h - main/streams.c: - MFH: fix bug #32742 (segmentation fault when the stream with a wrapper is - not closed) - - * (PHP_5_0) - NEWS - ext/standard/basic_functions.c - main/main.c - main/php_streams.h - main/streams/streams.c: - MFH: fix bugs #32742 (segmentation fault when the stream with a wrapper - is not closed), #32171 (Userspace stream wrapper crashes PHP) - - * ext/standard/basic_functions.c - main/main.c - main/php_streams.h - main/streams/streams.c: - fix bugs #32742 (segmentation fault when the stream with a wrapper is not - closed), - -2005-05-14 Marcus Boerger - - * configure.in - sapi/cli/config.w32 - sapi/cli/php_cli.c - sapi/cli/php_cli_readline.c - sapi/cli/php_cli_readline.h: - - Add command completion to CLI's -a mode - -2005-05-13 Antony Dovgal - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_4_3) - NEWS - Zend/zend.c - ZendEngine2/zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * ZendEngine2/zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-13 Magnus Määttä - - * NEWS - ext/posix/config.m4 - ext/posix/php_posix.h - ext/posix/posix.c: - Added new function: posix_mknod(). - -2005-05-13 Georg Richter - - * ext/mysqli/mysqli_nonapi.c: - charsets_dir is no longer needed - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/065.phpt: - MFH: - fixed windows compilation bug - renamed mysqli_set_character_set_name to mysqli_set_charset - - * ext/mysqli/php_mysqli.h: - mysql_set_charset now works version undependent for MySQL 4.1.13 and above - - * ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/065.phpt: - - fixed compile error under windows. Functionality for changing the - character set was moved to libmysql (4.1 bk tree - will be merged into - 5.0 within the next days). - - renamed mysql_set_character_set to mysqli_set_charset - -2005-05-13 Andrey Hristov - - * NEWS: - fix NEWS - - * ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h - ext/standard/tests/math/math_std_dev.phpt: - move math_standard_deviation and math_variance to the stats PECL extension - -2005-05-12 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-12 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - ext/sockets/sockets.c - ext/sockets/sockets.c: - MFH: fix #33019 (socket errors cause memory leaks in php_strerror()) - patch by jwozniak23 at poczta dot onet dot pl - - * ext/sockets/sockets.c: - fix #33019 (socket errors cause memory leaks in php_strerror()) - patch by jwozniak23 at poczta dot onet dot pl - -2005-05-11 Joe Orton - - * (PHP_5_0) - ext/standard/html.c: - MFH: - Fixed bug #29119 (html_decode_entities handling of U+0152-U+0192 - range) - (merge error from 4.3) - MFH: Mark pointers in entity tables as const. - - * ext/standard/html.c: - Mark pointers in entity tables as const. - - * ext/standard/html.c: - - Fixed bug #29119 (html_decode_entities handling of U+0152-U+0192 range) - (merge error from 4.3) - -2005-05-11 Andrey Hristov - - * NEWS: - ... - - * ext/standard/array.c - ext/standard/basic_functions.c - ext/standard/php_array.h: - add function array_product() - -2005-05-11 Wez Furlong - - * main/streams/userspace.c: - fix inverted logic and thus Bug #27508 - - * ext/standard/tests/file/bug27508.phpt: - add test for bug 27508 - -2005-05-10 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/pgsql/pgsql.c - ext/pgsql/pgsql.c: - use & and check for the right value of result_type - - * (PHP_4_3) - NEWS - ext/pgsql/pgsql.c: - use & and check for the right value of result_type - btw, nobody noticed that result_type wasn't ever working in 4.3, because - it was absent in parse_params().. - also, I prefer "Tony" just for uniformity =) - -2005-05-10 Jani Taskinen - - * (PHP_4_3) - NEWS: - Tony or Antony? :) - - * (PHP_5_0) - NEWS: - missing blame tag :) - -2005-05-10 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - ext/pgsql/pgsql.c - ext/pgsql/pgsql.c: - MFH: fix #32904 (pg_get_notify() ignores result_type parameter) - - * ext/pgsql/pgsql.c: - fix #32904 (pg_get_notify() ignores result_type parameter) - -2005-05-10 Andrey Hristov - - * ext/standard/tests/math/math_std_dev.phpt: - fix the test too - - * NEWS: - fix NEWS - -2005-05-10 Jani Taskinen - - * (PHP_5_0) - NEWS - ext/odbc/php_odbc_includes.h - ext/odbc/php_odbc_includes.h: - MFB: - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems) - - * (PHP_4_3) - NEWS - ext/odbc/php_odbc_includes.h: - - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems) - -2005-05-10 Andrey Hristov - - * ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h: - rename math_std_dev to math_standard_deviation (the API wasn't published - yet) - -2005-05-10 Jani Taskinen - - * ext/snmp/snmp.c: - ws - - * ext/snmp/snmp.c: - MFB: - Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes - snmpapp.conf - access errors). (Jani, ric at arizona dot edu) - - * (PHP_5_0) - NEWS - ext/snmp/snmp.c: - - Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf - access errors). (Jani, ric at arizona dot edu) - - * (PHP_4_3) - ext/snmp/php_snmp.h - ext/snmp/snmp.c: - Revert the memleak fix due to net-snmp oddity (see also bug #32613) - -2005-05-09 Andrey Hristov - - * ext/mysqli/mysqli_api.c: - after throwing an warning bail out - - * ext/mysqli/mysqli.c: - mysqli won't compile with Zend2 API before 2001 - in these days there was - no Zend2 - - * ext/mysqli/mysqli_api.c: - MFB - - * (PHP_5_0) - ext/mysqli/mysqli_api.c: - warn the user if he wants to prepare before fetching all previous data - (in case mysqli_stmt_store_result() wasn't called or not enough calls - to mysqli_stmt_fetch()). - -2005-05-09 Jani Taskinen - - * ext/mysqli/tests/connect.inc: - - We skip tests when the extension is not loaded..in the php.ini - - * ext/mysqli/tests/skipif.inc: - revert pointless patch - -2005-05-09 Georg Richter - - * (PHP_4_3) - NEWS - ext/mysql/libmysql/config-win.h: - fix for bug #32116 (mysql compressed connection doesn't work under win) - -2005-05-09 Andrey Hristov - - * ext/mysqli/tests/connect.inc - ext/mysqli/tests/skipif.inc: - also test shared builds - -2005-05-09 Zeev Suraski - - * (PHP_5_0) - ext/sqlite/libsqlite/src/sqlite.w32.h: - Fix build - -2005-05-09 Jani Taskinen - - * (PHP_5_0) - ext/posix/config.m4 - ext/posix/config.m4 - ext/posix/php_posix.h - ext/posix/php_posix.h - ext/posix/posix.c - ext/posix/posix.c: - MFH: - getlogin() / getgroups() are not necessarily available everywhere - - * ext/posix/config.m4 - ext/posix/php_posix.h - ext/posix/posix.c: - - getlogin() / getgroups() are not necessarily available everywhere - - * (PHP_4_3) - ext/standard/basic_functions.c: - Remove dos crap - -2005-05-08 Jani Taskinen - - * (PHP_4_3) - ext/standard/basic_functions.c: - MFH: - Fixed putenv() under win32 (see bug #32957) - -2005-05-08 Rasmus Lerdorf - - * ext/standard/info.c: - Fix request_uri XSS on phpinfo() page - - * (PHP_4_3) - ext/standard/info.c: - Oops, wrong place. It was in the logo stuff instead. - - * (PHP_4_3) - ext/standard/info.c: - Let's not XSS ourself at least - -2005-05-08 Jani Taskinen - - * (PHP_4_3) - NEWS - ext/ldap/config.m4 - ext/ldap/ldap.c - ext/ldap/php_ldap.h: - MFH: - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer) - - * ext/ldap/config.m4: - this check was not needed - - * (PHP_5_0) - NEWS - ext/ldap/config.m4 - ext/ldap/ldap.c - ext/ldap/php_ldap.h: - MFH: - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer) - - * ext/ldap/config.m4 - ext/ldap/ldap.c - ext/ldap/php_ldap.h: - - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer) - - * ext/dba/config.m4: - no tabs - -2005-05-08 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/065.phpt: - added new function mysqli_set_character_set_name - This function changes also the mysql->charset structure for - mysql_real_escape_string (see MySQL Bugs #8317 and #9637). - This bug will probably be fixed in MySQL 5.1 - - * ext/mysqli/tests/065.phpt - ext/mysqli/tests/065.phpt: - - Added new function mysqli_set_character_set_name - - * ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h: - Added new function mysqli_set_character_set_name - -2005-05-07 Jani Taskinen - - * NEWS: - this one needs to be upper.. - - * ext/standard/math.c: - ws + cs + proto fixes - -2005-05-07 Ilia Alshanetsky - - * ext/standard/ftp_fopen_wrapper.c: - MFB: Fixed memory leak on error in FTP wrapper. - - * (PHP_5_0) - ext/standard/ftp_fopen_wrapper.c: - Fixed memory leak on error in FTP wrapper. - -2005-05-07 Jani Taskinen - - * sapi/cli/php.1.in: - typofix - -2005-05-07 Wez Furlong - - * ext/pcntl/pcntl.c - ext/pcntl/pcntl.c - ext/pcntl/php_pcntl.h - ext/pcntl/php_pcntl.h - ext/pcntl/test-pcntl.php - ext/pcntl/test-pcntl.php: - MFB: Fix for #32974 - - * (PHP_4_3) - NEWS - ext/pcntl/pcntl.c - ext/pcntl/php_pcntl.h - ext/pcntl/test-pcntl.php: - Fix #32974 - -2005-05-07 Marcus Boerger - - * sapi/cli/php.1.in: - - Update - -2005-05-07 Andrey Hristov - - * ext/mysqli/mysqli_api.c: - revert this one till we have a better way to inform the user where the - truncation has occured - - * ext/standard/math.c: - update protos - -2005-05-07 Marcus Boerger - - * NEWS: - - Update: class File was renamed to FileObject - - * NEWS - sapi/cli/php_cli.c: - - Improved interactive mode of CLI (php -a) - -2005-05-07 Rasmus Lerdorf - - * (PHP_4_3) - ext/standard/ftp_fopen_wrapper.c: - Fix what I assume was a typo - -2005-05-07 Andrey Hristov - - * ext/mysqli/mysqli_api.c: - return MYSQLI_DATA_TRUNCATED if data happens to be truncated - - * ext/mysqli/mysqli_api.c: - return directly - -2005-05-07 Georg Richter - - * (PHP_5_0) - ext/mysqli/tests/064.phpt: - fix for 5_0. Statement constructor doesn't exist in 5_0 - -2005-05-07 Andrey Hristov - - * (PHP_5_0) - ext/mysqli/mysqli_api.c: - bail out just after detecting incorrect number of paramts to bind (MFH) - - * ext/mysqli/mysqli_api.c: - bail out when detecting incorrect number of parameters to be bound. - -2005-05-07 Jani Taskinen - - * ext/gd/config.m4: - - Install GD header files - - * Makefile.global - acinclude.m4 - configure.in - ext/curl/config.m4 - ext/dom/config.m4 - ext/iconv/config.m4 - ext/interbase/php_ibase_udf.c - ext/mbstring/config.m4 - ext/odbc/config.m4 - ext/session/config.m4 - ext/sqlite/config.m4 - ext/xml/config.m4 - sapi/embed/config.m4 - scripts/Makefile.frag - scripts/phpize.m4: - - Added PHP_INSTALL_HEADERS() macro - - Fixed several VPATH build issues - - Changed all awk calls to use $AWK - - Changed all mkdir calls to use "$php_shtool mkdir" - -2005-05-06 Jani Taskinen - - * ext/sqlite/config.m4: - cleanup - -2005-05-06 Ilia Alshanetsky - - * (PHP_4_3) - ext/standard/ftp_fopen_wrapper.c - ext/standard/ftp_fopen_wrapper.c: - MFH: Check ftp user name for control characters. - - * ext/standard/ftp_fopen_wrapper.c: - Check ftp user name for control characters. - -2005-05-06 Antony Dovgal - - * (PHP_4_3) - ext/gd/gd.c - ext/gd/gd.c - main/php_open_temporary_file.c - main/php_open_temporary_file.c: - MFH: fix off-by-one in _php_image_output() - and prevent such errors in php_do_open_temporary_file() - - * ext/gd/gd.c - main/php_open_temporary_file.c: - fix off-by-one in _php_image_output() - and prevent such errors in php_do_open_temporary_file() - -2005-05-06 Andrey Hristov - - * ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_nonapi.c: - initialize values because the call to zend_parse_parameters may not do it - -2005-05-06 Ilia Alshanetsky - - * NEWS - ext/standard/http_fopen_wrapper.c: - Added max_redirects context option that specifies how many HTTP redirects - to follow. - - * ext/standard/http_fopen_wrapper.c: - Missing bit from previous patch. - - * (PHP_5_0) - ext/standard/http_fopen_wrapper.c: - Added missing bit of the previous patch. - - * (PHP_4_3) - NEWS - NEWS - ext/standard/http_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c: - MFH: Fixed bug #32936 (http redirects URLs are not checked for control - chars). - - * ext/standard/http_fopen_wrapper.c: - Fixed bug #32936 (http redirects URLs are not checked for control chars). - -2005-05-06 Jani Taskinen - - * tests/lang/inc.inc: - - - * ext/standard/math.c: - fix proto - -2005-05-05 Dmitry Stogov - - * ZendEngine2/tests/bug31525.phpt - ZendEngine2/tests/bug31525.phpt - tests/lang/bug20175.phpt - tests/lang/bug21600.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug31525.phpt - tests/lang/bug20175.phpt - tests/lang/bug21600.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - -2005-05-05 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli.c - ext/mysqli/mysqli_api.c - ext/mysqli/tests/064.phpt: - MFH: fix for bug #32956 - fixed memleak in mysql_close - fixed data truncation in test 009.phpt - - * ext/mysqli/tests/064.phpt - ext/mysqli/tests/064.phpt: - - fixed memleak in mysqli_close - fixed bug #32956 (mysqli_bind_result doesn't support MYSQL_TYPE_NULL) - - * ext/mysqli/mysqli.c - ext/mysqli/mysqli_api.c: - fixed memleak in mysqli_close - fixed bug #32956 (mysqli_bind_result doesn't support MYSQL_TYPE_NULL) - - * php.ini-dist - php.ini-recommended: - fix for bug #32947 (Incorrect option for mysqli default password) - -2005-05-04 Stanislav Malyshev - - * tests/lang/bug32924.phpt - tests/lang/inc.inc: - add test - - * NEWS: - - - * ZendEngine2/zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - clarify some magic - -2005-05-04 Anantha Kesari H Y - - * ext/standard/dl.c - ext/standard/dl.c: - NetWare LibC dlsym works perfectly only thing that each of the extension - need to export a symbol with FULL capital prefix. - -2005-05-04 Dmitry Stogov - - * NEWS - ZendEngine2/zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * ZendEngine2/tests/bug30707.phpt - ZendEngine2/tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - ws - - * ZendEngine2/tests/bug30162.phpt - ZendEngine2/tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Rob Richards - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/dom/php_dom.c: - MFH: Fix bug #32930 (class extending DOMDocument doesn't clone properly) - - * ext/dom/php_dom.c: - Fix bug #32930 (class extending DOMDocument doesn't clone properly) - -2005-05-03 Ilia Alshanetsky - - * ext/pgsql/pgsql.c: - Prevent double free. - -2005-05-03 Dmitry Stogov - - * ZendEngine2/tests/unset_cv07.phpt: - Fixed notice message - - * tests/classes/interface_must_be_implemented.phpt: - Fixed error message - -2005-05-03 Marcus Boerger - - * (PHP_5_0) - ZendEngine2/tests/bug32252.phpt: - - Add test - - * (PHP_5_0) - tests/classes/abstract_derived.phpt - tests/classes/abstract_not_declared.phpt - tests/classes/abstract_redeclare.phpt - tests/classes/interface_must_be_implemented.phpt - tests/classes/interfaces_002.phpt: - - Update tests affexted by fix - -2005-05-03 Dmitry Stogov - - * ZendEngine2/zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - -2005-05-03 Jani Taskinen - - * scripts/Makefile.frag: - - acconfig.h should not be installed. (it is only a template file..) - -2005-05-03 Marcus Boerger - - * tests/classes/abstract_derived.phpt - tests/classes/abstract_not_declared.phpt - tests/classes/abstract_redeclare.phpt - tests/classes/interfaces_002.phpt: - - Fix tests affected by fix - -2005-05-03 Dmitry Stogov - - * ZendEngine2/tests/bug32296.phpt - ZendEngine2/tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - -2005-05-03 Ilia Alshanetsky - - * (PHP_4_3) - NEWS: - Bug fixing news. - - * (PHP_4_3) - Zend/zend_execute.c: - MFZE2: Fixed bug #32670 (foreach() does not issue warning on unset array - arg) - -2005-05-02 Marcus Boerger - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * (PHP_5_0) - NEWS: - - BFN - - * ZendEngine2/zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * ZendEngine2/zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-05-02 Andrey Hristov - - * ext/standard/math.c: - fixed div by zero - - * ext/standard/math.c - ext/standard/tests/math/math_std_dev.phpt: - add possibility to calculate the standard deviation and the variance - on a sample - the formulae are slightly different. - - * NEWS - ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h - ext/standard/tests/math/math_std_dev.phpt: - add also math_variance() which uses the same calculation as math_std_dev() - - * ext/standard/math.c - ext/standard/tests/math/math_std_dev.phpt: - fix division by zero. throw an warning if the array is empty. - -2005-05-02 Pierre-Alain Joye - - * (PHP_4_3) - ext/gd/gd.c: - - MFH (#32893, imagettf crashes) - uses long for zval - -2005-05-02 Andrey Hristov - - * NEWS: - FRN - - * ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h - ext/standard/tests/math/math_std_dev.phpt: - add math_std_dev() - -2005-05-01 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/standard/html.c: - MFH: Fixed bug #32608 (html_entity_decode() converts single quotes even if - ENT_NOQUOTES is given). - - * ext/standard/html.c: - Fixed bug #32608 (html_entity_decode() converts single quotes even if - ENT_NOQUOTES is given). - -2005-05-01 Pierre-Alain Joye - - * ext/gd/libgd/gd.c: - - MFB: #32891, init old y positions to non possible values. -1 being used - if the center start a (x,0) - - * (PHP_5_0) - ext/gd/libgd/gd.c: - - MFB: #32891, init old y positions to non possible values. -1 being used - if the center start a (x,0) - - * (PHP_4_3) - ext/gd/libgd/gd.c: - - #32891, init old y positions to non possible values. -1 being used if the - center start a (x,0) - -2005-04-30 Jani Taskinen - - * (PHP_4_3) - acinclude.m4 - acinclude.m4: - MFH: - Fix problems with phpized ext/imap - - * acinclude.m4: - - Fix problems with phpized ext/imap - - * (PHP_4_3) - NEWS - NEWS - configure.in - configure.in - scripts/Makefile.frag - scripts/Makefile.frag: - MFH: - Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana) - - * configure.in - scripts/Makefile.frag: - - Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana) - - * sapi/cli/php.1.in: - Silence the warnings about weird characters in this man page - - * scripts/dev/phpextdist - scripts/dev/phpextdist - scripts/dev/phpextdist: - 1.1.4; - Moved phpextdist to dev/ - - * scripts/Makefile.frag - scripts/phpextdist: - Moved phpextdist to dev/ - - * acinclude.m4 - configure.in: - - No need to iterate through the options twice - - * acinclude.m4: - re2c 0.96 is the one that works (tm) - - * acinclude.m4: - We do allow 2.0 now too. - -2005-04-29 Ilia Alshanetsky - - * main/streams/streams.c: - Attempt to eliminate seek() prior to every write. - -2005-04-29 Jani Taskinen - - * ZendEngine2/zend_object_handlers.c: - compile fix - -2005-04-29 Andrey Hristov - - * ext/mysqli/mysqli.c: - multi_query is no more global - - * (PHP_5_0) - ext/mysqli/mysqli.c: - missed to remove that. multi_query is no more a global. - -2005-04-29 Jani Taskinen - - * ZendEngine2/tests/bug30332.phpt - ZendEngine2/tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov - - * ZendEngine2/tests/bug30332.phpt - ZendEngine2/tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug32080.phpt - ZendEngine2/tests/bug32080.phpt - ZendEngine2/tests/bug32852.phpt - ZendEngine2/tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/tests/bug31828.phpt - ZendEngine2/tests/bug32080.phpt - ZendEngine2/tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - -2005-04-29 Jani Taskinen - - * ext/sysvmsg/tests/002.phpt: - typofix - - * (PHP_5_0) - php.ini-dist - php.ini-recommended: - MFH: Add auto_globals_jit entry to php.ini-* (bug #29514) - - * php.ini-dist - php.ini-recommended: - Add auto_globals_jit entry to php.ini-* (bug #29514) - - * tests/classes/array_access_003.phpt - tests/lang/bug22231.phpt - tests/lang/bug22367.phpt - tests/lang/bug22510.phpt: - - Make sure E_STRICT is set when expecting Strict errors.. - - * ZendEngine2/tests/bug22836.phpt - ZendEngine2/tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - - * tests/lang/bug30578.phpt: - Added test for bug #30578 - - * NEWS: - BFN - -2005-04-28 Ilia Alshanetsky - - * ext/mysqli/mysqli_warning.c: - e* allocation cannot fail. - -2005-04-28 Dmitry Stogov - - * ZendEngine2/tests/bug29015.phpt - ZendEngine2/tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - -2005-04-28 Antony Dovgal - - * tests/lang/bug32828.phpt - tests/lang/bug32828.phpt: - - add test for bug #32828 - -2005-04-28 Jani Taskinen - - * sapi/cgi/cgi_main.c: - int != long - -2005-04-28 Antony Dovgal - - * (PHP_5_0) - main/output.c: - MFH: fix #32828 (Throwing exception in output_callback function with - ob_start and - ob_end_clean leads to segfault) - - * main/output.c: - fix #32828 (Throwing exception in output_callback function with ob_start - and - ob_end_clean leads to segfault) - - * (PHP_4_3) - ext/oci8/oci8.c - ext/oci8/oci8.c: - MFH: handle unsupported datatypes and prevent segfault - - * ext/oci8/oci8.c: - handle unsupported datatype (OCIBindByName segfaults somewhere in OCI lib - when - unknown type is provided) - -2005-04-28 Jani Taskinen - - * php.ini-dist - php.ini-recommended - sapi/cgi/cgi_main.c: - - Added fastcgi.logging php.ini option to be able to disable - logging through the fastcgi connection - -2005-04-28 Rob Richards - - * (PHP_4_3) - NEWS - NEWS: - BFN - - * (PHP_4_3) - ext/xml/php_xml.h - ext/xml/php_xml.h - ext/xml/xml.c - ext/xml/xml.c: - MFH: Fix bug #32245 (xml_parser_free() in function assigned to the xml - parser - gives a segfault) - - * ext/xml/php_xml.h - ext/xml/xml.c: - - Fix bug #32245 (xml_parser_free() in function assigned to the xml parser - gives a segfault) - -2005-04-28 Jani Taskinen - - * main/main.c: - - Reorder request shutdown calls: Call all __destruct() functions and - register_shutdown_function() callbacks before flushing output buffers - and sending headers. - - Fixes bug #30578 and possibly others related to output buffering. - - -2005-04-28 Wez Furlong - - * TSRM/TSRM.c: - consolidate the various tls get/set calls for the different platforms into - a single macro, at Andi's request. - -2005-04-27 Jani Taskinen - - * ext/snmp/snmp.c: - Better use zval_ptr_dtor() instead (thanks Andi) - - * (PHP_5_0) - NEWS: - reword - -2005-04-27 Wez Furlong - - * TSRM/TSRM.c - TSRM/TSRM.h: - Add three new TSRM api functions: - - TSRM_API void *tsrm_new_interpreter_context(void); - TSRM_API void *tsrm_set_interpreter_context(void *new_ctx); - TSRM_API void tsrm_free_interpreter_context(void *context); - - These can be used, with a suitable SAPI, to host multiple interpreters on - the same thread. - -2005-04-27 Andrey Hristov - - * (PHP_5_0) - NEWS: - update NEWS - - * main/main.c: - rename - - * (PHP_4_3) - main/main.c - main/main.c: - change names - - * (PHP_5_0) - NEWS - NEWS: - BFN - - * (PHP_5_0) - ext/mysqli/mysqli_api.c: - MFH (fix bug #31023) - - * ext/mysqli/mysqli_api.c: - fix bug #32013(MySQLi bind_result causes fatal error: memory limit reached) - -2005-04-27 Dmitry Stogov - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h - ZendEngine2/tests/bug29210.phpt - ext/standard/basic_functions.c: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * ZendEngine2/tests/bug29210.phpt - ZendEngine2/tests/bug29210.phpt - ext/standard/basic_functions.c: - - file bug29210.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * (PHP_5_0) - NEWS - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * ZendEngine2/tests/bug29104.phpt - ZendEngine2/tests/bug29104.phpt: - - Fixed bug #29104 (Function declaration in method doesn't work) - -2005-04-27 Anantha Kesari H Y - - * TSRM/threads.m4 - TSRM/threads.m4: - check should be on host_alias rather than on target_alias, but somehow - works on configure generated using autoconf 2.57. - -2005-04-27 Jani Taskinen - - * ext/dom/config.m4 - ext/simplexml/config.m4 - ext/xml/config.m4 - ext/xmlrpc/config.m4 - ext/xsl/config.m4: - - Made the libxml related stuff to error out if someone does --disable-all - or --disable-libxml. Better than silently just leave the ext out.. - -2005-04-27 Dmitry Stogov - - * NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - -2005-04-27 Andrey Hristov - - * ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/bug31668.phpt: - MFB (fixing bug 31668) - - * ext/mysqli/tests/bug31668.phpt - ext/mysqli/tests/bug31668.phpt: - - file bug31668.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - ext/mysqli/mysqli_nonapi.c - ext/mysqli/php_mysqli.h: - - Fix bug 31668 (multi query fails every other time). The multi_query flag - was global and not per connection. - - use ecalloc() instead of calloc() for memory that will be freed with - efree() - -2005-04-27 Jani Taskinen - - * ext/zlib/tests/compress_zlib_wrapper.phpt: - nuking that file was not very good idea :) - -2005-04-27 Dmitry Stogov - - * ZendEngine2/tests/bug32674.phpt - ZendEngine2/tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov - - * ZendEngine2/tests/bug30889.phpt - ZendEngine2/tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * ZendEngine2/tests/bug32429.phpt: - fix - - * ZendEngine2/tests/bug30702.phpt - ZendEngine2/tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.c - ZendEngine2/tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * NEWS - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * NEWS - ZendEngine2/zend_builtin_functions.c - ZendEngine2/tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-26 Jani Taskinen - - * acinclude.m4 - acinclude.m4: - Netware stuff - -2005-04-25 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/url.c - ext/standard/url.c - ext/standard/tests/strings/url_t.phpt - ext/standard/tests/strings/url_t.phpt: - MFH: Fixed bug #32813 (parse_url() does not handle scheme-only urls - properly). - - * ext/standard/url.c - ext/standard/tests/strings/url_t.phpt: - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). - -2005-04-25 Jani Taskinen - - * tests/classes/serialize_001.phpt: - Fix test - - * NEWS: - Reorder - - * (PHP_4_3) - NEWS - main/php_variables.c: - MFH: Revert. Nokia didn't pay me enough. :) - - * (PHP_5_0) - NEWS: - rbfn - - * main/php_variables.c: - Revert. (Nokia is not that important :) - -2005-04-25 John Coggeshall - - * NEWS: - Update - -2005-04-25 Andrei Zmievski - - * ZendEngine2/zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Jani Taskinen - - * ext/zlib/tests/compress_zlib_wrapper.phpt: - - Added test: For some reason this fails with ZTS mode and - "outside-src-tree-build" - - * (PHP_5_0) - NEWS: - reorder + shorten.. - - * NEWS: - When an entry goes to the PHP_5_0 branch, no entry here - -2005-04-25 Stanislav Malyshev - - * NEWS: - oops - - * NEWS - NEWS: - fix - - * ext/gmp/gmp.c - ext/gmp/gmp.c - ext/gmp/tests/bug32773.phpt - ext/gmp/tests/bug32773.phpt: - Fix #32773 and make right fix for GMP FPEs - - * (PHP_4_3) - ext/gmp/gmp.c: - rm unneeded - - * (PHP_4_3) - NEWS: - fix for #32773 - - * (PHP_4_3) - ext/gmp/gmp.c: - Fix #32773 and made right fix for GMP FPEs - -2005-04-25 Pierre-Alain Joye - - * ext/gd/tests/bug24155.phpt - ext/gd/tests/bug27582_1.phpt: - - do not use md5, png signature can change between libpng version - some floating points issue can end to different colors (+/- 1/255) - tests should work again now. - -2005-04-25 Stanislav Malyshev - - * ext/gmp/tests/bug32773.phpt - ext/gmp/tests/bug32773.phpt - ext/gmp/tests/bug32773.phpt: - 1.1.4; - file bug32773.phpt was initially added on branch PHP_4_3. - -2005-04-25 Dmitry Stogov - - * (PHP_4_3) - NEWS - tests/lang/bug29944.phpt: - Test case fnd news entriey for bug #29944 - -2005-04-25 Stanislav Malyshev - - * (PHP_4_3) - ext/gmp/gmp.c: - Remove broken fix - second operand of GMP operation certainly can be 0 in - general case - -2005-04-25 Dmitry Stogov - - * (PHP_5_0) - NEWS - Zend/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c - ZendEngine2/tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - - * ZendEngine2/tests/bug29944.phpt - ZendEngine2/tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Edin Kadribasic - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/gd/config.w32: - MFH: Added T1LIB support on Windows (#32809) - - * ext/gd/config.w32: - Added T1LIB support on Windows (#32809) - -2005-04-25 Jani Taskinen - - * ZendEngine2/zend_hash.c: - ws - -2005-04-25 Dmitry Stogov - - * (PHP_4_3) - Zend/zend_hash.c - ZendEngine2/zend_hash.c - ext/standard/array.c - ext/standard/array.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - ZendEngine2/zend_hash.c - ext/standard/array.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann - - * ZendEngine2/zend_reflection_api.c: - Correct grammar. - -2005-04-24 Ilia Alshanetsky - - * main/php_variables.c: - MFB: zval** not zval* - - * (PHP_5_0) - main/php_variables.c: - zval** not zval*. - - * (PHP_4_3) - NEWS - NEWS - main/php_variables.c - main/php_variables.c: - MFH: Fixed bug #32802 (General cookie overrides more specific cookie). - - * main/php_variables.c: - Fixed bug #32802 (General cookie overrides more specific cookie). - -2005-04-24 Marcus Boerger - - * ZendEngine2/zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - typo - - * ext/snmp/snmp.c: - - Fix memleak - - * (PHP_4_3) - NEWS - NEWS - main/php_variables.c - main/php_variables.c: - MFH: - Fixed bug #32111 (Cookies can also be separated by colon) - - * main/php_variables.c: - - Fixed bug #32111 (Cookies can also be separated by colon) - - * main/php_variables.c: - ws, pval -> zval - -2005-04-23 Marcus Boerger - - * ZendEngine2/tests/bug29674.phpt - ZendEngine2/tests/bug30161.phpt - ZendEngine2/tests/bug30346.phpt - tests/classes/__set__get_004.phpt: - - Add new tests - - * acinclude.m4: - - Change bison check to positive logic and allow bison 2.0 - -2005-04-22 Joe Orton - - * (PHP_4_3) - ext/xmlrpc/libxmlrpc/xml_element.c - ext/xmlrpc/libxmlrpc/xml_element.c: - MFH: Fixed bug #32797 (invalid C code in xmlrpc extension). - - * ext/xmlrpc/libxmlrpc/xml_element.c: - Fixed bug #32797 (invalid C code in xmlrpc extension). - -2005-04-22 Antony Dovgal - - * (PHP_4_3) - ext/mysql/.cvsignore: - add missing entries in .cvsignore - - * ext/com_dotnet/com_extension.c - ext/com_dotnet/com_extension.c - sapi/apache_hooks/mod_php5.c - sapi/caudium/caudium.c - sapi/caudium/caudium.c - sapi/caudium/caudium.c - sapi/cgi/libfcgi/fcgiapp.c: - fix C++ comments - -2005-04-22 Andrey Hristov - - * (PHP_4_3) - main/main.c: - MFH - introduce INT_MAX and INT_SIZE - -2005-04-21 Jani Taskinen - - * ext/odbc/config.m4: - - Fix birdstep support (no SQLDataSources() support in it) - -2005-04-21 Ilia Alshanetsky - - * ext/curl/interface.c - ext/dom/attr.c - ext/dom/document.c - ext/dom/domimplementation.c - ext/dom/node.c - ext/dom/php_dom.c - ext/dom/php_dom.h - ext/dom/xml_common.h - ext/dom/xpath.c: - php_error() -> php_error_docref(). - -2005-04-21 Jani Taskinen - - * configure.in: - - Allow using --enable-versioning with any SAPI module - - * configure.in - sapi/cgi/config9.m4 - sapi/cli/config.m4: - Expose EXEEXT and use for cli/cgi binaries - - * (PHP_4_3) - NEWS - ext/standard/basic_functions.c - ext/standard/basic_functions.c: - MFH: - Fixed bug #32647 (Using register_shutdown_function() with invalid - callback can crash PHP) - - * (PHP_5_0) - NEWS: - BFN - - * ext/standard/basic_functions.c: - - Fixed bug #32647 (Using register_shutdown_function() with invalid - callback can crash PHP) - - * (PHP_4_3) - ext/standard/tests/general_functions/bug32647.phpt: - Fix test - - * ZendEngine2/tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - - * ext/standard/tests/general_functions/bug32647.phpt - ext/standard/tests/general_functions/bug32647.phpt - ext/standard/tests/general_functions/bug32647.phpt: - 1.1.4; - Added test for bug #32647 - - * ext/standard/tests/general_functions/bug29038.phpt - ext/standard/tests/general_functions/bug31190.phpt: - bug => Bug - -2005-04-20 Ilia Alshanetsky - - * ext/fdf/fdf.c: - Fixed ZTS build of fdf extension. - -2005-04-20 Brian France - - * (PHP_4_3) - NEWS - NEWS - acinclude.m4 - acinclude.m4: - MFH: Added support for .cc files in extensions. - - * NEWS - acinclude.m4: - Added support for .cc files in extensions. - -2005-04-20 Georg Richter - - * ext/mysqli/mysqli_api.c: - another fix for last commit (committed from wrong tree) :( - - * ext/mysqli/mysqli.c - ext/mysqli/tests/009.phpt: - fixed typo in last commit :( - - * ext/mysqli/mysqli.c - ext/mysqli/mysqli_api.c: - added support for data truncation (bind_result) for MySQL 5.0.5 - -2005-04-20 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #32776 (SOAP doesn't support one-way operations) - -2005-04-19 Jani Taskinen - - * (PHP_5_0) - NEWS: - reorder - -2005-04-19 Marcus Boerger - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen - - * ext/openssl/openssl.c: - - Never use Z_TYPE* macros on non-zvals. - -2005-04-19 Andrey Hristov - - * (PHP_5_0) - NEWS: - FN - - * main/main.c: - add INT_MAX and INT_SIZE constants. - - * ext/mysqli/tests/033.phpt: - MFB - - * (PHP_5_0) - ext/mysqli/tests/033.phpt: - fix test to be able to run not only over Unix socket but also over TCP/IP - and not only connected to localhost. - - * (PHP_5_0) - NEWS: - BFN - - * ext/mysqli/tests/bug32405.phpt - ext/mysqli/tests/bug32405.phpt: - - add a test case for Bug #32405 (the previous commit incorporated a fix - for it). - - * ext/mysqli/mysqli_api.c: - - nail down another 64bit problem. this will fix about 14 failing tests - on amd64 (probably other 64 bit arch). - - use ulong for this boolean variable, as it was before - - throw an warning if offset passed to mysqli_stmt_data_seek is negative - - * ext/mysqli/mysqli_api.c - ext/mysqli/tests/014.phpt: - - fixing all "long" into "int" fetching problems (cause memory corruption - on 64 bit) - - nail down a problem because of the new MYSQL_TYPE_NEWDECIMAL introduced - in MySQL 5.0+ - - Add more info to the autocommit test - -2005-04-19 Jani Taskinen - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_exceptions.c - sapi/apache/sapi_apache.c - sapi/apache_hooks/mod_php5.c - sapi/apache_hooks/sapi_apache.c: - No c++ comments in C code - - * ext/sqlite/pdo_sqlite2.c: - - This is not C++ code - -2005-04-19 Wez Furlong - - * ext/com_dotnet/com_com.c - ext/com_dotnet/com_handlers.c - ext/com_dotnet/com_typeinfo.c - ext/com_dotnet/php_com_dotnet_internal.h: - merge from branch: fixes for #32758 and #32759 - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/com_dotnet/com_com.c - ext/com_dotnet/com_handlers.c - ext/com_dotnet/com_typeinfo.c - ext/com_dotnet/php_com_dotnet_internal.h: - - Fix #32758 Cannot access safearray properties - - Fix #32759 incorrect determination of default value - -2005-04-19 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/sqlite/sqlite.c: - MFH: Fixed bug #32753 (Undefined constant SQLITE_NOTADB). - - * ext/sqlite/sqlite.c: - Fixed bug #32753 (Undefined constant SQLITE_NOTADB). - -2005-04-18 Rob Richards - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/dom/node.c - ext/dom/tests/bug32615.phpt: - MFH: Fix bug #32755 Segfault in replaceChild() when DocumentFragment has no - children - update test - - * ext/dom/node.c - ext/dom/tests/bug32615.phpt: - Fix bug #32755 Segfault in replaceChild() when DocumentFragment has no - children - update test - -2005-04-18 Andrey Hristov - - * ext/ncurses/ncurses_functions.c: - don't null it - let the engine do its magic ;) - -2005-04-18 Wez Furlong - - * ext/com_dotnet/com_handlers.c: - merge bug fixes from branch - - * (PHP_5_0) - NEWS - ext/com_dotnet/com_handlers.c: - Fix bugs #29583 and #31636 - -2005-04-18 Anantha Kesari H Y - - * configure.in: - PHP_OS and PHP_UNAME need to be hardcoded for cross builds - -2005-04-18 Dmitry Stogov - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-18 Georg Richter - - * ext/mysqli/mysqli.c: - cursor support for 5.0.4 (STMT_ATTR_CURSOR_TYPE changed to enum) - -2005-04-18 Ilia Alshanetsky - - * ext/com_dotnet/com_dotnet.c - ext/com_dotnet/com_persist.c: - removed unused vars. - -2005-04-17 Marcus Boerger - - * tests/classes/property_exists.phpt: - - Add more tests - - * ZendEngine2/zend_builtin_functions.c: - - Fix special cases of property_exists() - - * ZendEngine2/zend_object_handlers.c: - - Fix logic - -2005-04-17 Jani Taskinen - - * (PHP_5_0) - NEWS - ext/ldap/config.w32 - ext/ldap/ldap.c: - MFH: - Fixed bug #30819 (Better support for LDAP SASL bind) - - * ext/ldap/ldap.c: - - Fixed bug #30819 (Better support for LDAP SASL bind) - - * NEWS: - - Removed unnecessary NEWS entry - - * main/php.h: - - Remove relic - - * (PHP_4_3) - NEWS - ext/crack/crack.c: - - Fixed bug #32730 (ext/crack.c fails to compile with cracklib-2.8.3) - -2005-04-17 Derick Rethans - - * NEWS - ext/gd/gd.c: - - Fixed bug #32735 (Compile error in GD extension). - -2005-04-17 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - sapi/isapi/php4isapi.c - sapi/isapi/php5isapi.c: - MFH: - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct - HTTP response message) - - * sapi/isapi/php5isapi.c: - - Fixed bug #31887 (Custom 5xx error does not return correct HTTP response - message) - -2005-04-16 Sara Golemon - - * ZendEngine2/tests/method_exists.phpt: - method_exists() regression test - - * ZendEngine2/zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-16 Jani Taskinen - - * NEWS - NEWS - NEWS: - retype - -2005-04-16 Pierre-Alain Joye - - * NEWS: - - Typo - - * NEWS: - - Entry for imageconvolution addition - -2005-04-16 Jani Taskinen - - * (PHP_4_3) - ext/dotnet/.cvsignore: - typofix - -2005-04-16 Pierre-Alain Joye - - * ext/gd/gd.c - ext/gd/php_gd.h: - - export imageconvolution to userland, making people happy to do not - use the predefined ones :) - -2005-04-16 Uwe Schindler - - * (PHP_4_3) - NEWS - NEWS - ext/standard/md5.c - ext/standard/md5.c - ext/standard/sha1.c - ext/standard/sha1.c: - MFH: use streams api for md5_file() and sha1_file() - -2005-04-16 Rasmus Lerdorf - - * ext/gd/libgd/gd.c: - I think this is a cleaner emboss filter. Less fringing. - - * (PHP_5_0) - ext/gd/libgd/gd.c: - MFH: The emboss and edge detection filter matrices were swapped - - * ext/gd/libgd/gd.c: - The emboss and edge detection matrices are swapped - - * ext/sqlite/config.m4: - Don't do PDO here if PDO is disabled - -2005-04-15 Jani Taskinen - - * ext/standard/type.c: - - Fixed bug #32719 (strval() fails to zero terminate strings) - - * ext/standard/tests/strings/strval.phpt: - Add some more cases - - * ext/standard/tests/strings/strval.phpt - ext/standard/tests/strings/strval.phpt - ext/standard/tests/strings/strval.phpt: - 1.1.4; - Added test for strval() function - - * ext/snmp/snmp.c: - - Use correct type (bug #32720) - -2005-04-15 Frank M. Kromann - - * (PHP_5_0) - ext/ming/ming.c: - Backporting prebuilt and videostring functions - -2005-04-15 Marcus Boerger - - * ZendEngine2/zend_builtin_functions.c - tests/classes/property_exists.phpt: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-15 Uwe Schindler - - * NEWS - ext/standard/md5.c - ext/standard/sha1.c: - Remove include_path support from md5_file/sha1_file again - - * ext/standard/md5.c - ext/standard/sha1.c: - use streams api for md5_file and sha1_file. Added parameter - use_include_path similar to other PHP file functions. Documentation update - outstanding - - * (PHP_4_3) - ext/standard/md5.c - ext/standard/md5.c - ext/standard/sha1.c: - correct copy/paste problem - - * (PHP_4_3) - ext/standard/md5.c - ext/standard/md5.c - ext/standard/sha1.c - ext/standard/sha1.c: - MFH: fix various solaris problems by replacing stdio with posix io where - possible - - * ext/standard/md5.c - ext/standard/sha1.c: - fix various solaris problems by replacing stdio with posix io where - possible - -2005-04-14 Jani Taskinen - - * ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c: - - Regenerated with re2c 0.9.6 (fixes severe bugs) - - * ext/odbc/config.m4 - ext/odbc/php_odbc.h: - - Add support for latest Birdstep - -2005-04-14 Andrey Hristov - - * ext/skeleton/skeleton.php: - - don't use short tag - - detect CLI binary and don't print < ;br < in this case - -2005-04-14 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - BFN - - * (PHP_4_3) - ext/calendar/calendar.c: - MFH: Fixes & cleanup + some minor new features - -2005-04-14 Ilia Alshanetsky - - * ext/standard/datetime.c - ext/standard/datetime.h - ext/standard/parsedate.y - ext/standard/php_parsedate.h: - MFB43: Fixed bug #31583 (php_std_date() uses short day names in - non-y2k_compliance mode). - Fixed bug #31689 (PHPAPI missing for php_std_date() and php_parse_date()). - - * (PHP_5_0) - NEWS - ext/standard/datetime.c: - MFB43: Fixed bug #31583 (php_std_date() uses short day names in - non-y2k_compliance mode). - - * (PHP_4_3) - NEWS - ext/standard/datetime.c: - Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance - mode). - - Patch by: mike at php dot net - -2005-04-13 Ilia Alshanetsky - - * ext/calendar/calendar.c: - Removed unused vars. - -2005-04-13 Antony Dovgal - - * (PHP_4_3) - ext/pgsql/pgsql.c - ext/pgsql/pgsql.c: - MFH: disable pg_cmdtuples() too, if there is no pg_affected_rows() - - * ext/pgsql/pgsql.c: - disable pg_cmdtuples() too, if there is no pg_affected_rows() - -2005-04-13 Derick Rethans - - * ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: - - MFH43: Fixed bug #32699 (pg_affected_rows() was defined when it was not - available). - - * (PHP_5_0) - NEWS - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: - - MF43: Fixed bug #32699 (pg_affected_rows() was defined when it was not - available). - - * (PHP_4_3) - NEWS - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: - - Fixed bug #32699 (pg_affected_rows() was defined when it was not - available). - -2005-04-13 Stanislav Malyshev - - * (PHP_4_3) - Zend/zend_ini.c: - MF5: fix memory corruption if one on the on_modify handlers errors out - -2005-04-13 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS: - - Commit the pending patch (bug #32311). - -2005-04-13 Antony Dovgal - - * ext/standard/tests/array/bug30833.phpt - ext/standard/tests/array/bug30833.phpt - ext/standard/tests/array/bug30833.phpt: - 1.1.4; - add testcase for bug #30833 - -2005-04-13 Moriyoshi Koizumi - - * (PHP_4_3) - NEWS: - - MFH: commit the pending patch (bug #32311). - -2005-04-12 Frank M. Kromann - - * (PHP_4_3) - ext/mssql/php_mssql.c - ext/mssql/php_mssql.c: - MFH: Fix for #32682. Error on module shutdown when called from activescript - - * ext/mssql/php_mssql.c: - Fix for #32682. Error on module shutdown when called from activescript - -2005-04-12 Ilia Alshanetsky - - * ext/readline/readline.c: - Fixed compiler warning. - -2005-04-12 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/standard/array.c: - MFH: fix #30833 (array_count_values modifying input array) - - * ext/standard/array.c: - fix #30833 (array_count_values modifying input array) - -2005-04-12 Stanislav Malyshev - - * ZendEngine2/zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - ZendEngine2/zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-11 Frank M. Kromann - - * ext/fbsql/php_fbsql.c: - Don't truncate the .options file when a database is started without the - optional options parameter. - -2005-04-11 Jani Taskinen - - * (PHP_5_0) - sapi/apache2filter/sapi_apache2.c: - fix typo (bug #32673) - -2005-04-11 Antony Dovgal - - * main/streams/streams.c: - revert the patch, the problem seems to be somewhere else - -2005-04-11 Harrie Hazewinkel - - * ext/snmp/snmp.c: - Converting the usage of the integer based internal commands into - MACROS to ease future extensions. - - * ext/snmp/snmp.c: - Adding support for a getbulk oriented walk. - The getbulk can only be used for SNMPv2c and SNMPv3. - -2005-04-11 Dmitry Stogov - - * ext/wddx/wddx.c - ext/wddx/wddx.c: - Fixed SIGSEGV on serializing data with circular references - - * (PHP_5_0) - NEWS: - Fixed bug #31502 (Wrong deserialization from session when using WDDX - serializer ) - - * ext/wddx/wddx.c - ext/wddx/wddx.c: - Support for encoding/decoding of private and protected members - -2005-04-10 Andrey Hristov - - * NEWS: - news - - * ext/dom/document.c - ext/gd/gd.c: - fix memory corruption on 64bit in imagefttext(), - domdocument::load() and domdocument::loadxml() - - * ext/ncurses/ncurses_functions.c: - fix proto. return true instead of null - - * ext/calendar/calendar.c: - simplify code (no need of local variable - return directly) - -2005-04-10 Jani Taskinen - - * sapi/apache2handler/config.m4: - - Say in the help too this is the handler module.. - - * sapi/apache2filter/config.m4: - Might not be obvious for everyone :) - - * ext/odbc/config.m4: - - This was supposed to be escaped with \ - - * ext/odbc/config.m4: - Add more detailed failure msg. (bug #32649) - - * ext/bz2/bz2.dsp - ext/gd/gd.dsp: - - Make VC6 happy - -2005-04-10 Ilia Alshanetsky - - * NEWS - ext/standard/basic_functions.c - ext/standard/basic_functions.h: - Added time_sleep_until() function, which is a high precision mechanism of - making a script sleep until specified timestamp. - -2005-04-09 Sara Golemon - - * main/streams/streams.c: - Fold validation into an inlined function per Andi's suggestion - -2005-04-08 Jani Taskinen - - * win32/php_modules.dsw: - - Nuked some PECLed extensions - - * win32/php5ts.dsw: - Removed non-existing sapi/activescript dsp - - * (PHP_4_3) - NEWS - NEWS - sapi/apache2filter/sapi_apache2.c - sapi/apache2filter/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MFH: - Fixed bug #32587 (Apache2: errors sent to error_log do not include - timestamps) - - * sapi/apache2filter/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - - Fixed bug #32587 (Apache2: errors sent to error_log do not include - timestamps) - - * (PHP_4_3) - ext/standard/url_scanner_ex.c: - regenerated with re2c 0.9.4 - - * (PHP_4_3) - ext/standard/url_scanner_ex.re: - typo - - * (PHP_4_3) - ext/standard/url_scanner_ex.re: - Missing $Id$ tag - - * (PHP_5_0) - ext/standard/url_scanner_ex.c: - regenerate with correct re2c version - -2005-04-08 Rob Richards - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/dom/node.c - ext/dom/tests/bug32615.phpt: - - MFH Fixed bug #32615 (Segfault in replaceChild() using fragment when - previousSibling is NULL) - - add test - - * ext/dom/tests/bug32615.phpt - ext/dom/tests/bug32615.phpt: - - - Fixed bug #32615 (Segfault in replaceChild() using fragment when - previousSibling is NULL) - - add test - - * ext/dom/node.c: - - Fixed bug #32615 (Segfault in replaceChild() using fragment when - previousSibling is NULL) - - add test - -2005-04-08 Ilia Alshanetsky - - * (PHP_4_3) - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: Missing part of the patch for bug #32589 - - * ext/imap/php_imap.c: - Missing part of the patch for bug #32589 - -2005-04-08 Marcus Boerger - - * ZendEngine2/zend_operators.c: - - Fix memory corruption found by rob - - * ZendEngine2/tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - -2005-04-08 Jani Taskinen - - * configure.in: - remove duplicate entry - -2005-04-08 Marcus Boerger - - * tests/classes/property_exists.phpt: - - Add new test - - * ZendEngine2/zend_builtin_functions.c: - - Add property_exits() - - * ZendEngine2/zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - -2005-04-08 Rob Richards - - * ext/dom/tests/dom003.phpt - ext/dom/tests/dom003.phpt: - fix test - -2005-04-08 Marcus Boerger - - * ZendEngine2/zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-08 Jani Taskinen - - * (PHP_4_3) - main/snprintf.c - main/snprintf.h - main/spprintf.c: - MFH and Fixes bug #32482 (ap_php_snprintf broken) - -2005-04-07 Jon Parise - - * build/buildcheck.sh: - Spell "overridden" correctly. - -2005-04-07 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/standard/proc_open.c: - MFH: Fixed bug #32533 (proc_get_status() returns the incorrect process - status). - - * ext/standard/proc_open.c: - Fixed bug #32533 (proc_get_status() returns the incorrect process status). - -2005-04-07 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - BFN - - * (PHP_5_0) - ext/mysql/php_mysql.c: - MFH: - Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX) - - * ext/mysql/php_mysql.c - ext/mysql/php_mysql.c: - - Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX) - - * scripts/phpize.in: - Fix the echo/backquote issues + aclocal - - * (PHP_5_0) - build/build2.mk - build/buildcheck.sh - scripts/phpize.in: - MFH: Use PHP_AUTOCONF / PHP_AUTOHEADER environment variables - - * acinclude.m4: - - Cleanup a bit. And make use of shtool mkdir - - * run-tests.php: - - Reword the send-report-part a bit. (bug #32624) - - * ZendEngine2/zend_alloc.c - ZendEngine2/zend_alloc.h: - - Nuke the code duplication - - * ZendEngine2/zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Dmitry Stogov - - * ext/calendar/calendar.c - ext/calendar/calendar.c: - Fixed indentation - - * ext/calendar/calendar.c - ext/calendar/calendar.c: - Fixed wrong result of cal_days_in_month() with bad dates - -2005-04-07 Derick Rethans - - * (PHP_4_3) - Zend/zend_alloc.h: - - Doh, this should not have been in of course :) - - * (PHP_4_3) - Zend/zend_alloc.c - Zend/zend_alloc.h: - - Fixed bug with estrndup when the Zend Allocator was not in use. - -2005-04-07 Zeev Suraski - - * (PHP_5_0) - ZendEngine2/zend_alloc.c - ZendEngine2/zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * ZendEngine2/zend_alloc.c - ZendEngine2/zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-07 Uwe Schindler - - * (PHP_4_3) - main/streams.c - main/streams/plain_wrapper.c - main/streams/plain_wrapper.c: - Bug #32614 - prevent from crahsing with segfault on solaris if fdopen() - fails - this fixes NOT the stdio-problem on solaris! - -2005-04-07 Jani Taskinen - - * scripts/phpize.in: - - Added the $PHP_AUTOCONF/$PHP_AUTOHEADER usage to phpize - -2005-04-06 Jani Taskinen - - * run-tests.php: - - Not every OS has ldd.. - - * ext/standard/url_scanner_ex.c: - Regenerated with re2c 0.9.4 - - * NEWS: - Keep removed stuff in top.. - -2005-04-06 Ilia Alshanetsky - - * (PHP_5_0) - NEWS: - bug fixing news. - - * (PHP_5_0) - main/php_streams.h: - MFH: Fixed bug #32553 (mmap loads only the 1st 2000000 bytes on Win32). - - * (PHP_5_0) - NEWS - ext/standard/basic_functions.c - ext/standard/basic_functions.h: - MFH: Removed php_check_syntax() function, it never worked properly. For now - use shell_exec("php -l script_name") or similar. - - * NEWS - ext/standard/basic_functions.c - ext/standard/basic_functions.h: - Removed php_check_syntax() function, it never worked properly. For now - use shell_exec("php -l script_name") or similar. - - * (PHP_5_0) - NEWS - ext/standard/file.c - main/streams/plain_wrapper.c: - MFH: Fixed bug #31363 (broken non-blocking flock()). - - * ext/standard/file.c - main/streams/plain_wrapper.c: - Fixed bug #31363 (broken non-blocking flock()). - - -2005-04-06 Christian Stocker - - * NEWS - ext/xsl/php_xsl.c - ext/xsl/php_xsl.h - ext/xsl/xsltprocessor.c: - - Added optional first parameter to XsltProcessor::registerPHPFunctions to - only - allow certain functions to be called from XSLT. - -2005-04-06 Antony Dovgal - - * main/streams/streams.c: - do not try to read after EOF - -2005-04-06 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli.c: - MFH: fix for #32282 (segfault in mysqli_fetch_array on 64-bit) - - * ext/mysqli/mysqli.c: - fix for bug #32282 (segfault in mysqli_fetch_array on 64-bit) - -2005-04-05 Antony Dovgal - - * ext/ldap/ldap.c: - remove proto, it's internal func - -2005-04-05 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: Fixed bug #32589 (Possible crash inside imap_mail_compose, with - charsets). - - * ext/imap/php_imap.c: - Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). - -2005-04-05 Marcus Boerger - - * ext/standard/tests/serialize/005.phpt: - - Add new test - - * ZendEngine2/zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-05 Ilia Alshanetsky - - * (PHP_5_0) - main/streams/streams.c: - MFH: Fixed bug #30362 (stream_get_line() not reading data correctly). - - * main/streams/streams.c: - Fixed bug #30362 (stream_get_line() not reading data correctly). - -2005-04-04 Sara Golemon - - * (PHP_4_3) - main/streams.c: - MFH rev 1.72 (of main/streams/streams.c) - - * main/streams/streams.c: - BugFix #32563 - - This could have been done in stream_wrapper_register() - without introducing the slight performance hit on - wrapper registration since anyone registering a wrapper - in an extension should know better. - - The important thing is that since locate_wrapper makes - the assumption that all schemes will be /^[a-z0-9+.-]+$/i - Anything which registers them should make the same assumption as well. - -2005-04-04 Jani Taskinen - - * (PHP_4_3) - ext/standard/credits_ext.h: - update - - * (PHP_5_0) - NEWS - ext/standard/credits_ext.h - ext/standard/credits_sapi.h: - - Update - - * ext/standard/credits_ext.h: - Update credits - - * ext/standard/tests/file/bug30362.txt - ext/standard/tests/file/bug30362.txt: - - remove empty lines - - * ext/standard/tests/file/bug30362.phpt - ext/standard/tests/file/bug30362.phpt - ext/standard/tests/file/bug30362.txt: - - Added testcase for bug #30362 - -2005-04-04 Stanislav Malyshev - - * ZendEngine2/zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - ZendEngine2/zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-04 Antony Dovgal - - * (PHP_4_3) - NEWS - ext/gmp/gmp.c: - fix #32567 (ext/gmp fails to compile with thread safety enabled) - -2005-04-04 Rui Hirokawa - - * main/SAPI.c - main/SAPI.h - main/main.c - main/php_variables.c - sapi/apache/mod_php5.c - sapi/apache_hooks/mod_php5.c: - added a server variable PHP_AUTH_DIGEST to support HTTP Digest - Authentication. - -2005-04-04 Uwe Schindler - - * NEWS - NEWS - NEWS - main/rfc1867.c - main/rfc1867.c - main/rfc1867.c: - Bug #32491 (File upload error - unable to create a temporary file) - - Changing file upload from stdio to posix - -2005-04-04 Antony Dovgal - - * (PHP_5_0) - NEWS - ext/odbc/config.m4: - MFH: configure looks for incorrect db2 library - - * ext/odbc/config.m4: - fix #32560 (configure looks for incorrect library - libdb2.so instead of - libdb2.a, - which is used actually) - -2005-04-04 Jani Taskinen - - * php.ini-recommended: - - If this is supposed to be the configuration we recommend, - we've been recommending to not use short-open-tag for a long time. - E_STRICT too for 5.1 since it promotes the right ways (tm) to do things. - -2005-04-04 Jon Parise - - * NEWS - build/build2.mk - build/buildcheck.sh: - Adding the ability to override the autotools executables used by the - buildconf script via the PHP_AUTOCONF and PHP_AUTOHEADER environmental - variables. - -2005-04-03 Jani Taskinen - - * NEWS: - MBFN2B - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-04-03 Uwe Schindler - - * sapi/nsapi/nsapi.c: - Add sapi.get_request_time() to NSAPI - -2005-04-03 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/string.c - ext/standard/string.c - ext/standard/tests/strings/chunk_split.phpt - ext/standard/tests/strings/chunk_split.phpt: - MFH: Fixed bug #32530 (chunk_split() does not append endstr if chunklen is - longer then the original string). - - * ext/standard/string.c - ext/standard/tests/strings/chunk_split.phpt: - Fixed bug #32530 (chunk_split() does not append endstr if chunklen is - longer then the original string). - -2005-04-03 Antony Dovgal - - * ext/pgsql/config.m4: - fix typo - - * (PHP_4_3) - ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.re - ext/standard/url_scanner_ex.re: - MFH: fix output_reset_rewrite_vars() returning false - - * ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.re: - fix output_reset_rewrite_vars() returning false everytime - - * (PHP_5_0) - main/php_variables.c: - MFH patch previously commited by Ilia - (memory leak when "S" is not listed in variable_order) - -2005-04-03 Jani Taskinen - - * (PHP_4_3) - ext/dbase/dbase.c - ext/dbase/dbf_rec.c: - - Sync with HEAD: - . php_error -> php_error_docref (fixes test) - . pval -> zval - . use modern parameter parsing - - * ext/gd/tests/bug19366.phpt: - Fix another title - - * ext/gd/tests/bug27582_1.phpt: - fix description - -2005-04-03 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS: - - Reorder. - -2005-04-03 Jani Taskinen - - * ext/xml/tests/bug32001.phpt: - Partial fix test: It is still possible to use expat libs with ext/xml.. - -2005-04-02 Greg Beaver - - * (PHP_4_3) - pear/go-pear.bat: - allow local install, remove -n switch - - * (PHP_5_0) - pear/go-pear.bat: - remove -n switch - - * pear/go-pear.bat: - update to support local install, remove -n switch - -2005-04-02 Jani Taskinen - - * pear/package-Archive_Tar.xml - pear/package-Console_Getopt.xml - pear/package-PEAR.xml: - Fix the name (and thus make sure PEAR will not install atm) - - * pear/package-Archive_Tar.xml: - Fixed: [PEAR] Archive_Tar: XML error: not well-formed (invalid token) at - line 22 - - * php.ini-dist - php.ini-recommended: - Make sure php_mbstring.dll is first to getting loaded..(bug #32552) - - * (PHP_4_3) - NEWS - ext/swf/swf.c: - - Fixed bug #32538 (ext/swf/swf.c does not compile with gcc-3.4.x or newer) - -2005-04-01 Greg Beaver - - * pear/PEAR/RunTest.php - pear/PEAR/RunTest.php: - add missing file - -2005-04-01 Jani Taskinen - - * run-tests.php: - - Fixed bug #32504 (shtool problem on make test) - -2005-04-01 Joe Orton - - * ext/mssql/config.m4: - Use PHP_LIBDIR. - -2005-03-31 Jani Taskinen - - * ext/session/tests/007.phpt - ext/session/tests/008-php4.2.3.phpt - ext/session/tests/009.phpt: - These tests require register_long_arrays=1 - - * pear/tests/pear_config.phpt - pear/tests/pear_config_1.1.phpt - pear/tests/pear_registry.phpt - pear/tests/pear_registry_1.1.phpt: - fix some skip conditions.. - -2005-03-31 Derick Rethans - - * (PHP_5_0) - ZendEngine2/zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-31 Jani Taskinen - - * (PHP_4_3) - NEWS - Zend/zend_config.w32.h - Zend/zend_operators.c - Zend/zend_operators.h - ext/standard/array.c: - MFH: Added SORT_LOCALE_STRING for array sorting - - * main/snprintf.h: - C++ fix - -2005-03-30 Derick Rethans - - * (PHP_5_0) - configure.in - main/php_version.h: - - Back to dev so that we have working snapshots again. - -2005-03-30 Ilia Alshanetsky - - * (PHP_4_3) - configure.in - main/php_version.h: - back to dev. - -2005-03-30 Zeev Suraski - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - Roll 5.0.4 - -2005-03-30 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - configure.in - main/php_version.h: - Tag 4.3.11 - -2005-03-30 Joe Orton - - * ext/mysqli/mysqli_driver.c - ext/mysqli/mysqli_prop.c: - Mark more private functions as static. - -2005-03-30 Edin Kadribasic - - * INSTALL - INSTALL - win32/install.txt - win32/install.txt: - Updated install instructions from the documentation project (Philip Olson) - - * (PHP_5_0) - INSTALL - win32/install.txt: - Update instruction from the documentation project (Philip Olson) - -2005-03-30 Joe Orton - - * ext/mysqli/mysqli_prop.c: - Mark private functions as static. - -2005-03-29 Ilia Alshanetsky - - * (PHP_5_0) - NEWS: - patch reverted. - - * (PHP_4_3) - NEWS: - patch was reverted. - -2005-03-29 Sara Golemon - - * ext/standard/streamsfuncs.c - main/streams/filter.c - main/streams/php_stream_filter_api.h: - BugFix #31137 stream_filter_remove() segfaults when stream already closed - -2005-03-28 Ilia Alshanetsky - - * main/php_variables.c: - Proper fix for the memory leak. - - * main/php_variables.c: - Fixed memory leak when variables_order does not contain 'S'. - -2005-03-28 Greg Beaver - - * pear/packages/HTML_Template_IT-1.1.tar - pear/packages/HTML_Template_IT-1.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/XML_RPC-1.1.0.tar - pear/packages/XML_RPC-1.2.2.tar - pear/packages/XML_RPC-1.2.2.tar: - - update to current bundle ideal - - * (PHP_4_3) - pear/packages/DB-1.6.2.tar - pear/packages/HTML_Template_IT-1.1.tar - pear/packages/HTTP-1.2.2.tar - pear/packages/Mail-1.1.3.tar - pear/packages/Net_SMTP-1.2.6.tar - pear/packages/Net_Socket-1.0.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/XML_Parser-1.0.1.tar - pear/packages/XML_RPC-1.1.0.tar - pear/packages/XML_RPC-1.1.0.tar - pear/packages/XML_RPC-1.2.2.tar: - update to current bundle ideal - - * pear/packages/HTML_Template_IT-1.1.tar - pear/packages/HTML_Template_IT-1.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/Net_UserAgent_Detect-2.0.1.tar - pear/packages/XML_RPC-1.2.2.tar - pear/packages/XML_RPC-1.2.2.tar: - - file HTML_Template_IT-1.1.tar was initially added on branch PHP_4_3. - - * pear/PEAR/RunTest.php - pear/PEAR/RunTest.php - pear/PEAR/Command/Auth.php - pear/PEAR/Command/Build.php - pear/PEAR/Command/Common.php - pear/PEAR/Command/Config.php - pear/PEAR/Command/Install.php - pear/PEAR/Command/Mirror.php - pear/PEAR/Command/Package.php - pear/PEAR/Command/Registry.php - pear/PEAR/Command/Remote.php: - - file RunTest.php was initially added on branch PHP_4_3. - - * pear/PEAR.php - pear/PEAR.php - pear/PEAR.php - pear/System.php - pear/package-PEAR.xml - pear/package-PEAR.xml - pear/package-PEAR.xml - pear/package.dtd - pear/package.dtd - pear/package.dtd - pear/template.spec - pear/template.spec - pear/template.spec - pear/Archive/Tar.php - pear/Console/Getopt.php - pear/OS/Guess.php - pear/OS/Guess.php - pear/OS/Guess.php - pear/PEAR/Autoloader.php - pear/PEAR/Builder.php - pear/PEAR/Builder.php - pear/PEAR/Builder.php - pear/PEAR/Command.php - pear/PEAR/Common.php - pear/PEAR/Common.php - pear/PEAR/Common.php - pear/PEAR/Config.php - pear/PEAR/Dependency.php - pear/PEAR/Dependency.php - pear/PEAR/Dependency.php - pear/PEAR/Downloader.php - pear/PEAR/Downloader.php - pear/PEAR/ErrorStack.php - pear/PEAR/ErrorStack.php - pear/PEAR/ErrorStack.php - pear/PEAR/Exception.php - pear/PEAR/Exception.php - pear/PEAR/Exception.php - pear/PEAR/Exception.php - pear/PEAR/Installer.php - pear/PEAR/Installer.php - pear/PEAR/Installer.php - pear/PEAR/Packager.php - pear/PEAR/Registry.php - pear/PEAR/Registry.php - pear/PEAR/Registry.php - pear/PEAR/Remote.php - pear/PEAR/Command/Install.php - pear/PEAR/Command/Package.php - pear/PEAR/Command/Package.php - pear/PEAR/Frontend/CLI.php - pear/scripts/pear.in - pear/scripts/pearcmd.php - pear/scripts/pearcmd.php - pear/scripts/pearcmd.php - pear/tests/pear_config.phpt - pear/tests/pear_config_1.1.phpt - pear/tests/pear_registry_1.1.phpt: - merge in PEAR 1.3.5 - -2005-03-28 Pierre-Alain Joye - - * ext/gd/libgd/gd.c: - - remove "debug" code - - * ext/gd/libgd/gd.c: - - MFB, imagerectangle draws 2x each corners (alpha channel uglyness) - -2005-03-28 Joey Smith - - * php.ini-dist - php.ini-recommended: - Adding comments to .ini files at philip@php.net's request. - -2005-03-28 Edin Kadribasic - - * ext/xmlrpc/libxmlrpc/xml_element.c - ext/xmlrpc/libxmlrpc/xmlrpc.c: - Reshufle includes to make it compile on windows - -2005-03-27 Pierre-Alain Joye - - * ext/gd/gd.c - ext/gd/libgd/gd.c - ext/gd/libgd/gd.h: - - allow to keep or ignore the transparent color in imagerotate (thx - Ken Coar to report this "bug") - - be sure to restore alphablending in imagefill - - use zend_parse_parameter in imagerotate - -2005-03-27 Ilia Alshanetsky - - * ext/standard/file.c: - revert copy patch. - -2005-03-26 Edin Kadribasic - - * pear/make-pear-bundle.php: - Script that creates PEAR bundle dir for distribution - -2005-03-26 Derick Rethans - - * (PHP_5_0) - configure.in - main/php_version.h: - - Back to -dev - -2005-03-26 Jani Taskinen - - * ext/xml/compat.c - ext/xml/expat_compat.h - ext/xmlrpc/config.m4 - ext/xmlrpc/libxmlrpc/xml_element.c - ext/xmlrpc/libxmlrpc/xmlrpc.c - main/php_compat.h: - - Made it possible to build ext/xmlrpc with libxml2 - - * configure.in - build/libtool.m4: - - Prevent compiling shared extensions when --enable-versioning is used - - Fix -export-symbols in Linux in the bundled libtool.m4: - o http://lists.gnu.org/archive/html/libtool/2002-07/msg00029.html - - * NEWS: - BFN - - * ZendEngine2/zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - - * ext/ingres_ii/config.m4 - ext/ingres_ii/config.w32 - ext/ingres_ii/ii.c - ext/ingres_ii/php_ii.h: - - Fix windows build (using config.w32 and keeping sync with config.m4) - - * main/php.h: - Fix path - -2005-03-25 Jani Taskinen - - * NEWS: - These entries do not belong in NEWS file (internal issues) - -2005-03-25 Andi Gutmans - - * LICENSE: - - Increment year in copyright notice - -2005-03-25 Christopher Kings-Lynne - - * NEWS - ext/pgsql/config.m4 - ext/pgsql/config.w32 - ext/pgsql/pgsql.c - ext/pgsql/tests/08escape.phpt - ext/pgsql/tests/25async_query_params.phpt: - (PHP pg_unescape_bytea) Use libpq version of PQunescapeBytea if it exists. - - -2005-03-25 Ilia Alshanetsky - - * ext/pgsql/pgsql.c: - Slightly safer code. - -2005-03-24 Marcus Boerger - - * ZendEngine2/zend_vm_execute.h: - - Second part of removing temp solution - - * ZendEngine2/zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-24 Jani Taskinen - - * scripts/Makefile.frag: - Remove: Has not existed for ages.. - -2005-03-24 Zeev Suraski - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - Roll RC2 - -2005-03-24 Andi Gutmans - - * main/main.c - main/main.c: - - Fix typos - -2005-03-24 Antony Dovgal - - * (PHP_5_0) - ext/session/session.c: - MFH: fix leak when register_long_arrays is off - - * ext/session/session.c: - fix leak when register_long_arrays is off - -2005-03-23 Moriyoshi Koizumi - - * (PHP_4_3) - NEWS: - - Temporary reversion as per release masters' requests. - - * (PHP_5_0) - NEWS: - - Temporary reversion. - - * (PHP_4_3) - NEWS: - - Reorder. - - * (PHP_5_0) - NEWS: - - BFN. - - * (PHP_4_3) - NEWS: - - MFH: fix bug #32311 (mb_encode_mimeheader() does not properly escape - characters). - - * (PHP_5_0) - ext/iconv/iconv.c - ext/iconv/tests/iconv004.phpt: - - MFH: Add sanity check in iconv_mime_encode(). Leaving the third parameter - unspecified would yield bus error. - - MFH: Add testcase for the bug. - - * ext/iconv/tests/iconv004.phpt - ext/iconv/tests/iconv004.phpt: - - - Add test case for iconv_mime_encode(). - - * ext/iconv/iconv.c: - - Add sanity check in iconv_mime_encode(). Leaving the third parameter - unspecified would yield bus error. - -2005-03-23 Ilia Alshanetsky - - * (PHP_4_3) - configure.in - main/php_version.h: - Back to dev. - -2005-03-23 Andrei Zmievski - - * ZendEngine2/zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-23 Ilia Alshanetsky - - * (PHP_4_3) - configure.in - main/php_version.h: - 4.3.11RC2 - -2005-03-23 Marcus Boerger - - * (PHP_5_0) - main/main.c: - - MFH Notices shouldn't be treatedas errors and thus not being conidered to - be converted to exceptions. - - * main/main.c: - - Notices shouldn't be treatedas errors and thus not being conidered to be - converted to exceptions. - -2005-03-23 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #31695 (Cannot redefine endpoint when using WSDL) - -2005-03-23 Christopher Kings-Lynne - - * ext/pgsql/tests/02connection.phpt - ext/pgsql/tests/03sync_query.phpt - ext/pgsql/tests/23sync_query_params.phpt - ext/pgsql/tests/24sync_query_prepared.phpt - ext/pgsql/tests/25async_query_params.phpt - ext/pgsql/tests/26async_query_prepared.phpt: - - Ensure that ext/pgsql tests work when linked against 7.2 or lower libpq - -2005-03-23 Jani Taskinen - - * tests/run-test/.cvsignore: - Missing line - - * NEWS: - clean - -2005-03-22 Moriyoshi Koizumi - - * ext/mbstring/config.m4 - ext/mbstring/config.w32 - ext/mbstring/mbstring.c - ext/mbstring/mbstring.dsp: - - Add Armenian encoding / NLS (patch by Hayk Chamyan) - -2005-03-22 Edin Kadribasic - - * (PHP_4_3) - ext/exif/exif.c - ext/exif/exif.dsp - ext/mbstring/mbstring.dsp: - Fix exif win32 build - -2005-03-22 Jani Taskinen - - * ext/standard/tests/array/locale_sort.phpt: - Added SKIPIF - - * ext/standard/tests/array/locale_sort.phpt - ext/standard/tests/array/locale_sort.phpt: - - Addded test for locale aware sort - -2005-03-22 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - sapi/cli/php_cli.c - sapi/cli/php_cli.c: - MFH: fix #28803 (enabled debug causes bailout errors with CLI on AIX - because of fflush() called on already closed filedescriptor) - - * sapi/cli/php_cli.c: - fix #28803 (enabled debug causes bailout errors with CLI on AIX - because of fflush() called on already closed filedescriptor) - -2005-03-22 Ilia Alshanetsky - - * ext/standard/microtime.c: - Fixed compiler warning. - -2005-03-22 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #30106 (SOAP cannot not parse 'ref' element. Causes Uncaught - SoapFault exception) - -2005-03-22 Derick Rethans - - * (PHP_5_0) - README.CVS-RULES - README.CVS-RULES: - - MFH: Changed to reflect "current practise" - - * README.CVS-RULES: - - Changed to reflect "current practise" - -2005-03-22 Christopher Kings-Lynne - - * NEWS - ext/pgsql/CREDITS - ext/pgsql/config.m4 - ext/pgsql/config.w32 - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h - ext/pgsql/tests/06copy.phpt - ext/pgsql/tests/07optional.phpt: - Tweak some #if's to be more orthogonal. - - (PHP pg_set_error_verbosity) New function to set PostgreSQL error - verbosity - - (PHP pg_copy_from) Use non-deprecated API if it is available - - (PHP pg_copy_to) Use non-deprecated API if it is available - -2005-03-22 Ilia Alshanetsky - - * ext/standard/array.c: - Simplify argument checking code for array_combine(). - -2005-03-21 Marcus Boerger - - * (PHP_5_0) - NEWS: - - Fixed bug #32394 offsetUnset() segfaults in a foreach - -2005-03-21 Andi Gutmans - - * (PHP_5_0) - ZendEngine2/zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Anantha Kesari H Y - - * (PHP_5_0) - ext/standard/html.c: - NetWare can make use of configure generated php_config.h - - * (PHP_5_0) - ext/standard/dl.c - ext/standard/file.c - ext/standard/ftp_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c - ext/standard/pack.c: - NetWare LibC headers have sys/param.h - -2005-03-21 Andrei Zmievski - - * main/php.h: - Define PHP_ABSTRACT_ME - - * ZendEngine2/zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger - - * ZendEngine2/tests/bug31102.phpt: - - Added missing description (thanks jani) - - * ZendEngine2/tests/bug31102.phpt: - - Add new test - -2005-03-20 Ilia Alshanetsky - - * (PHP_5_0) - run-tests.php: - MFH: Detect shtool properly when build-dir != php source dir. - - * run-tests.php: - Detect shtool properly when build-dir != php source dir. - -2005-03-20 Zeev Suraski - - * TSRM/TSRM.c: - Merge - - * (PHP_5_0) - TSRM/TSRM.c: - Fix the lock (the other patch would probably also work, but it's more error - prone and it's better to be on the safe side) - -2005-03-20 Jani Taskinen - - * ext/pgsql/pgsql.c: - - Fixed a warning (might also be an error with some exotic compiler) - -2005-03-20 Christopher Kings-Lynne - - * ext/pgsql/pgsql.c - ext/pgsql/tests/03sync_query.phpt: - Two of the diagnostic definitions were added in 8.0. Add appropriate - #ifdefs. - -2005-03-19 Marcus Boerger - - * ZendEngine2/zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * ZendEngine2/zend_object_handlers.c: - - Fix #31185 - -2005-03-19 Jani Taskinen - - * NEWS: - less wordy - - * (PHP_5_0) - NEWS: - reorder - -2005-03-19 Marcus Boerger - - * main/main.c: - - We don't need to block those here (works as it works with normal error - overloading) - - * ZendEngine2/zend_execute_API.c: - - Fix all incarnations of bug #30266 - - * ext/standard/array.c - ext/standard/tests/array/bug30266.phpt: - - Check another incarnation of bug #30266 - -2005-03-19 Antony Dovgal - - * ext/bz2/bz2.c: - fix #32373 (segfault in bzopen('/wrong/path')) - -2005-03-19 Marcus Boerger - - * ext/pgsql/tests/24sync_query_prepared.phpt - ext/pgsql/tests/26async_query_prepared.phpt: - - Add missing skipif part - - * NEWS: - - ext/pgsql was updated - -2005-03-19 Christopher Kings-Lynne - - * ext/pgsql/pgsql.c: - Another oversight - make sure constants related to pg_result_error_field - are #if'd as well as the function itself - - * ext/pgsql/tests/02connection.phpt - ext/pgsql/tests/03sync_query.phpt: - Add regression tests for pg_transaction_status and pg_result_error_field - - * ext/pgsql/pgsql.c: - Minor oversight in #if for an internal function - -2005-03-19 Rui Hirokawa - - * ext/mbstring/php_mbregex.c: - oniguruma updated to 3.7.1 and changed UChar to OnigUChar. - -2005-03-19 Andi Gutmans - - * ZendEngine2/zend_interfaces.c - ZendEngine2/zend_interfaces.h: - - Fix typos - -2005-03-18 Jani Taskinen - - * ext/ingres_ii/config.w32 - ext/ingres_ii/config.w32: - - Added config.w32 (modified version, original by: Grant.Croker at ca dot - com) - -2005-03-18 Marcus Boerger - - * run-tests.php: - - Readd revised version of Jani's fix: - 'errors with -d having a check for invalid ini entries' - - Add -v for verbose mode - -2005-03-18 Jani Taskinen - - * sapi/cli/php_cli.c: - Revert bad idea. (no more error for invalid -d options) - - * run-tests.php: - revert - - * run-tests.php: - Fix stupid typos - - * run-tests.php: - Fix errors with -d having a check for invalid ini entries - -2005-03-18 Greg Beaver - - * (PHP_5_0) - pear/go-pear-list.php: - update to newest packages - - * pear/go-pear-list.php - pear/go-pear-list.php: - update to Archive_Tar 1.3.1 - -2005-03-18 Moriyoshi Koizumi - - * (PHP_4_3) - ext/mbstring/mbstring.dsp: - - Add missing entries. - -2005-03-17 Harrie Hazewinkel - - * (PHP_5_0) - NEWS: - Added SNMPv2 support. - - * (PHP_5_0) - ext/snmp/php_snmp.h - ext/snmp/snmp.c: - Adding SNMPV2 functions for data retrieval. - -2005-03-17 Antony Dovgal - - * ext/mysqli/mysqli_api.c: - fix typo in error message - -2005-03-17 Ilia Alshanetsky - - * (PHP_4_3) - ext/exif/exif.c: - MFH: Fixed build of exif extension on win32. - - * ext/exif/exif.c: - MFB: Fixed build of exif extension on win32. - - * (PHP_5_0) - ext/exif/exif.c: - Fixed build of exif extension on win32. - - * ext/ftp/ftp.c: - Fixed compiler warning on win32. - -2005-03-17 Rasmus Lerdorf - - * main/streams/cast.c: - Silence a warning here on systems where off_t is a long long. - -2005-03-17 Jani Taskinen - - * sapi/cli/php_cli.c: - - Made CLI option -d output error and exit if an non-existing (or - unmodifyable) entry is passed - -2005-03-17 Rob Richards - - * (PHP_4_3) - NEWS: - BFN - - * (PHP_4_3) - ext/domxml/php_domxml.c: - Fixed bug #32340 (insert_before($node,NULL) does not return) - -2005-03-17 Zeev Suraski - - * (PHP_5_0) - NEWS - configure.in - main/php_version.h: - RC1 -> RC2-dev - -2005-03-17 Rob Richards - - * ext/standard/dl.h: - export php_dl to fix windows cli build - -2005-03-17 Jani Taskinen - - * scripts/phpize.m4: - Removed unused DEFS subst - - * configure.in: - Fixed build properly - - * TSRM/TSRM.h - TSRM/tsrm_config_common.h - ext/mbstring/mb_gpc.c - ext/mbstring/mbstring.c: - Revert bad fix - - * (PHP_5_0) - scripts/phpize.m4: - MFB: remove unused subst - - * (PHP_4_3) - scripts/phpize.m4: - remove unused subst - - * (PHP_4_3) - configure.in - configure.in: - fix build - -2005-03-17 Derick Rethans - - * sapi/cli/php_cli.c: - - ZTS fixes - -2005-03-17 Rasmus Lerdorf - - * ext/mbstring/mb_gpc.c - ext/mbstring/mbstring.c: - Build fixes - -2005-03-16 Rasmus Lerdorf - - * TSRM/TSRM.h - TSRM/tsrm_config_common.h - main/php.h: - Fix Jani breakage - -2005-03-16 Ilia Alshanetsky - - * (PHP_5_0) - NEWS: - MFH: Fixed bug #32326 (Check values of Connection/Transfer-Encoding - case-incentively) - -2005-03-16 Harrie Hazewinkel - - * ext/snmp/php_snmp.h - ext/snmp/php_snmp.h - ext/snmp/snmp.c - ext/snmp/snmp.c: - Adding SNMPv2 community based (i.e. protocol version) functions. - -2005-03-16 Jani Taskinen - - * (PHP_4_3) - configure.in - configure.in - scripts/php-config.in - scripts/php-config.in: - MFH: - Remove these relics from era when TSRM was optional. - - * configure.in - scripts/php-config.in: - - Remove these relics from era when TSRM was optional. - -2005-03-16 Wez Furlong - - * (PHP_5_0) - ZendEngine2/zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * ZendEngine2/zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong - - * ZendEngine2/zend.c - ZendEngine2/zend_API.c - ZendEngine2/zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-15 Andrei Zmievski - - * sapi/cli/php_cli.c: - Make it possible to load shared extensions from command line via - -dextension= mechanism. - -2005-03-15 Wez Furlong - - * ext/sqlite/pdo_sqlite2.c: - remove debuging code - - * ext/sqlite/sqlite.c: - I'm a PECL citizen; even though I am HEAD of pecl/sqlite, don't assume that - I - am being built against HEAD of php-src. - -2005-03-15 Ilia Alshanetsky - - * (PHP_4_3) - Zend/zend_operators.h: - Fixed duplicate zend_strtod.h inclusion. - - * (PHP_4_3) - ext/openssl/openssl.c - ext/openssl/openssl.c: - MFH: Fixed possible usage of str without being initialized. - - * ext/openssl/openssl.c: - Fixed possible usage of str without being initialized. - -2005-03-15 Greg Beaver - - * (PHP_4_3) - pear/go-pear-list.php: - add go-pear-list (probably won't do anything, but it's worth a try) - -2005-03-14 Greg Beaver - - * pear/go-pear-list.php - pear/go-pear-list.php: - - this needs updating - -2005-03-14 Jani Taskinen - - * configure.in: - - Fixed bug #32200 (prevent using both --with-apxs2 and --with-apxs2filter) - - * (PHP_4_3) - NEWS - ext/openssl/openssl.c - ext/openssl/openssl.c: - MFH: - Fixed bug #18613 (Multiple OUs in x509 certificate not handled - properly) - - * (PHP_5_0) - NEWS: - BFN - - * ext/openssl/openssl.c: - - Fixed bug #18613 (Multiple OUs in x509 certificate not handled properly) - -2005-03-14 Rasmus Lerdorf - - * main/SAPI.c - main/SAPI.h - sapi/aolserver/aolserver.c - sapi/apache/mod_php5.c - sapi/apache2filter/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c - sapi/apache_hooks/mod_php5.c - sapi/cgi/cgi_main.c - sapi/thttpd/thttpd.c - sapi/tux/php_tux.c: - Fix for bug #32263 - This adds proto_num to request_info. It is defaulted to HTTP 1.0 (1000) - such that it has a valid value even if the underlying sapi doesn't set it - correctly. It is then used to determine if a 302 or a 303 should be sent - on a Location redirect. Any non GET/HEAD HTTP 1.1 redirect will get a 303 - instead of a 302 to be compatible with the HTTP spec. - -2005-03-14 Zeev Suraski - - * ZendEngine2/zend_ini.c: - Clarify logic - - * win32/registry.c: - Merge registry fix - - * (PHP_4_3) - win32/registry.c: - Fix an age old bug in parsing paths when reading - INI values from the registry - -2005-03-14 Anantha Kesari H Y - - * (PHP_5_0) - ext/session/session.c: - NetWare specific stat structure changes - - * (PHP_5_0) - main/php.h: - PHP_OS and PHP_UNAME for NetWare are getting populated from the - ph_config.h(configure.in) - - * (PHP_5_0) - configure.in: - For cross compiler uname's output while running on build machine can not be - stored in PHP_OS and PHP_UNAME - -2005-03-14 Stanislav Malyshev - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - ws - -2005-03-14 Jani Taskinen - - * (PHP_4_3) - NEWS - ext/curl/curl.c: - MFH: - Fixed bug #30609 (cURL functions bypass open_basedir) - - * (PHP_5_0) - NEWS - ext/curl/interface.c - ext/curl/interface.c: - - Fixed bug #30609 (cURL functions bypass open_basedir) - -2005-03-14 Zeev Suraski - - * (PHP_5_0) - NEWS: - RC1 - -2005-03-14 Jani Taskinen - - * NEWS: - -sigh* - -2005-03-14 Moriyoshi Koizumi - - * ext/xml/tests/bug32001.phpt - ext/xml/tests/bug32001.phpt: - - Turn off incorrect case folding to let test over. - -2005-03-13 Ilia Alshanetsky - - * (PHP_4_3) - configure.in - main/php_version.h: - Back to dev. - - * (PHP_4_3) - NEWS - configure.in - main/php_version.h: - 4.3.11RC1 - -2005-03-13 Zeev Suraski - - * (PHP_5_0) - configure.in - main/php_version.h: - Prepare to roll 5.0.4RC1 - -2005-03-13 Stanislav Malyshev - - * ZendEngine2/zend_stream.c - ZendEngine2/zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Ilia Alshanetsky - - * ext/standard/streamsfuncs.c: - Fixed compiler warning. - -2005-03-13 Marcus Boerger - - * ZendEngine2/zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Andrey Hristov - - * NEWS: - credits to Ilia - -2005-03-13 Marcus Boerger - - * (PHP_5_0) - NEWS: - - BFN - - * ZendEngine2/zend_execute_API.c: - - Actually this is a much better error decription - - * ZendEngine2/zend_execute_API.c - ZendEngine2/tests/bug32290.phpt - ZendEngine2/tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-12 Ilia Alshanetsky - - * ext/standard/string.c - ext/standard/tests/strings/str_word_count.phpt: - A more performance friendly version of Andrey's patch. - -2005-03-12 Andrey Hristov - - * NEWS: - FRN - - * ext/standard/string.c - ext/standard/tests/strings/str_word_count.phpt: - added an optional third parameter to str_word_count(), which is used as - a list of characters which are considerd "is_alpha()". Thus V14GR4 can - be extracted as one word if the user supplies "14" as charlist. - FR #31560 - -2005-03-12 Wez Furlong - - * sapi/cli/php_cli.c: - it's 2005 already - -2005-03-12 Andrey Hristov - - * ext/standard/string.c: - - type is either 1 or 2 if second parameter is set. if not set then type - is 0. - - use the lvalue for the second rvalue - - * ext/standard/tests/strings/str_word_count.phpt: - add a test file - - * ext/pcre/tests/pcre_count.phpt: - add test - - * NEWS - ext/pcre/php_pcre.c - ext/pcre/php_pcre.h - main/SAPI.c - win32/sendmail.c: - FR 32275 - fifth parameter to preg_replace() to count number of replaces - made. - - * (PHP_5_0) - NEWS: - BFN - - * ext/standard/array.c - ext/standard/array.c: - Fixed #30871 - -2005-03-12 Marcus Boerger - - * ext/wddx/tests/wddx.xml: - - Fix test - - * ext/wddx/wddx.c: - - Fix another memleak - - * ext/wddx/wddx.c: - - Fix memleak - -2005-03-12 Wez Furlong - - * ext/sqlite/config.w32: - build sqlite2 pdo driver on win32 - -2005-03-12 Marcus Boerger - - * ext/sqlite/pdo_sqlite2.c: - - Errcode might be empty - -2005-03-12 Wez Furlong - - * ext/sqlite/pdo_sqlite2.c: - Fix crappy whitespace - -2005-03-11 Wez Furlong - - * ext/sqlite/config.m4 - ext/sqlite/config.w32 - ext/sqlite/pdo_sqlite2.c - ext/sqlite/sqlite.c: - Implement a PDO driver for sqlite 2 - -2005-03-11 Anantha Kesari H Y - - * (PHP_5_0) - main/streams/userspace.c: - removing redundant CLIB_STAT_PATCH - - * (PHP_5_0) - ext/standard/filestat.c: - removing redundant NEW_LIBC checks - In NetWare statfs f_bavail member is known as f_bfree - NetWare LibC has pwd.h - - * (PHP_5_0) - ext/standard/file.c: - NetWare LibC has pwd.h and removing redundant CLIB_STAT_PATCH - - * (PHP_5_0) - TSRM/TSRM.c: - NetWare has a proper pthreads support - - * (PHP_5_0) - TSRM/TSRM.h: - NetWare can make use autoconf generated tsrm_config.h - - * (PHP_5_0) - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h: - NetWare LibC has lstat - - * (PHP_5_0) - TSRM/tsrm_config_common.h: - Netware can make use of autoconf generated tsrm_config.h - - * (PHP_5_0) - sapi/cli/php_getopt.h: - As NetWare LibC has optind and optarg macros defined in unistd.h our local - variables were getting mistakenly preprocessed so undeffing optind and - optarg - - * (PHP_5_0) - configure.in: - NetWare don't have sendmail binary so need this sendmail.c smarthost - implementation - - * (PHP_5_0) - netware/sendmail_nw.h: - changing the windows style directory seperator in netinet\in.h to - netinet/in.h - - * (PHP_5_0) - win32/sendmail.c: - time.h is available in NetWare LibC. - path sperator has been changed from \ to / while including - netware\sendmail_nw.h - - * (PHP_5_0) - ext/standard/datetime.c: - removed redundant NEW_LIBC checks for NetWare - - * (PHP_5_0) - ext/standard/proc_open.c: - In NetWare LibC WTERMSIG is avaliable as WIFTERMSIG - - * (PHP_5_0) - ext/standard/link.c - main/fopen_wrappers.c: - NetWare LibC has pwd.h - - * (PHP_5_0) - main/php_open_temporary_file.c: - Netware LibC has mkstemp - - * (PHP_5_0) - main/network.c: - removed NetWare specific NEW_LIBC checks - - * (PHP_5_0) - main/php_scandir.c: - NetWare LibC does not have search.h - - * (PHP_5_0) - ZendEngine2/acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger - - * ZendEngine2/tests/bug32252.phpt: - - Add new test - - * ZendEngine2/tests/bug27145.phpt - ZendEngine2/tests/bug27145.phpt: - - Irrelevant - - * (PHP_5_0) - NEWS - ext/xml/xml.c: - - Bugfix #30266 - - * ext/xml/xml.c: - - Fix #30266 - - * ZendEngine2/zend_object_handlers.c: - - Don't touch refcount/is_ref - - * ext/standard/tests/serialize/bug31402.phpt: - - Times have changed - php 5 relevant version now - - * ext/standard/array.c - ext/standard/streamsfuncs.c - ext/standard/type.c: - - Do not touch return_valu's refcount or is_ref - - * ext/standard/tests/serialize/bug31402.phpt: - - Allow to work under php 5 - -2005-03-10 Marcus Boerger - - * ext/standard/string.c: - - Cosmetics - - * ext/standard/string.c: - - Do not touch return_valu's refcount or is_ref - -2005-03-10 Ilia Alshanetsky - - * ext/ftp/ftp.c - ext/ftp/php_ftp.c: - Final set of fixes for bug #27633. - - -2005-03-10 Rob Richards - - * acinclude.m4: - require libxml 2.6.0 or higher - -2005-03-10 Zeev Suraski - - * ext/standard/basic_functions.c: - Oops, revert. - - * ext/standard/basic_functions.c: - Fix prototype - -2005-03-10 Marcus Boerger - - * run-tests2.php - server-tests.php - server-tests.php - server-tests.php: - - Rename test script - - * run-tests2.php: - - Make this work under 5 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - main/php_compat.h: - NetWare can use of ./configure generated php_config.h - - * (PHP_5_0) - ext/standard/ftp_fopen_wrapper.c: - NetWare Specific stat member changes - -2005-03-10 Marcus Boerger - - * ZendEngine2/tests/bug28442.phpt - ZendEngine2/tests/bug28442.phpt: - - - Bugfix #28442 - - * ZendEngine2/zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - ext/standard/pageinfo.c: - NetWare LibC has pwd.h and removing the redundant NEW_LIBC checks - - * (PHP_5_0) - ext/standard/pack.c - ext/standard/rand.c: - NetWare LibC has pwd.h - - * (PHP_5_0) - ext/standard/basic_functions.c: - NetWare LibC has netdb.h - - * (PHP_5_0) - ext/session/mod_files.c: - NetWare stat structure difference has been handled - -2005-03-10 Joe Orton - - * (PHP_4_3) - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MFH: - Fixed bug #31717: Reject PATH_INFO if "AcceptPathInfo off" is used. - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - ZendEngine2/acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - main/php.h: - NetWare LibC has param.h and pwd.h - - * (PHP_5_0) - ZendEngine2/zend.h: - NetWare can make use of ./configure generated zend_config.h - -2005-03-10 Joe Orton - - * ext/standard/html.c: - Fix /*-within-comment warning from GCC. - - * sapi/apache2handler/sapi_apache2.c: - - Fixed bug #31717: Reject PATH_INFO if "AcceptPathInfo off" is used. - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - TSRM/threads.m4: - This fix is needed for cross compilation to go through - - * (PHP_5_0) - ZendEngine2/Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger - - * ZendEngine2/zend_vm_execute.h: - - #31562 2nd part - - * ZendEngine2/zend_vm_def.h: - - Fix #31562 - - * (PHP_4_3) - NEWS - NEWS - NEWS - NEWS: - - BFN - - * ext/standard/var_unserializer.c: - - Wrong order of action - touch - - * ext/standard/var_unserializer.re: - - Fix #31442 unserialize broken on 64-bit systems - - Fix one warning - -2005-03-09 Marcus Boerger - - * ext/standard/var_unserializer.c: - - Fix #31442 unserialize broken on 64-bit systems - - Fix one warning - -2005-03-09 Ilia Alshanetsky - - * ext/ftp/ftp.c: - Fixes to ascii downloads on win32. - -2005-03-09 Rui Hirokawa - - * (PHP_4_3) - Zend/zend_language_scanner.l: - fixed #31987: possible zend-multibyte crash in ZTS. - -2005-03-09 Derick Rethans - - * (PHP_5_0) - NEWS - ext/standard/html.c - ext/standard/html.c: - - MF43: Fixed bug #28067 (partially incorrect utf8 to htmlentities - mapping). - - * (PHP_4_3) - NEWS - ext/standard/html.c: - - Fixed bug #28067 (partially incorrect utf8 to htmlentities mapping). - (Derick, - Benjamin Greiner) - -2005-03-09 Magnus Määttä - - * run-tests.php: - Since in_array is case sensitive we need to convert the names to lowercase - otherwise it won't run tests for extensions where the case of the name - differ from the - extension name. - -2005-03-08 Jani Taskinen - - * main/main.c - main/php.h: - This makes more sense. (Someone might actually use php_error_docref0() :) - -2005-03-08 Johannes Schlüter - - * (PHP_5_0) - NEWS: - - BFN - -2005-03-08 Jani Taskinen - - * main/php.h: - - This was not needed (said Marcus) - -2005-03-08 Ilia Alshanetsky - - * ext/standard/html.c: - Improve the performance of htmlspecialchars_decode() by 20-30%. - -2005-03-08 Jani Taskinen - - * ext/standard/var_unserializer.c: - update - - * NEWS: - reorder - -2005-03-07 Marcus Boerger - - * NEWS: - - Add some more news - - * tests/classes/serialize_001.phpt: - - Add test - - * ext/standard/var_unserializer.re: - - Update signature - - * ZendEngine2/zend.h - ZendEngine2/zend_compile.c - ZendEngine2/zend_interfaces.c - ZendEngine2/zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * ext/standard/file.c: - - Fix proto - - Do not try to write zero bytes - - * ext/standard/file.c: - - Length needs to be positive - - * ext/standard/file.c: - - Make maic qutes runtime work if length is specified too - - * ext/standard/file.c: - - Delay memory allocation, speeds up faiure case - -2005-03-07 Ilia Alshanetsky - - * NEWS - ext/standard/basic_functions.c - ext/standard/html.c - ext/standard/html.h: - Added htmlspecialchars_decode() function for fast conversion from - htmlspecialchars() generated entities back to characters. - -2005-03-07 Marcus Boerger - - * ZendEngine2/tests/bug32226.phpt - ZendEngine2/tests/bug32226.phpt: - - - Add updated description - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - RBFN - -2005-03-07 Zeev Suraski - - * (PHP_4_3) - tests/basic/bug31672.phpt: - Remove test case for a Won't Fix bug - - * (PHP_4_3) - Zend/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l - ZendEngine2/zend_language_scanner.l: - Revert // patch - -2005-03-07 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/standard/proc_open.c - ext/standard/proc_open.c: - Fixed bug #32210 (proc_get_status() sets "running" always to true). - -2005-03-07 Marcus Boerger - - * tests/classes/__set__get_005.phpt: - - Add new test - - * (PHP_5_0) - ext/standard/file.c: - - MFH Allow length 0 as default (e.g. skip param) - - * ext/standard/file.c: - - Allow length 0 as default (e.g. skip param) - -2005-03-06 Jani Taskinen - - * sapi/cgi/config9.m4 - sapi/cgi/config9.m4: - MFB: Fix VPATH build - -2005-03-06 Marcus Boerger - - * ext/standard/image.c: - - Actuall the comments were correct - - * ZendEngine2/zend_reflection_api.c: - - Fix by Tim - - * ext/mysqli/mysqli.c: - - Bugfix #28840 __destruct of a class that extends mysqli not called - -2005-03-06 Ilia Alshanetsky - - * (PHP_5_0) - ext/standard/html.c: - MFH: Make html_entity_decode() 15-20% faster by avoiding pointless string - duplication. - - * ext/standard/html.c: - Make html_entity_decode() 15-20% faster by avoiding pointless string - duplication. - -2005-03-06 Jani Taskinen - - * NEWS - ext/fam/.cvsignore - ext/fam/CREDITS - ext/fam/config.m4 - ext/fam/fam.c - ext/fam/package.xml - ext/fam/php_fam.h - ext/mnogosearch/.cvsignore - ext/mnogosearch/CREDITS - ext/mnogosearch/README - ext/mnogosearch/config.m4 - ext/mnogosearch/index.php - ext/mnogosearch/php_mnogo.c - ext/mnogosearch/php_mnogo.h: - - Moved ext/fam and ext/mnogosearch to PECL - -2005-03-06 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/image.c - ext/standard/image.c: - MFH: Fixed bug #29424 (width and height inverted for JPEG2000 files). - - * ext/standard/image.c: - Fixed bug #29424 (width and height inverted for JPEG2000 files). - -2005-03-06 Jani Taskinen - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.c: - Fixed compile warning (bug #32046) - - * ZendEngine2/zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-05 Rasmus Lerdorf - - * (PHP_4_3) - ext/exif/exif.c: - wtf? - -2005-03-05 John Coggeshall - - * ext/skeleton/tests/001.phpt: - Opps. - -2005-03-05 Derick Rethans - - * (PHP_5_0) - NEWS: - - Make sure to note that this involves SOAP. - -2005-03-05 Moriyoshi Koizumi - - * NEWS - main/SAPI.c - main/php_content_types.c - main/php_content_types.h: - - Fixed bug #32109 ($_POST is not populated in multithreaded environment). - -2005-03-05 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #32115 (dateTime encoding of timezone incorrect) - -2005-03-05 John Coggeshall - - * ext/skeleton/tests/001.phpt: - Starting tests.... - -2005-03-05 Andrei Zmievski - - * ext/standard/array.c: - Check that object can actually return a class entry. I need this for a - class-entry-less helper objects that should not be present in the class - table. - -2005-03-04 Jani Taskinen - - * sapi/apache_hooks/config.m4: - Merge from sapi/apache/config.m4 and cleanup - - * sapi/apache/config.m4: - Do not set apache stuff if not building apache - - * acinclude.m4: - This did not work for some reason, better revert it - - * scripts/phpize.m4: - Add missing subst - -2005-03-04 Ilia Alshanetsky - - * (PHP_5_0) - ext/mbstring/mb_gpc.c: - Removed unused variables. - -2005-03-03 Marcus Boerger - - * (PHP_5_0) - NEWS: - - BFN - -2005-03-03 Johannes Schlüter - - * (PHP_4_3) - ext/standard/incomplete_class.c: - - Remove -Tag from error message - -2005-03-03 Zeev Suraski - - * main/logos.h: - New egg - -2005-03-03 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/file.c - ext/standard/file.c: - MFH: Fixed bug #32160 (file truncation in copy() when source & destination - are - the same). - - * ext/standard/file.c: - Fixed bug #32160 (file truncation in copy() when source & destination are - the same). - -2005-03-02 Jani Taskinen - - * (PHP_4_3) - sapi/cli/php.1.in: - typofix - -2005-03-02 Moriyoshi Koizumi - - * ext/xml/tests/bug32001.phpt - ext/xml/tests/bug32001.phpt: - - - Add testcases for bug #32001 - -2005-03-02 Rob Richards - - * NEWS - NEWS: - BFN - - * ext/xsl/php_xsl.c - ext/xsl/php_xsl.h - ext/xsl/xsltprocessor.c: - Fixed bug #31033 (php:function(string, nodeset) with xsl:key crashes PHP) - - only in 5.1 branch for now due to significance of change - -2005-03-02 Stefan Esser - - * ext/exif/exif.c: - Fixed possible bufferoverflow - -2005-03-02 Rob Richards - - * (PHP_5_0) - ext/xml/compat.c: - MFH: Fixed bug #32001 (xml_parse_into_struct() exceeds maximum execution - time) - - * ext/xml/compat.c: - Fixed bug #32001 (xml_parse_into_struct() exceeds maximum execution time) - -2005-03-01 Marcus Boerger - - * ZendEngine2/zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen - - * (PHP_4_3) - ext/standard/var_unserializer.c: - touch - -2005-03-01 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/microtime.c - ext/standard/microtime.c: - MFH: Fixed bug #31792 (getrusage() does not provide ru_nswap value). - - * ext/standard/microtime.c: - Fixed bug #31792 (getrusage() does not provide ru_nswap value). - -2005-03-01 Andrei Zmievski - - * pear/Console/Getopt.php - pear/Console/Getopt.php - pear/Console/Getopt.php: - Allow = sign in long option argument. - Fixes PEAR bug #1831. - -2005-03-01 Anantha Kesari H Y - - * ext/standard/string.c - ext/standard/string.c: - NetWare allows directory seperator as \ and / - -2005-03-01 Stefan Esser - - * ext/standard/image.c: - Handle last or broken JP2 boxes correctly. - -2005-03-01 Antony Dovgal - - * (PHP_4_3) - NEWS - ext/gmp/gmp.c: - MFH: checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() - and gmp_fact() to prevent SIGFPE - changed zend_error() to php_error_docref() - - * (PHP_5_0) - NEWS - ext/gmp/gmp.c: - MFH: checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() - and gmp_fact() to prevent SIGFPE - - * ext/gmp/gmp.c: - fix SIGFPE in gmp_powm(), gmp_sqrt() & gmp_sqrtrem() when using negative - values - do not allow negative value to be passed to gmp_fact() - -2005-03-01 Marcus Boerger - - * ext/standard/image.c: - - MFB - - * (PHP_5_0) - ext/standard/image.c: - - Fix warning - - * (PHP_5_0) - NEWS: - - BFN - -2005-03-01 Jani Taskinen - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.c: - update - - * scripts/Makefile.frag: - ws - - * (PHP_4_3) - NEWS - Zend/zend_language_scanner.l - tests/basic/bug31672.phpt: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment - - * tests/basic/bug31672.phpt - tests/basic/bug31672.phpt - tests/basic/bug31672.phpt: - 1.1.4; - file bug31672.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend_language_scanner.l: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment) - - * ZendEngine2/zend_language_scanner.l: - Fix the fix for one line comments with tags - -2005-03-01 Johannes Schlüter - - * php.ini-dist - php.ini-recommended: - - Change comment: Syntax highlighter uses instead of - -2005-02-28 Ilia Alshanetsky - - * php.ini-dist - php.ini-recommended: - Added notes about ignore_user_abort to php.ini* - -2005-02-28 Marcus Boerger - - * ZendEngine2/zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-28 Jani Taskinen - - * NEWS: - reorder - - * (PHP_5_0) - NEWS: - typo - -2005-02-28 Stefan Esser - - * ext/standard/var_unserializer.re: - This way around for correct error messages - - * ext/standard/var_unserializer.re: - Drop invalid arrays - -2005-02-28 Wez Furlong - - * scripts/Makefile.frag: - Let's install the mbstring headers. - Fixes PECL #3516 - -2005-02-28 Marcus Boerger - - * acinclude.m4: - - Fix typo - -2005-02-27 Marcus Boerger - - * ext/simplexml/tests/016a.phpt - ext/simplexml/tests/022.phpt: - - Add tests - - * ZendEngine2/zend_object_handlers.c: - - If silence if wanted we do not error out - - * ZendEngine2/zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * ZendEngine2/zend_API.h: - - These must be initailized - -2005-02-27 Rasmus Lerdorf - - * TSRM/tsrm_virtual_cwd.c: - Add a comment to remind me to have a look at this at some point. - -2005-02-27 Ilia Alshanetsky - - * ext/standard/ftp_fopen_wrapper.c - ext/standard/image.c: - Fixed compiler warnings. - -2005-02-27 Marcus Boerger - - * ZendEngine2/zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen - - * main/main.c: - cs fix (really annoying :) - - * acinclude.m4 - ZendEngine2/Zend.m4: - - Cache the version check results - -2005-02-27 Stanislav Malyshev - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - fix typo - -2005-02-27 Sara Golemon - - * ext/standard/info.c: - Enum filters in phpinfo() - -2005-02-26 Wez Furlong - - * run-tests.php: - let the test-suite run from an alternate build dir - -2005-02-26 Marcus Boerger - - * ext/dba/config.m4: - - Make detection work for macros - - * ext/dba/dba_db1.c: - - Simplify - -2005-02-26 Greg Beaver - - * pear/go-pear-list.php: - use 1.3.5 - -2005-02-26 Marcus Boerger - - * ext/dba/config.w32: - - Prepare for db1.85 emulation with db3 - -2005-02-25 Marcus Boerger - - * ext/dba/config.m4 - ext/dba/dba.c - ext/dba/dba_db1.c - ext/dba/php_db1.h - ext/dba/tests/dba_db1.phpt: - - Add support for db1 through emulation - -2005-02-25 Frank M. Kromann - - * (PHP_5_0) - ext/mssql/php_mssql.c: - MFH: FreeTDS does not have support for DBTEXTLIMIT - - * ext/mssql/php_mssql.c - ext/mssql/php_mssql.c: - FreeTDS does not have support for DBTEXTLIMIT - -2005-02-25 Rob Richards - - * (PHP_4_3) - NEWS - ext/domxml/php_domxml.c: - no message - -2005-02-25 Marcus Boerger - - * ext/dba/config.m4: - - Align - -2005-02-25 Antony Dovgal - - * ext/oci8/config.m4: - fix bug preventing from building oci8 as shared module - (patch by stanislav dot voroniy at portavita dot nl) - -2005-02-25 Georg Richter - - * ext/mysqli/tests/bug30967.phpt - ext/mysqli/tests/bug30967.phpt: - fix for bug #31939 - -2005-02-25 Anantha Kesari H Y - - * netware/sendmail_nw.h: - changing the windows style path seperator in netinet\in.h to netinet/in.h - - * win32/sendmail.c: - time.h is available in NetWare LibC. - path sperator has been changed from \ to / while including - netware\sendmail_nw.h - -2005-02-25 Marcus Boerger - - * ext/exif/config.w32: - - Change to enable (synch with unix build system) - -2005-02-24 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_nonapi.c: - MFH: Fixed bug #32081 (default socket value is not being used). - - * ext/mysqli/mysqli_nonapi.c: - Fixed bug #32081 (default socket value is not being used). - -2005-02-24 Marcus Boerger - - * ext/standard/image.c: - - Little speed up - - * ext/standard/image.c: - - This must be == 1 - -2005-02-24 Jani Taskinen - - * acinclude.m4 - configure.in - ext/iconv/config.m4: - - Fixed all buildconf warnings + cross-compiling issues - -2005-02-24 Andi Gutmans - - * ZendEngine2/zend_language_scanner.l: - - Make one line comments work the same with as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - -2005-02-24 Jani Taskinen - - * TSRM/threads.m4: - - cross-compile fix - -2005-02-24 Andi Gutmans - - * ZendEngine2/zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Jani Taskinen - - * acinclude.m4 - configure.in - scripts/phpize.m4: - - Restructured and added a few comments here and there. - - Made macros of couple of tests previously littering configure.in - (e.g. PHP_PROG_AWK, PHP_PROG_LEX, PHP_PROG_BISON..) - - Moved all PHP_SUBST() calls into their respective macros. - (no point adding empty entries in Makefile if macro is not used) - - * ext/standard/var_unserializer.c: - - Generated with re2c 0.9.4 - -2005-02-24 Stanislav Malyshev - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - fix typo - -2005-02-24 Dmitry Stogov - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans - - * ZendEngine2/zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * main/streams/mmap.c: - - Fix comment - - * ZendEngine2/zend_objects.c - ZendEngine2/zend_objects.h - ZendEngine2/zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-24 Marcus Boerger - - * ext/standard/image.c: - - Prevent superflous memory allocation - -2005-02-23 Ilia Alshanetsky - - * ext/standard/image.c: - Additional safety checks. - -2005-02-23 Marcus Boerger - - * ext/standard/image.c: - - Slightly redesign - -2005-02-23 Ilia Alshanetsky - - * (PHP_5_0) - main/streams/mmap.c: - MFH: Increase maximum mmapable file size to 2mb from 1mb. - - * main/streams/mmap.c: - Increase maximum mmapable file size to 2mb from 1mb. - - * (PHP_4_3) - TODO_SEGFAULTS: - pack() issues were resolved. - -2005-02-23 Ard Biesheuvel - - * ext/interbase/interbase.c: - Fixed bug #31597: ibase_connect() - incorrect warning - -2005-02-23 Ilia Alshanetsky - - * ext/standard/dir.c: - Fixed compiler warning. - - * (PHP_5_0) - ext/bz2/bz2.c: - MFB_4_3: Fixed bug #29521 (compress.bzip2 returns error when used with http - wrapper) - - * ext/bz2/bz2.c: - MFB_4_3: Fixed bug #29521 (compress.bzip2 returns error when used with http - wrapper). - -2005-02-23 Stefan Esser - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - Correcting bounds check before someone uses this code - -2005-02-23 Derick Rethans - - * (PHP_5_0) - NEWS - ZendEngine2/zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * ZendEngine2/zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev - - * ext/standard/var.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - Custom object serializer infrastructure - PHP implementation - - * ZendEngine2/zend.h - ZendEngine2/zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Anantha Kesari H Y - - * main/php_syslog.h: - NetWare can make use of Autoconf generated header file - - * main/php_open_temporary_file.c: - NetWare LibC has mkstemp implementation - - * main/php_compat.h: - NetWare can make use autoconf generated header file - - * main/fopen_wrappers.c: - NetWare LibC has pwd.h - -2005-02-23 Jani Taskinen - - * ZendEngine2/Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger - - * run-tests.php: - - Use PHP not C semantics - - * ZendEngine2/zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/mysql/php_mysql.c - ext/mysql/php_mysql.c: - MFH: Fixed bug #31288 (Possible crash in mysql_fetch_field(), if - mysql_list_fields() was not called previously). - - * ext/mysql/php_mysql.c: - Fixed bug #31288 (Possible crash in mysql_fetch_field(), if - mysql_list_fields() was not called previously). - -2005-02-22 Marcus Boerger - - * ZendEngine2/zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen - - * (PHP_4_3) - main/SAPI.c - main/SAPI.c: - MFH: nuke unused variables when PCRE is not compiled statically into PHP - - * ZendEngine2/Zend.m4: - Fix cross-compile - - * ZendEngine2/acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger - - * ZendEngine2/zend_objects.c - ZendEngine2/zend_objects.h - ZendEngine2/zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * ZendEngine2/zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Moriyoshi Koizumi - - * (PHP_4_3) - NEWS: - - MFH: fix bug #32063 (mb_convert_encoding ignores named entity 'alpha') - - * (PHP_5_0) - NEWS: - - One more entry to go. - - * (PHP_5_0) - NEWS: - - Reorder. - - * (PHP_5_0) - NEWS: - - MFH: fix bug #32063 (mb_convert_encoding() ignores named entity 'alpha') - -2005-02-22 Anantha Kesari H Y - - * ZendEngine2/zend.h: - NetWare can include autoconf generated config headers - - * ZendEngine2/acconfig.h: - NetWare can make use of the configure script generated header file. - - * TSRM/tsrm_config.nw.h: - NetWare can use Autoconf based build system. - -2005-02-22 Moriyoshi Koizumi - - * main/SAPI.c: - - Silly typo. - -2005-02-22 Ilia Alshanetsky - - * (PHP_5_0) - NEWS - ext/standard/dir.c - main/php_streams.h - main/streams/streams.c: - MFH: Fixed bug #31515 (Improve performance of scandir() by factor of 10 or - so). - - * ext/standard/dir.c - main/php_streams.h - main/streams/streams.c: - Fixed bug #31515 (Improve performance of scandir() by factor of 10 or so). - -2005-02-21 Jani Taskinen - - * (PHP_5_0) - ext/mysqli/tests/skipif.inc: - Added missing skipif.inc (bug #31940) - - * main/SAPI.c: - Nuke unused variables when PCRE is not compiled in - - * main/SAPI.c: - Remove the useless TSRM_FETCH calls - -2005-02-21 Moriyoshi Koizumi - - * NEWS - NEWS: - - BFN - - * ext/mbstring/mbstring.c - ext/mbstring/mbstring.c: - - WS fix. - - * ext/mbstring/mb_gpc.c - ext/mbstring/mbstring.c - main/SAPI.c - main/SAPI.h - main/main.c - main/php_content_types.c - main/php_content_types.h: - - Fix bug #28568 (known_post_content_types is not thread safe). - - * ZendEngine2/Makefile.am: - - Add missing entry. - -2005-02-21 Stanislav Malyshev - - * (PHP_4_3) - Zend/zend_execute.c: - fix overloaded objects via TMP_VAR - - * (PHP_4_3) - main/SAPI.c: - packport fix from PHP5: read post data if they wreen't read - -2005-02-21 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS - ext/mbstring/php_mbregex.c: - - MFH: fix bug #30868 (evaluated pointer comparison in mbregex causes - compile - failure). - - * ext/mbstring/php_mbregex.c: - - Fix bug #30868 (evaluated pointer comparison in mbregex causes compile - failure). - - * (PHP_4_3) - NEWS: - - MFH: fix bug #30573 (compiler warning due to invalid type cast). - -2005-02-21 Anantha Kesari H Y - - * TSRM/tsrm_virtual_cwd.h: - NetWare LibC has lstat implementation - - * TSRM/tsrm_config_common.h: - NetWare can make use of autogenerated config header file - - * TSRM/TSRM.c: - NetWare has pthreads implementation - - * TSRM/TSRM.h: - NetWare can use the tsrm_config.h - - * TSRM/tsrm_virtual_cwd.c: - NetWare LibC has a lstat implementation - - * ext/standard/proc_open.c: - In NetWare LibC WTERMSIG is avaliable as WIFTERMSIG - -2005-02-21 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS: - - MFH: fix bug #29989 (type re_registers redefined in oniguruma.h) - -2005-02-21 Anantha Kesari H Y - - * ext/standard/pageinfo.c: - NetWare LibC has pwd.h. Removed unwanted extern basic_globals_id - declaration for Netware. - - * ext/standard/pack.c: - NetWare has pwd.h and removed unwanted check on NEW_LIBC while including - param.h - - * ext/standard/link.c: - NetWare LibC has pwd.h - - * ext/standard/filestat.c: - In NetWare statfs f_bavail member is known as f_bfree - -2005-02-21 Moriyoshi Koizumi - - * ext/mbstring/mbstring.c: - - Fix compiler warnings. - - * (PHP_4_3) - ext/mbstring/tests/bug28220.phpt - ext/mbstring/tests/bug30549.phpt - ext/mbstring/tests/bug31911.phpt: - - MFH: add testcases for bug #28220, #30549 and #31911. - - * (PHP_5_0) - ext/mbstring/tests/bug28220.phpt - ext/mbstring/tests/bug30549.phpt: - - MFH: add testcases for bug #28220 and #30549. - - * ext/mbstring/tests/bug28220.phpt - ext/mbstring/tests/bug30549.phpt: - 1.1.4; - - Add testcases for bug #28220 and #30549. - - * (PHP_4_3) - NEWS - ext/mbstring/config.m4: - - Upgrade libmbfl (fixers bug #28220, #30549 and #31911). - -2005-02-21 Greg Beaver - - * (PHP_5_0) - pear/go-pear-list.php: - upgrade to PEAR 1.3.5 - -2005-02-20 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS: - - BFN & some - - * (PHP_5_0) - ext/mbstring/config.m4 - ext/mbstring/config.w32 - ext/mbstring/php_mbregex.c - ext/mbstring/tests/bug31911.phpt: - - MFH: Update libmbfl - - MFH: Update oniguruma to 3.7.0. - - * ext/mbstring/tests/bug31911.phpt: - - - Update libmbfl (fixes bug #30549 and #31911). - - Update oniguruma to 3.7.0 - - * ext/mbstring/config.m4 - ext/mbstring/config.w32 - ext/mbstring/php_mbregex.c: - - Update libmbfl (fixes bug #30549 and #31911). - - Update oniguruma to 3.7.0 - -2005-02-20 Rob Richards - - * ext/dom/domexception.c - ext/dom/php_dom.h: - use new error handling when not throwing exceptions - -2005-02-20 Ilia Alshanetsky - - * ext/imap/php_imap.c: - Simplify Code. - -2005-02-20 Dmitry Stogov - - * ZendEngine2/zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa - - * (PHP_5_0) - ZendEngine2/zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * ZendEngine2/zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-19 Marcus Boerger - - * ext/sqlite/tests/sqlite_oo_031.phpt - ext/sqlite/tests/sqlite_oo_032.phpt - ext/sqlite/tests/sqlite_spl_001.phpt - ext/sqlite/tests/sqlite_spl_002.phpt - ext/sqlite/tests/sqlite_spl_003.phpt: - - Regroup and add a test - -2005-02-18 Derick Rethans - - * (PHP_4_3) - ext/standard/tests/array/bug32021.phpt: - - Added test case for bug #32021. - - * (PHP_5_0) - NEWS - ext/standard/array.c - ext/standard/tests/array/bug32021.phpt: - - MFH: Fixed bug #32021: Crash caused by range('', 'z') - - * ext/standard/array.c: - - Fixed bug #32021: Crash caused by range('', 'z') - - * ext/standard/tests/array/bug32021.phpt: - 1.1.4; - - Fixed bug #32021: Crash caused by range('', 'z') - -2005-02-18 Rob Richards - - * ext/dom/documentfragment.c: - Fragment must have associated document to append xml otherwise it is - read-only - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/dom/node.c: - MFH: Fixed bug #32011 (Fragments which replaced Nodes are not globaly - useable) - - * ext/dom/node.c: - Fixed bug #32011 (Fragments which replaced Nodes are not globaly useable) - -2005-02-17 Andi Gutmans - - * (PHP_5_0) - NEWS: - - Commit fix: - - Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping - columns - with NULL values). (Daniel Convissor) - - * (PHP_4_3) - NEWS: - - Commit NEWS Entry for: - - Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping - columns - with NULL values). (Daniel Convissor) - -2005-02-17 Marcus Boerger - - * ZendEngine2/zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * ZendEngine2/zend_API.c: - - No C++ ruleZ here - - * ZendEngine2/zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * ZendEngine2/zend_API.c: - - Incrementation is done elsewhere - - * ZendEngine2/zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Andi Gutmans - - * ext/msql/php_msql.c: - - Fix Bug #31960: msql_fetch_row() and msql_fetch_array() dropping columns - with NULL values - -2005-02-17 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/ftp/ftp.c - ext/ftp/ftp.c: - MFH: Fixed bug #27633 (Double \r problem on ftp_get in ASCII mode on - Win32). - - * ext/ftp/ftp.c: - Fixed bug #27633 (Double \r\r problem on ftp_get in ASCII mode on Win32). - -2005-02-17 Joe Orton - - * ext/xml/compat.c: - Declare error_mapping array as static and more const. - -2005-02-17 Anantha Kesari H Y - - * ext/standard/filestat.c: - NetWare LibC has pwd.h - - * ext/standard/file.c: - NetWare libc has pwd.h - -2005-02-17 Jani Taskinen - - * (PHP_4_3) - ext/openssl/openssl.c: - ws/cs - -2005-02-17 Wez Furlong - - * ext/standard/credits.c: - George too - - * ext/standard/credits.c - ext/standard/credits_ext.h: - ran ./scripts/dev/credits to update credits to reflect recent removals and - additions. - -2005-02-17 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - main/main.c: - MFH: MFH: Fixed bug #31440 ($GLOBALS can be overwritten via GPC when - register_globals is enabled). - - * (PHP_5_0) - NEWS - main/php_variables.c: - MFH: Fixed bug #31440 ($GLOBALS can be overwritten via GPC when - register_globals is enabled). - -2005-02-17 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - Zend/Zend.m4 - Zend/zend_strtod.c - ZendEngine2/Zend.m4 - ZendEngine2/zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * ZendEngine2/Zend.m4 - ZendEngine2/zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-17 Ilia Alshanetsky - - * main/php_variables.c: - Fixed bug #31440 ($GLOBALS can be overwritten via GPC when register_globals - is enabled). - -2005-02-17 Jani Taskinen - - * (PHP_4_3) - ext/pspell/config.m4 - ext/pspell/config.m4: - MFH:- Fixed bug #29554 (compile failure when using - --with-pspell=/usr/local) - - * ext/pspell/config.m4: - - Fixed bug #29554 (compile failure when using --with-pspell=/usr/local) - -2005-02-16 Jani Taskinen - - * ext/exif/exif.c: - PHP_WIN32 is defined or not defined. - -2005-02-16 Edin Kadribasic - - * (PHP_5_0) - NEWS: - BFN - - * ext/exif/exif.c: - Enable mbstring use on windows. We were linking against mbstring for - some time now, but have never actually used it on Windows. - Fixes #31980. - -2005-02-15 Ilia Alshanetsky - - * (PHP_4_3) - ext/exif/exif.c - ext/exif/exif.c: - MFH: Fixed bug #31986 (Max nesting limit set too low). - - * ext/exif/exif.c: - Fixed bug #31986 (Max nesting limit set too low). - -2005-02-15 Marcus Boerger - - * ext/sqlite/config.m4 - ext/sqlite/config.w32 - ext/sqlite/sqlite.c - ext/sqlite/tests/sqlite_oo_032.phpt: - - SQLite depends on SPL if it is present - - Add SQLiteResult::count() - - SQLiteResult implements Countable if present - -2005-02-15 Jani Taskinen - - * config.guess - config.sub - ltmain.sh - build/libtool.m4: - - Applied some patches to fix issues with e.g. ia_64 and s390 - - * ext/dom/config.m4: - No tabs here - - * ext/xmlrpc/libxmlrpc/.cvsignore: - Missing .libs entry - -2005-02-15 Ilia Alshanetsky - - * main/rfc1867.c: - Prune uploaded file names to \ on all OSes, read comments for explanation. - -2005-02-14 Jani Taskinen - - * ext/sockets/sockets.c: - - More sock->error resets - -2005-02-14 Edin Kadribasic - - * ext/pgsql/pgsql.c: - ws fix - - * NEWS - ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: - Added pg_field_type_oid() function - - * ext/pgsql/config.w32: - Added missing defines (#31751) - -2005-02-14 Jani Taskinen - - * (PHP_4_3) - ext/sockets/sockets.c: - Fix typo - - * (PHP_4_3) - ext/sockets/sockets.c: - MFH: - Removed duplicate error + reset error in new sockets - - * ext/sockets/sockets.c: - - Removed duplicate error + reset error in new sockets - -2005-02-14 Marcus Boerger - - * ext/standard/var_unserializer.c: - - Disallow illegal class names (.c part) - - * ext/standard/var_unserializer.re: - - Disallow illegal class names - -2005-02-14 Anantha Kesari H Y - - * main/php.h: - NetWare Libc has php.h so no need of having netware specific block here - -2005-02-14 Jani Taskinen - - * (PHP_5_0) - php.ini-dist - php.ini-recommended - ext/sockets/php_sockets.h: - MFH: nuke unused code + non-existing ini option - - * php.ini-dist - php.ini-recommended: - Nuke non-existing ini option - - * ext/sockets/php_sockets.h: - Nuke unused code - -2005-02-13 Marcus Boerger - - * ZendEngine2/zend_execute_API.c - ZendEngine2/zend_reflection_api.c: - - Be more gracious in reflection API - -2005-02-13 Ilia Alshanetsky - - * ext/standard/tests/general_functions/sunfuncts.phpt: - Fixed test. - -2005-02-13 Jani Taskinen - - * ext/session/mod_files.h - ext/session/mod_mm.h - ext/session/mod_user.h - ext/session/php_session.h: - - Missing $Id$ tags - - * (PHP_4_3) - ext/session/session.c: - MFH: - Added the alias session_commit() (more intuitive name for - session_write_close()) - MFH: - Partial sync of the file by adding macro SESSION_CHECK_ACTIVE_STATE - -2005-02-13 Marcus Boerger - - * ZendEngine2/zend_language_scanner.l: - - Fix doc comment handling - -2005-02-13 Jani Taskinen - - * ext/session/php_session.h: - MFB_4_3: cvs diff -r1.84.2.5 -r1.84.2.6 php_session.h - -2005-02-13 Wez Furlong - - * ext/sqlite/config.m4: - same fix here - -2005-02-12 Jani Taskinen - - * ext/snmp/snmp.c: - Missed one place.. - - * ext/snmp/snmp.c: - This was not good idea. - - * (PHP_4_3) - NEWS - ext/sockets/config.m4 - ext/sockets/php_sockets_win.h - ext/sockets/sockets.c: - - Fixed bug #31936 (set_h_errno() is redefined incompatibly) - - * ext/sockets/php_sockets_win.h - ext/sockets/sockets.c: - Remove unused set_h_errno - -2005-02-12 Marcus Boerger - - * (PHP_5_0) - NEWS - tests/lang/bug30862.phpt: - - BFN and add test - - * ZendEngine2/zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_parser.y: - - Cleanup foreach handling - -2005-02-11 Jani Taskinen - - * (PHP_4_3) - TSRM/TSRM.c - TSRM/TSRM.h - TSRM/tsrm_config.nw.h - TSRM/tsrm_config_common.h - TSRM/tsrm_nw.c - TSRM/tsrm_nw.h - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h - TSRM/tsrm_win32.c - TSRM/tsrm_win32.h: - Revert - - * (PHP_4_3) - NEWS - sapi/cgi/cgi_main.c: - Revert broken patch - - * (PHP_5_0) - NEWS - sapi/cgi/cgi_main.c: - Revert this patch - - * sapi/cgi/cgi_main.c: - Revert previous patch - -2005-02-10 Rob Richards - - * (PHP_5_0) - ext/standard/array.c: - MFH: fix segfault in array_walk when retval_ptr is empty - - such as when exception thrown - - * ext/standard/array.c: - fix segfault when retval_ptr is empty - such as when exception thrown - -2005-02-10 Hartmut Holzgraefe - - * ext/xml/tests/bug30266.phpt: - test case for Bug #30266 - -2005-02-10 Jani Taskinen - - * (PHP_4_3) - TSRM/TSRM.c - TSRM/TSRM.h - TSRM/tsrm_config.nw.h - TSRM/tsrm_config_common.h - TSRM/tsrm_nw.c - TSRM/tsrm_nw.h - TSRM/tsrm_virtual_cwd.c - TSRM/tsrm_virtual_cwd.h - TSRM/tsrm_win32.c - TSRM/tsrm_win32.h: - MFH: - Multiple fixes for nasty leaks in ZTS mode - - * configure.in - configure.in - configure.in - Zend/zend_strtod.c - ZendEngine2/zend_strtod.c - ZendEngine2/zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Antony Dovgal - - * ext/session/session.c: - hm.. - fix #28324 _properly_ - - * ext/session/session.c: - fix bug #28324 (HTTP_SESSION_VARS appear when register_long_arrays is Off) - -2005-02-10 Pierre-Alain Joye - - * ext/standard/sunfuncs.c: - - fix #30745 and #31853 (php-bugs at demark dot org, pierre) - -2005-02-10 Ilia Alshanetsky - - * ext/mbstring/mb_gpc.c - ext/mbstring/mbstring.c: - Removed unused vars. - -2005-02-10 Dmitry Stogov - - * NEWS - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-09 Frank M. Kromann - - * (PHP_4_3) - ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.c: - MFH: change return value from false to true, when a statement was executed - with warnings - - * ext/fbsql/php_fbsql.c: - change return value from false to true, when a statement was executed with - warnings - - * (PHP_4_3) - ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.c: - MFH: Check for warnings and return the warning texts - - * ext/fbsql/php_fbsql.c: - Check for warnings and return the warning texts - -2005-02-09 Rasmus Lerdorf - - * ext/curl/config.m4: - Fix for bug #31901 - -2005-02-09 Rob Richards - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_5_0) - ext/dom/php_dom.c: - MFH: Fixed bug #31878 (Segmentation fault using clone keyword on nodes) - - * ext/dom/php_dom.c: - Fixed bug #31878 (Segmentation fault using clone keyword on nodes) - -2005-02-09 Moriyoshi Koizumi - - * acinclude.m4: - - Complement for Jani's fix. Likely fix the iconv issue. - -2005-02-08 Ilia Alshanetsky - - * ext/shmop/php_shmop.h - ext/shmop/shmop.c: - Removed pointless operations/declarations. - - * NEWS - ext/standard/file.c: - Added optional maxlen parameter to file_get_contents(). - -2005-02-08 Antony Dovgal - - * NEWS - ext/cpdf/.cvsignore - ext/cpdf/CREDITS - ext/cpdf/config.m4 - ext/cpdf/config.w32 - ext/cpdf/cpdf.c - ext/cpdf/cpdf.dsp - ext/cpdf/package.xml - ext/cpdf/php_cpdf.h: - move ext/cpdf to PECL - -2005-02-08 Rasmus Lerdorf - - * (PHP_5_0) - ext/fam/fam.c - ext/fam/php_fam.h - ext/hwapi/hwapi.cpp - ext/hwapi/php_hwapi.h - ext/xml/xml.c: - MFH eliminating a few more useless R* calls - -2005-02-07 Rasmus Lerdorf - - * ext/fam/fam.c - ext/fam/php_fam.h - ext/hwapi/hwapi.cpp - ext/hwapi/php_hwapi.h - ext/mono/php_mono.c - ext/msession/msession.c - ext/msession/php_msession.h - ext/ncurses/ncurses.c - ext/ncurses/php_ncurses.h: - Get rid of more useless RINIT/RSHUTDOWN calls - -2005-02-07 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/sysvmsg/sysvmsg.c - ext/sysvmsg/sysvmsg.c: - MFH: Fixed bug #31527 (crash in msg_send() when non-string is stored - without - being serialized). - - * ext/sysvmsg/sysvmsg.c: - Fixed bug #31527 (crash in msg_send() when non-string is stored without - being serialized). - -2005-02-07 Rasmus Lerdorf - - * ext/xml/xml.c: - No reason to call empty RINIT, RSHUTDOWN and MSHUTDOWN functions here - -2005-02-07 Dmitry Stogov - - * ZendEngine2/zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * ZendEngine2/zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - - * tests/lang/040.phpt: - - Add new test - -2005-02-07 Antony Dovgal - - * ext/filepro/filepro.c - ext/filepro/php_filepro.h: - fix leaks on shutdown - fix leaks appearing when trying to open several "databases" - -2005-02-07 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - configure.in - configure.in: - MFH: - Fixed bug #31858 (--disable-cli does not force --without-pear) - - * configure.in: - - Fixed bug #31858 (--disable-cli does not force --without-pear) - -2005-02-06 Zeev Suraski - - * (PHP_5_0) - ZendEngine2/zend_ini_scanner.l: - Correct fix for #28803 - - * ZendEngine2/zend_ini_scanner.l: - Correct fix for #28804 - - * (PHP_4_3) - Zend/zend_ini_scanner.l: - Correct fix for #28804 (minimize change from previous regexp) - -2005-02-06 Wez Furlong - - * main/php_streams.h: - Avoid bug where stream_copy_to_stream() call for precisely 2000000 bytes - would - result in entire resource being copied. - The mmap brake is already present inside mmap_range() and is set to 1MB. - - * ext/standard/file.c: - support sucking data from streams in file_put_contents() - -2005-02-06 Ilia Alshanetsky - - * ext/standard/exec.c: - Fixed possible un-initialized var on error. - -2005-02-06 Wez Furlong - - * main/php_memory_streams.h - main/streams/memory.c: - add an open mode for the memory streams that allows the stream to take - ownership of the passed-in buffer - - * ext/sqlite/TODO: - update todo - -2005-02-05 Marcus Boerger - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_language_parser.y - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-05 Georg Richter - - * ext/mysqli/config.m4: - fix for bug #29329 - -2005-02-04 Jani Taskinen - - * ext/standard/tests/time/bug13142.phpt - ext/standard/tests/time/bug13142.phpt - ext/standard/tests/time/bug13142.phpt: - fix test - -2005-02-04 Hartmut Holzgraefe - - * NEWS - ZendEngine2/zend_API.c - ZendEngine2/zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-04 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #31832 (SOAP encoding problem with complex types in WSDL mode - with multiple parts) - -2005-02-04 Derick Rethans - - * (PHP_4_3) - NEWS - NEWS - ext/dbase/dbase.c - ext/dbase/dbase.c: - - MFH: Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) - - * ext/dbase/dbase.c: - - Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) - -2005-02-04 Jani Taskinen - - * (PHP_5_0) - NEWS: - BFN - - * (PHP_4_3) - NEWS - ext/standard/datetime.c - ext/standard/datetime.c: - MFH: Fixed bug #31842 (*date('r') does not return RFC2822 conforming date - string). - - * ext/standard/datetime.c: - - Fixed bug #31842 (*date('r') does not return RFC2822 conforming date - string). - - * (PHP_4_3) - NEWS - sapi/cgi/cgi_main.c: - MFH: - Fixed bug #28227 (PHP CGI depends upon non-standard SCRIPT_FILENAME) - - * (PHP_5_0) - NEWS - sapi/cgi/cgi_main.c: - MFH: - Fixed bug #28227 (PHP CGI depends upon non-standard SCRIPT_FILENAME) - - * sapi/cgi/cgi_main.c: - - Fixed bug #28227 (PHP CGI depends upon non-standard SCRIPT_FILENAME) - -2005-02-04 Ilia Alshanetsky - - * ext/readline/readline.c: - Proper fix for bug #31796 . - -2005-02-03 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/readline/readline.c - ext/readline/readline.c: - MFH: Fixed bug #31796 (readline completion handler does not handle empty - return values). - - * ext/readline/readline.c: - Fixed bug #31796 (readline completion handler does not handle empty return - values). - -2005-02-03 Jani Taskinen - - * buildconf - build/build2.mk: - - Fix buildconf with BSD make - -2005-02-03 Magnus Määttä - - * ext/filepro/package.xml: - Fix typos. - -2005-02-03 Jani Taskinen - - * EXTENSIONS: - cleanup - - * (PHP_5_0) - NEWS - ZendEngine2/zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * (PHP_4_3) - NEWS - Zend/zend_ini_scanner.l: - - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * ZendEngine2/zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * (PHP_4_3) - Zend/zend_ini_scanner.l: - Missing $Id$ tag + ws fix - - * ZendEngine2/zend_ini_scanner.l - ZendEngine2/zend_ini_scanner.l: - ws fix - -2005-02-02 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - main/fopen_wrappers.c - main/fopen_wrappers.c: - MFH: Fixed bug #31514 (open_basedir uses path_translated rather then cwd - for . - translation). - - * main/fopen_wrappers.c: - Fixed bug #31514 (open_basedir uses path_translated rather then cwd for . - translation). - -2005-02-02 Jani Taskinen - - * NEWS: - pecl movement - - * ext/w32api/.cvsignore - ext/w32api/CREDITS - ext/w32api/EXPERIMENTAL - ext/w32api/README - ext/w32api/TODO - ext/w32api/package.xml - ext/w32api/php_w32api.h - ext/w32api/w32api.c - ext/w32api/w32api.dsp - ext/w32api/w32api_function_definition_parser.y - ext/w32api/w32api_function_definition_scanner.l - ext/w32api/w32api_type_definition_parser.y - ext/w32api/w32api_type_definition_scanner.l: - - Moved ext/w32api to PECL. - - * NEWS: - PECL - - * ext/yp/.cvsignore - ext/yp/CREDITS - ext/yp/config.m4 - ext/yp/package.xml - ext/yp/php_yp.h - ext/yp/yp.c: - - Moved ext/yp to PECL. - - * NEWS: - NEWS - - * ext/dio/.cvsignore - ext/dio/EXPERIMENTAL - ext/dio/config.m4 - ext/dio/config.w32 - ext/dio/dio.c - ext/dio/package.xml - ext/dio/php_dio.h - ext/dio/tests/.cvsignore - ext/dio/tests/001.phpt: - - Moved ext/dio to PECL. - -2005-02-02 Stanislav Malyshev - - * ext/standard/array.c: - fix memory leak if function call fails - - * ZendEngine2/zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #31747 (SOAP Digest Authentication doesn't work with "HTTP/1.1 - 100 Continue" response) - -2005-02-02 Stanislav Malyshev - - * ZendEngine2/tests/bug31720.phpt: - test for Bug #31720 - - * ZendEngine2/tests/bug31720.phpt - ZendEngine2/tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - ZendEngine2/zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * (PHP_5_0) - ext/standard/array.c: - fix leak if function call fails - -2005-02-02 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #31755 (Cannot create SOAP header in no namespace) - - * ZendEngine2/tests/bug31683.phpt - ZendEngine2/tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ZendEngine2/zend.h - ZendEngine2/zend.h - ZendEngine2/zend_object_handlers.c - ZendEngine2/zend_object_handlers.c - ZendEngine2/tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - -2005-02-01 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/exif/exif.c - ext/exif/exif.c: - MFH: Fixed bug #31797 (exif_read_data() uses too low nesting limit). - - * ext/exif/exif.c: - Fixed bug #31797 (exif_read_data() uses too low nesting limit). - -2005-02-01 Stanislav Malyshev - - * ZendEngine2/zend_builtin_functions.c - ZendEngine2/zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * ZendEngine2/tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * ZendEngine2/tests/bug_debug_backtrace.phpt - ZendEngine2/tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - - * (PHP_4_3) - Zend/zend_execute.c: - Better fix for #28086 - -2005-02-01 Anantha Kesari H Y - - * TSRM/TSRM.h: - NetWare has a compliant pthread implementation - - * (PHP_5_0) - TSRM/TSRM.h: - NetWare is now having compliant pthreads implementation - -2005-02-01 Ilia Alshanetsky - - * (PHP_4_3) - main/rfc1867.c - main/rfc1867.c: - MFH: Final version of filename upload handling. - - * main/rfc1867.c: - Final version of filename upload handling. - -2005-01-31 Marcus Boerger - - * ZendEngine2/zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-30 Ilia Alshanetsky - - * (PHP_4_3) - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/var_unserializer.re: - MFH: Fix handling of INF/NAN in unserialize(). - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - Fix handling of INF/NAN in unserialize(). - -2005-01-28 Marcus Boerger - - * ZendEngine2/zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-28 Georg Richter - - * (PHP_5_0) - NEWS - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_prop.c: - MFH: Fix for mysql_affected_rows and mysql_stmt_affected_rows - - * ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_prop.c: - fixed a bug in mysql_affected_rows and mysql_stmt_affected_rows - in case affected_rows function returns (my_ulonglong) -1 for errors. - (Thanks to Antony Dovgal for reporting this bug) - -2005-01-28 Antony Dovgal - - * ext/standard/ftok.c - ext/standard/ftok.c - ext/standard/ftok.c: - improve CS & error messages - - * ext/standard/ftok.c - ext/standard/ftok.c: - MFB: explain why ftok() failed - - * (PHP_5_0) - ext/standard/ftok.c: - add warning explaining why ftok() failed - - * (PHP_5_0) - NEWS: - BFN (#31732) - - * ext/mbstring/mbstring.c: - MFB: fix #31732 - - * (PHP_5_0) - ext/mbstring/mbstring.c: - fix #31732 (mb_get_info causes segfault) - - * (PHP_4_3) - ext/posix/posix.c - ext/posix/posix.c: - MFH: change return type from NULL to FALSE when parameter parsing failed - - * ext/posix/posix.c: - change return type from NULL to FALSE when parameter parsing failed - (as was requested by Ilia) - - * ext/posix/posix.c: - MFB: fix posix_getsid() & posix_getpgid() - - * (PHP_5_0) - NEWS - ext/posix/posix.c: - fix posix_getsid() & posix_getpgid() - - /* looks like copy&paste error first introduced in PHP 3.0.10 (!) */ - -2005-01-27 Frank M. Kromann - - * (PHP_4_3) - ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.c: - MFH: Hack to fix crash caused by FBCAccess not returning errors when - creating an index that exists in the database. - - * ext/fbsql/php_fbsql.c: - Hack to fix crash caused by FBCAccess not returning errors when creating an - index that exists in the database. - -2005-01-27 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - ext/standard/url.c - ext/standard/tests/strings/url_t.phpt: - MFH: Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar) - - * (PHP_5_0) - NEWS - ext/standard/url.c - ext/standard/tests/strings/url_t.phpt: - MFH: Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar). - - * ext/standard/url.c - ext/standard/tests/strings/url_t.phpt: - Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar) - -2005-01-27 Antony Dovgal - - * ext/mysqli/mysqli.c: - MFB: fix leak in mysqli_fetch_array() - - * (PHP_5_0) - ext/mysqli/mysqli.c: - fix leak in mysqli_fetch_array() when using invalid resulttype - -2005-01-27 Georg Richter - - * ext/mysqli/mysqli_api.c: - fix for bug #31710 (return value for mysql_rollback is reverted) - fixed also same behaviour for mysql_commit and mysql_autocommit - -2005-01-27 Antony Dovgal - - * (PHP_5_0) - NEWS: - BFN - - * ext/mysqli/mysqli_api.c: - MFB: fix segfault when invalid field offset is passed to - mysqli_fetch_field_direct() - - * (PHP_5_0) - ext/mysqli/mysqli_api.c: - fix segfault when invalid field offset is passed to - mysqli_fetch_field_direct() - -2005-01-26 Derick Rethans - - * (PHP_4_3) - sapi/apache/config.m4 - sapi/apache/config.m4: - - MFH: There is no --with-apache2, only apxs2 - - * sapi/apache/config.m4: - - There is no --with-apache2, only apxs2 - -2005-01-26 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/var_unserializer.re: - MFH: Fixed bug #31699 (unserialize() float problem on non-English locales). - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - Fixed bug #31699 (unserialize() float problem on non-English locales). - - * (PHP_4_3) - NEWS - ext/standard/formatted_print.c: - MFH: Fixed bug #29733 (printf() handles repeated placeholders wrong). - - * (PHP_5_0) - NEWS - ext/standard/formatted_print.c: - Fixed bug #29733 (printf() handles repeated placeholders wrong). - (bugs dot php dot net at bluetwanger dot de, Ilia) - - * ext/standard/formatted_print.c: - Fixed bug #29733 (printf() handles repeated placeholders wrong). - - -2005-01-25 Andrei Zmievski - - * ext/standard/browscap.c: - Don't depend on empty_string. - -2005-01-25 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/pack.c: - MFH: Fixed bug #31465 (False warning in unpack() when working with *). - - * ext/standard/pack.c: - Fixed bug #31465 (False warning in unpack() when working with *). - -2005-01-25 Andrei Zmievski - - * (PHP_5_0) - NEWS - ext/standard/browscap.c - ext/standard/browscap.c - sapi/embed/php_embed.c - sapi/embed/php_embed.c: - MFB (Fix several egregious leaks in ext/browscap and sapi/embed). - - * (PHP_4_3) - NEWS - ext/standard/browscap.c - sapi/embed/php_embed.c: - Fix several egregious leaks in ext/browscap and sapi/embed. - -2005-01-25 Marcus Boerger - - * ext/sqlite/sqlite.c: - - Proto fix - -2005-01-25 Antony Dovgal - - * ext/imap/php_imap.c: - check body for NULL before using and prevent segfaults - -2005-01-25 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - ext/dio/dio.c - ext/dio/dio.c: - MFH: - Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings) - - * ext/dio/dio.c: - - Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings) - - * ZendEngine2/zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - - * (PHP_4_3) - acinclude.m4 - acinclude.m4: - MFH: - Fix macosx shared extension build - - * acinclude.m4: - - Fix macosx shared extension build - - * (PHP_4_3) - NEWS - NEWS - scripts/phpize.in - scripts/phpize.in: - MFH: - Return of the automake requirement - - * scripts/phpize.in: - - Return of the automake requirement. - - * (PHP_5_0) - NEWS: - order + typos - -2005-01-25 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #28041 (SOAP HTTP Digest Access Authentication was implemented) - -2005-01-25 Marcus Boerger - - * (PHP_5_0) - NEWS: - - BFN - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/zend_interfaces.c - ZendEngine2/tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * ZendEngine2/zend_interfaces.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * ZendEngine2/Makefile.frag: - - Fix dependency - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-25 Jani Taskinen - - * NEWS - NEWS - NEWS: - massage - -2005-01-24 Ilia Alshanetsky - - * (PHP_4_3) - main/rfc1867.c - main/rfc1867.c: - MFH: Use multibyte specific code for handling files and generic basename - based code in all other instances. - - * main/rfc1867.c: - Use multibyte specific code for handling files and generic basename based - code in all other instances. - - * (PHP_5_0) - ext/sysvmsg/sysvmsg.c: - Fixed compiler warning. - -2005-01-24 Marcus Boerger - - * (PHP_5_0) - NEWS - NEWS: - - BFN - - * (PHP_5_0) - NEWS: - - MFH fix for bug #31348 CachingIterator::rewind() leaks - - * ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/tests/bug30725.phpt: - - Second and last part of #30725 fix - - * ZendEngine2/zend_interfaces.c: - - Allow getIterator() to fail - - * ZendEngine2/tests/bug30725.phpt: - - - Add new test - - * NEWS: - - mysqli/sqlite changes - - * ext/sqlite/sqlite.c: - - Synch with MYSQLi extension and use RuntimeException as base for - SQLiteException if SPL is present. - -2005-01-24 Moriyoshi Koizumi - - * main/rfc1867.c: - - Revert irrelevant part. - -2005-01-24 Antony Dovgal - - * ext/sysvmsg/tests/002.phpt: - 1.1.4; - add test - - * ext/sysvmsg/sysvmsg.c: - fix msg_recieve() returning TRUE instead of FALSE when unserialize failed - (patch by Andrey Hristov) - -2005-01-24 Joe Orton - - * (PHP_4_3) - sapi/apache2handler/php_functions.c - sapi/apache2handler/php_functions.c: - MFH: Fixed regression #31645 - only flush before running the subrequest. - - * sapi/apache2handler/php_functions.c: - Fixed regression #31645 - only flush before running the subrequest. - -2005-01-23 Ilia Alshanetsky - - * (PHP_4_3) - ext/sysvshm/sysvshm.c: - Fixed compiler warning. - -2005-01-23 Sergey Kartashoff - - * ext/mnogosearch/php_mnogo.c - ext/mnogosearch/php_mnogo.c: - - A bug in mnogosearch module in ispell loading code was fixed - -2005-01-22 Jani Taskinen - - * (PHP_4_3) - Zend/zend.c - sapi/cli/php_cli.c: - MFH: - Memory leak fixes from ZE2 + HEAD CLI - - * (PHP_4_3) - Zend/Zend.m4 - Zend/configure.in - Zend/zend_strtod.c - ZendEngine2/Zend.m4 - ZendEngine2/configure.in - ZendEngine2/zend_strtod.c: - - Compile fix for systems without uint32_t typedef - - * (PHP_4_3) - scripts/phpize.in: - MFH: - Remove also autom4te.cache dir with phpize --clean - - * scripts/phpize.in - scripts/phpize.in: - - Remove also autom4te.cache dir with phpize --clean - - * (PHP_5_0) - ZendEngine2/Zend.m4 - ZendEngine2/configure.in - ZendEngine2/zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger - - * (PHP_5_0) - NEWS: - - BFN - - * ZendEngine2/zend_API.c - ZendEngine2/zend_API.h - ZendEngine2/zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans - - * ZendEngine2/zend_compile.c - ZendEngine2/zend_compile.h - ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-22 Jani Taskinen - - * (PHP_4_3) - acinclude.m4 - ext/dba/config.m4 - ext/mcrypt/config.m4: - MFH: - Typofix + removed unnecessary unsets caused by it - - * acinclude.m4 - acinclude.m4 - ext/dba/config.m4 - ext/dba/config.m4 - ext/mcrypt/config.m4 - ext/mcrypt/config.m4: - - Typofix + removed unnecessary unsets caused by it - - * (PHP_4_3) - NEWS - NEWS: - massage news - -2005-01-22 Andrei Zmievski - - * ext/exif/exif.c: - MFB (bugfix for 24851) - -2005-01-21 Andrei Zmievski - - * (PHP_5_0) - NEWS - ext/exif/exif.c: - MFB (bugfix for 28451) - - * (PHP_4_3) - NEWS: - -** empty log message *** - - * (PHP_4_3) - ext/exif/exif.c: - Protect against corrupt EXIF headers that feature unlimited IFD tag - nesting. - -2005-01-21 Stefan Esser - - * ext/session/session.c: - Correctly initialize ZVAL - -2005-01-21 Antony Dovgal - - * ext/imap/php_imap.c: - destruct return_value - -2005-01-21 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - Zend/zend_execute.c: - Fixed bug #28086 (crash inside overload() function). - -2005-01-20 Edin Kadribasic - - * (PHP_5_0) - ext/ldap/config.w32: - MFOB: Fixed bug #29492 - missing ldap_parse_reference() - - * (PHP_4_3) - ext/ldap/ldap.dsp: - Fixed bug #29492 - missing ldap_parse_reference() - -2005-01-20 Antony Dovgal - - * (PHP_4_3) - ext/imap/php_imap.c - ext/imap/php_imap.c: - fix error message =/ - - * (PHP_4_3) - NEWS - NEWS - ext/oci8/oci8.c - ext/oci8/oci8.c: - MFH: fix bug #31623 (OCILogin does not support password grace period) - - * ext/oci8/oci8.c: - fix bug #31623 (OCILogin does not support password grace period) - - * ext/imap/php_imap.c: - fix error message - - * ext/imap/php_imap.c: - fix segfault in imap_sort() - it segfaults when options is less than 0. - it looks like c-client bug, but we still need a workaround. - also, convert_to_string search criteria. - -2005-01-20 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/standard/string.c - main/rfc1867.c - main/rfc1867.c: - MFH: Fixed bug #31398 (When magic_guotes_gpc are enabled filenames with ' - get cutoff). - - * main/rfc1867.c: - Fixed bug #31398 (When magic_guotes_gpc are enabled filenames with ' - get cutoff). - -2005-01-20 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #30901 (can't send cookies with soap envelop). - void SoapClient::__setCookie(string name [, string value]) - -2005-01-20 Antony Dovgal - - * (PHP_4_3) - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: fix segfault in imap_headerinfo() when fromlength or subjectlength are - less than 0 - + fix protos - - * ext/imap/php_imap.c: - fix segfault in imap_headerinfo() when fromlength or subjectlength are less - than 0 - + fix protos - -2005-01-20 Dmitry Stogov - - * (PHP_5_0) - NEWS: - Fixed bug #31422 (No Error-Logging on SoapServer-Side). - -2005-01-20 Rob Richards - - * (PHP_5_0) - ext/dom/php_dom.c: - MFH: Fixed bug #28817 (Var problem when extending domDocument) - - * ext/dom/php_dom.c: - Fixed bug #28817 (Var problem when extending domDocument). - -2005-01-20 Antony Dovgal - - * (PHP_4_3) - ext/sysvsem/sysvsem.c - ext/sysvsem/sysvsem.c: - MFH: fix typos in error messages & resource name - - * ext/sysvshm/sysvshm.c: - fix typos in error messages - - * ext/sysvsem/sysvsem.c: - fix typos in error messages & resource name - -2005-01-20 Jani Taskinen - - * ZendEngine2/zend.h - ZendEngine2/zend_constants.c - ext/ncurses/ncurses_functions.c - sapi/cli/php_cli.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - - * (PHP_4_3) - NEWS - build/build2.mk - build/buildcheck.sh - build/libtool.m4 - scripts/Makefile.frag - scripts/phpize.in: - MFH: - Changed phpize not to require automake and libtool. (Jani) - MFH: - Fixed build system to always use bundled libtool files. (Jani) - MFH: - Rewrote of phpize routines - - * (PHP_5_0) - NEWS - build/build2.mk - build/buildcheck.sh - build/libtool.m4 - scripts/Makefile.frag - scripts/phpize.in: - MFH: - Changed phpize not to require automake and libtool. (Jani) - MFH: - Fixed build system to always use bundled libtool files. (Jani) - - * build/build2.mk - build/buildcheck.sh - scripts/Makefile.frag - scripts/phpize.in: - - Changed phpize not to require automake and libtool. - - Fixed build system to always use bundled libtool files. - - * scripts/phpize.m4: - - Add --with-libdir to phpized builds too - - * configure.in: - - Removed obsolete AC_PROG_RANLIB (AC_PROG_LIBTOOL does it) - - configure --help output cleanup for --with-libdir - -2005-01-19 Jani Taskinen - - * buildconf - build/build2.mk: - Added --debug option to buildconf - - * build/build2.mk - build/build2.mk - build/build2.mk - build/buildcheck.sh - build/buildcheck.sh - build/buildcheck.sh: - Revert the multiple autoconf versions patch - -2005-01-19 Ilia Alshanetsky - - * win32/sendmail.c: - Stricter cc header check. - -2005-01-19 Derick Rethans - - * build/libtool.m4: - - Add the patched libtool.m4 from snaps so that Jani can play with it. - -2005-01-19 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - NEWS: - BFN - - * (PHP_4_3) - win32/sendmail.c - win32/sendmail.c: - MFH: - Fixed bug #28976 (use From: from headers if sendmail_from is empty) - - * win32/sendmail.c: - - Fixed bug #28976 (use From: from headers if sendmail_from is empty) - - * acinclude.m4 - configure.in: - - Fix the pic patch - - * ZendEngine2/zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - - * (PHP_5_0) - run-tests.php: - MFH: - Fixed bug #29136 (make test - libtool failure on MacOSX) - - * run-tests.php: - - Fixed bug #29136 (make test - libtool failure on MacOSX) - -2005-01-19 Marcus Boerger - - * ZendEngine2/zend_ini_parser.y: - - Fix memleak - -2005-01-19 Jani Taskinen - - * (PHP_4_3) - ext/ldap/ldap.c: - MFH: - WS & CS fixes - MFH: - php_error -> php_error_docref - MFH: - Removed pointless checks (array_init, emalloc, etc.) - MFH: - Force ldapv3 for ldap_start_tls() - - * ext/ldap/ldap.c: - - ldap_start_tls() requires ldapv3 protocol -> force it - -2005-01-18 Ilia Alshanetsky - - * (PHP_4_3) - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: Fixed bug #31142 (crash, memory leak and data loss by - imap_mail_compose). - - * ext/imap/php_imap.c: - Fixed bug #31142 (crash, memory leak and data loss by imap_mail_compose). - -2005-01-18 Frank M. Kromann - - * ext/mssql/php_mssql.h: - Set the MSSQL_VERSION to FreeTDS when that lib is used - - * ext/mssql/config.w32: - Rename php_freetds.dll to php_dblib.dll (still using the freetds libs). - Allow the build of both versions in the same process - -2005-01-18 Antony Dovgal - - * (PHP_4_3) - ext/odbc/config.m4 - ext/odbc/config.m4: - MFH: add checks for libs & headers required by IBM DB2 - - * ext/odbc/config.m4: - add checks for libs & headers required by IBM DB2 - -2005-01-18 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). - - * ext/imap/php_imap.c: - Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). - - * (PHP_4_3) - NEWS - NEWS - ext/standard/string.c - ext/standard/string.c: - MFH: Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > - strlen). - - * ext/standard/string.c: - Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). - -2005-01-18 Jani Taskinen - - * (PHP_4_3) - ext/session/mod_files.c - ext/session/mod_files.c: - MFH: - Use FD_CLOEXEC with fcntl() and make sure it is always defined - - * ext/session/mod_files.c: - - Make sure FD_CLOEXEC is always defined. - -2005-01-18 Antony Dovgal - - * (PHP_4_3) - NEWS - NEWS - ext/odbc/php_odbc.c - ext/odbc/php_odbc.c: - MFH: fix bug #30430 (odbc_next_result() doesn't bind values and that - results in segfault) - fix protos - - * ext/odbc/php_odbc.c: - fix bug #30430 (odbc_next_result() doesn't bind values and that results in - segfault) - fix protos - -2005-01-18 Dmitry Stogov - - * ZendEngine2/zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - -2005-01-18 Jani Taskinen - - * tests/lang/bug30726.phpt: - - Sanitize output - - * ext/standard/tests/serialize/bug31402.phpt: - 1.1.4; - Add test for bug #31402 - -2005-01-18 Dmitry Stogov - - * (PHP_5_0) - NEWS: - changed title of the bugreport - -2005-01-18 Jani Taskinen - - * (PHP_4_3) - ext/standard/url_scanner_ex.c - ext/standard/var_unserializer.c: - - Files generated with re2c 0.9.2 - - * (PHP_4_3) - ext/standard/basic_functions.c - ext/standard/url_scanner_ex.re: - MFH: - Move hash table destruction to proper location - - * (PHP_5_0) - ext/standard/var_unserializer.c: - Touch generated file. - - * ext/standard/var_unserializer.c: - Touch the generated file. - -2005-01-18 Dmitry Stogov - - * ext/standard/basic_functions.c - ext/standard/tests/general_functions/bug31190.phpt: - Fixed bug #31190 (exceptions in call_user_func_array()) - - * ext/standard/tests/general_functions/bug31190.phpt - ext/standard/tests/general_functions/bug31190.phpt: - - file bug31190.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - NEWS - ext/standard/basic_functions.c: - Fixed bug #31190 (iexceptions in call_user_func_array()) - -2005-01-18 Magnus Määttä - - * (PHP_4_3) - tests/lang/bug30726.phpt - tests/lang/bug30726.phpt: - Add test case for bug #30726. - - * tests/lang/bug30726.phpt: - 1.1.4; - Add test case for bug #30726. - -2005-01-18 Dmitry Stogov - - * ZendEngine2/zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - NEWS - ZendEngine2/zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Frank M. Kromann - - * ext/mssql/config.w32: - use the static dblib.lib to avoid the need for extra dll's - - * ext/mssql/config.w32: - add --with-freetds option to win32 build. - TODO make it work when both mssql and freetds is included or bail out with - an error - - * ext/mssql/php_mssql.c - ext/mssql/php_mssql.h: - make the mssql extension work with freetds on win32 - -2005-01-18 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - Zend/zend_operators.h - ZendEngine2/zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * ZendEngine2/zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * (PHP_4_3) - NEWS - ext/standard/file.c: - Fixed bug #31580 (fgetcsv() problematic with "" escape sequences). - -2005-01-17 Antony Dovgal - - * ext/odbc/php_odbc.c: - fix weird DB2 issue: - DB2's SQLDataSources() returns _max available_ length of result string - instead of - _real_ length and that results in strings a-la "\0 " - -2005-01-17 Jani Taskinen - - * (PHP_4_3) - NEWS - Zend/zend_language_scanner.l: - MFZE2: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * (PHP_5_0) - NEWS - ZendEngine2/zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * ZendEngine2/zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * (PHP_4_3) - ext/gd/gd.c - ext/gd/gd.c: - MFH: - Added some sanity checks by changing to the parameter parsing API - - * ext/gd/gd.c: - - Added some sanity checks by changing to the parameter parsing API - -2005-01-17 Christian Stocker - - * (PHP_5_0) - ext/xsl/php_xsl.c - ext/xsl/php_xsl.h: - revert these 2 files... shouldn't have been comitted .. - - * ext/xsl/xsltprocessor.c: - fix protos (by Mehdi Achour ) - -2005-01-17 Antony Dovgal - - * ext/odbc/php_odbc.c: - fix leak appearing when odbc_errormsg() got invalid resource - -2005-01-17 Joe Orton - - * (PHP_4_3) - sapi/apache2handler/sapi_apache2.c - sapi/apache2handler/sapi_apache2.c: - MFH - Fixed bug #31519: Set r->status_line to SAPI-provided status-line. - - * sapi/apache2handler/sapi_apache2.c: - Fixed bug #31519: Set r->status_line to SAPI-provided status-line. - -2005-01-17 Stefan Esser - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re - ext/standard/var_unserializer.re: - Fix compiler warning. - -2005-01-16 Stefan Esser - - * (PHP_5_0) - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - if 2 of 3 tests are okay still do the 3rd test ! - -2005-01-16 Zak Greant - - * ext/mysqli/mysqli_driver.c - ext/mysqli/mysqli_embedded.c - ext/mysqli/mysqli_exception.c - ext/mysqli/mysqli_report.h - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h: - Added standard emacs and vim modelines - -2005-01-16 Moriyoshi Koizumi - - * (PHP_4_3) - ext/mbstring/mbstring.c: - - MFH: Fix a critical bug that request-local settings leak to another - request. - - * (PHP_5_0) - ext/mbstring/mb_gpc.c - ext/mbstring/mb_gpc.h - ext/mbstring/mbstring.c: - -MFH: Fix a critical bug that request-local settings leak to another - request. - - * ext/mbstring/mb_gpc.c - ext/mbstring/mb_gpc.h - ext/mbstring/mbstring.c: - - Fix a critical bug that request-local settings leak to another request. - -2005-01-16 Stanislav Malyshev - - * (PHP_4_3) - Zend/zend_execute.c: - another fix for overloaded objects - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - ZendEngine2/zend_API.c: - - Fix WS - -2005-01-15 Stefan Esser - - * ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - and use it... - - * TSRM/tsrm_virtual_cwd.c: - finally use what we calculated - - * ext/standard/php_var.h - ext/standard/var_unserializer.c - ext/standard/var_unserializer.re: - Restore unserialize() speed - -2005-01-15 Jani Taskinen - - * ext/standard/streamsfuncs.c: - CS fix - - * ext/gd/gd.c: - ws fix - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - ZendEngine2/zend_API.c: - - Change to using DL_UNLOAD macro. - - * ZendEngine2/zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS - ext/gd/gd.c - ext/gd/gd.c: - MFH: - Fixed bug #31060 (imageftbbox() does not use linespacing parameter) - - * ext/gd/gd.c: - - Fixed bug #31060 (imageftbbox() does not use linespacing parameter) - - * (PHP_4_3) - NEWS - NEWS - ext/gd/gd.c - ext/gd/gd.c: - MFH: - Fixed bug #30120 (imagettftext() and imagettfbbox() accept too many - parameters) - - * ext/gd/gd.c: - - Fixed bug #30120 (imagettftext() and imagettfbbox() accept too many - parameters) - - * (PHP_5_0) - main/php.h - sapi/apache_hooks/php_apache.c: - MFH: - Fix another generated header include - - * main/php.h - sapi/apache_hooks/php_apache.c: - - Fix another generated header include - -2005-01-14 Dmitry Stogov - - * ext/standard/streamsfuncs.c: - Fixed SIGSEGV in ext/standard/tests/network/tcp4loop.phpt and - ext/standard/tests/network/unixloop.phpt - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - ZendEngine2/tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - ext/standard/streamsfuncs.c: - Fixed SIGSEGV with ext/standard/tests/network/tcp4loop.phpt and - ext/standard/tests/network/unixloop.phpt - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-14 Jani Taskinen - - * (PHP_4_3) - NEWS: - BFN - -2005-01-13 Ard Biesheuvel - - * (PHP_4_3) - ext/interbase/interbase.c: - Fixed unregistered bug: corrupted 32-bit LONGs on 64-bit systems - -2005-01-13 Wez Furlong - - * (PHP_5_0) - acinclude.m4: - MFH the extension dep macro (which is a NOP) - so that pecl extensions with deps can build against head and 5.0.x - -2005-01-13 Dmitry Stogov - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-13 Wez Furlong - - * ext/odbc/config.m4 - ext/odbc/php_odbc.c - ext/odbc/php_odbc_includes.h: - Add support for ODBCRouter - -2005-01-12 Dmitry Stogov - - * ZendEngine2/zend_execute.c - ZendEngine2/zend_execute.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_opcodes.h - ZendEngine2/tests/bug31098.phpt - ZendEngine2/tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Rasmus Lerdorf - - * (PHP_4_3) - NEWS: - Should probably note this - -2005-01-11 Moriyoshi Koizumi - - * (PHP_5_0) - NEWS: - - I tend to write opposite things these days :P - - * (PHP_5_0) - ZendEngine2/zend_execute.c - ZendEngine2/tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * ZendEngine2/tests/bug31098.phpt - ZendEngine2/tests/bug31436.phpt: - - - Test renaming - - * ZendEngine2/zend_vm_execute.h - ZendEngine2/tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * NEWS - NEWS: - - BFN - - * ext/standard/html.c: - - Fix the fix :) - - * (PHP_4_3) - ext/standard/html.c: - - MFH: fix htmlentities() / html_decode_entity() UTF-8 related bugs - initially reported by Kamesh Jayachandrana - - * (PHP_5_0) - ext/standard/html.c - ext/standard/tests/strings/htmlentities17.phpt: - - MFH: fix htmlentities() / html_decode_entity() UTF-8 related bugs - initially reported by Kamesh Jayachandran - - * ext/standard/html.c - ext/standard/tests/strings/htmlentities17.phpt: - - Fix htmlentities() / html_decode_entity() UTF-8 related bugs - initially reported by Kamesh Jayachandran - - * ZendEngine2/zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-11 Joe Orton - - * (PHP_4_3) - NEWS - NEWS - sapi/apache2handler/php_functions.c - sapi/apache2handler/php_functions.c: - MFH: Fixed bug #30446 - virtual() includes files out of sequence, - work around 2.0 subrequest/internal redirect issue. - - * sapi/apache2handler/php_functions.c: - Fixed bug #30446 - virtual() includes files out of sequence, - work around 2.0 subrequest/internal redirect issue. - -2005-01-11 Jani Taskinen - - * sapi/cgi/cgi_main.c: - Fix ZTS build - -2005-01-11 Rob Richards - - * (PHP_5_0) - ext/dom/php_dom.c: - MFH: revert fix for bug #28817 - fix is bad - - * ext/dom/php_dom.c: - revert fix for bug #28817 - fix is bad - -2005-01-11 Jani Taskinen - - * (PHP_4_3) - ext/imap/config.m4 - ext/imap/config.m4 - ext/imap/php_imap.c - ext/imap/php_imap.c: - MFH: - Added check for IMAP 2004 versions - - * ext/imap/config.m4 - ext/imap/php_imap.c: - - Added check for IMAP 2005 version - -2005-01-10 Rasmus Lerdorf - - * ZendEngine2/zend.h - ZendEngine2/zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Antony Dovgal - - * ext/iconv/config.m4: - fix Konstantin's last name Chugeuv -> Chuguev - -2005-01-10 Rasmus Lerdorf - - * (PHP_4_3) - Zend/zend.h - Zend/zend_API.c: - Fixed shared extensions on OSX. We were using zend_mh_bundle_load to - load a shared extension, but dlclose() to unload it because it was - hardcoded. This caused problems for extensions loaded from php.ini - since the Apple linker does a symbol check on an unload and we hadn't - properly unloaded the shared extensions when Apache unloaded the parent - PHP shared library during its 2-pass load/unload/load startup routine. - By fixing the DL_UNLOAD macro and un-hardcoding the dlclose() call this - now works. - -2005-01-10 Jani Taskinen - - * (PHP_4_3) - ext/standard/tests/math/bug30069.phpt: - MFH: update test to include negative floats as strings too - - * ext/standard/tests/math/bug30069.phpt: - update test to include negative floats as strings too - - * (PHP_4_3) - NEWS - sapi/cgi/cgi_main.c: - MFH: - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr - stream). - - * (PHP_5_0) - NEWS - sapi/cgi/cgi_main.c: - - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr - stream). - (chris at ex-parrot dot com) - - * sapi/cgi/cgi_main.c: - - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr - stream). - - * ext/standard/php_parsedate.h - ext/standard/php_smart_str.h - ext/standard/php_smart_str_public.h - ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.h - ext/standard/url_scanner_ex.re: - Missing $Id$ tag - - * ext/standard/credits_ext.h - ext/standard/credits_sapi.h: - - Update credits - - * ChangeLog - ChangeLog.2004.gz: - - Compressed 2004 Changelog - - * ZendEngine2/header - ZendEngine2/zend_arg_defs.c - ZendEngine2/zend_strtod.c - ZendEngine2/zend_vm_def.h - ZendEngine2/zend_vm_execute.h - ZendEngine2/zend_vm_gen.php - ZendEngine2/zend_vm_opcodes.h: - - Added missing header sections. - -2005-01-10 Marcus Boerger - - * ext/sqlite/sqlite.c: - - Fix proto - - * ext/sqlite/sqlite.c: - - Bugfix #31342: SQLite OO interface with Exceptions (hugo dot pl at gmail - dot com) - - * ext/sqlite/php_sqlite.h - ext/sqlite/sqlite.c: - - Implement iterator interface in sqlite - -2005-01-10 Jani Taskinen - - * ZendEngine2/acinclude.m4 - ZendEngine2/configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - - * configure.in - configure.in - configure.in: - - The pic/no-pic patch by Joe Orton. - -2005-01-09 Jani Taskinen - - * (PHP_4_3) - configure.in: - Forgot this from the outside-source-dir patch - - * (PHP_4_3) - Zend/zend.h: - This was not supposed to be committed.. - - * (PHP_5_0) - configure.in - TSRM/TSRM.h - TSRM/TSRM.h - TSRM/tsrm_config_common.h - TSRM/tsrm_config_common.h - Zend/zend.h - ZendEngine2/zend.h - ext/bcmath/libbcmath/src/config.h - ext/bcmath/libbcmath/src/config.h - ext/gd/gdcache.c - ext/gd/gdcache.c - ext/gd/gdttf.c - ext/gd/gdttf.c - ext/mcve/mcve.c - ext/mcve/mcve.c - ext/odbc/birdstep.c - ext/odbc/birdstep.c - ext/pcre/pcrelib/internal.h - ext/pcre/pcrelib/internal.h - ext/sqlite/config.m4 - ext/standard/html.c - ext/standard/html.c - main/alloca.c - main/alloca.c - main/php_compat.h - main/php_compat.h - main/php_scandir.c - main/php_scandir.c - main/php_scandir.h - main/php_scandir.h - main/php_sprintf.c - main/php_syslog.h - main/php_syslog.h - sapi/cgi/libfcgi/include/fcgi_config.h - sapi/cgi/libfcgi/include/fcgi_config.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include to make sure the correct file is - used. - - * configure.in - TSRM/TSRM.h - TSRM/tsrm_config_common.h - ZendEngine2/zend.h - ext/bcmath/libbcmath/src/config.h - ext/gd/gdcache.c - ext/gd/gdttf.c - ext/mcve/mcve.c - ext/odbc/birdstep.c - ext/pcre/pcrelib/internal.h - ext/sqlite/config.m4 - ext/standard/html.c - main/alloca.c - main/php_compat.h - main/php_scandir.h - main/php_sprintf.c - main/php_syslog.h - sapi/cgi/libfcgi/include/fcgi_config.h: - - Fix outside-source-tree builds. Always include generated header files - with #include to make sure the correct file is used. - -2005-01-09 Antony Dovgal - - * (PHP_4_3) - NEWS: - BFN & end of cvs spam - - * (PHP_5_0) - NEWS: - BFN - - * ext/session/tests/bug31454.phpt - ext/session/tests/bug31454.phpt - ext/session/tests/bug31454.phpt: - add skipif section - - * ext/session/tests/bug31454.phpt: - 1.1.4; - add test for bug #31454 - - * ext/session/session.c: - efree(name) - - * ext/session/session.c: - fix bug #31454 (session_set_save_handler crashes PHP when supplied - non-existent object ref) - -2005-01-09 Jani Taskinen - - * (PHP_4_3) - Zend/zend_ini.c - Zend/zend_ini.h: - MFH: - Fix leak. (forgot from previous commit) - - * (PHP_4_3) - ext/standard/basic_functions.c - ext/standard/basic_functions.c - main/main.c - main/main.c - main/php_main.h - main/php_main.h: - MFH: - Fix leaks with registered shutdown functions. - - * ext/standard/basic_functions.c - main/main.c - main/php_main.h: - - Fix leaks with registered shutdown functions. - - * ZendEngine2/zend.c: - MFB: - Rationalize code a bit - - * (PHP_4_3) - Zend/zend.h: - MFZE2: Some cleanups - - * TODO - TODO: - Remove done stuff - -2005-01-08 Jani Taskinen - - * (PHP_4_3) - ext/standard/basic_functions.c - ext/standard/basic_functions.c: - MFH: - Fix possible crash (PR#26223). Leaks remain. - - * ext/standard/basic_functions.c: - - Fix possible crash (PR#26223). Leaks remain. - -2005-01-08 Georg Richter - - * ext/mysqli/mysqli_embedded.c - ext/mysqli/tests/connect.inc: - fixed compile bug under Windows (libmysql.def currently doesn't export - mysql_server_init/end). - Thanks to Sebastian Bergmann for reporting - -2005-01-08 Dmitry Stogov - - * TSRM/tsrm_virtual_cwd.c: - Unnecesary check was removed - -2005-01-08 Marcus Boerger - - * ext/standard/tests/serialize/bug31442.phpt: - - Add new test - - * ext/standard/tests/serialize/bug30234.phpt: - - Unify - - * ext/mysqli/mysqli_exception.c: - - Fix shared build - - * ext/mysqli/mysqli.c: - - Remove double destroy (which is definitively wrong and prevents php from - normal execution). - - * ext/dom/document.c: - - Fix dependency - -2005-01-08 Jani Taskinen - - * NEWS: - NN - - * ext/snmp/php_snmp.h - ext/snmp/snmp.c: - - Fix some memory leaks - -2005-01-07 Antony Dovgal - - * ext/standard/head.c: - remove duplicated include - -2005-01-07 Magnus Määttä - - * ext/posix/posix.c: - Argh.. Committed old patch. - Add safe_mode check and fix error code. - -2005-01-07 Antony Dovgal - - * acinclude.m4: - fix PHP_CHECK_64BIT macro (finally got 64bit machine to test it) - -2005-01-07 Georg Richter - - * ext/mysqli/mysqli.c: - forgot to remove some comments in last commit:( - -2005-01-07 Sebastian Bergmann - - * ext/mysqli/mysqli_exception.c: - ZTS fix. - - * ext/mysqli/config.w32: - Sync with config.m4. - -2005-01-07 Magnus Määttä - - * NEWS - ext/posix/php_posix.h - ext/posix/posix.c: - Added new function: posix_access() - Feature requests: #29615, #14924 - -2005-01-07 Georg Richter - - * NEWS: - new mysqli stuff - - * ext/mysqli/config.m4 - ext/mysqli/mysqli.c - ext/mysqli/mysqli_api.c - ext/mysqli/mysqli_driver.c - ext/mysqli/mysqli_embedded.c - ext/mysqli/mysqli_exception.c - ext/mysqli/mysqli_fe.c - ext/mysqli/mysqli_nonapi.c - ext/mysqli/mysqli_prop.c - ext/mysqli/mysqli_report.c - ext/mysqli/mysqli_warning.c - ext/mysqli/php_mysqli.h - ext/mysqli/tests/001.phpt - ext/mysqli/tests/014.phpt - ext/mysqli/tests/017.phpt - ext/mysqli/tests/033.phpt - ext/mysqli/tests/034.phpt - ext/mysqli/tests/041.phpt - ext/mysqli/tests/045.phpt - ext/mysqli/tests/047.phpt - ext/mysqli/tests/049.phpt - ext/mysqli/tests/061.phpt - ext/mysqli/tests/connect.inc - ext/mysqli/tests/skipif.inc - ext/mysqli/tests/skipifemb.inc: - Added new classes: - mysqli_driver - mysqli_warning - mysqli_exception - mysqli_sql_exception - - Improved embedded server support - changed testsuite to work also with embedded server - - Made statement and resultset classes extendable - - minor fixes - -2005-01-07 Anantha Kesari H Y - - * (PHP_5_0) - tests/classes/array_access_001.phpt - tests/classes/array_access_002.phpt - tests/classes/array_access_003.phpt - tests/classes/array_access_004.phpt: - removed skipif sections that check for the existence of ArrayAccess class - which is nomore a class but a interface.As the corresponding files in - PHP-5.1-HEAD had removed the SKIPIF blocks themselves, removing the same - for PHP5_0 branch also. - -2005-01-07 Jani Taskinen - - * (PHP_4_3) - NEWS - NEWS: - BFN - - * (PHP_4_3) - sapi/apache2filter/sapi_apache2.c - sapi/apache2filter/sapi_apache2.c: - MFH: - Fixed bug #31055 (apache2filter: per request leak proportional to - the full path of the request URI) - - * sapi/apache2filter/sapi_apache2.c: - - Fixed bug #31055 (apache2filter: per request leak proportional to the - full path of the request URI) - - * (PHP_4_3) - acinclude.m4 - acinclude.m4 - configure.in - configure.in - scripts/phpize.m4 - scripts/phpize.m4: - MFH: - Make sure $host_alias is never empty - - * acinclude.m4 - configure.in - scripts/phpize.m4: - - Make sure $host_alias is never empty - -2005-01-07 Wez Furlong - - * EXTENSIONS - EXTENSIONS - EXTENSIONS: - update by steph - -2005-01-06 Joe Orton - - * (PHP_4_3) - NEWS - NEWS - ext/curl/curl.c - ext/curl/interface.c: - MFH: - Fixed bug #31413 (curl POSTFIELDS crashes on 64-bit platforms). - -2005-01-06 Jani Taskinen - - * (PHP_5_0) - ext/session/mod_files.c: - Revert. This is always 1. - -2005-01-05 Joe Orton - - * ext/curl/interface.c: - Fix #31413: curl POSTFIELDS usage on 64-bit platforms. - -2005-01-05 Anantha Kesari H Y - - * (PHP_5_0) - ext/session/mod_files.c: - passing FD_CLOEXEC would be a standard way to pass argument to fcntl's last - argument than 1 - - * (PHP_5_0) - ext/ldap/ldap.c: - Removed redundant NEW_LIBC checks for NETWARE - - * (PHP_5_0) - ext/ftp/php_ftp.c: - Removed redundant NEW_LIBC checks for NetWare - - * (PHP_5_0) - ext/ftp/ftp.c: - Removed redundant NEW_LIBC checks - -2005-01-04 Frank M. Kromann - - * ext/gmp/config.w32: - Allow gmp to compile under Win32 - -2005-01-04 Wez Furlong - - * ext/standard/streamsfuncs.c: - Fix #31408: memory leak in stream_socket_recvfrom - -2005-01-04 Jani Taskinen - - * (PHP_4_3) - main/network.c - main/php_network.h: - - Fix bug #31403 (php_hostconnect not defined as PHPAPI) - - * (PHP_4_3) - NEWS - NEWS: - BFN - - * (PHP_4_3) - ext/gd/config.m4 - ext/gd/gd.c: - MFH: - Fixed bug #31396 (compile fails with gd 2.0.33 without freetype) - - * ext/gd/config.m4 - ext/gd/config.m4 - ext/gd/gd.c - ext/gd/gd.c: - - Fixed bug #31396 (compile fails with gd 2.0.33 without freetype) - -2005-01-04 Ilia Alshanetsky - - * (PHP_5_0) - ext/openssl/xp_ssl.c: - Fixed compiler warning resulting from an unused variable. - -2005-01-03 Stanislav Malyshev - - * ext/sqlite/libsqlite/src/auth.c - ext/sqlite/libsqlite/src/auth.c: - merge patch from http://www.sqlite.org/cvstrac/chngview?cn=1953 - bug led to PHP exiting on queries with unknown columns - - * (PHP_5_0) - ZendEngine2/zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * ZendEngine2/zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * (PHP_4_3) - Zend/zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky - - * (PHP_4_3) - NEWS - NEWS - Zend/zend_highlight.c - ZendEngine2/zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * ZendEngine2/zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2005-01-02 Rob Richards - - * ext/dom/document.c: - allow parser flags to be passed to xinclude() - - * (PHP_5_0) - NEWS: - BFN - -2005-01-02 Moriyoshi Koizumi - - * (PHP_4_3) - ext/standard/tests/array/bug29493.phpt - ext/standard/tests/array/bug29493.phpt - ext/standard/tests/array/bug31213.phpt - ext/standard/tests/array/bug31213.phpt: - - MFH: add testcases for bug #29493 and #31213. - - * ext/standard/tests/array/bug29493.phpt - ext/standard/tests/array/bug31213.phpt: - 1.1.4; - - Add testcases for bug #29493 and #31213. - -2005-01-01 Wez Furlong - - * (PHP_5_0) - ext/openssl/config0.m4: - Fix build here too - - * ext/openssl/config0.m4: - Fix build... diff --git a/ChangeLog.1999.gz b/ChangeLog.1999.gz deleted file mode 100644 index 9d92dda73f6ce..0000000000000 Binary files a/ChangeLog.1999.gz and /dev/null differ diff --git a/ChangeLog.2000.gz b/ChangeLog.2000.gz deleted file mode 100644 index 91cd3b2425c18..0000000000000 Binary files a/ChangeLog.2000.gz and /dev/null differ diff --git a/ChangeLog.2001.gz b/ChangeLog.2001.gz deleted file mode 100644 index 4f0a6f82414da..0000000000000 Binary files a/ChangeLog.2001.gz and /dev/null differ diff --git a/ChangeLog.2002.gz b/ChangeLog.2002.gz deleted file mode 100644 index 6a8c3bea44c32..0000000000000 Binary files a/ChangeLog.2002.gz and /dev/null differ diff --git a/ChangeLog.2003.gz b/ChangeLog.2003.gz deleted file mode 100644 index 0cb1d569b1acb..0000000000000 Binary files a/ChangeLog.2003.gz and /dev/null differ diff --git a/ChangeLog.2004.gz b/ChangeLog.2004.gz deleted file mode 100644 index b322d06930323..0000000000000 Binary files a/ChangeLog.2004.gz and /dev/null differ diff --git a/EXTENSIONS b/EXTENSIONS deleted file mode 100644 index e2cdcda83e20a..0000000000000 --- a/EXTENSIONS +++ /dev/null @@ -1,527 +0,0 @@ - List of PHP maintainers - ======================= - -Maintenance legend ------------------- - Supported: Someone is actually paid to look after this. - Maintained: Someone actually looks after it. - Odd Fixes: It has a maintainer but they don't have time to do - much other than throw the odd patch in. See below. - Orphan: No current maintainer [but maybe you could take the - role as you write your new code]. - Obsolete: Old code. Something tagged obsolete generally means - it has been replaced by a better system and you - should be using that. - Unknown: Not known at this time. - -Status legend -------------- - Working: Working under both Windows and Unix. - Windows: Working only under Windows. - Unix: Working only under Unix. - Experimental: Under development or initial release. - Not Working: Not working. - Unknown: Status unknown. - - -== Server APIs == - -------------------------------------------------------------------------------- -EXTENSION: aolserver -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: apache -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: apache_hooks -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: apache2filter -PRIMARY MAINTAINER: Aaron Bannert -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: apache2handler -PRIMARY MAINTAINER: Aaron Bannert -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: caudium -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: cgi -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: cli -MAINTENANCE: Marcus Boerger , Edin Kadribasic -STATUS: Working -SINCE: 4.3.0 -------------------------------------------------------------------------------- -EXTENSION: continuity -PRIMARY MAINTAINER: Alex Leigh -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: date -PRIMARY MAINTAINER: Derick Rethans -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: embed -PRIMARY MAINTAINER: Edin Kadribasic -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: isapi -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: milter -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: nsapi -PRIMARY MAINTAINER: Uwe Schindler -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: phttpd -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: pi3web -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: roxen -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: thttpd -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Odd fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: tux -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: webjames -PRIMARY MAINTAINER: Alex Waugh -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- - - -== Database extensions == - -------------------------------------------------------------------------------- -EXTENSION: dba -PRIMARY MAINTAINER: Marcus Börger -MAINTENANCE: Maintained -STATUS: Working -COMMENT: DBM abstraction for db2, db3, db4, dbm, ndbm, gdbm, ini -------------------------------------------------------------------------------- -EXTENSION: dbase -MAINTENANCE: Orphaned -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: dbx -PRIMARY MAINTAINER: Marc Boeren -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.6 -COMMENT: DB abstraction for odbc, mysql, pgsql, mssql, fbsql and more, see documentation -------------------------------------------------------------------------------- -EXTENSION: fbsql -PRIMARY MAINTAINER: Frank M. Kromann -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: informix -PRIMARY MAINTAINER: Danny Heijl -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: ingres_ii -PRIMARY MAINTAINER: David Hénot -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: interbase -PRIMARY MAINTAINER: Ard Biesheuvel , Jouni Ahto -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: msql -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mssql -PRIMARY MAINTAINER: Frank M. Kromann -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Tested on phpts and isapi versions -------------------------------------------------------------------------------- -EXTENSION: mysql -PRIMARY MAINTAINER: Zak Greant , Georg Richter -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mysqli -PRIMARY MAINTAINER: Georg Richter -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 5.0 -------------------------------------------------------------------------------- -EXTENSION: oci8 -PRIMARY MAINTAINER: Antony Dovgal -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: odbc -PRIMARY MAINTAINER: Daniel R. Kalowsky -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Working -------------------------------------------------------------------------------- -EXTENSION: oracle -MAINTENANCE: Orphaned -STATUS: Working -COMMENT: Using the new OCI8 driver is encouraged where possible. -------------------------------------------------------------------------------- -EXTENSION: ovrimos -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: pgsql -PRIMARY MAINTAINER: Marcus Boerger , Yasuo Ohgaki -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug. -------------------------------------------------------------------------------- -EXTENSION: sqlite -PRIMARY MAINTAINER: Marcus Boerger , Wez Furlong -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0 (Since 4.3.2 in PECL) -COMMENT: Integrates SQLite embeddable SQL database engine. -------------------------------------------------------------------------------- -EXTENSION: sybase -MAINTENANCE: Unknown -STATUS: Not Working -------------------------------------------------------------------------------- -EXTENSION: sybase_ct -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- - - -== XML extensions == - -------------------------------------------------------------------------------- -EXTENSION: dom -PRIMARY MAINTAINER: Christian Stocker , Rob Richards , Marcus Boerger -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0 -------------------------------------------------------------------------------- -EXTENSION: simplexml -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0 -------------------------------------------------------------------------------- -EXTENSION: soap -PRIMARY MAINTAINER: Dmitry Stogov -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: wddx -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: xml -PRIMARY MAINTAINER: Thies C. Arntzen -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: xmlrpc -PRIMARY MAINTAINER: Dan Libby -MAINTENANCE: UNKNOWN -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: xsl -PRIMARY MAINTAINER: Christian Stocker , Rob Richards -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0 -------------------------------------------------------------------------------- - - -== Other extensions == - -------------------------------------------------------------------------------- -EXTENSION: bcmath -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: bz2 -PRIMARY MAINTAINER: Hartmut Holzgraefe -MAINTENANCE: Odd Fixes -STATUS: Working -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: calendar -PRIMARY MAINTAINER: Hartmut Holzgraefe -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: com_dotnet -PRIMARY MAINTAINER: Wez Furlong -MAINTENANCE: Maintained -STATUS: Windows -SINCE: 5.0 -------------------------------------------------------------------------------- -EXTENSION: cpdf -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: ctype -PRIMARY MAINTAINER: Hartmut Holzgraefe -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: curl -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: exif -PRIMARY MAINTAINER: Marcus Boerger -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.2 -------------------------------------------------------------------------------- -EXTENSION: fam -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: fdf -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: filepro -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: ftp -PRIMARY MAINTAINER: Stefan Esser (sesser@php.net) -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: gd -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: gettext -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: gmp -MAINTENANCE: Unknown -STATUS: Unknown -SINCE: 4.0.4 -------------------------------------------------------------------------------- -EXTENSION: hwapi -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: iconv -PRIMARY MAINTAINER: Moriyoshi Koizumi -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: imap -PRIMARY MAINTAINER: Chuck Hagenbuch -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: ircg -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: ldap -PRIMARY MAINTAINER: Stig Venaas -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mbstring -PRIMARY MAINTAINER: Rui Hirokawa -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mcrypt -PRIMARY MAINTAINER: Derick Rethans -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mcve -PRIMARY MAINTAINER: Unknown -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: mhash -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mime_magic -PRIMARY MAINTAINER: Unknown -MAINTENANCE: Deprecated -STATUS: Experimental -COMMENT: Use PECL's fileinfo extension instead -------------------------------------------------------------------------------- -EXTENSION: ming -PRIMARY MAINTAINER: Frank M. Kromann -MAINTENANCE: Unknown -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: mnogosearch -PRIMARY MAINTAINER: Sergey Kartashoff -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: mono -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: msession -PRIMARY MAINTAINER Mark L. Woodward -MAINTENANCE: Maintained -STATUS: Working/Experimental -COMMENT: Tested on Linux, should work on other UNIX platforms. Backend server code can compile under Windows. -------------------------------------------------------------------------------- -EXTENSION: ncurses -PRIMARY MAINTAINER Ilia Alshanetsky , Wez Furlong , Hartmut Holzgraefe , Georg Richter -MAINTENANCE: Unknown -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: openssl -PRIMARY MAINTAINER: Wez Furlong -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.4 -------------------------------------------------------------------------------- -EXTENSION: pcntl -MAINTENANCE: Unknown -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: pcre -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: pfpro -PRIMARY MAINTAINER: David Croft -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: posix -PRIMARY MAINTAINER: Kristian Köhntopp -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: pspell -PRIMARY MAINTAINER: Vlad Krupin -MAINTENANCE: Unknown -STATUS: Unknown -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: readline -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: recode -PRIMARY MAINTAINER: Kristian Köhntopp -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: session -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: shmop -PRIMARY MAINTAINER: Ilia Alshanetsky -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: snmp -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: sockets -PRIMARY MAINTAINER: Chris Vandomelen -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: spl -PRIMARY MAINTAINER: Marcus Boerger -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0.0 -------------------------------------------------------------------------------- -EXTENSION: sysvmsg -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: sysvsem -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: sysvshm -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: tidy -PRIMARY MAINTAINER: John Coggeshall , Ilia Alshanetsky -MAINTENANCE: Maintained -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: tokenizer -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: yaz -PRIMARY MAINTAINER: Adam Dickmeiss -MAINTENANCE: Maintained -STATUS: Unknown -SINCE: 4.0.1 -------------------------------------------------------------------------------- -EXTENSION: zlib -PRIMARY MAINTAINER: Stefan Roehrich -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- diff --git a/INSTALL b/INSTALL deleted file mode 100644 index f305d0be8faca..0000000000000 --- a/INSTALL +++ /dev/null @@ -1,1535 +0,0 @@ - -Installing PHP - _________________________________________________________________ - - Table of Contents - Preface - 1. General Installation Considerations - 2. Installation on Unix systems - - Apache 1.3.x on Unix systems - Apache 2.0 on Unix systems - Caudium - fhttpd related notes - Sun, iPlanet and Netscape servers on Sun Solaris - CGI and commandline setups - HP-UX specific installation notes - OpenBSD installation notes - Solaris specific installation tips - Gentoo installation notes - - 3. Installation on Mac OS X - - Using Packages - Compiling for OS X Server - Compiling for MacOS X Client - - 4. Installation of PECL extensions - - Introduction to PECL Installations - Downloading PECL extensions - PECL for Windows users - Compiling shared PECL extensions with PEAR - Compiling shared PECL extensions with phpize - Compiling PECL extensions statically into PHP - - 5. Problems? - - Read the FAQ - Other problems - Bug reports - - 6. Runtime Configuration - - The configuration file - How to change configuration settings - _________________________________________________________________ - -Preface - - These installation instructions were generated from the HTML version - of the PHP Manual so formatting and linking have been altered. See the - online and updated version at: http://php.net/install.unix - _________________________________________________________________ - -Chapter 1. General Installation Considerations - - Before starting the installation, first you need to know what do you - want to use PHP for. There are three main fields you can use PHP, as - described in the What can PHP do? section: - - * Server-side scripting - * Command line scripting - * Client-side GUI applications - - For the first and most common form, you need three things: PHP itself, - a web server and a web browser. You probably already have a web - browser, and depending on your operating system setup, you may also - have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows). - You may also rent webspace at a company. This way, you don't need to - set up anything on your own, only write your PHP scripts, upload it to - the server you rent, and see the results in your browser. - - While setting up the server and PHP on your own, you have two choices - for the method of connecting PHP to the server. For many servers PHP - has a direct module interface (also called SAPI). These servers - include Apache, Microsoft Internet Information Server, Netscape and - iPlanet servers. Many other servers have support for ISAPI, the - Microsoft module interface (OmniHTTPd for example). If PHP has no - module support for your web server, you can always use it as a CGI or - FastCGI processor. This means you set up your server to use the CGI - executable of PHP to process all PHP file requests on the server. - - If you are also interested to use PHP for command line scripting (e.g. - write scripts autogenerating some images for you offline, or - processing text files depending on some arguments you pass to them), - you always need the command line executable. For more information, - read the section about writing command line PHP applications. In this - case, you need no server and no browser. - - With PHP you can also write desktop GUI applications using the PHP-GTK - extension. This is a completely different approach than writing web - pages, as you do not output any HTML, but manage windows and objects - within them. For more information about PHP-GTK, please visit the site - dedicated to this extension. PHP-GTK is not included in the official - PHP distribution. - - From now on, this section deals with setting up PHP for web servers on - Unix and Windows with server module interfaces and CGI executables. - You will also find information on the command line executable in the - following sections. - - PHP source code and binary distributions for Windows can be found at - http://www.php.net/downloads.php. We recommend you to choose a mirror - nearest to you for downloading the distributions. - _________________________________________________________________ - -Chapter 2. Installation on Unix systems - - This section will guide you through the general configuration and - installation of PHP on Unix systems. Be sure to investigate any - sections specific to your platform or web server before you begin the - process. - - As our manual outlines in the General Installation Considerations - section, we are mainly dealing with web centric setups of PHP in this - section, although we will cover setting up PHP for command line usage - as well. - - There are several ways to install PHP for the Unix platform, either - with a compile and configure process, or through various pre-packaged - methods. This documentation is mainly focused around the process of - compiling and configuring PHP. Many Unix like systems have some sort - of package installation system. This can assist in setting up a - standard configuration, but if you need to have a different set of - features (such as a secure server, or a different database driver), - you may need to build PHP and/or your webserver. If you are unfamiliar - with building and compiling your own software, it is worth checking to - see whether somebody has already built a packaged version of PHP with - the features you need. - - Prerequisite knowledge and software for compiling: - - * Basic Unix skills (being able to operate "make" and a C compiler) - * An ANSI C compiler - * flex: Version 2.5.4 - * bison: Version 1.28 (preferred), 1.35, or 1.75 - * A web server - * Any module specific components (such as gd, pdf libs, etc.) - - The initial PHP setup and configuration process is controlled by the - use of the commandline options of the configure script. You could get - a list of all available options along with short explanations running - ./configure --help. Our manual documents the different options - separately. You will find the core options in the appendix, while the - different extension specific options are descibed on the reference - pages. - - When PHP is configured, you are ready to build the module and/or - executables. The command make should take care of this. If it fails - and you can't figure out why, see the Problems section. - _________________________________________________________________ - -Apache 1.3.x on Unix systems - - This section contains notes and hints specific to Apache installs of - PHP on Unix platforms. We also have instructions and notes for Apache - 2 on a separate page. - - You can select arguments to add to the configure on line 10 below from - the list of core configure options and from extension specific options - described at the respective places in the manual. The version numbers - have been omitted here, to ensure the instructions are not incorrect. - You will need to replace the 'xxx' here with the correct values from - your files. - - Example 2-1. Installation Instructions (Apache Shared Module Version) - for PHP -1. gunzip apache_xxx.tar.gz -2. tar -xvf apache_xxx.tar -3. gunzip php-xxx.tar.gz -4. tar -xvf php-xxx.tar -5. cd apache_xxx -6. ./configure --prefix=/www --enable-module=so -7. make -8. make install -9. cd ../php-xxx - -10. Now, configure your PHP. This is where you customize your PHP - with various options, like which extensions will be enabled. Do a - ./configure --help for a list of available options. In our example - we'll do a simple configure with Apache 1 and MySQL support. Your - path to apxs may differ from our example. - - ./configure --with-mysql --with-apxs=/www/bin/apxs - -11. make -12. make install - - If you decide to change your configure options after installation, - you only need to repeat the last three steps. You only need to - restart apache for the new module to take effect. A recompile of - Apache is not needed. - - Note that unless told otherwise, 'make install' will also install PEAR, - various PHP tools such as phpize, install the PHP CLI, and more. - -13. Setup your php.ini file: - - cp php.ini-dist /usr/local/lib/php.ini - - You may edit your .ini file to set PHP options. If you prefer your - php.ini in another location, use --with-config-file-path=/some/path in - step 10. - - If you instead choose php.ini-recommended, be certain to read the list - of changes within, as they affect how PHP behaves. - -14. Edit your httpd.conf to load the PHP module. The path on the right hand - side of the LoadModule statement must point to the path of the PHP - module on your system. The make install from above may have already - added this for you, but be sure to check. - - For PHP 4: - - LoadModule php4_module libexec/libphp4.so - - For PHP 5: - - LoadModule php5_module libexec/libphp5.so - -15. And in the AddModule section of httpd.conf, somewhere under the - ClearModuleList, add this: - - For PHP 4: - - AddModule mod_php4.c - - For PHP 5: - - AddModule mod_php5.c - -16. Tell Apache to parse certain extensions as PHP. For example, - let's have Apache parse the .php extension as PHP. You could - have any extension(s) parse as PHP by simply adding more, with - each separated by a space. We'll add .phtml to demonstrate. - - AddType application/x-httpd-php .php .phtml - - It's also common to setup the .phps extension to show highlighted PHP - source, this can be done with: - - AddType application/x-httpd-php-source .phps - -17. Use your normal procedure for starting the Apache server. (You must - stop and restart the server, not just cause the server to reload by - using a HUP or USR1 signal.) - - Alternatively, to install PHP as a static object: - - Example 2-2. Installation Instructions (Static Module Installation for - Apache) for PHP -1. gunzip -c apache_1.3.x.tar.gz | tar xf - -2. cd apache_1.3.x -3. ./configure -4. cd .. - -5. gunzip -c php-4.x.y.tar.gz | tar xf - -6. cd php-4.x.y -7. ./configure --with-mysql --with-apache=../apache_1.3.x -8. make -9. make install - -10. cd ../apache_1.3.x - -11. ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a - (The above line is correct! Yes, we know libphp4.a does not exist at this - stage. It isn't supposed to. It will be created.) - -12. make - (you should now have an httpd binary which you can copy to your Apache bin -dir if - is is your first install then you need to "make install" as well) - -13. cd ../php-4.x.y -14. cp php.ini-dist /usr/local/lib/php.ini - -15. You can edit /usr/local/lib/php.ini file to set PHP options. - Edit your httpd.conf or srm.conf file and add: - AddType application/x-httpd-php .php - - Depending on your Apache install and Unix variant, there are many - possible ways to stop and restart the server. Below are some typical - lines used in restarting the server, for different apache/unix - installations. You should replace /path/to/ with the path to these - applications on your systems. - - Example 2-3. Example commands for restarting Apache -1. Several Linux and SysV variants: -/etc/rc.d/init.d/httpd restart - -2. Using apachectl scripts: -/path/to/apachectl stop -/path/to/apachectl start - -3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl: -/path/to/httpsdctl stop -/path/to/httpsdctl start - -4. Using mod_ssl, or another SSL server, you may want to manually -stop and start: -/path/to/apachectl stop -/path/to/apachectl startssl - - The locations of the apachectl and http(s)dctl binaries often vary. If - your system has locate or whereis or which commands, these can assist - you in finding your server control programs. - - Different examples of compiling PHP for apache are as follows: - - ./configure --with-apxs --with-pgsql - - This will create a libphp4.so shared library that is loaded into - Apache using a LoadModule line in Apache's httpd.conf file. The - PostgreSQL support is embedded into this libphp4.so library. - - ./configure --with-apxs --with-pgsql=shared - - This will create a libphp4.so shared library for Apache, but it will - also create a pgsql.so shared library that is loaded into PHP either - by using the extension directive in php.ini file or by loading it - explicitly in a script using the dl() function. - - ./configure --with-apache=/path/to/apache_source --with-pgsql - - This will create a libmodphp4.a library, a mod_php4.c and some - accompanying files and copy this into the src/modules/php4 directory - in the Apache source tree. Then you compile Apache using - --activate-module=src/modules/php4/libphp4.a and the Apache build - system will create libphp4.a and link it statically into the httpd - binary. The PostgreSQL support is included directly into this httpd - binary, so the final result here is a single httpd binary that - includes all of Apache and all of PHP. - - ./configure --with-apache=/path/to/apache_source --with-pgsql=shared - - Same as before, except instead of including PostgreSQL support - directly into the final httpd you will get a pgsql.so shared library - that you can load into PHP from either the php.ini file or directly - using dl(). - - When choosing to build PHP in different ways, you should consider the - advantages and drawbacks of each method. Building as a shared object - will mean that you can compile apache separately, and don't have to - recompile everything as you add to, or change, PHP. Building PHP into - apache (static method) means that PHP will load and run faster. For - more information, see the Apache webpage on DSO support. - - Note: Apache's default httpd.conf currently ships with a section - that looks like this: - -User nobody -Group "#-1" - - Unless you change that to "Group nogroup" or something like that - ("Group daemon" is also very common) PHP will not be able to open - files. - - Note: Make sure you specify the installed version of apxs when - using --with-apxs=/path/to/apxs. You must NOT use the apxs version - that is in the apache sources but the one that is actually - installed on your system. - _________________________________________________________________ - -Apache 2.0 on Unix systems - - This section contains notes and hints specific to Apache 2.0 installs - of PHP on Unix systems. - - Warning - - We do not recommend using a threaded MPM in production with Apache2. - Use the prefork MPM instead, or use Apache1. For information on why, - read the related FAQ entry on using Apache2 with a threaded MPM - - You are highly encouraged to take a look at the Apache Documentation - to get a basic understanding of the Apache 2.0 Server. - - PHP and Apache 2.0.x compatibility notes: The following versions of - PHP are known to work with the most recent version of Apache 2.0.x: - - * PHP 4.3.0 or later available at http://www.php.net/downloads.php. - * the latest stable development version. Get the source code - http://snaps.php.net/php4-latest.tar.gz or download binaries for - Windows http://snaps.php.net/win32/php4-win32-latest.zip. - * a prerelease version downloadable from http://qa.php.net/. - * you have always the option to obtain PHP through anonymous CVS. - - These versions of PHP are compatible to Apache 2.0.40 and later. - - Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works - with Apache 2.0.39, don't use any other version of Apache with PHP - 4.2.3. However, the recommended setup is to use PHP 4.3.0 or later - with the most recent version of Apache2. - - All mentioned versions of PHP will work still with Apache 1.3.x. - - Download the most recent version of Apache 2.0 and a fitting PHP - version from the above mentioned places. This quick guide covers only - the basics to get started with Apache 2.0 and PHP. For more - information read the Apache Documentation. The version numbers have - been omitted here, to ensure the instructions are not incorrect. You - will need to replace the 'NN' here with the correct values from your - files. - - Example 2-4. Installation Instructions (Apache 2 Shared Module - Version) -1. gzip -d httpd-2_0_NN.tar.gz -2. tar xvf httpd-2_0_NN.tar -3. gunzip php-NN.tar.gz -4. tar -xvf php-NN.tar -5. cd httpd-2_0_NN -6. ./configure --enable-so -7. make -8. make install - - Now you have Apache 2.0.NN available under /usr/local/apache2, - configured with loadable module support and the standard MPM prefork. - To test the installation use your normal procedure for starting - the Apache server, e.g.: - /usr/local/apache2/bin/apachectl start - and stop the server to go on with the configuration for PHP: - /usr/local/apache2/bin/apachectl stop. - -9. cd ../php-NN - -10. Now, configure your PHP. This is where you customize your PHP - with various options, like which extensions will be enabled. Do a - ./configure --help for a list of available options. In our example - we'll do a simple configure with Apache 2 and MySQL support. Your - path to apxs may differ, in fact, the binary may even be named apxs2 on - your system. - - ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql - -11. make -12. make install - - If you decide to change your configure options after installation, - you only need to repeat the last three steps. You only need to - restart apache for the new module to take effect. A recompile of - Apache is not needed. - - Note that unless told otherwise, 'make install' will also install PEAR, - various PHP tools such as phpize, install the PHP CLI, and more. - -13. Setup your php.ini - - cp php.ini-dist /usr/local/lib/php.ini - - You may edit your .ini file to set PHP options. If you prefer having - php.ini in another location, use --with-config-file-path=/some/path in - step 10. - - If you instead choose php.ini-recommended, be certain to read the list - of changes within, as they affect how PHP behaves. - -14. Edit your httpd.conf to load the PHP module. The path on the right hand - side of the LoadModule statement must point to the path of the PHP - module on your system. The make install from above may have already - added this for you, but be sure to check. - - For PHP 4: - - LoadModule php4_module libexec/libphp4.so - - For PHP 5: - - LoadModule php5_module libexec/libphp5.so - -15. Tell Apache to parse certain extensions as PHP. For example, - let's have Apache parse the .php extension as PHP. You could - have any extension(s) parse as PHP by simply adding more, with - each separated by a space. We'll add .phtml to demonstrate. - - AddType application/x-httpd-php .php .phtml - - It's also common to setup the .phps extension to show highlighted PHP - source, this can be done with: - - AddType application/x-httpd-php-source .phps - -16. Use your normal procedure for starting the Apache server, e.g.: - - /usr/local/apache2/bin/apachectl start - - Following the steps above you will have a running Apache 2.0 with - support for PHP as SAPI module. Of course there are many more - configuration options available for both, Apache and PHP. For more - information use ./configure --help in the corresponding source tree. - In case you wish to build a multithreaded version of Apache 2.0 you - must overwrite the standard MPM-Module prefork either with worker or - perchild. To do so append to your configure line in step 6 above - either the option --with-mpm=worker or --with-mpm=perchild. Take care - about the consequences and understand what you are doing. For more - information read the Apache documentation about the MPM-Modules. - - Note: If you want to use content negotiation, read the Apache - MultiViews FAQ. - - Note: To build a multithreaded version of Apache your system must - support threads. This also implies to build PHP with experimental - Zend Thread Safety (ZTS). Therefore not all extensions might be - available. The recommended setup is to build Apache with the - standard prefork MPM-Module. - _________________________________________________________________ - -Caudium - - PHP 4 can be built as a Pike module for the Caudium webserver. Note - that this is not supported with PHP 3. Follow the simple instructions - below to install PHP 4 for Caudium. - - Example 2-5. Caudium Installation Instructions -1. Make sure you have Caudium installed prior to attempting to - install PHP 4. For PHP 4 to work correctly, you will need Pike - 7.0.268 or newer. For the sake of this example we assume that - Caudium is installed in /opt/caudium/server/. -2. Change directory to php-x.y.z (where x.y.z is the version number). -3. ./configure --with-caudium=/opt/caudium/server -4. make -5. make install -6. Restart Caudium if it's currently running. -7. Log into the graphical configuration interface and go to the - virtual server where you want to add PHP 4 support. -8. Click Add Module and locate and then add the PHP 4 Script Support module. -9. If the documentation says that the 'PHP 4 interpreter isn't - available', make sure that you restarted the server. If you did - check /opt/caudium/logs/debug/default.1 for any errors related to - PHP4.so. Also make sure that - caudium/server/lib/[pike-version]/PHP4.so - is present. -10. Configure the PHP Script Support module if needed. - - You can of course compile your Caudium module with support for the - various extensions available in PHP 4. See the reference pages for - extension specific configure options. - - Note: When compiling PHP 4 with MySQL support you must make sure - that the normal MySQL client code is used. Otherwise there might be - conflicts if your Pike already has MySQL support. You do this by - specifying a MySQL install directory the --with-mysql option. - _________________________________________________________________ - -fhttpd related notes - - To build PHP as an fhttpd module, answer "yes" to "Build as an fhttpd - module?" (the --with-fhttpd=DIR option to configure) and specify the - fhttpd source base directory. The default directory is - /usr/local/src/fhttpd. If you are running fhttpd, building PHP as a - module will give better performance, more control and remote execution - capability. - - Note: Support for fhttpd is no longer available as of PHP 4.3.0. - _________________________________________________________________ - -Sun, iPlanet and Netscape servers on Sun Solaris - - This section contains notes and hints specific to Sun Java System Web - Server, Sun ONE Web Server, iPlanet and Netscape server installs of - PHP on Sun Solaris. - - From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to - generate custom directory listings and error pages. Additional - functions for Apache compatibility are also available. For support in - current webservers read the note about subrequests. - - You can find more information about setting up PHP for the Netscape - Enterprise Server (NES) here: - http://benoit.noss.free.fr/php/install-php4.html - - To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape webservers, - enter the proper install directory for the --with-nsapi=[DIR] option. - The default directory is usually /opt/netscape/suitespot/. Please also - read /php-xxx-version/sapi/nsapi/nsapi-readme.txt. - - 1. Install the following packages from http://www.sunfreeware.com/ or - another download site: - - autoconf-2.13 - automake-1.4 - bison-1_25-sol26-sparc-local - flex-2_5_4a-sol26-sparc-local - gcc-2_95_2-sol26-sparc-local - gzip-1.2.4-sol26-sparc-local - m4-1_4-sol26-sparc-local - make-3_76_1-sol26-sparc-local - mysql-3.23.24-beta (if you want mysql support) - perl-5_005_03-sol26-sparc-local - tar-1.13 (GNU tar) - 2. Make sure your path includes the proper directories - PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin and make it - available to your system export PATH. - 3. gunzip php-x.x.x.tar.gz (if you have a .gz dist, otherwise go to - 4). - 4. tar xvf php-x.x.x.tar - 5. Change to your extracted PHP directory: cd ../php-x.x.x - 6. For the following step, make sure /opt/netscape/suitespot/ is - where your netscape server is installed. Otherwise, change to the - correct path and run: - -./configure --with-mysql=/usr/local/mysql \ ---with-nsapi=/opt/netscape/suitespot/ \ ---enable-libgcc - - 7. Run make followed by make install. - - After performing the base install and reading the appropriate readme - file, you may need to perform some additional configuration steps. - - Configuration Instructions for Sun/iPlanet/Netscape. Firstly you may - need to add some paths to the LD_LIBRARY_PATH environment for the - server to find all the shared libs. This can best done in the start - script for your webserver. The start script is often located in: - /path/to/server/https-servername/start. You may also need to edit the - configuration files that are located in: - /path/to/server/https-servername/config/. - - 1. Add the following line to mime.types (you can do that by the - administration server): - -type=magnus-internal/x-httpd-php exts=php - - 2. Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6) - and add the following, shlib will vary depending on your system, - it will be something like /opt/netscape/suitespot/bin/libphp4.so. - You should place the following lines after mime types init. - -Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="/o -pt/netscape/suitespot/bin/libphp4.so" -Init fn="php4_init" LateInit="yes" errorString="Failed to initialize PHP!" [php -_ini="/path/to/php.ini"] - - (PHP >= 4.3.3) The php_ini parameter is optional but with it you - can place your php.ini in your webserver config directory. - 3. Configure the default object in obj.conf (for virtual server - classes [version 6.0+] in their vserver.obj.conf): - - -. -. -. -.#NOTE this next line should happen after all 'ObjectType' and before all 'AddL -og' lines -Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inik -ey=value ...] -. -. - - - (PHP >= 4.3.3) As additional parameters you can add some special - php.ini-values, for example you can set a - docroot="/path/to/docroot" specific to the context php4_execute is - called. For boolean ini-keys please use 0/1 as value, not - "On","Off",... (this will not work correctly), e.g. - zlib.output_compression=1 instead of zlib.output_compression="On" - 4. This is only needed if you want to configure a directory that only - consists of PHP scripts (same like a cgi-bin directory): - - -ObjectType fn="force-type" type="magnus-internal/x-httpd-php" -Service fn=php4_execute [inikey=value inikey=value ...] - - - After that you can configure a directory in the Administration - server and assign it the style x-httpd-php. All files in it will - get executed as PHP. This is nice to hide PHP usage by renaming - files to .html. - 5. Setup of authentication: PHP authentication cannot be used with - any other authentication. ALL AUTHENTICATION IS PASSED TO YOUR PHP - SCRIPT. To configure PHP Authentication for the entire server, add - the following line to your default object: - - -AuthTrans fn=php4_auth_trans -. -. -. - - - 6. To use PHP Authentication on a single directory, add the - following: - - -AuthTrans fn=php4_auth_trans - - - Note: The stacksize that PHP uses depends on the configuration of - the webserver. If you get crashes with very large PHP scripts, it - is recommended to raise it with the Admin Server (in the section - "MAGNUS EDITOR"). - _________________________________________________________________ - -CGI environment and recommended modifications in php.ini - - Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE - WS/iPlanet/Netscape is a multithreaded web server. Because of that all - requests are running in the same process space (the space of the - webserver itself) and this space has only one environment. If you want - to get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the - correct way to try this in the old PHP 3.x way with getenv() or a - similar way (register globals to environment, $_ENV). You would only - get the environment of the running webserver without any valid CGI - variables! - - Note: Why are there (invalid) CGI variables in the environment? - - Answer: This is because you started the webserver process from the - admin server which runs the startup script of the webserver, you - wanted to start, as a CGI script (a CGI script inside of the admin - server!). This is why the environment of the started webserver has - some CGI environment variables in it. You can test this by starting - the webserver not from the administration server. Use the command - line as root user and start it manually - you will see there are no - CGI-like environment variables. - - Simply change your scripts to get CGI variables in the correct way for - PHP 4.x by using the superglobal $_SERVER. If you have older scripts - which use $HTTP_HOST, etc., you should turn on register_globals in - php.ini and change the variable order too (important: remove "E" from - it, because you do not need the environment here): -variables_order = "GPCS" -register_globals = On - _________________________________________________________________ - -Special use for error pages or self-made directory listings (PHP >= 4.3.3) - - You can use PHP to generate the error pages for "404 Not Found" or - similar. Add the following line to the object in obj.conf for every - error page you want to overwrite: -Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value ini -key=value...] - - where XXX is the HTTP error code. Please delete any other Error - directives which could interfere with yours. If you want to place a - page for all errors that could exist, leave the code parameter out. - Your script can get the HTTP status code with $_SERVER['ERROR_TYPE']. - - Another possibility is to generate self-made directory listings. Just - create a PHP script which displays a directory listing and replace the - corresponding default Service line for - type="magnus-internal/directory" in obj.conf with the following: -Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scr -ipt.php" [inikey=value inikey=value...] - - For both error and directory listing pages the original URI and - translated URI are in the variables $_SERVER['PATH_INFO'] and - $_SERVER['PATH_TRANSLATED']. - _________________________________________________________________ - -Note about nsapi_virtual() and subrequests (PHP >= 4.3.3) - - The NSAPI module now supports the nsapi_virtual() function (alias: - virtual()) to make subrequests on the webserver and insert the result - in the webpage. This function uses some undocumented features from the - NSAPI library. On Unix the module automatically looks for the needed - functions and uses them if available. If not, nsapi_virtual() is - disabled. - - Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!! - _________________________________________________________________ - -CGI and commandline setups - - The default is to build PHP as a CGI program. This creates a - commandline interpreter, which can be used for CGI processing, or for - non-web-related PHP scripting. If you are running a web server PHP has - module support for, you should generally go for that solution for - performance reasons. However, the CGI version enables users to run - different PHP-enabled pages under different user-ids. - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - As of PHP 4.3.0, some important additions have happened to PHP. A new - SAPI named CLI also exists and it has the same name as the CGI binary. - What is installed at {PREFIX}/bin/php depends on your configure line - and this is described in detail in the manual section named Using PHP - from the command line. For further details please read that section of - the manual. - _________________________________________________________________ - -Testing - - If you have built PHP as a CGI program, you may test your build by - typing make test. It is always a good idea to test your build. This - way you may catch a problem with PHP on your platform early instead of - having to struggle with it later. - _________________________________________________________________ - -Benchmarking - - If you have built PHP 3 as a CGI program, you may benchmark your build - by typing make bench. Note that if safe mode is on by default, the - benchmark may not be able to finish if it takes longer then the 30 - seconds allowed. This is because the set_time_limit() can not be used - in safe mode. Use the max_execution_time configuration setting to - control this time for your own scripts. make bench ignores the - configuration file. - - Note: make bench is only available for PHP 3. - _________________________________________________________________ - -Using Variables - - Some server supplied environment variables are not defined in the - current CGI/1.1 specification. Only the following variables are - defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, - GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, - REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD, - SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PROTOCOL, and - SERVER_SOFTWARE. Everything else should be treated as 'vendor - extensions'. - _________________________________________________________________ - -HP-UX specific installation notes - - This section contains notes and hints specific to installing PHP on - HP-UX systems. (Contributed by paul_mckay at clearwater-it dot co dot - uk). - - Note: These tips were written for PHP 4.0.4 and Apache 1.3.9. - - 1. You need gzip, download a binary distribution from - http://hpux.connect.org.uk/ftp/hpux/Gnu/gzip-1.2.4a/gzip-1.2.4a-sd - -10.20.depot.Z uncompress the file and install using swinstall. - 2. You need gcc, download a binary distribution from - http://gatekeep.cs.utah.edu/ftp/hpux/Gnu/gcc-2.95.2/gcc-2.95.2-sd- - 10.20.depot.gz. uncompress this file and install gcc using - swinstall. - 3. You need the GNU binutils, you can download a binary distribution - from - http://hpux.connect.org.uk/ftp/hpux/Gnu/binutils-2.9.1/binutils-2. - 9.1-sd-10.20.depot.gz. uncompress this file and install binutils - using swinstall. - 4. You now need bison, you can download a binary distribution from - http://hpux.connect.org.uk/ftp/hpux/Gnu/bison-1.28/bison-1.28-sd-1 - 0.20.depot.gz, install as above. - 5. You now need flex, you need to download the source from one of the - http://www.gnu.org mirrors. It is in the non-gnu directory of the - ftp site. Download the file, gunzip, then tar -xvf it. Go into the - newly created flex directory and run ./configure, followed by - make, and then make install. - If you have errors here, it's probably because gcc etc. are not in - your PATH so add them to your PATH. - 6. Download the PHP and apache sources. - 7. gunzip and tar -xvf them. We need to hack a couple of files so - that they can compile OK. - 8. Firstly the configure file needs to be hacked because it seems to - lose track of the fact that you are a hpux machine, there will be - a better way of doing this but a cheap and cheerful hack is to put - lt_target=hpux10.20 on line 47286 of the configure script. - 9. Next, the Apache GuessOS file needs to be hacked. Under - apache_1.3.9/src/helpers change line 89 from echo - "hp${HPUXMACH}-hpux${HPUXVER}"; exit 0 to: echo - "hp${HPUXMACH}-hp-hpux${HPUXVER}"; exit 0 - 10. You cannot install PHP as a shared object under HP-UX so you must - compile it as a static, just follow the instructions at the Apache - page. - 11. PHP and Apache should have compiled OK, but Apache won't start. - you need to create a new user for Apache, e.g. www, or apache. You - then change lines 252 and 253 of the conf/httpd.conf in Apache so - that instead of - -User nobody -Group nogroup - - you have something like - -User www -Group sys - - This is because you can't run Apache as nobody under hp-ux. Apache - and PHP should then work. - _________________________________________________________________ - -OpenBSD installation notes - - This section contains notes and hints specific to installing PHP on - OpenBSD 3.6. - _________________________________________________________________ - -Using Binary Packages - - Using binary packages to install PHP on OpenBSD is the recommended and - simplest method. The core package has been separated from the various - modules, and each can be installed and removed independently from the - others. The files you need can be found on your OpenBSD CD or on the - FTP site. - - The main package you need to install is php4-core-4.3.8.tgz, which - contains the basic engine (plus gettext and iconv). Next, take a look - at the module packages, such as php4-mysql-4.3.8.tgz or - php4-imap-4.3.8.tgz. You need to use the phpxs command to activate and - deactivate these modules in your php.ini. - - Example 2-6. OpenBSD Package Install Example -# pkg_add php4-core-4.3.8.tgz -# /usr/local/sbin/phpxs -s -# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini - (add in mysql) -# pkg_add php4-mysql-4.3.8.tgz -# /usr/local/sbin/phpxs -a mysql - (add in imap) -# pkg_add php4-imap-4.3.8.tgz -# /usr/local/sbin/phpxs -a imap - (remove mysql as a test) -# pkg_delete php4-mysql-4.3.8 -# /usr/local/sbin/phpxs -r mysql - (install the PEAR libraries) -# pkg_add php4-pear-4.3.8.tgz - - Read the packages(7) manual page for more information about binary - packages on OpenBSD. - _________________________________________________________________ - -Using Ports - - You can also compile up PHP from source using the ports tree. However, - this is only recommended for users familiar with OpenBSD. The PHP 4 - port is split into two sub-directories: core and extensions. The - extensions directory generates sub-packages for all of the supported - PHP modules. If you find you do not want to create some of these - modules, use the no_* FLAVOR. For example, to skip building the imap - module, set the FLAVOR to no_imap. - _________________________________________________________________ - -Common Problems - - * The default install of Apache runs inside a chroot(2) jail, which - will restrict PHP scripts to accessing files under /var/www. You - will therefore need to create a /var/www/tmp directory for PHP - session files to be stored, or use an alternative session backend. - In addition, database sockets need to be placed inside the jail or - listen on the localhost interface. If you use network functions, - some files from /etc such as /etc/resolv.conf and /etc/services - will need to be moved into /var/www/etc. The OpenBSD PEAR package - automatically installs into the correct chroot directories, so no - special modification is needed there. More information on the - OpenBSD Apache is available in the OpenBSD FAQ. - * The OpenBSD 3.6 package for the gd extension requires XFree86 to - be installed. If you do not wish to use some of the font features - that require X11, install the php4-gd-4.3.8-no_x11.tgz package - instead. - _________________________________________________________________ - -Older Releases - - Older releases of OpenBSD used the FLAVORS system to compile up a - statically linked PHP. Since it is hard to generate binary packages - using this method, it is now deprecated. You can still use the old - stable ports trees if you wish, but they are unsupported by the - OpenBSD team. If you have any comments about this, the current - maintainer for the port is Anil Madhavapeddy (avsm at openbsd dot - org). - _________________________________________________________________ - -Solaris specific installation tips - - This section contains notes and hints specific to installing PHP on - Solaris systems. - _________________________________________________________________ - -Required software - - Solaris installs often lack C compilers and their related tools. Read - this FAQ for information on why using GNU versions for some of these - tools is necessary. The required software is as follows: - - * gcc (recommended, other C compilers may work) - * make - * flex - * bison - * m4 - * autoconf - * automake - * perl - * gzip - * tar - * GNU sed - - In addition, you will need to install (and possibly compile) any - additional software specific to your configuration, such as Oracle or - MySQL. - _________________________________________________________________ - -Using Packages - - You can simplify the Solaris install process by using pkgadd to - install most of your needed components. - _________________________________________________________________ - -Gentoo installation notes - - This section contains notes and hints specific to installing PHP on - Gentoo Linux. - _________________________________________________________________ - -Using Portage (emerge) - - While you can just download the PHP source and compile it yourself, - using Gentoo's packaging system is the simplest and cleanest method of - installing PHP. If you are not familiar with building software on - Linux, this is the way to go. - - If you have built your Gentoo system so far, you are probably used to - Portage already. Installing Apache and PHP is no different than the - other system tools. - - The first decision you need to make is whether you want to install - Apache 1.3.x or Apache 2.x. While both can be used with PHP, the steps - given below will use Apache 1.3.x. Another thing to consider is - whether your local Portage tree is up to date. If you have not updated - it recently, you need to run emerge sync before anything else. This - way, you will be using the most recent stable version of Apache and - PHP. - - Now that everything is in place, you can use the following example to - install Apache and PHP: - - Example 2-7. Gentoo Install Example with Apache 1.3 -# emerge \/mod_php-.ebuild config -# nano /etc/conf.d/apache - Add "-D PHP4" to APACHE_OPTS - -# rc-update add apache default -# /etc/init.d/apache start - - You can read more about emerge in the excellent Portage Manual - provided on the Gentoo website. - - If you need to use Apache 2, you can simply use emerge apache in the - last example. - _________________________________________________________________ - -Better control on configuration - - In the last section, PHP was emerged without any activated modules. As - of this writing, the only module activated by default with Portage is - XML which is needed by PEAR. This may not be what you want and you - will soon discover that you need more activated modules, like MySQL, - gettext, GD, etc. - - When you compile PHP from source yourself, you need to activate - modules via the configure command. With Gentoo, you can simply provide - USE flags which will be passed to the configure script automatically. - To see which USE flags to use with emerge, you can try: - - Example 2-8. Getting the list of valid USE flags -# USE="-*" emerge -pv php - -[ebuild N ] dev-php/php-4.3.6-r1 -X -berkdb -crypt -curl -debug -doc --fdftk -firebird -flash -freetds -gd -gd-external -gdbm -gmp -hardenedphp --imap -informix -ipv6 -java -jpeg -kerberos -ldap -mcal -memlimit -mssql --mysql -ncurses -nls -oci8 -odbc -pam -pdflib -png -postgres -qt -readline --snmp -spell -ssl -tiff -truetype -xml2 -yaz 3,876 kB - - As you can see from the last output, PHP considers a lot of USE flags. - Look at them closely and choose what you need. If you choose a flag - and you do not have the proper libraries, Portage will compile them - for you. It is a good idea to use emerge -pv again to see what Portage - will compile in accordance to your USE flags. As an example, if you do - not have X installed and you choose to include X in the USE flags, - Portage will compile X prior to PHP, which can take a couple of hours. - - If you choose to compile PHP with MySQL, cURL and GD support, the - command will look something like this: - - Example 2-9. Install PHP with USE flags - # USE="-* curl mysql gd" emerge php mod_php - - As in the last example, do not forget to emerge php as well as - mod_php. php is responsible for the command line version of PHP as - mod_php is for the Apache module version of PHP. - _________________________________________________________________ - -Common Problems - - * If you see the PHP source instead of the result the script should - produce, you have probably forgot to edit /etc/conf.d/apache. - Apache needs to be started with the -D PHP4 flag. To see if the - flag is present, you should be able to see it when using ps ax | - grep apache while Apache is running. - * Due to slotting problems, you might end up with more than one - version of PHP installed on your system. If this is the case, you - need to unmerge the old versions manually by using emerge unmerge - mod_php-. - * If you cannot emerge PHP because of Java, try putting -* in front - of your USE flags like in the above examples. - * If you are having problems configuring Apache and PHP, you can - always search the Gentoo Forums. Try searching with the keywords - "Apache PHP". - _________________________________________________________________ - -Chapter 3. Installation on Mac OS X - - This section contains notes and hints specific to installing PHP on - Mac OS X. There are two slightly different versions of Mac OS X, - Client and Server, our manual deals with installing PHP on both - systems. Note that PHP is not available for MacOS 9 and earlier - versions. - _________________________________________________________________ - -Using Packages - - There are a few pre-packaged and pre-compiled versions of PHP for Mac - OS X. This can help in setting up a standard configuration, but if you - need to have a different set of features (such as a secure server, or - a different database driver), you may need to build PHP and/or your - web server yourself. If you are unfamiliar with building and compiling - your own software, it's worth checking whether somebody has already - built a packaged version of PHP with the features you need. - _________________________________________________________________ - -Compiling for OS X Server - - Mac OS X Server install. - - 1. Get the latest distributions of Apache and PHP. - 2. Untar them, and run the configure program on Apache like so. - -./configure --exec-prefix=/usr \ ---localstatedir=/var \ ---mandir=/usr/share/man \ ---libexecdir=/System/Library/Apache/Modules \ ---iconsdir=/System/Library/Apache/Icons \ ---includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ ---enable-shared=max \ ---enable-module=most \ ---target=apache - - 3. If you want the compiler to do some optimization, you may also - want to add this line: - -setenv OPTIM=-O2 - - 4. Next, go to the PHP 4 source directory and configure it. - -./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --with-xml \ - --with-apache=/src/apache_1.3.12 - - If you have any other additions (MySQL, GD, etc.), be sure to add - them here. For the --with-apache string, put in the path to your - apache source directory, for example /src/apache_1.3.12. - 5. Type make and make install. This will add a directory to your - Apache source directory under src/modules/php4. - 6. Now, reconfigure Apache to build in PHP 4. - -./configure --exec-prefix=/usr \ ---localstatedir=/var \ ---mandir=/usr/share/man \ ---libexecdir=/System/Library/Apache/Modules \ ---iconsdir=/System/Library/Apache/Icons \ ---includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ ---enable-shared=max \ ---enable-module=most \ ---target=apache \ ---activate-module=src/modules/php4/libphp4.a - - You may get a message telling you that libmodphp4.a is out of - date. If so, go to the src/modules/php4 directory inside your - Apache source directory and run this command: ranlib libmodphp4.a. - Then go back to the root of the Apache source directory and run - the above configure command again. That'll bring the link table up - to date. Run make and make install again. - 7. Copy and rename the php.ini-dist file to your bin directory from - your PHP 4 source directory: cp php.ini-dist - /usr/local/bin/php.ini or (if your don't have a local directory) - cp php.ini-dist /usr/bin/php.ini. - _________________________________________________________________ - -Compiling for MacOS X Client - - The following instructions will help you install a PHP module for the - Apache web server included in MacOS X. This version includes support - for the MySQL and PostgreSQL databases. These instructions are - graciously provided by Marc Liyanage. - - Warning - - Be careful when you do this, you could screw up your Apache web - server! - - Do this to install: - - 1. Open a terminal window. - 2. Type wget - http://www.diax.ch/users/liyanage/software/macosx/libphp4.so.gz, - wait for the download to finish. - 3. Type gunzip libphp4.so.gz. - 4. Type sudo apxs -i -a -n php4 libphp4.so - 5. Now type sudo open -a TextEdit /etc/httpd/httpd.conf. TextEdit - will open with the web server configuration file. Locate these two - lines towards the end of the file: (Use the Find command) - -#AddType application/x-httpd-php .php -#AddType application/x-httpd-php-source .phps - - Remove the two hash marks (#), then save the file and quit - TextEdit. - 6. Finally, type sudo apachectl graceful to restart the web server. - - PHP should now be up and running. You can test it by dropping a file - into your Sites folder which is called test.php. Into that file, write - this line: . - - Now open up 127.0.0.1/~your_username/test.php in your web browser. You - should see a status table with information about the PHP module. - _________________________________________________________________ - -Chapter 4. Installation of PECL extensions - -Introduction to PECL Installations - - PHP extensions may be installed in a variety of ways. PECL is a - repository of PHP extensions living within the PEAR structure, and the - following demonstrates how to install these extensions. - - These instructions assume /your/phpsrcdir/ is the path to the PHP - source, and extname is the name of the PECL extension. Adjust - accordingly. These instructions also assume a familiarity with the - pear command. - - Shared extensions may be installed by including them inside of php.ini - using the extension PHP directive. See also the extensions_dir - directive, and dl(). The installation methods described below do not - automatically configure PHP to include these extensions, this step - must be done manually. - - When building PHP modules, it's important to have the appropriate - versions of the required tools (autoconf, automake, libtool, etc.) See - the Anonymous CVS Instructions for details on the required tools, and - required versions. - _________________________________________________________________ - -Downloading PECL extensions - - There are several options for downloading PECL extensions, such as: - - * http://pecl.php.net - Listed here is information like the ChangeLog, release - information, requirements, revisions, etc. Although not every PECL - extension has a webpage, most do. - * pear download extname - The pear command may also be used to download source files. - Specific revisions may also be specified. - * CVS - All PECL files reside in CVS. A web-based view may be seen at - http://cvs.php.net/pecl/. To download straight from CVS, consider - the following where phpfi is the password for user cvsread: - -$ cvs -d:pserver:cvsread@cvs.php.net:/repository login -$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname - - * Windows downloads - Windows users may find compiled PECL binaries by downloading the - Collection of PECL modules from the PHP Downloads page, and by - retrieving a PECL Snapshot. To compile PHP under Windows, read the - Win32 Build README. - _________________________________________________________________ - -PECL for Windows users - - Like with any other PHP extension DLL, to install move the PECL - extension DLLs into the extension_dir folder and include them within - php.ini. For example: - - extension=php_extname.dll - - After doing this, restart the web server. - _________________________________________________________________ - -Compiling shared PECL extensions with PEAR - - PEAR makes it easy to create shared PHP extensions. Using the pear - command, do the following: - - $ pear install extname - - That will download the source for extname, and compile it on the - system. This results in an extname.so file that may then be included - in php.ini - - In case the systems preferred_state is set higher than an available - extname version, like it's set to stable and the extension is still in - beta, either alter the preferred_state via pear config-set or specify - a specific version of the PECL extension. For example: - - $ pear install extname-0.1.1 - - Regardless, pear will copy this extname.so into the extensions - directory. Adjust php.ini accordingly. - _________________________________________________________________ - -Compiling shared PECL extensions with phpize - - If using pear is not an option, like for building shared PECL - extensions from CVS, or for unreleased PECL packages, then creating a - shared extension may also be done by manually using the phpize - command. The pear command essentially does this but it may also be - done manually. Assuming the source file is named extname.tgz, and that - it was downloaded into the current directory, consider the following: - -$ pear download extname -$ gzip -d < extname.tgz | tar -xvf - -$ cd extname -$ phpize -$ ./configure && make - - Upon success, this will create extname.so and put it into the modules/ - and/or .libs/ directory within the extname/ source. Move this shared - extension (extname.so) into the PHP extensions directory, and adjust - php.ini accordingly. - _________________________________________________________________ - -Compiling PECL extensions statically into PHP - - To statically include the extension within the PHP build, put the - extensions source into the ext/ directory found in the PHP source. For - example: - -$ cd /your/phpsrcdir/ext -$ pear download extname -$ gzip -d < extname.tgz | tar -xvf - -$ mv extname-x.x.x extname -$ rm package.xml - - This will result in the following directory: - - /your/phpsrcdir/ext/extname - - From here, build PHP as normal: - -$ cd /your/phpsrcdir -$ ./buildconf -$ ./configure --help -$ ./configure --with-extname --enable-someotherext --with-foobar -$ make -$ make install - - Whether --enable-extname or --with-extname is used depends on the - extension. Typically an extension that does not require external - libraries uses --enable. To be sure, run the following after - buildconf: - - $ ./configure --help | grep extname - _________________________________________________________________ - -Chapter 5. Problems? - -Read the FAQ - - Some problems are more common than others. The most common ones are - listed in the PHP FAQ, part of this manual. - _________________________________________________________________ - -Other problems - - If you are still stuck, someone on the PHP installation mailing list - may be able to help you. You should check out the archive first, in - case someone already answered someone else who had the same problem as - you. The archives are available from the support page on - http://www.php.net/support.php. To subscribe to the PHP installation - mailing list, send an empty mail to - php-install-subscribe@lists.php.net. The mailing list address is - php-install@lists.php.net. - - If you want to get help on the mailing list, please try to be precise - and give the necessary details about your environment (which operating - system, what PHP version, what web server, if you are running PHP as - CGI or a server module, safe mode, etc...), and preferably enough code - to make others able to reproduce and test your problem. - _________________________________________________________________ - -Bug reports - - If you think you have found a bug in PHP, please report it. The PHP - developers probably don't know about it, and unless you report it, - chances are it won't be fixed. You can report bugs using the - bug-tracking system at http://bugs.php.net/. Please do not send bug - reports in mailing list or personal letters. The bug system is also - suitable to submit feature requests. - - Read the How to report a bug document before submitting any bug - reports! - _________________________________________________________________ - -Chapter 6. Runtime Configuration - -The configuration file - - The configuration file (called php3.ini in PHP 3, and simply php.ini - as of PHP 4) is read when PHP starts up. For the server module - versions of PHP, this happens only once when the web server is - started. For the CGI and CLI version, it happens on every invocation. - - The default location of php.ini is a compile time option (see the FAQ - entry), but can be changed for the CGI and CLI version with the -c - command line switch, see the chapter about using PHP from the command - line. You can also use the environment variable PHPRC for an - additional path to search for a php.ini file. - - If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is - e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. - - Note: The Apache web server changes the directory to root at - startup causing PHP to attempt to read php.ini from the root - filesystem if it exists. - - The php.ini directives handled by extensions are documented - respectively on the pages of the extensions themselves. The list of - the core directives is available in the appendix. Probably not all the - PHP directives are documented in the manual though. For a completel - list of directives available in your PHP version, please read your - well commented php.ini file. Alternatively, you may find the the - latest php.ini from CVS helpful too. - - Example 6-1. php.ini example -; any text on a line after an unquoted semicolon (;) is ignored -[php] ; section markers (text within square brackets) are also ignored -; Boolean values can be set to either: -; true, on, yes -; or false, off, no, none -register_globals = off -track_errors = yes - -; you can enclose strings in double-quotes -include_path = ".:/usr/local/lib/php" - -; backslashes are treated the same as any other character -include_path = ".;c:\php\lib" - _________________________________________________________________ - -How to change configuration settings - -Running PHP as an Apache module - - When using PHP as an Apache module, you can also change the - configuration settings using directives in Apache configuration files - (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride - Options" or "AllowOverride All" privileges to do so. - - With PHP 4 and PHP 5, there are several Apache directives that allow - you to change the PHP configuration from within the Apache - configuration files. For a listing of which directives are - PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the - List of php.ini directives appendix. - - Note: With PHP 3, there are Apache directives that correspond to - each configuration setting in the php3.ini name, except the name is - prefixed by "php3_". - - php_value name value - Sets the value of the specified directive. Can be used only - with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a - previously set value use none as the value. - - Note: Don't use php_value to set boolean values. php_flag (see - below) should be used instead. - - php_flag name on|off - Used to set a boolean configuration directive. Can be used only - with PHP_INI_ALL and PHP_INI_PERDIR type directives. - - php_admin_value name value - Sets the value of the specified directive. This can not be used - in .htaccess files. Any directive type set with php_admin_value - can not be overridden by .htaccess or virtualhost directives. - To clear a previously set value use none as the value. - - php_admin_flag name on|off - Used to set a boolean configuration directive. This can not be - used in .htaccess files. Any directive type set with - php_admin_flag can not be overridden by .htaccess or - virtualhost directives. - - Example 6-2. Apache configuration example - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php3_include_path ".:/usr/local/lib/php" - php3_safe_mode on - - - Caution - - PHP constants do not exist outside of PHP. For example, in httpd.conf - you can not use PHP constants such as E_ALL or E_NOTICE to set the - error_reporting directive as they will have no meaning and will - evaluate to 0. Use the associated bitmask values instead. These - constants can be used in php.ini - _________________________________________________________________ - -Changing PHP configuration via the Windows registry - - When running PHP on Windows, the configuration values can be modified - on a per-directory basis using the Windows registry. The configuration - values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory - Values, in the sub-keys corresponding to the path names. For example, - configuration values for the directory c:\inetpub\wwwroot would be - stored in the key HKLM\SOFTWARE\PHP\Per Directory - Values\c\inetpub\wwwroot. The settings for the directory would be - active for any script running from this directory or any subdirectory - of it. The values under the key should have the name of the PHP - configuration directive and the string value. PHP constants in the - values are not parsed. However, only configuration values changeable - in PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not. - _________________________________________________________________ - -Other interfaces to PHP - - Regardless of how you run PHP, you can change certain values at - runtime of your scripts through ini_set(). See the documentation on - the ini_set() page for more information. - - If you are interested in a complete list of configuration settings on - your system with their current values, you can execute the phpinfo() - function, and review the resulting page. You can also access the - values of individual configuration directives at runtime using - ini_get() or get_cfg_var(). diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f1f51a51d7fac..0000000000000 --- a/LICENSE +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------- - The PHP License, Version 3.0 -Copyright (c) 1999 - 2005 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP, freely available from - ". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED 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 PHP -DEVELOPMENT TEAM OR ITS 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. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . - -This product includes the Zend Engine, freely available at -. diff --git a/Makefile.frag b/Makefile.frag deleted file mode 100644 index a5da9c3947e10..0000000000000 --- a/Makefile.frag +++ /dev/null @@ -1,23 +0,0 @@ - -# -# Zend -# - -$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h -$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h - -$(builddir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - @$(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -$(builddir)/zend_language_parser.h: $(builddir)/zend_language_parser.c -$(builddir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y - @$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@ - -$(builddir)/zend_ini_parser.h: $(builddir)/zend_ini_parser.c -$(builddir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - @$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@ - -$(builddir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - @$(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l - -$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(builddir)/zend_language_parser.h diff --git a/Makefile.gcov b/Makefile.gcov deleted file mode 100644 index 80ce36da3fdab..0000000000000 --- a/Makefile.gcov +++ /dev/null @@ -1,18 +0,0 @@ - -.php_cov_info.ltpdata: - @mkdir -p .cov/; \ - find . -name \*.gcda -o -name \*.gcno | sed -e 's/^\.\/\.cov\/.*//' | xargs --replace cp {} .cov/; \ - find . -name \*.gcda -o -name \*.gcno | sed -e 's/^\.\/\.cov\/.*//' | sed -e 's/^\.\///' | xargs --max-args=1 dirname | sed -e 's/\/.*//' | xargs --replace ln -s `pwd`/{} `pwd`/.cov > /dev/null 2>&1; \ - $(LTP) --directory .cov --output-file=.php_cov_info.ltpdata --capture; \ - -cov: .php_cov_info.ltpdata - -cov-html: cov - @$(LTP_GENHTML) -o cov_html/ .php_cov_info.ltpdata -t "PHP Code Coverage" -s; - -cov-clean: - find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \; - rm -f .cov/* # This is done first, since we are symlinked inside.. - rm -Rf .cov # Now remove the directory - rm -f .php_cov_info.ltpdata - rm -Rf cov_html diff --git a/Makefile.global b/Makefile.global deleted file mode 100644 index 8d776271ed671..0000000000000 --- a/Makefile.global +++ /dev/null @@ -1,86 +0,0 @@ -mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p -INSTALL = $(top_srcdir)/build/shtool install -c -INSTALL_DATA = $(INSTALL) -m 644 - -DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) -COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) - -CORE_HEADERS = Zend/ TSRM/ include/ main/ main/streams/ regex/ ext/standard/ -INSTALL_HEADERS = $(CORE_HEADERS) $(INSTALL_EXT_HEADERS) - -all: $(all_targets) - @echo - @echo "Build complete." - @echo "(It is safe to ignore warnings about tempnam and tmpnam)." - @echo - -build-modules: $(PHP_MODULES) - -libphp5.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ - -@$(LIBTOOL) --silent --mode=install cp libphp5.la $(phptempdir)/libphp5.la >/dev/null 2>&1 - -libs/libphp5.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp5.so - -install: $(all_targets) $(install_targets) - -install-sapi: $(OVERALL_TARGET) - @echo "Installing PHP SAPI module: $(PHP_SAPI)" - -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) - -@if test ! -r $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME); then \ - for i in 0.0.0 0.0 0; do \ - if test -r $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME).$$i; then \ - $(LN_S) $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp5.$(SHLIB_SUFFIX_NAME); \ - break; \ - fi; \ - done; \ - fi - @$(INSTALL_IT) - -install-modules: build-modules - @test -d modules && \ - $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) - @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" - @rm -f modules/*.la >/dev/null 2>&1 - @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) - -test: all - -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ - TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \ - elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \ - TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \ - else \ - echo "ERROR: Cannot run tests without CLI sapi."; \ - fi - -utest: all - -@if test -x $(SAPI_CLI_PATH) && test ! -z $(SAPI_CLI_PATH); then \ - TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -u $(TESTS); \ - else \ - echo "ERROR: Cannot run tests without CLI sapi."; \ - fi - -clean: - find . -name \*.lo -o -name \*.o | xargs rm -f - find . -name \*.la -o -name \*.a | xargs rm -f - find . -name \*.so | xargs rm -f - find . -name .libs -a -type d|xargs rm -rf - rm -f libphp5.la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/* - -distclean: clean - rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module buildmk.stamp - $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f - find . -name Makefile | xargs rm -f - -.PHONY: all clean install distclean test -.NOEXPORT: diff --git a/NEWS b/NEWS deleted file mode 100644 index d207eeae887ba..0000000000000 --- a/NEWS +++ /dev/null @@ -1,25 +0,0 @@ -PHP NEWS -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 6.0 -- Unicode support. (Andrei, Dmitriy, et al) -- Changed type hints so that they take "= NULL" as default value. (Marcus, - Derick) -- Changed __toString() behavior to call it in all necessary places - (Marcus, Dmitry) -- Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() - functions to not call __autoload(). (Dmitry) -- Added configure option to enable C-level Code Coverage Instrumenting. (John) -- Added to cURL extension: (Ilia) - . curl_setopt_array() which allows setting of multiple cURL options. - . CURLINFO_HEADER_OUT constant to facilitate request retrieval. -- Added --rclass and --rextension CLI parameters to reflect internal classes and - loaded extensions. (Johannes) -- Added optional parameter to http_build_query() to allow specification of - string separator. (Ilia) -- Added an optional parameter to parse_url() to allow retrieval of distinct URL - components. (Ilia) -- Added an optional parameter to strstr() and stristr() for retrieval of either - the part of haystack before or after first occurence of needle. (Johannes) -- Added possibility to check in which extension an internal function was - defined using reflection API. (Johannes) -- Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus) diff --git a/README.CVS-RULES b/README.CVS-RULES deleted file mode 100644 index 130cedf477755..0000000000000 --- a/README.CVS-RULES +++ /dev/null @@ -1,118 +0,0 @@ -This is the first file you should be reading after you get your CVS account. -We'll assume you're basically familiar with CVS, but feel free to post -your questions on the mailing list. Please have a look at -http://cvsbook.red-bean.com/ for more detailed information on CVS. - -PHP is developed through the efforts of a large number of people. -Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following -some basic rules with regards to CVS usage will: - - a. Make everybody happier, especially those responsible for maintaining - the CVS itself. - b. Keep the changes consistently well documented and easily trackable. - c. Prevent some of those 'Oops' moments. - d. Increase the general level of good will on planet Earth. - - -Having said that, here are the organizational rules: - - 1. Respect other people working on the project. - - 2. Discuss any significant changes on the list before committing. - - 3. Look at EXTENSIONS file to see who is the primary maintainer of - the code you want to contribute to. - - 4. If you "strongly disagree" about something another person did, don't - start fighting publicly - take it up in private email. - - 5. If you don't know how to do something, ask first! - - 6. Test your changes before committing them. We mean it. Really. - - 7. For development use the --enable-maintainer-zts switch to ensure your - code handles TSRM correctly and doesn't break for thos who need that. - -Currently we have the following branches in use: -HEAD Will become PHP 5.1. This CVS branch is for active development. -PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature - enhancements may go in here, but please keep that as infrequent as - possible. -PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted - on this branch. - -The next few rules are more of a technical nature. - - 1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit - messages every day. Woe be to those who attempt to mess with it. - - 2. All news updates intended for public viewing, such as new features, - bug fixes, improvements, etc., should go into the NEWS file. - - NB! Lines, starting with @ will go automagically into NEWS file, but - this is NOT recommended, though. Please, add news entries directly to - NEWS file and don't forget to keep them adjusted and sorted. - - 3. Do not commit multiple file and dump all messages in one commit. If you - modified several unrelated files, commit each group separately and - provide a nice commit message for each one. See example below. - - 4. Do write your commit message in such a way that it makes sense even - without the corresponding diff. One should be able to look at it, and - immediately know what was modified. Definitely include the function name - in the message as shown below. - - 5. In your commit messages, keep each line shorter than 80 characters. And - try to align your lines vertically, if they wrap. It looks bad otherwise. - - 6. If you modified a function that is callable from PHP, prepend PHP to - the function name as shown below. - - -The format of the commit messages is pretty simple. - -Use a - to start a new item in your commit message. - -If a line begins with #, it is taken to be a comment and will not appear -in the ChangeLog. Everything else goes into the ChangeLog. - -It is important to note that if your comment or news logline spans multiple -lines, you have to put # at the beginning of _every_ such line. - -Example. Say you modified two files, datetime.c and string.c. In datetime.c you -added a new format option for the date() function, and in string.c you fixed a -memory leak in php_trim(). Don't commit both of these at once. Commit them -separately and try to make sure your commit messages look something like the -following. - -For datetime.c: -- Added new 'K' format modifier to date() for printing out number of days until - New Year's Eve. - -For string.c: -- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor(). -#- Man, that thing was leaking all over the place! - -The # lines will be omitted from the ChangeLog automagically. - -If you fix some bugs, you should note the bug ID numbers in your -commit message. Bug ID should be prefixed by "#" for easier access to -bug report when developers are browsing CVS via. LXR or Bonsai. - -Example: - -Fixed bug #14016 (pgsql notice handler double free crash bug.) - -If you don't see your messages in ChangeLog right away, don't worry! -These files are updated once a day, so your stuff will not show up until -somewhat later. - -You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/) -to look at PHP CVS repository in various ways. - -To receive daily updates to ChangeLog and NEWS, send an empty message to -php-cvs-daily-subscribe@lists.php.net. - -Happy hacking, - -PHP Team diff --git a/README.EXTENSIONS b/README.EXTENSIONS deleted file mode 100644 index 51e3b730e7de7..0000000000000 --- a/README.EXTENSIONS +++ /dev/null @@ -1,39 +0,0 @@ -Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way -that broke both source and binary compatibility. If you are -maintaining a third party extension, here's how to update it: - -If this was your old module entry: - -zend_module_entry foo_module_entry = { - "foo", /* extension name */ - foo_functions, /* extension function list */ - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - PHP_RINIT(foo), /* per-request startup function */ - PHP_RSHUTDOWN(foo), /* per-request shutdown function */ - PHP_MINFO(foo), /* information function */ - STANDARD_MODULE_PROPERTIES -}; - -Here's how it should look if you want your code to build with PHP -4.1.0 and up: - -zend_module_entry foo_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "foo", /* extension name */ - foo_functions, /* extension function list */ - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - PHP_RINIT(foo), /* per-request startup function */ - PHP_RSHUTDOWN(foo), /* per-request shutdown function */ - PHP_MINFO(foo), /* information function */ -#if ZEND_MODULE_API_NO >= 20010901 - FOO_VERSION, /* extension version number (string) */ -#endif - STANDARD_MODULE_PROPERTIES -}; - -If you don't care about source compatibility with earlier PHP releases -than 4.1.0, you can drop the #if/#endif lines. diff --git a/README.EXT_SKEL b/README.EXT_SKEL deleted file mode 100644 index 599e6997c43bd..0000000000000 --- a/README.EXT_SKEL +++ /dev/null @@ -1,194 +0,0 @@ -(NOTE: you may also want to take a look at the pear package - PECL_Gen, a PHP-only alternative for this script that - supports way more extension writing tasks and is - supposed to replace ext_skel completely in the long run ...) - -WHAT IT IS - - It's a tool for automatically creating the basic framework for a PHP module - and writing C code handling arguments passed to your functions from a simple - configuration file. See an example at the end of this file. - -HOW TO USE IT - - Very simple. First, change to the ext/ directory of the PHP 4 sources. If - you just need the basic framework and will be writing all the code in your - functions yourself, you can now do - - ./ext_skel --extname=module_name - - and everything you need is placed in directory module_name. - - [ Note that GNU awk is likely required for this script to work. Debian - systems seem to default to using mawk, so you may need to change the - #! line in skeleton/create_stubs and the cat $proto | awk line in - ext_skel to use gawk explicitly. ] - - If you don't need to test the existence of any external header files, - libraries or functions in them, the module is already almost ready to be - compiled in PHP. Just remove 3 comments in your_module_name/config.m4, - change back up to PHP sources top directory, and do - - ./buildconf; ./configure --enable-module_name; make - - But if you already have planned the overall scheme of your module, what - functions it will contain, their return types and the arguments they take - (a very good idea) and don't want to bother yourself with creating function - definitions and handling arguments passed yourself, it's time to create a - function definitions file, which you will give as an argument to ext_skel - with option - - --proto=filename. - -FORMAT OF FUNCTION DEFINITIONS FILE - - All the definitions must be on one line. In it's simplest form, it's just - the function name, e.g. - - my_function - - but then you'll be left with an almost empty function body without any - argument handling. - - Arguments are given in parenthesis after the function name, and are of - the form 'argument_type argument_name'. Arguments are separated from each - other with a comma and optional space. Argument_type can be one of int, - bool, double, float, string, array, object or mixed. - - An optional argument is separated from the previous by an optional space, - then '[' and of course comma and optional space, like all the other - arguments. You should close a row of optional arguments with same amount of - ']'s as there where '['s. Currently, it does not harm if you forget to do it - or there is a wrong amount of ']'s, but this may change in the future. - - An additional short description may be added after the parameters. - If present it will be filled into the 'proto' header comments in the stubs - code and the tag in the XML documentation. - - An example: - - my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st - - Arguments arg3 and arg4 are optional. - - If possible, the function definition should also contain it's return type - in front of the definition. It's not actually used for any C code generating - purposes but PHP in-source documentation instead, and as such, very useful. - It can be any of int, double, string, bool, array, object, resource, mixed - or void. - - The file must contain nothing else but function definitions, no comments or - empty lines. - -OTHER OPTIONS - - --no-help - - By default, ext_skel creates both comments in the source code and a test - function to help first time module writers to get started and testing - configuring and compiling their module. This option turns off all such things - which may just annoy experienced PHP module coders. Especially useful with - - --stubs=file - - which will leave out also all module specific stuff and write just function - stubs with function value declarations and passed argument handling, and - function entries and definitions at the end of the file, for copying and - pasting into an already existing module. - - --assign-params - --string-lens - - By default, function proto 'void foo(string bar)' creates the following: - ... - zval **bar; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar); - - Specifying both of these options changes the generated code to: - ... - zval **bar_arg; - int bar_len; - char *bar = NULL; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar_arg); - bar = Z_STRVAL_PP(bar_arg); - bar_len = Z_STRLEN_PP(bar_arg); - - You shouldn't have to ask what happens if you leave --string-lens out. If you - have to, it's questionable whether you should be reading this document. - - --with-xml[=file] - - Creates the basics for phpdoc .xml file. - - --full-xml - - Not implemented yet. When or if there will ever be created a framework for - self-contained extensions to use phpdoc system for their documentation, this - option enables it on the created xml file. - -CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES - - Only arguments of types int, bool, double, float, string and array are - handled. For other types you must write the code yourself. And for type - mixed, it wouldn't even be possible to write anything, because only you - know what to expect. - - It can't handle correctly, and probably never will, variable list of - of arguments. (void foo(int bar [, ...]) - - Don't trust the generated code too much. It tries to be useful in most of - the situations you might encounter, but automatic code generation will never - beat a programmer who knows the real situation at hand. ext_skel is generally - best suited for quickly generating a wrapper for c-library functions you - might want to have available in PHP too. - - This program doesn't have a --help option. It has --no-help instead. - -EXAMPLE - - The following _one_ line - - bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) - - will create this function definition for you (note that there are a few - question marks to be replaced by you, and you must of course add your own - value definitions too): - -/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) - */ -PHP_FUNCTION(my_drawtext) -{ - zval **image, **text, **font, **x, **y, **color; - int argc; - int image_id = -1; - int font_id = -1; - - argc = ZEND_NUM_ARGS(); - if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???_rsrc_id); - ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); - - switch (argc) { - case 6: - convert_to_long_ex(color); - /* Fall-through. */ - case 5: - convert_to_long_ex(y); - convert_to_long_ex(x); - /* font: fetching resources already handled. */ - convert_to_string_ex(text); - /* image: fetching resources already handled. */ - break; - default: - WRONG_PARAM_COUNT; - } - - php_error(E_WARNING, "my_drawtext: not yet implemented"); -} -/* }}} */ - diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API deleted file mode 100644 index a051723b5b084..0000000000000 --- a/README.PARAMETER_PARSING_API +++ /dev/null @@ -1,127 +0,0 @@ -New parameter parsing functions -=============================== - -It should be easier to parse input parameters to an extension function. -Hence, borrowing from Python's example, there are now a set of functions -that given the string of type specifiers, can parse the input parameters -and store the results in the user specified variables. This avoids most -of the IS_* checks and convert_to_* conversions. The functions also -check for the appropriate number of parameters, and try to output -meaningful error messages. - - -Prototypes ----------- -/* Implemented. */ -int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...); -int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...); - -The zend_parse_parameters() function takes the number of parameters -passed to the extension function, the type specifier string, and the -list of pointers to variables to store the results in. The _ex() version -also takes 'flags' argument -- current only ZEND_PARSE_PARAMS_QUIET can -be used as 'flags' to specify that the function should operate quietly -and not output any error messages. - -Both functions return SUCCESS or FAILURE depending on the result. - -The auto-conversions are performed as necessary. Arrays, objects, and -resources cannot be auto-converted. - - -Type specifiers ---------------- - l - long - d - double - s - string (with possible null bytes) and its length - b - boolean, stored in zend_bool - r - resource (stored in zval) - a - array - o - object (of any type) - O - object (of specific type, specified by class entry) - z - the actual zval - - The following characters also have a meaning in the specifier string: - | - indicates that the remaining parameters are optional, they - should be initialized to default values by the extension since they - will not be touched by the parsing function if they are not - passed to it. - / - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows - ! - the parameter it follows can be of specified type or NULL (only applies - to 'a', 'o', 'O', 'r', and 'z'). If NULL is passed, the results - pointer is set to NULL as well. - -Examples --------- -/* Gets a long, a string and its length, and a zval */ -long l; -char *s; -int s_len; -zval *param; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz", - &l, &s, &s_len, ¶m) == FAILURE) { - return; -} - - -/* Gets an object of class specified by my_ce, and an optional double. */ -zval *obj; -double d = 0.5; -zend_class_entry my_ce; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d", - &obj, my_ce, &d) == FAILURE) { - return; -} - - -/* Gets an object or null, and an array. - If null is passed for object, obj will be set to NULL. */ -zval *obj; -zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", - &obj, &arr) == FAILURE) { - return; -} - - -/* Gets a separated array which can also be null. */ -zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", - &arr) == FAILURE) { - return; -} - - -/* Get only the first three parameters (useful for varargs functions). */ -zval *z; -zend_bool b; -zval *r; -if (zend_parse_parameters(3 TSRMLS_CC, "zbr!", - &z, &b, &r) == FAILURE) { - return; -} - - -/* Get either a set of 3 longs or a string. */ -long l1, l2, l3; -char *s; -/* - * The function expects a pointer to a integer in this case, not a long - * or any other type. If you specify a type which is larger - * than a 'int', the upper bits might not be initialized - * properly, leading to random crashes on platforms like - * Tru64 or Linux/Alpha. - */ -int length; - -if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "lll", &l1, &l2, &l3) == SUCCESS) { - /* manipulate longs */ -} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "s", &s, &length) == SUCCESS) { - /* manipulate string */ -} else { - /* output error */ - - return; -} diff --git a/README.PEAR b/README.PEAR deleted file mode 100644 index b645639d50669..0000000000000 --- a/README.PEAR +++ /dev/null @@ -1,11 +0,0 @@ -To install the PEAR installer, please use go-pear. - -On linux: -$ lynx -source http://go-pear.org/ | php - -or save the setup script under go-pear.php and run: - -php go-pear.php - -For more informations see the PEAR manual: -http://pear.php.net/manual/en/installation.getting.php diff --git a/README.PHP4-TO-PHP5-THIN-CHANGES b/README.PHP4-TO-PHP5-THIN-CHANGES deleted file mode 100644 index 0a2c6d6657131..0000000000000 --- a/README.PHP4-TO-PHP5-THIN-CHANGES +++ /dev/null @@ -1,155 +0,0 @@ -1. strrpos() and strripos() now use the entire string as a needle. Be aware - that the existing scripts may no longer work as you expect. - - EX : - - - Will give you different results. The former returns 3 while the latter - returns false rather than the position of the last occurrence of 'D'. - The same applies to strripos(). - -2. Illegal use of string offsets causes E_ERROR instead of E_WARNING. - - EX : - - - Fatal error: Cannot use string offset as an array in ... on line 1 - -3. array_merge() was changed to accept only arrays. If a non-array variable is - passed, a E_WARNING will be thrown for every such parameter. Be careful - because your code may start emitting E_WARNING out of the blue. - -4. Be careful when porting from ext/mysql to ext/mysqli. The following - functions return NULL when no more data is available in the result set - (ext/mysql's functions return FALSE). - - - mysqli_fetch_row() - - mysqli_fetch_array() - - mysqli_fetch_assoc() - -5. PATH_TRANSLATED server variable is no longer set implicitly under - Apache2 SAPI in contrast to the situation in PHP 4, where it is set to the - same value as the SCRIPT_FILENAME server variable when it is not populated - by Apache. This change was made to comply with the CGI specification. - Please refer to bug #23610 for further information. - -6. Starting PHP 5.0.0 the T_ML_CONSTANT constant is no longer defined by the - ext/tokenizer extension. If error_reporting is set to E_ALL notices will - be produced. Instead of T_ML_CONSTANT for /* */ the T_COMMENT constant - is used, thus both // and /* */ are resolved as the T_COMMENT constant. - However the PHPDoc style comments /** */ ,which starting PHP 5 are parsed - by PHP, are recongnized as T_DOC_COMMENT. - -7. $_SERVER should be populated with argc and argv if variables_order - includes "S". If you have specifically configured your system to not - create $_SERVER, then of course it shouldn't be there. The change was to - always make argc and argv available in the CLI version regardless of the - variables_order setting. As in, the CLI version will now always populate - the global $argc and $argv variables. - -8. In some cases classes must be declared before used. It only happens only - if some of the new features of PHP 5 are used. Otherwise the behaviour is - the old. - Example 1 (works with no errors): - - - Example 2 (throws an error): - - - Output (example 2) : - Fatal error: Class 'a' not found in /tmp/cl.php on line 2 - -9. get_class() starting PHP 5 returns the name of the class as it was - declared which may lead to problems in older scripts that rely on - the previous behaviour - the class name is lowercased. Expect the - same behaviour from get_parent_class() when applicable. - Example : - - - Output (PHP 4): - string(6) "foobar" - string(9) "extfoobar" - - Output (PHP 5): - string(6) "FooBar" - string(9) "ExtFooBar" - ---------------------------------------------------------------------- - Example code that will break : - //.... - function someMethod($p) { - if (get_class($p) != 'helpingclass') { - return FALSE; - } - //... - } - //... - Possible solution is to search for get_class() and get_parent_class() in - all your scripts and use strtolower(). - -10. get_class_methods() returns the names of the methods of a class as they - declared. In PHP4 the names are all lowercased. - Example code : - - Output (PHP4): - array(2) { - [0]=> - string(5) "dofoo" - [1]=> - string(6) "hasfoo" - } - Output (PHP5): - array(2) { - [0]=> - string(5) "doFoo" - [1]=> - string(6) "hasFoo" - } - -11. Assignment $this is impossible. Starting PHP 5.0.0 $this has special - meaning in class methods and is recognized by the PHP parser. The latter - will generate a parse error when assignment to $this is found - Example code : - assignNew($b); - echo "I was executed\n"; - ?> - Output (PHP 4): - I was executed - Output (PHP 5): - PHP Fatal error: Cannot re-assign $this in /tmp/this_ex.php on line 4 - diff --git a/README.QNX b/README.QNX deleted file mode 100644 index d70d2e5d8b62f..0000000000000 --- a/README.QNX +++ /dev/null @@ -1,57 +0,0 @@ -QNX4 Installation Notes ------------------------ - -NOTE: General installation instructions are in the INSTALL file - - -1. To compile and test PHP3 you have to grab, compile and install: - - GNU dbm library or another db library; - - GNU bison (1.25 or later; 1.25 tested); - - GNU flex (any version supporting -o and -P options; 2.5.4 tested); - - GNU diffutils (any version supporting -w option; 2.7 tested); - -2. To use CVS version you may need also: - - GNU CVS (1.9 tested); - - GNU autoconf (2.12 tested); - - GNU m4 (1.3 or later preferable; 1.4 tested); - -3. To run configure define -lunix in command line: - LDFLAGS=-lunix ./configure - -4. To use Sybase SQL Anywhere define ODBC_QNX and CUSTOM_ODBC_LIBS in - command line and run configure with --with-custom-odbc: - CFLAGS=-DODBC_QNX LDFLAGS=-lunix CUSTOM_ODBC_LIBS="-ldblib -lodbc" ./configure --with-custom-odbc=/usr/lib/sqlany50 - If you have SQL Anywhere version 5.5.00, then you have to add - CFLAGS=-DSQLANY_BUG - to workaround its SQLFreeEnv() bug. Other versions has not been tested, - so try without this flag first. - -5. To build the Apache module, you may have to hardcode an include path for - alloc.h in your Apache base directory: - - APACHE_DIRECTORY/src/httpd.h: - change #include "alloc.h" - to #include "APACHE_DIRECTORY/src/alloc.h" - Unless you want to use system regex library, you have to hardcode also - a path to regex.h: - - APACHE_DIRECTORY/src/conf.h: - change #include - to #include "APACHE_DIRECTORY/src/regex/regex.h" - I don't know so far why this required for QNX, may be it is Watcom - compiler problem. - - If you building Apache module with SQL Anywhere support, you'll get - symbol conflict with BOOL. It is defined in Apache (httpd.h) and in - SQL Anywhere (odbc.h). This has nothing to do with PHP, so you have to - fix it yourself someway. - -6. With above precautions, it should compile as is and pass regression - tests completely: - make - make check - make install - - Don't bother me unless you really sure you made that all but it - still doesn't work. - -June 28, 1998 -Igor Kovalenko -- owl@infomarket.ru diff --git a/README.SELF-CONTAINED-EXTENSIONS b/README.SELF-CONTAINED-EXTENSIONS deleted file mode 100644 index e6a375331b4a5..0000000000000 --- a/README.SELF-CONTAINED-EXTENSIONS +++ /dev/null @@ -1,155 +0,0 @@ -$Id$ -============================================================================= - -HOW TO CREATE A SELF-CONTAINED PHP EXTENSION - - A self-contained extension can be distributed independently of - the PHP source. To create such an extension, two things are - required: - - - Configuration file (config.m4) - - Source code for your module - - We will describe now how to create these and how to put things - together. - -PREPARING YOUR SYSTEM - - While the result will run on any system, a developer's setup needs these - tools: - - GNU autoconf - GNU automake - GNU libtool - GNU m4 - - All of these are available from - - ftp://ftp.gnu.org/pub/gnu/ - -CONVERTING AN EXISTING EXTENSION - - Just to show you how easy it is to create a self-contained - extension, we will convert an embedded extension into a - self-contained one. Install PHP and execute the following - commands. - - $ mkdir /tmp/newext - $ cd /tmp/newext - - You now have an empty directory. We will copy the files from - the mysql extension: - - $ cp -rp php-4.0.X/ext/mysql/* . - - It is time to finish the module. Run: - - $ phpize - - You can now ship the contents of the directory - the extension - can live completely on its own. - - The user instructions boil down to - - $ ./configure \ - [--with-php-config=/path/to/php-config] \ - [--with-mysql=MYSQL-DIR] - $ make install - - The MySQL module will either use the embedded MySQL client - library or the MySQL installation in MYSQL-DIR. - - -DEFINING THE NEW EXTENSION - - Our demo extension is called "foobar". - - It consists of two source files "foo.c" and "bar.c" - (and any arbitrary amount of header files, but that is not - important here). - - The demo extension does not reference any external - libraries (that is important, because the user does not - need to specify anything). - - - LTLIBRARY_SOURCES specifies the names of the sources files. You can - name an arbitrary number of source files here. - -CREATING THE M4 CONFIGURATION FILE - - The m4 configuration can perform additional checks. For a - self-contained extension, you do not need more than a few - macro calls. - ------------------------------------------------------------------------------- -PHP_ARG_ENABLE(foobar,whether to enable foobar, -[ --enable-foobar Enable foobar]) - -if test "$PHP_FOOBAR" != "no"; then - PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared) -fi ------------------------------------------------------------------------------- - - PHP_ARG_ENABLE will automatically set the correct variables, so - that the extension will be enabled by PHP_NEW_EXTENSION in shared mode. - - The first argument of PHP_NEW_EXTENSION describes the name of the - extension. The second names the source-code files. The third passes - $ext_shared which is set by PHP_ARG_ENABLE/WITH to PHP_NEW_EXTENSION. - - Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not - plan to distribute your module with PHP, these facilities allow you - to integrate your module easily into the main PHP module framework. - -CREATING SOURCE FILES - - ext_skel can be of great help when creating the common code for all modules - in PHP for you and also writing basic function definitions and C code for - handling arguments passed to your functions. See README.EXT_SKEL for further - information. - - As for the rest, you are currently alone here. There are a lot of existing - modules, use a simple module as a starting point and add your own code. - - -CREATING THE SELF-CONTAINED EXTENSION - - Put config.m4 and the source files into one directory. Then, run phpize - (this is installed during make install by PHP 4.0). - - For example, if you configured PHP with --prefix=/php, you would run - - $ /php/bin/phpize - - This will automatically copy the necessary build files and create - configure from your config.m4. - - And that's it. You now have a self-contained extension. - -INSTALLING A SELF-CONTAINED EXTENSION - - An extension can be installed by running: - - $ ./configure \ - [--with-php-config=/path/to/php-config] - $ make install - -ADDING SHARED MODULE SUPPORT TO A MODULE - - In order to be useful, a self-contained extension must be loadable - as a shared module. I will explain now how you can add shared module - support to an existing module called foo. - - 1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will - automatically be able to use --with-foo=shared[,..] or - --enable-foo=shared[,..]. - - 2. In config.m4, use PHP_NEW_EXTENSION(foo,.., $ext_shared) to enable - building the extension. - - 3. Add the following lines to your C source file: - - #ifdef COMPILE_DL_FOO - ZEND_GET_MODULE(foo) - #endif diff --git a/README.STREAMS b/README.STREAMS deleted file mode 100644 index f625406a3bae6..0000000000000 --- a/README.STREAMS +++ /dev/null @@ -1,379 +0,0 @@ -An Overview of the PHP Streams abstraction -========================================== -$Id$ - -WARNING: some prototypes in this file are out of date. -The information contained here is being integrated into -the PHP manual - stay tuned... - -Please send comments to: Wez Furlong - -Why Streams? -============ -You may have noticed a shed-load of issock parameters flying around the PHP -code; we don't want them - they are ugly and cumbersome and force you to -special case sockets and files every time you need to work with a "user-level" -PHP file pointer. -Streams take care of that and present the PHP extension coder with an ANSI -stdio-alike API that looks much nicer and can be extended to support non file -based data sources. - -Using Streams -============= -Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a -FILE* parameter. - -The main functions are: - -PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count); -PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t - count); -PHPAPI size_t php_stream_printf(php_stream * stream TSRMLS_DC, - const char * fmt, ...); -PHPAPI int php_stream_eof(php_stream * stream); -PHPAPI int php_stream_getc(php_stream * stream); -PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen); -PHPAPI int php_stream_close(php_stream * stream); -PHPAPI int php_stream_flush(php_stream * stream); -PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence); -PHPAPI off_t php_stream_tell(php_stream * stream); -PHPAPI int php_stream_lock(php_stream * stream, int mode); - -These (should) behave in the same way as the ANSI stdio functions with similar -names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell, flock. - -Opening Streams -=============== -In most cases, you should use this API: - -PHPAPI php_stream *php_stream_open_wrapper(char *path, char *mode, - int options, char **opened_path TSRMLS_DC); - -Where: - path is the file or resource to open. - mode is the stdio compatible mode eg: "wb", "rb" etc. - options is a combination of the following values: - IGNORE_PATH (default) - don't use include path to search for the file - USE_PATH - use include path to search for the file - IGNORE_URL - do not use plugin wrappers - REPORT_ERRORS - show errors in a standard format if something - goes wrong. - STREAM_MUST_SEEK - If you really need to be able to seek the stream - and don't need to be able to write to the original - file/URL, use this option to arrange for the stream - to be copied (if needed) into a stream that can - be seek()ed. - - opened_path is used to return the path of the actual file opened, - but if you used STREAM_MUST_SEEK, may not be valid. You are - responsible for efree()ing opened_path. opened_path may be (and usually - is) NULL. - -If you need to open a specific stream, or convert standard resources into -streams there are a range of functions to do this defined in php_streams.h. -A brief list of the most commonly used functions: - -PHPAPI php_stream *php_stream_fopen_from_file(FILE *file, const char *mode); - Convert a FILE * into a stream. - -PHPAPI php_stream *php_stream_fopen_tmpfile(void); - Open a FILE * with tmpfile() and convert into a stream. - -PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir, - const char *pfx, char **opened_path TSRMLS_DC); - Generate a temporary file name and open it. - -There are some network enabled relatives in php_network.h: - -PHPAPI php_stream *php_stream_sock_open_from_socket(int socket, int persistent); - Convert a socket into a stream. - -PHPAPI php_stream *php_stream_sock_open_host(const char *host, unsigned short port, - int socktype, int timeout, int persistent); - Open a connection to a host and return a stream. - -PHPAPI php_stream *php_stream_sock_open_unix(const char *path, int persistent, - struct timeval *timeout); - Open a UNIX domain socket. - - -Stream Utilities -================ - -If you need to copy some data from one stream to another, you will be please -to know that the streams API provides a standard way to do this: - -PHPAPI size_t php_stream_copy_to_stream(php_stream *src, - php_stream *dest, size_t maxlen); - -If you want to copy all remaining data from the src stream, pass -PHP_STREAM_COPY_ALL as the maxlen parameter, otherwise maxlen indicates the -number of bytes to copy. -This function will try to use mmap where available to make the copying more -efficient. - -If you want to read the contents of a stream into an allocated memory buffer, -you should use: - -PHPAPI size_t php_stream_copy_to_mem(php_stream *src, char **buf, - size_t maxlen, int persistent); - -This function will set buf to the address of the buffer that it allocated, -which will be maxlen bytes in length, or will be the entire length of the -data remaining on the stream if you set maxlen to PHP_STREAM_COPY_ALL. -The buffer is allocated using pemalloc(); you need to call pefree() to -release the memory when you are done. -As with copy_to_stream, this function will try use mmap where it can. - -If you have an existing stream and need to be able to seek() it, you -can use this function to copy the contents into a new stream that can -be seek()ed: - -PHPAPI int php_stream_make_seekable(php_stream *origstream, php_stream **newstream); - -It returns one of the following values: -#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ -#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */ -#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */ -#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */ - -make_seekable will always set newstream to be the stream that is valid -if the function succeeds. -When you have finished, remember to close the stream. - -NOTE: If you only need to seek forward, there is no need to call this -function, as the php_stream_seek can emulate forward seeking when the -whence parameter is SEEK_CUR. - -NOTE: Writing to the stream may not affect the original source, so it -only makes sense to use this for read-only use. - -NOTE: If the origstream is network based, this function will block -until the whole contents have been downloaded. - -NOTE: Never call this function with an origstream that is referenced -as a resource! It will close the origstream on success, and this -can lead to a crash when the resource is later used/released. - -NOTE: If you are opening a stream and need it to be seekable, use the -STREAM_MUST_SEEK option to php_stream_open_wrapper(); - -PHPAPI int php_stream_supports_lock(php_stream * stream); - -This function will return either 1 (success) or 0 (failure) indicating whether or -not a lock can be set on this stream. Typically you can only set locks on stdio streams. - -Casting Streams -=============== -What if your extension needs to access the FILE* of a user level file pointer? -You need to "cast" the stream into a FILE*, and this is how you do it: - -FILE * fp; -php_stream * stream; /* already opened */ - -if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS) == FAILURE) { - RETURN_FALSE; -} - -The prototype is: - -PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int - show_err); - -The show_err parameter, if non-zero, will cause the function to display an -appropriate error message of type E_WARNING if the cast fails. - -castas can be one of the following values: -PHP_STREAM_AS_STDIO - a stdio FILE* -PHP_STREAM_AS_FD - a generic file descriptor -PHP_STREAM_AS_SOCKETD - a socket descriptor - -If you ask a socket stream for a FILE*, the abstraction will use fdopen to -create it for you. Be warned that doing so may cause buffered data to be lost -if you mix ANSI stdio calls on the FILE* with php stream calls on the stream. - -If your system has the fopencookie function, php streams can synthesize a -FILE* on top of any stream, which is useful for SSL sockets, memory based -streams, data base streams etc. etc. - -In situations where this is not desirable, you should query the stream -to see if it naturally supports FILE *. You can use this code snippet -for this purpose: - - if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) { - /* can safely cast to FILE* with no adverse side effects */ - } - -You can use: - -PHPAPI int php_stream_can_cast(php_stream * stream, int castas) - -to find out if a stream can be cast, without actually performing the cast, so -to check if a stream is a socket you might use: - -if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) { - /* it can be a socket */ -} - -Please note the difference between php_stream_is and php_stream_can_cast; -stream_is tells you if the stream is a particular type of stream, whereas -can_cast tells you if the stream can be forced into the form you request. -The former doesn't change anything, while the later *might* change some -state in the stream. - -Stream Internals -================ - -There are two main structures associated with a stream - the php_stream -itself, which holds some state information (and possibly a buffer) and a -php_stream_ops structure, which holds the "virtual method table" for the -underlying implementation. - -The php_streams ops struct consists of pointers to methods that implement -read, write, close, flush, seek, gets and cast operations. Of these, an -implementation need only implement write, read, close and flush. The gets -method is intended to be used for streams if there is an underlying method -that can efficiently behave as fgets. The ops struct also contains a label -for the implementation that will be used when printing error messages - the -stdio implementation has a label of "STDIO" for example. - -The idea is that a stream implementation defines a php_stream_ops struct, and -associates it with a php_stream using php_stream_alloc. - -As an example, the php_stream_fopen() function looks like this: - -PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode) -{ - FILE * fp = fopen(filename, mode); - php_stream * ret; - - if (fp) { - ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode); - if (ret) - return ret; - - fclose(fp); - } - return NULL; -} - -php_stream_stdio_ops is a php_stream_ops structure that can be used to handle -FILE* based streams. - -A socket based stream would use code similar to that above to create a stream -to be passed back to fopen_wrapper (or it's yet to be implemented successor). - -The prototype for php_stream_alloc is this: - -PHPAPI php_stream * php_stream_alloc(php_stream_ops * ops, void * abstract, - size_t bufsize, int persistent, const char * mode) - -ops is a pointer to the implementation, -abstract holds implementation specific data that is relevant to this instance -of the stream, -bufsize is the size of the buffer to use - if 0, then buffering at the stream -level will be disabled (recommended for underlying sources that implement -their own buffering - such a FILE*), -persistent controls how the memory is to be allocated - persistently so that -it lasts across requests, or non-persistently so that it is freed at the end -of a request (it uses pemalloc), -mode is the stdio-like mode of operation - php streams places no real meaning -in the mode parameter, except that it checks for a 'w' in the string when -attempting to write (this may change). - -The mode parameter is passed on to fdopen/fopencookie when the stream is cast -into a FILE*, so it should be compatible with the mode parameter of fopen(). - -Writing your own stream implementation -====================================== - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -RULE #1: when writing your own streams: make sure you have configured PHP with ---enable-debug. -I've taken some great pains to hook into the Zend memory manager to help track -down allocation problems. It will also help you spot incorrect use of the -STREAMS_DC, STREAMS_CC and the semi-private STREAMS_REL_CC macros for function -definitions. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -RULE #2: Please use the stdio stream as a reference; it will help you -understand the semantics of the stream operations, and it will always -be more up to date than these docs :-) - -First, you need to figure out what data you need to associate with the -php_stream. For example, you might need a pointer to some memory for memory -based streams, or if you were making a stream to read data from an RDBMS like -MySQL, you might want to store the connection and rowset handles. - -The stream has a field called abstract that you can use to hold this data. -If you need to store more than a single field of data, define a structure to -hold it, allocate it (use pemalloc with the persistent flag set -appropriately), and use the abstract pointer to refer to it. - -For structured state you might have this: - -struct my_state { - MYSQL conn; - MYSQL_RES * result; -}; - -struct my_state * state = pemalloc(sizeof(struct my_state), persistent); - -/* initialize the connection, and run a query, using the fields in state to - * hold the results */ - -state->result = mysql_use_result(&state->conn); - -/* now allocate the stream itself */ -stream = php_stream_alloc(&my_ops, state, 0, persistent, "r"); - -/* now stream->abstract == state */ - -Once you have that part figured out, you can write your implementation and -define the your own php_stream_ops struct (we called it my_ops in the above -example). - -For example, for reading from this weird MySQL stream: - -static size_t php_mysqlop_read(php_stream * stream, char * buf, size_t count) -{ - struct my_state * state = (struct my_state*)stream->abstract; - - if (buf == NULL && count == 0) { - /* in this special case, php_streams is asking if we have reached the - * end of file */ - if (... at end of file ...) - return EOF; - else - return 0; - } - - /* pull out some data from the stream and put it in buf */ - ... mysql_fetch_row(state->result) ... - /* we could do something strange, like format the data as XML here, - and place that in the buf, but that brings in some complexities, - such as coping with a buffer size too small to hold the data, - so I won't even go in to how to do that here */ -} - -Implement the other operations - remember that write, read, close and flush -are all mandatory. The rest are optional. Declare your stream ops struct: - -php_stream_ops my_ops = { - php_mysqlop_write, php_mysqlop_read, php_mysqlop_close, - php_mysqlop_flush, NULL, NULL, NULL, - "Strange MySQL example" -} - -Thats it! - -Take a look at the STDIO implementation in streams.c for more information -about how these operations work. -The main thing to remember is that in your close operation you need to release -and free the resources you allocated for the abstract field. In the case of -the example above, you need to use mysql_free_result on the rowset, close the -connection and then use pefree to dispose of the struct you allocated. -You may read the stream->persistent field to determine if your struct was -allocated in persistent mode or not. - -vim:tw=78:et diff --git a/README.SUBMITTING_PATCH b/README.SUBMITTING_PATCH deleted file mode 100644 index 04847d79c24ba..0000000000000 --- a/README.SUBMITTING_PATCH +++ /dev/null @@ -1,126 +0,0 @@ -Submitting Patch for PHP -======================== - -This document describes how to submit a patch for PHP. Since you are -reading this document, you are willing to submit a patch for PHP. -Please keep reading! Submitting a patch for PHP is easy. The hard -part is making it acceptable for inclusion into our repository. :-) - -How to create patch? --------------------- -We are working with CVS. You need to get CVS source to create a patch -that we accept. Visit http://www.php.net/anoncvs.php to get CVS -source. You can check out older versions, but make sure you get -the default branch (i.e. Do not use -r option when you check out the -CVS source) - -Read CODING_STANDARDS file before you start working. - -Now you are ready to create a patch. Modify source to fix a bug in PHP or -add a new feature to PHP. After you finished editing, please test your -patch. Read README.TESTING for testing. - -After you finish testing your patch, take diff file using -"cvs diff > your.patch" command. - -Read README.TESTING for submitting a test script for your patch. This is -not strictly required, but it is preferred to submit a test script along -with your patch. Making new test script is very easy. It also helps us -to understand what you have been fixed or added to PHP. - - -Tips for creating patch ------------------------ -If you would like to fix multiple bugs. It is easier for us if you -could create 1 patch for 1 bug, but this is not strictly required. -Note though that you might get little response, if your patch is -too hard to review. - -If you would like change/add many lines, it is better to ask module -maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if -you are patching PEAR. Official module maintainers can be found in -EXTENSIONS file in PHP source. - -If you are new to CVS (Concurrent Versions System), visit -http://cvshome.org/ for details. - - -Recommended CVS client settings for creating patch file ------------------------------------------------------- -Recommended ~/.cvsrc file setting is: ------- -cvs -z3 -update -d -P -checkout -P -diff -u - ------- -diff -u means: - -u Use the unified output format. - -With this CVS setting, you don't have to worry about adding/deleting -newlines and spaces. - - -Check list for submitting patch -------------------------------- - - Did you run "make test" to check if your patch didn't break - other features? - - Did you compile PHP with --enable-debug and check the PHP and - web server error logs when you test your patch? - - Did you build PHP for multi-threaded web servers. (Optional) - - Did you create test script for "make test"? (Recommended) - - Did you check your patch is unified format and it does not - contain white space changes? (If you are not using recommended - cvs setting) - - Did you update CVS source before you take final patch? - - Did you read the patch again? - - -Where to send your patch? -------------------------- -If you are patching C source, send the patch to internals@lists.php.net. -If you are patching a module, you should also send the patch to the -maintainer. Official module maintainers are listed in EXTENSION file -in source. - -If you are patching PEAR, send the patch to pear-dev@lists.php.net. - -Please add the prefix "[PATCH]" to your email subject and make sure -to include the patch as a MIME attachment even if it is short. - -NOTE: only MIME attachments of type 'text/*' are accepted. The - easiest way to accomplish this, is to make the extension - '.txt'. - -Test scripts should be included in the same email. -Explain what has been fixed/added/changed by your patch. - -Finally, add the bug Id(s) which can be closed by your patch, if any. - - -What happens after you submit your patch ----------------------------------------- -If your patch is easy to review and has obviously no side-effects, -it might take up to a few hours until someone commits it. - -Because this is a volunteer-driven effort, more complex patches will -require more patience on your side. - -If you did not receive any feedback in a few days, please consider -resubmitting the description of your patch, along-side with -these questions: - -- Is my patch too hard to review? Because of which factors? -- Should I split it up in multiple parts? -- Are there any unwanted whitespace changes? - - -What happens when your patch is applied? ----------------------------------------- -Your name will be included together with your email address in the CVS -commit log. If your patch affects end-users, a brief description -and your name might be added to the NEWS file. - - -Thank you for submitting patch for PHP! diff --git a/README.TESTING b/README.TESTING deleted file mode 100644 index 117a360b85f2b..0000000000000 --- a/README.TESTING +++ /dev/null @@ -1,179 +0,0 @@ -[IMPORTANT NOTICE] ------------------- - Failed tests usualy indicate a problem with your local system setup -and not within PHP itself (at least for official PHP release versions). -You may decide to automaticaly submit a test summary to our QA workflow -at the end of a test run. - Please do *not* submit a failed test as a bug or ask for help on why -it failed on your system without providing substantial backup information -on *why* the test failed on your special setup. Thank you :-) - - -[Testing Basics] ----------------- - The easiest way to test your PHP build is to run "make test" from the -command line after successfully compiling. This will run the complete -tests for all enabled functionalities and extensions using the PHP -CLI binary. - To execute test scripts, you must build PHP with some SAPI, then you -type "make test" to execute all or some test scripts saved under -"tests" directory under source root directory. - -Usage: -make test - - "make test" basically executes "run-tests.php" script -under the source root (parallel builds will not work). Therefore you -can execute the script as follows: - -TEST_PHP_EXECUTABLE=sapi/cli/php \ -sapi/cli/php [-c /path/to/php.ini] run-tests.php [ext/foo/tests/GLOB] - - -[Which "php" executable "make test" look for] ---------------------------------------------- - You must use TEST_PHP_EXECUTABLE environment variable to explicitly -select the php executable to be used to run the tests. That can either -be the CLI or CGI executable. - - "make test" executes "run-tests.php" script with "php" binary. Some -test scripts such as session must be executed by CGI SAPI. Therefore, -you must build PHP with CGI SAPI to perform all tests. - -NOTE: PHP binary executing "run-tests.php" and php binary used for -executing test scripts may differ. If you use different PHP binary for -executing "run-tests.php" script, you may get errors. - - -[Which php.ini is used] ------------------------ - "make test" uses the same php.ini file as it would once installed. -The tests have been written to be independent of that php.ini file, -so if you find a test that is affected by a setting, please report -this, so we can address the issue. - - -[Which test scripts are executed] ---------------------------------- - "run-tests.php" ("make test"), without any arguments executes all -test scripts by extracting all directories named "tests" -from the source root and any subdirectories below. If there are files, -which have a "phpt" extension, "run-tests.php" looks at the sections -in these files, determines whether it should run it, by evaluating -the 'SKIP' section. If the test is eligible for execution, the 'FILE' -section is extracted into a ".php" file (with the same name besides -the extension) and gets executed. -When an argument is given or TESTS environment variable is set, the -GLOB is expanded by the shell and any file with extension "*.phpt" is -regarded as a test file. - - Tester can easily execute tests selectively with as follows. - -Examples: -./sapi/cli/php run-tests.php ext/mbstring/* -./sapi/cli/php run-tests.php ext/mbstring/020.phpt - - -[Test results] --------------- - Test results are printed to standard output. If there is a failed test, -the "run-tests.php" script saves the result, the expected result and the -code executed to the test script directory. For example, if -ext/myext/tests/myext.phpt fails to pass, the following files are created: - -ext/myext/tests/myext.php - actual test file executed -ext/myext/tests/myext.log - log of test execution (L) -ext/myext/tests/myext.exp - expected output (E) -ext/myext/tests/myext.out - output from test script (O) -ext/myext/tests/myext.diff - diff of .out and .exp (D) - - Failed tests are always bugs. Either the test is bugged or not considering -factors applying to the tester's environment, or there is a bug in PHP. -If this is a known bug, we strive to provide bug numbers, in either the -test name or the file name. You can check the status of such a bug, by -going to: http://bugs.php.net/12345 where 12345 is the bug number. -For clarity and automated processing, bug numbers are prefixed by a hash -sign '#' in test names and/or test cases are named bug12345.phpt. - -NOTE: The files generated by tests can be selected by setting the -environment variable TEST_PHP_LOG_FORMAT. For each file you want to be -generated use the character in brackets as shown above (default is LEOD). -The php file will be generated always. - -NOTE: You can set environment variable TEST_PHP_DETAILED to enable -detailed test information. - -[Automated testing] - If you like to keep up to speed, with latest developments and quality -assurance, setting the environment variable NO_INTERACTION to 1, will not -prompt the tester for any user input. - -Normally, the exit status of "make test" is zero, regardless of the results -of independent tests. Set the environment variable REPORT_EXIT_STATUS to 1, -and "make test" will set the exit status ("$?") to non-zero, when an -individual test has failed. - -Example script to be run by cron(1): -========== qa-test.sh ============= -#!/bin/sh - -CO_DIR=$HOME/cvs/php5 -MYMAIL=qa-test@domain.com -TMPDIR=/var/tmp -TODAY=`date +"%Y%m%d"` - -# Make sure compilation enviroment is correct -CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre' -export MAKE=gmake -export CC=gcc - -# Set test environment -export NO_INTERACTION=1 -export REPORT_EXIT_STATUS=1 - -cd $CO_DIR -cvs update . >>$TMPDIR/phpqatest.$TODAY -./cvsclean ; ./buildconf ; ./configure $CONFIGURE_OPTS ; $MAKE -$MAKE test >>$TMPDIR/phpqatest.$TODAY 2>&1 -if test $? -gt 0 -then - cat $TMPDIR/phpqatest.$TODAY | mail -s"PHP-QA Test Failed for $TODAY" $MYMAIL -fi -========== end of qa-test.sh ============= - -NOTE: the exit status of run-tests.php will be 1 when -REPORT_EXIT_STATUS is set. The result of "make test" may be higher -than that. At present, gmake 3.79.1 returns 2, so it is -advised to test for non-zero, rather then a specific value. - - -[Creating new test files] -------------------------- - Writing test file is very easy if you are used to PHP. -See the HOWTO at http://qa.php.net/write-test.php - - -[How to help us] ----------------- - If you find bug in PHP, you can submit bug report AND test script -for us. You don't have to write complete script, just give us test -script with following format. Please test the script and make sure -you write the correct ACTUAL OUTPUT and EXPECTED OUTPUT before you -submit. - - diff --git a/README.TESTING2 b/README.TESTING2 deleted file mode 100644 index 30bd26c88e650..0000000000000 --- a/README.TESTING2 +++ /dev/null @@ -1,137 +0,0 @@ -[IMPORTANT NOTICE] ------------------- -This is an addendum to README.TESTING with additional information -specific to run-tests2.php. - -run-tests2.php is backward compatible with tests developed for -the original run-tests.php script. run-tests2 is *not* used by -'make test'. run-tests2 was developed to provide support for -testing PHP under it's primary environment, HTTP, and can run the -PHP tests under any of the SAPI modules that are direct executables, -or are accessable via HTTP. - -[New features] ----------------- -* Command line interface: - You can run 'php run-tests2.php -h' to get all the possible options. -* Configuration file: - the -c argument will allow you to use a configuration file. This is - handy if you are testing multiple environments and need various options - depending on the environment. - see run-tests-config.php for details. -* CGI Emulation: - Will emulate a CGI environment when testing with the cgi sapi executable. -* HTTP testing: - can be configured to run test scripts through an HTTP server running - on localhost. localhost is required since either the web server must - alias a directory to the php source directory, or the test scripts - must be copied to a directory under the web server - (see config options TEST_WEB_BASE_URL, TEST_BASE_PATH, and TEST_WEB_EXT) -* New sections supported for test files (see below) - -When running tests over http, tests that require ini settings different that what -the web server runs under will be skipped. Since the test harness defines a number -of ini settings by default, the web server may require special configuration to -make testing work. - -[Example Usage] ----------------- -Some (but not all!) examples of usage: - -1. run tests from the php source directory - php run-tests2.php -p /path/to/php-cli - -2. run tests using cgi emulation - php run-tests2.php -p /path/to/php-cgi - -3. run tests over http, copying test files into document root - php run-tests2.php -w -u http://localhost/test -m /path/to/htdocs/test - -4. run tests over http, php sources have been aliased in web server - php run-tests2.php -w -u http://localhost/test - -5. run tests using configuration file - php run-tests2.php -c /path/to/run-tests-config.php - -6. run tests using configuration file, but overriding some settings: - (config file must be first) - php run-tests2.php -c /path/to/run-tests-config.php -w -t 3 -d /path/to/testdir - -NOTE: configuration as described in README.TESTING still works. - -[New Test Sections] ----------------- -In addition to the traditional test sections -(see http://qa.php.net/write-test.php), several new sections are available -under run-tests2. - ---POST-- -This is not a new section, but not multipart posts are supported for testing -file uploads, or other types of POST data. - ---CGI-- -This section takes no value. It merely provides a simple marker for tests -that MUST be run as CGI, even if there is no --POST-- or --GET-- sections -in the test file. - ---DESCRIPTION-- -Not used for anything, just a section for documenting the test - ---ENV-- -This section get's eval()'d to help build an environment for the -execution of the test. This can be used to change environment -vars that are used for CGI emulation, or simply to set env vars -for cli testing. A full example looks like: - - --ENV-- - return <<conf all run-tests2 configuration vars - $this->env all environment variables that will get passed to the test - - ---REQUEST-- -This section is also eval'd, and is similar in nature to --ENV--. However, -this section is used to build the url used in an HTTP request. Valid values -to set in this section would include: - SCRIPT_NAME The inital part of the request url - PATH_INFO The pathinfo part of a request url - FRAGMENT The fragment section of a url (after #) - QUERY_STRING The query part of a url (after ?) - - --REQUEST-- - return << - - INI setting: - script_encoding = utf-8 - - -Conversion Semantics -==================== - -Not all characters can be converted between Unicode and legacy encodings. -Normally, when downconverting from Unicode, the default behavior of ICU -converters is to substitute the missing sequence with the appropriate -substitution sequence for that codepage, such as 0x1A (Control-Z) in -ISO-8859-1. When upconverting to Unicode, if an encoding has a character -which cannot be converted into Unicode, that sequence is replaced by the -Unicode substitution character (U+FFFD). - -The conversion failure behavior can be customized: - - - perform substitution as described above with a custom substitution - character - - skip any invalid characters - - stop the conversion, raise an error, and return partial conversion - results - - replace the missing character with a diagnostic character and continue, - e.g. [U+hhhh] - -There are two INI settings that control this. - - unicode.from_error_mode = U_INVALID_SUBSTITUTE - U_INVALID_SKIP - U_INVALID_STOP - U_INVALID_ESCAPE - - unicode.from_error_subst_char = a2 - -The second setting is supposed to contain the Unicode code point value for -the substitution character. This value has to be representable in the target -encoding. - -Note that PHP always tries to convert as much as of the data as possible and -returns the converted results even if an error happens. - - -Unicode Switch -============== - -Obviously, PHP cannot simply impose new Unicode support on everyone. There -are many applications that do not care about Unicode and do not need it. -Consequently, there is a switch that enables certain fundamental language -changes related to Unicode. This switch is available as a site-wide, or -per-dir INI setting only. - -Note that having switch turned off does not imply that PHP is unaware of -Unicode at all and that no Unicode string can exist. It only affects certain -aspects of the language, and Unicode strings can always be created -programmatically. - - unicode_semantics = On - - [TODO: list areas that are affected by this switch] - - -Unicode String Type -=================== - -Unicode string type (IS_UNICODE) is supposed to contain text data encoded in -UTF-16 format. It is the main string type in PHP when Unicode semantics -switch is turned on. Unicode strings can exist when the switch is off, but -they have to be produced programmatically, via calls to functions that -return Unicode type. - -The operational unit when working with Unicode strings is a code point, not -code unit or byte. One code point in UTF-16 may be comprised of 1 or 2 code -units, each of which is a 16-bit word. Working on the code point level is -necessary because doing otherwise would mean offloading the processing of -surrogate pairs onto PHP users, and that is less than desirable. - -The repercussions are that one cannot expect code point N to be at offset -N in the Unicode string. Instead, one has to iterate from the beginning from -the string using U16_FWD() macro until the desired codepoint is reached. - -The codepoint access is one of the primary areas targeted for optimization. - - -Native Encoding String Type -=========================== - -Native encoding string type (IS_STRING) serves two purposes: backwards -compatibility when Unicode semantics switch is off, and for representing -strings in non-Unicode encodings (native encodings) when it is on. It is -processsed on the byte level. - - -Binary String Type -================== - -Binary string type (IS_BINARY) can be used for storing images, PDFs, or -other binary data intended to be processed on a byte-level and that cannot -be intepreted as text. - -Binary data type does not participate in implicit conversions, and cannot be -explicitly upconverted to other string types, although the inverse is -possible. - -Printing binary data to the standard output passes it through as-is, -independent of the output encoding. - -When Unicode semantics switch is off, binary string literals and binary -strings returned by functions actually resolve to IS_STRING type, for -backwards compatibility reasons. - - -Zval Structure Changes -====================== - -PHP is a type-agnostic language. Its data values are encapsulated in a zval -(Zend value) structure that can change as necessary to accomodate various types. - -struct _zval_struct { - /* Variable information */ - union { - long lval; /* long value */ - double dval; /* double value */ - struct { - char *val; - int len; - } str; /* string value */ - HashTable *ht; /* hash table value */ - zend_object_value obj; /* object value */ - } value; - zend_uint refcount; - zend_uchar type; /* active type */ - zend_uchar is_ref; -}; - -The type field determines what is stored in the union, IS_STRING being the only -data type pertinent to this discussion. In the current version, the strings -are binary-safe, but, for all intents and purposes, are assumed to be -comprised of 8-bit characters. It is possible to treat the string value as -an opaque type containing arbitrary binary data, and in fact that is how -mbstring extension uses it, in order to store multibyte strings. However, -many extensions and the Zend engine itself manipulate the string value -directly without regard to its internals. Needless to say, this can lead to -problems. - -For IS_UNICODE type, we need to add another structure to the union: - - union { - .... - struct { - UChar *val; /* Unicode string value */ - int32_t len; /* number of UChar's */ - .... - } value; - -This cleanly separates the two types of strings and helps preserve backwards -compatibility. For IS_BINARY type, we can re-use the str union. - - -Language Modifications -====================== - -If a Unicode switch is turned on, PHP string literals - single-quoted, -double-quoted, and heredocs - become Unicode strings (IS_UNICODE type). -They support all the same escape sequences and variable interpolations as -previously, with the addition of some new escape sequences. - -The contents of the strings are interpreted as follows: - - - all non-escaped characters are interpreted as a corresponding Unicode - codepoint based on the current script encoding, e.g. ASCII 'a' (0x51) => - U+0061, Shift-JIS (0x92 0x69) => U+4E2D - - - existing PHP escape sequences are also interpreted as Unicode codepoints, - including \xXX (hex) and \OOO (octal) numbers, e.g. "\x20" => U+0020 - - - two new escape sequences, \uXXXX and \UXXXXXX are interpreted as a 4 or - 6-hex Unicode codepoint value, e.g. \u0221 => U+0221, \U010410 => - U+10410 - - - a new escape sequence allows specifying a character by its full - Unicode name, e.g. \C{THAI CHARACTER PHO SAMPHAO} => U+0E20 - -The single-quoted string is more restrictive than the other two types: so -far the only escape sequence allowed inside of it was \', which specifies -a literal single quote. However, single quoted strings now support the new -Unicode character escape sequences as well. - -PHP allows variable interpolation inside the double-quoted and heredoc strings. -However, the parser separates the string into literal and variable chunks during -compilation, e.g. "abc $var def" -> "abc" . $var . "def". This means that the -literal chunks can be handled in the normal way for as far as Unicode -support is concerned. - -Since all string literals become Unicode by default, one loses the ability -to specify byte-oriented or binary strings. In order to create binary string -literals, a new syntax is necessary: prefixing a string literal with letter -'b' creates a binary string. - - $var = b'abc\001'; - $var = b"abc\001"; - $var = b<< IS_UNICODE uses runtime-encoding -IS_UNICODE -> IS_BINARY converts to runtime encoding first, then to binary - - -Implementation Details That Need Expanding -========================================== -- Streams support for Unicode - What stream filters will we be providing? -- Conversion errors behavior - Need to define the default. -- INI files encoding - Do we support BOMs? -- There are likely to be other issues which are missing from this document - - -Build System -============ - -Unicode support in PHP is always enabled. The only configuration option -during development should be the location of the ICU headers and libraries. - - --with-icu-dir= parameter specifies the location of ICU - header and library files. - -After the initial development we have to repackage ICU library for our needs -and bundle it with PHP. - - -Document History -================ - 0.5: Updated per latest discussions. Removed tentative language in several - places, since we have decided on everything described here already. - Clarified details according to Phase II progress. - - 0.4: Updated to include all the latest discussions. Updated development - phases. - - 0.3: Updated to include all the latest discussions. - - 0.2: Updated Phase I design proposal per discussion on unicode@php.net. - Modified Internal Encoding section to contain only UTF-16 info.. - Expanded Script Encoding section. - Added Binary Data Type section. - Amended Language Modifications section to describe string literals - behavior. - Amended Build System section. - - 0.1: Phase I design proposal - - -References -========== - - Unicode - http://www.unicode.org - - Unicode Glossary - http://www.unicode.org/glossary/ - - UTF-8 - http://www.utf-8.com/ - - UTF-16 - http://www.ietf.org/rfc/rfc2781.txt - - ICU Homepage - http://www.ibm.com/software/globalization/icu/ - - ICU User Guide and API Reference - http://icu.sourceforge.net/ - - Unicode Annex #31 - http://www.unicode.org/reports/tr31/ - - PHP Parameter Parsing API - http://www.php.net/manual/en/zend.arguments.retrieval.php - - -Authors -======= - Andrei Zmievski - -vim: set et : diff --git a/README.UNICODE-UPGRADES b/README.UNICODE-UPGRADES deleted file mode 100644 index dba901992feeb..0000000000000 --- a/README.UNICODE-UPGRADES +++ /dev/null @@ -1,403 +0,0 @@ -This document attempts to describe portions of the API related to the new -Unicode functionality and the best practices for upgrading existing -functions to support Unicode. - -Your first stop should be README.UNICODE: it covers the general Unicode -functionality and concepts without going into technical implementation -details. - -Working in Unicode World -======================== - -Strings -------- - -A lot of internal functionality is controlled by the unicode_semantics -switch. Its value is found in the Unicode globals variable, UG(unicode). It -is either on or off for the entire request. - -The big thing is that there are two new string types: IS_UNICODE and -IS_BINARY. The former one has its own storage in the value union part of -zval (value.ustr) and the latter re-uses value.str. - -Both types have new macros to set the zval value and to access it. - -Z_USTRVAL(), Z_USTRLEN() - - accesses the value and length (in code units) of the Unicode type string - -Z_BINVAL(), Z_BINLEN() - - accesses the value and length of the binary type string - -Z_UNIVAL(), Z_UNILEN() - - accesses either Unicode or native string value, depending on the current - setting of UG(unicode) switch. The Z_UNIVAL() type resolves to char*, so - you may need to cast it appropriately. - -Z_USTRCPLEN() - - gives the number of codepoints in the Unicode type string - -ZVAL_BINARY(), ZVAL_BINARYL() - - Sets zval to hold a binary string. Takes the same parameters as - Z_STRING(), Z_STRINGL(). - -ZVAL_UNICODE, ZVAL_UNICODEL() - - Sets zval to hold a Unicode string. Takes the same parameters as - Z_STRING(), Z_STRINGL(). - -ZVAL_ASCII_STRING(), ZVAL_ASCII_STRINGL() - - When UG(unicode) is off, it's equivalent to Z_STRING(), ZSTRINGL(). When - UG(unicode) is on, it sets zval to hold a Unicode representation of the - passed-in ASCII string. It will always create a new string in - UG(unicode)=1 case, so the value of the duplicate flag is not taken into - account. - -ZVAL_RT_STRING() - - When UG(unicode) is off, it's equivalent to Z_STRING(), Z_STRINGL(). WHen - UG(unicode) is on, it takes the input string, converts it to Unicode - using the runtime_encoding converter and sets zval to it. Since a new - string is always created in this case, the value of the duplicate flag - does not matter. - -ZVAL_TEXT() - - This macro sets the zval to hold either a Unicode or a normal string, - depending on the value of UG(unicode). No conversion happens, so the - argument has to be cast to (char*) when using this macro. One example of - its usage would be to initialize zval to hold the name of a user - function. - -There are, of course, related conversion macros. - -convert_to_string_with_converter(zval *op, UConverter *conv) - - converts a zval to native string using the specified converter, if necessary. - -convert_to_binary() - - converts a zval to binary string. - -convert_to_unicode() - - converts a zval to Unicode string. - -convert_to_unicode_with_converter(zval *op, UConverter *conv) - - converts a zval to Unicode string using the specified converter, if - necessary. - -convert_to_text(zval *op) - - converts a zval to either Unicode or native string, depending on the - value of UG(unicode) switch - -zend_ascii_to_unicode() function can be used to convert an ASCII char* -string to Unicode. This is useful especially for inline string literals, in -which case you can simply use USTR_MAKE() macro, e.g.: - - UChar* ustr; - - ustr = USTR_MAKE("main"); - -If you need to initialize a few such variables, it may be more efficient to -use ICU macros, which avoid the conversion, depending on the platform. See -[1] for more information. - -USTR_FREE() can be used to free a UChar* string safely, since it checks for -NULL argument. USTR_LEN() takes either a UChar* or a char* argument, -depending on the UG(unicode) value, and returns its length. Cast the -argument to char* before passing it. - -The list of functions that add new array values and add object properties -has also been expanded to include the new types. Please see zend_API.h for -full listing (add_*_ascii_string_*, add_*_rt_string_*, add_*_unicode_*, -add_*_binary_*). - -UBYTES() macro can be used to obtain the number of bytes necessary to store -the given number of UChar's. The typical usage is: - - char *constant_name = colon + (UG(unicode)?UBYTES(2):2); - - -Code Points and Code Units --------------------------- - -Unicode type strings are in the UTF-16 encoding where 1 Unicode character -may be represented by 1 or 2 UChar's. Each UChar is referred to as a "code -unit", and a full Unicode character as a "code point". Consequently, number -of code units and number of code points for the same Unicode string may be -different. This has many implications, the most important of which is that -you cannot simply index the UChar* string to get the desired codepoint. - -The zval's value.ustr.len contains actually the number of code units. To -obtain the number of code points, one can use u_counChar32() ICU API -function or Z_USTRCPLEN() macro. - -ICU provides a number of macros for working with UTF-16 strings on the -codepoint level [2]. They allow you to do things like obtain a codepoint at -random code unit offset, move forward and backward over the string, etc. -There are two versions of iterator macros, *_SAFE and *_UNSAFE. It is strong -recommended to use *_SAFE version, since they handle unpaired surrogates and -check for string boundaries. Here is an example of how to move through -UChar* string and work on codepoints. - - UChar *str = ...; - int32_t str_len = ...; - UChar32 codepoint; - int32_t offset = 0; - - while (offset < str_len) { - U16_NEXT(str, offset, str_len, codepoint); - /* now we have the Unicode character in codepoint */ - } - -There is not macro to get a codepoint at a certain code point offset, but -there is a Zend API function that does it. - - inline UChar32 zend_get_codepoint_at(UChar *str, int32_t length, int32_t n); - -To retrieve 3rd codepoint, you would call: - - zend_get_codepoint_at(str, str_len, 3); - -If you have a UChar32 codepoint and need to put it into a UChar* string, -there is another helper function, zend_codepoint_to_uchar(). It takes -a single UChar32 and converts it to a UChar sequence (1 or 2 UChar's). - - UChar buf[8]; - UChar32 codepoint = 0x101a2; - int8_t num_uchars; - num_uchars = zend_codepoint_to_uchar(codepoint, buf); - -The return value is the number of resulting UChar's or 0, which indicates -invalid codepoint. - - -Memory Allocation ------------------ - -For ease of use and to reduce possible bugs, there are memory allocation -functions specific to Unicode strings. Please use them at all times when -allocating UChar's. - - eumalloc(size) - eurealloc(ptr, size) - eustrndup(s, length) - eustrdup(s) - - peumalloc(size, persistent) - peurealloc(ptr, size, persistent) - -The size parameter refers to the number of UChar's, not bytes. - - -Hashes ------- - -Hashes API has been upgraded to work with Unicode and binary strings. All -hash functions that worked with string keys now have their equivalent -zend_u_hash_* API. The zend_u_hash_* functions take the type of the key -string as the second argument. - -When UG(unicode) switch is on, the IS_STRING keys are upconverted to -IS_UNICODE and then used in the hash lookup. - -There are two new constants that define key types: - - #define HASH_KEY_IS_BINARY 4 - #define HASH_KEY_IS_UNICODE 5 - -Note that zend_hash_get_current_key_ex() does not have a zend_u_hash_* -version. It returns the key as a char* pointer, you can can cast it -appropriately based on the key type. - - -Identifiers and Class Entries ------------------------------ - -In Unicode mode all the identifiers are Unicode strings. This means that -while various structures such as zend_class_entry, zend_function, etc store -the identifier name as a char* pointer, it will actually point to UChar* -string. Be careful when accessing the names of classes, functions, and such --- always check UG(unicode) before using them. - -In addition, zend_class_entry has a u_twin field that points to its Unicode -counterpart in UG(unicode) mode. Use U_CLASS_ENTRY() macro to access the -correct class entry, e.g.: - - ce = U_CLASS_ENTRY(default_exception_ce); - - -Formatted Output ----------------- - -Since UTF-16 strings frequently contain NULL bytes, you cannot simpley use -%s format to print them out. Towards that end, output functions such as -php_printf(), spprintf(), etc now have three different formats for use with -Unicode strings: - - %r - This format treats the corresponding argument as a Unicode string. The - string is automatically converted to the output encoding. If you wish to - apply a different converter to the string, use %*r and pass the - converter before the string argument. - - UChar *class_name = USTR_NAME("ReflectionClass"); - zend_printf("%r", class_name); - - %R - This format requires at least two arguments: the first one specifies the - type of the string to follow (IS_STRING or IS_UNICODE), and the second - one - the string itself. If the string is of Unicode type, it is - automatically converted to the output encoding. If you wish to apply - a different converter to the string, use %*R and pass the converter - before the string argument. - - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %R does not exist", - Z_TYPE_P(class_name), Z_UNIVAL_P(class_name)); - - %v - This format takes only one parameter, the string, but the expected - string type depends on the UG(unicode) value. If the string is of - Unicode type, it is automatically converted to the output encoding. If - you wish to apply a different converter to the string, use %*R and pass - the converter before the string argument. - - zend_error(E_WARNING, "%v::__toString() did not return anything", - Z_OBJCE_P(object)->name); - - - -Upgrading Functions -=================== - -Let's take a look at a couple of functions that have been upgraded to -support new string types. - -substr() --------- - -This functions returns part of a string based on offset and length -parameters. - - void *str; - int32_t str_len, cp_len; - zend_uchar str_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|l", &str, &str_len, &str_type, &f, &l) == FAILURE) { - return; - } - -The first thing we notice is that the incoming string specifier is 't', -which means that we can accept all 3 string types. The 'str' variable is -declared as void*, because it can point to either UChar* or char*. -The actual type of the incoming string is stored in 'str_type' variable. - - if (str_type == IS_UNICODE) { - cp_len = u_countChar32(str, str_len); - } else { - cp_len = str_len; - } - -If the string is a Unicode one, we cannot rely on the str_len value to tell -us the number of characters in it. Instead, we call u_countChar32() to -obtain it. - -The next several lines normalize start and length parameters to fit within the -string. Nothing new here. Then we locate the appropriate segment. - - if (str_type == IS_UNICODE) { - int32_t start = 0, end = 0; - U16_FWD_N((UChar*)str, end, str_len, f); - start = end; - U16_FWD_N((UChar*)str, end, str_len, l); - RETURN_UNICODEL((UChar*)str + start, end-start, 1); - -Since codepoint (character) #n is not necessarily at offset #n in Unicode -strings, we start at the beginning and iterate forward until we have gone -through the required number of codepoints to reach the start of the segment. -Then we save the location in 'start' and continue iterating through the number -of codepoints specified by the offset. Once that's done, we can return the -segment as a Unicode string. - - } else { - RETURN_STRINGL((char*)str + f, l, 1); - } - -For native and binary types, we can return the segment directly. - - -strrev() --------- - -Let's look at strrev() which requires somewhat more complicated upgrade. -While one of the guidelines for upgrades is that combining sequences are not -really taken into account during processing -- substr() can break them up, -for example -- in this case, we actually should be concerned, because -reversing combining sequence may result in a completely different string. To -illustrate: - - a (U+0061 LATIN SMALL LETTER A) - o (U+006f LATIN SMALL LETTER O) - + ' (U+0301 COMBINING ACUTE ACCENT) - + _ (U+0320 COMBINING MINUS SIGN BELOW) - l (U+006C LATIN SMALL LETTER L) - -Reversing this would result in: - - l (U+006C LATIN SMALL LETTER L) - + _ (U+0320 COMBINING MINUS SIGN BELOW) - + ' (U+0301 COMBINING ACUTE ACCENT) - o (U+006f LATIN SMALL LETTER O) - a (U+0061 LATIN SMALL LETTER A) - -All of a sudden the combining marks are being applied to 'l' instead of 'o'. -To avoid this, we need to treat combininig sequences as a unit, by checking -the combining character class of each character with u_getCombiningClass(). - -strrev() obtains its single argument, a string, and unless the string is of -Unicode type, processes it exactly as before, simply swapping bytes around. -For Unicode case, the magic is like this: - - int32_t i, x1, x2; - UChar32 ch; - UChar *u_s, *u_n, *u_p; - - u_n = eumalloc(Z_USTRLEN_PP(str)+1); - u_p = u_n; - u_s = Z_USTRVAL_PP(str); - - i = Z_USTRLEN_PP(str); - while (i > 0) { - U16_PREV(u_s, 0, i, ch); - if (u_getCombiningClass(ch) == 0) { - u_p += zend_codepoint_to_uchar(ch, u_p); - } else { - x2 = i; - do { - U16_PREV(u_s, 0, i, ch); - } while (u_getCombiningClass(ch) != 0); - x1 = i; - while (x1 <= x2) { - U16_NEXT(u_s, x1, Z_USTRLEN_PP(str), ch); - u_p += zend_codepoint_to_uchar(ch, u_p); - } - } - } - *u_p = 0; - -The basic idea is to walk the string backwards from the end, using -U16_PREV() macro. If the combining class of the current character is 0, -meaning it's a base character and not a combining mark, we simply append it -to the new string. Otherwise, we save the location of the index and do a run -over the characters until we get to the next one with combining class 0. At -that point we append the sequence as is, without reversing, to the new -string. Voila. - -Note that the code uses zend_codepoint_to_uchar() to convert full Unicode -characters (UChar32 type) to 1 or 2 UTF-16 code units (UChar type). - - - -References -========== - -[1] http://icu.sourceforge.net/apiref/icu4c/ustring_8h.html#a1 - -[2] http://icu.sourceforge.net/apiref/icu4c/utf16_8h.html - -vim: set et ai tw=76 fo=tron21: diff --git a/README.UNIX-BUILD-SYSTEM b/README.UNIX-BUILD-SYSTEM deleted file mode 100644 index 9b49cb8bc821b..0000000000000 --- a/README.UNIX-BUILD-SYSTEM +++ /dev/null @@ -1,123 +0,0 @@ -PHP Build System V5 Overview - -- supports Makefile.ins during transition phase -- not-really-portable Makefile includes have been eliminated -- supports separate build directories without VPATH by using - explicit rules only -- does not waste disk-space/CPU-time for building temporary libraries - => especially noticeable on slower systems -- slow recursive make replaced with one global Makefile -- eases integration of proper dependencies -- adds PHP_DEFINE(what[, value]) which creates a single include-file - per what. This will allow more fine-grained dependencies. -- abandoning the "one library per directory" concept -- improved integration of the CLI -- several new targets - build-modules: builds and copies dynamic modules into modules/ - install-cli: installs the CLI only, so that the install-sapi - target does only what its name says -- finally abandoned automake (still requires aclocal at this time) -- changed some configure-time constructs to run at buildconf-time -- upgraded shtool to 1.5.4 -- removed $(moduledir) (use EXTENSION_DIR) - -The Reason For a New System - -It became more and more apparent that there is a severe need -for addressing the portability concerns and improving the chance -that your build is correct (how often have you been told to -"make clean"? When this is done, you won't need to anymore). - - -If You Build PHP on a Unix System - - -You, as a user of PHP, will notice no changes. Of course, the build -system will be faster, look better and work smarter. - - - -If You Are Developing PHP - - - - -Extension developers: - -Makefile.ins are abandoned. The files which are to be compiled -are specified in the config.m4 now using the following macro: - -PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared) - -E.g. this enables the extension foo which consists of three source-code -modules, two in C and one in C++. And, depending on the user's wishes, -the extension will even be built as a dynamic module. - -The full syntax: - -PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]]) - -Please have a look at acinclude.m4 for the gory details and meanings -of the other parameters. - -And that's basically it for the extension side. - -If you previously built sub-libraries for this module, add -the source-code files here as well. If you need to specify -separate include directories, do it this way: - -PHP_NEW_EXTENSION(foo, foo.c mylib/bar.c mylib/gregor.c,,,-I@ext_srcdir@/lib) - -E.g. this builds the three files which are located relative to the -extension source directory and compiles all three files with the -special include directive (@ext_srcdir@ is automatically replaced). - -Now, you need to tell the build system that you want to build files -in a directory called $ext_builddir/lib: - -PHP_ADD_BUILD_DIR($ext_builddir/lib) - -Make sure to call this after PHP_NEW_EXTENSION, because $ext_builddir -is only set by the latter. - -If you have a complex extension, you might to need add special -Make rules. You can do this by calling PHP_ADD_MAKEFILE_FRAGMENT -in your config.m4 after PHP_NEW_EXTENSION. - -This will read a file in the source-dir of your extension called -Makefile.frag. In this file, $(builddir) and $(srcdir) will be -replaced by the values which are correct for your extension -and which are again determined by the PHP_NEW_EXTENSION macro. - -Make sure to prefix *all* relative paths correctly with either -$(builddir) or $(srcdir). Because the build system does not -change the working directory anymore, we must use either -absolute paths or relative ones to the top build-directory. -Correct prefixing ensures that. - - -SAPI developers: - -Instead of using PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type - -PHP_SELECT_SAPI(name, type, sources.c) - -I.e. specify the source-code files as above and also pass the -information regarding how PHP is supposed to be built (shared -module, program, etc). - -For example for APXS: - -PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php5.c php_apache.c) - - - -General info - -The foundation for the new system is the flexible handling of -sources and their contexts. With the help of macros you -can define special flags for each source-file, where it is -located, in which target context it can work, etc. - -Have a look at the well documented macros -PHP_ADD_SOURCES(_X) in acinclude.m4. diff --git a/README.WIN32-BUILD-SYSTEM b/README.WIN32-BUILD-SYSTEM deleted file mode 100644 index 7d3c792767b52..0000000000000 --- a/README.WIN32-BUILD-SYSTEM +++ /dev/null @@ -1,174 +0,0 @@ -The Win32 Build System. -$Id$ -Wez Furlong - -If you need help with the build system, send mail to -internals@lists.php.net; please don't email me directly. - -=========================================================== -Contents: -1. How to build PHP under windows - a. Requirements - b. Opening a command prompt - c. Generating configure.js - d. Configuring - e. Building - f. Cleaning up - g. Running the test suite - h. snapshot building - -2. How to write config.w32 files - x. to be written. - -=========================================================== -1. How to build PHP under windows -a. Requirements - - You need: - - Windows Scripting Host (cscript.exe) - - Microsoft Build Tools from: - Microsoft Visual Studio (VC6) or later - - You also need: - - bindlib_w32 [http://www.php.net/extra/bindlib_w32.zip] - - win32build [http://www.php.net/extra/win32build.zip] - - b. Opening the Build Environment Command Prompt: - - Using Visual Studio (VC6) - 1. Install it - 2. If you have a VC++ Command Prompt icon on your start menu, - click on it to get a Command Prompt with the env vars - set up correctly. - - If not, create a new shortcut and set the Target to: - - %comspec% /k "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" - - You might also want to set the prompt to start in - a convenient location (such as the root of your - PHP source checkout). - - - Using Visual Studio .Net - 1. Install it. - 2. Under the Visual Studio .Net Tools sub menu of your start - menu, you should have a Visual Studio .Net Command Prompt - icon. If not, create a new shortcut and set the Target to: - - %comspec% /k "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat" - - You might also want to set the prompt to start in - a convenient location (such as the root of your - PHP source checkout). - - - Using the Platform SDK tools - 1. Download the Platform SDK: - http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ - - - You need the Core SDK, which is approx 200MB to download - and requires approx 500MB of disk space. - - The other components of the SDK are not required by PHP - - You might be able to reduce the download size by downloading - the installer control component first and then selecting - only the Build Environment (around 30MB), but I haven't - tried this. - - ** Note: it seems that MS don't include the 32 bit - build tools in the platform SDK any longer, so - you will probably have very limited luck if you - don't also have VC++ or VS.Net already installed. - - 2. Once installed, you will have an icon on your start menu - that will launch the build environment; the latest SDK's - install a number of different versions of this; you probably - want to choose the Windows 2000 Retail build environment. - Clicking on this will open a command prompt with its Path, - Include and Lib env vars set to point to the build tools - and win32 headers. - -c. Generating configure - - Change directory to where you have your PHP 5 sources. - Run buildconf.bat. - -d. Configuring - - cscript /nologo configure.js --help - - Will give you a list of configuration options; these will - have the form: - - --enable-foo or --disable-foo or --with-foo or --without-foo. - - --enable-foo will turn something on, and is equivalent to - specifying --enable-foo=yes - - --disable-foo will turn something off, and is equivalent to - specifying --enable-foo=no - - --enable-foo=shared will attempt to build that feature as - a shared, dynamically loadable module. - - Sometimes a configure option needs additional information - about where to find headers and libraries; quite often - you can specify --enable-foo=option where option could be - the path to where to find those files. If you want to - specify a parameter and build it as shared, you can use - this syntax instead: --enable-foo=shared,option - - The same rules all apply to --with-foo and --without-foo; - the only difference is the way the options are named; - the convention is that --enable-foo means that you are - switching on something that comes with PHP, whereas - --with-foo means that you want to build in something - external to PHP. - -e. Building - - Once you have successfully configured your build (make - sure you read the output from the command to make sure - it worked correctly), you can build the code; simply type - - "nmake" at the command prompt, and it will build everthing - you asked for. - - Once the build has completed, you will find your binaries - in the build dir determined by configure; this is typically - Release_TS for release builds or Debug_TS for debug builds. - If you build a non-thread-safe build, it will use Release - or Debug to store the files. Also in this build dir you - will find sub directories for each module that went into - your PHP build. The files you'll want to keep are the - .exe and .dll files directly in your build dir. - -f. Cleaning Up - - You can automatically delete everything that was built - by running "nmake clean". This will delete everything - that was put there when you ran nmake, including the - .exe and .dll files. - -g. Running the test suite - - You can verify that your build is working well by running - the regression test suite. You do this by typing - "nmake test". You can specify the tests you want to run - by defing the TESTS variable - if you wanted to run the - sqlite test suite only, you would type - "nmake /D TESTS=ext/sqlite/tests test" - -h. Snapshot Building - - If you want to set up an automated build that will tolerate - breakages in some of the modules, you can use the - --enable-snapshot-build configure option to generate a - makefile optimized for that purpose. A snapshot build will - switch the argument parser so that the default option for - configure switches that your don't specify will be set - to "shared". The effect of this is to turn on all options - unless you explicitly disable them. When you have configured - your snapshot build, you can use "nmake build-snap" to build - everything, ignoring build errors in individual extensions - or SAPI. - -vim:tw=78:sw=1:ts=1:et - diff --git a/README.Zeus b/README.Zeus deleted file mode 100644 index 7fecaf0d89a5d..0000000000000 --- a/README.Zeus +++ /dev/null @@ -1,112 +0,0 @@ -Using PHP 5 with the Zeus Web Server ------------------------------------ - -Zeus fully supports running PHP in combination with our -webserver. There are three different interfaces that can be used to -enable PHP: - -* CGI -* ISAPI -* FastCGI - -Of the three, we recommend using FastCGI, which has been tested and -benchmarked as providing the best performance and reliability. - -Full details of how to install PHP are available from our -website, at: - -http://support.zeus.com/products/php.html - -If you have any problems, please check the support site for more -up-to-date information and advice. - - -Quick guide to installing CGI/FastCGI with Zeus ------------------------------------------------ - -Step 1 - Compile PHP as FastCGI. - -Compile as follows: - ./configure --enable-fastcgi - make - -Note that PHP has many options to the configure script - -e.g. --with-mysql. You will probably want to select your usual options -before compiling; the above is just a bare minimum, for illustration. - -After compilation finishes, you will be left with an executable -program called 'php'. Copy this into your document root, under a -dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php) - - -Step 2 - configure Zeus - -Four stages: - - enable FastCGI - - configure FastCGI - - setup alias for FastCGI - - setup alias for PHP - -1) Using the admin server, go to the 'module configuration' page for -your virtual server, and ensure that 'fastcgi' is enabled (select the -tickbox to the left). - -2) While we can run FastCGI's locally, there are known problems with -some OS's (specifically, the communication between web server and -FastCGI happens over a unix domain socket, and some OS's have trouble -sustaining high connection rates over these sockets). So instead, we -are going to set up the PHP FastCGI to run 'remotely' over localhost -(this uses TCP sockets, which do not suffer this problem). Go to the -'fastcgi configuration' page, and under 'add remote fastcgi': - Add Remote FastCGI - Docroot path /fcgi-bin/php - Remote machine localhost:8002 -The first entry is where you saved PHP, above. -The second entry is localhost: -We will start the FastCGI listening on this port shortly. -Click 'update' to commit these changes. - -3) Go to the path mapping module and add an alias for FastCGI: - Add Alias - Docroot path /fcgi-bin - Filesystem directory /path/to/docroot/fcgi-bin - Alias type fastcgi -Click 'update' to commit these changes - -4) Also on the path mapping module, add a handler for PHP: - Add handler - File extension php - Handler /fcgi-bin/php -Click 'update' to commit these changes - -Finally restart your virtual server for these changes to take effect. - - -Step 3 - start PHP as a FastCGI runner - -When you start PHP, it will pre-fork a given number of child processes -to handle incoming PHP requests. Each process will handle a given -number of requests before exiting (and being replaced by a newly -forked process). You can control these two parameters by setting the -following environment variables BEFORE starting the FastCGI runner: - -PHP_FCGI_CHILDREN - the number of child processes to pre-fork. This -variable MUST be set, if not then the PHP will not run as a FastCGI. -We recommend a value of 8 for a fairly busy site. If you have many, -long-running PHP scripts, then you may need to increase this further. - -PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process -handles before exiting. If not set, defaults to 500. - -To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner -8002 $DOCROOT/fcgi-bin/php'. Substitute the appropriate values for -$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose, -above. - -To stop the runner (e.g. to experiment with the above environment -variables) you will need to manually stop and running PHP -processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots -of children and not the runner, Zeus unfortunately cannot keep track -of what processes are running, sorry. A typical command line may look -like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk -'{print $4}' | xargs kill' diff --git a/README.input_filter b/README.input_filter deleted file mode 100644 index 969b421b82d94..0000000000000 --- a/README.input_filter +++ /dev/null @@ -1,193 +0,0 @@ -Input Filter Support in PHP 5 ------------------------------ - -XSS (Cross Site Scripting) hacks are becoming more and more prevalent, -and can be quite difficult to prevent. Whenever you accept user data -and somehow display this data back to users, you are likely vulnerable -to XSS hacks. - -The Input Filter support in PHP 5 is aimed at providing the framework -through which a company-wide or site-wide security policy can be -enforced. It is implemented as a SAPI hook and is called from the -treat_data and post handler functions. To implement your own security -policy you will need to write a standard PHP extension. - -A simple implementation might look like the following. This stores the -original raw user data and adds a my_get_raw() function while the normal -$_POST, $_GET and $_COOKIE arrays are only populated with stripped -data. In this simple example all I am doing is calling strip_tags() on -the data. If register_globals is turned on, the default globals that -are created will be stripped ($foo) while a $RAW_foo is created with the -original user input. - -ZEND_BEGIN_MODULE_GLOBALS(my_input_filter) - zval *post_array; - zval *get_array; - zval *cookie_array; -ZEND_END_MODULE_GLOBALS(my_input_filter) - -#ifdef ZTS -#define IF_G(v) TSRMG(my_input_filter_globals_id, zend_my_input_filter_globals *, v) -#else -#define IF_G(v) (my_input_filter_globals.v) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(my_input_filter) - -function_entry my_input_filter_functions[] = { - PHP_FE(my_get_raw, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry my_input_filter_module_entry = { - STANDARD_MODULE_HEADER, - "my_input_filter", - my_input_filter_functions, - PHP_MINIT(my_input_filter), - PHP_MSHUTDOWN(my_input_filter), - NULL, - PHP_RSHUTDOWN(my_input_filter), - PHP_MINFO(my_input_filter), - "0.1", - STANDARD_MODULE_PROPERTIES -}; - -PHP_MINIT_FUNCTION(my_input_filter) -{ - ZEND_INIT_MODULE_GLOBALS(my_input_filter, php_my_input_filter_init_globals, NULL); - - REGISTER_LONG_CONSTANT("POST", PARSE_POST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GET", PARSE_GET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("COOKIE", PARSE_COOKIE, CONST_CS | CONST_PERSISTENT); - - sapi_register_input_filter(my_sapi_input_filter); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(my_input_filter) -{ - if(IF_G(get_array)) { - zval_ptr_dtor(&IF_G(get_array)); - IF_G(get_array) = NULL; - } - if(IF_G(post_array)) { - zval_ptr_dtor(&IF_G(post_array)); - IF_G(post_array) = NULL; - } - if(IF_G(cookie_array)) { - zval_ptr_dtor(&IF_G(cookie_array)); - IF_G(cookie_array) = NULL; - } - return SUCCESS; -} - -PHP_MINFO_FUNCTION(my_input_filter) -{ - php_info_print_table_start(); - php_info_print_table_row( 2, "My Input Filter Support", "enabled" ); - php_info_print_table_row( 2, "Revision", "$Revision$"); - php_info_print_table_end(); -} - -/* The filter handler. If you return 1 from it, then PHP also registers the - * (modified) variable. Returning 0 prevents PHP from registering the variable; - * you can use this if your filter already registers the variable under a - * different name, or if you just don't want the variable registered at all. */ -SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter) -{ - zval new_var; - zval *array_ptr = NULL; - char *raw_var; - int var_len; - - assert(*val != NULL); - - switch(arg) { - case PARSE_GET: - if(!IF_G(get_array)) { - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - } - IF_G(get_array) = array_ptr; - break; - case PARSE_POST: - if(!IF_G(post_array)) { - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - } - IF_G(post_array) = array_ptr; - break; - case PARSE_COOKIE: - if(!IF_G(cookie_array)) { - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - } - IF_G(cookie_array) = array_ptr; - break; - } - Z_STRLEN(new_var) = val_len; - Z_STRVAL(new_var) = estrndup(*val, val_len); - Z_TYPE(new_var) = IS_STRING; - - var_len = strlen(var); - raw_var = emalloc(var_len+5); /* RAW_ and a \0 */ - strcpy(raw_var, "RAW_"); - strlcat(raw_var,var,var_len+5); - - php_register_variable_ex(raw_var, &new_var, array_ptr TSRMLS_DC); - - php_strip_tags(*val, val_len, NULL, NULL, 0); - - *new_val_len = strlen(*val); - return 1; -} - -PHP_FUNCTION(my_get_raw) -{ - long arg; - char *var; - int var_len; - zval **tmp; - zval *array_ptr = NULL; - HashTable *hash_ptr; - char *raw_var; - - if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) { - return; - } - - switch(arg) { - case PARSE_GET: - array_ptr = IF_G(get_array); - break; - case PARSE_POST: - array_ptr = IF_G(post_array); - break; - case PARSE_COOKIE: - array_ptr = IF_G(post_array); - break; - } - - if(!array_ptr) RETURN_FALSE; - - /* - * I'm changing the variable name here because when running with register_globals on, - * the variable will end up in the global symbol table - */ - raw_var = emalloc(var_len+5); /* RAW_ and a \0 */ - strcpy(raw_var, "RAW_"); - strlcat(raw_var,var,var_len+5); - hash_ptr = HASH_OF(array_ptr); - - if(zend_hash_find(hash_ptr, raw_var, var_len+5, (void **)&tmp) == SUCCESS) { - *return_value = **tmp; - zval_copy_ctor(return_value); - } else { - RETVAL_FALSE; - } - efree(raw_var); -} - diff --git a/TODO b/TODO deleted file mode 100644 index 036167973985e..0000000000000 --- a/TODO +++ /dev/null @@ -1,150 +0,0 @@ -Things to do or at least think about doing in the future. Name in -parenthesis means that person has taken on this project. - -Zend ----- - * Allow foreach ($array as $k => list($a, $b)) syntax for multi - dimensional arrays. - * Look at replacing c-lib call tolower(). - * Make hash API functions work with HASH_OF() to save time. - * Native large number support (probably with GNU GMP) - * Const'ify APIs. Right now, many functions leave parameters untouched, - but don't declare those as const. This makes interaction with other - interfaces difficult which pass const parameters to us. - - -global ------- - * Make sure that all ZTS globals get destructed. Most ts_allocate_id() - calls should have a dtor entry. - * on some platforms unimplemented function will just do nothing - (e.g. symlink) they should print a warning or not even be defined! - (DONE ?) - * --enable-all in configure. (--enable-shared=max ...) - * make configure print out a summary when it's done (like XEmacs) - * replace standard functions which work on static data with - reentrancy-safe functions (DONE?). - * make SAPI conform to CGI/1.1. Currently, all SAPI modules - define REMOTE_ADDR etc. themselves and reach only various level - of compliance. - * see what functions might need to be changed to use HashPosition, so - that the internal array pointer is not affected. - - Other - * use thread-safe resolver functions (either require BIND 8 or adns). - * implement javadoc based function docs template system. - * provide optional IPv6 support (seems to be done?). - * find a better way to implement script timeouts. SIGVTALRM is used - by some POSIX threads implementations (i.e. OpenBSD) and is not - available in ZTS mode. - * Implement flush feature suitable for nested output buffers. - -Streams -------- - * Route filestat.c through the wrapper layer; isolate the statcache code - so that it is independent of php functions and can be applied to any - stream/path. - * Implement generalized connection pool for stated protocols such as - ftp and http/1.1 (using keep-alive) to avoid having to negotiate - new command/request stream for each subsequent call; Possibly store - resources in contexts (creating a default context if necessary) to - allow segmentation of connection pools. - * Add a method to take ownership of the memory buffer in memory streams so - that generating string values for zvals doesn't require an estrdup. - * bundle and use curl lib for fopen wrapper. - -documentation -------------- - * Add remarks in the documentation which functions are not implemented - on win32. - * Add remarks in the documentation which functions are not binary-safe. - * Update curl documentation (DONE?) - * Add developer documentation. - * Add detailed documentation for Java extension. - -ext/bz2 -------- - * Add an ini directive to specify the size of decompression buffer. - The default 4k is too small for large files and also requires much time - for decompression. 40k is suitable for such files, however it may be too - much under certain environments. There should be appropriate default - settings for the various SAPI modules (e.g. apache and cli). - -ext/curl --------- - * Have a warning scheme for when people use unsupported features. - -ext/oci8 --------- - * All OCIFetch*() functions should return 0 for no more data and false on - error. - * Have a flag that trims trailing spaces from CHAR fields on retrieval. - * Make allow_call_time_pass_reference=Off working. - * For additional todo information, see oci8.c, in ext/oci8 - -ext/odbc --------- - For PHP 4.3.0: - * update all php_error calls to php_error_docref where valid - * integrate EXPERIMENTAL ODBC update for use in PHP 5.0, use for - testing purposes only. - - For PHP 5.0.0 - * Activate EXPERIMENTAL ODBC codebase update - -ext/pcre --------- - * Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe - -ext/pcntl ---------- - * Change internal callback handler to use TICKS - * Remove all zend_extension code - * Add object callback support to pcntl_signal() - -ext/pgsql ---------- - For PHP 4.3.0: - * Add pg_metadata() with metadata cache feature. - * Add pg_convert() to check and convert array value for query. - * Add pg_insert/pg_update/pg_delete/pg_select for simple query. - -ext/session ------------ - For PHP 4.3.0: - * session_abort() to abort session. ie: Do not save session data. - * Allow unset($_SESSION) or unset($HTTP_SESSION_VARS) to unset - session vars regardless of register_globals setting. - - Other: - * Maybe implement finer-grained session variables that could be - locked individually. - * Write a network-transparent storage back-end with fallover - facilities - * Provide a callback facility which is executed upon encountering - an unknown class name during deserialization - -ext/standard ------------- - * Add a version number to data serialized via serialize(). - * Possibly modify parsing of GPC data to automatically create arrays if - variable name is seen more than once. - * Implement regex-cache for url-functions. - * Move socket related functions to fsock.c. - -ext/wddx --------- - * See if we can support the remaining data types: - dateTime - binary - - http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm - (Andrei) - - * implement wddx_packet_as_javascript(). (Andrei) - -other cool stuff ----------------- - * PVM extension - -vim:et:sw=4:ts=4 diff --git a/TODO-5.1 b/TODO-5.1 deleted file mode 100644 index f54565f68adfb..0000000000000 --- a/TODO-5.1 +++ /dev/null @@ -1,5 +0,0 @@ -Zend Engine ------------ - - Look at making zend_constant value member be a zval* instead of zval. (Andi) - - Implement inheritance rules for type hints. (Marcus) - - Find a keyword for the if-set-or operator (apply the patch). (Marcus, all) diff --git a/TODO-PHP5 b/TODO-PHP5 deleted file mode 100644 index c21671faa4fb8..0000000000000 --- a/TODO-PHP5 +++ /dev/null @@ -1,109 +0,0 @@ -Component: Zend Engine 2 - - Important stuff to finish: PPP members/PPP methods, - support of overloaded extensions, possibly differentiate - between class and namespace as discussed with Stig in - Germany. -Responsibility: Zeev, Andi, Stas -Time frame: Couple of months for first part and extensions will be - ongoing while PHP is being fixed. - Things to leave for later versions: Native aggregation - support, accessing static members via object and not class. - - -Component: Aggregation -Responsibility: Andi, Stig? -Time frame: ? - - -Component: Redesign of API Versioning -Responsibility: ? -Time frame: 1 month - - -Component: Thread Safety - Identify the extensions that are not thread safe by design - or due to dependant libraries and identify them as such. - If possible try to resolve thread safety issue via code - improvements (if php code or patches will be accepted by - library maintainers). For situations where thread safety - cannot easily be acheived a flag in the extension API is - set so PHP can identify non-thread safe extensions. These - extensions will not be loaded in a ZTS compiled binary - (unless it is cli/cgi). - -Responsibility: ? -Time frame: ? - - -Component: SAPI - Environment variables defined in the CGI spec need to be - verified in each SAPI module that they conform to the CGI - spec correctly. If they do not, the SAPI module needs to - fix the variable prior to script execution. Having this - conformity will aid in having PHP scripts run correctly - under different sapi modules. - -Responsibility: Shane Caraveo & each sapi module owner -Timeframe: ? (but shouldn't be much effort, most modules are probably ok) - - -Component: Input Filtering - - Implement a SAPI input filter hook that will get called - just before registering a variable in the - treat_data/post_handler hooks. (done) - - Make sure this is also done in mbstring (done) - - Provide access functions, or perhaps a new - $_RAW_GET/POST/Cookie set of superglobals to get at the - unfiltered data - - Provide a .ini directive which allows people to set their - input filter to one of the built-in strip_tags, - htmlspecialchars or whatever other internal function might - be useful here. - - (The main benefit of this is to make it easier for people - to solve the XSS problem once and for all without having - to go through every line of their code and adding input - validation/filtering everywhere) -Responsibility: Rasmus -Timeframe: Yesterday - - -Component: RPC Abstraction Layer - Porting java, com, dotnet, xmlrpc, corba, soap and python, srm - (are there more ?) to work with the new oo api and preferably - by using ext/rpc. -Responsibility: Harald -Time frame: 2 months (but i have to wait for a few engine features first) - - -Component: OO Extensions - Each OO extension has to be revised and rewritten to fit into - the new OO model. We should decide which extensions are a must - to have for the release and which can be ported by the maintainer - later as a separate pecl release. - A list of extensions to be extended that have to be investigated: - * browscap - * aggregate - * all *sql extensions (*_fetch_object) - * domxml (seems like christian is rewriting it anyways) - * ming -Responsibility: Harald (, extension maintainers) - - -Component: Abstract Data Types (ADT) -Responsibility: Sterling, Harald -Time frame: ? - - -Component: Test Suite - Extending the test suite with atleast a test for every - function in an extension that doesn't require external - resources. Also developing an automated test thing which - cvs ups's, compiles and tests the build on a daily base on - as much platforms/extensions as possible. - - The test suite will also be extended to support threaded - testing and testing for differing sapi modules (via http - calls or other methods). -Reponsibility: Derick (, extension maintainers) -Time frame: 3 months diff --git a/TSRM/LICENSE b/TSRM/LICENSE deleted file mode 100644 index 8d208476e4198..0000000000000 --- a/TSRM/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski. -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. - -- Neither name of the copyright holders nor the names of their 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 HOLDERS 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. diff --git a/TSRM/Makefile.am b/TSRM/Makefile.am deleted file mode 100644 index 91e585b65c89a..0000000000000 --- a/TSRM/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## process this file with automake to produce Makefile.am -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libtsrm.la -libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c - -depend: diff --git a/TSRM/TODO b/TSRM/TODO deleted file mode 100644 index 82b4fedfde142..0000000000000 --- a/TSRM/TODO +++ /dev/null @@ -1,2 +0,0 @@ -- Improve the lock in ts_resource_ex() in order to cover less code. - This can probably be done by more careful hash table access diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c deleted file mode 100644 index 208d5e95d3de7..0000000000000 --- a/TSRM/TSRM.c +++ /dev/null @@ -1,718 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski| - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#include "TSRM.h" - -#ifdef ZTS - -#include - -#if HAVE_STDARG_H -#include -#endif - -typedef struct _tsrm_tls_entry tsrm_tls_entry; - -struct _tsrm_tls_entry { - void **storage; - int count; - THREAD_T thread_id; - tsrm_tls_entry *next; -}; - - -typedef struct { - size_t size; - ts_allocate_ctor ctor; - ts_allocate_dtor dtor; - int done; -} tsrm_resource_type; - - -/* The memory manager table */ -static tsrm_tls_entry **tsrm_tls_table=NULL; -static int tsrm_tls_table_size; -static ts_rsrc_id id_count; - -/* The resource sizes table */ -static tsrm_resource_type *resource_types_table=NULL; -static int resource_types_table_size; - - -static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */ - -/* New thread handlers */ -static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler; -static tsrm_thread_end_func_t tsrm_new_thread_end_handler; - -/* Debug support */ -int tsrm_error(int level, const char *format, ...); - -/* Read a resource from a thread's resource storage */ -static int tsrm_error_level; -static FILE *tsrm_error_file; - -#if TSRM_DEBUG -#define TSRM_ERROR(args) tsrm_error args -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - { \ - int unshuffled_offset = TSRM_UNSHUFFLE_RSRC_ID(offset); \ - \ - if (offset==0) { \ - return &array; \ - } else if ((unshuffled_offset)>=0 && (unshuffled_offset)<(range)) { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - 0x%0.8X", \ - unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset])); \ - return array[unshuffled_offset]; \ - } else { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", \ - unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \ - return NULL; \ - } \ - } -#else -#define TSRM_ERROR(args) -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - if (offset==0) { \ - return &array; \ - } else { \ - return array[TSRM_UNSHUFFLE_RSRC_ID(offset)]; \ - } -#endif - -#if defined(PTHREADS) -/* Thread local storage */ -static pthread_key_t tls_key; -# define tsrm_tls_set(what) pthread_setspecific(tls_key, (void*)(what)) -# define tsrm_tls_get() pthread_getspecific(tls_key) - -#elif defined(TSRM_ST) -static int tls_key; -# define tsrm_tls_set(what) st_thread_setspecific(tls_key, (void*)(what)) -# define tsrm_tls_get() st_thread_getspecific(tls_key) - -#elif defined(TSRM_WIN32) -static DWORD tls_key; -# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what)) -# define tsrm_tls_get() TlsGetValue(tls_key) - -#elif defined(BETHREADS) -static int32 tls_key; -# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what)) -# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key) - -#else -# define tsrm_tls_set(what) -# define tsrm_tls_get() NULL -# warning tsrm_set_interpreter_context is probably broken on this platform -#endif - -/* Startup TSRM (call once for the entire process) */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename) -{ -#if defined(GNUPTH) - pth_init(); -#elif defined(PTHREADS) - pthread_key_create( &tls_key, 0 ); -#elif defined(TSRM_ST) - st_init(); - st_key_create(&tls_key, 0); -#elif defined(TSRM_WIN32) - tls_key = TlsAlloc(); -#elif defined(BETHREADS) - tls_key = tls_allocate(); -#endif - - tsrm_error_file = stderr; - tsrm_error_set(debug_level, debug_filename); - tsrm_tls_table_size = expected_threads; - - tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *)); - if (!tsrm_tls_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table")); - return 0; - } - id_count=0; - - resource_types_table_size = expected_resources; - resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type)); - if (!resource_types_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table")); - free(tsrm_tls_table); - tsrm_tls_table = NULL; - return 0; - } - - tsmm_mutex = tsrm_mutex_alloc(); - - tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources)); - return 1; -} - - -/* Shutdown TSRM (call once for the entire process) */ -TSRM_API void tsrm_shutdown(void) -{ - int i; - - if (tsrm_tls_table) { - for (i=0; inext; - for (j=0; jcount; j++) { - if (p->storage[j]) { - if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) { - resource_types_table[j].dtor(p->storage[j], &p->storage); - } - free(p->storage[j]); - } - } - free(p->storage); - free(p); - p = next_p; - } - } - free(tsrm_tls_table); - tsrm_tls_table = NULL; - } - if (resource_types_table) { - free(resource_types_table); - resource_types_table=NULL; - } - tsrm_mutex_free(tsmm_mutex); - tsmm_mutex = NULL; - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM")); - if (tsrm_error_file!=stderr) { - fclose(tsrm_error_file); - } -#if defined(GNUPTH) - pth_kill(); -#elif defined(PTHREADS) - pthread_setspecific(tls_key, 0); - pthread_key_delete(tls_key); -#elif defined(TSRM_WIN32) - TlsFree(tls_key); -#endif -} - - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size)); - - tsrm_mutex_lock(tsmm_mutex); - - /* obtain a resource id */ - *rsrc_id = TSRM_SHUFFLE_RSRC_ID(id_count++); - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", *rsrc_id)); - - /* store the new resource type in the resource sizes table */ - if (resource_types_table_size < id_count) { - resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count); - if (!resource_types_table) { - tsrm_mutex_unlock(tsmm_mutex); - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource")); - *rsrc_id = 0; - return 0; - } - resource_types_table_size = id_count; - } - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0; - - /* enlarge the arrays for the already active threads */ - for (i=0; icount < id_count) { - int j; - - p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count); - for (j=p->count; jstorage[j] = (void *) malloc(resource_types_table[j].size); - if (resource_types_table[j].ctor) { - resource_types_table[j].ctor(p->storage[j], &p->storage); - } - } - p->count = id_count; - } - p = p->next; - } - } - tsrm_mutex_unlock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id)); - return *rsrc_id; -} - - -static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id)); - (*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry)); - (*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count); - (*thread_resources_ptr)->count = id_count; - (*thread_resources_ptr)->thread_id = thread_id; - (*thread_resources_ptr)->next = NULL; - - /* Set thread local storage to this new thread resources structure */ - tsrm_tls_set(*thread_resources_ptr); - - if (tsrm_new_thread_begin_handler) { - tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage)); - } - for (i=0; istorage[i] = NULL; - } else - { - (*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size); - if (resource_types_table[i].ctor) { - resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage); - } - } - } - - if (tsrm_new_thread_end_handler) { - tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage)); - } - - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) -{ - THREAD_T thread_id; - int hash_value; - tsrm_tls_entry *thread_resources; - -#ifdef NETWARE - /* The below if loop is added for NetWare to fix an abend while unloading PHP - * when an Apache unload command is issued on the system console. - * While exiting from PHP, at the end for some reason, this function is called - * with tsrm_tls_table = NULL. When this happened, the server abends when - * tsrm_tls_table is accessed since it is NULL. - */ - if(tsrm_tls_table) { -#endif - if (!th_id) { - /* Fast path for looking up the resources for the current - * thread. Its used by just about every call to - * ts_resource_ex(). This avoids the need for a mutex lock - * and our hashtable lookup. - */ - thread_resources = tsrm_tls_get(); - - if (thread_resources) { - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); - } - thread_id = tsrm_thread_id(); - } else { - thread_id = *th_id; - } - - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id)); - tsrm_mutex_lock(tsmm_mutex); - - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - if (!thread_resources) { - allocate_new_resource(&tsrm_tls_table[hash_value], thread_id); - return ts_resource_ex(id, &thread_id); - } else { - do { - if (thread_resources->thread_id == thread_id) { - break; - } - if (thread_resources->next) { - thread_resources = thread_resources->next; - } else { - allocate_new_resource(&thread_resources->next, thread_id); - return ts_resource_ex(id, &thread_id); - /* - * thread_resources = thread_resources->next; - * break; - */ - } - } while (thread_resources); - } - tsrm_mutex_unlock(tsmm_mutex); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); -#ifdef NETWARE - } /* if(tsrm_tls_table) */ -#endif -} - -/* frees an interpreter context. You are responsible for making sure that - * it is not linked into the TSRM hash, and not marked as the current interpreter */ -void tsrm_free_interpreter_context(void *context) -{ - tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context; - int i; - - while (thread_resources) { - next = thread_resources->next; - - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - free(thread_resources); - thread_resources = next; - } -} - -void *tsrm_set_interpreter_context(void *new_ctx) -{ - tsrm_tls_entry *current; - - current = tsrm_tls_get(); - - /* TODO: unlink current from the global linked list, and replace it - * it with the new context, protected by mutex where/if appropriate */ - - /* Set thread local storage to this new thread resources structure */ - tsrm_tls_set(new_ctx); - - /* return old context, so caller can restore it when they're done */ - return current; -} - - -/* allocates a new interpreter context */ -void *tsrm_new_interpreter_context(void) -{ - tsrm_tls_entry *new_ctx, *current; - THREAD_T thread_id; - - thread_id = tsrm_thread_id(); - tsrm_mutex_lock(tsmm_mutex); - - current = tsrm_tls_get(); - - allocate_new_resource(&new_ctx, thread_id); - - /* switch back to the context that was in use prior to our creation - * of the new one */ - return tsrm_set_interpreter_context(current); -} - - -/* frees all resources allocated for the current thread */ -void ts_free_thread(void) -{ - tsrm_tls_entry *thread_resources; - int i; - THREAD_T thread_id = tsrm_thread_id(); - int hash_value; - tsrm_tls_entry *last=NULL; - - tsrm_mutex_lock(tsmm_mutex); - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - while (thread_resources) { - if (thread_resources->thread_id == thread_id) { - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - if (last) { - last->next = thread_resources->next; - } else { - tsrm_tls_table[hash_value] = thread_resources->next; - } - tsrm_tls_set(0); - free(thread_resources); - break; - } - if (thread_resources->next) { - last = thread_resources; - } - thread_resources = thread_resources->next; - } - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* deallocates all occurrences of a given id */ -void ts_free_id(ts_rsrc_id id) -{ - int i; - int j = TSRM_UNSHUFFLE_RSRC_ID(id); - - tsrm_mutex_lock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Freeing resource id %d", id)); - - if (tsrm_tls_table) { - for (i=0; icount > j && p->storage[j]) { - if (resource_types_table && resource_types_table[j].dtor) { - resource_types_table[j].dtor(p->storage[j], &p->storage); - } - free(p->storage[j]); - p->storage[j] = NULL; - } - p = p->next; - } - } - } - resource_types_table[j].done = 1; - - tsrm_mutex_unlock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id)); -} - - - - -/* - * Utility Functions - */ - -/* Obtain the current thread id */ -TSRM_API THREAD_T tsrm_thread_id(void) -{ -#ifdef TSRM_WIN32 - return GetCurrentThreadId(); -#elif defined(GNUPTH) - return pth_self(); -#elif defined(PTHREADS) - return pthread_self(); -#elif defined(NSAPI) - return systhread_current(); -#elif defined(PI3WEB) - return PIThread_getCurrent(); -#elif defined(TSRM_ST) - return st_thread_self(); -#elif defined(BETHREADS) - return find_thread(NULL); -#endif -} - - -/* Allocate a mutex */ -TSRM_API MUTEX_T tsrm_mutex_alloc(void) -{ - MUTEX_T mutexp; -#ifdef TSRM_WIN32 - mutexp = malloc(sizeof(CRITICAL_SECTION)); - InitializeCriticalSection(mutexp); -#elif defined(GNUPTH) - mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); - pth_mutex_init(mutexp); -#elif defined(PTHREADS) - mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); - pthread_mutex_init(mutexp,NULL); -#elif defined(NSAPI) - mutexp = crit_init(); -#elif defined(PI3WEB) - mutexp = PIPlatform_allocLocalMutex(); -#elif defined(TSRM_ST) - mutexp = st_mutex_new(); -#elif defined(BETHREADS) - mutexp = (beos_ben*)malloc(sizeof(beos_ben)); - mutexp->ben = 0; - mutexp->sem = create_sem(1, "PHP sempahore"); -#endif -#ifdef THR_DEBUG - printf("Mutex created thread: %d\n",mythreadid()); -#endif - return( mutexp ); -} - - -/* Free a mutex */ -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) -{ - if (mutexp) { -#ifdef TSRM_WIN32 - DeleteCriticalSection(mutexp); - free(mutexp); -#elif defined(GNUPTH) - free(mutexp); -#elif defined(PTHREADS) - pthread_mutex_destroy(mutexp); - free(mutexp); -#elif defined(NSAPI) - crit_terminate(mutexp); -#elif defined(PI3WEB) - PISync_delete(mutexp); -#elif defined(TSRM_ST) - st_mutex_destroy(mutexp); -#elif defined(BETHREADS) - delete_sem(mutexp->sem); - free(mutexp); -#endif - } -#ifdef THR_DEBUG - printf("Mutex freed thread: %d\n",mythreadid()); -#endif -} - - -/* Lock a mutex */ -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - EnterCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_acquire(mutexp, 0, NULL); -#elif defined(PTHREADS) - return pthread_mutex_lock(mutexp); -#elif defined(NSAPI) - return crit_enter(mutexp); -#elif defined(PI3WEB) - return PISync_lock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_lock(mutexp); -#elif defined(BETHREADS) - if (atomic_add(&mutexp->ben, 1) != 0) - return acquire_sem(mutexp->sem); - return 0; -#endif -} - - -/* Unlock a mutex */ -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - LeaveCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_release(mutexp); -#elif defined(PTHREADS) - return pthread_mutex_unlock(mutexp); -#elif defined(NSAPI) - return crit_exit(mutexp); -#elif defined(PI3WEB) - return PISync_unlock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_unlock(mutexp); -#elif defined(BETHREADS) - if (atomic_add(&mutexp->ben, -1) != 1) - return release_sem(mutexp->sem); - return 0; -#endif -} - - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler) -{ - void *retval = (void *) tsrm_new_thread_begin_handler; - - tsrm_new_thread_begin_handler = new_thread_begin_handler; - return retval; -} - - -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler) -{ - void *retval = (void *) tsrm_new_thread_end_handler; - - tsrm_new_thread_end_handler = new_thread_end_handler; - return retval; -} - - - -/* - * Debug support - */ - -#if TSRM_DEBUG -int tsrm_error(int level, const char *format, ...) -{ - if (level<=tsrm_error_level) { - va_list args; - int size; - - fprintf(tsrm_error_file, "TSRM: "); - va_start(args, format); - size = vfprintf(tsrm_error_file, format, args); - va_end(args); - fprintf(tsrm_error_file, "\n"); - fflush(tsrm_error_file); - return size; - } else { - return 0; - } -} -#endif - - -void tsrm_error_set(int level, char *debug_filename) -{ - tsrm_error_level = level; - -#if TSRM_DEBUG - if (tsrm_error_file!=stderr) { /* close files opened earlier */ - fclose(tsrm_error_file); - } - - if (debug_filename) { - tsrm_error_file = fopen(debug_filename, "w"); - if (!tsrm_error_file) { - tsrm_error_file = stderr; - } - } else { - tsrm_error_file = stderr; - } -#endif -} - -#endif /* ZTS */ diff --git a/TSRM/TSRM.dsp b/TSRM/TSRM.dsp deleted file mode 100644 index 1a5693f5a23c4..0000000000000 --- a/TSRM/TSRM.dsp +++ /dev/null @@ -1,186 +0,0 @@ -# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=TSRM - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "TSRM - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "TSRM - Win32 Debug_TS" -# Name "TSRM - Win32 Release_TS" -# Name "TSRM - Win32 Release_TS_inline" -# Name "TSRM - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\TSRM.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\TSRM.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config_common.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.h -# End Source File -# End Group -# End Target -# End Project diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h deleted file mode 100644 index b2868730e5123..0000000000000 --- a/TSRM/TSRM.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski| - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#ifndef TSRM_H -#define TSRM_H - -/* #ifndef WIN32 */ -#ifndef WIN32 -# include -#endif - -#ifdef WIN32 -# define TSRM_WIN32 -# include "tsrm_config.w32.h" -#endif - -#ifdef TSRM_WIN32 -# ifdef TSRM_EXPORTS -# define TSRM_API __declspec(dllexport) -# else -# define TSRM_API __declspec(dllimport) -# endif -#else -# define TSRM_API -#endif - -/* Only compile multi-threading functions if we're in ZTS mode */ -#ifdef ZTS - -#ifdef TSRM_WIN32 -# ifndef TSRM_INCLUDE_FULL_WINDOWS_HEADERS -# define WIN32_LEAN_AND_MEAN -# endif -# include -# include -#elif defined(GNUPTH) -# include -#elif defined(PTHREADS) -# include -#elif defined(TSRM_ST) -# include -#elif defined(BETHREADS) -#include -#include -#endif - -typedef int ts_rsrc_id; - -/* Define THREAD_T and MUTEX_T */ -#ifdef TSRM_WIN32 -# define THREAD_T DWORD -# define MUTEX_T CRITICAL_SECTION * -#elif defined(GNUPTH) -# define THREAD_T pth_t -# define MUTEX_T pth_mutex_t * -#elif defined(PTHREADS) -# define THREAD_T pthread_t -# define MUTEX_T pthread_mutex_t * -#elif defined(NSAPI) -# define THREAD_T SYS_THREAD -# define MUTEX_T CRITICAL -#elif defined(PI3WEB) -# define THREAD_T PIThread * -# define MUTEX_T PISync * -#elif defined(TSRM_ST) -# define THREAD_T st_thread_t -# define MUTEX_T st_mutex_t -#elif defined(BETHREADS) -# define THREAD_T thread_id -typedef struct { - sem_id sem; - int32 ben; -} beos_ben; -# define MUTEX_T beos_ben * -#endif - -typedef void (*ts_allocate_ctor)(void *, void ***); -typedef void (*ts_allocate_dtor)(void *, void ***); - -#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts - -#ifdef __cplusplus -extern "C" { -#endif - -/* startup/shutdown */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename); -TSRM_API void tsrm_shutdown(void); - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor); - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id); -#define ts_resource(id) ts_resource_ex(id, NULL) - -/* frees all resources allocated for the current thread */ -TSRM_API void ts_free_thread(void); - -/* deallocates all occurrences of a given id */ -TSRM_API void ts_free_id(ts_rsrc_id id); - - -/* Debug support */ -#define TSRM_ERROR_LEVEL_ERROR 1 -#define TSRM_ERROR_LEVEL_CORE 2 -#define TSRM_ERROR_LEVEL_INFO 3 - -typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls); -typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls); - - -TSRM_API int tsrm_error(int level, const char *format, ...); -TSRM_API void tsrm_error_set(int level, char *debug_filename); - -/* utility functions */ -TSRM_API THREAD_T tsrm_thread_id(void); -TSRM_API MUTEX_T tsrm_mutex_alloc(void); -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp); - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler); -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler); - -/* these 3 APIs should only be used by people that fully understand the threading model - * used by PHP/Zend and the selected SAPI. */ -TSRM_API void *tsrm_new_interpreter_context(void); -TSRM_API void *tsrm_set_interpreter_context(void *new_ctx); -TSRM_API void tsrm_free_interpreter_context(void *context); - -#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) -#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) - -#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) -#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx -#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls -#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) -#define TSRMLS_D void ***tsrm_ls -#define TSRMLS_DC , TSRMLS_D -#define TSRMLS_C tsrm_ls -#define TSRMLS_CC , TSRMLS_C - -#ifdef __cplusplus -} -#endif - -#else /* non ZTS */ - -#define TSRMLS_FETCH() -#define TSRMLS_FETCH_FROM_CTX(ctx) -#define TSRMLS_SET_CTX(ctx) -#define TSRMLS_D void -#define TSRMLS_DC -#define TSRMLS_C -#define TSRMLS_CC - -#endif /* ZTS */ - -#endif /* TSRM_H */ diff --git a/TSRM/acconfig.h b/TSRM/acconfig.h deleted file mode 100644 index 2b94cf35e711d..0000000000000 --- a/TSRM/acconfig.h +++ /dev/null @@ -1 +0,0 @@ -#undef PTHREADS diff --git a/TSRM/acinclude.m4 b/TSRM/acinclude.m4 deleted file mode 100644 index fcf97fd352ee0..0000000000000 --- a/TSRM/acinclude.m4 +++ /dev/null @@ -1,5 +0,0 @@ - -AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[ - LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' -]) - diff --git a/TSRM/build.mk b/TSRM/build.mk deleted file mode 100644 index aac1a8b982ae5..0000000000000 --- a/TSRM/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile to generate build tools -# -# Standard usage: -# make -f build.mk -# -# Written by Sascha Schumann -# -# $Id$ - - -LT_TARGETS = ltmain.sh ltconfig - -config_h_in = tsrm_config.h.in - -makefile_am_files = Makefile.am -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in) - -all: $(targets) - -clean: - rm -f $(targets) - -$(LT_TARGETS): - rm -f $(LT_TARGETS) - libtoolize --automake $(AMFLAGS) -f - -$(makefile_in_files): $(makefile_am_files) - automake -a -i $(AMFLAGS) $(makefile_files) - -aclocal.m4: configure.in acinclude.m4 - aclocal - -$(config_h_in): configure.in acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @rm -f $@ - autoheader - -configure: aclocal.m4 configure.in - autoconf diff --git a/TSRM/buildconf b/TSRM/buildconf deleted file mode 100755 index fe8dee6f76780..0000000000000 --- a/TSRM/buildconf +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -case "$1" in ---copy) - automake_flags=--copy - shift -;; -esac - -libtoolize --force --automake $automake_flags - -mv aclocal.m4 aclocal.m4.old 2>/dev/null -aclocal -if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then - echo "buildconf: keeping ${1}aclocal.m4" - mv aclocal.m4.old aclocal.m4 -else - echo "buildconf: created or modified ${1}aclocal.m4" -fi - -autoheader - -automake --add-missing --include-deps $automake_flags - -mv configure configure.old 2>/dev/null -autoconf -if cmp configure.old configure > /dev/null 2>&1; then - echo "buildconf: keeping ${1}configure" - mv configure.old configure -else - echo "buildconf: created or modified ${1}configure" -fi - diff --git a/TSRM/config.w32 b/TSRM/config.w32 deleted file mode 100644 index 525f4390e55a7..0000000000000 --- a/TSRM/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ft=javascript -// $Id$ - -if (CHECK_HEADER_ADD_INCLUDE("NewAPIs.h", "CFLAGS_PHP", php_usual_include_suspects)) { - // Need to add the flag directly, since TSRM doesn't include the config - // header - ADD_FLAG("CFLAGS_PHP", "/DHAVE_NEWAPIS_H=1"); -} -ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c tsrm_win32.c"); - diff --git a/TSRM/configure.in b/TSRM/configure.in deleted file mode 100644 index acfdd00b3531f..0000000000000 --- a/TSRM/configure.in +++ /dev/null @@ -1,31 +0,0 @@ -dnl $Id$ -dnl -dnl Minimalistic configure.in for TSRM. -dnl - -AC_INIT(TSRM.c) -AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine) -AM_CONFIG_HEADER(tsrm_config.h) - -sinclude(tsrm.m4) - -TSRM_BASIC_CHECKS -TSRM_THREADS_CHECKS - -AM_PROG_LIBTOOL -if test "$enable_debug" != "yes"; then - AM_SET_LIBTOOL_VARIABLE([--silent]) -fi - -dnl TSRM_PTHREAD - -AC_CHECK_HEADERS( -utime.h \ -dirent.h \ -stdarg.h \ -alloca.h \ -unistd.h \ -limits.h -) - -AC_OUTPUT(Makefile) diff --git a/TSRM/readdir.h b/TSRM/readdir.h deleted file mode 100644 index b0f1ad9e6f99b..0000000000000 --- a/TSRM/readdir.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef READDIR_H -#define READDIR_H - - -/* - * Structures and types used to implement opendir/readdir/closedir - * on Windows 95/NT. - */ - -#include -#include -#include -#include - - -/* struct dirent - same as Unix */ - -struct dirent { - long d_ino; /* inode (always 1 in WIN32) */ - off_t d_off; /* offset to this dirent */ - unsigned short d_reclen; /* length of d_name */ - char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */ -}; - - -/* typedef DIR - not the same as Unix */ -typedef struct { - long handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ - short finished; /* 1 if there are not more files */ - struct _finddata_t fileinfo; /* from _findfirst/_findnext */ - char *dir; /* the dir we are reading */ - struct dirent dent; /* the dirent to return */ -} DIR; - -/* Function prototypes */ -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -int closedir(DIR *); -void rewinddir(DIR *); - - -#endif /* READDIR_H */ diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 deleted file mode 100644 index 38494ce7cae9b..0000000000000 --- a/TSRM/threads.m4 +++ /dev/null @@ -1,173 +0,0 @@ -dnl Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl -dnl 1. Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl -dnl 2. Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in -dnl the documentation and/or other materials provided with the -dnl distribution. -dnl -dnl THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY -dnl EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SASCHA SCHUMANN OR -dnl HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -dnl NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -dnl OF THE POSSIBILITY OF SUCH DAMAGE. - -dnl -dnl PTHREADS_FLAGS -dnl -dnl Set some magic defines to achieve POSIX threads conformance -dnl -AC_DEFUN([PTHREADS_FLAGS],[ - if test -z "$host_alias" && test -n "$host"; then - host_alias=$host - fi - if test -z "$host_alias"; then - AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) - fi - case $host_alias in - *solaris*) - PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; - *freebsd*) - PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; - *linux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *aix*) - PTHREAD_FLAGS=-D_THREAD_SAFE;; - *irix*) - PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;; - *hpux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *sco*) - PTHREAD_FLAGS=-D_REENTRANT;; -dnl Solves sigwait() problem, creates problems with u_long etc. -dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; - esac - - if test -n "$PTHREAD_FLAGS"; then - CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" - fi -])dnl -dnl -dnl PTHREADS_CHECK_COMPILE -dnl -dnl Check whether the current setup can use POSIX threads calls -dnl -AC_DEFUN([PTHREADS_CHECK_COMPILE], [ -AC_TRY_RUN( [ -#include -#include - -void *thread_routine(void *data) { - return data; -} - -int main() { - pthread_t thd; - pthread_mutexattr_t mattr; - int data = 1; - pthread_mutexattr_init(&mattr); - return pthread_create(&thd, NULL, thread_routine, &data); -} ], [ - pthreads_working=yes - ], [ - pthreads_working=no - ], [ - dnl For cross compiling running this test is of no use. NetWare supports pthreads - pthreads_working=no - case $host_alias in - *netware*) - pthreads_working=yes - esac -] -) ] )dnl -dnl -dnl PTHREADS_CHECK() -dnl -dnl Try to find a way to enable POSIX threads -dnl -dnl Magic flags -dnl -kthread gcc (FreeBSD) -dnl -Kthread UDK cc (UnixWare) -dnl -mt WorkShop cc (Solaris) -dnl -mthreads gcc (AIX) -dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD) -dnl -pthreads gcc (Solaris) -dnl -qthreaded AIX cc V5 -dnl -threads gcc (HP-UX) -dnl -AC_DEFUN([PTHREADS_CHECK],[ - -if test "$beos_threads" = "1"; then - pthreads_working="yes" - ac_cv_pthreads_cflags="" -else - save_CFLAGS=$CFLAGS - save_LIBS=$LIBS - PTHREADS_ASSIGN_VARS - PTHREADS_CHECK_COMPILE - LIBS=$save_LIBS - CFLAGS=$save_CFLAGS - - AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ - ac_cv_pthreads_cflags= - if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do - ac_save=$CFLAGS - CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE - CFLAGS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_cflags=$flag - break - fi - done - fi -fi -]) - -AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ -ac_cv_pthreads_lib= -if test "$pthreads_working" != "yes"; then - for lib in pthread pthreads c_r; do - ac_save=$LIBS - LIBS="$LIBS -l$lib" - PTHREADS_CHECK_COMPILE - LIBS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_lib=$lib - break - fi - done -fi -]) - -if test "$pthreads_working" = "yes"; then - threads_result="POSIX-Threads found" -else - threads_result="POSIX-Threads not found" -fi -])dnl -dnl -dnl -AC_DEFUN([PTHREADS_ASSIGN_VARS],[ -if test -n "$ac_cv_pthreads_lib"; then - LIBS="$LIBS -l$ac_cv_pthreads_lib" -fi - -if test -n "$ac_cv_pthreads_cflags"; then - CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" -fi -])dnl diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4 deleted file mode 100644 index bf4a872ac6280..0000000000000 --- a/TSRM/tsrm.m4 +++ /dev/null @@ -1,129 +0,0 @@ - -dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND) -AC_DEFUN([TSRM_CHECK_GCC_ARG],[ - gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_) - AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [ - echo 'void somefunc() { };' > conftest.c - cmd='$CC $1 -c conftest.c' - if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then - ac_result=no - else - ac_result=yes - fi - eval $gcc_arg_name=$ac_result - rm -f conftest.* - ]) - if eval test "\$$gcc_arg_name" = "yes"; then - $2 - else - : - $3 - fi -]) - -AC_DEFUN([TSRM_BASIC_CHECKS],[ - -AC_REQUIRE([AC_PROG_CC])dnl -dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl -AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl - -AC_CHECK_HEADERS(stdarg.h) - -]) - - -AC_DEFUN([TSRM_CHECK_PTH],[ - -AC_MSG_CHECKING(for GNU Pth) -PTH_PREFIX="`$1 --prefix`" -if test -z "$PTH_PREFIX"; then - AC_MSG_RESULT(Please check your Pth installation) -fi - -CPPFLAGS="$CPPFLAGS `$1 --cflags`" -LDFLAGS="$LDFLAGS `$1 --ldflags`" -LIBS="$LIBS `$1 --libs`" - -AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth]) -AC_MSG_RESULT(yes - installed in $PTH_PREFIX) - -]) - -AC_DEFUN([TSRM_CHECK_ST],[ - if test -r "$1/include/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1/include" - LDFLAGS="$LDFLAGS -L$1/lib" - elif test -r "$1/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1" - LDFLAGS="$LDFLAGS -L$1" - fi - AC_CHECK_HEADERS(st.h,[],[ - AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix]) - ]) - LIBS="$LIBS -lst" - AC_MSG_CHECKING(for SGI's State Threads) - AC_MSG_RESULT(yes) - AC_DEFINE(TSRM_ST, 1, [ ]) -]) - -sinclude(threads.m4) -sinclude(TSRM/threads.m4) - -AC_DEFUN([TSRM_CHECK_PTHREADS],[ - -PTHREADS_CHECK - -if test "$beos_threads" = "1"; then - AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads) -else - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR(Your system seems to lack POSIX threads.) - fi - - AC_DEFINE(PTHREADS, 1, Whether to use Pthreads) - - AC_MSG_CHECKING(for POSIX threads) - AC_MSG_RESULT(yes) -fi -]) - - -AC_DEFUN([TSRM_THREADS_CHECKS],[ - -dnl For the thread implementations, we always use --with-* -dnl to maintain consistency - -AC_ARG_WITH(tsrm-pth, -[ --with-tsrm-pth[=pth-config] - Use GNU Pth],[ - TSRM_PTH=$withval -],[ - TSRM_PTH=no -]) - -AC_ARG_WITH(tsrm-st, -[ --with-tsrm-st Use SGI's State Threads],[ - TSRM_ST=$withval -],[ - TSRM_ST=no -]) - -AC_ARG_WITH(tsrm-pthreads, -[ --with-tsrm-pthreads Use POSIX threads (default)],[ - TSRM_PTHREADS=$withval -],[ - TSRM_PTHREADS=yes -]) - -test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config - -if test "$TSRM_PTH" != "no"; then - TSRM_CHECK_PTH($TSRM_PTH) -elif test "$TSRM_ST" != "no"; then - TSRM_CHECK_ST($TSRM_ST) -elif test "$TSRM_PTHREADS" != "no"; then - TSRM_CHECK_PTHREADS -fi - -]) diff --git a/TSRM/tsrm_config.w32.h b/TSRM/tsrm_config.w32.h deleted file mode 100644 index 28a4e4242e014..0000000000000 --- a/TSRM/tsrm_config.w32.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef TSRM_CONFIG_W32_H -#define TSRM_CONFIG_W32_H - -#define HAVE_UTIME 1 -#define HAVE_ALLOCA 1 -#define HAVE_REALPATH 1 - -#include -#include -#include - -#undef inline -#ifdef ZEND_WIN32_FORCE_INLINE -# define inline __forceinline -#else -# define inline -#endif - - -#endif diff --git a/TSRM/tsrm_config_common.h b/TSRM/tsrm_config_common.h deleted file mode 100644 index bdd171e619046..0000000000000 --- a/TSRM/tsrm_config_common.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef TSRM_CONFIG_COMMON_H -#define TSRM_CONFIG_COMMON_H - -#if WINNT|WIN32 -# define TSRM_WIN32 -#endif - -#ifdef TSRM_WIN32 -# include "tsrm_config.w32.h" -#else -# include -# include -#endif - -#if HAVE_ALLOCA_H && !defined(_ALLOCA_H) -# include -#endif - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# ifndef HAVE_ALLOCA_H -# ifdef _AIX -#pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# ifndef NETWARE -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_LIMITS_H -#include -#endif - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 256 -# endif -#endif - -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) -# define tsrm_do_alloca(p) alloca(p) -# define tsrm_free_alloca(p) -#else -# define tsrm_do_alloca(p) malloc(p) -# define tsrm_free_alloca(p) free(p) -#endif - -#endif /* TSRM_CONFIG_COMMON_H */ diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c deleted file mode 100644 index 1182126d2614c..0000000000000 --- a/TSRM/tsrm_nw.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Venkat Raghavan S | - | Anantha Kesari H Y | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include - -#include "TSRM.h" - -#ifdef NETWARE - -#ifdef USE_MKFIFO -#include -#elif !defined(USE_PIPE_OPEN) /* NXFifoOpen */ -#include -#endif - -#include -#include - -#include - -#include "mktemp.h" - -/* strtok() call in LibC is abending when used in a different address space - * -- hence using PHP's version itself for now - */ -#include "tsrm_strtok_r.h" -#define tsrm_strtok_r(a,b,c) strtok((a),(b)) - -#define WHITESPACE " \t" -#define MAX_ARGS 10 - - -TSRM_API FILE* popen(const char *commandline, const char *type) -{ - char *command = NULL, *argv[MAX_ARGS] = {'\0'}, **env = NULL; - char *tempName = "sys:/php/temp/phpXXXXXX.tmp"; - char *filePath = NULL; - char *ptr = NULL; - int ptrLen = 0, argc = 0, i = 0, envCount = 0, err = 0; - FILE *stream = NULL; -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - int pipe_handle; - int mode = O_RDONLY; -#else - NXHandle_t pipe_handle; - NXMode_t mode = NX_O_RDONLY; -#endif - NXExecEnvSpec_t envSpec; - NXNameSpec_t nameSpec; - NXVmId_t newVM = 0; - - /* Check for validity of input parameters */ - if (!commandline || !type) - return NULL; - - /* Get temporary file name */ - filePath = mktemp(tempName); - if (!filePath) - return NULL; - - /* Set pipe mode according to type -- for now allow only "r" or "w" */ - if (strcmp(type, "r") == 0) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - mode = O_RDONLY; -#else - mode = NX_O_RDONLY; -#endif - else if (strcmp(type, "w") == 0) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - mode = O_WRONLY; -#else - mode = NX_O_WRONLY; -#endif - else - return NULL; - -#ifdef USE_PIPE_OPEN - pipe_handle = pipe_open(filePath, mode); - if (pipe_handle == -1) - return NULL; -#elif defined(USE_MKFIFO) - pipe_handle = mkfifo(filePath, mode); - if (pipe_handle == -1) - return NULL; -#else - /* - NetWare doesn't require first parameter - * - Allowing LibC to choose the buffer size for now - */ - err = NXFifoOpen(0, filePath, mode, 0, &pipe_handle); - if (err) - return NULL; -#endif - - /* Copy the environment variables in preparation for the spawn call */ - envCount = NXGetEnvCount() + 1; /* add one for NULL */ - env = (char **) NXMemAlloc(sizeof(char *) * envCount, 0); - if (!env) - return NULL; - - err = NXCopyEnv(env, envCount); - if (err) { - NXMemFree (env); - return NULL; - } - - /* Separate commandline string into words */ - ptr = tsrm_strtok_r((char*)commandline, WHITESPACE, NULL); - ptrLen = strlen(ptr); - - command = (char*)malloc(ptrLen + 1); - if (!command) { - NXMemFree (env); - return NULL; - } - - strcpy (command, ptr); - - ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL); - while (ptr && (argc < MAX_ARGS)) { - ptrLen = strlen(ptr); - - argv[argc] = (char*)malloc(ptrLen + 1); - if (!argv[argc]) { - NXMemFree (env); - if (command) - free (command); - - for (i = 0; i < argc; i++) { - if (argv[i]) - free (argv[i]); - } - - return NULL; - } - - strcpy (argv[argc], ptr); - argc++; - ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL); - } - - /* Setup the execution environment and spawn new process */ - envSpec.esFlags = 0; /* Not used */ - envSpec.esArgc = argc; - envSpec.esArgv = (void **) argv; - envSpec.esEnv = (void **) env; - -/* envSpec.esStdin.ssType = */ - envSpec.esStdout.ssType = NX_OBJ_FIFO; - envSpec.esStderr.ssType = NX_OBJ_FILE; - - /* 'ssHandle' is not a struct/union/class member */ -/* - envSpec.esStdin.ssHandle = - envSpec.esStdout.ssHandle = - envSpec.esStderr.ssHandle = -1; -*/ - envSpec.esStdin.ssPathCtx = NULL; - envSpec.esStdout.ssPathCtx = NULL; - envSpec.esStderr.ssPathCtx = NULL; - -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - if (mode == O_RDONLY) { -#else - if (mode == NX_O_RDONLY) { -#endif - envSpec.esStdin.ssPath = filePath; - envSpec.esStdout.ssPath = stdout; - } else { /* Write Only */ - envSpec.esStdin.ssPath = stdin; - envSpec.esStdout.ssPath = filePath; - } - - envSpec.esStderr.ssPath = stdout; - - nameSpec.ssType = NX_OBJ_FIFO; -/* nameSpec.ssHandle = 0; */ /* 'ssHandle' is not a struct/union/class member */ - nameSpec.ssPathCtx = NULL; /* Not used */ - nameSpec.ssPath = argv[0]; - err = NXVmSpawn(&nameSpec, &envSpec, 0, &newVM); - if (!err) - /* Get file pointer corresponding to the pipe (file) opened */ - stream = fdopen(pipe_handle, type); - - /* Clean-up */ - if (env) - NXMemFree (env); - - if (pipe_handle) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - close(pipe_handle); -#else - NXClose(pipe_handle); -#endif - - if (command) - free (command); - - for (i = 0; i < argc; i++) { - if (argv[i]) - free (argv[i]); - } - - return stream; -} - -TSRM_API int pclose(FILE* stream) -{ - int err = 0; - NXHandle_t fd = 0; - - /* Get the process associated with this pipe (file) handle and terminate it */ - fd = fileno(stream); - NXClose (fd); - - err = fclose(stream); - - return err; -} - -#endif /* NETWARE */ diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h deleted file mode 100644 index 14af1607adbcc..0000000000000 --- a/TSRM/tsrm_nw.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Venkat Raghavan S | - | Anantha Kesari H Y | - +----------------------------------------------------------------------+ -*/ - - -#ifndef TSRM_NW_H -#define TSRM_NW_H - -#include "TSRM.h" - -TSRM_API FILE* popen(const char *command, const char *type); -TSRM_API int pclose(FILE* stream); - -#endif diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c deleted file mode 100644 index e9ad26a7ac297..0000000000000 --- a/TSRM/tsrm_strtok_r.c +++ /dev/null @@ -1,63 +0,0 @@ -#include - -#include "tsrm_config_common.h" -#include "tsrm_strtok_r.h" - -static inline int in_character_class(char ch, const char *delim) -{ - while (*delim) { - if (*delim == ch) { - return 1; - } - delim++; - } - return 0; -} - -char *tsrm_strtok_r(char *s, const char *delim, char **last) -{ - char *token; - - if (s == NULL) { - s = *last; - } - - while (*s && in_character_class(*s, delim)) { - s++; - } - if (!*s) { - return NULL; - } - - token = s; - - while (*s && !in_character_class(*s, delim)) { - s++; - } - if (!*s) { - *last = s; - } else { - *s = '\0'; - *last = s + 1; - } - return token; -} - -#if 0 - -main() -{ - char foo[] = "/foo/bar//\\barbara"; - char *last; - char *token; - - token = tsrm_strtok_r(foo, "/\\", &last); - while (token) { - printf ("Token = '%s'\n", token); - token = tsrm_strtok_r(NULL, "/\\", &last); - } - - return 0; -} - -#endif diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h deleted file mode 100644 index 8c9e8198e780f..0000000000000 --- a/TSRM/tsrm_strtok_r.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TSRM_STRTOK_R -#define TSRM_STRTOK_R - -char *tsrm_strtok_r(char *s, const char *delim, char **last); - -#endif diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c deleted file mode 100644 index baf5843d00e54..0000000000000 --- a/TSRM/tsrm_virtual_cwd.c +++ /dev/null @@ -1,1052 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tsrm_virtual_cwd.h" -#include "tsrm_strtok_r.h" - -#ifdef TSRM_WIN32 -#include -#include "tsrm_win32.h" -# if HAVE_NEWAPIS_H -# define WANT_GETLONGPATHNAME_WRAPPER -# define COMPILE_NEWAPIS_STUBS -# include -# endif -#endif - -#ifdef NETWARE -#include -#endif - -#ifndef HAVE_REALPATH -#define realpath(x,y) strcpy(y,x) -#endif - -#define VIRTUAL_CWD_DEBUG 0 - -#include "TSRM.h" - -/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */ -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) -MUTEX_T cwd_mutex; -#endif - -#ifdef ZTS -ts_rsrc_id cwd_globals_id; -#else -virtual_cwd_globals cwd_globals; -#endif - -cwd_state main_cwd_state; /* True global */ - -#ifndef TSRM_WIN32 -#include -#else -#include -#endif - -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - -#ifdef TSRM_WIN32 -#include -#define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) -#define TOKENIZER_STRING "/\\" - -static int php_check_dots(const char *element, int n) -{ - while (n-- > 0) if (element[n] != '.') break; - - return (n != -1); -} - -#define IS_DIRECTORY_UP(element, len) \ - (len >= 2 && !php_check_dots(element, len)) - -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && element[0] == '.') - -#elif defined(NETWARE) -/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows -- - but rest of the stuff is like Unix */ -/* strtok() call in LibC is abending when used in a different address space -- hence using - PHP's version itself for now */ -/*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/ -#define TOKENIZER_STRING "/\\" - -#else -#define TOKENIZER_STRING "/" -#endif - - -/* default macros */ - -#ifndef IS_DIRECTORY_UP -#define IS_DIRECTORY_UP(element, len) \ - (len == 2 && element[0] == '.' && element[1] == '.') -#endif - -#ifndef IS_DIRECTORY_CURRENT -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && element[0] == '.') -#endif - -/* define this to check semantics */ -#define IS_DIR_OK(s) (1) - -#ifndef IS_DIR_OK -#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0) -#endif - - -#define CWD_STATE_COPY(d, s) \ - (d)->cwd_length = (s)->cwd_length; \ - (d)->cwd = (char *) malloc((s)->cwd_length+1); \ - memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1); - -#define CWD_STATE_FREE(s) \ - free((s)->cwd); - -static int php_is_dir_ok(const cwd_state *state) -{ - struct stat buf; - - if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) - return (0); - - return (1); -} - -static int php_is_file_ok(const cwd_state *state) -{ - struct stat buf; - - if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) - return (0); - - return (1); -} - -static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) -{ - CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state); -#ifdef REALPATH_CACHE - cwd_globals->realpath_cache_size = 0; - cwd_globals->realpath_cache_size_limit = REALPATH_CACHE_SIZE; - cwd_globals->realpath_cache_ttl = REALPATH_CACHE_TTL; - memset(cwd_globals->realpath_cache, 0, sizeof(cwd_globals->realpath_cache)); -#endif -} - -static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) -{ - CWD_STATE_FREE(&cwd_globals->cwd); -#ifdef REALPATH_CACHE - { - int i; - - for (i = 0; i < sizeof(cwd_globals->realpath_cache)/sizeof(cwd_globals->realpath_cache[0]); i++) { - realpath_cache_bucket *p = cwd_globals->realpath_cache[i]; - while (p != NULL) { - realpath_cache_bucket *r = p; - p = p->next; - free(r); - } - } - } -#endif -} - -static char *tsrm_strndup(const char *s, size_t length) -{ - char *p; - - p = (char *) malloc(length+1); - if (!p) { - return (char *)NULL; - } - if (length) { - memcpy(p,s,length); - } - p[length]=0; - return p; -} - -CWD_API void virtual_cwd_startup(void) -{ - char cwd[MAXPATHLEN]; - char *result; - -#ifdef NETWARE - result = getcwdpath(cwd, NULL, 1); - if(result) - { - char *c=cwd; - while(c = strchr(c, '\\')) - { - *c='/'; - ++c; - } - } -#else - result = getcwd(cwd, sizeof(cwd)); -#endif - if (!result) { - cwd[0] = '\0'; - } - main_cwd_state.cwd = strdup(cwd); - main_cwd_state.cwd_length = strlen(cwd); - -#ifdef ZTS - ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor); -#else - cwd_globals_ctor(&cwd_globals TSRMLS_CC); -#endif - -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) - cwd_mutex = tsrm_mutex_alloc(); -#endif -} - -CWD_API void virtual_cwd_shutdown(void) -{ -#ifndef ZTS - cwd_globals_dtor(&cwd_globals TSRMLS_CC); -#endif -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) - tsrm_mutex_free(cwd_mutex); -#endif - - free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */ -} - -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) -{ - cwd_state *state; - - state = &CWDG(cwd); - - if (state->cwd_length == 0) { - char *retval; - - *length = 1; - retval = (char *) malloc(2); - retval[0] = DEFAULT_SLASH; - retval[1] = '\0'; - return retval; - } - -#ifdef TSRM_WIN32 - /* If we have something like C: */ - if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') { - char *retval; - - *length = state->cwd_length+1; - retval = (char *) malloc(*length+1); - memcpy(retval, state->cwd, *length); - retval[*length-1] = DEFAULT_SLASH; - retval[*length] = '\0'; - return retval; - } -#endif - *length = state->cwd_length; - return strdup(state->cwd); -} - - -/* Same semantics as UNIX getcwd() */ -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) -{ - size_t length; - char *cwd; - - cwd = virtual_getcwd_ex(&length TSRMLS_CC); - - if (buf == NULL) { - return cwd; - } - if (length > size-1) { - free(cwd); - errno = ERANGE; /* Is this OK? */ - return NULL; - } - memcpy(buf, cwd, length+1); - free(cwd); - return buf; -} - -#ifdef REALPATH_CACHE -static inline unsigned long realpath_cache_key(const char *path, int path_len) -{ - register unsigned long h; - - const char *e = path + path_len; - for (h = 2166136261U; path < e; ) { - h *= 16777619; - h ^= *path++; - } - return h; -} - -static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC) -{ - long size = sizeof(realpath_cache_bucket) + path_len + 1 + realpath_len + 1; - if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) { - realpath_cache_bucket *bucket = malloc(size); - unsigned long n; - - bucket->key = realpath_cache_key(path, path_len); - bucket->path = (char*)bucket + sizeof(realpath_cache_bucket); - memcpy(bucket->path, path, path_len+1); - bucket->path_len = path_len; - bucket->realpath = bucket->path + (path_len + 1); - memcpy(bucket->realpath, realpath, realpath_len+1); - bucket->realpath_len = realpath_len; - bucket->expires = t + CWDG(realpath_cache_ttl); - n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); - bucket->next = CWDG(realpath_cache)[n]; - CWDG(realpath_cache)[n] = bucket; - CWDG(realpath_cache_size) += size; - } -} - -static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) -{ - unsigned long key = realpath_cache_key(path, path_len); - unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); - realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; - - while (*bucket != NULL) { - if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) { - realpath_cache_bucket *r = *bucket; - *bucket = (*bucket)->next; - CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; - free(r); - } else if (key == (*bucket)->key && path_len == (*bucket)->path_len && - memcmp(path, (*bucket)->path, path_len) == 0) { - return *bucket; - } else { - *bucket = (*bucket)->next; - } - } - return NULL; -} -#endif - - -/* Resolve path relatively to state and put the real path into state */ -/* returns 0 for ok, 1 for error */ -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) -{ - int path_length = strlen(path); - char *ptr, *path_copy; - char *tok = NULL; - int ptr_length; - cwd_state old_state; - int ret = 0; - int copy_amount = -1; - char *free_path; - unsigned char is_absolute = 0; -#ifndef TSRM_WIN32 - char resolved_path[MAXPATHLEN]; -#else - char *new_path; -#endif -#ifdef REALPATH_CACHE - char orig_path[MAXPATHLEN]; - int orig_path_len; - realpath_cache_bucket *bucket; - time_t t; - TSRMLS_FETCH(); -#endif - - if (path_length == 0) - return (0); - if (path_length >= MAXPATHLEN) - return (1); - -#ifdef REALPATH_CACHE - if (use_realpath && CWDG(realpath_cache_size_limit)) { - if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) { - memcpy(orig_path, path, path_length+1); - orig_path_len = path_length; - } else { - orig_path_len = path_length + state->cwd_length + 1; - if (orig_path_len >= MAXPATHLEN) { - return 1; - } - memcpy(orig_path, state->cwd, state->cwd_length); - orig_path[state->cwd_length] = DEFAULT_SLASH; - memcpy(orig_path + state->cwd_length + 1, path, path_length + 1); - } - t = CWDG(realpath_cache_ttl)?time(NULL):0; - if ((bucket = realpath_cache_find(orig_path, orig_path_len, t TSRMLS_CC)) != NULL) { - int len = bucket->realpath_len; - - CWD_STATE_COPY(&old_state, state); - state->cwd = (char *) realloc(state->cwd, len+1); - memcpy(state->cwd, bucket->realpath, len+1); - state->cwd_length = len; - if (verify_path && verify_path(state)) { - CWD_STATE_FREE(state); - *state = old_state; - return 1; - } else { - CWD_STATE_FREE(&old_state); - return 0; - } - } - } -#endif -#if !defined(TSRM_WIN32) && !defined(NETWARE) - /* cwd_length can be 0 when getcwd() fails. - * This can happen under solaris when a dir does not have read permissions - * but *does* have execute permissions */ - if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) { - if (use_realpath) { - if (realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */ - path = resolved_path; - path_length = strlen(path); - } else { - /* disable for now - return 1; */ - } - } - } else { /* Concat current directory with relative path and then run realpath() on it */ - char *tmp; - char *ptr; - - ptr = tmp = (char *) malloc(state->cwd_length+path_length+sizeof("/")); - if (!tmp) { - return 1; - } - memcpy(ptr, state->cwd, state->cwd_length); - ptr += state->cwd_length; - *ptr++ = DEFAULT_SLASH; - memcpy(ptr, path, path_length); - ptr += path_length; - *ptr = '\0'; - if (strlen(tmp) >= MAXPATHLEN) { - free(tmp); - return 1; - } - if (use_realpath) { - if (realpath(tmp, resolved_path)) { - path = resolved_path; - path_length = strlen(path); - } else { - /* disable for now - free(tmp); - return 1; */ - } - } - free(tmp); - } -#endif -#if defined(TSRM_WIN32) - { - char *dummy = NULL; - int new_path_length; - - new_path_length = GetLongPathName(path, dummy, 0) + 1; - if (new_path_length == 0) { - return 1; - } - new_path = (char *) malloc(new_path_length); - if (!new_path) { - return 1; - } - - if (GetLongPathName(path, new_path, new_path_length) != 0) { - path = new_path; - path_length = new_path_length; - } else { - free(new_path); - new_path = NULL; - } - } -#endif - free_path = path_copy = tsrm_strndup(path, path_length); - - CWD_STATE_COPY(&old_state, state); -#if VIRTUAL_CWD_DEBUG - fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path); -#endif - if (IS_ABSOLUTE_PATH(path_copy, path_length)) { - copy_amount = COPY_WHEN_ABSOLUTE(path_copy); - is_absolute = 1; -#ifdef TSRM_WIN32 - } else if (IS_SLASH(path_copy[0])) { - copy_amount = 2; -#endif - } - - if (copy_amount != -1) { - state->cwd = (char *) realloc(state->cwd, copy_amount + 1); - if (copy_amount) { - if (is_absolute) { - memcpy(state->cwd, path_copy, copy_amount); - path_copy += copy_amount; - } else { - memcpy(state->cwd, old_state.cwd, copy_amount); - } - } - state->cwd[copy_amount] = '\0'; - state->cwd_length = copy_amount; - } - - - if (state->cwd_length > 0 || IS_ABSOLUTE_PATH(path, path_length)) { - ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok); - while (ptr) { - ptr_length = strlen(ptr); - - if (IS_DIRECTORY_UP(ptr, ptr_length)) { - char save; - - save = DEFAULT_SLASH; - -#define PREVIOUS state->cwd[state->cwd_length - 1] - - while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) && - !IS_SLASH(PREVIOUS)) { - save = PREVIOUS; - PREVIOUS = '\0'; - state->cwd_length--; - } - - if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) { - state->cwd[state->cwd_length++] = save; - state->cwd[state->cwd_length] = '\0'; - } else { - PREVIOUS = '\0'; - state->cwd_length--; - } - } else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1); -#ifdef TSRM_WIN32 - /* Windows 9x will consider C:\\Foo as a network path. Avoid it. */ - if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') || - IsDBCSLeadByte(state->cwd[state->cwd_length-2])) { - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - } -#elif defined(NETWARE) - /* - Below code keeps appending to state->cwd a File system seperator - cases where this appending should not happen is given below, - a) sys: should just be left as it is - b) sys:system should just be left as it is, - Colon is allowed only in the first token as volume names alone can have the : in their names. - Files and Directories cannot have : in their names - So the check goes like this, - For second token and above simply append the DEFAULT_SLASH to the state->cwd. - For first token check for the existence of : - if it exists don't append the DEFAULT_SLASH to the state->cwd. - */ - if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) { - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - } -#else - state->cwd[state->cwd_length++] = DEFAULT_SLASH; -#endif - memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1); - state->cwd_length += ptr_length; - } - ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok); - } - - if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1); - state->cwd[state->cwd_length] = DEFAULT_SLASH; - state->cwd[state->cwd_length+1] = '\0'; - state->cwd_length++; - } - } else { - state->cwd = (char *) realloc(state->cwd, path_length+1); - memcpy(state->cwd, path, path_length+1); - state->cwd_length = path_length; - } - -#ifdef TSRM_WIN32 - if (new_path) { - free(new_path); - } -#endif - free(free_path); - -#ifdef REALPATH_CACHE - if (use_realpath && CWDG(realpath_cache_size_limit)) { - realpath_cache_add(orig_path, orig_path_len, state->cwd, state->cwd_length, t TSRMLS_CC); - } -#endif - - if (verify_path && verify_path(state)) { - CWD_STATE_FREE(state); - *state = old_state; - ret = 1; - } else { - CWD_STATE_FREE(&old_state); - ret = 0; - } - -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd); -#endif - return (ret); -} - -CWD_API int virtual_chdir(const char *path TSRMLS_DC) -{ - return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, 1)?-1:0; -} - -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) -{ - int length = strlen(path); - char *temp; - int retval; - - if (length == 0) { - return 1; /* Can't cd to empty string */ - } - while(--length >= 0 && !IS_SLASH(path[length])) { - } - - if (length == -1) { - /* No directory only file name */ - errno = ENOENT; - return -1; - } - - if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */ - length++; - } - temp = (char *) tsrm_do_alloca(length+1); - memcpy(temp, path, length); - temp[length] = 0; -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "Changing directory to %s\n", temp); -#endif - retval = p_chdir(temp TSRMLS_CC); - tsrm_free_alloca(temp); - return retval; -} - -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) -{ - cwd_state new_state; - char *retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - - if (virtual_file_ex(&new_state, path, NULL, 1)==0) { - int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; - - memcpy(real_path, new_state.cwd, len); - real_path[len] = '\0'; - retval = real_path; - } else { - retval = NULL; - } - - CWD_STATE_FREE(&new_state); - - return retval; -} - -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, verify_path, 1); - - *filepath = new_state.cwd; - - return retval; - -} - -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) -{ - return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC); -} - -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) -{ - cwd_state new_state; - FILE *f; - - if (path[0] == '\0') { /* Fail to open empty path */ - return NULL; - } - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - f = fopen(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} - -CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL, 1); - -#if defined(TSRM_WIN32) - ret = tsrm_win32_access(new_state.cwd, mode); -#else - ret = access(new_state.cwd, mode); -#endif - - CWD_STATE_FREE(&new_state); - - return ret; -} - - -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL, 0); - - ret = utime(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return ret; -} -#endif - -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL, 1); - - ret = chmod(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return ret; -} - -#if !defined(TSRM_WIN32) && !defined(NETWARE) -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL, 0); - - ret = chown(new_state.cwd, owner, group); - - CWD_STATE_FREE(&new_state); - return ret; -} -#endif - -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - if (flags & O_CREAT) { - mode_t mode; - va_list arg; - - va_start(arg, flags); - mode = (mode_t) va_arg(arg, int); - va_end(arg); - - f = open(new_state.cwd, flags, mode); - } else { - f = open(new_state.cwd, flags); - } - CWD_STATE_FREE(&new_state); - return f; -} - -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - f = creat(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} - -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) -{ - cwd_state old_state; - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&old_state, &CWDG(cwd)); - virtual_file_ex(&old_state, oldname, NULL, 0); - oldname = old_state.cwd; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, newname, NULL, 0); - newname = new_state.cwd; - - retval = rename(oldname, newname); - - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); - - return retval; -} - -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - retval = stat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#if !defined(TSRM_WIN32) -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 0); - - retval = lstat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} -#endif - -CWD_API int virtual_unlink(const char *path TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 0); - - retval = unlink(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL, 1); - -#ifdef TSRM_WIN32 - retval = mkdir(new_state.cwd); -#else - retval = mkdir(new_state.cwd, mode); -#endif - CWD_STATE_FREE(&new_state); - return retval; -} - -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL, 0); - - retval = rmdir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#ifdef TSRM_WIN32 -DIR *opendir(const char *name); -#endif - -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) -{ - cwd_state new_state; - DIR *retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL, 1); - - retval = opendir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#ifdef TSRM_WIN32 - -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) -{ - return popen_ex(command, type, CWDG(cwd).cwd, NULL); -} - -#elif defined(NETWARE) - -/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform - a VCWD_CHDIR() and mutex it - */ -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) -{ - char prev_cwd[MAXPATHLEN]; - char *getcwd_result; - FILE *retval; - - getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN); - if (!getcwd_result) { - return NULL; - } - -#ifdef ZTS - tsrm_mutex_lock(cwd_mutex); -#endif - - VCWD_CHDIR(CWDG(cwd).cwd); - retval = popen(command, type); - VCWD_CHDIR(prev_cwd); - -#ifdef ZTS - tsrm_mutex_unlock(cwd_mutex); -#endif - - return retval; -} - -#else /* Unix */ - -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) -{ - int command_length; - int dir_length, extra = 0; - char *command_line; - char *ptr, *dir; - FILE *retval; - - command_length = strlen(command); - - dir_length = CWDG(cwd).cwd_length; - dir = CWDG(cwd).cwd; - while (dir_length > 0) { - if (*dir == '\'') extra+=3; - dir++; - dir_length--; - } - dir_length = CWDG(cwd).cwd_length; - dir = CWDG(cwd).cwd; - - ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1); - if (!command_line) { - return NULL; - } - memcpy(ptr, "cd ", sizeof("cd ")-1); - ptr += sizeof("cd ")-1; - - if (CWDG(cwd).cwd_length == 0) { - *ptr++ = DEFAULT_SLASH; - } else { - *ptr++ = '\''; - while (dir_length > 0) { - switch (*dir) { - case '\'': - *ptr++ = '\''; - *ptr++ = '\\'; - *ptr++ = '\''; - /* fall-through */ - default: - *ptr++ = *dir; - } - dir++; - dir_length--; - } - *ptr++ = '\''; - } - - *ptr++ = ' '; - *ptr++ = ';'; - *ptr++ = ' '; - - memcpy(ptr, command, command_length+1); - retval = popen(command_line, type); - - free(command_line); - return retval; -} - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h deleted file mode 100644 index d6015dd862e9b..0000000000000 --- a/TSRM/tsrm_virtual_cwd.h +++ /dev/null @@ -1,312 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef VIRTUAL_CWD_H -#define VIRTUAL_CWD_H - -#include "TSRM.h" -#include "tsrm_config_common.h" - -#include -#include -#include - -#ifdef HAVE_UTIME_H -#include -#endif - -#ifdef HAVE_STDARG_H -#include -#endif - -#ifndef TSRM_WIN32 -#include -#endif - -#if defined(__osf__) || defined(_AIX) -#include -#endif - -#ifdef TSRM_WIN32 -#include "readdir.h" -#include -/* mode_t isn't defined on Windows */ -typedef unsigned short mode_t; - -#define DEFAULT_SLASH '\\' -#define DEFAULT_DIR_SEPARATOR ';' -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') -#define IS_SLASH_P(c) (*(c) == '/' || \ - (*(c) == '\\' && !IsDBCSLeadByte(*(c-1)))) - -/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths - in the file system and UNC paths need copying of two characters */ -#define COPY_WHEN_ABSOLUTE(path) 2 -#define IS_UNC_PATH(path, len) \ - (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) -#define IS_ABSOLUTE_PATH(path, len) \ - (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len))) - -#elif defined(NETWARE) -#ifdef HAVE_DIRENT_H -#include -#endif - -#define DEFAULT_SLASH '/' -#define DEFAULT_DIR_SEPARATOR ';' -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') -#define IS_SLASH_P(c) IS_SLASH(*(c)) -/* Colon indicates volume name, either first character should be forward slash or backward slash */ -#define IS_ABSOLUTE_PATH(path, len) \ - ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\')))) - -#else -#ifdef HAVE_DIRENT_H -#include -#endif - -#define DEFAULT_SLASH '/' - -#ifdef __riscos__ -#define DEFAULT_DIR_SEPARATOR ';' -#else -#define DEFAULT_DIR_SEPARATOR ':' -#endif - -#define IS_SLASH(c) ((c) == '/') -#define IS_SLASH_P(c) (*(c) == '/') - -#endif - - -#ifndef COPY_WHEN_ABSOLUTE -#define COPY_WHEN_ABSOLUTE(path) 0 -#endif - -#ifndef IS_ABSOLUTE_PATH -#define IS_ABSOLUTE_PATH(path, len) \ - (IS_SLASH(path[0])) -#endif - -#ifdef TSRM_EXPORTS -#define CWD_EXPORTS -#endif - -#ifdef TSRM_WIN32 -# ifdef CWD_EXPORTS -# define CWD_API __declspec(dllexport) -# else -# define CWD_API __declspec(dllimport) -# endif -#else -#define CWD_API -#endif - -typedef struct _cwd_state { - char *cwd; - int cwd_length; -} cwd_state; - -typedef int (*verify_path_func)(const cwd_state *); - -CWD_API void virtual_cwd_startup(void); -CWD_API void virtual_cwd_shutdown(void); -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC); -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC); -CWD_API int virtual_chdir(const char *path TSRMLS_DC); -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC); -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC); -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC); -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC); -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC); -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); -#if !defined(TSRM_WIN32) -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); -#endif -CWD_API int virtual_unlink(const char *path TSRMLS_DC); -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC); -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC); -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); -CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); -#if defined(TSRM_WIN32) -/* these are not defined in win32 headers */ -#ifndef W_OK -#define W_OK 0x02 -#endif -#ifndef R_OK -#define R_OK 0x04 -#endif -#ifndef X_OK -#define X_OK 0x01 -#endif -#ifndef F_OK -#define F_OK 0x00 -#endif -#endif - -/* On AIX & Tru64 when a file does not exist realpath() returns - * NULL, and sets errno to ENOENT. Unlike in other libc implementations - * the destination is not filled and remains undefined. Therefor, we - * must populate it manually using strcpy as done on systems with no - * realpath() function. - */ -#if defined(__osf__) || defined(_AIX) -static char *php_realpath_hack(char *src, char *dest) -{ - char *ret; - - if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) { - return strcpy(dest, src); - } else { - return ret; - } -} -#endif - -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC); -#endif -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC); -#if !defined(TSRM_WIN32) && !defined(NETWARE) -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC); -#endif - -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath); - -#define REALPATH_CACHE -#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */ -#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */ - -#ifdef REALPATH_CACHE -typedef struct _realpath_cache_bucket { - unsigned long key; - char *path; - int path_len; - char *realpath; - int realpath_len; - time_t expires; - struct _realpath_cache_bucket *next; -} realpath_cache_bucket; -#endif - -typedef struct _virtual_cwd_globals { - cwd_state cwd; -#ifdef REALPATH_CACHE - long realpath_cache_size; - long realpath_cache_size_limit; - long realpath_cache_ttl; - realpath_cache_bucket *realpath_cache[1024]; -#endif -} virtual_cwd_globals; - -#ifdef ZTS -extern ts_rsrc_id cwd_globals_id; -# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v) -#else -extern virtual_cwd_globals cwd_globals; -# define CWDG(v) (cwd_globals.v) -#endif - -/* The actual macros to be used in programs using TSRM - * If the program defines VIRTUAL_DIR it will use the - * virtual_* functions - */ - -#ifdef VIRTUAL_DIR - -#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC) -#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC) -/* Because open() has two modes, we have to macros to replace it */ -#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags) -#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode) -#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC) -#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC) -#define VCWD_GETWD(buf) -#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC) -#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC) -#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC) -#if !defined(TSRM_WIN32) -#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC) -#endif -#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC) -#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC) -#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC) -#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC) -#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC) -#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC) -#if HAVE_UTIME -#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC) -#endif -#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC) -#if !defined(TSRM_WIN32) && !defined(NETWARE) -#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group TSRMLS_CC) -#endif - -#else - -#define VCWD_GETCWD(buff, size) getcwd(buff, size) -#define VCWD_FOPEN(path, mode) fopen(path, mode) -#define VCWD_OPEN(path, flags) open(path, flags) -#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode) -#define VCWD_CREAT(path, mode) creat(path, mode) -#define VCWD_RENAME(oldname, newname) rename(oldname, newname) -#define VCWD_CHDIR(path) chdir(path) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) -#define VCWD_GETWD(buf) getwd(buf) -#define VCWD_STAT(path, buff) stat(path, buff) -#define VCWD_LSTAT(path, buff) lstat(path, buff) -#define VCWD_UNLINK(path) unlink(path) -#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) -#define VCWD_RMDIR(pathname) rmdir(pathname) -#define VCWD_OPENDIR(pathname) opendir(pathname) -#define VCWD_POPEN(command, type) popen(command, type) -#if defined(TSRM_WIN32) -#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode) -#else -#define VCWD_ACCESS(pathname, mode) access(pathname, mode) -#endif - -#ifdef HAVE_REALPATH -#if defined(__osf__) || defined(_AIX) -#define VCWD_REALPATH(path, real_path) php_realpath_hack(path, real_path) -#else -#define VCWD_REALPATH(path, real_path) realpath(path, real_path) -#endif -#else -#define VCWD_REALPATH(path, real_path) strcpy(real_path, path) -#endif - -#if HAVE_UTIME -#define VCWD_UTIME(path, time) utime(path, time) -#endif -#define VCWD_CHMOD(path, mode) chmod(path, mode) -#if !defined(TSRM_WIN32) && !defined(NETWARE) -#define VCWD_CHOWN(path, owner, group) chown(path, owner, group) -#endif - -#endif - -#endif /* VIRTUAL_CWD_H */ diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c deleted file mode 100644 index 3ef4b58574aec..0000000000000 --- a/TSRM/tsrm_win32.c +++ /dev/null @@ -1,388 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include - -#define TSRM_INCLUDE_FULL_WINDOWS_HEADERS - -#include "TSRM.h" - -#ifdef TSRM_WIN32 - -#include "tsrm_win32.h" - -#ifdef ZTS -static ts_rsrc_id win32_globals_id; -#else -static tsrm_win32_globals win32_globals; -#endif - -static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC) -{ - globals->process = NULL; - globals->shm = NULL; - globals->process_size = 0; - globals->shm_size = 0; - globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com"); -} - -static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC) -{ - shm_pair *ptr; - - if (globals->process) { - free(globals->process); - } - - if (globals->shm) { - for (ptr = globals->shm; ptr < (globals->shm + globals->shm_size); ptr++) { - UnmapViewOfFile(ptr->addr); - CloseHandle(ptr->segment); - UnmapViewOfFile(ptr->descriptor); - CloseHandle(ptr->info); - } - free(globals->shm); - } - - free(globals->comspec); -} - -TSRM_API void tsrm_win32_startup(void) -{ -#ifdef ZTS - ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor); -#else - tsrm_win32_ctor(&win32_globals TSRMLS_CC); -#endif -} - -TSRM_API void tsrm_win32_shutdown(void) -{ -#ifndef ZTS - tsrm_win32_dtor(&win32_globals TSRMLS_CC); -#endif -} - -TSRM_API int tsrm_win32_access(const char *pathname, int mode) -{ - SHFILEINFO sfi; - - if (mode == 1 /*X_OK*/) { - return access(pathname, 0) == 0 && - SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1; - } else { - return access(pathname, mode); - } -} - - -static process_pair *process_get(FILE *stream TSRMLS_DC) -{ - process_pair *ptr; - process_pair *newptr; - - for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) { - if (ptr->stream == stream) { - break; - } - } - - if (ptr < (TWG(process) + TWG(process_size))) { - return ptr; - } - - newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(process) = newptr; - ptr = newptr + TWG(process_size); - TWG(process_size)++; - return ptr; -} - -static shm_pair *shm_get(int key, void *addr) -{ - shm_pair *ptr; - shm_pair *newptr; - TSRMLS_FETCH(); - - for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) { - if (!ptr->descriptor) { - continue; - } - if (!addr && ptr->descriptor->shm_perm.key == key) { - break; - } else if (ptr->addr == addr) { - break; - } - } - - if (ptr < (TWG(shm) + TWG(shm_size))) { - return ptr; - } - - newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(shm) = newptr; - ptr = newptr + TWG(shm_size); - TWG(shm_size)++; - return ptr; -} - -static HANDLE dupHandle(HANDLE fh, BOOL inherit) { - HANDLE copy, self = GetCurrentProcess(); - if (!DuplicateHandle(self, fh, self, ©, 0, inherit, DUPLICATE_SAME_ACCESS|DUPLICATE_CLOSE_SOURCE)) { - return NULL; - } - return copy; -} - -TSRM_API FILE *popen(const char *command, const char *type) -{ - return popen_ex(command, type, NULL, NULL); -} - -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env) -{ - FILE *stream = NULL; - int fno, str_len = strlen(type), read, mode; - STARTUPINFO startup; - PROCESS_INFORMATION process; - SECURITY_ATTRIBUTES security; - HANDLE in, out; - char *cmd; - process_pair *proc; - TSRMLS_FETCH(); - - security.nLength = sizeof(SECURITY_ATTRIBUTES); - security.bInheritHandle = TRUE; - security.lpSecurityDescriptor = NULL; - - if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) { - return NULL; - } - - memset(&startup, 0, sizeof(STARTUPINFO)); - memset(&process, 0, sizeof(PROCESS_INFORMATION)); - - startup.cb = sizeof(STARTUPINFO); - startup.dwFlags = STARTF_USESTDHANDLES; - startup.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - read = (type[0] == 'r') ? TRUE : FALSE; - mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT; - - - if (read) { - in = dupHandle(in, FALSE); - startup.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - startup.hStdOutput = out; - } else { - out = dupHandle(out, FALSE); - startup.hStdInput = in; - startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - } - - cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")); - sprintf(cmd, "%s /c %s", TWG(comspec), command); - if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, env, cwd, &startup, &process)) { - return NULL; - } - free(cmd); - - CloseHandle(process.hThread); - proc = process_get(NULL TSRMLS_CC); - - if (read) { - fno = _open_osfhandle((long)in, _O_RDONLY | mode); - CloseHandle(out); - } else { - fno = _open_osfhandle((long)out, _O_WRONLY | mode); - CloseHandle(in); - } - - stream = _fdopen(fno, type); - proc->prochnd = process.hProcess; - proc->stream = stream; - return stream; -} - -TSRM_API int pclose(FILE *stream) -{ - DWORD termstat = 0; - process_pair *process; - TSRMLS_FETCH(); - - if ((process = process_get(stream TSRMLS_CC)) == NULL) { - return 0; - } - - fflush(process->stream); - fclose(process->stream); - - WaitForSingleObject(process->prochnd, INFINITE); - GetExitCodeProcess(process->prochnd, &termstat); - process->stream = NULL; - CloseHandle(process->prochnd); - - return termstat; -} - -TSRM_API int shmget(int key, int size, int flags) -{ - shm_pair *shm; - char shm_segment[26], shm_info[29]; - HANDLE shm_handle, info_handle; - BOOL created = FALSE; - - if (size < 0) { - return -1; - } - - sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key); - sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key); - - shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); - info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); - - if ((!shm_handle && !info_handle)) { - if (flags & IPC_EXCL) { - return -1; - } - if (flags & IPC_CREAT) { - shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment); - info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info); - created = TRUE; - } - if ((!shm_handle || !info_handle)) { - return -1; - } - } - - shm = shm_get(key, NULL); - shm->segment = shm_handle; - shm->info = info_handle; - shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - if (created) { - shm->descriptor->shm_perm.key = key; - shm->descriptor->shm_segsz = size; - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_cpid = getpid(); - shm->descriptor->shm_perm.mode = flags; - - shm->descriptor->shm_perm.cuid = shm->descriptor->shm_perm.cgid= 0; - shm->descriptor->shm_perm.gid = shm->descriptor->shm_perm.uid = 0; - shm->descriptor->shm_atime = shm->descriptor->shm_dtime = 0; - shm->descriptor->shm_lpid = shm->descriptor->shm_nattch = 0; - shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; - } - - if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { - CloseHandle(shm->segment); - UnmapViewOfFile(shm->descriptor); - CloseHandle(shm->info); - return -1; - } - - return key; -} - -TSRM_API void *shmat(int key, const void *shmaddr, int flags) -{ - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return (void*)-1; - } - - shm->descriptor->shm_atime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch++; - - shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - return shm->addr; -} - -TSRM_API int shmdt(const void *shmaddr) -{ - shm_pair *shm = shm_get(0, (void*)shmaddr); - - if (!shm->segment) { - return -1; - } - - shm->descriptor->shm_dtime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch--; - - return UnmapViewOfFile(shm->addr) ? 0 : -1; -} - -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) { - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return -1; - } - - switch (cmd) { - case IPC_STAT: - memcpy(buf, shm->descriptor, sizeof(struct shmid_ds)); - return 0; - - case IPC_SET: - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_perm.uid = buf->shm_perm.uid; - shm->descriptor->shm_perm.gid = buf->shm_perm.gid; - shm->descriptor->shm_perm.mode = buf->shm_perm.mode; - return 0; - - case IPC_RMID: - if (shm->descriptor->shm_nattch < 1) { - shm->descriptor->shm_perm.key = -1; - } - return 0; - - default: - return -1; - } -} - -TSRM_API char *realpath(char *orig_path, char *buffer) -{ - int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL); - if(!ret || ret > _MAX_PATH) { - return NULL; - } - return buffer; -} - -#endif diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h deleted file mode 100644 index cd0e7a4407f6f..0000000000000 --- a/TSRM/tsrm_win32.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef TSRM_WIN32_H -#define TSRM_WIN32_H - -#include "TSRM.h" -#include - -struct ipc_perm { - int key; - unsigned short uid; - unsigned short gid; - unsigned short cuid; - unsigned short cgid; - unsigned short mode; - unsigned short seq; -}; - -struct shmid_ds { - struct ipc_perm shm_perm; - int shm_segsz; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; - unsigned short shm_cpid; - unsigned short shm_lpid; - short shm_nattch; -}; - -typedef struct { - FILE *stream; - HANDLE prochnd; -} process_pair; - -typedef struct { - void *addr; - HANDLE info; - HANDLE segment; - struct shmid_ds *descriptor; -} shm_pair; - -typedef struct { - process_pair *process; - shm_pair *shm; - int process_size; - int shm_size; - char *comspec; -} tsrm_win32_globals; - -#ifdef ZTS -# define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v) -#else -# define TWG(v) (win32_globals.v) -#endif - -#define IPC_PRIVATE 0 -#define IPC_CREAT 00001000 -#define IPC_EXCL 00002000 -#define IPC_NOWAIT 00004000 - -#define IPC_RMID 0 -#define IPC_SET 1 -#define IPC_STAT 2 -#define IPC_INFO 3 - -#define SHM_R PAGE_READONLY -#define SHM_W PAGE_READWRITE - -#define SHM_RDONLY FILE_MAP_READ -#define SHM_RND FILE_MAP_WRITE -#define SHM_REMAP FILE_MAP_COPY - - -TSRM_API void tsrm_win32_startup(void); -TSRM_API void tsrm_win32_shutdown(void); - -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env); -TSRM_API FILE *popen(const char *command, const char *type); -TSRM_API int pclose(FILE *stream); -TSRM_API int tsrm_win32_access(const char *pathname, int mode); - -TSRM_API int shmget(int key, int size, int flags); -TSRM_API void *shmat(int key, const void *shmaddr, int flags); -TSRM_API int shmdt(const void *shmaddr); -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf); - -TSRM_API char *realpath(char *orig_path, char *buffer); -#endif diff --git a/Zend/ChangeLog b/Zend/ChangeLog deleted file mode 100644 index 697c309686900..0000000000000 --- a/Zend/ChangeLog +++ /dev/null @@ -1,23560 +0,0 @@ -2005-10-25 Marcus Boerger - - * (PHP_5_1) - zend_API.c - zend_API.h - zend_extensions.h: - - MFH zend_is_callable_ex() returns zend_class_entry* if available - - * zend_API.c: - - Make the code a bit clearer - - * zend_extensions.h: - - api was changed, also we are here in api 3.*, not 2 anymore - - * zend_API.c - zend_API.h: - - Make zend_is_callable_ex() return the class netry if available - -2005-10-24 Dmitry Stogov - - * zend_language_scanner.l: - Unicode support (bug #31341) - -2005-10-21 Dmitry Stogov - - * zend_language_scanner.l - zend_language_scanner.l - tests/bug31341.phpt: - Fixed bug #31341 (escape on curly inconsistent) - - * tests/bug31341.phpt - tests/bug31341.phpt: - - file bug31341.phpt was initially added on branch PHP_5_1. - - * zend_language_scanner.l - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #34782 (token_get_all() gives wrong result) - - * zend_reflection_api.c - zend_reflection_api.c - tests/bug29268.phpt: - Fixed bug #29268 (__autoload() not called with Reflection->getClass()) - - * tests/bug29268.phpt - tests/bug29268.phpt: - - file bug29268.phpt was initially added on branch PHP_5_1. - -2005-10-20 Antony Dovgal - - * zend_reflection_api.c: - copy/paste typo - -2005-10-20 Dmitry Stogov - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h: - Removed unnecesary local variable - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug34893.phpt: - Fixed bug #34893 (PHP5.1 overloading, Cannot access private property) - - * tests/bug34893.phpt - tests/bug34893.phpt: - - file bug34893.phpt was initially added on branch PHP_5_1. - - * tests/bug34712.phpt: - Fixed bug #34712 (zend.ze1_compatibility_mode = on segfault) - - * tests/bug34712.phpt - tests/bug34712.phpt: - - file bug34712.phpt was initially added on branch PHP_5_1. - - * zend_execute_API.c - zend_execute_API.c - tests/bug34767.phpt: - Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects - correctly) - - * tests/bug34767.phpt - tests/bug34767.phpt: - - file bug34767.phpt was initially added on branch PHP_5_1. - - * (PHP_5_1) - zend_compile.h: - Fixed bug #31177 (menory leaks and corruption because of incorrect - refcounting). - - * zend_compile.h - zend_extensions.h - zend_extensions.h - zend_ptr_stack.h - zend_ptr_stack.h - zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h - tests/bug31177-2.phpt: - Fixed bug #31177 (menory leaks and corruption because of incorrect - refcounting) - - * tests/bug31177-2.phpt - tests/bug31177-2.phpt: - - file bug31177-2.phpt was initially added on branch PHP_5_1. - - * (PHP_5_0) - tests/bug34062.phpt: - Added forgotten test - - * (PHP_5_1) - tests/bug33512.phpt - tests/bug34062.phpt: - Added forgotten tests - - * tests/bug33512.phpt - tests/bug33512.phpt - tests/bug34062.phpt - tests/bug34062.phpt - tests/bug34062.phpt: - - Added forgotten tests - -2005-10-19 Dmitry Stogov - - * tests/bug33257.phpt - tests/bug33257.phpt - tests/bug33257.phpt: - Fixed test - -2005-10-17 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug34873.phpt: - Fixed bug #34873 (Segmentation Fault on foreach in object) - -2005-10-17 Derick Rethans - - * zend_compile.c: - - Make sure that typehints for classes can only accept "= NULL" as default - value. - -2005-10-16 Marcus Boerger - - * zend_reflection_api.c: - - Add ability to access private properties of base classes - - Add ability to specify fully qualified name for properties - - ReflectionClass::getInterfaces89 now returns associative array - -2005-10-15 Derick Rethans - - * zend_compile.c: - - Changed type hints so that they take "= NULL" as default value. - -2005-10-14 Antony Dovgal - - * tests/bug34873.phpt - tests/bug34873.phpt - tests/bug34873.phpt: - 1.1.4; - add test for bug #34873 - -2005-10-13 Antony Dovgal - - * (PHP_5_1) - zend_API.c: - ws fix - -2005-10-12 Dmitry Stogov - - * zend.c: - Unicode support - -2005-10-11 Dmitry Stogov - - * zend.h: - Fixed compilation on Windows - -2005-10-10 Ilia Alshanetsky - - * (PHP_5_1) - zend_objects_API.c: - MFH: Fixed bug #34802 (Fixed crash on object instantiation failure). - - * zend_objects_API.c: - Fixed bug #34802 (Fixed crash on object instantiation failure). - -2005-10-10 Dmitry Stogov - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h - tests/bug34786.phpt: - Fixed bug #34786 (2 @ results in change to error_reporting() to random - value) - - * tests/bug34786.phpt - tests/bug34786.phpt: - - file bug34786.phpt was initially added on branch PHP_5_1. - - * zend_compile.c - zend_compile.c - tests/bug34467.phpt: - Fixed bug #34467 (foreach + __get + __set incosistency) - - * tests/bug34467.phpt - tests/bug34467.phpt: - - file bug34467.phpt was initially added on branch PHP_5_1. - -2005-10-09 Marcus Boerger - - * zend_reflection_api.c: - - Add 'overwrites' info to method dump - -2005-10-08 Marcus Boerger - - * zend_reflection_api.c: - - Add ReflectionMethod::getPrototype() - - Add some usefull information to the method dump - . From where it was inherited - . The prototype - -2005-10-07 Dmitry Stogov - - * zend_operators.c: - Fixed memory leak - -2005-10-06 Marcus Boerger - - * (PHP_5_1) - zend_reflection_api.c: - - MFH ReflectionClass::isInstantiable and abstract classes - - * zend_object_handlers.c: - - BC: php objects convert to int/double 1 with notice - - * tests/bug32322.phpt: - - Show the test finishes/dos2unix - - * tests/bug28444.phpt - tests/bug30791.phpt - tests/bug32290.phpt - tests/bug32290.phpt: - - Fix test - - * tests/bug26166.phpt: - - Fix test - - Convert to unicode - - * zend_object_handlers.c: - - Any php object converts to boolean as true - -2005-10-06 Dmitry Stogov - - * zend_API.c: - Cleanup - -2005-10-05 Marcus Boerger - - * zend.c - zend_API.c - zend_execute.h - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Have __toString() be called if available in all places an object is used - as a string. - - * zend_interfaces.c: - - Fix warnings - -2005-10-03 Marcus Boerger - - * zend_execute.h: - - In a conditional statement "a ? b ? c", a and b MUST have the same type - - * zend_API.c: - - Fix ZTS Build - - * zend_interfaces.c: - - Allow uncached global functions too - - * zend_API.h: - - Add propper casting - - * zend_reflection_api.c - zend_reflection_api.h: - - Make reflection class pointers available for others - -2005-10-03 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c: - Fixed memory leak - - * tests/bug34678.phpt - tests/bug34678.phpt - tests/bug34678.phpt: - 1.1.4; - Fixed bug #34678 (__call(), is_callable() and static methods) - - * zend_API.c - zend_API.c - zend_API.c - tests/bug34678.phpt - tests/bug34678.phpt: - Fixed bug #34678 (__call(), is_callable() and static methods) - - * tests/bug34358.phpt - tests/bug34358.phpt: - - Fixed bug #34358 (Fatal error: Cannot re-assign $this) - - * zend_compile.c - zend_compile.c - tests/bug34358.phpt: - Fixed bug #34358 (Fatal error: Cannot re-assign $this) - -2005-10-02 Andrei Zmievski - - * zend_operators.h: - -** empty log message *** - -2005-09-27 Dmitry Stogov - - * zend_objects_API.c - zend_objects_API.c - zend_objects_API.c - tests/bug34617.phpt - tests/bug34617.phpt: - Fixed bug #34617 (zend_deactivate: objects_store used after - zend_objects_store_destroy is called) - - * tests/bug34617.phpt - tests/bug34617.phpt - tests/bug34617.phpt: - 1.1.4; - file bug34617.phpt was initially added on branch PHP_5_0. - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug26166.phpt: - Changed __toString() behavior to call it in all necessary places - -2005-09-23 Marcus Boerger - - * zend_reflection_api.c: - - Remove unused variable - - * zend_compile.h: - - WS - - * zend_API.h: - - WS fix - -2005-09-23 Antony Dovgal - - * tests/error_reporting10.phpt: - fix test - - * tests/bug33771.phpt - tests/error_reporting01.phpt - tests/error_reporting02.phpt - tests/error_reporting03.phpt - tests/error_reporting04.phpt - tests/error_reporting05.phpt - tests/error_reporting06.phpt - tests/error_reporting07.phpt - tests/error_reporting08.phpt - tests/error_reporting09.phpt: - fix tests to work with HEAD and its new E_* values - - * tests/bug21888.phpt: - remove double EXPECT tag - - * tests/error_reporting01.phpt - tests/error_reporting02.phpt - tests/error_reporting03.phpt - tests/error_reporting04.phpt - tests/error_reporting05.phpt - tests/error_reporting06.phpt - tests/error_reporting07.phpt - tests/error_reporting08.phpt - tests/error_reporting09.phpt - tests/error_reporting10.phpt: - add new tests - - * tests/error_reporting01.phpt - tests/error_reporting01.phpt - tests/error_reporting02.phpt - tests/error_reporting02.phpt - tests/error_reporting03.phpt - tests/error_reporting03.phpt - tests/error_reporting04.phpt - tests/error_reporting04.phpt - tests/error_reporting05.phpt - tests/error_reporting05.phpt - tests/error_reporting06.phpt - tests/error_reporting06.phpt - tests/error_reporting07.phpt - tests/error_reporting07.phpt - tests/error_reporting08.phpt - tests/error_reporting08.phpt - tests/error_reporting09.phpt - tests/error_reporting09.phpt - tests/error_reporting10.phpt - tests/error_reporting10.phpt: - - file error_reporting01.phpt was initially added on branch PHP_5_1. - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - MF5.1: - - store current value of error_reporting only if it's not stored yet - - reset old_error_reporting to NULL only it points to the tmp_var at - current opline - - * (PHP_5_1) - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - store current value of error_reporting only if it's not stored yet - - reset old_error_reporting to NULL only it points to the tmp_var at - current opline - -2005-09-23 Derick Rethans - - * (PHP_5_0) - zend_execute.c: - - MFH: Moved the FREE_OP to after the execution of the included file, or - eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - -2005-09-22 Antony Dovgal - - * zend_modules.h - zend_modules.h: - bump API number - - * (PHP_5_1) - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.skl - zend_vm_opcodes.h - tests/bug33771.phpt: - MFH: fix #33771 (error_reporting falls to 0 when @ was used inside - try/catch block) - - * tests/bug33771.phpt - tests/bug33771.phpt: - - fix #33771 (error_reporting falls to 0 when @ was used inside try/catch - block) - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.skl - zend_vm_opcodes.h: - fix #33771 (error_reporting falls to 0 when @ was used inside try/catch - block) - -2005-09-21 Marcus Boerger - - * (PHP_5_0) - zend_language_parser.y - zend_language_parser.y: - - MFH Fix Bug #34243 ReflectionClass::getDocComment() returns no result - - * zend_language_parser.y: - - Fix Bug #34243 ReflectionClass::getDocComment() returns no result - -2005-09-21 Derick Rethans - - * (PHP_5_1) - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MFH: Moved the FREE_OP to after the execution of the included file, or - eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Moved the FREE_OP to after the execution of the included file, or eval - statement so that it is safe to access this information in the - overridden - zend_execute() function, which is what Xdebug does. - -2005-09-20 Antony Dovgal - - * (PHP_5_0) - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_reflection_api.c: - MF5.1: fix #34505 (Possible memory corruption when unmangling properties - with empty names) - -2005-09-19 Marcus Boerger - - * zend_reflection_api.c: - - Add eytension consts to extension output (Johannes) - - Fix WS in output - -2005-09-19 Dmitry Stogov - - * zend_execute.h - zend_execute.h - zend_execute.h: - MFH (removed unnecesary call to zval_ptr_dtor) - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h: - Fixed access to memory that is already freed (in case of __call() method) - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h - tests/bug33257.phpt - tests/bug33257.phpt - tests/bug33257.phpt: - Fixed parameter passing incompatibilities. - Now it is possible to call array_pop(explode("&","1&2&3")) again. - - * zend_execute.c - zend_reflection_api.c - tests/bug33996.phpt: - Unicode support - -2005-09-18 Antony Dovgal - - * (PHP_5_0) - zend_reflection_api.c: - fix leaks - this problem is in 5.0 only, while 5.1 & HEAD work fine and I'd appreciate - if someone explain me why.. - -2005-09-16 Antony Dovgal - - * (PHP_5_0) - zend_reflection_api.c - zend_reflection_api.c: - MFH: check class_entry of this_ptr in Reflection API - - * zend_reflection_api.c: - check class_entry of this_ptr in Reflection API, so we won't get an alien - this_ptr - when called statically in a function that is called statically too - (without being - declared as static) - - * (PHP_5_1) - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_reflection_api.c - zend_vm_def.h - zend_vm_execute.h: - fix #34505 (possible memory corruption when unmangling properties with - empty names) - 1st part - -2005-09-16 Dmitry Stogov - - * tests/array_type_hint_001.phpt: - Fixed tests - - * tests/bug34518.phpt - tests/bug34518.phpt: - - Fixed bug #34518 (Unset doesn't separate container in CV) - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h - tests/bug34518.phpt: - Fixed bug #34518 (Unset doesn't separate container in CV) - - * zend_compile.c - zend_compile.c: - MFH (overriding of protected static property) - -2005-09-15 Jani Taskinen - - * (PHP_5_1) - tests/array_type_hint_001.phpt - tests/bug20240.phpt - tests/bug33996.phpt - tests/bug34199.phpt: - - Fix tests due to changes in the error messages. - -2005-09-15 Derick Rethans - - * zend.c - zend_constants.c - zend_errors.h - zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - - Add E_RECOVERABLE. - -2005-09-15 Jani Taskinen - - * zend_execute.c: - MFB - - * (PHP_5_1) - zend_execute.c: - - Fixed error message grammar - -2005-09-14 Marcus Boerger - - * zend_execute.c: - - Improve error message - -2005-09-14 Jani Taskinen - - * acinclude.m4: - Silence some crap if bison does not exist - -2005-09-13 Andrei Zmievski - - * zend_reflection_api.c: - Fix for Unicode access. - -2005-09-13 Dmitry Stogov - - * (PHP_5_0) - zend_execute.h - tests/bug34199.phpt: - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler) - -2005-09-12 Sara Golemon - - * (PHP_5_0) - zend_execute.c: - MFH(r-1.719) Plug leak of 1 byte when converting from string - - * (PHP_5_1) - zend_execute.c: - MFH(r-1.719) Plug leak of 1/2 bytes when converting from string/unicode - - * zend_execute.c: - Plug leak of 1/2 bytes when converting from string/unicode - -2005-09-12 Dmitry Stogov - - * (PHP_5_0) - zend_operators.c: - typo - - * tests/bug34199.phpt - tests/bug34199.phpt: - - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency) - - * zend_execute.h - zend_execute.h - zend_operators.c - zend_operators.c - tests/bug34199.phpt: - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency) - -2005-09-12 Derick Rethans - - * zend_operators.c: - - Reimplement SORT_LOCALE_STRING with ICU locales. - -2005-09-12 Dmitry Stogov - - * (PHP_5_1) - zend.c: - Fixed huge memory leak in ZTS mode (backport from HEAD) - -2005-09-09 Dmitry Stogov - - * zend.c: - Fixed huge memory leaks in ZTS mode - - * (PHP_5_1) - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.h - zend_execute_API.c - tests/catch.phpt - tests/instanceof.phpt - tests/is_a.phpt: - Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() - functions to not call __autoload(). - - * tests/is_a.phpt - tests/is_a.phpt: - - MFH (is_sublass_of("A","B") should call __autoload() for "A" and "B") - - * zend_builtin_functions.c: - MFH (is_sublass_of("A","B") should call __autoload() for "A" and "B") - -2005-09-08 Dmitry Stogov - - * zend.c: - Avoid unnecessary copying/freeing - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h: - Unicode support for PHP constants - - * zend_compile.c - tests/catch.phpt: - catch operator shouldn't call __autoload () too - -2005-09-02 Jani Taskinen - - * zend_ini.c: - MFB: - Fixed bug #34307. We were not calling on_modify handler to set the - default - value in case setting the one from .ini file failed. (Andrei) - -2005-09-02 Andrei Zmievski - - * (PHP_5_1) - zend_ini.c: - Fix bug #34307. We were not calling on_modify handler to set the default - value in case setting the one from .ini file failed. - -2005-09-02 Dmitry Stogov - - * zend_execute_API.c - zend_execute_API.c - zend_execute_API.c - tests/bug34260.phpt - tests/bug34260.phpt - tests/bug34260.phpt - tests/bug34260.phpt - tests/bug34260.phpt: - Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) - -2005-09-01 Dmitry Stogov - - * tests/bug34137.phpt - tests/bug34137.phpt - tests/bug34137.phpt: - 1.1.4; - Fixed bug #34137 (assigning array element by reference causes binary mess) - - * zend_execute.c - zend_execute.c - zend_execute.c - tests/bug34137.phpt - tests/bug34137.phpt: - Fixed bug #34137 (assigning array element by reference causes binary mess) - - * zend_compile.c - zend_compile.c - tests/bug34310.phpt - tests/bug34310.phpt: - Fixed bug #34310 (foreach($arr as $c->d => $x) crashes) - - * zend.c - zend.h - zend.h - zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_compile.c - zend_compile.c - zend_object_handlers.c - zend_object_handlers.c - zend_opcode.c - zend_opcode.c - zend_reflection_api.c - zend_reflection_api.c: - Support for class constants and static members for internal classes - -2005-08-31 Jani Taskinen - - * tests/bug34310.phpt: - Added test for bug #34310 - - * tests/bug34310.phpt - tests/bug34310.phpt: - - file bug34310.phpt was initially added on branch PHP_5_1. - -2005-08-30 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c: - - Adds module registering a function to struct zend_internal_function. - (Johannes) - - * zend_reflection_api.c: - - Fix const speling (correct in branshes where did it vanish here) - -2005-08-30 Dmitry Stogov - - * zend_reflection_api.c - zend_reflection_api.c: - Fixed possible memory leak - - * zend.c: - Fixed unicode support bug - -2005-08-30 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - - MFH Fix #34299: ReflectionClass::isInstantiable() returns true for - abstract classes - -2005-08-29 Marcus Boerger - - * zend_reflection_api.c: - - Fix #34299: ReflectionClass::isInstantiable() returns true for abstract - classes - -2005-08-25 Zeev Suraski - - * (PHP_5_0) - zend.h: - Bump version - -2005-08-25 Dmitry Stogov - - * zend.c: - Fixed memory leaks - - * zend.c: - Fixed access to uninitialized variables - -2005-08-24 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Require declare(encoding=...) to come before any opcodes. Read source - comments for more info. - - Op arrays now know which script encoding they were compiled from. - - Use this information to intelligently convert inline HTML blocks to - the output encoding. Currently it opens and closes a new converter for - each block, but we can optimize it. - -2005-08-24 Dmitry Stogov - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h: - Fixed return-by-reference from internal functions - -2005-08-23 Andrei Zmievski - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: - Implement Unicode support for strncasecmp(). - - * zend_operators.c: - Damn. - - * zend_operators.c: - - Rewrite zend_u_binary_strncmp() to work on codepoint level. Calling - u_strCompare() doesn't help because it assumes that the input lengths - specify the number of UChar's. - - Change zend_u_binary_strcmp() to use u_strCompare() (and it's fine to - use it here, since we work with whole strings here). - - * zend_operators.c: - This was so embarassingly silly. - -2005-08-23 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_exceptions.c: - Unicode support - - * zend_API.h: - Unicode support cleanup - - * zend_builtin_functions.c - zend_execute.h - zend_execute_API.c - tests/is_a.phpt: - Changed is_a() and is_subcalls_of() functions to not call __autoload() (in - the same way as "instanceof" operator). - - * zend_builtin_functions.c: - Unicode support for strncasecmp() - -2005-08-22 Andrei Zmievski - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: - Unicode support for strcasecmp(). - - * zend_API.c: - We should use u_memcpy() whenever possible, to simplify code. - -2005-08-22 Stanislav Malyshev - - * (PHP_5_1) - zend_builtin_functions.c: - fix crash if throw attempted outside of executable code - -2005-08-22 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute_API.c: - zend_is_callable() and zend_make_callable() were changed to return readable - function name as zval (instead of string). - - * zend_execute_API.c: - Fixed memory leak - -2005-08-19 Andrei Zmievski - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: - Unicode support for strcmp()/strncmp(). - - * zend_API.c - zend_API.h - zend_object_handlers.c: - -** empty log message *** - -2005-08-19 Dmitry Stogov - - * zend_builtin_functions.c - zend_compile.c - zend_exceptions.c - zend_exceptions.c - zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_reflection_api.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Unicode support - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute_API.c - zend_language_scanner.l - zend_object_handlers.c - zend_object_handlers.h - zend_reflection_api.c - zend_vm_def.h - zend_vm_execute.h: - Unicode support cleanup - - * zend_compile.c - zend_compile.h - zend_execute_API.c - tests/instanceof.phpt: - nstanceof operator shouldn't call __autoload() - -2005-08-18 Andrei Zmievski - - * zend_API.c - zend_API.h - zend_operators.h - zend_unicode.h: - - Implement zend_codepoint_to_uchar(). - - Rename and fix zend_get_unified_string_type() so that it does not - allow mixing of binary and Unicode types. - -2005-08-18 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_exceptions.c: - Suppoer for unicode exception messages - -2005-08-18 Ilia Alshanetsky - - * (PHP_5_0) - zend_alloc.c: - MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is - reached) - - * (PHP_5_1) - zend_alloc.c: - MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is - reached); - -2005-08-18 Dmitry Stogov - - * zend_API.h: - Unicode support for extract() - -2005-08-18 Antony Dovgal - - * zend_builtin_functions.c: - fix memleak - -2005-08-18 Ilia Alshanetsky - - * zend_alloc.c: - Fixed bug #34156 (memory usage remains elevated after memory limit is - reached) - -2005-08-18 Jani Taskinen - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Removed EOL from error message - -2005-08-18 Dmitry Stogov - - * zend_exceptions.c: - Unicode support - - * zend.h: - -** empty log message *** - - * zend_API.c: - We don't need EMPY_STRING here. This function is execuited in non-unicode - context only. - -2005-08-17 Marcus Boerger - - * zend_operators.c - zend_operators.h: - - Fix TSRM - -2005-08-17 Andrei Zmievski - - * zend_API.c: - Disallow mixing binary and Unicode types when T specifiers are used. - - * zend_API.c - zend_operators.c: - - Introduce 'y' specifier for functions expecting binary data. - - convert_to_binary() now uses convert_to_string() in non-Unicode mode. - -2005-08-17 Dmitry Stogov - - * zend_builtin_functions.c - zend_object_handlers.c: - Unicode mode doesn't allow non-unicode properties - -2005-08-17 Andrei Zmievski - - * zend.h: - Bump up Zend version to 3.0.0 - - -2005-08-17 Dmitry Stogov - - * zend_reflection_api.c - zend_reflection_api.c - zend_reflection_api.c - tests/bug32981.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes - apache2.0.54 seg fault) - - * zend_API.c - zend_interfaces.c - zend_object_handlers.c - zend_object_handlers.h - zend_reflection_api.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Unicode support - -2005-08-16 Andrei Zmievski - - * zend_compile.c: - Fix it here too - - * zend_builtin_functions.c: - Z_UNI* are the right macros to use. - -2005-08-16 Dmitry Stogov - - * zend_API.c: - Unicode support - - * zend_exceptions.c - zend_exceptions.c: - Fixed memory leak - -2005-08-15 Dmitry Stogov - - * zend.h: - Unicode support - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_hash.c - zend_object_handlers.c - zend_objects.c - zend_operators.c: - Fixed several unicode related bugs - - * tests/bug22836.phpt - tests/bug23104.phpt - tests/bug26010.phpt - tests/bug26695.phpt - tests/bug27798.phpt - tests/bug28442.phpt - tests/bug28444.phpt - tests/bug29505.phpt - tests/bug29674.phpt - tests/bug30140.phpt - tests/bug30162.phpt - tests/bug30407.phpt - tests/bug30702.phpt - tests/bug30856.phpt - tests/bug31683.phpt - tests/bug32799.phpt - tests/bug32981.phpt - tests/bug33243.phpt - tests/bug33999.phpt - tests/bug34064.phpt - tests/unset_cv11.phpt: - Test engine is improved to support unicode mode - - * zend.c: - Fixed another print_r() bug - - * zend.c: - Fixed print_r() in unicode mode. - -2005-08-14 Marcus Boerger - - * zend.c: - - Simplify and make work in all modes - - * zend.c: - - Treat class_name in the exact same manner as prop_name before - -2005-08-13 Marcus Boerger - - * zend_exceptions.c - zend_opcode.c: - - Unicode - - * zend_alloc.h: - - This might already be defined - -2005-08-12 Antony Dovgal - - * zend_hash.c: - initialize key type when adding next index - - * zend_alloc.h: - fix typo noticed by Nuno - -2005-08-12 Andrei Zmievski - - * zend_alloc.h: - -** empty log message *** - - * zend_alloc.h: - Add unicode macros for when Zend memory manager is disabled. - -2005-08-12 Dmitry Stogov - - * zend_execute_API.c: - Fixed user function call in unicode mode - - * zend_API.c - zend_API.c: - Fixed typo (ZVAL_LONG() -> ZVAL_DOUBLE()) - - * zend_object_handlers.c: - Fixed support fot provate properties in unicode mode. - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_exceptions.h - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c - zend_reflection_api.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Unicode support - -2005-08-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_compile.c - zend_exceptions.c - zend_exceptions.h - zend_reflection_api.c: - ZTS fixes. - -2005-08-12 Ilia Alshanetsky - - * zend.c: - Fixed build, zend_error_noreturn was being defined twice. - -2005-08-12 Jani Taskinen - - * Makefile.am: - - No more zend_multibyte.* - - * Zend.m4 - zend_highlight.c - zend_multibyte.c - zend_multibyte.h: - Nuked unneeded multibyte stuff - -2005-08-11 Andrei Zmievski - - * Makefile.am - Zend.m4 - flex.skl - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_ini.c - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_object_handlers.c - zend_objects.c - zend_objects_API.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_reflection_api.c - zend_reflection_api.h - zend_strtod.c - zend_strtol.c - zend_unicode.c - zend_unicode.h - zend_variables.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Unicode support - -2005-08-11 Antony Dovgal - - * zend_reflection_api.c: - MF5.1: fix #34078 (Reflection API problems in methods with boolean or null - default values) - - (andrei said to sara a few hours ago you may commit whatever you want - until 9pm) (c) helly - if there are any problems with this patch - please tell me, I'll revert it - immediately - - * (PHP_5_0) - zend_reflection_api.c: - MF5.1: fix #34078 (Reflection API problems in methods with boolean or null - default values) - - * (PHP_5_1) - zend_reflection_api.c: - fix #34078 (Reflection API problems in methods with boolean or null default - values) - -2005-08-11 Marcus Boerger - - * zend_compile.c: - - For internal classes we must auto generate the abstract class flags. - -2005-08-10 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h: - Fixed bug #34062 (Crash in catch block when many arguments are used) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h: - Fixed bug #25359 (array_multisort() doesn't work in a function if array is - global or reference) - - * tests/bug34064.phpt - tests/bug34064.phpt: - - Fixed bug #34064 (arr[] as param to function in class gives invalid - opcode) - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - zend_vm_opcodes.h - zend_vm_opcodes.h - tests/bug34064.phpt: - Fixed bug #34064 (arr[] as param to function in class gives invalid opcode) - - * tests/bug34064.phpt - tests/bug34064.phpt: - - file bug34064.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c: - Fixed bug #34064 (arr[] as param to function is allowed only if function - receives argument by reference) - - * zend_vm_def.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_execute.h - tests/bug34045.phpt: - Fixed bug #34045 (Buffer overflow with serialized object) - - * tests/bug34045.phpt - tests/bug34045.phpt: - - file bug34045.phpt was initially added on branch PHP_5_1. - -2005-08-09 Derick Rethans - - * zend_extensions.h - zend_modules.h: - - Changing the API numbers, which might be a bit premature, but it allows - to differentiate between different branches. - - Bumbed the version number to 6.0.0-dev. I know we didn't discuss this - yet, - but I feel it should be 6.0. See mail to the mailinglist. - -2005-08-09 Andi Gutmans - - * (PHP_5_1) - zend.h: - - No release today. Found a critical bug... - - * (PHP_5_1) - zend.h: - - RC1 - -2005-08-08 Jani Taskinen - - * zend_API.c: - - Show the dependancy name we could not find (req_mod is null here when it - is not found :) - -2005-08-05 Dmitry Stogov - - * zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - - * zend_operators.c - tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Antony Dovgal - - * tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corryption during compilation of - - * (PHP_5_0) - zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Jani Taskinen - - * LICENSE: - - Bumber up year - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_strtod.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h - zend_vm.h: - Bump up the year - - * README.ZEND_VM: - Nuked DOS EOLs - -2005-08-02 Dmitry Stogov - - * zend_execute_API.c - zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Jani Taskinen - - * zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - -2005-08-02 Dmitry Stogov - - * bench.php: - Removed warnings - -2005-07-29 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - -2005-07-29 Anantha Kesari H Y - - * acconfig.h - acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen - - * zend_vm_execute.h: - update generated file - -2005-07-28 Andi Gutmans - - * zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-26 Jani Taskinen - - * zend_execute_API.c: - bug #33865 - -2005-07-25 Marcus Boerger - - * zend_API.c: - - Fix #33853 - -2005-07-22 Dmitry Stogov - - * zend.c - zend.c - tests/bug33802.phpt - tests/bug33802.phpt - tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger - - * zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov - - * zend_vm_def.h: - Fixed bug with returning from internal function by reference - -2005-07-19 Marcus Boerger - - * zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-18 Rasmus Lerdorf - - * zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Dmitry Stogov - - * zend_API.c - zend_API.h: - Fixed bug in new module statrup mechanism - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * tests/bug33558.phpt - tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Jani Taskinen - - * tests/bug33710.phpt: - typo - -2005-07-17 Marcus Boerger - - * tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky - - * zend_compile.c: - Added missing init. - -2005-07-14 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Dmitry Stogov - - * (php_5_1_0b3) - zend_execute_API.c - zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-08 Jani Taskinen - - * tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix test when session.save_handler is "user" - -2005-07-07 Dmitry Stogov - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_objects.c - zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y - - * zend_stream.c - zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Dmitry Stogov - - * zend_execute_API.c - zend_hash.c - zend_hash.h - tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-04 Dmitry Stogov - - * zend_compile.h - zend_execute.c - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - - * zend_API.h - zend_execute_API.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak - -2005-06-30 Dmitry Stogov - - * zend_API.c - zend_API.h: - Restored old behavior of zend_statup_module() - -2005-06-29 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix conditions for freeing - - * zend_API.c - zend_API.c: - add comment - - * (PHP_5_0) - zend_execute.c: - fix conditions - -2005-06-28 Antony Dovgal - - * zend_execute.c: - fix leak: when dup was ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix previous patch - - * zend_vm_execute.h: - update - - * zend_execute.c - zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - -2005-06-27 Jani Taskinen - - * zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - -2005-06-27 Stanislav Malyshev - - * zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_exceptions.c - zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-24 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * zend_compile.c - zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * tests/bug30519.phpt - tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-23 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * tests/bug28377.phpt - tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - - * tests/bug32660.phpt - tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * tests/bug30828.phpt - tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * zend_execute.c - tests/bug27268.phpt - tests/bug27268.phpt: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_builtin_functions.c - zend_builtin_functions.c - zend_execute_API.c - zend_execute_API.c - tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * tests/bug29896.phpt - tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Stanislav Malyshev - - * (php_5_1_0b2) - zend_vm.h - zend_vm_execute.h - zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal - - * (php_5_1_0b2) - zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * tests/bug33257.phpt - tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen - - * (php_5_1_0b2) - tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans - - * zend.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - zend.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Dmitry Stogov - - * (PHP_5_0) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-20 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-20 Dmitry Stogov - - * (php_5_1_0b2) - zend_object_handlers.c - zend_object_handlers.c: - Fixed possible crash on $x = $obj->$non_string - -2005-06-20 Marcus Boerger - - * (php_5_1_0b2) - zend_reflection_api.c: - - Fix bug #33389 by fixing copying - - * zend_reflection_api.c: - - Show true/flase - -2005-06-19 Derick Rethans - - * tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-17 Jani Taskinen - - * tests/bug29368.phpt - tests/bug30856.phpt - tests/bug30961.phpt - tests/bug31720.phpt - tests/bug32226.phpt - tests/bug33277.phpt: - No short-tags! - -2005-06-17 Dmitry Stogov - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - -2005-06-17 Antony Dovgal - - * (PHP_5_0) - zend_API.c - zend_list.c: - MFH: improve error messages in internal classes - - * zend_API.c - zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - -2005-06-17 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal - - * zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_extensions.h - zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger - - * zend_reflection_api.c: - - Internal functions/methods can now return by reference - - * zend_execute.c: - - Fix TSRM build - -2005-06-16 Dmitry Stogov - - * bench.php: - typo - - * zend.h - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_modules.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski - - * zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Compilation warnings - - * zend_compile.c - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - export zval getters - -2005-06-16 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Dmitry Stogov - - * zend.c - zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen - - * tests/bug32428.phpt: - typofix - -2005-06-14 Ilia Alshanetsky - - * bench.php: - more accurate timing function. - -2005-06-14 Dmitry Stogov - - * zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen - - * Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * Zend.m4: - typofix - - * Zend.m4 - acinclude.m4: - fix standalone build - -2005-06-13 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Specializer optimization - - * zend.c - zend.h - zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - - * zend_reflection_api.c - tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-11 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b1) - zend.h: - - Go with 5.1.0b1 - -2005-06-10 Dmitry Stogov - - * (php_5_1_0b1) - tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * tests/bug31177.phpt - tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - zend_reflection_api.c - zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - zend_execute.c - zend_execute.h - zend_extensions.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - zend_compile.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * tests/bug33277.phpt: - add test for this TBF bug - - * zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c - zend_execute_API.c - zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev - - * tests/bug33277.phpt - tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * zend_language_scanner.l - zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - -2005-06-08 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * zend_compile.c - zend_compile.c: - Fixed valgrind errors - - * zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen - - * zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov - - * zend_compile.c: - Fixed lookups for previos opcodes - - * zend_execute_API.c - zend_execute_API.c - tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * tests/bug30140.phpt - tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/bug32322.phpt - tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * tests/bug30820.phpt - tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - - * tests/bug30961.phpt - tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-06 Derick Rethans - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Dmitry Stogov - - * zend_compile.c - tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - - * zend_objects_API.c - zend_objects_API.c - tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * tests/bug32799.phpt - tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * tests/bug32596.phpt - tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - - * (PHP_5_0) - tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * tests/bug32993.phpt - tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - - * tests/bug33171.phpt - tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - -2005-06-06 Wez Furlong - - * zend_language_scanner.l: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-04 Zeev Suraski - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_stream.c - zend_stream.h - tests/halt01.phpt - tests/halt02.phpt - tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Dmitry Stogov - - * tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * (PHP_5_0) - zend.c - zend_execute_API.c - tests/bug30394.phpt - tests/bug30394.phpt: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * zend_compile.c - zend_compile.c - tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * tests/bug30080.phpt - tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_execute.c - tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * tests/bug27598.phpt - tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * tests/object_handlers.phpt - tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-01 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30791.phpt: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * tests/bug30791.phpt - tests/bug30791.phpt: - - file bug30791.phpt was initially added on branch PHP_5_0. - -2005-05-31 Magnus Määttä - - * tests/bug27304.phpt: - Fix test - -2005-05-31 Dmitry Stogov - - * zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Marcus Boerger - - * zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-29 Jani Taskinen - - * Zend.m4: - - Unify the "configure --help" texts - -2005-05-29 Hartmut Holzgraefe - - * acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * Zend.m4 - acinclude.m4: - avoid code duplication in bison version test - -2005-05-28 Marcus Boerger - - * zend_compile.c - zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug22836.phpt - tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-26 Dmitry Stogov - - * (PHP_5_0) - zend_execute_API.c - tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * tests/bug33116.phpt - tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_reflection_api.c - tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger - - * (PHP_5_0) - tests/bug27304.phpt - tests/bug32981.phpt: - - Add new tests - - * tests/bug27304.phpt - tests/bug27304.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - - - Add new tests - -2005-05-22 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Stanislav Malyshev - - * zend.c - zend.c: - fix leak - -2005-05-19 Dmitry Stogov - - * (PHP_5_0) - zend_object_handlers.c: - Backported fix for bug #30451 - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev - - * zend.c - zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - tests/bug29890.phpt: - test - - * tests/bug29890.phpt - tests/bug29890.phpt: - - test - - * zend_execute_API.c - zend_execute_API.c: - fix #29890 - crash when function call fails - - * zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * zend_object_handlers.c: - fix #30451 static properties don't work properly - - * tests/bug29689.phpt - tests/bug30451.phpt: - tests - - * tests/bug29689.phpt - tests/bug29689.phpt - tests/bug30451.phpt - tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Määttä - - * tests/bug31828.phpt - tests/bug32080.phpt: - Fix tests. - -2005-05-13 Antony Dovgal - - * (PHP_5_0) - zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-12 Marcus Boerger - - * zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-06 Jani Taskinen - - * zend_object_handlers.h: - typofix :) - -2005-05-05 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31525.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - - * tests/bug31525.phpt - tests/bug31525.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - -2005-05-04 Stanislav Malyshev - - * zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - zend_execute.c: - clarify some magic - -2005-05-04 Dmitry Stogov - - * zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * tests/bug30707.phpt - tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - zend_execute.c: - ws - - * tests/bug30162.phpt - tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed notice message - -2005-05-03 Marcus Boerger - - * (PHP_5_0) - tests/bug32252.phpt: - - Add test - -2005-05-03 Dmitry Stogov - - * zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - - * tests/bug32296.phpt - tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - -2005-05-02 Marcus Boerger - - * zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-04-29 Jani Taskinen - - * zend_object_handlers.c: - compile fix - - * tests/bug30332.phpt - tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov - - * zend_API.c - zend_API.c - tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * tests/bug30332.phpt - tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_execute.c - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt - tests/bug32852.phpt - tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - -2005-04-29 Jani Taskinen - - * tests/bug22836.phpt - tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - -2005-04-28 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - - * tests/bug29015.phpt - tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - -2005-04-27 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * zend_compile.c - zend_compile.c - tests/bug29104.phpt - tests/bug29104.phpt - tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - - * tests/bug32674.phpt - tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov - - * tests/bug30889.phpt - tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * tests/bug32429.phpt: - fix - - * zend_API.c - zend_API.c - tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * tests/bug30702.phpt - tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * zend_builtin_functions.c - tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-25 Andrei Zmievski - - * zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Dmitry Stogov - - * tests/bug29944.phpt - tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - - * zend_compile.c - zend_compile.c - tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Jani Taskinen - - * zend_hash.c: - ws - -2005-04-25 Dmitry Stogov - - * zend_hash.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - zend_hash.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann - - * zend_reflection_api.c: - Correct grammar. - -2005-04-24 Marcus Boerger - - * zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Marcus Boerger - - * tests/bug29674.phpt - tests/bug30161.phpt - tests/bug30346.phpt: - - Add new tests - -2005-04-21 Jani Taskinen - - * tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - -2005-04-19 Marcus Boerger - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen - - * zend_compile.c - zend_exceptions.c: - No c++ comments in C code - -2005-04-18 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-17 Marcus Boerger - - * zend_builtin_functions.c: - - Fix special cases of property_exists() - - * zend_object_handlers.c: - - Fix logic - -2005-04-16 Sara Golemon - - * tests/method_exists.phpt: - method_exists() regression test - - * zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-15 Marcus Boerger - - * zend_builtin_functions.c: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-12 Stanislav Malyshev - - * zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-08 Marcus Boerger - - * zend_operators.c: - - Fix memory corruption found by rob - - * tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - - * zend_builtin_functions.c: - - Add property_exits() - - * zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - - * zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * zend_object_handlers.c - zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-07 Jani Taskinen - - * zend_alloc.c - zend_alloc.h: - - Nuke the code duplication - - * zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Zeev Suraski - - * (PHP_5_0) - zend_alloc.c - zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * zend_alloc.c - zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-05 Marcus Boerger - - * zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-04 Stanislav Malyshev - - * zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-03 Jani Taskinen - - * (PHP_5_0) - zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-03-31 Derick Rethans - - * (PHP_5_0) - zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-26 Jani Taskinen - - * zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - -2005-03-24 Marcus Boerger - - * zend_vm_execute.h: - - Second part of removing temp solution - - * zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-23 Andrei Zmievski - - * zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Andrei Zmievski - - * zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger - - * tests/bug31102.phpt: - - Added missing description (thanks jani) - - * tests/bug31102.phpt: - - Add new test - -2005-03-19 Marcus Boerger - - * zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * zend_object_handlers.c: - - Fix #31185 - - * zend_execute_API.c: - - Fix all incarnations of bug #30266 - -2005-03-19 Andi Gutmans - - * zend_interfaces.c - zend_interfaces.h: - - Fix typos - -2005-03-16 Wez Furlong - - * (PHP_5_0) - zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong - - * zend.c - zend_API.c - zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-14 Zeev Suraski - - * zend_ini.c: - Clarify logic - -2005-03-14 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - ws - -2005-03-13 Stanislav Malyshev - - * zend_stream.c - zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Marcus Boerger - - * zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Marcus Boerger - - * zend_execute_API.c: - - Actually this is a much better error decription - - * zend_execute_API.c - tests/bug32290.phpt - tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-11 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger - - * tests/bug32252.phpt: - - Add new test - - * tests/bug27145.phpt - tests/bug27145.phpt: - - Irrelevant - - * zend_object_handlers.c: - - Don't touch refcount/is_ref - -2005-03-10 Marcus Boerger - - * tests/bug28442.phpt - tests/bug28442.phpt: - - - Bugfix #28442 - - * zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - zend.h: - NetWare can make use of ./configure generated zend_config.h - - * (PHP_5_0) - Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger - - * zend_vm_execute.h: - - #31562 2nd part - - * zend_vm_def.h: - - Fix #31562 - -2005-03-07 Marcus Boerger - - * zend.h - zend_compile.c - zend_interfaces.c - zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * tests/bug32226.phpt - tests/bug32226.phpt: - - - Add updated description - - * zend_builtin_functions.c - tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Zeev Suraski - - * zend_language_scanner.l - zend_language_scanner.l: - Revert // patch - -2005-03-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix by Tim - -2005-03-06 Jani Taskinen - - * zend_compile.c - zend_compile.c: - Fixed compile warning (bug #32046) - - * zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-01 Marcus Boerger - - * zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment) - - * zend_language_scanner.l: - Fix the fix for one line comments with tags - -2005-02-28 Marcus Boerger - - * zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-27 Marcus Boerger - - * zend_object_handlers.c: - - If silence if wanted we do not error out - - * zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * zend_API.h: - - These must be initailized - - * zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen - - * Zend.m4: - - Cache the version check results - -2005-02-24 Andi Gutmans - - * zend_language_scanner.l: - - Make one line comments work the same with as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - - * zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans - - * zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-23 Derick Rethans - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev - - * zend.h - zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Jani Taskinen - - * Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger - - * zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Marcus Boerger - - * zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen - - * Zend.m4: - Fix cross-compile - - * acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Anantha Kesari H Y - - * zend.h: - NetWare can include autoconf generated config headers - - * acconfig.h: - NetWare can make use of the configure script generated header file. - -2005-02-21 Moriyoshi Koizumi - - * Makefile.am: - - Add missing entry. - -2005-02-20 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa - - * (PHP_5_0) - zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-17 Marcus Boerger - - * zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * zend_API.c: - - No C++ ruleZ here - - * zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * zend_API.c: - - Incrementation is done elsewhere - - * zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * Zend.m4 - zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-13 Marcus Boerger - - * zend_execute_API.c - zend_reflection_api.c: - - Be more gracious in reflection API - - * zend_language_scanner.l: - - Fix doc comment handling - -2005-02-12 Marcus Boerger - - * zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Cleanup foreach handling - -2005-02-10 Jani Taskinen - - * zend_strtod.c - zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-07 Dmitry Stogov - - * zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - -2005-02-06 Zeev Suraski - - * (PHP_5_0) - zend_ini_scanner.l: - Correct fix for #28803 - - * zend_ini_scanner.l: - Correct fix for #28804 - -2005-02-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-04 Hartmut Holzgraefe - - * zend_API.c - zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-03 Jani Taskinen - - * (PHP_5_0) - zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l - zend_ini_scanner.l: - ws fix - -2005-02-02 Stanislav Malyshev - - * zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * tests/bug31720.phpt: - test for Bug #31720 - - * tests/bug31720.phpt - tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov - - * zend.h - zend.h - zend_object_handlers.c - zend_object_handlers.c - tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - - * tests/bug31683.phpt - tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - -2005-02-01 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * tests/bug_debug_backtrace.phpt - tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - -2005-01-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-28 Marcus Boerger - - * zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-25 Jani Taskinen - - * zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - -2005-01-25 Marcus Boerger - - * (PHP_5_0) - zend_execute.c - zend_interfaces.c - tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * zend_interfaces.c - zend_vm_def.h - zend_vm_execute.h - tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * Makefile.frag: - - Fix dependency - - * zend_vm_def.h - zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-24 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h - tests/bug30725.phpt: - - Second and last part of #30725 fix - - * zend_interfaces.c: - - Allow getIterator() to fail - - * tests/bug30725.phpt: - - - Add new test - -2005-01-22 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - configure.in - zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - - * Zend.m4 - configure.in - zend_strtod.c: - - Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-20 Jani Taskinen - - * zend.h - zend_constants.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - -2005-01-19 Jani Taskinen - - * zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - -2005-01-19 Marcus Boerger - - * zend_ini_parser.y: - - Fix memleak - -2005-01-18 Dmitry Stogov - - * zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - - * zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - -2005-01-17 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - zend_API.c: - - Fix WS - - * (PHP_5_0) - zend_API.c: - - Change to using DL_UNLOAD macro. - - * zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-13 Dmitry Stogov - - * zend_execute.c - zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-12 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt - tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Moriyoshi Koizumi - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * tests/bug31098.phpt - tests/bug31436.phpt: - - - Test renaming - - * zend_vm_execute.h - tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-10 Rasmus Lerdorf - - * zend.h - zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Jani Taskinen - - * header - zend_arg_defs.c - zend_strtod.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - - Added missing header sections. - - * acinclude.m4 - configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - -2005-01-09 Jani Taskinen - - * (PHP_5_0) - zend.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include to make sure the correct file is - used. - - * zend.h: - - Fix outside-source-tree builds. Always include generated header files - with #include to make sure the correct file is used. - - * zend.c: - MFB: - Rationalize code a bit - -2005-01-03 Stanislav Malyshev - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2004-12-30 Jani Taskinen - - * (PHP_5_0) - zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - MFH: - Fixed bug #28930 (PHP sources pick wrong header files generated by - bison). - - * zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - - Fixed bug #28930 (PHP sources pick wrong header files generated by bison) - - * Zend.m4 - acinclude.m4: - MFB_4_3: Quote macro names in AC_DEFUN() - -2004-12-27 Zeev Suraski - - * zend_builtin_functions.c: - MFB - - * (PHP_5_0) - zend_builtin_functions.c: - Fix desc - -2004-12-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: Need to unmangle the class name here - - * zend_reflection_api.c: - - Need to unmangle the class name here - -2004-12-27 Zeev Suraski - - * (PHP_5_0) - zend_exceptions.c: - Add descriptions - -2004-12-27 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug22836.phpt - tests/bug22836.phpt - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to use one space - -2004-12-27 Marcus Boerger - - * zend_reflection_api.c: - - More proto/error message fixes - - * zend_reflection_api.c: - - Small fixlet (by Tony) - -2004-12-24 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - New sarbage collector's bug was fixed (the behavior should be the same as - in PHP_5_0) - - * zend_execute.c - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 - -2004-12-21 Jani Taskinen - - * (PHP_5_0) - zend_strtod.c: - MFH: - Use correct header files (in c99 compliant way). uint32_t is - preferred. - - * zend_strtod.c: - - Use correct header files (in c99 compliant way). uint32_t is preferred. - -2004-12-20 Jani Taskinen - - * zend_strtod.c: - Better fix for endian compile problems. - -2004-12-17 Andi Gutmans - - * zend_object_handlers.c: - - Fixed Bug #30562 Segmentation fault with __call() - -2004-12-17 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed strtod for Irix and some other strange platform - -2004-12-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Make it compile on HPUX on Itanium 2 - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed bug #31107 (strtod on solaris9/intel) - -2004-12-16 Jani Taskinen - - * (PHP_5_0) - ChangeLog: - - MFH: Fix typo (avaliable -> available). (bug #28725) - - * ChangeLog: - - Fix typo (avaliable -> available). (bug #28725) - -2004-12-16 Derick Rethans - - * zend_strtod.c: - - MF43: Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - - * (PHP_5_0) - zend_strtod.c: - - Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - -2004-12-15 Andi Gutmans - - * (PHP_5_0) - zend.h: - - 5.0.4-dev - - * (PHP_5_0) - zend.h: - - Redo 5.0.3 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - Roll PHP 5.0.3 - -2004-12-14 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MFH: Fixed compile error related to bug #28605. - -2004-12-13 Derick Rethans - - * zend_operators.c: - - Added "G" modifier to ini setting number format. - -2004-12-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.3RC2 - -2004-12-07 Dmitry Stogov - - * zend_exceptions.c - zend_exceptions.c: - Fixed bug #30904 (segfault when recording soapclient into session). - -2004-12-06 Stanislav Malyshev - - * tests/bug30998.phpt: - add test - - * zend.c - zend.c: - port fix for #30998: Crash when user error handler returns false on amd64 - -2004-12-06 Dmitry Stogov - - * zend_compile.c - zend_compile.c - tests/bug30922.phpt: - Fixed bug #30922 (reflective functions crash PHP when interfaces extend - themselves) - - * tests/bug30922.phpt - tests/bug30922.phpt: - - file bug30922.phpt was initially added on branch PHP_5_0. - -2004-12-06 Stanislav Malyshev - - * (PHP_5_0) - zend_builtin_functions.c: - if fetch called not from PHP function, ptr can be NULL - -2004-12-01 Ilia Alshanetsky - - * zend_strtod.c: - MFB: Removed extra space that causes problems for some compilers. - - * (PHP_5_0) - zend_strtod.c: - Removed extra space that causes problems for some compilers. - -2004-12-01 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - revert unwanted change - - * zend_strtod.c - zend_strtod.c: - - Fixed MacOSX compilation (Patch by Christian) - - * (PHP_5_0) - zend.h: - - And in Zend/ too. - -2004-12-01 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug29883.phpt - tests/bug29883.phpt - tests/bug29883.phpt: - Fixed bug #29883 (isset gives invalid values on strings). - -2004-11-30 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with 5.0.3RC1 - -2004-11-29 Derick Rethans - - * (PHP_5_0) - zend_operators.c: - - MF43: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - - * zend_operators.c: - - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - -2004-11-25 Zeev Suraski - - * (PHP_5_0) - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_object_handlers.c - zend_object_handlers.h: - Reverting get_method() signature change - -2004-11-24 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults) - - * tests/bug30856.phpt: - - - Add new test - -2004-11-17 Stanislav Malyshev - - * (PHP_5_0) - zend_execute_API.c: - fix #30543 - - * zend_execute_API.c: - fix crash - -2004-11-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - Make this compile for the Mac again - -2004-11-15 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - MFH: Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - - * zend_strtod.c: - - Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - -2004-11-14 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH #30783 Apache crash when using ReflectionFunction::getStaticVariables() - MFH proto fixes - - * zend_reflection_api.c: - - Bugix #30783: Apache crash when using - ReflectionFunction::getStaticVariables() - -2004-11-09 Andrei Zmievski - - * zend_ini_parser.y: - Revert inadvertent commit. - - * zend_ini_parser.y: - .dylib extension are Mach-O shared libraries that meant for linking - against. Loadable modules (aka bundles) can have any extension, so we - should probably stick with .so - - http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod - -2004-11-05 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c: - - Fix for bug #30367, #30490 and possibly #30011. - -2004-11-04 Edin Kadribasic - - * Zend.dsp - ZendTS.dsp: - Added zend_strtod.* to the build - - * zend_strtod.c - zend_strtod.h: - Make zend_strtod compile on windows - -2004-11-04 Moriyoshi Koizumi - - * (PHP_5_0) - Makefile.am: - - MFH: Add entry for zend_strtod.c in belief that this is still active. - - * Makefile.am: - - Add entry for zend_strtod.c in belief that this is still active. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4: - - Don't show grep outputs - -2004-11-03 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - MFH: Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - - * zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4 - zend.h - zend_execute.c: - - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't - support weak symbol aliasing at this time. - -2004-11-03 Marcus Boerger - - * zend_reflection_api.c: - - Trying to invoke function not methot here - - * zend_reflection_api.c: - - Fix invokeargs() with static methods - -2004-11-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - Fixed "isset() and the new VM" bug. - -2004-11-02 Sebastian Bergmann - - * (PHP_5_0) - zend_API.c: - MFH: Patch by Joe Orton . - - * zend_API.c: - Patch by Joe Orton . - -2004-10-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReflectionFunction::invokeArgs(array) - - Add ReflectionMethod::invokeArgs(obj, array) - -2004-10-31 Sebastian Bergmann - - * zend_reflection_api.c: - Invokation -> Invocation - -2004-10-30 Marcus Boerger - - * zend.h: - Bump version (as discussed with Andi) - - * (PHP_5_0) - zend_execute.c: - - Fix (readd function name which got lost during earlier comit) - - * zend_reflection_api.c: - - Be consistent and use names as keys (found by johannes) - - * zend_extensions.h - zend_modules.h: - - Bump API version - - * (PHP_5_0) - zend_extensions.h - zend_modules.h: - Bump api after latest changes - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - MFH change zend_object_handlers->get_method() - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_vm_def.h - zend_vm_execute.h: - - Change zend_object_handlers->get_method() to allow aggregation for - internal classes - - * Makefile.frag: - - New architecture needs one more dependency - - * zend_exceptions.c - zend_reflection_api.c: - - Fix protos - -2004-10-29 Andi Gutmans - - * zend_operators.c: - - For Ilia: - - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - Hope this works well. I will MFH tomorrow if no one complains. - -2004-10-28 Dmitry Stogov - - * README.ZEND_VM - zend_vm_gen.php: - --without-lines changed to --with-lines - -2004-10-28 Andi Gutmans - - * zend_vm_execute.skl - zend_vm_gen.php: - - Fix typo - -2004-10-27 Andi Gutmans - - * zend_vm_opcodes.h: - - Oops missed this one - - * zend_operators.c: - - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a - boolean). - - Need to discuss where the real problem is. - - * README.ZEND_VM: - - Tiny fixes - - * README.ZEND_VM - zend_compile.h - zend_vm_execute.h - zend_vm_gen.php: - - Improve comments, docs, code... - -2004-10-26 Andi Gutmans - - * zend_builtin_functions.c: - - Patch from Andrey Hristov: - I have cooked a small patch which allows is_subclass_of() the accept - not only an object as first parameter but a string as well. When string - is passed the function checks whether the class specified is subclass of - the second parameter - class a{} - class b{} extends a{} - is_subclass_of("a", "a") //false - is_subclass_of("b", "a") //true - currently only objects are allowed as first parameter - -2004-10-26 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.c: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - * zend_operators.c: - Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). - -2004-10-23 Andi Gutmans - - * zend_vm_execute.h: - - Add missing file - -2004-10-22 Andi Gutmans - - * zend_vm_handlers.h - zend_vm_spec.h: - - Nuke another two files - - * Makefile.frag - zend_execute.c - zend_vm.h - zend_vm_def.h - zend_vm_execute.skl - zend_vm_gen.php: - - Commit new VM - - Old one is tagged as PRE_NEW_VM_GEN_PATCH - - Still doing work so more commits to come. Don't complain (yet) :) - - * (PRE_NEW_VM_GEN_PATCH) - zend_execute.c: - - Fix crash (MFB PHP5_0) - -2004-10-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix bug #30395 (Apache Child Segmentation fault in specific PHP-Code) - -2004-10-20 Andi Gutmans - - * zend_operators.c: - - If object handles are equal then save the comparison of properties in - - the == operator. - -2004-10-18 Anantha Kesari H Y - - * zend_modules.h: - including zend_compile.h for NetWare as NetWare uses MetroWerks Code - warrior compiler which does not allow declarations of following kind - before defining the types. - extern struct _zend_arg_info first_arg_force_ref[2]; - -2004-10-16 Andi Gutmans - - * zend_compile.c: - - One more test (WS) - - * zend_compile.c: - - WS fix to test commit - -2004-10-16 Anantha Kesari H Y - - * zend_compile.c - zend_compile.c: - Fix for 30457 - -2004-10-14 Marcus Boerger - - * zend_builtin_functions.c: - - Allow to omit object/classname in get_parent_class() which makes it - compatible with the signature and behavior of get_class() - -2004-10-13 Andi Gutmans - - * zend_compile.c: - - Don't allow access modifiers in interfaces. Explicitly stating public - - should also be disallowed but we don't have a way to detect it today. - -2004-10-12 Marcus Boerger - - * zend_builtin_functions.c: - Bug #30381 Strange results with get_class_vars() - - * (PHP_5_0) - zend_builtin_functions.c: - MFH Fix visibility of get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix visibility in get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix set_exception_handler - -2004-10-10 Sebastian Bergmann - - * .cvsignore - tests/.cvsignore: - Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. - -2004-10-08 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Revert automatic pass arg_info - -2004-10-08 Andi Gutmans - - * zend_compile.c: - - Fix BC break with default in switch() having to be at the end. - -2004-10-08 Anantha Kesari H Y - - * acconfig.h - zend_config.nw.h: - explicitly including sys/select.h as NetWare LibC sys/types.h does not - include sys/select.h implicitly as other LibC - -2004-10-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30344 - -2004-10-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Add arginfo ZEND_ARG_SEND_AUTOMATIC which lets the compiler automatically - determine whether pass by ref is possible or pass by value is needed. - -2004-10-05 Dmitry Stogov - - * tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv07.phpt: - Test files are fixed. - - * zend_execute.c - zend_vm_handlers.h - tests/unset_cv11.phpt: - Fixed unset() bug that was introduced with CV optimization patch - - * zend_execute_API.c - zend_vm_handlers.h - tests/unset.inc - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv05.phpt - tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - Added test cases for CV optimization patch - -2004-10-04 Andi Gutmans - - * zend_API.h - zend_execute_API.c: - - Rename delete_global_variable() to zend_delete_global_variable() - - * Zend.m4 - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c - zend_vm.h - zend_vm_handlers.h - zend_vm_spec.h: - - Commit the variable fetch optimization. - - Extensions which delete global variables need to use new special - function - - delete_global_variable() (I'm about to rename it) to remove them. - - Will post to internals@ or via commit messages if there's anything else. - -2004-10-04 Marcus Boerger - - * zend_builtin_functions.c: - - Bugfix #27798 - - * tests/bug27798.phpt: - - - Add new test - -2004-10-02 Marcus Boerger - - * (PHP_5_0) - tests/bug28444.phpt - tests/bug29368.phpt: - - Add new tests - - * tests/bug28444.phpt - tests/bug29368.phpt: - - - Add new test - -2004-10-01 Marcus Boerger - - * Makefile.frag: - - Add makefile fragment which simplifies working on the executer - -2004-09-30 Andi Gutmans - - * zend_operators.c: - - Small improvement to DVAL_TO_ZVAL macro - -2004-09-29 Marcus Boerger - - * zend_API.c: - - MFB (synch correctly not only for one problem) - - * zend_API.c: - - Refix the fix - -2004-09-29 Andi Gutmans - - * bench.php - tests/bench.php: - - Move bench.php to Zend/ - -2004-09-28 Marcus Boerger - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_objects.c: - Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) - -2004-09-28 Andi Gutmans - - * zend_execute_API.c: - - Return the warning until we check if we can change the type of str.len - -2004-09-28 Marcus Boerger - - * zend_reflection_api.c - zend_reflection_api.h: - - publish reflection_class_factory() as zend_reflection_class_factory() - -2004-09-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH fix several property handling issues - - * zend_reflection_api.c: - - Make internally used properties read-only and fix default properties - - * zend_exceptions.c: - - Fix memeleak - - * zend_reflection_api.c: - - Declare properties - -2004-09-27 Andi Gutmans - - * README.ZEND_VM: - - Document zend_vm_use_old_executor() for Derick. - -2004-09-27 Marcus Boerger - - * zend_reflection_api.c: - Fix Reflection_Class to ReflectionClass in docu/messages - - * zend_execute_API.c: - - Fix warning - - * zend_compile.c - zend_stream.c: - - Fix warning - - * zend_builtin_functions.c - zend_reflection_api.c: - - Fix warnings - - * zend_interfaces.c: - Fix warnign - -2004-09-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - - Use zval_ctor_func() for wrapper and update the prototype to void - - * zend_variables.c - zend_variables.h: - - Make zval_copy_ctor() return void like dtor(). No one ever checks the - - return value which is SUCCESS always. - -2004-09-26 Marcus Boerger - - * zend.h - zend_variables.h: - - Fix build - -2004-09-26 Andi Gutmans - - * zend.h - zend_variables.c - zend_variables.h: - - Apply Thies and Sterling's patch which doesn't call ctor/dtor functions - - for types which don't require it (BOOL/NULL/LONG/DOUBLE) - - Breaks serialization!!! - -2004-09-24 Anantha Kesari H Y - - * zend_API.c: - selectively avoiding module cleanup code for apache 1 build and removing a - duplicate code - -2004-09-24 Dmitry Stogov - - * zend_vm_spec.h: - Fixed specializer bug. - -2004-09-23 Andi Gutmans - - * (PHP_5_0) - zend.h: - - PHP 5.0.3-dev - - * zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_opcode.c - zend_vm.h: - - Commit new VM architecture. This one allows people (aka Derick) to - - ask the engine to use function handler mode. Will update the README - - about that. - - * (PHP_5_0) - zend.h: - - Roll 5.0.2 - -2004-09-23 Ilia Alshanetsky - - * tests/bug20240.phpt: - Fixed test. - -2004-09-23 Marcus Boerger - - * zend_reflection_api.c: - Bugfix # 30209 - -2004-09-23 Andi Gutmans - - * tests/bench.php: - - Commit synthetic benchmark - -2004-09-23 Anantha Kesari H Y - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - Reverted the NetWare Specific Stack limit related patches as asked by Andi - -2004-09-22 Anantha Kesari H Y - - * zend_execute_API.c - zend_globals.h: - NetWare specific stack limit checks - - * zend_API.c: - Aligned the ifdef NETWARE blocks to first column. - - * zend_execute.c: - Stack limit will be checked while executing the script - - * zend_config.nw.h: - To avoid redefinition (of free, alloca etc.) compilation errors in Zend. - - * zend_API.c: - When Apache is unloaded, it calls dlclose on all the PHP extensions - that are loaded in memory. In the case of Apache 1.3, this call is - blocking indefinitely. As a work around, this call is bypassed for Apache - 1.3 build on NetWare only. This means that none of the loaded PHP - extensions are unloaded. They will have to be manually unloaded before - re-loading the Apache 1.3 again. - - * zend.h: - defined ZEND_PATHS_SEPERATOR to semicolon for NetWare - - * acconfig.h: - enabled macros to call the proper LibC functions - -2004-09-22 Dmitry Stogov - - * zend_vm_handlers.h - zend_vm_spec.h: - Specializer was updated with executor's fixes. - - * zend_execute.c - zend_execute.c: - Fixed bug #29566 (foreach/string handling strangeness (crash)). - - * zend_execute.c: - Fixed bug in fix for bug #29707 - -2004-09-21 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Fix for bug #29707 - -2004-09-19 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #30146 (ReflectionProperty->getValue() requires instance for static - property) - - * zend_reflection_api.c: - Bugfix #30148 (ReflectionMethod->isConstructor() fails for inherited - classes) - -2004-09-17 Stanislav Malyshev - - * zend_execute_API.c - zend_objects_API.c - zend_objects_API.h: - fix crash when dtor is fialing on shutdown - -2004-09-16 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with PHP 5.0.2RC1 - - * tests/bug27669.phpt: - - Add test for bug #27669 - -2004-09-16 Sebastian Bergmann - - * zend_language_parser.y: - ZTS fix. - -2004-09-16 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix bug #27669 (Dmitry). - Fixes: - - -2004-09-15 Ilia Alshanetsky - - * zend_operators.h: - MFH: Fixed a bug causing ".123" * "90" and alike to return a 0. - - * (PHP_5_0) - zend_operators.h: - Fixed a bug causing ".123" * "90" and alike to return a 0. - -2004-09-15 Derick Rethans - - * zend_config.w32.h: - - Windows support strcoll too. - -2004-09-13 Stanislav Malyshev - - * zend_execute.c: - Antony Dovgal's error message improvement - #27290 - -2004-09-11 Derick Rethans - - * zend_operators.c - zend_operators.h: - - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions - which - makes them sort based on the current locale. (Derick) - - * (PHP_5_0) - zend_operators.c - zend_operators.h: - - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which - makes - them sort based on the current locale. (Derick) - -2004-09-11 Andi Gutmans - - * zend_operators.c: - - Resolve undefined behavior (joe at redhat) - -2004-09-10 Andi Gutmans - - * zend_compile.c: - - This one fixes rather strange problem - ZE allows multiple declarations - of the same class constant. - - It could be a minor BC break, but I'm sure it's a bug. (Antony Dovgal - aka tony2001) - -2004-09-09 Andi Gutmans - - * zend_extensions.h: - - Revert API bump - - * README.ZEND_VM: - - Commit VM explanation. - - * zend.c: - - Recommit - - * zend_API.c - zend_API.h - zend_compile.c: - - Recommit: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - - * zend_extensions.h: - - Recommit: - - Bump the API number to work around this major breakage. - - * ChangeLog - zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_opcode.c: - - Roll back VM commit - -2004-09-09 Marcus Boerger - - * zend.c: - - Drop namespace relict - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_compile.c: - MFH signature check/method registration - - * zend_API.c - zend_API.h - zend_compile.c: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - -2004-09-09 Derick Rethans - - * zend_extensions.h: - - Bump the API number to work around this major breakage. - -2004-09-09 Dmitry Stogov - - * zend_vm.h: - We will use CALL dispatch method for compilers other then GCC. It is more - safe. - -2004-09-09 Andi Gutmans - - * zend_API.c: - - Fix the fix. - -2004-09-06 Marcus Boerger - - * zend_objects.c: - - Fix handling of exceptions in dtors - -2004-09-05 Zeev Suraski - - * zend.c - zend.h - zend_ini_parser.y: - Fix reverse dependency - -2004-09-04 Andi Gutmans - - * zend_API.c: - - Don't destroy object when calling overloaded cast method in - - zend_parse_parameters() - -2004-09-02 Sebastian Bergmann - - * zend_compile.c: - Fugbix typo. - -2004-08-30 Marcus Boerger - - * (PHP_5_0) - ZEND_CHANGES: - MFH: Add some information about array overloading - - * ZEND_CHANGES: - Add some information about array overloading - -2004-08-30 Stanislav Malyshev - - * zend_execute.c: - fix crash #29893 - -2004-08-29 Marcus Boerger - - * zend_execute.c: - String offset starts with 0, fix isset($str[$len]) - - * (PHP_5_0) - zend_compile.c: - MFH: Bugfix #29882 isset crashes on arrays - - * zend_compile.c: - Bugfix #29882 isset crashes on arrays - -2004-08-27 Andi Gutmans - - * zend_alloc.c: - - Fix leak report for 0 byte allocations (Dmitry) - -2004-08-26 Marcus Boerger - - * (PHP_5_0) - zend_compile.c: - MFH: Enforce semantics: Classes cannot extend Interfaces - - * zend_compile.c: - Enforce semantics: Classes cannot extend Interfaces - - * tests/bug29828.phpt: - Fix test: Classes cannot extend Interfaces - - * zend_compile.c: - Drop doubled check - - * zend_compile.c: - - Bugfix #29828 Interfaces no longer work - - * tests/bug29828.phpt: - - Add new test - -2004-08-25 Andi Gutmans - - * zend_builtin_functions.c: - - Add interface_exists() and differentiate between classes and interfaces - (Andrey Hristov) - -2004-08-24 Marcus Boerger - - * zend_API.c: - - Add missing brackets - -2004-08-23 Marcus Boerger - - * zend_compile.c: - - Drop unused variable - - * zend_execute_API.c - zend_globals.h: - - Boost up __autoload() calls by caching the lookup - -2004-08-23 Andi Gutmans - - * zend_compile.c: - - Improve performance of switch() - -2004-08-23 Zeev Suraski - - * (PHP_5_0) - zend_reflection_api.c: - Fix names - -2004-08-21 Sara Golemon - - * zend_compile.c: - Bugfix#29777 Some compilers don't like // style comments - -2004-08-20 Sara Golemon - - * zend_ini_parser.y: - Fix compile - -2004-08-19 Andi Gutmans - - * zend_execute.c: - - Cleanup - - * zend.c - zend_execute_API.c - zend_globals.h: - - Second wave of garbage removal. - - * zend_compile.h - zend_execute.c: - - Stop using garbage. Please let me know if you find any bugs resulting - - of this patch (very likely). (Dmitry, Andi) - -2004-08-19 Marcus Boerger - - * zend_reflection_api.c: - - Implement #29728: Reflection API Feature: Default parameter value. - . ReflectionParameter::isDefaultValueAvailable() - . ReflectionParameter::getDefaultValue() - - * zend_reflection_api.c: - - Nedd to work on copy - -2004-08-18 Marcus Boerger - - * zend_reflection_api.c: - - Show default value of optional parameters of user defined functions. - -2004-08-18 Andrei Zmievski - - * zend_ini_parser.y: - Forgot to turn off debugging. - - * zend_ini_parser.y - zend_ini_scanner.l: - Re-add my patch for .ini variable access. - -2004-08-16 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH: Fix bug #29447: Reflection API issues - - * zend_reflection_api.c: - - Fix bug #29447: Reflection API issues - -2004-08-15 Marcus Boerger - - * zend_compile.c: - Remove unnecessary check - -2004-08-14 Marcus Boerger - - * zend_compile.c: - Add missing check - -2004-08-12 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to 5.0.2-dev - - * (PHP_5_0) - zend.h: - - Roll 5.0.1 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC2 - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Don't use magic numbers - - * zend_compile.c - zend_execute.c: - - Significantly improve performance of foreach($arr as $data). (Marcus) - -2004-08-11 Ilia Alshanetsky - - * zend_highlight.c: - MFH: Fixed bug #29607 (highlighting code with HEREDOC produces invalid - output). - - * (PHP_5_0) - zend_highlight.c: - Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). - -2004-08-11 Marcus Boerger - - * zend_execute.c: - More meaningfull error message - -2004-08-11 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Patch to allow the Zend memory allocators to be disabled. - - * zend_alloc.h: - - Added missing defines. - -2004-08-10 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - - * zend_highlight.c: - Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - -2004-08-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC1 - -2004-08-10 Marcus Boerger - - * zend_execute.c: - - Fix warnings - -2004-08-07 Andi Gutmans - - * zend_alloc.h: - - Commit Derick's patch for allowing Zend to use regular libc memory - - allocation functions. Mainly useful in conjunction with tools such as - - valgrind which enables us to find bugs we might not find with the - - current memory managers boundary protection. - -2004-08-05 Ilia Alshanetsky - - * zend_builtin_functions.c: - Eliminate unneeded variable. - -2004-08-04 Marcus Boerger - - * zend_reflection_api.c - tests/bug29523.phpt: - - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) - -2004-08-03 Marcus Boerger - - * ZEND_CHANGES: - Update - - * (PHP_5_0) - zend_builtin_functions.c - tests/bug29505.phpt: - - MFH Bug #29505 get_class_vars() severely broken when used with arrays - - * tests/bug29505.phpt: - - Add new test - - * zend_builtin_functions.c: - - Fixed Bug #29505 get_class_vars() severely broken when used with arrays - -2004-08-02 Marcus Boerger - - * zend_reflection_api.c: - - Add methods to check parameter count - - * (PHP_5_0) - zend_compile.c: - MFH Change to use memcmp instead of strcmp - - * zend_compile.c: - - Change to use memcmp instead of strcmp - -2004-08-02 Andi Gutmans - - * zend_compile.c: - - Fix typo - -2004-08-02 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Remove all for now - - * zend_compile.c - zend_compile.h - zend_execute_API.c: - MFB: Enforce protocol on magic methods/functions - -2004-08-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_execute.c: - MFH: A gentler (performance wise) allocation of buffer for temp variables. - - * zend_execute.c: - A gentler (performance wise) allocation of buffer for temp variables. - -2004-08-01 Marcus Boerger - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_execute_API.c: - - Enforce protocol on magic methods/functions - -2004-07-30 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_ptr_stack.c - zend_ptr_stack.h: - - More ptr_stack optimizations and cleanups - - * zend_alloc.c - zend_alloc.h - zend_execute.c - zend_fast_cache.h - zend_ptr_stack.h: - - Improve performance by inlining zend_ptr_stack_n_push(). var_args can - usually not be inlined by compilers. - -2004-07-29 Marcus Boerger - - * zend_hash.c: - - Increase performance of *sort() and some internal sort operations. - -2004-07-29 Sara Golemon - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Revert goto opcode - - * zend_execute.c: - &tmp and label are the same thing, don't free it till we're done with it. - - * zend_compile.c - zend_execute.c: - Plug some memory leaks and promote unknown label to E_ERROR. - If someone tries to jump to a non-existant label execution really - shouldn't try to carry on. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Add goto operator by popular request. - -2004-07-28 Wez Furlong - - * zend_ini.c: - Fix: ini entries for dl()'d modules now work under ZTS - Side-effect: avoid possible crashes when multiple threads load/unload - modules and mess with the global hash table. - -2004-07-28 Andi Gutmans - - * zend.h - zend.h: - - Fix MAC OSX to always use native DSO loading - -2004-07-27 Marcus Boerger - - * zend_exceptions.c: - - Be specific about visibility - -2004-07-27 Wez Furlong - - * zend_builtin_functions.c: - Fix two possible crashes. Latter is unlikely unless you are doing scary - things, but former looks nasty. - -2004-07-26 Stanislav Malyshev - - * zend_interfaces.c: - quick fix for #29382 - -2004-07-25 Marcus Boerger - - * zend_reflection_api.c: - - Show visibility errors (try to fix #29354) - - * (PHP_5_0) - zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - MFH: Fix bug #29368 : The destructor is called when an exception is - thrown from the constructor - - * zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - Fix bug #29368 : The destructor is called when an exception is thrown - from the constructor - - * zend.c - zend.h - zend_execute.h - zend_execute_API.c: - - Execute destructors earlier (Florian Schaper, fschaper at intux org) - - * zend_reflection_api.c: - - Add ReflectionParameter::isOptional() to test whether a parameter is - optional and also show this information in export. - - * zend_exceptions.c: - - Add optional parameters $filename and $lineno to ErrorException - constructor to allow overwriting automatically retrieved information. - -2004-07-23 Marcus Boerger - - * zend_execute.c: - Fix 0 Byte leak after alloca to emalloc change - -2004-07-22 Zeev Suraski - - * zend_object_handlers.c: - Fix bug in handling of protected properties - -2004-07-21 Edin Kadribasic - - * zend_builtin_functions.c: - Fixed build - -2004-07-21 Marcus Boerger - - * (PHP_5_0) - zend_builtin_functions.c: - MFH: Fixded #29291: get_class_vars() return names with NULLs - - * zend_builtin_functions.c: - - Fixded #29291: get_class_vars() return names with NULLs - -2004-07-20 Moriyoshi Koizumi - - * zend_alloc.c - zend_alloc.h: - - Add safe_pemalloc() - -2004-07-20 Marcus Boerger - - * zend_reflection_api.c: - - Fixed bug 28895 again (long live the dead) - -2004-07-20 Zeev Suraski - - * zend_exceptions.c: - Fix prototypes - - * zend_exceptions.c: - Add descriptions - -2004-07-20 Stanislav Malyshev - - * zend_compile.c: - add todo - - * (PHP_5_0) - zend_ini.h - zend_ini_parser.y: - export ini parser - -2004-07-19 Sebastian Bergmann - - * zend_reflection_api.c: - Fix prototypes: Reflection_* -> Reflection*. - - * zend_reflection_api.c: - Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise - an ReflectionException instead of returning NULL on failure. - - * zend_reflection_api.c: - Do not use contracted forms. - -2004-07-19 Stanislav Malyshev - - * zend_ini.h - zend_ini_parser.y: - export INI parser - - * zend_object_handlers.c: - __set and __get will be called not only when variable doesn't exist but - also when it's - invisible - -2004-07-19 Andi Gutmans - - * zend_extensions.h - zend_modules.h: - - Bump API number due to empty_string change - - * zend.c - zend.h - zend_API.h - zend_alloc.h - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_variables.c: - - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() - used to return "" and not bool(false). It's not worth keeping it because - STR_FREE() and zval_dtor() always have to check for it and it slows down - the general case. In addition, it seems that empty_string has been - abused - quite a lot, and was used not only for setting zval's but generally in - PHP code instead of "", which wasn't the intention. Last but not least, - nuking empty_string should improve stability as I doubt every place - correctly checked if they are not mistakenly erealloc()'ing it or - calling efree() on it. - NOTE: Some code is probably broken. Each extension maintainer should - check and see that my changes are OK. Also, I haven't had time to touch - PECL yet. Will try and do it tomorrow. - -2004-07-18 Wez Furlong - - * zend_execute_API.c: - No point allocating 0 bytes - -2004-07-16 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Speed up by making null/false/true reserved word which allows to drop - an opcode (FETCH_CONSTANT) for every usage. - - * zend_execute.c: - Bugfix #28464 catch() does not catch exceptions by interfaces - -2004-07-16 Ilia Alshanetsky - - * zend_operators.h: - MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). - - * (PHP_5_0) - zend_operators.h: - Fixed bug #28800 (strings beginning with "inf" improperly converted). - -2004-07-15 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - - Improve performance of zend_alloc by stopping the size from being a bit - - field. - -2004-07-15 Marcus Boerger - - * zend_exceptions.c - zend_exceptions.h: - - Add new class ErrorException to encapsulate errors in exceptions - - * zend_dynamic_array.h: - - Fix prototype - -2004-07-14 Stanislav Malyshev - - * zend_object_handlers.c: - be consistent with write_dimension - - * zend_object_handlers.c: - fix #28957 - -2004-07-13 Andi Gutmans - - * zend.h: - - 5.0.1-dev - -2004-07-13 Marcus Boerger - - * zend_constants.c: - Bugfix #29116 Zend constant warning uses memory after free (jdolecek at - NetBSD dot org) - -2004-07-13 Andi Gutmans - - * (php_5_0_0) - zend.h: - - Roll PHP 5.0.0 - -2004-07-12 Ilia Alshanetsky - - * (php_5_0_0RC4) - zend_execute.c: - Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). - -2004-07-12 Andi Gutmans - - * (php_5_0_0RC4) - zend.c: - - Convert zend_class_entry -> zend_class_entry * - -2004-07-10 Jon Parise - - * zend.c: - DragonFly BSD is derived from FreeBSD and requires the same floating point - precision fix. - -2004-07-10 Andi Gutmans - - * zend_alloc.c - zend_hash.c - zend_variables.c: - - Better stability during premature shutdown of request startup - -2004-07-05 Andi Gutmans - - * zend_mm.h: - - Disable zend_mm for 5.0.0 - -2004-07-03 Andi Gutmans - - * zend_alloc.c: - - Should fix mem leak with ZEND_MM. I made this change a while ago and - - rolled it back but I don't remember why. Please test! - -2004-07-01 Ilia Alshanetsky - - * zend_constants.c: - Do not use alloca() where it can be easily abused by the users. - - -2004-06-25 Wez Furlong - - * zend_stream.c - zend_stream.h: - export zend stream functions for zend extensions under windows - -2004-06-24 Sara Golemon - - * zend_execute.c: - Ease off on severity of new error (Using Resources as array offsets) - -2004-06-23 Sara Golemon - - * zend_execute.c: - BugFix #28879 Inconsistent behavior between explicit and implicit array - creation. - - Changes: - - Throw E_WARNING "Illegal offset type" when explicitly creating - array elements with objects, arrays, or resorces as indexes. - This matches implicit creation w/ obj/arr indices. - - Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)" - when implicitly creating array with resource as index. (BC) - -2004-06-19 Sebastian Bergmann - - * zend_reflection_api.c: - Reflection_* -> Reflection*. Patch by Timm Friebe. - -2004-06-18 Sara Golemon - - * zend_execute.c: - Another typo in converting array index doubles to long. - -2004-06-18 George Schlossnagle - - * zend_builtin_functions.c: - fix for 28213. - - class_name and call_type should be reinitialized on every loop iter. - -2004-06-17 Sara Golemon - - * zend_builtin_functions.c: - String length in parse_parameters should be int - -2004-06-15 Marcus Boerger - - * zend_reflection_api.c: - - -2004-06-14 Marcus Boerger - - * zend_language_scanner.l: - Need {} here - -2004-06-10 Marcus Boerger - - * zend_language_scanner.l: - - Require a single white-space char after /** to start a doc comment that - way we prevent /*** from becoming a doc comment (as requested Derick). - - * zend_API.h: - Add missing declaration - - * zend_reflection_api.c: - Small code layout change - - * zend_language_scanner.l: - Do not require NEWLINE at start of doccomment - - * zend_reflection_api.c: - Bugfix #28699: Reflection api bugs - -2004-06-09 Marcus Boerger - - * zend_reflection_api.c: - Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP - -2004-06-07 Andi Gutmans - - * zend.h: - - Go back to -dev (Shouldn't need another RC) - - * (php_5_0_0RC3) - zend.h: - - Roll RC3 - -2004-06-06 Stefan Esser - - * zend_compile.h - zend_opcode.c: - Fixed Zend Function Destructor to use correct TSRM handle. - -2004-06-05 Marcus Boerger - - * zend_API.c: - Fix #28641: Instance of Interface - -2004-06-03 Andi Gutmans - - * (php_5_0_0RC3RC2) - zend.h: - - Prepare for RC3RC2 - -2004-06-02 Andi Gutmans - - * zend_mm.h: - - Don't use ZEND_MM in Windows - -2004-06-02 Stanislav Malyshev - - * zend_execute.c: - fix incdec - make value's refcount non-zero when passing to - write_property - otherwise __set caller cleanup could kill it. - -2004-06-01 Andi Gutmans - - * zend.c: - - If user error handler returns "false" then we relay to the built in error - handler - -2004-05-31 Marcus Boerger - - * zend_reflection_api.c: - Refcount must not be set separatley again. - - * zend_reflection_api.c - zend_reflection_api.c: - Add missing initialization - - * zend_compile.c: - - -2004-05-28 Andrei Zmievski - - * zend.c: - Allow user-defined error handlers to indicate whether default error - handler should be re-invoked, by returning true or false. - -2004-05-28 Marcus Boerger - - * zend_execute.c: - Prevent possible problems with illegal properties - -2004-05-28 Derick Rethans - - * zend_builtin_functions.c: - - Make the default mask for user defined error handlers include ALL errors, - including E_STRICT. - -2004-05-27 Andi Gutmans - - * zend.h: - - Back to RC3-dev until we roll final - - * (php_5_0_0RC3RC1) - zend_execute.c: - - Fix problem with exceptions returning from include(). (Dmitry) - - * (php_5_0_0RC3RC1) - zend.h: - - RC3RC1 - -2004-05-26 Wez Furlong - - * zend_object_handlers.c: - Fix leak on systems where alloca isn't really alloca. - -2004-05-26 Andrei Zmievski - - * zend_constants.c: - Avoid unnecessary and silly copying of constant name when registering. - -2004-05-26 Andi Gutmans - - * zend_alloc.c: - - Fix memory manager problem - -2004-05-26 Sebastian Bergmann - - * ZEND_CHANGES: - Update Reflection API class names. Whitespace fixes. - -2004-05-25 Andi Gutmans - - * zend_objects_API.h: - - Nuke unused decleration - - * zend_alloc.c - zend_alloc.h: - - More fixes - - * zend_alloc.c - zend_alloc.h: - - Make fix compile. - - * zend_alloc.c - zend_alloc.h: - - Fix memory leak in mem cache in conjunction with Zend MM. How come no one - - noticed this? :) - -2004-05-23 Andi Gutmans - - * zend_objects_API.c: - - Fix problem with object being destroyed more than once - - * zend_builtin_functions.c: - - Fix the following script (it crashed): - - -2004-05-20 Wez Furlong - - * zend_exceptions.c - zend_exceptions.h: - Revert; obviously I missed the function at the bottom of the file... - - * zend_exceptions.c - zend_exceptions.h: - Export this, so extensions may throw their own exception objects that - they have already instantiated. - -2004-05-18 Marcus Boerger - - * zend_API.c: - - Need to operate on module pointer in hash table - -2004-05-18 Wez Furlong - - * zend_execute_API.c: - Fix bug #28438: win32 build fails in non-zts mode - -2004-05-18 Stanislav Malyshev - - * zend_API.c: - Z_TYPE_P is for zvals - -2004-05-18 Wez Furlong - - * zend_API.c: - Register according to the type specified by the module. - (Helps to fix dl() bug) - -2004-05-18 Sara Golemon - - * zend_execute.c: - Bugfix#28404 When type is double we need to access dval, not lval - -2004-05-17 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Revert the .ini vars patch. Will have to try again next Christmas - apparently. - - * zend_ini_parser.y: - Fix the apparent bug (; at the end of parse rule block). - -2004-05-17 Wez Furlong - - * zend_objects_API.c - zend_objects_API.h: - As discussed with Andi, add this helper API for setting the object pointer - from - within the constructor. - - Please read the comment for notes about how to use it; in general, you - don't - need it, so don't use it. - -2004-05-14 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Adding ability to refer to existing .ini variables from within .ini - files. Example: - - open_basedir = ${open_basedir} ":/new/dir" - -2004-05-12 Marcus Boerger - - * zend_API.c: - - Centralize register and hash operations for startup/register_module - in new zend_register_module_ex(). - - * zend_API.c: - - Revert to 1.249 - -2004-05-11 Andi Gutmans - - * zend_compile.c: - - Don't allow passing NULL to type hinted parameter. - -2004-05-10 Zeev Suraski - - * zend_operators.c: - - Fix comparison of objects - - Clarify convert_object_to_type() - -2004-05-10 Stefan Esser - - * zend_alloc.c: - Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly - problems. - -2004-05-04 Wez Furlong - - * zend_iterators.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add count_elements handler for overloaded objects. - -2004-05-02 Andi Gutmans - - * zend_operators.c: - - Fix comparison of two objects in non-compatibility mode. - -2004-05-01 Marcus Boerger - - * zend_API.c: - Don't load modules twice - -2004-04-29 Stanislav Malyshev - - * zend_execute.c: - Fix bug #27876 - -2004-04-28 Marcus Boerger - - * zend_exceptions.h: - Fix c++ builds - -2004-04-27 Marcus Boerger - - * zend_builtin_functions.c: - - Optional parameter to class_exists() that can be used to bypass - __autoload() which can be helpfull in __autoload() itself. - - * zend_interfaces.c: - - Fix warnings - - * zend_interfaces.c - zend_interfaces.h - zend_iterators.h: - - no unneccessary retval initialization - - new c-level iterator handler invalidate_current that is optionally - used to clear internal caching like in implementation of Iterator - -2004-04-27 Andi Gutmans - - * zend_reflection_api.c: - - Fix prototypes - -2004-04-26 Marcus Boerger - - * zend_reflection_api.c: - Fix prototype - -2004-04-25 Marcus Boerger - - * zend_builtin_functions.c: - Skip correct amount of stack entries - - * zend_interfaces.c: - Capture potential problem by error message - - * zend_reflection_api.c: - Show number of classes - -2004-04-25 Andi Gutmans - - * zend.h: - - RC3-dev - - * (php_5_0_0RC2) - zend.h: - - RC2 - -2004-04-23 Andi Gutmans - - * zend_compile.c: - - Fixed bug #27923. foreach() without a key should not check if the key - - is a reference (Adam) - -2004-04-21 Andi Gutmans - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC2) - zend.h: - - Prepare for RC2RC2 (if everything is OK especially Zeev's interface - - patch I'll roll RC2 tomorrow). - -2004-04-21 Zeev Suraski - - * (php_5_0_0RC2RC2) - zend_compile.c: - Restore fatal error in case a method that's supposed to implement an - interface/abstract method, breaks its prototype - -2004-04-20 Andi Gutmans - - * zend_language_parser.y: - - Fix bug #27283 - Exceptions where the last catch() statement was - sometimes - - skipped. - -2004-04-19 Marcus Boerger - - * zend_reflection_api.c: - show ini entries and classes for extensions. - -2004-04-17 Marcus Boerger - - * zend.c: - Retval may not be set when zend_execute() is overloaded - -2004-04-15 Marcus Boerger - - * zend_execute.c: - Handle failure in get_current_data - -2004-04-14 Andi Gutmans - - * zend_extensions.h: - - Add comment - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC1) - zend.h: - - RC2RC1 - -2004-04-13 Marcus Boerger - - * zend_exceptions.c: - Classnames shall start with an uppercase character - -2004-04-13 Zeev Suraski - - * zend_builtin_functions.c: - Fix debug_backtrace to show arguments again - We need to merge code from debug_backtrace & debug_print_backtrace at - some point! - -2004-04-13 Andi Gutmans - - * zend_extensions.h: - - Fix API no of Engine 2. The first number is the engine version and the - - rest is the API_NO. This way engine2_api_no is always greater than - - engine1_api_no. - - * zend.c - zend_exceptions.c - zend_exceptions.h: - - Add hook for exception handler (Derick) - -2004-04-12 Marcus Boerger - - * zend_API.h: - Fix order of macro parameter (synch with other macros) - -2004-04-12 Andi Gutmans - - * OBJECTS2_HOWTO - zend_extensions.h - zend_ini.c - zend_ini.h - zend_modules.h: - - modifyable -> modifiable - -2004-04-09 Andi Gutmans - - * zend_object_handlers.c: - - Fix bug #26441 (When __set() returned a value it corrupted it) - -2004-04-08 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #27519 Reflection_Function constructor crashes with non-existant - function's name - -2004-04-07 Andi Gutmans - - * zend_builtin_functions.c: - - Hopefully fix the debug_backtrace() code. - - * zend_builtin_functions.c: - - Fix crash bug in zend_debug_backtrace(). No idea how come this survived - - for so long.... - -2004-04-04 Ilia Alshanetsky - - * zend_objects_API.c: - Removed unused variable. - -2004-04-03 Andi Gutmans - - * zend_builtin_functions.c: - Patch by Timm Friebe: - It changes - set_exception_handler() to accept the pseudo-type "callable" (instead of - a string referring to a global function). - - - Examples: - set_exception_handler('function_name'); - set_exception_handler(array('class_name', 'static_method')); - set_exception_handler(array($instance, 'instance_method')); - - - This also makes set_exception_handler() more consistent with all the - other callback functionality, e.g. set_error_handler(). - - * zend_operators.c: - - Nuke more old junk - - * zend.h - zend_operators.c - zend_operators.h: - - Nuke code which hasn't been in use for ages. - -2004-04-01 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFB: Revert patch for bug #27782. - - * zend_execute.c - tests/bug27731.phpt: - Fixed reversed condition for error reporting. - -2004-03-31 Dmitry Stogov - - * zend_execute.c: - Fixed BUG in zend_post_incdec_property - -2004-03-31 Andi Gutmans - - * zend_reflection_api.c: - - Fix typo - -2004-03-30 Marcus Boerger - - * tests/bug26695.phpt: - Fix test - -2004-03-30 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). - -2004-03-30 Marcus Boerger - - * zend_reflection_api.c: - TSRM fix - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_globals.h - zend_reflection_api.c: - - Fix Reflection class names - - Add ability to get the extension an internal class was defined in - -2004-03-29 Marcus Boerger - - * acconfig.h: - NAN==NAN doest work (Ard) - - * zend_builtin_functions.c: - Allow mixed case search for extensions - -2004-03-29 Sebastian Bergmann - - * zend_execute.c: - -clonning+cloning - -2004-03-29 Dmitry Stogov - - * zend_execute.c: - Implicit clonning strict warning was added for ze1_compatibility_mode - -2004-03-29 Ilia Alshanetsky - - * zend_execute.c - tests/bug27731.phpt: - Fixed bug #27731 (error_reporting() inside @ block fails to set - error_reporting level). - -2004-03-28 Marcus Boerger - - * zend_API.c: - Use lowercasing here - - * zend.c: - Initialize the complete struct - -2004-03-28 Stanislav Malyshev - - * zend_language_parser.y: - check writability on =& too - - * zend_execute.c: - - call set handler if assigning to object having this handler - - cleanup: use macros to access object internal vars - - * zend_interfaces.c: - preserve ZEND_API in definition - - * zend_interfaces.h: - declare as extern - -2004-03-28 Marcus Boerger - - * zend_reflection_api.c: - Fix memleak found by Timm - -2004-03-28 Stanislav Malyshev - - * zend_operators.c: - centralize object-to-scalar conversion, make it work with get handler - - * zend.c: - try get handler on printable conversion - - * zend_object_handlers.h: - some more clear comments - - * zend_operators.c: - Use macros for object parts access - -2004-03-28 Dmitry Stogov - - * zend_execute_API.c: - fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt - passes again) - -2004-03-27 Marcus Boerger - - * zend.c: - Even though it is uncommented it should be right - -2004-03-26 Marcus Boerger - - * zend_API.c - zend_compile.c: - Force destructors to have empty signatures - -2004-03-26 Andi Gutmans - - * zend_execute.c: - - Fix build (thanks to Timm) - -2004-03-25 Derick Rethans - - * zend_language_scanner.l: - - Remove old and deprecated scanner token. - -2004-03-25 Andi Gutmans - - * zend_compile.c: - - If __construct() is defined then it will always take precedence over - - old style constructors. - -2004-03-25 Stanislav Malyshev - - * zend_execute.c: - no need to use result for RECV's - as in PHP4 - - * zend_execute.c: - Use get/set handlers for increment.decrement ops on objects - -2004-03-25 Andi Gutmans - - * zend_execute_API.c: - /* The compiler is not-reentrant. Make sure we __autoload() only during - run-time - * (doesn't impact fuctionality of __autoload() - */ - -2004-03-25 Dmitry Stogov - - * zend_execute_API.c: - Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. - -2004-03-24 Dmitry Stogov - - * zend.c - zend_execute_API.c - zend_globals.h: - New autoload protection schema was implemented (Using HashTable instead of - boolean flag) - -2004-03-24 Derick Rethans - - * zend_operators.c: - - Revert bogus commit - - * zend_operators.c: - - Fixed NEWS - -2004-03-24 Dmitry Stogov - - * tests/bug27641.phpt: - Fixed bug #27641 (Object cloning in ze1_compatibility_mode was - reimplemented) - - * zend_execute.c - zend_variables.c: - Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was - reimplemented (Dmitry, Andi) - -2004-03-22 Andi Gutmans - - * zend_compile.c: - - Fix bug - - * zend_execute.c: - - Remove whitespace - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Improve consistency - -2004-03-21 Stanislav Malyshev - - * zend_objects_API.c - zend_objects_API.h: - return zval *, to make it useful for read_property - - * zend_objects_API.c: - update to new API - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - API change for read_property: - instead of bool silent it now gets fetch type - This can be used for creating proxy objects for write contexts - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Nuke unused code - -2004-03-18 Andi Gutmans - - * zend.h: - - Back to RC2-dev - -2004-03-18 Zeev Suraski - - * (php_5_0_0RC1) - zend.h: - Prepare to roll RC1 - - * (php_5_0_0RC1) - zend_execute.c: - Fix possible data corruption with __set() - -2004-03-18 Stanislav Malyshev - - * zend_execute.c: - Improve error message - on E_STRICT, method is actually called, - so the error shouldn't say it cannot be called. - -2004-03-18 Andi Gutmans - - * (php_5_0_0RC1) - zend_compile.c: - - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. - - * (php_5_0_0RC1) - ZEND_CHANGES: - - Update Changes - -2004-03-17 Sascha Schumann - - * zend_multiply.h: - Readd x86 implementation - -2004-03-17 Andi Gutmans - - * (php_5_0_0RC1RC2) - zend_multiply.h: - - Improved patch for support multiplication on 64bit machines - - * (php_5_0_0RC1RC2) - zend_execute.c: - - Fix tiny bug (one of the reasons we can't support __toString() for - - regular objects). - - * (php_5_0_0RC1RC2) - zend.c: - - Stop make_printable_zval() from calling __toString() - - * zend_execute.c: - - Fixed problem with __toString(). Due to the engine's architecture it is - - currently not possible to call __toString() anywhere besides print & - eval. - - Follow up will be on internals@ - -2004-03-17 Stanislav Malyshev - - * (php_5_0_0RC1RC2) - zend_compile.c: - fix typo - -2004-03-17 Andi Gutmans - - * zend_multiply.h - zend_operators.c: - - Apply Ard's patch to support multiplication & overflow on both 32bit - and 64bit machines - -2004-03-16 Derick Rethans - - * zend.c - zend.h - zend_API.h - zend_modules.h: - - Replaced the exec_finished hook by the zend_post_deactive hook for - extensions. The new hook will be run after the symbol table and - destructors - are run. (Derick) - - * zend_modules.h: - - Bump API number so that it actually differs from PHP 4. This is needed - because we don't want PHP 4 and PHP 5 extensions to be in the same - directory - when doing "make install" for shared, or phpize'd extensions. - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - Fix SEGV in certain conditions while calling static methods - -2004-03-16 Zeev Suraski - - * zend_compile.c - zend_compile.h: - Add ability to disable JIT for a particular auto global - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - TSRM fix - -2004-03-16 Sascha Schumann - - * zend.h: - Enable ptr format check for GCC 3.1 and higher - -2004-03-16 Ilia Alshanetsky - - * zend.h: - Do not allow 3.0.4 for __attribute__. - - * zend.h: - Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive) - -2004-03-16 Andi Gutmans - - * zend_compile.c: - - Fix problem when using old-style constructors it wasn't being inherited - correctly. - -2004-03-16 Derick Rethans - - * zend_execute_API.c: - - Spaces to tabs - -2004-03-16 Andi Gutmans - - * zend_execute_API.c: - - If the called method is static then don't define $this - - * zend_execute.c - zend_execute_API.c: - - Error out if get_method() isn't defined. - - Use calling scope of internal function callee when calling a method - using static syntax (array("A", "func")); - -2004-03-16 Marcus Boerger - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Improve error message - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Restore E_NOTICE for longs and doubles. - -2004-03-15 Jani Taskinen - - * zend.h: - - Fixed bug #24582 (extensions can not be loaded dynamically in - Solaris/iPlanet) - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) - -2004-03-14 Marcus Boerger - - * zend_builtin_functions.c: - Make object parameter optional - -2004-03-14 Ilia Alshanetsky - - * zend.c: - Fixed bug #27590 (crash during shutdown when freeing persistent resources - in ZTS mode). - -2004-03-14 Andi Gutmans - - * zend_execute_API.c: - - Fix windows build - - * zend_execute_API.c: - - Fix for bug #27504 - - * zend_builtin_functions.c: - - Fixing bug #27123 - - * zend_operators.c: - - Improve compatibility mode and compare objects according to property - - comparison (sucky but this is how PHP 4 behaved). - - * zend.c: - - Fix flow of logic - - * zend_operators.c: - - Support old style of converting objects to long/double/bool. - - This is only enabled in compatibility mode, else it calls cast_object() - - and if that is not available we return 1 (true) so that the following - - code would work: - if ($obj) { - } - -2004-03-14 Marcus Boerger - - * zend_operators.c: - Fix: Add return type void - -2004-03-14 Andi Gutmans - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Support Cast operator in convert_to_* so that we support internal - - extensions such as SimpleXML. This is for Sterling. - - * zend_operators.c: - - Fix memory leak in the following code (Dmitry): - - - * zend_operators.c: - - Initial commit which allows comparing overloaded objects with native - - types (only for internal classes and not for user-land classes). - -2004-03-11 Andi Gutmans - - * zend_objects_API.c: - - Real fix for bug #27535 (Dmitry) - - * zend_objects_API.c: - - Attempt to fix bug #27535 - -2004-03-09 Marcus Boerger - - * ZEND_CHANGES: - Rename hasMore() to valid() as discussed. (Part VI) - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_interfaces.c - zend_language_parser.y - zend_reflection_api.c: - Clearify the different method/class flags (as discussed with Andi). - - * zend.h: - No longer needed - -2004-03-09 Andi Gutmans - - * zend_constants.c: - - Fix crash: - - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Nuke unused code. - -2004-03-08 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_iterators.h: - Rename hasMore() to valid() as discussed. (Part II) - - * zend_interfaces.c: - Rename hasMore() to valid() as discussed. (Part I) - - * zend_execute_API.c: - Check count. - - * zend_reflection_api.c: - Add another missing conversion - -2004-03-05 Andi Gutmans - - * zend_compile.c: - - Fix some small problems I introduce in last patch. - - * zend_compile.c: - - Finally fix the following: - $xml_mem = - simplexml_load_string('1'); - /* The following works fine */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter->page as $page) { - print $page; - } - } - /* The following segfaults */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter as $chapter) { // Difference here from previous - example - print $chapter; - } - } - -2004-03-04 Moriyoshi Koizumi - - * zend_language_scanner.l: - - Fix memleak when scanner is called from within tokenizer extension. - -2004-03-04 Stanislav Malyshev - - * zend_execute.h: - fix the fix - - * zend_execute.h: - oops, fix cut&paste gone bad - - * zend_execute.h: - Fix object true value: if we are in compat mode and it's Zend object - - use PHP4 rules. Otherwise, object is always true. - -2004-03-04 Derick Rethans - - * zend_constants.h - zend_operators.h: - - Fixed a 64bit issue (for zend_builtin_functions.c, module_number is an - int). - - Change the MAX_LENGTH_OF_LONG constant to 20, as LONG_MAX is 20 - characters. - (Patches by Ard Biesheuven) - - * tests/zend_operators.phpt: - - Added instance_of test (patch by Ard Biesheuvel) - -2004-03-04 Stanislav Malyshev - - * zend_compile.c: - Disallow redefining ctors and cleanup - - * zend_mm.c: - Handle out of memory/bad size situation gracefully, without getting into - loop - -2004-03-03 Andi Gutmans - - * zend_objects_API.c: - - Fix crash: - x as $x); - } - } - new foo(); - echo 'OK'; - ?> - -2004-03-02 Marcus Boerger - - * zend_API.c - zend_API.h: - Fix zend_parse_method_parameters_ex() and make it consistant with - zend_parse_method_parameters(). - -2004-03-02 Andi Gutmans - - * zend_compile.c: - - Fix leaks (although there might be still a problem here). - - * zend_execute.c: - - Fix leak (Dmitry) - - * zend_compile.c: - - Fix crash in: - attributes as $name => $attr) { - } - } - } - - $f= new Foo(); - $f->export(); - ?> - - * zend_objects.c: - - Improve fix for protecting destructor's from exceptions. - - I was killing the current exception completely which was wrong. - -2004-03-01 Andi Gutmans - - * zend_objects.c: - - Fix crash in destructors(). You can't throw an exception in destructors - as there is no guaranteed time when the destructor will be called. - - * zend_reflection_api.c: - - Fix leak - - * zend_reflection_api.c: - - Fix crash in reflection API (pierre) - - * zend.c - zend_exceptions.c - zend_execute_API.c: - - Fix crash in exception handling (zend_exception_error(...) and - zend_eval_string_ex() were buggy (Dmitry, Andi) - -2004-03-01 Derick Rethans - - * zend_compile.h: - - Typo fix (by Jan) - - * zend_builtin_functions.c: - - Fixed bug #27443 (defined() returns wrong type). - -2004-02-29 Andi Gutmans - - * zend_reflection_api.c: - - Apply fixes by Timm. - - * zend_compile.c: - - Change prototype isA check not to check the constructor. - - Only give an E_STRICT for non-isA compliant code as opposed to - E_COMPILE_ERROR. - -2004-02-29 Stanislav Malyshev - - * zend_compile.h: - add ZEND_API there too for opcode handlers - -2004-02-29 Derick Rethans - - * zend_execute.c: - - Initialize memory to \0 so that we can reliable detect whether a specific - opcode element is in use. - -2004-02-29 Stanislav Malyshev - - * zend_execute.c: - export opcode table - -2004-02-27 Marcus Boerger - - * zend_API.c - zend_compile.h: - Add some comments - - * zend_API.c - zend_compile.c - zend_execute.c: - Fixes for abstract classes/methods - -2004-02-26 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - Fix __METHOD__ (noticed by Davey Sahfik) - - * zend_reflection_api.c: - Fix problem with Reflection_Property (patch from Timm slightly modified). - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - As Andi found out the dtor may increase the refcount. - -2004-02-25 Jani Taskinen - - * zend_builtin_functions.c: - ws + cs - -2004-02-25 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix leak in foreach ($o->mthd()->arr) - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - - Improve ARG_INFO() macros to support supplying required_num_args - - Initial fix for foreach($o->mthd()->arr) crash (now leaks) - -2004-02-25 Derick Rethans - - * zend_highlight.c: - - Use instead of in highlight_string(). (Patch by - mg@iceni.pl) - -2004-02-25 Jani Taskinen - - * zend_exceptions.c: - Improve error messages - -2004-02-25 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: - - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't - only affect auto-clone). - - Perform implementation checks even with simple inheritance (off when - compatibility mode is enabled). - - Restore default arguments in interfaces and handle it correctly. - - Move registration of internal classes later in the startup sequence - in order to have INI options available. - -2004-02-25 Derick Rethans - - * zend_exceptions.c: - - Fixed bug #27391 (typo in Fatal Error message). - -2004-02-25 Zeev Suraski - - * zend_API.c - zend_compile.c - zend_compile.h - zend_opcode.c: - - Abstract methods cannot have defaults for arguments - - Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b) - prototypes - -2004-02-25 Sebastian Bergmann - - * zend_reflection_api.c: - Proto fixes. - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - Fix object destruction/free in shutdown - - set destructor_called even when no dtor is given - - use free_storage even when no dtor hat to be called - - * zend_objects_API.c: - Checking once for dtor is enough - -2004-02-24 Marcus Boerger - - * zend_API.c: - Fix class flags when handling abstract methods - -2004-02-23 Andi Gutmans - - * zend_language_parser.y: - - Improve precendence: - - foo = "Blah"; - - if (!$obj instanceof StdClass) { - print "No"; - } else { - print "Yes"; - } - - * zend_language_parser.y: - - Decrease precedence of instanceof so that the following is true: - php -r 'var_export((object)1 instanceof stdClass);'; - Patch by Jan Lehnardt - -2004-02-22 Derick Rethans - - * zend_operators.c: - - Fixed bug #27354 (Modulus operator crashes PHP). - -2004-02-22 Marcus Boerger - - * ZEND_CHANGES: - Add some more obviously needed information - -2004-02-20 Hartmut Holzgraefe - - * zend.h - zend_API.h - zend_iterators.h - zend_operators.h - zend_variables.h: - more EXTERN_C wrapping of ZEND_API prototypes - -2004-02-20 Jani Taskinen - - * zend_opcode.c: - ws fix - -2004-02-18 Hartmut Holzgraefe - - * zend.h - zend_builtin_functions.h - zend_extensions.h - zend_indent.h - zend_interfaces.h - zend_object_handlers.h - zend_objects.h - zend_objects_API.h - zend_ptr_stack.h - zend_stack.h - zend_stream.h: - wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C - for C++ extension support - -2004-02-18 Zeev Suraski - - * zend.c: - Forward-port fixlet from PHP 4 (thanks to Michael Sisolak) - -2004-02-17 Jani Taskinen - - * zend_list.c: - MFB: - Fix bug #26753 (zend_fetch_list_dtor_id() does not check NULL - strings) - -2004-02-16 Derick Rethans - - * ZEND_CHANGES: - - Clearify clone behavior, fixed clone example (Patch by Jan Lehnardt) - -2004-02-16 Marcus Boerger - - * zend_compile.c: - Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call - -2004-02-14 Marcus Boerger - - * zend_iterators.c: - dtor's may not be called from free_storage handlers - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_execute.c: - - Remove old code - -2004-02-12 Hartmut Holzgraefe - - * (php_5_0_0b4) - ZEND_CHANGES: - making sure that the provided examples actualy work (or at least do not - generate no parse errors) unless they are really expected to fail - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.c: - - This was too strict. - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_interfaces.c - zend_object_handlers.c: - - Check return-by-reference bit when implementing interface prototypes - - Add infrastructure for built-in functions to hint whether they - return by reference or not. It is NOT currently used for anything, - except for interface prototypes (you can use it to request that the - function that implements your prototype returns by reference or - doesn't return by reference). - For downwards compatibility - by default, interface prototypes are - agnostic as to whether the function that implements them returns - by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with - ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - - Fix ArrayAccess::getOffset() to conduct additional checks. - If your getOffset() should work with multidimensional arrays - it - must return by reference. - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.h: - - Add comments to read/write property/dimension for extension authors - -2004-02-12 Zeev Suraski - - * zend_default_classes.h: - zend_default_classes.h -> zend_exceptions.h - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - Makefile.am: - - Add zend_exceptions.c - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - ZendTS.dsp - zend.c - zend_default_classes.c - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_reflection_api.c: - Centralize exceptions code in zend_exceptions.[ch]. - Remove zend_default_classes.h (use zend_exceptions.h instead) - - NOTE: This currently breaks the build, fixes to php-src and pecl coming - soon - -2004-02-12 Andi Gutmans - - * zend_execute.c: - - Use zend_throw_exception_object() in throw_handler to make sure it - - does all the checks - -2004-02-12 Zeev Suraski - - * zend_default_classes.c - zend_default_classes.h - zend_exceptions.c - zend_exceptions.h - zend_execute.h - zend_execute_API.c: - Exceptions updates: - - - Enforce exceptions to be derived from class Exception. This allows - users to perform catch-all. It's not yet complete, so don't get - comfortable with it just yet :) Updates are coming soon. - - Implement zend_throw_exception() using zend_throw_exception_ex() - -2004-02-12 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - - Add API function to throw exception by using an object - -2004-02-11 Marcus Boerger - - * zend.c: - Must be initialized in ZTS mode - - * ZEND_CHANGES - ZEND_CHANGES: - Update - - * zend_compile.c - zend_language_parser.y: - Fix: [extends [, ]* ] - -2004-02-11 Zeev Suraski - - * zend_execute.c: - Fix leaks in assignments to overloaded objects - - * zend_execute.c: - Fix leak with overloaded objects, when they're used just "for the hell - of it" :) - - * zend_execute.c: - Fixed a bug the caused overloaded array indices to be converted to strings - - * zend_execute.c: - Turn off bogus warnings with overloaded dimensions and += (and friends) - - * zend_execute.c: - Improve the implementation of unset() on array dimensions to be more - consistent with that of regular variables and string offsets - - * zend_execute_API.c: - Fix bug #25038 - - * zend_reflection_api.c: - Fix crash (patch by Rob Richards) - - * zend.c - zend_execute_API.c: - Fix exceptions thrown without a stack frame - Always enable set_exception_handler() - - * zend_list.h: - Change FETCH_RESOURCE to return false on error instead of null, for - consistency with other error situations - - * zend_compile.c: - Fix bug #26802 (the right aspects of it found by Marcus, anyway :) - - * tests/bug26802.phpt: - Fix and clarify the test case - - * zend_execute_API.c: - Complete the fix for handling of exceptions happening during the - argument passing phase of function calls (fixes bug #26866) - - * zend_execute_API.c: - whitespace - -2004-02-10 Zeev Suraski - - * tests/bug26698.phpt: - Ignore the memleak in this test - - * zend_execute.c: - Fix bug #26698 (exceptions handled properly during argument passing to - functions) - - * zend_default_classes.c: - Fix bug #27186 - - * zend_execute_API.c: - Fix bug #26869 - - * zend_execute.c: - Fix refcounting of ++/+= overloading (fix leak in __get()/__set() - based classes) - -2004-02-10 Andi Gutmans - - * zend_compile.c: - - Nuke more unused code - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix handling in assignment using multidimensional array syntax to string - offset ($s = "FUBAR"; $s[0][0] = 1;) - -2004-02-10 Andi Gutmans - - * ZEND_CHANGES: - - We will go with PHP 4 behavior. With the new object model assigning by - reference has lost a lot of its importance. - - * zend_compile.c: - - Remove junk - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix exception handling in opcodes spanned across multiple oplines (fixes - the crash in __set()) - - * zend_execute.c: - - Fix pre/post increment for overloaded objects - - Fix binary-assign-op for overloaded objects - - NOTE: This requires the implementation of the 'get' callback! - -2004-02-10 Moriyoshi Koizumi - - * tests/bug22836.phpt: - - Correcting test. - -2004-02-08 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fix write-mode of overloaded objects when using array dimensions - -2004-02-08 Andi Gutmans - - * zend_objects_API.c: - - Check if free_storage exists - -2004-02-05 Sebastian Bergmann - - * ZEND_CHANGES: - Committing for Jan. - -2004-02-05 Ilia Alshanetsky - - * zend_compile.c - tests/bug27145.phpt: - Fixed bug #27145 (Unmangle private/protected property names before printing - then inside error messages). - -2004-02-04 Zeev Suraski - - * zend_execute_API.c: - Fix exceptions happening inside internal functions called through - zend_user_function() - - * zend_execute_API.c: - Remove double initialization - -2004-02-04 Marcus Boerger - - * zend_objects.h: - Add new prototype - - * zend_reflection_api.c: - Fix reflection - - * zend_iterators.c: - Fix warnings - -2004-02-04 Zeev Suraski - - * zend_compile.c: - Fixlet - - * zend_compile.c: - Fix handling of $this in some cases - - * zend_compile.c: - Handle additional cases - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_language_parser.y: - Reinstate early-binding for classes. - - Note that this is available for downwards compatibility only - and it - doesn't - work if you use new features (namely, interfaces). Generally, people - should - declare their classes before using them, but we just didn't want hell to - break - loose (c) - - * zend_opcode.c: - Optimize - - * zend_compile.c: - - Improve $this assignment detection and generalize some code in - zend_compile.c - - * zend_compile.c: - -Error out when trying to re-assign $this - - * zend_objects_API.c - zend_objects_API.h: - The valid bit was necessary after all - restored - - * zend_objects_API.c: - Fixlets - - * zend_compile.c - zend_objects.c: - - Small fixes - - * zend_execute.c: - - Improve wording - - * zend_execute_API.c - zend_iterators.c - zend_objects.c - zend_objects_API.c - zend_objects_API.h - zend_reflection_api.c: - Change destructor implementation (details will follow on internals@) - -2004-02-03 Marcus Boerger - - * tests/bug24884.phpt: - Update tests - - * zend_objects.c: - Nuke unused variable - - * zend_compile.c: - Fix Warning - -2004-02-03 Sebastian Bergmann - - * ZEND_CHANGES: - clone/__clone() related changes. - -2004-02-03 Zeev Suraski - - * zend_compile.c: - Remove unused variable - - * zend_objects_API.c - zend_objects_API.h: - Remove more garbage - valid bit was not really necessary - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c - zend_objects_API.h: - - Clean garbage (delete was nuked a long time ago) - -2004-02-03 Ilia Alshanetsky - - * zend_execute.c: - More unneeded code removed. - -2004-02-03 Zeev Suraski - - * zend_execute.c - zend_language_scanner.l: - Abort on parse error in an include file (patch by Ilia) - - * zend_compile.c: - Remove redundant code - - * zend_execute.c: - Fix try/catch block logic - - * zend_compile.c - zend_objects.c: - Perform a bitwise copy of the object even when __clone() is defined. - __clone() is back to not requiring any arguments, as $that is no longer - needed ($this already contains a copy of the original object, by the time - we __clone() is executed). - Calling the parent clone is done using parent::__clone() - - * zend_compile.c - zend_compile.h - zend_default_classes.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Rewrote exception support. Fixes a few limitations and bugs in the old - implementation, and allows exceptions to 'fire' much earlier than before. - - Instructions on how to use the new mechanism will follow on internals@ - shortly... - - Note - this (most probably) breaks the current implementation of - set_exception_handler() - -2004-02-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_objects.c: - Redesign the clone() feature to fix some fundamental flaws in the previous - implementation. - - Using clone directly is now done using - $replica = clone $src; - - Clone methods must now be declared as follows: - function __clone($that) - { - } - - Clone methods in derived classes can call the __clone method of their - parent - classes using parent::__clone($that) - -2004-01-31 Marcus Boerger - - * zend_reflection_api.c: - Throw an exception in case a reflection object cannot be found and do not - override the exception from constructors in static method calls. - -2004-01-30 Ilia Alshanetsky - - * zend_execute.c: - Apply the same parse error handling to (include|require)_once as the one - for - their non-once counterparts. - -2004-01-28 Zeev Suraski - - * zend_compile.c: - Tweak checks to detect some additional cases. - Reorder checks to make more sense. - - * zend_compile.c: - - Error message fix - - Prevent inheritance of the same constant from two interfaces - - * zend_compile.c: - Fixlets - - * zend_compile.c - zend_compile.h: - Prevent classes from implementing interfaces that have the same function - - * zend_execute.c: - Whitespace - - * zend_compile.c: - Code relayout - - * zend_execute_API.c: - Forward-port fix for timeouts under Windows - -2004-01-26 Marcus Boerger - - * zend_interfaces.c - zend_interfaces.h: - - Export struct zend_user_iterator - - Ad 'it' to function prefix to prevent naming clashes - - Export zend_user_it_free_current - -2004-01-25 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #26814 (On parse error include included file, terminate - execution script). - -2004-01-25 Marcus Boerger - - * zend_execute.c - zend_iterators.c - zend_iterators.h: - Respect proeprty visibility in foreach - - * tests/bug26696.phpt: - Update test - -2004-01-24 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling - internal non-static methods statically. - -2004-01-24 Sebastian Bergmann - - * zend_execute.c - zend_execute_API.c: - Change message as proposed by Jon. - -2004-01-23 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Simplify detection of methods that must be called dynamic (with object) - - * zend_execute.c - zend_execute_API.c: - Disallow calling __clone/__construct/__destruct static - Send an E_STRICT when calling a non static method static - - * zend_API.c - zend_compile.c - zend_compile.h: - Disallow static declaration of clone - -2004-01-23 Jani Taskinen - - * zend_constants.h - zend_ini.h: - Silence some compile warnings - -2004-01-22 Marcus Boerger - - * zend_default_classes.c: - Fix internal access to exception properties - -2004-01-19 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Hopefully fix bug #26696. - - Please let me know if hell-breaks loose - -2004-01-19 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_get_module_started() to quickly check whether a module is present - and its MINIT function has been called. - -2004-01-18 Marcus Boerger - - * zend_execute.h - zend_execute_API.c: - Improove debug capabilities - - * zend_reflection_api.c: - Fix some casing issues - -2004-01-17 Marcus Boerger - - * zend_interfaces.c: - - - * zend_interfaces.c: - Fix inheritance rule for interface Traversable - -2004-01-17 Jani Taskinen - - * tests/bug26802.phpt: - - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 - -2004-01-17 Ilia Alshanetsky - - * zend_object_handlers.c - zend_object_handlers.h: - Expose zend_std_call_user_call(), needed for implementation of things like - __call handlers. - -2004-01-17 Jani Taskinen - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - Nuke compile warning by using the LANG_SCNG macro instead - -2004-01-16 Jani Taskinen - - * zend_reflection_api.c: - - Fixed bug #26640 (__autoload() not invoked by Reflection classes) - - -2004-01-15 Zeev Suraski - - * zend.c: - Nice patch Christian, but it wasn't at all enabled? :) - - Fix bug #26883 - -2004-01-14 Zeev Suraski - - * zend_compile.c: - Don't allow interfaces to implement anything - -2004-01-14 Andi Gutmans - - * zend_operators.h: - - Remove bogus macros - -2004-01-13 Wez Furlong - - * zend_ini_parser.y: - Don't treat strings containing : as potential constant names in - the .ini parser. - This fixes Bug #26893 - -2004-01-12 Andi Gutmans - - * zend_compile.c: - - Return the PHP 4 behavior of not allowing class declerations within - - class declerations. This happened when declaring a class within a - - method. - class A { - function foo() { - class B { - } - } - } - -2004-01-12 Marcus Boerger - - * zend_API.h: - Add missing macro - -2004-01-11 Wez Furlong - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - TSRMLS fix - -2004-01-11 Andi Gutmans - - * zend_language_parser.y: - - Re-allow conditional class declerations. Needless to say that I also - - think it's not great coding.. Use polymorphism instead :) - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - - This should fix the problem of conditional function decleration on the - - same line of code not to work. You should re-evaluate your coding style - - if you really code this way :) - -2004-01-10 Zeev Suraski - - * zend_operators.c: - Remove conflict - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_operators.c: - Added error mask to set_error_handler() - Patch by Christian Schneider - -2004-01-09 Wez Furlong - - * acconfig.h: - support for building asm in the unix buildsys. - Also, when ZEND_ACCONFIG_H_NO_C_PROTOS is defined, - omit the C prototypes from the configuration header - so that it can be included into asm files. - -2004-01-09 Marcus Boerger - - * RFCs/002.txt: - this one is declined - -2004-01-09 Wez Furlong - - * zend_object_handlers.h: - must be extern to avoid problems with some compilers - -2004-01-09 Stanislav Malyshev - - * tests/bug26077.phpt: - fix expect - - * zend_compile.c: - Bug #25816 - disallow arrays in class constants - - * tests/bug26077.phpt: - add test - - * zend_compile.c - zend_execute.c: - Fix Bug #26077 - memory leak when new() result is not assigned - and no constructor defined - -2004-01-08 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_scanner.h - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Happy new year and PHP 5 for rest of the files too.. - -2004-01-08 Andi Gutmans - - * zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l: - - - A belated happy holidays (by two years) - -2004-01-07 Marcus Boerger - - * zend_execute.c: - Reimplement part of Bug #24608 that was reverted too - - * zend_execute.c: - Revert patch that allowed to call sttaic methods via $method() - -2004-01-06 Ilia Alshanetsky - - * zend_mm.c: - Check if realloc() succeeds or not. (Noticed by Andrey) - -2004-01-06 Marcus Boerger - - * tests/bug26802.phpt: - Update - -2004-01-05 Marcus Boerger - - * zend_execute.c - tests/bug26802.phpt: - Fixed bug #26802 - - * tests/bug26802.phpt: - Fix test - - * tests/bug26801.phpt - tests/bug26802.phpt: - Add new test - - * tests/bug26696.phpt: - Update test - -2004-01-05 Stanislav Malyshev - - * zend_API.c: - Fix bug #26543 - check parent:: and self:: in class names - - * zend_execute.c - zend_object_handlers.c: - Bug #24608 - fix interaction between __accessors and get_property_ptr - -2004-01-03 Derick Rethans - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_reflection_api.c: - - Fixed var_export() to show public, protected and private modifiers - properly. - - Exported (un)mangle_property_name. - -2004-01-02 Andrei Zmievski - - * zend_default_classes.c: - Do not show exception message if it's empty. - - -2003-12-31 Andrei Zmievski - - * zend_default_classes.c: - Make default message look better. - -2003-12-30 Andi Gutmans - - * ZEND_CHANGES: - - Fix typos - -2003-12-30 Marcus Boerger - - * ZEND_CHANGES: - Update - -2003-12-30 Ilia Alshanetsky - - * tests/bug26696.phpt: - Added test case for bug #26696. - -2003-12-29 Marcus Boerger - - * zend_execute.c: - Fix (string) conversion - - * zend.c: - Add missing notice - - * zend_execute_API.c: - Fix __autoload() with derived classes - -2003-12-28 Marcus Boerger - - * zend_API.c: - WS - - * zend_API.h - zend_compile.c: - Fix order of class_entry member initialization (needed for example for DOM) - -2003-12-27 Marcus Boerger - - * zend_language_parser.y: - Fixed bug #26065 (Crash when nesting classes) - - * tests/bug26698.phpt: - Add new test - - * zend_objects.c: - Simplify - - * zend_object_handlers.c: - Fix __tostring() and concatenation - -2003-12-25 Marcus Boerger - - * zend_execute.c - zend_execute.c: - Fix warning - -2003-12-25 Ilia Alshanetsky - - * zend_highlight.c: - Fixed Bug #26703 (Certain characters inside strings incorrectly treated as - keywords). Original patch by vrana@php.net. - -2003-12-23 Marcus Boerger - - * zend.c - zend_execute_API.c - zend_globals.h - tests/bug26697.phpt: - Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload - results in segfault). - -2003-12-22 Marcus Boerger - - * tests/bug26229.phpt - tests/bug26695.phpt: - Add more tests - - * tests/bug24884.phpt - tests/bug26166.phpt: - Fix tests now that class names are shown in correct casing - - * zend_compile.c: - Preserve class name casing. - - * zend_reflection_api.c: - Fixed bug #26695 (Reflection API does not recognize mixed-case class hints) - - * zend_object_handlers.c: - Fixed bug #26675 (Segfault on ArrayAccess use) - Update NEWS - -2003-12-22 Wez Furlong - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h: - export these symbols for use by SPL as a shared extension - -2003-12-19 Andi Gutmans - - * (php_5_0_0b3RC2) - zend_language_parser.y: - - Nuke another rule (thanks to Jan for noticing this) - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend.c: - Bug #25547 (error_handler and array index with function call) was fixed - tests/lang/bug25547.phpt - -2003-12-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke unused code - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend_execute.c: - Error reporting on unset string offset was added (Bug #24773 - Zend/tests/bug24773.phpt) - - * zend_execute.c: - Assign_op operators (+=) were fixed for elements of overloaded objects - -2003-12-18 Andi Gutmans - - * zend_execute.c: - - Nuke C++ comment - - * zend_execute.c: - - Revert patch 1.566 - -2003-12-18 Marcus Boerger - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fixed bug #24837 Incorrect behaviour of PPP using foreach. - -2003-12-17 Zeev Suraski - - * (php_5_0_0b3RC1) - zend_execute.c: - This part of the if was necessary after all. - Refix bug #22510 - -2003-12-17 Dmitry Stogov - - * (php_5_0_0b3RC1) - zend_execute_API.c: - -** empty log message *** - - * (php_5_0_0b3RC1) - zend_compile.c: - Dynamic function call from object's property was fixed - (See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt") - - * zend_execute_API.c: - Access to globals/autoglobals from class __destructor was fixed. - (see "tests/lang/bug24908.phpt" and - "tests/classes/destructor_and_globals.phpt") - -2003-12-16 Sebastian Bergmann - - * zend_compile.h - zend_object_handlers.h - zend_stream.h: - Sync: Export externally used functions. - -2003-12-16 Stanislav Malyshev - - * zend_compile.c: - export class initialization function - - * zend_object_handlers.c: - export externally used functions - - * zend_stream.c: - export function - -2003-12-15 Marcus Boerger - - * zend.c - zend_object_handlers.c - zend_object_handlers.h: - Reenable __tostring() magic for print,echo,concatenation,function naming... - but not for other internal things. - -2003-12-15 Jani Taskinen - - * zend_execute.c: - ws + cs (no c++ comments in c code) - -2003-12-15 Dmitry Stogov - - * zend_execute.c: - Bug #24773 was fixed (Zend/tests/bug24773.phpt) - Assign_op operators (+=) were fixed for elements of overloaded objects - Memory leaks during accessing ptoperies/elements of overloaded objects - were fixed - - * zend_execute_API.c - zend_reflection_api.c: - Memory corruptions were fixed in zend_str_tolower_copy() - -2003-12-14 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - Fix behavior of return-by-reference functions. Remove erroneous warnings, - add E_STRICT warnings in case you return something by reference that - you're - not supposed to (anything that's not a variable, or a return-value of a - function that returned by reference). - - * zend.h - zend_execute.c - zend_execute.h: - Some cleanup - -2003-12-13 Moriyoshi Koizumi - - * zend_operators.c: - Fixes for POSIX compliancy. - -2003-12-12 Marcus Boerger - - * zend.c: - Free is needed in non ZTS too - - * zend.c: - Fix memleaks in ZTS mode - - * zend.c: - Fix memleaks - -2003-12-12 Ilia Alshanetsky - - * zend_constants.c: - Do not copy extra byte. - -2003-12-11 Ilia Alshanetsky - - * zend.h: - Fixed extra byte allocation for TRUE/FALSE/ZEND_THREAD_SAFE/NULL constants. - -2003-12-11 Marcus Boerger - - * zend_execute_API.c: - Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught - Exception - -2003-12-11 Andi Gutmans - - * zend_execute.c: - - Refix bug #24773 - -2003-12-11 Marcus Boerger - - * zend_object_handlers.c: - Handle getter failure and allow to bypass thrown exceptions. - - * zend_execute.c: - read_dimension() handler might return 0, handle this. - -2003-12-10 Marcus Boerger - - * zend_execute_API.c: - Do not double copy the string - -2003-12-09 Jani Taskinen - - * zend_operators.c - zend_operators.h: - - Brought ext/bcmath to the new millennium - -2003-12-09 Andi Gutmans - - * zend_constants.c: - - Fix overallocation (thanks to Ilia) - -2003-12-08 Derick Rethans - - * zend_builtin_functions.c: - - Make it compile again - -2003-12-07 Stanislav Malyshev - - * zend_builtin_functions.c: - Apply Andrey Hristov's patch adding get_declared_interfaces() - -2003-12-06 Marcus Boerger - - * zend_compile.c: - This test is against interfaces not abstract classes. - - * zend_default_classes.c: - Show the exception message again after __toString() magic has been dropped. - -2003-12-05 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Remove two unneeded convert_to_string() (found by Marcus) - - Change illegal use of string offset to E_ERROR - -2003-12-05 Ilia Alshanetsky - - * zend_default_classes.c: - Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. - -2003-12-04 Moriyoshi Koizumi - - * zend_execute.c: - Revert crap. - - * zend_execute.c: - Raise error in case dereference is performed on a scalar value. - -2003-12-03 Ilia Alshanetsky - - * tests/bug24773.phpt: - Test case for bug #24773. - -2003-12-03 Moriyoshi Koizumi - - * zend_execute.c: - This kind of error should be caught. (suggested by Andi, thanks) - - * zend_execute.c: - Fix bug #24773 (unset()ing string offsets crashes PHP) - -2003-12-03 Derick Rethans - - * zend_execute.c: - - Remove newline from error message - -2003-12-02 Marcus Boerger - - * zend_object_handlers.c: - Remove automatic call to __toString() since it is supposed to cause too - much trouble. See discussion on the mailing list. - -2003-12-02 Andi Gutmans - - * zend_API.c - zend_operators.c: - - Revert the revert of these patches. This overloading can only be used - - by C extensions such as SimpleXML and *NOT* PHP code. Reasons given - - on the mailing list and problem with reentrancy inside the opcodes. - - * zend_compile.c: - - Fix for bug #26182 - - * zend_errors.h: - - Don't include E_STRICT in E_ALL. - -2003-12-02 Marcus Boerger - - * zend_API.h: - Free the zval container only if it should be freed and was not copied. - -2003-12-01 Andi Gutmans - - * zend_execute.c: - - Change to E_STRICT so as not to break existing scripts. - - Thanks Edin - - * zend_builtin_functions.c: - - Nuke property_exists(). We need to fix isset() and this is already - - supported in reflection API. In any case, it's best not to add new - - functions in the general namespace except for keeping engine consistency - (which would have been true in this case) - - * zend_API.c: - - Revert auto-conversion in parameter API - - * zend_operators.c: - - Don't automatically call __toString() in convert_to_string_ex(). - - use __toString() in your code. - - Keep the auto-case in make_printable_zval. - -2003-11-30 Marcus Boerger - - * zend_default_classes.c: - Check return value of exception::__tostring() - - * tests/bug20240.phpt: - Fix test - -2003-11-29 Marcus Boerger - - * zend_compile.c - zend_iterators.c: - Fix memleak - -2003-11-29 Ilia Alshanetsky - - * zend_highlight.c - zend_language_scanner.l: - Fixed bug #26463 (Incorrect handling of semicolons after heredoc) - -2003-11-29 Marcus Boerger - - * zend_API.h: - This takes the address of a zval ptr - - * zend_API.h: - Add macros to return values of other zvals. - This is needed because one cannot use REPLACE_ZVAL_VALUE with - return_value. - -2003-11-29 Ilia Alshanetsky - - * zend_execute.c: - Restore original patch for bug #26281. - - -2003-11-29 Marcus Boerger - - * zend_compile.c: - Revert accidential commit until decision - - * zend_compile.c - zend_default_classes.c: - Make exception code more robust: - - Fix error in calculation of trace-string length - - Allow to overload __strostring() and make it work for uncaught - exceptions - - Show exception thrown while displaying exceptions - -2003-11-28 Ilia Alshanetsky - - * zend_API.c: - Add removed lcname, it is still needed. - -2003-11-27 Marcus Boerger - - * zend_API.c: - Convert objects to string if string is required by newer parameter parsing - since we do this for older parameter parsing does so too. - - * zend_object_handlers.c: - The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * - writeobj. to allow it the api needs to be changed to zval **writeobj. - - * zend_builtin_functions.c: - Add a support function to check for property existance which is different - from checking a property from being empty/set. - Update test #26182. - -2003-11-24 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_operators.h: - Add new interface ArrayAccess to use objects as Arrays - -2003-11-24 Andi Gutmans - - * zend_constants.c: - - Fix newly introduced bug which stopped class constants from working. - - Thanks to Jan Lehnardt for reporting it. - -2003-11-24 Sebastian Bergmann - - * RFCs/004.txt: - No longer needed. - -2003-11-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_reflection_api.c: - - Fix __autoload() to preserve class case. - - Heads up, this patch might break stuff so please let me know if you - - bump into any problems. - -2003-11-23 Andi Gutmans - - * zend_reflection_api.c: - - Allocation optimizations by Timm Friebe - -2003-11-21 Ilia Alshanetsky - - * zend_execute.c: - Cleaner patch for bug #26281. - -2003-11-19 Ilia Alshanetsky - - * zend_execute.c - tests/bug26281.phpt: - Possible fix for bug #26281 & test case. - -2003-11-18 Marcus Boerger - - * zend_API.h: - Add method alias macro - -2003-11-18 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_constants.c - zend_errors.h - zend_language_parser.y: - - Add E_STRICT, to be used to warn purists (like Jani :) - -2003-11-18 Marcus Boerger - - * zend_compile.c: - Backpatch the correct opcode for list(), property overloading needs more - opcodes (Bugfix #26257). - - * zend_interfaces.c: - Use correct order - - * zend_interfaces.c: - Use correct macro/function - -2003-11-17 Marcus Boerger - - * zend_interfaces.c: - Correct destruction - -2003-11-13 Moriyoshi Koizumi - - * zend_operators.c: - Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) - -2003-11-13 Marcus Boerger - - * ZEND_CHANGES - zend_interfaces.c: - IteratorAggregate::getIterator() cannot return anythingy else than objects - -2003-11-13 Andi Gutmans - - * zend_compile.c: - - Make sure internal clasess are malloced - -2003-11-10 Marcus Boerger - - * zend_iterators.c: - Don't use zend_class_entry indirection - - * zend_builtin_functions.c: - Bugfix #26010 (Bug on get_object_vars() function) - - * zend_object_handlers.c: - Correct default handlers - - * zend_iterators.c: - Need to update iterators handler table too. - - * zend_execute.c - zend_object_handlers.c: - Fix those warnings - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Split isset/isempty for object property and object dimension hooking. - - * zend_interfaces.c: - Little iterator improvement: ability to store index in iterator - -2003-11-08 Marcus Boerger - - * zend_reflection_api.c: - Add method reflection_class::implementsInterface() - Allow string & reflection_class in isSubclassOf() - - * zend_reflection_api.c: - Fix reflection_class::isSubclassOf() - - * zend.c - zend_object_handlers.c - zend_operators.c - tests/bug26166.phpt: - Handle exceptions in casting more gracefully. - This fixes bug #26166 - -2003-11-07 Marcus Boerger - - * zend_execute_API.c: - Make __autoload() faster - - * zend_execute.c - zend_iterators.h: - Update Iterators: Call next at the correct point in time. - - * zend_compile.c: - Add missing initialization. - - * zend_interfaces.h: - Make these class entries available for inheriting classes - -2003-11-06 Ilia Alshanetsky - - * zend_operators.c: - Fixed bug #26148 (Print the notice before modifying variable on type - mismatch). - - - Patch by: morten-bugs dot php dot net at afdelingp dot dk - -2003-11-04 Marcus Boerger - - * zend_execute.c - zend_interfaces.c: - Prevent some SEGV's when Exceptions are thorown inside iterators. - - * zend_builtin_functions.c: - Removedouble efree call - -2003-11-04 Moriyoshi Koizumi - - * zend_object_handlers.c: - __tostring() handler should be binary-safe - - * tests/bug26010.phpt: - Fix one more test - -2003-11-04 Stanislav Malyshev - - * Makefile.am: - add zend_iterators.c zend_interfaces.c to make - -2003-10-31 Moriyoshi Koizumi - - * tests/bug26010.phpt: - Add test case for bug #26010 - -2003-10-30 Stanislav Malyshev - - * zend_compile.c: - make CATCH opcode use "class" T like other opcodes do - via IS_CONST - -2003-10-30 Andi Gutmans - - * (php_5_0_0b2) - ZEND_CHANGES: - - Beta 2 - -2003-10-29 Moriyoshi Koizumi - - * zend_operators.h: - Use pretty macro instead. - -2003-10-28 Andi Gutmans - - * zend_language_parser.y: - - Head up! I'm reverting the patch which allows for expressions in constant - - declerations. Allowing the access of other constants in this code is - - flawed. We are reverting back to PHP 4's static scalars. - - Don't worry if you get the following msg when compiling: - - "zend_language_parser.y contains 3 useless nonterminals and 22 useless - rules" - - I didn't nuke the code in case we have some brilliant ideas after beta 2 - -2003-10-28 Marcus Boerger - - * zend_interfaces.c: - Give some freedon to c iterators but not in userspace. - -2003-10-28 Shane Caraveo - - * zend_compile.c: - fix crash in do_implement_interface when compiling - pear/PHPUnit/Framework/TestCase.php line 63 - while only interface_gets_implemented is the issue in this instance, both - these vars were unitialized, causing potential other issues - -2003-10-25 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_make_callable() which allows to make zval's callable zval's. - At the moment this function only converts strings of the form - class::method - to an array(class,method). - - * zend_default_classes.c - zend_reflection_api.c: - This forces a better error message for non working clone calls. - - * zend_default_classes.c: - And use things to throw an exception here - - * zend_default_classes.c: - You shall not clone Exception instances - - * zend_reflection_api.c: - You shall not clone reflection_xx instances - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-25 Sebastian Bergmann - - * ZEND_CHANGES: - Fugbix typo. - - * ZEND_CHANGES: - s/Throwable/Printable: Exception has become an internal class since I - initially documented interfaces. - -2003-10-24 Andi Gutmans - - * ZEND_CHANGES: - - Fix typo - -2003-10-24 Marcus Boerger - - * zend_API.c - zend_execute_API.c: - Revert accidental commit - - * ZEND_CHANGES - zend_API.c - zend_execute_API.c: - Zend/ZEND_CHANGES - -2003-10-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp: - Add zend_interfaces.{c|h}. - -2003-10-22 Ilia Alshanetsky - - * zend.c: - Fixed bug #25922 (Crash in error handler when 5th argument is modified). - -2003-10-22 Marcus Boerger - - * zend_default_classes.c - zend_interfaces.c - zend_interfaces.h: - Impement userspace iterator interfaces and tests. See tests for details - on the names. - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Expand Interface C API. - In short: zend_class_entry->interface_gets_implemented() allows to modify - the class entry of a class when an interface gets implemented. - - * zend_default_classes.c: - The string conversion method should be named __toString() - -2003-10-21 Marcus Boerger - - * ZEND_CHANGES: - Make this clear - -2003-10-20 Andi Gutmans - - * ZEND_CHANGES: - - Add comment from Timm - -2003-10-20 Marcus Boerger - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke const in function parameters. I just can't remember why this exists - - and it seems no one else remembers either. It has no semantic meaning. - -2003-10-18 Marcus Boerger - - * zend.h - zend_API.h - zend_compile.c - zend_iterators.h: - Fix class/iterator relationship & handling - - * zend_iterators.c: - Fallback to old behavior until we have a default iterator that respects - visibility we do the array trick. - - * zend_iterators.h: - Change order: Optional rewind() to end of structure - -2003-10-17 Marcus Boerger - - * ZendTS.dsp: - WS - - * zend_reflection_api.c: - Show if a class/object is iterateable - - * ZendTS.dsp - zend.h - zend_API.h - zend_default_classes.c - zend_execute.c - zend_iterators.c - zend_iterators.h: - Added c-api for iterators - - * zend_reflection_api.c: - Fix showing final/abstract for classes - -2003-10-17 Ilia Alshanetsky - - * zend_ini_parser.y: - Fixed formatting issue. - - * zend_alloc.c: - Fixed if() condition. - -2003-10-15 Marcus Boerger - - * zend_API.c - zend_API.h: - Add oo support function zend_class_implements() - - * zend_default_classes.c: - Fix cast function - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Argh, the suffering copy&paste can cause - - * zend_alloc.c: - - Fix compile problem. - - * zend_mm.c: - - Fix the fix by making sure the new block is in the right free list. - -2003-10-14 Stanislav Malyshev - - * zend_execute_API.c: - The freed one is a hashtable - may matter if Hashtables are allocated - differently - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Support merging free block which was created by reallocing to smaller - - size. This should fix some performance issues. This code is still not - - thoroughly tested. - -2003-10-09 Zeev Suraski - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Allow foo::$bar() - -2003-10-07 Rasmus Lerdorf - - * Zend.m4: - MFB bison configure test fix - -2003-10-07 Zeev Suraski - - * zend_execute.c: - Fix bug #17997 (Warning when switch & reference are combined) - - * zend_ini_parser.y: - Fix the fix :) - Not thoroughly tested, but appears to work fine - -2003-10-07 Marcus Boerger - - * zend_ini_parser.y: - Bugfix #25770 Segfault with PHP and bison 1.875 - -2003-10-05 Zeev Suraski - - * zend_object_handlers.c: - Remove unused callback - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Remove redundant callback, simplify API - -2003-10-05 Shane Caraveo - - * (BEFORE_HANDLERS_RESHUFFLE) - zend_API.h: - this little piggy broke lots of things...eg. _function_check_flag in - reflection api. - -2003-10-03 Moriyoshi Koizumi - - * zend_API.c: - Fixed bug #24766 (strange result array from unpack()) - - * zend.h: - Bug #25738 (alloca() related problems on the Darwin platform) - - * zend_API.h: - Ensure lval to have a *boolean* value. - -2003-10-03 Jani Taskinen - - * Zend.m4: - Aligned configure help texts. - -2003-09-30 Moriyoshi Koizumi - - * zend_compile.c: - Remove redundant '\n' - -2003-09-26 Hartmut Holzgraefe - - * zend_alloc.c: - signed/unsigned compiler warning fixes - -2003-09-25 Georg Richter - - * zend_alloc.c: - fixed compiler warning - removed dead code - - * zend_hash.h: - changed ulong to long to avoid compiler warnings (comparison between signed - and unsigned) - -2003-09-22 Ilia Alshanetsky - - * zend.c - zend_language_scanner.l: - Added missing format. - -2003-09-20 Marcus Boerger - - * zend_reflection_api.c: - Add public array Reflection_Class::getDefaultProperties() - -2003-09-18 Marcus Boerger - - * zend_builtin_functions.c: - Nuke vars no longer needed - - * zend_builtin_functions.c - zend_reflection_api.c: - Go with studlyCaps - - * zend_reflection_api.c: - Change tostring() into __toString() to match method name used in casting. - - * zend.c - zend_operators.c: - Fallback to default behaviour for unsupported object type conversions - - * zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Allow partial type conversion support for objects. - - Add support for object to string conversion from userspace by method - __toString() and add a test. - - * zend_API.c: - Add missing check - -2003-09-17 Marcus Boerger - - * zend_compile.c - zend_execute.c: - Show name of missing function as typed - - * zend_default_classes.c: - Use studlyCaps in exception class - - * zend_compile.c: - Go with studlyCaps in error messages/backtrace/reflection output - -2003-09-16 Marcus Boerger - - * zend_reflection_api.c: - - Make it clear whether it is an interface or a class - - Fix static properties - -2003-09-15 Marcus Boerger - - * zend_execute.c: - Revert - need to look for a better solution - - * zend_execute.c: - Bugfix #25547 - -2003-09-15 Zeev Suraski - - * zend_operators.c: - Simplify / fix - -2003-09-14 Marcus Boerger - - * zend.c: - Bugfix #25335 - -2003-09-14 Zeev Suraski - - * zend_operators.c: - Commit 64-bit fixes to the standard operators - by Ard Biesheuvel (abies@php.net) - -2003-09-14 Marcus Boerger - - * zend.h: - Bugfix #25528 (by Ard Biesheuvel) - -2003-09-13 Marcus Boerger - - * zend_alloc.c: - Fix warnings - -2003-09-11 Stanislav Malyshev - - * tests/dtor_scope.phpt: - add test - - * zend_execute_API.c: - ws - - * zend_execute_API.c: - Use scope from method, not from object - -2003-09-11 Marcus Boerger - - * zend_default_classes.c: - Use type instead of constant - -2003-09-08 Marcus Boerger - - * zend_compile.c: - Fix property inheritance where a derived class inherits a public property - and owns it as an implicit public property already (noticed by Brad). - - * zend.c: - Fix registering/derigistering of stdClass in ZTS and NON ZTS mode - -2003-09-07 Marcus Boerger - - * zend_execute.c: - Fix foreach() called with non array - -2003-09-07 Stanislav Malyshev - - * Zend.m4: - check for mach-o/dyld.h - needed for non-PHP ZE build - -2003-09-06 Marcus Boerger - - * zend_default_classes.c: - Disallow to changing the backtrace - - * zend_reflection_api.c: - Add missing newline if no static methods are available - - * zend_reflection_api.c: - - Internal functions shall be static - - Fix more nesting - - * zend_reflection_api.c: - Fix logic - - * zend_reflection_api.c: - - Fix CS: {{{ / }}} - - Fix static reflection_*::export() - - Add class reflection_object which allows to show dynamic properties - - * zend_reflection_api.c: - Use %s where it makes more sense - -2003-09-05 Marcus Boerger - - * zend_reflection_api.c: - Simplify reflection_property::__constructor() and fix property factory - - * zend_reflection_api.c: - - Don't use resorved words as variable names. - - Improve several exception messages. - - Fix Reflection_Property::_construct() / getDeclaringClass() - - * zend_reflection_api.c: - Fix reflection_api::__construct() (noticed by Andrey) - - * zend_default_classes.c: - Provide string casting for exceptions by calling toString() - -2003-09-04 Marcus Boerger - - * zend_API.c - zend_execute.c - zend_object_handlers.c: - Tests show updating consts must happen once at runtime (revert - optimization). - Add tests for static properties. - - * zend_reflection_api.c: - Add reflection_class::getstaticproerties() - -2003-09-03 Marcus Boerger - - * zend_compile.c: - Partly revert and reintroduce hash table entries for the ctor. - - * zend_compile.c: - Nuke unused variable, too - - * zend_compile.c: - - Inheritance applies to __clone() too. - - No need to add additional functions for the constructor. - The handler uses the pointer as intended and doesn't look the the name. - - * zend_compile.c: - Cannot turn a static property into a non static one and vice versa - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c: - Fix handling of static properties initialized to arrays - - * zend_compile.c: - Add missing error messages when violating static property inheritance - rules. - - * zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c: - Fix static properties. - - * zend_compile.c: - Allow redeclareing a protected property as public. - -2003-09-03 Zeev Suraski - - * zend_compile.c: - Revert bogus patch - One must *never* use E_CORE_* error levels! - -2003-09-03 Marcus Boerger - - * zend_reflection_api.c: - Clearly distinguish between Const, Static and Other members. - -2003-09-02 Marcus Boerger - - * zend_compile.c: - Fix error messages - - * zend_API.c: - Allow redeclaring of protected properties as public (for internal classes). - - * zend_reflection_api.c: - Use appropriate function for property name unmangling. - - * zend_reflection_api.c: - Make these static as noticed by Andrey - - * zend_execute.c - zend_object_handlers.c - zend_objects.c: - Synch/Unify error messages related to function/method calls - - * zend_compile.c: - Fix error level - - * zend_API.c - zend_compile.c: - Currently we cannot support static ctor/dtor - - * zend_reflection_api.c: - These are implicit properties as denoted by the flag. Dynamic properties - only - exist in one single object and currently reflection api is not capable of - showing those. - -2003-08-31 Marcus Boerger - - * zend_reflection_api.c: - Don't repeat first const count(consts) time - - * zend_reflection_api.c: - Beautify output - - * zend_reflection_api.c: - Add reflection_parameters, patch by Timm Friebe - - * zend_default_classes.c: - Excluded chars < 32 when displaying string parameters that would obliterate - output. - -2003-08-31 Zeev Suraski - - * zend_arg_defs.c - zend_builtin_functions.c - zend_modules.h: - Attempt at fixing the linkage problem in Win32 - -2003-08-31 Marcus Boerger - - * zend_execute.c: - Synch error message with other one to fix tests - - * zend_reflection_api.c: - Check whether we may access tat union - - * zend.c: - Revisited: Replace the non portable code by spprintf - - * zend_reflection_api.c: - Using zend_spprintf should be faster here - - * zend.c - zend.h - zend_default_classes.c: - Make vspprintf available as zend utility function. Use it in exception - output. - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Actually fetch the parameter - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c - zend_reflection_api.c: - - Calling abstract methods should be a error for consistency reason. - - So in reflection_api we use the reflection_exception again. - -2003-08-30 Andi Gutmans - - * zend_default_classes.c: - - PLEASE stop commiting ^M's - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Even though it is ignored this should be correct - - * zend_default_classes.c: - Add frame numer and finally display stack trace in the message. - - * zend_default_classes.c: - Add exception::traceAsString() and exception::toString() - - * zend_reflection_api.c: - fci.function_table & fci.function_name are not needed since we use - zend_fcall_info_cache - - * zend_reflection_api.c: - Be precise - - * zend_reflection_api.c: - Actually using fcc would be a good idea - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c: - - The compiler can't detect all abstract function calls so we need to - check. - - * zend_default_classes.c: - Make those final (see comment) - -2003-08-29 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add zend_merge_properties() which is designed to serve *_fetch_object(). - - Explain drawbacks of object_and_properties_init and - zend_merge_properties. - - * zend_reflection_api.c: - - Use zend_fcall_info_cache in invoke() to improve speed. - -2003-08-29 Zeev Suraski - - * zend_compile.c: - Fix a problem in implicit public properties and inheritance - -2003-08-29 Sascha Schumann - - * zend_hash.c: - improve a number of zend_debug format strings - -2003-08-29 Marcus Boerger - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - Need to tell zend_fetch_debug_backtrace() whether to skip top function or - not. - -2003-08-28 Marcus Boerger - - * zend_default_classes.c: - Add public read access to protected - - * zend_default_classes.c - zend_default_classes.h: - Add zend_throw_exception_ex() which allows to format exception messages. - - * zend.c: - Classe tables work this way - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - - Split debug_backtrace() into lowlevel c function and php function wrapper - - Add trace property to default method based on new - zend_fetch_debug_backtrace - -2003-08-28 Sascha Schumann - - * zend.h: - older gccs don't understand attribute((format)) on function pointers - - * zend.h: - ZEND_GCC_VERSION should always be defined to a number so we can use - simple comparisons all the time. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - Add format attribute to a number of functions - - Kill a few warnings - - * zend.h - zend_alloc.h: - cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that - they can be used by downstream applications - - * zend_alloc.h: - Enable attribute((malloc)) for GCC 2.96 - - * zend_alloc.h: - GCC 2 does not know about malloc yet. - - * zend_alloc.h: - provide attribute((malloc)) where appropiate - -2003-08-27 Marcus Boerger - - * zend_reflection_api.c: - Nuke unused variable - - * zend_reflection_api.c: - Fix reflection_class::newInstance() - -2003-08-25 Jani Taskinen - - * zend.h: - - Fixed bug #25240 (spaces before pre-processor directives) - -2003-08-24 Marcus Boerger - - * zend_API.c: - Add missing check - - * zend_API.c: - Fix memory source of string duplication for non internal properties - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c - zend_execute_API.c - zend_variables.c - zend_variables.h: - - Provide appropriate way to destroy internal zval's. - - Allow internal zval's of type string and disallow complex types. - - Define the default string for extensions at class level instead of ctor. - - * zend_API.h - zend_compile.h - zend_reflection_api.c: - Don't identify alias'ed functions - -2003-08-24 Zeev Suraski - - * zend_API.c: - Use ""'s if you want empty strings. We want to crash on errors. - - * zend_compile.c: - Use pemalloc() - -2003-08-24 Marcus Boerger - - * zend_API.c: - Allow NULL, too - -2003-08-24 Zeev Suraski - - * zend_API.c: - Get rid of more ^M's - Marcus, please check your CVS client! - - * zend_default_classes.c: - Get rid of more ^M's - - * zend_compile.c: - line endings fix - - * zend_execute.c: - Never, ever, overwrite the refcount element of a connected zval! - -2003-08-24 Marcus Boerger - - * zend_reflection_api.c: - Add dedicated reflection_exception - - * zend_default_classes.c - zend_default_classes.h: - Allow to throw instances of classes derived from exception - - * zend.c - zend_default_classes.c - zend_default_classes.h - zend_execute.h - zend_execute_API.c: - - Provide a unified way to display uncaught exceptions, which shows - file/line/message info if possible. - - Add zend_eval_string_ex() to be able to handle exceptions in eval'd - code. - - Use above function to fix memleaks in CLI. - - * zend_reflection_api.c: - Make invoke() work - - * zend_reflection_api.c: - zend_parse_parameters 'O' works the way we need here - - * zend_reflection_api.c: - Not needed - - * zend_default_classes.c: - Make use method macros - - * zend_API.h: - One of PPP is needed, too - - * zend_reflection_api.c: - - Add Reflection_Function::isAlias - - Use ZEND_ME/ZEND_METHOD - - Fix static entries - - * zend_API.h - zend_compile.h: - - Add fn_flag ZEND_ACC_ALIAS - - Unify way of function_entry generation by new macro ZEND_FENTRY - - * zend_API.c: - Fix fn_flags handling - - * zend_API.c - zend_API.h - zend_default_classes.c: - Add property read code and use that in default exception class - -2003-08-23 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Allow zend_throw_exception() to also set the exception code - - * zend_default_classes.c: - Exception has 4 protected default properties (message,code,file,line). - They are all initialized at c-level constructor correctly. - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Internal classes can now have default properties. - - * zend_reflection_api.c: - Show ctor/dtor information and those don't return anything - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c: - - Flag ctor/dtor methods - - Use this to prevent memleaks when an exception gets thrown in ctors. - - * zend_default_classes.c: - Make exception code more robust - -2003-08-22 Ilia Alshanetsky - - * zend_builtin_functions.c - zend_constants.h: - Replace *magic number* with a much nicer define. - - * zend_builtin_functions.c: - Set 2147483647 as the module number of user defined constants - Fixed a few bugs and cleaned up get_defined_constants(). - -2003-08-21 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Add function 'zend_throw_exception(char *message, int duplicate - TSRMLS_DC);' - to provide an easy way to throw exceptions for extension developers. - - * zend_API.c: - If ce not given than any object would do - - * zend_API.c: - Paramspec 'O' / zend_parse_method_params(): only if given check the class - type - -2003-08-20 Zeev Suraski - - * zend_alloc.c: - adhere to silence - -2003-08-20 Marcus Boerger - - * zend_alloc.c: - Fix counting number of leaks - -2003-08-19 Wez Furlong - - * zend_execute.c: - fix build - -2003-08-18 Wez Furlong - - * zend_ini.h: - linkage for C++ - -2003-08-18 Zeev Suraski - - * ZendTS.dsp - zend_execute.c - zend_execute_locks.h: - Prevent access to internal engine functionality - - * zend.h - zend_alloc.c - zend_compile.h - zend_execute.c: - - Improve tracking - - Fix several overloading issues - - * zend_API.c - zend_alloc.h - zend_hash.c - zend_hash.h - zend_ts_hash.c - zend_ts_hash.c - zend_ts_hash.h - zend_ts_hash.h: - Improve tracking - - * zend_compile.c: - ws - -2003-08-17 Marcus Boerger - - * zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c: - Fix warnings - -2003-08-17 Sascha Schumann - - * zend.h: - One bit fields need to be unsigned, otherwise there is no storage for - the sign bit - - "A signed bit field has a length of 1 bit." - - * zend_API.h: - explicitly cast size_t to zend_uint to avoid warnings on 64 bit platforms. - -2003-08-17 Marcus Boerger - - * zend_execute.c: - Remove unnecessary if - - * zend_execute.c: - Put the code where it belongs - fixes a warning and confusion - - * zend_compile.c - zend_execute.c: - Implement a TBD: JMP to the end of foreach - - * zend_compile.c: - WS - - * zend_API.c: - - Show class names in error messages when dealing with methods - - Mark class as abstract if it gets an abstract method - -2003-08-16 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - Simplify abstract method declaration - - * zend_object_handlers.h: - WS - -2003-08-15 Sascha Schumann - - * zend_execute.c - zend_object_handlers.c: - Restrict scope of inline functions to compile unit - - Submitted by: Jason Greene - -2003-08-13 Marcus Boerger - - * zend_objects_API.c: - Add missing entry - - * zend_API.c: - - Show classes in case of methods - - Using sprintf here was a bad idea - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-11 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Bugfix 21918 - -2003-08-11 Masaki Fujimoto - - * Zend.m4 - flex.skl - zend_compile.c - zend_globals.h - zend_highlight.c - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_multibyte.h: - - added script encoding support to Zend Engine 2. - this enables ZE2 to gracefully parse scripts written in UTF-8 (with - BOM), - UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with - '--enable-zend-multibyte' and '--enable-mbstring') - -2003-08-10 Marcus Boerger - - * zend_compile.c: - Bugfix #24637 __destruct not called - -2003-08-09 Moriyoshi Koizumi - - * zend_compile.c: - Fix segfault when a referenced parameter is specified with typehint. - Result of the node will never be used because verify_instanceof handler - has - been eliminated. - -2003-08-09 Marcus Boerger - - * zend_objects.c: - Precise destructor errors - -2003-08-07 Moriyoshi Koizumi - - * tests/bug21478.phpt: - Add missing right parensis - -2003-08-07 Zeev Suraski - - * zend_execute_API.c: - Clarify use of original_function_state_ptr - -2003-08-07 Marcus Boerger - - * zend_execute_API.c: - - Fix warnings - - Fix code - -2003-08-06 Zeev Suraski - - * zend_execute_API.c: - clarify :) - -2003-08-05 Jani Taskinen - - * zend_execute_API.c: - Fix the build - -2003-08-05 Zeev Suraski - - * zend_API.h - zend_execute_API.c - zend_reflection_api.c: - Try to put an end to the endless number of call_user_function variants. - zend_call_function() now takes a structure that should contain all of the - necessary information. If further information is necessary in the future, - then we'll be able to add it without having to introduce a new function. - - As for caching - the 2nd, optional argument is a struct that can hold all - of the information that's necessary to invoke the function, including its - handler, scope and object it operates on (if any). Note that you may only - use a cache if the arguments you provide to zend_call_function() are - identical to the ones of the last call, except for the argument and return - value information. - - - The recently introduced fast_call_user_function() was removed - - I fixed most of the places that used fast_call_user_function() to use - caching - but there are still some that need to be fixed (XML and reflection) - -2003-08-05 Stanislav Malyshev - - * tests/bug24699.phpt: - fix syntax - - * zend_execute_API.c: - remove stack clean - it makes trouble - -2003-08-04 Marcus Boerger - - * zend_execute.c: - Fix ZTS - - * zend_execute_API.c: - Nuke unused variables - - * zend_reflection_api.c: - Add function/method parameter reflection - -2003-08-04 Ilia Alshanetsky - - * zend_execute_API.c - tests/bug23104.phpt: - Fixed bug #23104 (hash position of static arrays not being reset) - -2003-08-04 Stanislav Malyshev - - * zend_execute_API.c: - oops. forgot function - - * zend_execute_API.c: - fix crash #24842 - - * zend_compile.c: - fix leaks: bug #24831 - - * zend_execute.c: - use get_obj_zval_ptr - - * tests/bug24884.phpt: - add test - - * zend_execute.c: - Fix #24884 - clone $this - -2003-08-04 Zeev Suraski - - * zend_compile.c: - Simplify code using XOR - - * zend.h: - Add logical XOR, proves to be quite useful lately - - * zend_opcode.c: - This check shouldn't be necessary - -2003-08-03 Marcus Boerger - - * zend_opcode.c: - Fix crash - - * zend_compile.c: - Fix test and add missing initialization - -2003-08-03 Zeev Suraski - - * zend_API.c: - Ensure functions have a valid access level - - * zend_API.c: - Default to public - -2003-08-03 Marcus Boerger - - * zend_API.c: - Not needed, will be copied from ptr->flags later - - * zend_builtin_functions.c: - Add missing arg info - -2003-08-03 Moriyoshi Koizumi - - * tests/bug24635.phpt - tests/bug24699.phpt: - Style & WS fixes - -2003-08-03 Zeev Suraski - - * (BEFORE_ARG_INFO) - zend_API.c: - No need for this initialization - this function initializes all of the - elements of zend_internal_function - - * (BEFORE_ARG_INFO) - zend_execute.c: - Clean up. extended_value can only contain either ZEND_UNSET_DIM or - ZEND_UNSET_OBJ. - - * (BEFORE_ARG_INFO) - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c: - Generalize fetch_class - -2003-08-02 Marcus Boerger - - * zend_API.c: - Initialize all struct members: Necessary for reflection - - * zend_reflection_api.c: - Show interfaces - -2003-08-02 Wez Furlong - - * zend_API.c: - fix usage of instanceof here too - -2003-08-02 Marcus Boerger - - * zend_execute.c: - Fix warning - -2003-08-01 Wez Furlong - - * zend_API.c: - better fix... - - * zend_API.c: - Fix "O" format for zend_parse_parameters - -2003-07-31 Zeev Suraski - - * zend_API.c: - Use instanceof_function() - - * zend_compile.c - zend_execute.c: - Finish the array overloading patch - - * zend_execute.c: - Cleanup - -2003-07-31 Andi Gutmans - - * zend_hash.c: - - Fix logic. It was the wrong way around. - -2003-07-30 Andi Gutmans - - * zend_execute.c - zend_hash.c: - - Fix problem with hash when updating same bucket with data of different - sizes one after another. - - Fix number of arguments to read_dimension. - -2003-07-30 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of an opcode - - * zend_compile.c - zend_execute.c: - Support overloading of $foo["bar"] += "baz" - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve array overloading - support unset($foo["bar"]) - - * zend_compile.h: - Remove garbage - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_modules.h: - Add exec_finished() callback for modules - this is the last place where the - modules may touch the symbol table reliably - -2003-07-29 Ilia Alshanetsky - - * tests/bug22836.phpt: - Test case for bug #22836. - -2003-07-29 Jani Taskinen - - * zend.c: - Remove the obfuscation caused by the double "#ifdef ZTS" - -2003-07-27 Stanislav Malyshev - - * zend_compile.c: - fix compare - - * zend_compile.c: - use zend_binary_strncasecmp - - * zend_execute_API.c: - change shutdown order so that dtors would coexist with object error - handlers - - * zend_execute.c: - clean the right one - - * zend_execute_API.c: - make shutdown more granular so in case some dtor goes ape we still - can shut down cleanly - - * zend_compile.c - zend_execute.c - zend_objects.c: - make clone and throw coexist peacefully - - * tests/bug24635.phpt - tests/bug24699.phpt: - add test - - * zend_execute.c: - fix #24635: clean hash before putting into cache - - * zend_language_scanner.l: - fix crash #24550 - - * zend_compile.c - zend_constants.c: - fix leaks with class constants (bug #24699) - - * zend_compile.c: - make __clone call case insensitive, just as other calls are - -2003-07-24 Jani Taskinen - - * tests/bug19859.phpt - tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt - tests/bug24436.phpt: - cleanup (CS+ws) - -2003-07-24 Zeev Suraski - - * tests/bug24436.phpt: - Fix expectations :) - - * zend_execute.c: - Fix logic and comments in ASSIGN_DIM - - * zend_compile.c: - Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, - Sterling ;) - - * zend_builtin_functions.c: - Fix each() binary safety for keys - - * zend_execute.c: - Fix assignments to numeric array indices - - * zend_compile.c: - Remove useless code - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Support references in foreach() - Syntax: - foreach ($arr as &$val) - foreach ($arr as $key => &$val) - - * zend_execute.c: - Fix binary safety in foreach() keys (fixes bug #24783) - - * zend.c: - Make print_r() binary safe with keys - -2003-07-23 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_opcode.c: - Remove namespace leftovers - -2003-07-23 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Go back to ZE1-like code - -2003-07-23 Sebastian Bergmann - - * zend_reflection_api.c: - Fix segfault. Patch by Timm Friebe . - -2003-07-22 Marcus Boerger - - * zend_hash.h: - Fix for the moment - -2003-07-22 Zeev Suraski - - * zend_execute.c - zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Improve infrastructure of numeric handling of elements in symbol tables. - - When you want to work with a symbol table, and you don't know whether you - have a numeric ("string that looks like a number") or a string element in - your hands, use zend_symtable_*() functions, in place of zend_hash_*() - functions. - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Fix isset()/empty() for non-trivial object elements - (API change - read_property now accepts an extra element) - Fixes bug #24436 - -2003-07-21 Zeev Suraski - - * zend_object_handlers.c: - Fix bug #24499 - - * zend_execute.c: - Revert fix for #24729, and refix - -2003-07-21 Marcus Boerger - - * zend_execute.c: - Go with a better fix for #24729 - -2003-07-21 George Schlossnagle - - * zend_API.h: - reverted at Andi's request. replaced with more generic wrapper. - -2003-07-20 Marcus Boerger - - * zend_execute.c: - Bugfix #24729 = new ; causes crash when is not set - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - should nt here - -2003-07-20 Marcus Boerger - - * zend_reflection_api.c: - Fix warnings and whitespace in output - - * zend_reflection_api.c: - Add support for instances in Reflection_Class. - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - removed references to smart_str, replaced with private string management - function. When snprintf is integrated into the engine, string_printf - should be altered to use that. - -2003-07-20 Marcus Boerger - - * zend_objects_API.c: - More informative errors here and these are real core errors - - * zend_execute.c: - Fix uncloneable objetcs - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's implementation. - -2003-07-20 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Make it a macro - -2003-07-19 Marcus Boerger - - * zend_hash.c: - This is meant to be used in for(;has_more;next) - - * zend_hash.c - zend_hash.h: - Add missing function to ease implementations - -2003-07-19 Jani Taskinen - - * zend.h: - Fix the HPUX alloca fix as suggested by Sascha - -2003-07-19 Marcus Boerger - - * zend_objects.c - zend_objects.h: - Shuffle code to ease writing clone handlers - -2003-07-19 Andi Gutmans - - * zend.h: - - Don't use alloca on HP-UX (Moriyoshi Koizumi ) - -2003-07-16 Zeev Suraski - - * zend_compile.c: - Fix bug in the verification of interface-function implementation - - * zend_compile.c - zend_compile.h - zend_execute.c: - More cleanup for assign-op handling of objects - - * zend_alloc.c: - Fix warning - -2003-07-12 Andi Gutmans - - * zend_API.c: - - WS - -2003-07-11 Andi Gutmans - - * zend_API.c: - - Add support for Z in zend_parse_parameters(). It will allow the extension - - to retreive the zval **, thus allowing it to use the convert_to_*_ex() - - family of functions to do type conversions without effecting the value - in - - the engine itself. (Josh Fuhs ) - -2003-07-08 Zeev Suraski - - * zend_execute.c: - initial refactoring for assign-op handling of objects - -2003-07-07 Zeev Suraski - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Rework zend_do_declare_property and related code into one code base - - * zend_API.c: - Fix bug - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add get_dim callback - - * zend_execute.c: - Fix naming convention - -2003-07-07 Derick Rethans - - * zend_execute.c: - - Help Zeev fixing ghosts :) - -2003-07-07 Zeev Suraski - - * zend_object_handlers.c - zend_object_handlers.h: - whitespace - - * zend_objects_API.c: - Fix & whitespace - - * zend_object_handlers.c: - fixlet - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Initial support for overloading of array syntax for objects (very initial) - -2003-07-06 George Schlossnagle - - * zend_API.c - zend_API.h: - add convenience functions or adding class properties. Ok'd for commit by - Andi. - -2003-07-04 Andi Gutmans - - * zend_alloc.c - zend_mm.c - zend_mm.h: - - Add heap to memory manager. This should improve performance. - - Enabling it by default so that it gets tested. We should decide before - beta 2 if we want to revert back to malloc or not. - - Thanks to Sebastian for benchmarking it - -2003-07-04 Sebastian Bergmann - - * zend_reflection_api.c: - 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC - -2003-07-04 George Schlossnagle - - * zend_reflection_api.c: - ws fix - -2003-07-03 Marcus Boerger - - * zend_compile.c: - Allow final private methods - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - win build fixes (Rob Richards) - - * zend_reflection_api.c: - can't forget Andrei - -2003-07-03 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - enable Classname() constructor to be called via parent::__constructor() - - * tests/bug19859.phpt: - add test for Bug #19859 - - * zend_API.c - zend_execute_API.c: - Fix bug #19859 - allow fast_call_user_function to support __call - - * zend_builtin_functions.c: - fix the get_parent_class fix - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's patches, and mod authors line to give credit where credit is - due. - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Temporairy solution to overcome shutdown propbelms with objects that have - hidden destructors. - - * zend_objects.c: - Reorganize this a bit to ensure the object memory is destructed before - showing the error. - - * zend_builtin_functions.c: - Bug #24399: is_subclass_of(): fix memleak, too - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Throughly fix scoping change. Fixes, among other things, bug #24403 - -2003-07-02 Andi Gutmans - - * zend_compile.c - zend_globals.h: - - Nuke CG(in_clone_method) - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Fix for bug #22367. - Heads up - this will break syntactical compatiblity, return($foo) will - not work with functions that return references - return $foo should be - used - instead. It never worked well before, and caused all sorts of odd bugs. - It *might* be possible to support this specifically, albeit unlikely - -2003-07-02 Sterling Hughes - - * zend_execute_API.c: - optimize the case where the object is really a class name, as we don't need - to set EX(object) here. - - * zend_execute_API.c: - Timm Friebe points out that object detection should be done regardless of - the function pointer - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Finally fix property cloning and fix the tests accordingly. - - -2003-07-02 Sterling Hughes - - * zend_builtin_functions.c: - Fix bug #24445 - -2003-07-01 Marcus Boerger - - * zend_objects.c: - Fix __clone(). - - - * tests/bug20240.phpt: - Use both destructor and shutdown - - * zend_execute_API.c: - small bugfix - - * tests/bug24436.php - tests/bug24436.phpt: - Rename test to correct extension - - * zend_execute.c: - __clone might not be defined - - * zend_execute.c: - Fix __clone visibility - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.c: - Fix destructor visibility - -2003-07-01 Derick Rethans - - * tests/bug24436.php: - - Added test for bug #24436 - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - Timm Friebe's patches for code celanup and additional functions. - -2003-07-01 Jani Taskinen - - * tests/.cvsignore - tests/bug21478.phpt - tests/zend2.php - tests/zend2.php.txt: - Missing .cvsignore, broken test, renamed zend2.php -> zend2.php.txt - -2003-07-01 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - more incremental changes. add anything that needs a class factory. - - * zend_reflection_api.c: - all the easy parts of Reflection_Class - -2003-06-30 Shane Caraveo - - * zend_operators.h: - this fixes including this header in a c++ file (vs6) - -2003-06-30 Sterling Hughes - - * zend_compile.c: - nuke "main" as a reserved keyword - -2003-06-30 Andi Gutmans - - * zend.c - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_mm.c - zend_opcode.c - zend_reflection_api.c: - - ZE coding style requires if ( instead of if( - -2003-06-30 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. Remove unused local variables. - -2003-06-30 George Schlossnagle - - * Makefile.am - Zend.dsp - ZendTS.dsp - zend_default_classes.c - zend_reflection_api.c - zend_reflection_api.h: - added support for Reflection_Function, the first part of - the reflection api - -2003-06-30 Sterling Hughes - - * zend_builtin_functions.c: - move the check down a little so it catches all cases - - * zend_builtin_functions.c: - Fix bug #24399 from an excellent test case by edin - -2003-06-30 Zeev Suraski - - * zend_execute.c: - Semantically it's a refcount increase, not a lock... - - * zend_execute.c: - Fix 'global' implementation (fixes, at least, bug #24396 - -2003-06-30 Sterling Hughes - - * zend_operators.c: - revert back the optimization for now. - -2003-06-29 Ilia Alshanetsky - - * zend_object_handlers.c: - Fixed bug #24279 (__get() crash when no value is returned) - -2003-06-29 Sebastian Bergmann - - * ZEND_CHANGES: - Remove namespace references. - -2003-06-29 Sterling Hughes - - * zend_operators.c: - Very simple, but very effective optimization. Provides a signifigant speed - improvement to matches done via '=='. This checks that the lengths of two - strings are equal before performing a memcmp() on them. - -2003-06-23 Zeev Suraski - - * zend_execute.c: - Fix crash :) - -2003-06-23 Stanislav Malyshev - - * zend_execute.c: - FIx leak - -2003-06-22 Zeev Suraski - - * zend_execute.c - zend_language_parser.y: - Fix complex expressions for class names in NEW - - * zend_language_parser.y: - Simplify - -2003-06-21 Marcus Boerger - - * zend_language_parser.y: - WS - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Add final classes - -2003-06-16 Stanislav Malyshev - - * zend_execute.c: - no need to init zval - assignment will init - - * zend_execute.c: - Fix bug #22592 - cascading assignments to string offsets - - * zend_constants.c: - support for self:: and parent:: constants - - * zend_builtin_functions.c: - fix lambda function static vars (related to #17115) - -2003-06-15 Sebastian Bergmann - - * zend_constants.c: - Fix ZTS build. - -2003-06-15 Stanislav Malyshev - - * zend.c: - Fix bug #23279 - exception handler exits after first function call - - * zend_execute_API.c: - No need to duplicate code - zend_get_constant() knows to - handle class constants now - - * zend_execute_API.c: - Fix bug #18872 - Improper handling of class constants used as default - function argument values - - * zend_constants.c: - set ending \0 for string - - * zend_compile.c - zend_constants.c - zend_language_parser.y: - Fix bug #23384 - static class::constant constants should now - work in static & array expressions. - - * zend_execute_API.c: - Fix bug #21800 - initialize opcode handlers in interactive mode - -2003-06-14 Marcus Boerger - - * zend_hash.c: - ecalloc doesn't return NULL - - * zend.c: - Bugfix #24182: va_arg macro error in Zend/zend.c - -2003-06-10 Jani Taskinen - - * zend_multiply.h: - - Missing $Id$ tag - -2003-06-10 James Cox - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - updating license information in the headers. - -2003-06-09 Wez Furlong - - * zend_execute_API.c: - Fix for Bug #23951 - -2003-06-09 Stanislav Malyshev - - * zend_execute.c: - remove NS leftover - -2003-06-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix bogus implicit declarations of properties (squash bug #23671) - -2003-06-09 Stanislav Malyshev - - * zend_API.c - zend_execute_API.c: - Support 'self' and 'parent' in call_user_func() - -2003-06-09 Zeev Suraski - - * zend_execute.c: - Fix indirect reference calls to bogus function names - -2003-06-09 Jani Taskinen - - * zend_builtin_functions.c: - ws - -2003-06-08 Zeev Suraski - - * zend_object_handlers.c: - Fix casing issues in access level checks - - * zend.c - zend_compile.c - zend_compile.h: - Nicer handling of protected/private members in print_r() - - * zend_execute.c: - Fix handling of object property assignments in switch expressions - (bug #23925) - - * zend_builtin_functions.c: - Fix set_error_handler() - -2003-06-06 Sascha Schumann - - * zend_multiply.h: - mfb #24025 fix - -2003-06-04 Stanislav Malyshev - - * zend.c: - fix non-ZTS build - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. Again. - -2003-06-04 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - rm namespace leftovers - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. #Hopefully not a Voodoo Fix[TM]. - -2003-06-02 Sebastian Bergmann - - * zend.c - zend_execute.h: - Leftover. - -2003-06-02 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_object_handlers.c - zend_opcode.c: - MEGA-patch: namespaces are R.I.P. - -2003-06-01 Marcus Boerger - - * tests/zend2.php: - No nested classes - - * tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt: - Add some ZE2 bug tests - - * zend_opcode.c: - Bugfix #23670: implements and extends cause Apache 2 crash - - * zend_constants.c: - Do it correct always - - * zend_compile.h: - Defining it once is enough - -2003-05-31 Marcus Boerger - - * zend.c: - Fix init shutdown - -2003-05-31 Sterling Hughes - - * zend_compile.c - zend_execute.c: - revert the function call caching patch until a new solution is decided - upon. - -2003-05-31 Marcus Boerger - - * zend_constants.c: - Fix constants (noticed by David Brown ) - - * zend_constants.c: - c->name_len already contains the '\0' - -2003-05-30 Stanislav Malyshev - - * zend_execute.c: - fix crash on exceptions when return value of the inside function is used - -2003-05-29 Marcus Boerger - - * zend_compile.c - zend_language_parser.y: - Fix ~ operator in class constants. - - * zend_compile.c - zend_compile.h - zend_operators.c: - Faster interface inheritance & faster inheritance checks - - * zend_language_scanner.l: - CS - -2003-05-29 Wez Furlong - - * zend_compile.c: - Fix Bug #23285 (Potential Stack Overflow in zendlex). - -2003-05-28 Sterling Hughes - - * zend_alloc.c: - no reason to do this at runtime - - * zend_compile.c - zend_execute.c: - Cache function call lookups with loops (store in a temporary variable on - the - result opline). - Assuming lazy concensus on message that GeorgeS sent to the list last week - -2003-05-27 Sterling Hughes - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - Assume lazy consensus regarding the cast_object() patch. *Only* - implemented - from a internals perspective. This callback has been very useful for both - ext/mono and ext/simplexml - -2003-05-26 Marcus Boerger - - * zend_language_scanner.l: - Add pseudo constant __METHOD__ to easily report namespace::class::method. - - -2003-05-23 Marcus Boerger - - * zend_API.h: - Revert to sizeof() - -2003-05-23 Sterling Hughes - - * zend_execute.c - zend_hash.c - zend_operators.c - zend_operators.h: - move HANDLE_NUMERIC() from the hash table implementation upstream to the - places that actually need to use it. - -2003-05-22 Marcus Boerger - - * zend_execute.c: - No need to copy here unless implicit_clone is active (noticed by rob) - -2003-05-21 Marcus Boerger - - * zend_API.c - zend_builtin_functions.c - zend_constants.c - zend_object_handlers.c: - Make use optimized string lowering - - * zend_operators.c - zend_operators.h: - Use same parameter order as strcpy() - - * zend_API.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h: - Make zend_str_tolower_copy() a copy function (like stccpy). - Supply a dup version (like estrdup). - Fix tolower() handling. - -2003-05-21 Jani Taskinen - - * zend_builtin_functions.c: - Fixed bug #23619 (set_error_handler() registered handler not called for - object instances). (Jani, waboring@qualys.com) - -2003-05-21 Sterling Hughes - - * zend_operators.c: - optimize loops. The check only exists for integers because that's the more - common optimization, and you actually lose performance if you check for - a double too (wierd but true). - - * zend_mm.h: - add some logic to detect zend_mm, which is really only useful when thread - safety support is enabled. - - * zend_mm.h: - leave this off until its more ready/stable - php5 actually beats php4.3.* in my benchmarks now - - - * zend_API.c: - use zend_str_tolower_copy() - - * zend_execute.c: - Bottom drawer optimization to avoid this comparison, but this OP is - executed - quite often (all of the fetch_* ops) - -2003-05-20 Sterling Hughes - - * zend_operators.c: - bah humbug, use the pointer based version, which turns out to be an - instruction - faster - - * zend_operators.c: - use pointer arithmetic for the normal zend_str_tolower() - -2003-05-20 Marcus Boerger - - * zend_execute.c: - No need to copy the zval unless __clone() is called - -2003-05-20 Sterling Hughes - - * zend_operators.c: - make this faster and sexier - - * zend_execute.c: - use the new zend_str_tolower_copy() function - - * zend_operators.c: - doesn't need to be register - - * zend_execute_API.c - zend_operators.c - zend_operators.h: - optimize the lookups by avoiding a copy and then another pass - - Naked Dancing Girls should be given to: Myself, Zeev, Marcus, - and George Schlossnagle (in no particular order) - - * zend_API.h - zend_execute_API.c: - add fast_call_user_function() - -2003-05-20 Hartmut Holzgraefe - - * zend_API.h - zend_constants.h - zend_operators.h: - C++ compile fixes - -2003-05-19 Marcus Boerger - - * zend_execute.c: - Fix exception memleak - -2003-05-19 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - fix __clone - -2003-05-12 Marcus Boerger - - * zend_execute_API.c: - One function call is enough - -2003-05-08 Marcus Boerger - - * zend_compile.c: - Inheritance fix - -2003-05-07 Edin Kadribasic - - * zend_compile.c: - Reverting Marcus' incomplete patch which broke the build. - -2003-05-07 Marcus Boerger - - * zend_compile.c: - Inheritance fixes - -2003-05-04 Marcus Boerger - - * zend_API.c: - Fix namespace issue: Only CG is needed here - - * zend_API.c - zend_API.h: - Allow functions in internal namespaces (for example factories) - - * zend_execute.c: - Modify the abstract error message so that it shows up to three methods not - implemented. - - * zend_execute.c: - Fix warnings - - * zend_compile.c: - Don't inherit twice what is needed only once - - * zend.c: - Fix bug #23162 user_error() crashs if > 1024 bytes (Marcus, Moriyoshi) - -2003-05-04 Sterling Hughes - - * zend_default_classes.h: - semicolon - -2003-05-03 Sterling Hughes - - * zend_default_classes.h: - proto - - * zend_default_classes.c: - add an accessor for the default exception - -2003-04-29 Sascha Schumann - - * zend_multiply.h: - Fix the *= operator - - Slightly modified patch by Wez Furlong - -2003-04-25 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) - -2003-04-24 Sascha Schumann - - * zend_alloc.c - zend_alloc.h - zend_multiply.h: - add safe_emalloc - -2003-04-21 Stanislav Malyshev - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - Change get_class() so that it returns qualified names for namespaced - classes. - - *HEADS UP*: get_class_name() handler interface is changed, now it should - allocate the space it returns with emalloc, and the users free it. If - anyone has problems with it or has suggestions how to do it without this - - please tell. - - Also: make function_exists() understand namespaces. - - * zend_execute.c: - make import * fail if such classes or functions already there - -2003-04-20 Sterling Hughes - - * zend_compile.c: - Add check for final properties - -2003-04-20 Stanislav Malyshev - - * zend_execute_API.c: - Check name before '::' so that it would be a namespace in - zend_lookup_ns_class - - * zend_builtin_functions.c: - refine the set_error_handler fix - - * zend_builtin_functions.c: - Fix for bug #21094 (set_error_handler can not accept methods), - by Timm Friebe - -2003-04-19 Sebastian Bergmann - - * zend.c: - Corrected patch by Marcus Börger . - -2003-04-18 Sterling Hughes - - * zend.c - zend_opcode.c: - Patch by Marcus Börger to fix some memleaks - -2003-04-18 Derick Rethans - - * zend.h - zend_extensions.c: - - Revert my symbol fix patch, and merge in Stas' fixes to Zend Engine 1. - - * zend.h: - - MacOSX also prepends the _ before symbols in bundles - -2003-04-17 Sebastian Bergmann - - * zend.c: - Patch by Marcus Börger . - -2003-04-11 Sebastian Bergmann - - * zend_compile.c - zend_compile.h: - Fix warnings. - -2003-04-10 Sterling Hughes - - * zend_compile.c: - satisfy andi's switch fetish ;-) - -2003-04-10 Sebastian Bergmann - - * zend_compile.c: - Fix ZTS build. Fix warning. - - * ZEND_CHANGES: - Document 'const' keyword. - -2003-04-10 Sterling Hughes - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - allow expressions within constants, so the following is possible - - class foo { - const a = 1<<0; - const b = 1<<1; - const c = a | b; - } - - this makes const a compile-time expression. all other operators are - unaffected. - -2003-04-10 Zeev Suraski - - * zend_language_parser.y - zend_language_scanner.l: - Revert Harald's commit - -2003-04-10 George Schlossnagle - - * zend_language_parser.y: - One line fix so that it will compile - -2003-04-09 Harald Radi - - * zend_language_parser.y - zend_language_scanner.l: - removing the *syntactical sugar* again - - -2003-04-08 Andrei Zmievski - - * zend_builtin_functions.c: - Switch some functions to use new zend_lookup_ns_class() methods. This - means that they will accept both simple and fully qualified class names. - - * zend_API.c - zend_API.h: - Rename zend_register_internal_class_in_ns() to a better, less filling, - but with the same great taste zend_register_internal_ns_class(). - - * zend_execute.h - zend_execute_API.c: - Add zend_lookup_ns_class() function. - - * zend_operators.h: - Move memnstr into Zend and make an alias for BC in PHP. - -2003-04-07 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) - -2003-04-07 Sterling Hughes - - * zend_compile.h: - add markers that make this file easy to parse for external sources - -2003-04-04 Andrei Zmievski - - * zend_API.h: - Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring - class methods to avoid name collisions. - -2003-04-04 Stanislav Malyshev - - * zend_API.c - zend_API.h: - Fix namespace issues - -2003-04-03 Andrei Zmievski - - * zend_API.c: - Patch from Timm Friede for when EG(active_namespace) is NULL initially. - - * zend.c - zend_API.c - zend_compile.c: - Initialize all relevant zend_class_entry fields to avoid accidental - crashes. - -2003-04-03 Sebastian Bergmann - - * zend_list.c: - Leftover. - -2003-04-03 Sterling Hughes - - * zend_list.c - zend_list.h: - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - -2003-04-02 Andrei Zmievski - - * zend_API.c - zend_API.h: - - Add zend_register_internal_namespace() API function. - - Add zend_register_internal_class_in_ns() API function. - - * zend_compile.h: - Simplify. - -2003-04-02 Derick Rethans - - * zend_list.c: - - Fix whitespace - -2003-04-02 Sterling Hughes - - * zend_list.c - zend_list.h: - add the ability for curl_multi_info to introspect the handles. - - -2003-04-02 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Implement a different way to catch documentation comments. - - * zend_compile.c - zend_compile.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - Revert portions of the doc comment patch. There should be no parser - errors now. - -2003-04-02 Stanislav Malyshev - - * zend_builtin_functions.c - zend_compile.h - zend_execute.c: - allow class_exists() to work with namespaces too. - add CLASS_IS_NAMESPACE macro - - * zend_builtin_functions.c: - fix typo - - * zend_builtin_functions.c: - fix parameterless get_declared_classes call - -2003-04-01 Andrei Zmievski - - * zend_execute.c: - Stas's patch on zend_execute.c (1.448 -> 1.449) resulted in a bug where - the namespaced member accesses didn't work. This should hopefully - correct it. - - * zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_opcode.c: - Split ZEND_NAMESPACE into user and internal namespaces. Hope this is - okay with engine folks. - -2003-04-01 Stanislav Malyshev - - * zend_builtin_functions.c: - improve namespace name hanfling - - * zend_builtin_functions.c: - fix get_declared_classes() - - * zend_language_parser.y - zend_language_scanner.l: - Add __NAMESPACE__ auto-constant. - - * zend_builtin_functions.c: - make get_declared_classes() work with namespaces (based on Tal Peer's - patch) - -2003-03-31 Andrei Zmievski - - * zend.h - zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Multi-purpose patch: - - The fields of zend_namespace were not completely initialized which - led to a variety of problems. - - The occurrence of class/interface/namespace definition is now - captured. - - Functions/classes/interfaces/namespaces can be preceded by doc - comments which are stored for use by extensions. - -2003-03-31 Stanislav Malyshev - - * zend.c: - Use strncpy instead of sprintf - -2003-03-30 Andrei Zmievski - - * zend_language_parser.y: - Since zend_do_begin_class_member_function_call assumes the previous - opcode is FETCH_CONSTANT, swap the calls around. - -2003-03-30 Sebastian Bergmann - - * zend_execute.c: - ZTS fix. - -2003-03-30 Stanislav Malyshev - - * zend.c: - Try to report class name of the exception - - * zend_execute.c: - Fix namespace switch - -2003-03-29 Zeev Suraski - - * zend_compile.c: - Add missing initialization - - * zend_compile.c: - Fix crash - - * zend_API.c - zend_compile.c - zend_compile.h: - Initial support for enforcing prototype of abstract/interface method - implementations - -2003-03-29 Sterling Hughes - - * zend.c: - remove unused variable - -2003-03-27 Stanislav Malyshev - - * zend_execute.c: - fix fetch_class buglet - -2003-03-26 Stanislav Malyshev - - * zend_execute.c - zend_language_parser.y: - Un-nest namespaces - now namespace X { namespace Y {} } is a parse error - Also refine namespaced includes - -2003-03-26 Ilia Alshanetsky - - * zend_compile.c: - Fixed bug #22900 (declaration of namespaces with same name results in - leaks). - -2003-03-26 Sebastian Bergmann - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - Eliminate TSRMLS_FETCH() calls in destroy_op_array() and - zend_get_class_entry(). - - * zend_API.c - zend_object_handlers.c - zend_objects.c - zend_objects.h: - Eliminate TSRMLS_FETCH() calls in zend_objects_new() and - zend_objects_get_address(). - -2003-03-25 Andi Gutmans - - * zend_compile.c: - - Temporarily fix problem with inheriting from an internal class. This - might - - need some rework in the future (thanks to Marcus) - -2003-03-24 Stanislav Malyshev - - * zend_execute.c: - Fix {include|require}_once error message - if open - fails, don't use tream, use original name. - -2003-03-23 Andi Gutmans - - * zend.c: - - Fix win32 build - -2003-03-23 Stanislav Malyshev - - * zend.c: - resore namespace on shutdown - since some functions use - EG() and CG() pointers - -2003-03-23 Sebastian Bergmann - - * zend_default_classes.c: - ZTS fix. - -2003-03-23 Zeev Suraski - - * zend_compile.c: - Another fix for implicit public, perhaps it was not such a good idea :I - -2003-03-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp - zend_default_classes.c: - Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with - ZendTS.dsp. ZTS fixes. - -2003-03-23 Sterling Hughes - - * zend_default_classes.h: - DEFAULT_CLASSES_H not DEFAULT_INTERFACES_H - - * Makefile.am - zend.c - zend_default_classes.c - zend_default_classes.h: - add a standard Exception class. - -2003-03-22 Shane Caraveo - - * zend_compile.h: - export functions needed by cli - - * zend_language_scanner.l: - fix crash in win32 debug build - -2003-03-20 Stanislav Malyshev - - * Zend.m4: - Add stdlib.h too - it is needed fot strto{ld} - -2003-03-19 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - - Keep track of starting/ending line numbers for user functions. - - Store last parsed doc comment in a compiler global for future use. - - * zend_API.c: - Lowercase the function name when used as key in the function name. The - original case is still preserved in zend_function structure. - -2003-03-18 Zeev Suraski - - * zend_compile.c - zend_object_handlers.c: - - Fix situation where a derived class declares a public (or implicit - public) - with the same name as a private in the parent - - Optimize 'static binding' of private properties a bit - -2003-03-18 Stig Bakken - - * RFCs/002.txt: - - email address change - -2003-03-17 Stanislav Malyshev - - * zend_extensions.c: - MFZE1 - -2003-03-17 Jani Taskinen - - * Makefile.am: - Added missing zend_mm.c file and renamed zend_object_API.c -> - zend_objects_API.c - -2003-03-13 Andrei Zmievski - - * zend_API.c: - Fix warning in va_start(). - -2003-03-12 Andrei Zmievski - - * zend_API.c: - Initialize the namespace when registering functions. - -2003-03-12 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in the implicit public declaration - -2003-03-11 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix handling of ::func() - -2003-03-10 Zeev Suraski - - * zend_compile.c: - Clean redundant code - -2003-03-10 Jani Taskinen - - * zend_compile.c: - Fixed some leaks. Patch by Moriyoshi - -2003-03-10 Shane Caraveo - - * zend_config.w32.h: - fix isinf for win32 - -2003-03-09 Zeev Suraski - - * zend_language_parser.y: - Optimize - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix handling of ::foo - - * zend_compile.c: - Cleanup - -2003-03-09 Andi Gutmans - - * zend_language_scanner.l: - - Nuke junk - -2003-03-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix parsing rules of namespaces/classes - - * zend_language_parser.y: - Add ability to use ::interface_name in implements - - * zend_compile.c: - Fix :: handling - -2003-03-07 Sebastian Bergmann - - * ZEND_CHANGES: - Dedicated to Greg Beaver . - - * ZEND_CHANGES: - Document 'final'. - - * ZEND_CHANGES: - Fix class type hints example. - - * ZEND_CHANGES: - Update 'abstract' section. - -2003-03-07 Jani Taskinen - - * zend_ini.c - zend_ini.h: - Renamed OnUpdateInt -> OnUpdateLong to prevent further misunderstandings. - - * zend_execute.c: - Better fix for the memleaks (bug 19943) by Moriyoshi - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix warnings - - * zend_execute.c: - Fix error message - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Require abstract classes to be explicitly declared 'abstract', in order to - avoid making developers traverse the entire class/interface hierarchy - before they can figure out whether a class is instantiable - (ok, so it makes sense :) - -2003-03-06 Sebastian Bergmann - - * ZEND_CHANGES: - -german+english+. - - * ZEND_CHANGES: - D some TBDs - -2003-03-06 Jani Taskinen - - * zend_execute.c: - Fixed bug #19943 (the memleaks) - -2003-03-06 Ilia Alshanetsky - - * zend_highlight.c: - More cleanup of the zend_strip() function. - No longer strip __LINE__, since while it may become useless it could break - code where __LINE__ is passed as a function parameter. - - * zend_highlight.c: - Fixed in zend_strip() that corrupted heredoc. - Optimized the writing routine by moving from putchar() to fwrite(). - Changed hardcoded opcode # to it's defined name. - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Change opcode name - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Add class type hints - -2003-03-05 Zeev Suraski - - * zend_compile.c: - Fix auto globals - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Implement $obj::static_func() - - * zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c - zend_operators.c - zend_operators.h: - Add support for interfaces - -2003-03-04 Zeev Suraski - - * zend_compile.c - zend_language_parser.y: - Remove legacy code - - * zend_compile.c: - Remove redundant code - -2003-03-03 Harald Radi - - * zend_API.c: - add missing strtolower - - * zend_API.c - zend_API.h: - commiting zend_disable_class patch for George: - disabled classes will be replaced by dummy classes - that print a warning upon instanciation - -2003-03-02 Zeev Suraski - - * zend_execute_API.c: - Fix destructors some more - - * zend_compile.c - zend_compile.h: - Improve infrastructure - - * zend.c - zend_compile.c - zend_compile.h: - Add infrastructure for JIT initialization of auto globals - -2003-03-01 Zeev Suraski - - * zend_compile.c: - Fix mem leak - -2003-03-01 Andi Gutmans - - * zend_compile.c: - - Make __construct() have higher priority than class name functions - - for constructors. - - Fix problem with the engine allowing final/abstract for the same method. - - Both patches are by Marcus Börger. - -2003-02-27 Rasmus Lerdorf - - * zend_ini_scanner.l: - MFB: We know ini file scanning will never be interactive, so speed it up a - bit. Need a dynamic check for the language scanner. - -2003-02-26 Sebastian Bergmann - - * ZEND_CHANGES: - Syntactic sugar is sweet. - -2003-02-25 Zeev Suraski - - * zend_compile.c: - Get the bits right - final/private fix - -2003-02-25 Jani Taskinen - - * acconfig.h: - Do not redefine zend_isnan if it is already defined. - - * Zend.m4: - - Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). - -2003-02-24 Stanislav Malyshev - - * zend_compile.c: - fix exception handling - -2003-02-24 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l: - Add 'final' - -2003-02-24 Sebastian Bergmann - - * ZEND_CHANGES: - Remove obsolete not on redeclaring protected members. - - * ZEND_CHANGES: - Leftover. - - * ZEND_CHANGES: - Initial documentation of namespace {}. - -2003-02-23 Zeev Suraski - - * zend_compile.c: - Move abstract inheritance logic to the right spot - - * zend_compile.c: - Fixed abstract handling in inheritence - -2003-02-20 Wez Furlong - - * zend_stream.c: - -cough* - Fix another stupid mistake. - -2003-02-20 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Allow namespaces to have a number of parts. I.e., now you can do: - namespace foo { - function abc() {} - } - ... - namespace foo { - functio def() {} - } - -2003-02-19 Wez Furlong - - * zend_stream.c: - Fix stupid mistake that only affected interactive mode. - -2003-02-18 Rasmus Lerdorf - - * zend_stream.c: - fileno() needs a FILE * here, and at least on FreeBSD with gcc-2.95.3 - it is unable to figure out that this is indeed a FILE * and hence it - won't compile without this cast. - -2003-02-18 Zeev Suraski - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_scanner.l - zend_opcode.c: - Avoid using a C++ reserved word - -2003-02-18 Wez Furlong - - * ZendTS.dsp - flex.skl: - Fixup build for win32 - - * Makefile.am - flex.skl - zend.c - zend.h - zend_compile.h - zend_execute.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l - zend_stream.c - zend_stream.h: - Implement simple stream support in the ZE scanners. - -2003-02-17 Zeev Suraski - - * zend_language_parser.y: - Whitespace & minor renames - - * zend_language_parser.y: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve handling of static member variables - - * zend_config.w32.h - zend_ini_parser.y: - Improve Win32 build performance - -2003-02-16 Zeev Suraski - - * zend_execute.c: - Fix complex cases of self-assignments (bugs #21600, #22231) - - * zend_execute.c: - Make EG(This) and EG(scope) available to internal methods - - * zend_execute.c: - Revert patches - they weren't ready yet! - - * zend.c: - Fix initialization - -2003-02-16 Georg Richter - - * zend_execute.c: - fixed compiler warning - - * zend_execute.c: - tested patch from Zeev (fixes oo-bug in ext/mysqli) - -2003-02-16 Stanislav Malyshev - - * zend_compile.c - zend_language_parser.y: - add support for ::foo syntax meaning "global one" - - * zend_compile.c: - remove debug prints - -2003-02-16 Sebastian Bergmann - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - ZTS fixes - -2003-02-16 Stanislav Malyshev - - * zend_object_handlers.c: - namespace patch - static variable access - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Namespace patch. Big changes: - 1. Nested classes are gone. - 2. New syntax for namespaces: - namespace foo { - class X { ... } - function bar { ... } - var x = 1; - const ZZ = 2; - } - 3. Namespaced symbol access: $x = new foo::X; - etc. - For now, namespaces are case insensitive, just like classes. - Also, there can be no global class and namespace with the same name - (to avoid ambiguities in :: resolution). - -2003-02-15 Ilia Alshanetsky - - * zend_ini_scanner.l: - Added feature #19645 (ini parser can now handle quoted multi-line values). - -2003-02-14 Thies C. Arntzen - - * zend_execute_API.c: - init current_execute_data befor we start executing - - * Makefile.am: - ups - - * Makefile.am: - add really nice dump_bt function for debugging in gdb - -2003-02-13 Zeev Suraski - - * zend_object_handlers.c: - Fix error handling in illegal property access - -2003-02-13 Harald Radi - - * zend_language_scanner.l: - MFB PHP_4_3 - -2003-02-12 Ilia Alshanetsky - - * zend_API.c - zend_API.h: - Removed zend_get_module(), this function is not used by anything and more - importantly. it does not work. It tries to find data based on numeric keys - in hash table using string keys. - -2003-02-12 Zeev Suraski - - * zend_compile.c: - Fix declaration of class members that don't have an explicit access - modifier - -2003-02-11 Zeev Suraski - - * zend_compile.c: - Fix require() handling - that's an old bug! - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Improve parser handling of 'abstract' - -2003-02-10 Zeev Suraski - - * zend_compile.c: - Fix zend_initialize_class_data() - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h: - Centralize class initialization - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo - is not explicitly declared - - Forbid multiple declaration of the same variable - - * zend_execute.c: - whitespace - - * zend_API.c - zend_compile.c: - Add missing destructors - -2003-02-10 Stanislav Malyshev - - * zend_object_handlers.c: - update static constants too - -2003-02-10 Zeev Suraski - - * zend_builtin_functions.c: - Fix get_parent_class() - - * zend_object_handlers.c: - Restore missing check - - * zend_execute.c - zend_execute_API.c: - Add ability to reference self:: and parent:: in constant initializers - (bug #21849) - - * zend_execute.c: - Remove redundant code - -2003-02-09 Zeev Suraski - - * zend_execute.c: - Fix the array() problem (and probably some other problems too) - -2003-02-08 Georg Richter - - * zend_API.c - zend_API.h: - fixed zend_parse_method_param - -2003-02-08 Sebastian Bergmann - - * zend_builtin_functions.c: - zend_config.h (and its Win32 version) is already included by zend.h - -2003-02-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - The string.h is already available through zend.h, so the manual inclusion - is not necessary. - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Added a check to ensure that string.h is available before trying to use it. - - Thanks Andi. - - * zend_builtin_functions.c: - Added missing header. - -2003-02-07 Zeev Suraski - - * zend_globals.h - zend_object_handlers.c: - Improve PPP handling of properties - - * zend_config.w32.h: - Better fix - - * zend_config.w32.h: - Fix Windows build - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #15734 (Added an optional parameter to get_defined_constants(), - which if passed, will include information regarding who created the - constant). - -2003-02-06 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in - Zend Engine functions, if "zend" is specified as the module name). - Made get_extension_funcs() on failure. - -2003-02-06 Zeev Suraski - - * zend_compile.c: - Fix the 2nd buglet in the error message :) - - * zend_object_handlers.c: - Fix check - - * zend_hash.c - zend_hash.h: - Fix prototype (may have caused stack corruption) - -2003-02-05 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - - read_property cleanup - - Implement unset/isset/empty for PPP - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_opcode.c: - Rework static class properties - now supports access restrictions - - * zend_hash.c - zend_hash.h: - Add quick_exists() - - * zend_object_handlers.c: - Add PPP support for arrays - - * zend_compile.c: - Fix buglet in error message - -2003-02-04 Zeev Suraski - - * zend_object_handlers.c: - Missing update - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_object_handlers.c - zend_opcode.c - zend_ts_hash.c - zend_ts_hash.h: - Reimplement PPP properties - -2003-02-03 Sebastian Bergmann - - * zend_API.h: - Build fix. - -2003-02-02 Harald Radi - - * zend_API.c - zend_API.h: - extend the parameter parsing API by two functions - for parsing method parameters with automatic - detection if the function was called as such or as - a class method (with a valid this ptr). - if called as a function the first parameter has to be - the object it is operating on, if called as a method - this is used. - - -2003-02-02 Zeev Suraski - - * zend.h - zend_operators.h: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Core rearrangements - move Zend Objects specific code to their - specific implementation file - -2003-02-02 Andi Gutmans - - * zend_compile.c: - - Fix warning - -2003-02-01 Sebastian Bergmann - - * zend_ini_scanner.l - zend_language_scanner.l: - Fix build. - -2003-02-01 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Added some missing CVS $Id$ tags, headers and footers. - -2003-01-30 Ilia Alshanetsky - - * zend_operators.c: - Fixed compiler warning regarding signed/unsigned int comparisons. - -2003-01-30 Harald Radi - - * zend_ts_hash.c - zend_ts_hash.h: - fix non-zts build for wez - -2003-01-30 Ilia Alshanetsky - - * zend_execute_API.c: - Fix ZTS build. - -2003-01-29 Stanislav Malyshev - - * zend_compile.h - zend_execute_API.c - zend_opcode.c: - Add additional stage to post-session cleanup. - We need separate cleanup stage because of the following problem: - Suppose we destroy class X, which destroys function table, - and in function table we have function foo() that has static $bar. Now if - object of class X was assigned to $bar, its destructor will be called and - will - fail since X's function table is in mid-destruction. - So we want first of all to clean up all data and then move to tables - destruction. - Note that only run-time accessed data need to be cleaned up, pre-defined - data can not contain objects and thus are not probelmatic. - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Code rearrangements - -2003-01-29 Stanislav Malyshev - - * zend_execute_API.c: - Fix object destructors: - zend_objects_store_call_destructors is not used anymore, we rely on - symbol tables cleaners to destroy all objects. - - * zend_objects_API.c: - extra safety - - * zend_compile.c: - fix memory leak - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix assignments to $this. - Fixes the 'make install' problem reported on php-dev - -2003-01-28 Zeev Suraski - - * zend_compile.c: - Fix a ticks related crash - - * (PHP_5_0_dev_before_13561_fix) - zend_execute.c: - Allow methods in parent classes to call protected methods in derived - classes - -2003-01-27 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c: - Replace MAKE_VAR opcode with special 'data' opcode - This opcode is not executeable but only holds data for opcodes - that need more than two arguments (presently only ASSIGN_OBJ and the ilk - but - in the future also ASSIGN_DIM) - -2003-01-26 Sascha Schumann - - * zend_API.c: - Replace snprintf() call using zend_error's capabilities - -2003-01-23 Zeev Suraski - - * zend_execute.c: - Let the scope propagate to internal functions - -2003-01-23 Jani Taskinen - - * zend_execute_API.c: - Fixed bug: #14542, register_shutdown_function() timeout problem - -2003-01-22 Stanislav Malyshev - - * OBJECTS2_HOWTO: - some small refinements for get_class_* - -2003-01-22 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #21814 (Allow booleans to be used as array keys). - -2003-01-21 Sterling Hughes - - * zend_objects_API.c: - fix by phanto to the cloning - -2003-01-19 Zeev Suraski - - * Zend.m4: - relabel - -2003-01-19 Stanislav Malyshev - - * zend_compile.c: - Restore for now old statics behaviour (so that indirect $$var references - would work again). Comprehensive fix will follow later. - -2003-01-19 Harald Radi - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: - ini patch to allow 'entry[] = value' entries - -2003-01-17 Harald Radi - - * zend_objects.c - zend_objects.h: - export zend_objects_destroy_object() - static inline was meaningless anyways as the function - was only used as a callback handler and was never - called directly - - * zend_objects_API.c - zend_objects_API.h: - make std_object_handlers struct available for shared modules - -2003-01-16 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #20933 (isset/empty didn't work when used on string offsets). - -2003-01-15 Andi Gutmans - - * zend_compile.c: - - Revert int -> unsigned int change for str.len - -2003-01-15 Sascha Schumann - - * zend.h: - Revert commit which turned the lengths of strings into zend_uint. - -2003-01-14 Andi Gutmans - - * ZEND_CHANGES - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Change "is" to "instanceof" as it explains better what the operator - means. - - "is_a" was also appropriate but ugly. - -2003-01-14 Stanislav Malyshev - - * zend_API.c: - fix memory leaks and key size - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-14 Stanislav Malyshev - - * zend_compile.c: - fix warning - - * zend_API.c - zend_API.h: - Make add_property_ functions work via write_property handler - - * zend.c - zend_object_handlers.c: - ws - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - Reverting previous patch. - -2003-01-13 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-13 Andi Gutmans - - * zend_objects_API.c: - - Don't check if the handle is bogus. We should crash. - -2003-01-12 Harald Radi - - * zend_modules.h: - fix wrong dereferenciation - -2003-01-12 Stanislav Malyshev - - * zend_compile.c: - fix inheritance - - * zend_API.h: - Remove handle_property from here too - - * zend.c - zend.h - zend_compile.c: - RIP handle_* functions. ZE2 will use __ handlers instead. - - * zend_object_handlers.c: - Move Z_OBJ_P here. - - * zend_operators.h: - Remove Z_OBJ - it's internal to Zend objects, no generic function except - those in zend_object_handlers.c should use it. - Add Z_OBJ_HANDLER macro for easy access to handlers - -2003-01-12 Sebastian Bergmann - - * zend.c - zend.h - zend_builtin_functions.c: - ZTS fixes. - -2003-01-12 Stanislav Malyshev - - * zend_object_handlers.c: - add get_class_name handler - - * zend.c: - Use generic handlers instead of Z_OBJ - -2003-01-12 Harald Radi - - * zend_modules.h: - - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - partially revert previous commit and - change zend_modules.h to include - a forward declaration to zend_ini_entry - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - added zend_ini_entry to zend_modules_entry as - discussed with zeev - - * zend_builtin_functions.c: - fix 'use of uninitialized variable' warning - -2003-01-12 Stanislav Malyshev - - * zend_objects_API.c: - validate handle - -2003-01-12 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_ini.h - zend_variables.c: - Implemented compatibility mode - To enable - zend2.implicit_clone = on in php.ini or using ini_set() - -2003-01-11 Andi Gutmans - - * zend_execute.c: - - Fix typo and whitespace - -2003-01-11 Derick Rethans - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c: - - Ported the zend_execute_internal hook to ZendEngine2. - -2003-01-11 Harald Radi - - * zend_ts_hash.c: - freed reader twice instead of writer and reader - -2003-01-10 Ilia Alshanetsky - - * zend_alloc.c: - MFZE2 - -2003-01-10 Andrei Zmievski - - * zend_API.c: - Automatically register constructor, destructor, and clone function when - class methods are registered. - -2003-01-09 Zeev Suraski - - * zend_compile.c: - Found some more occurences of that elusive bug... - - * zend_compile.c: - Fix one lousy, annoying lurking bug (memory corruption) - Sebastian - try coWiki again please... - - * zend_API.h: - Unify and make it easy to add code into the broken-string error handler - - * zend_language_parser.y: - Fix writability checks - - * zend.c: - Fix leak - -2003-01-08 James Cox - - * zend.h: - cvs is dev not alpha. - -2003-01-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFZE2 - -2003-01-05 Zeev Suraski - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - MFZE1 - lineno fix - -2003-01-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix incorrect linkage of access-levels, when using private methods - -2003-01-01 Zeev Suraski - - * zend_API.c - zend_operators.h: - Win32 build fix - -2003-01-01 Stanislav Malyshev - - * zend_operators.h: - use handler for Z_OBJPROP - -2003-01-01 Zeev Suraski - - * zend_API.c: - Fix Wez's problem - -2002-12-31 Sebastian Bergmann - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - Bump year. - -2002-12-31 Stanislav Malyshev - - * zend_object_handlers.h: - fix level of indirection - -2002-12-30 Andrei Zmievski - - * zend_execute_API.c: - Adjust the error message. - -2002-12-30 Stanislav Malyshev - - * zend_object_handlers.h: - Oops, fix it indeed - - * zend_object_handlers.h: - Better check - -2002-12-26 Andrei Zmievski - - * zend_compile.c: - do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or - FAILURE. - -2002-12-14 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE2 - -2002-12-10 Zeev Suraski - - * zend_compile.c: - Fix check to allow for static+access level modifiers - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Allow variables to have both 'static' modifier and an access level. - NOTE: This only works at the syntax level right now (parser). It - doesn't actually work as of yet - all statics are considered - public for now - - Prevent users from putting more restrictions on methods in derived - classes - (i.e., you cannot make a public method private in a derived class, etc.) - -2002-12-09 Andi Gutmans - - * zend_mm.c: - - Fix a bug which I just introduced. - - * zend_mm.c: - - Fix typo - - * zend_mm.c: - - Improvements - - * zend_mm.c - zend_mm.h: - - First attempt to improve memory manager during realloc()'s - -2002-12-08 Zeev Suraski - - * zend_compile.c: - Remove comment - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Treat the absence of an access type just as if 'public' was supplied - - * zend_compile.c: - Simplify/fix inheritance checks - - * zend_execute.c: - Support private/protected constructors - -2002-12-07 Sebastian Bergmann - - * ZEND_CHANGES: - Update. - -2002-12-07 Zeev Suraski - - * zend_execute.c: - Fix error messages - - * zend_language_parser.y - zend_language_scanner.l: - Remove unintentional code - -2002-12-07 Andi Gutmans - - * zend_compile.c: - - Dissallow using parent, self and main as class names - -2002-12-06 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_hash.h - zend_language_parser.y - zend_language_scanner.l: - - Implement public/protected/private methods. - - Prevent instantiation of classes with abstract methods. - Based in part on Marcus's patch. - -2002-12-01 Andi Gutmans - - * zend_alloc.c: - - Allow enabling of memory cache with zend_mm - - * zend.c - zend.c - zend.h - zend.h - zend_builtin_functions.c - zend_builtin_functions.c: - - MFZE1 - - * zend.c - zend.h - zend_builtin_functions.c: - - Revert as the patch doesn't compile - - * zend.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_indent.c - zend_object_handlers.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_variables.c: - h WHitespace - - * zend.c: - - Initialize constants_updated (by Marcus) - - * zend_builtin_functions.c: - - Nuke use of deprecated macro - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - FN_IS_STATIC -> FN_STATIC - - * zend.c: - - Fix crash - - * zend_compile.c - zend_compile.h: - - My personal cleanups - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_language_parser.y - zend_object_handlers.c: - - Commit Marcus' cleanup of abstract and static inheritance and improve - - error messages - -2002-11-22 Derick Rethans - - * zend_API.c: - - Initialize all functions to non-static (patch by Marcus Börger - . - -2002-11-22 Sebastian Bergmann - - * zend_execute.c: - Show class name as well. Patch by Marcus Börger. - - * zend_execute.c: - Show the name of the abstract method in the error. - - * zend_compile.h: - Fix prototype. - -2002-11-20 Derick Rethans - - * zend_builtin_functions.c: - - MFZE1: Disable leak() and crash() when not using debug mode - -2002-11-20 Andi Gutmans - - * ZEND_CHANGES: - - Add abstract methods - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l: - - Fix build (thanks Marcus) - - Implement abstract methods, syntax: - - abstract function foo($vars); - - I don't see any reason why modifiers such as static/public need to be - - used with abstract. PHP is weakly typed and there would be no meaning to - - this anyway. People who want a strictly typed compiled language are - - looking in the wrong place. - -2002-11-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: - MFZE1 - error_reporting fix - -2002-11-18 Andi Gutmans - - * zend_language_scanner.l: - - MFZE1 - -2002-11-17 Stanislav Malyshev - - * zend_execute.c: - fix the leak - -2002-11-16 Andi Gutmans - - * zend_language_scanner.l - zend_language_scanner.l: - - MFZE1 - - * Zend.m4 - configure.in: - - MFZE1 - - * zend_hash.c: - - Commit fix for bug #19566 (I think it's by Marcus :) - -2002-11-14 Andrei Zmievski - - * zend_llist.h: - MFZE1 - -2002-11-13 Stanislav Malyshev - - * zend_execute.c: - semi-fix string offsets crash - now it doesn't crash, but still leaks - - * zend_object_handlers.c: - fix static - -2002-11-11 Andi Gutmans - - * ZEND_CHANGES: - - Update with statics - -2002-11-11 Sebastian Bergmann - - * zend_execute.c: - Fugbix typo. - -2002-11-11 Ilia Alshanetsky - - * zend.h: - MFZE1 - -2002-11-10 Andi Gutmans - - * zend_compile.c: - - MFZE1 - -2002-11-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - fix statics - make it behave like $this (fetch type "static") - Side effect: indirect references to statics won't work. - -2002-11-06 Sebastian Bergmann - - * zend_execute.c: - Fix ZTS build. - -2002-11-06 Stanislav Malyshev - - * zend_execute.c: - fix zend_assign_to_object_op - -2002-11-05 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 - -2002-11-05 Andi Gutmans - - * zend_compile.h: - - Shift around zend_op members - - * ZEND_CHANGES: - - A couple of updates - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Add support for static methods. Basically methods which are defined as - - static don't have $this. That's the whole difference. - - * tests/zend2.php: - - $clone -> $that - - * zend_execute_API.c: - - Fix bug introduced with type change of free_op1/2 - - * zend_language_parser.y - zend_language_scanner.l: - - ATTENTION: Finally nuke old_function and cfunction. I think it is time - - to get rid of these BC notations. This is from the days of the move from - - PHP/FI 2 -> PHP 3 - -2002-11-05 Ilia Alshanetsky - - * zend_hash.c: - Revert of previous patch. - -2002-11-05 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Change the automatically created variable $clone in __clone() to - - $that as discussed at the PHP Conference. If there are any objections - - alternative names please let me know. The reason for changing it from - - $clone is because $clone sounds as if it's the newly cloned object and - - not the old one. - -2002-11-05 Stanislav Malyshev - - * zend_compile.c - zend_compile.h: - avoid using 'class' in exported functions - it annoys c++ - -2002-11-05 Stig Bakken - - * zend.c: - Fixed some special cases that were crashing for the exception default - handler. - -2002-11-04 Ilia Alshanetsky - - * zend_compile.c: - Silence compiler warnings. - - * zend_hash.c: - If ordered is not set a random compiler assigned value of *p2 would be - used, - this patch fixes the problem by initializing *p2 to NULL. - - * zend_operators.c: - Silence compile warning, ctype.h is needed for tolower() function. - - * zend_language_scanner.l: - MFZE1 - -2002-11-02 Derick Rethans - - * zend_language_scanner.l: - - Fix segfault when __CLASS__ was used outside a class definition - - * zend.c: - - MFZE1 - -2002-11-02 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 (20214). - -2002-11-01 Andi Gutmans - - * zend_execute.c: - Fix unset($this->foo) - -2002-10-24 Andi Gutmans - - * zend_execute.c - zend_opcode.c: - Also tune jmpz_ex - - * zend_execute.c - zend_opcode.c - zend_compile.h: - - Improve performance of part of the jmps. More to follow. - -2002-10-23 Andi Gutmans - - * zend_execute.c - zend_compile.c: - - This might improve performance. Commiting it so that I can check it on - - Linux - - * zend_execute.c: - - Make Ts access a macro. I need this for my next patch which should - - improve performance but not sure yet if it will. - -2002-10-22 Andi Gutmans - - * zend_execute.c: - Nuke unused get_incdec_op() - - Nuke old comment - - * zend_compile.h - zend_execute.c - zend_globals.h: - Improve overall engine performance - - * zend_execute.c: - Fix bug reported by Daniel T. Gorski - -2002-10-21 Thies C. Arntzen - - * zend_builtin_functions.c: MFZE1 - -2002-10-20 Stanislav Malyshev - - * zend_object_handlers.c: looks like this message should go - - * zend_compile.c: Fix private handling - -2002-10-20 Sebastian Bergmann - - * zend_highlight.c - zend_highlight.h: Sync zend_html_puts parameter list with Zend Engine 1. - -2002-10-19 Andi Gutmans - - * zend_compile.h: - Fix compile warning. - - * zend_opcode.c - zend_compile.h - zend_execute.c: - Improve opcode dispatching - -2002-10-18 Andi Gutmans - - * zend.c - zend_compile.c - zend_execute.c: - - Change opcode dispatch mechanism to use a function per opcode and use - - a lookup table using the opcode # to call the correct function. - - Still have lots of tuning to do. - - * zend_execute.c: - Cleanup - -2002-10-16 Sebastian Bergmann - - * zend_execute.c: Fix ZTS build. - -2002-10-16 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: Fix class static members: now the following code works: - - and returns "Hello" (class statics are not copied anymore, but looked up in - runtime) - - * zend_compile.c - zend_compile.h - zend_execute.c: Fix and generalize $this handling. - ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be - used instead as the sign that it's a fetch from $this - -2002-10-14 Ilia Alshanetsky - - * zend_ini_parser.y - zend_ini_scanner.l - zend_globals.h: MFZE1 - -2002-10-14 Andi Gutmans - - * zend_execute.c - zend_language_parser.y: - Support new classname::$class_name, e.g.: - hello; - ?> - -2002-10-13 Ilia Alshanetsky - - * zend_extensions.h: Increased the API number. (re: floats patch) - -2002-10-12 Ilia Alshanetsky - - * zend_operators.c - zend_operators.h - zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (floats & locale issue) - -2002-10-10 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-10-10 Stanislav Malyshev - - * zend_object_handlers.c: add comment - - * zend_object_handlers.c: fix memory leaks - -2002-10-09 Stanislav Malyshev - - * zend_object_handlers.c: Fix object write handler behaviour: - * If this value is already set to given value, don't try to set it again. - * If we have reference, we should not move it. - * If we are assigning referenced variable, we should separate it. - -2002-10-09 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 zend_str_tolower issue. - -2002-10-07 Andi Gutmans - - * tests/zend2.php: - Fix test - - * zend_execute.c: - - Require $this-> when calling a methods. This whole automatic lookup - - first in the class and then in the global scope is confusing, slow and - - not quite BC compatible. - - * zend.c - zend_compile.c - zend_globals.h: - - Allow access to private/protected variables of $clone inside the __clone() - - method - -2002-10-06 Andi Gutmans - - * zend_execute.c: - Fix problem with unsetting object members. - -2002-10-01 Andi Gutmans - - * zend_language_parser.y: - - Fix problem when crashing on illegal tokens in class name during class - - definition. - -2002-09-30 Derick Rethans - - * ZEND_CHANGES: - No tabs :) - -2002-09-28 Derick Rethans - - * zend_builtin_functions.c: - Fix for defines... - - * zend_builtin_functions.c: - Fix build in non-ZTS mode - -2002-09-26 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 - -2002-09-25 Stanislav Malyshev - - * zend_extensions.h: - Propmote API NO year, so that it will never be the same as ZE1 API NO - -2002-09-24 Andi Gutmans - - * zend_compile.c: - Fix leak - - * zend_language_parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Megapatch to try and support inheritance from sub-classes. Things might - - be *very* buggy now so don't get too upset if that happens. - - I still need to improve some stuff but it's a good step (hopefully). - -2002-09-23 Andi Gutmans - - * zend_globals.h - zend_ini.c - zend_language_parser.y: - MFZE1. - -2002-09-21 Andi Gutmans - - * zend_extensions.h: - Someone screwed this up. - -2002-09-19 Derick Rethans - - * zend_ini.c: - Make Colin happy - -2002-09-19 Zeev Suraski - - * zend.c - zend.h - zend_execute_API.c: MFZE1 - connection_status() fix - - * zend.c: Fix non ZTS build - - * zend.c: Fix that obscure crash in Debug_TS mode - -2002-09-18 Zeev Suraski - - * zend.c: - Fix the thread-safe initialization of the ZE2. This should solve some - sporadic crashes, as well as the problem with the built-in constants. - - * zend_constants.c: Remove dead code - - * zend_builtin_functions.c: Add useful debugging function - -2002-09-17 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add tracking for hashtable allocation - - * zend.c: ZE2 fix - - * zend_compile.c: whitespace - - * zend.c - zend.h: MFZE1 - threading fix - -2002-09-16 Andrei Zmievski - - * zend_API.h - zend_builtin_functions.c - zend_API.c - zend_execute_API.c: MFZE1 - -2002-09-15 Ilia Alshanetsky - - * zend_highlight.c: Make zend actually strip comments. Bug #18151 - - * zend.c: - Make zend return a proper exit error code when it encounters a parse error. - -2002-09-15 Andi Gutmans - - * zend_compile.c: - - Hopefully fix problem with __autoload not working well with inherited classes. - - There might still be some weird situations I haven't thought of. - - * zend_list.c - zend_execute.c: - WS fix - "while (" instead of "while(" - - * zend_execute_API.c - zend_ini.c - zend_list.c - zend_object_handlers.c - zend_objects_API.c - zend_operators.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - WS - Always use "if (" and not "if(" - - * zend_execute_API.c: - WS - -2002-09-10 Stanislav Malyshev - - * zend_execute_API.c - zend_variables.c: MFZE1 - -2002-09-09 Stanislav Malyshev - - * zend_object_handlers.c: remove comment - -2002-09-08 Andi Gutmans - - * zend.h: - Prepare for alpha 3 - -2002-09-05 Stanislav Malyshev - - * zend_compile.c: quick-n-dirty inheritance support for __handlers - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Whitespace fixes. - -2002-09-04 Stanislav Malyshev - - * zend_object_handlers.c: remove dead code - - * ZEND_CHANGES - zend_object_handlers.c: Fix __call and add some docs - -2002-09-04 Sebastian Bergmann - - * zend_object_handlers.c: Fix ZTS build. - - * ZEND_CHANGES: TBD: __call(), __get(), __set(). - -2002-09-04 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_extensions.h - zend_object_handlers.c - zend_objects.c: Support for __get, __set and __call in classes. - This should work as follows: if class hasn't member with given name, - __get/__set is called. If class has no method with given name, __call is called. - __get/__set are not recursive, __call can be. - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Workaround for superfluous comma in var_export() result. - - * ZEND_CHANGES: - Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments. - -2002-09-03 Thies C. Arntzen - - * zend_builtin_functions.c: nuke warning - - * zend_builtin_functions.c: nuke unneeded stuff - -2002-09-03 Zeev Suraski - - * zend.c - zend.h - zend_ini.c: MFZE1 - -2002-09-03 Derick Rethans - - * zend_ini.c: - Revert - - * zend_ini.c: - - MFH for: Apply rest of html errors fix (Patch by Jan Lehnardt ) - -2002-09-03 Sebastian Bergmann - - * zend.h: - Add html_errors to zend_utility_values. Patch by Jan Lehnardt . - -2002-09-03 Andi Gutmans - - * zend_builtin_functions.c: - Fix typo - -2002-09-02 Thies C. Arntzen - - * zend_builtin_functions.c: - refine last patch. if the argument-stack is not consistent don't try to show - arguments. no call to zend_error is made as we might end up in an infinite - recursion if called from an error_handler. - so: if the arguments to functions aren't shown in debug_backtrace this is 'cause - the arument stack was not consistent when debug_backtrace was called. - - * zend_builtin_functions.c: - debug_backtrace() now checks the complete argument-stack for consistency. - -2002-09-02 Stanislav Malyshev - - * zend_execute.c: MFZE1 - -2002-09-01 Andi Gutmans - - * zend_llist.c: - Fix leak reported by "l0t3k" - -2002-09-01 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2002-08-28 Thies Arntzen - - * zend_builtin_functions.c - zend_execute_API.c: debug_backtrace() - - make args passed to functions called vy call_user_function available again. - - * zend_builtin_functions.c: debug_backtrace(): - - make args work if called from the error_handler - - fix refcount for args - - * zend.c: - clear current_execute_data on bailout as it would point into some freed area - on the stack. - -2002-08-28 derick - - * zend.c: - MFZE1 - -2002-08-26 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace(): show name of included file for include and require calls - plus some small fixes suggested by andi. - -2002-08-24 Andi Gutmans - - * zend_builtin_functions.c: - Whitespace - - * zend_builtin_functions.c: - Whitespace and better variable name - -2002-08-24 Thies Arntzen - - * zend_builtin_functions.c: fix warning - -2002-08-23 Andi Gutmans - - * Zend.m4: - Add \n to configure fprintf - - * zend_extensions.c: - dlerror -> DL_ERROR - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace: show include/require/eval as normal functions on the stack - -2002-08-23 derick - - * zend_builtin_functions.c: - No spaces :) - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - - debug_backtrace now also returns an array containing the arguments of the - called function. - - zeev, andi - is knowing the structure of the stack considered a bad thing in - zend_builtin_function? if yes i would have to create a new function in - zend_ptr_stack.c (but i think we are save this way) - - * zend_builtin_functions.c - zend_execute_API.c: - debug_backtrace: - added "type" ('->' or '::') for object calls. - made calls done thru call_user_func show-up correct in backtraces. - - andi, - does this look correct to you? - - * zend_execute.c: those are set by RETURN_FROM_EXECUTE - -2002-08-21 Thies Arntzen - - * zend_execute.c: - zend_execute: make sure that current_execute_data points to the right thing - after coming back from recursion. - -2002-08-19 Zeev Suraski - - * zend_operators.c: MFZE1 - -2002-08-17 Andi Gutmans - - * zend_execute.c: MFZE1 - -2002-08-17 Zeev Suraski - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-08-16 Stig Bakken - - * zend.c: * append emacs footer - - * zend.c: * remove builtin exception class - -2002-08-16 Andi Gutmans - - * zend.c: - Fix whitespace - -2002-08-16 Stig Bakken - - * zend_execute_API.c - zend_globals.h - zend.c - zend_builtin_functions.c: - - Added set_exception_handler() function for registering a global, - catch-all exception handling function - - Added set_exception_handler() function for registering a global, - catch-all exception handling function (Stig) - -2002-08-15 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_language_scanner.l: MFZE1 - -2002-08-14 jason - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y: - MFZE1 (use token instead of global for opcode counting) - -2002-08-13 Andi Gutmans - - * zend_execute_API.c: - - Fix crash when exception is raised in __autoload function - -2002-08-13 Zeev Suraski - - * zend.h: MFZE1 - -2002-08-08 sebastian - - * zend_objects.c: Fix warning. - -2002-08-08 stas - - * zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Add ZEND_API to functions - -2002-08-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Make new 'is' operator work with classes only and return false when - - the object isn't of the said class or the value isn't an object. - - * zend_static_allocator.c: - Bad Harald! :) - -2002-08-08 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2002-08-07 phanto - - * zend_static_allocator.c - zend_alloc.c - zend_config.w32.h - zend_hash.c - zend_ini.c - zend_llist.h - zend_mm.c - zend_operators.c: make win32 debug output more verbose - -2002-08-03 Andi Gutmans - - * tests/zend2.php: - Small fix - -2002-08-03 Zeev Suraski - - * zend_execute.c: MFZE1 - -2002-08-01 stas - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-07-30 jason - - * zend_compile.c - zend_execute.c - zend_globals.h: MFZE1 global declare - - * zend_compile.c: Fix segfault - -2002-07-30 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Adding 'is' operator that can be used to check the type of a variable, - or its class. - -2002-07-28 phanto - - * OBJECTS2_HOWTO: update the handlers struct - -2002-07-27 Andi Gutmans - - * zend_compile.c - zend_execute_API.c: - - Make sure classes are first looked for in the current scope. - - Make sure that during inheritance the global scope is searched if the - - current one doesn't work. - -2002-07-26 Andi Gutmans - - * zend_execute.c - zend.c - zend_builtin_functions.c - zend_compile.h: - - Fix problem with debug_backtrace() reported by Stig. We weren't reporting - - global function information because it wasn't available. We have to do - - an additional assignment per-function call so that it'll be available. - - Also don't define the global scope as function name _main_ but leave it - - empty so that frameworks like Pear can decide what they want to do. - -2002-07-25 sniper - - * Zend.m4: Fixed 3 major failures in this test: - - 1. Tests work better when they are actually run.. - 2. When file is opened, it should be closed sometime too. - 3. AC_TRY_RUN cleans after itself (rm -f conftest.*), so it's - good idea to read the values while the file still exists. - - -2002-07-24 Andi Gutmans - - * zend_mm.c: - Fix some compile problems with the new configure checks. - -2002-07-24 James Cox - - * Zend.m4 - zend_mm.c: move testing for the alignment values into configure. - - * Zend.m4: ws fixes. - -2002-07-23 Andi Gutmans - - * zend_hash.c: - Fix WS. - -2002-07-21 Andi Gutmans - - * zend_compile.c: - - Fix bug reported by Sebastian where old constructors didn't work in - - nested classes. - -2002-07-18 derick - - * zend.h - zend_extensions.c: - MFZE1 - MacOSX fixes by Marko Karppinen - -2002-07-17 Andi Gutmans - - * zend_compile.c: - - Remove code which wasn't supposed to go into the patch. - - * zend_compile.c - zend_language_parser.y: - Rejuggle some code. - -2002-07-17 sniper - - * ZEND_CHANGES: This was mentioned already above (with an example too :) - -2002-07-16 Andi Gutmans - - * ZEND_CHANGES: - Before I forget to list it, this was also added. - - * zend_language_scanner.l: - - Syntactic sugar - Add "public" as a synonym for "var". - - Now we have the three P's. - You can do: - - - -2002-07-15 derick - - * zend_operators.c: - MFH of the crap removal - -2002-07-15 Andi Gutmans - - * ZEND_CHANGES - zend.c - zend.h - zend_API.c - zend_compile.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - - Commit patch to support protected member variables (by Timm Friebe w/ - - some fixes by me). - - You can't access protected variables from outside the object. If you want - - to see a protected member from your ancestors you need to declare the - - member as protected in the class you want to use it in. You can't - - redeclare a protected variable as private nor the other way around. - - * zend_operators.c: - - Really implement bool increment/decrement as flip-flop. - -2002-07-14 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - ZEND_CHANGES: - - Nuke delete(). It was a big mistake to introduce it and I finally - - understand why Java didn't do so. - - If you still want to control destruction of your object then either make - - sure you kill all references or create a destruction method which you - - call yourself. - - * zend_execute.c: - Nuke some unused code - -2002-07-14 derick - - * zend_operators.c: MFZE1 - - * zend_operators.c: - MFZE1 - -2002-07-07 Andi Gutmans - - * zend_objects_API.c: - Path which should improve previous fix. - - * zend_objects_API.c: - - First try at solving problem with different objects being allocated the - - same id. - -2002-07-07 Stanislav Malyshev - - * zend_object_handlers.c: name length should be strlen+1 - -2002-07-07 Sebastian Bergmann - - * zend_language_parser.y: - Allow for 'class Namespace::Bar extends Foo' syntax. Patch by Timm Friebe . - -2002-07-06 Andi Gutmans - - * zend_execute.c: - - Fix problem where scope was lost in nested function calls. - - Thanks to Timm Friebe for diving into this one. - -2002-07-06 Zeev Suraski - - * zend_language_parser.y: spelling fix - -2002-07-05 Stig Bakken - - * zend_builtin_functions.c: * folding fixes - -2002-07-01 Andi Gutmans - - * zend_compile.c: - Fix bug when acccessing $this not in class scope. - - * zend_objects.h - zend_objects.c: - Export zend_object_get_address() - -2002-06-30 Andi Gutmans - - * ZEND_CHANGES: - Remember to document autoload when I have time. - -2002-06-30 Derick Rethans - - * zend_modules.h: - MFZE1 - -2002-06-29 Andi Gutmans - - * zend.h: - Get ready for alpha2 - - * zend_execute_API.c: - Invalid -> Undefined - - * zend_language_parser.y: - Add missing semi-colon. - - * zend_execute_API.c - zend_execute.c: - Improve some error messages. - - * zend_compile.c: - Revert previous fix. - - * zend_compile.c: - Change E_ERROR -> E_COMPILE_ERROR where needed. - - * zend_compile.c: - - Fix for bug #17882. We complain if the same method is declared twice. - - * zend.h - zend_operators.c: - Fix bug 15037 - - Bump version to alpha2-dev - -2002-06-28 Andi Gutmans - - * zend_operators.c: - WS fix - -2002-06-26 Andi Gutmans - - * zend_execute_API.c: - - Autoloading support based on patch from Ivan Ristic. - - Again I hope this feature ends up working well because if it doesn't we - - might need to nuke it. This only works for global scoped classes and it - - will never work for sub-classes so don't even ask!!!!! - - Just define an __autoload() function in the global scope and it will be - - called with the class name as the parameter if it doesn't manage to find - - the class. - - * zend_API.c - zend_builtin_functions.c - zend_mm.h: - Centralize global class fetch - - * zend_alloc.c - zend_execute.c: - - Fix problem with scope's not changing correctly during method calls. - - Reapply a tiny optimization to the allocator so that in non-debug mode - - we clean memory without detecting leaks. - -2002-06-24 Andi Gutmans - - * zend_fast_cache.h: - - MFZE1 (Turn off fast cache until we make sure it performs well.) - - * zend_alloc.c: - More fixes (warnings, bug fixes etc.) - - * zend_execute.c: - - Revert patch which checks at run-time if you're allowed to assign - - certain values by reference. - - We still need to find a solution for cases when this shouldn't be allowed - - as it might cause leaks. - - * zend_alloc.c: - Fix crash bug and clean up a bit. - -2002-06-24 Sebastian Bergmann - - * Zend.m4: IMHO, ZTS should no longer be labeled experimental. - -2002-06-24 Andi Gutmans - - * zend_alloc.c: - MFZE1 - - * zend_alloc.c: - Don't use cache if we're using ZEND_MM - - * zend_mm.c: - - Hardcode alignment to 8. We might need a configure check for this. - - * zend_mm.c - zend_mm.h: - Improve memory manager to allocate small blocks quickly. - - * zend_alloc.h - zend_mm.h - zend_alloc.c: - - Don't keep allocated blocks in a linked list if we're in non-debug mode - - as now the memory manager takes care to nuke all leaking blocks. - - * zend.h - zend_types.h: - MFZE1 - -2002-06-23 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Fix problem with constructor not being inherited and called correctly. - - * zend_mm.c: - Fix small bug - - * zend_mm.c: - - Almost completely implement realloc(). It now resizes in place when - - possible. - -2002-06-22 Andi Gutmans - - * zend_alloc.c - zend_mm.c: - Fix crash when zend_mm_shutdown is called more than once. - - * zend_alloc.c - zend_alloc.h - zend_globals.h - zend_language_parser.y: - MFZE1 - - * zend_constants.h - zend_objects.c - zend_variables.c - zend_variables.h - zend_constants.c - zend_alloc.c - zend_alloc.h: - Nuke persist_alloc(). - -2002-06-19 Andi Gutmans - - * zend_globals.h: - - This was also supposed to be part of the previous ZEND_MM commit :) - - * zend_alloc.c: - - Oops, this was supposed to be part of the previous #ifdef ZEND_MM change - - * zend_mm.h: - Use #ifdef for ZEND_MM - - * zend_mm.c: - Make sure MAX is defined - - * zend_constants.c: - - Fix problem where you couldn't define constants with different cases but - - the same name. - -2002-06-18 Derick Rethans - - * zend.c: - MFZE1 - -2002-06-17 Andi Gutmans - - * zend_mm.c: - Improve speed of alignment calculation - - * zend_mm.c - zend_mm.h - zend_alloc.c: - - Fix a bug and add code which frees actual allocated segments at the end - - of execution (this still doesn't work because some blocks remain - - referenced after the memory manager is killed. - - * zend_mm.c - zend_mm.h: - Save space per-allocated block. - -2002-06-16 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Fix bug in class constants - - Start centralizing main class lookups. This will help implement - - __autload() - - * zend_mm.c - zend_mm.h: - - Remove debug code which doesn't work anymore and add headers. - - * zend_globals.h - zend_mm.c - zend_mm.h - zend_alloc.c - ZendTS.dsp: - Commit an initial version of a home made memory manager. - - It's just for seeing if this would be an advantage to PHP in MT - - environments. If this is to become production material there is still - - a long way to go. - -2002-06-15 Andi Gutmans - - * zend_objects.h - zend_objects_API.c: - - Fix copy&paste problem where we allocated according to an old structure - - decleration and not the new one. - -2002-06-11 Andi Gutmans - - * zend_builtin_functions.c: - - Don't show debug_backtrace() in the trace itself. - - This patch is a bit ugly because the whole code itself is pretty complex - - and hard to re-order. - - * zend_execute.c - zend_language_parser.y: - - Fix problem with assigning functions by reference. - -2002-06-11 Sebastian Bergmann - - * RFCs/004.txt: Add __delegate(). - -2002-06-10 Harald Radi - - * zend_ts_hash.h - zend_ts_hash.c: added TS_HASH macro - -2002-06-10 Stanislav Malyshev - - * zend_execute.c: Fix leak - -2002-06-09 Harald Radi - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.h: - only check for an available class entry instead of - the std_object_handlers on some places - - -2002-06-08 Andi Gutmans - - * zend_hash.h - zend.h: - This should improve performance on Windows - - * zend_hash.h: - - Add a loop unrolled version of the hash function and a bit of an - - explanation about our hash function (Ralf S. Engelschall) - -2002-06-06 Sebastian Bergmann - - * RFCs/004.txt: Add RFC on delegation. - -2002-06-05 Sebastian Bergmann - - * zend_execute.c: Remove unused local variable. - -2002-06-05 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_object_handlers.c: - - Allow overloaded objects to receive the method name in its original - - case. - -2002-06-05 Derick Rethans - - * zend_llist.c: - Fix memleak (patch by Stefan Sesser) - -2002-06-04 Derick Rethans - - * zend_ini_scanner.l: - Fix for bug #17462 (Patch by Edin Kadribasic) - -2002-05-31 Andi Gutmans - - * ZendTS.dsp: - Add zend_objects_API.* to dsp - - * zend_objects_API.c: - Fix build (one more coming up) - - * zend_objects.c: - Fix build - -2002-05-31 Sebastian Bergmann - - * Zend.dsp: Add zend_objects_API.c to project. - -2002-05-31 Stanislav Malyshev - - * Makefile.am - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Generalize object storage and reference bookkeeping - -2002-05-30 Venkat Raghavan S - - * zend.h - zend_config.nw.h - acconfig.h: NetWare changes - -2002-05-26 Andi Gutmans - - * zend_multibyte.c: - - Add empty zend_multibyte.c to allow build with 4.3.0-dev. - -2002-05-24 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-05-24 Andi Gutmans - - * ZEND_CHANGES: - Add a bit of information. - -2002-05-20 Zeev Suraski - - * zend_API.h - zend_execute.h - zend_list.h: MFZE1 (Expose more C++ APIs) - -2002-05-14 Andi Gutmans - - * zend_objects.c - zend_objects.h: - constructor_called is supposed to be destructor_called - -2002-05-13 Sterling Hughes - - * zend_qsort.c: MFZE1 - -2002-05-13 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-12 Zeev Suraski - - * zend_highlight.c: MFZE1 - -2002-05-12 Sebastian Bergmann - - * ZEND_CHANGES: Rephrase. - - * ZEND_CHANGES: Beautify. - - * ZEND_CHANGES: Start documenting the debug backtracing. - - * ZEND_CHANGES: Whitespace fixes. - -2002-05-11 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: MFZE1 - -2002-05-10 Andi Gutmans - - * zend_builtin_functions.c: - Nuke C++ comment - - * zend_builtin_functions.c: - - Make debug_backtrace() return an array. Still not finished because I - might want to differentiate between method calls and static methods. - - Example: - $bt = debug_backtrace(); - foreach ($bt as $frame) { - if (isset($frame['class'])) { - print $frame['class']; - print "::"; - } - print $frame['function']; - print " ["; - print $frame['file']; - print ":"; - print $frame['line']; - print "]\n"; - } - -2002-05-08 Andi Gutmans - - * zend_execute.c - zend_builtin_functions.c: - - Hopefully fix problems with debug_backtrace() - -2002-05-08 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-07 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c: - - More debug backtrace work. It still doesn't work very well... - -2002-05-02 Andi Gutmans - - * zend.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: Initial support for built-in backtracing. - There are still a few problems such as includes and calling other functions - from internal functions which aren't seen (will have to think if and how to - fix this). - Also the main scripts filename isn't available. Need to think about that. - -2002-04-30 Stanislav Malyshev - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.h - zend_API.c: Make OBJCE return zend_class_entry*, also some cleanups - -2002-04-28 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: Revert. - -2002-04-27 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: - MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) - -2002-04-25 Harald Radi - - * zend_config.w32.h: unbreak the win32 build - -2002-04-24 Harald Radi - - * zend_API.c: MFZE1 saschas 'Avoid exceeding buffer limits' patch - -2002-04-23 Harald Radi - - * zend_hash.c - zend_hash.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ts_hash.c - zend_ts_hash.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_API.c - zend_API.h - zend.h: some type cleanup work - -2002-04-22 Harald Radi - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.h - zend_operators.h - zend_API.c - zend_API.h - zend_builtin_functions.c: added get_class_entry callback handler to the - object handlers structure - -2002-04-22 Sebastian Bergmann - - * Zend.m4: MFZE1: Change default value of inline-opt to yes (Sascha). - -2002-04-22 Harald Radi - - * zend_config.w32.h - acconfig.h - flex.skl: fixed linkage warning under win32 - -2002-04-20 Zeev Suraski - - * zend_execute_API.c: MFZE1 - -2002-04-19 Sebastian Bergmann - - * zend_list.c - zend_hash.c - zend_hash.h: - MFZE1: make sure the resource-list is always consistent during shutdown (Thies). - - * zend_hash.c: MFZE1: Fix imbalance bug (Zeev). - -2002-04-10 Jani Taskinen - - * zend_language_scanner.l - zend_language_parser.y: MFZE1 - -2002-04-07 Stanislav Malyshev - - * zend.h: make compatible with current PHP - - * zend_compile.c: sync - -2002-03-29 Derick Rethans - - * zend_compile.c: - revert patch - -2002-03-25 Derick Rethans - - * zend_compile.c: - MFZE1 - -2002-03-23 Andi Gutmans - - * zend_ts_hash.c - zend_ts_hash.h: - - Fix build without ZTS. If someone has a nicer fix let me know. - -2002-03-21 Andi Gutmans - - * zend_language_parser.y: - - No idea how this slipped in. Fix delete $obj statement. - -2002-03-20 Harald Radi - - * ZendTS.dsp - zend.h - zend_ts_hash.c - zend_ts_hash.h: added thread safe hashtable which allows concurrent - reads but only exclusive writes - -2002-03-19 Andi Gutmans - - * zend_language_parser.y - zend.h: - - Finish covering all parsed methods to check for validity in parser. - - Change zval's refcount to zend_uint (If it doesn't slow down the Engine - - too much it should probably stay this way). If anyone has time to test - - the difference in speed between zend_ushort & zend_uint in zend.h of - - the struct _zval_struct (one line change) I'd be glad to get some - - figures. - -2002-03-18 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - More fixes to check for member/function call legality. - -2002-03-17 Andi Gutmans - - * zend_language_parser.y - zend_compile.c: - - Start putting error handling where method calls are being used in a - - context where only writable variables should be used. - -2002-03-15 Andi Gutmans - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans - - * zend_execute.c: - Support importing constants. e.g.: - - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - - -2002-03-02 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise ) - -2002-01-25 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - - -2002-01-14 Sebastian Bergmann - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans - - * zend_execute.c: - Support constants. The following works now: - - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - - -2001-11-24 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-11-05 stig - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha - - * zend.h: Fix build - -2001-07-27 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor - -2000-11-02 Zeev Suraski - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans - - * zend.h: version update - -2000-06-26 Zeev Suraski - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of - -2000-06-11 Andi Gutmans - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy ) - -2000-05-22 Zeev Suraski - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans - - * zend_opcode.c: Fix order - -2000-05-17 sascha - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen - - * zend.h - zend_execute.c: - needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen - - * zend_operators.c: now - -2000-02-27 Egon Schmid - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski - - * zend_highlight.c: - Since we're highlighting code, put and around the code. - -2000-01-13 Zeev Suraski - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby - - * zend-scanner.l: build error - windows - -1999-12-04 stig - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski - - * zend.c: Make this class instanciatable - -1999-09-12 sascha - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski - - * zend_constants.c: New constants - -1999-07-22 stig - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski - - * zend.h: *** empty log message *** - -1999-05-12 stig - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff --git a/Zend/FlexLexer.h b/Zend/FlexLexer.h deleted file mode 100644 index fd6525857024c..0000000000000 --- a/Zend/FlexLexer.h +++ /dev/null @@ -1,186 +0,0 @@ -// $Header$ - -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms with or without -// modification are permitted provided that: (1) source distributions retain -// this entire copyright notice and comment, and (2) distributions including -// binaries display the following acknowledgement: ``This product includes -// software developed by the University of California, Berkeley and its -// contributors'' in the documentation or other materials provided with the -// distribution and in all advertising materials mentioning features or use -// of this software. Neither the name of the University nor the names of -// its contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef FLEXLEXER_H -// Never included before - need to define base class. -#define FLEXLEXER_H -#include - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); - - virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -#endif diff --git a/Zend/LICENSE b/Zend/LICENSE deleted file mode 100644 index 67256f19695eb..0000000000000 --- a/Zend/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ --------------------------------------------------------------------- - The Zend Engine License, Version 2.00 -Copyright (c) 1999-2005 Zend Technologies Ltd. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. The names "Zend" and "Zend Engine" must not be used to endorse - or promote products derived from this software without prior - permission from Zend Technologies Ltd. For written permission, - please contact license@zend.com. - - 4. Zend Technologies Ltd. may publish revised and/or new versions - of the license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by Zend Technologies Ltd. No one other than Zend - Technologies Ltd. has the right to modify the terms applicable - to covered code created under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes the Zend Engine, freely available at - http://www.zend.com" - - 6. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "The Zend Engine is freely available at http://www.zend.com" - -THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND -ANY EXPRESSED 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 ZEND -TECHNOLOGIES LTD. 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. - --------------------------------------------------------------------- diff --git a/Zend/Makefile.am b/Zend/Makefile.am deleted file mode 100644 index 36a0a4a464564..0000000000000 --- a/Zend/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -## Process this file with automake to produce Makefile.in -*- makefile -*- - -#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output - -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libZend.la - -libZend_la_SOURCES=\ - zend_language_parser.y zend_language_scanner.l \ - zend_ini_parser.y zend_ini_scanner.l \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ - zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ - zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ - zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ - zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \ - zend_objects_API.c zend_ts_hash.c zend_stream.c zend_mm.c \ - zend_default_classes.c zend_reflection_api.c \ - zend_iterators.c zend_interfaces.c zend_exceptions.c \ - zend_strtod.c zend_strtod.c zend_strtol.c - -libZend_la_LDFLAGS = -libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ - -# automake isn't too clever about "non-standard" use of lex and yacc - -$(libZend_la_OBJECTS): zend_language_parser.h - -zend_ini_scanner.lo: zend_ini_parser.h - -# Language parser/scanner rules - -zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -zend_language_parser.h: zend_language_parser.c -zend_language_parser.c: $(srcdir)/zend_language_parser.y - $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c - -# INI parser/scanner rules - -zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c - -zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l - -zend_ini_parser.h: zend_ini_parser.c - -depend: - -zend_execute.lo: $(srcdir)/zend_execute.c - $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c - diff --git a/Zend/Makefile.frag b/Zend/Makefile.frag deleted file mode 100755 index 3ab617d715534..0000000000000 --- a/Zend/Makefile.frag +++ /dev/null @@ -1 +0,0 @@ -Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h diff --git a/Zend/OBJECTS2_HOWTO b/Zend/OBJECTS2_HOWTO deleted file mode 100644 index 302d1e9087b53..0000000000000 --- a/Zend/OBJECTS2_HOWTO +++ /dev/null @@ -1,195 +0,0 @@ -Creating an object ------------------- - -Object can be created in the following ways: - -1. As a result of a function call. E.g.: - -$foo = create_new_foo("parameter"); -$foo->run(); - -The function should create a new zval, create new object and get the -handle for it, set handle and handler table as needed. Note that the -handle is the only ID of the object, so it should be enough to -identify it. - -2. Overriding create_object handler for class. E.g.: - -$foo = new Java("some.Class.here", "parameter"); -$foo->run(); - -The create_object handler function should create a new zval, create -new object and get the handle for it, set handle and handler table as -needed, and also provide constructor method that would handle -constructor call. The get_constructor handler table entry should be -used for that. Do not rely class entry's constructor, unless you refer -to it from get_constructor handler. - -Object maintenance ------------------- - -The handlers add_ref and del_ref are called when a new zval referring -to the object is created. This does not create a new object - both -zvals still refer to the same object. - -clone_obj handler should create a new object, identical to an old one, -but being a separate entity. - -delete_obj should destroy an object, all references to it become -invalid. - -Object access - read --------------------- - -read_property is used to read object's property. This value is not -meant to be changed. The handler returns zval * with the value. - -Object access - write ---------------------- - -write_property is used to directly write object's property by -name. This handler is used to assign property variables or to change them -in operations like += or ++ (unless get_property_zval_ptr is also set). - -get_property_zval_ptr is used to obtain pointer to modifiable zval for -operations like += or ++. This should be used only if your object model -stores properties as real zval's that can be modified from outside. -Otherwise this handler should be NULL and the engine will use -read_property and write_property instead. - -get_property_ptr is used to obtain zval ** for future writing to -it. If your object properties are stored as zval*, return real place -where the property is stored. If the aren't, the best way is to create -proxy object and handle it via get and set methods (see below). -This method is meant to be used for send-by-reference and assign-by-reference -use of object properties. If you don;t want to implement property -referencing for your objects, you can set this handler to NULL. - -get and set handlers are used when engine needs to access the object -as a value. E.g., in the following situation: - -$foo =& $obj->bar; -$foo = 1; - -if $foo is an object (e.g., proxy object from get_property_ptr) it -would be accessed using write handler. - -Object access - method call ---------------------------- - -get_method handler is used to find method description by name. It -should set right type, function name and parameter mask for the -method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be -called via call_method handler, otherwise it would be called with -standard Zend means. - -get_constructor performs the same function as get_method, but for the -object constructor. - -call_method handler is used to perform method call. Parameters are -passed like to any other Zend internal function. - -Object - comparison -------------------- - -Objects can be compared via compare_objects handler. This is used with -== operation, === compares objects by handles, i.e., return true if -and only if it's really the same object. Note that objects from -different object types (i.e., having different handlers) can not be -compared. - -Objects - reflection --------------------- - -get_class_name is used to retrieve class name of the object. -get_class_entry returns class entry (zend_class_entry) for the object, -in case there exists PHP class for it. -No other reflection functions are currently implemented. - -Objects - data structures and handlers ---------------------------------------- - -The object is represented by the following structure: - -struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -}; - -handle is an ID of the object among the objects of the same type (not -class!). The type of the object and how it behaves is determined by -the handler table. - -typedef struct _zend_object_handlers { - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_delete_obj_t delete_obj; - zend_object_clone_obj_t clone_obj; - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_get_property_ptr_t get_property_ptr; - zend_object_get_property_zval_ptr_t get_property_zval_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; -} zend_object_handlers; - -See zend_object_handlers.h for prototypes. All objects are passed as zval's. - -Handlers explained: - -add_ref - called when a copy of the object handle is created. - -del_ref - called when a copy of the object handle is destroyed. - -delete_obj - called when an object needs to be destroyed. - -clone_obj - called when a new object identical to an old one should be -created (unlike Zend Engine 1, this never happens unless explicitly -asked for). - -read_property - returns zval *, containing the value of the -property. Is used when value of the property should be retrieved for -reading. - -write_property - assigns value to certain property of the object. - -get_property_zval_ptr - retrieves zval** for being directly modified by -the engine. If your properties are not zval's, don't define it. - -get_property_ptr - retrieves zval** for the property of the value, to -be used for read and write. If object properties are not zval's -natively, this method should create and return proxy object for use -with get and set methods. - -get - retrieves zval* for object contents. To be used mainly with -proxy objects from get_property_ptr, but also may be used for -convert_to_* functions. - -set - sets value for object contents. To be used mainly with -proxy objects from get_property_ptr. - -has_property - checks if the object has certain property set. - -unset_property - removes value for the property of the object - -get_method - retrieves description of the method - -call_method - calls the method (parameters should be put on stack like -for any other PHP internal function). - -get_constructor - get description for the object constructor method - -get_class_entry - should return the class entry for the object - -get_class_name - get the name of the class the object belongs to - -compare_objects - compares if two objects are equal diff --git a/Zend/README.ZEND_VM b/Zend/README.ZEND_VM deleted file mode 100644 index 15ff6fd86f4bd..0000000000000 --- a/Zend/README.ZEND_VM +++ /dev/null @@ -1,108 +0,0 @@ -ZEND_VM -======= - -ZEND_VM architecture allows specializing opcode handlers according to op_type -fields and using different execution methods (call threading, switch threading -and direct threading). As a result ZE2 got more than 20% speedup on raw PHP -code execution (with specialized executor and direct threading execution -method). As in most PHP applications raw execution speed isn't the limiting -factor but system calls and database callls are, your mileage with this patch -will vary. - -Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can -find opcode handlers and helpers. The typical opcode handler template looks -like this: - -ZEND_VM_HANDLER(, , , ) -{ - -} - - is a opcode number (0, 1, ...) - is an opcode name (ZEN_NOP, ZEND_ADD, :) - & are masks for allowed operand op_types. Specializer -will generate code only for defined combination of types. You can use any -combination of the following op_types UNUSED, CONST, VAR, TMP and CV also -you can use ANY mask to disable specialization according operand's op_type. - is a handler's code itself. For most handlers it stills the -same as in old zend_execute.c, but now it uses macros to access opcode operands -and some internal executor data. - -You can see the conformity of new macros to old code in the following list: - -EXECUTE_DATA - execute_data -ZEND_VM_DISPATCH_TO_HANDLER() - return _helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER() - return (ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER_EX(,,) - return (, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_CONTINUE() - return 0 -ZEND_VM_NEXT_OPCODE() - NEXT_OPCODE() -ZEND_VM_SET_OPCODE( - SET_OPCODE( -ZEND_VM_INC_OPCODE() - INC_OPCOD() -ZEND_VM_RETURN_FROM_EXECUTE_LOOP() - RETURN_FROM_EXECUTE_LOOP() -ZEND_VM_C_LABEL(\n"); - zend_printf(""); -} - - - -ZEND_API void zend_strip(TSRMLS_D) -{ - zval token; - int token_type; - int prev_space = 0; - - CG(literal_type) = IS_STRING; - token.type = 0; - while ((token_type=lex_scan(&token TSRMLS_CC))) { - switch (token_type) { - case T_WHITESPACE: - if (!prev_space) { - zend_write(" ", sizeof(" ") - 1); - prev_space = 1; - } - /* lack of break; is intentional */ - case T_COMMENT: - case T_DOC_COMMENT: - token.type = 0; - continue; - - case T_END_HEREDOC: { - char *ptr = LANG_SCNG(yy_text); - - zend_write(ptr, LANG_SCNG(yy_leng) - 1); - /* The ensure that we only write one ; and that it followed by the required newline */ - zend_write("\n", sizeof("\n") - 1); - if (ptr[LANG_SCNG(yy_leng) - 1] == ';') { - lex_scan(&token TSRMLS_CC); - } - efree(Z_UNIVAL(token)); - } - break; - - default: - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - break; - } - - if (token.type == IS_STRING || - token.type == IS_BINARY || - token.type == IS_UNICODE) { - switch (token_type) { - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_CLOSE_TAG: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - break; - - default: - efree(Z_UNIVAL(token)); - break; - } - } - prev_space = token.type = 0; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ - diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h deleted file mode 100644 index 1e2c7f695e199..0000000000000 --- a/Zend/zend_highlight.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_HIGHLIGHT_H -#define ZEND_HIGHLIGHT_H - -#define HL_COMMENT_COLOR "#FF8000" /* orange */ -#define HL_DEFAULT_COLOR "#0000BB" /* blue */ -#define HL_HTML_COLOR "#000000" /* black */ -#define HL_STRING_COLOR "#DD0000" /* red */ -#define HL_BG_COLOR "#FFFFFF" /* white */ -#define HL_KEYWORD_COLOR "#007700" /* green */ - - -typedef struct _zend_syntax_highlighter_ini { - char *highlight_html; - char *highlight_comment; - char *highlight_default; - char *highlight_string; - char *highlight_keyword; -} zend_syntax_highlighter_ini; - - -BEGIN_EXTERN_C() -ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API void zend_strip(TSRMLS_D); -ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC); -ZEND_API void zend_html_putc(char c); -ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC); -END_EXTERN_C() - -extern zend_syntax_highlighter_ini syntax_highlighter_ini; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c deleted file mode 100644 index ec91ff0f138ce..0000000000000 --- a/Zend/zend_indent.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This indenter doesn't really work, it's here for no particular reason. */ - - -#include "zend.h" -#include -#include "zend_compile.h" -#include "zend_indent.h" - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) - - -static void handle_whitespace(int *emit_whitespace) -{ - unsigned char c; - int i; - - for (c=0; c<128; c++) { - if (emit_whitespace[c]>0) { - for (i=0; i0) { - ZEND_PUTS(" {\n"); - memset(emit_whitespace, 0, sizeof(int)*256); - } else { - ZEND_PUTS("{"); - } - break; - case '}': - nest_level--; - if (emit_whitespace['\n']==0) { - ZEND_PUTS("\n"); - } - for (i=0; i0) { - for (i=0; i | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INDENT_H -#define ZEND_INDENT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_indent(void); -END_EXTERN_C() - -#endif /* ZEND_INDENT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c deleted file mode 100644 index 072a843c78284..0000000000000 --- a/Zend/zend_ini.c +++ /dev/null @@ -1,574 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_qsort.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_alloc.h" -#include "zend_operators.h" -#include "zend_strtod.h" - -static HashTable *registered_zend_ini_directives; - -#define NO_VALUE_PLAINTEXT "no value" -#define NO_VALUE_HTML "no value" - -/* - * hash_apply functions - */ -static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) -{ - if (ini_entry->module_number == *module_number) { - return 1; - } else { - return 0; - } -} - - -static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) -{ - if (ini_entry->modified) { - if (ini_entry->on_modify) { - zend_try { - /* even if on_modify bails out, we have to continue on with restoring, - since there can be allocated variables that would be freed on MM shutdown - and would lead to memory corruption later ini entry is modified again */ - ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC); - } zend_end_try(); - } - efree(ini_entry->value); - ini_entry->value = ini_entry->orig_value; - ini_entry->value_length = ini_entry->orig_value_length; - ini_entry->modified = 0; - ini_entry->orig_value = NULL; - ini_entry->orig_value_length = 0; - } - return 0; -} - -/* - * Startup / shutdown - */ -ZEND_API int zend_ini_startup(TSRMLS_D) -{ - registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable)); - - EG(ini_directives) = registered_zend_ini_directives; - if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int zend_ini_shutdown(TSRMLS_D) -{ - zend_hash_destroy(EG(ini_directives)); - free(EG(ini_directives)); - return SUCCESS; -} - - -ZEND_API int zend_ini_global_shutdown(TSRMLS_D) -{ - zend_hash_destroy(registered_zend_ini_directives); - free(registered_zend_ini_directives); - return SUCCESS; -} - - -ZEND_API int zend_ini_deactivate(TSRMLS_D) -{ - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); - return SUCCESS; -} - - -#ifdef ZTS -ZEND_API int zend_copy_ini_directives(TSRMLS_D) -{ - zend_ini_entry ini_entry; - - EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable)); - if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); - zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC); - return SUCCESS; -} -#endif - - -static int ini_key_compare(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f; - Bucket *s; - - f = *((Bucket **) a); - s = *((Bucket **) b); - - if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */ - return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength); - } else if (f->nKeyLength==0) { /* f is numeric, s is not */ - return -1; - } else if (s->nKeyLength==0) { /* s is numeric, f is not */ - return 1; - } else { /* both strings */ - /*FIXME: unicode hash*/ - return zend_binary_strcasecmp(f->key.u.string, f->nKeyLength, s->key.u.string, s->nKeyLength); - } -} - - -ZEND_API void zend_ini_sort_entries(TSRMLS_D) -{ - zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC); -} - -/* - * Registration / unregistration - */ - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) -{ - zend_ini_entry *p = ini_entry; - zend_ini_entry *hashed_ini_entry; - zval default_value; - HashTable *directives = registered_zend_ini_directives; - zend_bool config_directive_success = 0; - -#ifdef ZTS - /* if we are called during the request, eg: from dl(), - * then we should not touch the global directives table, - * and should update the per-(request|thread) version instead. - * This solves two problems: one is that ini entries for dl()'d - * extensions will now work, and the second is that updating the - * global hash here from dl() is not mutex protected and can - * lead to death. - */ - if (directives != EG(ini_directives)) { - directives = EG(ini_directives); - } -#endif - - while (p->name) { - p->module_number = module_number; - config_directive_success = 0; - if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) { - zend_unregister_ini_entries(module_number TSRMLS_CC); - return FAILURE; - } - if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) { - if (!hashed_ini_entry->on_modify - || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) { - hashed_ini_entry->value = default_value.value.str.val; - hashed_ini_entry->value_length = default_value.value.str.len; - config_directive_success = 1; - } - } - - if (!config_directive_success && hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); - } - p++; - } - return SUCCESS; -} - - -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC); -} - - -static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) -{ - if (p->on_modify) { - p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC); - } - return 0; -} - - -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) -{ - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC); -} - - -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) -{ - zend_ini_entry *ini_entry; - char *duplicate; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - if (!(ini_entry->modifiable & modify_type)) { - return FAILURE; - } - - duplicate = estrndup(new_value, new_value_length); - - if (!ini_entry->on_modify - || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) { - if (!ini_entry->modified) { - ini_entry->orig_value = ini_entry->value; - ini_entry->orig_value_length = ini_entry->value_length; - } else { /* we already changed the value, free the changed value */ - efree(ini_entry->value); - } - ini_entry->value = duplicate; - ini_entry->value_length = new_value_length; - ini_entry->modified = 1; - } else { - efree(duplicate); - } - - return SUCCESS; -} - - -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC); - return SUCCESS; -} - - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) -{ - zend_ini_entry *ini_entry; - - if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - ini_entry->displayer = displayer; - return SUCCESS; -} - - - -/* - * Data retrieval - */ - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0); - } else if (ini_entry->value) { - return strtol(ini_entry->value, NULL, 0); - } - } - - return 0; -} - - -ZEND_API double zend_ini_double(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0); - } else if (ini_entry->value) { - return (double) zend_strtod(ini_entry->value, NULL); - } - } - - return 0.0; -} - - -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return ini_entry->orig_value; - } else { - return ini_entry->value; - } - } - - return ""; -} - - -static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML)-1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1; - } - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML)-1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1; - } - } - ZEND_WRITE(display_string, display_string_length); - } -} - - -ZEND_INI_DISP(zend_ini_boolean_displayer_cb) -{ - int value, tmp_value_len; - char *tmp_value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); - tmp_value_len = ini_entry->orig_value_length; - } else if (ini_entry->value) { - tmp_value = ini_entry->value; - tmp_value_len = ini_entry->value_length; - } else { - tmp_value = NULL; - tmp_value_len = 0; - } - - if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { - value = 1; - } - else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { - value = 1; - } - else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { - value = 1; - } - else { - value = atoi(tmp_value); - } - - if (value) { - ZEND_PUTS("On"); - } else { - ZEND_PUTS("Off"); - } -} - - -ZEND_INI_DISP(zend_ini_color_displayer_cb) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - if (value) { - if (zend_uv.html_errors) { - zend_printf("%s", value, value); - } else { - ZEND_PUTS(value); - } - } else { - if (zend_uv.html_errors) { - ZEND_PUTS(NO_VALUE_HTML); - } else { - ZEND_PUTS(NO_VALUE_PLAINTEXT); - } - } -} - - -ZEND_INI_DISP(display_link_numbers) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value)==-1) { - ZEND_PUTS("Unlimited"); - } else { - zend_printf("%s", value); - } - } -} - - -/* Standard message handlers */ - -ZEND_API ZEND_INI_MH(OnUpdateBool) -{ - zend_bool *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (zend_bool *) (base+(size_t) mh_arg1); - - if (new_value_length==2 && strcasecmp("on", new_value)==0) { - *p = (zend_bool) 1; - } - else if (new_value_length==3 && strcasecmp("yes", new_value)==0) { - *p = (zend_bool) 1; - } - else if (new_value_length==4 && strcasecmp("true", new_value)==0) { - *p = (zend_bool) 1; - } - else { - *p = (zend_bool) atoi(new_value); - } - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateLong) -{ - long *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (long *) (base+(size_t) mh_arg1); - - *p = zend_atoi(new_value, new_value_length); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateReal) -{ - double *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (double *) (base+(size_t) mh_arg1); - - *p = zend_strtod(new_value, NULL); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateString) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - if (new_value && !new_value[0]) { - return FAILURE; - } - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h deleted file mode 100644 index 93f12c9907bde..0000000000000 --- a/Zend/zend_ini.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INI_H -#define ZEND_INI_H - -#define ZEND_INI_USER (1<<0) -#define ZEND_INI_PERDIR (1<<1) -#define ZEND_INI_SYSTEM (1<<2) - -#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) - -#ifndef XtOffsetOf -# if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -# ifdef __STDC__ -# define XtOffset(p_type, field) _Offsetof(p_type, field) -# else -# ifdef CRAY2 -# define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -# else /* !CRAY2 */ - -# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -# endif /* !CRAY2 */ -# endif /* __STDC__ */ -# else /* ! (CRAY || __arm) */ - -# define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -# endif /* !CRAY */ - -# ifdef offsetof -# define XtOffsetOf(s_type, field) offsetof(s_type, field) -# else -# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -# endif - -#endif - -typedef struct _zend_ini_entry zend_ini_entry; - -#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC) -#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type) - -struct _zend_ini_entry { - int module_number; - int modifiable; - char *name; - uint name_length; - ZEND_INI_MH((*on_modify)); - void *mh_arg1; - void *mh_arg2; - void *mh_arg3; - - char *value; - uint value_length; - - char *orig_value; - uint orig_value_length; - int modified; - - void (*displayer)(zend_ini_entry *ini_entry, int type); -}; - -BEGIN_EXTERN_C() -ZEND_API int zend_ini_startup(TSRMLS_D); -ZEND_API int zend_ini_shutdown(TSRMLS_D); -ZEND_API int zend_ini_global_shutdown(TSRMLS_D); -ZEND_API int zend_ini_deactivate(TSRMLS_D); - -ZEND_API int zend_copy_ini_directives(TSRMLS_D); - -ZEND_API void zend_ini_sort_entries(TSRMLS_D); - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC); -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC); -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC); -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage); -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage); -ZEND_API void display_ini_entries(zend_module_entry *module); - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig); -ZEND_API double zend_ini_double(char *name, uint name_length, int orig); -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig); - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)); - -ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb); -ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb); -ZEND_API ZEND_INI_DISP(display_link_numbers); -END_EXTERN_C() - -#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = { -#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } }; - -#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \ - { 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer }, - -#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL) - -#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer) - -#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL) - -#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \ - ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL) - -#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \ - ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL) - -#ifdef ZTS -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb) -#else -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb) -#endif - -#define INI_INT(name) zend_ini_long((name), sizeof(name), 0) -#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0) -#define INI_STR(name) zend_ini_string((name), sizeof(name), 0) -#define INI_BOOL(name) ((zend_bool) INI_INT(name)) - -#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1) -#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1) -#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1) -#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name)) - - -#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC) -#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC) -#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module) - -#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer) -#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) - -/* Standard message handlers */ -BEGIN_EXTERN_C() -ZEND_API ZEND_INI_MH(OnUpdateBool); -ZEND_API ZEND_INI_MH(OnUpdateLong); -ZEND_API ZEND_INI_MH(OnUpdateReal); -ZEND_API ZEND_INI_MH(OnUpdateString); -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); -END_EXTERN_C() - -#define ZEND_INI_DISPLAY_ORIG 1 -#define ZEND_INI_DISPLAY_ACTIVE 2 - -#define ZEND_INI_STAGE_STARTUP (1<<0) -#define ZEND_INI_STAGE_SHUTDOWN (1<<1) -#define ZEND_INI_STAGE_ACTIVATE (1<<2) -#define ZEND_INI_STAGE_DEACTIVATE (1<<3) -#define ZEND_INI_STAGE_RUNTIME (1<<4) - -/* INI parsing engine */ -typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg); -BEGIN_EXTERN_C() -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -END_EXTERN_C() - -#define ZEND_INI_PARSER_ENTRY 1 -#define ZEND_INI_PARSER_SECTION 2 -#define ZEND_INI_PARSER_POP_ENTRY 3 - -typedef struct _zend_ini_parser_param { - zend_ini_parser_cb_t ini_parser_cb; - void *arg; -} zend_ini_parser_param; - -#endif /* ZEND_INI_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y deleted file mode 100644 index ffdec3eb09512..0000000000000 --- a/Zend/zend_ini_parser.y +++ /dev/null @@ -1,288 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define DEBUG_CFG_PARSER 0 -#include "zend.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_constants.h" -#include "zend_ini_scanner.h" -#include "zend_extensions.h" - -#define YYSTYPE zval - -#ifdef ZTS -#define YYPARSE_PARAM tsrm_ls -#define YYLEX_PARAM tsrm_ls -#endif - -#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb -#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg - -int ini_lex(zval *ini_lval TSRMLS_DC); -#ifdef ZTS -int ini_parse(void *arg); -#else -int ini_parse(void); -#endif - -zval yylval; - -#ifndef ZTS -extern int ini_lex(zval *ini_lval TSRMLS_DC); -extern FILE *ini_in; -extern void init_cfg_scanner(void); -#endif - -void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2) -{ - int i_result; - int i_op1, i_op2; - char str_result[MAX_LENGTH_OF_LONG]; - - i_op1 = atoi(op1->value.str.val); - free(op1->value.str.val); - if (op2) { - i_op2 = atoi(op2->value.str.val); - free(op2->value.str.val); - } else { - i_op2 = 0; - } - - switch (type) { - case '|': - i_result = i_op1 | i_op2; - break; - case '&': - i_result = i_op1 & i_op2; - break; - case '~': - i_result = ~i_op1; - break; - case '!': - i_result = !i_op1; - break; - default: - i_result = 0; - break; - } - - result->value.str.len = zend_sprintf(str_result, "%d", i_result); - result->value.str.val = (char *) malloc(result->value.str.len+1); - memcpy(result->value.str.val, str_result, result->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; -} - -void zend_ini_init_string(zval *result) -{ - result->value.str.val = malloc(1); - result->value.str.val[0] = 0; - result->value.str.len = 0; - result->type = IS_STRING; -} - -void zend_ini_add_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; - - result->value.str.val = (char *) realloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; -} - -void zend_ini_get_constant(zval *result, zval *name) -{ - zval z_constant; - TSRMLS_FETCH(); - - if (!memchr(name->value.str.val, ':', name->value.str.len) - && zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) { - /* z_constant is emalloc()'d */ - convert_to_string(&z_constant); - result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len); - result->value.str.len = z_constant.value.str.len; - result->type = z_constant.type; - zval_dtor(&z_constant); - free(name->value.str.val); - } else { - *result = *name; - } -} - -void zend_ini_get_var(zval *result, zval *name) -{ - zval curval; - char *envvar; - TSRMLS_FETCH(); - - if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) { - result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len); - result->value.str.len = curval.value.str.len; - } else if ((envvar = zend_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || - (envvar = getenv(name->value.str.val)) != NULL) { - result->value.str.val = strdup(envvar); - result->value.str.len = strlen(envvar); - } else { - zend_ini_init_string(result); - } -} - - -static void ini_error(char *str) -{ - char *error_buf; - int error_buf_len; - char *currently_parsed_filename; - TSRMLS_FETCH(); - - currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C); - error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */ - error_buf = (char *) emalloc(error_buf_len); - - sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C)); - - if (CG(ini_parser_unbuffered_errors)) { -#ifdef PHP_WIN32 - MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L); -#else - fprintf(stderr, "PHP: %s", error_buf); -#endif - } else { - zend_error(E_WARNING, "%s", error_buf); - } - efree(error_buf); -} - - -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - int retval; - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_open_file_for_scanning(fh TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - retval = ini_parse(TSRMLS_C); - - zend_ini_close_file(fh TSRMLS_CC); - - if (retval==0) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -%} - -%pure_parser -%token TC_STRING -%token TC_ENCAPSULATED_STRING -%token BRACK -%token SECTION -%token CFG_TRUE -%token CFG_FALSE -%token TC_DOLLAR_CURLY -%left '|' '&' -%right '~' '!' - -%% - -statement_list: - statement_list statement - | /* empty */ -; - -statement: - TC_STRING '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val); -#endif - ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($3.value.str.val); - } - | TC_STRING BRACK '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s'[ ] = '%s'\n", $1.value.str.val, $4.value.str.val); -#endif - ZEND_INI_PARSER_CB(&$1, &$4, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($4.value.str.val); - } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | '\n' -; - - -string_or_value: - expr { $$ = $1; } - | CFG_TRUE { $$ = $1; } - | CFG_FALSE { $$ = $1; } - | var_string_list { $$ = $1; } - | '\n' { zend_ini_init_string(&$$); } - | /* empty */ { zend_ini_init_string(&$$); } -; - - -var_string_list: - var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); } - | /* empty */ { zend_ini_init_string(&$$); } -; - -cfg_var_ref: - TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); } -; - -expr: - constant_string { $$ = $1; } - | expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); } - | expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); } - | '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); } - | '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); } - | '(' expr ')' { $$ = $2; } -; - -constant_string: - TC_STRING { zend_ini_get_constant(&$$, &$1); } -; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h deleted file mode 100644 index 96c76a4779e43..0000000000000 --- a/Zend/zend_ini_scanner.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_INI_SCANNER_H -#define _ZEND_INI_SCANNER_H - -BEGIN_EXTERN_C() -int zend_ini_scanner_get_lineno(TSRMLS_D); -char *zend_ini_scanner_get_filename(TSRMLS_D); -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC); -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC); -int ini_lex(zval *ini_lval TSRMLS_DC); -END_EXTERN_C() - -#endif /* _ZEND_INI_SCANNER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l deleted file mode 100644 index 9fb3461c95a8c..0000000000000 --- a/Zend/zend_ini_scanner.l +++ /dev/null @@ -1,236 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -#include -#include "zend.h" -#include "zend_globals.h" -#include -#include "zend_ini_scanner.h" - -#undef YYSTYPE -#define YYSTYPE zval - -#define YY_DECL int ini_lex(zval *ini_lval TSRMLS_DC) - -/* Globals Macros */ -#define SCNG INI_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -ZEND_API zend_scanner_globals ini_scanner_globals; -#endif - -# define YY_INPUT(buf, result, max_size) \ - if ( ((result = zend_stream_read(yyin, buf, max_size TSRMLS_CC)) == 0) \ - && zend_stream_ferror( yyin TSRMLS_CC) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); - -static char *ini_filename; - -void init_ini_scanner(TSRMLS_D) -{ - SCNG(lineno)=1; -} - - -int zend_ini_scanner_get_lineno(TSRMLS_D) -{ - return SCNG(lineno); -} - - -char *zend_ini_scanner_get_filename(TSRMLS_D) -{ - return ini_filename; -} - - -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) -{ - if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) { - return FAILURE; - } - - init_ini_scanner(TSRMLS_C); - yyin = fh; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - ini_filename = fh->filename; - return SUCCESS; -} - - -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) -{ - zend_stream_close(fh); -} - -%} - -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyywrap -%option never-interactive - -%% - -[ ]*[\[][ ]*[\]][ ]* { - return BRACK; -} - -[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1", 1); - ini_lval->value.str.len = 1; - ini_lval->type = IS_STRING; - return CFG_TRUE; -} - - -[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("", 0); - ini_lval->value.str.len = 0; - ini_lval->type = IS_STRING; - return CFG_FALSE; -} - -[[][^\]\n]+[\]][ ]*{NEWLINE}? { - /* SECTION */ - - /* eat trailing ] and spaces */ - while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']' || yytext[yyleng-1]==' ')) { - yyleng--; - yytext[yyleng]=0; - } - - SCNG(lineno)++; - - /* eat leading [ */ - yytext++; - yyleng--; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return SECTION; -} - - -["][^"]*["] { - /* ENCAPSULATED TC_STRING */ - - /* eat trailing " */ - yytext[yyleng-1]=0; - - /* eat leading " */ - yytext++; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2); - ini_lval->value.str.len = yyleng - 2; - ini_lval->type = IS_STRING; - return TC_ENCAPSULATED_STRING; -} - -[&|~$(){}!] { - return yytext[0]; -} - -"${" { - return TC_DOLLAR_CURLY; -} - -"}" { - ini_lval->value.lval = (long) yytext[0]; - return yytext[0]; -} - -[^=\n\r\t;|&$~(){}!"\[]+ { - /* STRING */ - register int i; - - /* eat trailing whitespace */ - for (i=yyleng-1; i>=0; i--) { - if (yytext[i]==' ' || yytext[i]=='\t') { - yytext[i]=0; - yyleng--; - } else { - break; - } - } - /* eat leading whitespace */ - while (yytext[0]) { - if (yytext[0]==' ' || yytext[0]=='\t') { - yytext++; - yyleng--; - } else { - break; - } - } - if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return TC_STRING; - } else { - /* whitespace */ - } -} - -[=\n] { - if (yytext[0] == '\n') { - SCNG(lineno)++; - } - return yytext[0]; -} - -{NEWLINE} { - SCNG(lineno)++; - return '\n'; -} - -[;][^\r\n]*{NEWLINE}? { - /* comment */ - SCNG(lineno)++; - return '\n'; -} - -[ \t] { - /* eat whitespace */ -} - -. { -#if DEBUG - php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n", yylineno, yytext, yytext[0]); -#endif -} - -<> { - yy_delete_buffer(YY_CURRENT_BUFFER TSRMLS_CC); - yyterminate(); -} diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c deleted file mode 100755 index 9081df0ae787e..0000000000000 --- a/Zend/zend_interfaces.c +++ /dev/null @@ -1,577 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -ZEND_API zend_class_entry *zend_ce_traversable; -ZEND_API zend_class_entry *zend_ce_aggregate; -ZEND_API zend_class_entry *zend_ce_iterator; -ZEND_API zend_class_entry *zend_ce_arrayaccess; -ZEND_API zend_class_entry *zend_ce_serializable; - -/* {{{ zend_call_method - Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) -{ - int result; - zend_fcall_info fci; - zval z_fname; - zval *retval; - HashTable *function_table; - - zval **params[2]; - - params[0] = &arg1; - params[1] = &arg2; - - fci.size = sizeof(fci); - /*fci.function_table = NULL; will be read form zend_class_entry of object if needed */ - fci.object_pp = object_pp; - fci.function_name = &z_fname; - fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval; - fci.param_count = param_count; - fci.params = params; - fci.no_separation = 1; - fci.symbol_table = NULL; - - if (!fn_proxy && !obj_ce) { - /* no interest in caching and no information already present that is - * needed later inside zend_call_function. */ - ZVAL_STRINGL(&z_fname, function_name, function_name_len, 0); - fci.function_table = !object_pp ? EG(function_table) : NULL; - result = zend_call_function(&fci, NULL TSRMLS_CC); - } else { - zend_fcall_info_cache fcic; - - fcic.initialized = 1; - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - if (obj_ce) { - function_table = &obj_ce->function_table; - } else { - function_table = EG(function_table); - } - if (!fn_proxy || !*fn_proxy) { - if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { - /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %v%s%s", obj_ce ? (void*)obj_ce->name : EMPTY_STR, obj_ce ? "::" : "", function_name); - } - if (fn_proxy) { - *fn_proxy = fcic.function_handler; - } - } else { - fcic.function_handler = *fn_proxy; - } - fcic.calling_scope = obj_ce; - fcic.object_pp = object_pp; - result = zend_call_function(&fci, &fcic TSRMLS_CC); - } - if (result == FAILURE) { - /* error at c-level */ - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? (void*)obj_ce->name : EMPTY_STR, obj_ce ? "::" : "", function_name); - } - if (!retval_ptr_ptr) { - if (retval) { - zval_ptr_dtor(&retval); - } - return NULL; - } - return *retval_ptr_ptr; -} -/* }}} */ - -/* iterator interface, c-level functions used by engine */ - -/* {{{ zend_user_it_new_iterator */ -static zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - zval *retval; - - return zend_call_method_with_0_params(&object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); - -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -static void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - - if (iter->value) { - zval_ptr_dtor(&iter->value); - iter->value = NULL; - } -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zval_ptr_dtor(&object); - efree(iter); -} -/* }}} */ - -/* {{{ zend_user_it_valid */ -static int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) -{ - if (_iter) { - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *more; - int result; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); - if (more) { - result = i_zend_is_true(more); - zval_ptr_dtor(&more); - return result ? SUCCESS : FAILURE; - } - } - return FAILURE; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_data */ -static void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - if (!iter->value) { - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value); - } - *data = &iter->value; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_key_default */ -#if 0 -static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - *int_key = _iter->index; - return HASH_KEY_IS_LONG; -} -#endif -/* }}} */ - -/* {{{ zend_user_it_get_current_key */ -static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *retval; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval); - - if (!retval) { - *int_key = 0; - if (!EG(exception)) - { - zend_error(E_WARNING, "Nothing returned from %v::key()", iter->ce->name); - } - return HASH_KEY_IS_LONG; - } - switch (retval->type) { - default: - zend_error(E_WARNING, "Illegal type returned from %v::key()", iter->ce->name); - case IS_NULL: - *int_key = 0; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - - case IS_STRING: - *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *str_key_len = retval->value.str.len+1; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_STRING; - - case IS_BINARY: - *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *str_key_len = retval->value.str.len+1; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_BINARY; - - case IS_UNICODE: - *str_key = (char*)eustrndup(Z_USTRVAL_P(retval), Z_USTRLEN_P(retval)); - *str_key_len = retval->value.str.len+1; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_UNICODE; - - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: { - if (retval->type == IS_DOUBLE) { - *int_key = (long)retval->value.dval; - } else { - *int_key = retval->value.lval; - } - } - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - } -} -/* }}} */ - -/* {{{ zend_user_it_move_forward */ -static void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL); -} -/* }}} */ - -/* {{{ zend_user_it_rewind */ -static void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL); -} -/* }}} */ - -zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { - zend_user_it_dtor, - zend_user_it_valid, - zend_user_it_get_current_data, - zend_user_it_get_current_key, - zend_user_it_move_forward, - zend_user_it_rewind, - zend_user_it_invalidate_current -}; - -/* {{{ zend_user_it_get_iterator */ -static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - zend_user_iterator *iterator = emalloc(sizeof(zend_user_iterator)); - - object->refcount++; - iterator->it.data = (void*)object; - iterator->it.funcs = ce->iterator_funcs.funcs; - iterator->ce = Z_OBJCE_P(object); - iterator->value = NULL; - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ zend_user_it_get_new_iterator */ -static zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - zval *iterator = zend_user_it_new_iterator(ce, object TSRMLS_CC); - zend_object_iterator *new_iterator; - - zend_class_entry *ce_it = iterator && Z_TYPE_P(iterator) == IS_OBJECT ? Z_OBJCE_P(iterator) : NULL; - - if (!ce || !ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) { - if (!EG(exception)) - { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %v::getIterator() must be traversable or implement interface Iterator", ce->name); - } - if (iterator) - { - zval_ptr_dtor(&iterator); - } - return NULL; - } - new_iterator = ce_it->get_iterator(ce_it, iterator TSRMLS_CC); - zval_ptr_dtor(&iterator); - return new_iterator; -} -/* }}} */ - -/* {{{ zend_implement_traversable */ -static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - /* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ - zend_uint i; - - if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) { - return SUCCESS; - } - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_aggregate) || class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_iterator)) { - return SUCCESS; - } - } - zend_error(E_CORE_ERROR, "Class %v must implement interface %s as part of either %s or %s", - class_type->name, - zend_ce_traversable->name, - zend_ce_iterator->name, - zend_ce_aggregate->name); - return FAILURE; -} -/* }}} */ - -/* {{{ zend_implement_aggregate */ -static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - int i, t = -1; - - if (class_type->get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed (exception being only Traversable is implmented) */ - if (class_type->num_interfaces) { - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_iterator)) { - return FAILURE; - } - if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_traversable)) { - t = i; - } - } - } - if (t == -1) { - return FAILURE; - } - } - } - class_type->iterator_funcs.zf_new_iterator = NULL; - class_type->get_iterator = zend_user_it_get_new_iterator; - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_iterator */ -static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has the necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed */ - return FAILURE; - } - } - class_type->get_iterator = zend_user_it_get_iterator; - class_type->iterator_funcs.zf_valid = NULL; - class_type->iterator_funcs.zf_current = NULL; - class_type->iterator_funcs.zf_key = NULL; - class_type->iterator_funcs.zf_next = NULL; - class_type->iterator_funcs.zf_rewind = NULL; - if (!class_type->iterator_funcs.funcs) { - class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_arrayaccess */ -static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ -#if 0 - /* get ht from ce */ - if (ht->read_dimension != zend_std_read_dimension - || ht->write_dimension != zend_std_write_dimension - || ht->has_dimension != zend_std_has_dimension - || ht->unset_dimension != zend_std_unset_dimension) { - return FAILURE; - } -#endif - return SUCCESS; -} -/* }}}*/ - -/* {{{ zend_user_serialize */ -int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) -{ - zend_class_entry * ce = Z_OBJCE_P(object); - zval *retval; - int result; - - zend_call_method_with_0_params(&object, ce, &ce->serialize_func, "serialize", &retval); - - - if (!retval || EG(exception)) { - result = FAILURE; - } else { - switch(Z_TYPE_P(retval)) { - case IS_NULL: - /* we could also make this '*buf_len = 0' but this allows to skip variables */ - zval_ptr_dtor(&retval); - return FAILURE; - case IS_STRING: - *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *buf_len = Z_STRLEN_P(retval); - result = SUCCESS; - break; - case IS_UNICODE: - *buffer = (char*)eustrndup(Z_USTRVAL_P(retval), Z_USTRLEN_P(retval)); - *buf_len = Z_USTRLEN_P(retval); - result = SUCCESS; - break; - default: /* failure */ - result = FAILURE; - break; - } - zval_ptr_dtor(&retval); - } - - if (result == FAILURE) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%v::serialize() must return a string or NULL", ce->name); - } - return result; -} -/* }}} */ - -/* {{{ zend_user_unserialize */ -int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) -{ - zval * zdata; - - object_init_ex(*object, ce); - - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1); - - zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata); - - zval_ptr_dtor(&zdata); - - if (EG(exception)) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ zend_implement_serializable */ -static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if ((class_type->serialize && class_type->serialize != zend_user_serialize) - || (class_type->unserialize && class_type->unserialize != zend_user_unserialize) - ) { - return FAILURE; - } - class_type->serialize = zend_user_serialize; - class_type->unserialize = zend_user_unserialize; - return SUCCESS; -} -/* }}}*/ - -/* {{{ function tables */ -zend_function_entry zend_funcs_aggregate[] = { - ZEND_ABSTRACT_ME(iterator, getIterator, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry zend_funcs_iterator[] = { - ZEND_ABSTRACT_ME(iterator, current, NULL) - ZEND_ABSTRACT_ME(iterator, next, NULL) - ZEND_ABSTRACT_ME(iterator, key, NULL) - ZEND_ABSTRACT_ME(iterator, valid, NULL) - ZEND_ABSTRACT_ME(iterator, rewind, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry *zend_funcs_traversable = NULL; - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset, 0, 0, 1) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this should be return by ref but atm cannot be */ - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -zend_function_entry zend_funcs_arrayaccess[] = { - ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset) - ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) - ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) - ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) - ZEND_ARG_INFO(0, serialized) -ZEND_END_ARG_INFO(); - -zend_function_entry zend_funcs_serializable[] = { - ZEND_ABSTRACT_ME(serializable, serialize, NULL) - ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define REGISTER_ITERATOR_INTERFACE(class_name, class_name_str) \ - {\ - zend_class_entry ce;\ - INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \ - zend_ce_ ## class_name = zend_register_internal_interface(&ce TSRMLS_CC);\ - zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\ - } - -#define REGISTER_ITERATOR_IMPLEMENT(class_name, interface_name) \ - zend_class_implements(zend_ce_ ## class_name TSRMLS_CC, 1, zend_ce_ ## interface_name) - -/* {{{ zend_register_interfaces */ -ZEND_API void zend_register_interfaces(TSRMLS_D) -{ - REGISTER_ITERATOR_INTERFACE(traversable, Traversable); - - REGISTER_ITERATOR_INTERFACE(aggregate, IteratorAggregate); - REGISTER_ITERATOR_IMPLEMENT(aggregate, traversable); - - REGISTER_ITERATOR_INTERFACE(iterator, Iterator); - REGISTER_ITERATOR_IMPLEMENT(iterator, traversable); - - REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess); - - REGISTER_ITERATOR_INTERFACE(serializable, Serializable) -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h deleted file mode 100755 index f2ebdbac3755e..0000000000000 --- a/Zend/zend_interfaces.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INTERFACES_H -#define ZEND_INTERFACES_H - -#include "zend.h" -#include "zend_API.h" - -BEGIN_EXTERN_C() - -extern ZEND_API zend_class_entry *zend_ce_traversable; -extern ZEND_API zend_class_entry *zend_ce_aggregate; -extern ZEND_API zend_class_entry *zend_ce_iterator; -extern ZEND_API zend_class_entry *zend_ce_arrayaccess; -extern ZEND_API zend_class_entry *zend_ce_serializable; - -typedef struct _zend_user_iterator { - zend_object_iterator it; - zend_class_entry *ce; - zval *value; -} zend_user_iterator; - -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); - -#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC) - -#define zend_call_method_with_1_params(obj, obj_ce, fn_proxy, function_name, retval, arg1) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 1, arg1, NULL TSRMLS_CC) - -#define zend_call_method_with_2_params(obj, obj_ce, fn_proxy, function_name, retval, arg1, arg2) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 2, arg1, arg2 TSRMLS_CC) - -ZEND_API void zend_register_interfaces(TSRMLS_D); - -END_EXTERN_C() - -#endif /* ZEND_INTERFACES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h deleted file mode 100644 index 0fe905fb2ac06..0000000000000 --- a/Zend/zend_istdiostream.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_STDIOSTREAM -#define _ZEND_STDIOSTREAM - -#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM) -class istdiostream : public istream -{ -private: - stdiobuf _file; -public: - istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); } - stdiobuf* rdbuf()/* const */ { return &_file; } -}; -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c deleted file mode 100755 index 2f76cac6ead3d..0000000000000 --- a/Zend/zend_iterators.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" - -static zend_class_entry zend_iterator_class_entry; - -static zend_object_handlers iterator_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - NULL, /* prop read */ - NULL, /* prop write */ - NULL, /* read dim */ - NULL, /* write dim */ - NULL, - NULL, /* get */ - NULL, /* set */ - NULL, /* has prop */ - NULL, /* unset prop */ - NULL, /* has dim */ - NULL, /* unset dim */ - NULL, /* props get */ - NULL, /* method get */ - NULL, /* call */ - NULL, /* get ctor */ - NULL, /* get_ce */ - NULL, /* get class name */ - NULL, /* compare */ - NULL, /* cast */ - NULL /* count */ -}; - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D) -{ - INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL); - free(zend_iterator_class_entry.name); - zend_iterator_class_entry.name = "__iterator_wrapper"; -} - -static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - zend_object_iterator *iter = (zend_object_iterator*)object; - iter->funcs->dtor(iter TSRMLS_CC); -} - -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC) -{ - zval *wrapped; - - MAKE_STD_ZVAL(wrapped); - Z_TYPE_P(wrapped) = IS_OBJECT; - wrapped->value.obj.handle = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC); - wrapped->value.obj.handlers = &iterator_object_handlers; - - return wrapped; -} - -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap( - zval *array_ptr, zend_object_iterator **iter TSRMLS_DC) -{ - switch (Z_TYPE_P(array_ptr)) { - case IS_OBJECT: - if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) { - *iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC); - return ZEND_ITER_OBJECT; - } - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_OBJECT; - } - return ZEND_ITER_INVALID; - - - case IS_ARRAY: - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_ARRAY; - } - return ZEND_ITER_INVALID; - - default: - return ZEND_ITER_INVALID; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h deleted file mode 100755 index f136c841f2d28..0000000000000 --- a/Zend/zend_iterators.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* These iterators were designed to operate within the foreach() - * structures provided by the engine, but could be extended for use - * with other iterative engine opcodes. - * These methods have similar semantics to the zend_hash API functions - * with similar names. - * */ - -typedef struct _zend_object_iterator zend_object_iterator; - -typedef struct _zend_object_iterator_funcs { - /* release all resources associated with this iterator instance */ - void (*dtor)(zend_object_iterator *iter TSRMLS_DC); - - /* check for end of iteration (FAILURE or SUCCESS if data is valid) */ - int (*valid)(zend_object_iterator *iter TSRMLS_DC); - - /* fetch the item data for the current element */ - void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC); - - /* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */ - int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); - - /* step forwards to next element */ - void (*move_forward)(zend_object_iterator *iter TSRMLS_DC); - - /* rewind to start of data (optional, may be NULL) */ - void (*rewind)(zend_object_iterator *iter TSRMLS_DC); - - /* invalidate current value/key (optional, may be NULL) */ - void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC); -} zend_object_iterator_funcs; - -struct _zend_object_iterator { - void *data; - zend_object_iterator_funcs *funcs; - ulong index; /* private to fe_reset/fe_fetch opcodes */ -}; - -typedef zval *(*zend_object_new_iterator_t)(zend_class_entry *ce, zval *object TSRMLS_DC); - -typedef struct _zend_class_iterator_funcs { - zend_object_iterator_funcs *funcs; - zend_object_new_iterator_t new_iterator; - union _zend_function *zf_new_iterator; - union _zend_function *zf_valid; - union _zend_function *zf_current; - union _zend_function *zf_key; - union _zend_function *zf_next; - union _zend_function *zf_rewind; -} zend_class_iterator_funcs; - -enum zend_object_iterator_kind { - ZEND_ITER_INVALID, - ZEND_ITER_PLAIN_ARRAY, - ZEND_ITER_PLAIN_OBJECT, - ZEND_ITER_OBJECT -}; - -BEGIN_EXTERN_C() -/* given a zval, returns stuff that can be used to iterate it. */ -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC); - -/* given an iterator, wrap it up as a zval for use by the engine opcodes */ -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC); - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D); -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y deleted file mode 100644 index a996378133c7a..0000000000000 --- a/Zend/zend_language_parser.y +++ /dev/null @@ -1,937 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * LALR shift/reduce conflicts and how they are resolved: - * - * - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift. - * - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift. - * - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift. - * - */ - - -#include "zend_compile.h" -#include "zend.h" -#include "zend_list.h" -#include "zend_globals.h" -#include "zend_API.h" -#include "zend_constants.h" - - -#define YYERROR_VERBOSE -#define YYSTYPE znode -#ifdef ZTS -# define YYPARSE_PARAM tsrm_ls -# define YYLEX_PARAM tsrm_ls -#endif - - -%} - -%pure_parser -%expect 4 - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL -%left '?' ':' -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_UNICODE_CAST T_BINARY_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_FUNCTION -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_THROW -%token T_USE -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_INTERFACE -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CLASS_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_DOC_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_BINARY_DOUBLE -%token T_BINARY_HEREDOC - -%% /* Rules */ - -start: - top_statement_list -; - -top_statement_list: - top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -top_statement: - statement - | function_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | class_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | T_HALT_COMPILER '(' ')' ';' { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); YYACCEPT; } -; - - -inner_statement_list: - inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -inner_statement: - statement - | function_declaration_statement - | class_declaration_statement - | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } -; - - -statement: - unticked_statement { zend_do_ticks(TSRMLS_C); } -; - -unticked_statement: - '{' inner_statement_list '}' - | T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } statement { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } elseif_list else_single { zend_do_if_end(TSRMLS_C); } - | T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(TSRMLS_C); } - | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); } - | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); } - | T_FOR - '(' - for_expr - ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); } - for_expr - ';' { zend_do_extended_info(TSRMLS_C); zend_do_for_cond(&$6, &$7 TSRMLS_CC); } - for_expr - ')' { zend_do_free(&$9 TSRMLS_CC); zend_do_for_before_statement(&$4, &$7 TSRMLS_CC); } - for_statement { zend_do_for_end(&$7 TSRMLS_CC); } - | T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 TSRMLS_CC); } switch_case_list { zend_do_switch_end(&$6 TSRMLS_CC); } - | T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL TSRMLS_CC); } - | T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 TSRMLS_CC); } - | T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL TSRMLS_CC); } - | T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 TSRMLS_CC); } - | T_RETURN ';' { zend_do_return(NULL, 0 TSRMLS_CC); } - | T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 TSRMLS_CC); } - | T_RETURN variable ';' { zend_do_return(&$2, 1 TSRMLS_CC); } - | T_GLOBAL global_var_list ';' - | T_STATIC static_var_list ';' - | T_ECHO echo_expr_list ';' - | T_INLINE_HTML { zend_do_echo(&$1, 1 TSRMLS_CC); } - | expr ';' { zend_do_free(&$1 TSRMLS_CC); } - | T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); } - | T_UNSET '(' unset_variables ')' ';' - | T_FOREACH '(' variable { zend_do_foreach_begin(&$1, &$2, &$3, 1 TSRMLS_CC); } T_AS - { zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); } - foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); } - | T_FOREACH '(' expr_without_variable { zend_do_foreach_begin(&$1, &$2, &$3, 0 TSRMLS_CC); } T_AS - { zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); } - variable foreach_optional_arg ')' { zend_check_writable_variable(&$7); zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); } - | T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); } - | ';' /* empty statement */ - | T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}' - T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); } - fully_qualified_class_name { zend_do_first_catch(&$7 TSRMLS_CC); } - T_VARIABLE ')' { zend_do_begin_catch(&$1, &$9, &$11, 1 TSRMLS_CC); } - '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } - additional_catches { zend_do_mark_last_catch(&$7, &$18 TSRMLS_CC); } - | T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); } -; - - -additional_catches: - non_empty_additional_catches { $$ = $1; } - | /* empty */ { $$.u.opline_num = -1; } -; - -non_empty_additional_catches: - additional_catch { $$ = $1; } - | non_empty_additional_catches additional_catch { $$ = $2; } -; - - -additional_catch: - T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } -; - - -unset_variables: - unset_variable - | unset_variables ',' unset_variable -; - -unset_variable: - variable { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1 TSRMLS_CC); } -; - -use_filename: - T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; } -; - - -function_declaration_statement: - unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - -class_declaration_statement: - unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - - -is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } -; - - -unticked_function_declaration_statement: - T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type, NULL TSRMLS_CC); } - '(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } -; - -unticked_class_declaration_statement: - class_entry_type T_STRING extends_from - { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); } - implements_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } - | interface_entry T_STRING - { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } - interface_extends_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } -; - - -class_entry_type: - T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = 0; } - | T_ABSTRACT T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; } - | T_FINAL T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_FINAL_CLASS; } -; - -extends_from: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_EXTENDS fully_qualified_class_name { $$ = $2; } -; - -interface_entry: - T_INTERFACE { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_INTERFACE; } -; - -interface_extends_list: - /* empty */ - | T_EXTENDS interface_list -; - -implements_list: - /* empty */ - | T_IMPLEMENTS interface_list -; - -interface_list: - fully_qualified_class_name { zend_do_implements_interface(&$1 TSRMLS_CC); } - | interface_list ',' fully_qualified_class_name { zend_do_implements_interface(&$3 TSRMLS_CC); } -; - -foreach_optional_arg: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_DOUBLE_ARROW foreach_variable { $$ = $2; } -; - - -foreach_variable: - variable { zend_check_writable_variable(&$1); $$ = $1; } - | '&' variable { zend_check_writable_variable(&$2); $$ = $2; $$.u.EA.type |= ZEND_PARSED_REFERENCE_VARIABLE; } -; - -for_statement: - statement - | ':' inner_statement_list T_ENDFOR ';' -; - - -foreach_statement: - statement - | ':' inner_statement_list T_ENDFOREACH ';' -; - - -declare_statement: - statement - | ':' inner_statement_list T_ENDDECLARE ';' -; - - -declare_list: - T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 TSRMLS_CC); } - | declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 TSRMLS_CC); } -; - - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - - -case_list: - /* empty */ { $$.op_type = IS_UNUSED; } - | case_list T_CASE expr case_separator { zend_do_extended_info(TSRMLS_C); zend_do_case_before_statement(&$1, &$2, &$3 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } - | case_list T_DEFAULT case_separator { zend_do_extended_info(TSRMLS_C); zend_do_default_before_statement(&$1, &$2 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } -; - - -case_separator: - ':' - | ';' -; - - -while_statement: - statement - | ':' inner_statement_list T_ENDWHILE ';' -; - - - -elseif_list: - /* empty */ - | elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } statement { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -new_elseif_list: - /* empty */ - | new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -else_single: - /* empty */ - | T_ELSE statement -; - - -new_else_single: - /* empty */ - | T_ELSE ':' inner_statement_list -; - - -parameter_list: - non_empty_parameter_list - | /* empty */ -; - - -non_empty_parameter_list: - optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$2, 0 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, &$1, &$2, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$4, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$7, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, &$3, &$4, 0 TSRMLS_CC); } -; - - -optional_class_type: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_STRING { $$ = $1; } - | T_ARRAY { $$.op_type = IS_CONST; $$.u.constant.type=IS_NULL;} -; - - -function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } - | /* empty */ { $$.u.constant.value.lval = 0; } -; - - -non_empty_function_call_parameter_list: - expr_without_variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval TSRMLS_CC); } - | variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval TSRMLS_CC); } - | '&' w_variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' '&' w_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval TSRMLS_CC); } -; - -global_var_list: - global_var_list ',' global_var { zend_do_fetch_global_variable(&$3, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } - | global_var { zend_do_fetch_global_variable(&$1, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } -; - - -global_var: - T_VARIABLE { $$ = $1; } - | '$' r_variable { zend_do_normalization(&$$, &$2 TSRMLS_CC); } - | '$' '{' expr '}' { zend_do_normalization(&$$, &$3 TSRMLS_CC); } -; - - -static_var_list: - static_var_list ',' T_VARIABLE { zend_do_fetch_static_variable(&$3, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE { zend_do_fetch_static_variable(&$1, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); } - -; - - -class_statement_list: - class_statement_list class_statement - | /* empty */ -; - - -class_statement: - variable_modifiers { CG(access_type) = $1.u.constant.value.lval; } class_variable_declaration ';' - | class_constant_declaration ';' - | method_modifiers T_FUNCTION { $2.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1, $4.op_type, &$1 TSRMLS_CC); } '(' - parameter_list ')' method_body { zend_do_abstract_method(&$5, &$1, &$10 TSRMLS_CC); zend_do_end_function_declaration(&$2 TSRMLS_CC); } -; - - -method_body: - ';' /* abstract method */ { $$.u.constant.value.lval = ZEND_ACC_ABSTRACT; } - | '{' inner_statement_list '}' { $$.u.constant.value.lval = 0; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { zend_error(E_STRICT, "var: Deprecated. Please use the public/private/protected modifiers"); $$.u.constant.value.lval = ZEND_ACC_PUBLIC; } -; - -method_modifiers: - /* empty */ { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; } - | non_empty_member_modifiers { $$ = $1; if (!($$.u.constant.value.lval & ZEND_ACC_PPP_MASK)) { $$.u.constant.value.lval |= ZEND_ACC_PUBLIC; } } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $$.u.constant.value.lval = zend_do_verify_access_types(&$1, &$2); } -; - -member_modifier: - T_PUBLIC { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; } - | T_PROTECTED { $$.u.constant.value.lval = ZEND_ACC_PROTECTED; } - | T_PRIVATE { $$.u.constant.value.lval = ZEND_ACC_PRIVATE; } - | T_STATIC { $$.u.constant.value.lval = ZEND_ACC_STATIC; } - | T_ABSTRACT { $$.u.constant.value.lval = ZEND_ACC_ABSTRACT; } - | T_FINAL { $$.u.constant.value.lval = ZEND_ACC_FINAL; } -; - -class_variable_declaration: - class_variable_declaration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, CG(access_type) TSRMLS_CC); } - | class_variable_declaration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5, CG(access_type) TSRMLS_CC); } - | T_VARIABLE { zend_do_declare_property(&$1, NULL, CG(access_type) TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3, CG(access_type) TSRMLS_CC); } -; - -class_constant_declaration: - class_constant_declaration ',' T_STRING '=' static_scalar { zend_do_declare_class_constant(&$3, &$5 TSRMLS_CC); } - | T_CONST T_STRING '=' static_scalar { zend_do_declare_class_constant(&$2, &$4 TSRMLS_CC); } -; - -echo_expr_list: - echo_expr_list ',' expr { zend_do_echo(&$3, 0 TSRMLS_CC); } - | expr { zend_do_echo(&$1, 0 TSRMLS_CC); } -; - - -for_expr: - /* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; } - | non_empty_for_expr { $$ = $1; } -; - -non_empty_for_expr: - non_empty_for_expr ',' { zend_do_free(&$1 TSRMLS_CC); } expr { $$ = $4; } - | expr { $$ = $1; } -; - -expr_without_variable: - T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); } - | variable '=' expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); } - | variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); } - | variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); } - | T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); } - | variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MUL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_DIV_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_CONCAT_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MOD_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_AND_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_OR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_XOR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 TSRMLS_CC); } - | rw_variable T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC TSRMLS_CC); } - | T_INC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC TSRMLS_CC); } - | rw_variable T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC TSRMLS_CC); } - | T_DEC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC TSRMLS_CC); } - | expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '.' expr { zend_do_binary_op(ZEND_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); } - | '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } - | '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } - | '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); } - | '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); } - | expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_INSTANCEOF class_name_reference { zend_do_instanceof(&$$, &$1, &$3, 0 TSRMLS_CC); } - | '(' expr ')' { $$ = $2; } - | expr '?' { zend_do_begin_qm_op(&$1, &$2 TSRMLS_CC); } - expr ':' { zend_do_qm_true(&$4, &$2, &$5 TSRMLS_CC); } - expr { zend_do_qm_false(&$$, &$7, &$2, &$5 TSRMLS_CC); } - | internal_functions_in_yacc { $$ = $1; } - | T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); } - | T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); } - | T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); } - | T_UNICODE_CAST expr { zend_do_cast(&$$, &$2, IS_UNICODE TSRMLS_CC); } - | T_BINARY_CAST expr { zend_do_cast(&$$, &$2, UG(unicode)?IS_BINARY:IS_STRING TSRMLS_CC); } - | T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); } - | T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); } - | T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); } - | T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); } - | T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); } - | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; } - | scalar { $$ = $1; } - | T_ARRAY '(' array_pair_list ')' { $$ = $3; } - | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); } - | T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); } -; - -function_call: - T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); } - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} -; - -fully_qualified_class_name: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - -class_name_reference: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } - | dynamic_class_name_reference { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - - -dynamic_class_name_reference: - base_variable T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } dynamic_class_name_variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_MEMBER; } - | base_variable { $$ = $1; } -; - - -dynamic_class_name_variable_properties: - dynamic_class_name_variable_properties dynamic_class_name_variable_property - | /* empty */ -; - - -dynamic_class_name_variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } -; - -exit_expr: - /* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' expr ')' { $$ = $2; } -; - - -ctor_arguments: - /* empty */ { $$.u.constant.value.lval=0; } - | '(' function_call_parameter_list ')' { $$ = $2; } -; - - -common_scalar: - T_LNUMBER { $$ = $1; } - | T_DNUMBER { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | T_LINE { $$ = $1; } - | T_FILE { $$ = $1; } - | T_CLASS_C { $$ = $1; } - | T_METHOD_C { $$ = $1; } - | T_FUNC_C { $$ = $1; } -; - - -static_scalar: /* compile-time evaluated scalars */ - common_scalar { $$ = $1; } - | T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $2; } - | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; } - | static_class_constant { $$ = $1; } -; - -static_class_constant: - T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT TSRMLS_CC); } -; - -scalar: - T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT TSRMLS_CC); } - | T_STRING_VARNAME { $$ = $1; } - | class_constant { $$ = $1; } - | common_scalar { $$ = $1; } - | '"' { CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; } encaps_list '"' { $$ = $3; } - | T_START_HEREDOC { CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; } encaps_list T_END_HEREDOC { $$ = $3; zend_do_end_heredoc(TSRMLS_C); } - | T_BINARY_DOUBLE { CG(literal_type) = UG(unicode)?IS_BINARY:IS_STRING; } encaps_list '"' { $$ = $3; } - | T_BINARY_HEREDOC { CG(literal_type) = UG(unicode)?IS_BINARY:IS_STRING; } encaps_list T_END_HEREDOC { $$ = $3; zend_do_end_heredoc(TSRMLS_C); } -; - - -static_array_pair_list: - /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); } - | non_empty_static_array_pair_list possible_comma { $$ = $1; } -; - -possible_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); } - | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); } - | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); } - | static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); } -; - -expr: - r_variable { $$ = $1; } - | expr_without_variable { $$ = $1; } -; - - -r_variable: - variable { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); $$ = $1; } -; - - -w_variable: - variable { zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$1); } -; - -rw_variable: - variable { zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$1); } -; - -variable: - base_variable_with_function_calls T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); } method_or_not variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = $1.u.EA.type | ($7.u.EA.type ? $7.u.EA.type : $6.u.EA.type); } - | base_variable_with_function_calls { $$ = $1; } -; - -variable_properties: - variable_properties variable_property { $$.u.EA.type = $2.u.EA.type; } - | /* empty */ { $$.u.EA.type = 0; } -; - - -variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.u.EA.type = $4.u.EA.type; } -; - -method_or_not: - '(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); - zend_do_push_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_METHOD_CALL; } - | /* empty */ { zend_do_declare_implicit_property(TSRMLS_C); $$.u.EA.type = ZEND_PARSED_MEMBER; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); } -; - -static_member: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = $3; zend_do_fetch_static_member(&$$, &$1 TSRMLS_CC); } -; - - -base_variable_with_function_calls: - base_variable { $$ = $1; } - | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.u.EA.type = ZEND_PARSED_FUNCTION_CALL; } -; - - -base_variable: - reference_variable { $$ = $1; $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | static_member { $$ = $1; $$.u.EA.type = ZEND_PARSED_STATIC_MEMBER; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | compound_variable { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -compound_variable: - T_VARIABLE { $$ = $1; } - | '$' '{' expr '}' { zend_do_normalization(&$$, &$3 TSRMLS_CC); } -; - -dim_offset: - /* empty */ { $$.op_type = IS_UNUSED; } - | expr { $$ = $1; } -; - - -object_property: - object_dim_list { $$ = $1; } - | variable_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -object_dim_list: - object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -variable_name: - T_STRING { $$ = $1; } - | '{' expr '}' { zend_do_normalization(&$$, &$2 TSRMLS_CC); } -; - -simple_indirect_reference: - '$' { $$.u.constant.value.lval = 1; } - | simple_indirect_reference '$' { $$.u.constant.value.lval++; } -; - -assignment_list: - assignment_list ',' assignment_list_element - | assignment_list_element -; - - -assignment_list_element: - variable { zend_do_add_list_element(&$1 TSRMLS_CC); } - | T_LIST '(' { zend_do_new_list_begin(TSRMLS_C); } assignment_list ')' { zend_do_new_list_end(TSRMLS_C); } - | /* empty */ { zend_do_add_list_element(NULL TSRMLS_CC); } -; - - -array_pair_list: - /* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list possible_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 TSRMLS_CC); } - | expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 TSRMLS_CC); } - | expr { zend_do_init_array(&$$, &$1, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { zend_do_add_array_element(&$$, &$6, &$3, 1 TSRMLS_CC); } - | non_empty_array_pair_list ',' '&' w_variable { zend_do_add_array_element(&$$, &$4, NULL, 1 TSRMLS_CC); } - | expr T_DOUBLE_ARROW '&' w_variable { zend_do_init_array(&$$, &$4, &$1, 1 TSRMLS_CC); } - | '&' w_variable { zend_do_init_array(&$$, &$2, NULL, 1 TSRMLS_CC); } -; - -encaps_list: - encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_add_variable(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_NUM_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_CHARACTER { zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_BAD_CHARACTER { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '[' { $2.u.constant.value.lval = (long) '['; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list ']' { $2.u.constant.value.lval = (long) ']'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '{' { $2.u.constant.value.lval = (long) '{'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '}' { $2.u.constant.value.lval = (long) '}'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 TSRMLS_CC); $2.u.constant.value.lval = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 TSRMLS_CC); } - | /* empty */ { zend_do_init_string(&$$ TSRMLS_CC); } - -; - - - -encaps_var: - T_VARIABLE { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } - | T_VARIABLE '[' { zend_do_begin_variable_parse(TSRMLS_C); } encaps_var_offset ']' { fetch_array_begin(&$$, &$1, &$4 TSRMLS_CC); } - | T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$2, &$1, 1 TSRMLS_CC); zend_do_fetch_property(&$$, &$2, &$3 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$2, 1 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_begin(&$$, &$2, &$4 TSRMLS_CC); } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - - -encaps_var_offset: - T_STRING { $$ = $1; } - | T_NUM_STRING { $$ = $1; } - | T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -internal_functions_in_yacc: - T_ISSET '(' isset_variables ')' { $$ = $3; } - | T_EMPTY '(' variable ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); } - | T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); } - | T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); } - | T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); } - | T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 TSRMLS_CC); } - | T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 TSRMLS_CC); } -; - -isset_variables: - variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } variable { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 TSRMLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 TSRMLS_CC); } -; - -class_constant: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_RT TSRMLS_CC); } -; - -%% - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h deleted file mode 100644 index 40813e1237b6b..0000000000000 --- a/Zend/zend_language_scanner.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_SCANNER_H -#define ZEND_SCANNER_H - -typedef struct _zend_lex_state { - YY_BUFFER_STATE buffer_state; - int state; - zend_file_handle *in; - uint lineno; - char *filename; - char *script_encoding; - - UConverter *input_conv; /* converter for flex input */ - UConverter *output_conv; /* converter for data from flex output */ - zend_bool encoding_checked; - char* rest_str; - int rest_len; -} zend_lex_state; - - -void zend_fatal_scanner_error(char *); -BEGIN_EXTERN_C() -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2); -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l deleted file mode 100644 index 80bff7f552609..0000000000000 --- a/Zend/zend_language_scanner.l +++ /dev/null @@ -1,2499 +0,0 @@ -%{ - -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -%} - -%x ST_IN_SCRIPTING -%x ST_DOUBLE_QUOTES -%x ST_BACKQUOTE -%x ST_HEREDOC -%x ST_LOOKING_FOR_PROPERTY -%x ST_LOOKING_FOR_VARNAME -%x ST_COMMENT -%x ST_DOC_COMMENT -%x ST_ONE_LINE_COMMENT -%option stack - -%{ - -#include -#include "zend.h" -#include "zend_alloc.h" -#include -#include "zend_compile.h" -#include "zend_language_scanner.h" -#include "zend_highlight.h" -#include "zend_constants.h" -#include "zend_variables.h" -#include "zend_operators.h" -#include "zend_API.h" -#include "zend_strtod.h" -#include "zend_unicode.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#define YY_DECL int lex_scan(zval *zendlval TSRMLS_DC) - -#define ECHO { ZEND_WRITE( yytext, yyleng ); } - -#ifdef ZTS -# define MY_INPUT yyinput -#else -# define MY_INPUT input -#endif - - -/* Globals Macros */ -#define SCNG LANG_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id language_scanner_globals_id; -#else -ZEND_API zend_scanner_globals language_scanner_globals; -#endif - -#define YY_INPUT(buf, result, max_size) \ - if ( ((result = zend_unicode_yyinput(yyin, buf, max_size TSRMLS_CC)) == 0) \ - && zend_stream_ferror( yyin TSRMLS_CC) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); - -#define YY_FATAL_ERROR zend_fatal_scanner_error - -#define HANDLE_NEWLINES(s, l) \ -do { \ - char *p = (s), *boundary = p+(l); \ - \ - while (p='0' && (c)<='7') -#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F')) - - -void zend_fatal_scanner_error(char *message) -{ - zend_error(E_COMPILE_ERROR, "%s", message); -} - -BEGIN_EXTERN_C() -void startup_scanner(TSRMLS_D) -{ - CG(heredoc) = NULL; - CG(heredoc_len) = 0; - CG(doc_comment) = NULL; - CG(doc_comment_len) = 0; - SCNG(yy_start_stack_ptr) = 0; - SCNG(yy_start_stack_depth) = 0; - SCNG(current_buffer) = NULL; - - SCNG(input_conv) = NULL; - SCNG(output_conv) = NULL; - SCNG(encoding_checked) = 0; - SCNG(rest_str) = NULL; - SCNG(rest_len) = 0; -} - - -void shutdown_scanner(TSRMLS_D) -{ - if (CG(heredoc)) { - efree(CG(heredoc)); - CG(heredoc_len)=0; - } - if (SCNG(yy_start_stack)) { - yy_flex_free(SCNG(yy_start_stack)); - SCNG(yy_start_stack) = NULL; - } - RESET_DOC_COMMENT(); - - if (SCNG(input_conv)) { - ucnv_close(SCNG(input_conv)); - SCNG(input_conv) = NULL; - } - if (SCNG(output_conv)) { - ucnv_close(SCNG(output_conv)); - SCNG(output_conv) = NULL; - } - SCNG(encoding_checked) = 0; - if (SCNG(rest_str)) { - efree(SCNG(rest_str)); - SCNG(rest_str) = NULL; - } - SCNG(rest_len) = 0; -} -END_EXTERN_C() - - -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE)); - lex_state->in = SCNG(yy_in); - lex_state->state = YYSTATE; - lex_state->filename = zend_get_compiled_filename(TSRMLS_C); - lex_state->lineno = CG(zend_lineno); - - lex_state->input_conv = SCNG(input_conv); - lex_state->output_conv = SCNG(output_conv); - lex_state->encoding_checked = SCNG(encoding_checked); - lex_state->rest_str = SCNG(rest_str); - lex_state->rest_len = SCNG(rest_len); - SCNG(input_conv) = NULL; - SCNG(output_conv) = NULL; - SCNG(encoding_checked) = 0; - SCNG(rest_str) = NULL; - SCNG(rest_len) = 0; -} - -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - YY_BUFFER_STATE original_buffer_state = YY_CURRENT_BUFFER; - - if (lex_state->buffer_state) { - yy_switch_to_buffer(lex_state->buffer_state TSRMLS_CC); - } else { - YY_CURRENT_BUFFER = NULL; - } - - yy_delete_buffer(original_buffer_state TSRMLS_CC); - SCNG(yy_in) = lex_state->in; - BEGIN(lex_state->state); - CG(zend_lineno) = lex_state->lineno; - zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); - zend_restore_compiled_script_encoding(lex_state->script_encoding TSRMLS_CC); - - if (SCNG(input_conv)) { - ucnv_close(SCNG(input_conv)); - } - SCNG(input_conv) = lex_state->input_conv; - if (SCNG(output_conv)) { - ucnv_close(SCNG(output_conv)); - } - SCNG(output_conv) = lex_state->output_conv; - SCNG(encoding_checked) = lex_state->encoding_checked; - if (SCNG(rest_str)) { - efree(SCNG(rest_str)); - } - SCNG(rest_str) = lex_state->rest_str; - SCNG(rest_len) = lex_state->rest_len; -} - - -BEGIN_EXTERN_C() - - -ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) -{ - TSRMLS_FETCH(); - - switch (fh->type) { - case ZEND_HANDLE_FP: - fclose(fh->handle.fp); - break; - case ZEND_HANDLE_STREAM: - if (fh->handle.stream.closer) { - fh->handle.stream.closer(fh->handle.stream.handle TSRMLS_CC); - } - break; - case ZEND_HANDLE_FILENAME: - /* We're only supposed to get here when destructing the used_files hash, - * which doesn't really contain open files, but references to their names/paths - */ - break; - } - if (fh->opened_path) { - efree(fh->opened_path); - fh->opened_path = NULL; - } - if (fh->free_filename && fh->filename) { - efree(fh->filename); - fh->filename = NULL; - } -} - - -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2) -{ - if (fh1->type != fh2->type) { - return 0; - } - switch (fh1->type) { - case ZEND_HANDLE_FP: - return fh1->handle.fp==fh2->handle.fp; - break; - case ZEND_HANDLE_STREAM: - return fh1->handle.stream.handle == fh2->handle.stream.handle; - break; - } - return 0; -} - - -ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) -{ - zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles); -} - -/* Convert one octal digit to a numeric value 0..7, or -1 on failure */ -static inline int8_t zend_get_octal_digit(UChar c) { - if (c >= 0x0030 && c <= 0x0037) { - return (int8_t)(c - 0x0030); - } - return -1; -} - -/* - * Convert one hex digit to a numeric value 0..F, or -1 on failure. - * Borrowed from ICU. - */ -static inline int8_t zend_get_hex_digit(UChar c) { - if (c >= 0x0030 && c <= 0x0039) { - return (int8_t)(c - 0x0030); - } - if (c >= 0x0041 && c <= 0x0046) { - return (int8_t)(c - (0x0041 - 10)); - } - if (c >= 0x0061 && c <= 0x0066) { - return (int8_t)(c - (0x0061 - 10)); - } - return -1; -} - -static inline zend_bool zend_digits_to_codepoint(char *s, char *end, UChar32 *c, int8_t digits) -{ - int8_t n = 0; - int8_t digit = 0; - UChar32 codepoint = 0; - - while (s < end && n < digits) { - digit = zend_get_hex_digit((UChar)*s); - if (digit < 0) { - break; - } - codepoint = (codepoint << 4) | digit; - ++s; - ++n; - } - - if (n < digits) { - return 0; - } - - *c = codepoint; - return 1; -} - -static inline zend_bool zend_udigits_to_codepoint(UChar *s, UChar *end, UChar32 *c, int8_t digits) -{ - int8_t n = 0; - int8_t digit = 0; - UChar32 codepoint = 0; - - while (s < end && n < digits) { - digit = zend_get_hex_digit(*s); - if (digit < 0) { - break; - } - codepoint = (codepoint << 4) | digit; - ++s; - ++n; - } - - if (n < digits) { - return 0; - } - - *c = codepoint; - return 1; -} - -static inline int zend_uchar_from_name(char *name, UChar32 *c) -{ - UChar32 codepoint = 0; - UErrorCode status = U_ZERO_ERROR; - - codepoint = u_charFromName(U_UNICODE_CHAR_NAME, name, &status); - if (U_SUCCESS(status)) { - *c = codepoint; - return 1; - } else { - return 0; - } -} - -static inline int zend_uchar_from_uname(UChar *name, int32_t name_len, UChar32 *c) -{ - UChar32 codepoint = 0; - UErrorCode status = U_ZERO_ERROR; - char buf[128]; - - u_UCharsToChars(name, buf, name_len); - buf[name_len] = 0; - codepoint = u_charFromName(U_UNICODE_CHAR_NAME, buf, &status); - if (U_SUCCESS(status)) { - *c = codepoint; - return 1; - } else { - return 0; - } -} - -static inline int zend_parse_charname_sequence(UChar **s, UChar *end, UChar32 *c) -{ - UChar *start; - - if (**s == '{') { - start = ++(*s); - while ((*s)++ != end) { - if (**s == '}') { - if (zend_uchar_from_uname(start, *s - start, c)) { - return 1; - } else { - /* safe, since *s points to '}' */ - **s = 0; - zend_error(E_COMPILE_WARNING, "Invalid Unicode character name: '%r'", start); - break; - } - } - } - } - - return 0; -} - -static inline int zend_copy_string_value(zval *zendlval, char *str, zend_uint str_len, zend_uchar type TSRMLS_DC) -{ - UErrorCode status = U_ZERO_ERROR; - int32_t consumed = 0; - - if (type == IS_UNICODE) { - consumed = zend_convert_scanner_output(&zendlval->value.ustr.val, &zendlval->value.ustr.len, str, str_len, &status TSRMLS_CC); - - if (U_FAILURE(status)) { - zend_error(E_COMPILE_WARNING,"Illegal or truncated character in input: offset %d, state=%d", consumed, YYSTATE); - efree(zendlval->value.ustr.val); - return 0; - } - zendlval->type = IS_UNICODE; - } else { - zendlval->value.str.val = (char *)estrndup(str, str_len); - zendlval->value.str.len = str_len; - zendlval->type = type; - } - - return 1; -} - -static inline int zend_check_and_normalize_identifier(zval *zendlval) -{ - UChar *norm; - int32_t norm_len; - - if (!zend_is_valid_identifier(Z_USTRVAL_P(zendlval), Z_USTRLEN_P(zendlval))) { - zend_error(E_COMPILE_WARNING, "Invalid identifier syntax: %r", Z_USTRVAL_P(zendlval)); - efree(Z_USTRVAL_P(zendlval)); - return 0; - } - if (!zend_normalize_identifier(&norm, &norm_len, Z_USTRVAL_P(zendlval), Z_USTRLEN_P(zendlval), 0)) { - zend_error(E_COMPILE_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(zendlval)); - efree(Z_USTRVAL_P(zendlval)); - return 0; - } - if (norm != Z_USTRVAL_P(zendlval)) { - efree(Z_USTRVAL_P(zendlval)); - ZVAL_UNICODEL(zendlval, norm, norm_len, 0); - } - return 1; -} - -static void zend_scanner_output_callback( - const void *context, - UConverterToUnicodeArgs *toUArgs, - const char *codeUnits, - int32_t length, - UConverterCallbackReason reason, - UErrorCode *err - ) -{ - if (*err == U_TRUNCATED_CHAR_FOUND || - *err == U_ILLEGAL_CHAR_FOUND || - *err == U_INVALID_CHAR_FOUND) { - *(const char **)context = toUArgs->source - length; - } - - return; -} - -static int is_encoding_flex_compatible(const char *enc TSRMLS_DC) -{ - int key_len = strlen(enc)+1; - unsigned char ret; - unsigned char *ret_ptr; - - if (zend_hash_find(&UG(flex_compatible), (char*)enc, key_len, (void**)&ret_ptr) == SUCCESS) { - return *ret_ptr; - } else { - UErrorCode status = U_ZERO_ERROR; - UConverter *conv = ucnv_open(enc, &status); - - if (U_FAILURE(status)) { - return 0; - } - - switch (ucnv_getType(conv)) { - case UCNV_DBCS: - case UCNV_UTF16_BigEndian: - case UCNV_UTF16_LittleEndian: - case UCNV_UTF32_BigEndian: - case UCNV_UTF32_LittleEndian: - case UCNV_EBCDIC_STATEFUL: - case UCNV_ISO_2022: - case UCNV_LMBCS_1: - case UCNV_LMBCS_2: - case UCNV_LMBCS_3: - case UCNV_LMBCS_4: - case UCNV_LMBCS_5: - case UCNV_LMBCS_6: - case UCNV_LMBCS_8: - case UCNV_LMBCS_11: - case UCNV_LMBCS_16: - case UCNV_LMBCS_17: - case UCNV_LMBCS_18: - case UCNV_LMBCS_19: - case UCNV_HZ: - case UCNV_SCSU: - case UCNV_UTF7: - case UCNV_BOCU1: - case UCNV_UTF16: - case UCNV_UTF32: - case UCNV_IMAP_MAILBOX: - ret = 0; - break; - case UCNV_LATIN_1: - case UCNV_UTF8: - case UCNV_ISCII: - case UCNV_US_ASCII: - case UCNV_CESU8: - ret = 1; - break; - default: { - static const UChar ascii[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E - }; - static const char expected[] = - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" - "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F" - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F" - "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F" - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F" - "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F" - "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F" - "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E"; - char output[sizeof(expected)]; - - if (ucnv_fromUChars(conv, - output, sizeof(output), - ascii, sizeof(expected), - &status) != sizeof(expected) || - U_FAILURE(status)) { - ret = 0; - } else { - ret = (memcmp(expected, output, sizeof(expected)) == 0); - } - } - } - ucnv_close(conv); - - zend_hash_add(&UG(flex_compatible), (char*)enc, key_len, (void**)&ret, sizeof(ret), NULL); - - return ret; - } -} - -ZEND_API int zend_prepare_scanner_converters(const char *onetime_encoding, int run_time TSRMLS_DC) -{ - const char *encoding = NULL; - - if (SCNG(input_conv)) { - /* Script is already converted to UTF-8 */ - return zend_set_converter_encoding(&SCNG(output_conv), "UTF-8"); - } else { - encoding = onetime_encoding; - } - - /* We need to convert the input stream only if script_encoding is not ASCII compatible */ - if (!is_encoding_flex_compatible(encoding TSRMLS_CC)) { - if (zend_set_converter_encoding(&SCNG(input_conv), encoding) == FAILURE) { - return FAILURE; - } - if (run_time) { - /* Convert rest of the buffer to unicode.runtime_encoding. */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - int offset, length, size; - const char *src, *old_src; - char rt_buf[8192]; - char *target = rt_buf; - UErrorCode status = U_ZERO_ERROR; - - old_src = src = yy_c_buf_p; - offset = yy_c_buf_p - b->yy_ch_buf; - length = b->yy_n_chars - offset; - size = b->yy_buf_size - offset; - - ucnv_convertEx(UG(utf8_conv), - SCNG(input_conv), - &target, rt_buf+size-2, - &src, src+length, - NULL, NULL, NULL, NULL, - TRUE, TRUE, - &status); - - if (src - old_src < length) { - /* Cannot fit into buffer. Schedule for next read. */ - SCNG(rest_len) = length - (src - old_src); - SCNG(rest_str) = emalloc(SCNG(rest_len)); - memcpy(SCNG(rest_str), src, SCNG(rest_len)); - } - length = target - rt_buf; - memcpy(yy_c_buf_p, rt_buf, length); - SCNG(yy_n_chars) = b->yy_n_chars = length + offset; - b->yy_ch_buf[b->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[b->yy_n_chars+1] = YY_END_OF_BUFFER_CHAR; - } - encoding = "UTF-8"; - } - return zend_set_converter_encoding(&SCNG(output_conv), encoding); -} - -ZEND_API int32_t zend_convert_scanner_output(UChar **target, int32_t *target_len, const char *source, int32_t source_len, UErrorCode *status TSRMLS_DC) -{ - const char *source_consumed = NULL; - - /* set our custom callback with context */ - ucnv_setToUCallBack(SCNG(output_conv), zend_scanner_output_callback, &source_consumed, NULL, NULL, status); - - /* reset the error and perform conversion */ - *status = U_ZERO_ERROR; - zend_convert_to_unicode(SCNG(output_conv), target, target_len, source, source_len, status); - - /* figure out how many source bytes were consumed */ - if (U_SUCCESS(*status)) { - return source_len; - } else if (source_consumed) { - return source_consumed - source; - } else { - return 0; - } -} - -int zend_unicode_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - size_t n; - int c = '*'; - const char *src = buf; - - /* Look of we have rest from previous call */ - if (SCNG(rest_str)) { - if (len >= SCNG(rest_len)) { - memcpy(buf, SCNG(rest_str), SCNG(rest_len)); - efree(SCNG(rest_str)); - SCNG(rest_str) = NULL; - n = SCNG(rest_len); - SCNG(rest_len) = 0; - } else { - memcpy(buf, SCNG(rest_str), len); - memcpy(SCNG(rest_str), SCNG(rest_str)+len, SCNG(rest_len)-len); - n = len; - SCNG(rest_len) -= len; - } - } else { - if (file_handle->handle.stream.interactive) { - for (n = 0; n < sizeof(buf) && (c = zend_stream_getc(yyin TSRMLS_CC)) != EOF && c != '\n'; ++n) { - buf[n] = (char)c; - } - if (c == '\n') { - buf[n++] = (char) c; - } - } else { - n = zend_stream_read(file_handle, buf, len TSRMLS_CC); - } - } - - /* Don't make any conversions if unicode=off */ - if (!UG(unicode)) { - return n; - } - - /* Autodetect encoding */ - if (!SCNG(encoding_checked)) { - int32_t signatureLength; - UErrorCode status = U_ZERO_ERROR; - const char *encoding; - - encoding = ucnv_detectUnicodeSignature(buf, n, &signatureLength, &status); - if (encoding && U_SUCCESS(status)) { - src += signatureLength; - n -= signatureLength; - if (is_encoding_flex_compatible(encoding TSRMLS_CC)) { - if (SCNG(input_conv)) { - ucnv_close(SCNG(input_conv)); - SCNG(input_conv) = NULL; - } - zend_set_converter_encoding(&SCNG(output_conv), encoding); - if (signatureLength > 0) { - memcpy(buf, src, n); - } - } else { - zend_set_converter_encoding(&SCNG(input_conv), encoding); - zend_set_converter_encoding(&SCNG(output_conv), "UTF-8"); - } - } - status = U_ZERO_ERROR; - SCNG(encoding_checked) = 1; - } - - if (SCNG(input_conv) && n >= 0) { - UErrorCode status = U_ZERO_ERROR; - char rt_buf[8192]; - char *target = rt_buf; - const char *old_src = src; - - ucnv_convertEx(UG(utf8_conv), - SCNG(input_conv), - &target, rt_buf+len, - &src, src+n, - NULL, NULL, NULL, NULL, - TRUE, TRUE, - &status); - if (src - old_src < n) { - /* Cannot fit into buffer. Schedule for next read. */ - SCNG(rest_len) = n - (src - old_src); - SCNG(rest_str) = emalloc(SCNG(rest_len)); - memcpy(SCNG(rest_str), src, SCNG(rest_len)); - } - n = target - rt_buf; - memcpy(buf, rt_buf, n); - } - return n; -} - -ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) -{ - char *file_path=NULL; - UErrorCode status = U_ZERO_ERROR; - - if (FAILURE == zend_stream_fixup(file_handle TSRMLS_CC)) { - return FAILURE; - } - - zend_llist_add_element(&CG(open_files), file_handle); - - /* Reset the scanner for scanning the new file */ - SCNG(yy_in) = file_handle; - - zend_prepare_scanner_converters(ucnv_getName(ZEND_U_CONVERTER(UG(script_encoding_conv)), &status), 0 TSRMLS_CC); - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - - BEGIN(INITIAL); - - if (file_handle->opened_path) { - file_path = file_handle->opened_path; - } else { - file_path = file_handle->filename; - } - - zend_set_compiled_filename(file_path TSRMLS_CC); - zend_set_compiled_script_encoding((char*)ucnv_getName(SCNG(output_conv), &status) TSRMLS_CC); - - if (CG(start_lineno)) { - CG(zend_lineno) = CG(start_lineno); - CG(start_lineno) = 0; - } else { - CG(zend_lineno) = 1; - } - - CG(increment_lineno) = 0; - return SUCCESS; -} -END_EXTERN_C() - - -ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval=NULL; - int compiler_result; - zend_bool compilation_successful=0; - znode retval_znode; - zend_bool original_in_compilation = CG(in_compilation); - - retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - retval_znode.u.constant.is_ref = 0; - retval_znode.u.constant.refcount = 1; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - retval = op_array; /* success oriented */ - - if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { - if (type==ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); - zend_bailout(); - } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); - } - compilation_successful=0; - } else { - init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(in_compilation) = 1; - CG(active_op_array) = op_array; - compiler_result = zendparse(TSRMLS_C); - zend_do_return(&retval_znode, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(in_compilation) = original_in_compilation; - if (compiler_result==1) { /* parser error */ - zend_bailout(); - } - compilation_successful=1; - } - - if (retval) { - CG(active_op_array) = original_active_op_array; - if (compilation_successful) { - pass_two(op_array TSRMLS_CC); - } else { - efree(op_array); - retval = NULL; - } - } - if (compilation_successful) { - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - return retval; -} - - -zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) -{ - zend_file_handle file_handle; - zval tmp; - zend_op_array *retval; - char *opened_path = NULL; - - if (filename->type != IS_STRING) { - tmp = *filename; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - filename = &tmp; - } - file_handle.filename = filename->value.str.val; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - file_handle.handle.fp = NULL; - - retval = zend_compile_file(&file_handle, type TSRMLS_CC); - if (retval && file_handle.handle.stream.handle) { - int dummy = 1; - - if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); - } - - zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); - - if (opened_path) { - efree(opened_path); - } - } - zend_destroy_file_handle(&file_handle TSRMLS_CC); - - if (filename==&tmp) { - zval_dtor(&tmp); - } - return retval; -} - -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC) -{ - const char *encoding; - UErrorCode status = U_ZERO_ERROR; - - if (Z_TYPE_P(str) == IS_UNICODE) { - convert_to_string_with_converter(str, UG(utf8_conv)); - encoding = "UTF-8"; - } else { - UErrorCode status = U_ZERO_ERROR; - encoding = ucnv_getName(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &status); - } - - /* enforce two trailing NULLs for flex... */ - STR_REALLOC(str->value.str.val, str->value.str.len+2); - - str->value.str.val[str->value.str.len+1]=0; - - SCNG(yy_in)=NULL; - - zend_prepare_scanner_converters(encoding, 0 TSRMLS_CC); - yy_scan_buffer(str->value.str.val, str->value.str.len+2 TSRMLS_CC); - - zend_set_compiled_filename(filename TSRMLS_CC); - zend_set_compiled_script_encoding((char*)ucnv_getName(SCNG(output_conv), &status) TSRMLS_CC); - CG(zend_lineno) = 1; - CG(increment_lineno) = 0; - return SUCCESS; -} - - -ZEND_API int zend_get_scanned_file_offset(TSRMLS_D) -{ - if (yyin) { - int offset_in_buffer = (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf); - int read_bytes = SCNG(yy_n_chars); - int offset_from_the_end = read_bytes - offset_in_buffer; - - return zend_stream_ftell(yyin TSRMLS_CC) - offset_from_the_end; - } else { - return -1; - } -} - - -zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval; - zval tmp; - int compiler_result; - zend_bool original_in_compilation = CG(in_compilation); - - tmp = *source_string; - zval_copy_ctor(&tmp); - if (Z_TYPE(tmp) != IS_STRING && Z_TYPE(tmp) != IS_UNICODE) { - convert_to_text(&tmp); - } - source_string = &tmp; - - if (Z_USTRLEN_P(source_string)==0) { - efree(op_array); - zval_dtor(&tmp); - return NULL; - } - - CG(in_compilation) = 1; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) { - efree(op_array); - retval = NULL; - } else { - init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(active_op_array) = op_array; - BEGIN(ST_IN_SCRIPTING); - compiler_result = zendparse(TSRMLS_C); - - if (compiler_result==1) { - CG(active_op_array) = original_active_op_array; - CG(unclean_shutdown)=1; - retval = NULL; - } else { - zend_do_return(NULL, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(active_op_array) = original_active_op_array; - pass_two(op_array TSRMLS_CC); - retval = op_array; - } - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - zval_dtor(&tmp); - CG(in_compilation) = original_in_compilation; - return retval; -} - - -BEGIN_EXTERN_C() -int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) { - zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename); - return FAILURE; - } - zend_highlight(syntax_highlighter_ini TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - return SUCCESS; -} - -int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zval tmp = *str; - - str = &tmp; - zval_copy_ctor(str); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { - return FAILURE; - } - BEGIN(INITIAL); - zend_highlight(syntax_highlighter_ini TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(str); - return SUCCESS; -} -END_EXTERN_C() - -#define zend_copy_value(zendlval, yytext, yyleng) \ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; - -int zend_scan_unicode_double_string(zval *zendlval TSRMLS_DC) -{ - register UChar *s, *t, c; - UChar *end; - UChar32 codepoint = 0; - int8_t digit; - int8_t min_digits = 0, max_digits = 0; - int8_t bits; - int8_t n; - - HANDLE_NEWLINES(yytext, yyleng); - - if (!zend_copy_string_value(zendlval, yytext+1, yyleng-2, IS_UNICODE TSRMLS_CC)) { - return 0; - } - - /* convert escape sequences */ - s = t = zendlval->value.ustr.val; - end = s+zendlval->value.ustr.len; - while (s=end) { - continue; - } - - min_digits = 0; - codepoint = 0; - bits = 4; - n = 0; - - switch(c) { - case 0x6E: /*'n'*/ - *t++ = (UChar) 0x0A; /*'\n'*/ - zendlval->value.ustr.len--; - break; - case 0x72: /*'r'*/ - *t++ = (UChar) 0x0D; /*'\r'*/ - zendlval->value.ustr.len--; - break; - case 0x74: /*'t'*/ - *t++ = (UChar) 0x09; /*'\t'*/ - zendlval->value.ustr.len--; - break; - case 0x5C: /*'\\'*/ - case 0x24: /*'$'*/ - case 0x22: /*'"'*/ - *t++ = *s; - zendlval->value.ustr.len--; - break; - case 0x43: /*'C'*/ - { - UChar *p = s+1; - if (p < end && zend_parse_charname_sequence(&p, end, &codepoint)) { - zendlval->value.ustr.len -= p - s + 1; - s = p; - if (U_IS_BMP(codepoint)) { - *t++ = (UChar) codepoint; - } else { - *t++ = (UChar) U16_LEAD(codepoint); - *t++ = (UChar) U16_TRAIL(codepoint); - zendlval->value.ustr.len++; - } - } else { - zend_error(E_COMPILE_WARNING, "Invalid \\C{..} sequence"); - efree(zendlval->value.ustr.val); - return 0; - } - break; - } - case 0x75: /*'u'*/ - min_digits = 4; - max_digits = 4; - zendlval->value.ustr.len--; - break; - case 0x55: /*'U'*/ - min_digits = 6; - max_digits = 6; - zendlval->value.ustr.len--; - break; - default: - digit = zend_get_octal_digit(*s); - if (digit >= 0) { - min_digits = 1; - max_digits = 3; - bits = 3; - n = 1; /* already have one digit */ - codepoint = digit; - } else if (c == 0x78 /*'x'*/ - && (s+1) < end && (digit = zend_get_hex_digit(*(s+1))) >= 0) { - min_digits = 1; - max_digits = 2; - zendlval->value.ustr.len--; - s++; - n = 1; /* already have one digit */ - codepoint = digit; - } else { - *t++ = 0x5C; /*'\\'*/ - *t++ = *s; - } - break; - } - - /* need to parse a number for one of the escape sequences */ - if (min_digits != 0) { - while (s++ < end && n < max_digits) { - digit = (bits == 4) ? zend_get_hex_digit(*s) : zend_get_octal_digit(*s); - if (digit < 0) { - break; - } - codepoint = (codepoint << bits) | digit; - n++; - } - - if (n < min_digits) { - /* can only happen for \u and \U sequences */ - zend_error(E_COMPILE_WARNING,"\\%c escape sequence requires exactly %d hexadecimal digits", (char) c, min_digits); - efree(zendlval->value.ustr.val); - return 0; - } - - if (U_IS_BMP(codepoint)) { - *t++ = (UChar) codepoint; - zendlval->value.ustr.len -= n; - } else if (codepoint <= 0x10FFFF) { - *t++ = (UChar) U16_LEAD(codepoint); - *t++ = (UChar) U16_TRAIL(codepoint); - zendlval->value.ustr.len -= n-1; - } else { - zend_error(E_COMPILE_WARNING,"\\U%06x is above the highest valid codepoint 0x10FFFF", codepoint); - efree(zendlval->value.ustr.val); - return 0; - } - } else { - s++; - } - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - -int zend_scan_unicode_single_string(zval *zendlval TSRMLS_DC) -{ - register UChar *s, *t; - UChar *end; - UChar32 codepoint = 0; - - HANDLE_NEWLINES(yytext, yyleng); - - if (!zend_copy_string_value(zendlval, yytext+1, yyleng-2, IS_UNICODE TSRMLS_CC)) { - return 0; - } - - /* convert escape sequences */ - s = t = zendlval->value.ustr.val; - end = s+zendlval->value.ustr.len; - while (s=end) { - continue; - } - switch(*s) { - case 0x5C: /*'\\'*/ - case 0x27: /*'\''*/ - *t++ = *s; - zendlval->value.ustr.len--; - break; - case 0x43: /*'C'*/ - { - UChar *p = s+1; - if (p < end && zend_parse_charname_sequence(&p, end, &codepoint)) { - zendlval->value.ustr.len -= p - s + 1; - s = p; - if (U_IS_BMP(codepoint)) { - *t++ = (UChar) codepoint; - } else { - *t++ = (UChar) U16_LEAD(codepoint); - *t++ = (UChar) U16_TRAIL(codepoint); - zendlval->value.ustr.len++; - } - } else { - zend_error(E_COMPILE_WARNING, "Invalid \\C{..} sequence"); - efree(zendlval->value.ustr.val); - return 0; - } - break; - } - case 0x75 /*'u'*/: - { - codepoint = 0; - if (zend_udigits_to_codepoint(s+1, end, &codepoint, 4)) { - *t++ = (UChar) codepoint; - s += 4; - zendlval->value.ustr.len -= 5; - } else { - zend_error(E_COMPILE_WARNING,"\\u escape sequence requires exactly 4 hexadecimal digits"); - efree(zendlval->value.ustr.val); - return 0; - } - break; - } - case 0x55 /*'U'*/: - { - codepoint = 0; - if (zend_udigits_to_codepoint(s+1, end, &codepoint, 6)) { - if (U_IS_BMP(codepoint)) { - *t++ = (UChar) codepoint; - zendlval->value.ustr.len -= 7; - } else if (codepoint <= 0x10FFFF) { - *t++ = (UChar) U16_LEAD(codepoint); - *t++ = (UChar) U16_TRAIL(codepoint); - zendlval->value.ustr.len -= 6; - } else { - zend_error(E_COMPILE_WARNING,"\\U%06x is above the highest valid codepoint 0x10FFFF", codepoint); - efree(zendlval->value.ustr.val); - return 0; - } - s += 6; - } else { - zend_error(E_COMPILE_WARNING,"\\U escape sequence requires exactly 6 hexadecimal digits"); - efree(zendlval->value.ustr.val); - return 0; - } - break; - } - default: - *t++ = 0x5C; /*'\\'*/ - *t++ = *s; - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - -int zend_scan_binary_double_string(zval *zendlval TSRMLS_DC) -{ - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = UG(unicode) ? IS_BINARY : IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case 'n': - *t++ = '\n'; - zendlval->value.str.len--; - break; - case 'r': - *t++ = '\r'; - zendlval->value.str.len--; - break; - case 't': - *t++ = '\t'; - zendlval->value.str.len--; - break; - case '\\': - case '$': - case '"': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - /* check for an octal */ - if (ZEND_IS_OCT(*s)) { - char octal_buf[4] = { 0, 0, 0, 0 }; - - octal_buf[0] = *s; - zendlval->value.str.len--; - if ((s+1)value.str.len--; - if ((s+1)value.str.len--; - } - } - *t++ = (char) strtol(octal_buf, NULL, 8); - } else if (*s=='x' && (s+1)value.str.len--; /* for the 'x' */ - - hex_buf[0] = *(++s); - zendlval->value.str.len--; - if ((s+1)value.str.len--; - } - *t++ = (char) strtol(hex_buf, NULL, 16); - } else { - *t++ = '\\'; - *t++ = *s; - } - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - -int zend_scan_binary_single_string(zval *zendlval TSRMLS_DC) -{ - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = UG(unicode) ? IS_BINARY : IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case '\\': - case '\'': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - *t++ = '\\'; - *t++ = *s; - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - -%} - -LNUM [0-9]+ -DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*) -EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM}) -HNUM "0x"[0-9a-fA-F]+ -LABEL [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* -WHITESPACE [ \n\r\t]+ -TABS_AND_SPACES [ \t]* -TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@] -ENCAPSED_TOKENS [\[\]{}$] -ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+ -ANY_CHAR (.|[\n]) -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyylineno -%option noyywrap -%% - -"exit" { - return T_EXIT; -} - -"die" { - return T_EXIT; -} - -"function" { - return T_FUNCTION; -} - -"const" { - return T_CONST; -} - -"return" { - return T_RETURN; -} - -"try" { - return T_TRY; -} - -"catch" { - return T_CATCH; -} - -"throw" { - return T_THROW; -} - -"if" { - return T_IF; -} - -"elseif" { - return T_ELSEIF; -} - -"endif" { - return T_ENDIF; -} - -"else" { - return T_ELSE; -} - -"while" { - return T_WHILE; -} - -"endwhile" { - return T_ENDWHILE; -} - -"do" { - return T_DO; -} - -"for" { - return T_FOR; -} - -"endfor" { - return T_ENDFOR; -} - -"foreach" { - return T_FOREACH; -} - -"endforeach" { - return T_ENDFOREACH; -} - -"declare" { - return T_DECLARE; -} - -"enddeclare" { - return T_ENDDECLARE; -} - -"instanceof" { - return T_INSTANCEOF; -} - -"as" { - return T_AS; -} - -"switch" { - return T_SWITCH; -} - -"endswitch" { - return T_ENDSWITCH; -} - -"case" { - return T_CASE; -} - -"default" { - return T_DEFAULT; -} - -"break" { - return T_BREAK; -} - -"continue" { - return T_CONTINUE; -} - -"echo" { - return T_ECHO; -} - -"print" { - return T_PRINT; -} - -"class" { - return T_CLASS; -} - -"interface" { - return T_INTERFACE; -} - -"extends" { - return T_EXTENDS; -} - -"implements" { - return T_IMPLEMENTS; -} - -"->" { - yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); - return T_OBJECT_OPERATOR; -} - -{LABEL} { - yy_pop_state(TSRMLS_C); - if (!zend_copy_string_value(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING TSRMLS_CC)) { - return 0; - } - if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) { - return 0; - } - return T_STRING; -} - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); -} - -"::" { - return T_PAAMAYIM_NEKUDOTAYIM; -} - -"new" { - return T_NEW; -} - -"clone" { - return T_CLONE; -} - -"var" { - return T_VAR; -} - -"("{TABS_AND_SPACES}("int"|"integer"){TABS_AND_SPACES}")" { - return T_INT_CAST; -} - -"("{TABS_AND_SPACES}("real"|"double"|"float"){TABS_AND_SPACES}")" { - return T_DOUBLE_CAST; -} - -"("{TABS_AND_SPACES}"string"{TABS_AND_SPACES}")" { - return T_STRING_CAST; -} - -"("{TABS_AND_SPACES}"unicode"{TABS_AND_SPACES}")" { - return T_UNICODE_CAST; -} - -"("{TABS_AND_SPACES}"binary"{TABS_AND_SPACES}")" { - return T_BINARY_CAST; -} - -"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" { - return T_ARRAY_CAST; -} - -"("{TABS_AND_SPACES}"object"{TABS_AND_SPACES}")" { - return T_OBJECT_CAST; -} - -"("{TABS_AND_SPACES}("bool"|"boolean"){TABS_AND_SPACES}")" { - return T_BOOL_CAST; -} - -"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" { - return T_UNSET_CAST; -} - -"eval" { - return T_EVAL; -} - -"include" { - return T_INCLUDE; -} - -"include_once" { - return T_INCLUDE_ONCE; -} - -"require" { - return T_REQUIRE; -} - -"require_once" { - return T_REQUIRE_ONCE; -} - -"use" { - return T_USE; -} - -"global" { - return T_GLOBAL; -} - -"isset" { - return T_ISSET; -} - -"empty" { - return T_EMPTY; -} - -"__halt_compiler" { - return T_HALT_COMPILER; -} - -"static" { - return T_STATIC; -} - -"abstract" { - return T_ABSTRACT; -} - -"final" { - return T_FINAL; -} - -"private" { - return T_PRIVATE; -} - -"protected" { - return T_PROTECTED; -} - -"public" { - return T_PUBLIC; -} - -"unset" { - return T_UNSET; -} - -"=>" { - return T_DOUBLE_ARROW; -} - -"list" { - return T_LIST; -} - -"array" { - return T_ARRAY; -} - -"++" { - return T_INC; -} - -"--" { - return T_DEC; -} - -"===" { - return T_IS_IDENTICAL; -} - -"!==" { - return T_IS_NOT_IDENTICAL; -} - -"==" { - return T_IS_EQUAL; -} - -"!="|"<>" { - return T_IS_NOT_EQUAL; -} - -"<=" { - return T_IS_SMALLER_OR_EQUAL; -} - -">=" { - return T_IS_GREATER_OR_EQUAL; -} - -"+=" { - return T_PLUS_EQUAL; -} - -"-=" { - return T_MINUS_EQUAL; -} - -"*=" { - return T_MUL_EQUAL; -} - -"/=" { - return T_DIV_EQUAL; -} - -".=" { - return T_CONCAT_EQUAL; -} - -"%=" { - return T_MOD_EQUAL; -} - -"<<=" { - return T_SL_EQUAL; -} - -">>=" { - return T_SR_EQUAL; -} - -"&=" { - return T_AND_EQUAL; -} - -"|=" { - return T_OR_EQUAL; -} - -"^=" { - return T_XOR_EQUAL; -} - -"||" { - return T_BOOLEAN_OR; -} - -"&&" { - return T_BOOLEAN_AND; -} - -"OR" { - return T_LOGICAL_OR; -} - -"AND" { - return T_LOGICAL_AND; -} - -"XOR" { - return T_LOGICAL_XOR; -} - -"<<" { - return T_SL; -} - -">>" { - return T_SR; -} - -{TOKENS} { - return yytext[0]; -} - - -"{" { - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return '{'; -} - - -"${" { - yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); - return T_DOLLAR_OPEN_CURLY_BRACES; -} - - -"}" { - RESET_DOC_COMMENT(); - /* This is a temporary fix which is dependant on flex and it's implementation */ - if (yy_start_stack_ptr) { - yy_pop_state(TSRMLS_C); - } - return '}'; -} - - -{LABEL} { - if (!zend_copy_string_value(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING TSRMLS_CC)) { - return 0; - } - if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) { - return 0; - } - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return T_STRING_VARNAME; -} - - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); -} - - -{LNUM} { - errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); - if (errno == ERANGE) { /* overflow */ - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } else { - zendlval->type = IS_LONG; - return T_LNUMBER; - } -} - -{HNUM} { - errno = 0; - zendlval->value.lval = strtoul(yytext, NULL, 16); - if (errno == ERANGE) { /* overflow */ - /* not trying strtod - it returns trash on 0x-es */ - zendlval->value.lval = LONG_MAX; /* maximal long */ - zend_error(E_NOTICE,"Hex number is too big: %s", yytext); - } else { - if (zendlval->value.lval < 0) { - /* maintain consistency with the old way */ - zendlval->value.dval = (unsigned long) zendlval->value.lval; - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } - zendlval->type = IS_LONG; - } - zendlval->type = IS_LONG; - return T_LNUMBER; -} - -{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */ - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_NUM_STRING; -} - -{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; -} - -"__CLASS__" { - char *class_name = NULL; - - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - ZVAL_EMPTY_TEXT(zendlval); - } else { - ZVAL_TEXT(zendlval, class_name, 1); - } - return T_CLASS_C; -} - -"__FUNCTION__" { - char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; - } - if (!func_name) { - ZVAL_EMPTY_TEXT(zendlval); - } else { - ZVAL_TEXT(zendlval, func_name, 1); - } - return T_FUNC_C; -} - -"__METHOD__" { - char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; - char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; - size_t len = 0; - - if (UG(unicode)) { - size_t len1; - - if (class_name) { - len += len1 = u_strlen((UChar*)class_name); - len += 2; - } - if (func_name) { - len += u_strlen((UChar*)func_name); - } else { - func_name = (char*)EMPTY_STR; - } - zendlval->value.str.len = len; - Z_USTRVAL_P(zendlval) = eumalloc(len+1); - if (class_name) { - u_strcpy(Z_USTRVAL_P(zendlval), (UChar*)class_name); - Z_USTRVAL_P(zendlval)[len1] = 0x3a; /* ':' */ - Z_USTRVAL_P(zendlval)[len1+1] = 0x3a; /* ':' */ - Z_USTRVAL_P(zendlval)[len1+2] = 0; - } else { - Z_USTRVAL_P(zendlval)[0] = 0; - } - u_strcat(Z_USTRVAL_P(zendlval), (UChar*)func_name); - zendlval->type = IS_UNICODE; - } else { - if (class_name) { - len += strlen(class_name) + 2; - } - if (func_name) { - len += strlen(func_name); - } - - zendlval->value.str.val = emalloc(len+1); - zendlval->value.str.len = sprintf(zendlval->value.str.val, "%s%s%s", - class_name ? class_name : "", - class_name && func_name ? "::" : "", - func_name ? func_name : "" - ); - zendlval->value.str.len = strlen(zendlval->value.str.val); - zendlval->type = IS_STRING; - } - return T_METHOD_C; -} - -"__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; - return T_LINE; -} - -"__FILE__" { - char *filename = zend_get_compiled_filename(TSRMLS_C); - - if (!filename) { - filename = ""; - } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FILE; -} - -(([^<]|"<"[^?%s<]){1,400})|"value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_BINARY; - HANDLE_NEWLINES(yytext, yyleng); - return T_INLINE_HTML; -} - -"" { - HANDLE_NEWLINES(yytext, yyleng); - if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_BINARY; - return T_INLINE_HTML; - } -} - - -"<%="|"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG_WITH_ECHO; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_BINARY; - return T_INLINE_HTML; - } -} - - -"<%" { - if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_BINARY; - return T_INLINE_HTML; - } -} - - -"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINE(yytext[yyleng-1]); - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; -} - -"$"{LABEL} { - if (!zend_copy_string_value(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING TSRMLS_CC)) { - return 0; - } - if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) { - return 0; - } - return T_VARIABLE; -} - -{LABEL} { - if (!zend_copy_string_value(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING TSRMLS_CC)) { - return 0; - } - if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) { - return 0; - } - return T_STRING; -} - -{LABEL} { - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_STRING; -} - - -{WHITESPACE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_WHITESPACE; -} - - -"#"|"//" { - BEGIN(ST_ONE_LINE_COMMENT); - yymore(); -} - -"?"|"%"|">" { - yymore(); -} - -[^\n\r?%>]+ { - yymore(); -} - -{NEWLINE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - CG(zend_lineno)++; - return T_COMMENT; -} - -"?>"|"%>" { - if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - yyless(yyleng-2); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } else { - yymore(); - } -} - -"/**"{WHITESPACE} { - CG(comment_start_line) = CG(zend_lineno); - RESET_DOC_COMMENT(); - BEGIN(ST_DOC_COMMENT); - yymore(); -} - -"/*" { - CG(comment_start_line) = CG(zend_lineno); - BEGIN(ST_COMMENT); - yymore(); -} - - -[^*]+ { - yymore(); -} - -"*/" { - CG(doc_comment) = estrndup(yytext, yyleng); - CG(doc_comment_len) = yyleng; - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_DOC_COMMENT; -} - -"*/" { - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; -} - -"*" { - yymore(); -} - -("?>"|""){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ -} - - -"%>"{NEWLINE}? { - if (CG(asp_tags)) { - BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ - } else { - yyless(1); - return yytext[0]; - } -} - - -(["]([^$"\\]|("\\".))*["]) { - if (UG(unicode)) { - return zend_scan_unicode_double_string(zendlval TSRMLS_CC); - } else { - return zend_scan_binary_double_string(zendlval TSRMLS_CC); - } -} - - -(b["]([^$"\\]|("\\".))*["]) { - yytext++; /* adjust for 'b' */ - yyleng--; - return zend_scan_binary_double_string(zendlval TSRMLS_CC); -} - - -([']([^'\\]|("\\".))*[']) { - if (UG(unicode)) { - return zend_scan_unicode_single_string(zendlval TSRMLS_CC); - } else { - return zend_scan_binary_single_string(zendlval TSRMLS_CC); - } -} - - -("b'"([^'\\]|("\\".))*[']) { - yytext++; /* adjust for 'b' */ - yyleng--; - return zend_scan_binary_single_string(zendlval TSRMLS_CC); -} - - -["] { - BEGIN(ST_DOUBLE_QUOTES); - return '\"'; -} - -b["] { - BEGIN(ST_DOUBLE_QUOTES); - return T_BINARY_DOUBLE; -} - -b"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { - char *s; - CG(zend_lineno)++; - CG(heredoc_len) = yyleng-4-1-(yytext[yyleng-2]=='\r'?1:0); - s = yytext+4; - while ((*s == ' ') || (*s == '\t')) { - s++; - CG(heredoc_len)--; - } - CG(heredoc) = estrndup(s, CG(heredoc_len)); - BEGIN(ST_HEREDOC); - return T_BINARY_HEREDOC; -} - - -"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { - char *s; - CG(zend_lineno)++; - CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0); - s = yytext+3; - while ((*s == ' ') || (*s == '\t')) { - s++; - CG(heredoc_len)--; - } - CG(heredoc) = estrndup(s, CG(heredoc_len)); - BEGIN(ST_HEREDOC); - return T_START_HEREDOC; -} - - -[`] { - BEGIN(ST_BACKQUOTE); - return '`'; -} - - -^{LABEL}(";")?{NEWLINE} { - int label_len; - unsigned char unput_semicolon; - - CG(zend_lineno)++; - if (yytext[yyleng-2]=='\r') { - label_len = yyleng-2; - } else { - label_len = yyleng-1; - } - - if (yytext[label_len-1]==';') { - label_len--; - unput_semicolon=1; - } else{ - unput_semicolon=0; - } - - if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) { - zendlval->value.str.val = estrndup(yytext, label_len); /* unput destroys yytext */ - zendlval->value.str.len = label_len; - if (unput_semicolon) { - unput(';'); - } - efree(CG(heredoc)); - CG(heredoc)=NULL; - CG(heredoc_len)=0; - BEGIN(ST_IN_SCRIPTING); - return T_END_HEREDOC; - } else { - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_STRING; - } -} - - -{ESCAPED_AND_WHITESPACE} { - HANDLE_NEWLINES(yytext, yyleng); - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_ENCAPSED_AND_WHITESPACE; -} - -[`]+ { - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_ENCAPSED_AND_WHITESPACE; -} - - -["]+ { - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_ENCAPSED_AND_WHITESPACE; -} - - -"$"[^a-zA-Z_\x7f-\xff{] { - zendlval->value.lval = (long) yytext[0]; - if (yyleng == 2) { - yyless(1); - } - return T_CHARACTER; -} - - -{ENCAPSED_TOKENS} { - zendlval->value.lval = (long) yytext[0]; - return yytext[0]; -} - -"{$" { - zendlval->value.lval = (long) yytext[0]; - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); - return T_CURLY_OPEN; -} - - -"\\\"" { - zendlval->value.lval = (long) '"'; - return T_CHARACTER; -} - -"\\`" { - zendlval->value.lval = (long) '`'; - return T_CHARACTER; -} - -"\\"[0-7]{1,3} { - zendlval->value.lval = strtol(yytext+1, NULL, 8); - return T_CHARACTER; -} - -"\\x"[0-9A-Fa-f]{1,2} { - zendlval->value.lval = strtol (yytext+2, NULL, 16); - return T_CHARACTER; -} - - -"\\u"[0-9A-Fa-f]{0,6} { - UChar32 codepoint; - int req_digits = (yytext[1] == 'U') ? 6 : 4; - - if (CG(literal_type) == IS_UNICODE) { - if (zend_digits_to_codepoint(yytext+2, yytext+yyleng, &codepoint, req_digits)) { - if (codepoint <= 0x10FFFF) { - zendlval->value.lval = (long) codepoint; - /* give back if we grabbed more than needed for \u case */ - if (yyleng > req_digits + 2) { - yyless(req_digits + 2); - } - return T_CHARACTER; - } else { - zend_error(E_COMPILE_WARNING,"\\U%06x is above the highest valid codepoint 0x10FFFF", codepoint); - return 0; - } - } else { - zend_error(E_COMPILE_WARNING,"\\%c escape sequence requires exactly %d hexadecimal digits", yytext[1], req_digits); - return 0; - } - } else { - zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC); - return T_STRING; - } -} - - -"\\C"("{"[A-Z0-9 -]+"}")? { - UChar32 codepoint; - - if (CG(literal_type) == IS_UNICODE && (yytext[1] == 'C')) { - /* minimum valid string is \C{.} */ - if (yyleng >= 5) { - /* safe, since we have } at the end */ - yytext[yyleng-1] = 0; - if (zend_uchar_from_name(yytext+3, &codepoint)) { - zendlval->value.lval = (long) codepoint; - return T_CHARACTER; - } else { - zend_error(E_COMPILE_WARNING, "Invalid Unicode character name: '%s'", yytext+3); - return 0; - } - } else { - zend_error(E_COMPILE_WARNING, "Invalid \\C{..} sequence"); - return 0; - } - } else { - zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC); - return T_STRING; - } -} - - -"\\{$" { - if (!zend_copy_string_value(zendlval, yytext+1, yyleng-1, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_STRING; -} - -"\\"{ANY_CHAR} { - switch (yytext[1]) { - case 'n': - zendlval->value.lval = (long) '\n'; - break; - case 't': - zendlval->value.lval = (long) '\t'; - break; - case 'r': - zendlval->value.lval = (long) '\r'; - break; - case '\\': - zendlval->value.lval = (long) '\\'; - break; - case '$': - zendlval->value.lval = (long) yytext[1]; - break; - default: - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_BAD_CHARACTER; - break; - } - return T_CHARACTER; -} - - -["'`]+ { - if (!zend_copy_string_value(zendlval, yytext, yyleng, CG(literal_type) TSRMLS_CC)) { - return 0; - } - return T_ENCAPSED_AND_WHITESPACE; -} - - -["] { - BEGIN(ST_IN_SCRIPTING); - return '\"'; -} - - -[`] { - BEGIN(ST_IN_SCRIPTING); - return '`'; -} - - -<> { - return 0; -} - -<> { - zend_error(E_COMPILE_WARNING,"Unterminated comment starting line %d", CG(comment_start_line)); - return 0; -} - - - -{ANY_CHAR} { - zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); -} diff --git a/Zend/zend_list.c b/Zend/zend_list.c deleted file mode 100644 index b77f83bb5c956..0000000000000 --- a/Zend/zend_list.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* resource lists */ - -#include "zend.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_globals.h" - -ZEND_API int le_index_ptr; - -/* true global */ -static HashTable list_destructors; - - -ZEND_API int zend_list_insert(void *ptr, int type) -{ - int index; - zend_rsrc_list_entry le; - TSRMLS_FETCH(); - - le.ptr=ptr; - le.type=type; - le.refcount=1; - - index = zend_hash_next_free_element(&EG(regular_list)); - - zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL); - return index; -} - -ZEND_API int _zend_list_delete(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */ - if (--le->refcount<=0) { - return zend_hash_index_del(&EG(regular_list), id); - } else { - return SUCCESS; - } - } else { - return FAILURE; - } -} - - -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { - *type = le->type; - return le->ptr; - } else { - *type = -1; - return NULL; - } -} - -ZEND_API int _zend_list_addref(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */ - le->refcount++; - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type) -{ - int rsrc_id; - - rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type); - - if (rsrc_result) { - rsrc_result->value.lval = rsrc_id; - rsrc_result->type = IS_RESOURCE; - } - - return rsrc_id; -} - - -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...) -{ - int id; - int actual_resource_type; - void *resource; - va_list resource_types; - int i; - char *space; - char *class_name; - - if (default_id==-1) { /* use id */ - if (!passed_id) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } else if ((*passed_id)->type != IS_RESOURCE) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } - id = (*passed_id)->value.lval; - } else { - id = default_id; - } - - resource = zend_list_find(id, &actual_resource_type); - if (!resource) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name); - } - return NULL; - } - - va_start(resource_types, num_resource_types); - for (i=0; itype, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->list_dtor) { - (ld->list_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->list_dtor_ex) { - ld->list_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type); - } -} - - -void plist_entry_destructor(void *ptr) -{ - zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr; - zend_rsrc_list_dtors_entry *ld; - TSRMLS_FETCH(); - - if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->plist_dtor) { - (ld->plist_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->plist_dtor_ex) { - ld->plist_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type); - } -} - - -int zend_init_rsrc_list(TSRMLS_D) -{ - if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) { - EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */ - return SUCCESS; - } else { - return FAILURE; - } -} - - -int zend_init_rsrc_plist(TSRMLS_D) -{ - return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0); -} - - -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC) -{ - zend_hash_graceful_reverse_destroy(ht); -} - -static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC) -{ - if (le->type == *resource_id) { - return 1; - } else { - return 0; - } -} - - -static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC) -{ - if (ld->module_number == *module_number) { - zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - return 1; - } else { - return 0; - } -} - - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC); -} - - -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor=(void (*)(void *)) ld; - lde.plist_dtor=(void (*)(void *)) pld; - lde.list_dtor_ex = lde.plist_dtor_ex = NULL; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_STD; - lde.type_name = NULL; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - - -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor = NULL; - lde.plist_dtor = NULL; - lde.list_dtor_ex = ld; - lde.plist_dtor_ex = pld; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_EX; - lde.type_name = type_name; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - -ZEND_API int zend_fetch_list_dtor_id(char *type_name) -{ - zend_rsrc_list_dtors_entry *lde; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(&list_destructors, &pos); - while (zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) { - if (lde->type_name && (strcmp(type_name, lde->type_name) == 0)) { -#if 0 - printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name); -#endif - return lde->resource_id; - } - zend_hash_move_forward_ex(&list_destructors, &pos); - } - - return 0; -} - -int zend_init_rsrc_list_dtors(void) -{ - int retval; - - retval = zend_hash_init(&list_destructors, 50, NULL, NULL, 1); - list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */ - - return retval; -} - - -void zend_destroy_rsrc_list_dtors(void) -{ - zend_hash_destroy(&list_destructors); -} - - -char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) -{ - zend_rsrc_list_dtors_entry *lde; - int rsrc_type; - - if (!zend_list_find(resource, &rsrc_type)) - return NULL; - - if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) { - return lde->type_name; - } else { - return NULL; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_list.h b/Zend/zend_list.h deleted file mode 100644 index 96139501b41a6..0000000000000 --- a/Zend/zend_list.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LIST_H -#define ZEND_LIST_H - -#include "zend_hash.h" -#include "zend_globals.h" - -BEGIN_EXTERN_C() - -#define ZEND_RESOURCE_LIST_TYPE_STD 1 -#define ZEND_RESOURCE_LIST_TYPE_EX 2 - -typedef struct _zend_rsrc_list_entry { - void *ptr; - int type; - int refcount; -} zend_rsrc_list_entry; - -typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC); -#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc TSRMLS_DC) - -typedef struct _zend_rsrc_list_dtors_entry { - /* old style destructors */ - void (*list_dtor)(void *); - void (*plist_dtor)(void *); - - /* new style destructors */ - rsrc_dtor_func_t list_dtor_ex; - rsrc_dtor_func_t plist_dtor_ex; - - char *type_name; - - int module_number; - int resource_id; - unsigned char type; -} zend_rsrc_list_dtors_entry; - - -#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number); -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number); -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number); - -void list_entry_destructor(void *ptr); -void plist_entry_destructor(void *ptr); - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC); -int zend_init_rsrc_list(TSRMLS_D); -int zend_init_rsrc_plist(TSRMLS_D); -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC); -int zend_init_rsrc_list_dtors(void); -void zend_destroy_rsrc_list_dtors(void); - -ZEND_API int zend_list_insert(void *ptr, int type); -ZEND_API int _zend_list_addref(int id TSRMLS_DC); -ZEND_API int _zend_list_delete(int id TSRMLS_DC); -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); - -#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) -#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) -#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC) - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); - -ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); -ZEND_API int zend_fetch_list_dtor_id(char *type_name); - -extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ - -#define ZEND_VERIFY_RESOURCE(rsrc) \ - if (!rsrc) { \ - RETURN_FALSE; \ - } - -#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \ - zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type); - -#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \ - if (le_id == 0) { \ - le_id = zend_fetch_list_dtor_id(le_type_name); \ - } -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c deleted file mode 100644 index 71da535decd16..0000000000000 --- a/Zend/zend_llist.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_llist.h" -#include "zend_qsort.h" - -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent) -{ - l->head = NULL; - l->tail = NULL; - l->count = 0; - l->size = size; - l->dtor = dtor; - l->persistent = persistent; -} - - -ZEND_API void zend_llist_add_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->prev = l->tail; - tmp->next = NULL; - if (l->tail) { - l->tail->next = tmp; - } else { - l->head = tmp; - } - l->tail = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->next = l->head; - tmp->prev = NULL; - if (l->head) { - l->head->prev = tmp; - } else { - l->tail = tmp; - } - l->head = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -#define DEL_LLIST_ELEMENT(current, l) \ - if ((current)->prev) {\ - (current)->prev->next = (current)->next;\ - } else {\ - (l)->head = (current)->next;\ - }\ - if ((current)->next) {\ - (current)->next->prev = (current)->prev;\ - } else {\ - (l)->tail = (current)->prev;\ - }\ - if ((l)->dtor) {\ - (l)->dtor((current)->data);\ - }\ - pefree((current), (l)->persistent);\ - --l->count; - - -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)) -{ - zend_llist_element *current=l->head; - zend_llist_element *next; - - while (current) { - next = current->next; - if (compare(current->data, element)) { - DEL_LLIST_ELEMENT(current, l); - break; - } - current = next; - } -} - - -ZEND_API void zend_llist_destroy(zend_llist *l) -{ - zend_llist_element *current=l->head, *next; - - while (current) { - next = current->next; - if (l->dtor) { - l->dtor(current->data); - } - pefree(current, l->persistent); - current = next; - } - - l->count = 0; -} - - -ZEND_API void zend_llist_clean(zend_llist *l) -{ - zend_llist_destroy(l); - l->head = l->tail = NULL; -} - - -ZEND_API void *zend_llist_remove_tail(zend_llist *l) -{ - zend_llist_element *old_tail; - void *data; - - if ((old_tail = l->tail)) { - if (l->tail->prev) { - l->tail->prev->next = NULL; - } - - data = old_tail->data; - - l->tail = l->tail->prev; - if (l->dtor) { - l->dtor(data); - } - pefree(old_tail, l->persistent); - - --l->count; - - return data; - } - - return NULL; -} - - -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src) -{ - zend_llist_element *ptr; - - zend_llist_init(dst, src->size, src->dtor, src->persistent); - ptr = src->head; - while (ptr) { - zend_llist_add_element(dst, ptr->data); - ptr = ptr->next; - } -} - - -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)) -{ - zend_llist_element *element, *next; - - element=l->head; - while (element) { - next = element->next; - if (func(element->data)) { - DEL_LLIST_ELEMENT(element, l); - } - element = next; - } -} - - -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data TSRMLS_CC); - } -} - -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC) -{ - size_t i; - - zend_llist_element **elements; - zend_llist_element *element, **ptr; - - if (l->count <= 0) { - return; - } - - elements = (zend_llist_element **) emalloc(l->count * sizeof(zend_llist_element *)); - - ptr = &elements[0]; - - for (element=l->head; element; element=element->next) { - *ptr++ = element; - } - - zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func TSRMLS_CC); - - l->head = elements[0]; - elements[0]->prev = NULL; - - for (i = 1; i < l->count; i++) { - elements[i]->prev = elements[i-1]; - elements[i-1]->next = elements[i]; - } - elements[i-1]->next = NULL; - l->tail = elements[i-1]; - efree(elements); -} - - -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data, arg TSRMLS_CC); - } -} - - -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...) -{ - zend_llist_element *element; - va_list args; - - va_start(args, num_args); - for (element=l->head; element; element=element->next) { - func(element->data, num_args, args TSRMLS_CC); - } - va_end(args); -} - - -ZEND_API int zend_llist_count(zend_llist *l) -{ - return l->count; -} - - -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->head; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->tail; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->next; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - - -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->prev; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h deleted file mode 100644 index 579534b6a9437..0000000000000 --- a/Zend/zend_llist.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LLIST_H -#define ZEND_LLIST_H - -typedef struct _zend_llist_element { - struct _zend_llist_element *next; - struct _zend_llist_element *prev; - char data[1]; /* Needs to always be last in the struct */ -} zend_llist_element; - -typedef void (*llist_dtor_func_t)(void *); -typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element ** TSRMLS_DC); -typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC); -typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC); -typedef void (*llist_apply_func_t)(void * TSRMLS_DC); - -typedef struct _zend_llist { - zend_llist_element *head; - zend_llist_element *tail; - size_t count; - size_t size; - llist_dtor_func_t dtor; - unsigned char persistent; - zend_llist_element *traverse_ptr; -} zend_llist; - -typedef zend_llist_element* zend_llist_position; - -BEGIN_EXTERN_C() -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent); -ZEND_API void zend_llist_add_element(zend_llist *l, void *element); -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element); -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); -ZEND_API void zend_llist_destroy(zend_llist *l); -ZEND_API void zend_llist_clean(zend_llist *l); -ZEND_API void *zend_llist_remove_tail(zend_llist *l); -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC); -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC); -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...); -ZEND_API int zend_llist_count(zend_llist *l); -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC); - -/* traversal */ -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos); - -#define zend_llist_get_first(l) zend_llist_get_first_ex(l, NULL) -#define zend_llist_get_last(l) zend_llist_get_last_ex(l, NULL) -#define zend_llist_get_next(l) zend_llist_get_next_ex(l, NULL) -#define zend_llist_get_prev(l) zend_llist_get_prev_ex(l, NULL) - -END_EXTERN_C() - -#endif /* ZEND_LLIST_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_mm.c b/Zend/zend_mm.c deleted file mode 100644 index a5e4de0f51705..0000000000000 --- a/Zend/zend_mm.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_mm.h" - -#if WIN32|WINNT -# ifndef inline -# define inline __inline -# endif -#endif - -#define ZEND_MM_FREE_BLOCK 0 -#define ZEND_MM_USED_BLOCK 1 - -#ifndef MAX -#define MAX(a, b) (((a)>(b))?(a):(b)) -#endif - -#ifndef ZEND_MM_ALIGNMENT -#define ZEND_MM_ALIGNMENT 8 -#define ZEND_MM_ALIGNMENT_LOG2 3 -#endif - -#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) - -#define ZEND_MM_BUCKET_INDEX(true_size) (true_size >> ZEND_MM_ALIGNMENT_LOG2) - -/* Aligned header size */ -#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) -#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block)) -#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_free_block)) -#define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment)) - -/* Memory calculations */ -#define ZEND_MM_BLOCK_AT(blk, offset) ((zend_mm_block *) (((char *) (blk))+(offset))) -#define ZEND_MM_DATA_OF(p) ((void *) (((char *) (p))+ZEND_MM_ALIGNED_HEADER_SIZE)) -#define ZEND_MM_HEADER_OF(blk) ZEND_MM_BLOCK_AT(blk, -(int)ZEND_MM_ALIGNED_HEADER_SIZE) - -/* Debug output */ -#define ZEND_MM_DEBUG(stmt) - - -/* Start Heap Code */ - -static int left_child[ZEND_HEAP_MAX_BUCKETS]; -static int left_child_of_right_brother[ZEND_HEAP_MAX_BUCKETS]; - -static inline void zend_heap_init(zend_heap heap) -{ - int i; - - for (i=0; i>1; /* (i-1)/2 */ - if (heap[i] < node) { - heap[i] = node; - } else { - break; - } - } while (i > 0); -} - -static inline void zend_heap_deactivate_leaf(zend_heap heap, int node) -{ - int i = node + ZEND_HEAP_MAX_BUCKETS-1; - - heap[i] = 0; - - do { - i = (i-1)>>1; /* (i-1)/2 */ - if (heap[i] == node) { - heap[i] = MAX(heap[2*i+1], heap[2*i+2]); - } else { - break; - } - } while (i > 0); -} - -static inline int zend_heap_search_leaf(zend_heap heap, int value) -{ - int i = 1; - - if (heap[0] < value) { - return 0; - } - - - while (i < ZEND_HEAP_MAX_BUCKETS) { - if (heap[i] >= value) { - /* Go to left child */ - i = left_child[i]; - } else { - /* Go to left child of right brother */ - i = left_child_of_right_brother[i]; - } - } - if (heap[i] >= value) { - return heap[i]; - } else { - return heap[i+1]; - } -} - -/* End Heap Code */ - -static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -{ - zend_mm_free_block **free_list_bucket; - size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - if (*free_list_bucket == NULL) { - zend_heap_activate_leaf(heap->heap, index); - } - } else { - free_list_bucket = &heap->free_buckets[0]; - } - mm_block->next_free_block = *free_list_bucket; - if (*free_list_bucket != NULL) { - mm_block->next_free_block->prev_free_block = mm_block; - } - *free_list_bucket = mm_block; - mm_block->prev_free_block = NULL; -} - - -static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -{ - if (mm_block->prev_free_block) { - mm_block->prev_free_block->next_free_block = mm_block->next_free_block; - } else { - zend_mm_free_block **free_list_bucket; - size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - *free_list_bucket = mm_block->next_free_block; - if (*free_list_bucket == NULL) { - zend_heap_deactivate_leaf(heap->heap, index); - } - } else { - free_list_bucket = &heap->free_buckets[0]; - *free_list_bucket = mm_block->next_free_block; - } - } - - if (mm_block->next_free_block) { - mm_block->next_free_block->prev_free_block = mm_block->prev_free_block; - } -} - -static inline void zend_mm_create_new_free_block(zend_mm_heap *heap, zend_mm_block *mm_block, size_t true_size) -{ - int remaining_size; - zend_mm_free_block *new_free_block; - - /* calculate sizes */ - remaining_size = mm_block->size - true_size; - - if (remaining_size < ZEND_MM_ALIGNED_FREE_HEADER_SIZE) { - /* keep best_fit->size as is, it'll include this extra space */ - return; - } - - /* prepare new free block */ - mm_block->size = true_size; - new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - new_free_block->type = ZEND_MM_FREE_BLOCK; - new_free_block->size = remaining_size; - new_free_block->prev_size = true_size; - - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(new_free_block, new_free_block->size)->prev_size = new_free_block->size; - - /* add the new free block to the free list */ - zend_mm_add_to_free_list(heap, new_free_block); -} - -zend_bool zend_mm_add_memory_block(zend_mm_heap *heap, size_t block_size) -{ - /* We need to make sure that block_size is big enough for the minimum segment size */ - zend_mm_free_block *mm_block; - zend_mm_block *guard_block; - zend_mm_segment *segment; - - /* align block size downwards */ - block_size = block_size & ZEND_MM_ALIGNMENT_MASK; - - segment = (zend_mm_segment *) malloc(block_size); - if (!segment) { - return 1; - } -/* fprintf(stderr, "Allocating segment %X\n", segment); */ - segment->next_segment = heap->segments_list; - heap->segments_list = segment; - - block_size -= ZEND_MM_ALIGNED_SEGMENT_SIZE; - mm_block = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - - mm_block->size = block_size - ZEND_MM_ALIGNED_HEADER_SIZE; /* keep one guard block in the end */ - mm_block->type = ZEND_MM_FREE_BLOCK; - mm_block->prev_size = 0; /* Size is always at least ZEND_MM_ALIGNED_HEADER_SIZE big (>0) so 0 is OK */ - - /* setup guard block */ - guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - guard_block->type = ZEND_MM_USED_BLOCK; - guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE; - guard_block->guard_block = 1; - guard_block->prev_size = mm_block->size; - ZEND_MM_DEBUG(("Setup guard block at 0x%0.8X\n", guard_block)); - - zend_mm_add_to_free_list(heap, mm_block); - - return 0; -} - -/* Notes: - * - This function may alter the block_sizes values to match platform alignment - * - This function does *not* perform sanity checks on the arguments - */ -zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size) -{ - heap->block_size = block_size; - heap->segments_list = NULL; - memset(heap->free_buckets, 0, sizeof(heap->free_buckets)); - zend_heap_init(heap->heap); - return zend_mm_add_memory_block(heap, block_size); -} - - -void zend_mm_shutdown(zend_mm_heap *heap) -{ - zend_mm_segment *segment = heap->segments_list; - zend_mm_segment *prev; - - while (segment) { - prev = segment; - segment = segment->next_segment; -/* fprintf(stderr, "Freeing segment %X\n", prev);*/ - free(prev); - } - heap->segments_list = NULL; -} - -void *zend_mm_alloc(zend_mm_heap *heap, size_t size) -{ - size_t true_size; - zend_mm_free_block *p, *best_fit=NULL; - zend_mm_free_block **free_list_bucket; - size_t index; - - /* The max() can probably be optimized with an if () which checks more specific cases */ - true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE); - - index = ZEND_MM_BUCKET_INDEX(true_size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - if (*free_list_bucket) { - best_fit = *free_list_bucket; - goto zend_mm_finished_searching_for_block; - } else { - int leaf; - - leaf = zend_heap_search_leaf(heap->heap, index); - if (leaf != 0) { - best_fit = heap->free_buckets[leaf]; - goto zend_mm_finished_searching_for_block; - } - } - } - - for (p = heap->free_buckets[0]; p; p = p->next_free_block) { - if (p->size == true_size) { - best_fit = p; - break; - } - if ((p->size > true_size) && (!best_fit || (best_fit->size > p->size))) { /* better fit */ - best_fit = p; - } - } - -zend_mm_finished_searching_for_block: - if (!best_fit) { - if (true_size > (heap->block_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE)) { - /* Make sure we add a memory block which is big enough */ - if (zend_mm_add_memory_block(heap, true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { - zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", true_size); - return NULL; - } - } else { - if (zend_mm_add_memory_block(heap, heap->block_size)) { - zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", heap->block_size); - return NULL; - } - } - return zend_mm_alloc(heap, size); - } - - /* mark as used */ - best_fit->type = ZEND_MM_USED_BLOCK; - ((zend_mm_block *) best_fit)->guard_block = 0; - - /* remove from free list */ - zend_mm_remove_from_free_list(heap, best_fit); - - zend_mm_create_new_free_block(heap, (zend_mm_block *) best_fit, true_size); - - return ZEND_MM_DATA_OF(best_fit); -} - - -void zend_mm_free(zend_mm_heap *heap, void *p) -{ - zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p); - zend_mm_block *prev_block, *next_block; - - if (mm_block->type != ZEND_MM_USED_BLOCK) { - /* error */ - return; - } - - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - /* merge with previous block if empty */ - if (mm_block->prev_size != 0 - && (prev_block=ZEND_MM_BLOCK_AT(mm_block, -(int)mm_block->prev_size))->type == ZEND_MM_FREE_BLOCK) { - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block); - prev_block->size += mm_block->size; - mm_block = prev_block; - next_block->prev_size = mm_block->size; - } - - /* merge with the next block if empty */ - if (next_block->type == ZEND_MM_FREE_BLOCK) { - mm_block->size += next_block->size; - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); /* recalculate */ - next_block->prev_size = mm_block->size; - } - - mm_block->type = ZEND_MM_FREE_BLOCK; - zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block); -} - -void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size) -{ - zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p); - zend_mm_block *next_block; - size_t true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE); - - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - if (true_size <= mm_block->size) { - zend_mm_create_new_free_block(heap, mm_block, true_size); - - if (next_block->type == ZEND_MM_FREE_BLOCK) { - zend_mm_block *new_next_block; - - new_next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - if (new_next_block != next_block) { /* A new free block was created */ - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) new_next_block); - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - new_next_block->size += next_block->size; - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(new_next_block, new_next_block->size)->prev_size = new_next_block->size; - zend_mm_add_to_free_list(heap, (zend_mm_free_block *) new_next_block); - } - } - return p; - } - - if ((mm_block->prev_size == 0) && (next_block->type == ZEND_MM_USED_BLOCK) && - (next_block->guard_block)) { - zend_mm_segment *segment = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE); - zend_mm_segment *segment_copy = segment; - zend_mm_block *guard_block; - size_t realloc_to_size; - - /* segment size, size of block and size of guard block */ - realloc_to_size = ZEND_MM_ALIGNED_SEGMENT_SIZE+true_size+ZEND_MM_ALIGNED_HEADER_SIZE; - segment = realloc(segment, realloc_to_size); - if (!segment) { - return NULL; - } - - if (segment != segment_copy) { - if (heap->segments_list == segment_copy) { - heap->segments_list = segment; - } else { - zend_mm_segment *seg = heap->segments_list; - - while (seg) { - if (seg->next_segment == segment_copy) { - seg->next_segment = segment; - break; - } - seg = seg->next_segment; - } - } - mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - } - - mm_block->size = true_size; - - /* setup guard block */ - guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - guard_block->type = ZEND_MM_USED_BLOCK; - guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE; - guard_block->guard_block = 1; - guard_block->prev_size = mm_block->size; - - return ZEND_MM_DATA_OF(mm_block); - } - - if (next_block->type != ZEND_MM_FREE_BLOCK || (mm_block->size + next_block->size < true_size)) { - void *ptr; - - ptr = zend_mm_alloc(heap, size); - memcpy(ptr, p, mm_block->size - ZEND_MM_ALIGNED_HEADER_SIZE); - zend_mm_free(heap, p); - return ptr; - } - - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - mm_block->size += next_block->size; - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(mm_block, mm_block->size)->prev_size = mm_block->size; - - zend_mm_create_new_free_block(heap, mm_block, true_size); - - return p; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_mm.h b/Zend/zend_mm.h deleted file mode 100644 index 1237f2f3a5bde..0000000000000 --- a/Zend/zend_mm.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_MM_H -#define _ZEND_MM_H - -#include - -#include "zend.h" -#include "zend_types.h" - - -#ifdef ZEND_WIN32 -#undef ZEND_MM -#else -/* #define ZEND_MM */ -#undef ZEND_MM -#endif - -/* mm block type */ -typedef struct _zend_mm_block { - unsigned int size : 31; - unsigned int type : 1; - size_t prev_size; - unsigned int guard_block : 1; -} zend_mm_block; - -typedef struct _zend_mm_free_block { - unsigned int size : 31; - unsigned int type : 1; - size_t prev_size; - struct _zend_mm_free_block *prev_free_block; - struct _zend_mm_free_block *next_free_block; -} zend_mm_free_block; - -typedef struct _zend_mm_segment { - struct _zend_mm_segment *next_segment; -} zend_mm_segment; - -#define ZEND_MM_NUM_BUCKETS 16 - -#define ZEND_HEAP_MAX_BUCKETS ZEND_MM_NUM_BUCKETS - -typedef int zend_heap[2*ZEND_HEAP_MAX_BUCKETS-1]; - -typedef struct _zend_mm_heap { - zend_mm_segment *segments_list; - size_t block_size; - zend_mm_free_block *free_buckets[ZEND_MM_NUM_BUCKETS]; - zend_heap heap; -} zend_mm_heap; - -zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size); -void zend_mm_shutdown(zend_mm_heap *heap); -void *zend_mm_alloc(zend_mm_heap *heap, size_t size); -void zend_mm_free(zend_mm_heap *heap, void *p); -void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size); - -#endif /* _ZEND_MM_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h deleted file mode 100644 index ad562c10227d6..0000000000000 --- a/Zend/zend_modules.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef MODULES_H -#define MODULES_H - -#include "zend.h" -#include "zend_compile.h" - -#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC -#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC -#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC -#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC - -extern struct _zend_arg_info first_arg_force_ref[2]; -extern struct _zend_arg_info second_arg_force_ref[3]; -extern struct _zend_arg_info third_arg_force_ref[4]; -extern struct _zend_arg_info fourth_arg_force_ref[5]; -extern struct _zend_arg_info all_args_by_ref[1]; - -#define ZEND_MODULE_API_NO 20050922 -#ifdef ZTS -#define USING_ZTS 1 -#else -#define USING_ZTS 0 -#endif - -#define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS -#define STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, NULL, NULL -#define ZE2_STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, ini_entries, NULL - -#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0 - -#define STANDARD_MODULE_PROPERTIES \ - NULL, STANDARD_MODULE_PROPERTIES_EX - -#define NO_VERSION_YET NULL - -#define MODULE_PERSISTENT 1 -#define MODULE_TEMPORARY 2 - -struct _zend_ini_entry; -typedef struct _zend_module_entry zend_module_entry; -typedef struct _zend_module_dep zend_module_dep; - -struct _zend_module_entry { - unsigned short size; - unsigned int zend_api; - unsigned char zend_debug; - unsigned char zts; - struct _zend_ini_entry *ini_entry; - struct _zend_module_dep *deps; - char *name; - struct _zend_function_entry *functions; - int (*module_startup_func)(INIT_FUNC_ARGS); - int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); - int (*request_startup_func)(INIT_FUNC_ARGS); - int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); - void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); - char *version; - int (*post_deactivate_func)(void); - int globals_id; - int module_started; - unsigned char type; - void *handle; - int module_number; -}; - -#define MODULE_DEP_REQUIRED 1 -#define MODULE_DEP_CONFLICTS 2 -#define MODULE_DEP_OPTIONAL 3 - -#define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED }, -#define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS }, -#define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL }, - -#define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL) -#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL) -#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL) - -struct _zend_module_dep { - char *name; /* module name */ - char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */ - char *version; /* version */ - unsigned char type; /* dependency type */ -}; - -extern ZEND_API HashTable module_registry; - -void module_destructor(zend_module_entry *module); -int module_registry_cleanup(zend_module_entry *module TSRMLS_DC); -int module_registry_request_startup(zend_module_entry *module TSRMLS_DC); -int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC); - -#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h deleted file mode 100644 index 0464f584c1078..0000000000000 --- a/Zend/zend_multiply.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sascha Schumann | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if defined(__i386__) && defined(__GNUC__) - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __tmpvar; \ - __asm__ ("imul %3,%0\n" \ - "adc $0,%1" \ - : "=r"(__tmpvar),"=r"(usedval) \ - : "0"(a), "r"(b), "1"(0)); \ - if (usedval) (dval) = (double) (a) * (double) (b); \ - else (lval) = __tmpvar; \ -} while (0) - -#else - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __lres = (a) * (b); \ - double __dres = (double)(a) * (double)(b); \ - double __delta = (double) __lres - __dres; \ - if ( ((usedval) = (( __dres + __delta ) != __dres))) { \ - (dval) = __dres; \ - } else { \ - (lval) = __lres; \ - } \ -} while (0) - -#endif diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c deleted file mode 100644 index 2dd0238182f6a..0000000000000 --- a/Zend/zend_object_handlers.c +++ /dev/null @@ -1,1099 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects.h" -#include "zend_objects_API.h" -#include "zend_object_handlers.h" -#include "zend_interfaces.h" - -#define DEBUG_OBJECT_HANDLERS 0 - -#define Z_OBJ_P(zval_p) zend_objects_get_address(zval_p TSRMLS_CC) - -/* - __X accessors explanation: - - if we have __get and property that is not part of the properties array is - requested, we call __get handler. If it fails, we return uninitialized. - - if we have __set and property that is not part of the properties array is - set, we call __set handler. If it fails, we do not change the array. - - for both handlers above, when we are inside __get/__set, no further calls for - __get/__set for these objects will be made, to prevent endless recursion and - enable accessors to change properties array. - - if we have __call and method which is not part of the class function table is - called, we cal __call handler. -*/ - -static HashTable *zend_std_get_properties(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - return zobj->properties; -} - -static zval *zend_std_call_getter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __get handler is called with one argument: - property name - - it should return whether the call was successfull or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__get, ZEND_GET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - if (retval) { - retval->refcount--; - } - - return retval; -} - -static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zval *retval = NULL; - int result; - zend_class_entry *ce = Z_OBJCE_P(object); - - SEPARATE_ARG_IF_REF(member); - value->refcount++; - - /* __set handler is called with two arguments: - property name - value to be set - - it should return whether the call was successfull or not - */ - zend_call_method_with_2_params(&object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value); - - zval_ptr_dtor(&member); - zval_ptr_dtor(&value); - - if (retval) { - result = i_zend_is_true(retval) ? SUCCESS : FAILURE; - zval_ptr_dtor(&retval); - return result; - } else { - return FAILURE; - } -} - -static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __unset handler is called with one argument: - property name - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member); - - zval_ptr_dtor(&member); -} - -static zval *zend_std_call_issetter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __isset handler is called with one argument: - property name - - it should return whether the property is set or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - return retval; -} - -static int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce TSRMLS_DC) -{ - switch (property_info->flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - return 1; - case ZEND_ACC_PROTECTED: - return zend_check_protected(ce, EG(scope)); - case ZEND_ACC_PRIVATE: - if (ce==EG(scope) && EG(scope)) { - return 1; - } else { - return 0; - } - break; - } - return 0; -} - -static inline zend_bool is_derived_class(zend_class_entry *child_class, zend_class_entry *parent_class) -{ - child_class = child_class->parent; - while (child_class) { - if (child_class == parent_class) { - return 1; - } - child_class = child_class->parent; - } - - return 0; -} - -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) -{ - zend_property_info *property_info = NULL; - zend_property_info *scope_property_info; - zend_bool denied_access = 0; - ulong h; - - if ((Z_TYPE_P(member) == IS_UNICODE && Z_USTRVAL_P(member)[0] == 0) || - Z_STRVAL_P(member)[0] == '\0') { - if (!silent) { - if (Z_UNILEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); - } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); - } - } - return NULL; - } - h = zend_u_get_hash_value(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member) + 1); - if (zend_u_hash_quick_find(&ce->properties_info, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, h, (void **) &property_info)==SUCCESS) { - if(property_info->flags & ZEND_ACC_SHADOW) { - /* if it's a shadow - go to access it's private */ - property_info = NULL; - } else { - if (zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (property_info->flags & ZEND_ACC_CHANGED - && !(property_info->flags & ZEND_ACC_PRIVATE)) { - /* We still need to make sure that we're not in a context - * where the right property is a different 'statically linked' private - * continue checking below... - */ - } else { - if (!silent && (property_info->flags & ZEND_ACC_STATIC)) { - zend_error(E_STRICT, "Accessing static property %v::$%R as non static", ce->name, Z_TYPE_P(member), Z_UNIVAL_P(member)); - } - return property_info; - } - } else { - /* Try to look in the scope instead */ - denied_access = 1; - } - } - } - if (EG(scope) != ce - && is_derived_class(ce, EG(scope)) - && EG(scope) - && zend_u_hash_quick_find(&EG(scope)->properties_info, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS - && scope_property_info->flags & ZEND_ACC_PRIVATE) { - return scope_property_info; - } else if (property_info) { - if (denied_access) { - /* Information was available, but we were denied access. Error out. */ - if (silent) { - return NULL; - } - zend_error(E_ERROR, "Cannot access %s property %v::$%R", zend_visibility_string(property_info->flags), ce->name, Z_TYPE_P(member), Z_STRVAL_P(member)); - } else { - /* fall through, return property_info... */ - } - } else { - EG(std_property_info).flags = ZEND_ACC_PUBLIC; - EG(std_property_info).name = Z_UNIVAL_P(member); - EG(std_property_info).name_length = Z_UNILEN_P(member); - EG(std_property_info).h = zend_u_get_hash_value(Z_TYPE_P(member), EG(std_property_info).name, EG(std_property_info).name_length+1); - property_info = &EG(std_property_info); - } - return property_info; -} - - -ZEND_API int zend_check_property_access(zend_object *zobj, zend_uchar utype, void *prop_info_name TSRMLS_DC) -{ - zend_property_info *property_info; - char *class_name, *prop_name; - zval member; - - zend_u_unmangle_property_name(utype, prop_info_name, &class_name, &prop_name); - if (utype == IS_UNICODE) { - ZVAL_UNICODE(&member, (UChar*)prop_name, 0); - } else { - ZVAL_STRING(&member, prop_name, 0); - } - property_info = zend_get_property_info(zobj->ce, &member, 1 TSRMLS_CC); - if (!property_info) { - return FAILURE; - } - if (class_name && class_name[0] != '*') { - if (!(property_info->flags & ZEND_ACC_PRIVATE)) { - /* we we're looking for a private prop but found a non private one of the same name */ - return FAILURE; - } else if (!UG(unicode) && strcmp((char*)prop_info_name+1, property_info->name+1)) { - /* we we're looking for a private prop but found a private one of the same name but another class */ - return FAILURE; - } else if (UG(unicode) && u_strcmp(((UChar*)prop_info_name)+1, ((UChar*)property_info->name)+1)) { - /* we we're looking for a private prop but found a private one of the same name but another class */ - return FAILURE; - } - } - return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE; -} - -zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **retval; - zval *rv = NULL; - zend_property_info *property_info; - int silent; - zend_bool use_get; - - silent = (type == BP_VAR_IS); - zobj = Z_OBJ_P(object); - use_get = (zobj->ce->__get && !zobj->in_get); - - if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_text(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member)); -#endif - - /* make zend_get_property_info silent if we have getter - we may want to use it */ - property_info = zend_get_property_info(zobj->ce, member, use_get TSRMLS_CC); - - if (!property_info || zend_u_hash_quick_find(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - if (use_get) { - /* have getter - try with it! */ - zobj->in_get = 1; /* prevent circular getting */ - rv = zend_std_call_getter(object, member TSRMLS_CC); - zobj->in_get = 0; - - if (rv) { - retval = &rv; - } else { - retval = &EG(uninitialized_zval_ptr); - } - } else { - if (!silent) { - zend_error(E_NOTICE,"Undefined property: %v::$%R", zobj->ce->name, Z_TYPE_P(member), Z_STRVAL_P(member)); - } - retval = &EG(uninitialized_zval_ptr); - } - } - if (tmp_member) { - (*retval)->refcount++; - zval_ptr_dtor(&tmp_member); - (*retval)->refcount--; - } - return *retval; -} - - -static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **variable_ptr; - int setter_done = 0; - zend_property_info *property_info; - zend_bool use_set; - - zobj = Z_OBJ_P(object); - use_set = (zobj->ce->__set && !zobj->in_set); - - if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_text(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, use_set TSRMLS_CC); - - if (property_info && zend_u_hash_quick_find(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, (void **) &variable_ptr) == SUCCESS) { - if (*variable_ptr == value) { - /* if we already have this value there, we don't actually need to do anything */ - setter_done = 1; - } else { - /* if we are assigning reference, we shouldn't move it, but instead assign variable - to the same pointer */ - if (PZVAL_IS_REF(*variable_ptr)) { - zval_dtor(*variable_ptr); /* old value should be destroyed */ - /* To check: can't *variable_ptr be some system variable like error_zval here? */ - (*variable_ptr)->type = value->type; - (*variable_ptr)->value = value->value; - if (value->refcount>0) { - zval_copy_ctor(*variable_ptr); - } - setter_done = 1; - } - } - } else { - if (use_set) { - zobj->in_set = 1; /* prevent circular setting */ - if (zend_std_call_setter(object, member, value TSRMLS_CC) != SUCCESS) { - /* for now, just ignore it - __set should take care of warnings, etc. */ - } - setter_done = 1; - zobj->in_set = 0; - } - } - - if (!setter_done) { - zval **foo; - - /* if we assign referenced variable, we should separate it */ - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - zend_u_hash_quick_update(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo); - } - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - -zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - - if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) { - if(offset == NULL) { - /* [] construct */ - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - - zval_ptr_dtor(&offset); - - if (!retval) { - if (!EG(exception)) { - zend_error(E_ERROR, "Undefined offset for object of type %v used as array", ce->name); - } - return 0; - } - - /* Undo PZVAL_LOCK() */ - retval->refcount--; - - return retval; - } else { - zend_error(E_ERROR, "Cannot use object of type %v as array", ce->name); - return 0; - } -} - - -static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) { - if (!offset) { - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_2_params(&object, ce, NULL, "offsetset", NULL, offset, value); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %v as array", ce->name); - } -} - - -static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - int result; - - if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - if (check_empty && result && !EG(exception)) { - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - } - } - } else { - result = 0; - } - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %v as array", ce->name); - return 0; - } - return result; -} - - -static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **retval; - zend_property_info *property_info; - zend_bool use_get; - - zobj = Z_OBJ_P(object); - use_get = (zobj->ce->__get && !zobj->in_get); - - if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_text(&tmp_member); - member = &tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Ptr object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, use_get TSRMLS_CC); - - if (!property_info || zend_u_hash_quick_find(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - zval *new_zval; - - if (!use_get) { - /* we don't have access controls - will just add it */ - new_zval = &EG(uninitialized_zval); - -/* zend_error(E_NOTICE, "Undefined property: %R", Z_TYPE_P(member), Z_STRVAL_P(member)); */ - new_zval->refcount++; - zend_u_hash_quick_update(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); - } else { - /* we do have getter - fail and let it try again with usual get/set */ - retval = NULL; - } - } - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - - -static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zend_property_info *property_info; - zend_bool use_unset; - - zobj = Z_OBJ_P(object); - use_unset = (zobj->ce->__unset && !zobj->in_unset); - - if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_text(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, 0 TSRMLS_CC); - - if (!property_info || zend_u_hash_del(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1)) { - if (use_unset) { - /* have unseter - try with it! */ - zobj->in_unset = 1; /* prevent circular unsetting */ - zend_std_call_unsetter(object, member TSRMLS_CC); - zobj->in_unset = 0; - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - - -static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %v as array", ce->name); - } -} - - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) -{ - zend_internal_function *func = (zend_internal_function *)EG(function_state_ptr)->function; - zval *method_name_ptr, *method_args_ptr; - zval *method_result_ptr = NULL; - zend_class_entry *ce = Z_OBJCE_P(this_ptr); - - ALLOC_ZVAL(method_args_ptr); - INIT_PZVAL(method_args_ptr); - array_init(method_args_ptr); - - if (zend_copy_parameters_array(ZEND_NUM_ARGS(), method_args_ptr TSRMLS_CC) == FAILURE) { - zval_dtor(method_args_ptr); - zend_error(E_ERROR, "Cannot get arguments for __call"); - RETURN_FALSE; - } - - ALLOC_ZVAL(method_name_ptr); - INIT_PZVAL(method_name_ptr); - ZVAL_TEXT(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */ - - /* __call handler is called with two arguments: - method name - array of method parameters - - */ - zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); - - if (method_result_ptr) { - if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } - } - - /* now destruct all auxiliaries */ - zval_ptr_dtor(&method_args_ptr); - zval_ptr_dtor(&method_name_ptr); - - /* destruct the function also, then - we have allocated it in get_method */ - efree(func); -} - -/* Ensures that we're allowed to call a private method. - * Returns the function address that should be called, or NULL - * if no such function exists. - */ -static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - if (!ce) { - return 0; - } - - /* We may call a private function if: - * 1. The class of our object is the same as the scope, and the private - * function (EX(fbc)) has the same scope. - * 2. One of our parent classes are the same as the scope, and it contains - * a private function with the same name that has the same scope. - */ - if (fbc->common.scope == ce && EG(scope) == ce) { - /* rule #1 checks out ok, allow the function call */ - return fbc; - } - - - /* Check rule #2 */ - ce = ce->parent; - while (ce) { - if (ce == EG(scope)) { - if (zend_u_hash_find(&ce->function_table, UG(unicode)?IS_UNICODE:IS_STRING, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS - && fbc->op_array.fn_flags & ZEND_ACC_PRIVATE - && fbc->common.scope == EG(scope)) { - return fbc; - } - break; - } - ce = ce->parent; - } - return NULL; -} - - -ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL; -} - - -/* Ensures that we're allowed to call a protected method. - */ -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) -{ - zend_class_entry *fbc_scope = ce; - - /* Is the context that's calling the function, the same as one of - * the function's parents? - */ - while (fbc_scope) { - if (fbc_scope==scope) { - return 1; - } - fbc_scope = fbc_scope->parent; - } - - /* Is the function's scope the same as our current object context, - * or any of the parents of our context? - */ - while (scope) { - if (scope==ce) { - return 1; - } - scope = scope->parent; - } - return 0; -} - - -static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) -{ - zend_object *zobj; - zend_function *fbc; - unsigned int lc_method_name_len; - char *lc_method_name; - zval *object = *object_ptr; - - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - /* Create a zend_copy_str_tolower(dest, src, src_length); */ - lc_method_name = zend_u_str_case_fold(type, method_name, method_len, 1, &lc_method_name_len); - - zobj = Z_OBJ_P(object); - if (zend_u_hash_find(&zobj->ce->function_table, type, lc_method_name, lc_method_name_len+1, (void **)&fbc) == FAILURE) { - efree(lc_method_name); - if (zobj->ce->__call) { - zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function)); - call_user_call->type = ZEND_INTERNAL_FUNCTION; - call_user_call->module = zobj->ce->module; - call_user_call->handler = zend_std_call_user_call; - call_user_call->arg_info = NULL; - call_user_call->num_args = 0; - call_user_call->scope = zobj->ce; - call_user_call->fn_flags = 0; - if (UG(unicode)) { - call_user_call->function_name = (char*)eustrndup((UChar*)method_name, method_len); - } else { - call_user_call->function_name = estrndup(method_name, method_len); - } - call_user_call->pass_rest_by_reference = 0; - call_user_call->return_reference = ZEND_RETURN_VALUE; - - return (union _zend_function *)call_user_call; - } else { - return NULL; - } - } - - /* Check access level */ - if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* Ensure that we haven't overridden a private function and end up calling - * the overriding public function... - */ - if (EG(scope) && fbc->op_array.fn_flags & ZEND_ACC_CHANGED) { - zend_function *priv_fbc; - - if (zend_u_hash_find(&EG(scope)->function_table, type, lc_method_name, lc_method_name_len+1, (void **) &priv_fbc)==SUCCESS - && priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE - && priv_fbc->common.scope == EG(scope)) { - fbc = priv_fbc; - } - } - } else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, object->value.obj.handlers->get_class_entry(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - fbc = updated_fbc; - } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(fbc->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - - efree(lc_method_name); - return fbc; -} - - -/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */ -ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - zend_function *fbc; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - if (zend_u_hash_find(&ce->function_table, type, function_name_strval, function_name_strlen+1, (void **) &fbc)==FAILURE) { - char *class_name = ce->name; - - if (!class_name) { - class_name = EMPTY_STR; - } - zend_error(E_ERROR, "Call to undefined method %R::%R()", type, class_name, type, function_name_strval); - } - if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary, most common case */ - } else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - fbc = updated_fbc; - } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(EG(scope), fbc->common.scope)) { - zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - - return fbc; -} - - -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, zend_uchar type, void *property_name, int property_name_len, zend_bool silent TSRMLS_DC) -{ - zval **retval = NULL; - zend_class_entry *tmp_ce = ce; - zend_property_info *property_info; - zend_property_info std_property_info; - - if (zend_u_hash_find(&ce->properties_info, type, property_name, property_name_len+1, (void **) &property_info)==FAILURE) { - std_property_info.flags = ZEND_ACC_PUBLIC; - std_property_info.name = property_name; - std_property_info.name_length = property_name_len; - std_property_info.h = zend_get_hash_value(std_property_info.name, std_property_info.name_length+1); - property_info = &std_property_info; - } - -#if DEBUG_OBJECT_HANDLERS - zend_printf("Access type for %v::%R is %s\n", ce->name, type, property_name, zend_visibility_string(property_info->flags)); -#endif - - if (!zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (!silent) { - zend_error(E_ERROR, "Cannot access %s property %v::$%R", zend_visibility_string(property_info->flags), ce->name, type, property_name); - } - return NULL; - } - - zend_update_class_constants(tmp_ce TSRMLS_CC); - - zend_u_hash_quick_find(tmp_ce->static_members, UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval); - - if (!retval) { - if (silent) { - return NULL; - } else { - zend_error(E_ERROR, "Access to undeclared static property: %v::$%R", ce->name, type, property_name); - } - } - - return retval; -} - - -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_uchar type, void *property_name, int property_name_len TSRMLS_DC) -{ - zend_error(E_ERROR, "Attempt to unset static property %v::$%R", ce->name, type, property_name); - return 0; -} - - -static union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC) -{ - zend_object *zobj = Z_OBJ_P(object); - zend_function *constructor = zobj->ce->constructor; - - if (constructor) { - if (constructor->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary */ - } else if (constructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (object->value.obj.handlers->get_class_entry(object TSRMLS_CC) != EG(scope)) { - zend_error(E_ERROR, "Call to private %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(constructor->common.scope, EG(scope))) { - zend_error(E_ERROR, "Call to protected %v::%v() from context '%v'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - return constructor; -} - - -int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC); - - -static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) -{ - zend_object *zobj1, *zobj2; - - zobj1 = Z_OBJ_P(o1); - zobj2 = Z_OBJ_P(o2); - - if (zobj1->ce != zobj2->ce) { - return 1; /* different classes */ - } - return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); -} - -static int zend_std_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) -{ - zend_object *zobj; - int result; - zval **value; - zval *tmp_member = NULL; - zend_property_info *property_info; - zend_bool use_isset; - - zobj = Z_OBJ_P(object); - use_isset = (zobj->ce->__isset && !zobj->in_isset); - - if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_text(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC); - - if (!property_info || zend_u_hash_quick_find(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1, property_info->h, (void **) &value) == FAILURE) { - result = 0; - if (use_isset && (has_set_exists != 2)) { - zval *rv; - - /* have issetter - try with it! */ - zobj->in_isset = 1; /* prevent circular getting */ - rv = zend_std_call_issetter(object, member TSRMLS_CC); - zobj->in_isset = 0; - if (rv) { - result = zend_is_true(rv); - zval_ptr_dtor(&rv); - if (has_set_exists && result && !EG(exception) && zobj->ce->__get && !zobj->in_get) { - rv = zend_std_call_getter(object, member TSRMLS_CC); - if (rv) { - rv->refcount++; - result = i_zend_is_true(rv); - zval_ptr_dtor(&rv); - } - } - } - } - } else { - switch (has_set_exists) { - case 0: - result = (Z_TYPE_PP(value) != IS_NULL); - break; - default: - result = zend_is_true(*value); - break; - case 2: - result = 1; - break; - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } - return result; -} - - -zend_class_entry *zend_std_object_get_class(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - - return zobj->ce; -} - -int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - zend_object *zobj; - zend_class_entry *ce; - zobj = Z_OBJ_P(object); - - if (parent) { - if (!zobj->ce->parent) { - return FAILURE; - } - ce = zobj->ce->parent; - } else { - ce = zobj->ce; - } - - *class_name_len = ce->name_length; - if (UG(unicode)) { - *class_name = (char*)eustrndup((UChar*)ce->name, ce->name_length); - } else { - *class_name = estrndup(ce->name, ce->name_length); - } - return SUCCESS; -} - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - zval *retval; - zend_class_entry *ce; - - switch (type) { - case IS_STRING: - case IS_UNICODE: - ce = Z_OBJCE_P(readobj); - if (ce->__tostring && - zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval)) { - if (EG(exception)) { - zval_ptr_dtor(&retval); - zend_error(E_ERROR, "Method %v::__toString() must not throw an exception", ce->name); - return FAILURE; - } - if (Z_TYPE_P(retval) == (UG(unicode)?IS_UNICODE:IS_STRING)) { - INIT_PZVAL(writeobj); - ZVAL_ZVAL(writeobj, retval, 1, 1); - if (Z_TYPE_P(writeobj) != type) { - convert_to_explicit_type(writeobj, type); - } - return SUCCESS; - } else { - zval_ptr_dtor(&retval); - INIT_PZVAL(writeobj); - ZVAL_EMPTY_STRING(writeobj); - zend_error(E_RECOVERABLE_ERROR, "Method %v::__toString() must return a string value", ce->name); - return SUCCESS; - } - } - return FAILURE; - case IS_BOOL: - INIT_PZVAL(writeobj); - ZVAL_BOOL(writeobj, 1); - return SUCCESS; - case IS_LONG: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %v could not be converted to int", ce->name); - INIT_PZVAL(writeobj); - ZVAL_LONG(writeobj, 1); - return SUCCESS; - case IS_DOUBLE: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %v could not be converted to double", ce->name); - INIT_PZVAL(writeobj); - ZVAL_DOUBLE(writeobj, 1); - return SUCCESS; - default: - break; - } - return FAILURE; -} - - -ZEND_API zend_object_handlers std_object_handlers = { - zend_objects_store_add_ref, /* add_ref */ - zend_objects_store_del_ref, /* del_ref */ - zend_objects_clone_obj, /* clone_obj */ - - zend_std_read_property, /* read_property */ - zend_std_write_property, /* write_property */ - zend_std_read_dimension, /* read_dimension */ - zend_std_write_dimension, /* write_dimension */ - zend_std_get_property_ptr_ptr, /* get_property_ptr_ptr */ - NULL, /* get */ - NULL, /* set */ - zend_std_has_property, /* has_property */ - zend_std_unset_property, /* unset_property */ - zend_std_has_dimension, /* has_dimension */ - zend_std_unset_dimension, /* unset_dimension */ - zend_std_get_properties, /* get_properties */ - zend_std_get_method, /* get_method */ - NULL, /* call_method */ - zend_std_get_constructor, /* get_constructor */ - zend_std_object_get_class, /* get_class_entry */ - zend_std_object_get_class_name, /* get_class_name */ - zend_std_compare_objects, /* compare_objects */ - zend_std_cast_object_tostring, /* cast_object */ - NULL, /* count_elements */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h deleted file mode 100644 index 017874ba4020e..0000000000000 --- a/Zend/zend_object_handlers.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECT_HANDLERS_H -#define ZEND_OBJECT_HANDLERS_H - -union _zend_function; -struct _zend_property_info; - -/* The following rule applies to read_property() and read_dimension() implementations: - If you return a zval which is not otherwise referenced by the extension or the engine's - symbol table, its reference count should be 0. -*/ -/* Used to fetch property from the object, read-only */ -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC); - -/* Used to fetch dimension from the object, read-only */ -typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC); - - -/* The following rule applies to write_property() and write_dimension() implementations: - If you receive a value zval in write_property/write_dimension, you may only modify it if - its reference count is 1. Otherwise, you must create a copy of that zval before making - any changes. You should NOT modify the reference count of the value passed to you. -*/ -/* Used to set property of the object */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); - -/* Used to set dimension of the object */ -typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); - - -/* Used to create pointer to the property of the object, for future direct r/w access */ -typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to set object value. Can be used to override assignments and scalar - write ops (like ++, +=) on the object */ -typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); - -/* Used to get object value. Can be used when converting object value to - * one of the basic types and when using scalar ops (like ++, +=) on the object - */ -typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); - -/* Used to check if a property of the object exists */ -/* param has_set_exists: - * 0 (has) whether property exists and is not NULL - * 1 (set) whether property exists and is true - * 2 (exists) whether property exists - */ -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists TSRMLS_DC); - -/* Used to check if a dimension of the object exists */ -typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC); - -/* Used to remove a property of the object */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to remove a dimension of the object */ -typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC); - -/* Used to get hash of the properties of the object, as hash of zval's */ -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); - -/* Used to call methods */ -/* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. - */ -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); -typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len TSRMLS_DC); -typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); - -/* Object maintenance/destruction */ -typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC); -typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); - -typedef zend_class_entry *(*zend_object_get_class_entry_t)(zval *object TSRMLS_DC); -typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); -typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); - -/* Cast an object to some other type - */ -typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC); - -/* updates *count to hold the number of elements present and returns SUCCESS. - * Returns FAILURE if the object does not have any sense of overloaded dimensions */ -typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC); - -typedef struct _zend_object_handlers { - /* general object functions */ - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_read_dimension_t read_dimension; - zend_object_write_dimension_t write_dimension; - zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_has_dimension_t has_dimension; - zend_object_unset_dimension_t unset_dimension; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; - zend_object_cast_t cast_object; - zend_object_count_elements_t count_elements; -} zend_object_handlers; - -extern ZEND_API zend_object_handlers std_object_handlers; -BEGIN_EXTERN_C() -ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, zend_uchar type, void *property_name, int property_name_len, zend_bool silent TSRMLS_DC); -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_uchar type, void *property_name, int property_name_len TSRMLS_DC); -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC); - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC); - - -#define IS_ZEND_STD_OBJECT(z) ((z).type == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL)) -#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL) - -ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); - -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope); - -ZEND_API int zend_check_property_access(zend_object *zobj, zend_uchar utype, void *prop_info_name TSRMLS_DC); - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS); -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c deleted file mode 100644 index c9299c4efb871..0000000000000 --- a/Zend/zend_objects.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_interfaces.h" - - -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC) -{ - zend_function *destructor = object->ce->destructor; - - if (destructor) { - zval zobj, *obj = &zobj; - zval *old_exception; - - if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) { - if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (object->ce != EG(scope)) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to private %v::__destruct() from context '%v'%s", - ce->name, - EG(scope) ? EG(scope)->name : EMPTY_STR, - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } else { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(destructor->common.scope, EG(scope))) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to protected %v::__destruct() from context '%v'%s", - ce->name, - EG(scope) ? EG(scope)->name : EMPTY_STR, - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } - } - - zobj.type = IS_OBJECT; - zobj.value.obj.handle = handle; - zobj.value.obj.handlers = &std_object_handlers; - INIT_PZVAL(obj); - - /* Make sure that destructors are protected from previously thrown exceptions. - * For example, if an exception was thrown in a function and when the function's - * local variable destruction results in a destructor being called. - */ - old_exception = EG(exception); - EG(exception) = NULL; - zend_call_method_with_0_params(&obj, object->ce, &object->ce->destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL); - if (old_exception) { - if (EG(exception)) { - zend_error(E_ERROR, "Ignoring exception from %v::__destruct() while an exception is already active", object->ce->name); - zval_ptr_dtor(&EG(exception)); - } - EG(exception) = old_exception; - } - } -} - -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC) -{ - zend_hash_destroy(object->properties); - FREE_HASHTABLE(object->properties); - efree(object); -} - -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - - *object = emalloc(sizeof(zend_object)); - (*object)->ce = class_type; - retval.handle = zend_objects_store_put(*object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC); - retval.handlers = &std_object_handlers; - (*object)->in_get = 0; - (*object)->in_set = 0; - (*object)->in_unset = 0; - (*object)->in_isset = 0; - return retval; -} - -ZEND_API zend_object *zend_objects_get_address(zval *zobject TSRMLS_DC) -{ - return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC); -} - -static void zval_add_ref_or_clone(zval **p) -{ - if (Z_TYPE_PP(p) == IS_OBJECT && !PZVAL_IS_REF(*p)) { - TSRMLS_FETCH(); - - if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) { - zend_error(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_PP(p)->name); - } else { - zval *orig = *p; - - ALLOC_ZVAL(*p); - **p = *orig; - INIT_PZVAL(*p); - (*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC); - } - } else { - (*p)->refcount++; - } -} - -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC) -{ - if (EG(ze1_compatibility_mode)) { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } else { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } - if (old_object->ce->clone) { - zval *new_obj; - - MAKE_STD_ZVAL(new_obj); - new_obj->type = IS_OBJECT; - new_obj->value.obj = new_obj_val; - zval_copy_ctor(new_obj); - - zend_call_method_with_0_params(&new_obj, old_object->ce, &old_object->ce->clone, ZEND_CLONE_FUNC_NAME, NULL); - - zval_ptr_dtor(&new_obj); - } -} - -ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value new_obj_val; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - /* assume that create isn't overwritten, so when clone depends on the - * overwritten one then it must itself be overwritten */ - old_object = zend_objects_get_address(zobject TSRMLS_CC); - new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); - - ALLOC_HASHTABLE(new_object->properties); - zend_u_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - - zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC); - - return new_obj_val; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h deleted file mode 100644 index ebb531b87aba8..0000000000000 --- a/Zend/zend_objects.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_H -#define ZEND_OBJECTS_H - -#include "zend.h" - -BEGIN_EXTERN_C() -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC); -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC); -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC); -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c deleted file mode 100644 index 6f929b0e10b25..0000000000000 --- a/Zend/zend_objects_API.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects_API.h" - -#define ZEND_DEBUG_OBJECTS 0 - -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size) -{ - objects->object_buckets = (zend_object_store_bucket *) emalloc(init_size * sizeof(zend_object_store_bucket)); - objects->top = 1; /* Skip 0 so that handles are true */ - objects->size = init_size; - objects->free_list_head = -1; -} - -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects) -{ - efree(objects->object_buckets); - objects->object_buckets = NULL; -} - -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - if (!objects->object_buckets[i].destructor_called) { - objects->object_buckets[i].destructor_called = 1; - if (obj->dtor && obj->object) { - obj->dtor(obj->object, i TSRMLS_CC); - } - } - } - } -} - -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - objects->object_buckets[i].destructor_called = 1; - } - } -} - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - objects->object_buckets[i].valid = 0; - if (obj->free_storage) { - obj->free_storage(obj->object TSRMLS_CC); - } - /* Not adding to free list as we are shutting down anyway */ - } - } -} - - -/* Store objects API */ - -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t free_storage, zend_objects_store_clone_t clone TSRMLS_DC) -{ - zend_object_handle handle; - struct _store_object *obj; - - if (EG(objects_store).free_list_head != -1) { - handle = EG(objects_store).free_list_head; - EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next; - } else { - if (EG(objects_store).top == EG(objects_store).size) { - EG(objects_store).size <<= 1; - EG(objects_store).object_buckets = (zend_object_store_bucket *) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object_store_bucket)); - } - handle = EG(objects_store).top++; - } - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - EG(objects_store).object_buckets[handle].destructor_called = 0; - EG(objects_store).object_buckets[handle].valid = 1; - - obj->refcount = 1; - obj->object = object; - obj->dtor = dtor; - obj->free_storage = free_storage; - - obj->clone = clone; - -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Allocated object id #%d\n", handle); -#endif - return handle; -} - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - EG(objects_store).object_buckets[handle].bucket.obj.refcount++; -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Increased refcount of object id #%d\n", handle); -#endif -} - -#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \ - EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \ - EG(objects_store).free_list_head = handle; \ - EG(objects_store).object_buckets[handle].valid = 0; - -ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle; - struct _store_object *obj; - - if (!EG(objects_store).object_buckets) { - return; - } - - handle = Z_OBJ_HANDLE_P(zobject); - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - /* Make sure we hold a reference count during the destructor call - otherwise, when the destructor ends the storage might be freed - when the refcount reaches 0 a second time - */ - if (EG(objects_store).object_buckets[handle].valid) { - if (obj->refcount == 1) { - if (!EG(objects_store).object_buckets[handle].destructor_called) { - EG(objects_store).object_buckets[handle].destructor_called = 1; - - if (obj->dtor) { - zobject->refcount++; - obj->dtor(obj->object, handle TSRMLS_CC); - zobject->refcount--; - } - } - if (obj->refcount == 1) { - if (obj->free_storage) { - obj->free_storage(obj->object TSRMLS_CC); - } - ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(); - } - } - } - - obj->refcount--; - -#if ZEND_DEBUG_OBJECTS - if (obj->refcount == 0) { - fprintf(stderr, "Deallocated object id #%d\n", handle); - } else { - fprintf(stderr, "Decreased refcount of object id #%d\n", handle); - } -#endif -} - -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - void *new_object; - struct _store_object *obj; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - if (obj->clone == NULL) { - zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %v", Z_OBJCE_P(zobject)->name); - } - - obj->clone(obj->object, &new_object TSRMLS_CC); - - retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC); - retval.handlers = Z_OBJ_HT_P(zobject); - - return retval; -} - -ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - return EG(objects_store).object_buckets[handle].bucket.obj.object; -} - -/* zend_object_store_set_object: - * It is ONLY valid to call this function from within the constructor of an - * overloaded object. Its purpose is to set the object pointer for the object - * when you can't possibly know its value until you have parsed the arguments - * from the constructor function. You MUST NOT use this function for any other - * weird games, or call it at any other time after the object is constructed. - * */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].bucket.obj.object = object; -} - - -/* Called when the ctor was terminated by an exception */ -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].destructor_called = 1; -} - - -/* Proxy objects workings */ -typedef struct _zend_proxy_object { - zval *object; - zval *property; -} zend_proxy_object; - -static zend_object_handlers zend_object_proxy_handlers; - -ZEND_API void zend_objects_proxy_free_storage(zend_proxy_object *object TSRMLS_DC) -{ - zval_ptr_dtor(&object->object); - zval_ptr_dtor(&object->property); - efree(object); -} - -ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_object **object_clone TSRMLS_DC) -{ - *object_clone = emalloc(sizeof(zend_proxy_object)); - (*object_clone)->object = object->object; - (*object_clone)->property = object->property; - zval_add_ref(&(*object_clone)->property); - zval_add_ref(&(*object_clone)->object); -} - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC) -{ - zend_proxy_object *pobj = emalloc(sizeof(zend_proxy_object)); - zval *retval; - - pobj->object = object; - pobj->property = member; - zval_add_ref(&pobj->property); - zval_add_ref(&pobj->object); - - MAKE_STD_ZVAL(retval); - retval->type = IS_OBJECT; - Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC); - Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers; - - return retval; -} - -ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(*property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->write_property) { - Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot write property of object - no write handler defined"); - } -} - -ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) { - return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot read property of object - no read handler defined"); - } - - return NULL; -} - -ZEND_API zend_object_handlers *zend_get_std_object_handlers() -{ - return &std_object_handlers; -} - -static zend_object_handlers zend_object_proxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - - NULL, /* read_property */ - NULL, /* write_property */ - NULL, /* read dimension */ - NULL, /* write_dimension */ - NULL, /* get_property_ptr_ptr */ - zend_object_proxy_get, /* get */ - zend_object_proxy_set, /* set */ - NULL, /* has_property */ - NULL, /* unset_property */ - NULL, /* has_dimension */ - NULL, /* unset_dimension */ - NULL, /* get_properties */ - NULL, /* get_method */ - NULL, /* call_method */ - NULL, /* get_constructor */ - NULL, /* get_class_entry */ - NULL, /* get_class_name */ - NULL, /* compare_objects */ - NULL, /* cast_object */ - NULL, /* count_elements */ -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h deleted file mode 100644 index 028976e8d43e8..0000000000000 --- a/Zend/zend_objects_API.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_API_H -#define ZEND_OBJECTS_API_H - -#include "zend.h" - -typedef void (*zend_objects_store_dtor_t)(void *object, zend_object_handle handle TSRMLS_DC); -typedef void (*zend_objects_free_object_storage_t)(void *object TSRMLS_DC); -typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSRMLS_DC); - -typedef struct _zend_object_store_bucket { - zend_bool destructor_called; - zend_bool valid; - union _store_bucket { - struct _store_object { - void *object; - zend_objects_store_dtor_t dtor; - zend_objects_free_object_storage_t free_storage; - zend_objects_store_clone_t clone; - zend_uint refcount; - } obj; - struct { - int next; - } free_list; - } bucket; -} zend_object_store_bucket; - -typedef struct _zend_objects_store { - zend_object_store_bucket *object_buckets; - zend_uint top; - zend_uint size; - int free_list_head; -} zend_objects_store; - -/* Global store handling functions */ -BEGIN_EXTERN_C() -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size); -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects); - -/* Store API functions */ -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t storage, zend_objects_store_clone_t clone TSRMLS_DC); - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC); -ZEND_API void zend_objects_store_del_ref(zval *object TSRMLS_DC); -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC); -ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC); -/* See comment in zend_objects_API.c before you use this */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC); -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC); - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC); - -#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC); - -ZEND_API zend_object_handlers *zend_get_std_object_handlers(); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c deleted file mode 100644 index ff46517a7475f..0000000000000 --- a/Zend/zend_opcode.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_alloc.h" -#include "zend_compile.h" -#include "zend_extensions.h" -#include "zend_API.h" - -#include "zend_vm.h" - -extern int zend_spprintf(char **message, int max_len, char *format, ...); - -static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_ctor) { - extension->op_array_ctor(op_array); - } -} - -static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_dtor) { - extension->op_array_dtor(op_array); - } -} - -static void op_array_alloc_ops(zend_op_array *op_array) -{ - op_array->opcodes = erealloc(op_array->opcodes, (op_array->size)*sizeof(zend_op)); -} - -void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC) -{ - op_array->type = type; - - op_array->backpatch_count = 0; - if (CG(interactive)) { - /* We must avoid a realloc() on the op_array in interactive mode, since pointers to constants - * will become invalid - */ - initial_ops_size = 8192; - } - - op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint)); - *op_array->refcount = 1; - op_array->size = initial_ops_size; - op_array->last = 0; - op_array->opcodes = NULL; - op_array_alloc_ops(op_array); - - op_array->size_var = 0; /* FIXME:??? */ - op_array->last_var = 0; - op_array->vars = NULL; - - op_array->T = 0; - - op_array->function_name = NULL; - op_array->filename = zend_get_compiled_filename(TSRMLS_C); - op_array->script_encoding = zend_get_compiled_script_encoding(TSRMLS_C); - op_array->doc_comment = NULL; - op_array->doc_comment_len = 0; - - op_array->arg_info = NULL; - op_array->num_args = 0; - op_array->required_num_args = 0; - - op_array->scope = NULL; - - op_array->brk_cont_array = NULL; - op_array->try_catch_array = NULL; - op_array->last_brk_cont = 0; - op_array->current_brk_cont = -1; - - op_array->static_variables = NULL; - op_array->last_try_catch = 0; - - op_array->return_reference = 0; - op_array->done_pass_two = 0; - - op_array->uses_this = 0; - - op_array->start_op = NULL; - - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC); -} - -ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC) -{ - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function TSRMLS_CC); - break; - case ZEND_INTERNAL_FUNCTION: - /* do nothing */ - break; - } -} - -ZEND_API void zend_function_dtor(zend_function *function) -{ - TSRMLS_FETCH(); - - destroy_zend_function(function TSRMLS_CC); -} - -static void zend_cleanup_op_array_data(zend_op_array *op_array) -{ - if (op_array->static_variables) { - zend_hash_clean(op_array->static_variables); - } -} - -ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_cleanup_op_array_data((zend_op_array *) function); - } - return 0; -} - -ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) -{ - if ((*pce)->static_members) { - if ((*pce)->static_members != &(*pce)->default_static_members) { - zend_hash_destroy((*pce)->static_members); - FREE_HASHTABLE((*pce)->static_members); - } - (*pce)->static_members = NULL; - } - if ((*pce)->type == ZEND_USER_CLASS) { - /* Clean all parts that can contain run-time data */ - /* Note that only run-time accessed data need to be cleaned up, pre-defined data can - not contain objects and thus are not probelmatic */ - zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data TSRMLS_CC); - } - return 0; -} - -ZEND_API void destroy_zend_class(zend_class_entry **pce) -{ - zend_class_entry *ce = *pce; - - if (--ce->refcount > 0) { - return; - } - switch (ce->type) { - case ZEND_USER_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - efree(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0 && ce->interfaces) { - efree(ce->interfaces); - } - if (ce->doc_comment) { - efree(ce->doc_comment); - } - efree(ce); - break; - case ZEND_INTERNAL_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - free(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0) { - free(ce->interfaces); - } - if (ce->doc_comment) { - free(ce->doc_comment); - } - free(ce); - break; - } -} - -void zend_class_add_ref(zend_class_entry **ce) -{ - (*ce)->refcount++; -} - -ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes; - zend_op *end = op_array->opcodes+op_array->last; - zend_uint i; - - if (op_array->static_variables) { - zend_hash_destroy(op_array->static_variables); - FREE_HASHTABLE(op_array->static_variables); - } - - if (--(*op_array->refcount)>0) { - return; - } - - efree(op_array->refcount); - - if (op_array->vars) { - i = op_array->last_var; - while (i > 0) { - i--; - efree(op_array->vars[i].name); - } - efree(op_array->vars); - } - - while (oplineop1.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op1.u.constant); -#endif - zval_dtor(&opline->op1.u.constant); - } - if (opline->op2.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op2.u.constant); -#endif - zval_dtor(&opline->op2.u.constant); - } - opline++; - } - efree(op_array->opcodes); - - if (op_array->function_name) { - efree(op_array->function_name); - } - if (op_array->doc_comment) { - efree(op_array->doc_comment); - } - if (op_array->brk_cont_array) { - efree(op_array->brk_cont_array); - } - if (op_array->try_catch_array) { - efree(op_array->try_catch_array); - } - if (op_array->done_pass_two) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC); - } - if (op_array->arg_info) { - for (i=0; inum_args; i++) { - efree(op_array->arg_info[i].name); - if (op_array->arg_info[i].class_name) { - efree(op_array->arg_info[i].class_name); - } - } - efree(op_array->arg_info); - } -} - -void init_op(zend_op *op TSRMLS_DC) -{ - memset(op, 0, sizeof(zend_op)); - op->lineno = CG(zend_lineno); - SET_UNUSED(op->result); -} - -zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC) -{ - zend_uint next_op_num = op_array->last++; - zend_op *next_op; - - if (next_op_num >= op_array->size) { - if (CG(interactive)) { - /* we messed up */ - zend_printf("Ran out of opcode space!\n" - "You should probably consider writing this huge script into a file!\n"); - zend_bailout(); - } - op_array->size *= 4; - op_array_alloc_ops(op_array); - } - - next_op = &(op_array->opcodes[next_op_num]); - - init_op(next_op TSRMLS_CC); - - return next_op; -} - -int get_next_op_number(zend_op_array *op_array) -{ - return op_array->last; -} - -zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array) -{ - op_array->last_brk_cont++; - op_array->brk_cont_array = erealloc(op_array->brk_cont_array, sizeof(zend_brk_cont_element)*op_array->last_brk_cont); - return &op_array->brk_cont_array[op_array->last_brk_cont-1]; -} - -static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes, *end=opline+op_array->last; - - while (oplineopcode == ZEND_EXT_STMT) { - if (opline+1opcode == ZEND_EXT_STMT) { - opline->opcode = ZEND_NOP; - opline++; - continue; - } - if (opline+1lineno = (opline+1)->lineno; - } - } else { - opline->opcode = ZEND_NOP; - } - } - opline++; - } -} - -static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_handler) { - extension->op_array_handler(op_array); - } -} - -int pass_two(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline, *end; - - if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { - return 0; - } - if (CG(extended_info)) { - zend_update_extended_info(op_array TSRMLS_CC); - } - if (CG(handle_op_arrays)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC); - } - - op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last); - op_array->size = op_array->last; - - opline = op_array->opcodes; - end = opline + op_array->last; - while (opline < end) { - if (opline->op1.op_type == IS_CONST) { - opline->op1.u.constant.is_ref = 1; - opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ - } - if (opline->op2.op_type == IS_CONST) { - opline->op2.u.constant.is_ref = 1; - opline->op2.u.constant.refcount = 2; - } - switch (opline->opcode) { - case ZEND_JMP: - opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num]; - break; - case ZEND_JMPZ: - case ZEND_JMPNZ: - case ZEND_JMPZ_EX: - case ZEND_JMPNZ_EX: - opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num]; - break; - } - ZEND_VM_SET_OPCODE_HANDLER(opline); - opline++; - } - - op_array->done_pass_two = 1; - return 0; -} - -int print_class(zend_class_entry *class_entry TSRMLS_DC) -{ - char *tmp; - - zend_spprintf(&tmp, 0, "Class %v:\n", class_entry->name); - printf("%s", tmp); - efree(tmp); - zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC); - zend_spprintf(&tmp, 0, "End of class %v.\n\n", class_entry->name); - printf("%s", tmp); - efree(tmp); - return 0; -} - -ZEND_API unary_op_type get_unary_op(int opcode) -{ - switch (opcode) { - case ZEND_BW_NOT: - return (unary_op_type) bitwise_not_function; - break; - case ZEND_BOOL_NOT: - return (unary_op_type) boolean_not_function; - break; - default: - return (unary_op_type) NULL; - break; - } -} - -ZEND_API void *get_binary_op(int opcode) -{ - switch (opcode) { - case ZEND_ADD: - case ZEND_ASSIGN_ADD: - return (void *) add_function; - break; - case ZEND_SUB: - case ZEND_ASSIGN_SUB: - return (void *) sub_function; - break; - case ZEND_MUL: - case ZEND_ASSIGN_MUL: - return (void *) mul_function; - break; - case ZEND_DIV: - case ZEND_ASSIGN_DIV: - return (void *) div_function; - break; - case ZEND_MOD: - case ZEND_ASSIGN_MOD: - return (void *) mod_function; - break; - case ZEND_SL: - case ZEND_ASSIGN_SL: - return (void *) shift_left_function; - break; - case ZEND_SR: - case ZEND_ASSIGN_SR: - return (void *) shift_right_function; - break; - case ZEND_CONCAT: - case ZEND_ASSIGN_CONCAT: - return (void *) concat_function; - break; - case ZEND_IS_IDENTICAL: - return (void *) is_identical_function; - break; - case ZEND_IS_NOT_IDENTICAL: - return (void *) is_not_identical_function; - break; - case ZEND_IS_EQUAL: - return (void *) is_equal_function; - break; - case ZEND_IS_NOT_EQUAL: - return (void *) is_not_equal_function; - break; - case ZEND_IS_SMALLER: - return (void *) is_smaller_function; - break; - case ZEND_IS_SMALLER_OR_EQUAL: - return (void *) is_smaller_or_equal_function; - break; - case ZEND_BW_OR: - case ZEND_ASSIGN_BW_OR: - return (void *) bitwise_or_function; - break; - case ZEND_BW_AND: - case ZEND_ASSIGN_BW_AND: - return (void *) bitwise_and_function; - break; - case ZEND_BW_XOR: - case ZEND_ASSIGN_BW_XOR: - return (void *) bitwise_xor_function; - break; - default: - return (void *) NULL; - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c deleted file mode 100644 index 1918f30a25f54..0000000000000 --- a/Zend/zend_operators.c +++ /dev/null @@ -1,2535 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_operators.h" -#include "zend_variables.h" -#include "zend_globals.h" -#include "zend_list.h" -#include "zend_fast_cache.h" -#include "zend_API.h" -#include "zend_multiply.h" -#include "zend_strtod.h" - -#include "unicode/uchar.h" -#include "unicode/ucol.h" - -#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1)) - -ZEND_API int zend_atoi(const char *str, int str_len) -{ - int retval; - - if (!str_len) { - str_len = strlen(str); - } - retval = strtol(str, NULL, 0); - if (str_len>0) { - switch (str[str_len-1]) { - case 'g': - case 'G': - retval *= 1024; - /* break intentionally missing */ - case 'm': - case 'M': - retval *= 1024; - /* break intentionally missing */ - case 'k': - case 'K': - retval *= 1024; - break; - } - } - return retval; -} - - -ZEND_API double zend_string_to_double(const char *number, zend_uint length) -{ - double divisor = 10.0; - double result = 0.0; - double exponent; - const char *end = number+length; - const char *digit = number; - - if (!length) { - return result; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result *= 10; - result += *digit - '0'; - } else if (*digit == '.') { - digit++; - break; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result += (*digit - '0') / divisor; - divisor *= 10; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - return result; -} - - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) -{ - switch (op->type) { - case IS_STRING: - case IS_BINARY: - { - char *strval; - - strval = op->value.str.val; - switch ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval, 1))) { - case IS_DOUBLE: - case IS_LONG: - break; - default: - op->value.lval = strtol(op->value.str.val, NULL, 10); - op->type = IS_LONG; - break; - } - STR_FREE(strval); - break; - } - case IS_UNICODE: - { - UChar *strval; - - strval = op->value.ustr.val; - switch ((op->type=is_numeric_unicode(strval, op->value.ustr.len, &op->value.lval, &op->value.dval, 1))) { - case IS_DOUBLE: - case IS_LONG: - break; - default: - op->value.lval = zend_u_strtol(op->value.ustr.val, NULL, 10); - op->type = IS_LONG; - break; - } - USTR_FREE(strval); - break; - } - break; - case IS_BOOL: - op->type = IS_LONG; - break; - case IS_RESOURCE: - zend_list_delete(op->value.lval); - op->type = IS_LONG; - break; - case IS_OBJECT: - convert_to_long_base(op, 10); - break; - case IS_NULL: - op->type = IS_LONG; - op->value.lval = 0; - break; - } -} - -#define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ - if (op->type != IS_LONG) { \ - convert_scalar_to_number(op TSRMLS_CC); \ - } \ - } else { \ - switch ((op)->type) { \ - case IS_STRING: \ - case IS_BINARY: \ - { \ - switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval, 1))) { \ - case IS_DOUBLE: \ - case IS_LONG: \ - break; \ - default: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - (holder).type = IS_LONG; \ - break; \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_UNICODE: \ - { \ - switch (((holder).type=is_numeric_unicode((op)->value.ustr.val, (op)->value.ustr.len, &(holder).value.lval, &(holder).value.dval, 1))) { \ - case IS_DOUBLE: \ - case IS_LONG: \ - break; \ - default: \ - (holder).value.lval = zend_u_strtol((op)->value.ustr.val, NULL, 10); \ - (holder).type = IS_LONG; \ - break; \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_NULL: \ - (holder).value.lval = 0; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - if ((holder).type == IS_LONG) { \ - (op) = &(holder); \ - } \ - break; \ - } \ - } - - -#define DVAL_TO_LVAL(d, l) (l) = (d) > LONG_MAX ? (unsigned long) (d) : (long) (d) - -#define zendi_convert_to_long(op, holder, result) \ - if (op == result) { \ - convert_to_long(op); \ - } else if ((op)->type != IS_LONG) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_DOUBLE: \ - DVAL_TO_LVAL((op)->value.dval, (holder).value.lval); \ - break; \ - case IS_STRING: \ - case IS_BINARY: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - break; \ - case IS_UNICODE: \ - (holder).value.lval = zend_u_strtol((op)->value.ustr.val, NULL, 10); \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - break; \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - break; \ - default: \ - zend_error(E_WARNING, "Cannot convert to ordinal value"); \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - } - - -#define zendi_convert_to_boolean(op, holder, result) \ - if (op==result) { \ - convert_to_boolean(op); \ - } else if ((op)->type != IS_BOOL) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_RESOURCE: \ - case IS_LONG: \ - (holder).value.lval = ((op)->value.lval ? 1 : 0); \ - break; \ - case IS_DOUBLE: \ - (holder).value.lval = ((op)->value.dval ? 1 : 0); \ - break; \ - case IS_STRING: \ - case IS_BINARY: \ - if ((op)->value.str.len == 0 \ - || ((op)->value.str.len==1 && (op)->value.str.val[0]=='0')) { \ - (holder).value.lval = 0; \ - } else { \ - (holder).value.lval = 1; \ - } \ - break; \ - case IS_UNICODE: \ - if ((op)->value.ustr.len == 0 \ - || ((op)->value.ustr.len==1 && \ - ((op)->value.ustr.val[0]=='0'))) { \ - (holder).value.lval = 0; \ - } else { \ - (holder).value.lval = 1; \ - } \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_boolean(&(holder)); \ - break; \ - default: \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_BOOL; \ - (op) = &(holder); \ - } - - -#define convert_object_to_type(op, ctype, conv_func) \ - if (Z_OBJ_HT_P(op)->cast_object) { \ - zval dst; \ - if (Z_OBJ_HT_P(op)->cast_object(op, &dst, ctype TSRMLS_CC) == FAILURE) { \ - zend_error(E_RECOVERABLE_ERROR, \ - "Object of class %v could not be converted to " # ctype, Z_OBJCE_P(op)->name); \ - } else { \ - zval_dtor(op); \ - op->type = ctype; \ - op->value = dst.value; \ - } \ - } else { \ - if(Z_OBJ_HT_P(op)->get) { \ - zval *newop = Z_OBJ_HT_P(op)->get(op TSRMLS_CC); \ - if(Z_TYPE_P(newop) != IS_OBJECT) { \ - /* for safety - avoid loop */ \ - zval_dtor(op); \ - *op = *newop; \ - FREE_ZVAL(newop); \ - conv_func(op); \ - } \ - } \ - } - - -ZEND_API void convert_to_long(zval *op) -{ - convert_to_long_base(op, 10); -} - - -ZEND_API void convert_to_long_base(zval *op, int base) -{ - long tmp; - - switch (op->type) { - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - break; - case IS_DOUBLE: - DVAL_TO_LVAL(op->value.dval, op->value.lval); - break; - case IS_STRING: - case IS_BINARY: - { - char *strval = op->value.str.val; - op->value.lval = strtol(strval, NULL, base); - STR_FREE(strval); - } - break; - case IS_UNICODE: - { - UChar *strval = op->value.ustr.val; - op->value.lval = zend_u_strtol(strval, NULL, base); - USTR_FREE(strval); - } - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - int retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_LONG, convert_to_long); - - if (op->type == IS_LONG) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } else { - zend_error(E_NOTICE, "Object of class %v could not be converted to int", Z_OBJCE_P(op)->name); - } - zval_dtor(op); - ZVAL_LONG(op, retval); - return; - } - default: - zend_error(E_WARNING, "Cannot convert to ordinal value"); - zval_dtor(op); - op->value.lval = 0; - break; - } - - op->type = IS_LONG; -} - - -ZEND_API void convert_to_double(zval *op) -{ - double tmp; - - switch (op->type) { - case IS_NULL: - op->value.dval = 0.0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - op->value.dval = (double) op->value.lval; - break; - case IS_DOUBLE: - break; - case IS_STRING: - case IS_BINARY: - { - char *strval = op->value.str.val; - - op->value.dval = zend_strtod(strval, NULL); - STR_FREE(strval); - } - break; - case IS_UNICODE: - { - UChar *strval = op->value.ustr.val; - - op->value.dval = zend_u_strtod(strval, NULL); - USTR_FREE(strval); - } - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.dval = tmp; - break; - case IS_OBJECT: - { - double retval = 1.0; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_DOUBLE, convert_to_double); - - if (op->type == IS_DOUBLE) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1.0:0.0); - } - } else { - zend_error(E_NOTICE, "Object of class %v could not be converted to double", Z_OBJCE_P(op)->name); - } - - zval_dtor(op); - ZVAL_DOUBLE(op, retval); - break; - } - default: - zend_error(E_WARNING, "Cannot convert to real value (type=%d)", op->type); - zval_dtor(op); - op->value.dval = 0; - break; - } - op->type = IS_DOUBLE; -} - - -ZEND_API void convert_to_null(zval *op) -{ - if (op->type == IS_OBJECT) { - if (Z_OBJ_HT_P(op)->cast_object) { - zval *org; - TSRMLS_FETCH(); - - ALLOC_ZVAL(org); - *org = *op; - if (Z_OBJ_HT_P(op)->cast_object(org, op, IS_NULL TSRMLS_CC) == SUCCESS) { - zval_dtor(org); - return; - } - *op = *org; - } - } - - zval_dtor(op); - op->type = IS_NULL; -} - - -ZEND_API void convert_to_boolean(zval *op) -{ - int tmp; - - switch (op->type) { - case IS_BOOL: - break; - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_LONG: - op->value.lval = (op->value.lval ? 1 : 0); - break; - case IS_DOUBLE: - op->value.lval = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - case IS_BINARY: - { - char *strval = op->value.str.val; - - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - op->value.lval = 0; - } else { - op->value.lval = 1; - } - STR_FREE(strval); - } - break; - case IS_UNICODE: - { - UChar *strval = op->value.ustr.val; - - if (op->value.ustr.len == 0 - || (op->value.ustr.len==1 && - (op->value.ustr.val[0]=='0'))) { - op->value.lval = 0; - } else { - op->value.lval = 1; - } - USTR_FREE(strval); - } - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - zend_bool retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_BOOL, convert_to_boolean); - - if (op->type == IS_BOOL) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } - - zval_dtor(op); - ZVAL_BOOL(op, retval); - break; - } - default: - zval_dtor(op); - op->value.lval = 0; - break; - } - op->type = IS_BOOL; -} - -ZEND_API void _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC) -{ - switch (op->type) { - case IS_NULL: - op->value.ustr.val = USTR_MAKE_REL(""); - op->value.ustr.len = 0; - break; - case IS_UNICODE: - break; - case IS_STRING: - zval_string_to_unicode(op TSRMLS_CC); - break; - case IS_BINARY: - zend_error(E_ERROR, "Cannot convert binary type to Unicode type"); - return; - case IS_BOOL: - if (op->value.lval) { - op->value.ustr.val = USTR_MAKE_REL("1"); - op->value.ustr.len = 1; - } else { - op->value.ustr.val = USTR_MAKE_REL(""); - op->value.ustr.len = 0; - } - break; - case IS_RESOURCE: { - long tmp = op->value.lval; - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - op->value.ustr.val = eumalloc_rel(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG + 1); - op->value.ustr.len = u_sprintf(op->value.ustr.val, "Resource id #%ld", tmp); - break; - } - case IS_LONG: { - int32_t capacity = MAX_LENGTH_OF_LONG + 1; - long lval = op->value.lval; - - op->value.ustr.val = eumalloc_rel(capacity); - op->value.ustr.len = u_sprintf(op->value.ustr.val, "%ld", lval); - break; - } - case IS_DOUBLE: { - int32_t capacity; - double dval = op->value.dval; - TSRMLS_FETCH(); - - capacity = MAX_LENGTH_OF_DOUBLE + EG(precision) + 1; - op->value.ustr.val = eumalloc_rel(capacity); - op->value.ustr.len = u_sprintf(op->value.ustr.val, "%.*G", (int) EG(precision), dval); - break; - } - case IS_ARRAY: - zend_error(E_NOTICE, "Array to string conversion"); - zval_dtor(op); - op->value.ustr.val = USTR_MAKE_REL("Array"); - op->value.ustr.len = sizeof("Array")-1; - break; - case IS_OBJECT: { - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_UNICODE, convert_to_unicode); - - if (op->type == IS_UNICODE) { - return; - } - - zend_error(E_NOTICE, "Object of class %v to string conversion", Z_OBJCE_P(op)->name); - zval_dtor(op); - op->value.ustr.val = USTR_MAKE_REL("Object"); - op->value.ustr.len = sizeof("Object")-1; - break; - } - default: - zval_dtor(op); - ZVAL_BOOL(op, 0); - break; - } - op->type = IS_UNICODE; -} - - -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) -{ - TSRMLS_FETCH(); - _convert_to_string_with_converter(op, ZEND_U_CONVERTER(UG(runtime_encoding_conv)) TSRMLS_CC ZEND_FILE_LINE_CC); -} - -ZEND_API void _convert_to_string_with_converter(zval *op, UConverter *conv TSRMLS_DC ZEND_FILE_LINE_DC) -{ - long lval; - double dval; - - switch (op->type) { - case IS_NULL: - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - break; - case IS_STRING: - if (conv == ZEND_U_CONVERTER(UG(runtime_encoding_conv))) { - break; - } else { - char *s; - int32_t s_len; - UErrorCode status = U_ZERO_ERROR; - s = op->value.str.val; - s_len = op->value.str.len; - zend_convert_encodings(conv, ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &op->value.str.val, &op->value.str.len, s, s_len, &status); - efree(s); - if (U_FAILURE(status)) { - zend_error(E_WARNING, "Error converting string for printing"); - } - } - break; - case IS_BINARY: - zend_error(E_ERROR, "Cannot convert binary type to string type"); - return; - case IS_UNICODE: - zval_unicode_to_string(op, conv TSRMLS_CC); - break; - case IS_BOOL: - if (op->value.lval) { - op->value.str.val = estrndup_rel("1", 1); - op->value.str.len = 1; - } else { - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - } - break; - case IS_RESOURCE: { - long tmp = op->value.lval; - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG); - op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp); - break; - } - case IS_LONG: - lval = op->value.lval; - - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_LONG + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%ld", lval); /* SAFE */ - break; - case IS_DOUBLE: { - TSRMLS_FETCH(); - dval = op->value.dval; - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); /* SAFE */ - /* %G already handles removing trailing zeros from the fractional part, yay */ - break; - } - case IS_ARRAY: - zend_error(E_NOTICE, "Array to string conversion"); - zval_dtor(op); - op->value.str.val = estrndup_rel("Array", sizeof("Array")-1); - op->value.str.len = sizeof("Array")-1; - break; - case IS_OBJECT: { - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_STRING, convert_to_string); - - if (op->type == IS_STRING) { - return; - } - - zend_error(E_NOTICE, "Object of class %v to string conversion", Z_OBJCE_P(op)->name); - zval_dtor(op); - op->value.str.val = estrndup_rel("Object", sizeof("Object")-1); - op->value.str.len = sizeof("Object")-1; - break; - } - default: - zval_dtor(op); - ZVAL_BOOL(op, 0); - break; - } - op->type = IS_STRING; -} - -ZEND_API void _convert_to_binary(zval *op TSRMLS_DC ZEND_FILE_LINE_DC) -{ - if (!UG(unicode)) { - convert_to_string(op); - return; - } - - switch (op->type) { - case IS_BINARY: - break; - case IS_OBJECT: { - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_BINARY, convert_to_binary); - - if (op->type == IS_BINARY) { - return; - } - - zend_error(E_NOTICE, "Object of class %v to binary conversion", Z_OBJCE_P(op)->name); - zval_dtor(op); - op->value.str.val = estrndup("Object", sizeof("Object")-1); - op->value.str.len = sizeof("Object")-1; - break; - } - default: - convert_to_string(op); - break; - } - op->type = IS_BINARY; -} - - -static void convert_scalar_to_array(zval *op, int type TSRMLS_DC) -{ - zval *entry; - - ALLOC_ZVAL(entry); - *entry = *op; - INIT_PZVAL(entry); - - switch (type) { - case IS_ARRAY: - ALLOC_HASHTABLE(op->value.ht); - zend_u_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - zend_hash_index_update(op->value.ht, 0, (void *) &entry, sizeof(zval *), NULL); - op->type = IS_ARRAY; - break; - case IS_OBJECT: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - zend_hash_update(Z_OBJPROP_P(op), "scalar", sizeof("scalar"), (void *) &entry, sizeof(zval *), NULL); - } - break; - } -} - - -ZEND_API void convert_to_array(zval *op) -{ - TSRMLS_FETCH(); - - switch (op->type) { - case IS_ARRAY: - return; - break; -/* OBJECTS_OPTIMIZE */ - case IS_OBJECT: - { - zval *tmp; - HashTable *ht; - - ALLOC_HASHTABLE(ht); - zend_u_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - if (Z_OBJ_HT_P(op)->get_properties) { - HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC); - if(obj_ht) { - zend_hash_copy(ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - } else { - convert_object_to_type(op, IS_ARRAY, convert_to_array); - - if (op->type == IS_ARRAY) { - return; - } - } - zval_dtor(op); - op->type = IS_ARRAY; - op->value.ht = ht; - } - return; - case IS_NULL: - ALLOC_HASHTABLE(op->value.ht); - zend_u_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - op->type = IS_ARRAY; - break; - default: - convert_scalar_to_array(op, IS_ARRAY TSRMLS_CC); - break; - } -} - - -ZEND_API void convert_to_object(zval *op) -{ - TSRMLS_FETCH(); - switch (op->type) { - case IS_ARRAY: - { - object_and_properties_init(op, U_CLASS_ENTRY(zend_standard_class_def), op->value.ht); - return; - break; - } - case IS_OBJECT: - return; - case IS_NULL: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - break; - } - default: - convert_scalar_to_array(op, IS_OBJECT TSRMLS_CC); - break; - } -} - -ZEND_API void multi_convert_to_long_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_long_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_double_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_double_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_string_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_string_ex(arg); - } - - va_end(ap); -} - -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) { - zval *tmp; - - if ((result == op1) && (result == op2)) { - /* $a += $a */ - return SUCCESS; - } - if (result != op1) { - *result = *op1; - zval_copy_ctor(result); - } - zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - return SUCCESS; - } - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval + op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) == (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval + (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) + op2->value.dval) : - (op1->value.dval + ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval + op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval - op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) != (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval - (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) - op2->value.dval) : - (op1->value.dval - ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval - op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long overflow; - - ZEND_SIGNED_MULTIPLY_LONG(op1->value.lval,op2->value.lval, result->value.lval,result->value.dval,overflow); - result->type = overflow ? IS_DOUBLE : IS_LONG; - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) * op2->value.dval) : - (op1->value.dval * ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval * op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* division by zero */ - } - if (op1->type == IS_LONG && op2->type == IS_LONG) { - if (op1->value.lval % op2->value.lval == 0) { /* integer */ - result->type = IS_LONG; - result->value.lval = op1->value.lval / op2->value.lval; - } else { - result->type = IS_DOUBLE; - result->value.dval = ((double) op1->value.lval) / op2->value.lval; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) / op2->value.dval) : - (op1->value.dval / ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval / op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - if (op2->value.lval == 0) { - ZVAL_BOOL(result, 0); - return FAILURE; /* modulus by zero */ - } - - if (abs(op2->value.lval) == 1) { - ZVAL_LONG(result, 0); - return SUCCESS; - } - - result->type = IS_LONG; - result->value.lval = op1->value.lval % op2->value.lval; - return SUCCESS; -} - - - -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - result->type = IS_BOOL; - - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy; - - zendi_convert_to_boolean(op1, op1_copy, result); - - result->type = IS_BOOL; - result->value.lval = !op1->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy = *op1; - - op1 = &op1_copy; - - if (op1->type == IS_DOUBLE) { - op1->value.lval = (long) op1->value.dval; - op1->type = IS_LONG; - } - if (op1->type == IS_LONG) { - result->value.lval = ~op1->value.lval; - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type == IS_STRING || op1->type == IS_BINARY) { - int i; - - result->type = op1->type; - result->value.str.val = estrndup(op1->value.str.val, op1->value.str.len); - result->value.str.len = op1->value.str.len; - for (i = 0; i < op1->value.str.len; i++) { - result->value.str.val[i] = ~op1->value.str.val[i]; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if ((op1->type == IS_STRING && op2->type == IS_STRING) || - (op1->type == IS_BINARY && op2->type == IS_BINARY)) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = op1->type; - result_len = longer->value.str.len; - result_str = estrndup(longer->value.str.val, longer->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] |= shorter->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; - } - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval | op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if ((op1->type == IS_STRING && op2->type == IS_STRING) || - (op1->type == IS_BINARY && op2->type == IS_BINARY)) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = op1->type; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] &= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval & op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if ((op1->type == IS_STRING && op2->type == IS_STRING) || - (op1->type == IS_BINARY && op2->type == IS_BINARY)) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = op1->type; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] ^= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval << op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval >> op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - -/* must support result==op1 */ -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2) -{ - if (op1->type == IS_UNICODE) { - UChar32 codepoint = (UChar32) op2->value.lval; - - if (U_IS_BMP(codepoint)) { - result->value.ustr.len = op1->value.ustr.len + 1; - result->value.ustr.val = eurealloc(op1->value.ustr.val, result->value.ustr.len+1); - result->value.ustr.val[result->value.ustr.len - 1] = (UChar) op2->value.lval; - } else { - result->value.ustr.len = op1->value.ustr.len + 2; - result->value.ustr.val = eurealloc(op1->value.ustr.val, result->value.ustr.len+1); - result->value.ustr.val[result->value.ustr.len - 2] = (UChar) U16_LEAD(codepoint); - result->value.ustr.val[result->value.ustr.len - 1] = (UChar) U16_TRAIL(codepoint); - } - result->value.ustr.val[result->value.ustr.len] = 0; - result->type = IS_UNICODE; - } else { - result->value.str.len = op1->value.str.len + 1; - result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1); - result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval; - result->value.str.val[result->value.str.len] = 0; - result->type = op1->type; - } - return SUCCESS; -} - - -/* must support result==op1 */ -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2) -{ - assert(op1->type == op2->type); - - if (op1->type == IS_UNICODE) { - int32_t length = op1->value.ustr.len + op2->value.ustr.len; - - result->value.ustr.val = eurealloc(op1->value.ustr.val, length+1); - u_memcpy(result->value.ustr.val+op1->value.ustr.len, op2->value.ustr.val, op2->value.ustr.len); - result->value.ustr.val[length] = 0; - result->value.ustr.len = length; - result->type = IS_UNICODE; - } else { - int length = op1->value.str.len + op2->value.str.len; - - result->value.str.val = (char *) erealloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = op1->type; - } - return SUCCESS; -} - - -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - zend_uchar result_type; - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zend_make_unicode_zval(op1, &op1_copy, &use_copy1); - zend_make_unicode_zval(op2, &op2_copy, &use_copy2); - result_type = IS_UNICODE; - } else if (op1->type == IS_BINARY && op2->type == IS_BINARY) { - result_type = IS_BINARY; - /* no conversion necessary */ - use_copy1 = use_copy2 = 0; - } else { - result_type = IS_STRING; - zend_make_string_zval(op1, &op1_copy, &use_copy1); - zend_make_string_zval(op2, &op2_copy, &use_copy2); - } - - if (use_copy1) { - /* We have created a converted copy of op1. Therefore, op1 won't become the result so - * we have to free it. - */ - if (result == op1) { - zval_dtor(op1); - } - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - if (result==op1) { /* special case, perform operations on result */ - add_string_to_string(result, op1, op2); - } else { - if (result_type == IS_UNICODE) { - result->value.ustr.len = op1->value.ustr.len + op2->value.ustr.len; - result->value.ustr.val = eumalloc(result->value.ustr.len + 1); - u_memcpy(result->value.ustr.val, op1->value.ustr.val, op1->value.ustr.len); - u_memcpy(result->value.ustr.val+op1->value.ustr.len, op2->value.ustr.val, op2->value.ustr.len); - result->value.ustr.val[result->value.ustr.len] = 0; - result->type = IS_UNICODE; - } else { - result->value.str.len = op1->value.str.len + op2->value.str.len; - result->value.str.val = (char *) emalloc(result->value.str.len + 1); - memcpy(result->value.str.val, op1->value.str.val, op1->value.str.len); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = result_type; - } - } - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - - -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = zend_binary_zval_strcmp(op1, op2); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - UErrorCode status = U_ZERO_ERROR; - UCollator *col; - - col = ucol_open(UG(default_locale), &status); - - zend_make_unicode_zval(op1, &op1_copy, &use_copy1); - zend_make_unicode_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = ucol_strcoll(col, op1->value.str.val, op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - - ucol_close(col); - - return SUCCESS; -} - -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - op1_copy = *op1; - zval_copy_ctor(&op1_copy); - - op2_copy = *op2; - zval_copy_ctor(&op2_copy); - - convert_to_double(&op1_copy); - convert_to_double(&op2_copy); - - result->value.lval = ZEND_NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval); - result->type = IS_LONG; - - return SUCCESS; -} - - -static inline void zend_free_obj_get_result(zval *op, int free_op) -{ - if (free_op) { - if (op->refcount == 0) { - zval_dtor(op); - FREE_ZVAL(op); - } else { - zval_ptr_dtor(&op); - } - } -} - -#define COMPARE_RETURN_AND_FREE(retval) \ - zend_free_obj_get_result(op1_orig, free_op1); \ - zend_free_obj_get_result(op2_orig, free_op2); \ - return retval; - -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - zend_bool free_op1 = 0, free_op2 = 0; - zval *op1_orig, *op2_orig; - - if (op1->type == IS_OBJECT && Z_OBJ_HT_P(op1)->get) { - op1 = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC); - free_op1 = 1; - } - op1_orig = op1; - if (op2->type == IS_OBJECT && Z_OBJ_HT_P(op2)->get) { - op2 = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); - free_op2 = 1; - } - op2_orig = op2; - - if ((op1->type == IS_NULL && op2->type == IS_STRING) - || (op2->type == IS_NULL && op1->type == IS_STRING)) { - if (op1->type == IS_NULL) { - result->type = IS_LONG; - result->value.lval = zend_binary_strcmp("", 0, op2->value.str.val, op2->value.str.len); - COMPARE_RETURN_AND_FREE(SUCCESS); - } else { - result->type = IS_LONG; - result->value.lval = zend_binary_strcmp(op1->value.str.val, op1->value.str.len, "", 0); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - } - - if ((op1->type == IS_UNICODE || op1->type == IS_STRING || op1->type == IS_BINARY) && - (op2->type == IS_UNICODE || op2->type == IS_STRING || op2->type == IS_BINARY)) { - - if (op1->type == IS_UNICODE || op2->type == IS_UNICODE) { - zendi_u_smart_strcmp(result, op1, op2); - } else if (op1->type == IS_STRING || op2->type == IS_STRING) { - zendi_smart_strcmp(result, op1, op2); - } else { - result->value.lval = zend_binary_zval_strcmp(op1, op2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - if (op1->type == IS_BOOL || op2->type == IS_BOOL - || op1->type == IS_NULL || op2->type == IS_NULL) { - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->type = IS_LONG; - result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) { - /* If the handlers array is not identical, fall through - * and perform get() or cast() if implemented - */ - if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { - zend_compare_objects(result, op1, op2 TSRMLS_CC); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - } - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - result->type = IS_LONG; - result->value.lval = op1->value.lval>op2->value.lval?1:(op1->value.lvalvalue.lval?-1:0); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - if ((op1->type == IS_DOUBLE || op1->type == IS_LONG) - && (op2->type == IS_DOUBLE || op2->type == IS_LONG)) { - result->value.dval = (op1->type == IS_LONG ? (double) op1->value.lval : op1->value.dval) - (op2->type == IS_LONG ? (double) op2->value.lval : op2->value.dval); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - COMPARE_RETURN_AND_FREE(SUCCESS); - } - if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) { - zend_compare_arrays(result, op1, op2 TSRMLS_CC); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - if (op1->type==IS_ARRAY) { - result->value.lval = 1; - result->type = IS_LONG; - COMPARE_RETURN_AND_FREE(SUCCESS); - } - if (op2->type==IS_ARRAY) { - result->value.lval = -1; - result->type = IS_LONG; - COMPARE_RETURN_AND_FREE(SUCCESS); - } - if (op1->type==IS_OBJECT) { - result->value.lval = 1; - result->type = IS_LONG; - COMPARE_RETURN_AND_FREE(SUCCESS); - } - if (op2->type==IS_OBJECT) { - result->value.lval = -1; - result->type = IS_LONG; - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - ZVAL_BOOL(result, 0); - COMPARE_RETURN_AND_FREE(FAILURE); -} - - -static int hash_zval_identical_function(const zval **z1, const zval **z2) -{ - zval result; - TSRMLS_FETCH(); - - /* is_identical_function() returns 1 in case of identity and 0 in case - * of a difference; - * whereas this comparison function is expected to return 0 on identity, - * and non zero otherwise. - */ - if (is_identical_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return !result.value.lval; -} - - -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (op1->type != op2->type) { - result->value.lval = 0; - return SUCCESS; - } - switch (op1->type) { - case IS_NULL: - result->value.lval = (op2->type==IS_NULL); - break; - case IS_BOOL: - case IS_LONG: - case IS_RESOURCE: - result->value.lval = (op1->value.lval == op2->value.lval); - break; - case IS_DOUBLE: - result->value.lval = (op1->value.dval == op2->value.dval); - break; - case IS_STRING: - case IS_BINARY: - if ((op1->value.str.len == op2->value.str.len) - && (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_UNICODE: - if ((op1->value.ustr.len == op2->value.ustr.len) - && (!memcmp(op1->value.ustr.val, op2->value.ustr.val, UBYTES(op1->value.ustr.len)))) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_ARRAY: - if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_OBJECT: - if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { - if (EG(ze1_compatibility_mode)) { - zend_compare_objects(result, op1, op2 TSRMLS_CC); - /* comparison returns 0 in case of equality and - * 1 in case of ineqaulity, we need to reverse it - */ - result->value.lval = !result->value.lval; - } else { - result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); - } - } else { - result->value.lval = 0; - } - break; - default: - ZVAL_BOOL(result, 0); - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - result->value.lval = !result->value.lval; - return SUCCESS; -} - - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval == 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) -{ - zend_uint i; - - for (i=0; inum_interfaces; i++) { - if (instanceof_function(instance_ce->interfaces[i], ce TSRMLS_CC)) { - return 1; - } - } - if (!interfaces_only) { - while (instance_ce) { - if (instance_ce == ce) { - return 1; - } - instance_ce = instance_ce->parent; - } - } - - return 0; -} - -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC) -{ - return instanceof_function_ex(instance_ce, ce, 0 TSRMLS_CC); -} - -#define LOWER_CASE 1 -#define UPPER_CASE 2 -#define NUMERIC 3 - - -static void increment_string(zval *str) -{ - int carry=0; - int pos=str->value.str.len-1; - char *s=str->value.str.val; - char *t; - int last=0; /* Shut up the compiler warning */ - int ch; - - if (str->value.str.len == 0) { - STR_FREE(str->value.str.val); - str->value.str.val = estrndup("1", sizeof("1")-1); - str->value.str.len = 1; - return; - } - - while (pos >= 0) { - ch = s[pos]; - if (ch >= 'a' && ch <= 'z') { - if (ch == 'z') { - s[pos] = 'a'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=LOWER_CASE; - } else if (ch >= 'A' && ch <= 'Z') { - if (ch == 'Z') { - s[pos] = 'A'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=UPPER_CASE; - } else if (ch >= '0' && ch <= '9') { - if (ch == '9') { - s[pos] = '0'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last = NUMERIC; - } else { - carry=0; - break; - } - if (carry == 0) { - break; - } - pos--; - } - - if (carry) { - t = (char *) emalloc(str->value.str.len+1+1); - memcpy(t+1, str->value.str.val, str->value.str.len); - str->value.str.len++; - t[str->value.str.len] = '\0'; - switch (last) { - case NUMERIC: - t[0] = '1'; - break; - case UPPER_CASE: - t[0] = 'A'; - break; - case LOWER_CASE: - t[0] = 'a'; - break; - } - STR_FREE(str->value.str.val); - str->value.str.val = t; - } -} - - -ZEND_API int increment_function(zval *op1) -{ - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MAX) { - /* switch to double */ - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval++; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval + 1; - break; - case IS_NULL: - op1->value.lval = 1; - op1->type = IS_LONG; - break; - case IS_BINARY: - case IS_STRING: { - long lval; - double dval; - char *strval = op1->value.str.val; - - switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - if (lval == LONG_MAX) { - /* switch to double */ - double d = (double)lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval = lval+1; - op1->type = IS_LONG; - } - efree(strval); /* should never be empty_string */ - break; - case IS_DOUBLE: - op1->value.dval = dval+1; - op1->type = IS_DOUBLE; - efree(strval); /* should never be empty_string */ - break; - default: - /* Perl style string increment */ - increment_string(op1); - break; - } - } - break; - case IS_UNICODE: - zend_error(E_ERROR, "Unsupported operand type"); - break; - default: - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int decrement_function(zval *op1) -{ - long lval; - double dval; - - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MIN) { - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval--; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval - 1; - break; - case IS_BINARY: - case IS_STRING: /* Like perl we only support string increment */ - if (op1->value.str.len == 0) { /* consider as 0 */ - STR_FREE(op1->value.str.val); - op1->value.lval = -1; - op1->type = IS_LONG; - break; - } - switch (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - STR_FREE(op1->value.str.val); - if (lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; - case IS_DOUBLE: - STR_FREE(op1->value.str.val); - op1->value.dval = dval - 1; - op1->type = IS_DOUBLE; - break; - } - break; - case IS_UNICODE: - zend_error(E_ERROR, "Unsupported operand type"); - break; - default: - return FAILURE; - } - - return SUCCESS; -} - - -ZEND_API int zval_is_true(zval *op) -{ - convert_to_boolean(op); - return (op->value.lval ? 1 : 0); -} - -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length) -{ - register unsigned char *str = (unsigned char*)source; - register unsigned char *result = (unsigned char*)dest; - register unsigned char *end = str + length; - - while (str < end) { - *result++ = tolower((int)*str++); - } - *result = *end; - - return dest; -} - -ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length) -{ - return zend_str_tolower_copy((char *)emalloc(length+1), source, length); -} - -ZEND_API void *zend_u_str_tolower_copy(zend_uchar type, void *dest, const void *source, unsigned int length) -{ - if (type == IS_UNICODE) { - register UChar *str = (UChar*)source; - register UChar *result = (UChar*)dest; - register UChar *end = str + length; - - while (str < end) { - *result++ = u_tolower((int)*str++); - } - *result = *end; - - return dest; - } else { - return zend_str_tolower_copy(dest, source, length); - } -} - -ZEND_API void *zend_u_str_tolower_dup(zend_uchar type, const void *source, unsigned int length) -{ - if (type == IS_UNICODE) { - return zend_u_str_tolower_copy(IS_UNICODE, emalloc(UBYTES(length+1)), source, length); - } else { - return zend_str_tolower_copy((char*)emalloc(length+1), (char*)source, length); - } -} - -ZEND_API void zend_str_tolower(char *str, unsigned int length) -{ - register unsigned char *p = (unsigned char*)str; - register unsigned char *end = p + length; - - while (p < end) { - *p = tolower((int)*p); - p++; - } -} - -ZEND_API void zend_u_str_tolower(zend_uchar type, void *str, unsigned int length) { - if (type == IS_UNICODE) { - register UChar *p = (UChar*)str; - register UChar *end = p + length; - - while (p < end) { - *p = u_tolower((int)*p); - p++; - } - } else { - zend_str_tolower((char*)str, length); - } -} - -ZEND_API void *zend_u_str_case_fold(zend_uchar type, const void *source, unsigned int length, zend_bool normalize, unsigned int *new_len) -{ - if (type == IS_UNICODE) { - UChar *ret; - int32_t ret_len; - - if (normalize) { - zend_normalize_identifier(&ret, &ret_len, (UChar*)source, length, 1); - } else { - UErrorCode status = U_ZERO_ERROR; - - zend_case_fold_string(&ret, &ret_len, (UChar*)source, length, U_FOLD_CASE_DEFAULT, &status); - } - - *new_len = ret_len; - return ret; - } else { - *new_len = length; - return zend_str_tolower_dup(source, length); - } -} - -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2) -{ - int retval; - - retval = memcmp(s1, s2, MIN(len1, len2)); - if (!retval) { - return (len1 - len2); - } else { - return retval; - } -} - - -ZEND_API int zend_u_binary_strcmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2) -{ - int32_t result = u_strCompare(s1, len1, s2, len2, 1); - return ZEND_NORMALIZE_BOOL(result); -} - - -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int retval; - - retval = memcmp(s1, s2, MIN(length, MIN(len1, len2))); - if (!retval) { - return (MIN(length, len1) - MIN(length, len2)); - } else { - return retval; - } -} - - -ZEND_API int zend_u_binary_strncmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2, uint length) -{ - int32_t off1 = 0, off2 = 0; - UChar32 c1, c2; - int32_t result = 0; - - for( ; length > 0; --length) { - if (off1 >= len1 || off2 >= len2) { - result = len1 - len2; - return ZEND_NORMALIZE_BOOL(result); - } - U16_NEXT(s1, off1, len1, c1); - U16_NEXT(s2, off2, len2, c2); - if (c1 != c2) { - result = (int32_t)c1-(int32_t)c2; - return ZEND_NORMALIZE_BOOL(result); - } - } - - return 0; -} - - -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2) -{ - int len; - int c1, c2; - - len = MIN(len1, len2); - - while (len--) { - c1 = tolower((int)*(unsigned char *)s1++); - c2 = tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return len1 - len2; -} - - -ZEND_API int zend_u_binary_strcasecmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2) -{ - UErrorCode status = U_ZERO_ERROR; - int32_t result = u_strCaseCompare(s1, len1, s2, len2, U_COMPARE_CODE_POINT_ORDER, &status); - return ZEND_NORMALIZE_BOOL(result); -} - - -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int len; - int c1, c2; - - len = MIN(length, MIN(len1, len2)); - - while (len--) { - c1 = tolower((int)*(unsigned char *)s1++); - c2 = tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return MIN(length, len1) - MIN(length, len2); -} - - -/* - * Because we do not know UChar offsets for the passed-in limit of the number of - * codepoints to compare, we take a hit upfront by iterating over both strings - * until we find them. Then we can simply use u_strCaseCompare(). - */ -ZEND_API int zend_u_binary_strncasecmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2, uint length) -{ - UErrorCode status = U_ZERO_ERROR; - int32_t off1 = 0, off2 = 0; - int32_t result; - - U16_FWD_N(s1, off1, len1, length); - U16_FWD_N(s2, off2, len2, length); - result = u_strCaseCompare(s1, off1, s2, off2, U_COMPARE_CODE_POINT_ORDER, &status); - return ZEND_NORMALIZE_BOOL(result); -} - - -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2) -{ - return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - - -ZEND_API int zend_u_binary_zval_strcmp(zval *s1, zval *s2) -{ - return zend_u_binary_strcmp(s1->value.ustr.val, s1->value.ustr.len, s2->value.ustr.val, s2->value.ustr.len); -} - - -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2) -{ - return zend_binary_strcasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - - -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) -{ - int ret1, ret2; - long lval1, lval2; - double dval1, dval2; - - if (s1->type == IS_BINARY || s2->type == IS_BINARY) { - zend_error(E_ERROR, "Cannot convert binary type to string type"); - return; - } - - if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) && - (ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) { - if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) { - if (ret1!=IS_DOUBLE) { - dval1 = zend_strtod(s1->value.str.val, NULL); - } else if (ret2!=IS_DOUBLE) { - dval2 = zend_strtod(s2->value.str.val, NULL); - } - result->value.dval = dval1 - dval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - } else { /* they both have to be long's */ - result->value.lval = lval1 - lval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - } else { - result->value.lval = zend_binary_zval_strcmp(s1, s2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - return; -} - - -ZEND_API void zendi_u_smart_strcmp(zval *result, zval *s1, zval *s2) -{ - int ret1, ret2; - long lval1, lval2; - double dval1, dval2; - zval s1_copy, s2_copy; - int use_copy1 = 0, use_copy2 = 0; - - if (s1->type != IS_UNICODE || s2->type != IS_UNICODE) { - zend_make_unicode_zval(s1, &s1_copy, &use_copy1); - zend_make_unicode_zval(s2, &s2_copy, &use_copy2); - if (use_copy1) { - s1 = &s1_copy; - } - if (use_copy2) { - s2 = &s2_copy; - } - } - - if ((ret1=is_numeric_unicode(s1->value.ustr.val, s1->value.ustr.len, &lval1, &dval1, 0)) && - (ret2=is_numeric_unicode(s2->value.ustr.val, s2->value.ustr.len, &lval2, &dval2, 0))) { - if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) { - if (ret1!=IS_DOUBLE) { - dval1 = zend_u_strtod(s1->value.ustr.val, NULL); - } else if (ret2!=IS_DOUBLE) { - dval2 = zend_u_strtod(s2->value.ustr.val, NULL); - } - result->value.dval = dval1 - dval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - } else { /* they both have to be long's */ - result->value.lval = lval1 - lval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - } else { - result->value.lval = zend_u_binary_zval_strcmp(s1, s2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - - if (use_copy1) { - zval_dtor(s1); - } - if (use_copy2) { - zval_dtor(s2); - } - return; -} - - -static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC) -{ - zval result; - - if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return result.value.lval; -} - -ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - - -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - result->type = IS_LONG; - result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) -{ - zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht TSRMLS_CC); -} - - -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) -{ - result->type = IS_LONG; - - if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { - result->value.lval = 0; - return; - } - - if (Z_OBJ_HT_P(o1)->compare_objects == NULL) { - result->value.lval = 1; - } else { - result->value.lval = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC); - } -} - -ZEND_API void zend_locale_usprintf_double(zval *op ZEND_FILE_LINE_DC) -{ - double dval = op->value.dval; - UFILE *strf; - int32_t capacity; - - TSRMLS_FETCH(); - - capacity = MAX_LENGTH_OF_DOUBLE + EG(precision) + 1; - op->value.ustr.val = eumalloc_rel(capacity); - /* UTODO uses default locale for now */ - strf = u_fstropen(op->value.ustr.val, capacity, NULL); - op->value.ustr.len = u_fprintf(strf, "%.*G", (int) EG(precision), dval); - u_fclose(strf); -} - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) -{ - double dval = op->value.dval; - - TSRMLS_FETCH(); - - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); - op->value.str.len = strlen(op->value.str.val); -} - -ZEND_API void zend_locale_usprintf_long(zval *op ZEND_FILE_LINE_DC) -{ - long lval = op->value.lval; - UFILE *strf; - int32_t capacity; - - capacity = MAX_LENGTH_OF_LONG + 1; - op->value.ustr.val = eumalloc_rel(capacity); - /* UTODO uses default locale for now */ - strf = u_fstropen(op->value.ustr.val, capacity, NULL); - op->value.ustr.len = u_fprintf(strf, "%ld", lval); - u_fclose(strf); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h deleted file mode 100644 index 4984117b91221..0000000000000 --- a/Zend/zend_operators.h +++ /dev/null @@ -1,447 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OPERATORS_H -#define ZEND_OPERATORS_H - -#include -#include - -#ifdef HAVE_IEEEFP_H -#include -#endif - -#include "zend_strtod.h" -#include "zend_unicode.h" - -#if 0&&HAVE_BCMATH -#include "ext/bcmath/libbcmath/src/bcmath.h" -#endif - -#define MAX_LENGTH_OF_LONG 20 -#define MAX_LENGTH_OF_DOUBLE 32 - -BEGIN_EXTERN_C() -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC); -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC); -ZEND_API long zend_u_strtol(const UChar *nptr, UChar **endptr, int base); -ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr); -END_EXTERN_C() - -static inline zend_uchar is_numeric_string(char *str, int length, long *lval, double *dval, zend_bool allow_errors) -{ - long local_lval; - double local_dval; - char *end_ptr_long, *end_ptr_double; - int conv_base=10; - - if (!length) { - return 0; - } - - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - errno=0; - local_lval = strtol(str, &end_ptr_long, conv_base); - if (errno!=ERANGE) { - if (end_ptr_long == str+length) { /* integer string */ - if (lval) { - *lval = local_lval; - } - return IS_LONG; - } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */ - return 0; - } - } else { - end_ptr_long=NULL; - } - - if (conv_base==16) { /* hex string, under UNIX strtod() messes it up */ - return 0; - } - - errno=0; - local_dval = zend_strtod(str, &end_ptr_double); - if (errno != ERANGE) { - if (end_ptr_double == str+length) { /* floating point string */ - if (!zend_finite(local_dval)) { - /* "inf","nan" and maybe other weird ones */ - return 0; - } - - if (dval) { - *dval = local_dval; - } - return IS_DOUBLE; - } - } else { - end_ptr_double=NULL; - } - if (allow_errors) { - if (end_ptr_double>end_ptr_long && dval) { - *dval = local_dval; - return IS_DOUBLE; - } else if (end_ptr_long && lval) { - *lval = local_lval; - return IS_LONG; - } - } - return 0; -} - -static inline zend_uchar is_numeric_unicode(UChar *str, int32_t length, long *lval, double *dval, zend_bool allow_errors) -{ - int32_t local_lval; - double local_dval; - UChar *end_ptr_long, *end_ptr_double; - int conv_base=10; - - if (!length) { - return 0; - } - - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - - errno=0; - local_lval = zend_u_strtol(str, &end_ptr_long, conv_base); - if (errno != ERANGE) { - if (end_ptr_long == str+length) { /* integer string */ - if (lval) { - *lval = local_lval; - } - return IS_LONG; - } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */ - return 0; - } - } else { - end_ptr_long = NULL; - } - - if (conv_base == 16) { /* hex string, under UNIX strtod() messes it up */ - /* UTODO: keep compatibility with is_numeric_string() here? */ - return 0; - } - - local_dval = zend_u_strtod(str, &end_ptr_double); - if (local_dval == 0 && end_ptr_double == str) { - end_ptr_double = NULL; - } else { - if (end_ptr_double == str+length) { /* floating point string */ - if (!zend_finite(local_dval)) { - /* "inf","nan" and maybe other weird ones */ - return 0; - } - - if (dval) { - *dval = local_dval; - } - return IS_DOUBLE; - } - } - - if (allow_errors) { - if (end_ptr_double > end_ptr_long && dval) { - *dval = local_dval; - return IS_DOUBLE; - } else if (end_ptr_long && lval) { - *lval = local_lval; - return IS_LONG; - } - } - return 0; -} - -static inline UChar* -zend_u_memnstr(UChar *haystack, UChar *needle, int32_t needle_len, UChar *end) -{ - return u_strFindFirst(haystack, end - haystack, needle, needle_len); -} - -static inline char * -zend_memnstr(char *haystack, char *needle, int needle_len, char *end) -{ - char *p = haystack; - char ne = needle[needle_len-1]; - - end -= needle_len; - - while (p <= end) { - if ((p = (char *)memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { - if (!memcmp(needle, p, needle_len-1)) { - return p; - } - } - - if (p == NULL) { - return NULL; - } - - p++; - } - - return NULL; -} - - -BEGIN_EXTERN_C() -ZEND_API int increment_function(zval *op1); -ZEND_API int decrement_function(zval *op2); - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC); -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC); -ZEND_API void _convert_to_string_with_converter(zval *op, UConverter *conv TSRMLS_DC ZEND_FILE_LINE_DC); -ZEND_API void _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC); -ZEND_API void _convert_to_unicode_with_converter(zval *op, UConverter *conv TSRMLS_DC ZEND_FILE_LINE_DC); -ZEND_API void _convert_to_binary(zval *op TSRMLS_DC ZEND_FILE_LINE_DC); -ZEND_API void convert_to_long(zval *op); -ZEND_API void convert_to_double(zval *op); -ZEND_API void convert_to_long_base(zval *op, int base); -ZEND_API void convert_to_null(zval *op); -ZEND_API void convert_to_boolean(zval *op); -ZEND_API void convert_to_array(zval *op); -ZEND_API void convert_to_object(zval *op); -ZEND_API void multi_convert_to_long_ex(int argc, ...); -ZEND_API void multi_convert_to_double_ex(int argc, ...); -ZEND_API void multi_convert_to_string_ex(int argc, ...); -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2); -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2); -#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC) -#define convert_to_string_with_converter(op, conv) _convert_to_string_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC) -#define convert_to_unicode(op) _convert_to_unicode((op) TSRMLS_CC ZEND_FILE_LINE_CC) -#define convert_to_unicode_with_converter(op, conv) _convert_to_unicode_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC) -#define convert_to_binary(op) _convert_to_binary((op) TSRMLS_CC ZEND_FILE_LINE_CC) -#define convert_to_text(op) (UG(unicode)?convert_to_unicode(op):convert_to_string(op)) - -ZEND_API double zend_string_to_double(const char *number, zend_uint length); - -ZEND_API int zval_is_true(zval *op); -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#if HAVE_STRCOLL -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#endif - -ZEND_API void zend_str_tolower(char *str, unsigned int length); -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length); -ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length); - -ZEND_API void zend_u_str_tolower(zend_uchar type, void *str, unsigned int length); -ZEND_API void *zend_u_str_tolower_copy(zend_uchar type, void *dest, const void *source, unsigned int length); -ZEND_API void *zend_u_str_tolower_dup(zend_uchar type, const void *source, unsigned int length); - -ZEND_API void *zend_u_str_case_fold(zend_uchar type, const void *source, unsigned int length, zend_bool normalize, unsigned int *new_len); - -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length); -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length); - -ZEND_API int zend_u_binary_zval_strcmp(zval *s1, zval *s2); -ZEND_API int zend_u_binary_strcmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2); -ZEND_API int zend_u_binary_strncmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2, uint length); -ZEND_API int zend_u_binary_strcasecmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2); -ZEND_API int zend_u_binary_strncasecmp(UChar *s1, int32_t len1, UChar *s2, int32_t len2, uint length); - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2); -ZEND_API void zendi_u_smart_strcmp(zval *result, zval *s1, zval *s2); -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC); -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC); -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC); - -ZEND_API int zend_atoi(const char *str, int str_len); - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); -ZEND_API void zend_locale_usprintf_double(zval *op ZEND_FILE_LINE_DC); -ZEND_API void zend_locale_usprintf_long(zval *op ZEND_FILE_LINE_DC); -END_EXTERN_C() -#define convert_to_ex_master(ppzv, lower_type, upper_type) \ - if ((*ppzv)->type!=IS_##upper_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_##lower_type(*ppzv); \ - } - -#define convert_to_explicit_type(pzv, type) \ - do { \ - switch (type) { \ - case IS_NULL: \ - convert_to_null(pzv); \ - break; \ - case IS_LONG: \ - convert_to_long(pzv); \ - break; \ - case IS_DOUBLE: \ - convert_to_double(pzv); \ - break; \ - case IS_BOOL: \ - convert_to_boolean(pzv); \ - break; \ - case IS_ARRAY: \ - convert_to_array(pzv); \ - break; \ - case IS_OBJECT: \ - convert_to_object(pzv); \ - break; \ - case IS_STRING: \ - convert_to_string(pzv); \ - break; \ - case IS_UNICODE: \ - convert_to_unicode(pzv); \ - break; \ - case IS_BINARY: \ - convert_to_binary(pzv); \ - break; \ - default: \ - assert(0); \ - break; \ - } \ - } while (0); \ - -#define convert_to_explicit_type_ex(ppzv, str_type) \ - if ((*ppzv)->type != str_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_explicit_type(*ppzv, str_type); \ - } - -#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL) -#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG) -#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE) -#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING) -#define convert_to_unicode_ex(ppzv) convert_to_ex_master(ppzv, unicode, UNICODE) -#define convert_to_binary_ex(ppzv) convert_to_ex_master(ppzv, binary, BINARY) -#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY) -#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT) -#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL) -#define convert_to_text_ex(ppzv) if (UG(unicode)) {convert_to_unicode_ex(ppzv);} else {convert_to_string_ex(ppzv);} - -#define convert_scalar_to_number_ex(ppzv) \ - if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \ - if (!(*ppzv)->is_ref) { \ - SEPARATE_ZVAL(ppzv); \ - } \ - convert_scalar_to_number(*ppzv TSRMLS_CC); \ - } - - -#define Z_LVAL(zval) (zval).value.lval -#define Z_BVAL(zval) ((zend_bool)(zval).value.lval) -#define Z_DVAL(zval) (zval).value.dval -#define Z_STRVAL(zval) (zval).value.str.val -#define Z_STRLEN(zval) (zval).value.str.len -#define Z_USTRVAL(zval) (zval).value.ustr.val -#define Z_USTRLEN(zval) (zval).value.ustr.len -#define Z_USTRCPLEN(zval) (u_countChar32((zval).value.ustr.val, (zval).value.ustr.len)) -#define Z_BINVAL(zval) Z_STRVAL(zval) -#define Z_BINLEN(zval) Z_STRLEN(zval) -#define Z_ARRVAL(zval) (zval).value.ht -#define Z_OBJ_HANDLE(zval) (zval).value.obj.handle -#define Z_OBJ_HT(zval) (zval).value.obj.handlers -#define Z_OBJCE(zval) zend_get_class_entry(&(zval) TSRMLS_CC) -#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) -#define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf -#define Z_RESVAL(zval) (zval).value.lval -#define Z_UNIVAL(zval) ((zval).type==IS_UNICODE?(char*)(zval).value.ustr.val:(zval).value.str.val) -#define Z_UNILEN(zval) ((zval).type==IS_UNICODE?(zval).value.ustr.len:(zval).value.str.len) - -#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) -#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) -#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p) -#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p) -#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p) -#define Z_USTRVAL_P(zval_p) Z_USTRVAL(*zval_p) -#define Z_USTRLEN_P(zval_p) Z_USTRLEN(*zval_p) -#define Z_USTRCPLEN_P(zval_p) Z_USTRCPLEN(*zval_p) -#define Z_BINVAL_P(zval) Z_STRVAL_P(zval) -#define Z_BINLEN_P(zval) Z_STRLEN_P(zval) -#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p) -#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p) -#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p) -#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p) -#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p) -#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p) -#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h) -#define Z_UNIVAL_P(zval_p) Z_UNIVAL(*zval_p) -#define Z_UNILEN_P(zval_p) Z_UNILEN(*zval_p) - -#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp) -#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp) -#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp) -#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp) -#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp) -#define Z_USTRVAL_PP(zval_pp) Z_USTRVAL(**zval_pp) -#define Z_USTRLEN_PP(zval_pp) Z_USTRLEN(**zval_pp) -#define Z_USTRCPLEN_PP(zval_pp) Z_USTRCPLEN(**zval_pp) -#define Z_BINVAL_PP(zval) Z_STRVAL_PP(zval) -#define Z_BINLEN_PP(zval) Z_STRLEN_PP(zval) -#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp) -#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp) -#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp) -#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp) -#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p) -#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p) -#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h) -#define Z_UNIVAL_PP(zval_pp) Z_UNIVAL(**zval_pp) -#define Z_UNILEN_PP(zval_pp) Z_UNILEN(**zval_pp) - -#define Z_TYPE(zval) (zval).type -#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p) -#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp) - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c deleted file mode 100644 index 74a51ec505b51..0000000000000 --- a/Zend/zend_ptr_stack.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ptr_stack.h" -#ifdef HAVE_STDARG_H -# include -#endif - -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) -{ - stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*PTR_STACK_BLOCK_SIZE); - stack->max = PTR_STACK_BLOCK_SIZE; - stack->top = 0; -} - - -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void *elem; - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void *); - stack->top++; - *(stack->top_element++) = elem; - count--; - } - va_end(ptr); -} - - -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void **elem; - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void **); - *elem = *(--stack->top_element); - stack->top--; - count--; - } - va_end(ptr); -} - - - -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) -{ - if (stack->elements) { - efree(stack->elements); - } -} - - -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) -{ - int i = stack->top; - - while (--i >= 0) { - func(stack->elements[i]); - } -} - - -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements) -{ - zend_ptr_stack_apply(stack, func); - if (free_elements) { - int i = stack->top; - - while (--i >= 0) { - efree(stack->elements[i]); - } - } - stack->top = 0; - stack->top_element = stack->elements; -} - - -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) -{ - return stack->top; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h deleted file mode 100644 index 4e13f52374a8c..0000000000000 --- a/Zend/zend_ptr_stack.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_PTR_STACK_H -#define ZEND_PTR_STACK_H - -typedef struct _zend_ptr_stack { - int top, max; - void **elements; - void **top_element; -} zend_ptr_stack; - - -#define PTR_STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements); -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); -END_EXTERN_C() - -#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ - if (stack->top+count > stack->max) { \ - /* we need to allocate more memory */ \ - stack->max *= 2; \ - stack->max += count; \ - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); \ - stack->top_element = stack->elements+stack->top; \ - } - -/* Not doing this with a macro because of the loop unrolling in the element assignment. - Just using a macro for 3 in the body for readability sake. */ -static inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c) -{ -#define ZEND_PTR_STACK_NUM_ARGS 3 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - *(stack->top_element++) = c; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b) -{ -#define ZEND_PTR_STACK_NUM_ARGS 2 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - *c = *(--stack->top_element); - stack->top -= 3; -} - -static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - stack->top -= 2; -} - -static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) -{ - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) - - stack->top++; - *(stack->top_element++) = ptr; -} - -static inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) -{ - stack->top--; - return *(--stack->top_element); -} - -#endif /* ZEND_PTR_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c deleted file mode 100644 index 612aa441cf65f..0000000000000 --- a/Zend/zend_qsort.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" - -#include - -#define QSORT_STACK_SIZE (sizeof(size_t) * CHAR_BIT) - -static void _zend_qsort_swap(void *a, void *b, size_t siz) -{ - register char *tmp_a_char; - register char *tmp_b_char; - register int *tmp_a_int; - register int *tmp_b_int; - register size_t i; - int t_i; - char t_c; - - tmp_a_int = (int *) a; - tmp_b_int = (int *) b; - - for (i = sizeof(int); i <= siz; i += sizeof(int)) { - t_i = *tmp_a_int; - *tmp_a_int++ = *tmp_b_int; - *tmp_b_int++ = t_i; - } - - tmp_a_char = (char *) tmp_a_int; - tmp_b_char = (char *) tmp_b_int; - - for (i = i - sizeof(int) + 1; i <= siz; ++i) { - t_c = *tmp_a_char; - *tmp_a_char++ = *tmp_b_char; - *tmp_b_char++ = t_c; - } -} - -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC) -{ - void *begin_stack[QSORT_STACK_SIZE]; - void *end_stack[QSORT_STACK_SIZE]; - register char *begin; - register char *end; - register char *seg1; - register char *seg2; - register char *seg2p; - register int loop; - uint offset; - - begin_stack[0] = (char *) base; - end_stack[0] = (char *) base + ((nmemb - 1) * siz); - - for (loop = 0; loop >= 0; --loop) { - begin = begin_stack[loop]; - end = end_stack[loop]; - - while (begin < end) { - offset = (end - begin) >> 1; - _zend_qsort_swap(begin, begin + (offset - (offset % siz)), siz); - - seg1 = begin + siz; - seg2 = end; - - while (1) { - for (; seg1 < seg2 && compare(begin, seg1 TSRMLS_CC) > 0; - seg1 += siz); - - for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0; - seg2 -= siz); - - if (seg1 >= seg2) - break; - - _zend_qsort_swap(seg1, seg2, siz); - - seg1 += siz; - seg2 -= siz; - } - - _zend_qsort_swap(begin, seg2, siz); - - seg2p = seg2; - - if ((seg2p - begin) <= (end - seg2p)) { - if ((seg2p + siz) < end) { - begin_stack[loop] = seg2p + siz; - end_stack[loop++] = end; - } - end = seg2p - siz; - } - else { - if ((seg2p - siz) > begin) { - begin_stack[loop] = begin; - end_stack[loop++] = seg2p - siz; - } - begin = seg2p + siz; - } - } - } -} - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h deleted file mode 100644 index b785388361b16..0000000000000 --- a/Zend/zend_qsort.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_QSORT_H -#define ZEND_QSORT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_QSORT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_reflection_api.c b/Zend/zend_reflection_api.c deleted file mode 100644 index 588e44669cd89..0000000000000 --- a/Zend/zend_reflection_api.c +++ /dev/null @@ -1,4248 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Timm Friebe | - | George Schlossnagle | - | Andrei Zmievski | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#include "zend.h" -#include "zend_API.h" -#include "zend_exceptions.h" -#include "zend_operators.h" -#include "zend_constants.h" -#include "zend_ini.h" -#include "zend_interfaces.h" - -/* Class entry pointers */ -ZEND_API zend_class_entry *reflector_ptr; -ZEND_API zend_class_entry *reflection_exception_ptr; -ZEND_API zend_class_entry *reflection_ptr; -ZEND_API zend_class_entry *reflection_function_ptr; -ZEND_API zend_class_entry *reflection_parameter_ptr; -ZEND_API zend_class_entry *reflection_class_ptr; -ZEND_API zend_class_entry *reflection_object_ptr; -ZEND_API zend_class_entry *reflection_method_ptr; -ZEND_API zend_class_entry *reflection_property_ptr; -ZEND_API zend_class_entry *reflection_extension_ptr; - -/* Method macros */ - -#define METHOD_NOTSTATIC(ce) \ - if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), U_CLASS_ENTRY(ce) TSRMLS_CC)) { \ - zend_error(E_ERROR, "%v() cannot be called statically", get_active_function_name(TSRMLS_C)); \ - return; \ - } \ - -#define METHOD_NOTSTATIC_NUMPARAMS(ce, c) METHOD_NOTSTATIC(ce) \ - if (ZEND_NUM_ARGS() > c) { \ - ZEND_WRONG_PARAM_COUNT(); \ - } \ - -/* Exception throwing macro */ -#define _DO_THROW(msg) \ - zend_throw_exception(U_CLASS_ENTRY(reflection_exception_ptr), msg, 0 TSRMLS_CC); \ - return; \ - -#define RETURN_ON_EXCEPTION \ - if (EG(exception) && Z_OBJCE_P(EG(exception)) == U_CLASS_ENTRY(reflection_exception_ptr)) { \ - return; \ - } - -#define GET_REFLECTION_OBJECT_PTR(target) \ - intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC); \ - if (intern == NULL || intern->ptr == NULL) { \ - RETURN_ON_EXCEPTION \ - zend_error(E_ERROR, "Internal error: Failed to retrieve the reflection object"); \ - } \ - target = intern->ptr; \ - -/* {{{ Smart string functions */ -typedef struct _string { - char *string; - int len; - int alloced; -} string; - -static void string_init(string *str) -{ - str->string = (char *) emalloc(1024); - str->len = 1; - str->alloced = 1024; - *str->string = '\0'; -} - -static string *string_printf(string *str, const char *format, ...) -{ - int len; - va_list arg; - char *s_tmp; - - va_start(arg, format); - len = zend_vspprintf(&s_tmp, 0, format, arg); - if (len) { - register int nlen = (str->len + len + (1024 - 1)) & ~(1024 - 1); - if (str->alloced < nlen) { - str->alloced = nlen; - str->string = erealloc(str->string, str->alloced); - } - memcpy(str->string + str->len - 1, s_tmp, len + 1); - str->len += len; - } - efree(s_tmp); - va_end(arg); - return str; -} - -static string *string_write(string *str, char *buf, int len) -{ - register int nlen = (str->len + len + (1024 - 1)) & ~(1024 - 1); - if (str->alloced < nlen) { - str->alloced = nlen; - str->string = erealloc(str->string, str->alloced); - } - memcpy(str->string + str->len - 1, buf, len); - str->len += len; - str->string[str->len - 1] = '\0'; - return str; -} - -static string *string_append(string *str, string *append) -{ - if (append->len > 1) { - string_write(str, append->string, append->len - 1); - } - return str; -} - -static void string_free(string *str) -{ - efree(str->string); - str->len = 0; - str->alloced = 0; - str->string = NULL; -} -/* }}} */ - -/* Struct for properties */ -typedef struct _property_reference { - zend_class_entry *ce; - zend_property_info *prop; -} property_reference; - -/* Struct for parameters */ -typedef struct _parameter_reference { - zend_uint offset; - zend_uint required; - struct _zend_arg_info *arg_info; - zend_function *fptr; -} parameter_reference; - -/* Struct for reflection objects */ -typedef struct { - zend_object zo; - void *ptr; - unsigned int free_ptr:1; - zval *obj; - zend_class_entry *ce; -} reflection_object; - -static zend_object_handlers reflection_object_handlers; - -static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) -{ - zval **value; - - if (zend_hash_find(Z_OBJPROP_P(object), name, name_len, (void **) &value) == FAILURE) { - RETURN_FALSE; - } - - *return_value = **value; - zval_copy_ctor(return_value); -} - -static void reflection_register_implement(zend_class_entry *class_entry, zend_class_entry *interface_entry TSRMLS_DC) -{ - zend_uint num_interfaces = ++class_entry->num_interfaces; - - class_entry->interfaces = (zend_class_entry **) realloc(class_entry->interfaces, sizeof(zend_class_entry *) * num_interfaces); - class_entry->interfaces[num_interfaces - 1] = interface_entry; -} - -static void reflection_free_objects_storage(void *object TSRMLS_DC) -{ - reflection_object *intern = (reflection_object *) object; - - if (intern->free_ptr && intern->ptr) { - efree(intern->ptr); - intern->ptr = NULL; - } - if (intern->obj) { - zval_ptr_dtor(&intern->obj); - } - zend_objects_free_object_storage(object TSRMLS_CC); -} - -static void reflection_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - reflection_object *intern = (reflection_object *) object; - reflection_object **intern_clone = (reflection_object **) object_clone; - - *intern_clone = emalloc(sizeof(reflection_object)); - (*intern_clone)->zo.ce = intern->zo.ce; - (*intern_clone)->zo.in_get = 0; - (*intern_clone)->zo.in_set = 0; - (*intern_clone)->zo.in_unset = 0; - (*intern_clone)->zo.in_isset = 0; - ALLOC_HASHTABLE((*intern_clone)->zo.properties); - (*intern_clone)->ptr = intern->ptr; - (*intern_clone)->free_ptr = intern->free_ptr; - (*intern_clone)->obj = intern->obj; - if (intern->obj) { - zval_add_ref(&intern->obj); - } -} - -static zend_object_value reflection_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zval tmp; - zend_object_value retval; - reflection_object *intern; - - intern = emalloc(sizeof(reflection_object)); - intern->zo.ce = class_type; - intern->zo.in_get = 0; - intern->zo.in_set = 0; - intern->zo.in_unset = 0; - intern->zo.in_isset = 0; - intern->ptr = NULL; - intern->obj = NULL; - intern->free_ptr = 0; - - ALLOC_HASHTABLE(intern->zo.properties); - zend_u_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - retval.handle = zend_objects_store_put(intern, NULL, reflection_free_objects_storage, reflection_objects_clone TSRMLS_CC); - retval.handlers = &reflection_object_handlers; - return retval; -} - -static zval * reflection_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; - return object; -} - -static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC); -static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char *indent TSRMLS_DC); -static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC); -static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC); -static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC); - -/* {{{ _class_string */ -static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC) -{ - int count, count_static_props = 0, count_static_funcs = 0, count_shadow_props = 0; - string sub_indent; - - string_init(&sub_indent); - string_printf(&sub_indent, "%s ", indent); - - /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) */ - if (ce->type == ZEND_USER_CLASS && ce->doc_comment) { - string_printf(str, "%s%s", indent, ce->doc_comment); - string_write(str, "\n", 1); - } - - if (obj) { - string_printf(str, "%sObject of class [ ", indent); - } else { - string_printf(str, "%s%s [ ", indent, (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : "Class"); - } - string_printf(str, (ce->type == ZEND_USER_CLASS) ? "module) { - string_printf(str, ":%s", ce->module->name); - } - string_printf(str, "> "); - if (ce->get_iterator != NULL) { - string_printf(str, " "); - } - if (ce->ce_flags & ZEND_ACC_INTERFACE) { - string_printf(str, "interface "); - } else { - if (ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - string_printf(str, "abstract "); - } - if (ce->ce_flags & ZEND_ACC_FINAL_CLASS) { - string_printf(str, "final "); - } - string_printf(str, "class "); - } - string_printf(str, "%v", ce->name); - if (ce->parent) { - string_printf(str, " extends %v", ce->parent->name); - } - - if (ce->num_interfaces) { - zend_uint i; - - string_printf(str, " implements %v", ce->interfaces[0]->name); - for (i = 1; i < ce->num_interfaces; ++i) { - string_printf(str, ", %v", ce->interfaces[i]->name); - } - } - string_printf(str, " ] {\n"); - - /* The information where a class is declared is only available for user classes */ - if (ce->type == ZEND_USER_CLASS) { - string_printf(str, "%s @@ %s %d-%d\n", indent, ce->filename, - ce->line_start, ce->line_end); - } - - /* Constants */ - if (&ce->constants_table) { - string_printf(str, "\n"); - count = zend_hash_num_elements(&ce->constants_table); - string_printf(str, "%s - Constants [%d] {\n", indent, count); - if (count > 0) { - HashPosition pos; - zval **value; - char *key; - uint key_len; - ulong num_index; - - zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->constants_table, (void **) &value, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_len, &num_index, 0, &pos); - - _const_string(str, key, *value, indent TSRMLS_CC); - zend_hash_move_forward_ex(&ce->constants_table, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - /* Static properties */ - if (&ce->properties_info) { - /* counting static properties */ - count = zend_hash_num_elements(&ce->properties_info); - if (count > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if(prop->flags & ZEND_ACC_SHADOW) { - count_shadow_props++; - } else if (prop->flags & ZEND_ACC_STATIC) { - count_static_props++; - } - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - - /* static properties */ - string_printf(str, "\n%s - Static properties [%d] {\n", indent, count_static_props); - if (count_static_props > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if ((prop->flags & ZEND_ACC_STATIC) && !(prop->flags & ZEND_ACC_SHADOW)) { - _property_string(str, prop, NULL, sub_indent.string TSRMLS_CC); - } - - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - /* Static methods */ - if (&ce->function_table) { - /* counting static properties */ - count = zend_hash_num_elements(&ce->function_table); - if (count > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - count_static_funcs++; - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } - - /* static properties */ - string_printf(str, "\n%s - Static methods [%d] {", indent, count_static_funcs); - if (count_static_funcs > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - string_printf(str, "\n"); - _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } else { - string_printf(str, "\n"); - } - string_printf(str, "%s }\n", indent); - } - - /* Default/Implicit properties */ - if (&ce->properties_info) { - count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; - string_printf(str, "\n%s - Properties [%d] {\n", indent, count); - if (count > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if (!(prop->flags & (ZEND_ACC_STATIC|ZEND_ACC_SHADOW))) { - _property_string(str, prop, NULL, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - if (obj && Z_OBJ_HT_P(obj)->get_properties) { - string dyn; - HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj TSRMLS_CC); - HashPosition pos; - zval **prop; - - string_init(&dyn); - count = 0; - - zend_hash_internal_pointer_reset_ex(properties, &pos); - - while (zend_hash_get_current_data_ex(properties, (void **) &prop, &pos) == SUCCESS) { - char *prop_name; - uint prop_name_size; - ulong index; - - if (zend_hash_get_current_key_ex(properties, &prop_name, &prop_name_size, &index, 1, &pos) == HASH_KEY_IS_STRING) { - if (prop_name_size && prop_name[0]) { /* skip all private and protected properties */ - if (!zend_hash_quick_exists(&ce->properties_info, prop_name, prop_name_size, zend_get_hash_value(prop_name, prop_name_size))) { - count++; - _property_string(&dyn, NULL, prop_name, sub_indent.string TSRMLS_CC); - } - } - efree(prop_name); - } - zend_hash_move_forward_ex(properties, &pos); - } - - string_printf(str, "\n%s - Dynamic properties [%d] {\n", indent, count); - string_append(str, &dyn); - string_printf(str, "%s }\n", indent); - string_free(&dyn); - } - - /* Non static methods */ - if (&ce->function_table) { - count = zend_hash_num_elements(&ce->function_table) - count_static_funcs; - string_printf(str, "\n%s - Methods [%d] {", indent, count); - if (count > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (!(mptr->common.fn_flags & ZEND_ACC_STATIC)) { - string_printf(str, "\n"); - _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } else { - string_printf(str, "\n"); - } - string_printf(str, "%s }\n", indent); - } - - string_printf(str, "%s}\n", indent); - string_free(&sub_indent); -} -/* }}} */ - -/* {{{ _const_string */ -static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC) -{ - string_printf(str, "%s Constant [ %s %s ] { }\n", - indent, - zend_zval_type_name(value), - name); -} -/* }}} */ - -/* {{{ _get_recv_opcode */ -static zend_op* _get_recv_op(zend_op_array *op_array, zend_uint offset) -{ - zend_op *op = op_array->opcodes; - zend_op *end = op + op_array->last; - - ++offset; - while (op < end) { - if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) && - op->op1.u.constant.value.lval == offset) { - return op; - } - ++op; - } - return NULL; -} -/* }}} */ - -/* {{{ _parameter_string */ -static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, char* indent TSRMLS_DC) -{ - string_printf(str, "Parameter #%d [ ", offset); - if (offset >= required) { - string_printf(str, " "); - } else { - string_printf(str, " "); - } - if (arg_info->class_name) { - string_printf(str, "%v ", arg_info->class_name); - if (arg_info->allow_null) { - string_printf(str, "or NULL "); - } - } else if (arg_info->array_type_hint) { - string_printf(str, "array "); - if (arg_info->allow_null) { - string_printf(str, "or NULL "); - } - } - if (arg_info->pass_by_reference) { - string_write(str, "&", sizeof("&")-1); - } - if (arg_info->name) { - string_printf(str, "$%v", arg_info->name); - } else { - string_printf(str, "$param%d", offset); - } - if (fptr->type == ZEND_USER_FUNCTION && offset >= required) { - zend_op *precv = _get_recv_op((zend_op_array*)fptr, offset); - if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2.op_type != IS_UNUSED) { - zval *zv, zv_copy; - int use_copy; - string_write(str, " = ", sizeof(" = ")-1); - ALLOC_ZVAL(zv); - *zv = precv->op2.u.constant; - zval_copy_ctor(zv); - INIT_PZVAL(zv); - zval_update_constant(&zv, (void*)1 TSRMLS_CC); - if (Z_TYPE_P(zv) == IS_BOOL) { - if (Z_LVAL_P(zv)) { - string_write(str, "true", sizeof("true")-1); - } else { - string_write(str, "false", sizeof("false")-1); - } - } else if (Z_TYPE_P(zv) == IS_NULL) { - string_write(str, "NULL", sizeof("NULL")-1); - } else if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_BINARY) { - if (Z_TYPE_P(zv) == IS_BINARY) { - string_write(str, "b'", sizeof("b")-1); - } - string_write(str, "'", sizeof("'")-1); - string_write(str, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 15)); - if (Z_STRLEN_P(zv) > 15) { - string_write(str, "...", sizeof("...")-1); - } - string_write(str, "'", sizeof("'")-1); - } else if (Z_TYPE_P(zv) == IS_UNICODE) { - string_write(str, "'", sizeof("'")-1); - zend_make_printable_zval(zv, &zv_copy, &use_copy); - string_write(str, Z_STRVAL(zv_copy), MIN(Z_STRLEN(zv_copy), 15)); - if (Z_STRLEN(zv_copy) > 15) { - string_write(str, "...", sizeof("...")-1); - } - string_write(str, "'", sizeof("'")-1); - if (use_copy) { - zval_dtor(&zv_copy); - } - } else { - zend_make_printable_zval(zv, &zv_copy, &use_copy); - string_write(str, Z_STRVAL(zv_copy), Z_STRLEN(zv_copy)); - if (use_copy) { - zval_dtor(&zv_copy); - } - } - zval_ptr_dtor(&zv); - } - } - string_write(str, " ]", sizeof(" ]")-1); -} -/* }}} */ - -/* {{{ _function_parameter_string */ -static void _function_parameter_string(string *str, zend_function *fptr, char* indent TSRMLS_DC) -{ - struct _zend_arg_info *arg_info = fptr->common.arg_info; - zend_uint i, required = fptr->common.required_num_args; - - if (!arg_info) { - return; - } - - string_printf(str, "\n"); - string_printf(str, "%s- Parameters [%d] {\n", indent, fptr->common.num_args); - for (i = 0; i < fptr->common.num_args; i++) { - string_printf(str, "%s ", indent); - _parameter_string(str, fptr, arg_info, i, required, indent TSRMLS_CC); - string_write(str, "\n", sizeof("\n")-1); - arg_info++; - } - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _function_string */ -static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC) -{ - string param_indent; - zend_function *overwrites; - char *lc_name; - unsigned int lc_name_len; - - /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) - * What's "wrong" is that any whitespace before the doc comment start is - * swallowed, leading to an unaligned comment. - */ - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { - string_printf(str, "%s%s\n", indent, fptr->op_array.doc_comment); - } - - string_printf(str, fptr->common.scope ? "%sMethod [ " : "%sFunction [ ", indent); - string_printf(str, (fptr->type == ZEND_USER_FUNCTION) ? "type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function*)fptr)->module) { - string_printf(str, ":%s", ((zend_internal_function*)fptr)->module->name); - } - if (scope && fptr->common.scope) { - if (fptr->common.scope != scope) { - string_printf(str, ", inherits %v", fptr->common.scope->name); - } else if (fptr->common.scope->parent) { - lc_name = zend_u_str_case_fold(IS_STRING, fptr->common.function_name, strlen(fptr->common.function_name), 1, &lc_name_len); - if (zend_u_hash_find(&fptr->common.scope->parent->function_table, IS_STRING, lc_name, lc_name_len + 1, (void**) &overwrites) == SUCCESS) { - if (fptr->common.scope != overwrites->common.scope) { - string_printf(str, ", overwrites %v", overwrites->common.scope->name); - } - } - efree(lc_name); - } - } - if (fptr->common.prototype && fptr->common.prototype->common.scope) { - string_printf(str, ", prototype %v", fptr->common.prototype->common.scope->name); - } - if (fptr->common.fn_flags & ZEND_ACC_CTOR) { - string_printf(str, ", ctor"); - } - if (fptr->common.fn_flags & ZEND_ACC_DTOR) { - string_printf(str, ", dtor"); - } - string_printf(str, "> "); - - if (fptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - string_printf(str, "abstract "); - } - if (fptr->common.fn_flags & ZEND_ACC_FINAL) { - string_printf(str, "final "); - } - if (fptr->common.fn_flags & ZEND_ACC_STATIC) { - string_printf(str, "static "); - } - - /* These are mutually exclusive */ - switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - string_printf(str, "public "); - break; - case ZEND_ACC_PRIVATE: - string_printf(str, "private "); - break; - case ZEND_ACC_PROTECTED: - string_printf(str, "protected "); - break; - default: - string_printf(str, " "); - break; - } - - string_printf(str, fptr->common.scope ? "method " : "function "); - if (fptr->op_array.return_reference) { - string_printf(str, "&"); - } - string_printf(str, "%v ] {\n", fptr->common.function_name); - /* The information where a function is declared is only available for user classes */ - if (fptr->type == ZEND_USER_FUNCTION) { - string_printf(str, "%s @@ %s %d - %d\n", indent, - fptr->op_array.filename, - fptr->op_array.line_start, - fptr->op_array.line_end); - } - string_init(¶m_indent); - string_printf(¶m_indent, "%s ", indent); - _function_parameter_string(str, fptr, param_indent.string TSRMLS_CC); - string_free(¶m_indent); - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _property_string */ -static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC) -{ - char *class_name; - - string_printf(str, "%sProperty [ ", indent); - if (!prop) { - string_printf(str, " public $%s", prop_name); - } else { - if (!(prop->flags & ZEND_ACC_STATIC)) { - if (prop->flags & ZEND_ACC_IMPLICIT_PUBLIC) { - string_write(str, " ", sizeof(" ") - 1); - } else { - string_write(str, " ", sizeof(" ") - 1); - } - } - - /* These are mutually exclusive */ - switch (prop->flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - string_printf(str, "public "); - break; - case ZEND_ACC_PRIVATE: - string_printf(str, "private "); - break; - case ZEND_ACC_PROTECTED: - string_printf(str, "protected "); - break; - } - if(prop->flags & ZEND_ACC_STATIC) { - string_printf(str, "static "); - } - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, &class_name, &prop_name); - string_printf(str, "$%v", prop_name); - } - - string_printf(str, " ]\n"); -} -/* }}} */ - -static int _extension_ini_string(zend_ini_entry *ini_entry, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - int number = va_arg(args, int); - char *comma = ""; - - if (number == ini_entry->module_number) { - string_printf(str, " %sEntry [ %s <", indent, ini_entry->name); - if (ini_entry->modifiable & ZEND_INI_ALL) { - string_printf(str, "ALL"); - } else { - if (ini_entry->modifiable & ZEND_INI_USER) { - string_printf(str, "USER"); - comma = ","; - } - if (ini_entry->modifiable & ZEND_INI_PERDIR) { - string_printf(str, "%sPERDIR", comma); - comma = ","; - } - if (ini_entry->modifiable & ZEND_INI_SYSTEM) { - string_printf(str, "%sSYSTEM", comma); - } - } - - string_printf(str, "> ]\n"); - string_printf(str, " %s Current = '%s'\n", indent, ini_entry->value ? ini_entry->value : ""); - if (ini_entry->modified) { - string_printf(str, " %s Default = '%s'\n", indent, ini_entry->orig_value ? ini_entry->orig_value : ""); - } - string_printf(str, " %s}\n", indent); - } - return ZEND_HASH_APPLY_KEEP; -} - -static int _extension_class_string(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int *num_classes = va_arg(args, int*); - TSRMLS_FETCH(); - - if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) { - string_printf(str, "\n"); - _class_string(str, *pce, NULL, indent TSRMLS_CC); - (*num_classes)++; - } - return ZEND_HASH_APPLY_KEEP; -} - -static int _extension_const_string(zend_constant *constant, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int *num_classes = va_arg(args, int*); - - if (constant->module_number == module->module_number) { - TSRMLS_FETCH(); - _const_string(str, constant->name, &constant->value, indent TSRMLS_CC); - (*num_classes)++; - } - return ZEND_HASH_APPLY_KEEP; -} - -/* {{{ _extension_string */ -static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC) -{ - string_printf(str, "%sExtension [ ", indent); - if (module->type == MODULE_PERSISTENT) { - string_printf(str, ""); - } - if (module->type == MODULE_TEMPORARY) { - string_printf(str, "" ); - } - string_printf(str, " extension #%d %s version %s ] {\n", - module->module_number, module->name, - (module->version == NO_VERSION_YET) ? "" : module->version); - - { - string str_ini; - string_init(&str_ini); - zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number); - if (str_ini.len > 1) { - string_printf(str, "\n - INI {\n"); - string_append(str, &str_ini); - string_printf(str, "%s }\n", indent); - } - string_free(&str_ini); - } - - { - string str_constants; - int num_constants = 0; - - string_init(&str_constants); - zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants TSRMLS_CC); - if (num_constants) { - string_printf(str, "\n - Constants [%d] {\n", num_constants); - string_append(str, &str_constants); - string_printf(str, "%s }\n", indent); - } - string_free(&str_constants); - } - - if (module->functions && module->functions->fname) { - zend_function *fptr; - zend_function_entry *func = module->functions; - - string_printf(str, "\n - Functions {\n"); - - /* Is there a better way of doing this? */ - while (func->fname) { - if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) { - zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - continue; - } - - _function_string(str, fptr, NULL, " " TSRMLS_CC); - func++; - } - string_printf(str, "%s }\n", indent); - } - - { - string str_classes; - string sub_indent; - int num_classes = 0; - - string_init(&sub_indent); - string_printf(&sub_indent, "%s ", indent); - string_init(&str_classes); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.string, module, &num_classes TSRMLS_CC); - if (num_classes) { - string_printf(str, "\n - Classes [%d] {", num_classes); - string_append(str, &str_classes); - string_printf(str, "%s }\n", indent); - } - string_free(&str_classes); - string_free(&sub_indent); - } - - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _function_check_flag */ -static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - RETURN_BOOL(mptr->common.fn_flags & mask); -} -/* }}} */ - -/* {{{ zend_reflection_class_factory */ -ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - - MAKE_STD_ZVAL(name); - ZVAL_TEXTL(name, ce->name, ce->name_length, 1); - reflection_instanciate(U_CLASS_ENTRY(reflection_class_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = ce; - intern->free_ptr = 0; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_extension_factory */ -static void reflection_extension_factory(zval *object, char *name_str TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - int name_len = strlen(name_str); - char *lcname; - struct _zend_module_entry *module; - - lcname = do_alloca(name_len + 1); - zend_str_tolower_copy(lcname, name_str, name_len); - if (zend_hash_find(&module_registry, lcname, name_len + 1, (void **)&module) == FAILURE) { - free_alloca(lcname); - return; - } - free_alloca(lcname); - - reflection_instanciate(U_CLASS_ENTRY(reflection_extension_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - MAKE_STD_ZVAL(name); - ZVAL_STRINGL(name, module->name, name_len, 1); - intern->ptr = module; - intern->free_ptr = 0; - intern->ce = NULL; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_parameter_factory */ -static void reflection_parameter_factory(zend_function *fptr, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, zval *object TSRMLS_DC) -{ - reflection_object *intern; - parameter_reference *reference; - zval *name; - - MAKE_STD_ZVAL(name); - if (arg_info->name) { - ZVAL_TEXTL(name, arg_info->name, arg_info->name_len, 1); - } else { - ZVAL_NULL(name); - } - reflection_instanciate(U_CLASS_ENTRY(reflection_parameter_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - reference = (parameter_reference*) emalloc(sizeof(parameter_reference)); - reference->arg_info = arg_info; - reference->offset = offset; - reference->required = required; - reference->fptr = fptr; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = fptr->common.scope; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_function_factory */ -static void reflection_function_factory(zend_function *function, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, function->common.function_name, 1); - - reflection_instanciate(U_CLASS_ENTRY(reflection_function_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = function; - intern->free_ptr = 0; - intern->ce = NULL; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_method_factory */ -static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - zval *classname; - - MAKE_STD_ZVAL(name); - MAKE_STD_ZVAL(classname); - ZVAL_TEXT(name, method->common.function_name, 1); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - reflection_instanciate(U_CLASS_ENTRY(reflection_method_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = method; - intern->free_ptr = 0; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_property_factory */ -static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - zval *classname; - property_reference *reference; - char *class_name, *prop_name; - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, &class_name, &prop_name); - - if (!(prop->flags & ZEND_ACC_PRIVATE)) { - /* we have to seach the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce->parent; - zend_property_info *tmp_info; - - while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { - if (tmp_info->flags & ZEND_ACC_PRIVATE) { - /* private in super class => NOT the same property */ - break; - } - ce = tmp_ce; - prop = tmp_info; - tmp_ce = tmp_ce->parent; - } - } - - MAKE_STD_ZVAL(name); - MAKE_STD_ZVAL(classname); - ZVAL_TEXT(name, prop_name, 1); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - - reflection_instanciate(U_CLASS_ENTRY(reflection_property_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - reference = (property_reference*) emalloc(sizeof(property_reference)); - reference->ce = ce; - reference->prop = prop; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ _reflection_export */ -static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_ptr, int ctor_argc) -{ - zval *reflector_ptr; - zval output, *output_ptr = &output; - zval *argument_ptr, *argument2_ptr; - zval *retval_ptr, **params[2]; - int result; - int return_output = 0; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval fname; - - if (ctor_argc == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &argument_ptr, &return_output) == FAILURE) { - return; - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) { - return; - } - } - - INIT_PZVAL(&output); - - /* Create object */ - MAKE_STD_ZVAL(reflector_ptr); - if (object_and_properties_init(reflector_ptr, ce_ptr, NULL) == FAILURE) { - _DO_THROW("Could not create reflector"); - } - - /* Call __construct() */ - params[0] = &argument_ptr; - params[1] = &argument2_ptr; - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &reflector_ptr; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = ctor_argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce_ptr->constructor; - fcc.calling_scope = ce_ptr; - fcc.object_pp = &reflector_ptr; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - if (EG(exception)) { - zval_ptr_dtor(&reflector_ptr); - return; - } - if (result == FAILURE) { - zval_ptr_dtor(&reflector_ptr); - _DO_THROW("Could not create reflector"); - } - - /* Call static reflection::export */ - ZVAL_BOOL(&output, return_output); - params[0] = &reflector_ptr; - params[1] = &output_ptr; - - ZVAL_STRINGL(&fname, "export", sizeof("export") - 1, 0); - fci.function_table = &U_CLASS_ENTRY(reflection_ptr)->function_table; - fci.function_name = &fname; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = params; - fci.no_separation = 1; - - result = zend_call_function(&fci, NULL TSRMLS_CC); - - if (result == FAILURE && EG(exception) == NULL) { - zval_ptr_dtor(&reflector_ptr); - zval_ptr_dtor(&retval_ptr); - _DO_THROW("Could not execute reflection::export()"); - } - - if (return_output) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } else { - zval_ptr_dtor(&retval_ptr); - } - - /* Destruct reflector which is no longer needed */ - zval_ptr_dtor(&reflector_ptr); -} -/* }}} */ - -/* {{{ Preventing __clone from being called */ -ZEND_METHOD(reflection, __clone) -{ - /* Should never be executable */ - _DO_THROW("Cannot clone object using __clone()"); -} -/* }}} */ - -/* {{{ proto public static mixed Reflection::export(Reflector r [, bool return]) - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection, export) -{ - zval *object, fname, *retval_ptr; - int result; - zend_bool return_output = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, U_CLASS_ENTRY(reflector_ptr), &return_output) == FAILURE) { - return; - } - - /* Invoke the __toString() method */ - ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1, 1); - result= call_user_function_ex(NULL, &object, &fname, &retval_ptr, 0, NULL, 0, NULL TSRMLS_CC); - zval_dtor(&fname); - - if (result == FAILURE) { - _DO_THROW("Invocation of method __toString() failed"); - /* Returns from this function */ - } - - if (!retval_ptr) { - zend_error(E_WARNING, "%v::__toString() did not return anything", Z_OBJCE_P(object)->name); - RETURN_FALSE; - } - - if (return_output) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } else { - /* No need for _r variant, return of __toString should always be a string */ - zend_print_zval(retval_ptr, 0); - zend_printf("\n"); - zval_ptr_dtor(&retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public static array Reflection::getModifierNames(int modifiers) - Returns an array of modifier names */ -ZEND_METHOD(reflection, getModifierNames) -{ - long modifiers; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &modifiers) == FAILURE) { - return; - } - - array_init(return_value); - - if (modifiers & (ZEND_ACC_ABSTRACT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - add_next_index_stringl(return_value, "abstract", sizeof("abstract")-1, 1); - } - if (modifiers & (ZEND_ACC_FINAL | ZEND_ACC_FINAL_CLASS)) { - add_next_index_stringl(return_value, "final", sizeof("final")-1, 1); - } - - /* These are mutually exclusive */ - switch (modifiers & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - add_next_index_stringl(return_value, "public", sizeof("public")-1, 1); - break; - case ZEND_ACC_PRIVATE: - add_next_index_stringl(return_value, "private", sizeof("private")-1, 1); - break; - case ZEND_ACC_PROTECTED: - add_next_index_stringl(return_value, "protected", sizeof("protected")-1, 1); - break; - } - - if (modifiers & ZEND_ACC_STATIC) { - add_next_index_stringl(return_value, "static", sizeof("static")-1, 1); - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionFunction::export(string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_function, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_function_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionFunction::__construct(string name) - Constructor. Throws an Exception in case the given function does not exist */ -ZEND_METHOD(reflection_function, __construct) -{ - zval *name; - zval *object; - unsigned int lcname_len; - char *lcname; - reflection_object *intern; - zend_function *fptr; - char *name_str; - int name_len; - zend_uchar type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name_str, &name_len, &type) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), type, lcname, lcname_len + 1, (void **)&fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Function %R() does not exist", type, name_str); - return; - } - efree(lcname); - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, fptr->common.function_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = fptr; - intern->free_ptr = 0; - intern->ce = NULL; -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_function, __toString) -{ - reflection_object *intern; - zend_function *fptr; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - string_init(&str); - _function_string(&str, fptr, intern->ce, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getName() - Returns this function's name */ -ZEND_METHOD(reflection, function_getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::isInternal() - Returns whether this is an internal function */ -ZEND_METHOD(reflection, function_isInternal) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::isUserDefined() - Returns whether this is an user-defined function */ -ZEND_METHOD(reflection_function, isUserDefined) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - RETURN_BOOL(fptr->type == ZEND_USER_FUNCTION); -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getFileName() - Returns the filename of the file this function was declared in */ -ZEND_METHOD(reflection_function, getFileName) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_STRING(fptr->op_array.filename, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionFunction::getStartLine() - Returns the line this function's declaration starts at */ -ZEND_METHOD(reflection_function, getStartLine) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_LONG(fptr->op_array.line_start); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionFunction::getEndLine() - Returns the line this function's declaration ends at */ -ZEND_METHOD(reflection_function, getEndLine) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_LONG(fptr->op_array.line_end); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getDocComment() - Returns the doc comment for this function */ -ZEND_METHOD(reflection_function, getDocComment) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { - RETURN_STRINGL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public array ReflectionFunction::getStaticVariables() - Returns an associative array containing this function's static variables and their values */ -ZEND_METHOD(reflection_function, getStaticVariables) -{ - zval *tmp_copy; - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - - /* Return an empty array in case no static variables exist */ - array_init(return_value); - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) { - zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); - } -} -/* }}} */ - -/* {{{ proto public mixed ReflectionFunction::invoke(mixed* args) - Invokes the function */ -ZEND_METHOD(reflection_function, invoke) -{ - zval *retval_ptr; - zval ***params; - int result; - int argc = ZEND_NUM_ARGS(); - zend_fcall_info fci; - zend_fcall_info_cache fcc; - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = fptr; - fcc.calling_scope = EG(scope); - fcc.object_pp = NULL; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of function %v() failed", fptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -static int _zval_array_to_c_array(zval **arg, zval ****params TSRMLS_DC) /* {{{ */ -{ - *(*params)++ = arg; - return ZEND_HASH_APPLY_KEEP; -} /* }}} */ - -/* {{{ proto public mixed ReflectionFunction::invokeArgs(array args) - Invokes the function and pass its arguments as array. */ -ZEND_METHOD(reflection_function, invokeArgs) -{ - zval *retval_ptr; - zval ***params; - int result; - int argc; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - reflection_object *intern; - zend_function *fptr; - zval *param_array; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", ¶m_array) == FAILURE) { - return; - } - - argc = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - params = safe_emalloc(sizeof(zval **), argc, 0); - zend_hash_apply_with_argument(Z_ARRVAL_P(param_array), (apply_func_arg_t)_zval_array_to_c_array, ¶ms TSRMLS_CC); - params -= argc; - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = fptr; - fcc.calling_scope = EG(scope); - fcc.object_pp = NULL; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of function %v() failed", fptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::returnsReference() - Gets whether this function returns a reference */ -ZEND_METHOD(reflection_function, returnsReference) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_BOOL(fptr->op_array.return_reference); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::getNumberOfParameters() - Gets the number of required parameters */ -ZEND_METHOD(reflection_function, getNumberOfParameters) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_LONG(fptr->common.num_args); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::getNumberOfRequiredParameters() - Gets the number of required parameters */ -ZEND_METHOD(reflection_function, getNumberOfRequiredParameters) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_LONG(fptr->common.required_num_args); -} -/* }}} */ - -/* {{{ proto public ReflectionParameter[] ReflectionFunction::getParameters() - Returns an array of parameter objects for this function */ -ZEND_METHOD(reflection_function, getParameters) -{ - reflection_object *intern; - zend_function *fptr; - zend_uint i; - struct _zend_arg_info *arg_info; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - arg_info= fptr->common.arg_info; - - array_init(return_value); - for (i = 0; i < fptr->common.num_args; i++) { - zval *parameter; - - ALLOC_ZVAL(parameter); - reflection_parameter_factory(fptr, arg_info, i, fptr->common.required_num_args, parameter TSRMLS_CC); - add_next_index_zval(return_value, parameter); - - arg_info++; - } -} -/* }}} */ - -/* {{{ proto public ReflectionExtension|NULL ReflectionFunction::getExtension() - Returns NULL or the extension the function belongs to */ -ZEND_METHOD(reflection_function, getExtension) -{ - reflection_object *intern; - zend_function *fptr; - zend_internal_function *internal; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (fptr->type != ZEND_INTERNAL_FUNCTION) { - RETURN_NULL(); - } - - internal = (zend_internal_function *)fptr; - if (internal->module) { - reflection_extension_factory(return_value, internal->module->name TSRMLS_CC); - } else { - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto public string|false ReflectionFunction::getExtensionName() - Returns false or the name of the extension the function belongs to */ -ZEND_METHOD(reflection_function, getExtensionName) -{ - reflection_object *intern; - zend_function *fptr; - zend_internal_function *internal; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (fptr->type != ZEND_INTERNAL_FUNCTION) { - RETURN_FALSE; - } - - internal = (zend_internal_function *)fptr; - if (internal->module) { - RETURN_STRING(internal->module->name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_parameter, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_parameter_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionParameter::__construct(mixed function, mixed parameter) - Constructor. Throws an Exception in case the given method does not exist */ -ZEND_METHOD(reflection_parameter, __construct) -{ - parameter_reference *ref; - zval *reference, *parameter; - zval *object; - zval *name; - reflection_object *intern; - zend_function *fptr; - struct _zend_arg_info *arg_info; - int position; - zend_class_entry *ce = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, ¶meter) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* First, find the function */ - switch (Z_TYPE_P(reference)) { - case IS_UNICODE: - case IS_STRING: { - unsigned int lcname_len; - char *lcname; - - convert_to_text_ex(&reference); - lcname = zend_u_str_case_fold(Z_TYPE_P(reference), Z_UNIVAL_P(reference), Z_UNILEN_P(reference), 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(reference), lcname, lcname_len + 1, (void**) &fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Function %R() does not exist", Z_TYPE_P(reference), Z_UNIVAL_P(reference)); - return; - } - efree(lcname); - } - break; - - case IS_ARRAY: { - zval **classref; - zval **method; - zend_class_entry **pce; - unsigned int lcname_len; - char *lcname; - - if ((zend_hash_index_find(Z_ARRVAL_P(reference), 0, (void **) &classref) == FAILURE) - || (zend_hash_index_find(Z_ARRVAL_P(reference), 1, (void **) &method) == FAILURE)) { - _DO_THROW("Expected array($object, $method) or array($classname, $method)"); - /* returns out of this function */ - } - - if (Z_TYPE_PP(classref) == IS_OBJECT) { - ce = Z_OBJCE_PP(classref); - } else { - convert_to_text_ex(classref); - if (zend_u_lookup_class(Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_UNILEN_PP(classref), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %R does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref)); - return; - } - ce = *pce; - } - - convert_to_text_ex(method); - lcname = zend_u_str_case_fold(Z_TYPE_PP(method), Z_UNIVAL_PP(method), Z_UNILEN_PP(method), 1, &lcname_len); - if (zend_u_hash_find(&ce->function_table, Z_TYPE_PP(method), lcname, lcname_len + 1, (void **) &fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %R::%R() does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_TYPE_PP(method), Z_UNIVAL_PP(method)); - return; - } - efree(lcname); - } - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an array(class, method)"); - /* returns out of this function */ - } - - /* Now, search for the parameter */ - arg_info = fptr->common.arg_info; - if (Z_TYPE_P(parameter) == IS_LONG) { - position= Z_LVAL_P(parameter); - if (position < 0 || (zend_uint)position >= fptr->common.num_args) { - _DO_THROW("The parameter specified by its offset could not be found"); - /* returns out of this function */ - } - } else { - zend_uint i; - - position= -1; - convert_to_string_ex(¶meter); - for (i = 0; i < fptr->common.num_args; i++) { - if (arg_info[i].name && strcmp(arg_info[i].name, Z_STRVAL_P(parameter)) == 0) { - position= i; - break; - } - } - if (position == -1) { - _DO_THROW("The parameter specified by its name could not be found"); - /* returns out of this function */ - } - } - - MAKE_STD_ZVAL(name); - if (arg_info[position].name) { - ZVAL_TEXTL(name, arg_info[position].name, arg_info[position].name_len, 1); - } else { - ZVAL_NULL(name); - } - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - - ref = (parameter_reference*) emalloc(sizeof(parameter_reference)); - ref->arg_info = &arg_info[position]; - ref->offset = (zend_uint)position; - ref->required = fptr->common.required_num_args; - ref->fptr = fptr; - intern->ptr = ref; - intern->free_ptr = 1; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionParameter::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_parameter, __toString) -{ - reflection_object *intern; - parameter_reference *param; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - string_init(&str); - _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionParameter::getName() - Returns this parameters's name */ -ZEND_METHOD(reflection_parameter, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionParameter::getClass() - Returns this parameters's class hint or NULL if there is none */ -ZEND_METHOD(reflection_parameter, getClass) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (!param->arg_info->class_name) { - RETURN_NULL(); - } else { - zend_class_entry **pce; - - if (zend_u_lookup_class_ex(UG(unicode)?IS_UNICODE:IS_STRING, param->arg_info->class_name, param->arg_info->class_name_len, 1, &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not exist", param->arg_info->class_name); - return; - } - zend_reflection_class_factory(*pce, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isArray() - Returns whether parameter MUST be an array */ -ZEND_METHOD(reflection_parameter, isArray) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->array_type_hint); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::allowsNull() - Returns whether NULL is allowed as this parameters's value */ -ZEND_METHOD(reflection_parameter, allowsNull) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->allow_null); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isPassedByReference() - Returns whether this parameters is passed to by reference */ -ZEND_METHOD(reflection_parameter, isPassedByReference) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->pass_by_reference); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isOptional() - Returns whether this parameter is an optional parameter */ -ZEND_METHOD(reflection_parameter, isOptional) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->offset >= param->required); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isDefaultValueAvailable() - Returns whether the default value of this parameter is available */ -ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) -{ - reflection_object *intern; - parameter_reference *param; - zend_op *precv; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (param->fptr->type != ZEND_USER_FUNCTION) - { - RETURN_FALSE; - } - if (param->offset < param->required) { - RETURN_FALSE; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::getDefaultValue() - Returns the default value of this parameter or throws an exception */ -ZEND_METHOD(reflection_parameter, getDefaultValue) -{ - reflection_object *intern; - parameter_reference *param; - zend_op *precv; - zval *zv, zv_copy; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (param->fptr->type != ZEND_USER_FUNCTION) - { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Cannot determine default value for internal functions"); - return; - } - if (param->offset < param->required) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Parameter is not optional"); - return; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Internal error"); - return; - } - - zv_copy = precv->op2.u.constant; - zv = &zv_copy; - zval_update_constant(&zv, (void*)0 TSRMLS_CC); - RETURN_ZVAL(zv, 1, 1); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_method, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_method_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionMethod::__construct(mixed class_or_method [, string name]) - Constructor. Throws an Exception in case the given method does not exist */ -ZEND_METHOD(reflection_method, __construct) -{ - zval *name, *classname; - zval *object; - reflection_object *intern; - unsigned int lcname_len; - char *lcname; - zend_class_entry **pce; - zend_class_entry *ce; - zend_function *mptr; - char *name_str, *tmp; - int name_len, tmp_len; - zval ztmp; - zend_uchar type; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zt", &classname, &name_str, &name_len, &type) == FAILURE) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) { - return; - } - if ((tmp = strstr(name_str, "::")) == NULL) { - return; - } - type = IS_STRING; - classname = &ztmp; - tmp_len = tmp - name_str; - ZVAL_STRINGL(classname, name_str, tmp_len, 1); - name_len = name_len - (tmp_len + 2); - name_str = tmp + 2; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* Find the class entry */ - switch (Z_TYPE_P(classname)) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not exist", Z_UNIVAL_P(classname)); - return; - } - ce = *pce; - break; - - case IS_OBJECT: - ce = Z_OBJCE_P(classname); - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an object"); - /* returns out of this function */ - } - - if (classname == &ztmp) { - zval_dtor(&ztmp); - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); - - lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len); - - if (zend_u_hash_find(&ce->function_table, type, lcname, lcname_len + 1, (void **) &mptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %v::%R() does not exist", ce->name, type, name_str); - return; - } - efree(lcname); - - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, mptr->common.function_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = mptr; - intern->free_ptr = 0; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionMethod::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_method, __toString) -{ - reflection_object *intern; - zend_function *mptr; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - string_init(&str); - _function_string(&str, mptr, intern->ce, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionMethod::invoke(mixed object, mixed* args) - Invokes the method. */ -ZEND_METHOD(reflection_method, invoke) -{ - zval *retval_ptr; - zval ***params; - zval **object_pp; - reflection_object *intern; - zend_function *mptr; - int argc = ZEND_NUM_ARGS(); - int result; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zend_class_entry *obj_ce; - - METHOD_NOTSTATIC(reflection_method_ptr); - - if (argc < 1) { - zend_error(E_WARNING, "Invoke() expects at least one parameter, none given"); - RETURN_FALSE; - } - - GET_REFLECTION_OBJECT_PTR(mptr); - - if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) || - (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke abstract method %v::%v()", - mptr->common.scope->name, mptr->common.function_name); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke %s method %v::%v() from scope %v", - mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", - mptr->common.scope->name, mptr->common.function_name, - Z_OBJCE_P(getThis())->name); - } - return; - } - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - /* In case this is a static method, we should'nt pass an object_pp - * (which is used as calling context aka $this). We can thus ignore the - * first parameter. - * - * Else, we verify that the given object is an instance of the class. - */ - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - object_pp = NULL; - obj_ce = NULL; - } else { - if ((Z_TYPE_PP(params[0]) != IS_OBJECT)) { - efree(params); - _DO_THROW("Non-object passed to Invoke()"); - /* Returns from this function */ - } - obj_ce = Z_OBJCE_PP(params[0]); - - if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) { - efree(params); - _DO_THROW("Given object is not an instance of the class this method was declared in"); - /* Returns from this function */ - } - - object_pp = params[0]; - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = object_pp; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc-1; - fci.params = params+1; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = mptr; - fcc.calling_scope = obj_ce; - fcc.object_pp = object_pp; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public mixed ReflectionMethod::invokeArgs(mixed object, array args) - Invokes the function and pass its arguments as array. */ -ZEND_METHOD(reflection_method, invokeArgs) -{ - zval *retval_ptr; - zval ***params; - zval *object; - reflection_object *intern; - zend_function *mptr; - int argc; - int result; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zend_class_entry *obj_ce; - zval *param_array; - - METHOD_NOTSTATIC(reflection_method_ptr); - - GET_REFLECTION_OBJECT_PTR(mptr); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, ¶m_array) == FAILURE) { - return; - } - - if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) || - (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke abstract method %v::%v", - mptr->common.scope->name, mptr->common.function_name); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke %s method %v::%v from scope %v", - mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", - mptr->common.scope->name, mptr->common.function_name, - Z_OBJCE_P(getThis())->name); - } - return; - } - - argc = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - params = safe_emalloc(sizeof(zval **), argc, 0); - zend_hash_apply_with_argument(Z_ARRVAL_P(param_array), (apply_func_arg_t)_zval_array_to_c_array, ¶ms TSRMLS_CC); - params -= argc; - - /* In case this is a static method, we should'nt pass an object_pp - * (which is used as calling context aka $this). We can thus ignore the - * first parameter. - * - * Else, we verify that the given object is an instance of the class. - */ - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - object = NULL; - obj_ce = NULL; - } else { - if (!object) { - efree(params); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke non static method %v::%v without an object", - mptr->common.scope->name, mptr->common.function_name); - return; - } - - obj_ce = Z_OBJCE_P(object); - - if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) { - efree(params); - _DO_THROW("Given object is not an instance of the class this method was declared in"); - /* Returns from this function */ - } - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &object; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = mptr; - fcc.calling_scope = obj_ce; - fcc.object_pp = &object; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isFinal() - Returns whether this method is final */ -ZEND_METHOD(reflection_method, isFinal) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isAbstract() - Returns whether this method is abstract */ -ZEND_METHOD(reflection_method, isAbstract) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_ABSTRACT); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isPublic() - Returns whether this method is public */ -ZEND_METHOD(reflection_method, isPublic) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isPrivate() - Returns whether this method is private */ -ZEND_METHOD(reflection_method, isPrivate) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PRIVATE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isProtected() - Returns whether this method is protected */ -ZEND_METHOD(reflection_method, isProtected) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PROTECTED); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isStatic() - Returns whether this method is static */ -ZEND_METHOD(reflection_method, isStatic) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_STATIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isConstructor() - Returns whether this method is the constructor */ -ZEND_METHOD(reflection_method, isConstructor) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - /* we need to check if the ctor is the ctor of the class level we we - * looking at since we might be looking at an inherited old style ctor - * defined in base class. */ - RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isDestructor() - Returns whether this method is static */ -ZEND_METHOD(reflection_method, isDestructor) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR); -} -/* }}} */ - -/* {{{ proto public int ReflectionMethod::getModifiers() - Returns a bitfield of the access modifiers for this method */ -ZEND_METHOD(reflection_method, getModifiers) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - - RETURN_LONG(mptr->common.fn_flags); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass() - Get the declaring class */ -ZEND_METHOD(reflection_method, getDeclaringClass) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC(reflection_method_ptr); - GET_REFLECTION_OBJECT_PTR(mptr); - - zend_reflection_class_factory(mptr->common.scope, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionMethod::getPrototype() - Get the prototype */ -ZEND_METHOD(reflection_method, getPrototype) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC(reflection_method_ptr); - GET_REFLECTION_OBJECT_PTR(mptr); - - if (!mptr->common.prototype) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %v::%v does not have a prototype", intern->ce->name, mptr->common.function_name); - return; - } - - reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionClass::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_class, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_class_ptr), 1); -} -/* }}} */ - -/* {{{ reflection_class_object_ctor */ -static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_object) -{ - zval *argument; - zval *object; - zval *classname; - reflection_object *intern; - zend_class_entry **ce; - - if (is_object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &argument) == FAILURE) { - return; - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &argument) == FAILURE) { - return; - } - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - if (Z_TYPE_P(argument) == IS_OBJECT) { - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL); - intern->ptr = Z_OBJCE_P(argument); - if (is_object) { - intern->obj = argument; - zval_add_ref(&argument); - } - } else { - convert_to_string_ex(&argument); - if (zend_u_lookup_class(Z_TYPE_P(argument), Z_UNIVAL_P(argument), Z_UNILEN_P(argument), &ce TSRMLS_CC) == FAILURE) { - if (!EG(exception)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", Z_TYPE_P(argument), Z_UNIVAL_P(argument)); - } - return; - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, (*ce)->name, (*ce)->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL); - - intern->ptr = *ce; - } - intern->free_ptr = 0; -} -/* }}} */ - -/* {{{ proto public ReflectionClass::__construct(mixed argument) throws ReflectionException - Constructor. Takes a string or an instance as an argument */ -ZEND_METHOD(reflection_class, __construct) -{ - reflection_class_object_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getStaticProperties() - Returns an associative array containing all static property values of the class */ -ZEND_METHOD(reflection_class, getStaticProperties) -{ - zval *tmp_copy; - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - - array_init(return_value); - zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionClass::getStaticPropertyValue(string name [, mixed default]) - Returns the value of a tsstic property */ -ZEND_METHOD(reflection_class, getStaticPropertyValue) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval **prop, *def_value = NULL; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|z", &name, &name_len, &name_type, &def_value) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - prop = zend_std_get_static_property(ce, name_type, name, name_len, 1 TSRMLS_CC); - if (!prop) { - if (def_value) { - RETURN_ZVAL(def_value, 1, 0); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not have a property named %R", ce->name, name_type, name); - } - return; - } else { - RETURN_ZVAL(*prop, 1, 0); - } -} -/* }}} */ - -/* {{{ proto public void ReflectionClass::setStaticPropertyValue($name, $value) - Sets the value of a static property */ -ZEND_METHOD(reflection_class, setStaticPropertyValue) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval **variable_ptr, *value; - int refcount; - zend_uchar is_ref; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tz", &name, &name_len, &name_type, &value) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - variable_ptr = zend_std_get_static_property(ce, name_type, name, name_len, 1 TSRMLS_CC); - if (!variable_ptr) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not have a property named %R", ce->name, name_type, name); - return; - } - refcount = (*variable_ptr)->refcount; - is_ref = (*variable_ptr)->is_ref; - zval_dtor(*variable_ptr); - **variable_ptr = *value; - zval_copy_ctor(*variable_ptr); - (*variable_ptr)->refcount = refcount; - (*variable_ptr)->is_ref = is_ref; - -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getDefaultProperties() - Returns an associative array containing copies of all default property values of the class */ -ZEND_METHOD(reflection_class, getDefaultProperties) -{ - reflection_object *intern; - zend_class_entry *ce; - int count; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - array_init(return_value); - - zend_update_class_constants(ce TSRMLS_CC); - - count = zend_hash_num_elements(&ce->default_properties); - if (count > 0) { - HashPosition pos; - zval **prop; - - zend_hash_internal_pointer_reset_ex(&ce->default_properties, &pos); - while (zend_hash_get_current_data_ex(&ce->default_properties, (void **) &prop, &pos) == SUCCESS) { - char *key, *class_name, *prop_name; - uint key_len; - ulong num_index; - zval *prop_copy; - - zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &num_index, 0, &pos); - zend_hash_move_forward_ex(&ce->default_properties, &pos); - zend_unmangle_property_name(key, &class_name, &prop_name); - if (class_name && class_name[0] != '*' && strcmp(class_name, ce->name)) { - /* filter privates from base classes */ - continue; - } - - /* copy: enforce read only access */ - ALLOC_ZVAL(prop_copy); - *prop_copy = **prop; - zval_copy_ctor(prop_copy); - INIT_PZVAL(prop_copy); - - add_assoc_zval(return_value, prop_name, prop_copy); - } - } -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_class, __toString) -{ - reflection_object *intern; - zend_class_entry *ce; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - string_init(&str); - _class_string(&str, ce, intern->obj, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getName() - Returns the class' name */ -ZEND_METHOD(reflection_class, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInternal() - Returns whether this class is an internal class */ -ZEND_METHOD(reflection_class, isInternal) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce->type == ZEND_INTERNAL_CLASS); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isUserDefined() - Returns whether this class is user-defined */ -ZEND_METHOD(reflection_class, isUserDefined) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce->type == ZEND_USER_CLASS); -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getFileName() - Returns the filename of the file this class was declared in */ -ZEND_METHOD(reflection_class, getFileName) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS) { - RETURN_STRING(ce->filename, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getStartLine() - Returns the line this class' declaration starts at */ -ZEND_METHOD(reflection_class, getStartLine) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_FUNCTION) { - RETURN_LONG(ce->line_start); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getEndLine() - Returns the line this class' declaration ends at */ -ZEND_METHOD(reflection_class, getEndLine) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS) { - RETURN_LONG(ce->line_end); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getDocComment() - Returns the doc comment for this class */ -ZEND_METHOD(reflection_class, getDocComment) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS && ce->doc_comment) { - RETURN_STRINGL(ce->doc_comment, ce->doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public ReflectionMethod ReflectionClass::getConstructor() - Returns the class' constructor if there is one, NULL otherwise */ -ZEND_METHOD(reflection_class, getConstructor) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->constructor) { - reflection_method_factory(ce, ce->constructor, return_value TSRMLS_CC); - } else { - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasMethod(string name) - Returns wether a method exists or not */ -ZEND_METHOD(reflection_class, hasMethod) -{ - reflection_object *intern; - zend_class_entry *ce; - unsigned int lc_name_len; - char *name, *lc_name; - int name_len; - zend_uchar type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - lc_name = zend_u_str_case_fold(type, name, name_len, 1, &lc_name_len); - if (zend_u_hash_exists(&ce->function_table, type, lc_name, lc_name_len + 1)) { - efree(lc_name); - RETURN_TRUE; - } else { - efree(lc_name); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public ReflectionMethod ReflectionClass::getMethod(string name) throws ReflectionException - Returns the class' method specified by its name */ -ZEND_METHOD(reflection_class, getMethod) -{ - reflection_object *intern; - zend_class_entry *ce; - zend_function *mptr; - unsigned int lc_name_len; - char *name, *lc_name; - int name_len; - zend_uchar type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - lc_name = zend_u_str_case_fold(type, name, name_len, 1, &lc_name_len); - if (zend_u_hash_find(&ce->function_table, type, lc_name, lc_name_len + 1, (void**) &mptr) == SUCCESS) { - reflection_method_factory(ce, mptr, return_value TSRMLS_CC); - efree(lc_name); - } else { - efree(lc_name); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %R does not exist", type, name); - return; - } -} -/* }}} */ - -/* {{{ _addmethod */ -static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC) -{ - zval *method; - zend_class_entry *ce = *va_arg(args, zend_class_entry**); - zval *retval = va_arg(args, zval*); - long filter = va_arg(args, long); - - if (mptr->common.fn_flags & filter) { - TSRMLS_FETCH(); - ALLOC_ZVAL(method); - reflection_method_factory(ce, mptr, method TSRMLS_CC); - add_next_index_zval(retval, method); - } - return 0; -} -/* }}} */ - -/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods() - Returns an array of this class' methods */ -ZEND_METHOD(reflection_class, getMethods) -{ - reflection_object *intern; - zend_class_entry *ce; - long filter = 0; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL | ZEND_ACC_STATIC; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - array_init(return_value); - zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod, 3, &ce, return_value, filter); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasProperty(string name) - Returns wether a property exists or not */ -ZEND_METHOD(reflection_class, hasProperty) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval *property; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_hash_exists(&ce->properties_info, name, name_len + 1)) { - RETURN_TRUE; - } else { - if (intern->obj && Z_OBJ_HANDLER_P(intern->obj, has_property)) - { - MAKE_STD_ZVAL(property); - ZVAL_STRINGL(property, name, name_len, 1); - if (Z_OBJ_HANDLER_P(intern->obj, has_property)(intern->obj, property, 2 TSRMLS_CC)) { - zval_ptr_dtor(&property); - RETURN_TRUE; - } - zval_ptr_dtor(&property); - } - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public ReflectionProperty ReflectionClass::getProperty(string name) throws ReflectionException - Returns the class' property specified by its name */ -ZEND_METHOD(reflection_class, getProperty) -{ - reflection_object *intern; - zend_class_entry *ce, **pce; - zend_property_info *property_info; - char *name, *tmp, *classname; - int name_len, classname_len; - zend_uchar name_type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &name_type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_u_hash_find(&ce->properties_info, name_type, name, name_len + 1, (void**) &property_info) == SUCCESS && (property_info->flags & ZEND_ACC_SHADOW) == 0) { - reflection_property_factory(ce, property_info, return_value TSRMLS_CC); - return; - } - if ((tmp = strstr(name, "::")) != NULL) { - classname_len = tmp - name; - classname = zend_str_tolower_dup(name, classname_len); - classname[classname_len] = '\0'; - name_len = name_len - (classname_len + 2); - name = tmp + 2; - - if (zend_u_lookup_class(name_type, classname, classname_len, &pce TSRMLS_CC) == FAILURE) { - if (!EG(exception)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", name_type, classname); - } - efree(classname); - return; - } - efree(classname); - - if (!instanceof_function(ce, *pce TSRMLS_CC)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Fully qualified property name %v::%R does not specify a base class of %v", (*pce)->name, name_type, name, ce->name); - return; - } - ce = *pce; - - if (zend_u_hash_find(&ce->properties_info, name_type, name, name_len + 1, (void**) &property_info) == SUCCESS && (property_info->flags & ZEND_ACC_SHADOW) == 0) { - reflection_property_factory(ce, property_info, return_value TSRMLS_CC); - return; - } - } - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Property %R does not exist", name_type, name); -} -/* }}} */ - -/* {{{ _addproperty */ -static int _addproperty(zend_property_info *pptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC) -{ - zval *property; - zend_class_entry *ce = *va_arg(args, zend_class_entry**); - zval *retval = va_arg(args, zval*); - long filter = va_arg(args, long); - - if (pptr->flags & ZEND_ACC_SHADOW) { - return 0; - } - - if (pptr->flags & filter) { - TSRMLS_FETCH(); - ALLOC_ZVAL(property); - reflection_property_factory(ce, pptr, property TSRMLS_CC); - add_next_index_zval(retval, property); - } - return 0; -} -/* }}} */ - -/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties() - Returns an array of this class' properties */ -ZEND_METHOD(reflection_class, getProperties) -{ - reflection_object *intern; - zend_class_entry *ce; - long filter = 0; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - array_init(return_value); - zend_hash_apply_with_arguments(&ce->properties_info, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasConstant(string name) - Returns wether a constant exists or not */ -ZEND_METHOD(reflection_class, hasConstant) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_hash_exists(&ce->constants_table, name, name_len + 1)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getConstants() - Returns an associative array containing this class' constants and their values */ -ZEND_METHOD(reflection_class, getConstants) -{ - zval *tmp_copy; - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - array_init(return_value); - zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionClass::getConstant(string name) - Returns the class' constant specified by its name */ -ZEND_METHOD(reflection_class, getConstant) -{ - reflection_object *intern; - zend_class_entry *ce; - zval **value; - char *name; - int name_len; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { - RETURN_FALSE; - } - *return_value = **value; - zval_copy_ctor(return_value); -} -/* }}} */ - -/* {{{ _class_check_flag */ -static void _class_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETVAL_BOOL(ce->ce_flags & mask); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInstantiable() - Returns whether this class is instantiable */ -ZEND_METHOD(reflection_class, isInstantiable) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS)) { - RETURN_FALSE; - } - - /* Basically, the class is instantiable. Though, if there is a constructor - * and it is not publicly accessible, it isn't! */ - if (!ce->constructor) { - RETURN_TRUE; - } - - RETURN_BOOL(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInterface() - Returns whether this is an interface or a class */ -ZEND_METHOD(reflection_class, isInterface) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_INTERFACE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isFinal() - Returns whether this class is final */ -ZEND_METHOD(reflection_class, isFinal) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL_CLASS); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isAbstract() - Returns whether this class is abstract */ -ZEND_METHOD(reflection_class, isAbstract) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getModifiers() - Returns a bitfield of the access modifiers for this class */ -ZEND_METHOD(reflection_class, getModifiers) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - RETURN_LONG(ce->ce_flags); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInstance(stdclass object) - Returns whether the given object is an instance of this class */ -ZEND_METHOD(reflection_class, isInstance) -{ - reflection_object *intern; - zend_class_entry *ce; - zval *object; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) { - return; - } - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce == Z_OBJCE_P(object)); -} -/* }}} */ - -/* {{{ proto public stdclass ReflectionClass::newInstance(mixed* args, ...) - Returns an instance of this class */ -ZEND_METHOD(reflection_class, newInstance) -{ - zval *retval_ptr; - reflection_object *intern; - zend_class_entry *ce; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - object_init_ex(return_value, ce); - - /* Run the constructor if there is one */ - if (ce->constructor) { - zval ***params; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - - if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name); - return; - } - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &return_value; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - efree(params); - zval_ptr_dtor(&retval_ptr); - zend_error(E_WARNING, "Invocation of %v's constructor failed", ce->name); - RETURN_NULL(); - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - efree(params); - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass[] ReflectionClass::getInterfaces() - Returns an array of interfaces this class implements */ -ZEND_METHOD(reflection_class, getInterfaces) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - /* Return an empty array if this class implements no interfaces */ - array_init(return_value); - - if (ce->num_interfaces) { - zend_uint i; - - for (i=0; i < ce->num_interfaces; i++) { - zval *interface; - ALLOC_ZVAL(interface); - zend_reflection_class_factory(ce->interfaces[i], interface TSRMLS_CC); - add_assoc_zval_ex(return_value, ce->interfaces[i]->name, ce->interfaces[i]->name_length, interface); - } - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionClass::getParentClass() - Returns the class' parent class, or, if none exists, FALSE */ -ZEND_METHOD(reflection_class, getParentClass) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->parent) { - zend_reflection_class_factory(ce->parent, return_value TSRMLS_CC); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isSubclassOf(string|ReflectionClass class) - Returns whether this class is a subclass of another class */ -ZEND_METHOD(reflection_class, isSubclassOf) -{ - reflection_object *intern, *argument; - zend_class_entry *ce, **pce, *class_ce; - zval *class_name; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE) { - return; - } - - switch(class_name->type) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %R does not exist", Z_TYPE_P(class_name), Z_UNIVAL_P(class_name)); - return; - } - class_ce = *pce; - break; - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(class_name), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) { - argument = (reflection_object *) zend_object_store_get_object(class_name TSRMLS_CC); - if (argument == NULL || argument->ptr == NULL) { - zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ - } - class_ce = argument->ptr; - break; - } - /* no break */ - default: - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Parameter one must either be a string or a ReflectionClass object"); - return; - } - - - RETURN_BOOL(instanceof_function(ce, class_ce TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::implementsInterface(string|ReflectionClass interface_name) - Returns whether this class is a subclass of another class */ -ZEND_METHOD(reflection_class, implementsInterface) -{ - reflection_object *intern, *argument; - zend_class_entry *ce, *interface_ce, **pce; - zval *interface; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &interface) == FAILURE) { - return; - } - - switch(interface->type) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(interface), Z_UNIVAL_P(interface), Z_UNILEN_P(interface), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %R does not exist", Z_TYPE_P(interface), Z_UNIVAL_P(interface)); - return; - } - interface_ce = *pce; - break; - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(interface), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) { - argument = (reflection_object *) zend_object_store_get_object(interface TSRMLS_CC); - if (argument == NULL || argument->ptr == NULL) { - zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ - } - interface_ce = argument->ptr; - break; - } - /* no break */ - default: - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Parameter one must either be a string or a ReflectionClass object"); - return; - } - - if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %v is a Class", interface_ce->name); - return; - } - RETURN_BOOL(instanceof_function(ce, interface_ce TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isIterateable() - Returns whether this class is iterateable (can be used inside foreach) */ -ZEND_METHOD(reflection_class, isIterateable) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - RETURN_BOOL(ce->get_iterator != NULL); -} -/* }}} */ - -/* {{{ proto public ReflectionExtension|NULL ReflectionClass::getExtension() - Returns NULL or the extension the class belongs to */ -ZEND_METHOD(reflection_class, getExtension) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->module) { - reflection_extension_factory(return_value, ce->module->name TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto public string|false ReflectionClass::getExtensionName() - Returns false or the name of the extension the class belongs to */ -ZEND_METHOD(reflection_class, getExtensionName) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->module) { - RETURN_STRING(ce->module->name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionObject::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_object, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_object_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionObject::__construct(mixed argument) throws ReflectionException - Constructor. Takes an instance as an argument */ -ZEND_METHOD(reflection_object, __construct) -{ - reflection_class_object_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionProperty::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_property, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_property_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionProperty::__construct(mixed class, string name) - Constructor. Throws an Exception in case the given property does not exist */ -ZEND_METHOD(reflection_property, __construct) -{ - zval *propname, *classname; - char *name_str, *class_name, *prop_name; - int name_len; - zval *object; - reflection_object *intern; - zend_class_entry **pce; - zend_class_entry *ce; - zend_property_info *property_info; - property_reference *reference; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zt", &classname, &name_str, &name_len, &name_type) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* Find the class entry */ - switch (Z_TYPE_P(classname)) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %R does not exist", Z_TYPE_P(classname), Z_UNIVAL_P(classname)); - return; - } - ce = *pce; - break; - - case IS_OBJECT: - ce = Z_OBJCE_P(classname); - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an object"); - /* returns out of this function */ - } - - if (zend_u_hash_find(&ce->properties_info, name_type, name_str, name_len + 1, (void **) &property_info) == FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Property %v::$%R does not exist", ce->name, name_type, name_str); - return; - } - - if (!(property_info->flags & ZEND_ACC_PRIVATE)) { - /* we have to seach the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce->parent; - zend_property_info *tmp_info; - - while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) { - if (tmp_info->flags & ZEND_ACC_PRIVATE) { - /* private in super class => NOT the same property */ - break; - } - ce = tmp_ce; - property_info = tmp_info; - tmp_ce = tmp_ce->parent; - } - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, &class_name, &prop_name); - MAKE_STD_ZVAL(propname); - ZVAL_TEXT(propname, prop_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL); - - reference = (property_reference*) emalloc(sizeof(property_reference)); - reference->ce = ce; - reference->prop = property_info; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionProperty::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_property, __toString) -{ - reflection_object *intern; - property_reference *ref; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - string_init(&str); - _property_string(&str, ref->prop, NULL, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionProperty::getName() - Returns the class' name */ -ZEND_METHOD(reflection_property, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -static void _property_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - RETURN_BOOL(ref->prop->flags & mask); -} - -/* {{{ proto public bool ReflectionProperty::isPublic() - Returns whether this property is public */ -ZEND_METHOD(reflection_property, isPublic) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isPrivate() - Returns whether this property is private */ -ZEND_METHOD(reflection_property, isPrivate) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PRIVATE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isProtected() - Returns whether this property is protected */ -ZEND_METHOD(reflection_property, isProtected) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PROTECTED); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isStatic() - Returns whether this property is static */ -ZEND_METHOD(reflection_property, isStatic) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_STATIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isDefault() - Returns whether this property is default (declared at compilation time). */ -ZEND_METHOD(reflection_property, isDefault) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ~ZEND_ACC_IMPLICIT_PUBLIC); -} -/* }}} */ - -/* {{{ proto public int ReflectionProperty::getModifiers() - Returns a bitfield of the access modifiers for this property */ -ZEND_METHOD(reflection_property, getModifiers) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - - RETURN_LONG(ref->prop->flags); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionProperty::getValue([stdclass object]) - Returns this property's value */ -ZEND_METHOD(reflection_property, getValue) -{ - reflection_object *intern; - property_reference *ref; - zval *object; - zval **member= NULL; - zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; - - METHOD_NOTSTATIC(reflection_property_ptr); - GET_REFLECTION_OBJECT_PTR(ref); - -#if MBO_0 - if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) { - _DO_THROW("Cannot access non-public member"); - /* Returns from this function */ - } -#endif - - if ((ref->prop->flags & ZEND_ACC_STATIC)) { - zend_update_class_constants(intern->ce TSRMLS_CC); - if (zend_u_hash_quick_find(intern->ce->static_members, utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) { - return; - } - if (zend_u_hash_quick_find(Z_OBJPROP_P(object), utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - } - - *return_value= **member; - zval_copy_ctor(return_value); - INIT_PZVAL(return_value); -} -/* }}} */ - -/* {{{ proto public void ReflectionProperty::setValue([stdclass object,] mixed value) - Sets this property's value */ -ZEND_METHOD(reflection_property, setValue) -{ - reflection_object *intern; - property_reference *ref; - zval **variable_ptr; - zval *object; - zval *value; - int setter_done = 0; - zval *tmp; - HashTable *prop_table; - zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; - - METHOD_NOTSTATIC(reflection_property_ptr); - GET_REFLECTION_OBJECT_PTR(ref); - - if (ref->prop->flags & ~(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)) { - _DO_THROW("Cannot access non-public member"); - /* Returns from this function */ - } - - if ((ref->prop->flags & ZEND_ACC_STATIC)) { - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &tmp, &value) == FAILURE) { - return; - } - } - zend_update_class_constants(intern->ce TSRMLS_CC); - prop_table = intern->ce->static_members; - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) { - return; - } - prop_table = Z_OBJPROP_P(object); - } - - if (zend_u_hash_quick_find(prop_table, utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &variable_ptr) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - if (*variable_ptr == value) { - setter_done = 1; - } else { - if (PZVAL_IS_REF(*variable_ptr)) { - zval_dtor(*variable_ptr); - (*variable_ptr)->type = value->type; - (*variable_ptr)->value = value->value; - if (value->refcount > 0) { - zval_copy_ctor(*variable_ptr); - } - setter_done = 1; - } - } - if (!setter_done) { - zval **foo; - - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - zend_u_hash_quick_update(prop_table, utype, ref->prop->name, ref->prop->name_length+1, ref->prop->h, &value, sizeof(zval *), (void **) &foo); - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionProperty::getDeclaringClass() - Get the declaring class */ -ZEND_METHOD(reflection_property, getDeclaringClass) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - - zend_reflection_class_factory(ref->ce, return_value TSRMLS_CC); -} - -/* {{{ proto public string ReflectionProperty::getDocComment() - Returns the doc comment for this property */ -ZEND_METHOD(reflection_property, getDocComment) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - if (ref->prop->doc_comment) { - RETURN_STRINGL(ref->prop->doc_comment, ref->prop->doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ -/* {{{ proto public static mixed ReflectionExtension::export(string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_extension, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_extension_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionExtension::__construct(string name) - Constructor. Throws an Exception in case the given extension does not exist */ -ZEND_METHOD(reflection_extension, __construct) -{ - zval *name; - zval *object; - char *lcname; - reflection_object *intern; - zend_module_entry *module; - char *name_str; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - lcname = do_alloca(name_len + 1); - zend_str_tolower_copy(lcname, name_str, name_len); - if (zend_hash_find(&module_registry, lcname, name_len + 1, (void **)&module) == FAILURE) { - free_alloca(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Extension %s does not exist", name_str); - return; - } - free_alloca(lcname); - MAKE_STD_ZVAL(name); - ZVAL_STRING(name, module->name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = module; - intern->free_ptr = 0; - intern->ce = NULL; -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_extension, __toString) -{ - reflection_object *intern; - zend_module_entry *module; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - string_init(&str); - _extension_string(&str, module, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::getName() - Returns this extension's name */ -ZEND_METHOD(reflection_extension, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::getVersion() - Returns this extension's version */ -ZEND_METHOD(reflection_extension, getVersion) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - /* An extension does not necessarily have a version number */ - if (module->version == NO_VERSION_YET) { - RETURN_NULL(); - } else { - RETURN_STRING(module->version, 1); - } -} -/* }}} */ - -/* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions() - Returns an array of this extension's fuctions */ -ZEND_METHOD(reflection_extension, getFunctions) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - if (module->functions) { - zval *function; - zend_function *fptr; - zend_function_entry *func = module->functions; - - /* Is there a better way of doing this? */ - while (func->fname) { - if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) { - zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - continue; - } - - ALLOC_ZVAL(function); - reflection_function_factory(fptr, function TSRMLS_CC); - add_assoc_zval_ex(return_value, func->fname, strlen(func->fname)+1, function); - func++; - } - } -} -/* }}} */ - -static int _addconstant(zend_constant *constant, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *const_val; - zval *retval = va_arg(args, zval*); - int number = va_arg(args, int); - - if (number == constant->module_number) { - ALLOC_ZVAL(const_val); - *const_val = constant->value; - zval_copy_ctor(const_val); - INIT_PZVAL(const_val); - add_assoc_zval_ex(retval, constant->name, constant->name_len, const_val); - } - return 0; -} - -/* {{{ proto public array ReflectionExtension::getConstants() - Returns an associative array containing this extension's constants and their values */ -ZEND_METHOD(reflection_extension, getConstants) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _addconstant, 2, return_value, module->module_number); -} -/* }}} */ - -/* {{{ _addinientry */ -static int _addinientry(zend_ini_entry *ini_entry, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *retval = va_arg(args, zval*); - int number = va_arg(args, int); - - if (number == ini_entry->module_number) { - if (ini_entry->value) { - add_assoc_stringl(retval, ini_entry->name, ini_entry->value, ini_entry->value_length, 1); - } else { - add_assoc_null(retval, ini_entry->name); - } - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -/* {{{ proto public array ReflectionExtension::getINIEntries() - Returns an associative array containing this extension's INI entries and their values */ -ZEND_METHOD(reflection_extension, getINIEntries) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _addinientry, 2, return_value, module->module_number); -} -/* }}} */ - -/* {{{ add_extension_class */ -static int add_extension_class(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *class_array = va_arg(args, zval*), *zclass; - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int add_reflection_class = va_arg(args, int); - - if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) { - TSRMLS_FETCH(); - if (add_reflection_class) { - ALLOC_ZVAL(zclass); - zend_reflection_class_factory(*pce, zclass TSRMLS_CC); - add_assoc_zval_ex(class_array, (*pce)->name, (*pce)->name_length + 1, zclass); - } else { - add_next_index_stringl(class_array, (*pce)->name, (*pce)->name_length, 1); - } - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -/* {{{ proto public ReflectionClass[] ReflectionExtension::getClasses() - Returns an array containing ReflectionClass objects for all classes of this extension */ -ZEND_METHOD(reflection_extension, getClasses) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public array ReflectionExtension::getClassNames() - Returns an array containing all names of all classes of this extension */ -ZEND_METHOD(reflection_extension, getClassNames) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ method tables */ -static zend_function_entry reflection_exception_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_functions[] = { - ZEND_ME(reflection, getModifierNames, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(reflection, export, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflector_functions[] = { - ZEND_FENTRY(export, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - ZEND_ABSTRACT_ME(reflector, __toString, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_function_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_function, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_function, __construct, NULL, 0) - ZEND_ME(reflection_function, __toString, NULL, 0) - ZEND_ME(reflection_function, isInternal, NULL, 0) - ZEND_ME(reflection_function, isUserDefined, NULL, 0) - ZEND_ME(reflection_function, getName, NULL, 0) - ZEND_ME(reflection_function, getFileName, NULL, 0) - ZEND_ME(reflection_function, getStartLine, NULL, 0) - ZEND_ME(reflection_function, getEndLine, NULL, 0) - ZEND_ME(reflection_function, getDocComment, NULL, 0) - ZEND_ME(reflection_function, getStaticVariables, NULL, 0) - ZEND_ME(reflection_function, invoke, NULL, 0) - ZEND_ME(reflection_function, invokeArgs, NULL, 0) - ZEND_ME(reflection_function, returnsReference, NULL, 0) - ZEND_ME(reflection_function, getParameters, NULL, 0) - ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0) - ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0) - ZEND_ME(reflection_function, getExtension, NULL, 0) - ZEND_ME(reflection_function, getExtensionName, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_method_functions[] = { - ZEND_ME(reflection_method, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_method, __construct, NULL, 0) - ZEND_ME(reflection_method, __toString, NULL, 0) - ZEND_ME(reflection_method, isPublic, NULL, 0) - ZEND_ME(reflection_method, isPrivate, NULL, 0) - ZEND_ME(reflection_method, isProtected, NULL, 0) - ZEND_ME(reflection_method, isAbstract, NULL, 0) - ZEND_ME(reflection_method, isFinal, NULL, 0) - ZEND_ME(reflection_method, isStatic, NULL, 0) - ZEND_ME(reflection_method, isConstructor, NULL, 0) - ZEND_ME(reflection_method, isDestructor, NULL, 0) - ZEND_ME(reflection_method, getModifiers, NULL, 0) - ZEND_ME(reflection_method, invoke, NULL, 0) - ZEND_ME(reflection_method, invokeArgs, NULL, 0) - ZEND_ME(reflection_method, getDeclaringClass, NULL, 0) - ZEND_ME(reflection_method, getPrototype, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_class_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_class, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_class, __construct, NULL, 0) - ZEND_ME(reflection_class, __toString, NULL, 0) - ZEND_ME(reflection_class, getName, NULL, 0) - ZEND_ME(reflection_class, isInternal, NULL, 0) - ZEND_ME(reflection_class, isUserDefined, NULL, 0) - ZEND_ME(reflection_class, isInstantiable, NULL, 0) - ZEND_ME(reflection_class, getFileName, NULL, 0) - ZEND_ME(reflection_class, getStartLine, NULL, 0) - ZEND_ME(reflection_class, getEndLine, NULL, 0) - ZEND_ME(reflection_class, getDocComment, NULL, 0) - ZEND_ME(reflection_class, getConstructor, NULL, 0) - ZEND_ME(reflection_class, hasMethod, NULL, 0) - ZEND_ME(reflection_class, getMethod, NULL, 0) - ZEND_ME(reflection_class, getMethods, NULL, 0) - ZEND_ME(reflection_class, hasProperty, NULL, 0) - ZEND_ME(reflection_class, getProperty, NULL, 0) - ZEND_ME(reflection_class, getProperties, NULL, 0) - ZEND_ME(reflection_class, hasConstant, NULL, 0) - ZEND_ME(reflection_class, getConstants, NULL, 0) - ZEND_ME(reflection_class, getConstant, NULL, 0) - ZEND_ME(reflection_class, getInterfaces, NULL, 0) - ZEND_ME(reflection_class, isInterface, NULL, 0) - ZEND_ME(reflection_class, isAbstract, NULL, 0) - ZEND_ME(reflection_class, isFinal, NULL, 0) - ZEND_ME(reflection_class, getModifiers, NULL, 0) - ZEND_ME(reflection_class, isInstance, NULL, 0) - ZEND_ME(reflection_class, newInstance, NULL, 0) - ZEND_ME(reflection_class, getParentClass, NULL, 0) - ZEND_ME(reflection_class, isSubclassOf, NULL, 0) - ZEND_ME(reflection_class, getStaticProperties, NULL, 0) - ZEND_ME(reflection_class, getStaticPropertyValue, NULL, 0) - ZEND_ME(reflection_class, setStaticPropertyValue, NULL, 0) - ZEND_ME(reflection_class, getDefaultProperties, NULL, 0) - ZEND_ME(reflection_class, isIterateable, NULL, 0) - ZEND_ME(reflection_class, implementsInterface, NULL, 0) - ZEND_ME(reflection_class, getExtension, NULL, 0) - ZEND_ME(reflection_class, getExtensionName, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_object_functions[] = { - ZEND_ME(reflection_object, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_object, __construct, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_property_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_property, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_property, __construct, NULL, 0) - ZEND_ME(reflection_property, __toString, NULL, 0) - ZEND_ME(reflection_property, getName, NULL, 0) - ZEND_ME(reflection_property, getValue, NULL, 0) - ZEND_ME(reflection_property, setValue, NULL, 0) - ZEND_ME(reflection_property, isPublic, NULL, 0) - ZEND_ME(reflection_property, isPrivate, NULL, 0) - ZEND_ME(reflection_property, isProtected, NULL, 0) - ZEND_ME(reflection_property, isStatic, NULL, 0) - ZEND_ME(reflection_property, isDefault, NULL, 0) - ZEND_ME(reflection_property, getModifiers, NULL, 0) - ZEND_ME(reflection_property, getDeclaringClass, NULL, 0) - ZEND_ME(reflection_property, getDocComment, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_parameter_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_parameter, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_parameter, __construct, NULL, 0) - ZEND_ME(reflection_parameter, __toString, NULL, 0) - ZEND_ME(reflection_parameter, getName, NULL, 0) - ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0) - ZEND_ME(reflection_parameter, getClass, NULL, 0) - ZEND_ME(reflection_parameter, isArray, NULL, 0) - ZEND_ME(reflection_parameter, allowsNull, NULL, 0) - ZEND_ME(reflection_parameter, isOptional, NULL, 0) - ZEND_ME(reflection_parameter, isDefaultValueAvailable, NULL, 0) - ZEND_ME(reflection_parameter, getDefaultValue, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_extension_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_extension, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_extension, __construct, NULL, 0) - ZEND_ME(reflection_extension, __toString, NULL, 0) - ZEND_ME(reflection_extension, getName, NULL, 0) - ZEND_ME(reflection_extension, getVersion, NULL, 0) - ZEND_ME(reflection_extension, getFunctions, NULL, 0) - ZEND_ME(reflection_extension, getConstants, NULL, 0) - ZEND_ME(reflection_extension, getINIEntries, NULL, 0) - ZEND_ME(reflection_extension, getClasses, NULL, 0) - ZEND_ME(reflection_extension, getClassNames, NULL, 0) - {NULL, NULL, NULL} -}; -/* }}} */ - -static zend_object_handlers *zend_std_obj_handlers; - -/* {{{ _reflection_write_property */ -static void _reflection_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - if ((Z_TYPE_P(member) == IS_STRING || Z_TYPE_P(member) == IS_UNICODE) - && zend_u_hash_exists(&Z_OBJCE_P(object)->default_properties, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1) - && (ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "name", sizeof("name")-1) || - ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "class", sizeof("class")-1))) - { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Cannot set read-only property %v::$%R", Z_OBJCE_P(object)->name, Z_TYPE_P(member), Z_UNIVAL_P(member)); - } - else - { - zend_std_obj_handlers->write_property(object, member, value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ zend_register_reflection_api */ -ZEND_API void zend_register_reflection_api(TSRMLS_D) { - zend_class_entry _reflection_entry; - - zend_std_obj_handlers = zend_get_std_object_handlers(); - memcpy(&reflection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - reflection_object_handlers.clone_obj = NULL; - reflection_object_handlers.write_property = _reflection_write_property; - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions); - reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions); - reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "Reflector", reflector_functions); - reflector_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflector_ptr->ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_function_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_function_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_parameter_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_ptr, NULL TSRMLS_CC); - zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_class_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_class_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr, NULL TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_property_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_property_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_extension_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - /* Property modifiers */ - REGISTER_MAIN_LONG_CONSTANT("P_STATIC", ZEND_ACC_STATIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PUBLIC", ZEND_ACC_PUBLIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PROTECTED", ZEND_ACC_PROTECTED, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PRIVATE", ZEND_ACC_PRIVATE, CONST_PERSISTENT|CONST_CS); - - /* Method modifiers */ - REGISTER_MAIN_LONG_CONSTANT("M_STATIC", ZEND_ACC_STATIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PUBLIC", ZEND_ACC_PUBLIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PROTECTED", ZEND_ACC_PROTECTED, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PRIVATE", ZEND_ACC_PRIVATE, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_ABSTRACT", ZEND_ACC_ABSTRACT, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_FINAL", ZEND_ACC_FINAL, CONST_PERSISTENT|CONST_CS); - - /* Class modifiers */ - REGISTER_MAIN_LONG_CONSTANT("C_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("C_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("C_FINAL", ZEND_ACC_FINAL_CLASS, CONST_PERSISTENT|CONST_CS); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_reflection_api.h b/Zend/zend_reflection_api.h deleted file mode 100644 index 2f7415c73c5f3..0000000000000 --- a/Zend/zend_reflection_api.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: George Schlossnagle | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_REFLECTION_API_H -#define ZEND_REFLECTION_API_H - -BEGIN_EXTERN_C() - -/* Class entry pointers */ -extern ZEND_API zend_class_entry *reflector_ptr; -extern ZEND_API zend_class_entry *reflection_exception_ptr; -extern ZEND_API zend_class_entry *reflection_ptr; -extern ZEND_API zend_class_entry *reflection_function_ptr; -extern ZEND_API zend_class_entry *reflection_parameter_ptr; -extern ZEND_API zend_class_entry *reflection_class_ptr; -extern ZEND_API zend_class_entry *reflection_object_ptr; -extern ZEND_API zend_class_entry *reflection_method_ptr; -extern ZEND_API zend_class_entry *reflection_property_ptr; -extern ZEND_API zend_class_entry *reflection_extension_ptr; - -ZEND_API void zend_register_reflection_api(TSRMLS_D); -ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC); - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c deleted file mode 100644 index 3eaff38e13cb5..0000000000000 --- a/Zend/zend_sprintf.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#if ZEND_BROKEN_SPRINTF -int zend_sprintf(char *buffer, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vsprintf(buffer, format, args); - va_end(args); - - return strlen(buffer); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c deleted file mode 100644 index 2de27d07d12ca..0000000000000 --- a/Zend/zend_stack.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_stack.h" - -ZEND_API int zend_stack_init(zend_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} - -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} - - -ZEND_API int zend_stack_top(zend_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} - - -ZEND_API int zend_stack_del_top(zend_stack *stack) -{ - if (stack->top > 0) { - efree(stack->elements[--stack->top]); - } - return SUCCESS; -} - - -ZEND_API int zend_stack_int_top(zend_stack *stack) -{ - int *e; - - if (zend_stack_top(stack, (void **) &e) == FAILURE) { - return FAILURE; /* this must be a negative number, since negative numbers can't be address numbers */ - } else { - return *e; - } -} - - -ZEND_API int zend_stack_is_empty(zend_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} - - -ZEND_API int zend_stack_destroy(zend_stack *stack) -{ - register int i; - - for (i = 0; i < stack->top; i++) { - efree(stack->elements[i]); - } - - if (stack->elements) { - efree(stack->elements); - } - return SUCCESS; -} - - -ZEND_API void **zend_stack_base(zend_stack *stack) -{ - return stack->elements; -} - - -ZEND_API int zend_stack_count(zend_stack *stack) -{ - return stack->top; -} - - -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - } -} - - -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h deleted file mode 100644 index 6dd1d29ce0c0b..0000000000000 --- a/Zend/zend_stack.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STACK_H -#define ZEND_STACK_H - -typedef struct _zend_stack { - int top, max; - void **elements; -} zend_stack; - - -#define STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API int zend_stack_init(zend_stack *stack); -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size); -ZEND_API int zend_stack_top(zend_stack *stack, void **element); -ZEND_API int zend_stack_del_top(zend_stack *stack); -ZEND_API int zend_stack_int_top(zend_stack *stack); -ZEND_API int zend_stack_is_empty(zend_stack *stack); -ZEND_API int zend_stack_destroy(zend_stack *stack); -ZEND_API void **zend_stack_base(zend_stack *stack); -ZEND_API int zend_stack_count(zend_stack *stack); -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg); -END_EXTERN_C() - -#define ZEND_STACK_APPLY_TOPDOWN 1 -#define ZEND_STACK_APPLY_BOTTOMUP 2 - -#endif /* ZEND_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c deleted file mode 100644 index dbbd6cf198085..0000000000000 --- a/Zend/zend_static_allocator.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend_static_allocator.h" - -/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ - -inline static void block_init(Block *block, zend_uint block_size) -{ - block->pos = block->bp = (char *) emalloc(block_size); - block->end = block->bp + block_size; -} - -inline static char *block_allocate(Block *block, zend_uint size) -{ - char *retval = block->pos; - if ((block->pos += size) >= block->end) { - return (char *)NULL; - } - return retval; -} - -inline static void block_destroy(Block *block) -{ - efree(block->bp); -} - -void static_allocator_init(StaticAllocator *sa) -{ - sa->Blocks = (Block *) emalloc(sizeof(Block)); - block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); - sa->num_blocks = 1; - sa->current_block = 0; -} - -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) -{ - char *retval; - - retval = block_allocate(&sa->Blocks[sa->current_block], size); - if (retval) { - return retval; - } - sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); - sa->current_block++; - block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE); - retval = block_allocate(&sa->Blocks[sa->current_block], size); - return retval; -} - -void static_allocator_destroy(StaticAllocator *sa) -{ - zend_uint i; - - for (i=0; inum_blocks; i++) { - block_free(&sa->Blocks[i]); - } - efree(sa->Blocks); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h deleted file mode 100644 index 8538b152ebae7..0000000000000 --- a/Zend/zend_static_allocator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STATIC_ALLOCATOR_H -#define ZEND_STATIC_ALLOCATOR_H - -#define ALLOCATOR_BLOCK_SIZE 400000 - -/* Temporary */ -typedef unsigned int zend_uint; -#define emalloc(s) malloc(s) -#define efree(p) free(p) - -typedef struct _Block { - char *bp; - char *pos; - char *end; -} Block; - -typedef struct _StaticAllocator { - Block *Blocks; - zend_uint num_blocks; - zend_uint current_block; -} StaticAllocator; - -void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size); -void static_allocator_destroy(StaticAllocator *sa); - -#endif /* ZEND_STATIC_ALLOCATOR_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c deleted file mode 100644 index 1e550244e0056..0000000000000 --- a/Zend/zend_stream.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#include "zend.h" -#include "zend_compile.h" - -ZEND_DLIMPORT int isatty(int fd); - -static size_t zend_stream_stdio_reader(void *handle, char *buf, size_t len TSRMLS_DC) -{ - return fread(buf, 1, len, (FILE*)handle); -} - -static void zend_stream_stdio_closer(void *handle TSRMLS_DC) -{ - if ((FILE*)handle != stdin) - fclose((FILE*)handle); -} - -static long zend_stream_stdio_fteller(void *handle TSRMLS_DC) -{ - return ftell((FILE*) handle); -} - - -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC) -{ - if (zend_stream_open_function) { - return zend_stream_open_function(filename, handle TSRMLS_CC); - } - handle->type = ZEND_HANDLE_FP; - handle->opened_path = NULL; - handle->handle.fp = zend_fopen(filename, &handle->opened_path); - handle->filename = (char *)filename; - handle->free_filename = 0; - - return (handle->handle.fp) ? SUCCESS : FAILURE; -} - -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC) -{ - switch (file_handle->type) { - case ZEND_HANDLE_FILENAME: - if (FAILURE == zend_stream_open(file_handle->filename, file_handle TSRMLS_CC)) { - return FAILURE; - } - break; - - case ZEND_HANDLE_FD: - file_handle->handle.fp = fdopen(file_handle->handle.fd, "rb"); - file_handle->type = ZEND_HANDLE_FP; - break; - - case ZEND_HANDLE_FP: - file_handle->handle.fp = file_handle->handle.fp; - break; - - case ZEND_HANDLE_STREAM: - /* nothing to do */ - return SUCCESS; - - default: - return FAILURE; - } - if (file_handle->type == ZEND_HANDLE_FP) { - if (!file_handle->handle.fp) { - return FAILURE; - } - - /* make compatible with stream */ - file_handle->handle.stream.handle = file_handle->handle.fp; - file_handle->handle.stream.reader = zend_stream_stdio_reader; - file_handle->handle.stream.closer = zend_stream_stdio_closer; - file_handle->handle.stream.fteller = zend_stream_stdio_fteller; - - file_handle->handle.stream.interactive = isatty(fileno((FILE *)file_handle->handle.stream.handle)); - } - return SUCCESS; -} - -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - if (file_handle->handle.stream.interactive) { - int c = '*'; - size_t n; - -#ifdef NETWARE - /* - c != 4 check is there as fread of a character in NetWare LibC gives 4 upon ^D character. - Ascii value 4 is actually EOT character which is not defined anywhere in the LibC - or else we can use instead of hardcoded 4. - */ - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n ) -#else - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n ) -#endif - buf[n] = (char) c; - if ( c == '\n' ) - buf[n++] = (char) c; - - return n; - } - return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC); -} - -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC) -{ - char buf; - - if (file_handle->handle.stream.reader(file_handle->handle.stream.handle, &buf, sizeof(buf) TSRMLS_CC)) { - return (int)buf; - } - return EOF; -} - -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC) -{ - return 0; -} - -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC) -{ - return file_handle->handle.stream.fteller(file_handle->handle.stream.handle TSRMLS_CC); -} diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h deleted file mode 100644 index fc45cf1c7a9d0..0000000000000 --- a/Zend/zend_stream.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STREAM_H -#define ZEND_STREAM_H - -/* Lightweight stream implementation for the ZE scanners. - * These functions are private to the engine. - * */ - -typedef size_t (*zend_stream_reader_t)(void *handle, char *buf, size_t len TSRMLS_DC); -typedef void (*zend_stream_closer_t)(void *handle TSRMLS_DC); -typedef long (*zend_stream_fteller_t)(void *handle TSRMLS_DC); - -typedef struct _zend_stream { - void *handle; - zend_stream_reader_t reader; - zend_stream_closer_t closer; - zend_stream_fteller_t fteller; - int interactive; -} zend_stream; - -typedef struct _zend_file_handle { - zend_uchar type; - char *filename; - char *opened_path; - union { - int fd; - FILE *fp; - zend_stream stream; - } handle; - zend_bool free_filename; -} zend_file_handle; - -BEGIN_EXTERN_C() -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC); -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC); -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC); -END_EXTERN_C() - -#define zend_stream_close(handle) zend_file_handle_dtor((handle)) - -#endif - diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c deleted file mode 100644 index 1810c5bf2743f..0000000000000 --- a/Zend/zend_strtod.c +++ /dev/null @@ -1,1802 +0,0 @@ -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991 by AT&T. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to - David M. Gay - AT&T Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-2070 - U.S.A. - dmg@research.att.com or research!dmg - */ - -/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly), we may be able to - * compute (d*10^k) * 10^(e-k) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22). - */ - -/* - * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define Sudden_Underflow for IEEE-format machines without gradual - * underflow (i.e., that flush to zero on underflow). - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic. - * #define Unsigned_Shifts if >> does treats its left operand as unsigned. - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define Just_16 to store 16 bits per 32-bit Long when doing high-precision - * integer arithmetic. Whether this speeds things up or slows things - * down depends on the machine and the number being converted. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - */ - -#include -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(HAVE_INTTYPES_H) -#include -#elif defined(HAVE_STDINT_H) -#include -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -#ifdef WORDS_BIGENDIAN -#define IEEE_BIG_ENDIAN -#else -#define IEEE_LITTLE_ENDIAN -#endif - -#if defined(__arm__) && !defined(__VFP_FP__) -/* - * Although the CPU is little endian the FP has different - * byte and word endianness. The byte order is still little endian - * but the word order is big endian. - */ -#define IEEE_BIG_ENDIAN -#endif - -#ifdef __vax__ -#define VAX -#endif - -#if defined(_MSC_VER) -#define int32_t __int32 -#define uint32_t unsigned __int32 -#define IEEE_LITTLE_ENDIAN -#endif - -#define Long int32_t -#define ULong uint32_t - -#ifdef __cplusplus -#include "malloc.h" -#include "memory.h" -#else -#ifndef KR_headers -#include "stdlib.h" -#include "string.h" -#include "locale.h" -#else -#include "malloc.h" -#include "memory.h" -#endif -#endif - -#ifdef MALLOC -#ifdef KR_headers -extern char *MALLOC(); -#else -extern void *MALLOC(size_t); -#endif -#else -#define MALLOC malloc -#endif - -#include "ctype.h" -#include "errno.h" - -#ifdef Bad_float_h -#ifdef IEEE_BIG_ENDIAN -#define IEEE_ARITHMETIC -#endif -#ifdef IEEE_LITTLE_ENDIAN -#define IEEE_ARITHMETIC -#endif - -#ifdef IEEE_ARITHMETIC -#define DBL_DIG 15 -#define DBL_MAX_10_EXP 308 -#define DBL_MAX_EXP 1024 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7976931348623157e+308 -#endif - -#ifdef IBM -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 75 -#define DBL_MAX_EXP 63 -#define FLT_RADIX 16 -#define FLT_ROUNDS 0 -#define DBL_MAX 7.2370055773322621e+75 -#endif - -#ifdef VAX -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 38 -#define DBL_MAX_EXP 127 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7014118346046923e+38 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647 -#endif -#else -#include "float.h" -#endif -#ifndef __MATH_H__ -#include "math.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef CONST -#ifdef KR_headers -#define CONST /* blank */ -#else -#define CONST const -#endif -#endif - -#ifdef Unsigned_Shifts -#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000; -#else -#define Sign_Extend(a,b) /*no-op*/ -#endif - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \ - defined(IBM) != 1 -Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or -IBM should be defined. -#endif - -typedef union { - double d; - ULong ul[2]; -} _double; -#define value(x) ((x).d) -#ifdef IEEE_LITTLE_ENDIAN -#define word0(x) ((x).ul[1]) -#define word1(x) ((x).ul[0]) -#else -#define word0(x) ((x).ul[0]) -#define word1(x) ((x).ul[1]) -#endif - -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) - */ -#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__) -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ -((unsigned short *)a)[0] = (unsigned short)c, a++) -#else -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ -((unsigned short *)a)[1] = (unsigned short)c, a++) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define IEEE_Arith -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 -#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */ -#else -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 0x1000000 -#define Exp_msk11 0x1000000 -#define Exp_mask 0x7f000000 -#define P 14 -#define Bias 65 -#define Exp_1 0x41000000 -#define Exp_11 0x41000000 -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask 0xffffff -#define Frac_mask1 0xffffff -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask 0xefffff -#define Bndry_mask1 0xffffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 4 -#define Tiny0 0x100000 -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 0x800000 -#define Exp_mask 0x7f80 -#define P 56 -#define Bias 129 -#define Exp_1 0x40800000 -#define Exp_11 0x4080 -#define Ebits 8 -#define Frac_mask 0x7fffff -#define Frac_mask1 0xffff007f -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask 0xffff007f -#define Bndry_mask1 0xffff007f -#define LSB 0x10000 -#define Sign_bit 0x8000 -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif -#endif - -#ifndef IEEE_Arith -#define ROUND_BIASED -#endif - -#ifdef RND_PRODQUOT -#define rounded_product(a,b) a = rnd_prod(a, b) -#define rounded_quotient(a,b) a = rnd_quot(a, b) -#ifdef KR_headers -extern double rnd_prod(), rnd_quot(); -#else -extern double rnd_prod(double, double), rnd_quot(double, double); -#endif -#else -#define rounded_product(a,b) a *= b -#define rounded_quotient(a,b) a /= b -#endif - -#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) -#define Big1 0xffffffff - -#ifndef Just_16 -/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * This makes some inner loops simpler and sometimes saves work - * during multiplications, but it often seems to make things slightly - * slower. Hence the default is now to store 32 bits per Long. - */ -#ifndef Pack_32 -#define Pack_32 -#endif -#endif - -#define Kmax 15 - - struct -Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; - }; - - typedef struct Bigint Bigint; - - static Bigint *freelist[Kmax+1]; - - static Bigint * -Balloc -#ifdef KR_headers - (k) int k; -#else - (int k) -#endif -{ - int x; - Bigint *rv; - - if ((rv = freelist[k])) { - freelist[k] = rv->next; - } - else { - x = 1 << k; - rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)); - rv->k = k; - rv->maxwds = x; - } - rv->sign = rv->wds = 0; - return rv; - } - - static void -Bfree -#ifdef KR_headers - (v) Bigint *v; -#else - (Bigint *v) -#endif -{ - if (v) { - v->next = freelist[v->k]; - freelist[v->k] = v; - } - } - -#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ -y->wds*sizeof(Long) + 2*sizeof(int)) - - static Bigint * -multadd -#ifdef KR_headers - (b, m, a) Bigint *b; int m, a; -#else - (Bigint *b, int m, int a) /* multiply by m and add a */ -#endif -{ - int i, wds; - ULong *x, y; -#ifdef Pack_32 - ULong xi, z; -#endif - Bigint *b1; - - wds = b->wds; - x = b->x; - i = 0; - do { -#ifdef Pack_32 - xi = *x; - y = (xi & 0xffff) * m + a; - z = (xi >> 16) * m + (y >> 16); - a = (int)(z >> 16); - *x++ = (z << 16) + (y & 0xffff); -#else - y = *x * m + a; - a = (int)(y >> 16); - *x++ = y & 0xffff; -#endif - } - while(++i < wds); - if (a) { - if (wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1, b); - Bfree(b); - b = b1; - } - b->x[wds++] = a; - b->wds = wds; - } - return b; - } - - static Bigint * -s2b -#ifdef KR_headers - (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; -#else - (CONST char *s, int nd0, int nd, ULong y9) -#endif -{ - Bigint *b; - int i, k; - Long x, y; - - x = (nd + 8) / 9; - for(k = 0, y = 1; x > y; y <<= 1, k++) ; -#ifdef Pack_32 - b = Balloc(k); - b->x[0] = y9; - b->wds = 1; -#else - b = Balloc(k+1); - b->x[0] = y9 & 0xffff; - b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; -#endif - - i = 9; - if (9 < nd0) { - s += 9; - do b = multadd(b, 10, *s++ - '0'); - while(++i < nd0); - s++; - } - else - s += 10; - for(; i < nd; i++) - b = multadd(b, 10, *s++ - '0'); - return b; - } - - static int -hi0bits -#ifdef KR_headers - (x) register ULong x; -#else - (register ULong x) -#endif -{ - register int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) - return 32; - } - return k; - } - - static int -lo0bits -#ifdef KR_headers - (y) ULong *y; -#else - (ULong *y) -#endif -{ - register int k; - register ULong x = *y; - - if (x & 7) { - if (x & 1) - return 0; - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!x & 1) - return 32; - } - *y = x; - return k; - } - - static Bigint * -i2b -#ifdef KR_headers - (i) int i; -#else - (int i) -#endif -{ - Bigint *b; - - b = Balloc(1); - b->x[0] = i; - b->wds = 1; - return b; - } - - static Bigint * -mult -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int k, wa, wb, wc; - ULong carry, y, z; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; -#ifdef Pack_32 - ULong z2; -#endif - - if (a->wds < b->wds) { - c = a; - a = b; - b = c; - } - k = a->k; - wa = a->wds; - wb = b->wds; - wc = wa + wb; - if (wc > a->maxwds) - k++; - c = Balloc(k); - for(x = c->x, xa = x + wc; x < xa; x++) - *x = 0; - xa = a->x; - xae = xa + wa; - xb = b->x; - xbe = xb + wb; - xc0 = c->x; -#ifdef Pack_32 - for(; xb < xbe; xb++, xc0++) { - if ((y = *xb & 0xffff)) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - Storeinc(xc, z2, z); - } - while(x < xae); - *xc = carry; - } - if ((y = *xb >> 16)) { - x = xa; - xc = xc0; - carry = 0; - z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - Storeinc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } - while(x < xae); - *xc = z2; - } - } -#else - for(; xb < xbe; xc0++) { - if (y = *xb++) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * y + *xc + carry; - carry = z >> 16; - *xc++ = z & 0xffff; - } - while(x < xae); - *xc = carry; - } - } -#endif - for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; - c->wds = wc; - return c; - } - - static Bigint *p5s; - - static Bigint * -pow5mult -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - Bigint *b1, *p5, *p51; - int i; - static int p05[3] = { 5, 25, 125 }; - - if ((i = k & 3)) - b = multadd(b, p05[i-1], 0); - - if (!(k >>= 2)) - return b; - if (!(p5 = p5s)) { - /* first time */ - p5 = p5s = i2b(625); - p5->next = 0; - } - for(;;) { - if (k & 1) { - b1 = mult(b, p5); - Bfree(b); - b = b1; - } - if (!(k >>= 1)) - break; - if (!(p51 = p5->next)) { - p51 = p5->next = mult(p5,p5); - p51->next = 0; - } - p5 = p51; - } - return b; - } - - static Bigint * -lshift -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; - -#ifdef Pack_32 - n = k >> 5; -#else - n = k >> 4; -#endif - k1 = b->k; - n1 = n + b->wds + 1; - for(i = b->maxwds; n1 > i; i <<= 1) - k1++; - b1 = Balloc(k1); - x1 = b1->x; - for(i = 0; i < n; i++) - *x1++ = 0; - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - if (k &= 0x1f) { - k1 = 32 - k; - z = 0; - do { - *x1++ = *x << k | z; - z = *x++ >> k1; - } - while(x < xe); - if ((*x1 = z)) - ++n1; - } -#else - if (k &= 0xf) { - k1 = 16 - k; - z = 0; - do { - *x1++ = *x << k & 0xffff | z; - z = *x++ >> k1; - } - while(x < xe); - if (*x1 = z) - ++n1; - } -#endif - else do - *x1++ = *x++; - while(x < xe); - b1->wds = n1 - 1; - Bfree(b); - return b1; - } - - static int -cmp -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - ULong *xa, *xa0, *xb, *xb0; - int i, j; - - i = a->wds; - j = b->wds; -#ifdef DEBUG - if (i > 1 && !a->x[i-1]) - Bug("cmp called with a->x[a->wds-1] == 0"); - if (j > 1 && !b->x[j-1]) - Bug("cmp called with b->x[b->wds-1] == 0"); -#endif - if (i -= j) - return i; - xa0 = a->x; - xa = xa0 + j; - xb0 = b->x; - xb = xb0 + j; - for(;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; - } - - static Bigint * -diff -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int i, wa, wb; - Long borrow, y; /* We need signed shifts here. */ - ULong *xa, *xae, *xb, *xbe, *xc; -#ifdef Pack_32 - Long z; -#endif - - i = cmp(a,b); - if (!i) { - c = Balloc(0); - c->wds = 1; - c->x[0] = 0; - return c; - } - if (i < 0) { - c = a; - a = b; - b = c; - i = 1; - } - else - i = 0; - c = Balloc(a->k); - c->sign = i; - wa = a->wds; - xa = a->x; - xae = xa + wa; - wb = b->wds; - xb = b->x; - xbe = xb + wb; - xc = c->x; - borrow = 0; -#ifdef Pack_32 - do { - y = (*xa & 0xffff) - (*xb & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) - (*xb++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } - while(xb < xbe); - while(xa < xae) { - y = (*xa & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ - *xb++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } - while(xb < xbe); - while(xa < xae) { - y = *xa++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } -#endif - while(!*--xc) - wa--; - c->wds = wa; - return c; - } - - static double -ulp -#ifdef KR_headers - (_x) double _x; -#else - (double _x) -#endif -{ - _double x; - register Long L; - _double a; - - value(x) = _x; - L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; -#ifndef Sudden_Underflow - if (L > 0) { -#endif -#ifdef IBM - L |= Exp_msk1 >> 4; -#endif - word0(a) = L; - word1(a) = 0; -#ifndef Sudden_Underflow - } - else { - L = -L >> Exp_shift; - if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; - } - else { - word0(a) = 0; - L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << (31 - L); - } - } -#endif - return value(a); - } - - static double -b2d -#ifdef KR_headers - (a, e) Bigint *a; int *e; -#else - (Bigint *a, int *e) -#endif -{ - ULong *xa, *xa0, w, y, z; - int k; - _double d; -#ifdef VAX - ULong d0, d1; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - - xa0 = a->x; - xa = xa0 + a->wds; - y = *--xa; -#ifdef DEBUG - if (!y) Bug("zero y in b2d"); -#endif - k = hi0bits(y); - *e = 32 - k; -#ifdef Pack_32 - if (k < Ebits) { - d0 = Exp_1 | y >> (Ebits - k); - w = xa > xa0 ? *--xa : 0; - d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> (32 - k); - y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> (32 - k); - } - else { - d0 = Exp_1 | y; - d1 = z; - } -#else - if (k < Ebits + 16) { - z = xa > xa0 ? *--xa : 0; - d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; - w = xa > xa0 ? *--xa : 0; - y = xa > xa0 ? *--xa : 0; - d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - w = xa > xa0 ? *--xa : 0; - k -= Ebits + 16; - d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; - y = xa > xa0 ? *--xa : 0; - d1 = w << k + 16 | y << k; -#endif - ret_d: -#ifdef VAX - word0(d) = d0 >> 16 | d0 << 16; - word1(d) = d1 >> 16 | d1 << 16; -#else -#undef d0 -#undef d1 -#endif - return value(d); - } - - static Bigint * -d2b -#ifdef KR_headers - (_d, e, bits) double d; int *e, *bits; -#else - (double _d, int *e, int *bits) -#endif -{ - Bigint *b; - int de, i, k; - ULong *x, y, z; - _double d; -#ifdef VAX - ULong d0, d1; -#endif - - value(d) = _d; -#ifdef VAX - d0 = word0(d) >> 16 | word0(d) << 16; - d1 = word1(d) >> 16 | word1(d) << 16; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - -#ifdef Pack_32 - b = Balloc(1); -#else - b = Balloc(2); -#endif - x = b->x; - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ -#ifdef Sudden_Underflow - de = (int)(d0 >> Exp_shift); -#ifndef IBM - z |= Exp_msk11; -#endif -#else - if ((de = (int)(d0 >> Exp_shift))) - z |= Exp_msk1; -#endif -#ifdef Pack_32 - if ((y = d1)) { - if ((k = lo0bits(&y))) { - x[0] = y | z << (32 - k); - z >>= k; - } - else - x[0] = y; - i = b->wds = (x[1] = z) ? 2 : 1; - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - x[0] = z; - i = b->wds = 1; - k += 32; - } -#else - if (y = d1) { - if (k = lo0bits(&y)) - if (k >= 16) { - x[0] = y | z << 32 - k & 0xffff; - x[1] = z >> k - 16 & 0xffff; - x[2] = z >> k; - i = 2; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16 | z << 16 - k & 0xffff; - x[2] = z >> k & 0xffff; - x[3] = z >> k+16; - i = 3; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16; - x[2] = z & 0xffff; - x[3] = z >> 16; - i = 3; - } - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - if (k >= 16) { - x[0] = z; - i = 0; - } - else { - x[0] = z & 0xffff; - x[1] = z >> 16; - i = 1; - } - k += 32; - } - while(!x[i]) - --i; - b->wds = i + 1; -#endif -#ifndef Sudden_Underflow - if (de) { -#endif -#ifdef IBM - *e = (de - Bias - (P-1) << 2) + k; - *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); -#else - *e = de - Bias - (P-1) + k; - *bits = P - k; -#endif -#ifndef Sudden_Underflow - } - else { - *e = de - Bias - (P-1) + 1 + k; -#ifdef Pack_32 - *bits = 32*i - hi0bits(x[i-1]); -#else - *bits = (i+2)*16 - hi0bits(x[i]); -#endif - } -#endif - return b; - } -#undef d0 -#undef d1 - - static double -ratio -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - _double da, db; - int k, ka, kb; - - value(da) = b2d(a, &ka); - value(db) = b2d(b, &kb); -#ifdef Pack_32 - k = ka - kb + 32*(a->wds - b->wds); -#else - k = ka - kb + 16*(a->wds - b->wds); -#endif -#ifdef IBM - if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; - if (k &= 3) - da *= 1 << k; - } - else { - k = -k; - word0(db) += (k >> 2)*Exp_msk1; - if (k &= 3) - db *= 1 << k; - } -#else - if (k > 0) - word0(da) += k*Exp_msk1; - else { - k = -k; - word0(db) += k*Exp_msk1; - } -#endif - return value(da) / value(db); - } - -static CONST double -tens[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22 -#ifdef VAX - , 1e23, 1e24 -#endif - }; - -#ifdef IEEE_Arith -static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 }; -#define n_bigtens 5 -#else -#ifdef IBM -static CONST double bigtens[] = { 1e16, 1e32, 1e64 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; -#define n_bigtens 3 -#else -static CONST double bigtens[] = { 1e16, 1e32 }; -static CONST double tinytens[] = { 1e-16, 1e-32 }; -#define n_bigtens 2 -#endif -#endif - -ZEND_API double -zend_strtod -#ifdef KR_headers - (s00, se) CONST char *s00; char **se; -#else - (CONST char *s00, char **se) -#endif -{ - int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, - e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; - CONST char *s, *s0, *s1; - double aadj, aadj1, adj; - _double rv, rv0; - Long L; - ULong y, z; - Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; - double result; - - CONST char decimal_point = '.'; - - sign = nz0 = nz = 0; - value(rv) = 0.; - - - for(s = s00; isspace((unsigned char) *s); s++) - ; - - if (*s == '-') { - sign = 1; - s++; - } else if (*s == '+') { - s++; - } - - if (*s == '\0') { - s = s00; - goto ret; - } - - if (*s == '0') { - nz0 = 1; - while(*++s == '0') ; - if (!*s) - goto ret; - } - s0 = s; - y = z = 0; - for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) - if (nd < 9) - y = 10*y + c - '0'; - else if (nd < 16) - z = 10*z + c - '0'; - nd0 = nd; - if (c == decimal_point) { - c = *++s; - if (!nd) { - for(; c == '0'; c = *++s) - nz++; - if (c > '0' && c <= '9') { - s0 = s; - nf += nz; - nz = 0; - goto have_dig; - } - goto dig_done; - } - for(; c >= '0' && c <= '9'; c = *++s) { - have_dig: - nz++; - if (c -= '0') { - nf += nz; - for(i = 1; i < nz; i++) - if (nd++ < 9) - y *= 10; - else if (nd <= DBL_DIG + 1) - z *= 10; - if (nd++ < 9) - y = 10*y + c; - else if (nd <= DBL_DIG + 1) - z = 10*z + c; - nz = 0; - } - } - } - dig_done: - e = 0; - if (c == 'e' || c == 'E') { - if (!nd && !nz && !nz0) { - s = s00; - goto ret; - } - s00 = s; - esign = 0; - switch(c = *++s) { - case '-': - esign = 1; - case '+': - c = *++s; - } - if (c >= '0' && c <= '9') { - while(c == '0') - c = *++s; - if (c > '0' && c <= '9') { - L = c - '0'; - s1 = s; - while((c = *++s) >= '0' && c <= '9') - L = 10*L + c - '0'; - if (s - s1 > 8 || L > 19999) - /* Avoid confusion from exponents - * so large that e might overflow. - */ - e = 19999; /* safe for 16 bit ints */ - else - e = (int)L; - if (esign) - e = -e; - } - else - e = 0; - } - else - s = s00; - } - if (!nd) { - if (!nz && !nz0) - s = s00; - goto ret; - } - e1 = e -= nf; - - /* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */ - - if (!nd0) - nd0 = nd; - k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; - value(rv) = y; - if (k > 9) - value(rv) = tens[k - 9] * value(rv) + z; - bd0 = 0; - if (nd <= DBL_DIG -#ifndef RND_PRODQUOT - && FLT_ROUNDS == 1 -#endif - ) { - if (!e) - goto ret; - if (e > 0) { - if (e <= Ten_pmax) { -#ifdef VAX - goto vax_ovfl_check; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - goto ret; -#endif - } - i = DBL_DIG - nd; - if (e <= Ten_pmax + i) { - /* A fancier test would sometimes let us do - * this for larger i values. - */ - e -= i; - value(rv) *= tens[i]; -#ifdef VAX - /* VAX exponent range is so narrow we must - * worry about overflow here... - */ - vax_ovfl_check: - word0(rv) -= P*Exp_msk1; - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - if ((word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) - goto ovfl; - word0(rv) += P*Exp_msk1; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); -#endif - goto ret; - } - } -#ifndef Inaccurate_Divide - else if (e >= -Ten_pmax) { - /* value(rv) = */ rounded_quotient(value(rv), - tens[-e]); - goto ret; - } -#endif - } - e1 += nd - k; - - /* Get starting approximation = rv * 10**e1 */ - - if (e1 > 0) { - if ((i = e1 & 15)) - value(rv) *= tens[i]; - if (e1 &= ~15) { - if (e1 > DBL_MAX_10_EXP) { - ovfl: - errno = ERANGE; -#ifndef Bad_float_h - value(rv) = HUGE_VAL; -#else - /* Can't trust HUGE_VAL */ -#ifdef IEEE_Arith - word0(rv) = Exp_mask; - word1(rv) = 0; -#else - word0(rv) = Big0; - word1(rv) = Big1; -#endif -#endif - if (bd0) - goto retfree; - goto ret; - } - if (e1 >>= 4) { - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= bigtens[j]; - /* The last multiplication could overflow. */ - word0(rv) -= P*Exp_msk1; - value(rv) *= bigtens[j]; - if ((z = word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-P)) - goto ovfl; - if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { - /* set to largest number */ - /* (Can't trust DBL_MAX) */ - word0(rv) = Big0; - word1(rv) = Big1; - } - else - word0(rv) += P*Exp_msk1; - } - - } - } - else if (e1 < 0) { - e1 = -e1; - if ((i = e1 & 15)) - value(rv) /= tens[i]; - if (e1 &= ~15) { - e1 >>= 4; - if (e1 >= 1 << n_bigtens) - goto undfl; - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= tinytens[j]; - /* The last multiplication could underflow. */ - value(rv0) = value(rv); - value(rv) *= tinytens[j]; - if (!value(rv)) { - value(rv) = 2.*value(rv0); - value(rv) *= tinytens[j]; - if (!value(rv)) { - undfl: - value(rv) = 0.; - errno = ERANGE; - if (bd0) - goto retfree; - goto ret; - } - word0(rv) = Tiny0; - word1(rv) = Tiny1; - /* The refinement below will clean - * this approximation up. - */ - } - } - } - - /* Now the hard part -- adjusting rv to the correct value.*/ - - /* Put digits into bd: true value = bd * 10^e */ - - bd0 = s2b(s0, nd0, nd, y); - - for(;;) { - bd = Balloc(bd0->k); - Bcopy(bd, bd0); - bb = d2b(value(rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ - bs = i2b(1); - - if (e >= 0) { - bb2 = bb5 = 0; - bd2 = bd5 = e; - } - else { - bb2 = bb5 = -e; - bd2 = bd5 = 0; - } - if (bbe >= 0) - bb2 += bbe; - else - bd2 -= bbe; - bs2 = bb2; -#ifdef Sudden_Underflow -#ifdef IBM - j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); -#else - j = P + 1 - bbbits; -#endif -#else - i = bbe + bbbits - 1; /* logb(rv) */ - if (i < Emin) /* denormal */ - j = bbe + (P-Emin); - else - j = P + 1 - bbbits; -#endif - bb2 += j; - bd2 += j; - i = bb2 < bd2 ? bb2 : bd2; - if (i > bs2) - i = bs2; - if (i > 0) { - bb2 -= i; - bd2 -= i; - bs2 -= i; - } - if (bb5 > 0) { - bs = pow5mult(bs, bb5); - bb1 = mult(bs, bb); - Bfree(bb); - bb = bb1; - } - if (bb2 > 0) - bb = lshift(bb, bb2); - if (bd5 > 0) - bd = pow5mult(bd, bd5); - if (bd2 > 0) - bd = lshift(bd, bd2); - if (bs2 > 0) - bs = lshift(bs, bs2); - delta = diff(bb, bd); - dsign = delta->sign; - delta->sign = 0; - i = cmp(delta, bs); - if (i < 0) { - /* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) - break; - delta = lshift(delta,Log2P); - if (cmp(delta, bs) > 0) - goto drop_down; - break; - } - if (i == 0) { - /* exactly half-way between */ - if (dsign) { - if ((word0(rv) & Bndry_mask1) == Bndry_mask1 - && word1(rv) == 0xffffffff) { - /*boundary case -- increment exponent*/ - word0(rv) = (word0(rv) & Exp_mask) - + Exp_msk1 -#ifdef IBM - | Exp_msk1 >> 4 -#endif - ; - word1(rv) = 0; - break; - } - } - else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { - drop_down: - /* boundary case -- decrement exponent */ -#ifdef Sudden_Underflow - L = word0(rv) & Exp_mask; -#ifdef IBM - if (L < Exp_msk1) -#else - if (L <= Exp_msk1) -#endif - goto undfl; - L -= Exp_msk1; -#else - L = (word0(rv) & Exp_mask) - Exp_msk1; -#endif - word0(rv) = L | Bndry_mask1; - word1(rv) = 0xffffffff; -#ifdef IBM - goto cont; -#else - break; -#endif - } -#ifndef ROUND_BIASED - if (!(word1(rv) & LSB)) - break; -#endif - if (dsign) - value(rv) += ulp(value(rv)); -#ifndef ROUND_BIASED - else { - value(rv) -= ulp(value(rv)); -#ifndef Sudden_Underflow - if (!value(rv)) - goto undfl; -#endif - } -#endif - break; - } - if ((aadj = ratio(delta, bs)) <= 2.) { - if (dsign) - aadj = aadj1 = 1.; - else if (word1(rv) || word0(rv) & Bndry_mask) { -#ifndef Sudden_Underflow - if (word1(rv) == Tiny1 && !word0(rv)) - goto undfl; -#endif - aadj = 1.; - aadj1 = -1.; - } - else { - /* special case -- power of FLT_RADIX to be */ - /* rounded down... */ - - if (aadj < 2./FLT_RADIX) - aadj = 1./FLT_RADIX; - else - aadj *= 0.5; - aadj1 = -aadj; - } - } - else { - aadj *= 0.5; - aadj1 = dsign ? aadj : -aadj; -#ifdef Check_FLT_ROUNDS - switch(FLT_ROUNDS) { - case 2: /* towards +infinity */ - aadj1 -= 0.5; - break; - case 0: /* towards 0 */ - case 3: /* towards -infinity */ - aadj1 += 0.5; - } -#else - if (FLT_ROUNDS == 0) - aadj1 += 0.5; -#endif - } - y = word0(rv) & Exp_mask; - - /* Check for overflow */ - - if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { - value(rv0) = value(rv); - word0(rv) -= P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - if ((word0(rv) & Exp_mask) >= - Exp_msk1*(DBL_MAX_EXP+Bias-P)) { - if (word0(rv0) == Big0 && word1(rv0) == Big1) - goto ovfl; - word0(rv) = Big0; - word1(rv) = Big1; - goto cont; - } - else - word0(rv) += P*Exp_msk1; - } - else { -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { - value(rv0) = value(rv); - word0(rv) += P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#ifdef IBM - if ((word0(rv) & Exp_mask) < P*Exp_msk1) -#else - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) -#endif - { - if (word0(rv0) == Tiny0 - && word1(rv0) == Tiny1) - goto undfl; - word0(rv) = Tiny0; - word1(rv) = Tiny1; - goto cont; - } - else - word0(rv) -= P*Exp_msk1; - } - else { - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - } -#else - /* Compute adj so that the IEEE rounding rules will - * correctly round rv + adj in some half-way cases. - * If rv * ulp(rv) is denormalized (i.e., - * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid - * trouble from bits lost to denormalization; - * example: 1.2e-307 . - */ - if (y <= (P-1)*Exp_msk1 && aadj >= 1.) { - aadj1 = (double)(int)(aadj + 0.5); - if (!dsign) - aadj1 = -aadj1; - } - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#endif - } - z = word0(rv) & Exp_mask; - if (y == z) { - /* Can we stop now? */ - L = aadj; - aadj -= L; - /* The tolerances below are conservative. */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) { - if (aadj < .4999999 || aadj > .5000001) - break; - } - else if (aadj < .4999999/FLT_RADIX) - break; - } - cont: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(delta); - } - retfree: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); - ret: - if (se) - *se = (char *)s; - result = sign ? -value(rv) : value(rv); - return result; - } - -/* UTODO: someone can reimplement this using the code above, if they really want to. */ -ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr) -{ - double value; - int32_t num_conv = 0, num_read = 0; - - num_conv = u_sscanf(nptr, "%f%n", &value, &num_read); - if (num_conv != EOF) { - if (endptr != 0) { - *endptr = (UChar *)nptr + num_read; - } - return value; - } else { - if (endptr != 0) { - *endptr = (UChar *)nptr; - } - return 0; - } -} diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h deleted file mode 100644 index 1b85279d29bc3..0000000000000 --- a/Zend/zend_strtod.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This is a header file for the strtod implementation by David M. Gay which - * can be found in zend_strtod.c */ -#ifndef ZEND_STRTOD_H -#define ZEND_STRTOD_H -#include - -BEGIN_EXTERN_C() -ZEND_API double zend_strtod(const char *s00, char **se); -END_EXTERN_C() - -#endif diff --git a/Zend/zend_strtol.c b/Zend/zend_strtol.c deleted file mode 100644 index 9a56cac1071ba..0000000000000 --- a/Zend/zend_strtol.c +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -#include -#include -#include -#include -#include -#include -#include - -/* - * Convert a Unicode string to a long integer. - * - * Ignores `locale' stuff. - */ -long -zend_u_strtol(nptr, endptr, base) - const UChar *nptr; - UChar **endptr; - register int base; -{ - register const UChar *s = nptr; - register unsigned long acc; - register UChar c; - register unsigned long cutoff; - register int neg = 0, any, cutlim; - register int32_t val; - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - do { - c = *s++; - } while (u_isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - (c == '0') - && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = (c == '0') ? 8 : 10; - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for longs is - * [-2147483648..2147483647] and the input base is 10, - * cutoff will be set to 214748364 and cutlim to either - * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated - * a value > 214748364, or equal but the next digit is > 7 (or 8), - * the number is too big, and we will return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; - cutlim = cutoff % (unsigned long)base; - cutoff /= (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) { - if ((val = u_digit(c, base)) < 0) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += val; - } - } - if (any < 0) { - acc = neg ? LONG_MIN : LONG_MAX; - errno = ERANGE; - } else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = (UChar *)(any ? s - 1 : nptr); - return (acc); -} diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c deleted file mode 100644 index e4a3a85501c79..0000000000000 --- a/Zend/zend_ts_hash.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ts_hash.h" - -/* ts management functions */ -static void begin_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((++(ht->reader)) == 1) { - tsrm_mutex_lock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void end_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((--(ht->reader)) == 0) { - tsrm_mutex_unlock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void begin_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_writer); -#endif -} - -static void end_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_unlock(ht->mx_writer); -#endif -} - -/* delegates */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init_ex(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_writer); -#endif - zend_hash_destroy(TS_HASH(ht)); -} - -ZEND_API void zend_ts_hash_clean(TsHashTable *ht) -{ - ht->reader = 0; - zend_hash_clean(TS_HASH(ht)); -} - -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_add_or_update(TS_HASH(ht), arKey, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_quick_add_or_update(TS_HASH(ht), arKey, nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_write(ht); - retval = zend_hash_add_empty_element(TS_HASH(ht), arKey, nKeyLength); - end_write(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_reader); -#endif - zend_hash_graceful_destroy(TS_HASH(ht)); -} - -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply_with_argument(TS_HASH(ht), apply_func, argument TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int num_args, ...) -{ - va_list args; - - va_start(args, num_args); - begin_write(ht); - zend_hash_apply_with_arguments(TS_HASH(ht), apply_func, num_args, args); - end_write(ht); - va_end(args); -} - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_reverse_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) -{ - int retval; - - begin_write(ht); - retval = zend_hash_del_key_or_index(TS_HASH(ht), arKey, nKeyLength, h, flag); - end_write(ht); - - return retval; -} - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - ulong retval; - - begin_read(ht); - retval = zend_get_hash_value(arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_find(TS_HASH(ht), arKey, nKeyLength, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_quick_find(TS_HASH(ht), arKey, nKeyLength, h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_find(TS_HASH(ht), h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_read(ht); - retval = zend_hash_exists(TS_HASH(ht), arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_exists(TS_HASH(ht), h); - end_read(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) -{ - begin_read(source); - begin_write(target); - zend_hash_copy(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite) -{ - begin_read(source); - begin_write(target); - zend_hash_merge(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size, overwrite); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam) -{ - begin_read(source); - begin_write(target); - zend_hash_merge_ex(TS_HASH(target), TS_HASH(source), pCopyConstructor, size, pMergeSource, pParam); - end_write(target); - end_read(source); -} - -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC) -{ - int retval; - - begin_write(ht); - retval = zend_hash_sort(TS_HASH(ht), sort_func, compare_func, renumber TSRMLS_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) -{ - int retval; - - begin_read(ht1); - begin_read(ht2); - retval = zend_hash_compare(TS_HASH(ht1), TS_HASH(ht2), compar, ordered TSRMLS_CC); - end_read(ht2); - end_read(ht1); - - return retval; -} - -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC) -{ - int retval; - - begin_read(ht); - retval = zend_hash_minmax(TS_HASH(ht), compar, flag, pData TSRMLS_CC); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht) -{ - int retval; - - begin_read(ht); - retval = zend_hash_num_elements(TS_HASH(ht)); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht) -{ - int retval; - - begin_write(ht); - retval = zend_hash_rehash(TS_HASH(ht)); - end_write(ht); - - return retval; -} - -#if ZEND_DEBUG -void zend_ts_hash_display_pListTail(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display_pListTail(TS_HASH(ht)); - end_read(ht); -} - -void zend_ts_hash_display(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display(TS_HASH(ht)); - end_read(ht); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h deleted file mode 100644 index f85f6102599f6..0000000000000 --- a/Zend/zend_ts_hash.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TS_HASH_H -#define ZEND_TS_HASH_H - -#include "zend.h" - -typedef struct _zend_ts_hashtable { - HashTable hash; - zend_uint reader; -#ifdef ZTS - MUTEX_T mx_reader; - MUTEX_T mx_writer; -#endif -} TsHashTable; - -BEGIN_EXTERN_C() - -#define TS_HASH(table) (&(table->hash)) - -/* startup/shutdown */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_clean(TsHashTable *ht); - -#define zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \ - _zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC) -#define zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \ - _zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC) - - -/* additions/updates/changes */ -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_index_update(ht, h, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_next_index_insert(ht, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC) - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength); - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int, ...); - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); - - -/* Deletes */ -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); -#define zend_ts_hash_del(ht, arKey, nKeyLength) \ - zend_ts_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) -#define zend_ts_hash_index_del(ht, h) \ - zend_ts_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength); - -/* Data retreival */ -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData); -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData); -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData); - -/* Misc */ -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength); -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h); - -/* Copying, merging and sorting */ -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size); -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite); -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam); -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC); -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC); -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC); - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht); - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht); - -ZEND_API ulong zend_ts_hash_func(char *arKey, uint nKeyLength); - -#if ZEND_DEBUG -/* debug */ -void zend_ts_hash_display_pListTail(TsHashTable *ht); -void zend_ts_hash_display(TsHashTable *ht); -#endif - -END_EXTERN_C() - -#define ZEND_TS_INIT_SYMTABLE(ht) \ - ZEND_TS_INIT_SYMTABLE_EX(ht, 2, 0) - -#define ZEND_TS_INIT_SYMTABLE_EX(ht, n, persistent) \ - zend_ts_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) - -#endif /* ZEND_HASH_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_types.h b/Zend/zend_types.h deleted file mode 100644 index a02a49de6ccca..0000000000000 --- a/Zend/zend_types.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TYPES_H -#define ZEND_TYPES_H - -typedef unsigned char zend_bool; -typedef unsigned char zend_uchar; -typedef unsigned int zend_uint; -typedef unsigned long zend_ulong; -typedef unsigned short zend_ushort; - -#endif /* ZEND_TYPES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_unicode.c b/Zend/zend_unicode.c deleted file mode 100644 index edaf9568a2cea..0000000000000 --- a/Zend/zend_unicode.c +++ /dev/null @@ -1,597 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2004 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_operators.h" -#include "zend_API.h" -#include "zend_unicode.h" -#include - -#ifdef ZTS -ZEND_API ts_rsrc_id unicode_globals_id; -#else -ZEND_API zend_unicode_globals unicode_globals; -#endif - -static void zend_from_unicode_substitute_cb( - const void *context, - UConverterFromUnicodeArgs *toUArgs, - const char *codeUnits, - int32_t length, - UConverterCallbackReason reason, - UErrorCode *err - ) -{ - if (context == NULL) { - if (reason > UCNV_IRREGULAR) - { - return; - } - - *err = U_ZERO_ERROR; - //ucnv_cbFromUWriteSub(fromArgs, 0, err); - return; - } else if (*((char*)context)=='i') { - if (reason != UCNV_UNASSIGNED) - { - /* the caller must have set - * the error code accordingly - */ - return; - } else { - *err = U_ZERO_ERROR; - //ucnv_cbFromUWriteSub(fromArgs, 0, err); - return; - } - } -} - -/* {{{ zend_set_converter_error_mode */ -void zend_set_converter_error_mode(UConverter *conv, uint8_t error_mode) -{ - UErrorCode status = U_ZERO_ERROR; - - switch (error_mode) { - case ZEND_FROM_U_ERROR_STOP: - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_STOP, NULL, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_SKIP: - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SKIP, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_ESCAPE: - /* UTODO replace with custom callback for various substitution patterns */ - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_UNICODE, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_SUBST: - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SUBSTITUTE, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status); - break; - - default: - assert(0); - break; - } -} -/* }}} */ - -/* {{{ zend_set_converter_subst_char */ -void zend_set_converter_subst_char(UConverter *conv, UChar *subst_char, int8_t subst_char_len) -{ - char dest[8]; - int8_t dest_len = 8; - UErrorCode status = U_ZERO_ERROR; - UErrorCode temp = U_ZERO_ERROR; - const void *old_context; - UConverterFromUCallback old_cb; - - if (!subst_char_len) - return; - - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_STOP, NULL, &old_cb, &old_context, &temp); - dest_len = ucnv_fromUChars(conv, dest, dest_len, subst_char, subst_char_len, &status); - ucnv_setFromUCallBack(conv, old_cb, old_context, NULL, NULL, &temp); - if (U_FAILURE(status)) { - zend_error(E_WARNING, "Could not set substitution character for the converter"); - return; - } - ucnv_setSubstChars(conv, dest, dest_len, &status); - if (status == U_ILLEGAL_ARGUMENT_ERROR) { - zend_error(E_WARNING, "Substitution character byte sequence is too short or long for this converter"); - return; - } -} -/* }}} */ - -/* {{{ zend_set_converter_encoding */ -int zend_set_converter_encoding(UConverter **converter, const char *encoding) -{ - UErrorCode status = U_ZERO_ERROR; - UConverter *new_converter = NULL; - - if (!converter) { - return FAILURE; - } - - /* - * The specified encoding might be the same as converter's existing one, - * which results in a no-op. - */ - if (*converter && encoding && encoding[0]) { - const char *current = ucnv_getName(*converter, &status); - status = U_ZERO_ERROR; /* reset error */ - if (!ucnv_compareNames(current, encoding)) { - return SUCCESS; - } - } - - /* - * If encoding is NULL, ucnv_open() will return a converter based on - * the default platform encoding as determined by ucnv_getDefaultName(). - */ - new_converter = ucnv_open(encoding, &status); - if (U_FAILURE(status)) { - return FAILURE; - } - - if (*converter) { - ucnv_close(*converter); - } - *converter = new_converter; - - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_copy_converter */ -int zend_copy_converter(UConverter **target, UConverter *source) -{ - UErrorCode status = U_ZERO_ERROR; - const char *encoding; - - assert(source != NULL); - - encoding = ucnv_getName(source, &status); - if (U_FAILURE(status)) { - return FAILURE; - } - - return zend_set_converter_encoding(target, encoding); -} -/* }}} */ - -/* {{{ zend_convert_to_unicode */ -ZEND_API void zend_convert_to_unicode(UConverter *conv, UChar **target, int32_t *target_len, const char *source, int32_t source_len, UErrorCode *status) -{ - UChar *buffer = NULL; - UChar *output; - int32_t buffer_len = 0; - int32_t converted = 0; - const char *input = source; - UConverterType conv_type; - - if (U_FAILURE(*status)) { - return; - } - - ucnv_resetToUnicode(conv); - conv_type = ucnv_getType(conv); - - switch (conv_type) { - case UCNV_SBCS: - case UCNV_LATIN_1: - case UCNV_US_ASCII: - /* - * For single-byte charsets, 1 input byte = 1 output UChar - */ - buffer_len = source_len; - break; - - default: - /* - * Initial estimate: 1.25 UChar's for every 2 source bytes + 2 (past a - * certain limit (2)). The rationale behind this is that (atleast - * in the case of GB2312) it is possible that there are single byte - * characters in the input string. By using an GD2312 text as - * example it seemed that a value of 1.25 allowed for as little - * re-allocations as possible without over estimating the buffer - * too much. In case there is a lot of single-byte characters - * around a single multi-byte character this estimation is too low, - * and then the re-allocation routines in the loop below kick in. - * Here we multiply by 1.33 and add 1 so that it's even quite - * efficient for smaller input strings without causing too much - * iterations of this loop. - */ - buffer_len = (source_len > 2) ? ((source_len >> 1) + (source_len >> 3) + 2) : source_len; - break; - } - - while (1) { - buffer = eurealloc(buffer, buffer_len + 1); - output = buffer + converted; - ucnv_toUnicode(conv, &output, buffer + buffer_len, &input, source + source_len, NULL, TRUE, status); - converted = (int32_t) (output - buffer); - if (*status == U_BUFFER_OVERFLOW_ERROR) { - buffer_len = (buffer_len * 1.33) + 1; - *status = U_ZERO_ERROR; - } else { - break; - } - } - - /* - * We return the buffer in case of failure anyway. The caller may want to - * use partially converted string for something. - */ - - buffer[converted] = 0; - *target = buffer; - *target_len = converted; -} -/* }}} */ - -/* {{{ zend_convert_from_unicode */ -ZEND_API void zend_convert_from_unicode(UConverter *conv, char **target, int32_t *target_len, const UChar *source, int32_t source_len, UErrorCode *status) -{ - char *buffer = NULL; - char *output; - int32_t buffer_len = 0; - int32_t converted = 0; - const UChar *input = source; - - if (U_FAILURE(*status)) { - return; - } - - ucnv_resetFromUnicode(conv); - - buffer_len = ucnv_getMaxCharSize(conv) * source_len; - - while (1) { - buffer = erealloc(buffer, buffer_len + 1); - output = buffer + converted; - ucnv_fromUnicode(conv, &output, buffer + buffer_len, &input, source + source_len, NULL, TRUE, status); - converted = (int32_t) (output - buffer); - if (*status == U_BUFFER_OVERFLOW_ERROR) { - buffer_len += 64; - *status = U_ZERO_ERROR; - } else { - break; - } - } - - /* - * We return the buffer in case of failure anyway. The caller may want to - * use partially converted string for something. - */ - - buffer[converted] = 0; /* NULL-terminate the output string */ - *target = buffer; - *target_len = converted; - - /* Report the conversion error */ - if (U_FAILURE(*status)) { - zend_error(E_NOTICE, "Error converting from Unicode to codepage string: %s", u_errorName(*status)); - } -} -/* }}} */ - -/* {{{ zend_convert_encodings */ -ZEND_API void zend_convert_encodings(UConverter *target_conv, UConverter *source_conv, - char **target, int32_t *target_len, - const char *source, int32_t source_len, UErrorCode *status) -{ - char *buffer = NULL; - char *output; - const char *input = source; - int32_t allocated = 0; - int32_t converted = 0; - int8_t null_size; - UChar pivot_buf[1024], *pivot, *pivot2; - - if (U_FAILURE(*status)) { - return; - } - - null_size = ucnv_getMinCharSize(target_conv); - allocated = source_len + null_size; - - ucnv_resetToUnicode(source_conv); - ucnv_resetFromUnicode(target_conv); - pivot = pivot2 = pivot_buf; - - while (1) { - buffer = (char *) erealloc(buffer, allocated); - output = buffer + converted; - ucnv_convertEx(target_conv, source_conv, &output, buffer + allocated - null_size, - &input, source + source_len, pivot_buf, &pivot, &pivot2, pivot_buf + 1024, FALSE, TRUE, status); - converted = (int32_t) (output - buffer); - if (*status == U_BUFFER_OVERFLOW_ERROR) { - allocated += 1024; - *status = U_ZERO_ERROR; - } else { - break; - } - } - - memset(buffer + converted, 0, null_size); /* NULL-terminate the output string */ - *target = buffer; - *target_len = converted; - - /* Report the conversion error */ - if (U_FAILURE(*status)) { - zend_error(E_NOTICE, "Error converting from codepage string to Unicode: %s", u_errorName(*status)); - } -} -/* }}} */ - -/* {{{ zval_unicode_to_string */ -ZEND_API int zval_unicode_to_string(zval *string, UConverter *conv TSRMLS_DC) -{ - UErrorCode status = U_ZERO_ERROR; - int retval = TRUE; - char *s = NULL; - int s_len; - -#if 0 - /* UTODO Putting it here for now, until we figure out the framework */ - switch (UG(from_u_error_mode)) { - case ZEND_FROM_U_ERROR_STOP: - ucnv_setFromUCallBack(UG(runtime_encoding_conv), UCNV_FROM_U_CALLBACK_STOP, NULL, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_SKIP: - ucnv_setFromUCallBack(UG(runtime_encoding_conv), UCNV_FROM_U_CALLBACK_SKIP, NULL, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_ESCAPE: - ucnv_setFromUCallBack(UG(runtime_encoding_conv), UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_UNICODE, NULL, NULL, &status); - break; - - case ZEND_FROM_U_ERROR_SUBST: - ucnv_setFromUCallBack(UG(runtime_encoding_conv), UCNV_FROM_U_CALLBACK_SUBSTITUTE, NULL, NULL, NULL, &status); - break; - - default: - assert(0); - break; - } - - if (UG(subst_chars)) { - char subchar[16]; - int8_t char_len = 16; - status = U_ZERO_ERROR; - ucnv_getSubstChars(UG(runtime_encoding_conv), subchar, &char_len, &status); - if (U_FAILURE(status)) { - zend_error(E_WARNING, "Could not get substitution characters"); - return FAILURE; - } - status = U_ZERO_ERROR; - ucnv_setSubstChars(UG(runtime_encoding_conv), UG(subst_chars), MIN(char_len, UG(subst_chars_len)), &status); - if (U_FAILURE(status)) { - zend_error(E_WARNING, "Could not set substitution characters"); - return FAILURE; - } - } - - status = U_ZERO_ERROR; -#endif - - UChar *u = Z_USTRVAL_P(string); - int32_t u_len = Z_USTRLEN_P(string); - - Z_TYPE_P(string) = IS_STRING; - zend_convert_from_unicode(conv, &s, &s_len, u, u_len, &status); - ZVAL_STRINGL(string, s, s_len, 0); - - if (U_FAILURE(status)) { - retval = FAILURE; - } - - efree(u); - return retval; -} -/* }}} */ - -/* {{{ zval_string_to_unicode */ -ZEND_API int zval_string_to_unicode(zval *string TSRMLS_DC) -{ - UErrorCode status = U_ZERO_ERROR; - int retval = TRUE; - UChar *u = NULL; - int32_t u_len; - - char *s = Z_STRVAL_P(string); - int s_len = Z_STRLEN_P(string); - - Z_TYPE_P(string) = IS_UNICODE; - zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, s, s_len, &status); - ZVAL_UNICODEL(string, u, u_len, 0); - - if (U_FAILURE(status)) { - retval = FALSE; - } - - efree(s); - return retval; -} -/* }}} */ - -/* {{{ zend_cmp_unicode_and_string */ -ZEND_API int zend_cmp_unicode_and_string(UChar *ustr, char* str, uint len) -{ - UErrorCode status = U_ZERO_ERROR; - UChar *u = NULL; - int32_t u_len; - int retval = TRUE; - TSRMLS_FETCH(); - - zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, str, len, &status); - if (U_FAILURE(status)) { - efree(u); - return FALSE; - } - retval = u_memcmp(ustr, u, u_len); - efree(u); - return retval; -} -/* }}} */ - -/* {{{ zend_cmp_unicode_and_literal */ -/* - * Compare a Unicode string and an ASCII literal. Because ASCII maps nicely onto Unicode - * range U+0000 .. U+007F, we can simply casst ASCII chars to Unicode values and avoid - * memory allocation. - */ -ZEND_API int zend_cmp_unicode_and_literal(UChar *ustr, int32_t ulen, char *str, int32_t slen) -{ - int32_t result; - uint len = MIN(ulen, slen); - - while (len--) { - result = (int32_t)(uint16_t)*ustr - (int32_t)(uint16_t)*str; - if (result != 0) - return result; - ustr++; - str++; - } - - return ulen - slen; -} -/* }}} */ - -/* {{{ zend_is_valid_identifier */ -ZEND_API int zend_is_valid_identifier(UChar *ident, int32_t ident_len) -{ - UChar32 codepoint; - int32_t i; - UProperty id_prop = UCHAR_XID_START; - - for (i = 0; i < ident_len; ) { - U16_NEXT(ident, i, ident_len, codepoint); - if (!u_hasBinaryProperty(codepoint, id_prop) && - codepoint != 0x5f) { /* special case for starting '_' */ - return 0; - } - id_prop = UCHAR_XID_CONTINUE; - } - - return 1; -} -/* }}} */ - -/* {{{ zend_normalize_string */ -static inline void zend_normalize_string(UChar **dest, int32_t *dest_len, UChar *src, int32_t src_len, UErrorCode *status) -{ - UChar *buffer = NULL; - int32_t buffer_len; - - buffer_len = src_len; - while (1) { - *status = U_ZERO_ERROR; - buffer = eurealloc(buffer, buffer_len+1); - buffer_len = unorm_normalize(src, src_len, UNORM_NFKC, 0, buffer, buffer_len, status); - if (*status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - if (U_SUCCESS(*status)) { - buffer[buffer_len] = 0; - *dest = buffer; - *dest_len = buffer_len; - } else { - efree(buffer); - } -} -/* }}} */ - -/* {{{ zend_case_fold_string */ -ZEND_API void zend_case_fold_string(UChar **dest, int32_t *dest_len, UChar *src, int32_t src_len, uint32_t options, UErrorCode *status) -{ - UChar *buffer = NULL; - int32_t buffer_len; - - buffer_len = src_len; - while (1) { - *status = U_ZERO_ERROR; - buffer = eurealloc(buffer, buffer_len+1); - buffer_len = u_strFoldCase(buffer, buffer_len, src, src_len, options, status); - if (*status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - if (U_SUCCESS(*status)) { - buffer[buffer_len] = 0; - *dest = buffer; - *dest_len = buffer_len; - } else { - efree(buffer); - } -} -/* }}} */ - -/* {{{ zend_normalize_identifier */ -ZEND_API int zend_normalize_identifier(UChar **dest, int32_t *dest_len, UChar *ident, int32_t ident_len, zend_bool fold_case) -{ - UChar *buffer = NULL; - UChar *orig_ident = ident; - int32_t buffer_len; - UErrorCode status = U_ZERO_ERROR; - - if (unorm_quickCheck(ident, ident_len, UNORM_NFKC, &status) != UNORM_YES) { - zend_normalize_string(&buffer, &buffer_len, ident, ident_len, &status); - if (U_FAILURE(status)) { - return 0; - } - ident = buffer; - ident_len = buffer_len; - } - - if (fold_case) { - zend_case_fold_string(&buffer, &buffer_len, ident, ident_len, U_FOLD_CASE_DEFAULT, &status); - if (ident != orig_ident) { - efree(ident); - } - if (U_FAILURE(status)) { - return 0; - } - ident = buffer; - ident_len = buffer_len; - - if (unorm_quickCheck(ident, ident_len, UNORM_NFKC, &status) != UNORM_YES) { - zend_normalize_string(&buffer, &buffer_len, ident, ident_len, &status); - if (ident != orig_ident) { - efree(ident); - } - if (U_FAILURE(status)) { - return 0; - } - ident = buffer; - ident_len = buffer_len; - } - } - - *dest = ident; - *dest_len = ident_len; - return 1; -} -/* }}} */ - -/* vim: set fdm=marker et sts=4: */ diff --git a/Zend/zend_unicode.h b/Zend/zend_unicode.h deleted file mode 100644 index 6de553893628d..0000000000000 --- a/Zend/zend_unicode.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2004 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -#ifndef ZEND_UNICODE_H -#define ZEND_UNICODE_H - -#include "zend.h" -#include -#include -#include -#include -#include -#include -#include - -#define ZEND_FROM_U_ERROR_STOP 0 -#define ZEND_FROM_U_ERROR_SKIP 1 -#define ZEND_FROM_U_ERROR_SUBST 2 -#define ZEND_FROM_U_ERROR_ESCAPE 3 - -/* internal functions */ - -int zend_set_converter_encoding(UConverter **converter, const char *encoding); -void zend_set_converter_subst_char(UConverter *conv, UChar *subst_char, int8_t subst_char_len); -void zend_set_converter_error_mode(UConverter *conv, uint8_t error_mode); - - -/* API functions */ - -ZEND_API void zend_convert_to_unicode(UConverter *conv, UChar **target, int32_t *target_len, const char *source, int32_t source_len, UErrorCode *status); -ZEND_API void zend_convert_from_unicode(UConverter *conv, char **target, int32_t *target_len, const UChar *source, int32_t source_len, UErrorCode *status); -ZEND_API void zend_convert_encodings(UConverter *target_conv, UConverter *source_conv, char **target, int32_t *target_len, const char *source, int32_t source_len, UErrorCode *status); -ZEND_API int zval_string_to_unicode(zval *string TSRMLS_DC); -ZEND_API int zval_unicode_to_string(zval *string, UConverter *conv TSRMLS_DC); - -ZEND_API int zend_cmp_unicode_and_string(UChar *ustr, char* str, uint len); -ZEND_API int zend_cmp_unicode_and_literal(UChar *ustr, int32_t ulen, char* str, int32_t slen); - -ZEND_API void zend_case_fold_string(UChar **dest, int32_t *dest_len, UChar *src, int32_t src_len, uint32_t options, UErrorCode *status); - -ZEND_API int zend_is_valid_identifier(UChar *ident, int32_t ident_len); -ZEND_API int zend_normalize_identifier(UChar **dest, int32_t *dest_len, UChar *ident, int32_t ident_len, zend_bool fold_case); - -/* - * Function to get a codepoint at position n. Iterates over codepoints starting from the - * beginning of the string. Does not check for n > length, this is left up to the caller. - */ -static inline UChar32 zend_get_codepoint_at(UChar *str, int32_t length, int32_t n) -{ - int32_t offset = 0; - UChar32 c = 0; - - U16_FWD_N(str, offset, length, n); - U16_GET(str, 0, offset, length, c); - - return c; -} - -/* - * Convert a single codepoint to UChar sequence (1 or 2). - * The UChar buffer is assumed to be large enough. - */ -static inline int zend_codepoint_to_uchar(UChar32 codepoint, UChar *buf) -{ - if (U_IS_BMP(codepoint)) { - *buf++ = (UChar) codepoint; - return 1; - } else if (codepoint <= UCHAR_MAX_VALUE) { - *buf++ = (UChar) U16_LEAD(codepoint); - *buf++ = (UChar) U16_TRAIL(codepoint); - return 2; - } else { - return 0; - } -} - -#define ZEND_U_CONVERTER(c) ((c)?(c):UG(fallback_encoding_conv)) - -#define USTR_FREE(ustr) do { if (ustr) { efree(ustr); } } while (0); -#define UBYTES(len) ((len) * sizeof(UChar)) -#define USTR_LEN(str) (UG(unicode)?u_strlen((UChar*)(str)):strlen((char*)(str))) - -#define USTR_MAKE(cs) zend_ascii_to_unicode(cs, sizeof(cs) ZEND_FILE_LINE_CC) -#define USTR_MAKE_REL(cs) zend_ascii_to_unicode(cs, sizeof(cs) ZEND_FILE_LINE_RELAY_CC) -static inline UChar* zend_ascii_to_unicode(const char *cs, size_t cs_size ZEND_FILE_LINE_DC) -{ - /* u_charsToUChars() takes care of the terminating NULL */ - UChar *us = eumalloc_rel(cs_size); - u_charsToUChars(cs, us, cs_size); - return us; -} - -#endif /* ZEND_UNICODE_H */ diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c deleted file mode 100644 index 7d5b208ca1d06..0000000000000 --- a/Zend/zend_variables.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include "zend.h" -#include "zend_API.h" -#include "zend_globals.h" -#include "zend_constants.h" -#include "zend_list.h" - - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_CONSTANT: { - TSRMLS_FETCH(); - - if (UG(unicode)) goto dtor_unicode; - } - case IS_STRING: - case IS_BINARY: - CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); - break; - case IS_UNICODE: -dtor_unicode: - CHECK_ZVAL_UNICODE_REL(zvalue); - STR_FREE_REL(zvalue->value.ustr.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - TSRMLS_FETCH(); - - if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { - zend_hash_destroy(zvalue->value.ht); - FREE_HASHTABLE(zvalue->value.ht); - } - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - - Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); - } - break; - case IS_RESOURCE: - { - TSRMLS_FETCH(); - - /* destroy resource */ - zend_list_delete(zvalue->value.lval); - } - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - return; - break; - } -} - - -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_CONSTANT: { - TSRMLS_FETCH(); - - if (UG(unicode)) goto dtor_unicode; - } - case IS_STRING: - case IS_BINARY: - CHECK_ZVAL_STRING_REL(zvalue); - free(zvalue->value.str.val); - break; - case IS_UNICODE: -dtor_unicode: - CHECK_ZVAL_UNICODE_REL(zvalue); - free(zvalue->value.ustr.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources"); - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - break; - } -} - - -ZEND_API void zval_add_ref(zval **p) -{ - (*p)->refcount++; -} - - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type) { - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_addref(zvalue->value.lval); - } - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: { - TSRMLS_FETCH(); - - if (UG(unicode)) goto copy_unicode; - } - case IS_STRING: - case IS_BINARY: - CHECK_ZVAL_STRING_REL(zvalue); - zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len); - break; - case IS_UNICODE: -copy_unicode: - CHECK_ZVAL_UNICODE_REL(zvalue); - zvalue->value.ustr.val = eustrndup_rel(zvalue->value.ustr.val, zvalue->value.ustr.len); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - zval *tmp; - HashTable *original_ht = zvalue->value.ht; - HashTable *tmp_ht = NULL; - TSRMLS_FETCH(); - - if (zvalue->value.ht == &EG(symbol_table)) { - return; /* do nothing */ - } - ALLOC_HASHTABLE_REL(tmp_ht); - zend_u_hash_init(tmp_ht, 0, NULL, ZVAL_PTR_DTOR, 0, original_ht->unicode); - zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - zvalue->value.ht = tmp_ht; - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC); - } - break; - } -} - -ZEND_API int zend_print_variable(zval *var) -{ - return zend_print_zval(var, 0); -} - - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue) -{ - zval_copy_ctor(zvalue); -} - - -ZEND_API void _zval_dtor_wrapper(zval *zvalue) -{ - zval_dtor(zvalue); -} - - -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue) -{ - zval_internal_dtor(zvalue); -} - - -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_ptr_dtor(zval_ptr); -} - - -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_internal_ptr_dtor(zval_ptr); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h deleted file mode 100644 index 25eb5a4eb9ae7..0000000000000 --- a/Zend/zend_variables.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VARIABLES_H -#define ZEND_VARIABLES_H - - -BEGIN_EXTERN_C() - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_dtor_func(zvalue ZEND_FILE_LINE_CC); -} - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_CC); -} - - -ZEND_API int zend_print_variable(zval *var); -ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_ptr_dtor(zval **zvalue ZEND_FILE_LINE_DC); -#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC) -#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC) -#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_internal_ptr_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC) - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue); -ZEND_API void _zval_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr); -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zvalue); -#define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper -#define zval_dtor_wrapper _zval_dtor_wrapper -#define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper -#define zval_internal_dtor_wrapper _zval_internal_dtor_wrapper -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor_wrapper -#else -#define zval_copy_ctor_wrapper _zval_copy_ctor_func -#define zval_dtor_wrapper _zval_dtor_func -#define zval_ptr_dtor_wrapper _zval_ptr_dtor -#define zval_internal_dtor_wrapper _zval_internal_dtor -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor -#endif - -ZEND_API void zval_add_ref(zval **p); - -END_EXTERN_C() - -#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper -#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper -#define ZVAL_INTERNAL_DTOR (void (*)(void *)) zval_internal_dtor_wrapper -#define ZVAL_INTERNAL_PTR_DTOR (void (*)(void *)) zval_internal_ptr_dtor_wrapper -#define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h deleted file mode 100644 index 7791a9124eb72..0000000000000 --- a/Zend/zend_vm.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VM_H -#define ZEND_VM_H - -ZEND_API void zend_vm_use_old_executor(); -ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode); - -#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) - -#endif diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h deleted file mode 100644 index f674880c44556..0000000000000 --- a/Zend/zend_vm_def.h +++ /dev/null @@ -1,3834 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* If you change this file, please regenerate the zend_vm_execute.h and - * zend_vm_opcodes.h files by running: - * php zend_vm_gen.php - */ - -ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - FREE_OP2(); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP(free_op_data1); - } - - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - if (OP1_TYPE != IS_CV && !OP1_FREE) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - } else { - zend_op *op_data = opline+1; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = GET_OP2_ZVAL_PTR(BP_VAR_R); - var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - FREE_OP1_VAR_PTR(); - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(23, ZEND_ASSIGN_ADD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, add_function); -} - -ZEND_VM_HANDLER(24, ZEND_ASSIGN_SUB, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, sub_function); -} - -ZEND_VM_HANDLER(25, ZEND_ASSIGN_MUL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mul_function); -} - -ZEND_VM_HANDLER(26, ZEND_ASSIGN_DIV, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, div_function); -} - -ZEND_VM_HANDLER(27, ZEND_ASSIGN_MOD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mod_function); -} - -ZEND_VM_HANDLER(28, ZEND_ASSIGN_SL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_left_function); -} - -ZEND_VM_HANDLER(29, ZEND_ASSIGN_SR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_right_function); -} - -ZEND_VM_HANDLER(30, ZEND_ASSIGN_CONCAT, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, concat_function); -} - -ZEND_VM_HANDLER(31, ZEND_ASSIGN_BW_OR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_or_function); -} - -ZEND_VM_HANDLER(32, ZEND_ASSIGN_BW_AND, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_and_function); -} - -ZEND_VM_HANDLER(33, ZEND_ASSIGN_BW_XOR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_xor_function); -} - -ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(132, ZEND_PRE_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(133, ZEND_PRE_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - *retval = *EG(uninitialized_zval_ptr); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(134, ZEND_POST_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(135, ZEND_POST_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R); - UErrorCode status = U_ZERO_ERROR; - - /* Convert inline HTML blocks to the output encoding, but only if necessary. */ - if (opline->extended_value && - strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status), - EX(op_array)->script_encoding)) { - zval z_conv; - UConverter *script_enc_conv = NULL; - if (zend_set_converter_encoding(&script_enc_conv, EX(op_array)->script_encoding) == FAILURE) { - zend_error(E_ERROR, "Unsupported encoding [%d]", EX(op_array)->script_encoding); - } - zend_convert_encodings(ZEND_U_CONVERTER(UG(output_encoding_conv)), script_enc_conv, &z_conv.value.str.val, &z_conv.value.str.len, z->value.str.val, z->value.str.len, &status); - z_conv.type = IS_BINARY; - if (U_SUCCESS(status)) { - zend_print_variable(&z_conv); - } else { - zend_error(E_WARNING, "Could not convert inline HTML for output"); - } - zval_dtor(&z_conv); - ucnv_close(script_enc_conv); - } else { - zend_print_variable(z); - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; - - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO); -} - -ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_text(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_u_hash_update(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (OP1_TYPE != IS_TMP_VAR) { - FREE_OP1(); - } - break; - case ZEND_FETCH_LOCAL: - FREE_OP1(); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(80, ZEND_FETCH_R, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(83, ZEND_FETCH_W, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_W); -} - -ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_RW); -} - -ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, - ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R); -} - -ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_UNSET); -} - -ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && OP1_TYPE != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_R), dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_W), dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS), dim, IS_OP2_TMP_FREE(), BP_VAR_IS TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (OP2_TYPE == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(type), dim, IS_OP2_TMP_FREE(), type TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_UNSET TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int type) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = GET_OP1_OBJ_ZVAL_PTR(type); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && OP1_TYPE != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW), property, BP_VAR_RW TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } else { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); - } -} - -ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_R); - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (container->type != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(container->value.ht, dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - FREE_OP2(); - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (OP1_TYPE == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - FREE_OP1_VAR_PTR(); - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (IS_OP2_TMP_FREE()?IS_TMP_VAR:OP2_TYPE), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - FREE_OP2_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W); - - if (OP2_TYPE == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ASSIGN); - } - if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - FREE_OP2_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - ZEND_VM_CONTINUE_JMP(); - } -} - -ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(70, ZEND_FREE, TMP, ANY) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - if (EX(opline)->extended_value == IS_UNICODE) { - tmp->value.ustr.val = eumalloc(1); - tmp->value.ustr.val[0] = 0; - tmp->value.ustr.len = 0; - tmp->type = IS_UNICODE; - } else { - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->type = EX(opline)->extended_value; - } - tmp->refcount = 1; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP, TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval var_copy; - int use_copy; - - if (opline->extended_value == IS_UNICODE) { - zend_make_unicode_zval(var, &var_copy, &use_copy); - } else { - zend_make_printable_zval(var, &var_copy, &use_copy); - } - if (use_copy) { - var = &var_copy; - } - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - FREE_OP2(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (OP2_TYPE == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - FREE_OP2(); - FREE_OP1_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(OP2_TYPE != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (OP2_TYPE == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - FREE_OP2(); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - void *function_name_strval, *lcname; - unsigned int function_name_strlen, lcname_len; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (OP2_TYPE == IS_CONST) { - function_name = &opline->op2.u.constant; - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - } - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - lcname = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_STRVAL_P(function_name), function_name_strlen, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(function_name), lcname, lcname_len+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %R()", Z_TYPE_P(function_name), function_name_strval); - } - - efree(lcname); - if (OP2_TYPE != IS_CONST) { - FREE_OP2(); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope; - zval *current_this; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* FIXME: output identifiers properly */ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - /* FIXME: output identifiers properly */ - zend_error(severity, "Non-static method %v::%v() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(EXECUTE_DATA, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = EXECUTE_DATA; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_u_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(61, ZEND_DO_FCALL_BY_NAME, ANY, ANY) -{ - EX(function_state).function = EX(fbc); - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *fname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(fname), Z_UNIVAL_P(fname), Z_UNILEN_P(fname)+1, (void **) &EX(function_state).function)==FAILURE) { - /* FIXME: output identifiers properly */ - zend_error_noreturn(E_ERROR, "Unknown function: %R()", Z_TYPE_P(fname), Z_UNIVAL_P(fname)); - } - EX(object) = NULL; - - FREE_OP1(); - - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - - retval_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (OP1_TYPE == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (OP1_TYPE == IS_VAR && !OP1_FREE) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -ZEND_VM_C_LABEL(return_by_value): - - retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(retval_ptr)->name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (value->type != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_u_hash_update(EG(active_symbol_table), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), - Z_UNILEN(opline->op2.u.constant)+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - FREE_OP1(); /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF); - } - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); -} - -ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = opline->op1.u.constant.value.lval; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %v%s%v(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %v%s%v()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = opline->op1.u.constant.value.lval; - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (opline->op2.u.constant.type == IS_CONSTANT || opline->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - if (opline->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval_copy_ctor(default_value); - } - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX_T(opline->result.u.var).tmp_var.value.lval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->brk); - FREE_OP2(); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->cont); - FREE_OP2(); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (OP1_TYPE==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - - FREE_OP2(); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - FREE_OP1(); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, TMP|VAR, ANY) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %v", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, CONST|UNUSED, CONST) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (OP1_TYPE == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'", - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant), - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant)); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_u_hash_find(&ce->constants_table, Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant)); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value) { - expr_ptr_ptr=GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && IS_OP1_TMP_FREE()) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - FREE_OP2(); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT); -} - -ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!IS_OP1_TMP_FREE()) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_string_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_UNICODE: { - zval var_copy; - int use_copy; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_BINARY: - convert_to_binary(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (UG(unicode) && opline->op2.u.constant.value.lval == ZEND_EVAL) { - if (inc_filename->type != IS_UNICODE) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_unicode(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - } else if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (opline->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - int dummy = 1; - zend_file_handle file_handle; - - if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len); - } - - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, inc_filename->value.str.val); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val); - } - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = 1; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = failure_retval; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - FREE_OP1(); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) { - zend_execute_data *ex = EXECUTE_DATA; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1); - - do { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - ex->CVs[i] = NULL; - break; - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - long index; - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - FREE_OP2(); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - FREE_OP2(); - break; - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value) { - array_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (IS_OP1_TMP_FREE()) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - } else { - array_ptr->refcount++; - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %v did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (is_empty) { - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type; - zend_bool use_key = opline->extended_value & ZEND_FE_FETCH_WITH_KEY; - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) != SUCCESS); - if (use_key) { - zend_u_unmangle_property_name(key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key, &class_name, &prop_name); - if (key_type == HASH_KEY_IS_UNICODE) { - str_key_len = u_strlen((UChar*)prop_name); - str_key = (char*)eustrndup((UChar*)prop_name, str_key_len); - } else { - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - } - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && iter->index++) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - if (!iter || (iter->index > 1 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - key->value.str.val = str_key; - key->value.str.len = str_key_len-1; - key->type = IS_STRING; - break; - case HASH_KEY_IS_BINARY: - key->value.str.val = str_key; - key->value.str.len = str_key_len-1; - key->type = IS_BINARY; - break; - case HASH_KEY_IS_UNICODE: - key->value.ustr.val = (UChar*)str_key; - key->value.ustr.len = str_key_len-1; - key->type = IS_UNICODE; - break; - case HASH_KEY_IS_LONG: - key->value.lval = int_key; - key->type = IS_LONG; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int prop_dim) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - FREE_OP2(); - } else if ((*container)->type == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - FREE_OP2(); - } else { - FREE_OP2(); - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 0); -} - -ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 1); -} - -ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY) -{ - if (OP1_TYPE != IS_UNUSED) { - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - FREE_OP1(); - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && EX_T(opline->op1.u.var).tmp_var.value.lval != 0) { - restored_error_reporting.type = IS_LONG; - restored_error_reporting.value.lval = EX_T(opline->op1.u.var).tmp_var.value.lval; - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=opline->op1.u.constant.value.lval) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(opline->op1.u.constant.value.lval); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(104, ZEND_EXT_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(0, ZEND_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%v cannot implement %v - it is not an interface", ce->name, iface->name); - } - - ce->interfaces[opline->extended_value] = iface; - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - int encapsulating_block=-1; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - encapsulating_block = i; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && EX(old_error_reporting)->value.lval != 0) { - restored_error_reporting.type = IS_LONG; - restored_error_reporting.value.lval = EX(old_error_reporting)->value.lval; - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (encapsulating_block == -1) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[EG(active_op_array)->try_catch_array[encapsulating_block].catch_op]); - ZEND_VM_CONTINUE(); - } -} - -ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -ZEND_VM_HANDLER(151, ZEND_U_NORMALIZE, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *string = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *string; - if (!IS_OP1_TMP_FREE()) { - zendi_zval_copy_ctor(*result); - } - - if (UG(unicode)) { - zval var_copy; - int use_copy; - UChar *norm; - int32_t norm_len; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - if (!zend_normalize_identifier(&norm, &norm_len, - Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result)); - } else if (norm != Z_USTRVAL_P(result)) { - efree(Z_USTRVAL_P(result)); - ZVAL_UNICODEL(result, norm, norm_len, 0); - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h deleted file mode 100644 index 8a811bc11626d..0000000000000 --- a/Zend/zend_vm_execute.h +++ /dev/null @@ -1,30866 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -static opcode_handler_t zend_user_opcode_handlers[256] = {(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL}; - -static zend_uchar zend_user_opcodes[256] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}; - -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op); - - -#define ZEND_VM_CONTINUE() return 0 -#define ZEND_VM_RETURN() return 1 -#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - -#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC - -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0) { - return; - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -#undef EX -#define EX(element) execute_data->element - -static int ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - if (EX(opline)->extended_value == IS_UNICODE) { - tmp->value.ustr.val = eumalloc(1); - tmp->value.ustr.val[0] = 0; - tmp->value.ustr.len = 0; - tmp->type = IS_UNICODE; - } else { - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->type = EX(opline)->extended_value; - } - tmp->refcount = 1; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope; - zval *current_this; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* FIXME: output identifiers properly */ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - /* FIXME: output identifiers properly */ - zend_error(severity, "Non-static method %v::%v() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(execute_data, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = execute_data; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_u_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - EX(function_state).function = EX(fbc); - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CATCH_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_u_hash_update(EG(active_symbol_table), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), - Z_UNILEN(opline->op2.u.constant)+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = opline->op1.u.constant.value.lval; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %v%s%v(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %v%s%v()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %v", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -static int ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_INTERFACE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%v cannot implement %v - it is not an interface", ce->name, iface->name); - } - - ce->interfaces[opline->extended_value] = iface; - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - int encapsulating_block=-1; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - encapsulating_block = i; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && EX(old_error_reporting)->value.lval != 0) { - restored_error_reporting.type = IS_LONG; - restored_error_reporting.value.lval = EX(old_error_reporting)->value.lval; - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (encapsulating_block == -1) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[EG(active_op_array)->try_catch_array[encapsulating_block].catch_op]); - ZEND_VM_CONTINUE(); - } -} - -static int ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -static int ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CONST == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = &opline->op2.u.constant; - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CONST != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (IS_CONST == IS_CONST); - - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - void *function_name_strval, *lcname; - unsigned int function_name_strlen, lcname_len; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CONST == IS_CONST) { - function_name = &opline->op2.u.constant; - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - } - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - lcname = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_STRVAL_P(function_name), function_name_strlen, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(function_name), lcname, lcname_len+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %R()", Z_TYPE_P(function_name), function_name_strval); - } - - efree(lcname); - if (IS_CONST != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = opline->op1.u.constant.value.lval; - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (opline->op2.u.constant.type == IS_CONSTANT || opline->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - if (opline->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval_copy_ctor(default_value); - } - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(&opline->op2.u.constant, - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->brk); - - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(&opline->op2.u.constant, - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->cont); - - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_TMP_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_TMP_VAR != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (IS_TMP_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - zval_dtor(free_op2.var); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - void *function_name_strval, *lcname; - unsigned int function_name_strlen, lcname_len; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_TMP_VAR == IS_CONST) { - function_name = &opline->op2.u.constant; - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - } - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - lcname = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_STRVAL_P(function_name), function_name_strlen, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(function_name), lcname, lcname_len+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %R()", Z_TYPE_P(function_name), function_name_strval); - } - - efree(lcname); - if (IS_TMP_VAR != IS_CONST) { - zval_dtor(free_op2.var); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->brk); - zval_dtor(free_op2.var); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_CONT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->cont); - zval_dtor(free_op2.var); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_VAR != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (IS_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - void *function_name_strval, *lcname; - unsigned int function_name_strlen, lcname_len; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_VAR == IS_CONST) { - function_name = &opline->op2.u.constant; - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - } - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - lcname = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_STRVAL_P(function_name), function_name_strlen, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(function_name), lcname, lcname_len+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %R()", Z_TYPE_P(function_name), function_name_strval); - } - - efree(lcname); - if (IS_VAR != IS_CONST) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->brk); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_CONT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->cont); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_UNUSED == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = NULL; - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_UNUSED != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (IS_UNUSED == IS_CONST); - - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = NULL; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CV == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - switch (class_name->type) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - case IS_UNICODE: - EX_T(opline->result.u.var).class_entry = zend_u_fetch_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CV != IS_UNUSED) { - char *function_name_strval; - unsigned int function_name_strlen; - zend_bool is_const = (IS_CV == IS_CONST); - - - if (is_const) { - function_name_strval = Z_UNIVAL(opline->op2.u.constant); - function_name_strlen = Z_UNILEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - void *function_name_strval, *lcname; - unsigned int function_name_strlen, lcname_len; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CV == IS_CONST) { - function_name = &opline->op2.u.constant; - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - } - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - lcname = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_STRVAL_P(function_name), function_name_strlen, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(function_name), lcname, lcname_len+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %R()", Z_TYPE_P(function_name), function_name_strval); - } - - efree(lcname); - if (IS_CV != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->brk); - - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes + - zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), - opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC)->cont); - - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = &opline->op1.u.constant; - UErrorCode status = U_ZERO_ERROR; - - /* Convert inline HTML blocks to the output encoding, but only if necessary. */ - if (opline->extended_value && - strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status), - EX(op_array)->script_encoding)) { - zval z_conv; - UConverter *script_enc_conv = NULL; - if (zend_set_converter_encoding(&script_enc_conv, EX(op_array)->script_encoding) == FAILURE) { - zend_error(E_ERROR, "Unsupported encoding [%d]", EX(op_array)->script_encoding); - } - zend_convert_encodings(ZEND_U_CONVERTER(UG(output_encoding_conv)), script_enc_conv, &z_conv.value.str.val, &z_conv.value.str.len, z->value.str.val, z->value.str.len, &status); - z_conv.type = IS_BINARY; - if (U_SUCCESS(status)) { - zend_print_variable(&z_conv); - } else { - zend_error(E_WARNING, "Could not convert inline HTML for output"); - } - zval_dtor(&z_conv); - ucnv_close(script_enc_conv); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; - - return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *varname = &opline->op1.u.constant; - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_text(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_u_hash_update(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CONST != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - ZEND_VM_CONTINUE_JMP(); - } -} - -static int ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *fname = &opline->op1.u.constant; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(fname), Z_UNIVAL_P(fname), Z_UNILEN_P(fname)+1, (void **) &EX(function_state).function)==FAILURE) { - /* FIXME: output identifiers properly */ - zend_error_noreturn(E_ERROR, "Unknown function: %R()", Z_TYPE_P(fname), Z_UNIVAL_P(fname)); - } - EX(object) = NULL; - - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CONST == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CONST == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = &opline->op1.u.constant; - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(retval_ptr)->name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = &opline->op1.u.constant; - - if (value->type != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = &opline->op1.u.constant; - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX_T(opline->result.u.var).tmp_var.value.lval = i_zend_is_true(&opline->op1.u.constant); - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = &opline->op1.u.constant; - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = &opline->op1.u.constant; - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_string_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_UNICODE: { - zval var_copy; - int use_copy; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_BINARY: - convert_to_binary(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = &opline->op1.u.constant; - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (UG(unicode) && opline->op2.u.constant.value.lval == ZEND_EVAL) { - if (inc_filename->type != IS_UNICODE) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_unicode(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - } else if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (opline->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - int dummy = 1; - zend_file_handle file_handle; - - if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len); - } - - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, inc_filename->value.str.val); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val); - } - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = 1; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = failure_retval; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = &opline->op1.u.constant; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1); - - do { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - ex->CVs[i] = NULL; - break; - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = &opline->op1.u.constant; - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - } else { - array_ptr->refcount++; - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %v did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value) { - - } else { - - } - if (is_empty) { - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = &opline->op1.u.constant; - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (IS_CONST != IS_UNUSED) { - zend_op *opline = EX(opline); - - zval *ptr = &opline->op1.u.constant; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op1.u.constant; - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_TICKS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=opline->op1.u.constant.value.lval) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(opline->op1.u.constant.value.lval); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_U_NORMALIZE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *string = &opline->op1.u.constant; - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *string; - if (!0) { - zendi_zval_copy_ctor(*result); - } - - if (UG(unicode)) { - zval var_copy; - int use_copy; - UChar *norm; - int32_t norm_len; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - if (!zend_normalize_identifier(&norm, &norm_len, - Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result)); - } else if (norm != Z_USTRVAL_P(result)) { - efree(Z_USTRVAL_P(result)); - ZVAL_UNICODEL(result, norm, norm_len, 0); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_CONST == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'", - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant), - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant)); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_u_hash_find(&ce->constants_table, Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant)); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=&opline->op2.u.constant; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - UErrorCode status = U_ZERO_ERROR; - - /* Convert inline HTML blocks to the output encoding, but only if necessary. */ - if (opline->extended_value && - strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status), - EX(op_array)->script_encoding)) { - zval z_conv; - UConverter *script_enc_conv = NULL; - if (zend_set_converter_encoding(&script_enc_conv, EX(op_array)->script_encoding) == FAILURE) { - zend_error(E_ERROR, "Unsupported encoding [%d]", EX(op_array)->script_encoding); - } - zend_convert_encodings(ZEND_U_CONVERTER(UG(output_encoding_conv)), script_enc_conv, &z_conv.value.str.val, &z_conv.value.str.len, z->value.str.val, z->value.str.len, &status); - z_conv.type = IS_BINARY; - if (U_SUCCESS(status)) { - zend_print_variable(&z_conv); - } else { - zend_error(E_WARNING, "Could not convert inline HTML for output"); - } - zval_dtor(&z_conv); - ucnv_close(script_enc_conv); - } else { - zend_print_variable(z); - } - - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; - - return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_text(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_u_hash_update(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_TMP_VAR != IS_TMP_VAR) { - zval_dtor(free_op1.var); - } - break; - case ZEND_FETCH_LOCAL: - zval_dtor(free_op1.var); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - ZEND_VM_CONTINUE_JMP(); - } -} - -static int ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_TMP_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_TMP_VAR == IS_VAR && !1) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(retval_ptr)->name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!1) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (value->type != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!1) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!1) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX_T(opline->result.u.var).tmp_var.value.lval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!1) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_string_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_UNICODE: { - zval var_copy; - int use_copy; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_BINARY: - convert_to_binary(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (UG(unicode) && opline->op2.u.constant.value.lval == ZEND_EVAL) { - if (inc_filename->type != IS_UNICODE) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_unicode(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - } else if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (opline->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - int dummy = 1; - zend_file_handle file_handle; - - if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len); - } - - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, inc_filename->value.str.val); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val); - } - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = 1; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = failure_retval; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - zval_dtor(free_op1.var); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1); - - do { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - ex->CVs[i] = NULL; - break; - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (1) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - } else { - array_ptr->refcount++; - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %v did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value) { - - } else { - - } - if (is_empty) { - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (IS_TMP_VAR != IS_UNUSED) { - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - zval_dtor(free_op1.var); - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && EX_T(opline->op1.u.var).tmp_var.value.lval != 0) { - restored_error_reporting.type = IS_LONG; - restored_error_reporting.value.lval = EX_T(opline->op1.u.var).tmp_var.value.lval; - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!1) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_U_NORMALIZE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *string = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *string; - if (!1) { - zendi_zval_copy_ctor(*result); - } - - if (UG(unicode)) { - zval var_copy; - int use_copy; - UChar *norm; - int32_t norm_len; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - if (!zend_normalize_identifier(&norm, &norm_len, - Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result)); - } else if (norm != Z_USTRVAL_P(result)) { - efree(Z_USTRVAL_P(result)); - ZVAL_UNICODEL(result, norm, norm_len, 0); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container->type != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - - zval *dim = &opline->op2.u.constant; - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(container->value.ht, dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=&opline->op2.u.constant; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy; - - if (opline->extended_value == IS_UNICODE) { - zend_make_unicode_zval(var, &var_copy, &use_copy); - } else { - zend_make_printable_zval(var, &var_copy, &use_copy); - } - if (use_copy) { - var = &var_copy; - } - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy; - - if (opline->extended_value == IS_UNICODE) { - zend_make_unicode_zval(var, &var_copy, &use_copy); - } else { - zend_make_printable_zval(var, &var_copy, &use_copy); - } - if (use_copy) { - var = &var_copy; - } - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *var = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval var_copy; - int use_copy; - - if (opline->extended_value == IS_UNICODE) { - zend_make_unicode_zval(var, &var_copy, &use_copy); - } else { - zend_make_printable_zval(var, &var_copy, &use_copy); - } - if (use_copy) { - var = &var_copy; - } - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - UErrorCode status = U_ZERO_ERROR; - - /* Convert inline HTML blocks to the output encoding, but only if necessary. */ - if (opline->extended_value && - strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status), - EX(op_array)->script_encoding)) { - zval z_conv; - UConverter *script_enc_conv = NULL; - if (zend_set_converter_encoding(&script_enc_conv, EX(op_array)->script_encoding) == FAILURE) { - zend_error(E_ERROR, "Unsupported encoding [%d]", EX(op_array)->script_encoding); - } - zend_convert_encodings(ZEND_U_CONVERTER(UG(output_encoding_conv)), script_enc_conv, &z_conv.value.str.val, &z_conv.value.str.len, z->value.str.val, z->value.str.len, &status); - z_conv.type = IS_BINARY; - if (U_SUCCESS(status)) { - zend_print_variable(&z_conv); - } else { - zend_error(E_WARNING, "Could not convert inline HTML for output"); - } - zval_dtor(&z_conv); - ucnv_close(script_enc_conv); - } else { - zend_print_variable(z); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; - - return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_text(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_u_hash_update(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - break; - case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - ZEND_VM_CONTINUE_JMP(); - } -} - -static int ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(retval_ptr)->name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (value->type != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX_T(opline->result.u.var).tmp_var.value.lval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_string_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_UNICODE: { - zval var_copy; - int use_copy; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_BINARY: - convert_to_binary(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (UG(unicode) && opline->op2.u.constant.value.lval == ZEND_EVAL) { - if (inc_filename->type != IS_UNICODE) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_unicode(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - } else if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (opline->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - int dummy = 1; - zend_file_handle file_handle; - - if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len); - } - - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, inc_filename->value.str.val); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val); - } - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = 1; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = failure_retval; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1); - - do { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - ex->CVs[i] = NULL; - break; - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value) { - array_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - } else { - array_ptr->refcount++; - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %v did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (is_empty) { - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type; - zend_bool use_key = opline->extended_value & ZEND_FE_FETCH_WITH_KEY; - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) != SUCCESS); - if (use_key) { - zend_u_unmangle_property_name(key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key, &class_name, &prop_name); - if (key_type == HASH_KEY_IS_UNICODE) { - str_key_len = u_strlen((UChar*)prop_name); - str_key = (char*)eustrndup((UChar*)prop_name, str_key_len); - } else { - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - } - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && iter->index++) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - if (!iter || (iter->index > 1 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - key->value.str.val = str_key; - key->value.str.len = str_key_len-1; - key->type = IS_STRING; - break; - case HASH_KEY_IS_BINARY: - key->value.str.val = str_key; - key->value.str.len = str_key_len-1; - key->type = IS_BINARY; - break; - case HASH_KEY_IS_UNICODE: - key->value.ustr.val = (UChar*)str_key; - key->value.ustr.len = str_key_len-1; - key->type = IS_UNICODE; - break; - case HASH_KEY_IS_LONG: - key->value.lval = int_key; - key->type = IS_LONG; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (IS_VAR != IS_UNUSED) { - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_U_NORMALIZE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *string = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *string; - if (!0) { - zendi_zval_copy_ctor(*result); - } - - if (UG(unicode)) { - zval var_copy; - int use_copy; - UChar *norm; - int32_t norm_len; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - if (!zend_normalize_identifier(&norm, &norm_len, - Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result)); - } else if (norm != Z_USTRVAL_P(result)) { - efree(Z_USTRVAL_P(result)); - ZVAL_UNICODEL(result, norm, norm_len, 0); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=&opline->op2.u.constant; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if ((*container)->type == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_obj_zval_ptr_unused(TSRMLS_C); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (IS_UNUSED != IS_UNUSED) { - zend_op *opline = EX(opline); - - zval *ptr = NULL; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = &opline->op2.u.constant; - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_UNUSED == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'", - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant), - Z_TYPE(opline->op2.u.constant), - Z_UNIVAL(opline->op2.u.constant)); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_u_hash_find(&ce->constants_table, Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant)); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=&opline->op2.u.constant; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=NULL; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=NULL; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if ((*container)->type == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=NULL; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIM_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=NULL; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=NULL; - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - UErrorCode status = U_ZERO_ERROR; - - /* Convert inline HTML blocks to the output encoding, but only if necessary. */ - if (opline->extended_value && - strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status), - EX(op_array)->script_encoding)) { - zval z_conv; - UConverter *script_enc_conv = NULL; - if (zend_set_converter_encoding(&script_enc_conv, EX(op_array)->script_encoding) == FAILURE) { - zend_error(E_ERROR, "Unsupported encoding [%d]", EX(op_array)->script_encoding); - } - zend_convert_encodings(ZEND_U_CONVERTER(UG(output_encoding_conv)), script_enc_conv, &z_conv.value.str.val, &z_conv.value.str.len, z->value.str.val, z->value.str.len, &status); - z_conv.type = IS_BINARY; - if (U_SUCCESS(status)) { - zend_print_variable(&z_conv); - } else { - zend_error(E_WARNING, "Could not convert inline HTML for output"); - } - zval_dtor(&z_conv); - ucnv_close(script_enc_conv); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; - - return ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_text(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %R", Z_TYPE_P(varname), Z_UNIVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_u_hash_update(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CV != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - ZEND_VM_CONTINUE_JMP(); - } -} - -static int ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - EX_T(opline->result.u.var).tmp_var.value.lval = retval; - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr); - ZEND_VM_CONTINUE_JMP(); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CV == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CV == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(retval_ptr)->name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (value->type != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - ; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX_T(opline->result.u.var).tmp_var.value.lval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", ce->name); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %v::__clone() from context '%v'", ce->name, EG(scope) ? EG(scope)->name : EMPTY_STR); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.obj = clone_call(obj TSRMLS_CC); - if (EG(exception)) { - FREE_ZVAL(EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->type = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_string_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_UNICODE: { - zval var_copy; - int use_copy; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_BINARY: - convert_to_binary(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (UG(unicode) && opline->op2.u.constant.value.lval == ZEND_EVAL) { - if (inc_filename->type != IS_UNICODE) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_unicode(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - } else if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (opline->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - int dummy = 1; - zend_file_handle file_handle; - - if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len); - } - - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, inc_filename->value.str.val); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val); - } - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = 1; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - EX_T(opline->result.u.var).var.ptr->value.lval = failure_retval; - EX_T(opline->result.u.var).var.ptr->type = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1); - - do { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - ex->CVs[i] = NULL; - break; - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value) { - array_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - } else { - array_ptr->refcount++; - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %v did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - ZEND_VM_NEXT_OPCODE(); - } - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value) { - - } else { - - } - if (is_empty) { - ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num); - ZEND_VM_CONTINUE_JMP(); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (varname->type != IS_STRING && varname->type != IS_UNICODE) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_text(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_u_hash_find(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - EX_T(opline->result.u.var).tmp_var.value.lval = 1; - } else { - EX_T(opline->result.u.var).tmp_var.value.lval = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (IS_CV != IS_UNUSED) { - zend_op *opline = EX(opline); - - zval *ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_U_NORMALIZE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *string = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *string; - if (!0) { - zendi_zval_copy_ctor(*result); - } - - if (UG(unicode)) { - zval var_copy; - int use_copy; - UChar *norm; - int32_t norm_len; - - zend_make_unicode_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - if (!zend_normalize_identifier(&norm, &norm_len, - Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result)); - } else if (norm != Z_USTRVAL_P(result)) { - efree(Z_USTRVAL_P(result)); - ZVAL_UNICODEL(result, norm, norm_len, 0); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=&opline->op2.u.constant; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if ((*container)->type == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC); - } - break; - } - if (z) { - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if ((*object_ptr)->type == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - zval *z_copy; - - if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && (*object_ptr)->type == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - /* FIXME: type is default */ - zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING && Z_TYPE_P(function_name) != IS_UNICODE) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_UNIVAL_P(function_name); - function_name_strlen = Z_UNILEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && EX(object)->type == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %R::%R()", type, Z_OBJ_CLASS_NAME_P(EX(object)), Z_TYPE_P(function_name), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %R() on a non-object", Z_TYPE_P(function_name), function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - - if (opline->opcode == ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - ZEND_VM_NEXT_OPCODE(); - } - } - if (!opline->extended_value && 0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_u_symtable_update(array_ptr->value.ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - - zend_hash_index_del(ht, index); - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - void *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && offset->type == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - - if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset_len && - !memcmp(ex->op_array->vars[i].name, offset_key, Z_TYPE_P(offset)==IS_UNICODE?UBYTES(offset_len):offset_len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if ((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.dval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: { - char *offset_key = Z_UNIVAL_P(offset); - int offset_len = Z_UNILEN_P(offset); - int free_offset = 0; - - if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) { - /* Identifier normalization */ - UChar *norm; - int32_t norm_len; - - if (!zend_normalize_identifier(&norm, &norm_len, - (UChar*)offset_key, offset_len, 0)) { - zend_error(E_WARNING, "Could not normalize identifier: %r", offset_key); - } else if ((char*)norm != offset_key) { - offset_key = (char*)norm; - offset_len = norm_len; - free_offset = 1; - } - } - if (zend_u_symtable_find(ht, Z_TYPE_P(offset), offset_key, offset_len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - if (free_offset) { - efree(offset_key); - } - break; - } - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if ((*container)->type == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if (((*container)->type == IS_STRING || - (*container)->type == IS_BINARY || - (*container)->type == IS_UNICODE) && !prop_dim) { /* string offsets */ - zval tmp; - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (offset->type == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && - offset->value.lval < Z_UNILEN_PP(container) && - ((Z_TYPE_PP(container) == IS_UNICODE)? - (Z_USTRVAL_PP(container)[offset->value.lval] != 0): - (Z_STRVAL_PP(container)[offset->value.lval] != '0'))) { - result = 1; - } - break; - } - } - - } else { - - } - } - - EX_T(opline->result.u.var).tmp_var.type = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - EX_T(opline->result.u.var).tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX_T(opline->result.u.var).tmp_var.value.lval = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - - -void zend_init_opcodes_handlers() -{ - static const opcode_handler_t labels[] = { - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_ADD_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CONST_CV_HANDLER, - ZEND_ADD_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_TMP_CV_HANDLER, - ZEND_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ADD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CV_HANDLER, - ZEND_SUB_SPEC_CONST_CONST_HANDLER, - ZEND_SUB_SPEC_CONST_TMP_HANDLER, - ZEND_SUB_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CONST_CV_HANDLER, - ZEND_SUB_SPEC_TMP_CONST_HANDLER, - ZEND_SUB_SPEC_TMP_TMP_HANDLER, - ZEND_SUB_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_TMP_CV_HANDLER, - ZEND_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CONST_HANDLER, - ZEND_SUB_SPEC_CV_TMP_HANDLER, - ZEND_SUB_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CV_HANDLER, - ZEND_MUL_SPEC_CONST_CONST_HANDLER, - ZEND_MUL_SPEC_CONST_TMP_HANDLER, - ZEND_MUL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CONST_CV_HANDLER, - ZEND_MUL_SPEC_TMP_CONST_HANDLER, - ZEND_MUL_SPEC_TMP_TMP_HANDLER, - ZEND_MUL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_TMP_CV_HANDLER, - ZEND_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CONST_HANDLER, - ZEND_MUL_SPEC_CV_TMP_HANDLER, - ZEND_MUL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CV_HANDLER, - ZEND_DIV_SPEC_CONST_CONST_HANDLER, - ZEND_DIV_SPEC_CONST_TMP_HANDLER, - ZEND_DIV_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CONST_CV_HANDLER, - ZEND_DIV_SPEC_TMP_CONST_HANDLER, - ZEND_DIV_SPEC_TMP_TMP_HANDLER, - ZEND_DIV_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_TMP_CV_HANDLER, - ZEND_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CONST_HANDLER, - ZEND_DIV_SPEC_CV_TMP_HANDLER, - ZEND_DIV_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CV_HANDLER, - ZEND_MOD_SPEC_CONST_CONST_HANDLER, - ZEND_MOD_SPEC_CONST_TMP_HANDLER, - ZEND_MOD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CONST_CV_HANDLER, - ZEND_MOD_SPEC_TMP_CONST_HANDLER, - ZEND_MOD_SPEC_TMP_TMP_HANDLER, - ZEND_MOD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_TMP_CV_HANDLER, - ZEND_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CONST_HANDLER, - ZEND_MOD_SPEC_CV_TMP_HANDLER, - ZEND_MOD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CV_HANDLER, - ZEND_SL_SPEC_CONST_CONST_HANDLER, - ZEND_SL_SPEC_CONST_TMP_HANDLER, - ZEND_SL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CONST_CV_HANDLER, - ZEND_SL_SPEC_TMP_CONST_HANDLER, - ZEND_SL_SPEC_TMP_TMP_HANDLER, - ZEND_SL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_TMP_CV_HANDLER, - ZEND_SL_SPEC_VAR_CONST_HANDLER, - ZEND_SL_SPEC_VAR_TMP_HANDLER, - ZEND_SL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CONST_HANDLER, - ZEND_SL_SPEC_CV_TMP_HANDLER, - ZEND_SL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CV_HANDLER, - ZEND_SR_SPEC_CONST_CONST_HANDLER, - ZEND_SR_SPEC_CONST_TMP_HANDLER, - ZEND_SR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CONST_CV_HANDLER, - ZEND_SR_SPEC_TMP_CONST_HANDLER, - ZEND_SR_SPEC_TMP_TMP_HANDLER, - ZEND_SR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_TMP_CV_HANDLER, - ZEND_SR_SPEC_VAR_CONST_HANDLER, - ZEND_SR_SPEC_VAR_TMP_HANDLER, - ZEND_SR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CONST_HANDLER, - ZEND_SR_SPEC_CV_TMP_HANDLER, - ZEND_SR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CV_HANDLER, - ZEND_CONCAT_SPEC_CONST_CONST_HANDLER, - ZEND_CONCAT_SPEC_CONST_TMP_HANDLER, - ZEND_CONCAT_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CONST_CV_HANDLER, - ZEND_CONCAT_SPEC_TMP_CONST_HANDLER, - ZEND_CONCAT_SPEC_TMP_TMP_HANDLER, - ZEND_CONCAT_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_TMP_CV_HANDLER, - ZEND_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_BW_OR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_OR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_OR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CONST_CV_HANDLER, - ZEND_BW_OR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_OR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_OR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_TMP_CV_HANDLER, - ZEND_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_BW_AND_SPEC_CONST_CONST_HANDLER, - ZEND_BW_AND_SPEC_CONST_TMP_HANDLER, - ZEND_BW_AND_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CONST_CV_HANDLER, - ZEND_BW_AND_SPEC_TMP_CONST_HANDLER, - ZEND_BW_AND_SPEC_TMP_TMP_HANDLER, - ZEND_BW_AND_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_TMP_CV_HANDLER, - ZEND_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_CASE_SPEC_CONST_CONST_HANDLER, - ZEND_CASE_SPEC_CONST_TMP_HANDLER, - ZEND_CASE_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CONST_CV_HANDLER, - ZEND_CASE_SPEC_TMP_CONST_HANDLER, - ZEND_CASE_SPEC_TMP_TMP_HANDLER, - ZEND_CASE_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_TMP_CV_HANDLER, - ZEND_CASE_SPEC_VAR_CONST_HANDLER, - ZEND_CASE_SPEC_VAR_TMP_HANDLER, - ZEND_CASE_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CONST_HANDLER, - ZEND_CASE_SPEC_CV_TMP_HANDLER, - ZEND_CASE_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_DIM_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_U_NORMALIZE_SPEC_CONST_HANDLER, - ZEND_U_NORMALIZE_SPEC_CONST_HANDLER, - ZEND_U_NORMALIZE_SPEC_CONST_HANDLER, - ZEND_U_NORMALIZE_SPEC_CONST_HANDLER, - ZEND_U_NORMALIZE_SPEC_CONST_HANDLER, - ZEND_U_NORMALIZE_SPEC_TMP_HANDLER, - ZEND_U_NORMALIZE_SPEC_TMP_HANDLER, - ZEND_U_NORMALIZE_SPEC_TMP_HANDLER, - ZEND_U_NORMALIZE_SPEC_TMP_HANDLER, - ZEND_U_NORMALIZE_SPEC_TMP_HANDLER, - ZEND_U_NORMALIZE_SPEC_VAR_HANDLER, - ZEND_U_NORMALIZE_SPEC_VAR_HANDLER, - ZEND_U_NORMALIZE_SPEC_VAR_HANDLER, - ZEND_U_NORMALIZE_SPEC_VAR_HANDLER, - ZEND_U_NORMALIZE_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_U_NORMALIZE_SPEC_CV_HANDLER, - ZEND_U_NORMALIZE_SPEC_CV_HANDLER, - ZEND_U_NORMALIZE_SPEC_CV_HANDLER, - ZEND_U_NORMALIZE_SPEC_CV_HANDLER, - ZEND_U_NORMALIZE_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER - }; - zend_opcode_handlers = (opcode_handler_t*)labels; -} -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op) -{ - static const int zend_vm_decode[] = { - _UNUSED_CODE, /* 0 */ - _CONST_CODE, /* 1 = IS_CONST */ - _TMP_CODE, /* 2 = IS_TMP_VAR */ - _UNUSED_CODE, /* 3 */ - _VAR_CODE, /* 4 = IS_VAR */ - _UNUSED_CODE, /* 5 */ - _UNUSED_CODE, /* 6 */ - _UNUSED_CODE, /* 7 */ - _UNUSED_CODE, /* 8 = IS_UNUSED */ - _UNUSED_CODE, /* 9 */ - _UNUSED_CODE, /* 10 */ - _UNUSED_CODE, /* 11 */ - _UNUSED_CODE, /* 12 */ - _UNUSED_CODE, /* 13 */ - _UNUSED_CODE, /* 14 */ - _UNUSED_CODE, /* 15 */ - _CV_CODE /* 16 = IS_CV */ - }; - return zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]]; -} - -ZEND_API void zend_vm_set_opcode_handler(zend_op* op) -{ - op->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op); -} - -ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl deleted file mode 100644 index 6cfd1bbcd3057..0000000000000 --- a/Zend/zend_vm_execute.skl +++ /dev/null @@ -1,73 +0,0 @@ -{%DEFINES%} - -ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - {%HELPER_VARS%} - - {%INTERNAL_LABELS%} - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { - {%ZEND_VM_CONTINUE_LABEL%} -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - {%ZEND_VM_DISPATCH%} { - {%INTERNAL_EXECUTOR%} - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -{%EXTERNAL_EXECUTOR%} - -void {%INITIALIZER_NAME%}() -{ - {%EXTERNAL_LABELS%} -} diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php deleted file mode 100644 index c30eed096efc1..0000000000000 --- a/Zend/zend_vm_gen.php +++ /dev/null @@ -1,1272 +0,0 @@ - | - +----------------------------------------------------------------------+ -*/ - -/* \$Id$ */ - - -DATA; - -/* - This script creates zend_vm_execute.h and zend_vm_opcodes.h - from existing zend_vm_def.h and zend_vm_execute.skl -*/ - -error_reporting(E_ALL); - -define("ZEND_VM_KIND_CALL", 1); -define("ZEND_VM_KIND_SWITCH", 2); -define("ZEND_VM_KIND_GOTO", 3); - -$op_types = array( - "ANY", - "CONST", - "TMP", - "VAR", - "UNUSED", - "CV" -); - -$prefix = array( - "ANY" => "", - "TMP" => "_TMP", - "VAR" => "_VAR", - "CONST" => "_CONST", - "UNUSED" => "_UNUSED", - "CV" => "_CV", -); - -$typecode = array( - "ANY" => 0, - "TMP" => 1, - "VAR" => 2, - "CONST" => 0, - "UNUSED" => 3, - "CV" => 4, -); - -$op1_type = array( - "ANY" => "opline->op1.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op2_type = array( - "ANY" => "opline->op2.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op1_free = array( - "ANY" => "(free_op1.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op1.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_free = array( - "ANY" => "(free_op2.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op2.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op1)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op2)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_free_op = array( - "ANY" => "FREE_OP(free_op1)", - "TMP" => "zval_dtor(free_op1.var)", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op = array( - "ANY" => "FREE_OP(free_op2)", - "TMP" => "zval_dtor(free_op2.var)", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op1)", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op2)", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_var_ptr = array( - "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_var_ptr = array( - "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$list = array(); // list of opcode handlers and helpers in original order -$opcodes = array(); // opcode handlers by code -$helpers = array(); // opcode helpers by name -$params = array(); // parameters of helpers -$opnames = array(); // opcode name to code mapping -$line_no = 1; - -// Writes $s into resulting executor -function out($f, $s) { - global $line_no; - - fputs($f,$s); - $line_no += substr_count($s, "\n"); -} - -// Resets #line directives in resulting executor -function out_line($f) { - global $line_no, $executor_file; - - fputs($f,"#line ".($line_no+1)." \"".$executor_file."\"\n"); - ++$line_no; -} - -// Returns name of specialized helper -function helper_name($name, $spec, $op1, $op2) { - global $prefix, $helpers; - - if (isset($helpers[$name])) { - // If we haven't helper with specified spicialized operands then - // using unspecialized helper - if (!isset($helpers[$name]["op1"][$op1]) && - isset($helpers[$name]["op1"]["ANY"])) { - $op1 = "ANY"; - } - if (!isset($helpers[$name]["op2"][$op2]) && - isset($helpers[$name]["op2"]["ANY"])) { - $op2 = "ANY"; - } - } - return $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]; -} - -// Generates code for opcode handler or helper -function gen_code($f, $spec, $kind, $code, $op1, $op2) { - global $op1_type, $op2_type, $op1_get_zval_ptr, $op2_get_zval_ptr, - $op1_get_zval_ptr_ptr, $op2_get_zval_ptr_ptr, - $op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr, - $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, - $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, - $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, - $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; - - // Specializing - $code = preg_replace( - array( - "/OP1_TYPE/", - "/OP2_TYPE/", - "/OP1_FREE/", - "/OP2_FREE/", - "/GET_OP1_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/IS_OP1_TMP_FREE\(\)/", - "/IS_OP2_TMP_FREE\(\)/", - "/FREE_OP1\(\)/", - "/FREE_OP2\(\)/", - "/FREE_OP1_IF_VAR\(\)/", - "/FREE_OP2_IF_VAR\(\)/", - "/FREE_OP1_VAR_PTR\(\)/", - "/FREE_OP2_VAR_PTR\(\)/", - "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", - "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", - "/ZEND_VM_C_LABEL\(\s*([A-Za-z_]*)\s*\)/m", - "/ZEND_VM_C_GOTO\(\s*([A-Za-z_]*)\s*\)/m", - ), - array( - $op1_type[$op1], - $op2_type[$op2], - $op1_free[$op1], - $op2_free[$op2], - $op1_get_zval_ptr[$op1], - $op2_get_zval_ptr[$op2], - $op1_get_zval_ptr_ptr[$op1], - $op2_get_zval_ptr_ptr[$op2], - $op1_get_obj_zval_ptr[$op1], - $op2_get_obj_zval_ptr[$op2], - $op1_get_obj_zval_ptr_ptr[$op1], - $op2_get_obj_zval_ptr_ptr[$op2], - $op1_is_tmp_free[$op1], - $op2_is_tmp_free[$op2], - $op1_free_op[$op1], - $op2_free_op[$op2], - $op1_free_op_if_var[$op1], - $op2_free_op_if_var[$op2], - $op1_free_op_var_ptr[$op1], - $op2_free_op_var_ptr[$op2], - ($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n", - ($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n", - "\\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - "goto \\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - ), - $code); - - // Updating code according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*[A-Za-z_]*\s*,\s*(.*)\s*\);/me", - ), - array( - "execute_data", - "return \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)'", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(\\2, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);'", - ), - $code); - break; - case ZEND_VM_KIND_SWITCH: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - case ZEND_VM_KIND_GOTO: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - } - - /* Remove unused free_op1 and free_op2 declarations */ - if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/me', $code, $matches, PREG_SET_ORDER)) { - $n = 0; - foreach ($matches as $match) { - $code = preg_replace('/'.preg_quote($match[0],'/').'/', "\$D$n", $code); - ++$n; - } - $del_free_op1 = (strpos($code, "free_op1") === false); - $del_free_op2 = (strpos($code, "free_op2") === false); - $n = 0; - foreach ($matches as $match) { - $dcl = $match[0]; - $changed = 0; - if ($del_free_op1 && strpos($dcl, "free_op1") !== false) { - $dcl = preg_replace("/free_op1\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op1\s*;/", ";", $dcl); - $changed = 1; - } - if ($del_free_op2 && strpos($dcl, "free_op2") !== false) { - $dcl = preg_replace("/free_op2\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op2\s*;/", ";", $dcl); - $changed = 1; - } - if ($changed) { - $dcl = preg_replace("/,\s*;/", ";", $dcl); - $dcl = preg_replace("/zend_free_op\s*;/", "", $dcl); - } - $code = preg_replace("/\\\$D$n/", $dcl, $code); - ++$n; - } - } - - /* Remove unnecessary ';' */ - $code = preg_replace('/^\s*;\s*$/m', '', $code); - - out($f, $code); -} - -// Generates opcode handler -function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno) { - global $definition_file, $prefix, $typecode, $opnames; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate opcode handler's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - out($f,"static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - break; - case ZEND_VM_KIND_SWITCH: - if ($spec) { - out($f,"case ".((string)($opnames[$name]*25+($typecode[$op1]*5)+$typecode[$op2])).": /*".$name."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER*/"); - } else { - out($f,"case ".$name.":"); - } - if ($use) { - // This handler is used by other handlers. We will add label to call it. - out($f," ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL:\n"); - } else { - out($f,"\n"); - } - break; - case ZEND_VM_KIND_GOTO: - out($f,$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER:\n"); - break; - } - - // Generate opcode handler's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates helper -function gen_helper($f, $spec, $kind, $name, $op1, $op2, $param, $code, $lineno) { - global $definition_file, $prefix; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate helper's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - if ($param == null) { - // Helper without parameters - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - // Helper with parameter - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(".$param.", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - break; - case ZEND_VM_KIND_SWITCH: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - } - - // Generate helper's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates array of opcode handlers (specialized or unspecialized) -function gen_labels($f, $spec, $kind, $prolog) { - global $opcodes, $op_types, $prefix, $typecode; - - $next = 0; - if ($spec) { - // Emit labels for specialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - // Emit pointer to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - $next++; - } - $next = $num + 1; - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - if (!isset($dsc["op1"][$op1])) { - // Try to use unspecialized handler - $op1 = "ANY"; - } - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - if (!isset($dsc["op2"][$op2])) { - // Try to use unspecialized handler - $op2 = "ANY"; - } - // Check if specialized handler is defined - if (isset($dsc["op1"][$op1]) && - isset($dsc["op2"][$op2])) { - // Emit pointer to specialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)($num*25+$typecode[$op1]*5+$typecode[$op2])).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - } - } else { - // Emit pinter to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - } - } - } else { - // Emit labels for unspecialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - $next++; - } - $next = $num+1; - // Emit pointer to unspecialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)$num).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_HANDLER,\n"); - break; - } - } - } - - // Emit last handler's label (undefined opcode) - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER\n"); - break; - } -} - -// Generates handler for undefined opcodes (CALL threading model) -function gen_null_handler($f) { - static $done = 0; - - // New and all executors with CALL threading model can use the same handler - // for undefined opcodes, do we emit code for it only once - if (!$done) { - $done = 1; - out($f,"static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - out($f,"{\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - out($f,"}\n\n"); - } -} - -// Generates all opcode handlers and helpers (specialized or unspecilaized) -function gen_executor_code($f, $spec, $kind, $prolog) { - global $list, $opcodes, $helpers, $op_types; - - if ($spec) { - // Produce specialized executor - $op1t = $op_types; - // for each op1.op_type - foreach($op1t as $op1) { - $op2t = $op_types; - // for each op2.op_type - foreach($op2t as $op2) { - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($opcodes[$num]["op1"][$op1]) && - isset($opcodes[$num]["op2"][$op2])) { - // Generate handler code - gen_handler($f, 1, $kind, $opcodes[$num]["op"], $op1, $op2, isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($helpers[$num]["op1"][$op1]) && - isset($helpers[$num]["op2"][$op2])) { - // Generate helper code - gen_helper($f, 1, $kind, $num, $op1, $op2, $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - } - } else { - // Produce unspecialized executor - - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Generate handler code - gen_handler($f, 0, $kind, $opcodes[$num]["op"], "ANY", "ANY", isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Generate helper code - gen_helper($f, 0, $kind, $num, "ANY", "ANY", $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - - if (ZEND_VM_LINES) { - // Reset #line directives - out_line($f); - } - - // Generate handler for undefined opcodes - switch ($kind) { - case ZEND_VM_KIND_CALL: - gen_null_handler($f); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"default:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"ZEND_NULL_HANDLER:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - } -} - -function skip_blanks($f, $prolog, $epilog) { - if (trim($prolog) != "" || trim($epilog) != "") { - out($f, $prolog.$epilog); - } -} - -// Generates executor from skeleton file and definition (specialized or unspecialized) -function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, $old) { - global $params, $skeleton_file, $line_no; - - $lineno = 0; - foreach ($skl as $line) { - // Skeleton file contains special markers in form %NAME% those are - // substituted by custom code - if (preg_match("/(.*)[{][%]([A-Z_]*)[%][}](.*)/", $line, $m)) { - switch ($m[2]) { - case "DEFINES": - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"static int zend_vm_old_executor = 0;\n\n"); - } - out($f,"static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);\n\n"); - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(EX(opline)->handler)\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode, opline));\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - } - break; - case "EXECUTOR_NAME": - out($f, $m[1].$executor_name.$m[3]."\n"); - break; - case "HELPER_VARS": - if ($kind != ZEND_VM_KIND_CALL) { - if ($kind == ZEND_VM_KIND_SWITCH) { - out($f,$m[1]."opcode_handler_t dispatch_handler;\n"); - } - // Emit local variables those are used for helpers' parameters - foreach ($params as $param => $x) { - out($f,$m[1].$param.";\n"); - } - } else { - skip_blanks($f, $m[1], $m[3]."\n"); - } - break; - case "INTERNAL_LABELS": - if ($kind == ZEND_VM_KIND_GOTO) { - // Emit array of labels of opcode handlers and code for - // zend_opcode_handlers initialization - $prolog = $m[1]; - out($f,$prolog."if (op_array == NULL) {\n"); - out($f,$prolog."\tstatic const opcode_handler_t labels[] = {\n"); - gen_labels($f, $spec, $kind, $prolog."\t\t"); - out($f,$prolog."\t};\n"); - out($f,$prolog."\tzend_opcode_handlers = (opcode_handler_t*)labels;\n"); - out($f,$prolog."\treturn;\n"); - out($f,$prolog."}\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_CONTINUE_LABEL": - if ($kind == ZEND_VM_KIND_SWITCH) { - // Only SWITCH dispatch method use it - out($f,"zend_vm_continue:".$m[3]."\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_DISPATCH": - // Emit code that dispatches to opcode handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f, $m[1]."if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0)".$m[3]."\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f, $m[1]."dispatch_handler = EX(opline)->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)dispatch_handler)".$m[3]."\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $m[1]."goto *(void**)(EX(opline)->handler);".$m[3]."\n"); - break; - } - break; - case "INTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Executor is defined as a set of functions - out($f, $m[1]."return;".$m[3]."\n"); - } else { - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - break; - case "EXTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Unspecialized executor with CALL threading is the same as the - // old one, so we don't need to produce code twitch - if (!$old || ZEND_VM_SPEC || (ZEND_VM_KIND != ZEND_VM_KIND_CALL)) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - } - break; - case "INITIALIZER_NAME": - out($f, $m[1].$initializer_name.$m[3]."\n"); - break; - case "EXTERNAL_LABELS": - // Emit code that initializes zend_opcode_handlers array - $prolog = $m[1]; - if ($kind == ZEND_VM_KIND_GOTO) { - // Labels are defined in the executor itself, so we call it - // with op_array NULL and it sets zend_opcode_handlers array - out($f,$prolog."TSRMLS_FETCH();\n"); - out($f,$prolog."zend_execute(NULL TSRMLS_CC);\n"); - } else { - if ($old) { - // Reserving space for user-defined opcodes - out($f,$prolog."static opcode_handler_t labels[512] = {\n"); - } else { - out($f,$prolog."static const opcode_handler_t labels[] = {\n"); - } - gen_labels($f, $spec, $kind, $prolog."\t"); - out($f,$prolog."};\n"); - out($f,$prolog."zend_opcode_handlers = (opcode_handler_t*)labels;\n"); - if ($old) { - // Setup old executor - out($f,$prolog."zend_vm_old_executor = 1;\n"); - out($f,$prolog."zend_execute = old_execute;\n"); - } - } - break; - default: - die("ERROR: Unknown keyword ".$m[2]." in skeleton file.\n"); - } - } else { - // Copy the line as is - out($f, $line); - } - } -} - -function gen_vm($def, $skel) { - global $definition_file, $skeleton_file, $executor_file, - $op_types, $list, $opcodes, $helpers, $params, $opnames; - - // Load definition file - $in = @file($def); - if (!$in) { - die("ERROR: Can not open definition file '$def'\n"); - } - // We need absolute path to definition file to use it in #line directives - $definition_file = realpath($def); - - // Load skeleton file - $skl = @file($skel); - if (!$skl) { - die("ERROR: Can not open skeleton file '$skel'\n"); - } - // We need absolute path to skeleton file to use it in #line directives - $skeleton_file = realpath($skel); - - // Parse definition file into tree - $lineno = 0; - $handler = null; - $helper = null; - $max_opcode_len = 0; - $max_opcode = 0; - $export = array(); - foreach ($in as $line) { - ++$lineno; - if (strpos($line,"ZEND_VM_HANDLER(") === 0) { - // Parsing opcode handler's definition - if (preg_match( - "/^ZEND_VM_HANDLER\(\s*([0-9]+)\s*,\s*([A-Z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HANDLER definition.\n"); - } - $code = (int)$m[1]; - $op = $m[2]; - $len = strlen($op); - $op1 = array_flip(explode("|",$m[3])); - $op2 = array_flip(explode("|",$m[4])); - - if ($len > $max_opcode_len) { - $max_opcode_len = $len; - } - if ($code > $max_opcode) { - $max_opcode = $code; - } - if (isset($opcodes[$code])) { - die("ERROR ($def:$lineno): Opcode with code '$code' is already defined.\n"); - } - if (isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is already defined.\n"); - } - $opcodes[$code] = array("op"=>$op,"op1"=>$op1,"op2"=>$op2,"code"=>""); - $opnames[$op] = $code; - $handler = $code; - $helper = null; - $list[$lineno] = array("handler"=>$handler); - } else if (strpos($line,"ZEND_VM_HELPER(") === 0) { - // Parsing helper's definition - if (preg_match( - "/^ZEND_VM_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>null,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_HELPER_EX(") === 0) { - // Parsing helper with parameter definition - if (preg_match( - "/^ZEND_VM_HELPER_EX\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*,\s*(.*)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - $param = $m[4]; - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - - // Store parameter - $params[$param] = 1; - - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>$param,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_EXPORT_HANDLER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HANDLER\(\s*([A-Za-z_]+)\s*,\s*([A-Z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HANDLER definition.\n"); - } - if (!isset($opnames[$m[2]])) { - die("ERROR ($def:$lineno): opcode '{$m[2]}' is not defined.\n"); - } - $export[] = array("handler",$m[1],$m[2]); - } else if (strpos($line,"ZEND_VM_EXPORT_HELPER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Za-z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HELPER definition.\n"); - } - if (!isset($helpers[$m[2]])) { - die("ERROR ($def:$lineno): helper '{$m[2]}' is not defined.\n"); - } - $export[] = array("helper",$m[1],$m[2]); - } else if ($handler !== null) { - // Add line of code to current opcode handler - $opcodes[$handler]["code"] .= $line; - } else if ($helper !== null) { - // Add line of code to current helper - $helpers[$helper]["code"] .= $line; - } - } - - ksort($opcodes); - - // Search for opcode handlers those are used by other opcode handlers - foreach ($opcodes as $dsc) { - if (preg_match("/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", $dsc["code"], $m)) { - $op = $m[1]; - if (!isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is not defined.\n"); - } - $code = $opnames[$op]; - $opcodes[$code]['use'] = 1; - } - } - - // Generate opcode #defines (zend_vm_opcodes.h) - $code_len = strlen((string)$max_opcode); - $f = fopen("zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n"); - - // Insert header - out($f, $GLOBALS['header_text']); - - foreach ($opcodes as $code => $dsc) { - $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); - $op = str_pad($dsc["op"],$max_opcode_len); - fputs($f,"#define $op $code\n"); - } - fclose($f); - echo "zend_vm_opcodes.h generated succesfully.\n"; - - // Generate zend_vm_execute.h - $f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n"); - $executor_file = realpath("zend_vm_execute.h"); - - // Insert header - out($f, $GLOBALS['header_text']); - - // Support for ZEND_USER_OPCODE - out($f, "static opcode_handler_t zend_user_opcode_handlers[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "(opcode_handler_t)NULL,"); - } - out($f, "(opcode_handler_t)NULL};\n\n"); - - out($f, "static zend_uchar zend_user_opcodes[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "$i,"); - } - out($f, "255};\n\n"); - - // Generate specialized executor - gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers", 0); - - // Generate un-specialized executor - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"\n/* Old executor */\n\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data.element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n\n"); - out($f,"#undef ZEND_VM_RETURN\n\n"); - out($f,"#undef ZEND_VM_DISPATCH\n\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - gen_executor($f, $skl, 0, ZEND_VM_KIND_CALL, "old_execute", "zend_vm_use_old_executor", 1); - } - - // Generate zend_vm_get_opcode_handler() function - out($f, "static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n"); - out($f, "{\n"); - if (!ZEND_VM_SPEC) { - out($f, "\treturn zend_opcode_handlers[opcode];\n"); - } else { - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\tif (zend_vm_old_executor) {\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode];\n"); - out($f, "\t} else {\n"); - } - out($f, "\t\tstatic const int zend_vm_decode[] = {\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 0 */\n"); - out($f, "\t\t\t_CONST_CODE, /* 1 = IS_CONST */\n"); - out($f, "\t\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 3 */\n"); - out($f, "\t\t\t_VAR_CODE, /* 4 = IS_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 5 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 6 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 7 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 8 = IS_UNUSED */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 9 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 10 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 11 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 12 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 13 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 14 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 15 */\n"); - out($f, "\t\t\t_CV_CODE /* 16 = IS_CV */\n"); - out($f, "\t\t};\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]];\n"); - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\t}\n"); - } - } - out($f, "}\n\n"); - - // Generate zend_vm_get_opcode_handler() function - out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n"); - out($f, "{\n"); - out($f, "\top->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);\n"); - out($f, "}\n\n"); - - // Export handlers and helpers - if (count($export) > 0 && - !ZEND_VM_OLD_EXECUTOR && - ZEND_VM_KIND != ZEND_VM_KIND_CALL) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n"); - out($f,"#undef ZEND_VM_RETURN\n"); - out($f,"#undef ZEND_VM_DISPATCH\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n\n"); - } - foreach ($export as $dsk) { - list($kind, $func, $name) = $dsk; - out($f, "ZEND_API int $func("); - if ($kind == "handler") { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - $code = $opcodes[$opnames[$name]]['code']; - } else { - $h = $helpers[$name]; - if ($h['param'] == null) { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - out($f, $h['param']. ", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - $code = $h['code']; - } - $done = 0; - if (ZEND_VM_OLD_EXECUTOR) { - if ($kind == "handler") { - out($f, "{\n\treturn ".$name."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } else if ($helpers[$name]["param"] == null) { - out($f, "{\n\treturn ".$name."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if (ZEND_VM_KIND == ZEND_VM_KIND_CALL) { - if ($kind == "handler") { - $op = $opcodes[$opnames[$name]]; - if (isset($op['op1']["ANY"]) && isset($op['op2']["ANY"])) { - out($f, "{\n\treturn ".$name."_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if ($helpers[$name]["param"] == null) { - $h = $helpers[$name]; - if (isset($h['op1']["ANY"]) && isset($h['op2']["ANY"])) { - out($f, "{\n\treturn ".$name."_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } - } - if (!$done) { - gen_code($f, 0, ZEND_VM_KIND_CALL, $code, 'ANY', 'ANY'); - } - } - - fclose($f); - echo "zend_vm_execute.h generated succesfully.\n"; -} - -function usage() { - echo("\nUsage: php zend_vm_gen.php [options]\n". - "\nOptions:". - "\n --with-vm-kind=CALL|SWITCH|GOTO - select threading model (default is CALL)". - "\n --without-specializer - disable executor specialization". - "\n --with-old-executor - enable old executor". - "\n --with-lines - enable #line directives". - "\n\n"); -} - -// Parse arguments -for ($i = 1; $i < $argc; $i++) { - if (strpos($argv[$i],"--with-vm-kind=") === 0) { - $kind = substr($argv[$i], strlen("--with-vm-kind=")); - switch ($kind) { - case "CALL": - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); - break; - case "SWITCH": - define("ZEND_VM_KIND", ZEND_VM_KIND_SWITCH); - break; - case "GOTO": - define("ZEND_VM_KIND", ZEND_VM_KIND_GOTO); - break; - default: - echo("ERROR: Invalid vm kind '$kind'\n"); - usage(); - die(); - } - } else if ($argv[$i] == "--without-specializer") { - // Disabling specialization - define("ZEND_VM_SPEC", 0); - } else if ($argv[$i] == "--with-old-executor") { - // Disabling code for old-style executor - define("ZEND_VM_OLD_EXECUTOR", 1); - } else if ($argv[$i] == "--with-lines") { - // Enabling debuging using original zend_vm_def.h - define("ZEND_VM_LINES", 1); - } else if ($argv[$i] == "--help") { - usage(); - exit(); - } else { - echo("ERROR: Invalid option '".$argv[$i]."'\n"); - usage(); - die(); - } -} - -// Using defaults -if (!defined("ZEND_VM_KIND")) { - // Using CALL threading by default - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); -} -if (!defined("ZEND_VM_SPEC")) { - // Using specialized executor by default - define("ZEND_VM_SPEC", 1); -} -if (!defined("ZEND_VM_OLD_EXECUTOR")) { - // Include old-style executor by default - define("ZEND_VM_OLD_EXECUTOR", 0); -} -if (!defined("ZEND_VM_LINES")) { - // Disabling #line directives - define("ZEND_VM_LINES", 0); -} - -gen_vm("zend_vm_def.h", "zend_vm_execute.skl"); - -?> diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h deleted file mode 100644 index b10683c584dcd..0000000000000 --- a/Zend/zend_vm_opcodes.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define ZEND_NOP 0 -#define ZEND_ADD 1 -#define ZEND_SUB 2 -#define ZEND_MUL 3 -#define ZEND_DIV 4 -#define ZEND_MOD 5 -#define ZEND_SL 6 -#define ZEND_SR 7 -#define ZEND_CONCAT 8 -#define ZEND_BW_OR 9 -#define ZEND_BW_AND 10 -#define ZEND_BW_XOR 11 -#define ZEND_BW_NOT 12 -#define ZEND_BOOL_NOT 13 -#define ZEND_BOOL_XOR 14 -#define ZEND_IS_IDENTICAL 15 -#define ZEND_IS_NOT_IDENTICAL 16 -#define ZEND_IS_EQUAL 17 -#define ZEND_IS_NOT_EQUAL 18 -#define ZEND_IS_SMALLER 19 -#define ZEND_IS_SMALLER_OR_EQUAL 20 -#define ZEND_CAST 21 -#define ZEND_QM_ASSIGN 22 -#define ZEND_ASSIGN_ADD 23 -#define ZEND_ASSIGN_SUB 24 -#define ZEND_ASSIGN_MUL 25 -#define ZEND_ASSIGN_DIV 26 -#define ZEND_ASSIGN_MOD 27 -#define ZEND_ASSIGN_SL 28 -#define ZEND_ASSIGN_SR 29 -#define ZEND_ASSIGN_CONCAT 30 -#define ZEND_ASSIGN_BW_OR 31 -#define ZEND_ASSIGN_BW_AND 32 -#define ZEND_ASSIGN_BW_XOR 33 -#define ZEND_PRE_INC 34 -#define ZEND_PRE_DEC 35 -#define ZEND_POST_INC 36 -#define ZEND_POST_DEC 37 -#define ZEND_ASSIGN 38 -#define ZEND_ASSIGN_REF 39 -#define ZEND_ECHO 40 -#define ZEND_PRINT 41 -#define ZEND_JMP 42 -#define ZEND_JMPZ 43 -#define ZEND_JMPNZ 44 -#define ZEND_JMPZNZ 45 -#define ZEND_JMPZ_EX 46 -#define ZEND_JMPNZ_EX 47 -#define ZEND_CASE 48 -#define ZEND_SWITCH_FREE 49 -#define ZEND_BRK 50 -#define ZEND_CONT 51 -#define ZEND_BOOL 52 -#define ZEND_INIT_STRING 53 -#define ZEND_ADD_CHAR 54 -#define ZEND_ADD_STRING 55 -#define ZEND_ADD_VAR 56 -#define ZEND_BEGIN_SILENCE 57 -#define ZEND_END_SILENCE 58 -#define ZEND_INIT_FCALL_BY_NAME 59 -#define ZEND_DO_FCALL 60 -#define ZEND_DO_FCALL_BY_NAME 61 -#define ZEND_RETURN 62 -#define ZEND_RECV 63 -#define ZEND_RECV_INIT 64 -#define ZEND_SEND_VAL 65 -#define ZEND_SEND_VAR 66 -#define ZEND_SEND_REF 67 -#define ZEND_NEW 68 -#define ZEND_FREE 70 -#define ZEND_INIT_ARRAY 71 -#define ZEND_ADD_ARRAY_ELEMENT 72 -#define ZEND_INCLUDE_OR_EVAL 73 -#define ZEND_UNSET_VAR 74 -#define ZEND_UNSET_DIM 75 -#define ZEND_UNSET_OBJ 76 -#define ZEND_FE_RESET 77 -#define ZEND_FE_FETCH 78 -#define ZEND_EXIT 79 -#define ZEND_FETCH_R 80 -#define ZEND_FETCH_DIM_R 81 -#define ZEND_FETCH_OBJ_R 82 -#define ZEND_FETCH_W 83 -#define ZEND_FETCH_DIM_W 84 -#define ZEND_FETCH_OBJ_W 85 -#define ZEND_FETCH_RW 86 -#define ZEND_FETCH_DIM_RW 87 -#define ZEND_FETCH_OBJ_RW 88 -#define ZEND_FETCH_IS 89 -#define ZEND_FETCH_DIM_IS 90 -#define ZEND_FETCH_OBJ_IS 91 -#define ZEND_FETCH_FUNC_ARG 92 -#define ZEND_FETCH_DIM_FUNC_ARG 93 -#define ZEND_FETCH_OBJ_FUNC_ARG 94 -#define ZEND_FETCH_UNSET 95 -#define ZEND_FETCH_DIM_UNSET 96 -#define ZEND_FETCH_OBJ_UNSET 97 -#define ZEND_FETCH_DIM_TMP_VAR 98 -#define ZEND_FETCH_CONSTANT 99 -#define ZEND_EXT_STMT 101 -#define ZEND_EXT_FCALL_BEGIN 102 -#define ZEND_EXT_FCALL_END 103 -#define ZEND_EXT_NOP 104 -#define ZEND_TICKS 105 -#define ZEND_SEND_VAR_NO_REF 106 -#define ZEND_CATCH 107 -#define ZEND_THROW 108 -#define ZEND_FETCH_CLASS 109 -#define ZEND_CLONE 110 -#define ZEND_INIT_METHOD_CALL 112 -#define ZEND_INIT_STATIC_METHOD_CALL 113 -#define ZEND_ISSET_ISEMPTY_VAR 114 -#define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 -#define ZEND_PRE_INC_OBJ 132 -#define ZEND_PRE_DEC_OBJ 133 -#define ZEND_POST_INC_OBJ 134 -#define ZEND_POST_DEC_OBJ 135 -#define ZEND_ASSIGN_OBJ 136 -#define ZEND_INSTANCEOF 138 -#define ZEND_DECLARE_CLASS 139 -#define ZEND_DECLARE_INHERITED_CLASS 140 -#define ZEND_DECLARE_FUNCTION 141 -#define ZEND_RAISE_ABSTRACT_ERROR 142 -#define ZEND_ADD_INTERFACE 144 -#define ZEND_VERIFY_ABSTRACT_CLASS 146 -#define ZEND_ASSIGN_DIM 147 -#define ZEND_ISSET_ISEMPTY_PROP_OBJ 148 -#define ZEND_HANDLE_EXCEPTION 149 -#define ZEND_USER_OPCODE 150 -#define ZEND_U_NORMALIZE 151 diff --git a/acconfig.h.in b/acconfig.h.in deleted file mode 100644 index f87979c2fdb02..0000000000000 --- a/acconfig.h.in +++ /dev/null @@ -1 +0,0 @@ -/* Leave this file alone */ diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index f3ee7639779b4..0000000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,2519 +0,0 @@ -dnl -dnl $Id$ -dnl -dnl This file contains local autoconf functions. -dnl - -dnl ------------------------------------------------------------------------- -dnl Output stylize macros for configure (help/runtime) -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_HELP_SEPARATOR(title) -dnl -dnl Adds separator title into the configure --help display. -dnl -AC_DEFUN([PHP_HELP_SEPARATOR],[ -AC_ARG_ENABLE([],[ -$1 -],[]) -]) - -dnl -dnl PHP_CONFIGURE_PART(title) -dnl -dnl Adds separator title configure output (idea borrowed from mm) -dnl -AC_DEFUN([PHP_CONFIGURE_PART],[ - AC_MSG_RESULT() - AC_MSG_RESULT([${T_MD}$1${T_ME}]) -]) - -dnl ------------------------------------------------------------------------- -dnl Build system helper macros -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_DEF_HAVE(what) -dnl -dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [ ])' -dnl -AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___), 1, [ ])]) - -dnl -dnl PHP_RUN_ONCE(namespace, variable, code) -dnl -dnl execute code, if variable is not set in namespace -dnl -AC_DEFUN([PHP_RUN_ONCE],[ - changequote({,}) - unique=`echo $2|$SED 's/[^a-zA-Z0-9]/_/g'` - changequote([,]) - cmd="echo $ac_n \"\$$1$unique$ac_c\"" - if test -n "$unique" && test "`eval $cmd`" = "" ; then - eval "$1$unique=set" - $3 - fi -]) - -dnl -dnl PHP_EXPAND_PATH(path, variable) -dnl -dnl expands path to an absolute path and assigns it to variable -dnl -AC_DEFUN([PHP_EXPAND_PATH],[ - if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then - $2=$1 - else - changequote({,}) - ep_dir="`echo $1|$SED 's%/*[^/][^/]*/*$%%'`" - changequote([,]) - ep_realdir="`(cd \"$ep_dir\" && pwd)`" - $2="$ep_realdir/`basename \"$1\"`" - fi -]) - -dnl -dnl PHP_DEFINE(WHAT [, value[, directory]]) -dnl -dnl Creates builddir/include/what.h and in there #define WHAT value -dnl -AC_DEFUN([PHP_DEFINE],[ - [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h] -]) - -dnl -dnl PHP_SUBST(varname) -dnl -dnl Adds variable with it's value into Makefile, e.g.: -dnl CC = gcc -dnl -AC_DEFUN([PHP_SUBST],[ - PHP_VAR_SUBST="$PHP_VAR_SUBST $1" -]) - -dnl -dnl PHP_SUBST_OLD(varname) -dnl -dnl Same as PHP_SUBST() but also substitutes all @VARNAME@ -dnl instances in every file passed to AC_OUTPUT() -dnl -AC_DEFUN([PHP_SUBST_OLD],[ - PHP_SUBST($1) - AC_SUBST($1) -]) - -dnl -dnl PHP_OUTPUT(file) -dnl -dnl Adds "file" to the list of files generated by AC_OUTPUT -dnl This macro can be used several times. -dnl -AC_DEFUN([PHP_OUTPUT],[ - PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" -]) - - -dnl ------------------------------------------------------------------------- -dnl Build system base macros -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_CANONICAL_HOST_TARGET -dnl -AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[ - AC_REQUIRE([AC_CANONICAL_HOST])dnl - AC_REQUIRE([AC_CANONICAL_TARGET])dnl - dnl Make sure we do not continue if host_alias is empty. - if test -z "$host_alias" && test -n "$host"; then - host_alias=$host - fi - if test -z "$host_alias"; then - AC_MSG_ERROR([host_alias is not set!]) - fi -]) - -dnl -dnl PHP_INIT_BUILD_SYSTEM -dnl -AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ -AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl -test -d include || $php_shtool mkdir include -> Makefile.objects -> Makefile.fragments -dnl We need to play tricks here to avoid matching the grep line itself -pattern=define -$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null -]) - -dnl -dnl PHP_GEN_GLOBAL_MAKEFILE -dnl -dnl Generates the global makefile. -dnl -AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[ - cat >Makefile <> Makefile - done - - cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile -]) - -dnl -dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile [, ext_srcdir [, ext_builddir]]]) -dnl -dnl Processes a file called Makefile.frag in the source directory -dnl of the most recently added extension. $(srcdir) and $(builddir) -dnl are substituted with the proper paths. Can be used to supply -dnl custom rules and/or additional targets. -dnl -AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[ - ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) - ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) - ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) - $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments -]) - -dnl -dnl PHP_ADD_SOURCES(source-path, sources [, special-flags [, type]]) -dnl -dnl Adds sources which are located relative to source-path to the -dnl array of type type. Sources are processed with optional -dnl special-flags which are passed to the compiler. Sources -dnl can be either written in C or C++ (filenames shall end in .c -dnl or .cpp, respectively). -dnl -dnl Note: If source-path begins with a "/", the "/" is removed and -dnl the path is interpreted relative to the top build-directory. -dnl -dnl which array to append to? -AC_DEFUN([PHP_ADD_SOURCES],[ - PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) -]) - -dnl -dnl _PHP_ASSIGN_BUILD_VARS(type) -dnl internal, don't use -AC_DEFUN([_PHP_ASSIGN_BUILD_VARS],[ -ifelse($1,shared,[ - b_c_pre=$shared_c_pre - b_cxx_pre=$shared_cxx_pre - b_c_meta=$shared_c_meta - b_cxx_meta=$shared_cxx_meta - b_c_post=$shared_c_post - b_cxx_post=$shared_cxx_post -],[ - b_c_pre=$php_c_pre - b_cxx_pre=$php_cxx_pre - b_c_meta=$php_c_meta - b_cxx_meta=$php_cxx_meta - b_c_post=$php_c_post - b_cxx_post=$php_cxx_post -])dnl - b_lo=[$]$1_lo -]) - -dnl -dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]]) -dnl -dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the -dnl name of the array target-var directly, as well as whether -dnl shared objects will be built from the sources. -dnl -dnl Should not be used directly. -dnl -AC_DEFUN([PHP_ADD_SOURCES_X],[ -dnl relative to source- or build-directory? -dnl ac_srcdir/ac_bdir include trailing slash - case $1 in - ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; - /*[)] ac_srcdir=`echo "$1"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; - *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; - esac - -dnl how to build .. shared or static? - ifelse($5,yes,_PHP_ASSIGN_BUILD_VARS(shared),_PHP_ASSIGN_BUILD_VARS(php)) - -dnl iterate over the sources - old_IFS=[$]IFS - for ac_src in $2; do - -dnl remove the suffix - IFS=. - set $ac_src - ac_obj=[$]1 - IFS=$old_IFS - -dnl append to the array which has been dynamically chosen at m4 time - $4="[$]$4 [$]ac_bdir[$]ac_obj.lo" - -dnl choose the right compiler/flags/etc. for the source-file - case $ac_src in - *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;; - esac - -dnl create a rule for the object/source combo - cat >>Makefile.objects< conftest.c - cmd='$CC $1 -c conftest.c' - if eval $cmd 2>&1 | $EGREP -e $1 >/dev/null ; then - ac_result=no - else - ac_result=yes - fi - eval $gcc_arg_name=$ac_result - rm -f conftest.* - ]) - if eval test "\$$gcc_arg_name" = "yes"; then - $2 - else - : - $3 - fi -]) - -dnl -dnl PHP_LIBGCC_LIBPATH(gcc) -dnl -dnl Stores the location of libgcc in libgcc_libpath -dnl -AC_DEFUN([PHP_LIBGCC_LIBPATH],[ - changequote({,}) - libgcc_libpath=`$1 --print-libgcc-file-name|$SED 's%/*[^/][^/]*$%%'` - changequote([,]) -]) - -dnl ------------------------------------------------------------------------- -dnl Macros to modify LIBS, INCLUDES, etc. variables -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_REMOVE_USR_LIB(NAME) -dnl -dnl Removes all -L/usr/$PHP_LIBDIR entries from variable NAME -dnl -AC_DEFUN([PHP_REMOVE_USR_LIB],[ - unset ac_new_flags - for i in [$]$1; do - case [$]i in - -L/usr/$PHP_LIBDIR|-L/usr/$PHP_LIBDIR/[)] ;; - *[)] ac_new_flags="[$]ac_new_flags [$]i" ;; - esac - done - $1=[$]ac_new_flags -]) - -dnl -dnl PHP_EVAL_LIBLINE(libline, SHARED-LIBADD) -dnl -dnl Use this macro, if you need to add libraries and or library search -dnl paths to the PHP build system which are only given in compiler -dnl notation. -dnl -AC_DEFUN([PHP_EVAL_LIBLINE],[ - for ac_i in $1; do - case $ac_i in - -pthread[)] - if test "$ext_shared" = "yes"; then - $2="[$]$2 -pthread" - else - PHP_RUN_ONCE(EXTRA_LDFLAGS, [$ac_i], [EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"]) - fi - ;; - -l*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBRARY($ac_ii,1,$2) - ;; - -L*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBPATH($ac_ii,$2) - ;; - esac - done -]) - -dnl -dnl PHP_EVAL_INCLINE(headerline) -dnl -dnl Use this macro, if you need to add header search paths to the PHP -dnl build system which are only given in compiler notation. -dnl -AC_DEFUN([PHP_EVAL_INCLINE],[ - for ac_i in $1; do - case $ac_i in - -I*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_INCLUDE($ac_ii) - ;; - esac - done -]) - -dnl internal, don't use -AC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[ - PHP_RUN_ONCE(LIBPATH, $1, [ - test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$1" - LDFLAGS="$LDFLAGS -L$1" - PHP_RPATHS="$PHP_RPATHS $1" - ]) -])dnl -dnl -dnl -dnl PHP_ADD_LIBPATH(path [, SHARED-LIBADD]) -dnl -dnl Adds a path to linkpath/runpath (LDFLAGS) -dnl -AC_DEFUN([PHP_ADD_LIBPATH],[ - if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then - PHP_EXPAND_PATH($1, ai_p) - ifelse([$2],,[ - _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) - ],[ - if test "$ext_shared" = "yes"; then - $2="$ld_runpath_switch$ai_p -L$ai_p [$]$2" - else - _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) - fi - ]) - fi -]) - -dnl -dnl PHP_UTILIZE_RPATHS() -dnl -dnl builds RPATHS/LDFLAGS from PHP_RPATHS -dnl -AC_DEFUN([PHP_UTILIZE_RPATHS],[ - OLD_RPATHS=$PHP_RPATHS - unset PHP_RPATHS - - for i in $OLD_RPATHS; do -dnl Can be passed to native cc/libtool - PHP_LDFLAGS="$PHP_LDFLAGS -L$i" -dnl Libtool-specific - PHP_RPATHS="$PHP_RPATHS -R $i" -dnl cc-specific - NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" - done - - if test "$PHP_RPATH" = "no"; then - unset PHP_RPATHS - unset NATIVE_RPATHS - fi -]) - -dnl -dnl PHP_ADD_INCLUDE(path [,before]) -dnl -dnl add an include path. -dnl if before is 1, add in the beginning of INCLUDES. -dnl -AC_DEFUN([PHP_ADD_INCLUDE],[ - if test "$1" != "/usr/include"; then - PHP_EXPAND_PATH($1, ai_p) - PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [ - if test "$2"; then - INCLUDES="-I$ai_p $INCLUDES" - else - INCLUDES="$INCLUDES -I$ai_p" - fi - ]) - fi -]) - -dnl internal, don't use -AC_DEFUN([_PHP_X_ADD_LIBRARY],[dnl - ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl -])dnl -dnl -dnl internal, don't use -AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[ - case $1 in - c|c_r|pthread*[)] ;; - *[)] ifelse($3,,[ - _PHP_X_ADD_LIBRARY($1,$2,$5) - ],[ - if test "$ext_shared" = "yes"; then - _PHP_X_ADD_LIBRARY($1,$2,$3) - else - $4($1,$2) - fi - ]) ;; - esac -])dnl -dnl -dnl -dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) -dnl -dnl add a library to the link line -dnl -AC_DEFUN([PHP_ADD_LIBRARY],[ - _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS]) -]) - -dnl -dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) -dnl -dnl add a library to the link line (deferred, not used during configure) -dnl -AC_DEFUN([PHP_ADD_LIBRARY_DEFER],[ - _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS]) -]) - -dnl -dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd]) -dnl -dnl add a library to the link line and path to linkpath/runpath. -dnl if shared-libadd is not empty and $ext_shared is yes, -dnl shared-libadd will be assigned the library information -dnl -AC_DEFUN([PHP_ADD_LIBRARY_WITH_PATH],[ -ifelse($3,,[ - if test -n "$2"; then - PHP_ADD_LIBPATH($2) - fi - PHP_ADD_LIBRARY($1) -],[ - if test "$ext_shared" = "yes"; then - $3="-l$1 [$]$3" - if test -n "$2"; then - PHP_ADD_LIBPATH($2,$3) - fi - else - PHP_ADD_LIBRARY_WITH_PATH($1,$2) - fi -]) -]) - -dnl -dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path[, shared-libadd]) -dnl -dnl add a library to the link line (deferred) -dnl and path to linkpath/runpath (not deferred) -dnl if shared-libadd is not empty and $ext_shared is yes, -dnl shared-libadd will be assigned the library information -dnl -AC_DEFUN([PHP_ADD_LIBRARY_DEFER_WITH_PATH],[ -ifelse($3,,[ - if test -n "$2"; then - PHP_ADD_LIBPATH($2) - fi - PHP_ADD_LIBRARY_DEFER($1) -],[ - if test "$ext_shared" = "yes"; then - $3="-l$1 [$]$3" - if test -n "$2"; then - PHP_ADD_LIBPATH($2,$3) - fi - else - PHP_ADD_LIBRARY_DEFER_WITH_PATH($1,$2) - fi -]) -]) - -dnl -dnl PHP_ADD_FRAMEWORK(framework [,before]) -dnl -dnl add a (Darwin / Mac OS X) framework to the link -dnl line. if before is 1, the framework is added -dnl to the beginning of the line. -dnl -AC_DEFUN([PHP_ADD_FRAMEWORK], [ - PHP_RUN_ONCE(FRAMEWORKS, $1, [ - if test "$2"; then - PHP_FRAMEWORKS="-framework $1 $PHP_FRAMEWORKS" - else - PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework $1" - fi - ]) -]) - -dnl -dnl PHP_ADD_FRAMEWORKPATH(path [,before]) -dnl -dnl add a (Darwin / Mac OS X) framework path to the link -dnl and include lines. default paths include (but are -dnl not limited to) /Local/Library/Frameworks and -dnl /System/Library/Frameworks, so these don't need -dnl to be specifically added. if before is 1, the -dnl framework path is added to the beginning of the -dnl relevant lines. -dnl -AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [ - PHP_EXPAND_PATH($1, ai_p) - PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [ - if test "$2"; then - PHP_FRAMEWORKPATH="-F$ai_p $PHP_FRAMEWORKPATH" - else - PHP_FRAMEWORKPATH="$PHP_FRAMEWORKPATH -F$ai_p" - fi - ]) -]) - -dnl -dnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path) -dnl -dnl Adds a (Darwin / Mac OS X) framework path and the -dnl framework itself to the link and include lines. -dnl -AC_DEFUN([PHP_ADD_FRAMEWORK_WITH_PATH], [ - PHP_ADD_FRAMEWORKPATH($2) - PHP_ADD_FRAMEWORK($1) -]) - -dnl -dnl PHP_SET_LIBTOOL_VARIABLE(var) -dnl -dnl Set libtool variable -dnl -AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[ - if test -z "$LIBTOOL"; then - LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' - else - LIBTOOL="$LIBTOOL $1" - fi -]) - -dnl ------------------------------------------------------------------------- -dnl Wrapper macros for AC_ARG_WITH / AC_ARG_ENABLE -dnl ------------------------------------------------------------------------- - -dnl PHP_ARG_ANALYZE_EX -dnl internal -AC_DEFUN([PHP_ARG_ANALYZE_EX],[ -ext_output="yes, shared" -ext_shared=yes -case [$]$1 in -shared,*[)] - $1=`echo "[$]$1"|$SED 's/^shared,//'` - ;; -shared[)] - $1=yes - ;; -no[)] - ext_output=no - ext_shared=no - ;; -*[)] - ext_output=yes - ext_shared=no - ;; -esac - -PHP_ALWAYS_SHARED([$1]) -]) - -dnl PHP_ARG_ANALYZE -dnl internal -AC_DEFUN([PHP_ARG_ANALYZE],[ -ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)]) -ifelse([$2],,,[AC_MSG_RESULT([$ext_output])]) -]) - -dnl -dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val[, extension-or-not]]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run -dnl the PHP_ARG_ANALYZE_EX. -dnl -AC_DEFUN([PHP_ARG_WITH],[ -PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)]) -]) - -dnl PHP_REAL_ARG_WITH -dnl internal -AC_DEFUN([PHP_REAL_ARG_WITH],[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_WITH($1,[$3],$5=[$]withval, -[ - $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi -]) -PHP_ARG_ANALYZE($5,[$2],$6) -]) - -dnl -dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val[, extension-or-not]]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run -dnl the PHP_ARG_ANALYZE_EX. -dnl -AC_DEFUN([PHP_ARG_ENABLE],[ -PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_),[ifelse($5,,yes,$5)]) -]) - -dnl PHP_REAL_ARG_ENABLE -dnl internal -AC_DEFUN([PHP_REAL_ARG_ENABLE],[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_ENABLE($1,[$3],$5=[$]enableval, -[ - $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi -]) -PHP_ARG_ANALYZE($5,[$2],$6) -]) - -dnl ------------------------------------------------------------------------- -dnl Build macros -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_SET_SYM_FILE(path) -dnl -dnl set the path of the file which contains the symbol export list -dnl -AC_DEFUN([PHP_SET_SYM_FILE], -[ - PHP_SYM_FILE=$1 -]) - -dnl -dnl PHP_BUILD_THREAD_SAFE -dnl -AC_DEFUN([PHP_BUILD_THREAD_SAFE],[ - enable_maintainer_zts=yes - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) - fi -]) - -dnl -dnl PHP_REQUIRE_CXX -dnl -AC_DEFUN([PHP_REQUIRE_CXX],[ - if test -z "$php_cxx_done"; then - AC_PROG_CXX - AC_PROG_CXXCPP - php_cxx_done=yes - fi -]) - -dnl -dnl PHP_BUILD_SHARED -dnl -AC_DEFUN([PHP_BUILD_SHARED],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp5.la - php_build_target=shared - - php_c_pre=$shared_c_pre - php_c_meta=$shared_c_meta - php_c_post=$shared_c_post - php_cxx_pre=$shared_cxx_pre - php_cxx_meta=$shared_cxx_meta - php_cxx_post=$shared_cxx_post - php_lo=$shared_lo -]) - -dnl -dnl PHP_BUILD_STATIC -dnl -AC_DEFUN([PHP_BUILD_STATIC],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp5.la - php_build_target=static -]) - -dnl -dnl PHP_BUILD_BUNDLE -dnl -AC_DEFUN([PHP_BUILD_BUNDLE],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libs/libphp5.bundle - php_build_target=static -]) - -dnl -dnl PHP_BUILD_PROGRAM -dnl -AC_DEFUN([PHP_BUILD_PROGRAM],[ - OVERALL_TARGET=[]ifelse($1,,php,$1) - php_c_pre='$(LIBTOOL) --mode=compile $(CC)' - php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' - php_c_post= - php_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' - php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' - php_cxx_post= - php_lo=lo - - case $with_pic in - yes) pic_setting='-prefer-pic';; - no) pic_setting='-prefer-non-pic';; - esac - - shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' - shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting - shared_c_post= - shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' - shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting - shared_cxx_post= - shared_lo=lo - - php_build_target=program -]) - -dnl -dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx) -dnl -dnl Basically sets up the link-stage for building module-name -dnl from object_var in build-dir. -dnl -AC_DEFUN([PHP_SHARED_MODULE],[ - install_modules="install-modules" - - case $host_alias in - *aix*[)] - suffix=so - link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so' - ;; - *netware*[)] - suffix=nlm - link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)' - ;; - *[)] - suffix=la - link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)' - ;; - esac - - PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix" - PHP_SUBST($2) - cat >>Makefile.objects<>)dnl -<>dnl -changequote([,]), [#include -#if STDC_HEADERS -#include -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl -AC_MSG_RESULT([$ac_cv_type_in_addr_t]) -if test $ac_cv_type_in_addr_t = no; then - AC_DEFINE(in_addr_t, u_int, [ ]) -fi -]) - -dnl -dnl PHP_TIME_R_TYPE -dnl -dnl Check type of reentrant time-related functions -dnl Type can be: irix, hpux or POSIX -dnl -AC_DEFUN([PHP_TIME_R_TYPE],[ -AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ -AC_TRY_RUN([ -#include - -main() { -char buf[27]; -struct tm t; -time_t old = 0; -int r, s; - -s = gmtime_r(&old, &t); -r = (int) asctime_r(&t, buf, 26); -if (r == s && s == 0) return (0); -return (1); -} -],[ - ac_cv_time_r_type=hpux -],[ - AC_TRY_RUN([ -#include -main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; - - s = gmtime_r(&old, &t); - p = asctime_r(&t, buf, 26); - if (p == buf && s == &t) return (0); - return (1); -} - ],[ - ac_cv_time_r_type=irix - ],[ - ac_cv_time_r_type=POSIX - ],[ - ac_cv_time_r_type=POSIX - ]) -],[ - ac_cv_time_r_type=POSIX -]) -]) - case $ac_cv_time_r_type in - hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; - irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; - esac -]) - -dnl -dnl PHP_DOES_PWRITE_WORK -dnl internal -AC_DEFUN([PHP_DOES_PWRITE_WORK],[ - AC_TRY_RUN([ -#include -#include -#include -#include -#include -$1 - main() { - int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); - - if (fd < 0) exit(1); - if (pwrite(fd, "text", 4, 0) != 4) exit(1); - /* Linux glibc breakage until 2.2.5 */ - if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); - exit(0); - } - - ],[ - ac_cv_pwrite=yes - ],[ - ac_cv_pwrite=no - ],[ - ac_cv_pwrite=no - ]) -]) - -dnl PHP_DOES_PREAD_WORK -dnl internal -AC_DEFUN([PHP_DOES_PREAD_WORK],[ - echo test > conftest_in - AC_TRY_RUN([ -#include -#include -#include -#include -#include -$1 - main() { - char buf[3]; - int fd = open("conftest_in", O_RDONLY); - if (fd < 0) exit(1); - if (pread(fd, buf, 2, 0) != 2) exit(1); - /* Linux glibc breakage until 2.2.5 */ - if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); - exit(0); - } - ],[ - ac_cv_pread=yes - ],[ - ac_cv_pread=no - ],[ - ac_cv_pread=no - ]) - rm -f conftest_in -]) - -dnl -dnl PHP_PWRITE_TEST -dnl -AC_DEFUN([PHP_PWRITE_TEST],[ - AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[ - PHP_DOES_PWRITE_WORK - if test "$ac_cv_pwrite" = "no"; then - PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);]) - if test "$ac_cv_pwrite" = "yes"; then - ac_cv_pwrite=64 - fi - fi - ]) - - if test "$ac_cv_pwrite" != "no"; then - AC_DEFINE(HAVE_PWRITE, 1, [ ]) - if test "$ac_cv_pwrite" = "64"; then - AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]) - fi - fi -]) - -dnl -dnl PHP_PREAD_TEST -dnl -AC_DEFUN([PHP_PREAD_TEST],[ - AC_CACHE_CHECK(whether pread works,ac_cv_pread,[ - PHP_DOES_PREAD_WORK - if test "$ac_cv_pread" = "no"; then - PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);]) - if test "$ac_cv_pread" = "yes"; then - ac_cv_pread=64 - fi - fi - ]) - - if test "$ac_cv_pread" != "no"; then - AC_DEFINE(HAVE_PREAD, 1, [ ]) - if test "$ac_cv_pread" = "64"; then - AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]) - fi - fi -]) - -dnl -dnl PHP_MISSING_TIME_R_DECL -dnl -AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ - AC_MSG_CHECKING([for missing declarations of reentrant functions]) - AC_TRY_COMPILE([#include ],[struct tm *(*func)() = localtime_r],[ - : - ],[ - AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[struct tm *(*func)() = gmtime_r],[ - : - ],[ - AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = asctime_r],[ - : - ],[ - AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = ctime_r],[ - : - ],[ - AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = strtok_r],[ - : - ],[ - AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) - ]) - AC_MSG_RESULT([done]) -]) - -dnl -dnl PHP_READDIR_R_TYPE -dnl -AC_DEFUN([PHP_READDIR_R_TYPE],[ - dnl HAVE_READDIR_R is also defined by libmysql - AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) - if test "$ac_cv_func_readdir_r" = "yes"; then - AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ - AC_TRY_RUN([ -#define _REENTRANT -#include -#include - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; - - dir = opendir("/"); - if (!dir) - exit(1); - if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) - exit(0); - exit(1); -} - ],[ - ac_cv_what_readdir_r=POSIX - ],[ - AC_TRY_CPP([ -#define _REENTRANT -#include -#include -int readdir_r(DIR *, struct dirent *); - ],[ - ac_cv_what_readdir_r=old-style - ],[ - ac_cv_what_readdir_r=none - ]) - ],[ - ac_cv_what_readdir_r=none - ]) - ]) - case $ac_cv_what_readdir_r in - POSIX) - AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; - old-style) - AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; - esac - fi -]) - -dnl -dnl PHP_TM_GMTOFF -dnl -AC_DEFUN([PHP_TM_GMTOFF],[ -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include -#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], - ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) - -if test "$ac_cv_struct_tm_gmtoff" = yes; then - AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) -fi -]) - -dnl -dnl PHP_STRUCT_FLOCK -dnl -AC_DEFUN([PHP_STRUCT_FLOCK],[ -AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, - AC_TRY_COMPILE([ -#include -#include - ], - [struct flock x;], - [ - ac_cv_struct_flock=yes - ],[ - ac_cv_struct_flock=no - ]) -) -if test "$ac_cv_struct_flock" = "yes" ; then - AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) -fi -]) - -dnl -dnl PHP_SOCKLEN_T -dnl -AC_DEFUN([PHP_SOCKLEN_T],[ -AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, - AC_TRY_COMPILE([ -#include -#include -],[ -socklen_t x; -],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -])) -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - -dnl -dnl PHP_MISSING_FCLOSE_DECL -dnl -dnl See if we have broken header files like SunOS has. -dnl -AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ - AC_MSG_CHECKING([for fclose declaration]) - AC_TRY_COMPILE([#include ],[int (*func)() = fclose],[ - AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) - AC_MSG_RESULT([ok]) - ],[ - AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) - AC_MSG_RESULT([missing]) - ]) -]) - -dnl -dnl PHP_AC_BROKEN_SPRINTF -dnl -dnl Check for broken sprintf(), C99 conformance -dnl -AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ - AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes - ],[ - ac_cv_broken_sprintf=no - ]) - ]) - if test "$ac_cv_broken_sprintf" = "yes"; then - AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) - else - AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) - fi -]) - -dnl -dnl PHP_AC_BROKEN_SNPRINTF -dnl -dnl Check for broken snprintf(), C99 conformance -dnl -AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_TRY_RUN([ -#define NULL (0L) -main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); - res = res || (buf[1] != '\0'); - /* Implementations may consider this as an encoding error */ - snprintf(buf, 0, "boerger"); - /* However, they MUST ignore the pointer */ - res = res || (buf[0] != 'm'); - res = res || (snprintf(NULL, 0, "boerger") != 7); - res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); - exit(res); -} - ],[ - ac_cv_broken_snprintf=no - ],[ - ac_cv_broken_snprintf=yes - ],[ - ac_cv_broken_snprintf=no - ]) - ]) - if test "$ac_cv_broken_snprintf" = "yes"; then - AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) - else - AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) - fi -]) - -dnl -dnl PHP_SOLARIS_PIC_WEIRDNESS -dnl -dnl Solaris requires main code to be position independent in order -dnl to let shared objects find symbols. Weird. Ugly. -dnl -dnl Must be run after all --with-NN options that let the user -dnl choose dynamic extensions, and after the gcc test. -dnl -AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[ - AC_MSG_CHECKING([whether -fPIC is required]) - if test -n "$EXT_SHARED"; then - os=`uname -sr 2>/dev/null` - case $os in - "SunOS 5.6"|"SunOS 5.7"[)] - case $CC in - gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; - *[)] CFLAGS="$CFLAGS -fpic";; - esac - AC_MSG_RESULT([yes]);; - *[)] - AC_MSG_RESULT([no]);; - esac - else - AC_MSG_RESULT([no]) - fi -]) - -dnl -dnl PHP_SYS_LFS -dnl -dnl The problem is that the default compilation flags in Solaris 2.6 won't -dnl let programs access large files; you need to tell the compiler that -dnl you actually want your programs to work on large files. For more -dnl details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html -dnl -dnl Written by Paul Eggert . -dnl -AC_DEFUN([PHP_SYS_LFS], -[dnl - # If available, prefer support for large files unless the user specified - # one of the CPPFLAGS, LDFLAGS, or LIBS variables. - AC_MSG_CHECKING([whether large file support needs explicit enabling]) - ac_getconfs='' - ac_result=yes - ac_set='' - ac_shellvars='CPPFLAGS LDFLAGS LIBS' - for ac_shellvar in $ac_shellvars; do - case $ac_shellvar in - CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;; - *[)] ac_lfsvar=LFS_$ac_shellvar ;; - esac - eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar - (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } - ac_getconf=`getconf $ac_lfsvar` - ac_getconfs=$ac_getconfs$ac_getconf - eval ac_test_$ac_shellvar=\$ac_getconf - done - case "$ac_result$ac_getconfs" in - yes[)] ac_result=no ;; - esac - case "$ac_result$ac_set" in - yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings" - esac - AC_MSG_RESULT([$ac_result]) - case $ac_result in - yes[)] - for ac_shellvar in $ac_shellvars; do - eval $ac_shellvar=\$ac_test_$ac_shellvar - done ;; - esac -]) - -dnl -dnl PHP_SOCKADDR_CHECKS -dnl -AC_DEFUN([PHP_SOCKADDR_CHECKS], [ - dnl Check for struct sockaddr_storage exists - AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage, - [AC_TRY_COMPILE([#include -#include ], - [struct sockaddr_storage s; s], - [ac_cv_sockaddr_storage=yes], [ac_cv_sockaddr_storage=no]) - ]) - if test "$ac_cv_sockaddr_storage" = "yes"; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [Whether you have struct sockaddr_storage]) - fi - dnl Check if field sa_len exists in struct sockaddr - AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ - AC_TRY_COMPILE([#include -#include ], - [static struct sockaddr sa; int n = (int) sa.sa_len; return n;], - [ac_cv_sockaddr_sa_len=yes], [ac_cv_sockaddr_sa_len=no]) - ]) - if test "$ac_cv_sockaddr_sa_len" = "yes"; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has field sa_len]) - fi -]) - -dnl -dnl PHP_DECLARED_TIMEZONE -dnl -AC_DEFUN([PHP_DECLARED_TIMEZONE],[ - AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ - AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -],[ - time_t foo = (time_t) timezone; -],[ - ac_cv_declared_timezone=yes -],[ - ac_cv_declared_timezone=no -])]) - if test "$ac_cv_declared_timezone" = "yes"; then - AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) - fi -]) - -dnl -dnl PHP_EBCDIC -dnl -AC_DEFUN([PHP_EBCDIC], [ - AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ - AC_TRY_RUN( [ -int main(void) { - return (unsigned char)'A' != (unsigned char)0xC1; -} -],[ - ac_cv_ebcdic=yes -],[ - ac_cv_ebcdic=no -],[ - ac_cv_ebcdic=no -])]) - if test "$ac_cv_ebcdic" = "yes"; then - AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) - fi -]) - -dnl -dnl PHP_BROKEN_GETCWD -dnl -dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a -dnl component of the path has execute but not read permissions -dnl -AC_DEFUN([PHP_BROKEN_GETCWD],[ - AC_MSG_CHECKING([for broken getcwd]) - os=`uname -sr 2>/dev/null` - case $os in - SunOS*[)] - AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd]) - AC_MSG_RESULT([yes]);; - *[)] - AC_MSG_RESULT([no]);; - esac -]) - -dnl -dnl PHP_BROKEN_GLIBC_FOPEN_APPEND -dnl -AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [ - AC_MSG_CHECKING([for broken libc stdio]) - AC_CACHE_VAL(have_broken_glibc_fopen_append,[ - AC_TRY_RUN([ -#include -int main(int argc, char *argv[]) -{ - FILE *fp; - long position; - char *filename = "/tmp/phpglibccheck"; - - fp = fopen(filename, "w"); - if (fp == NULL) { - perror("fopen"); - exit(2); - } - fputs("foobar", fp); - fclose(fp); - - fp = fopen(filename, "a+"); - position = ftell(fp); - fclose(fp); - unlink(filename); - if (position == 0) - return 1; - return 0; -} -], -[have_broken_glibc_fopen_append=no], -[have_broken_glibc_fopen_append=yes ], -AC_TRY_COMPILE([ -#include -],[ -#if !__GLIBC_PREREQ(2,2) -choke me -#endif -], -[have_broken_glibc_fopen_append=yes], -[have_broken_glibc_fopen_append=no ]) -)]) - - if test "$have_broken_glibc_fopen_append" = "yes"; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+]) - else - AC_MSG_RESULT(no) - fi -]) - -dnl -dnl PHP_FOPENCOOKIE -dnl -AC_DEFUN([PHP_FOPENCOOKIE], [ - AC_CHECK_FUNC(fopencookie, [have_glibc_fopencookie=yes]) - - if test "$have_glibc_fopencookie" = "yes"; then -dnl this comes in two flavors: -dnl newer glibcs (since 2.1.2 ? ) -dnl have a type called cookie_io_functions_t -AC_TRY_COMPILE([ -#define _GNU_SOURCE -#include -], [cookie_io_functions_t cookie;], [have_cookie_io_functions_t=yes], []) - - if test "$have_cookie_io_functions_t" = "yes"; then - cookie_io_functions_t=cookie_io_functions_t - have_fopen_cookie=yes - -dnl even newer glibcs have a different seeker definition... -AC_TRY_RUN([ -#define _GNU_SOURCE -#include - -struct cookiedata { - __off64_t pos; -}; - -__ssize_t reader(void *cookie, char *buffer, size_t size) -{ return size; } -__ssize_t writer(void *cookie, const char *buffer, size_t size) -{ return size; } -int closer(void *cookie) -{ return 0; } -int seeker(void *cookie, __off64_t *position, int whence) -{ ((struct cookiedata*)cookie)->pos = *position; return 0; } - -cookie_io_functions_t funcs = {reader, writer, seeker, closer}; - -main() { - struct cookiedata g = { 0 }; - FILE *fp = fopencookie(&g, "r", funcs); - - if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192) - exit(0); - exit(1); -} - -], [ - cookie_io_functions_use_off64_t=yes -], [ - cookie_io_functions_use_off64_t=no -], [ - cookie_io_functions_use_off64_t=no -]) - - else - -dnl older glibc versions (up to 2.1.2 ?) -dnl call it _IO_cookie_io_functions_t -AC_TRY_COMPILE([ -#define _GNU_SOURCE -#include -], [ _IO_cookie_io_functions_t cookie; ], [have_IO_cookie_io_functions_t=yes], []) - if test "$have_cookie_io_functions_t" = "yes" ; then - cookie_io_functions_t=_IO_cookie_io_functions_t - have_fopen_cookie=yes - fi - fi - - if test "$have_fopen_cookie" = "yes" ; then - AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) - AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) - if test "$cookie_io_functions_use_off64_t" = "yes" ; then - AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ]) - fi - fi - fi -]) - -dnl ------------------------------------------------------------------------- -dnl Library/function existance and build sanity checks -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) -dnl -dnl Wrapper for AC_CHECK_LIB -dnl -AC_DEFUN([PHP_CHECK_LIBRARY], [ - save_old_LDFLAGS=$LDFLAGS - ac_stuff="$5" - - save_ext_shared=$ext_shared - ext_shared=yes - PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS) - AC_CHECK_LIB([$1],[$2],[ - LDFLAGS=$save_old_LDFLAGS - ext_shared=$save_ext_shared - $3 - ],[ - LDFLAGS=$save_old_LDFLAGS - ext_shared=$save_ext_shared - unset ac_cv_lib_$1[]_$2 - $4 - ])dnl -]) - -dnl -dnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]]) -dnl -dnl El cheapo wrapper for AC_CHECK_LIB -dnl -AC_DEFUN([PHP_CHECK_FRAMEWORK], [ - save_old_LDFLAGS=$LDFLAGS - LDFLAGS="-framework $1 $LDFLAGS" - dnl supplying "c" to AC_CHECK_LIB is technically cheating, but - dnl rewriting AC_CHECK_LIB is overkill and this only affects - dnl the "checking.." output anyway. - AC_CHECK_LIB(c,[$2],[ - LDFLAGS=$save_old_LDFLAGS - $3 - ],[ - LDFLAGS=$save_old_LDFLAGS - $4 - ]) -]) - -dnl -dnl PHP_CHECK_FUNC_LIB(func, libs) -dnl -dnl This macro checks whether 'func' or '__func' exists -dnl in the specified library. -dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. -dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNC -dnl -dnl -dnl autoconf undefines the builtin "shift" :-( -dnl If possible, we use the builtin shift anyway, otherwise we use -dnl the ubercool definition I have tested so far with FreeBSD/GNU m4 -ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[ -define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])]) -]) -dnl -AC_DEFUN([PHP_CHECK_FUNC_LIB],[ - ifelse($2,,:,[ - unset ac_cv_lib_$2[]_$1 - unset ac_cv_lib_$2[]___$1 - unset found - AC_CHECK_LIB($2, $1, [found=yes], [ - AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) - ]) - - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" - AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - - if test "$found" = "yes"; then - PHP_ADD_LIBRARY($2) - PHP_DEF_HAVE($1) - PHP_DEF_HAVE(lib$2) - ac_cv_func_$1=yes - else - PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@))) - fi - ]) -]) - -dnl -dnl PHP_CHECK_FUNC(func, ...) -dnl -dnl This macro checks whether 'func' or '__func' exists -dnl in the default libraries and as a fall back in the specified library. -dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. -dnl -AC_DEFUN([PHP_CHECK_FUNC],[ - unset ac_cv_func_$1 - unset ac_cv_func___$1 - unset found - - AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) - - case $found in - yes[)] - PHP_DEF_HAVE($1) - ac_cv_func_$1=yes - ;; - ifelse($#,1,,[ - *[)] PHP_CHECK_FUNC_LIB($@) ;; - ]) - esac -]) - -dnl -dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]]) -dnl -dnl This macro checks whether build works and given function exists. -dnl -AC_DEFUN([PHP_TEST_BUILD], [ - old_LIBS=$LIBS - LIBS="$4 $LIBS" - AC_TRY_RUN([ - $5 - char $1(); - int main() { - $1(); - return 0; - } - ], [ - LIBS=$old_LIBS - $2 - ],[ - LIBS=$old_LIBS - $3 - ],[ - LIBS=$old_LIBS - ]) -]) - -dnl ------------------------------------------------------------------------- -dnl Platform characteristics checks -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_SHLIB_SUFFIX_NAME -dnl -dnl Determines shared library suffix -dnl suffix can be: .so, .sl or .dylib -dnl -AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[ - AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl - PHP_SUBST(SHLIB_SUFFIX_NAME) - SHLIB_SUFFIX_NAME=so - case $host_alias in - *hpux*[)] - SHLIB_SUFFIX_NAME=sl - ;; - *darwin*[)] - SHLIB_SUFFIX_NAME=dylib - ;; - esac -]) - -dnl -dnl PHP_CHECK_64BIT([do if 32], [do if 64]) -dnl -dnl This macro is used to detect if we're at 64-bit platform or not. -dnl It could be useful for those external libs, that have different precompiled -dnl versions in different directories. -dnl -AC_DEFUN([PHP_CHECK_64BIT],[ - AC_CHECK_SIZEOF(long int, 4) - AC_MSG_CHECKING([checking if we're at 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4" ; then - AC_MSG_RESULT([no]) - $1 - else - AC_MSG_RESULT([yes]) - $2 - fi -]) - -dnl -dnl PHP_C_BIGENDIAN -dnl -dnl Replacement macro for AC_C_BIGENDIAN -dnl -AC_DEFUN([PHP_C_BIGENDIAN], -[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, - [ - ac_cv_c_bigendian_php=unknown - AC_TRY_RUN( - [ -int main(void) -{ - short one = 1; - char *cp = (char *)&one; - - if (*cp == 0) { - return(0); - } else { - return(1); - } -} - ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) - ]) - if test $ac_cv_c_bigendian_php = yes; then - AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) - fi -]) - -dnl ------------------------------------------------------------------------- -dnl Checks for programs: PHP_PROG_ -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_PROG_SENDMAIL -dnl -dnl Search for the sendmail binary -dnl -AC_DEFUN([PHP_PROG_SENDMAIL], [ - PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib - AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH) - if test -n "$PROG_SENDMAIL"; then - AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) - fi - PHP_SUBST(PROG_SENDMAIL) -]) - -dnl -dnl PHP_PROG_AWK -dnl -dnl Some vendors force mawk before gawk; mawk is broken so we don't like that -dnl -AC_DEFUN([PHP_PROG_AWK], [ - AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH) - case "$AWK" in - *mawk) - AC_MSG_WARN([mawk is known to have problems on some systems. You should install GNU awk]) - ;; - *gawk) - ;; - bork) - AC_MSG_ERROR([Could not find awk; Install GNU awk]) - ;; - *) - AC_MSG_CHECKING([if $AWK is broken]) - if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then - AC_MSG_RESULT([yes]) - AC_MSG_ERROR([You should install GNU awk]) - else - AC_MSG_RESULT([no]) - fi - ;; - esac - PHP_SUBST(AWK) -]) - -dnl -dnl PHP_PROG_BISON -dnl -dnl Search for bison and check it's version -dnl -AC_DEFUN([PHP_PROG_BISON], [ - AC_PROG_YACC - LIBZEND_BISON_CHECK - PHP_SUBST(YACC) -]) - -dnl -dnl PHP_PROG_LEX -dnl -dnl Search for (f)lex and check it's version -dnl -AC_DEFUN([PHP_PROG_LEX], [ - # we only support certain flex versions - flex_version_list="2.5.4" - - AC_PROG_LEX - if test -n "$LEX"; then - AC_DECL_YYTEXT - : - fi - dnl ## Make flex scanners use const if they can, even if __STDC__ is not - dnl ## true, for compilers like Sun's that only set __STDC__ true in - dnl ## "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode - AC_C_CONST - if test "$ac_cv_c_const" = "yes" ; then - LEX_CFLAGS="-DYY_USE_CONST" - fi - - if test "$LEX"; then - AC_CACHE_CHECK([for flex version], php_cv_flex_version, [ - flex_version=`$LEX -V -v --version 2>/dev/null | $SED -e 's/^.* //'` - php_cv_flex_version=invalid - for flex_check_version in $flex_version_list; do - if test "$flex_version" = "$flex_check_version"; then - php_cv_flex_version="$flex_check_version (ok)" - fi - done - ]) - else - flex_version=none - fi - - case $php_cv_flex_version in - ""|invalid[)] - flex_msg="flex versions supported for regeneration of the Zend/PHP parsers: $flex_version_list (found: $flex_version)." - AC_MSG_WARN([$flex_msg]) - LEX="exit 0;" - ;; - esac - PHP_SUBST(LEX) -]) - -dnl -dnl PHP_PROG_RE2C -dnl -dnl Search for the re2c binary and check the version -dnl -AC_DEFUN([PHP_PROG_RE2C],[ - AC_CHECK_PROG(RE2C, re2c, re2c) - if test -n "$RE2C"; then - AC_CACHE_CHECK([for re2c version], php_cv_re2c_version, [ - re2c_vernum=`echo "" | re2c --vernum 2>/dev/null` - if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "908"; then - php_cv_re2c_version=invalid - else - php_cv_re2c_version="`echo "" | re2c --version | cut -d ' ' -f 2 2>/dev/null` (ok)" - fi - ]) - fi - case $php_cv_re2c_version in - ""|invalid[)] - AC_MSG_WARN([You will need re2c 0.98 or later if you want to regenerate PHP parsers.]) - RE2C="exit 0;" - ;; - esac - PHP_SUBST(RE2C) -]) - -dnl ------------------------------------------------------------------------- -dnl Common setup macros: PHP_SETUP_ -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]]) -dnl -dnl Common setup macro for kerberos -dnl -AC_DEFUN([PHP_SETUP_KERBEROS],[ - found_kerberos=no - unset KERBEROS_CFLAGS - unset KERBEROS_LIBS - - dnl First try to find krb5-config - if test -z "$KRB5_CONFIG"; then - AC_PATH_PROG(KRB5_CONFIG, krb5-config, no, [$PATH:/usr/kerberos/bin:/usr/local/bin]) - fi - - dnl If krb5-config is found try using it - if test "$PHP_KERBEROS" = "yes" && test -x "$KRB5_CONFIG"; then - KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi` - KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi` - - if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then - found_kerberos=yes - PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1) - PHP_EVAL_INCLINE($KERBEROS_CFLAGS) - fi - fi - - dnl If still not found use old skool method - if test "$found_kerberos" = "no"; then - - if test "$PHP_KERBEROS" = "yes"; then - PHP_KERBEROS="/usr/kerberos /usr/local /usr" - fi - - for i in $PHP_KERBEROS; do - if test -f $i/$PHP_LIBDIR/libkrb5.a || test -f $i/$PHP_LIBDIR/libkrb5.$SHLIB_SUFFIX_NAME; then - PHP_KERBEROS_DIR=$i - break - fi - done - - if test "$PHP_KERBEROS_DIR"; then - found_kerberos=yes - PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/$PHP_LIBDIR, $1) - PHP_ADD_LIBRARY(gssapi_krb5, 1, $1) - PHP_ADD_LIBRARY(krb5, 1, $1) - PHP_ADD_LIBRARY(k5crypto, 1, $1) - PHP_ADD_LIBRARY(com_err, 1, $1) - PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include) - fi - fi - - if test "$found_kerberos" = "yes"; then -ifelse([$2],[],:,[$2]) -ifelse([$3],[],,[else $3]) - fi -]) - -dnl -dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]]) -dnl -dnl Common setup macro for openssl -dnl -AC_DEFUN([PHP_SETUP_OPENSSL],[ - found_openssl=no - unset OPENSSL_INCDIR - unset OPENSSL_LIBDIR - - dnl Empty variable means 'no' - test -z "$PHP_OPENSSL" && PHP_OPENSSL=no - test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no - - dnl Fallbacks for different configure options - if test "$PHP_OPENSSL" != "no"; then - PHP_OPENSSL_DIR=$PHP_OPENSSL - elif test "$PHP_IMAP_SSL" != "no"; then - PHP_OPENSSL_DIR=$PHP_IMAP_SSL - fi - - dnl First try to find pkg-config - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - dnl If pkg-config is found try using it - if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then - if $PKG_CONFIG --atleast-version=0.9.6 openssl; then - found_openssl=yes - OPENSSL_LIBS=`$PKG_CONFIG --libs openssl` - OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl` - OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl` - else - AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.]) - fi - - if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then - PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1) - PHP_EVAL_INCLINE($OPENSSL_INCS) - fi - fi - - dnl If pkg-config fails for some reason, revert to the old method - if test "$found_openssl" = "no"; then - - if test "$PHP_OPENSSL_DIR" = "yes"; then - PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" - fi - - for i in $PHP_OPENSSL_DIR; do - if test -r $i/include/openssl/evp.h; then - OPENSSL_INCDIR=$i/include - fi - if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then - OPENSSL_LIBDIR=$i/$PHP_LIBDIR - fi - test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break - done - - if test -z "$OPENSSL_INCDIR"; then - AC_MSG_ERROR([Cannot find OpenSSL's ]) - fi - - if test -z "$OPENSSL_LIBDIR"; then - AC_MSG_ERROR([Cannot find OpenSSL's libraries]) - fi - - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$OPENSSL_INCDIR - AC_MSG_CHECKING([for OpenSSL version]) - AC_EGREP_CPP(yes,[ -#include -#if OPENSSL_VERSION_NUMBER >= 0x0090600fL - yes -#endif - ],[ - AC_MSG_RESULT([>= 0.9.6]) - ],[ - AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.]) - ]) - CPPFLAGS=$old_CPPFLAGS - - PHP_ADD_INCLUDE($OPENSSL_INCDIR) - - PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [ - PHP_ADD_LIBRARY(crypto,,$1) - ],[ - AC_MSG_ERROR([libcrypto not found!]) - ],[ - -L$OPENSSL_LIBDIR - ]) - - old_LIBS=$LIBS - LIBS="$LIBS -lcrypto" - PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [ - found_openssl=yes - ],[ - AC_MSG_ERROR([libssl not found!]) - ],[ - -L$OPENSSL_LIBDIR - ]) - LIBS=$old_LIBS - PHP_ADD_LIBRARY(ssl,,$1) - - PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1) - fi - - if test "$found_openssl" = "yes"; then - dnl For apache 1.3.x static build - OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR - AC_SUBST(OPENSSL_INCDIR_OPT) - -ifelse([$2],[],:,[$2]) -ifelse([$3],[],,[else $3]) - fi -]) - -dnl -dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]]) -dnl -dnl Common setup macro for iconv -dnl -AC_DEFUN([PHP_SETUP_ICONV], [ - found_iconv=no - unset ICONV_DIR - - # Create the directories for a VPATH build: - $php_shtool mkdir -p ext/iconv - - echo > ext/iconv/php_have_bsd_iconv.h - echo > ext/iconv/php_have_glibc_iconv.h - echo > ext/iconv/php_have_libiconv.h - echo > ext/iconv/php_have_iconv.h - echo > ext/iconv/php_php_iconv_impl.h - echo > ext/iconv/php_php_iconv_h_path.h - echo > ext/iconv/php_iconv_supports_errno.h - - dnl - dnl Check libc first if no path is provided in --with-iconv - dnl - if test "$PHP_ICONV" = "yes"; then - AC_CHECK_FUNC(iconv, [ - found_iconv=yes - ],[ - AC_CHECK_FUNC(libiconv,[ - PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) - AC_DEFINE(HAVE_LIBICONV, 1, [ ]) - found_iconv=yes - ]) - ]) - fi - - dnl - dnl Check external libs for iconv funcs - dnl - if test "$found_iconv" = "no"; then - - for i in $PHP_ICONV /usr/local /usr; do - if test -r $i/include/giconv.h; then - AC_DEFINE(HAVE_GICONV_H, 1, [ ]) - ICONV_DIR=$i - iconv_lib_name=giconv - break - elif test -r $i/include/iconv.h; then - ICONV_DIR=$i - iconv_lib_name=iconv - break - fi - done - - if test -z "$ICONV_DIR"; then - AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=]) - fi - - if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a || - test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME - then - PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [ - found_iconv=yes - PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) - AC_DEFINE(HAVE_LIBICONV,1,[ ]) - ], [ - PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [ - found_iconv=yes - ], [], [ - -L$ICONV_DIR/$PHP_LIBDIR - ]) - ], [ - -L$ICONV_DIR/$PHP_LIBDIR - ]) - fi - fi - - if test "$found_iconv" = "yes"; then - PHP_DEFINE(HAVE_ICONV,1,[ext/iconv]) - AC_DEFINE(HAVE_ICONV,1,[ ]) - if test -n "$ICONV_DIR"; then - PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1) - PHP_ADD_INCLUDE($ICONV_DIR/include) - fi - $2 -ifelse([$3],[],,[else $3]) - fi -]) - -dnl -dnl PHP_SETUP_LIBXML(shared-add [, action-found [, action-not-found]]) -dnl -dnl Common setup macro for libxml -dnl -AC_DEFUN([PHP_SETUP_LIBXML], [ -AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, -[ - for i in $PHP_LIBXML_DIR /usr/local /usr; do - if test -x "$i/bin/xml2-config"; then - ac_cv_php_xml2_config_path="$i/bin/xml2-config" - break - fi - done -]) - - if test -x "$ac_cv_php_xml2_config_path"; then - XML2_CONFIG="$ac_cv_php_xml2_config_path" - libxml_full_version=`$XML2_CONFIG --version` - ac_IFS=$IFS - IFS="." - set $libxml_full_version - IFS=$ac_IFS - LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` - if test "$LIBXML_VERSION" -ge "2006011"; then - LIBXML_LIBS=`$XML2_CONFIG --libs` - LIBXML_INCS=`$XML2_CONFIG --cflags` - PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) - PHP_EVAL_INCLINE($LIBXML_INCS) - - dnl Check that build works with given libs - AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ - PHP_TEST_BUILD(xmlInitParser, - [ - php_cv_libxml_build_works=yes - ], [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([build test failed. Please check the config.log for details.]) - ], [ - [$]$1 - ]) - ]) - if test "$php_cv_libxml_build_works" = "yes"; then - AC_DEFINE(HAVE_LIBXML, 1, [ ]) - fi - $2 - else - AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) - fi -ifelse([$3],[],,[else $3]) - fi -]) - -dnl ------------------------------------------------------------------------- -dnl Misc. macros -dnl ------------------------------------------------------------------------- - -dnl -dnl PHP_INSTALL_HEADERS(path [, file ...]) -dnl -dnl PHP header files to be installed -dnl -AC_DEFUN([PHP_INSTALL_HEADERS],[ - ifelse([$2],[],[ - for header_file in $1; do - PHP_RUN_ONCE(INSTALLHEADERS, $header_file, [ - INSTALL_EXT_HEADERS="$INSTALL_EXT_HEADERS $header_file" - ]) - done - ], [ - header_path=$1 - for header_file in $2; do - hp_hf="$header_path/$header_file" - PHP_RUN_ONCE(INSTALLHEADERS, $hp_hf, [ - INSTALL_EXT_HEADERS="$INSTALL_EXT_HEADERS $hp_hf" - ]) - done - ]) -]) - -dnl -dnl PHP_AP_EXTRACT_VERSION(/path/httpd) -dnl -dnl This macro is used to get a comparable -dnl version for apache1/2. -dnl -AC_DEFUN([PHP_AP_EXTRACT_VERSION],[ - ac_output=`$1 -v 2>&1 | grep version` - ac_IFS=$IFS -IFS="- /. -" - set $ac_output - IFS=$ac_IFS - - APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6` -]) - -dnl -dnl PHP_DEBUG_MACRO(filename) -dnl -AC_DEFUN([PHP_DEBUG_MACRO],[ - DEBUG_LOG=$1 - cat >$1 <conftest.$ac_ext <>$1 2>&1 - rm -fr conftest* -]) - -dnl -dnl PHP_CONFIG_NICE(filename) -dnl -dnl Generates the config.nice file -dnl -AC_DEFUN([PHP_CONFIG_NICE],[ - AC_REQUIRE([AC_PROG_EGREP]) - AC_REQUIRE([LT_AC_PROG_SED]) - PHP_SUBST(EGREP) - PHP_SUBST(SED) - test -f $1 && mv $1 $1.old - rm -f $1.old - cat >$1<> $1 - fi - done - - for arg in [$]0 "[$]@"; do - echo "'[$]arg' \\" >> $1 - CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'" - done - echo '"[$]@"' >> $1 - chmod +x $1 - PHP_SUBST_OLD(CONFIGURE_COMMAND) -]) - -dnl -dnl PHP_REGEX -dnl -AC_DEFUN([PHP_REGEX],[ - if test "$REGEX_TYPE" = "php"; then - AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ]) - AC_DEFINE(HSREGEX,1,[ ]) - AC_DEFINE(REGEX,1,[ ]) - PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c) - elif test "$REGEX_TYPE" = "system"; then - AC_DEFINE(REGEX,0,[ ]) - dnl Check if field re_magic exists in struct regex_t - AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [ - AC_TRY_COMPILE([#include -#include ], [regex_t rt; rt.re_magic;], - [ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no]) - ]) - if test "$ac_cv_regex_t_re_magic" = "yes"; then - AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1) - fi - fi - AC_MSG_CHECKING([which regex library to use]) - AC_MSG_RESULT([$REGEX_TYPE]) -]) - -dnl -dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) -dnl -AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ - AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - fi - ]) - if test -n "$pdo_inc_path"; then -ifelse([$1],[],:,[$1]) - else -ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2]) - fi -]) diff --git a/build/build.mk b/build/build.mk deleted file mode 100644 index a3e12f791c4aa..0000000000000 --- a/build/build.mk +++ /dev/null @@ -1,73 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2005 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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# -# Makefile to generate build tools -# - -ZENDDIR = Zend - -SUBDIRS = $(ZENDDIR) TSRM - -STAMP = buildmk.stamp - -ALWAYS = generated_lists - - -all: $(STAMP) $(ALWAYS) - @$(MAKE) AMFLAGS=$(AMFLAGS) -s -f build/build2.mk - -generated_lists: - @echo makefile_am_files = $(ZENDDIR)/Makefile.am \ - TSRM/Makefile.am > $@ - @echo config_h_files = $(ZENDDIR)/acconfig.h TSRM/acconfig.h >> $@ - @echo config_m4_files = $(ZENDDIR)/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \ - $(ZENDDIR)/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@ - -$(STAMP): build/buildcheck.sh - @build/buildcheck.sh $(STAMP) - -snapshot: - distname='$(DISTNAME)'; \ - if test -z "$$distname"; then \ - distname='php5-snapshot'; \ - fi; \ - myname=`basename \`pwd\`` ; \ - cd .. && cp -rp $$myname $$distname; \ - cd $$distname; \ - rm -f $(SUBDIRS) 2>/dev/null || true; \ - for i in $(SUBDIRS); do \ - test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \ - done; \ - find . -type l -exec rm {} \; ; \ - $(MAKE) AMFLAGS=--copy -f build/build.mk; \ - cd ..; \ - tar cf $$distname.tar $$distname; \ - rm -rf $$distname $$distname.tar.*; \ - bzip2 -9 $$distname.tar; \ - md5sum $$distname.tar.bz2; \ - sync; sleep 2; \ - md5sum $$distname.tar.bz2; \ - bzip2 -t $$distname.tar.bz2 - -cvsclean-work: - @for i in `find . -name .cvsignore`; do \ - (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice` *.o *.a .libs || true); \ - done - -.PHONY: $(ALWAYS) snapshot diff --git a/build/build2.mk b/build/build2.mk deleted file mode 100644 index 507438f48c084..0000000000000 --- a/build/build2.mk +++ /dev/null @@ -1,63 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2005 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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include generated_lists - -TOUCH_FILES = mkinstalldirs install-sh missing - -LT_TARGETS = ltmain.sh config.guess config.sub - -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -config_h_in = main/php_config.h.in - -acconfig_h_SOURCES = acconfig.h.in $(config_h_files) - -targets = $(TOUCH_FILES) configure $(config_h_in) - -PHP_AUTOCONF ?= 'autoconf' -PHP_AUTOHEADER ?= 'autoheader' - -SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_DECL_YYTEXT is expanded from...|the top level)'||true) - -all: $(targets) - -acconfig.h: $(acconfig_h_SOURCES) - @echo rebuilding $@ - cat $(acconfig_h_SOURCES) > $@ - -$(config_h_in): configure acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @echo rebuilding $@ - @rm -f $@ - $(PHP_AUTOHEADER) $(SUPPRESS_WARNINGS) - -$(TOUCH_FILES): - touch $(TOUCH_FILES) - -aclocal.m4: configure.in acinclude.m4 - @echo rebuilding $@ - cat acinclude.m4 ./build/libtool.m4 > $@ - -configure: aclocal.m4 configure.in $(config_m4_files) - @echo rebuilding $@ - $(PHP_AUTOCONF) $(SUPPRESS_WARNINGS) - diff --git a/build/buildcheck.sh b/build/buildcheck.sh deleted file mode 100755 index 1aa4a7f089864..0000000000000 --- a/build/buildcheck.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2005 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: Stig Bakken | -# | Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id: buildcheck.sh,v 1.37 2005-08-03 14:06:38 sniper Exp $ -# - -echo "buildconf: checking installation..." - -stamp=$1 - -# Allow the autoconf executable to be overridden by $PHP_AUTOCONF. -if test -z "$PHP_AUTOCONF"; then - PHP_AUTOCONF='autoconf' -fi - -# autoconf 2.13 or newer -ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then -echo "buildconf: autoconf not found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then -echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -else -echo "buildconf: autoconf version $ac_version (ok)" -fi - -if test "$1" = "2" && test "$2" -ge "50"; then - echo "buildconf: Your version of autoconf likely contains buggy cache code." - echo " Running cvsclean for you." - echo " To avoid this, install autoconf-2.13 and automake-1.5." - ./cvsclean - stamp= -fi - -test -n "$stamp" && touch $stamp - -exit 0 diff --git a/build/config-stubs b/build/config-stubs deleted file mode 100755 index 28208085a7513..0000000000000 --- a/build/config-stubs +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# $Id$ - -dir=$1; shift -for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do - echo "sinclude($stubfile)" -done diff --git a/build/genif.sh b/build/genif.sh deleted file mode 100644 index 61d1f00454889..0000000000000 --- a/build/genif.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/sh - -# $Id: genif.sh,v 1.6 2005-06-21 13:47:38 sniper Exp $ -# replacement for genif.pl - -infile=$1 -shift -srcdir=$1 -shift -extra_module_ptrs=$1 -shift -awk=$1 -shift - -if test -z "$infile" || test -z "$srcdir"; then - echo "please supply infile and srcdir" - exit 1 -fi - -header_list= -olddir=`pwd` -cd $srcdir - -module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`" - -for ext in ${1+"$@"} ; do - header_list="$header_list ext/$ext/*.h" -done - -includes=`$awk -f ./build/print_include.awk $header_list` - -cd $olddir - -cat $infile | \ - sed \ - -e "s'@EXT_INCLUDE_CODE@'$includes'" \ - -e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \ - -e 's/@NEWLINE@/\ -/g' - - diff --git a/build/libtool.m4 b/build/libtool.m4 deleted file mode 100644 index 413ac9bdd04e7..0000000000000 --- a/build/libtool.m4 +++ /dev/null @@ -1,6230 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This file is free software; the Free Software Foundation gives -## unlimited permission to copy and/or distribute it, with or without -## modifications, as long as this notice is preserved. - -# serial 47 AC_PROG_LIBTOOL - -ifdef([AC_ACVERSION],[ -# autoconf 2.13 compatibility -# Set PATH_SEPARATOR variable -# --------------------------------- -# Find the correct PATH separator. Usually this is :', but -# DJGPP uses ;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -]) - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -ifdef([AC_PROVIDE_IFELSE], - [], - [define([AC_PROVIDE_IFELSE], - [ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) - -dnl dnl And a similar setup for Fortran 77 support -dnl AC_PROVIDE_IFELSE([AC_PROG_F77], -dnl [AC_LIBTOOL_F77], -dnl [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -dnl ])]) - -dnl dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. -dnl AC_PROVIDE_IFELSE([AC_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [ifdef([AC_PROG_GCJ], -dnl [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -dnl ifdef([A][M_PROG_GCJ], -dnl [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -dnl ifdef([LT_AC_PROG_GCJ], -dnl [define([LT_AC_PROG_GCJ], -dnl defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -dnl ]) -])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], -[ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -dnl autoconf 2.13 compatibility -dnl _LT_AC_TRY_LINK() -AC_DEFUN(_LT_AC_TRY_LINK, [ -cat > conftest.$ac_ext <&5 - cat conftest.$ac_ext >&6 -ifelse([$2], , , [$2 - rm -rf conftest* -])dnl -fi -rm -f conftest*]) - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[_LT_AC_TRY_LINK([ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[dnl -#AC_ARG_ENABLE([libtool-lock], -#[ --disable-libtool-lock avoid locking (might break parallel builds)]) -#test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "configure:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "configure:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], -[ --with-tags[=TAGS] include additional configurations [automatic] -], -[tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file \`$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file \`$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using \`LTCC=$LTCC', extracted from \`$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - -# F77) -# if test -n "$F77" && test "X$F77" != "Xno"; then -# AC_LIBTOOL_LANG_F77_CONFIG -# else -# tagname="" -# fi -# ;; -# -# GCJ) -# if test -n "$GCJ" && test "X$GCJ" != "Xno"; then -# AC_LIBTOOL_LANG_GCJ_CONFIG -# else -# tagname="" -# fi -# ;; -# -# RC) -# AC_LIBTOOL_LANG_RC_CONFIG -# ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -ifdef([AC_PROG_EGREP], [], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# --------------- -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -#AC_DEFUN([AC_LIBTOOL_F77], -#[AC_REQUIRE([_LT_AC_LANG_F77]) -#])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -#AC_DEFUN([_LT_AC_LANG_F77], -#[AC_REQUIRE([AC_PROG_F77]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -#])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -#AC_DEFUN([AC_LIBTOOL_GCJ], -#[AC_REQUIRE([_LT_AC_LANG_GCJ]) -#])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -#AC_DEFUN([_LT_AC_LANG_GCJ], -#[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], -# [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], -# [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], -# [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], -# [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], -# [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -#])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -#AC_DEFUN([AC_LIBTOOL_RC], -#[AC_REQUIRE([LT_AC_PROG_RC]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -#])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_SAVE -AC_LANG_C - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([\`$CC' requires \`$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_REQUIRE([AC_PROG_LD]) - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* ) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -#AC_DEFUN([LT_AC_PROG_GCJ], -#[AC_CHECK_TOOL(GCJ, gcj, no) -# test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" -# AC_SUBST(GCJFLAGS) -#]) - -#AC_DEFUN([LT_AC_PROG_RC], -#[AC_CHECK_TOOL(RC, windres, no) -#]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -ac_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for ac_dir in $PATH -do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if test -f "$ac_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $ac_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) diff --git a/build/mkdep.awk b/build/mkdep.awk deleted file mode 100644 index e4cfa380ea024..0000000000000 --- a/build/mkdep.awk +++ /dev/null @@ -1,75 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 2000-2005 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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# Usage: -# -# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \ -# awk -f mkdep.awk > dependencies - - -{ - top_srcdir=$1 - top_builddir=$2 - srcdir=$3 - cmd=$4 - - for (i = 5; i <= NF; i++) { - if (match($i, "^-[A-Z]") == 0) - break; - cmd=cmd " " $i - } - - dif=i-1 - - for (; i <= NF; i++) - filenames[i-dif]=$i - - no_files=NF-dif - - for(i = 1; i <= no_files; i++) { - if (system("test -r " filenames[i]) != 0) - continue - - target=filenames[i] - sub(srcdir "/", "", target) - target2=target - sub("\.(c|cpp)$", ".lo", target); - sub("\.(c|cpp)$", ".slo", target2); - - for (e in used) - delete used[e] - - cmdx=cmd " " filenames[i] - done=0 - while ((cmdx | getline) > 0) { - if (match($0, "^# [0-9]* \".*\.h\"") != 0) { - if (sub(top_srcdir, "$(top_srcdir)", $3) == 0) - sub(top_builddir, "$(top_builddir)", $3) - if (substr($3,2,1) != "/" && used[$3] != 1) { - if (done == 0) - printf(target " " target2 ":") - done=1 - printf(" \\\n\t" substr($3,2,length($3)-2)) - used[$3] = 1; - } - } - } - if (done == 1) - print "\n" - } -} diff --git a/build/order_by_dep.awk b/build/order_by_dep.awk deleted file mode 100644 index 38128b2e1b56a..0000000000000 --- a/build/order_by_dep.awk +++ /dev/null @@ -1,89 +0,0 @@ -BEGIN { - orig_rs = RS; - orig_fs = FS; - RS=" "; - mod_count = 0; - SUBSEP=":"; -} - -function get_deps(module_name, depline, cmd) -{ - # this could probably be made *much* better - RS=orig_rs; - FS="[(,) \t]+" - cmd = "grep PHP_ADD_EXTENSION_DEP ext/" module_name "/config*.m4" - while (cmd | getline) { -# printf("GOT: %s,%s,%s,%s,%s\n", $1, $2, $3, $4, $5); - if (!length($5)) { - $5 = 0; - } - mod_deps[module_name, $4] = $5; - } - close(cmd) - RS=" "; - FS=orig_fs; -} - -function get_module_index(name, i) -{ - for (i in mods) { - if (mods[i] == name) { - return i; - } - } - return -1; -} - -function do_deps(mod_idx, module_name, mod_name_len, dep, ext, val, depidx) -{ - module_name = mods[mod_idx]; - mod_name_len = length(module_name); - - for (ext in mod_deps) { - if (substr(ext, 0, mod_name_len+1) != module_name SUBSEP) { - continue; - } - val = mod_deps[ext]; - ext = substr(ext, mod_name_len+2, length(ext)-mod_name_len); - - depidx = get_module_index(ext); - if (depidx >= 0) { - do_deps(depidx); - } - } - - #printf(" phpext_%s_ptr,\n", module_name); - printf(" phpext_%s_ptr,@NEWLINE@", module_name); - delete mods[mod_idx]; -} - -function count(arr, n, i) -{ - n = 0; - for (i in arr) - n++; - return n; -} - -/^[a-zA-Z0-9_-]+/ { - # mini hack for pedantic awk - gsub("[^a-zA-Z0-9_-]", "", $1) - # add each item to array - mods[mod_count++] = $1 - - # see if it has any module deps - get_deps($1); -} -END { - # order it correctly - out_count = 0; - - while (count(mods)) { - # count down, since we need to assemble it in reverse order - for (i = mod_count-1; i >= 0; --i) { - if (i in mods) { - do_deps(i); - } - } - } -} diff --git a/build/print_include.awk b/build/print_include.awk deleted file mode 100644 index a4919fae87343..0000000000000 --- a/build/print_include.awk +++ /dev/null @@ -1,6 +0,0 @@ -/phpext_/ { - if (old_filename != FILENAME) { - printf "#include \"" FILENAME "\"@NEWLINE@" - old_filename = FILENAME - } -} diff --git a/build/scan_makefile_in.awk b/build/scan_makefile_in.awk deleted file mode 100644 index 0c6d20398fee9..0000000000000 --- a/build/scan_makefile_in.awk +++ /dev/null @@ -1,32 +0,0 @@ -BEGIN { - mode=0 - sources="" -} - -mode == 0 && /^LTLIBRARY_SOURCES.*\\$/ { - if (match($0, "[^=]*$")) { - sources=substr($0, RSTART, RLENGTH-1) - } - mode=1 - next -} - -mode == 0 && /^LTLIBRARY_SOURCES.*/ { - if (match($0, "[^=]*$")) { - sources=substr($0, RSTART, RLENGTH) - } -} - -mode == 1 && /.*\\$/ { - sources=sources substr($0, 0, length - 1) - next -} - -mode == 1 { - sources=sources $0 - mode=0 -} - -END { - print sources -} diff --git a/build/shtool b/build/shtool deleted file mode 100755 index cd5352d22925f..0000000000000 --- a/build/shtool +++ /dev/null @@ -1,1123 +0,0 @@ -#!/bin/sh -## -## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2005 Ralf S. Engelschall -## -## See http://www.gnu.org/software/shtool/ for more information. -## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. -## -## Version: 2.0.2 (15-Jun-2005) -## Contents: 4/19 available modules -## - -## -## This program 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. -## -## This program 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 this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -## USA, or contact Ralf S. Engelschall . -## -## NOTICE: Given that you include this file verbatim into your own -## source tree, you are justified in saying that it remains separate -## from your package, and that this way you are simply just using GNU -## shtool. So, in this situation, there is no requirement that your -## package itself is licensed under the GNU General Public License in -## order to take advantage of GNU shtool. -## - -## -## Usage: shtool [] [ [] []] -## -## Available commands: -## echo Print string with optional construct expansion -## install Install a program, script or datafile -## mkdir Make one or more directories -## path Deal with program paths -## -## Not available commands (because module was not built-in): -## mdate Pretty-print modification time of a file or dir -## table Pretty-print a field-separated list as a table -## prop Display progress with a running propeller -## move Move files with simultaneous substitution -## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree through symbolic links -## fixperm Fix file permissions inside a source tree -## rotate Logfile rotation -## tarball Roll distribution tarballs -## subst Apply sed(1) substitution operations -## platform Platform Identification Utility -## arx Extended archive command -## slo Separate linker options by library class -## scpp Sharing C Pre-Processor -## version Maintain a version information file -## - -if [ $# -eq 0 ]; then - echo "$0:Error: invalid command line" 1>&2 - echo "$0:Hint: run \`$0 -h' for usage" 1>&2 - exit 1 -fi -if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 2.0.2 (15-Jun-2005)" - echo "Copyright (c) 1994-2005 Ralf S. Engelschall " - echo "Report bugs to " - echo '' - echo "Usage: shtool [] [ [] []]" - echo '' - echo 'Available global :' - echo ' -v, --version display shtool version information' - echo ' -h, --help display shtool usage help page (this one)' - echo ' -d, --debug display shell trace information' - echo ' -r, --recreate recreate this shtool script via shtoolize' - echo '' - echo 'Available [] []:' - echo ' echo [-n|--newline] [-e|--expand] [ ...]' - echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' - echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' - echo ' [-o|--owner ] [-g|--group ] [-e|--exec' - echo ' ] [ ...] ' - echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' - echo ' ] [-o|--owner ] [-g|--group ] ' - echo ' [ ...]' - echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' - echo ' [-m|--magic] [-p|--path ] [ ...]' - echo '' - echo 'Not available (because module was not built-in):' - echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' - echo ' [-f|--field-sep ] [-o|--order ] ' - echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' - echo ' ] [-s|--strip ] ...' - echo ' prop [-p|--prefix ]' - echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' - echo ' ' - echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' - echo ' [ ...] ' - echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' - echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' - echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' - echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' - echo ' [-a|--archive-dir ] [-z|--compress [:]]' - echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' - echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' - echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' - echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' - echo ' [-c|--compress ] [-d|--directory ] [-u|--user' - echo ' ] [-g|--group ] [-e|--exclude ]' - echo ' [ ...]' - echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' - echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' - echo ' ] [-e|--exec ] [-f|--file ] []' - echo ' [...]' - echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' - echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' - echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' - echo ' [-V|--version] [-h|--help]' - echo ' arx [-t|--trace] [-C|--command ] [' - echo ' ...]' - echo ' slo [-p|--prefix ] -- -L -l [-L -l' - echo ' ...]' - echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' - echo ' [-o|--output ] [-t|--template ] [-M|--mark' - echo ' ] [-D|--define ] [-C|--class ]' - echo ' [ ...]' - echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' - echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' - echo ' ] [-d|--display ] ' - echo '' - exit 0 -fi -if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then - echo "GNU shtool 2.0.2 (15-Jun-2005)" - exit 0 -fi -if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then - shtoolize -oshtool echo install mkdir path - exit 0 -fi -if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then - shift - set -x -fi -name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` -case "$name" in - echo|install|mkdir|path ) - # implicit tool command selection - tool="$name" - ;; - * ) - # explicit tool command selection - tool="$1" - shift - ;; -esac -arg_spec="" -opt_spec="" -gen_tmpfile=no - -## -## DISPATCH INTO SCRIPT PROLOG -## - -case $tool in - echo ) - str_tool="echo" - str_usage="[-n|--newline] [-e|--expand] [ ...]" - arg_spec="0+" - opt_spec="n.e." - opt_alias="n:newline,e:expand" - opt_n=no - opt_e=no - ;; - install ) - str_tool="install" - str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " - arg_spec="1+" - opt_spec="v.t.d.c.C.s.m:o:g:e+" - opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" - opt_v=no - opt_t=no - opt_d=no - opt_c=no - opt_C=no - opt_s=no - opt_m="0755" - opt_o="" - opt_g="" - opt_e="" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode ] [-o|--owner ] [-g|--group ] [ ...]" - arg_spec="1+" - opt_spec="t.f.p.m:o:g:" - opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group" - opt_t=no - opt_f=no - opt_p=no - opt_m="" - opt_o="" - opt_g="" - ;; - path ) - str_tool="path" - str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path ] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="s.r.d.b.m.p:" - opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path" - opt_s=no - opt_r=no - opt_d=no - opt_b=no - opt_m=no - opt_p="$PATH" - ;; - -* ) - echo "$0:Error: unknown option \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; - * ) - echo "$0:Error: unknown command \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; -esac - -## -## COMMON UTILITY CODE -## - -# commonly used ASCII values -ASC_TAB=" " -ASC_NL=" -" - -# determine name of tool -if [ ".$tool" != . ]; then - # used inside shtool script - toolcmd="$0 $tool" - toolcmdhelp="shtool $tool" - msgprefix="shtool:$tool" -else - # used as standalone script - toolcmd="$0" - toolcmdhelp="sh $0" - msgprefix="$str_tool" -fi - -# parse argument specification string -eval `echo $arg_spec |\ - sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` - -# parse option specification string -eval `echo h.$opt_spec |\ - sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` - -# parse option alias string -eval `echo h:help,$opt_alias |\ - sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` - -# interate over argument line -opt_PREV='' -while [ $# -gt 0 ]; do - # special option stops processing - if [ ".$1" = ".--" ]; then - shift - break - fi - - # determine option and argument - opt_ARG_OK=no - if [ ".$opt_PREV" != . ]; then - # merge previous seen option with argument - opt_OPT="$opt_PREV" - opt_ARG="$1" - opt_ARG_OK=yes - opt_PREV='' - else - # split argument into option and argument - case "$1" in - --[a-zA-Z0-9]*=*) - eval `echo "x$1" |\ - sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` - opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` - eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" - ;; - --[a-zA-Z0-9]*) - opt_OPT=`echo "x$1" | cut -c4-` - opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` - eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" - opt_ARG='' - ;; - -[a-zA-Z0-9]*) - eval `echo "x$1" |\ - sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ - -e 's/";\(.*\)$/"; opt_ARG="\1"/'` - ;; - -[a-zA-Z0-9]) - opt_OPT=`echo "x$1" | cut -c3-` - opt_ARG='' - ;; - *) - break - ;; - esac - fi - - # eat up option - shift - - # determine whether option needs an argument - eval "opt_MODE=\$opt_MODE_${opt_OPT}" - if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then - if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then - opt_PREV="$opt_OPT" - continue - fi - fi - - # process option - case $opt_MODE in - '.' ) - # boolean option - eval "opt_${opt_OPT}=yes" - ;; - ':' ) - # option with argument (multiple occurances override) - eval "opt_${opt_OPT}=\"\$opt_ARG\"" - ;; - '+' ) - # option with argument (multiple occurances append) - eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\"" - ;; - * ) - echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 - ;; - esac -done -if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 -fi - -# process help option -if [ ".$opt_h" = .yes ]; then - echo "Usage: $toolcmdhelp $str_usage" - exit 0 -fi - -# complain about incorrect number of arguments -case $arg_MODE in - '=' ) - if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; - '+' ) - if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; -esac - -# establish a temporary file on request -if [ ".$gen_tmpfile" = .yes ]; then - # create (explicitly) secure temporary directory - if [ ".$TMPDIR" != . ]; then - tmpdir="$TMPDIR" - elif [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - else - tmpdir="/tmp" - fi - tmpdir="$tmpdir/.shtool.$$" - ( umask 077 - rm -rf "$tmpdir" >/dev/null 2>&1 || true - mkdir "$tmpdir" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 - exit 1 - fi - ) - - # create (implicitly) secure temporary file - tmpfile="$tmpdir/shtool.tmp" - touch "$tmpfile" -fi - -# utility function: map string to lower case -util_lower () { - echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' -} - -# utility function: map string to upper case -util_upper () { - echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -} - -# cleanup procedure -shtool_exit () { - rc="$1" - if [ ".$gen_tmpfile" = .yes ]; then - rm -rf "$tmpdir" >/dev/null 2>&1 || true - fi - exit $rc -} - -## -## DISPATCH INTO SCRIPT BODY -## - -case $tool in - -echo ) - ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2005 Ralf S. Engelschall - ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then - case $TERM in - # for the most important terminal types we directly know the sequences - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*|cygwin) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - # for all others, we try to use a possibly existing `tput' or `tcout' utility - * ) - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # 'smso' is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso init reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then - break; - fi - done - ;; - esac - if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - term_bold='' - term_norm='' - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then - username="`(id -un) 2>/dev/null`" - if [ ".$username" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` - fi - if [ ".$username" = . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - userid="`(id -u ${username}) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'` - fi - if [ ".$userid" = . ]; then - userid=`(getent passwd ${username}) 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - grep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - fi - fi - - # determine (primary) group id - groupid='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then - groupid="`(id -g ${username}) 2>/dev/null`" - if [ ".$groupid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then - groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'` - fi - if [ ".$groupid" = . ]; then - groupid=`(getent passwd ${username}) 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid='?' - fi - fi - fi - fi - fi - fi - - # determine (primary) group name - groupname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then - groupname="`(id -gn ${username}) 2>/dev/null`" - if [ ".$groupname" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then - groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` - fi - if [ ".$groupname" = . ]; then - groupname=`(getent group) 2>/dev/null | \ - grep "^[^:]*:[^:]*:${groupid}:" | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname=`(ypcat group) 2>/dev/null | \ - grep "^[^:]*:[^:]*:${groupid}:" | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname='?' - fi - fi - fi - fi - fi - fi - - # determine host and domain name - hostname='' - domainname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi - fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi - fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac - fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%g/${groupname}/g" \ - -e "s/%G/${groupid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo "$text" - else - # the harder part: echo -n is best, because - # awk may complain about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn "$text" - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" - fi - fi - - shtool_exit 0 - ;; - -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2005 Ralf S. Engelschall - ## - - # special case: "shtool install -d [...]" internally - # maps to "shtool mkdir -f -p -m 755 [...]" - if [ "$opt_d" = yes ]; then - cmd="$0 mkdir -f -p -m 755" - if [ ".$opt_o" != . ]; then - cmd="$cmd -o '$opt_o'" - fi - if [ ".$opt_g" != . ]; then - cmd="$cmd -g '$opt_g'" - fi - if [ ".$opt_v" = .yes ]; then - cmd="$cmd -v" - fi - if [ ".$opt_t" = .yes ]; then - cmd="$cmd -t" - fi - for dir in "$@"; do - eval "$cmd $dir" || shtool_exit $? - done - shtool_exit 0 - fi - - # determine source(s) and destination - argc=$# - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dstpath="$1" - - # type check for destination - dstisdir=0 - if [ -d $dstpath ]; then - dstpath=`echo "$dstpath" | sed -e 's:/$::'` - dstisdir=1 - fi - - # consistency check for destination - if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then - echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 - shtool_exit 1 - fi - - # iterate over all source(s) - for src in $srcs; do - dst=$dstpath - - # if destination is a directory, append the input filename - if [ $dstisdir = 1 ]; then - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 - continue - fi - if [ -d "$src" ]; then - echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 - continue - fi - - # make a temp file name in the destination directory - dsttmp=`echo $dst |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ - -e "s;\$;/#INST@$$#;"` - - # verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || shtool_exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || shtool_exit $? - fi - - # adjust the target file - if [ ".$opt_e" != . ]; then - sed='sed' - OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" - for e - do - sed="$sed -e '$e'" - done - cp $dsttmp $dsttmp.old - chmod u+w $dsttmp - eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? - rm -f $dsttmp.old - fi - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || shtool_exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || shtool_exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 - fi - chgrp $opt_g $dsttmp || shtool_exit $? - fi - if [ ".$opt_m" != ".-" ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 - fi - chmod $opt_m $dsttmp || shtool_exit $? - fi - - # determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes - fi - fi - fi - - # finally, install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 - fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 - fi - rm -f $dst && mv $dsttmp $dst - fi - done - - shtool_exit 0 - ;; - -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2005 Ralf S. Engelschall - ## - - errstatus=0 - for p in ${1+"$@"}; do - # if the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then - echo "$msgprefix:Error: directory already exists: $p" 1>&2 - errstatus=1 - break - else - continue - fi - fi - # if the directory has to be created... - if [ ".$opt_p" = .no ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 - fi - mkdir $p || errstatus=$? - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $p" 1>&2 - fi - chown $opt_o $p || errstatus=$? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $p" 1>&2 - fi - chgrp $opt_g $p || errstatus=$? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $p" 1>&2 - fi - chmod $opt_m $p || errstatus=$? - fi - else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp='' - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $pathcomp" 1>&2 - fi - chown $opt_o $pathcomp || errstatus=$? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $pathcomp" 1>&2 - fi - chgrp $opt_g $pathcomp || errstatus=$? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done - fi - done - - shtool_exit $errstatus - ;; - -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-2005 Ralf S. Engelschall - ## - - namelist="$*" - - # check whether the test command supports the -x option - if [ -x /bin/sh ] 2>/dev/null; then - minusx="-x" - else - minusx="-r" - fi - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - shtool_exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - shtool_exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - shtool_exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile >/dev/null 2>&1 - touch $tmpfile - found=0 - pc=99 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - nc=99 - for name in perl perl5 miniperl; do - if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then - perl="$dir/$name" - pv=`$perl -e 'printf("%.3f", $]);'` - echo "$pv:$pc:$nc:$perl" >>$tmpfile - found=1 - fi - nc=`expr $nc - 1` - done - pc=`expr $pc - 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`" - rm -f $tmpfile >/dev/null 2>&1 - echo "$perl" - shtool_exit 0 - fi - rm -f $tmpfile >/dev/null 2>&1 - shtool_exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - echo >$tmpfile.c "#include " - echo >>$tmpfile.c "Syntax Error" - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile >/dev/null 2>&1 - rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1 - if [ ".$cpp" != . ]; then - echo "$cpp" - shtool_exit 0 - fi - shtool_exit 1 - fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" - fi - shtool_exit 0 - fi - done - done - - shtool_exit 1 - ;; - -esac - -shtool_exit 0 - diff --git a/buildconf b/buildconf deleted file mode 100755 index 468b7c65d2ca8..0000000000000 --- a/buildconf +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# $Id$ - -eval `grep '^EXTRA_VERSION=' configure.in` -case "$EXTRA_VERSION" in - *-dev) - dev=1 - ;; - *) - dev=0 - ;; -esac - -devok=0 -debug=no - -while test $# -gt 0; do - if test "$1" = "--copy"; then - automake_flags=--copy - fi - - if test "$1" = "--force"; then - devok=1 - echo "Forcing buildconf" - fi - - if test "$1" = "--debug"; then - debug=yes - fi - - shift -done - -if test "$dev" = "0" -a "$devok" = "0"; then - echo "You should not run buildconf in a release package." - echo "use buildconf --force to override this check." - exit 1 -fi - -if test -z "$ZENDDIR"; then - if grep "PHP_MAJOR_VERSION 6" main/php_version.h >/dev/null; then - v=5 - else - v=4 - fi - - if test "$v" = "5"; then - if test -r "Zend/OBJECTS2_HOWTO"; then - : - else - mv Zend ZendEngine1 2>/dev/null - mv ZendEngine2 Zend - fi - else - if test -r "Zend/zend_execute_globals.h"; then - : - else - mv Zend ZendEngine2 2>/dev/null - mv ZendEngine1 Zend - fi - fi - - ZENDDIR=Zend - echo "using default Zend directory" -fi - -rm -f generated_lists - -if test "$debug" = "yes"; then - ${MAKE:-make} -s -f build/build.mk AMFLAGS="$automake_flags" ZENDDIR="$ZENDDIR" SUPPRESS_WARNINGS="" -else - ${MAKE:-make} -s -f build/build.mk AMFLAGS="$automake_flags" ZENDDIR="$ZENDDIR" -fi diff --git a/buildconf.bat b/buildconf.bat deleted file mode 100644 index a21732604fa34..0000000000000 --- a/buildconf.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cscript /nologo win32\build\buildconf.js diff --git a/config.guess b/config.guess deleted file mode 100644 index 21a7ad8066e7a..0000000000000 --- a/config.guess +++ /dev/null @@ -1,1495 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-05-15' - -# This file 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*:MINGW*:* | i*:windows32*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/config.sub b/config.sub deleted file mode 100644 index 519f2cd0066c5..0000000000000 --- a/config.sub +++ /dev/null @@ -1,1570 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-05-12' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/configure.in b/configure.in deleted file mode 100644 index 55daba0e0927e..0000000000000 --- a/configure.in +++ /dev/null @@ -1,1456 +0,0 @@ - ## $Id$ -*- autoconf -*- -dnl ## Process this file with autoconf to produce a configure script. - -divert(1) - -dnl ## Diversion 1 is the autoconf + automake setup phase. We also -dnl ## set the PHP version, deal with platform-specific compile -dnl ## options and check for the basic compile tools. - -dnl ## Diversion 2 is the initial checking of OS features, programs, -dnl ## libraries and so on. - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - -dnl ## In diversion 4 we check user-configurable general settings. - -dnl ## In diversion 5 we check which extensions should be compiled. -dnl ## All of these are normally in the extension directories. -dnl ## Diversion 5 is the last one. Here we generate files and clean up. - -dnl include Zend specific macro definitions first -dnl ------------------------------------------------------------------------- -sinclude(Zend/acinclude.m4) - -dnl Basic autoconf + automake initialization, generation of config.nice. -dnl ------------------------------------------------------------------------- - -AC_PREREQ(2.13) -AC_INIT(README.CVS-RULES) - -PHP_CONFIG_NICE(config.nice) - -PHP_CANONICAL_HOST_TARGET - -AC_CONFIG_HEADER(main/php_config.h) - -MAJOR_VERSION=6 -MINOR_VERSION=0 -RELEASE_VERSION=0 -EXTRA_VERSION="-dev" -VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION" - -dnl Define where extension directories are located in the configure context -AC_DEFUN([PHP_EXT_BUILDDIR],[ext/$1])dnl -AC_DEFUN([PHP_EXT_DIR],[ext/$1])dnl -AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir/ext/$1])dnl -AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl - -dnl Setting up the PHP version based on the information above. -dnl ------------------------------------------------------------------------- - -PHP_VERSION=$VERSION -echo "/* automatically generated by configure */" > php_version.h.new -echo "/* edit configure.in to change version number */" >> php_version.h.new -echo "#define PHP_MAJOR_VERSION $MAJOR_VERSION" >> php_version.h.new -echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new -echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new -echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new -echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new -cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1 -if test $? -ne 0 ; then - rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \ - echo 'Updated main/php_version.h' -else - rm -f php_version.h.new -fi - - -dnl Catch common errors here to save a few seconds of our users' time -dnl ------------------------------------------------------------------------- - -if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then - AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the documentation for using APXS]) -fi - -if test -n "$with_apache" && test -n "$with_apxs"; then - AC_MSG_ERROR([--with-apache and --with-apxs cannot be used together]) -fi - -if test -n "$with_apxs2filter" && test -n "$with_apxs2"; then - AC_MSG_ERROR([--with-apxs2filter and --with-apxs2 cannot be used together]) -fi - - -dnl Settings we want to make before the checks. -dnl ------------------------------------------------------------------------- - -cwd=`pwd` - -php_shtool=$srcdir/build/shtool -T_MD=`$php_shtool echo -n -e %B` -T_ME=`$php_shtool echo -n -e %b` - -PHP_INIT_BUILD_SYSTEM - -dnl We want this one before the checks, so the checks can modify CFLAGS. -test -z "$CFLAGS" && auto_cflags=1 - -abs_srcdir=`(cd $srcdir; pwd)` -abs_builddir=`pwd` - -php_abs_top_srcdir=$abs_srcdir -php_abs_top_builddir=$abs_builddir - -dnl Because ``make install'' is often performed by the superuser, -dnl we create the libs subdirectory as the user who configures PHP. -dnl Otherwise, the current user will not be able to delete libs -dnl or the contents of libs. - -$php_shtool mkdir -p libs -rm -f libs/* - -dnl Checks for programs. -dnl ------------------------------------------------------------------------- - -AC_PROG_CC -AC_PROG_CC_C_O -dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf -dnl AC_PROG_CC_STDC -AC_PROG_CPP -AC_AIX -AC_PROG_LN_S - -dnl Support systems with system libraries in e.g. /usr/lib64 -AC_ARG_WITH(libdir, -[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], -[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib]) - -dnl check for -R, etc. switch -PHP_RUNPATH_SWITCH - -dnl Checks for some support/generator progs -PHP_PROG_RE2C -PHP_PROG_AWK -PHP_PROG_BISON -PHP_PROG_LEX - -dnl Platform-specific compile settings. -dnl ------------------------------------------------------------------------- - -dnl See bug #28605 -case $host_cpu in -alpha*) - if test "$GCC" = "yes"; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -ieee" - fi - ;; -esac - -case $host_alias in -*solaris*) - CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" - if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then - enable_libgcc=yes - fi - ;; -*dgux*) - CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";; -*darwin*|*rhapsody*) - CPPFLAGS="$CPPFLAGS -no-cpp-precomp" - AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) - php_multiple_shlib_versions_ok=yes;; -*beos*) - beos_threads=1 - LIBS="$LIBS -lbe -lroot";; -*mips*) - CPPFLAGS="$CPPFLAGS -D_XPG_IV";; -*hpux*) - if test "$GCC" = "yes"; then - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" - fi - ;; -*netware*) - PHP_BUILD_PROGRAM - PHP_ADD_SOURCES(/main, internal_functions.c,,PHP_GLOBAL_OBJS) - PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS, PHP_GLOBAL_OBJS) - PHP5LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\) - EXTENSION_DIR=sys:/php$MAJOR_VERSION/ext - PHP_SUBST(PHP5LIB_SHARED_LIBADD) - PHP_SHARED_MODULE(php5lib, PHP_GLOBAL_OBJS, netware) - ;; -esac - -# Disable PIC mode by default where it is known to be safe to do so, -# to avoid the performance hit from the lost register -AC_MSG_CHECKING([whether to force non-PIC code in shared modules]) -case $host_alias in -i?86-*-linux*|i?86-*-freebsd*) - if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then - with_pic=no - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; -*) AC_MSG_RESULT(no) ;; -esac - - -dnl Include Zend and TSRM configurations. -dnl ------------------------------------------------------------------------- - -sinclude(Zend/Zend.m4) -sinclude(TSRM/tsrm.m4) - - -divert(2) - -dnl ## Diversion 2 is where we set PHP-specific options and come up -dnl ## with reasonable default values for them. We check for pthreads here -dnl ## because the information is needed by the SAPI configuration. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - -dnl . -dnl ------------------------------------------------------------------------- - -PTHREADS_CHECK -PHP_HELP_SEPARATOR([SAPI modules:]) -PHP_SHLIB_SUFFIX_NAME -PHP_SAPI=default -PHP_BUILD_PROGRAM - - -dnl SAPI configuration. -dnl ------------------------------------------------------------------------- - -dnl paths to the targets are relative to the build directory -SAPI_SHARED=libs/libphp5.$SHLIB_SUFFIX_NAME -SAPI_STATIC=libs/libphp5.a -SAPI_LIBTOOL=libphp5.la - -PHP_CONFIGURE_PART(Configuring SAPI modules) - -esyscmd(./build/config-stubs sapi) - -dnl Show which main SAPI was selected -AC_MSG_CHECKING([for chosen SAPI module]) -AC_MSG_RESULT([$PHP_SAPI]) - -if test "$enable_maintainer_zts" = "yes"; then - PTHREADS_ASSIGN_VARS - PTHREADS_FLAGS -fi - -if test "$PHP_ENABLE_FASTCGI" = "yes"; then - PHP_CONFIGURE_PART(Running FastCGI checks) - sinclude(sapi/cgi/libfcgi/acinclude.m4) - sinclude(sapi/cgi/libfcgi/libfcgi.m4) -fi - -divert(3) - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. - - -dnl Starting system checks. -dnl ------------------------------------------------------------------------- - -PHP_CONFIGURE_PART(Running system checks) - -dnl Find sendmail binary -PHP_PROG_SENDMAIL - -dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset -PHP_EBCDIC - -dnl Check whether the system byte ordering is bigendian -PHP_C_BIGENDIAN - -dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary -dnl and source packages. This should be harmless on other OSs. -if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then - CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" - LDFLAGS="$LDFLAGS -L/usr/pkg/lib" -fi -test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib) - - -dnl First, library checks. -dnl ------------------------------------------------------------------------- - -dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try -dnl to avoid -lnsl checks, if we already have the functions which -dnl are usually in libnsl -dnl Also, uClibc will bark at linking with glibc's libnsl. - -PHP_CHECK_FUNC(socket, socket) -PHP_CHECK_FUNC(socketpair, socket) -PHP_CHECK_FUNC(htonl, socket) -PHP_CHECK_FUNC(gethostname, nsl) -PHP_CHECK_FUNC(gethostbyaddr, nsl) -PHP_CHECK_FUNC(yp_get_default_domain, nsl) - -PHP_CHECK_FUNC(dlopen, dl) -if test "$ac_cv_func_dlopen" = "yes"; then - AC_DEFINE(HAVE_LIBDL, 1, [ ]) -fi -AC_CHECK_LIB(m, sin) - -dnl Check for resolver routines. -dnl Need to check for both res_search and __res_search -dnl in -lc, -lbind, -lresolv and -lsocket -PHP_CHECK_FUNC(res_search, resolv, bind, socket) - -dnl Check for inet_aton and dn_skipname -dnl in -lc, -lbind and -lresolv -PHP_CHECK_FUNC(inet_aton, resolv, bind) -PHP_CHECK_FUNC(dn_skipname, resolv, bind) - - -dnl Then headers. -dnl ------------------------------------------------------------------------- - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_DIRENT - -dnl QNX requires unix.h to allow functions in libunix to work properly -AC_CHECK_HEADERS([ \ -inttypes.h \ -stdint.h \ -dirent.h \ -ApplicationServices/ApplicationServices.h \ -sys/param.h \ -sys/types.h \ -sys/time.h \ -netinet/in.h \ -alloca.h \ -arpa/inet.h \ -arpa/nameser.h \ -assert.h \ -crypt.h \ -fcntl.h \ -grp.h \ -ieeefp.h \ -langinfo.h \ -limits.h \ -locale.h \ -monetary.h \ -mach-o/dyld.h \ -netdb.h \ -pwd.h \ -resolv.h \ -signal.h \ -stdarg.h \ -stdlib.h \ -string.h \ -syslog.h \ -sysexits.h \ -sys/ioctl.h \ -sys/file.h \ -sys/mman.h \ -sys/mount.h \ -sys/poll.h \ -sys/resource.h \ -sys/select.h \ -sys/socket.h \ -sys/statfs.h \ -sys/statvfs.h \ -sys/vfs.h \ -sys/sysexits.h \ -sys/varargs.h \ -sys/wait.h \ -termios.h \ -unistd.h \ -unix.h \ -utime.h \ -sys/utsname.h \ -sys/ipc.h \ -dlfcn.h \ -assert.h -],[],[],[ -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -]) - -PHP_FOPENCOOKIE -PHP_BROKEN_GETCWD -PHP_BROKEN_GLIBC_FOPEN_APPEND - -dnl Checks for typedefs, structures, and compiler characteristics. -dnl ------------------------------------------------------------------------- - -AC_STRUCT_TM -AC_STRUCT_TIMEZONE - -PHP_MISSING_TIME_R_DECL -PHP_MISSING_FCLOSE_DECL - -PHP_TM_GMTOFF -PHP_STRUCT_FLOCK -PHP_SOCKLEN_T - -AC_CHECK_SIZEOF(intmax_t, 0) -AC_CHECK_SIZEOF(size_t, 8) -AC_CHECK_SIZEOF(ssize_t, 8) -AC_CHECK_SIZEOF(ptrdiff_t, 8) -AC_CHECK_SIZEOF(long long, 8) -AC_CHECK_SIZEOF(long long int, 8) -AC_CHECK_SIZEOF(long, 8) -AC_CHECK_SIZEOF(int, 4) - -dnl Check for members of the stat structure -AC_STRUCT_ST_BLKSIZE -dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists -dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument -if test "`uname -s 2>/dev/null`" != "QNX"; then - AC_STRUCT_ST_BLOCKS -else - AC_MSG_WARN([warnings level for cc set to 0]) - WARNING_LEVEL=0 -fi -AC_STRUCT_ST_RDEV - -dnl Checks for types -AC_TYPE_SIZE_T -AC_TYPE_UID_T - -dnl Checks for sockaddr_storage and sockaddr.sa_len -PHP_SOCKADDR_CHECKS - -dnl Check for IPv6 support -AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, -[AC_TRY_LINK([ #include -#include -#include ], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;], - [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])]) - -dnl Checks for library functions. -dnl ------------------------------------------------------------------------- - -AC_FUNC_VPRINTF -AC_CHECK_FUNCS( -alphasort \ -asctime_r \ -chroot \ -ctime_r \ -cuserid \ -crypt \ -flock \ -ftok \ -funopen \ -gai_strerror \ -gcvt \ -getlogin \ -getprotobyname \ -getprotobynumber \ -getservbyname \ -getservbyport \ -getrusage \ -gettimeofday \ -gmtime_r \ -grantpt \ -inet_ntoa \ -inet_ntop \ -inet_pton \ -isascii \ -link \ -localtime_r \ -lockf \ -lrand48 \ -memcpy \ -memmove \ -mkstemp \ -mmap \ -nl_langinfo \ -perror \ -poll \ -ptsname \ -putenv \ -realpath \ -random \ -rand_r \ -regcomp \ -res_search \ -scandir \ -setitimer \ -setlocale \ -localeconv \ -setpgid \ -setsockopt \ -setvbuf \ -shutdown \ -sin \ -snprintf \ -srand48 \ -srandom \ -statfs \ -statvfs \ -std_syslog \ -strcasecmp \ -strcoll \ -strdup \ -strerror \ -strftime \ -strptime \ -strstr \ -strtok_r \ -symlink \ -tempnam \ -tzset \ -unlockpt \ -unsetenv \ -usleep \ -nanosleep \ -utime \ -vsnprintf \ -) - -dnl Check for getaddrinfo, should be a better way, but... -dnl Also check for working getaddrinfo -AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo, -[AC_TRY_LINK([#include ], - [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);], - AC_TRY_RUN([ -#include -#include -#ifndef AF_INET -# include -#endif -int main(void) { - struct addrinfo *ai, *pai, hints; - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; - - if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) { - exit(1); - } - - if (ai == 0) { - exit(1); - } - - pai = ai; - - while (pai) { - if (pai->ai_family != AF_INET) { - /* 127.0.0.1/NUMERICHOST should only resolve ONE way */ - exit(1); - } - if (pai->ai_addr->sa_family != AF_INET) { - /* 127.0.0.1/NUMERICHOST should only resolve ONE way */ - exit(1); - } - pai = pai->ai_next; - } - freeaddrinfo(ai); - exit(0); -} - ],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no, ac_cv_func_getaddrinfo=no), -ac_cv_func_getaddrinfo=no)]) -if test "$ac_cv_func_getaddrinfo" = yes; then - AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function]) -fi - -AC_REPLACE_FUNCS(strlcat strlcpy getopt) -AC_FUNC_UTIME_NULL -AC_FUNC_ALLOCA -dnl PHP_AC_BROKEN_SPRINTF -dnl PHP_AC_BROKEN_SNPRINTF -PHP_DECLARED_TIMEZONE -PHP_TIME_R_TYPE -PHP_READDIR_R_TYPE -PHP_CHECK_IN_ADDR_T - -divert(4) - -dnl ## In diversion 4 we check user-configurable general settings. - -dnl General settings. -dnl ------------------------------------------------------------------------- -PHP_CONFIGURE_PART(General settings) - -PHP_HELP_SEPARATOR([General settings:]) -PHP_ARG_ENABLE(gcov, whether to include gcov symbols, -[ --enable-gcov Enable GCOV code coverage (requires LTP)], no, no) - -if test "$PHP_GCOV" = "yes"; then - AC_DEFUN([PHP_PROG_LTP],[ - - ltp_version_list="1.4" - - AC_CHECK_PROG(LTP, lcov, lcov) - AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml) - if test "$LTP"; then - AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [ - php_cv_ltp_version=invalid - ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'` - for ltp_check_version in $ltp_version_list; do - if test "$ltp_version" = "$ltp_check_version"; then - php_cv_ltp_version="$ltp_check_version (ok)" - fi - done - ]) - else - ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list" - AC_MSG_ERROR([$ltp_msg]) - fi - - case $php_cv_ltp_version in - ""|invalid[)] - ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)." - AC_MSG_ERROR([$ltp_msg]) - LTP="exit 0;" - ;; - esac - - if test "$LTP_GENHTML" = ""; then - AC_MSG_ERROR([Could not find genhtml from the LTP package]) - fi - - PHP_SUBST(LTP) - PHP_SUBST(LTP_GENHTML) - ]) - - PHP_PROG_LTP - AC_CHECK_LIB(gcov, __gcov_open, [ - PHP_ADD_LIBRARY(gcov) - AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov]) - CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage" - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov,$abs_srcdir) - ], [ - AC_MSG_ERROR([Problem with enabling gcov. Please check config.log for details.]) - ]) -fi - -PHP_ARG_ENABLE(debug, whether to include debugging symbols, -[ --enable-debug Compile with debugging symbols], no, no) - -if test "$PHP_DEBUG" = "yes"; then - PHP_DEBUG=1 - ZEND_DEBUG=yes -else - PHP_DEBUG=0 - ZEND_DEBUG=no -fi - -PHP_ARG_WITH(layout,[layout of installed files], -[ --with-layout=TYPE Set how installed files will be laid out. Type is - one of "PHP" or "GNU" [TYPE=PHP]], PHP, no) - -case $PHP_LAYOUT in - GNU) - oldstyleextdir=no - ;; - *) - oldstyleextdir=yes - ;; -esac - -PHP_ARG_WITH(config-file-path,[path to configuration file], -[ --with-config-file-path=PATH - Set the path in which to look for php.ini - [PREFIX/lib]], DEFAULT, no) - -if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then - case $PHP_LAYOUT in - GNU) - PHP_CONFIG_FILE_PATH=$sysconfdir - ;; - *) - PHP_CONFIG_FILE_PATH=$libdir - ;; - esac -fi - -PHP_ARG_WITH(config-file-scan-dir,[directory to be scanned for configuration files], -[ --with-config-file-scan-dir=PATH ], DEFAULT, no) -if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then - PHP_CONFIG_FILE_SCAN_DIR= -fi - -test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" - -PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default, -[ --enable-safe-mode Enable safe mode by default], no, no) - -if test "$PHP_SAFE_MODE" = "yes"; then - AC_DEFINE(PHP_SAFE_MODE,1,[ ]) -else - AC_DEFINE(PHP_SAFE_MODE,0,[ ]) -fi - -AC_MSG_CHECKING([for safe mode exec dir]) -AC_ARG_WITH(exec-dir, -[ --with-exec-dir[=DIR] Only allow executables in DIR under safe-mode - [/usr/local/php/bin]], -[ - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) - else - AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ]) - AC_MSG_RESULT([$withval]) - fi - else - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) - fi -],[ - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) -]) - -PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler, -[ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no) - -if test "$PHP_SIGCHILD" = "yes"; then - AC_DEFINE(PHP_SIGCHILD, 1, [ ]) -else - AC_DEFINE(PHP_SIGCHILD, 0, [ ]) -fi - -PHP_ARG_ENABLE(magic-quotes,whether to enable magic quotes by default, -[ --enable-magic-quotes Enable magic quotes by default.], no, no) - -if test "$PHP_MAGIC_QUOTES" = "yes"; then - AC_DEFINE(MAGIC_QUOTES, 1, [ ]) -else - AC_DEFINE(MAGIC_QUOTES, 0, [ ]) -fi - -PHP_ARG_ENABLE(rpath, whether to enable runpaths, -[ --disable-rpath Disable passing additional runtime library - search paths], yes, no) - -PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc, -[ --enable-libgcc Enable explicitly linking against libgcc], no, no) - -if test "$PHP_LIBGCC" = "yes"; then - PHP_LIBGCC_LIBPATH(gcc) - if test -z "$libgcc_libpath"; then - AC_MSG_ERROR([Cannot locate libgcc. Make sure that gcc is in your path]) - fi - PHP_ADD_LIBPATH($libgcc_libpath) - PHP_ADD_LIBRARY(gcc, yes) -fi - -PHP_ARG_ENABLE(short-tags,whether to enable short tags by default, -[ --disable-short-tags Disable the short-form /dev/null` -if test -z "$icu_install_prefix"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please specify the correct ICU install prefix.]) -else - AC_MSG_RESULT([found in $icu_install_prefix]) - - dnl Check ICU version - AC_MSG_CHECKING([for ICU 3.4 or greater]) - icu_version_full=`$ICU_CONFIG --version` - ac_IFS=$IFS - IFS="." - set $icu_version_full - IFS=$ac_IFS - icu_version=`expr [$]1 \* 1000 + [$]2` - AC_MSG_RESULT([found $icu_version_full]) - if test "$icu_version" -lt "3004"; then - AC_MSG_ERROR([ICU version 3.4 or later is required]) - fi - - ICU_INCS=`$ICU_CONFIG --cppflags-searchpath` - ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio` - PHP_EVAL_INCLINE($ICU_INCS) - PHP_EVAL_LIBLINE($ICU_LIBS) -fi - -divert(5) - -dnl ## In diversion 5 we check which extensions should be compiled. -dnl ## All of these are normally in the extension directories. - -dnl Extension configuration. -dnl ------------------------------------------------------------------------- - -PHP_HELP_SEPARATOR([Extensions: - - --with-EXTENSION=[shared[,PATH]] - - NOTE: Not all extensions can be build as 'shared'. - - Example: --with-foobar=shared,/usr/local/foobar/ - - o Builds the foobar extension as shared extension. - o foobar package install prefix is /usr/local/foobar/ -]) - -PHP_CONFIGURE_PART(Configuring extensions) - -dnl -dnl Check if all enabled by default extensions should be disabled -dnl - -AC_ARG_ENABLE(all, -[ --disable-all Disable all extensions which are enabled by default -], [ - PHP_ENABLE_ALL=$enableval -]) - -# reading config stubs -esyscmd(./build/config-stubs ext) - -dnl Extensions post-config -dnl ------------------------------------------------------------------------- - -if test "$PHP_VERSIONING" = "yes"; then - if test -n "$PHP_MODULES"; then - AC_MSG_ERROR([--enable-versioning cannot be used with shared modules]) - fi - test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym" - if test -f "$PHP_SYM_FILE"; then - EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE $EXTRA_LDFLAGS" - fi -fi - -enable_shared=yes -enable_static=yes - -case $php_build_target in -program|static) - standard_libtool_flag='-prefer-non-pic -static' - if test -z "$PHP_MODULES"; then - enable_shared=no - fi -;; -shared) - enable_static=no - case $with_pic in - yes) standard_libtool_flag='-prefer-pic';; - no) standard_libtool_flag='-prefer-non-pic';; - esac - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module" -;; -esac - -EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS" - -dnl this has to be here to prevent the openssl crypt() from -dnl overriding the system provided crypt(). -if test "$ac_cv_lib_crypt_crypt" = "yes"; then - EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt" -fi - -unset LIBS LDFLAGS - -dnl Configuring Zend and TSRM. -dnl ------------------------------------------------------------------------- - -PHP_HELP_SEPARATOR([Zend:]) -PHP_CONFIGURE_PART(Configuring Zend) - -LIBZEND_BASIC_CHECKS -LIBZEND_DLSYM_CHECK -LIBZEND_OTHER_CHECKS - -if test "$ZEND_MAINTAINER_ZTS" = "yes"; then - AC_DEFINE(ZTS,1,[ ]) - PHP_THREAD_SAFETY=yes -else - PHP_THREAD_SAFETY=no -fi - -INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM" -INCLUDES="$INCLUDES -I\$(top_builddir)/Zend" - -if test "$abs_srcdir" != "$abs_builddir"; then - INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend" - INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/" -fi - -ZEND_EXTRA_LIBS="$LIBS" -unset LIBS LDFLAGS - -PHP_HELP_SEPARATOR([TSRM:]) -PHP_CONFIGURE_PART(Configuring TSRM) -TSRM_BASIC_CHECKS -if test "$PHP_THREAD_SAFETY" = "yes"; then - TSRM_THREADS_CHECKS -fi - -EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS" -EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS" -EXTRA_LIBS="$EXTRA_LIBS $LIBS" -unset LIBS LDFLAGS - -test "$prefix" = "NONE" && prefix=/usr/local -test "$exec_prefix" = "NONE" && exec_prefix='${prefix}' -test "$program_prefix" = "NONE" && program_prefix= -test "$program_suffix" = "NONE" && program_suffix= - -case $libdir in - '${exec_prefix}/lib') - libdir=$libdir/php - ;; -esac -case $datadir in - '${prefix}/share') - datadir=$datadir/php - ;; - *) ;; -esac - -phplibdir=`pwd`/modules -$php_shtool mkdir -p $phplibdir -phptempdir=`pwd`/libs - -old_exec_prefix=$exec_prefix -old_libdir=$libdir -old_datadir=$datadir -exec_prefix=`eval echo $exec_prefix` -libdir=`eval echo $libdir` -datadir=`eval echo $datadir` - -dnl Build extension directory path - -ZEND_MODULE_API_NO=`$EGREP '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO //'` - -if test -z "$EXTENSION_DIR"; then - extbasedir=$ZEND_MODULE_API_NO - if test "$oldstyleextdir" = "yes"; then - if test "$PHP_DEBUG" = "1"; then - part1=debug - else - part1=no-debug - fi - if test "$enable_maintainer_zts" = "yes"; then - part2=zts - else - part2=non-zts - fi - extbasedir=$part1-$part2-$extbasedir - EXTENSION_DIR=$libdir/extensions/$extbasedir - else - if test "$enable_maintainer_zts" = "yes"; then - extbasedir=$extbasedir-zts - fi - - if test "$PHP_DEBUG" = "1"; then - extbasedir=$extbasedir-debug - fi - EXTENSION_DIR=$libdir/$extbasedir - fi -fi - -dnl Expand all directory names for use in macros/constants -EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR` -EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir` -EXPANDED_BINDIR=`eval echo $bindir` -EXPANDED_LIBDIR=$libdir -EXPANDED_SYSCONFDIR=`eval echo $sysconfdir` -EXPANDED_DATADIR=$datadir -EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"` -EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"` -INCLUDE_PATH=. - -exec_prefix=$old_exec_prefix -libdir=$old_libdir -datadir=$old_datadir - -AC_SUBST(INCLUDE_PATH) -AC_SUBST(EXPANDED_EXTENSION_DIR) -AC_SUBST(EXPANDED_BINDIR) -AC_SUBST(EXPANDED_LIBDIR) -AC_SUBST(EXPANDED_DATADIR) -AC_SUBST(EXPANDED_SYSCONFDIR) -AC_SUBST(EXPANDED_LOCALSTATEDIR) -AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH) -AC_SUBST(EXPANDED_PHP_CONFIG_FILE_SCAN_DIR) - -if test -n "$php_ldflags_add_usr_lib"; then - PHP_RPATHS="$PHP_RPATHS /usr/lib" -fi - -PHP_UTILIZE_RPATHS - -if test -z "$php_ldflags_add_usr_lib"; then - PHP_REMOVE_USR_LIB(PHP_LDFLAGS) - PHP_REMOVE_USR_LIB(LDFLAGS) -fi - -EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS" -EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS" - -PHP_BUILD_DATE=`date '+%Y-%m-%d'` -AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date]) - -case $host_alias in -*netware*) - PHP_OS="NetWare" - PHP_UNAME="NetWare" - AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[hardcode for each of the cross compiler host]) - AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[hardcode for each of the cross compiler host]) - ;; -*) - PHP_UNAME=`uname -a | xargs` - AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output]) - PHP_OS=`uname | xargs` - AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output]) - ;; -esac - -if test "$PHP_SAPI_CLI" != "no"; then - PHP_CLI_TARGET="\$(SAPI_CLI_PATH)" - PHP_INSTALL_CLI_TARGET="install-cli" - PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c getopt.c,, cli) -fi - -PHP_SUBST(PHP_CLI_TARGET) -PHP_SUBST(PHP_SAPI_OBJS) -PHP_SUBST(PHP_CLI_OBJS) -PHP_SUBST(PHP_GLOBAL_OBJS) - -PHP_SUBST(PHP_MODULES) - -PHP_SUBST(EXT_LIBS) - -PHP_SUBST_OLD(abs_builddir) -PHP_SUBST_OLD(abs_srcdir) -PHP_SUBST_OLD(php_abs_top_builddir) -PHP_SUBST_OLD(php_abs_top_srcdir) - -PHP_SUBST(bindir) -PHP_SUBST(exec_prefix) -PHP_SUBST_OLD(program_prefix) -PHP_SUBST_OLD(program_suffix) -PHP_SUBST(includedir) -PHP_SUBST(libdir) -PHP_SUBST(mandir) -PHP_SUBST(phplibdir) -PHP_SUBST(phptempdir) -PHP_SUBST(prefix) -PHP_SUBST(localstatedir) -PHP_SUBST(datadir) -PHP_SUBST(sysconfdir) - -PHP_SUBST(EXEEXT) -PHP_SUBST(CC) -PHP_SUBST(CFLAGS) -PHP_SUBST(CFLAGS_CLEAN) -PHP_SUBST(CPP) -PHP_SUBST(CPPFLAGS) -PHP_SUBST(CXX) -PHP_SUBST(CXXFLAGS) -PHP_SUBST(CXXFLAGS_CLEAN) -PHP_SUBST_OLD(DEBUG_CFLAGS) -PHP_SUBST_OLD(EXTENSION_DIR) -PHP_SUBST_OLD(EXTRA_LDFLAGS) -PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM) -PHP_SUBST_OLD(EXTRA_LIBS) -PHP_SUBST_OLD(ZEND_EXTRA_LIBS) -PHP_SUBST_OLD(INCLUDES) -PHP_SUBST_OLD(EXTRA_INCLUDES) -PHP_SUBST_OLD(INCLUDE_PATH) -PHP_SUBST_OLD(INSTALL_IT) -PHP_SUBST(LFLAGS) -PHP_SUBST(LIBTOOL) -PHP_SUBST(LN_S) -PHP_SUBST_OLD(NATIVE_RPATHS) -PHP_SUBST(PHP_BUILD_DATE) -PHP_SUBST_OLD(PHP_LDFLAGS) -PHP_SUBST_OLD(PHP_LIBS) -PHP_SUBST(OVERALL_TARGET) -PHP_SUBST(PHP_RPATHS) -PHP_SUBST(PHP_SAPI) -PHP_SUBST_OLD(PHP_VERSION) -PHP_SUBST(SHELL) -PHP_SUBST(SHARED_LIBTOOL) -PHP_SUBST(WARNING_LEVEL) -PHP_SUBST(PHP_FRAMEWORKS) -PHP_SUBST(PHP_FRAMEWORKPATH) -PHP_SUBST_OLD(SHLIB_SUFFIX_NAME) -PHP_SUBST(INSTALL_EXT_HEADERS) - -old_CC=$CC - -if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then - CXXFLAGS="$CXXFLAGS $ac_cv_pthreads_cflags" - INLINE_CFLAGS="$INLINE_CFLAGS $ac_cv_pthreads_cflags" - cat >meta_ccld<' > TSRM/tsrm_config.h - -test -d Zend || $php_shtool mkdir Zend - -cat >Zend/zend_config.h < -#if defined(APACHE) && defined(PHP_API_VERSION) -#undef HAVE_DLFCN_H -#endif -FEO - -# run this only when generating all the files? -if test -n "\$REDO_ALL"; then - # Hacking while airborne considered harmful. - # - echo "creating main/internal_functions.c" - extensions="$EXT_STATIC" -dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null - sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c - - echo "creating main/internal_functions_cli.c" - cli_extensions="$EXT_CLI_STATIC" - sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c - -dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then -dnl echo "main/internal_functions.c is unchanged" -dnl mv main/internal_functions.c.old main/internal_functions.c -dnl else -dnl rm -f main/internal_functions.c.old -dnl fi - - if test "$UNAME" = "FreeBSD" && test "$PHP_SAPI" = "apache2filter" && test "$TSRM_PTH" != "pth-config" ; then - echo "+--------------------------------------------------------------------+" - echo "| *** WARNING *** |" - echo "| |" - echo "| In order to build PHP as a Apache2 module on FreeBSD, you have to |" - echo "| add --with-tsrm-pth to your ./configure line. Therefore you need |" - echo "| to install gnu-pth from /usr/ports/devel/pth. |" - fi - - if test -n "$PHP_APXS_BROKEN"; then - echo "+--------------------------------------------------------------------+" - echo "| WARNING: Your $APXS script is most likely broken." - echo "| |" - echo "| Please go read http://www.php.net/faq.build#faq.build.apxs |" - echo "| and make the changes described there and try again. |" - fi - - # Warn about CGI version with no extra security options. - if test "$PHP_SAPI" = "cgi"; then - if test "$REDIRECT" = "0"; then - if test "$DISCARD_PATH" = "0"; then - echo "+--------------------------------------------------------------------+" - echo "| *** WARNING *** |" - echo "| |" - echo "| You will be compiling the CGI version of PHP without any |" - echo "| redirection checking. By putting this cgi binary somewhere in |" - echo "| your web space, users may be able to circumvent existing .htaccess |" - echo "| security by loading files directly through the parser. See |" - echo "| http://www.php.net/manual/security.php for more details. |" - fi - fi - fi - - - if test -n "$DEBUG_LOG"; then - rm -f config.cache -cat < processes when using a local Oracle-DB | -| please recompile PHP and specify --enable-sigchild when configuring| -| (This problem has been reported under Linux using Oracle >= 8.1.5) | -X - fi - fi - -cat < | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_BCMATH - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_bcmath.h" -#include "libbcmath/src/bcmath.h" - -ZEND_DECLARE_MODULE_GLOBALS(bcmath); - -function_entry bcmath_functions[] = { - PHP_FE(bcadd, NULL) - PHP_FE(bcsub, NULL) - PHP_FE(bcmul, NULL) - PHP_FE(bcdiv, NULL) - PHP_FE(bcmod, NULL) - PHP_FE(bcpow, NULL) - PHP_FE(bcsqrt, NULL) - PHP_FE(bcscale, NULL) - PHP_FE(bccomp, NULL) - PHP_FE(bcpowmod, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry bcmath_module_entry = { - STANDARD_MODULE_HEADER, - "bcmath", - bcmath_functions, - PHP_MINIT(bcmath), - PHP_MSHUTDOWN(bcmath), - PHP_RINIT(bcmath), - PHP_RSHUTDOWN(bcmath), - PHP_MINFO(bcmath), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_BCMATH -ZEND_GET_MODULE(bcmath) -#endif - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("bcmath.scale", "0", PHP_INI_ALL, OnUpdateLong, bc_precision, zend_bcmath_globals, bcmath_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_bcmath_init_globals - */ -static void php_bcmath_init_globals(zend_bcmath_globals *bcmath_globals) -{ - bcmath_globals->bc_precision = 0; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(bcmath) -{ - ZEND_INIT_MODULE_GLOBALS(bcmath, php_bcmath_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(bcmath) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(bcmath) -{ - bc_init_numbers(TSRMLS_C); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(bcmath) -{ - _bc_free_num_ex(&BCG(_zero_), 1); - _bc_free_num_ex(&BCG(_one_), 1); - _bc_free_num_ex(&BCG(_two_), 1); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(bcmath) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "BCMath support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_str2num - Convert to bc_num detecting scale */ -static void php_str2num(bc_num *num, char *str TSRMLS_DC) -{ - char *p; - - if (!(p = strchr(str, '.'))) { - bc_str2num(num, str, 0 TSRMLS_CC); - return; - } - - bc_str2num(num, str, strlen(p+1) TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale]) - Returns the sum of two arbitrary precision numbers */ -PHP_FUNCTION(bcadd) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_add (first, second, &result, scale); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsub(string left_operand, string right_operand [, int scale]) - Returns the difference between two arbitrary precision numbers */ -PHP_FUNCTION(bcsub) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_sub (first, second, &result, scale); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmul(string left_operand, string right_operand [, int scale]) - Returns the multiplication of two arbitrary precision numbers */ -PHP_FUNCTION(bcmul) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_multiply (first, second, &result, scale TSRMLS_CC); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale]) - Returns the quotient of two arbitrary precision numbers (division) */ -PHP_FUNCTION(bcdiv) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - switch (bc_divide(first, second, &result, scale TSRMLS_CC)) { - case 0: /* OK */ - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: /* division by zero */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmod(string left_operand, string right_operand) - Returns the modulus of the two arbitrary precision operands */ -PHP_FUNCTION(bcmod) -{ - zval **left, **right; - bc_num first, second, result; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - bc_str2num(&first, Z_STRVAL_PP(left), 0 TSRMLS_CC); - bc_str2num(&second, Z_STRVAL_PP(right), 0 TSRMLS_CC); - switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) { - case 0: - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcpowmod(string x, string y, string mod [, int scale]) - Returns the value of an arbitrary precision number raised to the power of another reduced by a modulous */ -PHP_FUNCTION(bcpowmod) -{ - char *left, *right, *modulous; - int left_len, right_len, modulous_len; - bc_num first, second, mod, result; - long scale = BCG(bc_precision); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) { - WRONG_PARAM_COUNT; - } - - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&mod TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, left TSRMLS_CC); - php_str2num(&second, right TSRMLS_CC); - php_str2num(&mod, modulous TSRMLS_CC); - bc_raisemod(first, second, mod, &result, scale TSRMLS_CC); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&mod); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcpow(string x, string y [, int scale]) - Returns the value of an arbitrary precision number raised to the power of another */ -PHP_FUNCTION(bcpow) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_raise (first, second, &result, scale TSRMLS_CC); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsqrt(string operand [, int scale]) - Returns the square root of an arbitray precision number */ -PHP_FUNCTION(bcsqrt) -{ - zval **left, **scale_param; - bc_num result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &left) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &left, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - bc_init_num(&result TSRMLS_CC); - php_str2num(&result, Z_STRVAL_PP(left) TSRMLS_CC); - if (bc_sqrt (&result, scale TSRMLS_CC) != 0) { - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number"); - } - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto int bccomp(string left_operand, string right_operand [, int scale]) - Compares two arbitrary precision numbers */ -PHP_FUNCTION(bccomp) -{ - zval **left, **right, **scale_param; - bc_num first, second; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) (Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - - bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC); - bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC); - Z_LVAL_P(return_value) = bc_compare(first, second); - Z_TYPE_P(return_value) = IS_LONG; - - bc_free_num(&first); - bc_free_num(&second); - return; -} -/* }}} */ - -/* {{{ proto bool bcscale(int scale) - Sets default scale parameter for all bc math functions */ -PHP_FUNCTION(bcscale) -{ - zval **new_scale; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_scale) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(new_scale); - BCG(bc_precision) = (Z_LVAL_PP(new_scale) < 0) ? 0 : Z_LVAL_PP(new_scale); - - RETURN_TRUE; -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4 deleted file mode 100644 index 3a4ad8c3b3dc0..0000000000000 --- a/ext/bcmath/config.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions, -[ --enable-bcmath Enable bc style precision math functions]) - -if test "$PHP_BCMATH" != "no"; then - PHP_NEW_EXTENSION(bcmath, bcmath.c \ -libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ -libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -libbcmath/src/rmzero.c libbcmath/src/str2num.c, - $ext_shared,,-I@ext_srcdir@/libbcmath/src) - PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src) - AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath]) -fi diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32 deleted file mode 100644 index 3579eadfae798..0000000000000 --- a/ext/bcmath/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); - -if (PHP_BCMATH == "yes") { - EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src"); - ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \ - outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \ - num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \ - nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath"); - - AC_DEFINE('HAVE_BCMATH', 1, 'Have BCMATH library'); -} diff --git a/ext/bcmath/libbcmath/AUTHORS b/ext/bcmath/libbcmath/AUTHORS deleted file mode 100644 index 982db9dc405e3..0000000000000 --- a/ext/bcmath/libbcmath/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Phil Nelson wrote bcmath library. - - diff --git a/ext/bcmath/libbcmath/COPYING.LIB b/ext/bcmath/libbcmath/COPYING.LIB deleted file mode 100644 index c4792dd27a32d..0000000000000 --- a/ext/bcmath/libbcmath/COPYING.LIB +++ /dev/null @@ -1,515 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. -^L - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. -^L - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -^L - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -^L - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -^L - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. -^L - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -^L - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS -^L - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper -mail. - -You should also get your employer (if you work as a programmer) or -your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James -Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/ext/bcmath/libbcmath/ChangeLog b/ext/bcmath/libbcmath/ChangeLog deleted file mode 100644 index b8d459a2bbfe0..0000000000000 --- a/ext/bcmath/libbcmath/ChangeLog +++ /dev/null @@ -1,10 +0,0 @@ -Wed Jun 7 09:39:02 2000 Phil Nelson - - * configure.in and many others: version number now at 0.2. - Many other changes/additions for getting a distribution - to work. - -2000-05-21 Phil Nelson - - * Initial setup of bcmath library., calling it version 0.1. - diff --git a/ext/bcmath/libbcmath/FAQ b/ext/bcmath/libbcmath/FAQ deleted file mode 100644 index 6499b1cffb53e..0000000000000 --- a/ext/bcmath/libbcmath/FAQ +++ /dev/null @@ -1,21 +0,0 @@ -BCMATH FAQ: - -1) Why BCMATH? - -The math routines of GNU bc become more generally useful in a -library form. By separating the BCMATH library from GNU bc, -GNU bc can be under the GPL and BCMATH can be under the LGPL. - -2) Why BCMATH when GMP exists? - -GMP has "integers" (no digits after a decimal), "rational numbers" -(stored as 2 integers) and "floats". None of these will correctly -represent a POSIX BC number. Floats are the closest, but will not -behave correctly for many computations. For example, BC numbers have -a "scale" that represent the number of digits to represent after the -decimal point. The multiplying two of these numbers requires one to -calculate an exact number of digits after the decimal point regardless -of the number of digits in the integer part. GMP floats have a -"fixed, but arbitrary" mantissa and so multiplying two floats will end -up dropping digits BC must calculate. - diff --git a/ext/bcmath/libbcmath/INSTALL b/ext/bcmath/libbcmath/INSTALL deleted file mode 100644 index 8893a0782735e..0000000000000 --- a/ext/bcmath/libbcmath/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -Currently, only libbcmath.a is built. To build and install it, do - - configure - make - make install - -Typical configure parameters are available. (e.g. PREFIX) - -Bugs and comments to philnelson@acm.org. diff --git a/ext/bcmath/libbcmath/Makefile.am b/ext/bcmath/libbcmath/Makefile.am deleted file mode 100644 index e5be8201b3110..0000000000000 --- a/ext/bcmath/libbcmath/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS= src doc - -MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h.in *~ - -dist-hook: - cp $(srcdir)/doc/bcmath.1 $(distdir)/doc - cp $(srcdir)/src/private.h $(distdir)/src - cp $(srcdir)/FAQ $(distdir) - diff --git a/ext/bcmath/libbcmath/NEWS b/ext/bcmath/libbcmath/NEWS deleted file mode 100644 index 431d7b315d17f..0000000000000 --- a/ext/bcmath/libbcmath/NEWS +++ /dev/null @@ -1,3 +0,0 @@ -NEWS for bcmath library: - - May 2000: The library is created. diff --git a/ext/bcmath/libbcmath/README b/ext/bcmath/libbcmath/README deleted file mode 100644 index cae5e5dc431d7..0000000000000 --- a/ext/bcmath/libbcmath/README +++ /dev/null @@ -1,9 +0,0 @@ -This is bcmath, a library of arbitrary precision math routines. -These routines, in a different form, are the routines that to -the arbitrary precision calculations for GNU bc and GNU dc. - -This library is provided to make these routines useful in a -larger context with less restrictions on the use of them. - -These routines do not duplicate functionality of the GNU gmp -library. gmp is similar, but the actual computation is different. diff --git a/ext/bcmath/libbcmath/acconfig.h b/ext/bcmath/libbcmath/acconfig.h deleted file mode 100644 index 4d301dcacf2a0..0000000000000 --- a/ext/bcmath/libbcmath/acconfig.h +++ /dev/null @@ -1,9 +0,0 @@ -/* PACKAGE name */ -#undef PACKAGE - -/* Package VERSION number */ -#undef VERSION - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - diff --git a/ext/bcmath/libbcmath/aclocal.m4 b/ext/bcmath/libbcmath/aclocal.m4 deleted file mode 100644 index e60c9eb55c786..0000000000000 --- a/ext/bcmath/libbcmath/aclocal.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 - -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff --git a/ext/bcmath/libbcmath/config.h.in b/ext/bcmath/libbcmath/config.h.in deleted file mode 100644 index 21cfb9255f9fb..0000000000000 --- a/ext/bcmath/libbcmath/config.h.in +++ /dev/null @@ -1,41 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - -/* Define if you have the header file. */ -#undef HAVE_LIB_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/ext/bcmath/libbcmath/configure b/ext/bcmath/libbcmath/configure deleted file mode 100644 index 026fd039c78d5..0000000000000 --- a/ext/bcmath/libbcmath/configure +++ /dev/null @@ -1,1859 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=doc/bcmath.1 - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:556: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:609: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE="bcmath" - -VERSION="0.2" - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:712: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:725: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:738: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:751: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:764: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:865: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 908 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:944: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1016: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1071: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1127: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -for ac_hdr in stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1210: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1247: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1322: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1426: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - -echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:1459: checking for ptrdiff_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_ptrdiff_t=yes -else - rm -rf conftest* - ac_cv_type_ptrdiff_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 -if test $ac_cv_type_ptrdiff_t = no; then - cat >> confdefs.h <<\EOF -#define ptrdiff_t size_t -EOF - -fi - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile src/Makefile doc/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@CPP@%$CPP%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - diff --git a/ext/bcmath/libbcmath/configure.in b/ext/bcmath/libbcmath/configure.in deleted file mode 100644 index 3da89e949f252..0000000000000 --- a/ext/bcmath/libbcmath/configure.in +++ /dev/null @@ -1,18 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(doc/bcmath.1) -AM_INIT_AUTOMAKE("bcmath", "0.2") -AM_CONFIG_HEADER(config.h) - -AC_PROG_CC - -AC_PROG_INSTALL -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h) -AC_C_CONST -AC_TYPE_SIZE_T -AC_CHECK_TYPE(ptrdiff_t, size_t) - -AC_OUTPUT(Makefile src/Makefile doc/Makefile) - diff --git a/ext/bcmath/libbcmath/install-sh b/ext/bcmath/libbcmath/install-sh deleted file mode 100644 index ab74c882e9233..0000000000000 --- a/ext/bcmath/libbcmath/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/ext/bcmath/libbcmath/missing b/ext/bcmath/libbcmath/missing deleted file mode 100644 index e4b838ca924dc..0000000000000 --- a/ext/bcmath/libbcmath/missing +++ /dev/null @@ -1,134 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program 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, or (at your option) -# any later version. - -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' - makeinfo touch the output file - yacc touch file \`y.tab.c'" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acinclude.m4' or \`configure.in'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`configure.in'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acconfig.h' or \`configure.in'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - touch config.h.in - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print \ - | sed 's/^\(.*\).am$/touch \1.in/' \ - | sh - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - your modified any \`.y' file. For being effective, your - modifications might require the \`Bison' package. Grab it from - any GNU archive site." - touch y.tab.c - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/ext/bcmath/libbcmath/mkinstalldirs b/ext/bcmath/libbcmath/mkinstalldirs deleted file mode 100644 index cc8783edce301..0000000000000 --- a/ext/bcmath/libbcmath/mkinstalldirs +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? - fi - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/ext/bcmath/libbcmath/src/Makefile.am b/ext/bcmath/libbcmath/src/Makefile.am deleted file mode 100644 index fab37d785e23b..0000000000000 --- a/ext/bcmath/libbcmath/src/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for bcmath library - -lib_LIBRARIES = libbcmath.a - -include_HEADERS = bcmath.h - -libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \ - init.c int2num.c nearzero.c neg.c num2long.c num2str.c output.c \ - raise.c raisemod.c recmul.c rmzero.c sqrt.c str2num.c sub.c zero.c \ - outofmem.c rt.c - -INCLUDES = -I$(srcdir) -I.. - -CFLAGS = @CFLAGS@ -CPPFLAGS = $(INCLUDES) -Wall - -MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h - -all: $(bin_LIBRARIES) - -clean: - rm -f $(OBJS) $(LIB) *~ diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c deleted file mode 100644 index 3b09af22b257d..0000000000000 --- a/ext/bcmath/libbcmath/src/add.c +++ /dev/null @@ -1,88 +0,0 @@ -/* add.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full add routine that takes care of negative numbers. - N1 is added to N2 and the result placed into RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_add (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num sum = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign == n2->n_sign) - { - sum = _bc_do_add (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); /* Compare magnitudes. */ - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - sum = _bc_do_sub (n2, n1, scale_min); - sum->n_sign = n2->n_sign; - break; - case 0: - /* They are equal! return zero with the correct scale! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - sum = bc_new_num (1, res_scale); - memset (sum->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - sum = _bc_do_sub (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = sum; -} - diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h deleted file mode 100644 index ce68f0da4e8ca..0000000000000 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ /dev/null @@ -1,162 +0,0 @@ -/* bcmath.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#ifndef _BCMATH_H_ -#define _BCMATH_H_ - -typedef enum {PLUS, MINUS} sign; - -typedef struct bc_struct *bc_num; - -typedef struct bc_struct - { - sign n_sign; - int n_len; /* The number of digits before the decimal point. */ - int n_scale; /* The number of digits after the decimal point. */ - int n_refs; /* The number of pointers to this number. */ - bc_num n_next; /* Linked list for available list. */ - char *n_ptr; /* The pointer to the actual storage. - If NULL, n_value points to the inside of - another number (bc_multiply...) and should - not be "freed." */ - char *n_value; /* The number. Not zero char terminated. - May not point to the same place as n_ptr as - in the case of leading zeros generated. */ - } bc_struct; - -#ifdef HAVE_CONFIG_H -#include "../../config.h" -#endif - -#include "php.h" -#include "../../php_bcmath.h" - -/* The base used in storing the numbers in n_value above. - Currently this MUST be 10. */ - -#define BASE 10 - -/* Some useful macros and constants. */ - -#define CH_VAL(c) (c - '0') -#define BCD_CHAR(d) (d + '0') - -#ifdef MIN -#undef MIN -#undef MAX -#endif -#define MAX(a, b) ((a)>(b)?(a):(b)) -#define MIN(a, b) ((a)>(b)?(b):(a)) -#define ODD(a) ((a)&1) - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 0x7ffffff -#endif - - -/* Function Prototypes */ - -/* Define the _PROTOTYPE macro if it is needed. */ - -#ifndef _PROTOTYPE -#ifdef __STDC__ -#define _PROTOTYPE(func, args) func args -#else -#define _PROTOTYPE(func, args) func() -#endif -#endif - -_PROTOTYPE(void bc_init_numbers, (TSRMLS_D)); - -_PROTOTYPE(bc_num _bc_new_num_ex, (int length, int scale, int persistent)); - -_PROTOTYPE(void _bc_free_num_ex, (bc_num *num, int persistent)); - -_PROTOTYPE(bc_num bc_copy_num, (bc_num num)); - -_PROTOTYPE(void bc_init_num, (bc_num *num TSRMLS_DC)); - -_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale TSRMLS_DC)); - -_PROTOTYPE(char *bc_num2str, (bc_num num)); - -_PROTOTYPE(void bc_int2num, (bc_num *num, int val)); - -_PROTOTYPE(long bc_num2long, (bc_num num)); - -_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2)); - -_PROTOTYPE(char bc_is_zero, (bc_num num TSRMLS_DC)); - -_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale)); - -_PROTOTYPE(char bc_is_neg, (bc_num num)); - -_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result, - int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot, - bc_num *rem, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod, - bc_num *result, int scale TSRMLS_DC)); - -_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result, - int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale TSRMLS_DC)); - -_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int), - int leading_zero TSRMLS_DC)); - -/* Prototypes needed for external utility routines. */ - -_PROTOTYPE(void bc_rt_warn, (char *mesg ,...)); -_PROTOTYPE(void bc_rt_error, (char *mesg ,...)); -_PROTOTYPE(void bc_out_of_memory, (void)); - -#define bc_new_num(length, scale) _bc_new_num_ex((length), (scale), 0) -#define bc_free_num(num) _bc_free_num_ex((num), 0) - -#endif diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c deleted file mode 100644 index 2f094a6917b72..0000000000000 --- a/ext/bcmath/libbcmath/src/compare.c +++ /dev/null @@ -1,161 +0,0 @@ -/* compare.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Compare two bc numbers. Return value is 0 if equal, -1 if N1 is less - than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just - compare the magnitudes. */ - - int -_bc_do_compare (n1, n2, use_sign, ignore_last) - bc_num n1, n2; - int use_sign; - int ignore_last; -{ - char *n1ptr, *n2ptr; - int count; - - /* First, compare signs. */ - if (use_sign && n1->n_sign != n2->n_sign) - { - if (n1->n_sign == PLUS) - return (1); /* Positive N1 > Negative N2 */ - else - return (-1); /* Negative N1 < Positive N1 */ - } - - /* Now compare the magnitude. */ - if (n1->n_len != n2->n_len) - { - if (n1->n_len > n2->n_len) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* If we get here, they have the same number of integer digits. - check the integer part and the equal length part of the fraction. */ - count = n1->n_len + MIN (n1->n_scale, n2->n_scale); - n1ptr = n1->n_value; - n2ptr = n2->n_value; - - while ((count > 0) && (*n1ptr == *n2ptr)) - { - n1ptr++; - n2ptr++; - count--; - } - if (ignore_last && count == 1 && n1->n_scale == n2->n_scale) - return (0); - if (count != 0) - { - if (*n1ptr > *n2ptr) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* They are equal up to the last part of the equal part of the fraction. */ - if (n1->n_scale != n2->n_scale) - { - if (n1->n_scale > n2->n_scale) - { - for (count = n1->n_scale-n2->n_scale; count>0; count--) - if (*n1ptr++ != 0) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - } - else - { - for (count = n2->n_scale-n1->n_scale; count>0; count--) - if (*n2ptr++ != 0) - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - } - - /* They must be equal! */ - return (0); -} - - -/* This is the "user callable" routine to compare numbers N1 and N2. */ - -int -bc_compare (n1, n2) - bc_num n1, n2; -{ - return _bc_do_compare (n1, n2, TRUE, FALSE); -} - diff --git a/ext/bcmath/libbcmath/src/config.h b/ext/bcmath/libbcmath/src/config.h deleted file mode 100644 index cc29a15f9594e..0000000000000 --- a/ext/bcmath/libbcmath/src/config.h +++ /dev/null @@ -1,10 +0,0 @@ -#if PHP_WIN32 -#include "../../../../main/config.w32.h" -#else -#include -#endif - -#include "php.h" -#include -#include "zend.h" -#include "zend_alloc.h" diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c deleted file mode 100644 index 52e4e044d5da8..0000000000000 --- a/ext/bcmath/libbcmath/src/debug.c +++ /dev/null @@ -1,69 +0,0 @@ -/* debug.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* pn prints the number NUM in base 10. */ - -static void -out_char (int c) -{ - putchar(c); -} - - -void -pn (bc_num num TSRMLS_DC) -{ - bc_out_num (num, 10, out_char, 0 TSRMLS_CC); - out_char ('\n'); -} - - -/* pv prints a character array as if it was a string of bcd digits. */ -void -pv (name, num, len) - char *name; - unsigned char *num; - int len; -{ - int i; - printf ("%s=", name); - for (i=0; i -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Some utility routines for the divide: First a one digit multiply. - NUM (with SIZE digits) is multiplied by DIGIT and the result is - placed into RESULT. It is written so that NUM and RESULT can be - the same pointers. */ - -static void -_one_mult (num, size, digit, result) - unsigned char *num; - int size, digit; - unsigned char *result; -{ - int carry, value; - unsigned char *nptr, *rptr; - - if (digit == 0) - memset (result, 0, size); - else - { - if (digit == 1) - memcpy (result, num, size); - else - { - /* Initialize */ - nptr = (unsigned char *) (num+size-1); - rptr = (unsigned char *) (result+size-1); - carry = 0; - - while (size-- > 0) - { - value = *nptr-- * digit + carry; - *rptr-- = value % BASE; - carry = value / BASE; - } - - if (carry != 0) *rptr = carry; - } - } -} - - -/* The full division routine. This computes N1 / N2. It returns - 0 if the division is ok and the result is in QUOT. The number of - digits after the decimal point is SCALE. It returns -1 if division - by zero is tried. The algorithm is found in Knuth Vol 2. p237. */ - -int -bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC) -{ - bc_num qval; - unsigned char *num1, *num2; - unsigned char *ptr1, *ptr2, *n2ptr, *qptr; - int scale1, val; - unsigned int len1, len2, scale2, qdigits, extra, count; - unsigned int qdig, qguess, borrow, carry; - unsigned char *mval; - char zero; - unsigned int norm; - - /* Test for divide by zero. */ - if (bc_is_zero (n2 TSRMLS_CC)) return -1; - - /* Test for divide by 1. If it is we must truncate. */ - if (n2->n_scale == 0) - { - if (n2->n_len == 1 && *n2->n_value == 1) - { - qval = bc_new_num (n1->n_len, scale); - qval->n_sign = (n1->n_sign == n2->n_sign ? PLUS : MINUS); - memset (&qval->n_value[n1->n_len],0,scale); - memcpy (qval->n_value, n1->n_value, - n1->n_len + MIN(n1->n_scale,scale)); - bc_free_num (quot); - *quot = qval; - } - } - - /* Set up the divide. Move the decimal point on n1 by n2's scale. - Remember, zeros on the end of num2 are wasted effort for dividing. */ - scale2 = n2->n_scale; - n2ptr = (unsigned char *) n2->n_value+n2->n_len+scale2-1; - while ((scale2 > 0) && (*n2ptr-- == 0)) scale2--; - - len1 = n1->n_len + scale2; - scale1 = n1->n_scale - scale2; - if (scale1 < scale) - extra = scale - scale1; - else - extra = 0; - num1 = (unsigned char *) emalloc (n1->n_len+n1->n_scale+extra+2); - if (num1 == NULL) bc_out_of_memory(); - memset (num1, 0, n1->n_len+n1->n_scale+extra+2); - memcpy (num1+1, n1->n_value, n1->n_len+n1->n_scale); - - len2 = n2->n_len + scale2; - num2 = (unsigned char *) emalloc (len2+1); - if (num2 == NULL) bc_out_of_memory(); - memcpy (num2, n2->n_value, len2); - *(num2+len2) = 0; - n2ptr = num2; - while (*n2ptr == 0) - { - n2ptr++; - len2--; - } - - /* Calculate the number of quotient digits. */ - if (len2 > len1+scale) - { - qdigits = scale+1; - zero = TRUE; - } - else - { - zero = FALSE; - if (len2>len1) - qdigits = scale+1; /* One for the zero integer part. */ - else - qdigits = len1-len2+scale+1; - } - - /* Allocate and zero the storage for the quotient. */ - qval = bc_new_num (qdigits-scale,scale); - memset (qval->n_value, 0, qdigits); - - /* Allocate storage for the temporary storage mval. */ - mval = (unsigned char *) emalloc (len2+1); - if (mval == NULL) bc_out_of_memory (); - - /* Now for the full divide algorithm. */ - if (!zero) - { - /* Normalize */ - norm = 10 / ((int)*n2ptr + 1); - if (norm != 1) - { - _one_mult (num1, len1+scale1+extra+1, norm, num1); - _one_mult (n2ptr, len2, norm, n2ptr); - } - - /* Initialize divide loop. */ - qdig = 0; - if (len2 > len1) - qptr = (unsigned char *) qval->n_value+len2-len1; - else - qptr = (unsigned char *) qval->n_value; - - /* Loop */ - while (qdig <= len1+scale-len2) - { - /* Calculate the quotient digit guess. */ - if (*n2ptr == num1[qdig]) - qguess = 9; - else - qguess = (num1[qdig]*10 + num1[qdig+1]) / *n2ptr; - - /* Test qguess. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - { - qguess--; - /* And again. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - qguess--; - } - - /* Multiply and subtract. */ - borrow = 0; - if (qguess != 0) - { - *mval = 0; - _one_mult (n2ptr, len2, qguess, mval+1); - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) mval+len2; - for (count = 0; count < len2+1; count++) - { - val = (int) *ptr1 - (int) *ptr2-- - borrow; - if (val < 0) - { - val += 10; - borrow = 1; - } - else - borrow = 0; - *ptr1-- = val; - } - } - - /* Test for negative result. */ - if (borrow == 1) - { - qguess--; - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) n2ptr+len2-1; - carry = 0; - for (count = 0; count < len2; count++) - { - val = (int) *ptr1 + (int) *ptr2-- + carry; - if (val > 9) - { - val -= 10; - carry = 1; - } - else - carry = 0; - *ptr1-- = val; - } - if (carry == 1) *ptr1 = (*ptr1 + 1) % 10; - } - - /* We now know the quotient digit. */ - *qptr++ = qguess; - qdig++; - } - } - - /* Clean up and return the number. */ - qval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - if (bc_is_zero (qval TSRMLS_CC)) qval->n_sign = PLUS; - _bc_rm_leading_zeros (qval); - bc_free_num (quot); - *quot = qval; - - /* Clean up temporary storage. */ - efree (mval); - efree (num1); - efree (num2); - - return 0; /* Everything is OK. */ -} - diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c deleted file mode 100644 index 2949bd10d4ae8..0000000000000 --- a/ext/bcmath/libbcmath/src/divmod.c +++ /dev/null @@ -1,87 +0,0 @@ -/* divmod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Division *and* modulo for numbers. This computes both NUM1 / NUM2 and - NUM1 % NUM2 and puts the results in QUOT and REM, except that if QUOT - is NULL then that store will be omitted. - */ - -int -bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC) -{ - bc_num quotient = NULL; - bc_num temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero (num2 TSRMLS_CC)) return -1; - - /* Calculate final scale. */ - rscale = MAX (num1->n_scale, num2->n_scale+scale); - bc_init_num(&temp TSRMLS_CC); - - /* Calculate it. */ - bc_divide (num1, num2, &temp, scale TSRMLS_CC); - if (quot) - quotient = bc_copy_num (temp); - bc_multiply (temp, num2, &temp, rscale TSRMLS_CC); - bc_sub (num1, temp, rem, rscale); - bc_free_num (&temp); - - if (quot) - { - bc_free_num (quot); - *quot = quotient; - } - - return 0; /* Everything is OK. */ -} - - -/* Modulo for numbers. This computes NUM1 % NUM2 and puts the - result in RESULT. */ - -int -bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC) -{ - return bc_divmod (num1, num2, NULL, result, scale TSRMLS_CC); -} - diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c deleted file mode 100644 index 5458fc5dfc4b5..0000000000000 --- a/ext/bcmath/libbcmath/src/doaddsub.c +++ /dev/null @@ -1,232 +0,0 @@ -/* doaddsub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Perform addition: N1 is added to N2 and the value is - returned. The signs of N1 and N2 are ignored. - SCALE_MIN is to set the minimum scale of the result. */ - - bc_num -_bc_do_add (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num sum; - int sum_scale, sum_digits; - char *n1ptr, *n2ptr, *sumptr; - int carry, n1bytes, n2bytes; - int count; - - /* Prepare sum. */ - sum_scale = MAX (n1->n_scale, n2->n_scale); - sum_digits = MAX (n1->n_len, n2->n_len) + 1; - sum = bc_new_num (sum_digits, MAX(sum_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > sum_scale) - { - sumptr = (char *) (sum->n_value + sum_scale + sum_digits); - for (count = scale_min - sum_scale; count > 0; count--) - *sumptr++ = 0; - } - - /* Start with the fraction part. Initialize the pointers. */ - n1bytes = n1->n_scale; - n2bytes = n2->n_scale; - n1ptr = (char *) (n1->n_value + n1->n_len + n1bytes - 1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2bytes - 1); - sumptr = (char *) (sum->n_value + sum_scale + sum_digits - 1); - - /* Add the fraction part. First copy the longer fraction.*/ - if (n1bytes != n2bytes) - { - if (n1bytes > n2bytes) - while (n1bytes>n2bytes) - { *sumptr-- = *n1ptr--; n1bytes--;} - else - while (n2bytes>n1bytes) - { *sumptr-- = *n2ptr--; n2bytes--;} - } - - /* Now add the remaining fraction part and equal size integer parts. */ - n1bytes += n1->n_len; - n2bytes += n2->n_len; - carry = 0; - while ((n1bytes > 0) && (n2bytes > 0)) - { - *sumptr = *n1ptr-- + *n2ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - n1bytes--; - n2bytes--; - } - - /* Now add carry the longer integer part. */ - if (n1bytes == 0) - { n1bytes = n2bytes; n1ptr = n2ptr; } - while (n1bytes-- > 0) - { - *sumptr = *n1ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - } - - /* Set final carry. */ - if (carry == 1) - *sumptr += 1; - - /* Adjust sum and return. */ - _bc_rm_leading_zeros (sum); - return sum; -} - - -/* Perform subtraction: N2 is subtracted from N1 and the value is - returned. The signs of N1 and N2 are ignored. Also, N1 is - assumed to be larger than N2. SCALE_MIN is the minimum scale - of the result. */ - - bc_num -_bc_do_sub (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num diff; - int diff_scale, diff_len; - int min_scale, min_len; - char *n1ptr, *n2ptr, *diffptr; - int borrow, count, val; - - /* Allocate temporary storage. */ - diff_len = MAX (n1->n_len, n2->n_len); - diff_scale = MAX (n1->n_scale, n2->n_scale); - min_len = MIN (n1->n_len, n2->n_len); - min_scale = MIN (n1->n_scale, n2->n_scale); - diff = bc_new_num (diff_len, MAX(diff_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > diff_scale) - { - diffptr = (char *) (diff->n_value + diff_len + diff_scale); - for (count = scale_min - diff_scale; count > 0; count--) - *diffptr++ = 0; - } - - /* Initialize the subtract. */ - n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale -1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale -1); - diffptr = (char *) (diff->n_value + diff_len + diff_scale -1); - - /* Subtract the numbers. */ - borrow = 0; - - /* Take care of the longer scaled number. */ - if (n1->n_scale != min_scale) - { - /* n1 has the longer scale */ - for (count = n1->n_scale - min_scale; count > 0; count--) - *diffptr-- = *n1ptr--; - } - else - { - /* n2 has the longer scale */ - for (count = n2->n_scale - min_scale; count > 0; count--) - { - val = - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Now do the equal length scale and integer parts. */ - - for (count = 0; count < min_len + min_scale; count++) - { - val = *n1ptr-- - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - - /* If n1 has more digits then n2, we now do that subtract. */ - if (diff_len != min_len) - { - for (count = diff_len - min_len; count > 0; count--) - { - val = *n1ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Clean up and return. */ - _bc_rm_leading_zeros (diff); - return diff; -} - diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c deleted file mode 100644 index cd45b9fbc1862..0000000000000 --- a/ext/bcmath/libbcmath/src/init.c +++ /dev/null @@ -1,131 +0,0 @@ -/* init.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -#if SANDER_0 - bc_num _bc_Free_list = NULL; -#endif - -/* new_num allocates a number and sets fields to known values. */ - -bc_num -_bc_new_num_ex (length, scale, persistent) - int length, scale, persistent; -{ - bc_num temp; - - /* PHP Change: malloc() -> pemalloc(), removed free_list code */ - temp = (bc_num) pemalloc (sizeof(bc_struct)+length+scale, persistent); -#if 0 - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { - temp = (bc_num) pemalloc (sizeof(bc_struct), persistent); - if (temp == NULL) bc_out_of_memory (); - } -#endif - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - /* PHP Change: malloc() -> pemalloc() */ - temp->n_ptr = (char *) pemalloc (length+scale, persistent); - if (temp->n_ptr == NULL) bc_out_of_memory(); - temp->n_value = temp->n_ptr; - memset (temp->n_ptr, 0, length+scale); - return temp; -} - - -/* "Frees" a bc_num NUM. Actually decreases reference count and only - frees the storage if reference count is zero. */ - -void -_bc_free_num_ex (num, persistent) - bc_num *num; - int persistent; -{ - if (*num == NULL) return; - (*num)->n_refs--; - if ((*num)->n_refs == 0) { - if ((*num)->n_ptr) - /* PHP Change: free() -> pefree(), removed free_list code */ - pefree ((*num)->n_ptr, persistent); - pefree(*num, persistent); -#if 0 - (*num)->n_next = _bc_Free_list; - _bc_Free_list = *num; -#endif - } - *num = NULL; -} - - -/* Intitialize the number package! */ - -void -bc_init_numbers (TSRMLS_D) -{ - BCG(_zero_) = _bc_new_num_ex (1,0,1); - BCG(_one_) = _bc_new_num_ex (1,0,1); - BCG(_one_)->n_value[0] = 1; - BCG(_two_) = _bc_new_num_ex (1,0,1); - BCG(_two_)->n_value[0] = 2; -} - - -/* Make a copy of a number! Just increments the reference count! */ - -bc_num -bc_copy_num (bc_num num) -{ - num->n_refs++; - return num; -} - - -/* Initialize a number NUM by making it a copy of zero. */ - -void -bc_init_num (bc_num *num TSRMLS_DC) -{ - *num = bc_copy_num (BCG(_zero_)); -} - diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c deleted file mode 100644 index 34419c138f06f..0000000000000 --- a/ext/bcmath/libbcmath/src/int2num.c +++ /dev/null @@ -1,84 +0,0 @@ -/* int2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Convert an integer VAL to a bc number NUM. */ - -void -bc_int2num (num, val) - bc_num *num; - int val; -{ - char buffer[30]; - char *bptr, *vptr; - int ix = 1; - char neg = 0; - - /* Sign. */ - if (val < 0) - { - neg = 1; - val = -val; - } - - /* Get things going. */ - bptr = buffer; - *bptr++ = val % BASE; - val = val / BASE; - - /* Extract remaining digits. */ - while (val != 0) - { - *bptr++ = val % BASE; - val = val / BASE; - ix++; /* Count the digits. */ - } - - /* Make the number. */ - bc_free_num (num); - *num = bc_new_num (ix, 0); - if (neg) (*num)->n_sign = MINUS; - - /* Assign the digits. */ - vptr = (*num)->n_value; - while (ix-- > 0) - *vptr++ = *--bptr; -} - diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c deleted file mode 100644 index ae16b65d8a605..0000000000000 --- a/ext/bcmath/libbcmath/src/nearzero.c +++ /dev/null @@ -1,69 +0,0 @@ -/* nearzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is almost zero. - Specifically, all but the last digit is 0 and the last digit is 1. - Last digit is defined by scale. */ - -char -bc_is_near_zero (num, scale) - bc_num num; - int scale; -{ - int count; - char *nptr; - - /* Error checking */ - if (scale > num->n_scale) - scale = num->n_scale; - - /* Initialize */ - count = num->n_len + scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0 && (count != 1 || *--nptr != 1)) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c deleted file mode 100644 index c864d77f1d9aa..0000000000000 --- a/ext/bcmath/libbcmath/src/neg.c +++ /dev/null @@ -1,49 +0,0 @@ -/* neg.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number is negative. */ - -char -bc_is_neg (num) - bc_num num; -{ - return num->n_sign == MINUS; -} - diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c deleted file mode 100644 index 0a6e0836ad43f..0000000000000 --- a/ext/bcmath/libbcmath/src/num2long.c +++ /dev/null @@ -1,70 +0,0 @@ -/* num2long.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a number NUM to a long. The function returns only the integer - part of the number. For numbers that are too large to represent as - a long, this function returns a zero. This can be detected by checking - the NUM for zero after having a zero returned. */ - -long -bc_num2long (num) - bc_num num; -{ - long val; - char *nptr; - int index; - - /* Extract the int value, ignore the fraction. */ - val = 0; - nptr = num->n_value; - for (index=num->n_len; (index>0) && (val<=(LONG_MAX/BASE)); index--) - val = val*BASE + *nptr++; - - /* Check for overflow. If overflow, return zero. */ - if (index>0) val = 0; - if (val < 0) val = 0; - - /* Return the value. */ - if (num->n_sign == PLUS) - return (val); - else - return (-val); -} - diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c deleted file mode 100644 index c47ec9bbad5c1..0000000000000 --- a/ext/bcmath/libbcmath/src/num2str.c +++ /dev/null @@ -1,79 +0,0 @@ -/* num2str.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a numbers to a string. Base 10 only.*/ - -char -*bc_num2str (num) - bc_num num; -{ - char *str, *sptr; - char *nptr; - int index, signch; - - /* Allocate the string memory. */ - signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */ - if (num->n_scale > 0) - str = (char *) emalloc (num->n_len + num->n_scale + 2 + signch); - else - str = (char *) emalloc (num->n_len + 1 + signch); - if (str == NULL) bc_out_of_memory(); - - /* The negative sign if needed. */ - sptr = str; - if (signch) *sptr++ = '-'; - - /* Load the whole number. */ - nptr = num->n_value; - for (index=num->n_len; index>0; index--) - *sptr++ = BCD_CHAR(*nptr++); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - *sptr++ = '.'; - for (index=0; indexn_scale; index++) - *sptr++ = BCD_CHAR(*nptr++); - } - - /* Terminate the string and return it! */ - *sptr = '\0'; - return (str); -} diff --git a/ext/bcmath/libbcmath/src/outofmem.c b/ext/bcmath/libbcmath/src/outofmem.c deleted file mode 100644 index 799a32d2ae6c5..0000000000000 --- a/ext/bcmath/libbcmath/src/outofmem.c +++ /dev/null @@ -1,46 +0,0 @@ -/* outofmem.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_out_of_memory (void) -{ - (void) fprintf (stderr, "bcmath: out of memory!\n"); - exit (1); -} diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c deleted file mode 100644 index ab49b0e366137..0000000000000 --- a/ext/bcmath/libbcmath/src/output.c +++ /dev/null @@ -1,208 +0,0 @@ -/* output.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* The following routines provide output for bcd numbers package - using the rules of POSIX bc for output. */ - -/* This structure is used for saving digits in the conversion process. */ -typedef struct stk_rec { - long digit; - struct stk_rec *next; -} stk_rec; - -/* The reference string for digits. */ -static char ref_str[] = "0123456789ABCDEF"; - - -/* A special output routine for "multi-character digits." Exactly - SIZE characters must be output for the value VAL. If SPACE is - non-zero, we must output one space before the number. OUT_CHAR - is the actual routine for writing the characters. */ - -void -bc_out_long (val, size, space, out_char) - long val; - int size, space; -#ifdef __STDC__ - void (*out_char)(int); -#else - void (*out_char)(); -#endif -{ - char digits[40]; - int len, ix; - - if (space) (*out_char) (' '); - sprintf (digits, "%ld", val); - len = strlen (digits); - while (size > len) - { - (*out_char) ('0'); - size--; - } - for (ix=0; ix < len; ix++) - (*out_char) (digits[ix]); -} - -/* Output of a bcd number. NUM is written in base O_BASE using OUT_CHAR - as the routine to do the actual output of the characters. */ - -void -#ifdef __STDC__ -bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero TSRMLS_DC) -#else -bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_DC) -#endif -{ - char *nptr; - int index, fdigit, pre_space; - stk_rec *digits, *temp; - bc_num int_part, frac_part, base, cur_dig, t_num, max_o_digit; - - /* The negative sign if needed. */ - if (num->n_sign == MINUS) (*out_char) ('-'); - - /* Output the number. */ - if (bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - else - if (o_base == 10) - { - /* The number is in base 10, do it the fast way. */ - nptr = num->n_value; - if (num->n_len > 1 || *nptr != 0) - for (index=num->n_len; index>0; index--) - (*out_char) (BCD_CHAR(*nptr++)); - else - nptr++; - - if (leading_zero && bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - for (index=0; indexn_scale; index++) - (*out_char) (BCD_CHAR(*nptr++)); - } - } - else - { - /* special case ... */ - if (leading_zero && bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - - /* The number is some other base. */ - digits = NULL; - bc_init_num (&int_part TSRMLS_CC); - bc_divide (num, BCG(_one_), &int_part, 0 TSRMLS_CC); - bc_init_num (&frac_part TSRMLS_CC); - bc_init_num (&cur_dig TSRMLS_CC); - bc_init_num (&base TSRMLS_CC); - bc_sub (num, int_part, &frac_part, 0); - /* Make the INT_PART and FRAC_PART positive. */ - int_part->n_sign = PLUS; - frac_part->n_sign = PLUS; - bc_int2num (&base, o_base); - bc_init_num (&max_o_digit TSRMLS_CC); - bc_int2num (&max_o_digit, o_base-1); - - - /* Get the digits of the integer part and push them on a stack. */ - while (!bc_is_zero (int_part TSRMLS_CC)) - { - bc_modulo (int_part, base, &cur_dig, 0 TSRMLS_CC); - /* PHP Change: malloc() -> emalloc() */ - temp = (stk_rec *) emalloc (sizeof(stk_rec)); - if (temp == NULL) bc_out_of_memory(); - temp->digit = bc_num2long (cur_dig); - temp->next = digits; - digits = temp; - bc_divide (int_part, base, &int_part, 0 TSRMLS_CC); - } - - /* Print the digits on the stack. */ - if (digits != NULL) - { - /* Output the digits. */ - while (digits != NULL) - { - temp = digits; - digits = digits->next; - if (o_base <= 16) - (*out_char) (ref_str[ (int) temp->digit]); - else - bc_out_long (temp->digit, max_o_digit->n_len, 1, out_char); - efree (temp); - } - } - - /* Get and print the digits of the fraction part. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - pre_space = 0; - t_num = bc_copy_num (BCG(_one_)); - while (t_num->n_len <= num->n_scale) { - bc_multiply (frac_part, base, &frac_part, num->n_scale TSRMLS_CC); - fdigit = bc_num2long (frac_part); - bc_int2num (&int_part, fdigit); - bc_sub (frac_part, int_part, &frac_part, 0); - if (o_base <= 16) - (*out_char) (ref_str[fdigit]); - else { - bc_out_long (fdigit, max_o_digit->n_len, pre_space, out_char); - pre_space = 1; - } - bc_multiply (t_num, base, &t_num, 0 TSRMLS_CC); - } - bc_free_num (&t_num); - } - - /* Clean up. */ - bc_free_num (&int_part); - bc_free_num (&frac_part); - bc_free_num (&base); - bc_free_num (&cur_dig); - bc_free_num (&max_o_digit); - } -} diff --git a/ext/bcmath/libbcmath/src/private.h b/ext/bcmath/libbcmath/src/private.h deleted file mode 100644 index f8f1048ab7831..0000000000000 --- a/ext/bcmath/libbcmath/src/private.h +++ /dev/null @@ -1,43 +0,0 @@ -/* private.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -/* "Private" routines to bcmath. */ - -/* variables */ -#if SANDER_0 -extern bc_num _bc_Free_list; -#endif - -/* routines */ -int _bc_do_compare (bc_num n1, bc_num n2, int use_sign, int ignore_last); -bc_num _bc_do_add (bc_num n1, bc_num n2, int scale_min); -bc_num _bc_do_sub (bc_num n1, bc_num n2, int scale_min); -void _bc_rm_leading_zeros (bc_num num); diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c deleted file mode 100644 index f2f4f4a1d7770..0000000000000 --- a/ext/bcmath/libbcmath/src/raise.c +++ /dev/null @@ -1,124 +0,0 @@ -/* raise.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Raise NUM1 to the NUM2 power. The result is placed in RESULT. - Maximum exponent is LONG_MAX. If a NUM2 is not an integer, - only the integer part is used. */ - -void -bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC) -{ - bc_num temp, power; - long exponent; - int rscale; - int pwrscale; - int calcscale; - char neg; - - /* Check the exponent for scale digits and convert to a long. */ - if (num2->n_scale != 0) - bc_rt_warn ("non-zero scale in exponent"); - exponent = bc_num2long (num2); - if (exponent == 0 && (num2->n_len > 1 || num2->n_value[0] != 0)) - bc_rt_error ("exponent too large in raise"); - - /* Special case if exponent is a zero. */ - if (exponent == 0) - { - bc_free_num (result); - *result = bc_copy_num (BCG(_one_)); - return; - } - - /* Other initializations. */ - if (exponent < 0) - { - neg = TRUE; - exponent = -exponent; - rscale = scale; - } - else - { - neg = FALSE; - rscale = MIN (num1->n_scale*exponent, MAX(scale, num1->n_scale)); - } - - /* Set initial value of temp. */ - power = bc_copy_num (num1); - pwrscale = num1->n_scale; - while ((exponent & 1) == 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale TSRMLS_CC); - exponent = exponent >> 1; - } - temp = bc_copy_num (power); - calcscale = pwrscale; - exponent = exponent >> 1; - - /* Do the calculation. */ - while (exponent > 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale TSRMLS_CC); - if ((exponent & 1) == 1) { - calcscale = pwrscale + calcscale; - bc_multiply (temp, power, &temp, calcscale TSRMLS_CC); - } - exponent = exponent >> 1; - } - - /* Assign the value. */ - if (neg) - { - bc_divide (BCG(_one_), temp, result, rscale TSRMLS_CC); - bc_free_num (&temp); - } - else - { - bc_free_num (result); - *result = temp; - if ((*result)->n_scale > rscale) - (*result)->n_scale = rscale; - } - bc_free_num (&power); -} - diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c deleted file mode 100644 index 58964bec58df0..0000000000000 --- a/ext/bcmath/libbcmath/src/raisemod.c +++ /dev/null @@ -1,98 +0,0 @@ -/* raisemod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Raise BASE to the EXPO power, reduced modulo MOD. The result is - placed in RESULT. If a EXPO is not an integer, - only the integer part is used. */ - -int -bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC) -{ - bc_num power, exponent, parity, temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero(mod TSRMLS_CC)) return -1; - if (bc_is_neg(expo)) return -1; - - /* Set initial values. */ - power = bc_copy_num (base); - exponent = bc_copy_num (expo); - temp = bc_copy_num (BCG(_one_)); - bc_init_num(&parity TSRMLS_CC); - - /* Check the base for scale digits. */ - if (base->n_scale != 0) - bc_rt_warn ("non-zero scale in base"); - - /* Check the exponent for scale digits. */ - if (exponent->n_scale != 0) - { - bc_rt_warn ("non-zero scale in exponent"); - bc_divide (exponent, BCG(_one_), &exponent, 0 TSRMLS_CC); /*truncate */ - } - - /* Check the modulus for scale digits. */ - if (mod->n_scale != 0) - bc_rt_warn ("non-zero scale in modulus"); - - /* Do the calculation. */ - rscale = MAX(scale, base->n_scale); - while ( !bc_is_zero(exponent TSRMLS_CC) ) - { - (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0 TSRMLS_CC); - if ( !bc_is_zero(parity TSRMLS_CC) ) - { - bc_multiply (temp, power, &temp, rscale TSRMLS_CC); - (void) bc_modulo (temp, mod, &temp, scale TSRMLS_CC); - } - - bc_multiply (power, power, &power, rscale TSRMLS_CC); - (void) bc_modulo (power, mod, &power, scale TSRMLS_CC); - } - - /* Assign the value. */ - bc_free_num (&power); - bc_free_num (&exponent); - bc_free_num (result); - bc_free_num (&parity); - *result = temp; - return 0; /* Everything is OK. */ -} diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c deleted file mode 100644 index c31d09dc72db5..0000000000000 --- a/ext/bcmath/libbcmath/src/recmul.c +++ /dev/null @@ -1,306 +0,0 @@ -/* recmul.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Recursive vs non-recursive multiply crossover ranges. */ -#if defined(MULDIGITS) -#include "muldigits.h" -#else -#define MUL_BASE_DIGITS 80 -#endif - -int mul_base_digits = MUL_BASE_DIGITS; -#define MUL_SMALL_DIGITS mul_base_digits/4 - -/* Multiply utility routines */ - -static bc_num -new_sub_num (length, scale, value) - int length, scale; - char *value; -{ - bc_num temp; - -#ifdef SANDER_0 - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { -#endif - temp = (bc_num) emalloc (sizeof(bc_struct)); -#ifdef SANDER_0 - if (temp == NULL) bc_out_of_memory (); - } -#endif - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - temp->n_ptr = NULL; - temp->n_value = value; - return temp; -} - -static void -_bc_simp_mul (bc_num n1, int n1len, bc_num n2, int n2len, bc_num *prod, - int full_scale) -{ - char *n1ptr, *n2ptr, *pvptr; - char *n1end, *n2end; /* To the end of n1 and n2. */ - int indx, sum, prodlen; - - prodlen = n1len+n2len+1; - - *prod = bc_new_num (prodlen, 0); - - n1end = (char *) (n1->n_value + n1len - 1); - n2end = (char *) (n2->n_value + n2len - 1); - pvptr = (char *) ((*prod)->n_value + prodlen - 1); - sum = 0; - - /* Here is the loop... */ - for (indx = 0; indx < prodlen-1; indx++) - { - n1ptr = (char *) (n1end - MAX(0, indx-n2len+1)); - n2ptr = (char *) (n2end - MIN(indx, n2len-1)); - while ((n1ptr >= n1->n_value) && (n2ptr <= n2end)) - sum += *n1ptr-- * *n2ptr++; - *pvptr-- = sum % BASE; - sum = sum / BASE; - } - *pvptr = sum; -} - - -/* A special adder/subtractor for the recursive divide and conquer - multiply algorithm. Note: if sub is called, accum must - be larger that what is being subtracted. Also, accum and val - must have n_scale = 0. (e.g. they must look like integers. *) */ -static void -_bc_shift_addsub (bc_num accum, bc_num val, int shift, int sub) -{ - signed char *accp, *valp; - int count, carry; - - count = val->n_len; - if (val->n_value[0] == 0) - count--; - assert (accum->n_len+accum->n_scale >= shift+count); - - /* Set up pointers and others */ - accp = (signed char *)(accum->n_value + - accum->n_len + accum->n_scale - shift - 1); - valp = (signed char *)(val->n_value + val->n_len - 1); - carry = 0; - - if (sub) { - /* Subtraction, carry is really borrow. */ - while (count--) { - *accp -= *valp-- + carry; - if (*accp < 0) { - carry = 1; - *accp-- += BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp -= carry; - if (*accp < 0) - *accp-- += BASE; - else - carry = 0; - } - } else { - /* Addition */ - while (count--) { - *accp += *valp-- + carry; - if (*accp > (BASE-1)) { - carry = 1; - *accp-- -= BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp += carry; - if (*accp > (BASE-1)) - *accp-- -= BASE; - else - carry = 0; - } - } -} - -/* Recursive divide and conquer multiply algorithm. - Based on - Let u = u0 + u1*(b^n) - Let v = v0 + v1*(b^n) - Then uv = (B^2n+B^n)*u1*v1 + B^n*(u1-u0)*(v0-v1) + (B^n+1)*u0*v0 - - B is the base of storage, number of digits in u1,u0 close to equal. -*/ -static void -_bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod, - int full_scale TSRMLS_DC) -{ - bc_num u0, u1, v0, v1; - int u0len, v0len; - bc_num m1, m2, m3, d1, d2; - int n, prodlen, m1zero; - int d1len, d2len; - - /* Base case? */ - if ((ulen+vlen) < mul_base_digits - || ulen < MUL_SMALL_DIGITS - || vlen < MUL_SMALL_DIGITS ) { - _bc_simp_mul (u, ulen, v, vlen, prod, full_scale); - return; - } - - /* Calculate n -- the u and v split point in digits. */ - n = (MAX(ulen, vlen)+1) / 2; - - /* Split u and v. */ - if (ulen < n) { - u1 = bc_copy_num (BCG(_zero_)); - u0 = new_sub_num (ulen,0, u->n_value); - } else { - u1 = new_sub_num (ulen-n, 0, u->n_value); - u0 = new_sub_num (n, 0, u->n_value+ulen-n); - } - if (vlen < n) { - v1 = bc_copy_num (BCG(_zero_)); - v0 = new_sub_num (vlen,0, v->n_value); - } else { - v1 = new_sub_num (vlen-n, 0, v->n_value); - v0 = new_sub_num (n, 0, v->n_value+vlen-n); - } - _bc_rm_leading_zeros (u1); - _bc_rm_leading_zeros (u0); - u0len = u0->n_len; - _bc_rm_leading_zeros (v1); - _bc_rm_leading_zeros (v0); - v0len = v0->n_len; - - m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC); - - /* Calculate sub results ... */ - - bc_init_num(&d1 TSRMLS_CC); - bc_init_num(&d2 TSRMLS_CC); - bc_sub (u1, u0, &d1, 0); - d1len = d1->n_len; - bc_sub (v0, v1, &d2, 0); - d2len = d2->n_len; - - - /* Do recursive multiplies and shifted adds. */ - if (m1zero) - m1 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0 TSRMLS_CC); - - if (bc_is_zero(d1 TSRMLS_CC) || bc_is_zero(d2 TSRMLS_CC)) - m2 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0 TSRMLS_CC); - - if (bc_is_zero(u0 TSRMLS_CC) || bc_is_zero(v0 TSRMLS_CC)) - m3 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0 TSRMLS_CC); - - /* Initialize product */ - prodlen = ulen+vlen+1; - *prod = bc_new_num(prodlen, 0); - - if (!m1zero) { - _bc_shift_addsub (*prod, m1, 2*n, 0); - _bc_shift_addsub (*prod, m1, n, 0); - } - _bc_shift_addsub (*prod, m3, n, 0); - _bc_shift_addsub (*prod, m3, 0, 0); - _bc_shift_addsub (*prod, m2, n, d1->n_sign != d2->n_sign); - - /* Now clean up! */ - bc_free_num (&u1); - bc_free_num (&u0); - bc_free_num (&v1); - bc_free_num (&m1); - bc_free_num (&v0); - bc_free_num (&m2); - bc_free_num (&m3); - bc_free_num (&d1); - bc_free_num (&d2); -} - -/* The multiply routine. N2 times N1 is put int PROD with the scale of - the result being MIN(N2 scale+N1 scale, MAX (SCALE, N2 scale, N1 scale)). - */ - -void -bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC) -{ - bc_num pval; - int len1, len2; - int full_scale, prod_scale; - - /* Initialize things. */ - len1 = n1->n_len + n1->n_scale; - len2 = n2->n_len + n2->n_scale; - full_scale = n1->n_scale + n2->n_scale; - prod_scale = MIN(full_scale,MAX(scale,MAX(n1->n_scale,n2->n_scale))); - - /* Do the multiply */ - _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale TSRMLS_CC); - - /* Assign to prod and clean up the number. */ - pval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - pval->n_value = pval->n_ptr; - pval->n_len = len2 + len1 + 1 - full_scale; - pval->n_scale = prod_scale; - _bc_rm_leading_zeros (pval); - if (bc_is_zero (pval TSRMLS_CC)) - pval->n_sign = PLUS; - bc_free_num (prod); - *prod = pval; -} diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c deleted file mode 100644 index 63f7a0cb79da0..0000000000000 --- a/ext/bcmath/libbcmath/src/rmzero.c +++ /dev/null @@ -1,55 +0,0 @@ -/* rmzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* For many things, we may have leading zeros in a number NUM. - _bc_rm_leading_zeros just moves the data "value" pointer to the - correct place and adjusts the length. */ - - void -_bc_rm_leading_zeros (num) - bc_num num; -{ - /* We can move n_value to point to the first non zero digit! */ - while (*num->n_value == 0 && num->n_len > 1) { - num->n_value++; - num->n_len--; - } -} - diff --git a/ext/bcmath/libbcmath/src/rt.c b/ext/bcmath/libbcmath/src/rt.c deleted file mode 100644 index 2479104fe4540..0000000000000 --- a/ext/bcmath/libbcmath/src/rt.c +++ /dev/null @@ -1,65 +0,0 @@ -/* rt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_rt_warn (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsprintf (error_mesg, mesg, args); - va_end (args); - - fprintf (stderr, "bc math warning: %s\n", error_mesg); -} - - -void bc_rt_error (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsprintf (error_mesg, mesg, args); - va_end (args); - - fprintf (stderr, "bc math error: %s\n", error_mesg); -} diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c deleted file mode 100644 index 5db5113eb5775..0000000000000 --- a/ext/bcmath/libbcmath/src/sqrt.c +++ /dev/null @@ -1,129 +0,0 @@ -/* sqrt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Take the square root NUM and return it in NUM with SCALE digits - after the decimal place. */ - -int -bc_sqrt (bc_num *num, int scale TSRMLS_DC) -{ - int rscale, cmp_res, done; - int cscale; - bc_num guess, guess1, point5, diff; - - /* Initial checks. */ - cmp_res = bc_compare (*num, BCG(_zero_)); - if (cmp_res < 0) - return 0; /* error */ - else - { - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (BCG(_zero_)); - return 1; - } - } - cmp_res = bc_compare (*num, BCG(_one_)); - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (BCG(_one_)); - return 1; - } - - /* Initialize the variables. */ - rscale = MAX (scale, (*num)->n_scale); - bc_init_num(&guess TSRMLS_CC); - bc_init_num(&guess1 TSRMLS_CC); - bc_init_num(&diff TSRMLS_CC); - point5 = bc_new_num (1,1); - point5->n_value[1] = 5; - - - /* Calculate the initial guess. */ - if (cmp_res < 0) - { - /* The number is between 0 and 1. Guess should start at 1. */ - guess = bc_copy_num (BCG(_one_)); - cscale = (*num)->n_scale; - } - else - { - /* The number is greater than 1. Guess should start at 10^(exp/2). */ - bc_int2num (&guess,10); - - bc_int2num (&guess1,(*num)->n_len); - bc_multiply (guess1, point5, &guess1, 0 TSRMLS_CC); - guess1->n_scale = 0; - bc_raise (guess, guess1, &guess, 0 TSRMLS_CC); - bc_free_num (&guess1); - cscale = 3; - } - - /* Find the square root using Newton's algorithm. */ - done = FALSE; - while (!done) - { - bc_free_num (&guess1); - guess1 = bc_copy_num (guess); - bc_divide (*num, guess, &guess, cscale TSRMLS_CC); - bc_add (guess, guess1, &guess, 0); - bc_multiply (guess, point5, &guess, cscale TSRMLS_CC); - bc_sub (guess, guess1, &diff, cscale+1); - if (bc_is_near_zero (diff, cscale)) - { - if (cscale < rscale+1) - cscale = MIN (cscale*3, rscale+1); - else - done = TRUE; - } - } - - /* Assign the number and clean up. */ - bc_free_num (num); - bc_divide (guess,BCG(_one_),num,rscale TSRMLS_CC); - bc_free_num (&guess); - bc_free_num (&guess1); - bc_free_num (&point5); - bc_free_num (&diff); - return 1; -} - diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c deleted file mode 100644 index c484c158e5946..0000000000000 --- a/ext/bcmath/libbcmath/src/str2num.c +++ /dev/null @@ -1,109 +0,0 @@ -/* str2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert strings to bc numbers. Base 10 only.*/ - -void -bc_str2num (bc_num *num, char *str, int scale TSRMLS_DC) -{ - int digits, strscale; - char *ptr, *nptr; - char zero_int; - - /* Prepare num. */ - bc_free_num (num); - - /* Check for valid number and count digits. */ - ptr = str; - digits = 0; - strscale = 0; - zero_int = FALSE; - if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */ - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - while (isdigit((int)*ptr)) ptr++, digits++; /* digits */ - if (*ptr == '.') ptr++; /* decimal point */ - while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */ - if ((*ptr != '\0') || (digits+strscale == 0)) - { - *num = bc_copy_num (BCG(_zero_)); - return; - } - - /* Adjust numbers and allocate storage and initialize fields. */ - strscale = MIN(strscale, scale); - if (digits == 0) - { - zero_int = TRUE; - digits = 1; - } - *num = bc_new_num (digits, strscale); - - /* Build the whole number. */ - ptr = str; - if (*ptr == '-') - { - (*num)->n_sign = MINUS; - ptr++; - } - else - { - (*num)->n_sign = PLUS; - if (*ptr == '+') ptr++; - } - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - nptr = (*num)->n_value; - if (zero_int) - { - *nptr++ = 0; - digits = 0; - } - for (;digits > 0; digits--) - *nptr++ = CH_VAL(*ptr++); - - - /* Build the fractional part. */ - if (strscale > 0) - { - ptr++; /* skip the decimal point! */ - for (;strscale > 0; strscale--) - *nptr++ = CH_VAL(*ptr++); - } -} - diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c deleted file mode 100644 index 2dd8eb5ecc144..0000000000000 --- a/ext/bcmath/libbcmath/src/sub.c +++ /dev/null @@ -1,90 +0,0 @@ -/* sub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full subtract routine that takes care of negative numbers. - N2 is subtracted from N1 and the result placed in RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_sub (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num diff = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign != n2->n_sign) - { - diff = _bc_do_add (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - /* Compare magnitudes. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - diff = _bc_do_sub (n2, n1, scale_min); - diff->n_sign = (n2->n_sign == PLUS ? MINUS : PLUS); - break; - case 0: - /* They are equal! return zero! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - diff = bc_new_num (1, res_scale); - memset (diff->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - diff = _bc_do_sub (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - break; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = diff; -} - diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c deleted file mode 100644 index 4ee249ee710b5..0000000000000 --- a/ext/bcmath/libbcmath/src/zero.c +++ /dev/null @@ -1,64 +0,0 @@ -/* zero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is zero. */ - -char -bc_is_zero (bc_num num TSRMLS_DC) -{ - int count; - char *nptr; - - /* Quick check. */ - if (num == BCG(_zero_)) return TRUE; - - /* Initialize */ - count = num->n_len + num->n_scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/package.xml b/ext/bcmath/package.xml deleted file mode 100644 index 876297e9f88df..0000000000000 --- a/ext/bcmath/package.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - bcmath - Arbitrary Precision Mathematics Functions - - - andi - Andi Gutmans - andi@php.net - lead - - - -For arbitrary precision mathematics PHP offers the Binary Calculator -which supports numbers of any size and precision, represented as strings. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h deleted file mode 100644 index ca5ba68aee796..0000000000000 --- a/ext/bcmath/php_bcmath.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BCMATH_H -#define PHP_BCMATH_H - -#if HAVE_BCMATH - -#include "libbcmath/src/bcmath.h" - -extern zend_module_entry bcmath_module_entry; -#define phpext_bcmath_ptr &bcmath_module_entry - -PHP_MINIT_FUNCTION(bcmath); -PHP_MSHUTDOWN_FUNCTION(bcmath); -PHP_RINIT_FUNCTION(bcmath); -PHP_RSHUTDOWN_FUNCTION(bcmath); -PHP_MINFO_FUNCTION(bcmath); - -PHP_FUNCTION(bcadd); -PHP_FUNCTION(bcsub); -PHP_FUNCTION(bcmul); -PHP_FUNCTION(bcdiv); -PHP_FUNCTION(bcmod); -PHP_FUNCTION(bcpow); -PHP_FUNCTION(bcsqrt); -PHP_FUNCTION(bccomp); -PHP_FUNCTION(bcscale); -PHP_FUNCTION(bcpowmod); - -ZEND_BEGIN_MODULE_GLOBALS(bcmath) - bc_num _zero_; - bc_num _one_; - bc_num _two_; - long bc_precision; -ZEND_END_MODULE_GLOBALS(bcmath) - -#if ZTS -#define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) -#else -#define BCG(v) (bcmath_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(bcmath) - -#else - -#define phpext_bcmath_ptr NULL - -#endif - -#endif /* PHP_BCMATH_H */ diff --git a/ext/bcmath/tests/bcadd.phpt b/ext/bcmath/tests/bcadd.phpt deleted file mode 100644 index 61552eecded0e..0000000000000 --- a/ext/bcmath/tests/bcadd.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcadd() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -4.0000 -8728932003911564969352217864684.00 diff --git a/ext/bcmath/tests/bccomp.phpt b/ext/bcmath/tests/bccomp.phpt deleted file mode 100644 index b2bf9f4ac2b9b..0000000000000 --- a/ext/bcmath/tests/bccomp.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bccomp() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- --1 --1 -0 -1 diff --git a/ext/bcmath/tests/bcdiv.phpt b/ext/bcmath/tests/bcdiv.phpt deleted file mode 100644 index cda19496d5569..0000000000000 --- a/ext/bcmath/tests/bcdiv.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bcdiv() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -0 -0.50 --0.2000 -4526580661.75 diff --git a/ext/bcmath/tests/bcmod.phpt b/ext/bcmath/tests/bcmod.phpt deleted file mode 100644 index 1d7be48a754b2..0000000000000 --- a/ext/bcmath/tests/bcmod.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcmod() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -1 --1 -1459434331351930289678 diff --git a/ext/bcmath/tests/bcmul.phpt b/ext/bcmath/tests/bcmul.phpt deleted file mode 100644 index 0ff322fe327bc..0000000000000 --- a/ext/bcmath/tests/bcmul.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bcmul() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -2 --15 -12193263111263526900 -3.75 diff --git a/ext/bcmath/tests/bcpow.phpt b/ext/bcmath/tests/bcpow.phpt deleted file mode 100644 index bdd4e08cab9ed..0000000000000 --- a/ext/bcmath/tests/bcpow.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcpow() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -1 --32 -18446744073709551616 diff --git a/ext/bcmath/tests/bcscale.phpt b/ext/bcmath/tests/bcscale.phpt deleted file mode 100644 index 4fc2f85eb92c1..0000000000000 --- a/ext/bcmath/tests/bcscale.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -bcscale() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -3.00 -3.0000000000 -3 diff --git a/ext/bcmath/tests/bcsqrt.phpt b/ext/bcmath/tests/bcsqrt.phpt deleted file mode 100644 index 46d92fd5edc1f..0000000000000 --- a/ext/bcmath/tests/bcsqrt.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -bcsqrt() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -43913234134.28826 diff --git a/ext/bcmath/tests/bcsub.phpt b/ext/bcmath/tests/bcsub.phpt deleted file mode 100644 index 71726492f7788..0000000000000 --- a/ext/bcmath/tests/bcsub.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcsub() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- --1 --6.0000 -8728932000054820705086578390258.00 diff --git a/ext/bz2/CREDITS b/ext/bz2/CREDITS deleted file mode 100644 index 67dff9f41d7b1..0000000000000 --- a/ext/bz2/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Bzip2 -Sterling Hughes diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c deleted file mode 100644 index f3939c5ea3f83..0000000000000 --- a/ext/bz2/bz2.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_bz2.h" - -#if HAVE_BZ2 - -/* PHP Includes */ -#include "ext/standard/file.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" - -/* for fileno() */ -#include - -/* Internal error constants */ -#define PHP_BZ_ERRNO 0 -#define PHP_BZ_ERRSTR 1 -#define PHP_BZ_ERRBOTH 2 - -function_entry bz2_functions[] = { - PHP_FE(bzopen, NULL) - PHP_FE(bzread, NULL) - PHP_FALIAS(bzwrite, fwrite, NULL) - PHP_FALIAS(bzflush, fflush, NULL) - PHP_FALIAS(bzclose, fclose, NULL) - PHP_FE(bzerrno, NULL) - PHP_FE(bzerrstr, NULL) - PHP_FE(bzerror, NULL) - PHP_FE(bzcompress, NULL) - PHP_FE(bzdecompress, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry bz2_module_entry = { - STANDARD_MODULE_HEADER, - "bz2", - bz2_functions, - PHP_MINIT(bz2), - PHP_MSHUTDOWN(bz2), - NULL, - NULL, - PHP_MINFO(bz2), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_BZ2 -ZEND_GET_MODULE(bz2) -#endif - -struct php_bz2_stream_data_t { - BZFILE *bz_file; - php_stream *stream; -}; - -/* {{{ BZip2 stream implementation */ - -static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; - size_t ret; - - ret = BZ2_bzread(self->bz_file, buf, count); - - if (ret == 0) { - stream->eof = 1; - } - - return ret; -} - -static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; - - return BZ2_bzwrite(self->bz_file, (char*)buf, count); -} - -static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - int ret = EOF; - - if (close_handle) { - BZ2_bzclose(self->bz_file); - } - - if (self->stream) { - php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0)); - } - - efree(self); - - return ret; -} - -static int php_bz2iop_flush(php_stream *stream TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - return BZ2_bzflush(self->bz_file); -} -/* }}} */ - -php_stream_ops php_stream_bz2io_ops = { - php_bz2iop_write, php_bz2iop_read, - php_bz2iop_close, php_bz2iop_flush, - "BZip2", - NULL, /* seek */ - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -/* {{{ Bzip2 stream openers */ -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, - char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self; - - self = emalloc(sizeof(*self)); - - self->stream = innerstream; - self->bz_file = bz; - - return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode); -} - -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, - char *path, - char *mode, - int options, - char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *retstream = NULL, *stream = NULL; - char *path_copy = NULL; - BZFILE *bz_file = NULL; - - if (strncasecmp("compress.bzip2://", path, 17) == 0) { - path += 17; - } - if (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0') { - return NULL; - } - -#ifdef VIRTUAL_DIR - virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC); -#else - path_copy = path; -#endif - - /* try and open it directly first */ - bz_file = BZ2_bzopen(path_copy, mode); - - if (opened_path && bz_file) { - *opened_path = estrdup(path_copy); - } - path_copy = NULL; - - if (bz_file == NULL) { - /* that didn't work, so try and get something from the network/wrapper */ - stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path); - - if (stream) { - int fd; - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - bz_file = BZ2_bzdopen(fd, mode); - } - } - /* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions - * failed. - */ - if (opened_path && !bz_file && mode[0] == 'w') { - VCWD_UNLINK(*opened_path); - } - } - - if (bz_file) { - retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC); - if (retstream) { - return retstream; - } - - BZ2_bzclose(bz_file); - } - - if (stream) { - php_stream_close(stream); - } - - return NULL; -} - -/* }}} */ - -static php_stream_wrapper_ops bzip2_stream_wops = { - _php_stream_bz2open, - NULL, /* close */ - NULL, /* fstat */ - NULL, /* stat */ - NULL, /* opendir */ - "BZip2", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_bzip2_wrapper = { - &bzip2_stream_wops, - NULL, - 0 /* is_url */ -}; - -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int); - -PHP_MINIT_FUNCTION(bz2) -{ - php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC); - php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(bz2) -{ - php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC); - php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC); - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(bz2) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "BZip2 Support", "Enabled"); - php_info_print_table_row(2, "Stream Wrapper support", "compress.bz2://"); - php_info_print_table_row(2, "Stream Filter support", "bzip2.decompress, bzip2.compress"); - php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion()); - php_info_print_table_end(); -} - -/* {{{ proto string bzread(int bz[, int length]) - Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */ -PHP_FUNCTION(bzread) -{ - zval *bz; - long len = 1024; - php_stream *stream; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &bz); - - if (len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative"); - RETURN_FALSE; - } - - Z_STRVAL_P(return_value) = emalloc(len + 1); - Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len); - - if (Z_STRLEN_P(return_value) < 0) { - efree(Z_STRVAL_P(return_value)); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream"); - RETURN_FALSE; - } - - Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; - - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(return_value) = php_addslashes( Z_STRVAL_P(return_value), - Z_STRLEN_P(return_value), - &Z_STRLEN_P(return_value), 1 TSRMLS_CC); - } - - Z_TYPE_P(return_value) = IS_STRING; -} -/* }}} */ - -/* {{{ proto resource bzopen(string|int file|fp, string mode) - Opens a new BZip2 stream */ -PHP_FUNCTION(bzopen) -{ - zval **file, /* The file to open */ - **mode; /* The mode to open the stream with */ - BZFILE *bz; /* The compressed file stream */ - php_stream *stream = NULL; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(mode); - - if (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w' && Z_STRVAL_PP(mode)[1] != '\0') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", Z_STRVAL_PP(mode)); - RETURN_FALSE; - } - - /* If it's not a resource its a string containing the filename to open */ - if (Z_TYPE_PP(file) != IS_RESOURCE) { - convert_to_string_ex(file); - stream = php_stream_bz2open(NULL, - Z_STRVAL_PP(file), - Z_STRVAL_PP(mode), - ENFORCE_SAFE_MODE | REPORT_ERRORS, - NULL); - } else { - /* If it is a resource, than its a stream resource */ - int fd; - - php_stream_from_zval(stream, file); - - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { - RETURN_FALSE; - } - - bz = BZ2_bzdopen(fd, Z_STRVAL_PP(mode)); - - stream = php_stream_bz2open_from_BZFILE(bz, Z_STRVAL_PP(mode), stream); - } - - if (stream) { - php_stream_to_zval(stream, return_value); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int bzerrno(resource bz) - Returns the error number */ -PHP_FUNCTION(bzerrno) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO); -} -/* }}} */ - -/* {{{ proto string bzerrstr(resource bz) - Returns the error string */ -PHP_FUNCTION(bzerrstr) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR); -} -/* }}} */ - -/* {{{ proto array bzerror(resource bz) - Returns the error number and error string in an associative array */ -PHP_FUNCTION(bzerror) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH); -} -/* }}} */ - -/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]]) - Compresses a string into BZip2 encoded data */ -PHP_FUNCTION(bzcompress) -{ - zval **source, /* Source data to compress */ - **zblock_size, /* Optional block size to use */ - **zwork_factor; /* Optional work factor to use */ - char *dest = NULL; /* Destination to place the compressed data into */ - int error, /* Error Container */ - block_size = 4, /* Block size for compression algorithm */ - work_factor = 0, /* Work factor for compression algorithm */ - argc; /* Argument count */ - unsigned int source_len, /* Length of the source data */ - dest_len; /* Length of the destination buffer */ - - argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &source, &zblock_size, &zwork_factor) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(source); - - /* Assign them to easy to use variables, dest_len is initially the length of the data - + .01 x length of data + 600 which is the largest size the results of the compression - could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net - for pointing this out). */ - source_len = Z_STRLEN_PP(source); - dest_len = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600; - - /* Allocate the destination buffer */ - dest = emalloc(dest_len + 1); - - /* Handle the optional arguments */ - if (argc > 1) { - convert_to_long_ex(zblock_size); - block_size = Z_LVAL_PP(zblock_size); - } - - if (argc > 2) { - convert_to_long_ex(zwork_factor); - work_factor = Z_LVAL_PP(zwork_factor); - } - - error = BZ2_bzBuffToBuffCompress(dest, &dest_len, Z_STRVAL_PP(source), source_len, block_size, 0, work_factor); - if (error != BZ_OK) { - efree(dest); - RETURN_LONG(error); - } else { - /* Copy the buffer, we have perhaps allocate alot more than we need, - so we erealloc() the buffer to the proper size */ - dest = erealloc(dest, dest_len + 1); - dest[dest_len] = 0; - RETURN_STRINGL(dest, dest_len, 0); - } -} -/* }}} */ - -/* {{{ proto string bzdecompress(string source [, int small]) - Decompresses BZip2 compressed data */ -PHP_FUNCTION(bzdecompress) -{ - char *source, *dest; - int source_len, error; - long small = 0; -#if defined(PHP_WIN32) - unsigned __int64 size = 0; -#else - unsigned long long size = 0; -#endif - bz_stream bzs; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) { - RETURN_FALSE; - } - - bzs.bzalloc = NULL; - bzs.bzfree = NULL; - - if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) { - RETURN_FALSE; - } - - bzs.next_in = source; - bzs.avail_in = source_len; - - /* in most cases bz2 offers at least 2:1 compression, so we use that as our base */ - bzs.avail_out = source_len * 2; - bzs.next_out = dest = emalloc(bzs.avail_out + 1); - - while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) { - /* compression is better then 2:1, need to allocate more memory */ - bzs.avail_out = source_len; - size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; - dest = erealloc(dest, size + bzs.avail_out + 1); - bzs.next_out = dest + size; - } - - if (error == BZ_STREAM_END || error == BZ_OK) { - size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; - dest = erealloc(dest, size + 1); - dest[size] = '\0'; - RETVAL_STRINGL(dest, size, 0); - } else { /* real error */ - efree(dest); - RETVAL_LONG(error); - } - - BZ2_bzDecompressEnd(&bzs); -} -/* }}} */ - -/* {{{ php_bz2_error() - The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */ -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) -{ - zval **bzp; /* BZip2 Resource Pointer */ - php_stream *stream; - const char *errstr; /* Error string */ - int errnum; /* Error number */ - struct php_bz2_stream_data_t *self; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bzp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - php_stream_from_zval(stream, bzp); - - if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) { - RETURN_FALSE; - } - - self = (struct php_bz2_stream_data_t *) stream->abstract; - - /* Fetch the error information */ - errstr = BZ2_bzerror(self->bz_file, &errnum); - - /* Determine what to return */ - switch (opt) { - case PHP_BZ_ERRNO: - RETURN_LONG(errnum); - break; - case PHP_BZ_ERRSTR: - RETURN_STRING((char*)errstr, 1); - break; - case PHP_BZ_ERRBOTH: - array_init(return_value); - - add_assoc_long (return_value, "errno", errnum); - add_assoc_string(return_value, "errstr", (char*)errstr, 1); - break; - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/bz2/bz2.dsp b/ext/bz2/bz2.dsp deleted file mode 100644 index a054c522a79b9..0000000000000 --- a/ext/bz2/bz2.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=bz2 - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "bz2.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "bz2 - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "bz2 - Win32 Release_TS" -# Name "bz2 - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\bz2.c -# End Source File -# Begin Source File - -SOURCE=.\bz2_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_bz2.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c deleted file mode 100644 index fc28823d37c1b..0000000000000 --- a/ext/bz2/bz2_filter.c +++ /dev/null @@ -1,400 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_bz2.h" - -/* {{{ data structure */ - -typedef struct _php_bz2_filter_data { - int persistent; - bz_stream strm; - char *inbuf; - size_t inbuf_len; - char *outbuf; - size_t outbuf_len; -} php_bz2_filter_data; - -/* }}} */ - -/* {{{ Memory management wrappers */ - -static void *php_bz2_alloc(void *opaque, int items, int size) -{ - return (void *)safe_pemalloc(items, size, 0, ((php_bz2_filter_data*)opaque)->persistent); -} - -static void php_bz2_free(void *opaque, void *address) -{ - pefree((void *)address, ((php_bz2_filter_data*)opaque)->persistent); -} -/* }}} */ - -/* {{{ bzip2.decompress filter implementation */ - -static php_stream_filter_status_t php_bz2_decompress_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_bz2_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - bz_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_bz2_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = buckets_in->head; - - if (bucket->is_unicode) { - /* decompression not allowed for unicode data */ - return PSFS_ERR_FATAL; - } - - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); - data->strm.avail_in = desired; - - status = BZ2_bzDecompress(&(data->strm)); - if (status != BZ_OK && status != BZ_STREAM_END) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = BZ_OK; - while (status == BZ_OK) { - status = BZ2_bzDecompress(&(data->strm)); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_bz2_filter_data *data = thisfilter->abstract; - BZ2_bzDecompressEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_bz2_decompress_ops = { - php_bz2_decompress_filter, - php_bz2_decompress_dtor, - "bzip2.decompress", - PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_OUTPUTS_STRING -}; -/* }}} */ - -/* {{{ bzip2.compress filter implementation */ - -static php_stream_filter_status_t php_bz2_compress_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_bz2_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - bz_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_bz2_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = buckets_in->head; - - if (bucket->is_unicode) { - /* compression not allowed for unicode data */ - return PSFS_ERR_FATAL; - } - - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); - data->strm.avail_in = desired; - - status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN)); - if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = BZ_OUTBUFF_FULL; - while (status == BZ_OUTBUFF_FULL) { - status = BZ2_bzCompress(&(data->strm), BZ_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - return exit_status; -} - -static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_bz2_filter_data *data = thisfilter->abstract; - BZ2_bzCompressEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_bz2_compress_ops = { - php_bz2_compress_filter, - php_bz2_compress_dtor, - "bzip2.compress", - PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_OUTPUTS_STRING -}; - -/* }}} */ - -/* {{{ bzip2.* common factory */ - -static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_stream_filter_ops *fops = NULL; - php_bz2_filter_data *data; - int status; - - /* Create this filter */ - data = pecalloc(1, sizeof(php_bz2_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_bz2_filter_data)); - return NULL; - } - - /* Circular reference */ - data->strm.opaque = (void *) data; - - data->strm.bzalloc = php_bz2_alloc; - data->strm.bzfree = php_bz2_free; - data->persistent = persistent; - data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->inbuf_len); - pefree(data, persistent); - return NULL; - } - data->strm.avail_in = 0; - data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } - - if (strcasecmp(filtername, "bzip2.decompress") == 0) { - int smallFootprint = 0; - - if (filterparams) { - zval **tmpzval = NULL; - - if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) { - zend_hash_find(HASH_OF(filterparams), "small", sizeof("small"), (void **) &tmpzval); - } else { - tmpzval = &filterparams; - } - - if (tmpzval) { - SEPARATE_ZVAL(tmpzval); - convert_to_boolean_ex(tmpzval); - smallFootprint = Z_LVAL_PP(tmpzval); - zval_ptr_dtor(tmpzval); - } - } - - status = BZ2_bzDecompressInit(&(data->strm), 0, smallFootprint); - fops = &php_bz2_decompress_ops; - } else if (strcasecmp(filtername, "bzip2.compress") == 0) { - int blockSize100k = PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE; - int workFactor = PHP_BZ2_FILTER_DEFAULT_WORKFACTOR; - - if (filterparams) { - zval **tmpzval; - - if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) { - if (zend_hash_find(HASH_OF(filterparams), "blocks", sizeof("blocks"), (void**) &tmpzval) == SUCCESS) { - /* How much memory to allocate (1 - 9) x 100kb */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - blockSize100k = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "work", sizeof("work"), (void**) &tmpzval) == SUCCESS) { - /* Work Factor (0 - 250) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 0 || Z_LVAL_PP(tmpzval) > 250) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - workFactor = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - } - } - - status = BZ2_bzCompressInit(&(data->strm), blockSize100k, 0, workFactor); - fops = &php_bz2_compress_ops; - } else { - status = BZ_DATA_ERROR; - } - - if (status != BZ_OK) { - /* Unspecified (probably strm) error, let stream-filter error do its own whining */ - pefree(data->strm.next_in, persistent); - pefree(data->strm.next_out, persistent); - pefree(data, persistent); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_bz2_filter_factory = { - php_bz2_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 deleted file mode 100644 index 3e6aa78d053a6..0000000000000 --- a/ext/bz2/config.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(bz2, for BZip2 support, -[ --with-bz2[=DIR] Include BZip2 support]) - -if test "$PHP_BZ2" != "no"; then - if test -r $PHP_BZ2/include/bzlib.h; then - BZIP_DIR=$PHP_BZ2 - else - AC_MSG_CHECKING(for BZip2 in default path) - for i in /usr/local /usr; do - if test -r $i/include/bzlib.h; then - BZIP_DIR=$i - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$BZIP_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the BZip2 distribution) - fi - - PHP_CHECK_LIBRARY(bz2, BZ2_bzerror, - [ - PHP_ADD_INCLUDE($BZIP_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/$PHP_LIBDIR, BZ2_SHARED_LIBADD) - AC_DEFINE(HAVE_BZ2,1,[ ]) - ], [ - AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0) - ], [ - -L$BZIP_DIR/$PHP_LIBDIR - ]) - - PHP_NEW_EXTENSION(bz2, bz2.c bz2_filter.c, $ext_shared) - PHP_SUBST(BZ2_SHARED_LIBADD) -fi diff --git a/ext/bz2/config.w32 b/ext/bz2/config.w32 deleted file mode 100644 index af57f8bc30a4c..0000000000000 --- a/ext/bz2/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("bz2", "BZip2", "no"); - -if (PHP_BZ2 != "no") { - if (CHECK_LIB("libbz2.lib", "bz2", PHP_BZ2) && - CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) { - EXTENSION("bz2", "bz2.c bz2_filter.c"); - AC_DEFINE('HAVE_BZ2', 1, 'Have BZ2 library'); - // BZ2 extension does this slightly differently from others - if (PHP_BZ2_SHARED) { - ADD_FLAG("CFLAGS_BZ2", "/D PHP_BZ2_EXPORTS "); - } - } else { - WARNING("bz2 not enabled; libraries and headers not found"); - } -} diff --git a/ext/bz2/package.xml b/ext/bz2/package.xml deleted file mode 100644 index 107f2188668f8..0000000000000 --- a/ext/bz2/package.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - bz2 - A Bzip2 management extension - -Bz2 is an extension to create and parse bzip2 compressed data. - - PHP License - - - sterling - Sterling Hughes - sterling@php.net - - - - 1.0 - 2003-05-17 - stable - - Initial Release in PECL - - - - - - - - CREDITS - config.m4 - php_bz2.h - bz2.c - bz2.dsp - - - diff --git a/ext/bz2/php_bz2.def b/ext/bz2/php_bz2.def deleted file mode 100644 index 831355344a2de..0000000000000 --- a/ext/bz2/php_bz2.def +++ /dev/null @@ -1,7 +0,0 @@ -EXPORTS - BZ2_bzCompressInit - BZ2_bzCompress - BZ2_bzCompressEnd - BZ2_bzDecompressInit - BZ2_bzDecompress - BZ2_bzDecompressEnd diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h deleted file mode 100644 index 88cd6d95d85dc..0000000000000 --- a/ext/bz2/php_bz2.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BZ2_H -#define PHP_BZ2_H - -#if HAVE_BZ2 - -extern zend_module_entry bz2_module_entry; -#define phpext_bz2_ptr &bz2_module_entry - -/* Bzip2 includes */ -#include - -PHP_MINIT_FUNCTION(bz2); -PHP_MSHUTDOWN_FUNCTION(bz2); -PHP_MINFO_FUNCTION(bz2); -PHP_FUNCTION(bzopen); -PHP_FUNCTION(bzread); -PHP_FUNCTION(bzerrno); -PHP_FUNCTION(bzerrstr); -PHP_FUNCTION(bzerror); -PHP_FUNCTION(bzcompress); -PHP_FUNCTION(bzdecompress); - -#else -#define phpext_bz2_ptr NULL -#endif - -#ifdef PHP_WIN32 -# ifdef PHP_BZ2_EXPORTS -# define PHP_BZ2_API __declspec(dllexport) -# elif defined(COMPILE_DL_BZ2) -# define PHP_BZ2_API __declspec(dllimport) -# else -# define PHP_BZ2_API /* nothing special */ -# endif -#else -# define PHP_BZ2_API -#endif - -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC); - -#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC) -#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC) - -php_stream_filter_factory php_bz2_filter_factory; -extern php_stream_ops php_stream_bz2io_ops; -#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops - -/* 400kb */ -#define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE 4 - -/* BZ2 Internal Default */ -#define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR 0 - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/bz2/tests/bz2_filter_compress.phpt b/ext/bz2/tests/bz2_filter_compress.phpt deleted file mode 100644 index 3de9a9d3ecb43..0000000000000 --- a/ext/bz2/tests/bz2_filter_compress.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -bzip2.compress (with convert.base64-encode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -QlpoNDFBWSZTWRN6QG0AAAoVgECFACA395UgIABIintI1N6mpowIQ0E1MTTAQGYTNcRyMZm5kgW3ib7hVboE7Tmqj3ToGZ5G3q1ZauD2G58hibSck8KS95EEAbx1Cn+LuSKcKEgJvSA2gA== diff --git a/ext/bz2/tests/bz2_filter_decompress.phpt b/ext/bz2/tests/bz2_filter_decompress.phpt deleted file mode 100644 index 951d572cb2d8f..0000000000000 --- a/ext/bz2/tests/bz2_filter_decompress.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -bzip2.decompress (with convert.base64-decode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -I am the very model of a modern major general, I've information vegetable, animal, and mineral. diff --git a/ext/bz2/tests/with_files.phpt b/ext/bz2/tests/with_files.phpt deleted file mode 100644 index 569144593928e..0000000000000 --- a/ext/bz2/tests/with_files.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -BZ2 with files ---SKIPIF-- - ---FILE-- - ---FILE-- - | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -/* {{{ proto int unixtojd([int timestamp]) - Convert UNIX timestamp to Julian Day */ -PHP_FUNCTION(unixtojd) -{ - pval *timestamp; - long jdate; - time_t t; - struct tm *ta, tmbuf; - int myargc=ZEND_NUM_ARGS(); - - if ((myargc > 1) || (zend_get_parameters(ht, myargc, ×tamp) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - if(myargc==1) { - convert_to_long(timestamp); - t = Z_LVAL_P(timestamp); - } else { - t = time(NULL); - } - - if(t < 0) { - RETURN_FALSE; - } - - ta = php_localtime_r(&t, &tmbuf); - jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto int jdtounix(int jday) - Convert Julian Day to UNIX timestamp */ -PHP_FUNCTION(jdtounix) -{ - pval *jday; - long uday; - - if ((ZEND_NUM_ARGS()!= 1) || (zend_get_parameters(ht, 1, &jday) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - convert_to_long(jday); - - uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */; - - if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */ - if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */ - - RETURN_LONG(uday*24*3600); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c deleted file mode 100644 index 5ec4b3cd61445..0000000000000 --- a/ext/calendar/calendar.c +++ /dev/null @@ -1,654 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - | Wez Furlong | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef PHP_WIN32 -#define _WINNLS_ -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_calendar.h" -#include "sdncal.h" - -#include - -function_entry calendar_functions[] = { - PHP_FE(jdtogregorian, NULL) - PHP_FE(gregoriantojd, NULL) - PHP_FE(jdtojulian, NULL) - PHP_FE(juliantojd, NULL) - PHP_FE(jdtojewish, NULL) - PHP_FE(jewishtojd, NULL) - PHP_FE(jdtofrench, NULL) - PHP_FE(frenchtojd, NULL) - PHP_FE(jddayofweek, NULL) - PHP_FE(jdmonthname, NULL) - PHP_FE(easter_date, NULL) - PHP_FE(easter_days, NULL) - PHP_FE(unixtojd, NULL) - PHP_FE(jdtounix, NULL) - PHP_FE(cal_to_jd, NULL) - PHP_FE(cal_from_jd, NULL) - PHP_FE(cal_days_in_month, NULL) - PHP_FE(cal_info, NULL) - {NULL, NULL, NULL} -}; - - -zend_module_entry calendar_module_entry = { - STANDARD_MODULE_HEADER, - "calendar", - calendar_functions, - PHP_MINIT(calendar), - NULL, - NULL, - NULL, - PHP_MINFO(calendar), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; - -#ifdef COMPILE_DL_CALENDAR -ZEND_GET_MODULE(calendar) -#endif - -/* this order must match the conversion table below */ -enum cal_name_type_t { - CAL_GREGORIAN = 0, - CAL_JULIAN, - CAL_JEWISH, - CAL_FRENCH, - CAL_NUM_CALS -}; - -typedef long int (*cal_to_jd_func_t) (int month, int day, int year); -typedef void (*cal_from_jd_func_t) (long int jd, int *year, int *month, int *day); -typedef char *(*cal_as_string_func_t) (int year, int month, int day); - -struct cal_entry_t { - char *name; - char *symbol; - cal_to_jd_func_t to_jd; - cal_from_jd_func_t from_jd; - int num_months; - int max_days_in_month; - char **month_name_short; - char **month_name_long; -}; - -static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = { - {"Gregorian", "CAL_GREGORIAN", GregorianToSdn, SdnToGregorian, 12, 31, - MonthNameShort, MonthNameLong}, - {"Julian", "CAL_JULIAN", JulianToSdn, SdnToJulian, 12, 31, - MonthNameShort, MonthNameLong}, - {"Jewish", "CAL_JEWISH", JewishToSdn, SdnToJewish, 13, 30, - JewishMonthName, JewishMonthName}, - {"French", "CAL_FRENCH", FrenchToSdn, SdnToFrench, 13, 30, - FrenchMonthName, FrenchMonthName} -}; - -/* For jddayofweek */ -enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG }; - -/* For jdmonthname */ -enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG, - CAL_MONTH_JULIAN_SHORT, CAL_MONTH_JULIAN_LONG, CAL_MONTH_JEWISH, - CAL_MONTH_FRENCH -}; - -/* for heb_number_to_chars */ -static char alef_bet[25] = "0àáâäċĉçèéëìîñòôö÷ĝùú"; - -#define CAL_JEWISH_ADD_ALAFIM_GERESH 0x2 -#define CAL_JEWISH_ADD_ALAFIM 0x4 -#define CAL_JEWISH_ADD_GERESHAYIM 0x8 - -PHP_MINIT_FUNCTION(calendar) -{ - REGISTER_LONG_CONSTANT("CAL_GREGORIAN", CAL_GREGORIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JULIAN", CAL_JULIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH", CAL_JEWISH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_FRENCH", CAL_FRENCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_NUM_CALS", CAL_NUM_CALS, CONST_CS | CONST_PERSISTENT); -/* constants for jddayofweek */ - REGISTER_LONG_CONSTANT("CAL_DOW_DAYNO", CAL_DOW_DAYNO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_SHORT", CAL_DOW_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_LONG", CAL_DOW_LONG, CONST_CS | CONST_PERSISTENT); -/* constants for jdmonthname */ - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_SHORT", CAL_MONTH_GREGORIAN_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_LONG", CAL_MONTH_GREGORIAN_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_SHORT", CAL_MONTH_JULIAN_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS | CONST_PERSISTENT); -/* constants for easter calculation */ - REGISTER_LONG_CONSTANT("CAL_EASTER_DEFAULT", CAL_EASTER_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ROMAN", CAL_EASTER_ROMAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_GREGORIAN", CAL_EASTER_ALWAYS_GREGORIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_JULIAN", CAL_EASTER_ALWAYS_JULIAN, CONST_CS | CONST_PERSISTENT); -/* constants for Jewish date formatting */ - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM_GERESH", CAL_JEWISH_ADD_ALAFIM_GERESH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM", CAL_JEWISH_ADD_ALAFIM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_GERESHAYIM", CAL_JEWISH_ADD_GERESHAYIM, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(calendar) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Calendar support", "enabled"); - php_info_print_table_end(); -} - -static void _php_cal_info(int cal, zval **ret) -{ - zval *months, *smonths; - int i; - struct cal_entry_t *calendar; - - calendar = &cal_conversion_table[cal]; - array_init(*ret); - - MAKE_STD_ZVAL(months); - MAKE_STD_ZVAL(smonths); - array_init(months); - array_init(smonths); - - for (i = 1; i <= calendar->num_months; i++) { - add_index_string(months, i, calendar->month_name_long[i], 1); - add_index_string(smonths, i, calendar->month_name_short[i], 1); - } - add_assoc_zval(*ret, "months", months); - add_assoc_zval(*ret, "abbrevmonths", smonths); - add_assoc_long(*ret, "maxdaysinmonth", calendar->max_days_in_month); - add_assoc_string(*ret, "calname", calendar->name, 1); - add_assoc_string(*ret, "calsymbol", calendar->symbol, 1); - -} - -/* {{{ proto array cal_info(int calendar) - Returns information about a particular calendar */ -PHP_FUNCTION(cal_info) -{ - long cal = -1; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &cal) == FAILURE) { - RETURN_FALSE; - } - - if (cal == -1) { - int i; - zval *val; - - array_init(return_value); - - for (i = 0; i < CAL_NUM_CALS; i++) { - MAKE_STD_ZVAL(val); - _php_cal_info(i, &val); - add_index_zval(return_value, i, val); - } - return; - } - - - if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - _php_cal_info(cal, &return_value); - -} -/* }}} */ - -/* {{{ proto int cal_days_in_month(int calendar, int month, int year) - Returns the number of days in a month for a given year and calendar */ -PHP_FUNCTION(cal_days_in_month) -{ - long cal, month, year; - struct cal_entry_t *calendar; - long sdn_start, sdn_next; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &cal, &month, &year) == FAILURE) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - calendar = &cal_conversion_table[cal]; - - sdn_start = calendar->to_jd(year, month, 1); - - if (sdn_start == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date."); - RETURN_FALSE; - } - - sdn_next = calendar->to_jd(year, 1 + month, 1); - - if (sdn_next == 0) { -/* if invalid, try first month of the next year... */ - sdn_next = calendar->to_jd(year + 1, 1, 1); - } - - RETURN_LONG(sdn_next - sdn_start); -} -/* }}} */ - -/* {{{ proto int cal_to_jd(int calendar, int month, int day, int year) - Converts from a supported calendar to Julian Day Count */ -PHP_FUNCTION(cal_to_jd) -{ - long cal, month, day, year; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - RETURN_LONG(cal_conversion_table[cal].to_jd(year, month, day)); -} -/* }}} */ - -/* {{{ proto array cal_from_jd(int jd, int calendar) - Converts from Julian Day Count to a supported calendar and return extended information */ -PHP_FUNCTION(cal_from_jd) -{ - long jd, cal; - int month, day, year, dow; - char date[16]; - struct cal_entry_t *calendar; - - if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "ll", &jd, &cal) == FAILURE) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld", cal); - RETURN_FALSE; - } - calendar = &cal_conversion_table[cal]; - - array_init(return_value); - - calendar->from_jd(jd, &year, &month, &day); - - sprintf(date, "%i/%i/%i", month, day, year); - add_assoc_string(return_value, "date", date, 1); - - add_assoc_long(return_value, "month", month); - add_assoc_long(return_value, "day", day); - add_assoc_long(return_value, "year", year); - -/* day of week */ - dow = DayOfWeek(jd); - add_assoc_long(return_value, "dow", dow); - add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1); - add_assoc_string(return_value, "dayname", DayNameLong[dow], 1); -/* month name */ - add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month], 1); - add_assoc_string(return_value, "monthname", calendar->month_name_long[month], 1); -} -/* }}} */ - -/* {{{ proto string jdtogregorian(int juliandaycount) - Converts a julian day count to a gregorian calendar date */ -PHP_FUNCTION(jdtogregorian) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToGregorian(julday, &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int gregoriantojd(int month, int day, int year) - Converts a gregorian calendar date to julian day count */ -PHP_FUNCTION(gregoriantojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(GregorianToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto string jdtojulian(int juliandaycount) - Convert a julian day count to a julian calendar date */ -PHP_FUNCTION(jdtojulian) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToJulian(julday, &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int juliantojd(int month, int day, int year) - Converts a julian calendar date to julian day count */ -PHP_FUNCTION(juliantojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(JulianToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ heb_number_to_chars*/ -/* -caution: the Hebrew format produces non unique result. -for example both: year '5' and year '5000' produce 'ä'. -use the numeric one for calculations. - */ -static char *heb_number_to_chars(int n, int fl, char **ret) -{ - char *p, old[18], *endofalafim; - - p = endofalafim = old; -/* - prevents the option breaking the jewish beliefs, and some other - critical resources ;) - */ - if (n > 9999 || n < 1) { - *ret = NULL; - return NULL; - } - -/* alafim (thousands) case */ - if (n / 1000) { - *p = alef_bet[n / 1000]; - p++; - - if (CAL_JEWISH_ADD_ALAFIM_GERESH & fl) { - *p = '\''; - p++; - } - if (CAL_JEWISH_ADD_ALAFIM & fl) { - strcpy(p, " àìôéí "); - p += 7; - } - - endofalafim = p; - n = n % 1000; - } - -/* tav-tav (tav=400) case */ - while (n >= 400) { - *p = alef_bet[22]; - p++; - n -= 400; - } - -/* meot (hundreads) case */ - if (n >= 100) { - *p = alef_bet[18 + n / 100]; - p++; - n = n % 100; - } - -/* tet-vav & tet-zain case (special case for 15 and 16) */ - if (n == 15 || n == 16) { - *p = alef_bet[9]; - p++; - *p = alef_bet[n - 9]; - p++; - } else { -/* asarot (tens) case */ - if (n >= 10) { - *p = alef_bet[9 + n / 10]; - p++; - n = n % 10; - } - -/* yehidot (ones) case */ - if (n > 0) { - *p = alef_bet[n]; - p++; - } - } - - if (CAL_JEWISH_ADD_GERESHAYIM & fl) { - switch (p - endofalafim) { - case 0: - break; - case 1: - *p = '\''; - p++; - break; - default: - *(p) = *(p - 1); - *(p - 1) = '"'; - p++; - } - } - - *p = '\0'; - *ret = estrndup(old, (p - old) + 1); - p = *ret; - return p; -} -/* }}} */ - -/* {{{ proto string jdtojewish(int juliandaycount [, bool hebrew [, int fl]]) - Converts a julian day count to a jewish calendar date */ -PHP_FUNCTION(jdtojewish) -{ - long julday, fl = 0; - zend_bool heb = 0; - int year, month, day; - char date[16], hebdate[25]; - char *dayp, *yearp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) { - RETURN_FALSE; - } - - SdnToJewish(julday, &year, &month, &day); - if (!heb) { - sprintf(date, "%i/%i/%i", month, day, year); - RETURN_STRING(date, 1); - } else { - if (year <= 0 || year > 9999) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Year out of range (0-9999)."); - RETURN_FALSE; - } - - sprintf(hebdate, "%s %s %s", heb_number_to_chars(day, fl, &dayp), JewishMonthHebName[month], heb_number_to_chars(year, fl, &yearp)); - - if (dayp) { - efree(dayp); - } - if (yearp) { - efree(yearp); - } - - RETURN_STRING(hebdate, 1); - - } -} -/* }}} */ - -/* {{{ proto int jewishtojd(int month, int day, int year) - Converts a jewish calendar date to a julian day count */ -PHP_FUNCTION(jewishtojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(JewishToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto string jdtofrench(int juliandaycount) - Converts a julian day count to a french republic calendar date */ -PHP_FUNCTION(jdtofrench) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToFrench(julday, &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int frenchtojd(int month, int day, int year) - Converts a french republic calendar date to julian day count */ -PHP_FUNCTION(frenchtojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(FrenchToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto mixed jddayofweek(int juliandaycount [, int mode]) - Returns name or number of day of week from julian day count */ -PHP_FUNCTION(jddayofweek) -{ - long julday, mode = CAL_DOW_DAYNO; - int day; - char *daynamel, *daynames; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &mode) == FAILURE) { - RETURN_FALSE; - } - - day = DayOfWeek(julday); - daynamel = DayNameLong[day]; - daynames = DayNameShort[day]; - - switch (mode) { - case CAL_DOW_SHORT: - RETURN_STRING(daynamel, 1); - break; - case CAL_DOW_LONG: - RETURN_STRING(daynames, 1); - break; - case CAL_DOW_DAYNO: - default: - RETURN_LONG(day); - break; - } -} -/* }}} */ - -/* {{{ proto string jdmonthname(int juliandaycount, int mode) - Returns name of month for julian day count */ -PHP_FUNCTION(jdmonthname) -{ - long julday, mode; - char *monthname = NULL; - int month, day, year; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &julday, &mode) == FAILURE) { - RETURN_FALSE; - } - - switch (mode) { - case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */ - SdnToGregorian(julday, &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */ - SdnToJulian(julday, &year, &month, &day); - monthname = MonthNameShort[month]; - break; - case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */ - SdnToJulian(julday, &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JEWISH: /* jewish month */ - SdnToJewish(julday, &year, &month, &day); - monthname = JewishMonthName[month]; - break; - case CAL_MONTH_FRENCH: /* french month */ - SdnToFrench(julday, &year, &month, &day); - monthname = FrenchMonthName[month]; - break; - default: /* default gregorian */ - case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */ - SdnToGregorian(julday, &year, &month, &day); - monthname = MonthNameShort[month]; - break; - } - - RETURN_STRING(monthname, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/config.m4 b/ext/calendar/config.m4 deleted file mode 100644 index a80101adbb0f9..0000000000000 --- a/ext/calendar/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support, -[ --enable-calendar Enable support for calendar conversion]) - -if test "$PHP_CALENDAR" = "yes"; then - AC_DEFINE(HAVE_CALENDAR,1,[ ]) - PHP_NEW_EXTENSION(calendar, calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c, $ext_shared) -fi diff --git a/ext/calendar/config.w32 b/ext/calendar/config.w32 deleted file mode 100644 index bd9faba46a08c..0000000000000 --- a/ext/calendar/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("calendar", "calendar conversion support", "yes"); - -if (PHP_CALENDAR == "yes") { - EXTENSION("calendar", "calendar.c dow.c french.c gregor.c jewish.c \ - julian.c easter.c cal_unix.c"); - AC_DEFINE('HAVE_CALENDAR', 1, 'Have calendar'); -} diff --git a/ext/calendar/dow.c b/ext/calendar/dow.c deleted file mode 100644 index 64ae008f77716..0000000000000 --- a/ext/calendar/dow.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * int - * DayOfWeek( - * long int sdn); - * - * Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for - * Sunday, 1 for Monday, etc. and 6 stands for Saturday. - * - * char *DayNameShort[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the abbreviated (three character) name of the day. - * - * char *DayNameLong[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the name of the day. - * - **************************************************************************/ - -#include "sdncal.h" - -int DayOfWeek( - long int sdn) -{ - int dow; - - dow = (sdn + 1) % 7; - if (dow >= 0) { - return (dow); - } else { - return (dow + 7); - } -} - -char *DayNameShort[7] = -{ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" -}; - -char *DayNameLong[7] = -{ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c deleted file mode 100644 index 225904489ab44..0000000000000 --- a/ext/calendar/easter.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm) -{ - - /* based on code by Simon Kershaw, */ - - struct tm te; - long year, golden, solar, lunar, pfm, dom, tmp, easter; - long method = CAL_EASTER_DEFAULT; - - /* Default to the current year if year parameter is not given */ - { - time_t a; - struct tm b; - time(&a); - php_localtime_r(&a, &b); - year = 1900 + b.tm_year; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "|ll", &year, &method) == FAILURE) { - return; - } - - if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive"); - RETURN_FALSE; - } - - golden = (year % 19) + 1; /* the Golden number */ - - if ((year <= 1582 && method != CAL_EASTER_ALWAYS_GREGORIAN) || - (year >= 1583 && year <= 1752 && method != CAL_EASTER_ROMAN && method != CAL_EASTER_ALWAYS_GREGORIAN) || - method == CAL_EASTER_ALWAYS_JULIAN) { /* JULIAN CALENDAR */ - - dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */ - if (dom < 0) { - dom += 7; - } - - pfm = (3 - (11*golden) - 7) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } else { /* GREGORIAN CALENDAR */ - dom = (year + (year/4) - (year/100) + (year/400)) % 7; /* the "Domincal number" */ - if (dom < 0) { - dom += 7; - } - - solar = (year-1600)/100 - (year-1600)/400; /* the solar and lunar corrections */ - lunar = (((year-1400) / 100) * 8) / 25; - - pfm = (3 - (11*golden) + solar - lunar) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } - - if ((pfm == 29) || (pfm == 28 && golden > 11)) { /* corrected date of the Paschal full moon */ - pfm--; /* - days after 21st March */ - } - - tmp = (4-pfm-dom) % 7; - if (tmp < 0) { - tmp += 7; - } - - easter = pfm + tmp + 1; /* Easter as the number of days after 21st March */ - - if (gm) { /* return a timestamp */ - te.tm_isdst = -1; - te.tm_year = year-1900; - te.tm_sec = 0; - te.tm_min = 0; - te.tm_hour = 0; - - if (easter < 11) { - te.tm_mon = 2; /* March */ - te.tm_mday = easter+21; - } else { - te.tm_mon = 3; /* April */ - te.tm_mday = easter-10; - } - - Z_LVAL_P(return_value) = mktime(&te); - } else { /* return the days after March 21 */ - Z_LVAL_P(return_value) = easter; - } - - Z_TYPE_P(return_value) = IS_LONG; - -} - -/* {{{ proto int easter_date([int year]) - Return the timestamp of midnight on Easter of a given year (defaults to current year) */ -PHP_FUNCTION(easter_date) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int easter_days([int year, [int method]]) - Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */ -PHP_FUNCTION(easter_days) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/calendar/french.c b/ext/calendar/french.c deleted file mode 100644 index 5b4dd53750659..0000000000000 --- a/ext/calendar/french.c +++ /dev/null @@ -1,160 +0,0 @@ -/* $selId: french.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToFrench( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a French republican calendar date. If the input SDN is - * before the first day of year 1 or after the last day of year 14, the - * three output values will all be set to zero, otherwise *pYear will be in - * the range 1 to 14 inclusive; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. If *pMonth is - * 13, the SDN represents one of the holidays at the end of the year and - * *pDay will be in the range 1 to 6 inclusive. - * - * long int - * FrenchToSdn( - * int year, - * int month, - * int day); - * - * Convert a French republican calendar date to a SDN. Zero is returned - * when the input date is detected as invalid or out of the supported - * range. The return value will be > 0 for all valid, supported dates, but - * there are some invalid dates that will return a positive value. To - * verify that a date is valid, convert it to SDN and then back and compare - * with the original. - * - * char *FrenchMonthName[14]; - * - * Convert a French republican month number (1 to 13) to the name of the - * French republican month (null terminated). An index of 13 (for the - * "extra" days at the end of the year) will return the string "Extra". An - * index of zero will return a zero length string. - * - * VALID RANGE - * - * These routines only convert dates in years 1 through 14 (Gregorian - * dates 22 September 1792 through 22 September 1806). This more than - * covers the period when the calendar was in use. - * - * I would support a wider range of dates, but I have not been able to - * find an authoritative definition of when leap years were to have - * occurred. There are suggestions that it was to skip a leap year ever - * 100 years like the Gregorian calendar. - * - * CALENDAR OVERVIEW - * - * The French republican calendar was adopted in October 1793 during - * the French Revolution and was abandoned in January 1806. The intent - * was to create a new calendar system that was based on scientific - * principals, not religious traditions. - * - * The year is divided into 12 months of 30 days each. The remaining 5 - * to 6 days in the year are grouped at the end and are holidays. Each - * month is divided into three decades (instead of weeks) of 10 days - * each. - * - * The epoch (first day of the first year) is 22 September 1792 in the - * Gregorian calendar. Leap years are every fourth year (year 3, 7, - * 11, etc.) - * - * TESTING - * - * This algorithm has been tested from the year 1 to 14. The source - * code of the verification program is included in this package. - * - * REFERENCES - * - * I have found no detailed, authoritative reference on this calendar. - * The algorithms are based on a preponderance of less authoritative - * sources. - * - **************************************************************************/ - -#include "sdncal.h" - -#define FRENCH_SDN_OFFSET 2375474 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_MONTH 30 -#define FIRST_VALID 2375840 -#define LAST_VALID 2380952 - -void SdnToFrench( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int temp; - int dayOfYear; - - if (sdn < FIRST_VALID || sdn > LAST_VALID) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn - FRENCH_SDN_OFFSET) * 4 - 1; - *pYear = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4; - *pMonth = dayOfYear / DAYS_PER_MONTH + 1; - *pDay = dayOfYear % DAYS_PER_MONTH + 1; -} - -long int FrenchToSdn( - int year, - int month, - int day) -{ - /* check for invalid dates */ - if (year < 1 || year > 14 || - month < 1 || month > 13 || - day < 1 || day > 30) { - return (0); - } - return ((year * DAYS_PER_4_YEARS) / 4 - + (month - 1) * DAYS_PER_MONTH - + day - + FRENCH_SDN_OFFSET); -} - -char *FrenchMonthName[14] = -{ - "", - "Vendemiaire", - "Brumaire", - "Frimaire", - "Nivose", - "Pluviose", - "Ventose", - "Germinal", - "Floreal", - "Prairial", - "Messidor", - "Thermidor", - "Fructidor", - "Extra" -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/gregor.c b/ext/calendar/gregor.c deleted file mode 100644 index f48950901a605..0000000000000 --- a/ext/calendar/gregor.c +++ /dev/null @@ -1,265 +0,0 @@ -/* $selId: gregor.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToGregorian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Gregorian calendar date. If the input SDN is less - * than 1, the three output values will all be set to zero, otherwise - * *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * GregorianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Gregorian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *MonthNameShort[13]; - * - * Convert a Gregorian month number (1 to 12) to the abbreviated (three - * character) name of the Gregorian month (null terminated). An index of - * zero will return a zero length string. - * - * char *MonthNameLong[13]; - * - * Convert a Gregorian month number (1 to 12) to the name of the Gregorian - * month (null terminated). An index of zero will return a zero length - * string. - * - * VALID RANGE - * - * 4714 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4714 - * B.C., such use may not be meaningful. The Gregorian calendar was - * not instituted until October 15, 1582 (or October 5, 1582 in the - * Julian calendar). Some countries did not accept it until much - * later. For example, Britain converted in 1752, The USSR in 1918 and - * Greece in 1923. Most European countries used the Julian calendar - * prior to the Gregorian. - * - * CALENDAR OVERVIEW - * - * The Gregorian calendar is a modified version of the Julian calendar. - * The only difference being the specification of leap years. The - * Julian calendar specifies that every year that is a multiple of 4 - * will be a leap year. This leads to a year that is 365.25 days long, - * but the current accepted value for the tropical year is 365.242199 - * days. - * - * To correct this error in the length of the year and to bring the - * vernal equinox back to March 21, Pope Gregory XIII issued a papal - * bull declaring that Thursday October 4, 1582 would be followed by - * Friday October 15, 1582 and that centennial years would only be a - * leap year if they were a multiple of 400. This shortened the year - * by 3 days per 400 years, giving a year of 365.2425 days. - * - * Another recently proposed change in the leap year rule is to make - * years that are multiples of 4000 not a leap year, but this has never - * been officially accepted and this rule is not implemented in these - * algorithms. - * - * ALGORITHMS - * - * The calculations are based on three different cycles: a 400 year - * cycle of leap years, a 4 year cycle of leap years and a 5 month - * cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 - * and 31 days, except for three anomalies: both July and August - * have 31 days, both December and January have 31, and February - * is less than 30. Starting with March, the lengths are in a - * cycle of 5 months (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the - * year starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4714 B.C. to 10000 - * A.D. The source code of the verification program is included in - * this package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). - * - **************************************************************************/ - -#include "sdncal.h" - -#define GREGOR_SDN_OFFSET 32045 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_400_YEARS 146097 - -void SdnToGregorian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int century; - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1; - - /* Calculate the century (year/100). */ - century = temp / DAYS_PER_400_YEARS; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3; - year = (century * 100) + (temp / DAYS_PER_4_YEARS); - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int GregorianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4714 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Nov 25, 4714 B.C.) */ - if (inputYear == -4714) { - if (inputMonth < 11) { - return (0); - } - if (inputMonth == 11 && inputDay < 25) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return (((year / 100) * DAYS_PER_400_YEARS) / 4 - + ((year % 100) * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - GREGOR_SDN_OFFSET); -} - -char *MonthNameShort[13] = -{ - "", - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" -}; - -char *MonthNameLong[13] = -{ - "", - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" -}; diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c deleted file mode 100644 index f4dc7c35ae57c..0000000000000 --- a/ext/calendar/jewish.c +++ /dev/null @@ -1,763 +0,0 @@ -/* $selId: jewish.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJewish( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Jewish calendar date. If the input SDN is before the - * first day of year 1, the three output values will all be set to zero, - * otherwise *pYear will be > 0; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar - * II is assigned the month number 7 and Elul is always 13. - * - * long int - * JewishToSdn( - * int year, - * int month, - * int day); - * - * Convert a Jewish calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *JewishMonthName[14]; - * - * Convert a Jewish month number (1 to 13) to the name of the Jewish month - * (null terminated). An index of zero will return a zero length string. - * - * VALID RANGE - * - * Although this software can handle dates all the way back to the year - * 1 (3761 B.C.), such use may not be meaningful. - * - * The Jewish calendar has been in use for several thousand years, but - * in the early days there was no formula to determine the start of a - * month. A new month was started when the new moon was first - * observed. - * - * It is not clear when the current rule based calendar replaced the - * observation based calendar. According to the book "Jewish Calendar - * Mystery Dispelled" by George Zinberg, the patriarch Hillel II - * published these rules in 358 A.D. But, according to The - * Encyclopedia Judaica, Hillel II may have only published the 19 year - * rule for determining the occurrence of leap years. - * - * I have yet to find a specific date when the current set of rules - * were known to be in use. - * - * CALENDAR OVERVIEW - * - * The Jewish calendar is based on lunar as well as solar cycles. A - * month always starts on or near a new moon and has either 29 or 30 - * days (a lunar cycle is about 29 1/2 days). Twelve of these - * alternating 29-30 day months gives a year of 354 days, which is - * about 11 1/4 days short of a solar year. - * - * Since a month is defined to be a lunar cycle (new moon to new moon), - * this 11 1/4 day difference cannot be overcome by adding days to a - * month as with the Gregorian calendar, so an entire month is - * periodically added to the year, making some years 13 months long. - * - * For astronomical as well as ceremonial reasons, the start of a new - * year may be delayed until a day or two after the new moon causing - * years to vary in length. Leap years can be from 383 to 385 days and - * common years can be from 353 to 355 days. These are the months of - * the year and their possible lengths: - * - * COMMON YEAR LEAP YEAR - * 1 Tishri 30 30 30 30 30 30 - * 2 Heshvan 29 29 30 29 29 30 (variable) - * 3 Kislev 29 30 30 29 30 30 (variable) - * 4 Tevet 29 29 29 29 29 29 - * 5 Shevat 30 30 30 30 30 30 - * 6 Adar I 29 29 29 30 30 30 (variable) - * 7 Adar II -- -- -- 29 29 29 (optional) - * 8 Nisan 30 30 30 30 30 30 - * 9 Iyyar 29 29 29 29 29 29 - * 10 Sivan 30 30 30 30 30 30 - * 11 Tammuz 29 29 29 29 29 29 - * 12 Av 30 30 30 30 30 30 - * 13 Elul 29 29 29 29 29 29 - * --- --- --- --- --- --- - * 353 354 355 383 384 385 - * - * Note that the month names and other words that appear in this file - * have multiple possible spellings in the Roman character set. I have - * chosen to use the spellings found in the Encyclopedia Judaica. - * - * Adar II, the month added for leap years, is sometimes referred to as - * the 13th month, but I have chosen to assign it the number 7 to keep - * the months in chronological order. This may not be consistent with - * other numbering schemes. - * - * Leap years occur in a fixed pattern of 19 years called the metonic - * cycle. The 3rd, 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. The first metonic cycle starts with Jewish - * year 1, or 3761/60 B.C. This is believed to be the year of - * creation. - * - * To construct the calendar for a year, you must first find the length - * of the year by determining the first day of the year (Tishri 1, or - * Rosh Ha-Shanah) and the first day of the following year. This - * selects one of the six possible month length configurations listed - * above. - * - * Finding the first day of the year is the most difficult part. - * Finding the date and time of the new moon (or molad) is the first - * step. For this purpose, the lunar cycle is assumed to be 29 days 12 - * hours and 793 halakim. A halakim is 1/1080th of an hour or 3 1/3 - * seconds. (This assumed value is only about 1/2 second less than the - * value used by modern astronomers -- not bad for a number that was - * determined so long ago.) The first molad of year 1 occurred on - * Sunday at 11:20:11 P.M. This would actually be Monday, because the - * Jewish day is considered to begin at sunset. - * - * Since sunset varies, the day is assumed to begin at 6:00 P.M. for - * calendar calculation purposes. So, the first molad was 5 hours 793 - * halakim after the start of Tishri 1, 0001 (which was Monday - * September 7, 4761 B.C. by the Gregorian calendar). All subsequent - * molads can be calculated from this starting point by adding the - * length of a lunar cycle. - * - * Once the molad that starts a year is determined the actual start of - * the year (Tishri 1) can be determined. Tishri 1 will be the day of - * the molad unless it is delayed by one of the following four rules - * (called dehiyyot). Each rule can delay the start of the year by one - * day, and since rule #1 can combine with one of the other rules, it - * can be delayed as much as two days. - * - * 1. Tishri 1 must never be Sunday, Wednesday or Friday. (This - * is largely to prevent certain holidays from occurring on the - * day before or after the Sabbath.) - * - * 2. If the molad occurs on or after noon, Tishri 1 must be - * delayed. - * - * 3. If it is a common (not leap) year and the molad occurs on - * Tuesday at or after 3:11:20 A.M., Tishri 1 must be delayed. - * - * 4. If it is the year following a leap year and the molad occurs - * on Monday at or after 9:32:43 and 1/3 sec, Tishri 1 must be - * delayed. - * - * GLOSSARY - * - * dehiyyot The set of 4 rules that determine when the new year - * starts relative to the molad. - * - * halakim 1/1080th of an hour or 3 1/3 seconds. - * - * lunar cycle The period of time between mean conjunctions of the - * sun and moon (new moon to new moon). This is - * assumed to be 29 days 12 hours and 793 halakim for - * calendar purposes. - * - * metonic cycle A 19 year cycle which determines which years are - * leap years and which are common years. The 3rd, - * 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. - * - * molad The date and time of the mean conjunction of the - * sun and moon (new moon). This is the approximate - * beginning of a month. - * - * Rosh Ha-Shanah The first day of the Jewish year (Tishri 1). - * - * Tishri The first month of the Jewish year. - * - * ALGORITHMS - * - * SERIAL DAY NUMBER TO JEWISH DATE - * - * The simplest approach would be to use the rules stated above to find - * the molad of Tishri before and after the given day number. Then use - * the molads to find Tishri 1 of the current and following years. - * From this the length of the year can be determined and thus the - * length of each month. But this method is used as a last resort. - * - * The first 59 days of the year are the same regardless of the length - * of the year. As a result, only the day number of the start of the - * year is required. - * - * Similarly, the last 6 months do not change from year to year. And - * since it can be determined whether the year is a leap year by simple - * division, the lengths of Adar I and II can be easily calculated. In - * fact, all dates after the 3rd month are consistent from year to year - * (once it is known whether it is a leap year). - * - * This means that if the given day number falls in the 3rd month or on - * the 30th day of the 2nd month the length of the year must be found, - * but in no other case. - * - * So, the approach used is to take the given day number and round it - * to the closest molad of Tishri (first new moon of the year). The - * rounding is not really to the *closest* molad, but is such that if - * the day number is before the middle of the 3rd month the molad at - * the start of the year is found, otherwise the molad at the end of - * the year is found. - * - * Only if the day number is actually found to be in the ambiguous - * period of 29 to 31 days is the other molad calculated. - * - * JEWISH DATE TO SERIAL DAY NUMBER - * - * The year number is used to find which 19 year metonic cycle contains - * the date and which year within the cycle (this is a division and - * modulus). This also determines whether it is a leap year. - * - * If the month is 1 or 2, the calculation is simple addition to the - * first of the year. - * - * If the month is 8 (Nisan) or greater, the calculation is simple - * subtraction from beginning of the following year. - * - * If the month is 4 to 7, it is considered whether it is a leap year - * and then simple subtraction from the beginning of the following year - * is used. - * - * Only if it is the 3rd month is both the start and end of the year - * required. - * - * TESTING - * - * This algorithm has been tested in two ways. First, 510 dates from a - * table in "Jewish Calendar Mystery Dispelled" were calculated and - * compared to the table. Second, the calculation algorithm described - * in "Jewish Calendar Mystery Dispelled" was coded and used to verify - * all dates from the year 1 (3761 B.C.) to the year 13760 (10000 - * A.D.). - * - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * The Encyclopedia Judaica, the entry for "Calendar" - * - * The Jewish Encyclopedia - * - * Jewish Calendar Mystery Dispelled by George Zinberg, Vantage Press, - * 1963 - * - * The Comprehensive Hebrew Calendar by Arthur Spier, Behrman House - * - * The Book of Calendars [note that this work contains many typos] - * - **************************************************************************/ - -#if defined(PHP_WIN32) && _MSC_VER >= 1200 -#pragma setlocale("english") -#endif - -#include "sdncal.h" - -#define HALAKIM_PER_HOUR 1080 -#define HALAKIM_PER_DAY 25920 -#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753) -#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) - -#define JEWISH_SDN_OFFSET 347997 -#define NEW_MOON_OF_CREATION 31524 - -#define SUNDAY 0 -#define MONDAY 1 -#define TUESDAY 2 -#define WEDNESDAY 3 -#define THURSDAY 4 -#define FRIDAY 5 -#define SATURDAY 6 - -#define NOON (18 * HALAKIM_PER_HOUR) -#define AM3_11_20 ((9 * HALAKIM_PER_HOUR) + 204) -#define AM9_32_43 ((15 * HALAKIM_PER_HOUR) + 589) - -static int monthsPerYear[19] = -{ -12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13 -}; - -static int yearOffset[19] = -{ - 0, 12, 24, 37, 49, 61, 74, 86, 99, 111, 123, - 136, 148, 160, 173, 185, 197, 210, 222 -}; - -char *JewishMonthName[14] = -{ - "", - "Tishri", - "Heshvan", - "Kislev", - "Tevet", - "Shevat", - "AdarI", - "AdarII", - "Nisan", - "Iyyar", - "Sivan", - "Tammuz", - "Av", - "Elul" -}; - -char *JewishMonthHebName[14] = -{ - "", - "úùĝé", - "çùċï", - "ëñìċ", - "èáú", - "ùáè", - "àĝ", - "'àĝ á", - "éñï", - "àééĝ", - "ñéċï", - "úîċĉ", - "àá", - "àìċì" -}; - -/************************************************************************ - * Given the year within the 19 year metonic cycle and the time of a molad - * (new moon) which starts that year, this routine will calculate what day - * will be the actual start of the year (Tishri 1 or Rosh Ha-Shanah). This - * first day of the year will be the day of the molad unless one of 4 rules - * (called dehiyyot) delays it. These 4 rules can delay the start of the - * year by as much as 2 days. - */ -static long int Tishri1( - int metonicYear, - long int moladDay, - long int moladHalakim) -{ - long int tishri1; - int dow; - int leapYear; - int lastWasLeapYear; - - tishri1 = moladDay; - dow = tishri1 % 7; - leapYear = metonicYear == 2 || metonicYear == 5 || metonicYear == 7 - || metonicYear == 10 || metonicYear == 13 || metonicYear == 16 - || metonicYear == 18; - lastWasLeapYear = metonicYear == 3 || metonicYear == 6 - || metonicYear == 8 || metonicYear == 11 || metonicYear == 14 - || metonicYear == 17 || metonicYear == 0; - - /* Apply rules 2, 3 and 4. */ - if ((moladHalakim >= NOON) || - ((!leapYear) && dow == TUESDAY && moladHalakim >= AM3_11_20) || - (lastWasLeapYear && dow == MONDAY && moladHalakim >= AM9_32_43)) { - tishri1++; - dow++; - if (dow == 7) { - dow = 0; - } - } - /* Apply rule 1 after the others because it can cause an additional - * delay of one day. */ - if (dow == WEDNESDAY || dow == FRIDAY || dow == SUNDAY) { - tishri1++; - } - return (tishri1); -} - -/************************************************************************ - * Given a metonic cycle number, calculate the date and time of the molad - * (new moon) that starts that cycle. Since the length of a metonic cycle - * is a constant, this is a simple calculation, except that it requires an - * intermediate value which is bigger that 32 bits. Because this - * intermediate value only needs 36 to 37 bits and the other numbers are - * constants, the process has been reduced to just a few steps. - */ -static void MoladOfMetonicCycle( - int metonicCycle, - long int *pMoladDay, - long int *pMoladHalakim) -{ - register unsigned long int r1, r2, d1, d2; - - /* Start with the time of the first molad after creation. */ - r1 = NEW_MOON_OF_CREATION; - - /* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32 - * bits of the result will be in r2 and the lower 16 bits will be - * in r1. */ - r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF); - r2 = r1 >> 16; - r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF); - - /* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the - * upper 16 bits of the quotient will be in d2 and the lower 16 bits - * will be in d1. */ - d2 = r2 / HALAKIM_PER_DAY; - r2 -= d2 * HALAKIM_PER_DAY; - r1 = (r2 << 16) | (r1 & 0xFFFF); - d1 = r1 / HALAKIM_PER_DAY; - r1 -= d1 * HALAKIM_PER_DAY; - - *pMoladDay = (d2 << 16) | d1; - *pMoladHalakim = r1; -} - -/************************************************************************ - * Given a day number, find the molad of Tishri (the new moon at the start - * of a year) which is closest to that day number. It's not really the - * *closest* molad that we want here. If the input day is in the first two - * months, we want the molad at the start of the year. If the input day is - * in the fourth to last months, we want the molad at the end of the year. - * If the input day is in the third month, it doesn't matter which molad is - * returned, because both will be required. This type of "rounding" allows - * us to avoid calculating the length of the year in most cases. - */ -static void FindTishriMolad( - long int inputDay, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim) -{ - long int moladDay; - long int moladHalakim; - int metonicCycle; - int metonicYear; - - /* Estimate the metonic cycle number. Note that this may be an under - * estimate because there are 6939.6896 days in a metonic cycle not - * 6940, but it will never be an over estimate. The loop below will - * correct for any error in this estimate. */ - metonicCycle = (inputDay + 310) / 6940; - - /* Calculate the time of the starting molad for this metonic cycle. */ - MoladOfMetonicCycle(metonicCycle, &moladDay, &moladHalakim); - - /* If the above was an under estimate, increment the cycle number until - * the correct one is found. For modern dates this loop is about 98.6% - * likely to not execute, even once, because the above estimate is - * really quite close. */ - while (moladDay < inputDay - 6940 + 310) { - metonicCycle++; - moladHalakim += HALAKIM_PER_METONIC_CYCLE; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - /* Find the molad of Tishri closest to this date. */ - for (metonicYear = 0; metonicYear < 18; metonicYear++) { - if (moladDay > inputDay - 74) { - break; - } - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - *pMetonicCycle = metonicCycle; - *pMetonicYear = metonicYear; - *pMoladDay = moladDay; - *pMoladHalakim = moladHalakim; -} - -/************************************************************************ - * Given a year, find the number of the first day of that year and the date - * and time of the starting molad. - */ -static void FindStartOfYear( - int year, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim, - int *pTishri1) -{ - *pMetonicCycle = (year - 1) / 19; - *pMetonicYear = (year - 1) % 19; - MoladOfMetonicCycle(*pMetonicCycle, pMoladDay, pMoladHalakim); - - *pMoladHalakim += HALAKIM_PER_LUNAR_CYCLE * yearOffset[*pMetonicYear]; - *pMoladDay += *pMoladHalakim / HALAKIM_PER_DAY; - *pMoladHalakim = *pMoladHalakim % HALAKIM_PER_DAY; - - *pTishri1 = Tishri1(*pMetonicYear, *pMoladDay, *pMoladHalakim); -} - -/************************************************************************ - * Given a serial day number (SDN), find the corresponding year, month and - * day in the Jewish calendar. The three output values will always be - * modified. If the input SDN is before the first day of year 1, they will - * all be set to zero, otherwise *pYear will be > 0; *pMonth will be in the - * range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive. - */ -void SdnToJewish( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int inputDay; - long int day; - long int halakim; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - int yearLength; - - if (sdn <= JEWISH_SDN_OFFSET) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - inputDay = sdn - JEWISH_SDN_OFFSET; - - FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - - if (inputDay >= tishri1) { - /* It found Tishri 1 at the start of the year. */ - *pYear = metonicCycle * 19 + metonicYear + 1; - if (inputDay < tishri1 + 59) { - if (inputDay < tishri1 + 30) { - *pMonth = 1; - *pDay = inputDay - tishri1 + 1; - } else { - *pMonth = 2; - *pDay = inputDay - tishri1 - 29; - } - return; - } - /* We need the length of the year to figure this out, so find - * Tishri 1 of the next year. */ - halakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - day += halakim / HALAKIM_PER_DAY; - halakim = halakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, day, halakim); - } else { - /* It found Tishri 1 at the end of the year. */ - *pYear = metonicCycle * 19 + metonicYear; - if (inputDay >= tishri1 - 177) { - /* It is one of the last 6 months of the year. */ - if (inputDay > tishri1 - 30) { - *pMonth = 13; - *pDay = inputDay - tishri1 + 30; - } else if (inputDay > tishri1 - 60) { - *pMonth = 12; - *pDay = inputDay - tishri1 + 60; - } else if (inputDay > tishri1 - 89) { - *pMonth = 11; - *pDay = inputDay - tishri1 + 89; - } else if (inputDay > tishri1 - 119) { - *pMonth = 10; - *pDay = inputDay - tishri1 + 119; - } else if (inputDay > tishri1 - 148) { - *pMonth = 9; - *pDay = inputDay - tishri1 + 148; - } else { - *pMonth = 8; - *pDay = inputDay - tishri1 + 178; - } - return; - } else { - if (monthsPerYear[(*pYear - 1) % 19] == 13) { - *pMonth = 7; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } else { - *pMonth = 6; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 29; - if (*pDay > 0) - return; - - /* We need the length of the year to figure this out, so find - * Tishri 1 of this year. */ - tishri1After = tishri1; - FindTishriMolad(day - 365, - &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - } - } - - yearLength = tishri1After - tishri1; - day = inputDay - tishri1 - 29; - if (yearLength == 355 || yearLength == 385) { - /* Heshvan has 30 days */ - if (day <= 30) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 30; - } else { - /* Heshvan has 29 days */ - if (day <= 29) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 29; - } - - /* It has to be Kislev. */ - *pMonth = 3; - *pDay = day; -} - -/************************************************************************ - * Given a year, month and day in the Jewish calendar, find the - * corresponding serial day number (SDN). Zero is returned when the input - * date is detected as invalid. The return value will be > 0 for all valid - * dates, but there are some invalid dates that will return a positive - * value. To verify that a date is valid, convert it to SDN and then back - * and compare with the original. - */ -long int JewishToSdn( - int year, - int month, - int day) -{ - long int sdn; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - long int moladDay; - long int moladHalakim; - int yearLength; - int lengthOfAdarIAndII; - - if (year <= 0 || day <= 0 || day > 30) { - return (0); - } - switch (month) { - case 1: - case 2: - /* It is Tishri or Heshvan - don't need the year length. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - if (month == 1) { - sdn = tishri1 + day - 1; - } else { - sdn = tishri1 + day + 29; - } - break; - - case 3: - /* It is Kislev - must find the year length. */ - - /* Find the start of the year. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - - /* Find the end of the year. */ - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, moladDay, moladHalakim); - - yearLength = tishri1After - tishri1; - - if (yearLength == 355 || yearLength == 385) { - sdn = tishri1 + day + 59; - } else { - sdn = tishri1 + day + 58; - } - break; - - case 4: - case 5: - case 6: - /* It is Tevet, Shevat or Adar I - don't need the year length. */ - - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - if (monthsPerYear[(year - 1) % 19] == 12) { - lengthOfAdarIAndII = 29; - } else { - lengthOfAdarIAndII = 59; - } - - if (month == 4) { - sdn = tishri1After + day - lengthOfAdarIAndII - 237; - } else if (month == 5) { - sdn = tishri1After + day - lengthOfAdarIAndII - 208; - } else { - sdn = tishri1After + day - lengthOfAdarIAndII - 178; - } - break; - - default: - /* It is Adar II or later - don't need the year length. */ - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - switch (month) { - case 7: - sdn = tishri1After + day - 207; - break; - case 8: - sdn = tishri1After + day - 178; - break; - case 9: - sdn = tishri1After + day - 148; - break; - case 10: - sdn = tishri1After + day - 119; - break; - case 11: - sdn = tishri1After + day - 89; - break; - case 12: - sdn = tishri1After + day - 60; - break; - case 13: - sdn = tishri1After + day - 30; - break; - default: - return (0); - } - } - return (sdn + JEWISH_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c deleted file mode 100644 index 39bcbc7e655d4..0000000000000 --- a/ext/calendar/julian.c +++ /dev/null @@ -1,249 +0,0 @@ -/* $selId: julian.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJulian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Julian calendar date. If the input SDN is less than - * 1, the three output values will all be set to zero, otherwise *pYear - * will be >= -4713 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * JulianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Julian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * VALID RANGE - * - * 4713 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4713 - * B.C., such use may not be meaningful. The calendar was created in - * 46 B.C., but the details did not stabilize until at least 8 A.D., - * and perhaps as late at the 4th century. Also, the beginning of a - * year varied from one culture to another - not all accepted January - * as the first month. - * - * CALENDAR OVERVIEW - * - * Julias Ceasar created the calendar in 46 B.C. as a modified form of - * the old Roman republican calendar which was based on lunar cycles. - * The new Julian calendar set fixed lengths for the months, abandoning - * the lunar cycle. It also specified that there would be exactly 12 - * months per year and 365.25 days per year with every 4th year being a - * leap year. - * - * Note that the current accepted value for the tropical year is - * 365.242199 days, not 365.25. This lead to an 11 day shift in the - * calendar with respect to the seasons by the 16th century when the - * Gregorian calendar was created to replace the Julian calendar. - * - * The difference between the Julian and today's Gregorian calendar is - * that the Gregorian does not make centennial years leap years unless - * they are a multiple of 400, which leads to a year of 365.2425 days. - * In other words, in the Gregorian calendar, 1700, 1800 and 1900 are - * not leap years, but 2000 is. All centennial years are leap years in - * the Julian calendar. - * - * The details are unknown, but the lengths of the months were adjusted - * until they finally stablized in 8 A.D. with their current lengths: - * - * January 31 - * February 28/29 - * March 31 - * April 30 - * May 31 - * June 30 - * Quintilis/July 31 - * Sextilis/August 31 - * September 30 - * October 31 - * November 30 - * December 31 - * - * In the early days of the calendar, the days of the month were not - * numbered as we do today. The numbers ran backwards (decreasing) and - * were counted from the Ides (15th of the month - which in the old - * Roman republican lunar calendar would have been the full moon) or - * from the Nonae (9th day before the Ides) or from the beginning of - * the next month. - * - * In the early years, the beginning of the year varied, sometimes - * based on the ascension of rulers. It was not always the first of - * January. - * - * Also, today's epoch, 1 A.D. or the birth of Jesus Christ, did not - * come into use until several centuries later when Christianity became - * a dominant religion. - * - * ALGORITHMS - * - * The calculations are based on two different cycles: a 4 year cycle - * of leap years and a 5 month cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 and - * 31 days, except for three anomalies: both July and August have 31 - * days, both December and January have 31, and February is less than - * 30. Starting with March, the lengths are in a cycle of 5 months - * (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the year - * starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4713 B.C. to 10000 A.D. - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). [Note: the published algorithm is for the - * Gregorian calendar, but was adjusted to use the Julian calendar's - * simpler leap year rule.] - * - **************************************************************************/ - -#include "sdncal.h" - -#define JULIAN_SDN_OFFSET 32083 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 - -void SdnToJulian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + JULIAN_SDN_OFFSET) * 4 - 1; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - year = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int JulianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4713 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Jan 2, 4713 B.C.) */ - if (inputYear == -4713) { - if (inputMonth == 1 && inputDay == 1) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return ((year * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - JULIAN_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/package.xml b/ext/calendar/package.xml deleted file mode 100644 index 877b745123d37..0000000000000 --- a/ext/calendar/package.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - calendar - Date conversion between different calendar formats - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - lead - - - shane - Shane Caraveo - developer - shane@caraveo.com - - - colin - Colin Viebrock - developer - colin@easydns.com - - - wez - Wez Furlong - developer - wez@php.net - - - -The calendar extension presents a series of functions to simplify -converting between different calendar formats. The intermediary or -standard it is based on is the Julian Day Count. The Julian Day Count -is a count of days starting from January 1st, 4713 B.C. To convert -between calendar systems, you must first convert to Julian Day Count, -then to the calendar system of your choice. Julian Day Count is very -different from the Julian Calendar! - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/calendar/php_calendar.h b/ext/calendar/php_calendar.h deleted file mode 100644 index 79c9edf73c321..0000000000000 --- a/ext/calendar/php_calendar.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef PHP_CALENDAR_H -#define PHP_CALENDAR_H - -extern zend_module_entry calendar_module_entry; -#define calendar_module_ptr &calendar_module_entry - -/* Functions */ - -PHP_MINIT_FUNCTION(calendar); -PHP_RINIT_FUNCTION(calendar); -PHP_RSHUTDOWN_FUNCTION(calendar); -PHP_MINFO_FUNCTION(calendar); - -PHP_FUNCTION(jdtogregorian); -PHP_FUNCTION(gregoriantojd); -PHP_FUNCTION(jdtojulian); -PHP_FUNCTION(juliantojd); -PHP_FUNCTION(jdtojewish); -PHP_FUNCTION(jewishtojd); -PHP_FUNCTION(jdtofrench); -PHP_FUNCTION(frenchtojd); -PHP_FUNCTION(jddayofweek); -PHP_FUNCTION(jdmonthname); -PHP_FUNCTION(easter_days); -PHP_FUNCTION(easter_date); -PHP_FUNCTION(unixtojd); -PHP_FUNCTION(jdtounix); -PHP_FUNCTION(cal_from_jd); -PHP_FUNCTION(cal_to_jd); -PHP_FUNCTION(cal_days_in_month); -PHP_FUNCTION(cal_info); - -#define phpext_calendar_ptr calendar_module_ptr - -/* - * Specifying the easter calculation method - * - * DEFAULT is Anglican, ie. use Julian calendar before 1753 - * and Gregorian after that. With ROMAN, the cutoff year is 1582. - * ALWAYS_GREGORIAN and ALWAYS_JULIAN force the calendar - * regardless of date. - * - */ - -#define CAL_EASTER_DEFAULT 0 -#define CAL_EASTER_ROMAN 1 -#define CAL_EASTER_ALWAYS_GREGORIAN 2 -#define CAL_EASTER_ALWAYS_JULIAN 3 - -#endif diff --git a/ext/calendar/sdncal.h b/ext/calendar/sdncal.h deleted file mode 100644 index 81328d1369cf5..0000000000000 --- a/ext/calendar/sdncal.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef SDNCAL_H -#define SDNCAL_H -/* - * This code has been modified for use with PHP - * by Shane Caraveo shane@caraveo.com - * see below for more details - * - */ - -/* $selId: sdncal.h,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * This package defines a set of routines that convert calendar dates to - * and from a serial day number (SDN). The SDN is a serial numbering of - * days where SDN 1 is November 25, 4714 BC in the Gregorian calendar and - * SDN 2447893 is January 1, 1990. This system of day numbering is - * sometimes referred to as Julian days, but to avoid confusion with the - * Julian calendar, it is referred to as serial day numbers here. The term - * Julian days is also used to mean the number of days since the beginning - * of the current year. - * - * The SDN can be used as an intermediate step in converting from one - * calendar system to another (such as Gregorian to Jewish). It can also - * be used for date computations such as easily comparing two dates, - * determining the day of the week, finding the date of yesterday or - * calculating the number of days between two dates. - * - * When using this software on 16 bit systems, be careful to store SDNs in - * a long int, because it will not fit in the 16 bits that some systems - * allocate to an int. - * - * For each calendar, there are two routines provided. One converts dates - * in that calendar to SDN and the other converts SDN to calendar dates. - * The routines are named SdnTo() and ToSdn(), where - * is the name of the calendar system. - * - * SDN values less than one are not supported. If a conversion routine - * returns an SDN of zero, this means that the date given is either invalid - * or is outside the supported range for that calendar. - * - * At least some validity checks are performed on input dates. For - * example, a negative month number will result in the return of zero for - * the SDN. A returned SDN greater than one does not necessarily mean that - * the input date was valid. To determine if the date is valid, convert it - * to SDN, and if the SDN is greater than zero, convert it back to a date - * and compare to the original. For example: - * - * int y1, m1, d1; - * int y2, m2, d2; - * long int sdn; - * ... - * sdn = GregorianToSdn(y1, m1, d1); - * if (sdn > 0) { - * SdnToGregorian(sdn, &y2, &m2, &d2); - * if (y1 == y2 && m1 == m2 && d1 == d2) { - * ... date is valid ... - * } - * } - * - **************************************************************************/ - -/* Gregorian calendar conversions. */ -void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int GregorianToSdn(int year, int month, int day); -extern char *MonthNameShort[13]; -extern char *MonthNameLong[13]; - -/* Julian calendar conversions. */ -void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JulianToSdn(int year, int month, int day); - -/* Jewish calendar conversions. */ -void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JewishToSdn(int year, int month, int day); -extern char *JewishMonthName[14]; -extern char *JewishMonthHebName[14]; - -/* French republic calendar conversions. */ -void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay); -long int FrenchToSdn(int inputYear, int inputMonth, int inputDay); -extern char *FrenchMonthName[14]; - -/* Islamic calendar conversions. */ -/* Not implemented yet. */ - -/* Day of week conversion. 0=Sunday, 6=Saturday */ -int DayOfWeek(long int sdn); -extern char *DayNameShort[7]; -extern char *DayNameLong[7]; - -#endif /* SDNCAL_H */ diff --git a/ext/calendar/tests/jdtojewish.phpt b/ext/calendar/tests/jdtojewish.phpt deleted file mode 100644 index c6dc1fd5949c5..0000000000000 --- a/ext/calendar/tests/jdtojewish.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -jdtojewish() function ---FILE-- - ---EXPECT-- -string(184) "2/22/5763 -ëá çùċï äúùñâ -ëá çùċï ä'úùñâ -ëá çùċï ä àìôéí úùñâ -ëá çùċï ä' àìôéí úùñâ -ë"á çùċï äúùñ"â -á' çùċï äúùñ"â -á' çùċï ä'úùñ"â -á' çùċï ä àìôéí úùñ"â -á' çùċï ä' àìôéí úùñ"â -" diff --git a/ext/com_dotnet/CREDITS b/ext/com_dotnet/CREDITS deleted file mode 100644 index 8dd06fa662b4f..0000000000000 --- a/ext/com_dotnet/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -COM and .Net -Wez Furlong diff --git a/ext/com_dotnet/README b/ext/com_dotnet/README deleted file mode 100644 index 0d9db40d981d4..0000000000000 --- a/ext/com_dotnet/README +++ /dev/null @@ -1,71 +0,0 @@ -This is the new php5 COM module. - -It is not 100% backwards compatible with PHP 4 ext/com, but you should not miss -the "features" that have not been retained. - -This module exposes 3 classes: variant, com and dotnet(*). -com and dotnet classes are descendants of the variant class; the only -difference between the three are their constructors. Once instantiated, the -module doesn't make a distinction between them. - -COM errrors are mapped to exceptions; you should protect your COM code using -the try..catch construct if you want to be able to handle error conditions. - -Be warned that due to the way the ZE2 currently works, exceptions are only -"armed" at the time they are detected, but do not "detonate" until the end of -the statement. So, code like this: - - $obj->foo[43]->bar(); - -Where the foo[43] access triggers an exception will continue to call the bar() -method on a null object and cause a fatal php error. - -Default properties and array access: - -$obj = new COM("..."); -$obj[1]->foo(); - -The code above will use the type information for the object to determine its -default property and then access it. In PHP 4, it was hard-coded to use the -"Items" member, which was wrong. - -The default property will also be used by the casting support to determine the -value for the object. - -Variants: - -This implementation of COM takes a simpler approach than the PHP 4 version; -we only map a few native types to COM and vice-versa, leaving the more complex -things as variants. This allows greater consistency of data when passing -parameters to and from COM objects (no data will be lost). In addition, a -large number of the variant API has been mapped to PHP space so that you can -use it for working with the special variant decimal, currency and date time -types. This could be used as a replacement for the bcmath extension, for -example. - -You can use the new object casting hook to for a php-native representation of -a variant object: - -$a = new variant(4); -$b = new variant(6); -$c = variant_add($a, $b); -echo $c; // outputs 10 as a string, instead of Object - -Sample Script: - -Version}\n"; -$word->Visible = 1; -$word->Documents->Add(); -$word->Selection->TypeText("This is a test..."); -$word->Documents[1]->SaveAs("Useless test.doc"); -$word->Quit(); -?> - -TODO: - -- documentation - -* dotnet support requires that you have the mscoree.h header from the .net sdk - when you build the module. diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c deleted file mode 100644 index e160e474c7c6a..0000000000000 --- a/ext/com_dotnet/com_com.c +++ /dev/null @@ -1,837 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -/* {{{ com_create_instance - ctor for COM class */ -PHP_FUNCTION(com_create_instance) -{ - zval *object = getThis(); - zval *server_params = NULL; - php_com_dotnet_object *obj; - char *module_name, *typelib_name = NULL, *server_name = NULL; - char *user_name = NULL, *domain_name = NULL, *password = NULL; - int module_name_len, typelib_name_len, server_name_len, - user_name_len, domain_name_len, password_len; - OLECHAR *moniker; - CLSID clsid; - CLSCTX ctx = CLSCTX_SERVER; - HRESULT res = E_FAIL; - int mode = COMG(autoreg_case_sensitive) ? CONST_CS : 0; - ITypeLib *TL = NULL; - COSERVERINFO info; - COAUTHIDENTITY authid = {0}; - COAUTHINFO authinfo = { - RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, - RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, - &authid, EOAC_NONE - }; - - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "s|s!ls", - &module_name, &module_name_len, &server_name, &server_name_len, - &obj->code_page, &typelib_name, &typelib_name_len) && - FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "sa|ls", - &module_name, &module_name_len, &server_params, &obj->code_page, - &typelib_name, &typelib_name_len)) { - - php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!" TSRMLS_CC); - ZVAL_NULL(object); - return; - } - - if (server_name) { - ctx = CLSCTX_REMOTE_SERVER; - } else if (server_params) { - zval **tmp; - - /* decode the data from the array */ - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Server", sizeof("Server"), (void**)&tmp)) { - convert_to_string_ex(tmp); - server_name = Z_STRVAL_PP(tmp); - server_name_len = Z_STRLEN_PP(tmp); - ctx = CLSCTX_REMOTE_SERVER; - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Username", sizeof("Username"), (void**)&tmp)) { - convert_to_string_ex(tmp); - user_name = Z_STRVAL_PP(tmp); - user_name_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Password", sizeof("Password"), (void**)&tmp)) { - convert_to_string_ex(tmp); - password = Z_STRVAL_PP(tmp); - password_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Domain", sizeof("Domain"), (void**)&tmp)) { - convert_to_string_ex(tmp); - domain_name = Z_STRVAL_PP(tmp); - domain_name_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Flags", sizeof("Flags"), (void**)&tmp)) { - convert_to_long_ex(tmp); - ctx = (CLSCTX)Z_LVAL_PP(tmp); - } - } - - if (server_name && !COMG(allow_dcom)) { - php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]" TSRMLS_CC); - return; - } - - moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page TSRMLS_CC); - - /* if instantiating a remote object, either directly, or via - * a moniker, fill in the relevant info */ - if (server_name) { - info.dwReserved1 = 0; - info.dwReserved2 = 0; - info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page TSRMLS_CC); - - if (user_name) { - authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC); - authid.UserLength = user_name_len; - - if (password) { - authid.Password = (OLECHAR*)password; - authid.PasswordLength = password_len; - } else { - authid.Password = (OLECHAR*)""; - authid.PasswordLength = 0; - } - - if (domain_name) { - authid.Domain = (OLECHAR*)domain_name; - authid.DomainLength = domain_name_len; - } else { - authid.Domain = (OLECHAR*)""; - authid.DomainLength = 0; - } - authid.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - info.pAuthInfo = &authinfo; - } else { - info.pAuthInfo = NULL; - } - } - - if (FAILED(CLSIDFromString(moniker, &clsid))) { - /* try to use it as a moniker */ - IBindCtx *pBindCtx = NULL; - IMoniker *pMoniker = NULL; - ULONG ulEaten; - BIND_OPTS2 bopt = {0}; - - if (SUCCEEDED(res = CreateBindCtx(0, &pBindCtx))) { - if (server_name) { - /* fill in the remote server info. - * MSDN docs indicate that this might be ignored in - * current win32 implementations, but at least we are - * doing the right thing in readiness for the day that - * it does work */ - bopt.cbStruct = sizeof(bopt); - IBindCtx_GetBindOptions(pBindCtx, (BIND_OPTS*)&bopt); - bopt.pServerInfo = &info; - /* apparently, GetBindOptions will only ever return - * a regular BIND_OPTS structure. My gut feeling is - * that it will modify the size field to reflect that - * so lets be safe and set it to the BIND_OPTS2 size - * again */ - bopt.cbStruct = sizeof(bopt); - IBindCtx_SetBindOptions(pBindCtx, (BIND_OPTS*)&bopt); - } - - if (SUCCEEDED(res = MkParseDisplayName(pBindCtx, moniker, &ulEaten, &pMoniker))) { - res = IMoniker_BindToObject(pMoniker, pBindCtx, - NULL, &IID_IDispatch, (LPVOID*)&V_DISPATCH(&obj->v)); - - if (SUCCEEDED(res)) { - V_VT(&obj->v) = VT_DISPATCH; - } - - IMoniker_Release(pMoniker); - } - } - if (pBindCtx) { - IBindCtx_Release(pBindCtx); - } - } else if (server_name) { - MULTI_QI qi; - - qi.pIID = &IID_IDispatch; - qi.pItf = NULL; - qi.hr = S_OK; - - res = CoCreateInstanceEx(&clsid, NULL, ctx, &info, 1, &qi); - - if (SUCCEEDED(res)) { - res = qi.hr; - V_DISPATCH(&obj->v) = (IDispatch*)qi.pItf; - V_VT(&obj->v) = VT_DISPATCH; - } - } else { - res = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&V_DISPATCH(&obj->v)); - if (SUCCEEDED(res)) { - V_VT(&obj->v) = VT_DISPATCH; - } - } - - if (server_name) { - STR_FREE((char*)info.pwszName); - STR_FREE((char*)authid.User); - } - - efree(moniker); - - if (FAILED(res)) { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Failed to create COM object `%s': %s", module_name, werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - ZVAL_NULL(object); - return; - } - - /* we got the object and it lives ! */ - - /* see if it has TypeInfo available */ - if (FAILED(IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo)) && typelib_name) { - /* load up the library from the named file */ - int cached; - - TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached TSRMLS_CC); - - if (TL) { - if (COMG(autoreg_on) && !cached) { - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - } - - /* cross your fingers... there is no guarantee that this ITypeInfo - * instance has any relation to this IDispatch instance... */ - ITypeLib_GetTypeInfo(TL, 0, &obj->typeinfo); - ITypeLib_Release(TL); - } - } else if (obj->typeinfo && COMG(autoreg_on)) { - int idx; - - if (SUCCEEDED(ITypeInfo_GetContainingTypeLib(obj->typeinfo, &TL, &idx))) { - /* check if the library is already in the cache by getting its name */ - BSTR name; - - if (SUCCEEDED(ITypeLib_GetDocumentation(TL, -1, &name, NULL, NULL, NULL))) { - typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page TSRMLS_CC); - - if (SUCCESS == zend_ts_hash_add(&php_com_typelibraries, typelib_name, typelib_name_len+1, (void*)&TL, sizeof(ITypeLib*), NULL)) { - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - - /* add a reference for the hash */ - ITypeLib_AddRef(TL); - } - - } else { - /* try it anyway */ - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - } - - ITypeLib_Release(TL); - } - } - -} -/* }}} */ - -/* {{{ proto object com_get_active_object(string progid [, int code_page ]) - Returns a handle to an already running instance of a COM object */ -PHP_FUNCTION(com_get_active_object) -{ - CLSID clsid; - char *module_name; - int module_name_len; - long code_page = COMG(code_page); - IUnknown *unk = NULL; - IDispatch *obj = NULL; - HRESULT res; - OLECHAR *module = NULL; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &module_name, &module_name_len, &code_page)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC); - return; - } - - module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC); - - res = CLSIDFromString(module, &clsid); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - res = GetActiveObject(&clsid, NULL, &unk); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else if (obj) { - /* we got our dispatchable object */ - php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC); - } - } - } - - if (obj) { - IDispatch_Release(obj); - } - if (unk) { - IUnknown_Release(obj); - } - efree(module); -} -/* }}} */ - -/* Performs an Invoke on the given com object. - * returns a failure code and creates an exception if there was an error */ -HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, - WORD flags, DISPPARAMS *disp_params, VARIANT *v TSRMLS_DC) -{ - HRESULT hr; - unsigned int arg_err; - EXCEPINFO e; - - hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err); - - if (FAILED(hr)) { - char *source = NULL, *desc = NULL, *msg = NULL; - int source_len, desc_len; - - switch (hr) { - case DISP_E_EXCEPTION: - if (e.bstrSource) { - source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page TSRMLS_CC); - SysFreeString(e.bstrSource); - } - if (e.bstrDescription) { - desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page TSRMLS_CC); - SysFreeString(e.bstrDescription); - } - if (PG(html_errors)) { - spprintf(&msg, 0, "Source: %s
Description: %s", - source ? source : "Unknown", - desc ? desc : "Unknown"); - } else { - spprintf(&msg, 0, "Source: %s\nDescription: %s", - source ? source : "Unknown", - desc ? desc : "Unknown"); - } - if (desc) { - efree(desc); - } - if (source) { - efree(source); - } - if (e.bstrHelpFile) { - SysFreeString(e.bstrHelpFile); - } - break; - - case DISP_E_PARAMNOTFOUND: - case DISP_E_TYPEMISMATCH: - desc = php_win_err(hr); - spprintf(&msg, 0, "Parameter %d: %s", arg_err, desc); - LocalFree(desc); - break; - - case DISP_E_BADPARAMCOUNT: - if ((disp_params->cArgs + disp_params->cNamedArgs == 0) && (flags == DISPATCH_PROPERTYGET)) { - /* if getting a property and they are missing all parameters, - * we want to create a proxy object for them; so lets not create an - * exception here */ - msg = NULL; - break; - } - /* else fall through */ - - default: - desc = php_win_err(hr); - spprintf(&msg, 0, "Error [0x%08x] %s", hr, desc); - LocalFree(desc); - break; - } - - if (msg) { - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - } - } - - return hr; -} - -/* map an ID to a name */ -HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, - int namelen, DISPID *dispid TSRMLS_DC) -{ - OLECHAR *olename; - HRESULT hr; - DISPID *dispid_ptr; - - if (namelen == -1) { - namelen = strlen(name); - } - - if (obj->id_of_name_cache && SUCCESS == zend_hash_find(obj->id_of_name_cache, name, namelen, (void**)&dispid_ptr)) { - *dispid = *dispid_ptr; - return S_OK; - } - - olename = php_com_string_to_olestring(name, namelen, obj->code_page TSRMLS_CC); - - if (obj->typeinfo) { - hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid); - if (FAILED(hr)) { - hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid); - if (SUCCEEDED(hr)) { - /* fall back on IDispatch direct */ - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - } - } else { - hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid); - } - efree(olename); - - if (SUCCEEDED(hr)) { - /* cache the mapping */ - if (!obj->id_of_name_cache) { - ALLOC_HASHTABLE(obj->id_of_name_cache); - zend_hash_init(obj->id_of_name_cache, 2, NULL, NULL, 0); - } - zend_hash_update(obj->id_of_name_cache, name, namelen, dispid, sizeof(*dispid), NULL); - } - - return hr; -} - -/* the core of COM */ -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC) -{ - DISPID dispid, altdispid; - DISPPARAMS disp_params; - HRESULT hr; - VARIANT *vargs = NULL, *byref_vals = NULL; - int i, byref_count = 0, j; - zend_internal_function *f = (zend_internal_function*)EG(function_state_ptr)->function; - - /* assumption: that the active function (f) is the function we generated for the engine */ - if (!f || f->arg_info == NULL) { - f = NULL; - } - - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - char *winerr = NULL; - char *msg = NULL; - winerr = php_win_err(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); - LocalFree(winerr); - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - return FAILURE; - } - - - if (nargs) { - vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); - } - - if (f) { - for (i = 0; i < nargs; i++) { - if (f->arg_info[nargs - i - 1].pass_by_reference) { - byref_count++; - } - } - } - - if (byref_count) { - byref_vals = (VARIANT*)safe_emalloc(sizeof(VARIANT), byref_count, 0); - for (j = 0, i = 0; i < nargs; i++) { - if (f->arg_info[nargs - i - 1].pass_by_reference) { - /* put the value into byref_vals instead */ - php_com_variant_from_zval(&byref_vals[j], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - - /* if it is already byref, "move" it into the vargs array, otherwise - * make vargs a reference to this value */ - if (V_VT(&byref_vals[j]) & VT_BYREF) { - memcpy(&vargs[i], &byref_vals[j], sizeof(vargs[i])); - VariantInit(&byref_vals[j]); /* leave the variant slot empty to simplify cleanup */ - } else { - VariantInit(&vargs[i]); - V_VT(&vargs[i]) = V_VT(&byref_vals[j]) | VT_BYREF; - /* union magic ensures that this works out */ - vargs[i].byref = &V_UINT(&byref_vals[j]); - } - j++; - } else { - php_com_variant_from_zval(&vargs[i], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - } - - } else { - /* Invoke'd args are in reverse order */ - for (i = 0; i < nargs; i++) { - php_com_variant_from_zval(&vargs[i], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - } - - disp_params.cArgs = nargs; - disp_params.cNamedArgs = 0; - disp_params.rgvarg = vargs; - disp_params.rgdispidNamedArgs = NULL; - - if (flags & DISPATCH_PROPERTYPUT) { - altdispid = DISPID_PROPERTYPUT; - disp_params.rgdispidNamedArgs = &altdispid; - disp_params.cNamedArgs = 1; - } - - /* this will create an exception if needed */ - hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v TSRMLS_CC); - - /* release variants */ - if (vargs) { - for (i = 0, j = 0; i < nargs; i++) { - /* if this was byref, update the zval */ - if (f && f->arg_info[nargs - i - 1].pass_by_reference) { - SEPARATE_ZVAL_IF_NOT_REF(args[nargs - i - 1]); - - /* if the variant is pointing at the byref_vals, we need to map - * the pointee value as a zval; otherwise, the value is pointing - * into an existing PHP variant record */ - if (V_VT(&vargs[i]) & VT_BYREF) { - if (vargs[i].byref == &V_UINT(&byref_vals[j])) { - /* copy that value */ - php_com_zval_from_variant(*args[nargs - i - 1], &byref_vals[j], - obj->code_page TSRMLS_CC); - } - } else { - /* not sure if this can ever happen; the variant we marked as BYREF - * is no longer BYREF - copy its value */ - php_com_zval_from_variant(*args[nargs - i - 1], &vargs[i], - obj->code_page TSRMLS_CC); - } - VariantClear(&byref_vals[j]); - j++; - } - VariantClear(&vargs[i]); - } - efree(vargs); - } - - return SUCCEEDED(hr) ? SUCCESS : FAILURE; -} - - - -int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, - WORD flags, VARIANT *v, int nargs, zval **args TSRMLS_DC) -{ - DISPID altdispid; - DISPPARAMS disp_params; - HRESULT hr; - VARIANT *vargs = NULL; - int i; - - if (nargs) { - vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); - } - - /* Invoke'd args are in reverse order */ - for (i = 0; i < nargs; i++) { - php_com_variant_from_zval(&vargs[i], args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - - disp_params.cArgs = nargs; - disp_params.cNamedArgs = 0; - disp_params.rgvarg = vargs; - disp_params.rgdispidNamedArgs = NULL; - - if (flags & DISPATCH_PROPERTYPUT) { - altdispid = DISPID_PROPERTYPUT; - disp_params.rgdispidNamedArgs = &altdispid; - disp_params.cNamedArgs = 1; - } - - /* this will create an exception if needed */ - hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v TSRMLS_CC); - - /* release variants */ - if (vargs) { - for (i = 0; i < nargs; i++) { - VariantClear(&vargs[i]); - } - efree(vargs); - } - - /* a bit of a hack this, but it's needed for COM array access. */ - if (hr == DISP_E_BADPARAMCOUNT) - return hr; - - return SUCCEEDED(hr) ? SUCCESS : FAILURE; -} - -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval **args TSRMLS_DC) -{ - DISPID dispid; - HRESULT hr; - char *winerr = NULL; - char *msg = NULL; - - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - winerr = php_win_err(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); - LocalFree(winerr); - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - return FAILURE; - } - - return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args TSRMLS_CC); -} - -/* {{{ proto string com_create_guid() - Generate a globally unique identifier (GUID) */ -PHP_FUNCTION(com_create_guid) -{ - GUID retval; - OLECHAR *guid_string; - - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) { - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = php_com_olestring_to_string(guid_string, &Z_STRLEN_P(return_value), CP_ACP, 0); - - CoTaskMemFree(guid_string); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool com_event_sink(object comobject, object sinkobject [, mixed sinkinterface]) - Connect events from a COM object to a PHP object */ -PHP_FUNCTION(com_event_sink) -{ - zval *object, *sinkobject, *sink=NULL; - char *dispname = NULL, *typelibname = NULL; - zend_bool gotguid = 0; - php_com_dotnet_object *obj; - ITypeInfo *typeinfo = NULL; - - RETVAL_FALSE; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oo|z/", - &object, php_com_variant_class_entry, &sinkobject, &sink)) { - RETURN_FALSE; - } - - obj = CDNO_FETCH(object); - - if (sink && Z_TYPE_P(sink) == IS_ARRAY) { - /* 0 => typelibname, 1 => dispname */ - zval **tmp; - - if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS) - typelibname = Z_STRVAL_PP(tmp); - if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS) - dispname = Z_STRVAL_PP(tmp); - } else if (sink != NULL) { - convert_to_string(sink); - dispname = Z_STRVAL_P(sink); - } - - typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC); - - if (typeinfo) { - HashTable *id_to_name; - - ALLOC_HASHTABLE(id_to_name); - - if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page TSRMLS_CC)) { - - /* Create the COM wrapper for this sink */ - obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name TSRMLS_CC); - - /* Now hook it up to the source */ - php_com_object_enable_event_sink(obj, TRUE TSRMLS_CC); - RETVAL_TRUE; - - } else { - FREE_HASHTABLE(id_to_name); - } - } - - if (typeinfo) { - ITypeInfo_Release(typeinfo); - } - -} -/* }}} */ - -/* {{{ proto bool com_print_typeinfo(object comobject | string typelib, string dispinterface, bool wantsink) - Print out a PHP class definition for a dispatchable interface */ -PHP_FUNCTION(com_print_typeinfo) -{ - zval *arg1; - char *ifacename = NULL; - char *typelibname = NULL; - int ifacelen; - zend_bool wantsink = 0; - php_com_dotnet_object *obj = NULL; - ITypeInfo *typeinfo; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|s!b", &arg1, &ifacename, - &ifacelen, &wantsink)) { - RETURN_FALSE; - } - - if (Z_TYPE_P(arg1) == IS_OBJECT) { - CDNO_FETCH_VERIFY(obj, arg1); - } else { - convert_to_string(arg1); - typelibname = Z_STRVAL_P(arg1); - } - - typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0 TSRMLS_CC); - if (typeinfo) { - php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page) TSRMLS_CC); - ITypeInfo_Release(typeinfo); - RETURN_TRUE; - } else { - zend_error(E_WARNING, "Unable to find typeinfo using the parameters supplied"); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool com_message_pump([int timeoutms]) - Process COM messages, sleeping for up to timeoutms milliseconds */ -PHP_FUNCTION(com_message_pump) -{ - long timeoutms = 0; - MSG msg; - DWORD result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE) - RETURN_FALSE; - - result = MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutms, QS_ALLINPUT); - - if (result == WAIT_OBJECT_0) { - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - /* we processed messages */ - RETVAL_TRUE; - } else { - /* we did not process messages (timed out) */ - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive]) - Loads a Typelibrary and registers its constants */ -PHP_FUNCTION(com_load_typelib) -{ - char *name; - int namelen; - ITypeLib *pTL = NULL; - zend_bool cs = TRUE; - int codepage = COMG(code_page); - int cached = 0; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &name, &namelen, &cs)) { - return; - } - - RETVAL_FALSE; - - pTL = php_com_load_typelib_via_cache(name, codepage, &cached TSRMLS_CC); - if (pTL) { - if (cached) { - RETVAL_TRUE; - } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage TSRMLS_CC) == SUCCESS) { - RETVAL_TRUE; - } - - ITypeLib_Release(pTL); - pTL = NULL; - } -} -/* }}} */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c deleted file mode 100644 index 6764a82b7ac06..0000000000000 --- a/ext/com_dotnet/com_dotnet.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_MSCOREE_H -# include "php_ini.h" -# include "ext/standard/info.h" -# include "php_com_dotnet.h" -# include "php_com_dotnet_internal.h" -# include "Zend/zend_exceptions.h" -# include - -/* Since there is no official public mscorlib.h header file, and since - * generating your own version from the elusive binary .tlb file takes a lot of - * hacking and results in a 3MB header file (!), we opt for this slightly - * voodoo approach. The following is just enough definition to be able to - * reach the _AppDomain::CreateInstance method that we need to use to be able - * to fire up .Net objects. We used to use IDispatch for this, but it would - * not always work. - * - * The following info was obtained using OleView to export the IDL from - * mscorlib.tlb. Note that OleView is unable to generate C headers for this - * particular tlb... hence this mess. - */ - -const GUID IID_mscorlib_System_AppDomain = { -0x05F696DC, 0x2B29, 0x3663, {0xAD, 0x8B, 0xC4, 0x38, 0x9C, 0xF2, 0xA7, 0x13 }}; - -typedef struct _Imscorlib_System_AppDomain IAppDomain; - -struct _Imscorlib_System_AppDomainVtbl { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAppDomain * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAppDomain * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAppDomain * This); - - /* this is padding to get CreateInstance into the correct position */ -#define DUMMY_METHOD(x) HRESULT ( STDMETHODCALLTYPE *dummy_##x )(IAppDomain *This) - - DUMMY_METHOD(GetTypeInfoCount); - DUMMY_METHOD(GetTypeInfo); - DUMMY_METHOD(GetIDsOfNames); - DUMMY_METHOD(Invoke); - DUMMY_METHOD(ToString); - DUMMY_METHOD(Equals); - DUMMY_METHOD(GetHashCode); - DUMMY_METHOD(GetType); - DUMMY_METHOD(InitializeLifetimeService); - DUMMY_METHOD(GetLifetimeService); - DUMMY_METHOD(Evidence); - DUMMY_METHOD(add_DomainUnload); - DUMMY_METHOD(remove_DomainUnload); - DUMMY_METHOD(add_AssemblyLoad); - DUMMY_METHOD(remove_AssemblyLoad); - DUMMY_METHOD(add_ProcessExit); - DUMMY_METHOD(remove_ProcessExit); - DUMMY_METHOD(add_TypeResolve); - DUMMY_METHOD(remove_TypeResolve); - DUMMY_METHOD(add_ResourceResolve); - DUMMY_METHOD(remove_ResourceResolve); - DUMMY_METHOD(add_AssemblyResolve); - DUMMY_METHOD(remove_AssemblyResolve); - DUMMY_METHOD(add_UnhandledException); - DUMMY_METHOD(remove_UnhandledException); - DUMMY_METHOD(DefineDynamicAssembly); - DUMMY_METHOD(DefineDynamicAssembly_2); - DUMMY_METHOD(DefineDynamicAssembly_3); - DUMMY_METHOD(DefineDynamicAssembly_4); - DUMMY_METHOD(DefineDynamicAssembly_5); - DUMMY_METHOD(DefineDynamicAssembly_6); - DUMMY_METHOD(DefineDynamicAssembly_7); - DUMMY_METHOD(DefineDynamicAssembly_8); - DUMMY_METHOD(DefineDynamicAssembly_9); - - HRESULT ( STDMETHODCALLTYPE *CreateInstance )(IAppDomain * This, BSTR AssemblyName, BSTR typeName, IUnknown **pRetVal); - HRESULT ( STDMETHODCALLTYPE *CreateInstanceFrom )(IAppDomain * This, BSTR AssemblyFile, BSTR typeName, IUnknown **pRetVal); - - /* more methods live here */ - - END_INTERFACE -}; - -struct _Imscorlib_System_AppDomain { - struct _Imscorlib_System_AppDomainVtbl *lpVtbl; -}; - - -struct dotnet_runtime_stuff { - ICorRuntimeHost *dotnet_host; - IAppDomain *dotnet_domain; - DISPID create_instance; -}; - -static HRESULT dotnet_init(char **p_where TSRMLS_DC) -{ - HRESULT hr; - struct dotnet_runtime_stuff *stuff; - IUnknown *unk = NULL; - char *where = ""; - - stuff = malloc(sizeof(*stuff)); - memset(stuff, 0, sizeof(*stuff)); - - where = "CoCreateInstance"; - hr = CoCreateInstance(&CLSID_CorRuntimeHost, NULL, CLSCTX_ALL, - &IID_ICorRuntimeHost, (LPVOID*)&stuff->dotnet_host); - - if (FAILED(hr)) - goto out; - - /* fire up the host and get the domain object */ - where = "ICorRuntimeHost_Start\n"; - hr = ICorRuntimeHost_Start(stuff->dotnet_host); - if (FAILED(hr)) - goto out; - - where = "ICorRuntimeHost_GetDefaultDomain"; - hr = ICorRuntimeHost_GetDefaultDomain(stuff->dotnet_host, &unk); - if (FAILED(hr)) - goto out; - - where = "QI: System._AppDomain"; - hr = IUnknown_QueryInterface(unk, &IID_mscorlib_System_AppDomain, (LPVOID*)&stuff->dotnet_domain); - if (FAILED(hr)) - goto out; - - COMG(dotnet_runtime_stuff) = stuff; - -out: - if (unk) { - IUnknown_Release(unk); - } - if (COMG(dotnet_runtime_stuff) == NULL) { - /* clean up */ - if (stuff->dotnet_domain) { - IUnknown_Release(stuff->dotnet_domain); - } - if (stuff->dotnet_host) { - ICorRuntimeHost_Stop(stuff->dotnet_host); - ICorRuntimeHost_Release(stuff->dotnet_host); - } - free(stuff); - - *p_where = where; - - return hr; - } - - return S_OK; -} - -/* {{{ com_dotnet_create_instance - ctor for DOTNET class */ -PHP_FUNCTION(com_dotnet_create_instance) -{ - zval *object = getThis(); - php_com_dotnet_object *obj; - char *assembly_name, *datatype_name; - int assembly_name_len, datatype_name_len; - struct dotnet_runtime_stuff *stuff; - OLECHAR *oleassembly, *oletype; - HRESULT hr; - int ret = FAILURE; - char *where = ""; - IUnknown *unk = NULL; - - if (COMG(dotnet_runtime_stuff) == NULL) { - hr = dotnet_init(&where TSRMLS_CC); - if (FAILED(hr)) { - char buf[1024]; - char *err = php_win_err(hr); - snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] %s", where, err); - if (err) - LocalFree(err); - php_com_throw_exception(hr, buf TSRMLS_CC); - ZVAL_NULL(object); - return; - } - } - - stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff); - - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", - &assembly_name, &assembly_name_len, - &datatype_name, &datatype_name_len, - &obj->code_page)) { - php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!" TSRMLS_CC); - ZVAL_NULL(object); - return; - } - - oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC); - oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC); - where = "CreateInstance"; - hr = stuff->dotnet_domain->lpVtbl->CreateInstance(stuff->dotnet_domain, oleassembly, oletype, &unk); - efree(oletype); - efree(oleassembly); - - if (SUCCEEDED(hr)) { - VARIANT unwrapped; - IObjectHandle *handle = NULL; - - where = "QI: IObjectHandle"; - hr = IUnknown_QueryInterface(unk, &IID_IObjectHandle, &handle); - - if (SUCCEEDED(hr)) { - where = "IObjectHandle_Unwrap"; - hr = IObjectHandle_Unwrap(handle, &unwrapped); - if (SUCCEEDED(hr)) { - - if (V_VT(&unwrapped) == VT_UNKNOWN) { - where = "Unwrapped, QI for IDispatch"; - hr = IUnknown_QueryInterface(V_UNKNOWN(&unwrapped), &IID_IDispatch, &V_DISPATCH(&obj->v)); - - if (SUCCEEDED(hr)) { - V_VT(&obj->v) = VT_DISPATCH; - - /* get its type-info */ - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - ret = SUCCESS; - } - } else if (V_VT(&unwrapped) == VT_DISPATCH) { - /* unwrapped is now the dispatch pointer we want */ - V_DISPATCH(&obj->v) = V_DISPATCH(&unwrapped); - V_VT(&obj->v) = VT_DISPATCH; - - /* get its type-info */ - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - - ret = SUCCESS; - } else { - /* shouldn't happen, but let's be ready for it */ - VariantClear(&unwrapped); - hr = E_INVALIDARG; - } - } - IObjectHandle_Release(handle); - } - IUnknown_Release(unk); - } - - if (ret == FAILURE) { - char buf[1024]; - char *err = php_win_err(hr); - snprintf(buf, sizeof(buf), "Failed to instantiate .Net object [%s] [0x%08x] %s", where, hr, err); - if (err) - LocalFree(err); - php_com_throw_exception(hr, buf TSRMLS_CC); - ZVAL_NULL(object); - return; - } -} -/* }}} */ - -void php_com_dotnet_mshutdown(TSRMLS_D) -{ - struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff); - - if (stuff->dotnet_domain) { - IDispatch_Release(stuff->dotnet_domain); - } - if (stuff->dotnet_host) { - ICorRuntimeHost_Stop(stuff->dotnet_host); - ICorRuntimeHost_Release(stuff->dotnet_host); - stuff->dotnet_host = NULL; - } - free(stuff); - COMG(dotnet_runtime_stuff) = NULL; -} - -void php_com_dotnet_rshutdown(TSRMLS_D) -{ - struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff); - - if (stuff->dotnet_domain) { - IDispatch_Release(stuff->dotnet_domain); - stuff->dotnet_domain = NULL; - } -} - -#endif /* HAVE_MSCOREE_H */ diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c deleted file mode 100644 index de48ea943a1ac..0000000000000 --- a/ext/com_dotnet/com_extension.c +++ /dev/null @@ -1,358 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -ZEND_DECLARE_MODULE_GLOBALS(com_dotnet) -TsHashTable php_com_typelibraries; - -zend_class_entry - *php_com_variant_class_entry, - *php_com_exception_class_entry, - *php_com_saproxy_class_entry; - -function_entry com_dotnet_functions[] = { - PHP_FE(variant_set, NULL) - PHP_FE(variant_add, NULL) - PHP_FE(variant_cat, NULL) - PHP_FE(variant_sub, NULL) - PHP_FE(variant_mul, NULL) - PHP_FE(variant_and, NULL) - PHP_FE(variant_div, NULL) - PHP_FE(variant_eqv, NULL) - PHP_FE(variant_idiv, NULL) - PHP_FE(variant_imp, NULL) - PHP_FE(variant_mod, NULL) - PHP_FE(variant_or, NULL) - PHP_FE(variant_pow, NULL) - PHP_FE(variant_xor, NULL) - PHP_FE(variant_abs, NULL) - PHP_FE(variant_fix, NULL) - PHP_FE(variant_int, NULL) - PHP_FE(variant_neg, NULL) - PHP_FE(variant_not, NULL) - PHP_FE(variant_round, NULL) - PHP_FE(variant_cmp, NULL) - PHP_FE(variant_date_to_timestamp, NULL) - PHP_FE(variant_date_from_timestamp, NULL) - PHP_FE(variant_get_type, NULL) - PHP_FE(variant_set_type, NULL) - PHP_FE(variant_cast, NULL) - /* com_com.c */ - PHP_FE(com_create_guid, NULL) - PHP_FE(com_event_sink, NULL) - PHP_FE(com_print_typeinfo, NULL) - PHP_FE(com_message_pump, NULL) - PHP_FE(com_load_typelib, NULL) - PHP_FE(com_get_active_object, NULL) - { NULL, NULL, NULL } -}; - -/* {{{ com_dotnet_module_entry - */ -zend_module_entry com_dotnet_module_entry = { - STANDARD_MODULE_HEADER, - "com_dotnet", - com_dotnet_functions, - PHP_MINIT(com_dotnet), - PHP_MSHUTDOWN(com_dotnet), - PHP_RINIT(com_dotnet), - PHP_RSHUTDOWN(com_dotnet), - PHP_MINFO(com_dotnet), - "0.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_COM_DOTNET -ZEND_GET_MODULE(com_dotnet) -#endif - -/* {{{ PHP_INI - */ - -/* com.typelib_file is the path to a file containing a - * list of typelibraries to register *persistently*. - * lines starting with ; are comments - * append #cis to end of typelib name to cause its constants - * to be loaded case insensitively */ -static PHP_INI_MH(OnTypeLibFileUpdate) -{ - FILE *typelib_file; - char *typelib_name_buffer; - char *strtok_buf = NULL; - int cached; - - if (!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) { - return FAILURE; - } - - typelib_name_buffer = (char *) emalloc(sizeof(char)*1024); - - while (fgets(typelib_name_buffer, 1024, typelib_file)) { - ITypeLib *pTL; - char *typelib_name; - char *modifier, *ptr; - int mode = CONST_CS | CONST_PERSISTENT; /* CONST_PERSISTENT is ok here */ - - if (typelib_name_buffer[0]==';') { - continue; - } - typelib_name = php_strtok_r(typelib_name_buffer, "\r\n", &strtok_buf); /* get rid of newlines */ - if (typelib_name == NULL) { - continue; - } - typelib_name = php_strtok_r(typelib_name, "#", &strtok_buf); - modifier = php_strtok_r(NULL, "#", &strtok_buf); - if (modifier != NULL) { - if (!strcmp(modifier, "cis") || !strcmp(modifier, "case_insensitive")) { - mode &= ~CONST_CS; - } - } - - /* Remove leading/training white spaces on search_string */ - while (isspace(*typelib_name)) {/* Ends on '\0' in worst case */ - typelib_name ++; - } - ptr = typelib_name + strlen(typelib_name) - 1; - while ((ptr != typelib_name) && isspace(*ptr)) { - *ptr = '\0'; - ptr--; - } - - if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached TSRMLS_CC)) != NULL) { - if (!cached) { - php_com_import_typelib(pTL, mode, COMG(code_page) TSRMLS_CC); - } - ITypeLib_Release(pTL); - } - } - - efree(typelib_name_buffer); - fclose(typelib_file); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("com.allow_dcom", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_dcom, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_verbose", "0", PHP_INI_ALL, OnUpdateBool, autoreg_verbose, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_typelib", "0", PHP_INI_ALL, OnUpdateBool, autoreg_on, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnUpdateBool, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.code_page", "", PHP_INI_ALL, OnUpdateLong, code_page, zend_com_dotnet_globals, com_dotnet_globals) - PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypeLibFileUpdate) -PHP_INI_END() -/* }}} */ - -/* {{{ php_com_dotnet_init_globals - */ -static void php_com_dotnet_init_globals(zend_com_dotnet_globals *com_dotnet_globals) -{ - memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals)); - com_dotnet_globals->code_page = CP_ACP; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(com_dotnet) -{ - zend_class_entry ce, *tmp; - - ZEND_INIT_MODULE_GLOBALS(com_dotnet, php_com_dotnet_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU); - php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU); - - INIT_CLASS_ENTRY(ce, "com_exception", NULL); - php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL; -/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */ - - INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL); - php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL; -/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */ - php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get; - - INIT_CLASS_ENTRY(ce, "variant", NULL); - ce.create_object = php_com_object_new; - php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - php_com_variant_class_entry->get_iterator = php_com_iter_get; - - INIT_CLASS_ENTRY(ce, "com", NULL); - ce.create_object = php_com_object_new; - tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC); - tmp->get_iterator = php_com_iter_get; - - zend_ts_hash_init(&php_com_typelibraries, 0, NULL, php_com_typelibrary_dtor, 1); - -#if HAVE_MSCOREE_H - INIT_CLASS_ENTRY(ce, "dotnet", NULL); - ce.create_object = php_com_object_new; - tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC); - tmp->get_iterator = php_com_iter_get; -#endif - -#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT) - - COM_CONST(CLSCTX_INPROC_SERVER); - COM_CONST(CLSCTX_INPROC_HANDLER); - COM_CONST(CLSCTX_LOCAL_SERVER); - COM_CONST(CLSCTX_REMOTE_SERVER); - COM_CONST(CLSCTX_SERVER); - COM_CONST(CLSCTX_ALL); - -#if 0 - COM_CONST(DISPATCH_METHOD); - COM_CONST(DISPATCH_PROPERTYGET); - COM_CONST(DISPATCH_PROPERTYPUT); -#endif - - COM_CONST(VT_NULL); - COM_CONST(VT_EMPTY); - COM_CONST(VT_UI1); - COM_CONST(VT_I1); - COM_CONST(VT_UI2); - COM_CONST(VT_I2); - COM_CONST(VT_UI4); - COM_CONST(VT_I4); - COM_CONST(VT_R4); - COM_CONST(VT_R8); - COM_CONST(VT_BOOL); - COM_CONST(VT_ERROR); - COM_CONST(VT_CY); - COM_CONST(VT_DATE); - COM_CONST(VT_BSTR); - COM_CONST(VT_DECIMAL); - COM_CONST(VT_UNKNOWN); - COM_CONST(VT_DISPATCH); - COM_CONST(VT_VARIANT); - COM_CONST(VT_INT); - COM_CONST(VT_UINT); - COM_CONST(VT_ARRAY); - COM_CONST(VT_BYREF); - - COM_CONST(CP_ACP); - COM_CONST(CP_MACCP); - COM_CONST(CP_OEMCP); - COM_CONST(CP_UTF7); - COM_CONST(CP_UTF8); - COM_CONST(CP_SYMBOL); - COM_CONST(CP_THREAD_ACP); - - COM_CONST(VARCMP_LT); - COM_CONST(VARCMP_EQ); - COM_CONST(VARCMP_GT); - COM_CONST(VARCMP_NULL); - - COM_CONST(NORM_IGNORECASE); - COM_CONST(NORM_IGNORENONSPACE); - COM_CONST(NORM_IGNORESYMBOLS); - COM_CONST(NORM_IGNOREWIDTH); - COM_CONST(NORM_IGNOREKANATYPE); -#ifdef NORM_IGNOREKASHIDA - COM_CONST(NORM_IGNOREKASHIDA); -#endif - COM_CONST(DISP_E_DIVBYZERO); - COM_CONST(DISP_E_OVERFLOW); - COM_CONST(DISP_E_BADINDEX); - COM_CONST(MK_E_UNAVAILABLE); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(com_dotnet) -{ - UNREGISTER_INI_ENTRIES(); -#if HAVE_MSCOREE_H - if (COMG(dotnet_runtime_stuff)) { - php_com_dotnet_mshutdown(TSRMLS_C); - } -#endif - - zend_ts_hash_destroy(&php_com_typelibraries); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(com_dotnet) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(com_dotnet) -{ -#if HAVE_MSCOREE_H - if (COMG(dotnet_runtime_stuff)) { - php_com_dotnet_rshutdown(TSRMLS_C); - } -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(com_dotnet) -{ - php_info_print_table_start(); - - php_info_print_table_header(2, "COM support", "enabled"); - php_info_print_table_header(2, "DCOM support", COMG(allow_dcom) ? "enabled" : "disabled"); - -#if HAVE_MSCOREE_H - php_info_print_table_header(2, ".Net support", "enabled"); -#else - php_info_print_table_header(2, ".Net support", "not present in this build"); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c deleted file mode 100644 index c53c11808af07..0000000000000 --- a/ext/com_dotnet/com_handlers.c +++ /dev/null @@ -1,686 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC) -{ - zval *return_value; - php_com_dotnet_object *obj; - VARIANT v; - HRESULT res; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - return_value->refcount = 0; - return_value->is_ref = 0; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - convert_to_string_ex(&member); - - res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC); - - if (res == SUCCESS) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } else if (res == DISP_E_BADPARAMCOUNT) { - php_com_saproxy_create(object, return_value, member TSRMLS_CC); - } - } else { - php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC); - } - - return return_value; -} - -static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_com_dotnet_object *obj; - VARIANT v; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - convert_to_string_ex(&member); - if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), - DISPATCH_PROPERTYPUT, &v, 1, &value TSRMLS_CC)) { - VariantClear(&v); - } - } else { - php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC); - } -} - -static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - zval *return_value; - php_com_dotnet_object *obj; - VARIANT v; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - return_value->refcount = 0; - return_value->is_ref = 0; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, &offset TSRMLS_CC)) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } - } else if (V_ISARRAY(&obj->v)) { - convert_to_long(offset); - - if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { - if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) { - php_com_wrap_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } - } else { - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - } else { - php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC); - } - - return return_value; -} - -static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - php_com_dotnet_object *obj; - zval *args[2]; - VARIANT v; - HRESULT res; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - args[0] = offset; - args[1] = value; - - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args TSRMLS_CC)) { - VariantClear(&v); - } - } else if (V_ISARRAY(&obj->v)) { - LONG indices = 0; - VARTYPE vt; - - if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { - if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) { - vt = V_VT(&obj->v) & ~VT_ARRAY; - } - - convert_to_long(offset); - indices = Z_LVAL_P(offset); - - VariantInit(&v); - php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC); - - if (V_VT(&v) != vt) { - VariantChangeType(&v, &v, 0, vt); - } - - if (vt == VT_VARIANT) { - res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v); - } else { - res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal); - } - - VariantClear(&v); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC); - } - - } else { - php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC); - } -} - -#if 0 -static void com_object_set(zval **property, zval *value TSRMLS_DC) -{ - /* Not yet implemented in the engine */ -} - -static zval *com_object_get(zval *property TSRMLS_DC) -{ - /* Not yet implemented in the engine */ - return NULL; -} -#endif - -static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - DISPID dispid; - php_com_dotnet_object *obj; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - convert_to_string_ex(&member); - if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid TSRMLS_CC))) { - /* TODO: distinguish between property and method! */ - return 1; - } - } else { - /* TODO: check for safearray */ - } - - return 0; -} - -static int com_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object"); - return 0; -} - -static void com_property_delete(zval *object, zval *member TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static void com_dimension_delete(zval *object, zval *offset TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static HashTable *com_properties_get(zval *object TSRMLS_DC) -{ - /* TODO: use type-info to get all the names and values ? - * DANGER: if we do that, there is a strong possibility for - * infinite recursion when the hash is displayed via var_dump(). - * Perhaps it is best to leave it un-implemented. - */ - return NULL; -} - -static void function_dtor(void *pDest) -{ - zend_internal_function *f = (zend_internal_function*)pDest; - - efree(f->function_name); - if (f->arg_info) { - efree(f->arg_info); - } -} - -static PHP_FUNCTION(com_method_handler) -{ - Z_OBJ_HANDLER_P(getThis(), call_method)( - ((zend_internal_function*)EG(function_state_ptr)->function)->function_name, - INTERNAL_FUNCTION_PARAM_PASSTHRU); -} - -static union _zend_function *com_method_get(zval **object_ptr, char *name, int len TSRMLS_DC) -{ - zend_internal_function f, *fptr = NULL; - php_com_dotnet_object *obj; - union _zend_function *func; - DISPID dummy; - zval *object = *object_ptr; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) != VT_DISPATCH) { - return NULL; - } - - if (FAILED(php_com_get_id_of_name(obj, name, len, &dummy TSRMLS_CC))) { - return NULL; - } - - /* check cache */ - if (obj->method_cache == NULL || FAILURE == zend_hash_find(obj->method_cache, name, len, (void**)&fptr)) { - f.type = ZEND_OVERLOADED_FUNCTION; - f.num_args = 0; - f.arg_info = NULL; - f.scope = obj->ce; - f.fn_flags = 0; - f.function_name = estrndup(name, len); - f.handler = PHP_FN(com_method_handler); - - fptr = &f; - - if (obj->typeinfo) { - /* look for byref params */ - ITypeComp *comp; - ITypeInfo *TI = NULL; - DESCKIND kind; - BINDPTR bindptr; - OLECHAR *olename; - ULONG lhash; - int i; - - if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) { - olename = php_com_string_to_olestring(name, len, obj->code_page TSRMLS_CC); - lhash = LHashValOfNameSys(SYS_WIN32, LOCALE_SYSTEM_DEFAULT, olename); - - if (SUCCEEDED(ITypeComp_Bind(comp, olename, lhash, INVOKE_FUNC, &TI, &kind, &bindptr))) { - switch (kind) { - case DESCKIND_FUNCDESC: - f.arg_info = ecalloc(bindptr.lpfuncdesc->cParams, sizeof(zend_arg_info)); - - for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) { - f.arg_info[i].allow_null = 1; - if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) { - f.arg_info[i].pass_by_reference = 1; - } - } - - f.num_args = bindptr.lpfuncdesc->cParams; - - ITypeInfo_ReleaseFuncDesc(TI, bindptr.lpfuncdesc); - break; - - /* these should not happen, but *might* happen if the user - * screws up; lets avoid a leak in that case */ - case DESCKIND_VARDESC: - ITypeInfo_ReleaseVarDesc(TI, bindptr.lpvardesc); - break; - case DESCKIND_TYPECOMP: - ITypeComp_Release(bindptr.lptcomp); - break; - - case DESCKIND_NONE: - break; - } - if (TI) { - ITypeInfo_Release(TI); - } - } - ITypeComp_Release(comp); - efree(olename); - } - } - - if (fptr) { - /* save this method in the cache */ - if (!obj->method_cache) { - ALLOC_HASHTABLE(obj->method_cache); - zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0); - } - - zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr); - } - } - - if (fptr) { - /* duplicate this into a new chunk of emalloc'd memory, - * since the engine will efree it */ - func = emalloc(sizeof(*fptr)); - memcpy(func, fptr, sizeof(*fptr)); - - return func; - } - - return NULL; -} - -static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - zval ***args = NULL; - php_com_dotnet_object *obj; - int nargs; - VARIANT v; - int ret = FAILURE; - - obj = CDNO_FETCH(getThis()); - - if (V_VT(&obj->v) != VT_DISPATCH) { - return FAILURE; - } - - nargs = ZEND_NUM_ARGS(); - - if (nargs) { - args = (zval ***)safe_emalloc(sizeof(zval *), nargs, 0); - zend_get_parameters_array_ex(nargs, args); - } - - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_byref(obj, method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - ret = SUCCESS; - VariantClear(&v); - } - - if (args) { - efree(args); - } - - return ret; -} - -static union _zend_function *com_constructor_get(zval *object TSRMLS_DC) -{ - php_com_dotnet_object *obj; - static zend_internal_function c, d, v; - - obj = CDNO_FETCH(object); - -#define POPULATE_CTOR(f, fn) \ - f.type = ZEND_INTERNAL_FUNCTION; \ - f.function_name = obj->ce->name; \ - f.scope = obj->ce; \ - f.arg_info = NULL; \ - f.num_args = 0; \ - f.fn_flags = 0; \ - f.handler = ZEND_FN(fn); \ - return (union _zend_function*)&f; - - switch (obj->ce->name[0]) { -#if HAVE_MSCOREE_H - case 'd': - POPULATE_CTOR(d, com_dotnet_create_instance); -#endif - - case 'c': - POPULATE_CTOR(c, com_create_instance); - - case 'v': - POPULATE_CTOR(v, com_variant_create_instance); - - default: - return NULL; - } -} - -static zend_class_entry *com_class_entry_get(zval *object TSRMLS_DC) -{ - php_com_dotnet_object *obj; - obj = CDNO_FETCH(object); - - return obj->ce; -} - -static int com_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - php_com_dotnet_object *obj; - obj = CDNO_FETCH(object); - - *class_name = estrndup(obj->ce->name, obj->ce->name_length); - *class_name_len = obj->ce->name_length; - - return 0; -} - -/* This compares two variants for equality */ -static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - php_com_dotnet_object *obja, *objb; - int ret; - /* strange header bug problem here... the headers define the proto without the - * flags parameter. However, the MSDN docs state that there is a flags parameter, - * and my VC6 won't link unless the code uses the version with 4 parameters. - * So, we have this declaration here to fix it */ - STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags); - - obja = CDNO_FETCH(object1); - objb = CDNO_FETCH(object2); - - switch (VarCmp(&obja->v, &objb->v, LOCALE_SYSTEM_DEFAULT, 0)) { - case VARCMP_LT: - ret = -1; - break; - case VARCMP_GT: - ret = 1; - break; - case VARCMP_EQ: - ret = 0; - break; - default: - /* either or both operands are NULL... - * not 100% sure how to handle this */ - ret = -2; - } - - return ret; -} - -static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) -{ - php_com_dotnet_object *obj; - VARIANT v; - VARTYPE vt = VT_EMPTY; - zval free_obj; - HRESULT res = S_OK; - - if (should_free) { - free_obj = *writeobj; - } - - obj = CDNO_FETCH(readobj); - ZVAL_NULL(writeobj); - VariantInit(&v); - - if (V_VT(&obj->v) == VT_DISPATCH) { - if (FAILURE == php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC)) { - return FAILURE; - } - } else { - VariantCopy(&v, &obj->v); - } - - switch(type) { - case IS_LONG: - vt = VT_INT; - break; - case IS_DOUBLE: - vt = VT_R8; - break; - case IS_BOOL: - vt = VT_BOOL; - break; - case IS_STRING: - case IS_UNICODE: - vt = VT_BSTR; - break; - default: - ; - } - - if (vt != VT_EMPTY && vt != V_VT(&v)) { - res = VariantChangeType(&v, &v, 0, vt); - } - - if (SUCCEEDED(res)) { - php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC); - } - - VariantClear(&v); - - if (should_free) { - zval_dtor(&free_obj); - } - - if (SUCCEEDED(res)) { - return SUCCESS; - } - - return FAILURE; -} - -static int com_object_count(zval *object, long *count TSRMLS_DC) -{ - php_com_dotnet_object *obj; - LONG ubound = 0, lbound = 0; - - obj = CDNO_FETCH(object); - - if (!V_ISARRAY(&obj->v)) { - return FAILURE; - } - - SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound); - SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound); - - *count = ubound - lbound + 1; - - return SUCCESS; -} - -zend_object_handlers php_com_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - com_property_read, - com_property_write, - com_read_dimension, - com_write_dimension, - NULL, - NULL, //com_object_get, - NULL, //com_object_set, - com_property_exists, - com_property_delete, - com_dimension_exists, - com_dimension_delete, - com_properties_get, - com_method_get, - com_call_method, - com_constructor_get, - com_class_entry_get, - com_class_name_get, - com_objects_compare, - com_object_cast, - com_object_count -}; - -void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC) -{ - if (obj->sink_dispatch) { - IConnectionPointContainer *cont; - IConnectionPoint *point; - - if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), - &IID_IConnectionPointContainer, (void**)&cont))) { - - if (SUCCEEDED(IConnectionPointContainer_FindConnectionPoint(cont, - &obj->sink_id, &point))) { - - if (enable) { - IConnectionPoint_Advise(point, (IUnknown*)obj->sink_dispatch, &obj->sink_cookie); - } else { - IConnectionPoint_Unadvise(point, obj->sink_cookie); - } - IConnectionPoint_Release(point); - } - IConnectionPointContainer_Release(cont); - } - } -} - -void php_com_object_free_storage(void *object TSRMLS_DC) -{ - php_com_dotnet_object *obj = (php_com_dotnet_object*)object; - - if (obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - - if (obj->sink_dispatch) { - php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC); - IDispatch_Release(obj->sink_dispatch); - obj->sink_dispatch = NULL; - } - - VariantClear(&obj->v); - - if (obj->method_cache) { - FREE_HASHTABLE(obj->method_cache); - } - if (obj->id_of_name_cache) { - FREE_HASHTABLE(obj->id_of_name_cache); - } - efree(obj); -} - -void php_com_object_clone(void *object, void **clone_ptr TSRMLS_DC) -{ - php_com_dotnet_object *cloneobj, *origobject; - - origobject = (php_com_dotnet_object*)object; - cloneobj = (php_com_dotnet_object*)emalloc(sizeof(php_com_dotnet_object)); - - memcpy(cloneobj, origobject, sizeof(*cloneobj)); - - /* VariantCopy will perform VariantClear; we don't want to clobber - * the IDispatch that we memcpy'd, so we init a new variant in the - * clone structure */ - VariantInit(&cloneobj->v); - /* We use the Indirection-following version of the API since we - * want to clone as much as possible */ - VariantCopyInd(&cloneobj->v, &origobject->v); - - if (cloneobj->typeinfo) { - ITypeInfo_AddRef(cloneobj->typeinfo); - } - - *clone_ptr = cloneobj; -} - -zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC) -{ - php_com_dotnet_object *obj; - zend_object_value retval; - - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - - VariantInit(&obj->v); - obj->code_page = CP_ACP; - obj->ce = ce; - - retval.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - retval.handlers = &php_com_object_handlers; - - return retval; -} diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c deleted file mode 100644 index ae51ab657d324..0000000000000 --- a/ext/com_dotnet/com_iterator.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -struct php_com_iterator { - zend_object_iterator iter; - IEnumVARIANT *ev; - ulong key; - VARIANT v; /* cached element */ - int code_page; - VARIANT safe_array; - VARTYPE sa_type; - LONG sa_max; -}; - -static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->ev) { - IEnumVARIANT_Release(I->ev); - } - VariantClear(&I->v); - VariantClear(&I->safe_array); - efree(I); -} - -static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->key == (ulong)-1) { - return FAILURE; - } - return SUCCESS; -} - -static void com_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - zval **ptr_ptr; - zval *ptr; - - /* sanity */ - if (I->key == (ulong)-1) { - *data = NULL; - return; - } - - MAKE_STD_ZVAL(ptr); - php_com_zval_from_variant(ptr, &I->v, I->code_page TSRMLS_CC); - /* php_com_wrap_variant(ptr, &I->v, I->code_page TSRMLS_CC); */ - ptr_ptr = emalloc(sizeof(*ptr_ptr)); - *ptr_ptr = ptr; - *data = ptr_ptr; - - return; -} - -static int com_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->key == (ulong)-1) { - return HASH_KEY_NON_EXISTANT; - } - *int_key = I->key; - return HASH_KEY_IS_LONG; -} - -static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - unsigned long n_fetched; - - /* release current cached element */ - VariantClear(&I->v); - - if (I->ev) { - /* Get the next element */ - if (SUCCEEDED(IEnumVARIANT_Next(I->ev, 1, &I->v, &n_fetched)) && n_fetched > 0) { - I->key++; - return SUCCESS; - } else { - /* indicate that there are no more items */ - I->key = (ulong)-1; - return FAILURE; - } - } else { - /* safe array */ - if (I->key >= I->sa_max) { - I->key = (ulong)-1; - return FAILURE; - } - I->key++; - if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key TSRMLS_CC)) { - return SUCCESS; - } else { - I->key = (ulong)-1; - return FAILURE; - } - } -} - - -static zend_object_iterator_funcs com_iter_funcs = { - com_iter_dtor, - com_iter_valid, - com_iter_get_data, - com_iter_get_key, - com_iter_move_forwards, - NULL -}; - -zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - php_com_dotnet_object *obj; - struct php_com_iterator *I; - IEnumVARIANT *iev = NULL; - DISPPARAMS dp; - VARIANT v; - unsigned long n_fetched; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v)); - return NULL; - } - - memset(&dp, 0, sizeof(dp)); - VariantInit(&v); - - I = (struct php_com_iterator*)ecalloc(1, sizeof(*I)); - I->iter.funcs = &com_iter_funcs; - I->iter.data = I; - I->code_page = obj->code_page; - VariantInit(&I->safe_array); - VariantInit(&I->v); - - if (V_ISARRAY(&obj->v)) { - LONG bound; - UINT dims; - - dims = SafeArrayGetDim(V_ARRAY(&obj->v)); - - if (dims != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Can only handle single dimension variant arrays (this array has %d)", dims); - goto fail; - } - - /* same semantics as foreach on a PHP array; - * make a copy and enumerate that copy */ - VariantCopy(&I->safe_array, &obj->v); - - /* determine the key value for the array */ - SafeArrayGetLBound(V_ARRAY(&I->safe_array), 1, &bound); - SafeArrayGetUBound(V_ARRAY(&I->safe_array), 1, &I->sa_max); - - /* pre-fetch the element */ - if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound TSRMLS_CC)) { - I->key = bound; - } else { - I->key = (ulong)-1; - } - - } else { - /* can we enumerate it? */ - if (FAILED(IDispatch_Invoke(V_DISPATCH(&obj->v), DISPID_NEWENUM, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD|DISPATCH_PROPERTYGET, - &dp, &v, NULL, NULL))) { - goto fail; - } - - /* get something useful out of it */ - if (V_VT(&v) == VT_UNKNOWN) { - IUnknown_QueryInterface(V_UNKNOWN(&v), &IID_IEnumVARIANT, (void**)&iev); - } else if (V_VT(&v) == VT_DISPATCH) { - IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IEnumVARIANT, (void**)&iev); - } - - VariantClear(&v); - - if (iev == NULL) { - goto fail; - } - - I->ev = iev; - - /* Get the first element now */ - if (SUCCEEDED(IEnumVARIANT_Next(I->ev, 1, &I->v, &n_fetched)) && n_fetched > 0) { - /* indicate that we have element 0 */ - I->key = 0; - } else { - /* indicate that there are no more items */ - I->key = (ulong)-1; - } - } - - return &I->iter; - -fail: - if (I) { - VariantClear(&I->safe_array); - VariantClear(&I->v); - efree(I); - } - return NULL; -} - diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c deleted file mode 100644 index bee9c7dcf836c..0000000000000 --- a/ext/com_dotnet/com_misc.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC) -{ - int free_msg = 0; - if (message == NULL) { - message = php_win_err(code); - free_msg = 1; - } - zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC); - if (free_msg) { - LocalFree(message); - } -} - -PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp, - int codepage TSRMLS_DC) -{ - php_com_dotnet_object *obj; - - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - obj->code_page = codepage; - obj->ce = php_com_variant_class_entry; - - VariantInit(&obj->v); - V_VT(&obj->v) = VT_DISPATCH; - V_DISPATCH(&obj->v) = disp; - - IDispatch_AddRef(V_DISPATCH(&obj->v)); - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - - Z_TYPE_P(z) = IS_OBJECT; - z->value.obj.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - z->value.obj.handlers = &php_com_object_handlers; -} - -PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v, - int codepage TSRMLS_DC) -{ - php_com_dotnet_object *obj; - - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - obj->code_page = codepage; - obj->ce = php_com_variant_class_entry; - - VariantInit(&obj->v); - VariantCopyInd(&obj->v, v); - - if (V_VT(&obj->v) == VT_DISPATCH) { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - } - - Z_TYPE_P(z) = IS_OBJECT; - - z->value.obj.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - z->value.obj.handlers = &php_com_object_handlers; -} - -/* this is a convenience function for fetching a particular - * element from a (possibly multi-dimensional) safe array */ -PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC) -{ - UINT dims; - LONG lbound, ubound; - LONG indices[1]; - VARTYPE vt; - - if (!V_ISARRAY(array)) { - return 0; - } - - dims = SafeArrayGetDim(V_ARRAY(array)); - - if (dims != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Can only handle single dimension variant arrays (this array has %d)", dims); - return 0; - } - - if (FAILED(SafeArrayGetVartype(V_ARRAY(array), &vt)) || vt == VT_EMPTY) { - vt = V_VT(array) & ~VT_ARRAY; - } - - /* determine the bounds */ - SafeArrayGetLBound(V_ARRAY(array), 1, &lbound); - SafeArrayGetUBound(V_ARRAY(array), 1, &ubound); - - /* check bounds */ - if (dim1 < lbound || dim1 > ubound) { - php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC); - return 0; - } - - /* now fetch that element */ - VariantInit(dest); - - indices[0] = dim1; - - if (vt == VT_VARIANT) { - SafeArrayGetElement(V_ARRAY(array), indices, dest); - } else { - V_VT(dest) = vt; - /* store the value into "lVal" member of the variant. - * This works because it is a union; since we know the variant - * type, we end up with a working variant */ - SafeArrayGetElement(V_ARRAY(array), indices, &dest->lVal); - } - - return 1; -} diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c deleted file mode 100644 index 0e05f101e554a..0000000000000 --- a/ext/com_dotnet/com_olechar.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | Harald Radi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - - -PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC) -{ - OLECHAR *olestring = NULL; - DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS; - BOOL ok; - - if (string_len == -1) { - /* determine required length for the buffer (includes NUL terminator) */ - string_len = MultiByteToWideChar(codepage, flags, string, -1, NULL, 0); - } else { - /* allow room for NUL terminator */ - string_len++; - } - - if (strlen > 0) { - olestring = (OLECHAR*)safe_emalloc(sizeof(OLECHAR), string_len, 0); - ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len); - } else { - ok = FALSE; - olestring = (OLECHAR*)emalloc(sizeof(OLECHAR)); - *olestring = 0; - } - - if (!ok) { - char *msg = php_win_err(GetLastError()); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Could not convert string to unicode: `%s'", msg); - - LocalFree(msg); - } - - return olestring; -} - -PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC) -{ - char *string; - uint length = 0; - BOOL ok; - LONG err; - - length = WideCharToMultiByte(codepage, 0, olestring, -1, NULL, 0, NULL, NULL); - - if (length) { - string = (char*)safe_emalloc(sizeof(char), length, 0); - length = WideCharToMultiByte(codepage, 0, olestring, -1, string, length, NULL, NULL); - ok = length > 0; - } else { - err = GetLastError(); - string = (char*)emalloc(sizeof(char)); - *string = '\0'; - ok = FALSE; - length = 0; - } - - if (!ok) { - char *msg = php_win_err(err); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Could not convert string from unicode: `%s'", msg); - - LocalFree(msg); - } - - if (string_len) { - *string_len = length-1; - } - - return string; -} diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c deleted file mode 100755 index ef50f0b44004c..0000000000000 --- a/ext/com_dotnet/com_persist.c +++ /dev/null @@ -1,785 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Infrastructure for working with persistent COM objects. - * Implements: IStream* wrapper for PHP streams. - * TODO: Magic __wakeup and __sleep handlers for serialization - * (can wait till 5.1) */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -/* {{{ expose php_stream as a COM IStream */ - -typedef struct { - CONST_VTBL struct IStreamVtbl *lpVtbl; - DWORD engine_thread; - LONG refcount; - php_stream *stream; - int id; -} php_istream; - -static int le_istream; -static void istream_destructor(php_istream *stm); - -static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_istream *stm = (php_istream *)rsrc->ptr; - istream_destructor(stm); -} - -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - -#define FETCH_STM() \ - TSRMLS_FIXED() \ - php_istream *stm = (php_istream*)This; \ - if (GetCurrentThreadId() != stm->engine_thread) \ - return RPC_E_WRONG_THREAD; - -static HRESULT STDMETHODCALLTYPE stm_queryinterface( - IStream *This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject) -{ - FETCH_STM(); - - if (IsEqualGUID(&IID_IUnknown, riid) || - IsEqualGUID(&IID_IStream, riid)) { - *ppvObject = This; - InterlockedIncrement(&stm->refcount); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG STDMETHODCALLTYPE stm_addref(IStream *This) -{ - FETCH_STM(); - - return InterlockedIncrement(&stm->refcount); -} - -static ULONG STDMETHODCALLTYPE stm_release(IStream *This) -{ - ULONG ret; - FETCH_STM(); - - ret = InterlockedDecrement(&stm->refcount); - if (ret == 0) { - /* destroy it */ - if (stm->id) - zend_list_delete(stm->id); - } - return ret; -} - -static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead) -{ - int nread; - FETCH_STM(); - - nread = php_stream_read(stm->stream, pv, cb); - - if (pcbRead) { - *pcbRead = nread > 0 ? nread : 0; - } - if (nread > 0) { - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten) -{ - int nwrote; - FETCH_STM(); - - nwrote = php_stream_write(stm->stream, pv, cb); - - if (pcbWritten) { - *pcbWritten = nwrote > 0 ? nwrote : 0; - } - if (nwrote > 0) { - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove, - DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) -{ - off_t offset; - int whence; - int ret; - FETCH_STM(); - - switch (dwOrigin) { - case STREAM_SEEK_SET: whence = SEEK_SET; break; - case STREAM_SEEK_CUR: whence = SEEK_CUR; break; - case STREAM_SEEK_END: whence = SEEK_END; break; - default: - return STG_E_INVALIDFUNCTION; - } - - if (dlibMove.HighPart) { - /* we don't support 64-bit offsets */ - return STG_E_INVALIDFUNCTION; - } - - offset = dlibMove.QuadPart; - - ret = php_stream_seek(stm->stream, offset, whence); - - if (plibNewPosition) { - plibNewPosition->QuadPart = (ULONGLONG)(ret >= 0 ? ret : 0); - } - - return ret >= 0 ? S_OK : STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libNewSize) -{ - FETCH_STM(); - - if (libNewSize.HighPart) { - return STG_E_INVALIDFUNCTION; - } - - if (php_stream_truncate_supported(stm->stream)) { - int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); - - if (ret == 0) { - return S_OK; - } - } - - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb, - ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) -{ - FETCH_STM(); - - return E_NOTIMPL; -} - -static HRESULT STDMETHODCALLTYPE stm_commit(IStream *This, DWORD grfCommitFlags) -{ - FETCH_STM(); - - php_stream_flush(stm->stream); - - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE stm_revert(IStream *This) -{ - /* NOP */ - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE stm_lock_region(IStream *This, - ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_unlock_region(IStream *This, - ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_stat(IStream *This, - STATSTG *pstatstg, DWORD grfStatFlag) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_clone(IStream *This, IStream **ppstm) -{ - return STG_E_INVALIDFUNCTION; -} - -static struct IStreamVtbl php_istream_vtbl = { - stm_queryinterface, - stm_addref, - stm_release, - stm_read, - stm_write, - stm_seek, - stm_set_size, - stm_copy_to, - stm_commit, - stm_revert, - stm_lock_region, - stm_unlock_region, - stm_stat, - stm_clone -}; - -static void istream_destructor(php_istream *stm) -{ - TSRMLS_FETCH(); - - if (stm->id) { - int id = stm->id; - stm->id = 0; - zend_list_delete(id); - return; - } - - if (stm->refcount > 0) { - CoDisconnectObject((IUnknown*)stm, 0); - } - - zend_list_delete(stm->stream->rsrc_id); - - CoTaskMemFree(stm); -} -/* }}} */ - -PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC) -{ - php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); - - if (stm == NULL) - return NULL; - - memset(stm, 0, sizeof(*stm)); - stm->engine_thread = GetCurrentThreadId(); - stm->lpVtbl = &php_istream_vtbl; - stm->refcount = 1; - stm->stream = stream; - - zend_list_addref(stream->rsrc_id); - stm->id = zend_list_insert(stm, le_istream); - - return (IStream*)stm; -} - -#define CPH_ME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_PUBLIC) -#define CPH_SME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_ALLOW_STATIC|ZEND_ACC_PUBLIC) -#define CPH_METHOD(fname) static PHP_METHOD(com_persist, fname) - -#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)zend_object_store_get_object(getThis() TSRMLS_CC); - -#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; } - -typedef struct { - zend_object std; - long codepage; - IUnknown *unk; - IPersistStream *ips; - IPersistStreamInit *ipsi; - IPersistFile *ipf; -} php_com_persist_helper; - -static zend_object_handlers helper_handlers; -static zend_class_entry *helper_ce; - -static inline HRESULT get_persist_stream(php_com_persist_helper *helper) -{ - if (!helper->ips && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, &helper->ips); - } - return helper->ips ? S_OK : E_NOTIMPL; -} - -static inline HRESULT get_persist_stream_init(php_com_persist_helper *helper) -{ - if (!helper->ipsi && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, &helper->ipsi); - } - return helper->ipsi ? S_OK : E_NOTIMPL; -} - -static inline HRESULT get_persist_file(php_com_persist_helper *helper) -{ - if (!helper->ipf && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, &helper->ipf); - } - return helper->ipf ? S_OK : E_NOTIMPL; -} - - -/* {{{ proto string COMPersistHelper::GetCurFile() - Determines the filename into which an object will be saved, or false if none is set, via IPersistFile::GetCurFile */ -CPH_METHOD(GetCurFileName) -{ - HRESULT res; - OLECHAR *olename = NULL; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - res = IPersistFile_GetCurFile(helper->ipf, &olename); - - if (res == S_OK) { - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = php_com_olestring_to_string(olename, - &Z_STRLEN_P(return_value), helper->codepage TSRMLS_CC); - CoTaskMemFree(olename); - return; - } else if (res == S_FALSE) { - CoTaskMemFree(olename); - RETURN_FALSE; - } - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - - -/* {{{ proto bool COMPersistHelper::SaveToFile(string filename [, bool remember]) - Persist object data to file, via IPersistFile::Save */ -CPH_METHOD(SaveToFile) -{ - HRESULT res; - char *filename, *fullpath = NULL; - int filename_len; - zend_bool remember = TRUE; - OLECHAR *olefilename = NULL; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b", - &filename, &filename_len, &remember)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - if (filename) { - fullpath = expand_filepath(filename, NULL TSRMLS_CC); - - if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(fullpath TSRMLS_CC)) { - RETURN_FALSE; - } - - olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC); - efree(fullpath); - } - res = IPersistFile_Save(helper->ipf, olefilename, remember); - if (SUCCEEDED(res)) { - if (!olefilename) { - res = IPersistFile_GetCurFile(helper->ipf, &olefilename); - if (S_OK == res) { - IPersistFile_SaveCompleted(helper->ipf, olefilename); - CoTaskMemFree(olefilename); - olefilename = NULL; - } - } else if (remember) { - IPersistFile_SaveCompleted(helper->ipf, olefilename); - } - } - - if (olefilename) { - efree(olefilename); - } - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto bool COMPersistHelper::LoadFromFile(string filename [, int flags]) - Load object data from file, via IPersistFile::Load */ -CPH_METHOD(LoadFromFile) -{ - HRESULT res; - char *filename, *fullpath; - int filename_len; - long flags = 0; - OLECHAR *olefilename; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &filename, &filename_len, &flags)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - fullpath = expand_filepath(filename, NULL TSRMLS_CC); - - if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(fullpath TSRMLS_CC)) { - RETURN_FALSE; - } - - olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC); - efree(fullpath); - - res = IPersistFile_Load(helper->ipf, olefilename, flags); - efree(olefilename); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::GetMaxStreamSize() - Gets maximum stream size required to store the object data, via IPersistStream::GetSizeMax (or IPersistStreamInit::GetSizeMax) */ -CPH_METHOD(GetMaxStreamSize) -{ - HRESULT res; - ULARGE_INTEGER size; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_GetSizeMax(helper->ipsi, &size); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStream_GetSizeMax(helper->ips, &size); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - return; - } - } - - if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - /* TODO: handle 64 bit properly */ - RETURN_LONG((LONG)size.QuadPart); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::InitNew() - Initializes the object to a default state, via IPersistStreamInit::InitNew */ -CPH_METHOD(InitNew) -{ - HRESULT res; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_InitNew(helper->ipsi); - - if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - RETURN_TRUE; - } - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto mixed COMPersistHelper::LoadFromStream(resource stream) - Initializes an object from the stream where it was previously saved, via IPersistStream::Load or OleLoadFromStream */ -CPH_METHOD(LoadFromStream) -{ - zval *zstm; - php_stream *stream; - IStream *stm = NULL; - HRESULT res; - CPH_FETCH(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - php_stream_from_zval_no_verify(stream, &zstm); - - if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); - return; - } - - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); - if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); - return; - } - - res = S_OK; - RETVAL_TRUE; - - if (helper->unk == NULL) { - IDispatch *disp = NULL; - - /* we need to create an object and load using OleLoadFromStream */ - res = OleLoadFromStream(stm, &IID_IDispatch, &disp); - - if (SUCCEEDED(res)) { - php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC); - } - } else { - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_Load(helper->ipsi, stm); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStreamInit_Load(helper->ipsi, stm); - } - } - } - IStream_Release(stm); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::SaveToStream(resource stream) - Saves the object to a stream, via IPersistStream::Save */ -CPH_METHOD(SaveToStream) -{ - zval *zstm; - php_stream *stream; - IStream *stm = NULL; - HRESULT res; - CPH_FETCH(); - - CPH_NO_OBJ(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - php_stream_from_zval_no_verify(stream, &zstm); - - if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); - return; - } - - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); - if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); - return; - } - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStream_Save(helper->ips, stm, TRUE); - } - } - - IStream_Release(stm); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::__construct([object com_object]) - Creates a persistence helper object, usually associated with a com_object */ -CPH_METHOD(__construct) -{ - php_com_dotnet_object *obj = NULL; - zval *zobj = NULL; - CPH_FETCH(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!", - &zobj, php_com_variant_class_entry)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - if (!zobj) { - return; - } - - obj = CDNO_FETCH(zobj); - - if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) { - php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC); - return; - } - - /* it is always safe to cast an interface to IUnknown */ - helper->unk = (IUnknown*)V_DISPATCH(&obj->v); - IUnknown_AddRef(helper->unk); - helper->codepage = obj->code_page; -} -/* }}} */ - - - - -static zend_function_entry com_persist_helper_methods[] = { - CPH_ME(__construct, NULL) - CPH_ME(GetCurFileName, NULL) - CPH_ME(SaveToFile, NULL) - CPH_ME(LoadFromFile, NULL) - CPH_ME(GetMaxStreamSize, NULL) - CPH_ME(InitNew, NULL) - CPH_ME(LoadFromStream, NULL) - CPH_ME(SaveToStream, NULL) - {NULL, NULL, NULL} -}; - -static void helper_free_storage(void *obj TSRMLS_DC) -{ - php_com_persist_helper *object = (php_com_persist_helper*)obj; - - if (object->ipf) { - IPersistFile_Release(object->ipf); - } - if (object->ips) { - IPersistStream_Release(object->ips); - } - if (object->ipsi) { - IPersistStreamInit_Release(object->ipsi); - } - if (object->unk) { - IUnknown_Release(object->unk); - } - zend_hash_destroy(object->std.properties); - FREE_HASHTABLE(object->std.properties); - efree(object); -} - - -static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC) -{ - php_com_persist_helper *clone, *object = (php_com_persist_helper*)obj; - - clone = emalloc(sizeof(*object)); - memcpy(clone, object, sizeof(*object)); - *clone_ptr = clone; - - ALLOC_HASHTABLE(clone->std.properties); - zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - if (clone->ipf) { - IPersistFile_AddRef(clone->ipf); - } - if (clone->ips) { - IPersistStream_AddRef(clone->ips); - } - if (clone->ipsi) { - IPersistStreamInit_AddRef(clone->ipsi); - } - if (clone->unk) { - IUnknown_AddRef(clone->unk); - } -} - -static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC) -{ - php_com_persist_helper *helper; - zend_object_value retval; - - helper = emalloc(sizeof(*helper)); - memset(helper, 0, sizeof(*helper)); - - ALLOC_HASHTABLE(helper->std.properties); - zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - helper->std.ce = helper_ce; - - retval.handle = zend_objects_store_put(helper, NULL, helper_free_storage, helper_clone TSRMLS_CC); - retval.handlers = &helper_handlers; - - return retval; -} - -int php_com_persist_minit(INIT_FUNC_ARGS) -{ - zend_class_entry ce; - - memcpy(&helper_handlers, zend_get_std_object_handlers(), sizeof(helper_handlers)); - helper_handlers.clone_obj = NULL; - - INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods); - ce.create_object = helper_new; - helper_ce = zend_register_internal_class(&ce TSRMLS_CC); - helper_ce->ce_flags |= ZEND_ACC_FINAL; - - le_istream = zend_register_list_destructors_ex(istream_dtor, - NULL, "com_dotnet_istream_wrapper", module_number); - - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c deleted file mode 100644 index 15b217fa68dee..0000000000000 --- a/ext/com_dotnet/com_saproxy.c +++ /dev/null @@ -1,584 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This module implements a SafeArray proxy which is used internally - * by the engine when resolving multi-dimensional array accesses on - * SafeArray types. - * In addition, the proxy is now able to handle properties of COM objects - * that smell like PHP arrays. - * */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -typedef struct { - /* the object we a proxying for; we hold a refcount to it */ - zval *zobj; - php_com_dotnet_object *obj; - - /* how many dimensions we are indirecting to get into this element */ - LONG dimensions; - - /* this is an array whose size_is(dimensions) */ - zval **indices; - -} php_com_saproxy; - -typedef struct { - zend_object_iterator iter; - zval *proxy_obj; - php_com_saproxy *proxy; - LONG key; - LONG imin, imax; - LONG *indices; -} php_com_saproxy_iter; - -#define SA_FETCH(zv) (php_com_saproxy*)zend_object_store_get_object(zv TSRMLS_CC) - -static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, int ndims) -{ - int i; - - for (i = 0; i < ndims; i++) { - MAKE_STD_ZVAL(dest->indices[i]); - *dest->indices[i] = *src->indices[i]; - zval_copy_ctor(dest->indices[i]); - } -} - -static zval *saproxy_property_read(zval *object, zval *member, int type TSRMLS_DC) -{ - zval *return_value; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - - php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC); - - return return_value; -} - -static void saproxy_property_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC); -} - -static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - zval *return_value; - UINT dims; - SAFEARRAY *sa; - LONG ubound, lbound; - int i; - HRESULT res; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - - if (V_VT(&proxy->obj->v) == VT_DISPATCH) { - VARIANT v; - zval **args; - - /* prop-get using first dimension as the property name, - * all subsequent dimensions and the offset as parameters */ - - args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0); - - for (i = 1; i < proxy->dimensions; i++) { - args[i-1] = proxy->indices[i]; - } - args[i-1] = offset; - - convert_to_string(proxy->indices[0]); - VariantInit(&v); - - res = php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]), - Z_STRLEN_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, - proxy->dimensions, args TSRMLS_CC); - - if (res == SUCCESS) { - php_com_zval_from_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC); - VariantClear(&v); - } else if (res == DISP_E_BADPARAMCOUNT) { - /* return another proxy */ - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - return return_value; - - } else if (!V_ISARRAY(&proxy->obj->v)) { - php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC); - return return_value; - } - - /* the SafeArray case */ - - /* offset/index must be an integer */ - convert_to_long(offset); - - sa = V_ARRAY(&proxy->obj->v); - dims = SafeArrayGetDim(sa); - - if (proxy->dimensions >= dims) { - /* too many dimensions */ - php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC); - return return_value; - } - - /* bounds check */ - SafeArrayGetLBound(sa, proxy->dimensions, &lbound); - SafeArrayGetUBound(sa, proxy->dimensions, &ubound); - - if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) { - php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC); - return return_value; - } - - if (dims - 1 == proxy->dimensions) { - LONG *indices; - VARTYPE vt; - VARIANT v; - - VariantInit(&v); - - /* we can return a real value */ - indices = safe_emalloc(dims, sizeof(LONG), 0); - - /* copy indices from proxy */ - for (i = 0; i < dims; i++) { - convert_to_long(proxy->indices[i]); - indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - /* add user-supplied index */ - indices[dims-1] = Z_LVAL_P(offset); - - /* now fetch the value */ - if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) { - vt = V_VT(&proxy->obj->v) & ~VT_ARRAY; - } - - if (vt == VT_VARIANT) { - res = SafeArrayGetElement(sa, indices, &v); - } else { - V_VT(&v) = vt; - res = SafeArrayGetElement(sa, indices, &v.lVal); - } - - efree(indices); - - if (SUCCEEDED(res)) { - php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - VariantClear(&v); - - } else { - /* return another proxy */ - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - return return_value; -} - -static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - UINT dims; - int i; - HRESULT res; - VARIANT v; - - if (V_VT(&proxy->obj->v) == VT_DISPATCH) { - /* We do a prop-set using the first dimension as the property name, - * all subsequent dimensions and offset as parameters, with value as - * the final value */ - zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0); - - for (i = 1; i < proxy->dimensions; i++) { - args[i-1] = proxy->indices[i]; - } - args[i-1] = offset; - args[i] = value; - - convert_to_string(proxy->indices[0]); - VariantInit(&v); - if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]), - Z_STRLEN_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1, - args TSRMLS_CC)) { - VariantClear(&v); - } - - efree(args); - - } else if (V_ISARRAY(&proxy->obj->v)) { - LONG *indices; - VARTYPE vt; - - dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v)); - indices = safe_emalloc(dims, sizeof(LONG), 0); - /* copy indices from proxy */ - for (i = 0; i < dims; i++) { - convert_to_long(proxy->indices[i]); - indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - /* add user-supplied index */ - convert_to_long(offset); - indices[dims-1] = Z_LVAL_P(offset); - - if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) { - vt = V_VT(&proxy->obj->v) & ~VT_ARRAY; - } - - VariantInit(&v); - php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC); - - if (V_VT(&v) != vt) { - VariantChangeType(&v, &v, 0, vt); - } - - if (vt == VT_VARIANT) { - res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v); - } else { - res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v.lVal); - } - - efree(indices); - VariantClear(&v); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - } else { - php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC); - } -} - -#if 0 -static void saproxy_object_set(zval **property, zval *value TSRMLS_DC) -{ -} - -static zval *saproxy_object_get(zval *property TSRMLS_DC) -{ - /* Not yet implemented in the engine */ - return NULL; -} -#endif - -static int saproxy_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - /* no properties */ - return 0; -} - -static int saproxy_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object"); - return 0; -} - -static void saproxy_property_delete(zval *object, zval *member TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static void saproxy_dimension_delete(zval *object, zval *offset TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static HashTable *saproxy_properties_get(zval *object TSRMLS_DC) -{ - /* no properties */ - return NULL; -} - -static union _zend_function *saproxy_method_get(zval *object, char *name, int len TSRMLS_DC) -{ - /* no methods */ - return NULL; -} - -static int saproxy_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - return FAILURE; -} - -static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC) -{ - /* user cannot instantiate */ - return NULL; -} - -static zend_class_entry *saproxy_class_entry_get(zval *object TSRMLS_DC) -{ - return php_com_saproxy_class_entry; -} - -static int saproxy_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - *class_name = estrndup(php_com_saproxy_class_entry->name, php_com_saproxy_class_entry->name_length); - *class_name_len = php_com_saproxy_class_entry->name_length; - return 0; -} - -static int saproxy_objects_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - return -1; -} - -static int saproxy_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) -{ - return FAILURE; -} - -static int saproxy_count_elements(zval *object, long *count TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - LONG ubound, lbound; - - if (!V_ISARRAY(&proxy->obj->v)) { - return FAILURE; - } - - SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &lbound); - SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &ubound); - - *count = ubound - lbound + 1; - - return SUCCESS; -} - -zend_object_handlers php_com_saproxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - saproxy_property_read, - saproxy_property_write, - saproxy_read_dimension, - saproxy_write_dimension, - NULL, - NULL, //saproxy_object_get, - NULL, //saproxy_object_set, - saproxy_property_exists, - saproxy_property_delete, - saproxy_dimension_exists, - saproxy_dimension_delete, - saproxy_properties_get, - saproxy_method_get, - saproxy_call_method, - saproxy_constructor_get, - saproxy_class_entry_get, - saproxy_class_name_get, - saproxy_objects_compare, - saproxy_object_cast, - saproxy_count_elements -}; - -static void saproxy_free_storage(void *object TSRMLS_DC) -{ - php_com_saproxy *proxy = (php_com_saproxy *)object; - int i; - - for (i = 0; i < proxy->dimensions; i++) { - if (proxy->indices) { - FREE_ZVAL(proxy->indices[i]); - } - } - - zval_ptr_dtor(&proxy->zobj); - efree(proxy->indices); - efree(proxy); -} - -static void saproxy_clone(void *object, void **clone_ptr TSRMLS_DC) -{ - php_com_saproxy *proxy = (php_com_saproxy *)object; - php_com_saproxy *cloneproxy; - - cloneproxy = emalloc(sizeof(*cloneproxy)); - memcpy(cloneproxy, proxy, sizeof(*cloneproxy)); - - ZVAL_ADDREF(cloneproxy->zobj); - cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval *), 0); - clone_indices(cloneproxy, proxy, proxy->dimensions); - - *clone_ptr = cloneproxy; -} - -int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC) -{ - php_com_saproxy *proxy, *rel = NULL; - - proxy = ecalloc(1, sizeof(*proxy)); - proxy->dimensions = 1; - - if (Z_OBJCE_P(com_object) == php_com_saproxy_class_entry) { - rel = SA_FETCH(com_object); - proxy->obj = rel->obj; - proxy->zobj = rel->zobj; - proxy->dimensions += rel->dimensions; - } else { - proxy->obj = CDNO_FETCH(com_object); - proxy->zobj = com_object; - } - - ZVAL_ADDREF(proxy->zobj); - proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval *), 0); - - if (rel) { - clone_indices(proxy, rel, rel->dimensions); - } - - MAKE_STD_ZVAL(proxy->indices[proxy->dimensions-1]); - *proxy->indices[proxy->dimensions-1] = *index; - zval_copy_ctor(proxy->indices[proxy->dimensions-1]); - - Z_TYPE_P(proxy_out) = IS_OBJECT; - Z_OBJ_HANDLE_P(proxy_out) = zend_objects_store_put(proxy, NULL, saproxy_free_storage, saproxy_clone TSRMLS_CC); - Z_OBJ_HT_P(proxy_out) = &php_com_saproxy_handlers; - - return 1; -} - -/* iterator */ - -static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - zval_ptr_dtor(&I->proxy_obj); - - efree(I->indices); - efree(I); -} - -static int saproxy_iter_valid(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - return (I->key < I->imax) ? SUCCESS : FAILURE; -} - -static void saproxy_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - VARIANT v; - VARTYPE vt; - zval *return_value, **ptr_ptr; - SAFEARRAY *sa; - - I->indices[I->proxy->dimensions-1] = I->key; - - sa = V_ARRAY(&I->proxy->obj->v); - - if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) { - vt = V_VT(&I->proxy->obj->v) & ~VT_ARRAY; - } - - VariantInit(&v); - if (vt == VT_VARIANT) { - SafeArrayGetElement(sa, I->indices, &v); - } else { - V_VT(&v) = vt; - SafeArrayGetElement(sa, I->indices, &v.lVal); - } - - MAKE_STD_ZVAL(return_value); - php_com_wrap_variant(return_value, &v, I->proxy->obj->code_page TSRMLS_CC); - VariantClear(&v); - - ptr_ptr = emalloc(sizeof(*ptr_ptr)); - *ptr_ptr = return_value; - *data = ptr_ptr; -} - -static int saproxy_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - if (I->key == -1) { - return HASH_KEY_NON_EXISTANT; - } - *int_key = (ulong)I->key; - return HASH_KEY_IS_LONG; -} - -static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - if (++I->key >= I->imax) { - I->key = -1; - return FAILURE; - } - return SUCCESS; -} - -static zend_object_iterator_funcs saproxy_iter_funcs = { - saproxy_iter_dtor, - saproxy_iter_valid, - saproxy_iter_get_data, - saproxy_iter_get_key, - saproxy_iter_move_forwards, - NULL -}; - - -zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - php_com_saproxy_iter *I; - int i; - - I = ecalloc(1, sizeof(*I)); - I->iter.funcs = &saproxy_iter_funcs; - I->iter.data = I; - - I->proxy = proxy; - I->proxy_obj = object; - ZVAL_ADDREF(I->proxy_obj); - - I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0); - for (i = 0; i < proxy->dimensions; i++) { - convert_to_long(proxy->indices[i]); - I->indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin); - SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imax); - - I->key = I->imin; - - return &I->iter; -} - diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c deleted file mode 100644 index b779366d65c9b..0000000000000 --- a/ext/com_dotnet/com_typeinfo.c +++ /dev/null @@ -1,603 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | Harald Radi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - - -/* The search string can be either: - * a) a file name - * b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0" - * c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library" - */ -PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC) -{ - ITypeLib *TL = NULL; - char *strtok_buf, *major, *minor; - CLSID clsid; - OLECHAR *p; - HRESULT hr; - - search_string = php_strtok_r(search_string, ",", &strtok_buf); - - if (search_string == NULL) { - return NULL; - } - - major = php_strtok_r(NULL, ",", &strtok_buf); - minor = php_strtok_r(NULL, ",", &strtok_buf); - - p = php_com_string_to_olestring(search_string, strlen(search_string), codepage TSRMLS_CC); - - if (SUCCEEDED(CLSIDFromString(p, &clsid))) { - WORD major_i = 1, minor_i = 0; - - /* pick up the major/minor numbers; if none specified, default to 1,0 */ - if (major && minor) { - major_i = (WORD)atoi(major); - minor_i = (WORD)atoi(minor); - } - - /* Load the TypeLib by GUID */ - hr = LoadRegTypeLib((REFGUID)&clsid, major_i, minor_i, LANG_NEUTRAL, &TL); - - /* if that failed, assumed that the GUID is actually a CLSID and - * attemp to get the library via an instance of that class */ - if (FAILED(hr) && (major == NULL || minor == NULL)) { - IDispatch *disp = NULL; - ITypeInfo *info = NULL; - int idx; - - if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&disp)) && - SUCCEEDED(hr = IDispatch_GetTypeInfo(disp, 0, LANG_NEUTRAL, &info))) { - hr = ITypeInfo_GetContainingTypeLib(info, &TL, &idx); - } - - if (info) { - ITypeInfo_Release(info); - } - if (disp) { - IDispatch_Release(disp); - } - } - } else { - /* Try to load it from a file; if it fails, do a really painful search of - * the registry */ - if (FAILED(LoadTypeLib(p, &TL))) { - HKEY hkey, hsubkey; - DWORD SubKeys, MaxSubKeyLength; - char *keyname; - unsigned int i, j; - DWORD VersionCount; - char version[20]; - char *libname; - DWORD libnamelen; - - if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib", 0, KEY_READ, &hkey) && - ERROR_SUCCESS == RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys, - &MaxSubKeyLength, NULL, NULL, NULL, NULL, NULL, NULL)) { - - MaxSubKeyLength++; /* make room for NUL */ - keyname = emalloc(MaxSubKeyLength); - libname = emalloc(strlen(search_string) + 1); - - for (i = 0; i < SubKeys && TL == NULL; i++) { - if (ERROR_SUCCESS == RegEnumKey(hkey, i, keyname, MaxSubKeyLength) && - ERROR_SUCCESS == RegOpenKeyEx(hkey, keyname, 0, KEY_READ, &hsubkey)) { - if (ERROR_SUCCESS == RegQueryInfoKey(hsubkey, NULL, NULL, NULL, &VersionCount, - NULL, NULL, NULL, NULL, NULL, NULL, NULL)) { - for (j = 0; j < VersionCount; j++) { - if (ERROR_SUCCESS != RegEnumKey(hsubkey, j, version, sizeof(version))) { - continue; - } - /* get the default value for this key and compare */ - libnamelen = strlen(search_string)+1; - if (ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, &libnamelen)) { - if (0 == stricmp(libname, search_string)) { - char *str = NULL; - int major, minor; - - /* fetch the GUID and add the version numbers */ - if (2 != sscanf(version, "%d.%d", &major, &minor)) { - major = 1; - minor = 0; - } - spprintf(&str, 0, "%s,%d,%d", keyname, major, minor); - /* recurse */ - TL = php_com_load_typelib(str, codepage TSRMLS_CC); - - efree(str); - break; - } - } - } - } - RegCloseKey(hsubkey); - } - } - RegCloseKey(hkey); - efree(keyname); - efree(libname); - } - } - } - - efree(p); - - return TL; -} - -/* Given a type-library, merge it into the current engine state */ -PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC) -{ - int i, j, interfaces; - TYPEKIND pTKind; - ITypeInfo *TypeInfo; - VARDESC *pVarDesc; - UINT NameCount; - BSTR bstr_ids; - zend_constant c; - zval exists, results, value; - char *const_name; - - if (TL == NULL) { - return FAILURE; - } - - interfaces = ITypeLib_GetTypeInfoCount(TL); - for (i = 0; i < interfaces; i++) { - ITypeLib_GetTypeInfoType(TL, i, &pTKind); - if (pTKind == TKIND_ENUM) { - ITypeLib_GetTypeInfo(TL, i, &TypeInfo); - for (j = 0; ; j++) { - if (FAILED(ITypeInfo_GetVarDesc(TypeInfo, j, &pVarDesc))) { - break; - } - ITypeInfo_GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount); - if (NameCount != 1) { - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - continue; - } - - const_name = php_com_olestring_to_string(bstr_ids, &c.name_len, codepage TSRMLS_CC); - c.name = zend_strndup(const_name, c.name_len); - efree(const_name); - c.name_len++; /* include NUL */ - SysFreeString(bstr_ids); - - /* sanity check for the case where the constant is already defined */ - if (zend_get_constant(c.name, c.name_len - 1, &exists TSRMLS_CC)) { - if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, &exists TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type library constant %s is already defined", c.name); - } - free(c.name); - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - continue; - } - - /* register the constant */ - php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage TSRMLS_CC); - if (Z_TYPE(value) == IS_LONG) { - c.flags = mode; - c.value.type = IS_LONG; - c.value.value.lval = Z_LVAL(value); - c.module_number = 0; - zend_register_constant(&c TSRMLS_CC); - } - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - } - ITypeInfo_Release(TypeInfo); - } - } - return SUCCESS; -} - -/* Type-library stuff */ -void php_com_typelibrary_dtor(void *pDest) -{ - ITypeLib *Lib = *(ITypeLib**)pDest; - ITypeLib_Release(Lib); -} - -PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string, - int codepage, int *cached TSRMLS_DC) -{ - ITypeLib **TLp; - ITypeLib *TL; - char *name_dup; - int l; - - l = strlen(search_string); - - if (zend_ts_hash_find(&php_com_typelibraries, search_string, l+1, - (void**)&TLp) == SUCCESS) { - *cached = 1; - /* add a reference for the caller */ - ITypeLib_AddRef(*TLp); - return *TLp; - } - - *cached = 0; - name_dup = estrndup(search_string, l); - TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC); - efree(name_dup); - - if (TL) { - if (SUCCESS == zend_ts_hash_update(&php_com_typelibraries, - search_string, l+1, (void*)TL, sizeof(ITypeLib*), NULL)) { - /* add a reference for the hash table */ - ITypeLib_AddRef(TL); - } - } - - return TL; -} - -ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC) -{ - ITypeInfo *typeinfo = NULL; - ITypeLib *typelib = NULL; - int gotguid = 0; - GUID iid; - - if (obj) { - if (dispname == NULL && sink) { - IProvideClassInfo2 *pci2; - IProvideClassInfo *pci; - - if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) { - gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid)); - IProvideClassInfo2_Release(pci2); - } - if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) { - /* examine the available interfaces */ - /* TODO: write some code here */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "IProvideClassInfo: this code not yet written!"); - IProvideClassInfo_Release(pci); - } - } else if (dispname == NULL) { - if (obj->typeinfo) { - ITypeInfo_AddRef(obj->typeinfo); - return obj->typeinfo; - } else { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo); - if (typeinfo) { - return typeinfo; - } - } - } else if (dispname && obj->typeinfo) { - unsigned int idx; - /* get the library from the object; the rest will be dealt with later */ - ITypeInfo_GetContainingTypeLib(obj->typeinfo, &typelib, &idx); - } else if (typelibname == NULL) { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo); - if (dispname) { - unsigned int idx; - /* get the library from the object; the rest will be dealt with later */ - ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx); - - if (typelib) { - ITypeInfo_Release(typeinfo); - typeinfo = NULL; - } - } - } - } else if (typelibname) { - /* Fetch the typelibrary and use that to look things up */ - typelib = php_com_load_typelib(typelibname, obj->code_page TSRMLS_CC); - } - - if (!gotguid && dispname && typelib) { - unsigned short cfound; - MEMBERID memid; - OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP TSRMLS_CC); - - cfound = 1; - if (FAILED(ITypeLib_FindName(typelib, olename, 0, &typeinfo, &memid, &cfound)) || cfound == 0) { - CLSID coclass; - ITypeInfo *coinfo; - - /* assume that it might be a progid instead */ - if (SUCCEEDED(CLSIDFromProgID(olename, &coclass)) && - SUCCEEDED(ITypeLib_GetTypeInfoOfGuid(typelib, &coclass, &coinfo))) { - - /* enumerate implemented interfaces and pick the one as indicated by sink */ - TYPEATTR *attr; - int i; - - ITypeInfo_GetTypeAttr(coinfo, &attr); - - for (i = 0; i < attr->cImplTypes; i++) { - HREFTYPE rt; - int tf; - - if (FAILED(ITypeInfo_GetImplTypeFlags(coinfo, i, &tf))) { - continue; - } - - if ((sink && tf == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) || - (!sink && (tf & IMPLTYPEFLAG_FSOURCE) == 0)) { - - /* flags match what we are looking for */ - - if (SUCCEEDED(ITypeInfo_GetRefTypeOfImplType(coinfo, i, &rt))) - if (SUCCEEDED(ITypeInfo_GetRefTypeInfo(coinfo, rt, &typeinfo))) - break; - - } - } - - ITypeInfo_ReleaseTypeAttr(coinfo, attr); - ITypeInfo_Release(coinfo); - } - } - - - efree(olename); - } else if (gotguid) { - ITypeLib_GetTypeInfoOfGuid(typelib, &iid, &typeinfo); - } - - if (typelib) { - ITypeLib_Release(typelib); - } - - return typeinfo; -} - -static const struct { - VARTYPE vt; - const char *name; -} vt_names[] = { - { VT_NULL, "VT_NULL" }, - { VT_EMPTY, "VT_EMPTY" }, - { VT_UI1, "VT_UI1" }, - { VT_I2, "VT_I2" }, - { VT_I4, "VT_I4" }, - { VT_R4, "VT_R4" }, - { VT_R8, "VT_R8" }, - { VT_BOOL, "VT_BOOL" }, - { VT_ERROR, "VT_ERROR" }, - { VT_CY, "VT_CY" }, - { VT_DATE, "VT_DATE" }, - { VT_BSTR, "VT_BSTR" }, - { VT_DECIMAL, "VT_DECIMAL" }, - { VT_UNKNOWN, "VT_UNKNOWN" }, - { VT_DISPATCH, "VT_DISPATCH" }, - { VT_VARIANT, "VT_VARIANT" }, - { VT_I1, "VT_I1" }, - { VT_UI2, "VT_UI2" }, - { VT_UI4, "VT_UI4" }, - { VT_INT, "VT_INT" }, - { VT_UINT, "VT_UINT" }, - { VT_ARRAY, "VT_ARRAY" }, - { VT_BYREF, "VT_BYREF" }, - { VT_VOID, "VT_VOID" }, - { VT_PTR, "VT_PTR" }, - { VT_HRESULT, "VT_HRESULT" }, - { VT_SAFEARRAY, "VT_SAFEARRAY" }, - { 0, NULL } -}; - -static inline const char *vt_to_string(VARTYPE vt) -{ - int i; - for (i = 0; vt_names[i].name != NULL; i++) { - if (vt_names[i].vt == vt) - return vt_names[i].name; - } - return "?"; -} - -static char *php_com_string_from_clsid(const CLSID *clsid, int codepage TSRMLS_DC) -{ - LPOLESTR ole_clsid; - char *clsid_str; - - StringFromCLSID(clsid, &ole_clsid); - clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage TSRMLS_CC); - LocalFree(ole_clsid); - - return clsid_str; -} - - -int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC) -{ - TYPEATTR *attr; - FUNCDESC *func; - int i; - OLECHAR *olename; - char *ansiname = NULL; - unsigned int ansinamelen; - int ret = 0; - - if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) { - return 0; - } - - /* verify that it is suitable */ - if (id_to_name == NULL || attr->typekind == TKIND_DISPATCH) { - - if (guid) { - memcpy(guid, &attr->guid, sizeof(GUID)); - } - - if (printdef) { - char *guidstring; - - ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL); - ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC); - SysFreeString(olename); - - guidstring = php_com_string_from_clsid(&attr->guid, codepage TSRMLS_CC); - php_printf("class %s { /* GUID=%s */\n", ansiname, guidstring); - efree(guidstring); - - efree(ansiname); - } - - if (id_to_name) { - zend_hash_init(id_to_name, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - /* So we've got the dispatch interface; lets list the event methods */ - for (i = 0; i < attr->cFuncs; i++) { - zval *tmp; - DISPID lastid = 0; /* for props */ - int isprop; - - if (FAILED(ITypeInfo_GetFuncDesc(typeinfo, i, &func))) - break; - - isprop = (func->invkind & DISPATCH_PROPERTYGET || func->invkind & DISPATCH_PROPERTYPUT); - - if (!isprop || lastid != func->memid) { - - lastid = func->memid; - - ITypeInfo_GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL); - ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC); - SysFreeString(olename); - - if (printdef) { - int j; - char *funcdesc; - unsigned int funcdesclen, cnames = 0; - BSTR *names; - - names = (BSTR*)safe_emalloc((func->cParams + 1), sizeof(BSTR), 0); - - ITypeInfo_GetNames(typeinfo, func->memid, names, func->cParams + 1, &cnames); - /* first element is the function name */ - SysFreeString(names[0]); - - php_printf("\t/* DISPID=%d */\n", func->memid); - - if (func->elemdescFunc.tdesc.vt != VT_VOID) { - php_printf("\t/* %s [%d] */\n", - vt_to_string(func->elemdescFunc.tdesc.vt), - func->elemdescFunc.tdesc.vt - ); - } - - if (isprop) { - - ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); - if (olename) { - funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC); - SysFreeString(olename); - php_printf("\t/* %s */\n", funcdesc); - efree(funcdesc); - } - - php_printf("\tvar $%s;\n\n", ansiname); - - } else { - /* a function */ - - php_printf("\tfunction %s(\n", ansiname); - - for (j = 0; j < func->cParams; j++) { - ELEMDESC *elem = &func->lprgelemdescParam[j]; - - php_printf("\t\t/* %s [%d] ", vt_to_string(elem->tdesc.vt), elem->tdesc.vt); - - if (elem->paramdesc.wParamFlags & PARAMFLAG_FIN) - php_printf("[in]"); - if (elem->paramdesc.wParamFlags & PARAMFLAG_FOUT) - php_printf("[out]"); - - if (elem->tdesc.vt == VT_PTR) { - /* what does it point to ? */ - php_printf(" --> %s [%d] ", - vt_to_string(elem->tdesc.lptdesc->vt), - elem->tdesc.lptdesc->vt - ); - } - - /* when we handle prop put and get, this will look nicer */ - if (j+1 < (int)cnames) { - funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage TSRMLS_CC); - SysFreeString(names[j+1]); - } else { - funcdesc = "???"; - } - - php_printf(" */ %s%s%c\n", - elem->tdesc.vt == VT_PTR ? "&$" : "$", - funcdesc, - j == func->cParams - 1 ? ' ' : ',' - ); - - if (j+1 < (int)cnames) { - efree(funcdesc); - } - } - - php_printf("\t\t)\n\t{\n"); - - ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); - if (olename) { - funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC); - SysFreeString(olename); - php_printf("\t\t/* %s */\n", funcdesc); - efree(funcdesc); - } - - php_printf("\t}\n"); - } - - efree(names); - } - - if (id_to_name) { - zend_str_tolower(ansiname, ansinamelen); - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, ansiname, ansinamelen, 0); - zend_hash_index_update(id_to_name, func->memid, (void*)&tmp, sizeof(zval *), NULL); - } - } - ITypeInfo_ReleaseFuncDesc(typeinfo, func); - } - - if (printdef) { - php_printf("}\n"); - } - - ret = 1; - } else { - zend_error(E_WARNING, "That's not a dispatchable interface!! type kind = %08x", attr->typekind); - } - - ITypeInfo_ReleaseTypeAttr(typeinfo, attr); - - return ret; -} - - diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c deleted file mode 100644 index 7c3ea12c5a0a7..0000000000000 --- a/ext/com_dotnet/com_variant.c +++ /dev/null @@ -1,912 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - -/* create an automation SafeArray from a PHP array. - * Only creates a single-dimensional array of variants. - * The keys of the PHP hash MUST be numeric. If the array - * is sparse, then the gaps will be filled with NULL variants */ -static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) -{ - SAFEARRAY *sa = NULL; - SAFEARRAYBOUND bound; - HashPosition pos; - int keytype; - char *strindex; - int strindexlen; - long intindex; - long max_index = 0; - VARIANT *va; - zval **item; - - /* find the largest array index, and assert that all keys are integers */ - zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos); - for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) { - - keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos); - - if (HASH_KEY_IS_STRING == keytype) { - goto bogus; - } else if (HASH_KEY_NON_EXISTANT == keytype) { - break; - } - if (intindex > max_index) { - max_index = intindex; - } - } - - /* allocate the structure */ - bound.lLbound = 0; - bound.cElements = intindex + 1; - sa = SafeArrayCreate(VT_VARIANT, 1, &bound); - - /* get a lock on the array itself */ - SafeArrayAccessData(sa, &va); - va = (VARIANT*)sa->pvData; - - /* now fill it in */ - zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos); - for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) { - if (FAILURE == zend_hash_get_current_data_ex(HASH_OF(z), (void**)&item, &pos)) { - break; - } - zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos); - php_com_variant_from_zval(&va[intindex], *item, codepage TSRMLS_CC); - } - - /* Unlock it and stuff it into our variant */ - SafeArrayUnaccessData(sa); - V_VT(v) = VT_ARRAY|VT_VARIANT; - V_ARRAY(v) = sa; - - return; - -bogus: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed"); - - V_VT(v) = VT_NULL; - - if (sa) { - SafeArrayUnlock(sa); - SafeArrayDestroy(sa); - } -} - -PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) -{ - OLECHAR *olestring; - php_com_dotnet_object *obj; - - switch (Z_TYPE_P(z)) { - case IS_NULL: - V_VT(v) = VT_NULL; - break; - - case IS_BOOL: - V_VT(v) = VT_BOOL; - V_BOOL(v) = Z_BVAL_P(z) ? VARIANT_TRUE : VARIANT_FALSE; - break; - - case IS_OBJECT: - if (php_com_is_valid_object(z TSRMLS_CC)) { - obj = CDNO_FETCH(z); - if (V_VT(&obj->v) == VT_DISPATCH) { - /* pass the underlying object */ - V_VT(v) = VT_DISPATCH; - if (V_DISPATCH(&obj->v)) { - IDispatch_AddRef(V_DISPATCH(&obj->v)); - } - V_DISPATCH(v) = V_DISPATCH(&obj->v); - } else { - /* pass the variant by reference */ - V_VT(v) = VT_VARIANT | VT_BYREF; - V_VARIANTREF(v) = &obj->v; - } - } else { - /* export the PHP object using our COM wrapper */ - V_VT(v) = VT_DISPATCH; - V_DISPATCH(v) = php_com_wrapper_export(z TSRMLS_CC); - } - break; - - case IS_ARRAY: - /* map as safe array */ - safe_array_from_zval(v, z, codepage TSRMLS_CC); - break; - - case IS_LONG: - V_VT(v) = VT_I4; - V_I4(v) = Z_LVAL_P(z); - break; - - case IS_DOUBLE: - V_VT(v) = VT_R8; - V_R8(v) = Z_DVAL_P(z); - break; - - case IS_STRING: - V_VT(v) = VT_BSTR; - olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC); - V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR)); - efree(olestring); - break; - - case IS_UNICODE: - V_VT(v) = VT_BSTR; - V_BSTR(v) = SysAllocString(Z_USTRVAL_P(z)); - break; - - case IS_RESOURCE: - case IS_CONSTANT: - case IS_CONSTANT_ARRAY: - default: - V_VT(v) = VT_NULL; - break; - } -} - -PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC) -{ - OLECHAR *olestring = NULL; - int ret = SUCCESS; - - switch (V_VT(v)) { - case VT_EMPTY: - case VT_NULL: - case VT_VOID: - ZVAL_NULL(z); - break; - case VT_UI1: - ZVAL_LONG(z, (long)V_UI1(v)); - break; - case VT_I1: - ZVAL_LONG(z, (long)V_I1(v)); - break; - case VT_UI2: - ZVAL_LONG(z, (long)V_UI2(v)); - break; - case VT_I2: - ZVAL_LONG(z, (long)V_I2(v)); - break; - case VT_UI4: /* TODO: promote to double if large? */ - ZVAL_LONG(z, (long)V_UI4(v)); - break; - case VT_I4: - ZVAL_LONG(z, (long)V_I4(v)); - break; - case VT_INT: - ZVAL_LONG(z, V_INT(v)); - break; - case VT_UINT: /* TODO: promote to double if large? */ - ZVAL_LONG(z, (long)V_UINT(v)); - break; - case VT_R4: - ZVAL_DOUBLE(z, (double)V_R4(v)); - break; - case VT_R8: - ZVAL_DOUBLE(z, V_R8(v)); - break; - case VT_BOOL: - ZVAL_BOOL(z, V_BOOL(v) ? 1 : 0); - break; - case VT_BSTR: - if (V_BSTR(v)) { - ZVAL_UNICODE(z, V_BSTR(v), 1); - } - break; - case VT_UNKNOWN: - if (V_UNKNOWN(v) != NULL) { - IDispatch *disp; - - if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, &disp))) { - php_com_wrap_dispatch(z, disp, codepage TSRMLS_CC); - IDispatch_Release(disp); - } else { - ret = FAILURE; - } - } - break; - - case VT_DISPATCH: - if (V_DISPATCH(v) != NULL) { - php_com_wrap_dispatch(z, V_DISPATCH(v), codepage TSRMLS_CC); - } - break; - - case VT_VARIANT: - /* points to another variant */ - return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage TSRMLS_CC); - - default: - php_com_wrap_variant(z, v, codepage TSRMLS_CC); - } - - if (olestring) { - efree(olestring); - } - - if (ret == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret); - } - - return ret; -} - -/* {{{ com_variant_create_instance - ctor for new VARIANT() */ -PHP_FUNCTION(com_variant_create_instance) -{ - /* VARTYPE == unsigned short */ long vt = VT_EMPTY; - long codepage = CP_ACP; - zval *object = getThis(); - php_com_dotnet_object *obj; - zval *zvalue = NULL; - HRESULT res; - - if (ZEND_NUM_ARGS() == 0) { - /* just leave things as-is - an empty variant */ - return; - } - - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!|ll", &zvalue, &vt, &codepage)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - if (ZEND_NUM_ARGS() == 3) { - obj->code_page = codepage; - } - - if (zvalue) { - php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC); - } - - if (ZEND_NUM_ARGS() >= 2) { - - res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt); - - if (FAILED(res)) { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } - } - - if (V_VT(&obj->v) != VT_DISPATCH && obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } -} -/* }}} */ - -/* {{{ proto void variant_set(object variant, mixed value) - Assigns a new value for a variant object */ -PHP_FUNCTION(variant_set) -{ - zval *zobj, *zvalue = NULL; - php_com_dotnet_object *obj; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Oz!", &zobj, php_com_variant_class_entry, &zvalue)) { - return; - } - - obj = CDNO_FETCH(zobj); - - /* dtor the old value */ - if (obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - if (obj->sink_dispatch) { - php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC); - IDispatch_Release(obj->sink_dispatch); - obj->sink_dispatch = NULL; - } - - VariantClear(&obj->v); - - php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC); -} -/* }}} */ - -enum variant_binary_opcode { - VOP_ADD, VOP_CAT, VOP_SUB, VOP_MUL, VOP_AND, VOP_DIV, - VOP_EQV, VOP_IDIV, VOP_IMP, VOP_MOD, VOP_OR, VOP_POW, - VOP_XOR -}; - -enum variant_unary_opcode { - VOP_ABS, VOP_FIX, VOP_INT, VOP_NEG, VOP_NOT -}; - -static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ -{ - VARIANT vres; - VARIANT left_val, right_val; - VARIANT *vleft = NULL, *vright = NULL; - zval *zleft = NULL, *zright = NULL; - php_com_dotnet_object *obj; - HRESULT result; - int codepage = CP_ACP; - - VariantInit(&left_val); - VariantInit(&right_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "OO", &zleft, php_com_variant_class_entry, - &zright, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - obj = CDNO_FETCH(zright); - vright = &obj->v; - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Oz!", &zleft, php_com_variant_class_entry, - &zright)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "z!O", &zleft, &zright, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zright); - vright = &obj->v; - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!z!", &zleft, &zright)) { - - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - - } else { - return; - } - - switch (op) { - case VOP_ADD: - result = VarAdd(vleft, vright, &vres); - break; - case VOP_CAT: - result = VarCat(vleft, vright, &vres); - break; - case VOP_SUB: - result = VarSub(vleft, vright, &vres); - break; - case VOP_MUL: - result = VarMul(vleft, vright, &vres); - break; - case VOP_AND: - result = VarAnd(vleft, vright, &vres); - break; - case VOP_DIV: - result = VarDiv(vleft, vright, &vres); - break; - case VOP_EQV: - result = VarEqv(vleft, vright, &vres); - break; - case VOP_IDIV: - result = VarIdiv(vleft, vright, &vres); - break; - case VOP_IMP: - result = VarImp(vleft, vright, &vres); - break; - case VOP_MOD: - result = VarMod(vleft, vright, &vres); - break; - case VOP_OR: - result = VarOr(vleft, vright, &vres); - break; - case VOP_POW: - result = VarPow(vleft, vright, &vres); - break; - case VOP_XOR: - result = VarXor(vleft, vright, &vres); - break; - } - - if (SUCCEEDED(result)) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } else { - php_com_throw_exception(result, NULL TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); - VariantClear(&right_val); -} -/* }}} */ - -/* {{{ proto mixed variant_add(mixed left, mixed right) - "Adds" two variant values together and returns the result */ -PHP_FUNCTION(variant_add) -{ - variant_binary_operation(VOP_ADD, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_cat(mixed left, mixed right) - concatenates two variant values together and returns the result */ -PHP_FUNCTION(variant_cat) -{ - variant_binary_operation(VOP_CAT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_sub(mixed left, mixed right) - subtracts the value of the right variant from the left variant value and returns the result */ -PHP_FUNCTION(variant_sub) -{ - variant_binary_operation(VOP_SUB, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_mul(mixed left, mixed right) - multiplies the values of the two variants and returns the result */ -PHP_FUNCTION(variant_mul) -{ - variant_binary_operation(VOP_MUL, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_and(mixed left, mixed right) - performs a bitwise AND operation between two variants and returns the result */ -PHP_FUNCTION(variant_and) -{ - variant_binary_operation(VOP_AND, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_div(mixed left, mixed right) - Returns the result from dividing two variants */ -PHP_FUNCTION(variant_div) -{ - variant_binary_operation(VOP_DIV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_eqv(mixed left, mixed right) - Performs a bitwise equivalence on two variants */ -PHP_FUNCTION(variant_eqv) -{ - variant_binary_operation(VOP_EQV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_idiv(mixed left, mixed right) - Converts variants to integers and then returns the result from dividing them */ -PHP_FUNCTION(variant_idiv) -{ - variant_binary_operation(VOP_IDIV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_imp(mixed left, mixed right) - Performs a bitwise implication on two variants */ -PHP_FUNCTION(variant_imp) -{ - variant_binary_operation(VOP_IMP, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_mod(mixed left, mixed right) - Divides two variants and returns only the remainder */ -PHP_FUNCTION(variant_mod) -{ - variant_binary_operation(VOP_MOD, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_or(mixed left, mixed right) - Performs a logical disjunction on two variants */ -PHP_FUNCTION(variant_or) -{ - variant_binary_operation(VOP_OR, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_pow(mixed left, mixed right) - Returns the result of performing the power function with two variants */ -PHP_FUNCTION(variant_pow) -{ - variant_binary_operation(VOP_POW, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_xor(mixed left, mixed right) - Performs a logical exclusion on two variants */ -PHP_FUNCTION(variant_xor) -{ - variant_binary_operation(VOP_XOR, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ -{ - VARIANT vres; - VARIANT left_val; - VARIANT *vleft = NULL; - zval *zleft = NULL; - php_com_dotnet_object *obj; - HRESULT result; - int codepage = CP_ACP; - - VariantInit(&left_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "O", &zleft, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!", &zleft)) { - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else { - return; - } - - switch (op) { - case VOP_ABS: - result = VarAbs(vleft, &vres); - break; - case VOP_FIX: - result = VarFix(vleft, &vres); - break; - case VOP_INT: - result = VarInt(vleft, &vres); - break; - case VOP_NEG: - result = VarNeg(vleft, &vres); - break; - case VOP_NOT: - result = VarNot(vleft, &vres); - break; - } - - if (SUCCEEDED(result)) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } else { - php_com_throw_exception(result, NULL TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); -} -/* }}} */ - -/* {{{ proto mixed variant_abs(mixed left) - Returns the absolute value of a variant */ -PHP_FUNCTION(variant_abs) -{ - variant_unary_operation(VOP_ABS, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_fix(mixed left) - Returns the integer part ? of a variant */ -PHP_FUNCTION(variant_fix) -{ - variant_unary_operation(VOP_FIX, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_int(mixed left) - Returns the integer portion of a variant */ -PHP_FUNCTION(variant_int) -{ - variant_unary_operation(VOP_INT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_neg(mixed left) - Performs logical negation on a variant */ -PHP_FUNCTION(variant_neg) -{ - variant_unary_operation(VOP_NEG, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_not(mixed left) - Performs bitwise not negation on a variant */ -PHP_FUNCTION(variant_not) -{ - variant_unary_operation(VOP_NOT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_round(mixed left, int decimals) - Rounds a variant to the specified number of decimal places */ -PHP_FUNCTION(variant_round) -{ - VARIANT vres; - VARIANT left_val; - VARIANT *vleft = NULL; - zval *zleft = NULL; - php_com_dotnet_object *obj; - int codepage = CP_ACP; - long decimals = 0; - - VariantInit(&left_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &zleft, php_com_variant_class_entry, &decimals)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!l", &zleft, &decimals)) { - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else { - return; - } - - if (SUCCEEDED(VarRound(vleft, decimals, &vres))) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); -} -/* }}} */ - -/* {{{ proto int variant_cmp(mixed left, mixed right [, int lcid [, int flags]]) - Compares two variants */ -PHP_FUNCTION(variant_cmp) -{ - VARIANT left_val, right_val; - VARIANT *vleft = NULL, *vright = NULL; - zval *zleft = NULL, *zright = NULL; - php_com_dotnet_object *obj; - int codepage = CP_ACP; - long lcid = LOCALE_SYSTEM_DEFAULT; - long flags = 0; - /* it is safe to ignore the warning for this line; see the comments in com_handlers.c */ - STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags); - - VariantInit(&left_val); - VariantInit(&right_val); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry, - &zright, php_com_variant_class_entry, &lcid, &flags)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - obj = CDNO_FETCH(zright); - vright = &obj->v; - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry, - &zright, &lcid, &flags)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry, - &lcid, &flags)) { - obj = CDNO_FETCH(zright); - vright = &obj->v; - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!z!|ll", &zleft, &zright, &lcid, &flags)) { - - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - - } else { - return; - } - - ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags)); - - VariantClear(&left_val); - VariantClear(&right_val); -} -/* }}} */ - -/* {{{ proto int variant_date_to_timestamp(object variant) - Converts a variant date/time value to unix timestamp */ -PHP_FUNCTION(variant_date_to_timestamp) -{ - VARIANT vres; - zval *zleft = NULL; - php_com_dotnet_object *obj; - - VariantInit(&vres); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", &zleft, php_com_variant_class_entry)) { - return; - } - obj = CDNO_FETCH(zleft); - - if (SUCCEEDED(VariantChangeType(&vres, &obj->v, 0, VT_DATE))) { - SYSTEMTIME systime; - struct tm tmv; - - VariantTimeToSystemTime(V_DATE(&vres), &systime); - - memset(&tmv, 0, sizeof(tmv)); - tmv.tm_year = systime.wYear - 1900; - tmv.tm_mon = systime.wMonth - 1; - tmv.tm_mday = systime.wDay; - tmv.tm_hour = systime.wHour; - tmv.tm_min = systime.wMinute; - tmv.tm_sec = systime.wSecond; - tmv.tm_isdst = -1; - - tzset(); - RETVAL_LONG(mktime(&tmv)); - } - - VariantClear(&vres); -} -/* }}} */ - -/* {{{ proto object variant_date_from_timestamp(int timestamp) - Returns a variant date representation of a unix timestamp */ -PHP_FUNCTION(variant_date_from_timestamp) -{ - long timestamp; - time_t ttstamp; - SYSTEMTIME systime; - struct tm *tmv; - VARIANT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", - ×tamp)) { - return; - } - - VariantInit(&res); - tzset(); - ttstamp = timestamp; - tmv = localtime(&ttstamp); - memset(&systime, 0, sizeof(systime)); - - systime.wDay = tmv->tm_mday; - systime.wHour = tmv->tm_hour; - systime.wMinute = tmv->tm_min; - systime.wMonth = tmv->tm_mon + 1; - systime.wSecond = tmv->tm_sec; - systime.wYear = tmv->tm_year + 1900; - - V_VT(&res) = VT_DATE; - SystemTimeToVariantTime(&systime, &V_DATE(&res)); - - php_com_wrap_variant(return_value, &res, CP_ACP TSRMLS_CC); - - VariantClear(&res); -} -/* }}} */ - -/* {{{ proto int variant_get_type(object variant) - Returns the VT_XXX type code for a variant */ -PHP_FUNCTION(variant_get_type) -{ - zval *zobj; - php_com_dotnet_object *obj; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", &zobj, php_com_variant_class_entry)) { - return; - } - obj = CDNO_FETCH(zobj); - - RETURN_LONG(V_VT(&obj->v)); -} -/* }}} */ - -/* {{{ proto void variant_set_type(object variant, int type) - Convert a variant into another type. Variant is modified "in-place" */ -PHP_FUNCTION(variant_set_type) -{ - zval *zobj; - php_com_dotnet_object *obj; - /* VARTYPE == unsigned short */ long vt; - HRESULT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Ol", &zobj, php_com_variant_class_entry, &vt)) { - return; - } - obj = CDNO_FETCH(zobj); - - res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt); - - if (SUCCEEDED(res)) { - if (vt != VT_DISPATCH && obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - } else { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } -} -/* }}} */ - -/* {{{ proto object variant_cast(object variant, int type) - Convert a variant into a new variant object of another type */ -PHP_FUNCTION(variant_cast) -{ - zval *zobj; - php_com_dotnet_object *obj; - /* VARTYPE == unsigned short */ long vt; - VARIANT vres; - HRESULT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Ol", &zobj, php_com_variant_class_entry, &vt)) { - return; - } - obj = CDNO_FETCH(zobj); - - VariantInit(&vres); - res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt); - - if (SUCCEEDED(res)) { - php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC); - } else { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } - - VariantClear(&vres); -} -/* }}} */ - diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c deleted file mode 100644 index 0236d2e1ab509..0000000000000 --- a/ext/com_dotnet/com_wrapper.c +++ /dev/null @@ -1,635 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This module exports a PHP object as a COM object by wrapping it - * using IDispatchEx */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - -typedef struct { - /* This first part MUST match the declaration - * of interface IDispatchEx */ - CONST_VTBL struct IDispatchExVtbl *lpVtbl; - - /* now the PHP stuff */ - - DWORD engine_thread; /* for sanity checking */ - zval *object; /* the object exported */ - LONG refcount; /* COM reference count */ - - HashTable *dispid_to_name; /* keep track of dispid -> name mappings */ - HashTable *name_to_dispid; /* keep track of name -> dispid mappings */ - - GUID sinkid; /* iid that we "implement" for event sinking */ - - int id; -} php_dispatchex; - -static int le_dispatch; - -static void disp_destructor(php_dispatchex *disp); - -static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_dispatchex *disp = (php_dispatchex *)rsrc->ptr; - disp_destructor(disp); -} - -int php_com_wrapper_minit(INIT_FUNC_ARGS) -{ - le_dispatch = zend_register_list_destructors_ex(dispatch_dtor, - NULL, "com_dotnet_dispatch_wrapper", module_number); - return le_dispatch; -} - - -/* {{{ trace */ -static inline void trace(char *fmt, ...) -{ - va_list ap; - char buf[4096]; - - sprintf(buf, "T=%08x ", GetCurrentThreadId()); - OutputDebugString(buf); - - va_start(ap, fmt); - vsnprintf(buf, sizeof(buf), fmt, ap); - - OutputDebugString(buf); - - va_end(ap); -} -/* }}} */ - -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - -#define FETCH_DISP(methname) \ - TSRMLS_FIXED() \ - php_dispatchex *disp = (php_dispatchex*)This; \ - trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \ - if (GetCurrentThreadId() != disp->engine_thread) \ - return RPC_E_WRONG_THREAD; - - -static HRESULT STDMETHODCALLTYPE disp_queryinterface( - IDispatchEx *This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject) -{ - FETCH_DISP("QueryInterface"); - - if (IsEqualGUID(&IID_IUnknown, riid) || - IsEqualGUID(&IID_IDispatch, riid) || - IsEqualGUID(&IID_IDispatchEx, riid) || - IsEqualGUID(&disp->sinkid, riid)) { - *ppvObject = This; - InterlockedIncrement(&disp->refcount); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This) -{ - FETCH_DISP("AddRef"); - - return InterlockedIncrement(&disp->refcount); -} - -static ULONG STDMETHODCALLTYPE disp_release(IDispatchEx *This) -{ - ULONG ret; - FETCH_DISP("Release"); - - ret = InterlockedDecrement(&disp->refcount); - trace("-- refcount now %d\n", ret); - if (ret == 0) { - /* destroy it */ - if (disp->id) - zend_list_delete(disp->id); - } - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_gettypeinfocount( - IDispatchEx *This, - /* [out] */ UINT *pctinfo) -{ - FETCH_DISP("GetTypeInfoCount"); - - *pctinfo = 0; - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE disp_gettypeinfo( - IDispatchEx *This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo) -{ - FETCH_DISP("GetTypeInfo"); - - *ppTInfo = NULL; - return DISP_E_BADINDEX; -} - -static HRESULT STDMETHODCALLTYPE disp_getidsofnames( - IDispatchEx *This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId) -{ - UINT i; - HRESULT ret = S_OK; - FETCH_DISP("GetIDsOfNames"); - - for (i = 0; i < cNames; i++) { - char *name; - unsigned int namelen; - zval **tmp; - - name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC); - - /* Lookup the name in the hash */ - if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == FAILURE) { - ret = DISP_E_UNKNOWNNAME; - rgDispId[i] = 0; - } else { - rgDispId[i] = Z_LVAL_PP(tmp); - } - - efree(name); - - } - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_invoke( - IDispatchEx *This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr) -{ - return This->lpVtbl->InvokeEx(This, dispIdMember, - lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, NULL); -} - -static HRESULT STDMETHODCALLTYPE disp_getdispid( - IDispatchEx *This, - /* [in] */ BSTR bstrName, - /* [in] */ DWORD grfdex, - /* [out] */ DISPID *pid) -{ - HRESULT ret = DISP_E_UNKNOWNNAME; - char *name; - unsigned int namelen; - zval **tmp; - FETCH_DISP("GetDispID"); - - name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page) TSRMLS_CC); - - trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid); - - /* Lookup the name in the hash */ - if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) { - trace("found it\n"); - *pid = Z_LVAL_PP(tmp); - ret = S_OK; - } - - efree(name); - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_invokeex( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [in] */ DISPPARAMS *pdp, - /* [out] */ VARIANT *pvarRes, - /* [out] */ EXCEPINFO *pei, - /* [unique][in] */ IServiceProvider *pspCaller) -{ - zval **name; - UINT i; - zval *retval = NULL; - zval ***params = NULL; - HRESULT ret = DISP_E_MEMBERNOTFOUND; - FETCH_DISP("InvokeEx"); - - if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) { - /* TODO: add support for overloaded objects */ - - trace("-- Invoke: %d %20s [%d] flags=%08x args=%d\n", id, Z_STRVAL_PP(name), Z_STRLEN_PP(name), wFlags, pdp->cArgs); - - /* convert args into zvals. - * Args are in reverse order */ - if (pdp->cArgs) { - params = (zval ***)safe_emalloc(sizeof(zval **), pdp->cArgs, 0); - for (i = 0; i < pdp->cArgs; i++) { - VARIANT *arg; - zval *zarg; - - arg = &pdp->rgvarg[ pdp->cArgs - 1 - i]; - - trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg)); - - ALLOC_INIT_ZVAL(zarg); - php_com_wrap_variant(zarg, arg, COMG(code_page) TSRMLS_CC); - params[i] = (zval**)emalloc(sizeof(zval**)); - *params[i] = zarg; - } - } - - trace("arguments processed, prepare to do some work\n"); - - /* TODO: if PHP raises an exception here, we should catch it - * and expose it as a COM exception */ - - if (wFlags & DISPATCH_PROPERTYGET) { - retval = zend_read_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, 1 TSRMLS_CC); - } else if (wFlags & DISPATCH_PROPERTYPUT) { - zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, *params[0] TSRMLS_CC); - } else if (wFlags & DISPATCH_METHOD) { - zend_try { - if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name, - &retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) { - ret = S_OK; - trace("function called ok\n"); - } else { - trace("failed to call func\n"); - ret = DISP_E_EXCEPTION; - } - } zend_catch { - trace("something blew up\n"); - ret = DISP_E_EXCEPTION; - } zend_end_try(); - } else { - trace("Don't know how to handle this invocation %08x\n", wFlags); - } - - /* release arguments */ - if (params) { - for (i = 0; i < pdp->cArgs; i++) { - zval_ptr_dtor(params[i]); - efree(params[i]); - } - efree(params); - } - - /* return value */ - if (retval) { - if (pvarRes) { - VariantInit(pvarRes); - php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC); - } - zval_ptr_dtor(&retval); - } else if (pvarRes) { - VariantInit(pvarRes); - } - - } else { - trace("InvokeEx: I don't support DISPID=%d\n", id); - } - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_deletememberbyname( - IDispatchEx *This, - /* [in] */ BSTR bstrName, - /* [in] */ DWORD grfdex) -{ - FETCH_DISP("DeleteMemberByName"); - - /* TODO: unset */ - - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid( - IDispatchEx *This, - /* [in] */ DISPID id) -{ - FETCH_DISP("DeleteMemberByDispID"); - - /* TODO: unset */ - - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_getmemberproperties( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [in] */ DWORD grfdexFetch, - /* [out] */ DWORD *pgrfdex) -{ - FETCH_DISP("GetMemberProperties"); - - return DISP_E_UNKNOWNNAME; -} - -static HRESULT STDMETHODCALLTYPE disp_getmembername( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [out] */ BSTR *pbstrName) -{ - zval *name; - FETCH_DISP("GetMemberName"); - - if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) { - OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page) TSRMLS_CC); - *pbstrName = SysAllocString(olestr); - efree(olestr); - return S_OK; - } else { - return DISP_E_UNKNOWNNAME; - } -} - -static HRESULT STDMETHODCALLTYPE disp_getnextdispid( - IDispatchEx *This, - /* [in] */ DWORD grfdex, - /* [in] */ DISPID id, - /* [out] */ DISPID *pid) -{ - ulong next = id+1; - FETCH_DISP("GetNextDispID"); - - while(!zend_hash_index_exists(disp->dispid_to_name, next)) - next++; - - if (zend_hash_index_exists(disp->dispid_to_name, next)) { - *pid = next; - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_getnamespaceparent( - IDispatchEx *This, - /* [out] */ IUnknown **ppunk) -{ - FETCH_DISP("GetNameSpaceParent"); - - *ppunk = NULL; - return E_NOTIMPL; -} - -static struct IDispatchExVtbl php_dispatch_vtbl = { - disp_queryinterface, - disp_addref, - disp_release, - disp_gettypeinfocount, - disp_gettypeinfo, - disp_getidsofnames, - disp_invoke, - disp_getdispid, - disp_invokeex, - disp_deletememberbyname, - disp_deletememberbydispid, - disp_getmemberproperties, - disp_getmembername, - disp_getnextdispid, - disp_getnamespaceparent -}; - - -/* enumerate functions and properties of the object and assign - * dispatch ids */ -static void generate_dispids(php_dispatchex *disp TSRMLS_DC) -{ - HashPosition pos; - char *name = NULL; - zval *tmp; - int namelen; - int keytype; - ulong pid; - - if (disp->dispid_to_name == NULL) { - ALLOC_HASHTABLE(disp->dispid_to_name); - ALLOC_HASHTABLE(disp->name_to_dispid); - zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(disp->dispid_to_name, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - /* properties */ - if (Z_OBJPROP_P(disp->object)) { - zend_hash_internal_pointer_reset_ex(Z_OBJPROP_P(disp->object), &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(Z_OBJPROP_P(disp->object), &name, - &namelen, &pid, 0, &pos))) { - char namebuf[32]; - if (keytype == HASH_KEY_IS_LONG) { - sprintf(namebuf, "%d", pid); - name = namebuf; - namelen = strlen(namebuf)+1; - } - - zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos); - - /* Find the existing id */ - if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS) - continue; - - /* add the mappings */ - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, name, namelen-1, 1); - zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL); - } - } - - /* functions */ - if (Z_OBJCE_P(disp->object)) { - zend_hash_internal_pointer_reset_ex(&Z_OBJCE_P(disp->object)->function_table, &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(&Z_OBJCE_P(disp->object)->function_table, - &name, &namelen, &pid, 0, &pos))) { - - char namebuf[32]; - if (keytype == HASH_KEY_IS_LONG) { - sprintf(namebuf, "%d", pid); - name = namebuf; - namelen = strlen(namebuf) + 1; - } - - zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos); - - /* Find the existing id */ - if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS) - continue; - - /* add the mappings */ - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, name, namelen-1, 1); - zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL); - } - } -} - -static php_dispatchex *disp_constructor(zval *object TSRMLS_DC) -{ - php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex)); - - trace("constructing a COM proxy\n"); - - if (disp == NULL) - return NULL; - - memset(disp, 0, sizeof(php_dispatchex)); - - disp->engine_thread = GetCurrentThreadId(); - disp->lpVtbl = &php_dispatch_vtbl; - disp->refcount = 1; - - - if (object) - ZVAL_ADDREF(object); - disp->object = object; - - disp->id = zend_list_insert(disp, le_dispatch); - - return disp; -} - -static void disp_destructor(php_dispatchex *disp) -{ - TSRMLS_FETCH(); - - trace("destroying COM wrapper for PHP object %s\n", Z_OBJCE_P(disp->object)->name); - - disp->id = 0; - - if (disp->refcount > 0) - CoDisconnectObject((IUnknown*)disp, 0); - - zend_hash_destroy(disp->dispid_to_name); - zend_hash_destroy(disp->name_to_dispid); - FREE_HASHTABLE(disp->dispid_to_name); - FREE_HASHTABLE(disp->name_to_dispid); - - if (disp->object) - zval_ptr_dtor(&disp->object); - - CoTaskMemFree(disp); -} - -PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, - HashTable *id_to_name TSRMLS_DC) -{ - php_dispatchex *disp = disp_constructor(val TSRMLS_CC); - HashPosition pos; - char *name = NULL; - zval *tmp, **ntmp; - int namelen; - int keytype; - ulong pid; - - disp->dispid_to_name = id_to_name; - - memcpy(&disp->sinkid, sinkid, sizeof(disp->sinkid)); - - /* build up the reverse mapping */ - ALLOC_HASHTABLE(disp->name_to_dispid); - zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); - - zend_hash_internal_pointer_reset_ex(id_to_name, &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) { - - if (keytype == HASH_KEY_IS_LONG) { - - zend_hash_get_current_data_ex(id_to_name, (void**)&ntmp, &pos); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, Z_STRVAL_PP(ntmp), - Z_STRLEN_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL); - } - - zend_hash_move_forward_ex(id_to_name, &pos); - } - - return (IDispatch*)disp; -} - -PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC) -{ - php_dispatchex *disp = NULL; - - if (Z_TYPE_P(val) != IS_OBJECT) { - return NULL; - } - - if (php_com_is_valid_object(val TSRMLS_CC)) { - /* pass back its IDispatch directly */ - php_com_dotnet_object *obj = CDNO_FETCH(val); - - if (obj == NULL) - return NULL; - - if (V_VT(&obj->v) == VT_DISPATCH && V_DISPATCH(&obj->v)) { - IDispatch_AddRef(V_DISPATCH(&obj->v)); - return V_DISPATCH(&obj->v); - } - - return NULL; - } - - disp = disp_constructor(val TSRMLS_CC); - generate_dispids(disp TSRMLS_CC); - - return (IDispatch*)disp; -} - - diff --git a/ext/com_dotnet/config.w32 b/ext/com_dotnet/config.w32 deleted file mode 100644 index 1526392c24bef..0000000000000 --- a/ext/com_dotnet/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("com-dotnet", "COM and .Net support", "yes"); - -if (PHP_COM_DOTNET == "yes") { - CHECK_LIB('oleaut32.lib', 'com_dotnet'); - EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \ - com_handlers.c com_iterator.c com_misc.c com_olechar.c \ - com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c"); - AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support'); - CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET'); -} diff --git a/ext/com_dotnet/package.xml b/ext/com_dotnet/package.xml deleted file mode 100644 index f9976245a80df..0000000000000 --- a/ext/com_dotnet/package.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - com_dotnet - Com and .NET support functions for Windows - - - wez - Wez Furlong - wez@php.net - lead - - - -... - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h deleted file mode 100644 index f0936abb66dfc..0000000000000 --- a/ext/com_dotnet/php_com_dotnet.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_COM_DOTNET_H -#define PHP_COM_DOTNET_H - -extern zend_module_entry com_dotnet_module_entry; -#define phpext_com_dotnet_ptr &com_dotnet_module_entry - -#ifdef PHP_WIN32 -# define PHP_COM_DOTNET_API __declspec(dllexport) -#else -# define PHP_COM_DOTNET_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(com_dotnet); -PHP_MSHUTDOWN_FUNCTION(com_dotnet); -PHP_RINIT_FUNCTION(com_dotnet); -PHP_RSHUTDOWN_FUNCTION(com_dotnet); -PHP_MINFO_FUNCTION(com_dotnet); - -ZEND_BEGIN_MODULE_GLOBALS(com_dotnet) - zend_bool allow_dcom; - zend_bool autoreg_verbose; - zend_bool autoreg_on; - zend_bool autoreg_case_sensitive; - void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */ - int code_page; /* default code_page if left unspecified */ -ZEND_END_MODULE_GLOBALS(com_dotnet) - -#ifdef ZTS -# define COMG(v) TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v) -#else -# define COMG(v) (com_dotnet_globals.v) -#endif - -extern ZEND_DECLARE_MODULE_GLOBALS(com_dotnet); - -#endif /* PHP_COM_DOTNET_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h deleted file mode 100644 index 35b0410f4e038..0000000000000 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_COM_DOTNET_INTERNAL_H -#define PHP_COM_DOTNET_INTERNAL_H - -#define _WIN32_DCOM -#define COBJMACROS -#include -#include -#include -#include -#include "win32/winutil.h" - -/* brain-death in winutil.h defines the macro to hide the useful function... */ -#undef php_win_err - -typedef struct _php_com_dotnet_object { - VARIANT v; - - ITypeInfo *typeinfo; - long code_page; - - zend_class_entry *ce; - - /* associated event sink */ - IDispatch *sink_dispatch; - GUID sink_id; - DWORD sink_cookie; - - /* cache for method signatures */ - HashTable *method_cache; - /* cache for name -> DISPID */ - HashTable *id_of_name_cache; -} php_com_dotnet_object; - -static inline int php_com_is_valid_object(zval *zv TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(zv); - return strcmp("com", ce->name) == 0 || - strcmp("dotnet", ce->name) == 0 || - strcmp("variant", ce->name) == 0; -} - -#define CDNO_FETCH(zv) (php_com_dotnet_object*)zend_object_store_get_object(zv TSRMLS_CC) -#define CDNO_FETCH_VERIFY(obj, zv) do { \ - if (!php_com_is_valid_object(zv TSRMLS_CC)) { \ - php_com_throw_exception(E_UNEXPECTED, "expected a variant object" TSRMLS_CC); \ - return; \ - } \ - obj = (php_com_dotnet_object*)zend_object_store_get_object(zv TSRMLS_CC); \ -} while(0) - -/* com_extension.c */ -TsHashTable php_com_typelibraries; -zend_class_entry *php_com_variant_class_entry, *php_com_exception_class_entry, *php_com_saproxy_class_entry; - -/* com_handlers.c */ -zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC); -void php_com_object_clone(void *object, void **clone_ptr TSRMLS_DC); -void php_com_object_free_storage(void *object TSRMLS_DC); -zend_object_handlers php_com_object_handlers; -void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC); - -/* com_saproxy.c */ -zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC); -int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC); - -/* com_olechar.c */ -PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, - uint *string_len, int codepage TSRMLS_DC); -PHPAPI OLECHAR *php_com_string_to_olestring(char *string, - uint string_len, int codepage TSRMLS_DC); - - -/* com_com.c */ -PHP_FUNCTION(com_create_instance); -PHP_FUNCTION(com_event_sink); -PHP_FUNCTION(com_create_guid); -PHP_FUNCTION(com_print_typeinfo); -PHP_FUNCTION(com_message_pump); -PHP_FUNCTION(com_load_typelib); -PHP_FUNCTION(com_get_active_object); - -HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, - WORD flags, DISPPARAMS *disp_params, VARIANT *v TSRMLS_DC); -HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, - int namelen, DISPID *dispid TSRMLS_DC); -int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, - WORD flags, VARIANT *v, int nargs, zval **args TSRMLS_DC); -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval **args TSRMLS_DC); -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC); - -/* com_wrapper.c */ -int php_com_wrapper_minit(INIT_FUNC_ARGS); -PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC); -PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC); - -/* com_persist.c */ -int php_com_persist_minit(INIT_FUNC_ARGS); - -/* com_variant.c */ -PHP_FUNCTION(com_variant_create_instance); -PHP_FUNCTION(variant_set); -PHP_FUNCTION(variant_add); -PHP_FUNCTION(variant_cat); -PHP_FUNCTION(variant_sub); -PHP_FUNCTION(variant_mul); -PHP_FUNCTION(variant_and); -PHP_FUNCTION(variant_div); -PHP_FUNCTION(variant_eqv); -PHP_FUNCTION(variant_idiv); -PHP_FUNCTION(variant_imp); -PHP_FUNCTION(variant_mod); -PHP_FUNCTION(variant_or); -PHP_FUNCTION(variant_pow); -PHP_FUNCTION(variant_xor); -PHP_FUNCTION(variant_abs); -PHP_FUNCTION(variant_fix); -PHP_FUNCTION(variant_int); -PHP_FUNCTION(variant_neg); -PHP_FUNCTION(variant_not); -PHP_FUNCTION(variant_round); -PHP_FUNCTION(variant_cmp); -PHP_FUNCTION(variant_date_to_timestamp); -PHP_FUNCTION(variant_date_from_timestamp); -PHP_FUNCTION(variant_get_type); -PHP_FUNCTION(variant_set_type); -PHP_FUNCTION(variant_cast); - -PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC); -PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC); -PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC); - -/* com_dotnet.c */ -PHP_FUNCTION(com_dotnet_create_instance); -void php_com_dotnet_rshutdown(TSRMLS_D); -void php_com_dotnet_mshutdown(TSRMLS_D); - -/* com_misc.c */ -void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC); -PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp, - int codepage TSRMLS_DC); -PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v, - int codepage TSRMLS_DC); -PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC); - -/* com_typeinfo.c */ -PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string, - int codepage, int *cached TSRMLS_DC); -PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC); -PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, - int codepage TSRMLS_DC); -void php_com_typelibrary_dtor(void *pDest); -ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC); -int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC); - -/* com_iterator.c */ -zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC); - - -#endif diff --git a/ext/com_dotnet/tests/27974.phpt b/ext/com_dotnet/tests/27974.phpt deleted file mode 100755 index 30c42b6cf6d4b..0000000000000 --- a/ext/com_dotnet/tests/27974.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -COM: mapping a safearray ---SKIPIF-- - ---FILE-- -getCode() != DISP_E_BADINDEX) { - throw $e; - } - echo "Got BADINDEX exception OK!\n"; - } - echo "OK!"; -} catch (Exception $e) { - print $e; -} -?> ---EXPECT-- -object(variant)#1 (0) { -} -123 -456 -789 -string(3) "123" -string(5) "hello" -string(3) "789" -Got BADINDEX exception OK! -OK! diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt deleted file mode 100644 index 0fd27bee5ef63..0000000000000 --- a/ext/com_dotnet/tests/variants.phpt +++ /dev/null @@ -1,637 +0,0 @@ ---TEST-- -COM: General variant tests ---SKIPIF-- - ---FILE-- - 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false); -$binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div', - 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); - -foreach ($values as $t => $val) { - $v = new VARIANT($val); - if ($t != variant_get_type($v)) { - printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); - print $v . "\n"; - } - $results = array(); - - foreach ($values as $op2) { - echo "--\n"; - foreach ($binary_ops as $op) { - try { - echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; - } catch (com_exception $e) { - echo "$op:\n"; - echo "\tvariant_$op($v, $op2)\n"; - echo "\texception " . $e->getMessage(); - printf("\tcode %08x\n\n", $e->getCode()); - } - } - } -} - -echo "OK!"; -?> ---EXPECT-- --- -add: 84 -cat: 4242 -sub: 0 -mul: 1764 -and: 42 -div: 1 -eqv: -1 -idiv: 1 -imp: -1 -mod: 0 -or: 42 -pow: 1.50130937545297E+68 -xor: 0 --- -add: 45.5 -cat: 423.5 -sub: 38.5 -mul: 147 -and: 0 -div: 12 -eqv: -47 -idiv: 10 -imp: -43 -mod: 2 -or: 46 -pow: 480145.116863642 -xor: 46 --- -add: - variant_add(42, hello) - exception Type mismatch. - code 80020005 - -cat: 42hello -sub: - variant_sub(42, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(42, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(42, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(42, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(42, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(42, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(42, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(42, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(42, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(42, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(42, hello) - exception Type mismatch. - code 80020005 - --- -add: 42 -cat: 42False -sub: 42 -mul: 0 -and: 0 -div: - variant_div(42, ) - exception Division by zero. - code 80020012 - -eqv: -43 -idiv: - variant_idiv(42, ) - exception Division by zero. - code 80020012 - -imp: -43 -mod: - variant_mod(42, ) - exception Division by zero. - code 80020012 - -or: 42 -pow: 1 -xor: 42 --- -add: 45.5 -cat: 3.542 -sub: -38.5 -mul: 147 -and: 0 -div: 8.33333333333333E-02 -eqv: -47 -idiv: 0 -imp: -5 -mod: 4 -or: 46 -pow: 7.09345573078604E+22 -xor: 46 --- -add: 7 -cat: 3.53.5 -sub: 0 -mul: 12.25 -and: 4 -div: 1 -eqv: -1 -idiv: 1 -imp: -1 -mod: 0 -or: 4 -pow: 80.2117802289664 -xor: 0 --- -add: - variant_add(3.5, hello) - exception Type mismatch. - code 80020005 - -cat: 3.5hello -sub: - variant_sub(3.5, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(3.5, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(3.5, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(3.5, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(3.5, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(3.5, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(3.5, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(3.5, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(3.5, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(3.5, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(3.5, hello) - exception Type mismatch. - code 80020005 - --- -add: 3.5 -cat: 3.5False -sub: 3.5 -mul: 0 -and: 0 -div: - variant_div(3.5, ) - exception Division by zero. - code 80020012 - -eqv: -5 -idiv: - variant_idiv(3.5, ) - exception Division by zero. - code 80020012 - -imp: -5 -mod: - variant_mod(3.5, ) - exception Division by zero. - code 80020012 - -or: 4 -pow: 1 -xor: 4 --- -add: - variant_add(hello, 42) - exception Type mismatch. - code 80020005 - -cat: hello42 -sub: - variant_sub(hello, 42) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, 42) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, 42) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, 42) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, 42) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, 42) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, 42) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, 42) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, 42) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, 42) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, 42) - exception Type mismatch. - code 80020005 - --- -add: - variant_add(hello, 3.5) - exception Type mismatch. - code 80020005 - -cat: hello3.5 -sub: - variant_sub(hello, 3.5) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, 3.5) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, 3.5) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, 3.5) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, 3.5) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, 3.5) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, 3.5) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, 3.5) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, 3.5) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, 3.5) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, 3.5) - exception Type mismatch. - code 80020005 - --- -add: hellohello -cat: hellohello -sub: - variant_sub(hello, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, hello) - exception Type mismatch. - code 80020005 - --- -add: - variant_add(hello, ) - exception Type mismatch. - code 80020005 - -cat: helloFalse -sub: - variant_sub(hello, ) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, ) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, ) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, ) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, ) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, ) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, ) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, ) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, ) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, ) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, ) - exception Type mismatch. - code 80020005 - --- -add: 42 -cat: False42 -sub: -42 -mul: 0 -and: 0 -div: 0 -eqv: -43 -idiv: 0 -imp: -1 -mod: 0 -or: 42 -pow: 0 -xor: 42 --- -add: 3.5 -cat: False3.5 -sub: -3.5 -mul: 0 -and: 0 -div: 0 -eqv: -5 -idiv: 0 -imp: -1 -mod: 0 -or: 4 -pow: 0 -xor: 4 --- -add: - variant_add(0, hello) - exception Type mismatch. - code 80020005 - -cat: Falsehello -sub: - variant_sub(0, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(0, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(0, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(0, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(0, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(0, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(0, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(0, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(0, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(0, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(0, hello) - exception Type mismatch. - code 80020005 - --- -add: 0 -cat: FalseFalse -sub: 0 -mul: 0 -and: 0 -div: - variant_div(0, ) - exception Out of present range. - code 8002000a - -eqv: -1 -idiv: - variant_idiv(0, ) - exception Division by zero. - code 80020012 - -imp: -1 -mod: - variant_mod(0, ) - exception Division by zero. - code 80020012 - -or: 0 -pow: 1 -xor: 0 -OK! diff --git a/ext/ctype/CREDITS b/ext/ctype/CREDITS deleted file mode 100644 index 22de90270994a..0000000000000 --- a/ext/ctype/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ctype -Hartmut Holzgraefe diff --git a/ext/ctype/README b/ext/ctype/README deleted file mode 100644 index 1e78a3d933927..0000000000000 --- a/ext/ctype/README +++ /dev/null @@ -1,5 +0,0 @@ -this is an experimental extension that provides the -ctype family of function available in C -i'm not sure about whether they should go into ext/standard -or stay as an extension of their own and about using -a ctype_ prefix or sticking with the C names ... diff --git a/ext/ctype/config.m4 b/ext/ctype/config.m4 deleted file mode 100644 index 7d575a3adcd9d..0000000000000 --- a/ext/ctype/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ctype, whether to enable ctype functions, -[ --disable-ctype Disable ctype functions], yes) - -if test "$PHP_CTYPE" != "no"; then - AC_DEFINE(HAVE_CTYPE, 1, [ ]) - PHP_NEW_EXTENSION(ctype, ctype.c, $ext_shared) -fi diff --git a/ext/ctype/config.w32 b/ext/ctype/config.w32 deleted file mode 100644 index 1ade89cdff2d7..0000000000000 --- a/ext/ctype/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("ctype", "ctype", "yes"); - -if (PHP_CTYPE == "yes") { - EXTENSION("ctype", "ctype.c"); - AC_DEFINE('HAVE_CTYPE', 1, 'Have ctype'); -} diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c deleted file mode 100644 index 9a5eb32330177..0000000000000 --- a/ext/ctype/ctype.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ctype.h" -#include "SAPI.h" -#include "ext/standard/info.h" - -#include - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_CTYPE - -/* If you declare any globals in php_ctype.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(ctype) -*/ - -/* True global resources - no need for thread safety here */ -/* static int le_ctype; */ - -/* {{{ ctype_functions[] - * Every user visible function must have an entry in ctype_functions[]. - */ -function_entry ctype_functions[] = { - PHP_FE(ctype_alnum, NULL) - PHP_FE(ctype_alpha, NULL) - PHP_FE(ctype_cntrl, NULL) - PHP_FE(ctype_digit, NULL) - PHP_FE(ctype_lower, NULL) - PHP_FE(ctype_graph, NULL) - PHP_FE(ctype_print, NULL) - PHP_FE(ctype_punct, NULL) - PHP_FE(ctype_space, NULL) - PHP_FE(ctype_upper, NULL) - PHP_FE(ctype_xdigit, NULL) - {NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */ -}; -/* }}} */ - -/* {{{ ctype_module_entry - */ -zend_module_entry ctype_module_entry = { - STANDARD_MODULE_HEADER, - "ctype", - ctype_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(ctype), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CTYPE -ZEND_GET_MODULE(ctype) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(ctype) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ctype functions", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ ctype - */ -#define CTYPE(iswhat) \ - zval *c; \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \ - return; \ - switch (Z_TYPE_P(c)) { \ - case IS_LONG: \ - if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ - } else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \ - } \ - SEPARATE_ZVAL(&c); \ - convert_to_string(c); \ - case IS_STRING: \ - case IS_BINARY: \ -string:\ - { \ - char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + Z_STRLEN_P(c); \ - if (e == p) { \ - RETURN_FALSE; \ - } \ - while (p < e) { \ - if(!iswhat((int)*(unsigned char *)(p++))) RETURN_FALSE; \ - } \ - RETURN_TRUE; \ - } \ - case IS_UNICODE: \ - convert_to_string(c); \ - goto string; \ - default: \ - break; \ - } \ - RETURN_FALSE; - -/* }}} */ - -/* {{{ proto bool ctype_alnum(mixed c) - Checks for alphanumeric character(s) */ -PHP_FUNCTION(ctype_alnum) -{ - CTYPE(isalnum); -} -/* }}} */ - -/* {{{ proto bool ctype_alpha(mixed c) - Checks for alphabetic character(s) */ -PHP_FUNCTION(ctype_alpha) -{ - CTYPE(isalpha); -} -/* }}} */ - -/* {{{ proto bool ctype_cntrl(mixed c) - Checks for control character(s) */ -PHP_FUNCTION(ctype_cntrl) -{ - CTYPE(iscntrl); -} -/* }}} */ - -/* {{{ proto bool ctype_digit(mixed c) - Checks for numeric character(s) */ -PHP_FUNCTION(ctype_digit) -{ - CTYPE(isdigit); -} -/* }}} */ - -/* {{{ proto bool ctype_lower(mixed c) - Checks for lowercase character(s) */ -PHP_FUNCTION(ctype_lower) -{ - CTYPE(islower); -} -/* }}} */ - -/* {{{ proto bool ctype_graph(mixed c) - Checks for any printable character(s) except space */ -PHP_FUNCTION(ctype_graph) -{ - CTYPE(isgraph); -} -/* }}} */ - -/* {{{ proto bool ctype_print(mixed c) - Checks for printable character(s) */ -PHP_FUNCTION(ctype_print) -{ - CTYPE(isprint); -} -/* }}} */ - -/* {{{ proto bool ctype_punct(mixed c) - Checks for any printable character which is not whitespace or an alphanumeric character */ -PHP_FUNCTION(ctype_punct) -{ - CTYPE(ispunct); -} -/* }}} */ - -/* {{{ proto bool ctype_space(mixed c) - Checks for whitespace character(s)*/ -PHP_FUNCTION(ctype_space) -{ - CTYPE(isspace); -} -/* }}} */ - -/* {{{ proto bool ctype_upper(mixed c) - Checks for uppercase character(s) */ -PHP_FUNCTION(ctype_upper) -{ - CTYPE(isupper); -} -/* }}} */ - -/* {{{ proto bool ctype_xdigit(mixed c) - Checks for character(s) representing a hexadecimal digit */ -PHP_FUNCTION(ctype_xdigit) -{ - CTYPE(isxdigit); -} -/* }}} */ - -#endif /* HAVE_CTYPE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ctype/ctype.dsp b/ext/ctype/ctype.dsp deleted file mode 100644 index 1305c72f6a8f2..0000000000000 --- a/ext/ctype/ctype.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ctype" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ctype - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak" CFG="ctype - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ctype - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ctype - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ctype - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D HAVE_CTYPE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ctype.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ctype - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CTYPE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ctype.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "ctype - Win32 Release_TS" -# Name "ctype - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ctype.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_ctype.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/ctype/ctype.xml b/ext/ctype/ctype.xml deleted file mode 100644 index 5837b9b5d0008..0000000000000 --- a/ext/ctype/ctype.xml +++ /dev/null @@ -1,245 +0,0 @@ - - Character type functions - ctype - - - - These functions check whether a character or string - falls into a certain character class according to the i - current locale. - - - When called with an integer argument theese functions - behave exactly like their C counterparts. - - - When called with a string argument they will check - every character in the string and will only return - true if every character in the string matches the - requested criteria. - - - Passing anything else but a string or integer will - return false immediately. - - - - - - - isalnum - Check for alphanumeric character(s) - - - Description - - - bool isalnum - string c - - - - See also setlocale. - - - - - - - isalpha - - - - Description - - - bool isalpha - string c - - - - - - - - - - iscntrl - - - - Description - - - bool iscntrl - string c - - - - - - - - - - isdigit - - - - Description - - - bool isdigit - string c - - - - - - - - - - islower - - - - Description - - - bool islower - string c - - - - - - - - - - isgraph - - - - Description - - - bool isgraph - string c - - - - - - - - - - isprint - - - - Description - - - bool isprint - string c - - - - - - - - - - ispunct - - - - Description - - - bool ispunct - string c - - - - - - - - - - isspace - - - - Description - - - bool isspace - string c - - - - - - - - - - isupper - - - - Description - - - bool isupper - string c - - - - - - - - - - isxdigit - - - - Description - - - bool isxdigit - string c - - - - - - - - - - - diff --git a/ext/ctype/package.xml b/ext/ctype/package.xml deleted file mode 100644 index 6cdd630c20026..0000000000000 --- a/ext/ctype/package.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - ctype - Character type detection - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - lead - - - -The functions provided by this extension check whether a -character or string falls into a certain character class -according to the current locale. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h deleted file mode 100644 index 0e12c9389e813..0000000000000 --- a/ext/ctype/php_ctype.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_CTYPE_H -#define PHP_CTYPE_H - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_CTYPE - -extern zend_module_entry ctype_module_entry; -#define phpext_ctype_ptr &ctype_module_entry - -#ifdef PHP_WIN32 -#define PHP_CTYPE_API __declspec(dllexport) -#else -#define PHP_CTYPE_API -#endif - -PHP_MINIT_FUNCTION(ctype); -PHP_MSHUTDOWN_FUNCTION(ctype); -PHP_RINIT_FUNCTION(ctype); -PHP_RSHUTDOWN_FUNCTION(ctype); -PHP_MINFO_FUNCTION(ctype); - -PHP_FUNCTION(ctype_alnum); -PHP_FUNCTION(ctype_alpha); -PHP_FUNCTION(ctype_cntrl); -PHP_FUNCTION(ctype_digit); -PHP_FUNCTION(ctype_lower); -PHP_FUNCTION(ctype_graph); -PHP_FUNCTION(ctype_print); -PHP_FUNCTION(ctype_punct); -PHP_FUNCTION(ctype_space); -PHP_FUNCTION(ctype_upper); -PHP_FUNCTION(ctype_xdigit); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(ctype) - int global_variable; -ZEND_END_MODULE_GLOBALS(ctype) -*/ - -#ifdef ZTS -#define CTYPEG(v) TSRMG(ctype_globals_id, php_ctype_globals *, v) -#else -#define CTYPEG(v) (ctype_globals.v) -#endif - -#else - -#define phpext_ctype_ptr NULL - -#endif - -#endif /* PHP_CTYPE_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/ctype/tests/001.phpt b/ext/ctype/tests/001.phpt deleted file mode 100644 index b7beea786134f..0000000000000 --- a/ext/ctype/tests/001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -ctype on integers ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ctype_lower 26 -ctype_upper 26 -ctype_alpha 52 -ctype_digit 10 -ctype_alnum 62 -ctype_cntrl 33 -ctype_graph 94 -ctype_print 95 -ctype_punct 32 -ctype_space 6 -ctype_xdigit 22 diff --git a/ext/ctype/tests/002.phpt b/ext/ctype/tests/002.phpt deleted file mode 100644 index 598ff9be963e0..0000000000000 --- a/ext/ctype/tests/002.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -ctype on strings ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -LOCALE is '%s' -ctype_lower 26 26 0 -ctype_upper 26 26 0 -ctype_alpha 52 52 0 -ctype_digit 10 10 0 -ctype_alnum 62 62 0 -ctype_cntrl 33 33 0 -ctype_graph 94 94 94 -ctype_print 95 95 95 -ctype_punct 32 32 0 -ctype_space 6 6 0 -ctype_xdigit 22 22 0 diff --git a/ext/ctype/tests/bug25745.phpt b/ext/ctype/tests/bug25745.phpt deleted file mode 100644 index 1d0ae0da7e3f8..0000000000000 --- a/ext/ctype/tests/bug25745.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #25745 (ctype functions fail with non-ascii characters) ---FILE-- - ---EXPECT-- -ok diff --git a/ext/curl/CREDITS b/ext/curl/CREDITS deleted file mode 100644 index 610e036787aa3..0000000000000 --- a/ext/curl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -cURL -Sterling Hughes diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 deleted file mode 100644 index 94baf6af226db..0000000000000 --- a/ext/curl/config.m4 +++ /dev/null @@ -1,110 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(curl, for CURL support, -[ --with-curl[=DIR] Include CURL support]) - -dnl Temporary option while we develop this aspect of the extension -PHP_ARG_WITH(curlwrappers, if we should use CURL for url streams, -[ --with-curlwrappers Use CURL for url streams], no, no) - -if test "$PHP_CURL" != "no"; then - if test -r $PHP_CURL/include/curl/easy.h; then - CURL_DIR=$PHP_CURL - else - AC_MSG_CHECKING(for CURL in default path) - for i in /usr/local /usr; do - if test -r $i/include/curl/easy.h; then - CURL_DIR=$i - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$CURL_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libcurl distribution - - easy.h should be in /include/curl/) - fi - - CURL_CONFIG="curl-config" - AC_MSG_CHECKING(for cURL 7.10.5 or greater) - - if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/bin/curl-config - else - if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/curl-config - fi - fi - - curl_version_full=`$CURL_CONFIG --version` - curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$curl_version" -ge 7010005; then - AC_MSG_RESULT($curl_version_full) - CURL_LIBS=`$CURL_CONFIG --libs` - else - AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support) - fi - - AC_MSG_CHECKING([for SSL support in libcurl]) - CURL_SSL=`$CURL_CONFIG --features | $EGREP SSL` - if test "$CURL_SSL" = "SSL"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support]) - - AC_MSG_CHECKING([for SSL library used]) - CURL_SSL_FLAVOUR= - for i in $CURL_LIBS; do - if test "$i" = "-lssl"; then - CURL_SSL_FLAVOUR="openssl" - AC_MSG_RESULT([openssl]) - AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support]) - AC_CHECK_HEADERS([openssl/crypto.h]) - break - elif test "$i" = "-lgnutls"; then - CURL_SSL_FLAVOUR="gnutls" - AC_MSG_RESULT([gnutls]) - AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support]) - AC_CHECK_HEADERS([gcrypt.h]) - break - fi - done - if test -z "$CURL_SSL_FLAVOUR"; then - AC_MSG_RESULT([unknown!]) - AC_MSG_WARN([Could not determine the type of SSL library used!]) - AC_MSG_WARN([Building will fail in ZTS mode!]) - fi - else - AC_MSG_RESULT([no]) - fi - - PHP_ADD_INCLUDE($CURL_DIR/include) - PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(curl,curl_easy_perform, - [ - AC_DEFINE(HAVE_CURL,1,[ ]) - ],[ - AC_MSG_ERROR(There is something wrong. Please check config.log for more information.) - ],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - PHP_CHECK_LIBRARY(curl,curl_version_info, - [ - AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ]) - ],[],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - if test "$PHP_CURLWRAPPERS" != "no" ; then - AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ]) - fi - - PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared) - PHP_SUBST(CURL_SHARED_LIBADD) -fi diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 deleted file mode 100644 index b4444190c8fe1..0000000000000 --- a/ext/curl/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("curl", "CURL support", "no"); - -if (PHP_CURL != "no") { - if (CHECK_LIB("libcurl.lib", "curl", PHP_CURL) && - CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") && - CHECK_LIB("ssleay32.lib", "curl", PHP_CURL) && - CHECK_LIB("libeay32.lib", "curl", PHP_CURL) && - CHECK_LIB("zlib.lib", "curl", PHP_CURL) && - CHECK_LIB("winmm.lib", "curl", PHP_CURL)) { - EXTENSION("curl", "interface.c multi.c streams.c"); - AC_DEFINE('HAVE_CURL', 1, 'Have CURL library'); - AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in CURL'); - // TODO: check for curl_version_info - // AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL wrappers [experimental]'); - } else { - WARNING("curl not enabled; libraries and headers not found"); - } -} diff --git a/ext/curl/curl.dsp b/ext/curl/curl.dsp deleted file mode 100644 index 81d823183d28a..0000000000000 --- a/ext/curl/curl.dsp +++ /dev/null @@ -1,186 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=curl - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "curl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "curl.mak" CFG="curl - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "curl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS_SSL" -# PROP Intermediate_Dir "Debug_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none /nodefaultlib - -!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_SSL" -# PROP Intermediate_Dir "Release_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "curl - Win32 Release_TS" -# Name "curl - Win32 Debug_TS" -# Name "curl - Win32 Debug_TS_SSL" -# Name "curl - Win32 Release_TS_SSL" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\interface.c -# End Source File - -# Begin Source File -SOURCE=.\multi.c -# End Source File - -# Begin Source File -SOURCE=.\streams.c -# End Source File - -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_curl.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/curl/interface.c b/ext/curl/interface.c deleted file mode 100644 index 4eb8a8a1aa73f..0000000000000 --- a/ext/curl/interface.c +++ /dev/null @@ -1,1794 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_CURL - -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#endif - -#include -#include - -/* As of curl 7.11.1 this is no longer defined inside curl.h */ -#ifndef HttpPost -#define HttpPost curl_httppost -#endif - -/* {{{ cruft for thread safe SSL crypto locks */ -#if defined(ZTS) && defined(HAVE_CURL_SSL) -# ifdef PHP_WIN32 -# define PHP_CURL_NEED_SSL_TSL -# define PHP_CURL_NEED_OPENSSL_TSL -# include -# else /* !PHP_WIN32 */ -# if defined(HAVE_CURL_OPENSSL) -# if defined(HAVE_OPENSSL_CRYPTO_H) -# define PHP_CURL_NEED_SSL_TSL -# define PHP_CURL_NEED_OPENSSL_TSL -# include -# else -# warning \ - "libcurl was compiled with OpenSSL support, but configure could not find " \ - "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif -# elif defined(HAVE_CURL_GNUTLS) -# if defined(HAVE_GCRYPT_H) -# define PHP_CURL_NEED_SSL_TSL -# define PHP_CURL_NEED_GNUTLS_TSL -# include -# else -# warning \ - "libcurl was compiled with GnuTLS support, but configure could not find " \ - "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif -# else -# warning \ - "libcurl was compiled with SSL support, but configure could not determine which" \ - "library was used; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS */ -# endif /* PHP_WIN32 */ -#endif /* ZTS && HAVE_CURL_SSL */ -/* }}} */ - -#define SMART_STR_PREALLOC 4096 - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/url.h" -#include "php_curl.h" - -int le_curl; -int le_curl_multi_handle; - -#ifdef PHP_CURL_NEED_SSL_TSL -static inline void php_curl_ssl_init(void); -static inline void php_curl_ssl_cleanup(void); -#endif - -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; - -#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (long) v); -#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), (double) v); -#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), (char *) v, 1); -#define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v); - -#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len) \ - if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \ - strncasecmp(str, "file://", sizeof("file://") - 1) == 0) \ - { \ - php_url *tmp_url; \ - \ - if (!(tmp_url = php_url_parse_ex(str, len))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid url '%s'", str); \ - RETURN_FALSE; \ - } \ - \ - if (tmp_url->query || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \ - (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \ - ) { \ - php_url_free(tmp_url); \ - RETURN_FALSE; \ - } \ - php_url_free(tmp_url); \ - } - -/* {{{ curl_functions[] - */ -function_entry curl_functions[] = { - PHP_FE(curl_init, NULL) - PHP_FE(curl_copy_handle, NULL) - PHP_FE(curl_version, NULL) - PHP_FE(curl_setopt, NULL) - PHP_FE(curl_setopt_array, NULL) - PHP_FE(curl_exec, NULL) - PHP_FE(curl_getinfo, NULL) - PHP_FE(curl_error, NULL) - PHP_FE(curl_errno, NULL) - PHP_FE(curl_close, NULL) - PHP_FE(curl_multi_init, NULL) - PHP_FE(curl_multi_add_handle, NULL) - PHP_FE(curl_multi_remove_handle, NULL) - PHP_FE(curl_multi_select, NULL) - PHP_FE(curl_multi_exec, second_arg_force_ref) - PHP_FE(curl_multi_getcontent, NULL) - PHP_FE(curl_multi_info_read, NULL) - PHP_FE(curl_multi_close, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ curl_module_entry - */ -zend_module_entry curl_module_entry = { - STANDARD_MODULE_HEADER, - "curl", - curl_functions, - PHP_MINIT(curl), - PHP_MSHUTDOWN(curl), - NULL, - NULL, - PHP_MINFO(curl), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CURL -ZEND_GET_MODULE (curl) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(curl) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "CURL support", "enabled"); - php_info_print_table_row(2, "CURL Information", curl_version()); - php_info_print_table_end(); -} -/* }}} */ - -#define REGISTER_CURL_CONSTANT(__c) REGISTER_LONG_CONSTANT(#__c, __c, CONST_CS | CONST_PERSISTENT) - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(curl) -{ - le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); - le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl", module_number); - - /* Constants for curl_setopt() */ - REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE); - REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_PORT); - REGISTER_CURL_CONSTANT(CURLOPT_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_READDATA); - REGISTER_CURL_CONSTANT(CURLOPT_INFILE); - REGISTER_CURL_CONSTANT(CURLOPT_INFILESIZE); - REGISTER_CURL_CONSTANT(CURLOPT_URL); - REGISTER_CURL_CONSTANT(CURLOPT_PROXY); - REGISTER_CURL_CONSTANT(CURLOPT_VERBOSE); - REGISTER_CURL_CONSTANT(CURLOPT_HEADER); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_NOPROGRESS); - REGISTER_CURL_CONSTANT(CURLOPT_NOBODY); - REGISTER_CURL_CONSTANT(CURLOPT_FAILONERROR); - REGISTER_CURL_CONSTANT(CURLOPT_UPLOAD); - REGISTER_CURL_CONSTANT(CURLOPT_POST); - REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY); - REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND); - REGISTER_CURL_CONSTANT(CURLOPT_NETRC); - REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION); - REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); - REGISTER_CURL_CONSTANT(CURLOPT_PUT); -#if CURLOPT_MUTE != 0 - REGISTER_CURL_CONSTANT(CURLOPT_MUTE); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_USERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_RANGE); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_POSTFIELDS); - REGISTER_CURL_CONSTANT(CURLOPT_REFERER); - REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT); - REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT); - REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPSV); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_LIMIT); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME); - REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIE); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIESESSION); - REGISTER_CURL_CONSTANT(CURLOPT_AUTOREFERER); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLVERSION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEVALUE); - REGISTER_CURL_CONSTANT(CURLOPT_CUSTOMREQUEST); - REGISTER_CURL_CONSTANT(CURLOPT_STDERR); - REGISTER_CURL_CONSTANT(CURLOPT_TRANSFERTEXT); - REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER); - REGISTER_CURL_CONSTANT(CURLOPT_QUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE); - REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL); - REGISTER_CURL_CONSTANT(CURLOPT_FILETIME); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_MAXREDIRS); - REGISTER_CURL_CONSTANT(CURLOPT_MAXCONNECTS); - REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY); - REGISTER_CURL_CONSTANT(CURLOPT_FRESH_CONNECT); - REGISTER_CURL_CONSTANT(CURLOPT_FORBID_REUSE); - REGISTER_CURL_CONSTANT(CURLOPT_RANDOM_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_EGDSOCKET); - REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYPEER); - REGISTER_CURL_CONSTANT(CURLOPT_CAINFO); - REGISTER_CURL_CONSTANT(CURLOPT_CAPATH); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEJAR); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_CIPHER_LIST); - REGISTER_CURL_CONSTANT(CURLOPT_BINARYTRANSFER); - REGISTER_CURL_CONSTANT(CURLOPT_NOSIGNAL); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_BUFFERSIZE); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPGET); - REGISTER_CURL_CONSTANT(CURLOPT_HTTP_VERSION); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEY); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEYTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEYPASSWD); - REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_CRLF); - REGISTER_CURL_CONSTANT(CURLOPT_ENCODING); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYPORT); - REGISTER_CURL_CONSTANT(CURLOPT_UNRESTRICTED_AUTH); - REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPRT); - REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD); - -#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ - REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); - /* http authentication options */ - REGISTER_CURL_CONSTANT(CURLAUTH_BASIC); - REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST); - REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); - REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); - REGISTER_CURL_CONSTANT(CURLAUTH_ANY); - REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE); -#endif - -#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */ - REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH); -#endif - - /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST); - - /* Info constants */ - REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL); - REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE); - REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_NAMELOOKUP_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_CONNECT_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_PRETRANSFER_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_FILETIME); - REGISTER_CURL_CONSTANT(CURLINFO_SSL_VERIFYRESULT); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_STARTTRANSFER_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_TYPE); - REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_COUNT); - REGISTER_CURL_CONSTANT(CURLINFO_HEADER_OUT); - - /* cURL protocol constants (curl_version) */ - REGISTER_CURL_CONSTANT(CURL_VERSION_IPV6); - REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4); - REGISTER_CURL_CONSTANT(CURL_VERSION_SSL); - REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ); - - /* version constants */ - REGISTER_CURL_CONSTANT(CURLVERSION_NOW); - - /* Error Constants */ - REGISTER_CURL_CONSTANT(CURLE_OK); - REGISTER_CURL_CONSTANT(CURLE_UNSUPPORTED_PROTOCOL); - REGISTER_CURL_CONSTANT(CURLE_FAILED_INIT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_PROXY); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_HOST); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_CONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_SERVER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_ACCESS_DENIED); - REGISTER_CURL_CONSTANT(CURLE_FTP_USER_PASSWORD_INCORRECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASS_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_USER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASV_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_227_FORMAT); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_GET_HOST); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_RECONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_BINARY); - REGISTER_CURL_CONSTANT(CURLE_PARTIAL_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_RETR_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_QUOTE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_STOR_FILE); - REGISTER_CURL_CONSTANT(CURLE_READ_ERROR); - REGISTER_CURL_CONSTANT(CURLE_OUT_OF_MEMORY); - REGISTER_CURL_CONSTANT(CURLE_OPERATION_TIMEOUTED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_ASCII); - REGISTER_CURL_CONSTANT(CURLE_FTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_USE_REST); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_GET_SIZE); - REGISTER_CURL_CONSTANT(CURLE_HTTP_RANGE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_POST_ERROR); - REGISTER_CURL_CONSTANT(CURLE_SSL_CONNECT_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_BAD_DOWNLOAD_RESUME); - REGISTER_CURL_CONSTANT(CURLE_FILE_COULDNT_READ_FILE); - REGISTER_CURL_CONSTANT(CURLE_LDAP_CANNOT_BIND); - REGISTER_CURL_CONSTANT(CURLE_LDAP_SEARCH_FAILED); - REGISTER_CURL_CONSTANT(CURLE_LIBRARY_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_FUNCTION_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLE_BAD_FUNCTION_ARGUMENT); - REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER); - REGISTER_CURL_CONSTANT(CURLE_HTTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_BAD_PASSWORD_ENTERED); - REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS); - REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION); - REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX); - REGISTER_CURL_CONSTANT(CURLE_OBSOLETE); - REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE); - REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING); - REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND); - REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED); - REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR); - REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR); - REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE); - REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM); - REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER); - REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT); - REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING); -#ifdef CURLE_LDAP_INVALID_URL - REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL); -#endif -#ifdef CURLE_FILESIZE_EXCEEDED - REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED); -#endif -#ifdef CURLE_FTP_SSL_FAILED - REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED); -#endif - - REGISTER_CURL_CONSTANT(CURLPROXY_HTTP); - REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5); - - REGISTER_CURL_CONSTANT(CURL_NETRC_OPTIONAL); - REGISTER_CURL_CONSTANT(CURL_NETRC_IGNORED); - REGISTER_CURL_CONSTANT(CURL_NETRC_REQUIRED); - - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE); - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0); - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1); - - REGISTER_CURL_CONSTANT(CURLM_CALL_MULTI_PERFORM); - REGISTER_CURL_CONSTANT(CURLM_OK); - REGISTER_CURL_CONSTANT(CURLM_BAD_HANDLE); - REGISTER_CURL_CONSTANT(CURLM_BAD_EASY_HANDLE); - REGISTER_CURL_CONSTANT(CURLM_OUT_OF_MEMORY); - REGISTER_CURL_CONSTANT(CURLM_INTERNAL_ERROR); - - REGISTER_CURL_CONSTANT(CURLMSG_DONE); - -#ifdef CURLOPT_FTPSSLAUTH - REGISTER_CURL_CONSTANT(CURLOPT_FTPSSLAUTH); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_SSL); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_TLS); -#endif - -#ifdef PHP_CURL_NEED_SSL_TSL - php_curl_ssl_init(); -#endif - if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) { - return FAILURE; - } - -#ifdef PHP_CURL_URL_WRAPPERS -# if HAVE_CURL_VERSION_INFO - { - curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); - char **p = (char **)info->protocols; - - while (*p != NULL) { - php_register_url_stream_wrapper(*p++, &php_curl_wrapper TSRMLS_CC); - } - } -# else - php_register_url_stream_wrapper("http", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("https", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ftp", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC); -# endif -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(curl) -{ -#ifdef PHP_CURL_URL_WRAPPERS - php_unregister_url_stream_wrapper("http" TSRMLS_CC); - php_unregister_url_stream_wrapper("https" TSRMLS_CC); - php_unregister_url_stream_wrapper("ftp" TSRMLS_CC); - php_unregister_url_stream_wrapper("ldap" TSRMLS_CC); -#endif - curl_global_cleanup(); -#ifdef PHP_CURL_NEED_SSL_TSL - php_curl_ssl_cleanup(); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ curl_write - */ -static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write; - size_t length = size * nmemb; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - -#if PHP_CURL_DEBUG - fprintf(stderr, "curl_write() called\n"); - fprintf(stderr, "data = %s, size = %d, nmemb = %d, ctx = %x\n", data, size, nmemb, ctx); -#endif - - switch (t->method) { - case PHP_CURL_STDOUT: - PHPWRITE(data, length); - break; - case PHP_CURL_FILE: - return fwrite(data, size, nmemb, t->fp); - case PHP_CURL_RETURN: - smart_str_appendl(&t->buf, data, (int) length); - break; - case PHP_CURL_USER: { - zval **argv[2]; - zval *retval_ptr = NULL; - zval *handle = NULL; - zval *zdata = NULL; - int error; - zend_fcall_info fci; - - MAKE_STD_ZVAL(handle); - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - argv[0] = &handle; - - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, data, length, 1); - argv[1] = &zdata; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.object_pp = NULL; - fci.function_name = t->func_name; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = argv; - fci.no_separation = 0; - fci.symbol_table = NULL; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION"); - length = -1; - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) != IS_LONG) { - convert_to_long_ex(&retval_ptr); - } - length = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } - - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_read - */ -static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_read *t = ch->handlers->read; - int length = -1; - - switch (t->method) { - case PHP_CURL_DIRECT: - if (t->fp) { - length = fread(data, size, nmemb, t->fp); - } - break; - case PHP_CURL_USER: { - zval **argv[3]; - zval *handle = NULL; - zval *zfd = NULL; - zval *zlength = NULL; - zval *retval_ptr; - int error; - zend_fcall_info fci; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - MAKE_STD_ZVAL(handle); - MAKE_STD_ZVAL(zfd); - MAKE_STD_ZVAL(zlength); - - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - ZVAL_RESOURCE(zfd, t->fd); - zend_list_addref(t->fd); - ZVAL_LONG(zlength, (int) size * nmemb); - - argv[0] = &handle; - argv[1] = &zfd; - argv[2] = &zlength; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = t->func_name; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 3; - fci.params = argv; - fci.no_separation = 0; - fci.symbol_table = NULL; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); - length = -1; - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) == IS_STRING) { - length = MIN(size * nmemb, Z_STRLEN_P(retval_ptr)); - memcpy(data, Z_STRVAL_P(retval_ptr), length); - } - zval_ptr_dtor(&retval_ptr); - } - - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - zval_ptr_dtor(argv[2]); - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_write_header - */ -static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write_header; - size_t length = size * nmemb; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - switch (t->method) { - case PHP_CURL_STDOUT: - /* Handle special case write when we're returning the entire transfer - */ - if (ch->handlers->write->method == PHP_CURL_RETURN) { - smart_str_appendl(&ch->handlers->write->buf, data, (int) length); - } else { - PHPWRITE(data, length); - } - break; - case PHP_CURL_FILE: - return fwrite(data, size, nmemb, t->fp); - case PHP_CURL_USER: { - zval **argv[2]; - zval *handle = NULL; - zval *zdata = NULL; - zval *retval_ptr; - int error; - zend_fcall_info fci; - - MAKE_STD_ZVAL(handle); - MAKE_STD_ZVAL(zdata); - - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - ZVAL_STRINGL(zdata, data, length, 1); - - argv[0] = &handle; - argv[1] = &zdata; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = t->func_name; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = argv; - fci.no_separation = 0; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION"); - length = -1; - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) != IS_LONG) { - convert_to_long_ex(&retval_ptr); - } - length = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - break; - } - - case PHP_CURL_IGNORE: - return length; - - default: - return -1; - } - - return length; -} -/* }}} */ - -static int curl_debug(CURL *cp, curl_infotype type, char *buf, size_t buf_len, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - - if (type == CURLINFO_HEADER_OUT) { - if (ch->header.str_len) { - efree(ch->header.str); - } - if (buf_len > 0) { - ch->header.str = estrndup(buf, buf_len); - ch->header.str_len = buf_len; - } - } - - return 0; -} - -#if CURLOPT_PASSWDFUNCTION != 0 -/* {{{ curl_passwd - */ -static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen) -{ - php_curl *ch = (php_curl *) ctx; - zval *func = ch->handlers->passwd; - zval *argv[3]; - zval *retval = NULL; - int error; - int ret = -1; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(argv[2]); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_STRING(argv[1], prompt, 1); - ZVAL_LONG(argv[2], buflen); - - error = call_user_function(EG(function_table), NULL, func, retval, 2, argv TSRMLS_CC); - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION"); - } else if (Z_TYPE_P(retval) == IS_STRING) { - if (Z_STRLEN_P(retval) > buflen) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Returned password is too long for libcurl to handle"); - } else { - strlcpy(buf, Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "User handler '%s' did not return a string.", Z_STRVAL_P(func)); - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&argv[2]); - zval_ptr_dtor(&retval); - - return ret; -} -/* }}} */ -#endif - -/* {{{ curl_free_string - */ -static void curl_free_string(void **string) -{ - efree(*string); -} -/* }}} */ - -/* {{{ curl_free_post - */ -static void curl_free_post(void **post) -{ - curl_formfree((struct HttpPost *) *post); -} -/* }}} */ - -/* {{{ curl_free_slist - */ -static void curl_free_slist(void **slist) -{ - curl_slist_free_all((struct curl_slist *) *slist); -} -/* }}} */ - -/* {{{ proto array curl_version([int version]) - Return cURL version information. */ -PHP_FUNCTION(curl_version) -{ - curl_version_info_data *d; - long uversion = CURLVERSION_NOW; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &uversion) == FAILURE) { - return; - } - - d = curl_version_info(uversion); - if (d == NULL) { - RETURN_FALSE; - } - - array_init(return_value); - - CAAL("version_number", d->version_num); - CAAL("age", d->age); - CAAL("features", d->features); - CAAL("ssl_version_number", d->ssl_version_num); - CAAS("version", d->version); - CAAS("host", d->host); - CAAS("ssl_version", d->ssl_version); - CAAS("libz_version", d->libz_version); - /* Add an array of protocols */ - { - char **p = (char **) d->protocols; - zval *protocol_list = NULL; - - MAKE_STD_ZVAL(protocol_list); - array_init(protocol_list); - - while (*p != NULL) { - add_next_index_string(protocol_list, *p++, 1); - } - CAAZ("protocols", protocol_list); - } -} -/* }}} */ - -/* {{{ alloc_curl_handle - */ -static void alloc_curl_handle(php_curl **ch) -{ - *ch = emalloc(sizeof(php_curl)); - (*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers)); - (*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read)); - - (*ch)->in_callback = 0; - (*ch)->header.str_len = 0; - - memset(&(*ch)->err, 0, sizeof((*ch)->err)); - - zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (void(*)(void *)) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist), (void(*)(void *)) curl_free_slist, 0); - zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), (void(*)(void *)) curl_free_post, 0); -} -/* }}} */ - -/* {{{ proto resource curl_init([string url]) - Initialize a CURL session */ -PHP_FUNCTION(curl_init) -{ - zval **url; - php_curl *ch; - CURL *cp; - int argc = ZEND_NUM_ARGS(); - - if (argc < 0 || argc > 1 || zend_get_parameters_ex(argc, &url) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 0) { - convert_to_string_ex(url); - PHP_CURL_CHECK_OPEN_BASEDIR(Z_STRVAL_PP(url), Z_STRLEN_PP(url)); - } - - cp = curl_easy_init(); - if (!cp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not initialize a new cURL handle"); - RETURN_FALSE; - } - - alloc_curl_handle(&ch); - TSRMLS_SET_CTX(ch->thread_ctx); - - ch->cp = cp; - - ch->handlers->write->method = PHP_CURL_STDOUT; - ch->handlers->write->type = PHP_CURL_ASCII; - ch->handlers->read->method = PHP_CURL_DIRECT; - ch->handlers->write_header->method = PHP_CURL_IGNORE; - - ch->uses = 0; - - curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); - curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str); - curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write); - curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_READFUNCTION, curl_read); - curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); - curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1); - curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); - curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ -#if defined(ZTS) - curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1); -#endif - - if (argc > 0) { - char *urlcopy; - - urlcopy = estrndup(Z_STRVAL_PP(url), Z_STRLEN_PP(url)); - curl_easy_setopt(ch->cp, CURLOPT_URL, urlcopy); - zend_llist_add_element(&ch->to_free.str, &urlcopy); - } - - ZEND_REGISTER_RESOURCE(return_value, ch, le_curl); - ch->id = Z_LVAL_P(return_value); -} -/* }}} */ - -/* {{{ proto resource curl_copy_handle(resource ch) - Copy a cURL handle along with all of it's preferences */ -PHP_FUNCTION(curl_copy_handle) -{ - zval **zid; - CURL *cp; - php_curl *ch; - php_curl *dupch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - cp = curl_easy_duphandle(ch->cp); - if (!cp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot duplicate cURL handle"); - RETURN_FALSE; - } - - alloc_curl_handle(&dupch); - TSRMLS_SET_CTX(ch->thread_ctx); - - dupch->cp = cp; - dupch->handlers->write->method = ch->handlers->write->method; - dupch->handlers->write->type = ch->handlers->write->type; - dupch->handlers->read->method = ch->handlers->read->method; - dupch->handlers->write_header->method = ch->handlers->write_header->method; - - ZEND_REGISTER_RESOURCE(return_value, dupch, le_curl); - dupch->id = Z_LVAL_P(return_value); -} -/* }}} */ - -static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *return_value TSRMLS_DC) -{ - CURLcode error=CURLE_OK; - - switch (option) { - case CURLOPT_INFILESIZE: - case CURLOPT_VERBOSE: - case CURLOPT_HEADER: - case CURLOPT_NOPROGRESS: - case CURLOPT_NOBODY: - case CURLOPT_FAILONERROR: - case CURLOPT_UPLOAD: - case CURLOPT_POST: - case CURLOPT_FTPLISTONLY: - case CURLOPT_FTPAPPEND: - case CURLOPT_NETRC: - case CURLOPT_FOLLOWLOCATION: - case CURLOPT_PUT: -#if CURLOPT_MUTE != 0 - case CURLOPT_MUTE: -#endif - case CURLOPT_TIMEOUT: - case CURLOPT_FTP_USE_EPSV: - case CURLOPT_LOW_SPEED_LIMIT: - case CURLOPT_SSLVERSION: - case CURLOPT_LOW_SPEED_TIME: - case CURLOPT_RESUME_FROM: - case CURLOPT_TIMEVALUE: - case CURLOPT_TIMECONDITION: - case CURLOPT_TRANSFERTEXT: - case CURLOPT_HTTPPROXYTUNNEL: - case CURLOPT_FILETIME: - case CURLOPT_MAXREDIRS: - case CURLOPT_MAXCONNECTS: - case CURLOPT_CLOSEPOLICY: - case CURLOPT_FRESH_CONNECT: - case CURLOPT_FORBID_REUSE: - case CURLOPT_CONNECTTIMEOUT: - case CURLOPT_SSL_VERIFYHOST: - case CURLOPT_SSL_VERIFYPEER: - case CURLOPT_DNS_USE_GLOBAL_CACHE: - case CURLOPT_NOSIGNAL: - case CURLOPT_PROXYTYPE: - case CURLOPT_BUFFERSIZE: - case CURLOPT_HTTPGET: - case CURLOPT_HTTP_VERSION: - case CURLOPT_CRLF: - case CURLOPT_DNS_CACHE_TIMEOUT: - case CURLOPT_PROXYPORT: - case CURLOPT_FTP_USE_EPRT: -#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ - case CURLOPT_HTTPAUTH: -#endif -#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */ - case CURLOPT_PROXYAUTH: -#endif - -#ifdef CURLOPT_FTPSSLAUTH - case CURLOPT_FTPSSLAUTH: -#endif - case CURLOPT_UNRESTRICTED_AUTH: - case CURLOPT_PORT: - case CURLOPT_AUTOREFERER: - case CURLOPT_COOKIESESSION: - convert_to_long_ex(zvalue); - error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); - break; - case CURLOPT_URL: - case CURLOPT_PROXY: - case CURLOPT_USERPWD: - case CURLOPT_PROXYUSERPWD: - case CURLOPT_RANGE: - case CURLOPT_CUSTOMREQUEST: - case CURLOPT_USERAGENT: - case CURLOPT_FTPPORT: - case CURLOPT_COOKIE: - case CURLOPT_REFERER: - case CURLOPT_INTERFACE: - case CURLOPT_KRB4LEVEL: - case CURLOPT_EGDSOCKET: - case CURLOPT_CAINFO: - case CURLOPT_CAPATH: - case CURLOPT_SSL_CIPHER_LIST: - case CURLOPT_SSLKEY: - case CURLOPT_SSLKEYTYPE: - case CURLOPT_SSLKEYPASSWD: - case CURLOPT_SSLENGINE: - case CURLOPT_SSLENGINE_DEFAULT: - case CURLOPT_SSLCERTTYPE: - case CURLOPT_ENCODING: { - char *copystr = NULL; - - convert_to_string_ex(zvalue); - - if (option == CURLOPT_URL) { - PHP_CURL_CHECK_OPEN_BASEDIR(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - } - - copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - error = curl_easy_setopt(ch->cp, option, copystr); - zend_llist_add_element(&ch->to_free.str, ©str); - - break; - } - case CURLOPT_FILE: - case CURLOPT_INFILE: - case CURLOPT_WRITEHEADER: - case CURLOPT_STDERR: { - FILE *fp = NULL; - int type; - void * what; - - what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream()); - ZEND_VERIFY_RESOURCE(what); - - if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) { - RETURN_FALSE; - } - - if (!fp) { - RETURN_FALSE; - } - - error = CURLE_OK; - switch (option) { - case CURLOPT_FILE: - ch->handlers->write->fp = fp; - ch->handlers->write->method = PHP_CURL_FILE; - break; - case CURLOPT_WRITEHEADER: - ch->handlers->write_header->fp = fp; - ch->handlers->write_header->method = PHP_CURL_FILE; - break; - case CURLOPT_INFILE: - zend_list_addref(Z_LVAL_PP(zvalue)); - ch->handlers->read->fp = fp; - ch->handlers->read->fd = Z_LVAL_PP(zvalue); - break; - default: - error = curl_easy_setopt(ch->cp, option, fp); - break; - } - - break; - } - case CURLOPT_RETURNTRANSFER: - convert_to_long_ex(zvalue); - - if (Z_LVAL_PP(zvalue)) { - ch->handlers->write->method = PHP_CURL_RETURN; - } else { - ch->handlers->write->method = PHP_CURL_STDOUT; - } - break; - case CURLOPT_BINARYTRANSFER: - convert_to_long_ex(zvalue); - - if (Z_LVAL_PP(zvalue)) { - ch->handlers->write->type = PHP_CURL_BINARY; - } - break; - case CURLOPT_WRITEFUNCTION: - if (ch->handlers->write->func_name) { - zval_ptr_dtor(&ch->handlers->write->func_name); - ch->handlers->write->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->write->func_name = *zvalue; - ch->handlers->write->method = PHP_CURL_USER; - break; - case CURLOPT_READFUNCTION: - if (ch->handlers->read->func_name) { - zval_ptr_dtor(&ch->handlers->read->func_name); - ch->handlers->write->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->read->func_name = *zvalue; - ch->handlers->read->method = PHP_CURL_USER; - break; - case CURLOPT_HEADERFUNCTION: - if (ch->handlers->write_header->func_name) { - zval_ptr_dtor(&ch->handlers->write_header->func_name); - ch->handlers->write->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->write_header->func_name = *zvalue; - ch->handlers->write_header->method = PHP_CURL_USER; - break; -#if CURLOPT_PASSWDFUNCTION != 0 - case CURLOPT_PASSWDFUNCTION: - if (ch->handlers->passwd) { - zval_ptr_dtor(&ch->handlers->passwd); - } - zval_add_ref(zvalue); - ch->handlers->passwd = *zvalue; - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd); - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch); - break; -#endif - case CURLOPT_POSTFIELDS: - if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) { - zval **current; - HashTable *postfields; - struct HttpPost *first = NULL; - struct HttpPost *last = NULL; - char *postval; - char *string_key = NULL; - ulong num_key; - uint string_key_len; - - postfields = HASH_OF(*zvalue); - if (! postfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS"); - RETURN_FALSE; - } - - for (zend_hash_internal_pointer_reset(postfields); - zend_hash_get_current_data(postfields, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(postfields) - ) { - - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0, NULL); - - postval = Z_STRVAL_PP(current); - - /* The arguments after _NAMELENGTH and _CONTENTSLENGTH - * must be explicitly cast to long in curl_formadd - * use since curl needs a long not an int. */ - if (*postval == '@') { - ++postval; - /* safe_mode / open_basedir check */ - if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(postval, "rb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - error = curl_formadd(&first, &last, - CURLFORM_COPYNAME, string_key, - CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, postval, - CURLFORM_END); - } else { - error = curl_formadd(&first, &last, - CURLFORM_COPYNAME, string_key, - CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_COPYCONTENTS, postval, - CURLFORM_CONTENTSLENGTH, (long)Z_STRLEN_PP(current), - CURLFORM_END); - } - } - - SAVE_CURL_ERROR(ch, error); - if (error != CURLE_OK) { - RETURN_FALSE; - } - - zend_llist_add_element(&ch->to_free.post, &first); - error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first); - - } else { - char *post = NULL; - - convert_to_string_ex(zvalue); - post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - zend_llist_add_element(&ch->to_free.str, &post); - - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post); - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue)); - } - break; - case CURLOPT_HTTPHEADER: - case CURLOPT_QUOTE: - case CURLOPT_HTTP200ALIASES: - case CURLOPT_POSTQUOTE: { - zval **current; - HashTable *ph; - struct curl_slist *slist = NULL; - - ph = HASH_OF(*zvalue); - if (!ph) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments"); - RETURN_FALSE; - } - - for (zend_hash_internal_pointer_reset(ph); - zend_hash_get_current_data(ph, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(ph) - ) { - char *indiv = NULL; - - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - indiv = estrndup(Z_STRVAL_PP(current), Z_STRLEN_PP(current) + 1); - slist = curl_slist_append(slist, indiv); - if (!slist) { - efree(indiv); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist"); - RETURN_FALSE; - } - zend_llist_add_element(&ch->to_free.str, &indiv); - } - zend_llist_add_element(&ch->to_free.slist, &slist); - - error = curl_easy_setopt(ch->cp, option, slist); - - break; - } - /* the following options deal with files, therefor safe_mode & open_basedir checks - * are required. - */ - case CURLOPT_COOKIEJAR: - case CURLOPT_SSLCERT: - case CURLOPT_RANDOM_FILE: - case CURLOPT_COOKIEFILE: { - char *copystr = NULL; - - convert_to_string_ex(zvalue); - - if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - - error = curl_easy_setopt(ch->cp, option, copystr); - zend_llist_add_element(&ch->to_free.str, ©str); - - break; - } - case CURLINFO_HEADER_OUT: - convert_to_long_ex(zvalue); - if (Z_LVAL_PP(zvalue) == 1) { - curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug); - curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *)ch); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 1); - } else { - curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, NULL); - curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, NULL); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); - } - break; - } - - SAVE_CURL_ERROR(ch, error); - if (error != CURLE_OK) { - return 1; - } else { - return 0; - } -} - -/* {{{ proto bool curl_setopt(resource ch, int option, mixed value) - Set an option for a CURL transfer */ -PHP_FUNCTION(curl_setopt) -{ - zval **zid, **zoption, **zvalue; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &zid, &zoption, &zvalue) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - convert_to_long_ex(zoption); - - if (!_php_curl_setopt(ch, Z_LVAL_PP(zoption), zvalue, return_value TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool curl_setopt_array(resource ch, array options) - Set an array of option for a CURL transfer */ -PHP_FUNCTION(curl_setopt_array) -{ - zval *zid, *arr, **entry; - php_curl *ch; - long option; - HashPosition pos; - char *string_key; - int str_key_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &zid, &arr) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&entry, &pos) == SUCCESS) { - if (zend_hash_get_current_key_ex(Z_ARRVAL_P(arr), &string_key, &str_key_len, &option, 0, &pos) == HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array keys must be CURLOPT constants or equivalent interger values."); - RETURN_FALSE; - } - if (_php_curl_setopt(ch, option, entry, return_value TSRMLS_CC)) { - RETURN_FALSE; - } - zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ _php_curl_cleanup_handle(ch) - Cleanup an execution phase */ -void _php_curl_cleanup_handle(php_curl *ch) -{ - if (ch->handlers->write->buf.len > 0) { - memset(&ch->handlers->write->buf, 0, sizeof(smart_str)); - } - if (ch->header.str_len) { - efree(ch->header.str); - ch->header.str_len = 0; - } - - memset(ch->err.str, 0, CURL_ERROR_SIZE + 1); - ch->err.no = 0; -} -/* }}} */ - -/* {{{ proto bool curl_exec(resource ch) - Perform a CURL session */ -PHP_FUNCTION(curl_exec) -{ - zval **zid; - php_curl *ch; - CURLcode error; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - _php_curl_cleanup_handle(ch); - - error = curl_easy_perform(ch->cp); - SAVE_CURL_ERROR(ch, error); - /* CURLE_PARTIAL_FILE is returned by HEAD requests */ - if (error != CURLE_OK && error != CURLE_PARTIAL_FILE) { - if (ch->handlers->write->buf.len > 0) { - smart_str_free(&ch->handlers->write->buf); - } - - RETURN_FALSE; - } - - ch->uses++; - - if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { - --ch->uses; - if (ch->handlers->write->type != PHP_CURL_BINARY) { - smart_str_0(&ch->handlers->write->buf); - } - RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0); - } - --ch->uses; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed curl_getinfo(resource ch, int opt) - Get information regarding a specific transfer */ -PHP_FUNCTION(curl_getinfo) -{ - zval **zid, - **zoption; - php_curl *ch; - int option, argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &zid, &zoption) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - if (argc < 2) { - char *s_code; - long l_code; - double d_code; - - array_init(return_value); - - if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code) == CURLE_OK) { - CAAS("url", s_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code) == CURLE_OK) { - if (s_code != NULL) { - CAAS("content_type", s_code); - } - } - if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code) == CURLE_OK) { - CAAL("http_code", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code) == CURLE_OK) { - CAAL("header_size", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code) == CURLE_OK) { - CAAL("request_size", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code) == CURLE_OK) { - CAAL("filetime", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code) == CURLE_OK) { - CAAL("ssl_verify_result", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code) == CURLE_OK) { - CAAL("redirect_count", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code) == CURLE_OK) { - CAAD("total_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code) == CURLE_OK) { - CAAD("namelookup_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code) == CURLE_OK) { - CAAD("connect_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code) == CURLE_OK) { - CAAD("pretransfer_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code) == CURLE_OK) { - CAAD("size_upload", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("size_download", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("speed_download", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code) == CURLE_OK) { - CAAD("speed_upload", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("download_content_length", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code) == CURLE_OK) { - CAAD("upload_content_length", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code) == CURLE_OK) { - CAAD("starttransfer_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code) == CURLE_OK) { - CAAD("redirect_time", d_code); - } - if (ch->header.str_len > 0) { - CAAS("request_header", ch->header.str); - } - } else { - option = Z_LVAL_PP(zoption); - switch (option) { - case CURLINFO_EFFECTIVE_URL: - case CURLINFO_CONTENT_TYPE: { - char *s_code = NULL; - - if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { - RETURN_STRING(s_code, 1); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_HTTP_CODE: - case CURLINFO_HEADER_SIZE: - case CURLINFO_REQUEST_SIZE: - case CURLINFO_FILETIME: - case CURLINFO_SSL_VERIFYRESULT: - case CURLINFO_REDIRECT_COUNT: { - long code = 0; - - if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { - RETURN_LONG(code); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_TOTAL_TIME: - case CURLINFO_NAMELOOKUP_TIME: - case CURLINFO_CONNECT_TIME: - case CURLINFO_PRETRANSFER_TIME: - case CURLINFO_SIZE_UPLOAD: - case CURLINFO_SIZE_DOWNLOAD: - case CURLINFO_SPEED_DOWNLOAD: - case CURLINFO_SPEED_UPLOAD: - case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - case CURLINFO_CONTENT_LENGTH_UPLOAD: - case CURLINFO_STARTTRANSFER_TIME: - case CURLINFO_REDIRECT_TIME: { - double code = 0.0; - - if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { - RETURN_DOUBLE(code); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_HEADER_OUT: - if (ch->header.str_len > 0) { - RETURN_STRINGL(ch->header.str, ch->header.str_len, 1); - } else { - RETURN_FALSE; - } - } - } -} -/* }}} */ - -/* {{{ proto string curl_error(resource ch) - Return a string contain the last error for the current session */ -PHP_FUNCTION(curl_error) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - ch->err.str[CURL_ERROR_SIZE] = 0; - RETURN_STRING(ch->err.str, 1); -} -/* }}} */ - -/* {{{ proto int curl_errno(resource ch) - Return an integer containing the last error number */ -PHP_FUNCTION(curl_errno) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - RETURN_LONG(ch->err.no); -} -/* }}} */ - -/* {{{ proto void curl_close(resource ch) - Close a CURL session */ -PHP_FUNCTION(curl_close) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - if (ch->in_callback) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close CURL handle from a callback"); - return; - } - - if (ch->uses) { - ch->uses--; - } else { - zend_list_delete(Z_LVAL_PP(zid)); - } -} -/* }}} */ - -/* {{{ _php_curl_close() - List destructor for curl handles */ -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_curl *ch = (php_curl *) rsrc->ptr; - -#if PHP_CURL_DEBUG - fprintf(stderr, "DTOR CALLED, ch = %x\n", ch); -#endif - - curl_easy_cleanup(ch->cp); - zend_llist_clean(&ch->to_free.str); - zend_llist_clean(&ch->to_free.slist); - zend_llist_clean(&ch->to_free.post); - - if (ch->handlers->write->func_name) { - zval_ptr_dtor(&ch->handlers->write->func_name); - } - if (ch->handlers->read->func_name) { - zval_ptr_dtor(&ch->handlers->read->func_name); - } - if (ch->handlers->write_header->func_name) { - zval_ptr_dtor(&ch->handlers->write_header->func_name); - } - if (ch->handlers->passwd) { - zval_ptr_dtor(&ch->handlers->passwd); - } - if (ch->header.str_len > 0) { - efree(ch->header.str); - } - - efree(ch->handlers->write); - efree(ch->handlers->write_header); - efree(ch->handlers->read); - efree(ch->handlers); - efree(ch); -} -/* }}} */ - -#ifdef PHP_CURL_NEED_OPENSSL_TSL -/* {{{ */ -static MUTEX_T *php_curl_openssl_tsl = NULL; - -static void php_curl_ssl_lock(int mode, int n, const char * file, int line) -{ - if (mode & CRYPTO_LOCK) { - tsrm_mutex_lock(php_curl_openssl_tsl[n]); - } else { - tsrm_mutex_unlock(php_curl_openssl_tsl[n]); - } -} - -static unsigned long php_curl_ssl_id(void) -{ - return (unsigned long) tsrm_thread_id(); -} - -static inline void php_curl_ssl_init(void) -{ - int i, c = CRYPTO_num_locks(); - - php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T)); - - for (i = 0; i < c; ++i) { - php_curl_openssl_tsl[i] = tsrm_mutex_alloc(); - } - - CRYPTO_set_id_callback(php_curl_ssl_id); - CRYPTO_set_locking_callback(php_curl_ssl_lock); -} - -static inline void php_curl_ssl_cleanup(void) -{ - if (php_curl_openssl_tsl) { - int i, c = CRYPTO_num_locks(); - - CRYPTO_set_id_callback(NULL); - CRYPTO_set_locking_callback(NULL); - - for (i = 0; i < c; ++i) { - tsrm_mutex_free(php_curl_openssl_tsl[i]); - } - - free(php_curl_openssl_tsl); - php_curl_openssl_tsl = NULL; - } -} -#endif /* PHP_CURL_NEED_OPENSSL_TSL */ -/* }}} */ - -#ifdef PHP_CURL_NEED_GNUTLS_TSL -/* {{{ */ -static int php_curl_ssl_mutex_create(void **m) -{ - if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) { - return SUCCESS; - } else { - return FAILURE; - } -} - -static int php_curl_ssl_mutex_destroy(void **m) -{ - tsrm_mutex_free(*((MUTEX_T *) m)); - return SUCCESS; -} - -static int php_curl_ssl_mutex_lock(void **m) -{ - return tsrm_mutex_lock(*((MUTEX_T *) m)); -} - -static int php_curl_ssl_mutex_unlock(void **m) -{ - return tsrm_mutex_unlock(*((MUTEX_T *) m)); -} - -static struct gcry_thread_cbs php_curl_gnutls_tsl = { - GCRY_THREAD_OPTIONS_USER, - NULL, - php_curl_ssl_mutex_create, - php_curl_ssl_mutex_destroy, - php_curl_ssl_mutex_lock, - php_curl_ssl_mutex_unlock -}; - -static inline void php_curl_ssl_init(void) -{ - gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl); -} - -static inline void php_curl_ssl_cleanup(void) -{ - return; -} -#endif /* PHP_CURL_NEED_GNUTLS_TSL */ -/* }}} */ - -#endif /* HAVE_CURL */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/curl/multi.c b/ext/curl/multi.c deleted file mode 100644 index dbc8087a0488c..0000000000000 --- a/ext/curl/multi.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_CURL - -#include "php_curl.h" - -#include -#include - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -/* {{{ proto resource curl_multi_init(void) - Returns a new cURL multi handle */ -PHP_FUNCTION(curl_multi_init) -{ - php_curlm *mh; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - mh = ecalloc(1, sizeof(php_curlm)); - mh->multi = curl_multi_init(); - - zend_llist_init(&mh->easyh, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0); - - ZEND_REGISTER_RESOURCE(return_value, mh, le_curl_multi_handle); -} -/* }}} */ - -/* {{{ proto int curl_multi_add_handle(resource multi, resource ch) - Add a normal cURL handle to a cURL multi handle */ -PHP_FUNCTION(curl_multi_add_handle) -{ - zval *z_mh; - zval *z_ch; - php_curlm *mh; - php_curl *ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - zval_add_ref(&z_ch); - - _php_curl_cleanup_handle(ch); - ch->uses++; - - zend_llist_add_element(&mh->easyh, &z_ch); - - RETURN_LONG((long) curl_multi_add_handle(mh->multi, ch->cp)); -} -/* }}} */ - -/* {{{ proto int curl_multi_remove_handle(resource mh, resource ch) - Remove a multi handle from a set of cURL handles */ -PHP_FUNCTION(curl_multi_remove_handle) -{ - zval *z_mh; - zval *z_ch; - php_curlm *mh; - php_curl *ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - --ch->uses; - - RETURN_LONG((long) curl_multi_remove_handle(mh->multi, ch->cp)); -} -/* }}} */ - -static void _make_timeval_struct(struct timeval *to, double timeout) -{ - unsigned long conv; - - conv = (unsigned long) (timeout * 1000000.0); - to->tv_sec = conv / 1000000; - to->tv_usec = conv % 1000000; -} - -/* {{{ proto int curl_multi_select(resource mh[, double timeout]) - Get all the sockets associated with the cURL extension, which can then be "selected" */ -PHP_FUNCTION(curl_multi_select) -{ - zval *z_mh; - php_curlm *mh; - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - int maxfd; - double timeout = 1.0; - struct timeval to; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|d", &z_mh, &timeout) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - _make_timeval_struct(&to, timeout); - - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&exceptfds); - - curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); - RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); -} -/* }}} */ - -/* {{{ proto int curl_multi_exec(resource mh, int &still_running) - Run the sub-connections of the current cURL handle */ -PHP_FUNCTION(curl_multi_exec) -{ - zval *z_mh; - zval *z_still_running; - php_curlm *mh; - int still_running; - int result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_mh, &z_still_running) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - convert_to_long_ex(&z_still_running); - still_running = Z_LVAL_P(z_still_running); - result = curl_multi_perform(mh->multi, &still_running); - ZVAL_LONG(z_still_running, still_running); - - RETURN_LONG(result); -} -/* }}} */ - -/* {{{ proto string curl_multi_getcontent(resource ch) - Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set */ -PHP_FUNCTION(curl_multi_getcontent) -{ - zval *z_ch; - php_curl *ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { - if (ch->handlers->write->type != PHP_CURL_BINARY) { - smart_str_0(&ch->handlers->write->buf); - } - - RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0); - } -} - -/* {{{ proto array curl_multi_info_read(resource mh) - Get information about the current transfers */ -PHP_FUNCTION(curl_multi_info_read) -{ - zval *z_mh; - php_curlm *mh; - CURLMsg *tmp_msg; - int queued_msgs; - - /* XXX: Not Implemented */ - return; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - tmp_msg = curl_multi_info_read(mh->multi, &queued_msgs); - if (tmp_msg == NULL) { - RETURN_FALSE; - } - - array_init(return_value); - add_assoc_long(return_value, "msg", tmp_msg->msg); - add_assoc_long(return_value, "result", tmp_msg->data.result); - /* add_assoc_resource(return_value, "handle", zend_list_id_by_pointer(tmp_msg->easy_handle, le_curl TSRMLS_CC)); */ - add_assoc_string(return_value, "whatever", (char *) tmp_msg->data.whatever, 1); -} -/* }}} */ - -/* {{{ proto void curl_multi_close(resource mh) - Close a set of cURL handles */ -PHP_FUNCTION(curl_multi_close) -{ - zval *z_mh; - php_curlm *mh; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - zend_list_delete(Z_LVAL_P(z_mh)); -} -/* }}} */ - -void _php_curl_multi_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_curlm *mh = (php_curlm *) rsrc->ptr; - if (mh) { - curl_multi_cleanup(mh->multi); - zend_llist_clean(&mh->easyh); - efree(mh); - rsrc->ptr = NULL; - } -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/curl/package.xml b/ext/curl/package.xml deleted file mode 100644 index 5e837a4074e42..0000000000000 --- a/ext/curl/package.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - curl - Clib PDF functions - - - sterling - Sterling Hughes - sterling@php.net - lead - - - -PHP supports libcurl, a library created by Daniel Stenberg, -that allows you to connect and communicate to many different -types of servers with many different types of protocols. -libcurl currently supports the http, https, ftp, gopher, -telnet, dict, file, and ldap protocols. libcurl also supports -HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this -can also be done with PHP's ftp extension), HTTP form based -upload, proxies, cookies, and user+password authentication. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h deleted file mode 100644 index 1b7e8e1e09bcd..0000000000000 --- a/ext/curl/php_curl.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _PHP_CURL_H -#define _PHP_CURL_H - -#include "php.h" -#include "ext/standard/php_smart_str.h" - -#ifdef COMPILE_DL_CURL -#undef HAVE_CURL -#define HAVE_CURL 1 -#endif - -#if HAVE_CURL - -#define PHP_CURL_DEBUG 0 - -#include -#include - -extern zend_module_entry curl_module_entry; -#define curl_module_ptr &curl_module_entry - -#define CURLOPT_RETURNTRANSFER 19913 -#define CURLOPT_BINARYTRANSFER 19914 -#define PHP_CURL_STDOUT 0 -#define PHP_CURL_FILE 1 -#define PHP_CURL_USER 2 -#define PHP_CURL_DIRECT 3 -#define PHP_CURL_RETURN 4 -#define PHP_CURL_ASCII 5 -#define PHP_CURL_BINARY 6 -#define PHP_CURL_IGNORE 7 - -extern int le_curl; -#define le_curl_name "cURL handle" -extern int le_curl_multi_handle; -#define le_curl_multi_handle_name "cURL Multi Handle" - -PHP_MINIT_FUNCTION(curl); -PHP_MSHUTDOWN_FUNCTION(curl); -PHP_MINFO_FUNCTION(curl); -PHP_FUNCTION(curl_version); -PHP_FUNCTION(curl_init); -PHP_FUNCTION(curl_copy_handle); -PHP_FUNCTION(curl_setopt); -PHP_FUNCTION(curl_setopt_array); -PHP_FUNCTION(curl_exec); -PHP_FUNCTION(curl_getinfo); -PHP_FUNCTION(curl_error); -PHP_FUNCTION(curl_errno); -PHP_FUNCTION(curl_close); -PHP_FUNCTION(curl_multi_init); -PHP_FUNCTION(curl_multi_add_handle); -PHP_FUNCTION(curl_multi_remove_handle); -PHP_FUNCTION(curl_multi_select); -PHP_FUNCTION(curl_multi_exec); -PHP_FUNCTION(curl_multi_getcontent); -PHP_FUNCTION(curl_multi_info_read); -PHP_FUNCTION(curl_multi_close); -void _php_curl_multi_close(zend_rsrc_list_entry * TSRMLS_DC); - -typedef struct { - zval *func_name; - zend_fcall_info_cache fci_cache; - FILE *fp; - smart_str buf; - int method; - int type; -} php_curl_write; - -typedef struct { - zval *func_name; - zend_fcall_info_cache fci_cache; - FILE *fp; - long fd; - int method; -} php_curl_read; - -typedef struct { - php_curl_write *write; - php_curl_write *write_header; - php_curl_read *read; - zval *passwd; -} php_curl_handlers; - -struct _php_curl_error { - char str[CURL_ERROR_SIZE + 1]; - int no; -}; - -struct _php_curl_send_headers { - char *str; - size_t str_len; -}; - -struct _php_curl_free { - zend_llist str; - zend_llist post; - zend_llist slist; -}; - -typedef struct { - struct _php_curl_error err; - struct _php_curl_free to_free; - struct _php_curl_send_headers header; - void ***thread_ctx; - CURL *cp; - php_curl_handlers *handlers; - long id; - unsigned int uses; - zend_bool in_callback; -} php_curl; - -typedef struct { - int still_running; - CURLM *multi; - zend_llist easyh; -} php_curlm; - -void _php_curl_cleanup_handle(php_curl *); - -/* streams support */ - -extern php_stream_ops php_curl_stream_ops; -#define PHP_STREAM_IS_CURL &php_curl_stream_ops - -php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - -extern php_stream_wrapper php_curl_wrapper; - -struct php_curl_buffer { - off_t readpos, writepos; - php_stream *buf; -}; - -typedef struct { - CURL *curl; - CURLM *multi; - char *url; - struct php_curl_buffer readbuffer; /* holds downloaded data */ - struct php_curl_buffer writebuffer; /* holds data to upload */ - - fd_set readfds, writefds, excfds; - int maxfd; - - char errstr[CURL_ERROR_SIZE + 1]; - CURLMcode mcode; - int pending; - zval *headers; -} php_curl_stream; - - -#else -#define curl_module_ptr NULL -#endif /* HAVE_CURL */ -#define phpext_curl_ptr curl_module_ptr -#endif /* _PHP_CURL_H */ diff --git a/ext/curl/streams.c b/ext/curl/streams.c deleted file mode 100644 index 7f0c55fb930f4..0000000000000 --- a/ext/curl/streams.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This file implements cURL based wrappers. - * NOTE: If you are implementing your own streams that are intended to - * work independently of wrappers, this is not a good example to follow! - **/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_memory_streams.h" - -#if HAVE_CURL - -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#endif - -#include -#include - -#define SMART_STR_PREALLOC 4096 - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "php_curl.h" - -static size_t on_data_available(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_stream *stream = (php_stream *) ctx; - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - size_t wrote; - TSRMLS_FETCH(); - - /* TODO: I'd like to deprecate this. - * This code is here because until we start getting real data, we don't know - * if we have had all of the headers - * */ - if (curlstream->readbuffer.writepos == 0) { - zval *sym; - - MAKE_STD_ZVAL(sym); - *sym = *curlstream->headers; - zval_copy_ctor(sym); - ZEND_SET_SYMBOL(EG(active_symbol_table), "http_response_header", sym); - } - - php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.writepos, SEEK_SET); - wrote = php_stream_write(curlstream->readbuffer.buf, data, size * nmemb); - curlstream->readbuffer.writepos = php_stream_tell(curlstream->readbuffer.buf); - - return wrote; -} - -/* cURL guarantees that headers are written as complete lines, with this function - * called once for each header */ -static size_t on_header_available(char *data, size_t size, size_t nmemb, void *ctx) -{ - size_t length = size * nmemb; - zval *header; - php_stream *stream = (php_stream *) ctx; - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(header); - Z_STRLEN_P(header) = length; - Z_STRVAL_P(header) = estrndup(data, length); - if (Z_STRVAL_P(header)[length-1] == '\n') { - Z_STRVAL_P(header)[length-1] = '\0'; - Z_STRLEN_P(header)--; - - if (Z_STRVAL_P(header)[length-2] == '\r') { - Z_STRVAL_P(header)[length-2] = '\0'; - Z_STRLEN_P(header)--; - } - } - Z_TYPE_P(header) = IS_STRING; - zend_hash_next_index_insert(Z_ARRVAL_P(curlstream->headers), &header, sizeof(zval *), NULL); - - /* based on the header, we might need to trigger a notification */ - if (!strncasecmp(data, "Location: ", 10)) { - php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_REDIRECTED, data + 10, 0); - } else if (!strncasecmp(data, "Content-Type: ", 14)) { - php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_MIME_TYPE_IS, data + 14, 0); - } else if (!strncasecmp(data, "Context-Length: ", 16)) { - php_stream_notify_file_size(stream->context, atoi(data + 16), data, 0); - php_stream_notify_progress_init(stream->context, 0, 0); - } - - return length; - -} - -static int on_progress_avail(php_stream *stream, double dltotal, double dlnow, double ultotal, double ulnow) -{ - TSRMLS_FETCH(); - - /* our notification system only works in a single direction; we should detect which - * direction is important and use the correct values in this call */ - php_stream_notify_progress(stream->context, dlnow, dltotal); - return 0; -} - -static size_t php_curl_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - - if (curlstream->writebuffer.buf) { - return php_stream_write(curlstream->writebuffer.buf, buf, count); - } - - return 0; -} - -static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - size_t didread = 0; - - if (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending) { - /* we need to read some more data */ - struct timeval tv; - - /* fire up the connection */ - if (curlstream->readbuffer.writepos == 0) { - while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(curlstream->multi, &curlstream->pending)); - } - - do { - /* get the descriptors from curl */ - curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd); - - /* if we are in blocking mode, set a timeout */ - tv.tv_usec = 0; - tv.tv_sec = 15; /* TODO: allow this to be configured from the script */ - - /* wait for data */ - switch (select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) { - case -1: - /* error */ - return 0; - case 0: - /* no data yet: timed-out */ - return 0; - default: - /* fetch the data */ - do { - curlstream->mcode = curl_multi_perform(curlstream->multi, &curlstream->pending); - } while (curlstream->mcode == CURLM_CALL_MULTI_PERFORM); - } - } while (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0); - - } - - /* if there is data in the buffer, try and read it */ - if (curlstream->readbuffer.writepos > 0 && curlstream->readbuffer.readpos < curlstream->readbuffer.writepos) { - php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.readpos, SEEK_SET); - didread = php_stream_read(curlstream->readbuffer.buf, buf, count); - curlstream->readbuffer.readpos = php_stream_tell(curlstream->readbuffer.buf); - } - - if (didread == 0) { - stream->eof = 1; - } - - return didread; -} - -static int php_curl_stream_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - - /* TODO: respect the close_handle flag here, so that casting to a FILE* on - * systems without fopencookie will work properly */ - - curl_multi_remove_handle(curlstream->multi, curlstream->curl); - curl_easy_cleanup(curlstream->curl); - curl_multi_cleanup(curlstream->multi); - - /* we are not closing curlstream->readbuf here, because we export - * it as a zval with the wrapperdata - the engine will garbage collect it */ - - efree(curlstream->url); - efree(curlstream); - - return 0; -} - -static int php_curl_stream_flush(php_stream *stream TSRMLS_DC) -{ -#ifdef ilia_0 - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; -#endif - return 0; -} - -static int php_curl_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - /* TODO: fill in details based on Data: and Content-Length: headers, and/or data - * from curl_easy_getinfo(). - * For now, return -1 to indicate that it doesn't make sense to stat this stream */ - return -1; -} - -static int php_curl_stream_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - /* delegate to the readbuffer stream */ - return php_stream_cast(curlstream->readbuffer.buf, castas, ret, 0); -} - -php_stream_ops php_curl_stream_ops = { - php_curl_stream_write, - php_curl_stream_read, - php_curl_stream_close, - php_curl_stream_flush, - "cURL", - NULL, /* seek */ - php_curl_stream_cast, /* cast */ - php_curl_stream_stat /* stat */ -}; - - -php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_curl_stream *curlstream; - zval *tmp; - - curlstream = emalloc(sizeof(php_curl_stream)); - memset(curlstream, 0, sizeof(php_curl_stream)); - - stream = php_stream_alloc(&php_curl_stream_ops, curlstream, 0, mode); - php_stream_context_set(stream, context); - - curlstream->curl = curl_easy_init(); - curlstream->multi = curl_multi_init(); - curlstream->pending = 1; - - /* if opening for an include statement, ensure that the local storage will - * have a FILE* associated with it. - * Otherwise, use the "smart" memory stream that will turn itself into a file - * when it gets large */ -#if !HAVE_FOPENCOOKIE - if (options & STREAM_WILL_CAST) { - curlstream->readbuffer.buf = php_stream_fopen_tmpfile(); - } else -#endif - { - curlstream->readbuffer.buf = php_stream_temp_new(); - } - - /* curl requires the URL to be valid throughout it's operation, so dup it */ - curlstream->url = estrdup(filename); - curl_easy_setopt(curlstream->curl, CURLOPT_URL, curlstream->url); - - /* feed curl data into our read buffer */ - curl_easy_setopt(curlstream->curl, CURLOPT_WRITEFUNCTION, on_data_available); - curl_easy_setopt(curlstream->curl, CURLOPT_FILE, stream); - - /* feed headers */ - curl_easy_setopt(curlstream->curl, CURLOPT_HEADERFUNCTION, on_header_available); - curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream); - - /* currently buggy (bug is in curl) */ - curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1); - - curl_easy_setopt(curlstream->curl, CURLOPT_ERRORBUFFER, curlstream->errstr); - curl_easy_setopt(curlstream->curl, CURLOPT_VERBOSE, 0); - - /* enable progress notification */ - curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSFUNCTION, on_progress_avail); - curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream); - curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0); - - curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION); - - /* TODO: read cookies and options from context */ - - /* prepare for "pull" mode */ - curl_multi_add_handle(curlstream->multi, curlstream->curl); - - /* Prepare stuff for file_get_wrapper_data: the data is an array: - * - * data = array( - * "headers" => array("Content-Type: text/html", "Xxx: Yyy"), - * "readbuf" => resource (equivalent to curlstream->readbuffer) - * ); - * */ - MAKE_STD_ZVAL(stream->wrapperdata); - array_init(stream->wrapperdata); - - MAKE_STD_ZVAL(curlstream->headers); - array_init(curlstream->headers); - - add_assoc_zval(stream->wrapperdata, "headers", curlstream->headers); - - MAKE_STD_ZVAL(tmp); - php_stream_to_zval(curlstream->readbuffer.buf, tmp); - add_assoc_zval(stream->wrapperdata, "readbuf", tmp); - -#if !HAVE_FOPENCOOKIE - if (options & STREAM_WILL_CAST) { - /* we will need to download the whole resource now, - * since we cannot get the actual FD for the download, - * so we won't be able to drive curl via stdio. */ - -/* TODO: this needs finishing */ - - curl_easy_perform(curlstream->curl); - } - else -#endif - { - /* fire up the connection; we need to detect a connection error here, - * otherwise the curlstream we return ends up doing nothing useful. */ - CURLMcode m; - - while (CURLM_CALL_MULTI_PERFORM == (m = curl_multi_perform(curlstream->multi, &curlstream->pending))) { - ; /* spin */ - } - - if (m != CURLM_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m); - } - - } - - return stream; -} - -static php_stream_wrapper_ops php_curl_wrapper_ops = { - php_curl_stream_opener, - NULL, /* stream_close: curl streams know how to clean themselves up */ - NULL, /* stream_stat: curl streams know how to stat themselves */ - NULL, /* stat url */ - NULL, /* opendir */ - "cURL", /* label */ - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_curl_wrapper = { - &php_curl_wrapper_ops, - NULL, - 1 /* is_url */ -}; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/date/CREDITS b/ext/date/CREDITS deleted file mode 100644 index bfcacbe989ef2..0000000000000 --- a/ext/date/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Date/Time Support -Derick Rethans diff --git a/ext/date/TODO b/ext/date/TODO deleted file mode 100644 index 4b1237c4a918a..0000000000000 --- a/ext/date/TODO +++ /dev/null @@ -1,6 +0,0 @@ -- Port over my 200 test cases to .phpt format. -- Write an error handler for unexpected characters while parsing dates. -- Cache lookups for timezone information. -- Optimize parsing @ with a negative timestamp. -- Make sure that date_default_timezone_set() validates the passed timezone - identifier. diff --git a/ext/date/config.m4 b/ext/date/config.m4 deleted file mode 100644 index 9e39d4f7e9086..0000000000000 --- a/ext/date/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl $Id$ -dnl config.m4 for date extension - -sinclude(ext/date/lib/timelib.m4) -sinclude(lib/timelib.m4) - -PHP_DATE_CFLAGS="-I@ext_builddir@/lib" -timelib_sources="lib/dow.c lib/parse_date.c lib/parse_tz.c - lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c" - -PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS) - -PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1) -PHP_ADD_INCLUDE([$ext_builddir/lib]) -PHP_ADD_INCLUDE([$ext_srcdir/lib]) - -PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h]) - -cat > $ext_builddir/lib/timelib_config.h < -#endif -EOF diff --git a/ext/date/config.w32 b/ext/date/config.w32 deleted file mode 100755 index 26283b05c78ce..0000000000000 --- a/ext/date/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -EXTENSION("date", "php_date.c", false, "-Iext/date/lib"); -ADD_SOURCES("ext/date/lib", "timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c", "date"); -AC_DEFINE('HAVE_DATE', 1, 'Have date/time support'); - -var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true); -tl_config.WriteLine("#include \"config.w32.h\""); -tl_config.Close(); diff --git a/ext/date/lib/README b/ext/date/lib/README deleted file mode 100644 index 2603bc7c6f7b5..0000000000000 --- a/ext/date/lib/README +++ /dev/null @@ -1,6 +0,0 @@ -Regenerating Parser -=================== - -Make sure you use re2c 0.9.8dev or higher: - -/dat/dev/sf/re2c/re2c -d -b resource/parse_date.re > parse_date.c diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c deleted file mode 100644 index 0c71c2dc6ab83..0000000000000 --- a/ext/date/lib/dow.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ -static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ - -static timelib_sll century_value(timelib_sll j) -{ - timelib_sll i = j - 17; - timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7; - - return c < 0 ? c + 7 : c; -} - -static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso) -{ - timelib_sll c1, y1, m1, dow; - - /* Only valid for Gregorian calendar */ - if (y < 1753) { - return -1; - } - c1 = century_value(y / 100); - y1 = (y % 100); - m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m]; - dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7; - if (iso) { - if (dow == 0) { - dow = 7; - } - } - return dow; -} - -timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return timelib_day_of_week_ex(y, m, d, 0); -} - -timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return timelib_day_of_week_ex(y, m, d, 1); -} - - /* jan feb mar apr may jun jul aug sep oct nov dec */ -static int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }; -static int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - -timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return (timelib_is_leap(y) ? d_table_leap[m] : d_table_common[m]) + d - 1; -} - -timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m) -{ - return timelib_is_leap(y) ? ml_table_leap[m] : ml_table_common[m]; -} - -void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy) -{ - int y_leap, prev_y_leap, doy, jan1weekday, weekday; - - y_leap = timelib_is_leap(y); - prev_y_leap = timelib_is_leap(y-1); - doy = timelib_day_of_year(y, m, d) + 1; - if (y_leap && m > 2) { - doy++; - } - jan1weekday = timelib_day_of_week(y, 1, 1); - weekday = timelib_day_of_week(y, m, d); - if (weekday == 0) weekday = 7; - if (jan1weekday == 0) jan1weekday = 7; - /* Find if Y M D falls in YearNumber Y-1, WeekNumber 52 or 53 */ - if (doy <= (8 - jan1weekday) && jan1weekday > 4) { - *iy = y - 1; - if (jan1weekday == 5 || (jan1weekday == 6 && prev_y_leap)) { - *iw = 53; - } else { - *iw = 52; - } - } else { - *iy = y; - } - /* 8. Find if Y M D falls in YearNumber Y+1, WeekNumber 1 */ - if (*iy == y) { - int i; - - i = y_leap ? 366 : 365; - if ((i - (doy - y_leap)) < (4 - weekday)) { - *iy = y + 1; - *iw = 1; - return; - } - } - /* 9. Find if Y M D falls in YearNumber Y, WeekNumber 1 through 53 */ - if (*iy == y) { - int j; - - j = doy + (7 - weekday) + (jan1weekday - 1); - *iw = j / 7; - if (jan1weekday > 4) { - *iw -= 1; - } - } -} - -timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d) -{ - timelib_sll dow, day; - - /* Figure out the dayofweek for y-1-1 */ - dow = timelib_day_of_week(y, 1, 1); - /* then use that to figure out the offset for day 1 of week 1 */ - day = 0 - (dow > 4 ? dow - 7 : dow); - - /* Add weeks and days */ - return day + ((w - 1) * 7) + d; -} - -#if 0 -int main(void) -{ - printf("dow = %d\n", timelib_day_of_week(1978, 12, 22)); /* 5 */ - printf("dow = %d\n", timelib_day_of_week(2005, 2, 19)); /* 6 */ -} -#endif diff --git a/ext/date/lib/fallbackmap.h b/ext/date/lib/fallbackmap.h deleted file mode 100644 index 7189eb88e3045..0000000000000 --- a/ext/date/lib/fallbackmap.h +++ /dev/null @@ -1,40 +0,0 @@ - { "sst", 0, -11, "Pacific/Apia" }, - { "hst", 0, -10, "Pacific/Honolulu" }, - { "akst", 0, -9, "America/Anchorage" }, - { "akdt", 1, -8, "America/Anchorage" }, - { "pst", 0, -8, "America/Los_Angeles" }, - { "pdt", 1, -7, "America/Los_Angeles" }, - { "mst", 0, -7, "America/Denver" }, - { "mdt", 1, -6, "America/Denver" }, - { "cst", 0, -6, "America/Chicago" }, - { "cdt", 1, -5, "America/Chicago" }, - { "est", 0, -5, "America/New_York" }, - { "edt", 1, -4, "America/New_York" }, - { "ast", 0, -4, "America/Halifax" }, - { "adt", 1, -3, "America/Halifax" }, - { "brt", 0, -3, "America/Sao_Paulo" }, - { "brst", 1, -2, "America/Sao_Paulo" }, - { "azost", 0, -1, "Atlantic/Azores" }, - { "azodt", 1, 0, "Atlantic/Azores" }, - { "gmt", 0, 0, "Europe/London" }, - { "bst", 1, 1, "Europe/London" }, - { "cet", 0, 1, "Europe/Paris" }, - { "cest", 1, 2, "Europe/Paris" }, - { "eet", 0, 2, "Europe/Helsinki" }, - { "eest", 1, 3, "Europe/Helsinki" }, - { "msk", 0, 3, "Europe/Moscow" }, - { "msd", 1, 4, "Europe/Moscow" }, - { "gst", 0, 4, "Asia/Dubai" }, - { "pkt", 0, 5, "Asia/Karachi" }, - { "ist", 0, 5.5, "Asia/Calcutta" }, - { "npt", 0, 5.75, "Asia/Katmandu" }, - { "yekt", 1, 6, "Asia/Yekaterinburg" }, - { "novst", 1, 7, "Asia/Novosibirsk" }, - { "krat", 0, 7, "Asia/Krasnoyarsk" }, - { "krast", 1, 8, "Asia/Krasnoyarsk" }, - { "jst", 0, 9, "Asia/Tokyo" }, - { "est", 0, 10, "Australia/Melbourne" }, - { "cst", 1, 10.5, "Australia/Adelaide" }, - { "est", 1, 11, "Australia/Melbourne" }, - { "nzst", 0, 12, "Pacific/Auckland" }, - { "nzdt", 1, 13, "Pacific/Auckland" }, diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c deleted file mode 100644 index 0882efd5783ad..0000000000000 --- a/ext/date/lib/parse_date.c +++ /dev/null @@ -1,18828 +0,0 @@ -/* Generated by re2c 0.9.10.dev on Wed Oct 19 22:39:08 2005 */ -#line 1 "resource/parse_date.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -# define strtoll(s, f, b) _atoi64(s) -#elif !defined(HAVE_STRTOLL) -# if defined(HAVE_ATOLL) -# define strtoll(s, f, b) atoll(s) -# else -# define strtoll(s, f, b) strtol(s, f, b) -# endif -#endif - -#define TIMELIB_SECOND 1 -#define TIMELIB_MINUTE 2 -#define TIMELIB_HOUR 3 -#define TIMELIB_DAY 4 -#define TIMELIB_MONTH 5 -#define TIMELIB_YEAR 6 -#define TIMELIB_WEEKDAY 7 - -#define EOI 257 -#define TIME 258 -#define DATE 259 - -#define TIMELIB_XMLRPC_SOAP 260 -#define TIMELIB_TIME12 261 -#define TIMELIB_TIME24 262 -#define TIMELIB_GNU_NOCOLON 263 -#define TIMELIB_GNU_NOCOLON_TZ 264 -#define TIMELIB_ISO_NOCOLON 265 - -#define TIMELIB_AMERICAN 266 -#define TIMELIB_ISO_DATE 267 -#define TIMELIB_DATE_FULL 268 -#define TIMELIB_DATE_TEXT 269 -#define TIMELIB_DATE_NOCOLON 270 -#define TIMELIB_PG_YEARDAY 271 -#define TIMELIB_PG_TEXT 272 -#define TIMELIB_PG_REVERSE 273 -#define TIMELIB_CLF 274 -#define TIMELIB_DATE_NO_DAY 275 -#define TIMELIB_SHORTDATE_WITH_TIME 276 -#define TIMELIB_DATE_FULL_POINTED 277 -#define TIMELIB_TIME24_WITH_ZONE 278 -#define TIMELIB_ISO_WEEK 279 - -#define TIMELIB_TIMEZONE 300 -#define TIMELIB_AGO 301 - -#define TIMELIB_RELATIVE 310 - -#define TIMELIB_ERROR 999 - -typedef unsigned char uchar; - -#define BSIZE 8192 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) return EOI; - -#define RET(i) {s->cur = cursor; return i;} - -#define timelib_string_free free - -#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } } -#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } -#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } } -#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; } -#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; } -#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; } -#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } } - -#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str -#define TIMELIB_DEINIT timelib_string_free(str) -#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; } - -#define TIMELIB_PROCESS_YEAR(x) { \ - if ((x) == -1) { \ - /* (x) = 0; */ \ - } else if ((x) < 100) { \ - if ((x) < 70) { \ - (x) += 2000; \ - } else { \ - (x) += 1900; \ - } \ - } \ -} - -#ifdef DEBUG_PARSER -#define DEBUG_OUTPUT(s) printf("%s\n", s); -#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } -#else -#define DEBUG_OUTPUT(s) -#define YYDEBUG(s,c) -#endif - -#include "timelib_structs.h" - -typedef struct timelib_elems { - unsigned int c; /* Number of elements */ - char **v; /* Values */ -} timelib_elems; - -typedef struct Scanner { - int fd; - uchar *lim, *str, *ptr, *cur, *tok, *pos; - unsigned int line, len; - int errors; - - struct timelib_time *time; - timelib_tzdb *tzdb; -} Scanner; - -typedef struct _timelib_lookup_table { - const char *name; - int type; - int value; -} timelib_lookup_table; - -typedef struct _timelib_relunit { - const char *name; - int unit; - int multiplier; -} timelib_relunit; - -#define HOUR(a) (int)(a * 60) - -/* The timezone table. */ -static timelib_tz_lookup_table timelib_timezone_lookup[] = { -#include "timezonemap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = { -#include "fallbackmap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_relunit const timelib_relunit_lookup[] = { - { "sec", TIMELIB_SECOND, 1 }, - { "secs", TIMELIB_SECOND, 1 }, - { "second", TIMELIB_SECOND, 1 }, - { "seconds", TIMELIB_SECOND, 1 }, - { "min", TIMELIB_MINUTE, 1 }, - { "mins", TIMELIB_MINUTE, 1 }, - { "minute", TIMELIB_MINUTE, 1 }, - { "minutes", TIMELIB_MINUTE, 1 }, - { "hour", TIMELIB_HOUR, 1 }, - { "hours", TIMELIB_HOUR, 1 }, - { "day", TIMELIB_DAY, 1 }, - { "days", TIMELIB_DAY, 1 }, - { "week", TIMELIB_DAY, 7 }, - { "weeks", TIMELIB_DAY, 7 }, - { "fortnight", TIMELIB_DAY, 14 }, - { "fortnights", TIMELIB_DAY, 14 }, - { "forthnight", TIMELIB_DAY, 14 }, - { "forthnights", TIMELIB_DAY, 14 }, - { "month", TIMELIB_MONTH, 1 }, - { "months", TIMELIB_MONTH, 1 }, - { "year", TIMELIB_YEAR, 1 }, - { "years", TIMELIB_YEAR, 1 }, - - { "monday", TIMELIB_WEEKDAY, 1 }, - { "tuesday", TIMELIB_WEEKDAY, 2 }, - { "wednesday", TIMELIB_WEEKDAY, 3 }, - { "thursday", TIMELIB_WEEKDAY, 4 }, - { "friday", TIMELIB_WEEKDAY, 5 }, - { "saturday", TIMELIB_WEEKDAY, 6 }, - { "sunday", TIMELIB_WEEKDAY, 0 }, - - { NULL, 0, 0 } -}; - -/* The relative text table. */ -static timelib_lookup_table const timelib_reltext_lookup[] = { - { "first", 0, 1 }, - { "next", 0, 1 }, - { "second", 0, 2 }, - { "third", 0, 3 }, - { "fourth", 0, 4 }, - { "fifth", 0, 5 }, - { "sixth", 0, 6 }, - { "seventh", 0, 7 }, - { "eight", 0, 8 }, - { "ninth", 0, 9 }, - { "tenth", 0, 10 }, - { "eleventh", 0, 11 }, - { "twelfth", 0, 12 }, - { "last", 0, -1 }, - { "previous", 0, -1 }, - { "this", 1, 0 }, - { NULL, 1, 0 } -}; - -/* The month table. */ -static timelib_lookup_table const timelib_month_lookup[] = { - { "jan", 0, 1 }, - { "feb", 0, 2 }, - { "mar", 0, 3 }, - { "apr", 0, 4 }, - { "may", 0, 5 }, - { "jun", 0, 6 }, - { "jul", 0, 7 }, - { "aug", 0, 8 }, - { "sep", 0, 9 }, - { "sept", 0, 9 }, - { "oct", 0, 10 }, - { "nov", 0, 11 }, - { "dec", 0, 12 }, - { "i", 0, 1 }, - { "ii", 0, 2 }, - { "iii", 0, 3 }, - { "iv", 0, 4 }, - { "v", 0, 5 }, - { "vi", 0, 6 }, - { "vii", 0, 7 }, - { "viii", 0, 8 }, - { "ix", 0, 9 }, - { "x", 0, 10 }, - { "xi", 0, 11 }, - { "xii", 0, 12 }, - - { "january", 0, 1 }, - { "february", 0, 2 }, - { "march", 0, 3 }, - { "april", 0, 4 }, - { "may", 0, 5 }, - { "june", 0, 6 }, - { "july", 0, 7 }, - { "august", 0, 8 }, - { "september", 0, 9 }, - { "october", 0, 10 }, - { "november", 0, 11 }, - { "december", 0, 12 }, - { NULL, 0, 0 } -}; - -#if 0 -static char* timelib_ltrim(char *s) -{ - char *ptr = s; - while (ptr[0] == ' ') { - ptr++; - } - return ptr; -} -#endif - -#if 0 -uchar *fill(Scanner *s, uchar *cursor){ - if(!s->eof){ - unsigned int cnt = s->tok - s->bot; - if(cnt){ - memcpy(s->bot, s->tok, s->lim - s->tok); - s->tok = s->bot; - s->ptr -= cnt; - cursor -= cnt; - s->pos -= cnt; - s->lim -= cnt; - } - if((s->top - s->lim) < BSIZE){ - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - memcpy(buf, s->tok, s->lim - s->tok); - s->tok = buf; - s->ptr = &buf[s->ptr - s->bot]; - cursor = &buf[cursor - s->bot]; - s->pos = &buf[s->pos - s->bot]; - s->lim = &buf[s->lim - s->bot]; - s->top = &s->lim[BSIZE]; - free(s->bot); - s->bot = buf; - } - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){ - s->eof = &s->lim[cnt]; *(s->eof)++ = '\n'; - } - s->lim += cnt; - } - return cursor; -} -#endif - -static timelib_sll timelib_meridian(char **ptr, timelib_sll h) -{ - timelib_sll retval = 0; - - while (!strchr("AaPp", **ptr)) { - ++*ptr; - } - if (**ptr == 'a' || **ptr == 'A') { - if (h == 12) { - retval = -12; - } - } else if (h != 12) { - retval = 12; - } - ++*ptr; - if (**ptr == '.') { - *ptr += 3; - } else { - ++*ptr; - } - return retval; -} - -static char *timelib_string(Scanner *s) -{ - char *tmp = calloc(1, s->cur - s->tok + 1); - memcpy(tmp, s->tok, s->cur - s->tok); - - return tmp; -} - -static timelib_sll timelib_get_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - timelib_sll tmp_nr = -1; - int len = 0; - - while ((**ptr < '0') || (**ptr > '9')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtoll(str, NULL, 10); - free(str); - return tmp_nr; -} - -static double timelib_get_frac_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - double tmp_nr = -1; - int len = 0; - - while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtod(str, NULL); - free(str); - return tmp_nr; -} - -static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) -{ - timelib_ull dir = 1; - - while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - } else if (**ptr == '-') { - dir = -1; - ++*ptr; - } - return dir * timelib_get_nr(ptr, max_length); -} - -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + - strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - -static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) -{ - char *word; - char *begin = *ptr, *end; - timelib_sll value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_reltext_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - *behavior = tp->type; - } - } - - free(word); - return value; -} - -static timelib_sll timelib_get_relative_text(char **ptr, int *behavior) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_relative_text(ptr, behavior); -} - -static long timelib_lookup_month(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_month_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - } - } - - free(word); - return value; -} - -static long timelib_get_month(char **ptr) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_month(ptr); -} - -static void timelib_eat_spaces(char **ptr) -{ - while (**ptr == ' ') { - ++*ptr; - } -} - -static const timelib_relunit* timelib_lookup_relunit(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - const timelib_relunit *tp, *value = NULL; - - while (**ptr != '\0' && **ptr != ' ') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_relunit_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp; - break; - } - } - - free(word); - return value; -} - -static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s) -{ - const timelib_relunit* relunit; - - relunit = timelib_lookup_relunit(ptr); - switch (relunit->unit) { - case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break; - case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break; - case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break; - case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break; - case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break; - case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break; - - case TIMELIB_WEEKDAY: - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7; - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = behavior; - break; - } -} - -static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst) -{ - int first_found = 0; - timelib_tz_lookup_table *tp, *first_found_elem; - timelib_tz_lookup_table *fmp; - - for (tp = timelib_timezone_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - if (!first_found) { - first_found = 1; - first_found_elem = tp; - if (gmtoffset == -1) { - return tp; - } - } - if (tp->gmtoffset == gmtoffset) { - return tp; - } - } - } - if (first_found) { - return first_found_elem; - } - /* Still didn't find anything, let's find the zone solely based on - * offset/isdst then */ - for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { - return fmp; - } - } - return NULL; -} - -static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - timelib_tz_lookup_table *tp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - if ((tp = zone_search(word, -1, 0))) { - value = -tp->gmtoffset / 60; - *dst = tp->type; - value += tp->type * 60; - *found = 1; - } else { - *found = 0; - } - - *tz_abbr = word; - return value; -} - -static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb) -{ - timelib_tzinfo *res; - - *tz_not_found = 0; - - while (**ptr == ' ') { - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return -1 * timelib_parse_tz_cor(ptr); - } else if (**ptr == '-') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return timelib_parse_tz_cor(ptr); - } else { - int found = 0; - long offset; - char *tz_abbr; - - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_ABBR; - offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found); -#if 0 - /* If we found a TimeZone identifier, use it */ - if (tz_name) { - t->tz_info = timelib_parse_tzfile(tz_name); - t->zone_type = TIMELIB_ZONETYPE_ID; - } -#endif - /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/")) { - if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { - t->tz_info = res; - t->zone_type = TIMELIB_ZONETYPE_ID; - found++; - } - } - if (t->zone_type != TIMELIB_ZONETYPE_ID) { - timelib_time_tz_abbr_update(t, tz_abbr); - } - free(tz_abbr); - *tz_not_found = (found == 0); - return offset; - } -} - -#define timelib_split_free(arg) { \ - int i; \ - for (i = 0; i < arg.c; i++) { \ - free(arg.v[i]); \ - } \ - if (arg.v) { \ - free(arg.v); \ - } \ -} - -static int scan(Scanner *s) -{ - uchar *cursor = s->cur; - char *str, *ptr = NULL; - -std: - s->tok = cursor; - s->len = 0; -#line 802 "resource/parse_date.re" - - -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 208, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 192, 64, 192, 0, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 8, 8, 8, 136, 8, 8, 8, - 136, 8, 8, 8, 8, 8, 136, 8, - 8, 8, 136, 136, 136, 8, 8, 8, - 8, 8, 8, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 738 "" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy0; - - YYDEBUG(1, *YYCURSOR); - ++YYCURSOR; -yy0: - if((YYLIMIT - YYCURSOR) < 26) YYFILL(26); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 0x00: case 0x0A: goto yy45; - case ' ': case ',': case '.': goto yy43; - case '+': case '-': goto yy40; - case '0': goto yy9; - case '1': goto yy10; - case '2': goto yy11; - case '3': goto yy12; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy13; - case '@': goto yy7; - case 'A': goto yy22; - case 'B': - case 'C': case 'G': - case 'H': case 'K': case 'Q': - case 'R': case 'U': case 'Y': - case 'Z': goto yy41; - case 'D': goto yy29; - case 'E': goto yy32; - case 'F': goto yy19; - case 'I': goto yy14; - case 'J': goto yy17; - case 'L': goto yy34; - case 'M': goto yy21; - case 'N': goto yy28; - case 'O': goto yy26; - case 'P': goto yy36; - case 'S': goto yy24; - case 'T': goto yy31; - case 'V': goto yy15; - case 'W': goto yy38; - case 'X': goto yy16; - case 'a': goto yy23; - case 'b': - case 'c': case 'g': - case 'h': - case 'i': case 'k': case 'q': - case 'r': case 'u': - case 'v': case 'x': case 'z': goto yy42; - case 'd': goto yy30; - case 'e': goto yy33; - case 'f': goto yy20; - case 'j': goto yy18; - case 'l': goto yy35; - case 'm': goto yy5; - case 'n': goto yy4; - case 'o': goto yy27; - case 'p': goto yy37; - case 's': goto yy25; - case 't': goto yy6; - case 'w': goto yy39; - case 'y': goto yy2; - default: goto yy47; - } -yy2: - YYDEBUG(2, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy48; - goto yy3; - } else { - if(yych == 'e') goto yy1327; - if(yych <= 'z') goto yy48; - goto yy3; - } -yy3: - YYDEBUG(3, *YYCURSOR); - -#line 1300 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("tzcorrection | tz"); - TIMELIB_INIT; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_TIMEZONE; - } -#line 826 "" -yy4: - YYDEBUG(4, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'H'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy604; - goto yy48; - } else { - if(yych <= 'I') goto yy605; - if(yych == 'O') goto yy600; - goto yy48; - } - } else { - if(yych <= 'h'){ - if(yych <= '`') goto yy3; - if(yych == 'e') goto yy604; - goto yy48; - } else { - if(yych <= 'n'){ - if(yych <= 'i') goto yy605; - goto yy48; - } else { - if(yych <= 'o') goto yy1321; - if(yych <= 'z') goto yy48; - goto yy3; - } - } - } -yy5: - YYDEBUG(5, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= 'N'){ - if(yych <= '@') goto yy3; - if(yych <= 'A') goto yy699; - goto yy48; - } else { - if(yych <= 'O') goto yy702; - if(yych <= 'Z') goto yy48; - goto yy3; - } - } else { - if(yych <= 'i'){ - if(yych <= 'a') goto yy699; - if(yych <= 'h') goto yy48; - goto yy1315; - } else { - if(yych == 'o') goto yy702; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy6: - YYDEBUG(6, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'A': - case 'B': - case 'C': - case 'D': case 'F': - case 'G': case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': case 'V': case 'X': - case 'Y': - case 'Z': case 'a': - case 'b': - case 'c': - case 'd': case 'f': - case 'g': case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': case 'p': - case 'q': - case 'r': - case 's': - case 't': case 'v': case 'x': - case 'y': - case 'z': goto yy48; - case 'E': case 'e': goto yy469; - case 'H': case 'h': goto yy470; - case 'U': case 'u': goto yy471; - case 'W': case 'w': goto yy472; - case 'o': goto yy1303; - default: goto yy3; - } -yy7: - YYDEBUG(7, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '-') goto yy1299; - if(yych <= '0') goto yy8; - if(yych <= '9') goto yy1300; - goto yy8; -yy8: - YYDEBUG(8, *YYCURSOR); - -#line 1366 "resource/parse_date.re" -{ -/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */ - s->errors++; - goto std; - } -#line 931 "" -yy9: - YYDEBUG(9, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': case 'S': - case 'T': case 'V': - case 'W': - case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': case 's': - case 't': case 'w': case 'y': goto yy1256; - case '-': goto yy783; - case '.': goto yy1265; - case '/': goto yy782; - case '0': goto yy1298; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1297; - case ':': goto yy1266; - default: goto yy8; - } -yy10: - YYDEBUG(10, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': - case 'P': case 'S': - case 'T': case 'V': - case 'W': - case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': - case 'p': case 's': - case 't': case 'w': case 'y': goto yy776; - case '-': goto yy783; - case '.': goto yy786; - case '/': goto yy782; - case '0': - case '1': - case '2': goto yy1297; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1264; - case ':': goto yy795; - default: goto yy8; - } -yy11: - YYDEBUG(11, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': - case 'P': case 'S': - case 'T': case 'V': - case 'W': - case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': - case 'p': case 's': - case 't': case 'w': case 'y': goto yy776; - case '-': goto yy783; - case '.': goto yy786; - case '/': goto yy782; - case '0': - case '1': - case '2': - case '3': goto yy1264; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1254; - case ':': goto yy795; - default: goto yy8; - } -yy12: - YYDEBUG(12, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': - case 'P': case 'S': - case 'T': case 'V': - case 'W': - case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': - case 'p': case 's': - case 't': case 'w': case 'y': goto yy776; - case '-': goto yy783; - case '.': goto yy786; - case '/': goto yy782; - case '0': - case '1': goto yy1254; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy781; - case ':': goto yy795; - default: goto yy8; - } -yy13: - YYDEBUG(13, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': - case 'P': case 'S': - case 'T': case 'V': - case 'W': - case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': - case 'p': case 's': - case 't': case 'w': case 'y': goto yy776; - case '-': goto yy783; - case '.': goto yy786; - case '/': goto yy782; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy781; - case ':': goto yy795; - default: goto yy8; - } -yy14: - YYDEBUG(14, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'I'){ - if(yych <= '/'){ - if(yych <= 0x1F) goto yy3; - if(yych <= '.') goto yy506; - goto yy3; - } else { - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - if(yych <= 'H') goto yy48; - goto yy774; - } - } else { - if(yych <= 'X'){ - if(yych == 'V') goto yy773; - if(yych <= 'W') goto yy48; - goto yy773; - } else { - if(yych <= 'Z') goto yy48; - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy15: - YYDEBUG(15, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych == 'I') goto yy771; - goto yy48; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy16: - YYDEBUG(16, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych == 'I') goto yy769; - goto yy48; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy17: - YYDEBUG(17, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'A'){ - if(yych <= '@') goto yy3; - goto yy752; - } else { - if(yych == 'U') goto yy751; - goto yy48; - } - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy3; - if(yych <= 'a') goto yy761; - goto yy51; - } else { - if(yych <= 'u') goto yy760; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy18: - YYDEBUG(18, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'A'){ - if(yych <= '@') goto yy3; - goto yy752; - } else { - if(yych == 'U') goto yy751; - goto yy48; - } - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy3; - if(yych <= 'a') goto yy752; - goto yy48; - } else { - if(yych <= 'u') goto yy751; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy19: - YYDEBUG(19, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'I'){ - if(yych <= 'D'){ - if(yych <= '@') goto yy3; - goto yy48; - } else { - if(yych <= 'E') goto yy715; - if(yych <= 'H') goto yy48; - goto yy716; - } - } else { - if(yych <= 'O'){ - if(yych <= 'N') goto yy48; - goto yy717; - } else { - if(yych == 'R') goto yy718; - goto yy48; - } - } - } else { - if(yych <= 'i'){ - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'e') goto yy733; - if(yych <= 'h') goto yy51; - goto yy734; - } - } else { - if(yych <= 'q'){ - if(yych == 'o') goto yy735; - goto yy51; - } else { - if(yych <= 'r') goto yy736; - if(yych <= 'z') goto yy51; - goto yy3; - } - } - } -yy20: - YYDEBUG(20, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'I'){ - if(yych <= 'D'){ - if(yych <= '@') goto yy3; - goto yy48; - } else { - if(yych <= 'E') goto yy715; - if(yych <= 'H') goto yy48; - goto yy716; - } - } else { - if(yych <= 'O'){ - if(yych <= 'N') goto yy48; - goto yy717; - } else { - if(yych == 'R') goto yy718; - goto yy48; - } - } - } else { - if(yych <= 'i'){ - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy48; - } else { - if(yych <= 'e') goto yy715; - if(yych <= 'h') goto yy48; - goto yy716; - } - } else { - if(yych <= 'q'){ - if(yych == 'o') goto yy717; - goto yy48; - } else { - if(yych <= 'r') goto yy718; - if(yych <= 'z') goto yy48; - goto yy3; - } - } - } -yy21: - YYDEBUG(21, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'A'){ - if(yych <= '@') goto yy3; - goto yy699; - } else { - if(yych == 'O') goto yy702; - goto yy48; - } - } else { - if(yych <= 'n'){ - if(yych <= '`') goto yy3; - if(yych <= 'a') goto yy700; - goto yy51; - } else { - if(yych <= 'o') goto yy701; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy22: - YYDEBUG(22, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'O'){ - if(yych <= '@') goto yy3; - if(yych == 'G') goto yy682; - goto yy48; - } else { - if(yych <= 'P') goto yy681; - if(yych == 'U') goto yy680; - goto yy48; - } - } else { - if(yych <= 'o'){ - if(yych <= '`') goto yy3; - if(yych == 'g') goto yy692; - goto yy51; - } else { - if(yych <= 't'){ - if(yych <= 'p') goto yy691; - goto yy51; - } else { - if(yych <= 'u') goto yy690; - if(yych <= 'z') goto yy51; - goto yy3; - } - } - } -yy23: - YYDEBUG(23, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'O'){ - if(yych <= '@') goto yy3; - if(yych == 'G') goto yy682; - goto yy48; - } else { - if(yych <= 'P') goto yy681; - if(yych == 'U') goto yy680; - goto yy48; - } - } else { - if(yych <= 'o'){ - if(yych <= '`') goto yy3; - if(yych == 'g') goto yy682; - goto yy48; - } else { - if(yych <= 't'){ - if(yych <= 'p') goto yy681; - goto yy48; - } else { - if(yych <= 'u') goto yy680; - if(yych <= 'z') goto yy48; - goto yy3; - } - } - } -yy24: - YYDEBUG(24, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'E'){ - if(yych <= '@') goto yy3; - if(yych <= 'A') goto yy633; - if(yych <= 'D') goto yy48; - goto yy632; - } else { - if(yych <= 'I'){ - if(yych <= 'H') goto yy48; - goto yy634; - } else { - if(yych == 'U') goto yy635; - goto yy48; - } - } - } else { - if(yych <= 'h'){ - if(yych <= 'a'){ - if(yych <= '`') goto yy3; - goto yy657; - } else { - if(yych == 'e') goto yy656; - goto yy51; - } - } else { - if(yych <= 't'){ - if(yych <= 'i') goto yy658; - goto yy51; - } else { - if(yych <= 'u') goto yy659; - if(yych <= 'z') goto yy51; - goto yy3; - } - } - } -yy25: - YYDEBUG(25, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'E'){ - if(yych <= '@') goto yy3; - if(yych <= 'A') goto yy633; - if(yych <= 'D') goto yy48; - goto yy632; - } else { - if(yych <= 'I'){ - if(yych <= 'H') goto yy48; - goto yy634; - } else { - if(yych == 'U') goto yy635; - goto yy48; - } - } - } else { - if(yych <= 'h'){ - if(yych <= 'a'){ - if(yych <= '`') goto yy3; - goto yy633; - } else { - if(yych == 'e') goto yy632; - goto yy48; - } - } else { - if(yych <= 't'){ - if(yych <= 'i') goto yy634; - goto yy48; - } else { - if(yych <= 'u') goto yy635; - if(yych <= 'z') goto yy48; - goto yy3; - } - } - } -yy26: - YYDEBUG(26, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'C') goto yy622; - goto yy48; - } else { - if(yych <= 'b'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'c') goto yy627; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy27: - YYDEBUG(27, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'C') goto yy622; - goto yy48; - } else { - if(yych <= 'b'){ - if(yych <= '`') goto yy3; - goto yy48; - } else { - if(yych <= 'c') goto yy622; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy28: - YYDEBUG(28, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'H'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy604; - goto yy48; - } else { - if(yych <= 'I') goto yy605; - if(yych == 'O') goto yy600; - goto yy48; - } - } else { - if(yych <= 'h'){ - if(yych <= '`') goto yy3; - if(yych == 'e') goto yy602; - goto yy51; - } else { - if(yych <= 'n'){ - if(yych <= 'i') goto yy603; - goto yy51; - } else { - if(yych <= 'o') goto yy601; - if(yych <= 'z') goto yy51; - goto yy3; - } - } - } -yy29: - YYDEBUG(29, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy503; - goto yy48; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'e') goto yy593; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy30: - YYDEBUG(30, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy503; - goto yy48; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy48; - } else { - if(yych <= 'e') goto yy503; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy31: - YYDEBUG(31, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'H'){ - if(yych <= 'D'){ - if(yych <= '@') goto yy3; - goto yy48; - } else { - if(yych <= 'E') goto yy469; - if(yych <= 'G') goto yy48; - goto yy470; - } - } else { - if(yych <= 'U'){ - if(yych <= 'T') goto yy48; - goto yy471; - } else { - if(yych == 'W') goto yy472; - goto yy48; - } - } - } else { - if(yych <= 'h'){ - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'e') goto yy465; - if(yych <= 'g') goto yy51; - goto yy466; - } - } else { - if(yych <= 'v'){ - if(yych == 'u') goto yy467; - goto yy51; - } else { - if(yych <= 'w') goto yy468; - if(yych <= 'z') goto yy51; - goto yy3; - } - } - } -yy32: - YYDEBUG(32, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'I'){ - if(yych <= '@') goto yy3; - if(yych <= 'H') goto yy48; - goto yy453; - } else { - if(yych == 'L') goto yy454; - goto yy48; - } - } else { - if(yych <= 'i'){ - if(yych <= '`') goto yy3; - if(yych <= 'h') goto yy51; - goto yy459; - } else { - if(yych == 'l') goto yy460; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy33: - YYDEBUG(33, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'I'){ - if(yych <= '@') goto yy3; - if(yych <= 'H') goto yy48; - goto yy453; - } else { - if(yych == 'L') goto yy454; - goto yy48; - } - } else { - if(yych <= 'i'){ - if(yych <= '`') goto yy3; - if(yych <= 'h') goto yy48; - goto yy453; - } else { - if(yych == 'l') goto yy454; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy34: - YYDEBUG(34, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych <= 'A') goto yy447; - goto yy48; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'a') goto yy450; - if(yych <= 'z') goto yy51; - goto yy3; - } -yy35: - YYDEBUG(35, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych <= 'A') goto yy447; - goto yy48; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'a') goto yy447; - if(yych <= 'z') goto yy48; - goto yy3; - } -yy36: - YYDEBUG(36, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'R') goto yy167; - goto yy48; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'r') goto yy308; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy37: - YYDEBUG(37, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'R') goto yy167; - goto yy48; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy3; - goto yy48; - } else { - if(yych <= 'r') goto yy167; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy38: - YYDEBUG(38, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy149; - goto yy48; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy51; - } else { - if(yych <= 'e') goto yy159; - if(yych <= 'z') goto yy51; - goto yy3; - } - } -yy39: - YYDEBUG(39, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy149; - goto yy48; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy48; - } else { - if(yych <= 'e') goto yy149; - if(yych <= 'z') goto yy48; - goto yy3; - } - } -yy40: - YYDEBUG(40, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy8; - if(yych <= '1') goto yy61; - if(yych <= '2') goto yy62; - if(yych <= '9') goto yy63; - goto yy8; -yy41: - YYDEBUG(41, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy48; - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy51; - goto yy3; -yy42: - YYDEBUG(42, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy48; - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy48; - goto yy3; -yy43: - YYDEBUG(43, *YYCURSOR); - ++YYCURSOR; - goto yy44; -yy44: - YYDEBUG(44, *YYCURSOR); - -#line 1355 "resource/parse_date.re" -{ - goto std; - } -#line 1767 "" -yy45: - YYDEBUG(45, *YYCURSOR); - ++YYCURSOR; - goto yy46; -yy46: - YYDEBUG(46, *YYCURSOR); - -#line 1360 "resource/parse_date.re" -{ - s->pos = cursor; s->line++; - goto std; - } -#line 1776 "" -yy47: - YYDEBUG(47, *YYCURSOR); - yych = *++YYCURSOR; - goto yy8; -yy48: - YYDEBUG(48, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy49; - if(yych <= '`') goto yy3; - if(yych >= '{') goto yy3; - goto yy49; -yy49: - YYDEBUG(49, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - if(yych <= '`') goto yy3; - if(yych >= '{') goto yy3; - goto yy50; -yy50: - YYDEBUG(50, *YYCURSOR); - yych = *++YYCURSOR; - goto yy3; -yy51: - YYDEBUG(51, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= '`') goto yy3; - if(yych >= '{') goto yy3; - goto yy52; - } - } -yy52: - YYDEBUG(52, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy50; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy53: - YYDEBUG(53, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@') goto yy54; - if(yych <= 'Z') goto yy55; - goto yy54; -yy54: - YYDEBUG(54, *YYCURSOR); - YYCURSOR = YYMARKER; - switch(yyaccept){ - case 11: goto yy802; - case 20: goto yy1269; - case 21: goto yy1277; - case 12: goto yy947; - case 18: goto yy1176; - case 8: goto yy562; - case 17: goto yy1041; - case 6: goto yy509; - case 10: goto yy788; - case 16: goto yy1074; - case 19: goto yy1085; - case 15: goto yy1067; - case 13: goto yy980; - case 14: goto yy1032; - case 9: goto yy684; - case 5: goto yy190; - case 4: goto yy158; - case 3: goto yy151; - case 1: goto yy3; - case 7: goto yy527; - case 2: goto yy85; - case 0: goto yy8; - } -yy55: - YYDEBUG(55, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 8) { - goto yy56; - } - goto yy54; -yy56: - YYDEBUG(56, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy57; -yy57: - YYDEBUG(57, *YYCURSOR); - if(yybm[0+yych] & 8) { - goto yy56; - } - if(yych == '/') goto yy53; - if(yych == '_') goto yy53; - goto yy3; -yy58: - YYDEBUG(58, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - if(yych >= '{') goto yy3; - goto yy59; - } -yy59: - YYDEBUG(59, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy60; -yy60: - YYDEBUG(60, *YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'z') goto yy59; - goto yy54; - } -yy61: - YYDEBUG(61, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': goto yy147; - case '6': - case '7': - case '8': - case '9': goto yy63; - case ':': goto yy64; - default: goto yy3; - } -yy62: - YYDEBUG(62, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': goto yy147; - case '4': - case '5': goto yy65; - case '6': - case '7': - case '8': - case '9': goto yy76; - case ':': goto yy64; - default: goto yy3; - } -yy63: - YYDEBUG(63, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': goto yy65; - case '6': - case '7': - case '8': - case '9': goto yy76; - case ':': goto yy64; - default: goto yy3; - } -yy64: - YYDEBUG(64, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy3; - if(yych <= '5') goto yy146; - goto yy3; -yy65: - YYDEBUG(65, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy145; - goto yy67; -yy66: - YYDEBUG(66, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy67; -yy67: - YYDEBUG(67, *YYCURSOR); - if(yybm[0+yych] & 16) { - goto yy66; - } - YYDEBUG(-1, yych); - switch(yych){ - case 'D': case 'd': goto yy71; - case 'F': case 'f': goto yy73; - case 'H': case 'h': goto yy70; - case 'M': case 'm': goto yy69; - case 'S': case 's': goto yy68; - case 'T': case 't': goto yy75; - case 'W': case 'w': goto yy72; - case 'Y': case 'y': goto yy74; - default: goto yy54; - } -yy68: - YYDEBUG(68, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'U'){ - if(yych <= 'D'){ - if(yych == 'A') goto yy131; - goto yy54; - } else { - if(yych <= 'E') goto yy133; - if(yych <= 'T') goto yy54; - goto yy132; - } - } else { - if(yych <= 'd'){ - if(yych == 'a') goto yy131; - goto yy54; - } else { - if(yych <= 'e') goto yy133; - if(yych == 'u') goto yy132; - goto yy54; - } - } -yy69: - YYDEBUG(69, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'O'){ - if(yych == 'I') goto yy123; - if(yych <= 'N') goto yy54; - goto yy122; - } else { - if(yych <= 'i'){ - if(yych <= 'h') goto yy54; - goto yy123; - } else { - if(yych == 'o') goto yy122; - goto yy54; - } - } -yy70: - YYDEBUG(70, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'O') goto yy120; - if(yych == 'o') goto yy120; - goto yy54; -yy71: - YYDEBUG(71, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy119; - if(yych == 'a') goto yy119; - goto yy54; -yy72: - YYDEBUG(72, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy111; - if(yych == 'e') goto yy111; - goto yy54; -yy73: - YYDEBUG(73, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'R'){ - if(yych == 'O') goto yy96; - if(yych <= 'Q') goto yy54; - goto yy95; - } else { - if(yych <= 'o'){ - if(yych <= 'n') goto yy54; - goto yy96; - } else { - if(yych == 'r') goto yy95; - goto yy54; - } - } -yy74: - YYDEBUG(74, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy92; - if(yych == 'e') goto yy92; - goto yy54; -yy75: - YYDEBUG(75, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'U'){ - if(yych == 'H') goto yy78; - if(yych <= 'T') goto yy54; - goto yy79; - } else { - if(yych <= 'h'){ - if(yych <= 'g') goto yy54; - goto yy78; - } else { - if(yych == 'u') goto yy79; - goto yy54; - } - } -yy76: - YYDEBUG(76, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy77; -yy77: - YYDEBUG(77, *YYCURSOR); - if(yybm[0+yych] & 16) { - goto yy66; - } - YYDEBUG(-1, yych); - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy76; - case 'D': case 'd': goto yy71; - case 'F': case 'f': goto yy73; - case 'H': case 'h': goto yy70; - case 'M': case 'm': goto yy69; - case 'S': case 's': goto yy68; - case 'T': case 't': goto yy75; - case 'W': case 'w': goto yy72; - case 'Y': case 'y': goto yy74; - default: goto yy54; - } -yy78: - YYDEBUG(78, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy87; - if(yych == 'u') goto yy87; - goto yy54; -yy79: - YYDEBUG(79, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy80; - if(yych != 'e') goto yy54; - goto yy80; -yy80: - YYDEBUG(80, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy81; - if(yych != 's') goto yy54; - goto yy81; -yy81: - YYDEBUG(81, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy82; - if(yych != 'd') goto yy54; - goto yy82; -yy82: - YYDEBUG(82, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy83; - if(yych != 'a') goto yy54; - goto yy83; -yy83: - YYDEBUG(83, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych != 'y') goto yy54; - goto yy84; -yy84: - YYDEBUG(84, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych == '+') goto yy86; - if(yych == '-') goto yy86; - goto yy85; -yy85: - YYDEBUG(85, *YYCURSOR); - -#line 1339 "resource/parse_date.re" -{ - timelib_ull i; - DEBUG_OUTPUT("relative"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_unsigned_nr((char **) &ptr, 24); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 0, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 2166 "" -yy86: - YYDEBUG(86, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 32) { - goto yy76; - } - goto yy54; -yy87: - YYDEBUG(87, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy88; - if(yych != 'r') goto yy54; - goto yy88; -yy88: - YYDEBUG(88, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy89; - if(yych != 's') goto yy54; - goto yy89; -yy89: - YYDEBUG(89, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy90; - if(yych != 'd') goto yy54; - goto yy90; -yy90: - YYDEBUG(90, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy91; - if(yych != 'a') goto yy54; - goto yy91; -yy91: - YYDEBUG(91, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy92: - YYDEBUG(92, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy93; - if(yych != 'a') goto yy54; - goto yy93; -yy93: - YYDEBUG(93, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy94; - if(yych != 'r') goto yy54; - goto yy94; -yy94: - YYDEBUG(94, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= '-'){ - if(yych == '+') goto yy86; - if(yych <= ',') goto yy85; - goto yy86; - } else { - if(yych <= 'S'){ - if(yych <= 'R') goto yy85; - goto yy84; - } else { - if(yych == 's') goto yy84; - goto yy85; - } - } -yy95: - YYDEBUG(95, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy108; - if(yych == 'i') goto yy108; - goto yy54; -yy96: - YYDEBUG(96, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy97; - if(yych != 'r') goto yy54; - goto yy97; -yy97: - YYDEBUG(97, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy98; - if(yych != 't') goto yy54; - goto yy98; -yy98: - YYDEBUG(98, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'N'){ - if(yych == 'H') goto yy100; - if(yych <= 'M') goto yy54; - goto yy99; - } else { - if(yych <= 'h'){ - if(yych <= 'g') goto yy54; - goto yy100; - } else { - if(yych != 'n') goto yy54; - goto yy99; - } - } -yy99: - YYDEBUG(99, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy105; - if(yych == 'i') goto yy105; - goto yy54; -yy100: - YYDEBUG(100, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy101; - if(yych != 'n') goto yy54; - goto yy101; -yy101: - YYDEBUG(101, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy102; - if(yych != 'i') goto yy54; - goto yy102; -yy102: - YYDEBUG(102, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'G') goto yy103; - if(yych != 'g') goto yy54; - goto yy103; -yy103: - YYDEBUG(103, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy104; - if(yych != 'h') goto yy54; - goto yy104; -yy104: - YYDEBUG(104, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy94; - if(yych == 't') goto yy94; - goto yy54; -yy105: - YYDEBUG(105, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'G') goto yy106; - if(yych != 'g') goto yy54; - goto yy106; -yy106: - YYDEBUG(106, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy107; - if(yych != 'h') goto yy54; - goto yy107; -yy107: - YYDEBUG(107, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy94; - if(yych == 't') goto yy94; - goto yy54; -yy108: - YYDEBUG(108, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy109; - if(yych != 'd') goto yy54; - goto yy109; -yy109: - YYDEBUG(109, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy110; - if(yych != 'a') goto yy54; - goto yy110; -yy110: - YYDEBUG(110, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy111: - YYDEBUG(111, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'E'){ - if(yych <= 'C') goto yy54; - if(yych <= 'D') goto yy113; - goto yy112; - } else { - if(yych <= 'c') goto yy54; - if(yych <= 'd') goto yy113; - if(yych >= 'f') goto yy54; - goto yy112; - } -yy112: - YYDEBUG(112, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'K') goto yy94; - if(yych == 'k') goto yy94; - goto yy54; -yy113: - YYDEBUG(113, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy114; - if(yych != 'n') goto yy54; - goto yy114; -yy114: - YYDEBUG(114, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy115; - if(yych != 'e') goto yy54; - goto yy115; -yy115: - YYDEBUG(115, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy116; - if(yych != 's') goto yy54; - goto yy116; -yy116: - YYDEBUG(116, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy117; - if(yych != 'd') goto yy54; - goto yy117; -yy117: - YYDEBUG(117, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy118; - if(yych != 'a') goto yy54; - goto yy118; -yy118: - YYDEBUG(118, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy119: - YYDEBUG(119, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy94; - if(yych == 'y') goto yy94; - goto yy54; -yy120: - YYDEBUG(120, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy121; - if(yych != 'u') goto yy54; - goto yy121; -yy121: - YYDEBUG(121, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy94; - if(yych == 'r') goto yy94; - goto yy54; -yy122: - YYDEBUG(122, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy127; - if(yych == 'n') goto yy127; - goto yy54; -yy123: - YYDEBUG(123, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy124; - if(yych != 'n') goto yy54; - goto yy124; -yy124: - YYDEBUG(124, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= 'S'){ - if(yych <= ','){ - if(yych == '+') goto yy86; - goto yy85; - } else { - if(yych <= '-') goto yy86; - if(yych <= 'R') goto yy85; - goto yy84; - } - } else { - if(yych <= 'r'){ - if(yych != 'U') goto yy85; - goto yy125; - } else { - if(yych <= 's') goto yy84; - if(yych != 'u') goto yy85; - goto yy125; - } - } -yy125: - YYDEBUG(125, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy126; - if(yych != 't') goto yy54; - goto yy126; -yy126: - YYDEBUG(126, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy94; - if(yych == 'e') goto yy94; - goto yy54; -yy127: - YYDEBUG(127, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'T'){ - if(yych == 'D') goto yy128; - if(yych <= 'S') goto yy54; - goto yy129; - } else { - if(yych <= 'd'){ - if(yych <= 'c') goto yy54; - goto yy128; - } else { - if(yych == 't') goto yy129; - goto yy54; - } - } -yy128: - YYDEBUG(128, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy130; - if(yych == 'a') goto yy130; - goto yy54; -yy129: - YYDEBUG(129, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy94; - if(yych == 'h') goto yy94; - goto yy54; -yy130: - YYDEBUG(130, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy131: - YYDEBUG(131, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy140; - if(yych == 't') goto yy140; - goto yy54; -yy132: - YYDEBUG(132, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy137; - if(yych == 'n') goto yy137; - goto yy54; -yy133: - YYDEBUG(133, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'C') goto yy134; - if(yych != 'c') goto yy54; - goto yy134; -yy134: - YYDEBUG(134, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= 'O'){ - if(yych <= ','){ - if(yych == '+') goto yy86; - goto yy85; - } else { - if(yych <= '-') goto yy86; - if(yych <= 'N') goto yy85; - goto yy135; - } - } else { - if(yych <= 'n'){ - if(yych == 'S') goto yy84; - goto yy85; - } else { - if(yych <= 'o') goto yy135; - if(yych == 's') goto yy84; - goto yy85; - } - } -yy135: - YYDEBUG(135, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy136; - if(yych != 'n') goto yy54; - goto yy136; -yy136: - YYDEBUG(136, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy94; - if(yych == 'd') goto yy94; - goto yy54; -yy137: - YYDEBUG(137, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy138; - if(yych != 'd') goto yy54; - goto yy138; -yy138: - YYDEBUG(138, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy139; - if(yych != 'a') goto yy54; - goto yy139; -yy139: - YYDEBUG(139, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy140: - YYDEBUG(140, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy141; - if(yych != 'u') goto yy54; - goto yy141; -yy141: - YYDEBUG(141, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy142; - if(yych != 'r') goto yy54; - goto yy142; -yy142: - YYDEBUG(142, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy143; - if(yych != 'd') goto yy54; - goto yy143; -yy143: - YYDEBUG(143, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy144; - if(yych != 'a') goto yy54; - goto yy144; -yy144: - YYDEBUG(144, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy84; - if(yych == 'y') goto yy84; - goto yy54; -yy145: - YYDEBUG(145, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= 'X'){ - if(yych <= 'G'){ - if(yych <= 'C'){ - if(yych == ' ') goto yy67; - goto yy3; - } else { - if(yych == 'E') goto yy3; - if(yych <= 'F') goto yy67; - goto yy3; - } - } else { - if(yych <= 'R'){ - if(yych <= 'H') goto yy67; - if(yych == 'M') goto yy67; - goto yy3; - } else { - if(yych <= 'T') goto yy67; - if(yych == 'W') goto yy67; - goto yy3; - } - } - } else { - if(yych <= 'l'){ - if(yych <= 'e'){ - if(yych <= 'Y') goto yy67; - if(yych == 'd') goto yy67; - goto yy3; - } else { - if(yych == 'g') goto yy3; - if(yych <= 'h') goto yy67; - goto yy3; - } - } else { - if(yych <= 'v'){ - if(yych <= 'm') goto yy67; - if(yych <= 'r') goto yy3; - if(yych <= 't') goto yy67; - goto yy3; - } else { - if(yych == 'x') goto yy3; - if(yych <= 'y') goto yy67; - goto yy3; - } - } - } -yy146: - YYDEBUG(146, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy50; - goto yy54; -yy147: - YYDEBUG(147, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': goto yy148; - case '6': - case '7': - case '8': - case '9': goto yy145; - case ':': goto yy64; - default: goto yy3; - } -yy148: - YYDEBUG(148, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy145; - default: goto yy3; - } -yy149: - YYDEBUG(149, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'D') goto yy49; - goto yy150; - } else { - if(yych <= 'c'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'd') goto yy150; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy150: - YYDEBUG(150, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych == 'N') goto yy152; - goto yy50; - } else { - if(yych <= 'm'){ - if(yych >= 'a') goto yy50; - goto yy151; - } else { - if(yych <= 'n') goto yy152; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy151: - YYDEBUG(151, *YYCURSOR); - -#line 1294 "resource/parse_date.re" -{ - DEBUG_OUTPUT("dayabbr"); - goto std; - } -#line 2730 "" -yy152: - YYDEBUG(152, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy153; - if(yych != 'e') goto yy3; - goto yy153; -yy153: - YYDEBUG(153, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'S') goto yy154; - if(yych != 's') goto yy54; - goto yy154; -yy154: - YYDEBUG(154, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy155; - if(yych != 'd') goto yy54; - goto yy155; -yy155: - YYDEBUG(155, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy156; - if(yych != 'a') goto yy54; - goto yy156; -yy156: - YYDEBUG(156, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych != 'y') goto yy54; - goto yy157; -yy157: - YYDEBUG(157, *YYCURSOR); - ++YYCURSOR; - goto yy158; -yy158: - YYDEBUG(158, *YYCURSOR); - -#line 1277 "resource/parse_date.re" -{ - const timelib_relunit* relunit; - DEBUG_OUTPUT("dayfull"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - relunit = timelib_lookup_relunit((char**) &ptr); - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = 1; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 2771 "" -yy159: - YYDEBUG(159, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'D') goto yy150; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'd') goto yy160; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy160: - YYDEBUG(160, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'N') goto yy152; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'n') goto yy161; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy161: - YYDEBUG(161, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'E') goto yy153; - goto yy3; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'e') goto yy162; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy162: - YYDEBUG(162, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'S') goto yy154; - if(yych != 's') goto yy60; - goto yy163; -yy163: - YYDEBUG(163, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy155; - if(yych != 'd') goto yy60; - goto yy164; -yy164: - YYDEBUG(164, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy156; - if(yych != 'a') goto yy60; - goto yy165; -yy165: - YYDEBUG(165, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych != 'y') goto yy60; - goto yy166; -yy166: - YYDEBUG(166, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy53; - goto yy158; - } else { - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy158; - if(yych <= 'z') goto yy59; - goto yy158; - } -yy167: - YYDEBUG(167, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'E') goto yy49; - goto yy168; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'e') goto yy168; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy168: - YYDEBUG(168, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'V') goto yy50; - goto yy169; - } else { - if(yych <= 'u'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'v') goto yy169; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy169: - YYDEBUG(169, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'I') goto yy170; - if(yych != 'i') goto yy3; - goto yy170; -yy170: - YYDEBUG(170, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'O') goto yy171; - if(yych != 'o') goto yy54; - goto yy171; -yy171: - YYDEBUG(171, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy172; - if(yych != 'u') goto yy54; - goto yy172; -yy172: - YYDEBUG(172, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy173; - if(yych != 's') goto yy54; - goto yy173; -yy173: - YYDEBUG(173, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy174; -yy174: - YYDEBUG(174, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': goto yy173; - case 'D': case 'd': goto yy178; - case 'F': case 'f': goto yy180; - case 'H': case 'h': goto yy177; - case 'M': case 'm': goto yy176; - case 'S': case 's': goto yy175; - case 'T': case 't': goto yy182; - case 'W': case 'w': goto yy179; - case 'Y': case 'y': goto yy181; - default: goto yy54; - } -yy175: - YYDEBUG(175, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'U'){ - if(yych <= 'D'){ - if(yych == 'A') goto yy294; - goto yy54; - } else { - if(yych <= 'E') goto yy296; - if(yych <= 'T') goto yy54; - goto yy295; - } - } else { - if(yych <= 'd'){ - if(yych == 'a') goto yy294; - goto yy54; - } else { - if(yych <= 'e') goto yy296; - if(yych == 'u') goto yy295; - goto yy54; - } - } -yy176: - YYDEBUG(176, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'O'){ - if(yych == 'I') goto yy286; - if(yych <= 'N') goto yy54; - goto yy285; - } else { - if(yych <= 'i'){ - if(yych <= 'h') goto yy54; - goto yy286; - } else { - if(yych == 'o') goto yy285; - goto yy54; - } - } -yy177: - YYDEBUG(177, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'O') goto yy283; - if(yych == 'o') goto yy283; - goto yy54; -yy178: - YYDEBUG(178, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy282; - if(yych == 'a') goto yy282; - goto yy54; -yy179: - YYDEBUG(179, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy274; - if(yych == 'e') goto yy274; - goto yy54; -yy180: - YYDEBUG(180, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'R'){ - if(yych == 'O') goto yy259; - if(yych <= 'Q') goto yy54; - goto yy258; - } else { - if(yych <= 'o'){ - if(yych <= 'n') goto yy54; - goto yy259; - } else { - if(yych == 'r') goto yy258; - goto yy54; - } - } -yy181: - YYDEBUG(181, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy253; - if(yych == 'e') goto yy253; - goto yy54; -yy182: - YYDEBUG(182, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'U'){ - if(yych == 'H') goto yy183; - if(yych <= 'T') goto yy54; - goto yy184; - } else { - if(yych <= 'h'){ - if(yych <= 'g') goto yy54; - goto yy183; - } else { - if(yych == 'u') goto yy184; - goto yy54; - } - } -yy183: - YYDEBUG(183, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy248; - if(yych == 'u') goto yy248; - goto yy54; -yy184: - YYDEBUG(184, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy185; - if(yych != 'e') goto yy54; - goto yy185; -yy185: - YYDEBUG(185, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy186; - if(yych != 's') goto yy54; - goto yy186; -yy186: - YYDEBUG(186, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy187; - if(yych != 'd') goto yy54; - goto yy187; -yy187: - YYDEBUG(187, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy188; - if(yych != 'a') goto yy54; - goto yy188; -yy188: - YYDEBUG(188, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych != 'y') goto yy54; - goto yy189; -yy189: - YYDEBUG(189, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'E': case 'e': goto yy195; - case 'F': case 'f': goto yy191; - case 'L': case 'l': goto yy196; - case 'N': case 'n': goto yy192; - case 'P': case 'p': goto yy197; - case 'S': case 's': goto yy193; - case 'T': case 't': goto yy194; - default: goto yy190; - } -yy190: - YYDEBUG(190, *YYCURSOR); - -#line 1260 "resource/parse_date.re" -{ - timelib_sll i; - int behavior; - DEBUG_OUTPUT("relativetext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_relative_text((char **) &ptr, &behavior); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, behavior, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 3090 "" -yy191: - YYDEBUG(191, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'O'){ - if(yych == 'I') goto yy239; - if(yych <= 'N') goto yy54; - goto yy240; - } else { - if(yych <= 'i'){ - if(yych <= 'h') goto yy54; - goto yy239; - } else { - if(yych == 'o') goto yy240; - goto yy54; - } - } -yy192: - YYDEBUG(192, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'I'){ - if(yych == 'E') goto yy235; - if(yych <= 'H') goto yy54; - goto yy234; - } else { - if(yych <= 'e'){ - if(yych <= 'd') goto yy54; - goto yy235; - } else { - if(yych == 'i') goto yy234; - goto yy54; - } - } -yy193: - YYDEBUG(193, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'I'){ - if(yych == 'E') goto yy223; - if(yych <= 'H') goto yy54; - goto yy224; - } else { - if(yych <= 'e'){ - if(yych <= 'd') goto yy54; - goto yy223; - } else { - if(yych == 'i') goto yy224; - goto yy54; - } - } -yy194: - YYDEBUG(194, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'W'){ - if(yych <= 'G'){ - if(yych == 'E') goto yy214; - goto yy54; - } else { - if(yych <= 'H') goto yy212; - if(yych <= 'V') goto yy54; - goto yy213; - } - } else { - if(yych <= 'g'){ - if(yych == 'e') goto yy214; - goto yy54; - } else { - if(yych <= 'h') goto yy212; - if(yych == 'w') goto yy213; - goto yy54; - } - } -yy195: - YYDEBUG(195, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'L'){ - if(yych == 'I') goto yy204; - if(yych <= 'K') goto yy54; - goto yy203; - } else { - if(yych <= 'i'){ - if(yych <= 'h') goto yy54; - goto yy204; - } else { - if(yych == 'l') goto yy203; - goto yy54; - } - } -yy196: - YYDEBUG(196, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy201; - if(yych == 'a') goto yy201; - goto yy54; -yy197: - YYDEBUG(197, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy198; - if(yych != 'r') goto yy54; - goto yy198; -yy198: - YYDEBUG(198, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy199; - if(yych != 'e') goto yy54; - goto yy199; -yy199: - YYDEBUG(199, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'V') goto yy200; - if(yych != 'v') goto yy54; - goto yy200; -yy200: - YYDEBUG(200, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy170; - if(yych == 'i') goto yy170; - goto yy54; -yy201: - YYDEBUG(201, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy202; - if(yych != 's') goto yy54; - goto yy202; -yy202: - YYDEBUG(202, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy54; -yy203: - YYDEBUG(203, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy207; - if(yych == 'e') goto yy207; - goto yy54; -yy204: - YYDEBUG(204, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'G') goto yy205; - if(yych != 'g') goto yy54; - goto yy205; -yy205: - YYDEBUG(205, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy206; - if(yych != 'h') goto yy54; - goto yy206; -yy206: - YYDEBUG(206, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy54; -yy207: - YYDEBUG(207, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'V') goto yy208; - if(yych != 'v') goto yy54; - goto yy208; -yy208: - YYDEBUG(208, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy209; - if(yych != 'e') goto yy54; - goto yy209; -yy209: - YYDEBUG(209, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy210; - if(yych != 'n') goto yy54; - goto yy210; -yy210: - YYDEBUG(210, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy211; - if(yych != 't') goto yy54; - goto yy211; -yy211: - YYDEBUG(211, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy212: - YYDEBUG(212, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy221; - if(yych == 'i') goto yy221; - goto yy54; -yy213: - YYDEBUG(213, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy217; - if(yych == 'e') goto yy217; - goto yy54; -yy214: - YYDEBUG(214, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy215; - if(yych != 'n') goto yy54; - goto yy215; -yy215: - YYDEBUG(215, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy216; - if(yych != 't') goto yy54; - goto yy216; -yy216: - YYDEBUG(216, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy217: - YYDEBUG(217, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'L') goto yy218; - if(yych != 'l') goto yy54; - goto yy218; -yy218: - YYDEBUG(218, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'F') goto yy219; - if(yych != 'f') goto yy54; - goto yy219; -yy219: - YYDEBUG(219, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy220; - if(yych != 't') goto yy54; - goto yy220; -yy220: - YYDEBUG(220, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy221: - YYDEBUG(221, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'S'){ - if(yych <= 'Q') goto yy54; - if(yych >= 'S') goto yy173; - goto yy222; - } else { - if(yych <= 'q') goto yy54; - if(yych <= 'r') goto yy222; - if(yych <= 's') goto yy173; - goto yy54; - } -yy222: - YYDEBUG(222, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy173; - if(yych == 'd') goto yy173; - goto yy54; -yy223: - YYDEBUG(223, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'V'){ - if(yych == 'C') goto yy227; - if(yych <= 'U') goto yy54; - goto yy228; - } else { - if(yych <= 'c'){ - if(yych <= 'b') goto yy54; - goto yy227; - } else { - if(yych == 'v') goto yy228; - goto yy54; - } - } -yy224: - YYDEBUG(224, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'X') goto yy225; - if(yych != 'x') goto yy54; - goto yy225; -yy225: - YYDEBUG(225, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy226; - if(yych != 't') goto yy54; - goto yy226; -yy226: - YYDEBUG(226, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy227: - YYDEBUG(227, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'O') goto yy232; - if(yych == 'o') goto yy232; - goto yy54; -yy228: - YYDEBUG(228, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy229; - if(yych != 'e') goto yy54; - goto yy229; -yy229: - YYDEBUG(229, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy230; - if(yych != 'n') goto yy54; - goto yy230; -yy230: - YYDEBUG(230, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy231; - if(yych != 't') goto yy54; - goto yy231; -yy231: - YYDEBUG(231, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy232: - YYDEBUG(232, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy233; - if(yych != 'n') goto yy54; - goto yy233; -yy233: - YYDEBUG(233, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy173; - if(yych == 'd') goto yy173; - goto yy54; -yy234: - YYDEBUG(234, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy237; - if(yych == 'n') goto yy237; - goto yy54; -yy235: - YYDEBUG(235, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'X') goto yy236; - if(yych != 'x') goto yy54; - goto yy236; -yy236: - YYDEBUG(236, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy54; -yy237: - YYDEBUG(237, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy238; - if(yych != 't') goto yy54; - goto yy238; -yy238: - YYDEBUG(238, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy239: - YYDEBUG(239, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'R'){ - if(yych == 'F') goto yy245; - if(yych <= 'Q') goto yy54; - goto yy244; - } else { - if(yych <= 'f'){ - if(yych <= 'e') goto yy54; - goto yy245; - } else { - if(yych == 'r') goto yy244; - goto yy54; - } - } -yy240: - YYDEBUG(240, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy241; - if(yych != 'u') goto yy54; - goto yy241; -yy241: - YYDEBUG(241, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy242; - if(yych != 'r') goto yy54; - goto yy242; -yy242: - YYDEBUG(242, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy243; - if(yych != 't') goto yy54; - goto yy243; -yy243: - YYDEBUG(243, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy244: - YYDEBUG(244, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy247; - if(yych == 's') goto yy247; - goto yy54; -yy245: - YYDEBUG(245, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy246; - if(yych != 't') goto yy54; - goto yy246; -yy246: - YYDEBUG(246, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy54; -yy247: - YYDEBUG(247, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy54; -yy248: - YYDEBUG(248, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy249; - if(yych != 'r') goto yy54; - goto yy249; -yy249: - YYDEBUG(249, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy250; - if(yych != 's') goto yy54; - goto yy250; -yy250: - YYDEBUG(250, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy251; - if(yych != 'd') goto yy54; - goto yy251; -yy251: - YYDEBUG(251, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy252; - if(yych != 'a') goto yy54; - goto yy252; -yy252: - YYDEBUG(252, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy253: - YYDEBUG(253, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy254; - if(yych != 'a') goto yy54; - goto yy254; -yy254: - YYDEBUG(254, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy255; - if(yych != 'r') goto yy54; - goto yy255; -yy255: - YYDEBUG(255, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'E': case 'e': goto yy195; - case 'F': case 'f': goto yy191; - case 'L': case 'l': goto yy196; - case 'N': case 'n': goto yy192; - case 'P': case 'p': goto yy197; - case 'S': case 's': goto yy256; - case 'T': case 't': goto yy194; - default: goto yy190; - } -yy256: - YYDEBUG(256, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'E': case 'e': goto yy257; - case 'F': case 'f': goto yy191; - case 'I': case 'i': goto yy224; - case 'L': case 'l': goto yy196; - case 'N': case 'n': goto yy192; - case 'P': case 'p': goto yy197; - case 'S': case 's': goto yy193; - case 'T': case 't': goto yy194; - default: goto yy190; - } -yy257: - YYDEBUG(257, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'V'){ - if(yych <= 'I'){ - if(yych == 'C') goto yy227; - if(yych <= 'H') goto yy54; - goto yy204; - } else { - if(yych == 'L') goto yy203; - if(yych <= 'U') goto yy54; - goto yy228; - } - } else { - if(yych <= 'i'){ - if(yych == 'c') goto yy227; - if(yych <= 'h') goto yy54; - goto yy204; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy203; - } else { - if(yych == 'v') goto yy228; - goto yy54; - } - } - } -yy258: - YYDEBUG(258, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy271; - if(yych == 'i') goto yy271; - goto yy54; -yy259: - YYDEBUG(259, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy260; - if(yych != 'r') goto yy54; - goto yy260; -yy260: - YYDEBUG(260, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy261; - if(yych != 't') goto yy54; - goto yy261; -yy261: - YYDEBUG(261, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'N'){ - if(yych == 'H') goto yy263; - if(yych <= 'M') goto yy54; - goto yy262; - } else { - if(yych <= 'h'){ - if(yych <= 'g') goto yy54; - goto yy263; - } else { - if(yych != 'n') goto yy54; - goto yy262; - } - } -yy262: - YYDEBUG(262, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy268; - if(yych == 'i') goto yy268; - goto yy54; -yy263: - YYDEBUG(263, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy264; - if(yych != 'n') goto yy54; - goto yy264; -yy264: - YYDEBUG(264, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'I') goto yy265; - if(yych != 'i') goto yy54; - goto yy265; -yy265: - YYDEBUG(265, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'G') goto yy266; - if(yych != 'g') goto yy54; - goto yy266; -yy266: - YYDEBUG(266, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy267; - if(yych != 'h') goto yy54; - goto yy267; -yy267: - YYDEBUG(267, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy255; - if(yych == 't') goto yy255; - goto yy54; -yy268: - YYDEBUG(268, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'G') goto yy269; - if(yych != 'g') goto yy54; - goto yy269; -yy269: - YYDEBUG(269, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy270; - if(yych != 'h') goto yy54; - goto yy270; -yy270: - YYDEBUG(270, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy255; - if(yych == 't') goto yy255; - goto yy54; -yy271: - YYDEBUG(271, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy272; - if(yych != 'd') goto yy54; - goto yy272; -yy272: - YYDEBUG(272, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy273; - if(yych != 'a') goto yy54; - goto yy273; -yy273: - YYDEBUG(273, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy274: - YYDEBUG(274, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'E'){ - if(yych <= 'C') goto yy54; - if(yych <= 'D') goto yy276; - goto yy275; - } else { - if(yych <= 'c') goto yy54; - if(yych <= 'd') goto yy276; - if(yych >= 'f') goto yy54; - goto yy275; - } -yy275: - YYDEBUG(275, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'K') goto yy255; - if(yych == 'k') goto yy255; - goto yy54; -yy276: - YYDEBUG(276, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy277; - if(yych != 'n') goto yy54; - goto yy277; -yy277: - YYDEBUG(277, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy278; - if(yych != 'e') goto yy54; - goto yy278; -yy278: - YYDEBUG(278, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'S') goto yy279; - if(yych != 's') goto yy54; - goto yy279; -yy279: - YYDEBUG(279, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy280; - if(yych != 'd') goto yy54; - goto yy280; -yy280: - YYDEBUG(280, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy281; - if(yych != 'a') goto yy54; - goto yy281; -yy281: - YYDEBUG(281, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy282: - YYDEBUG(282, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy255; - if(yych == 'y') goto yy255; - goto yy54; -yy283: - YYDEBUG(283, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy284; - if(yych != 'u') goto yy54; - goto yy284; -yy284: - YYDEBUG(284, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy255; - if(yych == 'r') goto yy255; - goto yy54; -yy285: - YYDEBUG(285, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy290; - if(yych == 'n') goto yy290; - goto yy54; -yy286: - YYDEBUG(286, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy287; - if(yych != 'n') goto yy54; - goto yy287; -yy287: - YYDEBUG(287, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'E': case 'e': goto yy195; - case 'F': case 'f': goto yy191; - case 'L': case 'l': goto yy196; - case 'N': case 'n': goto yy192; - case 'P': case 'p': goto yy197; - case 'S': case 's': goto yy256; - case 'T': case 't': goto yy194; - case 'U': case 'u': goto yy288; - default: goto yy190; - } -yy288: - YYDEBUG(288, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy289; - if(yych != 't') goto yy54; - goto yy289; -yy289: - YYDEBUG(289, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'E') goto yy255; - if(yych == 'e') goto yy255; - goto yy54; -yy290: - YYDEBUG(290, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 'T'){ - if(yych == 'D') goto yy291; - if(yych <= 'S') goto yy54; - goto yy292; - } else { - if(yych <= 'd'){ - if(yych <= 'c') goto yy54; - goto yy291; - } else { - if(yych == 't') goto yy292; - goto yy54; - } - } -yy291: - YYDEBUG(291, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy293; - if(yych == 'a') goto yy293; - goto yy54; -yy292: - YYDEBUG(292, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'H') goto yy255; - if(yych == 'h') goto yy255; - goto yy54; -yy293: - YYDEBUG(293, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy294: - YYDEBUG(294, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'T') goto yy303; - if(yych == 't') goto yy303; - goto yy54; -yy295: - YYDEBUG(295, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy300; - if(yych == 'n') goto yy300; - goto yy54; -yy296: - YYDEBUG(296, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'C') goto yy297; - if(yych != 'c') goto yy54; - goto yy297; -yy297: - YYDEBUG(297, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'E': case 'e': goto yy195; - case 'F': case 'f': goto yy191; - case 'L': case 'l': goto yy196; - case 'N': case 'n': goto yy192; - case 'O': case 'o': goto yy298; - case 'P': case 'p': goto yy197; - case 'S': case 's': goto yy256; - case 'T': case 't': goto yy194; - default: goto yy190; - } -yy298: - YYDEBUG(298, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'N') goto yy299; - if(yych != 'n') goto yy54; - goto yy299; -yy299: - YYDEBUG(299, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy255; - if(yych == 'd') goto yy255; - goto yy54; -yy300: - YYDEBUG(300, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy301; - if(yych != 'd') goto yy54; - goto yy301; -yy301: - YYDEBUG(301, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy302; - if(yych != 'a') goto yy54; - goto yy302; -yy302: - YYDEBUG(302, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy303: - YYDEBUG(303, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy304; - if(yych != 'u') goto yy54; - goto yy304; -yy304: - YYDEBUG(304, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'R') goto yy305; - if(yych != 'r') goto yy54; - goto yy305; -yy305: - YYDEBUG(305, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'D') goto yy306; - if(yych != 'd') goto yy54; - goto yy306; -yy306: - YYDEBUG(306, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'A') goto yy307; - if(yych != 'a') goto yy54; - goto yy307; -yy307: - YYDEBUG(307, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'Y') goto yy189; - if(yych == 'y') goto yy189; - goto yy54; -yy308: - YYDEBUG(308, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'E') goto yy168; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy309; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy309: - YYDEBUG(309, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'V') goto yy169; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'v') goto yy310; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy310: - YYDEBUG(310, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'I') goto yy170; - goto yy3; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'i') goto yy311; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy311: - YYDEBUG(311, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'O') goto yy171; - goto yy54; - } - } else { - if(yych <= 'n'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'o') goto yy312; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy312: - YYDEBUG(312, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'U') goto yy172; - goto yy54; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'u') goto yy313; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy313: - YYDEBUG(313, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy173; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy314: - YYDEBUG(314, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case ' ': goto yy173; - case '/': case '_': goto yy53; - case 'D': goto yy178; - case 'F': goto yy180; - case 'H': goto yy177; - case 'M': goto yy176; - case 'S': goto yy175; - case 'T': goto yy182; - case 'W': goto yy179; - case 'Y': goto yy181; - case 'a': - case 'b': - case 'c': case 'e': case 'g': case 'i': - case 'j': - case 'k': - case 'l': case 'n': - case 'o': - case 'p': - case 'q': - case 'r': case 'u': - case 'v': case 'x': case 'z': goto yy59; - case 'd': goto yy318; - case 'f': goto yy320; - case 'h': goto yy317; - case 'm': goto yy316; - case 's': goto yy315; - case 't': goto yy322; - case 'w': goto yy319; - case 'y': goto yy321; - default: goto yy54; - } -yy315: - YYDEBUG(315, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'A'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy54; - goto yy294; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy54; - goto yy296; - } else { - if(yych == 'U') goto yy295; - goto yy54; - } - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'a') goto yy433; - goto yy59; - } else { - if(yych <= 't'){ - if(yych <= 'e') goto yy434; - goto yy59; - } else { - if(yych <= 'u') goto yy435; - if(yych <= 'z') goto yy59; - goto yy54; - } - } - } -yy316: - YYDEBUG(316, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'H'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'I') goto yy286; - if(yych == 'O') goto yy285; - goto yy54; - } - } else { - if(yych <= 'i'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'h') goto yy59; - goto yy424; - } else { - if(yych == 'o') goto yy425; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy317: - YYDEBUG(317, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'O') goto yy283; - goto yy54; - } - } else { - if(yych <= 'n'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'o') goto yy422; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy318: - YYDEBUG(318, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy282; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy421; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy319: - YYDEBUG(319, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy274; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy413; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy320: - YYDEBUG(320, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'N'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'O') goto yy259; - if(yych == 'R') goto yy258; - goto yy54; - } - } else { - if(yych <= 'o'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'n') goto yy59; - goto yy397; - } else { - if(yych == 'r') goto yy398; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy321: - YYDEBUG(321, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy253; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy392; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy322: - YYDEBUG(322, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'G'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'H') goto yy183; - if(yych == 'U') goto yy184; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'g') goto yy59; - goto yy323; - } else { - if(yych == 'u') goto yy324; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy323: - YYDEBUG(323, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'U') goto yy248; - goto yy54; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'u') goto yy387; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy324: - YYDEBUG(324, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy185; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy325; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy325: - YYDEBUG(325, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy186; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy326; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy326: - YYDEBUG(326, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy187; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy327; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy327: - YYDEBUG(327, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy188; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy328; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy328: - YYDEBUG(328, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy329: - YYDEBUG(329, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '/': case '_': goto yy53; - case 'E': goto yy195; - case 'F': goto yy191; - case 'L': goto yy196; - case 'N': goto yy192; - case 'P': goto yy197; - case 'S': goto yy193; - case 'T': goto yy194; - case 'a': - case 'b': - case 'c': - case 'd': case 'g': - case 'h': - case 'i': - case 'j': - case 'k': case 'm': case 'o': case 'q': - case 'r': case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy59; - case 'e': goto yy330; - case 'f': goto yy331; - case 'l': goto yy332; - case 'n': goto yy333; - case 'p': goto yy334; - case 's': goto yy335; - case 't': goto yy336; - default: goto yy190; - } -yy330: - YYDEBUG(330, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'H'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'I') goto yy204; - if(yych == 'L') goto yy203; - goto yy54; - } - } else { - if(yych <= 'i'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'h') goto yy59; - goto yy379; - } else { - if(yych == 'l') goto yy378; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy331: - YYDEBUG(331, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'H'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'I') goto yy239; - if(yych == 'O') goto yy240; - goto yy54; - } - } else { - if(yych <= 'i'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'h') goto yy59; - goto yy369; - } else { - if(yych == 'o') goto yy370; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy332: - YYDEBUG(332, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy201; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy367; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy333: - YYDEBUG(333, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'D'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'E') goto yy235; - if(yych == 'I') goto yy234; - goto yy54; - } - } else { - if(yych <= 'e'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'd') goto yy59; - goto yy363; - } else { - if(yych == 'i') goto yy362; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy334: - YYDEBUG(334, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy198; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy359; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy335: - YYDEBUG(335, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'D'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'E') goto yy223; - if(yych == 'I') goto yy224; - goto yy54; - } - } else { - if(yych <= 'e'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'd') goto yy59; - goto yy348; - } else { - if(yych == 'i') goto yy349; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy336: - YYDEBUG(336, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'E'){ - if(yych == '/') goto yy53; - if(yych <= 'D') goto yy54; - goto yy214; - } else { - if(yych <= 'H'){ - if(yych <= 'G') goto yy54; - goto yy212; - } else { - if(yych == 'W') goto yy213; - goto yy54; - } - } - } else { - if(yych <= 'g'){ - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych == 'e') goto yy339; - goto yy59; - } - } else { - if(yych <= 'v'){ - if(yych >= 'i') goto yy59; - goto yy337; - } else { - if(yych <= 'w') goto yy338; - if(yych <= 'z') goto yy59; - goto yy54; - } - } - } -yy337: - YYDEBUG(337, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'I') goto yy221; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'i') goto yy346; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy338: - YYDEBUG(338, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy217; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy342; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy339: - YYDEBUG(339, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy215; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy340; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy340: - YYDEBUG(340, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy216; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy341; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy341: - YYDEBUG(341, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy342: - YYDEBUG(342, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'L') goto yy218; - goto yy54; - } - } else { - if(yych <= 'k'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'l') goto yy343; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy343: - YYDEBUG(343, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'F') goto yy219; - goto yy54; - } - } else { - if(yych <= 'e'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'f') goto yy344; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy344: - YYDEBUG(344, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy220; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy345; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy345: - YYDEBUG(345, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy346: - YYDEBUG(346, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'Q'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'R') goto yy222; - if(yych <= 'S') goto yy173; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy347; - if(yych <= 's') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy347: - YYDEBUG(347, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy173; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy348: - YYDEBUG(348, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'B'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'C') goto yy227; - if(yych == 'V') goto yy228; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'b') goto yy59; - goto yy352; - } else { - if(yych == 'v') goto yy353; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy349: - YYDEBUG(349, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'X') goto yy225; - goto yy54; - } - } else { - if(yych <= 'w'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'x') goto yy350; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy350: - YYDEBUG(350, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy226; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy351; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy351: - YYDEBUG(351, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy352: - YYDEBUG(352, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'O') goto yy232; - goto yy54; - } - } else { - if(yych <= 'n'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'o') goto yy357; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy353: - YYDEBUG(353, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy229; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy354; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy354: - YYDEBUG(354, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy230; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy355; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy355: - YYDEBUG(355, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy231; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy356; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy356: - YYDEBUG(356, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy357: - YYDEBUG(357, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy233; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy358; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy358: - YYDEBUG(358, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy173; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy359: - YYDEBUG(359, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy199; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy360; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy360: - YYDEBUG(360, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'V') goto yy200; - goto yy54; - } - } else { - if(yych <= 'u'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'v') goto yy361; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy361: - YYDEBUG(361, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'I') goto yy170; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'i') goto yy311; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy362: - YYDEBUG(362, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy237; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy365; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy363: - YYDEBUG(363, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'X') goto yy236; - goto yy54; - } - } else { - if(yych <= 'w'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'x') goto yy364; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy364: - YYDEBUG(364, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy365: - YYDEBUG(365, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy238; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy366; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy366: - YYDEBUG(366, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy367: - YYDEBUG(367, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy202; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy368; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy368: - YYDEBUG(368, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy369: - YYDEBUG(369, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'E'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'F') goto yy245; - if(yych == 'R') goto yy244; - goto yy54; - } - } else { - if(yych <= 'f'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'e') goto yy59; - goto yy374; - } else { - if(yych == 'r') goto yy375; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy370: - YYDEBUG(370, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'U') goto yy241; - goto yy54; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'u') goto yy371; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy371: - YYDEBUG(371, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy242; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy372; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy372: - YYDEBUG(372, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy243; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy373; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy373: - YYDEBUG(373, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy374: - YYDEBUG(374, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy246; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy377; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy375: - YYDEBUG(375, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy247; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy376; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy376: - YYDEBUG(376, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy377: - YYDEBUG(377, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy378: - YYDEBUG(378, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy207; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy382; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy379: - YYDEBUG(379, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'G') goto yy205; - goto yy54; - } - } else { - if(yych <= 'f'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'g') goto yy380; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy380: - YYDEBUG(380, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy206; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy381; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy381: - YYDEBUG(381, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy382: - YYDEBUG(382, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'V') goto yy208; - goto yy54; - } - } else { - if(yych <= 'u'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'v') goto yy383; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy383: - YYDEBUG(383, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy209; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy384; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy384: - YYDEBUG(384, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy210; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy385; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy385: - YYDEBUG(385, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy211; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy386; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy386: - YYDEBUG(386, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy387: - YYDEBUG(387, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy249; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy388; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy388: - YYDEBUG(388, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy250; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy389; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy389: - YYDEBUG(389, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy251; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy390; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy390: - YYDEBUG(390, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy252; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy391; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy391: - YYDEBUG(391, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy392: - YYDEBUG(392, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy254; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy393; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy393: - YYDEBUG(393, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy255; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy394: - YYDEBUG(394, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '/': case '_': goto yy53; - case 'E': goto yy195; - case 'F': goto yy191; - case 'L': goto yy196; - case 'N': goto yy192; - case 'P': goto yy197; - case 'S': goto yy256; - case 'T': goto yy194; - case 'a': - case 'b': - case 'c': - case 'd': case 'g': - case 'h': - case 'i': - case 'j': - case 'k': case 'm': case 'o': case 'q': - case 'r': case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy59; - case 'e': goto yy330; - case 'f': goto yy331; - case 'l': goto yy332; - case 'n': goto yy333; - case 'p': goto yy334; - case 's': goto yy395; - case 't': goto yy336; - default: goto yy190; - } -yy395: - YYDEBUG(395, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '/': case '_': goto yy53; - case 'E': goto yy257; - case 'F': goto yy191; - case 'I': goto yy224; - case 'L': goto yy196; - case 'N': goto yy192; - case 'P': goto yy197; - case 'S': goto yy193; - case 'T': goto yy194; - case 'a': - case 'b': - case 'c': - case 'd': case 'g': - case 'h': case 'j': - case 'k': case 'm': case 'o': case 'q': - case 'r': case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy59; - case 'e': goto yy396; - case 'f': goto yy331; - case 'i': goto yy349; - case 'l': goto yy332; - case 'n': goto yy333; - case 'p': goto yy334; - case 's': goto yy335; - case 't': goto yy336; - default: goto yy190; - } -yy396: - YYDEBUG(396, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'H'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'C') goto yy227; - goto yy54; - } - } else { - if(yych <= 'L'){ - if(yych <= 'I') goto yy204; - if(yych <= 'K') goto yy54; - goto yy203; - } else { - if(yych == 'V') goto yy228; - goto yy54; - } - } - } else { - if(yych <= 'i'){ - if(yych <= 'b'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'c') goto yy352; - if(yych <= 'h') goto yy59; - goto yy379; - } - } else { - if(yych <= 'u'){ - if(yych == 'l') goto yy378; - goto yy59; - } else { - if(yych <= 'v') goto yy353; - if(yych <= 'z') goto yy59; - goto yy54; - } - } - } -yy397: - YYDEBUG(397, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy260; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy402; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy398: - YYDEBUG(398, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'I') goto yy271; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'i') goto yy399; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy399: - YYDEBUG(399, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy272; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy400; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy400: - YYDEBUG(400, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy273; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy401; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy401: - YYDEBUG(401, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy402: - YYDEBUG(402, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy261; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy403; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy403: - YYDEBUG(403, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'G'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'H') goto yy263; - if(yych == 'N') goto yy262; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'g') goto yy59; - goto yy405; - } else { - if(yych == 'n') goto yy404; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy404: - YYDEBUG(404, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'I') goto yy268; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'i') goto yy410; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy405: - YYDEBUG(405, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy264; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy406; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy406: - YYDEBUG(406, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'I') goto yy265; - goto yy54; - } - } else { - if(yych <= 'h'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'i') goto yy407; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy407: - YYDEBUG(407, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'G') goto yy266; - goto yy54; - } - } else { - if(yych <= 'f'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'g') goto yy408; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy408: - YYDEBUG(408, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy267; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy409; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy409: - YYDEBUG(409, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy255; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy410: - YYDEBUG(410, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'G') goto yy269; - goto yy54; - } - } else { - if(yych <= 'f'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'g') goto yy411; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy411: - YYDEBUG(411, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy270; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy412; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy412: - YYDEBUG(412, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy255; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy413: - YYDEBUG(413, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'C'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'D') goto yy276; - if(yych <= 'E') goto yy275; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy415; - if(yych <= 'e') goto yy414; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy414: - YYDEBUG(414, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'K') goto yy255; - goto yy54; - } - } else { - if(yych <= 'j'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'k') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy415: - YYDEBUG(415, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy277; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy416; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy416: - YYDEBUG(416, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy278; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy417; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy417: - YYDEBUG(417, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'S') goto yy279; - goto yy54; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 's') goto yy418; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy418: - YYDEBUG(418, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy280; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy419; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy419: - YYDEBUG(419, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy281; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy420; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy420: - YYDEBUG(420, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy421: - YYDEBUG(421, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy255; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy422: - YYDEBUG(422, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'U') goto yy284; - goto yy54; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'u') goto yy423; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy423: - YYDEBUG(423, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy255; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy424: - YYDEBUG(424, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy287; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy430; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy425: - YYDEBUG(425, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy290; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy426; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy426: - YYDEBUG(426, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= 'C'){ - if(yych == '/') goto yy53; - goto yy54; - } else { - if(yych <= 'D') goto yy291; - if(yych == 'T') goto yy292; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - if(yych <= 'c') goto yy59; - goto yy427; - } else { - if(yych == 't') goto yy428; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy427: - YYDEBUG(427, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy293; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy429; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy428: - YYDEBUG(428, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'H') goto yy255; - goto yy54; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'h') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy429: - YYDEBUG(429, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy430: - YYDEBUG(430, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '/': case '_': goto yy53; - case 'E': goto yy195; - case 'F': goto yy191; - case 'L': goto yy196; - case 'N': goto yy192; - case 'P': goto yy197; - case 'S': goto yy256; - case 'T': goto yy194; - case 'U': goto yy288; - case 'a': - case 'b': - case 'c': - case 'd': case 'g': - case 'h': - case 'i': - case 'j': - case 'k': case 'm': case 'o': case 'q': - case 'r': case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy59; - case 'e': goto yy330; - case 'f': goto yy331; - case 'l': goto yy332; - case 'n': goto yy333; - case 'p': goto yy334; - case 's': goto yy395; - case 't': goto yy336; - case 'u': goto yy431; - default: goto yy190; - } -yy431: - YYDEBUG(431, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy289; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy432; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy432: - YYDEBUG(432, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'E') goto yy255; - goto yy54; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'e') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy433: - YYDEBUG(433, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy303; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy442; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy434: - YYDEBUG(434, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'C') goto yy297; - goto yy54; - } - } else { - if(yych <= 'b'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'c') goto yy439; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy435: - YYDEBUG(435, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy300; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy436; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy436: - YYDEBUG(436, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy301; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy437; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy437: - YYDEBUG(437, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy302; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy438; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy438: - YYDEBUG(438, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy439: - YYDEBUG(439, *YYCURSOR); - yyaccept = 5; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '/': case '_': goto yy53; - case 'E': goto yy195; - case 'F': goto yy191; - case 'L': goto yy196; - case 'N': goto yy192; - case 'O': goto yy298; - case 'P': goto yy197; - case 'S': goto yy256; - case 'T': goto yy194; - case 'a': - case 'b': - case 'c': - case 'd': case 'g': - case 'h': - case 'i': - case 'j': - case 'k': case 'm': case 'q': - case 'r': case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy59; - case 'e': goto yy330; - case 'f': goto yy331; - case 'l': goto yy332; - case 'n': goto yy333; - case 'o': goto yy440; - case 'p': goto yy334; - case 's': goto yy395; - case 't': goto yy336; - default: goto yy190; - } -yy440: - YYDEBUG(440, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'N') goto yy299; - goto yy54; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'n') goto yy441; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy441: - YYDEBUG(441, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy255; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy394; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy442: - YYDEBUG(442, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'U') goto yy304; - goto yy54; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'u') goto yy443; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy443: - YYDEBUG(443, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy305; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy444; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy444: - YYDEBUG(444, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'D') goto yy306; - goto yy54; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'd') goto yy445; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy445: - YYDEBUG(445, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'A') goto yy307; - goto yy54; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy54; - } else { - if(yych <= 'a') goto yy446; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy446: - YYDEBUG(446, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy189; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy329; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy447: - YYDEBUG(447, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'S') goto yy49; - goto yy448; - } else { - if(yych <= 'r'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 's') goto yy448; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy448: - YYDEBUG(448, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy50; - goto yy449; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy449; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy449: - YYDEBUG(449, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'X'){ - if(yych <= 'G'){ - if(yych <= 'C'){ - if(yych == ' ') goto yy174; - goto yy3; - } else { - if(yych == 'E') goto yy3; - if(yych <= 'F') goto yy174; - goto yy3; - } - } else { - if(yych <= 'R'){ - if(yych <= 'H') goto yy174; - if(yych == 'M') goto yy174; - goto yy3; - } else { - if(yych <= 'T') goto yy174; - if(yych == 'W') goto yy174; - goto yy3; - } - } - } else { - if(yych <= 'l'){ - if(yych <= 'e'){ - if(yych <= 'Y') goto yy174; - if(yych == 'd') goto yy174; - goto yy3; - } else { - if(yych == 'g') goto yy3; - if(yych <= 'h') goto yy174; - goto yy3; - } - } else { - if(yych <= 'v'){ - if(yych <= 'm') goto yy174; - if(yych <= 'r') goto yy3; - if(yych <= 't') goto yy174; - goto yy3; - } else { - if(yych == 'x') goto yy3; - if(yych <= 'y') goto yy174; - goto yy3; - } - } - } -yy450: - YYDEBUG(450, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'S') goto yy448; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 's') goto yy451; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy451: - YYDEBUG(451, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy449; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy452; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy452: - YYDEBUG(452, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': goto yy174; - case '/': case '_': goto yy53; - case 'a': - case 'b': - case 'c': case 'e': case 'g': case 'i': - case 'j': - case 'k': - case 'l': case 'n': - case 'o': - case 'p': - case 'q': - case 'r': case 'u': - case 'v': case 'x': case 'z': goto yy59; - case 'd': goto yy318; - case 'f': goto yy320; - case 'h': goto yy317; - case 'm': goto yy316; - case 's': goto yy315; - case 't': goto yy322; - case 'w': goto yy319; - case 'y': goto yy321; - default: goto yy3; - } -yy453: - YYDEBUG(453, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'G') goto yy457; - goto yy49; - } else { - if(yych <= 'f'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'g') goto yy457; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy454: - YYDEBUG(454, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'E') goto yy49; - goto yy455; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'e') goto yy455; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy455: - YYDEBUG(455, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'V') goto yy50; - goto yy456; - } else { - if(yych <= 'u'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'v') goto yy456; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy456: - YYDEBUG(456, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy209; - if(yych == 'e') goto yy209; - goto yy3; -yy457: - YYDEBUG(457, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'H') goto yy50; - goto yy458; - } else { - if(yych <= 'g'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'h') goto yy458; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy458: - YYDEBUG(458, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy3; -yy459: - YYDEBUG(459, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'G') goto yy457; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'g') goto yy463; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy460: - YYDEBUG(460, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'E') goto yy455; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy461; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy461: - YYDEBUG(461, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'V') goto yy456; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'v') goto yy462; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy462: - YYDEBUG(462, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'E') goto yy209; - goto yy3; - } - } else { - if(yych <= 'd'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'e') goto yy384; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy463: - YYDEBUG(463, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'H') goto yy458; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'h') goto yy464; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy464: - YYDEBUG(464, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy3; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy465: - YYDEBUG(465, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'N') goto yy486; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'n') goto yy501; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy466: - YYDEBUG(466, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= 'H'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= 'I') goto yy479; - if(yych == 'U') goto yy480; - goto yy49; - } - } else { - if(yych <= 'h'){ - if(yych == '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy52; - } else { - if(yych <= 't'){ - if(yych <= 'i') goto yy494; - goto yy52; - } else { - if(yych <= 'u') goto yy495; - if(yych <= 'z') goto yy52; - goto yy3; - } - } - } -yy467: - YYDEBUG(467, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'E') goto yy475; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy490; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy468: - YYDEBUG(468, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'E') goto yy473; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy488; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy469: - YYDEBUG(469, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'N') goto yy486; - goto yy49; - } else { - if(yych <= 'm'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'n') goto yy486; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy470: - YYDEBUG(470, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'I'){ - if(yych <= '@') goto yy3; - if(yych <= 'H') goto yy49; - goto yy479; - } else { - if(yych == 'U') goto yy480; - goto yy49; - } - } else { - if(yych <= 'i'){ - if(yych <= '`') goto yy3; - if(yych <= 'h') goto yy49; - goto yy479; - } else { - if(yych == 'u') goto yy480; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy471: - YYDEBUG(471, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'E') goto yy475; - goto yy49; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'e') goto yy475; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy472: - YYDEBUG(472, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'E') goto yy49; - goto yy473; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'e') goto yy473; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy473: - YYDEBUG(473, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'L') goto yy50; - goto yy474; - } else { - if(yych <= 'k'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'l') goto yy474; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy474: - YYDEBUG(474, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'F') goto yy219; - if(yych == 'f') goto yy219; - goto yy3; -yy475: - YYDEBUG(475, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'S') goto yy50; - goto yy476; - } else { - if(yych <= 'r'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 's') goto yy476; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy476: - YYDEBUG(476, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'D') goto yy477; - if(yych != 'd') goto yy3; - goto yy477; -yy477: - YYDEBUG(477, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy478; - if(yych != 'a') goto yy54; - goto yy478; -yy478: - YYDEBUG(478, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy479: - YYDEBUG(479, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'Q'){ - if(yych <= '@') goto yy3; - goto yy50; - } else { - if(yych <= 'R') goto yy485; - if(yych <= 'S') goto yy449; - goto yy50; - } - } else { - if(yych <= 'r'){ - if(yych <= '`') goto yy3; - if(yych <= 'q') goto yy50; - goto yy485; - } else { - if(yych <= 's') goto yy449; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy480: - YYDEBUG(480, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'R') goto yy50; - goto yy481; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 'r') goto yy481; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy481: - YYDEBUG(481, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'S') goto yy482; - if(yych != 's') goto yy3; - goto yy482; -yy482: - YYDEBUG(482, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy483; - if(yych != 'd') goto yy54; - goto yy483; -yy483: - YYDEBUG(483, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy484; - if(yych != 'a') goto yy54; - goto yy484; -yy484: - YYDEBUG(484, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy485: - YYDEBUG(485, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'D') goto yy173; - if(yych == 'd') goto yy173; - goto yy3; -yy486: - YYDEBUG(486, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy50; - goto yy487; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy487; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy487: - YYDEBUG(487, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy3; -yy488: - YYDEBUG(488, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'L') goto yy474; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'l') goto yy489; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy489: - YYDEBUG(489, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'F') goto yy219; - goto yy3; - } - } else { - if(yych <= 'e'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'f') goto yy344; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy490: - YYDEBUG(490, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'S') goto yy476; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 's') goto yy491; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy491: - YYDEBUG(491, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'D') goto yy477; - goto yy3; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'd') goto yy492; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy492: - YYDEBUG(492, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy478; - if(yych != 'a') goto yy60; - goto yy493; -yy493: - YYDEBUG(493, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy494: - YYDEBUG(494, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych <= 'Q') goto yy50; - if(yych <= 'R') goto yy485; - if(yych <= 'S') goto yy449; - goto yy50; - } - } else { - if(yych <= 'q'){ - if(yych == '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'r') goto yy500; - if(yych <= 's') goto yy452; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy495: - YYDEBUG(495, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'R') goto yy481; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'r') goto yy496; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy496: - YYDEBUG(496, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'S') goto yy482; - goto yy3; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 's') goto yy497; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy497: - YYDEBUG(497, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy483; - if(yych != 'd') goto yy60; - goto yy498; -yy498: - YYDEBUG(498, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy484; - if(yych != 'a') goto yy60; - goto yy499; -yy499: - YYDEBUG(499, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy500: - YYDEBUG(500, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'D') goto yy173; - goto yy3; - } - } else { - if(yych <= 'c'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'd') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy501: - YYDEBUG(501, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy487; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy502; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy502: - YYDEBUG(502, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy3; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy503: - YYDEBUG(503, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'C') goto yy49; - goto yy504; - } else { - if(yych <= 'b'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'c') goto yy504; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy504: - YYDEBUG(504, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'E') goto yy512; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'e') goto yy512; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy505: - YYDEBUG(505, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 17) YYFILL(17); - yych = *YYCURSOR; - goto yy506; -yy506: - YYDEBUG(506, *YYCURSOR); - if(yybm[0+yych] & 64) { - goto yy505; - } - if(yych <= '/') goto yy54; - if(yych <= '2') goto yy508; - if(yych <= '3') goto yy510; - if(yych <= '9') goto yy511; - goto yy54; -yy507: - YYDEBUG(507, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy506; - if(yych <= '0') goto yy582; - if(yych <= '2') goto yy583; - if(yych <= '3') goto yy584; - goto yy506; -yy508: - YYDEBUG(508, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy520; - if(yych == '2') goto yy581; - if(yych <= '9') goto yy564; - goto yy520; -yy509: - YYDEBUG(509, *YYCURSOR); - -#line 1082 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datetextual | datenoyear"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } -#line 8083 "" -yy510: - YYDEBUG(510, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy520; - if(yych <= '1') goto yy564; - if(yych <= '2') goto yy517; - if(yych <= '9') goto yy518; - goto yy520; -yy511: - YYDEBUG(511, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy520; - if(yych <= '1') goto yy516; - if(yych <= '2') goto yy517; - if(yych <= '9') goto yy518; - goto yy520; -yy512: - YYDEBUG(512, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'M') goto yy513; - if(yych != 'm') goto yy3; - goto yy513; -yy513: - YYDEBUG(513, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy514; - if(yych != 'b') goto yy54; - goto yy514; -yy514: - YYDEBUG(514, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy515; - if(yych != 'e') goto yy54; - goto yy515; -yy515: - YYDEBUG(515, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy505; - if(yych == 'r') goto yy505; - goto yy54; -yy516: - YYDEBUG(516, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy563; - if(yych <= ':') goto yy525; - goto yy509; - } -yy517: - YYDEBUG(517, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '3') goto yy563; - if(yych <= '9') goto yy560; - if(yych <= ':') goto yy525; - goto yy509; - } -yy518: - YYDEBUG(518, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy560; - if(yych <= ':') goto yy525; - goto yy509; - } -yy519: - YYDEBUG(519, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 14) YYFILL(14); - yych = *YYCURSOR; - goto yy520; -yy520: - YYDEBUG(520, *YYCURSOR); - if(yybm[0+yych] & 128) { - goto yy519; - } - if(yych <= '/') goto yy509; - if(yych <= '1') goto yy521; - if(yych <= '2') goto yy522; - if(yych <= '9') goto yy523; - goto yy509; -yy521: - YYDEBUG(521, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy559; - if(yych <= ':') goto yy525; - goto yy509; - } -yy522: - YYDEBUG(522, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '3') goto yy559; - if(yych <= '9') goto yy524; - if(yych <= ':') goto yy525; - goto yy509; - } -yy523: - YYDEBUG(523, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy524; - if(yych <= ':') goto yy525; - goto yy509; - } -yy524: - YYDEBUG(524, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy509; - if(yych <= '9') goto yy557; - goto yy509; -yy525: - YYDEBUG(525, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy526; - if(yych <= '9') goto yy528; - goto yy54; -yy526: - YYDEBUG(526, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy529; - goto yy527; - } else { - if(yych <= '9') goto yy528; - if(yych <= ':') goto yy529; - goto yy527; - } -yy527: - YYDEBUG(527, *YYCURSOR); - -#line 1311 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } -#line 8234 "" -yy528: - YYDEBUG(528, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy529; - if(yych != ':') goto yy527; - goto yy529; -yy529: - YYDEBUG(529, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy530; - if(yych <= '6') goto yy531; - if(yych <= '9') goto yy532; - goto yy54; -yy530: - YYDEBUG(530, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy527; - if(yych <= '9') goto yy533; - goto yy527; -yy531: - YYDEBUG(531, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '0') goto yy533; - goto yy527; -yy532: - YYDEBUG(532, *YYCURSOR); - yych = *++YYCURSOR; - goto yy527; -yy533: - YYDEBUG(533, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= ','){ - if(yych <= ' '){ - if(yych <= 0x1F) goto yy527; - goto yy534; - } else { - if(yych == '+') goto yy536; - goto yy527; - } - } else { - if(yych <= 'Z'){ - if(yych <= '-') goto yy536; - if(yych <= '@') goto yy527; - goto yy537; - } else { - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy538; - goto yy527; - } - } -yy534: - YYDEBUG(534, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 6) YYFILL(6); - yych = *YYCURSOR; - goto yy535; -yy535: - YYDEBUG(535, *YYCURSOR); - if(yych <= ','){ - if(yych <= ' '){ - if(yych <= 0x1F) goto yy54; - goto yy534; - } else { - if(yych != '+') goto yy54; - goto yy536; - } - } else { - if(yych <= 'Z'){ - if(yych <= '-') goto yy536; - if(yych <= '@') goto yy54; - goto yy537; - } else { - if(yych <= '`') goto yy54; - if(yych <= 'z') goto yy538; - goto yy54; - } - } -yy536: - YYDEBUG(536, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy550; - if(yych <= '2') goto yy551; - if(yych <= '9') goto yy552; - goto yy54; -yy537: - YYDEBUG(537, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy527; - if(yych <= 'Z') goto yy539; - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy541; - goto yy527; -yy538: - YYDEBUG(538, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy527; - if(yych <= 'Z') goto yy539; - if(yych <= '`') goto yy527; - if(yych >= '{') goto yy527; - goto yy539; -yy539: - YYDEBUG(539, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy527; - if(yych <= 'Z') goto yy540; - if(yych <= '`') goto yy527; - if(yych >= '{') goto yy527; - goto yy540; -yy540: - YYDEBUG(540, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '@') goto yy527; - if(yych <= 'Z') goto yy532; - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy532; - goto yy527; -yy541: - YYDEBUG(541, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych == '/') goto yy543; - if(yych <= '@') goto yy527; - goto yy540; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy527; - goto yy543; - } else { - if(yych <= '`') goto yy527; - if(yych >= '{') goto yy527; - goto yy542; - } - } -yy542: - YYDEBUG(542, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych == '/') goto yy543; - if(yych <= '@') goto yy527; - goto yy532; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy527; - goto yy543; - } else { - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy547; - goto yy527; - } - } -yy543: - YYDEBUG(543, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@') goto yy54; - if(yych >= '[') goto yy54; - goto yy544; -yy544: - YYDEBUG(544, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '`') goto yy54; - if(yych >= '{') goto yy54; - goto yy545; -yy545: - YYDEBUG(545, *YYCURSOR); - yyaccept = 7; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy546; -yy546: - YYDEBUG(546, *YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy543; - goto yy527; - } else { - if(yych <= '_') goto yy543; - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy545; - goto yy527; - } -yy547: - YYDEBUG(547, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy543; - goto yy527; - } else { - if(yych <= '_') goto yy543; - if(yych <= '`') goto yy527; - if(yych >= '{') goto yy527; - goto yy548; - } -yy548: - YYDEBUG(548, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy549; -yy549: - YYDEBUG(549, *YYCURSOR); - if(yych <= '^'){ - if(yych == '/') goto yy543; - goto yy54; - } else { - if(yych <= '_') goto yy543; - if(yych <= '`') goto yy54; - if(yych <= 'z') goto yy548; - goto yy54; - } -yy550: - YYDEBUG(550, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy527; - if(yych <= '5') goto yy555; - if(yych <= '9') goto yy552; - if(yych <= ':') goto yy553; - goto yy527; -yy551: - YYDEBUG(551, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '5'){ - if(yych <= '/') goto yy527; - if(yych <= '3') goto yy555; - goto yy554; - } else { - if(yych == ':') goto yy553; - goto yy527; - } -yy552: - YYDEBUG(552, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy527; - if(yych <= '5') goto yy554; - if(yych != ':') goto yy527; - goto yy553; -yy553: - YYDEBUG(553, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy527; - if(yych >= '6') goto yy527; - goto yy554; -yy554: - YYDEBUG(554, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy532; - goto yy54; -yy555: - YYDEBUG(555, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy527; - if(yych <= '5') goto yy556; - if(yych <= '9') goto yy532; - if(yych <= ':') goto yy553; - goto yy527; -yy556: - YYDEBUG(556, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy527; - if(yych <= '9') goto yy532; - goto yy527; -yy557: - YYDEBUG(557, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy509; - if(yych >= ':') goto yy509; - goto yy558; -yy558: - YYDEBUG(558, *YYCURSOR); - yych = *++YYCURSOR; - goto yy509; -yy559: - YYDEBUG(559, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy557; - if(yych <= ':') goto yy525; - goto yy509; - } -yy560: - YYDEBUG(560, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy509; - if(yych >= ':') goto yy509; - goto yy561; -yy561: - YYDEBUG(561, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy562; - if(yych <= '9') goto yy558; - goto yy562; -yy562: - YYDEBUG(562, *YYCURSOR); - -#line 1056 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datenoday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } -#line 8489 "" -yy563: - YYDEBUG(563, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy561; - if(yych <= ':') goto yy525; - goto yy509; - } -yy564: - YYDEBUG(564, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '1'){ - if(yych == '.') goto yy565; - if(yych <= '/') goto yy520; - goto yy566; - } else { - if(yych <= '2') goto yy567; - if(yych <= '9') goto yy568; - if(yych <= ':') goto yy525; - goto yy520; - } -yy565: - YYDEBUG(565, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '2'){ - if(yych <= '/') goto yy520; - if(yych <= '1') goto yy571; - goto yy572; - } else { - if(yych <= '5') goto yy573; - if(yych <= '9') goto yy574; - goto yy520; - } -yy566: - YYDEBUG(566, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy570; - if(yych <= ':') goto yy525; - goto yy509; - } -yy567: - YYDEBUG(567, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '3') goto yy570; - if(yych <= '9') goto yy569; - if(yych <= ':') goto yy525; - goto yy509; - } -yy568: - YYDEBUG(568, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy509; - } else { - if(yych <= '9') goto yy569; - if(yych <= ':') goto yy525; - goto yy509; - } -yy569: - YYDEBUG(569, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy562; - if(yych <= '9') goto yy557; - goto yy562; -yy570: - YYDEBUG(570, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy525; - goto yy562; - } else { - if(yych <= '9') goto yy557; - if(yych <= ':') goto yy525; - goto yy562; - } -yy571: - YYDEBUG(571, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy575; - goto yy509; - } else { - if(yych <= '9') goto yy580; - if(yych <= ':') goto yy575; - goto yy509; - } -yy572: - YYDEBUG(572, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy575; - goto yy509; - } else { - if(yych <= '3') goto yy580; - if(yych <= '9') goto yy579; - if(yych <= ':') goto yy575; - goto yy509; - } -yy573: - YYDEBUG(573, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy575; - goto yy509; - } else { - if(yych <= '9') goto yy579; - if(yych <= ':') goto yy575; - goto yy509; - } -yy574: - YYDEBUG(574, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych != '.') goto yy509; - goto yy575; - } else { - if(yych <= '9') goto yy524; - if(yych >= ';') goto yy509; - goto yy575; - } -yy575: - YYDEBUG(575, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy576; - if(yych <= '6') goto yy577; - if(yych <= '9') goto yy528; - goto yy54; -yy576: - YYDEBUG(576, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy529; - goto yy527; - } else { - if(yych <= '9') goto yy578; - if(yych <= ':') goto yy529; - goto yy527; - } -yy577: - YYDEBUG(577, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy529; - goto yy527; - } else { - if(yych <= '0') goto yy533; - if(yych == ':') goto yy529; - goto yy527; - } -yy578: - YYDEBUG(578, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '.'){ - if(yych <= '*'){ - if(yych == ' ') goto yy534; - goto yy527; - } else { - if(yych == ',') goto yy527; - if(yych <= '-') goto yy536; - goto yy529; - } - } else { - if(yych <= '@'){ - if(yych == ':') goto yy529; - goto yy527; - } else { - if(yych <= 'Z') goto yy537; - if(yych <= '`') goto yy527; - if(yych <= 'z') goto yy538; - goto yy527; - } - } -yy579: - YYDEBUG(579, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy529; - goto yy509; - } else { - if(yych <= '9') goto yy557; - if(yych <= ':') goto yy529; - goto yy509; - } -yy580: - YYDEBUG(580, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy575; - goto yy509; - } else { - if(yych <= '9') goto yy557; - if(yych <= ':') goto yy575; - goto yy509; - } -yy581: - YYDEBUG(581, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '1'){ - if(yych == '.') goto yy565; - if(yych <= '/') goto yy520; - goto yy566; - } else { - if(yych <= '2') goto yy567; - if(yych <= '9') goto yy568; - if(yych <= ':') goto yy525; - goto yy520; - } -yy582: - YYDEBUG(582, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '1'){ - if(yych <= '/') goto yy520; - if(yych <= '0') goto yy564; - goto yy585; - } else { - if(yych <= '2') goto yy592; - if(yych <= '9') goto yy585; - goto yy520; - } -yy583: - YYDEBUG(583, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy520; - if(yych == '2') goto yy592; - if(yych <= '9') goto yy585; - goto yy520; -yy584: - YYDEBUG(584, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy520; - if(yych <= '1') goto yy585; - if(yych <= '2') goto yy517; - if(yych <= '9') goto yy518; - goto yy520; -yy585: - YYDEBUG(585, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case '-': goto yy586; - case '.': goto yy565; - case '0': - case '1': goto yy566; - case '2': goto yy567; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy568; - case ':': goto yy525; - default: goto yy520; - } -yy586: - YYDEBUG(586, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy587; -yy587: - YYDEBUG(587, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy588; - if(yych <= '9') goto yy589; - goto yy588; -yy588: - YYDEBUG(588, *YYCURSOR); - -#line 1191 "resource/parse_date.re" -{ - DEBUG_OUTPUT("pgtextshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } -#line 8748 "" -yy589: - YYDEBUG(589, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy588; - if(yych >= ':') goto yy588; - goto yy590; -yy590: - YYDEBUG(590, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy588; - if(yych >= ':') goto yy588; - goto yy591; -yy591: - YYDEBUG(591, *YYCURSOR); - yych = *++YYCURSOR; - goto yy588; -yy592: - YYDEBUG(592, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case '-': goto yy586; - case '.': goto yy565; - case '0': - case '1': goto yy566; - case '2': goto yy567; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy568; - case ':': goto yy525; - default: goto yy520; - } -yy593: - YYDEBUG(593, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'C') goto yy504; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'c') goto yy594; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy594: - YYDEBUG(594, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'E') goto yy512; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'e') goto yy595; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy595: - YYDEBUG(595, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'M') goto yy513; - goto yy3; - } - } else { - if(yych <= 'l'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'm') goto yy596; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy596: - YYDEBUG(596, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy514; - if(yych != 'b') goto yy60; - goto yy597; -yy597: - YYDEBUG(597, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy515; - if(yych != 'e') goto yy60; - goto yy598; -yy598: - YYDEBUG(598, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy505; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy599: - YYDEBUG(599, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych == '/') goto yy53; - goto yy506; - } else { - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy506; - if(yych <= 'z') goto yy59; - goto yy506; - } -yy600: - YYDEBUG(600, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'V') goto yy612; - goto yy49; - } else { - if(yych <= 'u'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'v') goto yy612; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy601: - YYDEBUG(601, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'V') goto yy612; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'v') goto yy613; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy602: - YYDEBUG(602, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'X') goto yy608; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'x') goto yy611; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy603: - YYDEBUG(603, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'N') goto yy606; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'n') goto yy609; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy604: - YYDEBUG(604, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'X') goto yy608; - goto yy49; - } else { - if(yych <= 'w'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'x') goto yy608; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy605: - YYDEBUG(605, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'N') goto yy49; - goto yy606; - } else { - if(yych <= 'm'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'n') goto yy606; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy606: - YYDEBUG(606, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy50; - goto yy607; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy607; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy607: - YYDEBUG(607, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy3; -yy608: - YYDEBUG(608, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'T') goto yy449; - goto yy50; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy449; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy609: - YYDEBUG(609, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy607; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy610; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy610: - YYDEBUG(610, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy3; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy611: - YYDEBUG(611, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy449; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy452; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy612: - YYDEBUG(612, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'E') goto yy614; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'e') goto yy614; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy613: - YYDEBUG(613, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'E') goto yy614; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'e') goto yy615; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy614: - YYDEBUG(614, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'M') goto yy616; - if(yych == 'm') goto yy616; - goto yy3; -yy615: - YYDEBUG(615, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych != 'M') goto yy3; - goto yy616; - } - } else { - if(yych <= 'l'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'm') goto yy617; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy616: - YYDEBUG(616, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy618; - if(yych == 'b') goto yy618; - goto yy54; -yy617: - YYDEBUG(617, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy618; - if(yych == 'b') goto yy619; - goto yy60; -yy618: - YYDEBUG(618, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy620; - if(yych == 'e') goto yy620; - goto yy54; -yy619: - YYDEBUG(619, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy620; - if(yych == 'e') goto yy621; - goto yy60; -yy620: - YYDEBUG(620, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy505; - if(yych == 'r') goto yy505; - goto yy54; -yy621: - YYDEBUG(621, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy505; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy622: - YYDEBUG(622, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy49; - goto yy623; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 't') goto yy623; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy623: - YYDEBUG(623, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'O') goto yy624; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'o') goto yy624; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy624: - YYDEBUG(624, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'B') goto yy625; - if(yych != 'b') goto yy3; - goto yy625; -yy625: - YYDEBUG(625, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy626; - if(yych != 'e') goto yy54; - goto yy626; -yy626: - YYDEBUG(626, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy505; - if(yych == 'r') goto yy505; - goto yy54; -yy627: - YYDEBUG(627, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy623; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy628; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy628: - YYDEBUG(628, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'N'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'O') goto yy624; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'n'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'o') goto yy629; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy629: - YYDEBUG(629, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'B') goto yy625; - goto yy3; - } - } else { - if(yych <= 'a'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'b') goto yy630; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy630: - YYDEBUG(630, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy626; - if(yych != 'e') goto yy60; - goto yy631; -yy631: - YYDEBUG(631, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy505; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy632: - YYDEBUG(632, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'O'){ - if(yych <= '@') goto yy3; - if(yych == 'C') goto yy647; - goto yy49; - } else { - if(yych <= 'P') goto yy646; - if(yych == 'V') goto yy648; - goto yy49; - } - } else { - if(yych <= 'o'){ - if(yych <= '`') goto yy3; - if(yych == 'c') goto yy647; - goto yy49; - } else { - if(yych <= 'u'){ - if(yych <= 'p') goto yy646; - goto yy49; - } else { - if(yych <= 'v') goto yy648; - if(yych <= 'z') goto yy49; - goto yy3; - } - } - } -yy633: - YYDEBUG(633, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'T') goto yy641; - goto yy49; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 't') goto yy641; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy634: - YYDEBUG(634, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'X') goto yy639; - goto yy49; - } else { - if(yych <= 'w'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'x') goto yy639; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy635: - YYDEBUG(635, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'N') goto yy49; - goto yy636; - } else { - if(yych <= 'm'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'n') goto yy636; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy636: - YYDEBUG(636, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'D') goto yy50; - goto yy637; - } else { - if(yych <= 'c'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 'd') goto yy637; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy637: - YYDEBUG(637, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy638; - if(yych != 'a') goto yy3; - goto yy638; -yy638: - YYDEBUG(638, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy639: - YYDEBUG(639, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy50; - goto yy640; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy640; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy640: - YYDEBUG(640, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy3; -yy641: - YYDEBUG(641, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'U') goto yy50; - goto yy642; - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 'u') goto yy642; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy642: - YYDEBUG(642, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'R') goto yy643; - if(yych != 'r') goto yy3; - goto yy643; -yy643: - YYDEBUG(643, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy644; - if(yych != 'd') goto yy54; - goto yy644; -yy644: - YYDEBUG(644, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy645; - if(yych != 'a') goto yy54; - goto yy645; -yy645: - YYDEBUG(645, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy646: - YYDEBUG(646, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'T') goto yy651; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 't') goto yy651; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy647: - YYDEBUG(647, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'O') goto yy650; - goto yy50; - } else { - if(yych <= 'n'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'o') goto yy650; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy648: - YYDEBUG(648, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'E') goto yy50; - goto yy649; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'e') goto yy649; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy649: - YYDEBUG(649, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'N') goto yy230; - if(yych == 'n') goto yy230; - goto yy3; -yy650: - YYDEBUG(650, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'N') goto yy233; - if(yych == 'n') goto yy233; - goto yy3; -yy651: - YYDEBUG(651, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '-') goto yy507; - if(yych <= '.') goto yy506; - goto yy3; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy506; - if(yych <= 'D') goto yy3; - goto yy652; - } else { - if(yych != 'e') goto yy3; - goto yy652; - } - } -yy652: - YYDEBUG(652, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy653; - if(yych != 'm') goto yy54; - goto yy653; -yy653: - YYDEBUG(653, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy654; - if(yych != 'b') goto yy54; - goto yy654; -yy654: - YYDEBUG(654, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy655; - if(yych != 'e') goto yy54; - goto yy655; -yy655: - YYDEBUG(655, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy505; - if(yych == 'r') goto yy505; - goto yy54; -yy656: - YYDEBUG(656, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= 'C'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych <= '@') goto yy3; - if(yych <= 'B') goto yy49; - goto yy647; - } - } else { - if(yych <= 'P'){ - if(yych <= 'O') goto yy49; - goto yy646; - } else { - if(yych == 'V') goto yy648; - goto yy49; - } - } - } else { - if(yych <= 'c'){ - if(yych <= '_'){ - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'b') goto yy52; - goto yy671; - } - } else { - if(yych <= 'u'){ - if(yych == 'p') goto yy670; - goto yy52; - } else { - if(yych <= 'v') goto yy672; - if(yych <= 'z') goto yy52; - goto yy3; - } - } - } -yy657: - YYDEBUG(657, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy641; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy665; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy658: - YYDEBUG(658, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'X') goto yy639; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'x') goto yy663; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy659: - YYDEBUG(659, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'N') goto yy636; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'n') goto yy660; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy660: - YYDEBUG(660, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'D') goto yy637; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'd') goto yy661; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy661: - YYDEBUG(661, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'A') goto yy638; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy3; - } else { - if(yych <= 'a') goto yy662; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy662: - YYDEBUG(662, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy663: - YYDEBUG(663, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy640; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy664; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy664: - YYDEBUG(664, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy3; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy665: - YYDEBUG(665, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'U') goto yy642; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'u') goto yy666; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy666: - YYDEBUG(666, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'R') goto yy643; - goto yy3; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'r') goto yy667; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy667: - YYDEBUG(667, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'D') goto yy644; - if(yych != 'd') goto yy60; - goto yy668; -yy668: - YYDEBUG(668, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy645; - if(yych != 'a') goto yy60; - goto yy669; -yy669: - YYDEBUG(669, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy670: - YYDEBUG(670, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'S'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'T') goto yy651; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 't') goto yy675; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy671: - YYDEBUG(671, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'O') goto yy650; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'o') goto yy674; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy672: - YYDEBUG(672, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'E') goto yy649; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy673; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy673: - YYDEBUG(673, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'N') goto yy230; - goto yy3; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'n') goto yy355; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy674: - YYDEBUG(674, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'N') goto yy233; - goto yy3; - } - } else { - if(yych <= 'm'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'n') goto yy358; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy675: - YYDEBUG(675, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy53; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych <= 'E') goto yy652; - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'e') goto yy676; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy676: - YYDEBUG(676, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy653; - if(yych != 'm') goto yy60; - goto yy677; -yy677: - YYDEBUG(677, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy654; - if(yych != 'b') goto yy60; - goto yy678; -yy678: - YYDEBUG(678, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy655; - if(yych != 'e') goto yy60; - goto yy679; -yy679: - YYDEBUG(679, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'R') goto yy505; - goto yy54; - } - } else { - if(yych <= 'q'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'r') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy680: - YYDEBUG(680, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'G') goto yy687; - goto yy49; - } else { - if(yych <= 'f'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'g') goto yy687; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy681: - YYDEBUG(681, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'R') goto yy685; - goto yy49; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'r') goto yy685; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy682: - YYDEBUG(682, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'O') goto yy49; - goto yy683; - } else { - if(yych <= 'n'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'o') goto yy683; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy683: - YYDEBUG(683, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '@') goto yy684; - if(yych <= 'Z') goto yy50; - if(yych <= '`') goto yy684; - if(yych <= 'z') goto yy50; - goto yy684; -yy684: - YYDEBUG(684, *YYCURSOR); - -#line 1245 "resource/parse_date.re" -{ - DEBUG_OUTPUT("ago"); - TIMELIB_INIT; - s->time->relative.y = 0 - s->time->relative.y; - s->time->relative.m = 0 - s->time->relative.m; - s->time->relative.d = 0 - s->time->relative.d; - s->time->relative.h = 0 - s->time->relative.h; - s->time->relative.i = 0 - s->time->relative.i; - s->time->relative.s = 0 - s->time->relative.s; - s->time->relative.weekday = 0 - s->time->relative.weekday; - TIMELIB_DEINIT; - return TIMELIB_AGO; - } -#line 10073 "" -yy685: - YYDEBUG(685, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'I') goto yy686; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'i') goto yy686; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy686: - YYDEBUG(686, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'L') goto yy505; - if(yych == 'l') goto yy505; - goto yy3; -yy687: - YYDEBUG(687, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'U') goto yy688; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'u') goto yy688; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy688: - YYDEBUG(688, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'S') goto yy689; - if(yych != 's') goto yy3; - goto yy689; -yy689: - YYDEBUG(689, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy505; - if(yych == 't') goto yy505; - goto yy54; -yy690: - YYDEBUG(690, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'G') goto yy687; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'g') goto yy696; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy691: - YYDEBUG(691, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'R') goto yy685; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'r') goto yy694; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy692: - YYDEBUG(692, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'O') goto yy683; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'o') goto yy693; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy693: - YYDEBUG(693, *YYCURSOR); - yyaccept = 9; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy684; - goto yy50; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy684; - goto yy53; - } else { - if(yych <= '`') goto yy684; - if(yych <= 'z') goto yy58; - goto yy684; - } - } -yy694: - YYDEBUG(694, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'H'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'I') goto yy686; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'h'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'i') goto yy695; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy695: - YYDEBUG(695, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'L') goto yy505; - goto yy3; - } - } else { - if(yych <= 'k'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'l') goto yy599; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy696: - YYDEBUG(696, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'T'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'U') goto yy688; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'u') goto yy697; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy697: - YYDEBUG(697, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'S') goto yy689; - goto yy3; - } - } else { - if(yych <= 'r'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 's') goto yy698; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy698: - YYDEBUG(698, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'T') goto yy505; - goto yy54; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 't') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy699: - YYDEBUG(699, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'R'){ - if(yych <= '@') goto yy3; - if(yych <= 'Q') goto yy49; - goto yy709; - } else { - if(yych == 'Y') goto yy711; - goto yy49; - } - } else { - if(yych <= 'r'){ - if(yych <= '`') goto yy3; - if(yych <= 'q') goto yy49; - goto yy709; - } else { - if(yych == 'y') goto yy711; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy700: - YYDEBUG(700, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= 'Q'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= 'R') goto yy709; - if(yych == 'Y') goto yy711; - goto yy49; - } - } else { - if(yych <= 'q'){ - if(yych == '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy52; - } else { - if(yych <= 'x'){ - if(yych <= 'r') goto yy710; - goto yy52; - } else { - if(yych <= 'y') goto yy712; - if(yych <= 'z') goto yy52; - goto yy3; - } - } - } -yy701: - YYDEBUG(701, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'N') goto yy703; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'n') goto yy706; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy702: - YYDEBUG(702, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'N') goto yy49; - goto yy703; - } else { - if(yych <= 'm'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'n') goto yy703; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy703: - YYDEBUG(703, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'D') goto yy50; - goto yy704; - } else { - if(yych <= 'c'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 'd') goto yy704; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy704: - YYDEBUG(704, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy705; - if(yych != 'a') goto yy3; - goto yy705; -yy705: - YYDEBUG(705, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy706: - YYDEBUG(706, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'D') goto yy704; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'd') goto yy707; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy707: - YYDEBUG(707, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'A') goto yy705; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy3; - } else { - if(yych <= 'a') goto yy708; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy708: - YYDEBUG(708, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy709: - YYDEBUG(709, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'C') goto yy713; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'c') goto yy713; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy710: - YYDEBUG(710, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'B'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'C') goto yy713; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'b'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'c') goto yy714; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy711: - YYDEBUG(711, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '-') goto yy507; - if(yych <= '.') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy712: - YYDEBUG(712, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy53; - goto yy506; - } - } else { - if(yych <= '^'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy713: - YYDEBUG(713, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'H') goto yy505; - if(yych == 'h') goto yy505; - goto yy3; -yy714: - YYDEBUG(714, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'H') goto yy505; - goto yy3; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'h') goto yy599; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy715: - YYDEBUG(715, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'B') goto yy728; - goto yy49; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'b') goto yy728; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy716: - YYDEBUG(716, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'F'){ - if(yych <= '@') goto yy3; - if(yych <= 'E') goto yy49; - goto yy725; - } else { - if(yych == 'R') goto yy724; - goto yy49; - } - } else { - if(yych <= 'f'){ - if(yych <= '`') goto yy3; - if(yych <= 'e') goto yy49; - goto yy725; - } else { - if(yych == 'r') goto yy724; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy717: - YYDEBUG(717, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'U') goto yy722; - goto yy49; - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'u') goto yy722; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy718: - YYDEBUG(718, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'I') goto yy49; - goto yy719; - } else { - if(yych <= 'h'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'i') goto yy719; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy719: - YYDEBUG(719, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy151; - if(yych != 'D') goto yy50; - goto yy720; - } else { - if(yych <= 'c'){ - if(yych <= '`') goto yy151; - goto yy50; - } else { - if(yych <= 'd') goto yy720; - if(yych <= 'z') goto yy50; - goto yy151; - } - } -yy720: - YYDEBUG(720, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy721; - if(yych != 'a') goto yy3; - goto yy721; -yy721: - YYDEBUG(721, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy157; - goto yy54; -yy722: - YYDEBUG(722, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'R') goto yy50; - goto yy723; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 'r') goto yy723; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy723: - YYDEBUG(723, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'T') goto yy243; - if(yych == 't') goto yy243; - goto yy3; -yy724: - YYDEBUG(724, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych == 'S') goto yy727; - goto yy50; - } else { - if(yych <= 'r'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 's') goto yy727; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy725: - YYDEBUG(725, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'T') goto yy50; - goto yy726; - } else { - if(yych <= 's'){ - if(yych <= '`') goto yy3; - goto yy50; - } else { - if(yych <= 't') goto yy726; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy726: - YYDEBUG(726, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'H') goto yy173; - if(yych == 'h') goto yy173; - goto yy3; -yy727: - YYDEBUG(727, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'T') goto yy173; - if(yych == 't') goto yy173; - goto yy3; -yy728: - YYDEBUG(728, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'R') goto yy729; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'r') goto yy729; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy729: - YYDEBUG(729, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy730; - if(yych != 'u') goto yy3; - goto yy730; -yy730: - YYDEBUG(730, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy731; - if(yych != 'a') goto yy54; - goto yy731; -yy731: - YYDEBUG(731, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy732; - if(yych != 'r') goto yy54; - goto yy732; -yy732: - YYDEBUG(732, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy505; - if(yych == 'y') goto yy505; - goto yy54; -yy733: - YYDEBUG(733, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'B') goto yy728; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'b') goto yy746; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy734: - YYDEBUG(734, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= 'E'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= 'F') goto yy725; - if(yych == 'R') goto yy724; - goto yy49; - } - } else { - if(yych <= 'e'){ - if(yych == '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy52; - } else { - if(yych <= 'q'){ - if(yych <= 'f') goto yy743; - goto yy52; - } else { - if(yych <= 'r') goto yy742; - if(yych <= 'z') goto yy52; - goto yy3; - } - } - } -yy735: - YYDEBUG(735, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'U') goto yy722; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'u') goto yy740; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy736: - YYDEBUG(736, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'I') goto yy719; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'i') goto yy737; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy737: - YYDEBUG(737, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy151; - } else { - if(yych == 'D') goto yy720; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy151; - } else { - if(yych == 'd') goto yy738; - if(yych <= 'z') goto yy58; - goto yy151; - } - } -yy738: - YYDEBUG(738, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'A') goto yy721; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy3; - } else { - if(yych <= 'a') goto yy739; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy739: - YYDEBUG(739, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy157; - if(yych == 'y') goto yy166; - goto yy60; -yy740: - YYDEBUG(740, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'R') goto yy723; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'r') goto yy741; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy741: - YYDEBUG(741, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'T') goto yy243; - goto yy3; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 't') goto yy373; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy742: - YYDEBUG(742, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'S') goto yy727; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 's') goto yy745; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy743: - YYDEBUG(743, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'T') goto yy726; - goto yy50; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 't') goto yy744; - if(yych <= 'z') goto yy58; - goto yy3; - } - } -yy744: - YYDEBUG(744, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'H') goto yy173; - goto yy3; - } - } else { - if(yych <= 'g'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'h') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy745: - YYDEBUG(745, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'T') goto yy173; - goto yy3; - } - } else { - if(yych <= 's'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 't') goto yy314; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy746: - YYDEBUG(746, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Q'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'R') goto yy729; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'q'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'r') goto yy747; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy747: - YYDEBUG(747, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'U') goto yy730; - goto yy3; - } - } else { - if(yych <= 't'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy59; - } else { - if(yych <= 'u') goto yy748; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy748: - YYDEBUG(748, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy731; - if(yych != 'a') goto yy60; - goto yy749; -yy749: - YYDEBUG(749, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy732; - if(yych != 'r') goto yy60; - goto yy750; -yy750: - YYDEBUG(750, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy505; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy751: - YYDEBUG(751, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= 'L'){ - if(yych <= '@') goto yy3; - if(yych <= 'K') goto yy49; - goto yy758; - } else { - if(yych == 'N') goto yy757; - goto yy49; - } - } else { - if(yych <= 'l'){ - if(yych <= '`') goto yy3; - if(yych <= 'k') goto yy49; - goto yy758; - } else { - if(yych == 'n') goto yy757; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy752: - YYDEBUG(752, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - if(yych != 'N') goto yy49; - goto yy753; - } else { - if(yych <= 'm'){ - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'n') goto yy753; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy753: - YYDEBUG(753, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'U') goto yy754; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'u') goto yy754; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy754: - YYDEBUG(754, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy755; - if(yych != 'a') goto yy3; - goto yy755; -yy755: - YYDEBUG(755, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy756; - if(yych != 'r') goto yy54; - goto yy756; -yy756: - YYDEBUG(756, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy505; - if(yych == 'y') goto yy505; - goto yy54; -yy757: - YYDEBUG(757, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'E') goto yy759; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'e') goto yy759; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy758: - YYDEBUG(758, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych <= 0x1F) goto yy3; - if(yych <= ',') goto yy506; - goto yy507; - } else { - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych == 'Y') goto yy759; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'y') goto yy759; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy759: - YYDEBUG(759, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x1F) goto yy3; - if(yych == '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; -yy760: - YYDEBUG(760, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= 'K'){ - if(yych == '/') goto yy53; - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= 'L') goto yy758; - if(yych == 'N') goto yy757; - goto yy49; - } - } else { - if(yych <= 'k'){ - if(yych == '_') goto yy53; - if(yych <= '`') goto yy3; - goto yy52; - } else { - if(yych <= 'm'){ - if(yych <= 'l') goto yy767; - goto yy52; - } else { - if(yych <= 'n') goto yy766; - if(yych <= 'z') goto yy52; - goto yy3; - } - } - } -yy761: - YYDEBUG(761, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '@'){ - if(yych == '/') goto yy53; - goto yy3; - } else { - if(yych == 'N') goto yy753; - goto yy49; - } - } else { - if(yych <= '`'){ - if(yych == '_') goto yy53; - goto yy3; - } else { - if(yych == 'n') goto yy762; - if(yych <= 'z') goto yy52; - goto yy3; - } - } -yy762: - YYDEBUG(762, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'T'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'U') goto yy754; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 't'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'u') goto yy763; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy763: - YYDEBUG(763, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy3; - goto yy53; - } else { - if(yych == 'A') goto yy755; - goto yy3; - } - } else { - if(yych <= '`'){ - if(yych <= '_') goto yy53; - goto yy3; - } else { - if(yych <= 'a') goto yy764; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy764: - YYDEBUG(764, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy756; - if(yych != 'r') goto yy60; - goto yy765; -yy765: - YYDEBUG(765, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '^'){ - if(yych <= '/'){ - if(yych <= '.') goto yy54; - goto yy53; - } else { - if(yych == 'Y') goto yy505; - goto yy54; - } - } else { - if(yych <= 'x'){ - if(yych <= '_') goto yy53; - if(yych <= '`') goto yy54; - goto yy59; - } else { - if(yych <= 'y') goto yy599; - if(yych <= 'z') goto yy59; - goto yy54; - } - } -yy766: - YYDEBUG(766, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'E') goto yy759; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'd'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'e') goto yy768; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy767: - YYDEBUG(767, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'X'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - if(yych == '-') goto yy507; - goto yy506; - } else { - if(yych <= '/') goto yy53; - if(yych <= '9') goto yy506; - if(yych <= '@') goto yy3; - goto yy50; - } - } else { - if(yych <= '_'){ - if(yych <= 'Y') goto yy759; - if(yych <= 'Z') goto yy50; - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= 'x'){ - if(yych <= '`') goto yy3; - goto yy58; - } else { - if(yych <= 'y') goto yy768; - if(yych <= 'z') goto yy58; - goto yy3; - } - } - } -yy768: - YYDEBUG(768, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy3; - if(yych == '/') goto yy53; - goto yy506; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy3; - goto yy53; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy59; - goto yy3; - } - } -yy769: - YYDEBUG(769, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych != 'I') goto yy49; - goto yy770; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy770: - YYDEBUG(770, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy3; - if(yych == '/') goto yy3; - goto yy506; - } else { - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - goto yy50; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy771: - YYDEBUG(771, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych != 'I') goto yy49; - goto yy772; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy772: - YYDEBUG(772, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych == 'I') goto yy759; - goto yy50; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy50; - goto yy3; - } - } -yy773: - YYDEBUG(773, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy3; - if(yych == '/') goto yy3; - goto yy506; - } else { - if(yych <= 'Z'){ - if(yych <= '@') goto yy3; - goto yy49; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy774: - YYDEBUG(774, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '.'){ - if(yych <= 0x1F) goto yy3; - goto yy506; - } else { - if(yych <= '/') goto yy3; - if(yych <= '9') goto yy506; - goto yy3; - } - } else { - if(yych <= 'Z'){ - if(yych == 'I') goto yy770; - goto yy49; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy775: - YYDEBUG(775, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; - goto yy776; -yy776: - YYDEBUG(776, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': goto yy775; - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': goto yy784; - case 'A': case 'a': goto yy792; - case 'D': case 'd': goto yy779; - case 'F': case 'f': goto yy780; - case 'H': case 'h': goto yy70; - case 'I': goto yy787; - case 'J': case 'j': goto yy791; - case 'M': case 'm': goto yy778; - case 'N': case 'n': goto yy794; - case 'O': case 'o': goto yy793; - case 'P': case 'p': goto yy796; - case 'S': case 's': goto yy777; - case 'T': case 't': goto yy75; - case 'V': goto yy789; - case 'W': case 'w': goto yy72; - case 'X': goto yy790; - case 'Y': case 'y': goto yy74; - default: goto yy54; - } -yy777: - YYDEBUG(777, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych <= 'D'){ - if(yych == 'A') goto yy131; - goto yy54; - } else { - if(yych <= 'E') goto yy1253; - if(yych <= 'T') goto yy54; - goto yy132; - } - } else { - if(yych <= 'd'){ - if(yych == 'a') goto yy131; - goto yy54; - } else { - if(yych <= 'e') goto yy1253; - if(yych == 'u') goto yy132; - goto yy54; - } - } -yy778: - YYDEBUG(778, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'O'){ - if(yych <= 'H'){ - if(yych == 'A') goto yy883; - goto yy54; - } else { - if(yych <= 'I') goto yy123; - if(yych <= 'N') goto yy54; - goto yy122; - } - } else { - if(yych <= 'h'){ - if(yych == 'a') goto yy883; - goto yy54; - } else { - if(yych <= 'i') goto yy123; - if(yych == 'o') goto yy122; - goto yy54; - } - } -yy779: - YYDEBUG(779, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'E'){ - if(yych == 'A') goto yy119; - if(yych <= 'D') goto yy54; - goto yy870; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy119; - } else { - if(yych == 'e') goto yy870; - goto yy54; - } - } -yy780: - YYDEBUG(780, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'R'){ - if(yych <= 'N'){ - if(yych == 'E') goto yy886; - goto yy54; - } else { - if(yych <= 'O') goto yy96; - if(yych <= 'Q') goto yy54; - goto yy95; - } - } else { - if(yych <= 'n'){ - if(yych == 'e') goto yy886; - goto yy54; - } else { - if(yych <= 'o') goto yy96; - if(yych == 'r') goto yy95; - goto yy54; - } - } -yy781: - YYDEBUG(781, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy1004; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1003; - goto yy67; -yy782: - YYDEBUG(782, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '0': - case '1': - case '2': goto yy946; - case '3': goto yy948; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy949; - case 'A': case 'a': goto yy953; - case 'D': case 'd': goto yy957; - case 'F': case 'f': goto yy951; - case 'J': case 'j': goto yy950; - case 'M': case 'm': goto yy952; - case 'N': case 'n': goto yy956; - case 'O': case 'o': goto yy955; - case 'S': case 's': goto yy954; - default: goto yy54; - } -yy783: - YYDEBUG(783, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '0': goto yy902; - case '1': goto yy903; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy904; - case 'A': case 'a': goto yy908; - case 'D': case 'd': goto yy912; - case 'F': case 'f': goto yy906; - case 'J': case 'j': goto yy905; - case 'M': case 'm': goto yy907; - case 'N': case 'n': goto yy911; - case 'O': case 'o': goto yy910; - case 'S': case 's': goto yy909; - default: goto yy785; - } -yy784: - YYDEBUG(784, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; - goto yy785; -yy785: - YYDEBUG(785, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': goto yy784; - case 'A': case 'a': goto yy867; - case 'D': case 'd': goto yy869; - case 'F': case 'f': goto yy865; - case 'I': goto yy787; - case 'J': case 'j': goto yy791; - case 'M': case 'm': goto yy866; - case 'N': case 'n': goto yy794; - case 'O': case 'o': goto yy793; - case 'S': case 's': goto yy868; - case 'V': goto yy789; - case 'X': goto yy790; - default: goto yy54; - } -yy786: - YYDEBUG(786, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '1'){ - if(yych <= '/') goto yy785; - if(yych <= '0') goto yy861; - goto yy862; - } else { - if(yych <= '5') goto yy863; - if(yych <= '9') goto yy864; - goto yy785; - } -yy787: - YYDEBUG(787, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'H'){ - if(yych <= '.'){ - if(yych >= ' ') goto yy825; - goto yy788; - } else { - if(yych <= '/') goto yy788; - if(yych <= '9') goto yy827; - goto yy788; - } - } else { - if(yych <= 'V'){ - if(yych <= 'I') goto yy860; - if(yych >= 'V') goto yy833; - goto yy788; - } else { - if(yych == 'X') goto yy833; - goto yy788; - } - } -yy788: - YYDEBUG(788, *YYCURSOR); - -#line 1095 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datenoyearrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } -#line 11806 "" -yy789: - YYDEBUG(789, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych == 'I') goto yy858; - goto yy788; - } -yy790: - YYDEBUG(790, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych == 'I') goto yy857; - goto yy788; - } -yy791: - YYDEBUG(791, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy850; - if(yych <= 'T') goto yy54; - goto yy849; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy850; - } else { - if(yych == 'u') goto yy849; - goto yy54; - } - } -yy792: - YYDEBUG(792, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'T'){ - if(yych <= 'L'){ - if(yych == '.') goto yy797; - goto yy54; - } else { - if(yych <= 'M') goto yy798; - if(yych == 'P') goto yy843; - goto yy54; - } - } else { - if(yych <= 'o'){ - if(yych <= 'U') goto yy842; - if(yych == 'm') goto yy798; - goto yy54; - } else { - if(yych <= 'p') goto yy843; - if(yych == 'u') goto yy842; - goto yy54; - } - } -yy793: - YYDEBUG(793, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy837; - if(yych == 'c') goto yy837; - goto yy54; -yy794: - YYDEBUG(794, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy823; - if(yych == 'o') goto yy823; - goto yy54; -yy795: - YYDEBUG(795, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy801; - if(yych <= '9') goto yy803; - goto yy54; -yy796: - YYDEBUG(796, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'L'){ - if(yych != '.') goto yy54; - goto yy797; - } else { - if(yych <= 'M') goto yy798; - if(yych == 'm') goto yy798; - goto yy54; - } -yy797: - YYDEBUG(797, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy798; - if(yych != 'm') goto yy54; - goto yy798; -yy798: - YYDEBUG(798, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) == '.') goto yy800; - goto yy799; -yy799: - YYDEBUG(799, *YYCURSOR); - -#line 886 "resource/parse_date.re" -{ - DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - } - } - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_TIME12; - } -#line 11910 "" -yy800: - YYDEBUG(800, *YYCURSOR); - yych = *++YYCURSOR; - goto yy799; -yy801: - YYDEBUG(801, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy804; - goto yy802; - } else { - if(yych <= '9') goto yy817; - if(yych <= ':') goto yy804; - goto yy802; - } -yy802: - YYDEBUG(802, *YYCURSOR); - -#line 903 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_TIME24_WITH_ZONE; - } -#line 11947 "" -yy803: - YYDEBUG(803, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy804; - if(yych != ':') goto yy802; - goto yy804; -yy804: - YYDEBUG(804, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy805; - if(yych <= '6') goto yy806; - if(yych <= '9') goto yy807; - goto yy54; -yy805: - YYDEBUG(805, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy811; - goto yy802; -yy806: - YYDEBUG(806, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych == '0') goto yy811; - goto yy802; -yy807: - YYDEBUG(807, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != '.') goto yy802; - goto yy808; -yy808: - YYDEBUG(808, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy809; -yy809: - YYDEBUG(809, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy810; -yy810: - YYDEBUG(810, *YYCURSOR); - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy809; - goto yy802; -yy811: - YYDEBUG(811, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'A'){ - if(yych <= '-'){ - if(yych != ' ') goto yy802; - goto yy812; - } else { - if(yych <= '.') goto yy808; - if(yych <= '@') goto yy802; - goto yy814; - } - } else { - if(yych <= '`'){ - if(yych == 'P') goto yy814; - goto yy802; - } else { - if(yych <= 'a') goto yy814; - if(yych == 'p') goto yy814; - goto yy802; - } - } -yy812: - YYDEBUG(812, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy813; -yy813: - YYDEBUG(813, *YYCURSOR); - if(yych <= 'O'){ - if(yych <= ' '){ - if(yych <= 0x1F) goto yy54; - goto yy812; - } else { - if(yych != 'A') goto yy54; - goto yy814; - } - } else { - if(yych <= 'a'){ - if(yych <= 'P') goto yy814; - if(yych <= '`') goto yy54; - goto yy814; - } else { - if(yych != 'p') goto yy54; - goto yy814; - } - } -yy814: - YYDEBUG(814, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'L'){ - if(yych != '.') goto yy54; - goto yy815; - } else { - if(yych <= 'M') goto yy816; - if(yych == 'm') goto yy816; - goto yy54; - } -yy815: - YYDEBUG(815, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy816; - if(yych != 'm') goto yy54; - goto yy816; -yy816: - YYDEBUG(816, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '.') goto yy800; - goto yy799; -yy817: - YYDEBUG(817, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych != ' ') goto yy802; - goto yy818; - } else { - if(yych <= '.') goto yy804; - if(yych == ':') goto yy804; - goto yy802; - } - } else { - if(yych <= '`'){ - if(yych <= 'A') goto yy820; - if(yych == 'P') goto yy820; - goto yy802; - } else { - if(yych <= 'a') goto yy820; - if(yych == 'p') goto yy820; - goto yy802; - } - } -yy818: - YYDEBUG(818, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy819; -yy819: - YYDEBUG(819, *YYCURSOR); - if(yych <= 'O'){ - if(yych <= ' '){ - if(yych <= 0x1F) goto yy54; - goto yy818; - } else { - if(yych != 'A') goto yy54; - goto yy820; - } - } else { - if(yych <= 'a'){ - if(yych <= 'P') goto yy820; - if(yych <= '`') goto yy54; - goto yy820; - } else { - if(yych != 'p') goto yy54; - goto yy820; - } - } -yy820: - YYDEBUG(820, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'L'){ - if(yych != '.') goto yy54; - goto yy821; - } else { - if(yych <= 'M') goto yy822; - if(yych == 'm') goto yy822; - goto yy54; - } -yy821: - YYDEBUG(821, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy822; - if(yych != 'm') goto yy54; - goto yy822; -yy822: - YYDEBUG(822, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '.') goto yy800; - goto yy799; -yy823: - YYDEBUG(823, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy824; - if(yych != 'v') goto yy54; - goto yy824; -yy824: - YYDEBUG(824, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy788; - goto yy829; - } else { - if(yych == 'e') goto yy829; - goto yy788; - } - } -yy825: - YYDEBUG(825, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy826; -yy826: - YYDEBUG(826, *YYCURSOR); - if(yych <= 0x1F) goto yy54; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy827; -yy827: - YYDEBUG(827, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy828; - if(yych <= '9') goto yy834; - goto yy828; -yy828: - YYDEBUG(828, *YYCURSOR); - -#line 1030 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datefull"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL; - } -#line 12150 "" -yy829: - YYDEBUG(829, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy830; - if(yych != 'm') goto yy54; - goto yy830; -yy830: - YYDEBUG(830, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy831; - if(yych != 'b') goto yy54; - goto yy831; -yy831: - YYDEBUG(831, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy832; - if(yych != 'e') goto yy54; - goto yy832; -yy832: - YYDEBUG(832, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy833; - if(yych != 'r') goto yy54; - goto yy833; -yy833: - YYDEBUG(833, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - if(yych <= '9') goto yy827; - goto yy788; -yy834: - YYDEBUG(834, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych >= ':') goto yy828; - goto yy835; -yy835: - YYDEBUG(835, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych >= ':') goto yy828; - goto yy836; -yy836: - YYDEBUG(836, *YYCURSOR); - yych = *++YYCURSOR; - goto yy828; -yy837: - YYDEBUG(837, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy838; - if(yych != 't') goto yy54; - goto yy838; -yy838: - YYDEBUG(838, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'O'){ - if(yych <= 'N') goto yy788; - goto yy839; - } else { - if(yych != 'o') goto yy788; - goto yy839; - } - } -yy839: - YYDEBUG(839, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy840; - if(yych != 'b') goto yy54; - goto yy840; -yy840: - YYDEBUG(840, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy841; - if(yych != 'e') goto yy54; - goto yy841; -yy841: - YYDEBUG(841, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy833; - if(yych == 'r') goto yy833; - goto yy54; -yy842: - YYDEBUG(842, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy846; - if(yych == 'g') goto yy846; - goto yy54; -yy843: - YYDEBUG(843, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy844; - if(yych != 'r') goto yy54; - goto yy844; -yy844: - YYDEBUG(844, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'I'){ - if(yych <= 'H') goto yy788; - goto yy845; - } else { - if(yych != 'i') goto yy788; - goto yy845; - } - } -yy845: - YYDEBUG(845, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'L') goto yy833; - if(yych == 'l') goto yy833; - goto yy54; -yy846: - YYDEBUG(846, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'U'){ - if(yych <= 'T') goto yy788; - goto yy847; - } else { - if(yych != 'u') goto yy788; - goto yy847; - } - } -yy847: - YYDEBUG(847, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'S') goto yy848; - if(yych != 's') goto yy54; - goto yy848; -yy848: - YYDEBUG(848, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy833; - if(yych == 't') goto yy833; - goto yy54; -yy849: - YYDEBUG(849, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy856; - if(yych <= 'M') goto yy54; - goto yy855; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy856; - } else { - if(yych == 'n') goto yy855; - goto yy54; - } - } -yy850: - YYDEBUG(850, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy851; - if(yych != 'n') goto yy54; - goto yy851; -yy851: - YYDEBUG(851, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'U'){ - if(yych <= 'T') goto yy788; - goto yy852; - } else { - if(yych != 'u') goto yy788; - goto yy852; - } - } -yy852: - YYDEBUG(852, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy853; - if(yych != 'a') goto yy54; - goto yy853; -yy853: - YYDEBUG(853, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy854; - if(yych != 'r') goto yy54; - goto yy854; -yy854: - YYDEBUG(854, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy833; - if(yych == 'y') goto yy833; - goto yy54; -yy855: - YYDEBUG(855, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy788; - goto yy833; - } else { - if(yych == 'e') goto yy833; - goto yy788; - } - } -yy856: - YYDEBUG(856, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'Y'){ - if(yych <= 'X') goto yy788; - goto yy833; - } else { - if(yych == 'y') goto yy833; - goto yy788; - } - } -yy857: - YYDEBUG(857, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych == 'I') goto yy833; - goto yy788; - } -yy858: - YYDEBUG(858, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych != 'I') goto yy788; - goto yy859; - } -yy859: - YYDEBUG(859, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych == 'I') goto yy833; - goto yy788; - } -yy860: - YYDEBUG(860, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - goto yy788; - } else { - if(yych <= '9') goto yy827; - if(yych == 'I') goto yy833; - goto yy788; - } -yy861: - YYDEBUG(861, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy892; - goto yy802; - } else { - if(yych <= '9') goto yy901; - if(yych <= ':') goto yy804; - goto yy802; - } -yy862: - YYDEBUG(862, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy892; - goto yy802; - } else { - if(yych <= '2') goto yy901; - if(yych <= '9') goto yy817; - if(yych <= ':') goto yy804; - goto yy802; - } -yy863: - YYDEBUG(863, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy892; - goto yy802; - } else { - if(yych <= '9') goto yy817; - if(yych <= ':') goto yy804; - goto yy802; - } -yy864: - YYDEBUG(864, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy892; - if(yych == ':') goto yy804; - goto yy802; -yy865: - YYDEBUG(865, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy886; - if(yych == 'e') goto yy886; - goto yy54; -yy866: - YYDEBUG(866, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy883; - if(yych == 'a') goto yy883; - goto yy54; -yy867: - YYDEBUG(867, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy843; - if(yych <= 'T') goto yy54; - goto yy842; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy843; - } else { - if(yych == 'u') goto yy842; - goto yy54; - } - } -yy868: - YYDEBUG(868, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy876; - if(yych == 'e') goto yy876; - goto yy54; -yy869: - YYDEBUG(869, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy870; - if(yych != 'e') goto yy54; - goto yy870; -yy870: - YYDEBUG(870, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy871; - if(yych != 'c') goto yy54; - goto yy871; -yy871: - YYDEBUG(871, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy788; - goto yy872; - } else { - if(yych != 'e') goto yy788; - goto yy872; - } - } -yy872: - YYDEBUG(872, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy873; - if(yych != 'm') goto yy54; - goto yy873; -yy873: - YYDEBUG(873, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy874; - if(yych != 'b') goto yy54; - goto yy874; -yy874: - YYDEBUG(874, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy875; - if(yych != 'e') goto yy54; - goto yy875; -yy875: - YYDEBUG(875, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy833; - if(yych == 'r') goto yy833; - goto yy54; -yy876: - YYDEBUG(876, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy877; - if(yych != 'p') goto yy54; - goto yy877; -yy877: - YYDEBUG(877, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'T'){ - if(yych <= 'S') goto yy788; - goto yy878; - } else { - if(yych != 't') goto yy788; - goto yy878; - } - } -yy878: - YYDEBUG(878, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy788; - goto yy879; - } else { - if(yych != 'e') goto yy788; - goto yy879; - } - } -yy879: - YYDEBUG(879, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy880; - if(yych != 'm') goto yy54; - goto yy880; -yy880: - YYDEBUG(880, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy881; - if(yych != 'b') goto yy54; - goto yy881; -yy881: - YYDEBUG(881, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy882; - if(yych != 'e') goto yy54; - goto yy882; -yy882: - YYDEBUG(882, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy833; - if(yych == 'r') goto yy833; - goto yy54; -yy883: - YYDEBUG(883, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy884; - if(yych <= 'X') goto yy54; - goto yy833; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy884; - } else { - if(yych == 'y') goto yy833; - goto yy54; - } - } -yy884: - YYDEBUG(884, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'C'){ - if(yych <= 'B') goto yy788; - goto yy885; - } else { - if(yych != 'c') goto yy788; - goto yy885; - } - } -yy885: - YYDEBUG(885, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'H') goto yy833; - if(yych == 'h') goto yy833; - goto yy54; -yy886: - YYDEBUG(886, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy887; - if(yych != 'b') goto yy54; - goto yy887; -yy887: - YYDEBUG(887, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '9'){ - if(yych <= 0x1F) goto yy788; - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - goto yy827; - } else { - if(yych <= 'R'){ - if(yych <= 'Q') goto yy788; - goto yy888; - } else { - if(yych != 'r') goto yy788; - goto yy888; - } - } -yy888: - YYDEBUG(888, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'U') goto yy889; - if(yych != 'u') goto yy54; - goto yy889; -yy889: - YYDEBUG(889, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy890; - if(yych != 'a') goto yy54; - goto yy890; -yy890: - YYDEBUG(890, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy891; - if(yych != 'r') goto yy54; - goto yy891; -yy891: - YYDEBUG(891, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy833; - if(yych == 'y') goto yy833; - goto yy54; -yy892: - YYDEBUG(892, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy893; - if(yych <= '6') goto yy894; - if(yych <= '9') goto yy895; - goto yy54; -yy893: - YYDEBUG(893, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy900; - goto yy802; -yy894: - YYDEBUG(894, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy808; - goto yy802; - } else { - if(yych <= '0') goto yy900; - if(yych <= '9') goto yy896; - goto yy802; - } -yy895: - YYDEBUG(895, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych >= ':') goto yy802; - goto yy896; -yy896: - YYDEBUG(896, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy897; - if(yych <= '9') goto yy898; - goto yy897; -yy897: - YYDEBUG(897, *YYCURSOR); - -#line 1043 "resource/parse_date.re" -{ - DEBUG_OUTPUT("pointed date"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } -#line 12659 "" -yy898: - YYDEBUG(898, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy897; - if(yych >= ':') goto yy897; - goto yy899; -yy899: - YYDEBUG(899, *YYCURSOR); - yych = *++YYCURSOR; - goto yy897; -yy900: - YYDEBUG(900, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych == ' ') goto yy812; - goto yy802; - } else { - if(yych <= '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy898; - goto yy802; - } - } else { - if(yych <= '`'){ - if(yych <= 'A') goto yy814; - if(yych == 'P') goto yy814; - goto yy802; - } else { - if(yych <= 'a') goto yy814; - if(yych == 'p') goto yy814; - goto yy802; - } - } -yy901: - YYDEBUG(901, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '@'){ - if(yych <= '-'){ - if(yych == ' ') goto yy818; - goto yy802; - } else { - if(yych <= '.') goto yy892; - if(yych == ':') goto yy804; - goto yy802; - } - } else { - if(yych <= '`'){ - if(yych <= 'A') goto yy820; - if(yych == 'P') goto yy820; - goto yy802; - } else { - if(yych <= 'a') goto yy820; - if(yych == 'p') goto yy820; - goto yy802; - } - } -yy902: - YYDEBUG(902, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy941; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy904; - goto yy54; -yy903: - YYDEBUG(903, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy941; - if(yych <= '/') goto yy54; - if(yych >= '3') goto yy54; - goto yy904; -yy904: - YYDEBUG(904, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy941; - goto yy54; -yy905: - YYDEBUG(905, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy937; - if(yych <= 'T') goto yy54; - goto yy936; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy937; - } else { - if(yych == 'u') goto yy936; - goto yy54; - } - } -yy906: - YYDEBUG(906, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy934; - if(yych == 'e') goto yy934; - goto yy54; -yy907: - YYDEBUG(907, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy931; - if(yych == 'a') goto yy931; - goto yy54; -yy908: - YYDEBUG(908, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy928; - if(yych <= 'T') goto yy54; - goto yy927; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy928; - } else { - if(yych == 'u') goto yy927; - goto yy54; - } - } -yy909: - YYDEBUG(909, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy924; - if(yych == 'e') goto yy924; - goto yy54; -yy910: - YYDEBUG(910, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy922; - if(yych == 'c') goto yy922; - goto yy54; -yy911: - YYDEBUG(911, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy920; - if(yych == 'o') goto yy920; - goto yy54; -yy912: - YYDEBUG(912, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy913; - if(yych != 'e') goto yy54; - goto yy913; -yy913: - YYDEBUG(913, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy914; - if(yych != 'c') goto yy54; - goto yy914; -yy914: - YYDEBUG(914, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy827; - if(yych <= 'D') goto yy788; - goto yy872; - } else { - if(yych == 'e') goto yy872; - goto yy788; - } - } -yy915: - YYDEBUG(915, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy826; - if(yych <= '0') goto yy916; - if(yych <= '2') goto yy917; - if(yych <= '3') goto yy918; - goto yy826; -yy916: - YYDEBUG(916, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych <= '0') goto yy834; - if(yych <= '9') goto yy919; - goto yy828; -yy917: - YYDEBUG(917, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych <= '9') goto yy919; - goto yy828; -yy918: - YYDEBUG(918, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych <= '1') goto yy919; - if(yych <= '9') goto yy834; - goto yy828; -yy919: - YYDEBUG(919, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy828; - if(yych <= '9') goto yy835; - goto yy828; -yy920: - YYDEBUG(920, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy921; - if(yych != 'v') goto yy54; - goto yy921; -yy921: - YYDEBUG(921, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy827; - if(yych <= 'D') goto yy788; - goto yy829; - } else { - if(yych == 'e') goto yy829; - goto yy788; - } - } -yy922: - YYDEBUG(922, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy923; - if(yych != 't') goto yy54; - goto yy923; -yy923: - YYDEBUG(923, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'O'){ - if(yych <= '9') goto yy827; - if(yych <= 'N') goto yy788; - goto yy839; - } else { - if(yych == 'o') goto yy839; - goto yy788; - } - } -yy924: - YYDEBUG(924, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy925; - if(yych != 'p') goto yy54; - goto yy925; -yy925: - YYDEBUG(925, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'T'){ - if(yych <= '9') goto yy827; - if(yych <= 'S') goto yy788; - goto yy926; - } else { - if(yych != 't') goto yy788; - goto yy926; - } - } -yy926: - YYDEBUG(926, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy827; - if(yych <= 'D') goto yy788; - goto yy879; - } else { - if(yych == 'e') goto yy879; - goto yy788; - } - } -yy927: - YYDEBUG(927, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy930; - if(yych == 'g') goto yy930; - goto yy54; -yy928: - YYDEBUG(928, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy929; - if(yych != 'r') goto yy54; - goto yy929; -yy929: - YYDEBUG(929, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'I'){ - if(yych <= '9') goto yy827; - if(yych <= 'H') goto yy788; - goto yy845; - } else { - if(yych == 'i') goto yy845; - goto yy788; - } - } -yy930: - YYDEBUG(930, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'U'){ - if(yych <= '9') goto yy827; - if(yych <= 'T') goto yy788; - goto yy847; - } else { - if(yych == 'u') goto yy847; - goto yy788; - } - } -yy931: - YYDEBUG(931, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy932; - if(yych <= 'X') goto yy54; - goto yy933; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy932; - } else { - if(yych == 'y') goto yy933; - goto yy54; - } - } -yy932: - YYDEBUG(932, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'C'){ - if(yych <= '9') goto yy827; - if(yych <= 'B') goto yy788; - goto yy885; - } else { - if(yych == 'c') goto yy885; - goto yy788; - } - } -yy933: - YYDEBUG(933, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '-'){ - if(yych <= 0x1F) goto yy788; - if(yych <= ',') goto yy825; - goto yy915; - } else { - if(yych <= '.') goto yy825; - if(yych <= '/') goto yy788; - if(yych <= '9') goto yy827; - goto yy788; - } -yy934: - YYDEBUG(934, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy935; - if(yych != 'b') goto yy54; - goto yy935; -yy935: - YYDEBUG(935, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'R'){ - if(yych <= '9') goto yy827; - if(yych <= 'Q') goto yy788; - goto yy888; - } else { - if(yych == 'r') goto yy888; - goto yy788; - } - } -yy936: - YYDEBUG(936, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy940; - if(yych <= 'M') goto yy54; - goto yy939; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy940; - } else { - if(yych == 'n') goto yy939; - goto yy54; - } - } -yy937: - YYDEBUG(937, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy938; - if(yych != 'n') goto yy54; - goto yy938; -yy938: - YYDEBUG(938, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'U'){ - if(yych <= '9') goto yy827; - if(yych <= 'T') goto yy788; - goto yy852; - } else { - if(yych == 'u') goto yy852; - goto yy788; - } - } -yy939: - YYDEBUG(939, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'E'){ - if(yych <= '9') goto yy827; - if(yych <= 'D') goto yy788; - goto yy833; - } else { - if(yych == 'e') goto yy833; - goto yy788; - } - } -yy940: - YYDEBUG(940, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych <= ','){ - if(yych <= 0x1F) goto yy788; - goto yy825; - } else { - if(yych <= '-') goto yy915; - if(yych <= '.') goto yy825; - goto yy788; - } - } else { - if(yych <= 'Y'){ - if(yych <= '9') goto yy827; - if(yych <= 'X') goto yy788; - goto yy833; - } else { - if(yych == 'y') goto yy833; - goto yy788; - } - } -yy941: - YYDEBUG(941, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '2') goto yy942; - if(yych <= '3') goto yy944; - if(yych <= '9') goto yy945; - goto yy54; -yy942: - YYDEBUG(942, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy943; - if(yych <= '9') goto yy945; - goto yy943; -yy943: - YYDEBUG(943, *YYCURSOR); - -#line 1017 "resource/parse_date.re" -{ - DEBUG_OUTPUT("gnudateshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 13147 "" -yy944: - YYDEBUG(944, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy943; - if(yych >= '2') goto yy943; - goto yy945; -yy945: - YYDEBUG(945, *YYCURSOR); - yych = *++YYCURSOR; - goto yy943; -yy946: - YYDEBUG(946, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '.') goto yy947; - if(yych <= '/') goto yy998; - if(yych <= '9') goto yy949; - goto yy947; -yy947: - YYDEBUG(947, *YYCURSOR); - -#line 990 "resource/parse_date.re" -{ - DEBUG_OUTPUT("americanshort | american"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '/') { - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - } - TIMELIB_DEINIT; - return TIMELIB_AMERICAN; - } -#line 13175 "" -yy948: - YYDEBUG(948, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '.') goto yy947; - if(yych <= '/') goto yy998; - if(yych >= '2') goto yy947; - goto yy949; -yy949: - YYDEBUG(949, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '/') goto yy998; - goto yy947; -yy950: - YYDEBUG(950, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy997; - if(yych <= 'T') goto yy54; - goto yy996; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy997; - } else { - if(yych == 'u') goto yy996; - goto yy54; - } - } -yy951: - YYDEBUG(951, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy995; - if(yych == 'e') goto yy995; - goto yy54; -yy952: - YYDEBUG(952, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy994; - if(yych == 'a') goto yy994; - goto yy54; -yy953: - YYDEBUG(953, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy993; - if(yych <= 'T') goto yy54; - goto yy992; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy993; - } else { - if(yych == 'u') goto yy992; - goto yy54; - } - } -yy954: - YYDEBUG(954, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy990; - if(yych == 'e') goto yy990; - goto yy54; -yy955: - YYDEBUG(955, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy989; - if(yych == 'c') goto yy989; - goto yy54; -yy956: - YYDEBUG(956, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy988; - if(yych == 'o') goto yy988; - goto yy54; -yy957: - YYDEBUG(957, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy958; - if(yych != 'e') goto yy54; - goto yy958; -yy958: - YYDEBUG(958, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy959; - if(yych != 'c') goto yy54; - goto yy959; -yy959: - YYDEBUG(959, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '/') goto yy54; - goto yy960; -yy960: - YYDEBUG(960, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy961; -yy961: - YYDEBUG(961, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy962; -yy962: - YYDEBUG(962, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy963; -yy963: - YYDEBUG(963, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy964; -yy964: - YYDEBUG(964, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy965; -yy965: - YYDEBUG(965, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy966; - if(yych <= '2') goto yy967; - goto yy54; -yy966: - YYDEBUG(966, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy968; - goto yy54; -yy967: - YYDEBUG(967, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '4') goto yy54; - goto yy968; -yy968: - YYDEBUG(968, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy969; -yy969: - YYDEBUG(969, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '6') goto yy54; - goto yy970; -yy970: - YYDEBUG(970, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy971; -yy971: - YYDEBUG(971, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy972; -yy972: - YYDEBUG(972, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy973; - if(yych <= '6') goto yy974; - goto yy54; -yy973: - YYDEBUG(973, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy975; - goto yy54; -yy974: - YYDEBUG(974, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '0') goto yy54; - goto yy975; -yy975: - YYDEBUG(975, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ' ') goto yy54; - goto yy976; -yy976: - YYDEBUG(976, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 6) YYFILL(6); - yych = *YYCURSOR; - goto yy977; -yy977: - YYDEBUG(977, *YYCURSOR); - if(yych <= '*'){ - if(yych == ' ') goto yy976; - goto yy54; - } else { - if(yych == ',') goto yy54; - if(yych >= '.') goto yy54; - goto yy978; - } -yy978: - YYDEBUG(978, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy979; - if(yych <= '2') goto yy981; - if(yych <= '9') goto yy982; - goto yy54; -yy979: - YYDEBUG(979, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy980; - if(yych <= '5') goto yy986; - if(yych <= '9') goto yy982; - if(yych <= ':') goto yy983; - goto yy980; -yy980: - YYDEBUG(980, *YYCURSOR); - -#line 1217 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("clf"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_CLF; - } -#line 13349 "" -yy981: - YYDEBUG(981, *YYCURSOR); - yyaccept = 13; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '5'){ - if(yych <= '/') goto yy980; - if(yych <= '3') goto yy986; - goto yy984; - } else { - if(yych == ':') goto yy983; - goto yy980; - } -yy982: - YYDEBUG(982, *YYCURSOR); - yyaccept = 13; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy980; - if(yych <= '5') goto yy984; - if(yych != ':') goto yy980; - goto yy983; -yy983: - YYDEBUG(983, *YYCURSOR); - yyaccept = 13; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy980; - if(yych >= '6') goto yy980; - goto yy984; -yy984: - YYDEBUG(984, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy985; -yy985: - YYDEBUG(985, *YYCURSOR); - yych = *++YYCURSOR; - goto yy980; -yy986: - YYDEBUG(986, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy980; - if(yych <= '5') goto yy987; - if(yych <= '9') goto yy985; - if(yych <= ':') goto yy983; - goto yy980; -yy987: - YYDEBUG(987, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy980; - if(yych <= '9') goto yy985; - goto yy980; -yy988: - YYDEBUG(988, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy959; - if(yych == 'v') goto yy959; - goto yy54; -yy989: - YYDEBUG(989, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy959; - if(yych == 't') goto yy959; - goto yy54; -yy990: - YYDEBUG(990, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy991; - if(yych != 'p') goto yy54; - goto yy991; -yy991: - YYDEBUG(991, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'S'){ - if(yych == '/') goto yy960; - goto yy54; - } else { - if(yych <= 'T') goto yy959; - if(yych == 't') goto yy959; - goto yy54; - } -yy992: - YYDEBUG(992, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy959; - if(yych == 'g') goto yy959; - goto yy54; -yy993: - YYDEBUG(993, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy959; - if(yych == 'r') goto yy959; - goto yy54; -yy994: - YYDEBUG(994, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy959; - if(yych <= 'X') goto yy54; - goto yy959; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy959; - } else { - if(yych == 'y') goto yy959; - goto yy54; - } - } -yy995: - YYDEBUG(995, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy959; - if(yych == 'b') goto yy959; - goto yy54; -yy996: - YYDEBUG(996, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy959; - if(yych <= 'M') goto yy54; - goto yy959; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy959; - } else { - if(yych == 'n') goto yy959; - goto yy54; - } - } -yy997: - YYDEBUG(997, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy959; - if(yych == 'n') goto yy959; - goto yy54; -yy998: - YYDEBUG(998, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy999; -yy999: - YYDEBUG(999, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy947; - if(yych >= ':') goto yy947; - goto yy1000; -yy1000: - YYDEBUG(1000, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy947; - if(yych >= ':') goto yy947; - goto yy1001; -yy1001: - YYDEBUG(1001, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy947; - if(yych >= ':') goto yy947; - goto yy1002; -yy1002: - YYDEBUG(1002, *YYCURSOR); - yych = *++YYCURSOR; - goto yy947; -yy1003: - YYDEBUG(1003, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy1004; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1031; - goto yy67; -yy1004: - YYDEBUG(1004, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '0': goto yy902; - case '1': goto yy903; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy904; - case 'A': case 'a': goto yy1008; - case 'D': case 'd': goto yy1012; - case 'F': case 'f': goto yy1006; - case 'J': case 'j': goto yy1005; - case 'M': case 'm': goto yy1007; - case 'N': case 'n': goto yy1011; - case 'O': case 'o': goto yy1010; - case 'S': case 's': goto yy1009; - default: goto yy54; - } -yy1005: - YYDEBUG(1005, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy1030; - if(yych <= 'T') goto yy54; - goto yy1029; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy1030; - } else { - if(yych == 'u') goto yy1029; - goto yy54; - } - } -yy1006: - YYDEBUG(1006, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1028; - if(yych == 'e') goto yy1028; - goto yy54; -yy1007: - YYDEBUG(1007, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy1027; - if(yych == 'a') goto yy1027; - goto yy54; -yy1008: - YYDEBUG(1008, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy1026; - if(yych <= 'T') goto yy54; - goto yy1025; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy1026; - } else { - if(yych == 'u') goto yy1025; - goto yy54; - } - } -yy1009: - YYDEBUG(1009, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1023; - if(yych == 'e') goto yy1023; - goto yy54; -yy1010: - YYDEBUG(1010, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1022; - if(yych == 'c') goto yy1022; - goto yy54; -yy1011: - YYDEBUG(1011, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy1021; - if(yych == 'o') goto yy1021; - goto yy54; -yy1012: - YYDEBUG(1012, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1013; - if(yych != 'e') goto yy54; - goto yy1013; -yy1013: - YYDEBUG(1013, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1014; - if(yych != 'c') goto yy54; - goto yy1014; -yy1014: - YYDEBUG(1014, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '-') goto yy54; - goto yy1015; -yy1015: - YYDEBUG(1015, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '0') goto yy1016; - if(yych <= '2') goto yy1017; - if(yych <= '3') goto yy1018; - goto yy54; -yy1016: - YYDEBUG(1016, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '0') goto yy54; - if(yych <= '9') goto yy1019; - goto yy54; -yy1017: - YYDEBUG(1017, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1019; - goto yy54; -yy1018: - YYDEBUG(1018, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '2') goto yy54; - goto yy1019; -yy1019: - YYDEBUG(1019, *YYCURSOR); - ++YYCURSOR; - goto yy1020; -yy1020: - YYDEBUG(1020, *YYCURSOR); - -#line 1204 "resource/parse_date.re" -{ - DEBUG_OUTPUT("pgtextreverse"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } -#line 13589 "" -yy1021: - YYDEBUG(1021, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy1014; - if(yych == 'v') goto yy1014; - goto yy54; -yy1022: - YYDEBUG(1022, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy1014; - if(yych == 't') goto yy1014; - goto yy54; -yy1023: - YYDEBUG(1023, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy1024; - if(yych != 'p') goto yy54; - goto yy1024; -yy1024: - YYDEBUG(1024, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'S'){ - if(yych == '-') goto yy1015; - goto yy54; - } else { - if(yych <= 'T') goto yy1014; - if(yych == 't') goto yy1014; - goto yy54; - } -yy1025: - YYDEBUG(1025, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy1014; - if(yych == 'g') goto yy1014; - goto yy54; -yy1026: - YYDEBUG(1026, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1014; - if(yych == 'r') goto yy1014; - goto yy54; -yy1027: - YYDEBUG(1027, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy1014; - if(yych <= 'X') goto yy54; - goto yy1014; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy1014; - } else { - if(yych == 'y') goto yy1014; - goto yy54; - } - } -yy1028: - YYDEBUG(1028, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1014; - if(yych == 'b') goto yy1014; - goto yy54; -yy1029: - YYDEBUG(1029, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy1014; - if(yych <= 'M') goto yy54; - goto yy1014; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy1014; - } else { - if(yych == 'n') goto yy1014; - goto yy54; - } - } -yy1030: - YYDEBUG(1030, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy1014; - if(yych == 'n') goto yy1014; - goto yy54; -yy1031: - YYDEBUG(1031, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': case 'S': - case 'T': case 'V': case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': case 's': - case 't': case 'w': case 'y': goto yy1036; - case '-': goto yy1033; - case '.': goto yy1039; - case '/': goto yy1034; - case '0': goto yy1052; - case '1': goto yy1053; - case '2': goto yy1054; - case '3': goto yy1055; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy76; - case 'W': goto yy1056; - default: goto yy1032; - } -yy1032: - YYDEBUG(1032, *YYCURSOR); - -#line 1236 "resource/parse_date.re" -{ - DEBUG_OUTPUT("year4"); - TIMELIB_INIT; - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_CLF; - } -#line 13705 "" -yy1033: - YYDEBUG(1033, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case '0': goto yy1193; - case '1': goto yy1194; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy904; - case 'A': case 'a': goto yy1188; - case 'D': case 'd': goto yy1192; - case 'F': case 'f': goto yy1186; - case 'J': case 'j': goto yy1185; - case 'M': case 'm': goto yy1187; - case 'N': case 'n': goto yy1191; - case 'O': case 'o': goto yy1190; - case 'S': case 's': goto yy1189; - default: goto yy1038; - } -yy1034: - YYDEBUG(1034, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '0') goto yy1171; - if(yych <= '1') goto yy1172; - if(yych <= '9') goto yy1173; - goto yy54; -yy1035: - YYDEBUG(1035, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 9) YYFILL(9); - yych = *YYCURSOR; - goto yy1036; -yy1036: - YYDEBUG(1036, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': goto yy1035; - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': goto yy1037; - case 'A': case 'a': goto yy1047; - case 'D': case 'd': goto yy1051; - case 'F': case 'f': goto yy1045; - case 'H': case 'h': goto yy70; - case 'I': goto yy1040; - case 'J': case 'j': goto yy1044; - case 'M': case 'm': goto yy1046; - case 'N': case 'n': goto yy1050; - case 'O': case 'o': goto yy1049; - case 'S': case 's': goto yy1048; - case 'T': case 't': goto yy75; - case 'V': goto yy1042; - case 'W': case 'w': goto yy72; - case 'X': goto yy1043; - case 'Y': case 'y': goto yy74; - default: goto yy54; - } -yy1037: - YYDEBUG(1037, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 9) YYFILL(9); - yych = *YYCURSOR; - goto yy1038; -yy1038: - YYDEBUG(1038, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': goto yy1037; - case 'A': case 'a': goto yy1047; - case 'D': case 'd': goto yy1163; - case 'F': case 'f': goto yy1160; - case 'I': goto yy1040; - case 'J': case 'j': goto yy1044; - case 'M': case 'm': goto yy1161; - case 'N': case 'n': goto yy1050; - case 'O': case 'o': goto yy1049; - case 'S': case 's': goto yy1162; - case 'V': goto yy1042; - case 'X': goto yy1043; - default: goto yy54; - } -yy1039: - YYDEBUG(1039, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1038; - if(yych <= '0') goto yy1157; - if(yych <= '2') goto yy1158; - if(yych <= '3') goto yy1159; - goto yy1038; -yy1040: - YYDEBUG(1040, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= 'U'){ - if(yych == 'I') goto yy1156; - goto yy1041; - } else { - if(yych == 'W') goto yy1041; - if(yych <= 'X') goto yy1110; - goto yy1041; - } -yy1041: - YYDEBUG(1041, *YYCURSOR); - -#line 1069 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datenodayrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } -#line 13832 "" -yy1042: - YYDEBUG(1042, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'I') goto yy1154; - goto yy1041; -yy1043: - YYDEBUG(1043, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'I') goto yy1153; - goto yy1041; -yy1044: - YYDEBUG(1044, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy1146; - if(yych <= 'T') goto yy54; - goto yy1145; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy1146; - } else { - if(yych == 'u') goto yy1145; - goto yy54; - } - } -yy1045: - YYDEBUG(1045, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'R'){ - if(yych <= 'N'){ - if(yych == 'E') goto yy1139; - goto yy54; - } else { - if(yych <= 'O') goto yy96; - if(yych <= 'Q') goto yy54; - goto yy95; - } - } else { - if(yych <= 'n'){ - if(yych == 'e') goto yy1139; - goto yy54; - } else { - if(yych <= 'o') goto yy96; - if(yych == 'r') goto yy95; - goto yy54; - } - } -yy1046: - YYDEBUG(1046, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'O'){ - if(yych <= 'H'){ - if(yych == 'A') goto yy1136; - goto yy54; - } else { - if(yych <= 'I') goto yy123; - if(yych <= 'N') goto yy54; - goto yy122; - } - } else { - if(yych <= 'h'){ - if(yych == 'a') goto yy1136; - goto yy54; - } else { - if(yych <= 'i') goto yy123; - if(yych == 'o') goto yy122; - goto yy54; - } - } -yy1047: - YYDEBUG(1047, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy1130; - if(yych <= 'T') goto yy54; - goto yy1129; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy1130; - } else { - if(yych == 'u') goto yy1129; - goto yy54; - } - } -yy1048: - YYDEBUG(1048, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych <= 'D'){ - if(yych == 'A') goto yy131; - goto yy54; - } else { - if(yych <= 'E') goto yy1122; - if(yych <= 'T') goto yy54; - goto yy132; - } - } else { - if(yych <= 'd'){ - if(yych == 'a') goto yy131; - goto yy54; - } else { - if(yych <= 'e') goto yy1122; - if(yych == 'u') goto yy132; - goto yy54; - } - } -yy1049: - YYDEBUG(1049, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1117; - if(yych == 'c') goto yy1117; - goto yy54; -yy1050: - YYDEBUG(1050, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy1111; - if(yych == 'o') goto yy1111; - goto yy54; -yy1051: - YYDEBUG(1051, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'E'){ - if(yych == 'A') goto yy119; - if(yych <= 'D') goto yy54; - goto yy1104; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy119; - } else { - if(yych == 'e') goto yy1104; - goto yy54; - } - } -yy1052: - YYDEBUG(1052, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '0') goto yy1102; - if(yych <= '9') goto yy1103; - goto yy67; -yy1053: - YYDEBUG(1053, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '2') goto yy1069; - if(yych <= '9') goto yy1068; - goto yy67; -yy1054: - YYDEBUG(1054, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1068; - goto yy67; -yy1055: - YYDEBUG(1055, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '5') goto yy1064; - if(yych <= '6') goto yy1065; - if(yych <= '9') goto yy76; - goto yy67; -yy1056: - YYDEBUG(1056, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '5'){ - if(yych <= '/') goto yy54; - if(yych <= '0') goto yy1057; - if(yych <= '4') goto yy1058; - goto yy1059; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy54; - goto yy111; - } else { - if(yych == 'e') goto yy111; - goto yy54; - } - } -yy1057: - YYDEBUG(1057, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '0') goto yy54; - if(yych <= '9') goto yy1060; - goto yy54; -yy1058: - YYDEBUG(1058, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1060; - goto yy54; -yy1059: - YYDEBUG(1059, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '4') goto yy54; - goto yy1060; -yy1060: - YYDEBUG(1060, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy1061; - if(yych <= '7') goto yy1062; - goto yy1061; -yy1061: - YYDEBUG(1061, *YYCURSOR); - -#line 1172 "resource/parse_date.re" -{ - timelib_sll w, d; - DEBUG_OUTPUT("isoweek"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = 1; - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } -#line 14019 "" -yy1062: - YYDEBUG(1062, *YYCURSOR); - ++YYCURSOR; - goto yy1063; -yy1063: - YYDEBUG(1063, *YYCURSOR); - -#line 1153 "resource/parse_date.re" -{ - timelib_sll w, d; - DEBUG_OUTPUT("isoweekday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = timelib_get_nr((char **) &ptr, 1); - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } -#line 14041 "" -yy1064: - YYDEBUG(1064, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1066; - goto yy67; -yy1065: - YYDEBUG(1065, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '6') goto yy1066; - if(yych <= '9') goto yy76; - goto yy67; -yy1066: - YYDEBUG(1066, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= 'X'){ - if(yych <= 'G'){ - if(yych <= 'C'){ - if(yych == ' ') goto yy67; - goto yy1067; - } else { - if(yych == 'E') goto yy1067; - if(yych <= 'F') goto yy67; - goto yy1067; - } - } else { - if(yych <= 'R'){ - if(yych <= 'H') goto yy67; - if(yych == 'M') goto yy67; - goto yy1067; - } else { - if(yych <= 'T') goto yy67; - if(yych == 'W') goto yy67; - goto yy1067; - } - } - } else { - if(yych <= 'l'){ - if(yych <= 'e'){ - if(yych <= 'Y') goto yy67; - if(yych == 'd') goto yy67; - goto yy1067; - } else { - if(yych == 'g') goto yy1067; - if(yych <= 'h') goto yy67; - goto yy1067; - } - } else { - if(yych <= 'v'){ - if(yych <= 'm') goto yy67; - if(yych <= 'r') goto yy1067; - if(yych <= 't') goto yy67; - goto yy1067; - } else { - if(yych == 'x') goto yy1067; - if(yych <= 'y') goto yy67; - goto yy1067; - } - } - } -yy1067: - YYDEBUG(1067, *YYCURSOR); - -#line 1140 "resource/parse_date.re" -{ - DEBUG_OUTPUT("pgydotd"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = timelib_get_nr((char **) &ptr, 3); - s->time->m = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_YEARDAY; - } -#line 14114 "" -yy1068: - YYDEBUG(1068, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1066; - goto yy67; -yy1069: - YYDEBUG(1069, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '2'){ - if(yych <= '/') goto yy67; - if(yych >= '1') goto yy1071; - goto yy1070; - } else { - if(yych <= '3') goto yy1072; - if(yych <= '9') goto yy1066; - goto yy67; - } -yy1070: - YYDEBUG(1070, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': goto yy76; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1073; - default: goto yy1067; - } -yy1071: - YYDEBUG(1071, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1073; - default: goto yy1067; - } -yy1072: - YYDEBUG(1072, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': goto yy1073; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy76; - default: goto yy1067; - } -yy1073: - YYDEBUG(1073, *YYCURSOR); - yyaccept = 16; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 16) { - goto yy66; - } - YYDEBUG(-1, yych); - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy76; - case 'D': case 'd': goto yy71; - case 'F': case 'f': goto yy73; - case 'H': case 'h': goto yy70; - case 'M': case 'm': goto yy69; - case 'S': case 's': goto yy68; - case 'T': goto yy1075; - case 'W': case 'w': goto yy72; - case 'Y': case 'y': goto yy74; - case 't': goto yy1076; - default: goto yy1074; - } -yy1074: - YYDEBUG(1074, *YYCURSOR); - -#line 1106 "resource/parse_date.re" -{ - DEBUG_OUTPUT("datenocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_DATE_NOCOLON; - } -#line 14222 "" -yy1075: - YYDEBUG(1075, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'H'){ - if(yych <= '2'){ - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy1092; - goto yy1093; - } else { - if(yych <= '9') goto yy1094; - if(yych <= 'G') goto yy54; - goto yy78; - } - } else { - if(yych <= 'g'){ - if(yych == 'U') goto yy79; - goto yy54; - } else { - if(yych <= 'h') goto yy78; - if(yych == 'u') goto yy79; - goto yy54; - } - } -yy1076: - YYDEBUG(1076, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'H'){ - if(yych <= '2'){ - if(yych <= '/') goto yy54; - if(yych >= '2') goto yy1078; - goto yy1077; - } else { - if(yych <= '9') goto yy1079; - if(yych <= 'G') goto yy54; - goto yy78; - } - } else { - if(yych <= 'g'){ - if(yych == 'U') goto yy79; - goto yy54; - } else { - if(yych <= 'h') goto yy78; - if(yych == 'u') goto yy79; - goto yy54; - } - } -yy1077: - YYDEBUG(1077, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1086; - if(yych <= '9') goto yy1079; - goto yy54; -yy1078: - YYDEBUG(1078, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '3') goto yy1086; - if(yych <= '5') goto yy1080; - goto yy54; -yy1079: - YYDEBUG(1079, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '6') goto yy54; - goto yy1080; -yy1080: - YYDEBUG(1080, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1081; -yy1081: - YYDEBUG(1081, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1082; - if(yych <= '6') goto yy1083; - goto yy54; -yy1082: - YYDEBUG(1082, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1084; - goto yy54; -yy1083: - YYDEBUG(1083, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '0') goto yy54; - goto yy1084; -yy1084: - YYDEBUG(1084, *YYCURSOR); - ++YYCURSOR; - goto yy1085; -yy1085: - YYDEBUG(1085, *YYCURSOR); - -#line 1118 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 9); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_XMLRPC_SOAP; - } -#line 14319 "" -yy1086: - YYDEBUG(1086, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1087; - if(yych <= '9') goto yy1081; - goto yy54; -yy1087: - YYDEBUG(1087, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1088; - if(yych <= '6') goto yy1089; - if(yych <= '9') goto yy1081; - goto yy54; -yy1088: - YYDEBUG(1088, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1090; - if(yych <= '6') goto yy1091; - if(yych <= '9') goto yy1084; - goto yy54; -yy1089: - YYDEBUG(1089, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '0') goto yy1090; - if(yych <= '5') goto yy1082; - if(yych <= '6') goto yy1083; - goto yy54; -yy1090: - YYDEBUG(1090, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1085; - if(yych <= '9') goto yy1084; - goto yy1085; -yy1091: - YYDEBUG(1091, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '0') goto yy1084; - goto yy1085; -yy1092: - YYDEBUG(1092, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1101; - if(yych <= '9') goto yy1094; - if(yych <= ':') goto yy1095; - goto yy54; -yy1093: - YYDEBUG(1093, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '5'){ - if(yych <= '/') goto yy54; - if(yych <= '3') goto yy1101; - goto yy1080; - } else { - if(yych == ':') goto yy1095; - goto yy54; - } -yy1094: - YYDEBUG(1094, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1080; - if(yych != ':') goto yy54; - goto yy1095; -yy1095: - YYDEBUG(1095, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '6') goto yy54; - goto yy1096; -yy1096: - YYDEBUG(1096, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1097; -yy1097: - YYDEBUG(1097, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy1098; -yy1098: - YYDEBUG(1098, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1099; - if(yych <= '6') goto yy1100; - goto yy54; -yy1099: - YYDEBUG(1099, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1084; - goto yy54; -yy1100: - YYDEBUG(1100, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '0') goto yy1084; - goto yy54; -yy1101: - YYDEBUG(1101, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1087; - if(yych <= '9') goto yy1081; - if(yych <= ':') goto yy1095; - goto yy54; -yy1102: - YYDEBUG(1102, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '0') goto yy76; - if(yych <= '9') goto yy1066; - goto yy67; -yy1103: - YYDEBUG(1103, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '2'){ - if(yych <= '/') goto yy67; - if(yych <= '0') goto yy1070; - goto yy1071; - } else { - if(yych <= '3') goto yy1072; - if(yych <= '9') goto yy1066; - goto yy67; - } -yy1104: - YYDEBUG(1104, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1105; - if(yych != 'c') goto yy54; - goto yy1105; -yy1105: - YYDEBUG(1105, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy1106; - if(yych != 'e') goto yy1041; - goto yy1106; -yy1106: - YYDEBUG(1106, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy1107; - if(yych != 'm') goto yy54; - goto yy1107; -yy1107: - YYDEBUG(1107, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1108; - if(yych != 'b') goto yy54; - goto yy1108; -yy1108: - YYDEBUG(1108, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1109; - if(yych != 'e') goto yy54; - goto yy1109; -yy1109: - YYDEBUG(1109, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1110; - if(yych != 'r') goto yy54; - goto yy1110; -yy1110: - YYDEBUG(1110, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1041; -yy1111: - YYDEBUG(1111, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy1112; - if(yych != 'v') goto yy54; - goto yy1112; -yy1112: - YYDEBUG(1112, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy1113; - if(yych != 'e') goto yy1041; - goto yy1113; -yy1113: - YYDEBUG(1113, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy1114; - if(yych != 'm') goto yy54; - goto yy1114; -yy1114: - YYDEBUG(1114, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1115; - if(yych != 'b') goto yy54; - goto yy1115; -yy1115: - YYDEBUG(1115, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1116; - if(yych != 'e') goto yy54; - goto yy1116; -yy1116: - YYDEBUG(1116, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1110; - if(yych == 'r') goto yy1110; - goto yy54; -yy1117: - YYDEBUG(1117, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy1118; - if(yych != 't') goto yy54; - goto yy1118; -yy1118: - YYDEBUG(1118, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'O') goto yy1119; - if(yych != 'o') goto yy1041; - goto yy1119; -yy1119: - YYDEBUG(1119, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1120; - if(yych != 'b') goto yy54; - goto yy1120; -yy1120: - YYDEBUG(1120, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1121; - if(yych != 'e') goto yy54; - goto yy1121; -yy1121: - YYDEBUG(1121, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1110; - if(yych == 'r') goto yy1110; - goto yy54; -yy1122: - YYDEBUG(1122, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'P'){ - if(yych == 'C') goto yy134; - if(yych <= 'O') goto yy54; - goto yy1123; - } else { - if(yych <= 'c'){ - if(yych <= 'b') goto yy54; - goto yy134; - } else { - if(yych != 'p') goto yy54; - goto yy1123; - } - } -yy1123: - YYDEBUG(1123, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy1124; - if(yych != 't') goto yy1041; - goto yy1124; -yy1124: - YYDEBUG(1124, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'E') goto yy1125; - if(yych != 'e') goto yy1041; - goto yy1125; -yy1125: - YYDEBUG(1125, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'M') goto yy1126; - if(yych != 'm') goto yy54; - goto yy1126; -yy1126: - YYDEBUG(1126, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1127; - if(yych != 'b') goto yy54; - goto yy1127; -yy1127: - YYDEBUG(1127, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1128; - if(yych != 'e') goto yy54; - goto yy1128; -yy1128: - YYDEBUG(1128, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1110; - if(yych == 'r') goto yy1110; - goto yy54; -yy1129: - YYDEBUG(1129, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy1133; - if(yych == 'g') goto yy1133; - goto yy54; -yy1130: - YYDEBUG(1130, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1131; - if(yych != 'r') goto yy54; - goto yy1131; -yy1131: - YYDEBUG(1131, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'I') goto yy1132; - if(yych != 'i') goto yy1041; - goto yy1132; -yy1132: - YYDEBUG(1132, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'L') goto yy1110; - if(yych == 'l') goto yy1110; - goto yy54; -yy1133: - YYDEBUG(1133, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy1134; - if(yych != 'u') goto yy1041; - goto yy1134; -yy1134: - YYDEBUG(1134, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'S') goto yy1135; - if(yych != 's') goto yy54; - goto yy1135; -yy1135: - YYDEBUG(1135, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy1110; - if(yych == 't') goto yy1110; - goto yy54; -yy1136: - YYDEBUG(1136, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy1137; - if(yych <= 'X') goto yy54; - goto yy1110; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy1137; - } else { - if(yych == 'y') goto yy1110; - goto yy54; - } - } -yy1137: - YYDEBUG(1137, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'C') goto yy1138; - if(yych != 'c') goto yy1041; - goto yy1138; -yy1138: - YYDEBUG(1138, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'H') goto yy1110; - if(yych == 'h') goto yy1110; - goto yy54; -yy1139: - YYDEBUG(1139, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1140; - if(yych != 'b') goto yy54; - goto yy1140; -yy1140: - YYDEBUG(1140, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'R') goto yy1141; - if(yych != 'r') goto yy1041; - goto yy1141; -yy1141: - YYDEBUG(1141, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'U') goto yy1142; - if(yych != 'u') goto yy54; - goto yy1142; -yy1142: - YYDEBUG(1142, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy1143; - if(yych != 'a') goto yy54; - goto yy1143; -yy1143: - YYDEBUG(1143, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1144; - if(yych != 'r') goto yy54; - goto yy1144; -yy1144: - YYDEBUG(1144, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy1110; - if(yych == 'y') goto yy1110; - goto yy54; -yy1145: - YYDEBUG(1145, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy1152; - if(yych <= 'M') goto yy54; - goto yy1151; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy1152; - } else { - if(yych == 'n') goto yy1151; - goto yy54; - } - } -yy1146: - YYDEBUG(1146, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy1147; - if(yych != 'n') goto yy54; - goto yy1147; -yy1147: - YYDEBUG(1147, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy1148; - if(yych != 'u') goto yy1041; - goto yy1148; -yy1148: - YYDEBUG(1148, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy1149; - if(yych != 'a') goto yy54; - goto yy1149; -yy1149: - YYDEBUG(1149, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1150; - if(yych != 'r') goto yy54; - goto yy1150; -yy1150: - YYDEBUG(1150, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy1110; - if(yych == 'y') goto yy1110; - goto yy54; -yy1151: - YYDEBUG(1151, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1110; - if(yych == 'e') goto yy1110; - goto yy1041; -yy1152: - YYDEBUG(1152, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'Y') goto yy1110; - if(yych == 'y') goto yy1110; - goto yy1041; -yy1153: - YYDEBUG(1153, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'I') goto yy1110; - goto yy1041; -yy1154: - YYDEBUG(1154, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'I') goto yy1041; - goto yy1155; -yy1155: - YYDEBUG(1155, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'I') goto yy1110; - goto yy1041; -yy1156: - YYDEBUG(1156, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'I') goto yy1110; - goto yy1041; -yy1157: - YYDEBUG(1157, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '0') goto yy1170; - if(yych <= '9') goto yy1169; - goto yy54; -yy1158: - YYDEBUG(1158, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1168; - goto yy54; -yy1159: - YYDEBUG(1159, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1166; - if(yych <= '6') goto yy1165; - goto yy54; -yy1160: - YYDEBUG(1160, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1139; - if(yych == 'e') goto yy1139; - goto yy54; -yy1161: - YYDEBUG(1161, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy1136; - if(yych == 'a') goto yy1136; - goto yy54; -yy1162: - YYDEBUG(1162, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1164; - if(yych == 'e') goto yy1164; - goto yy54; -yy1163: - YYDEBUG(1163, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1104; - if(yych == 'e') goto yy1104; - goto yy54; -yy1164: - YYDEBUG(1164, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy1123; - if(yych == 'p') goto yy1123; - goto yy54; -yy1165: - YYDEBUG(1165, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '6') goto yy1167; - goto yy54; -yy1166: - YYDEBUG(1166, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1167; -yy1167: - YYDEBUG(1167, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1067; -yy1168: - YYDEBUG(1168, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1167; - goto yy54; -yy1169: - YYDEBUG(1169, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1167; - goto yy54; -yy1170: - YYDEBUG(1170, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '0') goto yy54; - if(yych <= '9') goto yy1167; - goto yy54; -yy1171: - YYDEBUG(1171, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '.') goto yy54; - if(yych <= '/') goto yy1174; - if(yych <= '0') goto yy1173; - if(yych <= '9') goto yy1179; - goto yy54; -yy1172: - YYDEBUG(1172, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '.') goto yy54; - if(yych <= '/') goto yy1174; - if(yych <= '2') goto yy1179; - goto yy54; -yy1173: - YYDEBUG(1173, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '/') goto yy54; - goto yy1174; -yy1174: - YYDEBUG(1174, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '2') goto yy1175; - if(yych <= '3') goto yy1177; - if(yych <= '9') goto yy1178; - goto yy54; -yy1175: - YYDEBUG(1175, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy1176; - if(yych <= '9') goto yy1178; - goto yy1176; -yy1176: - YYDEBUG(1176, *YYCURSOR); - -#line 1005 "resource/parse_date.re" -{ - DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 14751 "" -yy1177: - YYDEBUG(1177, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1176; - if(yych >= '2') goto yy1176; - goto yy1178; -yy1178: - YYDEBUG(1178, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1176; -yy1179: - YYDEBUG(1179, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '/') goto yy54; - goto yy1180; -yy1180: - YYDEBUG(1180, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '2'){ - if(yych <= '/') goto yy54; - if(yych >= '1') goto yy1182; - goto yy1181; - } else { - if(yych <= '3') goto yy1183; - if(yych <= '9') goto yy1178; - goto yy54; - } -yy1181: - YYDEBUG(1181, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1176; - if(yych <= '0') goto yy1178; - if(yych <= '9') goto yy1184; - goto yy1176; -yy1182: - YYDEBUG(1182, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1176; - if(yych <= '9') goto yy1184; - goto yy1176; -yy1183: - YYDEBUG(1183, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1176; - if(yych >= '2') goto yy1176; - goto yy1184; -yy1184: - YYDEBUG(1184, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '/') goto yy1178; - goto yy1176; -yy1185: - YYDEBUG(1185, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'A') goto yy1249; - if(yych <= 'T') goto yy54; - goto yy1248; - } else { - if(yych <= 'a'){ - if(yych <= '`') goto yy54; - goto yy1249; - } else { - if(yych == 'u') goto yy1248; - goto yy54; - } - } -yy1186: - YYDEBUG(1186, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1246; - if(yych == 'e') goto yy1246; - goto yy54; -yy1187: - YYDEBUG(1187, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'A') goto yy1243; - if(yych == 'a') goto yy1243; - goto yy54; -yy1188: - YYDEBUG(1188, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'U'){ - if(yych == 'P') goto yy1240; - if(yych <= 'T') goto yy54; - goto yy1239; - } else { - if(yych <= 'p'){ - if(yych <= 'o') goto yy54; - goto yy1240; - } else { - if(yych == 'u') goto yy1239; - goto yy54; - } - } -yy1189: - YYDEBUG(1189, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1236; - if(yych == 'e') goto yy1236; - goto yy54; -yy1190: - YYDEBUG(1190, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1234; - if(yych == 'c') goto yy1234; - goto yy54; -yy1191: - YYDEBUG(1191, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'O') goto yy1232; - if(yych == 'o') goto yy1232; - goto yy54; -yy1192: - YYDEBUG(1192, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'E') goto yy1230; - if(yych == 'e') goto yy1230; - goto yy54; -yy1193: - YYDEBUG(1193, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych == '-') goto yy941; - goto yy54; - } else { - if(yych <= '0') goto yy904; - if(yych <= '9') goto yy1195; - goto yy54; - } -yy1194: - YYDEBUG(1194, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy941; - if(yych <= '/') goto yy54; - if(yych >= '3') goto yy54; - goto yy1195; -yy1195: - YYDEBUG(1195, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '-') goto yy54; - goto yy1196; -yy1196: - YYDEBUG(1196, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '2'){ - if(yych <= '/') goto yy54; - if(yych >= '1') goto yy1198; - goto yy1197; - } else { - if(yych <= '3') goto yy1199; - if(yych <= '9') goto yy945; - goto yy54; - } -yy1197: - YYDEBUG(1197, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy943; - if(yych <= '0') goto yy945; - if(yych <= '9') goto yy1200; - goto yy943; -yy1198: - YYDEBUG(1198, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy943; - if(yych <= '9') goto yy1200; - goto yy943; -yy1199: - YYDEBUG(1199, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy943; - if(yych >= '2') goto yy943; - goto yy1200; -yy1200: - YYDEBUG(1200, *YYCURSOR); - yyaccept = 18; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'T') goto yy1176; - goto yy1201; -yy1201: - YYDEBUG(1201, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy1202; - if(yych <= '2') goto yy1203; - if(yych <= '9') goto yy1204; - goto yy54; -yy1202: - YYDEBUG(1202, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1211; - if(yych <= ':') goto yy1205; - goto yy54; -yy1203: - YYDEBUG(1203, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '3') goto yy1211; - if(yych == ':') goto yy1205; - goto yy54; -yy1204: - YYDEBUG(1204, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy1205; -yy1205: - YYDEBUG(1205, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '6') goto yy54; - goto yy1206; -yy1206: - YYDEBUG(1206, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1207; -yy1207: - YYDEBUG(1207, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy1208; -yy1208: - YYDEBUG(1208, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1209; - if(yych <= '6') goto yy1210; - goto yy54; -yy1209: - YYDEBUG(1209, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1084; - goto yy54; -yy1210: - YYDEBUG(1210, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '0') goto yy1084; - goto yy54; -yy1211: - YYDEBUG(1211, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy1212; -yy1212: - YYDEBUG(1212, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= '6') goto yy54; - goto yy1213; -yy1213: - YYDEBUG(1213, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1214; -yy1214: - YYDEBUG(1214, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != ':') goto yy54; - goto yy1215; -yy1215: - YYDEBUG(1215, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1216; - if(yych <= '6') goto yy1217; - goto yy54; -yy1216: - YYDEBUG(1216, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1218; - goto yy54; -yy1217: - YYDEBUG(1217, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '0') goto yy54; - goto yy1218; -yy1218: - YYDEBUG(1218, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != '.') goto yy1085; - goto yy1219; -yy1219: - YYDEBUG(1219, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1220; -yy1220: - YYDEBUG(1220, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 6) YYFILL(6); - yych = *YYCURSOR; - goto yy1221; -yy1221: - YYDEBUG(1221, *YYCURSOR); - if(yych <= ','){ - if(yych != '+') goto yy54; - goto yy1222; - } else { - if(yych <= '-') goto yy1222; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1220; - goto yy54; - } -yy1222: - YYDEBUG(1222, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '1') goto yy1223; - if(yych <= '2') goto yy1224; - if(yych <= '9') goto yy1225; - goto yy54; -yy1223: - YYDEBUG(1223, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1085; - if(yych <= '5') goto yy1228; - if(yych <= '9') goto yy1225; - if(yych <= ':') goto yy1226; - goto yy1085; -yy1224: - YYDEBUG(1224, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '5'){ - if(yych <= '/') goto yy1085; - if(yych <= '3') goto yy1228; - goto yy1227; - } else { - if(yych == ':') goto yy1226; - goto yy1085; - } -yy1225: - YYDEBUG(1225, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy1085; - if(yych <= '5') goto yy1227; - if(yych != ':') goto yy1085; - goto yy1226; -yy1226: - YYDEBUG(1226, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/') goto yy1085; - if(yych >= '6') goto yy1085; - goto yy1227; -yy1227: - YYDEBUG(1227, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1084; - goto yy54; -yy1228: - YYDEBUG(1228, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1085; - if(yych <= '5') goto yy1229; - if(yych <= '9') goto yy1084; - if(yych <= ':') goto yy1226; - goto yy1085; -yy1229: - YYDEBUG(1229, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy1085; - if(yych <= '9') goto yy1084; - goto yy1085; -yy1230: - YYDEBUG(1230, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'C') goto yy1231; - if(yych != 'c') goto yy54; - goto yy1231; -yy1231: - YYDEBUG(1231, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'E') goto yy1106; - if(yych == 'e') goto yy1106; - goto yy1041; - } -yy1232: - YYDEBUG(1232, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'V') goto yy1233; - if(yych != 'v') goto yy54; - goto yy1233; -yy1233: - YYDEBUG(1233, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'E') goto yy1113; - if(yych == 'e') goto yy1113; - goto yy1041; - } -yy1234: - YYDEBUG(1234, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'T') goto yy1235; - if(yych != 't') goto yy54; - goto yy1235; -yy1235: - YYDEBUG(1235, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'N'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'O') goto yy1119; - if(yych == 'o') goto yy1119; - goto yy1041; - } -yy1236: - YYDEBUG(1236, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'P') goto yy1237; - if(yych != 'p') goto yy54; - goto yy1237; -yy1237: - YYDEBUG(1237, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'S'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'T') goto yy1238; - if(yych != 't') goto yy1041; - goto yy1238; - } -yy1238: - YYDEBUG(1238, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'E') goto yy1125; - if(yych == 'e') goto yy1125; - goto yy1041; - } -yy1239: - YYDEBUG(1239, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'G') goto yy1242; - if(yych == 'g') goto yy1242; - goto yy54; -yy1240: - YYDEBUG(1240, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'R') goto yy1241; - if(yych != 'r') goto yy54; - goto yy1241; -yy1241: - YYDEBUG(1241, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'H'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'I') goto yy1132; - if(yych == 'i') goto yy1132; - goto yy1041; - } -yy1242: - YYDEBUG(1242, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'T'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'U') goto yy1134; - if(yych == 'u') goto yy1134; - goto yy1041; - } -yy1243: - YYDEBUG(1243, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'Y'){ - if(yych == 'R') goto yy1244; - if(yych <= 'X') goto yy54; - goto yy1245; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy54; - goto yy1244; - } else { - if(yych == 'y') goto yy1245; - goto yy54; - } - } -yy1244: - YYDEBUG(1244, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'B'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'C') goto yy1138; - if(yych == 'c') goto yy1138; - goto yy1041; - } -yy1245: - YYDEBUG(1245, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '-') goto yy1015; - goto yy1041; -yy1246: - YYDEBUG(1246, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'B') goto yy1247; - if(yych != 'b') goto yy54; - goto yy1247; -yy1247: - YYDEBUG(1247, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Q'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'R') goto yy1141; - if(yych == 'r') goto yy1141; - goto yy1041; - } -yy1248: - YYDEBUG(1248, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'N'){ - if(yych == 'L') goto yy1252; - if(yych <= 'M') goto yy54; - goto yy1251; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy54; - goto yy1252; - } else { - if(yych == 'n') goto yy1251; - goto yy54; - } - } -yy1249: - YYDEBUG(1249, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 'N') goto yy1250; - if(yych != 'n') goto yy54; - goto yy1250; -yy1250: - YYDEBUG(1250, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'T'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'U') goto yy1148; - if(yych == 'u') goto yy1148; - goto yy1041; - } -yy1251: - YYDEBUG(1251, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'D'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'E') goto yy1110; - if(yych == 'e') goto yy1110; - goto yy1041; - } -yy1252: - YYDEBUG(1252, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'X'){ - if(yych == '-') goto yy1015; - goto yy1041; - } else { - if(yych <= 'Y') goto yy1110; - if(yych == 'y') goto yy1110; - goto yy1041; - } -yy1253: - YYDEBUG(1253, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'P'){ - if(yych == 'C') goto yy134; - if(yych <= 'O') goto yy54; - goto yy877; - } else { - if(yych <= 'c'){ - if(yych <= 'b') goto yy54; - goto yy134; - } else { - if(yych == 'p') goto yy877; - goto yy54; - } - } -yy1254: - YYDEBUG(1254, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '.'){ - if(yych <= ',') goto yy1256; - if(yych <= '-') goto yy783; - goto yy1257; - } else { - if(yych <= '/') goto yy1258; - if(yych <= '9') goto yy1003; - goto yy1256; - } -yy1255: - YYDEBUG(1255, *YYCURSOR); - ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; - goto yy1256; -yy1256: - YYDEBUG(1256, *YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': goto yy1255; - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': goto yy784; - case 'A': case 'a': goto yy867; - case 'D': case 'd': goto yy779; - case 'F': case 'f': goto yy780; - case 'H': case 'h': goto yy70; - case 'I': goto yy787; - case 'J': case 'j': goto yy791; - case 'M': case 'm': goto yy778; - case 'N': case 'n': goto yy794; - case 'O': case 'o': goto yy793; - case 'S': case 's': goto yy777; - case 'T': case 't': goto yy75; - case 'V': goto yy789; - case 'W': case 'w': goto yy72; - case 'X': goto yy790; - case 'Y': case 'y': goto yy74; - default: goto yy54; - } -yy1257: - YYDEBUG(1257, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy785; - if(yych <= '0') goto yy1259; - if(yych <= '1') goto yy1260; - if(yych <= '9') goto yy1261; - goto yy785; -yy1258: - YYDEBUG(1258, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch(yych){ - case 'A': case 'a': goto yy953; - case 'D': case 'd': goto yy957; - case 'F': case 'f': goto yy951; - case 'J': case 'j': goto yy950; - case 'M': case 'm': goto yy952; - case 'N': case 'n': goto yy956; - case 'O': case 'o': goto yy955; - case 'S': case 's': goto yy954; - default: goto yy54; - } -yy1259: - YYDEBUG(1259, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '.') goto yy1262; - if(yych <= '/') goto yy54; - if(yych <= '9') goto yy1261; - goto yy54; -yy1260: - YYDEBUG(1260, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '.') goto yy1262; - if(yych <= '/') goto yy54; - if(yych >= '3') goto yy54; - goto yy1261; -yy1261: - YYDEBUG(1261, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != '.') goto yy54; - goto yy1262; -yy1262: - YYDEBUG(1262, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych >= ':') goto yy54; - goto yy1263; -yy1263: - YYDEBUG(1263, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy897; - if(yych <= '9') goto yy896; - goto yy897; -yy1264: - YYDEBUG(1264, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych <= ',') goto yy1256; - if(yych <= '-') goto yy783; - if(yych >= '/') goto yy1258; - goto yy1265; - } else { - if(yych <= '5') goto yy1267; - if(yych <= '9') goto yy1003; - if(yych <= ':') goto yy1266; - goto yy1256; - } -yy1265: - YYDEBUG(1265, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '1'){ - if(yych <= '/') goto yy785; - if(yych <= '0') goto yy1289; - goto yy1290; - } else { - if(yych <= '5') goto yy1291; - if(yych <= '9') goto yy1292; - goto yy785; - } -yy1266: - YYDEBUG(1266, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1284; - if(yych <= '9') goto yy1285; - goto yy54; -yy1267: - YYDEBUG(1267, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == '-') goto yy1004; - if(yych <= '/') goto yy67; - if(yych >= ':') goto yy67; - goto yy1268; -yy1268: - YYDEBUG(1268, *YYCURSOR); - yyaccept = 20; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': - case '!': - case '"': - case '#': - case '$': - case '%': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': case 'A': case 'D': case 'F': case 'H': - case 'I': - case 'J': case 'M': - case 'N': - case 'O': case 'S': - case 'T': case 'V': case 'X': - case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': - case 'n': - case 'o': case 's': - case 't': case 'w': case 'y': goto yy1036; - case '-': goto yy1033; - case '.': goto yy1039; - case '/': goto yy1034; - case '0': goto yy1270; - case '1': goto yy1271; - case '2': goto yy1272; - case '3': goto yy1273; - case '4': - case '5': goto yy1274; - case '6': goto yy1275; - case '7': - case '8': - case '9': goto yy76; - case 'W': goto yy1056; - default: goto yy1269; - } -yy1269: - YYDEBUG(1269, *YYCURSOR); - -#line 927 "resource/parse_date.re" -{ - DEBUG_OUTPUT("gnunocolon"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON; - } -#line 15398 "" -yy1270: - YYDEBUG(1270, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '0') goto yy1282; - if(yych <= '9') goto yy1283; - goto yy67; -yy1271: - YYDEBUG(1271, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '2') goto yy1281; - if(yych <= '9') goto yy1280; - goto yy67; -yy1272: - YYDEBUG(1272, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1280; - goto yy67; -yy1273: - YYDEBUG(1273, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '5') goto yy1278; - if(yych <= '6') goto yy1279; - if(yych <= '9') goto yy1276; - goto yy67; -yy1274: - YYDEBUG(1274, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '9') goto yy1276; - goto yy67; -yy1275: - YYDEBUG(1275, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy67; - if(yych <= '0') goto yy1276; - if(yych <= '9') goto yy76; - goto yy67; -yy1276: - YYDEBUG(1276, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 32) { - goto yy76; - } - if(yych <= 'X'){ - if(yych <= 'G'){ - if(yych <= 'C'){ - if(yych == ' ') goto yy67; - goto yy1277; - } else { - if(yych == 'E') goto yy1277; - if(yych <= 'F') goto yy67; - goto yy1277; - } - } else { - if(yych <= 'R'){ - if(yych <= 'H') goto yy67; - if(yych == 'M') goto yy67; - goto yy1277; - } else { - if(yych <= 'T') goto yy67; - if(yych == 'W') goto yy67; - goto yy1277; - } - } - } else { - if(yych <= 'l'){ - if(yych <= 'e'){ - if(yych <= 'Y') goto yy67; - if(yych == 'd') goto yy67; - goto yy1277; - } else { - if(yych == 'g') goto yy1277; - if(yych <= 'h') goto yy67; - goto yy1277; - } - } else { - if(yych <= 'v'){ - if(yych <= 'm') goto yy67; - if(yych <= 'r') goto yy1277; - if(yych <= 't') goto yy67; - goto yy1277; - } else { - if(yych == 'x') goto yy1277; - if(yych <= 'y') goto yy67; - goto yy1277; - } - } - } -yy1277: - YYDEBUG(1277, *YYCURSOR); - -#line 972 "resource/parse_date.re" -{ - int tz_not_found; - DEBUG_OUTPUT("iso8601nocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_ISO_NOCOLON; - } -#line 15496 "" -yy1278: - YYDEBUG(1278, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1066; - default: goto yy1277; - } -yy1279: - YYDEBUG(1279, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': goto yy1066; - case '7': - case '8': - case '9': goto yy76; - default: goto yy1277; - } -yy1280: - YYDEBUG(1280, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1066; - default: goto yy1277; - } -yy1281: - YYDEBUG(1281, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': goto yy1070; - case '1': - case '2': goto yy1071; - case '3': goto yy1072; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1066; - default: goto yy1277; - } -yy1282: - YYDEBUG(1282, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': goto yy76; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1066; - default: goto yy1277; - } -yy1283: - YYDEBUG(1283, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch(yych){ - case ' ': case 'D': case 'F': case 'H': case 'M': case 'S': - case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's': - case 't': case 'w': case 'y': goto yy67; - case '0': goto yy1070; - case '1': - case '2': goto yy1071; - case '3': goto yy1072; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1066; - default: goto yy1277; - } -yy1284: - YYDEBUG(1284, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy1286; - goto yy802; - } else { - if(yych <= '9') goto yy1285; - if(yych <= ':') goto yy1286; - goto yy802; - } -yy1285: - YYDEBUG(1285, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy1286; - if(yych != ':') goto yy802; - goto yy1286; -yy1286: - YYDEBUG(1286, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1287; - if(yych <= '6') goto yy1288; - if(yych <= '9') goto yy807; - goto yy54; -yy1287: - YYDEBUG(1287, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy807; - goto yy802; -yy1288: - YYDEBUG(1288, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych == '0') goto yy807; - goto yy802; -yy1289: - YYDEBUG(1289, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy1293; - goto yy802; - } else { - if(yych <= '9') goto yy1292; - if(yych <= ':') goto yy1286; - goto yy802; - } -yy1290: - YYDEBUG(1290, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy1293; - goto yy802; - } else { - if(yych <= '2') goto yy1292; - if(yych <= '9') goto yy1285; - if(yych <= ':') goto yy1286; - goto yy802; - } -yy1291: - YYDEBUG(1291, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy1293; - goto yy802; - } else { - if(yych <= '9') goto yy1285; - if(yych <= ':') goto yy1286; - goto yy802; - } -yy1292: - YYDEBUG(1292, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy1293; - if(yych == ':') goto yy1286; - goto yy802; -yy1293: - YYDEBUG(1293, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/') goto yy54; - if(yych <= '5') goto yy1294; - if(yych <= '6') goto yy1295; - if(yych <= '9') goto yy895; - goto yy54; -yy1294: - YYDEBUG(1294, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy1296; - goto yy802; -yy1295: - YYDEBUG(1295, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '/'){ - if(yych == '.') goto yy808; - goto yy802; - } else { - if(yych <= '0') goto yy1296; - if(yych <= '9') goto yy896; - goto yy802; - } -yy1296: - YYDEBUG(1296, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '.') goto yy808; - if(yych <= '/') goto yy802; - if(yych <= '9') goto yy898; - goto yy802; -yy1297: - YYDEBUG(1297, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych <= ',') goto yy776; - if(yych <= '-') goto yy783; - if(yych <= '.') goto yy786; - goto yy782; - } else { - if(yych <= '5') goto yy1267; - if(yych <= '9') goto yy1003; - if(yych <= ':') goto yy795; - goto yy776; - } -yy1298: - YYDEBUG(1298, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych <= ',') goto yy1256; - if(yych <= '-') goto yy783; - if(yych <= '.') goto yy1265; - goto yy782; - } else { - if(yych <= '5') goto yy1267; - if(yych <= '9') goto yy1003; - if(yych <= ':') goto yy1266; - goto yy1256; - } -yy1299: - YYDEBUG(1299, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '0') goto yy54; - if(yych >= ':') goto yy54; - goto yy1300; -yy1300: - YYDEBUG(1300, *YYCURSOR); - ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy1301; -yy1301: - YYDEBUG(1301, *YYCURSOR); - if(yych <= '/') goto yy1302; - if(yych <= '9') goto yy1300; - goto yy1302; -yy1302: - YYDEBUG(1302, *YYCURSOR); - -#line 862 "resource/parse_date.re" -{ - timelib_ull i; - - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_DATE(); - TIMELIB_UNHAVE_TIME(); - - i = timelib_get_unsigned_nr((char **) &ptr, 24); - s->time->y = 1970; - s->time->m = 1; - s->time->d = 1; - s->time->h = s->time->i = s->time->s = 0; - s->time->f = 0.0; - s->time->relative.s += i; - s->time->is_localtime = 1; - s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; - s->time->z = 0; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15760 "" -yy1303: - YYDEBUG(1303, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'c'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy49; - if(yych <= '`') goto yy3; - goto yy49; - } else { - if(yych <= 'l'){ - if(yych >= 'e') goto yy49; - goto yy1304; - } else { - if(yych <= 'm') goto yy1305; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy1304: - YYDEBUG(1304, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych <= 'a') goto yy1312; - if(yych <= 'z') goto yy50; - goto yy3; - } -yy1305: - YYDEBUG(1305, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'o') goto yy1306; - if(yych <= 'z') goto yy50; - goto yy3; - } -yy1306: - YYDEBUG(1306, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy3; - goto yy1307; -yy1307: - YYDEBUG(1307, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'r') goto yy54; - goto yy1308; -yy1308: - YYDEBUG(1308, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'o') goto yy54; - goto yy1309; -yy1309: - YYDEBUG(1309, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'w') goto yy54; - goto yy1310; -yy1310: - YYDEBUG(1310, *YYCURSOR); - ++YYCURSOR; - goto yy1311; -yy1311: - YYDEBUG(1311, *YYCURSOR); - -#line 850 "resource/parse_date.re" -{ - DEBUG_OUTPUT("tomorrow"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = 1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15824 "" -yy1312: - YYDEBUG(1312, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'y') goto yy3; - goto yy1313; -yy1313: - YYDEBUG(1313, *YYCURSOR); - ++YYCURSOR; - goto yy1314; -yy1314: - YYDEBUG(1314, *YYCURSOR); - -#line 840 "resource/parse_date.re" -{ - DEBUG_OUTPUT("midnight | today"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15840 "" -yy1315: - YYDEBUG(1315, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy49; - goto yy3; - } else { - if(yych == 'd') goto yy1316; - if(yych <= 'z') goto yy49; - goto yy3; - } -yy1316: - YYDEBUG(1316, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'n') goto yy1317; - if(yych <= 'z') goto yy50; - goto yy3; - } -yy1317: - YYDEBUG(1317, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy3; - goto yy1318; -yy1318: - YYDEBUG(1318, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'g') goto yy54; - goto yy1319; -yy1319: - YYDEBUG(1319, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'h') goto yy54; - goto yy1320; -yy1320: - YYDEBUG(1320, *YYCURSOR); - yych = *++YYCURSOR; - if(yych == 't') goto yy1313; - goto yy54; -yy1321: - YYDEBUG(1321, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= 'n'){ - if(yych <= 'V'){ - if(yych <= '@') goto yy3; - if(yych <= 'U') goto yy49; - goto yy612; - } else { - if(yych <= 'Z') goto yy49; - if(yych <= '`') goto yy3; - goto yy49; - } - } else { - if(yych <= 'v'){ - if(yych <= 'o') goto yy1324; - if(yych <= 'u') goto yy49; - goto yy612; - } else { - if(yych <= 'w') goto yy1322; - if(yych <= 'z') goto yy49; - goto yy3; - } - } -yy1322: - YYDEBUG(1322, *YYCURSOR); - ++YYCURSOR; - if((yych = *YYCURSOR) <= '@') goto yy1323; - if(yych <= 'Z') goto yy50; - if(yych <= '`') goto yy1323; - if(yych <= 'z') goto yy50; - goto yy1323; -yy1323: - YYDEBUG(1323, *YYCURSOR); - -#line 819 "resource/parse_date.re" -{ - DEBUG_OUTPUT("now"); - TIMELIB_INIT; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15911 "" -yy1324: - YYDEBUG(1324, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 'n') goto yy1325; - if(yych <= 'z') goto yy50; - goto yy3; - } -yy1325: - YYDEBUG(1325, *YYCURSOR); - ++YYCURSOR; - goto yy1326; -yy1326: - YYDEBUG(1326, *YYCURSOR); - -#line 828 "resource/parse_date.re" -{ - DEBUG_OUTPUT("noon"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - TIMELIB_HAVE_TIME(); - s->time->h = 12; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15936 "" -yy1327: - YYDEBUG(1327, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy49; - goto yy3; - } else { - if(yych == 's') goto yy1328; - if(yych <= 'z') goto yy49; - goto yy3; - } -yy1328: - YYDEBUG(1328, *YYCURSOR); - yych = *++YYCURSOR; - if(yych <= '`'){ - if(yych <= '@') goto yy3; - if(yych <= 'Z') goto yy50; - goto yy3; - } else { - if(yych == 't') goto yy1329; - if(yych <= 'z') goto yy50; - goto yy3; - } -yy1329: - YYDEBUG(1329, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy3; - goto yy1330; -yy1330: - YYDEBUG(1330, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'r') goto yy54; - goto yy1331; -yy1331: - YYDEBUG(1331, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'd') goto yy54; - goto yy1332; -yy1332: - YYDEBUG(1332, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'a') goto yy54; - goto yy1333; -yy1333: - YYDEBUG(1333, *YYCURSOR); - yych = *++YYCURSOR; - if(yych != 'y') goto yy54; - goto yy1334; -yy1334: - YYDEBUG(1334, *YYCURSOR); - ++YYCURSOR; - goto yy1335; -yy1335: - YYDEBUG(1335, *YYCURSOR); - -#line 807 "resource/parse_date.re" -{ - DEBUG_OUTPUT("yesterday"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = -1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 15987 "" -} -} -#line 1371 "resource/parse_date.re" - -} - -#define YYMAXFILL 26 - - -timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb) -{ - Scanner in; - int t; - - memset(&in, 0, sizeof(in)); - in.str = malloc(strlen(s) + YYMAXFILL); - memset(in.str, 0, strlen(s) + YYMAXFILL); - memcpy(in.str, s, strlen(s)); - in.lim = in.str + strlen(s) + YYMAXFILL; - in.cur = in.str; - in.time = timelib_time_ctor(); - in.time->y = -1; - in.time->d = -1; - in.time->m = -1; - in.time->h = -1; - in.time->i = -1; - in.time->s = -1; - in.time->f = -1; - in.time->z = -1; - in.time->dst = -1; - in.errors = 0; - in.tzdb = tzdb; - - do { - t = scan(&in); -#ifdef DEBUG_PARSER - printf("%d\n", t); -#endif - } while(t != EOI); - - free(in.str); - *errors = in.errors; - return in.time; -} - -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options) -{ - if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) { - parsed->h = 0; - parsed->i = 0; - parsed->s = 0; - parsed->f = 0; - } - if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0; - if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0; - if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0; - if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0; - if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0; - if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0; - if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0; - if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0; - if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0; - - if (!parsed->tz_abbr) { - parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - } - if (!parsed->tz_info) { - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; - } - if (parsed->zone_type == 0 && now->zone_type != 0) { - parsed->zone_type = now->zone_type; -/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; -*/ parsed->is_localtime = 1; - } -/* timelib_dump_date(parsed, 2); - timelib_dump_date(now, 2); -*/ -} - -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst) -{ - timelib_tz_lookup_table *tp; - - tp = zone_search(abbr, gmtoffset, isdst); - if (tp) { - return (tp->full_tz_name); - } else { - return NULL; - } -} - -timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) -{ - return timelib_timezone_lookup; -} - -#ifdef DEBUG_PARSER_STUB -int main(void) -{ - timelib_time time = timelib_strtotime("May 12"); - - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - if (time.have_weeknr_day) { - printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek); - } - return 0; -} -#endif - -/* - * vim: syntax=c - */ diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re deleted file mode 100644 index 34f9aa5723323..0000000000000 --- a/ext/date/lib/parse_date.re +++ /dev/null @@ -1,1487 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -# define strtoll(s, f, b) _atoi64(s) -#elif !defined(HAVE_STRTOLL) -# if defined(HAVE_ATOLL) -# define strtoll(s, f, b) atoll(s) -# else -# define strtoll(s, f, b) strtol(s, f, b) -# endif -#endif - -#define TIMELIB_SECOND 1 -#define TIMELIB_MINUTE 2 -#define TIMELIB_HOUR 3 -#define TIMELIB_DAY 4 -#define TIMELIB_MONTH 5 -#define TIMELIB_YEAR 6 -#define TIMELIB_WEEKDAY 7 - -#define EOI 257 -#define TIME 258 -#define DATE 259 - -#define TIMELIB_XMLRPC_SOAP 260 -#define TIMELIB_TIME12 261 -#define TIMELIB_TIME24 262 -#define TIMELIB_GNU_NOCOLON 263 -#define TIMELIB_GNU_NOCOLON_TZ 264 -#define TIMELIB_ISO_NOCOLON 265 - -#define TIMELIB_AMERICAN 266 -#define TIMELIB_ISO_DATE 267 -#define TIMELIB_DATE_FULL 268 -#define TIMELIB_DATE_TEXT 269 -#define TIMELIB_DATE_NOCOLON 270 -#define TIMELIB_PG_YEARDAY 271 -#define TIMELIB_PG_TEXT 272 -#define TIMELIB_PG_REVERSE 273 -#define TIMELIB_CLF 274 -#define TIMELIB_DATE_NO_DAY 275 -#define TIMELIB_SHORTDATE_WITH_TIME 276 -#define TIMELIB_DATE_FULL_POINTED 277 -#define TIMELIB_TIME24_WITH_ZONE 278 -#define TIMELIB_ISO_WEEK 279 - -#define TIMELIB_TIMEZONE 300 -#define TIMELIB_AGO 301 - -#define TIMELIB_RELATIVE 310 - -#define TIMELIB_ERROR 999 - -typedef unsigned char uchar; - -#define BSIZE 8192 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) return EOI; - -#define RET(i) {s->cur = cursor; return i;} - -#define timelib_string_free free - -#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } } -#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } -#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } } -#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; } -#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; } -#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; } -#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } } - -#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str -#define TIMELIB_DEINIT timelib_string_free(str) -#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; } - -#define TIMELIB_PROCESS_YEAR(x) { \ - if ((x) == -1) { \ - /* (x) = 0; */ \ - } else if ((x) < 100) { \ - if ((x) < 70) { \ - (x) += 2000; \ - } else { \ - (x) += 1900; \ - } \ - } \ -} - -#ifdef DEBUG_PARSER -#define DEBUG_OUTPUT(s) printf("%s\n", s); -#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } -#else -#define DEBUG_OUTPUT(s) -#define YYDEBUG(s,c) -#endif - -#include "timelib_structs.h" - -typedef struct timelib_elems { - unsigned int c; /* Number of elements */ - char **v; /* Values */ -} timelib_elems; - -typedef struct Scanner { - int fd; - uchar *lim, *str, *ptr, *cur, *tok, *pos; - unsigned int line, len; - int errors; - - struct timelib_time *time; - timelib_tzdb *tzdb; -} Scanner; - -typedef struct _timelib_lookup_table { - const char *name; - int type; - int value; -} timelib_lookup_table; - -typedef struct _timelib_relunit { - const char *name; - int unit; - int multiplier; -} timelib_relunit; - -#define HOUR(a) (int)(a * 60) - -/* The timezone table. */ -static timelib_tz_lookup_table timelib_timezone_lookup[] = { -#include "timezonemap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = { -#include "fallbackmap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_relunit const timelib_relunit_lookup[] = { - { "sec", TIMELIB_SECOND, 1 }, - { "secs", TIMELIB_SECOND, 1 }, - { "second", TIMELIB_SECOND, 1 }, - { "seconds", TIMELIB_SECOND, 1 }, - { "min", TIMELIB_MINUTE, 1 }, - { "mins", TIMELIB_MINUTE, 1 }, - { "minute", TIMELIB_MINUTE, 1 }, - { "minutes", TIMELIB_MINUTE, 1 }, - { "hour", TIMELIB_HOUR, 1 }, - { "hours", TIMELIB_HOUR, 1 }, - { "day", TIMELIB_DAY, 1 }, - { "days", TIMELIB_DAY, 1 }, - { "week", TIMELIB_DAY, 7 }, - { "weeks", TIMELIB_DAY, 7 }, - { "fortnight", TIMELIB_DAY, 14 }, - { "fortnights", TIMELIB_DAY, 14 }, - { "forthnight", TIMELIB_DAY, 14 }, - { "forthnights", TIMELIB_DAY, 14 }, - { "month", TIMELIB_MONTH, 1 }, - { "months", TIMELIB_MONTH, 1 }, - { "year", TIMELIB_YEAR, 1 }, - { "years", TIMELIB_YEAR, 1 }, - - { "monday", TIMELIB_WEEKDAY, 1 }, - { "tuesday", TIMELIB_WEEKDAY, 2 }, - { "wednesday", TIMELIB_WEEKDAY, 3 }, - { "thursday", TIMELIB_WEEKDAY, 4 }, - { "friday", TIMELIB_WEEKDAY, 5 }, - { "saturday", TIMELIB_WEEKDAY, 6 }, - { "sunday", TIMELIB_WEEKDAY, 0 }, - - { NULL, 0, 0 } -}; - -/* The relative text table. */ -static timelib_lookup_table const timelib_reltext_lookup[] = { - { "first", 0, 1 }, - { "next", 0, 1 }, - { "second", 0, 2 }, - { "third", 0, 3 }, - { "fourth", 0, 4 }, - { "fifth", 0, 5 }, - { "sixth", 0, 6 }, - { "seventh", 0, 7 }, - { "eight", 0, 8 }, - { "ninth", 0, 9 }, - { "tenth", 0, 10 }, - { "eleventh", 0, 11 }, - { "twelfth", 0, 12 }, - { "last", 0, -1 }, - { "previous", 0, -1 }, - { "this", 1, 0 }, - { NULL, 1, 0 } -}; - -/* The month table. */ -static timelib_lookup_table const timelib_month_lookup[] = { - { "jan", 0, 1 }, - { "feb", 0, 2 }, - { "mar", 0, 3 }, - { "apr", 0, 4 }, - { "may", 0, 5 }, - { "jun", 0, 6 }, - { "jul", 0, 7 }, - { "aug", 0, 8 }, - { "sep", 0, 9 }, - { "sept", 0, 9 }, - { "oct", 0, 10 }, - { "nov", 0, 11 }, - { "dec", 0, 12 }, - { "i", 0, 1 }, - { "ii", 0, 2 }, - { "iii", 0, 3 }, - { "iv", 0, 4 }, - { "v", 0, 5 }, - { "vi", 0, 6 }, - { "vii", 0, 7 }, - { "viii", 0, 8 }, - { "ix", 0, 9 }, - { "x", 0, 10 }, - { "xi", 0, 11 }, - { "xii", 0, 12 }, - - { "january", 0, 1 }, - { "february", 0, 2 }, - { "march", 0, 3 }, - { "april", 0, 4 }, - { "may", 0, 5 }, - { "june", 0, 6 }, - { "july", 0, 7 }, - { "august", 0, 8 }, - { "september", 0, 9 }, - { "october", 0, 10 }, - { "november", 0, 11 }, - { "december", 0, 12 }, - { NULL, 0, 0 } -}; - -#if 0 -static char* timelib_ltrim(char *s) -{ - char *ptr = s; - while (ptr[0] == ' ') { - ptr++; - } - return ptr; -} -#endif - -#if 0 -uchar *fill(Scanner *s, uchar *cursor){ - if(!s->eof){ - unsigned int cnt = s->tok - s->bot; - if(cnt){ - memcpy(s->bot, s->tok, s->lim - s->tok); - s->tok = s->bot; - s->ptr -= cnt; - cursor -= cnt; - s->pos -= cnt; - s->lim -= cnt; - } - if((s->top - s->lim) < BSIZE){ - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - memcpy(buf, s->tok, s->lim - s->tok); - s->tok = buf; - s->ptr = &buf[s->ptr - s->bot]; - cursor = &buf[cursor - s->bot]; - s->pos = &buf[s->pos - s->bot]; - s->lim = &buf[s->lim - s->bot]; - s->top = &s->lim[BSIZE]; - free(s->bot); - s->bot = buf; - } - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){ - s->eof = &s->lim[cnt]; *(s->eof)++ = '\n'; - } - s->lim += cnt; - } - return cursor; -} -#endif - -static timelib_sll timelib_meridian(char **ptr, timelib_sll h) -{ - timelib_sll retval = 0; - - while (!strchr("AaPp", **ptr)) { - ++*ptr; - } - if (**ptr == 'a' || **ptr == 'A') { - if (h == 12) { - retval = -12; - } - } else if (h != 12) { - retval = 12; - } - ++*ptr; - if (**ptr == '.') { - *ptr += 3; - } else { - ++*ptr; - } - return retval; -} - -static char *timelib_string(Scanner *s) -{ - char *tmp = calloc(1, s->cur - s->tok + 1); - memcpy(tmp, s->tok, s->cur - s->tok); - - return tmp; -} - -static timelib_sll timelib_get_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - timelib_sll tmp_nr = -1; - int len = 0; - - while ((**ptr < '0') || (**ptr > '9')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtoll(str, NULL, 10); - free(str); - return tmp_nr; -} - -static double timelib_get_frac_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - double tmp_nr = -1; - int len = 0; - - while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtod(str, NULL); - free(str); - return tmp_nr; -} - -static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) -{ - timelib_ull dir = 1; - - while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - } else if (**ptr == '-') { - dir = -1; - ++*ptr; - } - return dir * timelib_get_nr(ptr, max_length); -} - -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + - strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - -static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) -{ - char *word; - char *begin = *ptr, *end; - timelib_sll value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_reltext_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - *behavior = tp->type; - } - } - - free(word); - return value; -} - -static timelib_sll timelib_get_relative_text(char **ptr, int *behavior) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_relative_text(ptr, behavior); -} - -static long timelib_lookup_month(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_month_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - } - } - - free(word); - return value; -} - -static long timelib_get_month(char **ptr) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_month(ptr); -} - -static void timelib_eat_spaces(char **ptr) -{ - while (**ptr == ' ') { - ++*ptr; - } -} - -static const timelib_relunit* timelib_lookup_relunit(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - const timelib_relunit *tp, *value = NULL; - - while (**ptr != '\0' && **ptr != ' ') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_relunit_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp; - break; - } - } - - free(word); - return value; -} - -static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s) -{ - const timelib_relunit* relunit; - - relunit = timelib_lookup_relunit(ptr); - switch (relunit->unit) { - case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break; - case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break; - case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break; - case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break; - case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break; - case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break; - - case TIMELIB_WEEKDAY: - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7; - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = behavior; - break; - } -} - -static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst) -{ - int first_found = 0; - timelib_tz_lookup_table *tp, *first_found_elem; - timelib_tz_lookup_table *fmp; - - for (tp = timelib_timezone_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - if (!first_found) { - first_found = 1; - first_found_elem = tp; - if (gmtoffset == -1) { - return tp; - } - } - if (tp->gmtoffset == gmtoffset) { - return tp; - } - } - } - if (first_found) { - return first_found_elem; - } - /* Still didn't find anything, let's find the zone solely based on - * offset/isdst then */ - for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { - return fmp; - } - } - return NULL; -} - -static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - timelib_tz_lookup_table *tp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - if ((tp = zone_search(word, -1, 0))) { - value = -tp->gmtoffset / 60; - *dst = tp->type; - value += tp->type * 60; - *found = 1; - } else { - *found = 0; - } - - *tz_abbr = word; - return value; -} - -static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb) -{ - timelib_tzinfo *res; - - *tz_not_found = 0; - - while (**ptr == ' ') { - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return -1 * timelib_parse_tz_cor(ptr); - } else if (**ptr == '-') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return timelib_parse_tz_cor(ptr); - } else { - int found = 0; - long offset; - char *tz_abbr; - - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_ABBR; - offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found); -#if 0 - /* If we found a TimeZone identifier, use it */ - if (tz_name) { - t->tz_info = timelib_parse_tzfile(tz_name); - t->zone_type = TIMELIB_ZONETYPE_ID; - } -#endif - /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/")) { - if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { - t->tz_info = res; - t->zone_type = TIMELIB_ZONETYPE_ID; - found++; - } - } - if (t->zone_type != TIMELIB_ZONETYPE_ID) { - timelib_time_tz_abbr_update(t, tz_abbr); - } - free(tz_abbr); - *tz_not_found = (found == 0); - return offset; - } -} - -#define timelib_split_free(arg) { \ - int i; \ - for (i = 0; i < arg.c; i++) { \ - free(arg.v[i]); \ - } \ - if (arg.v) { \ - free(arg.v); \ - } \ -} - -static int scan(Scanner *s) -{ - uchar *cursor = s->cur; - char *str, *ptr = NULL; - -std: - s->tok = cursor; - s->len = 0; -/*!re2c -any = [\000-\377]; - -space = [ ]+; -frac = "."[0-9]+; - -ago = 'ago'; - -hour24 = [01]?[0-9] | "2"[0-3]; -hour24lz = [01][0-9] | "2"[0-3]; -hour12 = "0"?[1-9] | "1"[0-2]; -minute = [0-5]?[0-9]; -minutelz = [0-5][0-9]; -second = minute | "60"; -secondlz = minutelz | "60"; -meridian = [AaPp] "."? [Mm] "."?; -tz = [A-Za-z]{1,4} | [A-Z][a-z]+([_/][A-Z][a-z]+)+; -tzcorrection = [+-] hour24 ":"? minutelz?; - -month = "0"? [0-9] | "1"[0-2]; -day = [0-2]?[0-9] | "3"[01]; -year = [0-9]{1,4}; -year2 = [0-9]{2}; -year4 = [0-9]{4}; - -dayofyear = "00"[1-9] | "0"[1-9][0-9] | [1-2][0-9][0-9] | "3"[0-5][0-9] | "36"[0-6]; -weekofyear = "0"[1-9] | [1-4][0-9] | "5"[0-3]; - -monthlz = "0" [1-9] | "1" [0-2]; -daylz = "0" [1-9] | [1-2][0-9] | "3" [01]; - -dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'; -dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'; -daytext = dayfull | dayabbr; - -monthfull = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december'; -monthabbr = 'jan' | 'feb' | 'mar' | 'apr' | 'may' | 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'oct' | 'nov' | 'dec'; -monthroman = "I" | "II" | "III" | "IV" | "V" | "VI" | "VII" | "VIII" | "IX" | "X" | "XI" | "XII"; -monthtext = monthfull | monthabbr | monthroman; - -/* Time formats */ -timetiny12 = hour12 space? meridian; -timeshort12 = hour12[:.]minutelz space? meridian; -timelong12 = hour12[:.]minute[:.]secondlz space? meridian; - -timeshort24 = hour24[:.]minute; -timelong24 = hour24[:.]minute[:.]second; -iso8601long = hour24 [:.] minute [:.] second frac; - -/* iso8601shorttz = hour24 [:] minutelz space? (tzcorrection | tz); */ -iso8601normtz = hour24 [:.] minute [:.] secondlz space? (tzcorrection | tz); -/* iso8601longtz = hour24 [:] minute [:] secondlz frac space? (tzcorrection | tz); */ - -gnunocolon = hour24lz minutelz; -/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */ -iso8601nocolon = hour24lz minutelz secondlz; -/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */ - -/* Date formats */ -americanshort = month "/" day; -american = month "/" day "/" year; -iso8601dateslash = year4 "/" monthlz "/" daylz "/"?; -dateslash = year4 "/" month "/" day; -gnudateshort = year "-" month "-" day; -iso8601date = year4 "-" monthlz "-" daylz; -pointeddate = day "." month "." year; -datefull = day ([ -.])* monthtext ([ -.])* year; -datenoday = monthtext ([ -.])* year4; -datenodayrev = year4 ([ -.])* monthtext; -datetextual = monthtext ([ -.])* day [,.stndrh ]* year; -datenoyear = monthtext ([ -.])* day [,.stndrh ]*; -datenoyearrev = day ([ -.])* monthtext; -datenocolon = year4 monthlz daylz; - -/* Special formats */ -soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":" secondlz frac tzcorrection; -xmlrpc = year4 monthlz daylz "T" hour24 ":" minutelz ":" secondlz; -xmlrpcnocolon = year4 monthlz daylz 't' hour24 minutelz secondlz; -wddx = year4 "-" monthlz "-" daylz "T" hour24 ":" minutelz ":" secondlz; -pgydotd = year4 "."? dayofyear; -pgtextshort = monthabbr "-" daylz "-" year; -pgtextreverse = year "-" monthabbr "-" daylz; -isoweekday = year4 "W" weekofyear [0-7]; -isoweek = year4 "W" weekofyear; - -/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */ -clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection; - -/* Timestamp format: @1126396800 */ -timestamp = "@" "-"? [1-9] [0-9]*; - -/* To fix some ambiguities */ -dateshortwithtimeshort = datenoyear timeshort24; -dateshortwithtimelong = datenoyear timelong24; -dateshortwithtimelongtz = datenoyear iso8601normtz; - -/* - * Relative regexps - */ -reltextnumber = 'first'|'next'|'second'|'third'|'fourth'|'fifth'|'sixth'|'seventh'|'eight'|'ninth'|'tenth'|'eleventh'|'twelfth'|'last'|'previous'|'this'; -reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'forthnight'|'month'|'year') 's'?) | dayfull; - -relnumber = ([+-]?[0-9]+); -relative = (relnumber space? reltextunit)+; -relativetext = (reltextnumber space? reltextunit)+; - -*/ - -/*!re2c - /* so that vim highlights correctly */ - "yesterday" - { - DEBUG_OUTPUT("yesterday"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = -1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "now" - { - DEBUG_OUTPUT("now"); - TIMELIB_INIT; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "noon" - { - DEBUG_OUTPUT("noon"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - TIMELIB_HAVE_TIME(); - s->time->h = 12; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "midnight" | "today" - { - DEBUG_OUTPUT("midnight | today"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "tomorrow" - { - DEBUG_OUTPUT("tomorrow"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = 1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timestamp - { - timelib_ull i; - - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_DATE(); - TIMELIB_UNHAVE_TIME(); - - i = timelib_get_unsigned_nr((char **) &ptr, 24); - s->time->y = 1970; - s->time->m = 1; - s->time->d = 1; - s->time->h = s->time->i = s->time->s = 0; - s->time->f = 0.0; - s->time->relative.s += i; - s->time->is_localtime = 1; - s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; - s->time->z = 0; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timetiny12 | timeshort12 | timelong12 - { - DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - } - } - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_TIME12; - } - - timeshort24 | timelong24 /* | iso8601short | iso8601norm */ | iso8601long /*| iso8601shorttz | iso8601normtz | iso8601longtz*/ - { - int tz_not_found; - DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_TIME24_WITH_ZONE; - } - - gnunocolon - { - DEBUG_OUTPUT("gnunocolon"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON; - } -/* - gnunocolontz - { - DEBUG_OUTPUT("gnunocolontz"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb); - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON_TZ; - } -*/ - iso8601nocolon /*| iso8601nocolontz*/ - { - int tz_not_found; - DEBUG_OUTPUT("iso8601nocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_ISO_NOCOLON; - } - - americanshort | american - { - DEBUG_OUTPUT("americanshort | american"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '/') { - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - } - TIMELIB_DEINIT; - return TIMELIB_AMERICAN; - } - - iso8601date | iso8601dateslash | dateslash - { - DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - gnudateshort - { - DEBUG_OUTPUT("gnudateshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - datefull - { - DEBUG_OUTPUT("datefull"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL; - } - - pointeddate - { - DEBUG_OUTPUT("pointed date"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } - - datenoday - { - DEBUG_OUTPUT("datenoday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datenodayrev - { - DEBUG_OUTPUT("datenodayrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datetextual | datenoyear - { - DEBUG_OUTPUT("datetextual | datenoyear"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenoyearrev - { - DEBUG_OUTPUT("datenoyearrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenocolon - { - DEBUG_OUTPUT("datenocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_DATE_NOCOLON; - } - - xmlrpc | xmlrpcnocolon | soap | wddx - { - int tz_not_found; - DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 9); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_XMLRPC_SOAP; - } - - pgydotd - { - DEBUG_OUTPUT("pgydotd"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = timelib_get_nr((char **) &ptr, 3); - s->time->m = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_YEARDAY; - } - - isoweekday - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweekday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = timelib_get_nr((char **) &ptr, 1); - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - isoweek - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweek"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = 1; - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - pgtextshort - { - DEBUG_OUTPUT("pgtextshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - pgtextreverse - { - DEBUG_OUTPUT("pgtextreverse"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - clf - { - int tz_not_found; - DEBUG_OUTPUT("clf"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - year4 - { - DEBUG_OUTPUT("year4"); - TIMELIB_INIT; - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - ago - { - DEBUG_OUTPUT("ago"); - TIMELIB_INIT; - s->time->relative.y = 0 - s->time->relative.y; - s->time->relative.m = 0 - s->time->relative.m; - s->time->relative.d = 0 - s->time->relative.d; - s->time->relative.h = 0 - s->time->relative.h; - s->time->relative.i = 0 - s->time->relative.i; - s->time->relative.s = 0 - s->time->relative.s; - s->time->relative.weekday = 0 - s->time->relative.weekday; - TIMELIB_DEINIT; - return TIMELIB_AGO; - } - - relativetext - { - timelib_sll i; - int behavior; - DEBUG_OUTPUT("relativetext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_relative_text((char **) &ptr, &behavior); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, behavior, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - dayfull - { - const timelib_relunit* relunit; - DEBUG_OUTPUT("dayfull"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - relunit = timelib_lookup_relunit((char**) &ptr); - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = 1; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - dayabbr - { - DEBUG_OUTPUT("dayabbr"); - goto std; - } - - tzcorrection | tz - { - int tz_not_found; - DEBUG_OUTPUT("tzcorrection | tz"); - TIMELIB_INIT; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_TIMEZONE; - } - - dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz - { - int tz_not_found; - DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } - - relative - { - timelib_ull i; - DEBUG_OUTPUT("relative"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_unsigned_nr((char **) &ptr, 24); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 0, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - [ .,] - { - goto std; - } - - "\000"|"\n" - { - s->pos = cursor; s->line++; - goto std; - } - - any - { -/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */ - s->errors++; - goto std; - } -*/ -} - -/*!max:re2c */ - -timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb) -{ - Scanner in; - int t; - - memset(&in, 0, sizeof(in)); - in.str = malloc(strlen(s) + YYMAXFILL); - memset(in.str, 0, strlen(s) + YYMAXFILL); - memcpy(in.str, s, strlen(s)); - in.lim = in.str + strlen(s) + YYMAXFILL; - in.cur = in.str; - in.time = timelib_time_ctor(); - in.time->y = -1; - in.time->d = -1; - in.time->m = -1; - in.time->h = -1; - in.time->i = -1; - in.time->s = -1; - in.time->f = -1; - in.time->z = -1; - in.time->dst = -1; - in.errors = 0; - in.tzdb = tzdb; - - do { - t = scan(&in); -#ifdef DEBUG_PARSER - printf("%d\n", t); -#endif - } while(t != EOI); - - free(in.str); - *errors = in.errors; - return in.time; -} - -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options) -{ - if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) { - parsed->h = 0; - parsed->i = 0; - parsed->s = 0; - parsed->f = 0; - } - if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0; - if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0; - if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0; - if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0; - if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0; - if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0; - if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0; - if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0; - if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0; - - if (!parsed->tz_abbr) { - parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - } - if (!parsed->tz_info) { - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; - } - if (parsed->zone_type == 0 && now->zone_type != 0) { - parsed->zone_type = now->zone_type; -/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; -*/ parsed->is_localtime = 1; - } -/* timelib_dump_date(parsed, 2); - timelib_dump_date(now, 2); -*/ -} - -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst) -{ - timelib_tz_lookup_table *tp; - - tp = zone_search(abbr, gmtoffset, isdst); - if (tp) { - return (tp->full_tz_name); - } else { - return NULL; - } -} - -timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) -{ - return timelib_timezone_lookup; -} - -#ifdef DEBUG_PARSER_STUB -int main(void) -{ - timelib_time time = timelib_strtotime("May 12"); - - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - if (time.have_weeknr_day) { - printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek); - } - return 0; -} -#endif - -/* - * vim: syntax=c - */ diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c deleted file mode 100644 index f4eaee36b5d61..0000000000000 --- a/ext/date/lib/parse_tz.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif -#include "timezonedb.h" - -#ifdef WORDS_BIGENDIAN -#define timelib_conv_int(l) (l) -#else -#define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8) + ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24) -#endif - -static void read_header(char **tzf, timelib_tzinfo *tz) -{ - uint32_t buffer[6]; - - memcpy(&buffer, *tzf, sizeof(buffer)); - tz->ttisgmtcnt = timelib_conv_int(buffer[0]); - tz->ttisstdcnt = timelib_conv_int(buffer[1]); - tz->leapcnt = timelib_conv_int(buffer[2]); - tz->timecnt = timelib_conv_int(buffer[3]); - tz->typecnt = timelib_conv_int(buffer[4]); - tz->charcnt = timelib_conv_int(buffer[5]); - *tzf += sizeof(buffer); -} - -static void read_transistions(char **tzf, timelib_tzinfo *tz) -{ - int32_t *buffer = NULL; - uint32_t i; - unsigned char *cbuffer = NULL; - - if (tz->timecnt) { - buffer = (int32_t*) malloc(tz->timecnt * sizeof(int32_t)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(int32_t) * tz->timecnt); - *tzf += (sizeof(int32_t) * tz->timecnt); - for (i = 0; i < tz->timecnt; i++) { - buffer[i] = timelib_conv_int(buffer[i]); - } - - cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char)); - if (!cbuffer) { - return; - } - memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt); - *tzf += sizeof(unsigned char) * tz->timecnt; - } - - tz->trans = buffer; - tz->trans_idx = cbuffer; -} - -static void read_types(char **tzf, timelib_tzinfo *tz) -{ - unsigned char *buffer; - int32_t *leap_buffer; - unsigned int i, j; - - buffer = (unsigned char*) malloc(tz->typecnt * sizeof(unsigned char) * 6); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->typecnt); - *tzf += sizeof(unsigned char) * 6 * tz->typecnt; - - tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo)); - if (!tz->type) { - return; - } - - for (i = 0; i < tz->typecnt; i++) { - j = i * 6; - tz->type[i].offset = (buffer[j] * 16777216) + (buffer[j + 1] * 65536) + (buffer[j + 2] * 256) + buffer[j + 3]; - tz->type[i].isdst = buffer[j + 4]; - tz->type[i].abbr_idx = buffer[j + 5]; - } - free(buffer); - - tz->timezone_abbr = (char*) malloc(tz->charcnt); - if (!tz->timezone_abbr) { - return; - } - memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->charcnt); - *tzf += sizeof(char) * tz->charcnt; - - leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t)); - if (!leap_buffer) { - return; - } - memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2); - *tzf += sizeof(int32_t) * tz->leapcnt * 2; - - tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo)); - if (!tz->leap_times) { - return; - } - for (i = 0; i < tz->leapcnt; i++) { - tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]); - tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]); - } - free(leap_buffer); - - buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt); - *tzf += sizeof(unsigned char) * tz->ttisstdcnt; - - for (i = 0; i < tz->ttisstdcnt; i++) { - tz->type[i].isstdcnt = buffer[i]; - } - free(buffer); - - buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt); - *tzf += sizeof(unsigned char) * tz->ttisgmtcnt; - - for (i = 0; i < tz->ttisgmtcnt; i++) { - tz->type[i].isgmtcnt = buffer[i]; - } - free(buffer); -} - -void timelib_dump_tzinfo(timelib_tzinfo *tz) -{ - uint32_t i; - - printf("UTC/Local count: %lu\n", (unsigned long) tz->ttisgmtcnt); - printf("Std/Wall count: %lu\n", (unsigned long) tz->ttisstdcnt); - printf("Leap.sec. count: %lu\n", (unsigned long) tz->leapcnt); - printf("Trans. count: %lu\n", (unsigned long) tz->timecnt); - printf("Local types count: %lu\n", (unsigned long) tz->typecnt); - printf("Zone Abbr. count: %lu\n", (unsigned long) tz->charcnt); - - printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n", - "", "", 0, - (long int) tz->type[0].offset, - tz->type[0].isdst, - tz->type[0].abbr_idx, - &tz->timezone_abbr[tz->type[0].abbr_idx], - tz->type[0].isstdcnt, - tz->type[0].isgmtcnt - ); - for (i = 0; i < tz->timecnt; i++) { - printf ("%08X (%12d) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n", - tz->trans[i], tz->trans[i], tz->trans_idx[i], - (long int) tz->type[tz->trans_idx[i]].offset, - tz->type[tz->trans_idx[i]].isdst, - tz->type[tz->trans_idx[i]].abbr_idx, - &tz->timezone_abbr[tz->type[tz->trans_idx[i]].abbr_idx], - tz->type[tz->trans_idx[i]].isstdcnt, - tz->type[tz->trans_idx[i]].isgmtcnt - ); - } - for (i = 0; i < tz->leapcnt; i++) { - printf ("%08X (%12ld) = %d\n", - tz->leap_times[i].trans, - (long) tz->leap_times[i].trans, - tz->leap_times[i].offset); - } -} - -static int tz_search(char *timezone, int left, int right, timelib_tzdb *tzdb) -{ - int mid, cmp; - - if (left > right) { - return -1; /* not found */ - } - - mid = (left + right) / 2; - - cmp = strcasecmp(timezone, tzdb->index[mid].id); - if (cmp < 0) { - return tz_search(timezone, left, mid - 1, tzdb); - } else if (cmp > 0) { - return tz_search(timezone, mid + 1, right, tzdb); - } else { /* (cmp == 0) */ - return tzdb->index[mid].pos; - } -} - - -static int seek_to_tz_position(char **tzf, char *timezone, timelib_tzdb *tzdb) -{ - int pos; - - pos = tz_search(timezone, 0, tzdb->index_size, tzdb); - - if (pos == -1) { - return 0; - } - - (*tzf) = &(tzdb->data[pos + 20]); - return 1; -} - -timelib_tzdb *timelib_builtin_db(void) -{ - return &timezonedb_builtin; -} - -timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count) -{ - *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin); - return timezonedb_idx_builtin; -} - -timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb) -{ - char *tzf; - timelib_tzinfo *tmp; - - if (seek_to_tz_position((char**) &tzf, timezone, tzdb)) { - tmp = timelib_tzinfo_ctor(timezone); - - read_header((char**) &tzf, tmp); - read_transistions((char**) &tzf, tmp); - read_types((char**) &tzf, tmp); - } else { - tmp = NULL; - } - - return tmp; -} - -static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time) -{ - uint32_t i; - - /* If there is no transistion time, we pick the first one, if that doesn't - * exist we return NULL */ - if (!tz->timecnt || !tz->trans) { - *transition_time = 0; - if (tz->typecnt == 1) { - return &(tz->type[0]); - } - return NULL; - } - - /* If the TS is lower than the first transistion time, then we scan over - * all the transistion times to find the first non-DST one, or the first - * one in case there are only DST entries. Not sure which smartass came up - * with this idea in the first though :) */ - if (ts < tz->trans[0]) { - uint32_t j; - - *transition_time = 0; - j = 0; - while (j < tz->timecnt && tz->type[j].isdst) { - ++j; - } - if (j == tz->timecnt) { - j = 0; - } - return &(tz->type[j]); - } - - /* In all other cases we loop through the available transtion times to find - * the correct entry */ - for (i = 0; i < tz->timecnt; i++) { - if (ts < tz->trans[i]) { - *transition_time = tz->trans[i - 1]; - return &(tz->type[tz->trans_idx[i - 1]]); - } - } - *transition_time = tz->trans[tz->timecnt - 1]; - return &(tz->type[tz->trans_idx[tz->timecnt - 1]]); -} - -static tlinfo* fetch_leaptime_offset(timelib_tzinfo *tz, timelib_sll ts) -{ - int i; - - if (!tz->leapcnt || !tz->leap_times) { - return NULL; - } - - for (i = tz->leapcnt - 1; i > 0; i--) { - if (ts > tz->leap_times[i].trans) { - return &(tz->leap_times[i]); - } - } - return NULL; -} - -int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz) -{ - ttinfo *to; - timelib_sll dummy; - - if ((to = fetch_timezone_offset(tz, ts, &dummy))) { - return to->isdst; - } - return -1; -} - -timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz) -{ - ttinfo *to; - tlinfo *tl; - int32_t offset = 0, leap_secs = 0; - char *abbr; - timelib_time_offset *tmp = timelib_time_offset_ctor(); - timelib_sll transistion_time; - - if ((to = fetch_timezone_offset(tz, ts, &transistion_time))) { - offset = to->offset; - abbr = &(tz->timezone_abbr[to->abbr_idx]); - tmp->is_dst = to->isdst; - tmp->transistion_time = transistion_time; - } else { - offset = 0; - abbr = tz->timezone_abbr; - tmp->is_dst = 0; - tmp->transistion_time = 0; - } - - if ((tl = fetch_leaptime_offset(tz, ts))) { - leap_secs = -tl->offset; - } - - tmp->offset = offset; - tmp->leap_secs = leap_secs; - tmp->abbr = abbr ? strdup(abbr) : strdup("GMT"); - - return tmp; -} diff --git a/ext/date/lib/resource/README b/ext/date/lib/resource/README deleted file mode 100644 index 2603bc7c6f7b5..0000000000000 --- a/ext/date/lib/resource/README +++ /dev/null @@ -1,6 +0,0 @@ -Regenerating Parser -=================== - -Make sure you use re2c 0.9.8dev or higher: - -/dat/dev/sf/re2c/re2c -d -b resource/parse_date.re > parse_date.c diff --git a/ext/date/lib/resource/parse_date.re b/ext/date/lib/resource/parse_date.re deleted file mode 100644 index 34f9aa5723323..0000000000000 --- a/ext/date/lib/resource/parse_date.re +++ /dev/null @@ -1,1487 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -# define strtoll(s, f, b) _atoi64(s) -#elif !defined(HAVE_STRTOLL) -# if defined(HAVE_ATOLL) -# define strtoll(s, f, b) atoll(s) -# else -# define strtoll(s, f, b) strtol(s, f, b) -# endif -#endif - -#define TIMELIB_SECOND 1 -#define TIMELIB_MINUTE 2 -#define TIMELIB_HOUR 3 -#define TIMELIB_DAY 4 -#define TIMELIB_MONTH 5 -#define TIMELIB_YEAR 6 -#define TIMELIB_WEEKDAY 7 - -#define EOI 257 -#define TIME 258 -#define DATE 259 - -#define TIMELIB_XMLRPC_SOAP 260 -#define TIMELIB_TIME12 261 -#define TIMELIB_TIME24 262 -#define TIMELIB_GNU_NOCOLON 263 -#define TIMELIB_GNU_NOCOLON_TZ 264 -#define TIMELIB_ISO_NOCOLON 265 - -#define TIMELIB_AMERICAN 266 -#define TIMELIB_ISO_DATE 267 -#define TIMELIB_DATE_FULL 268 -#define TIMELIB_DATE_TEXT 269 -#define TIMELIB_DATE_NOCOLON 270 -#define TIMELIB_PG_YEARDAY 271 -#define TIMELIB_PG_TEXT 272 -#define TIMELIB_PG_REVERSE 273 -#define TIMELIB_CLF 274 -#define TIMELIB_DATE_NO_DAY 275 -#define TIMELIB_SHORTDATE_WITH_TIME 276 -#define TIMELIB_DATE_FULL_POINTED 277 -#define TIMELIB_TIME24_WITH_ZONE 278 -#define TIMELIB_ISO_WEEK 279 - -#define TIMELIB_TIMEZONE 300 -#define TIMELIB_AGO 301 - -#define TIMELIB_RELATIVE 310 - -#define TIMELIB_ERROR 999 - -typedef unsigned char uchar; - -#define BSIZE 8192 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) return EOI; - -#define RET(i) {s->cur = cursor; return i;} - -#define timelib_string_free free - -#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } } -#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } -#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } } -#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; } -#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; } -#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; } -#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } } - -#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str -#define TIMELIB_DEINIT timelib_string_free(str) -#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; } - -#define TIMELIB_PROCESS_YEAR(x) { \ - if ((x) == -1) { \ - /* (x) = 0; */ \ - } else if ((x) < 100) { \ - if ((x) < 70) { \ - (x) += 2000; \ - } else { \ - (x) += 1900; \ - } \ - } \ -} - -#ifdef DEBUG_PARSER -#define DEBUG_OUTPUT(s) printf("%s\n", s); -#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } -#else -#define DEBUG_OUTPUT(s) -#define YYDEBUG(s,c) -#endif - -#include "timelib_structs.h" - -typedef struct timelib_elems { - unsigned int c; /* Number of elements */ - char **v; /* Values */ -} timelib_elems; - -typedef struct Scanner { - int fd; - uchar *lim, *str, *ptr, *cur, *tok, *pos; - unsigned int line, len; - int errors; - - struct timelib_time *time; - timelib_tzdb *tzdb; -} Scanner; - -typedef struct _timelib_lookup_table { - const char *name; - int type; - int value; -} timelib_lookup_table; - -typedef struct _timelib_relunit { - const char *name; - int unit; - int multiplier; -} timelib_relunit; - -#define HOUR(a) (int)(a * 60) - -/* The timezone table. */ -static timelib_tz_lookup_table timelib_timezone_lookup[] = { -#include "timezonemap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = { -#include "fallbackmap.h" - { NULL, 0, 0, NULL }, -}; - -static timelib_relunit const timelib_relunit_lookup[] = { - { "sec", TIMELIB_SECOND, 1 }, - { "secs", TIMELIB_SECOND, 1 }, - { "second", TIMELIB_SECOND, 1 }, - { "seconds", TIMELIB_SECOND, 1 }, - { "min", TIMELIB_MINUTE, 1 }, - { "mins", TIMELIB_MINUTE, 1 }, - { "minute", TIMELIB_MINUTE, 1 }, - { "minutes", TIMELIB_MINUTE, 1 }, - { "hour", TIMELIB_HOUR, 1 }, - { "hours", TIMELIB_HOUR, 1 }, - { "day", TIMELIB_DAY, 1 }, - { "days", TIMELIB_DAY, 1 }, - { "week", TIMELIB_DAY, 7 }, - { "weeks", TIMELIB_DAY, 7 }, - { "fortnight", TIMELIB_DAY, 14 }, - { "fortnights", TIMELIB_DAY, 14 }, - { "forthnight", TIMELIB_DAY, 14 }, - { "forthnights", TIMELIB_DAY, 14 }, - { "month", TIMELIB_MONTH, 1 }, - { "months", TIMELIB_MONTH, 1 }, - { "year", TIMELIB_YEAR, 1 }, - { "years", TIMELIB_YEAR, 1 }, - - { "monday", TIMELIB_WEEKDAY, 1 }, - { "tuesday", TIMELIB_WEEKDAY, 2 }, - { "wednesday", TIMELIB_WEEKDAY, 3 }, - { "thursday", TIMELIB_WEEKDAY, 4 }, - { "friday", TIMELIB_WEEKDAY, 5 }, - { "saturday", TIMELIB_WEEKDAY, 6 }, - { "sunday", TIMELIB_WEEKDAY, 0 }, - - { NULL, 0, 0 } -}; - -/* The relative text table. */ -static timelib_lookup_table const timelib_reltext_lookup[] = { - { "first", 0, 1 }, - { "next", 0, 1 }, - { "second", 0, 2 }, - { "third", 0, 3 }, - { "fourth", 0, 4 }, - { "fifth", 0, 5 }, - { "sixth", 0, 6 }, - { "seventh", 0, 7 }, - { "eight", 0, 8 }, - { "ninth", 0, 9 }, - { "tenth", 0, 10 }, - { "eleventh", 0, 11 }, - { "twelfth", 0, 12 }, - { "last", 0, -1 }, - { "previous", 0, -1 }, - { "this", 1, 0 }, - { NULL, 1, 0 } -}; - -/* The month table. */ -static timelib_lookup_table const timelib_month_lookup[] = { - { "jan", 0, 1 }, - { "feb", 0, 2 }, - { "mar", 0, 3 }, - { "apr", 0, 4 }, - { "may", 0, 5 }, - { "jun", 0, 6 }, - { "jul", 0, 7 }, - { "aug", 0, 8 }, - { "sep", 0, 9 }, - { "sept", 0, 9 }, - { "oct", 0, 10 }, - { "nov", 0, 11 }, - { "dec", 0, 12 }, - { "i", 0, 1 }, - { "ii", 0, 2 }, - { "iii", 0, 3 }, - { "iv", 0, 4 }, - { "v", 0, 5 }, - { "vi", 0, 6 }, - { "vii", 0, 7 }, - { "viii", 0, 8 }, - { "ix", 0, 9 }, - { "x", 0, 10 }, - { "xi", 0, 11 }, - { "xii", 0, 12 }, - - { "january", 0, 1 }, - { "february", 0, 2 }, - { "march", 0, 3 }, - { "april", 0, 4 }, - { "may", 0, 5 }, - { "june", 0, 6 }, - { "july", 0, 7 }, - { "august", 0, 8 }, - { "september", 0, 9 }, - { "october", 0, 10 }, - { "november", 0, 11 }, - { "december", 0, 12 }, - { NULL, 0, 0 } -}; - -#if 0 -static char* timelib_ltrim(char *s) -{ - char *ptr = s; - while (ptr[0] == ' ') { - ptr++; - } - return ptr; -} -#endif - -#if 0 -uchar *fill(Scanner *s, uchar *cursor){ - if(!s->eof){ - unsigned int cnt = s->tok - s->bot; - if(cnt){ - memcpy(s->bot, s->tok, s->lim - s->tok); - s->tok = s->bot; - s->ptr -= cnt; - cursor -= cnt; - s->pos -= cnt; - s->lim -= cnt; - } - if((s->top - s->lim) < BSIZE){ - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - memcpy(buf, s->tok, s->lim - s->tok); - s->tok = buf; - s->ptr = &buf[s->ptr - s->bot]; - cursor = &buf[cursor - s->bot]; - s->pos = &buf[s->pos - s->bot]; - s->lim = &buf[s->lim - s->bot]; - s->top = &s->lim[BSIZE]; - free(s->bot); - s->bot = buf; - } - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){ - s->eof = &s->lim[cnt]; *(s->eof)++ = '\n'; - } - s->lim += cnt; - } - return cursor; -} -#endif - -static timelib_sll timelib_meridian(char **ptr, timelib_sll h) -{ - timelib_sll retval = 0; - - while (!strchr("AaPp", **ptr)) { - ++*ptr; - } - if (**ptr == 'a' || **ptr == 'A') { - if (h == 12) { - retval = -12; - } - } else if (h != 12) { - retval = 12; - } - ++*ptr; - if (**ptr == '.') { - *ptr += 3; - } else { - ++*ptr; - } - return retval; -} - -static char *timelib_string(Scanner *s) -{ - char *tmp = calloc(1, s->cur - s->tok + 1); - memcpy(tmp, s->tok, s->cur - s->tok); - - return tmp; -} - -static timelib_sll timelib_get_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - timelib_sll tmp_nr = -1; - int len = 0; - - while ((**ptr < '0') || (**ptr > '9')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtoll(str, NULL, 10); - free(str); - return tmp_nr; -} - -static double timelib_get_frac_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - double tmp_nr = -1; - int len = 0; - - while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - begin = *ptr; - while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtod(str, NULL); - free(str); - return tmp_nr; -} - -static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) -{ - timelib_ull dir = 1; - - while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) { - if (**ptr == '\0') { - return -1; - } - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - } else if (**ptr == '-') { - dir = -1; - ++*ptr; - } - return dir * timelib_get_nr(ptr, max_length); -} - -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + - strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - -static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) -{ - char *word; - char *begin = *ptr, *end; - timelib_sll value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_reltext_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - *behavior = tp->type; - } - } - - free(word); - return value; -} - -static timelib_sll timelib_get_relative_text(char **ptr, int *behavior) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_relative_text(ptr, behavior); -} - -static long timelib_lookup_month(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_month_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - } - } - - free(word); - return value; -} - -static long timelib_get_month(char **ptr) -{ - while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_month(ptr); -} - -static void timelib_eat_spaces(char **ptr) -{ - while (**ptr == ' ') { - ++*ptr; - } -} - -static const timelib_relunit* timelib_lookup_relunit(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - const timelib_relunit *tp, *value = NULL; - - while (**ptr != '\0' && **ptr != ' ') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_relunit_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp; - break; - } - } - - free(word); - return value; -} - -static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s) -{ - const timelib_relunit* relunit; - - relunit = timelib_lookup_relunit(ptr); - switch (relunit->unit) { - case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break; - case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break; - case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break; - case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break; - case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break; - case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break; - - case TIMELIB_WEEKDAY: - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7; - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = behavior; - break; - } -} - -static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst) -{ - int first_found = 0; - timelib_tz_lookup_table *tp, *first_found_elem; - timelib_tz_lookup_table *fmp; - - for (tp = timelib_timezone_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - if (!first_found) { - first_found = 1; - first_found_elem = tp; - if (gmtoffset == -1) { - return tp; - } - } - if (tp->gmtoffset == gmtoffset) { - return tp; - } - } - } - if (first_found) { - return first_found_elem; - } - /* Still didn't find anything, let's find the zone solely based on - * offset/isdst then */ - for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { - return fmp; - } - } - return NULL; -} - -static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - timelib_tz_lookup_table *tp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - if ((tp = zone_search(word, -1, 0))) { - value = -tp->gmtoffset / 60; - *dst = tp->type; - value += tp->type * 60; - *found = 1; - } else { - *found = 0; - } - - *tz_abbr = word; - return value; -} - -static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb) -{ - timelib_tzinfo *res; - - *tz_not_found = 0; - - while (**ptr == ' ') { - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return -1 * timelib_parse_tz_cor(ptr); - } else if (**ptr == '-') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - return timelib_parse_tz_cor(ptr); - } else { - int found = 0; - long offset; - char *tz_abbr; - - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_ABBR; - offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found); -#if 0 - /* If we found a TimeZone identifier, use it */ - if (tz_name) { - t->tz_info = timelib_parse_tzfile(tz_name); - t->zone_type = TIMELIB_ZONETYPE_ID; - } -#endif - /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/")) { - if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { - t->tz_info = res; - t->zone_type = TIMELIB_ZONETYPE_ID; - found++; - } - } - if (t->zone_type != TIMELIB_ZONETYPE_ID) { - timelib_time_tz_abbr_update(t, tz_abbr); - } - free(tz_abbr); - *tz_not_found = (found == 0); - return offset; - } -} - -#define timelib_split_free(arg) { \ - int i; \ - for (i = 0; i < arg.c; i++) { \ - free(arg.v[i]); \ - } \ - if (arg.v) { \ - free(arg.v); \ - } \ -} - -static int scan(Scanner *s) -{ - uchar *cursor = s->cur; - char *str, *ptr = NULL; - -std: - s->tok = cursor; - s->len = 0; -/*!re2c -any = [\000-\377]; - -space = [ ]+; -frac = "."[0-9]+; - -ago = 'ago'; - -hour24 = [01]?[0-9] | "2"[0-3]; -hour24lz = [01][0-9] | "2"[0-3]; -hour12 = "0"?[1-9] | "1"[0-2]; -minute = [0-5]?[0-9]; -minutelz = [0-5][0-9]; -second = minute | "60"; -secondlz = minutelz | "60"; -meridian = [AaPp] "."? [Mm] "."?; -tz = [A-Za-z]{1,4} | [A-Z][a-z]+([_/][A-Z][a-z]+)+; -tzcorrection = [+-] hour24 ":"? minutelz?; - -month = "0"? [0-9] | "1"[0-2]; -day = [0-2]?[0-9] | "3"[01]; -year = [0-9]{1,4}; -year2 = [0-9]{2}; -year4 = [0-9]{4}; - -dayofyear = "00"[1-9] | "0"[1-9][0-9] | [1-2][0-9][0-9] | "3"[0-5][0-9] | "36"[0-6]; -weekofyear = "0"[1-9] | [1-4][0-9] | "5"[0-3]; - -monthlz = "0" [1-9] | "1" [0-2]; -daylz = "0" [1-9] | [1-2][0-9] | "3" [01]; - -dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'; -dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'; -daytext = dayfull | dayabbr; - -monthfull = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december'; -monthabbr = 'jan' | 'feb' | 'mar' | 'apr' | 'may' | 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'oct' | 'nov' | 'dec'; -monthroman = "I" | "II" | "III" | "IV" | "V" | "VI" | "VII" | "VIII" | "IX" | "X" | "XI" | "XII"; -monthtext = monthfull | monthabbr | monthroman; - -/* Time formats */ -timetiny12 = hour12 space? meridian; -timeshort12 = hour12[:.]minutelz space? meridian; -timelong12 = hour12[:.]minute[:.]secondlz space? meridian; - -timeshort24 = hour24[:.]minute; -timelong24 = hour24[:.]minute[:.]second; -iso8601long = hour24 [:.] minute [:.] second frac; - -/* iso8601shorttz = hour24 [:] minutelz space? (tzcorrection | tz); */ -iso8601normtz = hour24 [:.] minute [:.] secondlz space? (tzcorrection | tz); -/* iso8601longtz = hour24 [:] minute [:] secondlz frac space? (tzcorrection | tz); */ - -gnunocolon = hour24lz minutelz; -/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */ -iso8601nocolon = hour24lz minutelz secondlz; -/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */ - -/* Date formats */ -americanshort = month "/" day; -american = month "/" day "/" year; -iso8601dateslash = year4 "/" monthlz "/" daylz "/"?; -dateslash = year4 "/" month "/" day; -gnudateshort = year "-" month "-" day; -iso8601date = year4 "-" monthlz "-" daylz; -pointeddate = day "." month "." year; -datefull = day ([ -.])* monthtext ([ -.])* year; -datenoday = monthtext ([ -.])* year4; -datenodayrev = year4 ([ -.])* monthtext; -datetextual = monthtext ([ -.])* day [,.stndrh ]* year; -datenoyear = monthtext ([ -.])* day [,.stndrh ]*; -datenoyearrev = day ([ -.])* monthtext; -datenocolon = year4 monthlz daylz; - -/* Special formats */ -soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":" secondlz frac tzcorrection; -xmlrpc = year4 monthlz daylz "T" hour24 ":" minutelz ":" secondlz; -xmlrpcnocolon = year4 monthlz daylz 't' hour24 minutelz secondlz; -wddx = year4 "-" monthlz "-" daylz "T" hour24 ":" minutelz ":" secondlz; -pgydotd = year4 "."? dayofyear; -pgtextshort = monthabbr "-" daylz "-" year; -pgtextreverse = year "-" monthabbr "-" daylz; -isoweekday = year4 "W" weekofyear [0-7]; -isoweek = year4 "W" weekofyear; - -/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */ -clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection; - -/* Timestamp format: @1126396800 */ -timestamp = "@" "-"? [1-9] [0-9]*; - -/* To fix some ambiguities */ -dateshortwithtimeshort = datenoyear timeshort24; -dateshortwithtimelong = datenoyear timelong24; -dateshortwithtimelongtz = datenoyear iso8601normtz; - -/* - * Relative regexps - */ -reltextnumber = 'first'|'next'|'second'|'third'|'fourth'|'fifth'|'sixth'|'seventh'|'eight'|'ninth'|'tenth'|'eleventh'|'twelfth'|'last'|'previous'|'this'; -reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'forthnight'|'month'|'year') 's'?) | dayfull; - -relnumber = ([+-]?[0-9]+); -relative = (relnumber space? reltextunit)+; -relativetext = (reltextnumber space? reltextunit)+; - -*/ - -/*!re2c - /* so that vim highlights correctly */ - "yesterday" - { - DEBUG_OUTPUT("yesterday"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = -1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "now" - { - DEBUG_OUTPUT("now"); - TIMELIB_INIT; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "noon" - { - DEBUG_OUTPUT("noon"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - TIMELIB_HAVE_TIME(); - s->time->h = 12; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "midnight" | "today" - { - DEBUG_OUTPUT("midnight | today"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - "tomorrow" - { - DEBUG_OUTPUT("tomorrow"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = 1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timestamp - { - timelib_ull i; - - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_DATE(); - TIMELIB_UNHAVE_TIME(); - - i = timelib_get_unsigned_nr((char **) &ptr, 24); - s->time->y = 1970; - s->time->m = 1; - s->time->d = 1; - s->time->h = s->time->i = s->time->s = 0; - s->time->f = 0.0; - s->time->relative.s += i; - s->time->is_localtime = 1; - s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; - s->time->z = 0; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timetiny12 | timeshort12 | timelong12 - { - DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - } - } - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_TIME12; - } - - timeshort24 | timelong24 /* | iso8601short | iso8601norm */ | iso8601long /*| iso8601shorttz | iso8601normtz | iso8601longtz*/ - { - int tz_not_found; - DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_TIME24_WITH_ZONE; - } - - gnunocolon - { - DEBUG_OUTPUT("gnunocolon"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON; - } -/* - gnunocolontz - { - DEBUG_OUTPUT("gnunocolontz"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb); - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON_TZ; - } -*/ - iso8601nocolon /*| iso8601nocolontz*/ - { - int tz_not_found; - DEBUG_OUTPUT("iso8601nocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_ISO_NOCOLON; - } - - americanshort | american - { - DEBUG_OUTPUT("americanshort | american"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '/') { - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - } - TIMELIB_DEINIT; - return TIMELIB_AMERICAN; - } - - iso8601date | iso8601dateslash | dateslash - { - DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - gnudateshort - { - DEBUG_OUTPUT("gnudateshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - datefull - { - DEBUG_OUTPUT("datefull"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL; - } - - pointeddate - { - DEBUG_OUTPUT("pointed date"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } - - datenoday - { - DEBUG_OUTPUT("datenoday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datenodayrev - { - DEBUG_OUTPUT("datenodayrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datetextual | datenoyear - { - DEBUG_OUTPUT("datetextual | datenoyear"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenoyearrev - { - DEBUG_OUTPUT("datenoyearrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenocolon - { - DEBUG_OUTPUT("datenocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_DATE_NOCOLON; - } - - xmlrpc | xmlrpcnocolon | soap | wddx - { - int tz_not_found; - DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 9); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_XMLRPC_SOAP; - } - - pgydotd - { - DEBUG_OUTPUT("pgydotd"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = timelib_get_nr((char **) &ptr, 3); - s->time->m = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_YEARDAY; - } - - isoweekday - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweekday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = timelib_get_nr((char **) &ptr, 1); - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - isoweek - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweek"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = 1; - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - pgtextshort - { - DEBUG_OUTPUT("pgtextshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - pgtextreverse - { - DEBUG_OUTPUT("pgtextreverse"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - clf - { - int tz_not_found; - DEBUG_OUTPUT("clf"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - year4 - { - DEBUG_OUTPUT("year4"); - TIMELIB_INIT; - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - ago - { - DEBUG_OUTPUT("ago"); - TIMELIB_INIT; - s->time->relative.y = 0 - s->time->relative.y; - s->time->relative.m = 0 - s->time->relative.m; - s->time->relative.d = 0 - s->time->relative.d; - s->time->relative.h = 0 - s->time->relative.h; - s->time->relative.i = 0 - s->time->relative.i; - s->time->relative.s = 0 - s->time->relative.s; - s->time->relative.weekday = 0 - s->time->relative.weekday; - TIMELIB_DEINIT; - return TIMELIB_AGO; - } - - relativetext - { - timelib_sll i; - int behavior; - DEBUG_OUTPUT("relativetext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_relative_text((char **) &ptr, &behavior); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, behavior, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - dayfull - { - const timelib_relunit* relunit; - DEBUG_OUTPUT("dayfull"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - relunit = timelib_lookup_relunit((char**) &ptr); - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = 1; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - dayabbr - { - DEBUG_OUTPUT("dayabbr"); - goto std; - } - - tzcorrection | tz - { - int tz_not_found; - DEBUG_OUTPUT("tzcorrection | tz"); - TIMELIB_INIT; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - TIMELIB_DEINIT; - return TIMELIB_TIMEZONE; - } - - dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz - { - int tz_not_found; - DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - s->errors += tz_not_found; - } - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } - - relative - { - timelib_ull i; - DEBUG_OUTPUT("relative"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_unsigned_nr((char **) &ptr, 24); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 0, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - [ .,] - { - goto std; - } - - "\000"|"\n" - { - s->pos = cursor; s->line++; - goto std; - } - - any - { -/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */ - s->errors++; - goto std; - } -*/ -} - -/*!max:re2c */ - -timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb) -{ - Scanner in; - int t; - - memset(&in, 0, sizeof(in)); - in.str = malloc(strlen(s) + YYMAXFILL); - memset(in.str, 0, strlen(s) + YYMAXFILL); - memcpy(in.str, s, strlen(s)); - in.lim = in.str + strlen(s) + YYMAXFILL; - in.cur = in.str; - in.time = timelib_time_ctor(); - in.time->y = -1; - in.time->d = -1; - in.time->m = -1; - in.time->h = -1; - in.time->i = -1; - in.time->s = -1; - in.time->f = -1; - in.time->z = -1; - in.time->dst = -1; - in.errors = 0; - in.tzdb = tzdb; - - do { - t = scan(&in); -#ifdef DEBUG_PARSER - printf("%d\n", t); -#endif - } while(t != EOI); - - free(in.str); - *errors = in.errors; - return in.time; -} - -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options) -{ - if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) { - parsed->h = 0; - parsed->i = 0; - parsed->s = 0; - parsed->f = 0; - } - if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0; - if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0; - if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0; - if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0; - if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0; - if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0; - if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0; - if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0; - if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0; - - if (!parsed->tz_abbr) { - parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - } - if (!parsed->tz_info) { - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; - } - if (parsed->zone_type == 0 && now->zone_type != 0) { - parsed->zone_type = now->zone_type; -/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; -*/ parsed->is_localtime = 1; - } -/* timelib_dump_date(parsed, 2); - timelib_dump_date(now, 2); -*/ -} - -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst) -{ - timelib_tz_lookup_table *tp; - - tp = zone_search(abbr, gmtoffset, isdst); - if (tp) { - return (tp->full_tz_name); - } else { - return NULL; - } -} - -timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) -{ - return timelib_timezone_lookup; -} - -#ifdef DEBUG_PARSER_STUB -int main(void) -{ - timelib_time time = timelib_strtotime("May 12"); - - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - if (time.have_weeknr_day) { - printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek); - } - return 0; -} -#endif - -/* - * vim: syntax=c - */ diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c deleted file mode 100644 index 18bcf9fc11e9f..0000000000000 --- a/ext/date/lib/timelib.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" -#include - -#define TIMELIB_TIME_FREE(m) \ - if (m) { \ - free(m); \ - m = NULL; \ - } \ - -timelib_time* timelib_time_ctor() -{ - timelib_time *t; - t = calloc(1, sizeof(timelib_time)); - - return t; -} - -void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr) -{ - unsigned int i; - - TIMELIB_TIME_FREE(tm->tz_abbr); - tm->tz_abbr = strdup(tz_abbr); - for (i = 0; i < strlen(tz_abbr); i++) { - tm->tz_abbr[i] = toupper(tz_abbr[i]); - } -} - -void timelib_time_dtor(timelib_time* t) -{ - TIMELIB_TIME_FREE(t->tz_abbr); - TIMELIB_TIME_FREE(t); -} - -timelib_time_offset* timelib_time_offset_ctor() -{ - timelib_time_offset *t; - t = calloc(1, sizeof(timelib_time_offset)); - - return t; -} - -void timelib_time_offset_dtor(timelib_time_offset* t) -{ - TIMELIB_TIME_FREE(t->abbr); - TIMELIB_TIME_FREE(t); -} - -timelib_tzinfo* timelib_tzinfo_ctor(char *name) -{ - timelib_tzinfo *t; - t = calloc(1, sizeof(timelib_tzinfo)); - t->name = strdup(name); - - return t; -} - -timelib_tzinfo *timelib_tzinfo_clone(timelib_tzinfo *tz) -{ - timelib_tzinfo *tmp = timelib_tzinfo_ctor(tz->name); - tmp->ttisgmtcnt = tz->ttisgmtcnt; - tmp->ttisstdcnt = tz->ttisstdcnt; - tmp->leapcnt = tz->leapcnt; - tmp->timecnt = tz->timecnt; - tmp->typecnt = tz->typecnt; - tmp->charcnt = tz->charcnt; - - tmp->trans = (int32_t *) malloc(tz->timecnt * sizeof(int32_t)); - tmp->trans_idx = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char)); - memcpy(tmp->trans, tz->trans, tz->timecnt * sizeof(int32_t)); - memcpy(tmp->trans_idx, tz->trans_idx, tz->timecnt * sizeof(unsigned char)); - - tmp->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo)); - memcpy(tmp->type, tz->type, tz->typecnt * sizeof(struct ttinfo)); - - tmp->timezone_abbr = (char*) malloc(tz->charcnt); - memcpy(tmp->timezone_abbr, tz->timezone_abbr, tz->charcnt); - - tmp->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo)); - memcpy(tmp->leap_times, tz->leap_times, tz->leapcnt * sizeof(tlinfo)); - - return tmp; -} - -void timelib_tzinfo_dtor(timelib_tzinfo *tz) -{ - TIMELIB_TIME_FREE(tz->name); - TIMELIB_TIME_FREE(tz->trans); - TIMELIB_TIME_FREE(tz->trans_idx); - TIMELIB_TIME_FREE(tz->type); - TIMELIB_TIME_FREE(tz->timezone_abbr); - TIMELIB_TIME_FREE(tz->leap_times); - TIMELIB_TIME_FREE(tz); -} - -char *timelib_get_tz_abbr_ptr(timelib_time *t) -{ - if (!t->sse_uptodate) { - timelib_update_ts(t, NULL); - }; - return t->tz_abbr; -} - -signed long timelib_date_to_int(timelib_time *d, int *error) -{ - timelib_sll ts; - - ts = d->sse; - - if (ts < LONG_MIN || ts > LONG_MAX) { - if (error) { - *error = 1; - } - return 0; - } - if (error) { - *error = 0; - } - return (signed long) d->sse; -} - -void timelib_dump_date(timelib_time *d, int options) -{ - if ((options & 2) == 2) { - printf("TYPE: %d ", d->zone_type); - } - printf("TS: %lld | %04lld-%02lld-%02lld %02lld:%02lld:%02lld", - d->sse, d->y, d->m, d->d, d->h, d->i, d->s); - if (d->f > +0.0) { - printf(" %.5f", d->f); - } - - if (d->is_localtime) { - switch (d->zone_type) { - case TIMELIB_ZONETYPE_OFFSET: /* Only offset */ - printf(" GMT %05d%s", d->z, d->dst == 1 ? " (DST)" : ""); - break; - case TIMELIB_ZONETYPE_ID: /* Timezone struct */ - /* Show abbreviation if wanted */ - if (d->tz_abbr) { - printf(" %s", d->tz_abbr); - } - /* Do we have a TimeZone struct? */ - if (d->tz_info) { - printf(" %s", d->tz_info->name); - } - break; - case TIMELIB_ZONETYPE_ABBR: - printf(" %s", d->tz_abbr); - printf(" %05d%s", d->z, d->dst == 1 ? " (DST)" : ""); - break; - } - } else { - printf(" GMT 00000"); - } - - if ((options & 1) == 1) { - if (d->have_relative) { - printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS", - d->relative.y, d->relative.m, d->relative.d, d->relative.h, d->relative.i, d->relative.s); - } - if (d->have_weekday_relative) { - printf(" / %d.%d", d->relative.weekday, d->relative.weekday_behavior); - } - } - printf("\n"); -} - diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h deleted file mode 100644 index faa99df223983..0000000000000 --- a/ext/date/lib/timelib.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef __TIMELIB_H__ -#define __TIMELIB_H__ - -#include "timelib_structs.h" - -#define TIMELIB_NONE 0x00 -#define TIMELIB_OVERRIDE_TIME 0x01 - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) -#endif - -#if defined(_MSC_VER) && !defined(strcasecmp) -#define strcasecmp stricmp -#endif - -/* From dow.c */ -timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d); -timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m); -void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy); - -/* From parse_date.re */ -timelib_time *timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb); -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options); -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst); -timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); - -/* From tm2unixtime.c */ -void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi); - -/* From unixtime2tm.c */ -int timelib_apply_localtime(timelib_time *t, unsigned int localtime); -void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts); -void timelib_unixtime2local(timelib_time *tm, timelib_sll ts, timelib_tzinfo* tz); -void timelib_update_from_sse(timelib_time *tm); -void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz); - -/* From parse_tz.c */ -timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb); -int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz); -timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz); -void timelib_dump_tzinfo(timelib_tzinfo *tz); -timelib_tzdb *timelib_builtin_db(void); -timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count); - -/* From timelib.c */ -timelib_tzinfo* timelib_tzinfo_ctor(); -void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr); -void timelib_time_tz_name_update(timelib_time* tm, char* tz_name); -void timelib_tzinfo_dtor(timelib_tzinfo *tz); -timelib_tzinfo* timelib_tzinfo_clone(timelib_tzinfo *tz); - -timelib_time* timelib_time_ctor(); -void timelib_time_set_option(timelib_time* tm, int option, void* option_value); -void timelib_time_dtor(timelib_time* t); - -timelib_time_offset* timelib_time_offset_ctor(); -void timelib_time_offset_dtor(timelib_time_offset* t); - -signed long timelib_date_to_int(timelib_time *d, int *error); -void timelib_dump_date(timelib_time *d, int options); - -#endif diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4 deleted file mode 100644 index c7255727f24e6..0000000000000 --- a/ext/date/lib/timelib.m4 +++ /dev/null @@ -1,80 +0,0 @@ -dnl -dnl $Id$ -dnl -dnl -dnl TL_DEF_HAVE(what [, why]) -dnl -dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])' -dnl -AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl - -dnl -dnl TL_CHECK_INT_TYPE(type) -dnl -AC_DEFUN([TL_CHECK_INT_TYPE],[ -AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [ -AC_TRY_COMPILE([ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#elif HAVE_STDINT_H -# include -#endif], -[if (($1 *) 0) - return 0; -if (sizeof ($1)) - return 0; -], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no]) -]) -if test "$ac_cv_int_type_$1" = "yes"; then - TL_DEF_HAVE($1, [Define if $1 type is present.]) -fi -])dnl - -dnl -dnl AC_TIMELIB_C_BIGENDIAN -dnl Replacement macro for AC_C_BIGENDIAN -dnl -AC_DEFUN([AC_TIMELIB_C_BIGENDIAN], -[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, - [ - ac_cv_c_bigendian_php=unknown - AC_TRY_RUN( - [ -int main(void) -{ - short one = 1; - char *cp = (char *)&one; - - if (*cp == 0) { - return(0); - } else { - return(1); - } -} - ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) - ]) - if test $ac_cv_c_bigendian_php = yes; then - AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) - fi -])dnl - -dnl Check for types, sizes, etc. needed by timelib -AC_CHECK_SIZEOF(long, 8) -AC_CHECK_SIZEOF(int, 4) -TL_CHECK_INT_TYPE(int32_t) -TL_CHECK_INT_TYPE(uint32_t) - -dnl Check for headers needed by timelib -AC_CHECK_HEADERS([ \ -sys/types.h \ -inttypes.h \ -stdint.h \ -string.h \ -stdlib.h -]) - -dnl Check for strtoll, atoll -AC_CHECK_FUNCS(strtoll atoll strftime) diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h deleted file mode 100644 index 317709336c699..0000000000000 --- a/ext/date/lib/timelib_structs.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef __TIMELIB_STRUCTS_H__ -#define __TIMELIB_STRUCTS_H__ - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(HAVE_INTTYPES_H) -#include -#elif defined(HAVE_STDINT_H) -#include -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -typedef unsigned __int64 timelib_ull; -typedef __int64 timelib_sll; -#else -typedef unsigned long long timelib_ull; -typedef signed long long timelib_sll; -#endif - -#if defined(_MSC_VER) -#define int32_t __int32 -#define uint32_t unsigned __int32 -#endif - -typedef struct ttinfo -{ - int32_t offset; - int isdst; - unsigned int abbr_idx; - - unsigned int isstdcnt; - unsigned int isgmtcnt; -} ttinfo; - -typedef struct tlinfo -{ - int32_t trans; - int32_t offset; -} tlinfo; - -typedef struct timelib_tzinfo -{ - char *name; - uint32_t ttisgmtcnt; - uint32_t ttisstdcnt; - uint32_t leapcnt; - uint32_t timecnt; - uint32_t typecnt; - uint32_t charcnt; - - int32_t *trans; - unsigned char *trans_idx; - - ttinfo *type; - char *timezone_abbr; - - tlinfo *leap_times; -} timelib_tzinfo; - -typedef struct timelib_rel_time { - timelib_sll y, m, d; /* Years, Months and Days */ - timelib_sll h, i, s; /* Hours, mInutes and Seconds */ - - int weekday; /* Stores the day in 'next monday' */ - int weekday_behavior; /* 0: the current day should *not* be counted when advancing forwards; 1: the current day *should* be counted */ -} timelib_rel_time; - -typedef struct timelib_time_offset { - int32_t offset; - unsigned int leap_secs; - unsigned int is_dst; - char *abbr; - timelib_sll transistion_time; -} timelib_time_offset; - -typedef struct timelib_time { - timelib_sll y, m, d; /* Year, Month, Day */ - timelib_sll h, i, s; /* Hour, mInute, Second */ - double f; /* Fraction */ - int z; /* GMT offset in minutes */ - char *tz_abbr; /* Timezone abbreviation (display only) */ - timelib_tzinfo *tz_info; /* Timezone structure */ - signed int dst; /* Flag if we were parsing a DST zone */ - timelib_rel_time relative; - - timelib_sll sse; /* Seconds since epoch */ - - unsigned int have_time, have_date, have_zone, have_relative, have_weekday_relative, have_weeknr_day; - - unsigned int sse_uptodate; /* !0 if the sse member is up to date with the date/time members */ - unsigned int tim_uptodate; /* !0 if the date/time members are up to date with the sse member */ - unsigned int is_localtime; /* 1 if the current struct represents localtime, 0 if it is in GMT */ - unsigned int zone_type; /* 1 time offset, - * 3 TimeZone identifier, - * 2 TimeZone abbreviation */ -} timelib_time; - -typedef struct _timelib_tz_lookup_table { - char *name; - int type; - int gmtoffset; - char *full_tz_name; -} timelib_tz_lookup_table; - -typedef struct _timelib_tzdb_index_entry { - char *id; - unsigned int pos; -} timelib_tzdb_index_entry; - -typedef struct _timelib_tzdb { - char *version; - int index_size; - timelib_tzdb_index_entry *index; - char *data; -} timelib_tzdb; - -#define TIMELIB_ZONETYPE_OFFSET 1 -#define TIMELIB_ZONETYPE_ABBR 2 -#define TIMELIB_ZONETYPE_ID 3 - -#define SECS_PER_DAY 86400 -#define DAYS_PER_YEAR 365 -#define DAYS_PER_LYEAR 366 - -#define timelib_is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) - -#define DEBUG(s) if (0) { s } - -#endif diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h deleted file mode 100644 index c8783820947de..0000000000000 --- a/ext/date/lib/timezonedb.h +++ /dev/null @@ -1,16437 +0,0 @@ -timelib_tzdb_index_entry timezonedb_idx_builtin[535] = { - { "Africa/Abidjan" , 0x000000 }, - { "Africa/Accra" , 0x000049 }, - { "Africa/Addis_Ababa" , 0x0000E5 }, - { "Africa/Algiers" , 0x00012F }, - { "Africa/Asmera" , 0x00024E }, - { "Africa/Bamako" , 0x000298 }, - { "Africa/Bangui" , 0x0002F7 }, - { "Africa/Banjul" , 0x000340 }, - { "Africa/Bissau" , 0x0003AB }, - { "Africa/Blantyre" , 0x000405 }, - { "Africa/Brazzaville" , 0x00044E }, - { "Africa/Bujumbura" , 0x000497 }, - { "Africa/Cairo" , 0x0004CF }, - { "Africa/Casablanca" , 0x00088A }, - { "Africa/Ceuta" , 0x000946 }, - { "Africa/Conakry" , 0x000C32 }, - { "Africa/Dakar" , 0x000C91 }, - { "Africa/Dar_es_Salaam" , 0x000CEB }, - { "Africa/Djibouti" , 0x000D4C }, - { "Africa/Douala" , 0x000D95 }, - { "Africa/El_Aaiun" , 0x000DDE }, - { "Africa/Freetown" , 0x000E38 }, - { "Africa/Gaborone" , 0x000F3B }, - { "Africa/Harare" , 0x000F8A }, - { "Africa/Johannesburg" , 0x000FD3 }, - { "Africa/Kampala" , 0x001035 }, - { "Africa/Khartoum" , 0x0010A8 }, - { "Africa/Kigali" , 0x0011AF }, - { "Africa/Kinshasa" , 0x0011F8 }, - { "Africa/Lagos" , 0x001230 }, - { "Africa/Libreville" , 0x001279 }, - { "Africa/Lome" , 0x0012C2 }, - { "Africa/Luanda" , 0x0012FA }, - { "Africa/Lubumbashi" , 0x001343 }, - { "Africa/Lusaka" , 0x00137B }, - { "Africa/Malabo" , 0x0013C4 }, - { "Africa/Maputo" , 0x00141E }, - { "Africa/Maseru" , 0x001467 }, - { "Africa/Mbabane" , 0x0014C3 }, - { "Africa/Mogadishu" , 0x00150D }, - { "Africa/Monrovia" , 0x00155C }, - { "Africa/Nairobi" , 0x0015B6 }, - { "Africa/Ndjamena" , 0x001629 }, - { "Africa/Niamey" , 0x001689 }, - { "Africa/Nouakchott" , 0x0016F0 }, - { "Africa/Ouagadougou" , 0x00174F }, - { "Africa/Porto-Novo" , 0x001798 }, - { "Africa/Sao_Tome" , 0x0017F2 }, - { "Africa/Timbuktu" , 0x00183B }, - { "Africa/Tripoli" , 0x00189A }, - { "Africa/Tunis" , 0x001988 }, - { "Africa/Windhoek" , 0x001A70 }, - { "America/Adak" , 0x001CAB }, - { "America/Anchorage" , 0x002005 }, - { "America/Anguilla" , 0x00235D }, - { "America/Antigua" , 0x0023A6 }, - { "America/Araguaina" , 0x002400 }, - { "America/Argentina/Buenos_Aires" , 0x002546 }, - { "America/Argentina/Catamarca" , 0x0026BF }, - { "America/Argentina/ComodRivadavia" , 0x00284F }, - { "America/Argentina/Cordoba" , 0x0029DF }, - { "America/Argentina/Jujuy" , 0x002B65 }, - { "America/Argentina/La_Rioja" , 0x002CF9 }, - { "America/Argentina/Mendoza" , 0x002E8E }, - { "America/Argentina/Rio_Gallegos" , 0x00302C }, - { "America/Argentina/San_Juan" , 0x0031BC }, - { "America/Argentina/Tucuman" , 0x003351 }, - { "America/Argentina/Ushuaia" , 0x0034E1 }, - { "America/Aruba" , 0x003671 }, - { "America/Asuncion" , 0x0036CB }, - { "America/Atka" , 0x0039A4 }, - { "America/Bahia" , 0x003CFE }, - { "America/Barbados" , 0x003E76 }, - { "America/Belem" , 0x003F04 }, - { "America/Belize" , 0x003FE6 }, - { "America/Boa_Vista" , 0x004156 }, - { "America/Bogota" , 0x00424C }, - { "America/Boise" , 0x0042AC }, - { "America/Buenos_Aires" , 0x00460E }, - { "America/Cambridge_Bay" , 0x004787 }, - { "America/Campo_Grande" , 0x004A8A }, - { "America/Cancun" , 0x004D5B }, - { "America/Caracas" , 0x004F76 }, - { "America/Catamarca" , 0x004FCC }, - { "America/Cayenne" , 0x00515C }, - { "America/Cayman" , 0x0051B2 }, - { "America/Chicago" , 0x0051FB }, - { "America/Chihuahua" , 0x0056FA }, - { "America/Coral_Harbour" , 0x005924 }, - { "America/Cordoba" , 0x0059A3 }, - { "America/Costa_Rica" , 0x005B29 }, - { "America/Cuiaba" , 0x005BA7 }, - { "America/Curacao" , 0x005E6E }, - { "America/Danmarkshavn" , 0x005EC8 }, - { "America/Dawson" , 0x005FDF }, - { "America/Dawson_Creek" , 0x0062D6 }, - { "America/Denver" , 0x00645B }, - { "America/Detroit" , 0x0067C8 }, - { "America/Dominica" , 0x006AF3 }, - { "America/Edmonton" , 0x006B3C }, - { "America/Eirunepe" , 0x006EA6 }, - { "America/El_Salvador" , 0x006F92 }, - { "America/Ensenada" , 0x006FFB }, - { "America/Fort_Wayne" , 0x00745B }, - { "America/Fortaleza" , 0x007347 }, - { "America/Glace_Bay" , 0x0076B9 }, - { "America/Godthab" , 0x0079DD }, - { "America/Goose_Bay" , 0x007C87 }, - { "America/Grand_Turk" , 0x00810F }, - { "America/Grenada" , 0x0083B2 }, - { "America/Guadeloupe" , 0x0083FB }, - { "America/Guatemala" , 0x008444 }, - { "America/Guayaquil" , 0x0084B7 }, - { "America/Guyana" , 0x008500 }, - { "America/Halifax" , 0x008575 }, - { "America/Havana" , 0x008A51 }, - { "America/Hermosillo" , 0x008DC2 }, - { "America/Indiana/Indianapolis" , 0x008E75 }, - { "America/Indiana/Knox" , 0x0090D3 }, - { "America/Indiana/Marengo" , 0x009444 }, - { "America/Indiana/Vevay" , 0x009914 }, - { "America/Indianapolis" , 0x0096B6 }, - { "America/Inuvik" , 0x009B18 }, - { "America/Iqaluit" , 0x009E0F }, - { "America/Jamaica" , 0x00A101 }, - { "America/Jujuy" , 0x00A1BA }, - { "America/Juneau" , 0x00A34E }, - { "America/Kentucky/Louisville" , 0x00A6A2 }, - { "America/Kentucky/Monticello" , 0x00AA8B }, - { "America/Knox_IN" , 0x00ADDE }, - { "America/La_Paz" , 0x00B14F }, - { "America/Lima" , 0x00B1AA }, - { "America/Los_Angeles" , 0x00B246 }, - { "America/Louisville" , 0x00B63F }, - { "America/Maceio" , 0x00BA28 }, - { "America/Managua" , 0x00BB46 }, - { "America/Manaus" , 0x00BBE3 }, - { "America/Martinique" , 0x00BCCF }, - { "America/Mazatlan" , 0x00BD2F }, - { "America/Mendoza" , 0x00BF68 }, - { "America/Menominee" , 0x00C106 }, - { "America/Merida" , 0x00C434 }, - { "America/Mexico_City" , 0x00C643 }, - { "America/Miquelon" , 0x00C895 }, - { "America/Monterrey" , 0x00CAFB }, - { "America/Montevideo" , 0x00CCFE }, - { "America/Montreal" , 0x00CEC4 }, - { "America/Montserrat" , 0x00D3A8 }, - { "America/Nassau" , 0x00D3F1 }, - { "America/New_York" , 0x00D72A }, - { "America/Nipigon" , 0x00DC1D }, - { "America/Nome" , 0x00DF17 }, - { "America/Noronha" , 0x00E270 }, - { "America/North_Dakota/Center" , 0x00E384 }, - { "America/Panama" , 0x00E6E1 }, - { "America/Pangnirtung" , 0x00E72A }, - { "America/Paramaribo" , 0x00EA34 }, - { "America/Phoenix" , 0x00EABA }, - { "America/Port-au-Prince" , 0x00EB3C }, - { "America/Port_of_Spain" , 0x00ED24 }, - { "America/Porto_Acre" , 0x00EC42 }, - { "America/Porto_Velho" , 0x00ED6D }, - { "America/Puerto_Rico" , 0x00EE4F }, - { "America/Rainy_River" , 0x00EE9D }, - { "America/Rankin_Inlet" , 0x00F197 }, - { "America/Recife" , 0x00F47D }, - { "America/Regina" , 0x00F591 }, - { "America/Rio_Branco" , 0x00F70E }, - { "America/Rosario" , 0x00F7F0 }, - { "America/Santiago" , 0x00F976 }, - { "America/Santo_Domingo" , 0x00FCF0 }, - { "America/Sao_Paulo" , 0x00FDAA }, - { "America/Scoresbysund" , 0x01007B }, - { "America/Shiprock" , 0x01033E }, - { "America/St_Johns" , 0x0106AB }, - { "America/St_Kitts" , 0x010BCA }, - { "America/St_Lucia" , 0x010C13 }, - { "America/St_Thomas" , 0x010C5C }, - { "America/St_Vincent" , 0x010CA5 }, - { "America/Swift_Current" , 0x010CEE }, - { "America/Tegucigalpa" , 0x010DD5 }, - { "America/Thule" , 0x010E3E }, - { "America/Thunder_Bay" , 0x011069 }, - { "America/Tijuana" , 0x011383 }, - { "America/Toronto" , 0x0116CF }, - { "America/Tortola" , 0x011BB3 }, - { "America/Vancouver" , 0x011BFC }, - { "America/Virgin" , 0x012009 }, - { "America/Whitehorse" , 0x012052 }, - { "America/Winnipeg" , 0x012349 }, - { "America/Yakutat" , 0x01274A }, - { "America/Yellowknife" , 0x012A86 }, - { "Antarctica/Casey" , 0x012D60 }, - { "Antarctica/Davis" , 0x012DA9 }, - { "Antarctica/DumontDUrville" , 0x012DFD }, - { "Antarctica/Mawson" , 0x012E5D }, - { "Antarctica/McMurdo" , 0x012EA7 }, - { "Antarctica/Palmer" , 0x013181 }, - { "Antarctica/Rothera" , 0x01348A }, - { "Antarctica/South_Pole" , 0x0134D4 }, - { "Antarctica/Syowa" , 0x0137AE }, - { "Antarctica/Vostok" , 0x0137F8 }, - { "Arctic/Longyearbyen" , 0x013842 }, - { "Asia/Aden" , 0x013B68 }, - { "Asia/Almaty" , 0x013BB1 }, - { "Asia/Amman" , 0x013D16 }, - { "Asia/Anadyr" , 0x013FCA }, - { "Asia/Aqtau" , 0x014296 }, - { "Asia/Aqtobe" , 0x014458 }, - { "Asia/Ashgabat" , 0x0145F5 }, - { "Asia/Ashkhabad" , 0x014706 }, - { "Asia/Baghdad" , 0x014817 }, - { "Asia/Bahrain" , 0x014AAC }, - { "Asia/Baku" , 0x014B06 }, - { "Asia/Bangkok" , 0x014DE7 }, - { "Asia/Beirut" , 0x014E30 }, - { "Asia/Bishkek" , 0x015131 }, - { "Asia/Brunei" , 0x0152D1 }, - { "Asia/Calcutta" , 0x015327 }, - { "Asia/Choibalsan" , 0x015394 }, - { "Asia/Chongqing" , 0x015628 }, - { "Asia/Chungking" , 0x0156CB }, - { "Asia/Colombo" , 0x01576E }, - { "Asia/Dacca" , 0x0157F9 }, - { "Asia/Damascus" , 0x01587C }, - { "Asia/Dhaka" , 0x015BC0 }, - { "Asia/Dili" , 0x015C43 }, - { "Asia/Dubai" , 0x015CC0 }, - { "Asia/Dushanbe" , 0x015D09 }, - { "Asia/Gaza" , 0x015E00 }, - { "Asia/Harbin" , 0x01613D }, - { "Asia/Hong_Kong" , 0x0161F7 }, - { "Asia/Hovd" , 0x0163A1 }, - { "Asia/Irkutsk" , 0x016628 }, - { "Asia/Istanbul" , 0x0168EC }, - { "Asia/Jakarta" , 0x016CCD }, - { "Asia/Jayapura" , 0x016D5D }, - { "Asia/Jerusalem" , 0x016DBC }, - { "Asia/Kabul" , 0x0170DF }, - { "Asia/Kamchatka" , 0x017124 }, - { "Asia/Karachi" , 0x0173E8 }, - { "Asia/Kashgar" , 0x01747D }, - { "Asia/Katmandu" , 0x01752D }, - { "Asia/Krasnoyarsk" , 0x017587 }, - { "Asia/Kuala_Lumpur" , 0x01784B }, - { "Asia/Kuching" , 0x0178E9 }, - { "Asia/Kuwait" , 0x0179BC }, - { "Asia/Macao" , 0x017A05 }, - { "Asia/Macau" , 0x017B34 }, - { "Asia/Magadan" , 0x017C63 }, - { "Asia/Makassar" , 0x017F27 }, - { "Asia/Manila" , 0x017F97 }, - { "Asia/Muscat" , 0x018010 }, - { "Asia/Nicosia" , 0x018059 }, - { "Asia/Novosibirsk" , 0x018335 }, - { "Asia/Omsk" , 0x018606 }, - { "Asia/Oral" , 0x0188CA }, - { "Asia/Phnom_Penh" , 0x018A7F }, - { "Asia/Pontianak" , 0x018AEB }, - { "Asia/Pyongyang" , 0x018B8B }, - { "Asia/Qatar" , 0x018BEC }, - { "Asia/Qyzylorda" , 0x018C46 }, - { "Asia/Rangoon" , 0x018DF0 }, - { "Asia/Riyadh" , 0x018E5C }, - { "Asia/Saigon" , 0x018EA5 }, - { "Asia/Sakhalin" , 0x018F11 }, - { "Asia/Samarkand" , 0x0191EA }, - { "Asia/Seoul" , 0x01932D }, - { "Asia/Shanghai" , 0x0193C5 }, - { "Asia/Singapore" , 0x01946A }, - { "Asia/Taipei" , 0x019515 }, - { "Asia/Tashkent" , 0x019621 }, - { "Asia/Tbilisi" , 0x019749 }, - { "Asia/Tehran" , 0x019A44 }, - { "Asia/Tel_Aviv" , 0x019CBA }, - { "Asia/Thimbu" , 0x019FDD }, - { "Asia/Thimphu" , 0x01A037 }, - { "Asia/Tokyo" , 0x01A091 }, - { "Asia/Ujung_Pandang" , 0x01A10E }, - { "Asia/Ulaanbaatar" , 0x01A17E }, - { "Asia/Ulan_Bator" , 0x01A405 }, - { "Asia/Urumqi" , 0x01A68C }, - { "Asia/Vientiane" , 0x01A72F }, - { "Asia/Vladivostok" , 0x01A79B }, - { "Asia/Yakutsk" , 0x01AA66 }, - { "Asia/Yekaterinburg" , 0x01AD2A }, - { "Asia/Yerevan" , 0x01B019 }, - { "Atlantic/Azores" , 0x01B311 }, - { "Atlantic/Bermuda" , 0x01B802 }, - { "Atlantic/Canary" , 0x01BAD7 }, - { "Atlantic/Cape_Verde" , 0x01BD93 }, - { "Atlantic/Faeroe" , 0x01BE00 }, - { "Atlantic/Jan_Mayen" , 0x01C098 }, - { "Atlantic/Madeira" , 0x01C3BE }, - { "Atlantic/Reykjavik" , 0x01C8AC }, - { "Atlantic/South_Georgia" , 0x01CA59 }, - { "Atlantic/St_Helena" , 0x01CD59 }, - { "Atlantic/Stanley" , 0x01CA91 }, - { "Australia/ACT" , 0x01CDA2 }, - { "Australia/Adelaide" , 0x01D0B3 }, - { "Australia/Brisbane" , 0x01D3C4 }, - { "Australia/Broken_Hill" , 0x01D464 }, - { "Australia/Canberra" , 0x01D77A }, - { "Australia/Currie" , 0x01DA8B }, - { "Australia/Darwin" , 0x01DD9C }, - { "Australia/Hobart" , 0x01DE04 }, - { "Australia/LHI" , 0x01E13D }, - { "Australia/Lindeman" , 0x01E3CC }, - { "Australia/Lord_Howe" , 0x01E485 }, - { "Australia/Melbourne" , 0x01E714 }, - { "Australia/North" , 0x01EA25 }, - { "Australia/NSW" , 0x01EA8D }, - { "Australia/Perth" , 0x01ED9E }, - { "Australia/Queensland" , 0x01EE2A }, - { "Australia/South" , 0x01EECA }, - { "Australia/Sydney" , 0x01F1DB }, - { "Australia/Tasmania" , 0x01F4EC }, - { "Australia/Victoria" , 0x01F825 }, - { "Australia/West" , 0x01FB36 }, - { "Australia/Yancowinna" , 0x01FBC2 }, - { "Brazil/Acre" , 0x01FED8 }, - { "Brazil/DeNoronha" , 0x01FFBA }, - { "Brazil/East" , 0x0200CE }, - { "Brazil/West" , 0x02039F }, - { "Canada/Atlantic" , 0x02048B }, - { "Canada/Central" , 0x020967 }, - { "Canada/East-Saskatchewan" , 0x02124C }, - { "Canada/Eastern" , 0x020D68 }, - { "Canada/Mountain" , 0x0213C9 }, - { "Canada/Newfoundland" , 0x021733 }, - { "Canada/Pacific" , 0x021C52 }, - { "Canada/Saskatchewan" , 0x02205F }, - { "Canada/Yukon" , 0x0221DC }, - { "CET" , 0x0224D3 }, - { "Chile/Continental" , 0x0227C6 }, - { "Chile/EasterIsland" , 0x022B40 }, - { "CST6CDT" , 0x022E88 }, - { "Cuba" , 0x023387 }, - { "EET" , 0x0236F8 }, - { "Egypt" , 0x02399F }, - { "Eire" , 0x023D5A }, - { "EST" , 0x02425F }, - { "EST5EDT" , 0x0242A8 }, - { "Etc/GMT" , 0x02479B }, - { "Etc/GMT+0" , 0x024843 }, - { "Etc/GMT+1" , 0x0248B5 }, - { "Etc/GMT+10" , 0x02492A }, - { "Etc/GMT+11" , 0x0249A0 }, - { "Etc/GMT+12" , 0x024A16 }, - { "Etc/GMT+2" , 0x024B01 }, - { "Etc/GMT+3" , 0x024B75 }, - { "Etc/GMT+4" , 0x024BE9 }, - { "Etc/GMT+5" , 0x024C5D }, - { "Etc/GMT+6" , 0x024CD1 }, - { "Etc/GMT+7" , 0x024D45 }, - { "Etc/GMT+8" , 0x024DB9 }, - { "Etc/GMT+9" , 0x024E2D }, - { "Etc/GMT-0" , 0x02480B }, - { "Etc/GMT-1" , 0x02487B }, - { "Etc/GMT-10" , 0x0248EF }, - { "Etc/GMT-11" , 0x024965 }, - { "Etc/GMT-12" , 0x0249DB }, - { "Etc/GMT-13" , 0x024A51 }, - { "Etc/GMT-14" , 0x024A8C }, - { "Etc/GMT-2" , 0x024AC7 }, - { "Etc/GMT-3" , 0x024B3B }, - { "Etc/GMT-4" , 0x024BAF }, - { "Etc/GMT-5" , 0x024C23 }, - { "Etc/GMT-6" , 0x024C97 }, - { "Etc/GMT-7" , 0x024D0B }, - { "Etc/GMT-8" , 0x024D7F }, - { "Etc/GMT-9" , 0x024DF3 }, - { "Etc/GMT0" , 0x0247D3 }, - { "Etc/Greenwich" , 0x024E67 }, - { "Etc/UCT" , 0x024E9F }, - { "Etc/Universal" , 0x024ED7 }, - { "Etc/UTC" , 0x024F0F }, - { "Etc/Zulu" , 0x024F47 }, - { "Europe/Amsterdam" , 0x024F7F }, - { "Europe/Andorra" , 0x0253B1 }, - { "Europe/Athens" , 0x025621 }, - { "Europe/Belfast" , 0x025958 }, - { "Europe/Belgrade" , 0x025E83 }, - { "Europe/Berlin" , 0x02613B }, - { "Europe/Bratislava" , 0x026480 }, - { "Europe/Brussels" , 0x0267A6 }, - { "Europe/Bucharest" , 0x026BD1 }, - { "Europe/Budapest" , 0x026EEF }, - { "Europe/Chisinau" , 0x027251 }, - { "Europe/Copenhagen" , 0x0275D3 }, - { "Europe/Dublin" , 0x0278D1 }, - { "Europe/Gibraltar" , 0x027DD6 }, - { "Europe/Helsinki" , 0x028221 }, - { "Europe/Istanbul" , 0x0284CB }, - { "Europe/Kaliningrad" , 0x0288AC }, - { "Europe/Kiev" , 0x028BEC }, - { "Europe/Lisbon" , 0x028EE9 }, - { "Europe/Ljubljana" , 0x0293D9 }, - { "Europe/London" , 0x029691 }, - { "Europe/Luxembourg" , 0x029BBC }, - { "Europe/Madrid" , 0x02A006 }, - { "Europe/Malta" , 0x02A3B8 }, - { "Europe/Mariehamn" , 0x02A765 }, - { "Europe/Minsk" , 0x02AA0F }, - { "Europe/Monaco" , 0x02AD0E }, - { "Europe/Moscow" , 0x02B13D }, - { "Europe/Nicosia" , 0x02B46C }, - { "Europe/Oslo" , 0x02B748 }, - { "Europe/Paris" , 0x02BA6E }, - { "Europe/Prague" , 0x02BEA8 }, - { "Europe/Riga" , 0x02C1CE }, - { "Europe/Rome" , 0x02C507 }, - { "Europe/Samara" , 0x02C8BE }, - { "Europe/San_Marino" , 0x02CBBD }, - { "Europe/Sarajevo" , 0x02CF74 }, - { "Europe/Simferopol" , 0x02D22C }, - { "Europe/Skopje" , 0x02D53D }, - { "Europe/Sofia" , 0x02D7F5 }, - { "Europe/Stockholm" , 0x02DAE4 }, - { "Europe/Tallinn" , 0x02DD87 }, - { "Europe/Tirane" , 0x02E0B5 }, - { "Europe/Tiraspol" , 0x02E3AF }, - { "Europe/Uzhgorod" , 0x02E731 }, - { "Europe/Vaduz" , 0x02EA34 }, - { "Europe/Vatican" , 0x02ECBB }, - { "Europe/Vienna" , 0x02F072 }, - { "Europe/Vilnius" , 0x02F393 }, - { "Europe/Warsaw" , 0x02F6C6 }, - { "Europe/Zagreb" , 0x02FA96 }, - { "Europe/Zaporozhye" , 0x02FD4E }, - { "Europe/Zurich" , 0x030055 }, - { "Factory" , 0x030302 }, - { "GB" , 0x030367 }, - { "GB-Eire" , 0x030892 }, - { "GMT" , 0x030DBD }, - { "GMT+0" , 0x030E65 }, - { "GMT-0" , 0x030E2D }, - { "GMT0" , 0x030DF5 }, - { "Greenwich" , 0x030E9D }, - { "Hongkong" , 0x030ED5 }, - { "HST" , 0x03107F }, - { "Iceland" , 0x031101 }, - { "Indian/Antananarivo" , 0x0312AE }, - { "Indian/Chagos" , 0x031316 }, - { "Indian/Christmas" , 0x03136C }, - { "Indian/Cocos" , 0x0313A4 }, - { "Indian/Comoro" , 0x0313DC }, - { "Indian/Kerguelen" , 0x031425 }, - { "Indian/Mahe" , 0x03146E }, - { "Indian/Maldives" , 0x0314B7 }, - { "Indian/Mauritius" , 0x031500 }, - { "Indian/Mayotte" , 0x031549 }, - { "Indian/Reunion" , 0x031592 }, - { "Iran" , 0x0315DB }, - { "Israel" , 0x031851 }, - { "Jamaica" , 0x031B74 }, - { "Japan" , 0x031C2D }, - { "Kwajalein" , 0x031CAA }, - { "Libya" , 0x031D01 }, - { "MET" , 0x031DEF }, - { "Mexico/BajaNorte" , 0x0320E2 }, - { "Mexico/BajaSur" , 0x03242E }, - { "Mexico/General" , 0x032667 }, - { "MST" , 0x0328B9 }, - { "MST7MDT" , 0x03293B }, - { "Navajo" , 0x032CA8 }, - { "NZ" , 0x033015 }, - { "NZ-CHAT" , 0x033387 }, - { "Pacific/Apia" , 0x033663 }, - { "Pacific/Auckland" , 0x0336BE }, - { "Pacific/Chatham" , 0x033A30 }, - { "Pacific/Easter" , 0x033D0C }, - { "Pacific/Efate" , 0x034054 }, - { "Pacific/Enderbury" , 0x03410E }, - { "Pacific/Fakaofo" , 0x034161 }, - { "Pacific/Fiji" , 0x034199 }, - { "Pacific/Funafuti" , 0x034203 }, - { "Pacific/Galapagos" , 0x03423B }, - { "Pacific/Gambier" , 0x034296 }, - { "Pacific/Guadalcanal" , 0x0342E0 }, - { "Pacific/Guam" , 0x034329 }, - { "Pacific/Honolulu" , 0x034373 }, - { "Pacific/Johnston" , 0x0343F5 }, - { "Pacific/Kiritimati" , 0x03442D }, - { "Pacific/Kosrae" , 0x034480 }, - { "Pacific/Kwajalein" , 0x0344CB }, - { "Pacific/Majuro" , 0x034522 }, - { "Pacific/Marquesas" , 0x034567 }, - { "Pacific/Midway" , 0x0345B1 }, - { "Pacific/Nauru" , 0x034621 }, - { "Pacific/Niue" , 0x03468D }, - { "Pacific/Norfolk" , 0x0346DF }, - { "Pacific/Noumea" , 0x034728 }, - { "Pacific/Pago_Pago" , 0x0347AC }, - { "Pacific/Palau" , 0x034829 }, - { "Pacific/Pitcairn" , 0x034861 }, - { "Pacific/Ponape" , 0x0348AA }, - { "Pacific/Port_Moresby" , 0x0348E3 }, - { "Pacific/Rarotonga" , 0x03491B }, - { "Pacific/Saipan" , 0x0349EB }, - { "Pacific/Samoa" , 0x034A42 }, - { "Pacific/Tahiti" , 0x034ABF }, - { "Pacific/Tarawa" , 0x034B09 }, - { "Pacific/Tongatapu" , 0x034B42 }, - { "Pacific/Truk" , 0x034BC2 }, - { "Pacific/Wake" , 0x034BFB }, - { "Pacific/Wallis" , 0x034C34 }, - { "Pacific/Yap" , 0x034C6C }, - { "Poland" , 0x034CA5 }, - { "Portugal" , 0x035075 }, - { "PRC" , 0x035565 }, - { "PST8PDT" , 0x03560A }, - { "ROC" , 0x035A03 }, - { "ROK" , 0x035B0F }, - { "Singapore" , 0x035BA7 }, - { "Turkey" , 0x035C52 }, - { "UCT" , 0x036033 }, - { "Universal" , 0x03606B }, - { "US/Alaska" , 0x0360A3 }, - { "US/Aleutian" , 0x0363FB }, - { "US/Arizona" , 0x036755 }, - { "US/Central" , 0x0367D7 }, - { "US/East-Indiana" , 0x0371C9 }, - { "US/Eastern" , 0x036CD6 }, - { "US/Hawaii" , 0x037427 }, - { "US/Indiana-Starke" , 0x0374A9 }, - { "US/Michigan" , 0x03781A }, - { "US/Mountain" , 0x037B45 }, - { "US/Pacific" , 0x037EB2 }, - { "US/Pacific-New" , 0x0382AB }, - { "US/Samoa" , 0x0386A4 }, - { "UTC" , 0x038721 }, - { "W-SU" , 0x038A00 }, - { "WET" , 0x038759 }, - { "Zulu" , 0x038D2F }, -}; -/* This is a generated file, do not modify */ -unsigned char timelib_timezone_db_data_builtin[232807] = { - - -/* Africa/Abidjan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x92, 0x48, -0x01, 0xFF, 0xFF, 0xFC, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Accra */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9E, 0x30, 0x66, 0xB4, -0xC1, 0x4C, 0xF9, 0x80, 0xC1, 0xEC, 0x7A, 0x50, 0xC3, 0x2E, 0x2D, 0x00, 0xC3, 0xCD, 0xAD, 0xD0, -0xC5, 0x0F, 0x60, 0x80, 0xC5, 0xAE, 0xE1, 0x50, 0xC6, 0xF0, 0x94, 0x00, 0xC7, 0x90, 0x14, 0xD0, -0xC8, 0xD3, 0x19, 0x00, 0xC9, 0x72, 0x99, 0xD0, 0xCA, 0xB4, 0x4C, 0x80, 0xCB, 0x53, 0xCD, 0x50, -0xCC, 0x95, 0x80, 0x00, 0xCD, 0x35, 0x00, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xFF, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x04, -0xB0, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x48, 0x53, -0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Addis_Ababa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Algiers */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x91, 0x60, 0x50, 0x4F, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA4, 0xB8, 0x06, 0x70, -0xC6, 0xFF, 0x06, 0x70, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xDA, 0x09, 0xA0, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x8A, 0x00, 0x00, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x24, 0x70, 0xD4, 0x4B, 0x07, 0x70, -0xE5, 0xCE, 0xD3, 0x00, 0xF3, 0x5C, 0xB0, 0xF0, 0x02, 0x78, 0xC1, 0xF0, 0x03, 0x43, 0xC8, 0xF0, -0x0D, 0xCF, 0xD7, 0x00, 0x0E, 0xAD, 0x44, 0xF0, 0x0F, 0x78, 0x5A, 0x00, 0x10, 0x68, 0x59, 0x10, -0x12, 0x76, 0x43, 0x70, 0x13, 0x66, 0x42, 0x80, 0x14, 0x5F, 0x7C, 0x10, 0x15, 0x4F, 0x5F, 0x00, -0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x05, -0x04, 0x05, 0x04, 0x05, 0x03, 0x05, 0x03, 0x01, 0x02, 0x06, 0x05, 0x04, 0x05, 0x03, 0x06, 0x03, -0x05, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, -0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x50, 0x4D, 0x54, 0x00, 0x57, -0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Asmera */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bamako */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bangui */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x7D, 0x14, -0x01, 0x00, 0x00, 0x11, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Banjul */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x9E, 0x1C, -0xBE, 0x2A, 0x27, 0x9C, 0xF4, 0xB6, 0x36, 0x10, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xF0, 0x64, 0x00, -0x00, 0xFF, 0xFF, 0xF0, 0x64, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, -0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bissau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x91, 0xC4, 0x93, 0x1C, -0x09, 0x67, 0x61, 0x10, 0x01, 0x02, 0xFF, 0xFF, 0xF1, 0x64, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Blantyre */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0, -0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Brazzaville */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x80, 0x2C, -0x01, 0x00, 0x00, 0x0E, 0x54, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bujumbura */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, - -/* Africa/Cairo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0, -0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60, -0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, -0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, -0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, -0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, -0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, -0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70, -0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70, -0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0, -0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0, -0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70, -0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70, -0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0, -0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0, -0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70, -0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70, -0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70, -0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0, -0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70, -0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0, -0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0, -0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60, -0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60, -0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60, -0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, -0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x1C, 0x37, 0xD0, 0x46, 0x31, 0x20, 0xE0, -0x46, 0xFC, 0x19, 0xD0, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xDB, 0xFB, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, -0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, -0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, -0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, -0x59, 0xCD, 0x62, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0xAD, 0x44, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0, -0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x8B, 0x2C, 0x60, -0x61, 0x56, 0x25, 0x50, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x36, 0x07, 0x50, 0x64, 0x4A, 0xF0, 0x60, -0x65, 0x15, 0xE9, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x68, 0x0A, 0xB4, 0x60, -0x68, 0xD5, 0xAD, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xD3, 0xB2, 0xE0, -0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x7E, 0x8D, 0xD0, 0x6F, 0x93, 0x76, 0xE0, -0x70, 0x5E, 0x6F, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x53, 0x3A, 0xE0, -0x74, 0x1E, 0x33, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x76, 0x07, 0x50, 0x50, 0x77, 0x1C, 0x39, 0x60, -0x77, 0xE7, 0x32, 0x50, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xC7, 0x14, 0x50, 0x7A, 0xDB, 0xFD, 0x60, -0x7B, 0xA6, 0xF6, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x9B, 0xC1, 0x60, -0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Casablanca */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C, -0xC6, 0xFF, 0x14, 0x80, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xED, 0x80, 0xD2, 0xA1, 0x32, 0xF0, -0xDB, 0x35, 0xA4, 0x00, 0xDB, 0xEE, 0x27, 0xF0, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70, -0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0, -0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70, -0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, -0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Ceuta */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x9E, 0xD6, 0x75, 0x70, -0x9F, 0xA1, 0x6E, 0x60, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, -0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, -0xB2, 0x70, 0x22, 0x70, 0xB2, 0xE1, 0x91, 0x80, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70, -0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0, -0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70, -0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x45, 0x54, 0x00, -0x57, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Africa/Conakry */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9B, 0x5C, -0xBC, 0x92, 0xB8, 0x80, 0xED, 0x30, 0x16, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF3, 0x24, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Dakar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9E, 0xD8, -0xCA, 0x3B, 0x10, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xEF, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Dar_es_Salaam */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC, -0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xE3, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Africa/Djibouti */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C, -0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Douala */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0x68, -0x01, 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/El_Aaiun */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBC, 0x48, 0xF0, 0xE0, -0x0B, 0xD1, 0xB0, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xF3, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Freetown */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x95, 0x90, 0x32, 0x6C, -0xBE, 0xF1, 0x38, 0x90, 0xBF, 0x92, 0x06, 0x30, 0xC0, 0xD3, 0xBD, 0x90, 0xC1, 0x74, 0x8B, 0x30, -0xC2, 0xB4, 0xF1, 0x10, 0xC3, 0x55, 0xBE, 0xB0, 0xC4, 0x96, 0x24, 0x90, 0xC5, 0x36, 0xF2, 0x30, -0xC6, 0x77, 0x58, 0x10, 0xC7, 0x18, 0x25, 0xB0, 0xC8, 0x59, 0xDD, 0x10, 0xC8, 0xFA, 0xAA, 0xB0, -0xCA, 0x3B, 0x10, 0x90, 0xCA, 0xDB, 0xDE, 0x30, 0xCC, 0x1C, 0x44, 0x10, 0xCC, 0xBD, 0x11, 0xB0, -0xE7, 0x8C, 0x7C, 0x10, 0xE8, 0x53, 0x80, 0x80, 0xE8, 0xCC, 0xBC, 0x70, 0xEA, 0x34, 0xB4, 0x00, -0xEA, 0xAD, 0xEF, 0xF0, 0xEC, 0x15, 0xE7, 0x80, 0xEC, 0x8F, 0x23, 0x70, 0xED, 0xF8, 0x6C, 0x80, -0xEE, 0x71, 0xA8, 0x70, 0xEF, 0xD9, 0xA0, 0x00, 0xF0, 0x52, 0xDB, 0xF0, 0xF1, 0xBA, 0xD3, 0x80, -0xF2, 0x34, 0x0F, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0xFF, 0xFF, 0xF3, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xFB, 0x50, 0x01, 0x04, 0xFF, 0xFF, -0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x46, 0x4D, 0x54, 0x00, 0x53, 0x4C, 0x53, 0x54, 0x00, 0x57, -0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Africa/Gaborone */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xCE, 0x8E, 0x6E, 0x80, -0xCF, 0x7E, 0x51, 0x70, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x04, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Harare */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64, -0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Johannesburg */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, -0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* Africa/Kampala */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C, -0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x63, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, -0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, -0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Africa/Khartoum */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0x00, -0x00, 0x9E, 0x17, 0xE0, 0x01, 0x7A, 0x34, 0x50, 0x02, 0x7D, 0xF9, 0xE0, 0x03, 0x5B, 0x67, 0xD0, -0x04, 0x60, 0x7E, 0xE0, 0x05, 0x3D, 0xEC, 0xD0, 0x06, 0x40, 0x60, 0xE0, 0x07, 0x1F, 0x20, 0x50, -0x08, 0x20, 0x42, 0xE0, 0x09, 0x00, 0x53, 0xD0, 0x0A, 0x00, 0x24, 0xE0, 0x0A, 0xE1, 0x87, 0x50, -0x0B, 0xE0, 0x06, 0xE0, 0x0C, 0xC4, 0x0C, 0x50, 0x0D, 0xBF, 0xE8, 0xE0, 0x0E, 0xA5, 0x3F, 0xD0, -0x0F, 0xA9, 0x05, 0x60, 0x10, 0x86, 0x73, 0x50, 0x11, 0x88, 0xE7, 0x60, 0x12, 0x67, 0xA6, 0xD0, -0x13, 0x68, 0xC9, 0x60, 0x14, 0x4A, 0x2B, 0xD0, 0x15, 0x48, 0xAB, 0x60, 0x16, 0x2B, 0x5F, 0x50, -0x17, 0x28, 0x8D, 0x60, 0x18, 0x0C, 0x92, 0xD0, 0x19, 0x08, 0x6F, 0x60, 0x19, 0xED, 0xC6, 0x50, -0x1A, 0xF1, 0x8B, 0xE0, 0x1B, 0xD0, 0x4B, 0x50, 0x1C, 0xD1, 0x6D, 0xE0, 0x1D, 0xB1, 0x7E, 0xD0, -0x38, 0x80, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, -0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Kigali */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50, -0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Kinshasa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, - -/* Africa/Lagos */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50, -0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Libreville */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0xA4, -0x01, 0x00, 0x00, 0x08, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Lome */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Africa/Luanda */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xC4, 0x78, 0x4C, -0x01, 0x00, 0x00, 0x0C, 0x34, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x41, 0x4F, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Lubumbashi */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, - -/* Africa/Lusaka */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC, -0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Malabo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x86, 0x44, -0xF4, 0x9F, 0xBE, 0x80, 0x01, 0x02, 0x00, 0x00, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, -0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Maputo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, -0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Maseru */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Mbabane */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58, -0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Mogadishu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50, -0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28, -0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Monrovia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA0, 0x5F, 0x6C, 0x9C, -0x04, 0x61, 0xF6, 0xEE, 0x01, 0x02, 0xFF, 0xFF, 0xF5, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xF5, 0x92, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4D, 0x4D, 0x54, 0x00, 0x4C, 0x52, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Nairobi */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, -0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xE3, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, -0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, -0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Africa/Ndjamena */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xE6, 0x80, 0x64, -0x12, 0x66, 0x71, 0x70, 0x13, 0x26, 0xDE, 0x60, 0x01, 0x02, 0x01, 0x00, 0x00, 0x0E, 0x1C, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Africa/Niamey */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x84, -0xBC, 0x92, 0xC6, 0x90, 0xED, 0x30, 0x08, 0x80, 0x01, 0x02, 0x03, 0x00, 0x00, 0x01, 0xFC, 0x00, -0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Nouakchott */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9D, 0x74, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0xE5, 0xC8, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF1, 0x0C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Ouagadougou */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x8F, 0xEC, -0x01, 0xFF, 0xFF, 0xFE, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Porto-Novo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x0C, -0xBC, 0x92, 0xB8, 0x80, 0x01, 0x02, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, -0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Sao_Tome */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x97, 0x10, -0x01, 0xFF, 0xFF, 0xF7, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Timbuktu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Tripoli */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24, -0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0, -0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60, -0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0, -0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0, -0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60, -0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C, -0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Tunis */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x60, 0x50, 0x4F, -0xC6, 0x3A, 0x88, 0xE0, 0xC7, 0x58, 0x9E, 0x60, 0xC7, 0xDB, 0x22, 0xE0, 0xCA, 0xE2, 0x54, 0xE0, -0xCB, 0xAD, 0x69, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xC2, 0x16, 0x00, -0xCD, 0xCC, 0xB0, 0x10, 0xCE, 0xA2, 0x35, 0x00, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x89, 0xE3, 0xE0, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x16, 0x60, 0x0D, 0xC7, 0xDF, 0xF0, 0x0E, 0x89, 0xAC, 0x70, -0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x1A, 0x70, 0x22, 0xA3, 0x3A, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x05, 0x27, 0x70, -0x42, 0x74, 0x0D, 0xF0, 0x43, 0x3C, 0x80, 0x00, 0x03, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x50, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Windhoek */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x82, 0x46, 0xCF, 0x68, -0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0x26, 0x06, 0xA7, 0xE0, 0x2D, 0x9D, 0xEA, 0xE0, -0x2E, 0x69, 0x1C, 0x10, 0x2F, 0x7D, 0xE9, 0x00, 0x30, 0x48, 0xFE, 0x10, 0x31, 0x67, 0x05, 0x80, -0x32, 0x28, 0xE0, 0x10, 0x33, 0x46, 0xE7, 0x80, 0x34, 0x11, 0xFC, 0x90, 0x35, 0x26, 0xC9, 0x80, -0x35, 0xF1, 0xDE, 0x90, 0x37, 0x06, 0xAB, 0x80, 0x37, 0xD1, 0xC0, 0x90, 0x38, 0xE6, 0x8D, 0x80, -0x39, 0xB1, 0xA2, 0x90, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0x91, 0x84, 0x90, 0x3C, 0xAF, 0x8C, 0x00, -0x3D, 0x71, 0x66, 0x90, 0x3E, 0x8F, 0x6E, 0x00, 0x3F, 0x5A, 0x83, 0x10, 0x40, 0x6F, 0x50, 0x00, -0x41, 0x3A, 0x65, 0x10, 0x42, 0x4F, 0x32, 0x00, 0x43, 0x1A, 0x47, 0x10, 0x44, 0x2F, 0x14, 0x00, -0x44, 0xFA, 0x29, 0x10, 0x46, 0x0E, 0xF6, 0x00, 0x46, 0xDA, 0x0B, 0x10, 0x47, 0xF8, 0x12, 0x80, -0x48, 0xC3, 0x27, 0x90, 0x49, 0xD7, 0xF4, 0x80, 0x4A, 0xA3, 0x09, 0x90, 0x4B, 0xB7, 0xD6, 0x80, -0x4C, 0x82, 0xEB, 0x90, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x62, 0xCD, 0x90, 0x4F, 0x77, 0x9A, 0x80, -0x50, 0x42, 0xAF, 0x90, 0x51, 0x60, 0xB7, 0x00, 0x52, 0x22, 0x91, 0x90, 0x53, 0x40, 0x99, 0x00, -0x54, 0x0B, 0xAE, 0x10, 0x55, 0x20, 0x7B, 0x00, 0x55, 0xEB, 0x90, 0x10, 0x57, 0x00, 0x5D, 0x00, -0x57, 0xCB, 0x72, 0x10, 0x58, 0xE0, 0x3F, 0x00, 0x59, 0xAB, 0x54, 0x10, 0x5A, 0xC0, 0x21, 0x00, -0x5B, 0x8B, 0x36, 0x10, 0x5C, 0xA9, 0x3D, 0x80, 0x5D, 0x6B, 0x18, 0x10, 0x5E, 0x89, 0x1F, 0x80, -0x5F, 0x54, 0x34, 0x90, 0x60, 0x69, 0x01, 0x80, 0x61, 0x34, 0x16, 0x90, 0x62, 0x48, 0xE3, 0x80, -0x63, 0x13, 0xF8, 0x90, 0x64, 0x28, 0xC5, 0x80, 0x64, 0xF3, 0xDA, 0x90, 0x66, 0x11, 0xE2, 0x00, -0x66, 0xD3, 0xBC, 0x90, 0x67, 0xF1, 0xC4, 0x00, 0x68, 0xBC, 0xD9, 0x10, 0x69, 0xD1, 0xA6, 0x00, -0x6A, 0x9C, 0xBB, 0x10, 0x6B, 0xB1, 0x88, 0x00, 0x6C, 0x7C, 0x9D, 0x10, 0x6D, 0x91, 0x6A, 0x00, -0x6E, 0x5C, 0x7F, 0x10, 0x6F, 0x71, 0x4C, 0x00, 0x70, 0x3C, 0x61, 0x10, 0x71, 0x5A, 0x68, 0x80, -0x72, 0x1C, 0x43, 0x10, 0x73, 0x3A, 0x4A, 0x80, 0x74, 0x05, 0x5F, 0x90, 0x75, 0x1A, 0x2C, 0x80, -0x75, 0xE5, 0x41, 0x90, 0x76, 0xFA, 0x0E, 0x80, 0x77, 0xC5, 0x23, 0x90, 0x78, 0xD9, 0xF0, 0x80, -0x79, 0xA5, 0x05, 0x90, 0x7A, 0xB9, 0xD2, 0x80, 0x7B, 0x84, 0xE7, 0x90, 0x7C, 0xA2, 0xEF, 0x00, -0x7D, 0x6E, 0x04, 0x10, 0x7E, 0x82, 0xD1, 0x00, 0x7F, 0x4D, 0xE6, 0x10, 0x01, 0x02, 0x01, 0x03, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0A, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x01, 0x53, 0x57, 0x41, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Adak */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Anchorage */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0xCB, 0x89, 0x36, 0xC0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40, -0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40, -0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0, -0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40, -0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0, -0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40, -0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40, -0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40, -0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81, -0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x09, 0xFF, -0xFF, 0x81, 0x70, 0x01, 0x0E, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x13, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x17, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1C, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00, -0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, 0x4B, -0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Anguilla */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x35, 0x20, -0x01, 0xFF, 0xFF, 0xC4, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Antigua */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x33, 0xF0, -0xDC, 0x42, 0xDC, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xC6, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Araguaina */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, -0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Buenos_Aires */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Catamarca */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Argentina/ComodRivadavia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Argentina/Cordoba */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Jujuy */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0, -0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, -0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, -0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/La_Rioja */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, -0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, -0x40, 0xBB, 0xF1, 0x30, 0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, -0x04, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, -0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, -0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Mendoza */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40, -0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0, -0x41, 0x56, 0x3E, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Rio_Gallegos */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Argentina/San_Juan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, -0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, -0x40, 0xBA, 0x9F, 0xB0, 0x41, 0x03, 0x30, 0x40, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, -0x04, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, -0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, -0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Tucuman */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xCB, 0xD1, 0x40, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Argentina/Ushuaia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB9, 0x4E, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Aruba */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2F, 0x38, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Asuncion */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x17, 0xF5, 0x90, -0x05, 0x2B, 0xDA, 0x40, 0x07, 0xFC, 0xF0, 0xB0, 0x0A, 0xCF, 0x74, 0xC0, 0x0B, 0x97, 0xCA, 0xB0, -0x0C, 0xB1, 0xF9, 0xC0, 0x0D, 0x78, 0xFE, 0x30, 0x0E, 0x93, 0x2D, 0x40, 0x0F, 0x5A, 0x31, 0xB0, -0x10, 0x74, 0x60, 0xC0, 0x11, 0x64, 0x43, 0xB0, 0x12, 0x55, 0x94, 0x40, 0x13, 0x46, 0xC8, 0xB0, -0x14, 0x38, 0x19, 0x40, 0x15, 0x27, 0xFC, 0x30, 0x16, 0x19, 0x4C, 0xC0, 0x17, 0x09, 0x2F, 0xB0, -0x17, 0xFA, 0x80, 0x40, 0x18, 0xEA, 0x63, 0x30, 0x19, 0xDB, 0xB3, 0xC0, 0x1A, 0xCC, 0xE8, 0x30, -0x1B, 0xBE, 0x38, 0xC0, 0x1C, 0xAE, 0x1B, 0xB0, 0x1D, 0x9F, 0x6C, 0x40, 0x1E, 0x8F, 0x4F, 0x30, -0x1F, 0x80, 0x9F, 0xC0, 0x20, 0x70, 0x82, 0xB0, 0x21, 0x61, 0xD3, 0x40, 0x22, 0x53, 0x07, 0xB0, -0x23, 0x44, 0x58, 0x40, 0x24, 0x34, 0x3B, 0x30, 0x25, 0x41, 0x3B, 0x40, 0x26, 0x15, 0x6E, 0xB0, -0x27, 0x06, 0xBF, 0x40, 0x27, 0xF6, 0xA2, 0x30, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x48, 0xB0, -0x2A, 0xCF, 0xBD, 0xC0, 0x2B, 0xB9, 0x09, 0x30, 0x2C, 0xAB, 0xAB, 0x40, 0x2D, 0x70, 0x0C, 0xB0, -0x2E, 0x8C, 0xDE, 0xC0, 0x2F, 0x4F, 0xEE, 0xB0, 0x30, 0x6E, 0x12, 0x40, 0x31, 0x36, 0x68, 0x30, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x0F, 0xB2, 0xB0, 0x34, 0x37, 0x10, 0xC0, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x16, 0xF2, 0xC0, 0x36, 0xE1, 0xEB, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xC1, 0xCD, 0xB0, -0x39, 0xD6, 0xB6, 0xC0, 0x3A, 0xA1, 0xAF, 0xB0, 0x3B, 0xBF, 0xD3, 0x40, 0x3C, 0xAF, 0xB6, 0x30, -0x3D, 0x71, 0x90, 0xC0, 0x3E, 0x8F, 0x98, 0x30, 0x3F, 0x5A, 0xAD, 0x40, 0x40, 0x6F, 0x7A, 0x30, -0x41, 0x71, 0xEE, 0x40, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x51, 0xD0, 0x40, 0x44, 0x13, 0x8E, 0xB0, -0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xD3, 0x52, 0xB0, -0x48, 0xFA, 0xB0, 0xC0, 0x49, 0xB3, 0x34, 0xB0, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x9C, 0x51, 0x30, -0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x5C, 0x15, 0x30, -0x50, 0x83, 0x73, 0x40, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x63, 0x55, 0x40, 0x53, 0x1B, 0xD9, 0x30, -0x54, 0x43, 0x37, 0x40, 0x54, 0xFB, 0xBB, 0x30, 0x56, 0x23, 0x19, 0x40, 0x56, 0xE4, 0xD7, 0xB0, -0x58, 0x02, 0xFB, 0x40, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, -0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x64, 0x5F, 0xB0, -0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x2D, 0x5E, 0x30, -0x63, 0x4B, 0x81, 0xC0, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, -0x67, 0x14, 0x80, 0x40, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xF4, 0x62, 0x40, 0x69, 0xAC, 0xE6, 0x30, -0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x75, 0xE4, 0xB0, -0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x35, 0xA8, 0xB0, -0x72, 0x5D, 0x06, 0xC0, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xFE, 0xA7, 0x30, -0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xBE, 0x6B, 0x30, -0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x7E, 0x2F, 0x30, -0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x5E, 0x11, 0x30, 0x7F, 0x85, 0x6F, 0x40, 0x01, 0x02, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0xFF, 0xFF, 0xC9, 0xF0, -0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, -0xD5, 0xD0, 0x01, 0x08, 0x41, 0x4D, 0x54, 0x00, 0x50, 0x59, 0x54, 0x00, 0x50, 0x59, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Atka */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Bahia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x1C, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDB, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, -0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Barbados */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA9, 0x79, 0x24, 0xE4, -0xB8, 0x85, 0x63, 0xE4, 0x0E, 0x00, 0xF2, 0xE0, 0x0E, 0x94, 0x8C, 0xD0, 0x0F, 0x97, 0x00, 0xE0, -0x10, 0x74, 0x6E, 0xD0, 0x11, 0x76, 0xE2, 0xE0, 0x12, 0x54, 0x50, 0xD0, 0x13, 0x5F, 0xFF, 0x60, -0x14, 0x30, 0x3E, 0x50, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, -0xC8, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC8, 0x1C, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x41, 0x44, -0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Belem */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x74, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xD2, -0x8C, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Belize */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x93, 0x5E, 0xD9, 0xB0, -0x9F, 0x9F, 0x3B, 0xE0, 0xA0, 0x45, 0x51, 0xD8, 0xA1, 0x7F, 0x1D, 0xE0, 0xA2, 0x2E, 0x6E, 0x58, -0xA3, 0x5E, 0xFF, 0xE0, 0xA4, 0x0E, 0x50, 0x58, 0xA5, 0x3E, 0xE1, 0xE0, 0xA5, 0xEE, 0x32, 0x58, -0xA7, 0x27, 0xFE, 0x60, 0xA7, 0xCE, 0x14, 0x58, 0xA9, 0x07, 0xE0, 0x60, 0xA9, 0xAD, 0xF6, 0x58, -0xAA, 0xE7, 0xC2, 0x60, 0xAB, 0x97, 0x12, 0xD8, 0xAC, 0xC7, 0xA4, 0x60, 0xAD, 0x76, 0xF4, 0xD8, -0xAE, 0xA7, 0x86, 0x60, 0xAF, 0x56, 0xD6, 0xD8, 0xB0, 0x87, 0x68, 0x60, 0xB1, 0x36, 0xB8, 0xD8, -0xB2, 0x70, 0x84, 0xE0, 0xB3, 0x16, 0x9A, 0xD8, 0xB4, 0x50, 0x66, 0xE0, 0xB4, 0xF6, 0x7C, 0xD8, -0xB6, 0x30, 0x48, 0xE0, 0xB6, 0xDF, 0x99, 0x58, 0xB8, 0x10, 0x2A, 0xE0, 0xB8, 0xBF, 0x7B, 0x58, -0xB9, 0xF0, 0x0C, 0xE0, 0xBA, 0x9F, 0x5D, 0x58, 0xBB, 0xD9, 0x29, 0x60, 0xBC, 0x7F, 0x3F, 0x58, -0xBD, 0xB9, 0x0B, 0x60, 0xBE, 0x5F, 0x21, 0x58, 0xBF, 0x98, 0xED, 0x60, 0xC0, 0x3F, 0x03, 0x58, -0xC1, 0x78, 0xCF, 0x60, 0xC2, 0x28, 0x1F, 0xD8, 0xC3, 0x58, 0xB1, 0x60, 0xC4, 0x08, 0x01, 0xD8, -0xC5, 0x38, 0x93, 0x60, 0xC5, 0xE7, 0xE3, 0xD8, 0xC7, 0x21, 0xAF, 0xE0, 0xC7, 0xC7, 0xC5, 0xD8, -0xC9, 0x01, 0x91, 0xE0, 0xC9, 0xA7, 0xA7, 0xD8, 0xCA, 0xE1, 0x73, 0xE0, 0xCB, 0x90, 0xC4, 0x58, -0xCC, 0xC1, 0x55, 0xE0, 0xCD, 0x70, 0xA6, 0x58, 0x07, 0x62, 0xDB, 0x60, 0x07, 0xB9, 0xD0, 0x50, -0x18, 0x61, 0x71, 0x60, 0x18, 0xAB, 0x37, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, -0xFF, 0xAD, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xB2, 0xA8, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x09, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x44, 0x54, 0x00, -0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Boa_Vista */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0xE0, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, 0x39, 0xDF, 0xF1, 0x40, 0x39, 0xE9, 0x1D, 0xB0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0xFF, 0xFF, 0xC7, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, -0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Bogota */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x98, 0x58, 0x55, 0x74, -0x2A, 0x02, 0x21, 0xD0, 0x2B, 0x42, 0x70, 0x40, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBA, 0x8C, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x42, 0x4D, 0x54, -0x00, 0x43, 0x4F, 0x53, 0x54, 0x00, 0x43, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Boise */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xA8, 0x46, 0x4C, 0x20, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, -0x03, 0x71, 0x1A, 0x80, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x07, 0xB2, 0x1F, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, -0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, -0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, -0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, -0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, -0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, -0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, -0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, -0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, -0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, -0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, -0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, -0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, -0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, -0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, -0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, -0x7F, 0x98, 0x1C, 0x80, 0x00, 0x01, 0x00, 0x01, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, -0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x14, 0x50, 0x44, -0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x53, -0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, - -/* America/Buenos_Aires */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Cambridge_Bay */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x9E, 0xB8, 0xAF, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0xCF, 0xF0, 0x90, 0xA1, 0xA2, 0xB6, 0x60, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x85, 0xF0, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0x04, 0xE9, 0x50, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x06, 0x05, 0x07, 0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x15, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x19, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x1D, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, -0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, - -/* America/Campo_Grande */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7A, 0x34, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30, -0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, -0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, -0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0, -0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x3F, 0x92, 0x0C, 0x40, 0x40, 0x2E, 0xE0, 0xB0, -0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30, 0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, -0x45, 0x31, 0xB2, 0x40, 0x45, 0xD7, 0xC1, 0x30, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xB7, 0xA3, 0x30, -0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0, -0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x40, 0x65, 0xB0, -0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0, 0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0, -0x54, 0x43, 0x37, 0x40, 0x54, 0xE0, 0x0B, 0xB0, 0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30, -0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30, -0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30, -0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0, -0x63, 0x4B, 0x81, 0xC0, 0x63, 0xF1, 0x90, 0xB0, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0, -0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0, 0x68, 0xF4, 0x62, 0x40, 0x69, 0x91, 0x36, 0xB0, -0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30, -0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30, -0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30, -0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xA2, 0xBB, 0xB0, -0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0, -0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x42, 0x61, 0xB0, 0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xCC, 0xCC, -0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* America/Cancun */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xDA, 0x60, -0x16, 0x86, 0xD5, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x35, 0xC4, 0x00, 0x60, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, -0xFF, 0xAE, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Caracas */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x93, 0x1E, 0x2C, 0x3C, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xC1, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x56, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Catamarca */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Cayenne */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x2B, 0x90, -0xFB, 0xC3, 0x35, 0xC0, 0x01, 0x02, 0xFF, 0xFF, 0xCE, 0xF0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x46, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Cayman */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB5, 0x00, -0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Chicago */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00, -0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00, -0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00, -0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00, -0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80, -0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80, -0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80, -0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00, -0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00, -0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00, -0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80, -0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* America/Chihuahua */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, -0x3B, 0xB6, 0xD1, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, -0x9C, 0x8C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Coral_Harbour */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0xCF, 0xD4, 0x70, 0xA1, 0xA2, 0x9A, 0x40, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Cordoba */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Costa_Rica */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA3, 0xE8, 0x16, 0x54, -0x11, 0x36, 0x49, 0x60, 0x11, 0xB7, 0x6E, 0x50, 0x13, 0x16, 0x2B, 0x60, 0x13, 0x97, 0x50, 0x50, -0x27, 0x97, 0xE0, 0x60, 0x28, 0x6E, 0xB6, 0xD0, 0x29, 0x77, 0xC2, 0x60, 0x29, 0xC2, 0xD9, 0xD0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB1, 0x2C, 0x00, 0x00, 0xFF, -0xFF, 0xB9, 0xB0, 0x01, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x09, 0x53, 0x4A, 0x4D, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Cuiaba */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7B, 0x94, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30, -0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, -0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, -0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0, -0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30, -0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xD7, 0xC1, 0x30, -0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xB7, 0xA3, 0x30, 0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30, -0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0, 0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0, -0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x40, 0x65, 0xB0, 0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0, -0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0, 0x54, 0x43, 0x37, 0x40, 0x54, 0xE0, 0x0B, 0xB0, -0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30, 0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30, -0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30, 0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30, -0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30, 0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0, -0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0, 0x63, 0x4B, 0x81, 0xC0, 0x63, 0xF1, 0x90, 0xB0, -0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0, 0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0, -0x68, 0xF4, 0x62, 0x40, 0x69, 0x91, 0x36, 0xB0, 0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30, -0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30, -0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30, 0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30, -0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30, 0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0, -0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xA2, 0xBB, 0xB0, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0, -0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0, 0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x42, 0x61, 0xB0, -0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0xFF, 0xFF, 0xCB, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Curacao */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2E, 0x20, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Danmarkshavn */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x9B, 0x80, 0x49, 0x00, -0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x30, 0xE7, 0x4E, 0x30, 0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0xFF, 0xFF, 0xEE, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, -0xE3, 0xE0, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47, -0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - -/* America/Dawson */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0x07, 0x30, 0xEC, 0x90, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, -0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, -0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, -0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, -0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, -0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, -0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, -0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, -0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, -0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, -0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, -0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, -0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, -0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, -0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, -0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, -0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - -/* America/Dawson_Creek */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, 0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, -0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, 0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, -0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, 0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, -0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, -0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, -0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, -0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, -0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, 0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, -0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, 0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, -0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, 0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, -0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, 0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, -0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, 0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, -0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, 0x04, 0x61, 0x27, 0xA0, 0x05, 0x01, 0xF0, 0x90, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, -0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Denver */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Detroit */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B, -0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, -0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Dominica */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x4C, -0x01, 0xFF, 0xFF, 0xC6, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Edmonton */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80, -0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80, -0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, -0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, -0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* America/Eirunepe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x88, 0x80, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x2C, 0xC0, 0xD1, 0x50, 0x2D, 0x66, 0xE0, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xC7, -0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, -0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/El_Salvador */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xD5, 0xA6, 0x20, -0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50, -0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Ensenada */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00, -0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, -0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, -0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, -0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0, -0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20, -0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20, -0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, -0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, -0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, -0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, -0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, -0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, -0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, -0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, -0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, -0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, -0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, -0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, -0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, -0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, -0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, -0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, -0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, -0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, -0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, -0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, -0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, -0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, -0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, -0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, -0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, -0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, -0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, -0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, -0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02, -0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80, -0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Fortaleza */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x18, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xDB, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/Fort_Wayne */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Glace_Bay */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xA8, 0x34, -0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, 0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xED, 0xD0, 0xE0, 0x9E, 0x3F, 0x60, 0xE1, 0x69, 0x38, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0, -0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0, -0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0, -0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60, -0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60, -0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60, -0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0, -0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0, -0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60, -0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60, -0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60, -0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0, -0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0, -0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0, -0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60, -0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x03, -0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xCC, 0x00, 0x00, 0xFF, 0xFF, -0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, -0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, - -/* America/Godthab */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x80, 0x68, 0x00, -0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCF, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, -0xE0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47, 0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* America/Goose_Bay */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0x7E, 0x8C, -0x9F, 0xC0, 0x1C, 0x7C, 0xBE, 0x9E, 0x4D, 0x6C, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF8, 0xDA, 0x6B, 0x58, 0xF9, 0x0F, 0x2E, 0x60, 0xFA, 0x08, 0x4B, 0xD0, -0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, 0xFD, 0xC8, 0x0F, 0xD0, -0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, 0x01, 0x87, 0xD3, 0xD0, -0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, 0x05, 0x50, 0xD2, 0x50, -0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, -0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, -0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, -0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, -0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, -0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, -0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, -0x20, 0x75, 0xD6, 0xFC, 0x21, 0x81, 0x69, 0x6C, 0x22, 0x55, 0xB8, 0xFC, 0x23, 0x6A, 0x77, 0xDC, -0x24, 0x35, 0x9A, 0xFC, 0x25, 0x4A, 0x67, 0xEC, 0x26, 0x15, 0x7C, 0xFC, 0x27, 0x2A, 0x49, 0xEC, -0x27, 0xFE, 0x99, 0x7C, 0x29, 0x0A, 0x2B, 0xEC, 0x29, 0xDE, 0x7B, 0x7C, 0x2A, 0xEA, 0x0D, 0xEC, -0x2B, 0xBE, 0x5D, 0x7C, 0x2C, 0xD3, 0x2A, 0x6C, 0x2D, 0x9E, 0x3F, 0x7C, 0x2E, 0xB3, 0x0C, 0x6C, -0x2F, 0x7E, 0x21, 0x7C, 0x30, 0x92, 0xEE, 0x6C, 0x31, 0x67, 0x3D, 0xFC, 0x32, 0x72, 0xD0, 0x6C, -0x33, 0x47, 0x1F, 0xFC, 0x34, 0x52, 0xB2, 0x6C, 0x35, 0x27, 0x01, 0xFC, 0x36, 0x32, 0x94, 0x6C, -0x37, 0x06, 0xE3, 0xFC, 0x38, 0x1B, 0xB0, 0xEC, 0x38, 0xE6, 0xC5, 0xFC, 0x39, 0xFB, 0x92, 0xEC, -0x3A, 0xC6, 0xA7, 0xFC, 0x3B, 0xDB, 0x74, 0xEC, 0x3C, 0xAF, 0xC4, 0x7C, 0x3D, 0xBB, 0x56, 0xEC, -0x3E, 0x8F, 0xA6, 0x7C, 0x3F, 0x9B, 0x38, 0xEC, 0x40, 0x6F, 0x88, 0x7C, 0x41, 0x84, 0x55, 0x6C, -0x42, 0x4F, 0x6A, 0x7C, 0x43, 0x64, 0x37, 0x6C, 0x44, 0x2F, 0x4C, 0x7C, 0x45, 0x44, 0x19, 0x6C, -0x46, 0x0F, 0x2E, 0x7C, 0x47, 0x23, 0xFB, 0x6C, 0x47, 0xF8, 0x4A, 0xFC, 0x49, 0x03, 0xDD, 0x6C, -0x49, 0xD8, 0x2C, 0xFC, 0x4A, 0xE3, 0xBF, 0x6C, 0x4B, 0xB8, 0x0E, 0xFC, 0x4C, 0xCC, 0xDB, 0xEC, -0x4D, 0x97, 0xF0, 0xFC, 0x4E, 0xAC, 0xBD, 0xEC, 0x4F, 0x77, 0xD2, 0xFC, 0x50, 0x8C, 0x9F, 0xEC, -0x51, 0x60, 0xEF, 0x7C, 0x52, 0x6C, 0x81, 0xEC, 0x53, 0x40, 0xD1, 0x7C, 0x54, 0x4C, 0x63, 0xEC, -0x55, 0x20, 0xB3, 0x7C, 0x56, 0x2C, 0x45, 0xEC, 0x57, 0x00, 0x95, 0x7C, 0x58, 0x15, 0x62, 0x6C, -0x58, 0xE0, 0x77, 0x7C, 0x59, 0xF5, 0x44, 0x6C, 0x5A, 0xC0, 0x59, 0x7C, 0x5B, 0xD5, 0x26, 0x6C, -0x5C, 0xA9, 0x75, 0xFC, 0x5D, 0xB5, 0x08, 0x6C, 0x5E, 0x89, 0x57, 0xFC, 0x5F, 0x94, 0xEA, 0x6C, -0x60, 0x69, 0x39, 0xFC, 0x61, 0x7E, 0x06, 0xEC, 0x62, 0x49, 0x1B, 0xFC, 0x63, 0x5D, 0xE8, 0xEC, -0x64, 0x28, 0xFD, 0xFC, 0x65, 0x3D, 0xCA, 0xEC, 0x66, 0x12, 0x1A, 0x7C, 0x67, 0x1D, 0xAC, 0xEC, -0x67, 0xF1, 0xFC, 0x7C, 0x68, 0xFD, 0x8E, 0xEC, 0x69, 0xD1, 0xDE, 0x7C, 0x6A, 0xDD, 0x70, 0xEC, -0x6B, 0xB1, 0xC0, 0x7C, 0x6C, 0xC6, 0x8D, 0x6C, 0x6D, 0x91, 0xA2, 0x7C, 0x6E, 0xA6, 0x6F, 0x6C, -0x6F, 0x71, 0x84, 0x7C, 0x70, 0x86, 0x51, 0x6C, 0x71, 0x5A, 0xA0, 0xFC, 0x72, 0x66, 0x33, 0x6C, -0x73, 0x3A, 0x82, 0xFC, 0x74, 0x46, 0x15, 0x6C, 0x75, 0x1A, 0x64, 0xFC, 0x76, 0x2F, 0x31, 0xEC, -0x76, 0xFA, 0x46, 0xFC, 0x78, 0x0F, 0x13, 0xEC, 0x78, 0xDA, 0x28, 0xFC, 0x79, 0xEE, 0xF5, 0xEC, -0x7A, 0xBA, 0x0A, 0xFC, 0x7B, 0xCE, 0xD7, 0xEC, 0x7C, 0xA3, 0x27, 0x7C, 0x7D, 0xAE, 0xB9, 0xEC, -0x7E, 0x83, 0x09, 0x7C, 0x7F, 0x8E, 0x9B, 0xEC, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x08, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x04, 0xFF, -0xFF, 0xCE, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, -0x08, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0xFF, 0xFF, 0xC7, -0xC0, 0x00, 0x14, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x18, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54, -0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, -0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* America/Grand_Turk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x11, 0x89, 0x49, 0xD0, 0x12, 0x79, 0x2C, 0xC0, 0x13, 0x69, 0x2B, 0xD0, 0x14, 0x59, 0x0E, 0xC0, -0x15, 0x49, 0x0D, 0xD0, 0x16, 0x38, 0xF0, 0xC0, 0x17, 0x28, 0xEF, 0xD0, 0x18, 0x22, 0x0D, 0x40, -0x19, 0x08, 0xD1, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40, -0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40, -0x20, 0x75, 0xE4, 0xD0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xC6, 0xD0, 0x23, 0x6A, 0x93, 0xC0, -0x24, 0x35, 0xA8, 0xD0, 0x25, 0x4A, 0x75, 0xC0, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x2A, 0x57, 0xC0, -0x27, 0xFE, 0xA7, 0x50, 0x29, 0x0A, 0x39, 0xC0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xEA, 0x1B, 0xC0, -0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xD3, 0x38, 0x40, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0xB3, 0x1A, 0x40, -0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x92, 0xFC, 0x40, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x72, 0xDE, 0x40, -0x33, 0x47, 0x2D, 0xD0, 0x34, 0x52, 0xC0, 0x40, 0x35, 0x27, 0x0F, 0xD0, 0x36, 0x32, 0xA2, 0x40, -0x37, 0x06, 0xF1, 0xD0, 0x38, 0x1B, 0xBE, 0xC0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xA0, 0xC0, -0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x82, 0xC0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x64, 0xC0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x46, 0xC0, 0x40, 0x6F, 0x96, 0x50, 0x41, 0x84, 0x63, 0x40, -0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, 0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x27, 0x40, -0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x09, 0x40, 0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xEB, 0x40, -0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xCD, 0x40, 0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xE9, 0xC0, -0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xCB, 0xC0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xAD, 0xC0, -0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x8F, 0xC0, 0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x71, 0xC0, -0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x53, 0xC0, 0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x70, 0x40, -0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x52, 0x40, 0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x34, 0x40, -0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x16, 0x40, 0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x94, 0xF8, 0x40, -0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x14, 0xC0, 0x62, 0x49, 0x29, 0xD0, 0x63, 0x5D, 0xF6, 0xC0, -0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xD8, 0xC0, 0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xBA, 0xC0, -0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0x9C, 0xC0, 0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x7E, 0xC0, -0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0x9B, 0x40, 0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x7D, 0x40, -0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x5F, 0x40, 0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x41, 0x40, -0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x23, 0x40, 0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x3F, 0xC0, -0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x21, 0xC0, 0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x03, 0xC0, -0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xE5, 0xC0, 0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xC7, 0xC0, -0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xA9, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* America/Grenada */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x64, -0x01, 0xFF, 0xFF, 0xC6, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Guadeloupe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Guatemala */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9F, 0x9D, 0xEA, 0xDC, -0x07, 0x55, 0xAC, 0x60, 0x07, 0xCD, 0x96, 0xD0, 0x19, 0x2C, 0x78, 0x60, 0x19, 0xCF, 0xE4, 0x50, -0x27, 0xEA, 0xEE, 0xE0, 0x28, 0xC8, 0x5C, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xAB, 0x24, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* America/Guayaquil */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xB6, 0xA4, 0x42, 0x18, -0x01, 0xFF, 0xFF, 0xB6, 0x68, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x51, 0x4D, 0x54, -0x00, 0x45, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Guyana */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x98, 0xD9, 0x79, 0x88, -0xF9, 0x39, 0x3E, 0xBC, 0x0A, 0x7D, 0xB4, 0x3C, 0x27, 0x7F, 0xFB, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0xC9, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xCB, 0x44, 0x00, 0x04, 0xFF, 0xFF, 0xCB, 0x44, -0x00, 0x09, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x47, 0x42, 0x47, 0x54, 0x00, 0x47, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Halifax */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0, -0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, -0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30, -0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0, -0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30, -0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30, -0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30, -0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0, -0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30, -0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30, -0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30, -0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30, -0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0, -0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0, -0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60, -0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60, -0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0, -0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0, -0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60, -0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60, -0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, -0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, -0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0, -0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0, -0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0, -0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60, -0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60, -0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60, -0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0, -0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0, -0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60, -0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60, -0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60, -0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0, -0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0, -0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0, -0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60, -0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* America/Havana */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80, -0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40, -0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0, -0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0, -0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0, -0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40, -0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0, -0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0, -0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0, -0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0, -0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40, -0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0, -0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40, -0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0, -0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0, -0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0, -0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0, -0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, -0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x43, 0x64, 0x53, 0x50, -0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x17, 0x50, -0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, -0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0, -0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x9D, 0xD0, -0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x61, 0xD0, -0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x60, 0x50, -0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x24, 0x50, -0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x22, 0xD0, -0x62, 0x49, 0x29, 0xD0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xE6, 0xD0, -0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0xAA, 0xD0, -0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0xA9, 0x50, -0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x6D, 0x50, -0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x31, 0x50, -0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x2F, 0xD0, -0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0, -0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xB7, 0xD0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2, -0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0x48, 0x4D, 0x54, 0x00, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* America/Hermosillo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x97, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* America/Indiana/Indianapolis */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Indiana/Knox */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, -0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, - -/* America/Indiana/Marengo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xEF, 0xAF, 0xE0, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, -0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, -0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, -0x0A, 0xF0, 0x86, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, -0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, -0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, - -/* America/Indianapolis */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Indiana/Vevay */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xE2, 0x7E, 0x3D, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, -0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x00, 0x00, - -/* America/Inuvik */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0xCF, 0xFE, 0xA0, 0xA1, 0xA2, 0xC4, 0x70, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x94, 0x00, -0x11, 0x89, 0x90, 0x20, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, -0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, -0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x19, 0x50, 0x44, 0x54, 0x00, -0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x50, 0x44, 0x44, 0x54, -0x00, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - -/* America/Iqaluit */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0xCF, 0xD4, 0x70, 0xA1, 0xA2, 0x9A, 0x40, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xF7, 0x2F, 0x3E, 0x50, 0xF8, 0x28, 0x69, 0xD0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, -0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, -0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, -0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, -0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, -0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, -0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, -0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, -0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, -0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, -0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, -0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, -0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, -0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, -0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, -0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x05, 0x06, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, -0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x15, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x19, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, - -/* America/Jamaica */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Jujuy */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0, -0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, -0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, -0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/Juneau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0, -0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30, -0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30, -0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0, -0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0, -0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0, -0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30, -0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30, -0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30, -0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0, -0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0, -0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30, -0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30, -0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0, -0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0, -0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0, -0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30, -0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30, -0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0, -0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0, -0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0, -0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30, -0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30, -0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30, -0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0, -0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0, -0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0, -0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x04, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x04, 0xFF, 0xFF, -0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x10, -0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x18, 0xFF, 0xFF, 0x81, 0x70, -0x00, 0x1D, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x50, 0x44, -0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/Kentucky/Louisville */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00, -0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70, -0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Kentucky/Monticello */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x14, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, - -/* America/Knox_IN */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, -0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, - -/* America/La_Paz */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x1E, 0x96, 0xE4, -0xB8, 0xEE, 0xD5, 0xD4, 0x01, 0x02, 0xFF, 0xFF, 0xC0, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xCE, 0x2C, -0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4F, 0x53, 0x54, -0x00, 0x42, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Lima */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x8C, 0x74, 0x40, 0xD4, -0xC3, 0xCF, 0x4A, 0x50, 0xC4, 0x45, 0xE3, 0x40, 0xC5, 0x2F, 0x4A, 0xD0, 0xC6, 0x1F, 0x2D, 0xC0, -0xC7, 0x0F, 0x2C, 0xD0, 0xC7, 0xFF, 0x0F, 0xC0, 0x1E, 0x18, 0xC4, 0x50, 0x1E, 0x8F, 0x5D, 0x40, -0x1F, 0xF9, 0xF7, 0xD0, 0x20, 0x70, 0x90, 0xC0, 0x25, 0x9E, 0xE3, 0xD0, 0x26, 0x15, 0x7C, 0xC0, -0x2D, 0x25, 0x03, 0x50, 0x2D, 0x9B, 0x9C, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, -0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x53, -0x54, 0x00, 0x50, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Los_Angeles */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Louisville */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00, -0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70, -0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Maceio */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x68, 0x7C, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDE, 0x84, 0x00, 0x00, 0xFF, -0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, -0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Managua */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xBD, 0x2D, 0x48, 0xE8, -0x06, 0x43, 0x74, 0x60, 0x09, 0xA4, 0x3E, 0x50, 0x11, 0x51, 0xF8, 0xE0, 0x11, 0xD4, 0x6F, 0x50, -0x13, 0x31, 0xDA, 0xE0, 0x13, 0xB4, 0x51, 0x50, 0x29, 0x61, 0x91, 0x20, 0x2A, 0xC1, 0x4B, 0x50, -0x2B, 0x44, 0x16, 0x20, 0x36, 0x63, 0x77, 0xD0, 0x42, 0x58, 0xC0, 0xE0, 0x43, 0x2C, 0xF4, 0x50, -0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x03, 0x01, 0xFF, 0xFF, 0xAF, -0x18, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, -0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4D, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, -0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Manaus */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Martinique */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xA3, 0xC8, 0x44, -0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x16, 0xB0, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC6, 0xBC, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x05, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x09, 0x46, 0x46, 0x4D, -0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* America/Mazatlan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C, -0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Mendoza */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40, -0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0, -0x41, 0x56, 0x3E, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Menominee */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0x06, 0x40, 0xDF, 0x70, -0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, -0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, -0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, -0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, -0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, -0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, -0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, -0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, -0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, -0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, -0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, -0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, -0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, -0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, -0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, -0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, -0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, -0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, -0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, -0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, -0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, -0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, -0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, -0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, -0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, -0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, -0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, -0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Merida */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA5, 0xB6, 0xDA, 0x60, -0x16, 0x86, 0xD5, 0x60, 0x18, 0x4C, 0x4B, 0x50, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0xFF, -0xFF, 0xAB, 0xFC, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Mexico_City */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0, -0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0, -0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80, -0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, -0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, -0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, -0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, -0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, -0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, -0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, -0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, -0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, -0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, -0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, -0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, -0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, -0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, -0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, -0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, -0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Miquelon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x91, 0xB6, 0x38, 0xA8, -0x13, 0x6E, 0x63, 0xC0, 0x20, 0x75, 0xE4, 0xD0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xC6, 0xD0, -0x23, 0x6A, 0x93, 0xC0, 0x24, 0x35, 0xA8, 0xD0, 0x25, 0x4A, 0x75, 0xC0, 0x26, 0x15, 0x8A, 0xD0, -0x27, 0x2A, 0x57, 0xC0, 0x27, 0xFE, 0xA7, 0x50, 0x29, 0x0A, 0x39, 0xC0, 0x29, 0xDE, 0x89, 0x50, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xD3, 0x38, 0x40, 0x2D, 0x9E, 0x4D, 0x50, -0x2E, 0xB3, 0x1A, 0x40, 0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x92, 0xFC, 0x40, 0x31, 0x67, 0x4B, 0xD0, -0x32, 0x72, 0xDE, 0x40, 0x33, 0x47, 0x2D, 0xD0, 0x34, 0x52, 0xC0, 0x40, 0x35, 0x27, 0x0F, 0xD0, -0x36, 0x32, 0xA2, 0x40, 0x37, 0x06, 0xF1, 0xD0, 0x38, 0x1B, 0xBE, 0xC0, 0x38, 0xE6, 0xD3, 0xD0, -0x39, 0xFB, 0xA0, 0xC0, 0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x82, 0xC0, 0x3C, 0xAF, 0xD2, 0x50, -0x3D, 0xBB, 0x64, 0xC0, 0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x46, 0xC0, 0x40, 0x6F, 0x96, 0x50, -0x41, 0x84, 0x63, 0x40, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, 0x44, 0x2F, 0x5A, 0x50, -0x45, 0x44, 0x27, 0x40, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x09, 0x40, 0x47, 0xF8, 0x58, 0xD0, -0x49, 0x03, 0xEB, 0x40, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xCD, 0x40, 0x4B, 0xB8, 0x1C, 0xD0, -0x4C, 0xCC, 0xE9, 0xC0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xCB, 0xC0, 0x4F, 0x77, 0xE0, 0xD0, -0x50, 0x8C, 0xAD, 0xC0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x8F, 0xC0, 0x53, 0x40, 0xDF, 0x50, -0x54, 0x4C, 0x71, 0xC0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x53, 0xC0, 0x57, 0x00, 0xA3, 0x50, -0x58, 0x15, 0x70, 0x40, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x52, 0x40, 0x5A, 0xC0, 0x67, 0x50, -0x5B, 0xD5, 0x34, 0x40, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x16, 0x40, 0x5E, 0x89, 0x65, 0xD0, -0x5F, 0x94, 0xF8, 0x40, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x14, 0xC0, 0x62, 0x49, 0x29, 0xD0, -0x63, 0x5D, 0xF6, 0xC0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xD8, 0xC0, 0x66, 0x12, 0x28, 0x50, -0x67, 0x1D, 0xBA, 0xC0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0x9C, 0xC0, 0x69, 0xD1, 0xEC, 0x50, -0x6A, 0xDD, 0x7E, 0xC0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0x9B, 0x40, 0x6D, 0x91, 0xB0, 0x50, -0x6E, 0xA6, 0x7D, 0x40, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x5F, 0x40, 0x71, 0x5A, 0xAE, 0xD0, -0x72, 0x66, 0x41, 0x40, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x23, 0x40, 0x75, 0x1A, 0x72, 0xD0, -0x76, 0x2F, 0x3F, 0xC0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x21, 0xC0, 0x78, 0xDA, 0x36, 0xD0, -0x79, 0xEF, 0x03, 0xC0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xE5, 0xC0, 0x7C, 0xA3, 0x35, 0x50, -0x7D, 0xAE, 0xC7, 0xC0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xA9, 0xC0, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCB, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Monterrey */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA5, 0xB6, 0xDA, 0x60, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, -0xFF, 0xA1, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* America/Montevideo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0xA2, 0x92, 0x87, 0xAC, -0xA9, 0x01, 0x25, 0xB8, 0xA9, 0xF1, 0x0F, 0xB0, 0xAA, 0xE2, 0x59, 0x38, 0xAB, 0xD2, 0x43, 0x30, -0xAC, 0xC3, 0x8C, 0xB8, 0xAD, 0xB3, 0x76, 0xB0, 0xBB, 0xF4, 0xB5, 0xB8, 0xBC, 0xBF, 0xB5, 0xB0, -0xBD, 0xD4, 0x97, 0xB8, 0xBE, 0x9F, 0x97, 0xB0, 0xBF, 0xB4, 0x79, 0xB8, 0xC0, 0x7F, 0x79, 0xB0, -0xC1, 0x9D, 0x96, 0x38, 0xC2, 0x5F, 0x5B, 0xB0, 0xC3, 0x7D, 0x78, 0x38, 0xC4, 0x3F, 0x3D, 0xB0, -0xC5, 0x5D, 0x5A, 0x38, 0xC6, 0x1F, 0x1F, 0xB0, 0xC7, 0x3D, 0x3C, 0x38, 0xC8, 0x08, 0x3C, 0x30, -0xC9, 0x1D, 0x1E, 0x38, 0xC9, 0xE8, 0x1E, 0x30, 0xCB, 0x55, 0x54, 0xB8, 0xCD, 0x1E, 0xC6, 0x30, -0xCD, 0x95, 0x5F, 0x20, 0xEC, 0x0B, 0x85, 0xB0, 0xEC, 0xF2, 0x2E, 0x20, 0xED, 0x45, 0x4A, 0xB0, -0xED, 0x85, 0xD6, 0x20, 0xF7, 0x13, 0x72, 0xB0, 0xF7, 0xFA, 0x1B, 0x20, 0xF8, 0xF3, 0x54, 0xB0, -0xFA, 0x09, 0x73, 0x20, 0xFA, 0xD3, 0x36, 0xB0, 0xFB, 0xEA, 0xA6, 0xA0, 0xFC, 0xFE, 0x3E, 0x30, -0xFD, 0xF7, 0x62, 0xA8, 0xFE, 0xDF, 0x71, 0xB0, 0xFF, 0xD8, 0x96, 0x28, 0x00, 0xC0, 0xA5, 0x30, -0x01, 0xB9, 0xC9, 0xA8, 0x04, 0x58, 0xDC, 0x30, 0x04, 0xED, 0xC7, 0xA0, 0x07, 0xDF, 0xEF, 0xB0, -0x09, 0x5A, 0x47, 0x28, 0x0C, 0xB1, 0xDD, 0xA0, 0x0E, 0xE7, 0x7F, 0x30, 0x0F, 0x83, 0x02, 0x20, -0x12, 0x55, 0x86, 0x30, 0x13, 0x6E, 0x47, 0xA0, 0x21, 0xC3, 0x54, 0x30, 0x22, 0x3B, 0x3E, 0xA0, -0x23, 0xA1, 0xE4, 0xB0, 0x24, 0x19, 0xCF, 0x20, 0x25, 0x4A, 0x67, 0xB0, 0x25, 0xF0, 0x76, 0xA0, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xD0, 0x58, 0xA0, 0x29, 0x0A, 0x2B, 0xB0, 0x29, 0xB0, 0x3A, 0xA0, -0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x90, 0x1C, 0xA0, 0x41, 0x4C, 0xF6, 0x30, 0x42, 0x46, 0x2F, 0xC0, -0x43, 0x48, 0xA3, 0xD0, 0x44, 0x13, 0x9C, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x04, 0x06, 0x04, -0x06, 0x04, 0x05, 0x04, 0x06, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xCB, 0x54, 0x00, -0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xCE, -0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0A, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0E, 0xFF, -0xFF, 0xDC, 0xD8, 0x01, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x55, 0x59, 0x48, 0x53, 0x54, 0x00, 0x55, -0x59, 0x54, 0x00, 0x55, 0x59, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Montreal */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9C, 0xBD, 0x01, 0xF0, -0x9C, 0xE4, 0x64, 0xC0, 0x9E, 0xB8, 0x93, 0x70, 0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x58, 0xF8, -0xA1, 0x99, 0x82, 0xE8, 0xA2, 0x94, 0x0D, 0xF8, 0xA3, 0x5F, 0x06, 0xE8, 0xA4, 0x73, 0xE8, 0xF0, -0xA5, 0x3E, 0xE8, 0xE8, 0xA6, 0x53, 0xCA, 0xF0, 0xA7, 0x1E, 0xCA, 0xE8, 0xAA, 0x2D, 0xEC, 0xF0, -0xAA, 0xDE, 0x8E, 0xE8, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xBE, 0x70, 0xE8, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x9E, 0x52, 0xE8, 0xAF, 0xBC, 0x53, 0x50, 0xB0, 0x7E, 0x11, 0xC0, 0xB1, 0x9C, 0x35, 0x50, -0xB2, 0x67, 0x2E, 0x40, 0xB3, 0x7C, 0x17, 0x50, 0xB4, 0x47, 0x10, 0x40, 0xB5, 0x5B, 0xF9, 0x50, -0xB6, 0x26, 0xF2, 0x40, 0xB7, 0x3B, 0xDB, 0x50, 0xB8, 0x06, 0xD4, 0x40, 0xB9, 0x24, 0xF7, 0xD0, -0xB9, 0xE6, 0xB6, 0x40, 0xBB, 0x04, 0xD9, 0xD0, 0xBB, 0xCF, 0xD2, 0xC0, 0xBC, 0xE4, 0xBB, 0xD0, -0xBD, 0xAF, 0xB4, 0xC0, 0xBE, 0xC4, 0x9D, 0xD0, 0xBF, 0x8F, 0x96, 0xC0, 0xC0, 0xA4, 0x7F, 0xD0, -0xC1, 0x6F, 0x78, 0xC0, 0xC2, 0x84, 0x61, 0xD0, 0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x64, 0x43, 0xD0, -0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x4D, 0x60, 0x50, 0xC7, 0x0F, 0x1E, 0xC0, 0xC8, 0x2D, 0x42, 0x50, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, -0xD8, 0x00, 0xA1, 0xE0, 0xD9, 0x15, 0x8A, 0xF0, 0xDA, 0x0E, 0xA8, 0x60, 0xDA, 0xFE, 0xA7, 0x70, -0xDB, 0xEE, 0x8A, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, -0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, -0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, -0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, -0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, -0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, -0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, -0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, -0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, -0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, -0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, -0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, -0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, -0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, -0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, -0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, - -/* America/Montserrat */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x35, 0x10, -0x01, 0xFF, 0xFF, 0xC5, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Nassau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x42, 0x84, -0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, -0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, -0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, -0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, -0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, -0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, -0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, -0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, -0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, -0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, -0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, -0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, -0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, -0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, -0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, -0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, -0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/New_York */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70, -0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0, -0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0, -0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0, -0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0, -0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, -0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0, -0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60, -0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60, -0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0, -0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0, -0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60, -0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60, -0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, -0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, -0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, -0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, -0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x01, - -/* America/Nipigon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xC8, 0xF8, 0x49, 0x50, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xFB, 0xE0, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, -0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, -0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, -0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, -0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, -0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, -0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, -0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, -0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, -0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, -0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, -0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, -0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, -0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, -0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, -0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, -0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, -0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, -0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, -0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, -0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, -0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, -0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, -0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, -0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, -0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, -0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, -0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, -0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, -0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, -0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, -0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, -0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, -0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Nome */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x18, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1D, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, -0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Noronha */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64, -0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10, -0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10, -0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10, -0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90, -0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90, -0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90, -0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90, -0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10, -0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90, -0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/North_Dakota/Center */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Panama */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x8B, 0xF4, 0x61, 0xE8, -0x01, 0xFF, 0xFF, 0xB5, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Pangnirtung */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x25, 0x9E, 0xB8, 0x85, 0x60, -0x9F, 0xBA, 0xDD, 0x50, 0xA0, 0xCF, 0xC6, 0x60, 0xA1, 0xA2, 0x8C, 0x30, 0xCB, 0x88, 0xE2, 0x60, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xF7, 0x2F, 0x30, 0x40, 0xF8, 0x28, 0x5B, 0xC0, -0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, -0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, -0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, -0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, -0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, -0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, -0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, -0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, -0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, -0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, -0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, -0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, -0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, -0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, -0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, -0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, -0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, -0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, -0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, -0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, -0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, -0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, -0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x07, 0x08, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, -0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x15, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x19, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x1D, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x21, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, -0x50, 0x54, 0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, -0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Paramaribo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x91, 0x05, 0x8E, 0xB8, -0xBE, 0x2A, 0x4B, 0xC4, 0xD2, 0x62, 0x2C, 0xB4, 0x0B, 0x11, 0x58, 0xB8, 0x1B, 0xBE, 0x31, 0xB8, -0x01, 0x02, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xCC, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xCC, 0x3C, 0x00, -0x04, 0xFF, 0xFF, 0xCC, 0x4C, 0x00, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x08, 0xFF, 0xFF, 0xCE, -0xC8, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4D, 0x54, -0x00, 0x4E, 0x45, 0x47, 0x54, 0x00, 0x53, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Phoenix */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Port-au-Prince */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9C, 0x6E, 0x71, 0xFC, -0x19, 0x1B, 0x46, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40, -0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40, -0x20, 0x91, 0x94, 0x50, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xDC, 0x60, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, -0x02, 0xFF, 0xFF, 0xBC, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, -0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x50, -0x50, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Porto_Acre */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0, -0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Port_of_Spain */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, -0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Porto_Velho */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x82, 0xE8, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC4, -0x18, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Puerto_Rico */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xCB, 0xF6, 0x32, 0xC0, -0xD2, 0x60, 0xED, 0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, -0x01, 0x04, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Rainy_River */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xA1, 0x80, -0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x09, 0xF0, 0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, -0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, -0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, -0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, -0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, -0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, -0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, -0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, -0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, -0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, -0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, -0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, -0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, -0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, -0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, -0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, -0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, -0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, -0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, -0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, -0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, -0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, -0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, -0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, -0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, -0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, -0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, -0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, -0x7F, 0x8E, 0xD3, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Rankin_Inlet */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0x9E, 0xB8, 0xA1, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0xCF, 0xE2, 0x80, 0xA1, 0xA2, 0xA8, 0x50, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x77, 0xE0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, -0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, -0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, -0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, -0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, -0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, -0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, -0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, -0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, -0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, -0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, -0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, -0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, -0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, -0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, -0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, -0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x15, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, -0x00, 0x43, 0x44, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/Recife */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x67, 0xB8, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xE9, 0x0F, 0xA0, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xDF, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* America/Regina */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Rio_Branco */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0, -0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* America/Rosario */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Santiago */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC0, -0x9F, 0x71, 0x09, 0x50, 0xA1, 0x01, 0xC3, 0x40, 0xB0, 0x5E, 0x7B, 0xD0, 0xB1, 0x77, 0x3D, 0x40, -0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, 0xB5, 0x39, 0xA4, 0x40, -0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, 0xB8, 0xFD, 0x5C, 0xC0, -0xB9, 0xC7, 0x20, 0x50, 0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, -0xFC, 0x97, 0x69, 0x30, 0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, -0x00, 0x60, 0x67, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, -0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, -0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, -0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, -0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, -0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, -0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, -0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, -0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, -0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, -0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, -0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, -0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, -0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, -0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, -0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, -0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, -0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, -0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, -0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, -0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, -0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, -0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, -0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, -0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, -0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, -0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, -0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, -0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, -0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, -0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, -0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, -0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, -0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xBD, -0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, -0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x09, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* America/Santo_Domingo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xBA, 0xDF, 0x42, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xA7, 0xC3, 0x40, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x43, 0x7B, 0xC8, -0x01, 0x87, 0xD3, 0xD0, 0x01, 0xFA, 0x7F, 0x48, 0x03, 0x70, 0xF0, 0x50, 0x03, 0xDD, 0x04, 0x48, -0x05, 0x50, 0xD2, 0x50, 0x05, 0xBF, 0x89, 0x48, 0x07, 0x30, 0xB4, 0x50, 0x07, 0xA0, 0xBC, 0xC8, -0x09, 0x10, 0x96, 0x50, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0x29, 0xE1, 0x60, 0x02, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xBE, 0x60, -0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, -0xC0, 0xB8, 0x01, 0x0D, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x53, 0x44, 0x4D, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x48, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Sao_Paulo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0, -0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20, -0x45, 0x31, 0xA4, 0x30, 0x45, 0xD7, 0xB3, 0x20, 0x47, 0x1A, 0xC0, 0xB0, 0x47, 0xB7, 0x95, 0x20, -0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0, -0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x40, 0x57, 0xA0, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xDF, 0xFD, 0xA0, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xF1, 0x82, 0xA0, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x91, 0x28, 0xA0, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xA2, 0xAD, 0xA0, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x42, 0x53, 0xA0, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C, -0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* America/Scoresbysund */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x4C, 0x5C, -0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x24, 0xC0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x03, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xEB, 0x24, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1, -0xF0, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x4C, -0x4D, 0x54, 0x00, 0x43, 0x47, 0x54, 0x00, 0x43, 0x47, 0x53, 0x54, 0x00, 0x45, 0x47, 0x54, 0x00, -0x45, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, - -/* America/Shiprock */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/St_Johns */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C, -0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC, -0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C, -0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC, -0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC, -0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC, -0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C, -0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C, -0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC, -0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C, -0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8, -0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8, -0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8, -0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58, -0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58, -0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58, -0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8, -0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8, -0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8, -0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58, -0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4, -0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4, -0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74, -0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74, -0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74, -0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4, -0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4, -0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4, -0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74, -0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74, -0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x46, 0x0F, 0x27, 0x74, -0x47, 0x23, 0xF4, 0x64, 0x47, 0xF8, 0x43, 0xF4, 0x49, 0x03, 0xD6, 0x64, 0x49, 0xD8, 0x25, 0xF4, -0x4A, 0xE3, 0xB8, 0x64, 0x4B, 0xB8, 0x07, 0xF4, 0x4C, 0xCC, 0xD4, 0xE4, 0x4D, 0x97, 0xE9, 0xF4, -0x4E, 0xAC, 0xB6, 0xE4, 0x4F, 0x77, 0xCB, 0xF4, 0x50, 0x8C, 0x98, 0xE4, 0x51, 0x60, 0xE8, 0x74, -0x52, 0x6C, 0x7A, 0xE4, 0x53, 0x40, 0xCA, 0x74, 0x54, 0x4C, 0x5C, 0xE4, 0x55, 0x20, 0xAC, 0x74, -0x56, 0x2C, 0x3E, 0xE4, 0x57, 0x00, 0x8E, 0x74, 0x58, 0x15, 0x5B, 0x64, 0x58, 0xE0, 0x70, 0x74, -0x59, 0xF5, 0x3D, 0x64, 0x5A, 0xC0, 0x52, 0x74, 0x5B, 0xD5, 0x1F, 0x64, 0x5C, 0xA9, 0x6E, 0xF4, -0x5D, 0xB5, 0x01, 0x64, 0x5E, 0x89, 0x50, 0xF4, 0x5F, 0x94, 0xE3, 0x64, 0x60, 0x69, 0x32, 0xF4, -0x61, 0x7D, 0xFF, 0xE4, 0x62, 0x49, 0x14, 0xF4, 0x63, 0x5D, 0xE1, 0xE4, 0x64, 0x28, 0xF6, 0xF4, -0x65, 0x3D, 0xC3, 0xE4, 0x66, 0x12, 0x13, 0x74, 0x67, 0x1D, 0xA5, 0xE4, 0x67, 0xF1, 0xF5, 0x74, -0x68, 0xFD, 0x87, 0xE4, 0x69, 0xD1, 0xD7, 0x74, 0x6A, 0xDD, 0x69, 0xE4, 0x6B, 0xB1, 0xB9, 0x74, -0x6C, 0xC6, 0x86, 0x64, 0x6D, 0x91, 0x9B, 0x74, 0x6E, 0xA6, 0x68, 0x64, 0x6F, 0x71, 0x7D, 0x74, -0x70, 0x86, 0x4A, 0x64, 0x71, 0x5A, 0x99, 0xF4, 0x72, 0x66, 0x2C, 0x64, 0x73, 0x3A, 0x7B, 0xF4, -0x74, 0x46, 0x0E, 0x64, 0x75, 0x1A, 0x5D, 0xF4, 0x76, 0x2F, 0x2A, 0xE4, 0x76, 0xFA, 0x3F, 0xF4, -0x78, 0x0F, 0x0C, 0xE4, 0x78, 0xDA, 0x21, 0xF4, 0x79, 0xEE, 0xEE, 0xE4, 0x7A, 0xBA, 0x03, 0xF4, -0x7B, 0xCE, 0xD0, 0xE4, 0x7C, 0xA3, 0x20, 0x74, 0x7D, 0xAE, 0xB2, 0xE4, 0x7E, 0x83, 0x02, 0x74, -0x7F, 0x8E, 0x94, 0xE4, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF, -0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08, -0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00, -0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* America/St_Kitts */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x34, 0xCC, -0x01, 0xFF, 0xFF, 0xC5, 0x34, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Lucia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Thomas */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Vincent */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xE8, -0x01, 0xFF, 0xFF, 0xC6, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4B, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Swift_Current */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x96, 0x18, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x76, 0x01, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xE8, 0x27, 0x2C, 0x10, 0xE9, 0x17, 0x0F, 0x00, 0xEB, 0xE6, 0xF0, 0x10, -0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, 0xEE, 0x91, 0xCB, 0x00, 0xEF, 0xAF, 0xEE, 0x90, -0xF0, 0x71, 0xAD, 0x00, 0x04, 0x61, 0x19, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, -0xFF, 0x9A, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, -0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, -0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Tegucigalpa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA4, 0x4C, 0x4B, 0x44, -0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50, -0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAE, 0x3C, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Thule */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9B, 0x80, 0x77, 0xFC, -0x27, 0xF5, 0x7A, 0xE0, 0x28, 0xE5, 0x5D, 0xD0, 0x29, 0xD5, 0x5C, 0xE0, 0x2A, 0xC5, 0x3F, 0xD0, -0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, -0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50, -0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50, -0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50, -0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, -0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0, 0x49, 0x03, 0xF9, 0x50, -0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0, 0x4C, 0xCC, 0xF7, 0xD0, -0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0, 0x50, 0x8C, 0xBB, 0xD0, -0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60, 0x54, 0x4C, 0x7F, 0xD0, -0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60, 0x58, 0x15, 0x7E, 0x50, -0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60, 0x5B, 0xD5, 0x42, 0x50, -0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0, 0x5F, 0x95, 0x06, 0x50, -0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0, 0x63, 0x5E, 0x04, 0xD0, -0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60, 0x67, 0x1D, 0xC8, 0xD0, -0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60, 0x6A, 0xDD, 0x8C, 0xD0, -0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60, 0x6E, 0xA6, 0x8B, 0x50, -0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0, 0x72, 0x66, 0x4F, 0x50, -0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0, 0x76, 0x2F, 0x4D, 0xD0, -0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0, 0x79, 0xEF, 0x11, 0xD0, -0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60, 0x7D, 0xAE, 0xD5, 0xD0, -0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x84, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Thunder_Bay */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x8F, 0x24, 0x7B, 0xE0, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, -0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, -0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, -0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, -0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, -0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, -0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, -0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, -0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, -0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, -0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, -0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, -0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, -0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, -0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, -0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, -0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, -0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, -0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, -0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, -0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, -0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, -0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, -0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, -0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, -0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, -0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, -0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, -0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, -0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, -0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, -0x7F, 0x8E, 0xC5, 0xE0, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0x43, 0x53, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* America/Tijuana */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00, -0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, -0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, -0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, -0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0, -0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20, -0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20, -0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, -0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, -0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, -0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, -0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, -0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, -0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, -0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, -0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, -0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, -0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, -0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, -0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, -0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, -0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, -0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, -0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, -0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, -0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, -0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, -0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, -0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, -0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, -0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, -0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, -0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, -0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, -0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, -0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02, -0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80, -0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Toronto */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0, -0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0, -0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70, -0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0, -0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70, -0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, -0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, -0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, -0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, -0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, -0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, -0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, -0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, -0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, -0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, -0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, -0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, -0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, -0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, -0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, -0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, - -/* America/Tortola */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x14, -0x01, 0xFF, 0xFF, 0xC3, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Vancouver */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, -0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, -0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, -0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, -0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, -0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, -0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, -0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, -0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, -0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, -0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, -0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, -0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, -0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, -0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, -0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, -0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, -0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, -0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* America/Virgin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Whitehorse */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, -0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, -0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, -0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, -0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, -0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, -0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, -0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, -0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, -0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, -0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, -0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, -0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, -0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, -0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, -0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, -0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - -/* America/Winnipeg */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0, -0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80, -0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xE2, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x00, - -/* America/Yakutat */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1A, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xFE, 0xB8, 0x55, 0x30, 0xFF, 0xA8, 0x38, 0x20, -0x00, 0x98, 0x37, 0x30, 0x01, 0x88, 0x1A, 0x20, 0x02, 0x78, 0x19, 0x30, 0x03, 0x71, 0x36, 0xA0, -0x04, 0x61, 0x35, 0xB0, 0x05, 0x51, 0x18, 0xA0, 0x06, 0x41, 0x17, 0xB0, 0x07, 0x30, 0xFA, 0xA0, -0x07, 0x8D, 0x51, 0xB0, 0x09, 0x10, 0xDC, 0xA0, 0x09, 0xAD, 0xCD, 0x30, 0x0A, 0xF0, 0xBE, 0xA0, -0x0B, 0xE0, 0xBD, 0xB0, 0x0C, 0xD9, 0xDB, 0x20, 0x0D, 0xC0, 0x9F, 0xB0, 0x0E, 0xB9, 0xBD, 0x20, -0x0F, 0xA9, 0xBC, 0x30, 0x10, 0x99, 0x9F, 0x20, 0x11, 0x89, 0x9E, 0x30, 0x12, 0x79, 0x81, 0x20, -0x13, 0x69, 0x80, 0x30, 0x14, 0x59, 0x63, 0x20, 0x15, 0x49, 0x62, 0x30, 0x16, 0x39, 0x45, 0x20, -0x17, 0x29, 0x44, 0x30, 0x18, 0x22, 0x61, 0xA0, 0x19, 0x09, 0x26, 0x30, 0x1A, 0x02, 0x43, 0xA0, -0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0, -0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30, -0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30, -0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0, -0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0, -0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0, -0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30, -0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30, -0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30, -0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0, -0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0, -0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30, -0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30, -0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0, -0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0, -0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0, -0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30, -0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30, -0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0, -0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0, -0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0, -0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30, -0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30, -0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30, -0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0, -0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0, -0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0, -0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x10, -0xFF, 0xFF, 0x81, 0x70, 0x00, 0x15, 0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, -0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - -/* America/Yellowknife */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x9E, 0xB8, 0xAF, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0xCF, 0xF0, 0x90, 0xA1, 0xA2, 0xB6, 0x60, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x85, 0xF0, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0x4D, 0x44, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* Antarctica/Casey */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xFE, 0x1E, 0xCC, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/Davis */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0x9C, 0x40, 0x00, -0xF6, 0x47, 0xDF, 0x10, 0xFE, 0x47, 0xAB, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x7A, 0x7A, 0x7A, 0x00, 0x44, 0x41, 0x56, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Antarctica/DumontDUrville */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0xBC, 0x76, 0x80, -0xDE, 0x34, 0x60, 0x60, 0xE7, 0x3C, 0x02, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x08, 0x7A, 0x7A, 0x7A, -0x00, 0x50, 0x4D, 0x54, 0x00, 0x44, 0x44, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Antarctica/Mawson */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE2, 0x20, 0x32, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x4D, 0x41, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/McMurdo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, -0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, -0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, -0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, -0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, -0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, -0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, -0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, -0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, -0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, -0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, -0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, -0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, -0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, -0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, -0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/Palmer */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0xF6, 0x98, 0xAD, 0x00, -0xF6, 0xE6, 0x9F, 0xB0, 0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, -0xFA, 0xD1, 0xE5, 0x30, 0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, -0xFE, 0x9C, 0x35, 0x30, 0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, -0x08, 0xF4, 0xCA, 0xB0, 0x09, 0xE4, 0xAD, 0xA0, 0x0A, 0xD4, 0xAC, 0xB0, 0x0B, 0xC4, 0x8F, 0xA0, -0x0C, 0xB4, 0x8E, 0xB0, 0x0D, 0xA4, 0x71, 0xA0, 0x17, 0x30, 0xBC, 0xB0, 0x18, 0x06, 0x5D, 0xC0, -0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, -0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, -0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, -0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, -0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, -0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, -0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, -0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, -0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, -0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, -0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, 0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, -0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, -0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, -0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, -0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, -0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, -0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, -0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, -0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, -0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, -0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, -0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, -0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, -0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, -0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, -0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, -0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0D, 0xFF, -0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x7A, 0x7A, 0x7A, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, -0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/Rothera */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0x02, 0x2D, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x52, 0x4F, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/South_Pole */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, -0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, -0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, -0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, -0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, -0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, -0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, -0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, -0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, -0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, -0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, -0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, -0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, -0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, -0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, -0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/Syowa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0xB1, 0x58, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x53, 0x59, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Antarctica/Vostok */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE9, 0x58, 0x89, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x56, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Arctic/Longyearbyen */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Asia/Aden */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x38, 0x20, -0x01, 0x00, 0x00, 0x2A, 0x60, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Almaty */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x7B, 0xDC, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0x7F, 0x7C, 0xA0, 0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, -0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, -0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, -0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, -0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, -0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, -0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, -0x42, 0x35, 0xD1, 0x20, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x00, 0x00, 0x48, 0x24, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x4C, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Amman */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, -0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, -0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, -0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, -0x1C, 0xAD, 0xD5, 0x60, 0x1D, 0x9F, 0x09, 0xD0, 0x1E, 0x92, 0xFD, 0x60, 0x1F, 0x82, 0xE0, 0x50, -0x20, 0x72, 0xDF, 0x60, 0x21, 0x62, 0xC2, 0x50, 0x22, 0x52, 0xC1, 0x60, 0x23, 0x4B, 0xDE, 0xD0, -0x24, 0x64, 0xBC, 0x60, 0x25, 0x2B, 0xC0, 0xD0, 0x26, 0x37, 0x6F, 0x60, 0x27, 0x0B, 0xA2, 0xD0, -0x28, 0x0B, 0x73, 0xE0, 0x28, 0xE2, 0x4A, 0x50, 0x29, 0xE4, 0xBE, 0x60, 0x2A, 0xCB, 0x66, 0xD0, -0x2B, 0xBB, 0x65, 0xE0, 0x2C, 0xAB, 0x48, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x78, 0xB5, 0xD0, -0x2F, 0x84, 0x64, 0x60, 0x30, 0x58, 0xA5, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60, -0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60, -0x37, 0x7A, 0x93, 0x60, 0x37, 0xF2, 0x8B, 0xE0, 0x38, 0xE2, 0x7C, 0xE0, 0x39, 0xD2, 0x6D, 0xE0, -0x3A, 0xC2, 0x5E, 0xE0, 0x3B, 0xB2, 0x4F, 0xE0, 0x3C, 0xA2, 0x40, 0xE0, 0x3D, 0x92, 0x31, 0xE0, -0x3E, 0x82, 0x22, 0xE0, 0x3F, 0x72, 0x13, 0xE0, 0x40, 0x62, 0x04, 0xE0, 0x41, 0x5B, 0x30, 0x60, -0x42, 0x4B, 0x21, 0x60, 0x43, 0x3B, 0x12, 0x60, 0x44, 0x2B, 0x03, 0x60, 0x45, 0x1A, 0xF4, 0x60, -0x46, 0x0A, 0xE5, 0x60, 0x46, 0xFA, 0xD6, 0x60, 0x47, 0xEA, 0xC7, 0x60, 0x48, 0xDA, 0xB8, 0x60, -0x49, 0xCA, 0xA9, 0x60, 0x4A, 0xBA, 0x9A, 0x60, 0x4B, 0xAA, 0x8B, 0x60, 0x4C, 0xA3, 0xB6, 0xE0, -0x4D, 0x93, 0xA7, 0xE0, 0x4E, 0x83, 0x98, 0xE0, 0x4F, 0x73, 0x89, 0xE0, 0x50, 0x63, 0x7A, 0xE0, -0x51, 0x53, 0x6B, 0xE0, 0x52, 0x43, 0x5C, 0xE0, 0x53, 0x33, 0x4D, 0xE0, 0x54, 0x23, 0x3E, 0xE0, -0x55, 0x13, 0x2F, 0xE0, 0x56, 0x03, 0x20, 0xE0, 0x56, 0xFC, 0x4C, 0x60, 0x57, 0xEC, 0x3D, 0x60, -0x58, 0xDC, 0x2E, 0x60, 0x59, 0xCC, 0x1F, 0x60, 0x5A, 0xBC, 0x10, 0x60, 0x5B, 0xAC, 0x01, 0x60, -0x5C, 0x9B, 0xF2, 0x60, 0x5D, 0x8B, 0xE3, 0x60, 0x5E, 0x7B, 0xD4, 0x60, 0x5F, 0x6B, 0xC5, 0x60, -0x60, 0x5B, 0xB6, 0x60, 0x61, 0x54, 0xE1, 0xE0, 0x62, 0x44, 0xD2, 0xE0, 0x63, 0x34, 0xC3, 0xE0, -0x64, 0x24, 0xB4, 0xE0, 0x65, 0x14, 0xA5, 0xE0, 0x66, 0x04, 0x96, 0xE0, 0x66, 0xF4, 0x87, 0xE0, -0x67, 0xE4, 0x78, 0xE0, 0x68, 0xD4, 0x69, 0xE0, 0x69, 0xC4, 0x5A, 0xE0, 0x6A, 0xB4, 0x4B, 0xE0, -0x6B, 0xA4, 0x3C, 0xE0, 0x6C, 0x9D, 0x68, 0x60, 0x6D, 0x8D, 0x59, 0x60, 0x6E, 0x7D, 0x4A, 0x60, -0x6F, 0x6D, 0x3B, 0x60, 0x70, 0x5D, 0x2C, 0x60, 0x71, 0x4D, 0x1D, 0x60, 0x72, 0x3D, 0x0E, 0x60, -0x73, 0x2C, 0xFF, 0x60, 0x74, 0x1C, 0xF0, 0x60, 0x75, 0x0C, 0xE1, 0x60, 0x76, 0x06, 0x0C, 0xE0, -0x76, 0xF5, 0xFD, 0xE0, 0x77, 0xE5, 0xEE, 0xE0, 0x78, 0xD5, 0xDF, 0xE0, 0x79, 0xC5, 0xD0, 0xE0, -0x7A, 0xB5, 0xC1, 0xE0, 0x7B, 0xA5, 0xB2, 0xE0, 0x7C, 0x95, 0xA3, 0xE0, 0x7D, 0x85, 0x94, 0xE0, -0x7E, 0x75, 0x85, 0xE0, 0x7F, 0x65, 0x76, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, -0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Anadyr */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x1D, 0x9C, -0xB5, 0xA3, 0x8C, 0xC0, 0x15, 0x27, 0x1B, 0x30, 0x16, 0x18, 0x4F, 0xA0, 0x17, 0x08, 0x4E, 0xB0, -0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40, -0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60, -0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60, -0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60, -0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0, -0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0, -0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0, -0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60, -0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0, -0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0, -0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0, -0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60, -0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60, -0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60, -0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0, -0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0, -0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0, -0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60, -0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60, -0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0, -0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0, -0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0, -0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60, -0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60, -0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60, -0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0, -0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0, -0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0, -0x01, 0x03, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x04, 0x01, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0xA6, 0x64, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x04, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x09, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x04, 0x00, 0x00, 0xB6, -0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, -0x4E, 0x41, 0x54, 0x00, 0x41, 0x4E, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Aqtau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1F, 0xAA, 0x19, 0x94, 0xE0, -0xB5, 0xA3, 0xFD, 0x40, 0xF2, 0xD4, 0xAE, 0x30, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x05, 0x03, 0x05, 0x03, -0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x03, 0x09, -0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x09, 0x00, 0x00, 0x2F, 0x20, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, -0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00, -0x00, 0x46, 0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00, 0x00, 0x54, 0x60, 0x01, -0x14, 0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x00, 0x00, 0x54, 0x60, 0x01, 0x14, 0x00, 0x00, 0x46, -0x50, 0x00, 0x1A, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x1A, 0x00, -0x00, 0x38, 0x40, 0x00, 0x1A, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4F, 0x52, 0x54, 0x00, 0x53, 0x48, -0x45, 0x54, 0x00, 0x53, 0x48, 0x45, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53, 0x54, 0x00, 0x41, -0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* Asia/Aqtobe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x8E, 0x68, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xA0, 0xD0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, 0x35, 0x1D, 0x64, 0xD0, -0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x28, 0xD0, -0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x27, 0x50, -0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xEB, 0x50, -0x41, 0x84, 0x00, 0xD0, 0x42, 0x35, 0xDF, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, -0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x02, 0x08, -0x07, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, -0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x08, 0x00, 0x00, 0x35, 0x98, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, -0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, -0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x4B, 0x54, 0x54, 0x00, 0x41, 0x4B, 0x54, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53, -0x54, 0x00, 0x41, 0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ashgabat */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40, -0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, -0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, -0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, -0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Ashkhabad */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40, -0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, -0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, -0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, -0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Baghdad */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0x30, 0x3C, 0xE0, -0x17, 0x30, 0x68, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xE8, 0xBD, 0x50, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBD, 0xC8, 0x40, 0x1C, 0xAD, 0xC7, 0x50, 0x1D, 0x9C, 0x74, 0xE0, -0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, -0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, -0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x19, 0x60, 0x27, 0xF6, 0x78, 0x00, 0x28, 0xE7, 0xBA, 0x80, -0x29, 0xD8, 0xFD, 0x00, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xBA, 0x30, 0x80, 0x2C, 0xAB, 0x73, 0x00, -0x2D, 0x9B, 0x64, 0x00, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0x7C, 0x97, 0x80, 0x30, 0x6D, 0xDA, 0x00, -0x31, 0x5F, 0x1C, 0x80, 0x32, 0x50, 0x5F, 0x00, 0x33, 0x40, 0x50, 0x00, 0x34, 0x31, 0x92, 0x80, -0x35, 0x21, 0x83, 0x80, 0x36, 0x12, 0xC6, 0x00, 0x37, 0x02, 0xB7, 0x00, 0x37, 0xF3, 0xF9, 0x80, -0x38, 0xE5, 0x3C, 0x00, 0x39, 0xD6, 0x7E, 0x80, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0xB7, 0xB2, 0x00, -0x3C, 0xA7, 0xA3, 0x00, 0x3D, 0x98, 0xE5, 0x80, 0x3E, 0x88, 0xD6, 0x80, 0x3F, 0x7A, 0x19, 0x00, -0x40, 0x6B, 0x5B, 0x80, 0x41, 0x5C, 0x9E, 0x00, 0x42, 0x4C, 0x8F, 0x00, 0x43, 0x3D, 0xD1, 0x80, -0x44, 0x2D, 0xC2, 0x80, 0x45, 0x1F, 0x05, 0x00, 0x46, 0x0E, 0xF6, 0x00, 0x47, 0x00, 0x38, 0x80, -0x47, 0xF1, 0x7B, 0x00, 0x48, 0xE2, 0xBD, 0x80, 0x49, 0xD2, 0xAE, 0x80, 0x4A, 0xC3, 0xF1, 0x00, -0x4B, 0xB3, 0xE2, 0x00, 0x4C, 0xA5, 0x24, 0x80, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x86, 0x58, 0x00, -0x4F, 0x77, 0x9A, 0x80, 0x50, 0x68, 0xDD, 0x00, 0x51, 0x58, 0xCE, 0x00, 0x52, 0x4A, 0x10, 0x80, -0x53, 0x3A, 0x01, 0x80, 0x54, 0x2B, 0x44, 0x00, 0x55, 0x1B, 0x35, 0x00, 0x56, 0x0C, 0x77, 0x80, -0x56, 0xFD, 0xBA, 0x00, 0x57, 0xEE, 0xFC, 0x80, 0x58, 0xDE, 0xED, 0x80, 0x59, 0xD0, 0x30, 0x00, -0x5A, 0xC0, 0x21, 0x00, 0x5B, 0xB1, 0x63, 0x80, 0x5C, 0xA1, 0x54, 0x80, 0x5D, 0x92, 0x97, 0x00, -0x5E, 0x83, 0xD9, 0x80, 0x5F, 0x75, 0x1C, 0x00, 0x60, 0x65, 0x0D, 0x00, 0x61, 0x56, 0x4F, 0x80, -0x62, 0x46, 0x40, 0x80, 0x63, 0x37, 0x83, 0x00, 0x64, 0x27, 0x74, 0x00, 0x65, 0x18, 0xB6, 0x80, -0x66, 0x09, 0xF9, 0x00, 0x66, 0xFB, 0x3B, 0x80, 0x67, 0xEB, 0x2C, 0x80, 0x68, 0xDC, 0x6F, 0x00, -0x69, 0xCC, 0x60, 0x00, 0x6A, 0xBD, 0xA2, 0x80, 0x6B, 0xAD, 0x93, 0x80, 0x6C, 0x9E, 0xD6, 0x00, -0x6D, 0x90, 0x18, 0x80, 0x6E, 0x81, 0x5B, 0x00, 0x6F, 0x71, 0x4C, 0x00, 0x70, 0x62, 0x8E, 0x80, -0x71, 0x52, 0x7F, 0x80, 0x72, 0x43, 0xC2, 0x00, 0x73, 0x33, 0xB3, 0x00, 0x74, 0x24, 0xF5, 0x80, -0x75, 0x16, 0x38, 0x00, 0x76, 0x07, 0x7A, 0x80, 0x76, 0xF7, 0x6B, 0x80, 0x77, 0xE8, 0xAE, 0x00, -0x78, 0xD8, 0x9F, 0x00, 0x79, 0xC9, 0xE1, 0x80, 0x7A, 0xB9, 0xD2, 0x80, 0x7B, 0xAB, 0x15, 0x00, -0x7C, 0x9C, 0x57, 0x80, 0x7D, 0x8D, 0x9A, 0x00, 0x7E, 0x7D, 0x8B, 0x00, 0x7F, 0x6E, 0xCD, 0x80, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x00, 0x00, 0x29, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, -0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x42, -0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Bahrain */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9E, 0x14, -0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x2F, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Baku */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x95, 0x44, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xBD, 0x52, 0x40, 0x28, 0xE5, 0x09, 0x70, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x30, 0xE6, 0xEB, 0xC0, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x4F, 0xC0, -0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x4E, 0x40, -0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x12, 0x40, -0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xD6, 0x40, -0x40, 0x65, 0xEB, 0x50, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xD4, 0xC0, -0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0x98, 0xC0, -0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x5C, 0xC0, -0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x53, 0xD0, 0x4E, 0xAC, 0x5B, 0x40, -0x4F, 0x6E, 0x35, 0xD0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x52, 0x50, 0x52, 0x6C, 0x1F, 0x40, -0x53, 0x37, 0x34, 0x50, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x16, 0x50, 0x56, 0x2B, 0xE3, 0x40, -0x56, 0xF6, 0xF8, 0x50, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xDA, 0x50, 0x59, 0xF4, 0xE1, 0xC0, -0x5A, 0xB6, 0xBC, 0x50, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xD8, 0xD0, 0x5D, 0xB4, 0xA5, 0xC0, -0x5E, 0x7F, 0xBA, 0xD0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x9C, 0xD0, 0x61, 0x7D, 0xA4, 0x40, -0x62, 0x3F, 0x7E, 0xD0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x60, 0xD0, 0x65, 0x3D, 0x68, 0x40, -0x66, 0x08, 0x7D, 0x50, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x5F, 0x50, 0x68, 0xFD, 0x2C, 0x40, -0x69, 0xC8, 0x41, 0x50, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x23, 0x50, 0x6C, 0xC6, 0x2A, 0xC0, -0x6D, 0x88, 0x05, 0x50, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xE7, 0x50, 0x70, 0x85, 0xEE, 0xC0, -0x71, 0x51, 0x03, 0xD0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xE5, 0xD0, 0x74, 0x45, 0xB2, 0xC0, -0x75, 0x10, 0xC7, 0xD0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0xA9, 0xD0, 0x78, 0x0E, 0xB1, 0x40, -0x78, 0xD0, 0x8B, 0xD0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x6D, 0xD0, 0x7B, 0xCE, 0x75, 0x40, -0x7C, 0x99, 0x8A, 0x50, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x6C, 0x50, 0x7F, 0x8E, 0x39, 0x40, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0C, 0x0A, 0x0B, 0x09, 0x0C, -0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, -0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, -0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, -0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, -0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, -0x09, 0x00, 0x00, 0x2E, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, -0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, -0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x0F, 0x00, 0x00, 0x38, 0x40, 0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, -0x50, 0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x4C, -0x4D, 0x54, 0x00, 0x42, 0x41, 0x4B, 0x54, 0x00, 0x42, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x41, 0x5A, -0x54, 0x00, 0x41, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, - -/* Asia/Bangkok */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, -0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, -0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Beirut */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xA2, 0x65, 0x63, 0xE0, -0xA3, 0x7B, 0x82, 0x50, 0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, -0xA7, 0x27, 0x7F, 0xD0, 0xA8, 0x29, 0xF3, 0xE0, 0xA8, 0xEB, 0xB2, 0x50, 0xE8, 0x2A, 0x85, 0xE0, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xEC, 0xE0, -0xEC, 0xB6, 0x94, 0x50, 0xED, 0xCF, 0x71, 0xE0, 0xEE, 0x99, 0x19, 0x50, 0xEF, 0xB0, 0xA5, 0x60, -0xF0, 0x7A, 0x4C, 0xD0, 0x04, 0xA6, 0x5E, 0x60, 0x05, 0x2B, 0x77, 0xD0, 0x06, 0x43, 0x03, 0xE0, -0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, -0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xB1, 0x97, 0x50, 0x0D, 0xC9, 0x23, 0x60, -0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, 0x1A, 0xF4, 0x2E, 0xE0, -0x1B, 0xD1, 0x9C, 0xD0, 0x1C, 0xD5, 0x62, 0x60, 0x1D, 0xB2, 0xD0, 0x50, 0x1E, 0xB6, 0x95, 0xE0, -0x1F, 0x94, 0x03, 0xD0, 0x20, 0x97, 0xC9, 0x60, 0x21, 0x75, 0x37, 0x50, 0x22, 0xA3, 0x2C, 0xE0, -0x23, 0x57, 0xBC, 0x50, 0x24, 0x67, 0x5F, 0x60, 0x25, 0x38, 0xEF, 0xD0, 0x26, 0x3C, 0xB5, 0x60, -0x27, 0x1A, 0x23, 0x50, 0x28, 0x1D, 0xE8, 0xE0, 0x28, 0xFB, 0x56, 0xD0, 0x2A, 0x00, 0x6D, 0xE0, -0x2A, 0xCE, 0x09, 0xD0, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x4D, 0x91, 0xD0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x0D, 0x55, 0xD0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xE2, 0xD0, 0x44, 0x25, 0xBD, 0x60, -0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xA6, 0xD0, 0x47, 0xEE, 0xBB, 0xE0, -0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x6A, 0xD0, 0x4B, 0xAE, 0x7F, 0xE0, -0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x69, 0x50, 0x4F, 0x6E, 0x43, 0xE0, -0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x2D, 0x50, 0x53, 0x37, 0x42, 0x60, -0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xF1, 0x50, 0x56, 0xF7, 0x06, 0x60, -0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xEF, 0xD0, 0x5A, 0xB6, 0xCA, 0x60, -0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xB3, 0xD0, 0x5E, 0x7F, 0xC8, 0xE0, -0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xB2, 0x50, 0x62, 0x3F, 0x8C, 0xE0, -0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x76, 0x50, 0x66, 0x08, 0x8B, 0x60, -0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x3A, 0x50, 0x69, 0xC8, 0x4F, 0x60, -0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x38, 0xD0, 0x6D, 0x88, 0x13, 0x60, -0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x85, 0xFC, 0xD0, 0x71, 0x51, 0x11, 0xE0, -0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xC0, 0xD0, 0x75, 0x10, 0xD5, 0xE0, -0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xBF, 0x50, 0x78, 0xD0, 0x99, 0xE0, -0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x83, 0x50, 0x7C, 0x99, 0x98, 0x60, -0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x47, 0x50, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Bishkek */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x7E, 0x10, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBE, 0xA3, 0xC0, 0x29, 0xE7, 0x37, 0x30, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xC7, 0x19, 0x30, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0xA6, 0xFB, 0x30, -0x2E, 0x84, 0x69, 0x20, 0x2F, 0x86, 0xDD, 0x30, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x66, 0xBF, 0x30, -0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x89, 0xD8, 0x34, 0x52, 0x56, 0xC8, 0x35, 0x1D, 0x6B, 0xD8, -0x36, 0x32, 0x38, 0xC8, 0x36, 0xFD, 0x4D, 0xD8, 0x38, 0x1B, 0x55, 0x48, 0x38, 0xDD, 0x2F, 0xD8, -0x39, 0xFB, 0x37, 0x48, 0x3A, 0xBD, 0x11, 0xD8, 0x3B, 0xDB, 0x19, 0x48, 0x3C, 0xA6, 0x2E, 0x58, -0x3D, 0xBA, 0xFB, 0x48, 0x3E, 0x86, 0x10, 0x58, 0x3F, 0x9A, 0xDD, 0x48, 0x40, 0x65, 0xF2, 0x58, -0x41, 0x83, 0xF9, 0xC8, 0x42, 0x45, 0xD4, 0x58, 0x42, 0xFB, 0x92, 0x20, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x0A, -0x00, 0x00, 0x45, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, -0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, -0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x52, 0x55, 0x54, 0x00, 0x46, 0x52, 0x55, 0x53, 0x54, -0x00, 0x4B, 0x47, 0x53, 0x54, 0x00, 0x4B, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Brunei */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0xAD, 0x8A, 0x02, 0x44, -0xBA, 0x67, 0x47, 0x88, 0x01, 0x02, 0x00, 0x00, 0x6B, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4E, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Calcutta */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x09, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, -0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Choibalsan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x86, 0xD3, 0xE7, 0x28, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70, -0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90, -0x1F, 0x7C, 0x10, 0x90, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xF2, 0x90, 0x22, 0x4B, 0xE3, 0x90, -0x23, 0x3B, 0xD4, 0x90, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xB6, 0x90, 0x26, 0x0B, 0xA7, 0x90, -0x27, 0x04, 0xD3, 0x10, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xB5, 0x10, 0x29, 0xD4, 0xA6, 0x10, -0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x79, 0x10, 0x2D, 0x94, 0x6A, 0x10, -0x2E, 0x84, 0x5B, 0x10, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x3D, 0x10, 0x31, 0x5D, 0x68, 0x90, -0x32, 0x4D, 0x59, 0x90, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x2D, 0x3B, 0x90, 0x35, 0x1D, 0x2C, 0x90, -0x36, 0x0D, 0x1D, 0x90, 0x3A, 0xE9, 0xA5, 0x90, 0x3B, 0xB4, 0x9E, 0x80, 0x3C, 0xA4, 0x9D, 0x90, -0x3D, 0x94, 0x80, 0x80, 0x3E, 0x84, 0x7F, 0x90, 0x3F, 0x74, 0x62, 0x80, 0x40, 0x64, 0x61, 0x90, -0x41, 0x54, 0x44, 0x80, 0x42, 0x44, 0x43, 0x90, 0x43, 0x34, 0x26, 0x80, 0x44, 0x24, 0x25, 0x90, -0x45, 0x1D, 0x43, 0x00, 0x46, 0x0D, 0x42, 0x10, 0x46, 0xFD, 0x25, 0x00, 0x47, 0xED, 0x24, 0x10, -0x48, 0xDD, 0x07, 0x00, 0x49, 0xCD, 0x06, 0x10, 0x4A, 0xBC, 0xE9, 0x00, 0x4B, 0xAC, 0xE8, 0x10, -0x4C, 0x9C, 0xCB, 0x00, 0x4D, 0x8C, 0xCA, 0x10, 0x4E, 0x7C, 0xAD, 0x00, 0x4F, 0x75, 0xE6, 0x90, -0x50, 0x65, 0xC9, 0x80, 0x51, 0x55, 0xC8, 0x90, 0x52, 0x45, 0xAB, 0x80, 0x53, 0x35, 0xAA, 0x90, -0x54, 0x25, 0x8D, 0x80, 0x55, 0x15, 0x8C, 0x90, 0x56, 0x05, 0x6F, 0x80, 0x56, 0xF5, 0x6E, 0x90, -0x57, 0xE5, 0x51, 0x80, 0x58, 0xD5, 0x50, 0x90, 0x59, 0xCE, 0x6E, 0x00, 0x5A, 0xBE, 0x6D, 0x10, -0x5B, 0xAE, 0x50, 0x00, 0x5C, 0x9E, 0x4F, 0x10, 0x5D, 0x8E, 0x32, 0x00, 0x5E, 0x7E, 0x31, 0x10, -0x5F, 0x6E, 0x14, 0x00, 0x60, 0x5E, 0x13, 0x10, 0x61, 0x4D, 0xF6, 0x00, 0x62, 0x3D, 0xF5, 0x10, -0x63, 0x2D, 0xD8, 0x00, 0x64, 0x1D, 0xD7, 0x10, 0x65, 0x16, 0xF4, 0x80, 0x66, 0x06, 0xF3, 0x90, -0x66, 0xF6, 0xD6, 0x80, 0x67, 0xE6, 0xD5, 0x90, 0x68, 0xD6, 0xB8, 0x80, 0x69, 0xC6, 0xB7, 0x90, -0x6A, 0xB6, 0x9A, 0x80, 0x6B, 0xA6, 0x99, 0x90, 0x6C, 0x96, 0x7C, 0x80, 0x6D, 0x86, 0x7B, 0x90, -0x6E, 0x7F, 0x99, 0x00, 0x6F, 0x6F, 0x98, 0x10, 0x70, 0x5F, 0x7B, 0x00, 0x71, 0x4F, 0x7A, 0x10, -0x72, 0x3F, 0x5D, 0x00, 0x73, 0x2F, 0x5C, 0x10, 0x74, 0x1F, 0x3F, 0x00, 0x75, 0x0F, 0x3E, 0x10, -0x75, 0xFF, 0x21, 0x00, 0x76, 0xEF, 0x20, 0x10, 0x77, 0xDF, 0x03, 0x00, 0x78, 0xCF, 0x02, 0x10, -0x79, 0xC8, 0x1F, 0x80, 0x7A, 0xB8, 0x1E, 0x90, 0x7B, 0xA8, 0x01, 0x80, 0x7C, 0x98, 0x00, 0x90, -0x7D, 0x87, 0xE3, 0x80, 0x7E, 0x77, 0xE2, 0x90, 0x7F, 0x67, 0xC5, 0x80, 0x01, 0x02, 0x04, 0x03, -0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x6B, 0x58, 0x00, 0x00, 0x00, 0x00, -0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, -0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0E, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x8C, 0xA0, -0x01, 0x0E, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x54, 0x00, 0x43, 0x48, 0x4F, 0x54, 0x00, -0x43, 0x48, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Chongqing */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94, -0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F, -0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Chungking */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94, -0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F, -0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Colombo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x87, 0x9D, 0xBD, 0x1C, -0xCB, 0x5A, 0x1C, 0x28, 0xCC, 0x95, 0x2B, 0xA0, 0xD2, 0x75, 0x80, 0x38, 0x31, 0xA6, 0x00, 0x28, -0x32, 0x71, 0x00, 0x20, 0x01, 0x02, 0x03, 0x01, 0x04, 0x05, 0x00, 0x00, 0x4A, 0xE4, 0x00, 0x00, -0x00, 0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x08, 0x00, 0x00, 0x5B, 0x68, -0x01, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x0D, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x4D, 0x4D, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x48, 0x53, 0x54, 0x00, 0x4C, 0x4B, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dacca */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20, -0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, -0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, -0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Damascus */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA1, 0xF2, 0xAB, 0x78, -0xA2, 0x81, 0x2F, 0x80, 0xA3, 0x5E, 0x9D, 0x70, 0xA4, 0x61, 0x11, 0x80, 0xA5, 0x3E, 0x7F, 0x70, -0xA6, 0x40, 0xF3, 0x80, 0xA7, 0x1E, 0x61, 0x70, 0xA8, 0x20, 0xD5, 0x80, 0xA9, 0x07, 0x7D, 0xF0, -0xF1, 0x8F, 0x52, 0x00, 0xF2, 0x5B, 0x9C, 0x70, 0xF3, 0x73, 0x28, 0x80, 0xF4, 0x3B, 0x7E, 0x70, -0xF5, 0x55, 0xAD, 0x80, 0xF6, 0x1F, 0x54, 0xF0, 0xF7, 0x36, 0xE1, 0x00, 0xF7, 0xFF, 0x36, 0xF0, -0xF9, 0x0E, 0xDA, 0x00, 0xF9, 0xE1, 0xBB, 0xF0, 0xFA, 0xF9, 0x48, 0x00, 0xFB, 0xC2, 0xEF, 0x70, -0xFC, 0xDB, 0xCD, 0x00, 0xFD, 0xA5, 0x74, 0x70, 0xFE, 0xBD, 0x00, 0x80, 0xFF, 0x86, 0xA7, 0xF0, -0x00, 0x9E, 0x34, 0x00, 0x01, 0x67, 0xDB, 0x70, 0x02, 0x7F, 0x67, 0x80, 0x03, 0x49, 0x0E, 0xF0, -0x04, 0x61, 0xEC, 0x80, 0x05, 0x2B, 0x93, 0xF0, 0x06, 0x43, 0x20, 0x00, 0x07, 0x0C, 0xC7, 0x70, -0x08, 0x24, 0x53, 0x80, 0x08, 0xED, 0xFA, 0xF0, 0x0A, 0x05, 0x87, 0x00, 0x0A, 0xCF, 0x2E, 0x70, -0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0xB1, 0xB3, 0x70, 0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x6B, 0x59, 0xF0, -0x0F, 0xAA, 0x73, 0x00, 0x10, 0x4C, 0x8D, 0x70, 0x18, 0xF4, 0xC5, 0x00, 0x19, 0xDB, 0x6D, 0x70, -0x1A, 0xD7, 0x4A, 0x00, 0x1B, 0xBD, 0xF2, 0x70, 0x1E, 0x55, 0x23, 0x00, 0x1F, 0x8A, 0xE5, 0x70, -0x20, 0x47, 0x7A, 0x00, 0x21, 0x89, 0x19, 0xF0, 0x22, 0x3C, 0x74, 0x00, 0x23, 0x6B, 0x9E, 0xF0, -0x24, 0x32, 0xBF, 0x80, 0x25, 0x25, 0x45, 0x70, 0x26, 0x15, 0x44, 0x80, 0x27, 0x05, 0x27, 0x70, -0x27, 0xF6, 0x5B, 0xE0, 0x28, 0xE7, 0x90, 0x50, 0x29, 0xE2, 0x1B, 0x60, 0x2A, 0xCA, 0x15, 0x50, -0x2B, 0xB2, 0x2B, 0x60, 0x2C, 0xA3, 0x5F, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x8C, 0x7C, 0x50, -0x2F, 0x7C, 0x7B, 0x60, 0x30, 0x6D, 0xAF, 0xD0, 0x31, 0x5F, 0x00, 0x60, 0x32, 0x50, 0x34, 0xD0, -0x33, 0x3E, 0xE2, 0x60, 0x34, 0x31, 0x68, 0x50, 0x35, 0x1E, 0xC4, 0x60, 0x36, 0x12, 0x9B, 0xD0, -0x37, 0x02, 0x9A, 0xE0, 0x37, 0xF3, 0xCF, 0x50, 0x38, 0xE5, 0x1F, 0xE0, 0x39, 0xD6, 0x54, 0x50, -0x3A, 0xC6, 0x53, 0x60, 0x3B, 0xB7, 0x87, 0xD0, 0x3C, 0xA7, 0x86, 0xE0, 0x3D, 0x98, 0xBB, 0x50, -0x3E, 0x88, 0xBA, 0x60, 0x3F, 0x79, 0xEE, 0xD0, 0x40, 0x6B, 0x3F, 0x60, 0x41, 0x5C, 0x73, 0xD0, -0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3D, 0xA7, 0x50, 0x44, 0x2D, 0xA6, 0x60, 0x45, 0x1E, 0xDA, 0xD0, -0x46, 0x0E, 0xD9, 0xE0, 0x47, 0x00, 0x0E, 0x50, 0x47, 0xF1, 0x5E, 0xE0, 0x48, 0xE2, 0x93, 0x50, -0x49, 0xD2, 0x92, 0x60, 0x4A, 0xC3, 0xC6, 0xD0, 0x4B, 0xB3, 0xC5, 0xE0, 0x4C, 0xA4, 0xFA, 0x50, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0x86, 0x2D, 0xD0, 0x4F, 0x77, 0x7E, 0x60, 0x50, 0x68, 0xB2, 0xD0, -0x51, 0x58, 0xB1, 0xE0, 0x52, 0x49, 0xE6, 0x50, 0x53, 0x39, 0xE5, 0x60, 0x54, 0x2B, 0x19, 0xD0, -0x55, 0x1B, 0x18, 0xE0, 0x56, 0x0C, 0x4D, 0x50, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xEE, 0xD2, 0x50, -0x58, 0xDE, 0xD1, 0x60, 0x59, 0xD0, 0x05, 0xD0, 0x5A, 0xC0, 0x04, 0xE0, 0x5B, 0xB1, 0x39, 0x50, -0x5C, 0xA1, 0x38, 0x60, 0x5D, 0x92, 0x6C, 0xD0, 0x5E, 0x83, 0xBD, 0x60, 0x5F, 0x74, 0xF1, 0xD0, -0x60, 0x64, 0xF0, 0xE0, 0x61, 0x56, 0x25, 0x50, 0x62, 0x46, 0x24, 0x60, 0x63, 0x37, 0x58, 0xD0, -0x64, 0x27, 0x57, 0xE0, 0x65, 0x18, 0x8C, 0x50, 0x66, 0x09, 0xDC, 0xE0, 0x66, 0xFB, 0x11, 0x50, -0x67, 0xEB, 0x10, 0x60, 0x68, 0xDC, 0x44, 0xD0, 0x69, 0xCC, 0x43, 0xE0, 0x6A, 0xBD, 0x78, 0x50, -0x6B, 0xAD, 0x77, 0x60, 0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0x8F, 0xFC, 0x60, 0x6E, 0x81, 0x30, 0xD0, -0x6F, 0x71, 0x2F, 0xE0, 0x70, 0x62, 0x64, 0x50, 0x71, 0x52, 0x63, 0x60, 0x72, 0x43, 0x97, 0xD0, -0x73, 0x33, 0x96, 0xE0, 0x74, 0x24, 0xCB, 0x50, 0x75, 0x16, 0x1B, 0xE0, 0x76, 0x07, 0x50, 0x50, -0x76, 0xF7, 0x4F, 0x60, 0x77, 0xE8, 0x83, 0xD0, 0x78, 0xD8, 0x82, 0xE0, 0x79, 0xC9, 0xB7, 0x50, -0x7A, 0xB9, 0xB6, 0x60, 0x7B, 0xAA, 0xEA, 0xD0, 0x7C, 0x9C, 0x3B, 0x60, 0x7D, 0x8D, 0x6F, 0xD0, -0x7E, 0x7D, 0x6E, 0xE0, 0x7F, 0x6E, 0xA3, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, -0x00, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Dhaka */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20, -0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, -0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, -0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Dili */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x18, 0xC4, -0xCB, 0x99, 0x32, 0xF0, 0xD2, 0x11, 0x0E, 0xF0, 0x0B, 0xEA, 0x30, 0x70, 0x39, 0xC3, 0x99, 0x00, -0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x75, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, -0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, -0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dubai */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x99, 0xA8, -0x01, 0x00, 0x00, 0x33, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dushanbe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x83, 0x80, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xCA, 0x8F, 0x50, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, -0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, -0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x44, 0x55, 0x53, 0x54, 0x00, 0x44, 0x55, 0x53, -0x53, 0x54, 0x00, 0x54, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Gaza */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xC8, 0x59, 0xB2, 0xE0, -0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, 0xD3, 0x65, 0xB0, 0x80, -0xD4, 0x6B, 0xE0, 0xD0, 0xE8, 0x36, 0x63, 0x60, 0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, -0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, 0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, -0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, 0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, -0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, 0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, -0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, 0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, -0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, 0xFB, 0x27, 0x42, 0x50, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x30, 0xE7, 0x07, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60, -0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60, -0x36, 0x8B, 0xF3, 0xE0, 0x37, 0x16, 0x61, 0x60, 0x38, 0x06, 0x44, 0x50, 0x38, 0xFF, 0x7D, 0xE0, -0x39, 0xEF, 0x60, 0xD0, 0x3A, 0xDF, 0x5F, 0xE0, 0x3B, 0xCF, 0x42, 0xD0, 0x3C, 0xBF, 0x41, 0xE0, -0x3D, 0xAF, 0x24, 0xD0, 0x3E, 0x9F, 0x23, 0xE0, 0x3F, 0x8F, 0x06, 0xD0, 0x40, 0x7F, 0x05, 0xE0, -0x41, 0x6E, 0xE8, 0xD0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x58, 0x05, 0x50, 0x44, 0x48, 0x04, 0x60, -0x45, 0x37, 0xE7, 0x50, 0x46, 0x27, 0xE6, 0x60, 0x47, 0x17, 0xC9, 0x50, 0x48, 0x07, 0xC8, 0x60, -0x48, 0xF7, 0xAB, 0x50, 0x49, 0xE7, 0xAA, 0x60, 0x4A, 0xD7, 0x8D, 0x50, 0x4B, 0xC7, 0x8C, 0x60, -0x4C, 0xB7, 0x6F, 0x50, 0x4D, 0xA7, 0x6E, 0x60, 0x4E, 0xA0, 0x8B, 0xD0, 0x4F, 0x90, 0x8A, 0xE0, -0x50, 0x80, 0x6D, 0xD0, 0x51, 0x70, 0x6C, 0xE0, 0x52, 0x60, 0x4F, 0xD0, 0x53, 0x50, 0x4E, 0xE0, -0x54, 0x40, 0x31, 0xD0, 0x55, 0x30, 0x30, 0xE0, 0x56, 0x20, 0x13, 0xD0, 0x57, 0x10, 0x12, 0xE0, -0x58, 0x09, 0x30, 0x50, 0x58, 0xF9, 0x2F, 0x60, 0x59, 0xE9, 0x12, 0x50, 0x5A, 0xD9, 0x11, 0x60, -0x5B, 0xC8, 0xF4, 0x50, 0x5C, 0xB8, 0xF3, 0x60, 0x5D, 0xA8, 0xD6, 0x50, 0x5E, 0x98, 0xD5, 0x60, -0x5F, 0x88, 0xB8, 0x50, 0x60, 0x78, 0xB7, 0x60, 0x61, 0x68, 0x9A, 0x50, 0x62, 0x58, 0x99, 0x60, -0x63, 0x51, 0xB6, 0xD0, 0x64, 0x41, 0xB5, 0xE0, 0x65, 0x31, 0x98, 0xD0, 0x66, 0x21, 0x97, 0xE0, -0x67, 0x11, 0x7A, 0xD0, 0x68, 0x01, 0x79, 0xE0, 0x68, 0xF1, 0x5C, 0xD0, 0x69, 0xE1, 0x5B, 0xE0, -0x6A, 0xD1, 0x3E, 0xD0, 0x6B, 0xC1, 0x3D, 0xE0, 0x6C, 0xB1, 0x20, 0xD0, 0x6D, 0xAA, 0x5A, 0x60, -0x6E, 0x9A, 0x3D, 0x50, 0x6F, 0x8A, 0x3C, 0x60, 0x70, 0x7A, 0x1F, 0x50, 0x71, 0x6A, 0x1E, 0x60, -0x72, 0x5A, 0x01, 0x50, 0x73, 0x4A, 0x00, 0x60, 0x74, 0x39, 0xE3, 0x50, 0x75, 0x29, 0xE2, 0x60, -0x76, 0x19, 0xC5, 0x50, 0x77, 0x09, 0xC4, 0x60, 0x78, 0x02, 0xE1, 0xD0, 0x78, 0xF2, 0xE0, 0xE0, -0x79, 0xE2, 0xC3, 0xD0, 0x7A, 0xD2, 0xC2, 0xE0, 0x7B, 0xC2, 0xA5, 0xD0, 0x7C, 0xB2, 0xA4, 0xE0, -0x7D, 0xA2, 0x87, 0xD0, 0x7E, 0x92, 0x86, 0xE0, 0x7F, 0x82, 0x69, 0xD0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, -0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Harbin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0x95, 0xBC, -0xB8, 0xD3, 0xCE, 0x78, 0xC7, 0x90, 0xFA, 0x80, 0xF9, 0x17, 0x95, 0xF0, 0x13, 0x6D, 0xB3, 0xF8, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x01, 0x02, 0x03, 0x01, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x00, 0x00, 0x76, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, 0x4C, -0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Hong_Kong */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC, -0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8, -0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8, -0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8, -0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28, -0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8, -0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8, -0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8, -0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, -0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28, -0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28, -0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, -0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, -0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, -0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28, -0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, -0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, -0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, -0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00, -0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Hovd */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xFC, 0x94, -0x0F, 0x0B, 0xEA, 0xA0, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, -0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0, -0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0, -0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xD1, 0x30, 0x29, 0xD4, 0xC2, 0x30, -0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xA4, 0x30, 0x2C, 0xA4, 0x95, 0x30, 0x2D, 0x94, 0x86, 0x30, -0x2E, 0x84, 0x77, 0x30, 0x2F, 0x74, 0x68, 0x30, 0x30, 0x64, 0x59, 0x30, 0x31, 0x5D, 0x84, 0xB0, -0x32, 0x4D, 0x75, 0xB0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x2D, 0x57, 0xB0, 0x35, 0x1D, 0x48, 0xB0, -0x36, 0x0D, 0x39, 0xB0, 0x3A, 0xE9, 0xC1, 0xB0, 0x3B, 0xB4, 0xBA, 0xA0, 0x3C, 0xA4, 0xB9, 0xB0, -0x3D, 0x94, 0x9C, 0xA0, 0x3E, 0x84, 0x9B, 0xB0, 0x3F, 0x74, 0x7E, 0xA0, 0x40, 0x64, 0x7D, 0xB0, -0x41, 0x54, 0x60, 0xA0, 0x42, 0x44, 0x5F, 0xB0, 0x43, 0x34, 0x42, 0xA0, 0x44, 0x24, 0x41, 0xB0, -0x45, 0x1D, 0x5F, 0x20, 0x46, 0x0D, 0x5E, 0x30, 0x46, 0xFD, 0x41, 0x20, 0x47, 0xED, 0x40, 0x30, -0x48, 0xDD, 0x23, 0x20, 0x49, 0xCD, 0x22, 0x30, 0x4A, 0xBD, 0x05, 0x20, 0x4B, 0xAD, 0x04, 0x30, -0x4C, 0x9C, 0xE7, 0x20, 0x4D, 0x8C, 0xE6, 0x30, 0x4E, 0x7C, 0xC9, 0x20, 0x4F, 0x76, 0x02, 0xB0, -0x50, 0x65, 0xE5, 0xA0, 0x51, 0x55, 0xE4, 0xB0, 0x52, 0x45, 0xC7, 0xA0, 0x53, 0x35, 0xC6, 0xB0, -0x54, 0x25, 0xA9, 0xA0, 0x55, 0x15, 0xA8, 0xB0, 0x56, 0x05, 0x8B, 0xA0, 0x56, 0xF5, 0x8A, 0xB0, -0x57, 0xE5, 0x6D, 0xA0, 0x58, 0xD5, 0x6C, 0xB0, 0x59, 0xCE, 0x8A, 0x20, 0x5A, 0xBE, 0x89, 0x30, -0x5B, 0xAE, 0x6C, 0x20, 0x5C, 0x9E, 0x6B, 0x30, 0x5D, 0x8E, 0x4E, 0x20, 0x5E, 0x7E, 0x4D, 0x30, -0x5F, 0x6E, 0x30, 0x20, 0x60, 0x5E, 0x2F, 0x30, 0x61, 0x4E, 0x12, 0x20, 0x62, 0x3E, 0x11, 0x30, -0x63, 0x2D, 0xF4, 0x20, 0x64, 0x1D, 0xF3, 0x30, 0x65, 0x17, 0x10, 0xA0, 0x66, 0x07, 0x0F, 0xB0, -0x66, 0xF6, 0xF2, 0xA0, 0x67, 0xE6, 0xF1, 0xB0, 0x68, 0xD6, 0xD4, 0xA0, 0x69, 0xC6, 0xD3, 0xB0, -0x6A, 0xB6, 0xB6, 0xA0, 0x6B, 0xA6, 0xB5, 0xB0, 0x6C, 0x96, 0x98, 0xA0, 0x6D, 0x86, 0x97, 0xB0, -0x6E, 0x7F, 0xB5, 0x20, 0x6F, 0x6F, 0xB4, 0x30, 0x70, 0x5F, 0x97, 0x20, 0x71, 0x4F, 0x96, 0x30, -0x72, 0x3F, 0x79, 0x20, 0x73, 0x2F, 0x78, 0x30, 0x74, 0x1F, 0x5B, 0x20, 0x75, 0x0F, 0x5A, 0x30, -0x75, 0xFF, 0x3D, 0x20, 0x76, 0xEF, 0x3C, 0x30, 0x77, 0xDF, 0x1F, 0x20, 0x78, 0xCF, 0x1E, 0x30, -0x79, 0xC8, 0x3B, 0xA0, 0x7A, 0xB8, 0x3A, 0xB0, 0x7B, 0xA8, 0x1D, 0xA0, 0x7C, 0x98, 0x1C, 0xB0, -0x7D, 0x87, 0xFF, 0xA0, 0x7E, 0x77, 0xFE, 0xB0, 0x7F, 0x67, 0xE1, 0xA0, 0x01, 0x03, 0x02, 0x03, -0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x55, 0xEC, 0x00, 0x00, 0x00, 0x00, -0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, -0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, -0x48, 0x4F, 0x56, 0x54, 0x00, 0x48, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Irkutsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA2, 0x12, 0x0F, 0xB0, -0xB5, 0xA3, 0xD3, 0x10, 0x15, 0x27, 0x61, 0x80, 0x16, 0x18, 0x95, 0xF0, 0x17, 0x08, 0x95, 0x00, -0x17, 0xF9, 0xC9, 0x70, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0, -0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0, -0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0, -0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xD1, 0x30, 0x29, 0x78, 0x79, 0x30, -0x29, 0xD4, 0x89, 0xF0, 0x2A, 0xC4, 0x6C, 0xE0, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, -0x2D, 0x94, 0x78, 0x20, 0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, -0x31, 0x5D, 0x76, 0xA0, 0x32, 0x72, 0x51, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x52, 0x33, 0xA0, -0x35, 0x1D, 0x3A, 0xA0, 0x36, 0x32, 0x15, 0xA0, 0x36, 0xFD, 0x1C, 0xA0, 0x38, 0x1B, 0x32, 0x20, -0x38, 0xDC, 0xFE, 0xA0, 0x39, 0xFB, 0x14, 0x20, 0x3A, 0xBC, 0xE0, 0xA0, 0x3B, 0xDA, 0xF6, 0x20, -0x3C, 0xA5, 0xFD, 0x20, 0x3D, 0xBA, 0xD8, 0x20, 0x3E, 0x85, 0xDF, 0x20, 0x3F, 0x9A, 0xBA, 0x20, -0x40, 0x65, 0xC1, 0x20, 0x41, 0x83, 0xD6, 0xA0, 0x42, 0x45, 0xA3, 0x20, 0x43, 0x63, 0xB8, 0xA0, -0x44, 0x25, 0x85, 0x20, 0x45, 0x43, 0x9A, 0xA0, 0x46, 0x05, 0x67, 0x20, 0x47, 0x23, 0x7C, 0xA0, -0x47, 0xEE, 0x83, 0xA0, 0x49, 0x03, 0x5E, 0xA0, 0x49, 0xCE, 0x65, 0xA0, 0x4A, 0xE3, 0x40, 0xA0, -0x4B, 0xAE, 0x47, 0xA0, 0x4C, 0xCC, 0x5D, 0x20, 0x4D, 0x8E, 0x29, 0xA0, 0x4E, 0xAC, 0x3F, 0x20, -0x4F, 0x6E, 0x0B, 0xA0, 0x50, 0x8C, 0x21, 0x20, 0x51, 0x57, 0x28, 0x20, 0x52, 0x6C, 0x03, 0x20, -0x53, 0x37, 0x0A, 0x20, 0x54, 0x4B, 0xE5, 0x20, 0x55, 0x16, 0xEC, 0x20, 0x56, 0x2B, 0xC7, 0x20, -0x56, 0xF6, 0xCE, 0x20, 0x58, 0x14, 0xE3, 0xA0, 0x58, 0xD6, 0xB0, 0x20, 0x59, 0xF4, 0xC5, 0xA0, -0x5A, 0xB6, 0x92, 0x20, 0x5B, 0xD4, 0xA7, 0xA0, 0x5C, 0x9F, 0xAE, 0xA0, 0x5D, 0xB4, 0x89, 0xA0, -0x5E, 0x7F, 0x90, 0xA0, 0x5F, 0x94, 0x6B, 0xA0, 0x60, 0x5F, 0x72, 0xA0, 0x61, 0x7D, 0x88, 0x20, -0x62, 0x3F, 0x54, 0xA0, 0x63, 0x5D, 0x6A, 0x20, 0x64, 0x1F, 0x36, 0xA0, 0x65, 0x3D, 0x4C, 0x20, -0x66, 0x08, 0x53, 0x20, 0x67, 0x1D, 0x2E, 0x20, 0x67, 0xE8, 0x35, 0x20, 0x68, 0xFD, 0x10, 0x20, -0x69, 0xC8, 0x17, 0x20, 0x6A, 0xDC, 0xF2, 0x20, 0x6B, 0xA7, 0xF9, 0x20, 0x6C, 0xC6, 0x0E, 0xA0, -0x6D, 0x87, 0xDB, 0x20, 0x6E, 0xA5, 0xF0, 0xA0, 0x6F, 0x67, 0xBD, 0x20, 0x70, 0x85, 0xD2, 0xA0, -0x71, 0x50, 0xD9, 0xA0, 0x72, 0x65, 0xB4, 0xA0, 0x73, 0x30, 0xBB, 0xA0, 0x74, 0x45, 0x96, 0xA0, -0x75, 0x10, 0x9D, 0xA0, 0x76, 0x2E, 0xB3, 0x20, 0x76, 0xF0, 0x7F, 0xA0, 0x78, 0x0E, 0x95, 0x20, -0x78, 0xD0, 0x61, 0xA0, 0x79, 0xEE, 0x77, 0x20, 0x7A, 0xB0, 0x43, 0xA0, 0x7B, 0xCE, 0x59, 0x20, -0x7C, 0x99, 0x60, 0x20, 0x7D, 0xAE, 0x3B, 0x20, 0x7E, 0x79, 0x42, 0x20, 0x7F, 0x8E, 0x1D, 0x20, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x61, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, -0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, -0x00, 0x62, 0x70, 0x00, 0x04, 0x49, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x4B, 0x54, 0x00, 0x49, 0x52, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Istanbul */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* Asia/Jakarta */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xA9, 0x78, 0x85, 0xE0, -0xBA, 0x16, 0xDE, 0x60, 0xCB, 0xBF, 0x83, 0x88, 0xD2, 0x11, 0x0E, 0xF0, 0xD7, 0x3C, 0xC6, 0x08, -0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x00, -0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, -0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x00, 0x00, 0x62, -0x70, 0x00, 0x09, 0x4A, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, -0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Jayapura */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBA, 0x16, 0xC1, 0x98, -0xCF, 0x17, 0x0B, 0xF0, 0xF4, 0xB5, 0xA2, 0x68, 0x01, 0x02, 0x01, 0x00, 0x00, 0x83, 0xE8, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Jerusalem */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Kabul */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xD0, 0xF9, 0xD7, 0x40, -0x01, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x48, 0x00, 0x00, 0x41, 0x46, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kamchatka */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA7, 0x52, 0x96, 0xC4, -0xB5, 0xA3, 0x9A, 0xD0, 0x15, 0x27, 0x29, 0x40, 0x16, 0x18, 0x5D, 0xB0, 0x17, 0x08, 0x5C, 0xC0, -0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40, -0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60, -0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60, -0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60, -0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0, -0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0, -0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0, -0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60, -0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0, -0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0, -0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0, -0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60, -0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60, -0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60, -0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0, -0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0, -0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0, -0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60, -0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60, -0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0, -0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0, -0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0, -0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60, -0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60, -0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60, -0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0, -0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0, -0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x94, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, -0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xA8, -0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, -0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x54, 0x54, 0x00, 0x50, 0x45, -0x54, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Karachi */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x89, 0x7E, 0xFC, 0xA4, -0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0xDD, 0xA8, 0xE0, 0xA8, 0x02, 0x4F, 0xAB, 0x30, -0x3C, 0xAF, 0x45, 0xEC, 0x3D, 0x9F, 0x28, 0xDC, 0x01, 0x02, 0x01, 0x03, 0x05, 0x04, 0x05, 0x00, -0x00, 0x3E, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x01, -0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0D, 0x00, 0x00, 0x46, -0x50, 0x00, 0x12, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x4B, 0x41, 0x52, 0x54, 0x00, -0x50, 0x4B, 0x53, 0x54, 0x00, 0x50, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kashgar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xC5, 0x44, -0xC7, 0x91, 0x1D, 0xA8, 0x13, 0x6D, 0xE5, 0x30, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, -0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, -0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, -0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x47, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x4D, -0x58, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, -0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x41, 0x53, 0x54, 0x00, 0x43, 0x44, -0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Katmandu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x7D, 0x84, -0x1E, 0x18, 0x30, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x4F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x50, 0xDC, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x4E, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Krasnoyarsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xF9, 0x0D, 0xF8, -0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, -0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, -0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0, -0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0, -0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2C, 0xA4, 0x95, 0x30, -0x2D, 0x94, 0x86, 0x30, 0x2E, 0x84, 0x77, 0x30, 0x2F, 0x74, 0x68, 0x30, 0x30, 0x64, 0x59, 0x30, -0x31, 0x5D, 0x84, 0xB0, 0x32, 0x72, 0x5F, 0xB0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0, -0x35, 0x1D, 0x48, 0xB0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x2A, 0xB0, 0x38, 0x1B, 0x40, 0x30, -0x38, 0xDD, 0x0C, 0xB0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xEE, 0xB0, 0x3B, 0xDB, 0x04, 0x30, -0x3C, 0xA6, 0x0B, 0x30, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xED, 0x30, 0x3F, 0x9A, 0xC8, 0x30, -0x40, 0x65, 0xCF, 0x30, 0x41, 0x83, 0xE4, 0xB0, 0x42, 0x45, 0xB1, 0x30, 0x43, 0x63, 0xC6, 0xB0, -0x44, 0x25, 0x93, 0x30, 0x45, 0x43, 0xA8, 0xB0, 0x46, 0x05, 0x75, 0x30, 0x47, 0x23, 0x8A, 0xB0, -0x47, 0xEE, 0x91, 0xB0, 0x49, 0x03, 0x6C, 0xB0, 0x49, 0xCE, 0x73, 0xB0, 0x4A, 0xE3, 0x4E, 0xB0, -0x4B, 0xAE, 0x55, 0xB0, 0x4C, 0xCC, 0x6B, 0x30, 0x4D, 0x8E, 0x37, 0xB0, 0x4E, 0xAC, 0x4D, 0x30, -0x4F, 0x6E, 0x19, 0xB0, 0x50, 0x8C, 0x2F, 0x30, 0x51, 0x57, 0x36, 0x30, 0x52, 0x6C, 0x11, 0x30, -0x53, 0x37, 0x18, 0x30, 0x54, 0x4B, 0xF3, 0x30, 0x55, 0x16, 0xFA, 0x30, 0x56, 0x2B, 0xD5, 0x30, -0x56, 0xF6, 0xDC, 0x30, 0x58, 0x14, 0xF1, 0xB0, 0x58, 0xD6, 0xBE, 0x30, 0x59, 0xF4, 0xD3, 0xB0, -0x5A, 0xB6, 0xA0, 0x30, 0x5B, 0xD4, 0xB5, 0xB0, 0x5C, 0x9F, 0xBC, 0xB0, 0x5D, 0xB4, 0x97, 0xB0, -0x5E, 0x7F, 0x9E, 0xB0, 0x5F, 0x94, 0x79, 0xB0, 0x60, 0x5F, 0x80, 0xB0, 0x61, 0x7D, 0x96, 0x30, -0x62, 0x3F, 0x62, 0xB0, 0x63, 0x5D, 0x78, 0x30, 0x64, 0x1F, 0x44, 0xB0, 0x65, 0x3D, 0x5A, 0x30, -0x66, 0x08, 0x61, 0x30, 0x67, 0x1D, 0x3C, 0x30, 0x67, 0xE8, 0x43, 0x30, 0x68, 0xFD, 0x1E, 0x30, -0x69, 0xC8, 0x25, 0x30, 0x6A, 0xDD, 0x00, 0x30, 0x6B, 0xA8, 0x07, 0x30, 0x6C, 0xC6, 0x1C, 0xB0, -0x6D, 0x87, 0xE9, 0x30, 0x6E, 0xA5, 0xFE, 0xB0, 0x6F, 0x67, 0xCB, 0x30, 0x70, 0x85, 0xE0, 0xB0, -0x71, 0x50, 0xE7, 0xB0, 0x72, 0x65, 0xC2, 0xB0, 0x73, 0x30, 0xC9, 0xB0, 0x74, 0x45, 0xA4, 0xB0, -0x75, 0x10, 0xAB, 0xB0, 0x76, 0x2E, 0xC1, 0x30, 0x76, 0xF0, 0x8D, 0xB0, 0x78, 0x0E, 0xA3, 0x30, -0x78, 0xD0, 0x6F, 0xB0, 0x79, 0xEE, 0x85, 0x30, 0x7A, 0xB0, 0x51, 0xB0, 0x7B, 0xCE, 0x67, 0x30, -0x7C, 0x99, 0x6E, 0x30, 0x7D, 0xAE, 0x49, 0x30, 0x7E, 0x79, 0x50, 0x30, 0x7F, 0x8E, 0x2B, 0x30, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, -0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, -0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, -0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Kuala_Lumpur */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x06, 0x00, -0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x67, 0x20, 0x01, -0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x7E, -0x90, 0x00, 0x0F, 0x00, 0x00, 0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x54, 0x00, 0x4D, 0x41, 0x4C, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kuching */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xAD, 0x8A, 0x06, 0x90, -0xBA, 0x67, 0x47, 0x88, 0xBF, 0x7B, 0x27, 0x80, 0xBF, 0xF3, 0x1B, 0x50, 0xC1, 0x5D, 0xAC, 0x80, -0xC1, 0xD5, 0xA0, 0x50, 0xC3, 0x3E, 0xE0, 0x00, 0xC3, 0xB6, 0xD3, 0xD0, 0xC5, 0x20, 0x13, 0x80, -0xC5, 0x98, 0x07, 0x50, 0xC7, 0x01, 0x47, 0x00, 0xC7, 0x79, 0x3A, 0xD0, 0xC8, 0xE3, 0xCC, 0x00, -0xC9, 0x5B, 0xBF, 0xD0, 0xCA, 0xC4, 0xFF, 0x80, 0xCB, 0x3C, 0xF3, 0x50, 0xCB, 0x91, 0x58, 0x00, -0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xEE, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x05, 0x00, 0x00, 0x67, 0x70, 0x00, -0x00, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x75, 0x30, 0x01, 0x09, 0x00, 0x00, 0x70, -0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x10, 0x00, 0x00, 0x70, 0x80, 0x00, 0x14, 0x4C, -0x4D, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x53, 0x54, 0x00, 0x4A, -0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Kuwait */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x35, 0x84, -0x01, 0x00, 0x00, 0x2C, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Macao */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04, -0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, -0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, -0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, -0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, -0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, -0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70, -0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28, -0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, -0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0, -0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70, -0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, -0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, -0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D, -0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Macau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04, -0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, -0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, -0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, -0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, -0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, -0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70, -0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28, -0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, -0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0, -0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70, -0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, -0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, -0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D, -0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Magadan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x36, 0xA0, -0xB5, 0xA3, 0xA8, 0xE0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0, 0x17, 0x08, 0x6A, 0xD0, -0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0, 0x1A, 0xCC, 0x23, 0x50, -0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x03, 0x70, -0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xC7, 0x70, -0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x8B, 0x70, -0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00, 0x29, 0x78, 0x4F, 0x00, -0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0, 0x2C, 0xA4, 0x5C, 0xF0, -0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0, 0x30, 0x64, 0x20, 0xF0, -0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70, 0x34, 0x52, 0x09, 0x70, -0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xEB, 0x70, 0x36, 0xFC, 0xF2, 0x70, 0x38, 0x1B, 0x07, 0xF0, -0x38, 0xDC, 0xD4, 0x70, 0x39, 0xFA, 0xE9, 0xF0, 0x3A, 0xBC, 0xB6, 0x70, 0x3B, 0xDA, 0xCB, 0xF0, -0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xAD, 0xF0, 0x3E, 0x85, 0xB4, 0xF0, 0x3F, 0x9A, 0x8F, 0xF0, -0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xAC, 0x70, 0x42, 0x45, 0x78, 0xF0, 0x43, 0x63, 0x8E, 0x70, -0x44, 0x25, 0x5A, 0xF0, 0x45, 0x43, 0x70, 0x70, 0x46, 0x05, 0x3C, 0xF0, 0x47, 0x23, 0x52, 0x70, -0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x34, 0x70, 0x49, 0xCE, 0x3B, 0x70, 0x4A, 0xE3, 0x16, 0x70, -0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x32, 0xF0, 0x4D, 0x8D, 0xFF, 0x70, 0x4E, 0xAC, 0x14, 0xF0, -0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xF6, 0xF0, 0x51, 0x56, 0xFD, 0xF0, 0x52, 0x6B, 0xD8, 0xF0, -0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xBA, 0xF0, 0x55, 0x16, 0xC1, 0xF0, 0x56, 0x2B, 0x9C, 0xF0, -0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xB9, 0x70, 0x58, 0xD6, 0x85, 0xF0, 0x59, 0xF4, 0x9B, 0x70, -0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x7D, 0x70, 0x5C, 0x9F, 0x84, 0x70, 0x5D, 0xB4, 0x5F, 0x70, -0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x41, 0x70, 0x60, 0x5F, 0x48, 0x70, 0x61, 0x7D, 0x5D, 0xF0, -0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x3F, 0xF0, 0x64, 0x1F, 0x0C, 0x70, 0x65, 0x3D, 0x21, 0xF0, -0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x03, 0xF0, 0x67, 0xE8, 0x0A, 0xF0, 0x68, 0xFC, 0xE5, 0xF0, -0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xC7, 0xF0, 0x6B, 0xA7, 0xCE, 0xF0, 0x6C, 0xC5, 0xE4, 0x70, -0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xC6, 0x70, 0x6F, 0x67, 0x92, 0xF0, 0x70, 0x85, 0xA8, 0x70, -0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x8A, 0x70, 0x73, 0x30, 0x91, 0x70, 0x74, 0x45, 0x6C, 0x70, -0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x88, 0xF0, 0x76, 0xF0, 0x55, 0x70, 0x78, 0x0E, 0x6A, 0xF0, -0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x4C, 0xF0, 0x7A, 0xB0, 0x19, 0x70, 0x7B, 0xCE, 0x2E, 0xF0, -0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x10, 0xF0, 0x7E, 0x79, 0x17, 0xF0, 0x7F, 0x8D, 0xF2, 0xF0, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x8D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, -0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x00, 0x00, 0x9A, -0xB0, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x47, 0x54, 0x00, 0x4D, 0x41, -0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Makassar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, -0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x11, 0x0E, 0xF0, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Manila */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xC1, 0x9C, 0xF4, 0x80, -0xC2, 0x16, 0x30, 0x70, 0xCB, 0xF2, 0xE7, 0x00, 0xD0, 0xA9, 0x25, 0x70, 0xE2, 0x6C, 0x39, 0x00, -0xE2, 0xD5, 0xA2, 0xF0, 0x0F, 0x75, 0x46, 0x80, 0x10, 0x66, 0x7A, 0xF0, 0x00, 0x01, 0x02, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x05, -0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x50, 0x48, 0x53, 0x54, 0x00, 0x50, 0x48, 0x54, 0x00, 0x4A, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Muscat */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x96, 0x94, -0x01, 0x00, 0x00, 0x36, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Nicosia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8, -0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0, -0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50, -0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50, -0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0, -0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0, -0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0, -0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50, -0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0, -0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Asia/Novosibirsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0x19, 0x24, -0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, -0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, -0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0, -0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0, -0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2B, 0xFE, 0x4E, 0x00, -0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, -0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, -0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, -0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, -0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, -0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40, -0x43, 0x63, 0xD4, 0xC0, 0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40, -0x47, 0x23, 0x98, 0xC0, 0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0, -0x4A, 0xE3, 0x5C, 0xC0, 0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0, -0x4E, 0xAC, 0x5B, 0x40, 0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40, -0x52, 0x6C, 0x1F, 0x40, 0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40, -0x56, 0x2B, 0xE3, 0x40, 0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40, -0x59, 0xF4, 0xE1, 0xC0, 0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0, -0x5D, 0xB4, 0xA5, 0xC0, 0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0, -0x61, 0x7D, 0xA4, 0x40, 0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0, -0x65, 0x3D, 0x68, 0x40, 0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40, -0x68, 0xFD, 0x2C, 0x40, 0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40, -0x6C, 0xC6, 0x2A, 0xC0, 0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40, -0x70, 0x85, 0xEE, 0xC0, 0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0, -0x74, 0x45, 0xB2, 0xC0, 0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0, -0x78, 0x0E, 0xB1, 0x40, 0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0, -0x7B, 0xCE, 0x75, 0x40, 0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40, -0x7F, 0x8E, 0x39, 0x40, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, -0x08, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x4D, 0xBC, 0x00, 0x00, -0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, -0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, -0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Omsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xB3, 0x40, 0xB0, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xE4, 0xED, 0x50, 0x29, 0x78, 0x95, 0x50, -0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, -0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, -0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40, 0x43, 0x63, 0xD4, 0xC0, -0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40, 0x47, 0x23, 0x98, 0xC0, -0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0, 0x4A, 0xE3, 0x5C, 0xC0, -0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0, 0x4E, 0xAC, 0x5B, 0x40, -0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40, 0x52, 0x6C, 0x1F, 0x40, -0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40, 0x56, 0x2B, 0xE3, 0x40, -0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40, 0x59, 0xF4, 0xE1, 0xC0, -0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0, 0x5D, 0xB4, 0xA5, 0xC0, -0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0, 0x61, 0x7D, 0xA4, 0x40, -0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0, 0x65, 0x3D, 0x68, 0x40, -0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40, 0x68, 0xFD, 0x2C, 0x40, -0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40, 0x6C, 0xC6, 0x2A, 0xC0, -0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40, 0x70, 0x85, 0xEE, 0xC0, -0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0, 0x74, 0x45, 0xB2, 0xC0, -0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0, 0x78, 0x0E, 0xB1, 0x40, -0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0, 0x7B, 0xCE, 0x75, 0x40, -0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40, 0x7F, 0x8E, 0x39, 0x40, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x44, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, -0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, -0x00, 0x46, 0x50, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4F, 0x4D, 0x53, 0x54, 0x00, 0x4F, 0x4D, -0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Oral */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x93, 0xDC, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0x7F, 0x98, 0xC0, 0x29, 0x4B, 0xB4, 0x40, 0x29, 0xD4, 0xC2, 0x30, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, -0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x01, 0x0A, -0x09, 0x0A, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0D, 0x00, 0x00, 0x30, 0x24, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, -0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, -0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, -0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, -0x4D, 0x54, 0x00, 0x55, 0x52, 0x41, 0x54, 0x00, 0x55, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4F, 0x52, -0x41, 0x53, 0x54, 0x00, 0x4F, 0x52, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Phnom_Penh */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Pontianak */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x8B, 0xFF, 0x8E, 0x00, -0xBA, 0x16, 0xDF, 0x00, 0xCB, 0x79, 0xA4, 0x08, 0xD2, 0x11, 0x0E, 0xF0, 0xD7, 0x3C, 0xC6, 0x08, -0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x21, 0xDA, 0x74, 0x80, 0x01, 0x02, 0x03, 0x02, -0x04, 0x02, 0x05, 0x06, 0x00, 0x00, 0x66, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x80, 0x00, 0x04, -0x00, 0x00, 0x69, 0x78, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x10, 0x00, 0x00, 0x62, 0x70, 0x00, 0x08, 0x4C, 0x4D, -0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, 0x49, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Pyongyang */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Qatar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9D, 0x30, -0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x30, 0x50, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Qyzylorda */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x86, 0xA0, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0x78, 0x95, 0x50, -0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, -0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, -0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x35, 0xD1, 0x20, 0x01, 0x02, 0x03, 0x04, -0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x02, 0x07, 0x09, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x09, -0x00, 0x00, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, -0x00, 0x00, 0x62, 0x70, 0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x62, 0x70, -0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x49, 0x5A, 0x54, -0x00, 0x4B, 0x49, 0x5A, 0x53, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Rangoon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x73, 0x5C, -0xCB, 0xF2, 0xFC, 0x18, 0xD1, 0x9A, 0x67, 0xF0, 0x01, 0x02, 0x03, 0x00, 0x00, 0x5A, 0x24, 0x00, -0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x5B, -0x68, 0x00, 0x0D, 0x52, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, -0x4D, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Riyadh */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x36, 0xB4, -0x01, 0x00, 0x00, 0x2B, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Saigon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Sakhalin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x17, 0x86, 0xF0, 0xCD, 0xB8, -0xC3, 0xCE, 0x85, 0x70, 0xD2, 0x30, 0xB2, 0xF0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0, -0x17, 0x08, 0x6A, 0xD0, 0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0, -0x1A, 0xCC, 0x23, 0x50, 0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70, -0x1E, 0x8C, 0x03, 0x70, 0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70, -0x22, 0x4B, 0xC7, 0x70, 0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70, -0x26, 0x0B, 0x8B, 0x70, 0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00, -0x29, 0x78, 0x4F, 0x00, 0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0, -0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0, -0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x17, 0x80, 0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, -0x38, 0x1B, 0x16, 0x00, 0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80, -0x3B, 0xDA, 0xDA, 0x00, 0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, -0x3F, 0x9A, 0x9E, 0x00, 0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, -0x43, 0x63, 0x9C, 0x80, 0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, -0x47, 0x23, 0x60, 0x80, 0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, -0x4A, 0xE3, 0x24, 0x80, 0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, -0x4E, 0xAC, 0x23, 0x00, 0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, -0x52, 0x6B, 0xE7, 0x00, 0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, -0x56, 0x2B, 0xAB, 0x00, 0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, -0x59, 0xF4, 0xA9, 0x80, 0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, -0x5D, 0xB4, 0x6D, 0x80, 0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, -0x61, 0x7D, 0x6C, 0x00, 0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, -0x65, 0x3D, 0x30, 0x00, 0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, -0x68, 0xFC, 0xF4, 0x00, 0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, -0x6C, 0xC5, 0xF2, 0x80, 0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, -0x70, 0x85, 0xB6, 0x80, 0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, -0x74, 0x45, 0x7A, 0x80, 0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, -0x78, 0x0E, 0x79, 0x00, 0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, -0x7B, 0xCE, 0x3D, 0x00, 0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, -0x7F, 0x8E, 0x01, 0x00, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x03, 0x04, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x85, 0xC8, 0x00, 0x00, -0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0, -0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00, -0xA8, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x0C, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x12, -0x4C, 0x4D, 0x54, 0x00, 0x43, 0x4A, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x41, 0x4B, 0x53, -0x54, 0x00, 0x53, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Samarkand */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x23, 0xAA, 0x19, 0x85, 0x60, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50, -0x29, 0x60, 0xBE, 0x30, 0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x01, 0x02, 0x03, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x08, 0x0B, 0x0A, 0x0C, 0x0B, 0x0C, 0x00, 0x00, 0x3E, 0xA0, 0x00, 0x00, 0x00, 0x00, -0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, -0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x54, 0x60, -0x00, 0x15, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, -0x46, 0x50, 0x00, 0x15, 0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x00, 0x00, 0x54, 0x60, 0x01, 0x1E, -0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x53, -0x41, 0x4D, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x54, 0x00, -0x55, 0x5A, 0x54, 0x00, 0x55, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Seoul */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, -0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, -0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03, -0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Shanghai */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0, -0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Singapore */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, -0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00, -0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Taipei */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00, -0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00, -0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80, -0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80, -0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00, -0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00, -0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80, -0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80, -0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80, -0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80, -0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tashkent */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x83, 0x08, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50, -0x29, 0x60, 0xBE, 0x30, 0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x09, 0x08, 0x0A, 0x09, 0x0A, 0x00, 0x00, 0x40, 0xF8, 0x00, 0x00, 0x00, 0x00, -0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, -0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, -0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x00, 0x00, -0x54, 0x60, 0x01, 0x13, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x41, -0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x53, 0x54, 0x00, 0x55, 0x5A, 0x54, 0x00, 0x55, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tbilisi */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x19, 0x99, 0xFC, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0x00, 0xCB, 0xC0, 0x28, 0xE5, 0x09, 0x70, -0x29, 0x60, 0xDA, 0x50, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xC0, 0x50, -0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, -0x30, 0x64, 0x59, 0x30, 0x31, 0x5D, 0x92, 0xC0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x40, 0x30, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x04, 0x30, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xC8, 0x30, -0x40, 0x65, 0xDD, 0x40, 0x40, 0xDD, 0xC7, 0xB0, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, -0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, -0x47, 0x23, 0xC2, 0xF0, 0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, -0x4A, 0xE3, 0x86, 0xF0, 0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, -0x4E, 0xAC, 0x85, 0x70, 0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, -0x52, 0x6C, 0x49, 0x70, 0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, -0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, -0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, -0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, -0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, -0x65, 0x3D, 0x92, 0x70, 0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, -0x68, 0xFD, 0x56, 0x70, 0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, -0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, -0x70, 0x86, 0x18, 0xF0, 0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, -0x74, 0x45, 0xDC, 0xF0, 0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, -0x78, 0x0E, 0xDB, 0x70, 0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, -0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, -0x7F, 0x8E, 0x63, 0x70, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x0B, 0x0A, 0x0B, 0x0A, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x08, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, -0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, -0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, -0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, -0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x00, 0x00, 0x2A, 0x04, 0x00, 0x00, -0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40, -0x00, 0x05, 0x00, 0x00, 0x38, 0x40, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, -0x38, 0x40, 0x01, 0x0A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14, -0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, -0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14, 0x54, 0x42, 0x4D, 0x54, 0x00, 0x54, 0x42, 0x49, -0x54, 0x00, 0x54, 0x42, 0x49, 0x53, 0x54, 0x00, 0x47, 0x45, 0x54, 0x00, 0x47, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tehran */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8, -0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30, -0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8, -0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8, -0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8, -0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8, -0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48, -0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48, -0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8, -0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8, -0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x44, 0x20, 0x62, 0x48, -0x45, 0x12, 0xE8, 0x38, 0x46, 0x01, 0x95, 0xC8, 0x46, 0xF4, 0x1B, 0xB8, 0x47, 0xE2, 0xC9, 0x48, -0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8, -0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8, -0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48, -0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48, -0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8, -0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8, -0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48, -0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48, -0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8, -0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8, -0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48, -0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48, -0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8, -0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8, -0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03, -0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04, -0x00, 0x00, 0x31, 0x38, 0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40, -0x00, 0x08, 0x00, 0x00, 0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, -0x49, 0x52, 0x53, 0x54, 0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tel_Aviv */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Thimbu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74, -0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Thimphu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74, -0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tokyo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70, -0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80, -0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A, -0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ujung_Pandang */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, -0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x11, 0x0E, 0xF0, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Ulaanbaatar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0, -0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0, -0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0, -0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0x94, 0x78, 0x20, -0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x5D, 0x76, 0xA0, -0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x2D, 0x49, 0xA0, 0x35, 0x1D, 0x3A, 0xA0, -0x36, 0x0D, 0x2B, 0xA0, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0, -0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0, -0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0, -0x45, 0x1D, 0x51, 0x10, 0x46, 0x0D, 0x50, 0x20, 0x46, 0xFD, 0x33, 0x10, 0x47, 0xED, 0x32, 0x20, -0x48, 0xDD, 0x15, 0x10, 0x49, 0xCD, 0x14, 0x20, 0x4A, 0xBC, 0xF7, 0x10, 0x4B, 0xAC, 0xF6, 0x20, -0x4C, 0x9C, 0xD9, 0x10, 0x4D, 0x8C, 0xD8, 0x20, 0x4E, 0x7C, 0xBB, 0x10, 0x4F, 0x75, 0xF4, 0xA0, -0x50, 0x65, 0xD7, 0x90, 0x51, 0x55, 0xD6, 0xA0, 0x52, 0x45, 0xB9, 0x90, 0x53, 0x35, 0xB8, 0xA0, -0x54, 0x25, 0x9B, 0x90, 0x55, 0x15, 0x9A, 0xA0, 0x56, 0x05, 0x7D, 0x90, 0x56, 0xF5, 0x7C, 0xA0, -0x57, 0xE5, 0x5F, 0x90, 0x58, 0xD5, 0x5E, 0xA0, 0x59, 0xCE, 0x7C, 0x10, 0x5A, 0xBE, 0x7B, 0x20, -0x5B, 0xAE, 0x5E, 0x10, 0x5C, 0x9E, 0x5D, 0x20, 0x5D, 0x8E, 0x40, 0x10, 0x5E, 0x7E, 0x3F, 0x20, -0x5F, 0x6E, 0x22, 0x10, 0x60, 0x5E, 0x21, 0x20, 0x61, 0x4E, 0x04, 0x10, 0x62, 0x3E, 0x03, 0x20, -0x63, 0x2D, 0xE6, 0x10, 0x64, 0x1D, 0xE5, 0x20, 0x65, 0x17, 0x02, 0x90, 0x66, 0x07, 0x01, 0xA0, -0x66, 0xF6, 0xE4, 0x90, 0x67, 0xE6, 0xE3, 0xA0, 0x68, 0xD6, 0xC6, 0x90, 0x69, 0xC6, 0xC5, 0xA0, -0x6A, 0xB6, 0xA8, 0x90, 0x6B, 0xA6, 0xA7, 0xA0, 0x6C, 0x96, 0x8A, 0x90, 0x6D, 0x86, 0x89, 0xA0, -0x6E, 0x7F, 0xA7, 0x10, 0x6F, 0x6F, 0xA6, 0x20, 0x70, 0x5F, 0x89, 0x10, 0x71, 0x4F, 0x88, 0x20, -0x72, 0x3F, 0x6B, 0x10, 0x73, 0x2F, 0x6A, 0x20, 0x74, 0x1F, 0x4D, 0x10, 0x75, 0x0F, 0x4C, 0x20, -0x75, 0xFF, 0x2F, 0x10, 0x76, 0xEF, 0x2E, 0x20, 0x77, 0xDF, 0x11, 0x10, 0x78, 0xCF, 0x10, 0x20, -0x79, 0xC8, 0x2D, 0x90, 0x7A, 0xB8, 0x2C, 0xA0, 0x7B, 0xA8, 0x0F, 0x90, 0x7C, 0x98, 0x0E, 0xA0, -0x7D, 0x87, 0xF1, 0x90, 0x7E, 0x77, 0xF0, 0xA0, 0x7F, 0x67, 0xD3, 0x90, 0x01, 0x03, 0x02, 0x03, -0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, -0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, -0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ulan_Bator */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0, -0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0, -0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0, -0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0x94, 0x78, 0x20, -0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x5D, 0x76, 0xA0, -0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x2D, 0x49, 0xA0, 0x35, 0x1D, 0x3A, 0xA0, -0x36, 0x0D, 0x2B, 0xA0, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0, -0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0, -0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0, -0x45, 0x1D, 0x51, 0x10, 0x46, 0x0D, 0x50, 0x20, 0x46, 0xFD, 0x33, 0x10, 0x47, 0xED, 0x32, 0x20, -0x48, 0xDD, 0x15, 0x10, 0x49, 0xCD, 0x14, 0x20, 0x4A, 0xBC, 0xF7, 0x10, 0x4B, 0xAC, 0xF6, 0x20, -0x4C, 0x9C, 0xD9, 0x10, 0x4D, 0x8C, 0xD8, 0x20, 0x4E, 0x7C, 0xBB, 0x10, 0x4F, 0x75, 0xF4, 0xA0, -0x50, 0x65, 0xD7, 0x90, 0x51, 0x55, 0xD6, 0xA0, 0x52, 0x45, 0xB9, 0x90, 0x53, 0x35, 0xB8, 0xA0, -0x54, 0x25, 0x9B, 0x90, 0x55, 0x15, 0x9A, 0xA0, 0x56, 0x05, 0x7D, 0x90, 0x56, 0xF5, 0x7C, 0xA0, -0x57, 0xE5, 0x5F, 0x90, 0x58, 0xD5, 0x5E, 0xA0, 0x59, 0xCE, 0x7C, 0x10, 0x5A, 0xBE, 0x7B, 0x20, -0x5B, 0xAE, 0x5E, 0x10, 0x5C, 0x9E, 0x5D, 0x20, 0x5D, 0x8E, 0x40, 0x10, 0x5E, 0x7E, 0x3F, 0x20, -0x5F, 0x6E, 0x22, 0x10, 0x60, 0x5E, 0x21, 0x20, 0x61, 0x4E, 0x04, 0x10, 0x62, 0x3E, 0x03, 0x20, -0x63, 0x2D, 0xE6, 0x10, 0x64, 0x1D, 0xE5, 0x20, 0x65, 0x17, 0x02, 0x90, 0x66, 0x07, 0x01, 0xA0, -0x66, 0xF6, 0xE4, 0x90, 0x67, 0xE6, 0xE3, 0xA0, 0x68, 0xD6, 0xC6, 0x90, 0x69, 0xC6, 0xC5, 0xA0, -0x6A, 0xB6, 0xA8, 0x90, 0x6B, 0xA6, 0xA7, 0xA0, 0x6C, 0x96, 0x8A, 0x90, 0x6D, 0x86, 0x89, 0xA0, -0x6E, 0x7F, 0xA7, 0x10, 0x6F, 0x6F, 0xA6, 0x20, 0x70, 0x5F, 0x89, 0x10, 0x71, 0x4F, 0x88, 0x20, -0x72, 0x3F, 0x6B, 0x10, 0x73, 0x2F, 0x6A, 0x20, 0x74, 0x1F, 0x4D, 0x10, 0x75, 0x0F, 0x4C, 0x20, -0x75, 0xFF, 0x2F, 0x10, 0x76, 0xEF, 0x2E, 0x20, 0x77, 0xDF, 0x11, 0x10, 0x78, 0xCF, 0x10, 0x20, -0x79, 0xC8, 0x2D, 0x90, 0x7A, 0xB8, 0x2C, 0xA0, 0x7B, 0xA8, 0x0F, 0x90, 0x7C, 0x98, 0x0E, 0xA0, -0x7D, 0x87, 0xF1, 0x90, 0x7E, 0x77, 0xF0, 0xA0, 0x7F, 0x67, 0xD3, 0x90, 0x01, 0x03, 0x02, 0x03, -0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, -0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, -0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Urumqi */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xBA, 0x64, -0x13, 0x6D, 0xD7, 0x20, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x52, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x52, -0x55, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Vientiane */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Vladivostok */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x16, 0xA7, 0x59, 0x47, 0x50, -0xB5, 0xA3, 0xB6, 0xF0, 0x15, 0x27, 0x45, 0x60, 0x16, 0x18, 0x79, 0xD0, 0x17, 0x08, 0x78, 0xE0, -0x17, 0xF9, 0xAD, 0x50, 0x18, 0xE9, 0xAC, 0x60, 0x19, 0xDA, 0xE0, 0xD0, 0x1A, 0xCC, 0x31, 0x60, -0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x11, 0x80, -0x1F, 0x7C, 0x02, 0x80, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xE4, 0x80, 0x22, 0x4B, 0xD5, 0x80, -0x23, 0x3B, 0xC6, 0x80, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0xA8, 0x80, 0x26, 0x0B, 0x99, 0x80, -0x27, 0x04, 0xC5, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0xB5, 0x10, 0x29, 0x78, 0x5D, 0x10, -0x29, 0xD4, 0x6D, 0xD0, 0x2A, 0xC4, 0x50, 0xC0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x6B, 0x00, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x84, 0x4D, 0x00, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x2F, 0x00, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x7B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, -0xA0, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0F, 0x00, -0x00, 0x7E, 0x90, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x54, 0x00, 0x56, 0x4C, -0x41, 0x53, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Yakutsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0xEA, 0x70, -0xB5, 0xA3, 0xC5, 0x00, 0x15, 0x27, 0x53, 0x70, 0x16, 0x18, 0x87, 0xE0, 0x17, 0x08, 0x86, 0xF0, -0x17, 0xF9, 0xBB, 0x60, 0x18, 0xE9, 0xBA, 0x70, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70, -0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90, -0x1F, 0x7C, 0x10, 0x90, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xF2, 0x90, 0x22, 0x4B, 0xE3, 0x90, -0x23, 0x3B, 0xD4, 0x90, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xB6, 0x90, 0x26, 0x0B, 0xA7, 0x90, -0x27, 0x04, 0xD3, 0x10, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0x78, 0x6B, 0x20, -0x29, 0xD4, 0x7B, 0xE0, 0x2A, 0xC4, 0x5E, 0xD0, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x79, 0x10, -0x2D, 0x94, 0x6A, 0x10, 0x2E, 0x84, 0x5B, 0x10, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x3D, 0x10, -0x31, 0x5D, 0x68, 0x90, 0x32, 0x72, 0x43, 0x90, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x52, 0x25, 0x90, -0x35, 0x1D, 0x2C, 0x90, 0x36, 0x32, 0x07, 0x90, 0x36, 0xFD, 0x0E, 0x90, 0x38, 0x1B, 0x24, 0x10, -0x38, 0xDC, 0xF0, 0x90, 0x39, 0xFB, 0x06, 0x10, 0x3A, 0xBC, 0xD2, 0x90, 0x3B, 0xDA, 0xE8, 0x10, -0x3C, 0xA5, 0xEF, 0x10, 0x3D, 0xBA, 0xCA, 0x10, 0x3E, 0x85, 0xD1, 0x10, 0x3F, 0x9A, 0xAC, 0x10, -0x40, 0x65, 0xB3, 0x10, 0x41, 0x83, 0xC8, 0x90, 0x42, 0x45, 0x95, 0x10, 0x43, 0x63, 0xAA, 0x90, -0x44, 0x25, 0x77, 0x10, 0x45, 0x43, 0x8C, 0x90, 0x46, 0x05, 0x59, 0x10, 0x47, 0x23, 0x6E, 0x90, -0x47, 0xEE, 0x75, 0x90, 0x49, 0x03, 0x50, 0x90, 0x49, 0xCE, 0x57, 0x90, 0x4A, 0xE3, 0x32, 0x90, -0x4B, 0xAE, 0x39, 0x90, 0x4C, 0xCC, 0x4F, 0x10, 0x4D, 0x8E, 0x1B, 0x90, 0x4E, 0xAC, 0x31, 0x10, -0x4F, 0x6D, 0xFD, 0x90, 0x50, 0x8C, 0x13, 0x10, 0x51, 0x57, 0x1A, 0x10, 0x52, 0x6B, 0xF5, 0x10, -0x53, 0x36, 0xFC, 0x10, 0x54, 0x4B, 0xD7, 0x10, 0x55, 0x16, 0xDE, 0x10, 0x56, 0x2B, 0xB9, 0x10, -0x56, 0xF6, 0xC0, 0x10, 0x58, 0x14, 0xD5, 0x90, 0x58, 0xD6, 0xA2, 0x10, 0x59, 0xF4, 0xB7, 0x90, -0x5A, 0xB6, 0x84, 0x10, 0x5B, 0xD4, 0x99, 0x90, 0x5C, 0x9F, 0xA0, 0x90, 0x5D, 0xB4, 0x7B, 0x90, -0x5E, 0x7F, 0x82, 0x90, 0x5F, 0x94, 0x5D, 0x90, 0x60, 0x5F, 0x64, 0x90, 0x61, 0x7D, 0x7A, 0x10, -0x62, 0x3F, 0x46, 0x90, 0x63, 0x5D, 0x5C, 0x10, 0x64, 0x1F, 0x28, 0x90, 0x65, 0x3D, 0x3E, 0x10, -0x66, 0x08, 0x45, 0x10, 0x67, 0x1D, 0x20, 0x10, 0x67, 0xE8, 0x27, 0x10, 0x68, 0xFD, 0x02, 0x10, -0x69, 0xC8, 0x09, 0x10, 0x6A, 0xDC, 0xE4, 0x10, 0x6B, 0xA7, 0xEB, 0x10, 0x6C, 0xC6, 0x00, 0x90, -0x6D, 0x87, 0xCD, 0x10, 0x6E, 0xA5, 0xE2, 0x90, 0x6F, 0x67, 0xAF, 0x10, 0x70, 0x85, 0xC4, 0x90, -0x71, 0x50, 0xCB, 0x90, 0x72, 0x65, 0xA6, 0x90, 0x73, 0x30, 0xAD, 0x90, 0x74, 0x45, 0x88, 0x90, -0x75, 0x10, 0x8F, 0x90, 0x76, 0x2E, 0xA5, 0x10, 0x76, 0xF0, 0x71, 0x90, 0x78, 0x0E, 0x87, 0x10, -0x78, 0xD0, 0x53, 0x90, 0x79, 0xEE, 0x69, 0x10, 0x7A, 0xB0, 0x35, 0x90, 0x7B, 0xCE, 0x4B, 0x10, -0x7C, 0x99, 0x52, 0x10, 0x7D, 0xAE, 0x2D, 0x10, 0x7E, 0x79, 0x34, 0x10, 0x7F, 0x8E, 0x0F, 0x10, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x79, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, -0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, -0x90, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, -0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x41, 0x4B, 0x54, 0x00, 0x59, 0x41, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Yekaterinburg */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x12, 0xAD, 0xF0, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x78, 0xA3, 0x60, -0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, -0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, -0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50, -0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50, -0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50, -0x40, 0x65, 0xEB, 0x50, 0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xE2, 0xD0, -0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0xA6, 0xD0, -0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x6A, 0xD0, -0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x53, 0xD0, 0x4E, 0xAC, 0x69, 0x50, -0x4F, 0x6E, 0x35, 0xD0, 0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x52, 0x50, 0x52, 0x6C, 0x2D, 0x50, -0x53, 0x37, 0x34, 0x50, 0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x16, 0x50, 0x56, 0x2B, 0xF1, 0x50, -0x56, 0xF6, 0xF8, 0x50, 0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xDA, 0x50, 0x59, 0xF4, 0xEF, 0xD0, -0x5A, 0xB6, 0xBC, 0x50, 0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xD8, 0xD0, 0x5D, 0xB4, 0xB3, 0xD0, -0x5E, 0x7F, 0xBA, 0xD0, 0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0x9C, 0xD0, 0x61, 0x7D, 0xB2, 0x50, -0x62, 0x3F, 0x7E, 0xD0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x60, 0xD0, 0x65, 0x3D, 0x76, 0x50, -0x66, 0x08, 0x7D, 0x50, 0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x5F, 0x50, 0x68, 0xFD, 0x3A, 0x50, -0x69, 0xC8, 0x41, 0x50, 0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x23, 0x50, 0x6C, 0xC6, 0x38, 0xD0, -0x6D, 0x88, 0x05, 0x50, 0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xE7, 0x50, 0x70, 0x85, 0xFC, 0xD0, -0x71, 0x51, 0x03, 0xD0, 0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xE5, 0xD0, 0x74, 0x45, 0xC0, 0xD0, -0x75, 0x10, 0xC7, 0xD0, 0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xA9, 0xD0, 0x78, 0x0E, 0xBF, 0x50, -0x78, 0xD0, 0x8B, 0xD0, 0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x6D, 0xD0, 0x7B, 0xCE, 0x83, 0x50, -0x7C, 0x99, 0x8A, 0x50, 0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x6C, 0x50, 0x7F, 0x8E, 0x47, 0x50, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x38, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, -0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, -0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, -0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, -0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x56, 0x45, 0x54, 0x00, 0x53, 0x56, 0x45, 0x53, 0x54, 0x00, 0x59, 0x45, 0x4B, 0x53, -0x54, 0x00, 0x59, 0x45, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Yerevan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x9A, 0x48, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xDC, 0xF6, 0x40, 0x28, 0xE5, 0x09, 0x70, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xF0, 0xE0, 0x44, 0x25, 0xBD, 0x60, -0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xB4, 0xE0, 0x47, 0xEE, 0xBB, 0xE0, -0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x78, 0xE0, 0x4B, 0xAE, 0x7F, 0xE0, -0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x77, 0x60, 0x4F, 0x6E, 0x43, 0xE0, -0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x3B, 0x60, 0x53, 0x37, 0x42, 0x60, -0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xFF, 0x60, 0x56, 0xF7, 0x06, 0x60, -0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xFD, 0xE0, 0x5A, 0xB6, 0xCA, 0x60, -0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xC1, 0xE0, 0x5E, 0x7F, 0xC8, 0xE0, -0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xC0, 0x60, 0x62, 0x3F, 0x8C, 0xE0, -0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x84, 0x60, 0x66, 0x08, 0x8B, 0x60, -0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x48, 0x60, 0x69, 0xC8, 0x4F, 0x60, -0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x46, 0xE0, 0x6D, 0x88, 0x13, 0x60, -0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x86, 0x0A, 0xE0, 0x71, 0x51, 0x11, 0xE0, -0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xCE, 0xE0, 0x75, 0x10, 0xD5, 0xE0, -0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xCD, 0x60, 0x78, 0xD0, 0x99, 0xE0, -0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x91, 0x60, 0x7C, 0x99, 0x98, 0x60, -0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x55, 0x60, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x0A, 0x07, 0x0A, 0x0B, 0x0D, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x00, 0x00, 0x29, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, -0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, -0x00, 0x00, 0x38, 0x40, 0x01, 0x13, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40, -0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x45, 0x52, 0x54, 0x00, 0x59, 0x45, 0x52, -0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Azores */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0x91, 0xC1, 0xFC, 0x58, -0x9B, 0x4B, 0x89, 0x90, 0x9B, 0xFE, 0xE3, 0xA0, 0x9C, 0x9D, 0x09, 0x90, 0x9D, 0xC9, 0x9F, 0x90, -0x9E, 0x7F, 0x8E, 0x90, 0x9F, 0xAA, 0xD3, 0x10, 0xA0, 0x5F, 0x70, 0x90, 0xA1, 0x8C, 0x06, 0x90, -0xA2, 0x41, 0xF5, 0x90, 0xA3, 0x6E, 0x8B, 0x90, 0xA4, 0x23, 0x29, 0x10, 0xA5, 0x4F, 0xBF, 0x10, -0xAA, 0x06, 0x0B, 0x90, 0xAA, 0xF4, 0xAB, 0x10, 0xAD, 0xC9, 0xC4, 0x10, 0xAE, 0xA7, 0x40, 0x10, -0xAF, 0xA0, 0x6B, 0x90, 0xB0, 0x87, 0x22, 0x10, 0xB1, 0x89, 0x88, 0x10, 0xB2, 0x70, 0x3E, 0x90, -0xB3, 0x72, 0xA4, 0x90, 0xB4, 0x50, 0x20, 0x90, 0xB7, 0x32, 0x68, 0x90, 0xB8, 0x0F, 0xE4, 0x90, -0xB8, 0xFF, 0xD5, 0x90, 0xB9, 0xEF, 0xC6, 0x90, 0xBC, 0xC8, 0xD4, 0x10, 0xBD, 0xB8, 0xC5, 0x10, -0xBE, 0x9F, 0x7B, 0x90, 0xBF, 0x98, 0xA7, 0x10, 0xC0, 0x9B, 0x0D, 0x10, 0xC1, 0x78, 0x89, 0x10, -0xC2, 0x68, 0x7A, 0x10, 0xC3, 0x58, 0x6B, 0x10, 0xC4, 0x3F, 0x21, 0x90, 0xC5, 0x38, 0x4D, 0x10, -0xC6, 0x3A, 0xB3, 0x10, 0xC7, 0x58, 0xC8, 0x90, 0xC7, 0xD9, 0xFB, 0x90, 0xC9, 0x01, 0x4B, 0x90, -0xC9, 0xF1, 0x3C, 0x90, 0xCA, 0xE2, 0x7F, 0x10, 0xCB, 0xB5, 0x6F, 0x10, 0xCB, 0xEC, 0xC0, 0x00, -0xCC, 0x80, 0x68, 0x00, 0xCC, 0xDC, 0xBF, 0x10, 0xCD, 0x95, 0x51, 0x10, 0xCD, 0xC3, 0x67, 0x80, -0xCE, 0x72, 0xBF, 0x00, 0xCE, 0xC5, 0xDB, 0x90, 0xCF, 0x75, 0x33, 0x10, 0xCF, 0xAC, 0x84, 0x00, -0xD0, 0x52, 0xA1, 0x00, 0xD0, 0xA5, 0xBD, 0x90, 0xD1, 0x55, 0x15, 0x10, 0xD1, 0x8C, 0x66, 0x00, -0xD2, 0x32, 0x83, 0x00, 0xD2, 0x85, 0x9F, 0x90, 0xD3, 0x59, 0xE1, 0x10, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x39, 0xED, 0x40, 0xD6, 0x29, 0xDE, 0x40, 0xD7, 0x19, 0xCF, 0x40, 0xD8, 0x09, 0xC0, 0x40, -0xD8, 0xF9, 0xB1, 0x40, 0xD9, 0xE9, 0xA2, 0x40, 0xDC, 0xB9, 0x75, 0x40, 0xDD, 0xB2, 0xA0, 0xC0, -0xDE, 0xA2, 0x91, 0xC0, 0xDF, 0x92, 0x82, 0xC0, 0xE0, 0x82, 0x73, 0xC0, 0xE1, 0x72, 0x64, 0xC0, -0xE2, 0x62, 0x55, 0xC0, 0xE3, 0x52, 0x46, 0xC0, 0xE4, 0x42, 0x37, 0xC0, 0xE5, 0x32, 0x28, 0xC0, -0xE6, 0x22, 0x19, 0xC0, 0xE7, 0x1B, 0x45, 0x40, 0xE8, 0x0B, 0x36, 0x40, 0xE8, 0xFB, 0x27, 0x40, -0xE9, 0xEB, 0x18, 0x40, 0xEA, 0xDB, 0x09, 0x40, 0xEB, 0xCA, 0xFA, 0x40, 0xEC, 0xBA, 0xEB, 0x40, -0xED, 0xAA, 0xDC, 0x40, 0xEE, 0x9A, 0xCD, 0x40, 0xEF, 0x8A, 0xBE, 0x40, 0xF0, 0x7A, 0xAF, 0x40, -0xF1, 0x6A, 0xA0, 0x40, 0xF2, 0x63, 0xCB, 0xC0, 0xF3, 0x53, 0xBC, 0xC0, 0xF4, 0x43, 0xAD, 0xC0, -0xF5, 0x33, 0x9E, 0xC0, 0xF6, 0x23, 0x8F, 0xC0, 0xF7, 0x13, 0x80, 0xC0, 0xF8, 0x03, 0x71, 0xC0, -0xF8, 0xF3, 0x62, 0xC0, 0x0D, 0x9B, 0x29, 0x10, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x26, 0xA0, 0x13, 0x44, 0x09, 0x90, -0x14, 0x34, 0x08, 0xA0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xEA, 0xA0, 0x17, 0x03, 0xDB, 0xA0, -0x17, 0xF3, 0xCC, 0xA0, 0x18, 0xE3, 0xCB, 0xB0, 0x19, 0xD3, 0xAE, 0xA0, 0x1A, 0xC3, 0x9F, 0xA0, -0x1B, 0xBC, 0xCB, 0x20, 0x1C, 0xAC, 0xBC, 0x20, 0x1D, 0x9C, 0xAD, 0x20, 0x1E, 0x8C, 0x9E, 0x20, -0x1F, 0x7C, 0x8F, 0x20, 0x20, 0x6C, 0x80, 0x20, 0x21, 0x5C, 0x71, 0x20, 0x22, 0x4C, 0x62, 0x20, -0x23, 0x3C, 0x53, 0x20, 0x24, 0x2C, 0x44, 0x20, 0x25, 0x1C, 0x35, 0x20, 0x26, 0x0C, 0x26, 0x20, -0x27, 0x05, 0x51, 0xA0, 0x27, 0xF5, 0x42, 0xA0, 0x28, 0xE5, 0x33, 0xA0, 0x29, 0xD5, 0x24, 0xA0, -0x2A, 0xC5, 0x15, 0xA0, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0xFF, 0xFF, 0xE5, 0x28, 0x00, 0x00, 0xFF, 0xFF, -0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, -0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, -0x48, 0x4D, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x53, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x54, 0x00, 0x41, -0x5A, 0x4F, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* Atlantic/Bermuda */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB4, 0xC3, 0x1D, 0xD8, -0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, -0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, -0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, -0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, -0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, -0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, -0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, -0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, -0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, -0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, -0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, -0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, -0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, -0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, -0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, -0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, -0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, -0x47, 0xF8, 0x66, 0xE0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, -0x4B, 0xB8, 0x2A, 0xE0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, -0x4F, 0x77, 0xEE, 0xE0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, -0x53, 0x40, 0xED, 0x60, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, -0x57, 0x00, 0xB1, 0x60, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, -0x5A, 0xC0, 0x75, 0x60, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, -0x5E, 0x89, 0x73, 0xE0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, -0x62, 0x49, 0x37, 0xE0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, -0x66, 0x12, 0x36, 0x60, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, -0x69, 0xD1, 0xFA, 0x60, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, -0x6D, 0x91, 0xBE, 0x60, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, -0x71, 0x5A, 0xBC, 0xE0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, -0x75, 0x1A, 0x80, 0xE0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, -0x78, 0xDA, 0x44, 0xE0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, -0x7C, 0xA3, 0x43, 0x60, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0xFF, 0xFF, 0xC3, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Canary */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x04, 0x5C, 0xF0, -0xD4, 0x41, 0xF7, 0x20, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xF1, 0x90, 0x00, 0x00, -0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, -0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x4C, 0x4D, -0x54, 0x00, 0x43, 0x41, 0x4E, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Atlantic/Cape_Verde */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x89, 0x7F, 0x51, 0x8C, -0xCC, 0x95, 0x9C, 0x20, 0xD2, 0x74, 0x7C, 0x10, 0x0B, 0x17, 0xF7, 0x40, 0x01, 0x02, 0x01, 0x03, -0xFF, 0xFF, 0xE9, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, -0x01, 0x08, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x56, 0x54, 0x00, -0x43, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Faeroe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x8B, 0x6D, 0xA4, 0x58, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, 0xF9, 0xA8, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, -0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, - -/* Atlantic/Jan_Mayen */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Atlantic/Madeira */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x91, 0xC1, 0xF1, 0x58, -0x9B, 0x4B, 0x7B, 0x80, 0x9B, 0xFE, 0xD5, 0x90, 0x9C, 0x9C, 0xFB, 0x80, 0x9D, 0xC9, 0x91, 0x80, -0x9E, 0x7F, 0x80, 0x80, 0x9F, 0xAA, 0xC5, 0x00, 0xA0, 0x5F, 0x62, 0x80, 0xA1, 0x8B, 0xF8, 0x80, -0xA2, 0x41, 0xE7, 0x80, 0xA3, 0x6E, 0x7D, 0x80, 0xA4, 0x23, 0x1B, 0x00, 0xA5, 0x4F, 0xB1, 0x00, -0xAA, 0x05, 0xFD, 0x80, 0xAA, 0xF4, 0x9D, 0x00, 0xAD, 0xC9, 0xB6, 0x00, 0xAE, 0xA7, 0x32, 0x00, -0xAF, 0xA0, 0x5D, 0x80, 0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x7A, 0x00, 0xB2, 0x70, 0x30, 0x80, -0xB3, 0x72, 0x96, 0x80, 0xB4, 0x50, 0x12, 0x80, 0xB7, 0x32, 0x5A, 0x80, 0xB8, 0x0F, 0xD6, 0x80, -0xB8, 0xFF, 0xC7, 0x80, 0xB9, 0xEF, 0xB8, 0x80, 0xBC, 0xC8, 0xC6, 0x00, 0xBD, 0xB8, 0xB7, 0x00, -0xBE, 0x9F, 0x6D, 0x80, 0xBF, 0x98, 0x99, 0x00, 0xC0, 0x9A, 0xFF, 0x00, 0xC1, 0x78, 0x7B, 0x00, -0xC2, 0x68, 0x6C, 0x00, 0xC3, 0x58, 0x5D, 0x00, 0xC4, 0x3F, 0x13, 0x80, 0xC5, 0x38, 0x3F, 0x00, -0xC6, 0x3A, 0xA5, 0x00, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xD9, 0xED, 0x80, 0xC9, 0x01, 0x3D, 0x80, -0xC9, 0xF1, 0x2E, 0x80, 0xCA, 0xE2, 0x71, 0x00, 0xCB, 0xB5, 0x61, 0x00, 0xCB, 0xEC, 0xB1, 0xF0, -0xCC, 0x80, 0x59, 0xF0, 0xCC, 0xDC, 0xB1, 0x00, 0xCD, 0x95, 0x43, 0x00, 0xCD, 0xC3, 0x59, 0x70, -0xCE, 0x72, 0xB0, 0xF0, 0xCE, 0xC5, 0xCD, 0x80, 0xCF, 0x75, 0x25, 0x00, 0xCF, 0xAC, 0x75, 0xF0, -0xD0, 0x52, 0x92, 0xF0, 0xD0, 0xA5, 0xAF, 0x80, 0xD1, 0x55, 0x07, 0x00, 0xD1, 0x8C, 0x57, 0xF0, -0xD2, 0x32, 0x74, 0xF0, 0xD2, 0x85, 0x91, 0x80, 0xD3, 0x59, 0xD3, 0x00, 0xD4, 0x49, 0xC4, 0x00, -0xD5, 0x39, 0xDF, 0x30, 0xD6, 0x29, 0xD0, 0x30, 0xD7, 0x19, 0xC1, 0x30, 0xD8, 0x09, 0xB2, 0x30, -0xD8, 0xF9, 0xA3, 0x30, 0xD9, 0xE9, 0x94, 0x30, 0xDC, 0xB9, 0x67, 0x30, 0xDD, 0xB2, 0x92, 0xB0, -0xDE, 0xA2, 0x83, 0xB0, 0xDF, 0x92, 0x74, 0xB0, 0xE0, 0x82, 0x65, 0xB0, 0xE1, 0x72, 0x56, 0xB0, -0xE2, 0x62, 0x47, 0xB0, 0xE3, 0x52, 0x38, 0xB0, 0xE4, 0x42, 0x29, 0xB0, 0xE5, 0x32, 0x1A, 0xB0, -0xE6, 0x22, 0x0B, 0xB0, 0xE7, 0x1B, 0x37, 0x30, 0xE8, 0x0B, 0x28, 0x30, 0xE8, 0xFB, 0x19, 0x30, -0xE9, 0xEB, 0x0A, 0x30, 0xEA, 0xDA, 0xFB, 0x30, 0xEB, 0xCA, 0xEC, 0x30, 0xEC, 0xBA, 0xDD, 0x30, -0xED, 0xAA, 0xCE, 0x30, 0xEE, 0x9A, 0xBF, 0x30, 0xEF, 0x8A, 0xB0, 0x30, 0xF0, 0x7A, 0xA1, 0x30, -0xF1, 0x6A, 0x92, 0x30, 0xF2, 0x63, 0xBD, 0xB0, 0xF3, 0x53, 0xAE, 0xB0, 0xF4, 0x43, 0x9F, 0xB0, -0xF5, 0x33, 0x90, 0xB0, 0xF6, 0x23, 0x81, 0xB0, 0xF7, 0x13, 0x72, 0xB0, 0xF8, 0x03, 0x63, 0xB0, -0xF8, 0xF3, 0x54, 0xB0, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, 0x0F, 0x84, 0x37, 0x80, -0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, 0x13, 0x43, 0xFB, 0x80, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0xFF, 0xFF, 0xF0, 0x28, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, -0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0F, 0x00, 0x00, 0x0E, 0x10, -0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x15, 0x46, 0x4D, 0x54, 0x00, 0x4D, 0x41, -0x44, 0x53, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x4D, 0x54, 0x00, 0x57, -0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Atlantic/Reykjavik */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94, -0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10, -0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0, -0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20, -0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20, -0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0, -0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0, -0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20, -0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20, -0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0, -0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0, -0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0, -0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20, -0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20, -0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, -0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/South_Georgia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, -0x00, 0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, - -/* Atlantic/Stanley */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x93, 0x44, 0x5F, 0x3C, -0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x36, 0x03, 0x30, 0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x15, 0xE5, 0x30, -0xC7, 0x18, 0x59, 0x40, 0xC7, 0xFF, 0x01, 0xB0, 0xC8, 0xF8, 0x3B, 0x40, 0xC9, 0xDE, 0xE3, 0xB0, -0xCA, 0xD8, 0x1D, 0x40, 0xCB, 0xBE, 0xC5, 0xB0, 0xCC, 0xB7, 0xFF, 0x40, 0xCD, 0x36, 0x81, 0x30, -0x19, 0x11, 0xFE, 0x40, 0x19, 0xD3, 0xBC, 0xB0, 0x1A, 0xF1, 0xC4, 0x20, 0x1B, 0xAA, 0x64, 0x30, -0x1C, 0xD1, 0xA6, 0x20, 0x1D, 0x8A, 0x46, 0x30, 0x1E, 0xA8, 0x5B, 0xB0, 0x1F, 0x6A, 0x36, 0x40, -0x20, 0x88, 0x3D, 0xB0, 0x21, 0x4A, 0x18, 0x40, 0x22, 0x68, 0x1F, 0xB0, 0x23, 0x29, 0xFA, 0x40, -0x24, 0x48, 0x01, 0xB0, 0x25, 0x09, 0xDC, 0x40, 0x26, 0x31, 0x1E, 0x30, 0x26, 0xE9, 0xBE, 0x40, -0x28, 0x11, 0x00, 0x30, 0x28, 0xD2, 0xDA, 0xC0, 0x29, 0xF0, 0xE2, 0x30, 0x2A, 0xB2, 0xBC, 0xC0, -0x2B, 0xD0, 0xC4, 0x30, 0x2C, 0x92, 0x9E, 0xC0, 0x2D, 0xB0, 0xA6, 0x30, 0x2E, 0x72, 0x80, 0xC0, -0x2F, 0x90, 0x88, 0x30, 0x30, 0x52, 0x62, 0xC0, 0x31, 0x79, 0xA4, 0xB0, 0x32, 0x3B, 0x7F, 0x40, -0x33, 0x59, 0x86, 0xB0, 0x34, 0x1B, 0x61, 0x40, 0x35, 0x39, 0x68, 0xB0, 0x35, 0xFB, 0x43, 0x40, -0x37, 0x19, 0x4A, 0xB0, 0x37, 0xDB, 0x25, 0x40, 0x38, 0xF9, 0x2C, 0xB0, 0x39, 0xBB, 0x07, 0x40, -0x3A, 0xD9, 0x2A, 0xD0, 0x3B, 0x91, 0xCA, 0xE0, 0x3C, 0xC2, 0x47, 0x50, 0x3D, 0x71, 0xAC, 0xE0, -0x3E, 0xA2, 0x29, 0x50, 0x3F, 0x5A, 0xC9, 0x60, 0x40, 0x82, 0x0B, 0x50, 0x41, 0x3A, 0xAB, 0x60, -0x42, 0x61, 0xED, 0x50, 0x43, 0x1A, 0x8D, 0x60, 0x44, 0x41, 0xCF, 0x50, 0x44, 0xFA, 0x6F, 0x60, -0x46, 0x21, 0xB1, 0x50, 0x46, 0xDA, 0x51, 0x60, 0x48, 0x0A, 0xCD, 0xD0, 0x48, 0xC3, 0x6D, 0xE0, -0x49, 0xEA, 0xAF, 0xD0, 0x4A, 0xA3, 0x4F, 0xE0, 0x4B, 0xCA, 0x91, 0xD0, 0x4C, 0x83, 0x31, 0xE0, -0x4D, 0xAA, 0x73, 0xD0, 0x4E, 0x63, 0x13, 0xE0, 0x4F, 0x8A, 0x55, 0xD0, 0x50, 0x42, 0xF5, 0xE0, -0x51, 0x73, 0x72, 0x50, 0x52, 0x22, 0xD7, 0xE0, 0x53, 0x53, 0x54, 0x50, 0x54, 0x0B, 0xF4, 0x60, -0x55, 0x33, 0x36, 0x50, 0x55, 0xEB, 0xD6, 0x60, 0x57, 0x13, 0x18, 0x50, 0x57, 0xCB, 0xB8, 0x60, -0x58, 0xF2, 0xFA, 0x50, 0x59, 0xAB, 0x9A, 0x60, 0x5A, 0xD2, 0xDC, 0x50, 0x5B, 0x8B, 0x7C, 0x60, -0x5C, 0xBB, 0xF8, 0xD0, 0x5D, 0x6B, 0x5E, 0x60, 0x5E, 0x9B, 0xDA, 0xD0, 0x5F, 0x54, 0x7A, 0xE0, -0x60, 0x7B, 0xBC, 0xD0, 0x61, 0x34, 0x5C, 0xE0, 0x62, 0x5B, 0x9E, 0xD0, 0x63, 0x14, 0x3E, 0xE0, -0x64, 0x3B, 0x80, 0xD0, 0x64, 0xF4, 0x20, 0xE0, 0x66, 0x24, 0x9D, 0x50, 0x66, 0xD4, 0x02, 0xE0, -0x68, 0x04, 0x7F, 0x50, 0x68, 0xBD, 0x1F, 0x60, 0x69, 0xE4, 0x61, 0x50, 0x6A, 0x9D, 0x01, 0x60, -0x6B, 0xC4, 0x43, 0x50, 0x6C, 0x7C, 0xE3, 0x60, 0x6D, 0xA4, 0x25, 0x50, 0x6E, 0x5C, 0xC5, 0x60, -0x6F, 0x84, 0x07, 0x50, 0x70, 0x3C, 0xA7, 0x60, 0x71, 0x6D, 0x23, 0xD0, 0x72, 0x1C, 0x89, 0x60, -0x73, 0x4D, 0x05, 0xD0, 0x74, 0x05, 0xA5, 0xE0, 0x75, 0x2C, 0xE7, 0xD0, 0x75, 0xE5, 0x87, 0xE0, -0x77, 0x0C, 0xC9, 0xD0, 0x77, 0xC5, 0x69, 0xE0, 0x78, 0xEC, 0xAB, 0xD0, 0x79, 0xA5, 0x4B, 0xE0, -0x7A, 0xCC, 0x8D, 0xD0, 0x7B, 0x85, 0x2D, 0xE0, 0x7C, 0xB5, 0xAA, 0x50, 0x7D, 0x6E, 0x4A, 0x60, -0x7E, 0x95, 0x8C, 0x50, 0x7F, 0x4E, 0x2C, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC9, 0xC4, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x53, 0x4D, 0x54, 0x00, 0x46, 0x4B, 0x53, 0x54, 0x00, 0x46, 0x4B, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/St_Helena */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x42, 0x9B, 0x58, -0x01, 0xFF, 0xFF, 0xFA, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4A, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Australia/ACT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Adelaide */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08, -0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08, -0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88, -0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88, -0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, 0x4A, 0xE3, 0x2B, 0x88, -0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, 0x4E, 0xAC, 0x2A, 0x08, -0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, 0x52, 0x6B, 0xEE, 0x08, -0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, 0x56, 0x2B, 0xB2, 0x08, -0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, 0x59, 0xF4, 0xB0, 0x88, -0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, 0x5D, 0xB4, 0x74, 0x88, -0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, 0x61, 0x7D, 0x73, 0x08, -0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, 0x65, 0x3D, 0x37, 0x08, -0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, 0x68, 0xFC, 0xFB, 0x08, -0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, 0x6C, 0xC5, 0xF9, 0x88, -0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, 0x70, 0x85, 0xBD, 0x88, -0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, 0x74, 0x45, 0x81, 0x88, -0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, 0x78, 0x0E, 0x80, 0x08, -0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, 0x7B, 0xCE, 0x44, 0x08, -0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, 0x7F, 0x8E, 0x08, 0x08, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93, -0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, -0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Brisbane */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, -0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, -0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - - -/* Australia/Broken_Hill */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, -0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, -0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, -0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, -0x47, 0x23, 0x67, 0x88, 0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, -0x4A, 0xE3, 0x2B, 0x88, 0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, -0x4E, 0xAC, 0x2A, 0x08, 0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, -0x52, 0x6B, 0xEE, 0x08, 0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, -0x56, 0x2B, 0xB2, 0x08, 0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, -0x59, 0xF4, 0xB0, 0x88, 0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, -0x5D, 0xB4, 0x74, 0x88, 0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, -0x61, 0x7D, 0x73, 0x08, 0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, -0x65, 0x3D, 0x37, 0x08, 0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, -0x68, 0xFC, 0xFB, 0x08, 0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, -0x6C, 0xC5, 0xF9, 0x88, 0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, -0x70, 0x85, 0xBD, 0x88, 0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, -0x74, 0x45, 0x81, 0x88, 0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, -0x78, 0x0E, 0x80, 0x08, 0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, -0x7B, 0xCE, 0x44, 0x08, 0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, -0x7F, 0x8E, 0x08, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, -0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Canberra */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Currie */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, -0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Darwin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, -0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Hobart */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00, -0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00, -0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/LHI */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0, -0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68, -0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68, -0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70, -0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0, -0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0, -0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70, -0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70, -0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70, -0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70, -0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0, -0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0, -0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0, -0x47, 0x23, 0x59, 0x78, 0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x3B, 0x78, 0x49, 0xCE, 0x3B, 0x70, -0x4A, 0xE3, 0x1D, 0x78, 0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x39, 0xF8, 0x4D, 0x8D, 0xFF, 0x70, -0x4E, 0xAC, 0x1B, 0xF8, 0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xFD, 0xF8, 0x51, 0x56, 0xFD, 0xF0, -0x52, 0x6B, 0xDF, 0xF8, 0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xC1, 0xF8, 0x55, 0x16, 0xC1, 0xF0, -0x56, 0x2B, 0xA3, 0xF8, 0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xC0, 0x78, 0x58, 0xD6, 0x85, 0xF0, -0x59, 0xF4, 0xA2, 0x78, 0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x84, 0x78, 0x5C, 0x9F, 0x84, 0x70, -0x5D, 0xB4, 0x66, 0x78, 0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x48, 0x78, 0x60, 0x5F, 0x48, 0x70, -0x61, 0x7D, 0x64, 0xF8, 0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x46, 0xF8, 0x64, 0x1F, 0x0C, 0x70, -0x65, 0x3D, 0x28, 0xF8, 0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x0A, 0xF8, 0x67, 0xE8, 0x0A, 0xF0, -0x68, 0xFC, 0xEC, 0xF8, 0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xCE, 0xF8, 0x6B, 0xA7, 0xCE, 0xF0, -0x6C, 0xC5, 0xEB, 0x78, 0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xCD, 0x78, 0x6F, 0x67, 0x92, 0xF0, -0x70, 0x85, 0xAF, 0x78, 0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x91, 0x78, 0x73, 0x30, 0x91, 0x70, -0x74, 0x45, 0x73, 0x78, 0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x8F, 0xF8, 0x76, 0xF0, 0x55, 0x70, -0x78, 0x0E, 0x71, 0xF8, 0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x53, 0xF8, 0x7A, 0xB0, 0x19, 0x70, -0x7B, 0xCE, 0x35, 0xF8, 0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x17, 0xF8, 0x7E, 0x79, 0x17, 0xF0, -0x7F, 0x8D, 0xF9, 0xF8, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, -0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53, -0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Lindeman */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x2A, 0x50, 0x68, 0xE0, -0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, 0x2D, 0x78, 0xAC, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Lord_Howe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0, -0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68, -0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68, -0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70, -0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0, -0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0, -0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70, -0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70, -0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70, -0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70, -0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0, -0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0, -0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0, -0x47, 0x23, 0x59, 0x78, 0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x3B, 0x78, 0x49, 0xCE, 0x3B, 0x70, -0x4A, 0xE3, 0x1D, 0x78, 0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x39, 0xF8, 0x4D, 0x8D, 0xFF, 0x70, -0x4E, 0xAC, 0x1B, 0xF8, 0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xFD, 0xF8, 0x51, 0x56, 0xFD, 0xF0, -0x52, 0x6B, 0xDF, 0xF8, 0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xC1, 0xF8, 0x55, 0x16, 0xC1, 0xF0, -0x56, 0x2B, 0xA3, 0xF8, 0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xC0, 0x78, 0x58, 0xD6, 0x85, 0xF0, -0x59, 0xF4, 0xA2, 0x78, 0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x84, 0x78, 0x5C, 0x9F, 0x84, 0x70, -0x5D, 0xB4, 0x66, 0x78, 0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x48, 0x78, 0x60, 0x5F, 0x48, 0x70, -0x61, 0x7D, 0x64, 0xF8, 0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x46, 0xF8, 0x64, 0x1F, 0x0C, 0x70, -0x65, 0x3D, 0x28, 0xF8, 0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x0A, 0xF8, 0x67, 0xE8, 0x0A, 0xF0, -0x68, 0xFC, 0xEC, 0xF8, 0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xCE, 0xF8, 0x6B, 0xA7, 0xCE, 0xF0, -0x6C, 0xC5, 0xEB, 0x78, 0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xCD, 0x78, 0x6F, 0x67, 0x92, 0xF0, -0x70, 0x85, 0xAF, 0x78, 0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x91, 0x78, 0x73, 0x30, 0x91, 0x70, -0x74, 0x45, 0x73, 0x78, 0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x8F, 0xF8, 0x76, 0xF0, 0x55, 0x70, -0x78, 0x0E, 0x71, 0xF8, 0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x53, 0xF8, 0x7A, 0xB0, 0x19, 0x70, -0x7B, 0xCE, 0x35, 0xF8, 0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x17, 0xF8, 0x7E, 0x79, 0x17, 0xF0, -0x7F, 0x8D, 0xF9, 0xF8, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, -0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53, -0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Melbourne */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/North */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, -0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Australia/NSW */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Perth */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC, -0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0, -0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0, -0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, -0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Queensland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, -0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, -0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - - -/* Australia/South */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08, -0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08, -0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88, -0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88, -0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, 0x4A, 0xE3, 0x2B, 0x88, -0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, 0x4E, 0xAC, 0x2A, 0x08, -0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, 0x52, 0x6B, 0xEE, 0x08, -0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, 0x56, 0x2B, 0xB2, 0x08, -0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, 0x59, 0xF4, 0xB0, 0x88, -0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, 0x5D, 0xB4, 0x74, 0x88, -0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, 0x61, 0x7D, 0x73, 0x08, -0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, 0x65, 0x3D, 0x37, 0x08, -0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, 0x68, 0xFC, 0xFB, 0x08, -0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, 0x6C, 0xC5, 0xF9, 0x88, -0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, 0x70, 0x85, 0xBD, 0x88, -0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, 0x74, 0x45, 0x81, 0x88, -0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, 0x78, 0x0E, 0x80, 0x08, -0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, 0x7B, 0xCE, 0x44, 0x08, -0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, 0x7F, 0x8E, 0x08, 0x08, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93, -0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, -0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Sydney */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/Tasmania */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00, -0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00, -0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Victoria */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, - -/* Australia/West */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC, -0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0, -0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0, -0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, -0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Yancowinna */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, -0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, -0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, -0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, -0x47, 0x23, 0x67, 0x88, 0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, -0x4A, 0xE3, 0x2B, 0x88, 0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, -0x4E, 0xAC, 0x2A, 0x08, 0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, -0x52, 0x6B, 0xEE, 0x08, 0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, -0x56, 0x2B, 0xB2, 0x08, 0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, -0x59, 0xF4, 0xB0, 0x88, 0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, -0x5D, 0xB4, 0x74, 0x88, 0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, -0x61, 0x7D, 0x73, 0x08, 0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, -0x65, 0x3D, 0x37, 0x08, 0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, -0x68, 0xFC, 0xFB, 0x08, 0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, -0x6C, 0xC5, 0xF9, 0x88, 0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, -0x70, 0x85, 0xBD, 0x88, 0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, -0x74, 0x45, 0x81, 0x88, 0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, -0x78, 0x0E, 0x80, 0x08, 0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, -0x7B, 0xCE, 0x44, 0x08, 0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, -0x7F, 0x8E, 0x08, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, -0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Brazil/Acre */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0, -0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* Brazil/DeNoronha */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64, -0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10, -0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10, -0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10, -0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90, -0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90, -0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90, -0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90, -0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10, -0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90, -0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Brazil/East */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0, -0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20, -0x45, 0x31, 0xA4, 0x30, 0x45, 0xD7, 0xB3, 0x20, 0x47, 0x1A, 0xC0, 0xB0, 0x47, 0xB7, 0x95, 0x20, -0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0, -0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x40, 0x57, 0xA0, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xDF, 0xFD, 0xA0, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xF1, 0x82, 0xA0, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x91, 0x28, 0xA0, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xA2, 0xAD, 0xA0, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x42, 0x53, 0xA0, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C, -0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* Brazil/West */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Atlantic */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0, -0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, -0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30, -0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0, -0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30, -0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30, -0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30, -0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0, -0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30, -0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30, -0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30, -0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30, -0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0, -0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0, -0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60, -0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60, -0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0, -0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0, -0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60, -0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60, -0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, -0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, -0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0, -0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0, -0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0, -0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60, -0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60, -0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60, -0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0, -0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0, -0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60, -0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60, -0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60, -0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0, -0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0, -0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0, -0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60, -0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* Canada/Central */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0, -0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80, -0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xE2, 0x00, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x00, - -/* Canada/Eastern */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0, -0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0, -0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70, -0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0, -0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70, -0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, -0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, -0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, -0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, -0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, -0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, -0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, -0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, -0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, -0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, -0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, -0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, -0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, -0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, -0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, -0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, - -/* Canada/East-Saskatchewan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* Canada/Mountain */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80, -0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80, -0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, -0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, -0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* Canada/Newfoundland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C, -0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC, -0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C, -0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC, -0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC, -0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC, -0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C, -0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C, -0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC, -0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C, -0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8, -0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8, -0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8, -0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58, -0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58, -0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58, -0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8, -0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8, -0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8, -0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58, -0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4, -0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4, -0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74, -0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74, -0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74, -0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4, -0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4, -0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4, -0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74, -0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74, -0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x46, 0x0F, 0x27, 0x74, -0x47, 0x23, 0xF4, 0x64, 0x47, 0xF8, 0x43, 0xF4, 0x49, 0x03, 0xD6, 0x64, 0x49, 0xD8, 0x25, 0xF4, -0x4A, 0xE3, 0xB8, 0x64, 0x4B, 0xB8, 0x07, 0xF4, 0x4C, 0xCC, 0xD4, 0xE4, 0x4D, 0x97, 0xE9, 0xF4, -0x4E, 0xAC, 0xB6, 0xE4, 0x4F, 0x77, 0xCB, 0xF4, 0x50, 0x8C, 0x98, 0xE4, 0x51, 0x60, 0xE8, 0x74, -0x52, 0x6C, 0x7A, 0xE4, 0x53, 0x40, 0xCA, 0x74, 0x54, 0x4C, 0x5C, 0xE4, 0x55, 0x20, 0xAC, 0x74, -0x56, 0x2C, 0x3E, 0xE4, 0x57, 0x00, 0x8E, 0x74, 0x58, 0x15, 0x5B, 0x64, 0x58, 0xE0, 0x70, 0x74, -0x59, 0xF5, 0x3D, 0x64, 0x5A, 0xC0, 0x52, 0x74, 0x5B, 0xD5, 0x1F, 0x64, 0x5C, 0xA9, 0x6E, 0xF4, -0x5D, 0xB5, 0x01, 0x64, 0x5E, 0x89, 0x50, 0xF4, 0x5F, 0x94, 0xE3, 0x64, 0x60, 0x69, 0x32, 0xF4, -0x61, 0x7D, 0xFF, 0xE4, 0x62, 0x49, 0x14, 0xF4, 0x63, 0x5D, 0xE1, 0xE4, 0x64, 0x28, 0xF6, 0xF4, -0x65, 0x3D, 0xC3, 0xE4, 0x66, 0x12, 0x13, 0x74, 0x67, 0x1D, 0xA5, 0xE4, 0x67, 0xF1, 0xF5, 0x74, -0x68, 0xFD, 0x87, 0xE4, 0x69, 0xD1, 0xD7, 0x74, 0x6A, 0xDD, 0x69, 0xE4, 0x6B, 0xB1, 0xB9, 0x74, -0x6C, 0xC6, 0x86, 0x64, 0x6D, 0x91, 0x9B, 0x74, 0x6E, 0xA6, 0x68, 0x64, 0x6F, 0x71, 0x7D, 0x74, -0x70, 0x86, 0x4A, 0x64, 0x71, 0x5A, 0x99, 0xF4, 0x72, 0x66, 0x2C, 0x64, 0x73, 0x3A, 0x7B, 0xF4, -0x74, 0x46, 0x0E, 0x64, 0x75, 0x1A, 0x5D, 0xF4, 0x76, 0x2F, 0x2A, 0xE4, 0x76, 0xFA, 0x3F, 0xF4, -0x78, 0x0F, 0x0C, 0xE4, 0x78, 0xDA, 0x21, 0xF4, 0x79, 0xEE, 0xEE, 0xE4, 0x7A, 0xBA, 0x03, 0xF4, -0x7B, 0xCE, 0xD0, 0xE4, 0x7C, 0xA3, 0x20, 0x74, 0x7D, 0xAE, 0xB2, 0xE4, 0x7E, 0x83, 0x02, 0x74, -0x7F, 0x8E, 0x94, 0xE4, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF, -0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08, -0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00, -0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* Canada/Pacific */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, -0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, -0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, -0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, -0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, -0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, -0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, -0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, -0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, -0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, -0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, -0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, -0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, -0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, -0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, -0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, -0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, -0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, -0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* Canada/Saskatchewan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* Canada/Yukon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, -0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, -0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, -0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, -0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, -0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, -0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, -0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, -0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, -0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, -0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, -0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, -0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, -0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, -0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, -0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, -0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - -/* CET */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, - -/* Chile/Continental */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC0, -0x9F, 0x71, 0x09, 0x50, 0xA1, 0x01, 0xC3, 0x40, 0xB0, 0x5E, 0x7B, 0xD0, 0xB1, 0x77, 0x3D, 0x40, -0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, 0xB5, 0x39, 0xA4, 0x40, -0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, 0xB8, 0xFD, 0x5C, 0xC0, -0xB9, 0xC7, 0x20, 0x50, 0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, -0xFC, 0x97, 0x69, 0x30, 0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, -0x00, 0x60, 0x67, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, -0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, -0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, -0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, -0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, -0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, -0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, -0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, -0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, -0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, -0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, -0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, -0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, -0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, -0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, -0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, -0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, -0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, -0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, -0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, -0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, -0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, -0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, -0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, -0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, -0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, -0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, -0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, -0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, -0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, -0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, -0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, -0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, -0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xBD, -0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, -0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x09, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* Chile/EasterIsland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88, -0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, 0xFC, 0x97, 0x69, 0x30, -0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, 0x00, 0x60, 0x67, 0xB0, -0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, -0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, 0x07, 0xDF, 0xEF, 0xB0, -0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, -0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, -0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, -0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, -0x16, 0xF1, 0xAC, 0xF0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, -0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, -0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, -0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, -0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, -0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, -0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, -0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, -0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, -0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, -0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, -0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, -0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, -0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, -0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, -0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, -0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, -0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, -0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, -0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, -0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, -0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, -0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, -0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, -0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, -0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, -0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, -0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, -0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x0A, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0x4D, 0x4D, 0x54, 0x00, 0x45, -0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, - -/* CST6CDT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00, -0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00, -0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00, -0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00, -0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80, -0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80, -0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80, -0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00, -0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00, -0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00, -0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80, -0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* Cuba */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80, -0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40, -0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0, -0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0, -0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0, -0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40, -0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0, -0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0, -0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0, -0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0, -0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40, -0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0, -0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40, -0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0, -0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0, -0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0, -0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0, -0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, -0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x43, 0x64, 0x53, 0x50, -0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x17, 0x50, -0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, -0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0, -0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x9D, 0xD0, -0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x61, 0xD0, -0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x60, 0x50, -0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x24, 0x50, -0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x22, 0xD0, -0x62, 0x49, 0x29, 0xD0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xE6, 0xD0, -0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0xAA, 0xD0, -0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0xA9, 0x50, -0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x6D, 0x50, -0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x31, 0x50, -0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x2F, 0xD0, -0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0, -0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xB7, 0xD0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2, -0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0x48, 0x4D, 0x54, 0x00, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, - -/* EET */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01, - -/* Egypt */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0, -0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60, -0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, -0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, -0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, -0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, -0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, -0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70, -0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70, -0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0, -0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0, -0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70, -0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70, -0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0, -0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0, -0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70, -0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70, -0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70, -0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0, -0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70, -0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0, -0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0, -0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60, -0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60, -0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60, -0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, -0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x1C, 0x37, 0xD0, 0x46, 0x31, 0x20, 0xE0, -0x46, 0xFC, 0x19, 0xD0, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xDB, 0xFB, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, -0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, -0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, -0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, -0x59, 0xCD, 0x62, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0xAD, 0x44, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0, -0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x8B, 0x2C, 0x60, -0x61, 0x56, 0x25, 0x50, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x36, 0x07, 0x50, 0x64, 0x4A, 0xF0, 0x60, -0x65, 0x15, 0xE9, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x68, 0x0A, 0xB4, 0x60, -0x68, 0xD5, 0xAD, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xD3, 0xB2, 0xE0, -0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x7E, 0x8D, 0xD0, 0x6F, 0x93, 0x76, 0xE0, -0x70, 0x5E, 0x6F, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x53, 0x3A, 0xE0, -0x74, 0x1E, 0x33, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x76, 0x07, 0x50, 0x50, 0x77, 0x1C, 0x39, 0x60, -0x77, 0xE7, 0x32, 0x50, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xC7, 0x14, 0x50, 0x7A, 0xDB, 0xFD, 0x60, -0x7B, 0xA6, 0xF6, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x9B, 0xC1, 0x60, -0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Eire */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91, -0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00, -0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, -0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, -0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, -0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, -0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, -0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, -0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, -0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, -0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, -0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10, -0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, -0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0, -0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20, -0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20, -0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20, -0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, -0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20, -0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20, -0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0, -0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0, -0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0, -0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01, -0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, - -/* EST */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x8B, 0xF4, 0x61, 0xE8, -0x01, 0xFF, 0xFF, 0xB5, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* EST5EDT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70, -0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0, -0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0, -0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0, -0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0, -0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, -0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0, -0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60, -0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60, -0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0, -0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0, -0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60, -0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60, -0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, -0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, -0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, -0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, -0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x01, - -/* Etc/GMT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Etc/GMT0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Etc/GMT-0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Etc/GMT+0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Etc/GMT-1 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x00, 0x00, 0x00, - -/* Etc/GMT+1 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x00, 0x00, 0x00, - -/* Etc/GMT-10 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x30, 0x00, 0x00, 0x00, - -/* Etc/GMT+10 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x30, 0x00, 0x00, 0x00, - -/* Etc/GMT-11 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x9A, 0xB0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x31, 0x00, 0x00, 0x00, - -/* Etc/GMT+11 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x31, 0x00, 0x00, 0x00, - -/* Etc/GMT-12 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x32, 0x00, 0x00, 0x00, - -/* Etc/GMT+12 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x32, 0x00, 0x00, 0x00, - -/* Etc/GMT-13 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xB6, 0xD0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x33, 0x00, 0x00, 0x00, - -/* Etc/GMT-14 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xC4, 0xE0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x34, 0x00, 0x00, 0x00, - -/* Etc/GMT-2 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x32, 0x00, 0x00, 0x00, - -/* Etc/GMT+2 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xE3, 0xE0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x32, 0x00, 0x00, 0x00, - -/* Etc/GMT-3 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x2A, 0x30, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x33, 0x00, 0x00, 0x00, - -/* Etc/GMT+3 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x33, 0x00, 0x00, 0x00, - -/* Etc/GMT-4 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x38, 0x40, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x34, 0x00, 0x00, 0x00, - -/* Etc/GMT+4 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x34, 0x00, 0x00, 0x00, - -/* Etc/GMT-5 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x46, 0x50, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x35, 0x00, 0x00, 0x00, - -/* Etc/GMT+5 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x35, 0x00, 0x00, 0x00, - -/* Etc/GMT-6 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x54, 0x60, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x36, 0x00, 0x00, 0x00, - -/* Etc/GMT+6 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x36, 0x00, 0x00, 0x00, - -/* Etc/GMT-7 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x62, 0x70, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x37, 0x00, 0x00, 0x00, - -/* Etc/GMT+7 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x37, 0x00, 0x00, 0x00, - -/* Etc/GMT-8 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x70, 0x80, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x38, 0x00, 0x00, 0x00, - -/* Etc/GMT+8 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x8F, 0x80, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x38, 0x00, 0x00, 0x00, - -/* Etc/GMT-9 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x39, 0x00, 0x00, 0x00, - -/* Etc/GMT+9 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x81, 0x70, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x39, 0x00, 0x00, 0x00, - -/* Etc/Greenwich */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Etc/UCT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00, - -/* Etc/Universal */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, - -/* Etc/UTC */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, - -/* Etc/Zulu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, - -/* Europe/Amsterdam */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x2E, 0xEC, -0x9B, 0xD5, 0xD6, 0x5C, 0x9C, 0xD9, 0xB8, 0x0C, 0x9D, 0xA4, 0xBF, 0x0C, 0x9E, 0xA7, 0x25, 0x0C, -0x9F, 0x97, 0x16, 0x0C, 0xA0, 0x90, 0x41, 0x8C, 0xA1, 0x76, 0xF8, 0x0C, 0xA2, 0x70, 0x23, 0x8C, -0xA3, 0x56, 0xDA, 0x0C, 0xA4, 0x50, 0x05, 0x8C, 0xA5, 0x36, 0xBC, 0x0C, 0xA6, 0x25, 0x5B, 0x8C, -0xA7, 0x27, 0xC1, 0x8C, 0xA8, 0x5E, 0xE3, 0x8C, 0xA9, 0x07, 0xA3, 0x8C, 0xA9, 0xEE, 0x5A, 0x0C, -0xAA, 0xE7, 0x85, 0x8C, 0xAC, 0x27, 0xE2, 0x0C, 0xAC, 0xC7, 0x67, 0x8C, 0xAD, 0xED, 0x66, 0x0C, -0xAE, 0xA7, 0x49, 0x8C, 0xAF, 0xCE, 0x99, 0x8C, 0xB0, 0x87, 0x2B, 0x8C, 0xB1, 0xB1, 0x1E, 0x8C, -0xB2, 0x70, 0x48, 0x0C, 0xB3, 0x92, 0x52, 0x0C, 0xB4, 0x50, 0x2A, 0x0C, 0xB5, 0x73, 0x85, 0x8C, -0xB6, 0x30, 0x0C, 0x0C, 0xB7, 0x54, 0xB9, 0x0C, 0xB8, 0x0F, 0xEE, 0x0C, 0xB9, 0x40, 0x78, 0x8C, -0xB9, 0xEF, 0xD0, 0x0C, 0xBB, 0x18, 0x71, 0x8C, 0xBB, 0xD8, 0xEC, 0x8C, 0xBC, 0xF9, 0xA5, 0x0C, -0xBD, 0xB8, 0xCE, 0x8C, 0xBE, 0xDA, 0xD8, 0x8C, 0xBF, 0x98, 0xB0, 0x8C, 0xC0, 0xBD, 0x5D, 0x8C, -0xC1, 0x78, 0x92, 0x8C, 0xC2, 0xA7, 0xCB, 0x8C, 0xC2, 0xDC, 0x5D, 0x5C, 0xC3, 0x58, 0x74, 0x70, -0xC4, 0x7F, 0xC4, 0x70, 0xC5, 0x38, 0x56, 0x70, 0xC6, 0x60, 0xF7, 0xF0, 0xC7, 0x21, 0x72, 0xF0, -0xC8, 0x44, 0xB2, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x09, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x0C, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x00, 0x00, 0x12, 0xA4, 0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x12, 0xA4, -0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x08, 0x00, 0x00, -0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x15, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x4E, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x45, 0x54, 0x00, 0x4E, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, -0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, - -/* Europe/Andorra */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0x41, 0xDB, 0x00, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, - - -/* Europe/Athens */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x21, 0x80, -0xB9, 0x7C, 0xE9, 0xE0, 0xB9, 0xC6, 0xAF, 0xD0, 0xC9, 0xF2, 0x63, 0xE0, 0xCA, 0x10, 0xA8, 0x50, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xAA, 0x4C, 0xF0, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0x93, 0x69, 0x70, -0xDF, 0x13, 0x9E, 0x60, 0xDF, 0xB7, 0x0A, 0x50, 0x09, 0xEC, 0x5E, 0x60, 0x0B, 0x18, 0xF4, 0x60, -0x0B, 0xCD, 0xAE, 0x00, 0x0C, 0xBD, 0x9F, 0x00, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8C, 0x5D, 0x80, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x6A, 0xFC, 0x10, 0x11, 0x64, 0x7B, 0xF0, 0x12, 0x52, 0xAA, 0xF0, -0x13, 0x46, 0x82, 0x60, 0x14, 0x33, 0xC2, 0x50, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x02, 0x01, 0x02, 0x01, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x16, 0x3C, 0x00, 0x00, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x41, -0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, -0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Belfast */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* Europe/Belgrade */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Berlin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0E, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD1, 0xB6, 0x96, 0x00, 0xD2, 0x58, 0xBE, 0x80, 0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x63, 0x1B, 0x90, -0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x39, 0xC3, 0x10, 0xD5, 0x67, 0xE7, 0x90, 0xD5, 0xA8, 0x73, 0x00, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90, -0xD9, 0xE9, 0x78, 0x10, 0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x00, 0x03, 0x02, 0x03, 0x02, 0x05, 0x00, 0x03, 0x02, 0x03, -0x02, 0x03, 0x01, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, -0x43, 0x45, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Bratislava */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10, -0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10, -0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Brussels */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x12, 0x98, 0x44, 0x49, 0x80, -0x9B, 0x0C, 0x25, 0x70, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xCE, 0xF8, 0x30, 0xA0, 0x60, 0xA5, 0xF0, -0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, -0xA5, 0x5E, 0x23, 0x70, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x2A, 0x01, 0xF0, -0xA9, 0x07, 0x7D, 0xF0, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, -0xAC, 0xC7, 0x41, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, -0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, -0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, -0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20, -0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0, -0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20, -0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, -0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x4A, 0x19, 0x20, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x5B, 0xBF, 0x60, -0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10, -0xD4, 0x4B, 0x23, 0x90, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, -0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x04, 0x01, 0x02, 0x03, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, -0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - -/* Europe/Bucharest */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0xB7, 0xB0, 0xD2, 0x08, -0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, 0xBB, 0xCF, 0x7E, 0x60, -0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, 0xBF, 0x98, 0x7C, 0xE0, -0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, 0xC3, 0x58, 0x40, 0xE0, -0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, 0xC7, 0x18, 0x04, 0xE0, -0x11, 0xAD, 0xD1, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x0B, 0xD0, 0x14, 0x33, 0xD0, 0x60, -0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80, 0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, -0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, -0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, -0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, -0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, -0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x24, 0xA0, 0xE0, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, -0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x00, 0x00, 0x18, 0x78, 0x00, 0x00, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Budapest */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0x30, 0x58, 0x70, -0x9E, 0xA7, 0x29, 0xA0, 0x9F, 0x95, 0xBB, 0x10, 0xA0, 0x9A, 0xD2, 0x20, 0xA1, 0x64, 0x79, 0x90, -0xA2, 0x70, 0x28, 0x20, 0xA3, 0x5A, 0xC5, 0x10, 0xC9, 0xF1, 0x3C, 0x90, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, -0xD1, 0x99, 0x78, 0xE0, 0xD2, 0x8D, 0x5E, 0x60, 0xD3, 0x50, 0xA6, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x39, 0xC3, 0x10, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x19, 0xA5, 0x10, 0xD8, 0x09, 0x96, 0x10, -0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0xDA, 0xED, 0x2F, 0x90, 0xDB, 0xE6, 0x5B, 0x10, -0xE2, 0xA2, 0xA8, 0xF0, 0xE3, 0x51, 0xF2, 0x60, 0xE4, 0x83, 0xDC, 0x70, 0xE5, 0x33, 0x25, 0xE0, -0xE6, 0x74, 0xE1, 0xF0, 0xE7, 0x11, 0xB6, 0x60, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xC2, 0x90, -0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x02, 0x03, 0x02, -0x03, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x43, 0x45, 0x53, -0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, - -/* Europe/Chisinau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C, -0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, -0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, -0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, -0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, -0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08, -0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00, -0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, -0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, -0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, - -/* Europe/Copenhagen */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60, -0x9B, 0xD5, 0xBE, 0xD0, 0xC8, 0x43, 0x57, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x24, 0x10, 0x90, 0xD3, 0x79, 0x85, 0x10, 0xD4, 0x1B, 0xAD, 0x90, 0xD5, 0x5E, 0xAD, 0x10, -0xD5, 0xDF, 0xE0, 0x10, 0xD7, 0x47, 0xC9, 0x90, 0xD7, 0xBF, 0xC2, 0x10, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Dublin */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91, -0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00, -0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, -0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, -0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, -0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, -0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, -0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, -0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, -0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, -0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, -0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10, -0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, -0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0, -0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20, -0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20, -0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20, -0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, -0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20, -0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20, -0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0, -0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0, -0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0, -0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01, -0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Gibraltar */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x01, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Helsinki */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18, -0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Istanbul */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* Europe/Kaliningrad */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, -0xD1, 0x95, 0x84, 0x60, 0xD2, 0x8A, 0xAD, 0x50, 0xD2, 0xDB, 0x26, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, -0x28, 0xE5, 0x17, 0x80, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xEA, 0x80, -0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, -0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, -0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, -0x38, 0x1B, 0x86, 0x80, 0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, -0x3B, 0xDB, 0x4A, 0x80, 0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, -0x3F, 0x9B, 0x0E, 0x80, 0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, -0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, -0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, -0x4A, 0xE3, 0x95, 0x00, 0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, -0x4E, 0xAC, 0x93, 0x80, 0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, -0x52, 0x6C, 0x57, 0x80, 0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, -0x56, 0x2C, 0x1B, 0x80, 0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, -0x59, 0xF5, 0x1A, 0x00, 0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, -0x5D, 0xB4, 0xDE, 0x00, 0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, -0x61, 0x7D, 0xDC, 0x80, 0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, -0x65, 0x3D, 0xA0, 0x80, 0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, -0x68, 0xFD, 0x64, 0x80, 0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, -0x6C, 0xC6, 0x63, 0x00, 0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, -0x70, 0x86, 0x27, 0x00, 0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, -0x74, 0x45, 0xEB, 0x00, 0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, -0x78, 0x0E, 0xE9, 0x80, 0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, -0x7B, 0xCE, 0xAD, 0x80, 0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, -0x7F, 0x8E, 0x71, 0x80, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x05, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, -0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, -0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, -0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Europe/Kiev */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA7, 0x64, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xCD, 0x2E, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xCD, 0xA8, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06, -0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, -0x00, 0x1C, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, -0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, -0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Lisbon */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10, -0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70, -0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70, -0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0, -0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, -0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, -0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, -0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, -0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, -0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70, -0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0, -0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60, -0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0, -0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0, -0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20, -0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0, -0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20, -0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0, -0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0, -0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, -0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7, -0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, -0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - - -/* Europe/Ljubljana */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/London */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* Europe/Luxembourg */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x16, 0x84, 0xA2, 0xAD, 0xBC, -0x9B, 0x1E, 0x8C, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xEA, 0xA7, 0xE0, 0x9D, 0xA4, 0x99, 0x70, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xE0, 0xC4, 0x70, 0xA0, 0x60, 0xA5, 0xF0, -0xA1, 0x7E, 0xE5, 0xA0, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x69, 0x10, 0xA4, 0x35, 0x81, 0xF0, -0xA5, 0x5E, 0x3F, 0x90, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0xAA, 0x00, 0xA8, 0x2A, 0x01, 0xF0, -0xA9, 0x07, 0x9A, 0x10, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x6E, 0x00, 0xAB, 0xD8, 0xA2, 0x70, -0xAC, 0xC7, 0x50, 0x00, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x32, 0x00, 0xAF, 0xA0, 0x4F, 0x70, -0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x30, 0x80, 0xB3, 0x72, 0x88, 0x70, -0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, -0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20, -0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0, -0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20, -0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, -0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x42, 0x30, 0x20, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6F, 0xB0, 0x10, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10, 0xD4, 0x4B, 0x23, 0x90, -0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x0B, -0x09, 0x0A, 0x09, 0x0A, 0x02, 0x03, 0x04, 0x03, 0x04, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x05, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, -0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Madrid */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA3, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x9C, 0xF3, 0xF0, 0x70, -0x9D, 0xBE, 0xF7, 0x70, 0x9E, 0xBA, 0xC5, 0xF0, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x8E, 0xCA, 0x70, -0xA1, 0x81, 0x5E, 0x70, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, -0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, -0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xC2, 0xA8, 0xF7, 0x70, -0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x39, 0xBF, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, -0xC7, 0x21, 0x4D, 0x70, 0xC7, 0xF5, 0x8E, 0xF0, 0xCB, 0xF5, 0xDE, 0x60, 0xCC, 0x96, 0xB5, 0x60, -0xCD, 0xC3, 0x4B, 0x60, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0xA3, 0x2D, 0x60, 0xD0, 0x8D, 0xD8, 0x60, -0xD1, 0x83, 0x0F, 0x60, 0xD2, 0x60, 0x99, 0x70, 0xD3, 0x62, 0xF1, 0x60, 0xD4, 0x41, 0xBE, 0xE0, -0xD9, 0x1E, 0x46, 0xE0, 0xD9, 0xE6, 0xB8, 0xF0, 0x08, 0x0D, 0xCD, 0xE0, 0x08, 0xF4, 0x92, 0x70, -0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xD4, 0x74, 0x70, 0x0B, 0xBB, 0x1C, 0xE0, 0x0C, 0xAB, 0x1B, 0xF0, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xFD, 0xF0, 0x0F, 0x85, 0x6C, 0xE0, 0x10, 0x74, 0x1A, 0x70, -0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, -0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x03, 0x02, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x0E, 0x10, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x09, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x57, 0x45, 0x53, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, - -/* Europe/Malta */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1D, 0xF7, 0x70, -0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, 0xF9, 0x33, 0xB5, 0xF0, -0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, 0xFC, 0xFC, 0xB4, 0x70, -0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, 0x00, 0xC5, 0xB2, 0xF0, -0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, 0x04, 0x85, 0x76, 0xF0, -0x05, 0x2B, 0x85, 0xE0, 0x06, 0x1A, 0x33, 0x70, 0x07, 0x0A, 0x24, 0x70, 0x08, 0x17, 0x16, 0x70, -0x08, 0xDA, 0x34, 0x70, 0x09, 0xF7, 0x14, 0x90, 0x0A, 0xC2, 0x0D, 0x80, 0x0B, 0xD6, 0xF6, 0x90, -0x0C, 0xA1, 0xEF, 0x80, 0x0D, 0xB6, 0xD8, 0x90, 0x0E, 0x81, 0xD1, 0x80, 0x0F, 0x96, 0xBA, 0x90, -0x10, 0x61, 0xB3, 0x80, 0x11, 0x76, 0x9C, 0x90, 0x12, 0x41, 0x95, 0x80, 0x13, 0x45, 0x5B, 0x10, -0x14, 0x2A, 0xB2, 0x00, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Mariehamn */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18, -0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Minsk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xAA, 0x38, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, -0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, -0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00, -0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, 0x38, 0x1B, 0x86, 0x80, -0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, 0x3B, 0xDB, 0x4A, 0x80, -0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, 0x3F, 0x9B, 0x0E, 0x80, -0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00, -0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00, -0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00, -0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x4E, 0xAC, 0x93, 0x80, -0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, 0x52, 0x6C, 0x57, 0x80, -0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, 0x56, 0x2C, 0x1B, 0x80, -0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, 0x59, 0xF5, 0x1A, 0x00, -0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, 0x5D, 0xB4, 0xDE, 0x00, -0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, 0x61, 0x7D, 0xDC, 0x80, -0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, 0x65, 0x3D, 0xA0, 0x80, -0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, 0x68, 0xFD, 0x64, 0x80, -0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, 0x6C, 0xC6, 0x63, 0x00, -0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, 0x70, 0x86, 0x27, 0x00, -0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, 0x74, 0x45, 0xEB, 0x00, -0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, 0x78, 0x0E, 0xE9, 0x80, -0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, 0x7B, 0xCE, 0xAD, 0x80, -0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, 0x7F, 0x8E, 0x71, 0x80, -0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, -0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Monaco */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x4F, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70, -0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0, -0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0, -0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, -0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, -0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0, -0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, -0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, -0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, -0xC7, 0xDA, 0x09, 0xA0, 0xCA, 0x17, 0x5B, 0xF0, 0xCA, 0xE2, 0x54, 0xE0, 0xCB, 0xAD, 0x69, 0xF0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x89, 0xF1, 0xF0, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00, -0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x05, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x06, 0x07, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, -0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00, -0x0E, 0x10, 0x00, 0x17, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x17, -0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, -0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Moscow */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8, -0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18, -0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0, -0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50, -0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, -0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, -0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, -0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, -0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, -0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, -0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, -0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, -0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, -0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, -0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, -0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, -0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70, -0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70, -0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70, -0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0, -0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0, -0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70, -0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70, -0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70, -0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0, -0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0, -0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0, -0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70, -0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70, -0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70, -0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23, -0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, -0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, -0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Nicosia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8, -0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0, -0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50, -0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50, -0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0, -0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0, -0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0, -0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50, -0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0, -0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Oslo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Paris */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x8B, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70, -0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0, -0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0, -0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, -0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, -0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0, -0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, -0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, -0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, -0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x6C, 0x27, 0xE0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4F, 0xE1, 0xE0, 0xD0, 0x89, 0xF1, 0xF0, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00, 0x0C, 0xAB, 0x1B, 0xF0, -0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, -0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x08, -0x03, 0x08, 0x09, 0x07, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, -0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x4D, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Prague */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10, -0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10, -0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Riga */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x22, 0x9E, 0xB9, 0x88, 0x08, -0x9F, 0x84, 0x8F, 0x08, 0xA0, 0x88, 0x46, 0x88, 0xA0, 0xCB, 0x83, 0x08, 0xAD, 0xE7, 0xF1, 0xE8, -0xC8, 0xAF, 0x64, 0x60, 0xCA, 0x62, 0x65, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0x90, 0x89, 0x70, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, -0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, -0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x4D, 0xBC, 0x00, -0x32, 0xE3, 0xEA, 0xE0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xBA, 0xEF, 0xE0, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x06, 0x04, -0x05, 0x04, 0x05, 0x04, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x02, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x16, 0x98, 0x00, 0x00, 0x00, 0x00, 0x24, -0xA8, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, 0x00, 0x38, -0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x52, 0x4D, 0x54, 0x00, 0x4C, -0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, -0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Rome */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Samara */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x00, 0x26, 0x9C, -0xB5, 0xA4, 0x0B, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, -0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x00, 0xC7, 0x00, -0x29, 0xD4, 0xC2, 0x30, 0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x83, 0x60, -0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, -0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, -0x38, 0xDD, 0x36, 0xE0, 0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, -0x3C, 0xA6, 0x35, 0x60, 0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, -0x40, 0x65, 0xF9, 0x60, 0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xF0, 0xE0, -0x44, 0x25, 0xBD, 0x60, 0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xB4, 0xE0, -0x47, 0xEE, 0xBB, 0xE0, 0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x78, 0xE0, -0x4B, 0xAE, 0x7F, 0xE0, 0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x77, 0x60, -0x4F, 0x6E, 0x43, 0xE0, 0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x3B, 0x60, -0x53, 0x37, 0x42, 0x60, 0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xFF, 0x60, -0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xFD, 0xE0, -0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xC1, 0xE0, -0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xC0, 0x60, -0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x84, 0x60, -0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x48, 0x60, -0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x46, 0xE0, -0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x86, 0x0A, 0xE0, -0x71, 0x51, 0x11, 0xE0, 0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xCE, 0xE0, -0x75, 0x10, 0xD5, 0xE0, 0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xCD, 0x60, -0x78, 0xD0, 0x99, 0xE0, 0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x91, 0x60, -0x7C, 0x99, 0x98, 0x60, 0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x55, 0x60, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x08, 0x07, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, -0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, -0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x55, 0x59, -0x54, 0x00, 0x4B, 0x55, 0x59, 0x53, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x53, 0x41, -0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Europe/San_Marino */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Sarajevo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Simferopol */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA4, 0x20, -0xB5, 0xA4, 0x19, 0x60, 0xCB, 0x04, 0x8D, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xCF, 0x9F, 0x38, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2D, 0xC2, 0xC6, 0xD0, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0xA0, 0xD0, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x32, 0xC9, 0x7E, 0xD0, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, -0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x06, 0x02, 0x06, 0x02, 0x06, 0x08, 0x07, -0x02, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x53, 0x4D, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* Europe/Skopje */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Sofia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, -0xD1, 0x72, 0x24, 0x20, 0x11, 0x63, 0xEF, 0x50, 0x12, 0x55, 0x3F, 0xE0, 0x13, 0x4D, 0x0B, 0xD0, -0x14, 0x35, 0x21, 0xE0, 0x15, 0x2C, 0xED, 0xD0, 0x16, 0x13, 0xC0, 0x70, 0x17, 0x0C, 0xCF, 0xD0, -0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, -0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, -0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, -0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, -0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, -0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x45, 0x45, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, -0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Stockholm */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, - -/* Europe/Tallinn */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1E, 0x9E, 0x59, 0x2D, 0xCC, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA1, 0x00, 0x2B, 0x70, 0xA4, 0x73, 0x6F, 0x4C, -0xC8, 0xB0, 0xB5, 0xE0, 0xCA, 0xC6, 0x97, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x74, 0xCB, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x26, 0x80, -0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80, -0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, -0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, -0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x06, 0xBE, 0x50, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0x1C, 0xBB, 0xE0, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x00, -0x04, 0x05, 0x06, 0x02, 0x01, 0x02, 0x01, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0E, 0x0C, 0x0D, 0x0C, 0x04, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x00, 0x00, 0x17, 0x34, 0x00, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00, -0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x19, 0x54, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* Europe/Tirane */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x34, 0x68, -0xC8, 0x6D, 0x87, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xB8, 0xE9, 0x90, -0x08, 0x28, 0x39, 0xF0, 0x08, 0xEF, 0x3E, 0x60, 0x0A, 0x05, 0x78, 0xF0, 0x0A, 0xD0, 0x71, 0xE0, -0x0B, 0xE9, 0x4F, 0x70, 0x0C, 0xB4, 0x48, 0x60, 0x0D, 0xD2, 0x6B, 0xF0, 0x0E, 0x94, 0x2A, 0x60, -0x0F, 0xB0, 0xFC, 0x70, 0x10, 0x74, 0x0C, 0x60, 0x11, 0x90, 0xDE, 0x70, 0x12, 0x53, 0xEE, 0x60, -0x13, 0x70, 0xC0, 0x70, 0x14, 0x3B, 0xB9, 0x60, 0x15, 0x48, 0xB9, 0x70, 0x16, 0x13, 0xB2, 0x60, -0x17, 0x31, 0xD5, 0xF0, 0x17, 0xFC, 0xCE, 0xE0, 0x19, 0x00, 0x94, 0x70, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x12, 0x98, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Tiraspol */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C, -0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, -0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, -0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, -0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, -0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08, -0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00, -0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, -0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, -0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, - -/* Europe/Uzhgorod */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xC8, 0x09, 0x71, 0x90, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x80, 0xA9, 0x60, 0xD0, 0xA1, 0x9E, 0xE0, 0xD1, 0xE5, 0xFD, 0xF0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x27, 0xF5, 0x42, 0xA0, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x05, 0x00, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x11, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53, -0x4B, 0x00, 0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, - -/* Europe/Vaduz */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, - -/* Europe/Vatican */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Vienna */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xA1, 0xF2, 0xBF, 0x70, 0xA2, 0x70, 0x1A, 0x10, 0xA3, 0x44, 0x5B, 0x90, -0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD1, 0x7F, 0x45, 0x10, -0xD2, 0xDB, 0x34, 0xF0, 0xD3, 0x63, 0x1B, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x39, 0xC3, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0x13, 0x4D, 0x27, 0xF0, -0x14, 0x33, 0xD0, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* Europe/Vilnius */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x22, 0x9C, 0x4F, 0x1F, 0x50, -0xA1, 0x85, 0x4A, 0x98, 0xA2, 0xF1, 0x30, 0xF0, 0xA3, 0x66, 0x78, 0x60, 0xC8, 0xAC, 0xCF, 0x70, -0xCA, 0x59, 0x2A, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x30, 0x3D, 0xE0, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, -0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, -0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, -0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00, -0x34, 0xAA, 0xC0, 0x60, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x3E, 0x12, 0x13, 0x60, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x03, 0x02, 0x04, 0x07, 0x05, 0x06, 0x05, 0x06, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, -0x04, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x03, 0x0D, 0x0E, -0x0D, 0x0F, 0x03, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00, 0x00, -0x00, 0x16, 0x68, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x0C, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x57, -0x4D, 0x54, 0x00, 0x4B, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, -0x53, 0x4B, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, - -/* Europe/Warsaw */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00, -0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD1, 0x95, 0x92, 0x70, -0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x5E, 0xAD, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90, -0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, 0xE9, 0xE1, 0xA5, 0x80, -0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, 0xED, 0xAA, 0xA4, 0x00, -0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, 0xF1, 0xB4, 0x3C, 0x00, -0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, 0xF5, 0x7D, 0x3A, 0x80, -0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x0A, 0x80, -0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80, -0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, -0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, -0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, -0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, 0x06, 0x02, 0x01, 0x04, -0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - - -/* Europe/Zagreb */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Zaporozhye */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA3, 0x30, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xAA, 0xE7, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xBD, 0xD6, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE4, 0xED, 0x50, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x01, 0x09, 0x01, 0x09, -0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, -0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x04, 0x43, 0x55, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, -0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - -/* Europe/Zurich */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x24, 0xC7, 0xF0, -0xC9, 0x72, 0x82, 0x60, 0xCA, 0x16, 0x26, 0x90, 0xCA, 0xE1, 0x03, 0x60, 0xCB, 0xF6, 0x08, 0x90, -0xCC, 0xC0, 0xE5, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, - -/* Factory */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x4C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x20, 0x7A, 0x6F, 0x6E, -0x65, 0x20, 0x6D, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2D, 0x2D, 0x73, -0x65, 0x65, 0x20, 0x7A, 0x69, 0x63, 0x20, 0x6D, 0x61, 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x70, 0x61, -0x67, 0x65, 0x00, 0x00, 0x00, - -/* GB */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* GB-Eire */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - -/* GMT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* GMT0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* GMT-0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* GMT+0 */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Greenwich */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, - -/* Hongkong */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC, -0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8, -0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8, -0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8, -0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28, -0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8, -0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8, -0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8, -0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, -0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28, -0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28, -0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, -0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, -0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, -0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28, -0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, -0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, -0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, -0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00, -0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* HST */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48, -0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38, -0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, -0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68, -0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, -0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, - -/* Iceland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94, -0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10, -0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0, -0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20, -0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20, -0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0, -0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0, -0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20, -0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20, -0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0, -0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0, -0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0, -0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20, -0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20, -0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, -0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Antananarivo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4, -0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Chagos */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x89, 0x7E, 0xF7, 0x9C, -0x30, 0xE6, 0xDD, 0xB0, 0x01, 0x02, 0x00, 0x00, 0x43, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x4F, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Christmas */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x00, 0x43, 0x58, 0x54, 0x00, 0x00, 0x00, - -/* Indian/Cocos */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68, -0x00, 0x00, 0x43, 0x43, 0x54, 0x00, 0x00, 0x00, - -/* Indian/Comoro */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0, -0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Kerguelen */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x62, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x54, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Mahe */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x88, 0x64, 0xE6, 0x84, -0x01, 0x00, 0x00, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Maldives */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xED, 0x2F, 0xC3, 0x98, -0x01, 0x00, 0x00, 0x44, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x4D, 0x4D, 0x54, -0x00, 0x4D, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Mauritius */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x89, 0x7F, 0x05, 0x98, -0x01, 0x00, 0x00, 0x35, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x4D, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Mayotte */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18, -0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Reunion */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xCC, 0x39, 0x80, -0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x52, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Iran */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8, -0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30, -0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8, -0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8, -0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8, -0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8, -0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48, -0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48, -0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8, -0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8, -0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x44, 0x20, 0x62, 0x48, -0x45, 0x12, 0xE8, 0x38, 0x46, 0x01, 0x95, 0xC8, 0x46, 0xF4, 0x1B, 0xB8, 0x47, 0xE2, 0xC9, 0x48, -0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8, -0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8, -0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48, -0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48, -0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8, -0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8, -0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48, -0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48, -0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8, -0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8, -0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48, -0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48, -0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8, -0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8, -0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03, -0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04, -0x00, 0x00, 0x31, 0x38, 0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40, -0x00, 0x08, 0x00, 0x00, 0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, -0x49, 0x52, 0x53, 0x54, 0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Israel */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Jamaica */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Japan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70, -0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80, -0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A, -0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Kwajalein */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50, -0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Libya */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24, -0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0, -0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60, -0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0, -0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0, -0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60, -0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C, -0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* MET */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x4D, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, - -/* Mexico/BajaNorte */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00, -0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, -0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, -0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, -0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0, -0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20, -0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20, -0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, -0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, -0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, -0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, -0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, -0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, -0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, -0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, -0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, -0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, -0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, -0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, -0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, -0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, -0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, -0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, -0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, -0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, -0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, -0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, -0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, -0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, -0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, -0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, -0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, -0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, -0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, -0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, -0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02, -0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80, -0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Mexico/BajaSur */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C, -0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Mexico/General */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0, -0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0, -0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80, -0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, -0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, -0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, -0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, -0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, -0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, -0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, -0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, -0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, -0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, -0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, -0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, -0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, -0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, -0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, -0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, -0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* MST */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* MST7MDT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* Navajo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* NZ */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, -0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, -0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, -0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, -0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, -0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, -0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, -0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, -0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, -0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, -0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, -0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, -0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, -0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, -0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, -0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, -0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, -0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, -0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, -0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, -0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, -0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, -0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, -0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, -0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, 0x48, 0xE7, 0x76, 0xE0, -0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, 0x4C, 0xA7, 0x3A, 0xE0, -0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, 0x50, 0x70, 0x39, 0x60, -0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, 0x54, 0x2F, 0xFD, 0x60, -0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, 0x57, 0xEF, 0xC1, 0x60, -0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, 0x5B, 0xB8, 0xBF, 0xE0, -0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, 0x5F, 0x78, 0x83, 0xE0, -0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, 0x63, 0x38, 0x47, 0xE0, -0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, 0x67, 0x01, 0x46, 0x60, -0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, 0x6A, 0xC1, 0x0A, 0x60, -0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, 0x6E, 0x80, 0xCE, 0x60, -0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, 0x72, 0x49, 0xCC, 0xE0, -0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, 0x76, 0x09, 0x90, 0xE0, -0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, 0x79, 0xC9, 0x54, 0xE0, -0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, 0x7D, 0x92, 0x53, 0x60, -0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, -0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* NZ-CHAT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, -0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, -0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, -0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, -0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, -0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, -0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, -0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, -0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, -0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, -0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, -0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, -0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, -0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, -0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, -0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC, -0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00, -0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48, -0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Apia */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x05, 0xFC, 0x00, -0xDA, 0x62, 0x04, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, -0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, -0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Auckland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, -0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, -0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, -0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, -0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, -0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, -0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, -0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, -0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, -0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, -0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, -0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, -0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, -0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, -0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, -0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, -0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, -0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, -0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, -0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, -0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, -0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, -0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, -0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, -0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, 0x48, 0xE7, 0x76, 0xE0, -0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, 0x4C, 0xA7, 0x3A, 0xE0, -0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, 0x50, 0x70, 0x39, 0x60, -0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, 0x54, 0x2F, 0xFD, 0x60, -0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, 0x57, 0xEF, 0xC1, 0x60, -0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, 0x5B, 0xB8, 0xBF, 0xE0, -0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, 0x5F, 0x78, 0x83, 0xE0, -0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, 0x63, 0x38, 0x47, 0xE0, -0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, 0x67, 0x01, 0x46, 0x60, -0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, 0x6A, 0xC1, 0x0A, 0x60, -0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, 0x6E, 0x80, 0xCE, 0x60, -0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, 0x72, 0x49, 0xCC, 0xE0, -0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, 0x76, 0x09, 0x90, 0xE0, -0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, 0x79, 0xC9, 0x54, 0xE0, -0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, 0x7D, 0x92, 0x53, 0x60, -0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, -0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* Pacific/Chatham */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, -0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, -0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, -0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, -0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, -0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, -0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, -0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, -0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, -0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, -0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, -0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, -0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, -0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, -0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, -0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC, -0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00, -0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48, -0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Easter */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88, -0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, 0xFC, 0x97, 0x69, 0x30, -0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, 0x00, 0x60, 0x67, 0xB0, -0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, -0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, 0x07, 0xDF, 0xEF, 0xB0, -0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, -0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, -0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, -0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, -0x16, 0xF1, 0xAC, 0xF0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, -0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, -0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, -0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, -0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, -0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, -0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, -0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, -0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, -0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, -0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, -0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, -0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, -0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, -0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, -0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, -0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, -0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, -0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, -0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, -0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, -0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, -0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, -0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, -0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, -0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, -0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, -0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, -0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x0A, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0x4D, 0x4D, 0x54, 0x00, 0x45, -0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, - -/* Pacific/Efate */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC2, 0xB4, -0x19, 0xD2, 0xF7, 0xD0, 0x1A, 0xC2, 0xDA, 0xC0, 0x1B, 0xDA, 0x66, 0xD0, 0x1C, 0xA2, 0xBC, 0xC0, -0x1D, 0x9B, 0xF6, 0x50, 0x1E, 0x82, 0x9E, 0xC0, 0x1F, 0x7B, 0xD8, 0x50, 0x20, 0x6B, 0xBB, 0x40, -0x21, 0x5B, 0xBA, 0x50, 0x22, 0x4B, 0x9D, 0x40, 0x23, 0x3B, 0x9C, 0x50, 0x24, 0x2B, 0x7F, 0x40, -0x25, 0x1B, 0x7E, 0x50, 0x26, 0x0B, 0x61, 0x40, 0x26, 0xFB, 0x60, 0x50, 0x27, 0xEB, 0x43, 0x40, -0x28, 0xE4, 0x7C, 0xD0, 0x29, 0x81, 0x51, 0x40, 0x2A, 0xE9, 0x48, 0xD0, 0x2B, 0x61, 0x33, 0x40, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x9D, 0xCC, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01, -0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x55, 0x53, 0x54, 0x00, -0x56, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Enderbury */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x56, 0x04, 0xC0, -0x2F, 0x06, 0x8B, 0x30, 0x01, 0x02, 0xFF, 0xFF, 0x57, 0x40, 0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x50, 0x48, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Pacific/Fakaofo */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x54, 0x4B, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Fiji */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0x13, 0xB2, 0x3C, -0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0xA7, 0x44, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, -0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4A, 0x53, 0x54, 0x00, -0x46, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Funafuti */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x54, 0x56, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Galapagos */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA4, 0x4C, 0x80, -0x1E, 0x18, 0xC4, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x43, 0x54, 0x00, -0x47, 0x41, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Gambier */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x48, 0x04, -0x01, 0xFF, 0xFF, 0x81, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Guadalcanal */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x94, 0x4F, 0x33, 0x8C, -0x01, 0x00, 0x00, 0x95, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Guam */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x3A, 0x43, 0x5E, 0x60, -0x01, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x47, 0x53, 0x54, -0x00, 0x43, 0x68, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Honolulu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48, -0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38, -0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, -0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68, -0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, -0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, - -/* Pacific/Johnston */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Kiritimati */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x55, 0xF2, 0x00, -0x2F, 0x06, 0x7D, 0x20, 0x01, 0x02, 0xFF, 0xFF, 0x6A, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x00, 0x00, 0x4C, 0x49, 0x4E, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, - -/* Pacific/Kosrae */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xFF, 0x86, 0x1B, 0x50, -0x36, 0x8B, 0x67, 0x40, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x4B, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Kwajalein */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50, -0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Majuro */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xFF, 0x86, 0x1B, 0x50, -0x01, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Marquesas */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x4C, 0x48, -0x01, 0xFF, 0xFF, 0x7D, 0x38, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x4D, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Midway */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE6, 0x75, 0x8A, 0xB0, -0xE6, 0xED, 0x75, 0x20, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x00, 0x02, 0x03, -0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54, 0x00, -0x42, 0x53, 0x54, 0x00, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Pacific/Nauru */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xE7, 0x2B, 0x04, -0xCB, 0xB4, 0xBF, 0x48, 0xD0, 0x42, 0x50, 0x70, 0x11, 0x8B, 0x04, 0xC8, 0x01, 0x02, 0x01, 0x03, -0x00, 0x00, 0x9C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x52, 0x54, 0x00, -0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Niue */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0xDC, 0x43, 0x35, 0x60, -0x10, 0x74, 0xCA, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x60, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, -0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0x4E, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* Pacific/Norfolk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x41, 0xF8, 0x80, -0x01, 0x00, 0x00, 0x9D, 0x80, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x4E, 0x4D, 0x54, -0x00, 0x4E, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Noumea */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC4, 0x74, -0x0E, 0xE6, 0xBA, 0x50, 0x0F, 0x56, 0xBB, 0xC0, 0x10, 0xC6, 0x9C, 0x50, 0x11, 0x37, 0xEF, 0x40, -0x32, 0xA0, 0x4B, 0xF0, 0x33, 0x18, 0x44, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x00, -0x00, 0x9C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, -0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, -0x00, 0x4E, 0x43, 0x53, 0x54, 0x00, 0x4E, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Pago_Pago */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Palau */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x00, 0x50, 0x57, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Pitcairn */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x35, 0x44, 0x42, 0x08, -0x01, 0xFF, 0xFF, 0x88, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0x50, 0x4E, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Ponape */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x9A, 0xB0, -0x00, 0x00, 0x50, 0x4F, 0x4E, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Port_Moresby */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Rarotonga */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0A, 0x10, 0xAC, 0x1B, 0x28, -0x11, 0x3F, 0xB5, 0x18, 0x12, 0x79, 0x81, 0x20, 0x13, 0x1F, 0x97, 0x18, 0x14, 0x59, 0x63, 0x20, -0x14, 0xFF, 0x79, 0x18, 0x16, 0x39, 0x45, 0x20, 0x16, 0xE8, 0x95, 0x98, 0x18, 0x22, 0x61, 0xA0, -0x18, 0xC8, 0x77, 0x98, 0x1A, 0x02, 0x43, 0xA0, 0x1A, 0xA8, 0x59, 0x98, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0x88, 0x3B, 0x98, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0x68, 0x1D, 0x98, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x47, 0xFF, 0x98, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x31, 0x1C, 0x18, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x10, 0xFE, 0x18, 0x25, 0x4A, 0xCA, 0x20, 0x25, 0xF0, 0xE0, 0x18, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xD0, 0xC2, 0x18, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, -0x6C, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, -0x43, 0x4B, 0x54, 0x00, 0x43, 0x4B, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Pacific/Saipan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x37, 0x70, -0x3A, 0x43, 0x5E, 0x60, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x68, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Samoa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Tahiti */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x55, 0xB8, -0x01, 0xFF, 0xFF, 0x73, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x54, 0x41, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Tarawa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x47, 0x49, 0x4C, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Tongatapu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x73, 0x42, 0x90, -0x37, 0xFB, 0x47, 0xD0, 0x38, 0xD3, 0x7D, 0xD0, 0x3A, 0x04, 0x08, 0x50, 0x3A, 0x72, 0xB8, 0x40, -0x3B, 0xE3, 0xEA, 0x50, 0x3C, 0x52, 0x9A, 0x40, 0x01, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x00, -0x00, 0xAD, 0x70, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01, -0x04, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x04, 0x54, 0x4F, 0x54, -0x00, 0x54, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - -/* Pacific/Truk */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Wake */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x57, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Wallis */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x57, 0x46, 0x54, 0x00, 0x00, 0x00, - -/* Pacific/Yap */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00, - -/* Poland */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00, -0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD1, 0x95, 0x92, 0x70, -0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x5E, 0xAD, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90, -0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, 0xE9, 0xE1, 0xA5, 0x80, -0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, 0xED, 0xAA, 0xA4, 0x00, -0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, 0xF1, 0xB4, 0x3C, 0x00, -0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, 0xF5, 0x7D, 0x3A, 0x80, -0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x0A, 0x80, -0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80, -0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, -0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, -0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, -0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, 0x06, 0x02, 0x01, 0x04, -0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - - -/* Portugal */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10, -0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70, -0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70, -0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0, -0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, -0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, -0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, -0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, -0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, -0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70, -0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0, -0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60, -0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0, -0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0, -0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20, -0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0, -0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20, -0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0, -0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0, -0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, -0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7, -0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, -0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - - -/* PRC */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0, -0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* PST8PDT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* ROC */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00, -0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00, -0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80, -0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80, -0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00, -0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00, -0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80, -0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80, -0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80, -0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80, -0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* ROK */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, -0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, -0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03, -0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Singapore */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, -0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00, -0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Turkey */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, - -/* UCT */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00, - -/* Universal */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, - -/* US/Alaska */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0xCB, 0x89, 0x36, 0xC0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40, -0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40, -0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0, -0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40, -0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0, -0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40, -0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40, -0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40, -0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81, -0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x09, 0xFF, -0xFF, 0x81, 0x70, 0x01, 0x0E, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x13, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x17, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1C, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00, -0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, 0x4B, -0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* US/Aleutian */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* US/Arizona */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, - -/* US/Central */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00, -0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00, -0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00, -0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00, -0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80, -0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80, -0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80, -0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00, -0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00, -0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00, -0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80, -0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - -/* US/Eastern */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70, -0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0, -0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0, -0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0, -0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0, -0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, -0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0, -0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60, -0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60, -0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0, -0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0, -0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60, -0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60, -0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, -0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, -0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, -0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, -0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x01, - -/* US/East-Indiana */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - -/* US/Hawaii */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48, -0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38, -0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, -0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68, -0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, -0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, - -/* US/Indiana-Starke */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, -0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, - -/* US/Michigan */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B, -0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, -0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - -/* US/Mountain */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* US/Pacific */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* US/Pacific-New */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - -/* US/Samoa */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* UTC */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, - -/* WET */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, -0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01, - -/* W-SU */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8, -0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18, -0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0, -0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50, -0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, -0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, -0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, -0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, -0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, -0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, -0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, -0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, -0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, -0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, -0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, -0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, -0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70, -0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70, -0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70, -0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0, -0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0, -0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70, -0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70, -0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70, -0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0, -0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0, -0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0, -0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70, -0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70, -0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70, -0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23, -0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, -0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, -0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Zulu */ -0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, }; - -timelib_tzdb timezonedb_builtin = { "2005.14", 535, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/lib/timezonemap.h b/ext/date/lib/timezonemap.h deleted file mode 100644 index f4393bee4bcee..0000000000000 --- a/ext/date/lib/timezonemap.h +++ /dev/null @@ -1,1630 +0,0 @@ - { "acst", 1, -14400, "America/Porto_Acre" }, - { "acst", 1, -14400, "America/Eirunepe" }, - { "acst", 1, -14400, "America/Rio_Branco" }, - { "acst", 1, -14400, "Brazil/Acre" }, - { "act", 0, -18000, "America/Porto_Acre" }, - { "act", 0, -18000, "America/Eirunepe" }, - { "act", 0, -18000, "America/Rio_Branco" }, - { "act", 0, -18000, "Brazil/Acre" }, - { "addt", 1, -7200, "America/Goose_Bay" }, - { "addt", 1, -7200, "America/Pangnirtung" }, - { "adt", 1, -10800, "America/Halifax" }, - { "adt", 1, -10800, "America/Barbados" }, - { "adt", 1, -10800, "America/Glace_Bay" }, - { "adt", 1, -10800, "America/Goose_Bay" }, - { "adt", 1, -10800, "America/Martinique" }, - { "adt", 1, -10800, "America/Pangnirtung" }, - { "adt", 1, -10800, "America/Thule" }, - { "adt", 1, -10800, "Atlantic/Bermuda" }, - { "adt", 1, -10800, "Canada/Atlantic" }, - { "adt", 1, 14400, "Asia/Baghdad" }, - { "aft", 0, 16200, "Asia/Kabul" }, - { "ahdt", 1, -32400, "America/Anchorage" }, - { "ahdt", 1, -32400, "US/Alaska" }, - { "ahst", 0, -36000, "America/Anchorage" }, - { "ahst", 0, -36000, "America/Adak" }, - { "ahst", 0, -36000, "America/Atka" }, - { "ahst", 0, -36000, "US/Alaska" }, - { "ahst", 0, -36000, "US/Aleutian" }, - { "akdt", 1, -28800, "America/Anchorage" }, - { "akdt", 1, -28800, "America/Juneau" }, - { "akdt", 1, -28800, "America/Nome" }, - { "akdt", 1, -28800, "America/Yakutat" }, - { "akdt", 1, -28800, "US/Alaska" }, - { "akst", 0, -32400, "America/Anchorage" }, - { "akst", 0, -32400, "America/Juneau" }, - { "akst", 0, -32400, "America/Nome" }, - { "akst", 0, -32400, "America/Yakutat" }, - { "akst", 0, -32400, "US/Alaska" }, - { "aktst", 1, 21600, "Asia/Aqtobe" }, - { "aktt", 0, 14400, "Asia/Aqtobe" }, - { "aktt", 0, 18000, "Asia/Aqtobe" }, - { "aktt", 0, 21600, "Asia/Aqtobe" }, - { "almst", 1, 25200, "Asia/Almaty" }, - { "almt", 0, 18000, "Asia/Almaty" }, - { "almt", 0, 21600, "Asia/Almaty" }, - { "amst", 1, 14400, "Asia/Yerevan" }, - { "amst", 1, 18000, "Asia/Yerevan" }, - { "amst", 1, -10800, "America/Boa_Vista" }, - { "amst", 1, -10800, "America/Campo_Grande" }, - { "amst", 1, -10800, "America/Cuiaba" }, - { "amst", 1, -10800, "America/Manaus" }, - { "amst", 1, -10800, "America/Porto_Velho" }, - { "amst", 1, -10800, "Brazil/West" }, - { "amt", 0, 10800, "Asia/Yerevan" }, - { "amt", 0, 14400, "Asia/Yerevan" }, - { "amt", 0, -14400, "America/Boa_Vista" }, - { "amt", 0, -14400, "America/Campo_Grande" }, - { "amt", 0, -14400, "America/Cuiaba" }, - { "amt", 0, -14400, "America/Manaus" }, - { "amt", 0, -14400, "America/Porto_Velho" }, - { "amt", 0, -14400, "Brazil/West" }, - { "amt", 0, 1172, "Europe/Amsterdam" }, - { "anast", 1, 43200, "Asia/Anadyr" }, - { "anast", 1, 46800, "Asia/Anadyr" }, - { "anast", 1, 50400, "Asia/Anadyr" }, - { "anat", 0, 39600, "Asia/Anadyr" }, - { "anat", 0, 43200, "Asia/Anadyr" }, - { "anat", 0, 46800, "Asia/Anadyr" }, - { "ant", 0, -16200, "America/Curacao" }, - { "ant", 0, -16200, "America/Aruba" }, - { "apt", 1, -10800, "America/Halifax" }, - { "apt", 1, -10800, "America/Glace_Bay" }, - { "apt", 1, -10800, "America/Pangnirtung" }, - { "apt", 1, -10800, "Canada/Atlantic" }, - { "aqtst", 1, 18000, "Asia/Aqtau" }, - { "aqtst", 1, 21600, "Asia/Aqtau" }, - { "aqtst", 1, 21600, "Asia/Aqtobe" }, - { "aqtt", 0, 14400, "Asia/Aqtau" }, - { "aqtt", 0, 18000, "Asia/Aqtau" }, - { "aqtt", 0, 18000, "Asia/Aqtobe" }, - { "arst", 1, -10800, "America/Buenos_Aires" }, - { "arst", 1, -7200, "America/Buenos_Aires" }, - { "arst", 1, -10800, "America/Argentina/Buenos_Aires" }, - { "arst", 1, -10800, "America/Argentina/Catamarca" }, - { "arst", 1, -10800, "America/Argentina/ComodRivadavia" }, - { "arst", 1, -10800, "America/Argentina/Cordoba" }, - { "arst", 1, -10800, "America/Argentina/Jujuy" }, - { "arst", 1, -10800, "America/Argentina/La_Rioja" }, - { "arst", 1, -10800, "America/Argentina/Mendoza" }, - { "arst", 1, -10800, "America/Argentina/Rio_Gallegos" }, - { "arst", 1, -10800, "America/Argentina/San_Juan" }, - { "arst", 1, -10800, "America/Argentina/Tucuman" }, - { "arst", 1, -10800, "America/Argentina/Ushuaia" }, - { "arst", 1, -10800, "America/Catamarca" }, - { "arst", 1, -10800, "America/Cordoba" }, - { "arst", 1, -10800, "America/Jujuy" }, - { "arst", 1, -10800, "America/Mendoza" }, - { "arst", 1, -10800, "America/Rosario" }, - { "arst", 1, -10800, "Antarctica/Palmer" }, - { "arst", 1, -7200, "America/Argentina/Buenos_Aires" }, - { "arst", 1, -7200, "America/Argentina/Catamarca" }, - { "arst", 1, -7200, "America/Argentina/ComodRivadavia" }, - { "arst", 1, -7200, "America/Argentina/Cordoba" }, - { "arst", 1, -7200, "America/Argentina/Jujuy" }, - { "arst", 1, -7200, "America/Argentina/La_Rioja" }, - { "arst", 1, -7200, "America/Argentina/Mendoza" }, - { "arst", 1, -7200, "America/Argentina/Rio_Gallegos" }, - { "arst", 1, -7200, "America/Argentina/San_Juan" }, - { "arst", 1, -7200, "America/Argentina/Tucuman" }, - { "arst", 1, -7200, "America/Argentina/Ushuaia" }, - { "arst", 1, -7200, "America/Catamarca" }, - { "arst", 1, -7200, "America/Cordoba" }, - { "arst", 1, -7200, "America/Jujuy" }, - { "arst", 1, -7200, "America/Mendoza" }, - { "arst", 1, -7200, "America/Rosario" }, - { "arst", 1, -7200, "Antarctica/Palmer" }, - { "art", 0, -10800, "America/Buenos_Aires" }, - { "art", 0, -14400, "America/Buenos_Aires" }, - { "art", 0, -10800, "America/Argentina/Buenos_Aires" }, - { "art", 0, -10800, "America/Argentina/Catamarca" }, - { "art", 0, -10800, "America/Argentina/ComodRivadavia" }, - { "art", 0, -10800, "America/Argentina/Cordoba" }, - { "art", 0, -10800, "America/Argentina/Jujuy" }, - { "art", 0, -10800, "America/Argentina/La_Rioja" }, - { "art", 0, -10800, "America/Argentina/Mendoza" }, - { "art", 0, -10800, "America/Argentina/Rio_Gallegos" }, - { "art", 0, -10800, "America/Argentina/San_Juan" }, - { "art", 0, -10800, "America/Argentina/Tucuman" }, - { "art", 0, -10800, "America/Argentina/Ushuaia" }, - { "art", 0, -10800, "America/Catamarca" }, - { "art", 0, -10800, "America/Cordoba" }, - { "art", 0, -10800, "America/Jujuy" }, - { "art", 0, -10800, "America/Mendoza" }, - { "art", 0, -10800, "America/Rosario" }, - { "art", 0, -10800, "Antarctica/Palmer" }, - { "art", 0, -14400, "America/Argentina/Buenos_Aires" }, - { "art", 0, -14400, "America/Argentina/Catamarca" }, - { "art", 0, -14400, "America/Argentina/ComodRivadavia" }, - { "art", 0, -14400, "America/Argentina/Cordoba" }, - { "art", 0, -14400, "America/Argentina/Jujuy" }, - { "art", 0, -14400, "America/Argentina/La_Rioja" }, - { "art", 0, -14400, "America/Argentina/Mendoza" }, - { "art", 0, -14400, "America/Argentina/Rio_Gallegos" }, - { "art", 0, -14400, "America/Argentina/San_Juan" }, - { "art", 0, -14400, "America/Argentina/Tucuman" }, - { "art", 0, -14400, "America/Argentina/Ushuaia" }, - { "art", 0, -14400, "America/Catamarca" }, - { "art", 0, -14400, "America/Cordoba" }, - { "art", 0, -14400, "America/Jujuy" }, - { "art", 0, -14400, "America/Mendoza" }, - { "art", 0, -14400, "America/Rosario" }, - { "art", 0, -14400, "Antarctica/Palmer" }, - { "ashst", 1, 18000, "Asia/Ashkhabad" }, - { "ashst", 1, 21600, "Asia/Ashkhabad" }, - { "ashst", 1, 18000, "Asia/Ashgabat" }, - { "ashst", 1, 21600, "Asia/Ashgabat" }, - { "asht", 0, 14400, "Asia/Ashkhabad" }, - { "asht", 0, 18000, "Asia/Ashkhabad" }, - { "asht", 0, 14400, "Asia/Ashgabat" }, - { "asht", 0, 18000, "Asia/Ashgabat" }, - { "ast", 0, 10800, "Asia/Riyadh" }, - { "ast", 0, -14400, "America/Anguilla" }, - { "ast", 0, -14400, "America/Antigua" }, - { "ast", 0, -14400, "America/Aruba" }, - { "ast", 0, -14400, "America/Barbados" }, - { "ast", 0, -14400, "America/Curacao" }, - { "ast", 0, -14400, "America/Dominica" }, - { "ast", 0, -14400, "America/Glace_Bay" }, - { "ast", 0, -14400, "America/Goose_Bay" }, - { "ast", 0, -14400, "America/Grenada" }, - { "ast", 0, -14400, "America/Guadeloupe" }, - { "ast", 0, -14400, "America/Halifax" }, - { "ast", 0, -14400, "America/Martinique" }, - { "ast", 0, -14400, "America/Miquelon" }, - { "ast", 0, -14400, "America/Montserrat" }, - { "ast", 0, -14400, "America/Pangnirtung" }, - { "ast", 0, -14400, "America/Port_of_Spain" }, - { "ast", 0, -14400, "America/Puerto_Rico" }, - { "ast", 0, -14400, "America/Santo_Domingo" }, - { "ast", 0, -14400, "America/St_Kitts" }, - { "ast", 0, -14400, "America/St_Lucia" }, - { "ast", 0, -14400, "America/St_Thomas" }, - { "ast", 0, -14400, "America/St_Vincent" }, - { "ast", 0, -14400, "America/Thule" }, - { "ast", 0, -14400, "America/Tortola" }, - { "ast", 0, -14400, "America/Virgin" }, - { "ast", 0, -14400, "Atlantic/Bermuda" }, - { "ast", 0, -14400, "Canada/Atlantic" }, - { "ast", 0, 10800, "Asia/Aden" }, - { "ast", 0, 10800, "Asia/Baghdad" }, - { "ast", 0, 10800, "Asia/Bahrain" }, - { "ast", 0, 10800, "Asia/Kuwait" }, - { "ast", 0, 10800, "Asia/Qatar" }, - { "awt", 1, -10800, "America/Halifax" }, - { "awt", 1, -10800, "America/Glace_Bay" }, - { "awt", 1, -10800, "America/Pangnirtung" }, - { "awt", 1, -10800, "America/Puerto_Rico" }, - { "awt", 1, -10800, "Canada/Atlantic" }, - { "azomt", 1, 0, "Atlantic/Azores" }, - { "azost", 1, -3600, "Atlantic/Azores" }, - { "azost", 1, 0, "Atlantic/Azores" }, - { "azot", 0, -3600, "Atlantic/Azores" }, - { "azot", 0, -7200, "Atlantic/Azores" }, - { "azst", 1, 14400, "Asia/Baku" }, - { "azst", 1, 18000, "Asia/Baku" }, - { "azt", 0, 10800, "Asia/Baku" }, - { "azt", 0, 14400, "Asia/Baku" }, - { "bakst", 1, 14400, "Asia/Baku" }, - { "bakst", 1, 18000, "Asia/Baku" }, - { "bakt", 0, 10800, "Asia/Baku" }, - { "bakt", 0, 14400, "Asia/Baku" }, - { "bdst", 1, 7200, "Europe/London" }, - { "bdst", 1, 7200, "Europe/Belfast" }, - { "bdst", 1, 7200, "Europe/Gibraltar" }, - { "bdst", 1, 7200, "GB" }, - { "bdst", 1, 7200, "GB-Eire" }, - { "bdt", 1, -36000, "America/Adak" }, - { "bdt", 1, -36000, "America/Atka" }, - { "bdt", 1, -36000, "America/Nome" }, - { "bdt", 1, -36000, "US/Aleutian" }, - { "bdt", 0, 21600, "Asia/Dacca" }, - { "bdt", 0, 21600, "Asia/Dhaka" }, - { "beat", 0, 9000, "Africa/Mogadishu" }, - { "beat", 0, 9000, "Africa/Kampala" }, - { "beat", 0, 9000, "Africa/Nairobi" }, - { "beaut", 0, 9885, "Africa/Nairobi" }, - { "beaut", 0, 9885, "Africa/Dar_es_Salaam" }, - { "beaut", 0, 9885, "Africa/Kampala" }, - { "bmt", 0, -14308, "America/Barbados" }, - { "bmt", 0, -3996, "Africa/Banjul" }, - { "bmt", 0, 6264, "Europe/Tiraspol" }, - { "bmt", 0, 6264, "Europe/Chisinau" }, - { "bnt", 0, 27000, "Asia/Brunei" }, - { "bnt", 0, 28800, "Asia/Brunei" }, - { "bortst", 1, 30000, "Asia/Kuching" }, - { "bort", 0, 27000, "Asia/Kuching" }, - { "bort", 0, 28800, "Asia/Kuching" }, - { "bost", 1, -12756, "America/La_Paz" }, - { "bot", 0, -14400, "America/La_Paz" }, - { "brst", 1, -7200, "America/Sao_Paulo" }, - { "brst", 1, -7200, "America/Araguaina" }, - { "brst", 1, -7200, "America/Bahia" }, - { "brst", 1, -7200, "America/Belem" }, - { "brst", 1, -7200, "America/Fortaleza" }, - { "brst", 1, -7200, "America/Maceio" }, - { "brst", 1, -7200, "America/Recife" }, - { "brst", 1, -7200, "Brazil/East" }, - { "brt", 0, -10800, "America/Sao_Paulo" }, - { "brt", 0, -10800, "America/Araguaina" }, - { "brt", 0, -10800, "America/Bahia" }, - { "brt", 0, -10800, "America/Belem" }, - { "brt", 0, -10800, "America/Fortaleza" }, - { "brt", 0, -10800, "America/Maceio" }, - { "brt", 0, -10800, "America/Recife" }, - { "brt", 0, -10800, "Brazil/East" }, - { "bst", 0, 3600, "Europe/London" }, - { "bst", 1, 3600, "Europe/London" }, - { "bst", 0, -39600, "America/Adak" }, - { "bst", 0, -39600, "America/Atka" }, - { "bst", 0, -39600, "America/Nome" }, - { "bst", 0, -39600, "Pacific/Midway" }, - { "bst", 0, -39600, "Pacific/Pago_Pago" }, - { "bst", 0, -39600, "Pacific/Samoa" }, - { "bst", 0, -39600, "US/Aleutian" }, - { "bst", 0, -39600, "US/Samoa" }, - { "bst", 0, 3600, "Europe/Belfast" }, - { "bst", 0, 3600, "GB" }, - { "bst", 0, 3600, "GB-Eire" }, - { "bst", 1, 3600, "Eire" }, - { "bst", 1, 3600, "Europe/Belfast" }, - { "bst", 1, 3600, "Europe/Dublin" }, - { "bst", 1, 3600, "Europe/Gibraltar" }, - { "bst", 1, 3600, "GB" }, - { "bst", 1, 3600, "GB-Eire" }, - { "btt", 0, 21600, "Asia/Thimbu" }, - { "btt", 0, 21600, "Asia/Thimphu" }, - { "burt", 0, 23400, "Asia/Calcutta" }, - { "burt", 0, 23400, "Asia/Dacca" }, - { "burt", 0, 23400, "Asia/Dhaka" }, - { "burt", 0, 23400, "Asia/Rangoon" }, - { "cant", 0, -3600, "Atlantic/Canary" }, - { "cast", 0, 34200, "Australia/Adelaide" }, - { "cast", 1, 10800, "Africa/Gaborone" }, - { "cast", 1, 10800, "Africa/Khartoum" }, - { "cat", 0, -36000, "America/Anchorage" }, - { "cat", 0, -36000, "US/Alaska" }, - { "cat", 0, 7200, "Africa/Khartoum" }, - { "cat", 0, 7200, "Africa/Blantyre" }, - { "cat", 0, 7200, "Africa/Gaborone" }, - { "cat", 0, 7200, "Africa/Harare" }, - { "cat", 0, 7200, "Africa/Kigali" }, - { "cat", 0, 7200, "Africa/Lusaka" }, - { "cat", 0, 7200, "Africa/Maputo" }, - { "cat", 0, 7200, "Africa/Windhoek" }, - { "cawt", 1, -32400, "America/Anchorage" }, - { "cawt", 1, -32400, "US/Alaska" }, - { "cddt", 1, -14400, "America/Rankin_Inlet" }, - { "cdt", 1, -18000, "America/Chicago" }, - { "cdt", 1, -14400, "America/Havana" }, - { "cdt", 1, -14400, "Cuba" }, - { "cdt", 1, -18000, "America/Belize" }, - { "cdt", 1, -18000, "America/Cambridge_Bay" }, - { "cdt", 1, -18000, "America/Cancun" }, - { "cdt", 1, -18000, "America/Chihuahua" }, - { "cdt", 1, -18000, "America/Costa_Rica" }, - { "cdt", 1, -18000, "America/El_Salvador" }, - { "cdt", 1, -18000, "America/Fort_Wayne" }, - { "cdt", 1, -18000, "America/Guatemala" }, - { "cdt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cdt", 1, -18000, "America/Indiana/Knox" }, - { "cdt", 1, -18000, "America/Indiana/Marengo" }, - { "cdt", 1, -18000, "America/Indiana/Vevay" }, - { "cdt", 1, -18000, "America/Indianapolis" }, - { "cdt", 1, -18000, "America/Iqaluit" }, - { "cdt", 1, -18000, "America/Kentucky/Louisville" }, - { "cdt", 1, -18000, "America/Kentucky/Monticello" }, - { "cdt", 1, -18000, "America/Knox_IN" }, - { "cdt", 1, -18000, "America/Louisville" }, - { "cdt", 1, -18000, "America/Managua" }, - { "cdt", 1, -18000, "America/Menominee" }, - { "cdt", 1, -18000, "America/Merida" }, - { "cdt", 1, -18000, "America/Mexico_City" }, - { "cdt", 1, -18000, "America/Monterrey" }, - { "cdt", 1, -18000, "America/North_Dakota/Center" }, - { "cdt", 1, -18000, "America/Pangnirtung" }, - { "cdt", 1, -18000, "America/Rainy_River" }, - { "cdt", 1, -18000, "America/Rankin_Inlet" }, - { "cdt", 1, -18000, "America/Tegucigalpa" }, - { "cdt", 1, -18000, "America/Winnipeg" }, - { "cdt", 1, -18000, "Canada/Central" }, - { "cdt", 1, -18000, "CST6CDT" }, - { "cdt", 1, -18000, "Mexico/General" }, - { "cdt", 1, -18000, "US/Central" }, - { "cdt", 1, -18000, "US/East-Indiana" }, - { "cdt", 1, -18000, "US/Indiana-Starke" }, - { "cdt", 1, 32400, "Asia/Shanghai" }, - { "cdt", 1, 32400, "Asia/Chongqing" }, - { "cdt", 1, 32400, "Asia/Chungking" }, - { "cdt", 1, 32400, "Asia/Harbin" }, - { "cdt", 1, 32400, "Asia/Kashgar" }, - { "cdt", 1, 32400, "Asia/Taipei" }, - { "cdt", 1, 32400, "Asia/Urumqi" }, - { "cdt", 1, 32400, "PRC" }, - { "cdt", 1, 32400, "ROC" }, - { "cemt", 1, 10800, "Europe/Berlin" }, - { "cemt", 1, 10800, "CET" }, - { "cest", 1, 7200, "Europe/Berlin" }, - { "cest", 1, 10800, "Europe/Kaliningrad" }, - { "cest", 1, 7200, "Africa/Algiers" }, - { "cest", 1, 7200, "Africa/Ceuta" }, - { "cest", 1, 7200, "Africa/Tripoli" }, - { "cest", 1, 7200, "Africa/Tunis" }, - { "cest", 1, 7200, "Arctic/Longyearbyen" }, - { "cest", 1, 7200, "Atlantic/Jan_Mayen" }, - { "cest", 1, 7200, "CET" }, - { "cest", 1, 7200, "Europe/Amsterdam" }, - { "cest", 1, 7200, "Europe/Andorra" }, - { "cest", 1, 7200, "Europe/Athens" }, - { "cest", 1, 7200, "Europe/Belgrade" }, - { "cest", 1, 7200, "Europe/Bratislava" }, - { "cest", 1, 7200, "Europe/Brussels" }, - { "cest", 1, 7200, "Europe/Budapest" }, - { "cest", 1, 7200, "Europe/Chisinau" }, - { "cest", 1, 7200, "Europe/Copenhagen" }, - { "cest", 1, 7200, "Europe/Gibraltar" }, - { "cest", 1, 7200, "Europe/Kaliningrad" }, - { "cest", 1, 7200, "Europe/Kiev" }, - { "cest", 1, 7200, "Europe/Lisbon" }, - { "cest", 1, 7200, "Europe/Ljubljana" }, - { "cest", 1, 7200, "Europe/Luxembourg" }, - { "cest", 1, 7200, "Europe/Madrid" }, - { "cest", 1, 7200, "Europe/Malta" }, - { "cest", 1, 7200, "Europe/Minsk" }, - { "cest", 1, 7200, "Europe/Monaco" }, - { "cest", 1, 7200, "Europe/Oslo" }, - { "cest", 1, 7200, "Europe/Paris" }, - { "cest", 1, 7200, "Europe/Prague" }, - { "cest", 1, 7200, "Europe/Riga" }, - { "cest", 1, 7200, "Europe/Rome" }, - { "cest", 1, 7200, "Europe/San_Marino" }, - { "cest", 1, 7200, "Europe/Sarajevo" }, - { "cest", 1, 7200, "Europe/Simferopol" }, - { "cest", 1, 7200, "Europe/Skopje" }, - { "cest", 1, 7200, "Europe/Sofia" }, - { "cest", 1, 7200, "Europe/Stockholm" }, - { "cest", 1, 7200, "Europe/Tallinn" }, - { "cest", 1, 7200, "Europe/Tirane" }, - { "cest", 1, 7200, "Europe/Tiraspol" }, - { "cest", 1, 7200, "Europe/Uzhgorod" }, - { "cest", 1, 7200, "Europe/Vaduz" }, - { "cest", 1, 7200, "Europe/Vatican" }, - { "cest", 1, 7200, "Europe/Vienna" }, - { "cest", 1, 7200, "Europe/Vilnius" }, - { "cest", 1, 7200, "Europe/Warsaw" }, - { "cest", 1, 7200, "Europe/Zagreb" }, - { "cest", 1, 7200, "Europe/Zaporozhye" }, - { "cest", 1, 7200, "Europe/Zurich" }, - { "cest", 1, 7200, "Libya" }, - { "cest", 1, 7200, "Poland" }, - { "cest", 1, 7200, "Portugal" }, - { "cest", 1, 7200, "WET" }, - { "cet", 0, 3600, "Europe/Berlin" }, - { "cet", 0, 3600, "Africa/Algiers" }, - { "cet", 0, 3600, "Africa/Casablanca" }, - { "cet", 0, 3600, "Africa/Ceuta" }, - { "cet", 0, 3600, "Africa/Tripoli" }, - { "cet", 0, 3600, "Africa/Tunis" }, - { "cet", 0, 3600, "Arctic/Longyearbyen" }, - { "cet", 0, 3600, "Atlantic/Jan_Mayen" }, - { "cet", 0, 3600, "CET" }, - { "cet", 0, 3600, "Europe/Amsterdam" }, - { "cet", 0, 3600, "Europe/Andorra" }, - { "cet", 0, 3600, "Europe/Athens" }, - { "cet", 0, 3600, "Europe/Belgrade" }, - { "cet", 0, 3600, "Europe/Bratislava" }, - { "cet", 0, 3600, "Europe/Brussels" }, - { "cet", 0, 3600, "Europe/Budapest" }, - { "cet", 0, 3600, "Europe/Chisinau" }, - { "cet", 0, 3600, "Europe/Copenhagen" }, - { "cet", 0, 3600, "Europe/Gibraltar" }, - { "cet", 0, 3600, "Europe/Kaliningrad" }, - { "cet", 0, 3600, "Europe/Kiev" }, - { "cet", 0, 3600, "Europe/Lisbon" }, - { "cet", 0, 3600, "Europe/Ljubljana" }, - { "cet", 0, 3600, "Europe/Luxembourg" }, - { "cet", 0, 3600, "Europe/Madrid" }, - { "cet", 0, 3600, "Europe/Malta" }, - { "cet", 0, 3600, "Europe/Minsk" }, - { "cet", 0, 3600, "Europe/Monaco" }, - { "cet", 0, 3600, "Europe/Oslo" }, - { "cet", 0, 3600, "Europe/Paris" }, - { "cet", 0, 3600, "Europe/Prague" }, - { "cet", 0, 3600, "Europe/Riga" }, - { "cet", 0, 3600, "Europe/Rome" }, - { "cet", 0, 3600, "Europe/San_Marino" }, - { "cet", 0, 3600, "Europe/Sarajevo" }, - { "cet", 0, 3600, "Europe/Simferopol" }, - { "cet", 0, 3600, "Europe/Skopje" }, - { "cet", 0, 3600, "Europe/Sofia" }, - { "cet", 0, 3600, "Europe/Stockholm" }, - { "cet", 0, 3600, "Europe/Tallinn" }, - { "cet", 0, 3600, "Europe/Tirane" }, - { "cet", 0, 3600, "Europe/Tiraspol" }, - { "cet", 0, 3600, "Europe/Uzhgorod" }, - { "cet", 0, 3600, "Europe/Vaduz" }, - { "cet", 0, 3600, "Europe/Vatican" }, - { "cet", 0, 3600, "Europe/Vienna" }, - { "cet", 0, 3600, "Europe/Vilnius" }, - { "cet", 0, 3600, "Europe/Warsaw" }, - { "cet", 0, 3600, "Europe/Zagreb" }, - { "cet", 0, 3600, "Europe/Zaporozhye" }, - { "cet", 0, 3600, "Europe/Zurich" }, - { "cet", 0, 3600, "Libya" }, - { "cet", 0, 3600, "Poland" }, - { "cet", 0, 3600, "Portugal" }, - { "cet", 0, 3600, "WET" }, - { "cet", 0, 7200, "Europe/Kaliningrad" }, - { "cgst", 1, -3600, "America/Scoresbysund" }, - { "cgt", 0, -7200, "America/Scoresbysund" }, - { "chadt", 1, 49500, "Pacific/Chatham" }, - { "chadt", 1, 49500, "NZ-CHAT" }, - { "chast", 0, 45900, "Pacific/Chatham" }, - { "chast", 0, 45900, "NZ-CHAT" }, - { "chat", 0, 30600, "Asia/Harbin" }, - { "chat", 0, 32400, "Asia/Harbin" }, - { "chdt", 1, -19800, "America/Belize" }, - { "chost", 1, 36000, "Asia/Choibalsan" }, - { "chot", 0, 32400, "Asia/Choibalsan" }, - { "cit", 0, 28800, "Asia/Dili" }, - { "cit", 0, 28800, "Asia/Makassar" }, - { "cit", 0, 28800, "Asia/Pontianak" }, - { "cit", 0, 28800, "Asia/Ujung_Pandang" }, - { "cjt", 0, 32400, "Asia/Sakhalin" }, - { "ckhst", 1, -34200, "Pacific/Rarotonga" }, - { "ckt", 0, -36000, "Pacific/Rarotonga" }, - { "clst", 1, -10800, "America/Santiago" }, - { "clst", 1, -14400, "America/Santiago" }, - { "clst", 1, -10800, "Antarctica/Palmer" }, - { "clst", 1, -10800, "Chile/Continental" }, - { "clst", 1, -14400, "Chile/Continental" }, - { "clt", 0, -14400, "America/Santiago" }, - { "clt", 0, -18000, "America/Santiago" }, - { "clt", 0, -14400, "Antarctica/Palmer" }, - { "clt", 0, -14400, "Chile/Continental" }, - { "clt", 0, -18000, "Chile/Continental" }, - { "cost", 1, -14400, "America/Bogota" }, - { "cot", 0, -18000, "America/Bogota" }, - { "cpt", 1, -18000, "America/Chicago" }, - { "cpt", 1, -18000, "America/Fort_Wayne" }, - { "cpt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cpt", 1, -18000, "America/Indiana/Knox" }, - { "cpt", 1, -18000, "America/Indiana/Marengo" }, - { "cpt", 1, -18000, "America/Indiana/Vevay" }, - { "cpt", 1, -18000, "America/Indianapolis" }, - { "cpt", 1, -18000, "America/Kentucky/Louisville" }, - { "cpt", 1, -18000, "America/Kentucky/Monticello" }, - { "cpt", 1, -18000, "America/Knox_IN" }, - { "cpt", 1, -18000, "America/Louisville" }, - { "cpt", 1, -18000, "America/Menominee" }, - { "cpt", 1, -18000, "America/Rainy_River" }, - { "cpt", 1, -18000, "America/Rankin_Inlet" }, - { "cpt", 1, -18000, "America/Winnipeg" }, - { "cpt", 1, -18000, "Canada/Central" }, - { "cpt", 1, -18000, "CST6CDT" }, - { "cpt", 1, -18000, "US/Central" }, - { "cpt", 1, -18000, "US/East-Indiana" }, - { "cpt", 1, -18000, "US/Indiana-Starke" }, - { "cst", 0, -21600, "America/Chicago" }, - { "cst", 0, -18000, "America/Havana" }, - { "cst", 0, -18000, "Cuba" }, - { "cst", 0, -21600, "America/Belize" }, - { "cst", 0, -21600, "America/Cambridge_Bay" }, - { "cst", 0, -21600, "America/Cancun" }, - { "cst", 0, -21600, "America/Chihuahua" }, - { "cst", 0, -21600, "America/Costa_Rica" }, - { "cst", 0, -21600, "America/Detroit" }, - { "cst", 0, -21600, "America/El_Salvador" }, - { "cst", 0, -21600, "America/Fort_Wayne" }, - { "cst", 0, -21600, "America/Guatemala" }, - { "cst", 0, -21600, "America/Hermosillo" }, - { "cst", 0, -21600, "America/Indiana/Indianapolis" }, - { "cst", 0, -21600, "America/Indiana/Knox" }, - { "cst", 0, -21600, "America/Indiana/Marengo" }, - { "cst", 0, -21600, "America/Indiana/Vevay" }, - { "cst", 0, -21600, "America/Indianapolis" }, - { "cst", 0, -21600, "America/Iqaluit" }, - { "cst", 0, -21600, "America/Kentucky/Louisville" }, - { "cst", 0, -21600, "America/Kentucky/Monticello" }, - { "cst", 0, -21600, "America/Knox_IN" }, - { "cst", 0, -21600, "America/Louisville" }, - { "cst", 0, -21600, "America/Managua" }, - { "cst", 0, -21600, "America/Mazatlan" }, - { "cst", 0, -21600, "America/Menominee" }, - { "cst", 0, -21600, "America/Merida" }, - { "cst", 0, -21600, "America/Mexico_City" }, - { "cst", 0, -21600, "America/Monterrey" }, - { "cst", 0, -21600, "America/North_Dakota/Center" }, - { "cst", 0, -21600, "America/Pangnirtung" }, - { "cst", 0, -21600, "America/Rainy_River" }, - { "cst", 0, -21600, "America/Rankin_Inlet" }, - { "cst", 0, -21600, "America/Regina" }, - { "cst", 0, -21600, "America/Swift_Current" }, - { "cst", 0, -21600, "America/Tegucigalpa" }, - { "cst", 0, -21600, "America/Winnipeg" }, - { "cst", 0, -21600, "Canada/Central" }, - { "cst", 0, -21600, "Canada/East-Saskatchewan" }, - { "cst", 0, -21600, "Canada/Saskatchewan" }, - { "cst", 0, -21600, "CST6CDT" }, - { "cst", 0, -21600, "Mexico/BajaSur" }, - { "cst", 0, -21600, "Mexico/General" }, - { "cst", 0, -21600, "US/Central" }, - { "cst", 0, -21600, "US/East-Indiana" }, - { "cst", 0, -21600, "US/Indiana-Starke" }, - { "cst", 0, -21600, "US/Michigan" }, - { "cst", 0, 28800, "Asia/Chongqing" }, - { "cst", 0, 28800, "Asia/Chungking" }, - { "cst", 0, 28800, "Asia/Harbin" }, - { "cst", 0, 28800, "Asia/Kashgar" }, - { "cst", 0, 28800, "Asia/Macao" }, - { "cst", 0, 28800, "Asia/Macau" }, - { "cst", 0, 28800, "Asia/Shanghai" }, - { "cst", 0, 28800, "Asia/Taipei" }, - { "cst", 0, 28800, "Asia/Urumqi" }, - { "cst", 0, 28800, "PRC" }, - { "cst", 0, 28800, "ROC" }, - { "cst", 0, 34200, "Asia/Jayapura" }, - { "cst", 0, 34200, "Australia/Adelaide" }, - { "cst", 0, 34200, "Australia/Broken_Hill" }, - { "cst", 0, 34200, "Australia/Darwin" }, - { "cst", 0, 34200, "Australia/North" }, - { "cst", 0, 34200, "Australia/South" }, - { "cst", 0, 34200, "Australia/Yancowinna" }, - { "cst", 1, 37800, "Australia/Adelaide" }, - { "cst", 1, 37800, "Australia/Broken_Hill" }, - { "cst", 1, 37800, "Australia/Darwin" }, - { "cst", 1, 37800, "Australia/North" }, - { "cst", 1, 37800, "Australia/South" }, - { "cst", 1, 37800, "Australia/Yancowinna" }, - { "cvst", 1, -3600, "Atlantic/Cape_Verde" }, - { "cvt", 0, -3600, "Atlantic/Cape_Verde" }, - { "cvt", 0, -7200, "Atlantic/Cape_Verde" }, - { "cwt", 1, -18000, "America/Chicago" }, - { "cwt", 1, -18000, "America/Fort_Wayne" }, - { "cwt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cwt", 1, -18000, "America/Indiana/Knox" }, - { "cwt", 1, -18000, "America/Indiana/Marengo" }, - { "cwt", 1, -18000, "America/Indiana/Vevay" }, - { "cwt", 1, -18000, "America/Indianapolis" }, - { "cwt", 1, -18000, "America/Kentucky/Louisville" }, - { "cwt", 1, -18000, "America/Kentucky/Monticello" }, - { "cwt", 1, -18000, "America/Knox_IN" }, - { "cwt", 1, -18000, "America/Louisville" }, - { "cwt", 1, -18000, "America/Menominee" }, - { "cwt", 1, -18000, "America/Mexico_City" }, - { "cwt", 1, -18000, "America/Rainy_River" }, - { "cwt", 1, -18000, "America/Rankin_Inlet" }, - { "cwt", 1, -18000, "America/Winnipeg" }, - { "cwt", 1, -18000, "Canada/Central" }, - { "cwt", 1, -18000, "CST6CDT" }, - { "cwt", 1, -18000, "Mexico/General" }, - { "cwt", 1, -18000, "US/Central" }, - { "cwt", 1, -18000, "US/East-Indiana" }, - { "cwt", 1, -18000, "US/Indiana-Starke" }, - { "chst", 0, 36000, "Pacific/Guam" }, - { "chst", 0, 36000, "Pacific/Saipan" }, - { "dact", 0, 21600, "Asia/Dacca" }, - { "dact", 0, 21600, "Asia/Dhaka" }, - { "davt", 0, 25200, "Antarctica/Davis" }, - { "ddut", 0, 36000, "Antarctica/DumontDUrville" }, - { "dusst", 1, 21600, "Asia/Dushanbe" }, - { "dusst", 1, 25200, "Asia/Dushanbe" }, - { "dust", 0, 18000, "Asia/Dushanbe" }, - { "dust", 0, 21600, "Asia/Dushanbe" }, - { "easst", 1, -18000, "Chile/EasterIsland" }, - { "easst", 1, -21600, "Chile/EasterIsland" }, - { "easst", 1, -18000, "Pacific/Easter" }, - { "easst", 1, -21600, "Pacific/Easter" }, - { "east", 0, -21600, "Chile/EasterIsland" }, - { "east", 0, -25200, "Chile/EasterIsland" }, - { "east", 0, -21600, "Pacific/Easter" }, - { "east", 0, -25200, "Pacific/Easter" }, - { "east", 1, 14400, "Indian/Antananarivo" }, - { "eat", 0, 10800, "Africa/Khartoum" }, - { "eat", 0, 10800, "Africa/Addis_Ababa" }, - { "eat", 0, 10800, "Africa/Asmera" }, - { "eat", 0, 10800, "Africa/Dar_es_Salaam" }, - { "eat", 0, 10800, "Africa/Djibouti" }, - { "eat", 0, 10800, "Africa/Kampala" }, - { "eat", 0, 10800, "Africa/Mogadishu" }, - { "eat", 0, 10800, "Africa/Nairobi" }, - { "eat", 0, 10800, "Indian/Antananarivo" }, - { "eat", 0, 10800, "Indian/Comoro" }, - { "eat", 0, 10800, "Indian/Mayotte" }, - { "ect", 0, -18000, "America/Guayaquil" }, - { "ect", 0, -18000, "Pacific/Galapagos" }, - { "eddt", 1, -10800, "America/Iqaluit" }, - { "edt", 1, -14400, "America/New_York" }, - { "edt", 1, -14400, "America/Cancun" }, - { "edt", 1, -14400, "America/Coral_Harbour" }, - { "edt", 1, -14400, "America/Detroit" }, - { "edt", 1, -14400, "America/Fort_Wayne" }, - { "edt", 1, -14400, "America/Grand_Turk" }, - { "edt", 1, -14400, "America/Indiana/Indianapolis" }, - { "edt", 1, -14400, "America/Indiana/Knox" }, - { "edt", 1, -14400, "America/Indiana/Marengo" }, - { "edt", 1, -14400, "America/Indiana/Vevay" }, - { "edt", 1, -14400, "America/Indianapolis" }, - { "edt", 1, -14400, "America/Iqaluit" }, - { "edt", 1, -14400, "America/Jamaica" }, - { "edt", 1, -14400, "America/Kentucky/Louisville" }, - { "edt", 1, -14400, "America/Kentucky/Monticello" }, - { "edt", 1, -14400, "America/Knox_IN" }, - { "edt", 1, -14400, "America/Louisville" }, - { "edt", 1, -14400, "America/Montreal" }, - { "edt", 1, -14400, "America/Nassau" }, - { "edt", 1, -14400, "America/Nipigon" }, - { "edt", 1, -14400, "America/Pangnirtung" }, - { "edt", 1, -14400, "America/Port-au-Prince" }, - { "edt", 1, -14400, "America/Santo_Domingo" }, - { "edt", 1, -14400, "America/Thunder_Bay" }, - { "edt", 1, -14400, "America/Toronto" }, - { "edt", 1, -14400, "Canada/Eastern" }, - { "edt", 1, -14400, "EST" }, - { "edt", 1, -14400, "EST5EDT" }, - { "edt", 1, -14400, "Jamaica" }, - { "edt", 1, -14400, "US/East-Indiana" }, - { "edt", 1, -14400, "US/Eastern" }, - { "edt", 1, -14400, "US/Indiana-Starke" }, - { "edt", 1, -14400, "US/Michigan" }, - { "eest", 1, 10800, "Europe/Helsinki" }, - { "eest", 1, 10800, "Africa/Cairo" }, - { "eest", 1, 10800, "Asia/Amman" }, - { "eest", 1, 10800, "Asia/Beirut" }, - { "eest", 1, 10800, "Asia/Damascus" }, - { "eest", 1, 10800, "Asia/Gaza" }, - { "eest", 1, 10800, "Asia/Istanbul" }, - { "eest", 1, 10800, "Asia/Nicosia" }, - { "eest", 1, 10800, "EET" }, - { "eest", 1, 10800, "Egypt" }, - { "eest", 1, 10800, "Europe/Athens" }, - { "eest", 1, 10800, "Europe/Bucharest" }, - { "eest", 1, 10800, "Europe/Chisinau" }, - { "eest", 1, 10800, "Europe/Istanbul" }, - { "eest", 1, 10800, "Europe/Kaliningrad" }, - { "eest", 1, 10800, "Europe/Kiev" }, - { "eest", 1, 10800, "Europe/Mariehamn" }, - { "eest", 1, 10800, "Europe/Minsk" }, - { "eest", 1, 10800, "Europe/Moscow" }, - { "eest", 1, 10800, "Europe/Nicosia" }, - { "eest", 1, 10800, "Europe/Riga" }, - { "eest", 1, 10800, "Europe/Simferopol" }, - { "eest", 1, 10800, "Europe/Sofia" }, - { "eest", 1, 10800, "Europe/Tallinn" }, - { "eest", 1, 10800, "Europe/Tiraspol" }, - { "eest", 1, 10800, "Europe/Uzhgorod" }, - { "eest", 1, 10800, "Europe/Vilnius" }, - { "eest", 1, 10800, "Europe/Warsaw" }, - { "eest", 1, 10800, "Europe/Zaporozhye" }, - { "eest", 1, 10800, "Poland" }, - { "eest", 1, 10800, "Turkey" }, - { "eest", 1, 10800, "W-SU" }, - { "eet", 0, 7200, "Europe/Helsinki" }, - { "eet", 1, 10800, "Asia/Gaza" }, - { "eet", 0, 7200, "Africa/Cairo" }, - { "eet", 0, 7200, "Africa/Tripoli" }, - { "eet", 0, 7200, "Asia/Amman" }, - { "eet", 0, 7200, "Asia/Beirut" }, - { "eet", 0, 7200, "Asia/Damascus" }, - { "eet", 0, 7200, "Asia/Gaza" }, - { "eet", 0, 7200, "Asia/Istanbul" }, - { "eet", 0, 7200, "Asia/Nicosia" }, - { "eet", 0, 7200, "EET" }, - { "eet", 0, 7200, "Egypt" }, - { "eet", 0, 7200, "Europe/Athens" }, - { "eet", 0, 7200, "Europe/Bucharest" }, - { "eet", 0, 7200, "Europe/Chisinau" }, - { "eet", 0, 7200, "Europe/Istanbul" }, - { "eet", 0, 7200, "Europe/Kaliningrad" }, - { "eet", 0, 7200, "Europe/Kiev" }, - { "eet", 0, 7200, "Europe/Mariehamn" }, - { "eet", 0, 7200, "Europe/Minsk" }, - { "eet", 0, 7200, "Europe/Moscow" }, - { "eet", 0, 7200, "Europe/Nicosia" }, - { "eet", 0, 7200, "Europe/Riga" }, - { "eet", 0, 7200, "Europe/Simferopol" }, - { "eet", 0, 7200, "Europe/Sofia" }, - { "eet", 0, 7200, "Europe/Tallinn" }, - { "eet", 0, 7200, "Europe/Tiraspol" }, - { "eet", 0, 7200, "Europe/Uzhgorod" }, - { "eet", 0, 7200, "Europe/Vilnius" }, - { "eet", 0, 7200, "Europe/Warsaw" }, - { "eet", 0, 7200, "Europe/Zaporozhye" }, - { "eet", 0, 7200, "Libya" }, - { "eet", 0, 7200, "Poland" }, - { "eet", 0, 7200, "Turkey" }, - { "eet", 0, 7200, "W-SU" }, - { "egst", 1, 0, "America/Scoresbysund" }, - { "egt", 0, -3600, "America/Scoresbysund" }, - { "ehdt", 1, -16200, "America/Santo_Domingo" }, - { "eit", 0, 32400, "Asia/Jayapura" }, - { "ept", 1, -14400, "America/New_York" }, - { "ept", 1, -14400, "America/Coral_Harbour" }, - { "ept", 1, -14400, "America/Detroit" }, - { "ept", 1, -14400, "America/Iqaluit" }, - { "ept", 1, -14400, "America/Montreal" }, - { "ept", 1, -14400, "America/Nipigon" }, - { "ept", 1, -14400, "America/Thunder_Bay" }, - { "ept", 1, -14400, "America/Toronto" }, - { "ept", 1, -14400, "Canada/Eastern" }, - { "ept", 1, -14400, "EST" }, - { "ept", 1, -14400, "EST5EDT" }, - { "ept", 1, -14400, "US/Eastern" }, - { "ept", 1, -14400, "US/Michigan" }, - { "est", 0, -18000, "America/New_York" }, - { "est", 0, -18000, "America/Antigua" }, - { "est", 0, -18000, "America/Cambridge_Bay" }, - { "est", 0, -18000, "America/Cancun" }, - { "est", 0, -18000, "America/Cayman" }, - { "est", 0, -18000, "America/Chicago" }, - { "est", 0, -18000, "America/Coral_Harbour" }, - { "est", 0, -18000, "America/Detroit" }, - { "est", 0, -18000, "America/Fort_Wayne" }, - { "est", 0, -18000, "America/Grand_Turk" }, - { "est", 0, -18000, "America/Indiana/Indianapolis" }, - { "est", 0, -18000, "America/Indiana/Knox" }, - { "est", 0, -18000, "America/Indiana/Marengo" }, - { "est", 0, -18000, "America/Indiana/Vevay" }, - { "est", 0, -18000, "America/Indianapolis" }, - { "est", 0, -18000, "America/Iqaluit" }, - { "est", 0, -18000, "America/Jamaica" }, - { "est", 0, -18000, "America/Kentucky/Louisville" }, - { "est", 0, -18000, "America/Kentucky/Monticello" }, - { "est", 0, -18000, "America/Knox_IN" }, - { "est", 0, -18000, "America/Louisville" }, - { "est", 0, -18000, "America/Managua" }, - { "est", 0, -18000, "America/Menominee" }, - { "est", 0, -18000, "America/Merida" }, - { "est", 0, -18000, "America/Montreal" }, - { "est", 0, -18000, "America/Nassau" }, - { "est", 0, -18000, "America/Nipigon" }, - { "est", 0, -18000, "America/Panama" }, - { "est", 0, -18000, "America/Pangnirtung" }, - { "est", 0, -18000, "America/Port-au-Prince" }, - { "est", 0, -18000, "America/Rankin_Inlet" }, - { "est", 0, -18000, "America/Santo_Domingo" }, - { "est", 0, -18000, "America/Thunder_Bay" }, - { "est", 0, -18000, "America/Toronto" }, - { "est", 0, -18000, "Canada/Eastern" }, - { "est", 0, -18000, "CST6CDT" }, - { "est", 0, -18000, "EST" }, - { "est", 0, -18000, "EST5EDT" }, - { "est", 0, -18000, "Jamaica" }, - { "est", 0, -18000, "US/Central" }, - { "est", 0, -18000, "US/East-Indiana" }, - { "est", 0, -18000, "US/Eastern" }, - { "est", 0, -18000, "US/Indiana-Starke" }, - { "est", 0, -18000, "US/Michigan" }, - { "est", 0, 36000, "Australia/ACT" }, - { "est", 0, 36000, "Australia/Brisbane" }, - { "est", 0, 36000, "Australia/Canberra" }, - { "est", 0, 36000, "Australia/Currie" }, - { "est", 0, 36000, "Australia/Hobart" }, - { "est", 0, 36000, "Australia/Lindeman" }, - { "est", 0, 36000, "Australia/Melbourne" }, - { "est", 0, 36000, "Australia/NSW" }, - { "est", 0, 36000, "Australia/Queensland" }, - { "est", 0, 36000, "Australia/Sydney" }, - { "est", 0, 36000, "Australia/Tasmania" }, - { "est", 0, 36000, "Australia/Victoria" }, - { "est", 1, 39600, "Australia/Melbourne" }, - { "est", 1, 39600, "Australia/ACT" }, - { "est", 1, 39600, "Australia/Brisbane" }, - { "est", 1, 39600, "Australia/Canberra" }, - { "est", 1, 39600, "Australia/Currie" }, - { "est", 1, 39600, "Australia/Hobart" }, - { "est", 1, 39600, "Australia/Lindeman" }, - { "est", 1, 39600, "Australia/NSW" }, - { "est", 1, 39600, "Australia/Queensland" }, - { "est", 1, 39600, "Australia/Sydney" }, - { "est", 1, 39600, "Australia/Tasmania" }, - { "est", 1, 39600, "Australia/Victoria" }, - { "ewt", 1, -14400, "America/New_York" }, - { "ewt", 1, -14400, "America/Coral_Harbour" }, - { "ewt", 1, -14400, "America/Detroit" }, - { "ewt", 1, -14400, "America/Iqaluit" }, - { "ewt", 1, -14400, "America/Montreal" }, - { "ewt", 1, -14400, "America/Nipigon" }, - { "ewt", 1, -14400, "America/Thunder_Bay" }, - { "ewt", 1, -14400, "America/Toronto" }, - { "ewt", 1, -14400, "Canada/Eastern" }, - { "ewt", 1, -14400, "EST" }, - { "ewt", 1, -14400, "EST5EDT" }, - { "ewt", 1, -14400, "US/Eastern" }, - { "ewt", 1, -14400, "US/Michigan" }, - { "fjst", 1, 46800, "Pacific/Fiji" }, - { "fjt", 0, 43200, "Pacific/Fiji" }, - { "fkst", 1, -10800, "Atlantic/Stanley" }, - { "fkst", 1, -7200, "Atlantic/Stanley" }, - { "fkt", 0, -10800, "Atlantic/Stanley" }, - { "fkt", 0, -14400, "Atlantic/Stanley" }, - { "fnst", 1, -3600, "America/Noronha" }, - { "fnst", 1, -3600, "Brazil/DeNoronha" }, - { "fnt", 0, -7200, "America/Noronha" }, - { "fnt", 0, -7200, "Brazil/DeNoronha" }, - { "fort", 0, 14400, "Asia/Aqtau" }, - { "fort", 0, 18000, "Asia/Aqtau" }, - { "frust", 1, 21600, "Asia/Bishkek" }, - { "frust", 1, 25200, "Asia/Bishkek" }, - { "frut", 0, 18000, "Asia/Bishkek" }, - { "frut", 0, 21600, "Asia/Bishkek" }, - { "galt", 0, -21600, "Pacific/Galapagos" }, - { "gamt", 0, -32400, "Pacific/Gambier" }, - { "gbgt", 0, -13500, "America/Guyana" }, - { "gest", 1, 14400, "Asia/Tbilisi" }, - { "gest", 1, 18000, "Asia/Tbilisi" }, - { "get", 0, 10800, "Asia/Tbilisi" }, - { "get", 0, 14400, "Asia/Tbilisi" }, - { "gft", 0, -10800, "America/Cayenne" }, - { "gft", 0, -14400, "America/Cayenne" }, - { "ghst", 1, 1200, "Africa/Accra" }, - { "gmt", 0, 0, "Africa/Abidjan" }, - { "gmt", 0, 0, "Africa/Accra" }, - { "gmt", 0, 0, "Africa/Bamako" }, - { "gmt", 0, 0, "Africa/Banjul" }, - { "gmt", 0, 0, "Africa/Bissau" }, - { "gmt", 0, 0, "Africa/Conakry" }, - { "gmt", 0, 0, "Africa/Dakar" }, - { "gmt", 0, 0, "Africa/Freetown" }, - { "gmt", 0, 0, "Africa/Malabo" }, - { "gmt", 0, 0, "Africa/Monrovia" }, - { "gmt", 0, 0, "Africa/Niamey" }, - { "gmt", 0, 0, "Africa/Nouakchott" }, - { "gmt", 0, 0, "Africa/Ouagadougou" }, - { "gmt", 0, 0, "Africa/Porto-Novo" }, - { "gmt", 0, 0, "Africa/Sao_Tome" }, - { "gmt", 0, 0, "Africa/Timbuktu" }, - { "gmt", 0, 0, "America/Danmarkshavn" }, - { "gmt", 0, 0, "Atlantic/Reykjavik" }, - { "gmt", 0, 0, "Atlantic/St_Helena" }, - { "gmt", 0, 0, "Eire" }, - { "gmt", 0, 0, "Europe/Belfast" }, - { "gmt", 0, 0, "Europe/Dublin" }, - { "gmt", 0, 0, "Europe/Gibraltar" }, - { "gmt", 0, 0, "Europe/London" }, - { "gmt", 0, 0, "GB" }, - { "gmt", 0, 0, "GB-Eire" }, - { "gmt", 0, 0, "GMT" }, - { "gmt", 0, 0, "Iceland" }, - { "gst", 0, 14400, "Asia/Dubai" }, - { "gst", 0, 14400, "Asia/Bahrain" }, - { "gst", 0, 14400, "Asia/Muscat" }, - { "gst", 0, 14400, "Asia/Qatar" }, - { "gyt", 0, -10800, "America/Guyana" }, - { "gyt", 0, -13500, "America/Guyana" }, - { "gyt", 0, -14400, "America/Guyana" }, - { "hadt", 1, -32400, "America/Adak" }, - { "hadt", 1, -32400, "America/Atka" }, - { "hadt", 1, -32400, "US/Aleutian" }, - { "hast", 0, -36000, "America/Adak" }, - { "hast", 0, -36000, "America/Atka" }, - { "hast", 0, -36000, "US/Aleutian" }, - { "hdt", 1, -34200, "Pacific/Honolulu" }, - { "hdt", 1, -34200, "HST" }, - { "hdt", 1, -34200, "US/Hawaii" }, - { "hkst", 1, 32400, "Asia/Hong_Kong" }, - { "hkst", 1, 32400, "Hongkong" }, - { "hkt", 0, 28800, "Asia/Hong_Kong" }, - { "hkt", 0, 28800, "Hongkong" }, - { "hovst", 1, 28800, "Asia/Hovd" }, - { "hovt", 0, 21600, "Asia/Hovd" }, - { "hovt", 0, 25200, "Asia/Hovd" }, - { "hpt", 1, -34200, "Pacific/Honolulu" }, - { "hpt", 1, -34200, "HST" }, - { "hpt", 1, -34200, "US/Hawaii" }, - { "hst", 0, -36000, "Pacific/Honolulu" }, - { "hst", 0, -37800, "Pacific/Honolulu" }, - { "hst", 0, -36000, "HST" }, - { "hst", 0, -36000, "US/Hawaii" }, - { "hst", 0, -37800, "HST" }, - { "hst", 0, -37800, "US/Hawaii" }, - { "hwt", 1, -34200, "Pacific/Honolulu" }, - { "hwt", 1, -34200, "HST" }, - { "hwt", 1, -34200, "US/Hawaii" }, - { "ict", 0, 25200, "Asia/Bangkok" }, - { "ict", 0, 25200, "Asia/Phnom_Penh" }, - { "ict", 0, 25200, "Asia/Saigon" }, - { "ict", 0, 25200, "Asia/Vientiane" }, - { "ict", 0, 28800, "Asia/Phnom_Penh" }, - { "ict", 0, 28800, "Asia/Saigon" }, - { "ict", 0, 28800, "Asia/Vientiane" }, - { "iddt", 1, 14400, "Asia/Jerusalem" }, - { "iddt", 1, 14400, "Asia/Tel_Aviv" }, - { "iddt", 1, 14400, "Israel" }, - { "idt", 1, 10800, "Asia/Jerusalem" }, - { "idt", 1, 10800, "Asia/Gaza" }, - { "idt", 1, 10800, "Asia/Tel_Aviv" }, - { "idt", 1, 10800, "Israel" }, - { "ihst", 1, 21600, "Asia/Colombo" }, - { "iot", 0, 18000, "Indian/Chagos" }, - { "iot", 0, 21600, "Indian/Chagos" }, - { "irdt", 1, 16200, "Asia/Tehran" }, - { "irdt", 1, 18000, "Asia/Tehran" }, - { "irdt", 1, 16200, "Iran" }, - { "irdt", 1, 18000, "Iran" }, - { "irkst", 1, 28800, "Asia/Irkutsk" }, - { "irkst", 1, 32400, "Asia/Irkutsk" }, - { "irkt", 0, 25200, "Asia/Irkutsk" }, - { "irkt", 0, 28800, "Asia/Irkutsk" }, - { "irst", 0, 12600, "Asia/Tehran" }, - { "irst", 0, 14400, "Asia/Tehran" }, - { "irst", 0, 12600, "Iran" }, - { "irst", 0, 14400, "Iran" }, - { "isst", 1, 0, "Atlantic/Reykjavik" }, - { "isst", 1, 0, "Iceland" }, - { "ist", 0, 7200, "Asia/Jerusalem" }, - { "ist", 0, -3600, "Atlantic/Reykjavik" }, - { "ist", 0, -3600, "Iceland" }, - { "ist", 0, 19800, "Asia/Calcutta" }, - { "ist", 0, 19800, "Asia/Colombo" }, - { "ist", 0, 19800, "Asia/Dacca" }, - { "ist", 0, 19800, "Asia/Dhaka" }, - { "ist", 0, 19800, "Asia/Karachi" }, - { "ist", 0, 19800, "Asia/Katmandu" }, - { "ist", 0, 19800, "Asia/Thimbu" }, - { "ist", 0, 19800, "Asia/Thimphu" }, - { "ist", 1, 2079, "Eire" }, - { "ist", 1, 2079, "Europe/Dublin" }, - { "ist", 1, 23400, "Asia/Calcutta" }, - { "ist", 1, 23400, "Asia/Colombo" }, - { "ist", 1, 23400, "Asia/Karachi" }, - { "ist", 0, 3600, "Eire" }, - { "ist", 0, 3600, "Europe/Dublin" }, - { "ist", 1, 3600, "Eire" }, - { "ist", 1, 3600, "Europe/Dublin" }, - { "ist", 0, 7200, "Asia/Gaza" }, - { "ist", 0, 7200, "Asia/Tel_Aviv" }, - { "ist", 0, 7200, "Israel" }, - { "javt", 0, 26400, "Asia/Jakarta" }, - { "jdt", 1, 36000, "Asia/Tokyo" }, - { "jdt", 1, 36000, "Japan" }, - { "jst", 0, 32400, "Asia/Tokyo" }, - { "jst", 0, 32400, "Asia/Dili" }, - { "jst", 0, 32400, "Asia/Jakarta" }, - { "jst", 0, 32400, "Asia/Kuala_Lumpur" }, - { "jst", 0, 32400, "Asia/Kuching" }, - { "jst", 0, 32400, "Asia/Makassar" }, - { "jst", 0, 32400, "Asia/Manila" }, - { "jst", 0, 32400, "Asia/Pontianak" }, - { "jst", 0, 32400, "Asia/Rangoon" }, - { "jst", 0, 32400, "Asia/Sakhalin" }, - { "jst", 0, 32400, "Asia/Singapore" }, - { "jst", 0, 32400, "Asia/Ujung_Pandang" }, - { "jst", 0, 32400, "Japan" }, - { "jst", 0, 32400, "Pacific/Nauru" }, - { "jst", 0, 32400, "Singapore" }, - { "kart", 0, 18000, "Asia/Karachi" }, - { "kast", 0, 18000, "Asia/Kashgar" }, - { "kast", 0, 19800, "Asia/Kashgar" }, - { "kdt", 1, 32400, "Asia/Seoul" }, - { "kdt", 1, 36000, "Asia/Seoul" }, - { "kdt", 1, 32400, "ROK" }, - { "kdt", 1, 36000, "ROK" }, - { "kgst", 1, 21600, "Asia/Bishkek" }, - { "kgt", 0, 18000, "Asia/Bishkek" }, - { "kizst", 1, 21600, "Asia/Qyzylorda" }, - { "kizt", 0, 14400, "Asia/Qyzylorda" }, - { "kizt", 0, 18000, "Asia/Qyzylorda" }, - { "kizt", 0, 21600, "Asia/Qyzylorda" }, - { "kmt", 0, 5736, "Europe/Vilnius" }, - { "kost", 0, 39600, "Pacific/Kosrae" }, - { "kost", 0, 43200, "Pacific/Kosrae" }, - { "krast", 1, 25200, "Asia/Krasnoyarsk" }, - { "krast", 1, 28800, "Asia/Krasnoyarsk" }, - { "krat", 0, 21600, "Asia/Krasnoyarsk" }, - { "krat", 0, 25200, "Asia/Krasnoyarsk" }, - { "kst", 0, 28800, "Asia/Seoul" }, - { "kst", 0, 30600, "Asia/Seoul" }, - { "kst", 0, 32400, "Asia/Seoul" }, - { "kst", 0, 28800, "Asia/Pyongyang" }, - { "kst", 0, 28800, "ROK" }, - { "kst", 0, 30600, "Asia/Pyongyang" }, - { "kst", 0, 30600, "ROK" }, - { "kst", 0, 32400, "Asia/Pyongyang" }, - { "kst", 0, 32400, "ROK" }, - { "kuyst", 1, 10800, "Europe/Samara" }, - { "kuyst", 1, 14400, "Europe/Samara" }, - { "kuyst", 1, 18000, "Europe/Samara" }, - { "kuyt", 0, 10800, "Europe/Samara" }, - { "kuyt", 0, 14400, "Europe/Samara" }, - { "kwat", 0, -43200, "Pacific/Kwajalein" }, - { "kwat", 0, -43200, "Kwajalein" }, - { "lhst", 0, 37800, "Australia/Lord_Howe" }, - { "lhst", 1, 39600, "Australia/Lord_Howe" }, - { "lhst", 1, 41400, "Australia/Lord_Howe" }, - { "lhst", 0, 37800, "Australia/LHI" }, - { "lhst", 1, 39600, "Australia/LHI" }, - { "lhst", 1, 41400, "Australia/LHI" }, - { "lint", 0, -36000, "Pacific/Kiritimati" }, - { "lint", 0, 50400, "Pacific/Kiritimati" }, - { "lkt", 0, 21600, "Asia/Colombo" }, - { "lkt", 0, 23400, "Asia/Colombo" }, - { "lont", 0, 25200, "Asia/Chongqing" }, - { "lont", 0, 25200, "Asia/Chungking" }, - { "lrt", 0, -2670, "Africa/Monrovia" }, - { "lst", 1, 9384, "Europe/Riga" }, - { "madmt", 1, 3600, "Atlantic/Madeira" }, - { "madst", 1, 0, "Atlantic/Madeira" }, - { "madt", 0, -3600, "Atlantic/Madeira" }, - { "magst", 1, 39600, "Asia/Magadan" }, - { "magst", 1, 43200, "Asia/Magadan" }, - { "magt", 0, 36000, "Asia/Magadan" }, - { "magt", 0, 39600, "Asia/Magadan" }, - { "malst", 1, 26400, "Asia/Singapore" }, - { "malst", 1, 26400, "Asia/Kuala_Lumpur" }, - { "malst", 1, 26400, "Singapore" }, - { "malt", 0, 25200, "Asia/Singapore" }, - { "malt", 0, 26400, "Asia/Singapore" }, - { "malt", 0, 27000, "Asia/Singapore" }, - { "malt", 0, 25200, "Asia/Kuala_Lumpur" }, - { "malt", 0, 25200, "Singapore" }, - { "malt", 0, 26400, "Asia/Kuala_Lumpur" }, - { "malt", 0, 26400, "Singapore" }, - { "malt", 0, 27000, "Asia/Kuala_Lumpur" }, - { "malt", 0, 27000, "Singapore" }, - { "mart", 0, -34200, "Pacific/Marquesas" }, - { "mawt", 0, 21600, "Antarctica/Mawson" }, - { "mddt", 1, -18000, "America/Cambridge_Bay" }, - { "mddt", 1, -18000, "America/Yellowknife" }, - { "mdst", 1, 16248, "Europe/Moscow" }, - { "mdst", 1, 16248, "W-SU" }, - { "mdt", 1, -21600, "America/Denver" }, - { "mdt", 1, -21600, "America/Boise" }, - { "mdt", 1, -21600, "America/Cambridge_Bay" }, - { "mdt", 1, -21600, "America/Chihuahua" }, - { "mdt", 1, -21600, "America/Edmonton" }, - { "mdt", 1, -21600, "America/Hermosillo" }, - { "mdt", 1, -21600, "America/Inuvik" }, - { "mdt", 1, -21600, "America/Mazatlan" }, - { "mdt", 1, -21600, "America/North_Dakota/Center" }, - { "mdt", 1, -21600, "America/Phoenix" }, - { "mdt", 1, -21600, "America/Regina" }, - { "mdt", 1, -21600, "America/Shiprock" }, - { "mdt", 1, -21600, "America/Swift_Current" }, - { "mdt", 1, -21600, "America/Yellowknife" }, - { "mdt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mdt", 1, -21600, "Canada/Mountain" }, - { "mdt", 1, -21600, "Canada/Saskatchewan" }, - { "mdt", 1, -21600, "Mexico/BajaSur" }, - { "mdt", 1, -21600, "MST" }, - { "mdt", 1, -21600, "MST7MDT" }, - { "mdt", 1, -21600, "Navajo" }, - { "mdt", 1, -21600, "US/Arizona" }, - { "mdt", 1, -21600, "US/Mountain" }, - { "mest", 1, 7200, "MET" }, - { "met", 0, 3600, "MET" }, - { "mht", 0, 43200, "Pacific/Kwajalein" }, - { "mht", 0, 43200, "Kwajalein" }, - { "mht", 0, 43200, "Pacific/Majuro" }, - { "mmt", 0, 9048, "Europe/Moscow" }, - { "mmt", 0, 23400, "Asia/Rangoon" }, - { "mmt", 0, 28656, "Asia/Makassar" }, - { "mmt", 0, 28656, "Asia/Ujung_Pandang" }, - { "mmt", 0, 9048, "W-SU" }, - { "most", 1, 32400, "Asia/Macao" }, - { "most", 1, 32400, "Asia/Macau" }, - { "mot", 0, 28800, "Asia/Macao" }, - { "mot", 0, 28800, "Asia/Macau" }, - { "mpt", 1, -21600, "America/Denver" }, - { "mpt", 1, -21600, "America/Boise" }, - { "mpt", 1, -21600, "America/Cambridge_Bay" }, - { "mpt", 1, -21600, "America/Edmonton" }, - { "mpt", 1, -21600, "America/North_Dakota/Center" }, - { "mpt", 1, -21600, "America/Regina" }, - { "mpt", 1, -21600, "America/Shiprock" }, - { "mpt", 1, -21600, "America/Swift_Current" }, - { "mpt", 1, -21600, "America/Yellowknife" }, - { "mpt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mpt", 1, -21600, "Canada/Mountain" }, - { "mpt", 1, -21600, "Canada/Saskatchewan" }, - { "mpt", 1, -21600, "MST" }, - { "mpt", 1, -21600, "MST7MDT" }, - { "mpt", 1, -21600, "Navajo" }, - { "mpt", 1, -21600, "US/Mountain" }, - { "mpt", 0, 36000, "Pacific/Saipan" }, - { "msd", 1, 14400, "Europe/Moscow" }, - { "msd", 1, 18000, "Europe/Moscow" }, - { "msd", 1, 14400, "Europe/Chisinau" }, - { "msd", 1, 14400, "Europe/Kaliningrad" }, - { "msd", 1, 14400, "Europe/Kiev" }, - { "msd", 1, 14400, "Europe/Minsk" }, - { "msd", 1, 14400, "Europe/Riga" }, - { "msd", 1, 14400, "Europe/Simferopol" }, - { "msd", 1, 14400, "Europe/Tallinn" }, - { "msd", 1, 14400, "Europe/Tiraspol" }, - { "msd", 1, 14400, "Europe/Uzhgorod" }, - { "msd", 1, 14400, "Europe/Vilnius" }, - { "msd", 1, 14400, "Europe/Zaporozhye" }, - { "msd", 1, 14400, "W-SU" }, - { "msd", 1, 18000, "W-SU" }, - { "msk", 0, 10800, "Europe/Moscow" }, - { "msk", 0, 10800, "Europe/Chisinau" }, - { "msk", 0, 10800, "Europe/Kaliningrad" }, - { "msk", 0, 10800, "Europe/Kiev" }, - { "msk", 0, 10800, "Europe/Minsk" }, - { "msk", 0, 10800, "Europe/Riga" }, - { "msk", 0, 10800, "Europe/Simferopol" }, - { "msk", 0, 10800, "Europe/Tallinn" }, - { "msk", 0, 10800, "Europe/Tiraspol" }, - { "msk", 0, 10800, "Europe/Uzhgorod" }, - { "msk", 0, 10800, "Europe/Vilnius" }, - { "msk", 0, 10800, "Europe/Zaporozhye" }, - { "msk", 0, 10800, "W-SU" }, - { "mst", 0, -25200, "America/Denver" }, - { "mst", 0, -25200, "America/Boise" }, - { "mst", 0, -25200, "America/Cambridge_Bay" }, - { "mst", 0, -25200, "America/Chihuahua" }, - { "mst", 0, -25200, "America/Dawson_Creek" }, - { "mst", 0, -25200, "America/Edmonton" }, - { "mst", 0, -25200, "America/Ensenada" }, - { "mst", 0, -25200, "America/Hermosillo" }, - { "mst", 0, -25200, "America/Inuvik" }, - { "mst", 0, -25200, "America/Mazatlan" }, - { "mst", 0, -25200, "America/Mexico_City" }, - { "mst", 0, -25200, "America/North_Dakota/Center" }, - { "mst", 0, -25200, "America/Phoenix" }, - { "mst", 0, -25200, "America/Regina" }, - { "mst", 0, -25200, "America/Shiprock" }, - { "mst", 0, -25200, "America/Swift_Current" }, - { "mst", 0, -25200, "America/Tijuana" }, - { "mst", 0, -25200, "America/Yellowknife" }, - { "mst", 0, -25200, "Canada/East-Saskatchewan" }, - { "mst", 0, -25200, "Canada/Mountain" }, - { "mst", 0, -25200, "Canada/Saskatchewan" }, - { "mst", 0, -25200, "Mexico/BajaNorte" }, - { "mst", 0, -25200, "Mexico/BajaSur" }, - { "mst", 0, -25200, "Mexico/General" }, - { "mst", 0, -25200, "MST" }, - { "mst", 0, -25200, "MST7MDT" }, - { "mst", 0, -25200, "Navajo" }, - { "mst", 0, -25200, "US/Arizona" }, - { "mst", 0, -25200, "US/Mountain" }, - { "mst", 1, 12648, "Europe/Moscow" }, - { "mst", 1, 12648, "W-SU" }, - { "mut", 0, 14400, "Indian/Mauritius" }, - { "mvt", 0, 18000, "Indian/Maldives" }, - { "mwt", 1, -21600, "America/Denver" }, - { "mwt", 1, -21600, "America/Boise" }, - { "mwt", 1, -21600, "America/Cambridge_Bay" }, - { "mwt", 1, -21600, "America/Edmonton" }, - { "mwt", 1, -21600, "America/North_Dakota/Center" }, - { "mwt", 1, -21600, "America/Phoenix" }, - { "mwt", 1, -21600, "America/Regina" }, - { "mwt", 1, -21600, "America/Shiprock" }, - { "mwt", 1, -21600, "America/Swift_Current" }, - { "mwt", 1, -21600, "America/Yellowknife" }, - { "mwt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mwt", 1, -21600, "Canada/Mountain" }, - { "mwt", 1, -21600, "Canada/Saskatchewan" }, - { "mwt", 1, -21600, "MST" }, - { "mwt", 1, -21600, "MST7MDT" }, - { "mwt", 1, -21600, "Navajo" }, - { "mwt", 1, -21600, "US/Arizona" }, - { "mwt", 1, -21600, "US/Mountain" }, - { "myt", 0, 28800, "Asia/Kuala_Lumpur" }, - { "myt", 0, 28800, "Asia/Kuching" }, - { "ncst", 1, 43200, "Pacific/Noumea" }, - { "nct", 0, 39600, "Pacific/Noumea" }, - { "nddt", 1, -5400, "America/St_Johns" }, - { "nddt", 1, -5400, "Canada/Newfoundland" }, - { "ndt", 1, -9000, "America/St_Johns" }, - { "ndt", 1, -9052, "America/St_Johns" }, - { "ndt", 1, -36000, "Pacific/Midway" }, - { "ndt", 1, -9000, "America/Goose_Bay" }, - { "ndt", 1, -9000, "Canada/Newfoundland" }, - { "ndt", 1, -9052, "America/Goose_Bay" }, - { "ndt", 1, -9052, "Canada/Newfoundland" }, - { "negt", 0, -12600, "America/Paramaribo" }, - { "nest", 1, 4800, "Europe/Amsterdam" }, - { "net", 0, 1200, "Europe/Amsterdam" }, - { "nft", 0, 41400, "Pacific/Norfolk" }, - { "novst", 1, 25200, "Asia/Novosibirsk" }, - { "novst", 1, 28800, "Asia/Novosibirsk" }, - { "novt", 0, 21600, "Asia/Novosibirsk" }, - { "novt", 0, 25200, "Asia/Novosibirsk" }, - { "npt", 1, -9000, "America/St_Johns" }, - { "npt", 1, -36000, "America/Adak" }, - { "npt", 1, -36000, "America/Atka" }, - { "npt", 1, -36000, "America/Nome" }, - { "npt", 1, -36000, "US/Aleutian" }, - { "npt", 1, -9000, "America/Goose_Bay" }, - { "npt", 1, -9000, "Canada/Newfoundland" }, - { "npt", 0, 20700, "Asia/Katmandu" }, - { "nrt", 0, 41400, "Pacific/Nauru" }, - { "nrt", 0, 43200, "Pacific/Nauru" }, - { "nst", 0, -12600, "America/St_Johns" }, - { "nst", 0, -12652, "America/St_Johns" }, - { "nst", 0, -12600, "America/Goose_Bay" }, - { "nst", 0, -12600, "Canada/Newfoundland" }, - { "nst", 0, -12652, "America/Goose_Bay" }, - { "nst", 0, -12652, "Canada/Newfoundland" }, - { "nst", 0, -39600, "America/Adak" }, - { "nst", 0, -39600, "America/Atka" }, - { "nst", 0, -39600, "America/Nome" }, - { "nst", 0, -39600, "Pacific/Midway" }, - { "nst", 0, -39600, "Pacific/Pago_Pago" }, - { "nst", 0, -39600, "Pacific/Samoa" }, - { "nst", 0, -39600, "US/Aleutian" }, - { "nst", 0, -39600, "US/Samoa" }, - { "nst", 1, 4772, "Europe/Amsterdam" }, - { "nut", 0, -39600, "Pacific/Niue" }, - { "nut", 0, -41400, "Pacific/Niue" }, - { "nwt", 1, -9000, "America/St_Johns" }, - { "nwt", 1, -36000, "America/Adak" }, - { "nwt", 1, -36000, "America/Atka" }, - { "nwt", 1, -36000, "America/Nome" }, - { "nwt", 1, -36000, "US/Aleutian" }, - { "nwt", 1, -9000, "America/Goose_Bay" }, - { "nwt", 1, -9000, "Canada/Newfoundland" }, - { "nzdt", 1, 46800, "Pacific/Auckland" }, - { "nzdt", 1, 46800, "Antarctica/McMurdo" }, - { "nzdt", 1, 46800, "Antarctica/South_Pole" }, - { "nzdt", 1, 46800, "NZ" }, - { "nzmt", 0, 41400, "Pacific/Auckland" }, - { "nzmt", 0, 41400, "NZ" }, - { "nzst", 0, 43200, "Pacific/Auckland" }, - { "nzst", 1, 43200, "Pacific/Auckland" }, - { "nzst", 1, 45000, "Pacific/Auckland" }, - { "nzst", 0, 43200, "Antarctica/McMurdo" }, - { "nzst", 0, 43200, "Antarctica/South_Pole" }, - { "nzst", 0, 43200, "NZ" }, - { "nzst", 1, 43200, "NZ" }, - { "nzst", 1, 45000, "NZ" }, - { "omsst", 1, 21600, "Asia/Omsk" }, - { "omsst", 1, 25200, "Asia/Omsk" }, - { "omst", 0, 18000, "Asia/Omsk" }, - { "omst", 0, 21600, "Asia/Omsk" }, - { "orast", 1, 18000, "Asia/Oral" }, - { "orat", 0, 14400, "Asia/Oral" }, - { "orat", 0, 18000, "Asia/Oral" }, - { "pddt", 1, -21600, "America/Inuvik" }, - { "pdt", 1, -25200, "America/Los_Angeles" }, - { "pdt", 1, -25200, "America/Boise" }, - { "pdt", 1, -25200, "America/Dawson" }, - { "pdt", 1, -25200, "America/Dawson_Creek" }, - { "pdt", 1, -25200, "America/Ensenada" }, - { "pdt", 1, -25200, "America/Inuvik" }, - { "pdt", 1, -25200, "America/Juneau" }, - { "pdt", 1, -25200, "America/Tijuana" }, - { "pdt", 1, -25200, "America/Vancouver" }, - { "pdt", 1, -25200, "America/Whitehorse" }, - { "pdt", 1, -25200, "Canada/Pacific" }, - { "pdt", 1, -25200, "Canada/Yukon" }, - { "pdt", 1, -25200, "Mexico/BajaNorte" }, - { "pdt", 1, -25200, "PST8PDT" }, - { "pdt", 1, -25200, "US/Pacific" }, - { "pdt", 1, -25200, "US/Pacific-New" }, - { "pest", 1, -14400, "America/Lima" }, - { "petst", 1, 43200, "Asia/Kamchatka" }, - { "petst", 1, 46800, "Asia/Kamchatka" }, - { "pett", 0, 39600, "Asia/Kamchatka" }, - { "pett", 0, 43200, "Asia/Kamchatka" }, - { "pet", 0, -18000, "America/Lima" }, - { "phot", 0, -39600, "Pacific/Enderbury" }, - { "phot", 0, 46800, "Pacific/Enderbury" }, - { "phst", 1, 32400, "Asia/Manila" }, - { "pht", 0, 28800, "Asia/Manila" }, - { "pkst", 1, 21600, "Asia/Karachi" }, - { "pkt", 0, 18000, "Asia/Karachi" }, - { "pmdt", 1, -7200, "America/Miquelon" }, - { "pmst", 0, -10800, "America/Miquelon" }, - { "pmt", 0, -13236, "America/Paramaribo" }, - { "pmt", 0, -13252, "America/Paramaribo" }, - { "pmt", 0, 26240, "Asia/Pontianak" }, - { "pmt", 0, 36000, "Antarctica/DumontDUrville" }, - { "ppt", 1, -25200, "America/Los_Angeles" }, - { "ppt", 1, -25200, "America/Dawson_Creek" }, - { "ppt", 1, -25200, "America/Inuvik" }, - { "ppt", 1, -25200, "America/Juneau" }, - { "ppt", 1, -25200, "America/Vancouver" }, - { "ppt", 1, -25200, "Canada/Pacific" }, - { "ppt", 1, -25200, "PST8PDT" }, - { "ppt", 1, -25200, "US/Pacific" }, - { "ppt", 1, -25200, "US/Pacific-New" }, - { "pst", 0, -28800, "America/Los_Angeles" }, - { "pst", 0, -28800, "America/Boise" }, - { "pst", 0, -28800, "America/Dawson" }, - { "pst", 0, -28800, "America/Dawson_Creek" }, - { "pst", 0, -28800, "America/Ensenada" }, - { "pst", 0, -28800, "America/Hermosillo" }, - { "pst", 0, -28800, "America/Inuvik" }, - { "pst", 0, -28800, "America/Juneau" }, - { "pst", 0, -28800, "America/Mazatlan" }, - { "pst", 0, -28800, "America/Tijuana" }, - { "pst", 0, -28800, "America/Vancouver" }, - { "pst", 0, -28800, "America/Whitehorse" }, - { "pst", 0, -28800, "Canada/Pacific" }, - { "pst", 0, -28800, "Canada/Yukon" }, - { "pst", 0, -28800, "Mexico/BajaNorte" }, - { "pst", 0, -28800, "Mexico/BajaSur" }, - { "pst", 0, -28800, "Pacific/Pitcairn" }, - { "pst", 0, -28800, "PST8PDT" }, - { "pst", 0, -28800, "US/Pacific" }, - { "pst", 0, -28800, "US/Pacific-New" }, - { "pwt", 1, -25200, "America/Los_Angeles" }, - { "pwt", 1, -25200, "America/Dawson_Creek" }, - { "pwt", 1, -25200, "America/Ensenada" }, - { "pwt", 1, -25200, "America/Inuvik" }, - { "pwt", 1, -25200, "America/Juneau" }, - { "pwt", 1, -25200, "America/Tijuana" }, - { "pwt", 1, -25200, "America/Vancouver" }, - { "pwt", 1, -25200, "Canada/Pacific" }, - { "pwt", 1, -25200, "Mexico/BajaNorte" }, - { "pwt", 1, -25200, "PST8PDT" }, - { "pwt", 1, -25200, "US/Pacific" }, - { "pwt", 1, -25200, "US/Pacific-New" }, - { "pyst", 1, -10800, "America/Asuncion" }, - { "pyt", 0, -10800, "America/Asuncion" }, - { "pyt", 0, -14400, "America/Asuncion" }, - { "qyzst", 1, 25200, "Asia/Qyzylorda" }, - { "qyzt", 0, 18000, "Asia/Qyzylorda" }, - { "qyzt", 0, 21600, "Asia/Qyzylorda" }, - { "ret", 0, 14400, "Indian/Reunion" }, - { "rmt", 0, 5784, "Europe/Riga" }, - { "rott", 0, -10800, "Antarctica/Rothera" }, - { "sakst", 1, 39600, "Asia/Sakhalin" }, - { "sakst", 1, 43200, "Asia/Sakhalin" }, - { "sakt", 0, 36000, "Asia/Sakhalin" }, - { "sakt", 0, 39600, "Asia/Sakhalin" }, - { "samst", 1, 21600, "Asia/Samarkand" }, - { "samst", 1, 18000, "Europe/Samara" }, - { "samt", 0, 14400, "Asia/Samarkand" }, - { "samt", 0, 18000, "Asia/Samarkand" }, - { "samt", 0, -41400, "Pacific/Apia" }, - { "samt", 0, -41400, "Pacific/Pago_Pago" }, - { "samt", 0, -41400, "Pacific/Samoa" }, - { "samt", 0, -41400, "US/Samoa" }, - { "samt", 0, 14400, "Europe/Samara" }, - { "sast", 1, 10800, "Africa/Johannesburg" }, - { "sast", 0, 7200, "Africa/Johannesburg" }, - { "sast", 1, 10800, "Africa/Maseru" }, - { "sast", 1, 10800, "Africa/Windhoek" }, - { "sast", 0, 7200, "Africa/Maseru" }, - { "sast", 0, 7200, "Africa/Mbabane" }, - { "sast", 0, 7200, "Africa/Windhoek" }, - { "sbt", 0, 39600, "Pacific/Guadalcanal" }, - { "sct", 0, 14400, "Indian/Mahe" }, - { "sgt", 0, 27000, "Asia/Singapore" }, - { "sgt", 0, 28800, "Asia/Singapore" }, - { "sgt", 0, 27000, "Singapore" }, - { "sgt", 0, 28800, "Singapore" }, - { "shest", 1, 21600, "Asia/Aqtau" }, - { "shet", 0, 18000, "Asia/Aqtau" }, - { "shet", 0, 21600, "Asia/Aqtau" }, - { "slst", 1, -1200, "Africa/Freetown" }, - { "slst", 1, 3600, "Africa/Freetown" }, - { "smt", 0, 25580, "Asia/Saigon" }, - { "smt", 0, 25580, "Asia/Phnom_Penh" }, - { "smt", 0, 25580, "Asia/Vientiane" }, - { "srt", 0, -10800, "America/Paramaribo" }, - { "srt", 0, -12600, "America/Paramaribo" }, - { "sst", 0, -39600, "Pacific/Samoa" }, - { "sst", 0, -39600, "Pacific/Midway" }, - { "sst", 0, -39600, "Pacific/Pago_Pago" }, - { "sst", 0, -39600, "US/Samoa" }, - { "svest", 1, 18000, "Asia/Yekaterinburg" }, - { "svest", 1, 21600, "Asia/Yekaterinburg" }, - { "svet", 0, 14400, "Asia/Yekaterinburg" }, - { "svet", 0, 18000, "Asia/Yekaterinburg" }, - { "syot", 0, 10800, "Antarctica/Syowa" }, - { "taht", 0, -36000, "Pacific/Tahiti" }, - { "tasst", 1, 21600, "Asia/Samarkand" }, - { "tasst", 1, 25200, "Asia/Samarkand" }, - { "tasst", 1, 21600, "Asia/Tashkent" }, - { "tasst", 1, 25200, "Asia/Tashkent" }, - { "tast", 0, 21600, "Asia/Samarkand" }, - { "tast", 0, 18000, "Asia/Tashkent" }, - { "tast", 0, 21600, "Asia/Tashkent" }, - { "tbist", 1, 14400, "Asia/Tbilisi" }, - { "tbist", 1, 18000, "Asia/Tbilisi" }, - { "tbit", 0, 10800, "Asia/Tbilisi" }, - { "tbit", 0, 14400, "Asia/Tbilisi" }, - { "tft", 0, 18000, "Indian/Kerguelen" }, - { "tjt", 0, 18000, "Asia/Dushanbe" }, - { "tlt", 0, 28800, "Asia/Dili" }, - { "tlt", 0, 32400, "Asia/Dili" }, - { "tmt", 0, 12344, "Asia/Tehran" }, - { "tmt", 0, 12344, "Iran" }, - { "tmt", 0, 14400, "Asia/Ashgabat" }, - { "tmt", 0, 14400, "Asia/Ashkhabad" }, - { "tmt", 0, 18000, "Asia/Ashgabat" }, - { "tmt", 0, 18000, "Asia/Ashkhabad" }, - { "tmt", 0, 5940, "Europe/Tallinn" }, - { "tost", 1, 50400, "Pacific/Tongatapu" }, - { "tot", 0, 46800, "Pacific/Tongatapu" }, - { "trst", 1, 14400, "Europe/Istanbul" }, - { "trst", 1, 14400, "Asia/Istanbul" }, - { "trst", 1, 14400, "Turkey" }, - { "trt", 0, 10800, "Europe/Istanbul" }, - { "trt", 0, 10800, "Asia/Istanbul" }, - { "trt", 0, 10800, "Turkey" }, - { "ulast", 1, 32400, "Asia/Ulaanbaatar" }, - { "ulast", 1, 32400, "Asia/Ulan_Bator" }, - { "ulat", 0, 25200, "Asia/Ulaanbaatar" }, - { "ulat", 0, 28800, "Asia/Ulaanbaatar" }, - { "ulat", 0, 25200, "Asia/Choibalsan" }, - { "ulat", 0, 25200, "Asia/Ulan_Bator" }, - { "ulat", 0, 28800, "Asia/Choibalsan" }, - { "ulat", 0, 28800, "Asia/Ulan_Bator" }, - { "urast", 1, 18000, "Asia/Oral" }, - { "urast", 1, 21600, "Asia/Oral" }, - { "urat", 0, 14400, "Asia/Oral" }, - { "urat", 0, 18000, "Asia/Oral" }, - { "urat", 0, 21600, "Asia/Oral" }, - { "urut", 0, 21600, "Asia/Urumqi" }, - { "uyhst", 1, -10800, "America/Montevideo" }, - { "uyhst", 1, -9000, "America/Montevideo" }, - { "uyst", 1, -7200, "America/Montevideo" }, - { "uyt", 0, -10800, "America/Montevideo" }, - { "uyt", 0, -12600, "America/Montevideo" }, - { "uzst", 1, 21600, "Asia/Samarkand" }, - { "uzst", 1, 21600, "Asia/Tashkent" }, - { "uzt", 0, 18000, "Asia/Samarkand" }, - { "uzt", 0, 18000, "Asia/Tashkent" }, - { "vet", 0, -14400, "America/Caracas" }, - { "vet", 0, -16200, "America/Caracas" }, - { "vlasst", 1, 36000, "Asia/Vladivostok" }, - { "vlast", 0, 32400, "Asia/Vladivostok" }, - { "vlast", 1, 39600, "Asia/Vladivostok" }, - { "vlat", 0, 32400, "Asia/Vladivostok" }, - { "vlat", 0, 36000, "Asia/Vladivostok" }, - { "vost", 0, 21600, "Antarctica/Vostok" }, - { "vust", 1, 43200, "Pacific/Efate" }, - { "vut", 0, 39600, "Pacific/Efate" }, - { "warst", 1, -10800, "America/Mendoza" }, - { "warst", 1, -10800, "America/Argentina/Jujuy" }, - { "warst", 1, -10800, "America/Argentina/Mendoza" }, - { "warst", 1, -10800, "America/Jujuy" }, - { "wart", 0, -14400, "America/Mendoza" }, - { "wart", 0, -14400, "America/Argentina/Catamarca" }, - { "wart", 0, -14400, "America/Argentina/ComodRivadavia" }, - { "wart", 0, -14400, "America/Argentina/Cordoba" }, - { "wart", 0, -14400, "America/Argentina/Jujuy" }, - { "wart", 0, -14400, "America/Argentina/La_Rioja" }, - { "wart", 0, -14400, "America/Argentina/Mendoza" }, - { "wart", 0, -14400, "America/Argentina/Rio_Gallegos" }, - { "wart", 0, -14400, "America/Argentina/San_Juan" }, - { "wart", 0, -14400, "America/Argentina/Tucuman" }, - { "wart", 0, -14400, "America/Argentina/Ushuaia" }, - { "wart", 0, -14400, "America/Catamarca" }, - { "wart", 0, -14400, "America/Cordoba" }, - { "wart", 0, -14400, "America/Jujuy" }, - { "wart", 0, -14400, "America/Rosario" }, - { "wast", 1, 7200, "Africa/Windhoek" }, - { "wast", 1, 7200, "Africa/Ndjamena" }, - { "wat", 0, -3600, "Africa/Dakar" }, - { "wat", 0, -3600, "Africa/Bamako" }, - { "wat", 0, -3600, "Africa/Banjul" }, - { "wat", 0, -3600, "Africa/Bissau" }, - { "wat", 0, -3600, "Africa/Conakry" }, - { "wat", 0, -3600, "Africa/El_Aaiun" }, - { "wat", 0, -3600, "Africa/Freetown" }, - { "wat", 0, -3600, "Africa/Niamey" }, - { "wat", 0, -3600, "Africa/Nouakchott" }, - { "wat", 0, -3600, "Africa/Timbuktu" }, - { "wat", 0, 0, "Africa/Freetown" }, - { "wat", 0, 3600, "Africa/Brazzaville" }, - { "wat", 0, 3600, "Africa/Bangui" }, - { "wat", 0, 3600, "Africa/Douala" }, - { "wat", 0, 3600, "Africa/Lagos" }, - { "wat", 0, 3600, "Africa/Libreville" }, - { "wat", 0, 3600, "Africa/Luanda" }, - { "wat", 0, 3600, "Africa/Malabo" }, - { "wat", 0, 3600, "Africa/Ndjamena" }, - { "wat", 0, 3600, "Africa/Niamey" }, - { "wat", 0, 3600, "Africa/Porto-Novo" }, - { "wat", 0, 3600, "Africa/Windhoek" }, - { "wemt", 1, 7200, "Europe/Lisbon" }, - { "wemt", 1, 7200, "Europe/Madrid" }, - { "wemt", 1, 7200, "Europe/Monaco" }, - { "wemt", 1, 7200, "Europe/Paris" }, - { "wemt", 1, 7200, "Portugal" }, - { "wemt", 1, 7200, "WET" }, - { "west", 1, 3600, "Europe/Paris" }, - { "west", 1, 3600, "Africa/Algiers" }, - { "west", 1, 3600, "Africa/Casablanca" }, - { "west", 1, 3600, "Africa/Ceuta" }, - { "west", 1, 3600, "Atlantic/Canary" }, - { "west", 1, 3600, "Atlantic/Faeroe" }, - { "west", 1, 3600, "Atlantic/Madeira" }, - { "west", 1, 3600, "Europe/Brussels" }, - { "west", 1, 3600, "Europe/Lisbon" }, - { "west", 1, 3600, "Europe/Luxembourg" }, - { "west", 1, 3600, "Europe/Madrid" }, - { "west", 1, 3600, "Europe/Monaco" }, - { "west", 1, 3600, "Portugal" }, - { "west", 1, 3600, "WET" }, - { "west", 1, 7200, "Europe/Luxembourg" }, - { "wet", 0, 0, "Europe/Paris" }, - { "wet", 0, 0, "Africa/Algiers" }, - { "wet", 0, 0, "Africa/Casablanca" }, - { "wet", 0, 0, "Africa/Ceuta" }, - { "wet", 0, 0, "Africa/El_Aaiun" }, - { "wet", 0, 0, "Atlantic/Azores" }, - { "wet", 0, 0, "Atlantic/Canary" }, - { "wet", 0, 0, "Atlantic/Faeroe" }, - { "wet", 0, 0, "Atlantic/Madeira" }, - { "wet", 0, 0, "Europe/Brussels" }, - { "wet", 0, 0, "Europe/Lisbon" }, - { "wet", 0, 0, "Europe/Luxembourg" }, - { "wet", 0, 0, "Europe/Madrid" }, - { "wet", 0, 0, "Europe/Monaco" }, - { "wet", 0, 0, "Portugal" }, - { "wet", 0, 0, "WET" }, - { "wet", 0, 3600, "Europe/Luxembourg" }, - { "wgst", 1, -7200, "America/Godthab" }, - { "wgst", 1, -7200, "America/Danmarkshavn" }, - { "wgt", 0, -10800, "America/Godthab" }, - { "wgt", 0, -10800, "America/Danmarkshavn" }, - { "wit", 0, 25200, "Asia/Jakarta" }, - { "wit", 0, 27000, "Asia/Jakarta" }, - { "wit", 0, 28800, "Asia/Jakarta" }, - { "wit", 0, 25200, "Asia/Pontianak" }, - { "wit", 0, 27000, "Asia/Pontianak" }, - { "wit", 0, 28800, "Asia/Pontianak" }, - { "wst", 0, 28800, "Australia/Perth" }, - { "wst", 1, 32400, "Australia/Perth" }, - { "wst", 0, -39600, "Pacific/Apia" }, - { "wst", 0, 28800, "Antarctica/Casey" }, - { "wst", 0, 28800, "Australia/West" }, - { "wst", 1, 32400, "Australia/West" }, - { "yakst", 1, 32400, "Asia/Yakutsk" }, - { "yakst", 1, 36000, "Asia/Yakutsk" }, - { "yakt", 0, 28800, "Asia/Yakutsk" }, - { "yakt", 0, 32400, "Asia/Yakutsk" }, - { "yddt", 1, -25200, "America/Dawson" }, - { "yddt", 1, -25200, "America/Whitehorse" }, - { "yddt", 1, -25200, "Canada/Yukon" }, - { "ydt", 1, -28800, "America/Dawson" }, - { "ydt", 1, -28800, "America/Whitehorse" }, - { "ydt", 1, -28800, "America/Yakutat" }, - { "ydt", 1, -28800, "Canada/Yukon" }, - { "yekst", 1, 21600, "Asia/Yekaterinburg" }, - { "yekt", 0, 18000, "Asia/Yekaterinburg" }, - { "yerst", 1, 14400, "Asia/Yerevan" }, - { "yerst", 1, 18000, "Asia/Yerevan" }, - { "yert", 0, 10800, "Asia/Yerevan" }, - { "yert", 0, 14400, "Asia/Yerevan" }, - { "ypt", 1, -28800, "America/Dawson" }, - { "ypt", 1, -28800, "America/Whitehorse" }, - { "ypt", 1, -28800, "America/Yakutat" }, - { "ypt", 1, -28800, "Canada/Yukon" }, - { "yst", 0, -32400, "America/Anchorage" }, - { "yst", 0, -32400, "America/Dawson" }, - { "yst", 0, -32400, "America/Juneau" }, - { "yst", 0, -32400, "America/Nome" }, - { "yst", 0, -32400, "America/Whitehorse" }, - { "yst", 0, -32400, "America/Yakutat" }, - { "yst", 0, -32400, "Canada/Yukon" }, - { "yst", 0, -32400, "US/Alaska" }, - { "ywt", 1, -28800, "America/Dawson" }, - { "ywt", 1, -28800, "America/Whitehorse" }, - { "ywt", 1, -28800, "America/Yakutat" }, - { "ywt", 1, -28800, "Canada/Yukon" }, - { "a", 0, 3600, NULL }, - { "b", 0, 7200, NULL }, - { "c", 0, 10800, NULL }, - { "d", 0, 14400, NULL }, - { "e", 0, 18000, NULL }, - { "f", 0, 21600, NULL }, - { "g", 0, 25200, NULL }, - { "h", 0, 28800, NULL }, - { "i", 0, 32400, NULL }, - { "k", 0, 36000, NULL }, - { "l", 0, 39600, NULL }, - { "m", 0, 43200, NULL }, - { "n", 0, -3600, NULL }, - { "o", 0, -7200, NULL }, - { "p", 0, -10800, NULL }, - { "q", 0, -14400, NULL }, - { "r", 0, -18000, NULL }, - { "s", 0, -21600, NULL }, - { "t", 0, -25200, NULL }, - { "u", 0, -28800, NULL }, - { "v", 0, -32400, NULL }, - { "w", 0, -36000, NULL }, - { "x", 0, -39600, NULL }, - { "y", 0, -43200, NULL }, - { "zzz", 0, 0, "Antarctica/Davis" }, - { "zzz", 0, 0, "Antarctica/DumontDUrville" }, - { "z", 0, 0, NULL }, diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c deleted file mode 100644 index dfc32b4d87aac..0000000000000 --- a/ext/date/lib/tm2unixtime.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -/* jan feb mrt apr may jun jul aug sep oct nov dec */ -static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - -/* dec jan feb mrt apr may jun jul aug sep oct nov dec */ -static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - -static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b) -{ - if (*a < start) { - *a += adj; - (*b)--; - return 1; - } - if (*a >= end) { - if (start == 0) { - (*b) += (*a / end); - (*a) -= (end * (*a / end)); - return 0; - } - - *a -= adj; - (*b)++; - return 1; - } - return 0; -} - -static int do_range_limit_days(timelib_sll *y, timelib_sll *m, timelib_sll *d) -{ - timelib_sll leapyear; - timelib_sll days_this_month; - timelib_sll last_month, last_year; - timelib_sll days_last_month; - - do_range_limit(1, 13, 12, m, y); - - leapyear = timelib_is_leap(*y); - days_this_month = leapyear ? days_in_month_leap[*m] : days_in_month[*m]; - last_month = (*m) - 1; - - if (last_month < 1) { - last_month += 12; - last_year = (*y) - 1; - } else { - last_year = (*y); - } - leapyear = timelib_is_leap(last_year); - days_last_month = leapyear ? days_in_month_leap[last_month] : days_in_month[last_month]; - - if (*d <= 0) { - *d += days_last_month; - (*m)--; - return 1; - } - if (*d > days_this_month) { - *d -= days_this_month; - (*m)++; - return 1; - } - return 0; -} - -static void do_adjust_for_weekday(timelib_time* time) -{ - timelib_sll current_dow, difference; - - current_dow = timelib_day_of_week(time->y, time->m, time->d); - difference = time->relative.weekday - current_dow; - if ((time->relative.d < 0 && difference < 0) || (time->relative.d >= 0 && difference <= -time->relative.weekday_behavior)) { - difference += 7; - } - if (time->relative.weekday >= 0) { - time->d += difference; - } else { - time->d -= (7 - (abs(time->relative.weekday) - current_dow)); - } -} - -static void do_normalize(timelib_time* time) -{ - do {} while (do_range_limit(0, 60, 60, &time->s, &time->i)); - do {} while (do_range_limit(0, 60, 60, &time->i, &time->h)); - do {} while (do_range_limit(0, 24, 24, &time->h, &time->d)); - do {} while (do_range_limit(1, 13, 12, &time->m, &time->y)); - - do {} while (do_range_limit_days(&time->y, &time->m, &time->d)); - do {} while (do_range_limit(1, 13, 12, &time->m, &time->y)); -} - -static void do_adjust_relative(timelib_time* time) -{ - if (time->have_relative) { - time->s += time->relative.s; - time->i += time->relative.i; - time->h += time->relative.h; - - time->d += time->relative.d; - time->m += time->relative.m; - time->y += time->relative.y; - } - do_normalize(time); - - if (time->have_weekday_relative) { - do_adjust_for_weekday(time); - } - do_normalize(time); - memset(&(time->relative), 0, sizeof(time->relative)); -} - -static timelib_sll do_years(timelib_sll year) -{ - timelib_sll i; - timelib_sll res = 0; - - if (year >= 1970) { - for (i = year - 1; i >= 1970; i--) { - if (timelib_is_leap(i)) { - res += (DAYS_PER_LYEAR * SECS_PER_DAY); - } else { - res += (DAYS_PER_YEAR * SECS_PER_DAY); - } - } - } else { - for (i = 1969; i >= year; i--) { - if (timelib_is_leap(i)) { - res -= (DAYS_PER_LYEAR * SECS_PER_DAY); - } else { - res -= (DAYS_PER_YEAR * SECS_PER_DAY); - } - } - } - return res; -} - -static timelib_sll do_months(timelib_ull month, timelib_ull year) -{ - if (timelib_is_leap(year)) { - return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY); - } else { - return ((month_tab[month - 1]) * SECS_PER_DAY); - } -} - -static timelib_sll do_days(timelib_ull day) -{ - return ((day - 1) * SECS_PER_DAY); -} - -static timelib_sll do_time(timelib_ull hour, timelib_ull minute, timelib_ull second) -{ - timelib_sll res = 0; - - res += hour * 3600; - res += minute * 60; - res += second; - return res; -} - -static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi) -{ - switch (tz->zone_type) { - case TIMELIB_ZONETYPE_OFFSET: - - tz->is_localtime = 1; - return tz->z * 60; - break; - - case TIMELIB_ZONETYPE_ABBR: { - timelib_sll tmp; - - tz->is_localtime = 1; - tmp = tz->z; - tmp -= tz->dst * 60; - tmp *= 60; - return tmp; - } - break; - - case TIMELIB_ZONETYPE_ID: - tzi = tz->tz_info; - /* Break intentionally missing */ - - default: - /* No timezone in struct, fallback to reference if possible */ - if (tzi) { - timelib_time_offset *before, *after; - timelib_sll tmp; - int in_transistion; - - tz->is_localtime = 1; - before = timelib_get_time_zone_info(tz->sse, tzi); - after = timelib_get_time_zone_info(tz->sse - before->offset, tzi); - timelib_set_timezone(tz, tzi); - - in_transistion = ( - ((tz->sse - after->offset) >= (after->transistion_time + (before->offset - after->offset))) && - ((tz->sse - after->offset) < after->transistion_time) - ); - - if ((before->offset != after->offset) && !in_transistion) { - tmp = -after->offset; - } else { - tmp = -tz->z; - } - timelib_time_offset_dtor(before); - timelib_time_offset_dtor(after); - - return tmp; - } - } - return 0; -} - -void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi) -{ - timelib_sll res = 0; - - do_adjust_relative(time); - res += do_years(time->y); - res += do_months(time->m, time->y); - res += do_days(time->d); - res += do_time(time->h, time->i, time->s); - time->sse = res; - - res += do_adjust_timezone(time, tzi); - time->sse = res; - - time->sse_uptodate = 1; -} - -#if 0 -int main(void) -{ - timelib_sll res; - timelib_time time; - - time = timelib_strtotime("10 Feb 2005 06:07:03 PM CET"); /* 1108055223 */ - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - res = time2unixtime(&time); - printf("%Ld\n", res); - - return 0; -} -#endif diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c deleted file mode 100644 index 984187d3242b7..0000000000000 --- a/ext/date/lib/unixtime2tm.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -#define TIMELIB_LL_CONST(n) n ## i64 -#else -#define TIMELIB_LL_CONST(n) n ## ll -#endif - -static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - - -/* Converts a Unix timestamp value into broken down time, in GMT */ -void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts) -{ - timelib_sll days, remainder, tmp_days; - timelib_sll cur_year = 1970; - timelib_sll i; - timelib_sll hours, minutes, seconds; - int *months; - - days = ts / SECS_PER_DAY; - remainder = ts - (days * SECS_PER_DAY); - if (ts < 0 && remainder == 0) { - days++; - remainder -= SECS_PER_DAY; - } - DEBUG(printf("days=%lld, rem=%lld\n", days, remainder);); - - if (ts >= 0) { - tmp_days = days + 1; - while (tmp_days >= DAYS_PER_LYEAR) { - cur_year++; - if (timelib_is_leap(cur_year)) { - tmp_days -= DAYS_PER_LYEAR; - } else { - tmp_days -= DAYS_PER_YEAR; - } - } - } else { - tmp_days = days; - - /* Guess why this might be for, it has to do with a pope ;-). It's also - * only valid for Great Brittain and it's colonies. It needs fixing for - * other locales. *sigh*, why is this crap so complex! */ - if (ts <= TIMELIB_LL_CONST(-6857352000)) { - tmp_days -= 11; - } - - while (tmp_days <= 0) { - cur_year--; - DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);); - if (timelib_is_leap(cur_year)) { - tmp_days += DAYS_PER_LYEAR; - } else { - tmp_days += DAYS_PER_YEAR; - } - } - remainder += SECS_PER_DAY; - } - DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);); - - months = timelib_is_leap(cur_year) ? month_tab_leap : month_tab; - i = 11; - while (i > 0) { - DEBUG(printf("month=%lld (%d)\n", i, months[i]);); - if (tmp_days > months[i]) { - break; - } - i--; - } - DEBUG(printf("A: ts=%lld, year=%lld, month=%lld, day=%lld,", ts, cur_year, i + 1, tmp_days - months[i]);); - - /* That was the date, now we do the tiiiime */ - hours = remainder / 3600; - minutes = (remainder - hours * 3600) / 60; - seconds = remainder % 60; - DEBUG(printf(" hour=%lld, minute=%lld, second=%lld\n", hours, minutes, seconds);); - - tm->y = cur_year; - tm->m = i + 1; - tm->d = tmp_days - months[i]; - tm->h = hours; - tm->i = minutes; - tm->s = seconds; - tm->z = 0; - tm->dst = 0; - tm->sse = ts; - tm->sse_uptodate = 1; - tm->tim_uptodate = 1; - tm->is_localtime = 0; - tm->have_zone = 0; -} - -void timelib_update_from_sse(timelib_time *tm) -{ - timelib_sll sse; - - sse = tm->sse; - - switch (tm->zone_type) { - case TIMELIB_ZONETYPE_ABBR: - case TIMELIB_ZONETYPE_OFFSET: { - int z = tm->z; - signed int dst = tm->dst; - - timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60)); - - tm->is_localtime = 1; - tm->have_zone = 1; - tm->z = z; - tm->dst = dst; - goto cleanup; - } - - case TIMELIB_ZONETYPE_ID: { - timelib_time_offset *gmt_offset; - - gmt_offset = timelib_get_time_zone_info(tm->sse, tm->tz_info); - timelib_unixtime2gmt(tm, tm->sse + gmt_offset->offset); - timelib_time_offset_dtor(gmt_offset); - - goto cleanup; - } - - default: - timelib_unixtime2gmt(tm, tm->sse); - goto cleanup; - } -cleanup: - tm->sse = sse; - tm->is_localtime = 1; - tm->have_zone = 1; -} - -void timelib_unixtime2local(timelib_time *tm, timelib_sll ts, timelib_tzinfo* tz) -{ - timelib_time_offset *gmt_offset; - - gmt_offset = timelib_get_time_zone_info(ts, tz); - timelib_unixtime2gmt(tm, ts + gmt_offset->offset); - - /* we need to reset the sse here as unixtime2gmt modifies it */ - tm->sse = ts; - tm->dst = gmt_offset->is_dst; - tm->z = gmt_offset->offset; - tm->tz_info = tz; - - timelib_time_tz_abbr_update(tm, gmt_offset->abbr); - timelib_time_offset_dtor(gmt_offset); - - tm->is_localtime = 1; - tm->have_zone = 1; - tm->zone_type = TIMELIB_ZONETYPE_ID; -} - -void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz) -{ - timelib_time_offset *gmt_offset; - - gmt_offset = timelib_get_time_zone_info(t->sse, tz); - t->z = gmt_offset->offset; -/* - if (t->dst != gmt_offset->is_dst) { - printf("ERROR (%d, %d)\n", t->dst, gmt_offset->is_dst); - exit(1); - } -*/ - t->dst = gmt_offset->is_dst; - t->tz_info = tz; - if (t->tz_abbr) { - free(t->tz_abbr); - } - t->tz_abbr = strdup(gmt_offset->abbr); - timelib_time_offset_dtor(gmt_offset); - - t->have_zone = 1; - t->zone_type = TIMELIB_ZONETYPE_ID; -} - -/* Converts the time stored in the struct to localtime if localtime = true, - * otherwise it converts it to gmttime. This is only done when necessary - * ofcourse. */ -int timelib_apply_localtime(timelib_time *t, unsigned int localtime) -{ - if (localtime) { - /* Converting from GMT time to local time */ - DEBUG(printf("Converting from GMT time to local time\n");); - - /* Check if TZ is set */ - if (!t->tz_info) { - DEBUG(printf("E: No timezone configured, can't switch to local time\n");); - return -1; - } - - timelib_unixtime2local(t, t->sse, t->tz_info); - } else { - /* Converting from local time to GMT time */ - DEBUG(printf("Converting from local time to GMT time\n");); - - timelib_unixtime2gmt(t, t->sse); - } - return 0; -} diff --git a/ext/date/php_date.c b/ext/date/php_date.c deleted file mode 100644 index 5ed733ce1b13c..0000000000000 --- a/ext/date/php_date.c +++ /dev/null @@ -1,1615 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_streams.h" -#include "php_main.h" -#include "php_globals.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/php_versioning.h" -#include "php_date.h" -#include "lib/timelib.h" -#include -#include - -/* {{{ Function table */ -function_entry date_functions[] = { - PHP_FE(strtotime, NULL) - PHP_FE(date, NULL) - PHP_FE(gmdate, NULL) - PHP_FE(mktime, NULL) - PHP_FE(gmmktime, NULL) - PHP_FE(checkdate, NULL) - -#ifdef HAVE_STRFTIME - PHP_FE(strftime, NULL) - PHP_FE(gmstrftime, NULL) -#endif - - PHP_FE(time, NULL) - PHP_FE(localtime, NULL) - PHP_FE(getdate, NULL) - -#ifdef EXPERIMENTAL_DATE_SUPPORT - /* Advanced Interface */ - PHP_FE(date_create, NULL) - PHP_FE(date_format, NULL) - PHP_FE(date_format_locale, NULL) - PHP_FE(date_modify, NULL) - PHP_FE(date_timezone_get, NULL) - PHP_FE(date_timezone_set, NULL) - PHP_FE(date_offset_get, NULL) - - PHP_FE(date_time_set, NULL) - PHP_FE(date_date_set, NULL) - PHP_FE(date_isodate_set, NULL) - - PHP_FE(timezone_open, NULL) - PHP_FE(timezone_name_get, NULL) - PHP_FE(timezone_offset_get, NULL) - PHP_FE(timezone_transistions_get, NULL) - PHP_FE(timezone_identifiers_list, NULL) - PHP_FE(timezone_abbreviations_list, NULL) -#endif - - /* Options and Configuration */ - PHP_FE(date_default_timezone_set, NULL) - PHP_FE(date_default_timezone_get, NULL) - {NULL, NULL, NULL} -}; - -#ifdef EXPERIMENTAL_DATE_SUPPORT -function_entry date_funcs_date[] = { - ZEND_NAMED_FE(format, ZEND_FN(date_format), NULL) - ZEND_NAMED_FE(modify, ZEND_FN(date_modify), NULL) - ZEND_NAMED_FE(getTimezone, ZEND_FN(date_timezone_get), NULL) - ZEND_NAMED_FE(setTimezone, ZEND_FN(date_timezone_set), NULL) - ZEND_NAMED_FE(getOffset, ZEND_FN(date_offset_get), NULL) - ZEND_NAMED_FE(setTime, ZEND_FN(date_time_set), NULL) - ZEND_NAMED_FE(setDate, ZEND_FN(date_date_set), NULL) - ZEND_NAMED_FE(setISODate, ZEND_FN(date_isodate_set), NULL) - {NULL, NULL, NULL} -}; - -function_entry date_funcs_timezone[] = { - ZEND_NAMED_FE(getName, ZEND_FN(timezone_name_get), NULL) - ZEND_NAMED_FE(getOffset, ZEND_FN(timezone_offset_get), NULL) - ZEND_NAMED_FE(getTransistions, ZEND_FN(timezone_transistions_get), NULL) - ZEND_MALIAS(timezone, listAbbreviations, abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_MALIAS(timezone, listIdentifiers, identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} -}; - -static void date_register_classes(TSRMLS_D); -# define DATE_REGISTER_CLASSES date_register_classes(TSRMLS_C) -#else -# define DATE_REGISTER_CLASSES /* */ -#endif - -static char* guess_timezone(TSRMLS_D); -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(date) - -/* True global */ -timelib_tzdb *php_date_global_timezone_db; -int php_date_global_timezone_db_enabled; - -/* {{{ INI Settings */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals) -PHP_INI_END() -/* }}} */ - -#ifdef EXPERIMENTAL_DATE_SUPPORT -typedef struct _php_date_obj php_date_obj; -typedef struct _php_timezone_obj php_timezone_obj; - -struct _php_date_obj { - zend_object std; - timelib_time *time; -}; - -struct _php_timezone_obj { - zend_object std; - timelib_tzinfo *tz; -}; - -zend_class_entry *date_ce_date, *date_ce_timezone; - -static zend_object_handlers date_object_handlers_date; -static zend_object_handlers date_object_handlers_timezone; - -#define DATE_SET_CONTEXT \ - zval *object; \ - object = getThis(); \ - -#define DATE_FETCH_OBJECT \ - php_date_obj *obj; \ - DATE_SET_CONTEXT; \ - if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - } else { \ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \ - RETURN_FALSE; \ - } \ - } \ - obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \ - - -static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); -static void date_object_free_storage_date(void *object TSRMLS_DC); -static void date_object_free_storage_timezone(void *object TSRMLS_DC); -#endif - -/* {{{ Module struct */ -zend_module_entry date_module_entry = { - STANDARD_MODULE_HEADER, - "date", /* extension name */ - date_functions, /* function list */ - PHP_MINIT(date), /* process startup */ - PHP_MSHUTDOWN(date), /* process shutdown */ - PHP_RINIT(date), /* request startup */ - PHP_RSHUTDOWN(date), /* request shutdown */ - PHP_MINFO(date), /* extension info */ - PHP_VERSION, /* extension version */ - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - - -/* {{{ php_date_init_globals */ -static void php_date_init_globals(zend_date_globals *date_globals) -{ - date_globals->default_timezone = NULL; - date_globals->timezone = NULL; -} -/* }}} */ - - -static void _php_date_tzinfo_dtor(void *tzinfo) -{ - timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo; - - timelib_tzinfo_dtor(*tzi); -} - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(date) -{ - if (DATEG(timezone)) { - efree(DATEG(timezone)); - } - DATEG(timezone) = NULL; - zend_hash_init(&DATEG(tzcache), 4, NULL, _php_date_tzinfo_dtor, 0); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(date) -{ - if (DATEG(timezone)) { - efree(DATEG(timezone)); - } - DATEG(timezone) = NULL; - zend_hash_destroy(&DATEG(tzcache)); - - return SUCCESS; -} -/* }}} */ - -#define DATE_TIMEZONEDB php_date_global_timezone_db ? php_date_global_timezone_db : timelib_builtin_db() - -#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO" -#define DATE_FORMAT_RFC1036 "l, d-M-y H:i:s T" -#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s T" -#define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O" - -#define DATE_TZ_ERRMSG \ - "It is not safe to rely on the system's timezone settings. Please use " \ - "the date.timezone setting, the TZ environment variable or the " \ - "date_default_timezone_set() function. " - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(date) -{ - ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - DATE_REGISTER_CLASSES; - - REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); - - php_date_global_timezone_db = NULL; - php_date_global_timezone_db_enabled = 0; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(date) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(date) -{ - timelib_tzdb *tzdb = DATE_TIMEZONEDB; - - php_info_print_table_start(); - php_info_print_table_row(2, "date/time support", "enabled"); - php_info_print_table_row(2, "Timezone Database Version", tzdb->version); - php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal"); - php_info_print_table_row(2, "Default timezone", guess_timezone(TSRMLS_C)); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ Timezone Cache functions */ -static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, timelib_tzdb *tzdb TSRMLS_DC) -{ - timelib_tzinfo *tzi, **ptzi; - - if (zend_hash_find(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void **) &ptzi) == SUCCESS) { - return *ptzi; - } - - tzi = timelib_parse_tzfile(formal_tzname, tzdb); - if (tzi) { - zend_hash_add(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void *) &tzi, sizeof(timelib_tzinfo*), NULL); - } - return tzi; -} -/* }}} */ - -/* {{{ Helper functions */ -static char* guess_timezone(TSRMLS_D) -{ - char *env; - - /* Checking configure timezone */ - if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) { - return DATEG(timezone); - } - /* Check environment variable */ - env = getenv("TZ"); - if (env && *env) { - return env; - } - /* Check config setting for default timezone */ - if (DATEG(default_timezone) && (strlen(DATEG(default_timezone)) > 0)) { - return DATEG(default_timezone); - } -#if HAVE_TM_ZONE - /* Try to guess timezone from system information */ - { - struct tm *ta, tmbuf; - time_t the_time; - char *tzid; - - the_time = time(NULL); - ta = php_localtime_r(&the_time, &tmbuf); - tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst); - if (! tzid) { - tzid = "UTC"; - } - - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST"); - return tzid; - } -#endif -#ifdef PHP_WIN32 - { - char *tzid; - TIME_ZONE_INFORMATION tzi; - - switch (GetTimeZoneInformation(&tzi)) - { - /* no DST or not in effect */ - case TIME_ZONE_ID_UNKNOWN: - case TIME_ZONE_ID_STANDARD: -php_win_std_time: - tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.StandardBias) * -60, 0); - if (! tzid) { - tzid = "UTC"; - } - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); - break; - - /* DST in effect */ - case TIME_ZONE_ID_DAYLIGHT: - /* If user has disabled DST in the control panel, Windows returns 0 here */ - if (tzi.DaylightBias == 0) { - goto php_win_std_time; - } - - tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.DaylightBias) * -60, 1); - if (! tzid) { - tzid = "UTC"; - } - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); - break; - } - return tzid; - } -#endif - /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); - return "UTC"; -} - -static timelib_tzinfo *get_timezone_info(TSRMLS_D) -{ - char *tz; - timelib_tzinfo *tzi; - - tz = guess_timezone(TSRMLS_C); - tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); - if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone"); - tzi = php_date_parse_tzfile("UTC", DATE_TIMEZONEDB TSRMLS_CC); - - if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!"); - } - } - return tzi; -} -/* }}} */ - - -/* {{{ date() and gmdate() data */ -#include "ext/standard/php_smart_str.h" - -static char *mon_full_names[] = { - "January", "February", "March", "April", - "May", "June", "July", "August", - "September", "October", "November", "December" -}; - -static char *mon_short_names[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -static char *day_full_names[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" -}; - -static char *day_short_names[] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" -}; - -static char *am_pm_lower_names[] = { "am", "pm" }; -static char *am_pm_upper_names[] = { "AM", "PM" }; - -static char *english_suffix(timelib_sll number) -{ - if (number >= 10 && number <= 19) { - return "th"; - } else { - switch (number % 10) { - case 1: return "st"; - case 2: return "nd"; - case 3: return "rd"; - } - } - return "th"; -} -/* }}} */ - -/* {{{ date_format - (gm)date helper */ - -typedef struct { - int day_shortname_lengths[7]; - int day_fullname_lengths[7]; - int month_shortname_lengths[12]; - int month_fullname_lengths[12]; - int am_pm_lenghts[2]; - - char* day_shortname[7]; - char* day_fullname[7]; - char* month_shortname[12]; - char* month_fullname[12]; - char* am_pm_name[2]; -} php_locale_data; - -static const UChar sLongPat [] = { 0x004D, 0x004D, 0x004D, 0x004D, 0x0020, - 0x0079, 0x0079, 0x0079, 0x0079 }; - - -#define DATE_LOC_READ(type, var, cor) \ - count = udat_countSymbols(fmt, (type)); \ - for (i = 0 - (cor); i < count; i++) { \ - array[i] = (UChar *) malloc(sizeof(UChar) * 15); \ - \ - status = U_ZERO_ERROR; \ - j = udat_getSymbols(fmt, (type), i, array[i], 15, &status); \ - \ - tmp->var[i + (cor)] = array[i]; \ - } - -static php_locale_data* date_get_locale_data(char *locale) -{ - php_locale_data *tmp = malloc(sizeof(php_locale_data)); - UDateFormat *fmt; - UErrorCode status = 0; - int32_t count, i, j; - UChar *array[15]; - UChar *pat = sLongPat; - int32_t len = 9; - - fmt = udat_open(UDAT_IGNORE,UDAT_IGNORE, locale, NULL, 0, pat, len, &status); - - DATE_LOC_READ(UDAT_WEEKDAYS, day_fullname, -1); - DATE_LOC_READ(UDAT_SHORT_WEEKDAYS, day_shortname, -1); - DATE_LOC_READ(UDAT_MONTHS, month_fullname, 0); - DATE_LOC_READ(UDAT_SHORT_MONTHS, month_shortname, 0); - DATE_LOC_READ(UDAT_AM_PMS, am_pm_name, 0); - - udat_close(fmt); - - return tmp; -} - -static void date_free_locale_data(php_locale_data *data) -{ - int i; - for (i = 0; i < 7; ++i) { - free(data->day_shortname[i]); - free(data->day_fullname[i]); - } - for (i = 0; i < 12; ++i) { - free(data->month_shortname[i]); - free(data->month_fullname[i]); - } - free(data->am_pm_name[0]); - free(data->am_pm_name[1]); - free(data); -} - -static inline int date_spprintf(char **str, size_t size TSRMLS_DC, const char *format, ...) -{ - int c; - va_list ap; - - va_start(ap, format); - - if (UG(unicode)) { - c = vuspprintf(str, size, format, ap); - } else { - c = vspprintf(str, size, format, ap); - } - va_end(ap); - return c; -} - -#define dayname_short(s,l) l ? loc_dat->day_shortname[s] : day_short_names[s] -#define dayname_full(s,l) l ? loc_dat->day_fullname[s] : day_full_names[s] -#define monthname_short(s,l) l ? loc_dat->month_shortname[s] : mon_short_names[s] -#define monthname_full(s,l) l ? loc_dat->month_fullname[s] : mon_full_names[s] -#define am_pm_lower_full(s,l) l ? loc_dat->am_pm_name[s] : am_pm_lower_names[s] -#define am_pm_upper_full(s,l) l ? loc_dat->am_pm_name[s] : am_pm_upper_names[s] - -static char *date_format(char *format, int format_len, int *return_len, timelib_time *t, int localtime, int localized TSRMLS_DC) -{ - smart_str string = {0}; - int i, no_free, length; - char *buffer; - timelib_time_offset *offset; - timelib_sll isoweek, isoyear; - php_locale_data *loc_dat; - - if (!format_len) { - return estrdup(""); - } - - loc_dat = date_get_locale_data(UG(default_locale)); - - if (localtime) { - if (t->zone_type == TIMELIB_ZONETYPE_ABBR) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; - offset->leap_secs = 0; - offset->is_dst = t->dst; - offset->abbr = strdup(t->tz_abbr); - } else if (t->zone_type == TIMELIB_ZONETYPE_OFFSET) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; - offset->leap_secs = 0; - offset->is_dst = t->dst; - offset->abbr = malloc(9); /* GMTħxxxx\0 */ - snprintf(offset->abbr, 9, "GMT%c%02d%02d", - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 ); - } else { - offset = timelib_get_time_zone_info(t->sse, t->tz_info); - } - } - timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); - - for (i = 0; i < format_len; i++) { - no_free = 0; - switch (format[i]) { - /* day */ - case 'd': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->d); break; - case 'D': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, dayname_short(timelib_day_of_week(t->y, t->m, t->d), localized)); break; - case 'j': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) t->d); break; - case 'l': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, dayname_full(timelib_day_of_week(t->y, t->m, t->d), localized)); break; - case 'S': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%s", english_suffix(t->d)); break; - case 'w': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break; - case 'N': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break; - case 'z': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break; - - /* week */ - case 'W': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) isoweek); break; /* iso weeknr */ - case 'o': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) isoyear); break; /* iso year */ - - /* month */ - case 'F': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, monthname_full(t->m - 1, localized)); break; - case 'm': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->m); break; - case 'M': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, monthname_short(t->m - 1, localized)); break; - case 'n': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) t->m); break; - case 't': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) timelib_days_in_month(t->y, t->m)); break; - - /* year */ - case 'L': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", timelib_is_leap((int) t->y)); break; - case 'y': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->y % 100); break; - case 'Y': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%04d", (int) t->y); break; - - /* time */ - case 'a': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, am_pm_lower_full(t->h >= 12 ? 1 : 0, localized)); break; - case 'A': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%R", localized ? IS_UNICODE : IS_STRING, am_pm_upper_full(t->h >= 12 ? 1 : 0, localized)); break; - case 'B': length = date_spprintf(&buffer, 32 TSRMLS_CC, "[B unimplemented]"); break; - case 'g': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break; - case 'G': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) t->h); break; - case 'h': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break; - case 'H': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->h); break; - case 'i': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->i); break; - case 's': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->s); break; - - /* timezone */ - case 'I': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", localtime ? offset->is_dst : 0); break; - case 'O': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%c%02d%02d", - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'T': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%s", localtime ? offset->abbr : "GMT"); break; - case 'e': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%s", localtime ? t->tz_info->name : "UTC"); break; - case 'Z': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", localtime ? offset->offset : 0); break; - - /* full date/time */ - case 'c': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d", - (int) t->y, (int) t->m, (int) t->d, - (int) t->h, (int) t->i, (int) t->s, - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'r': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d", - day_short_names[timelib_day_of_week(t->y, t->m, t->d)], - (int) t->d, mon_short_names[t->m - 1], - (int) t->y, (int) t->h, (int) t->i, (int) t->s, - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'U': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%lld", (timelib_sll) t->sse); break; - - case '\\': if (i < format_len) i++; length = date_spprintf(&buffer, 32 TSRMLS_CC, "%c", format[i]); break; - - default: length = date_spprintf(&buffer, 32 TSRMLS_CC, "%c", format[i]); - break; - } - smart_str_appendl(&string, buffer, length); - if (!no_free) { - efree(buffer); - } - } - - smart_str_0(&string); - date_free_locale_data(loc_dat); - - if (localtime) { - timelib_time_offset_dtor(offset); - } - - if (UG(unicode)) { - *return_len = string.len / 2; - } else { - *return_len = string.len; - } - return string.c; -} - -static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) -{ - char *format; - int format_len; - time_t ts; - char *string; - - if (ZEND_NUM_ARGS() == 1) { - ts = time(NULL); - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { - RETURN_FALSE; - } - - string = php_format_date(format, format_len, ts, localtime TSRMLS_CC); - - if (UG(unicode)) { - RETVAL_UNICODE(string, 0); - } else { - RETVAL_STRING(string, 0); - } -} -/* }}} */ - -PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ -{ - timelib_time *t; - timelib_tzinfo *tzi; - char *string; - int return_len; - - t = timelib_time_ctor(); - - if (localtime) { - tzi = get_timezone_info(TSRMLS_C); - timelib_unixtime2local(t, ts, tzi); - } else { - tzi = NULL; - timelib_unixtime2gmt(t, ts); - } - - string = date_format(format, format_len, &return_len, t, localtime, 0 TSRMLS_CC); - - timelib_time_dtor(t); - return string; -} -/* }}} */ - -/* {{{ proto string date(string format [, long timestamp]) - Format a local date/time */ -PHP_FUNCTION(date) -{ - php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string gmdate(string format [, long timestamp]) - Format a GMT date/time */ -PHP_FUNCTION(gmdate) -{ - php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ php_date_set_tzdb - NOT THREADSAFE */ -PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) -{ - timelib_tzdb *builtin = timelib_builtin_db(); - - if (php_version_compare(tzdb->version, builtin->version) > 0) { - php_date_global_timezone_db = tzdb; - php_date_global_timezone_db_enabled = 1; - } -} -/* }}} */ - -/* {{{ php_parse_date: Backwards compability function */ -signed long php_parse_date(char *string, signed long *now) -{ - timelib_time *parsed_time; - int error1, error2; - signed long retval; - - parsed_time = timelib_strtotime(string, &error1, DATE_TIMEZONEDB); - timelib_update_ts(parsed_time, NULL); - retval = timelib_date_to_int(parsed_time, &error2); - timelib_time_dtor(parsed_time); - if (error1 || error2) { - return -1; - } - return retval; -} -/* }}} */ - - -/* {{{ proto int strtotime(string time, int now) - Convert string representation of date and time to a timestamp */ -PHP_FUNCTION(strtotime) -{ - char *times, *initial_ts; - int time_len, error1, error2; - long preset_ts, ts; - - timelib_time *t, *now; - timelib_tzinfo *tzi; - - tzi = get_timezone_info(TSRMLS_C); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", ×, &time_len, &preset_ts) != FAILURE) { - /* We have an initial timestamp */ - now = timelib_time_ctor(); - - initial_ts = emalloc(25); - snprintf(initial_ts, 24, "@%lu", preset_ts); - t = timelib_strtotime(initial_ts, &error1, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */ - timelib_update_ts(t, tzi); - timelib_unixtime2local(now, t->sse, tzi); - timelib_time_dtor(t); - efree(initial_ts); - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", ×, &time_len) != FAILURE) { - /* We have no initial timestamp */ - now = timelib_time_ctor(); - timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi); - } else { - RETURN_FALSE; - } - - t = timelib_strtotime(times, &error1, DATE_TIMEZONEDB); - timelib_fill_holes(t, now, 0); - timelib_update_ts(t, tzi); - ts = timelib_date_to_int(t, &error2); - - /* if tz_info is not a copy, avoid double free */ - if (now->tz_info != tzi) { - timelib_tzinfo_dtor(now->tz_info); - } - if (t->tz_info != tzi) { - timelib_tzinfo_dtor(t->tz_info); - } - - timelib_time_dtor(now); - timelib_time_dtor(t); - - if (error1 || error2) { - RETURN_FALSE; - } else { - RETURN_LONG(ts); - } -} -/* }}} */ - - -/* {{{ php_mktime - (gm)mktime helper */ -PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) -{ - long hou, min, sec, mon, day, yea, dst = -1; - timelib_time *now; - timelib_tzinfo *tzi; - long ts, adjust_seconds = 0; - int error; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) { - RETURN_FALSE; - } - /* Initialize structure with current time */ - now = timelib_time_ctor(); - if (gmt) { - timelib_unixtime2gmt(now, (timelib_sll) time(NULL)); - } else { - tzi = get_timezone_info(TSRMLS_C); - timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi); - } - /* Fill in the new data */ - switch (ZEND_NUM_ARGS()) { - case 7: - /* break intentionally missing */ - case 6: - if (yea >= 0 && yea < 70) { - yea += 2000; - } else if (yea >= 70 && yea <= 100) { - yea += 1900; - } - now->y = yea; - /* break intentionally missing again */ - case 5: - now->d = day; - /* break missing intentionally here too */ - case 4: - now->m = mon; - /* and here */ - case 3: - now->s = sec; - /* yup, this break isn't here on purpose too */ - case 2: - now->i = min; - /* last intentionally missing break */ - case 1: - now->h = hou; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead"); - } - /* Update the timestamp */ - if (gmt) { - timelib_update_ts(now, NULL); - } else { - timelib_update_ts(now, tzi); - } - /* Support for the deprecated is_dst parameter */ - if (dst != -1) { - php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated"); - if (gmt) { - /* GMT never uses DST */ - if (dst == 1) { - adjust_seconds = -3600; - } - } else { - /* Figure out is_dst for current TS */ - timelib_time_offset *tmp_offset; - tmp_offset = timelib_get_time_zone_info(now->sse, tzi); - if (dst == 1 && tmp_offset->is_dst == 0) { - adjust_seconds = -3600; - } - if (dst == 0 && tmp_offset->is_dst == 1) { - adjust_seconds = +3600; - } - timelib_time_offset_dtor(tmp_offset); - } - } - /* Clean up and return */ - ts = timelib_date_to_int(now, &error); - ts += adjust_seconds; - timelib_time_dtor(now); - - if (error) { - RETURN_FALSE; - } else { - RETURN_LONG(ts); - } -} -/* }}} */ - -/* {{{ proto int mktime(int hour, int min, int sec, int mon, int day, int year) - Get UNIX timestamp for a date */ -PHP_FUNCTION(mktime) -{ - php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int gmmktime(int hour, int min, int sec, int mon, int day, int year) - Get UNIX timestamp for a GMT date */ -PHP_FUNCTION(gmmktime) -{ - php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - - -/* {{{ proto bool checkdate(int month, int day, int year) - Returns true(1) if it is a valid date in gregorian calendar */ -PHP_FUNCTION(checkdate) -{ - long m, d, y; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) { - RETURN_FALSE; - } - - if (y < 1 || y > 32767 || m < 1 || m > 12 || d < 1 || d > timelib_days_in_month(y, m)) { - RETURN_FALSE; - } - RETURN_TRUE; /* True : This month, day, year arguments are valid */ -} -/* }}} */ - -#ifdef HAVE_STRFTIME -/* {{{ php_strftime - (gm)strftime helper */ -PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) -{ - char *format, *buf; - int format_len; - long timestamp; - struct tm ta; - int max_reallocs = 5; - size_t buf_len = 64, real_len; - timelib_time *ts; - timelib_tzinfo *tzi; - timelib_time_offset *offset; - - timestamp = (long) time(NULL); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, ×tamp) == FAILURE) { - RETURN_FALSE; - } - - if (format_len == 0) { - RETURN_FALSE; - } - - ts = timelib_time_ctor(); - if (gmt) { - tzi = NULL; - timelib_unixtime2gmt(ts, (timelib_sll) timestamp); - } else { - tzi = get_timezone_info(TSRMLS_C); - timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi); - } - ta.tm_sec = ts->s; - ta.tm_min = ts->i; - ta.tm_hour = ts->h; - ta.tm_mday = ts->d; - ta.tm_mon = ts->m - 1; - ta.tm_year = ts->y - 1900; - ta.tm_wday = timelib_day_of_week(ts->y, ts->m, ts->d); - ta.tm_yday = timelib_day_of_year(ts->y, ts->m, ts->d); - if (gmt) { - ta.tm_isdst = 0; -#if HAVE_TM_GMTOFF - ta.tm_gmtoff = 0; -#endif -#if HAVE_TM_ZONE - ta.tm_zone = "GMT"; -#endif - } else { - offset = timelib_get_time_zone_info(timestamp, tzi); - - ta.tm_isdst = offset->is_dst; -#if HAVE_TM_GMTOFF - ta.tm_gmtoff = offset->offset; -#endif -#if HAVE_TM_ZONE - ta.tm_zone = offset->abbr; -#endif - } - - buf = (char *) emalloc(buf_len); - while ((real_len=strftime(buf, buf_len, format, &ta))==buf_len || real_len==0) { - buf_len *= 2; - buf = (char *) erealloc(buf, buf_len); - if (!--max_reallocs) { - break; - } - } - - timelib_time_dtor(ts); - if (!gmt) { - timelib_time_offset_dtor(offset); - } - - if (real_len && real_len != buf_len) { - buf = (char *) erealloc(buf, real_len + 1); - RETURN_STRINGL(buf, real_len, 0); - } - efree(buf); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string strftime(string format [, int timestamp]) - Format a local time/date according to locale settings */ -PHP_FUNCTION(strftime) -{ - php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string gmstrftime(string format [, int timestamp]) - Format a GMT/UCT time/date according to locale settings */ -PHP_FUNCTION(gmstrftime) -{ - php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ -#endif - -/* {{{ proto int time(void) - Return current UNIX timestamp */ -PHP_FUNCTION(time) -{ - RETURN_LONG((long)time(NULL)); -} -/* }}} */ - -/* {{{ proto array localtime([int timestamp [, bool associative_array]]) - Returns the results of the C system call localtime as an associative array if the associative_array argument is set to 1 other wise it is a regular array */ -PHP_FUNCTION(localtime) -{ - long timestamp = (long)time(NULL); - int associative = 0; - timelib_tzinfo *tzi; - timelib_time *ts; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", ×tamp, &associative) == FAILURE) { - RETURN_FALSE; - } - - tzi = get_timezone_info(TSRMLS_C); - ts = timelib_time_ctor(); - timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi); - - array_init(return_value); - - if (associative) { - add_assoc_long(return_value, "tm_sec", ts->s); - add_assoc_long(return_value, "tm_min", ts->i); - add_assoc_long(return_value, "tm_hour", ts->h); - add_assoc_long(return_value, "tm_mday", ts->d); - add_assoc_long(return_value, "tm_mon", ts->m - 1); - add_assoc_long(return_value, "tm_year", ts->y - 1900); - add_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_isdst", ts->dst); - } else { - add_next_index_long(return_value, ts->s); - add_next_index_long(return_value, ts->i); - add_next_index_long(return_value, ts->h); - add_next_index_long(return_value, ts->d); - add_next_index_long(return_value, ts->m - 1); - add_next_index_long(return_value, ts->y- 1900); - add_next_index_long(return_value, timelib_day_of_week(ts->y, ts->m, ts->d)); - add_next_index_long(return_value, timelib_day_of_year(ts->y, ts->m, ts->d)); - add_next_index_long(return_value, ts->dst); - } - - timelib_time_dtor(ts); -} -/* }}} */ - -/* {{{ proto array getdate([int timestamp]) - Get date/time information */ -PHP_FUNCTION(getdate) -{ - long timestamp = (long)time(NULL); - timelib_tzinfo *tzi; - timelib_time *ts; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", ×tamp) == FAILURE) { - RETURN_FALSE; - } - - tzi = get_timezone_info(TSRMLS_C); - ts = timelib_time_ctor(); - timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi); - - array_init(return_value); - - add_assoc_long(return_value, "seconds", ts->s); - add_assoc_long(return_value, "minutes", ts->i); - add_assoc_long(return_value, "hours", ts->h); - add_assoc_long(return_value, "mday", ts->d); - add_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "mon", ts->m); - add_assoc_long(return_value, "year", ts->y); - add_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_string(return_value, "weekday", day_full_names[timelib_day_of_week(ts->y, ts->m, ts->d)], 1); - add_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1); - add_index_long(return_value, 0, timestamp); - - timelib_time_dtor(ts); -} -/* }}} */ - -#ifdef EXPERIMENTAL_DATE_SUPPORT -static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC) -{ - php_date_obj *intern; - zend_object_value retval; - - intern = emalloc(sizeof(php_date_obj)); - memset(intern, 0, sizeof(php_date_obj)); - intern->std.ce = class_type; - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC); - retval.handlers = &date_object_handlers_date; - - return retval; -} - -static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC) -{ - php_timezone_obj *intern; - zend_object_value retval; - - intern = emalloc(sizeof(php_timezone_obj)); - memset(intern, 0, sizeof(php_timezone_obj)); - intern->std.ce = class_type; - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC); - retval.handlers = &date_object_handlers_timezone; - - return retval; -} - -static void date_object_free_storage_date(void *object TSRMLS_DC) -{ - php_date_obj *intern = (php_date_obj *)object; - - if (intern->time->tz_info) { - timelib_tzinfo_dtor(intern->time->tz_info); - } - timelib_time_dtor(intern->time); - - efree(object); -} - -static void date_object_free_storage_timezone(void *object TSRMLS_DC) -{ - php_timezone_obj *intern = (php_timezone_obj *)object; - - efree(object); -} - -static void date_register_classes(TSRMLS_D) -{ - zend_class_entry ce_date, ce_timezone; - - INIT_CLASS_ENTRY(ce_date, "date", date_funcs_date); - ce_date.create_object = date_object_new_date; - date_ce_date = zend_register_internal_class_ex(&ce_date, NULL, NULL TSRMLS_CC); - memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - date_object_handlers_date.clone_obj = NULL; - - INIT_CLASS_ENTRY(ce_timezone, "timezone", date_funcs_timezone); - ce_timezone.create_object = date_object_new_timezone; - date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL, NULL TSRMLS_CC); - memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - date_object_handlers_timezone.clone_obj = NULL; -} - -/* Advanced Interface */ -static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; - return object; -} - -PHP_FUNCTION(date_create) -{ - php_date_obj *dateobj; - zval *timezone_object = NULL; - int error; - timelib_time *now; - timelib_tzinfo *tzi; - char *time_str; - int time_str_len = 0, free_tzi = 0;; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - - date_instanciate(date_ce_date, return_value TSRMLS_CC); - dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC); - dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", &error, DATE_TIMEZONEDB); - - if (timezone_object) { - php_timezone_obj *tzobj; - - tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC); - tzi = timelib_tzinfo_clone(tzobj->tz); - free_tzi = 1; - } else if (dateobj->time->tz_info) { - tzi = timelib_tzinfo_clone(dateobj->time->tz_info); - free_tzi = 1; - } else { - tzi = get_timezone_info(TSRMLS_C); - } - - now = timelib_time_ctor(); - timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi); - - timelib_fill_holes(dateobj->time, now, 0); - timelib_update_ts(dateobj->time, tzi); - - if (now->tz_info != tzi) { - timelib_tzinfo_dtor(now->tz_info); - } - if (free_tzi) { - timelib_tzinfo_dtor(tzi); - } - timelib_time_dtor(now); -} - -PHP_FUNCTION(date_format) -{ - zval *object; - php_date_obj *dateobj; - char *format, *str; - int format_len, length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &format, &format_len) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - str = date_format(format, format_len, &length, dateobj->time, dateobj->time->is_localtime, 0 TSRMLS_CC); - if (UG(unicode)) { - RETURN_UNICODEL((UChar*) str, length, 0); - } else { - RETURN_STRINGL(str, length, 0); - } -} - -PHP_FUNCTION(date_format_locale) -{ - zval *object; - php_date_obj *dateobj; - char *format, *str; - int format_len, length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &format, &format_len) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - - str = date_format(format, format_len, &length, dateobj->time, dateobj->time->is_localtime, 1 TSRMLS_CC); - if (UG(unicode)) { - RETURN_UNICODEL((UChar*)str, length, 0); - } else { - RETURN_STRINGL(str, length, 0); - } -} - -PHP_FUNCTION(date_modify) -{ - zval *object; - php_date_obj *dateobj; - char *modify; - int modify_len; - int error; - timelib_time *tmp_time; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - - tmp_time = timelib_strtotime(modify, &error, DATE_TIMEZONEDB); - dateobj->time->relative.y = tmp_time->relative.y; - dateobj->time->relative.m = tmp_time->relative.m; - dateobj->time->relative.d = tmp_time->relative.d; - dateobj->time->relative.h = tmp_time->relative.h; - dateobj->time->relative.i = tmp_time->relative.i; - dateobj->time->relative.s = tmp_time->relative.s; - dateobj->time->relative.weekday = tmp_time->relative.weekday; - dateobj->time->have_relative = tmp_time->have_relative; - dateobj->time->have_weekday_relative = tmp_time->have_weekday_relative; - dateobj->time->sse_uptodate = 0; - timelib_time_dtor(tmp_time); - - timelib_update_ts(dateobj->time, NULL); - timelib_update_from_sse(dateobj->time); -} - -PHP_FUNCTION(date_timezone_get) -{ - zval *object; - php_date_obj *dateobj; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - if (dateobj->time->is_localtime && dateobj->time->tz_info) { - date_instanciate(date_ce_timezone, return_value TSRMLS_CC); - tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC); - tzobj->tz = timelib_tzinfo_clone(dateobj->time->tz_info); - } else { - RETURN_FALSE; - } -} - -PHP_FUNCTION(date_timezone_set) -{ - zval *object; - zval *timezone_object; - php_date_obj *dateobj; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC); - if (dateobj->time->tz_info) { - timelib_tzinfo_dtor(dateobj->time->tz_info); - } - timelib_set_timezone(dateobj->time, timelib_tzinfo_clone(tzobj->tz)); - timelib_unixtime2local(dateobj->time, dateobj->time->sse, dateobj->time->tz_info); -} - -PHP_FUNCTION(date_offset_get) -{ - zval *object; - php_date_obj *dateobj; - timelib_time_offset *offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - if (dateobj->time->is_localtime && dateobj->time->tz_info) { - offset = timelib_get_time_zone_info(dateobj->time->sse, dateobj->time->tz_info); - RETVAL_LONG(offset->offset); - timelib_time_offset_dtor(offset); - return; - } else { - RETURN_LONG(0); - } -} - -PHP_FUNCTION(date_time_set) -{ - zval *object; - php_date_obj *dateobj; - long h, i, s = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - dateobj->time->h = h; - dateobj->time->i = i; - dateobj->time->s = s; - timelib_update_ts(dateobj->time, NULL); -} - -PHP_FUNCTION(date_date_set) -{ - zval *object; - php_date_obj *dateobj; - long y, m, d; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - dateobj->time->y = y; - dateobj->time->m = m; - dateobj->time->d = d; - timelib_update_ts(dateobj->time, NULL); -} - -PHP_FUNCTION(date_isodate_set) -{ - zval *object; - php_date_obj *dateobj; - long y, w, d = 1; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - dateobj->time->y = y; - dateobj->time->m = 1; - dateobj->time->d = 1; - dateobj->time->relative.d = timelib_daynr_from_weeknr(y, w, d); - dateobj->time->have_relative = 1; - - timelib_update_ts(dateobj->time, NULL); -} - - -PHP_FUNCTION(timezone_open) -{ - php_timezone_obj *tzobj; - char *tz; - int tz_len; - timelib_tzinfo *tzi = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) { - RETURN_FALSE; - } - /* Try finding the tz information as "Timezone Abbreviation" */ - if (!tzi) { - char *tzid; - - tzid = timelib_timezone_id_from_abbr(tz, -1, 0); - if (tzid) { - tzi = php_date_parse_tzfile(tzid, DATE_TIMEZONEDB TSRMLS_CC); - } - } - /* Try finding the tz information as "Timezone Identifier" */ - if (!tzi) { - tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); - } - /* If we find it we instantiate the object otherwise, well, we don't and return false */ - if (tzi) { - date_instanciate(date_ce_timezone, return_value TSRMLS_CC); - tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC); - tzobj->tz = tzi; - } else { - RETURN_FALSE; - } -} - -PHP_FUNCTION(timezone_name_get) -{ - zval *object; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - - RETURN_STRING(tzobj->tz->name, 1); -} - -PHP_FUNCTION(timezone_offset_get) -{ - zval *object, *dateobject; - php_timezone_obj *tzobj; - php_date_obj *dateobj; - timelib_time_offset *offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC); - - offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tz); - RETVAL_LONG(offset->offset); - timelib_time_offset_dtor(offset); -} - -PHP_FUNCTION(timezone_transistions_get) -{ - zval *object, *element; - php_timezone_obj *tzobj; - int i; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - - array_init(return_value); - for (i = 0; i < tzobj->tz->timecnt; ++i) { - MAKE_STD_ZVAL(element); - array_init(element); - add_assoc_long(element, "ts", tzobj->tz->trans[i]); - add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0); - add_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset); - add_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst); - add_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1); - - add_next_index_zval(return_value, element); - } -} - -PHP_FUNCTION(timezone_identifiers_list) -{ - timelib_tzdb *tzdb; - timelib_tzdb_index_entry *table; - int i, item_count; - - tzdb = DATE_TIMEZONEDB; - item_count = tzdb->index_size; - table = tzdb->index; - - array_init(return_value); - - for (i = 0; i < item_count; ++i) { - add_next_index_string(return_value, table[i].id, 1); - }; -} - -PHP_FUNCTION(timezone_abbreviations_list) -{ - timelib_tz_lookup_table *table, *entry; - zval *element, **abbr_array_pp, *abbr_array; - - table = timelib_timezone_abbreviations_list(); - array_init(return_value); - entry = table; - - do { - MAKE_STD_ZVAL(element); - array_init(element); - add_assoc_bool(element, "dst", entry->type); - add_assoc_long(element, "offset", entry->gmtoffset); - if (entry->full_tz_name) { - add_assoc_string(element, "timezone_id", entry->full_tz_name, 1); - } else { - add_assoc_null(element, "timezone_id"); - } - - if (zend_hash_find(HASH_OF(return_value), entry->name, strlen(entry->name) + 1, (void **) &abbr_array_pp) == FAILURE) { - MAKE_STD_ZVAL(abbr_array); - array_init(abbr_array); - add_assoc_zval(return_value, entry->name, abbr_array); - } else { - abbr_array = *abbr_array_pp; - } - add_next_index_zval(abbr_array, element); - entry++; - } while (entry->name); -} -#endif - - -/* {{{ proto bool date_default_timezone_set(string timezone_identifier) - Sets the default timezone used by all date/time functions in a script */ -PHP_FUNCTION(date_default_timezone_set) -{ - char *zone; - int zone_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) { - RETURN_FALSE; - } - if (DATEG(timezone)) { - efree(DATEG(timezone)); - DATEG(timezone) = NULL; - } - DATEG(timezone) = estrndup(zone, zone_len); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string date_default_timezone_get() - Gets the default timezone used by all date/time functions in a script */ -PHP_FUNCTION(date_default_timezone_get) -{ - timelib_tzinfo *default_tz; - - default_tz = get_timezone_info(TSRMLS_C); - RETVAL_STRING(default_tz->name, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/date/php_date.h b/ext/date/php_date.h deleted file mode 100644 index a564fc7a2497c..0000000000000 --- a/ext/date/php_date.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DATE_H -#define PHP_DATE_H - -#include "lib/timelib.h" -#include "Zend/zend_hash.h" - -extern zend_module_entry date_module_entry; -#define phpext_date_ptr &date_module_entry - -PHP_FUNCTION(date); -PHP_FUNCTION(gmdate); -PHP_FUNCTION(strtotime); - -PHP_FUNCTION(mktime); -PHP_FUNCTION(gmmktime); - -PHP_FUNCTION(checkdate); - -#ifdef HAVE_STRFTIME -PHP_FUNCTION(strftime); -PHP_FUNCTION(gmstrftime); -#endif - -PHP_FUNCTION(time); -PHP_FUNCTION(localtime); -PHP_FUNCTION(getdate); - -#ifdef EXPERIMENTAL_DATE_SUPPORT -/* Advanced Interface */ -PHP_FUNCTION(date_create); -PHP_FUNCTION(date_format); -PHP_FUNCTION(date_format_locale); -PHP_FUNCTION(date_modify); -PHP_FUNCTION(date_timezone_get); -PHP_FUNCTION(date_timezone_set); -PHP_FUNCTION(date_offset_get); - -PHP_FUNCTION(date_time_set); -PHP_FUNCTION(date_date_set); -PHP_FUNCTION(date_isodate_set); - -PHP_FUNCTION(timezone_open); -PHP_FUNCTION(timezone_name_get); -PHP_FUNCTION(timezone_offset_get); -PHP_FUNCTION(timezone_transistions_get); -PHP_FUNCTION(timezone_identifiers_list); -PHP_FUNCTION(timezone_abbreviations_list); -#endif - -/* Options and Configuration */ -PHP_FUNCTION(date_default_timezone_set); -PHP_FUNCTION(date_default_timezone_get); - -PHP_RINIT_FUNCTION(date); -PHP_RSHUTDOWN_FUNCTION(date); -PHP_MINIT_FUNCTION(date); -PHP_MSHUTDOWN_FUNCTION(date); -PHP_MINFO_FUNCTION(date); - -ZEND_BEGIN_MODULE_GLOBALS(date) - char *default_timezone; - char *timezone; - HashTable tzcache; -ZEND_END_MODULE_GLOBALS(date) - -#ifdef ZTS -#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v) -#else -#define DATEG(v) (date_globals.v) -#endif - -/* Backwards compability wrapper */ -signed long php_parse_date(char *string, signed long *now); -PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt); -#if HAVE_STRFTIME -#define _php_strftime php_strftime -PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); -#endif -PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC); - -/* Mechanism to set new TZ database */ -PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb); - -#endif /* PHP_DATE_H */ diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt deleted file mode 100644 index 7384b7424469b..0000000000000 --- a/ext/date/tests/002.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -strtotime() function ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** GMT0 -1999-10-13 00:00:00 -1999-10-13 00:00:00 -2000-01-19 00:00:00 -2000-01-19 00:00:00 -2001-12-21 00:00:00 -2001-12-21 00:00:00 -2001-12-21 12:16:00 -2001-12-21 12:16:00 -%d-12-21 12:16:00 -2001-10-22 21:19:58 -2001-10-22 23:19:58 -2001-10-22 23:32:58 -2001-10-22 19:19:58 -2001-10-22 19:06:58 -2001-10-23 01:00:58 -2001-10-22 23:19:58 -2001-10-22 19:06:58 -2001-10-22 19:05:00 -1996-12-30 00:00:00 -2004-03-01 05:00:00 -*** US/Eastern -1999-10-13 00:00:00 -1999-10-13 00:00:00 -2000-01-19 00:00:00 -2000-01-19 00:00:00 -2001-12-21 00:00:00 -2001-12-21 00:00:00 -2001-12-21 12:16:00 -2001-12-21 12:16:00 -%d-12-21 12:16:00 -2001-10-22 21:19:58 -2001-10-22 19:19:58 -2001-10-22 19:32:58 -2001-10-22 15:19:58 -2001-10-22 15:06:58 -2001-10-22 21:00:58 -2001-10-22 19:19:58 -2001-10-22 15:06:58 -2001-10-22 15:05:00 -1996-12-30 00:00:00 -2004-03-01 00:00:00 diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt deleted file mode 100644 index 5e54263c54932..0000000000000 --- a/ext/date/tests/bug13142.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #13142 (strtotime handling of "M d H:i:s Y" format) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Tue, 04 Sep 2001 16:39:45 -0400 -Tue, 04 Sep 2001 16:39:45 -0400 diff --git a/ext/date/tests/bug14561.phpt b/ext/date/tests/bug14561.phpt deleted file mode 100644 index e2b6ef098253a..0000000000000 --- a/ext/date/tests/bug14561.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #14561 (strtotime() bug) ---FILE-- - ---EXPECT-- -1134847800 -1134847800 diff --git a/ext/date/tests/bug17988.phpt b/ext/date/tests/bug17988.phpt deleted file mode 100644 index 259fa7dc2e3bd..0000000000000 --- a/ext/date/tests/bug17988.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #17988 (strtotime handling of postgresql timestamps) ---FILE-- - ---EXPECT-- -2002-06-25 14:18:48 -2002-06-25 14:18:48 -2002-06-25 13:18:48 -2002-06-25 12:18:48 -2002-06-25 18:18:48 -2002-06-25 14:18:48 -2002-06-25 14:18:48 -2002-06-25 18:18:48 -2002-06-25 10:18:48 -2002-06-25 17:18:48 -2002-06-25 11:18:48 -2002-06-25 17:48:48 -2002-06-25 10:48:48 diff --git a/ext/date/tests/bug20382-1.phpt b/ext/date/tests/bug20382-1.phpt deleted file mode 100644 index a259d934af1d6..0000000000000 --- a/ext/date/tests/bug20382-1.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover) ---FILE-- - ---EXPECT-- -tStamp=Wednesday 2004-10-27 17:17:17 CEST -result=Monday 2004-11-01 00:00:00 CET -wanted=Monday 2004-11-01 00:00:00 CET diff --git a/ext/date/tests/bug20382-2.phpt b/ext/date/tests/bug20382-2.phpt deleted file mode 100644 index 6e6a1ba6faef6..0000000000000 --- a/ext/date/tests/bug20382-2.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Bug #20382 [2] (strtotime ("Monday", $date) produces wrong result on DST changeover) ---FILE-- - ---EXPECT-- -Europe/Andorra -ts = Monday 2037-10-19 17:17:17 CEST -result = Monday 2037-10-26 00:00:00 CET -wanted = Monday 00:00:00 - -Asia/Dubai -ts = Thursday 1970-01-01 17:17:17 GST -result = Monday 1970-01-05 00:00:00 GST -wanted = Monday 00:00:00 - -Asia/Kabul -ts = Thursday 1970-01-01 17:17:17 AFT -result = Monday 1970-01-05 00:00:00 AFT -wanted = Monday 00:00:00 - -America/Antigua -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -America/Anguilla -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -Europe/Tirane -ts = Monday 1983-04-11 17:17:17 CET -result = Monday 1983-04-18 01:00:00 CEST -wanted = Monday 00:00:00 - -Asia/Yerevan -ts = Monday 2037-10-19 17:17:17 AMST -result = Monday 2037-10-26 00:00:00 AMT -wanted = Monday 00:00:00 - -America/Curacao -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -Africa/Luanda -ts = Thursday 1970-01-01 17:17:17 WAT -result = Monday 1970-01-05 00:00:00 WAT -wanted = Monday 00:00:00 - -Antarctica/McMurdo -ts = Monday 2037-09-28 17:17:17 NZST -result = Monday 2037-10-05 00:00:00 NZDT -wanted = Monday 00:00:00 - -Australia/Adelaide -ts = Friday 1971-01-01 17:17:17 CST -result = Monday 1971-01-04 00:00:00 CST -wanted = Monday 00:00:00 - -Australia/Darwin -ts = Monday 1971-03-29 17:17:17 CST -result = Monday 1971-04-05 00:00:00 CST -wanted = Monday 00:00:00 - -Australia/Perth -ts = Friday 1971-01-01 17:17:17 WST -result = Monday 1971-01-04 00:00:00 WST -wanted = Monday 00:00:00 - -America/Aruba -ts = Monday 1971-03-29 17:17:17 AST -result = Monday 1971-04-05 00:00:00 AST -wanted = Monday 00:00:00 - -Asia/Baku -ts = Friday 1971-01-01 17:17:17 BAKT -result = Monday 1971-01-04 00:00:00 BAKT -wanted = Monday 00:00:00 - -Europe/Sarajevo -ts = Friday 1971-01-01 17:17:17 CET -result = Monday 1971-01-04 00:00:00 CET -wanted = Monday 00:00:00 - -America/Barbados -ts = Friday 1971-01-01 17:17:17 AST -result = Monday 1971-01-04 00:00:00 AST -wanted = Monday 00:00:00 - -Asia/Dacca -ts = Friday 1971-01-01 17:17:17 DACT -result = Monday 1971-01-04 00:00:00 DACT -wanted = Monday 00:00:00 - -Europe/Brussels -ts = Friday 1971-01-01 17:17:17 CET -result = Monday 1971-01-04 00:00:00 CET -wanted = Monday 00:00:00 - -Africa/Ouagadougou -ts = Monday 1971-03-29 17:17:17 GMT -result = Monday 1971-04-05 00:00:00 GMT -wanted = Monday 00:00:00 - -Europe/Tirane -ts = Monday 1983-04-11 17:17:17 CET -result = Monday 1983-04-18 01:00:00 CEST -wanted = Monday 00:00:00 - -America/Buenos_Aires -ts = Monday 1974-09-30 17:17:17 ART -result = Monday 1974-10-07 00:00:00 ART -wanted = Monday 00:00:00 - -America/Rosario -ts = Monday 1974-09-30 17:17:17 ART -result = Monday 1974-10-07 00:00:00 ART -wanted = Monday 00:00:00 - -Europe/Vienna -ts = Monday 1980-03-31 17:17:17 CET -result = Monday 1980-04-07 00:00:00 CEST -wanted = Monday 00:00:00 - -Asia/Baku -ts = Monday 1995-12-25 17:17:17 AZT -result = Monday 1996-01-01 01:00:00 AZST -wanted = Monday 00:00:00 diff --git a/ext/date/tests/bug21399.phpt b/ext/date/tests/bug21399.phpt deleted file mode 100644 index 08040bec54307..0000000000000 --- a/ext/date/tests/bug21399.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]") ---FILE-- - ---EXPECT-- -2005-06-20 09:14:07 diff --git a/ext/date/tests/bug21966.phpt b/ext/date/tests/bug21966.phpt deleted file mode 100644 index 31f592fa98407..0000000000000 --- a/ext/date/tests/bug21966.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #21966 (date() or mktime() returning bad value for mktime month param of '2') ---FILE-- - ---EXPECT-- -27/3/04 = 1080345600 -28/3/04 = 1080432000 -28/3/04 = 1080435600 -29/3/04 = 1080514800 -30/3/04 = 1080601200 diff --git a/ext/date/tests/bug26090.phpt b/ext/date/tests/bug26090.phpt deleted file mode 100644 index 03a90352cc092..0000000000000 --- a/ext/date/tests/bug26090.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #26090 (allow colons in time zone offset to strtotime()) ---FILE-- - ---EXPECT-- -2003-10-28 13:20:30 EST -2003-10-28 13:20:30 EST diff --git a/ext/date/tests/bug26198.phpt b/ext/date/tests/bug26198.phpt deleted file mode 100644 index c957bfcf7a9b9..0000000000000 --- a/ext/date/tests/bug26198.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #26198 (strtotime handling of "M Y" and "Y M" format) ---FILE-- - ---EXPECT-- -October 2001 (2001-10-01 00:00:00 GMT) -Oct 2001 (2001-10-01 00:00:00 GMT) diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt deleted file mode 100644 index c889666dc9d52..0000000000000 --- a/ext/date/tests/bug26317.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #26317 (military timezone offset signedness) ---SKIP-- -if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); -} ---FILE-- - ---EXPECT-- -2003-11-19 16:20:42 -2003-11-19 16:20:42 -2003-11-19 16:20:42 diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt deleted file mode 100644 index b57712009f0e5..0000000000000 --- a/ext/date/tests/bug26320.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #26320 (strtotime handling of XML Schema/ISO 8601 format) ---SKIP-- -if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); -} ---FILE-- - ---EXPECT-- -2003-11-19 12:30:42 -2003-11-19 12:30:42 \ No newline at end of file diff --git a/ext/date/tests/bug26694.phpt b/ext/date/tests/bug26694.phpt deleted file mode 100644 index a709d1666c335..0000000000000 --- a/ext/date/tests/bug26694.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT") ---FILE-- - ---EXPECT-- -2003-12-21 20:38:33 diff --git a/ext/date/tests/bug27719.phpt b/ext/date/tests/bug27719.phpt deleted file mode 100644 index 6f65bfb85e0a2..0000000000000 --- a/ext/date/tests/bug27719.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Bug #27719 (mktime returns incorrect timestamp for dst days) ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECTF-- -1081054800 04/04/04 12:00:00 -%s -1081054800 04/04/04 12:00:00 - -1075870800 02/04/04 12:00:00 -1075867200 02/03/04 11:00:00 -1075870800 02/04/04 12:00:00 - -1081054800 04/04/04 12:00:00 -1081051200 04/03/04 11:00:00 -1081054800 04/04/04 12:00:00 - -1081065600 04/04/04 04:00:00 -1081062000 04/04/04 03:00:00 -1081062000 04/04/04 03:00:00 - -1086325200 06/04/04 01:00:00 -1086321600 06/04/04 12:00:00 -1086321600 06/04/04 12:00:00 diff --git a/ext/date/tests/bug27780.phpt b/ext/date/tests/bug27780.phpt deleted file mode 100644 index f1e6eb67bd9e9..0000000000000 --- a/ext/date/tests/bug27780.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -Bug #27780 (strtotime(+1 xxx) returns a wrong date/time) ---FILE-- - ---EXPECT-- -America/Chicago -1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076824800 [2004-02-15 00:00:00 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076824801 [2004-02-15 00:00:01 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079503200 [2004-03-17 00:00:00 CST] [2004-04-07 00:00:00 -21 days] -1080367200 [2004-03-27 00:00:00 CST] [2004-04-07 00:00:00 11 days ago] -1080460800 [2004-03-28 02:00:00 CST] [2004-04-07 00:00:00 -10 day +2 hours] -1081227600 [2004-04-06 00:00:00 CDT] [2004-04-07 00:00:00 -1 day] -1081314000 [2004-04-07 00:00:00 CDT] [2004-04-07 00:00:00] -1081317600 [2004-04-07 01:00:00 CDT] [2004-04-07 00:00:00 +1 hour] -1081321200 [2004-04-07 02:00:00 CDT] [2004-04-07 00:00:00 +2 hour] -1081400400 [2004-04-08 00:00:00 CDT] [2004-04-07 00:00:00 +1 day] -1081400400 [2004-04-08 00:00:00 CDT] [2004-04-07 00:00:00 1 day] -1083128400 [2004-04-28 00:00:00 CDT] [2004-04-07 00:00:00 +21 days] - -Europe/Amsterdam -1076799599 [2004-02-14 23:59:59 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076799600 [2004-02-15 00:00:00 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076799601 [2004-02-15 00:00:01 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079478000 [2004-03-17 00:00:00 CET] [2004-04-07 00:00:00 -21 days] -1080342000 [2004-03-27 00:00:00 CET] [2004-04-07 00:00:00 11 days ago] -1080435600 [2004-03-28 03:00:00 CEST] [2004-04-07 00:00:00 -10 day +2 hours] -1081202400 [2004-04-06 00:00:00 CEST] [2004-04-07 00:00:00 -1 day] -1081288800 [2004-04-07 00:00:00 CEST] [2004-04-07 00:00:00] -1081292400 [2004-04-07 01:00:00 CEST] [2004-04-07 00:00:00 +1 hour] -1081296000 [2004-04-07 02:00:00 CEST] [2004-04-07 00:00:00 +2 hour] -1081375200 [2004-04-08 00:00:00 CEST] [2004-04-07 00:00:00 +1 day] -1081375200 [2004-04-08 00:00:00 CEST] [2004-04-07 00:00:00 1 day] -1083103200 [2004-04-28 00:00:00 CEST] [2004-04-07 00:00:00 +21 days] - -Asia/Jerusalem -1076795999 [2004-02-14 23:59:59 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076796000 [2004-02-15 00:00:00 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076796001 [2004-02-15 00:00:01 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079474400 [2004-03-17 00:00:00 IST] [2004-04-07 00:00:00 -21 days] -1080338400 [2004-03-27 00:00:00 IST] [2004-04-07 00:00:00 11 days ago] -1080432000 [2004-03-28 02:00:00 IST] [2004-04-07 00:00:00 -10 day +2 hours] -1081202400 [2004-04-06 00:00:00 IST] [2004-04-07 00:00:00 -1 day] -1081288800 [2004-04-07 00:00:00 IST] [2004-04-07 00:00:00] -1081292400 [2004-04-07 02:00:00 IDT] [2004-04-07 00:00:00 +1 hour] -1081292400 [2004-04-07 02:00:00 IDT] [2004-04-07 00:00:00 +2 hour] -1081371600 [2004-04-08 00:00:00 IDT] [2004-04-07 00:00:00 +1 day] -1081371600 [2004-04-08 00:00:00 IDT] [2004-04-07 00:00:00 1 day] -1083099600 [2004-04-28 00:00:00 IDT] [2004-04-07 00:00:00 +21 days] - -Asia/Singapore -1076774399 [2004-02-14 23:59:59 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076774400 [2004-02-15 00:00:00 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076774401 [2004-02-15 00:00:01 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079452800 [2004-03-17 00:00:00 SGT] [2004-04-07 00:00:00 -21 days] -1080316800 [2004-03-27 00:00:00 SGT] [2004-04-07 00:00:00 11 days ago] -1080410400 [2004-03-28 02:00:00 SGT] [2004-04-07 00:00:00 -10 day +2 hours] -1081180800 [2004-04-06 00:00:00 SGT] [2004-04-07 00:00:00 -1 day] -1081267200 [2004-04-07 00:00:00 SGT] [2004-04-07 00:00:00] -1081270800 [2004-04-07 01:00:00 SGT] [2004-04-07 00:00:00 +1 hour] -1081274400 [2004-04-07 02:00:00 SGT] [2004-04-07 00:00:00 +2 hour] -1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 +1 day] -1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 1 day] -1083081600 [2004-04-28 00:00:00 SGT] [2004-04-07 00:00:00 +21 days] - -America/Sao_Paulo -1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days] -1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago] -1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours] -1081220400 [2004-04-06 00:00:00 BRT] [2004-04-07 00:00:00 -1 day] -1081306800 [2004-04-07 00:00:00 BRT] [2004-04-07 00:00:00] -1081310400 [2004-04-07 01:00:00 BRT] [2004-04-07 00:00:00 +1 hour] -1081314000 [2004-04-07 02:00:00 BRT] [2004-04-07 00:00:00 +2 hour] -1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 +1 day] -1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 1 day] -1083121200 [2004-04-28 00:00:00 BRT] [2004-04-07 00:00:00 +21 days] diff --git a/ext/date/tests/bug28024.phpt b/ext/date/tests/bug28024.phpt deleted file mode 100644 index 3e0399adbed3b..0000000000000 --- a/ext/date/tests/bug28024.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #28024 (Changed behavior of strtotime()) ---FILE-- - ---EXPECT-- -1072972800 -2004-01-01 17:00:00 CET diff --git a/ext/date/tests/bug28088.phpt b/ext/date/tests/bug28088.phpt deleted file mode 100644 index 95866e00be461..0000000000000 --- a/ext/date/tests/bug28088.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #28088 (strtotime() cannot convert 00 hours") ---FILE-- - ---EXPECT-- -The following line rightly shows the correct date time: -04/04/04 2345 -But the following line fails to show the correct date time: -04/04/04 0045 diff --git a/ext/date/tests/bug28599.phpt b/ext/date/tests/bug28599.phpt deleted file mode 100644 index fcd17b46972fb..0000000000000 --- a/ext/date/tests/bug28599.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #28599 (strtotime fails with zero base time) ---FILE-- - ---EXPECT-- -15-11-2004 16:49:33 diff --git a/ext/date/tests/bug29150.phpt b/ext/date/tests/bug29150.phpt deleted file mode 100644 index 274584d050842..0000000000000 --- a/ext/date/tests/bug29150.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #29150 (Roman number format for months) ---FILE-- - ---EXPECT-- -2005-06-20 00:00:00 diff --git a/ext/date/tests/bug29585.phpt b/ext/date/tests/bug29585.phpt deleted file mode 100644 index 394569924662b..0000000000000 --- a/ext/date/tests/bug29585.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #29585 (Support week numbers in strtotime()) ---FILE-- - ---EXPECT-- -2004-07-19 00:00:00 diff --git a/ext/date/tests/bug29595.phpt b/ext/date/tests/bug29595.phpt deleted file mode 100644 index 285ade140b348..0000000000000 --- a/ext/date/tests/bug29595.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #29595 (Roman number format for months) ---FILE-- - ---EXPECT-- -1092026907 diff --git a/ext/date/tests/bug30096.phpt b/ext/date/tests/bug30096.phpt deleted file mode 100644 index fa4f716ee650b..0000000000000 --- a/ext/date/tests/bug30096.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #30096 (gmmktime does not return the corrent time) ---INI-- -error_reporting=2047 ---FILE-- - dst\n"; -$ts = -1; -gm_date_check(01,00,00,03,27,2005); -gm_date_check(02,00,00,03,27,2005); -gm_date_check(03,00,00,03,27,2005); -gm_date_check(04,00,00,03,27,2005); - -echo "\ndst --> no dst\n"; -$ts = -1; -gm_date_check(01,00,00,10,30,2005); -gm_date_check(02,00,00,10,30,2005); -gm_date_check(03,00,00,10,30,2005); -gm_date_check(04,00,00,10,30,2005); - -function gm_date_check($hour, $minute, $second, $month, $day, $year) { - global $ts, $tsold; - - echo "gmmktime($hour,$minute,$second,$month,$day,$year): "; - - $tsold = $ts; - $ts = gmmktime($hour, $minute, $second, $month, $day, $year); - - echo $ts, " | gmdate('r', $ts):", gmdate('r', $ts); - if ($tsold > 0) { - echo " | Diff: " . ($ts - $tsold); - } - echo "\n"; -} - -?> ---EXPECT-- -no dst --> dst -gmmktime(1,0,0,3,27,2005): 1111885200 | gmdate('r', 1111885200):Sun, 27 Mar 2005 01:00:00 +0000 -gmmktime(2,0,0,3,27,2005): 1111888800 | gmdate('r', 1111888800):Sun, 27 Mar 2005 02:00:00 +0000 | Diff: 3600 -gmmktime(3,0,0,3,27,2005): 1111892400 | gmdate('r', 1111892400):Sun, 27 Mar 2005 03:00:00 +0000 | Diff: 3600 -gmmktime(4,0,0,3,27,2005): 1111896000 | gmdate('r', 1111896000):Sun, 27 Mar 2005 04:00:00 +0000 | Diff: 3600 - -dst --> no dst -gmmktime(1,0,0,10,30,2005): 1130634000 | gmdate('r', 1130634000):Sun, 30 Oct 2005 01:00:00 +0000 -gmmktime(2,0,0,10,30,2005): 1130637600 | gmdate('r', 1130637600):Sun, 30 Oct 2005 02:00:00 +0000 | Diff: 3600 -gmmktime(3,0,0,10,30,2005): 1130641200 | gmdate('r', 1130641200):Sun, 30 Oct 2005 03:00:00 +0000 | Diff: 3600 -gmmktime(4,0,0,10,30,2005): 1130644800 | gmdate('r', 1130644800):Sun, 30 Oct 2005 04:00:00 +0000 | Diff: 3600 diff --git a/ext/date/tests/bug30532.phpt b/ext/date/tests/bug30532.phpt deleted file mode 100644 index faee0b316f32c..0000000000000 --- a/ext/date/tests/bug30532.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #30532 (strtotime - crossing daylight savings time) ---FILE-- - ---EXPECT-- -2004-10-31 01:00:00 EDT -2004-10-31 01:00:00 EST -2004-10-31 02:00:00 EST - -2004-10-31 01:00:00 EDT -2004-10-31 02:00:00 EST -2004-10-31 03:00:00 EST diff --git a/ext/date/tests/bug32086.phpt b/ext/date/tests/bug32086.phpt deleted file mode 100644 index 2799164cb1842..0000000000000 --- a/ext/date/tests/bug32086.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #32086 (strtotime don't work in DST) ---FILE-- - ---EXPECT-- -1099278000 -1099364400 -1099364400 -1099364400 -1099447200 -2004-11-01 00:00:00 BRT -2004-11-02 01:00:00 BRST -2004-11-02 01:00:00 BRST -2004-11-02 01:00:00 BRST -2004-11-03 00:00:00 BRST -1108778400 -1108868400 -1108868400 -1108868400 -1108954800 -2005-02-19 00:00:00 BRST -2005-02-20 00:00:00 BRT -2005-02-20 00:00:00 BRT -2005-02-20 00:00:00 BRT -2005-02-21 00:00:00 BRT diff --git a/ext/date/tests/bug32270.phpt b/ext/date/tests/bug32270.phpt deleted file mode 100644 index 2c5ff47549803..0000000000000 --- a/ext/date/tests/bug32270.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #32270 (strtotime/date behavior) ---FILE-- - ---EXPECT-- -01/01/1902 00:00:00 PST --2145888000 -01/01/1950 00:00:00 PST --631123200 -01/01/2000 00:00:00 PST -946713600 diff --git a/ext/date/tests/bug32555.phpt b/ext/date/tests/bug32555.phpt deleted file mode 100644 index 3ef513b5e902f..0000000000000 --- a/ext/date/tests/bug32555.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #32555 (strtotime("tomorrow") can return false) ---FILE-- - ---EXPECT-- -Sat Apr 2 02:30:00 2005 EST -Sun Apr 3 00:00:00 2005 EST -Sun Apr 3 03:30:00 2005 EDT -Mon Apr 4 02:30:00 2005 EDT diff --git a/ext/date/tests/bug32588.phpt b/ext/date/tests/bug32588.phpt deleted file mode 100644 index 6cf5ac92f85ff..0000000000000 --- a/ext/date/tests/bug32588.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #32588 (strtotime() error for 'last xxx' DST problem) ---FILE-- - ---EXPECT-- -1116406800 -1116407554 -1116443554 diff --git a/ext/date/tests/bug33414-1.phpt b/ext/date/tests/bug33414-1.phpt deleted file mode 100644 index 7b15228cf348b..0000000000000 --- a/ext/date/tests/bug33414-1.phpt +++ /dev/null @@ -1,320 +0,0 @@ ---TEST-- -Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests) ---FILE-- - ---EXPECT-- -TZ=America/Mendoza - wrong day. -tStamp=Sunday 1992-10-18 17:17:17 ARST 1 -result=Sunday 1992-10-25 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Catamarca - wrong day. -tStamp=Sunday 1990-10-21 17:17:17 ARST 1 -result=Sunday 1990-10-28 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Cordoba - wrong day. -tStamp=Sunday 1990-10-21 17:17:17 ARST 1 -result=Sunday 1990-10-28 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Rosario - wrong day. -tStamp=Tuesday 1991-10-15 17:17:17 WART 0 -result=Tuesday 1991-10-22 00:00:00 ARST 1 -wanted=Tuesday 00:00:00 - -TZ=Europe/Vienna - wrong day - giving unexpected results, at -least on my system :-) -tStamp=Thursday 1980-04-03 17:17:17 CET 0 -result=Thursday 1980-04-10 00:00:00 CEST 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Baku - wrong day. -tStamp=Sunday 1992-09-20 17:17:17 AZST 1 -result=Sunday 1992-09-27 00:00:00 AZT 0 -wanted=Sunday 00:00:00 - -TZ=America/Noronha - wrong day. -tStamp=Friday 1999-10-01 17:17:17 FNT 0 -result=Friday 1999-10-08 00:00:00 FNST 1 -wanted=Friday 00:00:00 - -TZ=America/Havana - wrong day. -tStamp=Thursday 2004-10-28 17:17:17 CDT 1 -result=Thursday 2004-11-04 00:00:00 CDT 1 -wanted=Thursday 00:00:00 - -TZ=Europe/Tallinn - wrong day. -tStamp=Saturday 2002-03-30 17:17:17 EET 0 -result=Saturday 2002-04-06 00:00:00 EEST 1 -wanted=Saturday 00:00:00 - -TZ=Asia/Jerusalem - wrong day. -tStamp=Thursday 2005-09-29 17:17:17 IDT 1 -result=Thursday 2005-10-06 00:00:00 IDT 1 -wanted=Thursday 00:00:00 - -TZ=Europe/Vilnius - wrong day. -tStamp=Friday 2003-03-28 17:17:17 EET 0 -result=Friday 2003-04-04 00:00:00 EEST 1 -wanted=Friday 00:00:00 - -TZ=Pacific/Kwajalein - wrong day. -tStamp=Friday 1993-08-13 17:17:17 KWAT 0 -result=Saturday 1993-08-21 00:00:00 MHT 0 -wanted=Friday 00:00:00 - -TZ=Asia/Ulan_Bator - wrong day. -tStamp=Saturday 2001-09-22 17:17:17 ULAST 1 -result=Saturday 2001-09-29 00:00:00 ULAST 1 -wanted=Saturday 00:00:00 - -TZ=America/Cancun - wrong day. -tStamp=Sunday 2002-04-07 17:17:17 CDT 1 -result=Sunday 2002-04-14 00:00:00 CDT 1 -wanted=Sunday 00:00:00 - -TZ=America/Mexico_City - wrong day. -tStamp=Wednesday 2002-04-03 17:17:17 CST 0 -result=Wednesday 2002-04-10 00:00:00 CDT 1 -wanted=Wednesday 00:00:00 - -TZ=America/Mazatlan - wrong day. -tStamp=Tuesday 2002-04-02 17:17:17 MST 0 -result=Tuesday 2002-04-09 00:00:00 MDT 1 -wanted=Tuesday 00:00:00 - -TZ=America/Chihuahua - wrong day. -tStamp=Thursday 2002-04-04 17:17:17 MST 0 -result=Thursday 2002-04-11 00:00:00 MDT 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Kuala_Lumpur - wrong day. -tStamp=Monday 1981-12-28 17:17:17 MALT 0 -result=Monday 1982-01-04 00:00:00 MYT 0 -wanted=Monday 00:00:00 - -TZ=Pacific/Chatham - wrong day. -tStamp=Monday 1974-10-28 17:17:17 CHAST 0 -result=Monday 1974-11-04 00:00:00 CHADT 1 -wanted=Monday 00:00:00 - -TZ=America/Lima - wrong day. -tStamp=Thursday 1985-12-26 17:17:17 PET 0 -result=Thursday 1986-01-02 00:00:00 PEST 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Karachi - wrong day. -tStamp=Friday 2002-04-05 17:17:17 PKT 0 -result=Friday 2002-04-12 00:00:00 PKST 1 -wanted=Friday 00:00:00 - -TZ=America/Asuncion - wrong day. -tStamp=Wednesday 2002-02-27 17:17:17 PYST 1 -result=Wednesday 2002-03-06 00:00:00 PYST 1 -wanted=Wednesday 00:00:00 - -TZ=Asia/Singapore - wrong day. -tStamp=Thursday 1981-12-31 17:17:17 SGT 0 -result=Thursday 1982-01-07 00:00:00 SGT 0 -wanted=Thursday 00:00:00 - -TZ=America/Montevideo - wrong day. -tStamp=Thursday 2004-09-16 17:17:17 UYT 0 -result=Thursday 2004-09-23 00:00:00 UYST 1 -wanted=Thursday 00:00:00 diff --git a/ext/date/tests/bug33414-2.phpt b/ext/date/tests/bug33414-2.phpt deleted file mode 100644 index 8eb2a35697227..0000000000000 --- a/ext/date/tests/bug33414-2.phpt +++ /dev/null @@ -1,121 +0,0 @@ ---TEST-- -Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() / date() tests) ---FILE-- - ---EXPECT-- -TZ=Pacific/Rarotonga - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 CKT 0 -result=Tuesday 1970-01-06 00:00:00 CKT 0 -wanted=Tuesday 00:00:00 - -TZ=Atlantic/South_Georgia - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 GST 0 -result=Tuesday 1970-01-06 00:00:00 GST 0 -wanted=Tuesday 00:00:00 - -TZ=America/Port-au-Prince - wrong day. -tStamp=Monday 2005-03-28 17:17:17 EST 0 -result=Monday 2005-04-04 00:00:00 EDT 1 -wanted=Monday 00:00:00 - -TZ=Pacific/Enderbury - wrong day, off by 2 days. -tStamp=Thursday 1970-01-01 17:17:17 PHOT 0 -result=Monday 1970-01-05 00:00:00 PHOT 0 -wanted=Monday 00:00:00 - -TZ=Pacific/Kiritimati - wrong day, off by 2 days. -tStamp=Thursday 1970-01-01 17:17:17 LINT 0 -result=Monday 1970-01-05 00:00:00 LINT 0 -wanted=Monday 00:00:00 - -TZ=America/Managua - wrong day. -tStamp=Tuesday 2005-04-05 17:17:17 CST 0 -result=Tuesday 2005-04-12 00:00:00 CDT 1 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Pitcairn - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 PNT 0 -result=Wednesday 1970-01-07 00:00:00 PNT 0 -wanted=Wednesday 00:00:00 - -TZ=Pacific/Fakaofo - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 TKT 0 -result=Saturday 1970-01-03 00:00:00 TKT 0 -wanted=Saturday 00:00:00 - -TZ=Pacific/Johnston - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 HST 0 -result=Friday 1970-01-02 00:00:00 HST 0 -wanted=Friday 00:00:00 diff --git a/ext/date/tests/bug33415-1.phpt b/ext/date/tests/bug33415-1.phpt deleted file mode 100644 index 3d36af8a53329..0000000000000 --- a/ext/date/tests/bug33415-1.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #33415 [1] (Possibly invalid non-one-hour DST or timezone shifts) ---FILE-- - ---EXPECT-- -TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1 -AM as per most DST transitions? -tStamp=Monday 1990-10-15 17:17:17 WART 0 -result=Monday 1990-10-22 00:00:00 WART 0 -wanted=Monday 00:00:00 - -TZ=Asia/Tbilisi - Is it OK for this to be 2 AM? -tStamp=Sunday 2005-03-20 17:17:17 GET 0 -result=Sunday 2005-03-27 00:00:00 GET 0 -wanted=Sunday 00:00:00 diff --git a/ext/date/tests/bug33415-2.phpt b/ext/date/tests/bug33415-2.phpt deleted file mode 100644 index a1e5930b5ff52..0000000000000 --- a/ext/date/tests/bug33415-2.phpt +++ /dev/null @@ -1,342 +0,0 @@ ---TEST-- -Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts) ---FILE-- - ---EXPECT-- -TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to -have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CAT 0 -result=Wednesday 1970-01-07 00:00:00 CAT 0 -wanted=Wednesday 00:00:00 - -TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes -tStamp=Thursday 1987-09-24 17:17:17 IST 0 -result=Thursday 1987-10-01 00:30:00 BTT 0 -wanted=Thursday 00:30:00 - -TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CCT 0 -result=Thursday 1970-01-08 00:00:00 CCT 0 -wanted=Thursday 00:00:00 - -TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CAT 0 -result=Saturday 1970-01-03 00:00:00 CAT 0 -wanted=Saturday 00:00:00 - -TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes -tStamp=Thursday 1980-04-24 17:17:17 KAST 0 -result=Thursday 1980-05-01 03:00:00 CST 0 -wanted=Thursday 03:00:00 - -TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CXT 0 -result=Sunday 1970-01-04 00:00:00 CXT 0 -wanted=Sunday 00:00:00 - -TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes -tStamp=Sunday 1970-10-18 17:17:17 EST 0 -result=Sunday 1970-10-25 00:30:00 EHDT 1 -wanted=Sunday 00:30:00 - -TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 TRUT 0 -result=Tuesday 1970-01-06 00:00:00 TRUT 0 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PONT 0 -result=Monday 1970-01-05 00:00:00 PONT 0 -wanted=Monday 00:00:00 - -TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes -tStamp=Sunday 1981-03-22 17:17:17 CGT 0 -result=Sunday 1981-03-29 02:00:00 EGST 1 -wanted=Sunday 02:00:00 - -TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes -tStamp=Thursday 1975-07-24 17:17:17 GYT 0 -result=Thursday 1975-07-31 00:45:00 GYT 0 -wanted=Thursday 00:45:00 - -TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes -tStamp=Tuesday 1977-10-25 17:17:17 IRST 0 -result=Tuesday 1977-11-01 00:30:00 IRST 0 -wanted=Tuesday 00:30:00 - -TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 GILT 0 -result=Monday 1970-01-05 00:00:00 GILT 0 -wanted=Monday 00:00:00 - -TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes -tStamp=Monday 1972-04-24 17:17:17 LRT 0 -result=Monday 1972-05-01 00:44:30 GMT 0 -wanted=Monday 00:44:30 - -TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes -tStamp=Wednesday 1985-12-25 17:17:17 IST 0 -result=Wednesday 1986-01-01 00:15:00 NPT 0 -wanted=Wednesday 00:15:00 - -TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes -tStamp=Tuesday 1979-04-24 17:17:17 NRT 0 -result=Tuesday 1979-05-01 00:30:00 NRT 0 -wanted=Tuesday 00:30:00 - -TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes -tStamp=Sunday 1978-09-24 17:17:17 NUT 0 -result=Sunday 1978-10-01 00:30:00 NUT 0 -wanted=Sunday 00:30:00 - -TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST -or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PGT 0 -result=Thursday 1970-01-08 00:00:00 PGT 0 -wanted=Thursday 00:00:00 - -TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes -tStamp=Thursday 1980-04-24 17:17:17 AST 0 -result=Thursday 1980-05-01 01:00:00 PMST 0 -wanted=Thursday 01:00:00 - -TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or -timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PWT 0 -result=Saturday 1970-01-03 00:00:00 PWT 0 -wanted=Saturday 00:00:00 - -TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 TVT 0 -result=Wednesday 1970-01-07 00:00:00 TVT 0 -wanted=Wednesday 00:00:00 - -TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 WAKT 0 -result=Tuesday 1970-01-06 00:00:00 WAKT 0 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 WFT 0 -result=Tuesday 1970-01-06 00:00:00 WFT 0 -wanted=Tuesday 00:00:00 - -TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes -tStamp=Monday 1984-09-24 17:17:17 SRT 0 -result=Monday 1984-10-01 00:30:00 SRT 0 -wanted=Monday 00:30:00 diff --git a/ext/date/tests/bug33452.phpt b/ext/date/tests/bug33452.phpt deleted file mode 100644 index e5abebf3c8dd6..0000000000000 --- a/ext/date/tests/bug33452.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #33452 (Support for year accompanying ISO week nr) ---FILE-- - ---EXPECT-- -2005-53 -2004-53 diff --git a/ext/date/tests/bug33532.phpt b/ext/date/tests/bug33532.phpt deleted file mode 100644 index 2a8da034120c9..0000000000000 --- a/ext/date/tests/bug33532.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #33532 (Different output for strftime() and date()) ---INI-- -error_reporting=2047 -date.timezone=UTC ---FILE-- - ---EXPECT-- -TZ has NOT been set -Should strftime==datestr? Strftime seems to assume GMT tStamp. -input 10:00:00 AM July 1 2005 -strftime 10:00:00 AM July 1 2005 UTC +0000 -datestr 10:00:00 AM July 1 2005 UTC - -Setting TZ -input 10:00:00 AM July 1 2005 -strftime 10:00:00 AM July 1 2005 EST +1000 -datestr 10:00:00 AM July 1 2005 EST diff --git a/ext/date/tests/bug33536.phpt b/ext/date/tests/bug33536.phpt deleted file mode 100644 index aa5f5ddb38bfe..0000000000000 --- a/ext/date/tests/bug33536.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #33456 (strtotime defaults to now even on non time string) ---FILE-- - ---EXPECT-- -bool(false) -1970-01-01 -1970-01-01 diff --git a/ext/date/tests/bug33562.phpt b/ext/date/tests/bug33562.phpt deleted file mode 100644 index 8383a79ab7359..0000000000000 --- a/ext/date/tests/bug33562.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #33562 (date("") crashes) ---FILE-- - ---EXPECT-- -[] -done diff --git a/ext/date/tests/bug33563.phpt b/ext/date/tests/bug33563.phpt deleted file mode 100644 index 9f4eb7b4d27dd..0000000000000 --- a/ext/date/tests/bug33563.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #33563 (strtotime('+1 month',$abc) cant get right time) ---FILE-- - ---EXPECT-- -strCurrDate:2005-06-30 21:04:23 strMonAfter:2005-07-30 21:04:23 diff --git a/ext/date/tests/bug33578.phpt b/ext/date/tests/bug33578.phpt deleted file mode 100644 index 4ba6df85971c3..0000000000000 --- a/ext/date/tests/bug33578.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #33578 (strtotime() doesn't parse "11 Oct" format") ---FILE-- - ---EXPECTF-- -10/11/%d -10/11/%d -10/11/2005 -10/11/%d -10/11/%d -10/11/2005 -10/11/2005 diff --git a/ext/date/tests/bug33869.phpt b/ext/date/tests/bug33869.phpt deleted file mode 100644 index 6957a6b7e24cd..0000000000000 --- a/ext/date/tests/bug33869.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #33869 (strtotime() doesn't parse "+1days" format) ---FILE-- - ---EXPECT-- -2005-01-06T01:01:01+0000 -2005-02-01T01:01:01+0000 -2006-01-01T01:01:01+0000 -2005-01-06T01:01:01+0000 -2005-02-01T01:01:01+0000 -2006-01-01T01:01:01+0000 diff --git a/ext/date/tests/bug33957.phpt b/ext/date/tests/bug33957.phpt deleted file mode 100644 index 43f14ee315f1d..0000000000000 --- a/ext/date/tests/bug33957.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -Bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number) ---FILE-- - ---EXPECT-- -1992-12-14 51 -1992-12-15 51 -1992-12-16 51 -1992-12-17 51 -1992-12-18 51 -1992-12-19 51 -1992-12-20 51 -1992-12-21 52 -1992-12-22 52 -1992-12-23 52 -1992-12-24 52 -1992-12-25 52 -1992-12-26 52 -1992-12-27 52 -1992-12-28 53 -1992-12-29 53 -1992-12-30 53 -1992-12-31 53 -1993-01-1 53 -1993-01-2 53 -1993-01-3 53 -1993-01-4 01 -1993-01-5 01 -1993-01-6 01 -1993-01-7 01 -1993-01-8 01 ----- - 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 - (12-14) 51-1992 50-1993 50-1994 50-1995 50-1996 50-1997 51-1998 50-1999 50-2000 50-2001 50-2002 50-2003 51-2004 50-2005 50-2006 50-2007 50-2008 51-2009 50-2010 50-2011 50-2012 50-2013 50-2014 51-2015 50-2016 50-2017 50-2018 50-2019 - (12-15) 51-1992 50-1993 50-1994 50-1995 50-1996 51-1997 51-1998 50-1999 50-2000 50-2001 50-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 50-2013 51-2014 51-2015 50-2016 50-2017 50-2018 50-2019 - (12-16) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 50-2001 51-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 51-2013 51-2014 51-2015 50-2016 50-2017 50-2018 51-2019 - (12-17) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 51-2001 51-2002 51-2003 51-2004 50-2005 50-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 50-2017 51-2018 51-2019 - (12-18) 51-1992 50-1993 50-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 50-2005 51-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 51-2017 51-2018 51-2019 - (12-19) 51-1992 50-1993 51-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 51-2005 51-2006 51-2007 51-2008 51-2009 50-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019 - (12-20) 51-1992 51-1993 51-1994 51-1995 51-1996 51-1997 51-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 51-2009 51-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019 - (12-21) 52-1992 51-1993 51-1994 51-1995 51-1996 51-1997 52-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 52-2009 51-2010 51-2011 51-2012 51-2013 51-2014 52-2015 51-2016 51-2017 51-2018 51-2019 - (12-22) 52-1992 51-1993 51-1994 51-1995 51-1996 52-1997 52-1998 51-1999 51-2000 51-2001 51-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 51-2013 52-2014 52-2015 51-2016 51-2017 51-2018 51-2019 - (12-23) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 51-2001 52-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 52-2013 52-2014 52-2015 51-2016 51-2017 51-2018 52-2019 - (12-24) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 52-2001 52-2002 52-2003 52-2004 51-2005 51-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 51-2017 52-2018 52-2019 - (12-25) 52-1992 51-1993 51-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 51-2005 52-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 52-2017 52-2018 52-2019 - (12-26) 52-1992 51-1993 52-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 52-2005 52-2006 52-2007 52-2008 52-2009 51-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019 - (12-27) 52-1992 52-1993 52-1994 52-1995 52-1996 52-1997 52-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 52-2009 52-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019 - (12-28) 53-1992 52-1993 52-1994 52-1995 52-1996 52-1997 53-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 53-2009 52-2010 52-2011 52-2012 52-2013 52-2014 53-2015 52-2016 52-2017 52-2018 52-2019 - (12-29) 53-1992 52-1993 52-1994 52-1995 52-1996 01-1998 53-1998 52-1999 52-2000 52-2001 52-2002 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 52-2013 01-2015 53-2015 52-2016 52-2017 52-2018 52-2019 - (12-30) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 52-2001 01-2003 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 01-2014 01-2015 53-2015 52-2016 52-2017 52-2018 01-2020 - (12-31) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 01-2002 01-2003 01-2004 53-2004 52-2005 52-2006 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 52-2017 01-2019 01-2020 -+1 (01-01) 53-1992 52-1993 52-1994 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 52-2005 01-2007 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 01-2018 01-2019 01-2020 -+1 (01-02) 53-1992 52-1993 01-1995 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 01-2006 01-2007 01-2008 01-2009 53-2009 52-2010 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020 -+1 (01-03) 53-1992 01-1994 01-1995 01-1996 01-1997 01-1998 53-1998 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 53-2009 01-2011 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020 -+1 (01-04) 01-1993 01-1994 01-1995 01-1996 01-1997 01-1998 01-1999 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 01-2010 01-2011 01-2012 01-2013 01-2014 01-2015 01-2016 01-2017 01-2018 01-2019 01-2020 -+1 (01-05) 01-1993 01-1994 01-1995 01-1996 01-1997 02-1998 01-1999 01-2000 01-2001 01-2002 01-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 01-2014 02-2015 01-2016 01-2017 01-2018 01-2019 01-2020 -+1 (01-06) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 01-2002 02-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 02-2014 02-2015 01-2016 01-2017 01-2018 01-2019 02-2020 -+1 (01-07) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 02-2002 02-2003 02-2004 01-2005 01-2006 01-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 01-2018 02-2019 02-2020 -+1 (01-08) 01-1993 01-1994 01-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 01-2006 02-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 02-2018 02-2019 02-2020 -+1 (01-09) 01-1993 01-1994 02-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 02-2006 02-2007 02-2008 02-2009 01-2010 01-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-10) 01-1993 02-1994 02-1995 02-1996 02-1997 02-1998 01-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 01-2010 02-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-11) 02-1993 02-1994 02-1995 02-1996 02-1997 02-1998 02-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 02-2010 02-2011 02-2012 02-2013 02-2014 02-2015 02-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-12) 02-1993 02-1994 02-1995 02-1996 02-1997 03-1998 02-1999 02-2000 02-2001 02-2002 02-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 02-2014 03-2015 02-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-13) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 02-2002 03-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 03-2014 03-2015 02-2016 02-2017 02-2018 02-2019 03-2020 -+1 (01-14) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 03-2002 03-2003 03-2004 02-2005 02-2006 02-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 02-2018 03-2019 03-2020 -+1 (01-15) 02-1993 02-1994 02-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 02-2006 03-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 03-2018 03-2019 03-2020 -+1 (01-16) 02-1993 02-1994 03-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 03-2006 03-2007 03-2008 03-2009 02-2010 02-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020 -+1 (01-17) 02-1993 03-1994 03-1995 03-1996 03-1997 03-1998 02-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 02-2010 03-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020 -+1 (01-18) 03-1993 03-1994 03-1995 03-1996 03-1997 03-1998 03-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 03-2010 03-2011 03-2012 03-2013 03-2014 03-2015 03-2016 03-2017 03-2018 03-2019 03-2020 ----- diff --git a/ext/date/tests/bug34087.phpt b/ext/date/tests/bug34087.phpt deleted file mode 100644 index 3fa3885481731..0000000000000 --- a/ext/date/tests/bug34087.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #34087 (strtotime() does not work with date format "Y/m/d") ---FILE-- - ---EXPECT-- -Y/m/d: 1123804800 -Y-m-d: 1123804800 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 diff --git a/ext/date/tests/bug34676.phpt b/ext/date/tests/bug34676.phpt deleted file mode 100644 index 6f616feb4064a..0000000000000 --- a/ext/date/tests/bug34676.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #34676 (missing support for strtotime("midnight") and strtotime("noon")) ---FILE-- - %s\n", $test, date(DATE_ISO8601, $t)); -} - -?> ---EXPECT-- -noon => 2005-12-22T12:00:00+0000 -midnight => 2005-12-22T00:00:00+0000 diff --git a/ext/date/tests/bug34771.phpt b/ext/date/tests/bug34771.phpt deleted file mode 100644 index a27d085a1da7b..0000000000000 --- a/ext/date/tests/bug34771.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #34771 (strtotime() fails with 1-12am/pm) ---FILE-- - %s\n", $test, date(DATE_ISO8601, $t)); -} - -?> ---EXPECT-- -12am => 2005-12-22T00:00:00+0000 -1am => 2005-12-22T01:00:00+0000 -1pm => 2005-12-22T13:00:00+0000 -12a.m. => 2005-12-22T00:00:00+0000 -1a.m. => 2005-12-22T01:00:00+0000 -1p.m. => 2005-12-22T13:00:00+0000 -12:00am => 2005-12-22T00:00:00+0000 -1:00am => 2005-12-22T01:00:00+0000 -1:00pm => 2005-12-22T13:00:00+0000 -12:00a.m. => 2005-12-22T00:00:00+0000 -1:00a.m. => 2005-12-22T01:00:00+0000 -1:00p.m. => 2005-12-22T13:00:00+0000 diff --git a/ext/date/tests/date.phpt b/ext/date/tests/date.phpt deleted file mode 100644 index 87cae0b3109ed..0000000000000 --- a/ext/date/tests/date.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -date() function ---FILE-- - ---EXPECT-- -c: 2003-01-23T12:20:59+00:00 -r: Thu, 23 Jan 2003 12:20:59 +0000 -c: 2003-01-23T13:20:59+01:00 -r: Thu, 23 Jan 2003 13:20:59 +0100 diff --git a/ext/date/tests/date_create-1.phpt b/ext/date/tests/date_create-1.phpt deleted file mode 100644 index 0f4fe59867a00..0000000000000 --- a/ext/date/tests/date_create-1.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -date_create() function [1] ---SKIPIF-- - ---FILE-- -format(DATE_ISO8601), "\n"; -} -?> ---EXPECT-- -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0100 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41-0700 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0100 -2005-07-14T22:30:41-0700 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41-0700 diff --git a/ext/date/tests/date_create-2.phpt b/ext/date/tests/date_create-2.phpt deleted file mode 100644 index e3bb1b334808d..0000000000000 --- a/ext/date/tests/date_create-2.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -date_create() function [2] ---SKIPIF-- - ---FILE-- -format(DATE_RFC822), "\n"; -?> ---EXPECT-- -Mon, 18 Jul 2005 22:10:00 GMT+0400 diff --git a/ext/date/tests/date_create-3.phpt b/ext/date/tests/date_create-3.phpt deleted file mode 100644 index 67be1a03e5ccf..0000000000000 --- a/ext/date/tests/date_create-3.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -date_create() function [3] ---FILE-- - ---EXPECT-- -2005-12-31T00:00:00+0100 -2005-12-31T00:00:00+0100 diff --git a/ext/date/tests/date_default_timezone_get-1.phpt b/ext/date/tests/date_default_timezone_get-1.phpt deleted file mode 100644 index e6319bab5a13e..0000000000000 --- a/ext/date/tests/date_default_timezone_get-1.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -date_default_timezone_get() function [1] ---INI-- -date.timezone= ---FILE-- - ---EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 -Europe/London - -Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 -Europe/London diff --git a/ext/date/tests/date_default_timezone_get-2.phpt b/ext/date/tests/date_default_timezone_get-2.phpt deleted file mode 100644 index 3fef097885078..0000000000000 --- a/ext/date/tests/date_default_timezone_get-2.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -date_default_timezone_get() function [2] ---INI-- -date.timezone=CEST ---FILE-- - ---EXPECTF-- -Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in %sdate_default_timezone_get-2.php on line 3 -UTC diff --git a/ext/date/tests/date_default_timezone_get-3.phpt b/ext/date/tests/date_default_timezone_get-3.phpt deleted file mode 100644 index 0e2e3c53e558a..0000000000000 --- a/ext/date/tests/date_default_timezone_get-3.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -date_default_timezone_get() function [3] ---INI-- -date.timezone= ---FILE-- - ---EXPECT-- -Europe/Rome -America/Chicago diff --git a/ext/date/tests/date_default_timezone_set-1.phpt b/ext/date/tests/date_default_timezone_set-1.phpt deleted file mode 100644 index 90916e9238edf..0000000000000 --- a/ext/date/tests/date_default_timezone_set-1.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -date_default_timezone_set() function [1] ---INI-- -date.timezone= ---FILE-- - ---EXPECTF-- -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 - -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 -America/Indiana/Knox -2005-01-12T03:00:00-0500 -2005-07-12T02:00:00-0500 -2005-01-12T08:00:00-0500 -2005-07-12T08:00:00-0500 diff --git a/ext/date/tests/date_modify-1.phpt b/ext/date/tests/date_modify-1.phpt deleted file mode 100644 index b931553d1980e..0000000000000 --- a/ext/date/tests/date_modify-1.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -date_modify() function [1] ---SKIPIF-- - ---FILE-- -modify("+1 second"); -echo date_format($ts, DATE_RFC822), "\n"; - -date_default_timezone_set("Europe/Amsterdam"); -$ts = date_create("Sun Mar 27 01:59:59 2005"); -echo date_format($ts, DATE_RFC822), "\n"; -$ts->modify("+1 second"); -echo date_format($ts, DATE_RFC822), "\n"; - -$ts = date_create("Sun Oct 30 01:59:59 2005"); -echo date_format($ts, DATE_RFC822), "\n"; -$ts->modify("+ 1 hour 1 second"); -echo date_format($ts, DATE_RFC822), "\n"; -?> ---EXPECT-- -Thu, 19 Aug 1993 23:59:59 KWAT -Sat, 21 Aug 1993 00:00:00 MHT -Sun, 27 Mar 2005 01:59:59 CET -Sun, 27 Mar 2005 03:00:00 CEST -Sun, 30 Oct 2005 01:59:59 CEST -Sun, 30 Oct 2005 03:00:00 CET diff --git a/ext/date/tests/date_modify-2.phpt b/ext/date/tests/date_modify-2.phpt deleted file mode 100644 index da22316af03db..0000000000000 --- a/ext/date/tests/date_modify-2.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -date_modify() function [2] ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Mon, 18 Jul 2005 22:10:00 GMT+0400 -Mon, 18 Jul 2005 23:10:00 GMT+0400 diff --git a/ext/date/tests/default-timezone-1.phpt b/ext/date/tests/default-timezone-1.phpt deleted file mode 100644 index ea5f2e6b84f46..0000000000000 --- a/ext/date/tests/default-timezone-1.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -date.timezone setting [1] ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -1119132944 diff --git a/ext/date/tests/default-timezone-2.phpt b/ext/date/tests/default-timezone-2.phpt deleted file mode 100644 index c9a404bccba15..0000000000000 --- a/ext/date/tests/default-timezone-2.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -date.timezone setting [2] ---INI-- -date.timezone=Europe/Oslo ---FILE-- - ---EXPECT-- -1119125744 diff --git a/ext/date/tests/format-negative-timestamp.phpt b/ext/date/tests/format-negative-timestamp.phpt deleted file mode 100644 index 5fd6a65897b64..0000000000000 --- a/ext/date/tests/format-negative-timestamp.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -strtotime() - Format: @timestamps ---FILE-- - $max_2) - $new_tm *= -1; - - if (strtotime("@$new_tm") != $new_tm) { - echo "Error when parsing: @$new_tm\n"; - } -} - -echo "done!"; -?> ---EXPECT-- -done! diff --git a/ext/date/tests/mktime-1.phpt b/ext/date/tests/mktime-1.phpt deleted file mode 100644 index 87fc0df68573d..0000000000000 --- a/ext/date/tests/mktime-1.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Check for mktime with out-of-range parameters ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -2000-02-29 -2000-02-28 -2000-02-29 -2001-02-28 -2001-03-01 -1999-11-30 -2000-05-29 12:00:00 -2000-05-29 13:00:00 -2000-05-29 12:00:00 -2000-01-31 12:00:00 -2000-01-31 12:00:00 -2000-01-31 11:00:00 -2000-04-29 12:00:00 -2000-04-29 13:00:00 -2000-04-29 12:00:00 diff --git a/ext/date/tests/mktime-2.phpt b/ext/date/tests/mktime-2.phpt deleted file mode 100644 index def140f3a08fd..0000000000000 --- a/ext/date/tests/mktime-2.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -mktime() [2] ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECTF-- -int(1009843200) -int(1009843200) -int(1009843200) -int(%s) -int(1025481600) -int(1025481600) -int(1025481600) -int(%s) -int(1009843200) -int(1009843200) -int(1009843200) -int(1009839600) -int(1025478000) -int(1025478000) -int(1025481600) -int(1025478000) diff --git a/ext/date/tests/mktime-3.phpt b/ext/date/tests/mktime-3.phpt deleted file mode 100644 index d4ccfbabe4737..0000000000000 --- a/ext/date/tests/mktime-3.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -mktime() [3] ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -America/Toronto -Y: 0 - January 2000-01-01T01:01:01-0500 -Y: 69 - out of range -Y: 70 - January 1970-01-01T01:01:01-0500 -Y: 71 - January 1971-01-01T01:01:01-0500 -Y: 99 - January 1999-01-01T01:01:01-0500 -Y: 100 - January 2000-01-01T01:01:01-0500 -Y: 1900 - out of range -Y: 1901 - out of range -Y: 1902 - January 1902-01-01T01:01:01-0500 -Y: 1999 - January 1999-01-01T01:01:01-0500 -Y: 2000 - January 2000-01-01T01:01:01-0500 -Y: 2001 - January 2001-01-01T01:01:01-0500 - -Europe/Oslo -Y: 0 - January 2000-01-01T01:01:01+0100 -Y: 69 - out of range -Y: 70 - January 1970-01-01T01:01:01+0100 -Y: 71 - January 1971-01-01T01:01:01+0100 -Y: 99 - January 1999-01-01T01:01:01+0100 -Y: 100 - January 2000-01-01T01:01:01+0100 -Y: 1900 - out of range -Y: 1901 - out of range -Y: 1902 - January 1902-01-01T01:01:01+0100 -Y: 1999 - January 1999-01-01T01:01:01+0100 -Y: 2000 - January 2000-01-01T01:01:01+0100 -Y: 2001 - January 2001-01-01T01:01:01+0100 diff --git a/ext/date/tests/strtotime.phpt b/ext/date/tests/strtotime.phpt deleted file mode 100644 index 6560d7f1fd3e9..0000000000000 --- a/ext/date/tests/strtotime.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -strtotime() function ---FILE-- - ---EXPECT-- -2005-07-14T22:30:41+0200 -2005-07-15T00:30:41+0200 diff --git a/ext/date/tests/timezone-configuration.phpt b/ext/date/tests/timezone-configuration.phpt deleted file mode 100644 index 147b10a8236c8..0000000000000 --- a/ext/date/tests/timezone-configuration.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -timezone configuration [1] ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -1119125744 -1119129344 -1119125744 diff --git a/ext/dba/CREDITS b/ext/dba/CREDITS deleted file mode 100644 index 370b3ea27108a..0000000000000 --- a/ext/dba/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBA -Sascha Schumann, Marcus Boerger \ No newline at end of file diff --git a/ext/dba/README b/ext/dba/README deleted file mode 100755 index 0c22830e5427c..0000000000000 --- a/ext/dba/README +++ /dev/null @@ -1,54 +0,0 @@ -These functions build the foundation for accessing Berkeley DB style -databases. - -This is a general abstraction layer for several file-based databases. As -such, functionality is limited to a common subset of features supported -by modern databases such as Sleepycat Software's DB2. (This is not to be -confused with IBM's DB2 software, which is supported through the ODBC -functions.) - -This extensions allows to work with the following databases: -dbm DBM is the oldest (original) type of Berkeley DB style databases. - You should avoid it, if possible. We do not support the - compatibility functions built into DB2 and gdbm, because they are - only compatible on the source code level, but cannot handle the - original dbm format. -ndbm NDBM is a newer type and more flexible than dbm. It still has - most of the arbitrary limits of dbm (therefore it is deprecated). -gdbm GDBM is the GNU database manager. -db2 DB2 is Sleepycat Software's DB2. It's described as "a programmatic - toolkit that provides high-performance built-in database support - for both standalone and client/server applications. -db3 DB3 is Sleepycat Software's DB3. -db4 DB4 is Sleepycat Software's DB4. This is available since PHP 5.0. -cdb CDB is "a fast, reliable, lightweight package for creating and - reading constant databases." It is from the author of qmail and - can be found at http://cr.yp.to/cdb.html. Since it is constant, - we support only reading operations. And since PHP 4.3.0 we support - writing (not updating) through the internal cdb library. -cdb_make Since PHP 4.3.0 we support creation (not updating) of cdb files - when the bundled cdb library is used. -flatfile This is available since PHP 4.3.0 for compatibility with the - deprecated dbm extension only and should be avoided. However you - may use this where files were created in this format. That happens - when configure could not find any external library. -inifile This is available since PHP 4.3.3 to be able to modify php.ini - files from within PHP scripts. When working with ini files you - can pass arrays of the form array(0=>group,1=>value_name) or - strings of the form "[group]value_name" where group is optional. - As the functions dba_firstkey() and dba_nextkey() return string - representations of the key there is a new function dba_key_split() - available since PHP 5 which allows to convert the string keys into - array keys without loosing FALSE. -qdbm This is available since PHP 5.0.0. The qdbm library can be loaded - from http://qdbm.sourceforge.net. - - -After configuring and compiling PHP you must execute the following test -from commandline: - php run-tests.php ext/dba. -This shows whether your combination of handlers works. Most problematic -are dbm and ndbm which conflict with many installations. The reason for -this is that on several systems these libraries are part of more than one -other library. The configuration test only prevents you from configuring -malfaunctioning single handlers but not combinations. \ No newline at end of file diff --git a/ext/dba/config.m4 b/ext/dba/config.m4 deleted file mode 100644 index 77a4a93b12f52..0000000000000 --- a/ext/dba/config.m4 +++ /dev/null @@ -1,552 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl Suppose we need FlatFile if no support or only CDB is used. - -AC_DEFUN([PHP_DBA_STD_BEGIN],[ - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT -]) - -AC_DEFUN([PHP_TEMP_LDFLAGS],[ - old_LDFLAGS=$LDFLAGS - LDFLAGS="$1 $LDFLAGS" - old_LIBS=$LIBS - LIBS="$2 $LIBS" - $3 - LDFLAGS=$old_LDFLAGS - LIBS=$old_LIBS -]) - -dnl Assign INCLUDE/LFLAGS from PREFIX -AC_DEFUN([PHP_DBA_STD_ASSIGN],[ - if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then - THIS_LFLAGS=$THIS_PREFIX/$PHP_LIBDIR - fi -]) - -dnl Standard check -AC_DEFUN([PHP_DBA_STD_CHECK],[ - THIS_RESULT="yes" - if test -z "$THIS_INCLUDE"; then - AC_MSG_ERROR([DBA: Could not find necessary header file(s).]) - fi - if test -z "$THIS_LIBS"; then - AC_MSG_ERROR([DBA: Could not find necessary library.]) - fi -]) - -dnl Attach THIS_x to DBA_x -AC_DEFUN([PHP_DBA_STD_ATTACH],[ - PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD) - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX -]) - -dnl Print the result message -dnl parameters(name [, full name [, empty or error message]]) -AC_DEFUN([AC_DBA_STD_RESULT],[ - THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_) - if test -n "$2"; then - THIS_FULL_NAME="$2" - else - THIS_FULL_NAME="$THIS_NAME" - fi - AC_MSG_CHECKING(for $THIS_FULL_NAME support) - if test -n "$3"; then - AC_MSG_ERROR($3) - fi - if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then - HAVE_DBA=1 - eval HAVE_$THIS_NAME=1 - AC_MSG_RESULT($THIS_RESULT) - else - AC_MSG_RESULT(no) - fi - unset THIS_RESULT THIS_NAME THIS_FULL_NAME -]) - -PHP_ARG_ENABLE(dba,whether to enable DBA, -[ --enable-dba Build DBA with builtin modules. To build shared DBA - extension use --enable-dba=shared]) - -AC_ARG_WITH(qdbm, -[ --with-qdbm[=DIR] DBA: Include QDBM support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - for i in $withval /usr/local /usr; do - if test -f "$i/include/depot.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/depot.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in qdbm; do - PHP_CHECK_LIBRARY($LIB, dpopen, [ - AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_QDBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_DBA_STD_RESULT(qdbm) - -AC_ARG_WITH(gdbm, -[ --with-gdbm[=DIR] DBA: Include GDBM support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_QDBM" = "1"; then - AC_DBA_STD_RESULT(gdbm,gdbm,You cannot combine --with-gdbm with --with-qdbm) - fi - for i in $withval /usr/local /usr; do - if test -f "$i/include/gdbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/gdbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - PHP_CHECK_LIBRARY(gdbm, gdbm_open, [ - AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_GDBM, 1, [ ]) - THIS_LIBS=gdbm - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_DBA_STD_RESULT(gdbm) - -AC_ARG_WITH(ndbm, -[ --with-ndbm[=DIR] DBA: Include NDBM support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - for i in $withval /usr/local /usr; do - if test -f "$i/include/ndbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/ndbm.h - break - elif test -f "$i/include/db1/ndbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db1/ndbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in ndbm db1 c; do - PHP_CHECK_LIBRARY($LIB, dbm_open, [ - AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_NDBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_DBA_STD_RESULT(ndbm) - -dnl Berkeley specific (library and version test) -dnl parameters(version, library list, function) -AC_DEFUN([PHP_DBA_DB_CHECK],[ - for LIB in $2; do - if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a -o -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[ - AC_TRY_LINK([ -#include "$THIS_INCLUDE" - ],[ - $3; - ],[ - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MAJOR == $1 - yes -#endif - ],[ - THIS_LIBS=$LIB - break - ]) - ]) - ]) - fi - done - if test -z "$THIS_LIBS"; then - AC_MSG_CHECKING(for db$1 major version) - AC_MSG_ERROR(Header contains different version) - fi - if test "$1" = "4"; then - AC_MSG_CHECKING(for db4 minor version and patch level) - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25 - yes -#endif - ],[ - AC_MSG_RESULT(ok) - ],[ - AC_MSG_ERROR(Version 4.1 requires patch level 25) - ]) - fi - if test "$ext_shared" = "yes"; then - AC_MSG_CHECKING(if dba can be used as shared extension) - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2) - yes -#endif - ],[ - AC_MSG_RESULT(yes) - ],[ - AC_MSG_ERROR(At least version 3.3 is required) - ]) - fi - if test -n "$THIS_LIBS"; then - AC_DEFINE(DBA_DB$1, 1, [ ]) - if test -n "$THIS_INCLUDE"; then - AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - fi - fi - DB$1_LIBS=$THIS_LIBS - DB$1_PREFIX=$THIS_PREFIX - DB$1_INCLUDE=$THIS_INCLUDE - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -]) - -AC_ARG_WITH(db4, -[ --with-db4[=DIR] DBA: Include Berkeley DB4 support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do - if test -f "$i/db4/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db4/db.h - break - elif test -f "$i/include/db4/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4/db.h - break - elif test -f "$i/include/db/db4.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db4.h - break - elif test -f "$i/include/db4.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(4, db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) - fi -]) -AC_DBA_STD_RESULT(db4,Berkeley DB4) - -AC_ARG_WITH(db3, -[ --with-db3[=DIR] DBA: Include Berkeley DB3 support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_DB4" = "1"; then - AC_DBA_STD_RESULT(db3,Berkeley DB3,You cannot combine --with-db3 with --with-db4) - fi - for i in $withval /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do - if test -f "$i/db3/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3/db.h - break - elif test -f "$i/include/db3/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3/db.h - break - elif test -f "$i/include/db/db3.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db3.h - break - elif test -f "$i/include/db3.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) - fi -]) -AC_DBA_STD_RESULT(db3,Berkeley DB3) - -AC_ARG_WITH(db2, -[ --with-db2[=DIR] DBA: Include Berkeley DB2 support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_DB3" = "1" -o "$HAVE_DB4" = "1"; then - AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with --with-db3 or --with-db4) - fi - for i in $withval $withval/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do - if test -f "$i/db2/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db2/db.h - break - elif test -f "$i/include/db2/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db2/db.h - break - elif test -f "$i/include/db/db2.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db2.h - break - elif test -f "$i/include/db2.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db2.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(2, db-2 db2 db, [(void)db_appinit("", NULL, (DB_ENV*)0, 0)]) - fi -]) -AC_DBA_STD_RESULT(db2,Berkeley DB2) - -AC_ARG_WITH(db1, -[ --with-db1[=DIR] DBA: Include Berkeley DB1 support/emulation],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - AC_MSG_CHECKING(for DB1 in library) - if test "$HAVE_DB4" = "1"; then - THIS_VERSION=4 - THIS_LIBS=$DB4_LIBS - THIS_PREFIX=$DB4_PREFIX - elif test "$HAVE_DB3" = "1"; then - THIS_LIBS=$DB3_LIBS - THIS_PREFIX=$DB3_PREFIX - elif test "$HAVE_DB2" = "1"; then - THIS_VERSION=2 - THIS_LIBS=$DB2_LIBS - THIS_PREFIX=$DB2_PREFIX - fi - if test "$HAVE_DB4" = "1" -o "$HAVE_DB3" = "1" -o "$HAVE_DB2" = "1"; then - AC_DEFINE_UNQUOTED(DB1_VERSION, "Berkeley DB 1.85 emulation in DB$THIS_VERSION", [ ]) - for i in db$THIS_VERSION/db_185.h include/db$THIS_VERSION/db_185.h include/db/db_185.h; do - if test -f "$THIS_PREFIX/$i"; then - THIS_INCLUDE=$THIS_PREFIX/$i - break - fi - done - else - AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ]) - for i in $withval /usr/local /usr; do - if test -f "$i/db1/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db1/db.h - break - elif test -f "$i/include/db1/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db1/db.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - THIS_LIBS=db - fi - AC_MSG_RESULT($THIS_LIBS) - AC_MSG_CHECKING(for DB1 in header) - AC_MSG_RESULT($THIS_INCLUDE) - if test -n "$THIS_INCLUDE"; then - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$THIS_LIBS,[ - AC_TRY_LINK([ -#include "$THIS_INCLUDE" - ],[ - DB * dbp = dbopen("", 0, 0, DB_HASH, 0); - ],[ - AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_DB1, 1, [ ]) - THIS_RESULT=yes - ],[ - THIS_RESULT=no - ]) - ]) - fi - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_DBA_STD_RESULT(db1,DB1) - -AC_ARG_WITH(dbm, -[ --with-dbm[=DIR] DBA: Include DBM support],[ - if test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_QDBM" = "1"; then - AC_DBA_STD_RESULT(dbm,dbm,You cannot combine --with-dbm with --with-qdbm) - fi - for i in $withval /usr/local /usr; do - if test -f "$i/include/dbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/dbm.h - break - elif test -f "$i/include/gdbm/dbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/gdbm/dbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in dbm c gdbm; do - PHP_CHECK_LIBRARY($LIB, dbminit, [ - AC_MSG_CHECKING(for DBM using GDBM) - AC_DEFINE_UNQUOTED(DBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - if test "$LIB" = "gdbm"; then - AC_DEFINE_UNQUOTED(DBM_VERSION, "GDBM", [ ]) - AC_MSG_RESULT(yes) - else - AC_DEFINE_UNQUOTED(DBM_VERSION, "DBM", [ ]) - AC_MSG_RESULT(no) - fi - AC_DEFINE(DBA_DBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_DBA_STD_RESULT(dbm) - -AC_DEFUN([PHP_DBA_BUILTIN_CDB],[ - AC_DEFINE(DBA_CDB_BUILTIN, 1, [ ]) - AC_DEFINE(DBA_CDB_MAKE, 1, [ ]) - AC_DEFINE(DBA_CDB, 1, [ ]) - cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c" - THIS_RESULT="builtin" -]) - -AC_ARG_WITH(cdb, -[ --with-cdb[=DIR] DBA: Include CDB support],[ - if test "$withval" = "yes" -o "$HAVE_DBA" = "1"; then - PHP_DBA_BUILTIN_CDB - elif test "$withval" != "no"; then - PHP_DBA_STD_BEGIN - for i in $withval /usr/local /usr; do - if test -f "$i/include/cdb.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/cdb.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in cdb c; do - PHP_CHECK_LIBRARY($LIB, cdb_read, [ - AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_CDB, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -],[ - if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then - PHP_DBA_BUILTIN_CDB - fi -]) -AC_DBA_STD_RESULT(cdb) - -AC_DEFUN([PHP_DBA_BUILTIN_INI],[ - AC_DEFINE(DBA_INIFILE, 1, [ ]) - ini_sources="libinifile/inifile.c" - THIS_RESULT="builtin" -]) - -AC_ARG_WITH(inifile, -[ --with-inifile DBA: Include INI support],[ - if test "$withval" != "no"; then - PHP_DBA_BUILTIN_INI - fi -],[ - if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then - PHP_DBA_BUILTIN_INI - fi -]) -AC_DBA_STD_RESULT(inifile,INI File) - -AC_DEFUN([PHP_DBA_BUILTIN_FLATFILE],[ - AC_DEFINE(DBA_FLATFILE, 1, [ ]) - flat_sources="libflatfile/flatfile.c" - THIS_RESULT="builtin" -]) - -dnl -dnl FlatFile check must be the last one. -dnl -AC_ARG_WITH(flatfile, -[ --with-flatfile DBA: Include FlatFile support],[ - if test "$withval" != "no"; then - PHP_DBA_BUILTIN_FLATFILE - fi -],[ - if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then - PHP_DBA_BUILTIN_FLATFILE - fi -]) -AC_DBA_STD_RESULT(FlatFile,FlatFile) - -AC_MSG_CHECKING(whether to enable DBA interface) -if test "$HAVE_DBA" = "1"; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DBA, 1, [ ]) - PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources, $ext_shared) - PHP_ADD_BUILD_DIR($ext_builddir/libinifile) - PHP_ADD_BUILD_DIR($ext_builddir/libcdb) - PHP_ADD_BUILD_DIR($ext_builddir/libflatfile) - PHP_SUBST(DBA_SHARED_LIBADD) -else - AC_MSG_RESULT(no) -fi diff --git a/ext/dba/config.w32 b/ext/dba/config.w32 deleted file mode 100644 index 4f3514e62f25c..0000000000000 --- a/ext/dba/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("dba", "DBA support", "no"); - -if (PHP_DBA != "no") { - if (CHECK_LIB("libdb31s.lib", "dba", PHP_DBA) && - CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) { - EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c"); - ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba"); - ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba"); - ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba"); - AC_DEFINE('HAVE_DBA', 1, 'DBA support'); - ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1"); - } else { - WARNING("dba not enabled; libraries and headers not found"); - } -} diff --git a/ext/dba/dba.c b/ext/dba/dba.c deleted file mode 100644 index 3a96fe7ef04c0..0000000000000 --- a/ext/dba/dba.c +++ /dev/null @@ -1,1136 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_DBA - -#include "php_ini.h" -#include -#include -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#include "php_dba.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "ext/standard/flock_compat.h" - -#include "php_gdbm.h" -#include "php_ndbm.h" -#include "php_dbm.h" -#include "php_cdb.h" -#include "php_db1.h" -#include "php_db2.h" -#include "php_db3.h" -#include "php_db4.h" -#include "php_flatfile.h" -#include "php_inifile.h" -#include "php_qdbm.h" - -/* {{{ dba_functions[] - */ -function_entry dba_functions[] = { - PHP_FE(dba_open, NULL) - PHP_FE(dba_popen, NULL) - PHP_FE(dba_close, NULL) - PHP_FE(dba_delete, NULL) - PHP_FE(dba_exists, NULL) - PHP_FE(dba_fetch, NULL) - PHP_FE(dba_insert, NULL) - PHP_FE(dba_replace, NULL) - PHP_FE(dba_firstkey, NULL) - PHP_FE(dba_nextkey, NULL) - PHP_FE(dba_optimize, NULL) - PHP_FE(dba_sync, NULL) - PHP_FE(dba_handlers, NULL) - PHP_FE(dba_list, NULL) - PHP_FE(dba_key_split, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHP_MINIT_FUNCTION(dba); -PHP_MSHUTDOWN_FUNCTION(dba); -PHP_MINFO_FUNCTION(dba); - -zend_module_entry dba_module_entry = { - STANDARD_MODULE_HEADER, - "dba", - dba_functions, - PHP_MINIT(dba), - PHP_MSHUTDOWN(dba), - NULL, - NULL, - PHP_MINFO(dba), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DBA -ZEND_GET_MODULE(dba) -#endif - -/* {{{ macromania */ - -#define DBA_ID_PARS \ - zval **id; \ - dba_info *info = NULL; \ - int ac = ZEND_NUM_ARGS() - -/* these are used to get the standard arguments */ - -#define DBA_GET1 \ - if(ac != 1 || zend_get_parameters_ex(ac, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } - -/* {{{ php_dba_myke_key */ -static size_t php_dba_make_key(zval **key, char **key_str, char **key_free TSRMLS_DC) -{ - if (Z_TYPE_PP(key) == IS_ARRAY) { - zval **group, **name; - HashPosition pos; - size_t len; - - if (zend_hash_num_elements(Z_ARRVAL_PP(key)) != 2) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Key does not have exactly two elements: (key, name)"); - return -1; - } - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(key), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_PP(key), (void **) &group, &pos); - zend_hash_move_forward_ex(Z_ARRVAL_PP(key), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_PP(key), (void **) &name, &pos); - convert_to_string_ex(group); - convert_to_string_ex(name); - if (Z_STRLEN_PP(group) == 0) { - *key_str = Z_STRVAL_PP(name); - *key_free = NULL; - return Z_STRLEN_PP(name); - } - len = spprintf(key_str, 0, "[%s]%s", Z_STRVAL_PP(group), Z_STRVAL_PP(name)); - *key_free = *key_str; - return len; - } else { - convert_to_string_ex(key); - *key_str = Z_STRVAL_PP(key); - *key_free = NULL; - return Z_STRLEN_PP(key); - } -} -/* }}} */ - -#define DBA_GET2 \ - zval **key; \ - char *key_str, *key_free; \ - size_t key_len; \ - if(ac != 2 || zend_get_parameters_ex(ac, &key, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_GET2_3 \ - zval **key; \ - char *key_str, *key_free; \ - size_t key_len; \ - zval **tmp; \ - int skip = 0; \ - switch(ac) { \ - case 2: \ - if (zend_get_parameters_ex(ac, &key, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - break; \ - case 3: \ - if (zend_get_parameters_ex(ac, &key, &tmp, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_long_ex(tmp); \ - skip = Z_LVAL_PP(tmp); \ - break; \ - default: \ - WRONG_PARAM_COUNT; \ - } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_GET3 \ - zval **key, **val; \ - char *key_str, *key_free; \ - size_t key_len; \ - if(ac != 3 || zend_get_parameters_ex(ac, &key, &val, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_string_ex(val); \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_ID_GET \ - ZEND_FETCH_RESOURCE2(info, dba_info *, id, -1, "DBA identifier", le_db, le_pdb); - -#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET -#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_ID_GET -#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_ID_GET -#define DBA_ID_GET3 DBA_ID_PARS; DBA_GET3; DBA_ID_GET - -#define DBA_ID_DONE \ - if (key_free) efree(key_free) -/* a DBA handler must have specific routines */ - -#define DBA_NAMED_HND(alias, name, flags) \ -{\ - #alias, flags, dba_open_##name, dba_close_##name, dba_fetch_##name, dba_update_##name, \ - dba_exists_##name, dba_delete_##name, dba_firstkey_##name, dba_nextkey_##name, \ - dba_optimize_##name, dba_sync_##name, dba_info_##name \ -}, - -#define DBA_HND(name, flags) DBA_NAMED_HND(name, name, flags) - -/* check whether the user has write access */ -#define DBA_WRITE_CHECK \ - if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ - RETURN_FALSE; \ - } - -/* }}} */ - -/* {{{ globals */ - -static dba_handler handler[] = { -#if DBA_GDBM - DBA_HND(gdbm, DBA_LOCK_EXT) /* Locking done in library if set */ -#endif -#if DBA_DBM - DBA_HND(dbm, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_NDBM - DBA_HND(ndbm, DBA_LOCK_ALL) /* Could be done in library: filemode = 0644 + S_ENFMT */ -#endif -#if DBA_CDB - DBA_HND(cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_CDB_BUILTIN - DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB1 - DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB2 - DBA_HND(db2, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB3 - DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB4 - DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_INIFILE - DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_CAST_AS_FD) /* No lock in lib */ -#endif -#if DBA_FLATFILE - DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_NO_APPEND) /* No lock in lib */ -#endif -#if DBA_QDBM - DBA_HND(qdbm, DBA_LOCK_EXT) -#endif - { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } -}; - -#if DBA_FLATFILE -#define DBA_DEFAULT "flatfile" -#elif DBA_DB4 -#define DBA_DEFAULT "db4" -#elif DBA_DB3 -#define DBA_DEFAULT "db3" -#elif DBA_DB2 -#define DBA_DEFAULT "db2" -#elif DBA_DB1 -#define DBA_DEFAULT "db1" -#elif DBA_GDBM -#define DBA_DEFAULT "gdbm" -#elif DBA_NBBM -#define DBA_DEFAULT "ndbm" -#elif DBA_DBM -#define DBA_DEFAULT "dbm" -#elif DBA_QDBM -#define DBA_DEFAULT "qdbm" -#else -#define DBA_DEFAULT "" -#endif -/* cdb/cdb_make and ini are no option here */ - -ZEND_BEGIN_MODULE_GLOBALS(dba) - char *default_handler; - dba_handler *default_hptr; -ZEND_END_MODULE_GLOBALS(dba) - -ZEND_DECLARE_MODULE_GLOBALS(dba) - -#ifdef ZTS -#define DBA_G(v) TSRMG(dba_globals_id, zend_dba_globals *, v) -#else -#define DBA_G(v) (dba_globals.v) -#endif - -static int le_db; -static int le_pdb; - -/* {{{ dba_fetch_resource -PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id TSRMLS_DC) -{ - dba_info *info; - DBA_ID_FETCH - *pinfo = info; -} -*/ -/* }}} */ - -/* {{{ dba_get_handler -PHPAPI dba_handler *dba_get_handler(const char* handler_name) -{ - dba_handler *hptr; - for (hptr = handler; hptr->name && strcasecmp(hptr->name, handler_name); hptr++); - return hptr; -} -*/ -/* }}} */ - -/* {{{ dba_close - */ -static void dba_close(dba_info *info TSRMLS_DC) -{ - if (info->hnd) { - info->hnd->close(info TSRMLS_CC); - } - if (info->path) { - pefree(info->path, info->flags&DBA_PERSISTENT); - } - if (info->fp && info->fp!=info->lock.fp) { - if(info->flags&DBA_PERSISTENT) { - php_stream_pclose(info->fp); - } else { - php_stream_close(info->fp); - } - } - if (info->lock.fp) { - if(info->flags&DBA_PERSISTENT) { - php_stream_pclose(info->lock.fp); - } else { - php_stream_close(info->lock.fp); - } - } - if (info->lock.name) { - pefree(info->lock.name, info->flags&DBA_PERSISTENT); - } - pefree(info, info->flags&DBA_PERSISTENT); -} -/* }}} */ - -/* {{{ dba_close_rsrc - */ -static void dba_close_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dba_info *info = (dba_info *)rsrc->ptr; - - dba_close(info TSRMLS_CC); -} -/* }}} */ - -/* {{{ dba_close_pe_rsrc_deleter */ -int dba_close_pe_rsrc_deleter(list_entry *le, void *pDba TSRMLS_DC) -{ - return le->ptr == pDba; -} -/* }}} */ - -/* {{{ dba_close_pe_rsrc */ -static void dba_close_pe_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dba_info *info = (dba_info *)rsrc->ptr; - - /* closes the resource by calling dba_close_rsrc() */ - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) dba_close_pe_rsrc_deleter, info TSRMLS_CC); -} -/* }}} */ - -/* {{{ PHP_INI - */ -ZEND_INI_MH(OnUpdateDefaultHandler) -{ - dba_handler *hptr; - - if (!strlen(new_value)) { - DBA_G(default_hptr) = NULL; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - } - - for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value); hptr++); - - if (!hptr->name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value); - return FAILURE; - } - DBA_G(default_hptr) = hptr; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("dba.default_handler", DBA_DEFAULT, PHP_INI_ALL, OnUpdateDefaultHandler, default_handler, zend_dba_globals, dba_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_dba_init_globals - */ -static void php_dba_init_globals(zend_dba_globals *dba_globals) -{ - dba_globals->default_handler = ""; - dba_globals->default_hptr = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(dba) -{ - ZEND_INIT_MODULE_GLOBALS(dba, php_dba_init_globals, NULL); - REGISTER_INI_ENTRIES(); - le_db = zend_register_list_destructors_ex(dba_close_rsrc, NULL, "dba", module_number); - le_pdb = zend_register_list_destructors_ex(dba_close_pe_rsrc, dba_close_rsrc, "dba persistent", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(dba) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -#include "ext/standard/php_smart_str.h" - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(dba) -{ - dba_handler *hptr; - smart_str handlers = {0}; - - for(hptr = handler; hptr->name; hptr++) { - smart_str_appends(&handlers, hptr->name); - smart_str_appendc(&handlers, ' '); - } - - php_info_print_table_start(); - php_info_print_table_row(2, "DBA support", "enabled"); - if (handlers.c) { - smart_str_0(&handlers); - php_info_print_table_row(2, "Supported handlers", handlers.c); - smart_str_free(&handlers); - } else { - php_info_print_table_row(2, "Supported handlers", "none"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_dba_update - */ -static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - char *v; - int len; - DBA_ID_GET3; - - DBA_WRITE_CHECK; - - if (PG(magic_quotes_runtime)) { - len = Z_STRLEN_PP(val); - v = estrndup(Z_STRVAL_PP(val), len); - php_stripslashes(v, &len TSRMLS_CC); - if(info->hnd->update(info, key_str, key_len, v, len, mode TSRMLS_CC) == SUCCESS) { - efree(v); - DBA_ID_DONE; - RETURN_TRUE; - } - efree(v); - } else { - if(info->hnd->update(info, key_str, key_len, VALLEN(val), mode TSRMLS_CC) == SUCCESS) - { - DBA_ID_DONE; - RETURN_TRUE; - } - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -#define FREENOW if(args) efree(args); if(key) efree(key) - -/* {{{ php_find_dbm - */ -dba_info *php_dba_find(const char* path TSRMLS_DC) -{ - list_entry *le; - dba_info *info; - int numitems, i; - - numitems = zend_hash_next_free_element(&EG(regular_list)); - for (i=1; iptr); - if (!strcmp(info->path, path)) { - return (dba_info *)(le->ptr); - } - } - } - - return NULL; -} -/* }}} */ - -/* {{{ php_dba_open - */ -static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - zval ***args = (zval ***) NULL; - int ac = ZEND_NUM_ARGS(); - dba_mode_t modenr; - dba_info *info, *other; - dba_handler *hptr; - char *key = NULL, *error = NULL; - int keylen = 0; - int i; - int lock_mode, lock_flag, lock_dbf = 0; - char *file_mode; - char mode[4], *pmode, *lock_file_mode = NULL; - int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0; - char *opened_path, *lock_name; - - if(ac < 2) { - WRONG_PARAM_COUNT; - } - - /* we pass additional args to the respective handler */ - args = safe_emalloc(ac, sizeof(zval *), 0); - if (zend_get_parameters_array_ex(ac, args) != SUCCESS) { - FREENOW; - WRONG_PARAM_COUNT; - } - - /* we only take string arguments */ - for (i = 0; i < ac; i++) { - convert_to_string_ex(args[i]); - keylen += Z_STRLEN_PP(args[i]); - } - - if (persistent) { - list_entry *le; - - /* calculate hash */ - key = safe_emalloc(keylen, 1, 1); - key[keylen] = '\0'; - keylen = 0; - - for(i = 0; i < ac; i++) { - memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); - keylen += Z_STRLEN_PP(args[i]); - } - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), key, keylen+1, (void **) &le) == SUCCESS) { - FREENOW; - - if (Z_TYPE_P(le) != le_pdb) { - RETURN_FALSE; - } - - info = (dba_info *)le->ptr; - - ZEND_REGISTER_RESOURCE(return_value, info, le_pdb); - return; - } - } - - if (ac==2) { - hptr = DBA_G(default_hptr); - if (!hptr) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "No default handler selected"); - FREENOW; - RETURN_FALSE; - } - } else { - for (hptr = handler; hptr->name && strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++); - } - - if (!hptr->name) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL_PP(args[2])); - FREENOW; - RETURN_FALSE; - } - - /* Check mode: [rwnc][fl]?t? - * r: Read - * w: Write - * n: Create/Truncate - * c: Create - * - * d: force lock on database file - * l: force lock on lck file - * -: ignore locking - * - * t: test open database, warning if locked - */ - strlcpy(mode, Z_STRVAL_PP(args[1]), sizeof(mode)); - pmode = &mode[0]; - if (pmode[0] && (pmode[1]=='d' || pmode[1]=='l' || pmode[1]=='-')) { /* force lock on db file or lck file or disable locking */ - switch (pmode[1]) { - case 'd': - lock_dbf = 1; - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - lock_flag = (hptr->flags & DBA_LOCK_ALL); - break; - } - /* no break */ - case 'l': - lock_flag = DBA_LOCK_ALL; - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name); - } - break; - default: - case '-': - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name); - FREENOW; - RETURN_FALSE; - } - lock_flag = 0; - break; - } - } else { - lock_flag = (hptr->flags&DBA_LOCK_ALL); - lock_dbf = 1; - } - switch (*pmode++) { - case 'r': - modenr = DBA_READER; - lock_mode = (lock_flag & DBA_LOCK_READER) ? LOCK_SH : 0; - file_mode = "r"; - break; - case 'w': - modenr = DBA_WRITER; - lock_mode = (lock_flag & DBA_LOCK_WRITER) ? LOCK_EX : 0; - file_mode = "r+b"; - break; - case 'c': - modenr = DBA_CREAT; - lock_mode = (lock_flag & DBA_LOCK_CREAT) ? LOCK_EX : 0; - if (lock_mode) { - if (lock_dbf) { - /* the create/append check will be done on the lock - * when the lib opens the file it is already created - */ - file_mode = "r+b"; /* read & write, seek 0 */ - lock_file_mode = "a+b"; /* append */ - } else { - file_mode = "a+b"; /* append */ - lock_file_mode = "w+b"; /* create/truncate */ - } - } else { - file_mode = "a+b"; - } - /* In case of the 'a+b' append mode, the handler is responsible - * to handle any rewind problems (see flatfile handler). - */ - break; - case 'n': - modenr = DBA_TRUNC; - lock_mode = (lock_flag & DBA_LOCK_TRUNC) ? LOCK_EX : 0; - file_mode = "w+b"; - break; - default: - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); - FREENOW; - RETURN_FALSE; - } - if (!lock_file_mode) { - lock_file_mode = file_mode; - } - if (*pmode=='d' || *pmode=='l' || *pmode=='-') { - pmode++; /* done already - skip here */ - } - if (*pmode=='t') { - pmode++; - if (!lock_flag) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)"); - FREENOW; - RETURN_FALSE; - } - if (!lock_mode) { - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name); - FREENOW; - RETURN_FALSE; - } else { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name); - FREENOW; - RETURN_FALSE; - } - } else { - lock_mode |= LOCK_NB; /* test =: non blocking */ - } - } - if (*pmode) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); - FREENOW; - RETURN_FALSE; - } - - info = pemalloc(sizeof(dba_info), persistent); - memset(info, 0, sizeof(dba_info)); - info->path = pestrdup(Z_STRVAL_PP(args[0]), persistent); - info->mode = modenr; - info->argc = ac - 3; - info->argv = args + 3; - info->flags = (hptr->flags & ~DBA_LOCK_ALL) | (lock_flag & DBA_LOCK_ALL) | (persistent ? DBA_PERSISTENT : 0); - info->lock.mode = lock_mode; - - /* if any open call is a locking call: - * check if we already habe a locking call open that should block this call - * the problem is some systems would allow read during write - */ - if (hptr->flags & DBA_LOCK_ALL) { - if ((other = php_dba_find(info->path TSRMLS_CC)) != NULL) { - if ( ( (lock_mode&LOCK_EX) && (other->lock.mode&(LOCK_EX|LOCK_SH)) ) - || ( (other->lock.mode&LOCK_EX) && (lock_mode&(LOCK_EX|LOCK_SH)) ) - ) { - error = "Unable to establish lock (database file already open)"; /* force failure exit */ - } - } - } - - if (!error && lock_mode) { - if (lock_dbf) { - lock_name = Z_STRVAL_PP(args[0]); - } else { - spprintf(&lock_name, 0, "%s.lck", info->path); - if (!strcmp(file_mode, "r")) { - /* when in read only mode try to use existing .lck file first */ - /* do not log errors for .lck file while in read ony mode on .lck file */ - lock_file_mode = "rb"; - info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path); - } - if (!info->lock.fp) { - /* when not in read mode or failed to open .lck file read only. now try again in create(write) mode and log errors */ - lock_file_mode = "a+b"; - } else { - if (!persistent) { - info->lock.name = opened_path; - } else { - info->lock.name = pestrdup(opened_path, persistent); - efree(opened_path); - } - } - } - if (!info->lock.fp) { - info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path); - if (info->lock.fp) { - if (lock_dbf) { - /* replace the path info with the real path of the opened file */ - pefree(info->path, persistent); - info->path = pestrdup(opened_path, persistent); - } - /* now store the name of the lock */ - if (!persistent) { - info->lock.name = opened_path; - } else { - info->lock.name = pestrdup(opened_path, persistent); - efree(opened_path); - } - } - } - if (!lock_dbf) { - efree(lock_name); - } - if (!info->lock.fp) { - dba_close(info TSRMLS_CC); - /* stream operation already wrote an error message */ - FREENOW; - RETURN_FALSE; - } - if (!php_stream_supports_lock(info->lock.fp)) { - error = "Stream does not support locking"; - } - if (php_stream_lock(info->lock.fp, lock_mode)) { - error = "Unable to establish lock"; /* force failure exit */ - } - } - - /* centralised open stream for builtin */ - if (!error && (hptr->flags&DBA_STREAM_OPEN)==DBA_STREAM_OPEN) { - if (info->lock.fp && lock_dbf) { - info->fp = info->lock.fp; /* use the same stream for locking and database access */ - } else { - info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL); - } - if (!info->fp) { - dba_close(info TSRMLS_CC); - /* stream operation already wrote an error message */ - FREENOW; - RETURN_FALSE; - } - if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) { - /* Needed becasue some systems do not allow to write to the original - * file contents with O_APPEND being set. - */ - if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream"); - dba_close(info TSRMLS_CC); - FREENOW; - RETURN_FALSE; -#ifdef F_SETFL - } else if (modenr == DBA_CREAT) { - int flags = fcntl(info->fd, F_SETFL); - fcntl(info->fd, F_SETFL, flags & ~O_APPEND); -#endif - } - - } - } - - if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:""); - FREENOW; - RETURN_FALSE; - } - - info->hnd = hptr; - info->argc = 0; - info->argv = NULL; - - if (persistent) { - list_entry new_le; - - Z_TYPE(new_le) = le_pdb; - new_le.ptr = info; - if (zend_hash_update(&EG(persistent_list), key, keylen+1, &new_le, sizeof(list_entry), NULL) == FAILURE) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Could not register persistent resource"); - FREENOW; - RETURN_FALSE; - } - } - - ZEND_REGISTER_RESOURCE(return_value, info, (persistent ? le_pdb : le_db)); - FREENOW; -} -/* }}} */ -#undef FREENOW - -/* {{{ proto resource dba_popen(string path, string mode [, string handlername, string ...]) - Opens path using the specified handler in mode persistently */ -PHP_FUNCTION(dba_popen) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto resource dba_open(string path, string mode [, string handlername, string ...]) - Opens path using the specified handler in mode*/ -PHP_FUNCTION(dba_open) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto void dba_close(resource handle) - Closes database */ -PHP_FUNCTION(dba_close) -{ - DBA_ID_GET1; - - zend_list_delete(Z_RESVAL_PP(id)); -} -/* }}} */ - -/* {{{ proto bool dba_exists(string key, resource handle) - Checks, if the specified key exists */ -PHP_FUNCTION(dba_exists) -{ - DBA_ID_GET2; - - if(info->hnd->exists(info, key_str, key_len TSRMLS_CC) == SUCCESS) { - DBA_ID_DONE; - RETURN_TRUE; - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_fetch(string key, [int skip ,] resource handle) - Fetches the data associated with key */ -PHP_FUNCTION(dba_fetch) -{ - char *val; - int len = 0; - DBA_ID_GET2_3; - - if (ac==3) { - if (!strcmp(info->hnd->name, "cdb")) { - if (skip < 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name); - skip = 0; - } - } else if (!strcmp(info->hnd->name, "inifile")) { - /* "-1" is compareable to 0 but allows a non restrictive - * access which is fater. For example 'inifile' uses this - * to allow faster access when the key was already found - * using firstkey/nextkey. However explicitly setting the - * value to 0 ensures the first value. - */ - if (skip < -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name); - skip = 0; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name); - skip = 0; - } - } else { - skip = 0; - } - if((val = info->hnd->fetch(info, key_str, key_len, skip, &len TSRMLS_CC)) != NULL) { - if (val && PG(magic_quotes_runtime)) { - val = php_addslashes(val, len, &len, 1 TSRMLS_CC); - } - DBA_ID_DONE; - RETURN_STRINGL(val, len, 0); - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto array|false dba_key_split(string key) - Splits an inifile key into an array of the form array(0=>group,1=>value_name) but returns false if input is false or null */ -PHP_FUNCTION(dba_key_split) -{ - zval *zkey; - char *key, *name; - int key_len; - - if (ZEND_NUM_ARGS() != 1) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) { - if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_BOOL && !Z_LVAL_P(zkey))) { - RETURN_BOOL(0); - } - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - RETURN_BOOL(0); - } - array_init(return_value); - if (key[0] == '[' && (name = strchr(key, ']')) != NULL) { - add_next_index_stringl(return_value, key+1, name - (key + 1), 1); - add_next_index_stringl(return_value, name+1, key_len - (name - key + 1), 1); - } else { - add_next_index_stringl(return_value, "", 0, 1); - add_next_index_stringl(return_value, key, key_len, 1); - } -} -/* }}} */ - -/* {{{ proto string dba_firstkey(resource handle) - Resets the internal key pointer and returns the first key */ -PHP_FUNCTION(dba_firstkey) -{ - char *fkey; - int len; - DBA_ID_GET1; - - fkey = info->hnd->firstkey(info, &len TSRMLS_CC); - if(fkey) - RETURN_STRINGL(fkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_nextkey(resource handle) - Returns the next key */ -PHP_FUNCTION(dba_nextkey) -{ - char *nkey; - int len; - DBA_ID_GET1; - - nkey = info->hnd->nextkey(info, &len TSRMLS_CC); - if(nkey) - RETURN_STRINGL(nkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_delete(string key, resource handle) - Deletes the entry associated with key - If inifile: remove all other key lines */ -PHP_FUNCTION(dba_delete) -{ - DBA_ID_GET2; - - DBA_WRITE_CHECK; - - if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) - { - DBA_ID_DONE; - RETURN_TRUE; - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_insert(string key, string value, resource handle) - If not inifile: Insert value as key, return false, if key exists already - If inifile: Add vakue as key (next instance of key) */ -PHP_FUNCTION(dba_insert) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool dba_replace(string key, string value, resource handle) - Inserts value as key, replaces key, if key exists already - If inifile: remove all other key lines */ -PHP_FUNCTION(dba_replace) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool dba_optimize(resource handle) - Optimizes (e.g. clean up, vacuum) database */ -PHP_FUNCTION(dba_optimize) -{ - DBA_ID_GET1; - - DBA_WRITE_CHECK; - if(info->hnd->optimize(info TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_sync(resource handle) - Synchronizes database */ -PHP_FUNCTION(dba_sync) -{ - DBA_ID_GET1; - - if(info->hnd->sync(info TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto array dba_handlers([bool full_info]) - List configured database handlers */ -PHP_FUNCTION(dba_handlers) -{ - dba_handler *hptr; - zend_bool full_info = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - - for(hptr = handler; hptr->name; hptr++) { - if (full_info) { - add_assoc_string(return_value, hptr->name, hptr->info(hptr, NULL TSRMLS_CC), 0); - } else { - add_next_index_string(return_value, hptr->name, 1); - } - } -} -/* }}} */ - -/* {{{ proto array dba_list() - List opened databases */ -PHP_FUNCTION(dba_list) -{ - ulong numitems, i; - zend_rsrc_list_entry *le; - dba_info *info; - - if (ZEND_NUM_ARGS()!=0) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - - numitems = zend_hash_next_free_element(&EG(regular_list)); - for (i=1; iptr); - add_index_string(return_value, i, info->path, 1); - } - } -} -/* }}} */ - -#endif /* HAVE_DBA */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba.dsp b/ext/dba/dba.dsp deleted file mode 100644 index ddfd1485a965d..0000000000000 --- a/ext/dba/dba.dsp +++ /dev/null @@ -1,213 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dba" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dba - Win32 Debug_TS Berkeley DB3 -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dba.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dba.mak" CFG="dba - Win32 Debug_TS Berkeley DB3" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dba - Win32 Release_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dba - Win32 Debug_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dba - Win32 Release_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "dba - Win32 Debug_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" -# ADD LINK32 php5ts_debug.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "dba - Win32 Release_TS Berkeley DB3" -# Name "dba - Win32 Debug_TS Berkeley DB3" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\libcdb\cdb.c -# End Source File -# Begin Source File - -SOURCE=.\libcdb\cdb_make.c -# End Source File -# Begin Source File - -SOURCE=.\dba.c -# End Source File -# Begin Source File - -SOURCE=.\dba_cdb.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db2.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db3.c -# End Source File -# Begin Source File - -SOURCE=.\dba_dbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_flatfile.c -# End Source File -# Begin Source File - -SOURCE=.\dba_gdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_inifile.c -# End Source File -# Begin Source File - -SOURCE=.\dba_ndbm.c -# End Source File -# Begin Source File - -SOURCE=.\libflatfile\flatfile.c -# End Source File -# Begin Source File - -SOURCE=.\libinifile\inifile.c -# End Source File -# Begin Source File - -SOURCE=.\libcdb\uint32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\libcdb\cdb.h -# End Source File -# Begin Source File - -SOURCE=.\libcdb\cdb_make.h -# End Source File -# Begin Source File - -SOURCE=.\libflatfile\flatfile.h -# End Source File -# Begin Source File - -SOURCE=.\php_cdb.h -# End Source File -# Begin Source File - -SOURCE=.\php_db2.h -# End Source File -# Begin Source File - -SOURCE=.\php_db3.h -# End Source File -# Begin Source File - -SOURCE=.\php_dba.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_flatfile.h -# End Source File -# Begin Source File - -SOURCE=.\php_gdbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_inifile.h -# End Source File -# Begin Source File - -SOURCE=.\php_ndbm.h -# End Source File -# Begin Source File - -SOURCE=.\libcdb\uint32.h -# End Source File -# Begin Source File - -SOURCE=.\libinifile\inifile.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c deleted file mode 100644 index b799b6da1fe54..0000000000000 --- a/ext/dba/dba_cdb.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_CDB -#include "php_cdb.h" - -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include - -#if DBA_CDB_BUILTIN -# include "libcdb/cdb.h" -# include "libcdb/cdb_make.h" -# include "libcdb/uint32.h" -#else -# ifdef CDB_INCLUDE_FILE -# include CDB_INCLUDE_FILE -# endif -#endif - -#define CDB_INFO \ - dba_cdb *cdb = (dba_cdb *) info->dbf - -typedef struct { - struct cdb c; -#if DBA_CDB_BUILTIN - struct cdb_make m; - php_stream *file; - int make; -#else - int file; -#endif - uint32 eod; /* size of constant database */ - uint32 pos; /* current position for traversing */ -} dba_cdb; - -DBA_OPEN_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - php_stream* file = 0; - int make; -#else - int file = 0; -#endif - dba_cdb *cdb; - dba_info *pinfo = (dba_info *) info; - - switch (info->mode) { - case DBA_READER: -#if DBA_CDB_BUILTIN - make = 0; - file = info->fp; -#else - file = VCWD_OPEN(info->path, O_RDONLY); - if (file < 0) { - *error = "Unable to open file"; - return FAILURE; - } -#endif - break; -#if DBA_CDB_BUILTIN - case DBA_TRUNC: - make = 1; - file = info->fp; - break; - case DBA_CREAT: - case DBA_WRITER: - *error = "Update operations are not supported"; - return FAILURE; /* not supported */ -#endif - default: - *error = "Currently not supported"; - return FAILURE; - } - - cdb = pemalloc(sizeof(dba_cdb), info->flags&DBA_PERSISTENT); - memset(cdb, 0, sizeof(dba_cdb)); - -#if DBA_CDB_BUILTIN - if (make) { - cdb_make_start(&cdb->m, file TSRMLS_CC); - } else { - cdb_init(&cdb->c, file TSRMLS_CC); - } - cdb->make = make; -#else - cdb_init(&cdb->c, file); -#endif - cdb->file = file; - - pinfo->dbf = cdb; - return SUCCESS; -} - -DBA_CLOSE_FUNC(cdb) -{ - CDB_INFO; - - /* cdb_free does not close associated file */ -#if DBA_CDB_BUILTIN - if (cdb->make) { - cdb_make_finish(&cdb->m TSRMLS_CC); - } else { - cdb_free(&cdb->c TSRMLS_CC); - } -#else - cdb_free(&cdb->c); - close(cdb->file); -#endif - pefree(cdb, info->flags&DBA_PERSISTENT); -} - -#if DBA_CDB_BUILTIN -# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos TSRMLS_CC) -# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len TSRMLS_CC) -# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len TSRMLS_CC) -#else -# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) -# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) -# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len) -#endif - -DBA_FETCH_FUNC(cdb) -{ - CDB_INFO; - unsigned int len; - char *new_entry = NULL; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - if (php_cdb_find(&cdb->c, key, keylen) == 1) { - while(skip--) { - if (php_cdb_findnext(&cdb->c, key, keylen) != 1) { - return NULL; - } - } - len = cdb_datalen(&cdb->c); - new_entry = safe_emalloc(len, 1, 1); - - if (php_cdb_read(&cdb->c, new_entry, len, cdb_datapos(&cdb->c)) == -1) { - efree(new_entry); - return NULL; - } - new_entry[len] = 0; - if (newlen) - *newlen = len; - } - - return new_entry; -} - -DBA_UPDATE_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - CDB_INFO; - - if (!cdb->make) - return FAILURE; /* database was opened readonly */ - if (!mode) - return FAILURE; /* cdb_make dosn't know replace */ - if (cdb_make_add(&cdb->m, key, keylen, val, vallen TSRMLS_CC) != -1) - return SUCCESS; -#endif - return FAILURE; -} - -DBA_EXISTS_FUNC(cdb) -{ - CDB_INFO; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return FAILURE; /* database was opened writeonly */ -#endif - if (php_cdb_find(&cdb->c, key, keylen) == 1) - return SUCCESS; - return FAILURE; -} - -DBA_DELETE_FUNC(cdb) -{ - return FAILURE; /* cdb doesn't support delete */ -} - -/* {{{ cdb_file_read */ -#if DBA_CDB_BUILTIN -# define cdb_file_read(fildes, buf, size) php_stream_read(fildes, buf, size) -#else -# define cdb_file_read(fildes, buf, size) read(fildes, buf, size) -#endif -/* }}} */ - -#define CREAD(n) do { \ - if (cdb_file_read(cdb->file, buf, n) < n) return NULL; \ -} while (0) - -/* {{{ cdb_file_lseek - php_stream_seek does not return actual position */ -#if DBA_CDB_BUILTIN -int cdb_file_lseek(php_stream *fp, off_t offset, int whence TSRMLS_DC) { - php_stream_seek(fp, offset, whence); - return php_stream_tell(fp); -} -#else -int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) { - return lseek(fd, offset, whence); -} -#endif -/* }}} */ - -#define CSEEK(n) do { \ - if (n >= cdb->eod) return NULL; \ - if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET TSRMLS_CC) != (off_t) n) return NULL; \ -} while (0) - - -DBA_FIRSTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 klen, dlen; - char buf[8]; - char *key; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - - cdb->eod = -1; - CSEEK(0); - CREAD(4); - - /* Total length of file in bytes */ - uint32_unpack(buf, &cdb->eod); - - CSEEK(2048); - CREAD(8); - - /* The first four bytes contain the length of the key */ - uint32_unpack(buf, &klen); - uint32_unpack(buf + 4, &dlen); - - key = safe_emalloc(klen, 1, 1); - if (cdb_file_read(cdb->file, key, klen) < klen) { - efree(key); - key = NULL; - } else { - key[klen] = '\0'; - if (newlen) *newlen = klen; - } - - /* header + klenlen + dlenlen + klen + dlen */ - cdb->pos = 2048 + 4 + 4 + klen + dlen; - - return key; -} - -DBA_NEXTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 klen, dlen; - char buf[8]; - char *key; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - - CSEEK(cdb->pos); - CREAD(8); - uint32_unpack(buf, &klen); - uint32_unpack(buf + 4, &dlen); - - key = safe_emalloc(klen, 1, 1); - if (cdb_file_read(cdb->file, key, klen) < klen) { - efree(key); - key = NULL; - } else { - key[klen] = '\0'; - if (newlen) *newlen = klen; - } - - cdb->pos += 8 + klen + dlen; - - return key; -} - -DBA_OPTIMIZE_FUNC(cdb) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(cdb) -{ - /* this is read-only */ - return SUCCESS; -} - -DBA_INFO_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - if (!strcmp(hnd->name, "cdb")) { - return estrdup(cdb_version()); - } else { - return estrdup(cdb_make_version()); - } -#else - return estrdup("External"); -#endif -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c deleted file mode 100755 index a317f6aa785c2..0000000000000 --- a/ext/dba/dba_db1.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shen Cheng-Da | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB1 -#include "php_db1.h" - -#ifdef DB1_INCLUDE_FILE -#include DB1_INCLUDE_FILE -#endif - -#include -#include -#include - -#define DB1_DATA dba_db1_data *dba = info->dbf -#define DB1_GKEY DBT gkey; gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; -} dba_db1_data; - -DBA_OPEN_FUNC(db1) -{ - dba_db1_data *dba; - DB *db; - - int gmode; - int filemode = 0644; - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - gmode = 0; - switch (info->mode) { - case DBA_READER: - gmode = O_RDONLY; - break; - case DBA_WRITER: - gmode = O_RDWR; - break; - case DBA_CREAT: - gmode = O_RDWR | O_CREAT; - break; - case DBA_TRUNC: - gmode = O_RDWR | O_CREAT | O_TRUNC; - break; - default: - return FAILURE; /* not possible */ - } - - db = dbopen((char *)info->path, gmode, filemode, DB_HASH, NULL); - - if (db == NULL) { - return FAILURE; - } - - dba = pemalloc(sizeof(*dba), info->flags&DBA_PERSISTENT); - dba->dbp = db; - - info->dbf = dba; - - return SUCCESS; -} - -DBA_CLOSE_FUNC(db1) -{ - DB1_DATA; - dba->dbp->close(dba->dbp); - pefree(info->dbf, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (dba->dbp->get(dba->dbp, &gkey, &gval, 0) == RET_SUCCESS) { - if (newlen) *newlen = gval.size; - return estrndup(gval.data, gval.size); - } - return NULL; -} - -DBA_UPDATE_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - gval.data = (char *) val; - gval.size = vallen; - - return dba->dbp->put(dba->dbp, &gkey, &gval, mode == 1 ? R_NOOVERWRITE : 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_EXISTS_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - return dba->dbp->get(dba->dbp, &gkey, &gval, 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_DELETE_FUNC(db1) -{ - DB1_DATA; - DB1_GKEY; - - return dba->dbp->del(dba->dbp, &gkey, 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db1) -{ - DBT gkey; - DBT gval; - DB1_DATA; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_FIRST) == RET_SUCCESS) { - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); - } - return NULL; -} - -DBA_NEXTKEY_FUNC(db1) -{ - DBT gkey; - DBT gval; - DB1_DATA; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_NEXT) == RET_SUCCESS) { - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); - } - return NULL; -} - -DBA_OPTIMIZE_FUNC(db1) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(db1) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(db1) -{ - return estrdup(DB1_VERSION); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c deleted file mode 100644 index 526d2ef4d87a1..0000000000000 --- a/ext/dba/dba_db2.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB2 -#include "php_db2.h" -#include - -#include -#ifdef DB2_INCLUDE_FILE -#include DB2_INCLUDE_FILE -#endif - -#define DB2_DATA dba_db2_data *dba = info->dbf -#define DB2_GKEY \ - DBT gkey = {0}; \ - gkey.data = (char *) key; \ - gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db2_data; - -DBA_OPEN_FUNC(db2) -{ - DB *dbp; - DBTYPE type; - int gmode = 0; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) { - return FAILURE;/* not possible */ - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if (db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) { - return FAILURE; - } - - info->dbf = pemalloc(sizeof(dba_db2_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_db2_data)); - ((dba_db2_data *) info->dbf)->dbp = dbp; - return SUCCESS; -} - -DBA_CLOSE_FUNC(db2) -{ - DB2_DATA; - - if (dba->cursor) - dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return NULL; - } - - if (newlen) *newlen = gval.size; - return estrndup(gval.data, gval.size); -} - -DBA_UPDATE_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - gval.data = (char *) val; - gval.size = vallen; - - if (dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return FAILURE; - } - return SUCCESS; -} - -DBA_EXISTS_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return FAILURE; - } - return SUCCESS; -} - -DBA_DELETE_FUNC(db2) -{ - DB2_DATA; - DB2_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db2) -{ - DB2_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - dba->cursor = NULL; - } - -#if (DB_VERSION_MAJOR > 2) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 6) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 6 && DB_VERSION_PATCH >= 4) - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) { -#else - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) { -#endif - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db2(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db2) -{ - DB2_DATA; - DBT gkey = {0}, gval = {0}; - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) - || !gkey.data) - return NULL; - - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); -} - -DBA_OPTIMIZE_FUNC(db2) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db2) -{ - DB2_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db2) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c deleted file mode 100644 index b6dce5b7bbe59..0000000000000 --- a/ext/dba/dba_db3.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB3 -#include "php_db3.h" -#include - -#include -#ifdef DB3_INCLUDE_FILE -#include DB3_INCLUDE_FILE -#else -#include -#endif - -static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg) -{ - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); -} - -#define DB3_DATA dba_db3_data *dba = info->dbf -#define DB3_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db3_data; - -DBA_OPEN_FUNC(db3) -{ - DB *dbp = NULL; - DBTYPE type; - int gmode = 0, err; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) { - return FAILURE; /* not possible */ - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - -#ifdef DB_FCNTL_LOCKING - gmode |= DB_FCNTL_LOCKING; -#endif - - if ((err=db_create(&dbp, NULL, 0)) == 0) { - dbp->set_errcall(dbp, php_dba_db3_errcall_fcn); - if ((err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) { - dba_db3_data *data; - - data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT); - data->dbp = dbp; - data->cursor = NULL; - info->dbf = data; - - return SUCCESS; - } else { - dbp->close(dbp, 0); - *error = db_strerror(err); - } - } else { - *error = db_strerror(err); - } - - return FAILURE; -} - -DBA_CLOSE_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db3) -{ - DBT gval; - char *new = NULL; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if (newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - } - return new; -} - -DBA_UPDATE_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db3) -{ - DB3_DATA; - DB3_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) { - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db3(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db3) -{ - DB3_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) { - if (gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if (newlen) *newlen = gkey.size; - } - } - - return nkey; -} - -DBA_OPTIMIZE_FUNC(db3) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db3) -{ - DB3_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db3) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c deleted file mode 100644 index 6dee094832580..0000000000000 --- a/ext/dba/dba_db4.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - | Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB4 -#include "php_db4.h" -#include - -#include -#ifdef DB4_INCLUDE_FILE -#include DB4_INCLUDE_FILE -#else -#include -#endif - -static void php_dba_db4_errcall_fcn(const char *errpfx, char *msg) -{ - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); -} - -#define DB4_DATA dba_db4_data *dba = info->dbf -#define DB4_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db4_data; - -DBA_OPEN_FUNC(db4) -{ - DB *dbp = NULL; - DBTYPE type; - int gmode = 0, err; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (info->flags & DBA_PERSISTENT) { - gmode |= DB_THREAD; - } - - if (gmode == -1) { - return FAILURE; /* not possible */ - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - -#ifdef DB_FCNTL_LOCKING - gmode |= DB_FCNTL_LOCKING; -#endif - - if ((err=db_create(&dbp, NULL, 0)) == 0) { - dbp->set_errcall(dbp, php_dba_db4_errcall_fcn); - if ( -#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) - (err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) { -#else - (err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) { -#endif - dba_db4_data *data; - - data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT); - data->dbp = dbp; - data->cursor = NULL; - info->dbf = data; - - return SUCCESS; - } else { - dbp->close(dbp, 0); - *error = db_strerror(err); - } - } else { - *error = db_strerror(err); - } - - return FAILURE; -} - -DBA_CLOSE_FUNC(db4) -{ - DB4_DATA; - - if (dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db4) -{ - DBT gval; - char *new = NULL; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if (newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - } - return new; -} - -DBA_UPDATE_FUNC(db4) -{ - DBT gval; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db4) -{ - DBT gval; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db4) -{ - DB4_DATA; - DB4_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db4) -{ - DB4_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) { - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db4(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db4) -{ - DB4_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) { - if (gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if (newlen) *newlen = gkey.size; - } - } - - return nkey; -} - -DBA_OPTIMIZE_FUNC(db4) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db4) -{ - DB4_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db4) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c deleted file mode 100644 index 6c335e9b19206..0000000000000 --- a/ext/dba/dba_dbm.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DBM -#include "php_dbm.h" - -#ifdef DBM_INCLUDE_FILE -#include DBM_INCLUDE_FILE -#endif -#if DBA_GDBM -#include "php_gdbm.h" -#endif - -#include -#include -#include -#include - -#define DBM_DATA dba_dbm_data *dba = info->dbf -#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -#define TRUNC_IT(extension, mode) \ - snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \ - buf[MAXPATHLEN-1] = '\0'; \ - if((fd = VCWD_OPEN_MODE(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \ - return FAILURE; \ - close(fd); - - -typedef struct { - datum nextkey; -} dba_dbm_data; - -DBA_OPEN_FUNC(dbm) -{ - int fd; - int filemode = 0644; - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if(info->mode == DBA_TRUNC) { - char buf[MAXPATHLEN]; - - /* dbm/ndbm original */ - TRUNC_IT(".pag", O_TRUNC); - TRUNC_IT(".dir", O_TRUNC); - } - - if(info->mode == DBA_CREAT) { - char buf[MAXPATHLEN]; - - TRUNC_IT(".pag", 0); - TRUNC_IT(".dir", 0); - } - - if(dbminit((char *) info->path) == -1) { - return FAILURE; - } - - info->dbf = pemalloc(sizeof(dba_dbm_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_dbm_data)); - return SUCCESS; -} - -DBA_CLOSE_FUNC(dbm) -{ - pefree(info->dbf, info->flags&DBA_PERSISTENT); - dbmclose(); -} - -DBA_FETCH_FUNC(dbm) -{ - datum gval; - char *new = NULL; - - DBM_GKEY; - gval = fetch(gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(dbm) -{ - datum gval; - - DBM_GKEY; - - if (mode == 1) { /* insert */ - gval = fetch(gkey); - if(gval.dptr) { - return FAILURE; - } - } - - gval.dptr = (char *) val; - gval.dsize = vallen; - - return (store(gkey, gval) == -1 ? FAILURE : SUCCESS); -} - -DBA_EXISTS_FUNC(dbm) -{ - datum gval; - DBM_GKEY; - - gval = fetch(gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(dbm) -{ - DBM_GKEY; - return(delete(gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *key = NULL; - - gkey = firstkey(); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return key; -} - -DBA_NEXTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *nkey = NULL; - - if(!dba->nextkey.dptr) return NULL; - - gkey = nextkey(dba->nextkey); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return nkey; -} - -DBA_OPTIMIZE_FUNC(dbm) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(dbm) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(dbm) -{ -#if DBA_GDBM - if (!strcmp(DBM_VERSION, "GDBM")) - { - return dba_info_gdbm(hnd, info TSRMLS_CC); - } -#endif - return estrdup(DBM_VERSION); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c deleted file mode 100644 index 9dc21e8ace672..0000000000000 --- a/ext/dba/dba_flatfile.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_FLATFILE -#include "php_flatfile.h" - -#include "libflatfile/flatfile.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -#define FLATFILE_DATA flatfile *dba = info->dbf -#define FLATFILE_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -DBA_OPEN_FUNC(flatfile) -{ - info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(flatfile)); - - ((flatfile*)info->dbf)->fp = info->fp; - - return SUCCESS; -} - -DBA_CLOSE_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(flatfile) -{ - datum gval; - char *new = NULL; - - FLATFILE_DATA; - FLATFILE_GKEY; - - gval = flatfile_fetch(dba, gkey TSRMLS_CC); - if (gval.dptr) { - if (newlen) { - *newlen = gval.dsize; - } - new = estrndup(gval.dptr, gval.dsize); - efree(gval.dptr); - } - return new; -} - -DBA_UPDATE_FUNC(flatfile) -{ - datum gval; - - FLATFILE_DATA; - FLATFILE_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) { - case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); - return FAILURE; - default: - case 0: - return SUCCESS; - case 1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists"); - return SUCCESS; - } -} - -DBA_EXISTS_FUNC(flatfile) -{ - datum gval; - FLATFILE_DATA; - FLATFILE_GKEY; - - gval = flatfile_fetch(dba, gkey TSRMLS_CC); - if (gval.dptr) { - efree(gval.dptr); - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(flatfile) -{ - FLATFILE_DATA; - FLATFILE_GKEY; - return(flatfile_delete(dba, gkey TSRMLS_CC) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - dba->nextkey = flatfile_firstkey(dba TSRMLS_CC); - if (dba->nextkey.dptr) { - if (newlen) { - *newlen = dba->nextkey.dsize; - } - return estrndup(dba->nextkey.dptr, dba->nextkey.dsize); - } - return NULL; -} - -DBA_NEXTKEY_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (!dba->nextkey.dptr) { - return NULL; - } - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - dba->nextkey = flatfile_nextkey(dba TSRMLS_CC); - if (dba->nextkey.dptr) { - if (newlen) { - *newlen = dba->nextkey.dsize; - } - return estrndup(dba->nextkey.dptr, dba->nextkey.dsize); - } - return NULL; -} - -DBA_OPTIMIZE_FUNC(flatfile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(flatfile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_INFO_FUNC(flatfile) -{ - return estrdup(flatfile_version()); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c deleted file mode 100644 index aa9a4789ec561..0000000000000 --- a/ext/dba/dba_gdbm.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_GDBM -#include "php_gdbm.h" - -#ifdef GDBM_INCLUDE_FILE -#include GDBM_INCLUDE_FILE -#endif - -#define GDBM_DATA dba_gdbm_data *dba = info->dbf -#define GDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -typedef struct { - GDBM_FILE dbf; - datum nextkey; -} dba_gdbm_data; - -DBA_OPEN_FUNC(gdbm) -{ - GDBM_FILE dbf; - int gmode = 0; - int filemode = 0644; - - gmode = info->mode == DBA_READER ? GDBM_READER : - info->mode == DBA_WRITER ? GDBM_WRITER : - info->mode == DBA_CREAT ? GDBM_WRCREAT : - info->mode == DBA_TRUNC ? GDBM_NEWDB : -1; - - if(gmode == -1) - return FAILURE; /* not possible */ - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = gdbm_open(info->path, 0, gmode, filemode, NULL); - - if(dbf) { - info->dbf = pemalloc(sizeof(dba_gdbm_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_gdbm_data)); - ((dba_gdbm_data *) info->dbf)->dbf = dbf; - return SUCCESS; - } - *error = gdbm_strerror(gdbm_errno); - return FAILURE; -} - -DBA_CLOSE_FUNC(gdbm) -{ - GDBM_DATA; - - if(dba->nextkey.dptr) free(dba->nextkey.dptr); - gdbm_close(dba->dbf); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(gdbm) -{ - GDBM_DATA; - datum gval; - char *new = NULL; - - GDBM_GKEY; - gval = gdbm_fetch(dba->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - free(gval.dptr); - } - return new; -} - -DBA_UPDATE_FUNC(gdbm) -{ - datum gval; - GDBM_DATA; - - GDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(gdbm_store(dba->dbf, gkey, gval, - mode == 1 ? GDBM_INSERT : GDBM_REPLACE) == 0) - return SUCCESS; - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno)); - return FAILURE; -} - -DBA_EXISTS_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_exists(dba->dbf, gkey) ? SUCCESS : FAILURE; -} - -DBA_DELETE_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_delete(dba->dbf, gkey) == -1 ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(gdbm) -{ - GDBM_DATA; - datum gkey; - char *key = NULL; - - if(dba->nextkey.dptr) { - free(dba->nextkey.dptr); - } - - gkey = gdbm_firstkey(dba->dbf); - if(gkey.dptr) { - key = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return key; -} - -DBA_NEXTKEY_FUNC(gdbm) -{ - GDBM_DATA; - char *nkey = NULL; - datum gkey; - - if(!dba->nextkey.dptr) return NULL; - - gkey = gdbm_nextkey(dba->dbf, dba->nextkey); - free(dba->nextkey.dptr); - if(gkey.dptr) { - nkey = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(gdbm) -{ - GDBM_DATA; - gdbm_reorganize(dba->dbf); - return SUCCESS; -} - -DBA_SYNC_FUNC(gdbm) -{ - GDBM_DATA; - - gdbm_sync(dba->dbf); - return SUCCESS; -} - -DBA_INFO_FUNC(gdbm) -{ - return estrdup(gdbm_version); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c deleted file mode 100644 index d6cf951217c47..0000000000000 --- a/ext/dba/dba_inifile.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_INIFILE -#include "php_inifile.h" - -#include "libinifile/inifile.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -#define INIFILE_DATA \ - inifile *dba = info->dbf - -#define INIFILE_GKEY \ - key_type ini_key; \ - if (!key) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \ - return 0; \ - } \ - ini_key = inifile_key_split((char*)key) /* keylen not needed here */ - -#define INIFILE_DONE \ - inifile_key_free(&ini_key) - -DBA_OPEN_FUNC(inifile) -{ - info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT TSRMLS_CC); - - return info->dbf ? SUCCESS : FAILURE; -} - -DBA_CLOSE_FUNC(inifile) -{ - INIFILE_DATA; - - inifile_free(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(inifile) -{ - val_type ini_val; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val = inifile_fetch(dba, &ini_key, skip TSRMLS_CC); - *newlen = ini_val.value ? strlen(ini_val.value) : 0; - INIFILE_DONE; - return ini_val.value; -} - -DBA_UPDATE_FUNC(inifile) -{ - val_type ini_val; - int res; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val.value = val; - - if (mode == 1) { - res = inifile_append(dba, &ini_key, &ini_val TSRMLS_CC); - } else { - res = inifile_replace(dba, &ini_key, &ini_val TSRMLS_CC); - } - INIFILE_DONE; - switch(res) { - case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); - return FAILURE; - default: - case 0: - return SUCCESS; - case 1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists"); - return SUCCESS; - } -} - -DBA_EXISTS_FUNC(inifile) -{ - val_type ini_val; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val = inifile_fetch(dba, &ini_key, 0 TSRMLS_CC); - INIFILE_DONE; - if (ini_val.value) { - inifile_val_free(&ini_val); - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(inifile) -{ - int res; - - INIFILE_DATA; - INIFILE_GKEY; - - res = inifile_delete(dba, &ini_key TSRMLS_CC); - - INIFILE_DONE; - return (res == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(inifile) -{ - INIFILE_DATA; - - if (inifile_firstkey(dba TSRMLS_CC)) { - char *result = inifile_key_string(&dba->curr.key); - *newlen = strlen(result); - return result; - } else { - return NULL; - } -} - -DBA_NEXTKEY_FUNC(inifile) -{ - INIFILE_DATA; - - if (!dba->curr.key.group && !dba->curr.key.name) { - return NULL; - } - - if (inifile_nextkey(dba TSRMLS_CC)) { - char *result = inifile_key_string(&dba->curr.key); - *newlen = strlen(result); - return result; - } else { - return NULL; - } -} - -DBA_OPTIMIZE_FUNC(inifile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(inifile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_INFO_FUNC(inifile) -{ - return estrdup(inifile_version()); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c deleted file mode 100644 index aac1b491c8dc6..0000000000000 --- a/ext/dba/dba_ndbm.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_NDBM -#include "php_ndbm.h" - -#include -#ifdef NDBM_INCLUDE_FILE -#include NDBM_INCLUDE_FILE -#endif - -#define NDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -DBA_OPEN_FUNC(ndbm) -{ - DBM *dbf; - int gmode = 0; - int filemode = 0644; - dba_info *pinfo = (dba_info *) info; - - switch(info->mode) { - case DBA_READER: - gmode = O_RDONLY; - break; - case DBA_WRITER: - gmode = O_RDWR; - break; - case DBA_CREAT: - gmode = O_RDWR | O_CREAT; - break; - case DBA_TRUNC: - gmode = O_RDWR | O_CREAT | O_TRUNC; - break; - default: - return FAILURE; /* not possible */ - } - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = dbm_open(info->path, gmode, filemode); - - pinfo->dbf = dbf; - return SUCCESS; -} - -DBA_CLOSE_FUNC(ndbm) -{ - dbm_close(info->dbf); -} - -DBA_FETCH_FUNC(ndbm) -{ - datum gval; - char *new = NULL; - - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(ndbm) -{ - datum gval; - - NDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(!dbm_store(info->dbf, gkey, gval, mode == 1 ? DBM_INSERT : DBM_REPLACE)) - return SUCCESS; - return FAILURE; -} - -DBA_EXISTS_FUNC(ndbm) -{ - datum gval; - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(ndbm) -{ - NDBM_GKEY; - return(dbm_delete(info->dbf, gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(ndbm) -{ - datum gkey; - char *key = NULL; - - gkey = dbm_firstkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - } - return key; -} - -DBA_NEXTKEY_FUNC(ndbm) -{ - datum gkey; - char *nkey = NULL; - - gkey = dbm_nextkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(ndbm) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(ndbm) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(ndbm) -{ - return estrdup("NDBM"); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c deleted file mode 100755 index 4d79cd7f736e5..0000000000000 --- a/ext/dba/dba_qdbm.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcin Gibula | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_QDBM -#include "php_qdbm.h" - -#ifdef QDBM_INCLUDE_FILE -#include QDBM_INCLUDE_FILE -#endif - -#define QDBM_DATA dba_qdbm_data *dba = info->dbf - -typedef struct { - DEPOT *dbf; -} dba_qdbm_data; - -DBA_OPEN_FUNC(qdbm) -{ - DEPOT *dbf; - - switch(info->mode) { - case DBA_READER: - dbf = dpopen(info->path, DP_OREADER, 0); - break; - case DBA_WRITER: - dbf = dpopen(info->path, DP_OWRITER, 0); - break; - case DBA_CREAT: - dbf = dpopen(info->path, DP_OWRITER | DP_OCREAT, 0); - break; - case DBA_TRUNC: - dbf = dpopen(info->path, DP_OWRITER | DP_OCREAT | DP_OTRUNC, 0); - break; - default: - return FAILURE; - } - - if (dbf) { - info->dbf = pemalloc(sizeof(dba_qdbm_data), info->flags & DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_qdbm_data)); - ((dba_qdbm_data *) info->dbf)->dbf = dbf; - return SUCCESS; - } - - *error = (char *) dperrmsg(dpecode); - return FAILURE; -} - -DBA_CLOSE_FUNC(qdbm) -{ - QDBM_DATA; - - dpclose(dba->dbf); - pefree(dba, info->flags & DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(qdbm) -{ - QDBM_DATA; - char *value, *new = NULL; - int value_size; - - value = dpget(dba->dbf, key, keylen, 0, -1, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_UPDATE_FUNC(qdbm) -{ - QDBM_DATA; - int result; - - result = dpput(dba->dbf, key, keylen, val, vallen, mode == 1 ? DP_DKEEP : DP_DOVER); - if (result) - return SUCCESS; - - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode)); - return FAILURE; -} - -DBA_EXISTS_FUNC(qdbm) -{ - QDBM_DATA; - char *value; - - value = dpget(dba->dbf, key, keylen, 0, -1, NULL); - if (value) { - free(value); - return SUCCESS; - } - - return FAILURE; -} - -DBA_DELETE_FUNC(qdbm) -{ - QDBM_DATA; - - return dpout(dba->dbf, key, keylen) ? SUCCESS : FAILURE; -} - -DBA_FIRSTKEY_FUNC(qdbm) -{ - QDBM_DATA; - int value_size; - char *value, *new = NULL; - - dpiterinit(dba->dbf); - - value = dpiternext(dba->dbf, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_NEXTKEY_FUNC(qdbm) -{ - QDBM_DATA; - int value_size; - char *value, *new = NULL; - - value = dpiternext(dba->dbf, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_OPTIMIZE_FUNC(qdbm) -{ - QDBM_DATA; - - dpoptimize(dba->dbf, 0); - return SUCCESS; -} - -DBA_SYNC_FUNC(qdbm) -{ - QDBM_DATA; - - dpsync(dba->dbf); - return SUCCESS; -} - -DBA_INFO_FUNC(qdbm) -{ - return estrdup(dpversion); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/install_cdb.sh b/ext/dba/install_cdb.sh deleted file mode 100755 index ce5f3cc856283..0000000000000 --- a/ext/dba/install_cdb.sh +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/sh - -# You can use this script if you want to use an external cdb lib. If you -# compile php using --with-cdb the internal functions will be used and no -# external library is used so that this script is not necessary. -# -# cdb-0.75 lacks support for installing header files and creating a -# library which programs can link against. This shell script fills -# the gap. -# -# $Id: install_cdb.sh,v 1.2 2002-11-04 17:53:04 helly Exp $ - -if test -r "cdb.a" && test -r "auto-str.c" && test -r "byte.a"; then - : -else - echo "Please execute this script in the cdb-0.75 source directory after 'make'" - exit 1 -fi - -prefix=$1 - -if test -z "$prefix"; then - prefix=/usr/local -fi - -echo "Using prefix $prefix" - -if mkdir -p "$prefix/include" "$prefix/lib"; then - : -else - echo "Creating directories failed. Please become superuser." - exit 1 -fi - -mkdir -p tmp || exit 1 -cd tmp -ar x ../cdb.a -ar x ../byte.a -ar x ../unix.a -ar x ../byte.a -ar x ../buffer.a -cp ../error.o . - -# not really portable -ar r "$prefix/lib/libcdb.a" * -ranlib "$prefix/lib/libcdb.a" -cd .. - -rm -rf tmp - -cp cdb.h uint32.h "$prefix/include" - -echo "done" diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c deleted file mode 100644 index 2141a64c83209..0000000000000 --- a/ext/dba/libcdb/cdb.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include -#include -#ifndef PHP_WIN32 -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include "cdb.h" - -#ifndef EPROTO -# define EPROTO -15 /* cdb 0.75's default for PROTOless systems */ -#endif - -/* {{{ cdb_match */ -static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRMLS_DC) -{ - char buf[32]; - unsigned int n; - - while (len > 0) { - n = sizeof(buf); - if (n > len) - n = len; - if (cdb_read(c, buf, n, pos TSRMLS_CC) == -1) - return -1; - if (memcmp(buf, key, n)) - return 0; - pos += n; - key += n; - len -= n; - } - return 1; -} -/* }}} */ - -/* {{{ cdb_hash */ -uint32 cdb_hash(char *buf, unsigned int len) -{ - uint32 h; - - h = CDB_HASHSTART; - while (len--) { - h = ( h + (h << 5)) ^ (*buf++); - } - return h; -} -/* }}} */ - -/* {{{ cdb_free */ -void cdb_free(struct cdb *c TSRMLS_DC) -{ -} -/* }}} */ - -/* {{{ cdb_findstart */ -void cdb_findstart(struct cdb *c TSRMLS_DC) -{ - c->loop = 0; -} -/* }}} */ - -/* {{{ cdb_init */ -void cdb_init(struct cdb *c, php_stream *fp TSRMLS_DC) -{ - cdb_free(c TSRMLS_CC); - cdb_findstart(c TSRMLS_CC); - c->fp = fp; -} -/* }}} */ - -/* {{{ cdb_read */ -int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC) -{ - if (php_stream_seek(c->fp, pos, SEEK_SET) == -1) { - errno = EPROTO; - return -1; - } - while (len > 0) { - int r; - do { - r = php_stream_read(c->fp, buf, len); - } while ((r == -1) && (errno == EINTR)); - if (r == -1) - return -1; - if (r == 0) { - errno = EPROTO; - return -1; - } - buf += r; - len -= r; - } - return 0; -} -/* }}} */ - -/* {{{ cdb_findnext */ -int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC) -{ - char buf[8]; - uint32 pos; - uint32 u; - - if (!c->loop) { - u = cdb_hash(key, len); - if (cdb_read(c, buf, 8, (u << 3) & 2047 TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf + 4,&c->hslots); - if (!c->hslots) - return 0; - uint32_unpack(buf, &c->hpos); - c->khash = u; - u >>= 8; - u %= c->hslots; - u <<= 3; - c->kpos = c->hpos + u; - } - - while (c->loop < c->hslots) { - if (cdb_read(c, buf, 8, c->kpos TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf + 4, &pos); - if (!pos) - return 0; - c->loop += 1; - c->kpos += 8; - if (c->kpos == c->hpos + (c->hslots << 3)) - c->kpos = c->hpos; - uint32_unpack(buf, &u); - if (u == c->khash) { - if (cdb_read(c, buf, 8, pos TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf, &u); - if (u == len) - switch(cdb_match(c, key, len, pos + 8 TSRMLS_CC)) { - case -1: - return -1; - case 1: - uint32_unpack(buf + 4, &c->dlen); - c->dpos = pos + 8 + len; - return 1; - } - } - } - - return 0; -} -/* }}} */ - -/* {{{ cdb_find */ -int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC) -{ - cdb_findstart(c TSRMLS_CC); - return cdb_findnext(c, key, len TSRMLS_CC); -} -/* }}} */ - -/* {{{ cdb_version */ -char *cdb_version() -{ - return "0.75, $Revision$"; -} -/* }}} */ diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h deleted file mode 100644 index 39a67f5f148a9..0000000000000 --- a/ext/dba/libcdb/cdb.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef CDB_H -#define CDB_H - -#include "uint32.h" - -#define CDB_HASHSTART 5381 - -struct cdb { - php_stream *fp; - uint32 loop; /* number of hash slots searched under this key */ - uint32 khash; /* initialized if loop is nonzero */ - uint32 kpos; /* initialized if loop is nonzero */ - uint32 hpos; /* initialized if loop is nonzero */ - uint32 hslots; /* initialized if loop is nonzero */ - uint32 dpos; /* initialized if cdb_findnext() returns 1 */ - uint32 dlen; /* initialized if cdb_findnext() returns 1 */ -}; - -uint32 cdb_hash(char *, unsigned int); - -void cdb_free(struct cdb * TSRMLS_DC); -void cdb_init(struct cdb *, php_stream *fp TSRMLS_DC); - -int cdb_read(struct cdb *, char *, unsigned int, uint32 TSRMLS_DC); - -void cdb_findstart(struct cdb * TSRMLS_DC); -int cdb_findnext(struct cdb *, char *, unsigned int TSRMLS_DC); -int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC); - -#define cdb_datapos(c) ((c)->dpos) -#define cdb_datalen(c) ((c)->dlen) - -char *cdb_version(); - -#endif diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c deleted file mode 100644 index 97cb0bd287c5f..0000000000000 --- a/ext/dba/libcdb/cdb_make.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include "cdb.h" -#include "cdb_make.h" -#include "uint32.h" - -/* {{{ cdb_make_write */ -static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz TSRMLS_DC) { - return php_stream_write(c->fp, buf, sz) == sz ? 0 : -1; -} - -/* {{{ cdb_posplus */ -static int cdb_posplus(struct cdb_make *c, uint32 len) -{ - uint32 newpos = c->pos + len; - if (newpos < len) { - errno = ENOMEM; - return -1; - } - c->pos = newpos; - return 0; -} -/* }}} */ - -/* {{{ cdb_make_start */ -int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC) -{ - c->head = 0; - c->split = 0; - c->hash = 0; - c->numentries = 0; - c->fp = f; - c->pos = sizeof(c->final); - if (php_stream_seek(f, c->pos, SEEK_SET) == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Fseek failed"); - return -1; - } - return php_stream_tell(c->fp); -} -/* }}} */ - -/* {{{ cdb_make_addend */ -int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h TSRMLS_DC) -{ - struct cdb_hplist *head; - - head = c->head; - if (!head || (head->num >= CDB_HPLIST)) { - head = (struct cdb_hplist *) emalloc(sizeof(struct cdb_hplist)); - if (!head) - return -1; - head->num = 0; - head->next = c->head; - c->head = head; - } - head->hp[head->num].h = h; - head->hp[head->num].p = c->pos; - ++head->num; - ++c->numentries; - if (cdb_posplus(c,8) == -1) - return -1; - if (cdb_posplus(c, keylen) == -1) - return -1; - if (cdb_posplus(c, datalen) == -1) - return -1; - return 0; -} -/* }}} */ - -/* {{{ cdb_make_addbegin */ -int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen TSRMLS_DC) -{ - char buf[8]; - - if (keylen > 0xffffffff) { - errno = ENOMEM; - return -1; - } - if (datalen > 0xffffffff) { - errno = ENOMEM; - return -1; - } - - uint32_pack(buf, keylen); - uint32_pack(buf + 4, datalen); - if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0) - return -1; - return 0; -} - -/* {{{ cdb_make_add */ -int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen TSRMLS_DC) -{ - if (cdb_make_addbegin(c, keylen, datalen TSRMLS_CC) == -1) - return -1; - if (cdb_make_write(c, key, keylen TSRMLS_CC) != 0) - return -1; - if (cdb_make_write(c, data, datalen TSRMLS_CC) != 0) - return -1; - return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen) TSRMLS_CC); -} -/* }}} */ - -/* {{{ cdb_make_finish */ -int cdb_make_finish(struct cdb_make *c TSRMLS_DC) -{ - char buf[8]; - int i; - uint32 len; - uint32 u; - uint32 memsize; - uint32 count; - uint32 where; - struct cdb_hplist *x; - struct cdb_hp *hp; - - for (i = 0;i < 256;++i) - c->count[i] = 0; - - for (x = c->head; x; x = x->next) { - i = x->num; - while (i--) - ++c->count[255 & x->hp[i].h]; - } - - memsize = 1; - for (i = 0;i < 256;++i) { - u = c->count[i] * 2; - if (u > memsize) - memsize = u; - } - - memsize += c->numentries; /* no overflow possible up to now */ - u = (uint32) 0 - (uint32) 1; - u /= sizeof(struct cdb_hp); - if (memsize > u) { - errno = ENOMEM; - return -1; - } - - c->split = (struct cdb_hp *) safe_emalloc(memsize, sizeof(struct cdb_hp), 0); - if (!c->split) - return -1; - - c->hash = c->split + c->numentries; - - u = 0; - for (i = 0;i < 256;++i) { - u += c->count[i]; /* bounded by numentries, so no overflow */ - c->start[i] = u; - } - - for (x = c->head; x; x = x->next) { - i = x->num; - while (i--) - c->split[--c->start[255 & x->hp[i].h]] = x->hp[i]; - } - - for (i = 0;i < 256;++i) { - count = c->count[i]; - - len = count + count; /* no overflow possible */ - uint32_pack(c->final + 8 * i,c->pos); - uint32_pack(c->final + 8 * i + 4,len); - - for (u = 0;u < len;++u) - c->hash[u].h = c->hash[u].p = 0; - - hp = c->split + c->start[i]; - for (u = 0;u < count;++u) { - where = (hp->h >> 8) % len; - while (c->hash[where].p) - if (++where == len) - where = 0; - c->hash[where] = *hp++; - } - - for (u = 0;u < len;++u) { - uint32_pack(buf, c->hash[u].h); - uint32_pack(buf + 4, c->hash[u].p); - if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0) - return -1; - if (cdb_posplus(c, 8) == -1) - return -1; - } - } - - if (c->split) - efree(c->split); - - for (x = c->head; x; c->head = x) { - x = x->next; - efree(c->head); - } - - if (php_stream_flush(c->fp) != 0) - return -1; - php_stream_rewind(c->fp); - if (php_stream_tell(c->fp) != 0) - return -1; - if (cdb_make_write(c, c->final, sizeof(c->final) TSRMLS_CC) != 0) - return -1; - return php_stream_flush(c->fp); -} -/* }}} */ - -/* {{{ cdb_make_version */ -char *cdb_make_version() -{ - return "0.75, $Revision$"; -} diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h deleted file mode 100644 index 2177a6a14a05b..0000000000000 --- a/ext/dba/libcdb/cdb_make.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef CDB_MAKE_H -#define CDB_MAKE_H - -#include -#include "uint32.h" - -#define CDB_HPLIST 1000 - -struct cdb_hp { - uint32 h; - uint32 p; -}; - -struct cdb_hplist { - struct cdb_hp hp[CDB_HPLIST]; - struct cdb_hplist *next; - int num; -} ; - -struct cdb_make { - /* char bspace[8192]; */ - char final[2048]; - uint32 count[256]; - uint32 start[256]; - struct cdb_hplist *head; - struct cdb_hp *split; /* includes space for hash */ - struct cdb_hp *hash; - uint32 numentries; - /* buffer b; */ - uint32 pos; - /* int fd; */ - php_stream * fp; -}; - -int cdb_make_start(struct cdb_make *, php_stream * TSRMLS_DC); -int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC); -int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC); -int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC); -int cdb_make_finish(struct cdb_make * TSRMLS_DC); -char *cdb_make_version(); - -#endif diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c deleted file mode 100644 index cb9e2f5e06678..0000000000000 --- a/ext/dba/libcdb/uint32.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include "uint32.h" - -/* {{{ uint32_pack */ -void uint32_pack(char *out, uint32 in) -{ - out[0] = in&0xff; in>>=8; - out[1] = in&0xff; in>>=8; - out[2] = in&0xff; in>>=8; - out[3] = in&0xff; -} -/* }}} */ - -/* {{{ uint32_unpack */ -void uint32_unpack(const char *in, uint32 *out) -{ - *out = (((uint32)(unsigned char)in[3])<<24) | - (((uint32)(unsigned char)in[2])<<16) | - (((uint32)(unsigned char)in[1])<<8) | - (((uint32)(unsigned char)in[0])); -} -/* }}} */ diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h deleted file mode 100644 index 12f21598f7838..0000000000000 --- a/ext/dba/libcdb/uint32.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef UINT32_H -#define UINT32_H - -#if SIZEOF_INT == 4 -/* Most 32-bit and 64-bit systems have 32-bit ints */ -typedef unsigned int uint32; -#elif SIZEOF_LONG == 4 -/* 16-bit systems? */ -typedef unsigned long uint32; -#else -#error Need type which holds 32 bits -#endif - -void uint32_pack(char *out, uint32 in); -void uint32_unpack(const char *in, uint32 *out); - -#endif diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c deleted file mode 100644 index 50b83d6016c78..0000000000000 --- a/ext/dba/libflatfile/flatfile.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - | based on ext/db/db.c by: | - | Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "safe_mode.h" - -#include -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#include "flatfile.h" - -#define FLATFILE_BLOCK_SIZE 1024 - -/* - * ret = -1 means that database was opened for read-only - * ret = 0 success - * ret = 1 key already exists - nothing done - */ - -/* {{{ flatfile_store - */ -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) { - if (mode == FLATFILE_INSERT) { - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { - return 1; - } - php_stream_seek(dba->fp, 0L, SEEK_END); - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { - return -1; - } - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { - return -1; - } - } else { /* FLATFILE_REPLACE */ - flatfile_delete(dba, key_datum TSRMLS_CC); - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { - return -1; - } - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize); - if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { - return -1; - } - } - - php_stream_flush(dba->fp); - return 0; -} -/* }}} */ - -/* {{{ flatfile_fetch - */ -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) { - datum value_datum = {NULL, 0}; - char buf[16]; - - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { - if (php_stream_gets(dba->fp, buf, sizeof(buf))) { - value_datum.dsize = atoi(buf); - value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1); - value_datum.dsize = php_stream_read(dba->fp, value_datum.dptr, value_datum.dsize); - } else { - value_datum.dptr = NULL; - value_datum.dsize = 0; - } - } - return value_datum; -} -/* }}} */ - -/* {{{ flatfile_delete - */ -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) { - char *key = key_datum.dptr; - size_t size = key_datum.dsize; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - size_t num; - size_t pos; - - php_stream_rewind(dba->fp); - while(!php_stream_eof(dba->fp)) { - /* read in the length of the key name */ - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - pos = php_stream_tell(dba->fp); - - /* read in the key name */ - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - - if (size == num && !memcmp(buf, key, size)) { - php_stream_seek(dba->fp, pos, SEEK_SET); - php_stream_putc(dba->fp, 0); - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0L, SEEK_END); - efree(buf); - return SUCCESS; - } - - /* read in the length of the value */ - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - /* read in the value */ - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - return FAILURE; -} -/* }}} */ - -/* {{{ flatfile_findkey - */ -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) { - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - size_t num; - int ret=0; - void *key = key_datum.dptr; - size_t size = key_datum.dsize; - - php_stream_rewind(dba->fp); - while (!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (size == num) { - if (!memcmp(buf, key, size)) { - ret = 1; - break; - } - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - return ret; -} -/* }}} */ - -/* {{{ flatfile_firstkey - */ -datum flatfile_firstkey(flatfile *dba TSRMLS_DC) { - datum res; - size_t num; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - - php_stream_rewind(dba->fp); - while(!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (*(buf) != 0) { - dba->CurrentFlatFilePos = php_stream_tell(dba->fp); - res.dptr = buf; - res.dsize = num; - return res; - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - res.dptr = NULL; - res.dsize = 0; - return res; -} -/* }}} */ - -/* {{{ flatfile_nextkey - */ -datum flatfile_nextkey(flatfile *dba TSRMLS_DC) { - datum res; - size_t num; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - - php_stream_seek(dba->fp, dba->CurrentFlatFilePos, SEEK_SET); - while(!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (*(buf)!=0) { - dba->CurrentFlatFilePos = php_stream_tell(dba->fp); - res.dptr = buf; - res.dsize = num; - return res; - } - } - efree(buf); - res.dptr = NULL; - res.dsize = 0; - return res; -} -/* }}} */ - -/* {{{ flatfile_version */ -char *flatfile_version() -{ - return "1.0, $Revision$"; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h deleted file mode 100644 index eb6cdb4f90912..0000000000000 --- a/ext/dba/libflatfile/flatfile.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_LIB_FLATFILE_H -#define PHP_LIB_FLATFILE_H - -typedef struct { - char *dptr; - size_t dsize; -} datum; - -typedef struct { - char *lockfn; - int lockfd; - php_stream *fp; - size_t CurrentFlatFilePos; - datum nextkey; -} flatfile; - -#define FLATFILE_INSERT 1 -#define FLATFILE_REPLACE 0 - -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC); -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC); -datum flatfile_firstkey(flatfile *dba TSRMLS_DC); -datum flatfile_nextkey(flatfile *dba TSRMLS_DC); -char *flatfile_version(); - -#endif diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c deleted file mode 100644 index 9efed3d1a9666..0000000000000 --- a/ext/dba/libinifile/inifile.c +++ /dev/null @@ -1,592 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "safe_mode.h" - -#include -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#include "inifile.h" - -/* ret = -1 means that database was opened for read-only - * ret = 0 success - * ret = 1 key already exists - nothing done - */ - -/* {{{ inifile_version */ -char *inifile_version() -{ - return "1.0, $Revision$"; -} -/* }}} */ - -/* {{{ inifile_free_key */ -void inifile_key_free(key_type *key) -{ - if (key->group) { - efree(key->group); - } - if (key->name) { - efree(key->name); - } - memset(key, 0, sizeof(key_type)); -} -/* }}} */ - -/* {{{ inifile_free_val */ -void inifile_val_free(val_type *val) -{ - if (val->value) { - efree(val->value); - } - memset(val, 0, sizeof(val_type)); -} -/* }}} */ - -/* {{{ inifile_free_val */ -void inifile_line_free(line_type *ln) -{ - inifile_key_free(&ln->key); - inifile_val_free(&ln->val); - ln->pos = 0; -} -/* }}} */ - -/* {{{ inifile_alloc */ -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC) -{ - inifile *dba; - - if (!readonly) { - if (!php_stream_truncate_supported(fp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream"); - return NULL; - } - } - - dba = pemalloc(sizeof(inifile), persistent); - memset(dba, 0, sizeof(inifile)); - dba->fp = fp; - dba->readonly = readonly; - return dba; -} -/* }}} */ - -/* {{{ inifile_free */ -void inifile_free(inifile *dba, int persistent) -{ - if (dba) { - inifile_line_free(&dba->curr); - inifile_line_free(&dba->next); - pefree(dba, persistent); - } -} -/* }}} */ - -/* {{{ inifile_key_split */ -key_type inifile_key_split(const char *group_name) -{ - key_type key; - char *name; - - if (group_name[0] == '[' && (name = strchr(group_name, ']')) != NULL) { - key.group = estrndup(group_name+1, name - (group_name + 1)); - key.name = estrdup(name+1); - } else { - key.group = estrdup(""); - key.name = estrdup(group_name); - } - return key; -} -/* }}} */ - -/* {{{ inifile_key_string */ -char * inifile_key_string(const key_type *key) -{ - if (key->group && *key->group) { - char *result; - spprintf(&result, 0, "[%s]%s", key->group, key->name ? key->name : ""); - return result; - } else if (key->name) { - return estrdup(key->name); - } else { - return NULL; - } -} -/* }}} */ - -/* {{{ etrim */ -static char *etrim(const char *str) -{ - char *val; - size_t l; - - if (!str) { - return NULL; - } - val = (char*)str; - while (*val && strchr(" \t\r\n", *val)) { - val++; - } - l = strlen(val); - while (l && (strchr(" \t\r\n", val[l-1]))) { - l--; - } - return estrndup(val, l); -} -/* }}} */ - -/* {{{ inifile_findkey - */ -static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) { - char *fline; - char *pos; - - inifile_val_free(&ln->val); - while ((fline = php_stream_gets(dba->fp, NULL, 0)) != NULL) { - if (fline) { - if (fline[0] == '[') { - /* A value name cannot start with '[' - * So either we find a ']' or we found an error - */ - pos = strchr(fline+1, ']'); - if (pos) { - *pos = '\0'; - inifile_key_free(&ln->key); - ln->key.group = etrim(fline+1); - ln->key.name = estrdup(""); - ln->pos = php_stream_tell(dba->fp); - efree(fline); - return 1; - } else { - efree(fline); - continue; - } - } else { - pos = strchr(fline, '='); - if (pos) { - *pos = '\0'; - /* keep group or make empty if not existent */ - if (!ln->key.group) { - ln->key.group = estrdup(""); - } - if (ln->key.name) { - efree(ln->key.name); - } - ln->key.name = etrim(fline); - ln->val.value = etrim(pos+1); - ln->pos = php_stream_tell(dba->fp); - efree(fline); - return 1; - } else { - /* simply ignore lines without '=' - * those should be comments - */ - efree(fline); - continue; - } - } - } - } - inifile_line_free(ln); - return 0; -} -/* }}} */ - -/* {{{ inifile_key_cmp */ -/* 0 = EQUAL - * 1 = GROUP-EQUAL,NAME-DIFFERENT - * 2 = DIFFERENT - */ -static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC) -{ - assert(k1->group && k1->name && k2->group && k2->name); - - if (!strcasecmp(k1->group, k2->group)) { - if (!strcasecmp(k1->name, k2->name)) { - return 0; - } else { - return 1; - } - } else { - return 2; - } -} -/* }}} */ - -/* {{{ inifile_fetch - */ -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { - line_type ln = {{NULL,NULL},{NULL}}; - val_type val; - int res, grp_eq = 0; - - if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) { - /* we got position already from last fetch */ - php_stream_seek(dba->fp, dba->next.pos, SEEK_SET); - } else { - /* specific instance or not same key -> restart search */ - /* the slow way: restart and seacrch */ - php_stream_rewind(dba->fp); - inifile_line_free(&dba->next); - } - if (skip == -1) { - skip = 0; - } - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (!(res=inifile_key_cmp(&ln.key, key TSRMLS_CC))) { - if (!skip) { - val.value = estrdup(ln.val.value ? ln.val.value : ""); - /* allow faster access by updating key read into next */ - inifile_line_free(&dba->next); - dba->next = ln; - dba->next.pos = php_stream_tell(dba->fp); - return val; - } - skip--; - } else if (res == 1) { - grp_eq = 1; - } else if (grp_eq) { - /* we are leaving group now: that means we cannot find the key */ - break; - } - } - inifile_line_free(&ln); - dba->next.pos = php_stream_tell(dba->fp); - return ln.val; -} -/* }}} */ - -/* {{{ inifile_firstkey - */ -int inifile_firstkey(inifile *dba TSRMLS_DC) { - inifile_line_free(&dba->curr); - dba->curr.pos = 0; - return inifile_nextkey(dba TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_nextkey - */ -int inifile_nextkey(inifile *dba TSRMLS_DC) { - line_type ln = {{NULL,NULL},{NULL}}; - - /*inifile_line_free(&dba->next); ??? */ - php_stream_seek(dba->fp, dba->curr.pos, SEEK_SET); - ln.key.group = estrdup(dba->curr.key.group ? dba->curr.key.group : ""); - inifile_read(dba, &ln TSRMLS_CC); - inifile_line_free(&dba->curr); - dba->curr = ln; - return ln.key.group || ln.key.name; -} -/* }}} */ - -/* {{{ inifile_truncate - */ -static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC) -{ - int res; - - if ((res=php_stream_truncate_set_size(dba->fp, size)) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in ftruncate: %d", res); - return FAILURE; - } - php_stream_seek(dba->fp, size, SEEK_SET); - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_find_group - * if found pos_grp_start points to "[group_name]" - */ -static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) -{ - int ret = FAILURE; - - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0, SEEK_SET); - inifile_line_free(&dba->curr); - inifile_line_free(&dba->next); - - if (key->group && strlen(key->group)) { - int res; - line_type ln = {{NULL,NULL},{NULL}}; - - res = 1; - while(inifile_read(dba, &ln TSRMLS_CC)) { - if ((res=inifile_key_cmp(&ln.key, key TSRMLS_CC)) < 2) { - ret = SUCCESS; - break; - } - *pos_grp_start = php_stream_tell(dba->fp); - } - inifile_line_free(&ln); - } else { - *pos_grp_start = 0; - ret = SUCCESS; - } - if (ret == FAILURE) { - *pos_grp_start = php_stream_tell(dba->fp); - } - return ret; -} -/* }}} */ - -/* {{{ inifile_next_group - * only valid after a call to inifile_find_group - * if any next group is found pos_grp_start points to "[group_name]" or whitespace before that - */ -static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) -{ - int ret = FAILURE; - line_type ln = {{NULL,NULL},{NULL}}; - - *pos_grp_start = php_stream_tell(dba->fp); - ln.key.group = estrdup(key->group); - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (inifile_key_cmp(&ln.key, key TSRMLS_CC) == 2) { - ret = SUCCESS; - break; - } - *pos_grp_start = php_stream_tell(dba->fp); - } - inifile_line_free(&ln); - return ret; -} -/* }}} */ - -/* {{{ inifile_copy_to - */ -static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy TSRMLS_DC) -{ - php_stream *fp; - - if (pos_start == pos_end) { - *ini_copy = NULL; - return SUCCESS; - } - if ((fp = php_stream_temp_create(0, 64 * 1024)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); - *ini_copy = NULL; - return FAILURE; - } - - if ((*ini_copy = inifile_alloc(fp, 1, 0 TSRMLS_CC)) == NULL) { - /* writes error */ - return FAILURE; - } - php_stream_seek(dba->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(dba->fp, fp, pos_end - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%d - %d] to temporary stream", pos_start, pos_end); - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_filter - * copy from to dba while ignoring key name (group must equal) - */ -static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC) -{ - size_t pos_start = 0, pos_next = 0, pos_curr; - int ret = SUCCESS; - line_type ln = {{NULL,NULL},{NULL}}; - - php_stream_seek(from->fp, 0, SEEK_SET); - php_stream_seek(dba->fp, 0, SEEK_END); - while(inifile_read(from, &ln TSRMLS_CC)) { - switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) { - case 0: - pos_curr = php_stream_tell(from->fp); - if (pos_start != pos_next) { - php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(from->fp, dba->fp, pos_next - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%d - %d] from temporary stream", pos_next, pos_start); - ret = FAILURE; - } - php_stream_seek(from->fp, pos_curr, SEEK_SET); - } - pos_next = pos_start = pos_curr; - break; - case 1: - pos_next = php_stream_tell(from->fp); - break; - case 2: - /* the function is meant to process only entries from same group */ - assert(0); - break; - } - } - if (pos_start != pos_next) { - php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(from->fp, dba->fp, pos_next - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%d - %d] from temporary stream", pos_next, pos_start); - ret = FAILURE; - } - } - inifile_line_free(&ln); - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_delete_replace_append - */ -static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) -{ - size_t pos_grp_start, pos_grp_next; - inifile *ini_tmp = NULL; - php_stream *fp_tmp = NULL; - int ret; - - /* 1) Search group start - * 2) Search next group - * 3) If not append: Copy group to ini_tmp - * 4) Open temp_stream and copy remainder - * 5) Truncate stream - * 6) If not append AND key.name given: Filtered copy back from ini_tmp - * to stream. Otherwise the user wanted to delete the group. - * 7) Append value if given - * 8) Append temporary stream - */ - - assert(!append || (key->name && value)); /* missuse */ - - /* 1 - 3 */ - inifile_find_group(dba, key, &pos_grp_start TSRMLS_CC); - inifile_next_group(dba, key, &pos_grp_next TSRMLS_CC); - if (append) { - ret = SUCCESS; - } else { - ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp TSRMLS_CC); - } - - /* 4 */ - if (ret == SUCCESS) { - fp_tmp = php_stream_temp_create(0, 64 * 1024); - if (!fp_tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); - ret = FAILURE; - } else { - php_stream_seek(dba->fp, 0, SEEK_END); - if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { - php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); - if (!php_stream_copy_to_stream(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); - ret = FAILURE; - } - } - } - } - - /* 5 */ - if (ret == SUCCESS) { - ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */ - } - - if (ret == SUCCESS) { - if (key->name && strlen(key->name)) { - /* 6 */ - if (!append && ini_tmp) { - ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC); - } - - /* 7 */ - /* important: do not query ret==SUCCESS again: inifile_filter might fail but - * however next operation must be done. - */ - if (value) { - if (pos_grp_start == pos_grp_next && key->group && strlen(key->group)) { - php_stream_printf(dba->fp TSRMLS_CC, "[%s]\n", key->group); - } - php_stream_printf(dba->fp TSRMLS_CC, "%s=%s\n", key->name, value->value ? value->value : ""); - } - } - - /* 8 */ - /* important: do not query ret==SUCCESS again: inifile_filter might fail but - * however next operation must be done. - */ - if (fp_tmp && php_stream_tell(fp_tmp)) { - php_stream_seek(fp_tmp, 0, SEEK_SET); - php_stream_seek(dba->fp, 0, SEEK_END); - if (!php_stream_copy_to_stream(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not copy from temporary stream - ini file truncated"); - ret = FAILURE; - } - } - } - - if (ini_tmp) { - php_stream_close(ini_tmp->fp); - inifile_free(ini_tmp, 0); - } - if (fp_tmp) { - php_stream_close(fp_tmp); - } - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0, SEEK_SET); - - return ret; -} -/* }}} */ - -/* {{{ inifile_delete - */ -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_relace - */ -int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_append - */ -int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h deleted file mode 100644 index e76fb35523d36..0000000000000 --- a/ext/dba/libinifile/inifile.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_LIB_INIFILE_H -#define PHP_LIB_INIFILE_H - -typedef struct { - char *group; - char *name; -} key_type; - -typedef struct { - char *value; -} val_type; - -typedef struct { - key_type key; - val_type val; - size_t pos; -} line_type; - -typedef struct { - char *lockfn; - int lockfd; - php_stream *fp; - int readonly; - line_type curr; - line_type next; -} inifile; - -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC); -int inifile_firstkey(inifile *dba TSRMLS_DC); -int inifile_nextkey(inifile *dba TSRMLS_DC); -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC); -int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -char *inifile_version(); - -key_type inifile_key_split(const char *group_name); -char * inifile_key_string(const key_type *key); - -void inifile_key_free(key_type *key); -void inifile_val_free(val_type *val); -void inifile_line_free(line_type *ln); - -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC); -void inifile_free(inifile *dba, int persistent); - -#endif diff --git a/ext/dba/php_cdb.h b/ext/dba/php_cdb.h deleted file mode 100644 index a046f0796b378..0000000000000 --- a/ext/dba/php_cdb.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_CDB_H -#define PHP_CDB_H - -#if DBA_CDB - -#include "php_dba.h" - -DBA_FUNCS(cdb); - -#endif - -#endif diff --git a/ext/dba/php_db1.h b/ext/dba/php_db1.h deleted file mode 100755 index c0bb5f08b4b6c..0000000000000 --- a/ext/dba/php_db1.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB1_H -#define PHP_DB1_H - -#if DBA_DB1 - -#include "php_dba.h" - -DBA_FUNCS(db1); - -#endif - -#endif diff --git a/ext/dba/php_db2.h b/ext/dba/php_db2.h deleted file mode 100644 index 2a95223a85442..0000000000000 --- a/ext/dba/php_db2.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB2_H -#define PHP_DB2_H - -#if DBA_DB2 - -#include "php_dba.h" - -DBA_FUNCS(db2); - -#endif - -#endif diff --git a/ext/dba/php_db3.h b/ext/dba/php_db3.h deleted file mode 100644 index 58bb0b62a08f7..0000000000000 --- a/ext/dba/php_db3.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB3_H -#define PHP_DB3_H - -#if DBA_DB3 - -#include "php_dba.h" - -DBA_FUNCS(db3); - -#endif - -#endif diff --git a/ext/dba/php_db4.h b/ext/dba/php_db4.h deleted file mode 100644 index fa814c3f5ec4b..0000000000000 --- a/ext/dba/php_db4.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB4_H -#define PHP_DB4_H - -#if DBA_DB4 - -#include "php_dba.h" - -DBA_FUNCS(db4); - -#endif - -#endif diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h deleted file mode 100644 index dd1a406b2a33e..0000000000000 --- a/ext/dba/php_dba.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_DBA_H -#define PHP_DBA_H - -#if HAVE_DBA - -typedef enum { - /* do not allow 0 here */ - DBA_READER = 1, - DBA_WRITER, - DBA_TRUNC, - DBA_CREAT -} dba_mode_t; - -typedef struct dba_lock { - php_stream *fp; - char *name; - int mode; /* LOCK_EX,LOCK_SH */ -} dba_lock; - -typedef struct dba_info { - /* public */ - void *dbf; /* ptr to private data or whatever */ - char *path; - dba_mode_t mode; - php_stream *fp; /* this is the database stream for builtin handlers */ - int fd; - /* arg[cv] are only available when the dba_open handler is called! */ - int argc; - zval ***argv; - /* private */ - int flags; /* whether and how dba did locking and other flags*/ - struct dba_handler *hnd; - dba_lock lock; -} dba_info; - -#define DBA_LOCK_READER (0x0001) -#define DBA_LOCK_WRITER (0x0002) -#define DBA_LOCK_CREAT (0x0004) -#define DBA_LOCK_TRUNC (0x0008) - -#define DBA_LOCK_EXT (0) -#define DBA_LOCK_ALL (DBA_LOCK_READER|DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC) -#define DBA_LOCK_WCT (DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC) - -#define DBA_STREAM_OPEN (0x0010) -#define DBA_PERSISTENT (0x0020) - -#define DBA_CAST_AS_FD (0x0050) -#define DBA_NO_APPEND (0x00D0) - -extern zend_module_entry dba_module_entry; -#define dba_module_ptr &dba_module_entry - -typedef struct dba_handler { - char *name; /* handler name */ - int flags; /* whether and how dba does locking and other flags*/ - int (*open)(dba_info *, char **error TSRMLS_DC); - void (*close)(dba_info * TSRMLS_DC); - char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC); - int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC); - int (*exists)(dba_info *, char *, int TSRMLS_DC); - int (*delete)(dba_info *, char *, int TSRMLS_DC); - char* (*firstkey)(dba_info *, int * TSRMLS_DC); - char* (*nextkey)(dba_info *, int * TSRMLS_DC); - int (*optimize)(dba_info * TSRMLS_DC); - int (*sync)(dba_info * TSRMLS_DC); - char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC); - /* dba_info==NULL: Handler info, dba_info!=NULL: Database info */ -} dba_handler; - -/* common prototypes which must be supplied by modules */ - -#define DBA_OPEN_FUNC(x) \ - int dba_open_##x(dba_info *info, char **error TSRMLS_DC) -#define DBA_CLOSE_FUNC(x) \ - void dba_close_##x(dba_info *info TSRMLS_DC) -#define DBA_FETCH_FUNC(x) \ - char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen TSRMLS_DC) -#define DBA_UPDATE_FUNC(x) \ - int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode TSRMLS_DC) -#define DBA_EXISTS_FUNC(x) \ - int dba_exists_##x(dba_info *info, char *key, int keylen TSRMLS_DC) -#define DBA_DELETE_FUNC(x) \ - int dba_delete_##x(dba_info *info, char *key, int keylen TSRMLS_DC) -#define DBA_FIRSTKEY_FUNC(x) \ - char *dba_firstkey_##x(dba_info *info, int *newlen TSRMLS_DC) -#define DBA_NEXTKEY_FUNC(x) \ - char *dba_nextkey_##x(dba_info *info, int *newlen TSRMLS_DC) -#define DBA_OPTIMIZE_FUNC(x) \ - int dba_optimize_##x(dba_info *info TSRMLS_DC) -#define DBA_SYNC_FUNC(x) \ - int dba_sync_##x(dba_info *info TSRMLS_DC) -#define DBA_INFO_FUNC(x) \ - char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC) - -#define DBA_FUNCS(x) \ - DBA_OPEN_FUNC(x); \ - DBA_CLOSE_FUNC(x); \ - DBA_FETCH_FUNC(x); \ - DBA_UPDATE_FUNC(x); \ - DBA_DELETE_FUNC(x); \ - DBA_EXISTS_FUNC(x); \ - DBA_FIRSTKEY_FUNC(x); \ - DBA_NEXTKEY_FUNC(x); \ - DBA_OPTIMIZE_FUNC(x); \ - DBA_SYNC_FUNC(x); \ - DBA_INFO_FUNC(x) - -#define VALLEN(p) Z_STRVAL_PP(p), Z_STRLEN_PP(p) - -PHP_FUNCTION(dba_open); -PHP_FUNCTION(dba_popen); -PHP_FUNCTION(dba_close); -PHP_FUNCTION(dba_firstkey); -PHP_FUNCTION(dba_nextkey); -PHP_FUNCTION(dba_replace); -PHP_FUNCTION(dba_insert); -PHP_FUNCTION(dba_delete); -PHP_FUNCTION(dba_exists); -PHP_FUNCTION(dba_fetch); -PHP_FUNCTION(dba_optimize); -PHP_FUNCTION(dba_sync); -PHP_FUNCTION(dba_handlers); -PHP_FUNCTION(dba_list); -PHP_FUNCTION(dba_key_split); - -#else -#define dba_module_ptr NULL -#endif - -#define phpext_dba_ptr dba_module_ptr - -#endif diff --git a/ext/dba/php_dbm.h b/ext/dba/php_dbm.h deleted file mode 100644 index 4c963d18ed91f..0000000000000 --- a/ext/dba/php_dbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DBM_H -#define PHP_DBM_H - -#if DBA_DBM - -#include "php_dba.h" - -DBA_FUNCS(dbm); - -#endif - -#endif diff --git a/ext/dba/php_flatfile.h b/ext/dba/php_flatfile.h deleted file mode 100644 index afa9f6d5d3920..0000000000000 --- a/ext/dba/php_flatfile.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_FLATFILE_H -#define PHP_FLATFILE_H - -#if DBA_FLATFILE - -#include "php_dba.h" - -DBA_FUNCS(flatfile); - -#endif - -#endif diff --git a/ext/dba/php_gdbm.h b/ext/dba/php_gdbm.h deleted file mode 100644 index 3068404cfe265..0000000000000 --- a/ext/dba/php_gdbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_GDBM_H -#define PHP_GDBM_H - -#if DBA_GDBM - -#include "php_dba.h" - -DBA_FUNCS(gdbm); - -#endif - -#endif diff --git a/ext/dba/php_inifile.h b/ext/dba/php_inifile.h deleted file mode 100644 index 69444df3c6d48..0000000000000 --- a/ext/dba/php_inifile.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_INIFILE_H -#define PHP_INIFILE_H - -#if DBA_INIFILE - -#include "php_dba.h" - -DBA_FUNCS(inifile); - -#endif - -#endif diff --git a/ext/dba/php_ndbm.h b/ext/dba/php_ndbm.h deleted file mode 100644 index b1ebf15af32d7..0000000000000 --- a/ext/dba/php_ndbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_NDBM_H -#define PHP_NDBM_H - -#if DBA_NDBM - -#include "php_dba.h" - -DBA_FUNCS(ndbm); - -#endif - -#endif diff --git a/ext/dba/php_qdbm.h b/ext/dba/php_qdbm.h deleted file mode 100644 index c88efcff4cfa1..0000000000000 --- a/ext/dba/php_qdbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_QDBM_H -#define PHP_QDBM_H - -#if DBA_QDBM - -#include "php_dba.h" - -DBA_FUNCS(qdbm); - -#endif - -#endif diff --git a/ext/dba/tests/dba001.phpt b/ext/dba/tests/dba001.phpt deleted file mode 100644 index 3d617fb2c231f..0000000000000 --- a/ext/dba/tests/dba001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -DBA File Creation Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -database file created \ No newline at end of file diff --git a/ext/dba/tests/dba002.phpt b/ext/dba/tests/dba002.phpt deleted file mode 100644 index 3f862e38c5107..0000000000000 --- a/ext/dba/tests/dba002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -DBA Insert/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -This is a test insert diff --git a/ext/dba/tests/dba003.phpt b/ext/dba/tests/dba003.phpt deleted file mode 100644 index 617ae91891ef6..0000000000000 --- a/ext/dba/tests/dba003.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -DBA Insert/Replace/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -This is the replacement text diff --git a/ext/dba/tests/dba004.phpt b/ext/dba/tests/dba004.phpt deleted file mode 100644 index 3b1f29c7dd6e2..0000000000000 --- a/ext/dba/tests/dba004.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DBA Multiple Insert/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -Another Content String Content String 2 diff --git a/ext/dba/tests/dba005.phpt b/ext/dba/tests/dba005.phpt deleted file mode 100644 index 5a933c48f984b..0000000000000 --- a/ext/dba/tests/dba005.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey Loop Test With 5 Items ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -5YYYYY diff --git a/ext/dba/tests/dba006.phpt b/ext/dba/tests/dba006.phpt deleted file mode 100644 index efa36a5d0709b..0000000000000 --- a/ext/dba/tests/dba006.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey with 2 deletes ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -3NYNYY \ No newline at end of file diff --git a/ext/dba/tests/dba007.phpt b/ext/dba/tests/dba007.phpt deleted file mode 100644 index 577dacc68c153..0000000000000 --- a/ext/dba/tests/dba007.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -DBA Multiple File Creation Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -database file created -database file created -database file created -array(3) { - [%d]=> - string(%d) "%s/dba/tests/test0.dbm" - [%d]=> - string(%d) "%s/dba/tests/test1.dbm" - [%d]=> - string(%d) "%s/dba/tests/test2.dbm" -} \ No newline at end of file diff --git a/ext/dba/tests/dba008.phpt b/ext/dba/tests/dba008.phpt deleted file mode 100644 index 84a47ba0836f7..0000000000000 --- a/ext/dba/tests/dba008.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -DBA magic_quotes_runtime Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -string(1) """ -string(2) "\"" -string(2) "\"" -string(1) """ diff --git a/ext/dba/tests/dba009.phpt b/ext/dba/tests/dba009.phpt deleted file mode 100755 index 50a50c6bd5a08..0000000000000 --- a/ext/dba/tests/dba009.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -DBA dba_popen Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -Opened -Inserted -Closed -Opened -Inserted diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt deleted file mode 100644 index f3bf7975ea06c..0000000000000 --- a/ext/dba/tests/dba_cdb.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -DBA CDB handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: cdb -5YYYYY -Content String 2 -array(5) { - ["key1"]=> - string(16) "Content String 1" - ["key2"]=> - string(16) "Content String 2" - ["key3"]=> - string(20) "Third Content String" - ["key4"]=> - string(22) "Another Content String" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -5YYYYY -Content String 2 -array(5) { - ["key1"]=> - string(16) "Content String 1" - ["key2"]=> - string(16) "Content String 2" - ["key3"]=> - string(20) "Third Content String" - ["key4"]=> - string(22) "Another Content String" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt deleted file mode 100644 index 04df9252d800b..0000000000000 --- a/ext/dba/tests/dba_cdb_make.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -DBA CDB_MAKE handler test ---INI-- -magic_quotes_runtime=1 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -database handler: cdb_make -string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" -string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" \ No newline at end of file diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt deleted file mode 100644 index a0fbe7bccaee2..0000000000000 --- a/ext/dba/tests/dba_cdb_read.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -DBA CDB handler test (read only) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -database handler: cdb -7YYYYNNN -=1234 -#1122 -?1212314 -#1212314 -=1231324 \ No newline at end of file diff --git a/ext/dba/tests/dba_db1.phpt b/ext/dba/tests/dba_db1.phpt deleted file mode 100755 index 983954b50b165..0000000000000 --- a/ext/dba/tests/dba_db1.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB1 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db1 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db2.phpt b/ext/dba/tests/dba_db2.phpt deleted file mode 100644 index bcc5a9479306c..0000000000000 --- a/ext/dba/tests/dba_db2.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB2 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db2 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db3.phpt b/ext/dba/tests/dba_db3.phpt deleted file mode 100644 index c6d04cf02d084..0000000000000 --- a/ext/dba/tests/dba_db3.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB3 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db3 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt deleted file mode 100644 index fcf089a1e90b0..0000000000000 --- a/ext/dba/tests/dba_db4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB4 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db4 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt deleted file mode 100644 index fdd7b375f4457..0000000000000 --- a/ext/dba/tests/dba_dbm.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: dbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt deleted file mode 100644 index 2e32b8a327815..0000000000000 --- a/ext/dba/tests/dba_flatfile.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA FlatFile handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: flatfile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt deleted file mode 100644 index f9b3e3c6067ad..0000000000000 --- a/ext/dba/tests/dba_gdbm.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -DBA GDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -database handler: gdbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc deleted file mode 100644 index c1e3c49c70e0f..0000000000000 --- a/ext/dba/tests/dba_handler.inc +++ /dev/null @@ -1,90 +0,0 @@ - \ No newline at end of file diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt deleted file mode 100644 index 9511a8bb49b5f..0000000000000 --- a/ext/dba/tests/dba_inifile.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA INIFILE handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: inifile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_ndbm.phpt b/ext/dba/tests/dba_ndbm.phpt deleted file mode 100644 index f7955c5813ecd..0000000000000 --- a/ext/dba/tests/dba_ndbm.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA NDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: ndbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_qdbm.phpt b/ext/dba/tests/dba_qdbm.phpt deleted file mode 100755 index a7c9ab69e13af..0000000000000 --- a/ext/dba/tests/dba_qdbm.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -DBA QDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -database handler: qdbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} - -Warning: dba_popen(%stest0.dbm,r-): Locking cannot be disabled for handler qdbm in %sdba_handler.inc on line %d -===DONE=== diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc deleted file mode 100644 index e75000fafdeda..0000000000000 --- a/ext/dba/tests/skipif.inc +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/ext/dba/tests/test.cdb b/ext/dba/tests/test.cdb deleted file mode 100644 index 21529c6280e74..0000000000000 Binary files a/ext/dba/tests/test.cdb and /dev/null differ diff --git a/ext/dba/tests/test.inc b/ext/dba/tests/test.inc deleted file mode 100644 index 04f954541c553..0000000000000 --- a/ext/dba/tests/test.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/ext/dbase/CREDITS b/ext/dbase/CREDITS deleted file mode 100644 index ea6adcaf41d17..0000000000000 --- a/ext/dbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dBase -Jim Winstead diff --git a/ext/dbase/config.m4 b/ext/dbase/config.m4 deleted file mode 100644 index 84202b320c5da..0000000000000 --- a/ext/dbase/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(dbase,whether to enable dbase support, -[ --enable-dbase Enable the bundled dbase library]) - -if test "$PHP_DBASE" = "yes"; then - AC_DEFINE(DBASE,1,[ ]) - PHP_NEW_EXTENSION(dbase, dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c, $ext_shared) -fi diff --git a/ext/dbase/config.w32 b/ext/dbase/config.w32 deleted file mode 100644 index 4a424a9926bbe..0000000000000 --- a/ext/dbase/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("dbase", "Enable the bundled dbase library", "no"); - -if (PHP_DBASE != "no") { - EXTENSION("dbase", "dbase.c dbf_head.c dbf_misc.c dbf_ndx.c dbf_rec.c"); - AC_DEFINE('HAVE_DBASE', 1, 'dbase support'); - ADD_FLAG("CFLAGS_DBASE", "/D DBASE=1"); -} diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c deleted file mode 100644 index 764fc9fc053a1..0000000000000 --- a/ext/dbase/dbase.c +++ /dev/null @@ -1,848 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include "php_globals.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if DBASE -#include "php_dbase.h" -#include "dbf.h" -#if defined(THREAD_SAFE) -DWORD DbaseTls; -static int numthreads=0; -void *dbase_mutex; - -typedef struct dbase_global_struct{ - int le_dbhead; -}dbase_global_struct; - -#define DBase_GLOBAL(a) dbase_globals->a - -#define DBase_TLS_VARS \ - dbase_global_struct *dbase_globals; \ - dbase_globals=TlsGetValue(DbaseTls); - -#else -static int le_dbhead; -#define DBase_GLOBAL(a) a -#define DBase_TLS_VARS -#endif - -#include -#include - - -static void _close_dbase(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dbhead_t *dbhead = (dbhead_t *)rsrc->ptr; - - close(dbhead->db_fd); - free_dbf_head(dbhead); -} - - -PHP_MINIT_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; -#ifdef COMPILE_DL_DBASE - CREATE_MUTEX(dbase_mutex, "DBase_TLS"); - SET_MUTEX(dbase_mutex); - numthreads++; - if (numthreads==1){ - if ((DbaseTls=TlsAlloc())==0xFFFFFFFF){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif - dbase_globals = (dbase_global_struct *) LocalAlloc(LPTR, sizeof(dbase_global_struct)); - TlsSetValue(DbaseTls, (void *) dbase_globals); -#endif - DBase_GLOBAL(le_dbhead) = - zend_register_list_destructors_ex(_close_dbase, NULL, "dbase", module_number); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; - dbase_globals = TlsGetValue(DbaseTls); - if (dbase_globals != 0) - LocalFree((HLOCAL) dbase_globals); -#ifdef COMPILE_DL_DBASE - SET_MUTEX(dbase_mutex); - numthreads--; - if (!numthreads){ - if (!TlsFree(DbaseTls)){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif -#endif - return SUCCESS; -} - -/* {{{ proto int dbase_open(string name, int mode) - Opens a dBase-format database file */ -PHP_FUNCTION(dbase_open) -{ - zval **dbf_name, **options; - dbhead_t *dbh; - int handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dbf_name, &options) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(dbf_name); - convert_to_long_ex(options); - - if (Z_LVAL_PP(options) == 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open %s in write-only mode", Z_STRVAL_PP(dbf_name)); - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(dbf_name) TSRMLS_CC)) { - RETURN_FALSE; - } - - dbh = dbf_open(Z_STRVAL_PP(dbf_name), Z_LVAL_PP(options) TSRMLS_CC); - if (dbh == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to open database %s", Z_STRVAL_PP(dbf_name)); - RETURN_FALSE; - } - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ proto bool dbase_close(int identifier) - Closes an open dBase-format database file */ -PHP_FUNCTION(dbase_close) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_PP(dbh_id)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int dbase_numrecords(int identifier) - Returns the number of records in the database */ -PHP_FUNCTION(dbase_numrecords) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_records); -} -/* }}} */ - -/* {{{ proto int dbase_numfields(int identifier) - Returns the number of fields (columns) in the database */ -PHP_FUNCTION(dbase_numfields) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dbh_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_nfields); -} -/* }}} */ - -/* {{{ proto bool dbase_pack(int identifier) - Packs the database (deletes records marked for deletion) */ -PHP_FUNCTION(dbase_pack) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dbh_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - pack_dbf(dbh); - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_add_record(int identifier, array data) - Adds a record to the database */ -PHP_FUNCTION(dbase_add_record) -{ - zval **dbh_id, **fields, **field; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dbh_id, &fields) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - if (num_fields != dbh->db_nfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - zval tmp; - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - - tmp = **field; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL(tmp)); - zval_dtor(&tmp); - t_cp += cur_f->db_flen; - } - - dbh->db_records++; - if (put_dbf_record(dbh, dbh->db_records, cp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_replace_record(int identifier, array data, int recnum) - Replaces a record to the database */ -PHP_FUNCTION(dbase_replace_record) -{ - zval **dbh_id, **fields, **field, **recnum; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &dbh_id, &fields, &recnum) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(recnum); - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - if (num_fields != dbh->db_nfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - convert_to_string_ex(field); - snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL_PP(field)); - t_cp += cur_f->db_flen; - } - - if (put_dbf_record(dbh, Z_LVAL_PP(recnum), cp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_delete_record(int identifier, int record) - Marks a record to be deleted */ -PHP_FUNCTION(dbase_delete_record) -{ - zval **dbh_id, **record; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &dbh_id, &record) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(record); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - if (del_dbf_record(dbh, Z_LVAL_PP(record)) < 0) { - if (Z_LVAL_PP(record) > dbh->db_records) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "record %ld out of bounds", Z_LVAL_PP(record)); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to delete record %ld", Z_LVAL_PP(record)); - } - RETURN_FALSE; - } - - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_dbase_get_record - */ -static void php_dbase_get_record(INTERNAL_FUNCTION_PARAMETERS, int assoc) -{ - zval **dbh_id, **record; - dbhead_t *dbh; - int dbh_type; - dbfield_t *dbf, *cur_f; - char *data, *fnp, *str_value; - size_t cursize = 0; - long overflow_test; - int errno_save; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &dbh_id, &record) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(record); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - if ((data = get_dbf_record(dbh, Z_LVAL_PP(record))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to read bad record %ld", Z_LVAL_PP(record)); - RETURN_FALSE; - } - - dbf = dbh->db_fields; - - array_init(return_value); - - fnp = NULL; - for (cur_f = dbf; cur_f < &dbf[dbh->db_nfields]; cur_f++) { - /* get the value */ - str_value = (char *)emalloc(cur_f->db_flen + 1); - - if(cursize <= (unsigned)cur_f->db_flen) { - cursize = cur_f->db_flen + 1; - fnp = erealloc(fnp, cursize); - } - snprintf(str_value, cursize, cur_f->db_format, get_field_val(data, cur_f, fnp)); - - /* now convert it to the right php internal type */ - switch (cur_f->db_type) { - case 'C': - case 'D': - if (!assoc) { - add_next_index_string(return_value, str_value, 1); - } else { - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - } - break; - case 'I': /* FALLS THROUGH */ - case 'N': - if (cur_f->db_fdc == 0) { - /* Large integers in dbase can be larger than long */ - errno_save = errno; - overflow_test = strtol(str_value, NULL, 10); - if (errno == ERANGE) { - /* If the integer is too large, keep it as string */ - if (!assoc) { - add_next_index_string(return_value, str_value, 1); - } else { - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - } - } else { - if (!assoc) { - add_next_index_long(return_value, overflow_test); - } else { - add_assoc_long(return_value, cur_f->db_fname, overflow_test); - } - } - errno = errno_save; - } else { - if (!assoc) { - add_next_index_double(return_value, atof(str_value)); - } else { - add_assoc_double(return_value, cur_f->db_fname, atof(str_value)); - } - } - break; - case 'L': /* we used to FALL THROUGH, but now we check for T/Y and F/N - and insert 1 or 0, respectively. db_fdc is the number of - decimals, which we don't care about. 3/14/2001 LEW */ - if ((*str_value == 'T') || (*str_value == 'Y')) { - if (!assoc) { - add_next_index_long(return_value, strtol("1", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol("1", NULL, 10)); - } - } else { - if ((*str_value == 'F') || (*str_value == 'N')) { - if (!assoc) { - add_next_index_long(return_value, strtol("0", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol("0", NULL, 10)); - } - } else { - if (!assoc) { - add_next_index_long(return_value, strtol(" ", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol(" ", NULL, 10)); - } - } - } - break; - case 'M': - /* this is a memo field. don't know how to deal with this yet */ - break; - default: - /* should deal with this in some way */ - break; - } - efree(str_value); - } - - efree(fnp); - - /* mark whether this record was deleted */ - if (data[0] == '*') { - add_assoc_long(return_value, "deleted", 1); - } else { - add_assoc_long(return_value, "deleted", 0); - } - - free(data); -} -/* }}} */ - -/* {{{ proto array dbase_get_record(int identifier, int record) - Returns an array representing a record from the database */ -PHP_FUNCTION(dbase_get_record) -{ - php_dbase_get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* From Martin Kuba */ -/* {{{ proto array dbase_get_record_with_names(int identifier, int record) - Returns an associative array representing a record from the database */ -PHP_FUNCTION(dbase_get_record_with_names) -{ - php_dbase_get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool dbase_create(string filename, array fields) - Creates a new dBase-format database file */ -PHP_FUNCTION(dbase_create) -{ - zval **filename, **fields, **field, **value; - int fd; - dbhead_t *dbh; - - int num_fields; - dbfield_t *dbf, *cur_f; - int i, rlen, handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &filename, &fields) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) { - RETURN_FALSE; - } - - if ((fd = VCWD_OPEN_MODE(Z_STRVAL_PP(filename), O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - /* have to use regular malloc() because this gets free()d by - code in the dbase library */ - dbh = (dbhead_t *)malloc(sizeof(dbhead_t)); - dbf = (dbfield_t *)malloc(sizeof(dbfield_t) * num_fields); - if (!dbh || !dbf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate memory for header info"); - RETURN_FALSE; - } - - /* initialize the header structure */ - dbh->db_fields = dbf; - dbh->db_fd = fd; - dbh->db_dbt = DBH_TYPE_NORMAL; - strcpy(dbh->db_date, "19930818"); - dbh->db_records = 0; - dbh->db_nfields = num_fields; - dbh->db_hlen = sizeof(struct dbf_dhead) + 1 + num_fields * sizeof(struct dbf_dfield); - - rlen = 1; - /** - * Patch by greg@darkphoton.com - **/ - /* make sure that the db_format entries for all fields are set to NULL to ensure we - don't seg fault if there's an error and we need to call free_dbf_head() before all - fields have been defined. */ - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - cur_f->db_format = NULL; - } - /** - * end patch - */ - - - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - /* look up the first field */ - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to find field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - - if (Z_TYPE_PP (field) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "second parameter must be array of arrays"); - free_dbf_head(dbh); - RETURN_FALSE; - } - - /* field name */ - if (zend_hash_index_find(Z_ARRVAL_PP(field), 0, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field name as first element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_string_ex(value); - if (Z_STRLEN_PP(value) > 10 || Z_STRLEN_PP(value) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid field name '%s' (must be non-empty and less than or equal to 10 characters)", Z_STRVAL_PP(value)); - free_dbf_head(dbh); - RETURN_FALSE; - } - copy_crimp(cur_f->db_fname, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); - - /* field type */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field type as second element of list in field %d", i); - RETURN_FALSE; - } - convert_to_string_ex(value); - cur_f->db_type = toupper(*Z_STRVAL_PP(value)); - - cur_f->db_fdc = 0; - - /* verify the field length */ - switch (cur_f->db_type) { - case 'L': - cur_f->db_flen = 1; - break; - case 'M': - cur_f->db_flen = 10; - dbh->db_dbt = DBH_TYPE_MEMO; - /* should create the memo file here, probably */ - break; - case 'D': - cur_f->db_flen = 8; - break; - case 'N': - case 'C': - /* field length */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 2, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field length as third element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_flen = Z_LVAL_PP(value); - - if (cur_f->db_type == 'N') { - if (zend_hash_index_find(Z_ARRVAL_PP (field), 3, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field precision as fourth element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_fdc = Z_LVAL_PP(value); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown field type '%c'", cur_f->db_type); - } - cur_f->db_foffset = rlen; - rlen += cur_f->db_flen; - - cur_f->db_format = get_dbf_f_fmt(cur_f); - } - - dbh->db_rlen = rlen; - put_dbf_info(dbh); - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ dbase_functions[] - */ -function_entry dbase_functions[] = { - PHP_FE(dbase_open, NULL) - PHP_FE(dbase_create, NULL) - PHP_FE(dbase_close, NULL) - PHP_FE(dbase_numrecords, NULL) - PHP_FE(dbase_numfields, NULL) - PHP_FE(dbase_add_record, NULL) - PHP_FE(dbase_replace_record, NULL) - PHP_FE(dbase_get_record, NULL) - PHP_FE(dbase_get_record_with_names, NULL) - PHP_FE(dbase_delete_record, NULL) - PHP_FE(dbase_pack, NULL) - PHP_FE(dbase_get_header_info, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* Added by Zak Greant */ -/* {{{ proto array dbase_get_header_info(int database_handle) - */ -PHP_FUNCTION(dbase_get_header_info) -{ - zval **dbh_id, *row; - dbfield_t *dbf, *cur_f; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - array_init(return_value); - - dbf = dbh->db_fields; - for (cur_f = dbf; cur_f < &dbh->db_fields[dbh->db_nfields]; ++cur_f) { - MAKE_STD_ZVAL(row); - array_init(row); - - add_next_index_zval(return_value, row); - - /* field name */ - add_assoc_string(row, "name", cur_f->db_fname, 1); - - /* field type */ - switch (cur_f->db_type) { - case 'C': add_assoc_string(row, "type", "character", 1); break; - case 'D': add_assoc_string(row, "type", "date", 1); break; - case 'I': add_assoc_string(row, "type", "integer", 1); break; - case 'N': add_assoc_string(row, "type", "number", 1); break; - case 'L': add_assoc_string(row, "type", "boolean", 1); break; - case 'M': add_assoc_string(row, "type", "memo", 1); break; - default: add_assoc_string(row, "type", "unknown", 1); break; - } - - /* length of field */ - add_assoc_long(row, "length", cur_f->db_flen); - - /* number of decimals in field */ - switch (cur_f->db_type) { - case 'N': - case 'I': - add_assoc_long(row, "precision", cur_f->db_fdc); - break; - default: - add_assoc_long(row, "precision", 0); - } - - /* format for printing %s etc */ - add_assoc_string(row, "format", cur_f->db_format, 1); - - /* offset within record */ - add_assoc_long(row, "offset", cur_f->db_foffset); - } -} -/* }}} */ - -zend_module_entry dbase_module_entry = { - STANDARD_MODULE_HEADER, - "dbase", dbase_functions, PHP_MINIT(dbase), PHP_MSHUTDOWN(dbase), NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_DBASE -ZEND_GET_MODULE(dbase) - -#if defined(PHP_WIN32) && defined(THREAD_SAFE) - -/*NOTE: You should have an odbc.def file where you -export DllMain*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - return 1; -} -#endif -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbase.dsp b/ext/dbase/dbase.dsp deleted file mode 100644 index 7c75304983e69..0000000000000 --- a/ext/dbase/dbase.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dbase" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dbase - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak" CFG="dbase - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dbase - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D HAVE_DBASE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D DBASE=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbase.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dbase - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBASE=1 /D DBASE=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_dbase.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "dbase - Win32 Release_TS" -# Name "dbase - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\dbase.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\dbf.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbase.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/dbase/dbf.h b/ext/dbase/dbf.h deleted file mode 100644 index c7ee8fde714e3..0000000000000 --- a/ext/dbase/dbf.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf header structure on disk (pc dbase III) - * - * Basic info taken from: - * "File Formats for Popular PC Software" - * Jeff Walden - * (c) 1986 John Wiley & Sons, Inc. - */ - -#ifndef DBF_H_ -#define DBF_H_ - -#include -#include -#ifdef WIN32 -#include -#else -#include -#endif - -/* So we can use O_BINARY on non-Win32 systems. */ -#if !defined(O_BINARY) && !defined(WIN32) -#define O_BINARY (0) -#endif - -struct dbf_dhead { - char dbh_dbt; /* memo (dbt) file present */ - char dbh_date[3]; /* last update YY, MM, DD */ - char dbh_records[4]; /* number of records LE */ - char dbh_hlen[2]; /* header length LE */ - char dbh_rlen[2]; /* record length LE */ - char dbh_res[20]; /* padding */ -}; -#define DBH_DATE_YEAR 0 /* byte offset for year in dbh_date */ -#define DBH_DATE_MONTH 1 -#define DBH_DATE_DAY 2 - -/* - * field description on disk - */ - -#define DBF_NAMELEN 11 - -struct dbf_dfield { - char dbf_name[DBF_NAMELEN]; /* name of field */ - char dbf_type; /* type of field */ - char dbf_fda[4]; /* something for dbase III */ - char dbf_flen[2]; /* field length [and decimal if N] */ - char dbf_res[14]; /* padding */ -}; - -struct db_field { - char db_fname[DBF_NAMELEN+1]; /* 0 terminated */ - char db_type; /* type of field */ - int db_flen; /* length of field */ - int db_fdc; /* number of decimals in field */ - - char *db_format; /* format for printing %s etc */ - int db_foffset; /* offset within record */ -}; -typedef struct db_field dbfield_t; - -struct db_head { - int db_fd; - unsigned char db_dbt; /* dbt present */ - char db_date[9]; /* date of last update in db format */ - long db_records; /* number of records */ - int db_hlen; /* header length */ - int db_rlen; /* record length */ - - int db_nfields; /* number of fields */ - dbfield_t *db_fields; /* field info */ - char *db_name; /* name of dbf file */ - int db_cur_rec; /* current record */ -}; -typedef struct db_head dbhead_t; - -#define DBH_TYPE_NORMAL 0x03 -#define DBH_TYPE_MEMO 0x83 - -#define VALID_RECORD ' ' -#define DELETED_RECORD '*' - -#include "dbf_head.h" -#include "dbf_misc.h" -#include "dbf_rec.h" - -#endif /* DBF_H_ */ diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c deleted file mode 100644 index 9ec1f40d6cbda..0000000000000 --- a/ext/dbase/dbf_head.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "php.h" -#include "dbf.h" - -void free_dbf_head(dbhead_t *dbh); -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); - -/* - * get the header info from the file - * basic header info & field descriptions - */ -dbhead_t *get_dbf_head(int fd) -{ - dbhead_t *dbh; - struct dbf_dhead dbhead; - dbfield_t *dbf, *cur_f, *tdbf; - int ret, nfields, offset, gf_retval; - - if ((dbh = (dbhead_t *)malloc(sizeof(dbhead_t))) == NULL) - return NULL; - if (lseek(fd, 0, 0) < 0) - return NULL; - if ((ret = read(fd, &dbhead, sizeof(dbhead))) < 0) - return NULL; - - /* build in core info */ - dbh->db_fd = fd; - dbh->db_dbt = dbhead.dbh_dbt; - dbh->db_records = get_long(dbhead.dbh_records); - dbh->db_hlen = get_short(dbhead.dbh_hlen); - dbh->db_rlen = get_short(dbhead.dbh_rlen); - - db_set_date(dbh->db_date, dbhead.dbh_date[DBH_DATE_YEAR] + 1900, - dbhead.dbh_date[DBH_DATE_MONTH], - dbhead.dbh_date[DBH_DATE_DAY]); - - /* malloc enough memory for the maximum number of fields: - 32 * 1024 = 32K dBase5 (for Win) seems to allow that many */ - tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*1024); - - offset = 1; - nfields = 0; - gf_retval = 0; - for (cur_f = tdbf; gf_retval < 2 && nfields < 1024; cur_f++) { - gf_retval = get_dbf_field(dbh, cur_f); - - if (gf_retval < 0) { - free_dbf_head(dbh); - return NULL; - } - if (gf_retval != 2 ) { - cur_f->db_foffset = offset; - offset += cur_f->db_flen; - nfields++; - } - } - dbh->db_nfields = nfields; - - /* malloc the right amount of space for records, copy and destroy old */ - dbf = (dbfield_t *)malloc(sizeof(dbfield_t)*nfields); - memcpy(dbf, tdbf, sizeof(dbfield_t)*nfields); - free(tdbf); - - dbh->db_fields = dbf; - - return dbh; -} - -/* - * free up the header info built above - */ -void free_dbf_head(dbhead_t *dbh) -{ - dbfield_t *dbf, *cur_f; - int nfields; - - dbf = dbh->db_fields; - nfields = dbh->db_nfields; - for (cur_f = dbf; cur_f < &dbf[nfields]; cur_f++) { - if (cur_f->db_format) { - free(cur_f->db_format); - } - } - - free(dbf); - free(dbh); -} - -/* - * put out the header info - */ -int put_dbf_head(dbhead_t *dbh) -{ - int fd = dbh->db_fd; - struct dbf_dhead dbhead; - int ret; - - memset (&dbhead, 0, sizeof(dbhead)); - - /* build on disk info */ - dbhead.dbh_dbt = dbh->db_dbt; - put_long(dbhead.dbh_records, dbh->db_records); - put_short(dbhead.dbh_hlen, dbh->db_hlen); - put_short(dbhead.dbh_rlen, dbh->db_rlen); - - /* put the date spec'd into the on disk header */ - dbhead.dbh_date[DBH_DATE_YEAR] =(char)(db_date_year(dbh->db_date) - - 1900); - dbhead.dbh_date[DBH_DATE_MONTH]=(char)(db_date_month(dbh->db_date)); - dbhead.dbh_date[DBH_DATE_DAY] =(char)(db_date_day(dbh->db_date)); - - if (lseek(fd, 0, 0) < 0) - return -1; - if ((ret = write(fd, &dbhead, sizeof(dbhead))) < 0) - return -1; - return ret; -} - -/* - * get a field off the disk from the current file offset - */ -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - int ret; - - if ((ret = read(dbh->db_fd, &dbfield, sizeof(dbfield))) < 0) { - return ret; - } - - /* Check for the '0Dh' field terminator , if found return '2' - which will tell the loop we are at the end of fields */ - if (dbfield.dbf_name[0]==0x0d) { - return 2; - } - - /* build the field name */ - copy_crimp(dbf->db_fname, dbfield.dbf_name, DBF_NAMELEN); - - dbf->db_type = dbfield.dbf_type; - switch (dbf->db_type) { - case 'N': - dbf->db_flen = dbfield.dbf_flen[0]; - dbf->db_fdc = dbfield.dbf_flen[1]; - break; - default: - dbf->db_flen = get_short(dbfield.dbf_flen); - break; - } - - if ((dbf->db_format = get_dbf_f_fmt(dbf)) == NULL) { - return 1; - } - - return 0; -} - -/* - * put a field out on the disk at the current file offset - */ -int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - char *scp, *dcp; - int ret; - - memset (&dbfield, 0, sizeof(dbfield)); - - /* build the on disk field info */ - scp = dbf->db_fname; dcp = dbfield.dbf_name; - - strncpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN); - - dbfield.dbf_type = dbf->db_type; - switch (dbf->db_type) { - case 'N': - dbfield.dbf_flen[0] = dbf->db_flen; - dbfield.dbf_flen[1] = dbf->db_fdc; - break; - default: - put_short(dbfield.dbf_flen, dbf->db_flen); - } - - /* now write it out to disk */ - if ((ret = write(dbh->db_fd, &dbfield, sizeof(dbfield))) < 0) { - return ret; - } - return 1; -} - -/* - * put out all the info at the top of the file... - */ -static char end_stuff[2] = {0x0d, 0}; - -void put_dbf_info(dbhead_t *dbh) -{ - dbfield_t *dbf; - char *cp; - int fcnt; - - if ((cp = db_cur_date(NULL))) { - strncpy(dbh->db_date, cp, 8); - free(cp); - } - put_dbf_head(dbh); - dbf = dbh->db_fields; - for (fcnt = dbh->db_nfields; fcnt > 0; fcnt--, dbf++) - put_dbf_field(dbh, dbf); - write(dbh->db_fd, end_stuff, 1); -} - -char *get_dbf_f_fmt(dbfield_t *dbf) -{ - char format[100]; - - /* build the field format for printf */ - switch (dbf->db_type) { - case 'C': - sprintf(format, "%%-%ds", dbf->db_flen); - break; - case 'N': - case 'L': - case 'D': - sprintf(format, "%%%ds", dbf->db_flen); - break; - case 'M': - strcpy(format, "%s"); - break; - } - return (char *)strdup(format); -} - -dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC) -{ - int fd; - char *cp; - dbhead_t *dbh; - - cp = dp; - if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) { - cp = (char *)malloc(MAXPATHLEN); /* So where does this get free()'d? -RL */ - strncpy(cp, dp, MAXPATHLEN-5); strcat(cp, ".dbf"); - if ((fd = VCWD_OPEN(cp, o_flags)) < 0) { - free(cp); - perror("open"); - return NULL; - } - } - - if ((dbh = get_dbf_head(fd)) == 0) { - fprintf(stderr, "Unable to get header\n"); - return NULL; - } - dbh->db_name = cp; - dbh->db_cur_rec = 0; - - return dbh; -} - -void dbf_head_info(dbhead_t *dbh) -{ - int nfields; - dbfield_t *dbf, *cur_f; - - nfields = dbh->db_nfields; - printf("# fields: %d, record len: %d, total records %ld\n", - nfields, dbh->db_rlen, dbh->db_records); - dbf = dbh->db_fields; - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf("# %s, %c, %d, %d\n", cur_f->db_fname, - cur_f->db_type, cur_f->db_flen, cur_f->db_fdc); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_head.h b/ext/dbase/dbf_head.h deleted file mode 100644 index 9a17a3a91f39b..0000000000000 --- a/ext/dbase/dbf_head.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "php.h" - -extern dbhead_t *get_dbf_head(int fd); -void free_dbf_head(dbhead_t *dbh); -extern int put_dbf_head(dbhead_t *dbh); -extern int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -extern int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -void put_dbf_info(dbhead_t *dbh); -extern char *get_dbf_f_fmt(dbfield_t *dbf); -extern dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC); -void dbf_head_info(dbhead_t *dbh); diff --git a/ext/dbase/dbf_misc.c b/ext/dbase/dbf_misc.c deleted file mode 100644 index ad17bd4e3fb1b..0000000000000 --- a/ext/dbase/dbf_misc.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ -#include -#include -#include - -#include "dbf_misc.h" - -#include "php_reentrancy.h" - -/* - * routine to change little endian long to host long - */ -long get_long(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - ret += ((*source++)<<16); - ret += ((*source++)<<24); - - return ret; -} - -void put_long(char *cp, long lval) -{ - *cp++ = lval & 0xff; - *cp++ = (lval >> 8) & 0xff; - *cp++ = (lval >> 16) & 0xff; - *cp++ = (lval >> 24) & 0xff; -} - -/* - * routine to change little endian short to host short - */ -int get_short(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - - return ret; -} - -void put_short(char *cp, int sval) -{ - *cp++ = sval & 0xff; - *cp++ = (sval >> 8) & 0xff; -} - -double get_double(char *cp) -{ - double ret; - unsigned char *dp = (unsigned char *)&ret; - - dp[7] = *cp++; - dp[6] = *cp++; - dp[5] = *cp++; - dp[4] = *cp++; - dp[3] = *cp++; - dp[2] = *cp++; - dp[1] = *cp++; - dp[0] = *cp++; - - return ret; -} - -void put_double(char *cp, double fval) -{ - unsigned char *dp = (unsigned char *)&fval; - - cp[7] = *dp++; - cp[6] = *dp++; - cp[5] = *dp++; - cp[4] = *dp++; - cp[3] = *dp++; - cp[2] = *dp++; - cp[1] = *dp++; - cp[0] = *dp++; -} - -void copy_fill(char *dp, char *sp, int len) -{ - while (*sp && len > 0) { - *dp++ = *sp++; - len--; - } - while (len-- > 0) - *dp++ = ' '; -} - -void copy_crimp(char *dp, char *sp, int len) -{ - while (len-- > 0) { - *dp++ = *sp++; - } - *dp = 0; - for (dp-- ; *dp == ' '; dp--) { - *dp = 0; - } - -} - -void db_set_date(char *cp, int year, int month, int day) -{ - if (month > 12) - month = 0; - if (day > 31) - day = 0; - sprintf(cp, "%d", year); - cp[4] = month / 10 + '0'; - cp[5] = month % 10 + '0'; - cp[6] = day / 10 + '0'; - cp[7] = day % 10 + '0'; - cp[8] = 0; -} - -int db_date_year(char *cp) -{ - int year, i; - - for (year = 0, i = 0; i < 4; i++) - year = year * 10 + (cp[i] - '0'); - return year; -} - -int db_date_month(char *cp) -{ - int month, i; - - for (month = 0, i = 4; i < 6; i++) - month = month * 10 + (cp[i] - '0'); - return month; -} - -int db_date_day(char *cp) -{ - int day, i; - - for (day = 0, i = 6; i < 8; i++) - day = day * 10 + (cp[i] - '0'); - return day; -} - -#include - -char *db_cur_date(char *cp) -{ - struct tm *ctm, tmbuf; - time_t c_time; - - c_time = time((time_t *)NULL); - ctm = php_localtime_r(&c_time, &tmbuf); - if (cp == NULL) - cp = (char *)malloc(9); - - if (ctm == NULL || cp == NULL) - return NULL; - - db_set_date(cp, ctm->tm_year + 1900, ctm->tm_mon + 1, ctm->tm_mday); - - return cp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_misc.h b/ext/dbase/dbf_misc.h deleted file mode 100644 index 37fe8b0ea98ae..0000000000000 --- a/ext/dbase/dbf_misc.h +++ /dev/null @@ -1,13 +0,0 @@ -void put_long(char *cp, long lval); -extern long get_long(char *cp); -extern int get_short(char *cp); -void put_short(char *cp, int sval); -void put_double(char *cp, double fval); -extern double get_double(char *cp); -void copy_fill(char *dp, char *sp, int len); -void copy_crimp(char *dp, char *sp, int len); -void db_set_date(char *cp, int year, int month, int day); -extern int db_date_year(char *cp); -extern int db_date_month(char *cp); -extern int db_date_day(char *cp); -extern char *db_cur_date(char *cp); diff --git a/ext/dbase/dbf_ndx.c b/ext/dbase/dbf_ndx.c deleted file mode 100644 index 121a0e81e263f..0000000000000 --- a/ext/dbase/dbf_ndx.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "dbf.h" -#include "dbf_ndx.h" - -/* - * get the ndx header for this file - */ -ndx_header_t *ndx_get_header(int fd) -{ - dndx_header_t *dp; - ndx_header_t *np; - - if ((dp = (dndx_header_t *)malloc(NDX_PAGE_SZ)) == NULL) - return NULL; - if ((np = (ndx_header_t *)malloc(sizeof(ndx_header_t))) == NULL) { - free(dp); - return NULL; - } - if ((lseek(fd, 0, 0) < 0) || (read(fd, dp, NDX_PAGE_SZ) < 0)) { - free(dp); free(np); - return NULL; - } - np->ndx_hpage = dp; - np->ndx_fd = fd; - np->ndx_start_pg = get_long(dp->dndx_st_pg); - np->ndx_total_pgs = get_long(dp->dndx_tot_pg); - np->ndx_key_len = get_short(dp->dndx_key_len); - np->ndx_keys_ppg = get_short(dp->dndx_keys_ppg); - np->ndx_key_type = get_short(dp->dndx_key_type); - np->ndx_key_size = get_long(dp->dndx_size_key); - np->ndx_key_name = dp->dndx_key_name; - np->ndx_unique = dp->dndx_unique; - - np->ndx_fp = NULL; - - return np; -} - -static ndx_page_t *ndx_get_page(ndx_header_t *hp, int pageno) -{ - ndx_page_t *fp; - dndx_page_t *dp; - ndx_record_t *rp; - -#if PHP_DEBUG - printf("getting page %d", pageno); -#endif - if ((fp = (ndx_page_t *)malloc(sizeof(ndx_page_t))) == NULL) - return NULL; - if ((dp = (dndx_page_t *)malloc(NDX_PAGE_SZ)) == NULL) { - free(fp); - return NULL; - } - if ((rp = (ndx_record_t *)malloc(sizeof(ndx_record_t) * hp->ndx_keys_ppg)) == NULL) { - free(dp); free(fp); - return NULL; - } - fp->ndxp_page_data = dp; - if ((lseek(hp->ndx_fd, pageno * NDX_PAGE_SZ, 0) < 0) || - (read(hp->ndx_fd, dp, NDX_PAGE_SZ) < 0)) { - free(fp); free(dp); - return NULL; - } - fp->ndxp_parent = NULL; - fp->ndxp_page_no = pageno; - fp->ndxp_num_keys = get_long(dp->dndxp_num_keys); - memset(rp, 0, sizeof(ndx_record_t) * hp->ndx_keys_ppg); - fp->ndxp_records = rp; - fp->ndxp_header_p = hp; -#if PHP_DEBUG - printf(", n_keys %ld\n", fp->ndxp_num_keys); -#endif - return fp; -} - -/* - * get the first entry for this ndx - */ -static ndx_page_t *ndx_get_first_pg(ndx_header_t *hp) -{ - ndx_page_t *fp; - - if (hp->ndx_fp) - return hp->ndx_fp; - if ((fp = ndx_get_page(hp, hp->ndx_start_pg))) { - hp->ndx_fp = fp; - } - return fp; -} - -static ndx_record_t *ndx_get_record(ndx_page_t *fp, int rec_no) -{ - ndx_record_t *rp; - ndx_header_t *hp = fp->ndxp_header_p; - struct dndx_record *drp; - -#if PHP_DEBUG - printf("page %ld, rec %d: ", fp->ndxp_page_no, rec_no); -#endif - if (rec_no >= fp->ndxp_num_keys) - return NULL; - rp = &(fp->ndxp_records[rec_no]); - if (!rp->ndxr_page) { - rp->ndxr_page = fp; - drp = (dndx_record_t *)((char *)&fp->ndxp_page_data->dndx_rp - + rec_no * hp->ndx_key_size); - rp->ndxr_left = get_long(drp->dndx_left_pg); - rp->ndxr_rec = get_long(drp->dndx_dbf_rec); - rp->ndxr_key_data = &drp->dndx_key_data; - rp->ndxr_p_nrec = rec_no; - } -#if PHP_DEBUG - printf("left %ld, dbf_rec %ld, data '%s'\n", rp->ndxr_left, - rp->ndxr_rec, rp->ndxr_key_data); -#endif - return rp; -} - -static ndx_record_t *ndx_scan_down(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_page_t *np; - ndx_record_t *rp; - - while ((rp = ndx_get_record(fp, recno)) && (rp->ndxr_rec == 0)) { - np = ndx_get_page(hp, rp->ndxr_left); - np->ndxp_parent = fp; - np->ndxp_par_rno = recno; - fp = np; - recno = 0; - } - return rp; -} - -static ndx_record_t *ndx_scan_up(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_record_t *rp; - - if (fp == NULL) - rp = NULL; - else if (recno < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, recno); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -ndx_record_t *ndx_get_first_rec(ndx_header_t *hp) -{ - ndx_page_t *fp; - ndx_record_t *rp = NULL; - - if ((fp = ndx_get_first_pg(hp))) { - fp->ndxp_last_key = 0; - rp = ndx_scan_down(hp, fp, 0); - } - hp->ndx_cur_rec = rp; - return rp; -} - -ndx_record_t *ndx_get_next_rec(ndx_header_t *hp, ndx_record_t *rp) -{ - ndx_page_t *fp; - int rec_no; - - fp = rp->ndxr_page; - rec_no = rp->ndxr_p_nrec + 1; - if (rec_no < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, rec_no); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_ndx.h b/ext/dbase/dbf_ndx.h deleted file mode 100644 index 4bc3d29641f36..0000000000000 --- a/ext/dbase/dbf_ndx.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf .ndx header structure on disk and in memory - * - * Basic info taken from: - * "Clipper Programming Guide, 3rd Edition, Version 5.01" - * by Rick Spence - */ - -#ifndef DBF_NDX_H_ -#define DBF_NDX_H_ - -#include "dbf.h" - -#define NDX_PAGE_SZ 512 - -/* on disk ndx header */ -struct dndx_header { - char dndx_st_pg[4]; /* starting page number */ - char dndx_tot_pg[4]; /* total number of pages */ - char dndx_filler1[4]; /* space */ - char dndx_key_len[2]; /* key length */ - char dndx_keys_ppg[2]; /* number of keys per page */ - char dndx_key_type[2]; /* key type */ - char dndx_size_key[4]; /* size of the key record */ - char dndx_filler2; /* space */ - char dndx_unique; /* whether or not done with unique */ - char dndx_key_name[488]; /* string defining the key */ -}; -typedef struct dndx_header dndx_header_t; - -/* in memory ndx header */ -struct ndx_header { - long ndx_start_pg; - long ndx_total_pgs; - unsigned short ndx_key_len; - unsigned short ndx_keys_ppg; - unsigned short ndx_key_type; - char ndx_unique; - long ndx_key_size; - char *ndx_key_name; - int ndx_fd; - struct ndx_page *ndx_fp; - dndx_header_t *ndx_hpage; - struct ndx_record *ndx_cur_rec; -}; -typedef struct ndx_header ndx_header_t; - -/* these are the possible values in the key type field */ -#define NDX_CHAR_TYPE 00 -#define NDX_NUM_TYPE 01 - -/* on disk key record */ -struct dndx_record { - char dndx_left_pg[4]; /* number of left page */ - char dndx_dbf_rec[4]; /* dbf record number */ - char dndx_key_data; /* key data */ -}; -typedef struct dndx_record dndx_record_t; - -struct ndx_record { - long ndxr_left; - long ndxr_rec; - char *ndxr_key_data; - struct ndx_page *ndxr_page; /* page pointer to where we are from*/ - int ndxr_p_nrec; /* number of the record within page */ -}; -typedef struct ndx_record ndx_record_t; - -struct dndx_page { - char dndxp_num_keys[4]; /* number of keys on this page */ - struct dndx_record dndx_rp; -}; -typedef struct dndx_page dndx_page_t; - -struct ndx_page { - long ndxp_page_no; - long ndxp_num_keys; - dndx_page_t *ndxp_page_data; - ndx_header_t *ndxp_header_p; - long ndxp_last_key; - struct ndx_page *ndxp_parent; /* parent page */ - int ndxp_par_rno; /* record number within parent */ - struct ndx_record *ndxp_records; -}; -typedef struct ndx_page ndx_page_t; - -extern ndx_header_t *ndx_get_header(int); - -extern ndx_record_t *ndx_get_first_rec(ndx_header_t *); -extern ndx_record_t *ndx_get_next_rec(ndx_header_t *, ndx_record_t *); - -#endif /* DBF_NDX_H_ */ diff --git a/ext/dbase/dbf_rec.c b/ext/dbase/dbf_rec.c deleted file mode 100644 index 6e872d3fb7eec..0000000000000 --- a/ext/dbase/dbf_rec.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include "ext/standard/flock_compat.h" - -#include -#include - -#include "dbf.h" - -int get_piece(dbhead_t *dbh, long offset, char *cp, int len); -int put_piece(dbhead_t *dbh, long offset, char *cp, int len); - -/* - * get a record off the database - */ -char *get_dbf_record(dbhead_t *dbh, long rec_num) -{ - long offset; - char *cp; - - if (rec_num > dbh->db_records) { - return NULL; - } - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return NULL; - } - - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (get_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - free(cp); - cp = NULL; - } - if (cp) - dbh->db_cur_rec = rec_num; - return cp; -} - -int -get_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* read the record into the allocated space */ - return read(dbh->db_fd, cp, len); -} - -/* - * put a record to the database - */ -long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp) -{ - long offset; - - if (rec_num == 0) { - rec_num = dbh->db_records; - } - if (rec_num > dbh->db_records) { - return 0L; - } - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (put_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - rec_num = -1; - } - return rec_num; -} - -int put_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* write the record into the file */ - return write(dbh->db_fd, cp, len); -} - -int del_dbf_record(dbhead_t *dbh, long rec_num) -{ - int ret = 0; - char *cp; - - if (rec_num > dbh->db_records) - return -1; - if ((cp = get_dbf_record(dbh, rec_num))) { - *cp = DELETED_RECORD; - ret = put_dbf_record(dbh, rec_num, cp); - free(cp); - } - return ret; -} - -void pack_dbf(dbhead_t *dbh) -{ - long out_off, in_off; - int rec_cnt, new_cnt; - char *cp; - - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return; - } - in_off = out_off = dbh->db_hlen; - - new_cnt = 0; - rec_cnt = dbh->db_records; - while (rec_cnt > 0) { - if (get_piece(dbh, in_off, cp, dbh->db_rlen) < 0) - break; - - if (*cp != DELETED_RECORD) { - /* write the record into the file */ - if (put_piece(dbh, out_off, cp, dbh->db_rlen) < 0) - break; - out_off += dbh->db_rlen; - new_cnt++; - } - in_off += dbh->db_rlen; - rec_cnt--; - } - free(cp); - - /* Try to truncate the file to the right size. */ - if (ftruncate(dbh->db_fd, out_off) != 0) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbase_pack() couldn't truncate the file to the right size. Some deleted records may still be left in there."); - } - - if (rec_cnt == 0) - dbh->db_records = new_cnt; -} - -/* routine to get a field from a record */ -char *get_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - int flen = fldp->db_flen; - - if ( !cp ) - cp = (char *)malloc(flen + 1); - if ( cp ) { - strncpy(cp, &rp[fldp->db_foffset], flen); - cp[flen] = 0; - } - return cp; -} - -void put_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - strncpy(&rp[fldp->db_foffset], cp, fldp->db_flen); -} - -/* - * output a record - */ -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp) -{ - dbfield_t *cur_f; - int nfields = dbh->db_nfields; - char *fnp = (char *)malloc(dbh->db_rlen); - - printf("%c", *cp); - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf(" "); - printf(cur_f->db_format, get_field_val(cp, cur_f, fnp)); - } - printf("\n"); - free(fnp); -} - -/* check for record validity */ -int is_valid_rec(char *cp) -{ - if (cp && (*cp == VALID_RECORD)) - return 1; - else - return 0; -} - -/* get the next record */ -char *dbf_get_next(dbhead_t *dbh) -{ - return get_dbf_record(dbh, dbh->db_cur_rec + 1); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_rec.h b/ext/dbase/dbf_rec.h deleted file mode 100644 index 6407c702f6672..0000000000000 --- a/ext/dbase/dbf_rec.h +++ /dev/null @@ -1,10 +0,0 @@ -extern char *get_dbf_record(dbhead_t *dbh, long rec_num); -extern long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp); -extern int put_piece(dbhead_t *dbh, long offset, char *cp, int len); -extern int del_dbf_record(dbhead_t *dbh, long rec_num); -void pack_dbf(dbhead_t *dbh); -extern char *get_field_val(char *rp, dbfield_t *fldp, char *cp); -void put_field_val(char *rp, dbfield_t *fldp, char *cp); -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp); -extern int is_valid_rec(char *cp); -extern char *dbf_get_next(dbhead_t *dbh); diff --git a/ext/dbase/package.xml b/ext/dbase/package.xml deleted file mode 100644 index f0a30a5a2073c..0000000000000 --- a/ext/dbase/package.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - dbase - dBase database file access functions - - - jimw - Jim Winstead - jimw@php.net - lead - - - -These functions allow you to access records stored -in dBase-format (dbf) databases. - -There is no support for indexes or memo fields. -There is no support for locking, too. -Two concurrent webserver processes modifying the -same dBase file will very likely ruin your database. - -dBase files are simple sequential files of fixed length records. -Records are appended to the end of the file and delete records -are kept until you call dbase_pack(). - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/dbase/php_dbase.h b/ext/dbase/php_dbase.h deleted file mode 100644 index deca0c9343724..0000000000000 --- a/ext/dbase/php_dbase.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DBASE_H -#define PHP_DBASE_H -#if DBASE -extern zend_module_entry dbase_module_entry; -#define dbase_module_ptr &dbase_module_entry - -PHP_MINIT_FUNCTION(dbase); -PHP_FUNCTION(dbase_open); -PHP_FUNCTION(dbase_create); -PHP_FUNCTION(dbase_close); -PHP_FUNCTION(dbase_numrecords); -PHP_FUNCTION(dbase_numfields); -PHP_FUNCTION(dbase_add_record); -PHP_FUNCTION(dbase_get_record); -PHP_FUNCTION(dbase_delete_record); -PHP_FUNCTION(dbase_pack); -PHP_FUNCTION(dbase_get_record_with_names); -PHP_FUNCTION(dbase_get_header_info); -#else -#define dbase_module_ptr NULL -#endif - -#define phpext_dbase_ptr dbase_module_ptr - -#endif /* PHP_DBASE_H */ diff --git a/ext/dbase/tests/bug31754.phpt b/ext/dbase/tests/bug31754.phpt deleted file mode 100644 index 32f802b57bb5b..0000000000000 --- a/ext/dbase/tests/bug31754.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #31754: (dbase_open() fails for mode = 1) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: dbase_open(): Cannot open /tmp/bug31754.dbf in write-only mode in %sbug31754.php on line %d diff --git a/ext/dom/CREDITS b/ext/dom/CREDITS deleted file mode 100644 index b78e376d6edd9..0000000000000 --- a/ext/dom/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DOM -Christian Stocker, Rob Richards, Marcus Boerger diff --git a/ext/dom/TODO b/ext/dom/TODO deleted file mode 100644 index 52afb18216e10..0000000000000 --- a/ext/dom/TODO +++ /dev/null @@ -1,4 +0,0 @@ -For 5.1 -1) enhance XPath functionality -2) look at auto encoding support for in/output -3) What DOM object types are really needed (i.e. not currently using DOMString) diff --git a/ext/dom/attr.c b/ext/dom/attr.c deleted file mode 100644 index bf5d1b594e27e..0000000000000 --- a/ext/dom/attr.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_LIBXML && HAVE_DOM - -#include "php_dom.h" - - -/* -* class DOMAttr extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-637646024 -* Since: -*/ - -zend_function_entry php_dom_attr_class_functions[] = { - PHP_FALIAS(isId, dom_attr_is_id, NULL) - PHP_ME(domattr, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMAttr::__construct(string name, [string value]); */ -PHP_METHOD(domattr, __construct) -{ - - zval *id; - xmlAttrPtr nodep = NULL; - xmlNodePtr oldnode = NULL; - dom_object *intern; - char *name, *value = NULL; - int name_len, value_len, name_valid; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_attr_class_entry), &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - nodep = xmlNewProp(NULL, (xmlChar *) name, value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC); - } -} - -/* }}} end DOMAttr::__construct */ - - -/* {{{ name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1112119403 -Since: -*/ -int dom_attr_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlAttrPtr attrp; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (attrp->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ specified boolean -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-862529273 -Since: -*/ -int dom_attr_specified_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - /* TODO */ - ALLOC_ZVAL(*retval); - ZVAL_TRUE(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ value string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-221662474 -Since: -*/ -int dom_attr_value_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlAttrPtr attrp; - xmlChar *content; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - - if ((content = xmlNodeGetContent((xmlNodePtr) attrp)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; - -} - -int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlAttrPtr attrp; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (attrp->children) { - node_list_unlink(attrp->children TSRMLS_CC); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ ownerElement DOMElement -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement -Since: DOM Level 2 -*/ -int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep, nodeparent; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nodeparent = nodep->parent; - if (!nodeparent) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ schemaTypeInfo DOMTypeInfo -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo -Since: DOM Level 3 -*/ -int dom_attr_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ proto boolean dom_attr_is_id(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-isId -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_attr_is_id) -{ - zval *id; - dom_object *intern; - xmlAttrPtr attrp; - xmlNodePtr nodep; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(attrp, id, xmlAttrPtr, intern); - - nodep = attrp->parent; - - if (xmlIsID(attrp->doc, nodep, attrp)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_attr_is_id */ - -#endif diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c deleted file mode 100644 index d1fd90d84c30a..0000000000000 --- a/ext/dom/cdatasection.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMCdataSection extends DOMText -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-667469212 -* Since: -*/ - -zend_function_entry php_dom_cdatasection_class_functions[] = { - PHP_ME(domcdatasection, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMCdataSection::__construct(string value); */ -PHP_METHOD(domcdatasection, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_cdatasection_class_entry), &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMCdataSection::__construct */ - -#endif diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c deleted file mode 100644 index 87a9cb8b1af52..0000000000000 --- a/ext/dom/characterdata.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMCharacterData extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-FF21A306 -* Since: -*/ - -zend_function_entry php_dom_characterdata_class_functions[] = { - PHP_FALIAS(substringData, dom_characterdata_substring_data, NULL) - PHP_FALIAS(appendData, dom_characterdata_append_data, NULL) - PHP_FALIAS(insertData, dom_characterdata_insert_data, NULL) - PHP_FALIAS(deleteData, dom_characterdata_delete_data, NULL) - PHP_FALIAS(replaceData, dom_characterdata_replace_data, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ data string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-72AB8359 -Since: -*/ -int dom_characterdata_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if ((content = xmlNodeGetContent(nodep)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ length long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C -Since: -*/ -int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - long length = 0; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - content = xmlNodeGetContent(nodep); - - if (content) { - length = xmlUTF8Strlen(content); - xmlFree(content); - } - - ZVAL_LONG(*retval, length); - - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto string dom_characterdata_substring_data(int offset, int count); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6531BCCF -Since: -*/ -PHP_FUNCTION(dom_characterdata_substring_data) -{ - zval *id; - xmlChar *cur; - xmlChar *substring; - xmlNodePtr node; - long offset, count; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if ((offset + count) > length) { - count = length - offset; - } - - substring = xmlUTF8Strsub(cur, offset, count); - xmlFree(cur); - - if (substring) { - RETVAL_STRING(substring, 1); - xmlFree(substring); - } else { - RETVAL_EMPTY_STRING(); - } -} -/* }}} end dom_characterdata_substring_data */ - - -/* {{{ proto void dom_characterdata_append_data(string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-32791A2F -Since: -*/ -PHP_FUNCTION(dom_characterdata_append_data) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - char *arg; - int arg_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - xmlTextConcat(nodep, arg, arg_len); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_append_data */ - - -/* {{{ proto void dom_characterdata_insert_data(int offset, string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3EDB695F -Since: -*/ -PHP_FUNCTION(dom_characterdata_insert_data) -{ - zval *id; - xmlChar *cur, *first, *second; - xmlNodePtr node; - char *arg; - long offset; - int length, arg_len; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - first = xmlUTF8Strndup(cur, offset); - second = xmlUTF8Strsub(cur, offset, length - offset); - xmlFree(cur); - - xmlNodeSetContent(node, first); - xmlNodeAddContent(node, arg); - xmlNodeAddContent(node, second); - - xmlFree(first); - xmlFree(second); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_insert_data */ - - -/* {{{ proto void dom_characterdata_delete_data(int offset, int count); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7C603781 -Since: -*/ -PHP_FUNCTION(dom_characterdata_delete_data) -{ - zval *id; - xmlChar *cur, *substring, *second; - xmlNodePtr node; - long offset, count; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (offset > 0) { - substring = xmlUTF8Strsub(cur, 0, offset); - } else { - substring = NULL; - } - - if ((offset + count) > length) { - count = length - offset; - } - - second = xmlUTF8Strsub(cur, offset + count, length - offset); - substring = xmlStrcat(substring, second); - - xmlNodeSetContent(node, substring); - - xmlFree(cur); - xmlFree(second); - xmlFree(substring); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_delete_data */ - - -/* {{{ proto void dom_characterdata_replace_data(int offset, int count, string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-E5CBA7FB -Since: -*/ -PHP_FUNCTION(dom_characterdata_replace_data) -{ - zval *id; - xmlChar *cur, *substring, *second = NULL; - xmlNodePtr node; - char *arg; - long offset, count; - int length, arg_len; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count, &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (offset > 0) { - substring = xmlUTF8Strsub(cur, 0, offset); - } else { - substring = NULL; - } - - if ((offset + count) > length) { - count = length - offset; - } - - if (offset < length) { - second = xmlUTF8Strsub(cur, offset + count, length - offset); - } - - substring = xmlStrcat(substring, arg); - substring = xmlStrcat(substring, second); - - xmlNodeSetContent(node, substring); - - xmlFree(cur); - if (second) { - xmlFree(second); - } - xmlFree(substring); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_replace_data */ -#endif diff --git a/ext/dom/comment.c b/ext/dom/comment.c deleted file mode 100644 index 18f5b00599f3c..0000000000000 --- a/ext/dom/comment.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMComment extends DOMCharacterData -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1728279322 -* Since: -*/ - -zend_function_entry php_dom_comment_class_functions[] = { - PHP_ME(domcomment, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMComment::__construct([string value]); */ -PHP_METHOD(domcomment, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, U_CLASS_ENTRY(dom_comment_class_entry), &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewComment((xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMComment::__construct */ -#endif diff --git a/ext/dom/config.m4 b/ext/dom/config.m4 deleted file mode 100644 index 4a083e4509fbb..0000000000000 --- a/ext/dom/config.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(dom, whether to enable DOM support, -[ --disable-dom Disable new DOM support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir[=DIR] DOM: libxml2 install prefix], no, no) -fi - -if test "$PHP_DOM" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([DOM extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(DOM_SHARED_LIBADD, [ - AC_DEFINE(HAVE_DOM,1,[ ]) - PHP_NEW_EXTENSION(dom, [php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c \ - processinginstruction.c cdatasection.c \ - documentfragment.c domimplementation.c \ - element.c node.c string_extend.c characterdata.c \ - documenttype.c domimplementationlist.c entity.c \ - nodelist.c text.c comment.c domconfiguration.c \ - domimplementationsource.c entityreference.c \ - notation.c xpath.c dom_iterators.c \ - typeinfo.c domerror.c domlocator.c namednodemap.c userdatahandler.c], - $ext_shared) - PHP_SUBST(DOM_SHARED_LIBADD) - PHP_INSTALL_HEADERS([ext/dom/xml_common.h]) - PHP_ADD_EXTENSION_DEP(dom, libxml) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/dom/config.w32 b/ext/dom/config.w32 deleted file mode 100644 index 382587ff6e375..0000000000000 --- a/ext/dom/config.w32 +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("dom", "DOM support", "yes"); - -if (PHP_DOM == "yes" && PHP_LIBXML == "yes") { - EXTENSION("dom", "php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c processinginstruction.c \ - cdatasection.c documentfragment.c domimplementation.c element.c \ - node.c string_extend.c characterdata.c documenttype.c \ - domimplementationlist.c entity.c nodelist.c text.c comment.c \ - domconfiguration.c domimplementationsource.c entityreference.c \ - notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \ - domlocator.c namednodemap.c userdatahandler.c"); - AC_DEFINE("HAVE_DOM", 1, "DOM support"); - if (!PHP_DOM_SHARED) { - ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC "); - } - ADD_EXTENSION_DEP('dom', 'libxml'); -} - - diff --git a/ext/dom/document.c b/ext/dom/document.c deleted file mode 100644 index d8765e16ca0f1..0000000000000 --- a/ext/dom/document.c +++ /dev/null @@ -1,2188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include -#ifdef LIBXML_SCHEMAS_ENABLED -#include -#include -#endif - -typedef struct _idsIterator idsIterator; -struct _idsIterator { - xmlChar *elementId; - xmlNode *element; -}; - -#define DOM_LOAD_STRING 0 -#define DOM_LOAD_FILE 1 - -/* -* class DOMDocument extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document -* Since: -*/ - -zend_function_entry php_dom_document_class_functions[] = { - PHP_FALIAS(createElement, dom_document_create_element, NULL) - PHP_FALIAS(createDocumentFragment, dom_document_create_document_fragment, NULL) - PHP_FALIAS(createTextNode, dom_document_create_text_node, NULL) - PHP_FALIAS(createComment, dom_document_create_comment, NULL) - PHP_FALIAS(createCDATASection, dom_document_create_cdatasection, NULL) - PHP_FALIAS(createProcessingInstruction, dom_document_create_processing_instruction, NULL) - PHP_FALIAS(createAttribute, dom_document_create_attribute, NULL) - PHP_FALIAS(createEntityReference, dom_document_create_entity_reference, NULL) - PHP_FALIAS(getElementsByTagName, dom_document_get_elements_by_tag_name, NULL) - PHP_FALIAS(importNode, dom_document_import_node, NULL) - PHP_FALIAS(createElementNS, dom_document_create_element_ns, NULL) - PHP_FALIAS(createAttributeNS, dom_document_create_attribute_ns, NULL) - PHP_FALIAS(getElementsByTagNameNS, dom_document_get_elements_by_tag_name_ns, NULL) - PHP_FALIAS(getElementById, dom_document_get_element_by_id, NULL) - PHP_FALIAS(adoptNode, dom_document_adopt_node, NULL) - PHP_FALIAS(normalizeDocument, dom_document_normalize_document, NULL) - PHP_FALIAS(renameNode, dom_document_rename_node, NULL) - PHP_ME(domdocument, load, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(save, dom_document_save, NULL) - PHP_ME(domdocument, loadXML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(saveXML, dom_document_savexml, NULL) - PHP_ME(domdocument, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_FALIAS(validate, dom_document_validate, NULL) - PHP_FALIAS(xinclude, dom_document_xinclude, NULL) -#if defined(LIBXML_HTML_ENABLED) - PHP_ME(domdocument, loadHTML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domdocument, loadHTMLFile, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(saveHTML, dom_document_save_html, NULL) - PHP_FALIAS(saveHTMLFile, dom_document_save_html_file, NULL) -#endif /* defined(LIBXML_HTML_ENABLED) */ -#if defined(LIBXML_SCHEMAS_ENABLED) - PHP_FALIAS(schemaValidate, dom_document_schema_validate_file, NULL) - PHP_FALIAS(schemaValidateSource, dom_document_schema_validate_xml, NULL) - PHP_FALIAS(relaxNGValidate, dom_document_relaxNG_validate_file, NULL) - PHP_FALIAS(relaxNGValidateSource, dom_document_relaxNG_validate_xml, NULL) -#endif - {NULL, NULL, NULL} -}; - -/* {{{ docType DOMDocumentType -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31 -Since: -*/ -int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - xmlDtdPtr dtdptr; - int ret; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - dtdptr = xmlGetIntSubset(docp); - if (!dtdptr) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) dtdptr, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ implementation DOMImplementation -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA -Since: -*/ -int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - php_dom_create_implementation(retval TSRMLS_CC); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ documentElement DOMElement -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092 -Since: -*/ -int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - xmlNode *root; - int ret; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - root = xmlDocGetRootElement(docp); - if (!root) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object(root, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - -/* {{{ encoding string -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding -Since: DOM Level 3 -*/ -int dom_document_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *encoding; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - encoding = (char *) docp->encoding; - ALLOC_ZVAL(*retval); - - if (encoding != NULL) { - ZVAL_STRING(*retval, encoding, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - xmlCharEncodingHandlerPtr handler; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - handler = xmlFindCharEncodingHandler(Z_STRVAL_P(newval)); - - if (handler != NULL) { - xmlCharEncCloseFunc(handler); - if (docp->encoding != NULL) { - xmlFree((xmlChar *)docp->encoding); - } - docp->encoding = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document Encoding"); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ standalone boolean -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone -Since: DOM Level 3 -*/ -int dom_document_standalone_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - int standalone; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - standalone = docp->standalone; - ZVAL_BOOL(*retval, standalone); - - return SUCCESS; -} - -int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - int standalone; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_long(newval); - - standalone = Z_LVAL_P(newval); - if (standalone > 0) { - docp->standalone = 1; - } - else if (standalone < 0) { - docp->standalone = -1; - } - else { - docp->standalone = 0; - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ version string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version -Since: DOM Level 3 -*/ -int dom_document_version_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *version; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - version = (char *) docp->version; - ALLOC_ZVAL(*retval); - - if (version != NULL) { - ZVAL_STRING(*retval, version, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (docp->version != NULL) { - xmlFree((xmlChar *) docp->version ); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - docp->version = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ strictErrorChecking boolean -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking -Since: DOM Level 3 -*/ -int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->stricterror); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->stricterror = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ formatOutput boolean -readonly=no -*/ -int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->formatoutput); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->formatoutput = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ validateOnParse boolean -readonly=no -*/ -int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->validateonparse); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->validateonparse = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ resolveExternals boolean -readonly=no -*/ -int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->resolveexternals); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->resolveexternals = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ preserveWhiteSpace boolean -readonly=no -*/ -int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->preservewhitespace); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->preservewhitespace = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ recover boolean -readonly=no -*/ -int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->recover); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->recover = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ substituteEntities boolean -readonly=no -*/ -int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_props *doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->substituteentities); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_props *doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->substituteentities = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ documentURI string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI -Since: DOM Level 3 -*/ -int dom_document_document_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *url; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - url = (char *) docp->URL; - if (url != NULL) { - ZVAL_STRING(*retval, url, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (docp->URL != NULL) { - xmlFree((xmlChar *) docp->URL); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - docp->URL = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ config DOMConfiguration -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config -Since: DOM Level 3 -*/ -int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547 -Since: -*/ -PHP_FUNCTION(dom_document_create_element) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - dom_object *intern; - int ret, name_len, value_len; - char *name, *value = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewDocNode(docp, NULL, name, value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_element */ - - -/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5 -Since: -*/ -PHP_FUNCTION(dom_document_create_document_fragment) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - dom_object *intern; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocFragment(docp); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_document_fragment */ - - -/* {{{ proto DOMText dom_document_create_text_node(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127 -Since: -*/ -PHP_FUNCTION(dom_document_create_text_node) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocText(docp, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_text_node */ - - -/* {{{ proto DOMComment dom_document_create_comment(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328 -Since: -*/ -PHP_FUNCTION(dom_document_create_comment) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocComment(docp, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_comment */ - - -/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8 -Since: -*/ -PHP_FUNCTION(dom_document_create_cdatasection) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewCDataBlock(docp, (xmlChar *) value, value_len); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_cdatasection */ - - -/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439 -Since: -*/ -PHP_FUNCTION(dom_document_create_processing_instruction) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len, name_len = 0; - dom_object *intern; - char *name, *value = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewPI((xmlChar *) name, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - node->doc = docp; - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_processing_instruction */ - - -/* {{{ proto DOMAttr dom_document_create_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198 -Since: -*/ -PHP_FUNCTION(dom_document_create_attribute) -{ - zval *id, *rv = NULL; - xmlAttrPtr node; - xmlDocPtr docp; - int ret, name_len; - dom_object *intern; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewDocProp(docp, (xmlChar *) name, NULL); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern); - -} -/* }}} end dom_document_create_attribute */ - - -/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE -Since: -*/ -PHP_FUNCTION(dom_document_create_entity_reference) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp = NULL; - dom_object *intern; - int ret, name_len; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewReference(docp, name); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern); -} -/* }}} end dom_document_create_entity_reference */ - - -/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094 -Since: -*/ -PHP_FUNCTION(dom_document_get_elements_by_tag_name) -{ - zval *id; - xmlDocPtr docp; - int name_len; - dom_object *intern, *namednode; - char *name; - xmlChar *local; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC); -} -/* }}} end dom_document_get_elements_by_tag_name */ - - -/* {{{ proto DOMNode dom_document_import_node(DOMNode importedNode, boolean deep); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Core-Document-importNode -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_import_node) -{ - zval *rv = NULL; - zval *id, *node; - xmlDocPtr docp; - xmlNodePtr nodep, retnodep; - dom_object *intern, *nodeobj; - int ret; - long recursive = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry), &recursive) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj); - - if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE - || nodep->type == XML_DOCUMENT_TYPE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported"); - RETURN_FALSE; - } - - if (nodep->doc == docp) { - retnodep = nodep; - } else { - retnodep = xmlDocCopyNode(nodep, docp, recursive); - if (!retnodep) { - RETURN_FALSE; - } - - } - - DOM_RET_OBJ(rv, (xmlNodePtr) retnodep, &ret, intern); -} -/* }}} end dom_document_import_node */ - - -/* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName [,string value]); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_create_element_ns) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlNodePtr nodep = NULL; - xmlNsPtr nsptr = NULL; - int ret, uri_len = 0, name_len = 0, value_len = 0; - char *uri, *name, *value = NULL; - char *localname = NULL, *prefix = NULL; - int errorcode; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - - if (errorcode == 0) { - if (xmlValidateName((xmlChar *) localname, 0) == 0) { - nodep = xmlNewDocNode (docp, NULL, localname, value); - if (nodep != NULL && uri != NULL) { - nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri); - if (nsptr == NULL) { - nsptr = dom_get_ns(nodep, uri, &errorcode, prefix); - } - xmlSetNs(nodep, nsptr); - } - } else { - errorcode = INVALID_CHARACTER_ERR; - } - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (nodep != NULL) { - xmlFreeNode(nodep); - } - php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (nodep == NULL) { - RETURN_FALSE; - } - - - nodep->ns = nsptr; - - DOM_RET_OBJ(rv, nodep, &ret, intern); -} -/* }}} end dom_document_create_element_ns */ - - -/* {{{ proto DOMAttr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_create_attribute_ns) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlNodePtr nodep = NULL, root; - xmlNsPtr nsptr; - int ret, uri_len = 0, name_len = 0; - char *uri, *name; - char *localname = NULL, *prefix = NULL; - dom_object *intern; - int errorcode; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - root = xmlDocGetRootElement(docp); - if (root != NULL) { - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - if (errorcode == 0) { - if (xmlValidateName((xmlChar *) localname, 0) == 0) { - nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL); - if (nodep != NULL && uri_len > 0) { - nsptr = xmlSearchNsByHref (nodep->doc, root, uri); - if (nsptr == NULL) { - nsptr = dom_get_ns(root, uri, &errorcode, prefix); - } - xmlSetNs(nodep, nsptr); - } - } else { - errorcode = INVALID_CHARACTER_ERR; - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Missing Root Element"); - RETURN_FALSE; - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (nodep != NULL) { - xmlFreeProp((xmlAttrPtr) nodep); - } - php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (nodep == NULL) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, nodep, &ret, intern); -} -/* }}} end dom_document_create_attribute_ns */ - - -/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBTNNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns) -{ - zval *id; - xmlDocPtr docp; - int uri_len, name_len; - dom_object *intern, *namednode; - char *uri, *name; - xmlChar *local, *nsuri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - nsuri = xmlCharStrndup(uri, uri_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC); -} -/* }}} end dom_document_get_elements_by_tag_name_ns */ - - -/* {{{ proto DOMElement dom_document_get_element_by_id(string elementId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBId -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_get_element_by_id) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlAttrPtr attrp; - int ret, idname_len; - dom_object *intern; - char *idname; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &idname, &idname_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - attrp = xmlGetID(docp, (xmlChar *) idname); - - if (attrp && attrp->parent) { - DOM_RET_OBJ(rv, (xmlNodePtr) attrp->parent, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_document_get_element_by_id */ - - -/* {{{ proto DOMNode dom_document_adopt_node(DOMNode source); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-adoptNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_adopt_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_document_adopt_node */ - - -/* {{{ proto void dom_document_normalize_document(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-normalizeDocument -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_normalize_document) -{ - zval *id; - xmlDocPtr docp; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - dom_normalize((xmlNodePtr) docp TSRMLS_CC); -} -/* }}} end dom_document_normalize_document */ - - -/* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_rename_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_document_rename_node */ - -/* {{{ proto void DOMDocument::__construct([string version], [string encoding]); */ -PHP_METHOD(domdocument, __construct) -{ - - zval *id; - xmlDoc *docp = NULL, *olddoc; - dom_object *intern; - char *encoding, *version = NULL; - int encoding_len = 0, version_len = 0, refcount; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, U_CLASS_ENTRY(dom_document_class_entry), &version, &version_len, &encoding, &encoding_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - docp = xmlNewDoc(version); - - if (!docp) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (encoding_len > 0) { - docp->encoding = (const xmlChar*)xmlStrdup(encoding); - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - olddoc = (xmlDocPtr) dom_object_get_node(intern); - if (olddoc != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - olddoc->_private = NULL; - } - } - intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMDocument::__construct */ - -char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr(source, ":"); - xmlParseURIReference(uri, escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */ - if (! VCWD_REALPATH(source, resolved_path)) { - expand_filepath(source, resolved_path TSRMLS_CC); - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} - - -/* {{{ */ -static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt = NULL; - dom_doc_props *doc_props; - dom_object *intern; - php_libxml_ref_obj *document = NULL; - int validate, recover, resolve_externals, keep_blanks, substitute_ent; - int resolved_path_len; - int old_error_reporting; - char *directory=NULL, resolved_path[MAXPATHLEN]; - - if (id != NULL) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - document = intern->document; - } - - doc_props = dom_get_doc_props(document); - validate = doc_props->validateonparse; - resolve_externals = doc_props->resolveexternals; - keep_blanks = doc_props->preservewhitespace; - substitute_ent = doc_props->substituteentities; - recover = doc_props->recover; - - if (document == NULL) { - efree(doc_props); - } - - xmlInitParser(); - -#if LIBXML_VERSION < 20600 - keep_blanks = xmlKeepBlanksDefault(keep_blanks); -#endif - - if (mode == DOM_LOAD_FILE) { - char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (file_dest) { - ctxt = xmlCreateFileParserCtxt(file_dest); - } - - } else { - ctxt = xmlCreateDocParserCtxt(source); - } - -#if LIBXML_VERSION < 20600 - xmlKeepBlanksDefault(keep_blanks); - /* xmlIndentTreeOutput default is changed in xmlKeepBlanksDefault - reset back to 1 which is default value */ - - xmlIndentTreeOutput = 1; -#endif - - if (ctxt == NULL) { - return(NULL); - } - - /* If loading from memory, we need to set the base directory for the document */ - if (mode != DOM_LOAD_FILE) { -#if HAVE_GETCWD - directory = VCWD_GETCWD(resolved_path, MAXPATHLEN); -#elif HAVE_GETWD - directory = VCWD_GETWD(resolved_path); -#endif - if (directory) { - if(ctxt->directory != NULL) { - xmlFree((char *) ctxt->directory); - } - resolved_path_len = strlen(resolved_path); - if (resolved_path[resolved_path_len - 1] != DEFAULT_SLASH) { - resolved_path[resolved_path_len] = DEFAULT_SLASH; - resolved_path[++resolved_path_len] = '\0'; - } - ctxt->directory = (char *) xmlCanonicPath((const xmlChar *) resolved_path); - } - } - - ctxt->vctxt.error = php_libxml_ctx_error; - ctxt->vctxt.warning = php_libxml_ctx_warning; - - if (ctxt->sax != NULL) { - ctxt->sax->error = php_libxml_ctx_error; - ctxt->sax->warning = php_libxml_ctx_warning; - } - -#if LIBXML_VERSION >= 20600 - if (validate && ! (options & XML_PARSE_DTDVALID)) { - options |= XML_PARSE_DTDVALID; - } - if (resolve_externals && ! (options & XML_PARSE_DTDATTR)) { - options |= XML_PARSE_DTDATTR; - } - if (substitute_ent && ! (options & XML_PARSE_NOENT)) { - options |= XML_PARSE_NOENT; - } - if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) { - options |= XML_PARSE_NOBLANKS; - } - - xmlCtxtUseOptions(ctxt, options); -#else - ctxt->validate = validate; - ctxt->loadsubset = (resolve_externals * XML_COMPLETE_ATTRS); - ctxt->replaceEntities = substitute_ent; -#endif - - ctxt->recovery = recover; - if (recover) { - old_error_reporting = EG(error_reporting); - EG(error_reporting) = old_error_reporting | E_WARNING; - } - - xmlParseDocument(ctxt); - - if (ctxt->wellFormed || recover) { - ret = ctxt->myDoc; - if (ctxt->recovery) { - EG(error_reporting) = old_error_reporting; - } - /* If loading from memory, set the base reference uri for the document */ - if (ret->URL == NULL && ctxt->directory != NULL) { - ret->URL = xmlStrdup(ctxt->directory); - } - } else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - - xmlFreeParserCtxt(ctxt); - - return(ret); -} -/* }}} */ - -/* {{{ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) */ -static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { - zval *id, *rv = NULL; - xmlDoc *docp = NULL, *newdoc; - dom_doc_props *doc_prop; - dom_object *intern; - char *source; - int source_len, refcount, ret; - long options = 0; - - id = getThis(); - if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), U_CLASS_ENTRY(dom_document_class_entry) TSRMLS_CC)) { - id = NULL; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) { - return; - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - newdoc = dom_document_parser(id, mode, source, options TSRMLS_CC); - - if (!newdoc) - RETURN_FALSE; - - if (id != NULL) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC); - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC); - - RETURN_TRUE; - } else { - DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL); - } -} -/* }}} end dom_parser_document */ - -/* {{{ proto DOMNode dom_document_load(string source [, int options]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-load -Since: DOM Level 3 -*/ -PHP_METHOD(domdocument, load) -{ - dom_parse_document(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_load */ - -/* {{{ proto DOMNode dom_document_loadxml(string source [, int options]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-loadXML -Since: DOM Level 3 -*/ -PHP_METHOD(domdocument, loadXML) -{ - dom_parse_document(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_loadxml */ - -/* {{{ proto int dom_document_save(string file); -Convenience method to save to file -*/ -PHP_FUNCTION(dom_document_save) -{ - zval *id; - xmlDoc *docp; - int file_len = 0, bytes, format, saveempty; - dom_object *intern; - dom_doc_props *doc_props; - char *file; - long options = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &file, &file_len, &options) == FAILURE) { - return; - } - - if (file_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - /* encoding handled by property on doc */ - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - bytes = xmlSaveFormatFileEnc(file, docp, NULL, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - if (bytes == -1) { - RETURN_FALSE; - } - RETURN_LONG(bytes); -} -/* }}} end dom_document_save */ - -/* {{{ proto string dom_document_savexml([node n]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-saveXML -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_savexml) -{ - zval *id, *nodep = NULL; - xmlDoc *docp; - xmlNode *node; - xmlBufferPtr buf; - xmlChar *mem; - dom_object *intern, *nodeobj; - dom_doc_props *doc_props; - int size, format, saveempty; - long options = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, U_CLASS_ENTRY(dom_document_class_entry), &nodep, U_CLASS_ENTRY(dom_node_class_entry), &options) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - - if (nodep != NULL) { - /* Dump contents of Node */ - DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj); - if (node->doc != docp) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - buf = xmlBufferCreate(); - if (!buf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer"); - RETURN_FALSE; - } - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - xmlNodeDump(buf, docp, node, 0, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - mem = (xmlChar*) xmlBufferContent(buf); - if (!mem) { - xmlBufferFree(buf); - RETURN_FALSE; - } - RETVAL_STRING(mem, 1); - xmlBufferFree(buf); - } else { - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - /* Encoding is handled from the encoding property set on the document */ - xmlDocDumpFormatMemory(docp, &mem, &size, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - if (!size) { - RETURN_FALSE; - } - RETVAL_STRINGL(mem, size, 1); - xmlFree(mem); - } -} -/* }}} end dom_document_savexml */ - -static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) { - xmlNodePtr xincnode; - - xincnode = cur; - cur = cur->next; - xmlUnlinkNode(xincnode); - php_libxml_node_free_resource(xincnode TSRMLS_CC); - - return cur; -} - -static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) { - while(cur) { - if (cur->type == XML_XINCLUDE_START) { - cur = php_dom_free_xinclude_node(cur TSRMLS_CC); - - /* XML_XINCLUDE_END node will be a sibling of XML_XINCLUDE_START */ - while(cur && cur->type != XML_XINCLUDE_END) { - cur = cur->next; - } - - if (cur && cur->type == XML_XINCLUDE_END) { - cur = php_dom_free_xinclude_node(cur TSRMLS_CC); - } - } else { - if (cur->type == XML_ELEMENT_NODE) { - php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC); - } - cur = cur->next; - } - } -} - -/* {{{ proto int dom_document_xinclude([int options]) - Substitutues xincludes in a DomDocument */ -PHP_FUNCTION(dom_document_xinclude) -{ - zval *id; - xmlDoc *docp; - xmlNodePtr root; - long flags = 0; - int err; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &flags) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - -#if LIBXML_VERSION >= 20607 - err = xmlXIncludeProcessFlags(docp, flags); -#else - err = xmlXIncludeProcess (docp); -#endif - - /* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these - are added via xmlXIncludeProcess to mark beginning and ending of xincluded document - but are not wanted in resulting document - must be done even if err as it could fail after - having processed some xincludes */ - root = (xmlNodePtr) docp->children; - while(root && root->type != XML_ELEMENT_NODE && root->type != XML_XINCLUDE_START) { - root = root->next; - } - if (root) { - php_dom_remove_xinclude_nodes(root TSRMLS_CC); - } - - if (err) { - RETVAL_LONG(err); - } else { - RETVAL_FALSE; - } - -} - - -/* {{{ proto boolean dom_document_validate(); -Since: DOM extended -*/ -PHP_FUNCTION(dom_document_validate) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - xmlValidCtxt *cvp; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (docp->intSubset == NULL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No DTD given in XML-Document"); - } - - cvp = xmlNewValidCtxt(); - - cvp->userData = NULL; - cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler; - cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler; - - if (xmlValidateDocument(cvp, docp)) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } - - xmlFreeValidCtxt(cvp); - -} - - -#if defined(LIBXML_SCHEMAS_ENABLED) -static void -_dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - char *source = NULL, *valid_file = NULL; - int source_len = 0; - xmlSchemaParserCtxtPtr parser; - xmlSchemaPtr sptr; - xmlSchemaValidCtxtPtr vptr; - int is_valid; - char resolved_path[MAXPATHLEN + 1]; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &source, &source_len) == FAILURE) { - return; - } - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - switch (type) { - case DOM_LOAD_FILE: - valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source"); - RETURN_FALSE; - } - parser = xmlSchemaNewParserCtxt(valid_file); - break; - case DOM_LOAD_STRING: - parser = xmlSchemaNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return; - } - - xmlSchemaSetParserErrors(parser, - (xmlSchemaValidityErrorFunc) php_libxml_error_handler, - (xmlSchemaValidityWarningFunc) php_libxml_error_handler, - parser); - sptr = xmlSchemaParse(parser); - xmlSchemaFreeParserCtxt(parser); - if (!sptr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) dom_object_get_node(intern); - - vptr = xmlSchemaNewValidCtxt(sptr); - if (!vptr) { - xmlSchemaFree(sptr); - php_error(E_ERROR, "Invalid Schema Validation Context"); - RETURN_FALSE; - } - - xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); - is_valid = xmlSchemaValidateDoc(vptr, docp); - xmlSchemaFree(sptr); - xmlSchemaFreeValidCtxt(vptr); - - if (is_valid == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - -/* {{{ proto boolean dom_document_schema_validate_file(string filename); */ -PHP_FUNCTION(dom_document_schema_validate_file) -{ - _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_schema_validate_file */ - -/* {{{ proto boolean dom_document_schema_validate(string source); */ -PHP_FUNCTION(dom_document_schema_validate_xml) -{ - _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_schema_validate */ - - -static void -_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - char *source = NULL, *valid_file = NULL; - int source_len = 0; - xmlRelaxNGParserCtxtPtr parser; - xmlRelaxNGPtr sptr; - xmlRelaxNGValidCtxtPtr vptr; - int is_valid; - char resolved_path[MAXPATHLEN + 1]; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &source, &source_len) == FAILURE) { - return; - } - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - switch (type) { - case DOM_LOAD_FILE: - valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source"); - RETURN_FALSE; - } - parser = xmlRelaxNGNewParserCtxt(valid_file); - break; - case DOM_LOAD_STRING: - parser = xmlRelaxNGNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return; - } - - xmlRelaxNGSetParserErrors(parser, - (xmlRelaxNGValidityErrorFunc) php_libxml_error_handler, - (xmlRelaxNGValidityWarningFunc) php_libxml_error_handler, - parser); - sptr = xmlRelaxNGParse(parser); - xmlRelaxNGFreeParserCtxt(parser); - if (!sptr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) dom_object_get_node(intern); - - vptr = xmlRelaxNGNewValidCtxt(sptr); - if (!vptr) { - xmlRelaxNGFree(sptr); - php_error(E_ERROR, "Invalid RelaxNG Validation Context"); - RETURN_FALSE; - } - - xmlRelaxNGSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); - is_valid = xmlRelaxNGValidateDoc(vptr, docp); - xmlRelaxNGFree(sptr); - xmlRelaxNGFreeValidCtxt(vptr); - - if (is_valid == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - -/* {{{ proto boolean dom_document_relaxNG_validate_file(string filename); */ -PHP_FUNCTION(dom_document_relaxNG_validate_file) -{ - _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_relaxNG_validate_file */ - -/* {{{ proto boolean dom_document_relaxNG_validate_xml(string source); */ -PHP_FUNCTION(dom_document_relaxNG_validate_xml) -{ - _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_relaxNG_validate_xml */ - -#endif - -#if defined(LIBXML_HTML_ENABLED) - -static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval *id, *rv = NULL; - xmlDoc *docp = NULL, *newdoc; - dom_object *intern; - dom_doc_props *doc_prop; - char *source; - int source_len, refcount, ret; - htmlParserCtxtPtr ctxt; - - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) { - return; - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - if (mode == DOM_LOAD_FILE) { - ctxt = htmlCreateFileParserCtxt(source, NULL); - } else { - source_len = xmlStrlen(source); - ctxt = htmlCreateMemoryParserCtxt(source, source_len); - } - - if (!ctxt) { - RETURN_FALSE; - } - - ctxt->vctxt.error = php_libxml_ctx_error; - ctxt->vctxt.warning = php_libxml_ctx_warning; - if (ctxt->sax != NULL) { - ctxt->sax->error = php_libxml_ctx_error; - ctxt->sax->warning = php_libxml_ctx_warning; - } - htmlParseDocument(ctxt); - newdoc = ctxt->myDoc; - htmlFreeParserCtxt(ctxt); - - if (!newdoc) - RETURN_FALSE; - - if (id != NULL && instanceof_function(Z_OBJCE_P(id), U_CLASS_ENTRY(dom_document_class_entry) TSRMLS_CC)) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC); - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC); - - RETURN_TRUE; - } else { - DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL); - } -} - -/* {{{ proto DOMNode dom_document_load_html_file(string source); -Since: DOM extended -*/ -PHP_METHOD(domdocument, loadHTMLFile) -{ - dom_load_html(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_load_html_file */ - -/* {{{ proto DOMNode dom_document_load_html(string source); -Since: DOM extended -*/ -PHP_METHOD(domdocument, loadHTML) -{ - dom_load_html(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_load_html */ - -/* {{{ proto int dom_document_save_html_file(string file); -Convenience method to save to file as html -*/ -PHP_FUNCTION(dom_document_save_html_file) -{ - zval *id; - xmlDoc *docp; - int file_len, bytes, format; - dom_object *intern; - dom_doc_props *doc_props; - char *file; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &file, &file_len) == FAILURE) { - return; - } - - if (file_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - /* encoding handled by property on doc */ - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - bytes = htmlSaveFileFormat(file, docp, NULL, format); - - if (bytes == -1) { - RETURN_FALSE; - } - RETURN_LONG(bytes); -} -/* }}} end dom_document_save_html_file */ - -/* {{{ proto string dom_document_save_html(); -Convenience method to output as html -*/ -PHP_FUNCTION(dom_document_save_html) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - xmlChar *mem; - int size; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - htmlDocDumpMemory(docp, &mem, &size); - if (!size) { - if (mem) - xmlFree(mem); - RETURN_FALSE; - } - RETVAL_STRINGL(mem, size, 1); - xmlFree(mem); -} -/* }}} end dom_document_save_html */ - -#endif /* defined(LIBXML_HTML_ENABLED) */ - -#endif /* HAVE_LIBXML && HAVE_DOM */ diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c deleted file mode 100644 index 5e8dabe46170a..0000000000000 --- a/ext/dom/documentfragment.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMDocumentFragment extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-B63ED1A3 -* Since: -*/ - -zend_function_entry php_dom_documentfragment_class_functions[] = { - PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(domdocumentfragment, appendXML, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMDocumentFragment::__construct(); */ -PHP_METHOD(domdocumentfragment, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewDocFragment(NULL); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - /* php_dom_set_object(intern, nodep TSRMLS_CC); */ - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMDocumentFragment::__construct */ - -/* php_dom_xmlSetTreeDoc is a custom implementation of xmlSetTreeDoc - needed for hack in appendXML due to libxml bug - no need to share this function */ -static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) { - xmlAttrPtr prop; - xmlNodePtr cur; - - if (tree) { - if(tree->type == XML_ELEMENT_NODE) { - prop = tree->properties; - while (prop != NULL) { - prop->doc = doc; - if (prop->children) { - cur = prop->children; - while (cur != NULL) { - php_dom_xmlSetTreeDoc(cur, doc); - cur = cur->next; - } - } - prop = prop->next; - } - } - if (tree->children != NULL) { - cur = tree->children; - while (cur != NULL) { - php_dom_xmlSetTreeDoc(cur, doc); - cur = cur->next; - } - } - tree->doc = doc; - } -} - -/* {{{ proto void DOMDocumentFragment::appendXML(string data); */ -PHP_METHOD(domdocumentfragment, appendXML) { - zval *id; - xmlNode *nodep; - dom_object *intern; - char *data = NULL; - int data_len = 0; - int err; - xmlNodePtr lst; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (data) { - err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst); - if (err != 0) { - RETURN_FALSE; - } - /* Following needed due to bug in libxml2 <= 2.6.14 - ifdef after next libxml release as bug is fixed in their cvs */ - php_dom_xmlSetTreeDoc(lst, nodep->doc); - /* End stupid hack */ - - xmlAddChildList(nodep,lst); - } - - RETURN_TRUE; -} - -#endif diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c deleted file mode 100644 index 0ff0329e5f4f9..0000000000000 --- a/ext/dom/documenttype.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* -* class DOMDocumentType extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-412266927 -* Since: -*/ - -zend_function_entry php_dom_documenttype_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134 -Since: -*/ -int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (dtdptr->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ entities DOMNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630 -Since: -*/ -int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr doctypep; - xmlHashTable *entityht; - dom_object *intern; - - doctypep = (xmlDtdPtr) dom_object_get_node(obj); - - if (doctypep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - MAKE_STD_ZVAL(*retval); - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - - entityht = (xmlHashTable *) doctypep->entities; - - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL TSRMLS_CC); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ notations DOMNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF -Since: -*/ -int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr doctypep; - xmlHashTable *notationht; - dom_object *intern; - - doctypep = (xmlDtdPtr) dom_object_get_node(obj); - - if (doctypep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - MAKE_STD_ZVAL(*retval); - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - - notationht = (xmlHashTable *) doctypep->notations; - - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL TSRMLS_CC); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId -Since: DOM Level 2 -*/ -int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (dtdptr->ExternalID) { - ZVAL_STRING(*retval, (char *) (dtdptr->ExternalID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId -Since: DOM Level 2 -*/ -int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (dtdptr->SystemID) { - ZVAL_STRING(*retval, (char *) (dtdptr->SystemID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ internalSubset string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset -Since: DOM Level 2 -*/ -int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - - xmlDtdPtr dtdptr; - xmlDtd *intsubset; - xmlOutputBuffer *buff = NULL; - xmlChar *strintsubset; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) { - buff = xmlAllocOutputBuffer(NULL); - if (buff != NULL) { - xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); - xmlOutputBufferFlush(buff); - strintsubset = xmlStrndup(buff->buffer->content, buff->buffer->use); - (void)xmlOutputBufferClose(buff); - ZVAL_STRING(*retval, (char *) strintsubset, 1); - return SUCCESS; - } - } - - ZVAL_EMPTY_STRING(*retval); - - return SUCCESS; - -} - -/* }}} */ - -#endif diff --git a/ext/dom/dom.dsp b/ext/dom/dom.dsp deleted file mode 100644 index f2ae5b1a76759..0000000000000 --- a/ext/dom/dom.dsp +++ /dev/null @@ -1,250 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dom" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dom - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dom.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dom.mak" CFG="dom - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dom - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dom - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dom - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D "LIBXML_THREAD_ENABLED" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 wsock32.lib php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"..\..\Release_TS/php_dom.dll" /implib:"..\..\Release_TS/php_dom.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dom - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D LIBXML_THREAD_ENABLED=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ws2_32.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS\php_dom.dll" /implib:"..\..\Debug_TS/php_dom.lib" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "dom - Win32 Release_TS" -# Name "dom - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\attr.c -# End Source File -# Begin Source File - -SOURCE=.\cdatasection.c -# End Source File -# Begin Source File - -SOURCE=.\characterdata.c -# End Source File -# Begin Source File - -SOURCE=.\comment.c -# End Source File -# Begin Source File - -SOURCE=.\document.c -# End Source File -# Begin Source File - -SOURCE=.\documentfragment.c -# End Source File -# Begin Source File - -SOURCE=.\documenttype.c -# End Source File -# Begin Source File - -SOURCE=.\domconfiguration.c -# End Source File -# Begin Source File - -SOURCE=.\domerror.c -# End Source File -# Begin Source File - -SOURCE=.\domerrorhandler.c -# End Source File -# Begin Source File - -SOURCE=.\domexception.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementation.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementationlist.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementationsource.c -# End Source File -# Begin Source File - -SOURCE=.\domlocator.c -# End Source File -# Begin Source File - -SOURCE=.\domstringlist.c -# End Source File -# Begin Source File - -SOURCE=.\element.c -# End Source File -# Begin Source File - -SOURCE=.\entity.c -# End Source File -# Begin Source File - -SOURCE=.\entityreference.c -# End Source File -# Begin Source File - -SOURCE=.\namednodemap.c -# End Source File -# Begin Source File - -SOURCE=.\namelist.c -# End Source File -# Begin Source File - -SOURCE=.\node.c -# End Source File -# Begin Source File - -SOURCE=.\nodelist.c -# End Source File -# Begin Source File - -SOURCE=.\notation.c -# End Source File -# Begin Source File - -SOURCE=.\php_dom.c -# End Source File -# Begin Source File - -SOURCE=.\processinginstruction.c -# End Source File -# Begin Source File - -SOURCE=.\string_extend.c -# End Source File -# Begin Source File - -SOURCE=.\text.c -# End Source File -# Begin Source File - -SOURCE=.\typeinfo.c -# End Source File -# Begin Source File - -SOURCE=.\userdatahandler.c -# End Source File -# Begin Source File - -SOURCE=.\xpath.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\dom_ce.h -# End Source File -# Begin Source File - -SOURCE=.\dom_fe.h -# End Source File -# Begin Source File - -SOURCE=.\dom_properties.h -# End Source File -# Begin Source File - -SOURCE=.\php_dom.h -# End Source File -# Begin Source File - -SOURCE=.\xml_common.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h deleted file mode 100644 index 586ef2b5df50e..0000000000000 --- a/ext/dom/dom_ce.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_CE_H -#define DOM_CE_H - -extern zend_class_entry *dom_domexception_class_entry; -extern zend_class_entry *dom_domstringlist_class_entry; -extern zend_class_entry *dom_namelist_class_entry; -extern zend_class_entry *dom_domimplementationlist_class_entry; -extern zend_class_entry *dom_domimplementationsource_class_entry; -extern zend_class_entry *dom_domimplementation_class_entry; -extern zend_class_entry *dom_documentfragment_class_entry; -extern zend_class_entry *dom_document_class_entry; -extern zend_class_entry *dom_nodelist_class_entry; -extern zend_class_entry *dom_namednodemap_class_entry; -extern zend_class_entry *dom_characterdata_class_entry; -extern zend_class_entry *dom_attr_class_entry; -extern zend_class_entry *dom_element_class_entry; -extern zend_class_entry *dom_text_class_entry; -extern zend_class_entry *dom_comment_class_entry; -extern zend_class_entry *dom_typeinfo_class_entry; -extern zend_class_entry *dom_userdatahandler_class_entry; -extern zend_class_entry *dom_domerror_class_entry; -extern zend_class_entry *dom_domerrorhandler_class_entry; -extern zend_class_entry *dom_domlocator_class_entry; -extern zend_class_entry *dom_domconfiguration_class_entry; -extern zend_class_entry *dom_cdatasection_class_entry; -extern zend_class_entry *dom_documenttype_class_entry; -extern zend_class_entry *dom_notation_class_entry; -extern zend_class_entry *dom_entity_class_entry; -extern zend_class_entry *dom_entityreference_class_entry; -extern zend_class_entry *dom_processinginstruction_class_entry; -extern zend_class_entry *dom_string_extend_class_entry; -#if defined(LIBXML_XPATH_ENABLED) -extern zend_class_entry *dom_xpath_class_entry; -#endif -extern zend_class_entry *dom_namespace_node_class_entry; - -#endif /* DOM_CE_H */ diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h deleted file mode 100644 index f20daff65b53b..0000000000000 --- a/ext/dom/dom_fe.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_FE_H -#define DOM_FE_H - -extern zend_function_entry php_dom_domexception_class_functions[]; -extern zend_function_entry php_dom_domstringlist_class_functions[]; -extern zend_function_entry php_dom_namelist_class_functions[]; -extern zend_function_entry php_dom_domimplementationlist_class_functions[]; -extern zend_function_entry php_dom_domimplementationsource_class_functions[]; -extern zend_function_entry php_dom_domimplementation_class_functions[]; -extern zend_function_entry php_dom_documentfragment_class_functions[]; -extern zend_function_entry php_dom_document_class_functions[]; -extern zend_function_entry php_dom_node_class_functions[]; -extern zend_function_entry php_dom_nodelist_class_functions[]; -extern zend_function_entry php_dom_namednodemap_class_functions[]; -extern zend_function_entry php_dom_characterdata_class_functions[]; -extern zend_function_entry php_dom_attr_class_functions[]; -extern zend_function_entry php_dom_element_class_functions[]; -extern zend_function_entry php_dom_text_class_functions[]; -extern zend_function_entry php_dom_comment_class_functions[]; -extern zend_function_entry php_dom_typeinfo_class_functions[]; -extern zend_function_entry php_dom_userdatahandler_class_functions[]; -extern zend_function_entry php_dom_domerror_class_functions[]; -extern zend_function_entry php_dom_domerrorhandler_class_functions[]; -extern zend_function_entry php_dom_domlocator_class_functions[]; -extern zend_function_entry php_dom_domconfiguration_class_functions[]; -extern zend_function_entry php_dom_cdatasection_class_functions[]; -extern zend_function_entry php_dom_documenttype_class_functions[]; -extern zend_function_entry php_dom_notation_class_functions[]; -extern zend_function_entry php_dom_entity_class_functions[]; -extern zend_function_entry php_dom_entityreference_class_functions[]; -extern zend_function_entry php_dom_processinginstruction_class_functions[]; -extern zend_function_entry php_dom_string_extend_class_functions[]; -extern zend_function_entry php_dom_xpath_class_functions[]; - -/* domexception errors */ -typedef enum { -/* PHP_ERR is non-spec code for PHP errors: */ - PHP_ERR = 0, - INDEX_SIZE_ERR = 1, - DOMSTRING_SIZE_ERR = 2, - HIERARCHY_REQUEST_ERR = 3, - WRONG_DOCUMENT_ERR = 4, - INVALID_CHARACTER_ERR = 5, - NO_DATA_ALLOWED_ERR = 6, - NO_MODIFICATION_ALLOWED_ERR = 7, - NOT_FOUND_ERR = 8, - NOT_SUPPORTED_ERR = 9, - INUSE_ATTRIBUTE_ERR = 10, -/* Introduced in DOM Level 2: */ - INVALID_STATE_ERR = 11, -/* Introduced in DOM Level 2: */ - SYNTAX_ERR = 12, -/* Introduced in DOM Level 2: */ - INVALID_MODIFICATION_ERR = 13, -/* Introduced in DOM Level 2: */ - NAMESPACE_ERR = 14, -/* Introduced in DOM Level 2: */ - INVALID_ACCESS_ERR = 15, -/* Introduced in DOM Level 3: */ - VALIDATION_ERR = 16 -} dom_exception_code; - -/* domstringlist methods */ -PHP_FUNCTION(dom_domstringlist_item); - -/* domnamelist methods */ -PHP_FUNCTION(dom_namelist_get_name); -PHP_FUNCTION(dom_namelist_get_namespace_uri); - -/* domimplementationlist methods */ -PHP_FUNCTION(dom_domimplementationlist_item); - -/* domimplementationsource methods */ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation); -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations); - -/* domimplementation methods */ -PHP_METHOD(domimplementation, hasFeature); -PHP_METHOD(domimplementation, createDocumentType); -PHP_METHOD(domimplementation, createDocument); -PHP_METHOD(domimplementation, getFeature); - -/* domdocumentfragment methods */ -PHP_METHOD(domdocumentfragment, __construct); -PHP_METHOD(domdocumentfragment, appendXML); - -/* domdocument methods */ -PHP_FUNCTION(dom_document_create_element); -PHP_FUNCTION(dom_document_create_document_fragment); -PHP_FUNCTION(dom_document_create_text_node); -PHP_FUNCTION(dom_document_create_comment); -PHP_FUNCTION(dom_document_create_cdatasection); -PHP_FUNCTION(dom_document_create_processing_instruction); -PHP_FUNCTION(dom_document_create_attribute); -PHP_FUNCTION(dom_document_create_entity_reference); -PHP_FUNCTION(dom_document_get_elements_by_tag_name); -PHP_FUNCTION(dom_document_import_node); -PHP_FUNCTION(dom_document_create_element_ns); -PHP_FUNCTION(dom_document_create_attribute_ns); -PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns); -PHP_FUNCTION(dom_document_get_element_by_id); -PHP_FUNCTION(dom_document_adopt_node); -PHP_FUNCTION(dom_document_normalize_document); -PHP_FUNCTION(dom_document_rename_node); -PHP_METHOD(domdocument, __construct); - /* convienience methods */ -PHP_METHOD(domdocument, load); -PHP_FUNCTION(dom_document_save); -PHP_METHOD(domdocument, loadXML); -PHP_FUNCTION(dom_document_savexml); -PHP_FUNCTION(dom_document_validate); -PHP_FUNCTION(dom_document_xinclude); - -#if defined(LIBXML_HTML_ENABLED) -PHP_METHOD(domdocument, loadHTML); -PHP_METHOD(domdocument, loadHTMLFile); -PHP_FUNCTION(dom_document_save_html); -PHP_FUNCTION(dom_document_save_html_file); -#endif /* defined(LIBXML_HTML_ENABLED) */ - -#if defined(LIBXML_SCHEMAS_ENABLED) -PHP_FUNCTION(dom_document_schema_validate_file); -PHP_FUNCTION(dom_document_schema_validate_xml); -PHP_FUNCTION(dom_document_relaxNG_validate_file); -PHP_FUNCTION(dom_document_relaxNG_validate_xml); -#endif - -/* domnode methods */ -PHP_FUNCTION(dom_node_insert_before); -PHP_FUNCTION(dom_node_replace_child); -PHP_FUNCTION(dom_node_remove_child); -PHP_FUNCTION(dom_node_append_child); -PHP_FUNCTION(dom_node_has_child_nodes); -PHP_FUNCTION(dom_node_clone_node); -PHP_FUNCTION(dom_node_normalize); -PHP_FUNCTION(dom_node_is_supported); -PHP_FUNCTION(dom_node_has_attributes); -PHP_FUNCTION(dom_node_compare_document_position); -PHP_FUNCTION(dom_node_is_same_node); -PHP_FUNCTION(dom_node_lookup_prefix); -PHP_FUNCTION(dom_node_is_default_namespace); -PHP_FUNCTION(dom_node_lookup_namespace_uri); -PHP_FUNCTION(dom_node_is_equal_node); -PHP_FUNCTION(dom_node_get_feature); -PHP_FUNCTION(dom_node_set_user_data); -PHP_FUNCTION(dom_node_get_user_data); - -/* domnodelist methods */ -PHP_FUNCTION(dom_nodelist_item); - -/* domnamednodemap methods */ -PHP_FUNCTION(dom_namednodemap_get_named_item); -PHP_FUNCTION(dom_namednodemap_set_named_item); -PHP_FUNCTION(dom_namednodemap_remove_named_item); -PHP_FUNCTION(dom_namednodemap_item); -PHP_FUNCTION(dom_namednodemap_get_named_item_ns); -PHP_FUNCTION(dom_namednodemap_set_named_item_ns); -PHP_FUNCTION(dom_namednodemap_remove_named_item_ns); - -/* domcharacterdata methods */ -PHP_FUNCTION(dom_characterdata_substring_data); -PHP_FUNCTION(dom_characterdata_append_data); -PHP_FUNCTION(dom_characterdata_insert_data); -PHP_FUNCTION(dom_characterdata_delete_data); -PHP_FUNCTION(dom_characterdata_replace_data); - -/* domattr methods */ -PHP_FUNCTION(dom_attr_is_id); -PHP_METHOD(domattr, __construct); - -/* domelement methods */ -PHP_FUNCTION(dom_element_get_attribute); -PHP_FUNCTION(dom_element_set_attribute); -PHP_FUNCTION(dom_element_remove_attribute); -PHP_FUNCTION(dom_element_get_attribute_node); -PHP_FUNCTION(dom_element_set_attribute_node); -PHP_FUNCTION(dom_element_remove_attribute_node); -PHP_FUNCTION(dom_element_get_elements_by_tag_name); -PHP_FUNCTION(dom_element_get_attribute_ns); -PHP_FUNCTION(dom_element_set_attribute_ns); -PHP_FUNCTION(dom_element_remove_attribute_ns); -PHP_FUNCTION(dom_element_get_attribute_node_ns); -PHP_FUNCTION(dom_element_set_attribute_node_ns); -PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns); -PHP_FUNCTION(dom_element_has_attribute); -PHP_FUNCTION(dom_element_has_attribute_ns); -PHP_FUNCTION(dom_element_set_id_attribute); -PHP_FUNCTION(dom_element_set_id_attribute_ns); -PHP_FUNCTION(dom_element_set_id_attribute_node); -PHP_METHOD(domelement, __construct); - -/* domtext methods */ -PHP_FUNCTION(dom_text_split_text); -PHP_FUNCTION(dom_text_is_whitespace_in_element_content); -PHP_FUNCTION(dom_text_replace_whole_text); -PHP_METHOD(domtext, __construct); - -/* domcomment methods */ -PHP_METHOD(domcomment, __construct); - -/* domtypeinfo methods */ - -/* domuserdatahandler methods */ -PHP_FUNCTION(dom_userdatahandler_handle); - -/* domdomerror methods */ - -/* domerrorhandler methods */ -PHP_FUNCTION(dom_domerrorhandler_handle_error); - -/* domlocator methods */ - -/* domconfiguration methods */ -PHP_FUNCTION(dom_domconfiguration_set_parameter); -PHP_FUNCTION(dom_domconfiguration_get_parameter); -PHP_FUNCTION(dom_domconfiguration_can_set_parameter); - -/* domcdatasection methods */ -PHP_METHOD(domcdatasection, __construct); - -/* domdocumenttype methods */ - -/* domnotation methods */ - -/* domentity methods */ - -/* domentityreference methods */ -PHP_METHOD(domentityreference, __construct); - -/* domprocessinginstruction methods */ -PHP_METHOD(domprocessinginstruction, __construct); - -/* string_extend methods */ -PHP_FUNCTION(dom_string_extend_find_offset16); -PHP_FUNCTION(dom_string_extend_find_offset32); - -#if defined(LIBXML_XPATH_ENABLED) -/* xpath methods */ -PHP_METHOD(domxpath, __construct); -PHP_FUNCTION(dom_xpath_register_ns); -PHP_FUNCTION(dom_xpath_query); -PHP_FUNCTION(dom_xpath_evaluate); -#endif - -#endif /* DOM_FE_H */ diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c deleted file mode 100644 index 378abc405e512..0000000000000 --- a/ext/dom/dom_iterators.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include "dom_ce.h" - -typedef struct _nodeIterator nodeIterator; -struct _nodeIterator { - int cur; - int index; - xmlNode *node; -}; - -typedef struct _notationIterator notationIterator; -struct _notationIterator { - int cur; - int index; - xmlNotation *notation; -}; - -static void itemHashScanner (void *payload, void *data, xmlChar *name) { - nodeIterator *priv = (nodeIterator *)data; - - if(priv->cur < priv->index) { - priv->cur++; - } else { - if(priv->node == NULL) { - priv->node = (xmlNode *)payload; - } - } -} - -xmlNodePtr create_notation(const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) { - xmlEntityPtr ret; - - ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); - memset(ret, 0, sizeof(xmlEntity)); - ret->type = XML_NOTATION_NODE; - ret->name = xmlStrdup(name); - ret->ExternalID = xmlStrdup(ExternalID); - ret->SystemID = xmlStrdup(SystemID); - ret->length = 0; - ret->content = NULL; - ret->URI = NULL; - ret->orig = NULL; - ret->children = NULL; - ret->parent = NULL; - ret->doc = NULL; - ret->_private = NULL; - ret->last = NULL; - ret->prev = NULL; - return((xmlNodePtr) ret); -} - -xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index) -{ - xmlNode *nodep = NULL; - nodeIterator *iter; - int htsize; - - if ((htsize = xmlHashSize(ht)) > 0 && index < htsize) { - iter = emalloc(sizeof(nodeIterator)); - iter->cur = 0; - iter->index = index; - iter->node = NULL; - xmlHashScan(ht, itemHashScanner, iter); - nodep = iter->node; - efree(iter); - return nodep; - } else { - return NULL; - } -} - -xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index) -{ - notationIterator *iter; - xmlNotation *notep = NULL; - int htsize; - - if ((htsize = xmlHashSize(ht)) > 0 && index < htsize) { - iter = emalloc(sizeof(notationIterator)); - iter->cur = 0; - iter->index = index; - iter->notation = NULL; - xmlHashScan(ht, itemHashScanner, iter); - notep = iter->notation; - efree(iter); - return create_notation(notep->name, notep->PublicID, notep->SystemID); - } else { - return NULL; - } -} - -static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - zval_ptr_dtor((zval**)&iterator->intern.data); - - if (iterator->curobj) { - zval_ptr_dtor((zval**)&iterator->curobj); - } - - efree(iterator); -} - -static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) -{ - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - if (iterator->curobj) { - return SUCCESS; - } else { - return FAILURE; - } -} - -static void php_dom_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - *data = &iterator->curobj; -} - -static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zval *curobj; - xmlNodePtr curnode = NULL; - dom_object *intern; - zval *object; - int namelen; - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - object = (zval *)iterator->intern.data; - - if (instanceof_function(Z_OBJCE_P(object), U_CLASS_ENTRY(dom_nodelist_class_entry) TSRMLS_CC)) { - *int_key = iter->index - 1; - return HASH_KEY_IS_LONG; - } else { - curobj = iterator->curobj; - - intern = (dom_object *)zend_object_store_get_object(curobj TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node; - } - - namelen = xmlStrlen(curnode->name); - *str_key = estrndup(curnode->name, namelen); - *str_key_len = namelen + 1; - return HASH_KEY_IS_STRING; - } -} - -static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - zval *curobj, *curattr = NULL; - zval *object; - xmlNodePtr curnode = NULL, basenode; - dom_object *intern; - dom_object *nnmap; - dom_nnodemap_object *objmap; - int ret, previndex=1; - HashTable *nodeht; - pval **entry; - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - object = (zval *)iterator->intern.data; - nnmap = (dom_object *)zend_object_store_get_object(object TSRMLS_CC); - objmap = (dom_nnodemap_object *)nnmap->ptr; - - curobj = iterator->curobj; - intern = (dom_object *)zend_object_store_get_object(curobj TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - if (objmap->ht == NULL) { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - zend_hash_move_forward(nodeht); - if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) { - curattr = *entry; - curattr->refcount++; - } - } else { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node; - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - curnode = curnode->next; - } else { - /* Nav the tree evey time as this is LIVE */ - basenode = dom_object_get_node(objmap->baseobj); - if (basenode && (basenode->type == XML_DOCUMENT_NODE || basenode->type == XML_HTML_DOCUMENT_NODE)) { - basenode = xmlDocGetRootElement((xmlDoc *) basenode); - } else { - basenode = basenode->children; - } - curnode = dom_get_elements_by_tag_name_ns_raw(basenode, objmap->ns, objmap->local, &previndex, iter->index); - } - } - } else { - if (objmap->nodetype == XML_ENTITY_NODE) { - curnode = php_dom_libxml_hash_iter(objmap->ht, iter->index); - } else { - curnode = php_dom_libxml_notation_iter(objmap->ht, iter->index); - } - } - } - - zval_ptr_dtor((zval**)&curobj); - if (curnode) { - MAKE_STD_ZVAL(curattr); - curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC); - } - - iterator->curobj = curattr; -} - -zend_object_iterator_funcs php_dom_iterator_funcs = { - php_dom_iterator_dtor, - php_dom_iterator_valid, - php_dom_iterator_current_data, - php_dom_iterator_current_key, - php_dom_iterator_move_forward, - NULL -}; - -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - dom_object *intern; - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode=NULL; - zval *curattr = NULL; - int ret, curindex = 0; - HashTable *nodeht; - pval **entry; - - php_dom_iterator *iterator = emalloc(sizeof(php_dom_iterator)); - - object->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &php_dom_iterator_funcs; - - intern = (dom_object *)zend_object_store_get_object(object TSRMLS_CC); - objmap = (dom_nnodemap_object *)intern->ptr; - if (objmap != NULL) { - if (objmap->ht == NULL) { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - zend_hash_internal_pointer_reset(nodeht); - if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) { - curattr = *entry; - curattr->refcount++; - } - } else { - nodep = (xmlNode *)dom_object_get_node(objmap->baseobj); - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE) { - curnode = (xmlNodePtr) nodep->properties; - } else { - curnode = (xmlNodePtr) nodep->children; - } - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &curindex, 0); - } - } - } else { - curnode = php_dom_libxml_hash_iter(objmap->ht, 0); - } - } - - if (curnode) { - MAKE_STD_ZVAL(curattr); - curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC); - } - - iterator->curobj = curattr; - - return (zend_object_iterator*)iterator; -} - -#endif diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h deleted file mode 100644 index bfb93c5a59ea4..0000000000000 --- a/ext/dom/dom_properties.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_PROPERTIES_H -#define DOM_PROPERTIES_H - -/* attr properties */ -int dom_attr_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_specified_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_value_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* characterdata properties */ -int dom_characterdata_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* document properties */ -int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_standalone_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_version_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_document_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* documenttype properties */ -int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domerror properties */ -int dom_domerror_severity_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_message_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_type_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_related_exception_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_related_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_location_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domimplementationlist properties */ -int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domlocator properties */ -int dom_domlocator_line_number_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_column_number_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_offset_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_related_node_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_uri_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domstringlist properties */ -int dom_domstringlist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* element properties */ -int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* entity properties */ -int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_entity_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_entity_version_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* namednodemap properties */ -int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* namelist properties */ -int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* node properties */ -int dom_node_node_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_node_value_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_namespace_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_prefix_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_node_local_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_base_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* nodelist properties */ -int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* notation properties */ -int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* processinginstruction properties */ -int dom_processinginstruction_target_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_processinginstruction_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* text properties */ -int dom_text_whole_text_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* typeinfo properties */ -int dom_typeinfo_type_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_typeinfo_type_namespace_read(dom_object *obj, zval **retval TSRMLS_DC); - -#if defined(LIBXML_XPATH_ENABLED) -/* xpath properties */ -int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC); -#endif - -#endif /* DOM_PROPERTIERS_H */ diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c deleted file mode 100644 index b2cc515fa1583..0000000000000 --- a/ext/dom/domconfiguration.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domdomconfiguration -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domconfiguration_class_functions[] = { - PHP_FALIAS(setParameter, dom_domconfiguration_set_parameter, NULL) - PHP_FALIAS(getParameter, dom_domconfiguration_get_parameter, NULL) - PHP_FALIAS(canSetParameter, dom_domconfiguration_can_set_parameter, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_void dom_domconfiguration_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-property -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_set_parameter */ - - -/* {{{ proto domdomuserdata dom_domconfiguration_get_parameter(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-getParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_get_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_get_parameter */ - - -/* {{{ proto boolean dom_domconfiguration_can_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-canSetParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_can_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_can_set_parameter */ -#endif diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c deleted file mode 100644 index c39f12ff5f240..0000000000000 --- a/ext/dom/domerror.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domerror -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMError -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domerror_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ severity unsigned short -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-severity -Since: -*/ -int dom_domerror_severity_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ message string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-message -Since: -*/ -int dom_domerror_message_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ type string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-type -Since: -*/ -int dom_domerror_type_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ relatedException object -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedException -Since: -*/ -int dom_domerror_related_exception_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ relatedData domobject -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedData -Since: -*/ -int dom_domerror_related_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ location domlocator -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-location -Since: -*/ -int dom_domerror_location_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c deleted file mode 100644 index 2d78a79ef2155..0000000000000 --- a/ext/dom/domerrorhandler.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domerrorhandler -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMErrorHandler -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domerrorhandler_class_functions[] = { - PHP_FALIAS(handleError, dom_domerrorhandler_handle_error, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_boolean dom_domerrorhandler_handle_error(domerror error); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-ERRORS-DOMErrorHandler-handleError -Since: -*/ -PHP_FUNCTION(dom_domerrorhandler_handle_error) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domerrorhandler_handle_error */ -#endif diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c deleted file mode 100644 index 2db21db5e97fb..0000000000000 --- a/ext/dom/domexception.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMException -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-17189187 -* Since: -*/ - -extern zend_class_entry *dom_domexception_class_entry; - -zend_function_entry php_dom_domexception_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ php_dom_throw_error_with_message */ -void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) -{ - if (strict_error == 1) { - zend_throw_exception(U_CLASS_ENTRY(dom_domexception_class_entry), error_message, error_code TSRMLS_CC); - } else { - php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC); - } -} - -/* {{{ php_dom_throw_error */ -void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC) -{ - char *error_message; - - switch (error_code) - { - case INDEX_SIZE_ERR: - error_message = "Index Size Error"; - break; - case DOMSTRING_SIZE_ERR: - error_message = "DOM String Size Error"; - break; - case HIERARCHY_REQUEST_ERR: - error_message = "Hierarchy Request Error"; - break; - case WRONG_DOCUMENT_ERR: - error_message = "Wrong Document Error"; - break; - case INVALID_CHARACTER_ERR: - error_message = "Invalid Character Error"; - break; - case NO_DATA_ALLOWED_ERR: - error_message = "No Data Allowed Error"; - break; - case NO_MODIFICATION_ALLOWED_ERR: - error_message = "No Modification Allowed Error"; - break; - case NOT_FOUND_ERR: - error_message = "Not Found Error"; - break; - case NOT_SUPPORTED_ERR: - error_message = "Not Supported Error"; - break; - case INUSE_ATTRIBUTE_ERR: - error_message = "Inuse Attribute Error"; - break; - case INVALID_STATE_ERR: - error_message = "Invalid State Error"; - break; - case SYNTAX_ERR: - error_message = "Syntax Error"; - break; - case INVALID_MODIFICATION_ERR: - error_message = "Invalid Modification Error"; - break; - case NAMESPACE_ERR: - error_message = "Namespace Error"; - break; - case INVALID_ACCESS_ERR: - error_message = "Invalid Access Error"; - break; - case VALIDATION_ERR: - error_message = "Validation Error"; - break; - default: - error_message = "Unhandled Error"; - } - - php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC); -} -/* }}} end php_dom_throw_error */ - -#endif /* HAVE_LIBXML && HAVE_DOM */ diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c deleted file mode 100644 index 0f271877c6c1d..0000000000000 --- a/ext/dom/domimplementation.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* -* class DOMImplementation -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-102161490 -* Since: -*/ - -zend_function_entry php_dom_domimplementation_class_functions[] = { - PHP_ME(domimplementation, getFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, hasFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocumentType, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocument, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7 -Since: -*/ -PHP_METHOD(domimplementation, hasFeature) -{ - int feature_len, version_len; - char *feature, *version; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - return; - } - - if (dom_has_feature(feature, version)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_domimplementation_has_feature */ - - -/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType -Since: DOM Level 2 -*/ -PHP_METHOD(domimplementation, createDocumentType) -{ - zval *rv = NULL; - xmlDtd *doctype; - int ret, name_len = 0, publicid_len = 0, systemid_len = 0; - char *name, *publicid, *systemid; - xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL; - xmlURIPtr uri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "qualifiedName is required"); - RETURN_FALSE; - } - - if (publicid_len > 0) - pch1 = publicid; - if (systemid_len > 0) - pch2 = systemid; - - uri = xmlParseURI(name); - if (uri->opaque != NULL) { - localname = xmlStrdup(uri->opaque); - if (xmlStrchr(localname, (xmlChar) ':') != NULL) { - php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC); - xmlFreeURI(uri); - xmlFree(localname); - RETURN_FALSE; - } - } else { - localname = xmlStrdup(name); - } - - /* TODO: Test that localname has no invalid chars - php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC); - */ - - xmlFreeURI(uri); - - doctype = xmlCreateIntSubset(NULL, localname, pch1, pch2); - xmlFree(localname); - - DOM_RET_OBJ(rv, (xmlNodePtr) doctype, &ret, NULL); -} -/* }}} end dom_domimplementation_create_document_type */ - - -/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument -Since: DOM Level 2 -*/ -PHP_METHOD(domimplementation, createDocument) -{ - zval *node = NULL, *rv = NULL; - xmlDoc *docp; - xmlNode *nodep; - xmlDtdPtr doctype = NULL; - xmlNsPtr nsptr = NULL; - int ret, uri_len = 0, name_len = 0, errorcode = 0; - char *uri, *name; - char *prefix = NULL, *localname = NULL; - dom_object *doctobj; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, U_CLASS_ENTRY(dom_documenttype_class_entry)) == FAILURE) { - return; - } - - if (node != NULL) { - DOM_GET_OBJ(doctype, node, xmlDtdPtr, doctobj); - if (doctype->type == XML_DOCUMENT_TYPE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid DocumentType object"); - RETURN_FALSE; - } - if (doctype->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - } else { - doctobj = NULL; - } - - if (name_len > 0) { - errorcode = dom_check_qname(name, &localname, &prefix, 1, name_len); - if (errorcode == 0 && uri_len > 0 && ((nsptr = xmlNewNs(NULL, uri, prefix)) == NULL)) { - errorcode = NAMESPACE_ERR; - } - } - - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (localname != NULL) { - xmlFree(localname); - } - php_dom_throw_error(errorcode, 1 TSRMLS_CC); - RETURN_FALSE; - } - - /* currently letting libxml2 set the version string */ - docp = xmlNewDoc(NULL); - if (!docp) { - if (localname != NULL) { - xmlFree(localname); - } - RETURN_FALSE; - } - - if (doctype != NULL) { - docp->intSubset = doctype; - doctype->parent = docp; - doctype->doc = docp; - docp->children = (xmlNodePtr) doctype; - docp->last = (xmlNodePtr) doctype; - } - - if (localname != NULL) { - nodep = xmlNewDocNode (docp, nsptr, localname, NULL); - if (!nodep) { - if (doctype != NULL) { - docp->intSubset = NULL; - doctype->parent = NULL; - doctype->doc = NULL; - docp->children = NULL; - docp->last = NULL; - } - xmlFreeDoc(docp); - xmlFree(localname); - /* Need some type of error here */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected Error"); - RETURN_FALSE; - } - - nodep->nsDef = nsptr; - - xmlDocSetRootElement(docp, nodep); - xmlFree(localname); - } - - DOM_RET_OBJ(rv, (xmlNodePtr) docp, &ret, NULL); - - if (doctobj != NULL) { - doctobj->document = ((dom_object *)((php_libxml_node_ptr *)docp->_private)->_private)->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp TSRMLS_CC); - } -} -/* }}} end dom_domimplementation_create_document */ - - -/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature -Since: DOM Level 3 -*/ -PHP_METHOD(domimplementation, getFeature) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementation_get_feature */ -#endif diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c deleted file mode 100644 index f8134807ba6d5..0000000000000 --- a/ext/dom/domimplementationlist.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domimplementationlist -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domimplementationlist_class_functions[] = { - PHP_FALIAS(item, dom_domimplementationlist_item, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length -Since: -*/ -int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item -Since: -*/ -PHP_FUNCTION(dom_domimplementationlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationlist_item */ -#endif diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c deleted file mode 100644 index 12a822638a715..0000000000000 --- a/ext/dom/domimplementationsource.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domimplementationsource -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationSource -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domimplementationsource_class_functions[] = { - PHP_FALIAS(getDomimplementation, dom_domimplementationsource_get_domimplementation, NULL) - PHP_FALIAS(getDomimplementations, dom_domimplementationsource_get_domimplementations, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto domdomimplementation dom_domimplementationsource_get_domimplementation(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpl -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementation */ - - -/* {{{ proto domimplementationlist dom_domimplementationsource_get_domimplementations(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpls -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementations */ -#endif diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c deleted file mode 100644 index 3265aa2ca82a3..0000000000000 --- a/ext/dom/domlocator.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domlocator -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Interfaces-DOMLocator -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domlocator_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ line_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-line-number -Since: -*/ -int dom_domlocator_line_number_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ column_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-column-number -Since: -*/ -int dom_domlocator_column_number_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ offset long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-offset -Since: -*/ -int dom_domlocator_offset_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ related_node node -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-node -Since: -*/ -int dom_domlocator_related_node_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ uri string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-uri -Since: -*/ -int dom_domlocator_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - -#endif diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c deleted file mode 100644 index 366bc5d75e051..0000000000000 --- a/ext/dom/domstringlist.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domstringlist -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domstringlist_class_functions[] = { - PHP_FALIAS(item, dom_domstringlist_item, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-length -Since: -*/ -int dom_domstringlist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto domstring dom_domstringlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-item -Since: -*/ -PHP_FUNCTION(dom_domstringlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domstringlist_item */ -#endif diff --git a/ext/dom/element.c b/ext/dom/element.c deleted file mode 100644 index 68e63c061c55c..0000000000000 --- a/ext/dom/element.c +++ /dev/null @@ -1,935 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMElement extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-745549614 -* Since: -*/ - -zend_function_entry php_dom_element_class_functions[] = { - PHP_FALIAS(getAttribute, dom_element_get_attribute, NULL) - PHP_FALIAS(setAttribute, dom_element_set_attribute, NULL) - PHP_FALIAS(removeAttribute, dom_element_remove_attribute, NULL) - PHP_FALIAS(getAttributeNode, dom_element_get_attribute_node, NULL) - PHP_FALIAS(setAttributeNode, dom_element_set_attribute_node, NULL) - PHP_FALIAS(removeAttributeNode, dom_element_remove_attribute_node, NULL) - PHP_FALIAS(getElementsByTagName, dom_element_get_elements_by_tag_name, NULL) - PHP_FALIAS(getAttributeNS, dom_element_get_attribute_ns, NULL) - PHP_FALIAS(setAttributeNS, dom_element_set_attribute_ns, NULL) - PHP_FALIAS(removeAttributeNS, dom_element_remove_attribute_ns, NULL) - PHP_FALIAS(getAttributeNodeNS, dom_element_get_attribute_node_ns, NULL) - PHP_FALIAS(setAttributeNodeNS, dom_element_set_attribute_node_ns, NULL) - PHP_FALIAS(getElementsByTagNameNS, dom_element_get_elements_by_tag_name_ns, NULL) - PHP_FALIAS(hasAttribute, dom_element_has_attribute, NULL) - PHP_FALIAS(hasAttributeNS, dom_element_has_attribute_ns, NULL) - PHP_FALIAS(setIdAttribute, dom_element_set_id_attribute, NULL) - PHP_FALIAS(setIdAttributeNS, dom_element_set_id_attribute_ns, NULL) - PHP_FALIAS(setIdAttributeNode, dom_element_set_id_attribute_node, NULL) - PHP_ME(domelement, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMElement::__construct(string name, [string value], [string uri]); */ -PHP_METHOD(domelement, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *name, *value = NULL, *uri = NULL; - char *localname = NULL, *prefix = NULL; - int errorcode = 0, uri_len = 0; - int name_len, value_len = 0, name_valid; - xmlNsPtr nsptr = NULL; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - /* Namespace logic is seperate and only when uri passed in to insure no BC breakage */ - if (uri_len > 0) { - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - if (errorcode == 0) { - nodep = xmlNewNode (NULL, localname); - if (nodep != NULL && uri != NULL) { - nsptr = dom_get_ns(nodep, uri, &errorcode, prefix); - xmlSetNs(nodep, nsptr); - } - } - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - if (errorcode != 0) { - if (nodep != NULL) { - xmlFree(nodep); - } - php_dom_throw_error(errorcode, 1 TSRMLS_CC); - RETURN_FALSE; - } - } else { - /* If you don't pass a namespace uri, then you can't set a prefix */ - localname = xmlSplitQName2(name, (xmlChar **) &prefix); - if (prefix != NULL) { - xmlFree(localname); - xmlFree(prefix); - php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - nodep = xmlNewNode(NULL, (xmlChar *) name); - } - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (value_len > 0) { - xmlNodeSetContentLen(nodep, value, value_len); - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMElement::__construct */ - -/* {{{ tagName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-104682815 -Since: -*/ -int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlNsPtr ns; - xmlChar *qname; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup(ns->prefix); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - ZVAL_STRING(*retval, qname, 1); - xmlFree(qname); - } else { - ZVAL_STRING(*retval, (char *) nodep->name, 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ schemaTypeInfo typeinfo -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Element-schemaTypeInfo -Since: DOM Level 3 -*/ -int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ proto string dom_element_get_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9 -Since: -*/ -PHP_FUNCTION(dom_element_get_attribute) -{ - zval *id; - xmlNode *nodep; - char *name, *value; - dom_object *intern; - int name_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - value = xmlGetProp(nodep, name); - if (value == NULL) { - RETURN_EMPTY_STRING(); - } else { - RETVAL_STRING(value, 1); - xmlFree(value); - } -} -/* }}} end dom_element_get_attribute */ - - -/* {{{ proto void dom_element_set_attribute(string name, string value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68F082 -Since: -*/ -PHP_FUNCTION(dom_element_set_attribute) -{ - zval *id, *rv = NULL; - xmlNode *nodep; - xmlAttr *attr; - int ret, name_len, value_len; - dom_object *intern; - char *name, *value; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - attr = xmlHasProp(nodep,name); - if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { - node_list_unlink(attr->children TSRMLS_CC); - } - attr = xmlSetProp(nodep, name, value); - if (!attr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", name); - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) attr, &ret, intern); - -} -/* }}} end dom_element_set_attribute */ - - -/* {{{ proto void dom_element_remove_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D6AC0F9 -Since: -*/ -PHP_FUNCTION(dom_element_remove_attribute) -{ - zval *id; - xmlNode *nodep; - xmlAttr *attrp; - dom_object *intern; - int name_len; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - attrp = xmlHasProp(nodep,name); - if (attrp == NULL) { - RETURN_FALSE; - } - - if (attrp->type != XML_ATTRIBUTE_DECL) { - if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) { - node_list_unlink(attrp->children TSRMLS_CC); - xmlUnlinkNode((xmlNodePtr) attrp); - xmlFreeProp(attrp); - } else { - xmlUnlinkNode((xmlNodePtr) attrp); - } - } - - RETURN_TRUE; -} -/* }}} end dom_element_remove_attribute */ - - -/* {{{ proto DOMAttr dom_element_get_attribute_node(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-217A91B8 -Since: -*/ -PHP_FUNCTION(dom_element_get_attribute_node) -{ - zval *id, *rv = NULL; - xmlNode *nodep; - xmlAttr *attrp; - int name_len, ret; - dom_object *intern; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - attrp = xmlHasProp(nodep,name); - if (attrp == NULL) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); -} -/* }}} end dom_element_get_attribute_node */ - - -/* {{{ proto DOMAttr dom_element_set_attribute_node(DOMAttr newAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-887236154 -Since: -*/ -PHP_FUNCTION(dom_element_set_attribute_node) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlAttr *attrp, *existattrp = NULL; - dom_object *intern, *attrobj, *oldobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required"); - RETURN_FALSE; - } - - existattrp = xmlHasProp(nodep, attrp->name); - if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) { - if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL && - ((php_libxml_node_ptr *)oldobj->ptr)->node == (xmlNodePtr) attrp) - { - RETURN_NULL(); - } - xmlUnlinkNode((xmlNodePtr) existattrp); - } - - if (attrp->doc == NULL && nodep->doc != NULL) { - attrobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC); - } - - xmlAddChild(nodep, (xmlNodePtr) attrp); - - /* Returns old property if removed otherwise NULL */ - if (existattrp != NULL) { - DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_element_set_attribute_node */ - - -/* {{{ proto DOMAttr dom_element_remove_attribute_node(DOMAttr oldAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D589198 -Since: -*/ -PHP_FUNCTION(dom_element_remove_attribute_node) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlAttr *attrp; - dom_object *intern, *attrobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE || attrp->parent != nodep) { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - xmlUnlinkNode((xmlNodePtr) attrp); - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); - -} -/* }}} end dom_element_remove_attribute_node */ - - -/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1938918D -Since: -*/ -PHP_FUNCTION(dom_element_get_elements_by_tag_name) -{ - zval *id; - xmlNodePtr elemp; - int name_len; - dom_object *intern, *namednode; - char *name; - xmlChar *local; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC); -} -/* }}} end dom_element_get_elements_by_tag_name */ - - -/* {{{ proto string dom_element_get_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_attribute_ns) -{ - zval *id; - xmlNodePtr elemp; - xmlNsPtr nsptr; - dom_object *intern; - int uri_len = 0, name_len = 0; - char *uri, *name, *strattr; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - strattr = xmlGetNsProp(elemp, name, uri); - - if (strattr != NULL) { - RETVAL_STRING(strattr, 1); - xmlFree(strattr); - } else { - if (xmlStrEqual(uri, DOM_XMLNS_NAMESPACE)) { - nsptr = dom_get_nsdecl(elemp, name); - if (nsptr != NULL) { - RETVAL_STRING((char *) nsptr->href, 1); - } else { - RETVAL_EMPTY_STRING(); - } - } else { - RETVAL_EMPTY_STRING(); - } - } - -} -/* }}} end dom_element_get_attribute_ns */ - -static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) { - xmlNsPtr def; - xmlChar prefix[50]; - int counter = 1; - - if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) { - return NULL; - } - - /* Code taken from libxml2 (2.6.20) xmlNewReconciliedNs - * - * Find a close prefix which is not already in use. - * Let's strip namespace prefixes longer than 20 chars ! - */ - if (ns->prefix == NULL) - snprintf((char *) prefix, sizeof(prefix), "default"); - else - snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix); - - def = xmlSearchNs(doc, tree, prefix); - while (def != NULL) { - if (counter > 1000) return(NULL); - if (ns->prefix == NULL) - snprintf((char *) prefix, sizeof(prefix), "default%d", counter++); - else - snprintf((char *) prefix, sizeof(prefix), "%.20s%d", - (char *)ns->prefix, counter++); - def = xmlSearchNs(doc, tree, prefix); - } - - /* - * OK, now we are ready to create a new one. - */ - def = xmlNewNs(tree, ns->href, prefix); - return(def); -} - -/* {{{ proto void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_set_attribute_ns) -{ - zval *id; - xmlNodePtr elemp, nodep = NULL; - xmlNsPtr nsptr; - xmlAttr *attr; - int uri_len = 0, name_len = 0, value_len = 0; - char *uri, *name, *value; - char *localname = NULL, *prefix = NULL; - dom_object *intern; - int errorcode = 0, stricterror, is_xmlns = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(elemp) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_NULL(); - } - - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - - if (errorcode == 0) { - if (uri_len > 0) { - nodep = (xmlNodePtr) xmlHasNsProp(elemp, localname, uri); - if (nodep != NULL && nodep->type != XML_ATTRIBUTE_DECL) { - node_list_unlink(nodep->children TSRMLS_CC); - } - - if (xmlStrEqual(prefix,"xmlns") && xmlStrEqual(uri, DOM_XMLNS_NAMESPACE)) { - is_xmlns = 1; - nsptr = dom_get_nsdecl(elemp, localname); - } else { - nsptr = xmlSearchNsByHref(elemp->doc, elemp, uri); - if (nsptr && nsptr->prefix == NULL) { - xmlNsPtr tmpnsptr; - - tmpnsptr = nsptr->next; - while (tmpnsptr) { - if ((tmpnsptr->prefix != NULL) && (tmpnsptr->href != NULL) && - (xmlStrEqual(tmpnsptr->href, (xmlChar *) uri))) { - nsptr = tmpnsptr; - break; - } - tmpnsptr = tmpnsptr->next; - } - if (tmpnsptr == NULL) { - nsptr = _dom_new_reconNs(elemp->doc, elemp, nsptr); - } - } - } - - if (nsptr == NULL) { - if (prefix == NULL) { - errorcode = NAMESPACE_ERR; - } else { - if (is_xmlns == 1) { - xmlNewNs(elemp, value, localname); - } else { - nsptr = dom_get_ns(elemp, uri, &errorcode, prefix); - } - } - } else { - if (is_xmlns == 1) { - if (nsptr->href) { - xmlFree((xmlChar *) nsptr->href); - } - nsptr->href = xmlStrdup(value); - } - } - - if (errorcode == 0 && is_xmlns == 0) { - attr = xmlSetNsProp(elemp, nsptr, localname, value); - } - } else { - attr = xmlHasProp(elemp, localname); - if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { - node_list_unlink(attr->children TSRMLS_CC); - } - attr = xmlSetProp(elemp, localname, value); - } - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - php_dom_throw_error(errorcode, stricterror TSRMLS_CC); - } - - RETURN_NULL(); -} -/* }}} end dom_element_set_attribute_ns */ - - -/* {{{ proto void dom_element_remove_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElRemAtNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_remove_attribute_ns) -{ - zval *id; - xmlNode *nodep; - xmlAttr *attrp; - xmlNsPtr nsptr; - dom_object *intern; - int name_len, uri_len; - char *name, *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_NULL(); - } - - attrp = xmlHasNsProp(nodep, name, uri); - - nsptr = dom_get_nsdecl(nodep, name); - if (nsptr != NULL) { - if (xmlStrEqual(uri, nsptr->href)) { - if (nsptr->href != NULL) { - xmlFree((char *) nsptr->href); - nsptr->href = NULL; - } - if (nsptr->prefix != NULL) { - xmlFree((char *) nsptr->prefix); - nsptr->prefix = NULL; - } - } else { - RETURN_NULL(); - } - } - - if (attrp && attrp->type != XML_ATTRIBUTE_DECL) { - if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) { - node_list_unlink(attrp->children TSRMLS_CC); - xmlUnlinkNode((xmlNodePtr) attrp); - xmlFreeProp(attrp); - } else { - xmlUnlinkNode((xmlNodePtr) attrp); - } - } - - RETURN_NULL(); -} -/* }}} end dom_element_remove_attribute_ns */ - - -/* {{{ proto DOMAttr dom_element_get_attribute_node_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAtNodeNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_attribute_node_ns) -{ - zval *id, *rv = NULL; - xmlNodePtr elemp; - xmlAttrPtr attrp; - dom_object *intern; - int uri_len, name_len, ret; - char *uri, *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - attrp = xmlHasNsProp(elemp, name, uri); - - if (attrp == NULL) { - RETURN_NULL(); - } - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); - -} -/* }}} end dom_element_get_attribute_node_ns */ - - -/* {{{ proto DOMAttr dom_element_set_attribute_node_ns(DOMAttr newAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAtNodeNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_set_attribute_node_ns) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlNs *nsp; - xmlAttr *attrp, *existattrp = NULL; - dom_object *intern, *attrobj, *oldobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required"); - RETURN_FALSE; - } - - nsp = attrp->ns; - if (nsp != NULL) { - existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name); - } else { - existattrp = xmlHasProp(nodep, attrp->name); - } - - if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) { - if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL && - ((php_libxml_node_ptr *)oldobj->ptr)->node == (xmlNodePtr) attrp) - { - RETURN_NULL(); - } - xmlUnlinkNode((xmlNodePtr) existattrp); - } - - if (attrp->doc == NULL && nodep->doc != NULL) { - attrobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC); - } - - xmlAddChild(nodep, (xmlNodePtr) attrp); - - /* Returns old property if removed otherwise NULL */ - if (existattrp != NULL) { - DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_element_set_attribute_node_ns */ - - - -/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C90942 -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns) -{ - zval *id; - xmlNodePtr elemp; - int uri_len, name_len; - dom_object *intern, *namednode; - char *uri, *name; - xmlChar *local, *nsuri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - nsuri = xmlCharStrndup(uri, uri_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC); - -} -/* }}} end dom_element_get_elements_by_tag_name_ns */ - - -/* {{{ proto boolean dom_element_has_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttr -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_has_attribute) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - char *name, *value; - int name_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - value = xmlGetProp(nodep, name); - if (value == NULL) { - RETURN_FALSE; - } else { - xmlFree(value); - RETURN_TRUE; - } -} -/* }}} end dom_element_has_attribute */ - - -/* {{{ proto boolean dom_element_has_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_has_attribute_ns) -{ - zval *id; - xmlNodePtr elemp; - xmlNs *nsp; - dom_object *intern; - int uri_len, name_len; - char *uri, *name, *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - value = xmlGetNsProp(elemp, name, uri); - - if (value != NULL) { - xmlFree(value); - RETURN_TRUE; - } else { - if (xmlStrEqual(uri, DOM_XMLNS_NAMESPACE)) { - nsp = dom_get_nsdecl(elemp, name); - if (nsp != NULL) { - RETURN_TRUE; - } - } - } - - RETURN_FALSE; -} -/* }}} end dom_element_has_attribute_ns */ - - -/* {{{ proto void dom_element_set_id_attribute(string name, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttr -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_element_set_id_attribute */ - - -/* {{{ proto void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNS -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_element_set_id_attribute_ns */ - - -/* {{{ proto void dom_element_set_id_attribute_node(attr idAttr, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_element_set_id_attribute_node */ - -#endif diff --git a/ext/dom/entity.c b/ext/dom/entity.c deleted file mode 100644 index a0650e3dc340f..0000000000000 --- a/ext/dom/entity.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMEntity extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-527DCFF2 -* Since: -*/ - -zend_function_entry php_dom_entity_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025 -Since: -*/ -int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E -Since: -*/ -int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ notationName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38 -Since: -*/ -int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - char *content; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - content = xmlNodeGetContent((xmlNodePtr) nodep); - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ actualEncoding string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding -Since: DOM Level 3 -*/ -int dom_entity_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ encoding string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding -Since: DOM Level 3 -*/ -int dom_entity_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ version string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version -Since: DOM Level 3 -*/ -int dom_entity_version_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c deleted file mode 100644 index 8bea78426167a..0000000000000 --- a/ext/dom/entityreference.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMEntityReference extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-11C98490 -* Since: -*/ - -zend_function_entry php_dom_entityreference_class_functions[] = { - PHP_ME(domentityreference, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMEntityReference::__construct(string name); */ -PHP_METHOD(domentityreference, __construct) -{ - zval *id; - xmlNode *node; - xmlNodePtr oldnode = NULL; - dom_object *intern; - char *name; - int name_len, name_valid; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_entityreference_class_entry), &name, &name_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewReference(NULL, name); - - if (!node) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern TSRMLS_CC); - } -} - -/* }}} end DOMEntityReference::__construct */ -#endif diff --git a/ext/dom/examples/dom1.inc b/ext/dom/examples/dom1.inc deleted file mode 100644 index 792d6f2dbc481..0000000000000 --- a/ext/dom/examples/dom1.inc +++ /dev/null @@ -1,43 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -function print_node($node) -{ - print "Node Name: " . $node->nodeName; - print "\nNode Type: " . $node->nodeType; - $child_count = $node->childNodes->length; - print "\nNum Children: " . $child_count; - if($child_count <= 1){ - print "\nNode Content: " . $node->nodeValue; - } - print "\n\n"; -} - -function print_node_list($nodelist) -{ - foreach($nodelist as $node) - { - print_node($node); - } -} - -?> diff --git a/ext/dom/examples/dom1.php b/ext/dom/examples/dom1.php deleted file mode 100644 index 8ea367458d6f6..0000000000000 --- a/ext/dom/examples/dom1.php +++ /dev/null @@ -1,94 +0,0 @@ -loadxml($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -// children() of of document would result in a memleak -//$children = $dom->children(); -//print_node_list($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement; -print_node($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes; -print_node_list($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild; -print_node($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parentNode; -print_node($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes; -print_node_list($children); - -echo "--------- creating a new attribute\n"; -//This is worthless -//$attr = $dom->createAttribute("src", "picture.gif"); -//print_r($attr); - -//$rootnode->set_attributeNode($attr); -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); -print "\n"; - -echo "--------- Get Attribute Node\n"; -$attr = $rootnode->getAttributeNode("src"); -print_node($attr); - -echo "--------- Remove Attribute Node\n"; -$attr = $rootnode->removeAttribute("src"); -print "Removed " . $attr . " attributes.\n"; - -echo "--------- attributes of rootnode\n"; -$attrs = $rootnode->attributes; -print_node_list($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs->item(0)->childNodes; -print_node_list($children); - -echo "--------- Add child to root\n"; -$myelement = new domElement("Silly", "Symphony"); -$newchild = $rootnode->appendChild($myelement); -print_node($newchild); -print $dom->saveXML(); -print "\n"; - -echo "--------- Find element by tagname\n"; -echo " Using dom\n"; -$children = $dom->getElementsByTagname("Silly"); -print_node_list($children); - -echo " Using elem\n"; -$children = $rootnode->getElementsByTagName("Silly"); -print_node_list($children); - -echo "--------- Unlink Node\n"; -print_node($children->item(0)); -$rootnode->removeChild($children->item(0)); -print_node_list($rootnode->childNodes); -print $dom->savexml(); - -echo "--------- Find element by id\n"; -print ("Not implemented\n"); - -echo "--------- Check various node_name return values\n"; -print ("Not needed\n"); - -?> diff --git a/ext/dom/examples/note-invalid.xml b/ext/dom/examples/note-invalid.xml deleted file mode 100644 index 58d4e650441bb..0000000000000 --- a/ext/dom/examples/note-invalid.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -PHP User Group -Shane -Reminder -Don't forget the meeting tonight! -
Or I'll clobber you!
-
diff --git a/ext/dom/examples/note.dtd b/ext/dom/examples/note.dtd deleted file mode 100644 index 4016eb58111cd..0000000000000 --- a/ext/dom/examples/note.dtd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/note.php b/ext/dom/examples/note.php deleted file mode 100644 index a8695f3664442..0000000000000 --- a/ext/dom/examples/note.php +++ /dev/null @@ -1,19 +0,0 @@ -load('note.xml'); -if (!$dom->validate('note.dtd')) { - print "Document note.dtd is not valid\n"; -} else { - print "Document note.dtd is valid\n"; -} - -$dom = new domDocument; -$dom->load('note-invalid.xml'); -if (!$dom->validate('note.dtd')) { - print "Document note-invalid.xml is not valid\n"; -} else { - print "Document note-invalid.xml is valid\n"; -} - -?> diff --git a/ext/dom/examples/note.xml b/ext/dom/examples/note.xml deleted file mode 100644 index 49614a1b5256c..0000000000000 --- a/ext/dom/examples/note.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - -PHP User Group -Shane -Reminder -Don't forget the meeting tonight! - diff --git a/ext/dom/examples/relaxNG.php b/ext/dom/examples/relaxNG.php deleted file mode 100644 index d265fd988e185..0000000000000 --- a/ext/dom/examples/relaxNG.php +++ /dev/null @@ -1,11 +0,0 @@ -load('relaxNG.xml'); -if (!$dom->relaxNGValidate('relaxNG.rng')) { - print "Document is not valid"; -} else { - print "Document is valid"; -} - -?> \ No newline at end of file diff --git a/ext/dom/examples/relaxNG.rng b/ext/dom/examples/relaxNG.rng deleted file mode 100644 index f4357e04ef8ab..0000000000000 --- a/ext/dom/examples/relaxNG.rng +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/ext/dom/examples/relaxNG.xml b/ext/dom/examples/relaxNG.xml deleted file mode 100644 index 6b0cac1225050..0000000000000 --- a/ext/dom/examples/relaxNG.xml +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/ext/dom/examples/relaxNG2.rng b/ext/dom/examples/relaxNG2.rng deleted file mode 100644 index 4adae7b15113d..0000000000000 --- a/ext/dom/examples/relaxNG2.rng +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/relaxNG3.rng b/ext/dom/examples/relaxNG3.rng deleted file mode 100644 index 73e1eb6165102..0000000000000 --- a/ext/dom/examples/relaxNG3.rng +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/shipping.php b/ext/dom/examples/shipping.php deleted file mode 100644 index 5205fd2014cb6..0000000000000 --- a/ext/dom/examples/shipping.php +++ /dev/null @@ -1,11 +0,0 @@ -load('shipping.xml'); -if (!$dom->schemaValidate('shipping.xsd')) { - print "Document is not valid"; -} else { - print "Document is valid"; -} - -?> \ No newline at end of file diff --git a/ext/dom/examples/shipping.xml b/ext/dom/examples/shipping.xml deleted file mode 100644 index dc8a09e301768..0000000000000 --- a/ext/dom/examples/shipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Tove Svendson - Ragnhildvei 2 -
4000 Stavanger
- Norway -
- - - Empire Burlesque - 1 - 10.90 - - - Hide your heart - 1 - 9.90 - - -
\ No newline at end of file diff --git a/ext/dom/examples/shipping.xsd b/ext/dom/examples/shipping.xsd deleted file mode 100644 index 8b16b7c03a621..0000000000000 --- a/ext/dom/examples/shipping.xsd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c deleted file mode 100644 index b14b526ba383d..0000000000000 --- a/ext/dom/namednodemap.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMNamedNodeMap -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1780488922 -* Since: -*/ - -zend_function_entry php_dom_namednodemap_class_functions[] = { - PHP_FALIAS(getNamedItem, dom_namednodemap_get_named_item, NULL) - PHP_FALIAS(setNamedItem, dom_namednodemap_set_named_item, NULL) - PHP_FALIAS(removeNamedItem, dom_namednodemap_remove_named_item, NULL) - PHP_FALIAS(item, dom_namednodemap_item, NULL) - PHP_FALIAS(getNamedItemNS, dom_namednodemap_get_named_item_ns, NULL) - PHP_FALIAS(setNamedItemNS, dom_namednodemap_set_named_item_ns, NULL) - PHP_FALIAS(removeNamedItemNS, dom_namednodemap_remove_named_item_ns, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E -Since: -*/ -int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_nnodemap_object *objmap; - xmlAttrPtr curnode; - xmlNodePtr nodep; - int count = 0; - - objmap = (dom_nnodemap_object *)obj->ptr; - - if (objmap != NULL) { - if (objmap->ht) { - count = xmlHashSize(objmap->ht); - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - curnode = nodep->properties; - if (curnode) { - count++; - while (curnode->next != NULL) { - count++; - curnode = curnode->next; - } - } - } - } - } - - MAKE_STD_ZVAL(*retval); - ZVAL_LONG(*retval, count); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_get_named_item) -{ - zval *id, *rv = NULL; - int ret, namedlen=0; - dom_object *intern; - xmlNodePtr itemnode = NULL; - char *named; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep; - xmlNotation *notep = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &named, &namedlen) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named); - } else { - notep = (xmlNotation *)xmlHashLookup(objmap->ht, named); - itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID); - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - itemnode = (xmlNodePtr)xmlHasProp(nodep, named); - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } else { - RETVAL_NULL(); - } -} -/* }}} end dom_namednodemap_get_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_item) -{ - zval *id, *rv = NULL; - long index; - int ret; - dom_object *intern; - xmlNodePtr itemnode = NULL; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &index) == FAILURE) { - return; - } - if (index >= 0) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = php_dom_libxml_hash_iter(objmap->ht, index); - } else { - itemnode = php_dom_libxml_notation_iter(objmap->ht, index); - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - curnode = (xmlNodePtr)nodep->properties; - count = 0; - while (count < index && curnode != NULL) { - count++; - curnode = (xmlNodePtr)curnode->next; - } - itemnode = curnode; - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } - } - - RETVAL_NULL(); -} -/* }}} end dom_namednodemap_item */ - - -/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_get_named_item_ns) -{ - zval *id, *rv = NULL; - int ret, namedlen=0, urilen=0; - dom_object *intern; - xmlNodePtr itemnode = NULL; - char *uri, *named; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep; - xmlNotation *notep = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &uri, &urilen, &named, &namedlen) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named); - } else { - notep = (xmlNotation *)xmlHashLookup(objmap->ht, named); - itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID); - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - itemnode = (xmlNodePtr)xmlHasNsProp(nodep, named, uri); - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } else { - RETVAL_NULL(); - } -} -/* }}} end dom_namednodemap_get_named_item_ns */ - - -/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item_ns */ - - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item_ns */ -#endif diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c deleted file mode 100644 index 3a6b546f49bb3..0000000000000 --- a/ext/dom/namelist.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMNameList -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_namelist_class_functions[] = { - PHP_FALIAS(getName, dom_namelist_get_name, NULL) - PHP_FALIAS(getNamespaceURI, dom_namelist_get_namespace_uri, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length -Since: -*/ -int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto string dom_namelist_get_name(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName -Since: -*/ -PHP_FUNCTION(dom_namelist_get_name) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_name */ - - -/* {{{ proto string dom_namelist_get_namespace_uri(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI -Since: -*/ -PHP_FUNCTION(dom_namelist_get_namespace_uri) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_namespace_uri */ -#endif diff --git a/ext/dom/node.c b/ext/dom/node.c deleted file mode 100644 index 2ff6ebcee650a..0000000000000 --- a/ext/dom/node.c +++ /dev/null @@ -1,1672 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* -* class DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1950641247 -* Since: -*/ - -zend_function_entry php_dom_node_class_functions[] = { - PHP_FALIAS(insertBefore, dom_node_insert_before, NULL) - PHP_FALIAS(replaceChild, dom_node_replace_child, NULL) - PHP_FALIAS(removeChild, dom_node_remove_child, NULL) - PHP_FALIAS(appendChild, dom_node_append_child, NULL) - PHP_FALIAS(hasChildNodes, dom_node_has_child_nodes, NULL) - PHP_FALIAS(cloneNode, dom_node_clone_node, NULL) - PHP_FALIAS(normalize, dom_node_normalize, NULL) - PHP_FALIAS(isSupported, dom_node_is_supported, NULL) - PHP_FALIAS(hasAttributes, dom_node_has_attributes, NULL) - PHP_FALIAS(compareDocumentPosition, dom_node_compare_document_position, NULL) - PHP_FALIAS(isSameNode, dom_node_is_same_node, NULL) - PHP_FALIAS(lookupPrefix, dom_node_lookup_prefix, NULL) - PHP_FALIAS(isDefaultNamespace, dom_node_is_default_namespace, NULL) - PHP_FALIAS(lookupNamespaceUri, dom_node_lookup_namespace_uri, NULL) - PHP_FALIAS(isEqualNode, dom_node_is_equal_node, NULL) - PHP_FALIAS(getFeature, dom_node_get_feature, NULL) - PHP_FALIAS(setUserData, dom_node_set_user_data, NULL) - PHP_FALIAS(getUserData, dom_node_get_user_data, NULL) - {NULL, NULL, NULL} -}; - -static void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) { - xmlNsPtr nsptr; - - if (nodep->type == XML_ELEMENT_NODE) { - /* Following if block primarily used for inserting nodes created via createElementNS */ - if (nodep->nsDef != NULL && nodep->nsDef->href != NULL) { - if((nsptr = xmlSearchNsByHref(doc, nodep->parent, nodep->nsDef->href)) && - (nodep->nsDef->prefix == NULL || xmlStrEqual(nsptr->prefix, nodep->nsDef->prefix))) { - dom_set_old_ns(doc, nodep->nsDef); - nodep->nsDef = NULL; - } - } - xmlReconciliateNs(doc, nodep); - } -} - -/* {{{ nodeName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D095 -Since: -*/ -int dom_node_node_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlNsPtr ns; - char *str = NULL; - xmlChar *qname = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ATTRIBUTE_NODE: - case XML_ELEMENT_NODE: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup(ns->prefix); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - str = qname; - } else { - str = (char *) nodep->name; - } - break; - case XML_NAMESPACE_DECL: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup("xmlns"); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - str = qname; - } else { - str = (char *) nodep->name; - } - break; - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - case XML_PI_NODE: - case XML_ENTITY_DECL: - case XML_ENTITY_REF_NODE: - case XML_NOTATION_NODE: - str = (char *) nodep->name; - break; - case XML_CDATA_SECTION_NODE: - str = "#cdata-section"; - break; - case XML_COMMENT_NODE: - str = "#comment"; - break; - case XML_HTML_DOCUMENT_NODE: - case XML_DOCUMENT_NODE: - str = "#document"; - break; - case XML_DOCUMENT_FRAG_NODE: - str = "#document-fragment"; - break; - case XML_TEXT_NODE: - str = "#text"; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Node Type"); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - if (qname != NULL) { - xmlFree(qname); - } - - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ nodeValue string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D080 -Since: -*/ -int dom_node_node_value_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - /* Access to Element node is implemented as a convience method */ - switch (nodep->type) { - case XML_ATTRIBUTE_NODE: - case XML_TEXT_NODE: - case XML_ELEMENT_NODE: - case XML_COMMENT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - str = xmlNodeGetContent(nodep); - break; - case XML_NAMESPACE_DECL: - str = xmlNodeGetContent(nodep->children); - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - xmlFree(str); - } else { - ZVAL_NULL(*retval); - } - - - return SUCCESS; - -} - -int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - xmlNode *nodep; - zval value_copy; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - /* Access to Element node is implemented as a convience method */ - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - if (nodep->children) { - node_list_unlink(nodep->children TSRMLS_CC); - } - case XML_TEXT_NODE: - case XML_COMMENT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - if (newval == &value_copy) { - zval_dtor(newval); - } - break; - default: - break; - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ nodeType int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558 -Since: -*/ -int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - /* Specs dictate that they are both type XML_DOCUMENT_TYPE_NODE */ - if (nodep->type == XML_DTD_NODE) { - ZVAL_LONG(*retval, XML_DOCUMENT_TYPE_NODE); - } else { - ZVAL_LONG(*retval, nodep->type); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ parentNode DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317 -Since: -*/ -int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *nodeparent; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nodeparent = nodep->parent; - if (!nodeparent) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ childNodes DomNodeList -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987 -Since: -*/ -int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - dom_object *intern; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (dom_node_children_valid(nodep) == FAILURE) { - ZVAL_NULL(*retval); - } else { - php_dom_create_interator(*retval, DOM_NODELIST TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL TSRMLS_CC); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ firstChild DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388 -Since: -*/ -int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *first = NULL; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (dom_node_children_valid(nodep) == SUCCESS) { - first = nodep->children; - } - - if (!first) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(first, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ lastChild DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB -Since: -*/ -int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *last = NULL; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (dom_node_children_valid(nodep) == SUCCESS) { - last = nodep->last; - } - - if (!last) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(last, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ previousSibling DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8 -Since: -*/ -int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *prevsib; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - prevsib = nodep->prev; - if (!prevsib) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(prevsib, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ nextSibling DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F -Since: -*/ -int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *nextsib; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nextsib = nodep->next; - if (!nextsib) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nextsib, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ attributes DomNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096 -Since: -*/ -int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - dom_object *intern; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (nodep->type == XML_ELEMENT_NODE) { - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL TSRMLS_CC); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ ownerDocument DomDocument -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc -Since: -*/ -int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlDocPtr docp; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; - } - - docp = nodep->doc; - if (!docp) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ namespaceUri string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSname -Since: DOM Level 2 -*/ -int dom_node_namespace_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - if (nodep->ns != NULL) { - str = (char *) nodep->ns->href; - } - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ prefix string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSPrefix -Since: DOM Level 2 -*/ -int dom_node_prefix_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlNsPtr ns; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - str = (char *) ns->prefix; - } - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if (str == NULL) { - ZVAL_EMPTY_STRING(*retval); - } else { - ZVAL_STRING(*retval, str, 1); - } - return SUCCESS; - -} - -int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep, *nsnode = NULL; - xmlNsPtr ns = NULL, curns; - char *strURI; - char *prefix; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - nsnode = nodep; - case XML_ATTRIBUTE_NODE: - if (nsnode == NULL) { - nsnode = nodep->parent; - if (nsnode == NULL) { - nsnode = xmlDocGetRootElement(nodep->doc); - } - } - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - prefix = Z_STRVAL_P(newval); - if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) { - strURI = (char *) nodep->ns->href; - if (strURI == NULL || - (!strcmp (prefix, "xml") && strcmp(strURI, XML_XML_NAMESPACE)) || - (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (prefix, "xmlns") && - strcmp (strURI, DOM_XMLNS_NAMESPACE)) || - (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (nodep->name, "xmlns"))) { - ns = NULL; - } else { - curns = nsnode->nsDef; - while (curns != NULL) { - if (xmlStrEqual((xmlChar *)prefix, curns->prefix) && xmlStrEqual(nodep->ns->href, curns->href)) { - ns = curns; - break; - } - curns = curns->next; - } - if (ns == NULL) { - ns = xmlNewNs(nsnode, nodep->ns->href, (xmlChar *)prefix); - } - } - - if (ns == NULL) { - if (newval == &value_copy) { - zval_dtor(newval); - } - php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document) TSRMLS_CC); - return FAILURE; - } - - xmlSetNs(nodep, ns); - } - if (newval == &value_copy) { - zval_dtor(newval); - } - break; - default: - break; - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ localName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSLocalN -Since: DOM Level 2 -*/ -int dom_node_local_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE || nodep->type == XML_NAMESPACE_DECL) { - ZVAL_STRING(*retval, (char *) (nodep->name), 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ baseURI string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-baseURI -Since: DOM Level 3 -*/ -int dom_node_base_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlChar *baseuri; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - baseuri = xmlNodeGetBase(nodep->doc, nodep); - if (baseuri) { - ZVAL_STRING(*retval, (char *) (baseuri), 1); - xmlFree(baseuri); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ textContent string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-textContent -Since: DOM Level 3 -*/ -int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - str = xmlNodeGetContent(nodep); - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - xmlFree(str); - - return SUCCESS; -} - -int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - -static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, - xmlNodePtr nextsib, xmlNodePtr fragment, - dom_object *intern, dom_object *childobj TSRMLS_DC) -{ - xmlNodePtr newchild, node; - - newchild = fragment->children; - - if (newchild) { - if (prevsib == NULL) { - nodep->children = newchild; - } else { - prevsib->next = newchild; - } - newchild->prev = prevsib; - if (nextsib == NULL) { - nodep->last = fragment->last; - } else { - fragment->last->next = nextsib; - nextsib->prev = fragment->last; - } - - node = newchild; - while (node != NULL) { - node->parent = nodep; - if (node->doc != nodep->doc) { - xmlSetTreeDoc(node, nodep->doc); - if (node->_private != NULL) { - childobj = node->_private; - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - } - if (node == fragment->last) { - break; - } - node = node->next; - } - - fragment->children = NULL; - fragment->last = NULL; - } - - return newchild; -} - -/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727 -Since: -*/ -PHP_FUNCTION(dom_node_insert_before) -{ - zval *id, *node, *ref = NULL, *rv = NULL; - xmlNodePtr child, new_child, parentp, refp; - dom_object *intern, *childobj, *refpobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry), &ref, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(parentp, id, xmlNodePtr, intern); - - if (dom_node_children_valid(parentp) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - new_child = NULL; - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(parentp) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(parentp, child) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->doc != parentp->doc && child->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty"); - RETURN_FALSE; - } - - if (child->doc == NULL && parentp->doc != NULL) { - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - - if (ref != NULL) { - DOM_GET_OBJ(refp, ref, xmlNodePtr, refpobj); - if (refp->parent != parentp) { - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->parent != NULL) { - xmlUnlinkNode(child); - } - - if (child->type == XML_TEXT_NODE && (refp->type == XML_TEXT_NODE || - (refp->prev != NULL && refp->prev->type == XML_TEXT_NODE))) { - if (child->doc == NULL) { - xmlSetTreeDoc(child, parentp->doc); - } - new_child = child; - new_child->parent = refp->parent; - new_child->next = refp; - new_child->prev = refp->prev; - refp->prev = new_child; - if (new_child->prev != NULL) { - new_child->prev->next = new_child; - } - if (new_child->parent != NULL) { - if (new_child->parent->children == refp) { - new_child->parent->children = new_child; - } - } - - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(refp->parent, child->name); - else - lastattr = xmlHasNsProp(refp->parent, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } else { - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj TSRMLS_CC); - } - - if (new_child == NULL) { - new_child = xmlAddPrevSibling(refp, child); - } - } else { - if (child->parent == parentp){ - xmlUnlinkNode(child); - } - if (child->type == XML_TEXT_NODE && parentp->last != NULL && parentp->last->type == XML_TEXT_NODE) { - child->parent = parentp; - if (child->doc == NULL) { - xmlSetTreeDoc(child, parentp->doc); - } - new_child = child; - if (parentp->children == NULL) { - parentp->children = child; - parentp->last = child; - } else { - child = parentp->last; - child->next = new_child; - new_child->prev = child; - parentp->last = new_child; - } - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(parentp, child->name); - else - lastattr = xmlHasNsProp(parentp, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } else { - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj TSRMLS_CC); - } - if (new_child == NULL) { - new_child = xmlAddChild(parentp, child); - } - } - - if (NULL == new_child) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't add newnode as the previous sibling of refnode"); - RETURN_FALSE; - } - - dom_reconcile_ns(parentp->doc, new_child); - - DOM_RET_OBJ(rv, new_child, &ret, intern); - -} -/* }}} end dom_node_insert_before */ - - -/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307 -Since: -*/ -PHP_FUNCTION(dom_node_replace_child) -{ - zval *id, *newnode, *oldnode; - xmlNodePtr children, newchild, oldchild, nodep; - dom_object *intern, *newchildobj, *oldchildobj; - int foundoldchild = 0, stricterror; - - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, U_CLASS_ENTRY(dom_node_class_entry), &newnode, U_CLASS_ENTRY(dom_node_class_entry), &oldnode, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(newchild, newnode, xmlNodePtr, newchildobj); - DOM_GET_OBJ(oldchild, oldnode, xmlNodePtr, oldchildobj); - - children = nodep->children; - if (!children) { - RETURN_FALSE; - } - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (newchild->parent != NULL && dom_node_is_read_only(newchild->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (newchild->doc != nodep->doc && newchild->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(nodep, newchild) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - /* check for the old child and wether the new child is already a child */ - while (children) { - if (children == oldchild) { - foundoldchild = 1; - break; - } - children = children->next; - } - - if (foundoldchild) { - xmlNodePtr node; - zval *rv = NULL; - - if (newchild->type == XML_DOCUMENT_FRAG_NODE) { - xmlNodePtr prevsib, nextsib; - prevsib = oldchild->prev; - nextsib = oldchild->next; - - xmlUnlinkNode(oldchild); - - newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj TSRMLS_CC); - if (newchild) { - dom_reconcile_ns(nodep->doc, newchild); - } - } else if (oldchild != newchild) { - if (newchild->doc == NULL && nodep->doc != NULL) { - xmlSetTreeDoc(newchild, nodep->doc); - newchildobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL TSRMLS_CC); - } - node = xmlReplaceNode(oldchild, newchild); - dom_reconcile_ns(nodep->doc, newchild); - } - DOM_RET_OBJ(rv, oldchild, &ret, intern); - return; - } else { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } -} -/* }}} end dom_node_replace_child */ - - -/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066 -Since: -*/ -PHP_FUNCTION(dom_node_remove_child) -{ - zval *id, *node; - xmlNodePtr children, child, nodep; - dom_object *intern, *childobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - children = nodep->children; - if (!children) { - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - while (children) { - if (children == child) { - zval *rv = NULL; - xmlUnlinkNode(child); - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - children = children->next; - } - - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE -} -/* }}} end dom_node_remove_child */ - - -/* {{{ proto DomNode dom_node_append_child(DomNode newChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107 -Since: -*/ -PHP_FUNCTION(dom_node_append_child) -{ - zval *id, *node, *rv = NULL; - xmlNodePtr child, nodep, new_child = NULL; - dom_object *intern, *childobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(nodep, child) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (!(child->doc == NULL || child->doc == nodep->doc)) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty"); - RETURN_FALSE; - } - - if (child->doc == NULL && nodep->doc != NULL) { - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - - if (child->parent != NULL){ - xmlUnlinkNode(child); - } - - if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) { - child->parent = nodep; - if (child->doc == NULL) { - xmlSetTreeDoc(child, nodep->doc); - } - new_child = child; - if (nodep->children == NULL) { - nodep->children = child; - nodep->last = child; - } else { - child = nodep->last; - child->next = new_child; - new_child->prev = child; - nodep->last = new_child; - } - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(nodep, child->name); - else - lastattr = xmlHasNsProp(nodep, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj TSRMLS_CC); - } - - if (new_child == NULL) { - new_child = xmlAddChild(nodep, child); - if (new_child == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't append node"); - RETURN_FALSE; - } - } - - dom_reconcile_ns(nodep->doc, new_child); - - DOM_RET_OBJ(rv, new_child, &ret, intern); -} -/* }}} end dom_node_append_child */ - - -/* {{{ proto boolean dom_node_has_child_nodes(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-810594187 -Since: -*/ -PHP_FUNCTION(dom_node_has_child_nodes) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - if (nodep->children) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_has_child_nodes */ - - -/* {{{ proto DomNode dom_node_clone_node(boolean deep); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4 -Since: -*/ -PHP_FUNCTION(dom_node_clone_node) -{ - zval *rv = NULL; - zval *id; - xmlNode *n, *node; - int ret; - dom_object *intern; - long recursive = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, U_CLASS_ENTRY(dom_node_class_entry), &recursive) == FAILURE) { - return; - } - - DOM_GET_OBJ(n, id, xmlNodePtr, intern); - - node = xmlDocCopyNode(n, n->doc, recursive); - - if (!node) { - RETURN_FALSE; - } - - /* When deep is false Element nodes still require the attributes - Following taken from libxml as xmlDocCopyNode doesnt do this */ - if (n->type == XML_ELEMENT_NODE && recursive == 0) { - if (n->nsDef != NULL) { - node->nsDef = xmlCopyNamespaceList(n->nsDef); - } - if (n->ns != NULL) { - xmlNsPtr ns; - ns = xmlSearchNs(n->doc, node, n->ns->prefix); - if (ns == NULL) { - ns = xmlSearchNs(n->doc, n, n->ns->prefix); - if (ns != NULL) { - xmlNodePtr root = node; - - while (root->parent != NULL) { - root = root->parent; - } - node->ns = xmlNewNs(root, ns->href, ns->prefix); - } - } else { - node->ns = ns; - } - } - if (n->properties != NULL) { - node->properties = xmlCopyPropList(node, n->properties); - } - } - - /* If document cloned we want a new document proxy */ - if (node->doc != n->doc) { - intern = NULL; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_node_clone_node */ - - - -/* {{{ proto void dom_node_normalize(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize -Since: -*/ -PHP_FUNCTION(dom_node_normalize) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - dom_normalize(nodep TSRMLS_CC); - -} -/* }}} end dom_node_normalize */ - - -/* {{{ proto boolean dom_node_is_supported(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Level-2-Core-Node-supports -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_node_is_supported) -{ - zval *id; - int feature_len, version_len; - char *feature, *version; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_node_class_entry), &feature, &feature_len, &version, &version_len) == FAILURE) { - return; - } - - if (dom_has_feature(feature, version)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_is_supported */ - - -/* {{{ proto boolean dom_node_has_attributes(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeHasAttrs -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_node_has_attributes) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (nodep->type != XML_ELEMENT_NODE) - RETURN_FALSE; - - if (nodep->properties) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_has_attributes */ - -/* {{{ proto short dom_node_compare_document_position(DomNode other); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_compare_document_position) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_compare_document_position */ - - -/* {{{ proto boolean dom_node_is_same_node(DomNode other); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_same_node) -{ - zval *id, *node; - xmlNodePtr nodeotherp, nodep; - dom_object *intern, *nodeotherobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - DOM_GET_OBJ(nodeotherp, node, xmlNodePtr, nodeotherobj); - - if (nodep == nodeotherp) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_is_same_node */ - - -/* {{{ proto string dom_node_lookup_prefix(string namespaceURI); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_lookup_prefix) -{ - zval *id; - xmlNodePtr nodep, lookupp = NULL; - dom_object *intern; - xmlNsPtr nsptr; - int uri_len = 0; - char *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &uri, &uri_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (uri_len > 0) { - switch (nodep->type) { - case XML_ELEMENT_NODE: - lookupp = nodep; - break; - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - lookupp = xmlDocGetRootElement((xmlDocPtr) nodep); - break; - case XML_ENTITY_NODE : - case XML_NOTATION_NODE: - case XML_DOCUMENT_FRAG_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - RETURN_NULL(); - break; - default: - lookupp = nodep->parent; - } - - if (lookupp != NULL && (nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, uri))) { - if (nsptr->prefix != NULL) { - RETURN_STRING((char *) nsptr->prefix, 1); - } - } - } - - RETURN_NULL(); -} -/* }}} end dom_node_lookup_prefix */ - - -/* {{{ proto boolean dom_node_is_default_namespace(string namespaceURI); -URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_default_namespace) -{ - zval *id; - xmlNodePtr nodep; - dom_object *intern; - xmlNsPtr nsptr; - int uri_len = 0; - char *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &uri, &uri_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (uri_len > 0) { - nsptr = xmlSearchNs(nodep->doc, nodep, NULL); - if (nsptr && xmlStrEqual(nsptr->href, uri)) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} end dom_node_is_default_namespace */ - - -/* {{{ proto string dom_node_lookup_namespace_uri(string prefix); -URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_lookup_namespace_uri) -{ - zval *id; - xmlNodePtr nodep; - dom_object *intern; - xmlNsPtr nsptr; - int prefix_len = 0; - char *prefix; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &prefix, &prefix_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (prefix_len > 0) { - nsptr = xmlSearchNs(nodep->doc, nodep, prefix); - if (nsptr && nsptr->href != NULL) { - RETURN_STRING((char *) nsptr->href, 1); - } - } - - RETURN_NULL(); -} -/* }}} end dom_node_lookup_namespace_uri */ - - -/* {{{ proto boolean dom_node_is_equal_node(DomNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_equal_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_is_equal_node */ - - -/* {{{ proto DomNode dom_node_get_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_feature) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_feature */ - - -/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_set_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_set_user_data */ - - -/* {{{ proto DomUserData dom_node_get_user_data(string key); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_user_data */ -#endif diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c deleted file mode 100644 index db4798b4bd881..0000000000000 --- a/ext/dom/nodelist.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMNodeList -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-536297177 -* Since: -*/ - -zend_function_entry php_dom_nodelist_class_functions[] = { - PHP_FALIAS(item, dom_nodelist_item, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337 -Since: -*/ -int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count = 0; - HashTable *nodeht; - - objmap = (dom_nnodemap_object *)obj->ptr; - if (objmap != NULL) { - if (objmap->ht) { - count = xmlHashSize(objmap->ht); - } else { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - count = zend_hash_num_elements(nodeht); - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - curnode = nodep->children; - if (curnode) { - count++; - while (curnode->next != NULL) { - count++; - curnode = curnode->next; - } - } - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, -1); - } - } - } - } - } - - MAKE_STD_ZVAL(*retval); - ZVAL_LONG(*retval, count); - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto DOMNode dom_nodelist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136 -Since: -*/ -PHP_FUNCTION(dom_nodelist_item) -{ - zval *id, *rv = NULL; - long index; - int ret; - dom_object *intern; - xmlNodePtr itemnode = NULL; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count = 0; - HashTable *nodeht; - pval **entry; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_nodelist_class_entry), &index) == FAILURE) { - return; - } - - if (index >= 0) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - if (objmap != NULL) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = php_dom_libxml_hash_iter(objmap->ht, index); - } else { - itemnode = php_dom_libxml_notation_iter(objmap->ht, index); - } - } else { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - if (zend_hash_index_find(nodeht, index, (void **) &entry)==SUCCESS) { - *return_value = **entry; - zval_copy_ctor(return_value); - return; - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - curnode = nodep->children; - while (count < index && curnode != NULL) { - count++; - curnode = curnode->next; - } - itemnode = curnode; - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - itemnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, index); - } - } - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } - } - - RETVAL_NULL(); -} -/* }}} end dom_nodelist_item */ -#endif diff --git a/ext/dom/notation.c b/ext/dom/notation.c deleted file mode 100644 index 91ab32764a624..0000000000000 --- a/ext/dom/notation.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMNotation extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9 -* Since: -*/ - -zend_function_entry php_dom_notation_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0 -Since: -*/ -int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNotationPtr nodep; - - nodep = (xmlNotationPtr) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->PublicID) { - ZVAL_STRING(*retval, (char *) (nodep->PublicID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0 -Since: -*/ -int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNotationPtr nodep; - - nodep = (xmlNotationPtr) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->SystemID) { - ZVAL_STRING(*retval, (char *) (nodep->PublicID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c deleted file mode 100644 index a6ff59ad1e6d3..0000000000000 --- a/ext/dom/php_dom.c +++ /dev/null @@ -1,1477 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - | Marcus Borger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "ext/standard/php_rand.h" -#include "php_dom.h" -#include "dom_properties.h" - -#include "ext/standard/info.h" -#define PHP_XPATH 1 -#define PHP_XPTR 2 - -zend_class_entry *dom_node_class_entry; -zend_class_entry *dom_domexception_class_entry; -zend_class_entry *dom_domstringlist_class_entry; -zend_class_entry *dom_namelist_class_entry; -zend_class_entry *dom_domimplementationlist_class_entry; -zend_class_entry *dom_domimplementationsource_class_entry; -zend_class_entry *dom_domimplementation_class_entry; -zend_class_entry *dom_documentfragment_class_entry; -zend_class_entry *dom_document_class_entry; -zend_class_entry *dom_nodelist_class_entry; -zend_class_entry *dom_namednodemap_class_entry; -zend_class_entry *dom_characterdata_class_entry; -zend_class_entry *dom_attr_class_entry; -zend_class_entry *dom_element_class_entry; -zend_class_entry *dom_text_class_entry; -zend_class_entry *dom_comment_class_entry; -zend_class_entry *dom_typeinfo_class_entry; -zend_class_entry *dom_userdatahandler_class_entry; -zend_class_entry *dom_domerror_class_entry; -zend_class_entry *dom_domerrorhandler_class_entry; -zend_class_entry *dom_domlocator_class_entry; -zend_class_entry *dom_domconfiguration_class_entry; -zend_class_entry *dom_cdatasection_class_entry; -zend_class_entry *dom_documenttype_class_entry; -zend_class_entry *dom_notation_class_entry; -zend_class_entry *dom_entity_class_entry; -zend_class_entry *dom_entityreference_class_entry; -zend_class_entry *dom_processinginstruction_class_entry; -zend_class_entry *dom_string_extend_class_entry; -#if defined(LIBXML_XPATH_ENABLED) -zend_class_entry *dom_xpath_class_entry; -#endif -zend_class_entry *dom_namespace_node_class_entry; - -zend_object_handlers dom_object_handlers; -zend_object_handlers dom_ze1_object_handlers; - -static HashTable classes; -static HashTable u_classes; - -typedef int (*dom_read_t)(dom_object *obj, zval **retval TSRMLS_DC); -typedef int (*dom_write_t)(dom_object *obj, zval *newval TSRMLS_DC); - -typedef struct _dom_prop_handler { - dom_read_t read_func; - dom_write_t write_func; -} dom_prop_handler; - -/* {{{ int dom_node_is_read_only(xmlNodePtr node) */ -int dom_node_is_read_only(xmlNodePtr node) { - switch (node->type) { - case XML_ENTITY_REF_NODE: - case XML_ENTITY_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_NOTATION_NODE: - case XML_DTD_NODE: - case XML_ELEMENT_DECL: - case XML_ATTRIBUTE_DECL: - case XML_ENTITY_DECL: - case XML_NAMESPACE_DECL: - return SUCCESS; - break; - default: - if (node->doc == NULL) { - return SUCCESS; - } else { - return FAILURE; - } - } -} -/* }}} end dom_node_is_read_only */ - -/* {{{ int dom_node_children_valid(xmlNodePtr node) */ -int dom_node_children_valid(xmlNodePtr node) { - switch (node->type) { - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - case XML_PI_NODE: - case XML_COMMENT_NODE: - case XML_TEXT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_NOTATION_NODE: - return FAILURE; - break; - default: - return SUCCESS; - } -} -/* }}} end dom_node_children_valid */ - -/* {{{ dom_get_doc_props() */ -dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document) -{ - dom_doc_props *doc_props; - - if (document && document->doc_props) { - return document->doc_props; - } else { - doc_props = emalloc(sizeof(dom_doc_props)); - doc_props->formatoutput = 0; - doc_props->validateonparse = 0; - doc_props->resolveexternals = 0; - doc_props->preservewhitespace = 1; - doc_props->substituteentities = 0; - doc_props->stricterror = 1; - doc_props->recover = 0; - if (document) { - document->doc_props = doc_props; - } - return doc_props; - } -} -/* }}} */ - -/* {{{ dom_get_strict_error() */ -int dom_get_strict_error(php_libxml_ref_obj *document) { - int stricterror; - dom_doc_props *doc_props; - - doc_props = dom_get_doc_props(document); - stricterror = doc_props->stricterror; - if (document == NULL) { - efree(doc_props); - } - - return stricterror; -} -/* }}} */ - -/* {{{ xmlNodePtr dom_object_get_node(dom_object *obj) */ -xmlNodePtr dom_object_get_node(dom_object *obj) -{ - if (obj->ptr != NULL) { - return ((php_libxml_node_ptr *)obj->ptr)->node; - } else { - return NULL; - } -} -/* }}} end dom_object_get_node */ - -/* {{{ dom_object *php_dom_object_get_data(xmlNodePtr obj) */ -dom_object *php_dom_object_get_data(xmlNodePtr obj) -{ - if (obj->_private != NULL) { - return (dom_object *) ((php_libxml_node_ptr *) obj->_private)->_private; - } else { - return NULL; - } -} -/* }}} end php_dom_object_get_data */ - -/* {{{ dom_read_na */ -static int dom_read_na(dom_object *obj, zval **retval TSRMLS_DC) -{ - *retval = NULL; - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property"); - return FAILURE; -} -/* }}} */ - -/* {{{ dom_write_na */ -static int dom_write_na(dom_object *obj, zval *newval TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property"); - return FAILURE; -} -/* }}} */ - -/* {{{ dom_register_prop_handler */ -static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func TSRMLS_DC) -{ - dom_prop_handler hnd; - - hnd.read_func = read_func ? read_func : dom_read_na; - hnd.write_func = write_func ? write_func : dom_write_na; - zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(dom_prop_handler), NULL); -} -/* }}} */ - -static zval **dom_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - zval **retval = NULL; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret = FAILURE; - - if (member->type != IS_STRING && member->type != IS_UNICODE) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_text(&tmp_member); - member = &tmp_member; - } - - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_u_hash_find(obj->prop_handler, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, (void **) &hnd); - } - if (ret == FAILURE) { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->get_property_ptr_ptr(object, member TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - -/* {{{ dom_read_property */ -zval *dom_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - zval *retval; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING && member->type != IS_UNICODE) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_text(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_u_hash_find(obj->prop_handler, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - ret = hnd->read_func(obj, &retval TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - retval->refcount = 0; - retval->is_ref = 0; - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -/* {{{ dom_write_property */ -void dom_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING && member->type != IS_UNICODE) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_text(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_u_hash_find((HashTable *)obj->prop_handler, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - hnd->write_func(obj, value TSRMLS_CC); - } else { - std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } -} -/* }}} */ - - -void *php_dom_export_node(zval *object TSRMLS_DC) -{ - php_libxml_node_object *intern; - xmlNodePtr nodep = NULL; - - intern = (php_libxml_node_object *)zend_object_store_get_object(object TSRMLS_CC); - if (intern && intern->node) { - nodep = intern->node->node; - } - - return nodep; -} - -/* {{{ proto somNode dom_import_simplexml(sxeobject node) - Get a simplexml_element object from dom to allow for processing */ -PHP_FUNCTION(dom_import_simplexml) -{ -#ifdef HAVE_SIMPLEXML - zval *rv = NULL; - zval *node; - xmlNodePtr nodep = NULL; - php_libxml_node_object *nodeobj; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { - return; - } - - nodeobj = (php_libxml_node_object *)zend_object_store_get_object(node TSRMLS_CC); - nodep = php_libxml_import_node(node TSRMLS_CC); - - if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) { - DOM_RET_OBJ(rv, (xmlNodePtr) nodep, &ret, (dom_object *)nodeobj); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import"); - RETURN_NULL(); - } -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SimpleXML support is not enabled"); - return; -#endif -} -/* }}} */ - -zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - void *new_object; - dom_object *intern; - dom_object *old_object; - struct _store_object *obj; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - if (obj->clone == NULL) { - php_error(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_P(zobject)->name); - } - - obj->clone(obj->object, &new_object TSRMLS_CC); - - retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC); - intern = (dom_object *) new_object; - intern->handle = retval.handle; - retval.handlers = Z_OBJ_HT_P(zobject); - - old_object = (dom_object *) obj->object; - zend_objects_clone_members(&intern->std, retval, &old_object->std, intern->handle TSRMLS_CC); - - return retval; -} - -zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC) -{ - php_error(E_ERROR, "Cannot clone object of class %v due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name); - /* Return zobject->value.obj just to satisfy compiler */ - return zobject->value.obj; -} - -static zend_function_entry dom_functions[] = { - PHP_FE(dom_import_simplexml, NULL) - {NULL, NULL, NULL} -}; - -static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) { - if (EG(ze1_compatibility_mode)) { - return &dom_ze1_object_handlers; - } else { - return &dom_object_handlers; - } -} - -static zend_module_dep dom_deps[] = { - ZEND_MOD_REQUIRED("libxml") - ZEND_MOD_CONFLICTS("domxml") -#ifdef HAVE_SIMPLEXML - ZEND_MOD_REQUIRED("simplexml") -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry dom_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - dom_deps, - "dom", - dom_functions, - PHP_MINIT(dom), - PHP_MSHUTDOWN(dom), - NULL, - NULL, - PHP_MINFO(dom), - DOM_API_VERSION, /* Extension versionnumber */ - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DOM -ZEND_GET_MODULE(dom) -#endif - -static void dom_prop_handlers_dtor(HashTable *ht) -{ - zend_hash_destroy(ht); -} - -static void dom_prop_handlers_ctor(HashTable *ht) -{ - HashTable tmp = *ht; - - zend_u_hash_init(ht, 0, NULL, NULL, 1, 1); - zend_hash_copy(ht, &tmp, NULL, NULL, sizeof(dom_prop_handler)); -} - -/* {{{ PHP_MINIT_FUNCTION(dom) */ -PHP_MINIT_FUNCTION(dom) -{ - zend_class_entry ce; - HashTable dom_domstringlist_prop_handlers; - HashTable dom_namelist_prop_handlers; - HashTable dom_domimplementationlist_prop_handlers; - HashTable dom_document_prop_handlers; - HashTable dom_node_prop_handlers; - HashTable dom_document_fragment_prop_handlers; - HashTable dom_nodelist_prop_handlers; - HashTable dom_namednodemap_prop_handlers; - HashTable dom_characterdata_prop_handlers; - HashTable dom_attr_prop_handlers; - HashTable dom_element_prop_handlers; - HashTable dom_text_prop_handlers; - HashTable dom_cdata_prop_handlers; - HashTable dom_comment_prop_handlers; - HashTable dom_typeinfo_prop_handlers; - HashTable dom_domerror_prop_handlers; - HashTable dom_domlocator_prop_handlers; - HashTable dom_documenttype_prop_handlers; - HashTable dom_notation_prop_handlers; - HashTable dom_entity_prop_handlers; - HashTable dom_processinginstruction_prop_handlers; - HashTable dom_namespace_node_prop_handlers; - HashTable dom_entity_reference_prop_handlers; -#if defined(LIBXML_XPATH_ENABLED) - HashTable dom_xpath_prop_handlers; -#endif - - memcpy(&dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - dom_object_handlers.read_property = dom_read_property; - dom_object_handlers.write_property = dom_write_property; - dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr; - dom_object_handlers.clone_obj = dom_objects_store_clone_obj; - - memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - dom_ze1_object_handlers.read_property = dom_read_property; - dom_ze1_object_handlers.write_property = dom_write_property; - dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr; - dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj; - - zend_hash_init(&classes, 0, NULL, (void (*)(void *))dom_prop_handlers_dtor, 1); - - INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions); - dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL; - zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); - - REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry); - - zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domstringlist_prop_handlers, sizeof(dom_domstringlist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry); - - zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namelist_prop_handlers, sizeof(dom_namelist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry); - - zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domimplementationlist_prop_handlers, sizeof(dom_domimplementationlist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry); - REGISTER_DOM_CLASS(ce, "DOMImplementation", NULL, php_dom_domimplementation_class_functions, dom_domimplementation_class_entry); - - REGISTER_DOM_CLASS(ce, "DOMNode", NULL, php_dom_node_class_functions, dom_node_class_entry); - - zend_hash_init(&dom_node_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNameSpaceNode", NULL, NULL, dom_namespace_node_class_entry); - - zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namespace_node_prop_handlers, sizeof(dom_namespace_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocumentFragment", dom_node_class_entry, php_dom_documentfragment_class_functions, dom_documentfragment_class_entry); - zend_hash_init(&dom_document_fragment_prop_handlers, 0, NULL, NULL, 1); - zend_hash_copy(&dom_document_fragment_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler)); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_document_fragment_prop_handlers, sizeof(dom_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocument", dom_node_class_entry, php_dom_document_class_functions, dom_document_class_entry); - zend_hash_init(&dom_document_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC); - - zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_document_prop_handlers, sizeof(dom_document_prop_handlers), NULL); - - INIT_CLASS_ENTRY(ce, "DOMNodeList", php_dom_nodelist_class_functions); - ce.create_object = dom_nnodemap_objects_new; - dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - dom_nodelist_class_entry->get_iterator = php_dom_get_iterator; - - zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_nodelist_prop_handlers, sizeof(dom_nodelist_prop_handlers), NULL); - - INIT_CLASS_ENTRY(ce, "DOMNamedNodeMap", php_dom_namednodemap_class_functions); - ce.create_object = dom_nnodemap_objects_new; - dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator; - - zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namednodemap_prop_handlers, sizeof(dom_namednodemap_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMCharacterData", dom_node_class_entry, php_dom_characterdata_class_functions, dom_characterdata_class_entry); - - zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write TSRMLS_CC); - dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_characterdata_prop_handlers, sizeof(dom_characterdata_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMAttr", dom_node_class_entry, php_dom_attr_class_functions, dom_attr_class_entry); - - zend_hash_init(&dom_attr_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_attr_prop_handlers, sizeof(dom_attr_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMElement", dom_node_class_entry, php_dom_element_class_functions, dom_element_class_entry); - - zend_hash_init(&dom_element_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_element_prop_handlers, sizeof(dom_element_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMText", dom_characterdata_class_entry, php_dom_text_class_functions, dom_text_class_entry); - - zend_hash_init(&dom_text_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_text_prop_handlers, sizeof(dom_text_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMComment", dom_characterdata_class_entry, php_dom_comment_class_functions, dom_comment_class_entry); - zend_hash_init(&dom_comment_prop_handlers, 0, NULL, NULL, 1); - zend_hash_copy(&dom_comment_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler)); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_comment_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry); - - zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_typeinfo_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry); - - zend_hash_init(&dom_domerror_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domerror_prop_handlers, sizeof(dom_domerror_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry); - - zend_hash_init(&dom_domlocator_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domlocator_prop_handlers, sizeof(dom_domlocator_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry); - REGISTER_DOM_CLASS(ce, "DOMCdataSection", dom_text_class_entry, php_dom_cdatasection_class_functions, dom_cdatasection_class_entry); - zend_hash_init(&dom_cdata_prop_handlers, 0, NULL, NULL, 1); - zend_hash_copy(&dom_cdata_prop_handlers, &dom_text_prop_handlers, NULL, NULL, sizeof(dom_prop_handler)); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_cdata_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocumentType", dom_node_class_entry, php_dom_documenttype_class_functions, dom_documenttype_class_entry); - - zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_documenttype_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNotation", NULL, php_dom_notation_class_functions, dom_notation_class_entry); - - zend_hash_init(&dom_notation_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL TSRMLS_CC); - /* Notation nodes are special */ - dom_register_prop_handler(&dom_notation_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_notation_prop_handlers, sizeof(dom_notation_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMEntity", dom_node_class_entry, php_dom_entity_class_functions, dom_entity_class_entry); - - zend_hash_init(&dom_entity_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write TSRMLS_CC); - zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_entity_prop_handlers, sizeof(dom_entity_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMEntityReference", dom_node_class_entry, php_dom_entityreference_class_functions, dom_entityreference_class_entry); - zend_hash_init(&dom_entity_reference_prop_handlers, 0, NULL, NULL, 1); - zend_hash_copy(&dom_entity_reference_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler)); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_entity_reference_prop_handlers, sizeof(dom_entity_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMProcessingInstruction", dom_node_class_entry, php_dom_processinginstruction_class_functions, dom_processinginstruction_class_entry); - - zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write TSRMLS_CC); - zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_processinginstruction_prop_handlers, sizeof(dom_processinginstruction_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMStringExtend", NULL, php_dom_string_extend_class_functions, dom_string_extend_class_entry); - -#if defined(LIBXML_XPATH_ENABLED) - INIT_CLASS_ENTRY(ce, "DOMXPath", php_dom_xpath_class_functions); - ce.create_object = dom_xpath_objects_new; - dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_xpath_prop_handlers, sizeof(dom_xpath_prop_handlers), NULL); -#endif - - REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NODE", XML_ATTRIBUTE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_TEXT_NODE", XML_TEXT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_CDATA_SECTION_NODE", XML_CDATA_SECTION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_REF_NODE", XML_ENTITY_REF_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_NODE", XML_ENTITY_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_PI_NODE", XML_PI_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_COMMENT_NODE", XML_COMMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_NODE", XML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_TYPE_NODE", XML_DOCUMENT_TYPE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_FRAG_NODE", XML_DOCUMENT_FRAG_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NOTATION_NODE", XML_NOTATION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_HTML_DOCUMENT_NODE", XML_HTML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DTD_NODE", XML_DTD_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ELEMENT_DECL_NODE", XML_ELEMENT_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_DECL_NODE", XML_ATTRIBUTE_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_DECL_NODE", XML_ENTITY_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NAMESPACE_DECL_NODE", XML_NAMESPACE_DECL, CONST_CS | CONST_PERSISTENT); -#ifdef XML_GLOBAL_NAMESPACE - REGISTER_LONG_CONSTANT("XML_GLOBAL_NAMESPACE", XML_GLOBAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("XML_LOCAL_NAMESPACE", XML_LOCAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_CDATA", XML_ATTRIBUTE_CDATA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ID", XML_ATTRIBUTE_ID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREF", XML_ATTRIBUTE_IDREF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREFS", XML_ATTRIBUTE_IDREFS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENTITY", XML_ATTRIBUTE_ENTITIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKEN", XML_ATTRIBUTE_NMTOKEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKENS", XML_ATTRIBUTE_NMTOKENS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT); - - /* DOMException Codes */ - REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INDEX_SIZE_ERR", INDEX_SIZE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_WRONG_DOCUMENT_ERR", WRONG_DOCUMENT_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_CHARACTER_ERR", INVALID_CHARACTER_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NO_DATA_ALLOWED_ERR", NO_DATA_ALLOWED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NO_MODIFICATION_ALLOWED_ERR", NO_MODIFICATION_ALLOWED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NOT_FOUND_ERR", NOT_FOUND_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NOT_SUPPORTED_ERR", NOT_SUPPORTED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INUSE_ATTRIBUTE_ERR", INUSE_ATTRIBUTE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_STATE_ERR", INVALID_STATE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_SYNTAX_ERR", SYNTAX_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_MODIFICATION_ERR", INVALID_MODIFICATION_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NAMESPACE_ERR", NAMESPACE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_ACCESS_ERR", INVALID_ACCESS_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_VALIDATION_ERR", VALIDATION_ERR, CONST_CS | CONST_PERSISTENT); - - php_libxml_register_export(dom_node_class_entry, php_dom_export_node); - - zend_u_hash_init(&u_classes, 0, NULL, (void (*)(void *))dom_prop_handlers_dtor, 1, 1); - zend_hash_copy(&u_classes, &classes, (copy_ctor_func_t)dom_prop_handlers_ctor, NULL, sizeof(HashTable)); - - return SUCCESS; -} -/* }}} */ - -/* {{{ */ -PHP_MINFO_FUNCTION(dom) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "DOM/XML", "enabled"); - php_info_print_table_row(2, "DOM/XML API Version", DOM_API_VERSION); - php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION); -#if defined(LIBXML_HTML_ENABLED) - php_info_print_table_row(2, "HTML Support", "enabled"); -#endif -#if defined(LIBXML_XPATH_ENABLED) - php_info_print_table_row(2, "XPath Support", "enabled"); -#endif -#if defined(LIBXML_XPTR_ENABLED) - php_info_print_table_row(2, "XPointer Support", "enabled"); -#endif -#ifdef LIBXML_SCHEMAS_ENABLED - php_info_print_table_row(2, "Schema Support", "enabled"); - php_info_print_table_row(2, "RelaxNG Support", "enabled"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -PHP_MSHUTDOWN_FUNCTION(dom) -{ - zend_hash_destroy(&classes); - zend_hash_destroy(&u_classes); - -/* If you want do find memleaks in this module, compile libxml2 with --with-mem-debug and - uncomment the following line, this will tell you the amount of not freed memory - and the total used memory into apaches error_log */ -/* xmlMemoryDump();*/ - - return SUCCESS; -} - -/* {{{ node_list_unlink */ -void node_list_unlink(xmlNodePtr node TSRMLS_DC) -{ - dom_object *wrapper; - - while (node != NULL) { - - wrapper = php_dom_object_get_data(node); - - if (wrapper != NULL ) { - xmlUnlinkNode(node); - } else { - node_list_unlink(node->children TSRMLS_CC); - - switch (node->type) { - case XML_ATTRIBUTE_DECL: - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_ENTITY_DECL: - case XML_ATTRIBUTE_NODE: - break; - default: - node_list_unlink((xmlNodePtr) node->properties TSRMLS_CC); - } - - } - - node = node->next; - } -} -/* }}} end node_list_unlink */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ dom_xpath_objects_free_storage */ -void dom_xpath_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - if (intern->ptr != NULL) { - xmlXPathFreeContext((xmlXPathContextPtr) intern->ptr); - php_libxml_decrement_doc_ref((php_libxml_node_object *) intern TSRMLS_CC); - intern->ptr = NULL; - } - - efree(object); -} -/* }}} */ -#endif - -/* {{{ dom_objects_free_storage */ -void dom_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - int retcount; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node != NULL) { - if (((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) { - php_libxml_node_decrement_resource((php_libxml_node_object *) intern TSRMLS_CC); - } else { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - } - intern->ptr = NULL; - } - - efree(object); -} -/* }}} */ - -void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC) -{ - dom_nnodemap_object *mapptr; - zval *baseobj = NULL; - - mapptr = (dom_nnodemap_object *)intern->ptr; - if (basenode) { - MAKE_STD_ZVAL(baseobj); - baseobj->type = IS_OBJECT; - baseobj->is_ref = 1; - baseobj->value.obj.handle = basenode->handle; - baseobj->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C); - zval_copy_ctor(baseobj); - } - mapptr->baseobjptr = baseobj; - mapptr->baseobj = basenode; - mapptr->nodetype = ntype; - mapptr->ht = ht; - mapptr->local = local; - mapptr->ns = ns; - -} - -static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC) -{ - zend_class_entry *base_class; - zval *tmp; - dom_object *intern; - - intern = emalloc(sizeof(dom_object)); - intern->std.ce = class_type; - intern->std.in_get = 0; - intern->std.in_set = 0; - intern->ptr = NULL; - intern->prop_handler = NULL; - intern->document = NULL; - - base_class = class_type; - while(base_class->type != ZEND_INTERNAL_CLASS && base_class->parent != NULL) { - base_class = base_class->parent; - } - - zend_u_hash_find(UG(unicode)?&u_classes:&classes, UG(unicode)?IS_UNICODE:IS_STRING, base_class->name, base_class->name_length + 1, (void **) &intern->prop_handler); - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - if (hash_copy) { - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - - return intern; -} - -/* {{{ dom_objects_clone */ -void dom_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - dom_object *intern = (dom_object *) object; - dom_object *clone; - xmlNodePtr node; - xmlNodePtr cloned_node; - - clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC); - - if (instanceof_function(intern->std.ce, U_CLASS_ENTRY(dom_node_class_entry) TSRMLS_CC)) { - node = (xmlNodePtr)dom_object_get_node((dom_object *) object); - if (node != NULL) { - cloned_node = xmlDocCopyNode(node, node->doc, 1); - if (cloned_node != NULL) { - /* If we cloned a document then we must create new doc proxy */ - if (cloned_node->doc == node->doc) { - clone->document = intern->document; - } - php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone TSRMLS_CC); - } - - } - } - - *object_clone = (void *) clone; -} -/* }}} */ - -/* {{{ dom_objects_new */ -zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} -/* }}} */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) */ -zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} -/* }}} */ -#endif - -static void dom_nnodemap_object_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - zval *baseobj; - dom_object *intern; - dom_nnodemap_object *objmap; - - intern = (dom_object *)object; - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap) { - if (objmap->local) { - xmlFree(objmap->local); - } - if (objmap->ns) { - xmlFree(objmap->ns); - } - if (objmap->baseobjptr) { - baseobj = objmap->baseobjptr; - zval_ptr_dtor((zval **)&baseobj); - } - efree(objmap); - intern->ptr = NULL; - } - - -} - -void dom_nnodemap_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - - php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - efree(object); -} - -zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - dom_nnodemap_object *objmap; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - intern->ptr = emalloc(sizeof(dom_nnodemap_object)); - objmap = (dom_nnodemap_object *)intern->ptr; - objmap->baseobj = NULL; - objmap->baseobjptr = NULL; - objmap->nodetype = 0; - objmap->ht = NULL; - objmap->local = NULL; - objmap->ns = NULL; - - retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} - -void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) -{ - zend_class_entry *ce; - - if (ce_type == DOM_NAMEDNODEMAP) { - ce = U_CLASS_ENTRY(dom_namednodemap_class_entry); - } else { - ce = U_CLASS_ENTRY(dom_nodelist_class_entry); - } - - object_init_ex(return_value, ce); -} - -/* {{{ php_dom_create_object */ -zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wrapper_in, zval *return_value, dom_object *domobj TSRMLS_DC) -{ - zval *wrapper; - zend_class_entry *ce; - dom_object *intern; - - *found = 0; - - if (!obj) { - ALLOC_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((intern = (dom_object *) php_dom_object_get_data((void *) obj))) { - return_value->type = IS_OBJECT; - return_value->is_ref = 1; - return_value->value.obj.handle = intern->handle; - return_value->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C); - zval_copy_ctor(return_value); - *found = 1; - return return_value; - } - - wrapper = return_value; - - switch (obj->type) { - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - { - ce = U_CLASS_ENTRY(dom_document_class_entry); - break; - } - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - { - ce = U_CLASS_ENTRY(dom_documenttype_class_entry); - break; - } - case XML_ELEMENT_NODE: - { - ce = U_CLASS_ENTRY(dom_element_class_entry); - break; - } - case XML_ATTRIBUTE_NODE: - { - ce = U_CLASS_ENTRY(dom_attr_class_entry); - break; - } - case XML_TEXT_NODE: - { - ce = U_CLASS_ENTRY(dom_text_class_entry); - break; - } - case XML_COMMENT_NODE: - { - ce = U_CLASS_ENTRY(dom_comment_class_entry); - break; - } - case XML_PI_NODE: - { - ce = U_CLASS_ENTRY(dom_processinginstruction_class_entry); - break; - } - case XML_ENTITY_REF_NODE: - { - ce = U_CLASS_ENTRY(dom_entityreference_class_entry); - break; - } - case XML_ENTITY_DECL: - case XML_ELEMENT_DECL: - { - ce = U_CLASS_ENTRY(dom_entity_class_entry); - break; - } - case XML_CDATA_SECTION_NODE: - { - ce = U_CLASS_ENTRY(dom_cdatasection_class_entry); - break; - } - case XML_DOCUMENT_FRAG_NODE: - { - ce = U_CLASS_ENTRY(dom_documentfragment_class_entry); - break; - } - case XML_NOTATION_NODE: - { - ce = U_CLASS_ENTRY(dom_notation_class_entry); - break; - } - case XML_NAMESPACE_DECL: - { - ce = U_CLASS_ENTRY(dom_namespace_node_class_entry); - break; - } - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d", Z_TYPE_P(obj)); - ZVAL_NULL(wrapper); - return wrapper; - } - - object_init_ex(wrapper, ce); - - intern = (dom_object *)zend_objects_get_address(wrapper TSRMLS_CC); - if (obj->doc != NULL) { - if (domobj != NULL) { - intern->document = domobj->document; - } - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc TSRMLS_CC); - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern TSRMLS_CC); - return (wrapper); -} -/* }}} end php_domobject_new */ - - -void php_dom_create_implementation(zval **retval TSRMLS_DC) { - object_init_ex(*retval, U_CLASS_ENTRY(dom_domimplementation_class_entry)); -} - -/* {{{ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) */ -int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) -{ - xmlNodePtr nodep; - - if (parent == NULL || child == NULL || child->doc != parent->doc) { - return SUCCESS; - } - - nodep = parent; - - while (nodep) { - if (nodep == child) { - return FAILURE; - } - nodep = nodep->parent; - } - - return SUCCESS; -} -/* }}} end dom_hierarchy */ - -/* {{{ dom_has_feature(char *feature, char *version) */ -int dom_has_feature(char *feature, char *version) -{ - int retval = 0; - - if (!(strcmp (version, "1.0") && strcmp (version,"2.0") && strcmp(version, ""))) { - if ((!strcasecmp(feature, "Core") && !strcmp (version, "1.0")) || !strcasecmp(feature, "XML")) - retval = 1; - } - - return retval; -} -/* }}} end dom_has_feature */ - -xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index) -{ - xmlNodePtr ret = NULL; - - while (nodep != NULL && (*cur <= index || index == -1)) { - if (nodep->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(nodep->name, local) || xmlStrEqual("*", local)) { - if (ns == NULL || (nodep->ns != NULL && (xmlStrEqual(nodep->ns->href, ns) || xmlStrEqual("*", ns)))) { - if (*cur == index) { - ret = nodep; - break; - } - (*cur)++; - } - } - ret = dom_get_elements_by_tag_name_ns_raw(nodep->children, ns, local, cur, index); - if (ret != NULL) { - break; - } - } - nodep = nodep->next; - } - return ret; -} -/* }}} end dom_element_get_elements_by_tag_name_ns_raw */ - - -/* {{{ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) */ -void dom_normalize (xmlNodePtr nodep TSRMLS_DC) -{ - xmlNodePtr child, nextp, newnextp; - xmlAttrPtr attr; - xmlChar *strContent; - - child = nodep->children; - while(child != NULL) { - switch (child->type) { - case XML_TEXT_NODE: - nextp = child->next; - while (nextp != NULL) { - if (nextp->type == XML_TEXT_NODE) { - newnextp = nextp->next; - strContent = xmlNodeGetContent(nextp); - xmlNodeAddContent(child, strContent); - xmlFree(strContent); - xmlUnlinkNode(nextp); - php_libxml_node_free_resource(nextp TSRMLS_CC); - nextp = newnextp; - } else { - break; - } - } - break; - case XML_ELEMENT_NODE: - dom_normalize (child TSRMLS_CC); - attr = child->properties; - while (attr != NULL) { - dom_normalize((xmlNodePtr) attr TSRMLS_CC); - attr = attr->next; - } - break; - case XML_ATTRIBUTE_NODE: - dom_normalize (child TSRMLS_CC); - break; - default: - break; - } - child = child->next; - } -} -/* }}} end dom_normalize */ - - -/* {{{ void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) */ -void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) { - xmlNs *cur; - - if (doc == NULL) - return; - - if (doc->oldNs == NULL) { - doc->oldNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (doc->oldNs == NULL) { - return; - } - memset(doc->oldNs, 0, sizeof(xmlNs)); - doc->oldNs->type = XML_LOCAL_NAMESPACE; - doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); - doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); - } - - cur = doc->oldNs; - while (cur->next != NULL) { - cur = cur->next; - } - cur->next = ns; -} -/* }}} end dom_set_old_ns */ - -/* -http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS - -NAMESPACE_ERR: Raised if - -1. the qualifiedName is a malformed qualified name -2. the qualifiedName has a prefix and the namespaceURI is null -*/ - -/* {{{ int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) */ -int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) { - if (name_len == 0) { - return NAMESPACE_ERR; - } - - *localname = xmlSplitQName2(qname, (xmlChar **) prefix); - if (*localname == NULL) { - *localname = xmlStrdup(qname); - if (*prefix == NULL && uri_len == 0) { - return 0; - } - } - - /* 1 */ - if (xmlValidateQName((xmlChar *) qname, 0) != 0) { - return NAMESPACE_ERR; - } - - /* 2 */ - if (*prefix != NULL && uri_len == 0) { - return NAMESPACE_ERR; - } - - return 0; -} - - -/* -http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS - -NAMESPACE_ERR: Raised if - -3. the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces] -4. the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/" -5. the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns". -*/ - -/* {{{ xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) */ -xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) { - xmlNsPtr nsptr = NULL; - - *errorcode = 0; - - if (! ((prefix && !strcmp (prefix, "xml" ) && strcmp(uri, XML_XML_NAMESPACE)) || - (prefix && !strcmp (prefix, "xmlns") && strcmp(uri, DOM_XMLNS_NAMESPACE)) || - (prefix && !strcmp(uri, DOM_XMLNS_NAMESPACE) && strcmp (prefix, "xmlns")))) { - nsptr = xmlNewNs(nodep, uri, prefix); - } - - if (nsptr == NULL) { - *errorcode = NAMESPACE_ERR; - } - - return nsptr; - -} -/* }}} end dom_get_ns */ - -/* {{{ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) */ -xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) { - xmlNsPtr cur; - xmlNs *ret = NULL; - if (node == NULL) - return NULL; - - if (localName == NULL || xmlStrEqual(localName, "")) { - cur = node->nsDef; - while (cur != NULL) { - if (cur->prefix == NULL && cur->href != NULL) { - ret = cur; - break; - } - cur = cur->next; - } - } else { - cur = node->nsDef; - while (cur != NULL) { - if (cur->prefix != NULL && xmlStrEqual(localName, cur->prefix)) { - ret = cur; - break; - } - cur = cur->next; - } - } - return ret; -} -/* }}} end dom_get_nsdecl */ - -#endif /* HAVE_DOM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h deleted file mode 100644 index 210d2cfe1b47c..0000000000000 --- a/ext/dom/php_dom.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - | Marcus Borger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DOM_H -#define PHP_DOM_H - -extern zend_module_entry dom_module_entry; -#define phpext_dom_ptr &dom_module_entry - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#if defined(LIBXML_HTML_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPATH_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPTR_ENABLED) -#include -#endif -#ifdef PHP_WIN32 -#ifndef DOM_EXPORTS -#define DOM_EXPORTS -#endif -#endif - -#include "xml_common.h" -#include "ext/libxml/php_libxml.h" -#include "zend_exceptions.h" -#include "dom_ce.h" -/* DOM API_VERSION, please bump it up, if you change anything in the API - therefore it's easier for the script-programmers to check, what's working how - Can be checked with phpversion("dom"); -*/ -#define DOM_API_VERSION "20031129" -/* Define a custom type for iterating using an unused nodetype */ -#define DOM_NODESET XML_XINCLUDE_START - -typedef struct _dom_nnodemap_object { - dom_object *baseobj; - int nodetype; - xmlHashTable *ht; - xmlChar *local; - xmlChar *ns; - zval *baseobjptr; -} dom_nnodemap_object; - -typedef struct { - zend_object_iterator intern; - zval *curobj; -} php_dom_iterator; - -#include "dom_fe.h" - -dom_object *dom_object_get_data(xmlNodePtr obj); -dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document); -zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC); -zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC); -#if defined(LIBXML_XPATH_ENABLED) -zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC); -#endif -int dom_get_strict_error(php_libxml_ref_obj *document); -void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC); -void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC); -void node_list_unlink(xmlNodePtr node TSRMLS_DC); -int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len); -xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix); -void dom_set_old_ns(xmlDoc *doc, xmlNs *ns); -xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName); -void dom_normalize (xmlNodePtr nodep TSRMLS_DC); -xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index); -void php_dom_create_implementation(zval **retval TSRMLS_DC); -int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child); -int dom_has_feature(char *feature, char *version); -int dom_node_is_read_only(xmlNodePtr node); -int dom_node_children_valid(xmlNodePtr node); -void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC); -void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC); -xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); -xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC); - -#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = dom_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); - -#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (dom_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %v", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ -} - -#define DOM_NO_ARGS() \ - if (ZEND_NUM_ARGS() != 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects exactly 0 parameters, %d given", ZEND_NUM_ARGS()); \ - return; \ - } - -#define DOM_NOT_IMPLEMENTED() \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); \ - return; - -#define DOM_NODELIST 0 -#define DOM_NAMEDNODEMAP 1 - -PHP_MINIT_FUNCTION(dom); -PHP_MSHUTDOWN_FUNCTION(dom); -PHP_MINFO_FUNCTION(dom); - -#endif /* PHP_DOM_H */ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c deleted file mode 100644 index 7c1a2d834103c..0000000000000 --- a/ext/dom/processinginstruction.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMProcessingInstruction extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1004215813 -* Since: -*/ - -zend_function_entry php_dom_processinginstruction_class_functions[] = { - PHP_ME(domprocessinginstruction, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]); */ -PHP_METHOD(domprocessinginstruction, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *name, *value = NULL; - int name_len, value_len, name_valid; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_processinginstruction_class_entry), &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMProcessingInstruction::__construct */ - -/* {{{ target string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1478689192 -Since: -*/ -int dom_processinginstruction_target_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (nodep->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ data string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-837822393 -Since: -*/ -int dom_processinginstruction_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - - if ((content = xmlNodeGetContent(nodep)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c deleted file mode 100644 index 8286974a09940..0000000000000 --- a/ext/dom/string_extend.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domstringextend -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend -* Since: -*/ - -zend_function_entry php_dom_string_extend_class_functions[] = { - PHP_FALIAS(findOffset16, dom_string_extend_find_offset16, NULL) - PHP_FALIAS(findOffset32, dom_string_extend_find_offset32, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto int dom_string_extend_find_offset16(int offset32); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset16) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset16 */ - - -/* {{{ proto int dom_string_extend_find_offset32(int offset16); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset32) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset32 */ -#endif diff --git a/ext/dom/tests/book.xml b/ext/dom/tests/book.xml deleted file mode 100644 index 95de0da86649e..0000000000000 --- a/ext/dom/tests/book.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/book.xml.gz b/ext/dom/tests/book.xml.gz deleted file mode 100644 index 2c97807a59fbe..0000000000000 Binary files a/ext/dom/tests/book.xml.gz and /dev/null differ diff --git a/ext/dom/tests/bug28721.phpt b/ext/dom/tests/bug28721.phpt deleted file mode 100644 index e8e7d867d8995..0000000000000 --- a/ext/dom/tests/bug28721.phpt +++ /dev/null @@ -1,485 +0,0 @@ ---TEST-- -Bug # 28721: (appendChild() and insertBefore() unset DOMText) ---SKIPIF-- - ---FILE-- -nodeName . " (" . $node->nodeValue . ")\n"; -} - -function print_node_r(DomNode $node) { - static $indent = ""; - echo "\n" . $indent; - print_node($node); - - echo $indent . "parent: "; - if ( $node->parentNode ) - print_node($node->parentNode); - else - echo "NULL\n"; - - echo $indent . "previousSibling: "; - if ( $node->previousSibling ) - print_node($node->previousSibling); - else - echo "NULL\n"; - - echo $indent . "nextSibling: "; - if ( $node->nextSibling ) - print_node($node->nextSibling); - else - echo "NULL\n"; - - if ( !$node->hasChildNodes() ) - return; - - foreach ($node->childNodes as $child) { - - $old_indent = $indent; - $indent .= " "; - print_node_r($child); - $indent = $old_indent; - } -} - -function err_handler($errno, $errstr, $errfile, $errline) { - echo "Error ($errno) on line $errline: $errstr\n"; -} - -// Record 'DocumentFragment is empty' warnings -set_error_handler("err_handler", E_WARNING); - -$xml = new DomDocument(); - -$p = $xml->createElement("p"); - -$p->appendChild($t1 = $xml->createTextNode(" t1 ")); -$p->appendChild($b = $xml->createElement("b")); -$b->appendChild($xml->createTextNode("X")); -$p->appendChild($t2 = $xml->createTextNode(" t2 ")); -$p->appendChild($xml->createTextNode(" xxx ")); - -print_node_r($p); - -echo "\nAppend t1 to p:\n"; -$ret = $p->appendChild($t1); - -print_node_r($p); -echo "\n"; - -echo "t1 == ret: "; -var_dump( $t1 === $ret ); - - -$d = $xml->createElement("div"); -$d->appendChild($t3 = $xml->createTextNode(" t3 ")); -$d->appendChild($b = $xml->createElement("b")); -$b->appendChild($xml->createElement("X")); -$d->appendChild($t4 = $xml->createTextNode(" t4 ")); -$d->appendChild($xml->createTextNode(" xxx ")); - -echo "\ndiv:\n"; -print_node_r($d); - -echo "\nInsert t4 before t3:\n"; - -$ret = $d->insertBefore($t4, $t3); - -print_node_r($d); -echo "\n"; - -$frag = $xml->createDocumentFragment(); - -$t5 = $frag->appendChild($xml->createTextNode(" t5 ")); -$frag->appendChild($i = $xml->createElement("i")); -$i->appendChild($xml->createTextNode(" frob ")); -$frag->appendChild($xml->createTextNOde(" t6 ")); - -echo "\np:\n"; -print_node_r($p); -echo "\nFragment:\n"; -print_node_r($frag); - -echo "\nAppending fragment to p:\n"; -$p->appendChild($frag); - -print_node_r($p); -echo "\nFragment:\n"; -print_node_r($frag); - -echo "\ndiv:\n"; -print_node_r($d); -echo "\nInserting fragment before t4\n"; -$d->insertBefore($frag, $t4); -print_node_r($d); - -echo "\np:\n"; -print_node_r($p); - -?> ---EXPECT-- - -name (value): p ( t1 X t2 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t1 ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: NULL - nextSibling: name (value): b (X) - - name (value): b (X) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): #text ( t2 ) - nextSibling: NULL - -Append t1 to p: - -name (value): p (X t2 xxx t1 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: NULL - -t1 == ret: bool(true) - -div: - -name (value): div ( t3 t4 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t3 ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: NULL - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( t4 ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): b () - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: NULL - -Insert t4 before t3: - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - - -p: - -name (value): p (X t2 xxx t1 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: NULL - -Fragment: - -name (value): #document-fragment () -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t5 ) - parent: name (value): #document-fragment () - previousSibling: NULL - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): #document-fragment () - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): #document-fragment () - previousSibling: name (value): i ( frob ) - nextSibling: NULL - -Appending fragment to p: - -name (value): p (X t2 xxx t1 t5 frob t6 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: name (value): #text ( t5 ) - - name (value): #text ( t5 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): i ( frob ) - nextSibling: NULL - -Fragment: - -name (value): #document-fragment () -parent: NULL -previousSibling: NULL -nextSibling: NULL - -div: - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - -Inserting fragment before t4 -Error (2) on line 109: DOMNode::insertBefore(): Document Fragment is empty - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - -p: - -name (value): p (X t2 xxx t1 t5 frob t6 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: name (value): #text ( t5 ) - - name (value): #text ( t5 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): i ( frob ) - nextSibling: NULL diff --git a/ext/dom/tests/bug28817.phpt b/ext/dom/tests/bug28817.phpt deleted file mode 100644 index 1d04ff3f1cad7..0000000000000 --- a/ext/dom/tests/bug28817.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug # 28817: (properties in extended class) ---SKIPIF-- - ---FILE-- -p_array[] = 'bonus'; - $this->p_array[] = 'vir'; - $this->p_array[] = 'semper'; - $this->p_array[] = 'tiro'; - - $this->p_variable = 'Cessante causa cessat effectus'; - } -} - -$z=new z(); -var_dump($z->p_array); -var_dump($z->p_variable); -?> ---EXPECTF-- -array(4) { - [0]=> - string(5) "bonus" - [1]=> - string(3) "vir" - [2]=> - string(6) "semper" - [3]=> - string(4) "tiro" -} -string(30) "Cessante causa cessat effectus" ---UEXPECTF-- -array(4) { - [0]=> - unicode(5) "bonus" - [1]=> - unicode(3) "vir" - [2]=> - unicode(6) "semper" - [3]=> - unicode(4) "tiro" -} -unicode(30) "Cessante causa cessat effectus" diff --git a/ext/dom/tests/bug32615.phpt b/ext/dom/tests/bug32615.phpt deleted file mode 100644 index e48973429a77d..0000000000000 --- a/ext/dom/tests/bug32615.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Bug # 32615: (Replacing and inserting Fragments) ---SKIPIF-- - ---FILE-- -createDocumentFragment(); -$frag->appendChild(new DOMElement('root')); -$dom->appendChild($frag); -$root = $dom->documentElement; - -$frag->appendChild(new DOMElement('first')); -$root->appendChild($frag); - -$frag->appendChild(new DOMElement('second')); -$root->appendChild($frag); - -$node = $dom->createElement('newfirst'); -$frag->appendChild($node); -$root->replaceChild($frag, $root->firstChild); - -unset($frag); -$frag = $dom->createDocumentFragment(); - -$frag->appendChild(new DOMElement('newsecond')); -$root->replaceChild($frag, $root->lastChild); - -$node = $frag->appendChild(new DOMElement('fourth')); -$root->insertBefore($frag, NULL); - -$frag->appendChild(new DOMElement('third')); -$node = $root->insertBefore($frag, $node); - -$frag->appendChild(new DOMElement('start')); -$root->insertBefore($frag, $root->firstChild); - -$frag->appendChild(new DOMElement('newthird')); -$root->replaceChild($frag, $node); - -$frag->appendChild(new DOMElement('newfourth')); -$root->replaceChild($frag, $root->lastChild); - -$frag->appendChild(new DOMElement('first')); -$root->replaceChild($frag, $root->firstChild->nextSibling); - -$root->removeChild($root->firstChild); - -echo $dom->saveXML()."\n"; - -while ($root->hasChildNodes()) { - $root->removeChild($root->firstChild); -} - -$frag->appendChild(new DOMElement('first')); -$root->insertBefore($frag, $root->firstChild); - -$node = $frag->appendChild(new DOMElement('fourth')); -$root->appendChild($frag); - -$frag->appendChild(new DOMElement('second')); -$frag->appendChild(new DOMElement('third')); -$root->insertBefore($frag, $node); - -echo $dom->saveXML()."\n"; - -$frag = $dom->createDocumentFragment(); -$root = $dom->documentElement; -$root->replaceChild($frag, $root->firstChild); - -echo $dom->saveXML(); - -?> ---EXPECT-- - - - - - - - - - - diff --git a/ext/dom/tests/bug34276.phpt b/ext/dom/tests/bug34276.phpt deleted file mode 100644 index e1083364a555a..0000000000000 --- a/ext/dom/tests/bug34276.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug # 34276: setAttributeNS and default namespace ---SKIPIF-- - ---FILE-- - - -HERE; - -function dump($elems) { - foreach ($elems as $elem) { - var_dump($elem->nodeName); - dump($elem->childNodes); - } -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$foo = $dom->documentElement; -var_dump($foo->hasAttributeNS('http://www.example.com/ns/foo', 'attra')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra')); - -$foo->setAttributeNS('http://www.example.com/ns/foo', 'attra', 'attranew'); -$foo->setAttributeNS('http://www.example.com/ns/fubar', 'attrb', 'attrbnew'); -$foo->setAttributeNS('http://www.example.com/ns/foo', 'attrc', 'attrc'); - -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/fubar', 'attrb')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attrc')); - -print $dom->saveXML(); -?> ---EXPECT-- -bool(false) -string(0) "" -string(8) "attranew" -string(8) "attrbnew" -string(5) "attrc" - - diff --git a/ext/dom/tests/dom001.phpt b/ext/dom/tests/dom001.phpt deleted file mode 100644 index a0c78fbb0a19f..0000000000000 --- a/ext/dom/tests/dom001.phpt +++ /dev/null @@ -1,275 +0,0 @@ ---TEST-- -Test 1: Accessing single node ---SKIPIF-- - ---FILE-- -loadxml($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -// children() of of document would result in a memleak -//$children = $dom->children(); -//print_node_list($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement; -print_node($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes; -print_node_list($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild; -print_node($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parentNode; -print_node($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes; -print_node_list($children); - -echo "--------- creating a new attribute\n"; -//This is worthless -//$attr = $dom->createAttribute("src", "picture.gif"); -//print_r($attr); - -//$rootnode->set_attributeNode($attr); -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); -print "\n"; - -echo "--------- Get Attribute Node\n"; -$attr = $rootnode->getAttributeNode("src"); -print_node($attr); - -echo "--------- Remove Attribute Node\n"; -$attr = $rootnode->removeAttribute("src"); -print "Removed " . $attr . " attributes.\n"; - -echo "--------- attributes of rootnode\n"; -$attrs = $rootnode->attributes; -print_node_list($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs->item(0)->childNodes; -print_node_list($children); - -echo "--------- Add child to root\n"; -$myelement = new domElement("Silly", "Symphony"); -$newchild = $rootnode->appendChild($myelement); -print_node($newchild); -print $dom->saveXML(); -print "\n"; - -echo "--------- Find element by tagname\n"; -echo " Using dom\n"; -$children = $dom->getElementsByTagname("Silly"); -print_node_list($children); - -echo " Using elem\n"; -$children = $rootnode->getElementsByTagName("Silly"); -print_node_list($children); - -echo "--------- Unlink Node\n"; -print_node($children->item(0)); -$rootnode->removeChild($children->item(0)); -print_node_list($rootnode->childNodes); -print $dom->savexml(); - -echo "--------- Find element by id\n"; -print ("Not implemented\n"); - -echo "--------- Check various node_name return values\n"; -print ("Not needed\n"); - -?> ---EXPECT-- -Test 1: accessing single nodes from php ---------- root -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of root -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- last -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- parent -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of parent -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- creating a new attribute -picture.gif ---------- Get Attribute Node -Node Name: src -Node Type: 2 -Num Children: 1 -Node Content: picture.gif - ---------- Remove Attribute Node -Removed 1 attributes. ---------- attributes of rootnode -Node Name: language -Node Type: 2 -Num Children: 1 -Node Content: en - ---------- children of an attribute -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: en - ---------- Add child to root -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - -Symphony - ---------- Find element by tagname - Using dom -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - Using elem -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - ---------- Unlink Node -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - ---------- Find element by id -Not implemented ---------- Check various node_name return values -Not needed diff --git a/ext/dom/tests/dom002.phpt b/ext/dom/tests/dom002.phpt deleted file mode 100644 index 2bc0717d645e1..0000000000000 --- a/ext/dom/tests/dom002.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test 2: getElementsByTagName() / getElementsByTagNameNS() ---SKIPIF-- - ---FILE-- - - - - - - - -HERE; - -function dump($elems) { - foreach ($elems as $elem) { - var_dump($elem->nodeName); - dump($elem->childNodes); - } -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$doc = $dom->documentElement; -dump($dom->getElementsByTagName('bar')); -dump($doc->getElementsByTagName('bar')); -dump($dom->getElementsByTagNameNS('http://www.example.com/ns/fubar', 'bar')); -dump($doc->getElementsByTagNameNS('http://www.example.com/ns/fubar', 'bar')); -?> ---EXPECT-- -string(3) "bar" -string(5) "test1" -string(3) "bar" -string(5) "test2" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(3) "bar" -string(5) "test1" -string(3) "bar" -string(5) "test2" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" diff --git a/ext/dom/tests/dom003.phpt b/ext/dom/tests/dom003.phpt deleted file mode 100644 index c1f4d22082943..0000000000000 --- a/ext/dom/tests/dom003.phpt +++ /dev/null @@ -1,107 +0,0 @@ ---TEST-- -Test 3: Exception Test ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book.xml"); -$rootNode = $dom->documentElement; -print "--- Catch exception with try/catch\n"; -try { - $rootNode->appendChild($rootNode); -} catch (domexception $e) { - var_dump($e); -} -print "--- Don't catch exception with try/catch\n"; -$rootNode->appendChild($rootNode); - - -?> ---EXPECTF-- ---- Catch exception with try/catch -object(DOMException)#%d (6) { - ["message":protected]=> - string(23) "Hierarchy Request Error" - ["string":"Exception":private]=> - string(0) "" - ["file":protected]=> - string(%d) "%sdom003.php" - ["line":protected]=> - int(8) - ["trace":"Exception":private]=> - array(1) { - [0]=> - array(6) { - ["file"]=> - string(%d) "%sdom003.php" - ["line"]=> - int(8) - ["function"]=> - string(11) "appendChild" - ["class"]=> - string(7) "DOMNode" - ["type"]=> - string(2) "->" - ["args"]=> - array(1) { - [0]=> - object(DOMElement)#%d (0) { - } - } - } - } - ["code"]=> - int(3) -} ---- Don't catch exception with try/catch - -Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in %sdom003.php:%d -Stack trace: -#0 %sdom003.php(13): DOMNode->appendChild(Object(DOMElement)) -#1 {main} - thrown in %sdom003.php on line %d ---UEXPECTF-- ---- Catch exception with try/catch -object(DOMException)#%d (6) { - [u"message":protected]=> - unicode(23) "Hierarchy Request Error" - [u"string":u"Exception":private]=> - unicode(0) "" - [u"file":protected]=> - unicode(%d) "%sdom003.php" - [u"line":protected]=> - int(8) - [u"trace":u"Exception":private]=> - array(1) { - [0]=> - array(6) { - [u"file"]=> - unicode(%d) "%sdom003.php" - [u"line"]=> - int(8) - [u"function"]=> - unicode(11) "appendChild" - [u"class"]=> - unicode(7) "DOMNode" - [u"type"]=> - unicode(2) "->" - [u"args"]=> - array(1) { - [0]=> - object(DOMElement)#%d (0) { - } - } - } - } - [u"code"]=> - int(3) -} ---- Don't catch exception with try/catch - -Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in %sdom003.php:%d -Stack trace: -#0 %sdom003.php(13): DOMNode->appendChild(Object(DOMElement)) -#1 {main} - thrown in %sdom003.php on line %d diff --git a/ext/dom/tests/dom004.phpt b/ext/dom/tests/dom004.phpt deleted file mode 100644 index 82b7915f6f630..0000000000000 --- a/ext/dom/tests/dom004.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test 4: Streams Test ---SKIPIF-- - ---FILE-- -load("compress.zlib://".dirname(__FILE__)."/book.xml.gz"); -print $dom->saveXML(); - ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/dom005.phpt b/ext/dom/tests/dom005.phpt deleted file mode 100644 index c0f4bb714db1e..0000000000000 --- a/ext/dom/tests/dom005.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test 5: HTML Test ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__)."/test.html"); -print "--- save as XML\n"; - -print adjustDoctype($dom->saveXML()); -print "--- save as HTML\n"; - -print adjustDoctype($dom->saveHTML()); - -function adjustDoctype($xml) { - return str_replace("DOCTYPE HTML","DOCTYPE html",$xml); -} - ---EXPECT-- ---- save as XML - - -Hello world

-This is a not well-formed
-html files with undeclared entities  -

---- save as HTML - - -Hello world -

-This is a not well-formed
-html files with undeclared entities  -

- diff --git a/ext/dom/tests/dom006.phpt b/ext/dom/tests/dom006.phpt deleted file mode 100644 index b8e8ed172440a..0000000000000 --- a/ext/dom/tests/dom006.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test 6: Extends Test ---SKIPIF-- - ---FILE-- -createElement("title"); - $titleElement->appendChild($this->createTextNode($title)); - $authorElement = $this->createElement("author"); - $authorElement->appendChild($this->createTextNode($author)); - - $bookElement = $this->createElement("book"); - - $bookElement->appendChild($titleElement); - $bookElement->appendChild($authorElement); - $this->documentElement->appendChild($bookElement); - } - -} - -$dom = new books; - -$dom->load(dirname(__FILE__)."/book.xml"); -$dom->addBook("PHP de Luxe", "Richard Samar, Christian Stocker"); -print $dom->saveXML(); ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - -PHP de LuxeRichard Samar, Christian Stocker diff --git a/ext/dom/tests/dom_create_element.phpt b/ext/dom/tests/dom_create_element.phpt deleted file mode 100644 index 3f307099bb12b..0000000000000 --- a/ext/dom/tests/dom_create_element.phpt +++ /dev/null @@ -1,394 +0,0 @@ ---TEST-- -Test 1: Creating Elements with and without Namespaces ---SKIPIF-- - ---FILE-- -createElement('valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 2 DOMDocument::createElement('-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElement('-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 3 DOMDocument::createElement(' ')\n"; -try { - $dom = new domDocument; - $dom->createElement(' '); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 4 DOMDocument::createElement('prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElement('prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 5 DOMDocument::createElementNS('http://valid.com', 'valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 7 DOMDocument::createElementNS('http://valid.com', '-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', '-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 9 DOMDocument::createElementNS('', 'prefix:invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('', 'prefix:invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:valid:invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', '-prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "12 DOMDocument::createElementNS('-', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('-', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - -print "13 DOMElement::__construct('valid')\n"; -try { - $element = new DomElement('valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "14 DOMElement::__construct('-invalid')\n"; -try { - $element = new DomElement('-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "15 DOMElement::__construct(' ')\n"; -try { - $element = new DomElement(' '); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "16 DOMElement::__construct('prefix:valid')\n"; -try { - $element = new DomElement('prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "17 DOMElement::__construct('valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "18 DOMElement::__construct('prefix:valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "19 DOMElement::__construct('-invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('-invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:-invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "21 DOMElement::__construct('prefix:invalid', '', '')\n"; -try { - $element = new DomElement('prefix:invalid', '', ''); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:valid:invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('-prefix:valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "24 DOMElement::__construct('prefix:valid', '', '-')\n"; -try { - $element = new DomElement('prefix:valid', '', '-'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the qualifiedName has a prefix and the namespaceURI is null */ - -print "25 DOMDocument::createElementNS('', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the qualifiedName has a prefix that is "xml" and the namespaceURI - is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces] */ - -print "26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://wrong.namespaceURI.com', 'xml:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com')\n"; -try { - $element = new DomElement('xml:valid', '', 'http://wrong.namespaceURI.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* This is okay because we reuse the xml namespace from the document */ -print "28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* This isn't because the xml namespace isn't there and we can't create it */ -print "29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace')\n"; -try { - $element = new DomElement('xml:valid', '', 'http://www.w3.org/XML/1998/namespace'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - -/* the qualifiedName or its prefix is "xmlns" and the namespaceURI is - different from "http://www.w3.org/2000/xmlns/" */ - -print "30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com')\n"; -try { - $element = new DomElement('xmlns:valid', '', 'http://wrong.namespaceURI.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/')\n"; -try { - $element = new DomElement('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the - qualifiedName nor its prefix is "xmlns". */ - -print "34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/')\n"; -try { - $element = new DomElement('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - - -?> ---EXPECT-- - 1 DOMDocument::createElement('valid') -valid - 2 DOMDocument::createElement('-invalid') -Invalid Character Error - 3 DOMDocument::createElement(' ') -Invalid Character Error - 4 DOMDocument::createElement('prefix:valid') -valid - 5 DOMDocument::createElementNS('http://valid.com', 'valid') -valid - 6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid') -valid - 7 DOMDocument::createElementNS('http://valid.com', '-invalid') -Namespace Error - 8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid') -Namespace Error - 9 DOMDocument::createElementNS('', 'prefix:invalid') -Namespace Error -10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid') -Namespace Error -11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid') -Namespace Error -12 DOMDocument::createElementNS('-', 'prefix:valid') -valid -13 DOMElement::__construct('valid') -valid -14 DOMElement::__construct('-invalid') -Invalid Character Error -15 DOMElement::__construct(' ') -Invalid Character Error -16 DOMElement::__construct('prefix:valid') -Namespace Error -17 DOMElement::__construct('valid', '', 'http://valid.com') -valid -18 DOMElement::__construct('prefix:valid', '', 'http://valid.com') -valid -19 DOMElement::__construct('-invalid', '', 'http://valid.com') -Invalid Character Error -20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com') -Namespace Error -21 DOMElement::__construct('prefix:invalid', '', '') -Namespace Error -22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com') -Namespace Error -23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com') -Invalid Character Error -24 DOMElement::__construct('prefix:valid', '', '-') -valid -25 DOMDocument::createElementNS('', 'prefix:valid') -Namespace Error -26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid') -Namespace Error -27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com') -Namespace Error -28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid') -valid -29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace') -Namespace Error -30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid') -Namespace Error -31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com') -Namespace Error -32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid') -valid -33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/') -valid -34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid') -Namespace Error -35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/') -Namespace Error diff --git a/ext/dom/tests/dom_import_simplexml.phpt b/ext/dom/tests/dom_import_simplexml.phpt deleted file mode 100644 index 81744aa260085..0000000000000 --- a/ext/dom/tests/dom_import_simplexml.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Interop Test: Import from SimpleXML ---SKIPIF-- - - ---FILE-- -ownerDocument->saveXML(); -?> ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/dom_test.inc b/ext/dom/tests/dom_test.inc deleted file mode 100644 index 86b426f8f37ca..0000000000000 --- a/ext/dom/tests/dom_test.inc +++ /dev/null @@ -1,47 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -function print_node($node) -{ - print "Node Name: " . $node->nodeName; - print "\nNode Type: " . $node->nodeType; - if ($node->nodeType != 3) { - $child_count = $node->childNodes->length; - } else { - $child_count = 0; - } - print "\nNum Children: " . $child_count; - if($child_count <= 1){ - print "\nNode Content: " . $node->nodeValue; - } - print "\n\n"; -} - -function print_node_list($nodelist) -{ - foreach($nodelist as $node) - { - print_node($node); - } -} - -?> diff --git a/ext/dom/tests/dom_xinclude.phpt b/ext/dom/tests/dom_xinclude.phpt deleted file mode 100644 index f9a3dd761ede6..0000000000000 --- a/ext/dom/tests/dom_xinclude.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test: Xinclude and Streams ---SKIPIF-- - ---FILE-- -loadXML($data); - -$dom->xinclude(); -print $dom->saveXML()."\n"; -foreach ($dom->documentElement->childNodes as $node) { - print $node->nodeName."\n"; -} -?> ---EXPECTF-- - - - - The Grapes of Wrath - John Steinbeck - - The Pearl - John Steinbeck - - - -#text -book -book -#text diff --git a/ext/dom/tests/skipif.inc b/ext/dom/tests/skipif.inc deleted file mode 100644 index 08fd695d97eba..0000000000000 --- a/ext/dom/tests/skipif.inc +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ext/dom/tests/test.html b/ext/dom/tests/test.html deleted file mode 100644 index fe6d0d3dbc1cc..0000000000000 --- a/ext/dom/tests/test.html +++ /dev/null @@ -1,9 +0,0 @@ - - -Hello world - - -This is a not well-formed
-html files with undeclared entities  - - diff --git a/ext/dom/tests/xinclude.xml b/ext/dom/tests/xinclude.xml deleted file mode 100644 index 27efa91aee06c..0000000000000 --- a/ext/dom/tests/xinclude.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ext/dom/text.c b/ext/dom/text.c deleted file mode 100644 index 799b02a3ab46a..0000000000000 --- a/ext/dom/text.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include "dom_ce.h" - -/* -* class DOMText extends DOMCharacterData -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1312295772 -* Since: -*/ - -zend_function_entry php_dom_text_class_functions[] = { - PHP_FALIAS(splitText, dom_text_split_text, NULL) - PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, NULL) - PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, NULL) - PHP_FALIAS(replaceWholeText, dom_text_replace_whole_text, NULL) - PHP_ME(domtext, __construct, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMText::__construct([string value]); */ -PHP_METHOD(domtext, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, U_CLASS_ENTRY(dom_text_class_entry), &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewText((xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = (xmlNodePtr)intern->ptr; - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMText::__construct */ - -/* {{{ wholeText string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-wholeText -Since: DOM Level 3 -*/ -int dom_text_whole_text_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr node; - xmlChar *wholetext; - - node = dom_object_get_node(obj); - - if (node == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - wholetext = xmlNodeListGetString(node->doc, node, 1); - ZVAL_STRING(*retval, wholetext, 1); - - xmlFree(wholetext); - - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto DOMText dom_text_split_text(int offset); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-38853C1D -Since: -*/ -PHP_FUNCTION(dom_text_split_text) -{ - zval *id; - xmlChar *cur; - xmlChar *first; - xmlChar *second; - xmlNodePtr node; - xmlNodePtr nnode; - long offset; - int ret; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_text_class_entry), &offset) == FAILURE) { - return; - } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - if (node->type != XML_TEXT_NODE) { - RETURN_FALSE; - } - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - length = xmlStrlen(cur); - - if (offset > length || offset < 0) { - xmlFree(cur); - RETURN_FALSE; - } - - first = xmlStrndup(cur, offset); - second = xmlStrdup(cur + offset); - - xmlFree(cur); - - xmlNodeSetContentLen(node, first, offset); - nnode = xmlNewDocText(node->doc, second); - - xmlFree(first); - xmlFree(second); - - if (node->parent != NULL) { - nnode->type = XML_ELEMENT_NODE; - xmlAddNextSibling(node, nnode); - nnode->type = XML_TEXT_NODE; - } - - return_value = php_dom_create_object(nnode, &ret, NULL, return_value, intern TSRMLS_CC); -} -/* }}} end dom_text_split_text */ - - -/* {{{ proto boolean dom_text_is_whitespace_in_element_content(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-isWhitespaceInElementContent -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_text_is_whitespace_in_element_content) -{ - zval *id; - xmlNodePtr node; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_text_class_entry)) == FAILURE) { - return; - } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - if (xmlIsBlankNode(node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_text_is_whitespace_in_element_content */ - - -/* {{{ proto DOMText dom_text_replace_whole_text(string content); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_text_replace_whole_text) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_text_replace_whole_text */ -#endif diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c deleted file mode 100644 index a719bad52dc3c..0000000000000 --- a/ext/dom/typeinfo.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domtypeinfo -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_typeinfo_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ type_name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeName -Since: -*/ -int dom_typeinfo_type_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ type_namespace string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeNamespace -Since: -*/ -int dom_typeinfo_type_namespace_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c deleted file mode 100644 index 0c653242a40fb..0000000000000 --- a/ext/dom/userdatahandler.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domuserdatahandler -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#UserDataHandler -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_userdatahandler_class_functions[] = { - PHP_FALIAS(handle, dom_userdatahandler_handle, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent -Since: -*/ -PHP_FUNCTION(dom_userdatahandler_handle) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_userdatahandler_handle */ -#endif diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h deleted file mode 100644 index dff448b6f3e21..0000000000000 --- a/ext/dom/xml_common.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XML_COMMON_H -#define PHP_XML_COMMON_H - -#include "ext/libxml/php_libxml.h" - -typedef struct _dom_doc_props { - int formatoutput; - int validateonparse; - int resolveexternals; - int preservewhitespace; - int substituteentities; - int stricterror; - int recover; -} dom_doc_props; - -typedef dom_doc_props *dom_doc_propsptr; - -typedef struct _dom_object { - zend_object std; - void *ptr; - php_libxml_ref_obj *document; - HashTable *prop_handler; - zend_object_handle handle; -} dom_object; - -#ifdef PHP_WIN32 -#ifdef PHPAPI -#undef PHPAPI -#endif -#ifdef DOM_EXPORTS -#define PHPAPI __declspec(dllexport) -#else -#define PHPAPI __declspec(dllimport) -#endif /* DOM_EXPORTS */ -#endif /* PHP_WIN32 */ - -#define PHP_DOM_EXPORT PHPAPI - -PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry; -PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj); -PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *in, zval* return_value, dom_object *domobj TSRMLS_DC); -PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj); - -#define DOM_XMLNS_NAMESPACE \ - (const xmlChar *) "http://www.w3.org/2000/xmlns/" - -#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ -} - -#define DOC_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->document != NULL) { \ - if (!(__ptr = (__prtype)__intern->document->ptr)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ - } \ -} - -#define DOM_RET_OBJ(zval, obj, ret, domobject) \ - if (NULL == (zval = php_dom_create_object(obj, ret, zval, return_value, domobject TSRMLS_CC))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - -#define DOM_GET_THIS(zval) \ - if (NULL == (zval = getThis())) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object missing"); \ - RETURN_FALSE; \ - } - -#define DOM_GET_THIS_OBJ(__ptr, __id, __prtype, __intern) \ - DOM_GET_THIS(__id); \ - DOM_GET_OBJ(__ptr, __id, __prtype, __intern); - -#endif diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c deleted file mode 100644 index 140a14c46822b..0000000000000 --- a/ext/dom/xpath.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -#define PHP_DOM_XPATH_QUERY 0 -#define PHP_DOM_XPATH_EVALUATE 1 - -/* -* class DOMXPath -*/ - -#if defined(LIBXML_XPATH_ENABLED) - -zend_function_entry php_dom_xpath_class_functions[] = { - PHP_ME(domxpath, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_FALIAS(registerNamespace, dom_xpath_register_ns, NULL) - PHP_FALIAS(query, dom_xpath_query, NULL) - PHP_FALIAS(evaluate, dom_xpath_evaluate, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMXPath::__construct(DOMDocument doc); */ -PHP_METHOD(domxpath, __construct) -{ - zval *id, *doc; - xmlDocPtr docp = NULL; - dom_object *docobj, *intern; - xmlXPathContextPtr ctx, oldctx; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &doc, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj); - - ctx = xmlXPathNewContext(docp); - if (ctx == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldctx = (xmlXPathContextPtr)intern->ptr; - if (oldctx != NULL) { - php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - xmlXPathFreeContext(oldctx); - } - intern->ptr = ctx; - intern->document = docobj->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC); - } -} -/* }}} end DOMXPath::__construct */ - -/* {{{ document DOMDocument*/ -int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp = NULL; - xmlXPathContextPtr ctx; - int ret; - - ctx = (xmlXPathContextPtr) obj->ptr; - - if (ctx) { - docp = (xmlDocPtr) ctx->doc; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* {{{ proto boolean dom_xpath_register_ns(string prefix, string uri); */ -PHP_FUNCTION(dom_xpath_register_ns) -{ - zval *id; - xmlXPathContextPtr ctxp; - int prefix_len, ns_uri_len; - dom_object *intern; - unsigned char *prefix, *ns_uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - ctxp = (xmlXPathContextPtr) intern->ptr; - if (ctxp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; - } - - if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { - RETURN_FALSE - } - RETURN_TRUE; -} - -static void dom_xpath_iter(zval *baseobj, dom_object *intern) -{ - dom_nnodemap_object *mapptr; - - mapptr = (dom_nnodemap_object *)intern->ptr; - mapptr->baseobjptr = baseobj; - mapptr->nodetype = DOM_NODESET; - -} - -static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) { - zval *id, *retval, *context = NULL; - xmlXPathContextPtr ctxp; - xmlNodePtr nodep = NULL; - xmlXPathObjectPtr xpathobjp; - int expr_len, ret, nsnbr = 0, xpath_type; - dom_object *intern, *nodeobj; - char *expr; - xmlDoc *docp = NULL; - xmlNsPtr *ns; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &expr, &expr_len, &context, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - ctxp = (xmlXPathContextPtr) intern->ptr; - if (ctxp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) ctxp->doc; - if (docp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Document Pointer"); - RETURN_FALSE; - } - - if (context != NULL) { - DOM_GET_OBJ(nodep, context, xmlNodePtr, nodeobj); - } - - if (!nodep) { - nodep = xmlDocGetRootElement(docp); - } - - if (nodep && docp != nodep->doc) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node From Wrong Document"); - RETURN_FALSE; - } - - ctxp->node = nodep; - - /* Register namespaces in the node */ - ns = xmlGetNsList(docp, nodep); - - if (ns != NULL) { - while (ns[nsnbr] != NULL) - nsnbr++; - } - - - ctxp->namespaces = ns; - ctxp->nsNr = nsnbr; - - xpathobjp = xmlXPathEvalExpression(expr, ctxp); - ctxp->node = NULL; - - if (ns != NULL) { - xmlFree(ns); - ctxp->namespaces = NULL; - ctxp->nsNr = 0; - } - - if (! xpathobjp) { - RETURN_FALSE; - } - - if (type == PHP_DOM_XPATH_QUERY) { - xpath_type = XPATH_NODESET; - } else { - xpath_type = xpathobjp->type; - } - - switch (xpath_type) { - - case XPATH_NODESET: - { - int i; - xmlNodeSetPtr nodesetp; - - MAKE_STD_ZVAL(retval); - array_init(retval); - - if (xpathobjp->type == XPATH_NODESET && NULL != (nodesetp = xpathobjp->nodesetval)) { - - for (i = 0; i < nodesetp->nodeNr; i++) { - xmlNodePtr node = nodesetp->nodeTab[i]; - zval *child; - - MAKE_STD_ZVAL(child); - - if (node->type == XML_NAMESPACE_DECL) { - xmlNsPtr curns; - xmlNodePtr nsparent; - - nsparent = node->_private; - curns = xmlNewNs(NULL, node->name, NULL); - if (node->children) { - curns->prefix = xmlStrdup((char *) node->children); - } - if (node->children) { - node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name); - } else { - node = xmlNewDocNode(docp, NULL, "xmlns", node->name); - } - node->type = XML_NAMESPACE_DECL; - node->parent = nsparent; - node->ns = curns; - } - child = php_dom_create_object(node, &ret, NULL, child, intern TSRMLS_CC); - add_next_index_zval(retval, child); - } - } - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - dom_xpath_iter(retval, intern); - break; - } - - case XPATH_BOOLEAN: - RETVAL_BOOL(xpathobjp->boolval); - break; - - case XPATH_NUMBER: - RETVAL_DOUBLE(xpathobjp->floatval) - break; - - case XPATH_STRING: - RETVAL_STRING(xpathobjp->stringval, 1); - break; - - default: - RETVAL_NULL(); - break; - } - - xmlXPathFreeObject(xpathobjp); -} - -/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */ -PHP_FUNCTION(dom_xpath_query) -{ - php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY); -} -/* }}} end dom_xpath_query */ - -/* {{{ proto mixed dom_xpath_evaluate(string expr [,DOMNode context]); */ -PHP_FUNCTION(dom_xpath_evaluate) -{ - php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE); -} -/* }}} end dom_xpath_evaluate */ - -#endif /* LIBXML_XPATH_ENABLED */ - -/* }}} */ -#endif diff --git a/ext/enchant/CREDITS b/ext/enchant/CREDITS deleted file mode 100644 index 481febbfc286b..0000000000000 --- a/ext/enchant/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -enchant -Pierre-Alain Joye, Ilia Alshanetsky diff --git a/ext/enchant/config.m4 b/ext/enchant/config.m4 deleted file mode 100755 index b59cd8fb3cb85..0000000000000 --- a/ext/enchant/config.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(enchant,for ENCHANT support, -[ --with-enchant[=DIR] Include enchant support. - GNU Aspell version 1.1.3 or higher required.]) - -if test "$PHP_ENCHANT" != "no"; then - PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared) - if test "$PHP_ENCHANT" != "yes"; then - ENCHANT_SEARCH_DIRS=$PHP_ENCHANT - else - ENCHANT_SEARCH_DIRS="/usr/local /usr" - fi - for i in $ENCHANT_SEARCH_DIRS; do - if test -f $i/include/enchant/enchant.h; then - ENCHANT_DIR=$i - ENCHANT_INCDIR=$i/include/enchant - elif test -f $i/include/enchant.h; then - ENCHANT_DIR=$i - ENCHANT_INCDIR=$i/include - fi - done - - if test -z "$ENCHANT_DIR"; then - AC_MSG_ERROR(Cannot find enchant) - fi - - ENCHANT_LIBDIR=$ENCHANT_DIR/lib - - AC_DEFINE(HAVE_ENCHANT,1,[ ]) - PHP_SUBST(ENCHANT_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD) - PHP_ADD_INCLUDE($ENCHANT_INCDIR) -fi diff --git a/ext/enchant/config.w32 b/ext/enchant/config.w32 deleted file mode 100644 index f9ba6beafc332..0000000000000 --- a/ext/enchant/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("enchant", "Enchant Support", "no"); - -if (PHP_ENCHANT == "yes") { - if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT)) { - EXTENSION("enchant", "enchant.c"); - AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false); - } else { - WARNING('Could not find enchant.h; skipping'); - } -} diff --git a/ext/enchant/docs/examples/example1.php b/ext/enchant/docs/examples/example1.php deleted file mode 100644 index 9d503f74e66d3..0000000000000 --- a/ext/enchant/docs/examples/example1.php +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c deleted file mode 100755 index b92fa9d468bf4..0000000000000 --- a/ext/enchant/enchant.c +++ /dev/null @@ -1,731 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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: Pierre-Alain Joye | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "enchant.h" -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_enchant.h" - - -typedef EnchantBroker * EnchantBrokerPtr; -typedef struct _broker_struct enchant_broker; -typedef struct _dict_struct enchant_dict; - -typedef enchant_broker * enchant_brokerPtr; -typedef enchant_dict * enchant_dictPtr; - -typedef struct _broker_struct { - EnchantBroker *pbroker; - enchant_dict **dict; - unsigned int dictcnt; - zval *rsrc_id; -} _enchant_broker; - -typedef struct _dict_struct { - unsigned int id; - EnchantDict *pdict; - enchant_broker *pbroker; - zval *rsrc_id; - enchant_dict *next; - enchant_dict *prev; -} _enchant_dict; - - -/* True global resources - no need for thread safety here */ -static int le_enchant_broker; -static int le_enchant_dict; - -/* If you declare any globals in php_enchant.h uncomment this:*/ -/*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/ - -/* {{{ enchant_functions[] - * - * Every user visible function must have an entry in enchant_functions[]. - */ -function_entry enchant_functions[] = { - PHP_FE(enchant_broker_init, NULL) - PHP_FE(enchant_broker_free, NULL) - PHP_FE(enchant_broker_get_error, NULL) - PHP_FE(enchant_broker_request_dict, NULL) - PHP_FE(enchant_broker_request_pwl_dict, NULL) - PHP_FE(enchant_broker_free_dict, NULL) - PHP_FE(enchant_broker_dict_exists, NULL) - PHP_FE(enchant_broker_set_ordering, NULL) - PHP_FE(enchant_broker_describe, NULL) - PHP_FE(enchant_dict_check, NULL) - PHP_FE(enchant_dict_suggest, NULL) - PHP_FE(enchant_dict_add_to_personal, NULL) - PHP_FE(enchant_dict_add_to_session, NULL) - PHP_FE(enchant_dict_is_in_session, NULL) - PHP_FE(enchant_dict_store_replacement, NULL) - PHP_FE(enchant_dict_get_error, NULL) - PHP_FE(enchant_dict_describe, NULL) - PHP_FE(enchant_dict_quick_check, third_arg_force_ref) - - {NULL, NULL, NULL} /* Must be the last line in enchant_functions[] */ -}; -/* }}} */ - -/* {{{ enchant_module_entry - */ -zend_module_entry enchant_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "enchant", - enchant_functions, - PHP_MINIT(enchant), - PHP_MSHUTDOWN(enchant), - NULL, /* Replace with NULL if there's nothing to do at request start */ - NULL, /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(enchant), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_ENCHANT -ZEND_GET_MODULE(enchant) -#endif - -static void -enumerate_providers_fn (const char * const name, - const char * const desc, - const char * const file, - void * ud) -{ - zval *zdesc = (zval *) ud; - zval *tmp_array; - - MAKE_STD_ZVAL(tmp_array); - array_init(tmp_array); - - add_assoc_string(tmp_array, "name", (char *)name, 1); - add_assoc_string(tmp_array, "desc", (char *)desc, 1); - add_assoc_string(tmp_array, "file", (char *)file, 1); - - if (Z_TYPE_P(zdesc)!=IS_ARRAY) { - array_init(zdesc); - } - - add_next_index_zval(zdesc, tmp_array); -} - -static void -describe_dict_fn (const char * const lang, - const char * const name, - const char * const desc, - const char * const file, - void * ud) -{ - zval *zdesc = (zval *) ud; - array_init(zdesc); - add_assoc_string(zdesc, "lang", (char *)lang, 1); - add_assoc_string(zdesc, "name", (char *)name, 1); - add_assoc_string(zdesc, "desc", (char *)desc, 1); - add_assoc_string(zdesc, "file", (char *)file, 1); -} - -static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - if (rsrc->ptr) { - enchant_broker *broker = (enchant_broker *)rsrc->ptr; - if (broker) { - if (broker->pbroker) { - if (broker->dictcnt && broker->dict) { - if (broker->dict) { - int total, tofree; - tofree = total = broker->dictcnt-1; - do { - zend_list_delete(Z_RESVAL_P(broker->dict[total]->rsrc_id)); - efree(broker->dict[total]); - total--; - } while (total>=0); - } - efree(broker->dict); - broker->dict = NULL; - } - enchant_broker_free(broker->pbroker); - } - efree(broker); - } - } -} - -static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - if (rsrc->ptr) { - enchant_dict *pdict = (enchant_dict *)rsrc->ptr; - if (pdict) { - if (pdict->pdict && pdict->pbroker) { - enchant_broker_free_dict(pdict->pbroker->pbroker, pdict->pdict); - } - if (pdict->id) { - pdict->pbroker->dict[pdict->id-1]->next = NULL; - } - } - } -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(enchant) -{ - le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant broker", module_number); - le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant dict", module_number); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(enchant) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static void __enumerate_providers_fn (const char * const name, - const char * const desc, - const char * const file, - void * ud) -{ - php_info_print_table_row(3, name, desc, file); -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(enchant) -{ - EnchantBroker *pbroker; - - pbroker = enchant_broker_init(); - php_info_print_table_start(); - php_info_print_table_header(2, "enchant support", "enabled"); - php_info_print_table_row(2, "Version", "@version@"); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_end(); - - php_info_print_table_start(); - enchant_broker_describe(pbroker, __enumerate_providers_fn, NULL); - php_info_print_table_end(); - enchant_broker_free(pbroker); -} -/* }}} */ - -#define PHP_ENCHANT_GET_BROKER \ - ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, &broker, -1, "enchant_broker", le_enchant_broker); \ - if (!pbroker || !pbroker->pbroker) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \ - RETURN_FALSE; \ - } - -#define PHP_ENCHANT_GET_DICT \ - ZEND_FETCH_RESOURCE(pdict, enchant_dict *, &dict, -1, "enchant dict", le_enchant_dict); \ - if (!pdict || !pdict->pdict) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \ - RETURN_FALSE; \ - } - -/* {{{ proto resource enchant_broker_init() - create a new broker object capable of requesting */ -PHP_FUNCTION(enchant_broker_init) -{ - enchant_broker *broker; - EnchantBroker *pbroker; - - if (ZEND_NUM_ARGS()) { - ZEND_WRONG_PARAM_COUNT(); - } - - pbroker = enchant_broker_init(); - - if (pbroker) { - broker = (enchant_broker *) emalloc(sizeof(enchant_broker)); - broker->pbroker = pbroker; - broker->dict = NULL; - broker->dictcnt = 0; - ZEND_REGISTER_RESOURCE(return_value, broker, le_enchant_broker); - broker->rsrc_id = return_value; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean enchant_free(resource broker) - Destroys the broker object and its dictionnaries */ -PHP_FUNCTION(enchant_broker_free) -{ - zval *broker; - enchant_broker *pbroker; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { - RETURN_FALSE; - } - PHP_ENCHANT_GET_BROKER; - - zend_list_delete(Z_RESVAL_P(broker)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string enchant_broker_get_error(resource broker) - Returns the last error of the broker */ -PHP_FUNCTION(enchant_broker_get_error) -{ - zval *broker; - enchant_broker *pbroker; - char *msg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - msg = enchant_broker_get_error(pbroker->pbroker); - if (msg) { - RETURN_STRING((char *)msg, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto resource enchant_broker_request_dict(resource broker, string tag) - create a new dictionary using tag, the non-empty language tag you wish to request - a dictionary for ("en_US", "de_DE", ...) */ -PHP_FUNCTION(enchant_broker_request_dict) -{ - zval *broker; - enchant_broker *pbroker; - enchant_dict *dict; - EnchantDict *d; - char *tag; - int taglen; - int pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag); - if (d) { - if (pbroker->dictcnt) { - pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); - pos = pbroker->dictcnt++; - } else { - pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); - pos = 0; - pbroker->dictcnt++; - } - - dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); - dict->id = pos; - dict->pbroker = pbroker; - dict->pdict = d; - dict->rsrc_id = return_value; - dict->prev = pos ? pbroker->dict[pos-1] : NULL; - dict->next = NULL; - pbroker->dict[pos] = dict; - - if (pos) { - pbroker->dict[pos-1]->next = dict; - } - - ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource enchant_broker_request_pwl_dict(resource dict, string filename) - creates a dictionary using a PWL file. A PWL file is personal word file one word per line. - It must exist before the call.*/ -PHP_FUNCTION(enchant_broker_request_pwl_dict) -{ - zval *broker; - enchant_broker *pbroker; - enchant_dict *dict; - EnchantDict *d; - char *pwl; - int pwllen; - int pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) { - RETURN_FALSE; - } - - if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl); - if (d) { - if (pbroker->dictcnt) { - pos = pbroker->dictcnt++; - pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); - } else { - pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); - pos = 0; - pbroker->dictcnt++; - } - dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); - dict->id = pos; - dict->pbroker = pbroker; - dict->pdict = d; - dict->rsrc_id = return_value; - dict->prev = pos?pbroker->dict[pos-1]:NULL; - dict->next = NULL; - pbroker->dict[pos] = dict; - if (pos) { - pbroker->dict[pos-1]->next = dict; - } - ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource enchant_broker_free_dict(resource dict) - Free the dictionary resource */ -PHP_FUNCTION(enchant_broker_free_dict) -{ - zval *dict; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - zend_list_delete(Z_RESVAL_P(dict)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag) - Wether a dictionary exists or not. Using non-empty tag */ -PHP_FUNCTION(enchant_broker_dict_exists) -{ - zval *broker; - char *tag; - int taglen; - enchant_broker * pbroker; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - RETURN_BOOL(enchant_broker_dict_exists(pbroker->pbroker, tag)); -} -/* }}} */ - - -/* {{{ proto bool enchant_broker_set_ordering(resource broker, string tag, string ordering) - Declares a preference of dictionaries to use for the language - described/referred to by 'tag'. The ordering is a comma delimited - list of provider names. As a special exception, the "*" tag can - be used as a language tag to declare a default ordering for any - language that does not explictly declare an ordering. */ - -PHP_FUNCTION(enchant_broker_set_ordering) -{ - zval *broker; - char *pordering; - int porderinglen; - char *ptag; - int ptaglen; - enchant_broker * pbroker; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - enchant_broker_set_ordering(pbroker->pbroker, ptag, pordering); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array enchant_broker_describe(resource broker) - Enumerates the Enchant providers and tells - you some rudimentary information about them. The same info is provided through phpinfo() */ -PHP_FUNCTION(enchant_broker_describe) -{ - EnchantBrokerDescribeFn describetozval = enumerate_providers_fn; - zval *broker; - enchant_broker * pbroker; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_BROKER; - - enchant_broker_describe(pbroker->pbroker, describetozval, (void *)return_value); -} -/* }}} */ - -/* {{{ proto bool enchant_dict_quick_check(resource dict, string word [, array &suggestions]) - If the word is correctly spelled return true, otherwise return false, if suggestions variable - is provided, fill it with spelling alternatives. */ -PHP_FUNCTION(enchant_dict_quick_check) -{ - zval *dict, *sugg = NULL; - char *word; - int wordlen; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) { - RETURN_FALSE; - } - - if (sugg) { - zval_dtor(sugg); - } - - PHP_ENCHANT_GET_DICT; - - if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) { - if (!sugg && ZEND_NUM_ARGS() == 2) { - RETURN_FALSE; - } - - int n_sugg; - char **suggs; - - array_init(sugg); - - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg); - if (suggs && n_sugg) { - int i; - for (i = 0; i < n_sugg; i++) { - add_next_index_string(sugg, suggs[i], 1); - } - enchant_dict_free_suggestions(pdict->pdict, suggs); - } - - - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool enchant_dict_check(resource dict, string word) - If the word is correctly spelled return true, otherwise return false */ -PHP_FUNCTION(enchant_dict_check) -{ - zval *dict; - char *word; - int wordlen; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - RETURN_BOOL(!enchant_dict_check(pdict->pdict, word, wordlen)); -} -/* }}} */ - -/* {{{ proto array enchant_dict_suggest(resource dict, string word) - Will return a list of values if any of those pre-conditions are not met.*/ -PHP_FUNCTION(enchant_dict_suggest) -{ - zval *dict; - char *word; - int wordlen; - char **suggs; - enchant_dict *pdict; - int n_sugg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg); - if (suggs && n_sugg) { - int i; - - array_init(return_value); - for (i = 0; i < n_sugg; i++) { - add_next_index_string(return_value, suggs[i], 1); - } - - enchant_dict_free_suggestions(pdict->pdict, suggs); - } -} -/* }}} */ - -/* {{{ proto void enchant_dict_add_to_personal(resource dict, string word) - add 'word' to personal word list */ -PHP_FUNCTION(enchant_dict_add_to_personal) -{ - zval *dict; - char *word; - int wordlen; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - enchant_dict_add_to_personal(pdict->pdict, word, wordlen); -} -/* }}} */ - -/* {{{ proto void enchant_dict_add_to_session(resource dict, string word) - add 'word' to this spell-checking session */ -PHP_FUNCTION(enchant_dict_add_to_session) -{ - zval *dict; - char *word; - int wordlen; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - enchant_dict_add_to_session(pdict->pdict, word, wordlen); -} -/* }}} */ - -/* {{{ proto bool enchant_dict_is_in_session(resource dict, string word) - whether or not 'word' exists in this spelling-session */ -PHP_FUNCTION(enchant_dict_is_in_session) -{ - zval *dict; - char *word; - int wordlen; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen)); -} -/* }}} */ - -/* {{{ proto void enchant_dict_store_replacement(resource dict, string mis, string cor) - add a correction for 'mis' using 'cor'. - Notes that you replaced @mis with @cor, so it's possibly more likely - that future occurrences of @mis will be replaced with @cor. So it might - bump @cor up in the suggestion list.*/ -PHP_FUNCTION(enchant_dict_store_replacement) -{ - zval *dict; - char *mis, *cor; - int mislen, corlen; - - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - enchant_dict_store_replacement(pdict->pdict, mis, mislen, cor, corlen); -} -/* }}} */ - -/* {{{ proto string enchant_dict_get_error(resource dict) - Returns the last error of the current spelling-session */ -PHP_FUNCTION(enchant_dict_get_error) -{ - zval *dict; - enchant_dict *pdict; - char *msg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - msg = enchant_dict_get_error(pdict->pdict); - if (msg) { - RETURN_STRING((char *)msg, 1); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto array enchant_dict_describe(resource dict) - Describes an individual dictionary 'dict' */ -PHP_FUNCTION(enchant_dict_describe) -{ - zval *dict; - enchant_dict *pdict; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { - RETURN_FALSE; - } - - PHP_ENCHANT_GET_DICT; - - enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/enchant/package.xml b/ext/enchant/package.xml deleted file mode 100755 index 6bc17c7a9bbbb..0000000000000 --- a/ext/enchant/package.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - enchant - libenchant binder, support near all spelling tools - - - pajoye - Pierre-Alain Joye - paj@pearfr.org - lead - - - iliaa - Ilia Alshanetsky - ilia@php.net - lead - - - Enchant is a binder for libenchant. Libenchant provides a common -API for many spell libraries: -- aspell/pspell (intended to replace ispell) -- hspell (hebrew) -- ispell -- myspell (OpenOffice project, mozilla) -- uspell (primarily Yiddish, Hebrew, and Eastern European languages) -A plugin system allows to add custom spell support. -see www.abisource.com/enchant/ - PHP - - stable - 1.0 - 2004-08-11 - - Fixed leak inside MINFO function. -- Fixed crash inside enchant_dict_suggest() when there are no suggestions. -- Added missing safe_mode/open_basedir check inside enchant_broker_request_pwl_dict(). -- Fixed various function prototypes. -- Fixed possible leak in suggestions result. - - - - - - - - - - - - - - - - - - - - - - beta - 0.2.1 - 2004-03-11 - - Fix possible leak in suggestions result -- Move to beta status - - - alpha - 0.2.0 - - Add Ilia Alshanetsky as maintainer -- Cleanup sources codes (ilia) -- Add enchant_dict_quick_check (ilia) - - - 0.1 - alpha - 2003-03-08 - Initial release - - - - diff --git a/ext/enchant/php_enchant.h b/ext/enchant/php_enchant.h deleted file mode 100644 index e0d98730cae5d..0000000000000 --- a/ext/enchant/php_enchant.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | 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 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: Pierre-Alain Joye | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifndef PHP_ENCHANT_H -#define PHP_ENCHANT_H - -extern zend_module_entry enchant_module_entry; -#define phpext_enchant_ptr &enchant_module_entry - -#ifdef PHP_WIN32 -#define PHP_ENCHANT_API __declspec(dllexport) -#else -#define PHP_ENCHANT_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -PHP_MINIT_FUNCTION(enchant); -PHP_MSHUTDOWN_FUNCTION(enchant); -PHP_MINFO_FUNCTION(enchant); - -PHP_FUNCTION(enchant_broker_init); -PHP_FUNCTION(enchant_broker_free); -PHP_FUNCTION(enchant_broker_get_error); -PHP_FUNCTION(enchant_broker_request_dict); -PHP_FUNCTION(enchant_broker_request_pwl_dict); -PHP_FUNCTION(enchant_broker_free_dict); -PHP_FUNCTION(enchant_broker_dict_exists); -PHP_FUNCTION(enchant_broker_set_ordering); -PHP_FUNCTION(enchant_broker_describe); - -PHP_FUNCTION(enchant_dict_check); -PHP_FUNCTION(enchant_dict_suggest); -PHP_FUNCTION(enchant_dict_add_to_personal); -PHP_FUNCTION(enchant_dict_add_to_session); -PHP_FUNCTION(enchant_dict_is_in_session); -PHP_FUNCTION(enchant_dict_store_replacement); -PHP_FUNCTION(enchant_dict_get_error); -PHP_FUNCTION(enchant_dict_describe); -PHP_FUNCTION(enchant_dict_quick_check); - -#ifdef ZTS -#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v) -#else -#define ENCHANT_G(v) (enchant_globals.v) -#endif - -#endif /* PHP_ENCHANT_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ - diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c deleted file mode 100644 index 0b87b184165ff..0000000000000 --- a/ext/ereg/ereg.c +++ /dev/null @@ -1,668 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jim Winstead | - | Jaakko Hyvätti | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include -#include "php.h" -#include "php_string.h" -#include "reg.h" -#include "ext/standard/info.h" - -ZEND_DECLARE_MODULE_GLOBALS(reg) - -typedef struct { - regex_t preg; - int cflags; -} reg_cache; - -static int reg_magic = 0; - -/* {{{ _php_regcomp - */ -static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) -{ - int r = 0; - int patlen = strlen(pattern); - reg_cache *rc = NULL; - TSRMLS_FETCH(); - - if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == SUCCESS - && rc->cflags == cflags) { -#ifdef HAVE_REGEX_T_RE_MAGIC - /* - * We use a saved magic number to see whether cache is corrupted, and if it - * is, we flush it and compile the pattern from scratch. - */ - if (rc->preg.re_magic != reg_magic) { - zend_hash_clean(®(ht_rc)); - } else { - memcpy(preg, &rc->preg, sizeof(*preg)); - return r; - } - } - - r = regcomp(preg, pattern, cflags); - if(!r) { - reg_cache rcp; - - rcp.cflags = cflags; - memcpy(&rcp.preg, preg, sizeof(*preg)); - /* - * Since we don't have access to the actual MAGIC1 definition in the private - * header file, we save the magic value immediately after compilation. Hopefully, - * it's good. - */ - if (!reg_magic) reg_magic = preg->re_magic; - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, - (void *) &rcp, sizeof(rcp), NULL); - } -#else - memcpy(preg, &rc->preg, sizeof(*preg)); - } else { - r = regcomp(preg, pattern, cflags); - if(!r) { - reg_cache rcp; - - rcp.cflags = cflags; - memcpy(&rcp.preg, preg, sizeof(*preg)); - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, - (void *) &rcp, sizeof(rcp), NULL); - } - } -#endif - return r; -} -/* }}} */ - -static void _free_reg_cache(reg_cache *rc) -{ - regfree(&rc->preg); -} - -#undef regfree -#define regfree(a); -#undef regcomp -#define regcomp(a, b, c) _php_regcomp(a, b, c) - -static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC) -{ - zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); -} - -static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC) -{ - zend_hash_destroy(®_globals->ht_rc); -} - -PHP_MINIT_FUNCTION(regex) -{ - ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(regex) -{ -#ifndef ZTS - php_reg_destroy_globals(®_globals TSRMLS_CC); -#endif - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(regex) -{ -#if HSREGEX - php_info_print_table_row(2, "Regex Library", "Bundled library enabled"); -#else - php_info_print_table_row(2, "Regex Library", "System library enabled"); -#endif -} - - -/* {{{ php_reg_eprint - * php_reg_eprint - convert error number to name - */ -static void php_reg_eprint(int err, regex_t *re) { - char *buf = NULL, *message = NULL; - size_t len; - size_t buf_len; - -#ifdef REG_ITOA - /* get the length of the message */ - buf_len = regerror(REG_ITOA | err, re, NULL, 0); - if (buf_len) { - buf = (char *)safe_emalloc(buf_len, sizeof(char), 0); - if (!buf) return; /* fail silently */ - /* finally, get the error message */ - regerror(REG_ITOA | err, re, buf, buf_len); - } -#else - buf_len = 0; -#endif - len = regerror(err, re, NULL, 0); - if (len) { - TSRMLS_FETCH(); - - message = (char *)safe_emalloc((buf_len + len + 2), sizeof(char), 0); - if (!message) { - return; /* fail silently */ - } - if (buf_len) { - snprintf(message, buf_len, "%s: ", buf); - buf_len += 1; /* so pointer math below works */ - } - /* drop the message into place */ - regerror(err, re, message + buf_len, len); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); - } - - STR_FREE(buf); - STR_FREE(message); -} -/* }}} */ - -/* {{{ php_ereg - */ -static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **regex, /* Regular expression */ - **findin, /* String to apply expression to */ - **array = NULL; /* Optional register array */ - regex_t re; - regmatch_t *subs; - int err, match_len, string_len; - uint i; - int copts = 0; - off_t start, end; - char *buf = NULL; - char *string = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (icase) - copts |= REG_ICASE; - - if (argc == 2) - copts |= REG_NOSUB; - - /* compile the regular expression from the supplied regex */ - if (Z_TYPE_PP(regex) == IS_STRING) { - err = regcomp(&re, Z_STRVAL_PP(regex), REG_EXTENDED | copts); - } else { - /* we convert numbers to integers and treat them as a string */ - if (Z_TYPE_PP(regex) == IS_DOUBLE) - convert_to_long_ex(regex); /* get rid of decimal places */ - convert_to_string_ex(regex); - /* don't bother doing an extended regex with just a number */ - err = regcomp(&re, Z_STRVAL_PP(regex), copts); - } - - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - /* make a copy of the string we're looking in */ - convert_to_string_ex(findin); - string = estrndup(Z_STRVAL_PP(findin), Z_STRLEN_PP(findin)); - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - - /* actually execute the regular expression */ - err = regexec(&re, string, re.re_nsub+1, subs, 0); - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - efree(subs); - RETURN_FALSE; - } - match_len = 1; - - if (array && err != REG_NOMATCH) { - match_len = (int) (subs[0].rm_eo - subs[0].rm_so); - string_len = Z_STRLEN_PP(findin) + 1; - - buf = emalloc(string_len); - - zval_dtor(*array); /* start with clean array */ - array_init(*array); - - for (i = 0; i <= re.re_nsub; i++) { - start = subs[i].rm_so; - end = subs[i].rm_eo; - if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) { - add_index_stringl(*array, i, string+start, end-start, 1); - } else { - add_index_bool(*array, i, 0); - } - } - efree(buf); - } - - efree(subs); - efree(string); - if (err == REG_NOMATCH) { - RETVAL_FALSE; - } else { - if (match_len == 0) - match_len = 1; - RETVAL_LONG(match_len); - } - regfree(&re); -} -/* }}} */ - -/* {{{ proto int ereg(string pattern, string string [, array registers]) - Regular expression match */ -PHP_FUNCTION(ereg) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int eregi(string pattern, string string [, array registers]) - Case-insensitive regular expression match */ -PHP_FUNCTION(eregi) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_reg_replace - * this is the meat and potatoes of regex replacement! */ -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) -{ - regex_t re; - regmatch_t *subs; - - char *buf, /* buf is where we build the replaced string */ - *nbuf, /* nbuf is used when we grow the buffer */ - *walkbuf; /* used to walk buf when replacing backrefs */ - const char *walk; /* used to walk replacement string for backrefs */ - int buf_len; - int pos, tmp, string_len, new_l; - int err, copts = 0; - - string_len = strlen(string); - - if (icase) { - copts = REG_ICASE; - } - if (extended) { - copts |= REG_EXTENDED; - } - - err = regcomp(&re, pattern, copts); - if (err) { - php_reg_eprint(err, &re); - return ((char *) -1); - } - - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - - /* start with a buffer that is twice the size of the stringo - we're doing replacements in */ - buf_len = 2 * string_len + 1; - buf = safe_emalloc(buf_len, sizeof(char), 0); - - err = pos = 0; - buf[0] = '\0'; - while (!err) { - err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0)); - - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - efree(subs); - efree(buf); - regfree(&re); - return ((char *) -1); - } - - if (!err) { - /* backref replacement is done in two passes: - 1) find out how long the string will be, and allocate buf - 2) copy the part before match, replacement and backrefs to buf - - Jaakko Hyvätti - */ - - new_l = strlen(buf) + subs[0].rm_so; /* part before the match */ - walk = replace; - while (*walk) { - if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) { - if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) { - new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so; - } - walk += 2; - } else { - new_l++; - walk++; - } - } - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = emalloc(buf_len); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - tmp = strlen(buf); - /* copy the part of the string before the match */ - strncat(buf, &string[pos], subs[0].rm_so); - - /* copy replacement and backrefs */ - walkbuf = &buf[tmp + subs[0].rm_so]; - walk = replace; - while (*walk) { - if ('\\' == *walk && isdigit(walk[1]) && walk[1] - '0' <= (int)re.re_nsub) { - if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1 - /* this next case shouldn't happen. it does. */ - && subs[walk[1] - '0'].rm_so <= subs[walk[1] - '0'].rm_eo) { - - tmp = subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so; - memcpy (walkbuf, &string[pos + subs[walk[1] - '0'].rm_so], tmp); - walkbuf += tmp; - } - walk += 2; - } else { - *walkbuf++ = *walk++; - } - } - *walkbuf = '\0'; - - /* and get ready to keep looking for replacements */ - if (subs[0].rm_so == subs[0].rm_eo) { - if (subs[0].rm_so + pos >= string_len) { - break; - } - new_l = strlen (buf) + 1; - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = safe_emalloc(buf_len, sizeof(char), 0); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - pos += subs[0].rm_eo + 1; - buf [new_l-1] = string [pos-1]; - buf [new_l] = '\0'; - } else { - pos += subs[0].rm_eo; - } - } else { /* REG_NOMATCH */ - new_l = strlen(buf) + strlen(&string[pos]); - if (new_l + 1 > buf_len) { - buf_len = new_l + 1; /* now we know exactly how long it is */ - nbuf = safe_emalloc(buf_len, sizeof(char), 0); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - /* stick that last bit of string on our output */ - strcat(buf, &string[pos]); - } - } - - /* don't want to leak memory .. */ - efree(subs); - regfree(&re); - - /* whew. */ - return (buf); -} -/* }}} */ - -/* {{{ php_ereg_replace - */ -static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **arg_pattern, - **arg_replace, - **arg_string; - char *pattern; - char *string; - char *replace; - char *ret; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(arg_pattern) == IS_STRING) { - if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern)) - pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern)); - else - pattern = STR_EMPTY_ALLOC(); - } else { - convert_to_long_ex(arg_pattern); - pattern = emalloc(2); - pattern[0] = (char) Z_LVAL_PP(arg_pattern); - pattern[1] = '\0'; - } - - if (Z_TYPE_PP(arg_replace) == IS_STRING) { - if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace)) - replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace)); - else - replace = STR_EMPTY_ALLOC(); - } else { - convert_to_long_ex(arg_replace); - replace = emalloc(2); - replace[0] = (char) Z_LVAL_PP(arg_replace); - replace[1] = '\0'; - } - - convert_to_string_ex(arg_string); - if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string)) - string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string)); - else - string = STR_EMPTY_ALLOC(); - - /* do the actual work */ - ret = php_reg_replace(pattern, replace, string, icase, 1); - if (ret == (char *) -1) { - RETVAL_FALSE; - } else { - RETVAL_STRING(ret, 1); - STR_FREE(ret); - } - - STR_FREE(string); - STR_FREE(replace); - STR_FREE(pattern); -} -/* }}} */ - -/* {{{ proto string ereg_replace(string pattern, string replacement, string string) - Replace regular expression */ -PHP_FUNCTION(ereg_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string eregi_replace(string pattern, string replacement, string string) - Case insensitive replace regular expression */ -PHP_FUNCTION(eregi_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_split - */ -static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - zval **spliton, **str, **arg_count = NULL; - regex_t re; - regmatch_t subs[1]; - char *strp, *endp; - int err, size, count = -1, copts = 0; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 2) { - convert_to_long_ex(arg_count); - count = Z_LVAL_PP(arg_count); - } - - if (icase) - copts = REG_ICASE; - - convert_to_string_ex(spliton); - convert_to_string_ex(str); - - strp = Z_STRVAL_PP(str); - endp = strp + Z_STRLEN_PP(str); - - err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts); - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - array_init(return_value); - - /* churn through str, generating array entries as we go */ - while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) { - if (subs[0].rm_so == 0 && subs[0].rm_eo) { - /* match is at start of string, return empty string */ - add_next_index_stringl(return_value, "", 0, 1); - /* skip ahead the length of the regex match */ - strp += subs[0].rm_eo; - } else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) { - /* No more matches */ - regfree(&re); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression to split()"); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } else { - /* On a real match */ - - /* make a copy of the substring */ - size = subs[0].rm_so; - - /* add it to the array */ - add_next_index_stringl(return_value, strp, size, 1); - - /* point at our new starting point */ - strp = strp + subs[0].rm_eo; - } - - /* if we're only looking for a certain number of points, - stop looking once we hit it */ - if (count != -1) { - count--; - } - } - - /* see if we encountered an error */ - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } - - /* otherwise we just have one last element to add to the array */ - size = endp - strp; - - add_next_index_stringl(return_value, strp, size, 1); - - regfree(&re); -} -/* }}} */ - -/* {{{ proto array split(string pattern, string string [, int limit]) - Split string into array by regular expression */ -PHP_FUNCTION(split) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array spliti(string pattern, string string [, int limit]) - Split string into array by regular expression case-insensitive */ - -PHP_FUNCTION(spliti) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* }}} */ - -/* {{{ proto string sql_regcase(string string) - Make regular expression for case insensitive match */ -PHPAPI PHP_FUNCTION(sql_regcase) -{ - zval **string; - char *tmp; - unsigned char c; - register int i, j; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &string)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(string); - - tmp = safe_emalloc(Z_STRLEN_PP(string), 4, 1); - - for (i = j = 0; i < Z_STRLEN_PP(string); i++) { - c = (unsigned char) Z_STRVAL_PP(string)[i]; - if(isalpha(c)) { - tmp[j++] = '['; - tmp[j++] = toupper(c); - tmp[j++] = tolower(c); - tmp[j++] = ']'; - } else { - tmp[j++] = c; - } - } - tmp[j] = 0; - - RETVAL_STRINGL(tmp, j, 1); - efree(tmp); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h deleted file mode 100644 index 5497026b491ad..0000000000000 --- a/ext/ereg/php_ereg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - - -/* $Id$ */ - -#ifndef REG_H -#define REG_H - -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); - -PHP_FUNCTION(ereg); -PHP_FUNCTION(eregi); -PHP_FUNCTION(eregi_replace); -PHP_FUNCTION(ereg_replace); -PHP_FUNCTION(split); -PHP_FUNCTION(spliti); -PHPAPI PHP_FUNCTION(sql_regcase); - -ZEND_BEGIN_MODULE_GLOBALS(reg) - HashTable ht_rc; -ZEND_END_MODULE_GLOBALS(reg) - -PHP_MINIT_FUNCTION(regex); -PHP_MSHUTDOWN_FUNCTION(regex); -PHP_MINFO_FUNCTION(regex); - - -#ifdef ZTS -#define REG(v) TSRMG(reg_globals_id, zend_reg_globals *, v) -#else -#define REG(v) (reg_globals.v) -#endif - -#endif /* REG_H */ diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h deleted file mode 100644 index 3713f4ec91d9e..0000000000000 --- a/ext/ereg/php_regex.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_REGEX_H -#define PHP_REGEX_H - -/* - * REGEX means: - * 0.. system regex - * 1.. bundled regex - */ - -#if REGEX -/* get aliases */ -#include "regex/regex_extra.h" -#include "regex/regex.h" - -/* get rid of aliases */ -#define PHP_NO_ALIASES -#include "regex/regex_extra.h" -#undef PHP_NO_ALIASES - -#undef _PCREPOSIX_H -#define _PCREPOSIX_H 1 - -#ifndef _REGEX_H -#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ -#endif -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#ifndef _RX_H -#define _RX_H 1 /* Try defining these for Linux to */ -#endif -#ifndef __REGEXP_LIBRARY_H__ -#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */ -#endif -#ifndef _H_REGEX -#define _H_REGEX 1 /* This one is for AIX */ -#endif -#elif REGEX == 0 -#include -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#endif - -#endif /* PHP_REGEX_H */ diff --git a/ext/ereg/regex/COPYRIGHT b/ext/ereg/regex/COPYRIGHT deleted file mode 100644 index d43362fbfc9a7..0000000000000 --- a/ext/ereg/regex/COPYRIGHT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. diff --git a/ext/ereg/regex/README b/ext/ereg/regex/README deleted file mode 100644 index cea9b67b6665d..0000000000000 --- a/ext/ereg/regex/README +++ /dev/null @@ -1,32 +0,0 @@ -alpha3.4 release. -Thu Mar 17 23:17:18 EST 1994 -henry@zoo.toronto.edu - -See WHATSNEW for change listing. - -installation notes: --------- -Read the comments at the beginning of Makefile before running. - -Utils.h contains some things that just might have to be modified on -some systems, as well as a nested include (ugh) of . - -The "fake" directory contains quick-and-dirty fakes for some header -files and routines that old systems may not have. Note also that --DUSEBCOPY will make utils.h substitute bcopy() for memmove(). - -After that, "make r" will build regcomp.o, regexec.o, regfree.o, -and regerror.o (the actual routines), bundle them together into a test -program, and run regression tests on them. No output is good output. - -"make lib" builds just the .o files for the actual routines (when -you're happy with testing and have adjusted CFLAGS for production), -and puts them together into libregex.a. You can pick up either the -library or *.o ("make lib" makes sure there are no other .o files left -around to confuse things). - -Main.c, debug.c, split.c are used for regression testing but are not part -of the RE routines themselves. - -Regex.h goes in /usr/include. All other .h files are internal only. --------- diff --git a/ext/ereg/regex/WHATSNEW b/ext/ereg/regex/WHATSNEW deleted file mode 100644 index 6e82e1dae0cd2..0000000000000 --- a/ext/ereg/regex/WHATSNEW +++ /dev/null @@ -1,92 +0,0 @@ -New in alpha3.4: The complex bug alluded to below has been fixed (in a -slightly kludgey temporary way that may hurt efficiency a bit; this is -another "get it out the door for 4.4" release). The tests at the end of -the tests file have accordingly been uncommented. The primary sign of -the bug was that something like a?b matching ab matched b rather than ab. -(The bug was essentially specific to this exact situation, else it would -have shown up earlier.) - -New in alpha3.3: The definition of word boundaries has been altered -slightly, to more closely match the usual programming notion that "_" -is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir, -and the makefile no longer alludes to it in mysterious ways. The -makefile has generally been cleaned up some. Fixes have been made -(again!) so that the regression test will run without -DREDEBUG, at -the cost of weaker checking. A workaround for a bug in some folks' - has been added. And some more things have been added to -tests, including a couple right at the end which are commented out -because the code currently flunks them (complex bug; fix coming). -Plus the usual minor cleanup. - -New in alpha3.2: Assorted bits of cleanup and portability improvement -(the development base is now a BSDI system using GCC instead of an ancient -Sun system, and the newer compiler exposed some glitches). Fix for a -serious bug that affected REs using many [] (including REG_ICASE REs -because of the way they are implemented), *sometimes*, depending on -memory-allocation patterns. The header-file prototypes no longer name -the parameters, avoiding possible name conflicts. The possibility that -some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is -now handled gracefully. "uchar" is no longer used as an internal type -name (too many people have the same idea). Still the same old lousy -performance, alas. - -New in alpha3.1: Basically nothing, this release is just a bookkeeping -convenience. Stay tuned. - -New in alpha3.0: Performance is no better, alas, but some fixes have been -made and some functionality has been added. (This is basically the "get -it out the door in time for 4.4" release.) One bug fix: regfree() didn't -free the main internal structure (how embarrassing). It is now possible -to put NULs in either the RE or the target string, using (resp.) a new -REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to -regcomp() makes all characters ordinary, so you can match a literal -string easily (this will become more useful when performance improves!). -There are now primitives to match beginnings and ends of words, although -the syntax is disgusting and so is the implementation. The REG_ATOI -debugging interface has changed a bit. And there has been considerable -internal cleanup of various kinds. - -New in alpha2.3: Split change list out of README, and moved flags notes -into Makefile. Macro-ized the name of regex(7) in regex(3), since it has -to change for 4.4BSD. Cleanup work in engine.c, and some new regression -tests to catch tricky cases thereof. - -New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two -small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges -in my own test program and might be useful to others for similar purposes. -The regression test will now compile (and run) without REDEBUG. The -BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now. -Char/uchar parameters are now written int/unsigned, to avoid possible -portability problems with unpromoted parameters. Some unsigned casts have -been introduced to minimize portability problems with shifting into sign -bits. - -New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big -thing is that regex.h is now generated, using mkh, rather than being -supplied in the distribution; due to circularities in dependencies, -you have to build regex.h explicitly by "make h". The two known bugs -have been fixed (and the regression test now checks for them), as has a -problem with assertions not being suppressed in the absence of REDEBUG. -No performance work yet. - -New in alpha2: Backslash-anything is an ordinary character, not an -error (except, of course, for the handful of backslashed metacharacters -in BREs), which should reduce script breakage. The regression test -checks *where* null strings are supposed to match, and has generally -been tightened up somewhat. Small bug fixes in parameter passing (not -harmful, but technically errors) and some other areas. Debugging -invoked by defining REDEBUG rather than not defining NDEBUG. - -New in alpha+3: full prototyping for internal routines, using a little -helper program, mkh, which extracts prototypes given in stylized comments. -More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple -pre-screening of input when a literal string is known to be part of the -RE; this does wonders for performance. - -New in alpha+2: minor bits of cleanup. Notably, the number "32" for the -word width isn't hardwired into regexec.c any more, the public header -file prototypes the functions if __STDC__ is defined, and some small typos -in the manpages have been fixed. - -New in alpha+1: improvements to the manual pages, and an important -extension, the REG_STARTEND option to regexec(). diff --git a/ext/ereg/regex/cclass.h b/ext/ereg/regex/cclass.h deleted file mode 100644 index df41694b0403b..0000000000000 --- a/ext/ereg/regex/cclass.h +++ /dev/null @@ -1,30 +0,0 @@ -/* character-class table */ -static struct cclass { - unsigned char *name; - unsigned char *chars; - unsigned char *multis; -} cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""}, - {"blank", " \t", ""}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""}, - {"digit", "0123456789", ""}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - ""}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"space", "\t\n\v\f\r ", ""}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""}, - {"xdigit", "0123456789ABCDEFabcdef", - ""}, - {NULL, 0, ""} -}; diff --git a/ext/ereg/regex/cname.h b/ext/ereg/regex/cname.h deleted file mode 100644 index 670b273882817..0000000000000 --- a/ext/ereg/regex/cname.h +++ /dev/null @@ -1,102 +0,0 @@ -/* character-name table */ -static struct cname { - char *name; - char code; -} cnames[] = { - {"NUL", '\0'}, - {"SOH", '\001'}, - {"STX", '\002'}, - {"ETX", '\003'}, - {"EOT", '\004'}, - {"ENQ", '\005'}, - {"ACK", '\006'}, - {"BEL", '\007'}, - {"alert", '\007'}, - {"BS", '\010'}, - {"backspace", '\b'}, - {"HT", '\011'}, - {"tab", '\t'}, - {"LF", '\012'}, - {"newline", '\n'}, - {"VT", '\013'}, - {"vertical-tab", '\v'}, - {"FF", '\014'}, - {"form-feed", '\f'}, - {"CR", '\015'}, - {"carriage-return", '\r'}, - {"SO", '\016'}, - {"SI", '\017'}, - {"DLE", '\020'}, - {"DC1", '\021'}, - {"DC2", '\022'}, - {"DC3", '\023'}, - {"DC4", '\024'}, - {"NAK", '\025'}, - {"SYN", '\026'}, - {"ETB", '\027'}, - {"CAN", '\030'}, - {"EM", '\031'}, - {"SUB", '\032'}, - {"ESC", '\033'}, - {"IS4", '\034'}, - {"FS", '\034'}, - {"IS3", '\035'}, - {"GS", '\035'}, - {"IS2", '\036'}, - {"RS", '\036'}, - {"IS1", '\037'}, - {"US", '\037'}, - {"space", ' '}, - {"exclamation-mark", '!'}, - {"quotation-mark", '"'}, - {"number-sign", '#'}, - {"dollar-sign", '$'}, - {"percent-sign", '%'}, - {"ampersand", '&'}, - {"apostrophe", '\''}, - {"left-parenthesis", '('}, - {"right-parenthesis", ')'}, - {"asterisk", '*'}, - {"plus-sign", '+'}, - {"comma", ','}, - {"hyphen", '-'}, - {"hyphen-minus", '-'}, - {"period", '.'}, - {"full-stop", '.'}, - {"slash", '/'}, - {"solidus", '/'}, - {"zero", '0'}, - {"one", '1'}, - {"two", '2'}, - {"three", '3'}, - {"four", '4'}, - {"five", '5'}, - {"six", '6'}, - {"seven", '7'}, - {"eight", '8'}, - {"nine", '9'}, - {"colon", ':'}, - {"semicolon", ';'}, - {"less-than-sign", '<'}, - {"equals-sign", '='}, - {"greater-than-sign", '>'}, - {"question-mark", '?'}, - {"commercial-at", '@'}, - {"left-square-bracket", '['}, - {"backslash", '\\'}, - {"reverse-solidus", '\\'}, - {"right-square-bracket", ']'}, - {"circumflex", '^'}, - {"circumflex-accent", '^'}, - {"underscore", '_'}, - {"low-line", '_'}, - {"grave-accent", '`'}, - {"left-brace", '{'}, - {"left-curly-bracket", '{'}, - {"vertical-line", '|'}, - {"right-brace", '}'}, - {"right-curly-bracket", '}'}, - {"tilde", '~'}, - {"DEL", '\177'}, - {NULL, 0}, -}; diff --git a/ext/ereg/regex/debug.c b/ext/ereg/regex/debug.c deleted file mode 100644 index 3db93ef293ae0..0000000000000 --- a/ext/ereg/regex/debug.c +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" -#include "debug.ih" - -/* - - regprint - print a regexp for debugging - == void regprint(regex_t *r, FILE *d); - */ -void -regprint(r, d) -regex_t *r; -FILE *d; -{ - register struct re_guts *g = r->re_g; - register int i; - register int c; - register int last; - int nincat[NC]; - - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); - fprintf(d, ", first %ld last %ld", (long)g->firststate, - (long)g->laststate); - if (g->iflags&USEBOL) - fprintf(d, ", USEBOL"); - if (g->iflags&USEEOL) - fprintf(d, ", USEEOL"); - if (g->iflags&BAD) - fprintf(d, ", BAD"); - if (g->nsub > 0) - fprintf(d, ", nsub=%ld", (long)g->nsub); - if (g->must != NULL) - fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, - g->must); - if (g->backrefs) - fprintf(d, ", backrefs"); - if (g->nplus > 0) - fprintf(d, ", nplus %ld", (long)g->nplus); - fprintf(d, "\n"); - s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } -} - -/* - - s_print - print the strip for debugging - == static void s_print(register struct re_guts *g, FILE *d); - */ -static void -s_print(g, d) -register struct re_guts *g; -FILE *d; -{ - register sop *s; - register cset *cs; - register int i; - register int done = 0; - register sop opnd; - register int col = 0; - register int last; - register sopno offset = 2; -# define GAP() { if (offset % 5 == 0) { \ - if (col > 40) { \ - fprintf(d, "\n\t"); \ - col = 0; \ - } else { \ - fprintf(d, " "); \ - col++; \ - } \ - } else \ - col++; \ - offset++; \ - } - - if (OP(g->strip[0]) != OEND) - fprintf(d, "missing initial OEND!\n"); - for (s = &g->strip[1]; !done; s++) { - opnd = OPND(*s); - switch (OP(*s)) { - case OEND: - fprintf(d, "\n"); - done = 1; - break; - case OCHAR: - if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) - fprintf(d, "\\%c", (unsigned char)opnd); - else - fprintf(d, "%s", regchar((unsigned char)opnd)); - break; - case OBOL: - fprintf(d, "^"); - break; - case OEOL: - fprintf(d, "$"); - break; - case OBOW: - fprintf(d, "\\{"); - break; - case OEOW: - fprintf(d, "\\}"); - break; - case OANY: - fprintf(d, "."); - break; - case OANYOF: - fprintf(d, "[(%ld)", (long)opnd); - cs = &g->sets[opnd]; - last = -1; - for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ - if (CHIN(cs, i) && i < g->csetsize) { - if (last < 0) { - fprintf(d, "%s", regchar(i)); - last = i; - } - } else { - if (last >= 0) { - if (last != i-1) - fprintf(d, "-%s", - regchar(i-1)); - last = -1; - } - } - fprintf(d, "]"); - break; - case OBACK_: - fprintf(d, "(\\<%ld>", (long)opnd); - break; - case O_BACK: - fprintf(d, "<%ld>\\)", (long)opnd); - break; - case OPLUS_: - fprintf(d, "(+"); - if (OP(*(s+opnd)) != O_PLUS) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_PLUS: - if (OP(*(s-opnd)) != OPLUS_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "+)"); - break; - case OQUEST_: - fprintf(d, "(?"); - if (OP(*(s+opnd)) != O_QUEST) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_QUEST: - if (OP(*(s-opnd)) != OQUEST_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "?)"); - break; - case OLPAREN: - fprintf(d, "((<%ld>", (long)opnd); - break; - case ORPAREN: - fprintf(d, "<%ld>))", (long)opnd); - break; - case OCH_: - fprintf(d, "<"); - if (OP(*(s+opnd)) != OOR2) - fprintf(d, "<%ld>", (long)opnd); - break; - case OOR1: - if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "|"); - break; - case OOR2: - fprintf(d, "|"); - if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_CH: - if (OP(*(s-opnd)) != OOR1) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, ">"); - break; - default: - fprintf(d, "!%ld(%ld)!", OP(*s), opnd); - break; - } - if (!done) - GAP(); - } -} - -/* - - regchar - make a character printable - == static char *regchar(int ch); - */ -static unsigned char * /* -> representation */ -regchar(ch) -int ch; -{ - static unsigned char buf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(buf, "%c", ch); - else - sprintf(buf, "\\%o", ch); - return(buf); -} diff --git a/ext/ereg/regex/debug.ih b/ext/ereg/regex/debug.ih deleted file mode 100644 index 5f40ff7917876..0000000000000 --- a/ext/ereg/regex/debug.ih +++ /dev/null @@ -1,14 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === debug.c === */ -void regprint(regex_t *r, FILE *d); -static void s_print(register struct re_guts *g, FILE *d); -static char *regchar(int ch); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/engine.c b/ext/ereg/regex/engine.c deleted file mode 100644 index 0682267f61801..0000000000000 --- a/ext/ereg/regex/engine.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* - * The matching engine and friends. This file is #included by regexec.c - * after suitable #defines of a variety of macros used herein, so that - * different state representations can be used without duplicating masses - * of code. - */ - -#ifdef SNAMES -#define matcher smatcher -#define fast sfast -#define slow sslow -#define dissect sdissect -#define backref sbackref -#define step sstep -#define print sprint -#define at sat -#define match smat -#endif -#ifdef LNAMES -#define matcher lmatcher -#define fast lfast -#define slow lslow -#define dissect ldissect -#define backref lbackref -#define step lstep -#define print lprint -#define at lat -#define match lmat -#endif - -/* another structure passed up and down to avoid zillions of parameters */ -struct match { - struct re_guts *g; - int eflags; - regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ - unsigned char *offp; /* offsets work from here */ - unsigned char *beginp; /* start of string -- virtual NUL precedes */ - unsigned char *endp; /* end of string -- virtual NUL here */ - unsigned char *coldp; /* can be no match starting before here */ - unsigned char **lastpos; /* [nplus+1] */ - STATEVARS; - states st; /* current states */ - states fresh; /* states for a fresh start */ - states tmp; /* temporary */ - states empty; /* empty set of states */ -}; - -#include "engine.ih" - -#ifdef REDEBUG -#define SP(t, s, c) print(m, t, s, c, stdout) -#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) -#define NOTE(str) { if (m->eflags®_TRACE) printf("=%s\n", (str)); } -#else -#define SP(t, s, c) /* nothing */ -#define AT(t, p1, p2, s1, s2) /* nothing */ -#define NOTE(s) /* nothing */ -#endif - -/* - - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, char *string, \ - == size_t nmatch, regmatch_t pmatch[], int eflags); - */ -static int /* 0 success, REG_NOMATCH failure */ -matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; -unsigned char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register unsigned char *endp; - register size_t i; - struct match mv; - register struct match *m = &mv; - register unsigned char *dp; - const register sopno gf = g->firststate+1; /* +1 for OEND */ - const register sopno gl = g->laststate; - unsigned char *start; - unsigned char *stop; - - /* simplify the situation where possible */ - if (g->cflags®_NOSUB) - nmatch = 0; - if (eflags®_STARTEND) { - start = string + pmatch[0].rm_so; - stop = string + pmatch[0].rm_eo; - } else { - start = string; - stop = start + strlen(start); - } - if (stop < start) - return(REG_INVARG); - - /* prescreening; this does wonders for this rather slow code */ - if (g->must != NULL) { - for (dp = start; dp < stop; dp++) - if (*dp == g->must[0] && stop - dp >= g->mlen && - memcmp(dp, g->must, (size_t)g->mlen) == 0) - break; - if (dp == stop) /* we didn't find g->must */ - return(REG_NOMATCH); - } - - /* match struct setup */ - m->g = g; - m->eflags = eflags; - m->pmatch = NULL; - m->lastpos = NULL; - m->offp = string; - m->beginp = start; - m->endp = stop; - STATESETUP(m, 4); - SETUP(m->st); - SETUP(m->fresh); - SETUP(m->tmp); - SETUP(m->empty); - CLEAR(m->empty); - - /* this loop does only one repetition except for backrefs */ - for (;;) { - endp = fast(m, start, stop, gf, gl); - if (endp == NULL) { /* a miss */ - STATETEARDOWN(m); - return(REG_NOMATCH); - } - if (nmatch == 0 && !g->backrefs) - break; /* no further info needed */ - - /* where? */ - assert(m->coldp != NULL); - for (;;) { - NOTE("finding start"); - endp = slow(m, m->coldp, stop, gf, gl); - if (endp != NULL) - break; - assert(m->coldp < m->endp); - m->coldp++; - } - if (nmatch == 1 && !g->backrefs) - break; /* no further info needed */ - - /* oh my, he wants the subexpressions... */ - if (m->pmatch == NULL) - m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * - sizeof(regmatch_t)); - if (m->pmatch == NULL) { - STATETEARDOWN(m); - return(REG_ESPACE); - } - for (i = 1; i <= m->g->nsub; i++) - m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; - if (!g->backrefs && !(m->eflags®_BACKR)) { - NOTE("dissecting"); - dp = dissect(m, m->coldp, endp, gf, gl); - } else { - if (g->nplus > 0 && m->lastpos == NULL) - m->lastpos = (unsigned char **)malloc((g->nplus+1) * - sizeof(unsigned char *)); - if (g->nplus > 0 && m->lastpos == NULL) { - free((char *)m->pmatch); - STATETEARDOWN(m); - return(REG_ESPACE); - } - NOTE("backref dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - if (dp != NULL) - break; - - /* uh-oh... we couldn't find a subexpression-level match */ - assert(g->backrefs); /* must be back references doing it */ - assert(g->nplus == 0 || m->lastpos != NULL); - for (;;) { - if (dp != NULL || endp <= m->coldp) - break; /* defeat */ - NOTE("backoff"); - endp = slow(m, m->coldp, endp-1, gf, gl); - if (endp == NULL) - break; /* defeat */ - /* try it on a shorter possibility */ -#ifndef NDEBUG - for (i = 1; i <= m->g->nsub; i++) { - assert(m->pmatch[i].rm_so == -1); - assert(m->pmatch[i].rm_eo == -1); - } -#endif - NOTE("backoff dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - assert(dp == NULL || dp == endp); - if (dp != NULL) /* found a shorter one */ - break; - - /* despite initial appearances, there is no match here */ - NOTE("false alarm"); - start = m->coldp + 1; /* recycle starting later */ - assert(start <= stop); - } - - /* fill in the details if requested */ - if (nmatch > 0) { - pmatch[0].rm_so = m->coldp - m->offp; - pmatch[0].rm_eo = endp - m->offp; - } - if (nmatch > 1) { - assert(m->pmatch != NULL); - for (i = 1; i < nmatch; i++) - if (i <= m->g->nsub) - pmatch[i] = m->pmatch[i]; - else { - pmatch[i].rm_so = -1; - pmatch[i].rm_eo = -1; - } - } - - if (m->pmatch != NULL) - free((char *)m->pmatch); - if (m->lastpos != NULL) - free((char *)m->lastpos); - STATETEARDOWN(m); - return(0); -} - -/* - - dissect - figure out what matched what, no back references - == static unsigned char *dissect(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* == stop (success) always */ -dissect(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register unsigned char *stp; /* string matched by it cannot pass here */ - register unsigned char *rest; /* start of rest of string */ - register unsigned char *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *sep; /* end of string matched by subsubRE */ - register unsigned char *oldssp; /* previous ssp */ - register unsigned char *dp; - - AT("diss", start, stop, startst, stopst); - sp = start; - for (ss = startst; ss < stopst; ss = es) { - /* identify end of subRE */ - es = ss; - switch (OP(m->g->strip[es])) { - case OPLUS_: - case OQUEST_: - es += OPND(m->g->strip[es]); - break; - case OCH_: - while (OP(m->g->strip[es]) != O_CH) - es += OPND(m->g->strip[es]); - break; - } - es++; - - /* figure out what it matched */ - switch (OP(m->g->strip[ss])) { - case OEND: - assert(PHP_REGEX_NOPE); - break; - case OCHAR: - sp++; - break; - case OBOL: - case OEOL: - case OBOW: - case OEOW: - break; - case OANY: - case OANYOF: - sp++; - break; - case OBACK_: - case O_BACK: - assert(PHP_REGEX_NOPE); - break; - /* cases where length of match is hard to find */ - case OQUEST_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - /* did innards match? */ - if (slow(m, sp, rest, ssub, esub) != NULL) { - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - } else /* no */ - assert(sp == rest); - sp = rest; - break; - case OPLUS_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - ssp = sp; - oldssp = ssp; - for (;;) { /* find last match of innards */ - sep = slow(m, ssp, rest, ssub, esub); - if (sep == NULL || sep == ssp) - break; /* failed or matched null */ - oldssp = ssp; /* on to next try */ - ssp = sep; - } - if (sep == NULL) { - /* last successful match */ - sep = ssp; - ssp = oldssp; - } - assert(sep == rest); /* must exhaust substring */ - assert(slow(m, ssp, sep, ssub, esub) == rest); - dp = dissect(m, ssp, sep, ssub, esub); - assert(dp == sep); - sp = rest; - break; - case OCH_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = ss + OPND(m->g->strip[ss]) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - if (slow(m, sp, rest, ssub, esub) == rest) - break; /* it matched all of it */ - /* that one missed, try next one */ - assert(OP(m->g->strip[esub]) == OOR1); - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - sp = rest; - break; - case O_PLUS: - case O_QUEST: - case OOR1: - case OOR2: - case O_CH: - assert(PHP_REGEX_NOPE); - break; - case OLPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_so = sp - m->offp; - break; - case ORPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_eo = sp - m->offp; - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - } - - assert(sp == stop); - return(sp); -} - -/* - - backref - figure out what matched what, figuring in back references - == static unsigned char *backref(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst, sopno lev); - */ -static unsigned char * /* == stop (success) or NULL (failure) */ -backref(m, start, stop, startst, stopst, lev) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -sopno lev; /* PLUS nesting level */ -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *dp; - register size_t len; - register int hard; - register sop s; - register regoff_t offsave; - register cset *cs; - - AT("back", start, stop, startst, stopst); - sp = start; - - /* get as far as we can with easy stuff */ - hard = 0; - for (ss = startst; !hard && ss < stopst; ss++) - switch (OP(s = m->g->strip[ss])) { - case OCHAR: - if (sp == stop || *sp++ != (unsigned char)OPND(s)) - return(NULL); - break; - case OANY: - if (sp == stop) - return(NULL); - sp++; - break; - case OANYOF: - cs = &m->g->sets[OPND(s)]; - if (sp == stop || !CHIN(cs, *sp++)) - return(NULL); - break; - case OBOL: - if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOL: - if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OBOW: - if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && - !ISWORD(*(sp-1))) ) && - (sp < m->endp && ISWORD(*sp)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOW: - if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp < m->endp && !ISWORD(*sp)) ) && - (sp > m->beginp && ISWORD(*(sp-1))) ) - { /* yes */ } - else - return(NULL); - break; - case O_QUEST: - break; - case OOR1: /* matches null but needs to skip */ - ss++; - s = m->g->strip[ss]; - do { - assert(OP(s) == OOR2); - ss += OPND(s); - } while (OP(s = m->g->strip[ss]) != O_CH); - /* note that the ss++ gets us past the O_CH */ - break; - default: /* have to make a choice */ - hard = 1; - break; - } - if (!hard) { /* that was it! */ - if (sp != stop) - return(NULL); - return(sp); - } - ss--; /* adjust for the for's final increment */ - - /* the hard stuff */ - AT("hard", sp, stop, ss, stopst); - s = m->g->strip[ss]; - switch (OP(s)) { - case OBACK_: /* the vilest depths */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - if (m->pmatch[i].rm_eo == -1) - return(NULL); - assert(m->pmatch[i].rm_so != -1); - len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; - assert(stop - m->beginp >= len); - if (sp > stop - len) - return(NULL); /* not enough left to match */ - ssp = m->offp + m->pmatch[i].rm_so; - if (memcmp(sp, ssp, len) != 0) - return(NULL); - while (m->g->strip[ss] != SOP(O_BACK, i)) - ss++; - return(backref(m, sp+len, stop, ss+1, stopst, lev)); - break; - case OQUEST_: /* to null or not */ - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); /* not */ - return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev)); - break; - case OPLUS_: - assert(m->lastpos != NULL); - assert(lev+1 <= m->g->nplus); - m->lastpos[lev+1] = sp; - return(backref(m, sp, stop, ss+1, stopst, lev+1)); - break; - case O_PLUS: - if (sp == m->lastpos[lev]) /* last pass matched null */ - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - /* try another pass */ - m->lastpos[lev] = sp; - dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev); - if (dp == NULL) - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - else - return(dp); - break; - case OCH_: /* find the right one, if any */ - ssub = ss + 1; - esub = ss + OPND(s) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - dp = backref(m, sp, stop, ssub, esub, lev); - if (dp != NULL) - return(dp); - /* that one missed, try next one */ - if (OP(m->g->strip[esub]) == O_CH) - return(NULL); /* there is none */ - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - break; - case OLPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_so; - m->pmatch[i].rm_so = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_so = offsave; - return(NULL); - break; - case ORPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_eo; - m->pmatch[i].rm_eo = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_eo = offsave; - return(NULL); - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - - /* "can't happen" */ - assert(PHP_REGEX_NOPE); - /* NOTREACHED */ - return((unsigned char *)NULL); /* dummy */ -} - -/* - - fast - step through the string at top speed - == static unsigned char *fast(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where tentative match ended, or NULL */ -fast(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states fresh = m->fresh; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *coldp; /* last p after which no match was underway */ - - CLEAR(st); - SET1(st, startst); - st = step(m->g, startst, stopst, st, NOTHING, st); - ASSIGN(fresh, st); - SP("start", st, *p); - coldp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - if (EQ(st, fresh)) - coldp = p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("boleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("boweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, fresh); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("aft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - assert(coldp != NULL); - m->coldp = coldp; - if (ISSET(st, stopst)) - return(p+1); - else - return(NULL); -} - -/* - - slow - step through the string more deliberately - == static unsigned char *slow(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where it ended */ -slow(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states empty = m->empty; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *matchp; /* last p at which a match ended */ - - AT("slow", start, stop, startst, stopst); - CLEAR(st); - SET1(st, startst); - SP("sstart", st, *p); - st = step(m->g, startst, stopst, st, NOTHING, st); - matchp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst)) - matchp = p; - if (EQ(st, empty) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, empty); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("saft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - return(matchp); -} - - -/* - - step - map set of states reachable before char to set reachable after - == static states step(register struct re_guts *g, sopno start, sopno stop, \ - == register states bef, int ch, register states aft); - == #define BOL (OUT+1) - == #define EOL (BOL+1) - == #define BOLEOL (BOL+2) - == #define NOTHING (BOL+3) - == #define BOW (BOL+4) - == #define EOW (BOL+5) - == #define CODEMAX (BOL+5) // highest code used - == #define NONCHAR(c) ((c) > UCHAR_MAX) - == #define NNONCHAR (CODEMAX-UCHAR_MAX) - */ -static states -step(g, start, stop, bef, ch, aft) -register struct re_guts *g; -sopno start; /* start state within strip */ -sopno stop; /* state after stop state within strip */ -register states bef; /* states reachable before */ -int ch; /* character or NONCHAR code */ -register states aft; /* states already known reachable after */ -{ - register cset *cs; - register sop s; - register sopno pc; - register onestate here; /* note, macros know this name */ - register sopno look; - register long i; - - for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { - s = g->strip[pc]; - switch (OP(s)) { - case OEND: - assert(pc == stop-1); - break; - case OCHAR: - /* only characters can match */ - assert(!NONCHAR(ch) || ch != (unsigned char)OPND(s)); - if (ch == (unsigned char)OPND(s)) - FWD(aft, bef, 1); - break; - case OBOL: - if (ch == BOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OEOL: - if (ch == EOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OBOW: - if (ch == BOW) - FWD(aft, bef, 1); - break; - case OEOW: - if (ch == EOW) - FWD(aft, bef, 1); - break; - case OANY: - if (!NONCHAR(ch)) - FWD(aft, bef, 1); - break; - case OANYOF: - cs = &g->sets[OPND(s)]; - if (!NONCHAR(ch) && CHIN(cs, ch)) - FWD(aft, bef, 1); - break; - case OBACK_: /* ignored here */ - case O_BACK: - FWD(aft, aft, 1); - break; - case OPLUS_: /* forward, this is just an empty */ - FWD(aft, aft, 1); - break; - case O_PLUS: /* both forward and back */ - FWD(aft, aft, 1); - i = ISSETBACK(aft, OPND(s)); - BACK(aft, aft, OPND(s)); - if (!i && ISSETBACK(aft, OPND(s))) { - /* oho, must reconsider loop body */ - pc -= OPND(s) + 1; - INIT(here, pc); - } - break; - case OQUEST_: /* two branches, both forward */ - FWD(aft, aft, 1); - FWD(aft, aft, OPND(s)); - break; - case O_QUEST: /* just an empty */ - FWD(aft, aft, 1); - break; - case OLPAREN: /* not significant here */ - case ORPAREN: - FWD(aft, aft, 1); - break; - case OCH_: /* mark the first two branches */ - FWD(aft, aft, 1); - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - break; - case OOR1: /* done a branch, find the O_CH */ - if (ISSTATEIN(aft, here)) { - for (look = 1; - OP(s = g->strip[pc+look]) != O_CH; - look += OPND(s)) - assert(OP(s) == OOR2); - FWD(aft, aft, look); - } - break; - case OOR2: /* propagate OCH_'s marking */ - FWD(aft, aft, 1); - if (OP(g->strip[pc+OPND(s)]) != O_CH) { - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - } - break; - case O_CH: /* just empty */ - FWD(aft, aft, 1); - break; - default: /* ooooops... */ - assert(PHP_REGEX_NOPE); - break; - } - } - - return(aft); -} - -#ifdef REDEBUG -/* - - print - print a set of states - == #ifdef REDEBUG - == static void print(struct match *m, unsigned char *caption, states st, \ - == int ch, FILE *d); - == #endif - */ -static void -print(m, caption, st, ch, d) -struct match *m; -unsigned char *caption; -states st; -int ch; -FILE *d; -{ - register struct re_guts *g = m->g; - register int i; - register int first = 1; - - if (!(m->eflags®_TRACE)) - return; - - fprintf(d, "%s", caption); - if (ch != '\0') - fprintf(d, " %s", pchar(ch)); - for (i = 0; i < g->nstates; i++) - if (ISSET(st, i)) { - fprintf(d, "%s%d", (first) ? "\t" : ", ", i); - first = 0; - } - fprintf(d, "\n"); -} - -/* - - at - print current situation - == #ifdef REDEBUG - == static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, \ - == sopno startst, sopno stopst); - == #endif - */ -static void -at(m, title, start, stop, startst, stopst) -struct match *m; -unsigned char *title; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - if (!(m->eflags®_TRACE)) - return; - - printf("%s %s-", title, pchar(*start)); - printf("%s ", pchar(*stop)); - printf("%ld-%ld\n", (long)startst, (long)stopst); -} - -#ifndef PCHARDONE -#define PCHARDONE /* never again */ -/* - - pchar - make a character printable - == #ifdef REDEBUG - == static unsigned char *pchar(int ch); - == #endif - * - * Is this identical to regchar() over in debug.c? Well, yes. But a - * duplicate here avoids having a debugging-capable regexec.o tied to - * a matching debug.o, and this is convenient. It all disappears in - * the non-debug compilation anyway, so it doesn't matter much. - */ -static unsigned char * /* -> representation */ -pchar(ch) -int ch; -{ - static unsigned char pbuf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(pbuf, "%c", ch); - else - sprintf(pbuf, "\\%o", ch); - return(pbuf); -} -#endif -#endif - -#undef matcher -#undef fast -#undef slow -#undef dissect -#undef backref -#undef step -#undef print -#undef at -#undef match diff --git a/ext/ereg/regex/engine.ih b/ext/ereg/regex/engine.ih deleted file mode 100644 index 9a301838bcd90..0000000000000 --- a/ext/ereg/regex/engine.ih +++ /dev/null @@ -1,35 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === engine.c === */ -static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags); -static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev); -static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft); -#define BOL (OUT+1) -#define EOL (BOL+1) -#define BOLEOL (BOL+2) -#define NOTHING (BOL+3) -#define BOW (BOL+4) -#define EOW (BOL+5) -#define CODEMAX (BOL+5) /* highest code used */ -#define NONCHAR(c) ((c) > UCHAR_MAX) -#define NNONCHAR (CODEMAX-UCHAR_MAX) -#ifdef REDEBUG -static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d); -#endif -#ifdef REDEBUG -static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -#endif -#ifdef REDEBUG -static unsigned char *pchar(int ch); -#endif - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/main.c b/ext/ereg/regex/main.c deleted file mode 100644 index 657338a2c1998..0000000000000 --- a/ext/ereg/regex/main.c +++ /dev/null @@ -1,510 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "main.ih" - -char *progname; -int debug = 0; -int line = 0; -int status = 0; - -int copts = REG_EXTENDED; -int eopts = 0; -regoff_t startoff = 0; -regoff_t endoff = 0; - - -extern int split(); -extern void regprint(); - -/* - - main - do the simple case, hand off to regress() for regression - */ -int main(argc, argv) -int argc; -char *argv[]; -{ - regex_t re; -# define NS 10 - regmatch_t subs[NS]; - char erbuf[100]; - int err; - size_t len; - int c; - int errflg = 0; - register int i; - extern int optind; - extern char *optarg; - - progname = argv[0]; - - while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF) - switch (c) { - case 'c': /* compile options */ - copts = options('c', optarg); - break; - case 'e': /* execute options */ - eopts = options('e', optarg); - break; - case 'S': /* start offset */ - startoff = (regoff_t)atoi(optarg); - break; - case 'E': /* end offset */ - endoff = (regoff_t)atoi(optarg); - break; - case 'x': /* Debugging. */ - debug++; - break; - case '?': - default: - errflg++; - break; - } - if (errflg) { - fprintf(stderr, "usage: %s ", progname); - fprintf(stderr, "[-c copt][-C][-d] [re]\n"); - exit(2); - } - - if (optind >= argc) { - regress(stdin); - exit(status); - } - - err = regcomp(&re, argv[optind++], copts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - regprint(&re, stdout); - - if (optind >= argc) { - regfree(&re); - exit(status); - } - - if (eopts®_STARTEND) { - subs[0].rm_so = startoff; - subs[0].rm_eo = strlen(argv[optind]) - endoff; - } - err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - if (!(copts®_NOSUB)) { - len = (int)(subs[0].rm_eo - subs[0].rm_so); - if (subs[0].rm_so != -1) { - if (len != 0) - printf("match `%.*s'\n", (int)len, - argv[optind] + subs[0].rm_so); - else - printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); - } - for (i = 1; i < NS; i++) - if (subs[i].rm_so != -1) - printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); - } - exit(status); -} - -/* - - regress - main loop of regression test - == void regress(FILE *in); - */ -void -regress(in) -FILE *in; -{ - char inbuf[1000]; -# define MAXF 10 - char *f[MAXF]; - int nf; - int i; - char erbuf[100]; - size_t ne; - char *badpat = "invalid regular expression"; -# define SHORT 10 - char *bpname = "REG_BADPAT"; - regex_t re; - - while (fgets(inbuf, sizeof(inbuf), in) != NULL) { - line++; - if (inbuf[0] == '#' || inbuf[0] == '\n') - continue; /* NOTE CONTINUE */ - inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ - if (debug) - fprintf(stdout, "%d:\n", line); - nf = split(inbuf, f, MAXF, "\t\t"); - if (nf < 3) { - fprintf(stderr, "bad input, line %d\n", line); - exit(1); - } - for (i = 0; i < nf; i++) - if (strcmp(f[i], "\"\"") == 0) - f[i] = ""; - if (nf <= 3) - f[3] = NULL; - if (nf <= 4) - f[4] = NULL; - try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); - if (opt('&', f[1])) /* try with either type of RE */ - try(f[0], f[1], f[2], f[3], f[4], - options('c', f[1]) &~ REG_EXTENDED); - } - - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", - erbuf, badpat); - status = 1; - } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); - if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", - erbuf, SHORT-1, badpat); - status = 1; - } - ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { - fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", - erbuf, bpname); - status = 1; - } - re.re_endp = bpname; - ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); - if (atoi(erbuf) != (int)REG_BADPAT) { - fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", - erbuf, (long)REG_BADPAT); - status = 1; - } else if (ne != strlen(erbuf)+1) { - fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", - erbuf, (long)REG_BADPAT); - status = 1; - } -} - -/* - - try - try it, and report on problems - == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); - */ -void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ -{ - regex_t re; -# define NSUBS 10 - regmatch_t subs[NSUBS]; -# define NSHOULD 15 - char *should[NSHOULD]; - int nshould; - char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - register int i; - char *grump; - char f0copy[1000]; - char f2copy[1000]; - - strcpy(f0copy, f0); - re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; - fixstr(f0copy); - err = regcomp(&re, f0copy, opts); - if (err != 0 && (!opt('C', f1) || err != efind(f2))) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err == 0 && opt('C', f1)) { - /* unexpected success */ - fprintf(stderr, "%d: %s should have given REG_%s\n", - line, type, f2); - status = 1; - err = 1; /* so we won't try regexec */ - } - - if (err != 0) { - regfree(&re); - return; - } - - strcpy(f2copy, f2); - fixstr(f2copy); - - if (options('e', f1)®_STARTEND) { - if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) - fprintf(stderr, "%d: bad STARTEND syntax\n", line); - subs[0].rm_so = strchr(f2, '(') - f2 + 1; - subs[0].rm_eo = strchr(f2, ')') - f2; - } - err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); - - if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err != 0) { - /* nothing more to check */ - } else if (f3 == NULL) { - /* unexpected success */ - fprintf(stderr, "%d: %s exec should have failed\n", - line, type); - status = 1; - err = 1; /* just on principle */ - } else if (opts®_NOSUB) { - /* nothing more to check */ - } else if ((grump = check(f2, subs[0], f3)) != NULL) { - fprintf(stderr, "%d: %s %s\n", line, type, grump); - status = 1; - err = 1; - } - - if (err != 0 || f4 == NULL) { - regfree(&re); - return; - } - - for (i = 1; i < NSHOULD; i++) - should[i] = NULL; - nshould = split(f4, should+1, NSHOULD-1, ","); - if (nshould == 0) { - nshould = 1; - should[1] = ""; - } - for (i = 1; i < NSUBS; i++) { - grump = check(f2, subs[i], should[i]); - if (grump != NULL) { - fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); - status = 1; - err = 1; - } - } - - regfree(&re); -} - -/* - - options - pick options out of a regression-test string - == int options(int type, char *s); - */ -int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; -{ - register char *p; - register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; - - for (p = s; *p != '\0'; p++) - if (strchr(legal, *p) != NULL) - switch (*p) { - case 'b': - o &= ~REG_EXTENDED; - break; - case 'i': - o |= REG_ICASE; - break; - case 's': - o |= REG_NOSUB; - break; - case 'n': - o |= REG_NEWLINE; - break; - case 'm': - o &= ~REG_EXTENDED; - o |= REG_NOSPEC; - break; - case 'p': - o |= REG_PEND; - break; - case '^': - o |= REG_NOTBOL; - break; - case '$': - o |= REG_NOTEOL; - break; - case '#': - o |= REG_STARTEND; - break; - case 't': /* trace */ - o |= REG_TRACE; - break; - case 'l': /* force long representation */ - o |= REG_LARGE; - break; - case 'r': /* force backref use */ - o |= REG_BACKR; - break; - } - return(o); -} - -/* - - opt - is a particular option in a regression string? - == int opt(int c, char *s); - */ -int /* predicate */ -opt(c, s) -int c; -char *s; -{ - return(strchr(s, c) != NULL); -} - -/* - - fixstr - transform magic characters in strings - == void fixstr(register char *p); - */ -void -fixstr(p) -register char *p; -{ - if (p == NULL) - return; - - for (; *p != '\0'; p++) - if (*p == 'N') - *p = '\n'; - else if (*p == 'T') - *p = '\t'; - else if (*p == 'S') - *p = ' '; - else if (*p == 'Z') - *p = '\0'; -} - -/* - - check - check a substring match - == char *check(char *str, regmatch_t sub, char *should); - */ -char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; -{ - register int len; - register int shlen; - register char *p; - static char grump[500]; - register char *at = NULL; - - if (should != NULL && strcmp(should, "-") == 0) - should = NULL; - if (should != NULL && should[0] == '@') { - at = should + 1; - should = ""; - } - - /* check rm_so and rm_eo for consistency */ - if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || - (sub.rm_so != -1 && sub.rm_eo == -1) || - (sub.rm_so != -1 && sub.rm_so < 0) || - (sub.rm_eo != -1 && sub.rm_eo < 0) ) { - sprintf(grump, "start %ld end %ld", (long)sub.rm_so, - (long)sub.rm_eo); - return(grump); - } - - /* check for no match */ - if (sub.rm_so == -1 && should == NULL) - return(NULL); - if (sub.rm_so == -1) - return("did not match"); - - /* check for in range */ - if (sub.rm_eo > strlen(str)) { - sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); - return(grump); - } - - len = (int)(sub.rm_eo - sub.rm_so); - shlen = (int)strlen(should); - p = str + sub.rm_so; - - /* check for not supposed to match */ - if (should == NULL) { - sprintf(grump, "matched `%.*s'", len, p); - return(grump); - } - - /* check for wrong match */ - if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { - sprintf(grump, "matched `%.*s' instead", len, p); - return(grump); - } - if (shlen > 0) - return(NULL); - - /* check null match in right place */ - if (at == NULL) - return(NULL); - shlen = strlen(at); - if (shlen == 0) - shlen = 1; /* force check for end-of-string */ - if (strncmp(p, at, shlen) != 0) { - sprintf(grump, "matched null at `%.20s'", p); - return(grump); - } - return(NULL); -} - -/* - - eprint - convert error number to name - == static char *eprint(int err); - */ -static char * -eprint(err) -int err; -{ - static char epbuf[100]; - size_t len; - - len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); - assert(len <= sizeof(epbuf)); - return(epbuf); -} - -/* - - efind - convert error name to number - == static int efind(char *name); - */ -static int -efind(name) -char *name; -{ - static char efbuf[100]; - regex_t re; - - sprintf(efbuf, "REG_%s", name); - assert(strlen(efbuf) < sizeof(efbuf)); - re.re_endp = efbuf; - (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); - return(atoi(efbuf)); -} diff --git a/ext/ereg/regex/main.ih b/ext/ereg/regex/main.ih deleted file mode 100644 index 5a0118ac44167..0000000000000 --- a/ext/ereg/regex/main.ih +++ /dev/null @@ -1,19 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === main.c === */ -void regress(FILE *in); -void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); -int options(int type, char *s); -int opt(int c, char *s); -void fixstr(register char *p); -char *check(char *str, regmatch_t sub, char *should); -static char *eprint(int err); -static int efind(char *name); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/mkh b/ext/ereg/regex/mkh deleted file mode 100644 index 252b246c7bd25..0000000000000 --- a/ext/ereg/regex/mkh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# mkh - pull headers out of C source -PATH=/bin:/usr/bin ; export PATH - -# egrep pattern to pick out marked lines -egrep='^ =([ ]|$)' - -# Sed program to process marked lines into lines for the header file. -# The markers have already been removed. Two things are done here: removal -# of backslashed newlines, and some fudging of comments. The first is done -# because -o needs to have prototypes on one line to strip them down. -# Getting comments into the output is tricky; we turn C++-style // comments -# into /* */ comments, after altering any existing */'s to avoid trouble. -peel=' /\\$/N - /\\\n[ ]*/s///g - /\/\//s;\*/;* /;g - /\/\//s;//\(.*\);/*\1 */;' - -for a -do - case "$a" in - -o) # old (pre-function-prototype) compiler - # add code to comment out argument lists - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);' - shift - ;; - -b) # funny Berkeley __P macro - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));' - shift - ;; - -s) # compiler doesn't like `static foo();' - # add code to get rid of the `static' - peel="$peel - "'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;' - shift - ;; - -p) # private declarations - egrep='^ ==([ ]|$)' - shift - ;; - -i) # wrap in #ifndef, argument is name - ifndef="$2" - shift ; shift - ;; - *) break - ;; - esac -done - -if test " $ifndef" != " " -then - echo "#ifndef $ifndef" - echo "#define $ifndef /* never again */" -fi -echo "/* ========= begin header generated by $0 ========= */" -echo '#ifdef __cplusplus' -echo 'extern "C" {' -echo '#endif' -for f -do - echo - echo "/* === $f === */" - egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel" - echo -done -echo '#ifdef __cplusplus' -echo '}' -echo '#endif' -echo "/* ========= end header generated by $0 ========= */" -if test " $ifndef" != " " -then - echo "#endif" -fi -exit 0 diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c deleted file mode 100644 index ec034d4c4ce25..0000000000000 --- a/ext/ereg/regex/regcomp.c +++ /dev/null @@ -1,1608 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define POSIX_MISTAKE - -#include "utils.h" -#include "regex.h" -#include "regex2.h" - -#include "cclass.h" -#include "cname.h" - -/* - * parse structure, passed up and down to avoid global variables and - * other clumsinesses - */ -struct parse { - unsigned char *next; /* next character in RE */ - unsigned char *end; /* end of string (-> NUL normally) */ - int error; /* has an error been seen? */ - sop *strip; /* malloced strip */ - sopno ssize; /* malloced strip size (allocated) */ - sopno slen; /* malloced strip length (used) */ - int ncsalloc; /* number of csets allocated */ - struct re_guts *g; -# define NPAREN 10 /* we need to remember () 1-9 for back refs */ - sopno pbegin[NPAREN]; /* -> ( ([0] unused) */ - sopno pend[NPAREN]; /* -> ) ([0] unused) */ -}; - -#include "regcomp.ih" - -static unsigned char nuls[10]; /* place to point scanner in event of error */ - -/* - * macros for use with parse structure - * BEWARE: these know that the parse structure is named `p' !!! - */ -#define PEEK() (*p->next) -#define PEEK2() (*(p->next+1)) -#define MORE() (p->next < p->end) -#define MORE2() (p->next+1 < p->end) -#define SEE(c) (MORE() && PEEK() == (c)) -#define SEETWO(a, b) (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b)) -#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) -#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) -#define NEXT() (p->next++) -#define NEXT2() (p->next += 2) -#define NEXTn(n) (p->next += (n)) -#define GETNEXT() (*p->next++) -#define SETERROR(e) seterr(p, (e)) -#define REQUIRE(co, e) (void) ((co) || SETERROR(e)) -#define MUSTSEE(c, e) (REQUIRE(MORE() && PEEK() == (c), e)) -#define MUSTEAT(c, e) (REQUIRE(MORE() && GETNEXT() == (c), e)) -#define MUSTNOTSEE(c, e) (REQUIRE(!MORE() || PEEK() != (c), e)) -#define EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd)) -#define INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(pos)+1, pos) -#define AHEAD(pos) dofwd(p, pos, HERE()-(pos)) -#define ASTERN(sop, pos) EMIT(sop, HERE()-pos) -#define HERE() (p->slen) -#define THERE() (p->slen - 1) -#define THERETHERE() (p->slen - 2) -#define DROP(n) (p->slen -= (n)) - -#ifndef NDEBUG -static int never = 0; /* for use in asserts; shuts lint up */ -#else -#define never 0 /* some s have bugs too */ -#endif - -/* - - regcomp - interface for parser and compilation - = API_EXPORT(int) regcomp(regex_t *, const char *, int); - = #define REG_BASIC 0000 - = #define REG_EXTENDED 0001 - = #define REG_ICASE 0002 - = #define REG_NOSUB 0004 - = #define REG_NEWLINE 0010 - = #define REG_NOSPEC 0020 - = #define REG_PEND 0040 - = #define REG_DUMP 0200 - */ -API_EXPORT(int) /* 0 success, otherwise REG_something */ -regcomp(preg, pattern, cflags) -regex_t *preg; -const char *pattern; -int cflags; -{ - struct parse pa; - register struct re_guts *g; - register struct parse *p = &pa; - register int i; - register size_t len; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&~REG_DUMP) -#endif - - cflags = GOODFLAGS(cflags); - if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) - return(REG_INVARG); - - if (cflags®_PEND) { - if (preg->re_endp < pattern) - return(REG_INVARG); - len = preg->re_endp - pattern; - } else - len = strlen((char *)pattern); - - /* do the mallocs early so failure handling is easy */ - g = (struct re_guts *)malloc(sizeof(struct re_guts) + - (NC-1)*sizeof(cat_t)); - if (g == NULL) - return(REG_ESPACE); - p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); - p->slen = 0; - if (p->strip == NULL) { - free((char *)g); - return(REG_ESPACE); - } - - /* set things up */ - p->g = g; - p->next = (unsigned char *)pattern; /* convenience; we do not modify it */ - p->end = p->next + len; - p->error = 0; - p->ncsalloc = 0; - for (i = 0; i < NPAREN; i++) { - p->pbegin[i] = 0; - p->pend[i] = 0; - } - g->csetsize = NC; - g->sets = NULL; - g->setbits = NULL; - g->ncsets = 0; - g->cflags = cflags; - g->iflags = 0; - g->nbol = 0; - g->neol = 0; - g->must = NULL; - g->mlen = 0; - g->nsub = 0; - g->ncategories = 1; /* category 0 is "everything else" */ - g->categories = &g->catspace[0]; - (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t)); - g->backrefs = 0; - - /* do it */ - EMIT(OEND, 0); - g->firststate = THERE(); - if (cflags®_EXTENDED) - p_ere(p, OUT); - else if (cflags®_NOSPEC) - p_str(p); - else - p_bre(p, OUT, OUT); - EMIT(OEND, 0); - g->laststate = THERE(); - - /* tidy up loose ends and fill things in */ - categorize(p, g); - stripsnug(p, g); - findmust(p, g); - g->nplus = pluscount(p, g); - g->magic = MAGIC2; - preg->re_nsub = g->nsub; - preg->re_g = g; - preg->re_magic = MAGIC1; -#ifndef REDEBUG - /* not debugging, so can't rely on the assert() in regexec() */ - if (g->iflags&BAD) - SETERROR(REG_ASSERT); -#endif - - /* win or lose, we're done */ - if (p->error != 0) /* lose */ - regfree(preg); - return(p->error); -} - -/* - - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); - */ -static void -p_ere(p, stop) -register struct parse *p; -int stop; /* character this ERE should end at */ -{ - register unsigned char c; - register sopno prevback = 0; - register sopno prevfwd = 0; - register sopno conc; - register int first = 1; /* is this the first alternative? */ - - for (;;) { - /* do a bunch of concatenated expressions */ - conc = HERE(); - while (MORE() && (c = PEEK()) != '|' && c != stop) - p_ere_exp(p); - (void) REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ - - if (!EAT('|')) - break; /* NOTE BREAK OUT */ - - if (first) { - INSERT(OCH_, conc); /* offset is wrong */ - prevfwd = conc; - prevback = conc; - first = 0; - } - ASTERN(OOR1, prevback); - prevback = THERE(); - AHEAD(prevfwd); /* fix previous offset */ - prevfwd = HERE(); - EMIT(OOR2, 0); /* offset is very wrong */ - } - - if (!first) { /* tail-end fixups */ - AHEAD(prevfwd); - ASTERN(O_CH, prevback); - } - - assert(!MORE() || SEE(stop)); -} - -/* - - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op - == static void p_ere_exp(register struct parse *p); - */ -static void -p_ere_exp(p) -register struct parse *p; -{ - register unsigned char c; - register sopno pos; - register int count; - register int count2; - register sopno subno; - int wascaret = 0; - - assert(MORE()); /* caller should have ensured this */ - c = GETNEXT(); - - pos = HERE(); - switch (c) { - case '(': - REQUIRE(MORE(), REG_EPAREN); - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - if (!SEE(')')) - p_ere(p, ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - MUSTEAT(')', REG_EPAREN); - break; -#ifndef POSIX_MISTAKE - case ')': /* happens only if no current unmatched ( */ - /* - * You may ask, why the ifndef? Because I didn't notice - * this until slightly too late for 1003.2, and none of the - * other 1003.2 regular-expression reviewers noticed it at - * all. So an unmatched ) is legal POSIX, at least until - * we can get it fixed. - */ - SETERROR(REG_EPAREN); - break; -#endif - case '^': - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - wascaret = 1; - break; - case '$': - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - break; - case '|': - SETERROR(REG_EMPTY); - break; - case '*': - case '+': - case '?': - SETERROR(REG_BADRPT); - break; - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case '\\': - REQUIRE(MORE(), REG_EESCAPE); - c = GETNEXT(); - ordinary(p, c); - break; - case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, c); - break; - } - - if (!MORE()) - return; - c = PEEK(); - /* we call { a repetition if followed by a digit */ - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) )) - return; /* no repetition, we're done */ - NEXT(); - - REQUIRE(!wascaret, REG_BADRPT); - switch (c) { - case '*': /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - break; - case '+': - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - break; - case '?': - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, pos); /* offset slightly wrong */ - ASTERN(OOR1, pos); /* this one's right */ - AHEAD(pos); /* fix the OCH_ */ - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - break; - case '{': - count = p_count(p); - if (EAT(',')) { - if (isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EAT('}')) { /* error heuristics */ - while (MORE() && PEEK() != '}') - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - break; - } - - if (!MORE()) - return; - c = PEEK(); - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) ) ) - return; - SETERROR(REG_BADRPT); -} - -/* - - p_str - string (no metacharacters) "parser" - == static void p_str(register struct parse *p); - */ -static void -p_str(p) -register struct parse *p; -{ - REQUIRE(MORE(), REG_EMPTY); - while (MORE()) - ordinary(p, GETNEXT()); -} - -/* - - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(register struct parse *p, register int end1, \ - == register int end2); - * Giving end1 as OUT essentially eliminates the end1/end2 check. - * - * This implementation is a bit of a kludge, in that a trailing $ is first - * taken as an ordinary character and then revised to be an anchor. The - * only undesirable side effect is that '$' gets included as a character - * category in such cases. This is fairly harmless; not worth fixing. - * The amount of lookahead needed to avoid this kludge is excessive. - */ -static void -p_bre(p, end1, end2) -register struct parse *p; -register int end1; /* first terminating character */ -register int end2; /* second terminating character */ -{ - register sopno start = HERE(); - register int first = 1; /* first subexpression? */ - register int wasdollar = 0; - - if (EAT('^')) { - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - } - while (MORE() && !SEETWO(end1, end2)) { - wasdollar = p_simp_re(p, first); - first = 0; - } - if (wasdollar) { /* oops, that was a trailing anchor */ - DROP(1); - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - } - - REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ -} - -/* - - p_simp_re - parse a simple RE, an atom possibly followed by a repetition - == static int p_simp_re(register struct parse *p, int starordinary); - */ -static int /* was the simple RE an unbackslashed $? */ -p_simp_re(p, starordinary) -register struct parse *p; -int starordinary; /* is a leading * an ordinary character? */ -{ - register int c; - register int count; - register int count2; - register sopno pos; - register int i; - register sopno subno; -# define BACKSL (1<g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_bre(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - case BACKSL|'}': - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - REQUIRE(starordinary, REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, (unsigned char)c); /* takes off BACKSL, if any */ - break; - } - - if (EAT('*')) { /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - } else if (EATTWO('\\', '{')) { - count = p_count(p); - if (EAT(',')) { - if (MORE() && isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EATTWO('\\', '}')) { /* error heuristics */ - while (MORE() && !SEETWO('\\', '}')) - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ - return(1); - - return(0); -} - -/* - - p_count - parse a repetition count - == static int p_count(register struct parse *p); - */ -static int /* the value */ -p_count(p) -register struct parse *p; -{ - register int count = 0; - register int ndigits = 0; - - while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { - count = count*10 + (GETNEXT() - '0'); - ndigits++; - } - - REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); - return(count); -} - -/* - - p_bracket - parse a bracketed character list - == static void p_bracket(register struct parse *p); - * - * Note a significant property of this code: if the allocset() did SETERROR, - * no set operations are done. - */ -static void -p_bracket(p) -register struct parse *p; -{ - register cset *cs = allocset(p); - register int invert = 0; - - /* Dept of Truly Sickening Special-Case Kludges */ - if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { - EMIT(OBOW, 0); - NEXTn(6); - return; - } - if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) { - EMIT(OEOW, 0); - NEXTn(6); - return; - } - - if (EAT('^')) - invert++; /* make note to invert set at end */ - if (EAT(']')) - CHadd(cs, ']'); - else if (EAT('-')) - CHadd(cs, '-'); - while (MORE() && PEEK() != ']' && !SEETWO('-', ']')) - p_b_term(p, cs); - if (EAT('-')) - CHadd(cs, '-'); - MUSTEAT(']', REG_EBRACK); - - if (p->error != 0) /* don't mess things up further */ - return; - - if (p->g->cflags®_ICASE) { - register int i; - register int ci; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i) && isalpha(i)) { - ci = othercase(i); - if (ci != i) - CHadd(cs, ci); - } - if (cs->multis != NULL) - mccase(p, cs); - } - if (invert) { - register int i; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i)) - CHsub(cs, i); - else - CHadd(cs, i); - if (p->g->cflags®_NEWLINE) - CHsub(cs, '\n'); - if (cs->multis != NULL) - mcinvert(p, cs); - } - - assert(cs->multis == NULL); /* xxx */ - - if (nch(p, cs) == 1) { /* optimize singleton sets */ - ordinary(p, firstch(p, cs)); - freeset(p, cs); - } else - EMIT(OANYOF, freezeset(p, cs)); -} - -/* - - p_b_term - parse one term of a bracketed character list - == static void p_b_term(register struct parse *p, register cset *cs); - */ -static void -p_b_term(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - register unsigned char start, finish; - register int i; - - /* classify what we've got */ - switch ((MORE()) ? PEEK() : '\0') { - case '[': - c = (MORE2()) ? PEEK2() : '\0'; - break; - case '-': - SETERROR(REG_ERANGE); - return; /* NOTE RETURN */ - break; - default: - c = '\0'; - break; - } - - switch (c) { - case ':': /* character class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECTYPE); - p_b_cclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO(':', ']'), REG_ECTYPE); - break; - case '=': /* equivalence class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECOLLATE); - p_b_eclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); - break; - default: /* symbol, ordinary character, or range */ -/* xxx revision needed for multichar stuff */ - start = p_b_symbol(p); - if (SEE('-') && MORE2() && PEEK2() != ']') { - /* range */ - NEXT(); - if (EAT('-')) - finish = '-'; - else - finish = p_b_symbol(p); - } else - finish = start; -/* xxx what about signed chars here... */ - REQUIRE(start <= finish, REG_ERANGE); - for (i = start; i <= finish; i++) - CHadd(cs, i); - break; - } -} - -/* - - p_b_cclass - parse a character-class name and deal with it - == static void p_b_cclass(register struct parse *p, register cset *cs); - */ -static void -p_b_cclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char *sp = p->next; - register struct cclass *cp; - register size_t len; - register unsigned char *u; - register unsigned char c; - - while (MORE() && isalpha(PEEK())) - NEXT(); - len = p->next - sp; - for (cp = cclasses; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - break; - if (cp->name == NULL) { - /* oops, didn't find it */ - SETERROR(REG_ECTYPE); - return; - } - - u = cp->chars; - while ((c = *u++) != '\0') - CHadd(cs, c); - for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) - MCadd(p, cs, u); -} - -/* - - p_b_eclass - parse an equivalence-class name and deal with it - == static void p_b_eclass(register struct parse *p, register cset *cs); - * - * This implementation is incomplete. xxx - */ -static void -p_b_eclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - - c = p_b_coll_elem(p, '='); - CHadd(cs, c); -} - -/* - - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(register struct parse *p); - */ -static unsigned char /* value of symbol */ -p_b_symbol(p) -register struct parse *p; -{ - register unsigned char value; - - REQUIRE(MORE(), REG_EBRACK); - if (!EATTWO('[', '.')) - return(GETNEXT()); - - /* collating symbol */ - value = p_b_coll_elem(p, '.'); - REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); - return(value); -} - -/* - - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(register struct parse *p, int endc); - */ -static unsigned char /* value of collating element */ -p_b_coll_elem(p, endc) -register struct parse *p; -int endc; /* name ended by endc,']' */ -{ - register unsigned char *sp = p->next; - register struct cname *cp; - register int len; - - while (MORE() && !SEETWO(endc, ']')) - NEXT(); - if (!MORE()) { - SETERROR(REG_EBRACK); - return(0); - } - len = p->next - sp; - for (cp = cnames; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - return(cp->code); /* known name */ - if (len == 1) - return(*sp); /* single character */ - SETERROR(REG_ECOLLATE); /* neither */ - return(0); -} - -/* - - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); - */ -static unsigned char /* if no counterpart, return ch */ -othercase(ch) -int ch; -{ - assert(isalpha(ch)); - if (isupper(ch)) - return(tolower(ch)); - else if (islower(ch)) - return(toupper(ch)); - else /* peculiar, but could happen */ - return(ch); -} - -/* - - bothcases - emit a dualcase version of a two-case character - == static void bothcases(register struct parse *p, int ch); - * - * Boy, is this implementation ever a kludge... - */ -static void -bothcases(p, ch) -register struct parse *p; -int ch; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[3]; - - assert(othercase(ch) != ch); /* p_bracket() would recurse */ - p->next = bracket; - p->end = bracket+2; - bracket[0] = ch; - bracket[1] = ']'; - bracket[2] = '\0'; - p_bracket(p); - assert(p->next == bracket+2); - p->next = oldnext; - p->end = oldend; -} - -/* - - ordinary - emit an ordinary character - == static void ordinary(register struct parse *p, register int ch); - */ -static void -ordinary(p, ch) -register struct parse *p; -register int ch; -{ - register cat_t *cap = p->g->categories; - - if ((p->g->cflags®_ICASE) && isalpha(ch) && othercase(ch) != ch) - bothcases(p, ch); - else { - EMIT(OCHAR, (unsigned char)ch); - if (cap[ch] == 0) - cap[ch] = p->g->ncategories++; - } -} - -/* - - nonnewline - emit REG_NEWLINE version of OANY - == static void nonnewline(register struct parse *p); - * - * Boy, is this implementation ever a kludge... - */ -static void -nonnewline(p) -register struct parse *p; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[4]; - - p->next = bracket; - p->end = bracket+3; - bracket[0] = '^'; - bracket[1] = '\n'; - bracket[2] = ']'; - bracket[3] = '\0'; - p_bracket(p); - assert(p->next == bracket+3); - p->next = oldnext; - p->end = oldend; -} - -/* - - repeat - generate code for a bounded repetition, recursively if needed - == static void repeat(register struct parse *p, sopno start, int from, int to); - */ -static void -repeat(p, start, from, to) -register struct parse *p; -sopno start; /* operand from here to end of strip */ -int from; /* repeated from this number */ -int to; /* to this number of times (maybe INFINITY) */ -{ - register sopno finish = HERE(); -# define N 2 -# define INF 3 -# define REP(f, t) ((f)*8 + (t)) -# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - register sopno copy; - - if (p->error != 0) /* head off possible runaway recursion */ - return; - - assert(from <= to); - - switch (REP(MAP(from), MAP(to))) { - case REP(0, 0): /* must be user doing this */ - DROP(finish-start); /* drop the operand */ - break; - case REP(0, 1): /* as x{1,1}? */ - case REP(0, N): /* as x{1,n}? */ - case REP(0, INF): /* as x{1,}? */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); /* offset is wrong... */ - repeat(p, start+1, 1, to); - ASTERN(OOR1, start); - AHEAD(start); /* ... fix it */ - EMIT(OOR2, 0); - AHEAD(THERE()); - ASTERN(O_CH, THERETHERE()); - break; - case REP(1, 1): /* trivial case */ - /* done */ - break; - case REP(1, N): /* as x?x{1,n-1} */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); - ASTERN(OOR1, start); - AHEAD(start); - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - copy = dupl(p, start+1, finish+1); - assert(copy == finish+4); - repeat(p, copy, 1, to-1); - break; - case REP(1, INF): /* as x+ */ - INSERT(OPLUS_, start); - ASTERN(O_PLUS, start); - break; - case REP(N, N): /* as xx{m-1,n-1} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to-1); - break; - case REP(N, INF): /* as xx{n-1,INF} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to); - break; - default: /* "can't happen" */ - SETERROR(REG_ASSERT); /* just in case */ - break; - } -} - -/* - - seterr - set an error condition - == static int seterr(register struct parse *p, int e); - */ -static int /* useless but makes type checking happy */ -seterr(p, e) -register struct parse *p; -int e; -{ - if (p->error == 0) /* keep earliest error condition */ - p->error = e; - p->next = nuls; /* try to bring things to a halt */ - p->end = nuls; - return(0); /* make the return value well-defined */ -} - -/* - - allocset - allocate a set of characters for [] - == static cset *allocset(register struct parse *p); - */ -static cset * -allocset(p) -register struct parse *p; -{ - register int no = p->g->ncsets++; - register size_t nc; - register size_t nbytes; - register cset *cs; - register size_t css = (size_t)p->g->csetsize; - register int i; - - if (no >= p->ncsalloc) { /* need another column of space */ - p->ncsalloc += CHAR_BIT; - nc = p->ncsalloc; - assert(nc % CHAR_BIT == 0); - nbytes = nc / CHAR_BIT * css; - if (p->g->sets == NULL) - p->g->sets = (cset *)malloc(nc * sizeof(cset)); - else - p->g->sets = (cset *)realloc((unsigned char *)p->g->sets, - nc * sizeof(cset)); - if (p->g->setbits == NULL) - p->g->setbits = (uch *)malloc(nbytes); - else { - p->g->setbits = (uch *)realloc((unsigned char *)p->g->setbits, - nbytes); - /* xxx this isn't right if setbits is now NULL */ - for (i = 0; i < no; i++) - p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT); - } - if (p->g->sets != NULL && p->g->setbits != NULL) - (void) memset((unsigned char *)p->g->setbits + (nbytes - css), - 0, css); - else { - no = 0; - SETERROR(REG_ESPACE); - /* caller's responsibility not to do set ops */ - } - } - - assert(p->g->sets != NULL); /* xxx */ - cs = &p->g->sets[no]; - cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); - cs->mask = 1 << ((no) % CHAR_BIT); - cs->hash = 0; - cs->smultis = 0; - cs->multis = NULL; - - return(cs); -} - -/* - - freeset - free a now-unused set - == static void freeset(register struct parse *p, register cset *cs); - */ -static void -freeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - CHsub(cs, i); - if (cs == top-1) /* recover only the easy case */ - p->g->ncsets--; -} - -/* - - freezeset - final processing on a set of characters - == static int freezeset(register struct parse *p, register cset *cs); - * - * The main task here is merging identical sets. This is usually a waste - * of time (although the hash code minimizes the overhead), but can win - * big if REG_ICASE is being used. REG_ICASE, by the way, is why the hash - * is done using addition rather than xor -- all ASCII [aA] sets xor to - * the same value! - */ -static int /* set number */ -freezeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register uch h = cs->hash; - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register cset *cs2; - register size_t css = (size_t)p->g->csetsize; - - /* look for an earlier one which is the same */ - for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) - if (cs2->hash == h && cs2 != cs) { - /* maybe */ - for (i = 0; i < css; i++) - if (!!CHIN(cs2, i) != !!CHIN(cs, i)) - break; /* no */ - if (i == css) - break; /* yes */ - } - - if (cs2 < top) { /* found one */ - freeset(p, cs); - cs = cs2; - } - - return((int)(cs - p->g->sets)); -} - -/* - - firstch - return first character in a set (which must have at least one) - == static int firstch(register struct parse *p, register cset *cs); - */ -static int /* character; there is no "none" value */ -firstch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - return((unsigned char)i); - assert(never); - return(0); /* arbitrary */ -} - -/* - - nch - number of characters in a set - == static int nch(register struct parse *p, register cset *cs); - */ -static int -nch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - register int n = 0; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - n++; - return(n); -} - -/* - - mcadd - add a collating element to a cset - == static void mcadd(register struct parse *p, register cset *cs, \ - == register char *cp); - */ -static void -mcadd(p, cs, cp) -register struct parse *p; -register cset *cs; -register unsigned char *cp; -{ - register size_t oldend = cs->smultis; - - cs->smultis += strlen(cp) + 1; - if (cs->multis == NULL) - cs->multis = malloc(cs->smultis); - else - cs->multis = realloc(cs->multis, cs->smultis); - if (cs->multis == NULL) { - SETERROR(REG_ESPACE); - return; - } - - (void) strcpy(cs->multis + oldend - 1, cp); - cs->multis[cs->smultis - 1] = '\0'; -} - -#if 0 -/* - - mcsub - subtract a collating element from a cset - == static void mcsub(register cset *cs, register unsigned char *cp); - */ -static void -mcsub(cs, cp) -register unsigned cset *cs; -register unsigned char *cp; -{ - register unsigned char *fp = mcfind(cs, cp); - register size_t len = strlen(fp); - - assert(fp != NULL); - (void) memmove(fp, fp + len + 1, - cs->smultis - (fp + len + 1 - cs->multis)); - cs->smultis -= len; - - if (cs->smultis == 0) { - free(cs->multis); - cs->multis = NULL; - return; - } - - cs->multis = realloc(cs->multis, cs->smultis); - assert(cs->multis != NULL); -} - -/* - - mcin - is a collating element in a cset? - == static int mcin(register cset *cs, register unsigned char *cp); - */ -static int -mcin(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - return(mcfind(cs, cp) != NULL); -} - - -/* - - mcfind - find a collating element in a cset - == static unsigned char *mcfind(register cset *cs, register unsigned char *cp); - */ -static unsigned char * -mcfind(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - register unsigned char *p; - - if (cs->multis == NULL) - return(NULL); - for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) - if (strcmp(cp, p) == 0) - return(p); - return(NULL); -} -#endif - -/* - - mcinvert - invert the list of collating elements in a cset - == static void mcinvert(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mcinvert(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - mccase - add case counterparts of the list of collating elements in a cset - == static void mccase(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mccase(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - isinsets - is this character in any sets? - == static int isinsets(register struct re_guts *g, int c); - */ -static int /* predicate */ -isinsets(g, c) -register struct re_guts *g; -int c; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc = (unsigned char)c; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc] != 0) - return(1); - return(0); -} - -/* - - samesets - are these two characters in exactly the same sets? - == static int samesets(register struct re_guts *g, int c1, int c2); - */ -static int /* predicate */ -samesets(g, c1, c2) -register struct re_guts *g; -int c1; -int c2; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc1 = (unsigned char)c1; - register unsigned uc2 = (unsigned char)c2; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc1] != col[uc2]) - return(0); - return(1); -} - -/* - - categorize - sort out character categories - == static void categorize(struct parse *p, register struct re_guts *g); - */ -static void -categorize(p, g) -struct parse *p; -register struct re_guts *g; -{ - register cat_t *cats = g->categories; - register int c; - register int c2; - register cat_t cat; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - for (c = 0; c <= UCHAR_MAX; c++) - if (cats[c] == 0 && isinsets(g, c)) { - cat = g->ncategories++; - cats[c] = cat; - for (c2 = c+1; c2 <= UCHAR_MAX; c2++) - if (cats[c2] == 0 && samesets(g, c, c2)) - cats[c2] = cat; - } -} - -/* - - dupl - emit a duplicate of a bunch of sops - == static sopno dupl(register struct parse *p, sopno start, sopno finish); - */ -static sopno /* start of duplicate */ -dupl(p, start, finish) -register struct parse *p; -sopno start; /* from here */ -sopno finish; /* to this less one */ -{ - register sopno ret = HERE(); - register sopno len = finish - start; - - assert(finish >= start); - if (len == 0) - return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); - (void) memcpy((char *)(p->strip + p->slen), - (char *)(p->strip + start), (size_t)len*sizeof(sop)); - p->slen += len; - return(ret); -} - -/* - - doemit - emit a strip operator - == static void doemit(register struct parse *p, sop op, size_t opnd); - * - * It might seem better to implement this as a macro with a function as - * hard-case backup, but it's just too big and messy unless there are - * some changes to the data structures. Maybe later. - */ -static void -doemit(p, op, opnd) -register struct parse *p; -sop op; -size_t opnd; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* deal with oversize operands ("can't happen", more or less) */ - assert(opnd < 1<slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); - - /* finally, it's all reduced to the easy case */ - p->strip[p->slen++] = SOP(op, opnd); -} - -/* - - doinsert - insert a sop into the strip - == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); - */ -static void -doinsert(p, op, opnd, pos) -register struct parse *p; -sop op; -size_t opnd; -sopno pos; -{ - register sopno sn; - register sop s; - register int i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - sn = HERE(); - EMIT(op, opnd); /* do checks, ensure space */ - assert(HERE() == sn+1); - s = p->strip[sn]; - - /* adjust paren pointers */ - assert(pos > 0); - for (i = 1; i < NPAREN; i++) { - if (p->pbegin[i] >= pos) { - p->pbegin[i]++; - } - if (p->pend[i] >= pos) { - p->pend[i]++; - } - } - - memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos], - (HERE()-pos-1)*sizeof(sop)); - p->strip[pos] = s; -} - -/* - - dofwd - complete a forward reference - == static void dofwd(register struct parse *p, sopno pos, sop value); - */ -static void -dofwd(p, pos, value) -register struct parse *p; -register sopno pos; -sop value; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - assert(value < 1<strip[pos] = OP(p->strip[pos]) | value; -} - -/* - - enlarge - enlarge the strip - == static void enlarge(register struct parse *p, sopno size); - */ -static void -enlarge(p, size) -register struct parse *p; -register sopno size; -{ - register sop *sp; - - if (p->ssize >= size) - return; - - sp = (sop *)realloc(p->strip, size*sizeof(sop)); - if (sp == NULL) { - SETERROR(REG_ESPACE); - return; - } - p->strip = sp; - p->ssize = size; -} - -/* - - stripsnug - compact the strip - == static void stripsnug(register struct parse *p, register struct re_guts *g); - */ -static void -stripsnug(p, g) -register struct parse *p; -register struct re_guts *g; -{ - g->nstates = p->slen; - g->strip = (sop *)realloc((unsigned char *)p->strip, p->slen * sizeof(sop)); - if (g->strip == NULL) { - SETERROR(REG_ESPACE); - g->strip = p->strip; - } -} - -/* - - findmust - fill in must and mlen with longest mandatory literal string - == static void findmust(register struct parse *p, register struct re_guts *g); - * - * This algorithm could do fancy things like analyzing the operands of | - * for common subsequences. Someday. This code is simple and finds most - * of the interesting cases. - * - * Note that must and mlen got initialized during setup. - */ -static void -findmust(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - sop *start = NULL; - register sop *newstart = NULL; - register sopno newlen; - register sop s; - register unsigned char *cp; - register sopno i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* find the longest OCHAR sequence in strip */ - newlen = 0; - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OCHAR: /* sequence member */ - if (newlen == 0) /* new sequence */ - newstart = scan - 1; - newlen++; - break; - case OPLUS_: /* things that don't break one */ - case OLPAREN: - case ORPAREN: - break; - case OQUEST_: /* things that must be skipped */ - case OCH_: - scan--; - do { - scan += OPND(s); - s = *scan; - /* assert() interferes w debug printouts */ - if (OP(s) != O_QUEST && OP(s) != O_CH && - OP(s) != OOR2) { - g->iflags |= BAD; - return; - } - } while (OP(s) != O_QUEST && OP(s) != O_CH); - /* fallthrough */ - default: /* things that break a sequence */ - if (newlen > g->mlen) { /* ends one */ - start = newstart; - g->mlen = newlen; - } - newlen = 0; - break; - } - } while (OP(s) != OEND); - - if (g->mlen == 0) /* there isn't one */ - return; - - /* turn it into a character string */ - g->must = malloc((size_t)g->mlen + 1); - if (g->must == NULL) { /* argh; just forget it */ - g->mlen = 0; - return; - } - cp = g->must; - scan = start; - for (i = g->mlen; i > 0; i--) { - while (OP(s = *scan++) != OCHAR) - continue; - assert(cp < g->must + g->mlen); - *cp++ = (unsigned char)OPND(s); - } - assert(cp == g->must + g->mlen); - *cp++ = '\0'; /* just on general principles */ -} - -/* - - pluscount - count + nesting - == static sopno pluscount(register struct parse *p, register struct re_guts *g); - */ -static sopno /* nesting depth */ -pluscount(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - register sop s; - register sopno plusnest = 0; - register sopno maxnest = 0; - - if (p->error != 0) - return(0); /* there may not be an OEND */ - - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OPLUS_: - plusnest++; - break; - case O_PLUS: - if (plusnest > maxnest) - maxnest = plusnest; - plusnest--; - break; - } - } while (OP(s) != OEND); - if (plusnest != 0) - g->iflags |= BAD; - return(maxnest); -} diff --git a/ext/ereg/regex/regcomp.ih b/ext/ereg/regex/regcomp.ih deleted file mode 100644 index c93d32e51d32e..0000000000000 --- a/ext/ereg/regex/regcomp.ih +++ /dev/null @@ -1,53 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regcomp.c === */ -static void p_ere(register struct parse *p, int stop); -static void p_ere_exp(register struct parse *p); -static void p_str(register struct parse *p); -static void p_bre(register struct parse *p, register int end1, register int end2); -static int p_simp_re(register struct parse *p, int starordinary); -static int p_count(register struct parse *p); -static void p_bracket(register struct parse *p); -static void p_b_term(register struct parse *p, register cset *cs); -static void p_b_cclass(register struct parse *p, register cset *cs); -static void p_b_eclass(register struct parse *p, register cset *cs); -static unsigned char p_b_symbol(register struct parse *p); -static unsigned char p_b_coll_elem(register struct parse *p, int endc); -static unsigned char othercase(int ch); -static void bothcases(register struct parse *p, int ch); -static void ordinary(register struct parse *p, register int ch); -static void nonnewline(register struct parse *p); -static void repeat(register struct parse *p, sopno start, int from, int to); -static int seterr(register struct parse *p, int e); -static cset *allocset(register struct parse *p); -static void freeset(register struct parse *p, register cset *cs); -static int freezeset(register struct parse *p, register cset *cs); -static int firstch(register struct parse *p, register cset *cs); -static int nch(register struct parse *p, register cset *cs); -static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp); -#if 0 -static void mcsub(register cset *cs, register unsigned char *cp); -static int mcin(register cset *cs, register unsigned char *cp); -static unsigned char *mcfind(register cset *cs, register unsigned char *cp); -#endif -static void mcinvert(register struct parse *p, register cset *cs); -static void mccase(register struct parse *p, register cset *cs); -static int isinsets(register struct re_guts *g, int c); -static int samesets(register struct re_guts *g, int c1, int c2); -static void categorize(struct parse *p, register struct re_guts *g); -static sopno dupl(register struct parse *p, sopno start, sopno finish); -static void doemit(register struct parse *p, sop op, size_t opnd); -static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); -static void dofwd(register struct parse *p, sopno pos, sop value); -static void enlarge(register struct parse *p, sopno size); -static void stripsnug(register struct parse *p, register struct re_guts *g); -static void findmust(register struct parse *p, register struct re_guts *g); -static sopno pluscount(register struct parse *p, register struct re_guts *g); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/regerror.c b/ext/ereg/regex/regerror.c deleted file mode 100644 index 6c8e064c4a57a..0000000000000 --- a/ext/ereg/regex/regerror.c +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regerror.ih" - -/* - = #define REG_OKAY 0 - = #define REG_NOMATCH 1 - = #define REG_BADPAT 2 - = #define REG_ECOLLATE 3 - = #define REG_ECTYPE 4 - = #define REG_EESCAPE 5 - = #define REG_ESUBREG 6 - = #define REG_EBRACK 7 - = #define REG_EPAREN 8 - = #define REG_EBRACE 9 - = #define REG_BADBR 10 - = #define REG_ERANGE 11 - = #define REG_ESPACE 12 - = #define REG_BADRPT 13 - = #define REG_EMPTY 14 - = #define REG_ASSERT 15 - = #define REG_INVARG 16 - = #define REG_ATOI 255 // convert name to number (!) - = #define REG_ITOA 0400 // convert number to name (!) - */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - {REG_OKAY, "REG_OKAY", "no errors detected"}, - {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, - {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, - {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, - {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, - {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, - {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, - {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, - {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, - {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, - {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, - {REG_ERANGE, "REG_ERANGE", "invalid character range"}, - {REG_ESPACE, "REG_ESPACE", "out of memory"}, - {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, - {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, - {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, - {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, - {-1, "", "*** unknown regexp error code ***"}, -}; - -/* - - regerror - the interface to error numbers - = API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - */ -/* ARGSUSED */ -API_EXPORT(size_t) -regerror( -int errcode, -const regex_t *preg, -char *errbuf, -size_t errbuf_size) -{ - register struct rerr *r; - register size_t len; - register int target = errcode &~ REG_ITOA; - register char *s; - char convbuf[50]; - - if (errcode == REG_ATOI) - s = regatoi(preg, convbuf); - else { - for (r = rerrs; r->code >= 0; r++) - if (r->code == target) - break; - - if (errcode®_ITOA) { - if (r->code >= 0) - (void) strcpy(convbuf, r->name); - else - sprintf(convbuf, "REG_0x%x", target); - assert(strlen(convbuf) < sizeof(convbuf)); - s = convbuf; - } else - s = r->explain; - } - - len = strlen(s) + 1; - if (errbuf_size > 0) { - if (errbuf_size > len) - (void) strcpy(errbuf, s); - else { - (void) strncpy(errbuf, s, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return(len); -} - -/* - - regatoi - internal routine to implement REG_ATOI - == static char *regatoi(const regex_t *preg, char *localbuf); - */ -static char * -regatoi(preg, localbuf) -const regex_t *preg; -char *localbuf; -{ - register struct rerr *r; - - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, preg->re_endp) == 0) - break; - if (r->code < 0) - return("0"); - - sprintf(localbuf, "%d", r->code); - return(localbuf); -} diff --git a/ext/ereg/regex/regerror.ih b/ext/ereg/regex/regerror.ih deleted file mode 100644 index 2cb668c24f07e..0000000000000 --- a/ext/ereg/regex/regerror.ih +++ /dev/null @@ -1,12 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regerror.c === */ -static char *regatoi(const regex_t *preg, char *localbuf); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/regex.3 b/ext/ereg/regex/regex.3 deleted file mode 100644 index 100c8a7f71c72..0000000000000 --- a/ext/ereg/regex/regex.3 +++ /dev/null @@ -1,502 +0,0 @@ -.TH REGEX 3 "17 May 1993" -.BY "Henry Spencer" -.de ZR -.\" one other place knows this name: the SEE ALSO section -.IR regex (7) \\$1 -.. -.SH NAME -regcomp, regexec, regerror, regfree \- regular-expression library -.SH SYNOPSIS -.ft B -.\".na -#include -.br -#include -.HP 10 -int regcomp(regex_t\ *preg, const\ char\ *pattern, int\ cflags); -.HP -int\ regexec(const\ regex_t\ *preg, const\ char\ *string, -size_t\ nmatch, regmatch_t\ pmatch[], int\ eflags); -.HP -size_t\ regerror(int\ errcode, const\ regex_t\ *preg, -char\ *errbuf, size_t\ errbuf_size); -.HP -void\ regfree(regex_t\ *preg); -.\".ad -.ft -.SH DESCRIPTION -These routines implement POSIX 1003.2 regular expressions (``RE''s); -see -.ZR . -.I Regcomp -compiles an RE written as a string into an internal form, -.I regexec -matches that internal form against a string and reports results, -.I regerror -transforms error codes from either into human-readable messages, -and -.I regfree -frees any dynamically-allocated storage used by the internal form -of an RE. -.PP -The header -.I -declares two structure types, -.I regex_t -and -.IR regmatch_t , -the former for compiled internal forms and the latter for match reporting. -It also declares the four functions, -a type -.IR regoff_t , -and a number of constants with names starting with ``REG_''. -.PP -.I Regcomp -compiles the regular expression contained in the -.I pattern -string, -subject to the flags in -.IR cflags , -and places the results in the -.I regex_t -structure pointed to by -.IR preg . -.I Cflags -is the bitwise OR of zero or more of the following flags: -.IP REG_EXTENDED \w'REG_EXTENDED'u+2n -Compile modern (``extended'') REs, -rather than the obsolete (``basic'') REs that -are the default. -.IP REG_BASIC -This is a synonym for 0, -provided as a counterpart to REG_EXTENDED to improve readability. -.IP REG_NOSPEC -Compile with recognition of all special characters turned off. -All characters are thus considered ordinary, -so the ``RE'' is a literal string. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -REG_EXTENDED and REG_NOSPEC may not be used -in the same call to -.IR regcomp . -.IP REG_ICASE -Compile for matching that ignores upper/lower case distinctions. -See -.ZR . -.IP REG_NOSUB -Compile for matching that need only report success or failure, -not what was matched. -.IP REG_NEWLINE -Compile for newline-sensitive matching. -By default, newline is a completely ordinary character with no special -meaning in either REs or strings. -With this flag, -`[^' bracket expressions and `.' never match newline, -a `^' anchor matches the null string after any newline in the string -in addition to its normal function, -and the `$' anchor matches the null string before any newline in the -string in addition to its normal function. -.IP REG_PEND -The regular expression ends, -not at the first NUL, -but just before the character pointed to by the -.I re_endp -member of the structure pointed to by -.IR preg . -The -.I re_endp -member is of type -.IR const\ char\ * . -This flag permits inclusion of NULs in the RE; -they are considered ordinary characters. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -When successful, -.I regcomp -returns 0 and fills in the structure pointed to by -.IR preg . -One member of that structure -(other than -.IR re_endp ) -is publicized: -.IR re_nsub , -of type -.IR size_t , -contains the number of parenthesized subexpressions within the RE -(except that the value of this member is undefined if the -REG_NOSUB flag was used). -If -.I regcomp -fails, it returns a non-zero error code; -see DIAGNOSTICS. -.PP -.I Regexec -matches the compiled RE pointed to by -.I preg -against the -.IR string , -subject to the flags in -.IR eflags , -and reports results using -.IR nmatch , -.IR pmatch , -and the returned value. -The RE must have been compiled by a previous invocation of -.IR regcomp . -The compiled form is not altered during execution of -.IR regexec , -so a single compiled RE can be used simultaneously by multiple threads. -.PP -By default, -the NUL-terminated string pointed to by -.I string -is considered to be the text of an entire line, minus any terminating -newline. -The -.I eflags -argument is the bitwise OR of zero or more of the following flags: -.IP REG_NOTBOL \w'REG_STARTEND'u+2n -The first character of -the string -is not the beginning of a line, so the `^' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_NOTEOL -The NUL terminating -the string -does not end a line, so the `$' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_STARTEND -The string is considered to start at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_so\fR -and to have a terminating NUL located at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_eo\fR -(there need not actually be a NUL at that location), -regardless of the value of -.IR nmatch . -See below for the definition of -.IR pmatch -and -.IR nmatch . -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Note that a non-zero \fIrm_so\fR does not imply REG_NOTBOL; -REG_STARTEND affects only the location of the string, -not how it is matched. -.PP -See -.ZR -for a discussion of what is matched in situations where an RE or a -portion thereof could match any of several substrings of -.IR string . -.PP -Normally, -.I regexec -returns 0 for success and the non-zero code REG_NOMATCH for failure. -Other non-zero error codes may be returned in exceptional situations; -see DIAGNOSTICS. -.PP -If REG_NOSUB was specified in the compilation of the RE, -or if -.I nmatch -is 0, -.I regexec -ignores the -.I pmatch -argument (but see below for the case where REG_STARTEND is specified). -Otherwise, -.I pmatch -points to an array of -.I nmatch -structures of type -.IR regmatch_t . -Such a structure has at least the members -.I rm_so -and -.IR rm_eo , -both of type -.I regoff_t -(a signed arithmetic type at least as large as an -.I off_t -and a -.IR ssize_t ), -containing respectively the offset of the first character of a substring -and the offset of the first character after the end of the substring. -Offsets are measured from the beginning of the -.I string -argument given to -.IR regexec . -An empty substring is denoted by equal offsets, -both indicating the character following the empty substring. -.PP -The 0th member of the -.I pmatch -array is filled in to indicate what substring of -.I string -was matched by the entire RE. -Remaining members report what substring was matched by parenthesized -subexpressions within the RE; -member -.I i -reports subexpression -.IR i , -with subexpressions counted (starting at 1) by the order of their opening -parentheses in the RE, left to right. -Unused entries in the array\(emcorresponding either to subexpressions that -did not participate in the match at all, or to subexpressions that do not -exist in the RE (that is, \fIi\fR\ > \fIpreg\fR\->\fIre_nsub\fR)\(emhave both -.I rm_so -and -.I rm_eo -set to \-1. -If a subexpression participated in the match several times, -the reported substring is the last one it matched. -(Note, as an example in particular, that when the RE `(b*)+' matches `bbb', -the parenthesized subexpression matches each of the three `b's and then -an infinite number of empty strings following the last `b', -so the reported substring is one of the empties.) -.PP -If REG_STARTEND is specified, -.I pmatch -must point to at least one -.I regmatch_t -(even if -.I nmatch -is 0 or REG_NOSUB was specified), -to hold the input offsets for REG_STARTEND. -Use for output is still entirely controlled by -.IR nmatch ; -if -.I nmatch -is 0 or REG_NOSUB was specified, -the value of -.IR pmatch [0] -will not be changed by a successful -.IR regexec . -.PP -.I Regerror -maps a non-zero -.I errcode -from either -.I regcomp -or -.I regexec -to a human-readable, printable message. -If -.I preg -is non-NULL, -the error code should have arisen from use of -the -.I regex_t -pointed to by -.IR preg , -and if the error code came from -.IR regcomp , -it should have been the result from the most recent -.I regcomp -using that -.IR regex_t . -.RI ( Regerror -may be able to supply a more detailed message using information -from the -.IR regex_t .) -.I Regerror -places the NUL-terminated message into the buffer pointed to by -.IR errbuf , -limiting the length (including the NUL) to at most -.I errbuf_size -bytes. -If the whole message won't fit, -as much of it as will fit before the terminating NUL is supplied. -In any case, -the returned value is the size of buffer needed to hold the whole -message (including terminating NUL). -If -.I errbuf_size -is 0, -.I errbuf -is ignored but the return value is still correct. -.PP -If the -.I errcode -given to -.I regerror -is first ORed with REG_ITOA, -the ``message'' that results is the printable name of the error code, -e.g. ``REG_NOMATCH'', -rather than an explanation thereof. -If -.I errcode -is REG_ATOI, -then -.I preg -shall be non-NULL and the -.I re_endp -member of the structure it points to -must point to the printable name of an error code; -in this case, the result in -.I errbuf -is the decimal digits of -the numeric value of the error code -(0 if the name is not recognized). -REG_ITOA and REG_ATOI are intended primarily as debugging facilities; -they are extensions, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Be warned also that they are considered experimental and changes are possible. -.PP -.I Regfree -frees any dynamically-allocated storage associated with the compiled RE -pointed to by -.IR preg . -The remaining -.I regex_t -is no longer a valid compiled RE -and the effect of supplying it to -.I regexec -or -.I regerror -is undefined. -.PP -None of these functions references global variables except for tables -of constants; -all are safe for use from multiple threads if the arguments are safe. -.SH IMPLEMENTATION CHOICES -There are a number of decisions that 1003.2 leaves up to the implementor, -either by explicitly saying ``undefined'' or by virtue of them being -forbidden by the RE grammar. -This implementation treats them as follows. -.PP -See -.ZR -for a discussion of the definition of case-independent matching. -.PP -There is no particular limit on the length of REs, -except insofar as memory is limited. -Memory usage is approximately linear in RE size, and largely insensitive -to RE complexity, except for bounded repetitions. -See BUGS for one short RE using them -that will run almost any system out of memory. -.PP -A backslashed character other than one specifically given a magic meaning -by 1003.2 (such magic meanings occur only in obsolete [``basic''] REs) -is taken as an ordinary character. -.PP -Any unmatched [ is a REG_EBRACK error. -.PP -Equivalence classes cannot begin or end bracket-expression ranges. -The endpoint of one range cannot begin another. -.PP -RE_DUP_MAX, the limit on repetition counts in bounded repetitions, is 255. -.PP -A repetition operator (?, *, +, or bounds) cannot follow another -repetition operator. -A repetition operator cannot begin an expression or subexpression -or follow `^' or `|'. -.PP -`|' cannot appear first or last in a (sub)expression or after another `|', -i.e. an operand of `|' cannot be an empty subexpression. -An empty parenthesized subexpression, `()', is legal and matches an -empty (sub)string. -An empty string is not a legal RE. -.PP -A `{' followed by a digit is considered the beginning of bounds for a -bounded repetition, which must then follow the syntax for bounds. -A `{' \fInot\fR followed by a digit is considered an ordinary character. -.PP -`^' and `$' beginning and ending subexpressions in obsolete (``basic'') -REs are anchors, not ordinary characters. -.SH SEE ALSO -grep(1), regex(7) -.PP -POSIX 1003.2, sections 2.8 (Regular Expression Notation) -and -B.5 (C Binding for Regular Expression Matching). -.SH DIAGNOSTICS -Non-zero error codes from -.I regcomp -and -.I regexec -include the following: -.PP -.nf -.ta \w'REG_ECOLLATE'u+3n -REG_NOMATCH regexec() failed to match -REG_BADPAT invalid regular expression -REG_ECOLLATE invalid collating element -REG_ECTYPE invalid character class -REG_EESCAPE \e applied to unescapable character -REG_ESUBREG invalid backreference number -REG_EBRACK brackets [ ] not balanced -REG_EPAREN parentheses ( ) not balanced -REG_EBRACE braces { } not balanced -REG_BADBR invalid repetition count(s) in { } -REG_ERANGE invalid character range in [ ] -REG_ESPACE ran out of memory -REG_BADRPT ?, *, or + operand invalid -REG_EMPTY empty (sub)expression -REG_ASSERT ``can't happen''\(emyou found a bug -REG_INVARG invalid argument, e.g. negative-length string -.fi -.SH HISTORY -Written by Henry Spencer at University of Toronto, -henry@zoo.toronto.edu. -.SH BUGS -This is an alpha release with known defects. -Please report problems. -.PP -There is one known functionality bug. -The implementation of internationalization is incomplete: -the locale is always assumed to be the default one of 1003.2, -and only the collating elements etc. of that locale are available. -.PP -The back-reference code is subtle and doubts linger about its correctness -in complex cases. -.PP -.I Regexec -performance is poor. -This will improve with later releases. -.I Nmatch -exceeding 0 is expensive; -.I nmatch -exceeding 1 is worse. -.I Regexec -is largely insensitive to RE complexity \fIexcept\fR that back -references are massively expensive. -RE length does matter; in particular, there is a strong speed bonus -for keeping RE length under about 30 characters, -with most special characters counting roughly double. -.PP -.I Regcomp -implements bounded repetitions by macro expansion, -which is costly in time and space if counts are large -or bounded repetitions are nested. -An RE like, say, -`((((a{1,100}){1,100}){1,100}){1,100}){1,100}' -will (eventually) run almost any existing machine out of swap space. -.PP -There are suspected problems with response to obscure error conditions. -Notably, -certain kinds of internal overflow, -produced only by truly enormous REs or by multiply nested bounded repetitions, -are probably not handled well. -.PP -Due to a mistake in 1003.2, things like `a)b' are legal REs because `)' is -a special character only in the presence of a previous unmatched `('. -This can't be fixed until the spec is fixed. -.PP -The standard's definition of back references is vague. -For example, does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'? -Until the standard is clarified, -behavior in such cases should not be relied on. -.PP -The implementation of word-boundary matching is a bit of a kludge, -and bugs may lurk in combinations of word-boundary matching and anchoring. diff --git a/ext/ereg/regex/regex.7 b/ext/ereg/regex/regex.7 deleted file mode 100644 index d89012bda1dcd..0000000000000 --- a/ext/ereg/regex/regex.7 +++ /dev/null @@ -1,233 +0,0 @@ -.TH REGEX 7 "7 Feb 1994" -.BY "Henry Spencer" -.SH NAME -regex \- POSIX 1003.2 regular expressions -.SH DESCRIPTION -Regular expressions (``RE''s), -as defined in POSIX 1003.2, come in two forms: -modern REs (roughly those of -.IR egrep ; -1003.2 calls these ``extended'' REs) -and obsolete REs (roughly those of -.IR ed ; -1003.2 ``basic'' REs). -Obsolete REs mostly exist for backward compatibility in some old programs; -they will be discussed at the end. -1003.2 leaves some aspects of RE syntax and semantics open; -`\(dg' marks decisions on these aspects that -may not be fully portable to other 1003.2 implementations. -.PP -A (modern) RE is one\(dg or more non-empty\(dg \fIbranches\fR, -separated by `|'. -It matches anything that matches one of the branches. -.PP -A branch is one\(dg or more \fIpieces\fR, concatenated. -It matches a match for the first, followed by a match for the second, etc. -.PP -A piece is an \fIatom\fR possibly followed -by a single\(dg `*', `+', `?', or \fIbound\fR. -An atom followed by `*' matches a sequence of 0 or more matches of the atom. -An atom followed by `+' matches a sequence of 1 or more matches of the atom. -An atom followed by `?' matches a sequence of 0 or 1 matches of the atom. -.PP -A \fIbound\fR is `{' followed by an unsigned decimal integer, -possibly followed by `,' -possibly followed by another unsigned decimal integer, -always followed by `}'. -The integers must lie between 0 and RE_DUP_MAX (255\(dg) inclusive, -and if there are two of them, the first may not exceed the second. -An atom followed by a bound containing one integer \fIi\fR -and no comma matches -a sequence of exactly \fIi\fR matches of the atom. -An atom followed by a bound -containing one integer \fIi\fR and a comma matches -a sequence of \fIi\fR or more matches of the atom. -An atom followed by a bound -containing two integers \fIi\fR and \fIj\fR matches -a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. -.PP -An atom is a regular expression enclosed in `()' (matching a match for the -regular expression), -an empty set of `()' (matching the null string)\(dg, -a \fIbracket expression\fR (see below), `.' -(matching any single character), `^' (matching the null string at the -beginning of a line), `$' (matching the null string at the -end of a line), a `\e' followed by one of the characters -`^.[$()|*+?{\e' -(matching that character taken as an ordinary character), -a `\e' followed by any other character\(dg -(matching that character taken as an ordinary character, -as if the `\e' had not been present\(dg), -or a single character with no other significance (matching that character). -A `{' followed by a character other than a digit is an ordinary -character, not the beginning of a bound\(dg. -It is illegal to end an RE with `\e'. -.PP -A \fIbracket expression\fR is a list of characters enclosed in `[]'. -It normally matches any single character from the list (but see below). -If the list begins with `^', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -If two characters in the list are separated by `\-', this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. `[0-9]' in ASCII matches any decimal digit. -It is illegal\(dg for two ranges to share an -endpoint, e.g. `a-c-e'. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal `]' in the list, make it the first character -(following a possible `^'). -To include a literal `\-', make it the first or last character, -or the second endpoint of a range. -To use a literal `\-' as the first endpoint of a range, -enclose it in `[.' and `.]' to make it a collating element (see below). -With the exception of these and some combinations using `[' (see next -paragraphs), all other special characters, including `\e', lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in `[.' and `.]' stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression containing a multi-character collating element -can thus match more than one character, -e.g. if the collating sequence includes a `ch' collating element, -then the RE `[[.ch.]]*c' matches the first five characters -of `chchcc'. -.PP -Within a bracket expression, a collating element enclosed in `[=' and -`=]' is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `[.' and `.]'.) -For example, if o and \o'o^' are the members of an equivalence class, -then `[[=o=]]', `[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous. -An equivalence class may not\(dg be an endpoint -of a range. -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in `[:' and `:]' stands for the list of all characters belonging to that -class. -Standard character class names are: -.PP -.RS -.nf -.ta 3c 6c 9c -alnum digit punct -alpha graph space -blank lower upper -cntrl print xdigit -.fi -.RE -.PP -These stand for the character classes defined in -.IR ctype (3). -A locale may provide others. -A character class may not be used as an endpoint of a range. -.PP -There are two special cases\(dg of bracket expressions: -the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at -the beginning and end of a word respectively. -A word is defined as a sequence of -word characters -which is neither preceded nor followed by -word characters. -A word character is an -.I alnum -character (as defined by -.IR ctype (3)) -or an underscore. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -it matches the longest. -Subexpressions also match the longest possible substrings, subject to -the constraint that the whole match be as long as possible, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that higher-level subexpressions thus take priority over -their lower-level component subexpressions. -.PP -Match lengths are measured in characters, not collating elements. -A null string is considered longer than no match at all. -For example, -`bb*' matches the three middle characters of `abbbc', -`(wee|week)(knights|nights)' matches all ten characters of `weeknights', -when `(.*).*' is matched against `abc' the parenthesized subexpression -matches all three characters, and -when `(a*)*' is matched against `bc' both the whole RE and the parenthesized -subexpression match the null string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -e.g. `x' becomes `[xX]'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that (e.g.) `[x]' -becomes `[xX]' and `[^x]' becomes `[^xX]'. -.PP -No particular limit is imposed on the length of REs\(dg. -Programs intended to be portable should not employ REs longer -than 256 bytes, -as an implementation can refuse to accept such REs and remain -POSIX-compliant. -.PP -Obsolete (``basic'') regular expressions differ in several respects. -`|', `+', and `?' are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are `\e{' and `\e}', -with `{' and `}' by themselves ordinary characters. -The parentheses for nested subexpressions are `\e(' and `\e)', -with `(' and `)' by themselves ordinary characters. -`^' is an ordinary character except at the beginning of the -RE or\(dg the beginning of a parenthesized subexpression, -`$' is an ordinary character except at the end of the -RE or\(dg the end of a parenthesized subexpression, -and `*' is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `^'). -Finally, there is one new type of atom, a \fIback reference\fR: -`\e' followed by a non-zero decimal digit \fId\fR -matches the same sequence of characters -matched by the \fId\fRth parenthesized subexpression -(numbering subexpressions by the positions of their opening parentheses, -left to right), -so that (e.g.) `\e([bc]\e)\e1' matches `bb' or `cc' but not `bc'. -.SH SEE ALSO -regex(3) -.PP -POSIX 1003.2, section 2.8 (Regular Expression Notation). -.SH BUGS -Having two kinds of REs is a botch. -.PP -The current 1003.2 spec says that `)' is an ordinary character in -the absence of an unmatched `('; -this was an unintentional result of a wording error, -and change is likely. -Avoid relying on it. -.PP -Back references are a dreadful botch, -posing major problems for efficient implementations. -They are also somewhat vaguely defined -(does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?). -Avoid using them. -.PP -1003.2's specification of case-independent matching is vague. -The ``one case implies all cases'' definition given above -is current consensus among implementors as to the right interpretation. -.PP -The syntax for word boundaries is incredibly ugly. diff --git a/ext/ereg/regex/regex.dsp b/ext/ereg/regex/regex.dsp deleted file mode 100644 index e8f1ad42995e4..0000000000000 --- a/ext/ereg/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/ext/ereg/regex/regex.dsw b/ext/ereg/regex/regex.dsw deleted file mode 100644 index 7b7df8126c4b5..0000000000000 --- a/ext/ereg/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/ext/ereg/regex/regex.h b/ext/ereg/regex/regex.h deleted file mode 100644 index b39c5e178c6b7..0000000000000 --- a/ext/ereg/regex/regex.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _HSREGEX_H_ -#define _HSREGEX_H_ -#ifndef _HSREGEX_H -#define _HSREGEX_H /* never again */ -/* ========= begin header generated by ././mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regex2.h === */ -#ifdef WIN32 -#define API_EXPORT(type) __declspec(dllexport) type __stdcall -#else -#define API_EXPORT(type) type -#endif - -typedef off_t regoff_t; -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - - -/* === regcomp.c === */ -API_EXPORT(int) regcomp(regex_t *, const char *, int); -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - - -/* === regerror.c === */ -#define REG_OKAY 0 -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ -API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - - -/* === regexec.c === */ -API_EXPORT(int) regexec(const regex_t *, const char *, size_t, regmatch_t [], int); -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - - -/* === regfree.c === */ -API_EXPORT(void) regfree(regex_t *); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ././mkh ========= */ -#endif -#endif diff --git a/ext/ereg/regex/regex.mak b/ext/ereg/regex/regex.mak deleted file mode 100644 index b87ded340b396..0000000000000 --- a/ext/ereg/regex/regex.mak +++ /dev/null @@ -1,304 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on regex.dsp -!IF "$(CFG)" == "" -CFG=regex - Win32 Release -!MESSAGE No configuration specified. Defaulting to regex - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "regex - Win32 Release" && "$(CFG)" != "regex - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Release/ -CPP_SBRS=. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regcomp.sbr" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regerror.sbr" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regexec.sbr" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\regfree.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.bsc" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "." /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\Debug/ -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - "$(INTDIR)\regcomp.sbr" \ - "$(INTDIR)\regerror.sbr" \ - "$(INTDIR)\regexec.sbr" \ - "$(INTDIR)\regfree.sbr" - -"$(OUTDIR)\regex.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(CFG)" == "regex - Win32 Release" || "$(CFG)" == "regex - Win32 Debug" -SOURCE=.\regcomp.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regcomp.obj" : $(SOURCE) $(DEP_CPP_REGCO) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regcomp.obj" "$(INTDIR)\regcomp.sbr" : $(SOURCE) $(DEP_CPP_REGCO)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regerror.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regerror.obj" : $(SOURCE) $(DEP_CPP_REGER) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regerror.obj" "$(INTDIR)\regerror.sbr" : $(SOURCE) $(DEP_CPP_REGER)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regexec.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regexec.obj" : $(SOURCE) $(DEP_CPP_REGEX) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regexec.obj" "$(INTDIR)\regexec.sbr" : $(SOURCE) $(DEP_CPP_REGEX)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regfree.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regfree.obj" : $(SOURCE) $(DEP_CPP_REGFR) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regfree.obj" "$(INTDIR)\regfree.sbr" : $(SOURCE) $(DEP_CPP_REGFR)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\engine.c - -!ENDIF - diff --git a/ext/ereg/regex/regex2.h b/ext/ereg/regex/regex2.h deleted file mode 100644 index 4996f96ecd354..0000000000000 --- a/ext/ereg/regex/regex2.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * First, the stuff that ends up in the outside-world include file - = #ifdef WIN32 - = #define API_EXPORT(type) __declspec(dllexport) type __stdcall - = #else - = #define API_EXPORT(type) type - = #endif - = - = typedef off_t regoff_t; - = typedef struct { - = int re_magic; - = size_t re_nsub; // number of parenthesized subexpressions - = const unsigned char *re_endp; // end pointer for REG_PEND - = struct re_guts *re_g; // none of your business :-) - = } regex_t; - = typedef struct { - = regoff_t rm_so; // start of match - = regoff_t rm_eo; // end of match - = } regmatch_t; - */ -/* - * internals of regex_t - */ -#define MAGIC1 ((('r'^0200)<<8) | 'e') - -/* - * The internal representation is a *strip*, a sequence of - * operators ending with an endmarker. (Some terminology etc. is a - * historical relic of earlier versions which used multiple strips.) - * Certain oddities in the representation are there to permit running - * the machinery backwards; in particular, any deviation from sequential - * flow must be marked at both its source and its destination. Some - * fine points: - * - * - OPLUS_ and O_PLUS are *inside* the loop they create. - * - OQUEST_ and O_QUEST are *outside* the bypass they create. - * - OCH_ and O_CH are *outside* the multi-way branch they create, while - * OOR1 and OOR2 are respectively the end and the beginning of one of - * the branches. Note that there is an implicit OOR2 following OCH_ - * and an implicit OOR1 preceding O_CH. - * - * In state representations, an operator's bit is on to signify a state - * immediately *preceding* "execution" of that operator. - */ -typedef long sop; /* strip operator */ -typedef long sopno; -#define OPRMASK 0x7c000000 -#define OPDMASK 0x03ffffff -#define OPSHIFT (26) -#define OP(n) ((n)&OPRMASK) -#define OPND(n) ((n)&OPDMASK) -#define SOP(op, opnd) ((op)|(opnd)) -/* operators meaning operand */ -/* (back, fwd are offsets) */ -#define OEND (1< uch [csetsize] */ - uch mask; /* bit within array */ - uch hash; /* hash code */ - size_t smultis; - unsigned char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ -} cset; -/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ -#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c)) -#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c)) -#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) -#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ -#define MCsub(p, cs, cp) mcsub(p, cs, cp) -#define MCin(p, cs, cp) mcin(p, cs, cp) - -/* stuff for character categories */ -typedef unsigned char cat_t; - -/* - * main compiled-expression structure - */ -struct re_guts { - int magic; -# define MAGIC2 ((('R'^0200)<<8)|'E') - sop *strip; /* malloced area for strip */ - int csetsize; /* number of bits in a cset vector */ - int ncsets; /* number of csets in use */ - cset *sets; /* -> cset [ncsets] */ - uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ - int cflags; /* copy of regcomp() cflags argument */ - sopno nstates; /* = number of sops */ - sopno firststate; /* the initial OEND (normally 0) */ - sopno laststate; /* the final OEND */ - int iflags; /* internal flags */ -# define USEBOL 01 /* used ^ */ -# define USEEOL 02 /* used $ */ -# define BAD 04 /* something wrong */ - int nbol; /* number of ^ used */ - int neol; /* number of $ used */ - int ncategories; /* how many character categories */ - cat_t *categories; /* ->catspace[-UCHAR_MIN] */ - unsigned char *must; /* match must contain this string */ - int mlen; /* length of must */ - size_t nsub; /* copy of re_nsub */ - int backrefs; /* does it use back references? */ - sopno nplus; /* how deep does it nest +s? */ - /* catspace must be last */ - cat_t catspace[1]; /* actually [NC] */ -}; - -/* misc utilities */ -#define OUT (UCHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum(c) || (c) == '_') diff --git a/ext/ereg/regex/regex_extra.h b/ext/ereg/regex/regex_extra.h deleted file mode 100644 index d668f7613f8d4..0000000000000 --- a/ext/ereg/regex/regex_extra.h +++ /dev/null @@ -1,23 +0,0 @@ -/* do not frame this - we must be able to include this file multiple times */ - -#undef regexec -#undef regerror -#undef regfree -#undef regcomp - -#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX)) - -#ifndef PHP_WIN32 - -#ifndef PHP_NO_ALIASES - -#define regexec php_regexec -#define regerror php_regerror -#define regfree php_regfree -#define regcomp php_regcomp - -#endif - -#endif - -#endif diff --git a/ext/ereg/regex/regexec.c b/ext/ereg/regex/regexec.c deleted file mode 100644 index bbfe094c96ca2..0000000000000 --- a/ext/ereg/regex/regexec.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * the outer shell of regexec() - * - * This file includes engine.c *twice*, after muchos fiddling with the - * macros that code uses. This lets the same code operate on two different - * representations for state sets. - */ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -#define PHP_REGEX_NOPE 0; /* for use in asserts; shuts lint up */ - -/* macros for manipulating states, small version */ -#define states unsigned -#define states1 unsigned /* for later use in regexec() decision */ -#define CLEAR(v) ((v) = 0) -#define SET0(v, n) ((v) &= ~((unsigned)1 << (n))) -#define SET1(v, n) ((v) |= (unsigned)1 << (n)) -#define ISSET(v, n) ((v) & ((unsigned)1 << (n))) -#define ASSIGN(d, s) ((d) = (s)) -#define EQ(a, b) ((a) == (b)) -#define STATEVARS int dummy /* dummy version */ -#define STATESETUP(m, n) /* nothing */ -#define STATETEARDOWN(m) /* nothing */ -#define SETUP(v) ((v) = 0) -#define onestate unsigned -#define INIT(o, n) ((o) = (unsigned)1 << (n)) -#define INC(o) ((o) <<= 1) -#define ISSTATEIN(v, o) ((v) & (o)) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) << (n)) -#define BACK(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) >> (n)) -#define ISSETBACK(v, n) ((v) & ((unsigned)here >> (n))) -/* function names */ -#define SNAMES /* engine.c looks after details */ - -#include "engine.c" - -/* now undo things */ -#undef states -#undef CLEAR -#undef SET0 -#undef SET1 -#undef ISSET -#undef ASSIGN -#undef EQ -#undef STATEVARS -#undef STATESETUP -#undef STATETEARDOWN -#undef SETUP -#undef onestate -#undef INIT -#undef INC -#undef ISSTATEIN -#undef FWD -#undef BACK -#undef ISSETBACK -#undef SNAMES - -/* macros for manipulating states, large version */ -#define states unsigned char * -#define CLEAR(v) memset(v, 0, m->g->nstates) -#define SET0(v, n) ((v)[n] = 0) -#define SET1(v, n) ((v)[n] = 1) -#define ISSET(v, n) ((v)[n]) -#define ASSIGN(d, s) memcpy(d, s, m->g->nstates) -#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) -#define STATEVARS int vn; unsigned char *space -#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \ - if ((m)->space == NULL) return(REG_ESPACE); \ - (m)->vn = 0; } -#define STATETEARDOWN(m) { free((m)->space); } -#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) -#define onestate int -#define INIT(o, n) ((o) = (n)) -#define INC(o) ((o)++) -#define ISSTATEIN(v, o) ((v)[o]) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst)[here+(n)] |= (src)[here]) -#define BACK(dst, src, n) ((dst)[here-(n)] |= (src)[here]) -#define ISSETBACK(v, n) ((v)[here - (n)]) -/* function names */ -#define LNAMES /* flag */ - -#include "engine.c" - -/* - - regexec - interface for matching - = API_EXPORT(int) regexec(const regex_t *, const char *, size_t, \ - = regmatch_t [], int); - = #define REG_NOTBOL 00001 - = #define REG_NOTEOL 00002 - = #define REG_STARTEND 00004 - = #define REG_TRACE 00400 // tracing of execution - = #define REG_LARGE 01000 // force large representation - = #define REG_BACKR 02000 // force use of backref code - * - * We put this here so we can exploit knowledge of the state representation - * when choosing which matcher to call. Also, by this point the matchers - * have been prototyped. - */ -API_EXPORT(int) /* 0 success, REG_NOMATCH failure */ -regexec(preg, string, nmatch, pmatch, eflags) -const regex_t *preg; -const char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register struct re_guts *g = preg->re_g; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND)) -#endif - - if (preg->re_magic != MAGIC1 || g->magic != MAGIC2) - return(REG_BADPAT); - assert(!(g->iflags&BAD)); - if (g->iflags&BAD) /* backstop for no-debug case */ - return(REG_BADPAT); - eflags = GOODFLAGS(eflags); - - if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); - else - return(lmatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); -} diff --git a/ext/ereg/regex/regfree.c b/ext/ereg/regex/regfree.c deleted file mode 100644 index 9fd618a13b83a..0000000000000 --- a/ext/ereg/regex/regfree.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -/* - - regfree - free everything - = API_EXPORT(void) regfree(regex_t *); - */ -API_EXPORT(void) -regfree(preg) -regex_t *preg; -{ - register struct re_guts *g; - - if (preg->re_magic != MAGIC1) /* oops */ - return; /* nice to complain, but hard */ - - g = preg->re_g; - if (g == NULL || g->magic != MAGIC2) /* oops again */ - return; - preg->re_magic = 0; /* mark it invalid */ - g->magic = 0; /* mark it invalid */ - - if (g->strip != NULL) - free((char *)g->strip); - if (g->sets != NULL) - free((char *)g->sets); - if (g->setbits != NULL) - free((char *)g->setbits); - if (g->must != NULL) - free(g->must); - free((char *)g); -} diff --git a/ext/ereg/regex/split.c b/ext/ereg/regex/split.c deleted file mode 100644 index 188bdb775b9ff..0000000000000 --- a/ext/ereg/regex/split.c +++ /dev/null @@ -1,316 +0,0 @@ -#include -#include - -/* - - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); - */ -int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ -{ - register char *p = string; - register char c; /* latest character */ - register char sepc = sep[0]; - register char sepc2; - register int fn; - register char **fp = fields; - register char *sepp; - register int trimtrail; - - /* white space */ - if (sepc == '\0') { - while ((c = *p++) == ' ' || c == '\t') - continue; - p--; - trimtrail = 1; - sep = " \t"; /* note, code below knows this is 2 long */ - sepc = ' '; - } else - trimtrail = 0; - sepc2 = sep[1]; /* now we can safely pick this up */ - - /* catch empties */ - if (*p == '\0') - return(0); - - /* single separator */ - if (sepc2 == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - if (fn == 0) - break; - while ((c = *p++) != sepc) - if (c == '\0') - return(nfields - fn); - *(p-1) = '\0'; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - for (;;) { - while ((c = *p++) != sepc) - if (c == '\0') - return(fn); - fn++; - } - /* not reached */ - } - - /* two separators */ - if (sep[2] == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - while ((c = *p++) != sepc && c != sepc2) - if (c == '\0') { - if (trimtrail && **(fp-1) == '\0') - fn++; - return(nfields - fn); - } - if (fn == 0) - break; - *(p-1) = '\0'; - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - while (c != '\0') { - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - fn++; - while ((c = *p++) != '\0' && c != sepc && c != sepc2) - continue; - } - /* might have to trim trailing white space */ - if (trimtrail) { - p--; - while ((c = *--p) == sepc || c == sepc2) - continue; - p++; - if (*p != '\0') { - if (fn == nfields+1) - *p = '\0'; - fn--; - } - } - return(fn); - } - - /* n separators */ - fn = 0; - for (;;) { - if (fn < nfields) - *fp++ = p; - fn++; - for (;;) { - c = *p++; - if (c == '\0') - return(fn); - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc != '\0') /* it was a separator */ - break; - } - if (fn < nfields) - *(p-1) = '\0'; - for (;;) { - c = *p++; - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc == '\0') /* it wasn't a separator */ - break; - } - p--; - } - - /* not reached */ -} - -#ifdef TEST_SPLIT - - -/* - * test program - * pgm runs regression - * pgm sep splits stdin lines by sep - * pgm str sep splits str by sep - * pgm str sep n splits str by sep n times - */ -int -main(argc, argv) -int argc; -char *argv[]; -{ - char buf[512]; - register int n; -# define MNF 10 - char *fields[MNF]; - - if (argc > 4) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - } - else if (argc > 3) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - (void) split(buf, fields, MNF, argv[2]); - } - else if (argc > 2) - dosplit(argv[1], argv[2]); - else if (argc > 1) - while (fgets(buf, sizeof(buf), stdin) != NULL) { - buf[strlen(buf)-1] = '\0'; /* stomp newline */ - dosplit(buf, argv[1]); - } - else - regress(); - - exit(0); -} - -dosplit(string, seps) -char *string; -char *seps; -{ -# define NF 5 - char *fields[NF]; - register int nf; - - nf = split(string, fields, NF, seps); - print(nf, NF, fields); -} - -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; -{ - register int fn; - register int bound; - - bound = (nf > nfp) ? nfp : nf; - printf("%d:\t", nf); - for (fn = 0; fn < bound; fn++) - printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n"); -} - -#define RNF 5 /* some table entries know this */ -struct { - char *str; - char *seps; - int nf; - char *fi[RNF]; -} tests[] = { - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 5, { "abc", "def", "", "g", "" }, - " a bcd", " ", 4, { "", "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", " _", 0, { "" }, - " ", " _", 2, { "", "" }, - "x", " _", 1, { "x" }, - "x y", " _", 2, { "x", "y" }, - "ab _ cd", " _", 2, { "ab", "cd" }, - " a_b c ", " _", 5, { "", "a", "b", "c", "" }, - "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " _", 6, { "", "a", "b", "c", "d " }, - - "", " _~", 0, { "" }, - " ", " _~", 2, { "", "" }, - "x", " _~", 1, { "x" }, - "x y", " _~", 2, { "x", "y" }, - "ab _~ cd", " _~", 2, { "ab", "cd" }, - " a_b c~", " _~", 5, { "", "a", "b", "c", "" }, - "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" }, - "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " }, - - "", " _~-", 0, { "" }, - " ", " _~-", 2, { "", "" }, - "x", " _~-", 1, { "x" }, - "x y", " _~-", 2, { "x", "y" }, - "ab _~- cd", " _~-", 2, { "ab", "cd" }, - " a_b c~", " _~-", 5, { "", "a", "b", "c", "" }, - "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" }, - "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " }, - - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 4, { "abc", "def", "g", "" }, - " a bcd", " ", 3, { "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", "", 0, { "" }, - " ", "", 0, { "" }, - "x", "", 1, { "x" }, - "xy", "", 1, { "xy" }, - "x y", "", 2, { "x", "y" }, - "abc def g ", "", 3, { "abc", "def", "g" }, - "\t a bcd", "", 2, { "a", "bcd" }, - " a \tb\t c ", "", 3, { "a", "b", "c" }, - "a b c d e ", "", 5, { "a", "b", "c", "d", "e" }, - "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" }, - " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " }, - - NULL, NULL, 0, { NULL }, -}; - -regress() -{ - char buf[512]; - register int n; - char *fields[RNF+1]; - register int nf; - register int i; - register int printit; - register char *f; - - for (n = 0; tests[n].str != NULL; n++) { - (void) strcpy(buf, tests[n].str); - fields[RNF] = NULL; - nf = split(buf, fields, RNF, tests[n].seps); - printit = 0; - if (nf != tests[n].nf) { - printf("split `%s' by `%s' gave %d fields, not %d\n", - tests[n].str, tests[n].seps, nf, tests[n].nf); - printit = 1; - } else if (fields[RNF] != NULL) { - printf("split() went beyond array end\n"); - printit = 1; - } else { - for (i = 0; i < nf && i < RNF; i++) { - f = fields[i]; - if (f == NULL) - f = "(NULL)"; - if (strcmp(f, tests[n].fi[i]) != 0) { - printf("split `%s' by `%s', field %d is `%s', not `%s'\n", - tests[n].str, tests[n].seps, - i, fields[i], tests[n].fi[i]); - printit = 1; - } - } - } - if (printit) - print(nf, RNF, fields); - } -} -#endif diff --git a/ext/ereg/regex/tests b/ext/ereg/regex/tests deleted file mode 100644 index c05846177f594..0000000000000 --- a/ext/ereg/regex/tests +++ /dev/null @@ -1,475 +0,0 @@ -# regular expression test set -# Lines are at least three fields, separated by one or more tabs. "" stands -# for an empty field. First field is an RE. Second field is flags. If -# C flag given, regcomp() is expected to fail, and the third field is the -# error name (minus the leading REG_). -# -# Otherwise it is expected to succeed, and the third field is the string to -# try matching it against. If there is no fourth field, the match is -# expected to fail. If there is a fourth field, it is the substring that -# the RE is expected to match. If there is a fifth field, it is a comma- -# separated list of what the subexpressions should match, with - indicating -# no match for that one. In both the fourth and fifth fields, a (sub)field -# starting with @ indicates that the (sub)expression is expected to match -# a null string followed by the stuff after the @; this provides a way to -# test where null strings match. The character `N' in REs and strings -# is newline, `S' is space, `T' is tab, `Z' is NUL. -# -# The full list of flags: -# - placeholder, does nothing -# b RE is a BRE, not an ERE -# & try it as both an ERE and a BRE -# C regcomp() error expected, third field is error name -# i REG_ICASE -# m ("mundane") REG_NOSPEC -# s REG_NOSUB (not really testable) -# n REG_NEWLINE -# ^ REG_NOTBOL -# $ REG_NOTEOL -# # REG_STARTEND (see below) -# p REG_PEND -# -# For REG_STARTEND, the start/end offsets are those of the substring -# enclosed in (). - -# basics -a & a a -abc & abc abc -abc|de - abc abc -a|b|c - abc a - -# parentheses and perversions thereof -a(b)c - abc abc -a\(b\)c b abc abc -a( C EPAREN -a( b a( a( -a\( - a( a( -a\( bC EPAREN -a\(b bC EPAREN -a(b C EPAREN -a(b b a(b a(b -# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly) -a) - a) a) -) - ) ) -# end gagging (in a just world, those *should* give EPAREN) -a) b a) a) -a\) bC EPAREN -\) bC EPAREN -a()b - ab ab -a\(\)b b ab ab - -# anchoring and REG_NEWLINE -^abc$ & abc abc -a^b - a^b -a^b b a^b a^b -a$b - a$b -a$b b a$b a$b -^ & abc @abc -$ & abc @ -^$ & "" @ -$^ - "" @ -\($\)\(^\) b "" @ -# stop retching, those are legitimate (although disgusting) -^^ - "" @ -$$ - "" @ -b$ & abNc -b$ &n abNc b -^b$ & aNbNc -^b$ &n aNbNc b -^$ &n aNNb @Nb -^$ n abc -^$ n abcN @ -$^ n aNNb @Nb -\($\)\(^\) bn aNNb @Nb -^^ n^ aNNb @Nb -$$ n aNNb @NN -^a ^ a -a$ $ a -^a ^n aNb -^b ^n aNb b -a$ $n bNa -b$ $n bNa b -a*(^b$)c* - b b -a*\(^b$\)c* b b b - -# certain syntax errors and non-errors -| C EMPTY -| b | | -* C BADRPT -* b * * -+ C BADRPT -? C BADRPT -"" &C EMPTY -() - abc @abc -\(\) b abc @abc -a||b C EMPTY -|ab C EMPTY -ab| C EMPTY -(|a)b C EMPTY -(a|)b C EMPTY -(*a) C BADRPT -(+a) C BADRPT -(?a) C BADRPT -({1}a) C BADRPT -\(\{1\}a\) bC BADRPT -(a|*b) C BADRPT -(a|+b) C BADRPT -(a|?b) C BADRPT -(a|{1}b) C BADRPT -^* C BADRPT -^* b * * -^+ C BADRPT -^? C BADRPT -^{1} C BADRPT -^\{1\} bC BADRPT - -# metacharacters, backslashes -a.c & abc abc -a[bc]d & abd abd -a\*c & a*c a*c -a\\b & a\b a\b -a\\\*b & a\*b a\*b -a\bc & abc abc -a\ &C EESCAPE -a\\bc & a\bc a\bc -\{ bC BADRPT -a\[b & a[b a[b -a[b &C EBRACK -# trailing $ is a peculiar special case for the BRE code -a$ & a a -a$ & a$ -a\$ & a -a\$ & a$ a$ -a\\$ & a -a\\$ & a$ -a\\$ & a\$ -a\\$ & a\ a\ - -# back references, ugh -a\(b\)\2c bC ESUBREG -a\(b\1\)c bC ESUBREG -a\(b*\)c\1d b abbcbbd abbcbbd bb -a\(b*\)c\1d b abbcbd -a\(b*\)c\1d b abbcbbbd -^\(.\)\1 b abc -a\([bc]\)\1d b abcdabbd abbd b -a\(\([bc]\)\2\)*d b abbccd abbccd -a\(\([bc]\)\2\)*d b abbcbd -# actually, this next one probably ought to fail, but the spec is unclear -a\(\(b\)*\2\)*d b abbbd abbbd -# here is a case that no NFA implementation does right -\(ab*\)[ab]*\1 b ababaaa ababaaa a -# check out normal matching in the presence of back refs -\(a\)\1bcd b aabcd aabcd -\(a\)\1bc*d b aabcd aabcd -\(a\)\1bc*d b aabd aabd -\(a\)\1bc*d b aabcccd aabcccd -\(a\)\1bc*[ce]d b aabcccd aabcccd -^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd - -# ordinary repetitions -ab*c & abc abc -ab+c - abc abc -ab?c - abc abc -a\(*\)b b a*b a*b -a\(**\)b b ab ab -a\(***\)b bC BADRPT -*a b *a *a -**a b a a -***a bC BADRPT - -# the dreaded bounded repetitions -{ & { { -{abc & {abc {abc -{1 C BADRPT -{1} C BADRPT -a{b & a{b a{b -a{1}b - ab ab -a\{1\}b b ab ab -a{1,}b - ab ab -a\{1,\}b b ab ab -a{1,2}b - aab aab -a\{1,2\}b b aab aab -a{1 C EBRACE -a\{1 bC EBRACE -a{1a C EBRACE -a\{1a bC EBRACE -a{1a} C BADBR -a\{1a\} bC BADBR -a{,2} - a{,2} a{,2} -a\{,2\} bC BADBR -a{,} - a{,} a{,} -a\{,\} bC BADBR -a{1,x} C BADBR -a\{1,x\} bC BADBR -a{1,x C EBRACE -a\{1,x bC EBRACE -a{300} C BADBR -a\{300\} bC BADBR -a{1,0} C BADBR -a\{1,0\} bC BADBR -ab{0,0}c - abcac ac -ab\{0,0\}c b abcac ac -ab{0,1}c - abcac abc -ab\{0,1\}c b abcac abc -ab{0,3}c - abbcac abbc -ab\{0,3\}c b abbcac abbc -ab{1,1}c - acabc abc -ab\{1,1\}c b acabc abc -ab{1,3}c - acabc abc -ab\{1,3\}c b acabc abc -ab{2,2}c - abcabbc abbc -ab\{2,2\}c b abcabbc abbc -ab{2,4}c - abcabbc abbc -ab\{2,4\}c b abcabbc abbc -((a{1,10}){1,10}){1,10} - a a a,a - -# multiple repetitions -a** &C BADRPT -a++ C BADRPT -a?? C BADRPT -a*+ C BADRPT -a*? C BADRPT -a+* C BADRPT -a+? C BADRPT -a?* C BADRPT -a?+ C BADRPT -a{1}{1} C BADRPT -a*{1} C BADRPT -a+{1} C BADRPT -a?{1} C BADRPT -a{1}* C BADRPT -a{1}+ C BADRPT -a{1}? C BADRPT -a*{b} - a{b} a{b} -a\{1\}\{1\} bC BADRPT -a*\{1\} bC BADRPT -a\{1\}* bC BADRPT - -# brackets, and numerous perversions thereof -a[b]c & abc abc -a[ab]c & abc abc -a[^ab]c & adc adc -a[]b]c & a]c a]c -a[[b]c & a[c a[c -a[-b]c & a-c a-c -a[^]b]c & adc adc -a[^-b]c & adc adc -a[b-]c & a-c a-c -a[b &C EBRACK -a[] &C EBRACK -a[1-3]c & a2c a2c -a[3-1]c &C ERANGE -a[1-3-5]c &C ERANGE -a[[.-.]--]c & a-c a-c -a[1- &C ERANGE -a[[. &C EBRACK -a[[.x &C EBRACK -a[[.x. &C EBRACK -a[[.x.] &C EBRACK -a[[.x.]] & ax ax -a[[.x,.]] &C ECOLLATE -a[[.one.]]b & a1b a1b -a[[.notdef.]]b &C ECOLLATE -a[[.].]]b & a]b a]b -a[[:alpha:]]c & abc abc -a[[:notdef:]]c &C ECTYPE -a[[: &C EBRACK -a[[:alpha &C EBRACK -a[[:alpha:] &C EBRACK -a[[:alpha,:] &C ECTYPE -a[[:]:]]b &C ECTYPE -a[[:-:]]b &C ECTYPE -a[[:alph:]] &C ECTYPE -a[[:alphabet:]] &C ECTYPE -[[:alnum:]]+ - -%@a0X- a0X -[[:alpha:]]+ - -%@aX0- aX -[[:blank:]]+ - aSSTb SST -[[:cntrl:]]+ - aNTb NT -[[:digit:]]+ - a019b 019 -[[:graph:]]+ - Sa%bS a%b -[[:lower:]]+ - AabC ab -[[:print:]]+ - NaSbN aSb -[[:punct:]]+ - S%-&T %-& -[[:space:]]+ - aSNTb SNT -[[:upper:]]+ - aBCd BC -[[:xdigit:]]+ - p0f3Cq 0f3C -a[[=b=]]c & abc abc -a[[= &C EBRACK -a[[=b &C EBRACK -a[[=b= &C EBRACK -a[[=b=] &C EBRACK -a[[=b,=]] &C ECOLLATE -a[[=one=]]b & a1b a1b - -# complexities -a(((b)))c - abc abc -a(b|(c))d - abd abd -a(b*|c)d - abbd abbd -# just gotta have one DFA-buster, of course -a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and an inline expansion in case somebody gets tricky -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and in case somebody just slips in an NFA... -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights -# fish for anomalies as the number of states passes 32 -12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789 -123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890 -1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901 -12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012 -123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123 -# and one really big one, beyond any plausible word width -1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890 -# fish for problems as brackets go past 8 -[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm -[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo -[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq -[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq - -# subtleties of matching -abc & xabcy abc -a\(b\)?c\1d b acd -aBc i Abc Abc -a[Bc]*d i abBCcd abBCcd -0[[:upper:]]1 &i 0a1 0a1 -0[[:lower:]]1 &i 0A1 0A1 -a[^b]c &i abc -a[^b]c &i aBc -a[^b]c &i adc adc -[a]b[c] - abc abc -[a]b[a] - aba aba -[abc]b[abc] - abc abc -[abc]b[abd] - abd abd -a(b?c)+d - accd accd -(wee|week)(knights|night) - weeknights weeknights -(we|wee|week|frob)(knights|night|day) - weeknights weeknights -a[bc]d - xyzaaabcaababdacd abd -a[ab]c - aaabc abc -abc s abc abc -a* & b @b - -# Let's have some fun -- try to match a C comment. -# first the obvious, which looks okay at first glance... -/\*.*\*/ - /*x*/ /*x*/ -# but... -/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ -# okay, we must not match */ inside; try to do that... -/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ -/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ -# but... -/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ -# and a still fancier version, which does it right (I think)... -/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ -/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ - -# subexpressions -a(b)(c)d - abcd abcd b,c -a(((b)))c - abc abc b,b,b -a(b|(c))d - abd abd b,- -a(b*|c|e)d - abbd abbd bb -a(b*|c|e)d - acd acd c -a(b*|c|e)d - ad ad @d -a(b?)c - abc abc b -a(b?)c - ac ac @c -a(b+)c - abc abc b -a(b+)c - abbbc abbbc bbb -a(b*)c - ac ac @c -(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de -# the regression tester only asks for 9 subexpressions -a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j -a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k -a([bc]?)c - abc abc b -a([bc]?)c - ac ac @c -a([bc]+)c - abc abc b -a([bc]+)c - abcc abcc bc -a([bc]+)bc - abcbc abcbc bc -a(bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abbb abbb bb -a(bbb+|bb+|b)bb - abbb abbb b -(.*).* - abcdef abcdef abcdef -(a*)* - bc @b @b - -# do we get the right subexpression when it is used more than once? -a(b|c)*d - ad ad - -a(b|c)*d - abcd abcd c -a(b|c)+d - abd abd b -a(b|c)+d - abcd abcd c -a(b|c?)+d - ad ad @d -a(b|c?)+d - abcd abcd @d -a(b|c){0,0}d - ad ad - -a(b|c){0,1}d - ad ad - -a(b|c){0,1}d - abd abd b -a(b|c){0,2}d - ad ad - -a(b|c){0,2}d - abcd abcd c -a(b|c){0,}d - ad ad - -a(b|c){0,}d - abcd abcd c -a(b|c){1,1}d - abd abd b -a(b|c){1,1}d - acd acd c -a(b|c){1,2}d - abd abd b -a(b|c){1,2}d - abcd abcd c -a(b|c){1,}d - abd abd b -a(b|c){1,}d - abcd abcd c -a(b|c){2,2}d - acbd acbd b -a(b|c){2,2}d - abcd abcd c -a(b|c){2,4}d - abcd abcd c -a(b|c){2,4}d - abcbd abcbd b -a(b|c){2,4}d - abcbcd abcbcd c -a(b|c){2,}d - abcd abcd c -a(b|c){2,}d - abcbd abcbd b -a(b+|((c)*))+d - abd abd @d,@d,- -a(b+|((c)*))+d - abcd abcd @d,@d,- - -# check out the STARTEND option -[abc] &# a(b)c b -[abc] &# a(d)c -[abc] &# a(bc)d b -[abc] &# a(dc)d c -. &# a()c -b.*c &# b(bc)c bc -b.* &# b(bc)c bc -.*c &# b(bc)c bc - -# plain strings, with the NOSPEC flag -abc m abc abc -abc m xabcy abc -abc m xyz -a*b m aba*b a*b -a*b m ab -"" mC EMPTY - -# cases involving NULs -aZb & a a -aZb &p a -aZb &p# (aZb) aZb -aZ*b &p# (ab) ab -a.b &# (aZb) aZb -a.* &# (aZb)c aZb - -# word boundaries (ick) -[[:<:]]a & a a -[[:<:]]a & ba -[[:<:]]a & -a a -a[[:>:]] & a a -a[[:>:]] & ab -a[[:>:]] & a- a -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc -[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc -[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc -[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_ -[[:<:]]a_b[[:>:]] & x_a_b - -# past problems, and suspected problems -(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1 -abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop -abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv -(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 -CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 -Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz -a?b - ab ab --\{0,1\}[0-9]*$ b -5 -5 diff --git a/ext/ereg/regex/utils.h b/ext/ereg/regex/utils.h deleted file mode 100644 index cd4a96025f24a..0000000000000 --- a/ext/ereg/regex/utils.h +++ /dev/null @@ -1,25 +0,0 @@ -/* utility definitions */ - -#include "regex_extra.h" - -#ifdef _POSIX2_RE_DUP_MAX -#define DUPMAX _POSIX2_RE_DUP_MAX -#else -#define DUPMAX 255 -#endif -#define INFINITY (DUPMAX + 1) -#define NC (CHAR_MAX - CHAR_MIN + 1) -typedef unsigned char uch; - -/* switch off assertions (if not already off) if no REDEBUG */ -#ifndef REDEBUG -#ifndef NDEBUG -#define NDEBUG /* no assertions please */ -#endif -#endif -#include - -/* for old systems with bcopy() but no memmove() */ -#ifdef USEBCOPY -#define memmove(d, s, c) bcopy(s, d, c) -#endif diff --git a/ext/ereg/tests/001.phpt b/ext/ereg/tests/001.phpt deleted file mode 100644 index 13c50d0d1e458..0000000000000 --- a/ext/ereg/tests/001.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -RegReplace test 1 ---FILE-- - ---EXPECT-- -abcdef diff --git a/ext/ereg/tests/002.phpt b/ext/ereg/tests/002.phpt deleted file mode 100644 index abe9e063d8b76..0000000000000 --- a/ext/ereg/tests/002.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -RegReplace test 2 ---FILE-- - ---EXPECT-- -abc diff --git a/ext/ereg/tests/003.phpt b/ext/ereg/tests/003.phpt deleted file mode 100644 index 4257f0d27e78d..0000000000000 --- a/ext/ereg/tests/003.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -ereg_replace single-quote test ---FILE-- - ---EXPECT-- -'test diff --git a/ext/ereg/tests/004.phpt b/ext/ereg/tests/004.phpt deleted file mode 100644 index 3e535c6a9de40..0000000000000 --- a/ext/ereg/tests/004.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -simple ereg test ---FILE-- - ---EXPECT-- -ok -ok diff --git a/ext/ereg/tests/005.phpt b/ext/ereg/tests/005.phpt deleted file mode 100644 index ee9ccc6da4afc..0000000000000 --- a/ext/ereg/tests/005.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test Regular expression register support in ereg ---FILE-- - ---EXPECT-- -32 -This is a nice and simple string -is -is diff --git a/ext/ereg/tests/006.phpt b/ext/ereg/tests/006.phpt deleted file mode 100644 index cae349672ed76..0000000000000 --- a/ext/ereg/tests/006.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Test ereg_replace of start-of-line ---FILE-- - ---EXPECT-- -That is a nice and simple string diff --git a/ext/ereg/tests/007.phpt b/ext/ereg/tests/007.phpt deleted file mode 100644 index beb3cdc159176..0000000000000 --- a/ext/ereg/tests/007.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Test empty result buffer in reg_replace ---FILE-- - ---EXPECT-- -strlen($b)=0 diff --git a/ext/ereg/tests/008.phpt b/ext/ereg/tests/008.phpt deleted file mode 100644 index 9a0cedabc5338..0000000000000 --- a/ext/ereg/tests/008.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Test back-references in regular expressions ---FILE-- - ---EXPECT-- -123 abc +-|= diff --git a/ext/ereg/tests/009.phpt b/ext/ereg/tests/009.phpt deleted file mode 100644 index 528606f3c897d..0000000000000 --- a/ext/ereg/tests/009.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test split() ---FILE-- - ---EXPECT-- -4 -this -is -a -test diff --git a/ext/ereg/tests/010.phpt b/ext/ereg/tests/010.phpt deleted file mode 100644 index f6f8909f73d7b..0000000000000 --- a/ext/ereg/tests/010.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -Long back references ---FILE-- - ---EXPECT-- -abc2222222222def2222222222 diff --git a/ext/ereg/tests/011.phpt b/ext/ereg/tests/011.phpt deleted file mode 100644 index 65554b302fc6a..0000000000000 --- a/ext/ereg/tests/011.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -\0 back reference ---FILE-- - ---EXPECT-- -abcdef123ghi diff --git a/ext/ereg/tests/012.phpt b/ext/ereg/tests/012.phpt deleted file mode 100644 index 88ad5992addf9..0000000000000 --- a/ext/ereg/tests/012.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -nonexisting back reference ---FILE-- - ---EXPECT-- -abcdef\1ghi diff --git a/ext/ereg/tests/013.phpt b/ext/ereg/tests/013.phpt deleted file mode 100644 index a2d9ee009910e..0000000000000 --- a/ext/ereg/tests/013.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -escapes in replace string ---FILE-- - ---EXPECT-- -abcdef\g\\hi\ diff --git a/ext/ereg/tests/014.phpt b/ext/ereg/tests/014.phpt deleted file mode 100644 index d2a32451a9d94..0000000000000 --- a/ext/ereg/tests/014.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -backreferences not replaced recursively ---FILE-- - ---EXPECT-- -\2 diff --git a/ext/ereg/tests/015.phpt b/ext/ereg/tests/015.phpt deleted file mode 100644 index c255ddf05bb9f..0000000000000 --- a/ext/ereg/tests/015.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -replace empty matches ---FILE-- - ---EXPECT-- -zabc123 diff --git a/ext/ereg/tests/016.phpt b/ext/ereg/tests/016.phpt deleted file mode 100644 index c354ab26fc5f2..0000000000000 --- a/ext/ereg/tests/016.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -test backslash handling in regular expressions ---FILE-- - ---EXPECT-- -abc123abc diff --git a/ext/exif/CREDITS b/ext/exif/CREDITS deleted file mode 100644 index 94de97e5b09f1..0000000000000 --- a/ext/exif/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -EXIF -Rasmus Lerdorf, Marcus Boerger diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 deleted file mode 100644 index a3ba9240df595..0000000000000 --- a/ext/exif/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support, -[ --enable-exif Enable EXIF (metadata from images) support]) - -if test "$PHP_EXIF" != "no"; then - AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support]) - PHP_NEW_EXTENSION(exif, exif.c, $ext_shared) -fi diff --git a/ext/exif/config.w32 b/ext/exif/config.w32 deleted file mode 100644 index 3ac0108f2d006..0000000000000 --- a/ext/exif/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("exif", "exif", "no"); - -if (PHP_EXIF == "yes") { - EXTENSION("exif", "exif.c"); - AC_DEFINE('HAVE_EXIF', 1, 'Have exif'); - ADD_EXTENSION_DEP('exif', 'mbstring'); -} diff --git a/ext/exif/example.php b/ext/exif/example.php deleted file mode 100644 index e34dc05f6d4cc..0000000000000 --- a/ext/exif/example.php +++ /dev/null @@ -1,23 +0,0 @@ - - - -exif_read_data example - - -\n" : "Image contains headers
"; -$exif = exif_read_data ('tests/test2.jpg',0,true); -foreach($exif as $key=>$section) { - foreach($section as $name=>$val) { - echo "$key.$name: $val
\n"; - } -} -?> - - \ No newline at end of file diff --git a/ext/exif/exif.c b/ext/exif/exif.c deleted file mode 100644 index dca6d85201d2e..0000000000000 --- a/ext/exif/exif.c +++ /dev/null @@ -1,4077 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* ToDos - * - * See if example images from http://www.exif.org have illegal - * thumbnail sizes or if code is corrupt. - * Create/Update exif headers. - * Create/Remove/Update image thumbnails. - */ - -/* Security - * - * At current time i do not see any security problems but a potential - * attacker could generate an image with recursive ifd pointers...(Marcus) - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/file.h" - -#if HAVE_EXIF - -/* When EXIF_DEBUG is defined the module generates a lot of debug messages - * that help understanding what is going on. This can and should be used - * while extending the module as it shows if you are at the right position. - * You are always considered to have a copy of TIFF6.0 and EXIF2.10 standard. - */ -#undef EXIF_DEBUG - -#ifdef EXIF_DEBUG -#define EXIFERR_DC , const char *_file, size_t _line TSRMLS_DC -#define EXIFERR_CC , __FILE__, __LINE__ TSRMLS_CC -#else -#define EXIFERR_DC TSRMLS_DC -#define EXIFERR_CC TSRMLS_CC -#endif - -#undef EXIF_JPEG2000 - -#include "php_exif.h" -#include -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_image.h" -#include "ext/standard/info.h" - -#if defined(PHP_WIN32) || (HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)) -#define EXIF_USE_MBSTRING 1 -#else -#define EXIF_USE_MBSTRING 0 -#endif - -#if EXIF_USE_MBSTRING -#include "ext/mbstring/mbstring.h" -#endif - -/* needed for ssize_t definition */ -#include - -typedef unsigned char uchar; - -#ifndef safe_emalloc -# define safe_emalloc(a,b,c) emalloc((a)*(b)+(c)) -#endif - -#ifndef TRUE -# define TRUE 1 -# define FALSE 0 -#endif - -#ifndef max -# define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -#define EFREE_IF(ptr) if (ptr) efree(ptr) - -#define MAX_IFD_NESTING_LEVEL 100 - -static -ZEND_BEGIN_ARG_INFO(exif_thumbnail_force_ref, 1) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO(); - -/* {{{ exif_functions[] - */ -function_entry exif_functions[] = { - PHP_FE(exif_read_data, NULL) - PHP_FALIAS(read_exif_data, exif_read_data, NULL) - PHP_FE(exif_tagname, NULL) - PHP_FE(exif_thumbnail, exif_thumbnail_force_ref) - PHP_FE(exif_imagetype, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define EXIF_VERSION "1.4 $Id$" - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(exif) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "EXIF Support", "enabled"); - php_info_print_table_row(2, "EXIF Version", EXIF_VERSION); - php_info_print_table_row(2, "Supported EXIF Version", "0220"); - php_info_print_table_row(2, "Supported filetypes", "JPEG,TIFF"); - php_info_print_table_end(); -} -/* }}} */ - -ZEND_BEGIN_MODULE_GLOBALS(exif) - char * encode_unicode; - char * decode_unicode_be; - char * decode_unicode_le; - char * encode_jis; - char * decode_jis_be; - char * decode_jis_le; -ZEND_END_MODULE_GLOBALS(exif) - -ZEND_DECLARE_MODULE_GLOBALS(exif) - -#ifdef ZTS -#define EXIF_G(v) TSRMG(exif_globals_id, zend_exif_globals *, v) -#else -#define EXIF_G(v) (exif_globals.v) -#endif - -/* {{{ PHP_INI - */ - -ZEND_INI_MH(OnUpdateEncode) -{ -#if EXIF_USE_MBSTRING - if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); - return FAILURE; - } -#endif - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -ZEND_INI_MH(OnUpdateDecode) -{ -#if EXIF_USE_MBSTRING - if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); - return FAILURE; - } -#endif - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("exif.encode_unicode", "ISO-8859-15", PHP_INI_ALL, OnUpdateEncode, encode_unicode, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_unicode_motorola", "UCS-2BE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_be, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_unicode_intel", "UCS-2LE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_le, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.encode_jis", "", PHP_INI_ALL, OnUpdateEncode, encode_jis, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_jis_motorola", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_be, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_jis_intel", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_le, zend_exif_globals, exif_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_extname_init_globals - */ -static void php_exif_init_globals(zend_exif_globals *exif_globals) -{ - exif_globals->encode_unicode = NULL; - exif_globals->decode_unicode_be = NULL; - exif_globals->decode_unicode_le = NULL; - exif_globals->encode_jis = NULL; - exif_globals->decode_jis_be = NULL; - exif_globals->decode_jis_le = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(exif) - Get the size of an image as 4-element array */ -PHP_MINIT_FUNCTION(exif) -{ - ZEND_INIT_MODULE_GLOBALS(exif, php_exif_init_globals, NULL); - REGISTER_INI_ENTRIES(); - REGISTER_LONG_CONSTANT("EXIF_USE_MBSTRING", EXIF_USE_MBSTRING, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(exif) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ exif_module_entry - */ -zend_module_entry exif_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "exif", - exif_functions, - PHP_MINIT(exif), - PHP_MSHUTDOWN(exif), - NULL, NULL, - PHP_MINFO(exif), -#if ZEND_MODULE_API_NO >= 20010901 - EXIF_VERSION, -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_EXIF -ZEND_GET_MODULE(exif) -#endif - -/* {{{ php_strnlen - * get length of string if buffer if less than buffer size or buffer size */ -static size_t php_strnlen(char* str, size_t maxlen) { - size_t len = 0; - - if (str && maxlen && *str) { - do { - len++; - } while (--maxlen && *(++str)); - } - return len; -} -/* }}} */ - -/* {{{ error messages -*/ -static const char * EXIF_ERROR_FILEEOF = "Unexpected end of file reached"; -static const char * EXIF_ERROR_CORRUPT = "File structure corrupted"; -static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached"; -static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section"; - -#define EXIF_ERRLOG_FILEEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FILEEOF); -#define EXIF_ERRLOG_CORRUPT(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_CORRUPT); -#define EXIF_ERRLOG_THUMBEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_THUMBEOF); -#define EXIF_ERRLOG_FSREALLOC(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FSREALLOC); -/* }}} */ - -/* {{{ format description defines - Describes format descriptor -*/ -static int php_tiff_bytes_per_format[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 1}; -#define NUM_FORMATS 13 - -#define TAG_FMT_BYTE 1 -#define TAG_FMT_STRING 2 -#define TAG_FMT_USHORT 3 -#define TAG_FMT_ULONG 4 -#define TAG_FMT_URATIONAL 5 -#define TAG_FMT_SBYTE 6 -#define TAG_FMT_UNDEFINED 7 -#define TAG_FMT_SSHORT 8 -#define TAG_FMT_SLONG 9 -#define TAG_FMT_SRATIONAL 10 -#define TAG_FMT_SINGLE 11 -#define TAG_FMT_DOUBLE 12 -#define TAG_FMT_IFD 13 - -#ifdef EXIF_DEBUG -static char *exif_get_tagformat(int format) -{ - switch(format) { - case TAG_FMT_BYTE: return "BYTE"; - case TAG_FMT_STRING: return "STRING"; - case TAG_FMT_USHORT: return "USHORT"; - case TAG_FMT_ULONG: return "ULONG"; - case TAG_FMT_URATIONAL: return "URATIONAL"; - case TAG_FMT_SBYTE: return "SBYTE"; - case TAG_FMT_UNDEFINED: return "UNDEFINED"; - case TAG_FMT_SSHORT: return "SSHORT"; - case TAG_FMT_SLONG: return "SLONG"; - case TAG_FMT_SRATIONAL: return "SRATIONAL"; - case TAG_FMT_SINGLE: return "SINGLE"; - case TAG_FMT_DOUBLE: return "DOUBLE"; - case TAG_FMT_IFD: return "IFD"; - } - return "*Illegal"; -} -#endif - -/* Describes tag values */ -#define TAG_GPS_VERSION_ID 0x0000 -#define TAG_GPS_LATITUDE_REF 0x0001 -#define TAG_GPS_LATITUDE 0x0002 -#define TAG_GPS_LONGITUDE_REF 0x0003 -#define TAG_GPS_LONGITUDE 0x0004 -#define TAG_GPS_ALTITUDE_REF 0x0005 -#define TAG_GPS_ALTITUDE 0x0006 -#define TAG_GPS_TIME_STAMP 0x0007 -#define TAG_GPS_SATELLITES 0x0008 -#define TAG_GPS_STATUS 0x0009 -#define TAG_GPS_MEASURE_MODE 0x000A -#define TAG_GPS_DOP 0x000B -#define TAG_GPS_SPEED_REF 0x000C -#define TAG_GPS_SPEED 0x000D -#define TAG_GPS_TRACK_REF 0x000E -#define TAG_GPS_TRACK 0x000F -#define TAG_GPS_IMG_DIRECTION_REF 0x0010 -#define TAG_GPS_IMG_DIRECTION 0x0011 -#define TAG_GPS_MAP_DATUM 0x0012 -#define TAG_GPS_DEST_LATITUDE_REF 0x0013 -#define TAG_GPS_DEST_LATITUDE 0x0014 -#define TAG_GPS_DEST_LONGITUDE_REF 0x0015 -#define TAG_GPS_DEST_LONGITUDE 0x0016 -#define TAG_GPS_DEST_BEARING_REF 0x0017 -#define TAG_GPS_DEST_BEARING 0x0018 -#define TAG_GPS_DEST_DISTANCE_REF 0x0019 -#define TAG_GPS_DEST_DISTANCE 0x001A -#define TAG_GPS_PROCESSING_METHOD 0x001B -#define TAG_GPS_AREA_INFORMATION 0x001C -#define TAG_GPS_DATE_STAMP 0x001D -#define TAG_GPS_DIFFERENTIAL 0x001E -#define TAG_TIFF_COMMENT 0x00FE /* SHOUDLNT HAPPEN */ -#define TAG_NEW_SUBFILE 0x00FE /* New version of subfile tag */ -#define TAG_SUBFILE_TYPE 0x00FF /* Old version of subfile tag */ -#define TAG_IMAGEWIDTH 0x0100 -#define TAG_IMAGEHEIGHT 0x0101 -#define TAG_BITS_PER_SAMPLE 0x0102 -#define TAG_COMPRESSION 0x0103 -#define TAG_PHOTOMETRIC_INTERPRETATION 0x0106 -#define TAG_TRESHHOLDING 0x0107 -#define TAG_CELL_WIDTH 0x0108 -#define TAG_CELL_HEIGHT 0x0109 -#define TAG_FILL_ORDER 0x010A -#define TAG_DOCUMENT_NAME 0x010D -#define TAG_IMAGE_DESCRIPTION 0x010E -#define TAG_MAKE 0x010F -#define TAG_MODEL 0x0110 -#define TAG_STRIP_OFFSETS 0x0111 -#define TAG_ORIENTATION 0x0112 -#define TAG_SAMPLES_PER_PIXEL 0x0115 -#define TAG_ROWS_PER_STRIP 0x0116 -#define TAG_STRIP_BYTE_COUNTS 0x0117 -#define TAG_MIN_SAMPPLE_VALUE 0x0118 -#define TAG_MAX_SAMPLE_VALUE 0x0119 -#define TAG_X_RESOLUTION 0x011A -#define TAG_Y_RESOLUTION 0x011B -#define TAG_PLANAR_CONFIGURATION 0x011C -#define TAG_PAGE_NAME 0x011D -#define TAG_X_POSITION 0x011E -#define TAG_Y_POSITION 0x011F -#define TAG_FREE_OFFSETS 0x0120 -#define TAG_FREE_BYTE_COUNTS 0x0121 -#define TAG_GRAY_RESPONSE_UNIT 0x0122 -#define TAG_GRAY_RESPONSE_CURVE 0x0123 -#define TAG_RESOLUTION_UNIT 0x0128 -#define TAG_PAGE_NUMBER 0x0129 -#define TAG_TRANSFER_FUNCTION 0x012D -#define TAG_SOFTWARE 0x0131 -#define TAG_DATETIME 0x0132 -#define TAG_ARTIST 0x013B -#define TAG_HOST_COMPUTER 0x013C -#define TAG_PREDICTOR 0x013D -#define TAG_WHITE_POINT 0x013E -#define TAG_PRIMARY_CHROMATICITIES 0x013F -#define TAG_COLOR_MAP 0x0140 -#define TAG_HALFTONE_HINTS 0x0141 -#define TAG_TILE_WIDTH 0x0142 -#define TAG_TILE_LENGTH 0x0143 -#define TAG_TILE_OFFSETS 0x0144 -#define TAG_TILE_BYTE_COUNTS 0x0145 -#define TAG_SUB_IFD 0x014A -#define TAG_INK_SETMPUTER 0x014C -#define TAG_INK_NAMES 0x014D -#define TAG_NUMBER_OF_INKS 0x014E -#define TAG_DOT_RANGE 0x0150 -#define TAG_TARGET_PRINTER 0x0151 -#define TAG_EXTRA_SAMPLE 0x0152 -#define TAG_SAMPLE_FORMAT 0x0153 -#define TAG_S_MIN_SAMPLE_VALUE 0x0154 -#define TAG_S_MAX_SAMPLE_VALUE 0x0155 -#define TAG_TRANSFER_RANGE 0x0156 -#define TAG_JPEG_TABLES 0x015B -#define TAG_JPEG_PROC 0x0200 -#define TAG_JPEG_INTERCHANGE_FORMAT 0x0201 -#define TAG_JPEG_INTERCHANGE_FORMAT_LEN 0x0202 -#define TAG_JPEG_RESTART_INTERVAL 0x0203 -#define TAG_JPEG_LOSSLESS_PREDICTOR 0x0205 -#define TAG_JPEG_POINT_TRANSFORMS 0x0206 -#define TAG_JPEG_Q_TABLES 0x0207 -#define TAG_JPEG_DC_TABLES 0x0208 -#define TAG_JPEG_AC_TABLES 0x0209 -#define TAG_YCC_COEFFICIENTS 0x0211 -#define TAG_YCC_SUB_SAMPLING 0x0212 -#define TAG_YCC_POSITIONING 0x0213 -#define TAG_REFERENCE_BLACK_WHITE 0x0214 -/* 0x0301 - 0x0302 */ -/* 0x0320 */ -/* 0x0343 */ -/* 0x5001 - 0x501B */ -/* 0x5021 - 0x503B */ -/* 0x5090 - 0x5091 */ -/* 0x5100 - 0x5101 */ -/* 0x5110 - 0x5113 */ -/* 0x80E3 - 0x80E6 */ -/* 0x828d - 0x828F */ -#define TAG_COPYRIGHT 0x8298 -#define TAG_EXPOSURETIME 0x829A -#define TAG_FNUMBER 0x829D -#define TAG_EXIF_IFD_POINTER 0x8769 -#define TAG_ICC_PROFILE 0x8773 -#define TAG_EXPOSURE_PROGRAM 0x8822 -#define TAG_SPECTRAL_SENSITY 0x8824 -#define TAG_GPS_IFD_POINTER 0x8825 -#define TAG_ISOSPEED 0x8827 -#define TAG_OPTOELECTRIC_CONVERSION_F 0x8828 -/* 0x8829 - 0x882b */ -#define TAG_EXIFVERSION 0x9000 -#define TAG_DATE_TIME_ORIGINAL 0x9003 -#define TAG_DATE_TIME_DIGITIZED 0x9004 -#define TAG_COMPONENT_CONFIG 0x9101 -#define TAG_COMPRESSED_BITS_PER_PIXEL 0x9102 -#define TAG_SHUTTERSPEED 0x9201 -#define TAG_APERTURE 0x9202 -#define TAG_BRIGHTNESS_VALUE 0x9203 -#define TAG_EXPOSURE_BIAS_VALUE 0x9204 -#define TAG_MAX_APERTURE 0x9205 -#define TAG_SUBJECT_DISTANCE 0x9206 -#define TAG_METRIC_MODULE 0x9207 -#define TAG_LIGHT_SOURCE 0x9208 -#define TAG_FLASH 0x9209 -#define TAG_FOCAL_LENGTH 0x920A -/* 0x920B - 0x920D */ -/* 0x9211 - 0x9216 */ -#define TAG_SUBJECT_AREA 0x9214 -#define TAG_MAKER_NOTE 0x927C -#define TAG_USERCOMMENT 0x9286 -#define TAG_SUB_SEC_TIME 0x9290 -#define TAG_SUB_SEC_TIME_ORIGINAL 0x9291 -#define TAG_SUB_SEC_TIME_DIGITIZED 0x9292 -/* 0x923F */ -/* 0x935C */ -#define TAG_XP_TITLE 0x9C9B -#define TAG_XP_COMMENTS 0x9C9C -#define TAG_XP_AUTHOR 0x9C9D -#define TAG_XP_KEYWORDS 0x9C9E -#define TAG_XP_SUBJECT 0x9C9F -#define TAG_FLASH_PIX_VERSION 0xA000 -#define TAG_COLOR_SPACE 0xA001 -#define TAG_COMP_IMAGE_WIDTH 0xA002 /* compressed images only */ -#define TAG_COMP_IMAGE_HEIGHT 0xA003 -#define TAG_RELATED_SOUND_FILE 0xA004 -#define TAG_INTEROP_IFD_POINTER 0xA005 /* IFD pointer */ -#define TAG_FLASH_ENERGY 0xA20B -#define TAG_SPATIAL_FREQUENCY_RESPONSE 0xA20C -#define TAG_FOCALPLANE_X_RES 0xA20E -#define TAG_FOCALPLANE_Y_RES 0xA20F -#define TAG_FOCALPLANE_RESOLUTION_UNIT 0xA210 -#define TAG_SUBJECT_LOCATION 0xA214 -#define TAG_EXPOSURE_INDEX 0xA215 -#define TAG_SENSING_METHOD 0xA217 -#define TAG_FILE_SOURCE 0xA300 -#define TAG_SCENE_TYPE 0xA301 -#define TAG_CFA_PATTERN 0xA302 -#define TAG_CUSTOM_RENDERED 0xA401 -#define TAG_EXPOSURE_MODE 0xA402 -#define TAG_WHITE_BALANCE 0xA403 -#define TAG_DIGITAL_ZOOM_RATIO 0xA404 -#define TAG_FOCAL_LENGTH_IN_35_MM_FILM 0xA405 -#define TAG_SCENE_CAPTURE_TYPE 0xA406 -#define TAG_GAIN_CONTROL 0xA407 -#define TAG_CONTRAST 0xA408 -#define TAG_SATURATION 0xA409 -#define TAG_SHARPNESS 0xA40A -#define TAG_DEVICE_SETTING_DESCRIPTION 0xA40B -#define TAG_SUBJECT_DISTANCE_RANGE 0xA40C -#define TAG_IMAGE_UNIQUE_ID 0xA420 - -/* Olympus specific tags */ -#define TAG_OLYMPUS_SPECIALMODE 0x0200 -#define TAG_OLYMPUS_JPEGQUAL 0x0201 -#define TAG_OLYMPUS_MACRO 0x0202 -#define TAG_OLYMPUS_DIGIZOOM 0x0204 -#define TAG_OLYMPUS_SOFTWARERELEASE 0x0207 -#define TAG_OLYMPUS_PICTINFO 0x0208 -#define TAG_OLYMPUS_CAMERAID 0x0209 -/* end Olympus specific tags */ - -/* Internal */ -#define TAG_NONE -1 /* note that -1 <> 0xFFFF */ -#define TAG_COMPUTED_VALUE -2 -#define TAG_END_OF_LIST 0xFFFD - -/* Values for TAG_PHOTOMETRIC_INTERPRETATION */ -#define PMI_BLACK_IS_ZERO 0 -#define PMI_WHITE_IS_ZERO 1 -#define PMI_RGB 2 -#define PMI_PALETTE_COLOR 3 -#define PMI_TRANSPARENCY_MASK 4 -#define PMI_SEPARATED 5 -#define PMI_YCBCR 6 -#define PMI_CIELAB 8 - -/* }}} */ - -/* {{{ TabTable[] - */ -typedef const struct { - unsigned short Tag; - char *Desc; -} tag_info_type; - -typedef tag_info_type tag_info_array[]; -typedef tag_info_type *tag_table_type; - -#define TAG_TABLE_END \ - {TAG_NONE, "No tag value"},\ - {TAG_COMPUTED_VALUE, "Computed value"},\ - {TAG_END_OF_LIST, ""} /* Important for exif_get_tagname() IF value != "" functionresult is != false */ - -static tag_info_array tag_table_IFD = { - { 0x000B, "ACDComment"}, - { 0x00FE, "NewSubFile"}, /* better name it 'ImageType' ? */ - { 0x00FF, "SubFile"}, - { 0x0100, "ImageWidth"}, - { 0x0101, "ImageLength"}, - { 0x0102, "BitsPerSample"}, - { 0x0103, "Compression"}, - { 0x0106, "PhotometricInterpretation"}, - { 0x010A, "FillOrder"}, - { 0x010D, "DocumentName"}, - { 0x010E, "ImageDescription"}, - { 0x010F, "Make"}, - { 0x0110, "Model"}, - { 0x0111, "StripOffsets"}, - { 0x0112, "Orientation"}, - { 0x0115, "SamplesPerPixel"}, - { 0x0116, "RowsPerStrip"}, - { 0x0117, "StripByteCounts"}, - { 0x0118, "MinSampleValue"}, - { 0x0119, "MaxSampleValue"}, - { 0x011A, "XResolution"}, - { 0x011B, "YResolution"}, - { 0x011C, "PlanarConfiguration"}, - { 0x011D, "PageName"}, - { 0x011E, "XPosition"}, - { 0x011F, "YPosition"}, - { 0x0120, "FreeOffsets"}, - { 0x0121, "FreeByteCounts"}, - { 0x0122, "GrayResponseUnit"}, - { 0x0123, "GrayResponseCurve"}, - { 0x0124, "T4Options"}, - { 0x0125, "T6Options"}, - { 0x0128, "ResolutionUnit"}, - { 0x0129, "PageNumber"}, - { 0x012D, "TransferFunction"}, - { 0x0131, "Software"}, - { 0x0132, "DateTime"}, - { 0x013B, "Artist"}, - { 0x013C, "HostComputer"}, - { 0x013D, "Predictor"}, - { 0x013E, "WhitePoint"}, - { 0x013F, "PrimaryChromaticities"}, - { 0x0140, "ColorMap"}, - { 0x0141, "HalfToneHints"}, - { 0x0142, "TileWidth"}, - { 0x0143, "TileLength"}, - { 0x0144, "TileOffsets"}, - { 0x0145, "TileByteCounts"}, - { 0x014A, "SubIFD"}, - { 0x014C, "InkSet"}, - { 0x014D, "InkNames"}, - { 0x014E, "NumberOfInks"}, - { 0x0150, "DotRange"}, - { 0x0151, "TargetPrinter"}, - { 0x0152, "ExtraSample"}, - { 0x0153, "SampleFormat"}, - { 0x0154, "SMinSampleValue"}, - { 0x0155, "SMaxSampleValue"}, - { 0x0156, "TransferRange"}, - { 0x0157, "ClipPath"}, - { 0x0158, "XClipPathUnits"}, - { 0x0159, "YClipPathUnits"}, - { 0x015A, "Indexed"}, - { 0x015B, "JPEGTables"}, - { 0x015F, "OPIProxy"}, - { 0x0200, "JPEGProc"}, - { 0x0201, "JPEGInterchangeFormat"}, - { 0x0202, "JPEGInterchangeFormatLength"}, - { 0x0203, "JPEGRestartInterval"}, - { 0x0205, "JPEGLosslessPredictors"}, - { 0x0206, "JPEGPointTransforms"}, - { 0x0207, "JPEGQTables"}, - { 0x0208, "JPEGDCTables"}, - { 0x0209, "JPEGACTables"}, - { 0x0211, "YCbCrCoefficients"}, - { 0x0212, "YCbCrSubSampling"}, - { 0x0213, "YCbCrPositioning"}, - { 0x0214, "ReferenceBlackWhite"}, - { 0x02BC, "ExtensibleMetadataPlatform"}, /* XAP: Extensible Authoring Publishing, obsoleted by XMP: Extensible Metadata Platform */ - { 0x0301, "Gamma"}, - { 0x0302, "ICCProfileDescriptor"}, - { 0x0303, "SRGBRenderingIntent"}, - { 0x0320, "ImageTitle"}, - { 0x5001, "ResolutionXUnit"}, - { 0x5002, "ResolutionYUnit"}, - { 0x5003, "ResolutionXLengthUnit"}, - { 0x5004, "ResolutionYLengthUnit"}, - { 0x5005, "PrintFlags"}, - { 0x5006, "PrintFlagsVersion"}, - { 0x5007, "PrintFlagsCrop"}, - { 0x5008, "PrintFlagsBleedWidth"}, - { 0x5009, "PrintFlagsBleedWidthScale"}, - { 0x500A, "HalftoneLPI"}, - { 0x500B, "HalftoneLPIUnit"}, - { 0x500C, "HalftoneDegree"}, - { 0x500D, "HalftoneShape"}, - { 0x500E, "HalftoneMisc"}, - { 0x500F, "HalftoneScreen"}, - { 0x5010, "JPEGQuality"}, - { 0x5011, "GridSize"}, - { 0x5012, "ThumbnailFormat"}, - { 0x5013, "ThumbnailWidth"}, - { 0x5014, "ThumbnailHeight"}, - { 0x5015, "ThumbnailColorDepth"}, - { 0x5016, "ThumbnailPlanes"}, - { 0x5017, "ThumbnailRawBytes"}, - { 0x5018, "ThumbnailSize"}, - { 0x5019, "ThumbnailCompressedSize"}, - { 0x501A, "ColorTransferFunction"}, - { 0x501B, "ThumbnailData"}, - { 0x5020, "ThumbnailImageWidth"}, - { 0x5021, "ThumbnailImageHeight"}, - { 0x5022, "ThumbnailBitsPerSample"}, - { 0x5023, "ThumbnailCompression"}, - { 0x5024, "ThumbnailPhotometricInterp"}, - { 0x5025, "ThumbnailImageDescription"}, - { 0x5026, "ThumbnailEquipMake"}, - { 0x5027, "ThumbnailEquipModel"}, - { 0x5028, "ThumbnailStripOffsets"}, - { 0x5029, "ThumbnailOrientation"}, - { 0x502A, "ThumbnailSamplesPerPixel"}, - { 0x502B, "ThumbnailRowsPerStrip"}, - { 0x502C, "ThumbnailStripBytesCount"}, - { 0x502D, "ThumbnailResolutionX"}, - { 0x502E, "ThumbnailResolutionY"}, - { 0x502F, "ThumbnailPlanarConfig"}, - { 0x5030, "ThumbnailResolutionUnit"}, - { 0x5031, "ThumbnailTransferFunction"}, - { 0x5032, "ThumbnailSoftwareUsed"}, - { 0x5033, "ThumbnailDateTime"}, - { 0x5034, "ThumbnailArtist"}, - { 0x5035, "ThumbnailWhitePoint"}, - { 0x5036, "ThumbnailPrimaryChromaticities"}, - { 0x5037, "ThumbnailYCbCrCoefficients"}, - { 0x5038, "ThumbnailYCbCrSubsampling"}, - { 0x5039, "ThumbnailYCbCrPositioning"}, - { 0x503A, "ThumbnailRefBlackWhite"}, - { 0x503B, "ThumbnailCopyRight"}, - { 0x5090, "LuminanceTable"}, - { 0x5091, "ChrominanceTable"}, - { 0x5100, "FrameDelay"}, - { 0x5101, "LoopCount"}, - { 0x5110, "PixelUnit"}, - { 0x5111, "PixelPerUnitX"}, - { 0x5112, "PixelPerUnitY"}, - { 0x5113, "PaletteHistogram"}, - { 0x1000, "RelatedImageFileFormat"}, - { 0x800D, "ImageID"}, - { 0x80E3, "Matteing"}, /* obsoleted by ExtraSamples */ - { 0x80E4, "DataType"}, /* obsoleted by SampleFormat */ - { 0x80E5, "ImageDepth"}, - { 0x80E6, "TileDepth"}, - { 0x828D, "CFARepeatPatternDim"}, - { 0x828E, "CFAPattern"}, - { 0x828F, "BatteryLevel"}, - { 0x8298, "Copyright"}, - { 0x829A, "ExposureTime"}, - { 0x829D, "FNumber"}, - { 0x83BB, "IPTC/NAA"}, - { 0x84E3, "IT8RasterPadding"}, - { 0x84E5, "IT8ColorTable"}, - { 0x8649, "ImageResourceInformation"}, /* PhotoShop */ - { 0x8769, "Exif_IFD_Pointer"}, - { 0x8773, "ICC_Profile"}, - { 0x8822, "ExposureProgram"}, - { 0x8824, "SpectralSensity"}, - { 0x8828, "OECF"}, - { 0x8825, "GPS_IFD_Pointer"}, - { 0x8827, "ISOSpeedRatings"}, - { 0x8828, "OECF"}, - { 0x9000, "ExifVersion"}, - { 0x9003, "DateTimeOriginal"}, - { 0x9004, "DateTimeDigitized"}, - { 0x9101, "ComponentsConfiguration"}, - { 0x9102, "CompressedBitsPerPixel"}, - { 0x9201, "ShutterSpeedValue"}, - { 0x9202, "ApertureValue"}, - { 0x9203, "BrightnessValue"}, - { 0x9204, "ExposureBiasValue"}, - { 0x9205, "MaxApertureValue"}, - { 0x9206, "SubjectDistance"}, - { 0x9207, "MeteringMode"}, - { 0x9208, "LightSource"}, - { 0x9209, "Flash"}, - { 0x920A, "FocalLength"}, - { 0x920B, "FlashEnergy"}, /* 0xA20B in JPEG */ - { 0x920C, "SpatialFrequencyResponse"}, /* 0xA20C - - */ - { 0x920D, "Noise"}, - { 0x920E, "FocalPlaneXResolution"}, /* 0xA20E - - */ - { 0x920F, "FocalPlaneYResolution"}, /* 0xA20F - - */ - { 0x9210, "FocalPlaneResolutionUnit"}, /* 0xA210 - - */ - { 0x9211, "ImageNumber"}, - { 0x9212, "SecurityClassification"}, - { 0x9213, "ImageHistory"}, - { 0x9214, "SubjectLocation"}, /* 0xA214 - - */ - { 0x9215, "ExposureIndex"}, /* 0xA215 - - */ - { 0x9216, "TIFF/EPStandardID"}, - { 0x9217, "SensingMethod"}, /* 0xA217 - - */ - { 0x923F, "StoNits"}, - { 0x927C, "MakerNote"}, - { 0x9286, "UserComment"}, - { 0x9290, "SubSecTime"}, - { 0x9291, "SubSecTimeOriginal"}, - { 0x9292, "SubSecTimeDigitized"}, - { 0x935C, "ImageSourceData"}, /* "Adobe Photoshop Document Data Block": 8BIM... */ - { 0x9c9b, "Title" }, /* Win XP specific, Unicode */ - { 0x9c9c, "Comments" }, /* Win XP specific, Unicode */ - { 0x9c9d, "Author" }, /* Win XP specific, Unicode */ - { 0x9c9e, "Keywords" }, /* Win XP specific, Unicode */ - { 0x9c9f, "Subject" }, /* Win XP specific, Unicode, not to be confused with SubjectDistance and SubjectLocation */ - { 0xA000, "FlashPixVersion"}, - { 0xA001, "ColorSpace"}, - { 0xA002, "ExifImageWidth"}, - { 0xA003, "ExifImageLength"}, - { 0xA004, "RelatedSoundFile"}, - { 0xA005, "InteroperabilityOffset"}, - { 0xA20B, "FlashEnergy"}, /* 0x920B in TIFF/EP */ - { 0xA20C, "SpatialFrequencyResponse"}, /* 0x920C - - */ - { 0xA20D, "Noise"}, - { 0xA20E, "FocalPlaneXResolution"}, /* 0x920E - - */ - { 0xA20F, "FocalPlaneYResolution"}, /* 0x920F - - */ - { 0xA210, "FocalPlaneResolutionUnit"}, /* 0x9210 - - */ - { 0xA211, "ImageNumber"}, - { 0xA212, "SecurityClassification"}, - { 0xA213, "ImageHistory"}, - { 0xA214, "SubjectLocation"}, /* 0x9214 - - */ - { 0xA215, "ExposureIndex"}, /* 0x9215 - - */ - { 0xA216, "TIFF/EPStandardID"}, - { 0xA217, "SensingMethod"}, /* 0x9217 - - */ - { 0xA300, "FileSource"}, - { 0xA301, "SceneType"}, - { 0xA302, "CFAPattern"}, - { 0xA401, "CustomRendered"}, - { 0xA402, "ExposureMode"}, - { 0xA403, "WhiteBalance"}, - { 0xA404, "DigitalZoomRatio"}, - { 0xA405, "FocalLengthIn35mmFilm"}, - { 0xA406, "SceneCaptureType"}, - { 0xA407, "GainControl"}, - { 0xA408, "Contrast"}, - { 0xA409, "Saturation"}, - { 0xA40A, "Sharpness"}, - { 0xA40B, "DeviceSettingDescription"}, - { 0xA40C, "SubjectDistanceRange"}, - { 0xA420, "ImageUniqueID"}, - TAG_TABLE_END -} ; - -static tag_info_array tag_table_GPS = { - { 0x0000, "GPSVersion"}, - { 0x0001, "GPSLatitudeRef"}, - { 0x0002, "GPSLatitude"}, - { 0x0003, "GPSLongitudeRef"}, - { 0x0004, "GPSLongitude"}, - { 0x0005, "GPSAltitudeRef"}, - { 0x0006, "GPSAltitude"}, - { 0x0007, "GPSTimeStamp"}, - { 0x0008, "GPSSatellites"}, - { 0x0009, "GPSStatus"}, - { 0x000A, "GPSMeasureMode"}, - { 0x000B, "GPSDOP"}, - { 0x000C, "GPSSpeedRef"}, - { 0x000D, "GPSSpeed"}, - { 0x000E, "GPSTrackRef"}, - { 0x000F, "GPSTrack"}, - { 0x0010, "GPSImgDirectionRef"}, - { 0x0011, "GPSImgDirection"}, - { 0x0012, "GPSMapDatum"}, - { 0x0013, "GPSDestLatitudeRef"}, - { 0x0014, "GPSDestLatitude"}, - { 0x0015, "GPSDestLongitudeRef"}, - { 0x0016, "GPSDestLongitude"}, - { 0x0017, "GPSDestBearingRef"}, - { 0x0018, "GPSDestBearing"}, - { 0x0019, "GPSDestDistanceRef"}, - { 0x001A, "GPSDestDistance"}, - { 0x001B, "GPSProcessingMode"}, - { 0x001C, "GPSAreaInformation"}, - { 0x001D, "GPSDateStamp"}, - { 0x001E, "GPSDifferential"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_IOP = { - { 0x0001, "InterOperabilityIndex"}, /* should be 'R98' or 'THM' */ - { 0x0002, "InterOperabilityVersion"}, - { 0x1000, "RelatedFileFormat"}, - { 0x1001, "RelatedImageWidth"}, - { 0x1002, "RelatedImageHeight"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_CANON = { - { 0x0001, "ModeArray"}, /* guess */ - { 0x0004, "ImageInfo"}, /* guess */ - { 0x0006, "ImageType"}, - { 0x0007, "FirmwareVersion"}, - { 0x0008, "ImageNumber"}, - { 0x0009, "OwnerName"}, - { 0x000C, "Camera"}, - { 0x000F, "CustomFunctions"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_CASIO = { - { 0x0001, "RecordingMode"}, - { 0x0002, "Quality"}, - { 0x0003, "FocusingMode"}, - { 0x0004, "FlashMode"}, - { 0x0005, "FlashIntensity"}, - { 0x0006, "ObjectDistance"}, - { 0x0007, "WhiteBalance"}, - { 0x000A, "DigitalZoom"}, - { 0x000B, "Sharpness"}, - { 0x000C, "Contrast"}, - { 0x000D, "Saturation"}, - { 0x0014, "CCDSensitivity"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_FUJI = { - { 0x0000, "Version"}, - { 0x1000, "Quality"}, - { 0x1001, "Sharpness"}, - { 0x1002, "WhiteBalance"}, - { 0x1003, "Color"}, - { 0x1004, "Tone"}, - { 0x1010, "FlashMode"}, - { 0x1011, "FlashStrength"}, - { 0x1020, "Macro"}, - { 0x1021, "FocusMode"}, - { 0x1030, "SlowSync"}, - { 0x1031, "PictureMode"}, - { 0x1100, "ContTake"}, - { 0x1300, "BlurWarning"}, - { 0x1301, "FocusWarning"}, - { 0x1302, "AEWarning "}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_NIKON = { - { 0x0003, "Quality"}, - { 0x0004, "ColorMode"}, - { 0x0005, "ImageAdjustment"}, - { 0x0006, "CCDSensitivity"}, - { 0x0007, "WhiteBalance"}, - { 0x0008, "Focus"}, - { 0x000a, "DigitalZoom"}, - { 0x000b, "Converter"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_NIKON_990 = { - { 0x0001, "Version"}, - { 0x0002, "ISOSetting"}, - { 0x0003, "ColorMode"}, - { 0x0004, "Quality"}, - { 0x0005, "WhiteBalance"}, - { 0x0006, "ImageSharpening"}, - { 0x0007, "FocusMode"}, - { 0x0008, "FlashSetting"}, - { 0x000F, "ISOSelection"}, - { 0x0080, "ImageAdjustment"}, - { 0x0082, "AuxiliaryLens"}, - { 0x0085, "ManualFocusDistance"}, - { 0x0086, "DigitalZoom"}, - { 0x0088, "AFFocusPosition"}, - { 0x0010, "DataDump"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_OLYMPUS = { - { 0x0200, "SpecialMode"}, - { 0x0201, "JPEGQuality"}, - { 0x0202, "Macro"}, - { 0x0204, "DigitalZoom"}, - { 0x0207, "SoftwareRelease"}, - { 0x0208, "PictureInfo"}, - { 0x0209, "CameraId"}, - { 0x0F00, "DataDump"}, - TAG_TABLE_END -}; - -typedef enum mn_byte_order_t { - MN_ORDER_INTEL = 0, - MN_ORDER_MOTOROLA = 1, - MN_ORDER_NORMAL -} mn_byte_order_t; - -typedef enum mn_offset_mode_t { - MN_OFFSET_NORMAL, - MN_OFFSET_MAKER, - MN_OFFSET_GUESS -} mn_offset_mode_t; - -typedef struct { - tag_table_type tag_table; - char * make; - char * model; - char * id_string; - int id_string_len; - int offset; - mn_byte_order_t byte_order; - mn_offset_mode_t offset_mode; -} maker_note_type; - -static const maker_note_type maker_note_array[] = { - { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS}, -/* { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},*/ - { tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL}, - { tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER}, - { tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, - { tag_table_VND_NIKON_990, "NIKON", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, - { tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", NULL, "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, -}; -/* }}} */ - -/* {{{ exif_get_tagname - Get headername for tag_num or NULL if not defined */ -static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC) -{ - int i, t; - char tmp[32]; - - for (i=0;;i++) { - if ((t=tag_table[i].Tag) == tag_num || t==TAG_END_OF_LIST) { - if (t==TAG_END_OF_LIST) { - break; - } - if (ret && len) { - strncpy(ret, tag_table[i].Desc, abs(len)); - if (len<0) { - len = -len; - ret[len-1]='\0'; - for(i=strlen(ret);i=32 ? c : '.'; - tmp[(i%16)+1] = '\0'; - } else { - p += sprintf(buf+p, " "); - } - if (i%16==15) { - p += sprintf(buf+p, " %s", tmp); - if (i>=len) { - break; - } - } - } - } - buf[sizeof(buf)-1] = '\0'; - return buf; -} -#endif -/* }}} */ - -/* {{{ php_jpg_get16 - Get 16 bits motorola order (always) for jpeg header stuff. -*/ -static int php_jpg_get16(void *value) -{ - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; -} -/* }}} */ - -/* {{{ php_ifd_get16u - * Convert a 16 bit unsigned value from file's native byte order */ -static int php_ifd_get16u(void *value, int motorola_intel) -{ - if (motorola_intel) { - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; - } else { - return (((uchar *)value)[1] << 8) | ((uchar *)value)[0]; - } -} -/* }}} */ - -/* {{{ php_ifd_get16s - * Convert a 16 bit signed value from file's native byte order */ -static signed short php_ifd_get16s(void *value, int motorola_intel) -{ - return (signed short)php_ifd_get16u(value, motorola_intel); -} -/* }}} */ - -/* {{{ php_ifd_get32s - * Convert a 32 bit signed value from file's native byte order */ -static int php_ifd_get32s(void *value, int motorola_intel) -{ - if (motorola_intel) { - return (((char *)value)[0] << 24) - | (((uchar *)value)[1] << 16) - | (((uchar *)value)[2] << 8 ) - | (((uchar *)value)[3] ); - } else { - return (((char *)value)[3] << 24) - | (((uchar *)value)[2] << 16) - | (((uchar *)value)[1] << 8 ) - | (((uchar *)value)[0] ); - } -} -/* }}} */ - -/* {{{ php_ifd_get32u - * Write 32 bit unsigned value to data */ -static unsigned php_ifd_get32u(void *value, int motorola_intel) -{ - return (unsigned)php_ifd_get32s(value, motorola_intel) & 0xffffffff; -} -/* }}} */ - -/* {{{ php_ifd_set16u - * Write 16 bit unsigned value to data */ -static void php_ifd_set16u(char *data, unsigned int value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF00) >> 8; - data[1] = (value & 0x00FF); - } else { - data[1] = (value & 0xFF00) >> 8; - data[0] = (value & 0x00FF); - } -} -/* }}} */ - -/* {{{ php_ifd_set32u - * Convert a 32 bit unsigned value from file's native byte order */ -static void php_ifd_set32u(char *data, size_t value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF000000) >> 24; - data[1] = (value & 0x00FF0000) >> 16; - data[2] = (value & 0x0000FF00) >> 8; - data[3] = (value & 0x000000FF); - } else { - data[3] = (value & 0xFF000000) >> 24; - data[2] = (value & 0x00FF0000) >> 16; - data[1] = (value & 0x0000FF00) >> 8; - data[0] = (value & 0x000000FF); - } -} -/* }}} */ - -/* {{{ exif_convert_any_format - * Evaluate number, be it int, rational, or float from directory. */ -static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return (double)php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return (double)php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return (signed short)php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single"); -#endif - return (double)*(float *)value; - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double"); -#endif - return *(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ exif_convert_any_to_int - * Evaluate number, be it int, rational, or float from directory. */ -static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single"); -#endif - return (size_t)*(float *)value; - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double"); -#endif - return (size_t)*(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ struct image_info_value, image_info_list -*/ -#ifndef WORD -#define WORD unsigned short -#endif -#ifndef DWORD -#define DWORD unsigned int -#endif - -typedef struct { - int num; - int den; -} signed_rational; - -typedef struct { - unsigned int num; - unsigned int den; -} unsigned_rational; - -typedef union _image_info_value { - char *s; - unsigned u; - int i; - float f; - double d; - signed_rational sr; - unsigned_rational ur; - union _image_info_value *list; -} image_info_value; - -typedef struct { - WORD tag; - WORD format; - DWORD length; - DWORD dummy; /* value ptr of tiff directory entry */ - char *name; - image_info_value value; -} image_info_data; - -typedef struct { - int count; - image_info_data *list; -} image_info_list; -/* }}} */ - -/* {{{ exif_get_sectionname - Returns the name of a section -*/ -#define SECTION_FILE 0 -#define SECTION_COMPUTED 1 -#define SECTION_ANY_TAG 2 -#define SECTION_IFD0 3 -#define SECTION_THUMBNAIL 4 -#define SECTION_COMMENT 5 -#define SECTION_APP0 6 -#define SECTION_EXIF 7 -#define SECTION_FPIX 8 -#define SECTION_GPS 9 -#define SECTION_INTEROP 10 -#define SECTION_APP12 11 -#define SECTION_WINXP 12 -#define SECTION_MAKERNOTE 13 -#define SECTION_COUNT 14 - -#define FOUND_FILE (1<2) - sections[len-2] = '\0'; - return sections; -} -/* }}} */ - -/* {{{ struct image_info_type - This structure stores Exif header image elements in a simple manner - Used to store camera data as extracted from the various ways that it can be - stored in a nexif header -*/ - -typedef struct { - int type; - size_t size; - uchar *data; -} file_section; - -typedef struct { - int count; - file_section *list; -} file_section_list; - -typedef struct { - image_filetype filetype; - size_t width, height; - size_t size; - size_t offset; - char *data; -} thumbnail_data; - -typedef struct { - char *value; - size_t size; - int tag; -} xp_field_type; - -typedef struct { - int count; - xp_field_type *list; -} xp_field_list; - -/* This structure is used to store a section of a Jpeg file. */ -typedef struct { - php_stream *infile; - char *FileName; - time_t FileDateTime; - size_t FileSize; - image_filetype FileType; - int Height, Width; - int IsColor; - - char *make; - char *model; - - float ApertureFNumber; - float ExposureTime; - double FocalplaneUnits; - float CCDWidth; - double FocalplaneXRes; - size_t ExifImageWidth; - float FocalLength; - float Distance; - - int motorola_intel; /* 1 Motorola; 0 Intel */ - - char *UserComment; - int UserCommentLength; - char *UserCommentEncoding; - char *encode_unicode; - char *decode_unicode_be; - char *decode_unicode_le; - char *encode_jis; - char *decode_jis_be; - char *decode_jis_le; - char *Copyright;/* EXIF standard defines Copyright as " [ '\0' ] ['\0']" */ - char *CopyrightPhotographer; - char *CopyrightEditor; - - xp_field_list xp_fields; - - thumbnail_data Thumbnail; - /* other */ - int sections_found; /* FOUND_ */ - image_info_list info_list[SECTION_COUNT]; - /* for parsing */ - int read_thumbnail; - int read_all; - int ifd_nesting_level; - /* internal */ - file_section_list file; -} image_info_type; -/* }}} */ - -/* {{{ exif_error_docref */ -static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_type *ImageInfo, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); -#ifdef EXIF_DEBUG - { - char *buf; - - spprintf(&buf, 0, "%s(%d): %s", _file, _line, format); - php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args TSRMLS_CC); - efree(buf); - } -#else - php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args TSRMLS_CC); -#endif - va_end(args); -} -/* }}} */ - -/* {{{ jpeg_sof_info - */ -typedef struct { - int bits_per_sample; - size_t width; - size_t height; - int num_components; -} jpeg_sof_info; -/* }}} */ - -/* {{{ exif_file_sections_add - Add a file_section to image_info - returns the used block or -1. if size>0 and data == NULL buffer of size is allocated -*/ -static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data) -{ - file_section *tmp; - int count = ImageInfo->file.count; - - tmp = erealloc(ImageInfo->file.list, (count+1)*sizeof(file_section)); - ImageInfo->file.list = tmp; - ImageInfo->file.list[count].type = 0xFFFF; - ImageInfo->file.list[count].data = NULL; - ImageInfo->file.list[count].size = 0; - ImageInfo->file.count = count+1; - if (!size) { - data = NULL; - } else if (data == NULL) { - data = emalloc(size); - } - ImageInfo->file.list[count].type = type; - ImageInfo->file.list[count].data = data; - ImageInfo->file.list[count].size = size; - return count; -} -/* }}} */ - -/* {{{ exif_file_sections_realloc - Reallocate a file section returns 0 on success and -1 on failure -*/ -static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC) -{ - void *tmp; - - /* This is not a malloc/realloc check. It is a plausibility check for the - * function parameters (requirements engineering). - */ - if (section_index >= ImageInfo->file.count) { - EXIF_ERRLOG_FSREALLOC(ImageInfo) - return -1; - } - tmp = erealloc(ImageInfo->file.list[section_index].data, size); - ImageInfo->file.list[section_index].data = tmp; - ImageInfo->file.list[section_index].size = size; - return 0; -} -/* }}} */ - -/* {{{ exif_file_section_free - Discard all file_sections in ImageInfo -*/ -static int exif_file_sections_free(image_info_type *ImageInfo) -{ - int i; - - if (ImageInfo->file.count) { - for (i=0; ifile.count; i++) { - EFREE_IF(ImageInfo->file.list[i].data); - } - } - EFREE_IF(ImageInfo->file.list); - ImageInfo->file.count = 0; - return TRUE; -} -/* }}} */ - -/* {{{ exif_iif_add_value - Add a value to image_info -*/ -static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC) -{ - size_t idex; - void *vptr; - image_info_value *info_value; - image_info_data *info_data; - image_info_data *list; - - if (length >= LONG_MAX) { - return; - } - - list = erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = tag; - info_data->format = format; - info_data->length = length; - info_data->name = estrdup(name); - info_value = &info_data->value; - - switch (format) { - case TAG_FMT_STRING: - if (value) { - length = php_strnlen(value, length); - if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - } else { - info_value->s = estrndup(value, length); - } - info_data->length = length; - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - break; - - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - info_data->tag = TAG_FMT_UNDEFINED;/* otherwise not freed from memory */ - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if (!length) - break; - case TAG_FMT_UNDEFINED: - if (value) { - /* do not recompute length here */ - if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - } else { - info_value->s = estrndup(value, length); - } - info_data->length = length; - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - if (length==0) { - break; - } else - if (length>1) { - info_value->list = safe_emalloc(length, sizeof(image_info_value), 0); - } else { - info_value = &info_data->value; - } - for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) { - if (length>1) { - info_value = &info_data->value.list[idex]; - } - switch (format) { - case TAG_FMT_USHORT: - info_value->u = php_ifd_get16u(vptr, motorola_intel); - break; - - case TAG_FMT_ULONG: - info_value->u = php_ifd_get32u(vptr, motorola_intel); - break; - - case TAG_FMT_URATIONAL: - info_value->ur.num = php_ifd_get32u(vptr, motorola_intel); - info_value->ur.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); - break; - - case TAG_FMT_SSHORT: - info_value->i = php_ifd_get16s(vptr, motorola_intel); - break; - - case TAG_FMT_SLONG: - info_value->i = php_ifd_get32s(vptr, motorola_intel); - break; - - case TAG_FMT_SRATIONAL: - info_value->sr.num = php_ifd_get32u(vptr, motorola_intel); - info_value->sr.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); - break; - - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type single"); -#endif - info_value->f = *(float *)value; - - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type double"); -#endif - info_value->d = *(double *)value; - break; - } - } - } - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_tag - Add a tag from IFD to image_info -*/ -static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC) -{ - exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_iif_add_int - Add an int value to image_info -*/ -static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - list = erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_SLONG; - info_data->length = 1; - info_data->name = estrdup(name); - info_data->value.i = value; - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_str - Add a string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - if (value) { - list = erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - image_info->info_list[section_index].list = list; - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_STRING; - info_data->length = 1; - info_data->name = estrdup(name); - if (PG(magic_quotes_runtime)) { - info_data->value.s = php_addslashes(value, strlen(value), NULL, 0 TSRMLS_CC); - } else { - info_data->value.s = estrdup(value); - } - image_info->sections_found |= 1<info_list[section_index].count++; - } -} -/* }}} */ - -/* {{{ exif_iif_add_fmt - Add a format string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...) -{ - char *tmp; - va_list arglist; - - va_start(arglist, value); - if (value) { - vspprintf(&tmp, 0, value, arglist); - exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC); - efree(tmp); - } - va_end(arglist); -} -/* }}} */ - -/* {{{ exif_iif_add_str - Add a string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - if (value) { - list = erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - image_info->info_list[section_index].list = list; - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_UNDEFINED; - info_data->length = length; - info_data->name = estrdup(name); - if (PG(magic_quotes_runtime)) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, image_info, E_NOTICE, "Adding %s as buffer%s", name, exif_char_dump(value, length, 0)); -#endif - info_data->value.s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - info_data->length = length; - } else { - info_data->value.s = safe_emalloc(length, 1, 1); - memcpy(info_data->value.s, value, length); - info_data->value.s[length] = 0; - } - image_info->sections_found |= 1<info_list[section_index].count++; - } -} -/* }}} */ - -/* {{{ exif_iif_free - Free memory allocated for image_info -*/ -static void exif_iif_free(image_info_type *image_info, int section_index) { - int i; - void *f; /* faster */ - - if (image_info->info_list[section_index].count) { - for (i=0; i < image_info->info_list[section_index].count; i++) { - if ((f=image_info->info_list[section_index].list[i].name) != NULL) { - efree(f); - } - switch(image_info->info_list[section_index].list[i].format) { - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if (image_info->info_list[section_index].list[i].length<1) - break; - default: - case TAG_FMT_UNDEFINED: - case TAG_FMT_STRING: - if ((f=image_info->info_list[section_index].list[i].value.s) != NULL) { - efree(f); - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - /* nothing to do here */ - if (image_info->info_list[section_index].list[i].length > 1) { - if ((f=image_info->info_list[section_index].list[i].value.list) != NULL) { - efree(f); - } - } - break; - } - } - } - EFREE_IF(image_info->info_list[section_index].list); -} -/* }}} */ - -/* {{{ add_assoc_image_info - * Add image_info to associative array value. */ -static void add_assoc_image_info(pval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC) -{ - char buffer[64], *val, *name, uname[64]; - int i, ap, l, b, idx=0, unknown=0; -#ifdef EXIF_DEBUG - int info_tag; -#endif - image_info_value *info_value; - image_info_data *info_data; - pval *tmpi, *array = NULL; - -#ifdef EXIF_DEBUG -/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/ -#endif - if (image_info->info_list[section_index].count) { - if (sub_array) { - MAKE_STD_ZVAL(tmpi); - array_init(tmpi); - } else { - tmpi = value; - } - - for(i=0; iinfo_list[section_index].count; i++) { - info_data = &image_info->info_list[section_index].list[i]; -#ifdef EXIF_DEBUG - info_tag = info_data->tag; /* conversion */ -#endif - info_value = &info_data->value; - if (!(name = info_data->name)) { - snprintf(uname, sizeof(uname), "%d", unknown++); - name = uname; - } -#ifdef EXIF_DEBUG -/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index) TSRMLS_CC), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:""):exif_get_tagformat(info_data->format));*/ -#endif - if (info_data->length==0) { - add_assoc_null(tmpi, name); - } else { - switch (info_data->format) { - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - case TAG_FMT_BYTE: - case TAG_FMT_SBYTE: - case TAG_FMT_UNDEFINED: - if (!info_value->s) { - add_assoc_stringl(tmpi, name, "", 0, 1); - } else { - add_assoc_stringl(tmpi, name, info_value->s, info_data->length, 1); - } - break; - - case TAG_FMT_STRING: - if (!(val = info_value->s)) { - val = ""; - } - if (section_index==SECTION_COMMENT) { - add_index_string(tmpi, idx++, val, 1); - } else { - add_assoc_string(tmpi, name, val, 1); - } - break; - - case TAG_FMT_URATIONAL: - case TAG_FMT_SRATIONAL: - /*case TAG_FMT_BYTE: - case TAG_FMT_SBYTE:*/ - case TAG_FMT_USHORT: - case TAG_FMT_SSHORT: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - case TAG_FMT_ULONG: - case TAG_FMT_SLONG: - /* now the rest, first see if it becomes an array */ - if ((l = info_data->length) > 1) { - array = NULL; - MAKE_STD_ZVAL(array); - array_init(array); - } - for(ap=0; ap1) { - info_value = &info_data->value.list[ap]; - } - switch (info_data->format) { - case TAG_FMT_BYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b])); - } - break; - } - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - if (l==1) { - add_assoc_long(tmpi, name, (int)info_value->u); - } else { - add_index_long(array, ap, (int)info_value->u); - } - break; - - case TAG_FMT_URATIONAL: - snprintf(buffer, sizeof(buffer), "%i/%i", info_value->ur.num, info_value->ur.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SBYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b]); - } - break; - } - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - if (l==1) { - add_assoc_long(tmpi, name, info_value->i); - } else { - add_index_long(array, ap, info_value->i); - } - break; - - case TAG_FMT_SRATIONAL: - snprintf(buffer, sizeof(buffer), "%i/%i", info_value->sr.num, info_value->sr.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SINGLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->f); - } else { - add_index_double(array, ap, info_value->f); - } - break; - - case TAG_FMT_DOUBLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->d); - } else { - add_index_double(array, ap, info_value->d); - } - break; - } - info_value = &info_data->value.list[ap]; - } - if (l>1) { - add_assoc_zval(tmpi, name, array); - } - break; - } - } - } - if (sub_array) { - add_assoc_zval(value, exif_get_sectionname(section_index), tmpi); - } - } -} -/* }}} */ - -/* {{{ Markers - JPEG markers consist of one or more 0xFF bytes, followed by a marker - code byte (which is not an FF). Here are the marker codes of interest - in this program. (See jdmarker.c for a more complete list.) -*/ - -#define M_TEM 0x01 /* temp for arithmetic coding */ -#define M_RES 0x02 /* reserved */ -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_DHT 0xC4 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_JPEG 0x08 /* reserved for extensions */ -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_DAC 0xCC /* arithmetic table */ -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_RST0 0xD0 /* restart segment */ -#define M_RST1 0xD1 -#define M_RST2 0xD2 -#define M_RST3 0xD3 -#define M_RST4 0xD4 -#define M_RST5 0xD5 -#define M_RST6 0xD6 -#define M_RST7 0xD7 -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_DQT 0xDB -#define M_DNL 0xDC -#define M_DRI 0xDD -#define M_DHP 0xDE -#define M_EXP 0xDF -#define M_APP0 0xE0 /* JPEG: 'JFIFF' AND (additional 'JFXX') */ -#define M_EXIF 0xE1 /* Exif Attribute Information */ -#define M_APP2 0xE2 /* Flash Pix Extension Data? */ -#define M_APP3 0xE3 -#define M_APP4 0xE4 -#define M_APP5 0xE5 -#define M_APP6 0xE6 -#define M_APP7 0xE7 -#define M_APP8 0xE8 -#define M_APP9 0xE9 -#define M_APP10 0xEA -#define M_APP11 0xEB -#define M_APP12 0xEC -#define M_APP13 0xED /* IPTC International Press Telecommunications Council */ -#define M_APP14 0xEE /* Software, Copyright? */ -#define M_APP15 0xEF -#define M_JPG0 0xF0 -#define M_JPG1 0xF1 -#define M_JPG2 0xF2 -#define M_JPG3 0xF3 -#define M_JPG4 0xF4 -#define M_JPG5 0xF5 -#define M_JPG6 0xF6 -#define M_JPG7 0xF7 -#define M_JPG8 0xF8 -#define M_JPG9 0xF9 -#define M_JPG10 0xFA -#define M_JPG11 0xFB -#define M_JPG12 0xFC -#define M_JPG13 0xFD -#define M_COM 0xFE /* COMment */ - -#define M_PSEUDO 0x123 /* Extra value. */ - -/* }}} */ - -/* {{{ jpeg2000 markers - */ -/* Markers x30 - x3F do not have a segment */ -/* Markers x00, x01, xFE, xC0 - xDF ISO/IEC 10918-1 -> M_ */ -/* Markers xF0 - xF7 ISO/IEC 10918-3 */ -/* Markers xF7 - xF8 ISO/IEC 14495-1 */ -/* XY=Main/Tile-header:(R:required, N:not_allowed, O:optional, L:last_marker) */ -#define JC_SOC 0x4F /* NN, Start of codestream */ -#define JC_SIZ 0x51 /* RN, Image and tile size */ -#define JC_COD 0x52 /* RO, Codeing style defaulte */ -#define JC_COC 0x53 /* OO, Coding style component */ -#define JC_TLM 0x55 /* ON, Tile part length main header */ -#define JC_PLM 0x57 /* ON, Packet length main header */ -#define JC_PLT 0x58 /* NO, Packet length tile part header */ -#define JC_QCD 0x5C /* RO, Quantization default */ -#define JC_QCC 0x5D /* OO, Quantization component */ -#define JC_RGN 0x5E /* OO, Region of interest */ -#define JC_POD 0x5F /* OO, Progression order default */ -#define JC_PPM 0x60 /* ON, Packed packet headers main header */ -#define JC_PPT 0x61 /* NO, Packet packet headers tile part header */ -#define JC_CME 0x64 /* OO, Comment: "LL E " E=0:binary, E=1:ascii */ -#define JC_SOT 0x90 /* NR, Start of tile */ -#define JC_SOP 0x91 /* NO, Start of packeter default */ -#define JC_EPH 0x92 /* NO, End of packet header */ -#define JC_SOD 0x93 /* NL, Start of data */ -#define JC_EOC 0xD9 /* NN, End of codestream */ -/* }}} */ - -/* {{{ exif_process_COM - Process a COM marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC) -{ - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_process_CME - Process a CME marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -#ifdef EXIF_JPEG2000 -static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC) -{ - if (length>3) { - switch(value[2]) { - case 0: - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC); - break; - case 1: - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Undefined JPEG2000 comment encoding"); - break; - } - } else { - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section to small"); - } -} -#endif -/* }}} */ - -/* {{{ exif_process_SOFn - * Process a SOFn marker. This is useful for the image dimensions */ -static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result) -{ -/* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */ - result->bits_per_sample = Data[2]; - result->height = php_jpg_get16(Data+3); - result->width = php_jpg_get16(Data+5); - result->num_components = Data[7]; - -/* switch (marker) { - case M_SOF0: process = "Baseline"; break; - case M_SOF1: process = "Extended sequential"; break; - case M_SOF2: process = "Progressive"; break; - case M_SOF3: process = "Lossless"; break; - case M_SOF5: process = "Differential sequential"; break; - case M_SOF6: process = "Differential progressive"; break; - case M_SOF7: process = "Differential lossless"; break; - case M_SOF9: process = "Extended sequential, arithmetic coding"; break; - case M_SOF10: process = "Progressive, arithmetic coding"; break; - case M_SOF11: process = "Lossless, arithmetic coding"; break; - case M_SOF13: process = "Differential sequential, arithmetic coding"; break; - case M_SOF14: process = "Differential progressive, arithmetic coding"; break; - case M_SOF15: process = "Differential lossless, arithmetic coding"; break; - default: process = "Unknown"; break; - }*/ -} -/* }}} */ - -/* forward declarations */ -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC); -static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC); - -/* {{{ exif_get_markername - Get name of marker */ -#ifdef EXIF_DEBUG -static char * exif_get_markername(int marker) -{ - switch(marker) { - case 0xC0: return "SOF0"; - case 0xC1: return "SOF1"; - case 0xC2: return "SOF2"; - case 0xC3: return "SOF3"; - case 0xC4: return "DHT"; - case 0xC5: return "SOF5"; - case 0xC6: return "SOF6"; - case 0xC7: return "SOF7"; - case 0xC9: return "SOF9"; - case 0xCA: return "SOF10"; - case 0xCB: return "SOF11"; - case 0xCD: return "SOF13"; - case 0xCE: return "SOF14"; - case 0xCF: return "SOF15"; - case 0xD8: return "SOI"; - case 0xD9: return "EOI"; - case 0xDA: return "SOS"; - case 0xDB: return "DQT"; - case 0xDC: return "DNL"; - case 0xDD: return "DRI"; - case 0xDE: return "DHP"; - case 0xDF: return "EXP"; - case 0xE0: return "APP0"; - case 0xE1: return "EXIF"; - case 0xE2: return "FPIX"; - case 0xE3: return "APP3"; - case 0xE4: return "APP4"; - case 0xE5: return "APP5"; - case 0xE6: return "APP6"; - case 0xE7: return "APP7"; - case 0xE8: return "APP8"; - case 0xE9: return "APP9"; - case 0xEA: return "APP10"; - case 0xEB: return "APP11"; - case 0xEC: return "APP12"; - case 0xED: return "APP13"; - case 0xEE: return "APP14"; - case 0xEF: return "APP15"; - case 0xF0: return "JPG0"; - case 0xFD: return "JPG13"; - case 0xFE: return "COM"; - case 0x01: return "TEM"; - } - return "Unknown"; -} -#endif -/* }}} */ - -/* {{{ proto string exif_tagname(index) - Get headername for index or false if not defined */ -PHP_FUNCTION(exif_tagname) -{ - pval **p_num; - int tag, ac = ZEND_NUM_ARGS(); - char *szTemp; - - if ((ac < 1 || ac > 1) || zend_get_parameters_ex(ac, &p_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(p_num); - tag = Z_LVAL_PP(p_num); - szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD TSRMLS_CC); - if (tag<0 || !szTemp || !szTemp[0]) { - RETURN_BOOL(FALSE); - } else { - RETURN_STRING(szTemp, 1) - } -} -/* }}} */ - -/* {{{ exif_ifd_make_value - * Create a value for an ifd from an info_data pointer */ -static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) { - size_t byte_count; - char *value_ptr, *data_ptr; - size_t i; - - image_info_value *info_value; - - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - value_ptr = emalloc(max(byte_count, 4)); - memset(value_ptr, 0, 4); - if (!info_data->length) { - return value_ptr; - } - if (info_data->format == TAG_FMT_UNDEFINED || info_data->format == TAG_FMT_STRING - || (byte_count>1 && (info_data->format == TAG_FMT_BYTE || info_data->format == TAG_FMT_SBYTE)) - ) { - memmove(value_ptr, info_data->value.s, byte_count); - return value_ptr; - } else if (info_data->format == TAG_FMT_BYTE) { - *value_ptr = info_data->value.u; - return value_ptr; - } else if (info_data->format == TAG_FMT_SBYTE) { - *value_ptr = info_data->value.i; - return value_ptr; - } else { - data_ptr = value_ptr; - for(i=0; ilength; i++) { - if (info_data->length==1) { - info_value = &info_data->value; - } else { - info_value = &info_data->value.list[i]; - } - switch(info_data->format) { - case TAG_FMT_USHORT: - php_ifd_set16u(data_ptr, info_value->u, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_ULONG: - php_ifd_set32u(data_ptr, info_value->u, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_SSHORT: - php_ifd_set16u(data_ptr, info_value->i, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_SLONG: - php_ifd_set32u(data_ptr, info_value->i, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_URATIONAL: - php_ifd_set32u(data_ptr, info_value->sr.num, motorola_intel); - php_ifd_set32u(data_ptr+4, info_value->sr.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SRATIONAL: - php_ifd_set32u(data_ptr, info_value->ur.num, motorola_intel); - php_ifd_set32u(data_ptr+4, info_value->ur.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SINGLE: - memmove(data_ptr, &info_data->value.f, byte_count); - data_ptr += 4; - break; - case TAG_FMT_DOUBLE: - memmove(data_ptr, &info_data->value.d, byte_count); - data_ptr += 8; - break; - } - } - } - return value_ptr; -} -/* }}} */ - -/* {{{ exif_thumbnail_build - * Check and build thumbnail */ -static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) { - size_t new_size, new_move, new_value; - char *new_data; - void *value_ptr; - int i, byte_count; - image_info_list *info_list; - image_info_data *info_data; -#ifdef EXIF_DEBUG - char tagname[64]; -#endif - - if (!ImageInfo->read_thumbnail || !ImageInfo->Thumbnail.offset || !ImageInfo->Thumbnail.size) { - return; /* ignore this call */ - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: filetype = %d", ImageInfo->Thumbnail.filetype); -#endif - switch(ImageInfo->Thumbnail.filetype) { - default: - case IMAGE_FILETYPE_JPEG: - /* done */ - break; - case IMAGE_FILETYPE_TIFF_II: - case IMAGE_FILETYPE_TIFF_MM: - info_list = &ImageInfo->info_list[SECTION_THUMBNAIL]; - new_size = 8 + 2 + info_list->count * 12 + 4; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size of signature + directory(%d): 0x%02X", info_list->count, new_size); -#endif - new_value= new_size; /* offset for ifd values outside ifd directory */ - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - if (byte_count > 4) { - new_size += byte_count; - } - } - new_move = new_size; - new_data = erealloc(ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size+new_size); - ImageInfo->Thumbnail.data = new_data; - memmove(ImageInfo->Thumbnail.data + new_move, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - ImageInfo->Thumbnail.size += new_size; - /* fill in data */ - if (ImageInfo->motorola_intel) { - memmove(new_data, "MM\x00\x2a\x00\x00\x00\x08", 8); - } else { - memmove(new_data, "II\x2a\x00\x08\x00\x00\x00", 8); - } - new_data += 8; - php_ifd_set16u(new_data, info_list->count, ImageInfo->motorola_intel); - new_data += 2; - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD TSRMLS_CC), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count); -#endif - if (info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) { - php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u(new_data + 2, TAG_FMT_ULONG, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 4, 1, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 8, new_move, ImageInfo->motorola_intel); - } else { - php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel); - value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel TSRMLS_CC); - if (byte_count <= 4) { - memmove(new_data+8, value_ptr, 4); - } else { - php_ifd_set32u(new_data+8, new_value, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: writing with value offset: 0x%04X + 0x%02X", new_value, byte_count); -#endif - memmove(ImageInfo->Thumbnail.data+new_value, value_ptr, byte_count); - new_value += byte_count; - } - efree(value_ptr); - } - new_data += 12; - } - memset(new_data, 0, 4); /* next ifd pointer */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: created"); -#endif - break; - } -} -/* }}} */ - -/* {{{ exif_thumbnail_extract - * Grab the thumbnail, corrected */ -static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) { - if (ImageInfo->Thumbnail.data) { - exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails"); - return; /* Should not happen */ - } - if (!ImageInfo->read_thumbnail) { - return; /* ignore this call */ - } - /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ - if (ImageInfo->Thumbnail.size >= 65536 - || ImageInfo->Thumbnail.size <= 0 - || ImageInfo->Thumbnail.offset <= 0 - ) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Illegal thumbnail size/offset"); - return; - } - /* Check to make sure we are not going to go past the ExifLength */ - if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - return; - } - ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); - exif_thumbnail_build(ImageInfo TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_process_undefined - * Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */ -static int exif_process_undefined(char **result, char *value, size_t byte_count TSRMLS_DC) { - /* we cannot use strlcpy - here the problem is that we have to copy NUL - * chars up to byte_count, we also have to add a single NUL character to - * force end of string. - * estrndup does not return length - */ - if (byte_count) { - (*result) = estrndup(value, byte_count); /* NULL @ byte_count!!! */ - return byte_count+1; - } - return 0; -} -/* }}} */ - -/* {{{ exif_process_string_raw - * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ -#if !EXIF_USE_MBSTRING -static int exif_process_string_raw(char **result, char *value, size_t byte_count) { - /* we cannot use strlcpy - here the problem is that we have to copy NUL - * chars up to byte_count, we also have to add a single NUL character to - * force end of string. - */ - if (byte_count) { - (*result) = safe_emalloc(byte_count, 1, 1); - memcpy(*result, value, byte_count); - (*result)[byte_count] = '\0'; - return byte_count+1; - } - return 0; -} -#endif -/* }}} */ - -/* {{{ exif_process_string - * Copy a string in Exif header to a character string and return length of allocated buffer if any. - * In contrast to exif_process_string this function does allways return a string buffer */ -static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) { - /* we cannot use strlcpy - here the problem is that we cannot use strlen to - * determin length of string and we cannot use strlcpy with len=byte_count+1 - * because then we might get into an EXCEPTION if we exceed an allocated - * memory page...so we use php_strnlen in conjunction with memcpy and add the NUL - * char. - * estrdup would sometimes allocate more memory and does not return length - */ - if ((byte_count=php_strnlen(value, byte_count)) > 0) { - return exif_process_undefined(result, value, byte_count TSRMLS_CC); - } - (*result) = estrndup("", 1); /* force empty string */ - return byte_count+1; -} -/* }}} */ - -/* {{{ exif_process_user_comment - * Process UserComment in IFD. */ -static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC) -{ - int a; - -#if EXIF_USE_MBSTRING - char *decode; - size_t len;; -#endif - - *pszEncoding = NULL; - /* Copy the comment */ - if (ByteCount>=8) { - if (!memcmp(szValuePtr, "UNICODE\0", 8)) { - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; -#if EXIF_USE_MBSTRING - /* First try to detect BOM: ZERO WIDTH NOBREAK SPACE (FEFF 16) - * since we have no encoding support for the BOM yet we skip that. - */ - if (!memcmp(szValuePtr, "\xFE\xFF", 2)) { - decode = "UCS-2BE"; - szValuePtr = szValuePtr+2; - ByteCount -= 2; - } else if (!memcmp(szValuePtr, "\xFF\xFE", 2)) { - decode = "UCS-2LE"; - szValuePtr = szValuePtr+2; - ByteCount -= 2; - } else if (ImageInfo->motorola_intel) { - decode = ImageInfo->decode_unicode_be; - } else { - decode = ImageInfo->decode_unicode_le; - } - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, decode, &len TSRMLS_CC); - return len; -#else - return exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); -#endif - } else - if (!memcmp(szValuePtr, "ASCII\0\0\0", 8)) { - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } else - if (!memcmp(szValuePtr, "JIS\0\0\0\0\0", 8)) { - /* JIS should be tanslated to MB or we leave it to the user - leave it to the user */ - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; -#if EXIF_USE_MBSTRING - if (ImageInfo->motorola_intel) { - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_be, &len TSRMLS_CC); - } else { - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_le, &len TSRMLS_CC); - } - return len; -#else - return exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); -#endif - } else - if (!memcmp(szValuePtr, "\0\0\0\0\0\0\0\0", 8)) { - /* 8 NULL means undefined and should be ASCII... */ - *pszEncoding = estrdup("UNDEFINED"); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } - } - - /* Olympus has this padded with trailing spaces. Remove these first. */ - if (ByteCount>0) { - for (a=ByteCount-1;a && szValuePtr[a]==' ';a--) { - (szValuePtr)[a] = '\0'; - } - } - - /* normal text without encoding */ - exif_process_string(pszInfoPtr, szValuePtr, ByteCount TSRMLS_CC); - return strlen(*pszInfoPtr); -} -/* }}} */ - -/* {{{ exif_process_unicode - * Process unicode field in IFD. */ -static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC) -{ - xp_field->tag = tag; - - /* Copy the comment */ -#if EXIF_USE_MBSTRING -/* What if MS supports big-endian with XP? */ -/* if (ImageInfo->motorola_intel) { - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &xp_field->size TSRMLS_CC); - } else { - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_le, &xp_field->size TSRMLS_CC); - }*/ - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_le, &xp_field->size TSRMLS_CC); - return xp_field->size; -#else - xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount); - return xp_field->size; -#endif -} -/* }}} */ - -/* {{{ exif_process_IFD_in_MAKERNOTE - * Process nested IFDs directories in Maker Note. */ -static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC) -{ - int de, i=0, section_index = SECTION_MAKERNOTE; - int NumDirEntries, old_motorola_intel, offset_diff; - const maker_note_type *maker_note; - char *dir_start; - - for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) { - if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) - return FALSE; - maker_note = maker_note_array+i; - - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/ - if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make))) - continue; - if (maker_note->model && (!ImageInfo->model || strcmp(maker_note->model, ImageInfo->model))) - continue; - if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len)) - continue; - break; - } - - dir_start = value_ptr + maker_note->offset; - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (int)dir_start-(int)offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (int)dir_start-(int)offset_base+maker_note->offset+displacement)); -#endif - - ImageInfo->sections_found |= FOUND_MAKERNOTE; - - old_motorola_intel = ImageInfo->motorola_intel; - switch (maker_note->byte_order) { - case MN_ORDER_INTEL: - ImageInfo->motorola_intel = 0; - break; - case MN_ORDER_MOTOROLA: - ImageInfo->motorola_intel = 1; - break; - default: - case MN_ORDER_NORMAL: - break; - } - - NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); - - switch (maker_note->offset_mode) { - case MN_OFFSET_MAKER: - offset_base = value_ptr; - break; - case MN_OFFSET_GUESS: - offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff); -#endif - offset_base = value_ptr + offset_diff; - break; - default: - case MN_OFFSET_NORMAL: - break; - } - - if ((2+NumDirEntries*12) > value_len) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + x%04X*12 = x%04X > x%04X", NumDirEntries, 2+NumDirEntries*12, value_len); - return FALSE; - } - - for (de=0;detag_table TSRMLS_CC)) { - return FALSE; - } - } - ImageInfo->motorola_intel = old_motorola_intel; -/* NextDirOffset (must be NULL) = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel);*/ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(SECTION_MAKERNOTE)); -#endif - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_IFD_TAG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC) -{ - size_t length; - int tag, format, components; - char *value_ptr, tagname[64], cbuf[32], *outside=NULL; - size_t byte_count, offset_val, fpos, fgot; - xp_field_type *tmp_xp; - - /* Protect against corrupt headers */ - if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) { - exif_error_docref("exif_read_data#error_ifd" TSRMLS_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached"); - return FALSE; - } - ImageInfo->ifd_nesting_level++; - - tag = php_ifd_get16u(dir_entry, ImageInfo->motorola_intel); - format = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - components = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel); - - if (!format || format > NUM_FORMATS) { - /* (-1) catches illegal zero case as unsigned underflows to positive large. */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), format); - format = TAG_FMT_BYTE; - /*return TRUE;*/ - } - - byte_count = components * php_tiff_bytes_per_format[format]; - - if ((ssize_t)byte_count < 0) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), byte_count); - return FALSE; - } - - if (byte_count > 4) { - offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* If its bigger than 4 bytes, the dir entry contains an offset. */ - value_ptr = offset_base+offset_val; - if (offset_val+byte_count > IFDlength || value_ptr < dir_entry) { - /* - // It is important to check for IMAGE_FILETYPE_TIFF - // JPEG does not use absolute pointers instead its pointers are relative to the start - // of the TIFF header in APP1 section. - */ - if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) { - if (value_ptr < dir_entry) { - /* we can read this if offset_val > 0 */ - /* some files have their values in other parts of the file */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, dir_entry); - } else { - /* this is for sure not allowed */ - /* exception are IFD pointers */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, byte_count, offset_val+byte_count, IFDlength); - } - return TRUE; - } - if (byte_count>sizeof(cbuf)) { - /* mark as outside range and get buffer */ - value_ptr = emalloc(byte_count); - outside = value_ptr; - } else { - /* - // in most cases we only access a small range so - // it is faster to use a static buffer there - // BUT it offers also the possibility to have - // pointers read without the need to free them - // explicitley before returning. - */ - value_ptr = cbuf; - } - - fpos = php_stream_tell(ImageInfo->infile); - php_stream_seek(ImageInfo->infile, offset_val, SEEK_SET); - fgot = php_stream_tell(ImageInfo->infile); - if (fgot!=offset_val) { - EFREE_IF(outside); - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x08X", fgot, offset_val); - return FALSE; - } - fgot = php_stream_read(ImageInfo->infile, value_ptr, byte_count); - php_stream_seek(ImageInfo->infile, fpos, SEEK_SET); - if (fgotsections_found |= FOUND_ANY_TAG; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", format==TAG_FMT_STRING?(value_ptr?value_ptr:""):exif_get_tagformat(format)); -#endif - if (section_index==SECTION_THUMBNAIL) { - if (!ImageInfo->Thumbnail.data) { - switch(tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGE_HEIGHT: - ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_STRIP_OFFSETS: - case TAG_JPEG_INTERCHANGE_FORMAT: - /* accept both formats */ - ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_STRIP_BYTE_COUNTS: - if (ImageInfo->FileType == IMAGE_FILETYPE_TIFF_II || ImageInfo->FileType == IMAGE_FILETYPE_TIFF_MM) { - ImageInfo->Thumbnail.filetype = ImageInfo->FileType; - } else { - /* motorola is easier to read */ - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM; - } - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_JPEG_INTERCHANGE_FORMAT_LEN: - if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) { - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG; - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - } - break; - } - } - } else { - if (section_index==SECTION_IFD0 || section_index==SECTION_EXIF) - switch(tag) { - case TAG_COPYRIGHT: - /* check for " NUL NUL" */ - if (byte_count>1 && (length=php_strnlen(value_ptr, byte_count)) > 0) { - if (lengthCopyrightPhotographer = estrdup(value_ptr); - ImageInfo->CopyrightEditor = estrdup(value_ptr+length+1); - spprintf(&ImageInfo->Copyright, 0, "%s, %s", value_ptr, value_ptr+length+1); - /* format = TAG_FMT_UNDEFINED; this musn't be ASCII */ - /* but we are not supposed to change this */ - /* keep in mind that image_info does not store editor value */ - } else { - ImageInfo->Copyright = estrdup(value_ptr); - } - } - break; - - case TAG_USERCOMMENT: - ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count TSRMLS_CC); - break; - - case TAG_XP_TITLE: - case TAG_XP_COMMENTS: - case TAG_XP_AUTHOR: - case TAG_XP_KEYWORDS: - case TAG_XP_SUBJECT: - tmp_xp = (xp_field_type*)erealloc(ImageInfo->xp_fields.list, sizeof(xp_field_type)*(ImageInfo->xp_fields.count+1)); - ImageInfo->sections_found |= FOUND_WINXP; - ImageInfo->xp_fields.list = tmp_xp; - ImageInfo->xp_fields.count++; - exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count TSRMLS_CC); - break; - - case TAG_FNUMBER: - /* Simplest way of expressing aperture, so I trust it the most. - (overwrite previously computed value if there is one) */ - ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_APERTURE: - case TAG_MAX_APERTURE: - /* More relevant info always comes earlier, so only use this field if we don't - have appropriate aperture information yet. */ - if (ImageInfo->ApertureFNumber == 0) { - ImageInfo->ApertureFNumber - = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)*0.5); - } - break; - - case TAG_SHUTTERSPEED: - /* More complicated way of expressing exposure time, so only use - this value if we don't already have it from somewhere else. - SHUTTERSPEED comes after EXPOSURE TIME - */ - if (ImageInfo->ExposureTime == 0) { - ImageInfo->ExposureTime - = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2))); - } - break; - case TAG_EXPOSURETIME: - ImageInfo->ExposureTime = -1; - break; - - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_FOCALPLANE_X_RES: - ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_SUBJECT_DISTANCE: - /* Inidcates the distacne the autofocus camera is focused to. - Tends to be less accurate as distance increases. */ - ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_FOCALPLANE_RESOLUTION_UNIT: - switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)) { - case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */ - case 2: - /* According to the information I was using, 2 measn meters. - But looking at the Cannon powershot's files, inches is the only - sensible value. */ - ImageInfo->FocalplaneUnits = 25.4; - break; - - case 3: ImageInfo->FocalplaneUnits = 10; break; /* centimeter */ - case 4: ImageInfo->FocalplaneUnits = 1; break; /* milimeter */ - case 5: ImageInfo->FocalplaneUnits = .001; break; /* micrometer */ - } - break; - - case TAG_SUB_IFD: - if (format==TAG_FMT_IFD) { - /* If this is called we are either in a TIFFs thumbnail or a JPEG where we cannot handle it */ - /* TIFF thumbnail: our data structure cannot store a thumbnail of a thumbnail */ - /* JPEG do we have the data area and what to do with it */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Skip SUB IFD"); - } - break; - - case TAG_MAKE: - ImageInfo->make = estrdup(value_ptr); - break; - case TAG_MODEL: - ImageInfo->model = estrdup(value_ptr); - break; - - case TAG_MAKER_NOTE: - exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC); - break; - - case TAG_EXIF_IFD_POINTER: - case TAG_GPS_IFD_POINTER: - case TAG_INTEROP_IFD_POINTER: - if (ReadNextIFD) { - char *Subdir_start; - int sub_section_index = 0; - switch(tag) { - case TAG_EXIF_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found EXIF"); -#endif - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found GPS"); -#endif - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found INTEROPERABILITY"); -#endif - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - } - Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel); - if (Subdir_start < offset_base || Subdir_start > offset_base+IFDlength) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer"); - return FALSE; - } - exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(sub_section_index)); -#endif - } - } - } - exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table TSRMLS_CC), tag, format, components, value_ptr TSRMLS_CC); - EFREE_IF(outside); - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_JPEG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC) -{ - int de; - int NumDirEntries; - int NextDirOffset; - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))", exif_get_sectionname(section_index), IFDlength, IFDlength); -#endif - - ImageInfo->sections_found |= FOUND_IFD0; - - NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); - - if ((dir_start+2+NumDirEntries*12) > (offset_base+IFDlength)) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)((size_t)dir_start+2-(size_t)offset_base), NumDirEntries, (int)((size_t)dir_start+2+NumDirEntries*12-(size_t)offset_base), IFDlength); - return FALSE; - } - - for (de=0;demotorola_intel); - if (NextDirOffset) { - /* the next line seems false but here IFDlength means length of all IFDs */ - if (offset_base + NextDirOffset < offset_base || offset_base + NextDirOffset > offset_base+IFDlength) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD offset"); - return FALSE; - } - /* That is the IFD for the first thumbnail */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail"); -#endif - if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL TSRMLS_CC)) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size); -#endif - if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN - && ImageInfo->Thumbnail.size - && ImageInfo->Thumbnail.offset - && ImageInfo->read_thumbnail - ) { - exif_thumbnail_extract(ImageInfo, offset_base, IFDlength TSRMLS_CC); - } - return TRUE; - } else { - return FALSE; - } - } - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_TIFF_in_JPEG - Process a TIFF header in a JPEG file -*/ -static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC) -{ - unsigned exif_value_2a, offset_of_ifd; - - /* set the thumbnail stuff to nothing so we can test to see if they get set up */ - if (memcmp(CharBuf, "II", 2) == 0) { - ImageInfo->motorola_intel = 0; - } else if (memcmp(CharBuf, "MM", 2) == 0) { - ImageInfo->motorola_intel = 1; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF alignment marker"); - return; - } - - /* Check the next two values for correctness. */ - exif_value_2a = php_ifd_get16u(CharBuf+2, ImageInfo->motorola_intel); - offset_of_ifd = php_ifd_get32u(CharBuf+4, ImageInfo->motorola_intel); - if ( exif_value_2a != 0x2a || offset_of_ifd < 0x08) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF start (1)"); - return; - } - - ImageInfo->sections_found |= FOUND_IFD0; - /* First directory starts at offset 8. Offsets starts at 0. */ - exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0 TSRMLS_CC); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done"); -#endif - - /* Compute the CCD width, in milimeters. */ - if (ImageInfo->FocalplaneXRes != 0) { - ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); - } -} -/* }}} */ - -/* {{{ exif_process_APP1 - Process an JPEG APP1 block marker - Describes all the drivel that most digital cameras include... -*/ -static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC) -{ - /* Check the APP1 for Exif Identifier Code */ - static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader, 6)) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code"); - return; - } - exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8 TSRMLS_CC); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done"); -#endif -} -/* }}} */ - -/* {{{ exif_process_APP12 - Process an JPEG APP12 block marker used by OLYMPUS -*/ -static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length TSRMLS_DC) -{ - size_t l1, l2=0; - - if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { - exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); - if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); - exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); - } - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section APP12 with l1=%d, l2=%d done", l1, l2); -#endif -} -/* }}} */ - -/* {{{ exif_scan_JPEG_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC) -{ - int section, sn; - int marker = 0, last_marker = M_PSEUDO, comment_correction=1; - unsigned int ll, lh; - uchar *Data; - size_t fpos, size, got, itemlen; - jpeg_sof_info sof_info; - - for(section=0;;section++) { -#ifdef EXIF_DEBUG - fpos = php_stream_tell(ImageInfo->infile); - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Needing section %d @ 0x%08X", ImageInfo->file.count, fpos); -#endif - - /* get marker byte, swallowing possible padding */ - /* some software does not count the length bytes of COM section */ - /* one company doing so is very much envolved in JPEG... so we accept too */ - if (last_marker==M_COM && comment_correction) { - comment_correction = 2; - } - do { - if ((marker = php_stream_getc(ImageInfo->infile)) == EOF) { - EXIF_ERRLOG_CORRUPT(ImageInfo) - return FALSE; - } - if (last_marker==M_COM && comment_correction>0) { - if (marker!=0xFF) { - marker = 0xff; - comment_correction--; - } else { - last_marker = M_PSEUDO; /* stop skipping 0 for M_COM */ - } - } - } while (marker == 0xff); - if (last_marker==M_COM && !comment_correction) { - exif_error_docref("exif_read_data#error_mcom" EXIFERR_CC, ImageInfo, E_NOTICE, "Image has corrupt COM section: some software set wrong length information"); - } - if (last_marker==M_COM && comment_correction) - return M_EOI; /* ah illegal: char after COM section not 0xFF */ - - fpos = php_stream_tell(ImageInfo->infile); - - if (marker == 0xff) { - /* 0xff is legal padding, but if we get that many, something's wrong. */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes"); - return FALSE; - } - - /* Read the length of the section. */ - lh = php_stream_getc(ImageInfo->infile); - ll = php_stream_getc(ImageInfo->infile); - - itemlen = (lh << 8) | ll; - - if (itemlen < 2) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s, Section length: 0x%02X%02X", EXIF_ERROR_CORRUPT, lh, ll); -#else - EXIF_ERRLOG_CORRUPT(ImageInfo) -#endif - return FALSE; - } - - sn = exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL); - Data = ImageInfo->file.list[sn].data; - - /* Store first two pre-read bytes. */ - Data[0] = (uchar)lh; - Data[1] = (uchar)ll; - - got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */ - if (got != itemlen-2) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2); - return FALSE; - } - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section(x%02X=%s) @ x%04X + x%04X(=%d)", marker, exif_get_markername(marker), fpos, itemlen, itemlen); -#endif - switch(marker) { - case M_SOS: /* stop before hitting compressed data */ - /* If reading entire image is requested, read the rest of the data. */ - if (ImageInfo->read_all) { - /* Determine how much file is left. */ - fpos = php_stream_tell(ImageInfo->infile); - size = ImageInfo->FileSize - fpos; - sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL); - Data = ImageInfo->file.list[sn].data; - got = php_stream_read(ImageInfo->infile, (char*)Data, size); - if (got != size) { - EXIF_ERRLOG_FILEEOF(ImageInfo) - return FALSE; - } - } - return TRUE; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "No image in jpeg!"); - return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE; - - case M_COM: /* Comment section */ - exif_process_COM(ImageInfo, (char *)Data, itemlen TSRMLS_CC); - break; - - case M_EXIF: - if (!(ImageInfo->sections_found&FOUND_IFD0)) { - /*ImageInfo->sections_found |= FOUND_EXIF;*/ - /* Seen files from some 'U-lead' software with Vivitar scanner - that uses marker 31 later in the file (no clue what for!) */ - exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos TSRMLS_CC); - } - break; - - case M_APP12: - exif_process_APP12(ImageInfo, (char *)Data, itemlen TSRMLS_CC); - break; - - - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - exif_process_SOFn(Data, marker, &sof_info); - ImageInfo->Width = sof_info.width; - ImageInfo->Height = sof_info.height; - if (sof_info.num_components == 3) { - ImageInfo->IsColor = 1; - } else { - ImageInfo->IsColor = 0; - } - break; - default: - /* skip any other marker silently. */ - break; - } - - /* keep track of last marker */ - last_marker = marker; - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Done"); -#endif - return TRUE; -} -/* }}} */ - -/* {{{ exif_scan_thumbnail - * scan JPEG in thumbnail (memory) */ -static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC) -{ - uchar c, *data = (uchar*)ImageInfo->Thumbnail.data; - int n, marker; - size_t length=2, pos=0; - jpeg_sof_info sof_info; - - if (!data) { - return FALSE; /* nothing to do here */ - } - if (memcmp(data, "\xFF\xD8\xFF", 3)) { - if (!ImageInfo->Thumbnail.width && !ImageInfo->Thumbnail.height) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Thumbnail is not a JPEG image"); - } - return FALSE; - } - for (;;) { - pos += length; - if (pos>=ImageInfo->Thumbnail.size) - return FALSE; - c = data[pos++]; - if (pos>=ImageInfo->Thumbnail.size) - return FALSE; - if (c != 0xFF) { - return FALSE; - } - n = 8; - while ((c = data[pos++]) == 0xFF && n--) { - if (pos+3>=ImageInfo->Thumbnail.size) - return FALSE; - /* +3 = pos++ of next check when reaching marker + 2 bytes for length */ - } - if (c == 0xFF) - return FALSE; - marker = c; - length = php_jpg_get16(data+pos); - if (pos+length>=ImageInfo->Thumbnail.size) { - return FALSE; - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process section(x%02X=%s) @ x%04X + x%04X", marker, exif_get_markername(marker), pos, length); -#endif - switch (marker) { - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - /* handle SOFn block */ - exif_process_SOFn(data+pos, marker, &sof_info); - ImageInfo->Thumbnail.height = sof_info.height; - ImageInfo->Thumbnail.width = sof_info.width; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size: %d * %d", sof_info.width, sof_info.height); -#endif - return TRUE; - - case M_SOS: - case M_EOI: - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); - return FALSE; - break; - - default: - /* just skip */ - break; - } - } - - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); - return FALSE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_TIFF - * Parse the TIFF header; */ -static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index TSRMLS_DC) -{ - int i, sn, num_entries, sub_section_index = 0; - unsigned char *dir_entry; - char tagname[64]; - size_t ifd_size, dir_size, entry_offset, next_offset, entry_length, entry_value=0, fgot; - int entry_tag , entry_type; - tag_table_type tag_table = exif_get_tag_table(section_index); - - if (ImageInfo->FileSize >= dir_offset+2) { - sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2); -#endif - php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */ - php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2); - num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel); - dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/; - if (ImageInfo->FileSize >= dir_offset+dir_size) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries); -#endif - if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) { - return FALSE; - } - php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2); - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/ - next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF done, next offset x%04X", next_offset); -#endif - /* now we have the directory we can look how long it should be */ - ifd_size = dir_size; - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - if (entry_type > NUM_FORMATS) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table TSRMLS_CC), entry_type); - /* Since this is repeated in exif_process_IFD_TAG make it a notice here */ - /* and make it a warning in the exif_process_IFD_TAG which is called */ - /* elsewhere. */ - entry_type = TAG_FMT_BYTE; - /*The next line would break the image on writeback: */ - /* php_ifd_set16u(dir_entry+2, entry_type, ImageInfo->motorola_intel);*/ - } - entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel) * php_tiff_bytes_per_format[entry_type]; - if (entry_length <= 4) { - switch(entry_type) { - case TAG_FMT_USHORT: - entry_value = php_ifd_get16u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SSHORT: - entry_value = php_ifd_get16s(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_ULONG: - entry_value = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SLONG: - entry_value = php_ifd_get32s(dir_entry+8, ImageInfo->motorola_intel); - break; - } - switch(entry_tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->Width = entry_value; - break; - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGE_HEIGHT: - ImageInfo->Height = entry_value; - break; - case TAG_PHOTOMETRIC_INTERPRETATION: - switch (entry_value) { - case PMI_BLACK_IS_ZERO: - case PMI_WHITE_IS_ZERO: - case PMI_TRANSPARENCY_MASK: - ImageInfo->IsColor = 0; - break; - case PMI_RGB: - case PMI_PALETTE_COLOR: - case PMI_SEPARATED: - case PMI_YCBCR: - case PMI_CIELAB: - ImageInfo->IsColor = 1; - break; - } - break; - } - } else { - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* if entry needs expading ifd cache and entry is at end of current ifd cache. */ - /* otherwise there may be huge holes between two entries */ - if (entry_offset + entry_length > dir_offset + ifd_size - && entry_offset == dir_offset + ifd_size) { - ifd_size = entry_offset + entry_length - dir_offset; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Resize struct: x%04X + x%04X - x%04X = x%04X", entry_offset, entry_length, dir_offset, ifd_size); -#endif - } - } - } - if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) { - if (ifd_size > dir_size) { - if (dir_offset + ifd_size > ImageInfo->FileSize) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); - return FALSE; - } - if (exif_file_sections_realloc(ImageInfo, sn, ifd_size TSRMLS_CC)) { - return FALSE; - } - /* read values not stored in directory itself */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); -#endif - php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+dir_size), ifd_size-dir_size); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF, done"); -#endif - } - /* now process the tags */ - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - /*entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel);*/ - if (entry_tag == TAG_EXIF_IFD_POINTER || - entry_tag == TAG_INTEROP_IFD_POINTER || - entry_tag == TAG_GPS_IFD_POINTER || - entry_tag == TAG_SUB_IFD - ) { - switch(entry_tag) { - case TAG_EXIF_IFD_POINTER: - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - case TAG_SUB_IFD: - ImageInfo->sections_found |= FOUND_THUMBNAIL; - sub_section_index = SECTION_THUMBNAIL; - break; - } - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset); -#endif - exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC); - if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) { - if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN - && ImageInfo->Thumbnail.size - && ImageInfo->Thumbnail.offset - && ImageInfo->read_thumbnail - ) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); -#endif - if (!ImageInfo->Thumbnail.data) { - ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size); - php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); - fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - if (fgot < ImageInfo->Thumbnail.size) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - } - exif_thumbnail_build(ImageInfo TSRMLS_CC); - } - } - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s done", exif_get_sectionname(sub_section_index)); -#endif - } else { - if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry, - (char*)(ImageInfo->file.list[sn].data-dir_offset), - ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) { - return FALSE; - } - } - } - /* If we had a thumbnail in a SUB_IFD we have ANOTHER image in NEXT IFD */ - if (next_offset && section_index != SECTION_THUMBNAIL) { - /* this should be a thumbnail IFD */ - /* the thumbnail itself is stored at Tag=StripOffsets */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset); -#endif - exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); -#endif - if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) { - ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size); - php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); - fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - if (fgot < ImageInfo->Thumbnail.size) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - } - exif_thumbnail_build(ImageInfo TSRMLS_CC); - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done"); -#endif - } - return TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X)", ImageInfo->FileSize, dir_offset+ImageInfo->file.list[sn].size); - return FALSE; - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+dir_size); - return FALSE; - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than start of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+2); - return FALSE; - } -} -/* }}} */ - -/* {{{ exif_scan_FILE_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC) -{ - unsigned char file_header[8]; - int ret = FALSE; - - ImageInfo->FileType = IMAGE_FILETYPE_UNKNOWN; - - if (ImageInfo->FileSize >= 2) { - php_stream_seek(ImageInfo->infile, 0, SEEK_SET); - php_stream_read(ImageInfo->infile, (char*)file_header, 2); - if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) { - ImageInfo->FileType = IMAGE_FILETYPE_JPEG; - if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file"); - } - } else if (ImageInfo->FileSize >= 8) { - php_stream_read(ImageInfo->infile, (char*)(file_header+2), 6); - if (!memcmp(file_header, "II\x2A\x00", 4)) { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_II; - ImageInfo->motorola_intel = 0; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/II format"); -#endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo, - php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), - SECTION_IFD0 TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); - } - } - else - if (!memcmp(file_header, "MM\x00\x2a", 4)) { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_MM; - ImageInfo->motorola_intel = 1; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/MM format"); -#endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo, - php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), - SECTION_IFD0 TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File not supported"); - return FALSE; - } - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File to small (%d)", ImageInfo->FileSize); - } - return ret; -} -/* }}} */ - -/* {{{ exif_discard_imageinfo - Discard data scanned by exif_read_file. -*/ -static int exif_discard_imageinfo(image_info_type *ImageInfo) -{ - int i; - - EFREE_IF(ImageInfo->FileName); - EFREE_IF(ImageInfo->UserComment); - EFREE_IF(ImageInfo->UserCommentEncoding); - EFREE_IF(ImageInfo->Copyright); - EFREE_IF(ImageInfo->CopyrightPhotographer); - EFREE_IF(ImageInfo->CopyrightEditor); - EFREE_IF(ImageInfo->Thumbnail.data); - EFREE_IF(ImageInfo->encode_unicode); - EFREE_IF(ImageInfo->decode_unicode_be); - EFREE_IF(ImageInfo->decode_unicode_le); - EFREE_IF(ImageInfo->encode_jis); - EFREE_IF(ImageInfo->decode_jis_be); - EFREE_IF(ImageInfo->decode_jis_le); - EFREE_IF(ImageInfo->make); - EFREE_IF(ImageInfo->model); - for (i=0; ixp_fields.count; i++) { - EFREE_IF(ImageInfo->xp_fields.list[i].value); - } - EFREE_IF(ImageInfo->xp_fields.list); - for (i=0; imotorola_intel = -1; /* flag as unknown */ - - ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL); - if (!ImageInfo->infile) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Unable to open file"); - return FALSE; - } - - php_basename(FileName, strlen(FileName), NULL, 0, &(ImageInfo->FileName), NULL TSRMLS_CC); - ImageInfo->read_thumbnail = read_thumbnail; - ImageInfo->read_all = read_all; - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_UNKNOWN; - - ImageInfo->encode_unicode = safe_estrdup(EXIF_G(encode_unicode)); - ImageInfo->decode_unicode_be = safe_estrdup(EXIF_G(decode_unicode_be)); - ImageInfo->decode_unicode_le = safe_estrdup(EXIF_G(decode_unicode_le)); - ImageInfo->encode_jis = safe_estrdup(EXIF_G(encode_jis)); - ImageInfo->decode_jis_be = safe_estrdup(EXIF_G(decode_jis_be)); - ImageInfo->decode_jis_le = safe_estrdup(EXIF_G(decode_jis_le)); - - if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) { - if (VCWD_STAT(FileName, &st) >= 0) { - /* Store file date/time. */ -#ifdef NETWARE - ImageInfo->FileDateTime = st.st_mtime.tv_sec; -#else - ImageInfo->FileDateTime = st.st_mtime; -#endif - ImageInfo->FileSize = st.st_size; - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Opened stream is file: %d", ImageInfo->FileSize);*/ - } - } else { - if (!ImageInfo->FileSize) { - php_stream_seek(ImageInfo->infile, 0, SEEK_END); - ImageInfo->FileSize = php_stream_tell(ImageInfo->infile); - php_stream_seek(ImageInfo->infile, 0, SEEK_SET); - } - } - - ImageInfo->ifd_nesting_level = 0; - - /* Scan the JPEG headers. */ - ret = exif_scan_FILE_header(ImageInfo TSRMLS_CC); - - php_stream_close(ImageInfo->infile); - return ret; -} -/* }}} */ - -/* {{{ proto array exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]]) - Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails */ -PHP_FUNCTION(exif_read_data) -{ - pval **p_name, **p_sections_needed, **p_sub_arrays, **p_read_thumbnail, **p_read_all; - int i, ac = ZEND_NUM_ARGS(), ret, sections_needed=0, sub_arrays=0, read_thumbnail=0, read_all=0; - image_info_type ImageInfo; - char tmp[64], *sections_str, *s; - - memset(&ImageInfo, 0, sizeof(ImageInfo)); - - if ((ac < 1 || ac > 4) || zend_get_parameters_ex(ac, &p_name, &p_sections_needed, &p_sub_arrays, &p_read_thumbnail, &p_read_all) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_name); - - if(ac >= 2) { - convert_to_string_ex(p_sections_needed); - sections_str = safe_emalloc(strlen(Z_STRVAL_PP(p_sections_needed)), 1, 3); - sprintf(sections_str, ",%s,", Z_STRVAL_PP(p_sections_needed)); - /* sections_str DOES start with , and SPACES are NOT allowed in names */ - s = sections_str; - while(*++s) { - if(*s==' ') { - *s = ','; - } - } - for (i=0; i= 3) { - convert_to_long_ex(p_sub_arrays); - sub_arrays = Z_LVAL_PP(p_sub_arrays); - } - if(ac >= 4) { - convert_to_long_ex(p_read_thumbnail); - read_thumbnail = Z_LVAL_PP(p_read_thumbnail); - } - if(ac >= 5) { - convert_to_long_ex(p_read_all); - read_all = Z_LVAL_PP(p_read_all); - } - /* parameters 3,4 will be working in later versions.... */ - read_all = 0; /* just to make function work for 4.2 tree */ - - ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), read_thumbnail, read_all TSRMLS_CC); - - sections_str = exif_get_sectionlist(ImageInfo.sections_found TSRMLS_CC); - -#ifdef EXIF_DEBUG - if (sections_str) - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections found: %s", sections_str[0] ? sections_str : "None"); -#endif - - ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/ - - if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) { - /* array_init must be checked at last! otherwise the array must be freed if a later test fails. */ - exif_discard_imageinfo(&ImageInfo); - EFREE_IF(sections_str); - RETURN_FALSE; - } - - array_init(return_value); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section FILE"); -#endif - - /* now we can add our information */ - exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType) TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE" TSRMLS_CC); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED"); -#endif - - if (ImageInfo.Width>0 && ImageInfo.Height>0) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" TSRMLS_CC, "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height); - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width TSRMLS_CC); - } - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor TSRMLS_CC); - if (ImageInfo.motorola_intel != -1) { - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC); - } - if (ImageInfo.FocalLength) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1fmm", ImageInfo.FocalLength); - if(ImageInfo.CCDWidth) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); - } - } - if(ImageInfo.CCDWidth) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth" TSRMLS_CC, "%dmm", (int)ImageInfo.CCDWidth); - } - if(ImageInfo.ExposureTime>0) { - if(ImageInfo.ExposureTime <= 0.5) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); - } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s", ImageInfo.ExposureTime); - } - } - if(ImageInfo.ApertureFNumber) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1f", ImageInfo.ApertureFNumber); - } - if(ImageInfo.Distance) { - if(ImageInfo.Distance<0) { - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC); - } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2fm", ImageInfo.Distance); - } - } - if (ImageInfo.UserComment) { - exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment TSRMLS_CC); - if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) { - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding TSRMLS_CC); - } - } - - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor TSRMLS_CC); - - for (i=0; i= 3) { - if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) { - exif_scan_thumbnail(&ImageInfo TSRMLS_CC); - } - zval_dtor(p_width); - zval_dtor(p_height); - ZVAL_LONG(p_width, ImageInfo.Thumbnail.width); - ZVAL_LONG(p_height, ImageInfo.Thumbnail.height); - } - if (arg_c >= 4) { - zval_dtor(p_imagetype); - ZVAL_LONG(p_imagetype, ImageInfo.Thumbnail.filetype); - } - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info"); -#endif - - exif_discard_imageinfo(&ImageInfo); - -#ifdef EXIF_DEBUG - php_error_docref1(NULL TSRMLS_CC, p_name, E_NOTICE, "Done"); -#endif -} -/* }}} */ - -/* {{{ proto int exif_imagetype(string imagefile) - Get the type of an image */ -PHP_FUNCTION(exif_imagetype) -{ - zval **arg1; - php_stream * stream; - int itype = 0; - - if (ZEND_NUM_ARGS() != 1) - WRONG_PARAM_COUNT; - - if (zend_get_parameters_ex(1, &arg1) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(arg1); - stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); - - if (stream == NULL) { - RETURN_FALSE; - } - - itype = php_getimagetype(stream, NULL TSRMLS_CC); - - php_stream_close(stream); - - if (itype == IMAGE_FILETYPE_UNKNOWN) { - RETURN_FALSE; - } else { - ZVAL_LONG(return_value, itype); - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 fdm=marker - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/ext/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index 4a827338b2bb3..0000000000000 --- a/ext/exif/exif.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="exif" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=exif - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "exif.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "exif.mak" CFG="exif - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "exif - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "exif - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "exif - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_exif.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "exif - Win32 Release_TS" -# Name "exif - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\exif.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_exif.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/exif/package.xml b/ext/exif/package.xml deleted file mode 100644 index 76ef22c933f97..0000000000000 --- a/ext/exif/package.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - exif - Read header information from JPEG and DIFF headers - - - rasmus - Rasmus Lerdorf - helly@php.net - lead - - - helly - Markus Boerger - helly@php.net - lead - - - -The EXIF functions provide access to information stored in headers -of JPEG and TIFF images. This way you can read meta data generated -by digital cameras and certain image processing applications. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h deleted file mode 100644 index ca5a00137cb54..0000000000000 --- a/ext/exif/php_exif.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#if HAVE_EXIF -extern zend_module_entry exif_module_entry; -#define phpext_exif_ptr &exif_module_entry - -PHP_FUNCTION(exif_read_data); -PHP_FUNCTION(exif_tagname); -PHP_FUNCTION(exif_thumbnail); -PHP_FUNCTION(exif_imagetype); -#endif diff --git a/ext/exif/test.php b/ext/exif/test.php deleted file mode 100644 index 907b9ea080aea..0000000000000 --- a/ext/exif/test.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/ext/exif/test.txt b/ext/exif/test.txt deleted file mode 100644 index 1c12b509e6559..0000000000000 --- a/ext/exif/test.txt +++ /dev/null @@ -1,365 +0,0 @@ -\n"; - echo "Thumbnail could not be extracted.\n"; - echo "
"; - } - die(); -} - -if ( !defined('IMAGETYPE_GIF')) define('IMAGETYPE_GIF',1); -if ( !defined('IMAGETYPE_JPEG')) define('IMAGETYPE_JPEG',2); -if ( !defined('IMAGETYPE_TIFF_II')) define('IMAGETYPE_TIFF_II',7); -if ( !defined('IMAGETYPE_TIFF_MM')) define('IMAGETYPE_TIFF_MM',8); - -$possible = array(); - -/****************************************************************************/ -// message function is used for debugging purpose: just to se what happens -function message($msg) { - error_log($msg,0); - echo "$msg\n"; -} - -function error_msg() { - $ret = 'O.K.'; - if (array_key_exists('php_errormsg',$GLOBALS) && strlen($GLOBALS['php_errormsg'])) { - $ret = ''.$GLOBALS['php_errormsg'].''; - $GLOBALS['php_errormsg'] = ''; - } - return $ret; -} - -/****************************************************************************/ -// private to function search_file() -function _search_file($root,&$possible,$path='') { - $sub = array(); - $cnt = 0; - $type= false; - - //error_log("search_file($root,$path)",0); - if ($dir = @opendir($root.$path.'/')) { - while (($found = @readdir($dir)) !== false) { - $type = @filetype($root.$path.'/'.$found); - //error_log("search_file($root$path):$type=$found",0); - switch( $type) { - case 'file': - $pos = strrpos($found,'.'); - if ( function_exists('exif_imagetype')) { - $type = exif_imagetype($root.$path.'/'.$found); - } else { - if ( $pos!==false) { - $type = GetImageSize($root.$path.'/'.$found); - if ( is_array($type)) { - $type = $type[2]; - } else { - $type = false; - } - } else $type = false; - } - if ( $type!==false) - { - $possible[] = array('file'=>$root.$path.'/'.$found, 'type'=>$type); - //error_log("search_file($root$path) add:$path/$found",0); - if ( ($cnt=count($possible)) % 100 == 0) { - error_log("exif test page - counting files: $cnt",0); - } - } - break; - case 'dir': - if ( $found!='.' && $found!='..') { - $sub[count($sub)] = $found; - } - break; - } - } - @closedir($dir); - foreach( $sub as $idx => $found) { - _search_file($root,$possible,$path.'/'.$found); - } - } -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function search_file() { - global $argc, $argv; - $possible = array(); - - if ( $argc > 1) { - $path = $argv[1]; - } else if ( array_key_exists('SCRIPT_FILENAME',$_SERVER)) { - $path = $_SERVER['SCRIPT_FILENAME']; - //error_log("SCRIPT_FILENAME($path)",0); - } else { - $path = $argv[0]; - //error_log("argv($path)",0); - } - if ( ($p=strpos($path,'?')) !== false) $path = substr($path,0,$p); - if ( ($p=strrpos($path,'/')) /*< strlen($path)-1*/) $path = substr($path,0,$p); - error_log("exif test page - counting files in $path"); - _search_file($path,$possible); - error_log("exif test page - counting files: ".count($possible)." done.",0); - return $possible; -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function AddInfo($Name,$Value,$highlight=0) { - if (is_array($Value)) $Value = 'Array: ('.join(',',$Value).')'; - $Value = nl2br($Value); - if ( $highlight) { - $Name = "$Name"; - } else { - $Name = "$Name"; - } - return "$Name$Value \n"; -} - -$possible = search_file(); - -$title = "PHP module exif test page"; - -?> - - -<?=$title ?> - - - -

-

(c) Marcus Börger, 2002

-

-

-Images taken from www.exif.org, -marcus-boerger.de -all rights reserved by their authors and artists, see exif headers. -The files can be downloaded here. -To start the test you simple have to put all images into the same directory as this script. -The test will work with all files in that directory and all subdirectories. To test private -images just put them into that directory. -

-

-Youmay take a look at the test source here. -

-

-This test just prooves that some exif headers can be scanned. -If all files produce a header in output the module might be o.k. -

-

-What to look for in detail: -

-
    -
  • kodak-dc4800-plus-acdsee.jpg -
      -
    • should provide a long comment 'by marcus börger<%04i>'*n
    • -
    • this file returns an array but it also produces an errormessage because ACDSee destroys - the integrity of IFD directory (size of directory and offsets of entries following any - edited entry maybe wrong). -
    • -
    -
  • -
  • hp-photosmart.jpg -
      -
    • should provide a two line copyright notice
    • -
    -
  • -
  • olympus-d320l -
      -
    • should provide an APP12 infoset
    • -
    -
  • -
  • unknown.jpg -
      -
    • should provide an empty comment, this is a comment section and not an IFD0, EXIF or GPS section
    • -
    -
  • -
  • some images -
      -
    • have empty fields, that is the tag is present but no data is stored
    • -
    -
  • -
-

function exif_tagname

- - - - - - -\n"; -} -?> -
ImageWidth
JPEGProc
SceneType
false
function exif_tagname is not supported
-
-

function exif_read_data for images

- -\n"; - $tab2 = "";//"\n"; - $types = array('','GIF','JPEG','PNG','SWF','PSD','BMP','TIFF_II','TIFF_MM','JPC','JP2','JPX','JB2'); - foreach($possible as $idx => $file) { - $type = $file['type']; - $file = $file['file']; - if ( !((++$num)%100)) error_log("exif test page - checking files: $num",0); - $error = ''; - $len = 2; - $rows = 1 - + ($check_getimagesize ? 1 : 0) - + ($check_exif_thumbnail ? 1 : 0) - + ($check_exif_read_data ? 1 : 0); - if ( !$fast_output) echo "\n"; - if ($check_getimagesize) { - $len++; - $size = GetImageSize($file); - $error = error_msg();// clear message - if ( $size === false) { - $error = 'GetImageSize returned false
'.$error; - $res_getimagesize = $error; - } else { - $res_getimagesize = '('.join($size,',').')'; - } - if ( !$fast_output) echo AddInfo("GetImageSize",$error,1); - } - if ( $check_exif_thumbnail) { - $len++; - if ($type!=IMAGETYPE_JPEG) {// && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) { - $error = "filetype not supported: $types[$type]"; - $res_exif_thumbnail = $error; - } else { - $t_width = 0; - $t_height = 0; - $result = exif_thumbnail($file, $t_width, $t_height); - $error = error_msg();// clear message - if ( $result === false) { - $error = 'exif_thumbnail returned false
'.$error; - if ( $t_width && $t_height) { - $error = "$t_width x $t_height
$error"; - } - $res_exif_thumbnail = $error; - } else { - $res_exif_thumbnail = $t_width . " x " . $t_height; - } - } - if ( !$fast_output) echo AddInfo("exif_thumbnail",$error,1); - } - if ($check_exif_read_data) { - $len++; - if ($type!=IMAGETYPE_JPEG && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) { - $res_exif_read_data = "filetype not supported: $types[$type]"; - if ( !$fast_output) echo AddInfo("exif_read_data",$res_exif_read_data); - $res = ''; - } else { - $image = exif_read_data($file,'COMMENT,IFD0,EXIF,APP12',true); - $error = error_msg();// clear message - if ( !$fast_output) echo AddInfo("exif_read_data",$error,1); - $res = ''; - if ( $image === false) { - $res_exif_read_data = "exif_read_data returned false
$error"; - } else { - $res_exif_read_data = $error; - // ah no!$error = error_msg(); // force o.k. - foreach($image as $Name => $Value) { - if ( $Name!='Thumbnail') { - if ( is_array($Value)) { - $len++; - $res .= AddInfo($Name,'Array('.count($Value).')'); - foreach( $Value as $idx => $Entry) { - if ($idx==='Thumbnail') $Entry = '<data>'; - $len++; - $res .= AddInfo($Name.':'.$idx,$Entry); - } - } else { - $len++; - $res .= AddInfo($Name,$Value); - } - } - } - } - } - } - $tab2 .= "\n"; - $tab2 .= "\n"; - if ($check_getimagesize) { - $tab2 .= "\n"; - } - if ($check_exif_thumbnail) { - $tab2 .= "\n"; - } - if ($check_exif_read_data) { - $tab2 .= "\n"; - $tab2 .= $res; - } - if ( $fast_output) { - echo $tab2; - $tab2 = ''; - } - } - error_log("exif test page - checking files: ".count($possible)." done.",0); - echo $tab2; - echo "
$num$file
$num
$file
GetImageSize$res_getimagesize
exif_thumbnail$res_exif_thumbnail
exif_read_data$res_exif_read_data
\n"; -} else { - echo "

function exif_read_data is not supported

\n"; -} -?> - - \ No newline at end of file diff --git a/ext/exif/tests/bug34704.jpg b/ext/exif/tests/bug34704.jpg deleted file mode 100755 index 42b14c1908fc3..0000000000000 Binary files a/ext/exif/tests/bug34704.jpg and /dev/null differ diff --git a/ext/exif/tests/bug34704.phpt b/ext/exif/tests/bug34704.phpt deleted file mode 100755 index b6b26de78d67c..0000000000000 --- a/ext/exif/tests/bug34704.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug #34704 (Infinite recursion due to corrupt JPEG) ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 -output_handler= -zlib.output_compression=0 ---FILE-- - -===DONE=== ---EXPECTF-- -array(7) { - ["FileName"]=> - string(12) "bug34704.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(9976) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(4) "IFD0" - ["COMPUTED"]=> - array(5) { - ["html"]=> - string(24) "width="386" height="488"" - ["Height"]=> - int(488) - ["Width"]=> - int(386) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - } -} -===DONE=== diff --git a/ext/exif/tests/exif000.phpt b/ext/exif/tests/exif000.phpt deleted file mode 100644 index eea16438cf136..0000000000000 --- a/ext/exif/tests/exif000.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Check for exif_read_data default behaviour ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -Array -( - [FileName] => test2.jpg - [FileDateTime] => %d - [FileSize] => 1240 - [FileType] => 2 - [MimeType] => image/jpeg - [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, COMMENT - [COMPUTED] => Array - ( - [html] => width="1" height="1" - [Height] => 1 - [Width] => 1 - [IsColor] => 1 - [ByteOrderMotorola] => 1 - [UserComment] => Exif test image. - [UserCommentEncoding] => ASCII - [Copyright] => Photo (c) M.Boerger, Edited by M.Boerger. - [Copyright.Photographer] => Photo (c) M.Boerger - [Copyright.Editor] => Edited by M.Boerger. - [Thumbnail.FileType] => 2 - [Thumbnail.MimeType] => image/jpeg - ) - - [Copyright] => Photo (c) M.Boerger - [UserComment] => ASCII - [THUMBNAIL] => Array - ( - [JPEGInterchangeFormat] => 134 - [JPEGInterchangeFormatLength] => 523 - ) - - [COMMENT] => Array - ( - [0] => Comment #1. - [1] => Comment #2. - [2] => Comment #3end - ) - -) diff --git a/ext/exif/tests/exif001.phpt b/ext/exif/tests/exif001.phpt deleted file mode 100644 index 8fac4286ca686..0000000000000 --- a/ext/exif/tests/exif001.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Check for exif_read_data ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test2.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(16) "Exif test image." - ["UserCommentEncoding"]=> - string(5) "ASCII" - ["Copyright"]=> - string(41) "Photo (c) M.Boerger, Edited by M.Boerger." - ["Copyright.Photographer"]=> - string(19) "Photo (c) M.Boerger" - ["Copyright.Editor"]=> - string(20) "Edited by M.Boerger." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(19) "Photo (c) M.Boerger" - ["UserComment"]=> - string(5) "ASCII" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(11) "Comment #1." - [1]=> - string(11) "Comment #2." - [2]=> - string(13) "Comment #3end" - } -} \ No newline at end of file diff --git a/ext/exif/tests/exif002.phpt b/ext/exif/tests/exif002.phpt deleted file mode 100644 index 1b1220c60073a..0000000000000 --- a/ext/exif/tests/exif002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Check for exif_thumbnail ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECT-- -27bbfd9fc10e1e663d749f5225447905_523 == 27bbfd9fc10e1e663d749f5225447905_523 diff --git a/ext/exif/tests/exif003.phpt b/ext/exif/tests/exif003.phpt deleted file mode 100644 index 20cb61ee17183..0000000000000 --- a/ext/exif/tests/exif003.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Check for exif_read_data, Unicode user comment ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -exif.decode_unicode_motorola=UCS-2BE -exif.encode_unicode=ISO-8859-15 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test3.jpg" - ["FileDateTime"]=> - int(%s) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(7) "ÄÖÜßäöü" - ["UserCommentEncoding"]=> - string(7) "UNICODE" - ["Copyright"]=> - string(41) "Photo (c) M.Boerger, Edited by M.Boerger." - ["Copyright.Photographer"]=> - string(19) "Photo (c) M.Boerger" - ["Copyright.Editor"]=> - string(20) "Edited by M.Boerger." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(19) "Photo (c) M.Boerger" - ["UserComment"]=> - string(7) "UNICODE" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(11) "Comment #1." - [1]=> - string(11) "Comment #2." - [2]=> - string(13) "Comment #3end" - } -} \ No newline at end of file diff --git a/ext/exif/tests/exif004.phpt b/ext/exif/tests/exif004.phpt deleted file mode 100644 index 229f49e1459b8..0000000000000 --- a/ext/exif/tests/exif004.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Check for exif_read_data, Unicode WinXP tags ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -exif.decode_unicode_intel=UCS-2LE -exif.decode_unicode_motorola=UCS-2BE -exif.encode_unicode=ISO-8859-1 ---FILE-- - ---EXPECT-- -array(5) { - ["Subject"]=> - string(10) "Subject..." - ["Keywords"]=> - string(11) "Keywords..." - ["Author"]=> - string(9) "Rui Carmo" - ["Comments"]=> - string(29) "Comments -Line2 -Line3 -Line4" - ["Title"]=> - string(8) "Title..." -} diff --git a/ext/exif/tests/exif005.phpt b/ext/exif/tests/exif005.phpt deleted file mode 100644 index e34e3a0421746..0000000000000 --- a/ext/exif/tests/exif005.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Check for exif_read_data, unusual IFD start ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECT-- -array(2) { - ["ImageDescription"]=> - string(11) "Ifd00000009" - ["DateTime"]=> - string(19) "2002:10:18 20:06:00" -} \ No newline at end of file diff --git a/ext/exif/tests/exif006.phpt b/ext/exif/tests/exif006.phpt deleted file mode 100644 index bad74ee4fa98b..0000000000000 --- a/ext/exif/tests/exif006.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Check for exif_read_data, magic_quotes_runtime ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -magic_quotes_runtime=1 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test6.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(24) "width=\"1\" height=\"1\"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(16) "Hallo \'Du\'+da!" - ["UserCommentEncoding"]=> - string(5) "ASCII" - ["Copyright"]=> - string(45) "Photo \"M. Boerger\"., Edited \'M. Boerger\'." - ["Copyright.Photographer"]=> - string(21) "Photo \"M. Boerger\"." - ["Copyright.Editor"]=> - string(22) "Edited \'M. Boerger\'." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(21) "Photo \"M. Boerger\"." - ["UserComment"]=> - string(5) "ASCII" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(13) "Comment \"1\"" - [1]=> - string(13) "Comment \'2\'" - [2]=> - string(13) "Comment #3end" - } -} diff --git a/ext/exif/tests/test1.jpg b/ext/exif/tests/test1.jpg deleted file mode 100644 index 121decb65ad30..0000000000000 Binary files a/ext/exif/tests/test1.jpg and /dev/null differ diff --git a/ext/exif/tests/test2.jpg b/ext/exif/tests/test2.jpg deleted file mode 100644 index f60ecded6f8b0..0000000000000 Binary files a/ext/exif/tests/test2.jpg and /dev/null differ diff --git a/ext/exif/tests/test3.jpg b/ext/exif/tests/test3.jpg deleted file mode 100644 index 7547a16630f6b..0000000000000 Binary files a/ext/exif/tests/test3.jpg and /dev/null differ diff --git a/ext/exif/tests/test4.jpg b/ext/exif/tests/test4.jpg deleted file mode 100644 index 8a23a7b658ddc..0000000000000 Binary files a/ext/exif/tests/test4.jpg and /dev/null differ diff --git a/ext/exif/tests/test5.jpg b/ext/exif/tests/test5.jpg deleted file mode 100644 index d03cac18a3092..0000000000000 Binary files a/ext/exif/tests/test5.jpg and /dev/null differ diff --git a/ext/exif/tests/test6.jpg b/ext/exif/tests/test6.jpg deleted file mode 100644 index 073cefdfe0221..0000000000000 Binary files a/ext/exif/tests/test6.jpg and /dev/null differ diff --git a/ext/ext_skel b/ext/ext_skel deleted file mode 100755 index 58cc89f80f2d0..0000000000000 --- a/ext/ext_skel +++ /dev/null @@ -1,300 +0,0 @@ -#!/bin/sh - -givup() { - echo $* - exit 1 -} - -usage() { -echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]" -echo " [--skel=dir] [--full-xml] [--no-help]" -echo "" -echo " --extname=module module is the name of your extension" -echo " --proto=file file contains prototypes of functions to create" -echo " --stubs=file generate only function stubs in file" -echo " --xml generate xml documentation to be added to phpdoc-cvs" -echo " --skel=dir path to the skeleton directory" -echo " --full-xml generate xml documentation for a self-contained extension" -echo " (not yet implemented)" -echo " --no-help don't try to be nice and create comments in the code" -echo " and helper functions to test if the module compiled" -exit 1 -} - -if test $# = 0; then - usage -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --extname=?*) - extname=$optarg - EXTNAME=`echo $extname | tr "[:lower:]" "[:upper:]"` - ;; - --proto=?*) - proto=$optarg - ;; - --stubs=*) - stubs=yes - stubfile=$optarg - ;; - --xml) - xml="yes" - ;; - --xml=?*) - xml=$optarg - ;; - --full-xml) - full_xml="yes" - ;; - --no-help) - no_help="yes" - ;; - --skel=?*) - skel_dir=$optarg - ;; - *) - usage - ;; - esac - shift -done - -if test -d "$extname" ; then - givup "Directory $extname already exists." -fi - -if test -z "$skel_dir"; then - skel_dir="skeleton" -fi - -## convert skel_dir to full path -skel_dir=`cd $skel_dir && pwd` - -test -d $skel_dir || givup "directory $skel_dir does not exist or is not directory" - -if echo '\c' | grep -s c >/dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -if test -z "$stubs"; then - echo "Creating directory $extname" - stubfile=$extname"/function_stubs" - mkdir $extname || givup "Cannot create directory $extname" -fi - -if test -n "$proto"; then - cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f $skel_dir/create_stubs -fi - -if test -z "$stubs"; then - cd $extname - chmod 755 . - -$ECHO_N "Creating basic files:$ECHO_C" - -$ECHO_N " config.m4$ECHO_C" -cat >config.m4 < check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this - dnl if test -r \$PHP_$EXTNAME/\$SEARCH_FOR; then # path given as parameter - dnl ${EXTNAME}_DIR=\$PHP_$EXTNAME - dnl else # search default path list - dnl AC_MSG_CHECKING([for $extname files in default path]) - dnl for i in \$SEARCH_PATH ; do - dnl if test -r \$i/\$SEARCH_FOR; then - dnl ${EXTNAME}_DIR=\$i - dnl AC_MSG_RESULT(found in \$i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "\$${EXTNAME}_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the $extname distribution]) - dnl fi - - dnl # --with-$extname -> add include path - dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include) - - dnl # --with-$extname -> check for lib and symbol presence - dnl LIBNAME=$extname # you may want to change this - dnl LIBSYMBOL=$extname # you most likely want to change this - - dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) - dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm -ldl - dnl ]) - dnl - dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) - - PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared) -fi -eof - -$ECHO_N " config.w32$ECHO_C" -cat >config.w32 <.cvsignore < sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_entries_here__/r function_entries' >> sedscript -echo '/__function_stubs_here__/r function_stubs' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_entries_here__/D' >> sedscript -echo '/__function_stubs_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo '/Remove the following/,/^\*\//D' >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi - -sed -f sedscript < $skel_dir/skeleton.c > $extname.c - - -$ECHO_N " php_$extname.h$ECHO_C" -echo "s/extname/$extname/g" > sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_declarations_here__/r function_declarations' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_declarations_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi -sed -f sedscript <$skel_dir/php_skeleton.h > php_$extname.h - -$ECHO_N " CREDITS$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <$skel_dir/CREDITS > CREDITS - -$ECHO_N " EXPERIMENTAL$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <$skel_dir/EXPERIMENTAL > EXPERIMENTAL - -$ECHO_N " tests/001.phpt$ECHO_C" -mkdir tests || givup "Cannot create tests directory" -chmod 755 tests -sed -f sedscript <$skel_dir/tests/001.phpt > tests/001.phpt - -if test -z "$stubs" && test -z "$no_help"; then - $ECHO_N " $extname.php$ECHO_C" - sed \ - -e "s/extname/$extname/g" \ - <$skel_dir/skeleton.php \ - > $extname.php -fi - -rm sedscript - -if test -n "$proto"; then - if test -z "$stubs"; then - rm function_entries - rm function_declarations - rm function_stubs - fi - if test -f function_warning; then - rm function_warning - warning=" -NOTE! Because some arguments to functions were resources, the code generated -cannot yet be compiled without editing. Please consider this to be step 4.5 -in the instructions above. -" - fi -fi - -find . -type f | xargs chmod 644 -find . -type d | xargs chmod 755 -fi - -echo " [done]." - -if test -z "$no_help" && test -z "$stubs"; then - cat < \ No newline at end of file diff --git a/ext/fbsql/CREDITS b/ext/fbsql/CREDITS deleted file mode 100644 index 3500fdc89e084..0000000000000 --- a/ext/fbsql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FBSQL -Frank M. Kromann diff --git a/ext/fbsql/Readme_w32.txt b/ext/fbsql/Readme_w32.txt deleted file mode 100644 index af8bfdc1e9676..0000000000000 --- a/ext/fbsql/Readme_w32.txt +++ /dev/null @@ -1,22 +0,0 @@ -Rules for building FBSQL ------------------------- - -The fbsql project contains 2 configurations. - -To build this extension you must first download and -install FrontBase. The default instalation path would -be c:\usr\FrontBase. If you install it in another location -you need to change the include path in the project before -compiling. - -Start Visual Studio, load php_modules.dsw, select the fbsql projects, -configuration and build it. - -Finaly copy php_fbsql.dll to your extension directory and enable it -by adding the following line tp php.ini - -extension=php_fbsql.dll - -or by calling dl() in each script - -dl("php_fbsql.dll"); \ No newline at end of file diff --git a/ext/fbsql/config.m4 b/ext/fbsql/config.m4 deleted file mode 100644 index 384c4cd3808d5..0000000000000 --- a/ext/fbsql/config.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fbsql, for FrontBase SQL92 (fbsql) support, -[ --with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory]) - -if test "$PHP_FBSQL" != "no"; then - - AC_DEFINE(HAVE_FBSQL, 1, [Whether you have FrontBase]) - PHP_NEW_EXTENSION(fbsql, php_fbsql.c, $ext_shared) - - FBSQL_INSTALLATION_DIR="" - if test "$PHP_FBSQL" = "yes"; then - - for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do - if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then - FBSQL_INSTALLATION_DIR=$i/FrontBase - break - fi - done - - if test -z "$FBSQL_INSTALLATION_DIR"; then - AC_MSG_ERROR(Cannot find FrontBase in known installation directories) - fi - - elif test "$PHP_FBSQL" != "no"; then - - if test -f $PHP_FBSQL/include/FBCAccess/FBCAccess.h; then - FBSQL_INSTALLATION_DIR=$PHP_FBSQL - else - AC_MSG_ERROR(Directory $PHP_FBSQL is not a FrontBase installation directory) - fi - fi - - if test ! -r "$FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a"; then - AC_MSG_ERROR(Could not find $FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a) - fi - - PHP_ADD_LIBRARY_WITH_PATH(FBCAccess, $FBSQL_INSTALLATION_DIR/lib, FBSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($FBSQL_INSTALLATION_DIR/include) - PHP_SUBST(FBSQL_SHARED_LIBADD) -fi diff --git a/ext/fbsql/config.w32 b/ext/fbsql/config.w32 deleted file mode 100644 index 0c6909ab52948..0000000000000 --- a/ext/fbsql/config.w32 +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("fbsql", "FrontBase support", "no"); - -if (PHP_FBSQL == "yes") { - if (CHECK_LIB("FBCAccess.lib", "fbsql", - "\\usr\\FrontBase\\lib;" + PHP_PHP_BUILD + "\\FrontBase\\lib;" - + PHP_FBSQL + "\\lib;" + PHP_FBSQL) && - CHECK_HEADER_ADD_INCLUDE("FBCAccess\\FBCAccess.h", "CFLAGS_FBSQL", - "\\usr\\FrontBase\\include;" + PHP_PHP_BUILD + "\\FrontBase\\include;" - + PHP_FBSQL + "\\include;" + PHP_FBSQL)) { - EXTENSION("fbsql", "php_fbsql.c"); - ADD_FLAG('CFLAGS_FBSQL', '/DWinNT=1'); - AC_DEFINE('HAVE_FBSQL', 1, 'Have FrontBase support'); - } else { - WARNING("fbsql not enabled; libraries and headers not found"); - } -} diff --git a/ext/fbsql/fbsql.dsp b/ext/fbsql/fbsql.dsp deleted file mode 100644 index a71186361617a..0000000000000 --- a/ext/fbsql/fbsql.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fbsql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fbsql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak" CFG="fbsql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fbsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fbsql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "NDEBUG" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /D ZEND_DEBUG=0 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_fbsql.dll" /libpath:"..\..\Release" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /FR /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib php5ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "NDEBUG" /D ZTS=1 /D ZEND_DEBUG=0 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib FBCAccess.lib ws2_32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline" - -!ENDIF - -# Begin Target - -# Name "fbsql - Win32 Release" -# Name "fbsql - Win32 Debug" -# Name "fbsql - Win32 Debug_TS" -# Name "fbsql - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_fbsql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fbsql.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\Readme_w32.txt -# End Source File -# End Target -# End Project diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c deleted file mode 100644 index 340a653697f47..0000000000000 --- a/ext/fbsql/php_fbsql.c +++ /dev/null @@ -1,3739 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* TODO: - * - * ? Safe mode implementation - */ - -/* SB's list: - - API for a more natural FB connect semantic - - Connect & set session - - Autoreconnect when disconnected - - Comments and cleanup - - BUGS - - Select db with no arguments - - Query with everything defaulted -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" - -#ifdef PHP_WIN32 -#include -#else -#include - -#if HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#endif - -#include "php_ini.h" - -#define HAVE_FBSQL 1 - -#if HAVE_FBSQL -#include "php_fbsql.h" -#include - -static int le_result, le_link, le_plink; - -struct PHPFBResult; -typedef struct PHPFBResult PHPFBResult; - -struct PHPFBLink; -typedef struct PHPFBLink PHPFBLink; - -/* The PHPFBLink structure represents a fbsql link. The lion is used for - a connection to a machine, it may be persistent and is reference counted. - The reason for refcounting is mostly to avoid to think, it work independent of - any wierd and unforseen allocation deallocation order. - - The PHPFBDatabse structure implements to actual connection to a FrontBase server - ot may be persistent is the link it is connected to is persistent, and refcounted - for the same reasons as above. - - The PHPFBResult structure implements a result from the FrontBase server, and does all - required buffereing from of results. - - In the PHP code the 3 above a data structures are referenced by means of integers in the - range from 1 to som configurable maximum. You can put a limit to the number of links, databases - and results. The integer identifications is implemented by insertion in the list, which is passed - as an argument to all the functions, please note the list is polymorph. - - Database objects and link objects are all reused, base on the host name user name, host name database name - user name. So connecting twice to the same database as the same user will return the same database id. - We use the same coding for that as fbsql does, explioiting the underlying implementation of the lists. - - Persistent objects are put in the persistent list as well, but only by name, if you connect to a persistent object - and it is not in the list it is simply added and get a new index, and refcounted. Tricky, tricky ... -*/ - -/* Some functions which should be exported from FBCAccess */ - -void* fbaObjectAtIndex(); -void fbaRelease(); -unsigned int fbaCount(); - -struct FBCAutoStartInfo { - FBArray* infoLines; -}; - -struct PHPFBResult -{ - PHPFBLink* link; /* The link for the result, may be NULL if no link */ - char* fetchHandle; /* The fetch handle, the id used by the server. */ - FBCMetaData* metaData; /* The metadata describing the result */ - FBCMetaData* ResultmetaData; /* The metadata describing the result */ - FBCRowHandler* rowHandler; /* The row handler, the Frontbase structure used for accessing rows in the result */ - unsigned int batchSize; /* The number of row to fetch when expanding the number of rows in the row handler */ - unsigned int rowCount; /* The number of rows in the results set. The number of row is not in */ - /* general known when the select is done, one typically needs to fetch all the row - to figure out how many row you got. When the rowCount is unknown the value is - 0x7ffffffff */ - int columnCount; /* Number of columns in the row set. */ - unsigned int rowIndex; /* The current row index. */ - int columnIndex; /* The current column index */ - void** row; /* The last row accessed */ - FBArray* array; /* The link may return a result set, the database list, we implement that by the */ - /* FBArray, just a list of strings. */ - FBCPList* list; /* The same special kind result just for property list from extract, schema info. */ - unsigned int selectResults; /* number of results in select */ - unsigned int currentResult; /* current result number */ - int lobMode; /* 0=Fetch data (default); 1=Fetch handle */ -}; - -struct PHPFBLink -{ - int persistent; /* persistent ? */ - char* hostName; /* Host name */ - char* userName; /* User name */ - char* userPassword; /* User password */ - char* databasePassword; /* Database password */ - char* databaseName; /* The name of the database */ - FBCExecHandler* execHandler; /* The exechandler, can be used for database operations */ - FBCDatabaseConnection* connection; /* The connection to the database */ - unsigned int affectedRows; /* Number of rows affected by the last SQL statement */ - long autoCommit; /* Enable or disable autoCommit */ - unsigned int errorNo; /* The latest error on the connection, 0 is ok. */ - char* errorText; /* The error text */ - unsigned int insert_id; /* The row index of the latest row inserted into the database */ -}; - -#define FBSQL_ASSOC 1<<0 -#define FBSQL_NUM 1<<1 -#define FBSQL_BOTH (FBSQL_ASSOC|FBSQL_NUM) - -#define FBSQL_LOCK_DEFERRED 0 -#define FBSQL_LOCK_OPTIMISTIC 1 -#define FBSQL_LOCK_PESSIMISTIC 2 /* default */ - -#define FBSQL_ISO_READ_UNCOMMITTED 0 -#define FBSQL_ISO_READ_COMMITTED 1 -#define FBSQL_ISO_REPEATABLE_READ 2 -#define FBSQL_ISO_SERIALIZABLE 3 /* default */ -#define FBSQL_ISO_VERSIONED 4 - -#define FBSQL_LOB_DIRECT 0 /* default */ -#define FBSQL_LOB_HANDLE 1 /* default */ - -#define DIGEST_BUFFER_SIZE 17 /* fbcDigestPassword() expects a preallocated buffer for 16 bytes plus termination */ - -int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql); -char *DigestPassword(char *user, char *password) -{ - char *digest = NULL; - - if (user && strlen(user) && password && strlen(password)) { - char *user_upper = estrdup(user); - digest = emalloc(DIGEST_BUFFER_SIZE); - digest[0] = '\0'; - (void)fbcDigestPassword(php_strtoupper(user_upper, strlen(user_upper)), password, digest); - efree(user_upper); - } - - return digest; -} - -/* {{{ fbsql_functions[] - */ -function_entry fbsql_functions[] = { - PHP_FE(fbsql_connect, NULL) - PHP_FE(fbsql_pconnect, NULL) - PHP_FE(fbsql_close, NULL) - PHP_FE(fbsql_select_db, NULL) - PHP_FE(fbsql_set_characterset, NULL) - PHP_FE(fbsql_create_db, NULL) - PHP_FE(fbsql_drop_db, NULL) - PHP_FE(fbsql_start_db, NULL) - PHP_FE(fbsql_stop_db, NULL) - PHP_FE(fbsql_db_status, NULL) - PHP_FE(fbsql_query, NULL) - PHP_FE(fbsql_db_query, NULL) - PHP_FE(fbsql_list_dbs, NULL) - PHP_FE(fbsql_list_tables, NULL) - PHP_FE(fbsql_list_fields, NULL) - PHP_FE(fbsql_error, NULL) - PHP_FE(fbsql_errno, NULL) - PHP_FE(fbsql_affected_rows, NULL) - PHP_FE(fbsql_rows_fetched, NULL) - PHP_FE(fbsql_insert_id, NULL) - PHP_FE(fbsql_result, NULL) - PHP_FE(fbsql_next_result, NULL) - PHP_FE(fbsql_num_rows, NULL) - PHP_FE(fbsql_num_fields, NULL) - PHP_FE(fbsql_fetch_row, NULL) - PHP_FE(fbsql_fetch_array, NULL) - PHP_FE(fbsql_fetch_assoc, NULL) - PHP_FE(fbsql_fetch_object, NULL) - PHP_FE(fbsql_data_seek, NULL) - PHP_FE(fbsql_fetch_lengths, NULL) - PHP_FE(fbsql_fetch_field, NULL) - PHP_FE(fbsql_field_seek, NULL) - PHP_FE(fbsql_free_result, NULL) - PHP_FE(fbsql_field_name, NULL) - PHP_FE(fbsql_field_table, NULL) - PHP_FE(fbsql_field_len, NULL) - PHP_FE(fbsql_field_type, NULL) - PHP_FE(fbsql_field_flags, NULL) - PHP_FE(fbsql_table_name, NULL) - -/* Fontbase additions: */ - PHP_FE(fbsql_set_transaction, NULL) - PHP_FE(fbsql_autocommit, NULL) - PHP_FE(fbsql_commit, NULL) - PHP_FE(fbsql_rollback, NULL) - - PHP_FE(fbsql_create_blob, NULL) - PHP_FE(fbsql_create_clob, NULL) - PHP_FE(fbsql_set_lob_mode, NULL) - PHP_FE(fbsql_read_blob, NULL) - PHP_FE(fbsql_read_clob, NULL) - PHP_FE(fbsql_blob_size, NULL) - PHP_FE(fbsql_clob_size, NULL) - - PHP_FE(fbsql_hostname, NULL) - PHP_FE(fbsql_database, NULL) - PHP_FE(fbsql_database_password, NULL) - PHP_FE(fbsql_username, NULL) - PHP_FE(fbsql_password, NULL) - PHP_FE(fbsql_warnings, NULL) - PHP_FE(fbsql_set_password, NULL) - - PHP_FE(fbsql_get_autostart_info, NULL) -/* PHP_FE(fbsql_set_autostart_info, NULL) */ - -/* Aliases: */ - PHP_FALIAS(fbsql, fbsql_db_query, NULL) - PHP_FALIAS(fbsql_tablename, fbsql_table_name, NULL) - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry fbsql_module_entry = { - STANDARD_MODULE_HEADER, - "fbsql", - fbsql_functions, - PHP_MINIT(fbsql), - PHP_MSHUTDOWN(fbsql), - PHP_RINIT(fbsql), - PHP_RSHUTDOWN(fbsql), - PHP_MINFO(fbsql), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -ZEND_DECLARE_MODULE_GLOBALS(fbsql) - -#ifdef COMPILE_DL_FBSQL -ZEND_GET_MODULE(fbsql) -#endif - -#define CHECK_LINK(link) { \ - if (link==-1) { \ - if (FB_SQL_G(generateWarnings)) \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); \ - RETURN_FALSE; \ - } \ -} - -static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBResult* result = (PHPFBResult *)rsrc->ptr; - - if (result) - { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - if (result->list) fbcplRelease(result->list); - if (result->array) fbaRelease(result->array); - if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData); - efree(result); - } -} - - -static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - efree(link); - FB_SQL_G(linkCount)--; - } -} - -static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - free(link); - FB_SQL_G(linkCount)--; - FB_SQL_G(persistentCount)--; - } -} - -static void php_fbsql_set_default_link(int id TSRMLS_DC) -{ - if (FB_SQL_G(linkIndex)!=-1) { - zend_list_delete(FB_SQL_G(linkIndex)); - } - FB_SQL_G(linkIndex) = id; - zend_list_addref(id); -} - -static int php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (FB_SQL_G(linkIndex)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return FB_SQL_G(linkIndex); -} - - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size); - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allowPersistent, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateBool, generateWarnings, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateBool, autoCommit, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, maxPersistent, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateLong, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateLong, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_results", "128", PHP_INI_SYSTEM, OnUpdateLong, maxResults, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.batchsize", "1000", PHP_INI_ALL, OnUpdateLong, batchSize, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY ("fbsql.default_host", NULL, PHP_INI_SYSTEM, OnUpdateString, hostName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_user", "_SYSTEM", PHP_INI_SYSTEM, OnUpdateString, userName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_password", "", PHP_INI_SYSTEM, OnUpdateString, userPassword, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database", "", PHP_INI_SYSTEM, OnUpdateString, databaseName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database_password", "", PHP_INI_SYSTEM, OnUpdateString, databasePassword, zend_fbsql_globals, fbsql_globals) -PHP_INI_END() -/* }}} */ - -static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals) -{ - fbsql_globals->persistentCount = 0; - - if (fbsql_globals->hostName==NULL) - { - char name[256]; - gethostname(name, sizeof(name)); - name[sizeof(name)-1] = 0; - fbsql_globals->hostName = strdup(name); - } - - fbsql_globals->persistentCount = 0; - fbsql_globals->linkCount = 0; -} - -PHP_MINIT_FUNCTION(fbsql) -{ - ZEND_INIT_MODULE_GLOBALS(fbsql, php_fbsql_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - fbcInitialize(); - fbcehSetMultiThreaded(True); - le_result = zend_register_list_destructors_ex(phpfbReleaseResult, NULL, "fbsql result", module_number); - le_link = zend_register_list_destructors_ex(phpfbReleaseLink, NULL, "fbsql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, phpfbReleasePLink, "fbsql plink", module_number); - Z_TYPE(fbsql_module_entry) = type; - - REGISTER_LONG_CONSTANT("FBSQL_ASSOC", FBSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NUM", FBSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_BOTH", FBSQL_BOTH, CONST_CS | CONST_PERSISTENT); - - /* Register Transaction constants */ - REGISTER_LONG_CONSTANT("FBSQL_LOCK_DEFERRED", FBSQL_LOCK_DEFERRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_OPTIMISTIC", FBSQL_LOCK_OPTIMISTIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_PESSIMISTIC", FBSQL_LOCK_PESSIMISTIC, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_UNCOMMITTED", FBSQL_ISO_READ_UNCOMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_COMMITTED", FBSQL_ISO_READ_COMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_REPEATABLE_READ", FBSQL_ISO_REPEATABLE_READ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_SERIALIZABLE", FBSQL_ISO_SERIALIZABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_VERSIONED", FBSQL_ISO_VERSIONED, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_UTF8", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO8859_1", FBC_ISO8859_1, CONST_CS | CONST_PERSISTENT); - - /* Register Status constants */ - REGISTER_LONG_CONSTANT("FBSQL_UNKNOWN", FBUnknownStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPED", FBStopped, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STARTING", FBStarting, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_RUNNING", FBRunning, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPING", FBStopping, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NOEXEC", FBNoExec, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_LOB_DIRECT", FBSQL_LOB_DIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOB_HANDLE", FBSQL_LOB_HANDLE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(fbsql) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(fbsql) -{ - FB_SQL_G(linkIndex) = -1; - FB_SQL_G(linkCount) = FB_SQL_G(persistentCount); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(fbsql) -{ - return SUCCESS; -} - -PHP_MINFO_FUNCTION(fbsql) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "FrontBase support", "enabled"); - - php_info_print_table_row(2, "Client API version", "2.24"); - - if (FB_SQL_G(allowPersistent)) - { - snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(persistentCount)); - php_info_print_table_row(2, "Active Persistent Links", buf); - } - - snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(linkCount)); - php_info_print_table_row(2, "Active Links", buf); - -/* - sprintf(buf, "%ld", FB_SQL_G(resultCount)); - php_info_print_table_row(2, "Active Results", buf); -*/ - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - PHPFBLink* phpLink; - list_entry *lep; - char name[1024]; - char *hostName = NULL, *userName = NULL, *userPassword = NULL; - int argc = ZEND_NUM_ARGS(), create_new = 0; - zval **argv[3]; - - if ((argc < 0) || (argc > 3)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0], &argv[1], &argv[2])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_string_ex(argv[0]); - hostName = Z_STRVAL_PP(argv[0]); - } - if (argc >= 2) - { - convert_to_string_ex(argv[1]); - userName = Z_STRVAL_PP(argv[1]); - } - if (argc == 3) - { - convert_to_string_ex(argv[2]); - userPassword = Z_STRVAL_PP(argv[2]); - } - - if (hostName == NULL) hostName = FB_SQL_G(hostName); - if (userName == NULL) userName = FB_SQL_G(userName); - if (userPassword == NULL) userPassword = FB_SQL_G(userPassword); - - if (snprintf(name, sizeof(name), "fbsql_%s_%s_%s", hostName, userName, userPassword) < 0) { - RETURN_FALSE; - } - - if (!FB_SQL_G(allowPersistent)) { - persistent=0; - } - if (persistent) { - if (zend_hash_find(&EG(persistent_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - phpLink = (PHPFBLink*)lep->ptr; - } - else { - list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if ((FB_SQL_G(maxPersistent) != -1 && FB_SQL_G(persistentCount) == FB_SQL_G(maxPersistent))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase persistent link limit %d exceeded", FB_SQL_G(maxPersistent)); - RETURN_FALSE; - } - - phpLink = malloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = NULL; - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - - le.ptr = phpLink; - Z_TYPE(le) = le_plink; - if (zend_hash_update(&EG(persistent_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - free(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - FB_SQL_G(persistentCount)++; - } - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_plink); - } - else - { - list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if (zend_hash_find(&EG(regular_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - int type, link; - void *ptr; - - link = (int) lep->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = link; - php_fbsql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - return; - } else { - zend_hash_del(&EG(regular_list), name, strlen(name) + 1); - } - phpLink = (PHPFBLink*)lep->ptr; - } - - phpLink = emalloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = NULL; - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_link); - - le.ptr = (void *)Z_LVAL_P(return_value); - Z_TYPE(le) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - efree(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - } - php_fbsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); -} - -int phpfbFetchRow(PHPFBResult* result, unsigned int row) -{ - if (result->rowHandler == NULL) - { - void *rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (rawData == NULL) { - result->rowCount = 0; - } - else - result->rowHandler = fbcrhInitWith(rawData, result->metaData); - } - for (;;) - { - void *rawData; - if (row >= result->rowCount && result->rowCount != 0x7fffffff) return 0; - if (fbcrhRowCount(result->rowHandler) > (unsigned int)row) return 1; - rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (!fbcrhAddBatch(result->rowHandler, rawData)) result->rowCount = fbcrhRowCount(result->rowHandler); - } -} - - -/* {{{ proto resource fbsql_connect([string hostname [, string username [, string password]]]) - Create a connection to a database server */ -PHP_FUNCTION(fbsql_connect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource fbsql_pconnect([string hostname [, string username [, string password]]]) - Create a persistant connection to a database server */ -PHP_FUNCTION(fbsql_pconnect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_close([resource link_identifier]) - Close a connection to a database server */ -PHP_FUNCTION(fbsql_close) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id, i, nument, type; - void *ptr; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - nument = zend_hash_next_free_element(&EG(regular_list)); - for (i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - PHPFBResult *result; - - result = (PHPFBResult *)ptr; - if (result->link == phpLink) { - zend_list_delete(i); - } - } - } - - if (id==-1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(fbsql_link_index)); - } - - if (id!=-1 - || (fbsql_link_index && Z_RESVAL_PP(fbsql_link_index)==FB_SQL_G(linkIndex))) { - zend_list_delete(FB_SQL_G(linkIndex)); - FB_SQL_G(linkIndex) = -1; - } - - RETURN_TRUE; -} -/* }}} */ - -static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) -{ - unsigned port; - FBCDatabaseConnection* c; - FBCMetaData* md; - - if (!link->databaseName || strcmp(link->databaseName, databaseName)) - { - port = atoi(databaseName); - if (port>0 && port<65535) - c = fbcdcConnectToDatabaseUsingPort(link->hostName, port, link->databasePassword); - else - c = fbcdcConnectToDatabase(databaseName, link->hostName, link->databasePassword); - if (c == NULL) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", fbcdcClassErrorMessage()); - return 0; - } - md = fbcdcCreateSession(c, "PHP", link->userName, link->userPassword, link->userName); - if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - fbcmdRelease(md); - fbcdcClose(c); - fbcdcRelease(c); - return 0; - } - fbcmdRelease(md); - - if (c) - { - if (link->autoCommit) - md = fbcdcExecuteDirectSQL(c, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(c, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - fbcdcSetOutputCharacterSet(c, FBC_ISO8859_1); - fbcdcSetInputCharacterSet(c, FBC_ISO8859_1); - - if (link->connection) - { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - link->connection = c; - if (link->databaseName) free(link->databaseName); - link->databaseName = strdup(databaseName); - } - return 1; -} - -void phpfbestrdup(const char * s, int* length, char** value) -{ - int l = s?strlen(s):0; - if (value) - { - char* r = emalloc(l+1); - if (s) - strcpy(r, s); - else - r[0] = 0; - *value = r; - } - *length = l; -} - -/* {{{ proto void fbsql_set_transaction(resource link_identifier, int locking, int isolation) - Sets the transaction locking and isolation */ -PHP_FUNCTION(fbsql_set_transaction) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **Locking = NULL, **Isolation = NULL; - char strSQL[1024]; - char *strLocking[] = {"DEFERRED", "OPTIMISTIC", "PESSIMISTIC"}; - char *strIsolation[] = {"READ UNCOMMITTED", "READ NCOMMITTED", "REPEATABLE READ", "SERIALIZABLE", "VERSIONED"}; - - switch (ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &fbsql_link_index, &Locking, &Isolation)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (Z_LVAL_PP(Locking) < 0 || Z_LVAL_PP(Locking) > 2) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locking type."); - RETURN_FALSE; - } - if (Z_LVAL_PP(Isolation) < 0 || Z_LVAL_PP(Isolation) > 4) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid isolation type."); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (snprintf(strSQL, sizeof(strSQL) , "SET TRANSACTION LOCKING %s, ISOLATION %s;", strLocking[Z_LVAL_PP(Locking)], strIsolation[Z_LVAL_PP(Isolation)]) < 0) { - RETURN_FALSE; - } - - md = fbcdcExecuteDirectSQL(phpLink->connection, strSQL); - fbcmdRelease(md); -} -/* }}} */ - -/* {{{ proto bool fbsql_autocommit(resource link_identifier [, bool OnOff]) - Turns on auto-commit */ -PHP_FUNCTION(fbsql_autocommit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **onoff = NULL; - zend_bool OnOff; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &onoff)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (onoff) - { - convert_to_boolean_ex(onoff); - OnOff = Z_BVAL_PP(onoff); - phpLink->autoCommit = OnOff; - if (OnOff) - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - RETURN_BOOL(phpLink->autoCommit); -} -/* }}} */ - -/* {{{ proto bool fbsql_commit([resource link_identifier]) - Commit the transaction */ -PHP_FUNCTION(fbsql_commit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcCommit(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool fbsql_rollback([resource link_identifier]) - Rollback all statments since last commit */ -PHP_FUNCTION(fbsql_rollback) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcRollback(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - - -static void php_fbsql_create_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - FBCBlobHandle *lobHandle; - zval **lob_data, **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_data)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_data, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_data); - switch (lob_type) { - case 0 : /* BLOB */ - lobHandle = fbcdcWriteBLOB(phpLink->connection, Z_STRVAL_PP(lob_data), Z_STRLEN_PP(lob_data)); - break; - case 1 : /* CLOB */ - lobHandle = fbcdcWriteCLOB(phpLink->connection, Z_STRVAL_PP(lob_data)); - break; - } - if (lobHandle) { - RETURN_STRING(fbcbhDescription(lobHandle), 1); - fbcbhRelease(lobHandle); - } - else - RETURN_FALSE; -} - -/* {{{ proto string fbsql_create_blob(string blob_data [, resource link_identifier]) - Create a BLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_blob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_create_clob(string clob_data [, resource link_identifier]) - Create a CLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_clob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_set_lob_mode(resource result, int lob_mode) - Sets the mode for how LOB data re retreived (actual data or a handle) */ -PHP_FUNCTION(fbsql_set_lob_mode) -{ - - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **lob_mode = NULL; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &lob_mode)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(lob_mode); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->lobMode = Z_LVAL_PP(lob_mode); - - RETURN_TRUE; -} -/* }}} */ - -static void php_fbsql_read_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - long length = 0; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - length = fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle)); - if (lob_type == 0) - value = estrndup((char *)fbcdcReadBLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - else - value = estrndup((char *)fbcdcReadCLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - if (value) { - RETURN_STRINGL(value, length, 0); - } - else { - RETURN_FALSE; - } -} - -/* {{{ proto string fbsql_read_blob(string blob_handle [, resource link_identifier]) - Read the BLOB data identified by blob_handle */ -PHP_FUNCTION(fbsql_read_blob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_read_clob(string clob_handle [, resource link_identifier]) - Read the CLOB data identified by clob_handle */ -PHP_FUNCTION(fbsql_read_clob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -static void php_fbsql_lob_size(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - RETURN_LONG(fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle))); -} - -/* {{{ proto int fbsql_blob_size(string blob_handle [, resource link_identifier]) - Get the size of a BLOB identified by blob_handle */ -PHP_FUNCTION(fbsql_blob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int fbsql_clob_size(string clob_handle [, resource link_identifier]) - Get the size of a CLOB identified by clob_handle */ -PHP_FUNCTION(fbsql_clob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_hostname(resource link_identifier [, string host_name]) - Get or set the host name used with a connection */ -PHP_FUNCTION(fbsql_hostname) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **host_name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &host_name)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (host_name) - { - convert_to_string_ex(host_name); - if (phpLink->hostName) free(phpLink->hostName); - phpLink->hostName = strdup(Z_STRVAL_PP(host_name)); - } - RETURN_STRING(phpLink->hostName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_database(resource link_identifier [, string database]) - Get or set the database name used with a connection */ -PHP_FUNCTION(fbsql_database) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &dbname)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (dbname) - { - convert_to_string_ex(dbname); - if (phpLink->databaseName) free(phpLink->databaseName); - phpLink->databaseName = strdup(Z_STRVAL_PP(dbname)); - } - if (phpLink->databaseName) { - RETURN_STRING(phpLink->databaseName, 1); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_database_password(resource link_identifier [, string database_password]) - Get or set the databsae password used with a connection */ -PHP_FUNCTION(fbsql_database_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **db_password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &db_password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (db_password) - { - convert_to_string_ex(db_password); - if (phpLink->databasePassword) free(phpLink->databasePassword); - phpLink->databasePassword = strdup(Z_STRVAL_PP(db_password)); - } - RETURN_STRING(phpLink->databasePassword, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_username(resource link_identifier [, string username]) - Get or set the host user used with a connection */ -PHP_FUNCTION(fbsql_username) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **username = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &username)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (username) - { - convert_to_string_ex(username); - if (phpLink->userName) free(phpLink->userName); - phpLink->userName = strdup(Z_STRVAL_PP(username)); - } - RETURN_STRING(phpLink->userName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_password(resource link_identifier [, string password]) - Get or set the user password used with a connection */ -PHP_FUNCTION(fbsql_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (password) - { - convert_to_string_ex(password); - if (phpLink->userPassword) free(phpLink->userPassword); - phpLink->userPassword = strdup(Z_STRVAL_PP(password)); - } - RETURN_STRING(phpLink->userPassword, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_set_password(resource link_identifier, string user, string password, string old_password) - Change the password for a given user */ -PHP_FUNCTION(fbsql_set_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **user, **password, **old_password; - char *digest_password, *digest_old_password; - FBCMetaData *md; - - switch (ZEND_NUM_ARGS()) { - case 4: - if (zend_get_parameters_ex(4, &fbsql_link_index, &user, &password, &old_password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(user); - convert_to_string_ex(password); - convert_to_string_ex(old_password); - - digest_password = DigestPassword(Z_STRVAL_PP(user), Z_STRVAL_PP(password)); - digest_old_password = DigestPassword(Z_STRVAL_PP(user), Z_STRVAL_PP(old_password)); - - md = fbcdcSetPasswordForUser(phpLink->connection, Z_STRVAL_PP(user), digest_password, digest_old_password); - if (mdOk(phpLink, md, "Change password")) { - ZVAL_BOOL(return_value, 1); - } - else { - ZVAL_BOOL(return_value, 0); - } - fbcmdRelease(md); - if (digest_old_password) efree(digest_old_password); - if (digest_password) efree(digest_password); -} -/* }}} */ - - -/* {{{ proto bool fbsql_select_db([string database_name [, resource link_identifier]]) - Select the database to open */ -PHP_FUNCTION(fbsql_select_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname; - int id; - char* name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 0: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &dbname)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - break; - case 2: - if (zend_get_parameters_ex(2, &dbname, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (!php_fbsql_select_db(name, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void fbsql_set_characterset(resource link_identifier, long charcterset [, long in_out_both]]) - Change input/output character set */ -PHP_FUNCTION(fbsql_set_characterset) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index, **zcharset, **zin_out; - int id = -1; - int charset = -1, in_out_both = 3; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &zcharset)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &fbsql_link_index, &zcharset, &zin_out)==FAILURE) { - RETURN_FALSE; - } - in_out_both = Z_LVAL_PP(zin_out); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - charset = Z_LVAL_PP(zcharset); - - if (in_out_both & 1) { - fbcdcSetInputCharacterSet(phpLink->connection, charset); - } - if (in_out_both & 2) { - fbcdcSetOutputCharacterSet(phpLink->connection, charset); - } -} - -/* {{{ proto int fbsql_change_user(string user, string password [, string database [, resource link_identifier]]) - Change the user for a session */ -PHP_FUNCTION(fbsql_change_user) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **user, **password, **database; - int id; - char *name = NULL, *userName, *userPassword; - char buffer[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &user, &password)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(3, &user, &password, &database)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - break; - case 4: - if (zend_get_parameters_ex(4, &user, &password, &database, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(user); - userName = Z_STRVAL_PP(user); - - convert_to_string_ex(password); - userPassword = Z_STRVAL_PP(password); - - if (snprintf(buffer, sizeof(buffer), "SET AUTHORIZATION %s;", userName) < 0) { - RETURN_FALSE; - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink, 0); - if (Z_LVAL_P(return_value)) - { - free(phpLink->userName); - phpLink->userName = strdup(userName); - } -} -/* }}} */ - -/* {{{ proto bool fbsql_create_db(string database_name [, resource link_identifier]) - Create a new database on the server */ -PHP_FUNCTION(fbsql_create_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **database_options = NULL; - int id; - int i, status; - char *databaseName, *databaseOptions = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_string_ex(database_options); - databaseOptions = Z_STRVAL_PP(database_options); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBUnknownStatus) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s created -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_drop_db(string database_name [, resource link_identifier]) - Drop a database on the server */ -PHP_FUNCTION(fbsql_drop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBStopped) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBUnknownStatus) txt = "nonexisting"; - else if (status == FBStarting ) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping ) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s, database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (!fbcehDeleteDatabaseNamed(phpLink->execHandler, databaseName)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBUnknownStatus) break; - } - if (status != FBUnknownStatus) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s dropped -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool fbsql_start_db(string database_name [, resource link_identifier [, string database_options]]) - Start a database on the server */ -PHP_FUNCTION(fbsql_start_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **database_options; - int id; - int i, status; - char *databaseName, *databaseOptions = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_string_ex(database_options); - databaseOptions = Z_STRVAL_PP(database_options); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if ((status != FBStopped) && (status != FBRunning) && (status != FBStarting)) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s, as database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (status == FBStopped) - { - int dbstarted; - if (databaseOptions != NULL) - { - dbstarted = fbcehStartDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions); - } - else - { - dbstarted = fbcehStartDatabaseNamed(phpLink->execHandler, databaseName); - } - if (!dbstarted) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - } - - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s started -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fbsql_stop_db(string database_name [, resource link_identifier]) - Stop a database on the server */ -PHP_FUNCTION(fbsql_stop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - -/* printf("Stop db %x\n", phpDatabase->connection); */ - if (!fbcdcStopDatabase(phpLink->connection)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot stop database %s@%s", databaseName, phpLink->hostName); - RETURN_FALSE; - } - - for (i=0; i < 20; i++) - { - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBStopped) break; -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_db_status(string database_name [, resource link_identifier]) - Gets the status (Stopped, Starting, Running, Stopping) for a given database */ -PHP_FUNCTION(fbsql_db_status) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - if (phpLink->execHandler) { - RETURN_LONG(fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName)); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ mdOk - */ -int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql) -{ - FBCDatabaseConnection* c = link->connection; - int result = 1; - TSRMLS_FETCH(); - - link->errorNo = 0; - if (link->errorText) - { - free(link->errorText); - link->errorText = NULL; - } - if (md == NULL) - { - link->errorNo = 1; - link->errorText = strdup("Connection to database server was lost"); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", link->errorText); - result = 0; - } - else if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in statement: '%s' %s", sql, emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - result = 0; - } - else if (fbcmdWarningsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Warning in statement: '%s' %s", sql, emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - result = 1; - } - return result; -} -/* }}} */ - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size) -{ - PHPFBResult* result = NULL; - FBCMetaData* md, *meta; - char* tp; - char* fh = NULL; - unsigned int sR = 1, cR = 0; - - meta = fbcdcExecuteDirectSQL(link->connection, sql); - if (!mdOk(link, meta, sql)) - { - fbcmdRelease(meta); - ZVAL_BOOL(return_value, 0) - } - else { - if (fbcmdHasMetaDataArray(meta)) { - sR = fbcmdMetaDataArrayCount(meta); - md = (FBCMetaData*)fbcmdMetaDataAtIndex(meta, cR); - } - else - md = meta; - - tp = fbcmdStatementType(md); - if (tp == NULL) { - fbcmdRelease(meta); - ZVAL_BOOL(return_value, 1) - } - else if ((tp[0] == 'C') || (tp[0] == 'R')) - { - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - else if ((fh = fbcmdFetchHandle(md)) || tp[0] == 'E' || (tp[0] == 'U' && fh)) - { - result = (PHPFBResult *)emalloc(sizeof(PHPFBResult)); - result->link = link; - result->rowHandler = NULL; - result->fetchHandle = NULL; - result->ResultmetaData = meta; - result->metaData = md; - result->batchSize = batch_size > 0 ? batch_size : FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = 0; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - result->selectResults = sR; - result->currentResult = cR; - result->lobMode = FBSQL_LOB_DIRECT; - - if (tp[0] != 'E') - { - result->columnCount = fbcmdColumnCount(md); - result->fetchHandle = fh; - } - else - { - char* r = fbcmdMessage(result->metaData); - fbcrhConvertToOutputCharSet(fbcdcOutputCharacterSet(link->connection), (unsigned char *)r); - if ((result->list = fbcplParse(r))) - { - result->rowCount = fbcplCount(result->list); - result->columnCount = 7; - } - } - ZEND_REGISTER_RESOURCE(return_value, result, le_result); - } - else if (tp[0] == 'I' || tp[0] == 'U') - { - if (tp[0] == 'I') link->insert_id = fbcmdRowIndex(md); - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - else if(tp[0] == 'A' || tp[0] == 'D') - { - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - if (link) link->affectedRows = fbcmdRowCount(md); - } -} - -/* {{{ proto resource fbsql_query(string query [, resource link_identifier [, long batch_size]]) - Send one or more SQL statements to the server and execute them */ -PHP_FUNCTION(fbsql_query) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **query, **batch_size; - int id, bs = 0; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &query, &fbsql_link_index, &batch_size)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_long_ex(batch_size); - bs = Z_LVAL_PP(batch_size); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, bs); -} -/* }}} */ - -/* {{{ proto resource fbsql_db_query(string database_name, string query [, resource link_identifier]) - Send one or more SQL statements to a specified database on the server */ -PHP_FUNCTION(fbsql_db_query) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname, **query; - int id; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &dbname, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &dbname, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - convert_to_string_ex(dbname); - - if (php_fbsql_select_db(Z_STRVAL_PP(dbname), phpLink TSRMLS_CC)) { - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource fbsql_list_dbs([resource link_identifier]) - Retreive a list of all databases on the server */ -PHP_FUNCTION(fbsql_list_dbs) -{ - PHPFBResult* phpResult; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - phpResult = emalloc(sizeof(PHPFBResult)); - phpResult->link = phpLink; - phpResult->fetchHandle = NULL; - phpResult->rowHandler = NULL; - phpResult->ResultmetaData = NULL; - phpResult->metaData = NULL; - phpResult->batchSize = FB_SQL_G(batchSize); - phpResult->columnCount = 1; - phpResult->rowIndex = 0; - phpResult->columnIndex = 0; - phpResult->row = NULL; - phpResult->array = fbcehAvailableDatabases(phpLink->execHandler); - phpResult->rowCount = fbaCount(phpResult->array); - phpResult->list = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpResult, le_result); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_tables(string database [, int link_identifier]) - Retreive a list of all tables from the specifoied database */ -PHP_FUNCTION(fbsql_list_tables) -{ - char* sql = "select t0.\"table_name\"from information_schema.tables t0, information_schema.SCHEMATA t1 where t0.schema_pk = t1.schema_pk and t1.\"schema_name\" = current_schema order by \"table_name\";"; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (databaseName == NULL) { - php_fbsql_select_db(FB_SQL_G(databaseName), phpLink TSRMLS_CC); - } else { - php_fbsql_select_db(databaseName, phpLink TSRMLS_CC); - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_fields(string database_name, string table_name [, resource link_identifier]) - Retrieve a list of all fields for the specified database.table */ -PHP_FUNCTION(fbsql_list_fields) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **table_name; - int id; - char *databaseName, *tableName; - char sql[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &database_name, &table_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &table_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - convert_to_string_ex(table_name); - tableName = Z_STRVAL_PP(table_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - - if (snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE 1=0;", tableName) < 0) { - RETURN_FALSE; - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_error([resource link_identifier]) - Returns the last error string */ -PHP_FUNCTION(fbsql_error) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->errorText == NULL) { - RETURN_FALSE; - } - else { - RETURN_STRING(phpLink->errorText, 1); - } -} -/* }}} */ - -/* {{{ proto int fbsql_errno([resource link_identifier]) - Returns the last error code */ -PHP_FUNCTION(fbsql_errno) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->errorNo); -} -/* }}} */ - -/* {{{ proto bool fbsql_warnings([int flag]) - Enable or disable FrontBase warnings */ -PHP_FUNCTION(fbsql_warnings) -{ - int argc = ZEND_NUM_ARGS(); - zval **argv[1]; - - if ((argc < 0) || (argc > 1)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_long_ex(argv[0]); - FB_SQL_G(generateWarnings) = Z_LVAL_PP(argv[0]) != 0; - } - RETURN_BOOL(FB_SQL_G(generateWarnings)); -} -/* }}} */ - -/* {{{ proto int fbsql_affected_rows([resource link_identifier]) - Get the number of rows affected by the last statement */ -PHP_FUNCTION(fbsql_affected_rows) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->affectedRows); -} -/* }}} */ - -/* {{{ proto int fbsql_affected_rows([resource link_identifier]) - Get the number of rows affected by the last statement */ -PHP_FUNCTION(fbsql_rows_fetched) -{ - PHPFBResult* phpResult = NULL; - zval **result = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(phpResult, PHPFBResult *, result, id, "FrontBase-Result", le_result); - - if (!phpResult->rowHandler) { - RETURN_FALSE; - } - else { - RETURN_LONG(fbcrhRowCount(phpResult->rowHandler)); - } -} -/* }}} */ - -/* {{{ proto int fbsql_insert_id([resource link_identifier]) - Get the internal index for the last insert statement */ -PHP_FUNCTION(fbsql_insert_id) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->insert_id); -} -/* }}} */ - -/* {{{ phpSizeOfInt - */ -int phpSizeOfInt (int i) -{ - int s = 1; - if (i < 0) - { - s++; - i = -i; - } - while ((i = i / 10)) s++; - return s; -} -/* }}} */ - -void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* length, char** value TSRMLS_DC) -{ - FBCMetaData* md = result->metaData; - const FBCDatatypeMetaData* dtmd = fbcmdDatatypeMetaDataAtIndex(md, column); - unsigned dtc = fbcdmdDatatypeCode(dtmd); - switch (dtc) - { - case FB_Boolean: - { - unsigned char v = *((unsigned char*)(data)); - if (v == 255) - phpfbestrdup("Unknown", length, value); - else if (v == 0) - phpfbestrdup("False", length, value); - else - phpfbestrdup("True", length, value); - } - break; - - case FB_PrimaryKey: - case FB_Integer: - { - int v = *((int*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; -#ifdef FB_TinyInteger - case FB_TinyInteger: - { - short int v = *((FBTinyInteger*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; -#endif -#ifdef FB_LongInteger - case FB_LongInteger: - { - FBLongInteger v = *((FBLongInteger*)data); - char b[128]; -#ifdef PHP_WIN32 - snprintf(b, sizeof(b), "%I64i", v); -#else - snprintf(b, sizeof(b), "%ll", v); -#endif - phpfbestrdup(b, length, value); - } - break; -#endif - case FB_SmallInteger: - { - short v = *((short*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Float: - case FB_Real: - case FB_Double: - case FB_Numeric: - case FB_Decimal: - { - double v = *((double*)data); - char b[128]; - snprintf(b, sizeof(b), "%f", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Character: - case FB_VCharacter: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_Bit: - case FB_VBit: - { - const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column); - struct bitValue - { - unsigned int nBytes; - unsigned char* bytes; - }; - struct bitValue* ptr = data; - unsigned nBits = ptr->nBytes * 8; - - if (dtc == FB_Bit) nBits = fbcdmdLength(fbccmdDatatype(clmd)); - if (nBits %8 == 0) - { - unsigned i; - unsigned int l = nBits / 8; - *length = l*2+3+1; - if (value) - { - char* r = safe_emalloc(l, 2, 4); - r[0] = 'X'; - r[1] = '\''; - for (i = 0; i < nBits / 8; i++) - { - char c[4]; - sprintf(c, "%02x", ptr->bytes[i]); - r[i*2+2] = c[0]; - r[i*2+3] = c[1]; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - else - { - unsigned i; - unsigned int l = nBits; - *length = l*2+3+1; - if (value) - { - char* r = safe_emalloc(l, 2, 4); - r[0] = 'B'; - r[1] = '\''; - for (i = 0; i < nBits; i++) - { - int bit = 0; - if (i/8 < ptr->nBytes) bit = ptr->bytes[i/8] & (1<<(7-(i%8))); - r[i*2+2] = bit?'1':'0'; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - } - break; - - case FB_Date: - case FB_Time: - case FB_TimeTZ: - case FB_Timestamp: - case FB_TimestampTZ: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_YearMonth: - { - char b[128]; - int v = *((unsigned int*)data); - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_DayTime: - { - char b[128]; - double seconds = *((double*)data); - snprintf(b, sizeof(b), "%f", seconds); - phpfbestrdup(b, length, value); - } - break; - - case FB_CLOB: - case FB_BLOB: - { - if (*((unsigned char*) data) == '\1') - { /* Direct */ - *length = ((FBCBlobDirect *)data)->blobSize; - *value = estrndup((char *)((FBCBlobDirect *)data)->blobData, *length); - } - else - { - FBCBlobHandle *lobHandle; - unsigned char *bytes = (unsigned char *)data; - char *handle = (char *)(&bytes[1]); - lobHandle = fbcbhInitWithHandle(handle); - *length = fbcbhBlobSize(lobHandle); - - if (result->lobMode == FBSQL_LOB_HANDLE) { - phpfbestrdup(fbcbhDescription(lobHandle), length, value); - } - else { - if (dtc == FB_BLOB) - *value = estrndup((char *)fbcdcReadBLOB(result->link->connection, lobHandle), *length); - else - *value = estrndup((char *)fbcdcReadCLOB(result->link->connection, lobHandle), *length); - } - fbcbhRelease(lobHandle); - } - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unimplemented type (%d)", dtc); - break; - } -} - -/* {{{ phpfbSqlResult - */ -void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIndex, int columnIndex) -{ - void** row; - if (result->list) - { - FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list, "COLUMNS"); - FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns, result->rowIndex); - if (columnIndex == 0) - { /* Name */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "NAME"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 2) - { /* Length */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "WIDTH"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 1) - { /* Type */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "DATATYPE"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 3) - { /* Flags */ - RETURN_STRING("", 1); - } - else - { - RETURN_STRING("", 1); - } - } - else if (result->array) - { /* Special case for get dbs */ - RETURN_STRING(fbaObjectAtIndex(result->array, rowIndex), 1); - } - else if (!phpfbFetchRow(result, rowIndex)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such row %d in result set %d", rowIndex, rowIndex); - RETURN_FALSE; - } - else if (columnIndex >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such column %d in result set %d", columnIndex, rowIndex); - RETURN_FALSE; - } - else - { - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - else if (row[columnIndex]) - { - phpfbColumnAsString(result, columnIndex, row[columnIndex], &Z_STRLEN_P(return_value), &Z_STRVAL_P(return_value) TSRMLS_CC); - Z_TYPE_P(return_value) = IS_STRING; - } - else - { - RETURN_NULL(); - } - } -} -/* }}} */ - -/* {{{ proto mixed fbsql_result(int result [, int row [, mixed field]]) - ??? */ -PHP_FUNCTION(fbsql_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row = NULL, **field = NULL; - int rowIndex; - int columnIndex; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &fbsql_result_index, &row, &field)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - rowIndex = result->rowIndex; - if (row) - { - convert_to_long_ex(row); - rowIndex = Z_LVAL_PP(row); - } - - columnIndex = result->columnIndex; - if (field) - { - if ((Z_TYPE_PP(field) == IS_STRING) && (result->metaData)) - { - for (columnIndex =0; columnIndex < result->columnCount; columnIndex ++) - { - const FBCColumnMetaData* cmd = fbcmdColumnMetaDataAtIndex(result->metaData, columnIndex); - const char* lbl = fbccmdLabelName(cmd); - if (strcmp((char*)lbl, Z_STRVAL_PP(field)) == 0) break; - } - if (columnIndex == result->columnCount) RETURN_FALSE; - } - else - { - convert_to_long_ex(field); - columnIndex = Z_LVAL_PP(field); - if (columnIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal column index - %d", columnIndex); - RETURN_FALSE; - } - } - } - - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, rowIndex, columnIndex); - - result->columnIndex++; - if (result->columnIndex == result->columnCount) - { - result->rowIndex++; - result->columnIndex = 0; - } -} -/* }}} */ - -/* {{{ proto bool fbsql_next_result(int result) - Switch to the next result if multiple results are available */ -PHP_FUNCTION(fbsql_next_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->currentResult++; - if (result->currentResult < result->selectResults) { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - result->metaData = (FBCMetaData*)fbcmdMetaDataAtIndex(result->ResultmetaData, result->currentResult); - result->fetchHandle = fbcmdFetchHandle(result->metaData); - result->rowHandler = NULL; - result->batchSize = FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = fbcmdColumnCount(result->metaData);; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - if (result->link) - result->link->affectedRows = fbcmdRowCount(result->metaData); - - RETURN_TRUE; - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int fbsql_num_rows(int result) - Get number of rows */ -PHP_FUNCTION(fbsql_num_rows) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int rowCount; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->array) - rowCount = result->rowCount; - else { - rowCount = fbcmdRowCount(result->metaData); - if (rowCount == -1) - { - phpfbFetchRow(result, 0x7fffffff); - rowCount = result->rowCount; - } - } - RETURN_LONG(rowCount); -} -/* }}} */ - -/* {{{ proto int fbsql_num_fields(int result) - Get number of fields in the result set */ -PHP_FUNCTION(fbsql_num_fields) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - RETURN_LONG(result->columnCount); -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_row(resource result) - Fetch a row of data. Returns an indexed array */ -PHP_FUNCTION(fbsql_fetch_row) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM, 1); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_assoc(resource result) - Detch a row of data. Returns an assoc array */ -PHP_FUNCTION(fbsql_fetch_assoc) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 1); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_object(resource result [, int result_type]) - Fetch a row of data. Returns an object */ -PHP_FUNCTION(fbsql_fetch_object) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 2); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_array(resource result [, int result_type]) - Fetches a result row as an array (associative, numeric or both)*/ -PHP_FUNCTION(fbsql_fetch_array) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH, 2); -} -/* }}} */ - -static void _parse_list(zval** return_value, FBCPList* list) -{ - int count = fbcplCount(list); - int i,j; - - for (i=0; i expected_args) { - WRONG_PARAM_COUNT; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &zresult_type)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zresult_type); - result_type = Z_LVAL_PP(zresult_type); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - rowIndex = result->rowIndex; - if (((result_type & FBSQL_NUM) != FBSQL_NUM) && ((result_type & FBSQL_ASSOC) != FBSQL_ASSOC)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH"); - RETURN_FALSE; - } - array_init(return_value); - if (result->fetchHandle == NULL) - { - if (result->array == NULL && result->list == NULL) - { - RETURN_FALSE; - } - if (result->rowIndex >= result->rowCount) - { - RETURN_FALSE; - } - if (result->list) { - char* key; - FBCPList* value; - - value = (FBCPList*)fbcplValueAtIndex(result->list, result->rowIndex); - key = (char*)fbcplKeyAtIndex(result->list, result->rowIndex); - - if (key && key[0] == 2) - key = NULL; - - if (fbcplIsDictionary(value)) { - zval *value_array; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - _parse_list(&value_array, value); - if (result_type & FBSQL_NUM || key == NULL) - { - add_index_zval(return_value, 0, value_array); - } - if (result_type & FBSQL_ASSOC && key != NULL) - { - add_assoc_zval(return_value, key, value_array); - } - } - else if (fbcplIsArray(value)) { - zval *value_array; - int valcount = fbcplCount(value); - int j; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - for (j=0; jarray, result->rowIndex)), 0); - } - if (result_type & FBSQL_ASSOC) - { - add_assoc_string(return_value, "Database", estrdup(fbaObjectAtIndex(result->array, result->rowIndex)), 0); - } - } - } - else { - if (result->rowCount == 0) { - RETURN_FALSE; - } - if (result->rowCount == 0x7fffffff) - { - if (!phpfbFetchRow(result, result->rowIndex)) { - RETURN_FALSE; - } - } - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - for (i=0; i < result->columnCount; i++) - { - if (row[i]) - { - char* value; - unsigned int length; - unsigned int c = 0; - phpfbColumnAsString(result, i, row[i], &length, &value TSRMLS_CC); - if (result_type & FBSQL_NUM) - { - add_index_stringl(return_value, i, value, length, c); - c = 1; - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_stringl(return_value, key, value, length, c); - } - } - else - { - if (result_type & FBSQL_NUM) - { - add_index_unset(return_value, i); - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_unset(return_value, key); - } - } - } - } - result->rowIndex++; - result->columnIndex = 0; -} - -/* {{{ proto bool fbsql_data_seek(int result, int row_number) - Move the internal row counter to the specified row_number */ -PHP_FUNCTION(fbsql_data_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row_number = NULL; - unsigned int rowIndex; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row_number)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - convert_to_long_ex(row_number); - rowIndex = Z_LVAL_PP(row_number); - - if (rowIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal row_index (%d)", rowIndex); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, rowIndex); - if (rowIndex > result->rowCount) RETURN_FALSE; - result->rowIndex = rowIndex; - result->columnIndex = 0; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_lengths(int result) - Returns an array of the lengths of each column in the result set */ -PHP_FUNCTION(fbsql_fetch_lengths) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int i; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->row == NULL) RETURN_FALSE; - array_init(return_value); - for (i=0; i < result->columnCount; i++) - { - unsigned length = 0; - if (result->row[i]) phpfbColumnAsString(result, i, result->row[i], &length, NULL TSRMLS_CC); - add_index_long(return_value, i, length); - } -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_field(int result [, int field_index]) - Get the field properties for a specified field_index */ -PHP_FUNCTION(fbsql_fetch_field) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - object_init(return_value); - - add_property_string(return_value, "name", (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_string(return_value, "table", (char*)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "max_length", fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - add_property_string(return_value, "type", (char*)fbcdmdDatatypeString(fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "not_null", !fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))); -/* Remember to add the rest */ -/* add_property_long(return_value, "primary_key", IS_PRI_KEY(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "multiple_key", (fbsql_field->flags&MULTIPLE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "unique_key", (fbsql_field->flags&UNIQUE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "numeric", IS_NUM(Z_TYPE_P(fbsql_field))?1:0); */ -/* add_property_long(return_value, "blob", IS_BLOB(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "unsigned", (fbsql_field->flags&UNSIGNED_FLAG?1:0)); */ -/* add_property_long(return_value, "zerofill", (fbsql_field->flags&ZEROFILL_FLAG?1:0)); */ -} -/* }}} */ - -/* {{{ proto bool fbsql_field_seek(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - - result->columnIndex = column; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fbsql_field_name(int result [, int field_index]) - Get the column name for a specified field_index */ -PHP_FUNCTION(fbsql_field_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 0); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - result->columnIndex = column; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_table(int result [, int field_index]) - Get the table name for a specified field_index */ -PHP_FUNCTION(fbsql_field_table) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - RETURN_STRING((char *)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); -} -/* }}} */ - -/* {{{ proto mixed fbsql_field_len(int result [, int field_index]) - Get the column length for a specified field_index */ -PHP_FUNCTION(fbsql_field_len) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 2); - } - else if (result->metaData) - { - RETURN_LONG(fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_type(int result [, int field_index]) - Get the field type for a specified field_index */ -PHP_FUNCTION(fbsql_field_type) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 1); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbcdmdDatatypeString (fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_flags(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_flags) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - char buf[512]; - int len; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - strcpy(buf, ""); - if (!fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))) { - strcat(buf, "not_null "); - } -#if 0 - if (IS_PRI_KEY(fbsql_field->flags)) { - strcat(buf, "primary_key "); - } - if (fbsql_field->flags&UNIQUE_KEY_FLAG) { - strcat(buf, "unique_key "); - } - if (fbsql_field->flags&MULTIPLE_KEY_FLAG) { - strcat(buf, "multiple_key "); - } - if (IS_BLOB(fbsql_field->flags)) { - strcat(buf, "blob "); - } - if (fbsql_field->flags&UNSIGNED_FLAG) { - strcat(buf, "unsigned "); - } - if (fbsql_field->flags&ZEROFILL_FLAG) { - strcat(buf, "zerofill "); - } - if (fbsql_field->flags&BINARY_FLAG) { - strcat(buf, "binary "); - } - if (fbsql_field->flags&ENUM_FLAG) { - strcat(buf, "enum "); - } - if (fbsql_field->flags&AUTO_INCREMENT_FLAG) { - strcat(buf, "auto_increment "); - } - if (fbsql_field->flags&TIMESTAMP_FLAG) { - strcat(buf, "timestamp "); - } -#endif - len = strlen(buf); - /* remove trailing space, if present */ - if (len && buf[len-1] == ' ') { - buf[len-1] = 0; - len--; - } - RETURN_STRING(buf, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_table_name(resource result, int index) - Retreive the table name for index after a call to fbsql_list_tables() */ -PHP_FUNCTION(fbsql_table_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **table_index; - unsigned index; - char* value; - unsigned int length; - void** row; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &table_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(table_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - index = Z_LVAL_PP(table_index); - if (index < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal index (%i)", index); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, index); - if (index > result->rowCount) RETURN_FALSE; - result->rowIndex = index; - result->columnIndex = 0; - - row = fbcrhRowAtIndex(result->rowHandler, index); - phpfbColumnAsString(result, 0, row[0], &length, &value TSRMLS_CC); - RETURN_STRINGL(value, length, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_free_result(resource result) - free the memory used to store a result */ -PHP_FUNCTION(fbsql_free_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - zend_list_delete(Z_LVAL_PP(fbsql_result_index)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_get_autostart_info([resource link_identifier]) - ??? */ -PHP_FUNCTION(fbsql_get_autostart_info) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - FBCAutoStartInfo* asInfo; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - if (phpLink->execHandler == NULL) { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No valid Exec handler available for this connection"); - RETURN_FALSE; - } - else { - array_init(return_value); - asInfo = fbcehGetAutoStartInfo(phpLink->execHandler); - if (asInfo != NULL) { - unsigned i; - - for (i=0; iinfoLines); i++) { - FBArray* infoLine = fbaObjectAtIndex(asInfo->infoLines, i); -/* - if (fbaCount(infoLine) == 2) { - fbaObjectAtIndex(infoLine, 0); - fbaObjectAtIndex(infoLine, 1); - } - else { -*/ - add_index_string(return_value, i, fbaObjectAtIndex(infoLine, 0), 1); -/* } - */ - - } - } - } -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fbsql/php_fbsql.h b/ext/fbsql/php_fbsql.h deleted file mode 100644 index a972a35d5daec..0000000000000 --- a/ext/fbsql/php_fbsql.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define HAVE_FBSQL 1 - -#ifndef _PHP_FBSQL_H -#define _PHP_FBSQL_H - -#if COMPILE_DL_FBSQL -#undef HAVE_FBSQL -#define HAVE_FBSQL 1 -#endif -#if HAVE_FBSQL - -extern zend_module_entry fbsql_module_entry; -#define fbsql_module_ptr &fbsql_module_entry - -#include - -PHP_MINIT_FUNCTION(fbsql); -PHP_MSHUTDOWN_FUNCTION(fbsql); -PHP_RINIT_FUNCTION(fbsql); -PHP_RSHUTDOWN_FUNCTION(fbsql); -PHP_MINFO_FUNCTION(fbsql); -PHP_FUNCTION(fbsql_connect); -PHP_FUNCTION(fbsql_pconnect); -PHP_FUNCTION(fbsql_close); -PHP_FUNCTION(fbsql_select_db); -PHP_FUNCTION(fbsql_set_characterset); -PHP_FUNCTION(fbsql_change_user); -PHP_FUNCTION(fbsql_create_db); -PHP_FUNCTION(fbsql_drop_db); -PHP_FUNCTION(fbsql_start_db); -PHP_FUNCTION(fbsql_stop_db); -PHP_FUNCTION(fbsql_db_status); -PHP_FUNCTION(fbsql_query); -PHP_FUNCTION(fbsql_db_query); -PHP_FUNCTION(fbsql_list_dbs); -PHP_FUNCTION(fbsql_list_tables); -PHP_FUNCTION(fbsql_list_fields); -PHP_FUNCTION(fbsql_error); -PHP_FUNCTION(fbsql_errno); -PHP_FUNCTION(fbsql_affected_rows); -PHP_FUNCTION(fbsql_rows_fetched); -PHP_FUNCTION(fbsql_insert_id); -PHP_FUNCTION(fbsql_result); -PHP_FUNCTION(fbsql_next_result); -PHP_FUNCTION(fbsql_num_rows); -PHP_FUNCTION(fbsql_num_fields); -PHP_FUNCTION(fbsql_fetch_row); -PHP_FUNCTION(fbsql_fetch_array); -PHP_FUNCTION(fbsql_fetch_assoc); -PHP_FUNCTION(fbsql_fetch_object); -PHP_FUNCTION(fbsql_data_seek); -PHP_FUNCTION(fbsql_fetch_lengths); -PHP_FUNCTION(fbsql_fetch_field); -PHP_FUNCTION(fbsql_field_seek); -PHP_FUNCTION(fbsql_free_result); -PHP_FUNCTION(fbsql_field_name); -PHP_FUNCTION(fbsql_field_table); -PHP_FUNCTION(fbsql_field_len); -PHP_FUNCTION(fbsql_field_type); -PHP_FUNCTION(fbsql_field_flags); -PHP_FUNCTION(fbsql_table_name); - -PHP_FUNCTION(fbsql_set_transaction); -PHP_FUNCTION(fbsql_autocommit); -PHP_FUNCTION(fbsql_commit); -PHP_FUNCTION(fbsql_rollback); - -PHP_FUNCTION(fbsql_create_blob); -PHP_FUNCTION(fbsql_create_clob); -PHP_FUNCTION(fbsql_set_lob_mode); -PHP_FUNCTION(fbsql_read_blob); -PHP_FUNCTION(fbsql_read_clob); -PHP_FUNCTION(fbsql_blob_size); -PHP_FUNCTION(fbsql_clob_size); - -PHP_FUNCTION(fbsql_hostname); -PHP_FUNCTION(fbsql_database); -PHP_FUNCTION(fbsql_database_password); -PHP_FUNCTION(fbsql_username); -PHP_FUNCTION(fbsql_password); -PHP_FUNCTION(fbsql_warnings); -PHP_FUNCTION(fbsql_set_password); - -PHP_FUNCTION(fbsql_get_autostart_info); -/* PHP_FUNCTION(fbsql_set_autostart_info); */ - -static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args); -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent); - -ZEND_BEGIN_MODULE_GLOBALS(fbsql) - zend_bool allowPersistent; - zend_bool generateWarnings; - zend_bool autoCommit; - long maxPersistent; - long maxLinks; - long maxConnections; - long maxResults; - long batchSize; - char *hostName; - char *databaseName; - char *databasePassword; - char *userName; - char *userPassword; - long persistentCount; - long linkCount; - long linkIndex; - -ZEND_END_MODULE_GLOBALS(fbsql) - -#ifdef ZTS -# define FB_SQL_G(v) TSRMG(fbsql_globals_id, zend_fbsql_globals *, v) -#else -# define FB_SQL_G(v) (fbsql_globals.v) -#endif - -/*#ifndef ZTS /* No need for external definitions */ -/*extern fbsql_module* phpfbModule; */ -/*#endif */ - -#else /* HAVE_FBSQL */ - -#define fbsql_module_ptr NULL -#error not ok -#endif /* HAVE_FBSQL */ - -#define phpext_fbsql_ptr fbsql_module_ptr - -#endif /* _PHP_FBSQL_H */ diff --git a/ext/fdf/CREDITS b/ext/fdf/CREDITS deleted file mode 100644 index 57c33cc4b3d8c..0000000000000 --- a/ext/fdf/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FDF -Uwe Steinmann diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 deleted file mode 100644 index 14fc261ec3450..0000000000000 --- a/ext/fdf/config.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fdftk, for FDF support, -[ --with-fdftk[=DIR] Include FDF support]) - -if test "$PHP_FDFTK" != "no"; then - - case $host_os in - aix*[)] - libtype=aix - ;; - solaris*[)] - libtype=solaris - ;; - linux*[)] - libtype=linux - ;; - *[)] - AC_MSG_ERROR([The fdf toolkit is not available for $host_os.]) - ;; - esac - - if test "$PHP_FDFTK" = "yes"; then - PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk" - fi - - for dir in $PHP_FDFTK; do - for subdir in include HeadersAndLibraries/headers; do - if test -r $dir/$subdir/FdfTk.h; then - FDFTK_DIR=$dir - FDFTK_H_DIR=$dir/$subdir - break 2 - elif test -r $dir/$subdir/fdftk.h; then - AC_DEFINE(HAVE_FDFTK_H_LOWER,1,[ ]) - FDFTK_DIR=$dir - FDFTK_H_DIR=$dir/$subdir - break 2 - fi - done - done - - if test -z "$FDFTK_DIR"; then - AC_MSG_ERROR([FdfTk.h or fdftk.h not found. Please reinstall the fdf toolkit.]) - fi - - PHP_ADD_INCLUDE($FDFTK_H_DIR) - - FDFLIBRARY="" - for file in fdftk FdfTk; do - for dir in $FDFTK_DIR/lib $FDFTK_DIR/HeadersAndLibraries/$libtype/C; do - if test -r $dir/lib$file.so; then - PHP_CHECK_LIBRARY($file, FDFOpen, [FDFLIBRARY=$file], [], [-L$dir -lm]) - if test "$FDFLIBRARY"; then - PHP_CHECK_LIBRARY($file, FDFGetFDFVersion, [AC_DEFINE(HAVE_FDFTK_5,1,[ ])], [], [-L$dir -lm]) - FDFTK_LIB_DIR=$dir - break 2 - fi - fi - done - done - - if test -z "$FDFLIBRARY"; then - AC_MSG_ERROR(no usable fdf library found) - fi - - PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDF_SHARED_LIBADD) - - PHP_NEW_EXTENSION(fdf, fdf.c, $ext_shared) - PHP_SUBST(FDF_SHARED_LIBADD) - AC_DEFINE(HAVE_FDFLIB,1,[ ]) -fi diff --git a/ext/fdf/config.w32 b/ext/fdf/config.w32 deleted file mode 100644 index befad2b816aa2..0000000000000 --- a/ext/fdf/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("fdf", "Include FDF support.", "no"); - -if (PHP_FDF != "no") { - if (CHECK_LIB("fdftk.lib", "fdf", PHP_FDF) && - CHECK_HEADER_ADD_INCLUDE("FdfTk.h", "CFLAGS_FDF")) { - EXTENSION("fdf", "fdf.c"); - AC_DEFINE('HAVE_FDFLIB', 1, 'FDF support'); - ADD_FLAG("CFLAGS_FDF", "/D HAVE_FDFTK_5"); - } else { - WARNING("fdf not enabled; libraries and headers not found"); - } -} diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c deleted file mode 100644 index 66ec51d9962d0..0000000000000 --- a/ext/fdf/fdf.c +++ /dev/null @@ -1,1632 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Uwe Steinmann | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from - http://beta1.adobe.com/ada/acrosdk/forms.html. */ - -/* Note that there is no code from the FdfTk lib in this file */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_open_temporary_file.h" - -#if HAVE_FDFLIB - -#include "SAPI.h" -#include "ext/standard/info.h" -#include "php_open_temporary_file.h" -#include "php_variables.h" -#include "php_fdf.h" - -#ifndef S_ISDIR -#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) -#endif - -static int le_fdf; - -SAPI_POST_HANDLER_FUNC(fdf_post_handler); - -/* {{{ fdf_functions[] - */ -function_entry fdf_functions[] = { - PHP_FE(fdf_add_template, NULL) - PHP_FE(fdf_close, NULL) - PHP_FE(fdf_create, NULL) - PHP_FE(fdf_enum_values, NULL) - PHP_FE(fdf_errno, NULL) - PHP_FE(fdf_error, NULL) - PHP_FE(fdf_get_ap, NULL) - PHP_FE(fdf_get_encoding, NULL) - PHP_FE(fdf_get_file, NULL) - PHP_FE(fdf_get_flags, NULL) - PHP_FE(fdf_get_opt, NULL) - PHP_FE(fdf_get_status, NULL) - PHP_FE(fdf_get_value, NULL) - PHP_FE(fdf_get_version, NULL) - PHP_FE(fdf_next_field_name, NULL) - PHP_FE(fdf_open, NULL) - PHP_FE(fdf_open_string, NULL) - PHP_FE(fdf_remove_item, NULL) - PHP_FE(fdf_save, NULL) - PHP_FE(fdf_save_string, NULL) - PHP_FE(fdf_set_ap, NULL) - PHP_FE(fdf_set_encoding, NULL) - PHP_FE(fdf_set_file, NULL) - PHP_FE(fdf_set_flags, NULL) - PHP_FE(fdf_set_javascript_action, NULL) - PHP_FE(fdf_set_opt, NULL) - PHP_FE(fdf_set_status, NULL) - PHP_FE(fdf_set_submit_form_action, NULL) - PHP_FE(fdf_set_value, NULL) - PHP_FE(fdf_header, NULL) -#ifdef HAVE_FDFTK_5 - PHP_FE(fdf_add_doc_javascript, NULL) - PHP_FE(fdf_get_attachment, NULL) - PHP_FE(fdf_set_on_import_javascript, NULL) - PHP_FE(fdf_set_target_frame, NULL) - PHP_FE(fdf_set_version, NULL) -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry fdf_module_entry = { - STANDARD_MODULE_HEADER, - "fdf", - fdf_functions, - PHP_MINIT(fdf), - PHP_MSHUTDOWN(fdf), - PHP_RINIT(fdf), - NULL, - PHP_MINFO(fdf), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_FDF -ZEND_GET_MODULE(fdf) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(fdf) - -#define FDF_SUCCESS do { FDF_G(error)=FDFErcOK; RETURN_TRUE;} while(0) -#define FDF_FAILURE(err) do { FDF_G(error)=err; RETURN_FALSE;} while(0) - -static void phpi_FDFClose(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - FDFDoc fdf = (FDFDoc)rsrc->ptr; - - (void) FDFClose(fdf); -} - -#define FDF_POST_CONTENT_TYPE "application/vnd.fdf" - -static sapi_post_entry php_fdf_post_entry = { - FDF_POST_CONTENT_TYPE, - sizeof(FDF_POST_CONTENT_TYPE)-1, - sapi_read_standard_form_data, - fdf_post_handler -}; - -static void php_fdf_init_globals(zend_fdf_globals *fdf_globals) -{ - memset(fdf_globals, 0, sizeof(*fdf_globals)); -} - - - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(fdf) -{ - ZEND_INIT_MODULE_GLOBALS(fdf, php_fdf_init_globals, NULL); - - le_fdf = zend_register_list_destructors_ex(phpi_FDFClose, NULL, "fdf", module_number); - - /* add handler for Acrobat FDF form post requests */ - sapi_register_post_entry(&php_fdf_post_entry TSRMLS_CC); - - - /* Constants used by fdf_set_opt() */ - REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFID", FDFID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFf", FDFFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetFf", FDFSetFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClearFf", FDFClearFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFlags", FDFFlags, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetF", FDFSetF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClrF", FDFClrF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAP", FDFAP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAS", FDFAS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAction", FDFAction, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAA", FDFAA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAPRef", FDFAPRef, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFIF", FDFIF, CONST_CS | CONST_PERSISTENT); - - /* Constants used by fdf_set_javascript_action() */ - REGISTER_LONG_CONSTANT("FDFEnter", FDFEnter, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFExit", FDFExit, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFDown", FDFDown, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT); - - /* Constants used by fdf_(set|get)_ap */ - REGISTER_LONG_CONSTANT("FDFNormalAP", 1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFRolloverAP", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFDownAP", 3, CONST_CS | CONST_PERSISTENT); - -#ifdef PHP_WIN32 - return SUCCESS; -#else - return (FDFInitialize() == FDFErcOK) ? SUCCESS : FAILURE; -#endif -} -/* }}} */ - -/* {{{ RINIT */ -PHP_RINIT_FUNCTION(fdf) -{ - FDF_G(error) = FDFErcOK; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(fdf) -{ - /* need to use a PHPAPI function here because it is external module in windows */ - php_info_print_table_start(); - php_info_print_table_row(2, "FDF Support", "enabled"); - php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() ); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(fdf) -{ - /* remove handler for Acrobat FDF form post requests */ - sapi_unregister_post_entry(&php_fdf_post_entry TSRMLS_CC); - -#ifdef PHP_WIN32 - return SUCCESS; -#else - return (FDFFinalize() == FDFErcOK) ? SUCCESS : FAILURE; -#endif -} -/* }}} */ - -/* {{{ proto resource fdf_open(string filename) - Opens a new FDF document */ -PHP_FUNCTION(fdf_open) -{ - zval **file; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(file); - - if (php_check_open_basedir(Z_STRVAL_PP(file) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(file), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - err = FDFOpen(Z_STRVAL_PP(file), 0, &fdf); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto resource fdf_open_string(string fdf_data) - Opens a new FDF document from string */ -PHP_FUNCTION(fdf_open_string) -{ - char *fdf_data; - int fdf_data_len; - FDFDoc fdf; - FDFErc err; - char *temp_filename; - FILE *fp; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &fdf_data, &fdf_data_len) - == FAILURE) { - return; - } - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - RETURN_FALSE; - } - fwrite(fdf_data, fdf_data_len, 1, fp); - fclose(fp); - - err = FDFOpen(temp_filename, 0, &fdf); - unlink(temp_filename); - efree(temp_filename); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto resource fdf_create(void) - Creates a new FDF document */ -PHP_FUNCTION(fdf_create) -{ - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - err = FDFCreate(&fdf); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto void fdf_close(resource fdfdoc) - Closes the FDF document */ -PHP_FUNCTION(fdf_close) -{ - zval **fdfp; - FDFDoc fdf; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - zend_list_delete(Z_RESVAL_PP(fdfp)); -} -/* }}} */ - -/* {{{ proto string fdf_get_value(resource fdfdoc, string fieldname [, int which]) - Gets the value of a field as string */ -PHP_FUNCTION(fdf_get_value) -{ - zval *r_fdf; - char *fieldname; - int fieldname_len; - long which = -1; - FDFDoc fdf; - FDFErc err; - ASInt32 nr, size = 256; - char *buffer; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", - &r_fdf, &fieldname, &fieldname_len, - &which) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - buffer = emalloc(size); - if(which >= 0) { -#if HAVE_FDFTK_5 - err = FDFGetNthValue(fdf, fieldname, which, buffer, size-2, &nr); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "the optional 'which' parameter requires FDF toolkit 5.0 or above, it will be ignored for now"); - which = -1; -#endif - } else { - err = FDFGetValue(fdf, fieldname, buffer, size-2, &nr); - } - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+2); - if(which >= 0) { -#if HAVE_FDFTK_5 - err = FDFGetNthValue(fdf, fieldname, which, buffer, nr, &nr); -#endif - } else { - err = FDFGetValue(fdf, fieldname, buffer, nr, &nr); - } -#if HAVE_FDFTK_5 - } else if((err == FDFErcValueIsArray) && (which == -1)) { - array_init(return_value); - which = 0; - do { - err = FDFGetNthValue(fdf, fieldname, which, buffer, size-2, &nr); - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+2); - err = FDFGetNthValue(fdf, fieldname, which, buffer, nr, &nr); - } - if (err == FDFErcOK) { - add_next_index_string(return_value, buffer, 1); - } - which++; - } while (err == FDFErcOK); - efree(buffer); - buffer = NULL; -#endif - } - - if((err != FDFErcOK) && (err != FDFErcNoValue)) { - if(buffer) efree(buffer); - FDF_FAILURE(err); - } - - if(buffer) { - RETVAL_STRING(buffer, 1); - efree(buffer); - } - - return; -} -/* }}} */ - -/* {{{ proto bool fdf_set_value(resource fdfdoc, string fieldname, mixed value [, int isname]) - Sets the value of a field */ -PHP_FUNCTION(fdf_set_value) -{ - zval **fdfp, **fieldname, **value, **dummy; - FDFDoc fdf; - FDFErc err; - - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &fdfp, &fieldname, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 4: - if (zend_get_parameters_ex(4, &fdfp, &fieldname, &value, &dummy) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - - if (Z_TYPE_PP(value) == IS_ARRAY) { -#ifdef HAVE_FDFTK_5 - ASInt32 nValues = zend_hash_num_elements(Z_ARRVAL_PP(value)); - char **newValues = ecalloc(nValues, sizeof(char *)), **next; - HashPosition pos; - zval **tmp; - - next = newValues; - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(value), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(value), - (void **) &tmp, - &pos) == SUCCESS) { - convert_to_string_ex(tmp); - *next++ = estrdup(Z_STRVAL_PP(tmp)); - zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos); - } - - err = FDFSetValues(fdf, Z_STRVAL_PP(fieldname), nValues, (const char **)newValues); - - for(next = newValues; nValues; nValues--) { - efree(*next++); - } - efree(newValues); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "setting array values is only possible with FDF toolkit 5.0 and above"); - RETURN_FALSE; -#endif - } else { - convert_to_string_ex(value); - - err = FDFSetValue(fdf, Z_STRVAL_PP(fieldname), Z_STRVAL_PP(value), (ASBool)0 /*dummy*/); - } - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_next_field_name(resource fdfdoc [, string fieldname]) - Gets the name of the next field name or the first field name */ -PHP_FUNCTION(fdf_next_field_name) -{ - zval **fdfp, **field; - int argc=ZEND_NUM_ARGS(); - ASInt32 length=256, nr; - char *buffer=NULL, *fieldname=NULL; - FDFDoc fdf; - FDFErc err; - - if (argc > 2 || argc < 1 || zend_get_parameters_ex(argc, &fdfp, &field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - if(argc == 2) { - convert_to_string_ex(field); - fieldname = Z_STRVAL_PP(field); - } - - buffer = emalloc(length); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+1); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - } - - if(err != FDFErcOK) { - efree(buffer); - FDF_FAILURE(err); - } - - RETVAL_STRING(buffer, 1); - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool fdf_set_ap(resource fdfdoc, string fieldname, int face, string filename, int pagenr) - Sets the appearence of a field */ -PHP_FUNCTION(fdf_set_ap) -{ - zval **fdfp, **fieldname, **face, **filename, **pagenr; - FDFDoc fdf; - FDFErc err; - FDFAppFace facenr; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &face, &filename, &pagenr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(face); - convert_to_string_ex(filename); - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - convert_to_long_ex(pagenr); - - switch(Z_LVAL_PP(face)) { - case 1: - facenr = FDFNormalAP; - break; - case 2: - facenr = FDFRolloverAP; - break; - case 3: - facenr = FDFDownAP; - break; - default: - facenr = FDFNormalAP; - break; - } - - err = FDFSetAP(fdf, Z_STRVAL_PP(fieldname), facenr, NULL, Z_STRVAL_PP(filename), (ASInt32) Z_LVAL_PP(pagenr)); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; - -} -/* }}} */ - -/* {{{ proto bool fdf_get_ap(resource fdfdoc, string fieldname, int face, string filename) - Gets the appearance of a field and creates a PDF document out of it. */ -PHP_FUNCTION(fdf_get_ap) { - zval *r_fdf; - char *fieldname, *filename; - int fieldname_len, filename_len; - long face; - FDFDoc fdf; - FDFErc err; - FDFAppFace facenr; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsls", - &r_fdf, &fieldname, &fieldname_len, - &face, &filename, &filename_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - switch(face) { - case 1: - facenr = FDFNormalAP; - break; - case 2: - facenr = FDFRolloverAP; - break; - case 3: - facenr = FDFDownAP; - break; - default: - facenr = FDFNormalAP; - break; - } - - err = FDFGetAP(fdf, fieldname, facenr, filename); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; - - -} -/* }}} */ - -/* {{{ proto string fdf_get_encoding(resource fdf) - Gets FDF file encoding scheme */ -PHP_FUNCTION(fdf_get_encoding) { - zval *r_fdf; - FDFDoc fdf; - FDFErc err; - char buffer[32]; - ASInt32 len; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &r_fdf) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFGetEncoding(fdf, buffer, 32, &len); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_G(error) = FDFErcOK; - RETURN_STRINGL(buffer, (size_t)len, 1); -} -/* }}} */ - -/* {{{ proto bool fdf_set_status(resource fdfdoc, string status) - Sets the value of /Status key */ -PHP_FUNCTION(fdf_set_status) -{ - zval **fdfp, **status; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(status); - - err = FDFSetStatus(fdf, Z_STRVAL_PP(status)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_get_status(resource fdfdoc) - Gets the value of /Status key */ -PHP_FUNCTION(fdf_get_status) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetStatus(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetStatus(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - efree(buf); - FDF_FAILURE(err); - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_set_file(resource fdfdoc, string filename [, string target_frame]) - Sets the value of /F key */ -PHP_FUNCTION(fdf_set_file) -{ - zval *r_fdf; - char *filename, *target_frame= NULL; - int filename_len, target_frame_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &r_fdf, - &filename, &filename_len, - &target_frame, &target_frame_len) - == FAILURE) { - return; - } - - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetFile(fdf, filename); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - if(target_frame) { -#ifdef HAVE_FDFTK_5 - err = FDFSetTargetFrame(fdf, target_frame); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "setting the target frame is only possible with FDF toolkit 5.0 and above, ignoring it for now"); -#endif - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_get_file(resource fdfdoc) - Gets the value of /F key */ -PHP_FUNCTION(fdf_get_file) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetFile(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetFile(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - efree(buf); - FDF_FAILURE(err); - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_save(resource fdfdoc [, string filename]) - Writes out the FDF file */ -PHP_FUNCTION(fdf_save) -{ - zval *r_fdf; - char *filename = NULL; - int filename_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s", &r_fdf, &filename, &filename_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if(filename) { - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - err = FDFSave(fdf, filename); - } else { - FILE *fp; - char *temp_filename; - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - err = FDFErcFileSysErr; - } else { - fclose(fp); - err = FDFSave(fdf, temp_filename); - - if(err == FDFErcOK) { - php_stream *stream = php_stream_open_wrapper(temp_filename, "rb", 0, NULL); - if (stream) { - php_stream_passthru(stream); - php_stream_close(stream); - } else { - err = FDFErcFileSysErr; - } - } - } - if(temp_filename) { - unlink(temp_filename); - efree(temp_filename); - } - } - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_save_string(resource fdfdoc) - Returns the FDF file as a string */ -PHP_FUNCTION(fdf_save_string) -{ - zval *r_fdf; - FDFDoc fdf; - FDFErc err; - FILE *fp; - char *temp_filename = NULL; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fdf) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - err = FDFErcFileSysErr; - } else { - fclose(fp); - err = FDFSave(fdf, temp_filename); - - if(err == FDFErcOK) { - fp = fopen(temp_filename, "rb"); - if (fp) { - struct stat stat; - char *buf; - - if (fstat(fileno(fp), &stat) == -1) { - RETVAL_FALSE; - goto err; - } - buf = emalloc(stat.st_size +1); - fread(buf, stat.st_size, 1, fp); - buf[stat.st_size] = '\0'; - fclose(fp); - - unlink(temp_filename); - efree(temp_filename); - RETURN_STRINGL(buf, stat.st_size, 0); - } else { - err = FDFErcFileSysErr; - } - } - } - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } -err: - if(temp_filename) { - unlink(temp_filename); - efree(temp_filename); - } - - return; -} -/* }}} */ - -/* {{{ proto bool fdf_add_template(resource fdfdoc, int newpage, string filename, string template, int rename) - Adds a template into the FDF document */ -PHP_FUNCTION(fdf_add_template) -{ - zval **fdfp, **newpage, **filename, **template, **rename; - FDFDoc fdf; - FDFErc err; - pdfFileSpecRec filespec; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &newpage, &filename, &template, &rename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_long_ex(newpage); - convert_to_string_ex(filename); - convert_to_string_ex(template); - convert_to_long_ex(rename); - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - filespec.FS = NULL; - filespec.F = Z_STRVAL_PP(filename); - filespec.Mac = NULL; - filespec.DOS = NULL; - filespec.Unix = NULL; - filespec.ID[0] = NULL; - filespec.ID[1] = NULL; - filespec.bVolatile = false; - - err = FDFAddTemplate(fdf, (unsigned short)(Z_LVAL_PP(newpage)), &filespec, Z_STRVAL_PP(template), (unsigned short)(Z_LVAL_PP(rename))); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_flags(resource fdfdoc, string fieldname, int whichflags, int newflags) - Sets flags for a field in the FDF document */ -PHP_FUNCTION(fdf_set_flags) -{ - zval **fdfp, **fieldname, **flags, **newflags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &flags, &newflags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(flags); - convert_to_long_ex(newflags); - - err=FDFSetFlags(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(flags), Z_LVAL_PP(newflags)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto int fdf_get_flags(resorce fdfdoc, string fieldname, int whichflags) - Gets the flags of a field */ -PHP_FUNCTION(fdf_get_flags) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long whichflags; - FDFDoc fdf; - FDFErc err; - ASUns32 flags; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", - &r_fdf, &fieldname, &fieldname_len, - &whichflags) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFGetFlags(fdf, fieldname, (FDFItem)whichflags, &flags); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - RETURN_LONG((long)flags); -} -/* }}} */ - -/* {{{ proto bool fdf_set_opt(resource fdfdoc, string fieldname, int element, string value, string name) - Sets a value in the opt array for a field */ -PHP_FUNCTION(fdf_set_opt) -{ - zval **fdfp, **fieldname, **element, **value, **name; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &element, &value, &name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(element); - convert_to_string_ex(value); - convert_to_string_ex(name); - - err = FDFSetOpt(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(element), Z_STRVAL_PP(value), Z_STRVAL_PP(name)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto mixed fdf_get_opt(resource fdfdof, string fieldname [, int element]) - Gets a value from the opt array of a field */ -PHP_FUNCTION(fdf_get_opt) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long element = -1; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", - &r_fdf, &fieldname, &fieldname_len, - &element) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if(element == -1) { - ASInt32 elements; - err = FDFGetOpt(fdf, fieldname, (ASInt32)-1, NULL, NULL, 0, &elements); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - RETURN_LONG((long)elements); - } else { - ASInt32 bufSize, nRet; - char *buf1, *buf2; - - bufSize = 1024; - buf1 = emalloc(bufSize); - buf2 = emalloc(bufSize); - - err = FDFGetOpt(fdf, fieldname, (ASInt32)element, buf1, buf2, bufSize, &nRet); - if(err == FDFErcBufTooShort) { - efree(buf1); - efree(buf2); - buf1 = emalloc(nRet); - buf2 = emalloc(nRet); - bufSize = nRet; - err = FDFGetOpt(fdf, fieldname, (ASInt32)element, buf1, buf2, bufSize, &nRet); - } - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - array_init(return_value); - add_next_index_stringl(return_value, buf1, strlen(buf1), 1); - add_next_index_stringl(return_value, buf2, strlen(buf2), 1); - efree(buf1); - efree(buf2); - } -} -/* }}} */ - -/* {{{ proto bool fdf_set_submit_form_action(resource fdfdoc, string fieldname, int whichtrigger, string url, int flags) - Sets the submit form action for a field */ -PHP_FUNCTION(fdf_set_submit_form_action) -{ - zval **fdfp, **fieldname, **trigger, **url, **flags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &trigger, &url, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(url); - convert_to_long_ex(flags); - - err = FDFSetSubmitFormAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(url), Z_LVAL_PP(flags)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_javascript_action(resource fdfdoc, string fieldname, int whichtrigger, string script) - Sets the javascript action for a field */ -PHP_FUNCTION(fdf_set_javascript_action) -{ - zval **fdfp, **fieldname, **trigger, **script; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &trigger, &script) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(script); - - err = FDFSetJavaScriptAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(script)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_encoding(resource fdf_document, string encoding) - Sets FDF encoding (either "Shift-JIS" or "Unicode") */ -PHP_FUNCTION(fdf_set_encoding) -{ - zval **fdfp, **enc; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &enc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(enc); - - err = FDFSetEncoding(fdf, Z_STRVAL_PP(enc)); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ SAPI_POST_HANDLER_FUNC - * SAPI post handler for FDF forms */ -SAPI_POST_HANDLER_FUNC(fdf_post_handler) -{ - FILE *fp; - FDFDoc theFDF; - char *name=NULL, *value=NULL, *p, *data; - int name_len=0, value_len=0; - char *lastfieldname =NULL; - char *filename = NULL; - FDFErc err; - ASInt32 nBytes; - zval *array_ptr = (zval *) arg; - - fp=php_open_temporary_file(NULL, "fdfdata.", &filename TSRMLS_CC); - if(!fp) { - if(filename) efree(filename); - return; - } - fwrite(SG(request_info).post_data, SG(request_info).post_data_length, 1, fp); - fclose(fp); - - /* Set HTTP_FDF_DATA variable */ - data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SET_VAR_STRINGL("HTTP_FDF_DATA", data, SG(request_info).post_data_length); - - err = FDFOpen(filename, 0, &theFDF); - - if(err==FDFErcOK){ - name = emalloc(name_len=256); - value= emalloc(value_len=256); - while (1) { - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - if(err == FDFErcBufTooShort && nBytes >0 ) { - name = erealloc(name, name_len=(nBytes+1)); - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - } - - if(err != FDFErcOK || nBytes == 0) break; - - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - - err = FDFGetValue(theFDF, name, NULL, 0, &nBytes); - if(err != FDFErcOK && err != FDFErcNoValue ) break; - - if(value_len0) { - err = FDFGetValue(theFDF, name, value, value_len-1, &nBytes); - if(err == FDFErcOK && nBytes != 0) { - for(p=value;*p;p++) if(*p=='\r') *p='\n'; - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - php_register_variable(name, value, array_ptr TSRMLS_CC); - } - } - } - - FDFClose(theFDF); - VCWD_UNLINK((const char *)filename); - efree(filename); - - if(name) efree(name); - if(value) efree(value); - if(lastfieldname) efree(lastfieldname); - } -} -/* }}} */ - -/* {{{ proto int fdf_errno(void) - Gets error code for last operation */ -PHP_FUNCTION(fdf_errno) { - RETURN_LONG((long)FDF_G(error)); -} -/* }}} */ - -/* {{{ proto string fdf_error([int errno]) - Gets error description for error code */ -PHP_FUNCTION(fdf_error) { - FDFErc err; - long p_err = -1; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &p_err) - == FAILURE) { - return; - } - - err = (p_err >= 0) ? (FDFErc)p_err : FDF_G(error); - - switch(err) { - case FDFErcOK: - RETURN_STRING("no error", 1); - case FDFErcInternalError: - RETURN_STRING("An internal FDF Library error occurred", 1); - case FDFErcBadParameter: - RETURN_STRING("One or more of the parameters passed were invalid. ", 1); - case FDFErcFileSysErr: - RETURN_STRING("A file system error occurred or the file was not found", 1); - case FDFErcBadFDF: - RETURN_STRING("The FDF file being opened or parsed was invalid", 1); - case FDFErcFieldNotFound: - RETURN_STRING("The field whose name was passed in the parameter fieldName does not exist in the FDF file", 1); - case FDFErcNoValue: - RETURN_STRING("The field whose value was requested has no value", 1); - case FDFErcEnumStopped: - RETURN_STRING("Enumeration was stopped by FDFEnumValues by returning FALSE", 1); - case FDFErcCantInsertField: - RETURN_STRING("The field whose name was passed in the parameter fieldName cannot be inserted into the FDF file", 1); - case FDFErcNoOption: - RETURN_STRING("The requested element in a fields /Opt key does not exist, or the field has no /Opt key. ", 1); - case FDFErcNoFlags: - RETURN_STRING("The field has no /F or /Ff keys", 1); - case FDFErcBadPDF: - RETURN_STRING("The PDF file passed as the parameter to FDFSetAP was invalid, or did not contain the requested page ", 1); - case FDFErcBufTooShort: - RETURN_STRING("The buffer passed as a parameter was too short", 1); - case FDFErcNoAP: - RETURN_STRING("The field has no /AP key", 1); - case FDFErcIncompatibleFDF: - RETURN_STRING("An attempt to mix classic and template-based FDF files was made", 1); -#ifdef HAVE_FDFTK_5 - case FDFErcNoAppendSaves: - RETURN_STRING("The FDF does not include a /Difference key", 1); - case FDFErcValueIsArray: - RETURN_STRING("The value of this field is an array. Use FDFGetNthValue. ", 1); - case FDFErcEmbeddedFDFs: - RETURN_STRING("The FDF you passed as a parameter is a container for one or more FDFs embedded within it. Use FDFOpenFromEmbedded to gain access to each embedded FDF", 1); - case FDFErcNoMoreFDFs: - RETURN_STRING("Returned by FDFOpenFromEmbedded when parameter iWhich >= the number of embedded FDFs (including the case when the passed FDF does not contain any embedded FDFs)", 1); - case FDFErcInvalidPassword: - RETURN_STRING("Returned by FDFOpenFromEmbedded when the embedded FDF is encrypted, and you did not provide the correct password", 1); -#endif - case FDFErcLast: - RETURN_STRING("Reserved for future use", 1); - default: - RETURN_STRING("unknown error", 1); - } -} -/* }}} */ - -/* {{{ proto string fdf_get_version([resource fdfdoc]) - Gets version number for FDF api or file */ -PHP_FUNCTION(fdf_get_version) { - zval *r_fdf = NULL; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &r_fdf) - == FAILURE) { - return; - } - - if(r_fdf) { -#if HAVE_FDFTK_5 - const char *fdf_version; - FDFDoc fdf; - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - fdf_version = FDFGetFDFVersion(fdf); - RETURN_STRING((char *)fdf_version, 1); -#else - RETURN_STRING("1.2",1); -#endif - } else { - const char *api_version = FDFGetVersion(); - RETURN_STRING((char *)api_version, 1); - } -} -/* }}} */ - -#ifdef HAVE_FDFTK_5 -/* {{{ proto bool fdf_set_version(resourece fdfdoc, string version) - Sets FDF version for a file*/ -PHP_FUNCTION(fdf_set_version) { - zval *r_fdf; - char *version; - int version_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &r_fdf, &version, &version_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetFDFVersion(fdf, version); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_add_doc_javascript(resource fdfdoc, string scriptname, string script) - Add javascript code to the fdf file */ -PHP_FUNCTION(fdf_add_doc_javascript) { - zval *r_fdf; - char *name, *script; - int name_len, script_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &r_fdf, - &name, &name_len, - &script, &script_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFAddDocJavaScript(fdf, name, script); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_on_import_javascript(resource fdfdoc, string script [, bool before_data_import]) - Adds javascript code to be executed when Acrobat opens the FDF */ -PHP_FUNCTION(fdf_set_on_import_javascript) { - zval *r_fdf; - char *script; - int script_len; - zend_bool before; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &r_fdf, - &script, &script_len, &before - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetOnImportJavaScript(fdf, script, before); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_target_frame(resource fdfdoc, string target) - Sets target frame for form */ -PHP_FUNCTION(fdf_set_target_frame) { - zval *r_fdf; - char *target; - int target_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &r_fdf, - &target, &target_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetTargetFrame(fdf, target); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ -#endif - -/* {{{ proto bool fdf_remove_item(resource fdfdoc, string fieldname, int item) - Sets target frame for form */ -PHP_FUNCTION(fdf_remove_item) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long item; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &r_fdf, - &fieldname, &fieldname_len, - &item - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFRemoveItem(fdf, *fieldname ? fieldname : NULL, item); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -#ifdef HAVE_FDFTK_5 -/* {{{ proto array fdf_get_attachment(resource fdfdoc, string fieldname, string savepath) - Get attached uploaded file */ -PHP_FUNCTION(fdf_get_attachment) { - zval *r_fdf; - char *fieldname, *savepath; - int fieldname_len, savepath_len; - int is_dir=0; - FDFDoc fdf; - FDFErc err; - char pathbuf[MAXPATHLEN], mimebuf[1024]; - struct stat statBuf; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &r_fdf, - &fieldname, &fieldname_len, - &savepath, &savepath_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (php_check_open_basedir(savepath TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(savepath, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - strncpy(pathbuf , savepath, MAXPATHLEN-1); - pathbuf[MAXPATHLEN-1] = '\0'; - - if(0 == stat(pathbuf, &statBuf)) { - is_dir = S_ISDIR(statBuf.st_mode); - } - - err = FDFExtractAttachment(fdf, fieldname, pathbuf, sizeof(pathbuf), is_dir, mimebuf, sizeof(mimebuf)); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - array_init(return_value); - add_assoc_string(return_value, "path", pathbuf, 1); - add_assoc_string(return_value, "type", mimebuf, 1); - stat(pathbuf, &statBuf); - add_assoc_long(return_value, "size", statBuf.st_size); -} -/* }}} */ -#endif - -/* {{{ enum_values_callback */ -static ASBool enum_values_callback(char *name, char *value, void *userdata) -{ - zval *retval_ptr, *z_name, *z_value, **args[3]; - long retval = 0; - int numargs = 2; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(z_name); - ZVAL_STRING(z_name, name, 1); - args[0] = &z_name; - - if (*value) { /* simple value */ - MAKE_STD_ZVAL(z_value); - ZVAL_STRING(z_value, value, 1); - args[1] = &z_value; - } else { /* empty value *might* be an array */ - /* TODO: do it like fdf_get_value (or re-implement yourself?) */ - } - - if (userdata) { - args[2] = (zval **) userdata; - numargs++; - } - - if (call_user_function_ex(EG(function_table), - NULL, - FDF_G(enum_callback), - &retval_ptr, - numargs, args, - 0, NULL TSRMLS_CC) == SUCCESS - && retval_ptr) { - - convert_to_long_ex(&retval_ptr); - retval = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "callback failed"); - } - - zval_ptr_dtor(&z_name); - zval_ptr_dtor(&z_value); - - return (ASBool)retval; -} -/* }}} */ - -/* {{{ proto bool fdf_enum_values(resource fdfdoc, callback function [, mixed userdata]) - Call a user defined function for each document value */ -PHP_FUNCTION(fdf_enum_values) { - zval *r_fdf; - zval *callback; - zval *userdata = NULL; - FDFDoc fdf; - FDFErc err; - zval name; - char namebuf[1024], valbuf[1024]; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|z", &r_fdf, - &callback, &userdata - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (!zend_is_callable(callback, 0, &name)) { - convert_to_string(&name); - php_error_docref1(NULL TSRMLS_CC, Z_STRVAL(name), E_WARNING, "Second argument is expected to be a valid callback"); - zval_ptr_dtor(&name); - RETURN_FALSE; - } - zval_ptr_dtor(&name); - FDF_G(enum_callback) = callback; - FDF_G(enum_fdf) = fdf; - - err = FDFEnumValues(fdf, enum_values_callback, - namebuf, sizeof(namebuf), - valbuf, sizeof(valbuf), - userdata ? &userdata : NULL, 0); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto void fdf_header(void) - Set FDF specific HTTP headers */ -PHP_FUNCTION(fdf_header) { - sapi_header_line ctr = {0}; - - ctr.line = "Content-type: application/vnd.fdf"; - ctr.line_len = strlen(ctr.line); - ctr.response_code = 200; - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fdf/fdf.dsp b/ext/fdf/fdf.dsp deleted file mode 100644 index 85b91ceac92df..0000000000000 --- a/ext/fdf/fdf.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fdf" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fdf - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak" CFG="fdf - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fdf - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fdf - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_fdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "fdf - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_fdf.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "fdf - Win32 Release_TS" -# Name "fdf - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\fdf.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fdf.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/fdf/package.xml b/ext/fdf/package.xml deleted file mode 100644 index 9558286828fd7..0000000000000 --- a/ext/fdf/package.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - fdf - PDF Form Data Format functions - - - steinm - Uwe Steinmann - steinm@php.net - lead - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - developer - - - -Forms Data Format (FDF) is a format for handling forms -within PDF documents. You should read the documentation -at http://partners.adobe.com/asn/acrobat/forms.jsp for -more information on what FDF is and how it is used in -general. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h deleted file mode 100644 index eed90989f01fb..0000000000000 --- a/ext/fdf/php_fdf.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Uwe Steinmann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FDF_H -#define PHP_FDF_H - -#if HAVE_FDFLIB -#ifdef PHP_WIN32 -#else -#define UNIX_DEV -#endif - -#if HAVE_FDFTK_H_LOWER -# include -#else -# include -#endif - -ZEND_BEGIN_MODULE_GLOBALS(fdf) - FDFErc error; - zval *enum_callback; - FDFDoc enum_fdf; -ZEND_END_MODULE_GLOBALS(fdf) - -#ifdef ZTS -#define FDF_G(v) TSRMG(fdf_globals_id, zend_fdf_globals *, v) -#else -#define FDF_G(v) (fdf_globals.v) -#endif - - -extern zend_module_entry fdf_module_entry; -#define fdf_module_ptr &fdf_module_entry - -PHP_MINIT_FUNCTION(fdf); -PHP_MSHUTDOWN_FUNCTION(fdf); -PHP_RINIT_FUNCTION(fdf); -PHP_MINFO_FUNCTION(fdf); - -PHP_FUNCTION(fdf_open); -PHP_FUNCTION(fdf_open_string); -PHP_FUNCTION(fdf_close); -PHP_FUNCTION(fdf_create); -PHP_FUNCTION(fdf_save); -PHP_FUNCTION(fdf_save_string); -PHP_FUNCTION(fdf_get_value); -PHP_FUNCTION(fdf_set_value); -PHP_FUNCTION(fdf_next_field_name); -PHP_FUNCTION(fdf_set_ap); -PHP_FUNCTION(fdf_get_ap); -PHP_FUNCTION(fdf_get_status); -PHP_FUNCTION(fdf_set_status); -PHP_FUNCTION(fdf_set_file); -PHP_FUNCTION(fdf_get_file); -PHP_FUNCTION(fdf_add_template); -PHP_FUNCTION(fdf_set_flags); -PHP_FUNCTION(fdf_get_flags); -PHP_FUNCTION(fdf_set_opt); -PHP_FUNCTION(fdf_get_opt); -PHP_FUNCTION(fdf_set_submit_form_action); -PHP_FUNCTION(fdf_set_javascript_action); -PHP_FUNCTION(fdf_add_doc_javascript); -PHP_FUNCTION(fdf_set_on_import_javascript); -PHP_FUNCTION(fdf_set_encoding); -PHP_FUNCTION(fdf_get_encoding); -PHP_FUNCTION(fdf_set_version); -PHP_FUNCTION(fdf_get_version); -PHP_FUNCTION(fdf_set_target_frame); -PHP_FUNCTION(fdf_errno); -PHP_FUNCTION(fdf_error); -PHP_FUNCTION(fdf_remove_item); -PHP_FUNCTION(fdf_get_attachment); -PHP_FUNCTION(fdf_enum_values); -PHP_FUNCTION(fdf_header); -#else -#define fdf_module_ptr NULL -#endif -#define phpext_fdf_ptr fdf_module_ptr -#endif /* PHP_FDF_H */ diff --git a/ext/fdf/tests/01-general.phpt b/ext/fdf/tests/01-general.phpt deleted file mode 100644 index 998da3d7297cd..0000000000000 --- a/ext/fdf/tests/01-general.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Adobe Form Data Format functions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK \ No newline at end of file diff --git a/ext/fdf/tests/02-values.phpt b/ext/fdf/tests/02-values.phpt deleted file mode 100644 index 40c7df4a0ebcd..0000000000000 --- a/ext/fdf/tests/02-values.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -FDF open/save and set/get values ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo: bar -bar: foo diff --git a/ext/fdf/tests/03-read-file.phpt b/ext/fdf/tests/03-read-file.phpt deleted file mode 100644 index a611142b3f123..0000000000000 --- a/ext/fdf/tests/03-read-file.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -FDF read file ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo: bar -bar: foo diff --git a/ext/fdf/tests/04-POST.phpt b/ext/fdf/tests/04-POST.phpt deleted file mode 100644 index 1d8c9de48f1d5..0000000000000 --- a/ext/fdf/tests/04-POST.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -FDF POST data parsing ---SKIPIF-- - ---HEADERS-- -return <<> ] /ID [ <3c0e51bf6427b09f7faa482297af6957><5f9787a1646a3bfe44b7725c9c1284df> -] >> ->> -endobj -trailer -<< -/Root 1 0 R - ->> -%%EOF ---FILE-- - $value) { - echo "$key => $value\n"; -} -?> ---EXPECT-- -209 -status: Thanks George \ No newline at end of file diff --git a/ext/fdf/tests/simple.fdf b/ext/fdf/tests/simple.fdf deleted file mode 100644 index 21d3fbd55af30..0000000000000 --- a/ext/fdf/tests/simple.fdf +++ /dev/null @@ -1,18 +0,0 @@ -%FDF-1.2 -%âÏÓ -1 0 obj -<< -/FDF << /Fields 2 0 R >> ->> -endobj -2 0 obj -[ -<< /T (foo)/V (bar)>> << /T (bar)/V (foo)>> -] -endobj -trailer -<< -/Root 1 0 R - ->> -%%EOF diff --git a/ext/fileinfo/CREDITS b/ext/fileinfo/CREDITS deleted file mode 100644 index 6251d1b110bb3..0000000000000 --- a/ext/fileinfo/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -fileinfo -Ilia Alshanetsky diff --git a/ext/fileinfo/EXPERIMENTAL b/ext/fileinfo/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 deleted file mode 100644 index f1c15c006bd07..0000000000000 --- a/ext/fileinfo/config.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension fileinfo - -PHP_ARG_WITH(fileinfo, for fileinfo support, -[ --with-fileinfo=DIR Include fileinfo support]) - -if test "$PHP_FILEINFO" != "no"; then - SEARCH_PATH="/usr/local /usr /usr/share/file" - if test -r $PHP_FILEINFO/include/magic.h || test -r $PHP_FILEINFO/magic.h; then - FILEINFO_DIR=$PHP_FILEINFO - else - AC_MSG_CHECKING([for magic files in default path]) - for i in $SEARCH_PATH ; do - if test -r $i/include/magic.h || test -r $i/magic.h; then - FILEINFO_DIR=$i - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$FILEINFO_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the libmagic distribution]) - fi - - if test -r "$FILEINFO_DIR/include/magic.h"; then - PHP_ADD_INCLUDE($FILEINFO_DIR/include) - else - PHP_ADD_INCLUDE($FILEINFO_DIR) - fi - - LIBNAME=magic - LIBSYMBOL=magic_open - - PHP_CHECK_FUNC(dl, dlopen) - PHP_CHECK_FUNC(gzgets, z) - PHP_CHECK_FUNC(round, m) - - PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, - [ - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FILEINFO_DIR/lib, FILEINFO_SHARED_LIBADD) - AC_DEFINE(HAVE_FILEINFOLIB,1,[ ]) - ],[ - AC_MSG_ERROR([wrong magic lib version or lib not found]) - ],[ - -L$FILEINFO_DIR/lib - ]) - - MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic /usr/share/misc" - for i in $MAGIC_MIME_LOCATIONS; do - if test -f $i; then - PHP_DEFAULT_MAGIC_FILE=$i - break - fi - done - AC_DEFINE_UNQUOTED(PHP_DEFAULT_MAGIC_FILE,"$PHP_DEFAULT_MAGIC_FILE",[magic file path]) - - PHP_SUBST(FILEINFO_SHARED_LIBADD) - - PHP_NEW_EXTENSION(fileinfo, fileinfo.c, $ext_shared) -fi diff --git a/ext/fileinfo/config.w32 b/ext/fileinfo/config.w32 deleted file mode 100644 index 08d09e61f5ca1..0000000000000 --- a/ext/fileinfo/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("fileinfo", "fileinfo support", "no"); - -if (PHP_FILEINFO != 'no' && - CHECK_HEADER_ADD_INCLUDE('magic.h', 'CFLAGS_FILEINFO') && - CHECK_LIB(PHP_DEBUG != 'no'?'libmagic-staticd.lib':'libmagic-static.lib', - 'fileinfo', PHP_FILEINFO)) { - EXTENSION('fileinfo', 'fileinfo.c'); - AC_DEFINE('USE_MAGIC_STATIC', '', ''); -} - diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c deleted file mode 100644 index c992ff910bd17..0000000000000 --- a/ext/fileinfo/fileinfo.c +++ /dev/null @@ -1,433 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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. | - +----------------------------------------------------------------------+ - | Author: Ilia Alshanetsky | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "php.h" - -#include -/* - * HOWMANY specifies the maximum offset libmagic will look at - * this is currently hardcoded in the libmagic source but not exported - */ -#ifndef HOWMANY -#define HOWMANY 65536 -#endif - - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" /* needed for context stuff */ -#include "php_fileinfo.h" -#include "fopen_wrappers.h" /* needed for is_url */ - -struct php_fileinfo { - long options; - struct magic_set *magic; -}; - -#ifndef PHP_DEFAULT_MAGIC_FILE -#define PHP_DEFAULT_MAGIC_FILE NULL -#endif - -#ifdef ZEND_ENGINE_2 - -static zend_object_handlers finfo_object_handlers; -zend_class_entry *finfo_class_entry; - -struct finfo_object { - zend_object zo; - struct php_fileinfo *ptr; -}; - -#define FILEINFO_DECLARE_INIT_OBJECT(object) \ - zval *object = getThis(); - -#define FILEINFO_REGISTER_OBJECT(_object, _ptr) \ -{ \ - struct finfo_object *obj; \ - obj = (struct finfo_object*)zend_object_store_get_object(_object TSRMLS_CC); \ - obj->ptr = _ptr; \ -} - -#define FILEINFO_FROM_OBJECT(finfo, object) \ -{ \ - struct finfo_object *obj = zend_object_store_get_object(object TSRMLS_CC); \ - finfo = obj->ptr; \ - if (!finfo) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The invalid fileinfo object."); \ - RETURN_FALSE; \ - } \ -} - -/* {{{ finfo_objects_dtor - */ -static void finfo_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - struct finfo_object *intern = (struct finfo_object *) object; - - if (intern->ptr) { - magic_close(intern->ptr->magic); - efree(intern->ptr); - } - - efree(intern); -} -/* }}} */ - -/* {{{ finfo_objects_new - */ -PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - struct finfo_object *intern; - - intern = emalloc(sizeof(struct finfo_object)); - intern->zo.ce = class_type; - intern->zo.in_get = 0; - intern->zo.in_set = 0; - intern->zo.properties = NULL; - intern->ptr = NULL; - - retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &finfo_object_handlers; - - return retval; -} -/* }}} */ - -/* {{{ finfo_class_functions - */ -function_entry finfo_class_functions[] = { - ZEND_ME_MAPPING(finfo, finfo_open, NULL) - ZEND_ME_MAPPING(set_flags, finfo_set_flags,NULL) - ZEND_ME_MAPPING(file, finfo_file, NULL) - ZEND_ME_MAPPING(buffer, finfo_buffer, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -#else - -#define FILEINFO_REGISTER_OBJECT(_object, _ptr) {} -#define FILEINFO_FROM_OBJECT(socket_id, object) {} - -#define FILEINFO_DECLARE_INIT_OBJECT(object) -#define object 0 - -#endif - -#define FINFO_SET_OPTION(magic, options) \ - if (magic_setflags(magic, options) == -1) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%ld' %d:%s", \ - options, magic_errno(magic), magic_error(magic)); \ - RETURN_FALSE; \ - } - -/* True global resources - no need for thread safety here */ -static int le_fileinfo; - -void finfo_resource_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - if (rsrc->ptr) { - struct php_fileinfo *finfo = (struct php_fileinfo *) rsrc->ptr; - magic_close(finfo->magic); - efree(rsrc->ptr); - rsrc->ptr = NULL; - } -} - -/* {{{ fileinfo_functions[] - */ -function_entry fileinfo_functions[] = { - PHP_FE(finfo_open, NULL) - PHP_FE(finfo_close, NULL) - PHP_FE(finfo_set_flags, NULL) - PHP_FE(finfo_file, NULL) - PHP_FE(finfo_buffer, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(finfo) -{ -#ifdef ZEND_ENGINE_2 - zend_class_entry _finfo_class_entry; - INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions); - _finfo_class_entry.create_object = finfo_objects_new; - finfo_class_entry = zend_register_internal_class(&_finfo_class_entry TSRMLS_CC); - - /* copy the standard object handlers to you handler table */ - memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -#endif /* ZEND_ENGINE_2 */ - - le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number); - - REGISTER_LONG_CONSTANT("FILEINFO_NONE", MAGIC_NONE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_SYMLINK", MAGIC_SYMLINK, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_MIME", MAGIC_MIME, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_COMPRESS", MAGIC_COMPRESS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_DEVICES", MAGIC_DEVICES, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_CONTINUE", MAGIC_CONTINUE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_PRESERVE_ATIME", MAGIC_PRESERVE_ATIME, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILEINFO_RAW", MAGIC_RAW, CONST_CS|CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ fileinfo_module_entry - */ -zend_module_entry fileinfo_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "fileinfo", - fileinfo_functions, - PHP_MINIT(finfo), - NULL, - NULL, - NULL, - PHP_MINFO(fileinfo), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_FILEINFO -ZEND_GET_MODULE(fileinfo) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(fileinfo) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "fileinfo support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto resource finfo_open([int options [, string arg]]) - Create a new fileinfo resource. */ -PHP_FUNCTION(finfo_open) -{ - long options = MAGIC_NONE; - char *file = PHP_DEFAULT_MAGIC_FILE; - int file_len = 0; - struct php_fileinfo *finfo; - FILEINFO_DECLARE_INIT_OBJECT(object) - char resolved_path[MAXPATHLEN]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) { - RETURN_FALSE; - } - - if (file_len) { /* user specified filed, perform open_basedir checks */ - if (!VCWD_REALPATH(file, resolved_path)) { - RETURN_FALSE; - } - file = resolved_path; - - if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) { - RETURN_FALSE; - } - } - - finfo = emalloc(sizeof(struct php_fileinfo)); - - finfo->options = options; - finfo->magic = magic_open(options); - - if (finfo->magic == NULL) { - efree(finfo); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%ld'.", options); - RETURN_FALSE; - } - - if (magic_load(finfo->magic, file) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file); - magic_close(finfo->magic); - efree(finfo); - RETURN_FALSE; - } - - if (object) { - FILEINFO_REGISTER_OBJECT(object, finfo); - } else { - ZEND_REGISTER_RESOURCE(return_value, finfo, le_fileinfo); - } -} -/* }}} */ - -/* {{{ proto resource finfo_close(resource finfo) - Close fileinfo resource. */ -PHP_FUNCTION(finfo_close) -{ - struct php_fileinfo *finfo; - zval *zfinfo; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zfinfo) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo); - - zend_list_delete(Z_RESVAL_P(zfinfo)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool finfo_set_flags(resource finfo, int options) - Set libmagic configuration options. */ -PHP_FUNCTION(finfo_set_flags) -{ - long options; - struct php_fileinfo *finfo; - zval *zfinfo; - FILEINFO_DECLARE_INIT_OBJECT(object) - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &options) == FAILURE) { - RETURN_FALSE; - } - FILEINFO_FROM_OBJECT(finfo, object); - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zfinfo, &options) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo); - } - - FINFO_SET_OPTION(finfo->magic, options) - finfo->options = options; - - RETURN_TRUE; -} -/* }}} */ - -static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - long options = 0; - char *buffer, *tmp, *ret_val; - int buffer_len; - struct php_fileinfo *finfo; - zval *zfinfo, *zcontext = NULL; - FILEINFO_DECLARE_INIT_OBJECT(object) - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbz", &buffer, &buffer_len, &options, &zcontext) == FAILURE) { - RETURN_FALSE; - } - FILEINFO_FROM_OBJECT(finfo, object); - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|lbz", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo); - } - - /* Set options for the current file/buffer. */ - if (options) { - FINFO_SET_OPTION(finfo->magic, options) - } - - if (mode) { /* file */ - /* determine if the file is a local file or remote URL */ - char *tmp2; - php_stream_wrapper *wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC); - if (wrap && wrap->is_url) { -#ifdef ZEND_ENGINE_2 - php_stream_context *context = php_stream_context_from_zval(zcontext, 0); -#else - php_stream_context *context = NULL; -#endif - php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", - ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); - if (!stream) { - RETURN_FALSE; - } - buffer_len = php_stream_copy_to_mem(stream, &tmp, HOWMANY, 0); - php_stream_close(stream); - - if (buffer_len == 0) { - RETURN_FALSE; - } - } else { /* local file */ - char resolved_path[MAXPATHLEN]; - if (!VCWD_REALPATH(buffer, resolved_path)) { - RETURN_FALSE; - } - - ret_val = (char *) magic_file(finfo->magic, buffer); - goto common; - } - } else { /* buffer */ - tmp = buffer; - } - - ret_val = (char *) magic_buffer(finfo->magic, tmp, buffer_len); - if (mode) { - efree(tmp); - } -common: - /* Restore options */ - if (options) { - FINFO_SET_OPTION(finfo->magic, finfo->options) - } - - if (!ret_val) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed identify data %d:%s", - magic_errno(finfo->magic), magic_error(finfo->magic)); - RETURN_FALSE; - } else { - RETURN_STRING(ret_val, 1); - } -} - -/* {{{ proto string finfo_file(resource finfo, char *file_name [, int options [, resource context]]) - Return information about a file. */ -PHP_FUNCTION(finfo_file) -{ - _php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string finfo_buffer(resource finfo, char *string [, int options]) - Return infromation about a string buffer. */ -PHP_FUNCTION(finfo_buffer) -{ - _php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/fileinfo/fileinfo.php b/ext/fileinfo/fileinfo.php deleted file mode 100644 index 1ee9efbeb85e3..0000000000000 --- a/ext/fileinfo/fileinfo.php +++ /dev/null @@ -1,29 +0,0 @@ -buffer(file_get_contents($file)) . "\n"; -} -?> diff --git a/ext/fileinfo/package.xml b/ext/fileinfo/package.xml deleted file mode 100644 index 14dab5b573772..0000000000000 --- a/ext/fileinfo/package.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - Fileinfo - libmagic bindings - - - iliaa - Ilia Alshanetsky - ilia@php.net - lead - - - -This extension allows retrieval of information regarding vast majority of file. -This information may include dimensions, quality, length etc... - -Additionally it can also be used to retrieve the mime type for a particular -file and for text files proper language encoding. - - PHP - - stable - 1.0 - 2005-06-30 - - 1) Fixed library detection routines. - - - - - - - - - - - - - - diff --git a/ext/fileinfo/php_fileinfo.h b/ext/fileinfo/php_fileinfo.h deleted file mode 100644 index 66c562172d7a2..0000000000000 --- a/ext/fileinfo/php_fileinfo.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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. | - +----------------------------------------------------------------------+ - | Author: Ilia Alshanetsky | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FILEINFO_H -#define PHP_FILEINFO_H - -extern zend_module_entry fileinfo_module_entry; -#define phpext_fileinfo_ptr &fileinfo_module_entry - -#ifdef PHP_WIN32 -#define PHP_FILEINFO_API __declspec(dllexport) -#else -#define PHP_FILEINFO_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINFO_FUNCTION(fileinfo); - -PHP_FUNCTION(finfo_open); -PHP_FUNCTION(finfo_close); -PHP_FUNCTION(finfo_set_flags); -PHP_FUNCTION(finfo_file); -PHP_FUNCTION(finfo_buffer); - -#ifdef ZTS -#define FILEINFO_G(v) TSRMG(fileinfo_globals_id, zend_fileinfo_globals *, v) -#else -#define FILEINFO_G(v) (fileinfo_globals.v) -#endif - -#endif /* PHP_FILEINFO_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/filepro/CREDITS b/ext/filepro/CREDITS deleted file mode 100644 index c272432c04b2c..0000000000000 --- a/ext/filepro/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FilePro -Chad Robinson diff --git a/ext/filepro/config.m4 b/ext/filepro/config.m4 deleted file mode 100644 index 3b8d24f7ab5fe..0000000000000 --- a/ext/filepro/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(filepro,whether to enable the bundled filePro support, -[ --enable-filepro Enable the bundled read-only filePro support]) - -if test "$PHP_FILEPRO" = "yes"; then - AC_DEFINE(HAVE_FILEPRO, 1, [ ]) - PHP_NEW_EXTENSION(filepro, filepro.c, $ext_shared) -fi diff --git a/ext/filepro/config.w32 b/ext/filepro/config.w32 deleted file mode 100644 index 06848c7767df2..0000000000000 --- a/ext/filepro/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("filepro", "Enable the bundled read-only filePro support.", "no"); - -if (PHP_FILEPRO != "no") { - EXTENSION("filepro", "filepro.c"); - AC_DEFINE('HAVE_FILEPRO', 1, 'filepro support'); -} diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c deleted file mode 100644 index 8da055b729312..0000000000000 --- a/ext/filepro/filepro.c +++ /dev/null @@ -1,614 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chad Robinson | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - filePro 4.x support developed by Chad Robinson, chadr@brttech.com - Contact Chad Robinson at BRT Technical Services Corp. for details. - filePro is a registered trademark by Fiserv, Inc. This file contains - no code or information that is not freely available from the filePro - web site at http://www.fileproplus.com/ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include -#if HAVE_SYS_PARAM_H -#include -#endif -#include -#include "php_globals.h" - -#include "php_filepro.h" -#if HAVE_FILEPRO - -typedef struct fp_field { - char *name; - char *format; - int width; - struct fp_field *next; -} FP_FIELD; - -#ifdef THREAD_SAFE -DWORD FPTls; -static int numthreads=0; - -typedef struct fp_global_struct{ - char *fp_database; - signed int fp_fcount; - signed int fp_keysize; - FP_FIELD *fp_fieldlist; -}fp_global_struct; - -#define FP_GLOBAL(a) fp_globals->a - -#define FP_TLS_VARS \ - fp_global_struct *fp_globals; \ - fp_globals=TlsGetValue(FPTls); - -#else -#define FP_GLOBAL(a) a -#define FP_TLS_VARS -static char *fp_database = NULL; /* Database directory */ -static signed int fp_fcount = -1; /* Column count */ -static signed int fp_keysize = -1; /* Size of key records */ -static FP_FIELD *fp_fieldlist = NULL; /* List of fields */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(filepro) -{ -#ifdef THREAD_SAFE - fp_global_struct *fp_globals; -#ifdef COMPILE_DL_FILEPRO - CREATE_MUTEX(fp_mutex,"FP_TLS"); - SET_MUTEX(fp_mutex); - numthreads++; - if (numthreads==1){ - if ((FPTls=TlsAlloc())==0xFFFFFFFF){ - FREE_MUTEX(fp_mutex); - return 0; - }} - FREE_MUTEX(fp_mutex); -#endif - fp_globals = (fp_global_struct *) LocalAlloc(LPTR, sizeof(fp_global_struct)); - TlsSetValue(FPTls, (void *) fp_globals); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(filepro) -{ - FP_GLOBAL(fp_database)=NULL; - FP_GLOBAL(fp_fcount)=-1; - FP_GLOBAL(fp_keysize)=-1; - FP_GLOBAL(fp_fieldlist)=NULL; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(filepro) -{ - FP_FIELD *tmp, *next; - - if (FP_GLOBAL(fp_database)) { - efree(FP_GLOBAL(fp_database)); - } - - if (FP_GLOBAL(fp_fieldlist)) { - for (tmp = FP_GLOBAL(fp_fieldlist); tmp;) { - efree(tmp->name); - efree(tmp->format); - next = tmp->next; - efree(tmp); - tmp=next; - } - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(filepro) -{ -#ifdef THREAD_SAFE - fp_global_struct *fp_globals; - fp_globals = TlsGetValue(FPTls); - if (fp_globals != 0) - LocalFree((HLOCAL) fp_globals); -#ifdef COMPILE_DL_FILEPRO - SET_MUTEX(fp_mutex); - numthreads--; - if (!numthreads){ - if (!TlsFree(FPTls)){ - FREE_MUTEX(fp_mutex); - return 0; - } - } - FREE_MUTEX(fp_mutex); -#endif -#endif - return SUCCESS; -} -/* }}} */ - -function_entry filepro_functions[] = { - PHP_FE(filepro, NULL) - PHP_FE(filepro_rowcount, NULL) - PHP_FE(filepro_fieldname, NULL) - PHP_FE(filepro_fieldtype, NULL) - PHP_FE(filepro_fieldwidth, NULL) - PHP_FE(filepro_fieldcount, NULL) - PHP_FE(filepro_retrieve, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry filepro_module_entry = { - STANDARD_MODULE_HEADER, - "filepro", - filepro_functions, - PHP_MINIT(filepro), - PHP_MSHUTDOWN(filepro), - PHP_RINIT(filepro), - PHP_RSHUTDOWN(filepro), - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_FILEPRO -ZEND_GET_MODULE(filepro) -#if defined(PHP_WIN32) && defined(THREAD_SAFE) - -/*NOTE: You should have an odbc.def file where you -export DllMain*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - switch( ul_reason_for_call ) { - case DLL_PROCESS_ATTACH: - if ((FPTls=TlsAlloc())==0xFFFFFFFF) { - return 0; - } - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - if (!TlsFree(FPTls)) { - return 0; - } - break; - } - return 1; -} -#endif -#endif - -/* - * LONG filePro(STRING directory) - * - * Read and verify the map file. We store the field count and field info - * internally, which means we become unstable if you modify the table while - * a user is using it! We cannot lock anything since Web connections don't - * provide the ability to later unlock what we locked. Be smart, be safe. - */ -/* {{{ proto bool filepro(string directory) - Read and verify the map file */ -PHP_FUNCTION(filepro) -{ - zval **dir; - FILE *fp; - char workbuf[MAXPATHLEN]; - char readbuf[256]; - char *strtok_buf = NULL; - int i; - FP_FIELD *new_field, *tmp, *next; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dir) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(dir); - - /* free memory */ - if (FP_GLOBAL(fp_database) != NULL) { - efree (FP_GLOBAL(fp_database)); - } - - /* free linked list of fields */ - tmp = FP_GLOBAL(fp_fieldlist); - while (tmp != NULL) { - next = tmp->next; - efree(tmp->name); - efree(tmp->format); - efree(tmp); - tmp = next; - } - - /* init the global vars */ - FP_GLOBAL(fp_database) = NULL; - FP_GLOBAL(fp_fieldlist) = NULL; - FP_GLOBAL(fp_fcount) = -1; - FP_GLOBAL(fp_keysize) = -1; - - snprintf(workbuf, sizeof(workbuf), "%s/map", Z_STRVAL_PP(dir)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open map: [%d] %s", errno, strerror(errno)); - RETURN_FALSE; - } - if (!fgets(readbuf, sizeof(readbuf), fp)) { - fclose(fp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot read map: [%d] %s", errno, strerror(errno)); - RETURN_FALSE; - } - - /* Get the field count, assume the file is readable! */ - if (strcmp(php_strtok_r(readbuf, ":", &strtok_buf), "map")) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Map file corrupt or encrypted"); - RETURN_FALSE; - } - FP_GLOBAL(fp_keysize) = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - php_strtok_r(NULL, ":", &strtok_buf); - FP_GLOBAL(fp_fcount) = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - - /* Read in the fields themselves */ - for (i = 0; i < FP_GLOBAL(fp_fcount); i++) { - if (!fgets(readbuf, sizeof(readbuf), fp)) { - fclose(fp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot read map: [%d] %s", errno, strerror(errno)); - RETURN_FALSE; - } - new_field = emalloc(sizeof(FP_FIELD)); - new_field->next = NULL; - new_field->name = estrdup(php_strtok_r(readbuf, ":", &strtok_buf)); - new_field->width = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - new_field->format = estrdup(php_strtok_r(NULL, ":", &strtok_buf)); - - /* Store in forward-order to save time later */ - if (!FP_GLOBAL(fp_fieldlist)) { - FP_GLOBAL(fp_fieldlist) = new_field; - } else { - for (tmp = FP_GLOBAL(fp_fieldlist); tmp; tmp = tmp->next) { - if (!tmp->next) { - tmp->next = new_field; - tmp = new_field; - } - } - } - } - fclose(fp); - - FP_GLOBAL(fp_database) = estrndup(Z_STRVAL_PP(dir), Z_STRLEN_PP(dir)); - - RETVAL_TRUE; -} -/* }}} */ - - -/* - * LONG filePro_rowcount(void) - * - * Count the used rows in the database. filePro just marks deleted records - * as deleted; they are not removed. Since no counts are maintained we need - * to go in and count records ourselves. - * - * Errors return false, success returns the row count. - */ -/* {{{ proto int filepro_rowcount(void) - Find out how many rows are in a filePro database */ -PHP_FUNCTION(filepro_rowcount) -{ - FILE *fp; - char workbuf[MAXPATHLEN]; - char readbuf[256]; - int recsize = 0, records = 0; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - recsize = FP_GLOBAL(fp_keysize) + 19; /* 20 bytes system info -1 to save time later */ - - /* Now read the records in, moving forward recsize-1 bytes each time */ - snprintf(workbuf, sizeof(workbuf), "%s/key", FP_GLOBAL(fp_database)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open key: [%d] %s", errno, strerror(errno)); - RETURN_FALSE; - } - while (!feof(fp)) { - if (fread(readbuf, 1, 1, fp) == 1) { - if (readbuf[0]) - records++; - fseek(fp, recsize, SEEK_CUR); - } - } - fclose(fp); - - RETVAL_LONG(records); -} -/* }}} */ - - -/* - * STRING filePro_fieldname(LONG field_number) - * - * Errors return false, success returns the name of the field. - */ -/* {{{ proto string filepro_fieldname(int fieldnumber) - Gets the name of a field */ -PHP_FUNCTION(filepro_fieldname) -{ - zval **fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_PP(fno)) { - RETURN_STRING(lp->name, 1); - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate field number %ld.", Z_LVAL_PP(fno)); - - RETVAL_FALSE; -} -/* }}} */ - - -/* - * STRING filePro_fieldtype(LONG field_number) - * - * Errors return false, success returns the type (edit) of the field - */ -/* {{{ proto string filepro_fieldtype(int field_number) - Gets the type of a field */ -PHP_FUNCTION(filepro_fieldtype) -{ - zval **fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_PP(fno)) { - RETURN_STRING(lp->format, 1); - } - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate field number %ld.", Z_LVAL_PP(fno)); - RETVAL_FALSE; -} -/* }}} */ - - -/* - * STRING filePro_fieldwidth(int field_number) - * - * Errors return false, success returns the character width of the field. - */ -/* {{{ proto int filepro_fieldwidth(int field_number) - Gets the width of a field */ -PHP_FUNCTION(filepro_fieldwidth) -{ - zval **fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_PP(fno)) { - RETURN_LONG(lp->width); - } - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate field number %ld.", Z_LVAL_PP(fno)); - RETVAL_FALSE; -} -/* }}} */ - - -/* - * LONG filePro_fieldcount(void) - * - * Errors return false, success returns the field count. - */ -/* {{{ proto int filepro_fieldcount(void) - Find out how many fields are in a filePro database */ -PHP_FUNCTION(filepro_fieldcount) -{ - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - /* Read in the first line from the map file */ - RETVAL_LONG(FP_GLOBAL(fp_fcount)); -} -/* }}} */ - - -/* - * STRING filePro_retrieve(int row_number, int field_number) - * - * Errors return false, success returns the datum. - */ -/* {{{ proto string filepro_retrieve(int row_number, int field_number) - Retrieves data from a filePro database */ -PHP_FUNCTION(filepro_retrieve) -{ - zval **rno, **fno; - FP_FIELD *lp; - FILE *fp; - char workbuf[MAXPATHLEN]; - char *readbuf; - int i, fnum, rnum; - long offset; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &rno, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Must set database directory first!"); - RETURN_FALSE; - } - - convert_to_long_ex(rno); - convert_to_long_ex(fno); - - fnum = Z_LVAL_PP(fno); - rnum = Z_LVAL_PP(rno); - - if (rnum < 0 || fnum < 0 || fnum >= FP_GLOBAL(fp_fcount)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameters out of range"); - RETURN_FALSE; - } - - offset = (rnum + 1) * (FP_GLOBAL(fp_keysize) + 20) + 20; /* Record location */ - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp && i < fnum; lp = lp->next, i++) { - offset += lp->width; - } - if (!lp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot locate field"); - RETURN_FALSE; - } - - /* Now read the record in */ - snprintf(workbuf, sizeof(workbuf), "%s/key", FP_GLOBAL(fp_database)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open key: [%d] %s", errno, strerror(errno)); - fclose(fp); - RETURN_FALSE; - } - fseek(fp, offset, SEEK_SET); - - readbuf = emalloc (lp->width+1); - if (fread(readbuf, lp->width, 1, fp) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot read data: [%d] %s", errno, strerror(errno)); - efree(readbuf); - fclose(fp); - RETURN_FALSE; - } - readbuf[lp->width] = '\0'; - fclose(fp); - RETURN_STRING(readbuf, 0); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/filepro/filepro.dsp b/ext/filepro/filepro.dsp deleted file mode 100644 index af9d7f2c15e17..0000000000000 --- a/ext/filepro/filepro.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="filepro" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=filepro - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "filepro.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "filepro.mak" CFG="filepro - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "filepro - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "filepro - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "filepro - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FILEPRO_EXPORTS" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FILEPRO=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_filepro.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "filepro - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FILEPRO_EXPORTS" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FILEPRO=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_filepro.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "filepro - Win32 Release_TS" -# Name "filepro - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\filepro.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_filepro.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/filepro/package.xml b/ext/filepro/package.xml deleted file mode 100644 index cb118b05436c9..0000000000000 --- a/ext/filepro/package.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - filepro - filePro database access functions - - - ??? - Chad Robinson - chadr@brttech.com - lead - - - -These functions allow read-only access to data stored in filePro databases. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - diff --git a/ext/filepro/php_filepro.h b/ext/filepro/php_filepro.h deleted file mode 100644 index 5193644c4a8ae..0000000000000 --- a/ext/filepro/php_filepro.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chad Robinson | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - filePro 4.x support developed by Chad Robinson, chadr@brttech.com - Contact Chad Robinson at BRT Technical Services Corp. for details. - filePro is a registered trademark by Fiserv, Inc. This file contains - no code or information that is not freely available from the filePro - web site at http://www.fileproplus.com/ -*/ - -#ifndef PHP_FILEPRO_H -#define PHP_FILEPRO_H -#if HAVE_FILEPRO -extern zend_module_entry filepro_module_entry; -#define phpext_filepro_ptr &filepro_module_entry - -PHP_FUNCTION(filepro); -PHP_FUNCTION(filepro_rowcount); -PHP_FUNCTION(filepro_fieldname); -PHP_FUNCTION(filepro_fieldtype); -PHP_FUNCTION(filepro_fieldwidth); -PHP_FUNCTION(filepro_fieldcount); -PHP_FUNCTION(filepro_retrieve); - -PHP_MINIT_FUNCTION(filepro); -PHP_RINIT_FUNCTION(filepro); -PHP_RSHUTDOWN_FUNCTION(filepro); -PHP_MSHUTDOWN_FUNCTION(filepro); -#else -#define phpext_filepro_ptr NULL -#endif -#endif /* PHP_FILEPRO_H */ diff --git a/ext/ftp/CREDITS b/ext/ftp/CREDITS deleted file mode 100644 index bf0920ad80d48..0000000000000 --- a/ext/ftp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FTP -Stefan Esser, Andrew Skalski diff --git a/ext/ftp/config.m4 b/ext/ftp/config.m4 deleted file mode 100644 index c822fcf48f6b8..0000000000000 --- a/ext/ftp/config.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ftp,whether to enable FTP support, -[ --enable-ftp Enable FTP support]) - -PHP_ARG_WITH(openssl-dir,OpenSSL dir for FTP, -[ --with-openssl-dir[=DIR] FTP: openssl install prefix], no, no) - -if test "$PHP_FTP" = "yes"; then - AC_DEFINE(HAVE_FTP,1,[Whether you want FTP support]) - PHP_NEW_EXTENSION(ftp, php_ftp.c ftp.c, $ext_shared) - - if test "$PHP_OPENSSL" != "no" || test "$PHP_OPENSSL_DIR" != "no"; then - PHP_SETUP_OPENSSL(FTP_SHARED_LIBADD) - PHP_SUBST(FTP_SHARED_LIBADD) - fi -fi diff --git a/ext/ftp/config.w32 b/ext/ftp/config.w32 deleted file mode 100644 index c91e350a86a49..0000000000000 --- a/ext/ftp/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("ftp", "ftp support", "yes"); - -if (PHP_FTP == "yes") { - EXTENSION("ftp", "php_ftp.c ftp.c"); - AC_DEFINE('HAVE_FTP', 1, 'Have FTP support'); -} diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c deleted file mode 100644 index 38d972c48da70..0000000000000 --- a/ext/ftp/ftp.c +++ /dev/null @@ -1,1919 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andrew Skalski | - | Stefan Esser (resume functions) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_FTP - -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef PHP_WIN32 -#include -#elif defined(NETWARE) -#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ -#include -#else -#include -#include -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#include -#include -#endif -#include - -#if HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#if HAVE_OPENSSL_EXT -#include -#endif - -#include "ftp.h" -#include "ext/standard/fsock.h" - -/* Additional headers for NetWare */ -#if defined(NETWARE) && !defined(USE_WINSOCK) -#include -#endif - -/* sends an ftp command, returns true on success, false on error. - * it sends the string "cmd args\r\n" if args is non-null, or - * "cmd\r\n" if args is null - */ -static int ftp_putcmd( ftpbuf_t *ftp, - const char *cmd, - const char *args); - -/* wrapper around send/recv to handle timeouts */ -static int my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len); -static int my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len); -static int my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrlen); - -/* reads a line the socket , returns true on success, false on error */ -static int ftp_readline(ftpbuf_t *ftp); - -/* reads an ftp response, returns true on success, false on error */ -static int ftp_getresp(ftpbuf_t *ftp); - -/* sets the ftp transfer type */ -static int ftp_type(ftpbuf_t *ftp, ftptype_t type); - -/* opens up a data stream */ -static databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC); - -/* accepts the data connection, returns updated data buffer */ -static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC); - -/* closes the data connection, returns NULL */ -static databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data); - -/* generic file lister */ -static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC); - -/* IP and port conversion box */ -union ipbox { - struct in_addr ia[2]; - unsigned short s[4]; - unsigned char c[8]; -}; - -/* {{{ ftp_open - */ -ftpbuf_t* -ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC) -{ - ftpbuf_t *ftp; - socklen_t size; - struct timeval tv; - - - /* alloc the ftp structure */ - ftp = ecalloc(1, sizeof(*ftp)); - - tv.tv_sec = timeout_sec; - tv.tv_usec = 0; - - ftp->fd = php_network_connect_socket_to_host(host, - (unsigned short) (port ? port : 21), SOCK_STREAM, - 0, &tv, NULL, NULL, NULL, 0 TSRMLS_CC); - if (ftp->fd == -1) { - goto bail; - } - - /* Default Settings */ - ftp->timeout_sec = timeout_sec; - ftp->nb = 0; - - size = sizeof(ftp->localaddr); - memset(&ftp->localaddr, 0, size); - if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - if (!ftp_getresp(ftp) || ftp->resp != 220) { - goto bail; - } - - return ftp; - -bail: - if (ftp->fd != -1) { - closesocket(ftp->fd); - } - efree(ftp); - return NULL; -} -/* }}} */ - -/* {{{ ftp_close - */ -ftpbuf_t* -ftp_close(ftpbuf_t *ftp) -{ - if (ftp == NULL) { - return NULL; - } - if (ftp->data) { - data_close(ftp, ftp->data); - } - if (ftp->fd != -1) { -#if HAVE_OPENSSL_EXT - if (ftp->ssl_active) { - SSL_shutdown(ftp->ssl_handle); - } -#endif - closesocket(ftp->fd); - } - ftp_gc(ftp); - efree(ftp); - return NULL; -} -/* }}} */ - -/* {{{ ftp_gc - */ -void -ftp_gc(ftpbuf_t *ftp) -{ - if (ftp == NULL) { - return; - } - if (ftp->pwd) { - efree(ftp->pwd); - ftp->pwd = NULL; - } - if (ftp->syst) { - efree(ftp->syst); - ftp->syst = NULL; - } -} -/* }}} */ - -/* {{{ ftp_quit - */ -int -ftp_quit(ftpbuf_t *ftp) -{ - if (ftp == NULL) { - return 0; - } - - if (!ftp_putcmd(ftp, "QUIT", NULL)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 221) { - return 0; - } - - if (ftp->pwd) { - efree(ftp->pwd); - ftp->pwd = NULL; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_login - */ -int -ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) -{ -#if HAVE_OPENSSL_EXT - SSL_CTX *ctx = NULL; -#endif - if (ftp == NULL) { - return 0; - } - -#if HAVE_OPENSSL_EXT - if (ftp->use_ssl && !ftp->ssl_active) { - if (!ftp_putcmd(ftp, "AUTH", "TLS")) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - - if (ftp->resp != 234) { - if (!ftp_putcmd(ftp, "AUTH", "SSL")) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - - if (ftp->resp != 334) { - ftp->use_ssl = 0; - } else { - ftp->old_ssl = 1; - ftp->use_ssl_for_data = 1; - } - } - - /* now enable ssl if we still need to */ - if (ftp->use_ssl) { - ctx = SSL_CTX_new(SSLv23_client_method()); - if (ctx == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL context"); - return 0; - } - - ftp->ssl_handle = SSL_new(ctx); - if (ftp->ssl_handle == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle"); - SSL_CTX_free(ctx); - return 0; - } - - SSL_set_fd(ftp->ssl_handle, ftp->fd); - - if (SSL_connect(ftp->ssl_handle) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS handshake failed"); - SSL_shutdown(ftp->ssl_handle); - return 0; - } - - ftp->ssl_active = 1; - - if (!ftp->old_ssl) { - - /* set protection buffersize to zero */ - if (!ftp_putcmd(ftp, "PBSZ", "0")) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - - /* enable data conn encryption */ - if (!ftp_putcmd(ftp, "PROT", "P")) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - - ftp->use_ssl_for_data = (ftp->resp >= 200 && ftp->resp <=299); - } - } - } -#endif - - if (!ftp_putcmd(ftp, "USER", user)) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - if (ftp->resp == 230) { - return 1; - } - if (ftp->resp != 331) { - return 0; - } - if (!ftp_putcmd(ftp, "PASS", pass)) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - return (ftp->resp == 230); -} -/* }}} */ - -/* {{{ ftp_reinit - */ -int -ftp_reinit(ftpbuf_t *ftp) -{ - if (ftp == NULL) { - return 0; - } - - ftp_gc(ftp); - - ftp->nb = 0; - - if (!ftp_putcmd(ftp, "REIN", NULL)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 220) { - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_syst - */ -const char* -ftp_syst(ftpbuf_t *ftp) -{ - char *syst, *end; - - if (ftp == NULL) { - return NULL; - } - - /* default to cached value */ - if (ftp->syst) { - return ftp->syst; - } - if (!ftp_putcmd(ftp, "SYST", NULL)) { - return NULL; - } - if (!ftp_getresp(ftp) || ftp->resp != 215) { - return NULL; - } - syst = ftp->inbuf; - while (*syst == ' ') { - syst++; - } - if ((end = strchr(syst, ' '))) { - *end = 0; - } - ftp->syst = estrdup(syst); - if (end) { - *end = ' '; - } - return ftp->syst; -} -/* }}} */ - -/* {{{ ftp_pwd - */ -const char* -ftp_pwd(ftpbuf_t *ftp) -{ - char *pwd, *end; - - if (ftp == NULL) { - return NULL; - } - - /* default to cached value */ - if (ftp->pwd) { - return ftp->pwd; - } - if (!ftp_putcmd(ftp, "PWD", NULL)) { - return NULL; - } - if (!ftp_getresp(ftp) || ftp->resp != 257) { - return NULL; - } - /* copy out the pwd from response */ - if ((pwd = strchr(ftp->inbuf, '"')) == NULL) { - return NULL; - } - if ((end = strrchr(++pwd, '"')) == NULL) { - return NULL; - } - ftp->pwd = estrndup(pwd, end - pwd); - - return ftp->pwd; -} -/* }}} */ - -/* {{{ ftp_exec - */ -int -ftp_exec(ftpbuf_t *ftp, const char *cmd) -{ - if (ftp == NULL) { - return 0; - } - if (!ftp_putcmd(ftp, "SITE EXEC", cmd)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 200) { - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_raw - */ -void -ftp_raw(ftpbuf_t *ftp, const char *cmd, zval *return_value) -{ - if (ftp == NULL || cmd == NULL) { - RETURN_NULL(); - } - if (!ftp_putcmd(ftp, cmd, NULL)) { - RETURN_NULL(); - } - array_init(return_value); - while (ftp_readline(ftp)) { - add_next_index_string(return_value, ftp->inbuf, 1); - if (isdigit(ftp->inbuf[0]) && isdigit(ftp->inbuf[1]) && isdigit(ftp->inbuf[2]) && ftp->inbuf[3] == ' ') { - return; - } - } -} -/* }}} */ - -/* {{{ ftp_chdir - */ -int -ftp_chdir(ftpbuf_t *ftp, const char *dir) -{ - if (ftp == NULL) { - return 0; - } - - if (ftp->pwd) { - efree(ftp->pwd); - ftp->pwd = NULL; - } - - if (!ftp_putcmd(ftp, "CWD", dir)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 250) { - return 0; - } - return 1; -} -/* }}} */ - -/* {{{ ftp_cdup - */ -int -ftp_cdup(ftpbuf_t *ftp) -{ - if (ftp == NULL) { - return 0; - } - - if (ftp->pwd) { - efree(ftp->pwd); - ftp->pwd = NULL; - } - - if (!ftp_putcmd(ftp, "CDUP", NULL)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 250) { - return 0; - } - return 1; -} -/* }}} */ - -/* {{{ ftp_mkdir - */ -char* -ftp_mkdir(ftpbuf_t *ftp, const char *dir) -{ - char *mkd, *end; - - if (ftp == NULL) { - return NULL; - } - if (!ftp_putcmd(ftp, "MKD", dir)) { - return NULL; - } - if (!ftp_getresp(ftp) || ftp->resp != 257) { - return NULL; - } - /* copy out the dir from response */ - if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { - mkd = estrdup(dir); - return mkd; - } - if ((end = strrchr(++mkd, '"')) == NULL) { - return NULL; - } - *end = 0; - mkd = estrdup(mkd); - *end = '"'; - - return mkd; -} -/* }}} */ - -/* {{{ ftp_rmdir - */ -int -ftp_rmdir(ftpbuf_t *ftp, const char *dir) -{ - if (ftp == NULL) { - return 0; - } - if (!ftp_putcmd(ftp, "RMD", dir)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 250) { - return 0; - } - return 1; -} -/* }}} */ - -/* {{{ ftp_chmod - */ -int -ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filename_len) -{ - char *buffer; - - if (ftp == NULL || filename_len <= 0) { - return 0; - } - - if (!(buffer = emalloc(32 + filename_len + 1))) { - return 0; - } - - sprintf(buffer, "CHMOD %o %s", mode, filename); - - if (!ftp_putcmd(ftp, "SITE", buffer)) { - efree(buffer); - return 0; - } - - efree(buffer); - - if (!ftp_getresp(ftp) || ftp->resp != 200) { - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_alloc - */ -int -ftp_alloc(ftpbuf_t *ftp, const int size, char **response) -{ - char buffer[64]; - - if (ftp == NULL || size <= 0) { - return 0; - } - - snprintf(buffer, sizeof(buffer) - 1, "%d", size); - - if (!ftp_putcmd(ftp, "ALLO", buffer)) { - return 0; - } - - if (!ftp_getresp(ftp)) { - return 0; - } - - if (response && ftp->inbuf) { - *response = estrdup(ftp->inbuf); - } - - if (ftp->resp < 200 || ftp->resp >= 300) { - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_nlist - */ -char** -ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC) -{ - return ftp_genlist(ftp, "NLST", path TSRMLS_CC); -} -/* }}} */ - -/* {{{ ftp_list - */ -char** -ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC) -{ - return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC); -} -/* }}} */ - -/* {{{ ftp_type - */ -int -ftp_type(ftpbuf_t *ftp, ftptype_t type) -{ - char typechar[2] = "?"; - - if (ftp == NULL) { - return 0; - } - if (type == ftp->type) { - return 1; - } - if (type == FTPTYPE_ASCII) { - typechar[0] = 'A'; - } else if (type == FTPTYPE_IMAGE) { - typechar[0] = 'I'; - } else { - return 0; - } - if (!ftp_putcmd(ftp, "TYPE", typechar)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 200) { - return 0; - } - ftp->type = type; - - return 1; -} -/* }}} */ - -/* {{{ ftp_pasv - */ -int -ftp_pasv(ftpbuf_t *ftp, int pasv) -{ - char *ptr; - union ipbox ipbox; - unsigned long b[6]; - socklen_t n; - struct sockaddr *sa; - struct sockaddr_in *sin; - - if (ftp == NULL) { - return 0; - } - if (pasv && ftp->pasv == 2) { - return 1; - } - ftp->pasv = 0; - if (!pasv) { - return 1; - } - n = sizeof(ftp->pasvaddr); - memset(&ftp->pasvaddr, 0, n); - sa = (struct sockaddr *) &ftp->pasvaddr; - -#if HAVE_IPV6 - if (getpeername(ftp->fd, sa, &n) < 0) { - return 0; - } - if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; - char *endptr, delimiter; - - /* try EPSV first */ - if (!ftp_putcmd(ftp, "EPSV", NULL)) { - return 0; - } - if (!ftp_getresp(ftp)) { - return 0; - } - if (ftp->resp == 229) { - /* parse out the port */ - for (ptr = ftp->inbuf; *ptr && *ptr != '('; ptr++); - if (!*ptr) { - return 0; - } - delimiter = *++ptr; - for (n = 0; *ptr && n < 3; ptr++) { - if (*ptr == delimiter) { - n++; - } - } - - sin6->sin6_port = htons((unsigned short) strtoul(ptr, &endptr, 10)); - if (ptr == endptr || *endptr != delimiter) { - return 0; - } - ftp->pasv = 2; - return 1; - } - } - - /* fall back to PASV */ -#endif - - if (!ftp_putcmd(ftp, "PASV", NULL)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 227) { - return 0; - } - /* parse out the IP and port */ - for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); - n = sscanf(ptr, "%lu,%lu,%lu,%lu,%lu,%lu", &b[0], &b[1], &b[2], &b[3], &b[4], &b[5]); - if (n != 6) { - return 0; - } - for (n = 0; n < 6; n++) { - ipbox.c[n] = (unsigned char) b[n]; - } - sin = (struct sockaddr_in *) sa; - sin->sin_family = AF_INET; - sin->sin_addr = ipbox.ia[0]; - sin->sin_port = ipbox.s[2]; - - ftp->pasv = 2; - - return 1; -} -/* }}} */ - -/* {{{ ftp_get - */ -int -ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) -{ - databuf_t *data = NULL; - int lastch; - size_t rcvd; - char arg[11]; - - if (ftp == NULL) { - return 0; - } - if (!ftp_type(ftp, type)) { - goto bail; - } - - if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { - goto bail; - } - - ftp->data = data; - - if (resumepos > 0) { - if (resumepos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483647 bytes."); - goto bail; - } - sprintf(arg, "%u", resumepos); - if (!ftp_putcmd(ftp, "REST", arg)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 350)) { - goto bail; - } - } - - if (!ftp_putcmd(ftp, "RETR", path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - - if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) { - goto bail; - } - - lastch = 0; - while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { - goto bail; - } - - if (type == FTPTYPE_ASCII) { -#ifndef PHP_WIN32 - char *s; -#endif - char *ptr = data->buf; - char *e = ptr + rcvd; - /* logic depends on the OS EOL - * Win32 -> \r\n - * Everything Else \n - */ -#ifdef PHP_WIN32 - php_stream_write(outstream, ptr, (e - ptr)); - ptr = e; -#else - while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) { - php_stream_write(outstream, ptr, (s - ptr)); - if (*(s + 1) == '\n') { - s++; - php_stream_putc(outstream, '\n'); - } - ptr = s + 1; - } -#endif - if (ptr < e) { - php_stream_write(outstream, ptr, (e - ptr)); - } - } else if (rcvd != php_stream_write(outstream, data->buf, rcvd)) { - goto bail; - } - } - - ftp->data = data = data_close(ftp, data); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - goto bail; - } - - return 1; -bail: - ftp->data = data_close(ftp, data); - return 0; -} -/* }}} */ - -/* {{{ ftp_put - */ -int -ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) -{ - databuf_t *data = NULL; - int size; - char *ptr; - int ch; - char arg[11]; - - if (ftp == NULL) { - return 0; - } - if (!ftp_type(ftp, type)) { - goto bail; - } - if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { - goto bail; - } - ftp->data = data; - - if (startpos > 0) { - if (startpos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes."); - goto bail; - } - sprintf(arg, "%u", startpos); - if (!ftp_putcmd(ftp, "REST", arg)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 350)) { - goto bail; - } - } - - if (!ftp_putcmd(ftp, "STOR", path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) { - goto bail; - } - - size = 0; - ptr = data->buf; - while (!php_stream_eof(instream) && (ch = php_stream_getc(instream))!=EOF) { - /* flush if necessary */ - if (FTP_BUFSIZE - size < 2) { - if (my_send(ftp, data->fd, data->buf, size) != size) { - goto bail; - } - ptr = data->buf; - size = 0; - } - - if (ch == '\n' && type == FTPTYPE_ASCII) { - *ptr++ = '\r'; - size++; - } - - *ptr++ = ch; - size++; - } - - if (size && my_send(ftp, data->fd, data->buf, size) != size) { - goto bail; - } - ftp->data = data = data_close(ftp, data); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - goto bail; - } - return 1; -bail: - ftp->data = data_close(ftp, data); - return 0; -} -/* }}} */ - -/* {{{ ftp_size - */ -int -ftp_size(ftpbuf_t *ftp, const char *path) -{ - if (ftp == NULL) { - return -1; - } - if (!ftp_type(ftp, FTPTYPE_IMAGE)) { - return -1; - } - if (!ftp_putcmd(ftp, "SIZE", path)) { - return -1; - } - if (!ftp_getresp(ftp) || ftp->resp != 213) { - return -1; - } - return atoi(ftp->inbuf); -} -/* }}} */ - -/* {{{ ftp_mdtm - */ -time_t -ftp_mdtm(ftpbuf_t *ftp, const char *path) -{ - time_t stamp; - struct tm *gmt, tmbuf; - struct tm tm; - char *ptr; - int n; - - if (ftp == NULL) { - return -1; - } - if (!ftp_putcmd(ftp, "MDTM", path)) { - return -1; - } - if (!ftp_getresp(ftp) || ftp->resp != 213) { - return -1; - } - /* parse out the timestamp */ - for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); - n = sscanf(ptr, "%4u%2u%2u%2u%2u%2u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (n != 6) { - return -1; - } - tm.tm_year -= 1900; - tm.tm_mon--; - tm.tm_isdst = -1; - - /* figure out the GMT offset */ - stamp = time(NULL); - gmt = php_gmtime_r(&stamp, &tmbuf); - gmt->tm_isdst = -1; - - /* apply the GMT offset */ - tm.tm_sec += stamp - mktime(gmt); - tm.tm_isdst = gmt->tm_isdst; - - stamp = mktime(&tm); - - return stamp; -} -/* }}} */ - -/* {{{ ftp_delete - */ -int -ftp_delete(ftpbuf_t *ftp, const char *path) -{ - if (ftp == NULL) { - return 0; - } - if (!ftp_putcmd(ftp, "DELE", path)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 250) { - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ ftp_rename - */ -int -ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) -{ - if (ftp == NULL) { - return 0; - } - if (!ftp_putcmd(ftp, "RNFR", src)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 350) { - return 0; - } - if (!ftp_putcmd(ftp, "RNTO", dest)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp != 250) { - return 0; - } - return 1; -} -/* }}} */ - -/* {{{ ftp_site - */ -int -ftp_site(ftpbuf_t *ftp, const char *cmd) -{ - if (ftp == NULL) { - return 0; - } - if (!ftp_putcmd(ftp, "SITE", cmd)) { - return 0; - } - if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) { - return 0; - } - - return 1; -} -/* }}} */ - -/* static functions */ - -/* {{{ ftp_putcmd - */ -int -ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) -{ - int size; - char *data; - - /* build the output buffer */ - if (args && args[0]) { - /* "cmd args\r\n\0" */ - if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) { - return 0; - } - size = sprintf(ftp->outbuf, "%s %s\r\n", cmd, args); - } else { - /* "cmd\r\n\0" */ - if (strlen(cmd) + 3 > FTP_BUFSIZE) { - return 0; - } - size = sprintf(ftp->outbuf, "%s\r\n", cmd); - } - - data = ftp->outbuf; - - if (my_send(ftp, ftp->fd, data, size) != size) { - return 0; - } - return 1; -} -/* }}} */ - -/* {{{ ftp_readline - */ -int -ftp_readline(ftpbuf_t *ftp) -{ - int size, rcvd; - char *data, *eol; - - /* shift the extra to the front */ - size = FTP_BUFSIZE; - rcvd = 0; - if (ftp->extra) { - memmove(ftp->inbuf, ftp->extra, ftp->extralen); - rcvd = ftp->extralen; - } - - data = ftp->inbuf; - - do { - size -= rcvd; - for (eol = data; rcvd; rcvd--, eol++) { - if (*eol == '\r') { - *eol = 0; - ftp->extra = eol + 1; - if (rcvd > 1 && *(eol + 1) == '\n') { - ftp->extra++; - rcvd--; - } - if ((ftp->extralen = --rcvd) == 0) { - ftp->extra = NULL; - } - return 1; - } else if (*eol == '\n') { - *eol = 0; - ftp->extra = eol + 1; - if ((ftp->extralen = --rcvd) == 0) { - ftp->extra = NULL; - } - return 1; - } - } - - data = eol; - if ((rcvd = my_recv(ftp, ftp->fd, data, size)) < 1) { - return 0; - } - } while (size); - - return 0; -} -/* }}} */ - -/* {{{ ftp_getresp - */ -int -ftp_getresp(ftpbuf_t *ftp) -{ - char *buf; - - if (ftp == NULL) { - return 0; - } - buf = ftp->inbuf; - ftp->resp = 0; - - while (1) { - - if (!ftp_readline(ftp)) { - return 0; - } - - /* Break out when the end-tag is found */ - if (isdigit(ftp->inbuf[0]) && isdigit(ftp->inbuf[1]) && isdigit(ftp->inbuf[2]) && ftp->inbuf[3] == ' ') { - break; - } - } - - /* translate the tag */ - if (!isdigit(ftp->inbuf[0]) || !isdigit(ftp->inbuf[1]) || !isdigit(ftp->inbuf[2])) { - return 0; - } - - ftp->resp = 100 * (ftp->inbuf[0] - '0') + 10 * (ftp->inbuf[1] - '0') + (ftp->inbuf[2] - '0'); - - memmove(ftp->inbuf, ftp->inbuf + 4, FTP_BUFSIZE - 4); - - if (ftp->extra) { - ftp->extra -= 4; - } - return 1; -} -/* }}} */ - -/* {{{ my_send - */ -int -my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) -{ - int n, size, sent; - - size = len; - while (size) { - n = php_pollfd_for_ms(s, POLLOUT, ftp->timeout_sec * 1000); - - if (n < 1) { - -#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) - if (n == 0) { - errno = ETIMEDOUT; - } -#endif - return -1; - } - -#if HAVE_OPENSSL_EXT - if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { - sent = SSL_write(ftp->ssl_handle, buf, size); - } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { - sent = SSL_write(ftp->data->ssl_handle, buf, size); - } else { -#endif - sent = send(s, buf, size, 0); -#if HAVE_OPENSSL_EXT - } -#endif - if (sent == -1) { - return -1; - } - - buf = (char*) buf + sent; - size -= sent; - } - - return len; -} -/* }}} */ - -/* {{{ my_recv - */ -int -my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) -{ - int n, nr_bytes; - - n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); - if (n < 1) { -#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) - if (n == 0) { - errno = ETIMEDOUT; - } -#endif - return -1; - } - -#if HAVE_OPENSSL_EXT - if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { - nr_bytes = SSL_read(ftp->ssl_handle, buf, len); - } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { - nr_bytes = SSL_read(ftp->data->ssl_handle, buf, len); - } else { -#endif - nr_bytes = recv(s, buf, len, 0); -#if HAVE_OPENSSL_EXT - } -#endif - return (nr_bytes); -} -/* }}} */ - -/* {{{ data_available - */ -int -data_available(ftpbuf_t *ftp, php_socket_t s) -{ - int n; - - n = php_pollfd_for_ms(s, PHP_POLLREADABLE, 1000); - if (n < 1) { -#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) - if (n == 0) { - errno = ETIMEDOUT; - } -#endif - return 0; - } - - return 1; -} -/* }}} */ -/* {{{ data_writeable - */ -int -data_writeable(ftpbuf_t *ftp, php_socket_t s) -{ - int n; - - n = php_pollfd_for_ms(s, POLLOUT, 1000); - if (n < 1) { -#ifndef PHP_WIN32 - if (n == 0) { - errno = ETIMEDOUT; - } -#endif - return 0; - } - - return 1; -} -/* }}} */ - -/* {{{ my_accept - */ -int -my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrlen) -{ - int n; - - n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); - if (n < 1) { -#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) - if (n == 0) { - errno = ETIMEDOUT; - } -#endif - return -1; - } - - return accept(s, addr, addrlen); -} -/* }}} */ - -/* {{{ ftp_getdata - */ -databuf_t* -ftp_getdata(ftpbuf_t *ftp TSRMLS_DC) -{ - int fd = -1; - databuf_t *data; - php_sockaddr_storage addr; - struct sockaddr *sa; - socklen_t size; - union ipbox ipbox; - char arg[sizeof("255, 255, 255, 255, 255, 255")]; - struct timeval tv; - - - /* ask for a passive connection if we need one */ - if (ftp->pasv && !ftp_pasv(ftp, 1)) { - return NULL; - } - /* alloc the data structure */ - data = ecalloc(1, sizeof(*data)); - data->listener = -1; - data->fd = -1; - data->type = ftp->type; - - sa = (struct sockaddr *) &ftp->localaddr; - /* bind/listen */ - if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - /* passive connection handler */ - if (ftp->pasv) { - /* clear the ready status */ - ftp->pasv = 1; - - /* connect */ - /* Win 95/98 seems not to like size > sizeof(sockaddr_in) */ - size = php_sockaddr_size(&ftp->pasvaddr); - tv.tv_sec = ftp->timeout_sec; - tv.tv_usec = 0; - if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - data->fd = fd; - - ftp->data = data; - return data; - } - - - /* active (normal) connection */ - - /* bind to a local address */ - php_any_addr(sa->sa_family, &addr, 0); - size = php_sockaddr_size(&addr); - - if (bind(fd, (struct sockaddr*) &addr, size) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - if (listen(fd, 5) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno); - goto bail; - } - - data->listener = fd; - -#if HAVE_IPV6 - if (sa->sa_family == AF_INET6) { - /* need to use EPRT */ - char eprtarg[INET6_ADDRSTRLEN + sizeof("|x||xxxxx|")]; - char out[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &((struct sockaddr_in6*) sa)->sin6_addr, out, sizeof(out)); - sprintf(eprtarg, "|2|%s|%hu|", out, ntohs(((struct sockaddr_in6 *) &addr)->sin6_port)); - - if (!ftp_putcmd(ftp, "EPRT", eprtarg)) { - goto bail; - } - - if (!ftp_getresp(ftp) || ftp->resp != 200) { - goto bail; - } - - ftp->data = data; - return data; - } -#endif - - /* send the PORT */ - ipbox.ia[0] = ((struct sockaddr_in*) sa)->sin_addr; - ipbox.s[2] = ((struct sockaddr_in*) &addr)->sin_port; - sprintf(arg, "%u,%u,%u,%u,%u,%u", ipbox.c[0], ipbox.c[1], ipbox.c[2], ipbox.c[3], ipbox.c[4], ipbox.c[5]); - - if (!ftp_putcmd(ftp, "PORT", arg)) { - goto bail; - } - if (!ftp_getresp(ftp) || ftp->resp != 200) { - goto bail; - } - - ftp->data = data; - return data; - -bail: - if (fd != -1) { - closesocket(fd); - } - efree(data); - return NULL; -} -/* }}} */ - -/* {{{ data_accept - */ -databuf_t* -data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) -{ - php_sockaddr_storage addr; - socklen_t size; - -#if HAVE_OPENSSL_EXT - SSL_CTX *ctx; -#endif - - if (data->fd != -1) { - goto data_accepted; - } - size = sizeof(addr); - data->fd = my_accept(ftp, data->listener, (struct sockaddr*) &addr, &size); - closesocket(data->listener); - data->listener = -1; - - if (data->fd == -1) { - efree(data); - return NULL; - } - -data_accepted: -#if HAVE_OPENSSL_EXT - - /* now enable ssl if we need to */ - if (ftp->use_ssl && ftp->use_ssl_for_data) { - ctx = SSL_CTX_new(SSLv23_client_method()); - if (ctx == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context"); - return 0; - } - - data->ssl_handle = SSL_new(ctx); - if (data->ssl_handle == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle"); - SSL_CTX_free(ctx); - return 0; - } - - - SSL_set_fd(data->ssl_handle, data->fd); - - if (ftp->old_ssl) { - SSL_copy_session_id(data->ssl_handle, ftp->ssl_handle); - } - - if (SSL_connect(data->ssl_handle) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed"); - SSL_shutdown(data->ssl_handle); - return 0; - } - - data->ssl_active = 1; - } - -#endif - - return data; -} -/* }}} */ - -/* {{{ data_close - */ -databuf_t* -data_close(ftpbuf_t *ftp, databuf_t *data) -{ - if (data == NULL) { - return NULL; - } - if (data->listener != -1) { -#if HAVE_OPENSSL_EXT - if (data->ssl_active) { - SSL_shutdown(data->ssl_handle); - data->ssl_active = 0; - } -#endif - closesocket(data->listener); - } - if (data->fd != -1) { -#if HAVE_OPENSSL_EXT - if (data->ssl_active) { - SSL_shutdown(data->ssl_handle); - data->ssl_active = 0; - } -#endif - closesocket(data->fd); - } - if (ftp) { - ftp->data = NULL; - } - efree(data); - return NULL; -} -/* }}} */ - -/* {{{ ftp_genlist - */ -char** -ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) -{ - php_stream *tmpstream = NULL; - databuf_t *data = NULL; - char *ptr; - int ch, lastch; - int size, rcvd; - int lines; - char **ret = NULL; - char **entry; - char *text; - - - if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory."); - return NULL; - } - - if (!ftp_type(ftp, FTPTYPE_ASCII)) { - goto bail; - } - - if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { - goto bail; - } - ftp->data = data; - - if (!ftp_putcmd(ftp, cmd, path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - - /* pull data buffer into tmpfile */ - if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) { - goto bail; - } - size = 0; - lines = 0; - lastch = 0; - while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { - goto bail; - } - - php_stream_write(tmpstream, data->buf, rcvd); - - size += rcvd; - for (ptr = data->buf; rcvd; rcvd--, ptr++) { - if (*ptr == '\n' && lastch == '\r') { - lines++; - } else { - size++; - } - lastch = *ptr; - } - } - - ftp->data = data = data_close(ftp, data); - - php_stream_rewind(tmpstream); - - ret = safe_emalloc((lines + 1), sizeof(char**), size * sizeof(char*)); - - entry = ret; - text = (char*) (ret + lines + 1); - *entry = text; - lastch = 0; - while ((ch = php_stream_getc(tmpstream)) != EOF) { - if (ch == '\n' && lastch == '\r') { - *(text - 1) = 0; - *++entry = text; - } else { - *text++ = ch; - } - lastch = ch; - } - *entry = NULL; - - php_stream_close(tmpstream); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - efree(ret); - return NULL; - } - - return ret; -bail: - ftp->data = data_close(ftp, data); - php_stream_close(tmpstream); - if (ret) - efree(ret); - return NULL; -} -/* }}} */ - -/* {{{ ftp_nb_get - */ -int -ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) -{ - databuf_t *data = NULL; - char arg[11]; - - if (ftp == NULL) { - goto bail; - } - - if (!ftp_type(ftp, type)) { - goto bail; - } - - if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { - goto bail; - } - - if (resumepos>0) { - /* We are working on an architecture that supports 64-bit integers - * since php is 32 bit by design, we bail out with warning - */ - if (resumepos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483648 bytes."); - goto bail; - } - sprintf(arg, "%u", resumepos); - if (!ftp_putcmd(ftp, "REST", arg)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 350)) { - goto bail; - } - } - - if (!ftp_putcmd(ftp, "RETR", path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - - if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) { - goto bail; - } - - ftp->data = data; - ftp->stream = outstream; - ftp->lastch = 0; - ftp->nb = 1; - - return (ftp_nb_continue_read(ftp TSRMLS_CC)); - -bail: - ftp->data = data_close(ftp, data); - return PHP_FTP_FAILED; -} -/* }}} */ - -/* {{{ ftp_nb_continue_read - */ -int -ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC) -{ - databuf_t *data = NULL; - char *ptr; - int lastch; - size_t rcvd; - ftptype_t type; - - data = ftp->data; - - /* check if there is already more data */ - if (!data_available(ftp, data->fd)) { - return PHP_FTP_MOREDATA; - } - - type = ftp->type; - - lastch = ftp->lastch; - if ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { - goto bail; - } - - if (type == FTPTYPE_ASCII) { - for (ptr = data->buf; rcvd; rcvd--, ptr++) { - if (lastch == '\r' && *ptr != '\n') { - php_stream_putc(ftp->stream, '\r'); - } - if (*ptr != '\r') { - php_stream_putc(ftp->stream, *ptr); - } - lastch = *ptr; - } - } else if (rcvd != php_stream_write(ftp->stream, data->buf, rcvd)) { - goto bail; - } - - ftp->lastch = lastch; - return PHP_FTP_MOREDATA; - } - - if (type == FTPTYPE_ASCII && lastch == '\r') { - php_stream_putc(ftp->stream, '\r'); - } - - ftp->data = data = data_close(ftp, data); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - goto bail; - } - - ftp->nb = 0; - return PHP_FTP_FINISHED; -bail: - ftp->nb = 0; - ftp->data = data_close(ftp, data); - return PHP_FTP_FAILED; -} -/* }}} */ - -/* {{{ ftp_nb_put - */ -int -ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) -{ - databuf_t *data = NULL; - char arg[11]; - - if (ftp == NULL) { - return 0; - } - if (!ftp_type(ftp, type)) { - goto bail; - } - if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { - goto bail; - } - if (startpos > 0) { - if (startpos > 2147483647) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes."); - goto bail; - } - sprintf(arg, "%u", startpos); - if (!ftp_putcmd(ftp, "REST", arg)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 350)) { - goto bail; - } - } - - if (!ftp_putcmd(ftp, "STOR", path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) { - goto bail; - } - ftp->data = data; - ftp->stream = instream; - ftp->lastch = 0; - ftp->nb = 1; - - return (ftp_nb_continue_write(ftp TSRMLS_CC)); - -bail: - ftp->data = data_close(ftp, data); - return PHP_FTP_FAILED; -} -/* }}} */ - - -/* {{{ ftp_nb_continue_write - */ -int -ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC) -{ - int size; - char *ptr; - int ch; - - /* check if we can write more data */ - if (!data_writeable(ftp, ftp->data->fd)) { - return PHP_FTP_MOREDATA; - } - - size = 0; - ptr = ftp->data->buf; - while (!php_stream_eof(ftp->stream) && (ch = php_stream_getc(ftp->stream)) != EOF) { - - if (ch == '\n' && ftp->type == FTPTYPE_ASCII) { - *ptr++ = '\r'; - size++; - } - - *ptr++ = ch; - size++; - - /* flush if necessary */ - if (FTP_BUFSIZE - size < 2) { - if (my_send(ftp, ftp->data->fd, ftp->data->buf, size) != size) { - goto bail; - } - return PHP_FTP_MOREDATA; - } - } - - if (size && my_send(ftp, ftp->data->fd, ftp->data->buf, size) != size) { - goto bail; - } - ftp->data = data_close(ftp, ftp->data); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - goto bail; - } - ftp->nb = 0; - return PHP_FTP_FINISHED; -bail: - ftp->data = data_close(ftp, ftp->data); - ftp->nb = 0; - return PHP_FTP_FAILED; -} -/* }}} */ - -#endif /* HAVE_FTP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h deleted file mode 100644 index f5dc18c203ad6..0000000000000 --- a/ext/ftp/ftp.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andrew Skalski | - | Stefan Esser (resume functions) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef FTP_H -#define FTP_H - -#include "php_network.h" - -#include -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#define FTP_DEFAULT_TIMEOUT 90 -#define FTP_DEFAULT_AUTOSEEK 1 -#define PHP_FTP_FAILED 0 -#define PHP_FTP_FINISHED 1 -#define PHP_FTP_MOREDATA 2 - -/* XXX this should be configurable at runtime XXX */ -#define FTP_BUFSIZE 4096 - -typedef enum ftptype { - FTPTYPE_ASCII, - FTPTYPE_IMAGE -} ftptype_t; - -typedef struct databuf -{ - int listener; /* listener socket */ - php_socket_t fd; /* data connection */ - ftptype_t type; /* transfer type */ - char buf[FTP_BUFSIZE]; /* data buffer */ -#if HAVE_OPENSSL_EXT - SSL *ssl_handle; /* ssl handle */ - int ssl_active; /* flag if ssl is active or not */ -#endif -} databuf_t; - -typedef struct ftpbuf -{ - php_socket_t fd; /* control connection */ - php_sockaddr_storage localaddr; /* local address */ - int resp; /* last response code */ - char inbuf[FTP_BUFSIZE]; /* last response text */ - char *extra; /* extra characters */ - int extralen; /* number of extra chars */ - char outbuf[FTP_BUFSIZE]; /* command output buffer */ - char *pwd; /* cached pwd */ - char *syst; /* cached system type */ - ftptype_t type; /* current transfer type */ - int pasv; /* 0=off; 1=pasv; 2=ready */ - php_sockaddr_storage pasvaddr; /* passive mode address */ - long timeout_sec; /* User configureable timeout (seconds) */ - int autoseek; /* User configureable autoseek flag */ - - int nb; /* "nonblocking" transfer in progress */ - databuf_t *data; /* Data connection for "nonblocking" transfers */ - php_stream *stream; /* output stream for "nonblocking" transfers */ - int lastch; /* last char of previous call */ - int direction; /* recv = 0 / send = 1 */ - int closestream;/* close or not close stream */ -#if HAVE_OPENSSL_EXT - int use_ssl; /* enable(1) or disable(0) ssl */ - int use_ssl_for_data; /* en/disable ssl for the dataconnection */ - int old_ssl; /* old mode = forced data encryption */ - SSL *ssl_handle; /* handle for control connection */ - int ssl_active; /* ssl active on control conn */ -#endif - -} ftpbuf_t; - - - -/* open a FTP connection, returns ftpbuf (NULL on error) - * port is the ftp port in network byte order, or 0 for the default - */ -ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC); - -/* quits from the ftp session (it still needs to be closed) - * return true on success, false on error - */ -int ftp_quit(ftpbuf_t *ftp); - -/* frees up any cached data held in the ftp buffer */ -void ftp_gc(ftpbuf_t *ftp); - -/* close the FTP connection and return NULL */ -ftpbuf_t* ftp_close(ftpbuf_t *ftp); - -/* logs into the FTP server, returns true on success, false on error */ -int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC); - -/* reinitializes the connection, returns true on success, false on error */ -int ftp_reinit(ftpbuf_t *ftp); - -/* returns the remote system type (NULL on error) */ -const char* ftp_syst(ftpbuf_t *ftp); - -/* returns the present working directory (NULL on error) */ -const char* ftp_pwd(ftpbuf_t *ftp); - -/* exec a command [special features], return true on success, false on error */ -int ftp_exec(ftpbuf_t *ftp, const char *cmd); - -/* send a raw ftp command, return response as a hashtable, NULL on error */ -void ftp_raw(ftpbuf_t *ftp, const char *cmd, zval *return_value); - -/* changes directories, return true on success, false on error */ -int ftp_chdir(ftpbuf_t *ftp, const char *dir); - -/* changes to parent directory, return true on success, false on error */ -int ftp_cdup(ftpbuf_t *ftp); - -/* creates a directory, return the directory name on success, NULL on error. - * the return value must be freed - */ -char* ftp_mkdir(ftpbuf_t *ftp, const char *dir); - -/* removes a directory, return true on success, false on error */ -int ftp_rmdir(ftpbuf_t *ftp, const char *dir); - -/* Set permissions on a file */ -int ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filename_len); - -/* Allocate space on remote server with ALLO command - * Many servers will respond with 202 Allocation not necessary, - * however some servers will not accept STOR or APPE until ALLO is confirmed. - * If response is passed, it is estrdup()ed from ftp->inbuf and must be freed - * or assigned to a zval returned to the user */ -int ftp_alloc(ftpbuf_t *ftp, const int size, char **response); - -/* returns a NULL-terminated array of filenames in the given path - * or NULL on error. the return array must be freed (but don't - * free the array elements) - */ -char** ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC); - -/* returns a NULL-terminated array of lines returned by the ftp - * LIST command for the given path or NULL on error. the return - * array must be freed (but don't - * free the array elements) - */ -char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC); - -/* switches passive mode on or off - * returns true on success, false on error - */ -int ftp_pasv(ftpbuf_t *ftp, int pasv); - -/* retrieves a file and saves its contents to outfp - * returns true on success, false on error - */ -int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); - -/* stores the data from a file, socket, or process as a file on the remote server - * returns true on success, false on error - */ -int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); - -/* returns the size of the given file, or -1 on error */ -int ftp_size(ftpbuf_t *ftp, const char *path); - -/* returns the last modified time of the given file, or -1 on error */ -time_t ftp_mdtm(ftpbuf_t *ftp, const char *path); - -/* renames a file on the server */ -int ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest); - -/* deletes the file from the server */ -int ftp_delete(ftpbuf_t *ftp, const char *path); - -/* sends a SITE command to the server */ -int ftp_site(ftpbuf_t *ftp, const char *cmd); - -/* retrieves part of a file and saves its contents to outfp - * returns true on success, false on error - */ -int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); - -/* stores the data from a file, socket, or process as a file on the remote server - * returns true on success, false on error - */ -int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); - -/* continues a previous nb_(f)get command - */ -int ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC); - -/* continues a previous nb_(f)put command - */ -int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC); - - -#endif diff --git a/ext/ftp/package.xml b/ext/ftp/package.xml deleted file mode 100644 index c1152cb3e8f49..0000000000000 --- a/ext/ftp/package.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - ftp - File Transfer Protocol functions - - - ??? - Andrew Skalski - askalski@chek.com - lead - - - sesser - Stefan Esser - sesser@php.net - lead - - - -The functions in this extension implement client access to file -servers speaking the File Transfer Protocol (FTP) as defined in -http://www.faqs.org/rfcs/rfc959. This extension is meant for -detailed access to an FTP server providing a wide range of -control to the executing script. If you only wish to read from -or write to a file on an FTP server, consider using the ftp:// -wrapper with the filesystem functions which provide a simpler -and more intuitive interface. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c deleted file mode 100644 index 245f480cde5cc..0000000000000 --- a/ext/ftp/php_ftp.c +++ /dev/null @@ -1,1253 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andrew Skalski | - | Stefan Esser (resume functions) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if defined(NETWARE) && defined(USE_WINSOCK) -#include -#endif - -#if HAVE_OPENSSL_EXT -# include -#endif - -#if HAVE_FTP - -#include "ext/standard/info.h" -#include "ext/standard/file.h" - -#include "php_ftp.h" -#include "ftp.h" - -static int le_ftpbuf; -#define le_ftpbuf_name "FTP Buffer" - -static - ZEND_BEGIN_ARG_INFO(third_and_rest_force_ref, 1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO() - -function_entry php_ftp_functions[] = { - PHP_FE(ftp_connect, NULL) -#if HAVE_OPENSSL_EXT - PHP_FE(ftp_ssl_connect, NULL) -#endif - PHP_FE(ftp_login, NULL) - PHP_FE(ftp_pwd, NULL) - PHP_FE(ftp_cdup, NULL) - PHP_FE(ftp_chdir, NULL) - PHP_FE(ftp_exec, NULL) - PHP_FE(ftp_raw, NULL) - PHP_FE(ftp_mkdir, NULL) - PHP_FE(ftp_rmdir, NULL) - PHP_FE(ftp_chmod, NULL) - PHP_FE(ftp_alloc, third_and_rest_force_ref) - PHP_FE(ftp_nlist, NULL) - PHP_FE(ftp_rawlist, NULL) - PHP_FE(ftp_systype, NULL) - PHP_FE(ftp_pasv, NULL) - PHP_FE(ftp_get, NULL) - PHP_FE(ftp_fget, NULL) - PHP_FE(ftp_put, NULL) - PHP_FE(ftp_fput, NULL) - PHP_FE(ftp_size, NULL) - PHP_FE(ftp_mdtm, NULL) - PHP_FE(ftp_rename, NULL) - PHP_FE(ftp_delete, NULL) - PHP_FE(ftp_site, NULL) - PHP_FE(ftp_close, NULL) - PHP_FE(ftp_set_option, NULL) - PHP_FE(ftp_get_option, NULL) - PHP_FE(ftp_nb_fget, NULL) - PHP_FE(ftp_nb_get, NULL) - PHP_FE(ftp_nb_continue, NULL) - PHP_FE(ftp_nb_put, NULL) - PHP_FE(ftp_nb_fput, NULL) - PHP_FALIAS(ftp_quit, ftp_close, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry php_ftp_module_entry = { - STANDARD_MODULE_HEADER, - "ftp", - php_ftp_functions, - PHP_MINIT(ftp), - NULL, - NULL, - NULL, - PHP_MINFO(ftp), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#if COMPILE_DL_FTP -ZEND_GET_MODULE(php_ftp) -#endif - -static void ftp_destructor_ftpbuf(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr; - - ftp_close(ftp); -} - -PHP_MINIT_FUNCTION(ftp) -{ - le_ftpbuf = zend_register_list_destructors_ex(ftp_destructor_ftpbuf, NULL, le_ftpbuf_name, module_number); - REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_BINARY", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_IMAGE", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_AUTORESUME", PHP_FTP_AUTORESUME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_TIMEOUT_SEC", PHP_FTP_OPT_TIMEOUT_SEC, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_AUTOSEEK", PHP_FTP_OPT_AUTOSEEK, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_FAILED", PHP_FTP_FAILED, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_FINISHED", PHP_FTP_FINISHED, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_MOREDATA", PHP_FTP_MOREDATA, CONST_PERSISTENT | CONST_CS); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(ftp) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "FTP support", "enabled"); - php_info_print_table_end(); -} - -#define XTYPE(xtype, mode) { \ - if (mode != FTPTYPE_ASCII && mode != FTPTYPE_IMAGE) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \ - RETURN_FALSE; \ - } \ - xtype = mode; \ - } - - -/* {{{ proto resource ftp_connect(string host [, int port [, int timeout]]) - Opens a FTP stream */ -PHP_FUNCTION(ftp_connect) -{ - ftpbuf_t *ftp; - char *host; - int host_len; - long port = 0; - long timeout_sec = FTP_DEFAULT_TIMEOUT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { - return; - } - - if (timeout_sec <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); - RETURN_FALSE; - } - - /* connect */ - if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) { - RETURN_FALSE; - } - - /* autoseek for resuming */ - ftp->autoseek = FTP_DEFAULT_AUTOSEEK; -#if HAVE_OPENSSL_EXT - /* disable ssl */ - ftp->use_ssl = 0; -#endif - - ZEND_REGISTER_RESOURCE(return_value, ftp, le_ftpbuf); -} -/* }}} */ - -#if HAVE_OPENSSL_EXT -/* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout]]) - Opens a FTP-SSL stream */ -PHP_FUNCTION(ftp_ssl_connect) -{ - ftpbuf_t *ftp; - char *host; - int host_len; - long port = 0; - long timeout_sec = FTP_DEFAULT_TIMEOUT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { - return; - } - - if (timeout_sec <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); - RETURN_FALSE; - } - - /* connect */ - if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) { - RETURN_FALSE; - } - - /* autoseek for resuming */ - ftp->autoseek = FTP_DEFAULT_AUTOSEEK; - /* enable ssl */ - ftp->use_ssl = 1; - - ZEND_REGISTER_RESOURCE(return_value, ftp, le_ftpbuf); -} -/* }}} */ -#endif - -/* {{{ proto bool ftp_login(resource stream, string username, string password) - Logs into the FTP server */ -PHP_FUNCTION(ftp_login) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *user, *pass; - int user_len, pass_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* log in */ - if (!ftp_login(ftp, user, pass TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string ftp_pwd(resource stream) - Returns the present working directory */ -PHP_FUNCTION(ftp_pwd) -{ - zval *z_ftp; - ftpbuf_t *ftp; - const char *pwd; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!(pwd = ftp_pwd(ftp))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING((char*) pwd, 1); -} -/* }}} */ - -/* {{{ proto bool ftp_cdup(resource stream) - Changes to the parent directory */ -PHP_FUNCTION(ftp_cdup) -{ - zval *z_ftp; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp_cdup(ftp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_chdir(resource stream, string directory) - Changes directories */ -PHP_FUNCTION(ftp_chdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* change directories */ - if (!ftp_chdir(ftp, dir)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_exec(resource stream, string command) - Requests execution of a program on the FTP server */ -PHP_FUNCTION(ftp_exec) -{ - pval *z_ftp; - ftpbuf_t *ftp; - char *cmd; - int cmd_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* execute serverside command */ - if (!ftp_exec(ftp, cmd)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array ftp_raw(resource stream, string command) - Sends a literal command to the FTP server */ -PHP_FUNCTION(ftp_raw) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *cmd; - int cmd_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* execute arbitrary ftp command */ - ftp_raw(ftp, cmd, return_value); -} -/* }}} */ - -/* {{{ proto string ftp_mkdir(resource stream, string directory) - Creates a directory and returns the absolute path for the new directory or false on error */ -PHP_FUNCTION(ftp_mkdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir, *tmp; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* create directorie */ - if (NULL == (tmp = ftp_mkdir(ftp, dir))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING(tmp, 0); -} -/* }}} */ - -/* {{{ proto bool ftp_rmdir(resource stream, string directory) - Removes a directory */ -PHP_FUNCTION(ftp_rmdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* remove directorie */ - if (!ftp_rmdir(ftp, dir)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ftp_chmod(resource stream, int mode, string filename) - Sets permissions on a file */ -PHP_FUNCTION(ftp_chmod) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *filename; - int filename_len; - long mode; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &z_ftp, &mode, &filename, &filename_len) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp_chmod(ftp, mode, filename, filename_len)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_LONG(mode); -} -/* }}} */ - -/* {{{ proto bool ftp_alloc(resource stream, int size[, &response]) - Attempt to allocate space on the remote FTP server */ -PHP_FUNCTION(ftp_alloc) -{ - zval *z_ftp, *zresponse = NULL; - ftpbuf_t *ftp; - long size, ret; - char *response = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &z_ftp, &size, &zresponse) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); - if (response) { - zval_dtor(zresponse); - ZVAL_STRING(zresponse, response, 0); - } - - if (!ret) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array ftp_nlist(resource stream, string directory) - Returns an array of filenames in the given directory */ -PHP_FUNCTION(ftp_nlist) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char **nlist, **ptr, *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get list of files */ - if (NULL == (nlist = ftp_nlist(ftp, dir TSRMLS_CC))) { - RETURN_FALSE; - } - - array_init(return_value); - for (ptr = nlist; *ptr; ptr++) { - add_next_index_string(return_value, *ptr, 1); - } - efree(nlist); -} -/* }}} */ - -/* {{{ proto array ftp_rawlist(resource stream, string directory [, bool recursive]) - Returns a detailed listing of a directory as an array of output lines */ -PHP_FUNCTION(ftp_rawlist) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char **llist, **ptr, *dir; - int dir_len; - zend_bool recursive = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get raw directory listing */ - if (NULL == (llist = ftp_list(ftp, dir, recursive TSRMLS_CC))) { - RETURN_FALSE; - } - - array_init(return_value); - for (ptr = llist; *ptr; ptr++) { - add_next_index_string(return_value, *ptr, 1); - } - efree(llist); -} -/* }}} */ - -/* {{{ proto string ftp_systype(resource stream) - Returns the system type identifier */ -PHP_FUNCTION(ftp_systype) -{ - zval *z_ftp; - ftpbuf_t *ftp; - const char *syst; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (NULL == (syst = ftp_syst(ftp))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING((char*) syst, 1); -} -/* }}} */ - -/* {{{ proto bool ftp_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos]) - Retrieves a file from the FTP server and writes it to an open file */ -PHP_FUNCTION(ftp_fget) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream *stream; - char *file; - int file_len; - long mode, resumepos=0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - php_stream_from_zval(stream, &z_file); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { - resumepos = 0; - } - - if (ftp->autoseek && resumepos) { - /* if autoresume is wanted seek to end */ - if (resumepos == PHP_FTP_AUTORESUME) { - php_stream_seek(stream, 0, SEEK_END); - resumepos = php_stream_tell(stream); - } else { - php_stream_seek(stream, resumepos, SEEK_SET); - } - } - - if (!ftp_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ftp_nb_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos]) - Retrieves a file from the FTP server asynchronly and writes it to an open file */ -PHP_FUNCTION(ftp_nb_fget) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream *stream; - char *file; - int file_len, ret; - long mode, resumepos=0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - php_stream_from_zval(stream, &z_file); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { - resumepos = 0; - } - - if (ftp->autoseek && resumepos) { - /* if autoresume is wanted seek to end */ - if (resumepos == PHP_FTP_AUTORESUME) { - php_stream_seek(stream, 0, SEEK_END); - resumepos = php_stream_tell(stream); - } else { - php_stream_seek(stream, resumepos, SEEK_SET); - } - } - - /* configuration */ - ftp->direction = 0; /* recv */ - ftp->closestream = 0; /* do not close */ - - if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_LONG(ret); - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ proto bool ftp_pasv(resource stream, bool pasv) - Turns passive mode on or off */ -PHP_FUNCTION(ftp_pasv) -{ - zval *z_ftp; - ftpbuf_t *ftp; - zend_bool pasv; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &z_ftp, &pasv) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp_pasv(ftp, pasv ? 1 : 0)) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos]) - Retrieves a file from the FTP server and writes it to a local file */ -PHP_FUNCTION(ftp_get) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream *outstream; - char *local, *remote; - int local_len, remote_len; - long mode, resumepos=0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { - resumepos = 0; - } - -#ifdef PHP_WIN32 - mode = FTPTYPE_IMAGE; -#endif - - if (ftp->autoseek && resumepos) { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - if (outstream == NULL) { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - } - if (outstream != NULL) { - /* if autoresume is wanted seek to end */ - if (resumepos == PHP_FTP_AUTORESUME) { - php_stream_seek(outstream, 0, SEEK_END); - resumepos = php_stream_tell(outstream); - } else { - php_stream_seek(outstream, resumepos, SEEK_SET); - } - } - } else { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - } - - if (outstream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local); - RETURN_FALSE; - } - - if (!ftp_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) { - php_stream_close(outstream); - VCWD_UNLINK(local); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - php_stream_close(outstream); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ftp_nb_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos]) - Retrieves a file from the FTP server nbhronly and writes it to a local file */ -PHP_FUNCTION(ftp_nb_get) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream *outstream; - char *local, *remote; - int local_len, remote_len, ret; - long mode, resumepos=0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { - resumepos = 0; - } -#ifdef PHP_WIN32 - mode = FTPTYPE_IMAGE; -#endif - if (ftp->autoseek && resumepos) { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - if (outstream == NULL) { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - } - if (outstream != NULL) { - /* if autoresume is wanted seek to end */ - if (resumepos == PHP_FTP_AUTORESUME) { - php_stream_seek(outstream, 0, SEEK_END); - resumepos = php_stream_tell(outstream); - } else { - php_stream_seek(outstream, resumepos, SEEK_SET); - } - } - } else { - outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - } - - if (outstream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local); - RETURN_FALSE; - } - - /* configuration */ - ftp->direction = 0; /* recv */ - ftp->closestream = 1; /* do close */ - - if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { - php_stream_close(outstream); - VCWD_UNLINK(local); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_LONG(PHP_FTP_FAILED); - } - - if (ret == PHP_FTP_FINISHED) { - php_stream_close(outstream); - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ proto int ftp_nb_continue(resource stream) - Continues retrieving/sending a file nbronously */ -PHP_FUNCTION(ftp_nb_continue) -{ - zval *z_ftp; - ftpbuf_t *ftp; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp->nb) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no nbronous transfer to continue."); - RETURN_LONG(PHP_FTP_FAILED); - } - - if (ftp->direction) { - ret=ftp_nb_continue_write(ftp TSRMLS_CC); - } else { - ret=ftp_nb_continue_read(ftp TSRMLS_CC); - } - - if (ret != PHP_FTP_MOREDATA && ftp->closestream) { - php_stream_close(ftp->stream); - } - - if (ret == PHP_FTP_FAILED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ proto bool ftp_fput(resource stream, string remote_file, resource fp, int mode[, int startpos]) - Stores a file from an open file to the FTP server */ -PHP_FUNCTION(ftp_fput) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - int remote_len; - long mode, startpos=0; - php_stream *stream; - char *remote; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - php_stream_from_zval(stream, &z_file); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { - startpos = 0; - } - - if (ftp->autoseek && startpos) { - /* if autoresume is wanted ask for remote size */ - if (startpos == PHP_FTP_AUTORESUME) { - startpos = ftp_size(ftp, remote); - if (startpos < 0) { - startpos = 0; - } - } - if (startpos) { - php_stream_seek(stream, startpos, SEEK_SET); - } - } - - if (!ftp_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ftp_nb_fput(resource stream, string remote_file, resource fp, int mode[, int startpos]) - Stores a file from an open file to the FTP server nbronly */ -PHP_FUNCTION(ftp_nb_fput) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - int remote_len, ret; - long mode, startpos=0; - php_stream *stream; - char *remote; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - php_stream_from_zval(stream, &z_file); - XTYPE(xtype, mode); - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { - startpos = 0; - } - - if (ftp->autoseek && startpos) { - /* if autoresume is wanted ask for remote size */ - if (startpos == PHP_FTP_AUTORESUME) { - startpos = ftp_size(ftp, remote); - if (startpos < 0) { - startpos = 0; - } - } - if (startpos) { - php_stream_seek(stream, startpos, SEEK_SET); - } - } - - /* configuration */ - ftp->direction = 1; /* send */ - ftp->closestream = 0; /* do not close */ - - if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) == PHP_FTP_FAILED)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_LONG(ret); - } - - RETURN_LONG(ret); -} -/* }}} */ - - -/* {{{ proto bool ftp_put(resource stream, string remote_file, string local_file, int mode[, int startpos]) - Stores a file on the FTP server */ -PHP_FUNCTION(ftp_put) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - char *remote, *local; - int remote_len, local_len; - long mode, startpos=0; - php_stream *instream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - if (!(instream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL))) { - RETURN_FALSE; - } - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { - startpos = 0; - } - - if (ftp->autoseek && startpos) { - /* if autoresume is wanted ask for remote size */ - if (startpos == PHP_FTP_AUTORESUME) { - startpos = ftp_size(ftp, remote); - if (startpos < 0) { - startpos = 0; - } - } - if (startpos) { - php_stream_seek(instream, startpos, SEEK_SET); - } - } - - if (!ftp_put(ftp, remote, instream, xtype, startpos TSRMLS_CC)) { - php_stream_close(instream); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - php_stream_close(instream); - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto int ftp_nb_put(resource stream, string remote_file, string local_file, int mode[, int startpos]) - Stores a file on the FTP server */ -PHP_FUNCTION(ftp_nb_put) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - char *remote, *local; - int remote_len, local_len, ret; - long mode, startpos=0; - php_stream *instream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - if (!(instream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL))) { - RETURN_FALSE; - } - - /* ignore autoresume if autoseek is switched off */ - if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { - startpos = 0; - } - - if (ftp->autoseek && startpos) { - /* if autoresume is wanted ask for remote size */ - if (startpos == PHP_FTP_AUTORESUME) { - startpos = ftp_size(ftp, remote); - if (startpos < 0) { - startpos = 0; - } - } - if (startpos) { - php_stream_seek(instream, startpos, SEEK_SET); - } - } - - /* configuration */ - ftp->direction = 1; /* send */ - ftp->closestream = 1; /* do close */ - - ret = ftp_nb_put(ftp, remote, instream, xtype, startpos TSRMLS_CC); - - if (ret != PHP_FTP_MOREDATA) { - php_stream_close(instream); - } - - if (ret == PHP_FTP_FAILED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ proto int ftp_size(resource stream, string filename) - Returns the size of the file, or -1 on error */ -PHP_FUNCTION(ftp_size) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get file size */ - RETURN_LONG(ftp_size(ftp, file)); -} -/* }}} */ - -/* {{{ proto int ftp_mdtm(resource stream, string filename) - Returns the last modification time of the file, or -1 on error */ -PHP_FUNCTION(ftp_mdtm) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get file mod time */ - RETURN_LONG(ftp_mdtm(ftp, file)); -} -/* }}} */ - -/* {{{ proto bool ftp_rename(resource stream, string src, string dest) - Renames the given file to a new path */ -PHP_FUNCTION(ftp_rename) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *src, *dest; - int src_len, dest_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* rename the file */ - if (!ftp_rename(ftp, src, dest)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_delete(resource stream, string file) - Deletes a file */ -PHP_FUNCTION(ftp_delete) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* delete the file */ - if (!ftp_delete(ftp, file)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_site(resource stream, string cmd) - Sends a SITE command to the server */ -PHP_FUNCTION(ftp_site) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *cmd; - int cmd_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* send the site command */ - if (!ftp_site(ftp, cmd)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_close(resource stream) - Closes the FTP stream */ -PHP_FUNCTION(ftp_close) -{ - zval *z_ftp; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - ftp_quit(ftp); - - RETURN_BOOL(zend_list_delete(Z_LVAL_P(z_ftp)) == SUCCESS); -} -/* }}} */ - -/* {{{ proto bool ftp_set_option(resource stream, int option, mixed value) - Sets an FTP option */ -PHP_FUNCTION(ftp_set_option) -{ - zval *z_ftp, *z_value; - long option; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - switch (option) { - case PHP_FTP_OPT_TIMEOUT_SEC: - if (Z_TYPE_P(z_value) != IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given", - zend_zval_type_name(z_value)); - RETURN_FALSE; - } - if (Z_LVAL_P(z_value) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); - RETURN_FALSE; - } - ftp->timeout_sec = Z_LVAL_P(z_value); - RETURN_TRUE; - break; - case PHP_FTP_OPT_AUTOSEEK: - if (Z_TYPE_P(z_value) != IS_BOOL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given", - zend_zval_type_name(z_value)); - RETURN_FALSE; - } - ftp->autoseek = Z_LVAL_P(z_value); - RETURN_TRUE; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto mixed ftp_get_option(resource stream, int option) - Gets an FTP option */ -PHP_FUNCTION(ftp_get_option) -{ - zval *z_ftp; - long option; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - switch (option) { - case PHP_FTP_OPT_TIMEOUT_SEC: - RETURN_LONG(ftp->timeout_sec); - break; - case PHP_FTP_OPT_AUTOSEEK: - RETURN_BOOL(ftp->autoseek); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); - RETURN_FALSE; - break; - } -} -/* }}} */ - -#endif /* HAVE_FTP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h deleted file mode 100644 index aa45c7e18da5d..0000000000000 --- a/ext/ftp/php_ftp.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andrew Skalski | - | Stefan Esser (resume functions) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _INCLUDED_FTP_H -#define _INCLUDED_FTP_H - -#if HAVE_FTP - -extern zend_module_entry php_ftp_module_entry; -#define php_ftp_module_ptr &php_ftp_module_entry - -#define PHP_FTP_OPT_TIMEOUT_SEC 0 -#define PHP_FTP_OPT_AUTOSEEK 1 -#define PHP_FTP_AUTORESUME -1 - -PHP_MINIT_FUNCTION(ftp); -PHP_MINFO_FUNCTION(ftp); - -PHP_FUNCTION(ftp_connect); -#ifdef HAVE_OPENSSL_EXT -PHP_FUNCTION(ftp_ssl_connect); -#endif -PHP_FUNCTION(ftp_login); -PHP_FUNCTION(ftp_pwd); -PHP_FUNCTION(ftp_cdup); -PHP_FUNCTION(ftp_chdir); -PHP_FUNCTION(ftp_exec); -PHP_FUNCTION(ftp_raw); -PHP_FUNCTION(ftp_mkdir); -PHP_FUNCTION(ftp_rmdir); -PHP_FUNCTION(ftp_chmod); -PHP_FUNCTION(ftp_alloc); -PHP_FUNCTION(ftp_nlist); -PHP_FUNCTION(ftp_rawlist); -PHP_FUNCTION(ftp_systype); -PHP_FUNCTION(ftp_pasv); -PHP_FUNCTION(ftp_get); -PHP_FUNCTION(ftp_fget); -PHP_FUNCTION(ftp_put); -PHP_FUNCTION(ftp_fput); -PHP_FUNCTION(ftp_size); -PHP_FUNCTION(ftp_mdtm); -PHP_FUNCTION(ftp_rename); -PHP_FUNCTION(ftp_delete); -PHP_FUNCTION(ftp_site); -PHP_FUNCTION(ftp_close); -PHP_FUNCTION(ftp_set_option); -PHP_FUNCTION(ftp_get_option); -PHP_FUNCTION(ftp_nb_get); -PHP_FUNCTION(ftp_nb_fget); -PHP_FUNCTION(ftp_nb_put); -PHP_FUNCTION(ftp_nb_fput); -PHP_FUNCTION(ftp_nb_continue); - -#define phpext_ftp_ptr php_ftp_module_ptr - -#else -#define php_ftp_module_ptr NULL -#endif /* HAVE_FTP */ - -#endif diff --git a/ext/gd/CREDITS b/ext/gd/CREDITS deleted file mode 100644 index 2393a9f8fc3e3..0000000000000 --- a/ext/gd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GD imaging -Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 deleted file mode 100644 index 2c5bb4a9e7aa1..0000000000000 --- a/ext/gd/config.m4 +++ /dev/null @@ -1,384 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl -dnl Configure options -dnl - -PHP_ARG_WITH(gd, for GD support, -[ --with-gd[=DIR] Include GD support where DIR is GD install prefix. - If DIR is not set, the bundled GD library will be used]) - -if test -z "$PHP_JPEG_DIR"; then - PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, - [ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix], no, no) -fi - -if test -z "$PHP_PNG_DIR"; then - PHP_ARG_WITH(png-dir, for the location of libpng, - [ --with-png-dir[=DIR] GD: Set the path to libpng install prefix], no, no) -fi - -if test -z "$PHP_ZLIB_DIR"; then - PHP_ARG_WITH(zlib-dir, for the location of libz, - [ --with-zlib-dir[=DIR] GD: Set the path to libz install prefix], no, no) -fi - -PHP_ARG_WITH(xpm-dir, for the location of libXpm, -[ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix], no, no) - -PHP_ARG_WITH(freetype-dir, for FreeType 2, -[ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix], no, no) - -PHP_ARG_WITH(t1lib, for T1lib support, -[ --with-t1lib[=DIR] GD: Include T1lib support. T1lib version >= 5.0.0 required], no, no) - -PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD, -[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no) - -PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD, -[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no) - -dnl -dnl Checks for the configure options -dnl - -AC_DEFUN([PHP_GD_JPEG],[ - if test "$PHP_JPEG_DIR" != "no"; then - - for i in $PHP_JPEG_DIR /usr/local /usr; do - test -f $i/$PHP_LIBDIR/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libjpeg.a && GD_JPEG_DIR=$i && break - done - - if test -z "$GD_JPEG_DIR"; then - AC_MSG_ERROR([libjpeg.(a|so) not found.]) - fi - - PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, - [ - PHP_ADD_INCLUDE($GD_JPEG_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.]) - ],[ - -L$GD_JPEG_DIR/$PHP_LIBDIR - ]) - else - AC_MSG_RESULT([If configure fails try --with-jpeg-dir=]) - fi -]) - -AC_DEFUN([PHP_GD_PNG],[ - if test "$PHP_PNG_DIR" != "no"; then - - for i in $PHP_PNG_DIR /usr/local /usr; do - test -f $i/$PHP_LIBDIR/libpng.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libpng.a && GD_PNG_DIR=$i && break - done - - if test -z "$GD_PNG_DIR"; then - AC_MSG_ERROR([libpng.(a|so) not found.]) - fi - - if test "$PHP_ZLIB_DIR" = "no"; then - AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=]) - fi - - if test ! -f $GD_PNG_DIR/include/png.h; then - AC_MSG_ERROR([png.h not found.]) - fi - - PHP_CHECK_LIBRARY(png,png_write_image, - [ - PHP_ADD_INCLUDE($GD_PNG_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.]) - ],[ - -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz -L$GD_PNG_DIR/$PHP_LIBDIR - ]) - - else - AC_MSG_RESULT([If configure fails try --with-png-dir= and --with-zlib-dir=]) - fi -]) - -AC_DEFUN([PHP_GD_XPM],[ - if test "$PHP_XPM_DIR" != "no"; then - - for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do - test -f $i/$PHP_LIBDIR/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libXpm.a && GD_XPM_DIR=$i && break - done - - if test -z "$GD_XPM_DIR"; then - AC_MSG_ERROR([libXpm.(a|so) not found.]) - fi - - for i in include include/X11; do - test -f $GD_XPM_DIR/$i/xpm.h && GD_XPM_INC=$GD_XPM_DIR/include - done - - if test -z "$GD_XPM_INC"; then - AC_MSG_ERROR([xpm.h not found.]) - fi - - PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage, - [ - PHP_ADD_INCLUDE($GD_XPM_INC) - PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.]) - ],[ - -L$GD_XPM_DIR/$PHP_LIBDIR -lX11 - ]) - else - AC_MSG_RESULT(If configure fails try --with-xpm-dir=) - fi -]) - -AC_DEFUN([PHP_GD_FREETYPE2],[ - if test "$PHP_FREETYPE_DIR" != "no"; then - - for i in $PHP_FREETYPE_DIR /usr/local /usr; do - if test -f "$i/include/freetype2/freetype/freetype.h"; then - FREETYPE2_DIR=$i - FREETYPE2_INC_DIR=$i/include/freetype2 - break - fi - done - - if test -n "$FREETYPE2_DIR" ; then - PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - PHP_ADD_INCLUDE($FREETYPE2_DIR/include) - PHP_ADD_INCLUDE($FREETYPE2_INC_DIR) - AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) - AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) - else - AC_MSG_ERROR([freetype2 not found!]) - fi - else - AC_MSG_RESULT([If configure fails try --with-freetype-dir=]) - fi -]) - -AC_DEFUN([PHP_GD_T1LIB],[ - if test "$PHP_T1LIB" != "no"; then - - for i in $PHP_T1LIB /usr/local /usr; do - test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break - done - - if test -z "$GD_T1_DIR"; then - AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.]) - fi - - PHP_CHECK_LIBRARY(t1, T1_StrError, - [ - AC_DEFINE(HAVE_LIBT1,1,[ ]) - PHP_ADD_INCLUDE($GD_T1_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.]) - ],[ - -L$GD_T1_DIR/$PHP_LIBDIR - ]) - fi -]) - -AC_DEFUN([PHP_GD_TTSTR],[ - if test "$PHP_GD_NATIVE_TTF" = "yes"; then - AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) - fi -]) - -AC_DEFUN([PHP_GD_JISX0208],[ - if test "$PHP_GD_JIS_CONV" = "yes"; then - USE_GD_JIS_CONV=1 - fi -]) - -AC_DEFUN([PHP_GD_CHECK_VERSION],[ - PHP_CHECK_LIBRARY(gd, gdImageString16, [AC_DEFINE(HAVE_LIBGD13, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageGif, [AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromGd2, [AC_DEFINE(HAVE_GD_GD2, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageSetTile, [AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageEllipse, [AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageSetBrush, [AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringTTF, [AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringFT, [AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringFTEx, [AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdFreeFontCache, [AC_DEFINE(HAVE_GD_FREEFONTCACHE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) -]) - -dnl -dnl Main GD configure -dnl - -if test "$PHP_GD" = "yes"; then - GD_MODULE_TYPE=builtin - extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \ - libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_png.c libgd/gd_jpeg.c \ - libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \ - libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \ - libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \ - libgd/xbm.c libgd/gd_gif_out.c " - -dnl check for fabsf and floorf which are available since C99 - AC_CHECK_FUNCS(fabsf floorf) - -dnl PNG is required by GD library - test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes - -dnl Various checks for GD features - PHP_GD_TTSTR - PHP_GD_JISX0208 - PHP_GD_JPEG - PHP_GD_PNG - PHP_GD_XPM - PHP_GD_FREETYPE2 - PHP_GD_T1LIB - -dnl These are always available with bundled library - AC_DEFINE(HAVE_LIBGD, 1, [ ]) - AC_DEFINE(HAVE_LIBGD13, 1, [ ]) - AC_DEFINE(HAVE_LIBGD15, 1, [ ]) - AC_DEFINE(HAVE_LIBGD20, 1, [ ]) - AC_DEFINE(HAVE_LIBGD204, 1, [ ]) - AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ]) - AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ]) - AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ]) - AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ]) - AC_DEFINE(HAVE_GD_WBMP, 1, [ ]) - AC_DEFINE(HAVE_GD_GD2, 1, [ ]) - AC_DEFINE(HAVE_GD_PNG, 1, [ ]) - AC_DEFINE(HAVE_GD_XBM, 1, [ ]) - AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ]) - AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ]) - AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ]) - AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ]) - AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ]) - AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ]) - AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ]) - -dnl Make sure the libgd/ is first in the include path - GDLIB_CFLAGS="-DHAVE_LIBPNG" - -dnl Depending which libraries were included to PHP configure, -dnl enable the support in bundled GD library - - if test -n "$GD_JPEG_DIR"; then - AC_DEFINE(HAVE_GD_JPG, 1, [ ]) - GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBJPEG" - fi - - if test -n "$GD_XPM_DIR"; then - AC_DEFINE(HAVE_GD_XPM, 1, [ ]) - GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM" - fi - - if test -n "$FREETYPE2_DIR"; then - AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ]) - AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ]) - GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE" - fi - - if test -n "$USE_GD_JIS_CONV"; then - AC_DEFINE(USE_GD_JISX0208, 1, [ ]) - GDLIB_CFLAGS="$GDLIB_CFLAGS -DJISX0208" - fi - -else - - if test "$PHP_GD" != "no"; then - GD_MODULE_TYPE=external - extra_sources="gdcache.c" - -dnl Various checks for GD features - PHP_GD_TTSTR - PHP_GD_JPEG - PHP_GD_PNG - PHP_GD_XPM - PHP_GD_FREETYPE2 - PHP_GD_T1LIB - -dnl Header path - for i in include/gd1.3 include/gd include gd1.3 gd ""; do - test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i" - done - -dnl Library path - for i in $PHP_LIBDIR/gd1.3 $PHP_LIBDIR/gd $PHP_LIBDIR gd1.3 gd ""; do - test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" -o -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i" - done - - if test -n "$GD_INCLUDE" && test -n "$GD_LIB"; then - PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBGD,1,[ ]) - PHP_GD_CHECK_VERSION - elif test -z "$GD_INCLUDE"; then - AC_MSG_ERROR([Unable to find gd.h anywhere under $PHP_GD]) - else - AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $PHP_GD]) - fi - - PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE) - - dnl - dnl Check for gd 2.0.4 greater availability - dnl - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$GD_INCLUDE - AC_TRY_COMPILE([ -#include -#include - ], [ -gdIOCtx *ctx; -ctx = malloc(sizeof(gdIOCtx)); -ctx->gd_free = 1; - ], [ - AC_DEFINE(HAVE_LIBGD204, 1, [ ]) - ]) - CPPFLAGS=$old_CPPFLAGS - - fi -fi - -dnl -dnl Common for both builtin and external GD -dnl -if test "$PHP_GD" != "no"; then - PHP_NEW_EXTENSION(gd, gd.c $extra_sources, $ext_shared,, \\$(GDLIB_CFLAGS)) - - if test "$GD_MODULE_TYPE" = "builtin"; then - GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS" - PHP_ADD_BUILD_DIR($ext_builddir/libgd) - GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/" - else - GD_HEADER_DIRS="ext/gd/" - GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS" - PHP_ADD_INCLUDE($GD_INCLUDE) - - PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [ - AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) - ], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - fi - - PHP_INSTALL_HEADERS([$GD_HEADER_DIRS]) - PHP_SUBST(GDLIB_CFLAGS) - PHP_SUBST(GD_SHARED_LIBADD) -fi diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 deleted file mode 100644 index 74a805e6092cf..0000000000000 --- a/ext/gd/config.w32 +++ /dev/null @@ -1,63 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("gd", "Bundled GD support", "yes,shared"); -ARG_WITH("t1lib", "t1lib support", "yes"); - -if (PHP_GD != "no") { - if (CHECK_LIB("libjpeg.lib", "gd", PHP_GD) && - CHECK_LIB("freetype2.lib", "gd", PHP_GD) && - CHECK_LIB("libpng.lib", "gd", PHP_GD) && - CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") - ) { - if (PHP_T1LIB != "no") { - if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) && - CHECK_HEADER_ADD_INCLUDE("t1lib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\t1lib") - ) { - ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBT1"); - } else { - WARNING("t1lib not enabled; libraries and headers not found"); - } - } - - if (PHP_ZLIB == "no" || PHP_ZLIB_SHARED) { - CHECK_LIB("zlib.lib", "gd", PHP_GD); - } - - EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd", "php_gd2.dll"); - ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c \ - gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ - gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \ - gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \ - gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c", "gd"); - AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); - ADD_FLAG("CFLAGS_GD", " \ -/D HAVE_GD_DYNAMIC_CTX_EX=1 \ -/D HAVE_GD_BUNDLED=1 \ -/D HAVE_GD_GD2 \ -/D HAVE_GD_GIF_READ=1 \ -/D HAVE_GD_GIF_CREATE=1 \ -/D HAVE_GDIMAGECOLORRESOLVE=1 \ -/D HAVE_GD_IMAGESETBRUSH=1 \ -/D HAVE_GD_IMAGESETTILE=1 \ -/D HAVE_GD_JPG \ -/D HAVE_GD_PNG \ -/D HAVE_GD_STRINGFTEX=1 \ -/D HAVE_GD_STRINGTTF=1 \ -/D HAVE_GD_WBMP \ -/D HAVE_GD_XBM \ -/D HAVE_LIBFREETYPE=1 \ -/D HAVE_LIBGD13=1 \ -/D HAVE_LIBGD15=1 \ -/D HAVE_LIBGD20=1 \ -/D HAVE_LIBGD204=1 \ -/D HAVE_LIBJPEG \ -/D HAVE_LIBPNG \ -/D USE_GD_IMGSTRTTF \ -/D USE_GD_IOCTX \ -/D MSWIN32 \ - "); - } else { - WARNING("gd not enabled; libraries and headers not found"); - } -} diff --git a/ext/gd/gd.c b/ext/gd/gd.c deleted file mode 100644 index 76fb2347d285f..0000000000000 --- a/ext/gd/gd.c +++ /dev/null @@ -1,4258 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Bakken | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, - Cold Spring Harbor Labs. */ - -/* Note that there is no code from the gd package in this file */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/head.h" -#include -#include "SAPI.h" -#include "php_gd.h" -#include "ext/standard/info.h" -#include "php_open_temporary_file.h" - -#if HAVE_SYS_WAIT_H -# include -#endif -#if HAVE_UNISTD_H -# include -#endif -#ifdef PHP_WIN32 -# include -# include -#endif - -#if HAVE_LIBGD - -static int le_gd, le_gd_font; -#if HAVE_LIBT1 -#include -static int le_ps_font, le_ps_enc; -static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC); -#endif - -#include -#include /* 1 Tiny font */ -#include /* 2 Small font */ -#include /* 3 Medium bold font */ -#include /* 4 Large font */ -#include /* 5 Giant font */ -#ifdef HAVE_GD_WBMP -#include "libgd/wbmp.h" -#endif -#ifdef ENABLE_GD_TTF -# ifdef HAVE_LIBFREETYPE -# include -# include FT_FREETYPE_H -# else -# endif -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#ifdef ENABLE_GD_TTF -static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int); -#endif - -#if HAVE_LIBGD15 -/* it's >= 1.5, i.e. has IOCtx */ -#define USE_GD_IOCTX 1 -#else -#undef USE_GD_IOCTX -#endif - -#ifdef USE_GD_IOCTX -#include "gd_ctx.c" -#else -#define gdImageCreateFromGdCtx NULL -#define gdImageCreateFromGd2Ctx NULL -#define gdImageCreateFromGd2partCtx NULL -#define gdImageCreateFromGifCtx NULL -#define gdImageCreateFromJpegCtx NULL -#define gdImageCreateFromPngCtx NULL -#define gdImageCreateFromWBMPCtx NULL -typedef FILE gdIOCtx; -#define CTX_PUTC(c, fp) fputc(c, fp) -#endif - -#ifndef HAVE_GDIMAGECOLORRESOLVE -extern int gdImageColorResolve(gdImagePtr, int, int, int); -#endif - -#if HAVE_COLORCLOSESTHWB -int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); -#endif - -#ifndef HAVE_GD_DYNAMIC_CTX_EX -#define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data) -#endif - -/* Section Filters Declarations */ -/* IMPORTANT NOTE FOR NEW FILTER - * Do not forget to update: - * IMAGE_FILTER_MAX: define the last filter index - * IMAGE_FILTER_MAX_ARGS: define the biggest amout of arguments - * image_filter array in PHP_FUNCTION(imagefilter) - * */ -#if HAVE_GD_BUNDLED -#define IMAGE_FILTER_NEGATE 0 -#define IMAGE_FILTER_GRAYSCALE 1 -#define IMAGE_FILTER_BRIGHTNESS 2 -#define IMAGE_FILTER_CONTRAST 3 -#define IMAGE_FILTER_COLORIZE 4 -#define IMAGE_FILTER_EDGEDETECT 5 -#define IMAGE_FILTER_EMBOSS 6 -#define IMAGE_FILTER_GAUSSIAN_BLUR 7 -#define IMAGE_FILTER_SELECTIVE_BLUR 8 -#define IMAGE_FILTER_MEAN_REMOVAL 9 -#define IMAGE_FILTER_SMOOTH 10 -#define IMAGE_FILTER_MAX 10 -#define IMAGE_FILTER_MAX_ARGS 5 -static void php_image_filter_negate(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_grayscale(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_edgedetect(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_emboss(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_selective_blur(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_mean_removal(INTERNAL_FUNCTION_PARAMETERS); -static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS); -#endif -/* End Section filters declarations */ -static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC); -static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()); -static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()); -static int _php_image_type(char data[8]); -static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type); -static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold); - -/* {{{ gd_functions[] - */ -function_entry gd_functions[] = { - PHP_FE(gd_info, NULL) - PHP_FE(imagearc, NULL) - PHP_FE(imageellipse, NULL) - PHP_FE(imagechar, NULL) - PHP_FE(imagecharup, NULL) - PHP_FE(imagecolorat, NULL) - PHP_FE(imagecolorallocate, NULL) -#if HAVE_LIBGD15 - PHP_FE(imagepalettecopy, NULL) - PHP_FE(imagecreatefromstring, NULL) -#endif - PHP_FE(imagecolorclosest, NULL) -#if HAVE_COLORCLOSESTHWB - PHP_FE(imagecolorclosesthwb, NULL) -#endif - PHP_FE(imagecolordeallocate, NULL) - PHP_FE(imagecolorresolve, NULL) - PHP_FE(imagecolorexact, NULL) - PHP_FE(imagecolorset, NULL) - PHP_FE(imagecolortransparent, NULL) - PHP_FE(imagecolorstotal, NULL) - PHP_FE(imagecolorsforindex, NULL) - PHP_FE(imagecopy, NULL) -#if HAVE_LIBGD15 - PHP_FE(imagecopymerge, NULL) - PHP_FE(imagecopymergegray, NULL) -#endif - PHP_FE(imagecopyresized, NULL) - PHP_FE(imagecreate, NULL) -#if HAVE_LIBGD20 - PHP_FE(imagecreatetruecolor, NULL) - PHP_FE(imageistruecolor, NULL) - PHP_FE(imagetruecolortopalette, NULL) - PHP_FE(imagesetthickness, NULL) - PHP_FE(imagefilledarc, NULL) - PHP_FE(imagefilledellipse, NULL) - PHP_FE(imagealphablending, NULL) - PHP_FE(imagesavealpha, NULL) - PHP_FE(imagecolorallocatealpha, NULL) - PHP_FE(imagecolorresolvealpha, NULL) - PHP_FE(imagecolorclosestalpha, NULL) - PHP_FE(imagecolorexactalpha, NULL) - PHP_FE(imagecopyresampled, NULL) -#endif - -#ifdef HAVE_GD_BUNDLED - PHP_FE(imagerotate, NULL) - PHP_FE(imageantialias, NULL) -#endif - -#if HAVE_GD_IMAGESETTILE - PHP_FE(imagesettile, NULL) -#endif - -#if HAVE_GD_IMAGESETBRUSH - PHP_FE(imagesetbrush, NULL) -#endif - - PHP_FE(imagesetstyle, NULL) - -#ifdef HAVE_GD_PNG - PHP_FE(imagecreatefrompng, NULL) -#endif -#ifdef HAVE_GD_GIF_READ - PHP_FE(imagecreatefromgif, NULL) -#endif -#ifdef HAVE_GD_JPG - PHP_FE(imagecreatefromjpeg, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(imagecreatefromwbmp, NULL) -#endif -#ifdef HAVE_GD_XBM - PHP_FE(imagecreatefromxbm, NULL) -#endif -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) - PHP_FE(imagecreatefromxpm, NULL) -#endif - PHP_FE(imagecreatefromgd, NULL) -#ifdef HAVE_GD_GD2 - PHP_FE(imagecreatefromgd2, NULL) - PHP_FE(imagecreatefromgd2part, NULL) -#endif -#ifdef HAVE_GD_PNG - PHP_FE(imagepng, NULL) -#endif -#ifdef HAVE_GD_GIF_CREATE - PHP_FE(imagegif, NULL) -#endif -#ifdef HAVE_GD_JPG - PHP_FE(imagejpeg, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(imagewbmp, NULL) -#endif - PHP_FE(imagegd, NULL) -#ifdef HAVE_GD_GD2 - PHP_FE(imagegd2, NULL) -#endif - - PHP_FE(imagedestroy, NULL) - PHP_FE(imagegammacorrect, NULL) - PHP_FE(imagefill, NULL) - PHP_FE(imagefilledpolygon, NULL) - PHP_FE(imagefilledrectangle, NULL) - PHP_FE(imagefilltoborder, NULL) - PHP_FE(imagefontwidth, NULL) - PHP_FE(imagefontheight, NULL) - PHP_FE(imageinterlace, NULL) - PHP_FE(imageline, NULL) - PHP_FE(imageloadfont, NULL) - PHP_FE(imagepolygon, NULL) - PHP_FE(imagerectangle, NULL) - PHP_FE(imagesetpixel, NULL) - PHP_FE(imagestring, NULL) - PHP_FE(imagestringup, NULL) - PHP_FE(imagesx, NULL) - PHP_FE(imagesy, NULL) - PHP_FE(imagedashedline, NULL) - -#ifdef ENABLE_GD_TTF - PHP_FE(imagettfbbox, NULL) - PHP_FE(imagettftext, NULL) -#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX - PHP_FE(imageftbbox, NULL) - PHP_FE(imagefttext, NULL) -#endif -#endif - -#ifdef HAVE_LIBT1 - PHP_FE(imagepsloadfont, NULL) - /* - PHP_FE(imagepscopyfont, NULL) - */ - PHP_FE(imagepsfreefont, NULL) - PHP_FE(imagepsencodefont, NULL) - PHP_FE(imagepsextendfont, NULL) - PHP_FE(imagepsslantfont, NULL) - PHP_FE(imagepstext, NULL) - PHP_FE(imagepsbbox, NULL) -#endif - PHP_FE(imagetypes, NULL) - -#if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP) - PHP_FE(jpeg2wbmp, NULL) -#endif -#if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP) - PHP_FE(png2wbmp, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(image2wbmp, NULL) -#endif -#if HAVE_GD_BUNDLED - PHP_FE(imagelayereffect, NULL) - PHP_FE(imagecolormatch, NULL) - PHP_FE(imagexbm, NULL) -#endif -/* gd filters */ -#ifdef HAVE_GD_BUNDLED - PHP_FE(imagefilter, NULL) - PHP_FE(imageconvolution, NULL) -#endif - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry gd_module_entry = { - STANDARD_MODULE_HEADER, - "gd", - gd_functions, - PHP_MINIT(gd), - PHP_MSHUTDOWN(gd), - NULL, -#if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE) - PHP_RSHUTDOWN(gd), -#else - NULL, -#endif - PHP_MINFO(gd), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_GD -ZEND_GET_MODULE(gd) -#endif - -/* {{{ php_free_gd_image - */ -static void php_free_gd_image(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - gdImageDestroy((gdImagePtr) rsrc->ptr); -} -/* }}} */ - -/* {{{ php_free_gd_font - */ -static void php_free_gd_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - gdFontPtr fp = (gdFontPtr) rsrc->ptr; - - if (fp->data) { - efree(fp->data); - } - - efree(fp); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(gd) -{ -#if HAVE_LIBT1 - T1_CloseLib(); -#endif - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(gd) -{ - le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number); - le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number); -#if HAVE_LIBT1 - T1_SetBitmapPad(8); - T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE); - T1_SetLogLevel(T1LOG_DEBUG); - le_ps_font = zend_register_list_destructors_ex(php_free_ps_font, NULL, "gd PS font", module_number); - le_ps_enc = zend_register_list_destructors_ex(php_free_ps_enc, NULL, "gd PS encoding", module_number); -#endif - - REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT); -#ifdef gdTiled - /* special colours for gd */ - REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_STYLED", gdStyled, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_BRUSHED", gdBrushed, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_STYLEDBRUSHED", gdStyledBrushed, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_TRANSPARENT", gdTransparent, CONST_CS | CONST_PERSISTENT); -#endif -#if HAVE_LIBGD20 - /* for imagefilledarc */ - REGISTER_LONG_CONSTANT("IMG_ARC_ROUNDED", gdArc, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_PIE", gdPie, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_CHORD", gdChord, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_NOFILL", gdNoFill, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_EDGED", gdEdged, CONST_CS | CONST_PERSISTENT); -#endif -/* GD2 image format types */ -#ifdef GD2_FMT_RAW - REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef GD2_FMT_COMPRESSED - REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT); -#endif -#if HAVE_GD_BUNDLED - REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_EFFECT_OVERLAY", gdEffectOverlay, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GD_BUNDLED", 1, CONST_CS | CONST_PERSISTENT); - /* Section Filters */ - REGISTER_LONG_CONSTANT("IMG_FILTER_NEGATE", IMAGE_FILTER_NEGATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_GRAYSCALE", IMAGE_FILTER_GRAYSCALE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_BRIGHTNESS", IMAGE_FILTER_BRIGHTNESS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_CONTRAST", IMAGE_FILTER_CONTRAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_COLORIZE", IMAGE_FILTER_COLORIZE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_EDGEDETECT", IMAGE_FILTER_EDGEDETECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_GAUSSIAN_BLUR", IMAGE_FILTER_GAUSSIAN_BLUR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_SELECTIVE_BLUR", IMAGE_FILTER_SELECTIVE_BLUR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_EMBOSS", IMAGE_FILTER_EMBOSS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_MEAN_REMOVAL", IMAGE_FILTER_MEAN_REMOVAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_FILTER_SMOOTH", IMAGE_FILTER_SMOOTH, CONST_CS | CONST_PERSISTENT); - /* End Section Filters */ -#else - REGISTER_LONG_CONSTANT("GD_BUNDLED", 0, CONST_CS | CONST_PERSISTENT); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -#if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE) -PHP_RSHUTDOWN_FUNCTION(gd) -{ -#if HAVE_GD_FONTCACHESHUTDOWN - gdFontCacheShutdown(); -#else - gdFreeFontCache(); -#endif - return SUCCESS; -} -#endif -/* }}} */ - -#if HAVE_GD_BUNDLED -#define PHP_GD_VERSION_STRING "bundled (2.0.28 compatible)" -#elif HAVE_LIBGD20 -#define PHP_GD_VERSION_STRING "2.0 or higher" -#elif HAVE_GDIMAGECOLORRESOLVE -#define PHP_GD_VERSION_STRING "1.6.2 or higher" -#elif HAVE_LIBGD13 -#define PHP_GD_VERSION_STRING "between 1.3 and 1.6.1" -#else -#define PHP_GD_VERSION_STRING "1.2" -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(gd) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "GD Support", "enabled"); - - /* need to use a PHPAPI function here because it is external module in windows */ - - php_info_print_table_row(2, "GD Version", PHP_GD_VERSION_STRING); - -#ifdef ENABLE_GD_TTF - php_info_print_table_row(2, "FreeType Support", "enabled"); -#if HAVE_LIBFREETYPE - php_info_print_table_row(2, "FreeType Linkage", "with freetype"); - { - char tmp[256]; -#ifdef FREETYPE_PATCH - snprintf(tmp, sizeof(tmp), "%d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH); -#else - snprintf(tmp, sizeof(tmp), "%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR); -#endif - php_info_print_table_row(2, "FreeType Version", tmp); - } - php_info_print_table_row(2, "FreeType Linkage", "with unknown library"); -#endif -#endif - -#ifdef HAVE_LIBT1 - php_info_print_table_row(2, "T1Lib Support", "enabled"); -#endif - -/* this next part is stupid ... if I knew better, I'd put them all on one row (cmv) */ - -#ifdef HAVE_GD_GIF_READ - php_info_print_table_row(2, "GIF Read Support", "enabled"); -#endif -#ifdef HAVE_GD_GIF_CREATE - php_info_print_table_row(2, "GIF Create Support", "enabled"); -#endif -#ifdef HAVE_GD_JPG - php_info_print_table_row(2, "JPG Support", "enabled"); -#endif -#ifdef HAVE_GD_PNG - php_info_print_table_row(2, "PNG Support", "enabled"); -#endif -#ifdef HAVE_GD_WBMP - php_info_print_table_row(2, "WBMP Support", "enabled"); -#endif -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) - php_info_print_table_row(2, "XPM Support", "enabled"); -#endif -#ifdef HAVE_GD_XBM - php_info_print_table_row(2, "XBM Support", "enabled"); -#endif -#if defined(USE_GD_JISX0208) && defined(HAVE_GD_BUNDLED) - php_info_print_table_row(2, "JIS-mapped Japanese Font Support", "enabled"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto array gd_info() - */ -PHP_FUNCTION(gd_info) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING, 1); - -#ifdef ENABLE_GD_TTF - add_assoc_bool(return_value, "FreeType Support", 1); -#if HAVE_LIBFREETYPE - add_assoc_string(return_value, "FreeType Linkage", "with freetype", 1); -#else - add_assoc_string(return_value, "FreeType Linkage", "with unknown library", 1); -#endif -#else - add_assoc_bool(return_value, "FreeType Support", 0); -#endif - -#ifdef HAVE_LIBT1 - add_assoc_bool(return_value, "T1Lib Support", 1); -#else - add_assoc_bool(return_value, "T1Lib Support", 0); -#endif -#ifdef HAVE_GD_GIF_READ - add_assoc_bool(return_value, "GIF Read Support", 1); -#else - add_assoc_bool(return_value, "GIF Read Support", 0); -#endif -#ifdef HAVE_GD_GIF_CREATE - add_assoc_bool(return_value, "GIF Create Support", 1); -#else - add_assoc_bool(return_value, "GIF Create Support", 0); -#endif -#ifdef HAVE_GD_JPG - add_assoc_bool(return_value, "JPG Support", 1); -#else - add_assoc_bool(return_value, "JPG Support", 0); -#endif -#ifdef HAVE_GD_PNG - add_assoc_bool(return_value, "PNG Support", 1); -#else - add_assoc_bool(return_value, "PNG Support", 0); -#endif -#ifdef HAVE_GD_WBMP - add_assoc_bool(return_value, "WBMP Support", 1); -#else - add_assoc_bool(return_value, "WBMP Support", 0); -#endif -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) - add_assoc_bool(return_value, "XPM Support", 1); -#else - add_assoc_bool(return_value, "XPM Support", 0); -#endif -#ifdef HAVE_GD_XBM - add_assoc_bool(return_value, "XBM Support", 1); -#else - add_assoc_bool(return_value, "XBM Support", 0); -#endif -#if defined(USE_GD_JISX0208) && defined(HAVE_GD_BUNDLED) - add_assoc_bool(return_value, "JIS-mapped Japanese Font Support", 1); -#else - add_assoc_bool(return_value, "JIS-mapped Japanese Font Support", 0); -#endif -} -/* }}} */ - -/* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */ -PHP_GD_API int phpi_get_le_gd(void) -{ - return le_gd; -} - -#ifndef HAVE_GDIMAGECOLORRESOLVE - -/* {{{ gdImageColorResolve - */ -/********************************************************************/ -/* gdImageColorResolve is a replacement for the old fragment: */ -/* */ -/* if ((color=gdImageColorExact(im,R,G,B)) < 0) */ -/* if ((color=gdImageColorAllocate(im,R,G,B)) < 0) */ -/* color=gdImageColorClosest(im,R,G,B); */ -/* */ -/* in a single function */ - -int gdImageColorResolve(gdImagePtr im, int r, int g, int b) -{ - int c; - int ct = -1; - int op = -1; - long rd, gd, bd, dist; - long mindist = 3*255*255; /* init to max poss dist */ - - for (c = 0; c < im->colorsTotal; c++) { - if (im->open[c]) { - op = c; /* Save open slot */ - continue; /* Color not in use */ - } - rd = (long) (im->red [c] - r); - gd = (long) (im->green[c] - g); - bd = (long) (im->blue [c] - b); - dist = rd * rd + gd * gd + bd * bd; - if (dist < mindist) { - if (dist == 0) { - return c; /* Return exact match color */ - } - mindist = dist; - ct = c; - } - } - /* no exact match. We now know closest, but first try to allocate exact */ - if (op == -1) { - op = im->colorsTotal; - if (op == gdMaxColors) { /* No room for more colors */ - return ct; /* Return closest available color */ - } - im->colorsTotal++; - } - im->red [op] = r; - im->green[op] = g; - im->blue [op] = b; - im->open [op] = 0; - return op; /* Return newly allocated color */ -} -/* }}} */ - -#endif - -#define FLIPWORD(a) (((a & 0xff000000) >> 24) | ((a & 0x00ff0000) >> 8) | ((a & 0x0000ff00) << 8) | ((a & 0x000000ff) << 24)) - -/* {{{ proto int imageloadfont(string filename) - Load a new font */ -PHP_FUNCTION(imageloadfont) -{ - zval **file; - int hdr_size = sizeof(gdFont) - sizeof(char *); - int ind, body_size, n = 0, b, i, body_size_check; - gdFontPtr font; - php_stream *stream; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL); - if (stream == NULL) { - RETURN_FALSE; - } - - /* Only supports a architecture-dependent binary dump format - * at the moment. - * The file format is like this on machines with 32-byte integers: - * - * byte 0-3: (int) number of characters in the font - * byte 4-7: (int) value of first character in the font (often 32, space) - * byte 8-11: (int) pixel width of each character - * byte 12-15: (int) pixel height of each character - * bytes 16-: (char) array with character data, one byte per pixel - * in each character, for a total of - * (nchars*width*height) bytes. - */ - font = (gdFontPtr) emalloc(sizeof(gdFont)); - b = 0; - while (b < hdr_size && (n = php_stream_read(stream, (char*)&font[b], hdr_size - b))) { - b += n; - } - - if (!n) { - efree(font); - if (php_stream_eof(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header"); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header"); - } - php_stream_close(stream); - RETURN_FALSE; - } - i = php_stream_tell(stream); - php_stream_seek(stream, 0, SEEK_END); - body_size_check = php_stream_tell(stream) - hdr_size; - php_stream_seek(stream, i, SEEK_SET); - - body_size = font->w * font->h * font->nchars; - if (body_size != body_size_check) { - font->w = FLIPWORD(font->w); - font->h = FLIPWORD(font->h); - font->nchars = FLIPWORD(font->nchars); - body_size = font->w * font->h * font->nchars; - } - - if (body_size != body_size_check) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font"); - efree(font); - php_stream_close(stream); - RETURN_FALSE; - } - - font->data = emalloc(body_size); - b = 0; - while (b < body_size && (n = php_stream_read(stream, &font->data[b], body_size - b))) { - b += n; - } - - if (!n) { - efree(font->data); - efree(font); - if (php_stream_eof(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading body"); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body"); - } - php_stream_close(stream); - RETURN_FALSE; - } - php_stream_close(stream); - - /* Adding 5 to the font index so we will never have font indices - * that overlap with the old fonts (with indices 1-5). The first - * list index given out is always 1. - */ - ind = 5 + zend_list_insert(font, le_gd_font); - - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto bool imagesetstyle(resource im, array styles) - Set the line drawing styles for use with imageline and IMG_COLOR_STYLED. */ -PHP_FUNCTION(imagesetstyle) -{ - zval **IM, **styles; - gdImagePtr im; - int * stylearr; - int index; - HashPosition pos; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &styles) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_array_ex(styles); - - /* copy the style values in the stylearr */ - stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(*styles)), 0); - - zend_hash_internal_pointer_reset_ex(HASH_OF(*styles), &pos); - - for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*styles), &pos)) { - zval ** item; - - if (zend_hash_get_current_data_ex(HASH_OF(*styles), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_long_ex(item); - - stylearr[index++] = Z_LVAL_PP(item); - } - - gdImageSetStyle(im, stylearr, index); - - efree(stylearr); - - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_LIBGD20 -/* {{{ proto resource imagecreatetruecolor(int x_size, int y_size) - Create a new true color image */ -PHP_FUNCTION(imagecreatetruecolor) -{ - zval **x_size, **y_size; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(x_size); - convert_to_long_ex(y_size); - - if (Z_LVAL_PP(x_size) <= 0 || Z_LVAL_PP(y_size) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); - RETURN_FALSE; - } - - im = gdImageCreateTrueColor(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -} -/* }}} */ - -/* {{{ proto bool imageistruecolor(resource im) - return true if the image uses truecolor */ -PHP_FUNCTION(imageistruecolor) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_BOOL(im->trueColor); -} -/* }}} */ - -/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted) - Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */ -PHP_FUNCTION(imagetruecolortopalette) -{ - zval **IM, **dither, **ncolors; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &dither, &ncolors) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_boolean_ex(dither); - convert_to_long_ex(ncolors); - - gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors)); - - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_GD_BUNDLED -/* {{{ proto bool imagecolormatch(resource im1, resource im2) - Makes the colors of the palette version of an image more closely match the true color version */ -PHP_FUNCTION(imagecolormatch) -{ - zval **IM1, **IM2; - gdImagePtr im1, im2; - int result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM1, &IM2 ) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im1, gdImagePtr, IM1, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im2, gdImagePtr, IM2, -1, "Image", le_gd); - - result = gdImageColorMatch(im1, im2); - switch (result) { - case -1: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image1 must be TrueColor" ); - RETURN_FALSE; - break; - case -2: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image2 must be Palette" ); - RETURN_FALSE; - break; - case -3: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image1 and Image2 must be the same size" ); - RETURN_FALSE; - break; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool imagesetthickness(resource im, int thickness) - Set line thickness for drawing lines, ellipses, rectangles, polygons etc. */ -PHP_FUNCTION(imagesetthickness) -{ - zval **IM, **thick; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &thick) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_long_ex(thick); - - gdImageSetThickness(im, Z_LVAL_PP(thick)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagefilledellipse(resource im, int cx, int cy, int w, int h, int color) - Draw an ellipse */ -PHP_FUNCTION(imagefilledellipse) -{ - zval **IM, **cx, **cy, **w, **h, **color; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(color); - - gdImageFilledEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagefilledarc(resource im, int cx, int cy, int w, int h, int s, int e, int col, int style) - Draw a filled partial ellipse */ -PHP_FUNCTION(imagefilledarc) -{ - zval **IM, **cx, **cy, **w, **h, **ST, **E, **col, **style; - gdImagePtr im; - int e, st; - - if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(ST); - convert_to_long_ex(E); - convert_to_long_ex(col); - convert_to_long_ex(style); - - e = Z_LVAL_PP(E); - if (e < 0) { - e %= 360; - } - - st = Z_LVAL_PP(ST); - if (st < 0) { - st %= 360; - } - - gdImageFilledArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col), Z_LVAL_PP(style)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagealphablending(resource im, bool on) - Turn alpha blending mode on or off for the given image */ -PHP_FUNCTION(imagealphablending) -{ - zval **IM, **blend; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &blend) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_boolean_ex(blend); - - gdImageAlphaBlending(im, Z_LVAL_PP(blend)); - - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_LIBGD20 -/* {{{ proto bool imagesavealpha(resource im, bool on) - Include alpha channel to a saved image */ -PHP_FUNCTION(imagesavealpha) -{ - zval **IM, **save; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &save) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_boolean_ex(save); - - gdImageSaveAlpha(im, Z_LVAL_PP(save)); - - RETURN_TRUE; -} -#endif - -#if HAVE_GD_BUNDLED -/* {{{ proto bool imagelayereffect(resource im, int effect) - Set the alpha blending flag to use the bundled libgd layering effects */ -PHP_FUNCTION(imagelayereffect) -{ - zval **IM, **effect; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &effect) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_long_ex(effect); - - gdImageAlphaBlending(im, Z_LVAL_PP(effect) ); - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto int imagecolorallocatealpha(resource im, int red, int green, int blue, int alpha) - Allocate a color with an alpha level. Works for true color and palette based images */ -PHP_FUNCTION(imagecolorallocatealpha) -{ - zval *IM; - long red, green, blue, alpha; - gdImagePtr im; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha)); -} -/* }}} */ - -/* {{{ proto int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha) - Resolve/Allocate a colour with an alpha level. Works for true colour and palette based images */ -PHP_FUNCTION(imagecolorresolvealpha) -{ - zval **IM, ** red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorResolveAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -} -/* }}} */ - -/* {{{ proto int imagecolorclosestalpha(resource im, int red, int green, int blue, int alpha) - Find the closest matching colour with alpha transparency */ -PHP_FUNCTION(imagecolorclosestalpha) -{ - zval **IM, ** red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorClosestAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -} -/* }}} */ - -/* {{{ proto int imagecolorexactalpha(resource im, int red, int green, int blue, int alpha) - Find exact match for colour with transparency */ -PHP_FUNCTION(imagecolorexactalpha) -{ - zval **IM, **red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorExactAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -} -/* }}} */ - -/* {{{ proto bool imagecopyresampled(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) - Copy and resize part of an image using resampling to help ensure clarity */ -PHP_FUNCTION(imagecopyresampled) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; - gdImagePtr im_dst, im_src; - int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(DW); - convert_to_long_ex(DH); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - dstH = Z_LVAL_PP(DH); - dstW = Z_LVAL_PP(DW); - - gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - - RETURN_TRUE; -} -/* }}} */ -#endif - -#ifdef HAVE_GD_BUNDLED -/* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor) - Rotate an image using a custom angle */ -PHP_FUNCTION(imagerotate) -{ - zval *SIM; - gdImagePtr im_dst, im_src; - double degrees; - long color; - long ignoretransparent = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, °rees, &color, &ignoretransparent) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - im_dst = gdImageRotate(im_src, degrees, color, ignoretransparent); - - if (im_dst != NULL) { - ZEND_REGISTER_RESOURCE(return_value, im_dst, le_gd); - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif - -#if HAVE_GD_IMAGESETTILE -/* {{{ proto bool imagesettile(resource image, resource tile) - Set the tile image to $tile when filling $image with the "IMG_COLOR_TILED" color */ -PHP_FUNCTION(imagesettile) -{ - zval **IM, **TILE; - gdImagePtr im, tile; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - - gdImageSetTile(im, tile); - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if HAVE_GD_IMAGESETBRUSH -/* {{{ proto bool imagesetbrush(resource image, resource brush) - Set the brush image to $brush when filling $image with the "IMG_COLOR_BRUSHED" color */ -PHP_FUNCTION(imagesetbrush) -{ - zval **IM, **TILE; - gdImagePtr im, tile; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - - gdImageSetBrush(im, tile); - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto resource imagecreate(int x_size, int y_size) - Create a new image */ -PHP_FUNCTION(imagecreate) -{ - zval **x_size, **y_size; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(x_size); - convert_to_long_ex(y_size); - - if (Z_LVAL_PP(x_size) <= 0 || Z_LVAL_PP(y_size) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); - RETURN_FALSE; - } - - im = gdImageCreate(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -} -/* }}} */ - -/* {{{ proto int imagetypes(void) - Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM */ -PHP_FUNCTION(imagetypes) -{ - int ret=0; -#ifdef HAVE_GD_GIF_CREATE - ret = 1; -#endif -#ifdef HAVE_GD_JPG - ret |= 2; -#endif -#ifdef HAVE_GD_PNG - ret |= 4; -#endif -#ifdef HAVE_GD_WBMP - ret |= 8; -#endif -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) - ret |= 16; -#endif - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ _php_image_type - */ -static const char php_sig_gd2[3] = {'g', 'd', '2'}; - -static int _php_image_type (char data[8]) -{ -#ifdef HAVE_LIBGD15 - /* Based on ext/standard/image.c */ - - if (data == NULL) { - return -1; - } - - if (!memcmp(data, php_sig_gd2, 3)) { - return PHP_GDIMG_TYPE_GD2; - } else if (!memcmp(data, php_sig_jpg, 3)) { - return PHP_GDIMG_TYPE_JPG; - } else if (!memcmp(data, php_sig_png, 3)) { - if (!memcmp(data, php_sig_png, 8)) { - return PHP_GDIMG_TYPE_PNG; - } - } else if (!memcmp(data, php_sig_gif, 3)) { - return PHP_GDIMG_TYPE_GIF; - } -#ifdef HAVE_GD_WBMP - else { - gdIOCtx *io_ctx; - io_ctx = gdNewDynamicCtxEx(8, data, 0); - if (io_ctx) { - if (getmbi((int(*)(void *)) gdGetC, io_ctx) == 0 && skipheader((int(*)(void *)) gdGetC, io_ctx) == 0 ) { -#if HAVE_LIBGD204 - io_ctx->gd_free(io_ctx); -#else - io_ctx->free(io_ctx); -#endif - return PHP_GDIMG_TYPE_WBM; - } else { -#if HAVE_LIBGD204 - io_ctx->gd_free(io_ctx); -#else - io_ctx->free(io_ctx); -#endif - } - } - } -#endif - return -1; -#endif -} -/* }}} */ - -#ifdef HAVE_LIBGD15 -/* {{{ _php_image_create_from_string - */ -gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC) -{ - gdImagePtr im; - gdIOCtx *io_ctx; - - io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0); - - if (!io_ctx) { - return NULL; - } - - im = (*ioctx_func_p)(io_ctx); - if (!im) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn); - return NULL; - } - -#if HAVE_LIBGD204 - io_ctx->gd_free(io_ctx); -#else - io_ctx->free(io_ctx); -#endif - - return im; -} -/* }}} */ - -/* {{{ proto resource imagecreatefromstring(string image) - Create a new image from the image stream in the string */ -PHP_FUNCTION(imagecreatefromstring) -{ - zval **data; - gdImagePtr im; - int imtype; - char sig[8]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &data) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(data); - memcpy(sig, Z_STRVAL_PP(data), 8); - - imtype = _php_image_type(sig); - - switch (imtype) { - case PHP_GDIMG_TYPE_JPG: -#ifdef HAVE_GD_JPG - im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No JPEG support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_PNG: -#ifdef HAVE_GD_PNG - im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PNG support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_GIF: -#ifdef HAVE_GD_GIF_READ - im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No GIF support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_WBM: -#ifdef HAVE_GD_WBMP - im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No WBMP support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_GD2: -#ifdef HAVE_GD_GD2 - im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No GD2 support in this PHP build"); - RETURN_FALSE; -#endif - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data is not in a recognized format."); - RETURN_FALSE; - } - - if (!im) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't create GD Image Stream out of Data"); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -} -/* }}} */ -#endif - -/* {{{ _php_image_create_from - */ -static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()) -{ - zval **file, **srcx, **srcy, **width, **height; - gdImagePtr im = NULL; - char *fn=NULL; - php_stream *stream; - FILE * fp = NULL; - int argc=ZEND_NUM_ARGS(); - - if ((image_type == PHP_GDIMG_TYPE_GD2PART && argc != 5) || - (image_type != PHP_GDIMG_TYPE_GD2PART && argc != 1) || - zend_get_parameters_ex(argc, &file, &srcx, &srcy, &width, &height) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - if (argc == 5 && image_type == PHP_GDIMG_TYPE_GD2PART) { - multi_convert_to_long_ex(4, srcx, srcy, width, height); - } - - fn = Z_STRVAL_PP(file); - - stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL); - if (stream == NULL) { - RETURN_FALSE; - } - -#ifndef USE_GD_IOCTX - ioctx_func_p = NULL; /* don't allow sockets without IOCtx */ -#endif - - /* try and avoid allocating a FILE* if the stream is not naturally a FILE* */ - if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) { - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS)) { - goto out_err; - } - } else if (ioctx_func_p) { -#ifdef USE_GD_IOCTX - /* we can create an io context */ - gdIOCtx* io_ctx; - size_t buff_size; - char *buff; - - /* needs to be malloc (persistent) - GD will free() it later */ - buff_size = php_stream_copy_to_mem(stream, &buff, PHP_STREAM_COPY_ALL, 1); - - if (!buff_size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data"); - goto out_err; - } - - io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0); - if (!io_ctx) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context"); - goto out_err; - } - - if (image_type == PHP_GDIMG_TYPE_GD2PART) { - im = (*ioctx_func_p)(io_ctx, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); - } else { - im = (*ioctx_func_p)(io_ctx); - } -#if HAVE_LIBGD204 - io_ctx->gd_free(io_ctx); -#else - io_ctx->free(io_ctx); -#endif - -#endif - } - else { - /* try and force the stream to be FILE* */ - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) { - goto out_err; - } - } - - if (!im && fp) { - switch (image_type) { - case PHP_GDIMG_TYPE_GD2PART: - im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); - break; -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) - case PHP_GDIMG_TYPE_XPM: - im = gdImageCreateFromXpm(fn); - break; -#endif - default: - im = (*func_p)(fp); - break; - } - - fflush(fp); - } - - if (im) { - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); - php_stream_close(stream); - return; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid %s file", fn, tn); -out_err: - php_stream_close(stream); - RETURN_FALSE; - -} -/* }}} */ - -#ifdef HAVE_GD_GIF_READ -/* {{{ proto resource imagecreatefromgif(string filename) - Create a new image from GIF file or URL */ -PHP_FUNCTION(imagecreatefromgif) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageCreateFromGif, gdImageCreateFromGifCtx); -} -/* }}} */ -#endif /* HAVE_GD_GIF_READ */ - -#ifdef HAVE_GD_JPG -/* {{{ proto resource imagecreatefromjpeg(string filename) - Create a new image from JPEG file or URL */ -PHP_FUNCTION(imagecreatefromjpeg) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageCreateFromJpeg, gdImageCreateFromJpegCtx); -} -/* }}} */ -#endif /* HAVE_GD_JPG */ - -#ifdef HAVE_GD_PNG -/* {{{ proto resource imagecreatefrompng(string filename) - Create a new image from PNG file or URL */ -PHP_FUNCTION(imagecreatefrompng) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImageCreateFromPng, gdImageCreateFromPngCtx); -} -/* }}} */ -#endif /* HAVE_GD_PNG */ - -#ifdef HAVE_GD_XBM -/* {{{ proto resource imagecreatefromxbm(string filename) - Create a new image from XBM file or URL */ -PHP_FUNCTION(imagecreatefromxbm) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageCreateFromXbm, NULL); -} -/* }}} */ -#endif /* HAVE_GD_XBM */ - -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) -/* {{{ proto resource imagecreatefromxpm(string filename) - Create a new image from XPM file or URL */ -PHP_FUNCTION(imagecreatefromxpm) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm, NULL); -} -/* }}} */ -#endif - -#ifdef HAVE_GD_WBMP -/* {{{ proto resource imagecreatefromwbmp(string filename) - Create a new image from WBMP file or URL */ -PHP_FUNCTION(imagecreatefromwbmp) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP, gdImageCreateFromWBMPCtx); -} -/* }}} */ -#endif /* HAVE_GD_WBMP */ - -/* {{{ proto resource imagecreatefromgd(string filename) - Create a new image from GD file or URL */ -PHP_FUNCTION(imagecreatefromgd) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageCreateFromGd, gdImageCreateFromGdCtx); -} -/* }}} */ - -#ifdef HAVE_GD_GD2 -/* {{{ proto resource imagecreatefromgd2(string filename) - Create a new image from GD2 file or URL */ -PHP_FUNCTION(imagecreatefromgd2) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageCreateFromGd2, gdImageCreateFromGd2Ctx); -} -/* }}} */ - -/* {{{ proto resource imagecreatefromgd2part(string filename, int srcX, int srcY, int width, int height) - Create a new image from a given part of GD2 file or URL */ -PHP_FUNCTION(imagecreatefromgd2part) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part, gdImageCreateFromGd2PartCtx); -} -/* }}} */ -#endif /* HAVE_GD_GD2 */ - -/* {{{ _php_image_output - */ -static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) -{ - zval **imgind, **file, **quality, **type; - gdImagePtr im; - char *fn = NULL; - FILE *fp; - int argc = ZEND_NUM_ARGS(); - int q = -1, i, t = 1; - - /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ - /* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */ - /* The quality parameter for gd2 stands for chunk size */ - - if (argc < 1 || argc > 4 || zend_get_parameters_ex(argc, &imgind, &file, &quality, &type) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", le_gd); - - if (argc > 1) { - convert_to_string_ex(file); - fn = Z_STRVAL_PP(file); - if (argc == 3) { - convert_to_long_ex(quality); - q = Z_LVAL_PP(quality); - } - if (argc == 4) { - convert_to_long_ex(type); - t = Z_LVAL_PP(type); - } - } - - if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { - if (!fn || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn); - RETURN_FALSE; - } - - fp = VCWD_FOPEN(fn, "wb"); - if (!fp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn); - RETURN_FALSE; - } - - switch (image_type) { -#ifdef HAVE_GD_WBMP - case PHP_GDIMG_CONVERT_WBM: - if (q == -1) { - q = 0; - } else if (q < 0 || q > 255) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); - q = 0; - } - gdImageWBMP(im, q, fp); - break; -#endif - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, fp, q); - break; - case PHP_GDIMG_TYPE_WBM: - for (i = 0; i < gdImageColorsTotal(im); i++) { - if (gdImageRed(im, i) == 0) break; - } - (*func_p)(im, i, fp); - break; -#if HAVE_LIBGD20 - case PHP_GDIMG_TYPE_GD: - if (im->trueColor){ - gdImageTrueColorToPalette(im,1,256); - } - (*func_p)(im, fp); - break; -#endif - default: - if (q == -1) { - q = 128; - } - (*func_p)(im, fp, q, t); - break; - } - fflush(fp); - fclose(fp); - } else { - int b; - FILE *tmp; - char buf[4096]; - char *path; - - tmp = php_open_temporary_file(NULL, NULL, &path TSRMLS_CC); - if (tmp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file"); - RETURN_FALSE; - } - - switch (image_type) { -#ifdef HAVE_GD_WBMP - case PHP_GDIMG_CONVERT_WBM: - if (q == -1) { - q = 0; - } else if (q < 0 || q > 255) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); - q = 0; - } - gdImageWBMP(im, q, tmp); - break; -#endif - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, tmp, q); - break; - case PHP_GDIMG_TYPE_WBM: - for (i = 0; i < gdImageColorsTotal(im); i++) { - if (gdImageRed(im, i) == 0) { - break; - } - } - (*func_p)(im, q, tmp); - break; -#if HAVE_LIBGD20 - case PHP_GDIMG_TYPE_GD: - if (im->trueColor) { - gdImageTrueColorToPalette(im,1,256); - } - (*func_p)(im, tmp); - break; -#endif - default: - (*func_p)(im, tmp); - break; - } - - fseek(tmp, 0, SEEK_SET); - -#if APACHE && defined(CHARSET_EBCDIC) - /* XXX this is unlikely to work any more thies@thieso.net */ - - /* This is a binary file already: avoid EBCDIC->ASCII conversion */ - ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); -#endif - while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) { - php_write(buf, b TSRMLS_CC); - } - - fclose(tmp); - VCWD_UNLINK((const char *)path); /* make sure that the temporary file is removed */ - efree(path); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagexbm(int im, string filename [, int foreground]) - Output XBM image to browser or file */ -#if HAVE_GD_BUNDLED -PHP_FUNCTION(imagexbm) -{ - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageXbmCtx); -} -#endif -/* }}} */ - -#ifdef HAVE_GD_GIF_CREATE -/* {{{ proto bool imagegif(resource im [, string filename]) - Output GIF image to browser or file */ -PHP_FUNCTION(imagegif) -{ -#ifdef HAVE_GD_GIF_CTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGifCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGif); -#endif -} -/* }}} */ -#endif /* HAVE_GD_GIF_CREATE */ - -#ifdef HAVE_GD_PNG -/* {{{ proto bool imagepng(resource im [, string filename [, int quality]]) - Output PNG image to browser or file */ -PHP_FUNCTION(imagepng) -{ -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePngCtxEx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePng); -#endif -} -/* }}} */ -#endif /* HAVE_GD_PNG */ - -#ifdef HAVE_GD_JPG -/* {{{ proto bool imagejpeg(resource im [, string filename [, int quality]]) - Output JPEG image to browser or file */ -PHP_FUNCTION(imagejpeg) -{ -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpegCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpeg); -#endif -} -/* }}} */ -#endif /* HAVE_GD_JPG */ - -#ifdef HAVE_GD_WBMP -/* {{{ proto bool imagewbmp(resource im [, string filename, [, int foreground]]) - Output WBMP image to browser or file */ -PHP_FUNCTION(imagewbmp) -{ -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMPCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMP); -#endif -} -/* }}} */ -#endif /* HAVE_GD_WBMP */ - -/* {{{ proto bool imagegd(resource im [, string filename]) - Output GD image to browser or file */ -PHP_FUNCTION(imagegd) -{ - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageGd); -} -/* }}} */ - -#ifdef HAVE_GD_GD2 -/* {{{ proto bool imagegd2(resource im [, string filename, [, int chunk_size, [, int type]]]) - Output GD2 image to browser or file */ -PHP_FUNCTION(imagegd2) -{ - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageGd2); -} -/* }}} */ -#endif /* HAVE_GD_GD2 */ - -/* {{{ proto bool imagedestroy(resource im) - Destroy an image */ -PHP_FUNCTION(imagedestroy) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - zend_list_delete(Z_LVAL_PP(IM)); - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto int imagecolorallocate(resource im, int red, int green, int blue) - Allocate a color for an image */ -PHP_FUNCTION(imagecolorallocate) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorAllocate(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -#if HAVE_LIBGD15 -/* {{{ proto void imagepalettecopy(resource dst, resource src) - Copy the palette from the src image onto the dst image */ -PHP_FUNCTION(imagepalettecopy) -{ - zval **dstim, **srcim; - gdImagePtr dst, src; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dstim, &srcim) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(dst, gdImagePtr, dstim, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(src, gdImagePtr, srcim, -1, "Image", le_gd); - - gdImagePaletteCopy(dst, src); -} -/* }}} */ -#endif - -/* {{{ proto int imagecolorat(resource im, int x, int y) - Get the index of the color of a pixel */ -PHP_FUNCTION(imagecolorat) -{ - zval **IM, **x, **y; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &x, &y) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - -#if HAVE_LIBGD20 - if (gdImageTrueColor(im)) { - if (im->tpixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { - RETURN_LONG(gdImageTrueColorPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y))); - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", Z_LVAL_PP(x), Z_LVAL_PP(y)); - RETURN_FALSE; - } - } else { -#endif - if (im->pixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { -#if HAVE_LIBGD13 - RETURN_LONG(im->pixels[Z_LVAL_PP(y)][Z_LVAL_PP(x)]); -#else - RETURN_LONG(im->pixels[Z_LVAL_PP(x)][Z_LVAL_PP(y)]); -#endif - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", Z_LVAL_PP(x), Z_LVAL_PP(y)); - RETURN_FALSE; - } -#if HAVE_LIBGD20 - } -#endif -} -/* }}} */ - -/* {{{ proto int imagecolorclosest(resource im, int red, int green, int blue) - Get the index of the closest color to the specified color */ -PHP_FUNCTION(imagecolorclosest) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorClosest(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -#if HAVE_COLORCLOSESTHWB -/* {{{ proto int imagecolorclosesthwb(resource im, int red, int green, int blue) - Get the index of the color which has the hue, white and blackness nearest to the given color */ -PHP_FUNCTION(imagecolorclosesthwb) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorClosestHWB(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ -#endif - -/* {{{ proto bool imagecolordeallocate(resource im, int index) - De-allocate a color for an image */ -PHP_FUNCTION(imagecolordeallocate) -{ - zval **IM, **index; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - -#if HAVE_LIBGD20 - /* We can return right away for a truecolor image as deallocating colours is meaningless here */ - if (gdImageTrueColor(im)) { - RETURN_TRUE; - } -#endif - - convert_to_long_ex(index); - col = Z_LVAL_PP(index); - - if (col >= 0 && col < gdImageColorsTotal(im)) { - gdImageColorDeallocate(im, col); - RETURN_TRUE; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int imagecolorresolve(resource im, int red, int green, int blue) - Get the index of the specified color or its closest possible alternative */ -PHP_FUNCTION(imagecolorresolve) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorResolve(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto int imagecolorexact(resource im, int red, int green, int blue) - Get the index of the specified color */ -PHP_FUNCTION(imagecolorexact) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorExact(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto void imagecolorset(resource im, int col, int red, int green, int blue) - Set the color for the specified palette index */ -PHP_FUNCTION(imagecolorset) -{ - zval **IM, **color, **red, **green, **blue; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &color, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(color); - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - col = Z_LVAL_PP(color); - - if (col >= 0 && col < gdImageColorsTotal(im)) { - im->red[col] = Z_LVAL_PP(red); - im->green[col] = Z_LVAL_PP(green); - im->blue[col] = Z_LVAL_PP(blue); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array imagecolorsforindex(resource im, int col) - Get the colors for an index */ -PHP_FUNCTION(imagecolorsforindex) -{ - zval **IM, **index; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(index); - col = Z_LVAL_PP(index); -#if HAVE_LIBGD20 - if ((col >= 0 && gdImageTrueColor(im)) || (!gdImageTrueColor(im) && col >= 0 && col < gdImageColorsTotal(im))) { - array_init(return_value); - - add_assoc_long(return_value,"red", gdImageRed(im,col)); - add_assoc_long(return_value,"green", gdImageGreen(im,col)); - add_assoc_long(return_value,"blue", gdImageBlue(im,col)); - add_assoc_long(return_value,"alpha", gdImageAlpha(im,col)); - } -#else - if (col >= 0 && col < gdImageColorsTotal(im)) { - array_init(return_value); - - add_assoc_long(return_value,"red", im->red[col]); - add_assoc_long(return_value,"green", im->green[col]); - add_assoc_long(return_value,"blue", im->blue[col]); - } -#endif - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imagegammacorrect(resource im, float inputgamma, float outputgamma) - Apply a gamma correction to a GD image */ -PHP_FUNCTION(imagegammacorrect) -{ - zval **IM, **inputgamma, **outputgamma; - gdImagePtr im; - int i; - double input, output; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &inputgamma, &outputgamma) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(inputgamma); - convert_to_double_ex(outputgamma); - - input = Z_DVAL_PP(inputgamma); - output = Z_DVAL_PP(outputgamma); - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - -#if HAVE_LIBGD20 - if (gdImageTrueColor(im)) { - int x, y, c; - - for (y = 0; y < gdImageSY(im); y++) { - for (x = 0; x < gdImageSX(im); x++) { - c = gdImageGetPixel(im, x, y); - gdImageSetPixel(im, x, y, - gdTrueColor( - (int) ((pow((pow((gdTrueColorGetRed(c) / 255.0), input)), 1.0 / output) * 255) + .5), - (int) ((pow((pow((gdTrueColorGetGreen(c) / 255.0), input)), 1.0 / output) * 255) + .5), - (int) ((pow((pow((gdTrueColorGetBlue(c) / 255.0), input)), 1.0 / output) * 255) + .5) - ) - ); - } - } - RETURN_TRUE; - } -#endif - for (i = 0; i < gdImageColorsTotal(im); i++) { - im->red[i] = (int)((pow((pow((im->red[i] / 255.0), input)), 1.0 / output) * 255) + .5); - im->green[i] = (int)((pow((pow((im->green[i] / 255.0), input)), 1.0 / output) * 255) + .5); - im->blue[i] = (int)((pow((pow((im->blue[i] / 255.0), input)), 1.0 / output) * 255) + .5); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagesetpixel(resource im, int x, int y, int col) - Set a single pixel */ -PHP_FUNCTION(imagesetpixel) -{ - zval **IM, **x, **y, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(col); - - gdImageSetPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imageline(resource im, int x1, int y1, int x2, int y2, int col) - Draw a line */ -PHP_FUNCTION(imageline) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - -#ifdef HAVE_GD_BUNDLED - if (im->antialias) { - gdImageAALine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - } else -#endif - { - gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagedashedline(resource im, int x1, int y1, int x2, int y2, int col) - Draw a dashed line */ -PHP_FUNCTION(imagedashedline) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageDashedLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagerectangle(resource im, int x1, int y1, int x2, int y2, int col) - Draw a rectangle */ -PHP_FUNCTION(imagerectangle) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagefilledrectangle(resource im, int x1, int y1, int x2, int y2, int col) - Draw a filled rectangle */ -PHP_FUNCTION(imagefilledrectangle) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageFilledRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagearc(resource im, int cx, int cy, int w, int h, int s, int e, int col) - Draw a partial ellipse */ -PHP_FUNCTION(imagearc) -{ - zval **IM, **cx, **cy, **w, **h, **ST, **E, **col; - gdImagePtr im; - int e, st; - - if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(ST); - convert_to_long_ex(E); - convert_to_long_ex(col); - - e = Z_LVAL_PP(E); - if (e < 0) { - e %= 360; - } - - st = Z_LVAL_PP(ST); - if (st < 0) { - st %= 360; - } - - gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imageellipse(resource im, int cx, int cy, int w, int h, int color) - Draw an ellipse */ -PHP_FUNCTION(imageellipse) -{ - zval **IM, **cx, **cy, **w, **h, **color; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(color); - -#ifdef HAVE_GD_IMAGEELLIPSE /* this function is missing from GD 2.0.1 */ - gdImageEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); -#else - gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), 0, 360, Z_LVAL_PP(color)); -#endif - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagefilltoborder(resource im, int x, int y, int border, int col) - Flood fill to specific color */ -PHP_FUNCTION(imagefilltoborder) -{ - zval **IM, **x, **y, **border, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &x, &y, &border, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(border); - convert_to_long_ex(col); - - gdImageFillToBorder(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(border), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagefill(resource im, int x, int y, int col) - Flood fill */ -PHP_FUNCTION(imagefill) -{ - zval **IM, **x, **y, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(col); - - gdImageFill(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagecolorstotal(resource im) - Find out the number of colors in an image's palette */ -PHP_FUNCTION(imagecolorstotal) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageColorsTotal(im)); -} -/* }}} */ - -/* {{{ proto int imagecolortransparent(resource im [, int col]) - Define a color as transparent */ -PHP_FUNCTION(imagecolortransparent) -{ - zval **IM, **COL; - gdImagePtr im; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - break; - case 2: - if (zend_get_parameters_ex(2, &IM, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_long_ex(COL); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - if (ZEND_NUM_ARGS() > 1) { - gdImageColorTransparent(im, Z_LVAL_PP(COL)); - } - - RETURN_LONG(gdImageGetTransparent(im)); -} -/* }}} */ - -/* {{{ proto int imageinterlace(resource im [, int interlace]) - Enable or disable interlace */ -PHP_FUNCTION(imageinterlace) -{ - zval **IM, **INT; - gdImagePtr im; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - break; - case 2: - if (zend_get_parameters_ex(2, &IM, &INT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_long_ex(INT); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - if (ZEND_NUM_ARGS() > 1) { - gdImageInterlace(im, Z_LVAL_PP(INT)); - } - - RETURN_LONG(gdImageGetInterlaced(im)); -} -/* }}} */ - -/* {{{ php_imagepolygon - arg = 0 normal polygon - arg = 1 filled polygon */ -/* im, points, num_points, col */ -static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) -{ - zval **IM, **POINTS, **NPOINTS, **COL; - pval **var = NULL; - gdImagePtr im; - gdPointPtr points; - int npoints, col, nelem, i; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &POINTS, &NPOINTS, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(NPOINTS); - convert_to_long_ex(COL); - - npoints = Z_LVAL_PP(NPOINTS); - col = Z_LVAL_PP(COL); - - if (Z_TYPE_PP(POINTS) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument to imagepolygon not an array"); - RETURN_FALSE; - } - - nelem = zend_hash_num_elements(Z_ARRVAL_PP(POINTS)); - if (nelem < 6) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array"); - RETURN_FALSE; - } - - if (nelem < npoints * 2) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2); - RETURN_FALSE; - } - - points = (gdPointPtr) safe_emalloc(npoints, sizeof(gdPoint), 0); - - for (i = 0; i < npoints; i++) { - if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) { - SEPARATE_ZVAL((var)); - convert_to_long(*var); - points[i].x = Z_LVAL_PP(var); - } - if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2) + 1, (void **) &var) == SUCCESS) { - SEPARATE_ZVAL(var); - convert_to_long(*var); - points[i].y = Z_LVAL_PP(var); - } - } - - if (filled) { - gdImageFilledPolygon(im, points, npoints, col); - } else { - gdImagePolygon(im, points, npoints, col); - } - - efree(points); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepolygon(resource im, array point, int num_points, int col) - Draw a polygon */ -PHP_FUNCTION(imagepolygon) -{ - php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool imagefilledpolygon(resource im, array point, int num_points, int col) - Draw a filled polygon */ -PHP_FUNCTION(imagefilledpolygon) -{ - php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_find_gd_font - */ -static gdFontPtr php_find_gd_font(int size TSRMLS_DC) -{ - gdFontPtr font; - int ind_type; - - switch (size) { - case 1: - font = gdFontTiny; - break; - case 2: - font = gdFontSmall; - break; - case 3: - font = gdFontMediumBold; - break; - case 4: - font = gdFontLarge; - break; - case 5: - font = gdFontGiant; - break; - default: - font = zend_list_find(size - 5, &ind_type); - if (!font || ind_type != le_gd_font) { - if (size < 1) { - font = gdFontTiny; - } else { - font = gdFontGiant; - } - } - break; - } - - return font; -} -/* }}} */ - -/* {{{ php_imagefontsize - * arg = 0 ImageFontWidth - * arg = 1 ImageFontHeight - */ -static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg) -{ - zval **SIZE; - gdFontPtr font; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &SIZE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(SIZE); - - font = php_find_gd_font(Z_LVAL_PP(SIZE) TSRMLS_CC); - RETURN_LONG(arg ? font->h : font->w); -} -/* }}} */ - -/* {{{ proto int imagefontwidth(int font) - Get font width */ -PHP_FUNCTION(imagefontwidth) -{ - php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int imagefontheight(int font) - Get font height */ -PHP_FUNCTION(imagefontheight) -{ - php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_gdimagecharup - * workaround for a bug in gd 1.2 */ -static void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) -{ - int cx, cy, px, py, fline; - cx = 0; - cy = 0; - - if ((c < f->offset) || (c >= (f->offset + f->nchars))) { - return; - } - - fline = (c - f->offset) * f->h * f->w; - for (py = y; (py > (y - f->w)); py--) { - for (px = x; (px < (x + f->h)); px++) { - if (f->data[fline + cy * f->w + cx]) { - gdImageSetPixel(im, px, py, color); - } - cy++; - } - cy = 0; - cx++; - } -} -/* }}} */ - -/* {{{ php_imagechar - * arg = 0 ImageChar - * arg = 1 ImageCharUp - * arg = 2 ImageString - * arg = 3 ImageStringUp - */ -static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval **IM, **SIZE, **X, **Y, **C, **COL; - gdImagePtr im; - int ch = 0, col, x, y, size, i, l = 0; - unsigned char *str = NULL; - gdFontPtr font; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &SIZE, &X, &Y, &C, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(SIZE); - convert_to_long_ex(X); - convert_to_long_ex(Y); - convert_to_string_ex(C); - convert_to_long_ex(COL); - - col = Z_LVAL_PP(COL); - - if (mode < 2) { - ch = (int)((unsigned char)*(Z_STRVAL_PP(C))); - } else { - str = (unsigned char *) estrndup(Z_STRVAL_PP(C), Z_STRLEN_PP(C)); - l = strlen(str); - } - - y = Z_LVAL_PP(Y); - x = Z_LVAL_PP(X); - size = Z_LVAL_PP(SIZE); - - font = php_find_gd_font(size TSRMLS_CC); - - switch (mode) { - case 0: - gdImageChar(im, font, x, y, ch, col); - break; - case 1: - php_gdimagecharup(im, font, x, y, ch, col); - break; - case 2: - for (i = 0; (i < l); i++) { - gdImageChar(im, font, x, y, (int) ((unsigned char) str[i]), col); - x += font->w; - } - break; - case 3: { - for (i = 0; (i < l); i++) { - /* php_gdimagecharup(im, font, x, y, (int) str[i], col); */ - gdImageCharUp(im, font, x, y, (int) str[i], col); - y -= font->w; - } - break; - } - } - if (str) { - efree(str); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagechar(resource im, int font, int x, int y, string c, int col) - Draw a character */ -PHP_FUNCTION(imagechar) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool imagecharup(resource im, int font, int x, int y, string c, int col) - Draw a character rotated 90 degrees counter-clockwise */ -PHP_FUNCTION(imagecharup) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool imagestring(resource im, int font, int x, int y, string str, int col) - Draw a string horizontally */ -PHP_FUNCTION(imagestring) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto bool imagestringup(resource im, int font, int x, int y, string str, int col) - Draw a string vertically - rotated 90 degrees counter-clockwise */ -PHP_FUNCTION(imagestringup) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); -} -/* }}} */ - -/* {{{ proto bool imagecopy(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h) - Copy part of an image */ -PHP_FUNCTION(imagecopy) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - - gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH); - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_LIBGD15 -/* {{{ proto bool imagecopymerge(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) - Merge one part of an image with another */ -PHP_FUNCTION(imagecopymerge) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX, pct; - - if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(PCT); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - pct = Z_LVAL_PP(PCT); - - gdImageCopyMerge(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagecopymergegray(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) - Merge one part of an image with another */ -PHP_FUNCTION(imagecopymergegray) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX, pct; - - if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(PCT); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - pct = Z_LVAL_PP(PCT); - - gdImageCopyMergeGray(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool imagecopyresized(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) - Copy and resize part of an image */ -PHP_FUNCTION(imagecopyresized) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; - gdImagePtr im_dst, im_src; - int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(DW); - convert_to_long_ex(DH); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - dstH = Z_LVAL_PP(DH); - dstW = Z_LVAL_PP(DW); - - if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); - RETURN_FALSE; - } - - gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagesx(resource im) - Get image width */ -PHP_FUNCTION(imagesx) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageSX(im)); -} -/* }}} */ - -/* {{{ proto int imagesy(resource im) - Get image height */ -PHP_FUNCTION(imagesy) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageSY(im)); -} -/* }}} */ - -#ifdef ENABLE_GD_TTF -#define TTFTEXT_DRAW 0 -#define TTFTEXT_BBOX 1 -#endif - -#ifdef ENABLE_GD_TTF - -#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX -/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) - Give the bounding box of a text using fonts via freetype2 */ -PHP_FUNCTION(imageftbbox) -{ - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1); -} -/* }}} */ - -/* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) - Write text to the image using fonts via freetype2 */ -PHP_FUNCTION(imagefttext) -{ - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1); -} -/* }}} */ -#endif - -/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) - Give the bounding box of a text using TrueType fonts */ -PHP_FUNCTION(imagettfbbox) -{ - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 0); -} -/* }}} */ - -/* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) - Write text to the image using a TrueType font */ -PHP_FUNCTION(imagettftext) -{ - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 0); -} -/* }}} */ - -/* {{{ php_imagettftext_common - */ -static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int extended) -{ - zval *IM, *EXT = NULL; - gdImagePtr im=NULL; - long col = -1, x = -1, y = -1; - int str_len, fontname_len, i, brect[8]; - double ptsize, angle; - unsigned char *str = NULL, *fontname = NULL; - char *error = NULL; - int argc = ZEND_NUM_ARGS(); -#if HAVE_GD_STRINGFTEX - gdFTStringExtra strex = {0}; -#endif - -#if !HAVE_GD_STRINGFTEX - assert(!extended); -#endif - - if (mode == TTFTEXT_BBOX) { - if (argc < 4 || argc > ((extended) ? 5 : 4)) { - ZEND_WRONG_PARAM_COUNT(); - } else if (zend_parse_parameters(argc TSRMLS_CC, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) { - RETURN_FALSE; - } - } else { - if (argc < 8 || argc > ((extended) ? 9 : 8)) { - ZEND_WRONG_PARAM_COUNT(); - } else if (zend_parse_parameters(argc TSRMLS_CC, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); - } - - /* convert angle to radians */ - angle = angle * (M_PI/180); - -#if HAVE_GD_STRINGFTEX - if (extended && EXT) { /* parse extended info */ - HashPosition pos; - - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(EXT), &pos); - do { - zval ** item; - char * key; - ulong num_key; - - if (zend_hash_get_current_key_ex(HASH_OF(EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { - continue; - } - - if (zend_hash_get_current_data_ex(HASH_OF(EXT), (void **) &item, &pos) == FAILURE) { - continue; - } - - if (strcmp("linespacing", key) == 0) { - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } - - } while (zend_hash_move_forward_ex(HASH_OF(EXT), &pos) == SUCCESS); - } -#endif - -#ifdef VIRTUAL_DIR - { - char tmp_font_path[MAXPATHLEN]; - - if (VCWD_REALPATH(fontname, tmp_font_path)) { - fontname = (unsigned char *) fontname; - } else { - fontname = NULL; - } - } -#else - fontname = (unsigned char *) fontname; -#endif - -#ifdef USE_GD_IMGSTRTTF -# if HAVE_GD_STRINGFTEX - if (extended) { - error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex); - } - else -# endif - -# if HAVE_GD_STRINGFT - error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str); -# elif HAVE_GD_STRINGTTF - error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y, str); -# endif -#endif - - if (error) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error); - RETURN_FALSE; - } - - array_init(return_value); - - /* return array with the text's bounding box */ - for (i = 0; i < 8; i++) { - add_next_index_long(return_value, brect[i]); - } -} -/* }}} */ -#endif /* ENABLE_GD_TTF */ - -#if HAVE_LIBT1 - -/* {{{ php_free_ps_font - */ -static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int *font = (int *) rsrc->ptr; - - T1_DeleteFont(*font); - efree(font); -} -/* }}} */ - -/* {{{ php_free_ps_enc - */ -static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - char **enc = (char **) rsrc->ptr; - - T1_DeleteEncoding(enc); -} -/* }}} */ - -/* {{{ proto resource imagepsloadfont(string pathname) - Load a new font from specified file */ -PHP_FUNCTION(imagepsloadfont) -{ - zval **file; - int f_ind, *font; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - f_ind = T1_AddFont(Z_STRVAL_PP(file)); - - if (f_ind < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(f_ind)); - } - - if (T1_LoadFont(f_ind)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load the font"); - RETURN_FALSE; - } - - font = (int *) emalloc(sizeof(int)); - *font = f_ind; - ZEND_REGISTER_RESOURCE(return_value, font, le_ps_font); -} -/* }}} */ - -/* {{{ proto int imagepscopyfont(int font_index) - Make a copy of a font for purposes like extending or reenconding */ -/* The function in t1lib which this function uses seem to be buggy... -PHP_FUNCTION(imagepscopyfont) -{ - zval **fnt; - int l_ind, type; - gd_ps_font *nf_ind, *of_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(fnt); - - of_ind = zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != le_ps_font) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - nf_ind = emalloc(sizeof(gd_ps_font)); - nf_ind->font_id = T1_CopyFont(of_ind->font_id); - - if (nf_ind->font_id < 0) { - l_ind = nf_ind->font_id; - efree(nf_ind); - switch (l_ind) { - case -1: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FontID %d is not loaded in memory", l_ind); - RETURN_FALSE; - break; - case -2: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to copy a logical font"); - RETURN_FALSE; - break; - case -3: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } - } - - nf_ind->extend = 1; - l_ind = zend_list_insert(nf_ind, le_ps_font); - RETURN_LONG(l_ind); -} -*/ -/* }}} */ - -/* {{{ proto bool imagepsfreefont(resource font_index) - Free memory used by a font */ -PHP_FUNCTION(imagepsfreefont) -{ - zval **fnt; - int *f_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - zend_list_delete(Z_LVAL_PP(fnt)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsencodefont(resource font_index, string filename) - To change a fonts character encoding vector */ -PHP_FUNCTION(imagepsencodefont) -{ - zval **fnt, **enc; - char **enc_vector; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &enc) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(enc); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - if ((enc_vector = T1_LoadEncoding(Z_STRVAL_PP(enc))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load encoding vector from %s", Z_STRVAL_PP(enc)); - RETURN_FALSE; - } - - T1_DeleteAllSizes(*f_ind); - if (T1_ReencodeFont(*f_ind, enc_vector)) { - T1_DeleteEncoding(enc_vector); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't reencode font"); - RETURN_FALSE; - } - - zend_list_insert(enc_vector, le_ps_enc); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsextendfont(resource font_index, float extend) - Extend or or condense (if extend < 1) a font */ -PHP_FUNCTION(imagepsextendfont) -{ - zval **fnt, **ext; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &ext) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(ext); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - T1_DeleteAllSizes(*f_ind); - - if (Z_DVAL_PP(ext) <= 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Second parameter %f out of range (must be > 0)", Z_DVAL_PP(ext)); - RETURN_FALSE; - } - - if (T1_ExtendFont(*f_ind, Z_DVAL_PP(ext)) != 0) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsslantfont(resource font_index, float slant) - Slant a font */ -PHP_FUNCTION(imagepsslantfont) -{ - zval **fnt, **slt; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &slt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(slt); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - if (T1_SlantFont(*f_ind, Z_DVAL_PP(slt)) != 0) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array imagepstext(resource image, string text, resource font, int size, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias]) - Rasterize a string over an image */ -PHP_FUNCTION(imagepstext) -{ - zval *img, *fnt; - int i, j; - long _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0; - int *f_ind; - int h_lines, v_lines, c_ind; - int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl; -#if HAVE_LIBGD20 - int fg_al, bg_al, al; -#endif - int aa[16]; - int amount_kern, add_width; - double angle = 0.0, extend; - unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - gdImagePtr bg_img; - GLYPH *str_img; - T1_OUTLINE *char_path, *str_path; - T1_TMATRIX *transform = NULL; - char *str; - int str_len; - int argc = ZEND_NUM_ARGS(); - - if (argc != 8 && argc != 12) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, &img, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font); - - /* Ensure that the provided colors are valid */ -#if HAVE_LIBGD20 - if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { -#else - if (_fg < 0 || _fg > gdImageColorsTotal(bg_img)) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %ld out of range", _fg); - RETURN_FALSE; - } - -#if HAVE_LIBGD20 - if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { -#else - if (_bg < 0 || _bg > gdImageColorsTotal(bg_img)) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %ld out of range", _bg); - RETURN_FALSE; - } - - fg_rd = gdImageRed (bg_img, _fg); - fg_gr = gdImageGreen(bg_img, _fg); - fg_bl = gdImageBlue (bg_img, _fg); -#if HAVE_LIBGD20 - fg_al = gdImageAlpha(bg_img, _fg); -#endif - - bg_rd = gdImageRed (bg_img, _bg); - bg_gr = gdImageGreen(bg_img, _bg); - bg_bl = gdImageBlue (bg_img, _bg); -#if HAVE_LIBGD20 - bg_al = gdImageAlpha(bg_img, _bg); -#endif - - for (i = 0; i < aa_steps; i++) { - rd = bg_rd + (double) (fg_rd - bg_rd) / aa_steps * (i + 1); - gr = bg_gr + (double) (fg_gr - bg_gr) / aa_steps * (i + 1); - bl = bg_bl + (double) (fg_bl - bg_bl) / aa_steps * (i + 1); -#if HAVE_LIBGD20 - al = bg_al + (double) (fg_al - bg_al) / aa_steps * (i + 1); - aa[i] = gdImageColorResolveAlpha(bg_img, rd, gr, bl, al); -#else - aa[i] = gdImageColorResolve(bg_img, rd, gr, bl); -#endif - } - - T1_AASetBitsPerPixel(8); - - switch (aa_steps) { - case 4: - T1_AASetGrayValues(0, 1, 2, 3, 4); - T1_AASetLevel(T1_AA_LOW); - break; - case 16: - T1_AAHSetGrayValues(aa_greys); - T1_AASetLevel(T1_AA_HIGH); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %ld as number of steps for antialiasing", aa_steps); - RETURN_FALSE; - } - - if (angle) { - transform = T1_RotateMatrix(NULL, angle); - } - - if (width) { - extend = T1_GetExtend(*f_ind); - str_path = T1_GetCharOutline(*f_ind, str[0], size, transform); - - if (!str_path) { - if (T1_errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno)); - } - RETURN_FALSE; - } - - for (i = 1; i < str_len; i++) { - amount_kern = (int) T1_GetKerning(*f_ind, str[i - 1], str[i]); - amount_kern += str[i - 1] == ' ' ? space : 0; - add_width = (int) (amount_kern + width) / extend; - - char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, size, transform); - str_path = T1_ConcatOutlines(str_path, char_path); - - char_path = T1_GetCharOutline(*f_ind, str[i], size, transform); - str_path = T1_ConcatOutlines(str_path, char_path); - } - str_img = T1_AAFillOutline(str_path, 0); - } else { - str_img = T1_AASetString(*f_ind, str, str_len, space, T1_KERNING, size, transform); - } - if (T1_errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno)); - RETURN_FALSE; - } - - h_lines = str_img->metrics.ascent - str_img->metrics.descent; - v_lines = str_img->metrics.rightSideBearing - str_img->metrics.leftSideBearing; - - for (i = 0; i < v_lines; i++) { - for (j = 0; j < h_lines; j++) { - switch (str_img->bits[j * v_lines + i]) { - case 0: - break; - default: - c_ind = aa[str_img->bits[j * v_lines + i] - 1]; - gdImageSetPixel(bg_img, x + str_img->metrics.leftSideBearing + i, y - str_img->metrics.ascent + j, c_ind); - break; - } - } - } - - array_init(return_value); - - add_next_index_long(return_value, str_img->metrics.leftSideBearing); - add_next_index_long(return_value, str_img->metrics.descent); - add_next_index_long(return_value, str_img->metrics.rightSideBearing); - add_next_index_long(return_value, str_img->metrics.ascent); -} -/* }}} */ - -/* {{{ proto array imagepsbbox(string text, resource font, int size [, int space, int tightness, int angle]) - Return the bounding box needed by a string if rasterized */ -PHP_FUNCTION(imagepsbbox) -{ - zval **str, **fnt, **sz, **sp, **wd, **ang; - int i, space, add_width = 0, char_width, amount_kern; - int cur_x, cur_y, dx, dy; - int x1, y1, x2, y2, x3, y3, x4, y4; - int *f_ind; - int per_char = 0; - double angle, sin_a = 0, cos_a = 0; - BBox char_bbox, str_bbox = {0, 0, 0, 0}; - - switch (ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &str, &fnt, &sz) == FAILURE) { - RETURN_FALSE; - } - space = 0; - break; - case 6: - if (zend_get_parameters_ex(6, &str, &fnt, &sz, &sp, &wd, &ang) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sp); - convert_to_long_ex(wd); - convert_to_double_ex(ang); - space = Z_LVAL_PP(sp); - add_width = Z_LVAL_PP(wd); - angle = Z_DVAL_PP(ang) * M_PI / 180; - sin_a = sin(angle); - cos_a = cos(angle); - per_char = add_width || angle ? 1 : 0; - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - convert_to_string_ex(str); - convert_to_long_ex(sz); - -#define max(a, b) (a > b ? a : b) -#define min(a, b) (a < b ? a : b) -#define new_x(a, b) (int) ((a) * cos_a - (b) * sin_a) -#define new_y(a, b) (int) ((a) * sin_a + (b) * cos_a) - - if (per_char) { - space += T1_GetCharWidth(*f_ind, ' '); - cur_x = cur_y = 0; - - for (i = 0; i < Z_STRLEN_PP(str); i++) { - if (Z_STRVAL_PP(str)[i] == ' ') { - char_bbox.llx = char_bbox.lly = char_bbox.ury = 0; - char_bbox.urx = char_width = space; - } else { - char_bbox = T1_GetCharBBox(*f_ind, Z_STRVAL_PP(str)[i]); - char_width = T1_GetCharWidth(*f_ind, Z_STRVAL_PP(str)[i]); - } - amount_kern = i ? T1_GetKerning(*f_ind, Z_STRVAL_PP(str)[i - 1], Z_STRVAL_PP(str)[i]) : 0; - - /* Transfer character bounding box to right place */ - x1 = new_x(char_bbox.llx, char_bbox.lly) + cur_x; - y1 = new_y(char_bbox.llx, char_bbox.lly) + cur_y; - x2 = new_x(char_bbox.llx, char_bbox.ury) + cur_x; - y2 = new_y(char_bbox.llx, char_bbox.ury) + cur_y; - x3 = new_x(char_bbox.urx, char_bbox.ury) + cur_x; - y3 = new_y(char_bbox.urx, char_bbox.ury) + cur_y; - x4 = new_x(char_bbox.urx, char_bbox.lly) + cur_x; - y4 = new_y(char_bbox.urx, char_bbox.lly) + cur_y; - - /* Find min & max values and compare them with current bounding box */ - str_bbox.llx = min(str_bbox.llx, min(x1, min(x2, min(x3, x4)))); - str_bbox.lly = min(str_bbox.lly, min(y1, min(y2, min(y3, y4)))); - str_bbox.urx = max(str_bbox.urx, max(x1, max(x2, max(x3, x4)))); - str_bbox.ury = max(str_bbox.ury, max(y1, max(y2, max(y3, y4)))); - - /* Move to the next base point */ - dx = new_x(char_width + add_width + amount_kern, 0); - dy = new_y(char_width + add_width + amount_kern, 0); - cur_x += dx; - cur_y += dy; - /* - printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", x1, y1, x2, y2, x3, y3, x4, y4, char_bbox.llx, char_bbox.lly, char_bbox.urx, char_bbox.ury, char_width, amount_kern, cur_x, cur_y, dx, dy); - */ - } - - } else { - str_bbox = T1_GetStringBBox(*f_ind, Z_STRVAL_PP(str), Z_STRLEN_PP(str), space, T1_KERNING); - } - - if (T1_errno) { - RETURN_FALSE; - } - - array_init(return_value); - /* - printf("%d %d %d %d\n", str_bbox.llx, str_bbox.lly, str_bbox.urx, str_bbox.ury); - */ - add_next_index_long(return_value, (int) ceil(((double) str_bbox.llx)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.lly)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.urx)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.ury)*Z_LVAL_PP(sz)/1000)); -} -/* }}} */ -#endif - -#ifdef HAVE_GD_WBMP -/* {{{ proto bool image2wbmp(resource im [, string filename [, int threshold]]) - Output WBMP image to browser or file */ -PHP_FUNCTION(image2wbmp) -{ - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_CONVERT_WBM, "WBMP", _php_image_bw_convert); -} -/* }}} */ -#endif /* HAVE_GD_WBMP */ - -#if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP) -/* {{{ proto bool jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) - Convert JPEG image to WBMP image */ -PHP_FUNCTION(jpeg2wbmp) -{ - _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG); -} -/* }}} */ -#endif - -#if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP) -/* {{{ proto bool png2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) - Convert PNG image to WBMP image */ -PHP_FUNCTION(png2wbmp) -{ - _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG); -} -/* }}} */ -#endif - -#ifdef HAVE_GD_WBMP -/* {{{ _php_image_bw_convert - * It converts a gd Image to bw using a threshold value */ -static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold) -{ - gdImagePtr im_dest; - int white, black; - int color, color_org, median; - int dest_height = gdImageSY(im_org); - int dest_width = gdImageSX(im_org); - int x, y; - TSRMLS_FETCH(); - - im_dest = gdImageCreate(dest_width, dest_height); - if (im_dest == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); - return; - } - - white = gdImageColorAllocate(im_dest, 255, 255, 255); - if (white == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); - return; - } - - black = gdImageColorAllocate(im_dest, 0, 0, 0); - if (black == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); - return; - } - -#if HAVE_LIBGD20 - if (im_org->trueColor) { - gdImageTrueColorToPalette(im_org, 1, 256); - } -#endif - - for (y = 0; y < dest_height; y++) { - for (x = 0; x < dest_width; x++) { - color_org = gdImageGetPixel(im_org, x, y); - median = (im_org->red[color_org] + im_org->green[color_org] + im_org->blue[color_org]) / 3; - if (median < threshold) { - color = black; - } else { - color = white; - } - gdImageSetPixel (im_dest, x, y, color); - } - } -#ifdef USE_GD_IOCTX - gdImageWBMPCtx (im_dest, black, out); -#else - gdImageWBMP (im_dest, black, out); -#endif - -} -/* }}} */ - -/* {{{ _php_image_convert - * _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */ -static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) -{ - zval **f_org, **f_dest, **height, **width, **threshold; - gdImagePtr im_org, im_dest, im_tmp; - char *fn_org = NULL; - char *fn_dest = NULL; - FILE *org, *dest; - int argc = ZEND_NUM_ARGS(); - int dest_height = -1; - int dest_width = -1; - int org_height, org_width; - int white, black; - int color, color_org, median; - int int_threshold; - int x, y; - float x_ratio, y_ratio; - - if (argc != 5 || zend_get_parameters_ex(argc, &f_org, &f_dest, &height, &width, &threshold) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(f_org); - convert_to_string_ex(f_dest); - convert_to_long_ex(height); - convert_to_long_ex(width); - convert_to_long_ex(threshold); - - fn_org = Z_STRVAL_PP(f_org); - fn_dest = Z_STRVAL_PP(f_dest); - dest_height = Z_LVAL_PP(height); - dest_width = Z_LVAL_PP(width); - int_threshold = Z_LVAL_PP(threshold); - - /* Check threshold value */ - if (int_threshold < 0 || int_threshold > 8) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'", int_threshold); - RETURN_FALSE; - } - - /* Check origin file */ - if (!fn_org || php_check_open_basedir(fn_org TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid origin filename '%s'", fn_org); - RETURN_FALSE; - } - - /* Check destination file */ - if (!fn_dest || php_check_open_basedir(fn_dest TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid destination filename '%s'", fn_dest); - RETURN_FALSE; - } - - /* Open origin file */ - org = VCWD_FOPEN(fn_org, "rb"); - if (!org) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for reading", fn_org); - RETURN_FALSE; - } - - /* Open destination file */ - dest = VCWD_FOPEN(fn_dest, "wb"); - if (!dest) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest); - RETURN_FALSE; - } - - switch (image_type) { -#ifdef HAVE_GD_GIF_READ - case PHP_GDIMG_TYPE_GIF: - im_org = gdImageCreateFromGif(org); - if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_GIF_READ */ - -#ifdef HAVE_GD_JPG - case PHP_GDIMG_TYPE_JPG: - im_org = gdImageCreateFromJpeg(org); - if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_JPG */ - - -#ifdef HAVE_GD_PNG - case PHP_GDIMG_TYPE_PNG: - im_org = gdImageCreateFromPng(org); - if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_PNG */ - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported"); - RETURN_FALSE; - break; - } - - org_width = gdImageSX (im_org); - org_height = gdImageSY (im_org); - - x_ratio = (float) org_width / (float) dest_width; - y_ratio = (float) org_height / (float) dest_height; - - if (x_ratio > 1 && y_ratio > 1) { - if (y_ratio > x_ratio) { - x_ratio = y_ratio; - } else { - y_ratio = x_ratio; - } - dest_width = (int) (org_width / x_ratio); - dest_height = (int) (org_height / y_ratio); - } else { - x_ratio = (float) dest_width / (float) org_width; - y_ratio = (float) dest_height / (float) org_height; - - if (y_ratio < x_ratio) { - x_ratio = y_ratio; - } else { - y_ratio = x_ratio; - } - dest_width = (int) (org_width * x_ratio); - dest_height = (int) (org_height * y_ratio); - } - - im_tmp = gdImageCreate (dest_width, dest_height); - if (im_tmp == NULL ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); - RETURN_FALSE; - } - - gdImageCopyResized (im_tmp, im_org, 0, 0, 0, 0, dest_width, dest_height, org_width, org_height); - - gdImageDestroy(im_org); - - fclose(org); - - im_dest = gdImageCreate(dest_width, dest_height); - if (im_dest == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer"); - RETURN_FALSE; - } - - white = gdImageColorAllocate(im_dest, 255, 255, 255); - if (white == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); - RETURN_FALSE; - } - - black = gdImageColorAllocate(im_dest, 0, 0, 0); - if (black == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); - RETURN_FALSE; - } - - int_threshold = int_threshold * 32; - - for (y = 0; y < dest_height; y++) { - for (x = 0; x < dest_width; x++) { - color_org = gdImageGetPixel (im_tmp, x, y); - median = (im_tmp->red[color_org] + im_tmp->green[color_org] + im_tmp->blue[color_org]) / 3; - if (median < int_threshold) { - color = black; - } else { - color = white; - } - gdImageSetPixel (im_dest, x, y, color); - } - } - - gdImageDestroy (im_tmp ); - - gdImageWBMP(im_dest, black , dest); - - fflush(dest); - fclose(dest); - - gdImageDestroy(im_dest); - - RETURN_TRUE; -} -/* }}} */ -#endif /* HAVE_GD_WBMP */ - -#endif /* HAVE_LIBGD */ - -/* Section Filters */ -#ifdef HAVE_GD_BUNDLED - -#define PHP_GD_SINGLE_RES \ - zval **SIM; \ - gdImagePtr im_src; \ - if (zend_get_parameters_ex(1, &SIM) == FAILURE) { \ - RETURN_FALSE; \ - } \ - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); \ - if (im_src == NULL) { \ - RETURN_FALSE; \ - } - -static void php_image_filter_negate(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageNegate(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_grayscale(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageGrayScale(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS) -{ - zval *SIM; - gdImagePtr im_src; - long brightness, tmp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &SIM, &tmp, &brightness) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - if (im_src == NULL) { - RETURN_FALSE; - } - - if (gdImageBrightness(im_src, (int)brightness) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS) -{ - zval *SIM; - gdImagePtr im_src; - long contrast, tmp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &SIM, &tmp, &contrast) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - if (im_src == NULL) { - RETURN_FALSE; - } - - if (gdImageContrast(im_src, (int)contrast) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS) -{ - zval *SIM; - gdImagePtr im_src; - long r,g,b,tmp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &SIM, &tmp, &r, &g, &b) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - if (im_src == NULL) { - RETURN_FALSE; - } - - if (gdImageColor(im_src, (int) r, (int) g, (int) b) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_edgedetect(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageEdgeDetectQuick(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_emboss(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageEmboss(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageGaussianBlur(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_selective_blur(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageSelectiveBlur(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_mean_removal(INTERNAL_FUNCTION_PARAMETERS) -{ - PHP_GD_SINGLE_RES - - if (gdImageMeanRemoval(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS) -{ - zval *SIM; - long tmp; - gdImagePtr im_src; - double weight; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rld", &SIM, &tmp, &weight) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - if (im_src == NULL) { - RETURN_FALSE; - } - - if (gdImageSmooth(im_src, (float)weight)==1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - -/* {{{ proto bool imagefilter(resource src_im, int filtertype, [args] ) - Applies Filter an image using a custom angle */ -PHP_FUNCTION(imagefilter) -{ - zval *tmp; - - typedef void (*image_filter)(INTERNAL_FUNCTION_PARAMETERS); - long filtertype; - image_filter filters[] = - { - php_image_filter_negate , - php_image_filter_grayscale, - php_image_filter_brightness, - php_image_filter_contrast, - php_image_filter_colorize, - php_image_filter_edgedetect, - php_image_filter_emboss, - php_image_filter_gaussian_blur, - php_image_filter_selective_blur, - php_image_filter_mean_removal, - php_image_filter_smooth - }; - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 5 || zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (filtertype >= 0 && filtertype <= IMAGE_FILTER_MAX) { - filters[filtertype](INTERNAL_FUNCTION_PARAM_PASSTHRU); - } -} -/* }}} */ - -/* {{{ proto resource imageconvolution(resource src_im, array matrix3x3, double div, double offset) - Apply a 3x3 convolution matrix, using coefficient div and offset */ -PHP_FUNCTION(imageconvolution) -{ - zval *SIM, *hash_matrix; - pval **var = NULL, **var2 = NULL; - gdImagePtr im_src = NULL; - float div, offset; - int nelem, i, j, res; - float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); - - nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix)); - if (nelem != 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array"); - RETURN_FALSE; - } - - for (i=0; i<3; i++) { - if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS) { - if (Z_TYPE_PP(var) != IS_ARRAY || zend_hash_num_elements(Z_ARRVAL_PP(var)) != 3 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array"); - RETURN_FALSE; - } - - for (j=0; j<3; j++) { - if (zend_hash_index_find(Z_ARRVAL_PP(var), (j), (void **) &var2) == SUCCESS) { - SEPARATE_ZVAL(var2); - convert_to_double(*var2); - matrix[i][j] = Z_DVAL_PP(var2); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix"); - RETURN_FALSE; - } - } - } - } - res = gdImageConvolution(im_src, matrix, div, offset); - - if (res) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* End section: Filters */ - -/* {{{ proto bool imageantialias(resource im, bool on) - Should antialiased functions used or not*/ -PHP_FUNCTION(imageantialias) -{ - zval **IM, **alias; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &alias) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_boolean_ex(alias); - gdImageAntialias(im, Z_LVAL_PP(alias)); - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/gd/gd.dsp b/ext/gd/gd.dsp deleted file mode 100644 index d7207562f89a2..0000000000000 --- a/ext/gd/gd.dsp +++ /dev/null @@ -1,600 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=gd - Win32 Release_TS GD2 -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "gd.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "gd.mak" CFG="gd - Win32 Release_TS GD2" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "gd - Win32 Release_TS GD2" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gd - Win32 Debug_TS GD2" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Release_TS_GD2_bundled" -# PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD2_bundled" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Debug_TS_GD2_bundled" -# PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD2_bundled" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib libjpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "gd - Win32 Release_TS GD2" -# Name "gd - Win32 Debug_TS GD2" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\gd.c -# End Source File -# Begin Source File - -SOURCE=.\gdttf.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\gdcache.h -# End Source File -# Begin Source File - -SOURCE=.\gdttf.h -# End Source File -# Begin Source File - -SOURCE=.\php_gd.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "libgd" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "*.c" -# Begin Source File - -SOURCE=.\libgd\gd.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd2copypal.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_arc_f_buggy.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_gd.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_gd2.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_gif_in.c -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_gif_out.c -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_io.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_io_dp.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_io_file.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_io_ss.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_jpeg.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_png.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_ss.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_topal.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_wbmp.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdcache.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontg.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontl.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontmb.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfonts.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontt.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdft.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdhelpers.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdkanji.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdtables.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdxpm.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\wbmp.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libgd\xbm.c - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP Intermediate_Dir "Release_TS_bundled" - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP Intermediate_Dir "Debug_TS_bundled" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "*.h" -# Begin Source File - -SOURCE=.\libgd\gd.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gd_io.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdcache.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontg.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontl.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontmb.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfonts.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdfontt.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\gdhelpers.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\jisx0208.h -# End Source File -# Begin Source File - -SOURCE=.\libgd\wbmp.h -# End Source File -# End Group -# End Group -# End Target -# End Project diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c deleted file mode 100644 index c315b870ea01b..0000000000000 --- a/ext/gd/gd_ctx.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stanislav Malyshev | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php_gd.h" - -#define CTX_PUTC(c,ctx) ctx->putC(ctx, c) - -static void _php_image_output_putc(struct gdIOCtx *ctx, int c) -{ - /* without the following downcast, the write will fail - * (i.e., will write a zero byte) for all - * big endian architectures: - */ - unsigned char ch = (unsigned char) c; - TSRMLS_FETCH(); - php_write(&ch, 1 TSRMLS_CC); -} - -static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) -{ - TSRMLS_FETCH(); - return php_write((void *)buf, l TSRMLS_CC); -} - -static void _php_image_output_ctxfree(struct gdIOCtx *ctx) -{ - if(ctx) { - efree(ctx); - } -} - -/* {{{ _php_image_output_ctx */ -static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) -{ - zval **imgind, **file, **quality; - gdImagePtr im; - char *fn = NULL; - FILE *fp = NULL; - int argc = ZEND_NUM_ARGS(); - int q = -1, i; - gdIOCtx *ctx; - - /* The third (quality) parameter for Wbmp stands for the threshold when called from image2wbmp(). - * The third (quality) parameter for Wbmp and Xbm stands for the foreground color index when called - * from imagey(). - */ - - if (argc < 2 && image_type == PHP_GDIMG_TYPE_XBM) { - WRONG_PARAM_COUNT; - } - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &imgind, &file, &quality) == FAILURE) - { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", phpi_get_le_gd()); - - if (argc > 1) { - convert_to_string_ex(file); - fn = Z_STRVAL_PP(file); - if (argc == 3) { - convert_to_long_ex(quality); - q = Z_LVAL_PP(quality);/* or colorindex for foreground of BW images (defaults to black) */ - } - } - if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { - if (!fn || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn); - RETURN_FALSE; - } - - fp = VCWD_FOPEN(fn, "wb"); - if (!fp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn); - RETURN_FALSE; - } - - ctx = gdNewFileCtx(fp); - } else { - ctx = emalloc(sizeof(gdIOCtx)); - ctx->putC = _php_image_output_putc; - ctx->putBuf = _php_image_output_putbuf; -#if HAVE_LIBGD204 - ctx->gd_free = _php_image_output_ctxfree; -#else - ctx->free = _php_image_output_ctxfree; -#endif - -#if APACHE && defined(CHARSET_EBCDIC) - /* XXX this is unlikely to work any more thies@thieso.net */ - /* This is a binary file already: avoid EBCDIC->ASCII conversion */ - ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); -#endif - } - - switch(image_type) { - case PHP_GDIMG_CONVERT_WBM: - if(q<0||q>255) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); - } - case PHP_GDIMG_TYPE_JPG: - case PHP_GDIMG_TYPE_PNG: - (*func_p)(im, ctx, q); - break; - case PHP_GDIMG_TYPE_XBM: - case PHP_GDIMG_TYPE_WBM: - if (argc < 3) { - for(i=0; i < gdImageColorsTotal(im); i++) { - if(!gdImageRed(im, i) && !gdImageGreen(im, i) && !gdImageBlue(im, i)) break; - } - q = i; - } - if (image_type == PHP_GDIMG_TYPE_XBM) { - (*func_p)(im, fn, q, ctx); - } else { - (*func_p)(im, q, ctx); - } - break; - default: - (*func_p)(im, ctx); - break; - } - -#if HAVE_LIBGD204 - ctx->gd_free(ctx); -#else - ctx->free(ctx); -#endif - - if(fp) { - fflush(fp); - fclose(fp); - } - - RETURN_TRUE; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c deleted file mode 100644 index a728d8254831e..0000000000000 --- a/ext/gd/gdcache.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * $Id$ - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@lucent.com) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -#include "php.h" - -/* This just seems unessacary */ -#if PHP_WIN32 -#define ENABLE_GD_TTF -#else -#include -#endif -#if HAVE_LIBFREETYPE && !defined(HAVE_GD_CACHE_CREATE) - -#include "gdcache.h" - -/*********************************************************/ -/* implementation */ -/*********************************************************/ - - -/* create a new cache */ -gdCache_head_t * -gdCacheCreate( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease ) -{ - gdCache_head_t *head; - - head = (gdCache_head_t *)pemalloc(sizeof(gdCache_head_t), 1); - head->mru = NULL; - head->size = size; - head->gdCacheTest = gdCacheTest; - head->gdCacheFetch = gdCacheFetch; - head->gdCacheRelease = gdCacheRelease; - return head; -} - -void -gdCacheDelete( gdCache_head_t *head ) -{ - gdCache_element_t *elem, *prev; - - elem = head->mru; - while(elem) { - (*(head->gdCacheRelease))(elem->userdata); - prev = elem; - elem = elem->next; - pefree((char *)prev, 1); - } - pefree((char *)head, 1); -} - -void * -gdCacheGet( gdCache_head_t *head, void *keydata ) -{ - int i=0; - gdCache_element_t *elem, *prev = NULL, *prevprev = NULL; - void *userdata; - - elem = head->mru; - while(elem) { - if ((*(head->gdCacheTest))(elem->userdata, keydata)) { - if (i) { /* if not already most-recently-used */ - /* relink to top of list */ - prev->next = elem->next; - elem->next = head->mru; - head->mru = elem; - } - return elem->userdata; - } - prevprev = prev; - prev = elem; - elem = elem->next; - i++; - } - userdata = (*(head->gdCacheFetch))(&(head->error), keydata); - if (! userdata) { - /* if there was an error in the fetch then don't cache */ - return NULL; - } - if (i < head->size) { /* cache still growing - add new elem */ - elem = (gdCache_element_t *)pemalloc(sizeof(gdCache_element_t), 1); - } - else { /* cache full - replace least-recently-used */ - /* preveprev becomes new end of list */ - prevprev->next = NULL; - elem = prev; - (*(head->gdCacheRelease))(elem->userdata); - } - /* relink to top of list */ - elem->next = head->mru; - head->mru = elem; - elem->userdata = userdata; - return userdata; -} - - - -/*********************************************************/ -/* test stub */ -/*********************************************************/ - - -#ifdef GDCACHE_TEST - -#include - -typedef struct { - int key; - int value; -} key_value_t; - -static int -cacheTest( void *map, void *key ) -{ - return (((key_value_t *)map)->key == *(int *)key); -} - -static void * -cacheFetch( char **error, void *key ) -{ - key_value_t *map; - - map = (key_value_t *)malloc(sizeof(key_value_t)); - map->key = *(int *)key; - map->value = 3; - - *error = NULL; - return (void *)map; -} - -static void -cacheRelease( void *map) -{ - free( (char *)map ); -} - -int -main(char *argv[], int argc) -{ - gdCache_head_t *cacheTable; - int elem, key; - - cacheTable = gdCacheCreate(3, cacheTest, cacheFetch, cacheRelease); - - key = 20; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 40; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 50; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - - gdCacheDelete(cacheTable); - - return 0; -} - -#endif - -#endif /* ENABLE_GD_TTF */ diff --git a/ext/gd/gdcache.h b/ext/gd/gdcache.h deleted file mode 100644 index 657eb1843539a..0000000000000 --- a/ext/gd/gdcache.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * $Id$ - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@lucent.com) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -/*********************************************************/ -/* header */ -/*********************************************************/ - -#if (!defined(_OSD_POSIX) && !defined(__FreeBSD__)) && HAVE_MALLOC_H -#include -#else -#include /* BS2000/OSD defines malloc() & friends in stdlib.h */ -#endif -#ifndef NULL -#define NULL (void *)0 -#endif - -/* user defined function templates */ -typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); -typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); -typedef void (*gdCacheReleaseFn_t)(void *userdata); - -/* element structure */ -typedef struct gdCache_element_s gdCache_element_t; -struct gdCache_element_s { - gdCache_element_t *next; - void *userdata; -}; - -/* head structure */ -typedef struct gdCache_head_s gdCache_head_t; -struct gdCache_head_s { - gdCache_element_t *mru; - int size; - char *error; - gdCacheTestFn_t gdCacheTest; - gdCacheFetchFn_t gdCacheFetch; - gdCacheReleaseFn_t gdCacheRelease; -}; - -/* function templates */ -gdCache_head_t * -gdCacheCreate( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease ); - -void -gdCacheDelete( gdCache_head_t *head ); - -void * -gdCacheGet( gdCache_head_t *head, void *keydata ); diff --git a/ext/gd/libgd/README b/ext/gd/libgd/README deleted file mode 100644 index c0333ef5c2791..0000000000000 --- a/ext/gd/libgd/README +++ /dev/null @@ -1,72 +0,0 @@ -This directory contains the GD library available from -http://www.boutell.com/gd/ - -The inclusion of this library with PHP is in response to the -popularity of the GD extension and the GD library itself. We felt -it would be worthwhile to make sure everyone had access to the -features of GD and by bundling GD with PHP we have a known target to -work against. - -In addition to the above, a number of motivated PHP hackers have -expressed an interest in extending the functionality of the PHP-GD -combination. By putting a version of GD into PHP CVS we have provided -a sandbox for them to throw sand at each other in. Any and all -improvements we make to the GD library will be contributed back to the -original maintainers of this library at boutell.com. - -The following statement is from the original GD package: - - Credits and license terms - - In order to resolve any possible confusion regarding the authorship of - gd, the following copyright statement covers all of the authors who - have required such a statement. _If you are aware of any oversights in - this copyright notice, please contact Thomas Boutell who will be - pleased to correct them._ - -COPYRIGHT STATEMENT FOLLOWS THIS LINE - - Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 by - the National Institutes of Health. - - Portions copyright 1996, 1997, 1998, 1999, 2000, 2001 by - Boutell.Com, Inc. - - Portions relating to GD2 format copyright 1999, 2000 Philip Warner. - - Portions relating to PNG copyright 1999, 2000 Greg Roelofs. - - Portions relating to libttf copyright 1999, 2000 John Ellson - (ellson@lucent.com). - - Portions relating to JPEG and to color quantization copyright 2000, - Doug Becker and copyright (C) 1994-1998, Thomas G. Lane. This - software is based in part on the work of the Independent JPEG - Group. See the file README-JPEG.TXT for more information. - - Portions relating to WBMP copyright 2000 Maurice Szmurlo and Johan - Van den Brande. - - _Permission has been granted to copy, distribute and modify gd in - any context without fee, including a commercial application, - provided that this notice is present in user-accessible supporting - documentation._ - - This does not affect your ownership of the derived work itself, and - the intent is to assure proper credit for the authors of gd, not to - interfere with your productive use of gd. If you have questions, - ask. "Derived works" includes all programs that utilize the - library. Credit must be given in user-accessible documentation. - - _This software is provided "AS IS."_ The copyright holders disclaim - all warranties, either express or implied, including but not - limited to implied warranties of merchantability and fitness for a - particular purpose, with respect to this code and accompanying - documentation. - - Although their code does not appear in gd 2.0.1, the authors wish - to thank David Koblas, David Rowley, and Hutchison Avenue Software - Corporation for their prior contributions. - -END OF COPYRIGHT STATEMENT diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c deleted file mode 100644 index 1ac09a76fce94..0000000000000 --- a/ext/gd/libgd/gd.c +++ /dev/null @@ -1,3919 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#include "php.h" - -#ifdef _MSC_VER -# if _MSC_VER >= 1300 -/* in MSVC.NET these are available but only for __cplusplus and not _MSC_EXTENSIONS */ -# if !defined(_MSC_EXTENSIONS) && defined(__cplusplus) -# define HAVE_FABSF 1 -extern float fabsf(float x); -# define HAVE_FLOORF 1 -extern float floorf(float x); -# endif /*MSVC.NET */ -# endif /* MSC */ -#endif -#ifndef HAVE_FABSF -# define HAVE_FABSF 0 -#endif -#ifndef HAVE_FLOORF -# define HAVE_FLOORF 0 -#endif -#if HAVE_FABSF == 0 -/* float fabsf(float x); */ -# define fabsf(x) ((float)(fabs(x))) -#endif -#if HAVE_FLOORF == 0 -/* float floorf(float x);*/ -#define floorf(x) ((float)(floor(x))) -#endif - -#ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of ASCII */ -#define CHARSET_EBCDIC -#define __attribute__(any) /*nothing */ -#endif -/*_OSD_POSIX*/ - -#ifndef CHARSET_EBCDIC -#define ASC(ch) ch -#else /*CHARSET_EBCDIC */ -#define ASC(ch) gd_toascii[(unsigned char)ch] -static const unsigned char gd_toascii[256] = -{ -/*00 */ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, - 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................ */ -/*10 */ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /*................ */ -/*20 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /*................ */ -/*30 */ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /*................ */ -/*40 */ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, - 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+| */ -/*50 */ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /*&.........!$*);. */ -/*60 */ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, - 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, -/*-/........^,%_>?*/ -/*70 */ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, - 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /*..........:#@'=" */ -/*80 */ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /*.abcdefghi...... */ -/*90 */ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /*.jklmnopqr...... */ -/*a0 */ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /*..stuvwxyz...... */ -/*b0 */ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, - 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /*...........[\].. */ -/*c0 */ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /*.ABCDEFGHI...... */ -/*d0 */ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /*.JKLMNOPQR...... */ -/*e0 */ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /*..STUVWXYZ...... */ -/*f0 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~ */ -}; -#endif /*CHARSET_EBCDIC */ - -/* 2.0.10: cast instead of floor() yields 35% performance improvement. Thanks to John Buckman. */ -#define floor_cast(exp) ((long) exp) - -extern int gdCosT[]; -extern int gdSinT[]; - -static void gdImageBrushApply(gdImagePtr im, int x, int y); -static void gdImageTileApply(gdImagePtr im, int x, int y); -static void gdImageAntiAliasedApply(gdImagePtr im, int x, int y); -static int gdLayerOverlay(int dst, int src); -static int gdAlphaOverlayColor(int src, int dst, int max); -int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y); - -void php_gd_error_ex(int type, const char *format, ...) -{ - va_list args; - - TSRMLS_FETCH(); - - va_start(args, format); - php_verror(NULL, "", type, format, args TSRMLS_CC); - va_end(args); -} - -void php_gd_error(const char *format, ...) -{ - va_list args; - - TSRMLS_FETCH(); - - va_start(args, format); - php_verror(NULL, "", E_WARNING, format, args TSRMLS_CC); - va_end(args); -} - -gdImagePtr gdImageCreate (int sx, int sy) -{ - int i; - gdImagePtr im; - im = (gdImage *) gdMalloc(sizeof(gdImage)); - memset(im, 0, sizeof(gdImage)); - /* Row-major ever since gd 1.3 */ - im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); - im->AA_opacity = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); - im->polyInts = 0; - im->polyAllocated = 0; - im->brush = 0; - im->tile = 0; - im->style = 0; - for (i = 0; i < sy; i++) { - /* Row-major ever since gd 1.3 */ - im->pixels[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); - im->AA_opacity[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); - } - im->sx = sx; - im->sy = sy; - im->colorsTotal = 0; - im->transparent = (-1); - im->interlace = 0; - im->thick = 1; - im->AA = 0; - im->AA_polygon = 0; - for (i = 0; i < gdMaxColors; i++) { - im->open[i] = 1; - im->red[i] = 0; - im->green[i] = 0; - im->blue[i] = 0; - } - im->trueColor = 0; - im->tpixels = 0; - im->cx1 = 0; - im->cy1 = 0; - im->cx2 = im->sx - 1; - im->cy2 = im->sy - 1; - return im; -} - -gdImagePtr gdImageCreateTrueColor (int sx, int sy) -{ - int i; - gdImagePtr im; - im = (gdImage *) gdMalloc(sizeof(gdImage)); - memset(im, 0, sizeof(gdImage)); - im->tpixels = (int **) gdMalloc(sizeof(int *) * sy); - im->AA_opacity = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); - im->polyInts = 0; - im->polyAllocated = 0; - im->brush = 0; - im->tile = 0; - im->style = 0; - for (i = 0; i < sy; i++) { - im->tpixels[i] = (int *) gdCalloc(sx, sizeof(int)); - im->AA_opacity[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); - } - im->sx = sx; - im->sy = sy; - im->transparent = (-1); - im->interlace = 0; - im->trueColor = 1; - /* 2.0.2: alpha blending is now on by default, and saving of alpha is - * off by default. This allows font antialiasing to work as expected - * on the first try in JPEGs -- quite important -- and also allows - * for smaller PNGs when saving of alpha channel is not really - * desired, which it usually isn't! - */ - im->saveAlphaFlag = 0; - im->alphaBlendingFlag = 1; - im->thick = 1; - im->AA = 0; - im->AA_polygon = 0; - im->cx1 = 0; - im->cy1 = 0; - im->cx2 = im->sx - 1; - im->cy2 = im->sy - 1; - return im; -} - -void gdImageDestroy (gdImagePtr im) -{ - int i; - if (im->pixels) { - for (i = 0; i < im->sy; i++) { - gdFree(im->pixels[i]); - } - gdFree(im->pixels); - } - if (im->tpixels) { - for (i = 0; i < im->sy; i++) { - gdFree(im->tpixels[i]); - } - gdFree(im->tpixels); - } - if (im->AA_opacity) { - for (i = 0; i < im->sy; i++) { - gdFree(im->AA_opacity[i]); - } - gdFree(im->AA_opacity); - } - if (im->polyInts) { - gdFree(im->polyInts); - } - if (im->style) { - gdFree(im->style); - } - gdFree(im); -} - -int gdImageColorClosest (gdImagePtr im, int r, int g, int b) -{ - return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque); -} - -int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a) -{ - int i; - long rd, gd, bd, ad; - int ct = (-1); - int first = 1; - long mindist = 0; - - if (im->trueColor) { - return gdTrueColorAlpha(r, g, b, a); - } - for (i = 0; i < im->colorsTotal; i++) { - long dist; - if (im->open[i]) { - continue; - } - rd = im->red[i] - r; - gd = im->green[i] - g; - bd = im->blue[i] - b; - /* gd 2.02: whoops, was - b (thanks to David Marwood) */ - ad = im->alpha[i] - a; - dist = rd * rd + gd * gd + bd * bd + ad * ad; - if (first || (dist < mindist)) { - mindist = dist; - ct = i; - first = 0; - } - } - return ct; -} - -/* This code is taken from http://www.acm.org/jgt/papers/SmithLyons96/hwb_rgb.html, an article - * on colour conversion to/from RBG and HWB colour systems. - * It has been modified to return the converted value as a * parameter. - */ - -#define RETURN_HWB(h, w, b) {HWB->H = h; HWB->W = w; HWB->B = b; return HWB;} -#define RETURN_RGB(r, g, b) {RGB->R = r; RGB->G = g; RGB->B = b; return RGB;} -#define HWB_UNDEFINED -1 -#define SETUP_RGB(s, r, g, b) {s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;} - -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif -#define MIN3(a,b,c) ((a)<(b)?(MIN(a,c)):(MIN(b,c))) -#ifndef MAX -#define MAX(a,b) ((a)<(b)?(b):(a)) -#endif -#define MAX3(a,b,c) ((a)<(b)?(MAX(b,c)):(MAX(a,c))) - - -/* - * Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. Pure - * red always maps to 6 in this implementation. Therefore UNDEFINED can be - * defined as 0 in situations where only unsigned numbers are desired. - */ -typedef struct -{ - float R, G, B; -} -RGBType; -typedef struct -{ - float H, W, B; -} -HWBType; - -static HWBType * RGB_to_HWB (RGBType RGB, HWBType * HWB) -{ - /* - * RGB are each on [0, 1]. W and B are returned on [0, 1] and H is - * returned on [0, 6]. Exception: H is returned UNDEFINED if W == 1 - B. - */ - - float R = RGB.R, G = RGB.G, B = RGB.B, w, v, b, f; - int i; - - w = MIN3 (R, G, B); - v = MAX3 (R, G, B); - b = 1 - v; - if (v == w) { - RETURN_HWB(HWB_UNDEFINED, w, b); - } - f = (R == w) ? G - B : ((G == w) ? B - R : R - G); - i = (R == w) ? 3 : ((G == w) ? 5 : 1); - - RETURN_HWB(i - f / (v - w), w, b); -} - -static float HWB_Diff (int r1, int g1, int b1, int r2, int g2, int b2) -{ - RGBType RGB1, RGB2; - HWBType HWB1, HWB2; - float diff; - - SETUP_RGB(RGB1, r1, g1, b1); - SETUP_RGB(RGB2, r2, g2, b2); - - RGB_to_HWB(RGB1, &HWB1); - RGB_to_HWB(RGB2, &HWB2); - - /* - * I made this bit up; it seems to produce OK results, and it is certainly - * more visually correct than the current RGB metric. (PJW) - */ - - if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED)) { - diff = 0.0f; /* Undefined hues always match... */ - } else { - diff = fabsf(HWB1.H - HWB2.H); - if (diff > 3.0f) { - diff = 6.0f - diff; /* Remember, it's a colour circle */ - } - } - - diff = diff * diff + (HWB1.W - HWB2.W) * (HWB1.W - HWB2.W) + (HWB1.B - HWB2.B) * (HWB1.B - HWB2.B); - - return diff; -} - - -#if 0 -/* - * This is not actually used, but is here for completeness, in case someone wants to - * use the HWB stuff for anything else... - */ -static RGBType * HWB_to_RGB (HWBType HWB, RGBType * RGB) -{ - /* - * H is given on [0, 6] or UNDEFINED. W and B are given on [0, 1]. - * RGB are each returned on [0, 1]. - */ - - float h = HWB.H, w = HWB.W, b = HWB.B, v, n, f; - int i; - - v = 1 - b; - if (h == HWB_UNDEFINED) { - RETURN_RGB(v, v, v); - } - i = floor(h); - f = h - i; - if (i & 1) { - f = 1 - f; /* if i is odd */ - } - n = w + f * (v - w); /* linear interpolation between w and v */ - switch (i) { - case 6: - case 0: - RETURN_RGB(v, n, w); - case 1: - RETURN_RGB(n, v, w); - case 2: - RETURN_RGB(w, v, n); - case 3: - RETURN_RGB(w, n, v); - case 4: - RETURN_RGB(n, w, v); - case 5: - RETURN_RGB(v, w, n); - } - - return RGB; -} -#endif - -int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b) -{ - int i; - /* long rd, gd, bd; */ - int ct = (-1); - int first = 1; - float mindist = 0; - if (im->trueColor) { - return gdTrueColor(r, g, b); - } - for (i = 0; i < im->colorsTotal; i++) { - float dist; - if (im->open[i]) { - continue; - } - dist = HWB_Diff(im->red[i], im->green[i], im->blue[i], r, g, b); - if (first || (dist < mindist)) { - mindist = dist; - ct = i; - first = 0; - } - } - return ct; -} - -int gdImageColorExact (gdImagePtr im, int r, int g, int b) -{ - return gdImageColorExactAlpha (im, r, g, b, gdAlphaOpaque); -} - -int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) -{ - int i; - if (im->trueColor) { - return gdTrueColorAlpha(r, g, b, a); - } - for (i = 0; i < im->colorsTotal; i++) { - if (im->open[i]) { - continue; - } - if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { - return i; - } - } - return -1; -} - -int gdImageColorAllocate (gdImagePtr im, int r, int g, int b) -{ - return gdImageColorAllocateAlpha (im, r, g, b, gdAlphaOpaque); -} - -int gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a) -{ - int i; - int ct = (-1); - if (im->trueColor) { - return gdTrueColorAlpha(r, g, b, a); - } - for (i = 0; i < im->colorsTotal; i++) { - if (im->open[i]) { - ct = i; - break; - } - } - if (ct == (-1)) { - ct = im->colorsTotal; - if (ct == gdMaxColors) { - return -1; - } - im->colorsTotal++; - } - im->red[ct] = r; - im->green[ct] = g; - im->blue[ct] = b; - im->alpha[ct] = a; - im->open[ct] = 0; - - return ct; -} - -/* - * gdImageColorResolve is an alternative for the code fragment: - * - * if ((color=gdImageColorExact(im,R,G,B)) < 0) - * if ((color=gdImageColorAllocate(im,R,G,B)) < 0) - * color=gdImageColorClosest(im,R,G,B); - * - * in a single function. Its advantage is that it is guaranteed to - * return a color index in one search over the color table. - */ - -int gdImageColorResolve (gdImagePtr im, int r, int g, int b) -{ - return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque); -} - -int gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a) -{ - int c; - int ct = -1; - int op = -1; - long rd, gd, bd, ad, dist; - long mindist = 4 * 255 * 255; /* init to max poss dist */ - if (im->trueColor) - { - return gdTrueColorAlpha (r, g, b, a); - } - - for (c = 0; c < im->colorsTotal; c++) - { - if (im->open[c]) - { - op = c; /* Save open slot */ - continue; /* Color not in use */ - } - if (c == im->transparent) - { - /* don't ever resolve to the color that has - * been designated as the transparent color */ - continue; - } - rd = (long) (im->red[c] - r); - gd = (long) (im->green[c] - g); - bd = (long) (im->blue[c] - b); - ad = (long) (im->alpha[c] - a); - dist = rd * rd + gd * gd + bd * bd + ad * ad; - if (dist < mindist) - { - if (dist == 0) - { - return c; /* Return exact match color */ - } - mindist = dist; - ct = c; - } - } - /* no exact match. We now know closest, but first try to allocate exact */ - if (op == -1) - { - op = im->colorsTotal; - if (op == gdMaxColors) - { /* No room for more colors */ - return ct; /* Return closest available color */ - } - im->colorsTotal++; - } - im->red[op] = r; - im->green[op] = g; - im->blue[op] = b; - im->alpha[op] = a; - im->open[op] = 0; - return op; /* Return newly allocated color */ -} - -void gdImageColorDeallocate (gdImagePtr im, int color) -{ - if (im->trueColor) { - return; - } - /* Mark it open. */ - im->open[color] = 1; -} - -void gdImageColorTransparent (gdImagePtr im, int color) -{ - if (!im->trueColor) { - if (im->transparent != -1) { - im->alpha[im->transparent] = gdAlphaOpaque; - } - if (color > -1 && colorcolorsTotal && color<=gdMaxColors) { - im->alpha[color] = gdAlphaTransparent; - } else { - return; - } - } - im->transparent = color; -} - -void gdImagePaletteCopy (gdImagePtr to, gdImagePtr from) -{ - int i; - int x, y, p; - int xlate[256]; - if (to->trueColor || from->trueColor) { - return; - } - - for (i = 0; i < 256; i++) { - xlate[i] = -1; - } - - for (x = 0; x < to->sx; x++) { - for (y = 0; y < to->sy; y++) { - p = gdImageGetPixel(to, x, y); - if (xlate[p] == -1) { - /* This ought to use HWB, but we don't have an alpha-aware version of that yet. */ - xlate[p] = gdImageColorClosestAlpha (from, to->red[p], to->green[p], to->blue[p], to->alpha[p]); - } - gdImageSetPixel(to, x, y, xlate[p]); - } - } - - for (i = 0; i < from->colorsTotal; i++) { - to->red[i] = from->red[i]; - to->blue[i] = from->blue[i]; - to->green[i] = from->green[i]; - to->alpha[i] = from->alpha[i]; - to->open[i] = 0; - } - - for (i = from->colorsTotal; i < to->colorsTotal; i++) { - to->open[i] = 1; - } - - to->colorsTotal = from->colorsTotal; -} - -/* 2.0.10: before the drawing routines, some code to clip points that are - * outside the drawing window. Nick Atty (nick@canalplan.org.uk) - * - * This is the Sutherland Hodgman Algorithm, as implemented by - * Duvanenko, Robbins and Gyurcsik - SH(DRG) for short. See Dr Dobb's - * Journal, January 1996, pp107-110 and 116-117 - * - * Given the end points of a line, and a bounding rectangle (which we - * know to be from (0,0) to (SX,SY)), adjust the endpoints to be on - * the edges of the rectangle if the line should be drawn at all, - * otherwise return a failure code - */ - -/* this does "one-dimensional" clipping: note that the second time it - * is called, all the x parameters refer to height and the y to width - * - the comments ignore this (if you can understand it when it's - * looking at the X parameters, it should become clear what happens on - * the second call!) The code is simplified from that in the article, - * as we know that gd images always start at (0,0) - */ - -static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) { - double m; /* gradient of line */ - - if (*x0 < 0) { /* start of line is left of window */ - if(*x1 < 0) { /* as is the end, so the line never cuts the window */ - return 0; - } - m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ - /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */ - *y0 -= (int)(m * *x0); - *x0 = 0; - /* now, perhaps, adjust the far end of the line as well */ - if (*x1 > maxdim) { - *y1 += (int)(m * (maxdim - *x1)); - *x1 = maxdim; - } - return 1; - } - if (*x0 > maxdim) { /* start of line is right of window - complement of above */ - if (*x1 > maxdim) { /* as is the end, so the line misses the window */ - return 0; - } - m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ - *y0 += (int)(m * (maxdim - *x0)); /* adjust so point is on the right boundary */ - *x0 = maxdim; - /* now, perhaps, adjust the end of the line */ - if (*x1 < 0) { - *y1 -= (int)(m * *x1); - *x1 = 0; - } - return 1; - } - /* the final case - the start of the line is inside the window */ - if (*x1 > maxdim) { /* other end is outside to the right */ - m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ - *y1 += (int)(m * (maxdim - *x1)); - *x1 = maxdim; - return 1; - } - if (*x1 < 0) { /* other end is outside to the left */ - m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ - *y1 -= (int)(m * *x1); - *x1 = 0; - return 1; - } - /* only get here if both points are inside the window */ - return 1; -} - -void gdImageSetPixel (gdImagePtr im, int x, int y, int color) -{ - int p; - switch (color) { - case gdStyled: - if (!im->style) { - /* Refuse to draw if no style is set. */ - return; - } else { - p = im->style[im->stylePos++]; - } - if (p != gdTransparent) { - gdImageSetPixel(im, x, y, p); - } - im->stylePos = im->stylePos % im->styleLength; - break; - case gdStyledBrushed: - if (!im->style) { - /* Refuse to draw if no style is set. */ - return; - } - p = im->style[im->stylePos++]; - if (p != gdTransparent && p != 0) { - gdImageSetPixel(im, x, y, gdBrushed); - } - im->stylePos = im->stylePos % im->styleLength; - break; - case gdBrushed: - gdImageBrushApply(im, x, y); - break; - case gdTiled: - gdImageTileApply(im, x, y); - break; - case gdAntiAliased: - gdImageAntiAliasedApply(im, x, y); - break; - default: - if (gdImageBoundsSafe(im, x, y)) { - if (im->trueColor) { - switch (im->alphaBlendingFlag) { - default: - case gdEffectReplace: - im->tpixels[y][x] = color; - break; - case gdEffectAlphaBlend: - im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color); - break; - case gdEffectNormal: - im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color); - break; - case gdEffectOverlay : - im->tpixels[y][x] = gdLayerOverlay(im->tpixels[y][x], color); - break; - } - } else { - im->pixels[y][x] = color; - } - } - break; - } -} - -int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) -{ - int p = gdImageGetPixel(im, x, y); - - if (!im->trueColor) { - return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : gdAlphaOpaque); - } else { - return p; - } -} - -static void gdImageBrushApply (gdImagePtr im, int x, int y) -{ - int lx, ly; - int hy, hx; - int x1, y1, x2, y2; - int srcx, srcy; - - if (!im->brush) { - return; - } - - hy = gdImageSY(im->brush) / 2; - y1 = y - hy; - y2 = y1 + gdImageSY(im->brush); - hx = gdImageSX(im->brush) / 2; - x1 = x - hx; - x2 = x1 + gdImageSX(im->brush); - srcy = 0; - - if (im->trueColor) { - if (im->brush->trueColor) { - for (ly = y1; ly < y2; ly++) { - srcx = 0; - for (lx = x1; (lx < x2); lx++) { - int p; - p = gdImageGetTrueColorPixel(im->brush, srcx, srcy); - /* 2.0.9, Thomas Winzig: apply simple full transparency */ - if (p != gdImageGetTransparent(im->brush)) { - gdImageSetPixel(im, lx, ly, p); - } - srcx++; - } - srcy++; - } - } else { - /* 2.0.12: Brush palette, image truecolor (thanks to Thorben Kundinger for pointing out the issue) */ - for (ly = y1; ly < y2; ly++) { - srcx = 0; - for (lx = x1; lx < x2; lx++) { - int p, tc; - p = gdImageGetPixel(im->brush, srcx, srcy); - tc = gdImageGetTrueColorPixel(im->brush, srcx, srcy); - /* 2.0.9, Thomas Winzig: apply simple full transparency */ - if (p != gdImageGetTransparent(im->brush)) { - gdImageSetPixel(im, lx, ly, tc); - } - srcx++; - } - srcy++; - } - } - } else { - for (ly = y1; ly < y2; ly++) { - srcx = 0; - for (lx = x1; lx < x2; lx++) { - int p; - p = gdImageGetPixel(im->brush, srcx, srcy); - /* Allow for non-square brushes! */ - if (p != gdImageGetTransparent(im->brush)) { - /* Truecolor brush. Very slow on a palette destination. */ - if (im->brush->trueColor) { - gdImageSetPixel(im, lx, ly, gdImageColorResolveAlpha(im, gdTrueColorGetRed(p), - gdTrueColorGetGreen(p), - gdTrueColorGetBlue(p), - gdTrueColorGetAlpha(p))); - } else { - gdImageSetPixel(im, lx, ly, im->brushColorMap[p]); - } - } - srcx++; - } - srcy++; - } - } -} - -static void gdImageTileApply (gdImagePtr im, int x, int y) -{ - int srcx, srcy; - int p; - if (!im->tile) { - return; - } - srcx = x % gdImageSX(im->tile); - srcy = y % gdImageSY(im->tile); - if (im->trueColor) { - p = gdImageGetTrueColorPixel(im->tile, srcx, srcy); - gdImageSetPixel(im, x, y, p); - } else { - p = gdImageGetPixel(im->tile, srcx, srcy); - /* Allow for transparency */ - if (p != gdImageGetTransparent(im->tile)) { - if (im->tile->trueColor) { - /* Truecolor tile. Very slow on a palette destination. */ - gdImageSetPixel(im, x, y, gdImageColorResolveAlpha(im, - gdTrueColorGetRed(p), - gdTrueColorGetGreen(p), - gdTrueColorGetBlue(p), - gdTrueColorGetAlpha(p))); - } else { - gdImageSetPixel(im, x, y, im->tileColorMap[p]); - } - } - } -} - - -static int gdImageTileGet (gdImagePtr im, int x, int y) -{ - int srcx, srcy; - int tileColor,p; - if (!im->tile) { - return -1; - } - srcx = x % gdImageSX(im->tile); - srcy = y % gdImageSY(im->tile); - p = gdImageGetPixel(im->tile, srcx, srcy); - - if (im->trueColor) { - if (im->tile->trueColor) { - tileColor = p; - } else { - tileColor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p)); - } - } else { - if (im->tile->trueColor) { - tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p)); - } else { - tileColor = p; - tileColor = gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p)); - } - } - return tileColor; -} - - -static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py) -{ - float p_dist, p_alpha; - unsigned char opacity; - - /* - * Find the perpendicular distance from point C (px, py) to the line - * segment AB that is being drawn. (Adapted from an algorithm from the - * comp.graphics.algorithms FAQ.) - */ - - int LAC_2, LBC_2; - - int Ax_Cx = im->AAL_x1 - px; - int Ay_Cy = im->AAL_y1 - py; - - int Bx_Cx = im->AAL_x2 - px; - int By_Cy = im->AAL_y2 - py; - - /* 2.0.13: bounds check! AA_opacity is just as capable of - * overflowing as the main pixel array. Arne Jorgensen. - * 2.0.14: typo fixed. 2.0.15: moved down below declarations - * to satisfy non-C++ compilers. - */ - if (!gdImageBoundsSafe(im, px, py)) { - return; - } - - /* Get the squares of the lengths of the segemnts AC and BC. */ - LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy); - LBC_2 = (Bx_Cx * Bx_Cx) + (By_Cy * By_Cy); - - if (((im->AAL_LAB_2 + LAC_2) >= LBC_2) && ((im->AAL_LAB_2 + LBC_2) >= LAC_2)) { - /* The two angles are acute. The point lies inside the portion of the - * plane spanned by the line segment. - */ - p_dist = fabs ((float) ((Ay_Cy * im->AAL_Bx_Ax) - (Ax_Cx * im->AAL_By_Ay)) / im->AAL_LAB); - } else { - /* The point is past an end of the line segment. It's length from the - * segment is the shorter of the lengths from the endpoints, but call - * the distance -1, so as not to compute the alpha nor draw the pixel. - */ - p_dist = -1; - } - - if ((p_dist >= 0) && (p_dist <= (float) (im->thick))) { - p_alpha = pow (1.0 - (p_dist / 1.5), 2); - - if (p_alpha > 0) { - if (p_alpha >= 1) { - opacity = 255; - } else { - opacity = (unsigned char) (p_alpha * 255.0); - } - if (!im->AA_polygon || (im->AA_opacity[py][px] < opacity)) { - im->AA_opacity[py][px] = opacity; - } - } - } -} - - -int gdImageGetPixel (gdImagePtr im, int x, int y) -{ - if (gdImageBoundsSafe(im, x, y)) { - if (im->trueColor) { - return im->tpixels[y][x]; - } else { - return im->pixels[y][x]; - } - } else { - return 0; - } -} - -void gdImageAABlend (gdImagePtr im) -{ - float p_alpha, old_alpha; - int color = im->AA_color, color_red, color_green, color_blue; - int old_color, old_red, old_green, old_blue; - int p_color, p_red, p_green, p_blue; - int px, py; - - color_red = gdImageRed(im, color); - color_green = gdImageGreen(im, color); - color_blue = gdImageBlue(im, color); - - /* Impose the anti-aliased drawing on the image. */ - for (py = 0; py < im->sy; py++) { - for (px = 0; px < im->sx; px++) { - if (im->AA_opacity[py][px] != 0) { - old_color = gdImageGetPixel(im, px, py); - - if ((old_color != color) && ((old_color != im->AA_dont_blend) || (im->AA_opacity[py][px] == 255))) { - /* Only blend with different colors that aren't the dont_blend color. */ - p_alpha = (float) (im->AA_opacity[py][px]) / 255.0; - old_alpha = 1.0 - p_alpha; - - if (p_alpha >= 1.0) { - p_color = color; - } else { - old_red = gdImageRed(im, old_color); - old_green = gdImageGreen(im, old_color); - old_blue = gdImageBlue(im, old_color); - - p_red = (int) (((float) color_red * p_alpha) + ((float) old_red * old_alpha)); - p_green = (int) (((float) color_green * p_alpha) + ((float) old_green * old_alpha)); - p_blue = (int) (((float) color_blue * p_alpha) + ((float) old_blue * old_alpha)); - p_color = gdImageColorResolve(im, p_red, p_green, p_blue); - } - gdImageSetPixel(im, px, py, p_color); - } - } - } - /* Clear the AA_opacity array behind us. */ - memset(im->AA_opacity[py], 0, im->sx); - } -} - - -/* Bresenham as presented in Foley & Van Dam */ -void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) -{ - int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; - int wid; - int w, wstart; - int thick = im->thick; - - /* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */ - if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im))) { - return; - } - - /* gdAntiAliased passed as color: set anti-aliased line (AAL) global vars. */ - if (color == gdAntiAliased) { - im->AAL_x1 = x1; - im->AAL_y1 = y1; - im->AAL_x2 = x2; - im->AAL_y2 = y2; - - /* Compute what we can for point-to-line distance calculation later. */ - im->AAL_Bx_Ax = x2 - x1; - im->AAL_By_Ay = y2 - y1; - im->AAL_LAB_2 = (im->AAL_Bx_Ax * im->AAL_Bx_Ax) + (im->AAL_By_Ay * im->AAL_By_Ay); - im->AAL_LAB = sqrt (im->AAL_LAB_2); - - /* For AA, we must draw pixels outside the width of the line. Keep in - * mind that this will be curtailed by cos/sin of theta later. - */ - thick += 4; - } - - dx = abs(x2 - x1); - dy = abs(y2 - y1); - if (dy <= dx) { - /* More-or-less horizontal. use wid for vertical stroke */ - /* Doug Claar: watch out for NaN in atan2 (2.0.5) */ - if ((dx == 0) && (dy == 0)) { - wid = 1; - } else { - wid = (int)(thick * cos (atan2 (dy, dx))); - if (wid == 0) { - wid = 1; - } - } - d = 2 * dy - dx; - incr1 = 2 * dy; - incr2 = 2 * (dy - dx); - if (x1 > x2) { - x = x2; - y = y2; - ydirflag = (-1); - xend = x1; - } else { - x = x1; - y = y1; - ydirflag = 1; - xend = x2; - } - - /* Set up line thickness */ - wstart = y - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel(im, x, w, color); - } - - if (((y2 - y1) * ydirflag) > 0) { - while (x < xend) { - x++; - if (d < 0) { - d += incr1; - } else { - y++; - d += incr2; - } - wstart = y - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel (im, x, w, color); - } - } - } else { - while (x < xend) { - x++; - if (d < 0) { - d += incr1; - } else { - y--; - d += incr2; - } - wstart = y - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel (im, x, w, color); - } - } - } - } else { - /* More-or-less vertical. use wid for horizontal stroke */ - /* 2.0.12: Michael Schwartz: divide rather than multiply; - TBB: but watch out for /0! */ - double as = sin(atan2(dy, dx)); - if (as != 0) { - if (!(wid = thick / as)) { - wid = 1; - } - } else { - wid = 1; - } - - d = 2 * dx - dy; - incr1 = 2 * dx; - incr2 = 2 * (dx - dy); - if (y1 > y2) { - y = y2; - x = x2; - yend = y1; - xdirflag = (-1); - } else { - y = y1; - x = x1; - yend = y2; - xdirflag = 1; - } - - /* Set up line thickness */ - wstart = x - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel (im, w, y, color); - } - - if (((x2 - x1) * xdirflag) > 0) { - while (y < yend) { - y++; - if (d < 0) { - d += incr1; - } else { - x++; - d += incr2; - } - wstart = x - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel (im, w, y, color); - } - } - } else { - while (y < yend) { - y++; - if (d < 0) { - d += incr1; - } else { - x--; - d += incr2; - } - wstart = x - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel (im, w, y, color); - } - } - } - } - - /* If this is the only line we are drawing, go ahead and blend. */ - if (color == gdAntiAliased && !im->AA_polygon) { - gdImageAABlend(im); - } -} - - -/* - * Added on 2003/12 by Pierre-Alain Joye (pajoye@pearfr.org) - * */ -#define BLEND_COLOR(a, nc, c, cc) \ -nc = (cc) + (((((c) - (cc)) * (a)) + ((((c) - (cc)) * (a)) >> 8) + 0x80) >> 8); - -inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t) -{ - int dr,dg,db,p,r,g,b; - dr = gdTrueColorGetRed(color); - dg = gdTrueColorGetGreen(color); - db = gdTrueColorGetBlue(color); - - p = gdImageGetPixel(im,x,y); - r = gdTrueColorGetRed(p); - g = gdTrueColorGetGreen(p); - b = gdTrueColorGetBlue(p); - - BLEND_COLOR(t, dr, r, dr); - BLEND_COLOR(t, dg, g, dg); - BLEND_COLOR(t, db, b, db); - im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque); -} - -/* - * Added on 2003/12 by Pierre-Alain Joye (pajoye@pearfr.org) - **/ -void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) -{ - /* keep them as 32bits */ - long x, y, inc; - long dx, dy,tmp; - - if (y1 < 0 && y2 < 0) { - return; - } - if (y1 < 0) { - x1 += (y1 * (x1 - x2)) / (y2 - y1); - y1 = 0; - } - if (y2 < 0) { - x2 += (y2 * (x1 - x2)) / (y2 - y1); - y2 = 0; - } - - /* bottom edge */ - if (y1 >= im->sy && y2 >= im->sy) { - return; - } - if (y1 >= im->sy) { - x1 -= ((im->sy - y1) * (x1 - x2)) / (y2 - y1); - y1 = im->sy - 1; - } - if (y2 >= im->sy) { - x2 -= ((im->sy - y2) * (x1 - x2)) / (y2 - y1); - y2 = im->sy - 1; - } - - /* left edge */ - if (x1 < 0 && x2 < 0) { - return; - } - if (x1 < 0) { - y1 += (x1 * (y1 - y2)) / (x2 - x1); - x1 = 0; - } - if (x2 < 0) { - y2 += (x2 * (y1 - y2)) / (x2 - x1); - x2 = 0; - } - /* right edge */ - if (x1 >= im->sx && x2 >= im->sx) { - return; - } - if (x1 >= im->sx) { - y1 -= ((im->sx - x1) * (y1 - y2)) / (x2 - x1); - x1 = im->sx - 1; - } - if (x2 >= im->sx) { - y2 -= ((im->sx - x2) * (y1 - y2)) / (x2 - x1); - x2 = im->sx - 1; - } - - dx = x2 - x1; - dy = y2 - y1; - - if (dx == 0 && dy == 0) { - return; - } - if (abs(dx) > abs(dy)) { - if (dx < 0) { - tmp = x1; - x1 = x2; - x2 = tmp; - tmp = y1; - y1 = y2; - y2 = tmp; - dx = x2 - x1; - dy = y2 - y1; - } - x = x1 << 16; - y = y1 << 16; - inc = (dy * 65536) / dx; - while ((x >> 16) < x2) { - gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF); - if ((y >> 16) + 1 < im->sy) { - gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF); - } - x += (1 << 16); - y += inc; - } - } else { - if (dy < 0) { - tmp = x1; - x1 = x2; - x2 = tmp; - tmp = y1; - y1 = y2; - y2 = tmp; - dx = x2 - x1; - dy = y2 - y1; - } - x = x1 << 16; - y = y1 << 16; - inc = (dx * 65536) / dy; - while ((y>>16) < y2) { - gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF); - if ((x >> 16) + 1 < im->sx) { - gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF); - } - x += inc; - y += (1<<16); - } - } -} - -static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, int vert); - -void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) -{ - int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; - int dashStep = 0; - int on = 1; - int wid; - int vert; - int thick = im->thick; - - dx = abs(x2 - x1); - dy = abs(y2 - y1); - if (dy <= dx) { - /* More-or-less horizontal. use wid for vertical stroke */ - /* 2.0.12: Michael Schwartz: divide rather than multiply; - TBB: but watch out for /0! */ - double as = sin(atan2(dy, dx)); - if (as != 0) { - wid = thick / as; - } else { - wid = 1; - } - wid = (int)(thick * sin(atan2(dy, dx))); - vert = 1; - - d = 2 * dy - dx; - incr1 = 2 * dy; - incr2 = 2 * (dy - dx); - if (x1 > x2) { - x = x2; - y = y2; - ydirflag = (-1); - xend = x1; - } else { - x = x1; - y = y1; - ydirflag = 1; - xend = x2; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - if (((y2 - y1) * ydirflag) > 0) { - while (x < xend) { - x++; - if (d < 0) { - d += incr1; - } else { - y++; - d += incr2; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - } - } else { - while (x < xend) { - x++; - if (d < 0) { - d += incr1; - } else { - y--; - d += incr2; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - } - } - } else { - /* 2.0.12: Michael Schwartz: divide rather than multiply; - TBB: but watch out for /0! */ - double as = sin (atan2 (dy, dx)); - if (as != 0) { - wid = thick / as; - } else { - wid = 1; - } - vert = 0; - - d = 2 * dx - dy; - incr1 = 2 * dx; - incr2 = 2 * (dx - dy); - if (y1 > y2) { - y = y2; - x = x2; - yend = y1; - xdirflag = (-1); - } else { - y = y1; - x = x1; - yend = y2; - xdirflag = 1; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - if (((x2 - x1) * xdirflag) > 0) { - while (y < yend) { - y++; - if (d < 0) { - d += incr1; - } else { - x++; - d += incr2; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - } - } else { - while (y < yend) { - y++; - if (d < 0) { - d += incr1; - } else { - x--; - d += incr2; - } - dashedSet(im, x, y, color, &on, &dashStep, wid, vert); - } - } - } -} - -static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, int vert) -{ - int dashStep = *dashStepP; - int on = *onP; - int w, wstart; - - dashStep++; - if (dashStep == gdDashSize) { - dashStep = 0; - on = !on; - } - if (on) { - if (vert) { - wstart = y - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel(im, x, w, color); - } - } else { - wstart = x - wid / 2; - for (w = wstart; w < wstart + wid; w++) { - gdImageSetPixel(im, w, y, color); - } - } - } - *dashStepP = dashStep; - *onP = on; -} - -void gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) -{ - int cx, cy; - int px, py; - int fline; - cx = 0; - cy = 0; -#ifdef CHARSET_EBCDIC - c = ASC (c); -#endif /*CHARSET_EBCDIC */ - if ((c < f->offset) || (c >= (f->offset + f->nchars))) { - return; - } - fline = (c - f->offset) * f->h * f->w; - for (py = y; (py < (y + f->h)); py++) { - for (px = x; (px < (x + f->w)); px++) { - if (f->data[fline + cy * f->w + cx]) { - gdImageSetPixel(im, px, py, color); - } - cx++; - } - cx = 0; - cy++; - } -} - -void gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) -{ - int cx, cy; - int px, py; - int fline; - cx = 0; - cy = 0; -#ifdef CHARSET_EBCDIC - c = ASC (c); -#endif /*CHARSET_EBCDIC */ - if ((c < f->offset) || (c >= (f->offset + f->nchars))) { - return; - } - fline = (c - f->offset) * f->h * f->w; - for (py = y; py > (y - f->w); py--) { - for (px = x; px < (x + f->h); px++) { - if (f->data[fline + cy * f->w + cx]) { - gdImageSetPixel(im, px, py, color); - } - cy++; - } - cy = 0; - cx++; - } -} - -void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) -{ - int i; - int l; - l = strlen ((char *) s); - for (i = 0; (i < l); i++) { - gdImageChar(im, f, x, y, s[i], color); - x += f->w; - } -} - -void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) -{ - int i; - int l; - l = strlen ((char *) s); - for (i = 0; (i < l); i++) { - gdImageCharUp(im, f, x, y, s[i], color); - y -= f->w; - } -} - -static int strlen16 (unsigned short *s); - -void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) -{ - int i; - int l; - l = strlen16(s); - for (i = 0; (i < l); i++) { - gdImageChar(im, f, x, y, s[i], color); - x += f->w; - } -} - -void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) -{ - int i; - int l; - l = strlen16(s); - for (i = 0; i < l; i++) { - gdImageCharUp(im, f, x, y, s[i], color); - y -= f->w; - } -} - -static int strlen16 (unsigned short *s) -{ - int len = 0; - while (*s) { - s++; - len++; - } - return len; -} - -#ifndef HAVE_LSQRT -/* If you don't have a nice square root function for longs, you can use - ** this hack - */ -long lsqrt (long n) -{ - long result = (long) sqrt ((double) n); - return result; -} -#endif - -/* s and e are integers modulo 360 (degrees), with 0 degrees - being the rightmost extreme and degrees changing clockwise. - cx and cy are the center in pixels; w and h are the horizontal - and vertical diameter in pixels. Nice interface, but slow. - See gd_arc_f_buggy.c for a better version that doesn't - seem to be bug-free yet. */ - -void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) -{ - if ((s % 360) == (e % 360)) { - gdImageEllipse(im, cx, cy, w, h, color); - } else { - gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); - } -} - -void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style) -{ - gdPoint pts[3]; - int i; - int lx = 0, ly = 0; - int fx = 0, fy = 0; - - while (s<0) { - s += 360; - } - - while (e < s) { - e += 360; - } - - for (i = s; i <= e; i++) { - int x, y; - x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx; - y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy; - if (i != s) { - if (!(style & gdChord)) { - if (style & gdNoFill) { - gdImageLine(im, lx, ly, x, y, color); - } else { - /* This is expensive! */ - pts[0].x = lx; - pts[0].y = ly; - pts[1].x = x; - pts[1].y = y; - pts[2].x = cx; - pts[2].y = cy; - gdImageFilledPolygon(im, pts, 3, color); - } - } - } else { - fx = x; - fy = y; - } - lx = x; - ly = y; - } - if (style & gdChord) { - if (style & gdNoFill) { - if (style & gdEdged) { - gdImageLine(im, cx, cy, lx, ly, color); - gdImageLine(im, cx, cy, fx, fy, color); - } - gdImageLine(im, fx, fy, lx, ly, color); - } else { - pts[0].x = fx; - pts[0].y = fy; - pts[1].x = lx; - pts[1].y = ly; - pts[2].x = cx; - pts[2].y = cy; - gdImageFilledPolygon(im, pts, 3, color); - } - } else { - if (style & gdNoFill) { - if (style & gdEdged) { - gdImageLine(im, cx, cy, lx, ly, color); - gdImageLine(im, cx, cy, fx, fy, color); - } - } - } -} - - -/** - * Integer Ellipse functions (gdImageEllipse and gdImageFilledEllipse) - * Function added by Pierre-Alain Joye 02/08/2003 (paj@pearfr.org) - * See the ellipse function simplification for the equation - * as well as the midpoint algorithm. - */ - -void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c) -{ - int x=0,mx1=0,mx2=0,my1=0,my2=0; - long aq,bq,dx,dy,r,rx,ry,a,b; - - a=w>>1; - b=h>>1; - gdImageSetPixel(im,mx+a, my, c); - gdImageSetPixel(im,mx-a, my, c); - mx1 = mx-a;my1 = my; - mx2 = mx+a;my2 = my; - - aq = a * a; - bq = b * b; - dx = aq << 1; - dy = bq << 1; - r = a * bq; - rx = r << 1; - ry = 0; - x = a; - while (x > 0){ - if (r > 0) { - my1++;my2--; - ry +=dx; - r -=ry; - } - if (r <= 0){ - x--; - mx1++;mx2--; - rx -=dy; - r +=rx; - } - gdImageSetPixel(im,mx1, my1, c); - gdImageSetPixel(im,mx1, my2, c); - gdImageSetPixel(im,mx2, my1, c); - gdImageSetPixel(im,mx2, my2, c); - } -} - -void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c) -{ - int x=0,mx1=0,mx2=0,my1=0,my2=0; - long aq,bq,dx,dy,r,rx,ry,a,b; - int i; - int old_y1,old_y2; - - a=w>>1; - b=h>>1; - - gdImageLine(im, mx-a, my, mx+a, my, c); - - mx1 = mx-a;my1 = my; - mx2 = mx+a;my2 = my; - - aq = a * a; - bq = b * b; - dx = aq << 1; - dy = bq << 1; - r = a * bq; - rx = r << 1; - ry = 0; - x = a; - old_y2=-2; - old_y1=-2; - while (x > 0){ - if (r > 0) { - my1++;my2--; - ry +=dx; - r -=ry; - } - if (r <= 0){ - x--; - mx1++;mx2--; - rx -=dy; - r +=rx; - } - if(old_y2!=my2){ - for(i=mx1;i<=mx2;i++){ - gdImageSetPixel(im,i,my1,c); - } - } - if(old_y2!=my2){ - for(i=mx1;i<=mx2;i++){ - gdImageSetPixel(im,i,my2,c); - } - } - old_y2 = my2; - old_y1 = my1; - } -} - -void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) -{ - int lastBorder; - /* Seek left */ - int leftLimit = -1, rightLimit; - int i, restoreAlphaBleding=0; - - if (border < 0) { - /* Refuse to fill to a non-solid border */ - return; - } - - if (im->alphaBlendingFlag) { - restoreAlphaBleding = 1; - im->alphaBlendingFlag = 0; - } - - if (x >= im->sx) { - x = im->sx - 1; - } - if (y >= im->sy) { - y = im->sy - 1; - } - - for (i = x; i >= 0; i--) { - if (gdImageGetPixel(im, i, y) == border) { - break; - } - gdImageSetPixel(im, i, y, color); - leftLimit = i; - } - if (leftLimit == -1) { - if (restoreAlphaBleding) { - im->alphaBlendingFlag = 1; - } - return; - } - /* Seek right */ - rightLimit = x; - for (i = (x + 1); i < im->sx; i++) { - if (gdImageGetPixel(im, i, y) == border) { - break; - } - gdImageSetPixel(im, i, y, color); - rightLimit = i; - } - /* Look at lines above and below and start paints */ - /* Above */ - if (y > 0) { - lastBorder = 1; - for (i = leftLimit; i <= rightLimit; i++) { - int c = gdImageGetPixel(im, i, y - 1); - if (lastBorder) { - if ((c != border) && (c != color)) { - gdImageFillToBorder(im, i, y - 1, border, color); - lastBorder = 0; - } - } else if ((c == border) || (c == color)) { - lastBorder = 1; - } - } - } - - /* Below */ - if (y < ((im->sy) - 1)) { - lastBorder = 1; - for (i = leftLimit; i <= rightLimit; i++) { - int c = gdImageGetPixel(im, i, y + 1); - - if (lastBorder) { - if ((c != border) && (c != color)) { - gdImageFillToBorder(im, i, y + 1, border, color); - lastBorder = 0; - } - } else if ((c == border) || (c == color)) { - lastBorder = 1; - } - } - } - if (restoreAlphaBleding) { - im->alphaBlendingFlag = 1; - } -} - -/* - * set the pixel at (x,y) and its 4-connected neighbors - * with the same pixel value to the new pixel value nc (new color). - * A 4-connected neighbor: pixel above, below, left, or right of a pixel. - * ideas from comp.graphics discussions. - * For tiled fill, the use of a flag buffer is mandatory. As the tile image can - * contain the same color as the color to fill. To do not bloat normal filling - * code I added a 2nd private function. - */ - -/* horizontal segment of scan line y */ -struct seg {int y, xl, xr, dy;}; - -/* max depth of stack */ -#define FILL_MAX 1200000 -#define FILL_PUSH(Y, XL, XR, DY) \ - if (sp=0 && Y+(DY)y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;} - -#define FILL_POP(Y, XL, XR, DY) \ - {sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;} - -void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc); - -void gdImageFill(gdImagePtr im, int x, int y, int nc) -{ - int l, x1, x2, dy; - int oc; /* old pixel value */ - int wx2,wy2; - - int alphablending_bak; - - /* stack of filled segments */ - /* struct seg stack[FILL_MAX],*sp = stack;; */ - struct seg *stack; - struct seg *sp; - - alphablending_bak = im->alphaBlendingFlag; - im->alphaBlendingFlag = 0; - - if (nc==gdTiled){ - _gdImageFillTiled(im,x,y,nc); - im->alphaBlendingFlag = alphablending_bak; - return; - } - - wx2=im->sx;wy2=im->sy; - oc = gdImageGetPixel(im, x, y); - if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) { - im->alphaBlendingFlag = alphablending_bak; - return; - } - - stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); - sp = stack; - - /* required! */ - FILL_PUSH(y,x,x,1); - /* seed segment (popped 1st) */ - FILL_PUSH(y+1, x, x, -1); - while (sp>stack) { - FILL_POP(y, x1, x2, dy); - - for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) { - gdImageSetPixel(im,x, y, nc); - } - if (x>=x1) { - goto skip; - } - l = x+1; - - /* leak on left? */ - if (lx2+1) { - FILL_PUSH(y, x2+1, x-1, -dy); - } -skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); - - l = x; - } while (x<=x2); - } - efree(stack); - im->alphaBlendingFlag = alphablending_bak; -} - -void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) -{ - int i,l, x1, x2, dy; - int oc; /* old pixel value */ - int tiled; - int wx2,wy2; - /* stack of filled segments */ - struct seg *stack; - struct seg *sp; - - int **pts; - if(!im->tile){ - return; - } - - wx2=im->sx;wy2=im->sy; - tiled = nc==gdTiled; - - nc = gdImageTileGet(im,x,y); - pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int)); - - for (i=0; isy;i++) { - pts[i] = (int *) ecalloc(im->sx, sizeof(int)); - } - - stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); - sp = stack; - - oc = gdImageGetPixel(im, x, y); - - /* required! */ - FILL_PUSH(y,x,x,1); - /* seed segment (popped 1st) */ - FILL_PUSH(y+1, x, x, -1); - while (sp>stack) { - FILL_POP(y, x1, x2, dy); - for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) { - if (pts[y][x]){ - /* we should never be here */ - break; - } - nc = gdImageTileGet(im,x,y); - pts[y][x]=1; - gdImageSetPixel(im,x, y, nc); - } - if (x>=x1) { - goto skip; - } - l = x+1; - - /* leak on left? */ - if (lx2+1) { - FILL_PUSH(y, x2+1, x-1, -dy); - } -skip: for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); - l = x; - } while (x<=x2); - } - for (i=0; isy;i++) { - efree(pts[i]); - } - efree(pts); - efree(stack); -} - - - -void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) -{ - int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2; - int thick = im->thick; - int half1 = 1; - int t; - - if (y2 < y1) { - t=y1; - y1 = y2; - y2 = t; - - t = x1; - x1 = x2; - x2 = t; - } - - x1h = x1; x1v = x1; y1h = y1; y1v = y1; x2h = x2; x2v = x2; y2h = y2; y2v = y2; - if (thick > 1) { - int cx, cy, x1ul, y1ul, x2lr, y2lr; - int half = thick >> 1; - half1 = thick - half; - x1ul = x1 - half; - y1ul = y1 - half; - - x2lr = x2 + half; - y2lr = y2 + half; - - cy = y1ul + thick; - while (cy-- > y1ul) { - cx = x1ul - 1; - while (cx++ < x2lr) { - gdImageSetPixel(im, cx, cy, color); - } - } - - cy = y2lr - thick; - while (cy++ < y2lr) { - cx = x1ul - 1; - while (cx++ < x2lr) { - gdImageSetPixel(im, cx, cy, color); - } - } - - cy = y1ul + thick - 1; - while (cy++ < y2lr -thick) { - cx = x1ul - 1; - while (cx++ < x1ul + thick) { - gdImageSetPixel(im, cx, cy, color); - } - } - - cy = y1ul + thick - 1; - while (cy++ < y2lr -thick) { - cx = x2lr - thick - 1; - while (cx++ < x2lr) { - gdImageSetPixel(im, cx, cy, color); - } - } - - return; - } else { - y1v = y1h + 1; - y2v = y2h - 1; - gdImageLine(im, x1h, y1h, x2h, y1h, color); - gdImageLine(im, x1h, y2h, x2h, y2h, color); - gdImageLine(im, x1v, y1v, x1v, y2v, color); - gdImageLine(im, x2v, y1v, x2v, y2v, color); - } -} - -void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) -{ - int x, y; - - /* Nick Atty: limit the points at the edge. Note that this also - * nicely kills any plotting for rectangles completely outside the - * window as it makes the tests in the for loops fail - */ - if (x1 < 0) { - x1 = 0; - } - if (x1 > gdImageSX(im)) { - x1 = gdImageSX(im); - } - if(y1 < 0) { - y1 = 0; - } - if (y1 > gdImageSY(im)) { - y1 = gdImageSY(im); - } - if (x1 > x2) { - x = x1; - x1 = x2; - x2 = x; - } - if (y1 > y2) { - y = y1; - y1 = y2; - y2 = y; - } - - for (y = y1; (y <= y2); y++) { - for (x = x1; (x <= x2); x++) { - gdImageSetPixel (im, x, y, color); - } - } -} - -void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) -{ - int c; - int x, y; - int tox, toy; - int i; - int colorMap[gdMaxColors]; - - if (dst->trueColor) { - /* 2.0: much easier when the destination is truecolor. */ - /* 2.0.10: needs a transparent-index check that is still valid if - * the source is not truecolor. Thanks to Frank Warmerdam. - */ - - if (src->trueColor) { - for (y = 0; (y < h); y++) { - for (x = 0; (x < w); x++) { - int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y); - gdImageSetPixel (dst, dstX + x, dstY + y, c); - } - } - } else { - /* source is palette based */ - for (y = 0; (y < h); y++) { - for (x = 0; (x < w); x++) { - int c = gdImageGetPixel (src, srcX + x, srcY + y); - if (c != src->transparent) { - gdImageSetPixel (dst, dstX + x, dstY + y, gdTrueColor(src->red[c], src->green[c], src->blue[c])); - } - } - } - } - return; - } - - /* Destination is palette based */ - if (src->trueColor) { /* But source is truecolor (Ouch!) */ - toy = dstY; - for (y = srcY; (y < (srcY + h)); y++) { - tox = dstX; - for (x = srcX; x < (srcX + w); x++) { - int nc; - c = gdImageGetPixel (src, x, y); - - /* Get best match possible. */ - nc = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha(c)); - - gdImageSetPixel(dst, tox, toy, nc); - tox++; - } - toy++; - } - return; - } - - /* Palette based to palette based */ - for (i = 0; i < gdMaxColors; i++) { - colorMap[i] = (-1); - } - toy = dstY; - for (y = srcY; y < (srcY + h); y++) { - tox = dstX; - for (x = srcX; x < (srcX + w); x++) { - int nc; - int mapTo; - c = gdImageGetPixel (src, x, y); - /* Added 7/24/95: support transparent copies */ - if (gdImageGetTransparent (src) == c) { - tox++; - continue; - } - /* Have we established a mapping for this color? */ - if (src->trueColor) { - /* 2.05: remap to the palette available in the destination image. This is slow and - * works badly, but it beats crashing! Thanks to Padhrig McCarthy. - */ - mapTo = gdImageColorResolveAlpha (dst, gdTrueColorGetRed (c), gdTrueColorGetGreen (c), gdTrueColorGetBlue (c), gdTrueColorGetAlpha (c)); - } else if (colorMap[c] == (-1)) { - /* If it's the same image, mapping is trivial */ - if (dst == src) { - nc = c; - } else { - /* Get best match possible. This function never returns error. */ - nc = gdImageColorResolveAlpha (dst, src->red[c], src->green[c], src->blue[c], src->alpha[c]); - } - colorMap[c] = nc; - mapTo = colorMap[c]; - } else { - mapTo = colorMap[c]; - } - gdImageSetPixel (dst, tox, toy, mapTo); - tox++; - } - toy++; - } -} - -/* This function is a substitute for real alpha channel operations, - so it doesn't pay attention to the alpha channel. */ -void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) -{ - int c, dc; - int x, y; - int tox, toy; - int ncR, ncG, ncB; - toy = dstY; - - for (y = srcY; y < (srcY + h); y++) { - tox = dstX; - for (x = srcX; x < (srcX + w); x++) { - int nc; - c = gdImageGetPixel(src, x, y); - /* Added 7/24/95: support transparent copies */ - if (gdImageGetTransparent(src) == c) { - tox++; - continue; - } - /* If it's the same image, mapping is trivial */ - if (dst == src) { - nc = c; - } else { - dc = gdImageGetPixel(dst, tox, toy); - - ncR = (int)(gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0)); - ncG = (int)(gdImageGreen (src, c) * (pct / 100.0) + gdImageGreen (dst, dc) * ((100 - pct) / 100.0)); - ncB = (int)(gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0)); - - /* Find a reasonable color */ - nc = gdImageColorResolve (dst, ncR, ncG, ncB); - } - gdImageSetPixel (dst, tox, toy, nc); - tox++; - } - toy++; - } -} - -/* This function is a substitute for real alpha channel operations, - so it doesn't pay attention to the alpha channel. */ -void gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) -{ - int c, dc; - int x, y; - int tox, toy; - int ncR, ncG, ncB; - float g; - toy = dstY; - - for (y = srcY; (y < (srcY + h)); y++) { - tox = dstX; - for (x = srcX; (x < (srcX + w)); x++) { - int nc; - c = gdImageGetPixel (src, x, y); - /* Added 7/24/95: support transparent copies */ - if (gdImageGetTransparent(src) == c) { - tox++; - continue; - } - /* - * If it's the same image, mapping is NOT trivial since we - * merge with greyscale target, but if pct is 100, the grey - * value is not used, so it becomes trivial. pjw 2.0.12. - */ - if (dst == src && pct == 100) { - nc = c; - } else { - dc = gdImageGetPixel(dst, tox, toy); - g = (0.29900f * gdImageRed(dst, dc)) + (0.58700f * gdImageGreen(dst, dc)) + (0.11400f * gdImageBlue(dst, dc)); - - ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); - ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); - ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); - - /* First look for an exact match */ - nc = gdImageColorExact(dst, ncR, ncG, ncB); - if (nc == (-1)) { - /* No, so try to allocate it */ - nc = gdImageColorAllocate(dst, ncR, ncG, ncB); - /* If we're out of colors, go for the closest color */ - if (nc == (-1)) { - nc = gdImageColorClosest(dst, ncR, ncG, ncB); - } - } - } - gdImageSetPixel(dst, tox, toy, nc); - tox++; - } - toy++; - } -} - -void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) -{ - int c; - int x, y; - int tox, toy; - int ydest; - int i; - int colorMap[gdMaxColors]; - /* Stretch vectors */ - int *stx, *sty; - /* We only need to use floating point to determine the correct stretch vector for one line's worth. */ - double accum; - stx = (int *) gdMalloc (sizeof (int) * srcW); - sty = (int *) gdMalloc (sizeof (int) * srcH); - accum = 0; - - /* Fixed by Mao Morimoto 2.0.16 */ - for (i = 0; (i < srcW); i++) { - stx[i] = dstW * (i+1) / srcW - dstW * i / srcW ; - } - for (i = 0; (i < srcH); i++) { - sty[i] = dstH * (i+1) / srcH - dstH * i / srcH ; - } - for (i = 0; (i < gdMaxColors); i++) { - colorMap[i] = (-1); - } - toy = dstY; - for (y = srcY; (y < (srcY + srcH)); y++) { - for (ydest = 0; (ydest < sty[y - srcY]); ydest++) { - tox = dstX; - for (x = srcX; (x < (srcX + srcW)); x++) { - int nc = 0; - int mapTo; - if (!stx[x - srcX]) { - continue; - } - if (dst->trueColor) { - /* 2.0.9: Thorben Kundinger: Maybe the source image is not a truecolor image */ - if (!src->trueColor) { - int tmp = gdImageGetPixel (src, x, y); - mapTo = gdImageGetTrueColorPixel (src, x, y); - if (gdImageGetTransparent (src) == tmp) { - /* 2.0.21, TK: not tox++ */ - tox += stx[x - srcX]; - continue; - } - } else { - /* TK: old code follows */ - mapTo = gdImageGetTrueColorPixel (src, x, y); - /* Added 7/24/95: support transparent copies */ - if (gdImageGetTransparent (src) == mapTo) { - /* 2.0.21, TK: not tox++ */ - tox += stx[x - srcX]; - continue; - } - } - } else { - c = gdImageGetPixel (src, x, y); - /* Added 7/24/95: support transparent copies */ - if (gdImageGetTransparent (src) == c) { - tox += stx[x - srcX]; - continue; - } - if (src->trueColor) { - /* Remap to the palette available in the destination image. This is slow and works badly. */ - mapTo = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), - gdTrueColorGetGreen(c), - gdTrueColorGetBlue(c), - gdTrueColorGetAlpha (c)); - } else { - /* Have we established a mapping for this color? */ - if (colorMap[c] == (-1)) { - /* If it's the same image, mapping is trivial */ - if (dst == src) { - nc = c; - } else { - /* Find or create the best match */ - /* 2.0.5: can't use gdTrueColorGetRed, etc with palette */ - nc = gdImageColorResolveAlpha(dst, gdImageRed(src, c), - gdImageGreen(src, c), - gdImageBlue(src, c), - gdImageAlpha(src, c)); - } - colorMap[c] = nc; - } - mapTo = colorMap[c]; - } - } - for (i = 0; (i < stx[x - srcX]); i++) { - gdImageSetPixel (dst, tox, toy, mapTo); - tox++; - } - } - toy++; - } - } - gdFree (stx); - gdFree (sty); -} - -/* When gd 1.x was first created, floating point was to be avoided. - These days it is often faster than table lookups or integer - arithmetic. The routine below is shamelessly, gloriously - floating point. TBB */ - -void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) -{ - int x, y; - double sy1, sy2, sx1, sx2; - if (!dst->trueColor) { - gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - return; - } - for (y = dstY; (y < dstY + dstH); y++) { - sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH; - sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH; - for (x = dstX; (x < dstX + dstW); x++) { - double sx, sy; - double spixels = 0; - double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; - double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; - sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; - sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; - sy = sy1; - do { - double yportion; - if (floor_cast(sy) == floor_cast(sy1)) { - yportion = 1.0f - (sy - floor_cast(sy)); - if (yportion > sy2 - sy1) { - yportion = sy2 - sy1; - } - sy = floor_cast(sy); - } else if (sy == floorf(sy2)) { - yportion = sy2 - floor_cast(sy2); - } else { - yportion = 1.0f; - } - sx = sx1; - do { - double xportion; - double pcontribution; - int p; - if (floorf(sx) == floor_cast(sx1)) { - xportion = 1.0f - (sx - floor_cast(sx)); - if (xportion > sx2 - sx1) { - xportion = sx2 - sx1; - } - sx = floor_cast(sx); - } else if (sx == floorf(sx2)) { - xportion = sx2 - floor_cast(sx2); - } else { - xportion = 1.0f; - } - pcontribution = xportion * yportion; - p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY); - - alpha_factor = ((gdAlphaMax - gdTrueColorGetAlpha(p))) * pcontribution; - red += gdTrueColorGetRed (p) * alpha_factor; - green += gdTrueColorGetGreen (p) * alpha_factor; - blue += gdTrueColorGetBlue (p) * alpha_factor; - alpha += gdTrueColorGetAlpha (p) * pcontribution; - alpha_sum += alpha_factor; - contrib_sum += pcontribution; - spixels += xportion * yportion; - sx += 1.0f; - } - while (sx < sx2); - - sy += 1.0f; - } - - while (sy < sy2); - - if (spixels != 0.0f) { - red /= spixels; - green /= spixels; - blue /= spixels; - alpha /= spixels; - } - if ( alpha_sum != 0.0f) { - if( contrib_sum != 0.0f) { - alpha_sum /= contrib_sum; - } - red /= alpha_sum; - green /= alpha_sum; - blue /= alpha_sum; - } - /* Clamping to allow for rounding errors above */ - if (red > 255.0f) { - red = 255.0f; - } - if (green > 255.0f) { - green = 255.0f; - } - if (blue > 255.0f) { - blue = 255.0f; - } - if (alpha > gdAlphaMax) { - alpha = gdAlphaMax; - } - gdImageSetPixel(dst, x, y, gdTrueColorAlpha ((int) red, (int) green, (int) blue, (int) alpha)); - } - } -} - - -/* - * Rotate function Added on 2003/12 - * by Pierre-Alain Joye (pajoye@pearfr.org) - **/ -/* Begin rotate function */ -#ifdef ROTATE_PI -#undef ROTATE_PI -#endif /* ROTATE_PI */ - -#define ROTATE_DEG2RAD 3.1415926535897932384626433832795/180 -void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack, int ignoretransparent) -{ - typedef int (*FuncPtr)(gdImagePtr, int, int); - int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA; - FuncPtr f; - - int pxlOldLeft, pxlLeft=0, pxlSrc; - - /* Keep clrBack as color index if required */ - if (src->trueColor) { - pxlOldLeft = clrBack; - f = gdImageGetTrueColorPixel; - } else { - pxlOldLeft = clrBack; - clrBackR = gdImageRed(src, clrBack); - clrBackG = gdImageGreen(src, clrBack); - clrBackB = gdImageBlue(src, clrBack); - clrBackA = gdImageAlpha(src, clrBack); - clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA); - f = gdImageGetPixel; - } - - for (i = 0; i < iOffset; i++) { - gdImageSetPixel (dst, i, uRow, clrBack); - } - - if (i < dst->sx) { - gdImageSetPixel (dst, i, uRow, clrBack); - } - - for (i = 0; i < src->sx; i++) { - pxlSrc = f (src,i,uRow); - - r = (int)(gdImageRed(src,pxlSrc) * dWeight); - g = (int)(gdImageGreen(src,pxlSrc) * dWeight); - b = (int)(gdImageBlue(src,pxlSrc) * dWeight); - a = (int)(gdImageAlpha(src,pxlSrc) * dWeight); - - pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); - - if (pxlLeft == -1) { - pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a); - } - - r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft)); - g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft)); - b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft)); - a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft)); - - if (r>255) { - r = 255; - } - - if (g>255) { - g = 255; - } - - if (b>255) { - b = 255; - } - - if (a>127) { - a = 127; - } - - if (ignoretransparent && pxlSrc == dst->transparent) { - pxlSrc = dst->transparent; - } else { - pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a); - - if (pxlSrc == -1) { - pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a); - } - } - - if ((i + iOffset >= 0) && (i + iOffset < dst->sx)) { - gdImageSetPixel (dst, i+iOffset, uRow, pxlSrc); - } - - pxlOldLeft = pxlLeft; - } - - i += iOffset; - - if (i < dst->sx) { - gdImageSetPixel (dst, i, uRow, pxlLeft); - } - - gdImageSetPixel (dst, iOffset, uRow, clrBack); - - i--; - - while (++i < dst->sx) { - gdImageSetPixel (dst, i, uRow, clrBack); - } -} - -void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack, int ignoretransparent) -{ - typedef int (*FuncPtr)(gdImagePtr, int, int); - int i, iYPos=0, r, g, b, a; - FuncPtr f; - int pxlOldLeft, pxlLeft=0, pxlSrc; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - - for (i = 0; i<=iOffset; i++) { - gdImageSetPixel (dst, uCol, i, clrBack); - } - r = (int)((double)gdImageRed(src,clrBack) * dWeight); - g = (int)((double)gdImageGreen(src,clrBack) * dWeight); - b = (int)((double)gdImageBlue(src,clrBack) * dWeight); - a = (int)((double)gdImageAlpha(src,clrBack) * dWeight); - - pxlOldLeft = gdImageColorAllocateAlpha(dst, r, g, b, a); - - for (i = 0; i < src->sy; i++) { - pxlSrc = f (src, uCol, i); - iYPos = i + iOffset; - - r = (int)((double)gdImageRed(src,pxlSrc) * dWeight); - g = (int)((double)gdImageGreen(src,pxlSrc) * dWeight); - b = (int)((double)gdImageBlue(src,pxlSrc) * dWeight); - a = (int)((double)gdImageAlpha(src,pxlSrc) * dWeight); - - pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); - - if (pxlLeft == -1) { - pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a); - } - - r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft)); - g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft)); - b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft)); - a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft)); - - if (r>255) { - r = 255; - } - - if (g>255) { - g = 255; - } - - if (b>255) { - b = 255; - } - - if (a>127) { - a = 127; - } - - if (ignoretransparent && pxlSrc == dst->transparent) { - pxlSrc = dst->transparent; - } else { - pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a); - - if (pxlSrc == -1) { - pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a); - } - } - - if ((iYPos >= 0) && (iYPos < dst->sy)) { - gdImageSetPixel (dst, uCol, iYPos, pxlSrc); - } - - pxlOldLeft = pxlLeft; - } - - i = iYPos; - if (i < dst->sy) { - gdImageSetPixel (dst, uCol, i, pxlLeft); - } - - i--; - while (++i < dst->sy) { - gdImageSetPixel (dst, uCol, i, clrBack); - } -} - -/* Rotates an image by 90 degrees (counter clockwise) */ -gdImagePtr gdImageRotate90 (gdImagePtr src, int ignoretransparent) -{ - int uY, uX; - int c,r,g,b,a; - gdImagePtr dst; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - dst = gdImageCreateTrueColor(src->sy, src->sx); - dst->transparent = src->transparent; - - if (dst != NULL) { - gdImagePaletteCopy (dst, src); - - for (uY = 0; uYsy; uY++) { - for (uX = 0; uXsx; uX++) { - c = f (src, uX, uY); - if (!src->trueColor) { - r = gdImageRed(src,c); - g = gdImageGreen(src,c); - b = gdImageBlue(src,c); - a = gdImageAlpha(src,c); - c = gdTrueColorAlpha(r, g, b, a); - } - if (ignoretransparent && c == dst->transparent) { - gdImageSetPixel(dst, uY, (dst->sy - uX - 1), dst->transparent); - } else { - gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c); - } - } - } - } - - return dst; -} - -/* Rotates an image by 180 degrees (counter clockwise) */ -gdImagePtr gdImageRotate180 (gdImagePtr src, int ignoretransparent) -{ - int uY, uX; - int c,r,g,b,a; - gdImagePtr dst; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - dst = gdImageCreateTrueColor(src->sx, src->sy); - dst->transparent = src->transparent; - - if (dst != NULL) { - gdImagePaletteCopy (dst, src); - - for (uY = 0; uYsy; uY++) { - for (uX = 0; uXsx; uX++) { - c = f (src, uX, uY); - if (!src->trueColor) { - r = gdImageRed(src,c); - g = gdImageGreen(src,c); - b = gdImageBlue(src,c); - a = gdImageAlpha(src,c); - c = gdTrueColorAlpha(r, g, b, a); - } - - if (ignoretransparent && c == dst->transparent) { - gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), dst->transparent); - } else { - gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c); - } - } - } - } - - return dst; -} - -/* Rotates an image by 270 degrees (counter clockwise) */ -gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent) -{ - int uY, uX; - int c,r,g,b,a; - gdImagePtr dst; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - dst = gdImageCreateTrueColor (src->sy, src->sx); - dst->transparent = src->transparent; - - if (dst != NULL) { - gdImagePaletteCopy (dst, src); - - for (uY = 0; uYsy; uY++) { - for (uX = 0; uXsx; uX++) { - c = f (src, uX, uY); - if (!src->trueColor) { - r = gdImageRed(src,c); - g = gdImageGreen(src,c); - b = gdImageBlue(src,c); - a = gdImageAlpha(src,c); - c = gdTrueColorAlpha(r, g, b, a); - } - - if (ignoretransparent && c == dst->transparent) { - gdImageSetPixel(dst, (dst->sx - uY - 1), uX, dst->transparent); - } else { - gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c); - } - } - } - } - - return dst; -} - -gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent) -{ - typedef int (*FuncPtr)(gdImagePtr, int, int); - gdImagePtr dst1,dst2,dst3; - FuncPtr f; - double dRadAngle, dSinE, dTan, dShear; - double dOffset; /* Variable skew offset */ - int u, iShear, newx, newy; - int clrBackR, clrBackG, clrBackB, clrBackA; - - /* See GEMS I for the algorithm details */ - dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */ - dSinE = sin (dRadAngle); - dTan = tan (dRadAngle / 2.0); - - newx = (int)(src->sx + src->sy * fabs(dTan)); - newy = src->sy; - - /* 1st shear */ - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - - dst1 = gdImageCreateTrueColor(newx, newy); - /******* Perform 1st shear (horizontal) ******/ - if (dst1 == NULL) { - return NULL; - } - dst1->alphaBlendingFlag = gdEffectReplace; - - if (dAngle == 0.0) { - /* Returns copy of src */ - gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy); - return dst1; - } - - gdImagePaletteCopy (dst1, src); - - if (ignoretransparent) { - if (gdImageTrueColor(src)) { - dst1->transparent = src->transparent; - } else { - - dst1->transparent = gdTrueColorAlpha(gdImageRed(src, src->transparent), gdImageBlue(src, src->transparent), gdImageGreen(src, src->transparent), 127); - } - } - - dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */ - dSinE = sin (dRadAngle); - dTan = tan (dRadAngle / 2.0); - - for (u = 0; u < dst1->sy; u++) { - if (dTan >= 0.0) { - dShear = ((double)(u + 0.5)) * dTan; - } else { - dShear = ((double)(u - dst1->sy) + 0.5) * dTan; - } - - iShear = (int)floor(dShear); - gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack, ignoretransparent); - } - - /* - The 1st shear may use the original clrBack as color index - Convert it once here - */ - if(!src->trueColor) { - clrBackR = gdImageRed(src, clrBack); - clrBackG = gdImageGreen(src, clrBack); - clrBackB = gdImageBlue(src, clrBack); - clrBackA = gdImageAlpha(src, clrBack); - clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA); - } - /* 2nd shear */ - newx = dst1->sx; - - if (dSinE > 0.0) { - dOffset = (src->sx-1) * dSinE; - } else { - dOffset = -dSinE * (src->sx - newx); - } - - newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - dst2 = gdImageCreateTrueColor(newx, newy); - if (dst2 == NULL) { - gdImageDestroy(dst1); - return NULL; - } - dst2->alphaBlendingFlag = gdEffectReplace; - if (ignoretransparent) { - dst2->transparent = dst1->transparent; - } - - for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) { - iShear = (int)floor (dOffset); - gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack, ignoretransparent); - } - - /* 3rd shear */ - gdImageDestroy(dst1); - - newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1; - newy = dst2->sy; - - if (src->trueColor) { - f = gdImageGetTrueColorPixel; - } else { - f = gdImageGetPixel; - } - dst3 = gdImageCreateTrueColor(newx, newy); - if (dst3 == NULL) { - gdImageDestroy(dst2); - return NULL; - } - - dst3->alphaBlendingFlag = gdEffectReplace; - if (ignoretransparent) { - dst3->transparent = dst2->transparent; - } - - if (dSinE >= 0.0) { - dOffset = (double)(src->sx - 1) * dSinE * -dTan; - } else { - dOffset = dTan * ((double)(src->sx - 1) * -dSinE + (double)(1 - newy)); - } - - for (u = 0; u < dst3->sy; u++, dOffset += dTan) { - int iShear = (int)floor(dOffset); - gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack, ignoretransparent); - } - - gdImageDestroy(dst2); - - return dst3; -} - -gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent) -{ - gdImagePtr pMidImg; - gdImagePtr rotatedImg; - - if (src == NULL) { - return NULL; - } - - if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) { - return NULL; - } - - while (dAngle >= 360.0) { - dAngle -= 360.0; - } - - while (dAngle < 0) { - dAngle += 360.0; - } - - if (dAngle == 90.00) { - return gdImageRotate90(src, ignoretransparent); - } - if (dAngle == 180.00) { - return gdImageRotate180(src, ignoretransparent); - } - if(dAngle == 270.00) { - return gdImageRotate270 (src, ignoretransparent); - } - - if ((dAngle > 45.0) && (dAngle <= 135.0)) { - pMidImg = gdImageRotate90 (src, ignoretransparent); - dAngle -= 90.0; - } else if ((dAngle > 135.0) && (dAngle <= 225.0)) { - pMidImg = gdImageRotate180 (src, ignoretransparent); - dAngle -= 180.0; - } else if ((dAngle > 225.0) && (dAngle <= 315.0)) { - pMidImg = gdImageRotate270 (src, ignoretransparent); - dAngle -= 270.0; - } else { - return gdImageRotate45 (src, dAngle, clrBack, ignoretransparent); - } - - if (pMidImg == NULL) { - return NULL; - } - - rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack, ignoretransparent); - gdImageDestroy(pMidImg); - - return rotatedImg; -} -/* End Rotate function */ - -void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c) -{ - int i; - int lx, ly; - typedef void (*image_line)(gdImagePtr im, int x1, int y1, int x2, int y2, int color); - image_line draw_line; - - if (!n) { - return; - } - - /* Let it be known that we are drawing a polygon so that the opacity - * mask doesn't get cleared after each line. - */ - if (c == gdAntiAliased) { - im->AA_polygon = 1; - } - - if ( im->antialias) { - draw_line = gdImageAALine; - } else { - draw_line = gdImageLine; - } - lx = p->x; - ly = p->y; - draw_line(im, lx, ly, p[n - 1].x, p[n - 1].y, c); - for (i = 1; i < n; i++) { - p++; - draw_line(im, lx, ly, p->x, p->y, c); - lx = p->x; - ly = p->y; - } - - if (c == gdAntiAliased) { - im->AA_polygon = 0; - gdImageAABlend(im); - } -} - -int gdCompareInt (const void *a, const void *b); - -/* THANKS to Kirsten Schulz for the polygon fixes! */ - -/* The intersection finding technique of this code could be improved - * by remembering the previous intertersection, and by using the slope. - * That could help to adjust intersections to produce a nice - * interior_extrema. - */ - -void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c) -{ - int i; - int y; - int miny, maxy; - int x1, y1; - int x2, y2; - int ind1, ind2; - int ints; - int fill_color; - - if (!n) { - return; - } - - if (c == gdAntiAliased) { - fill_color = im->AA_color; - } else { - fill_color = c; - } - - if (!im->polyAllocated) { - im->polyInts = (int *) gdMalloc(sizeof(int) * n); - im->polyAllocated = n; - } - if (im->polyAllocated < n) { - while (im->polyAllocated < n) { - im->polyAllocated *= 2; - } - im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated); - } - miny = p[0].y; - maxy = p[0].y; - for (i = 1; i < n; i++) { - if (p[i].y < miny) { - miny = p[i].y; - } - if (p[i].y > maxy) { - maxy = p[i].y; - } - } - - /* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */ - if (miny < 0) { - miny = 0; - } - if (maxy >= gdImageSY(im)) { - maxy = gdImageSY(im) - 1; - } - - /* Fix in 1.3: count a vertex only once */ - for (y = miny; y <= maxy; y++) { - /*1.4 int interLast = 0; */ - /* int dirLast = 0; */ - /* int interFirst = 1; */ - ints = 0; - for (i = 0; i < n; i++) { - if (!i) { - ind1 = n - 1; - ind2 = 0; - } else { - ind1 = i - 1; - ind2 = i; - } - y1 = p[ind1].y; - y2 = p[ind2].y; - if (y1 < y2) { - x1 = p[ind1].x; - x2 = p[ind2].x; - } else if (y1 > y2) { - y2 = p[ind1].y; - y1 = p[ind2].y; - x2 = p[ind1].x; - x1 = p[ind2].x; - } else { - continue; - } - /* Do the following math as float intermediately, and round to ensure - * that Polygon and FilledPolygon for the same set of points have the - * same footprint. - */ - if (y >= y1 && y < y2) { - im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; - } else if (y == maxy && y > y1 && y <= y2) { - im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; - } - } - qsort(im->polyInts, ints, sizeof(int), gdCompareInt); - - for (i = 0; i < ints; i += 2) { - gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color); - } - } - - /* If we are drawing this AA, then redraw the border with AA lines. */ - if (c == gdAntiAliased) { - gdImagePolygon(im, p, n, c); - } -} - -int gdCompareInt (const void *a, const void *b) -{ - return (*(const int *) a) - (*(const int *) b); -} - -void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) -{ - if (im->style) { - gdFree(im->style); - } - im->style = (int *) gdMalloc(sizeof(int) * noOfPixels); - memcpy(im->style, style, sizeof(int) * noOfPixels); - im->styleLength = noOfPixels; - im->stylePos = 0; -} - -void gdImageSetThickness (gdImagePtr im, int thickness) -{ - im->thick = thickness; -} - -void gdImageSetBrush (gdImagePtr im, gdImagePtr brush) -{ - int i; - im->brush = brush; - if (!im->trueColor && !im->brush->trueColor) { - for (i = 0; i < gdImageColorsTotal(brush); i++) { - int index; - index = gdImageColorResolveAlpha(im, gdImageRed(brush, i), gdImageGreen(brush, i), gdImageBlue(brush, i), gdImageAlpha(brush, i)); - im->brushColorMap[i] = index; - } - } -} - -void gdImageSetTile (gdImagePtr im, gdImagePtr tile) -{ - int i; - im->tile = tile; - if (!im->trueColor && !im->tile->trueColor) { - for (i = 0; i < gdImageColorsTotal(tile); i++) { - int index; - index = gdImageColorResolveAlpha(im, gdImageRed(tile, i), gdImageGreen(tile, i), gdImageBlue(tile, i), gdImageAlpha(tile, i)); - im->tileColorMap[i] = index; - } - } -} - -void gdImageSetAntiAliased (gdImagePtr im, int c) -{ - im->AA = 1; - im->AA_color = c; - im->AA_dont_blend = -1; -} - -void gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend) -{ - im->AA = 1; - im->AA_color = c; - im->AA_dont_blend = dont_blend; -} - - -void gdImageInterlace (gdImagePtr im, int interlaceArg) -{ - im->interlace = interlaceArg; -} - -int gdImageCompare (gdImagePtr im1, gdImagePtr im2) -{ - int x, y; - int p1, p2; - int cmpStatus = 0; - int sx, sy; - - if (im1->interlace != im2->interlace) { - cmpStatus |= GD_CMP_INTERLACE; - } - - if (im1->transparent != im2->transparent) { - cmpStatus |= GD_CMP_TRANSPARENT; - } - - if (im1->trueColor != im2->trueColor) { - cmpStatus |= GD_CMP_TRUECOLOR; - } - - sx = im1->sx; - if (im1->sx != im2->sx) { - cmpStatus |= GD_CMP_SIZE_X + GD_CMP_IMAGE; - if (im2->sx < im1->sx) { - sx = im2->sx; - } - } - - sy = im1->sy; - if (im1->sy != im2->sy) { - cmpStatus |= GD_CMP_SIZE_Y + GD_CMP_IMAGE; - if (im2->sy < im1->sy) { - sy = im2->sy; - } - } - - if (im1->colorsTotal != im2->colorsTotal) { - cmpStatus |= GD_CMP_NUM_COLORS; - } - - for (y = 0; y < sy; y++) { - for (x = 0; x < sx; x++) { - p1 = im1->trueColor ? gdImageTrueColorPixel(im1, x, y) : gdImagePalettePixel(im1, x, y); - p2 = im2->trueColor ? gdImageTrueColorPixel(im2, x, y) : gdImagePalettePixel(im2, x, y); - - if (gdImageRed(im1, p1) != gdImageRed(im2, p2)) { - cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; - break; - } - if (gdImageGreen(im1, p1) != gdImageGreen(im2, p2)) { - cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; - break; - } - if (gdImageBlue(im1, p1) != gdImageBlue(im2, p2)) { - cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; - break; - } -#if 0 - /* Soon we'll add alpha channel to palettes */ - if (gdImageAlpha(im1, p1) != gdImageAlpha(im2, p2)) { - cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; - break; - } -#endif - } - if (cmpStatus & GD_CMP_COLOR) { - break; - } - } - - return cmpStatus; -} - -int -gdAlphaBlend (int dst, int src) -{ - /* 2.0.12: TBB: alpha in the destination should be a - * component of the result. Thanks to Frank Warmerdam for - * pointing out the issue. - */ - return ((((gdTrueColorGetAlpha (src) * - gdTrueColorGetAlpha (dst)) / gdAlphaMax) << 24) + - ((((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * - gdTrueColorGetRed (src) / gdAlphaMax) + - (gdTrueColorGetAlpha (src) * - gdTrueColorGetRed (dst)) / gdAlphaMax) << 16) + - ((((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * - gdTrueColorGetGreen (src) / gdAlphaMax) + - (gdTrueColorGetAlpha (src) * - gdTrueColorGetGreen (dst)) / gdAlphaMax) << 8) + - (((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * - gdTrueColorGetBlue (src) / gdAlphaMax) + - (gdTrueColorGetAlpha (src) * - gdTrueColorGetBlue (dst)) / gdAlphaMax)); -} - -void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) -{ - im->alphaBlendingFlag = alphaBlendingArg; -} - -void gdImageAntialias (gdImagePtr im, int antialias) -{ - if (im->trueColor){ - im->antialias = antialias; - } -} - -void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg) -{ - im->saveAlphaFlag = saveAlphaArg; -} - -static int gdLayerOverlay (int dst, int src) -{ - int a1, a2; - a1 = gdAlphaMax - gdTrueColorGetAlpha(dst); - a2 = gdAlphaMax - gdTrueColorGetAlpha(src); - return ( ((gdAlphaMax - a1*a2/gdAlphaMax) << 24) + - (gdAlphaOverlayColor( gdTrueColorGetRed(src), gdTrueColorGetRed(dst), gdRedMax ) << 16) + - (gdAlphaOverlayColor( gdTrueColorGetGreen(src), gdTrueColorGetGreen(dst), gdGreenMax ) << 8) + - (gdAlphaOverlayColor( gdTrueColorGetBlue(src), gdTrueColorGetBlue(dst), gdBlueMax )) - ); -} - -static int gdAlphaOverlayColor (int src, int dst, int max ) -{ - /* this function implements the algorithm - * - * for dst[rgb] < 0.5, - * c[rgb] = 2.src[rgb].dst[rgb] - * and for dst[rgb] > 0.5, - * c[rgb] = -2.src[rgb].dst[rgb] + 2.dst[rgb] + 2.src[rgb] - 1 - * - */ - - dst = dst << 1; - if( dst > max ) { - /* in the "light" zone */ - return dst + (src << 1) - (dst * src / max) - max; - } else { - /* in the "dark" zone */ - return dst * src / max; - } -} - -void gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2) -{ - if (x1 < 0) { - x1 = 0; - } - if (x1 >= im->sx) { - x1 = im->sx - 1; - } - if (x2 < 0) { - x2 = 0; - } - if (x2 >= im->sx) { - x2 = im->sx - 1; - } - if (y1 < 0) { - y1 = 0; - } - if (y1 >= im->sy) { - y1 = im->sy - 1; - } - if (y2 < 0) { - y2 = 0; - } - if (y2 >= im->sy) { - y2 = im->sy - 1; - } - im->cx1 = x1; - im->cy1 = y1; - im->cx2 = x2; - im->cy2 = y2; -} - -void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) -{ - *x1P = im->cx1; - *y1P = im->cy1; - *x2P = im->cx2; - *y2P = im->cy2; -} - - -/* Filters function added on 2003/12 - * by Pierre-Alain Joye (pajoye@pearfr.org) - **/ -/* Begin filters function */ -#ifndef HAVE_GET_TRUE_COLOR -#define GET_PIXEL_FUNCTION(src)(src->trueColor?gdImageGetTrueColorPixel:gdImageGetPixel) -#endif - -/* invert src image */ -int gdImageNegate(gdImagePtr src) -{ - int x, y; - int r,g,b,a; - int new_pxl, pxl; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src==NULL) { - return 0; - } - - f = GET_PIXEL_FUNCTION(src); - - for (y=0; ysy; ++y) { - for (x=0; xsx; ++x) { - pxl = f (src, x, y); - r = gdImageRed(src, pxl); - g = gdImageGreen(src, pxl); - b = gdImageBlue(src, pxl); - a = gdImageAlpha(src, pxl); - - new_pxl = gdImageColorAllocateAlpha(src, 255-r, 255-g, 255-b, a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, 255-r, 255-g, 255-b, a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - return 1; -} - -/* Convert the image src to a grayscale image */ -int gdImageGrayScale(gdImagePtr src) -{ - int x, y; - int r,g,b,a; - int new_pxl, pxl; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - f = GET_PIXEL_FUNCTION(src); - - if (src==NULL) { - return 0; - } - - for (y=0; ysy; ++y) { - for (x=0; xsx; ++x) { - pxl = f (src, x, y); - r = gdImageRed(src, pxl); - g = gdImageGreen(src, pxl); - b = gdImageBlue(src, pxl); - a = gdImageAlpha(src, pxl); - r = g = b = (int) (.299 * r + .587 * g + .114 * b); - - new_pxl = gdImageColorAllocateAlpha(src, r, g, b, a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, r, g, b, a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - return 1; -} - -/* Set the brightness level for the image src */ -int gdImageBrightness(gdImagePtr src, int brightness) -{ - int x, y; - int r,g,b,a; - int new_pxl, pxl; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - f = GET_PIXEL_FUNCTION(src); - - if (src==NULL || (brightness < -255 || brightness>255)) { - return 0; - } - - if (brightness==0) { - return 1; - } - - for (y=0; ysy; ++y) { - for (x=0; xsx; ++x) { - pxl = f (src, x, y); - - r = gdImageRed(src, pxl); - g = gdImageGreen(src, pxl); - b = gdImageBlue(src, pxl); - a = gdImageAlpha(src, pxl); - - r = r + brightness; - g = g + brightness; - b = b + brightness; - - r = (r > 255)? 255 : ((r < 0)? 0:r); - g = (g > 255)? 255 : ((g < 0)? 0:g); - b = (b > 255)? 255 : ((b < 0)? 0:b); - - new_pxl = gdImageColorAllocateAlpha(src, (int)r, (int)g, (int)b, a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, (int)r, (int)g, (int)b, a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - return 1; -} - - -int gdImageContrast(gdImagePtr src, double contrast) -{ - int x, y; - int r,g,b,a; - double rf,gf,bf; - int new_pxl, pxl; - typedef int (*FuncPtr)(gdImagePtr, int, int); - - FuncPtr f; - f = GET_PIXEL_FUNCTION(src); - - if (src==NULL) { - return 0; - } - - contrast = (double)(100.0-contrast)/100.0; - contrast = contrast*contrast; - - for (y=0; ysy; ++y) { - for (x=0; xsx; ++x) { - pxl = f(src, x, y); - - r = gdImageRed(src, pxl); - g = gdImageGreen(src, pxl); - b = gdImageBlue(src, pxl); - a = gdImageAlpha(src, pxl); - - rf = (double)r/255.0; - rf = rf-0.5; - rf = rf*contrast; - rf = rf+0.5; - rf = rf*255.0; - - bf = (double)b/255.0; - bf = bf-0.5; - bf = bf*contrast; - bf = bf+0.5; - bf = bf*255.0; - - gf = (double)g/255.0; - gf = gf-0.5; - gf = gf*contrast; - gf = gf+0.5; - gf = gf*255.0; - - rf = (rf > 255.0)? 255.0 : ((rf < 0.0)? 0.0:rf); - gf = (gf > 255.0)? 255.0 : ((gf < 0.0)? 0.0:gf); - bf = (bf > 255.0)? 255.0 : ((bf < 0.0)? 0.0:bf); - - new_pxl = gdImageColorAllocateAlpha(src, (int)rf, (int)gf, (int)bf, a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, (int)rf, (int)gf, (int)bf, a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - return 1; -} - - -int gdImageColor(gdImagePtr src, int red, int green, int blue) -{ - int x, y; - int r,g,b,a; - int new_pxl, pxl; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src==NULL || (red<-255||red>255) || (green<-255||green>255) || (blue<-255||blue>255)) { - return 0; - } - - f = GET_PIXEL_FUNCTION(src); - - for (y=0; ysy; ++y) { - for (x=0; xsx; ++x) { - pxl = f(src, x, y); - r = gdImageRed(src, pxl); - g = gdImageGreen(src, pxl); - b = gdImageBlue(src, pxl); - a = gdImageAlpha(src, pxl); - - r = r + red; - g = g + green; - b = b + blue; - - r = (r > 255)? 255 : ((r < 0)? 0:r); - g = (g > 255)? 255 : ((g < 0)? 0:g); - b = (b > 255)? 255 : ((b < 0)? 0:b); - - new_pxl = gdImageColorAllocateAlpha(src, (int)r, (int)g, (int)b, a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, (int)r, (int)g, (int)b, a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - return 1; -} - -int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, float offset) -{ - int x, y, i, j, new_a; - float new_r, new_g, new_b; - int new_pxl, pxl=0; - gdImagePtr srcback; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src==NULL) { - return 0; - } - - /* We need the orinal image with each safe neoghb. pixel */ - srcback = gdImageCreateTrueColor (src->sx, src->sy); - gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); - - if (srcback==NULL) { - return 0; - } - - f = GET_PIXEL_FUNCTION(src); - - for ( y=0; ysy; y++) { - for(x=0; xsx; x++) { - new_r = new_g = new_b = 0; - new_a = gdImageAlpha(srcback, pxl); - - for (j=0; j<3; j++) { - int yv = MIN(MAX(y - 1 + j, 0), src->sy - 1); - for (i=0; i<3; i++) { - pxl = f(srcback, MIN(MAX(x - 1 + i, 0), src->sx - 1), yv); - new_r += (float)gdImageRed(srcback, pxl) * filter[j][i]; - new_g += (float)gdImageGreen(srcback, pxl) * filter[j][i]; - new_b += (float)gdImageBlue(srcback, pxl) * filter[j][i]; - } - } - - new_r = (new_r/filter_div)+offset; - new_g = (new_g/filter_div)+offset; - new_b = (new_b/filter_div)+offset; - - new_r = (new_r > 255.0f)? 255.0f : ((new_r < 0.0f)? 0.0f:new_r); - new_g = (new_g > 255.0f)? 255.0f : ((new_g < 0.0f)? 0.0f:new_g); - new_b = (new_b > 255.0f)? 255.0f : ((new_b < 0.0f)? 0.0f:new_b); - - new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - gdImageDestroy(srcback); - return 1; -} - -int gdImageSelectiveBlur( gdImagePtr src) -{ - int x, y, i, j; - float new_r, new_g, new_b; - int new_pxl, cpxl, pxl, new_a=0; - float flt_r [3][3]; - float flt_g [3][3]; - float flt_b [3][3]; - float flt_r_sum, flt_g_sum, flt_b_sum; - - gdImagePtr srcback; - typedef int (*FuncPtr)(gdImagePtr, int, int); - FuncPtr f; - - if (src==NULL) { - return 0; - } - - /* We need the orinal image with each safe neoghb. pixel */ - srcback = gdImageCreateTrueColor (src->sx, src->sy); - gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); - - if (srcback==NULL) { - return 0; - } - - f = GET_PIXEL_FUNCTION(src); - - for(y = 0; ysy; y++) { - for (x=0; xsx; x++) { - flt_r_sum = flt_g_sum = flt_b_sum = 0.0; - cpxl = f(src, x, y); - - for (j=0; j<3; j++) { - for (i=0; i<3; i++) { - if ((j == 1) && (i == 1)) { - flt_r[1][1] = flt_g[1][1] = flt_b[1][1] = 0.5; - } else { - pxl = f(src, x-(3>>1)+i, y-(3>>1)+j); - new_a = gdImageAlpha(srcback, pxl); - - new_r = ((float)gdImageRed(srcback, cpxl)) - ((float)gdImageRed (srcback, pxl)); - - if (new_r < 0.0f) { - new_r = -new_r; - } - if (new_r != 0) { - flt_r[j][i] = 1.0f/new_r; - } else { - flt_r[j][i] = 1.0f; - } - - new_g = ((float)gdImageGreen(srcback, cpxl)) - ((float)gdImageGreen(srcback, pxl)); - - if (new_g < 0.0f) { - new_g = -new_g; - } - if (new_g != 0) { - flt_g[j][i] = 1.0f/new_g; - } else { - flt_g[j][i] = 1.0f; - } - - new_b = ((float)gdImageBlue(srcback, cpxl)) - ((float)gdImageBlue(srcback, pxl)); - - if (new_b < 0.0f) { - new_b = -new_b; - } - if (new_b != 0) { - flt_b[j][i] = 1.0f/new_b; - } else { - flt_b[j][i] = 1.0f; - } - } - - flt_r_sum += flt_r[j][i]; - flt_g_sum += flt_g[j][i]; - flt_b_sum += flt_b [j][i]; - } - } - - for (j=0; j<3; j++) { - for (i=0; i<3; i++) { - if (flt_r_sum != 0.0) { - flt_r[j][i] /= flt_r_sum; - } - if (flt_g_sum != 0.0) { - flt_g[j][i] /= flt_g_sum; - } - if (flt_b_sum != 0.0) { - flt_b [j][i] /= flt_b_sum; - } - } - } - - new_r = new_g = new_b = 0.0; - - for (j=0; j<3; j++) { - for (i=0; i<3; i++) { - pxl = f(src, x-(3>>1)+i, y-(3>>1)+j); - new_r += (float)gdImageRed(srcback, pxl) * flt_r[j][i]; - new_g += (float)gdImageGreen(srcback, pxl) * flt_g[j][i]; - new_b += (float)gdImageBlue(srcback, pxl) * flt_b[j][i]; - } - } - - new_r = (new_r > 255.0f)? 255.0f : ((new_r < 0.0f)? 0.0f:new_r); - new_g = (new_g > 255.0f)? 255.0f : ((new_g < 0.0f)? 0.0f:new_g); - new_b = (new_b > 255.0f)? 255.0f : ((new_b < 0.0f)? 0.0f:new_b); - new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); - if (new_pxl == -1) { - new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); - } - if ((y >= 0) && (y < src->sy)) { - gdImageSetPixel (src, x, y, new_pxl); - } - } - } - gdImageDestroy(srcback); - return 1; -} - -int gdImageEdgeDetectQuick(gdImagePtr src) -{ - float filter[3][3] = {{-1.0,0.0,-1.0}, - {0.0,4.0,0.0}, - {-1.0,0.0,-1.0}}; - - return gdImageConvolution(src, filter, 1, 127); -} - -int gdImageGaussianBlur(gdImagePtr im) -{ - float filter[3][3] = {{1.0,2.0,1.0}, - {2.0,4.0,2.0}, - {1.0,2.0,1.0}}; - - return gdImageConvolution(im, filter, 16, 0); -} - -int gdImageEmboss(gdImagePtr im) -{ -/* - float filter[3][3] = {{1.0,1.0,1.0}, - {0.0,0.0,0.0}, - {-1.0,-1.0,-1.0}}; -*/ - float filter[3][3] = {{ 1.5, 0.0, 0.0}, - { 0.0, 0.0, 0.0}, - { 0.0, 0.0,-1.5}}; - - return gdImageConvolution(im, filter, 1, 127); -} - -int gdImageMeanRemoval(gdImagePtr im) -{ - float filter[3][3] = {{-1.0,-1.0,-1.0}, - {-1.0,9.0,-1.0}, - {-1.0,-1.0,-1.0}}; - - return gdImageConvolution(im, filter, 1, 0); -} - -int gdImageSmooth(gdImagePtr im, float weight) -{ - float filter[3][3] = {{1.0,1.0,1.0}, - {1.0,0.0,1.0}, - {1.0,1.0,1.0}}; - - filter[1][1] = weight; - - return gdImageConvolution(im, filter, weight+8, 0); -} -/* End filters function */ diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h deleted file mode 100644 index 7cd6785c6ce6d..0000000000000 --- a/ext/gd/libgd/gd.h +++ /dev/null @@ -1,664 +0,0 @@ -#ifndef GD_H -#define GD_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include "php_compat.h" - -#ifndef WIN32 -/* default fontpath for unix systems */ -#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:." -#define PATHSEPARATOR ":" -#else -/* default fontpath for windows systems */ -#define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;." -#define PATHSEPARATOR ";" -#endif - -/* gd.h: declarations file for the graphic-draw module. - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation. This software is provided "AS IS." Thomas Boutell and - * Boutell.Com, Inc. disclaim all warranties, either express or implied, - * including but not limited to implied warranties of merchantability and - * fitness for a particular purpose, with respect to this code and accompanying - * documentation. */ - -/* stdio is needed for file I/O. */ -#include -#include "gd_io.h" - -void php_gd_error_ex(int type, const char *format, ...); - -void php_gd_error(const char *format, ...); - - -/* The maximum number of palette entries in palette-based images. - In the wonderful new world of gd 2.0, you can of course have - many more colors when using truecolor mode. */ - -#define gdMaxColors 256 - -/* Image type. See functions below; you will not need to change - the elements directly. Use the provided macros to - access sx, sy, the color table, and colorsTotal for - read-only purposes. */ - -/* If 'truecolor' is set true, the image is truecolor; - pixels are represented by integers, which - must be 32 bits wide or more. - - True colors are repsented as follows: - - ARGB - - Where 'A' (alpha channel) occupies only the - LOWER 7 BITS of the MSB. This very small - loss of alpha channel resolution allows gd 2.x - to keep backwards compatibility by allowing - signed integers to be used to represent colors, - and negative numbers to represent special cases, - just as in gd 1.x. */ - -#define gdAlphaMax 127 -#define gdAlphaOpaque 0 -#define gdAlphaTransparent 127 -#define gdRedMax 255 -#define gdGreenMax 255 -#define gdBlueMax 255 -#define gdTrueColorGetAlpha(c) (((c) & 0x7F000000) >> 24) -#define gdTrueColorGetRed(c) (((c) & 0xFF0000) >> 16) -#define gdTrueColorGetGreen(c) (((c) & 0x00FF00) >> 8) -#define gdTrueColorGetBlue(c) ((c) & 0x0000FF) -#define gdEffectReplace 0 -#define gdEffectAlphaBlend 1 -#define gdEffectNormal 2 -#define gdEffectOverlay 3 - - -/* This function accepts truecolor pixel values only. The - source color is composited with the destination color - based on the alpha channel value of the source color. - The resulting color is opaque. */ - -int gdAlphaBlend(int dest, int src); - -typedef struct gdImageStruct { - /* Palette-based image pixels */ - unsigned char ** pixels; - int sx; - int sy; - /* These are valid in palette images only. See also - 'alpha', which appears later in the structure to - preserve binary backwards compatibility */ - int colorsTotal; - int red[gdMaxColors]; - int green[gdMaxColors]; - int blue[gdMaxColors]; - int open[gdMaxColors]; - /* For backwards compatibility, this is set to the - first palette entry with 100% transparency, - and is also set and reset by the - gdImageColorTransparent function. Newer - applications can allocate palette entries - with any desired level of transparency; however, - bear in mind that many viewers, notably - many web browsers, fail to implement - full alpha channel for PNG and provide - support for full opacity or transparency only. */ - int transparent; - int *polyInts; - int polyAllocated; - struct gdImageStruct *brush; - struct gdImageStruct *tile; - int brushColorMap[gdMaxColors]; - int tileColorMap[gdMaxColors]; - int styleLength; - int stylePos; - int *style; - int interlace; - /* New in 2.0: thickness of line. Initialized to 1. */ - int thick; - /* New in 2.0: alpha channel for palettes. Note that only - Macintosh Internet Explorer and (possibly) Netscape 6 - really support multiple levels of transparency in - palettes, to my knowledge, as of 2/15/01. Most - common browsers will display 100% opaque and - 100% transparent correctly, and do something - unpredictable and/or undesirable for levels - in between. TBB */ - int alpha[gdMaxColors]; - /* Truecolor flag and pixels. New 2.0 fields appear here at the - end to minimize breakage of existing object code. */ - int trueColor; - int ** tpixels; - /* Should alpha channel be copied, or applied, each time a - pixel is drawn? This applies to truecolor images only. - No attempt is made to alpha-blend in palette images, - even if semitransparent palette entries exist. - To do that, build your image as a truecolor image, - then quantize down to 8 bits. */ - int alphaBlendingFlag; - /* Should antialias functions be used */ - int antialias; - /* Should the alpha channel of the image be saved? This affects - PNG at the moment; other future formats may also - have that capability. JPEG doesn't. */ - int saveAlphaFlag; - - - /* 2.0.12: anti-aliased globals */ - int AA; - int AA_color; - int AA_dont_blend; - unsigned char **AA_opacity; - int AA_polygon; - /* Stored and pre-computed variables for determining the perpendicular - * distance from a point to the anti-aliased line being drawn: - */ - int AAL_x1; - int AAL_y1; - int AAL_x2; - int AAL_y2; - int AAL_Bx_Ax; - int AAL_By_Ay; - int AAL_LAB_2; - float AAL_LAB; - - /* 2.0.12: simple clipping rectangle. These values must be checked for safety when set; please use gdImageSetClip */ - int cx1; - int cy1; - int cx2; - int cy2; -} gdImage; - -typedef gdImage * gdImagePtr; - -typedef struct { - /* # of characters in font */ - int nchars; - /* First character is numbered... (usually 32 = space) */ - int offset; - /* Character width and height */ - int w; - int h; - /* Font data; array of characters, one row after another. - Easily included in code, also easily loaded from - data files. */ - char *data; -} gdFont; - -/* Text functions take these. */ -typedef gdFont *gdFontPtr; - -/* For backwards compatibility only. Use gdImageSetStyle() - for MUCH more flexible line drawing. Also see - gdImageSetBrush(). */ -#define gdDashSize 4 - -/* Special colors. */ - -#define gdStyled (-2) -#define gdBrushed (-3) -#define gdStyledBrushed (-4) -#define gdTiled (-5) - -/* NOT the same as the transparent color index. - This is used in line styles only. */ -#define gdTransparent (-6) - -#define gdAntiAliased (-7) - -/* Functions to manipulate images. */ - -/* Creates a palette-based image (up to 256 colors). */ -gdImagePtr gdImageCreate(int sx, int sy); - -/* An alternate name for the above (2.0). */ -#define gdImageCreatePalette gdImageCreate - -/* Creates a truecolor image (millions of colors). */ -gdImagePtr gdImageCreateTrueColor(int sx, int sy); - -/* Creates an image from various file types. These functions - return a palette or truecolor image based on the - nature of the file being loaded. Truecolor PNG - stays truecolor; palette PNG stays palette-based; - JPEG is always truecolor. */ -gdImagePtr gdImageCreateFromPng(FILE *fd); -gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in); -gdImagePtr gdImageCreateFromWBMP(FILE *inFile); -gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile); -gdImagePtr gdImageCreateFromJpeg(FILE *infile); -gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile); - -/* A custom data source. */ -/* The source function must return -1 on error, otherwise the number - of bytes fetched. 0 is EOF, not an error! */ -/* context will be passed to your source function. */ - -typedef struct { - int (*source) (void *context, char *buffer, int len); - void *context; -} gdSource, *gdSourcePtr; - -gdImagePtr gdImageCreateFromPngSource(gdSourcePtr in); - -gdImagePtr gdImageCreateFromGd(FILE *in); -gdImagePtr gdImageCreateFromGdCtx(gdIOCtxPtr in); - -gdImagePtr gdImageCreateFromGd2(FILE *in); -gdImagePtr gdImageCreateFromGd2Ctx(gdIOCtxPtr in); - -gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h); -gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h); - -gdImagePtr gdImageCreateFromXbm(FILE *fd); -void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out); - -gdImagePtr gdImageCreateFromXpm (char *filename); - -void gdImageDestroy(gdImagePtr im); - -/* Replaces or blends with the background depending on the - most recent call to gdImageAlphaBlending and the - alpha channel value of 'color'; default is to overwrite. - Tiling and line styling are also implemented - here. All other gd drawing functions pass through this call, - allowing for many useful effects. */ - -void gdImageSetPixel(gdImagePtr im, int x, int y, int color); - -int gdImageGetPixel(gdImagePtr im, int x, int y); - -void gdImageAABlend(gdImagePtr im); - -void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); -void gdImageAALine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); - -/* For backwards compatibility only. Use gdImageSetStyle() - for much more flexible line drawing. */ -void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); -/* Corners specified (not width and height). Upper left first, lower right - second. */ -void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); -/* Solid bar. Upper left corner first, lower right corner second. */ -void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); -void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2); -void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P); -void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); -void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); -void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); -void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); -void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); -void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); - -/* 2.0.16: for thread-safe use of gdImageStringFT and friends, - * call this before allowing any thread to call gdImageStringFT. - * Otherwise it is invoked by the first thread to invoke - * gdImageStringFT, with a very small but real risk of a race condition. - * Return 0 on success, nonzero on failure to initialize freetype. - */ -int gdFontCacheSetup(void); - -/* Optional: clean up after application is done using fonts in gdImageStringFT(). */ -void gdFontCacheShutdown(void); - -/* Calls gdImageStringFT. Provided for backwards compatibility only. */ -char *gdImageStringTTF(gdImage *im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string); - -/* FreeType 2 text output */ -char *gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string); - -typedef struct { - double linespacing; /* fine tune line spacing for '\n' */ - int flags; /* Logical OR of gdFTEX_ values */ - int charmap; /* TBB: 2.0.12: may be gdFTEX_Unicode, - gdFTEX_Shift_JIS, or gdFTEX_Big5; - when not specified, maps are searched - for in the above order. */ - int hdpi; - int vdpi; -} - gdFTStringExtra, *gdFTStringExtraPtr; - -#define gdFTEX_LINESPACE 1 -#define gdFTEX_CHARMAP 2 -#define gdFTEX_RESOLUTION 4 - -/* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */ -#define gdFTEX_Unicode 0 -#define gdFTEX_Shift_JIS 1 -#define gdFTEX_Big5 2 - -/* FreeType 2 text output with fine tuning */ -char * -gdImageStringFTEx(gdImage * im, int *brect, int fg, char * fontlist, - double ptsize, double angle, int x, int y, char * string, - gdFTStringExtraPtr strex); - - -/* Point type for use in polygon drawing. */ -typedef struct { - int x, y; -} gdPoint, *gdPointPtr; - -void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c); -void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c); - -/* These functions still work with truecolor images, - for which they never return error. */ -int gdImageColorAllocate(gdImagePtr im, int r, int g, int b); -/* gd 2.0: palette entries with non-opaque transparency are permitted. */ -int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a); -/* Assumes opaque is the preferred alpha channel value */ -int gdImageColorClosest(gdImagePtr im, int r, int g, int b); -/* Closest match taking all four parameters into account. - A slightly different color with the same transparency - beats the exact same color with radically different - transparency */ -int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a); -/* An alternate method */ -int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); -/* Returns exact, 100% opaque matches only */ -int gdImageColorExact(gdImagePtr im, int r, int g, int b); -/* Returns an exact match only, including alpha */ -int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a); -/* Opaque only */ -int gdImageColorResolve(gdImagePtr im, int r, int g, int b); -/* Based on gdImageColorExactAlpha and gdImageColorClosestAlpha */ -int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a); - -/* A simpler way to obtain an opaque truecolor value for drawing on a - truecolor image. Not for use with palette images! */ - -#define gdTrueColor(r, g, b) (((r) << 16) + \ - ((g) << 8) + \ - (b)) - -/* Returns a truecolor value with an alpha channel component. - gdAlphaMax (127, **NOT 255**) is transparent, 0 is completely - opaque. */ - -#define gdTrueColorAlpha(r, g, b, a) (((a) << 24) + \ - ((r) << 16) + \ - ((g) << 8) + \ - (b)) - -void gdImageColorDeallocate(gdImagePtr im, int color); - -/* Converts a truecolor image to a palette-based image, - using a high-quality two-pass quantization routine - which attempts to preserve alpha channel information - as well as R/G/B color information when creating - a palette. If ditherFlag is set, the image will be - dithered to approximate colors better, at the expense - of some obvious "speckling." colorsWanted can be - anything up to 256. If the original source image - includes photographic information or anything that - came out of a JPEG, 256 is strongly recommended. - - Better yet, don't use this function -- write real - truecolor PNGs and JPEGs. The disk space gain of - conversion to palette is not great (for small images - it can be negative) and the quality loss is ugly. */ - -gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted); - -void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted); - - -/* An attempt at getting the results of gdImageTrueColorToPalette - to look a bit more like the original (im1 is the original - and im2 is the palette version */ -int gdImageColorMatch(gdImagePtr im1, gdImagePtr im2); - -/* Specifies a color index (if a palette image) or an - RGB color (if a truecolor image) which should be - considered 100% transparent. FOR TRUECOLOR IMAGES, - THIS IS IGNORED IF AN ALPHA CHANNEL IS BEING - SAVED. Use gdImageSaveAlpha(im, 0); to - turn off the saving of a full alpha channel in - a truecolor image. Note that gdImageColorTransparent - is usually compatible with older browsers that - do not understand full alpha channels well. TBB */ -void gdImageColorTransparent(gdImagePtr im, int color); - -void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src); -void gdImagePng(gdImagePtr im, FILE *out); -void gdImagePngCtx(gdImagePtr im, gdIOCtx *out); -void gdImageGif(gdImagePtr im, FILE *out); -void gdImageGifCtx(gdImagePtr im, gdIOCtx *out); -/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all, - * 1 is FASTEST but produces larger files, 9 provides the best - * compression (smallest files) but takes a long time to compress, and - * -1 selects the default compiled into the zlib library. - */ -void gdImagePngEx(gdImagePtr im, FILE * out, int level); -void gdImagePngCtxEx(gdImagePtr im, gdIOCtx * out, int level); - -void gdImageWBMP(gdImagePtr image, int fg, FILE *out); -void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out); - -/* Guaranteed to correctly free memory returned - by the gdImage*Ptr functions */ -void gdFree(void *m); - -/* Best to free this memory with gdFree(), not free() */ -void *gdImageWBMPPtr(gdImagePtr im, int *size, int fg); - -/* 100 is highest quality (there is always a little loss with JPEG). - 0 is lowest. 10 is about the lowest useful setting. */ -void gdImageJpeg(gdImagePtr im, FILE *out, int quality); -void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality); - -/* Best to free this memory with gdFree(), not free() */ -void *gdImageJpegPtr(gdImagePtr im, int *size, int quality); - -gdImagePtr gdImageCreateFromGif(FILE *fd); -gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in); -gdImagePtr gdImageCreateFromGifSource(gdSourcePtr in); - -/* A custom data sink. For backwards compatibility. Use - gdIOCtx instead. */ -/* The sink function must return -1 on error, otherwise the number - of bytes written, which must be equal to len. */ -/* context will be passed to your sink function. */ -typedef struct { - int (*sink) (void *context, const char *buffer, int len); - void *context; -} gdSink, *gdSinkPtr; - -void gdImagePngToSink(gdImagePtr im, gdSinkPtr out); - -void gdImageGd(gdImagePtr im, FILE *out); -void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt); - -/* Best to free this memory with gdFree(), not free() */ -void* gdImagePngPtr(gdImagePtr im, int *size); - -/* Best to free this memory with gdFree(), not free() */ -void* gdImageGdPtr(gdImagePtr im, int *size); -void *gdImagePngPtrEx(gdImagePtr im, int *size, int level); - -/* Best to free this memory with gdFree(), not free() */ -void* gdImageGd2Ptr(gdImagePtr im, int cs, int fmt, int *size); - -void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c); - -/* Style is a bitwise OR ( | operator ) of these. - gdArc and gdChord are mutually exclusive; - gdChord just connects the starting and ending - angles with a straight line, while gdArc produces - a rounded edge. gdPie is a synonym for gdArc. - gdNoFill indicates that the arc or chord should be - outlined, not filled. gdEdged, used together with - gdNoFill, indicates that the beginning and ending - angles should be connected to the center; this is - a good way to outline (rather than fill) a - 'pie slice'. */ -#define gdArc 0 -#define gdPie gdArc -#define gdChord 1 -#define gdNoFill 2 -#define gdEdged 4 - -void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style); -void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color); -void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color); -void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color); -void gdImageFill(gdImagePtr im, int x, int y, int color); -void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h); -void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, - int srcX, int srcY, int w, int h, int pct); -void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, - int srcX, int srcY, int w, int h, int pct); - -/* Stretches or shrinks to fit, as needed. Does NOT attempt - to average the entire set of source pixels that scale down onto the - destination pixel. */ -void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); - -/* gd 2.0: stretches or shrinks to fit, as needed. When called with a - truecolor destination image, this function averages the - entire set of source pixels that scale down onto the - destination pixel, taking into account what portion of the - destination pixel each source pixel represents. This is a - floating point operation, but this is not a performance issue - on modern hardware, except for some embedded devices. If the - destination is a palette image, gdImageCopyResized is - substituted automatically. */ -void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); - -gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent); -gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent); -gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent); -gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack, int ignoretransparent); -gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent); - -void gdImageSetBrush(gdImagePtr im, gdImagePtr brush); -void gdImageSetTile(gdImagePtr im, gdImagePtr tile); -void gdImageSetAntiAliased(gdImagePtr im, int c); -void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend); -void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels); -/* Line thickness (defaults to 1). Affects lines, ellipses, - rectangles, polygons and so forth. */ -void gdImageSetThickness(gdImagePtr im, int thickness); -/* On or off (1 or 0) for all three of these. */ -void gdImageInterlace(gdImagePtr im, int interlaceArg); -void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg); -void gdImageAntialias(gdImagePtr im, int antialias); -void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg); - -/* Macros to access information about images. */ - -/* Returns nonzero if the image is a truecolor image, - zero for a palette image. */ - -#define gdImageTrueColor(im) ((im)->trueColor) - -#define gdImageSX(im) ((im)->sx) -#define gdImageSY(im) ((im)->sy) -#define gdImageColorsTotal(im) ((im)->colorsTotal) -#define gdImageRed(im, c) ((im)->trueColor ? gdTrueColorGetRed(c) : \ - (im)->red[(c)]) -#define gdImageGreen(im, c) ((im)->trueColor ? gdTrueColorGetGreen(c) : \ - (im)->green[(c)]) -#define gdImageBlue(im, c) ((im)->trueColor ? gdTrueColorGetBlue(c) : \ - (im)->blue[(c)]) -#define gdImageAlpha(im, c) ((im)->trueColor ? gdTrueColorGetAlpha(c) : \ - (im)->alpha[(c)]) -#define gdImageGetTransparent(im) ((im)->transparent) -#define gdImageGetInterlaced(im) ((im)->interlace) - -/* These macros provide direct access to pixels in - palette-based and truecolor images, respectively. - If you use these macros, you must perform your own - bounds checking. Use of the macro for the correct type - of image is also your responsibility. */ -#define gdImagePalettePixel(im, x, y) (im)->pixels[(y)][(x)] -#define gdImageTrueColorPixel(im, x, y) (im)->tpixels[(y)][(x)] - -/* I/O Support routines. */ - -gdIOCtx* gdNewFileCtx(FILE*); -gdIOCtx* gdNewDynamicCtx(int, void*); -gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag); -gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out); -void* gdDPExtractData(struct gdIOCtx* ctx, int *size); - -#define GD2_CHUNKSIZE 128 -#define GD2_CHUNKSIZE_MIN 64 -#define GD2_CHUNKSIZE_MAX 4096 - -#define GD2_VERS 2 -#define GD2_ID "gd2" -#define GD2_FMT_RAW 1 -#define GD2_FMT_COMPRESSED 2 - - -/* filters section - * - * Negate the imag src, white becomes black, - * The red, green, and blue intensities of an image are negated. - * White becomes black, yellow becomes blue, etc. - */ -int gdImageNegate(gdImagePtr src); - -/* Convert the image src to a grayscale image */ -int gdImageGrayScale(gdImagePtr src); - -/* Set the brightness level for the image src */ -int gdImageBrightness(gdImagePtr src, int brightness); - -/* Set the contrast level for the image */ -int gdImageContrast(gdImagePtr src, double contrast); - -/* Simply adds or substracts respectively red, green or blue to a pixel */ -int gdImageColor(gdImagePtr src, int red, int green, int blue); - -/* Image convolution by a 3x3 custom matrix */ -int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset); - -int gdImageEdgeDetectQuick(gdImagePtr src); - -int gdImageGaussianBlur(gdImagePtr im); - -int gdImageSelectiveBlur( gdImagePtr src); - -int gdImageEmboss(gdImagePtr im); - -int gdImageMeanRemoval(gdImagePtr im); - -int gdImageSmooth(gdImagePtr im, float weight); - -/* Image comparison definitions */ -int gdImageCompare(gdImagePtr im1, gdImagePtr im2); - -#define GD_CMP_IMAGE 1 /* Actual image IS different */ -#define GD_CMP_NUM_COLORS 2 /* Number of Colours in pallette differ */ -#define GD_CMP_COLOR 4 /* Image colours differ */ -#define GD_CMP_SIZE_X 8 /* Image width differs */ -#define GD_CMP_SIZE_Y 16 /* Image heights differ */ -#define GD_CMP_TRANSPARENT 32 /* Transparent colour */ -#define GD_CMP_BACKGROUND 64 /* Background colour */ -#define GD_CMP_INTERLACE 128 /* Interlaced setting */ -#define GD_CMP_TRUECOLOR 256 /* Truecolor vs palette differs */ - -/* resolution affects ttf font rendering, particularly hinting */ -#define GD_RESOLUTION 96 /* pixels per inch */ - -#ifdef __cplusplus -} -#endif - -/* 2.0.12: this now checks the clipping rectangle */ -#define gdImageBoundsSafe(im, x, y) (!((((y) < (im)->cy1) || ((y) > (im)->cy2)) || (((x) < (im)->cx1) || ((x) > (im)->cx2)))) - -#endif /* GD_H */ diff --git a/ext/gd/libgd/gd2copypal.c b/ext/gd/libgd/gd2copypal.c deleted file mode 100644 index ae9b559f17b2e..0000000000000 --- a/ext/gd/libgd/gd2copypal.c +++ /dev/null @@ -1,65 +0,0 @@ - -#include -#include "gd.h" -#include - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - gdImagePtr pal; - FILE *in, *out; - if (argc != 3) - { - fprintf (stderr, "Usage: gd2copypal palettefile.gd2 filename.gd2\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Palette file does not exist!\n"); - exit (1); - } - pal = gdImageCreateFromGd2 (in); - fclose (in); - if (!pal) - { - fprintf (stderr, "Palette is not in GD2 format!\n"); - exit (1); - } - - in = fopen (argv[2], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromGd2 (in); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in GD2 format!\n"); - exit (1); - } - - gdImagePaletteCopy (im, pal); - - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } - gdImageGd2 (im, out, 128, 2); - fclose (out); - gdImageDestroy (pal); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/gd2time.c b/ext/gd/libgd/gd2time.c deleted file mode 100644 index 18e6c0c9e4c2d..0000000000000 --- a/ext/gd/libgd/gd2time.c +++ /dev/null @@ -1,60 +0,0 @@ - -#include -#include /* for atoi */ -#include /* For time */ -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in; - int x, y, w, h; - int c; - int i; - int t0; - - if (argc != 7) - { - fprintf (stderr, "Usage: gd2time filename.gd count x y w h\n"); - exit (1); - } - - c = atoi (argv[2]); - x = atoi (argv[3]); - y = atoi (argv[4]); - w = atoi (argv[5]); - h = atoi (argv[6]); - - printf ("Extracting %d times from (%d, %d), size is %dx%d\n", c, x, y, w, h); - - t0 = time (0); - for (i = 0; i < c; i++) - { - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - - im = gdImageCreateFromGd2Part (in, x, y, w, h); - fclose (in); - - if (!im) - { - fprintf (stderr, "Error reading source file!\n"); - exit (1); - } - gdImageDestroy (im); - }; - t0 = time (0) - t0; - printf ("%d seconds to extract (& destroy) %d times\n", t0, c); - - return 0; -} diff --git a/ext/gd/libgd/gd2topng.c b/ext/gd/libgd/gd2topng.c deleted file mode 100644 index 6db5eb30037bd..0000000000000 --- a/ext/gd/libgd/gd2topng.c +++ /dev/null @@ -1,49 +0,0 @@ - -#include -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in, *out; - if (argc != 3) - { - fprintf (stderr, "Usage: gd2topng filename.gd2 filename.png\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromGd2 (in); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in GD2 format!\n"); - exit (1); - } - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } -#ifdef HAVE_LIBPNG - gdImagePng (im, out); -#else - fprintf(stderr, "No PNG library support available.\n"); -#endif - fclose (out); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/gd_arc_f_buggy.c b/ext/gd/libgd/gd_arc_f_buggy.c deleted file mode 100644 index c26e42171a735..0000000000000 --- a/ext/gd/libgd/gd_arc_f_buggy.c +++ /dev/null @@ -1,741 +0,0 @@ -/* This is potentially great stuff, but fails against the test - program at the end. This would probably be much more - efficent than the implementation currently in gd.c if the - errors in the output were corrected. TBB */ - -#if 0 - -#include "gd.h" -#include - -/* Courtesy of F J Franklin. */ - -static gdPoint gdArcClosest (int width, int height, int angle); - -void -gdImageFilledEllipse (gdImagePtr im, int cx, int cy, int width, int height, int color) -{ - gdImageFilledArc (im, cx, cy, width, height, 0, 360, color, gdChord); -} - -void -gdImageFilledArc (gdImagePtr im, int cx, int cy, int width, int height, int s, int e, int color, int style) -{ - gdPoint pt[7]; - gdPoint axis_pt[4]; - - int angle; - - int have_s = 0; - int have_e = 0; - - int flip_x = 0; - int flip_y = 0; - - int conquer = 0; - - int i; - - int a; - int b; - - int x; - int y; - - long s_sin = 0; - long s_cos = 0; - long e_sin = 0; - long e_cos = 0; - - long w; /* a * 2 */ - long h; /* b * 2 */ - - long x2; /* x * 2 */ - long y2; /* y * 2 */ - long lx2; /* x * 2 (line) */ - long ly2; /* y * 2 (line) */ - - long ws; /* (a * 2)^2 */ - long hs; /* (b * 2)^2 */ - - long whs; /* (a * 2)^2 * (b * 2)^2 */ - - long g; /* decision variable */ - long lg; /* decision variable (line) */ - - width = (width & 1) ? (width + 1) : (width); - height = (height & 1) ? (height + 1) : (height); - - a = width / 2; - b = height / 2; - - axis_pt[0].x = a; - axis_pt[0].y = 0; - axis_pt[1].x = 0; - axis_pt[1].y = b; - axis_pt[2].x = -a; - axis_pt[2].y = 0; - axis_pt[3].x = 0; - axis_pt[3].y = -b; - - if (s == e) - return; - - if ((e - s) >= 360) - { - s = 0; - e = 0; - } - - while (s < 0) - s += 360; - while (s >= 360) - s -= 360; - while (e < 0) - e += 360; - while (e >= 360) - e -= 360; - - if (e <= s) - e += 360; - - /* I'm assuming a chord-rule at the moment. Need to add origin to get a - * pie-rule, but will need to set chord-rule before recursion... - */ - - for (i = 0; i < 4; i++) - { - if ((s < (i + 1) * 90) && (e > (i + 1) * 90)) - { - gdImageFilledArc (im, cx, cy, width, height, s, (i + 1) * 90, color, gdChord); - pt[0] = gdArcClosest (width, height, s); - pt[0].x += cx; - pt[0].y += cy; - pt[1].x = cx + axis_pt[(i + 1) & 3].x; - pt[1].y = cy + axis_pt[(i + 1) & 3].y; - if (e <= (i + 2) * 90) - { - gdImageFilledArc (im, cx, cy, width, height, (i + 1) * 90, e, color, gdChord); - pt[2] = gdArcClosest (width, height, e); - pt[2].x += cx; - pt[2].y += cy; - if (style == gdChord) - { - gdImageFilledPolygon (im, pt, 3, color); - gdImagePolygon (im, pt, 3, color); - } - else if (style == gdPie) - { - pt[3].x = cx; - pt[3].y = cy; - gdImageFilledPolygon (im, pt, 4, color); - gdImagePolygon (im, pt, 4, color); - } - } - else - { - gdImageFilledArc (im, cx, cy, width, height, (i + 1) * 90, (i + 2) * 90, color, gdChord); - pt[2].x = cx + axis_pt[(i + 2) & 3].x; - pt[2].y = cy + axis_pt[(i + 2) & 3].y; - if (e <= (i + 3) * 90) - { - gdImageFilledArc (im, cx, cy, width, height, (i + 2) * 90, e, color, gdChord); - pt[3] = gdArcClosest (width, height, e); - pt[3].x += cx; - pt[3].y += cy; - if (style == gdChord) - { - gdImageFilledPolygon (im, pt, 4, color); - gdImagePolygon (im, pt, 4, color); - } - else if (style == gdPie) - { - pt[4].x = cx; - pt[4].y = cy; - gdImageFilledPolygon (im, pt, 5, color); - gdImagePolygon (im, pt, 5, color); - } - } - else - { - gdImageFilledArc (im, cx, cy, width, height, (i + 2) * 90, (i + 3) * 90, color, gdChord); - pt[3].x = cx + axis_pt[(i + 3) & 3].x; - pt[3].y = cy + axis_pt[(i + 3) & 3].y; - if (e <= (i + 4) * 90) - { - gdImageFilledArc (im, cx, cy, width, height, (i + 3) * 90, e, color, gdChord); - pt[4] = gdArcClosest (width, height, e); - pt[4].x += cx; - pt[4].y += cy; - if (style == gdChord) - { - gdImageFilledPolygon (im, pt, 5, color); - gdImagePolygon (im, pt, 5, color); - } - else if (style == gdPie) - { - pt[5].x = cx; - pt[5].y = cy; - gdImageFilledPolygon (im, pt, 6, color); - gdImagePolygon (im, pt, 6, color); - } - } - else - { - gdImageFilledArc (im, cx, cy, width, height, (i + 3) * 90, (i + 4) * 90, color, gdChord); - pt[4].x = cx + axis_pt[(i + 4) & 3].x; - pt[4].y = cy + axis_pt[(i + 4) & 3].y; - - gdImageFilledArc (im, cx, cy, width, height, (i + 4) * 90, e, color, gdChord); - pt[5] = gdArcClosest (width, height, e); - pt[5].x += cx; - pt[5].y += cy; - if (style == gdChord) - { - gdImageFilledPolygon (im, pt, 6, color); - gdImagePolygon (im, pt, 6, color); - } - else if (style == gdPie) - { - pt[6].x = cx; - pt[6].y = cy; - gdImageFilledPolygon (im, pt, 7, color); - gdImagePolygon (im, pt, 7, color); - } - } - } - } - return; - } - } - - /* At this point we have only arcs that lies within a quadrant - - * map this to first quadrant... - */ - - if ((s >= 90) && (e <= 180)) - { - angle = s; - s = 180 - e; - e = 180 - angle; - flip_x = 1; - } - if ((s >= 180) && (e <= 270)) - { - s = s - 180; - e = e - 180; - flip_x = 1; - flip_y = 1; - } - if ((s >= 270) && (e <= 360)) - { - angle = s; - s = 360 - e; - e = 360 - angle; - flip_y = 1; - } - - if (s == 0) - { - s_sin = 0; - s_cos = (long) ((double) 32768); - } - else - { - s_sin = (long) ((double) 32768 * sin ((double) s * M_PI / (double) 180)); - s_cos = (long) ((double) 32768 * cos ((double) s * M_PI / (double) 180)); - } - if (e == 0) - { - e_sin = (long) ((double) 32768); - e_cos = 0; - } - else - { - e_sin = (long) ((double) 32768 * sin ((double) e * M_PI / (double) 180)); - e_cos = (long) ((double) 32768 * cos ((double) e * M_PI / (double) 180)); - } - - w = (long) width; - h = (long) height; - - ws = w * w; - hs = h * h; - - whs = 1; - while ((ws > 32768) || (hs > 32768)) - { - ws = (ws + 1) / 2; /* Unfortunate limitations on integers makes */ - hs = (hs + 1) / 2; /* drawing large ellipses problematic... */ - whs *= 2; - } - while ((ws * hs) > (0x04000000L / whs)) - { - ws = (ws + 1) / 2; - hs = (hs + 1) / 2; - whs *= 2; - } - whs *= ws * hs; - - pt[0].x = w / 2; - pt[0].y = 0; - - pt[2].x = 0; - pt[2].y = h / 2; - - have_s = 0; - have_e = 0; - - if (s == 0) - have_s = 1; - if (e == 90) - have_e = 1; - - x2 = w; - y2 = 0; /* Starting point is exactly on ellipse */ - - g = x2 - 1; - g = g * g * hs + 4 * ws - whs; - - while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ - { - y2 += 2; - g += ws * 4 * (y2 + 1); - - if (g > 0) /* Need to drop */ - { - x2 -= 2; - g -= hs * 4 * x2; - } - - if ((have_s == 0) && ((s_sin * x2) <= (y2 * s_cos))) - { - pt[0].x = (int) (x2 / 2); - pt[0].y = (int) (y2 / 2); - have_s = 1; - } - - if ((have_e == 0) && ((e_sin * x2) <= (y2 * e_cos))) - { - pt[2].x = (int) (x2 / 2); - pt[2].y = (int) (y2 / 2); - have_e = 1; - } - } - pt[1].x = (int) (x2 / 2); - pt[1].y = (int) (y2 / 2); - - x2 = 0; - y2 = h; /* Starting point is exactly on ellipse */ - - g = y2 - 1; - g = g * g * ws + 4 * hs - whs; - - while ((x2 * hs) < (y2 * ws)) - { - x2 += 2; - g += hs * 4 * (x2 + 1); - - if (g > 0) /* Need to drop */ - { - y2 -= 2; - g -= ws * 4 * y2; - } - - if ((have_s == 0) && ((s_sin * x2) >= (y2 * s_cos))) - { - pt[0].x = (int) (x2 / 2); - pt[0].y = (int) (y2 / 2); - have_s = 1; - } - - if ((have_e == 0) && ((e_sin * x2) >= (y2 * e_cos))) - { - pt[2].x = (int) (x2 / 2); - pt[2].y = (int) (y2 / 2); - have_e = 1; - } - } - - if ((have_s == 0) || (have_e == 0)) - return; /* Bizarre case */ - - if (style == gdPie) - { - pt[3] = pt[0]; - pt[4] = pt[1]; - pt[5] = pt[2]; - - pt[0].x = cx + (flip_x ? (-pt[0].x) : pt[0].x); - pt[0].y = cy + (flip_y ? (-pt[0].y) : pt[0].y); - pt[1].x = cx; - pt[1].y = cy; - pt[2].x = cx + (flip_x ? (-pt[2].x) : pt[2].x); - pt[2].y = cy + (flip_y ? (-pt[2].y) : pt[2].y); - gdImageFilledPolygon (im, pt, 3, color); - gdImagePolygon (im, pt, 3, color); - - pt[0] = pt[3]; - pt[1] = pt[4]; - pt[2] = pt[5]; - } - - if (((s_cos * hs) > (s_sin * ws)) && ((e_cos * hs) < (e_sin * ws))) - { /* the points are on different parts of the curve... - * this is too tricky to try to handle, so divide and conquer: - */ - pt[3] = pt[0]; - pt[4] = pt[1]; - pt[5] = pt[2]; - - pt[0].x = cx + (flip_x ? (-pt[0].x) : pt[0].x); - pt[0].y = cy + (flip_y ? (-pt[0].y) : pt[0].y); - pt[1].x = cx + (flip_x ? (-pt[1].x) : pt[1].x); - pt[1].y = cy + (flip_y ? (-pt[1].y) : pt[1].y); - pt[2].x = cx + (flip_x ? (-pt[2].x) : pt[2].x); - pt[2].y = cy + (flip_y ? (-pt[2].y) : pt[2].y); - gdImageFilledPolygon (im, pt, 3, color); - gdImagePolygon (im, pt, 3, color); - - pt[0] = pt[3]; - pt[2] = pt[4]; - - conquer = 1; - } - - if (conquer || (((s_cos * hs) > (s_sin * ws)) && ((e_cos * hs) > (e_sin * ws)))) - { /* This is the best bit... */ - /* steep line + ellipse */ - /* go up & left from pt[0] to pt[2] */ - - x2 = w; - y2 = 0; /* Starting point is exactly on ellipse */ - - g = x2 - 1; - g = g * g * hs + 4 * ws - whs; - - while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ - { - if ((s_sin * x2) <= (y2 * s_cos)) - break; - - y2 += 2; - g += ws * 4 * (y2 + 1); - - if (g > 0) /* Need to drop */ - { - x2 -= 2; - g -= hs * 4 * x2; - } - } - - lx2 = x2; - ly2 = y2; - - lg = lx2 * (pt[0].y - pt[2].y) - ly2 * (pt[0].x - pt[2].x); - lg = (lx2 - 1) * (pt[0].y - pt[2].y) - (ly2 + 2) * (pt[0].x - pt[2].x) - lg; - - while (y2 < (2 * pt[2].y)) - { - y2 += 2; - g += ws * 4 * (y2 + 1); - - if (g > 0) /* Need to drop */ - { - x2 -= 2; - g -= hs * 4 * x2; - } - - ly2 += 2; - lg -= 2 * (pt[0].x - pt[2].x); - - if (lg < 0) /* Need to drop */ - { - lx2 -= 2; - lg -= 2 * (pt[0].y - pt[2].y); - } - - y = (int) (y2 / 2); - for (x = (int) (lx2 / 2); x <= (int) (x2 / 2); x++) - { - gdImageSetPixel (im, ((flip_x) ? (cx - x) : (cx + x)), - ((flip_y) ? (cy - y) : (cy + y)), color); - } - } - } - if (conquer) - { - pt[0] = pt[4]; - pt[2] = pt[5]; - } - if (conquer || (((s_cos * hs) < (s_sin * ws)) && ((e_cos * hs) < (e_sin * ws)))) - { /* This is the best bit... */ - /* gradual line + ellipse */ - /* go down & right from pt[2] to pt[0] */ - - x2 = 0; - y2 = h; /* Starting point is exactly on ellipse */ - - g = y2 - 1; - g = g * g * ws + 4 * hs - whs; - - while ((x2 * hs) < (y2 * ws)) - { - x2 += 2; - g += hs * 4 * (x2 + 1); - - if (g > 0) /* Need to drop */ - { - y2 -= 2; - g -= ws * 4 * y2; - } - - if ((e_sin * x2) >= (y2 * e_cos)) - break; - } - - lx2 = x2; - ly2 = y2; - - lg = lx2 * (pt[0].y - pt[2].y) - ly2 * (pt[0].x - pt[2].x); - lg = (lx2 + 2) * (pt[0].y - pt[2].y) - (ly2 - 1) * (pt[0].x - pt[2].x) - lg; - - while (x2 < (2 * pt[0].x)) - { - x2 += 2; - g += hs * 4 * (x2 + 1); - - if (g > 0) /* Need to drop */ - { - y2 -= 2; - g -= ws * 4 * y2; - } - - lx2 += 2; - lg += 2 * (pt[0].y - pt[2].y); - - if (lg < 0) /* Need to drop */ - { - ly2 -= 2; - lg += 2 * (pt[0].x - pt[2].x); - } - - x = (int) (x2 / 2); - for (y = (int) (ly2 / 2); y <= (int) (y2 / 2); y++) - { - gdImageSetPixel (im, ((flip_x) ? (cx - x) : (cx + x)), - ((flip_y) ? (cy - y) : (cy + y)), color); - } - } - } -} - -static gdPoint -gdArcClosest (int width, int height, int angle) -{ - gdPoint pt; - - int flip_x = 0; - int flip_y = 0; - - long a_sin = 0; - long a_cos = 0; - - long w; /* a * 2 */ - long h; /* b * 2 */ - - long x2; /* x * 2 */ - long y2; /* y * 2 */ - - long ws; /* (a * 2)^2 */ - long hs; /* (b * 2)^2 */ - - long whs; /* (a * 2)^2 * (b * 2)^2 */ - - long g; /* decision variable */ - - w = (long) ((width & 1) ? (width + 1) : (width)); - h = (long) ((height & 1) ? (height + 1) : (height)); - - while (angle < 0) - angle += 360; - while (angle >= 360) - angle -= 360; - - if (angle == 0) - { - pt.x = w / 2; - pt.y = 0; - return (pt); - } - if (angle == 90) - { - pt.x = 0; - pt.y = h / 2; - return (pt); - } - if (angle == 180) - { - pt.x = -w / 2; - pt.y = 0; - return (pt); - } - if (angle == 270) - { - pt.x = 0; - pt.y = -h / 2; - return (pt); - } - - pt.x = 0; - pt.y = 0; - - if ((angle > 90) && (angle < 180)) - { - angle = 180 - angle; - flip_x = 1; - } - if ((angle > 180) && (angle < 270)) - { - angle = angle - 180; - flip_x = 1; - flip_y = 1; - } - if ((angle > 270) && (angle < 360)) - { - angle = 360 - angle; - flip_y = 1; - } - - a_sin = (long) ((double) 32768 * sin ((double) angle * M_PI / (double) 180)); - a_cos = (long) ((double) 32768 * cos ((double) angle * M_PI / (double) 180)); - - ws = w * w; - hs = h * h; - - whs = 1; - while ((ws > 32768) || (hs > 32768)) - { - ws = (ws + 1) / 2; /* Unfortunate limitations on integers makes */ - hs = (hs + 1) / 2; /* drawing large ellipses problematic... */ - whs *= 2; - } - while ((ws * hs) > (0x04000000L / whs)) - { - ws = (ws + 1) / 2; - hs = (hs + 1) / 2; - whs *= 2; - } - whs *= ws * hs; - - if ((a_cos * hs) > (a_sin * ws)) - { - x2 = w; - y2 = 0; /* Starting point is exactly on ellipse */ - - g = x2 - 1; - g = g * g * hs + 4 * ws - whs; - - while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ - { - y2 += 2; - g += ws * 4 * (y2 + 1); - - if (g > 0) /* Need to drop */ - { - x2 -= 2; - g -= hs * 4 * x2; - } - - if ((a_sin * x2) <= (y2 * a_cos)) - { - pt.x = (int) (x2 / 2); - pt.y = (int) (y2 / 2); - break; - } - } - } - else - { - x2 = 0; - y2 = h; /* Starting point is exactly on ellipse */ - - g = y2 - 1; - g = g * g * ws + 4 * hs - whs; - - while ((x2 * hs) < (y2 * ws)) - { - x2 += 2; - g += hs * 4 * (x2 + 1); - - if (g > 0) /* Need to drop */ - { - y2 -= 2; - g -= ws * 4 * y2; - } - - if ((a_sin * x2) >= (y2 * a_cos)) - { - pt.x = (int) (x2 / 2); - pt.y = (int) (y2 / 2); - break; - } - } - } - - if (flip_x) - pt.x = -pt.x; - if (flip_y) - pt.y = -pt.y; - - return (pt); -} - -#include "gd.h" -#include -#include - -#define WIDTH 500 -#define HEIGHT 300 - -int -main (int argc, char *argv[]) -{ - gdImagePtr im = gdImageCreate (WIDTH, HEIGHT); - int white = gdImageColorResolve (im, 0xFF, 0xFF, 0xFF), black = gdImageColorResolve (im, 0, 0, 0), - red = gdImageColorResolve (im, 0xFF, 0xA0, 0xA0); - FILE *out; - - /* filled arc - circle */ - gdImageFilledArc (im, WIDTH / 5, HEIGHT / 4, 200, 200, 45, 90, red, gdPie); - gdImageArc (im, WIDTH / 5, HEIGHT / 4, 200, 200, 45, 90, black); - - /* filled arc - ellipse */ - gdImageFilledArc (im, WIDTH / 2, HEIGHT / 4, 200, 150, 45, 90, red, gdPie); - gdImageArc (im, WIDTH / 2, HEIGHT / 4, 200, 150, 45, 90, black); - - - /* reference lines */ - gdImageLine (im, 0, HEIGHT / 4, WIDTH, HEIGHT / 4, black); - gdImageLine (im, WIDTH / 5, 0, WIDTH / 5, HEIGHT, black); - gdImageLine (im, WIDTH / 2, 0, WIDTH / 2, HEIGHT, black); - gdImageLine (im, WIDTH / 2, HEIGHT / 4, WIDTH / 2 + 300, HEIGHT / 4 + 300, black); - gdImageLine (im, WIDTH / 5, HEIGHT / 4, WIDTH / 5 + 300, HEIGHT / 4 + 300, black); - - /* TBB: Write img to test/arctest.png */ - out = fopen ("test/arctest.png", "wb"); - if (!out) - { - php_gd_error("Can't create test/arctest.png"); - exit (1); - } - gdImagePng (im, out); - fclose (out); - php_gd_error("Test image written to test/arctest.png"); - /* Destroy it */ - gdImageDestroy (im); - - return 0; -} - -#endif diff --git a/ext/gd/libgd/gd_gd.c b/ext/gd/libgd/gd_gd.c deleted file mode 100644 index 2d259cdd514e3..0000000000000 --- a/ext/gd/libgd/gd_gd.c +++ /dev/null @@ -1,274 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" - -#define TRUE 1 -#define FALSE 0 - -/* Exported functions: */ -extern void gdImageGd (gdImagePtr im, FILE * out); - - -/* Use this for commenting out debug-print statements. */ -/* Just use the first '#define' to allow all the prints... */ -/*#define GD2_DBG(s) (s) */ -#define GD2_DBG(s) - -/* */ -/* Shared code to read color tables from gd file. */ -/* */ -int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag) -{ - int i; - if (gd2xFlag) { - int trueColorFlag; - if (!gdGetByte(&trueColorFlag, in)) { - goto fail1; - } - /* 2.0.12: detect bad truecolor .gd files created by pre-2.0.12. - * Beginning in 2.0.12 truecolor is indicated by the initial 2-byte - * signature. - */ - if (trueColorFlag != im->trueColor) { - goto fail1; - } - /* This should have been a word all along */ - if (!im->trueColor) { - if (!gdGetWord(&im->colorsTotal, in)) { - goto fail1; - } - } - /* Int to accommodate truecolor single-color transparency */ - if (!gdGetInt(&im->transparent, in)) { - goto fail1; - } - } else { - if (!gdGetByte(&im->colorsTotal, in)) { - goto fail1; - } - if (!gdGetWord(&im->transparent, in)) { - goto fail1; - } - if (im->transparent == 257) { - im->transparent = (-1); - } - } - - GD2_DBG(printf("Pallette had %d colours (T=%d)\n", im->colorsTotal, im->transparent)); - - if (im->trueColor) { - return TRUE; - } - - for (i = 0; i < gdMaxColors; i++) { - if (!gdGetByte(&im->red[i], in)) { - goto fail1; - } - if (!gdGetByte(&im->green[i], in)) { - goto fail1; - } - if (!gdGetByte(&im->blue[i], in)) { - goto fail1; - } - if (gd2xFlag) { - if (!gdGetByte(&im->alpha[i], in)) { - goto fail1; - } - } - } - - for (i = 0; i < im->colorsTotal; i++) { - im->open[i] = 0; - } - - return TRUE; -fail1: - return FALSE; -} - -/* */ -/* Use the common basic header info to make the image object. */ -/* */ -static gdImagePtr _gdCreateFromFile (gdIOCtx * in, int *sx, int *sy) -{ - gdImagePtr im; - int gd2xFlag = 0; - int trueColorFlag = 0; - - if (!gdGetWord(sx, in)) { - goto fail1; - } - if (*sx == 65535 || *sx == 65534) { - /* This is a gd 2.0 .gd file */ - gd2xFlag = 1; - /* 2.0.12: 65534 signals a truecolor .gd file. There is a slight redundancy here but we can live with it. */ - if (*sx == 65534) { - trueColorFlag = 1; - } - if (!gdGetWord(sx, in)) { - goto fail1; - } - } - if (!gdGetWord(sy, in)) { - goto fail1; - } - - GD2_DBG(printf("Image is %dx%d\n", *sx, *sy)); - - if (trueColorFlag) { - im = gdImageCreateTrueColor(*sx, *sy); - } else { - im = gdImageCreate(*sx, *sy); - } - if (!_gdGetColors(in, im, gd2xFlag)) { - goto fail2; - } - - return im; -fail2: - gdImageDestroy(im); -fail1: - return 0; -} - -gdImagePtr gdImageCreateFromGd (FILE * inFile) -{ - gdImagePtr im; - gdIOCtx *in; - - in = gdNewFileCtx(inFile); - im = gdImageCreateFromGdCtx(in); - - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGdPtr (int size, void *data) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromGdCtx(in); - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGdCtx (gdIOCtxPtr in) -{ - int sx, sy; - int x, y; - gdImagePtr im; - - /* Read the header */ - im = _gdCreateFromFile(in, &sx, &sy); - - if (im == NULL) { - goto fail1; - } - - /* Then the data... */ - /* 2.0.12: support truecolor properly in .gd as well as in .gd2. Problem reported by Andreas Pfaller. */ - if (im->trueColor) { - for (y = 0; y < sy; y++) { - for (x = 0; x < sx; x++) { - int pix; - if (!gdGetInt(&pix, in)) { - goto fail2; - } - im->tpixels[y][x] = pix; - } - } - } else { - for (y = 0; y < sy; y++) { - for (x = 0; x < sx; x++) { - int ch; - ch = gdGetC(in); - if (ch == EOF) { - goto fail2; - } - /* ROW-MAJOR IN GD 1.3 */ - im->pixels[y][x] = ch; - } - } - } - - return im; - -fail2: - gdImageDestroy (im); -fail1: - return 0; -} - -void _gdPutColors (gdImagePtr im, gdIOCtx * out) -{ - int i; - - gdPutC(im->trueColor, out); - if (!im->trueColor) { - gdPutWord(im->colorsTotal, out); - } - gdPutInt(im->transparent, out); - if (!im->trueColor) { - for (i = 0; i < gdMaxColors; i++) { - gdPutC((unsigned char) im->red[i], out); - gdPutC((unsigned char) im->green[i], out); - gdPutC((unsigned char) im->blue[i], out); - gdPutC((unsigned char) im->alpha[i], out); - } - } -} - -static void _gdPutHeader (gdImagePtr im, gdIOCtx * out) -{ - /* 65535 indicates this is a gd 2.x .gd file. - * 2.0.12: 65534 indicates truecolor. - */ - if (im->trueColor) { - gdPutWord(65534, out); - } else { - gdPutWord(65535, out); - } - gdPutWord(im->sx, out); - gdPutWord(im->sy, out); - - _gdPutColors(im, out); -} - -static void _gdImageGd (gdImagePtr im, gdIOCtx * out) -{ - int x, y; - - _gdPutHeader(im, out); - - for (y = 0; y < im->sy; y++) { - for (x = 0; x < im->sx; x++) { - /* ROW-MAJOR IN GD 1.3 */ - if (im->trueColor) { - gdPutInt(im->tpixels[y][x], out); - } else { - gdPutC((unsigned char) im->pixels[y][x], out); - } - } - } -} - -void gdImageGd (gdImagePtr im, FILE * outFile) -{ - gdIOCtx *out = gdNewFileCtx(outFile); - _gdImageGd(im, out); - out->gd_free(out); -} - -void *gdImageGdPtr (gdImagePtr im, int *size) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx(2048, NULL); - _gdImageGd(im, out); - rv = gdDPExtractData(out, size); - out->gd_free(out); - return rv; -} diff --git a/ext/gd/libgd/gd_gd2.c b/ext/gd/libgd/gd_gd2.c deleted file mode 100644 index 1e739179e2c75..0000000000000 --- a/ext/gd/libgd/gd_gd2.c +++ /dev/null @@ -1,825 +0,0 @@ -/* - * gd_gd2.c - * - * Implements the I/O and support for the GD2 format. - * - * Changing the definition of GD2_DBG (below) will cause copious messages - * to be displayed while it processes requests. - * - * Designed, Written & Copyright 1999, Philip Warner. - * - */ - -#include -#include -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#include - -#define TRUE 1 -#define FALSE 0 - -/* 2.11: not part of the API, as the save routine can figure it out - * from im->trueColor, and the load routine doesn't need to tell - * the end user the saved format. NOTE: adding 2 is assumed - * to result in the correct format value for truecolor! -*/ -#define GD2_FMT_TRUECOLOR_RAW 3 -#define GD2_FMT_TRUECOLOR_COMPRESSED 4 - -#define gd2_compressed(fmt) (((fmt) == GD2_FMT_COMPRESSED) || ((fmt) == GD2_FMT_TRUECOLOR_COMPRESSED)) -#define gd2_truecolor(fmt) (((fmt) == GD2_FMT_TRUECOLOR_RAW) || ((fmt) == GD2_FMT_TRUECOLOR_COMPRESSED)) - -/* Use this for commenting out debug-print statements. */ -/* Just use the first '#define' to allow all the prints... */ -/* #define GD2_DBG(s) (s) */ -#define GD2_DBG(s) - -typedef struct -{ - int offset; - int size; -} t_chunk_info; - -extern int _gdGetColors(gdIOCtx * in, gdImagePtr im, int gd2xFlag); -extern void _gdPutColors(gdImagePtr im, gdIOCtx * out); - -/* */ -/* Read the extra info in the gd2 header. */ -/* */ -static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** chunkIdx) -{ - int i; - int ch; - char id[5]; - t_chunk_info *cidx; - int sidx; - int nc; - - GD2_DBG(php_gd_error("Reading gd2 header info")); - - for (i = 0; i < 4; i++) { - ch = gdGetC(in); - if (ch == EOF) { - goto fail1; - } - id[i] = ch; - } - id[4] = 0; - - GD2_DBG(php_gd_error("Got file code: %s", id)); - - /* Equiv. of 'magick'. */ - if (strcmp(id, GD2_ID) != 0) { - GD2_DBG(php_gd_error("Not a valid gd2 file")); - goto fail1; - } - - /* Version */ - if (gdGetWord(vers, in) != 1) { - goto fail1; - } - GD2_DBG(php_gd_error("Version: %d", *vers)); - - if ((*vers != 1) && (*vers != 2)) { - GD2_DBG(php_gd_error("Bad version: %d", *vers)); - goto fail1; - } - - /* Image Size */ - if (!gdGetWord(sx, in)) { - GD2_DBG(php_gd_error("Could not get x-size")); - goto fail1; - } - if (!gdGetWord(sy, in)) { - GD2_DBG(php_gd_error("Could not get y-size")); - goto fail1; - } - GD2_DBG(php_gd_error("Image is %dx%d", *sx, *sy)); - - /* Chunk Size (pixels, not bytes!) */ - if (gdGetWord(cs, in) != 1) { - goto fail1; - } - GD2_DBG(php_gd_error("ChunkSize: %d", *cs)); - - if ((*cs < GD2_CHUNKSIZE_MIN) || (*cs > GD2_CHUNKSIZE_MAX)) { - GD2_DBG(php_gd_error("Bad chunk size: %d", *cs)); - goto fail1; - } - - /* Data Format */ - if (gdGetWord(fmt, in) != 1) { - goto fail1; - } - GD2_DBG(php_gd_error("Format: %d", *fmt)); - - if ((*fmt != GD2_FMT_RAW) && (*fmt != GD2_FMT_COMPRESSED) && (*fmt != GD2_FMT_TRUECOLOR_RAW) && (*fmt != GD2_FMT_TRUECOLOR_COMPRESSED)) { - GD2_DBG(php_gd_error("Bad data format: %d", *fmt)); - goto fail1; - } - - /* # of chunks wide */ - if (gdGetWord(ncx, in) != 1) { - goto fail1; - } - GD2_DBG(php_gd_error("%d Chunks Wide", *ncx)); - - /* # of chunks high */ - if (gdGetWord(ncy, in) != 1) { - goto fail1; - } - GD2_DBG(php_gd_error("%d Chunks vertically", *ncy)); - - if (gd2_compressed(*fmt)) { - nc = (*ncx) * (*ncy); - GD2_DBG(php_gd_error("Reading %d chunk index entries", nc)); - sidx = sizeof(t_chunk_info) * nc; - if (sidx <= 0) { - goto fail1; - } - cidx = gdCalloc(sidx, 1); - for (i = 0; i < nc; i++) { - if (gdGetInt(&cidx[i].offset, in) != 1) { - goto fail1; - } - if (gdGetInt(&cidx[i].size, in) != 1) { - goto fail1; - } - } - *chunkIdx = cidx; - } - - GD2_DBG(php_gd_error("gd2 header complete")); - - return 1; - -fail1: - return 0; -} - -static gdImagePtr _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** cidx) -{ - gdImagePtr im; - - if (_gd2GetHeader (in, sx, sy, cs, vers, fmt, ncx, ncy, cidx) != 1) { - GD2_DBG(php_gd_error("Bad GD2 header")); - goto fail1; - } - - if (gd2_truecolor(*fmt)) { - im = gdImageCreateTrueColor(*sx, *sy); - } else { - im = gdImageCreate(*sx, *sy); - } - if (im == NULL) { - GD2_DBG(php_gd_error("Could not create gdImage")); - goto fail1; - } - - if (!_gdGetColors(in, im, (*vers) == 2)) { - GD2_DBG(php_gd_error("Could not read color palette")); - goto fail2; - } - GD2_DBG(php_gd_error("Image palette completed: %d colours", im->colorsTotal)); - - return im; - -fail2: - gdImageDestroy(im); - return 0; - -fail1: - return 0; -} - -static int _gd2ReadChunk (int offset, char *compBuf, int compSize, char *chunkBuf, uLongf * chunkLen, gdIOCtx * in) -{ - int zerr; - - if (gdTell(in) != offset) { - GD2_DBG(php_gd_error("Positioning in file to %d", offset)); - gdSeek(in, offset); - } else { - GD2_DBG(php_gd_error("Already Positioned in file to %d", offset)); - } - - /* Read and uncompress an entire chunk. */ - GD2_DBG(php_gd_error("Reading file")); - if (gdGetBuf(compBuf, compSize, in) != compSize) { - return FALSE; - } - GD2_DBG(php_gd_error("Got %d bytes. Uncompressing into buffer of %d bytes", compSize, (int)*chunkLen)); - zerr = uncompress((unsigned char *) chunkBuf, chunkLen, (unsigned char *) compBuf, compSize); - if (zerr != Z_OK) { - GD2_DBG(php_gd_error("Error %d from uncompress", zerr)); - return FALSE; - } - GD2_DBG(php_gd_error("Got chunk")); - - return TRUE; -} - -gdImagePtr gdImageCreateFromGd2 (FILE * inFile) -{ - gdIOCtx *in = gdNewFileCtx(inFile); - gdImagePtr im; - - im = gdImageCreateFromGd2Ctx(in); - - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGd2Ptr (int size, void *data) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromGd2Ctx(in); - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in) -{ - int sx, sy; - int i; - int ncx, ncy, nc, cs, cx, cy; - int x, y, ylo, yhi, xlo, xhi; - int vers, fmt; - t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */ - unsigned char *chunkBuf = NULL; /* So we can gdFree it with impunity. */ - int chunkNum = 0; - int chunkMax = 0; - uLongf chunkLen; - int chunkPos = 0; - int compMax = 0; - int bytesPerPixel; - char *compBuf = NULL; /* So we can gdFree it with impunity. */ - - gdImagePtr im; - - /* Get the header */ - if (!(im = _gd2CreateFromFile(in, &sx, &sy, &cs, &vers, &fmt, &ncx, &ncy, &chunkIdx))) { - return 0; - } - - bytesPerPixel = im->trueColor ? 4 : 1; - nc = ncx * ncy; - - if (gd2_compressed(fmt)) { - /* Find the maximum compressed chunk size. */ - compMax = 0; - for (i = 0; (i < nc); i++) { - if (chunkIdx[i].size > compMax) { - compMax = chunkIdx[i].size; - } - } - compMax++; - - /* Allocate buffers */ - chunkMax = cs * bytesPerPixel * cs; - if (chunkMax <= 0) { - return 0; - } - chunkBuf = gdCalloc(chunkMax, 1); - compBuf = gdCalloc(compMax, 1); - - GD2_DBG(php_gd_error("Largest compressed chunk is %d bytes", compMax)); - } - - /* Read the data... */ - for (cy = 0; (cy < ncy); cy++) { - for (cx = 0; (cx < ncx); cx++) { - ylo = cy * cs; - yhi = ylo + cs; - if (yhi > im->sy) { - yhi = im->sy; - } - - GD2_DBG(php_gd_error("Processing Chunk %d (%d, %d), y from %d to %d", chunkNum, cx, cy, ylo, yhi)); - - if (gd2_compressed(fmt)) { - chunkLen = chunkMax; - - if (!_gd2ReadChunk(chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, (char *) chunkBuf, &chunkLen, in)) { - GD2_DBG(php_gd_error("Error reading comproessed chunk")); - goto fail2; - } - - chunkPos = 0; - } - - for (y = ylo; (y < yhi); y++) { - xlo = cx * cs; - xhi = xlo + cs; - if (xhi > im->sx) { - xhi = im->sx; - } - - if (!gd2_compressed(fmt)) { - for (x = xlo; x < xhi; x++) { - if (im->trueColor) { - if (!gdGetInt(&im->tpixels[y][x], in)) { - im->tpixels[y][x] = 0; - } - } else { - int ch; - if (!gdGetByte(&ch, in)) { - ch = 0; - } - im->pixels[y][x] = ch; - } - } - } else { - for (x = xlo; x < xhi; x++) { - if (im->trueColor) { - /* 2.0.1: work around a gcc bug by being verbose. TBB */ - int a = chunkBuf[chunkPos++] << 24; - int r = chunkBuf[chunkPos++] << 16; - int g = chunkBuf[chunkPos++] << 8; - int b = chunkBuf[chunkPos++]; - im->tpixels[y][x] = a + r + g + b; - } else { - im->pixels[y][x] = chunkBuf[chunkPos++]; - } - } - } - } - chunkNum++; - } - } - - GD2_DBG(php_gd_error("Freeing memory")); - - if (chunkBuf) { - gdFree(chunkBuf); - } - if (compBuf) { - gdFree(compBuf); - } - if (chunkIdx) { - gdFree(chunkIdx); - } - - GD2_DBG(php_gd_error("Done")); - - return im; - -fail2: - gdImageDestroy(im); - if (chunkBuf) { - gdFree(chunkBuf); - } - if (compBuf) { - gdFree(compBuf); - } - if (chunkIdx) { - gdFree(chunkIdx); - } - - return 0; -} - -gdImagePtr gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h); - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) -{ - gdImagePtr im; - gdIOCtx *in = gdNewFileCtx(inFile); - - im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h); - - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h) -{ - int scx, scy, ecx, ecy, fsx, fsy; - int nc, ncx, ncy, cs, cx, cy; - int x, y, ylo, yhi, xlo, xhi; - int dstart, dpos; - int i; - /* 2.0.12: unsigned is correct; fixes problems with color munging. Thanks to Steven Brown. */ - unsigned int ch; - int vers, fmt; - t_chunk_info *chunkIdx = NULL; - unsigned char *chunkBuf = NULL; - int chunkNum; - int chunkMax = 0; - uLongf chunkLen; - int chunkPos = 0; - int compMax; - char *compBuf = NULL; - - gdImagePtr im; - - /* The next few lines are basically copied from gd2CreateFromFile - * we change the file size, so don't want to use the code directly. - * but we do need to know the file size. - */ - if (_gd2GetHeader(in, &fsx, &fsy, &cs, &vers, &fmt, &ncx, &ncy, &chunkIdx) != 1) { - goto fail1; - } - - GD2_DBG(php_gd_error("File size is %dx%d", fsx, fsy)); - - /* This is the difference - make a file based on size of chunks. */ - if (gd2_truecolor(fmt)) { - im = gdImageCreateTrueColor(w, h); - } else { - im = gdImageCreate(w, h); - } - if (im == NULL) { - goto fail1; - } - - if (!_gdGetColors(in, im, vers == 2)) { - goto fail2; - } - GD2_DBG(php_gd_error("Image palette completed: %d colours", im->colorsTotal)); - - /* Process the header info */ - nc = ncx * ncy; - - if (gd2_compressed(fmt)) { - /* Find the maximum compressed chunk size. */ - compMax = 0; - for (i = 0; (i < nc); i++) { - if (chunkIdx[i].size > compMax) { - compMax = chunkIdx[i].size; - } - } - compMax++; - - if (im->trueColor) { - chunkMax = cs * cs * 4; - } else { - chunkMax = cs * cs; - } - if (chunkMax <= 0) { - goto fail2; - } - - chunkBuf = gdCalloc(chunkMax, 1); - compBuf = gdCalloc(compMax, 1); - } - - /* Work out start/end chunks */ - scx = srcx / cs; - scy = srcy / cs; - if (scx < 0) { - scx = 0; - } - if (scy < 0) { - scy = 0; - } - - ecx = (srcx + w) / cs; - ecy = (srcy + h) / cs; - if (ecx >= ncx) { - ecx = ncx - 1; - } - if (ecy >= ncy) { - ecy = ncy - 1; - } - - /* Remember file position of image data. */ - dstart = gdTell(in); - GD2_DBG(php_gd_error("Data starts at %d", dstart)); - - /* Loop through the chunks. */ - for (cy = scy; (cy <= ecy); cy++) { - ylo = cy * cs; - yhi = ylo + cs; - if (yhi > fsy) { - yhi = fsy; - } - - for (cx = scx; cx <= ecx; cx++) { - - xlo = cx * cs; - xhi = xlo + cs; - if (xhi > fsx) { - xhi = fsx; - } - - GD2_DBG(php_gd_error("Processing Chunk (%d, %d), from %d to %d", cx, cy, ylo, yhi)); - - if (!gd2_compressed(fmt)) { - GD2_DBG(php_gd_error("Using raw format data")); - if (im->trueColor) { - dpos = (cy * (cs * fsx) * 4 + cx * cs * (yhi - ylo) * 4) + dstart; - } else { - dpos = cy * (cs * fsx) + cx * cs * (yhi - ylo) + dstart; - } - - /* gd 2.0.11: gdSeek returns TRUE on success, not 0. Longstanding bug. 01/16/03 */ - if (!gdSeek(in, dpos)) { - php_gd_error_ex(E_WARNING, "Error from seek: %d", errno); - goto fail2; - } - GD2_DBG(php_gd_error("Reading (%d, %d) from position %d", cx, cy, dpos - dstart)); - } else { - chunkNum = cx + cy * ncx; - - chunkLen = chunkMax; - if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, chunkBuf, &chunkLen, in)) { - php_gd_error("Error reading comproessed chunk"); - goto fail2; - } - chunkPos = 0; - GD2_DBG(php_gd_error("Reading (%d, %d) from chunk %d", cx, cy, chunkNum)); - } - - GD2_DBG(php_gd_error(" into (%d, %d) - (%d, %d)", xlo, ylo, xhi, yhi)); - - for (y = ylo; (y < yhi); y++) { - for (x = xlo; x < xhi; x++) { - if (!gd2_compressed(fmt)) { - if (im->trueColor) { - if (!gdGetInt(&ch, in)) { - ch = 0; - } - } else { - ch = gdGetC(in); - if ((int)ch == EOF) { - ch = 0; - } - } - } else { - if (im->trueColor) { - ch = chunkBuf[chunkPos++]; - ch = (ch << 8) + chunkBuf[chunkPos++]; - ch = (ch << 8) + chunkBuf[chunkPos++]; - ch = (ch << 8) + chunkBuf[chunkPos++]; - } else { - ch = chunkBuf[chunkPos++]; - } - } - - /* Only use a point that is in the image. */ - if ((x >= srcx) && (x < (srcx + w)) && (x < fsx) && (x >= 0) && (y >= srcy) && (y < (srcy + h)) && (y < fsy) && (y >= 0)) { - if (im->trueColor) { - im->tpixels[y - srcy][x - srcx] = ch; - } else { - im->pixels[y - srcy][x - srcx] = ch; - } - } - } - } - } - } - - if (chunkBuf) { - gdFree(chunkBuf); - } - if (compBuf) { - gdFree(compBuf); - } - if (chunkIdx) { - gdFree(chunkIdx); - } - - return im; - -fail2: - gdImageDestroy(im); -fail1: - if (chunkBuf) { - gdFree(chunkBuf); - } - if (compBuf) { - gdFree(compBuf); - } - if (chunkIdx) { - gdFree(chunkIdx); - } - - return 0; -} - -static void _gd2PutHeader (gdImagePtr im, gdIOCtx * out, int cs, int fmt, int cx, int cy) -{ - int i; - - /* Send the gd2 id, to verify file format. */ - for (i = 0; i < 4; i++) { - gdPutC((unsigned char) (GD2_ID[i]), out); - } - - /* We put the version info first, so future versions can easily change header info. */ - - gdPutWord(GD2_VERS, out); - gdPutWord(im->sx, out); - gdPutWord(im->sy, out); - gdPutWord(cs, out); - gdPutWord(fmt, out); - gdPutWord(cx, out); - gdPutWord(cy, out); -} - -static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt) -{ - int ncx, ncy, cx, cy; - int x, y, ylo, yhi, xlo, xhi; - int chunkLen; - int chunkNum = 0; - char *chunkData = NULL; /* So we can gdFree it with impunity. */ - char *compData = NULL; /* So we can gdFree it with impunity. */ - uLongf compLen; - int idxPos = 0; - int idxSize; - t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */ - int posSave; - int bytesPerPixel = im->trueColor ? 4 : 1; - int compMax = 0; - - /* Force fmt to a valid value since we don't return anything. */ - if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) { - fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED; - } - if (im->trueColor) { - fmt += 2; - } - /* Make sure chunk size is valid. These are arbitrary values; 64 because it seems - * a little silly to expect performance improvements on a 64x64 bit scale, and - * 4096 because we buffer one chunk, and a 16MB buffer seems a little large - it may be - * OK for one user, but for another to read it, they require the buffer. - */ - if (cs == 0) { - cs = GD2_CHUNKSIZE; - } else if (cs < GD2_CHUNKSIZE_MIN) { - cs = GD2_CHUNKSIZE_MIN; - } else if (cs > GD2_CHUNKSIZE_MAX) { - cs = GD2_CHUNKSIZE_MAX; - } - - /* Work out number of chunks. */ - ncx = im->sx / cs + 1; - ncy = im->sy / cs + 1; - - /* Write the standard header. */ - _gd2PutHeader (im, out, cs, fmt, ncx, ncy); - - if (gd2_compressed(fmt)) { - /* Work out size of buffer for compressed data, If CHUNKSIZE is large, - * then these will be large! - */ - - /* The zlib notes say output buffer size should be (input size) * 1.01 * 12 - * - we'll use 1.02 to be paranoid. - */ - compMax = (int)(cs * bytesPerPixel * cs * 1.02f) + 12; - - /* Allocate the buffers. */ - chunkData = safe_emalloc(cs * bytesPerPixel, cs, 0); - memset(chunkData, 0, cs * bytesPerPixel * cs); - if (compMax <= 0) { - goto fail; - } - compData = gdCalloc(compMax, 1); - - /* Save the file position of chunk index, and allocate enough space for - * each chunk_info block . - */ - idxPos = gdTell(out); - idxSize = ncx * ncy * sizeof(t_chunk_info); - GD2_DBG(php_gd_error("Index size is %d", idxSize)); - gdSeek(out, idxPos + idxSize); - - chunkIdx = safe_emalloc(idxSize, sizeof(t_chunk_info), 0); - memset(chunkIdx, 0, idxSize * sizeof(t_chunk_info)); - } - - _gdPutColors (im, out); - - GD2_DBG(php_gd_error("Size: %dx%d", im->sx, im->sy)); - GD2_DBG(php_gd_error("Chunks: %dx%d", ncx, ncy)); - - for (cy = 0; (cy < ncy); cy++) { - for (cx = 0; (cx < ncx); cx++) { - ylo = cy * cs; - yhi = ylo + cs; - if (yhi > im->sy) { - yhi = im->sy; - } - - GD2_DBG(php_gd_error("Processing Chunk (%dx%d), y from %d to %d", cx, cy, ylo, yhi)); - chunkLen = 0; - for (y = ylo; (y < yhi); y++) { - GD2_DBG(php_gd_error("y=%d: ",y)); - xlo = cx * cs; - xhi = xlo + cs; - if (xhi > im->sx) { - xhi = im->sx; - } - - if (gd2_compressed(fmt)) { - for (x = xlo; x < xhi; x++) { - GD2_DBG(php_gd_error("%d...",x)); - if (im->trueColor) { - int p = im->tpixels[y][x]; - chunkData[chunkLen++] = gdTrueColorGetAlpha(p); - chunkData[chunkLen++] = gdTrueColorGetRed(p); - chunkData[chunkLen++] = gdTrueColorGetGreen(p); - chunkData[chunkLen++] = gdTrueColorGetBlue(p); - } else { - chunkData[chunkLen++] = im->pixels[y][x]; - } - } - } else { - for (x = xlo; x < xhi; x++) { - GD2_DBG(php_gd_error("%d, ",x)); - - if (im->trueColor) { - gdPutInt(im->tpixels[y][x], out); - } else { - gdPutC((unsigned char) im->pixels[y][x], out); - } - } - } - GD2_DBG(php_gd_error("y=%d done.",y)); - } - - if (gd2_compressed(fmt)) { - compLen = compMax; - if (compress((unsigned char *) &compData[0], &compLen, (unsigned char *) &chunkData[0], chunkLen) != Z_OK) { - php_gd_error("Error from compressing"); - } else { - chunkIdx[chunkNum].offset = gdTell(out); - chunkIdx[chunkNum++].size = compLen; - GD2_DBG(php_gd_error("Chunk %d size %d offset %d", chunkNum, chunkIdx[chunkNum - 1].size, chunkIdx[chunkNum - 1].offset)); - - if (gdPutBuf (compData, compLen, out) <= 0) { - /* Any alternate suggestions for handling this? */ - php_gd_error_ex(E_WARNING, "Error %d on write", errno); - } - } - } - } - } - - if (gd2_compressed(fmt)) { - /* Save the position, write the index, restore position (paranoia). */ - GD2_DBG(php_gd_error("Seeking %d to write index", idxPos)); - posSave = gdTell(out); - gdSeek(out, idxPos); - GD2_DBG(php_gd_error("Writing index")); - for (x = 0; x < chunkNum; x++) { - GD2_DBG(php_gd_error("Chunk %d size %d offset %d", x, chunkIdx[x].size, chunkIdx[x].offset)); - gdPutInt(chunkIdx[x].offset, out); - gdPutInt(chunkIdx[x].size, out); - } - gdSeek(out, posSave); - } -fail: - GD2_DBG(php_gd_error("Freeing memory")); - if (chunkData) { - gdFree(chunkData); - } - if (compData) { - gdFree(compData); - } - if (chunkIdx) { - gdFree(chunkIdx); - } - GD2_DBG(php_gd_error("Done")); -} - -void gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt) -{ - gdIOCtx *out = gdNewFileCtx(outFile); - - _gdImageGd2(im, out, cs, fmt); - - out->gd_free(out); -} - -void *gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx(2048, NULL); - - _gdImageGd2(im, out, cs, fmt); - rv = gdDPExtractData(out, size); - out->gd_free(out); - - return rv; -} diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c deleted file mode 100644 index 1733a646f36f9..0000000000000 --- a/ext/gd/libgd/gd_gif_in.c +++ /dev/null @@ -1,580 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" - -#include "php.h" - -/* Used only when debugging GIF compression code */ -/* #define DEBUGGING_ENVARS */ - -#ifdef DEBUGGING_ENVARS - -static int verbose_set = 0; -static int verbose; -#define VERBOSE (verbose_set?verbose:set_verbose()) - -static int set_verbose(void) -{ - verbose = !!getenv("GIF_VERBOSE"); - verbose_set = 1; - return(verbose); -} - -#else - -#define VERBOSE 0 - -#endif - - -#define MAXCOLORMAPSIZE 256 - -#define TRUE 1 -#define FALSE 0 - -#define CM_RED 0 -#define CM_GREEN 1 -#define CM_BLUE 2 - -#define MAX_LWZ_BITS 12 - -#define INTERLACE 0x40 -#define LOCALCOLORMAP 0x80 -#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) - -#define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) != 0) - -#define LM_to_uint(a,b) (((b)<<8)|(a)) - -/* We may eventually want to use this information, but def it out for now */ -#if 0 -static struct { - unsigned int Width; - unsigned int Height; - unsigned char ColorMap[3][MAXCOLORMAPSIZE]; - unsigned int BitPixel; - unsigned int ColorResolution; - unsigned int Background; - unsigned int AspectRatio; -} GifScreen; -#endif - -static struct { - int transparent; - int delayTime; - int inputFlag; - int disposal; -} Gif89 = { -1, -1, -1, 0 }; - -static int ReadColorMap (gdIOCtx *fd, int number, unsigned char (*buffer)[256]); -static int DoExtension (gdIOCtx *fd, int label, int *Transparent); -static int GetDataBlock (gdIOCtx *fd, unsigned char *buf); -static int GetCode (gdIOCtx *fd, int code_size, int flag); -static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size); - -static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */ - -int ZeroDataBlock; - -gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource) -{ - gdIOCtx *in = gdNewSSCtx(inSource, NULL); - gdImagePtr im; - - im = gdImageCreateFromGifCtx(in); - - in->gd_free(in); - - return im; -} - -gdImagePtr -gdImageCreateFromGif(FILE *fdFile) -{ - gdIOCtx *fd = gdNewFileCtx(fdFile); - gdImagePtr im = 0; - - im = gdImageCreateFromGifCtx(fd); - - fd->gd_free(fd); - - return im; -} - -gdImagePtr -gdImageCreateFromGifCtx(gdIOCtxPtr fd) -{ -/* 1.4 int imageNumber; */ - int BitPixel; - int ColorResolution; - int Background; - int AspectRatio; - int Transparent = (-1); - unsigned char buf[16]; - unsigned char c; - unsigned char ColorMap[3][MAXCOLORMAPSIZE]; - unsigned char localColorMap[3][MAXCOLORMAPSIZE]; - int imw, imh; - int useGlobalColormap; - int bitPixel; - int i; - /*1.4//int imageCount = 0; */ - char version[4]; - - gdImagePtr im = 0; - ZeroDataBlock = FALSE; - - /*1.4//imageNumber = 1; */ - if (! ReadOK(fd,buf,6)) { - return 0; - } - if (strncmp((char *)buf,"GIF",3) != 0) { - return 0; - } - strncpy(version, (char *)buf + 3, 3); - version[3] = '\0'; - - if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { - return 0; - } - if (! ReadOK(fd,buf,7)) { - return 0; - } - BitPixel = 2<<(buf[4]&0x07); - ColorResolution = (int) (((buf[4]&0x70)>>3)+1); - Background = buf[5]; - AspectRatio = buf[6]; - - if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ - if (ReadColorMap(fd, BitPixel, ColorMap)) { - return 0; - } - } - for (;;) { - if (! ReadOK(fd,&c,1)) { - return 0; - } - if (c == ';') { /* GIF terminator */ - goto terminated; - } - - if (c == '!') { /* Extension */ - if (! ReadOK(fd,&c,1)) { - return 0; - } - DoExtension(fd, c, &Transparent); - continue; - } - - if (c != ',') { /* Not a valid start character */ - continue; - } - - /*1.4//++imageCount; */ - - if (! ReadOK(fd,buf,9)) { - return 0; - } - - useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); - - bitPixel = 1<<((buf[8]&0x07)+1); - - imw = LM_to_uint(buf[4],buf[5]); - imh = LM_to_uint(buf[6],buf[7]); - if (!(im = gdImageCreate(imw, imh))) { - return 0; - } - im->interlace = BitSet(buf[8], INTERLACE); - if (! useGlobalColormap) { - if (ReadColorMap(fd, bitPixel, localColorMap)) { - return 0; - } - ReadImage(im, fd, imw, imh, localColorMap, - BitSet(buf[8], INTERLACE)); - /*1.4//imageCount != imageNumber); */ - } else { - ReadImage(im, fd, imw, imh, - ColorMap, - BitSet(buf[8], INTERLACE)); - /*1.4//imageCount != imageNumber); */ - } - if (Transparent != (-1)) { - gdImageColorTransparent(im, Transparent); - } - goto terminated; - } - -terminated: - /* Terminator before any image was declared! */ - if (!im) { - return 0; - } - /* Check for open colors at the end, so - we can reduce colorsTotal and ultimately - BitsPerPixel */ - for (i=((im->colorsTotal-1)); (i>=0); i--) { - if (im->open[i]) { - im->colorsTotal--; - } else { - break; - } - } - return im; -} - -static int -ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) -{ - int i; - unsigned char rgb[3]; - - - for (i = 0; i < number; ++i) { - if (! ReadOK(fd, rgb, sizeof(rgb))) { - return TRUE; - } - buffer[CM_RED][i] = rgb[0] ; - buffer[CM_GREEN][i] = rgb[1] ; - buffer[CM_BLUE][i] = rgb[2] ; - } - - - return FALSE; -} - -static int -DoExtension(gdIOCtx *fd, int label, int *Transparent) -{ - static unsigned char buf[256]; - - switch (label) { - case 0xf9: /* Graphic Control Extension */ - (void) GetDataBlock(fd, (unsigned char*) buf); - Gif89.disposal = (buf[0] >> 2) & 0x7; - Gif89.inputFlag = (buf[0] >> 1) & 0x1; - Gif89.delayTime = LM_to_uint(buf[1],buf[2]); - if ((buf[0] & 0x1) != 0) - *Transparent = buf[3]; - - while (GetDataBlock(fd, (unsigned char*) buf) > 0) - ; - return FALSE; - default: - break; - } - while (GetDataBlock(fd, (unsigned char*) buf) > 0) - ; - - return FALSE; -} - -static int -GetDataBlock_(gdIOCtx *fd, unsigned char *buf) -{ - unsigned char count; - - if (! ReadOK(fd,&count,1)) { - return -1; - } - - ZeroDataBlock = count == 0; - - if ((count != 0) && (! ReadOK(fd, buf, count))) { - return -1; - } - - return count; -} - -static int -GetDataBlock(gdIOCtx *fd, unsigned char *buf) -{ - int rv; - int i; - char *tmp = NULL; - - rv = GetDataBlock_(fd,buf); - if (VERBOSE) { - if (rv > 0) { - tmp = safe_emalloc(3 * rv, sizeof(char), 1); - for (i=0;i= lastbit) { - if (done) { - if (curbit >= lastbit) { - /* Oh well */ - } - return -1; - } - buf[0] = buf[last_byte-2]; - buf[1] = buf[last_byte-1]; - - if ((count = GetDataBlock(fd, &buf[2])) <= 0) - done = TRUE; - - last_byte = 2 + count; - curbit = (curbit - lastbit) + 16; - lastbit = (2+count)*8 ; - } - - ret = 0; - for (i = curbit, j = 0; j < code_size; ++i, ++j) - ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; - - curbit += code_size; - return ret; -} - -static int -GetCode(gdIOCtx *fd, int code_size, int flag) -{ - int rv; - - rv = GetCode_(fd,code_size,flag); - if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning %d]",code_size,flag,rv); - return(rv); -} - -#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2) -static int -LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size) -{ - static int fresh = FALSE; - int code, incode; - static int code_size, set_code_size; - static int max_code, max_code_size; - static int firstcode, oldcode; - static int clear_code, end_code; - static int table[2][(1<< MAX_LWZ_BITS)]; - static int stack[STACK_SIZE], *sp; - register int i; - - if (flag) { - set_code_size = input_code_size; - code_size = set_code_size+1; - clear_code = 1 << set_code_size ; - end_code = clear_code + 1; - max_code_size = 2*clear_code; - max_code = clear_code+2; - - GetCode(fd, 0, TRUE); - - fresh = TRUE; - - for (i = 0; i < clear_code; ++i) { - table[0][i] = 0; - table[1][i] = i; - } - for (; i < (1< stack) - return *--sp; - - while ((code = GetCode(fd, code_size, FALSE)) >= 0) { - if (code == clear_code) { - for (i = 0; i < clear_code; ++i) { - table[0][i] = 0; - table[1][i] = i; - } - for (; i < (1< 0) - ; - - if (count != 0) - return -2; - } - - incode = code; - - if (sp == (stack + STACK_SIZE)) { - /* Bad compressed data stream */ - return -1; - } - - if (code >= max_code) { - *sp++ = firstcode; - code = oldcode; - } - - while (code >= clear_code) { - if (sp == (stack + STACK_SIZE)) { - /* Bad compressed data stream */ - return -1; - } - *sp++ = table[1][code]; - if (code == table[0][code]) { - /* Oh well */ - } - code = table[0][code]; - } - - *sp++ = firstcode = table[1][code]; - - if ((code = max_code) <(1<= max_code_size) && - (max_code_size < (1< stack) - return *--sp; - } - return code; -} - -static int -LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) -{ - int rv; - - rv = LWZReadByte_(fd,flag,input_code_size); - if (VERBOSE) php_gd_error_ex(E_NOTICE, "[LWZReadByte(,%d,%d) returning %d]",flag,input_code_size,rv); - return(rv); -} - -static void -ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace) /*1.4//, int ignore) */ -{ - unsigned char c; - int v; - int xpos = 0, ypos = 0, pass = 0; - int i; - /* Stash the color map into the image */ - for (i=0; (ired[i] = cmap[CM_RED][i]; - im->green[i] = cmap[CM_GREEN][i]; - im->blue[i] = cmap[CM_BLUE][i]; - im->open[i] = 1; - } - /* Many (perhaps most) of these colors will remain marked open. */ - im->colorsTotal = gdMaxColors; - /* - ** Initialize the Compression routines - */ - if (! ReadOK(fd,&c,1)) { - return; - } - if (LWZReadByte(fd, TRUE, c) < 0) { - return; - } - - /* - ** If this is an "uninteresting picture" ignore it. - ** REMOVED For 1.4 - */ - /*if (ignore) { */ - /* while (LWZReadByte(fd, FALSE, c) >= 0) */ - /* ; */ - /* return; */ - /*} */ - - while ((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { - /* This how we recognize which colors are actually used. */ - if (im->open[v]) { - im->open[v] = 0; - } - gdImageSetPixel(im, xpos, ypos, v); - ++xpos; - if (xpos == len) { - xpos = 0; - if (interlace) { - switch (pass) { - case 0: - case 1: - ypos += 8; break; - case 2: - ypos += 4; break; - case 3: - ypos += 2; break; - } - - if (ypos >= height) { - ++pass; - switch (pass) { - case 1: - ypos = 4; break; - case 2: - ypos = 2; break; - case 3: - ypos = 1; break; - default: - goto fini; - } - } - } else { - ++ypos; - } - } - if (ypos >= height) - break; - } - -fini: - if (LWZReadByte(fd,FALSE,c)>=0) { - /* Ignore extra */ - } -} - diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c deleted file mode 100644 index 49da75f96f972..0000000000000 --- a/ext/gd/libgd/gd_gif_out.c +++ /dev/null @@ -1,759 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" - -/* Code drawn from ppmtogif.c, from the pbmplus package -** -** Based on GIFENCOD by David Rowley . A -** Lempel-Zim compression based on "compress". -** -** Modified by Marcel Wijkstra -** -** Copyright (C) 1989 by Jef Poskanzer. -** -** Permission to use, copy, modify, and distribute this software and its -** documentation for any purpose and without fee is hereby granted, provided -** that the above copyright notice appear in all copies and that both that -** copyright notice and this permission notice appear in supporting -** documentation. This software is provided "as is" without express or -** implied warranty. -** -** The Graphics Interchange Format(c) is the Copyright property of -** CompuServe Incorporated. GIF(sm) is a Service Mark property of -** CompuServe Incorporated. -*/ - -/* - * a code_int must be able to hold 2**GIFBITS values of type int, and also -1 - */ -typedef int code_int; - -#ifdef SIGNED_COMPARE_SLOW -typedef unsigned long int count_int; -typedef unsigned short int count_short; -#else /*SIGNED_COMPARE_SLOW*/ -typedef long int count_int; -#endif /*SIGNED_COMPARE_SLOW*/ - -/* 2.0.28: threadsafe */ - -#define maxbits GIFBITS - -/* should NEVER generate this code */ -#define maxmaxcode ((code_int)1 << GIFBITS) - -#define HSIZE 5003 /* 80% occupancy */ -#define hsize HSIZE /* Apparently invariant, left over from - compress */ - -typedef struct { - int Width, Height; - int curx, cury; - long CountDown; - int Pass; - int Interlace; - int n_bits; /* number of bits/code */ - code_int maxcode; /* maximum code, given n_bits */ - count_int htab [HSIZE]; - unsigned short codetab [HSIZE]; - code_int free_ent; /* first unused entry */ - /* - * block compression parameters -- after all codes are used up, - * and compression rate changes, start over. - */ - int clear_flg; - int offset; - long int in_count; /* length of input */ - long int out_count; /* # of codes output (for debugging) */ - - int g_init_bits; - gdIOCtx * g_outfile; - - int ClearCode; - int EOFCode; - unsigned long cur_accum; - int cur_bits; - /* - * Number of characters so far in this 'packet' - */ - int a_count; - /* - * Define the storage for the packet accumulator - */ - char accum[ 256 ]; -} GifCtx; - -static int gifPutWord(int w, gdIOCtx *out); -static int colorstobpp(int colors); -static void BumpPixel (GifCtx *ctx); -static int GIFNextPixel (gdImagePtr im, GifCtx *ctx); -static void GIFEncode (gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im); -static void compress (int init_bits, gdIOCtx *outfile, gdImagePtr im, GifCtx *ctx); -static void output (code_int code, GifCtx *ctx); -static void cl_block (GifCtx *ctx); -static void cl_hash (register count_int chsize, GifCtx *ctx); -static void char_init (GifCtx *ctx); -static void char_out (int c, GifCtx *ctx); -static void flush_char (GifCtx *ctx); -void * gdImageGifPtr (gdImagePtr im, int *size) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx (2048, NULL); - gdImageGifCtx (im, out); - rv = gdDPExtractData (out, size); - out->gd_free (out); - return rv; -} - -void gdImageGif (gdImagePtr im, FILE * outFile) -{ - gdIOCtx *out = gdNewFileCtx (outFile); - gdImageGifCtx (im, out); - out->gd_free (out); -} - -void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out) -{ - gdImagePtr pim = 0, tim = im; - int interlace, transparent, BitsPerPixel; - interlace = im->interlace; - transparent = im->transparent; - if (im->trueColor) { - /* Expensive, but the only way that produces an - acceptable result: mix down to a palette - based temporary image. */ - pim = gdImageCreatePaletteFromTrueColor(im, 1, 256); - if (!pim) { - return; - } - tim = pim; - } - BitsPerPixel = colorstobpp(tim->colorsTotal); - /* All set, let's do it. */ - GIFEncode( - out, tim->sx, tim->sy, interlace, 0, transparent, BitsPerPixel, - tim->red, tim->green, tim->blue, tim); - if (pim) { - /* Destroy palette based temporary image. */ - gdImageDestroy( pim); - } -} - -static int -colorstobpp(int colors) -{ - int bpp = 0; - - if ( colors <= 2 ) - bpp = 1; - else if ( colors <= 4 ) - bpp = 2; - else if ( colors <= 8 ) - bpp = 3; - else if ( colors <= 16 ) - bpp = 4; - else if ( colors <= 32 ) - bpp = 5; - else if ( colors <= 64 ) - bpp = 6; - else if ( colors <= 128 ) - bpp = 7; - else if ( colors <= 256 ) - bpp = 8; - return bpp; - } - -/***************************************************************************** - * - * GIFENCODE.C - GIF Image compression interface - * - * GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent, - * BitsPerPixel, Red, Green, Blue, gdImagePtr ) - * - *****************************************************************************/ - -#define TRUE 1 -#define FALSE 0 -/* - * Bump the 'curx' and 'cury' to point to the next pixel - */ -static void -BumpPixel(GifCtx *ctx) -{ - /* - * Bump the current X position - */ - ++(ctx->curx); - - /* - * If we are at the end of a scan line, set curx back to the beginning - * If we are interlaced, bump the cury to the appropriate spot, - * otherwise, just increment it. - */ - if( ctx->curx == ctx->Width ) { - ctx->curx = 0; - - if( !ctx->Interlace ) - ++(ctx->cury); - else { - switch( ctx->Pass ) { - - case 0: - ctx->cury += 8; - if( ctx->cury >= ctx->Height ) { - ++(ctx->Pass); - ctx->cury = 4; - } - break; - - case 1: - ctx->cury += 8; - if( ctx->cury >= ctx->Height ) { - ++(ctx->Pass); - ctx->cury = 2; - } - break; - - case 2: - ctx->cury += 4; - if( ctx->cury >= ctx->Height ) { - ++(ctx->Pass); - ctx->cury = 1; - } - break; - - case 3: - ctx->cury += 2; - break; - } - } - } -} - -/* - * Return the next pixel from the image - */ -static int -GIFNextPixel(gdImagePtr im, GifCtx *ctx) -{ - int r; - - if( ctx->CountDown == 0 ) - return EOF; - - --(ctx->CountDown); - - r = gdImageGetPixel(im, ctx->curx, ctx->cury); - - BumpPixel(ctx); - - return r; -} - -/* public */ - -static void -GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im) -{ - int B; - int RWidth, RHeight; - int LeftOfs, TopOfs; - int Resolution; - int ColorMapSize; - int InitCodeSize; - int i; - GifCtx ctx; - ctx.Interlace = GInterlace; - ctx.in_count = 1; - memset(&ctx, 0, sizeof(ctx)); - ColorMapSize = 1 << BitsPerPixel; - - RWidth = ctx.Width = GWidth; - RHeight = ctx.Height = GHeight; - LeftOfs = TopOfs = 0; - - Resolution = BitsPerPixel; - - /* - * Calculate number of bits we are expecting - */ - ctx.CountDown = (long)ctx.Width * (long)ctx.Height; - - /* - * Indicate which pass we are on (if interlace) - */ - ctx.Pass = 0; - - /* - * The initial code size - */ - if( BitsPerPixel <= 1 ) - InitCodeSize = 2; - else - InitCodeSize = BitsPerPixel; - - /* - * Set up the current x and y position - */ - ctx.curx = ctx.cury = 0; - - /* - * Write the Magic header - */ - gdPutBuf(Transparent < 0 ? "GIF87a" : "GIF89a", 6, fp ); - - /* - * Write out the screen width and height - */ - gifPutWord( RWidth, fp ); - gifPutWord( RHeight, fp ); - - /* - * Indicate that there is a global colour map - */ - B = 0x80; /* Yes, there is a color map */ - - /* - * OR in the resolution - */ - B |= (Resolution - 1) << 5; - - /* - * OR in the Bits per Pixel - */ - B |= (BitsPerPixel - 1); - - /* - * Write it out - */ - gdPutC( B, fp ); - - /* - * Write out the Background colour - */ - gdPutC( Background, fp ); - - /* - * Byte of 0's (future expansion) - */ - gdPutC( 0, fp ); - - /* - * Write out the Global Colour Map - */ - for( i=0; i= 0 ) { - gdPutC( '!', fp ); - gdPutC( 0xf9, fp ); - gdPutC( 4, fp ); - gdPutC( 1, fp ); - gdPutC( 0, fp ); - gdPutC( 0, fp ); - gdPutC( (unsigned char) Transparent, fp ); - gdPutC( 0, fp ); - } - - /* - * Write an Image separator - */ - gdPutC( ',', fp ); - - /* - * Write the Image header - */ - - gifPutWord( LeftOfs, fp ); - gifPutWord( TopOfs, fp ); - gifPutWord( ctx.Width, fp ); - gifPutWord( ctx.Height, fp ); - - /* - * Write out whether or not the image is interlaced - */ - if( ctx.Interlace ) - gdPutC( 0x40, fp ); - else - gdPutC( 0x00, fp ); - - /* - * Write out the initial code size - */ - gdPutC( InitCodeSize, fp ); - - /* - * Go and actually compress the data - */ - compress( InitCodeSize+1, fp, im, &ctx ); - - /* - * Write out a Zero-length packet (to end the series) - */ - gdPutC( 0, fp ); - - /* - * Write the GIF file terminator - */ - gdPutC( ';', fp ); -} - -/*************************************************************************** - * - * GIFCOMPR.C - GIF Image compression routines - * - * Lempel-Ziv compression based on 'compress'. GIF modifications by - * David Rowley (mgardi@watdcsu.waterloo.edu) - * - ***************************************************************************/ - -/* - * General DEFINEs - */ - -#define GIFBITS 12 - -#ifdef NO_UCHAR - typedef char char_type; -#else /*NO_UCHAR*/ - typedef unsigned char char_type; -#endif /*NO_UCHAR*/ - -/* - * - * GIF Image compression - modified 'compress' - * - * Based on: compress.c - File compression ala IEEE Computer, June 1984. - * - * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) - * Jim McKie (decvax!mcvax!jim) - * Steve Davies (decvax!vax135!petsd!peora!srd) - * Ken Turkowski (decvax!decwrl!turtlevax!ken) - * James A. Woods (decvax!ihnp4!ames!jaw) - * Joe Orost (decvax!vax135!petsd!joe) - * - */ -#include - -#define ARGVAL() (*++(*argv) || (--argc && *++argv)) - -#ifdef COMPATIBLE /* But wrong! */ -# define MAXCODE(n_bits) ((code_int) 1 << (n_bits) - 1) -#else /*COMPATIBLE*/ -# define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1) -#endif /*COMPATIBLE*/ - -#define HashTabOf(i) ctx->htab[i] -#define CodeTabOf(i) ctx->codetab[i] - - -/* - * To save much memory, we overlay the table used by compress() with those - * used by decompress(). The tab_prefix table is the same size and type - * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We - * get this from the beginning of htab. The output stack uses the rest - * of htab, and contains characters. There is plenty of room for any - * possible stack (stack used to be 8000 characters). - */ - -#define tab_prefixof(i) CodeTabOf(i) -#define tab_suffixof(i) ((char_type*)(htab))[i] -#define de_stack ((char_type*)&tab_suffixof((code_int)1<g_init_bits = init_bits; - ctx->g_outfile = outfile; - - /* - * Set up the necessary values - */ - ctx->offset = 0; - ctx->out_count = 0; - ctx->clear_flg = 0; - ctx->in_count = 1; - ctx->maxcode = MAXCODE(ctx->n_bits = ctx->g_init_bits); - - ctx->ClearCode = (1 << (init_bits - 1)); - ctx->EOFCode = ctx->ClearCode + 1; - ctx->free_ent = ctx->ClearCode + 2; - - char_init(ctx); - - ent = GIFNextPixel( im, ctx ); - - hshift = 0; - for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L ) - ++hshift; - hshift = 8 - hshift; /* set hash code range bound */ - - hsize_reg = hsize; - cl_hash( (count_int) hsize_reg, ctx ); /* clear hash table */ - - output( (code_int)ctx->ClearCode, ctx ); - -#ifdef SIGNED_COMPARE_SLOW - while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) { -#else /*SIGNED_COMPARE_SLOW*/ - while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */ -#endif /*SIGNED_COMPARE_SLOW*/ - - ++(ctx->in_count); - - fcode = (long) (((long) c << maxbits) + ent); - i = (((code_int)c << hshift) ^ ent); /* xor hashing */ - - if ( HashTabOf (i) == fcode ) { - ent = CodeTabOf (i); - continue; - } else if ( (long)HashTabOf (i) < 0 ) /* empty slot */ - goto nomatch; - disp = hsize_reg - i; /* secondary hash (after G. Knott) */ - if ( i == 0 ) - disp = 1; -probe: - if ( (i -= disp) < 0 ) - i += hsize_reg; - - if ( HashTabOf (i) == fcode ) { - ent = CodeTabOf (i); - continue; - } - if ( (long)HashTabOf (i) > 0 ) - goto probe; -nomatch: - output ( (code_int) ent, ctx ); - ++(ctx->out_count); - ent = c; -#ifdef SIGNED_COMPARE_SLOW - if ( (unsigned) ctx->free_ent < (unsigned) maxmaxcode) { -#else /*SIGNED_COMPARE_SLOW*/ - if ( ctx->free_ent < maxmaxcode ) { /* } */ -#endif /*SIGNED_COMPARE_SLOW*/ - CodeTabOf (i) = ctx->free_ent++; /* code -> hashtable */ - HashTabOf (i) = fcode; - } else - cl_block(ctx); - } - /* - * Put out the final code. - */ - output( (code_int)ent, ctx ); - ++(ctx->out_count); - output( (code_int) ctx->EOFCode, ctx ); -} - -/***************************************************************** - * TAG( output ) - * - * Output the given code. - * Inputs: - * code: A n_bits-bit integer. If == -1, then EOF. This assumes - * that n_bits =< (long)wordsize - 1. - * Outputs: - * Outputs code to the file. - * Assumptions: - * Chars are 8 bits long. - * Algorithm: - * Maintain a GIFBITS character long buffer (so that 8 codes will - * fit in it exactly). Use the VAX insv instruction to insert each - * code in turn. When the buffer fills up empty it and start over. - */ - -static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, - 0x001F, 0x003F, 0x007F, 0x00FF, - 0x01FF, 0x03FF, 0x07FF, 0x0FFF, - 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; - -static void -output(code_int code, GifCtx *ctx) -{ - ctx->cur_accum &= masks[ ctx->cur_bits ]; - - if( ctx->cur_bits > 0 ) - ctx->cur_accum |= ((long)code << ctx->cur_bits); - else - ctx->cur_accum = code; - - ctx->cur_bits += ctx->n_bits; - - while( ctx->cur_bits >= 8 ) { - char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx ); - ctx->cur_accum >>= 8; - ctx->cur_bits -= 8; - } - - /* - * If the next entry is going to be too big for the code size, - * then increase it, if possible. - */ - if ( ctx->free_ent > ctx->maxcode || ctx->clear_flg ) { - - if( ctx->clear_flg ) { - - ctx->maxcode = MAXCODE (ctx->n_bits = ctx->g_init_bits); - ctx->clear_flg = 0; - - } else { - - ++(ctx->n_bits); - if ( ctx->n_bits == maxbits ) - ctx->maxcode = maxmaxcode; - else - ctx->maxcode = MAXCODE(ctx->n_bits); - } - } - - if( code == ctx->EOFCode ) { - /* - * At EOF, write the rest of the buffer. - */ - while( ctx->cur_bits > 0 ) { - char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx); - ctx->cur_accum >>= 8; - ctx->cur_bits -= 8; - } - - flush_char(ctx); - - } -} - -/* - * Clear out the hash table - */ -static void -cl_block (GifCtx *ctx) /* table clear for block compress */ -{ - - cl_hash ( (count_int) hsize, ctx ); - ctx->free_ent = ctx->ClearCode + 2; - ctx->clear_flg = 1; - - output( (code_int)ctx->ClearCode, ctx); -} - -static void -cl_hash(register count_int chsize, GifCtx *ctx) /* reset code table */ - -{ - - register count_int *htab_p = ctx->htab+chsize; - - register long i; - register long m1 = -1; - - i = chsize - 16; - do { /* might use Sys V memset(3) here */ - *(htab_p-16) = m1; - *(htab_p-15) = m1; - *(htab_p-14) = m1; - *(htab_p-13) = m1; - *(htab_p-12) = m1; - *(htab_p-11) = m1; - *(htab_p-10) = m1; - *(htab_p-9) = m1; - *(htab_p-8) = m1; - *(htab_p-7) = m1; - *(htab_p-6) = m1; - *(htab_p-5) = m1; - *(htab_p-4) = m1; - *(htab_p-3) = m1; - *(htab_p-2) = m1; - *(htab_p-1) = m1; - htab_p -= 16; - } while ((i -= 16) >= 0); - - for ( i += 16; i > 0; --i ) - *--htab_p = m1; -} - -/****************************************************************************** - * - * GIF Specific routines - * - ******************************************************************************/ - -/* - * Set up the 'byte output' routine - */ -static void -char_init(GifCtx *ctx) -{ - ctx->a_count = 0; -} - -/* - * Add a character to the end of the current packet, and if it is 254 - * characters, flush the packet to disk. - */ -static void -char_out(int c, GifCtx *ctx) -{ - ctx->accum[ ctx->a_count++ ] = c; - if( ctx->a_count >= 254 ) - flush_char(ctx); -} - -/* - * Flush the packet to disk, and reset the accumulator - */ -static void -flush_char(GifCtx *ctx) -{ - if( ctx->a_count > 0 ) { - gdPutC( ctx->a_count, ctx->g_outfile ); - gdPutBuf( ctx->accum, ctx->a_count, ctx->g_outfile ); - ctx->a_count = 0; - } -} - -static int gifPutWord(int w, gdIOCtx *out) -{ - /* Byte order is little-endian */ - gdPutC(w & 0xFF, out); - gdPutC((w >> 8) & 0xFF, out); - return 0; -} - - diff --git a/ext/gd/libgd/gd_io.c b/ext/gd/libgd/gd_io.c deleted file mode 100644 index ab807149f75f1..0000000000000 --- a/ext/gd/libgd/gd_io.c +++ /dev/null @@ -1,146 +0,0 @@ - - -/* - * io.c - * - * Implements the simple I/O 'helper' routines. - * - * Not really essential, but these routines were used extensively in GD, - * so they were moved here. They also make IOCtx calls look better... - * - * Written (or, at least, moved) 1999, Philip Warner. - * - */ - -#include -#include -#include -#include "gd.h" - -/* Use this for commenting out debug-print statements. */ -/* Just use the first '#define' to allow all the prints... */ -/*#define IO_DBG(s) (s) */ -#define IO_DBG(s) - - -#define GD_IO_EOF_CHK(r) \ - if (r == EOF) { \ - return 0; \ - } \ - -/* - * Write out a word to the I/O context pointer - */ -void Putword (int w, gdIOCtx * ctx) -{ - unsigned char buf[2]; - - buf[0] = w & 0xff; - buf[1] = (w / 256) & 0xff; - (ctx->putBuf) (ctx, (char *) buf, 2); -} - -void Putchar (int c, gdIOCtx * ctx) -{ - (ctx->putC) (ctx, c & 0xff); -} - -void gdPutC (const unsigned char c, gdIOCtx * ctx) -{ - (ctx->putC) (ctx, c); -} - -void gdPutWord (int w, gdIOCtx * ctx) -{ - IO_DBG (php_gd_error("Putting word...")); - (ctx->putC) (ctx, (unsigned char) (w >> 8)); - (ctx->putC) (ctx, (unsigned char) (w & 0xFF)); - IO_DBG (php_gd_error("put.")); -} - -void gdPutInt (int w, gdIOCtx * ctx) -{ - IO_DBG (php_gd_error("Putting int...")); - (ctx->putC) (ctx, (unsigned char) (w >> 24)); - (ctx->putC) (ctx, (unsigned char) ((w >> 16) & 0xFF)); - (ctx->putC) (ctx, (unsigned char) ((w >> 8) & 0xFF)); - (ctx->putC) (ctx, (unsigned char) (w & 0xFF)); - IO_DBG (php_gd_error("put.")); -} - -int gdGetC (gdIOCtx * ctx) -{ - return ((ctx->getC) (ctx)); -} - -int gdGetByte (int *result, gdIOCtx * ctx) -{ - int r; - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result = r; - return 1; -} - -int gdGetWord (int *result, gdIOCtx * ctx) -{ - int r; - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result = r << 8; - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result += r; - return 1; -} - - -int gdGetInt (int *result, gdIOCtx * ctx) -{ - int r; - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result = r << 24; - - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result += r << 16; - - r = (ctx->getC) (ctx); - if (r == EOF) { - return 0; - } - *result += r << 8; - - r = (ctx->getC) (ctx); - GD_IO_EOF_CHK(r); - *result += r; - - return 1; -} - -int gdPutBuf (const void *buf, int size, gdIOCtx * ctx) -{ - IO_DBG (php_gd_error("Putting buf...")); - return (ctx->putBuf) (ctx, buf, size); - IO_DBG (php_gd_error("put.")); -} - -int gdGetBuf (void *buf, int size, gdIOCtx * ctx) -{ - return (ctx->getBuf) (ctx, buf, size); -} - -int gdSeek (gdIOCtx * ctx, const int pos) -{ - IO_DBG (php_gd_error("Seeking...")); - return ((ctx->seek) (ctx, pos)); - IO_DBG (php_gd_error("Done.")); -} - -long gdTell (gdIOCtx * ctx) -{ - IO_DBG (php_gd_error("Telling...")); - return ((ctx->tell) (ctx)); - IO_DBG (php_gd_error ("told.")); -} diff --git a/ext/gd/libgd/gd_io.h b/ext/gd/libgd/gd_io.h deleted file mode 100644 index b893751b7b383..0000000000000 --- a/ext/gd/libgd/gd_io.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef GD_IO_H -#define GD_IO_H 1 - -#include - -#ifdef VMS -#define Putchar gdPutchar -#endif - -typedef struct gdIOCtx { - int (*getC)(struct gdIOCtx*); - int (*getBuf)(struct gdIOCtx*, void*, int); - - void (*putC)(struct gdIOCtx*, int); - int (*putBuf)(struct gdIOCtx*, const void*, int); - - int (*seek)(struct gdIOCtx*, const int); - long (*tell)(struct gdIOCtx*); - - void (*gd_free)(struct gdIOCtx*); - -} gdIOCtx; - -typedef struct gdIOCtx *gdIOCtxPtr; - -void Putword(int w, gdIOCtx *ctx); -void Putchar(int c, gdIOCtx *ctx); - -void gdPutC(const unsigned char c, gdIOCtx *ctx); -int gdPutBuf(const void *, int, gdIOCtx*); -void gdPutWord(int w, gdIOCtx *ctx); -void gdPutInt(int w, gdIOCtx *ctx); - -int gdGetC(gdIOCtx *ctx); -int gdGetBuf(void *, int, gdIOCtx*); -int gdGetByte(int *result, gdIOCtx *ctx); -int gdGetWord(int *result, gdIOCtx *ctx); -int gdGetInt(int *result, gdIOCtx *ctx); - -int gdSeek(gdIOCtx *ctx, const int); -long gdTell(gdIOCtx *ctx); - -#endif diff --git a/ext/gd/libgd/gd_io_dp.c b/ext/gd/libgd/gd_io_dp.c deleted file mode 100644 index bfeb4cb4bb9aa..0000000000000 --- a/ext/gd/libgd/gd_io_dp.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - * io_dp.c - * - * Implements the dynamic pointer interface. - * - * Based on GD.pm code by Lincoln Stein for interfacing to libgd. - * Added support for reading as well as support for 'tell' and 'seek'. - * - * As will all I/O modules, most functions are for local use only (called - * via function pointers in the I/O context). - * - * gdDPExtractData is the exception to this: it will return the pointer to - * the internal data, and reset the internal storage. - * - * Written/Modified 1999, Philip Warner. - * - */ - -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#define TRUE 1 -#define FALSE 0 - -/* this is used for creating images in main memory */ -typedef struct dpStruct -{ - void *data; - int logicalSize; - int realSize; - int dataGood; - int pos; - int freeOK; -} dynamicPtr; - -typedef struct dpIOCtx -{ - gdIOCtx ctx; - dynamicPtr *dp; -} dpIOCtx; - -typedef struct dpIOCtx *dpIOCtxPtr; - -/* these functions operate on in-memory dynamic pointers */ -static int allocDynamic (dynamicPtr * dp, int initialSize, void *data); -static int appendDynamic (dynamicPtr * dp, const void *src, int size); -static int gdReallocDynamic (dynamicPtr * dp, int required); -static int trimDynamic (dynamicPtr * dp); -static void gdFreeDynamicCtx (struct gdIOCtx *ctx); -static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag); - -static int dynamicPutbuf (struct gdIOCtx *, const void *, int); -static void dynamicPutchar (struct gdIOCtx *, int a); - -static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len); -static int dynamicGetchar (gdIOCtxPtr ctx); - -static int dynamicSeek (struct gdIOCtx *, const int); -static long dynamicTell (struct gdIOCtx *); - -/* return data as a dynamic pointer */ -gdIOCtx * gdNewDynamicCtx (int initialSize, void *data) -{ - return gdNewDynamicCtxEx(initialSize, data, 1); -} - -gdIOCtx * gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag) -{ - dpIOCtx *ctx; - dynamicPtr *dp; - - ctx = (dpIOCtx *) gdMalloc (sizeof (dpIOCtx)); - - dp = newDynamic(initialSize, data, freeOKFlag); - - ctx->dp = dp; - - ctx->ctx.getC = dynamicGetchar; - ctx->ctx.putC = dynamicPutchar; - - ctx->ctx.getBuf = dynamicGetbuf; - ctx->ctx.putBuf = dynamicPutbuf; - - ctx->ctx.seek = dynamicSeek; - ctx->ctx.tell = dynamicTell; - - ctx->ctx.gd_free = gdFreeDynamicCtx; - - return (gdIOCtx *) ctx; -} - -void * gdDPExtractData (struct gdIOCtx *ctx, int *size) -{ - dynamicPtr *dp; - dpIOCtx *dctx; - void *data; - - dctx = (dpIOCtx *) ctx; - dp = dctx->dp; - - /* clean up the data block and return it */ - if (dp->dataGood) { - trimDynamic (dp); - *size = dp->logicalSize; - data = dp->data; - } else { - *size = 0; - data = NULL; - if (dp->data != NULL && dp->freeOK) { - gdFree(dp->data); - } - } - - dp->data = NULL; - dp->realSize = 0; - dp->logicalSize = 0; - - return data; -} - -static void gdFreeDynamicCtx (struct gdIOCtx *ctx) -{ - dynamicPtr *dp; - dpIOCtx *dctx; - - dctx = (dpIOCtx *) ctx; - dp = dctx->dp; - - gdFree(ctx); - - dp->realSize = 0; - dp->logicalSize = 0; - - gdFree(dp); -} - -static long dynamicTell (struct gdIOCtx *ctx) -{ - dpIOCtx *dctx; - - dctx = (dpIOCtx *) ctx; - - return (dctx->dp->pos); -} - -static int dynamicSeek (struct gdIOCtx *ctx, const int pos) -{ - int bytesNeeded; - dynamicPtr *dp; - dpIOCtx *dctx; - - dctx = (dpIOCtx *) ctx; - dp = dctx->dp; - - if (!dp->dataGood) { - return FALSE; - } - - bytesNeeded = pos; - if (bytesNeeded > dp->realSize) { - /* 2.0.21 */ - if (!dp->freeOK) { - return FALSE; - } - gdReallocDynamic (dp, dp->realSize * 2); - } - - /* if we get here, we can be sure that we have enough bytes to copy safely */ - - /* Extend the logical size if we seek beyond EOF. */ - if (pos > dp->logicalSize) { - dp->logicalSize = pos; - } - - dp->pos = pos; - - return TRUE; -} - -/* return data as a dynamic pointer */ -static dynamicPtr * newDynamic (int initialSize, void *data, int freeOKFlag) -{ - dynamicPtr *dp; - dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr)); - - allocDynamic (dp, initialSize, data); - - dp->pos = 0; - dp->freeOK = freeOKFlag; - - return dp; -} - -static int -dynamicPutbuf (struct gdIOCtx *ctx, const void *buf, int size) -{ - dpIOCtx *dctx; - dctx = (dpIOCtx *) ctx; - - appendDynamic (dctx->dp, buf, size); - - if (dctx->dp->dataGood) - { - return size; - } - else - { - return -1; - }; - -} - -static void dynamicPutchar (struct gdIOCtx *ctx, int a) -{ - unsigned char b; - dpIOCtxPtr dctx; - - b = a; - dctx = (dpIOCtxPtr) ctx; - - appendDynamic(dctx->dp, &b, 1); -} - -static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len) -{ - int rlen, remain; - dpIOCtxPtr dctx; - dynamicPtr *dp; - - dctx = (dpIOCtxPtr) ctx; - dp = dctx->dp; - - remain = dp->logicalSize - dp->pos; - if (remain >= len) { - rlen = len; - } else { - if (remain == 0) { - return EOF; - } - rlen = remain; - } - - memcpy(buf, (void *) ((char *) dp->data + dp->pos), rlen); - dp->pos += rlen; - - return rlen; -} - -static int dynamicGetchar (gdIOCtxPtr ctx) -{ - unsigned char b; - int rv; - - rv = dynamicGetbuf (ctx, &b, 1); - if (rv != 1) { - return EOF; - } else { - return b; /* (b & 0xff); */ - } -} - -/* ********************************************************************* - - * InitDynamic - Return a dynamically resizable void* - * - * ********************************************************************* - */ -static int -allocDynamic (dynamicPtr * dp, int initialSize, void *data) -{ - - if (data == NULL) { - dp->logicalSize = 0; - dp->dataGood = FALSE; - dp->data = gdMalloc(initialSize); - } else { - dp->logicalSize = initialSize; - dp->dataGood = TRUE; - dp->data = data; - } - - dp->realSize = initialSize; - dp->dataGood = TRUE; - dp->pos = 0; - - return TRUE; -} - -/* append bytes to the end of a dynamic pointer */ -static int appendDynamic (dynamicPtr * dp, const void *src, int size) -{ - int bytesNeeded; - char *tmp; - - if (!dp->dataGood) { - return FALSE; - } - - /* bytesNeeded = dp->logicalSize + size; */ - bytesNeeded = dp->pos + size; - - if (bytesNeeded > dp->realSize) { - /* 2.0.21 */ - if (!dp->freeOK) { - return FALSE; - } - gdReallocDynamic(dp, bytesNeeded * 2); - } - - /* if we get here, we can be sure that we have enough bytes to copy safely */ - /*printf("Mem OK Size: %d, Pos: %d\n", dp->realSize, dp->pos); */ - - tmp = (char *) dp->data; - memcpy((void *) (tmp + (dp->pos)), src, size); - dp->pos += size; - - if (dp->pos > dp->logicalSize) { - dp->logicalSize = dp->pos; - } - - return TRUE; -} - -/* grow (or shrink) dynamic pointer */ -static int gdReallocDynamic (dynamicPtr * dp, int required) -{ - void *newPtr; - - /* First try gdRealloc(). If that doesn't work, make a new memory block and copy. */ - if ((newPtr = gdRealloc(dp->data, required))) { - dp->realSize = required; - dp->data = newPtr; - return TRUE; - } - - /* create a new pointer */ - newPtr = gdMalloc(required); - - /* copy the old data into it */ - memcpy(newPtr, dp->data, dp->logicalSize); - gdFree(dp->data); - dp->data = newPtr; - - dp->realSize = required; - - return TRUE; -} - -/* trim pointer so that its real and logical sizes match */ -static int trimDynamic (dynamicPtr * dp) -{ - /* 2.0.21: we don't reallocate memory we don't own */ - if (!dp->freeOK) { - return FALSE; - } - return gdReallocDynamic(dp, dp->logicalSize); -} diff --git a/ext/gd/libgd/gd_io_file.c b/ext/gd/libgd/gd_io_file.c deleted file mode 100644 index 8318a45969a2f..0000000000000 --- a/ext/gd/libgd/gd_io_file.c +++ /dev/null @@ -1,128 +0,0 @@ - -/* - * io_file.c - * - * Implements the file interface. - * - * As will all I/O modules, most functions are for local use only (called - * via function pointers in the I/O context). - * - * Most functions are just 'wrappers' for standard file functions. - * - * Written/Modified 1999, Philip Warner. - * - */ - -/* For platforms with incomplete ANSI defines. Fortunately, - SEEK_SET is defined to be zero by the standard. */ - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif /* SEEK_SET */ - -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -/* this is used for creating images in main memory */ - -typedef struct fileIOCtx -{ - gdIOCtx ctx; - FILE *f; -} fileIOCtx; - -gdIOCtx *newFileCtx (FILE * f); - -static int fileGetbuf (gdIOCtx *, void *, int); -static int filePutbuf (gdIOCtx *, const void *, int); -static void filePutchar (gdIOCtx *, int); -static int fileGetchar (gdIOCtx * ctx); - -static int fileSeek (struct gdIOCtx *, const int); -static long fileTell (struct gdIOCtx *); -static void gdFreeFileCtx (gdIOCtx * ctx); - -/* return data as a dynamic pointer */ -gdIOCtx * gdNewFileCtx (FILE * f) -{ - fileIOCtx *ctx; - - ctx = (fileIOCtx *) gdMalloc(sizeof (fileIOCtx)); - - ctx->f = f; - - ctx->ctx.getC = fileGetchar; - ctx->ctx.putC = filePutchar; - - ctx->ctx.getBuf = fileGetbuf; - ctx->ctx.putBuf = filePutbuf; - - ctx->ctx.tell = fileTell; - ctx->ctx.seek = fileSeek; - - ctx->ctx.gd_free = gdFreeFileCtx; - - return (gdIOCtx *) ctx; -} - -static void gdFreeFileCtx (gdIOCtx * ctx) -{ - gdFree(ctx); -} - - -static int filePutbuf (gdIOCtx * ctx, const void *buf, int size) -{ - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - return fwrite(buf, 1, size, fctx->f); - -} - -static int fileGetbuf (gdIOCtx * ctx, void *buf, int size) -{ - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - return fread(buf, 1, size, fctx->f); -} - -static void filePutchar (gdIOCtx * ctx, int a) -{ - unsigned char b; - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - b = a; - - putc (b, fctx->f); -} - -static int fileGetchar (gdIOCtx * ctx) -{ - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - return getc (fctx->f); -} - - -static int fileSeek (struct gdIOCtx *ctx, const int pos) -{ - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - return (fseek (fctx->f, pos, SEEK_SET) == 0); -} - -static long fileTell (struct gdIOCtx *ctx) -{ - fileIOCtx *fctx; - fctx = (fileIOCtx *) ctx; - - return ftell (fctx->f); -} diff --git a/ext/gd/libgd/gd_io_ss.c b/ext/gd/libgd/gd_io_ss.c deleted file mode 100644 index 0275cdc403303..0000000000000 --- a/ext/gd/libgd/gd_io_ss.c +++ /dev/null @@ -1,138 +0,0 @@ - -/* - * io_ss.c - * - * Implements the Source/Sink interface. - * - * As will all I/O modules, most functions are for local use only (called - * via function pointers in the I/O context). - * - * The Source/Sink model is the primary 'user' interface for alternate data - * sources; the IOCtx interface is intended (at least in version 1.5) to be - * used internally until it settles down a bit. - * - * This module just layers the Source/Sink interface on top of the IOCtx; no - * support is provided for tell/seek, so GD2 writing is not possible, and - * retrieving parts of GD2 files is also not possible. - * - * A new SS context does not need to be created with both a Source and a Sink. - * - * Written/Modified 1999, Philip Warner. - * - */ - -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -/* this is used for creating images in main memory */ - -typedef struct ssIOCtx -{ - gdIOCtx ctx; - gdSourcePtr src; - gdSinkPtr snk; -} ssIOCtx; - -typedef struct ssIOCtx *ssIOCtxPtr; - -gdIOCtx *gdNewSSCtx (gdSourcePtr src, gdSinkPtr snk); - -static int sourceGetbuf (gdIOCtx *, void *, int); -static int sourceGetchar (gdIOCtx * ctx); -static int sinkPutbuf (gdIOCtx * ctx, const void *buf, int size); -static void sinkPutchar (gdIOCtx * ctx, int a); -static void gdFreeSsCtx (gdIOCtx * ctx); - -/* return data as a dynamic pointer */ -gdIOCtx * gdNewSSCtx (gdSourcePtr src, gdSinkPtr snk) -{ - ssIOCtxPtr ctx; - - ctx = (ssIOCtxPtr) gdMalloc (sizeof (ssIOCtx)); - - ctx->src = src; - ctx->snk = snk; - - ctx->ctx.getC = sourceGetchar; - ctx->ctx.getBuf = sourceGetbuf; - - ctx->ctx.putC = sinkPutchar; - ctx->ctx.putBuf = sinkPutbuf; - - ctx->ctx.tell = NULL; - ctx->ctx.seek = NULL; - - ctx->ctx.gd_free = gdFreeSsCtx; - - return (gdIOCtx *) ctx; -} - -static void gdFreeSsCtx (gdIOCtx * ctx) -{ - gdFree(ctx); -} - - -static int sourceGetbuf (gdIOCtx * ctx, void *buf, int size) -{ - ssIOCtx *lctx; - int res; - - lctx = (ssIOCtx *) ctx; - - res = ((lctx->src->source) (lctx->src->context, buf, size)); - - /* - * Translate the return values from the Source object: - * 0 is EOF, -1 is error - */ - - if (res == 0) { - return EOF; - } else if (res < 0) { - return 0; - } else { - return res; - } -} - -static int sourceGetchar (gdIOCtx * ctx) -{ - int res; - unsigned char buf; - - res = sourceGetbuf (ctx, &buf, 1); - - if (res == 1) { - return buf; - } else { - return EOF; - } -} - -static int sinkPutbuf (gdIOCtx * ctx, const void *buf, int size) -{ - ssIOCtxPtr lctx; - int res; - - lctx = (ssIOCtx *) ctx; - - res = (lctx->snk->sink) (lctx->snk->context, buf, size); - - if (res <= 0) { - return 0; - } else { - return res; - } -} - -static void sinkPutchar (gdIOCtx * ctx, int a) -{ - unsigned char b; - - b = a; - sinkPutbuf (ctx, &b, 1); -} diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c deleted file mode 100644 index a276fe8539dfa..0000000000000 --- a/ext/gd/libgd/gd_jpeg.c +++ /dev/null @@ -1,763 +0,0 @@ -/* - * gd_jpeg.c: Read and write JPEG (JFIF) format image files using the - * gd graphics library (http://www.boutell.com/gd/). - * - * This software is based in part on the work of the Independent JPEG - * Group. For more information on the IJG JPEG software (and JPEG - * documentation, etc.), see ftp://ftp.uu.net/graphics/jpeg/. - * - * NOTE: IJG 12-bit JSAMPLE (BITS_IN_JSAMPLE == 12) mode is not - * supported at all on read in gd 2.0, and is not supported on write - * except for palette images, which is sort of pointless (TBB). Even that - * has never been tested according to DB. - * - * Copyright 2000 Doug Becker, mailto:thebeckers@home.com - * - * Modification 4/18/00 TBB: JPEG_DEBUG rather than just DEBUG, - * so VC++ builds don't spew to standard output, causing - * major CGI brain damage - * - * 2.0.10: more efficient gdImageCreateFromJpegCtx, thanks to - * Christian Aberger - */ - -#include -#include -#include -#include -#include - -#include "gd.h" -/* TBB: move this up so include files are not brought in */ -/* JCE: arrange HAVE_LIBJPEG so that it can be set in gd.h */ -#ifdef HAVE_LIBJPEG -#include "gdhelpers.h" -#undef HAVE_STDLIB_H - -/* 1.8.1: remove dependency on jinclude.h */ -#include "jpeglib.h" -#include "jerror.h" - -static const char *const GD_JPEG_VERSION = "1.0"; - -typedef struct _jmpbuf_wrapper -{ - jmp_buf jmpbuf; -} jmpbuf_wrapper; - -/* Called by the IJG JPEG library upon encountering a fatal error */ -static void fatal_jpeg_error (j_common_ptr cinfo) -{ - jmpbuf_wrapper *jmpbufw; - - php_gd_error("gd-jpeg: JPEG library reports unrecoverable error: "); - (*cinfo->err->output_message) (cinfo); - - jmpbufw = (jmpbuf_wrapper *) cinfo->client_data; - jpeg_destroy (cinfo); - - if (jmpbufw != 0) { - longjmp (jmpbufw->jmpbuf, 1); - php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: longjmp returned control; terminating"); - } else { - php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: jmpbuf unrecoverable; terminating"); - } - - exit (99); -} - -/* - * Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality - * QUALITY. If QUALITY is in the range 0-100, increasing values - * represent higher quality but also larger image size. If QUALITY is - * negative, the IJG JPEG library's default quality is used (which - * should be near optimal for many applications). See the IJG JPEG - * library documentation for more details. - */ - -void gdImageJpeg (gdImagePtr im, FILE * outFile, int quality) -{ - gdIOCtx *out = gdNewFileCtx (outFile); - gdImageJpegCtx (im, out, quality); - out->gd_free (out); -} - -void *gdImageJpegPtr (gdImagePtr im, int *size, int quality) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx (2048, NULL); - gdImageJpegCtx (im, out, quality); - rv = gdDPExtractData (out, size); - out->gd_free (out); - - return rv; -} - -void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile); - -void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality) -{ - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - int i, j, jidx; - /* volatile so we can gdFree it on return from longjmp */ - volatile JSAMPROW row = 0; - JSAMPROW rowptr[1]; - jmpbuf_wrapper jmpbufw; - JDIMENSION nlines; - char comment[255]; - - memset (&cinfo, 0, sizeof (cinfo)); - memset (&jerr, 0, sizeof (jerr)); - - cinfo.err = jpeg_std_error (&jerr); - cinfo.client_data = &jmpbufw; - if (setjmp (jmpbufw.jmpbuf) != 0) { - /* we're here courtesy of longjmp */ - if (row) { - gdFree (row); - } - return; - } - - cinfo.err->error_exit = fatal_jpeg_error; - - jpeg_create_compress (&cinfo); - - cinfo.image_width = im->sx; - cinfo.image_height = im->sy; - cinfo.input_components = 3; /* # of color components per pixel */ - cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ - jpeg_set_defaults (&cinfo); - if (quality >= 0) { - jpeg_set_quality (&cinfo, quality, TRUE); - } - - /* If user requests interlace, translate that to progressive JPEG */ - if (gdImageGetInterlaced (im)) { - jpeg_simple_progression (&cinfo); - } - - jpeg_gdIOCtx_dest (&cinfo, outfile); - - row = (JSAMPROW) safe_emalloc(cinfo.image_width * cinfo.input_components, sizeof(JSAMPLE), 0); - memset(row, 0, cinfo.image_width * cinfo.input_components * sizeof(JSAMPLE)); - rowptr[0] = row; - - jpeg_start_compress (&cinfo, TRUE); - - if (quality >= 0) { - snprintf(comment, sizeof(comment)-1, "CREATOR: gd-jpeg v%s (using IJG JPEG v%d), quality = %d\n", GD_JPEG_VERSION, JPEG_LIB_VERSION, quality); - } else { - snprintf(comment, sizeof(comment)-1, "CREATOR: gd-jpeg v%s (using IJG JPEG v%d), default quality\n", GD_JPEG_VERSION, JPEG_LIB_VERSION); - } - jpeg_write_marker (&cinfo, JPEG_COM, (unsigned char *) comment, (unsigned int) strlen (comment)); - if (im->trueColor) { - -#if BITS_IN_JSAMPLE == 12 - php_gd_error("gd-jpeg: error: jpeg library was compiled for 12-bit precision. This is mostly useless, because JPEGs on the web are 8-bit and such versions of the jpeg library won't read or write them. GD doesn't support these unusual images. Edit your jmorecfg.h file to specify the correct precision and completely 'make clean' and 'make install' libjpeg again. Sorry"); - goto error; -#endif /* BITS_IN_JSAMPLE == 12 */ - - for (i = 0; i < im->sy; i++) { - for (jidx = 0, j = 0; j < im->sx; j++) { - int val = im->tpixels[i][j]; - - row[jidx++] = gdTrueColorGetRed (val); - row[jidx++] = gdTrueColorGetGreen (val); - row[jidx++] = gdTrueColorGetBlue (val); - } - - nlines = jpeg_write_scanlines (&cinfo, rowptr, 1); - if (nlines != 1) { - php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1", nlines); - } - } - } else { - for (i = 0; i < im->sy; i++) { - for (jidx = 0, j = 0; j < im->sx; j++) { - int idx = im->pixels[i][j]; - - /* NB: Although gd RGB values are ints, their max value is - * 255 (see the documentation for gdImageColorAllocate()) - * -- perfect for 8-bit JPEG encoding (which is the norm) - */ -#if BITS_IN_JSAMPLE == 8 - row[jidx++] = im->red[idx]; - row[jidx++] = im->green[idx]; - row[jidx++] = im->blue[idx]; -#elif BITS_IN_JSAMPLE == 12 - row[jidx++] = im->red[idx] << 4; - row[jidx++] = im->green[idx] << 4; - row[jidx++] = im->blue[idx] << 4; -#else -#error IJG JPEG library BITS_IN_JSAMPLE value must be 8 or 12 -#endif - } - - nlines = jpeg_write_scanlines (&cinfo, rowptr, 1); - if (nlines != 1) { - php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1", nlines); - } - } - } - - jpeg_finish_compress (&cinfo); - jpeg_destroy_compress (&cinfo); - gdFree (row); -} - -gdImagePtr gdImageCreateFromJpeg (FILE * inFile) -{ - gdImagePtr im; - gdIOCtx *in = gdNewFileCtx(inFile); - im = gdImageCreateFromJpegCtx(in); - in->gd_free (in); - - return im; -} - -gdImagePtr gdImageCreateFromJpegPtr (int size, void *data) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromJpegCtx(in); - in->gd_free(in); - - return im; -} - -void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile); - -static int CMYKToRGB(int c, int m, int y, int k, int inverted); - -/* - * Create a gd-format image from the JPEG-format INFILE. Returns the - * image, or NULL upon error. - */ -gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile) -{ - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - jmpbuf_wrapper jmpbufw; - /* volatile so we can gdFree them after longjmp */ - volatile JSAMPROW row = 0; - volatile gdImagePtr im = 0; - JSAMPROW rowptr[1]; - unsigned int i, j; - int retval; - JDIMENSION nrows; - int channels = 3; - int inverted = 0; - - memset (&cinfo, 0, sizeof (cinfo)); - memset (&jerr, 0, sizeof (jerr)); - - cinfo.err = jpeg_std_error (&jerr); - cinfo.client_data = &jmpbufw; - if (setjmp (jmpbufw.jmpbuf) != 0) { - /* we're here courtesy of longjmp */ - if (row) { - gdFree (row); - } - if (im) { - gdImageDestroy (im); - } - return 0; - } - - cinfo.err->error_exit = fatal_jpeg_error; - - jpeg_create_decompress (&cinfo); - - jpeg_gdIOCtx_src (&cinfo, infile); - - /* 2.0.22: save the APP14 marker to check for Adobe Photoshop CMYK files with inverted components. */ - jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 256); - - retval = jpeg_read_header (&cinfo, TRUE); - if (retval != JPEG_HEADER_OK) { - php_gd_error_ex(E_WARNING, "gd-jpeg: warning: jpeg_read_header returned %d, expected %d", retval, JPEG_HEADER_OK); - } - - if (cinfo.image_height > INT_MAX) { - php_gd_error_ex(E_WARNING, "gd-jpeg: warning: JPEG image height (%u) is greater than INT_MAX (%d) (and thus greater than gd can handle)", cinfo.image_height, INT_MAX); - } - - if (cinfo.image_width > INT_MAX) { - php_gd_error_ex(E_WARNING, "gd-jpeg: warning: JPEG image width (%u) is greater than INT_MAX (%d) (and thus greater than gd can handle)", cinfo.image_width, INT_MAX); - } - - im = gdImageCreateTrueColor ((int) cinfo.image_width, (int) cinfo.image_height); - if (im == 0) { - php_gd_error("gd-jpeg error: cannot allocate gdImage struct"); - goto error; - } - - /* 2.0.22: very basic support for reading CMYK colorspace files. Nice for - * thumbnails but there's no support for fussy adjustment of the - * assumed properties of inks and paper. */ - if ((cinfo.jpeg_color_space == JCS_CMYK) || (cinfo.jpeg_color_space == JCS_YCCK)) { - cinfo.out_color_space = JCS_CMYK; - } else { - cinfo.out_color_space = JCS_RGB; - } - - if (jpeg_start_decompress (&cinfo) != TRUE) { - php_gd_error("gd-jpeg: warning: jpeg_start_decompress reports suspended data source"); - } - - /* REMOVED by TBB 2/12/01. This field of the structure is - * documented as private, and sure enough it's gone in the - * latest libjpeg, replaced by something else. Unfortunately - * there is still no right way to find out if the file was - * progressive or not; just declare your intent before you - * write one by calling gdImageInterlace(im, 1) yourself. - * After all, we're not really supposed to rework JPEGs and - * write them out again anyway. Lossy compression, remember? - */ -#if 0 - gdImageInterlace (im, cinfo.progressive_mode != 0); -#endif - - if (cinfo.out_color_space == JCS_RGB) { - if (cinfo.output_components != 3) { - php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3 for RGB)", cinfo.output_components); - goto error; - } - channels = 3; - } else if (cinfo.out_color_space == JCS_CMYK) { - jpeg_saved_marker_ptr marker; - if (cinfo.output_components != 4) { - php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 4 for CMYK)", cinfo.output_components); - goto error; - } - channels = 4; - marker = cinfo.marker_list; - while (marker) { - if ((marker->marker == (JPEG_APP0 + 14)) && (marker->data_length >= 12) && (!strncmp((const char *) marker->data, "Adobe", 5))) { - inverted = 1; - break; - } - marker = marker->next; - } - } else { - php_gd_error_ex(E_WARNING, "gd-jpeg: error: unexpected colorspace."); - goto error; - } - -#if BITS_IN_JSAMPLE == 12 - php_gd_error("gd-jpeg: error: jpeg library was compiled for 12-bit precision. This is mostly useless, because JPEGs on the web are 8-bit and such versions of the jpeg library won't read or write them. GD doesn't support these unusual images. Edit your jmorecfg.h file to specify the correct precision and completely 'make clean' and 'make install' libjpeg again. Sorry."); - goto error; -#endif /* BITS_IN_JSAMPLE == 12 */ - - row = safe_emalloc(cinfo.output_width * channels, sizeof(JSAMPLE), 0); - memset(row, 0, cinfo.output_width * channels * sizeof(JSAMPLE)); - rowptr[0] = row; - - if (cinfo.out_color_space == JCS_CMYK) { - for (i = 0; i < cinfo.output_height; i++) { - register JSAMPROW currow = row; - register int *tpix = im->tpixels[i]; - nrows = jpeg_read_scanlines (&cinfo, rowptr, 1); - if (nrows != 1) { - php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows); - goto error; - } - for (j = 0; j < cinfo.output_width; j++, currow += 4, tpix++) { - *tpix = CMYKToRGB (currow[0], currow[1], currow[2], currow[3], inverted); - } - } - } else { - for (i = 0; i < cinfo.output_height; i++) { - register JSAMPROW currow = row; - register int *tpix = im->tpixels[i]; - nrows = jpeg_read_scanlines (&cinfo, rowptr, 1); - if (nrows != 1) { - php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows); - goto error; - } - for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) { - *tpix = gdTrueColor (currow[0], currow[1], currow[2]); - } - } - } - - if (jpeg_finish_decompress (&cinfo) != TRUE) { - php_gd_error("gd-jpeg: warning: jpeg_finish_decompress reports suspended data source"); - } - - /* Thanks to Truxton Fulton */ - if (cinfo.err->num_warnings > 0) { - goto error; - } - - jpeg_destroy_decompress (&cinfo); - gdFree (row); - - return im; - -error: - jpeg_destroy_decompress (&cinfo); - if (row) { - gdFree (row); - } - if (im) { - gdImageDestroy (im); - } - return 0; -} - -/* A very basic conversion approach, TBB */ -static int CMYKToRGB(int c, int m, int y, int k, int inverted) -{ - if (inverted) { - c = 255 - c; - m = 255 - m; - y = 255 - y; - k = 255 - k; - } - return gdTrueColor((255 - c) * (255 - k) / 255, (255 - m) * (255 - k) / 255, (255 - y) * (255 - k) / 255); -} - -/* - * gdIOCtx JPEG data sources and sinks, T. Boutell - * almost a simple global replace from T. Lane's stdio versions. - * - */ - -/* Different versions of libjpeg use either 'jboolean' or 'boolean', and - some platforms define 'boolean', and so forth. Deal with this - madness by typedeffing 'safeboolean' to 'boolean' if HAVE_BOOLEAN - is already set, because this is the test that libjpeg uses. - Otherwise, typedef it to int, because that's what libjpeg does - if HAVE_BOOLEAN is not defined. -TBB */ - -#ifdef HAVE_BOOLEAN -typedef boolean safeboolean; -#else -typedef int safeboolean; -#endif /* HAVE_BOOLEAN */ - -/* Expanded data source object for gdIOCtx input */ - -typedef struct -{ - struct jpeg_source_mgr pub; /* public fields */ - - gdIOCtx *infile; /* source stream */ - unsigned char *buffer; /* start of buffer */ - safeboolean start_of_file; /* have we gotten any data yet? */ -} my_source_mgr; - -typedef my_source_mgr *my_src_ptr; - -#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ - -/* - * Initialize source --- called by jpeg_read_header - * before any data is actually read. - */ - -void init_source (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - - /* We reset the empty-input-file flag for each image, - * but we don't clear the input buffer. - * This is correct behavior for reading a series of images from one source. - */ - src->start_of_file = TRUE; -} - - -/* - * Fill the input buffer --- called whenever buffer is emptied. - * - * In typical applications, this should read fresh data into the buffer - * (ignoring the current state of next_input_byte & bytes_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been reloaded. It is not necessary to - * fill the buffer entirely, only to obtain at least one more byte. - * - * There is no such thing as an EOF return. If the end of the file has been - * reached, the routine has a choice of ERREXIT() or inserting fake data into - * the buffer. In most cases, generating a warning message and inserting a - * fake EOI marker is the best course of action --- this will allow the - * decompressor to output however much of the image is there. However, - * the resulting error message is misleading if the real problem is an empty - * input file, so we handle that case specially. - * - * In applications that need to be able to suspend compression due to input - * not being available yet, a FALSE return indicates that no more data can be - * obtained right now, but more may be forthcoming later. In this situation, - * the decompressor will return to its caller (with an indication of the - * number of scanlines it has read, if any). The application should resume - * decompression after it has loaded more data into the input buffer. Note - * that there are substantial restrictions on the use of suspension --- see - * the documentation. - * - * When suspending, the decompressor will back up to a convenient restart point - * (typically the start of the current MCU). next_input_byte & bytes_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point must be rescanned after resumption, so move it to - * the front of the buffer rather than discarding it. - */ - -#define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n" - -safeboolean fill_input_buffer (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - /* 2.0.12: signed size. Thanks to Geert Jansen */ - ssize_t nbytes = 0; - - /* ssize_t got; */ - /* char *s; */ - memset(src->buffer, 0, INPUT_BUF_SIZE); - - while (nbytes < INPUT_BUF_SIZE) { - int got = gdGetBuf(src->buffer + nbytes, INPUT_BUF_SIZE - nbytes, src->infile); - - if (got == EOF || got == 0) { - /* EOF or error. If we got any data, don't worry about it. If we didn't, then this is unexpected. */ - if (!nbytes) { - nbytes = -1; - } - break; - } - nbytes += got; - } - - if (nbytes <= 0) { - if (src->start_of_file) { /* Treat empty input file as fatal error */ - ERREXIT (cinfo, JERR_INPUT_EMPTY); - } - WARNMS (cinfo, JWRN_JPEG_EOF); - /* Insert a fake EOI marker */ - src->buffer[0] = (unsigned char) 0xFF; - src->buffer[1] = (unsigned char) JPEG_EOI; - nbytes = 2; - } - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; - - return TRUE; -} - - -/* - * Skip data --- used to skip over a potentially large amount of - * uninteresting data (such as an APPn marker). - * - * Writers of suspendable-input applications must note that skip_input_data - * is not granted the right to give a suspension return. If the skip extends - * beyond the data currently in the buffer, the buffer can be marked empty so - * that the next read will cause a fill_input_buffer call that can suspend. - * Arranging for additional bytes to be discarded before reloading the input - * buffer is the application writer's problem. - */ - -void skip_input_data (j_decompress_ptr cinfo, long num_bytes) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - - /* Just a dumb implementation for now. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. - */ - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - (void) fill_input_buffer (cinfo); - /* note we assume that fill_input_buffer will never return FALSE, - * so suspension need not be handled. - */ - } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - - -/* - * An additional method that can be provided by data source modules is the - * resync_to_restart method for error recovery in the presence of RST markers. - * For the moment, this source module just uses the default resync method - * provided by the JPEG library. That method assumes that no backtracking - * is possible. - */ - - -/* - * Terminate source --- called by jpeg_finish_decompress - * after all data has been read. Often a no-op. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -void term_source (j_decompress_ptr cinfo) -{ -#if 0 - * never used */ - my_src_ptr src = (my_src_ptr) cinfo->src; -#endif -} - - -/* - * Prepare for input from a gdIOCtx stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing decompression. - */ - -void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile) -{ - my_src_ptr src; - - /* The source object and input buffer are made permanent so that a series - * of JPEG images can be read from the same file by calling jpeg_gdIOCtx_src - * only before the first one. (If we discarded the buffer at the end of - * one image, we'd likely lose the start of the next one.) - * This makes it unsafe to use this manager and a different source - * manager serially with the same JPEG object. Caveat programmer. - */ - if (cinfo->src == NULL) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (my_source_mgr)); - src = (my_src_ptr) cinfo->src; - src->buffer = (unsigned char *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof (unsigned char)); - - } - - src = (my_src_ptr) cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = term_source; - src->infile = infile; - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->pub.next_input_byte = NULL; /* until buffer loaded */ -} - -/* Expanded data destination object for stdio output */ - -typedef struct -{ - struct jpeg_destination_mgr pub; /* public fields */ - gdIOCtx *outfile; /* target stream */ - unsigned char *buffer; /* start of buffer */ -} my_destination_mgr; - -typedef my_destination_mgr *my_dest_ptr; - -#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ - -/* - * Initialize destination --- called by jpeg_start_compress - * before any data is actually written. - */ - -void init_destination (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - - /* Allocate the output buffer --- it will be released when done with image */ - dest->buffer = (unsigned char *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * sizeof (unsigned char)); - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; -} - - -/* - * Empty the output buffer --- called whenever buffer fills up. - * - * In typical applications, this should write the entire output buffer - * (ignoring the current state of next_output_byte & free_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been dumped. - * - * In applications that need to be able to suspend compression due to output - * overrun, a FALSE return indicates that the buffer cannot be emptied now. - * In this situation, the compressor will return to its caller (possibly with - * an indication that it has not accepted all the supplied scanlines). The - * application should resume compression after it has made more room in the - * output buffer. Note that there are substantial restrictions on the use of - * suspension --- see the documentation. - * - * When suspending, the compressor will back up to a convenient restart point - * (typically the start of the current MCU). next_output_byte & free_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point will be regenerated after resumption, so do not - * write it out when emptying the buffer externally. - */ - -safeboolean empty_output_buffer (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - - if (gdPutBuf (dest->buffer, OUTPUT_BUF_SIZE, dest->outfile) != (size_t) OUTPUT_BUF_SIZE) { - ERREXIT (cinfo, JERR_FILE_WRITE); - } - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - - return TRUE; -} - - -/* - * Terminate destination --- called by jpeg_finish_compress - * after all data has been written. Usually needs to flush buffer. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -void term_destination (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; - - /* Write any data remaining in the buffer */ - if (datacount > 0 && ((size_t)gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)) { - ERREXIT (cinfo, JERR_FILE_WRITE); - } -} - - -/* - * Prepare for output to a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing compression. - */ - -void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile) -{ - my_dest_ptr dest; - - /* The destination object is made permanent so that multiple JPEG images - * can be written to the same file without re-executing jpeg_stdio_dest. - * This makes it dangerous to use this manager and a different destination - * manager serially with the same JPEG object, because their private object - * sizes may be different. Caveat programmer. - */ - if (cinfo->dest == NULL) { /* first time for this JPEG object? */ - cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (my_destination_mgr)); - } - - dest = (my_dest_ptr) cinfo->dest; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; - dest->outfile = outfile; -} - -#endif /* HAVE_JPEG */ diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c deleted file mode 100644 index f57f7c4b24ab4..0000000000000 --- a/ext/gd/libgd/gd_png.c +++ /dev/null @@ -1,706 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" - -/* JCE: Arrange HAVE_LIBPNG so that it can be set in gd.h */ -#ifdef HAVE_LIBPNG - -#include "png.h" /* includes zlib.h and setjmp.h */ -#include "gdhelpers.h" - -#define TRUE 1 -#define FALSE 0 - -/*--------------------------------------------------------------------------- - - gd_png.c Copyright 1999 Greg Roelofs and Thomas Boutell - - The routines in this file, gdImagePng*() and gdImageCreateFromPng*(), - are drop-in replacements for gdImageGif*() and gdImageCreateFromGif*(), - except that these functions are noisier in the case of errors (comment - out all fprintf() statements to disable that). - - GD 2.0 supports RGBA truecolor and will read and write truecolor PNGs. - GD 2.0 supports 8 bits of color resolution per channel and - 7 bits of alpha channel resolution. Images with more than 8 bits - per channel are reduced to 8 bits. Images with an alpha channel are - only able to resolve down to '1/128th opaque' instead of '1/256th', - and this conversion is also automatic. I very much doubt you can see it. - Both tRNS and true alpha are supported. - - Gamma is ignored, and there is no support for text annotations. - - Last updated: 9 February 2001 - - ---------------------------------------------------------------------------*/ - -#ifndef PNG_SETJMP_NOT_SUPPORTED -typedef struct _jmpbuf_wrapper -{ - jmp_buf jmpbuf; -} jmpbuf_wrapper; - -static jmpbuf_wrapper gdPngJmpbufStruct; - -static void gdPngErrorHandler (png_structp png_ptr, png_const_charp msg) -{ - jmpbuf_wrapper *jmpbuf_ptr; - - /* This function, aside from the extra step of retrieving the "error - * pointer" (below) and the fact that it exists within the application - * rather than within libpng, is essentially identical to libpng's - * default error handler. The second point is critical: since both - * setjmp() and longjmp() are called from the same code, they are - * guaranteed to have compatible notions of how big a jmp_buf is, - * regardless of whether _BSD_SOURCE or anything else has (or has not) - * been defined. - */ - - php_gd_error_ex(E_ERROR, "gd-png: fatal libpng error: %s", msg); - - jmpbuf_ptr = png_get_error_ptr (png_ptr); - if (jmpbuf_ptr == NULL) { /* we are completely hosed now */ - php_gd_error_ex(E_ERROR, "gd-png: EXTREMELY fatal error: jmpbuf unrecoverable; terminating."); - } - - longjmp (jmpbuf_ptr->jmpbuf, 1); -} -#endif - -static void gdPngReadData (png_structp png_ptr, png_bytep data, png_size_t length) -{ - gdGetBuf(data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); -} - -static void gdPngWriteData (png_structp png_ptr, png_bytep data, png_size_t length) -{ - gdPutBuf (data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); -} - -static void gdPngFlushData (png_structp png_ptr) -{ -} - -gdImagePtr gdImageCreateFromPng (FILE * inFile) -{ - gdImagePtr im; - gdIOCtx *in = gdNewFileCtx(inFile); - im = gdImageCreateFromPngCtx(in); - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromPngPtr (int size, void *data) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromPngCtx(in); - in->gd_free(in); - return im; -} - -/* This routine is based in part on the Chapter 13 demo code in "PNG: The - * Definitive Guide" (http://www.cdrom.com/pub/png/pngbook.html). - */ -gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) -{ - png_byte sig[8]; - png_structp png_ptr; - png_infop info_ptr; - png_uint_32 width, height, rowbytes, w, h; - int bit_depth, color_type, interlace_type; - int num_palette, num_trans; - png_colorp palette; - png_color_16p trans_gray_rgb; - png_color_16p trans_color_rgb; - png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; - gdImagePtr im = NULL; - int i, j, *open = NULL; - volatile int transparent = -1; - volatile int palette_allocated = FALSE; - - /* Make sure the signature can't match by dumb luck -- TBB */ - /* GRR: isn't sizeof(infile) equal to the size of the pointer? */ - memset (infile, 0, sizeof(infile)); - - /* first do a quick check that the file really is a PNG image; could - * have used slightly more general png_sig_cmp() function instead - */ - gdGetBuf(sig, 8, infile); - if (!png_check_sig (sig, 8)) { /* bad signature */ - return NULL; - } - -#ifndef PNG_SETJMP_NOT_SUPPORTED - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, &gdPngJmpbufStruct, gdPngErrorHandler, NULL); -#else - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -#endif - if (png_ptr == NULL) { - php_gd_error("gd-png error: cannot allocate libpng main struct"); - return NULL; - } - - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - php_gd_error("gd-png error: cannot allocate libpng info struct"); - png_destroy_read_struct (&png_ptr, NULL, NULL); - - return NULL; - } - - /* we could create a second info struct here (end_info), but it's only - * useful if we want to keep pre- and post-IDAT chunk info separated - * (mainly for PNG-aware image editors and converters) - */ - - /* setjmp() must be called in every non-callback function that calls a - * PNG-reading libpng function - */ -#ifndef PNG_SETJMP_NOT_SUPPORTED - if (setjmp(gdPngJmpbufStruct.jmpbuf)) { - php_gd_error("gd-png error: setjmp returns error condition"); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - - return NULL; - } -#endif - - png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ - - png_set_read_fn(png_ptr, (void *) infile, gdPngReadData); - png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ - - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL); - if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA)) { - im = gdImageCreateTrueColor((int) width, (int) height); - } else { - im = gdImageCreate((int) width, (int) height); - } - if (im == NULL) { - php_gd_error("gd-png error: cannot allocate gdImage struct"); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - gdFree(image_data); - gdFree(row_pointers); - - return NULL; - } - - if (bit_depth == 16) { - png_set_strip_16(png_ptr); - } else if (bit_depth < 8) { - png_set_packing (png_ptr); /* expand to 1 byte per pixel */ - } - - switch (color_type) { - case PNG_COLOR_TYPE_PALETTE: - png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); -#ifdef DEBUG - php_gd_error("gd-png color_type is palette, colors: %d", num_palette); -#endif /* DEBUG */ - if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { - /* gd 2.0: we support this rather thoroughly now. Grab the - * first fully transparent entry, if any, as the value of - * the simple-transparency index, mostly for backwards - * binary compatibility. The alpha channel is where it's - * really at these days. - */ - int firstZero = 1; - png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL); - for (i = 0; i < num_trans; ++i) { - im->alpha[i] = gdAlphaMax - (trans[i] >> 1); - if ((trans[i] == 0) && (firstZero)) { - transparent = i; - firstZero = 0; - } - } - } - break; - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_GRAY_ALPHA: - /* create a fake palette and check for single-shade transparency */ - if ((palette = (png_colorp) gdMalloc (256 * sizeof (png_color))) == NULL) { - php_gd_error("gd-png error: cannot allocate gray palette"); - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - - return NULL; - } - palette_allocated = TRUE; - if (bit_depth < 8) { - num_palette = 1 << bit_depth; - for (i = 0; i < 256; ++i) { - j = (255 * i) / (num_palette - 1); - palette[i].red = palette[i].green = palette[i].blue = j; - } - } else { - num_palette = 256; - for (i = 0; i < 256; ++i) { - palette[i].red = palette[i].green = palette[i].blue = i; - } - } - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_gray_rgb); - if (bit_depth == 16) { /* png_set_strip_16() not yet in effect */ - transparent = trans_gray_rgb->gray >> 8; - } else { - transparent = trans_gray_rgb->gray; - } - /* Note slight error in 16-bit case: up to 256 16-bit shades - * may get mapped to a single 8-bit shade, and only one of them - * is supposed to be transparent. IOW, both opaque pixels and - * transparent pixels will be mapped into the transparent entry. - * There is no particularly good way around this in the case - * that all 256 8-bit shades are used, but one could write some - * custom 16-bit code to handle the case where there are gdFree - * palette entries. This error will be extremely rare in - * general, though. (Quite possibly there is only one such - * image in existence.) - */ - } - break; - - case PNG_COLOR_TYPE_RGB: - case PNG_COLOR_TYPE_RGB_ALPHA: - /* gd 2.0: we now support truecolor. See the comment above - * for a rare situation in which the transparent pixel may not - * work properly with 16-bit channels. - */ - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_color_rgb); - if (bit_depth == 16) { /* png_set_strip_16() not yet in effect */ - transparent = gdTrueColor(trans_color_rgb->red >> 8, - trans_color_rgb->green >> 8, - trans_color_rgb->blue >> 8); - } else { - transparent = gdTrueColor(trans_color_rgb->red, - trans_color_rgb->green, - trans_color_rgb->blue); - } - } - break; - } - - png_read_update_info(png_ptr, info_ptr); - - /* allocate space for the PNG image data */ - rowbytes = png_get_rowbytes(png_ptr, info_ptr); - image_data = (png_bytep) safe_emalloc(rowbytes, height, 0); - - row_pointers = (png_bytepp) safe_emalloc(height, sizeof(png_bytep), 0); - - /* set the individual row_pointers to point at the correct offsets */ - for (h = 0; h < height; ++h) { - row_pointers[h] = image_data + h * rowbytes; - } - - png_read_image(png_ptr, row_pointers); /* read whole image... */ - png_read_end(png_ptr, NULL); /* ...done! */ - - if (!im->trueColor) { - im->colorsTotal = num_palette; - /* load the palette and mark all entries "open" (unused) for now */ - open = im->open; - for (i = 0; i < num_palette; ++i) { - im->red[i] = palette[i].red; - im->green[i] = palette[i].green; - im->blue[i] = palette[i].blue; - open[i] = 1; - } - for (i = num_palette; i < gdMaxColors; ++i) { - open[i] = 1; - } - } - /* 2.0.12: Slaven Rezic: palette images are not the only images - * with a simple transparent color setting. - */ - im->transparent = transparent; - im->interlace = (interlace_type == PNG_INTERLACE_ADAM7); - - /* can't nuke structs until done with palette */ - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - switch (color_type) { - case PNG_COLOR_TYPE_RGB: - for (h = 0; h < height; h++) { - int boffset = 0; - for (w = 0; w < width; w++) { - register png_byte r = row_pointers[h][boffset++]; - register png_byte g = row_pointers[h][boffset++]; - register png_byte b = row_pointers[h][boffset++]; - im->tpixels[h][w] = gdTrueColor (r, g, b); - } - } - break; - - case PNG_COLOR_TYPE_RGB_ALPHA: - for (h = 0; h < height; h++) { - int boffset = 0; - for (w = 0; w < width; w++) { - register png_byte r = row_pointers[h][boffset++]; - register png_byte g = row_pointers[h][boffset++]; - register png_byte b = row_pointers[h][boffset++]; - - /* gd has only 7 bits of alpha channel resolution, and - * 127 is transparent, 0 opaque. A moment of convenience, - * a lifetime of compatibility. - */ - - register png_byte a = gdAlphaMax - (row_pointers[h][boffset++] >> 1); - im->tpixels[h][w] = gdTrueColorAlpha(r, g, b, a); - } - } - break; - - default: - /* Palette image, or something coerced to be one */ - for (h = 0; h < height; ++h) { - for (w = 0; w < width; ++w) { - register png_byte idx = row_pointers[h][w]; - im->pixels[h][w] = idx; - open[idx] = 0; - } - } - } -#ifdef DEBUG - if (!im->trueColor) { - for (i = num_palette; i < gdMaxColors; ++i) { - if (!open[i]) { - php_gd_error("gd-png warning: image data references out-of-range color index (%d)", i); - } - } - } -#endif - - if (palette_allocated) { - gdFree(palette); - } - gdFree(image_data); - gdFree(row_pointers); - - return im; -} - -void gdImagePngEx (gdImagePtr im, FILE * outFile, int level) -{ - gdIOCtx *out = gdNewFileCtx(outFile); - gdImagePngCtxEx(im, out, level); - out->gd_free(out); -} - -void gdImagePng (gdImagePtr im, FILE * outFile) -{ - gdIOCtx *out = gdNewFileCtx(outFile); - gdImagePngCtxEx(im, out, -1); - out->gd_free(out); -} - -void * gdImagePngPtr (gdImagePtr im, int *size) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx(2048, NULL); - gdImagePngCtxEx(im, out, -1); - rv = gdDPExtractData(out, size); - out->gd_free(out); - - return rv; -} - -void * gdImagePngPtrEx (gdImagePtr im, int *size, int level) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx(2048, NULL); - gdImagePngCtxEx(im, out, level); - rv = gdDPExtractData(out, size); - out->gd_free(out); - return rv; -} - -void gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile) -{ - gdImagePngCtxEx(im, outfile, -1); -} - -/* This routine is based in part on code from Dale Lutz (Safe Software Inc.) - * and in part on demo code from Chapter 15 of "PNG: The Definitive Guide" - * (http://www.cdrom.com/pub/png/pngbook.html). - */ -void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level) -{ - int i, j, bit_depth = 0, interlace_type; - int width = im->sx; - int height = im->sy; - int colors = im->colorsTotal; - int *open = im->open; - int mapping[gdMaxColors]; /* mapping[gd_index] == png_index */ - png_byte trans_values[256]; - png_color_16 trans_rgb_value; - png_color palette[gdMaxColors]; - png_structp png_ptr; - png_infop info_ptr; - volatile int transparent = im->transparent; - volatile int remap = FALSE; - -#ifndef PNG_SETJMP_NOT_SUPPORTED - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, &gdPngJmpbufStruct, gdPngErrorHandler, NULL); -#else - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -#endif - if (png_ptr == NULL) { - php_gd_error("gd-png error: cannot allocate libpng main struct"); - return; - } - - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - php_gd_error("gd-png error: cannot allocate libpng info struct"); - png_destroy_write_struct (&png_ptr, (png_infopp) NULL); - - return; - } - -#ifndef PNG_SETJMP_NOT_SUPPORTED - if (setjmp (gdPngJmpbufStruct.jmpbuf)) { - php_gd_error("gd-png error: setjmp returns error condition"); - png_destroy_write_struct (&png_ptr, &info_ptr); - - return; - } -#endif - - png_set_write_fn(png_ptr, (void *) outfile, gdPngWriteData, gdPngFlushData); - - /* This is best for palette images, and libpng defaults to it for - * palette images anyway, so we don't need to do it explicitly. - * What to ideally do for truecolor images depends, alas, on the image. - * gd is intentionally imperfect and doesn't spend a lot of time - * fussing with such things. - */ - - /* png_set_filter(png_ptr, 0, PNG_FILTER_NONE); */ - - /* 2.0.12: this is finally a parameter */ - png_set_compression_level(png_ptr, level); - - /* can set this to a smaller value without compromising compression if all - * image data is 16K or less; will save some decoder memory [min == 8] - */ - - /* png_set_compression_window_bits(png_ptr, 15); */ - - if (!im->trueColor) { - if (transparent >= im->colorsTotal || (transparent >= 0 && open[transparent])) { - transparent = -1; - } - - for (i = 0; i < gdMaxColors; ++i) { - mapping[i] = -1; - } - - /* count actual number of colors used (colorsTotal == high-water mark) */ - colors = 0; - for (i = 0; i < im->colorsTotal; ++i) { - if (!open[i]) { - mapping[i] = colors; - ++colors; - } - } - if (colors < im->colorsTotal) { - remap = TRUE; - } - if (colors <= 2) { - bit_depth = 1; - } else if (colors <= 4) { - bit_depth = 2; - } else if (colors <= 16) { - bit_depth = 4; - } else { - bit_depth = 8; - } - } - - interlace_type = im->interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE; - - if (im->trueColor) { - if (im->saveAlphaFlag) { - png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, interlace_type, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - } else { - png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, interlace_type, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - } - } else { - png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_PALETTE, interlace_type, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - } - - if (im->trueColor && !im->saveAlphaFlag && (transparent >= 0)) { - /* 2.0.9: fixed by Thomas Winzig */ - trans_rgb_value.red = gdTrueColorGetRed (im->transparent); - trans_rgb_value.green = gdTrueColorGetGreen (im->transparent); - trans_rgb_value.blue = gdTrueColorGetBlue (im->transparent); - png_set_tRNS(png_ptr, info_ptr, 0, 0, &trans_rgb_value); - } - - if (!im->trueColor) { - /* Oy veh. Remap the PNG palette to put the entries with interesting alpha channel - * values first. This minimizes the size of the tRNS chunk and thus the size - * of the PNG file as a whole. - */ - - int tc = 0; - int i; - int j; - int k; - - for (i = 0; (i < im->colorsTotal); i++) { - if ((!im->open[i]) && (im->alpha[i] != gdAlphaOpaque)) { - tc++; - } - } - if (tc) { -#if 0 - for (i = 0; (i < im->colorsTotal); i++) { - trans_values[i] = 255 - ((im->alpha[i] << 1) + (im->alpha[i] >> 6)); - } - png_set_tRNS (png_ptr, info_ptr, trans_values, 256, NULL); -#endif - if (!remap) { - remap = TRUE; - } - - /* (Semi-)transparent indexes come up from the bottom of the list of real colors; opaque - * indexes come down from the top - */ - j = 0; - k = colors - 1; - - for (i = 0; i < im->colorsTotal; i++) { - if (!im->open[i]) { - if (im->alpha[i] != gdAlphaOpaque) { - /* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */ - trans_values[j] = 255 - ((im->alpha[i] << 1) + (im->alpha[i] >> 6)); - mapping[i] = j++; - } else { - mapping[i] = k--; - } - } - } - png_set_tRNS(png_ptr, info_ptr, trans_values, tc, NULL); - } - } - - /* convert palette to libpng layout */ - if (!im->trueColor) { - if (remap) { - for (i = 0; i < im->colorsTotal; ++i) { - if (mapping[i] < 0) { - continue; - } - - palette[mapping[i]].red = im->red[i]; - palette[mapping[i]].green = im->green[i]; - palette[mapping[i]].blue = im->blue[i]; - } - } else { - for (i = 0; i < colors; ++i) { - palette[i].red = im->red[i]; - palette[i].green = im->green[i]; - palette[i].blue = im->blue[i]; - } - } - png_set_PLTE(png_ptr, info_ptr, palette, colors); - } - - /* write out the PNG header info (everything up to first IDAT) */ - png_write_info(png_ptr, info_ptr); - - /* make sure < 8-bit images are packed into pixels as tightly as possible */ - png_set_packing(png_ptr); - - /* This code allocates a set of row buffers and copies the gd image data - * into them only in the case that remapping is necessary; in gd 1.3 and - * later, the im->pixels array is laid out identically to libpng's row - * pointers and can be passed to png_write_image() function directly. - * The remapping case could be accomplished with less memory for non- - * interlaced images, but interlacing causes some serious complications. - */ - - if (im->trueColor) { - /* performance optimizations by Phong Tran */ - int channels = im->saveAlphaFlag ? 4 : 3; - /* Our little 7-bit alpha channel trick costs us a bit here. */ - png_bytep *row_pointers; - unsigned char* pOutputRow; - int **ptpixels = im->tpixels; - int *pThisRow; - unsigned char a; - int thisPixel; - png_bytep *prow_pointers; - int saveAlphaFlag = im->saveAlphaFlag; - - row_pointers = safe_emalloc(sizeof(png_bytep), height, 0); - prow_pointers = row_pointers; - for (j = 0; j < height; ++j) { - *prow_pointers = (png_bytep) safe_emalloc(width, channels, 0); - pOutputRow = *prow_pointers++; - pThisRow = *ptpixels++; - for (i = 0; i < width; ++i) { - thisPixel = *pThisRow++; - *pOutputRow++ = gdTrueColorGetRed(thisPixel); - *pOutputRow++ = gdTrueColorGetGreen(thisPixel); - *pOutputRow++ = gdTrueColorGetBlue(thisPixel); - if (saveAlphaFlag) { - /* convert the 7-bit alpha channel to an 8-bit alpha channel. - * We do a little bit-flipping magic, repeating the MSB - * as the LSB, to ensure that 0 maps to 0 and - * 127 maps to 255. We also have to invert to match - * PNG's convention in which 255 is opaque. - */ - a = gdTrueColorGetAlpha(thisPixel); - /* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */ - *pOutputRow++ = 255 - ((a << 1) + (a >> 6)); - } - } - } - - png_write_image(png_ptr, row_pointers); - png_write_end(png_ptr, info_ptr); - - for (j = 0; j < height; ++j) { - gdFree(row_pointers[j]); - } - - gdFree(row_pointers); - } else { - if (remap) { - png_bytep *row_pointers; - row_pointers = safe_emalloc(height, sizeof(png_bytep), 0); - for (j = 0; j < height; ++j) { - row_pointers[j] = (png_bytep) gdMalloc(width); - for (i = 0; i < width; ++i) { - row_pointers[j][i] = mapping[im->pixels[j][i]]; - } - } - - png_write_image(png_ptr, row_pointers); - png_write_end(png_ptr, info_ptr); - - for (j = 0; j < height; ++j) { - gdFree(row_pointers[j]); - } - - gdFree(row_pointers); - } else { - png_write_image(png_ptr, im->pixels); - png_write_end(png_ptr, info_ptr); - } - } - /* 1.6.3: maybe we should give that memory BACK! TBB */ - png_destroy_write_struct(&png_ptr, &info_ptr); -} - -#endif /* HAVE_LIBPNG */ diff --git a/ext/gd/libgd/gd_ss.c b/ext/gd/libgd/gd_ss.c deleted file mode 100644 index 08edea3eca209..0000000000000 --- a/ext/gd/libgd/gd_ss.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include -#include -#include "gd.h" - -#define TRUE 1 -#define FALSE 0 - -/* Exported functions: */ -extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out); -extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource); - -/* Use this for commenting out debug-print statements. */ -/* Just use the first '#define' to allow all the prints... */ -/*#define GD_SS_DBG(s) (s) */ -#define GD_SS_DBG(s) - -#ifdef HAVE_LIBPNG -void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink) -{ - gdIOCtx *out = gdNewSSCtx(NULL, outSink); - gdImagePngCtx(im, out); - out->gd_free(out); -} - -gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource) -{ - gdIOCtx *in = gdNewSSCtx(inSource, NULL); - gdImagePtr im; - - im = gdImageCreateFromPngCtx(in); - - in->gd_free(in); - - return im; -} -#else /* no HAVE_LIBPNG */ -void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink) -{ - php_gd_error("PNG support is not available"); -} -gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource) -{ - php_gd_error("PNG support is not available"); - return NULL; -} -#endif /* HAVE_LIBPNG */ - diff --git a/ext/gd/libgd/gd_topal.c b/ext/gd/libgd/gd_topal.c deleted file mode 100644 index 15eed3e11ee71..0000000000000 --- a/ext/gd/libgd/gd_topal.c +++ /dev/null @@ -1,2122 +0,0 @@ -/* TODO: oim and nim in the lower level functions; - correct use of stub (sigh). */ - -/* 2.0.12: a new adaptation from the same original, this time - by Barend Gehrels. My attempt to incorporate alpha channel - into the result worked poorly and degraded the quality of - palette conversion even when the source contained no - alpha channel data. This version does not attempt to produce - an output file with transparency in some of the palette - indexes, which, in practice, doesn't look so hot anyway. TBB */ - -/* - * gd_topal, adapted from jquant2.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains 2-pass color quantization (color mapping) routines. - * These routines provide selection of a custom color map for an image, - * followed by mapping of the image to that color map, with optional - * Floyd-Steinberg dithering. - * It is also possible to use just the second pass to map to an arbitrary - * externally-given color map. - * - * Note: ordered dithering is not supported, since there isn't any fast - * way to compute intercolor distances; it's unclear that ordered dither's - * fundamental assumptions even hold with an irregularly spaced color map. - */ - -#ifdef ORIGINAL_LIB_JPEG - -#define JPEG_INTERNALS - -#include "jinclude.h" -#include "jpeglib.h" - -#else - -/* - * THOMAS BOUTELL & BAREND GEHRELS, february 2003 - * adapted the code to work within gd rather than within libjpeg. - * If it is not working, it's not Thomas G. Lane's fault. - */ - -/* - SETTING THIS ONE CAUSES STRIPED IMAGE - to be done: solve this - #define ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS - */ - -#include -#include "gd.h" -#include "gdhelpers.h" - -/* (Re)define some defines known by libjpeg */ -#define QUANT_2PASS_SUPPORTED - -#define RGB_RED 0 -#define RGB_GREEN 1 -#define RGB_BLUE 2 - -#define JSAMPLE unsigned char -#define MAXJSAMPLE (gdMaxColors-1) -#define BITS_IN_JSAMPLE 8 - -#define JSAMPROW int* -#define JDIMENSION int - -#define METHODDEF(type) static type -#define LOCAL(type) static type - - -/* We assume that right shift corresponds to signed division by 2 with - * rounding towards minus infinity. This is correct for typical "arithmetic - * shift" instructions that shift in copies of the sign bit. But some - * C compilers implement >> with an unsigned shift. For these machines you - * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. - * It is only applied with constant shift counts. SHIFT_TEMPS must be - * included in the variables of any routine using RIGHT_SHIFT. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS INT32 shift_temp; -#define RIGHT_SHIFT(x,shft) \ - ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ - (shift_temp >> (shft))) -#else -#define SHIFT_TEMPS -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - - -#define range_limit(x) { if(x<0) x=0; if (x>255) x=255; } - - -#ifndef INT16 -#define INT16 short -#endif - -#ifndef UINT16 -#define UINT16 unsigned short -#endif - -#ifndef INT32 -#define INT32 int -#endif - -#ifndef FAR -#define FAR -#endif - - - -#ifndef boolean -#define boolean int -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - - -#define input_buf (oim->tpixels) -#define output_buf (nim->pixels) - -#endif - -#ifdef QUANT_2PASS_SUPPORTED - - -/* - * This module implements the well-known Heckbert paradigm for color - * quantization. Most of the ideas used here can be traced back to - * Heckbert's seminal paper - * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", - * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. - * - * In the first pass over the image, we accumulate a histogram showing the - * usage count of each possible color. To keep the histogram to a reasonable - * size, we reduce the precision of the input; typical practice is to retain - * 5 or 6 bits per color, so that 8 or 4 different input values are counted - * in the same histogram cell. - * - * Next, the color-selection step begins with a box representing the whole - * color space, and repeatedly splits the "largest" remaining box until we - * have as many boxes as desired colors. Then the mean color in each - * remaining box becomes one of the possible output colors. - * - * The second pass over the image maps each input pixel to the closest output - * color (optionally after applying a Floyd-Steinberg dithering correction). - * This mapping is logically trivial, but making it go fast enough requires - * considerable care. - * - * Heckbert-style quantizers vary a good deal in their policies for choosing - * the "largest" box and deciding where to cut it. The particular policies - * used here have proved out well in experimental comparisons, but better ones - * may yet be found. - * - * In earlier versions of the IJG code, this module quantized in YCbCr color - * space, processing the raw upsampled data without a color conversion step. - * This allowed the color conversion math to be done only once per colormap - * entry, not once per pixel. However, that optimization precluded other - * useful optimizations (such as merging color conversion with upsampling) - * and it also interfered with desired capabilities such as quantizing to an - * externally-supplied colormap. We have therefore abandoned that approach. - * The present code works in the post-conversion color space, typically RGB. - * - * To improve the visual quality of the results, we actually work in scaled - * RGB space, giving G distances more weight than R, and R in turn more than - * B. To do everything in integer math, we must use integer scale factors. - * The 2/3/1 scale factors used here correspond loosely to the relative - * weights of the colors in the NTSC grayscale equation. - * If you want to use this code to quantize a non-RGB color space, you'll - * probably need to change these scale factors. - */ - -#define R_SCALE 2 /* scale R distances by this much */ -#define G_SCALE 3 /* scale G distances by this much */ -#define B_SCALE 1 /* and B by this much */ - -/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined - * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B - * and B,G,R orders. If you define some other weird order in jmorecfg.h, - * you'll get compile errors until you extend this logic. In that case - * you'll probably want to tweak the histogram sizes too. - */ - -#if RGB_RED == 0 -#define C0_SCALE R_SCALE -#endif -#if RGB_BLUE == 0 -#define C0_SCALE B_SCALE -#endif -#if RGB_GREEN == 1 -#define C1_SCALE G_SCALE -#endif -#if RGB_RED == 2 -#define C2_SCALE R_SCALE -#endif -#if RGB_BLUE == 2 -#define C2_SCALE B_SCALE -#endif - - -/* - * First we have the histogram data structure and routines for creating it. - * - * The number of bits of precision can be adjusted by changing these symbols. - * We recommend keeping 6 bits for G and 5 each for R and B. - * If you have plenty of memory and cycles, 6 bits all around gives marginally - * better results; if you are short of memory, 5 bits all around will save - * some space but degrade the results. - * To maintain a fully accurate histogram, we'd need to allocate a "long" - * (preferably unsigned long) for each cell. In practice this is overkill; - * we can get by with 16 bits per cell. Few of the cell counts will overflow, - * and clamping those that do overflow to the maximum value will give close- - * enough results. This reduces the recommended histogram size from 256Kb - * to 128Kb, which is a useful savings on PC-class machines. - * (In the second pass the histogram space is re-used for pixel mapping data; - * in that capacity, each cell must be able to store zero to the number of - * desired colors. 16 bits/cell is plenty for that too.) - * Since the JPEG code is intended to run in small memory model on 80x86 - * machines, we can't just allocate the histogram in one chunk. Instead - * of a true 3-D array, we use a row of pointers to 2-D arrays. Each - * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and - * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that - * on 80x86 machines, the pointer row is in near memory but the actual - * arrays are in far memory (same arrangement as we use for image arrays). - */ - -#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ - -/* These will do the right thing for either R,G,B or B,G,R color order, - * but you may not like the results for other color orders. - */ -#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ -#define HIST_C1_BITS 6 /* bits of precision in G histogram */ -#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ - -/* Number of elements along histogram axes. */ -#define HIST_C0_ELEMS (1<cquantize; -#endif - register JSAMPROW ptr; - register histptr histp; - register hist3d histogram = cquantize->histogram; - int row; - JDIMENSION col; -#ifdef ORIGINAL_LIB_JPEG - JDIMENSION width = cinfo->output_width; -#else - int width = oim->sx; - int num_rows = oim->sy; -#endif - - for (row = 0; row < num_rows; row++) - { - ptr = input_buf[row]; - for (col = width; col > 0; col--) - { -#ifdef ORIGINAL_LIB_JPEG - int r = GETJSAMPLE (ptr[0]) >> C0_SHIFT; - int g = GETJSAMPLE (ptr[1]) >> C1_SHIFT; - int b = GETJSAMPLE (ptr[2]) >> C2_SHIFT; -#else - int r = gdTrueColorGetRed (*ptr) >> C0_SHIFT; - int g = gdTrueColorGetGreen (*ptr) >> C1_SHIFT; - int b = gdTrueColorGetBlue (*ptr) >> C2_SHIFT; - /* 2.0.12: Steven Brown: support a single totally transparent - color in the original. */ - if ((oim->transparent >= 0) && (*ptr == oim->transparent)) - { - ptr++; - continue; - } -#endif - /* get pixel value and index into the histogram */ - histp = &histogram[r][g][b]; - /* increment, check for overflow and undo increment if so. */ - if (++(*histp) == 0) - (*histp)--; -#ifdef ORIGINAL_LIB_JPEG - ptr += 3; -#else - ptr++; -#endif - } - } -} - - -/* - * Next we have the really interesting routines: selection of a colormap - * given the completed histogram. - * These routines work with a list of "boxes", each representing a rectangular - * subset of the input color space (to histogram precision). - */ - -typedef struct -{ - /* The bounds of the box (inclusive); expressed as histogram indexes */ - int c0min, c0max; - int c1min, c1max; - int c2min, c2max; - /* The volume (actually 2-norm) of the box */ - INT32 volume; - /* The number of nonzero histogram cells within this box */ - long colorcount; -} -box; - -typedef box *boxptr; - - -LOCAL (boxptr) find_biggest_color_pop (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest color population */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register long maxc = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) - { - if (boxp->colorcount > maxc && boxp->volume > 0) - { - which = boxp; - maxc = boxp->colorcount; - } - } - return which; -} - - -LOCAL (boxptr) find_biggest_volume (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest (scaled) volume */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register INT32 maxv = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) - { - if (boxp->volume > maxv) - { - which = boxp; - maxv = boxp->volume; - } - } - return which; -} - - -LOCAL (void) -#ifndef ORIGINAL_LIB_JPEG - update_box (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, boxptr boxp) -{ -#else - update_box (j_decompress_ptr cinfo, boxptr boxp) -/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ -/* and recompute its volume and population */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; -#endif - hist3d histogram = cquantize->histogram; - histptr histp; - int c0, c1, c2; - int c0min, c0max, c1min, c1max, c2min, c2max; - INT32 dist0, dist1, dist2; - long ccount; - - c0min = boxp->c0min; - c0max = boxp->c0max; - c1min = boxp->c1min; - c1max = boxp->c1max; - c2min = boxp->c2min; - c2max = boxp->c2max; - - if (c0max > c0min) - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) - { - boxp->c0min = c0min = c0; - goto have_c0min; - } - } -have_c0min: - if (c0max > c0min) - for (c0 = c0max; c0 >= c0min; c0--) - for (c1 = c1min; c1 <= c1max; c1++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) - { - boxp->c0max = c0max = c0; - goto have_c0max; - } - } -have_c0max: - if (c1max > c1min) - for (c1 = c1min; c1 <= c1max; c1++) - for (c0 = c0min; c0 <= c0max; c0++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) - { - boxp->c1min = c1min = c1; - goto have_c1min; - } - } -have_c1min: - if (c1max > c1min) - for (c1 = c1max; c1 >= c1min; c1--) - for (c0 = c0min; c0 <= c0max; c0++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) - { - boxp->c1max = c1max = c1; - goto have_c1max; - } - } -have_c1max: - if (c2max > c2min) - for (c2 = c2min; c2 <= c2max; c2++) - for (c0 = c0min; c0 <= c0max; c0++) - { - histp = &histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) - { - boxp->c2min = c2min = c2; - goto have_c2min; - } - } -have_c2min: - if (c2max > c2min) - for (c2 = c2max; c2 >= c2min; c2--) - for (c0 = c0min; c0 <= c0max; c0++) - { - histp = &histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) - { - boxp->c2max = c2max = c2; - goto have_c2max; - } - } -have_c2max: - - /* Update box volume. - * We use 2-norm rather than real volume here; this biases the method - * against making long narrow boxes, and it has the side benefit that - * a box is splittable iff norm > 0. - * Since the differences are expressed in histogram-cell units, - * we have to shift back to JSAMPLE units to get consistent distances; - * after which, we scale according to the selected distance scale factors. - */ - dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; - dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; - dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; - boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2; - - /* Now scan remaining volume of box and compute population */ - ccount = 0; - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++, histp++) - if (*histp != 0) - { - ccount++; - } - } - boxp->colorcount = ccount; -} - - -LOCAL (int) -#ifdef ORIGINAL_LIB_JPEG -median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, - int desired_colors) -#else -median_cut (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, - boxptr boxlist, int numboxes, int desired_colors) -#endif -/* Repeatedly select and split the largest box until we have enough boxes */ -{ - int n, lb; - int c0, c1, c2, cmax; - register boxptr b1, b2; - - while (numboxes < desired_colors) - { - /* Select box to split. - * Current algorithm: by population for first half, then by volume. - */ - if (numboxes * 2 <= desired_colors) - { - b1 = find_biggest_color_pop (boxlist, numboxes); - } - else - { - b1 = find_biggest_volume (boxlist, numboxes); - } - if (b1 == NULL) /* no splittable boxes left! */ - break; - b2 = &boxlist[numboxes]; /* where new box will go */ - /* Copy the color bounds to the new box. */ - b2->c0max = b1->c0max; - b2->c1max = b1->c1max; - b2->c2max = b1->c2max; - b2->c0min = b1->c0min; - b2->c1min = b1->c1min; - b2->c2min = b1->c2min; - /* Choose which axis to split the box on. - * Current algorithm: longest scaled axis. - * See notes in update_box about scaling distances. - */ - c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; - c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; - c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; - /* We want to break any ties in favor of green, then red, blue last. - * This code does the right thing for R,G,B or B,G,R color orders only. - */ -#if RGB_RED == 0 - cmax = c1; - n = 1; - if (c0 > cmax) - { - cmax = c0; - n = 0; - } - if (c2 > cmax) - { - n = 2; - } -#else - cmax = c1; - n = 1; - if (c2 > cmax) - { - cmax = c2; - n = 2; - } - if (c0 > cmax) - { - n = 0; - } -#endif - /* Choose split point along selected axis, and update box bounds. - * Current algorithm: split at halfway point. - * (Since the box has been shrunk to minimum volume, - * any split will produce two nonempty subboxes.) - * Note that lb value is max for lower box, so must be < old max. - */ - switch (n) - { - case 0: - lb = (b1->c0max + b1->c0min) / 2; - b1->c0max = lb; - b2->c0min = lb + 1; - break; - case 1: - lb = (b1->c1max + b1->c1min) / 2; - b1->c1max = lb; - b2->c1min = lb + 1; - break; - case 2: - lb = (b1->c2max + b1->c2min) / 2; - b1->c2max = lb; - b2->c2min = lb + 1; - break; - } - /* Update stats for boxes */ -#ifdef ORIGINAL_LIB_JPEG - update_box (cinfo, b1); - update_box (cinfo, b2); -#else - update_box (oim, nim, cquantize, b1); - update_box (oim, nim, cquantize, b2); -#endif - numboxes++; - } - return numboxes; -} - - -LOCAL (void) -#ifndef ORIGINAL_LIB_JPEG - compute_color (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, - boxptr boxp, int icolor) -{ -#else - compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) -/* Compute representative color for a box, put it in colormap[icolor] */ -{ - /* Current algorithm: mean weighted by pixels (not colors) */ - /* Note it is important to get the rounding correct! */ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; -#endif - hist3d histogram = cquantize->histogram; - histptr histp; - int c0, c1, c2; - int c0min, c0max, c1min, c1max, c2min, c2max; - long count = 0; /* 2.0.28: = 0 */ - long total = 0; - long c0total = 0; - long c1total = 0; - long c2total = 0; - - c0min = boxp->c0min; - c0max = boxp->c0max; - c1min = boxp->c1min; - c1max = boxp->c1max; - c2min = boxp->c2min; - c2max = boxp->c2max; - - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) - { - histp = &histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - { - if ((count = *histp++) != 0) - { - total += count; - c0total += - ((c0 << C0_SHIFT) + ((1 << C0_SHIFT) >> 1)) * count; - c1total += - ((c1 << C1_SHIFT) + ((1 << C1_SHIFT) >> 1)) * count; - c2total += - ((c2 << C2_SHIFT) + ((1 << C2_SHIFT) >> 1)) * count; - } - } - } - -#ifdef ORIGINAL_LIB_JPEG - cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total >> 1)) / total); - cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total >> 1)) / total); - cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total); -#else - /* 2.0.16: Paul den Dulk found an occasion where total can be 0 */ - if (count) - { - nim->red[icolor] = (int) ((c0total + (total >> 1)) / total); - nim->green[icolor] = (int) ((c1total + (total >> 1)) / total); - nim->blue[icolor] = (int) ((c2total + (total >> 1)) / total); - } - else - { - nim->red[icolor] = 255; - nim->green[icolor] = 255; - nim->blue[icolor] = 255; - } -#endif -} - - -LOCAL (void) -#ifdef ORIGINAL_LIB_JPEG -select_colors (j_decompress_ptr cinfo, int desired_colors) -#else -select_colors (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, int desired_colors) -#endif -/* Master routine for color selection */ -{ - boxptr boxlist; - int numboxes; - int i; - - /* Allocate workspace for box list */ -#ifdef ORIGINAL_LIB_JPEG - boxlist = (boxptr) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF (box)); -#else - boxlist = (boxptr) safe_emalloc(desired_colors, sizeof (box), 1); -#endif - /* Initialize one box containing whole space */ - numboxes = 1; - boxlist[0].c0min = 0; - boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; - boxlist[0].c1min = 0; - boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; - boxlist[0].c2min = 0; - boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; -#ifdef ORIGINAL_LIB_JPEG - /* Shrink it to actually-used volume and set its statistics */ - update_box (cinfo, &boxlist[0]); - /* Perform median-cut to produce final box list */ - numboxes = median_cut (cinfo, boxlist, numboxes, desired_colors); - /* Compute the representative color for each box, fill colormap */ - for (i = 0; i < numboxes; i++) - compute_color (cinfo, &boxlist[i], i); - cinfo->actual_number_of_colors = numboxes; - TRACEMS1 (cinfo, 1, JTRC_QUANT_SELECTED, numboxes); -#else - /* Shrink it to actually-used volume and set its statistics */ - update_box (oim, nim, cquantize, &boxlist[0]); - /* Perform median-cut to produce final box list */ - numboxes = median_cut (oim, nim, cquantize, boxlist, numboxes, desired_colors); - /* Compute the representative color for each box, fill colormap */ - for (i = 0; i < numboxes; i++) - compute_color (oim, nim, cquantize, &boxlist[i], i); - nim->colorsTotal = numboxes; - - /* If we had a pure transparency color, add it as the last palette entry. - * Skip incrementing the color count so that the dither / matching phase - * won't use it on pixels that shouldn't have been transparent. We'll - * increment it after all that finishes. */ - if (oim->transparent >= 0) - { - /* Save the transparent color. */ - nim->red[nim->colorsTotal] = gdTrueColorGetRed (oim->transparent); - nim->green[nim->colorsTotal] = gdTrueColorGetGreen (oim->transparent); - nim->blue[nim->colorsTotal] = gdTrueColorGetBlue (oim->transparent); - nim->alpha[nim->colorsTotal] = gdAlphaTransparent; - nim->open[nim->colorsTotal] = 0; - } - - gdFree (boxlist); -#endif -} - - -/* - * These routines are concerned with the time-critical task of mapping input - * colors to the nearest color in the selected colormap. - * - * We re-use the histogram space as an "inverse color map", essentially a - * cache for the results of nearest-color searches. All colors within a - * histogram cell will be mapped to the same colormap entry, namely the one - * closest to the cell's center. This may not be quite the closest entry to - * the actual input color, but it's almost as good. A zero in the cache - * indicates we haven't found the nearest color for that cell yet; the array - * is cleared to zeroes before starting the mapping pass. When we find the - * nearest color for a cell, its colormap index plus one is recorded in the - * cache for future use. The pass2 scanning routines call fill_inverse_cmap - * when they need to use an unfilled entry in the cache. - * - * Our method of efficiently finding nearest colors is based on the "locally - * sorted search" idea described by Heckbert and on the incremental distance - * calculation described by Spencer W. Thomas in chapter III.1 of Graphics - * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that - * the distances from a given colormap entry to each cell of the histogram can - * be computed quickly using an incremental method: the differences between - * distances to adjacent cells themselves differ by a constant. This allows a - * fairly fast implementation of the "brute force" approach of computing the - * distance from every colormap entry to every histogram cell. Unfortunately, - * it needs a work array to hold the best-distance-so-far for each histogram - * cell (because the inner loop has to be over cells, not colormap entries). - * The work array elements have to be INT32s, so the work array would need - * 256Kb at our recommended precision. This is not feasible in DOS machines. - * - * To get around these problems, we apply Thomas' method to compute the - * nearest colors for only the cells within a small subbox of the histogram. - * The work array need be only as big as the subbox, so the memory usage - * problem is solved. Furthermore, we need not fill subboxes that are never - * referenced in pass2; many images use only part of the color gamut, so a - * fair amount of work is saved. An additional advantage of this - * approach is that we can apply Heckbert's locality criterion to quickly - * eliminate colormap entries that are far away from the subbox; typically - * three-fourths of the colormap entries are rejected by Heckbert's criterion, - * and we need not compute their distances to individual cells in the subbox. - * The speed of this approach is heavily influenced by the subbox size: too - * small means too much overhead, too big loses because Heckbert's criterion - * can't eliminate as many colormap entries. Empirically the best subbox - * size seems to be about 1/512th of the histogram (1/8th in each direction). - * - * Thomas' article also describes a refined method which is asymptotically - * faster than the brute-force method, but it is also far more complex and - * cannot efficiently be applied to small subboxes. It is therefore not - * useful for programs intended to be portable to DOS machines. On machines - * with plenty of memory, filling the whole histogram in one shot with Thomas' - * refined method might be faster than the present code --- but then again, - * it might not be any faster, and it's certainly more complicated. - */ - - -/* log2(histogram cells in update box) for each axis; this can be adjusted */ -#define BOX_C0_LOG (HIST_C0_BITS-3) -#define BOX_C1_LOG (HIST_C1_BITS-3) -#define BOX_C2_LOG (HIST_C2_BITS-3) - -#define BOX_C0_ELEMS (1<actual_number_of_colors; -#else - int numcolors = nim->colorsTotal; -#endif - int maxc0, maxc1, maxc2; - int centerc0, centerc1, centerc2; - int i, x, ncolors; - INT32 minmaxdist, min_dist, max_dist, tdist; - INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ - - /* Compute true coordinates of update box's upper corner and center. - * Actually we compute the coordinates of the center of the upper-corner - * histogram cell, which are the upper bounds of the volume we care about. - * Note that since ">>" rounds down, the "center" values may be closer to - * min than to max; hence comparisons to them must be "<=", not "<". - */ - maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); - centerc0 = (minc0 + maxc0) >> 1; - maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); - centerc1 = (minc1 + maxc1) >> 1; - maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); - centerc2 = (minc2 + maxc2) >> 1; - - /* For each color in colormap, find: - * 1. its minimum squared-distance to any point in the update box - * (zero if color is within update box); - * 2. its maximum squared-distance to any point in the update box. - * Both of these can be found by considering only the corners of the box. - * We save the minimum distance for each color in mindist[]; - * only the smallest maximum distance is of interest. - */ - minmaxdist = 0x7FFFFFFFL; - - for (i = 0; i < numcolors; i++) - { - /* We compute the squared-c0-distance term, then add in the other two. */ -#ifdef ORIGINAL_LIB_JPEG - x = GETJSAMPLE (cinfo->colormap[0][i]); -#else - x = nim->red[i]; -#endif - if (x < minc0) - { - tdist = (x - minc0) * C0_SCALE; - min_dist = tdist * tdist; - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist * tdist; - } - else if (x > maxc0) - { - tdist = (x - maxc0) * C0_SCALE; - min_dist = tdist * tdist; - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist * tdist; - } - else - { - /* within cell range so no contribution to min_dist */ - min_dist = 0; - if (x <= centerc0) - { - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist * tdist; - } - else - { - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist * tdist; - } - } - -#ifdef ORIGINAL_LIB_JPEG - x = GETJSAMPLE (cinfo->colormap[1][i]); -#else - x = nim->green[i]; -#endif - if (x < minc1) - { - tdist = (x - minc1) * C1_SCALE; - min_dist += tdist * tdist; - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist * tdist; - } - else if (x > maxc1) - { - tdist = (x - maxc1) * C1_SCALE; - min_dist += tdist * tdist; - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist * tdist; - } - else - { - /* within cell range so no contribution to min_dist */ - if (x <= centerc1) - { - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist * tdist; - } - else - { - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist * tdist; - } - } - -#ifdef ORIGINAL_LIB_JPEG - x = GETJSAMPLE (cinfo->colormap[2][i]); -#else - x = nim->blue[i]; -#endif - if (x < minc2) - { - tdist = (x - minc2) * C2_SCALE; - min_dist += tdist * tdist; - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist * tdist; - } - else if (x > maxc2) - { - tdist = (x - maxc2) * C2_SCALE; - min_dist += tdist * tdist; - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist * tdist; - } - else - { - /* within cell range so no contribution to min_dist */ - if (x <= centerc2) - { - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist * tdist; - } - else - { - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist * tdist; - } - } - - mindist[i] = min_dist; /* save away the results */ - if (max_dist < minmaxdist) - minmaxdist = max_dist; - } - - /* Now we know that no cell in the update box is more than minmaxdist - * away from some colormap entry. Therefore, only colors that are - * within minmaxdist of some part of the box need be considered. - */ - ncolors = 0; - for (i = 0; i < numcolors; i++) - { - if (mindist[i] <= minmaxdist) - colorlist[ncolors++] = (JSAMPLE) i; - } - return ncolors; -} - - -LOCAL (void) find_best_colors ( -#ifdef ORIGINAL_LIB_JPEG - j_decompress_ptr cinfo, -#else - gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, -#endif - int minc0, int minc1, int minc2, - int numcolors, JSAMPLE colorlist[], - JSAMPLE bestcolor[]) -/* Find the closest colormap entry for each cell in the update box, - * given the list of candidate colors prepared by find_nearby_colors. - * Return the indexes of the closest entries in the bestcolor[] array. - * This routine uses Thomas' incremental distance calculation method to - * find the distance from a colormap entry to successive cells in the box. - */ -{ - int ic0, ic1, ic2; - int i, icolor; - register INT32 *bptr; /* pointer into bestdist[] array */ - JSAMPLE *cptr; /* pointer into bestcolor[] array */ - INT32 dist0, dist1; /* initial distance values */ - register INT32 dist2; /* current distance in inner loop */ - INT32 xx0, xx1; /* distance increments */ - register INT32 xx2; - INT32 inc0, inc1, inc2; /* initial values for increments */ - /* This array holds the distance to the nearest-so-far color for each cell */ - INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Initialize best-distance for each cell of the update box */ - bptr = bestdist; - for (i = BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS - 1; i >= 0; i--) - *bptr++ = 0x7FFFFFFFL; - - /* For each color selected by find_nearby_colors, - * compute its distance to the center of each cell in the box. - * If that's less than best-so-far, update best distance and color number. - */ - - /* Nominal steps between cell centers ("x" in Thomas article) */ -#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) -#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) -#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) - - for (i = 0; i < numcolors; i++) - { - int r, g, b; -#ifdef ORIGINAL_LIB_JPEG - - icolor = GETJSAMPLE (colorlist[i]); - r = GETJSAMPLE (cinfo->colormap[0][icolor]); - g = GETJSAMPLE (cinfo->colormap[1][icolor]); - b = GETJSAMPLE (cinfo->colormap[2][icolor]); -#else - icolor = colorlist[i]; - r = nim->red[icolor]; - g = nim->green[icolor]; - b = nim->blue[icolor]; -#endif - - /* Compute (square of) distance from minc0/c1/c2 to this color */ - inc0 = (minc0 - r) * C0_SCALE; - dist0 = inc0 * inc0; - inc1 = (minc1 - g) * C1_SCALE; - dist0 += inc1 * inc1; - inc2 = (minc2 - b) * C2_SCALE; - dist0 += inc2 * inc2; - /* Form the initial difference increments */ - inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; - inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; - inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; - /* Now loop over all cells in box, updating distance per Thomas method */ - bptr = bestdist; - cptr = bestcolor; - xx0 = inc0; - for (ic0 = BOX_C0_ELEMS - 1; ic0 >= 0; ic0--) - { - dist1 = dist0; - xx1 = inc1; - for (ic1 = BOX_C1_ELEMS - 1; ic1 >= 0; ic1--) - { - dist2 = dist1; - xx2 = inc2; - for (ic2 = BOX_C2_ELEMS - 1; ic2 >= 0; ic2--) - { - if (dist2 < *bptr) - { - *bptr = dist2; - *cptr = (JSAMPLE) icolor; - } - dist2 += xx2; - xx2 += 2 * STEP_C2 * STEP_C2; - bptr++; - cptr++; - } - dist1 += xx1; - xx1 += 2 * STEP_C1 * STEP_C1; - } - dist0 += xx0; - xx0 += 2 * STEP_C0 * STEP_C0; - } - } -} - - -LOCAL (void) -fill_inverse_cmap ( -#ifdef ORIGINAL_LIB_JPEG - j_decompress_ptr cinfo, -#else - gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, -#endif - int c0, int c1, int c2) -/* Fill the inverse-colormap entries in the update box that contains */ -/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ -/* we can fill as many others as we wish.) */ -{ -#ifdef ORIGINAL_LIB_JPEG - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; -#endif - hist3d histogram = cquantize->histogram; - int minc0, minc1, minc2; /* lower left corner of update box */ - int ic0, ic1, ic2; - register JSAMPLE *cptr; /* pointer into bestcolor[] array */ - register histptr cachep; /* pointer into main cache array */ - /* This array lists the candidate colormap indexes. */ - JSAMPLE colorlist[MAXNUMCOLORS]; - int numcolors; /* number of candidate colors */ - /* This array holds the actually closest colormap index for each cell. */ - JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Convert cell coordinates to update box ID */ - c0 >>= BOX_C0_LOG; - c1 >>= BOX_C1_LOG; - c2 >>= BOX_C2_LOG; - - /* Compute true coordinates of update box's origin corner. - * Actually we compute the coordinates of the center of the corner - * histogram cell, which are the lower bounds of the volume we care about. - */ - minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); - minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); - minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); - - /* Determine which colormap entries are close enough to be candidates - * for the nearest entry to some cell in the update box. - */ -#ifdef ORIGINAL_LIB_JPEG - numcolors = find_nearby_colors (cinfo, minc0, minc1, minc2, colorlist); - - /* Determine the actually nearest colors. */ - find_best_colors (cinfo, minc0, minc1, minc2, numcolors, colorlist, - bestcolor); -#else - numcolors = - find_nearby_colors (oim, nim, cquantize, minc0, minc1, minc2, colorlist); - find_best_colors (oim, nim, cquantize, minc0, minc1, minc2, numcolors, - colorlist, bestcolor); -#endif - - /* Save the best color numbers (plus 1) in the main cache array */ - c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ - c1 <<= BOX_C1_LOG; - c2 <<= BOX_C2_LOG; - cptr = bestcolor; - for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) - { - for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) - { - cachep = &histogram[c0 + ic0][c1 + ic1][c2]; - for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) - { -#ifdef ORIGINAL_LIB_JPEG - *cachep++ = (histcell) (GETJSAMPLE (*cptr++) + 1); -#else - *cachep++ = (histcell) ((*cptr++) + 1); -#endif - } - } - } -} - - -/* - * Map some rows of pixels to the output colormapped representation. - */ - -METHODDEF (void) -#ifndef ORIGINAL_LIB_JPEG -pass2_no_dither (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) -{ - register int *inptr; - register unsigned char *outptr; - int width = oim->sx; - int num_rows = oim->sy; -#else -pass2_no_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs no dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - register JSAMPROW inptr, outptr; - JDIMENSION width = cinfo->output_width; -#endif - hist3d histogram = cquantize->histogram; - register int c0, c1, c2; - int row; - JDIMENSION col; - register histptr cachep; - - - for (row = 0; row < num_rows; row++) - { - inptr = input_buf[row]; - outptr = output_buf[row]; - for (col = width; col > 0; col--) - { - /* get pixel value and index into the cache */ - int r, g, b; -#ifdef ORIGINAL_LIB_JPEG - r = GETJSAMPLE (*inptr++); - g = GETJSAMPLE (*inptr++); - b = GETJSAMPLE (*inptr++); -#else - r = gdTrueColorGetRed (*inptr); - g = gdTrueColorGetGreen (*inptr); - /* - 2.0.24: inptr must not be incremented until after - transparency check, if any. Thanks to "Super Pikeman." - */ - b = gdTrueColorGetBlue (*inptr); - - /* If the pixel is transparent, we assign it the palette index that - * will later be added at the end of the palette as the transparent - * index. */ - if ((oim->transparent >= 0) && (oim->transparent == *(inptr - 1))) - { - *outptr++ = nim->colorsTotal; - inptr++; - continue; - } - inptr++; -#endif - c0 = r >> C0_SHIFT; - c1 = g >> C1_SHIFT; - c2 = b >> C2_SHIFT; - cachep = &histogram[c0][c1][c2]; - /* If we have not seen this color before, find nearest colormap entry */ - /* and update the cache */ - if (*cachep == 0) -#ifdef ORIGINAL_LIB_JPEG - fill_inverse_cmap (cinfo, c0, c1, c2); -#else - fill_inverse_cmap (oim, nim, cquantize, c0, c1, c2); -#endif - /* Now emit the colormap index for this cell */ -#ifdef ORIGINAL_LIB_JPEG - *outptr++ = (JSAMPLE) (*cachep - 1); -#else - *outptr++ = (*cachep - 1); -#endif - } - } -} - - -METHODDEF (void) -#ifndef ORIGINAL_LIB_JPEG -pass2_fs_dither (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) -{ -#else -pass2_fs_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs Floyd-Steinberg dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - JSAMPROW inptr; /* => current input pixel */ -#endif - hist3d histogram = cquantize->histogram; - register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ - LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ - LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ - register FSERRPTR errorptr; /* => fserrors[] at column before current */ - histptr cachep; - int dir; /* +1 or -1 depending on direction */ - int dir3; /* 3*dir, for advancing inptr & errorptr */ - int row; - JDIMENSION col; -#ifdef ORIGINAL_LIB_JPEG - JSAMPROW outptr; /* => current output pixel */ - JDIMENSION width = cinfo->output_width; - JSAMPLE *range_limit = cinfo->sample_range_limit; - JSAMPROW colormap0 = cinfo->colormap[0]; - JSAMPROW colormap1 = cinfo->colormap[1]; - JSAMPROW colormap2 = cinfo->colormap[2]; -#else - int *inptr; /* => current input pixel */ - unsigned char *outptr; /* => current output pixel */ - int width = oim->sx; - int num_rows = oim->sy; - int *colormap0 = nim->red; - int *colormap1 = nim->green; - int *colormap2 = nim->blue; -#endif - int *error_limit = cquantize->error_limiter; - - - SHIFT_TEMPS for (row = 0; row < num_rows; row++) - { - inptr = input_buf[row]; - outptr = output_buf[row]; - if (cquantize->on_odd_row) - { - /* work right to left in this row */ - inptr += (width - 1) * 3; /* so point to rightmost pixel */ - outptr += width - 1; - dir = -1; - dir3 = -3; - errorptr = cquantize->fserrors + (width + 1) * 3; /* => entry after last column */ -#ifdef ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS - cquantize->on_odd_row = FALSE; /* flip for next time */ -#endif - } - else - { - /* work left to right in this row */ - dir = 1; - dir3 = 3; - errorptr = cquantize->fserrors; /* => entry before first real column */ -#ifdef ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS - cquantize->on_odd_row = TRUE; /* flip for next time */ -#endif - } - /* Preset error values: no error propagated to first pixel from left */ - cur0 = cur1 = cur2 = 0; - /* and no error propagated to row below yet */ - belowerr0 = belowerr1 = belowerr2 = 0; - bpreverr0 = bpreverr1 = bpreverr2 = 0; - - for (col = width; col > 0; col--) - { - - /* If this pixel is transparent, we want to assign it to the special - * transparency color index past the end of the palette rather than - * go through matching / dithering. */ - if ((oim->transparent >= 0) && (*inptr == oim->transparent)) - { - *outptr = nim->colorsTotal; - errorptr[0] = 0; - errorptr[1] = 0; - errorptr[2] = 0; - errorptr[3] = 0; - inptr += dir; - outptr += dir; - errorptr += dir3; - continue; - } - /* curN holds the error propagated from the previous pixel on the - * current line. Add the error propagated from the previous line - * to form the complete error correction term for this pixel, and - * round the error term (which is expressed * 16) to an integer. - * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct - * for either sign of the error value. - * Note: errorptr points to *previous* column's array entry. - */ - cur0 = RIGHT_SHIFT (cur0 + errorptr[dir3 + 0] + 8, 4); - cur1 = RIGHT_SHIFT (cur1 + errorptr[dir3 + 1] + 8, 4); - cur2 = RIGHT_SHIFT (cur2 + errorptr[dir3 + 2] + 8, 4); - /* Limit the error using transfer function set by init_error_limit. - * See comments with init_error_limit for rationale. - */ - cur0 = error_limit[cur0]; - cur1 = error_limit[cur1]; - cur2 = error_limit[cur2]; - /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. - * The maximum error is +- MAXJSAMPLE (or less with error limiting); - * this sets the required size of the range_limit array. - */ -#ifdef ORIGINAL_LIB_JPEG - cur0 += GETJSAMPLE (inptr[0]); - cur1 += GETJSAMPLE (inptr[1]); - cur2 += GETJSAMPLE (inptr[2]); - cur0 = GETJSAMPLE (range_limit[cur0]); - cur1 = GETJSAMPLE (range_limit[cur1]); - cur2 = GETJSAMPLE (range_limit[cur2]); -#else - cur0 += gdTrueColorGetRed (*inptr); - cur1 += gdTrueColorGetGreen (*inptr); - cur2 += gdTrueColorGetBlue (*inptr); - range_limit (cur0); - range_limit (cur1); - range_limit (cur2); -#endif - - /* Index into the cache with adjusted pixel value */ - cachep = - &histogram[cur0 >> C0_SHIFT][cur1 >> C1_SHIFT][cur2 >> C2_SHIFT]; - /* If we have not seen this color before, find nearest colormap */ - /* entry and update the cache */ - if (*cachep == 0) -#ifdef ORIGINAL_LIB_JPEG - fill_inverse_cmap (cinfo, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT, - cur2 >> C2_SHIFT); -#else - fill_inverse_cmap (oim, nim, cquantize, cur0 >> C0_SHIFT, - cur1 >> C1_SHIFT, cur2 >> C2_SHIFT); -#endif - /* Now emit the colormap index for this cell */ - { - register int pixcode = *cachep - 1; - *outptr = (JSAMPLE) pixcode; - /* Compute representation error for this pixel */ -#define GETJSAMPLE - cur0 -= GETJSAMPLE (colormap0[pixcode]); - cur1 -= GETJSAMPLE (colormap1[pixcode]); - cur2 -= GETJSAMPLE (colormap2[pixcode]); -#undef GETJSAMPLE - } - /* Compute error fractions to be propagated to adjacent pixels. - * Add these into the running sums, and simultaneously shift the - * next-line error sums left by 1 column. - */ - { - register LOCFSERROR bnexterr, delta; - - bnexterr = cur0; /* Process component 0 */ - delta = cur0 * 2; - cur0 += delta; /* form error * 3 */ - errorptr[0] = (FSERROR) (bpreverr0 + cur0); - cur0 += delta; /* form error * 5 */ - bpreverr0 = belowerr0 + cur0; - belowerr0 = bnexterr; - cur0 += delta; /* form error * 7 */ - bnexterr = cur1; /* Process component 1 */ - delta = cur1 * 2; - cur1 += delta; /* form error * 3 */ - errorptr[1] = (FSERROR) (bpreverr1 + cur1); - cur1 += delta; /* form error * 5 */ - bpreverr1 = belowerr1 + cur1; - belowerr1 = bnexterr; - cur1 += delta; /* form error * 7 */ - bnexterr = cur2; /* Process component 2 */ - delta = cur2 * 2; - cur2 += delta; /* form error * 3 */ - errorptr[2] = (FSERROR) (bpreverr2 + cur2); - cur2 += delta; /* form error * 5 */ - bpreverr2 = belowerr2 + cur2; - belowerr2 = bnexterr; - cur2 += delta; /* form error * 7 */ - } - /* At this point curN contains the 7/16 error value to be propagated - * to the next pixel on the current line, and all the errors for the - * next line have been shifted over. We are therefore ready to move on. - */ -#ifdef ORIGINAL_LIB_JPEG - inptr += dir3; /* Advance pixel pointers to next column */ -#else - inptr += dir; /* Advance pixel pointers to next column */ -#endif - outptr += dir; - errorptr += dir3; /* advance errorptr to current column */ - } - /* Post-loop cleanup: we must unload the final error values into the - * final fserrors[] entry. Note we need not unload belowerrN because - * it is for the dummy column before or after the actual array. - */ - errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ - errorptr[1] = (FSERROR) bpreverr1; - errorptr[2] = (FSERROR) bpreverr2; - } -} - - -/* - * Initialize the error-limiting transfer function (lookup table). - * The raw F-S error computation can potentially compute error values of up to - * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be - * much less, otherwise obviously wrong pixels will be created. (Typical - * effects include weird fringes at color-area boundaries, isolated bright - * pixels in a dark area, etc.) The standard advice for avoiding this problem - * is to ensure that the "corners" of the color cube are allocated as output - * colors; then repeated errors in the same direction cannot cause cascading - * error buildup. However, that only prevents the error from getting - * completely out of hand; Aaron Giles reports that error limiting improves - * the results even with corner colors allocated. - * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty - * well, but the smoother transfer function used below is even better. Thanks - * to Aaron Giles for this idea. - */ - -LOCAL (void) -#ifdef ORIGINAL_LIB_JPEG -init_error_limit (j_decompress_ptr cinfo) -#else -init_error_limit (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) -#endif -/* Allocate and fill in the error_limiter table */ -{ - int *table; - int in, out; -#ifdef ORIGINAL_LIB_JPEG - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - table = (int *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE * 2 + 1) * SIZEOF (int)); -#else - cquantize->error_limiter_storage = - (int *) safe_emalloc ((MAXJSAMPLE * 2 + 1), sizeof (int), 0); - if (!cquantize->error_limiter_storage) - { - return; - } - table = cquantize->error_limiter_storage; -#endif - - table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ - cquantize->error_limiter = table; - -#define STEPSIZE ((MAXJSAMPLE+1)/16) - /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ - out = 0; - for (in = 0; in < STEPSIZE; in++, out++) - { - table[in] = out; - table[-in] = -out; - } - /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ - for (; in < STEPSIZE * 3; in++, out += (in & 1) ? 0 : 1) - { - table[in] = out; - table[-in] = -out; - } - /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ - for (; in <= MAXJSAMPLE; in++) - { - table[in] = out; - table[-in] = -out; - } -#undef STEPSIZE -} - - -/* - * Finish up at the end of each pass. - */ - -#ifdef ORIGINAL_LIB_JPEG -METHODDEF (void) -finish_pass1 (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Select the representative colors and fill in cinfo->colormap */ - cinfo->colormap = cquantize->sv_colormap; - select_colors (cinfo, cquantize->desired); - /* Force next pass to zero the color index table */ - cquantize->needs_zeroed = TRUE; -} - - -METHODDEF (void) -finish_pass2 (j_decompress_ptr cinfo) -{ - /* no work */ -} - -/* - * Initialize for each processing pass. - */ - -METHODDEF (void) -start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - int i; - - /* Only F-S dithering or no dithering is supported. */ - /* If user asks for ordered dither, give him F-S. */ - if (cinfo->dither_mode != JDITHER_NONE) - cinfo->dither_mode = JDITHER_FS; - - if (is_pre_scan) - { - /* Set up method pointers */ - cquantize->pub.color_quantize = prescan_quantize; - cquantize->pub.finish_pass = finish_pass1; - cquantize->needs_zeroed = TRUE; /* Always zero histogram */ - } - else - { - /* Set up method pointers */ - if (cinfo->dither_mode == JDITHER_FS) - cquantize->pub.color_quantize = pass2_fs_dither; - else - cquantize->pub.color_quantize = pass2_no_dither; - cquantize->pub.finish_pass = finish_pass2; - - /* Make sure color count is acceptable */ - i = cinfo->actual_number_of_colors; - if (i < 1) - ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 1); - if (i > MAXNUMCOLORS) - ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); - - if (cinfo->dither_mode == JDITHER_FS) - { - size_t arraysize = (size_t) ((cinfo->output_width + 2) * - (3 * SIZEOF (FSERROR))); - /* Allocate Floyd-Steinberg workspace if we didn't already. */ - if (cquantize->fserrors == NULL) - cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); - /* Initialize the propagated errors to zero. */ - jzero_far ((void FAR *) cquantize->fserrors, arraysize); - /* Make the error-limit table if we didn't already. */ - if (cquantize->error_limiter == NULL) - init_error_limit (cinfo); - cquantize->on_odd_row = FALSE; - } - - } - /* Zero the histogram or inverse color map, if necessary */ - if (cquantize->needs_zeroed) - { - for (i = 0; i < HIST_C0_ELEMS; i++) - { - jzero_far ((void FAR *) histogram[i], - HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF (histcell)); - } - cquantize->needs_zeroed = FALSE; - } -} - - -/* - * Switch to a new external colormap between output passes. - */ - -METHODDEF (void) -new_color_map_2_quant (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Reset the inverse color map */ - cquantize->needs_zeroed = TRUE; -} -#else -static void -zeroHistogram (hist3d histogram) -{ - int i; - /* Zero the histogram or inverse color map */ - for (i = 0; i < HIST_C0_ELEMS; i++) - { - memset (histogram[i], - 0, HIST_C1_ELEMS * HIST_C2_ELEMS * sizeof (histcell)); - } -} -#endif - -static void gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colorsWanted, gdImagePtr *cimP); - -gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int dither, int colorsWanted) -{ - gdImagePtr nim; - gdImageTrueColorToPaletteBody(im, dither, colorsWanted, &nim); - return nim; -} - -void gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted) -{ - gdImageTrueColorToPaletteBody(im, dither, colorsWanted, 0); -} - -/* - * Module initialization routine for 2-pass color quantization. - */ - -#ifdef ORIGINAL_LIB_JPEG -GLOBAL (void) -jinit_2pass_quantizer (j_decompress_ptr cinfo) -#else -static void gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colorsWanted, gdImagePtr *cimP) -#endif -{ - my_cquantize_ptr cquantize = NULL; - int i; - -#ifndef ORIGINAL_LIB_JPEG - /* Allocate the JPEG palette-storage */ - size_t arraysize; - int maxColors = gdMaxColors; - gdImagePtr nim; - if (cimP) { - nim = gdImageCreate(oim->sx, oim->sy); - *cimP = nim; - if (!nim) { - return; - } - } else { - nim = oim; - } - if (!oim->trueColor) - { - /* (Almost) nothing to do! */ - if (cimP) { - gdImageCopy(nim, oim, 0, 0, 0, 0, oim->sx, oim->sy); - *cimP = nim; - } - return; - } - - /* If we have a transparent color (the alphaless mode of transparency), we - * must reserve a palette entry for it at the end of the palette. */ - if (oim->transparent >= 0) - { - maxColors--; - } - if (colorsWanted > maxColors) - { - colorsWanted = maxColors; - } - if (!cimP) { - nim->pixels = gdCalloc (sizeof (unsigned char *), oim->sy); - if (!nim->pixels) - { - /* No can do */ - goto outOfMemory; - } - for (i = 0; (i < nim->sy); i++) - { - nim->pixels[i] = gdCalloc (sizeof (unsigned char *), oim->sx); - if (!nim->pixels[i]) - { - goto outOfMemory; - } - } - } -#endif - -#ifdef ORIGINAL_LIB_JPEG - cquantize = (my_cquantize_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF (my_cquantizer)); - cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; - cquantize->pub.start_pass = start_pass_2_quant; - cquantize->pub.new_color_map = new_color_map_2_quant; - /* Make sure jdmaster didn't give me a case I can't handle */ - if (cinfo->out_color_components != 3) - ERREXIT (cinfo, JERR_NOTIMPL); -#else - cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1); - if (!cquantize) - { - /* No can do */ - goto outOfMemory; - } -#endif - cquantize->fserrors = NULL; /* flag optional arrays not allocated */ - cquantize->error_limiter = NULL; - - - /* Allocate the histogram/inverse colormap storage */ -#ifdef ORIGINAL_LIB_JPEG - cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF (hist2d)); - for (i = 0; i < HIST_C0_ELEMS; i++) - { - cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF (histcell)); - } - cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ -#else - cquantize->histogram = (hist3d) safe_emalloc (HIST_C0_ELEMS, sizeof (hist2d), 0); - for (i = 0; i < HIST_C0_ELEMS; i++) - { - cquantize->histogram[i] = - (hist2d) safe_emalloc (HIST_C1_ELEMS * HIST_C2_ELEMS, sizeof (histcell), 0); - if (!cquantize->histogram[i]) - { - goto outOfMemory; - } - } -#endif - -#ifdef ORIGINAL_LIB_JPEG - /* Allocate storage for the completed colormap, if required. - * We do this now since it is FAR storage and may affect - * the memory manager's space calculations. - */ - if (cinfo->enable_2pass_quant) - { - /* Make sure color count is acceptable */ - int desired = cinfo->desired_number_of_colors; - /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ - if (desired < 8) - ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 8); - /* Make sure colormap indexes can be represented by JSAMPLEs */ - if (desired > MAXNUMCOLORS) - ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); - cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) desired, - (JDIMENSION) 3); - cquantize->desired = desired; - } - else - cquantize->sv_colormap = NULL; - - /* Only F-S dithering or no dithering is supported. */ - /* If user asks for ordered dither, give him F-S. */ - if (cinfo->dither_mode != JDITHER_NONE) - cinfo->dither_mode = JDITHER_FS; - - /* Allocate Floyd-Steinberg workspace if necessary. - * This isn't really needed until pass 2, but again it is FAR storage. - * Although we will cope with a later change in dither_mode, - * we do not promise to honor max_memory_to_use if dither_mode changes. - */ - if (cinfo->dither_mode == JDITHER_FS) - { - cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF (FSERROR)))); - /* Might as well create the error-limiting table too. */ - init_error_limit (cinfo); - } -#else - - cquantize->fserrors = (FSERRPTR) safe_emalloc (3, sizeof (FSERROR), 0); - init_error_limit (oim, nim, cquantize); - arraysize = (size_t) ((nim->sx + 2) * (3 * sizeof (FSERROR))); - /* Allocate Floyd-Steinberg workspace. */ - cquantize->fserrors = gdRealloc(cquantize->fserrors, arraysize); - memset(cquantize->fserrors, 0, arraysize); - if (!cquantize->fserrors) - { - goto outOfMemory; - } - cquantize->on_odd_row = FALSE; - - /* Do the work! */ - zeroHistogram (cquantize->histogram); - prescan_quantize (oim, nim, cquantize); - /* TBB 2.0.5: pass colorsWanted, not 256! */ - select_colors (oim, nim, cquantize, colorsWanted); - zeroHistogram (cquantize->histogram); - if (dither) - { - pass2_fs_dither (oim, nim, cquantize); - } - else - { - pass2_no_dither (oim, nim, cquantize); - } -#if 0 /* 2.0.12; we no longer attempt full alpha in palettes */ - if (cquantize->transparentIsPresent) - { - int mt = -1; - int mtIndex = -1; - for (i = 0; (i < im->colorsTotal); i++) - { - if (im->alpha[i] > mt) - { - mtIndex = i; - mt = im->alpha[i]; - } - } - for (i = 0; (i < im->colorsTotal); i++) - { - if (im->alpha[i] == mt) - { - im->alpha[i] = gdAlphaTransparent; - } - } - } - if (cquantize->opaqueIsPresent) - { - int mo = 128; - int moIndex = -1; - for (i = 0; (i < im->colorsTotal); i++) - { - if (im->alpha[i] < mo) - { - moIndex = i; - mo = im->alpha[i]; - } - } - for (i = 0; (i < im->colorsTotal); i++) - { - if (im->alpha[i] == mo) - { - im->alpha[i] = gdAlphaOpaque; - } - } - } -#endif - - /* If we had a 'transparent' color, increment the color count so it's - * officially in the palette and convert the transparent variable to point to - * an index rather than a color (Its data already exists and transparent - * pixels have already been mapped to it by this point, it is done late as to - * avoid color matching / dithering with it). */ - if (oim->transparent >= 0) - { - nim->transparent = nim->colorsTotal; - nim->colorsTotal++; - } - - /* Success! Get rid of the truecolor image data. */ - if (!cimP) { - oim->trueColor = 0; - /* Junk the truecolor pixels */ - for (i = 0; i < oim->sy; i++) - { - gdFree (oim->tpixels[i]); - } - gdFree (oim->tpixels); - oim->tpixels = 0; - } - goto success; - /* Tediously free stuff. */ -outOfMemory: - if (oim->trueColor) - { - if (!cimP) { - /* On failure only */ - for (i = 0; i < nim->sy; i++) - { - if (nim->pixels[i]) - { - gdFree (nim->pixels[i]); - } - } - if (nim->pixels) - { - gdFree (nim->pixels); - } - nim->pixels = 0; - } else { - gdImageDestroy(nim); - *cimP = 0; - } - } -success: - for (i = 0; i < HIST_C0_ELEMS; i++) - { - if (cquantize->histogram[i]) - { - gdFree (cquantize->histogram[i]); - } - } - if (cquantize->histogram) - { - gdFree (cquantize->histogram); - } - if (cquantize->fserrors) - { - gdFree (cquantize->fserrors); - } - if (cquantize->error_limiter_storage) - { - gdFree (cquantize->error_limiter_storage); - } - if (cquantize) - { - gdFree (cquantize); - } - -#endif -} - - -/* bring the palette colors in im2 to be closer to im1 - * - */ -int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2) -{ - unsigned long *buf; /* stores our calculations */ - unsigned long *bp; /* buf ptr */ - int color, rgb; - int x,y; - int count; - - if( !im1->trueColor ) { - return -1; /* im1 must be True Color */ - } - if( im2->trueColor ) { - return -2; /* im2 must be indexed */ - } - if( (im1->sx != im2->sx) || (im1->sy != im2->sy) ) { - return -3; /* the images are meant to be the same dimensions */ - } - - buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * im2->colorsTotal, 0); - memset( buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal ); - - for (x=0; xsx; x++) { - for( y=0; ysy; y++ ) { - color = im2->pixels[y][x]; - rgb = im1->tpixels[y][x]; - bp = buf + (color * 5); - (*(bp++))++; - *(bp++) += gdTrueColorGetRed(rgb); - *(bp++) += gdTrueColorGetGreen(rgb); - *(bp++) += gdTrueColorGetBlue(rgb); - *(bp++) += gdTrueColorGetAlpha(rgb); - } - } - bp = buf; - for (color=0; colorcolorsTotal; color++) { - count = *(bp++); - if( count > 0 ) { - im2->red[color] = *(bp++) / count; - im2->green[color] = *(bp++) / count; - im2->blue[color] = *(bp++) / count; - im2->alpha[color] = *(bp++) / count; - } else { - bp += 4; - } - } - gdFree(buf); - return 0; -} - - -#endif diff --git a/ext/gd/libgd/gd_wbmp.c b/ext/gd/libgd/gd_wbmp.c deleted file mode 100644 index b81eed80e7561..0000000000000 --- a/ext/gd/libgd/gd_wbmp.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - WBMP: Wireless Bitmap Type 0: B/W, Uncompressed Bitmap - Specification of the WBMP format can be found in the file: - SPEC-WAESpec-19990524.pdf - You can download the WAP specification on: http://www.wapforum.com/ - - gd_wbmp.c - - Copyright (C) Johan Van den Brande (johan@vandenbrande.com) - - Fixed: gdImageWBMPPtr, gdImageWBMP - - Recoded: gdImageWBMPCtx for use with my wbmp library - (wbmp library included, but you can find the latest distribution - at http://www.vandenbrande.com/wbmp) - - Implemented: gdImageCreateFromWBMPCtx, gdImageCreateFromWBMP - - --------------------------------------------------------------------------- - - Parts of this code are from Maurice Smurlo. - - - ** Copyright (C) Maurice Szmurlo --- T-SIT --- January 2000 - ** (Maurice.Szmurlo@info.unicaen.fr) - - ** Permission to use, copy, modify, and distribute this software and its - ** documentation for any purpose and without fee is hereby granted, provided - ** that the above copyright notice appear in all copies and that both that - ** copyright notice and this permission notice appear in supporting - ** documentation. This software is provided "as is" without express or - ** implied warranty. - - --------------------------------------------------------------------------- - Parts od this code are inspired by 'pbmtowbmp.c' and 'wbmptopbm.c' by - Terje Sannum . - ** - ** Permission to use, copy, modify, and distribute this software and its - ** documentation for any purpose and without fee is hereby granted, provided - ** that the above copyright notice appear in all copies and that both that - ** copyright notice and this permission notice appear in supporting - ** documentation. This software is provided "as is" without express or - ** implied warranty. - ** - --------------------------------------------------------------------------- - - Todo: - - gdCreateFromWBMP function for reading WBMP files - - ---------------------------------------------------------------------------- - */ - -#include -#include -#include -#include -#include - -#include "wbmp.h" - - -/* gd_putout - ** --------- - ** Wrapper around gdPutC for use with writewbmp - ** - */ -void gd_putout (int i, void *out) -{ - gdPutC(i, (gdIOCtx *) out); -} - - -/* gd_getin - ** -------- - ** Wrapper around gdGetC for use with readwbmp - ** - */ -int gd_getin (void *in) -{ - return (gdGetC((gdIOCtx *) in)); -} - - -/* gdImageWBMPCtx - ** -------------- - ** Write the image as a wbmp file - ** Parameters are: - ** image: gd image structure; - ** fg: the index of the foreground color. any other value will be - ** considered as background and will not be written - ** out: the stream where to write - */ -void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out) -{ - int x, y, pos; - Wbmp *wbmp; - - /* create the WBMP */ - if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) { - php_gd_error("Could not create WBMP"); - } - - /* fill up the WBMP structure */ - pos = 0; - for (y = 0; y < gdImageSY(image); y++) { - for (x = 0; x < gdImageSX(image); x++) { - if (gdImageGetPixel (image, x, y) == fg) { - wbmp->bitmap[pos] = WBMP_BLACK; - } - pos++; - } - } - - /* write the WBMP to a gd file descriptor */ - if (writewbmp (wbmp, &gd_putout, out)) { - php_gd_error("Could not save WBMP"); - } - /* des submitted this bugfix: gdFree the memory. */ - freewbmp(wbmp); -} - -/* gdImageCreateFromWBMPCtx - ** ------------------------ - ** Create a gdImage from a WBMP file input from an gdIOCtx - */ -gdImagePtr gdImageCreateFromWBMPCtx (gdIOCtx * infile) -{ - /* FILE *wbmp_file; */ - Wbmp *wbmp; - gdImagePtr im = NULL; - int black, white; - int col, row, pos; - - if (readwbmp (&gd_getin, infile, &wbmp)) { - return NULL; - } - - if (!(im = gdImageCreate (wbmp->width, wbmp->height))) { - freewbmp (wbmp); - return NULL; - } - - /* create the background color */ - white = gdImageColorAllocate(im, 255, 255, 255); - /* create foreground color */ - black = gdImageColorAllocate(im, 0, 0, 0); - - /* fill in image (in a wbmp 1 = white/ 0 = black) */ - pos = 0; - for (row = 0; row < wbmp->height; row++) { - for (col = 0; col < wbmp->width; col++) { - if (wbmp->bitmap[pos++] == WBMP_WHITE) { - gdImageSetPixel(im, col, row, white); - } else { - gdImageSetPixel(im, col, row, black); - } - } - } - - freewbmp(wbmp); - - return im; -} - -/* gdImageCreateFromWBMP - ** --------------------- - */ -gdImagePtr gdImageCreateFromWBMP (FILE * inFile) -{ - gdImagePtr im; - gdIOCtx *in = gdNewFileCtx(inFile); - im = gdImageCreateFromWBMPCtx(in); - in->gd_free(in); - - return im; -} - -gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data) -{ - gdImagePtr im; - gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); - im = gdImageCreateFromWBMPCtx(in); - in->gd_free(in); - return im; -} - -/* gdImageWBMP - ** ----------- - */ -void gdImageWBMP (gdImagePtr im, int fg, FILE * outFile) -{ - gdIOCtx *out = gdNewFileCtx(outFile); - gdImageWBMPCtx(im, fg, out); - out->gd_free(out); -} - -/* gdImageWBMPPtr - ** -------------- - */ -void * gdImageWBMPPtr (gdImagePtr im, int *size, int fg) -{ - void *rv; - gdIOCtx *out = gdNewDynamicCtx(2048, NULL); - gdImageWBMPCtx(im, fg, out); - rv = gdDPExtractData(out, size); - out->gd_free(out); - - return rv; -} diff --git a/ext/gd/libgd/gdcache.c b/ext/gd/libgd/gdcache.c deleted file mode 100644 index e3b057a3ee470..0000000000000 --- a/ext/gd/libgd/gdcache.c +++ /dev/null @@ -1,210 +0,0 @@ -#include "gd.h" -#include "gdhelpers.h" - -#ifdef HAVE_LIBFREETYPE -#define NEED_CACHE 1 -#endif - -#ifdef NEED_CACHE - -/* - * gdcache.c - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@graphviz.org) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -#include "gdcache.h" - -/*********************************************************/ -/* implementation */ -/*********************************************************/ - - -/* create a new cache */ -gdCache_head_t * -gdCacheCreate ( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease) -{ - gdCache_head_t *head; - - head = (gdCache_head_t *) gdPMalloc(sizeof (gdCache_head_t)); - head->mru = NULL; - head->size = size; - head->gdCacheTest = gdCacheTest; - head->gdCacheFetch = gdCacheFetch; - head->gdCacheRelease = gdCacheRelease; - return head; -} - -void -gdCacheDelete (gdCache_head_t * head) -{ - gdCache_element_t *elem, *prev; - - elem = head->mru; - while (elem) - { - (*(head->gdCacheRelease)) (elem->userdata); - prev = elem; - elem = elem->next; - gdPFree ((char *) prev); - } - gdPFree ((char *) head); -} - -void * -gdCacheGet (gdCache_head_t * head, void *keydata) -{ - int i = 0; - gdCache_element_t *elem, *prev = NULL, *prevprev = NULL; - void *userdata; - - elem = head->mru; - while (elem) - { - if ((*(head->gdCacheTest)) (elem->userdata, keydata)) - { - if (i) - { /* if not already most-recently-used */ - /* relink to top of list */ - prev->next = elem->next; - elem->next = head->mru; - head->mru = elem; - } - return elem->userdata; - } - prevprev = prev; - prev = elem; - elem = elem->next; - i++; - } - userdata = (*(head->gdCacheFetch)) (&(head->error), keydata); - if (!userdata) - { - /* if there was an error in the fetch then don't cache */ - return NULL; - } - if (i < head->size) - { /* cache still growing - add new elem */ - elem = (gdCache_element_t *) gdPMalloc(sizeof (gdCache_element_t)); - } - else - { /* cache full - replace least-recently-used */ - /* preveprev becomes new end of list */ - prevprev->next = NULL; - elem = prev; - (*(head->gdCacheRelease)) (elem->userdata); - } - /* relink to top of list */ - elem->next = head->mru; - head->mru = elem; - elem->userdata = userdata; - return userdata; -} - - - -/*********************************************************/ -/* test stub */ -/*********************************************************/ - - -#ifdef TEST - -#include - -typedef struct -{ - int key; - int value; -} -key_value_t; - -static int -cacheTest (void *map, void *key) -{ - return (((key_value_t *) map)->key == *(int *) key); -} - -static void * -cacheFetch (char **error, void *key) -{ - key_value_t *map; - - map = (key_value_t *) gdMalloc (sizeof (key_value_t)); - map->key = *(int *) key; - map->value = 3; - - *error = NULL; - return (void *) map; -} - -static void -cacheRelease (void *map) -{ - gdFree ((char *) map); -} - -int -main (char *argv[], int argc) -{ - gdCache_head_t *cacheTable; - int elem, key; - - cacheTable = gdCacheCreate (3, cacheTest, cacheFetch, cacheRelease); - - key = 20; - elem = *(int *) gdCacheGet (cacheTable, &key); - key = 30; - elem = *(int *) gdCacheGet (cacheTable, &key); - key = 40; - elem = *(int *) gdCacheGet (cacheTable, &key); - key = 50; - elem = *(int *) gdCacheGet (cacheTable, &key); - key = 30; - elem = *(int *) gdCacheGet (cacheTable, &key); - key = 30; - elem = *(int *) gdCacheGet (cacheTable, &key); - - gdCacheDelete (cacheTable); - - return 0; -} - -#endif /* TEST */ -#endif /* HAVE_NEEDCACHE */ diff --git a/ext/gd/libgd/gdcache.h b/ext/gd/libgd/gdcache.h deleted file mode 100644 index 6a6e892447bde..0000000000000 --- a/ext/gd/libgd/gdcache.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * gdcache.h - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@graphviz.org) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -/*********************************************************/ -/* header */ -/*********************************************************/ - -#include -#ifdef HAVE_MALLOC_H - #include -#endif -#ifndef NULL -#define NULL (void *)0 -#endif - -/* user defined function templates */ -typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); -typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); -typedef void (*gdCacheReleaseFn_t)(void *userdata); - -/* element structure */ -typedef struct gdCache_element_s gdCache_element_t; -struct gdCache_element_s { - gdCache_element_t *next; - void *userdata; -}; - -/* head structure */ -typedef struct gdCache_head_s gdCache_head_t; -struct gdCache_head_s { - gdCache_element_t *mru; - int size; - char *error; - gdCacheTestFn_t gdCacheTest; - gdCacheFetchFn_t gdCacheFetch; - gdCacheReleaseFn_t gdCacheRelease; -}; - -/* function templates */ -gdCache_head_t * -gdCacheCreate( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease ); - -void -gdCacheDelete( gdCache_head_t *head ); - -void * -gdCacheGet( gdCache_head_t *head, void *keydata ); diff --git a/ext/gd/libgd/gddemo.c b/ext/gd/libgd/gddemo.c deleted file mode 100644 index a5ceeb53b86b8..0000000000000 --- a/ext/gd/libgd/gddemo.c +++ /dev/null @@ -1,118 +0,0 @@ -#include -#include "gd.h" -#include "gdfontg.h" -#include "gdfonts.h" - -int -main (void) -{ - /* Input and output files */ - FILE *in; - FILE *out; - - /* Input and output images */ - gdImagePtr im_in = 0, im_out = 0; - - /* Brush image */ - gdImagePtr brush; - - /* Color indexes */ - int white; - int blue; - int red; - int green; - - /* Points for polygon */ - gdPoint points[3]; - - /* Create output image, 256 by 256 pixels, true color. */ - im_out = gdImageCreateTrueColor (256, 256); - /* First color allocated is background. */ - white = gdImageColorAllocate (im_out, 255, 255, 255); - - /* Set transparent color. */ - gdImageColorTransparent (im_out, white); - - /* Try to load demoin.png and paste part of it into the - output image. */ - in = fopen ("demoin.png", "rb"); - if (!in) - { - fprintf (stderr, "Can't load source image; this demo\n"); - fprintf (stderr, "is much more impressive if demoin.png\n"); - fprintf (stderr, "is available.\n"); - im_in = 0; - } - else - { - im_in = gdImageCreateFromPng (in); - fclose (in); - /* Now copy, and magnify as we do so */ - gdImageCopyResized (im_out, im_in, - 32, 32, 0, 0, 192, 192, 255, 255); - } - red = gdImageColorAllocate (im_out, 255, 0, 0); - green = gdImageColorAllocate (im_out, 0, 255, 0); - blue = gdImageColorAllocate (im_out, 0, 0, 255); - /* Rectangle */ - gdImageLine (im_out, 16, 16, 240, 16, green); - gdImageLine (im_out, 240, 16, 240, 240, green); - gdImageLine (im_out, 240, 240, 16, 240, green); - gdImageLine (im_out, 16, 240, 16, 16, green); - /* Circle */ - gdImageArc (im_out, 128, 128, 60, 20, 0, 720, blue); - /* Arc */ - gdImageArc (im_out, 128, 128, 40, 40, 90, 270, blue); - /* Flood fill: doesn't do much on a continuously - variable tone jpeg original. */ - gdImageFill (im_out, 8, 8, blue); - /* Polygon */ - points[0].x = 64; - points[0].y = 0; - points[1].x = 0; - points[1].y = 128; - points[2].x = 128; - points[2].y = 128; - gdImageFilledPolygon (im_out, points, 3, green); - /* Brush. A fairly wild example also involving a line style! */ - if (im_in) - { - int style[8]; - brush = gdImageCreateTrueColor (16, 16); - gdImageCopyResized (brush, im_in, - 0, 0, 0, 0, - gdImageSX (brush), gdImageSY (brush), - gdImageSX (im_in), gdImageSY (im_in)); - gdImageSetBrush (im_out, brush); - /* With a style, so they won't overprint each other. - Normally, they would, yielding a fat-brush effect. */ - style[0] = 0; - style[1] = 0; - style[2] = 0; - style[3] = 0; - style[4] = 0; - style[5] = 0; - style[6] = 0; - style[7] = 1; - gdImageSetStyle (im_out, style, 8); - /* Draw the styled, brushed line */ - gdImageLine (im_out, 0, 255, 255, 0, gdStyledBrushed); - } - /* Text */ - gdImageString (im_out, gdFontGiant, 32, 32, - (unsigned char *) "hi", red); - gdImageStringUp (im_out, gdFontSmall, 64, 64, - (unsigned char *) "hi", red); - /* Make output image interlaced (progressive, in the case of JPEG) */ - gdImageInterlace (im_out, 1); - out = fopen ("demoout.png", "wb"); - /* Write PNG */ - gdImagePng (im_out, out); - fclose (out); - gdImageDestroy (im_out); - if (im_in) - { - gdImageDestroy (im_in); - } - return 0; -} diff --git a/ext/gd/libgd/gdfontg.c b/ext/gd/libgd/gdfontg.c deleted file mode 100644 index 61c8c2710e287..0000000000000 --- a/ext/gd/libgd/gdfontg.c +++ /dev/null @@ -1,4389 +0,0 @@ - - -/* - This is a header file for gd font, generated using - bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -Misc-Fixed-Bold-R-Normal-Sans-15-140-75-75-C-90-ISO8859-2 - at Mon Jan 26 14:45:58 1998. - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gdfontg.h" - -char gdFontGiantData[] = -{ -/* Char 0 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 1 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 2 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 1, 0, - -/* Char 3 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 4 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 5 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 6 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 7 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 8 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 9 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 10 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 11 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 12 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 13 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 14 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 15 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 16 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 17 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 18 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 19 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 20 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 21 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 22 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 23 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 24 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 25 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 26 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 27 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 28 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 29 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 30 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 0, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 31 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 32 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 33 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 34 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 35 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 36 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 37 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 38 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 39 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 40 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 41 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 42 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 43 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 44 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 45 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 46 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 47 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 48 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 49 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 50 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 51 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 52 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 53 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 54 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 55 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 56 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 57 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 58 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 59 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 60 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 61 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 62 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 63 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 64 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 65 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 66 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 67 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 68 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 69 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 70 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 71 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 72 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 73 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 74 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 75 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 76 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 77 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 78 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 79 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 80 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 81 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 82 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 83 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 84 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 85 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 86 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 87 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 88 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 89 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 90 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 91 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 92 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 93 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 94 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 95 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 96 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 97 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 98 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 99 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 100 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 101 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 102 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 103 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - -/* Char 104 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 105 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 106 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, 0, - -/* Char 107 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 108 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 109 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 110 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 111 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 112 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - -/* Char 113 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - -/* Char 114 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 115 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 116 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 117 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 118 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 119 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 120 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 121 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - -/* Char 122 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 123 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 124 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 125 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 126 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 127 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 128 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 129 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 130 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 131 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 132 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 133 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 134 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 135 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 136 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 137 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 138 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 139 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 140 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 141 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 142 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 143 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 144 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 145 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 146 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 147 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 148 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 149 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 150 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 151 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 152 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 153 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 154 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 155 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 156 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 157 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 158 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 159 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 160 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 161 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - -/* Char 162 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 163 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 164 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 165 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 166 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 167 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 168 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 169 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 170 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - -/* Char 171 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 172 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 173 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 174 */ - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 175 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 176 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 177 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 1, - -/* Char 178 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, 0, - -/* Char 179 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 180 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 181 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 182 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 183 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 184 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - -/* Char 185 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 186 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - -/* Char 187 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 188 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 189 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 190 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 191 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 192 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 193 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 194 */ - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 195 */ - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 196 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 197 */ - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 198 */ - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 199 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - -/* Char 200 */ - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 201 */ - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 202 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - -/* Char 203 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 204 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 205 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 206 */ - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 207 */ - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 208 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 209 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 210 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 211 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 212 */ - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 213 */ - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 214 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 215 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 216 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 217 */ - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 218 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 219 */ - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 220 */ - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 221 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 222 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - -/* Char 223 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 224 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 225 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 226 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 227 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 228 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 229 */ - 0, 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 230 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 231 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - -/* Char 232 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 233 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 234 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - -/* Char 235 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 236 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 237 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 238 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 239 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 240 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 241 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 242 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 243 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 244 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 245 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 246 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 247 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 248 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 249 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 250 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 251 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 252 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 253 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, - -/* Char 254 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, 0, - -/* Char 255 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - - -}; - -gdFont gdFontGiantRep = -{ - 256, - 0, - 9, - 15, - gdFontGiantData -}; - -gdFontPtr gdFontGiant = &gdFontGiantRep; - -gdFontPtr gdFontGetGiant(void) -{ - return gdFontGiant; -} - -/* This file has not been truncated. */ diff --git a/ext/gd/libgd/gdfontg.h b/ext/gd/libgd/gdfontg.h deleted file mode 100644 index 8a3e95e8bc827..0000000000000 --- a/ext/gd/libgd/gdfontg.h +++ /dev/null @@ -1,30 +0,0 @@ - -#ifndef _GDFONTG_H_ -#define _GDFONTG_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This is a header file for gd font, generated using - bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -Misc-Fixed-Bold-R-Normal-Sans-15-140-75-75-C-90-ISO8859-2 - at Mon Jan 26 14:45:58 1998. - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gd.h" - -extern gdFontPtr gdFontGiant; -extern gdFontPtr gdFontGetGiant(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/ext/gd/libgd/gdfontl.c b/ext/gd/libgd/gdfontl.c deleted file mode 100644 index 6da54e1a1223c..0000000000000 --- a/ext/gd/libgd/gdfontl.c +++ /dev/null @@ -1,4646 +0,0 @@ - - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-medium-r-normal--16-140-75-75-c-80-iso8859-2 - at Tue Jan 6 19:39:27 1998. - - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gdfontl.h" - -char gdFontLargeData[] = -{ -/* Char 0 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 1 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 2 */ - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 1, - -/* Char 3 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 4 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 5 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 6 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 7 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 8 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 9 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 10 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 11 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 12 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 13 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 14 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 15 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 16 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 17 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 18 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 19 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 20 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 21 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 22 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 23 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 24 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 25 */ - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 26 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 27 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 28 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 1, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 29 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 30 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 31 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 32 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 33 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 34 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 35 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 36 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 37 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 1, 0, 0, - 0, 1, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 1, 0, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 38 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 1, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 39 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 40 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 41 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 42 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 43 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 44 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 45 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 46 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 47 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 48 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 49 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 50 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 51 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 52 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 53 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 54 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 55 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 56 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 57 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 58 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 59 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 60 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 61 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 62 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 63 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 64 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 65 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 66 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 67 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 68 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 69 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 70 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 71 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 72 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 73 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 74 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 75 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 76 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 77 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 78 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 79 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 80 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 81 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 1, 0, 1, 0, - 0, 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 82 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 83 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 84 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 85 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 86 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 87 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 88 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 89 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 90 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 91 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 92 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 93 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 94 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 95 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 96 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 97 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 98 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 99 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 100 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 101 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 102 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 103 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - -/* Char 104 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 105 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 106 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - -/* Char 107 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 108 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 109 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 110 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 111 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 112 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - -/* Char 113 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - -/* Char 114 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 115 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 116 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 117 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 118 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 119 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 120 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 121 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - -/* Char 122 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 123 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 124 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 125 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 126 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 127 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 128 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 129 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 130 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 131 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 132 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 133 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 134 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 135 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 136 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 137 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 138 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 139 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 140 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 141 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 142 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 143 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 144 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 145 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 146 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 147 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 148 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 149 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 150 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 151 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 152 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 153 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 154 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 155 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 156 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 157 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 158 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 159 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 160 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 161 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, - -/* Char 162 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 163 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 164 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 165 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 166 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 167 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 168 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 169 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 170 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 171 */ - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 172 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 173 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 174 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 175 */ - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 176 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 177 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, - -/* Char 178 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - -/* Char 179 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 180 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 181 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 182 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 183 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 184 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - -/* Char 185 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 186 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 187 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 188 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 189 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 190 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 191 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 192 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 193 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 194 */ - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 195 */ - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 196 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 197 */ - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 198 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 199 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - -/* Char 200 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 201 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 202 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, - -/* Char 203 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 204 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 205 */ - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 206 */ - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 207 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 208 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 209 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 210 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 211 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 212 */ - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 213 */ - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 214 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 215 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 216 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 217 */ - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 218 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 219 */ - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 220 */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 221 */ - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 222 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 223 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 1, 1, 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 224 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 225 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 226 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 227 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 228 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 229 */ - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 230 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 231 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - -/* Char 232 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 233 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 234 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - -/* Char 235 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 236 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 237 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 238 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 239 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 1, 0, 1, - 0, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 240 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 241 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 242 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 243 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 244 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 245 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 246 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 247 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 248 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 249 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 250 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 251 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 252 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -/* Char 253 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 0, - -/* Char 254 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - -/* Char 255 */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - -}; - -gdFont gdFontLargeRep = -{ - 256, - 0, - 8, - 16, - gdFontLargeData -}; - -gdFontPtr gdFontLarge = &gdFontLargeRep; - -gdFontPtr gdFontGetLarge(void) -{ - return gdFontLarge; -} - -/* This file has not been truncated. */ diff --git a/ext/gd/libgd/gdfontl.h b/ext/gd/libgd/gdfontl.h deleted file mode 100644 index 92fee14ff3343..0000000000000 --- a/ext/gd/libgd/gdfontl.h +++ /dev/null @@ -1,31 +0,0 @@ - -#ifndef _GDFONTL_H_ -#define _GDFONTL_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-medium-r-normal--16-140-75-75-c-80-iso8859-2 - at Tue Jan 6 19:39:27 1998. - - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gd.h" - -extern gdFontPtr gdFontLarge; -extern gdFontPtr gdFontGetLarge(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/ext/gd/libgd/gdfontmb.c b/ext/gd/libgd/gdfontmb.c deleted file mode 100644 index dab7c0589de2d..0000000000000 --- a/ext/gd/libgd/gdfontmb.c +++ /dev/null @@ -1,3876 +0,0 @@ - - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 - at Thu Jan 8 13:54:57 1998. - No copyright info was found in the original bdf. - */ - - -#include "gdfontmb.h" - -char gdFontMediumBoldData[] = -{ -/* Char 0 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 1 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 2 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 3 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 4 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 5 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 0, - 0, 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 6 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 7 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 8 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 9 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 10 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 11 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 12 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 13 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 14 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 15 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 16 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 17 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 18 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 19 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 20 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 21 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 22 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 23 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 24 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 25 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 26 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 27 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 28 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 29 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 30 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 31 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 32 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 33 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 34 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 35 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 36 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 0, 1, 1, 0, 1, 0, - 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 0, - 1, 0, 1, 1, 0, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 37 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 38 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 0, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 39 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 40 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 41 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 42 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 43 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 44 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 45 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 46 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 47 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 48 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 49 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 50 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 51 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 52 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 53 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 54 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 55 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 56 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 57 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 58 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 59 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 60 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 61 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 62 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 63 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 64 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 1, 1, 1, 0, - 1, 0, 1, 0, 1, 1, 0, - 1, 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 65 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 66 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 67 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 68 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 69 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 70 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 71 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 72 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 73 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 74 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 75 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 76 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 77 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 78 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 79 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 80 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 81 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 82 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 83 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 84 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 85 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 86 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 87 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 88 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 89 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 90 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 91 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 92 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 93 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 94 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 95 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 96 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 97 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 98 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 99 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 100 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 101 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 102 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 103 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - -/* Char 104 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 105 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 106 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - -/* Char 107 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 108 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 109 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 110 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 111 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 112 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - -/* Char 113 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - -/* Char 114 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 115 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 116 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 117 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 118 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 119 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 120 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 121 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - -/* Char 122 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 123 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 124 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 125 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 126 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 127 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 128 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 129 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 130 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 131 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 132 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 133 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 134 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 135 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 136 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 137 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 138 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 139 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 140 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 141 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 142 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 143 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 144 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 145 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 146 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 147 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 148 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 149 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 150 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 151 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 152 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 153 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 154 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 155 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 156 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 157 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 158 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 159 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 160 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 161 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - -/* Char 162 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 163 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 164 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 165 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 166 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 167 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 168 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 169 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 170 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - -/* Char 171 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 172 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 173 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 174 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 175 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 176 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 177 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - -/* Char 178 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - -/* Char 179 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 180 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 181 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 182 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 183 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 184 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - -/* Char 185 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 186 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - -/* Char 187 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 188 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 189 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 190 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 191 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 192 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 193 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 194 */ - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 195 */ - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 196 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 197 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 198 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 199 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - -/* Char 200 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 201 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 202 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - -/* Char 203 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 204 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 205 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 206 */ - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 207 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 208 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 209 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 210 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 211 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 212 */ - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 213 */ - 0, 1, 1, 0, 0, 1, 1, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 214 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 215 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 216 */ - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 217 */ - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 218 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 219 */ - 0, 1, 1, 0, 0, 1, 1, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 220 */ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 221 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 222 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - -/* Char 223 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 224 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 225 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 226 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 227 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 228 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 229 */ - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 230 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 231 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - -/* Char 232 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 233 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 234 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - -/* Char 235 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 236 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 237 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 238 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 239 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, - 0, 0, 0, 1, 1, 0, 1, - 0, 0, 0, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 1, 1, 0, 1, 1, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 240 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 241 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 242 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 243 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 244 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 245 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 246 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 247 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 248 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 249 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 250 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 251 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 1, 1, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 252 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - -/* Char 253 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 0, - -/* Char 254 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, - -/* Char 255 */ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - - -}; - -gdFont gdFontMediumBoldRep = -{ - 256, - 0, - 7, - 13, - gdFontMediumBoldData -}; - -gdFontPtr gdFontMediumBold = &gdFontMediumBoldRep; - -gdFontPtr gdFontGetMediumBold(void) -{ - return gdFontMediumBold; -} - -/* This file has not been truncated. */ diff --git a/ext/gd/libgd/gdfontmb.h b/ext/gd/libgd/gdfontmb.h deleted file mode 100644 index 2e2f0cbe4798c..0000000000000 --- a/ext/gd/libgd/gdfontmb.h +++ /dev/null @@ -1,29 +0,0 @@ - -#ifndef _GDFONTMB_H_ -#define _GDFONTMB_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 - at Thu Jan 8 13:54:57 1998. - No copyright info was found in the original bdf. - */ - - -#include "gd.h" - -extern gdFontPtr gdFontMediumBold; -extern gdFontPtr gdFontGetMediumBold(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/ext/gd/libgd/gdfonts.c b/ext/gd/libgd/gdfonts.c deleted file mode 100644 index 165cf70c54ad9..0000000000000 --- a/ext/gd/libgd/gdfonts.c +++ /dev/null @@ -1,3876 +0,0 @@ - - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 - at Thu Jan 8 14:13:20 1998. - No copyright info was found in the original bdf. - */ - - -#include "gdfonts.h" - -char gdFontSmallData[] = -{ -/* Char 0 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 1 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 2 */ - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 0, - -/* Char 3 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 4 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 5 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 6 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 7 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 8 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 9 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - -/* Char 10 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 11 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 12 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 13 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 14 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 15 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 16 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 17 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 18 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 19 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 20 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 21 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 22 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 23 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 24 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 25 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 26 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 27 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 28 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 29 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 30 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 31 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 32 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 33 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 34 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 35 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 1, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 36 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 1, 0, - 0, 0, 1, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 37 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 38 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 39 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 40 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 41 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 42 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 43 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 44 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 45 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 46 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 47 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 48 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 49 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 50 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 51 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 52 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 53 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 54 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 55 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 56 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 57 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 58 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 59 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 60 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 61 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 62 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 63 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 64 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 65 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 66 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 67 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 68 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 69 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 70 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 71 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 72 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 73 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 74 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 75 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 76 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 77 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 78 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 79 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 80 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 81 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 82 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 83 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 84 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 85 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 86 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 87 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 88 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 89 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 90 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 91 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 92 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 93 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 94 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 95 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 96 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 97 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 98 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 99 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 100 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 101 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 102 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 103 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - -/* Char 104 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 105 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 106 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - -/* Char 107 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 108 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 109 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 0, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 110 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 111 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 112 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - -/* Char 113 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - -/* Char 114 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 115 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 116 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 117 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 118 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 119 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 120 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 121 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, 0, - -/* Char 122 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 123 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 124 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 125 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 126 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 127 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 128 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 129 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 130 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 131 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 132 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 133 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 134 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 135 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 136 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 137 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 138 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 139 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 140 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 141 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 142 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 143 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 144 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 145 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 146 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 147 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 148 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 149 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 150 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 151 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 152 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 153 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 154 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 155 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 156 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 157 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 158 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 159 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 160 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 161 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 1, - -/* Char 162 */ - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 163 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 164 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 165 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 166 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 167 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 168 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 169 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 170 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - -/* Char 171 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 172 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 173 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 174 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 175 */ - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 176 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 177 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 1, - -/* Char 178 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - -/* Char 179 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 180 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 181 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, - 0, 1, 1, 0, 0, 1, - 0, 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 182 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 183 */ - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 184 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - -/* Char 185 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 186 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - -/* Char 187 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 188 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 189 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 190 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 191 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 192 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 193 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 194 */ - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 195 */ - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 196 */ - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 197 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 198 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 199 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - -/* Char 200 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 201 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 202 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - -/* Char 203 */ - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 204 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 205 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 206 */ - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 207 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 208 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 1, 1, 1, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 209 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 210 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 211 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 212 */ - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 213 */ - 0, 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 214 */ - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 215 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 216 */ - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 217 */ - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 218 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 219 */ - 0, 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 220 */ - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 221 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 222 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 223 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 224 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 225 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 226 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 227 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 228 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 229 */ - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 230 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 231 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, 0, - -/* Char 232 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 233 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 234 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - -/* Char 235 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 236 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 237 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 238 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 239 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 1, 0, - 0, 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 240 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 1, 1, - 0, 0, 0, 0, 1, 0, - 0, 1, 1, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 241 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 242 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 243 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 244 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 245 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 246 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 247 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 248 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 0, 0, - 1, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 249 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 250 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 251 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 252 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - -/* Char 253 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 1, 0, - 0, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, 0, - -/* Char 254 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, - 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, - -/* Char 255 */ - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - - -}; - -gdFont gdFontSmallRep = -{ - 256, - 0, - 6, - 13, - gdFontSmallData -}; - -gdFontPtr gdFontSmall = &gdFontSmallRep; - -gdFontPtr gdFontGetSmall(void) -{ - return gdFontSmall; -} - -/* This file has not been truncated. */ diff --git a/ext/gd/libgd/gdfonts.h b/ext/gd/libgd/gdfonts.h deleted file mode 100644 index 55d0e1f0b2ad8..0000000000000 --- a/ext/gd/libgd/gdfonts.h +++ /dev/null @@ -1,29 +0,0 @@ - -#ifndef _GDFONTS_H_ -#define _GDFONTS_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 - at Thu Jan 8 14:13:20 1998. - No copyright info was found in the original bdf. - */ - - -#include "gd.h" - -extern gdFontPtr gdFontSmall; -extern gdFontPtr gdFontGetSmall(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/ext/gd/libgd/gdfontt.c b/ext/gd/libgd/gdfontt.c deleted file mode 100644 index 2e6d241506a94..0000000000000 --- a/ext/gd/libgd/gdfontt.c +++ /dev/null @@ -1,2597 +0,0 @@ - - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-2 - at Thu Jan 8 13:49:54 1998. - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gdfontt.h" - -char gdFontTinyData[] = -{ -/* Char 0 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 1 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 1, 1, 1, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 2 */ - 0, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - -/* Char 3 */ - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 1, 1, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - -/* Char 4 */ - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, - 1, 0, 1, 1, 1, - 1, 0, 1, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 5 */ - 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 1, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 1, - -/* Char 6 */ - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, - -/* Char 7 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 8 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 9 */ - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, - -/* Char 10 */ - 1, 0, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 1, 1, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - -/* Char 11 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 12 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 13 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 14 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 15 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 16 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 17 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 18 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 19 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 20 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 21 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 22 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 23 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 24 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 25 */ - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - -/* Char 26 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 27 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 28 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 29 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 30 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 0, 0, 1, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 1, - 1, 0, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 31 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 32 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 33 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 34 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 35 */ - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 1, 1, 1, 1, 1, - 0, 1, 0, 1, 0, - 1, 1, 1, 1, 1, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 36 */ - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 1, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 37 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, - 1, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 1, - 1, 0, 0, 1, 1, - 0, 0, 0, 0, 0, - -/* Char 38 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 1, - 0, 0, 0, 0, 0, - -/* Char 39 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 40 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 41 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 42 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 43 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 44 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 45 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 46 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 47 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 48 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 49 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 50 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 51 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 52 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 53 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 54 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 55 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 56 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 57 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 58 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 59 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - -/* Char 60 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 61 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 62 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 63 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 64 */ - 0, 0, 1, 1, 0, - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 1, - 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, - 1, 0, 0, 1, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - -/* Char 65 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 66 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 67 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 68 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 69 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 70 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 71 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 72 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 73 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 74 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 75 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 76 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 77 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 78 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 1, 1, 0, - 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 79 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 80 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 81 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - -/* Char 82 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 83 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 84 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 85 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 86 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 87 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 88 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 89 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 90 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 91 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 92 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, - -/* Char 93 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 94 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 95 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - -/* Char 96 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 97 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 98 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 99 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 100 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 101 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 102 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 103 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - -/* Char 104 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 105 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 106 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - -/* Char 107 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 108 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 109 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, - 1, 0, 0, 0, 1, - 0, 0, 0, 0, 0, - -/* Char 110 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 111 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 112 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - -/* Char 113 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 0, 0, 1, 0, - -/* Char 114 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 115 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 116 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 117 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 118 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 119 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, - 1, 0, 1, 0, 1, - 1, 0, 1, 0, 1, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 120 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 121 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - -/* Char 122 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 123 */ - 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 124 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 125 */ - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 126 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 127 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 128 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 129 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 130 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 131 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 132 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 133 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 134 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 135 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 136 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 137 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 138 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 139 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 140 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 141 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 142 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 143 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 144 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 145 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 146 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 147 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 148 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 149 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 150 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 151 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 152 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 153 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 154 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 155 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 156 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 157 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 158 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 159 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 160 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 161 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 0, 0, 1, 1, - -/* Char 162 */ - 1, 0, 0, 0, 1, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 163 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - -/* Char 164 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, - 0, 1, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 165 */ - 0, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 166 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 167 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - -/* Char 168 */ - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 169 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 170 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - -/* Char 171 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 172 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 173 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 174 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 175 */ - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 176 */ - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 177 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 1, 1, - -/* Char 178 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 1, 1, - -/* Char 179 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 180 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 181 */ - 0, 0, 0, 1, 1, - 1, 1, 0, 0, 1, - 0, 1, 0, 1, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 182 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 183 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 184 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - -/* Char 185 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 186 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 0, 1, 1, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - -/* Char 187 */ - 0, 0, 0, 1, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 188 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 189 */ - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 190 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 191 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 192 */ - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 193 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 194 */ - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 195 */ - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 196 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 197 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 198 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 199 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 1, 0, 0, 0, - -/* Char 200 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 201 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 202 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, - -/* Char 203 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 204 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 205 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 206 */ - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 207 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 208 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 1, 0, - 1, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 209 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 210 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 1, 1, 1, 0, - 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 211 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 212 */ - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 213 */ - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 214 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 215 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 216 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 217 */ - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 218 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 219 */ - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 220 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 221 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 222 */ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - -/* Char 223 */ - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 1, 0, 1, 0, - 1, 0, 1, 0, 0, - 1, 0, 0, 0, 0, - -/* Char 224 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 225 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 226 */ - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 227 */ - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 228 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 229 */ - 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 230 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 231 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 1, 0, 0, - -/* Char 232 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 233 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 234 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 1, - -/* Char 235 */ - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 236 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 1, 1, 0, - 1, 1, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 237 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 238 */ - 0, 0, 1, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 239 */ - 0, 0, 0, 1, 1, - 0, 0, 1, 0, 1, - 0, 0, 1, 0, 1, - 0, 1, 1, 0, 0, - 1, 0, 1, 0, 0, - 1, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 240 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 1, 1, - 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 241 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 242 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 243 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 244 */ - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 245 */ - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 246 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 247 */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 248 */ - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, - 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - -/* Char 249 */ - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 250 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 251 */ - 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 252 */ - 1, 0, 0, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 1, 0, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, - -/* Char 253 */ - 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, - 1, 0, 0, 1, 0, - 0, 1, 1, 1, 0, - 0, 0, 0, 1, 0, - 0, 1, 1, 0, 0, - -/* Char 254 */ - 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 0, 0, - -/* Char 255 */ - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - - -}; - -gdFont gdFontTinyRep = -{ - 256, - 0, - 5, - 8, - gdFontTinyData -}; - -gdFontPtr gdFontTiny = &gdFontTinyRep; - -gdFontPtr gdFontGetTiny(void) -{ - return gdFontTiny; -} - -/* This file has not been truncated. */ diff --git a/ext/gd/libgd/gdfontt.h b/ext/gd/libgd/gdfontt.h deleted file mode 100644 index 102fec991b4b9..0000000000000 --- a/ext/gd/libgd/gdfontt.h +++ /dev/null @@ -1,30 +0,0 @@ - -#ifndef _GDFONTT_H_ -#define _GDFONTT_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This is a header file for gd font, generated using - bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz - from bdf font - -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-2 - at Thu Jan 8 13:49:54 1998. - The original bdf was holding following copyright: - "Libor Skarvada, libor@informatics.muni.cz" - */ - - -#include "gd.h" - -extern gdFontPtr gdFontTiny; -extern gdFontPtr gdFontGetTiny(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c deleted file mode 100644 index a09bdcba6d6a8..0000000000000 --- a/ext/gd/libgd/gdft.c +++ /dev/null @@ -1,1107 +0,0 @@ - -/********************************************/ -/* gd interface to freetype library */ -/* */ -/* John Ellson ellson@graphviz.org */ -/********************************************/ - -#include -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#ifndef MSWIN32 -#include -#else -#include -#ifndef R_OK -# define R_OK 04 /* Needed in Windows */ -#endif -#endif - -#ifdef WIN32 -#define access _access -#ifndef R_OK -#define R_OK 2 -#endif -#endif - -/* number of antialised colors for indexed bitmaps */ -/* overwrite Windows GDI define in case of windows build */ -#ifdef NUMCOLORS -#undef NUMCOLORS -#endif -#define NUMCOLORS 8 - -char * -gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string) -{ - /* 2.0.6: valid return */ - return gdImageStringFT (im, brect, fg, fontlist, ptsize, angle, x, y, string); -} - -#ifndef HAVE_LIBFREETYPE -char * -gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string, - gdFTStringExtraPtr strex) -{ - return "libgd was not built with FreeType font support\n"; -} - -char * -gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string) -{ - return "libgd was not built with FreeType font support\n"; -} -#else - -#include "gdcache.h" -#include -#include FT_FREETYPE_H -#include FT_GLYPH_H - -/* number of fonts cached before least recently used is replaced */ -#define FONTCACHESIZE 6 - -/* number of antialias color lookups cached */ -#define TWEENCOLORCACHESIZE 32 - -/* - * Line separation as a factor of font height. - * No space between if LINESPACE = 1.00 - * Line separation will be rounded up to next pixel row. - */ -#define LINESPACE 1.05 - -/* - * The character (space) used to separate alternate fonts in the - * fontlist parameter to gdImageStringFT. 2.0.18: space was a oor choice for this. - */ -#define LISTSEPARATOR ";" - -/* - * DEFAULT_FONTPATH and PATHSEPARATOR are host type dependent and - * are normally set by configure in config.h. These are just - * some last resort values that might match some Un*x system - * if building this version of gd separate from graphviz. - */ -#ifndef DEFAULT_FONTPATH -#if defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh)) -#define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts" -#else -#define DEFAULT_FONTPATH "/usr/share/fonts/truetype" -#endif -#endif -#ifndef PATHSEPARATOR -#define PATHSEPARATOR ":" -#endif - -#ifndef TRUE -#define FALSE 0 -#define TRUE !FALSE -#endif - -#ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) -#endif - -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif - -typedef struct -{ - char *fontlist; /* key */ - FT_Library *library; - FT_Face face; - FT_Bool have_char_map_unicode, have_char_map_big5, have_char_map_sjis, have_char_map_apple_roman; - gdCache_head_t *glyphCache; -} font_t; - -typedef struct -{ - char *fontlist; /* key */ - FT_Library *library; -} fontkey_t; - -typedef struct -{ - int pixel; /* key */ - int bgcolor; /* key */ - int fgcolor; /* key *//* -ve means no antialias */ - gdImagePtr im; /* key */ - int tweencolor; -} tweencolor_t; - -typedef struct -{ - int pixel; /* key */ - int bgcolor; /* key */ - int fgcolor; /* key *//* -ve means no antialias */ - gdImagePtr im; /* key */ -} tweencolorkey_t; - -/******************************************************************** - * gdTcl_UtfToUniChar is borrowed from Tcl ... - */ -/* - * tclUtf.c -- - * - * Routines for manipulating UTF-8 strings. - * - * Copyright (c) 1997-1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tclUtf.c 1.25 98/01/28 18:02:43 - */ - -/* - *--------------------------------------------------------------------------- - * - * gdTcl_UtfToUniChar -- - * - * Extract the Tcl_UniChar represented by the UTF-8 string. Bad - * UTF-8 sequences are converted to valid Tcl_UniChars and processing - * continues. Equivalent to Plan 9 chartorune(). - * - * The caller must ensure that the source buffer is long enough that - * this routine does not run off the end and dereference non-existent - * memory looking for trail bytes. If the source buffer is known to - * be '\0' terminated, this cannot happen. Otherwise, the caller - * should call Tcl_UtfCharComplete() before calling this routine to - * ensure that enough bytes remain in the string. - * - * Results: - * *chPtr is filled with the Tcl_UniChar, and the return value is the - * number of bytes from the UTF-8 string that were consumed. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -#ifdef JISX0208 -#include "jisx0208.h" -#endif - -#define Tcl_UniChar int -#define TCL_UTF_MAX 3 -static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) -/* str is the UTF8 next character pointer */ -/* chPtr is the int for the result */ -{ - int byte; - - /* HTML4.0 entities in decimal form, e.g. Å */ - byte = *((unsigned char *) str); - if (byte == '&') { - int i, n = 0; - - byte = *((unsigned char *) (str + 1)); - if (byte == '#') { - for (i = 2; i < 8; i++) { - byte = *((unsigned char *) (str + i)); - if (byte >= '0' && byte <= '9') { - n = (n * 10) + (byte - '0'); - } else { - break; - } - } - if (byte == ';') { - *chPtr = (Tcl_UniChar) n; - return ++i; - } - } - } - - /* Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones. */ - - byte = *((unsigned char *) str); -#ifdef JISX0208 - if (0xA1 <= byte && byte <= 0xFE) { - int ku, ten; - - ku = (byte & 0x7F) - 0x20; - ten = (str[1] & 0x7F) - 0x20; - if ((ku < 1 || ku > 92) || (ten < 1 || ten > 94)) { - *chPtr = (Tcl_UniChar) byte; - return 1; - } - - *chPtr = (Tcl_UniChar) UnicodeTbl[ku - 1][ten - 1]; - return 2; - } else -#endif /* JISX0208 */ - if (byte < 0xC0) { - /* Handles properly formed UTF-8 characters between - * 0x01 and 0x7F. Also treats \0 and naked trail - * bytes 0x80 to 0xBF as valid characters representing - * themselves. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xE0) { - if ((str[1] & 0xC0) == 0x80) { - /* Two-byte-character lead-byte followed by a trail-byte. */ - - *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (str[1] & 0x3F)); - return 2; - } - /* - * A two-byte-character lead-byte not followed by trail-byte - * represents itself. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xF0) { - if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { - /* Three-byte-character lead byte followed by two trail bytes. */ - - *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) | ((str[1] & 0x3F) << 6) | (str[2] & 0x3F)); - return 3; - } - /* A three-byte-character lead-byte not followed by two trail-bytes represents itself. */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } -#if TCL_UTF_MAX > 3 - else { - int ch, total, trail; - - total = totalBytes[byte]; - trail = total - 1; - - if (trail > 0) { - ch = byte & (0x3F >> trail); - do { - str++; - if ((*str & 0xC0) != 0x80) { - *chPtr = byte; - return 1; - } - ch <<= 6; - ch |= (*str & 0x3F); - trail--; - } while (trail > 0); - *chPtr = ch; - return total; - } - } -#endif - - *chPtr = (Tcl_UniChar) byte; - return 1; -} - -/********************************************************************/ -/* font cache functions */ - -static int fontTest (void *element, void *key) -{ - font_t *a = (font_t *) element; - fontkey_t *b = (fontkey_t *) key; - - return (strcmp (a->fontlist, b->fontlist) == 0); -} - -static void *fontFetch (char **error, void *key) -{ - font_t *a; - fontkey_t *b = (fontkey_t *) key; - int n; - int font_found = 0; - unsigned short platform, encoding; - char *fontsearchpath, *fontlist; - char fullname[MAXPATHLEN], cur_dir[MAXPATHLEN]; - char *name, *path=NULL, *dir; - char *strtok_ptr; - FT_Error err; - FT_CharMap found = 0; - FT_CharMap charmap; - - a = (font_t *) gdPMalloc(sizeof(font_t)); - a->fontlist = gdPEstrdup(b->fontlist); - a->library = b->library; - - /* - * Search the pathlist for any of a list of font names. - */ - fontsearchpath = getenv ("GDFONTPATH"); - if (!fontsearchpath) { - fontsearchpath = DEFAULT_FONTPATH; - } - fontlist = gdEstrdup(a->fontlist); - - /* - * Must use gd_strtok_r else pointer corrupted by strtok in nested loop. - */ - for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) { - /* make a fresh copy each time - strtok corrupts it. */ - path = gdEstrdup (fontsearchpath); - - /* if name is an absolute filename then test directly */ - if (*name == '/' || (name[0] != 0 && name[1] == ':' && (name[2] == '/' || name[2] == '\\'))) { - snprintf(fullname, sizeof(fullname) - 1, "%s", name); - if (access(fullname, R_OK) == 0) { - font_found++; - break; - } - } - for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) { - if (!strcmp(dir, ".")) { - TSRMLS_FETCH(); -#if HAVE_GETCWD - dir = VCWD_GETCWD(cur_dir, MAXPATHLEN); -#elif HAVE_GETWD - dir = VCWD_GETWD(cur_dir); -#endif - if (!dir) { - continue; - } - } - -#define GD_CHECK_FONT_PATH(ext) \ - snprintf(fullname, sizeof(fullname) - 1, "%s/%s%s", dir, name, ext); \ - if (access(fullname, R_OK) == 0) { \ - font_found++; \ - break; \ - } \ - - GD_CHECK_FONT_PATH(""); - GD_CHECK_FONT_PATH(".ttf"); - GD_CHECK_FONT_PATH(".pfa"); - GD_CHECK_FONT_PATH(".pfb"); - GD_CHECK_FONT_PATH(".dfont"); - } - gdFree(path); - path = NULL; - if (font_found) { - break; - } - } - - if (path) { - gdFree(path); - } - - gdFree(fontlist); - - if (!font_found) { - gdPFree(a->fontlist); - gdPFree(a); - *error = "Could not find/open font"; - return NULL; - } - - err = FT_New_Face (*b->library, fullname, 0, &a->face); - if (err) { - gdPFree(a->fontlist); - gdPFree(a); - *error = "Could not read font"; - return NULL; - } - - /* FIXME - This mapping stuff is imcomplete - where is the spec? */ - /* EAM - It's worse than that. It's pointless to match character encodings here. - * As currently written, the stored a->face->charmap only matches one of - * the actual charmaps and we cannot know at this stage if it is the right - * one. We should just skip all this stuff, and check in gdImageStringFTEx - * if some particular charmap is preferred and if so whether it is held in - * one of the a->face->charmaps[0..num_charmaps]. - * And why is it so bad not to find any recognized charmap? The user may - * still know what mapping to use, even if we do not. In that case we can - * just use the map in a->face->charmaps[num_charmaps] and be done with it. - */ - - a->have_char_map_unicode = 0; - a->have_char_map_big5 = 0; - a->have_char_map_sjis = 0; - a->have_char_map_apple_roman = 0; - for (n = 0; n < a->face->num_charmaps; n++) { - charmap = a->face->charmaps[n]; - platform = charmap->platform_id; - encoding = charmap->encoding_id; - -/* EAM DEBUG - Newer versions of libfree2 make it easier by defining encodings */ -#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2))) - if (charmap->encoding == FT_ENCODING_MS_SYMBOL - || charmap->encoding == FT_ENCODING_ADOBE_CUSTOM - || charmap->encoding == FT_ENCODING_ADOBE_STANDARD) { - a->have_char_map_unicode = 1; - found = charmap; - a->face->charmap = charmap; - return (void *)a; - } -#endif /* Freetype 2.1.3 or better */ -/* EAM DEBUG */ - - if ((platform == 3 && encoding == 1) /* Windows Unicode */ - || (platform == 3 && encoding == 0) /* Windows Symbol */ - || (platform == 2 && encoding == 1) /* ISO Unicode */ - || (platform == 0)) - { /* Apple Unicode */ - a->have_char_map_unicode = 1; - found = charmap; - } else if (platform == 3 && encoding == 4) { /* Windows Big5 */ - a->have_char_map_big5 = 1; - found = charmap; - } else if (platform == 3 && encoding == 2) { /* Windows Sjis */ - a->have_char_map_sjis = 1; - found = charmap; - } else if ((platform == 1 && encoding == 0) /* Apple Roman */ - || (platform == 2 && encoding == 0)) - { /* ISO ASCII */ - a->have_char_map_apple_roman = 1; - found = charmap; - } - } - if (!found) { - gdPFree(a->fontlist); - gdPFree(a); - *error = "Unable to find a CharMap that I can handle"; - return NULL; - } - - /* 2.0.5: we should actually return this */ - a->face->charmap = found; - return (void *) a; -} - -static void fontRelease (void *element) -{ - font_t *a = (font_t *) element; - - FT_Done_Face (a->face); - gdPFree(a->fontlist); - gdPFree((char *) element); -} - -/********************************************************************/ -/* tweencolor cache functions */ - -static int tweenColorTest (void *element, void *key) -{ - tweencolor_t *a = (tweencolor_t *) element; - tweencolorkey_t *b = (tweencolorkey_t *) key; - - return (a->pixel == b->pixel && a->bgcolor == b->bgcolor && a->fgcolor == b->fgcolor && a->im == b->im); -} - -/* - * Computes a color in im's color table that is part way between - * the background and foreground colors proportional to the gray - * pixel value in the range 0-NUMCOLORS. The fg and bg colors must already - * be in the color table for palette images. For truecolor images the - * returned value simply has an alpha component and gdImageAlphaBlend - * does the work so that text can be alpha blended across a complex - * background (TBB; and for real in 2.0.2). - */ -static void * tweenColorFetch (char **error, void *key) -{ - tweencolor_t *a; - tweencolorkey_t *b = (tweencolorkey_t *) key; - int pixel, npixel, bg, fg; - gdImagePtr im; - - a = (tweencolor_t *) gdMalloc (sizeof (tweencolor_t)); - pixel = a->pixel = b->pixel; - bg = a->bgcolor = b->bgcolor; - fg = a->fgcolor = b->fgcolor; - im = b->im; - - /* if fg is specified by a negative color idx, then don't antialias */ - if (fg < 0) { - if ((pixel + pixel) >= NUMCOLORS) { - a->tweencolor = -fg; - } else { - a->tweencolor = bg; - } - } else { - npixel = NUMCOLORS - pixel; - if (im->trueColor) { - /* 2.0.1: use gdImageSetPixel to do the alpha blending work, - * or to just store the alpha level. All we have to do here - * is incorporate our knowledge of the percentage of this - * pixel that is really "lit" by pushing the alpha value - * up toward transparency in edge regions. - */ - a->tweencolor = gdTrueColorAlpha( - gdTrueColorGetRed(fg), - gdTrueColorGetGreen(fg), - gdTrueColorGetBlue(fg), - gdAlphaMax - (gdTrueColorGetAlpha (fg) * pixel / NUMCOLORS)); - } else { - a->tweencolor = gdImageColorResolve(im, - (pixel * im->red[fg] + npixel * im->red[bg]) / NUMCOLORS, - (pixel * im->green[fg] + npixel * im->green[bg]) / NUMCOLORS, - (pixel * im->blue[fg] + npixel * im->blue[bg]) / NUMCOLORS); - } - } - return (void *) a; -} - -static void tweenColorRelease (void *element) -{ - gdFree((char *) element); -} - -/* draw_bitmap - transfers glyph bitmap to GD image */ -static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y) -{ - unsigned char *pixel = NULL; - int *tpixel = NULL; - int x, y, row, col, pc, pcr; - - tweencolor_t *tc_elem; - tweencolorkey_t tc_key; - - /* copy to image, mapping colors */ - tc_key.fgcolor = fg; - tc_key.im = im; - /* Truecolor version; does not require the cache */ - if (im->trueColor) { - for (row = 0; row < bitmap.rows; row++) { - pc = row * bitmap.pitch; - pcr = pc; - y = pen_y + row; - /* clip if out of bounds */ - /* 2.0.16: clipping rectangle, not image bounds */ - if ((y > im->cy2) || (y < im->cy1)) { - continue; - } - for (col = 0; col < bitmap.width; col++, pc++) { - int level; - if (bitmap.pixel_mode == ft_pixel_mode_grays) { - /* Scale to 128 levels of alpha for gd use. - * alpha 0 is opacity, so be sure to invert at the end - */ - level = (bitmap.buffer[pc] * gdAlphaMax / (bitmap.num_grays - 1)); - } else if (bitmap.pixel_mode == ft_pixel_mode_mono) { - /* 2.0.5: mode_mono fix from Giuliano Pochini */ - level = ((bitmap.buffer[(col>>3)+pcr]) & (1<<(~col&0x07))) ? gdAlphaTransparent : gdAlphaOpaque; - } else { - return "Unsupported ft_pixel_mode"; - } - if ((fg >= 0) && (im->trueColor)) { - /* Consider alpha in the foreground color itself to be an - * upper bound on how opaque things get, when truecolor is - * available. Without truecolor this results in far too many - * color indexes. - */ - level = level * (gdAlphaMax - gdTrueColorGetAlpha(fg)) / gdAlphaMax; - } - level = gdAlphaMax - level; - x = pen_x + col; - /* clip if out of bounds */ - /* 2.0.16: clip to clipping rectangle, Matt McNabb */ - if ((x > im->cx2) || (x < im->cx1)) { - continue; - } - /* get pixel location in gd buffer */ - tpixel = &im->tpixels[y][x]; - if (fg < 0) { - if (level < (gdAlphaMax / 2)) { - *tpixel = -fg; - } - } else { - if (im->alphaBlendingFlag) { - *tpixel = gdAlphaBlend(*tpixel, (level << 24) + (fg & 0xFFFFFF)); - } else { - *tpixel = (level << 24) + (fg & 0xFFFFFF); - } - } - } - } - return (char *) NULL; - } - /* Non-truecolor case, restored to its more or less original form */ - for (row = 0; row < bitmap.rows; row++) { - int pcr; - pc = row * bitmap.pitch; - pcr = pc; - if (bitmap.pixel_mode==ft_pixel_mode_mono) { - pc *= 8; /* pc is measured in bits for monochrome images */ - } - y = pen_y + row; - - /* clip if out of bounds */ - if (y >= im->sy || y < 0) { - continue; - } - - for (col = 0; col < bitmap.width; col++, pc++) { - if (bitmap.pixel_mode == ft_pixel_mode_grays) { - /* - * Round to NUMCOLORS levels of antialiasing for - * index color images since only 256 colors are - * available. - */ - tc_key.pixel = ((bitmap.buffer[pc] * NUMCOLORS) + bitmap.num_grays / 2) / (bitmap.num_grays - 1); - } else if (bitmap.pixel_mode == ft_pixel_mode_mono) { - tc_key.pixel = ((bitmap.buffer[pc / 8] << (pc % 8)) & 128) ? NUMCOLORS : 0; - /* 2.0.5: mode_mono fix from Giuliano Pochini */ - tc_key.pixel = ((bitmap.buffer[(col>>3)+pcr]) & (1<<(~col&0x07))) ? NUMCOLORS : 0; - } else { - return "Unsupported ft_pixel_mode"; - } - if (tc_key.pixel > 0) { /* if not background */ - x = pen_x + col; - - /* clip if out of bounds */ - if (x >= im->sx || x < 0) { - continue; - } - /* get pixel location in gd buffer */ - pixel = &im->pixels[y][x]; - if (tc_key.pixel == NUMCOLORS) { - /* use fg color directly. gd 2.0.2: watch out for - * negative indexes (thanks to David Marwood). - */ - *pixel = (fg < 0) ? -fg : fg; - } else { - /* find antialised color */ - tc_key.bgcolor = *pixel; - tc_elem = (tweencolor_t *) gdCacheGet(tc_cache, &tc_key); - *pixel = tc_elem->tweencolor; - } - } - } - } - return (char *) NULL; -} - -static int -gdroundupdown (FT_F26Dot6 v1, int updown) -{ - return (!updown) ? (v1 < 0 ? ((v1 - 63) >> 6) : v1 >> 6) : (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6); -} - -extern int any2eucjp (char *, char *, unsigned int); - -/* Persistent font cache until explicitly cleared */ -/* Fonts can be used across multiple images */ - -/* 2.0.16: thread safety (the font cache is shared) */ -gdMutexDeclare(gdFontCacheMutex); -static gdCache_head_t *fontCache = NULL; -static FT_Library library; - -void gdFontCacheShutdown() -{ - if (fontCache) { - gdMutexShutdown(gdFontCacheMutex); - gdCacheDelete(fontCache); - fontCache = NULL; - FT_Done_FreeType(library); - } -} - -void gdFreeFontCache() -{ - gdFontCacheShutdown(); -} - -int gdFontCacheSetup(void) -{ - if (fontCache) { - /* Already set up */ - return 0; - } - gdMutexSetup(gdFontCacheMutex); - if (FT_Init_FreeType(&library)) { - gdMutexShutdown(gdFontCacheMutex); - return -1; - } - fontCache = gdCacheCreate (FONTCACHESIZE, fontTest, fontFetch, fontRelease); - return 0; -} - - -/********************************************************************/ -/* gdImageStringFT - render a utf8 string onto a gd image */ - -char * -gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist, - double ptsize, double angle, int x, int y, char *string) -{ - return gdImageStringFTEx(im, brect, fg, fontlist, ptsize, angle, x, y, string, 0); -} - -char * -gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex) -{ - FT_BBox bbox, glyph_bbox; - FT_Matrix matrix; - FT_Vector pen, delta, penf; - FT_Face face; - FT_Glyph image; - FT_GlyphSlot slot; - FT_Bool use_kerning; - FT_UInt glyph_index, previous; - double sin_a = sin (angle); - double cos_a = cos (angle); - int len, i = 0, ch; - int x1 = 0, y1 = 0; - font_t *font; - fontkey_t fontkey; - char *next; - char *tmpstr = NULL; - int render = (im && (im->trueColor || (fg <= 255 && fg >= -255))); - FT_BitmapGlyph bm; - /* 2.0.13: Bob Ostermann: don't force autohint, that's just for testing freetype and doesn't look as good */ - int render_mode = FT_LOAD_DEFAULT; - int m, mfound; - /* Now tuneable thanks to Wez Furlong */ - double linespace = LINESPACE; - /* 2.0.6: put this declaration with the other declarations! */ - /* - * make a new tweenColorCache on every call - * because caching colormappings between calls - * is not safe. If the im-pointer points to a - * brand new image, the cache gives out bogus - * colorindexes. -- 27.06.2001 - */ - gdCache_head_t *tc_cache; - /* Tuneable horizontal and vertical resolution in dots per inch */ - int hdpi, vdpi; - - if (strex && ((strex->flags & gdFTEX_LINESPACE) == gdFTEX_LINESPACE)) { - linespace = strex->linespacing; - } - tc_cache = gdCacheCreate(TWEENCOLORCACHESIZE, tweenColorTest, tweenColorFetch, tweenColorRelease); - - /***** initialize font library and font cache on first call ******/ - - if (!fontCache) { - if (gdFontCacheSetup() != 0) { - gdCacheDelete(tc_cache); - return "Failure to initialize font library"; - } - } - /*****/ - - gdMutexLock(gdFontCacheMutex); - /* get the font (via font cache) */ - fontkey.fontlist = fontlist; - fontkey.library = &library; - font = (font_t *) gdCacheGet (fontCache, &fontkey); - if (!font) { - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return fontCache->error; - } - face = font->face; /* shortcut */ - slot = face->glyph; /* shortcut */ - - /* - * Added hdpi and vdpi to support images at non-screen resolutions, i.e. 300 dpi TIFF, - * or 100h x 50v dpi FAX format. 2.0.23. - * 2004/02/27 Mark Shackelford, mark.shackelford@acs-inc.com - */ - hdpi = GD_RESOLUTION; - vdpi = GD_RESOLUTION; - if (strex && (strex->flags & gdFTEX_RESOLUTION)) { - hdpi = strex->hdpi; - vdpi = strex->vdpi; - } - - if (FT_Set_Char_Size(face, 0, (FT_F26Dot6) (ptsize * 64), hdpi, vdpi)) { - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return "Could not set character size"; - } - - matrix.xx = (FT_Fixed) (cos_a * (1 << 16)); - matrix.yx = (FT_Fixed) (sin_a * (1 << 16)); - matrix.xy = -matrix.yx; - matrix.yy = matrix.xx; - - penf.x = penf.y = 0; /* running position of non-rotated string */ - pen.x = pen.y = 0; /* running position of rotated string */ - bbox.xMin = bbox.xMax = bbox.yMin = bbox.yMax = 0; - - use_kerning = FT_HAS_KERNING (face); - previous = 0; - if (fg < 0) { - render_mode |= FT_LOAD_MONOCHROME; - } - /* 2.0.12: allow explicit specification of the preferred map; - * but we still fall back if it is not available. - */ - m = gdFTEX_Unicode; - if (strex && (strex->flags & gdFTEX_CHARMAP)) { - m = strex->charmap; - } - /* Try all three types of maps, but start with the specified one */ - mfound = 0; - for (i = 0; i < 3; i++) { - switch (m) { - case gdFTEX_Unicode: - if (font->have_char_map_unicode) { - mfound = 1; - } - break; - case gdFTEX_Shift_JIS: - if (font->have_char_map_sjis) { - mfound = 1; - } - break; - case gdFTEX_Big5: - /* This was the 'else' case, we can't really 'detect' it */ - mfound = 1; - break; - } - if (mfound) { - break; - } - m++; - m %= 3; - } - if (!mfound) { - /* No character set found! */ - gdMutexUnlock(gdFontCacheMutex); - return "No character set found"; - } - -#ifndef JISX0208 - if (font->have_char_map_sjis) { -#endif - tmpstr = (char *) gdMalloc(BUFSIZ); - any2eucjp(tmpstr, string, BUFSIZ); - next = tmpstr; -#ifndef JISX0208 - } else { - next = string; - } -#endif - - while (*next) { - ch = *next; - - /* carriage returns */ - if (ch == '\r') { - penf.x = 0; - x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; - pen.x = pen.y = 0; - previous = 0; /* clear kerning flag */ - next++; - continue; - } - /* newlines */ - if (ch == '\n') { - /* 2.0.13: reset penf.x. Christopher J. Grayce */ - penf.x = 0; - penf.y -= (long)(face->size->metrics.height * linespace); - penf.y = (penf.y - 32) & -64; /* round to next pixel row */ - x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; - pen.x = pen.y = 0; - previous = 0; /* clear kerning flag */ - next++; - continue; - } - -/* EAM DEBUG */ -#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2))) - if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL && strcmp(font->face->family_name, "Symbol") == 0) { - /* I do not know the significance of the constant 0xf000. - * It was determined by inspection of the character codes - * stored in Microsoft font symbol. - * Added by Pierre (pajoye@php.net): - * Convert to the Symbol glyph range only for a Symbol family member - */ - len = gdTcl_UtfToUniChar (next, &ch); - ch |= 0xf000; - next += len; - } else -#endif /* Freetype 2.1 or better */ -/* EAM DEBUG */ - - switch (m) { - case gdFTEX_Unicode: - if (font->have_char_map_unicode) { - /* use UTF-8 mapping from ASCII */ - len = gdTcl_UtfToUniChar(next, &ch); - next += len; - } - break; - case gdFTEX_Shift_JIS: - if (font->have_char_map_sjis) { - unsigned char c; - int jiscode; - c = *next; - if (0xA1 <= c && c <= 0xFE) { - next++; - jiscode = 0x100 * (c & 0x7F) + ((*next) & 0x7F); - - ch = (jiscode >> 8) & 0xFF; - jiscode &= 0xFF; - - if (ch & 1) { - jiscode += 0x40 - 0x21; - } else { - jiscode += 0x9E - 0x21; - } - - if (jiscode >= 0x7F) { - jiscode++; - } - ch = (ch - 0x21) / 2 + 0x81; - if (ch >= 0xA0) { - ch += 0x40; - } - - ch = (ch << 8) + jiscode; - } else { - ch = c & 0xFF; /* don't extend sign */ - } - next++; - } - break; - case gdFTEX_Big5: { - /* - * Big 5 mapping: - * use "JIS-8 half-width katakana" coding from 8-bit characters. Ref: - * ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/japan.inf-032092.sjs - */ - ch = (*next) & 0xFF; /* don't extend sign */ - next++; - if (ch >= 161 /* first code of JIS-8 pair */ - && *next) { /* don't advance past '\0' */ - /* TBB: Fix from Kwok Wah On: & 255 needed */ - ch = (ch * 256) + ((*next) & 255); - next++; - } - } - break; - } - - /* set rotation transform */ - FT_Set_Transform(face, &matrix, NULL); - /* Convert character code to glyph index */ - glyph_index = FT_Get_Char_Index(face, ch); - - /* retrieve kerning distance and move pen position */ - if (use_kerning && previous && glyph_index) { - FT_Get_Kerning(face, previous, glyph_index, ft_kerning_default, &delta); - pen.x += delta.x; - penf.x += delta.x; - } - - /* load glyph image into the slot (erase previous one) */ - if (FT_Load_Glyph(face, glyph_index, render_mode)) { - if (tmpstr) { - gdFree(tmpstr); - } - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return "Problem loading glyph"; - } - - /* transform glyph image */ - FT_Get_Glyph(slot, &image); - if (brect) { /* only if need brect */ - FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox); - glyph_bbox.xMin += penf.x; - glyph_bbox.yMin += penf.y; - glyph_bbox.xMax += penf.x; - glyph_bbox.yMax += penf.y; - if (ch == ' ') { /* special case for trailing space */ - glyph_bbox.xMax += slot->metrics.horiAdvance; - } - if (!i) { /* if first character, init BB corner values */ - bbox.xMin = glyph_bbox.xMin; - bbox.yMin = glyph_bbox.yMin; - bbox.xMax = glyph_bbox.xMax; - bbox.yMax = glyph_bbox.yMax; - } else { - if (bbox.xMin > glyph_bbox.xMin) { - bbox.xMin = glyph_bbox.xMin; - } - if (bbox.yMin > glyph_bbox.yMin) { - bbox.yMin = glyph_bbox.yMin; - } - if (bbox.xMax < glyph_bbox.xMax) { - bbox.xMax = glyph_bbox.xMax; - } - if (bbox.yMax < glyph_bbox.yMax) { - bbox.yMax = glyph_bbox.yMax; - } - } - i++; - } - - if (render) { - if (image->format != ft_glyph_format_bitmap && FT_Glyph_To_Bitmap(&image, ft_render_mode_normal, 0, 1)) { - if (tmpstr) { - gdFree(tmpstr); - } - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return "Problem rendering glyph"; - } - - /* now, draw to our target surface */ - bm = (FT_BitmapGlyph) image; - gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y - y1 + ((pen.y + 31) >> 6) - bm->top); - } - - /* record current glyph index for kerning */ - previous = glyph_index; - - /* increment pen position */ - pen.x += image->advance.x >> 10; - pen.y -= image->advance.y >> 10; - - penf.x += slot->metrics.horiAdvance; - - FT_Done_Glyph(image); - } - - if (brect) { /* only if need brect */ - /* For perfect rounding, must get sin(a + pi/4) and sin(a - pi/4). */ - double d1 = sin (angle + 0.78539816339744830962); - double d2 = sin (angle - 0.78539816339744830962); - - /* rotate bounding rectangle */ - brect[0] = (int) (bbox.xMin * cos_a - bbox.yMin * sin_a); - brect[1] = (int) (bbox.xMin * sin_a + bbox.yMin * cos_a); - brect[2] = (int) (bbox.xMax * cos_a - bbox.yMin * sin_a); - brect[3] = (int) (bbox.xMax * sin_a + bbox.yMin * cos_a); - brect[4] = (int) (bbox.xMax * cos_a - bbox.yMax * sin_a); - brect[5] = (int) (bbox.xMax * sin_a + bbox.yMax * cos_a); - brect[6] = (int) (bbox.xMin * cos_a - bbox.yMax * sin_a); - brect[7] = (int) (bbox.xMin * sin_a + bbox.yMax * cos_a); - - /* scale, round and offset brect */ - brect[0] = x + gdroundupdown(brect[0], d2 > 0); - brect[1] = y - gdroundupdown(brect[1], d1 < 0); - brect[2] = x + gdroundupdown(brect[2], d1 > 0); - brect[3] = y - gdroundupdown(brect[3], d2 > 0); - brect[4] = x + gdroundupdown(brect[4], d2 < 0); - brect[5] = y - gdroundupdown(brect[5], d1 > 0); - brect[6] = x + gdroundupdown(brect[6], d1 < 0); - brect[7] = y - gdroundupdown(brect[7], d2 < 0); - } - - if (tmpstr) { - gdFree(tmpstr); - } - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return (char *) NULL; -} - -#endif /* HAVE_LIBFREETYPE */ diff --git a/ext/gd/libgd/gdhelpers.c b/ext/gd/libgd/gdhelpers.c deleted file mode 100644 index ae2428dfcde65..0000000000000 --- a/ext/gd/libgd/gdhelpers.c +++ /dev/null @@ -1,76 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "gd.h" -#include "gdhelpers.h" -#include -#include - -/* TBB: gd_strtok_r is not portable; provide an implementation */ - -#define SEP_TEST (separators[*((unsigned char *) s)]) - -char * -gd_strtok_r (char *s, char *sep, char **state) -{ - char separators[256]; - char *start; - char *result = 0; - memset (separators, 0, sizeof (separators)); - while (*sep) - { - separators[*((unsigned char *) sep)] = 1; - sep++; - } - if (!s) - { - /* Pick up where we left off */ - s = *state; - } - start = s; - /* 1. EOS */ - if (!(*s)) - { - *state = s; - return 0; - } - /* 2. Leading separators, if any */ - if (SEP_TEST) - { - do - { - s++; - } - while (SEP_TEST); - /* 2a. EOS after separators only */ - if (!(*s)) - { - *state = s; - return 0; - } - } - /* 3. A token */ - result = s; - do - { - /* 3a. Token at end of string */ - if (!(*s)) - { - *state = s; - return result; - } - s++; - } - while (!SEP_TEST); - /* 4. Terminate token and skip trailing separators */ - *s = '\0'; - do - { - s++; - } - while (SEP_TEST); - /* 5. Return token */ - *state = s; - return result; -} diff --git a/ext/gd/libgd/gdhelpers.h b/ext/gd/libgd/gdhelpers.h deleted file mode 100644 index 5e7d9bee73bac..0000000000000 --- a/ext/gd/libgd/gdhelpers.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef GDHELPERS_H -#define GDHELPERS_H 1 - -#include -#include "php.h" - -/* TBB: strtok_r is not universal; provide an implementation of it. */ - -extern char *gd_strtok_r(char *s, char *sep, char **state); - -/* These functions wrap memory management. gdFree is - in gd.h, where callers can utilize it to correctly - free memory allocated by these functions with the - right version of free(). */ -#define gdCalloc(nmemb, size) ecalloc(nmemb, size) -#define gdMalloc(size) emalloc(size) -#define gdRealloc(ptr, size) erealloc(ptr, size) -#define gdEstrdup(ptr) estrdup(ptr) -#define gdFree(ptr) efree(ptr) -#define gdPMalloc(ptr) pemalloc(ptr, 1) -#define gdPFree(ptr) pefree(ptr, 1) -#define gdPEstrdup(ptr) pestrdup(ptr, 1) - -#ifdef ZTS -#define gdMutexDeclare(x) MUTEX_T x -#define gdMutexSetup(x) x = tsrm_mutex_alloc() -#define gdMutexShutdown(x) tsrm_mutex_free(x) -#define gdMutexLock(x) tsrm_mutex_lock(x) -#define gdMutexUnlock(x) tsrm_mutex_unlock(x) -#else -#define gdMutexDeclare(x) -#define gdMutexSetup(x) -#define gdMutexShutdown(x) -#define gdMutexLock(x) -#define gdMutexUnlock(x) -#endif - -#endif /* GDHELPERS_H */ - diff --git a/ext/gd/libgd/gdkanji.c b/ext/gd/libgd/gdkanji.c deleted file mode 100644 index 37f3bd10a079b..0000000000000 --- a/ext/gd/libgd/gdkanji.c +++ /dev/null @@ -1,627 +0,0 @@ - -/* gdkanji.c (Kanji code converter) */ -/* written by Masahito Yamaga (ma@yama-ga.com) */ - -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#include -#if defined(HAVE_ICONV_H) || defined(HAVE_ICONV) -#include -#ifdef HAVE_ERRNO_H -#include -#endif -#endif - -#if defined(HAVE_ICONV_H) && !defined(HAVE_ICONV) -#define HAVE_ICONV 1 -#endif - -#define LIBNAME "any2eucjp()" - -#if defined(__MSC__) || defined(__BORLANDC__) || defined(__TURBOC__) || defined(_Windows) || defined(MSDOS) -#ifndef SJISPRE -#define SJISPRE 1 -#endif -#endif - -#ifdef TRUE -#undef TRUE -#endif -#ifdef FALSE -#undef FALSE -#endif - -#define TRUE 1 -#define FALSE 0 - -#define NEW 1 -#define OLD 2 -#define ESCI 3 -#define NEC 4 -#define EUC 5 -#define SJIS 6 -#define EUCORSJIS 7 -#define ASCII 8 - -#define NEWJISSTR "JIS7" -#define OLDJISSTR "jis" -#define EUCSTR "eucJP" -#define SJISSTR "SJIS" - -#define ESC 27 -#define SS2 142 - -static void -debug (const char *format,...) -{ -#ifdef DEBUG - va_list args; - - va_start (args, format); - fprintf (stdout, "%s: ", LIBNAME); - vfprintf (stdout, format, args); - fprintf (stdout, "\n"); - va_end (args); -#endif -} - -static void -error (const char *format,...) -{ - va_list args; - char *tmp; - TSRMLS_FETCH(); - - va_start(args, format); - vspprintf(&tmp, 0, format, args); - va_end(args); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", LIBNAME, tmp); - efree(tmp); -} - -/* DetectKanjiCode() derived from DetectCodeType() by Ken Lunde. */ - -static int -DetectKanjiCode (unsigned char *str) -{ - static int whatcode = ASCII; - int oldcode = ASCII; - int c, i; - char *lang = NULL; - - c = '\1'; - i = 0; - - if (whatcode != EUCORSJIS && whatcode != ASCII) - { - oldcode = whatcode; - whatcode = ASCII; - } - - while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') - { - if ((c = str[i++]) != '\0') - { - if (c == ESC) - { - c = str[i++]; - if (c == '$') - { - c = str[i++]; - if (c == 'B') - whatcode = NEW; - else if (c == '@') - whatcode = OLD; - } - else if (c == '(') - { - c = str[i++]; - if (c == 'I') - whatcode = ESCI; - } - else if (c == 'K') - whatcode = NEC; - } - else if ((c >= 129 && c <= 141) || (c >= 143 && c <= 159)) - whatcode = SJIS; - else if (c == SS2) - { - c = str[i++]; - if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160) || (c >= 224 && c <= 252)) - whatcode = SJIS; - else if (c >= 161 && c <= 223) - whatcode = EUCORSJIS; - } - else if (c >= 161 && c <= 223) - { - c = str[i++]; - if (c >= 240 && c <= 254) - whatcode = EUC; - else if (c >= 161 && c <= 223) - whatcode = EUCORSJIS; - else if (c >= 224 && c <= 239) - { - whatcode = EUCORSJIS; - while (c >= 64 && c != '\0' && whatcode == EUCORSJIS) - { - if (c >= 129) - { - if (c <= 141 || (c >= 143 && c <= 159)) - whatcode = SJIS; - else if (c >= 253 && c <= 254) - whatcode = EUC; - } - c = str[i++]; - } - } - else if (c <= 159) - whatcode = SJIS; - } - else if (c >= 240 && c <= 254) - whatcode = EUC; - else if (c >= 224 && c <= 239) - { - c = str[i++]; - if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160)) - whatcode = SJIS; - else if (c >= 253 && c <= 254) - whatcode = EUC; - else if (c >= 161 && c <= 252) - whatcode = EUCORSJIS; - } - } - } - -#ifdef DEBUG - if (whatcode == ASCII) - debug ("Kanji code not included."); - else if (whatcode == EUCORSJIS) - debug ("Kanji code not detected."); - else - debug ("Kanji code detected at %d byte.", i); -#endif - - if (whatcode == EUCORSJIS && oldcode != ASCII) - whatcode = oldcode; - - if (whatcode == EUCORSJIS) - { - if (getenv ("LC_ALL")) - lang = getenv ("LC_ALL"); - else if (getenv ("LC_CTYPE")) - lang = getenv ("LC_CTYPE"); - else if (getenv ("LANG")) - lang = getenv ("LANG"); - - if (lang) - { - if (strcmp (lang, "ja_JP.SJIS") == 0 || -#ifdef hpux - strcmp (lang, "japanese") == 0 || -#endif - strcmp (lang, "ja_JP.mscode") == 0 || - strcmp (lang, "ja_JP.PCK") == 0) - whatcode = SJIS; - else if (strncmp (lang, "ja", 2) == 0) -#ifdef SJISPRE - whatcode = SJIS; -#else - whatcode = EUC; -#endif - } - } - - if (whatcode == EUCORSJIS) -#ifdef SJISPRE - whatcode = SJIS; -#else - whatcode = EUC; -#endif - - return whatcode; -} - -/* SJIStoJIS() is sjis2jis() by Ken Lunde. */ - -static void -SJIStoJIS (int *p1, int *p2) -{ - register unsigned char c1 = *p1; - register unsigned char c2 = *p2; - register int adjust = c2 < 159; - register int rowOffset = c1 < 160 ? 112 : 176; - register int cellOffset = adjust ? (31 + (c2 > 127)) : 126; - - *p1 = ((c1 - rowOffset) << 1) - adjust; - *p2 -= cellOffset; -} - -/* han2zen() was derived from han2zen() written by Ken Lunde. */ - -#define IS_DAKU(c) ((c >= 182 && c <= 196) || (c >= 202 && c <= 206) || (c == 179)) -#define IS_HANDAKU(c) (c >= 202 && c <= 206) - -static void -han2zen (int *p1, int *p2) -{ - int c = *p1; - int daku = FALSE; - int handaku = FALSE; - int mtable[][2] = - { - {129, 66}, - {129, 117}, - {129, 118}, - {129, 65}, - {129, 69}, - {131, 146}, - {131, 64}, - {131, 66}, - {131, 68}, - {131, 70}, - {131, 72}, - {131, 131}, - {131, 133}, - {131, 135}, - {131, 98}, - {129, 91}, - {131, 65}, - {131, 67}, - {131, 69}, - {131, 71}, - {131, 73}, - {131, 74}, - {131, 76}, - {131, 78}, - {131, 80}, - {131, 82}, - {131, 84}, - {131, 86}, - {131, 88}, - {131, 90}, - {131, 92}, - {131, 94}, - {131, 96}, - {131, 99}, - {131, 101}, - {131, 103}, - {131, 105}, - {131, 106}, - {131, 107}, - {131, 108}, - {131, 109}, - {131, 110}, - {131, 113}, - {131, 116}, - {131, 119}, - {131, 122}, - {131, 125}, - {131, 126}, - {131, 128}, - {131, 129}, - {131, 130}, - {131, 132}, - {131, 134}, - {131, 136}, - {131, 137}, - {131, 138}, - {131, 139}, - {131, 140}, - {131, 141}, - {131, 143}, - {131, 147}, - {129, 74}, - {129, 75} - }; - - if (*p2 == 222 && IS_DAKU (*p1)) - daku = TRUE; /* Daku-ten */ - else if (*p2 == 223 && IS_HANDAKU (*p1)) - handaku = TRUE; /* Han-daku-ten */ - - *p1 = mtable[c - 161][0]; - *p2 = mtable[c - 161][1]; - - if (daku) - { - if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122)) - (*p2)++; - else if (*p2 == 131 && *p2 == 69) - *p2 = 148; - } - else if (handaku && *p2 >= 110 && *p2 <= 122) - (*p2) += 2; -} - -/* Recast strcpy to handle unsigned chars used below. */ -#define ustrcpy(A,B) (strcpy((char*)(A),(const char*)(B))) - -static void -do_convert (unsigned char *to, unsigned char *from, const char *code) -{ -#ifdef HAVE_ICONV - iconv_t cd; - size_t from_len, to_len; - - if ((cd = iconv_open (EUCSTR, code)) == (iconv_t) - 1) - { - error ("iconv_open() error"); -#ifdef HAVE_ERRNO_H - if (errno == EINVAL) - error ("invalid code specification: \"%s\" or \"%s\"", - EUCSTR, code); -#endif - strcpy ((char *) to, (const char *) from); - return; - } - - from_len = strlen ((const char *) from) + 1; - to_len = BUFSIZ; - - if ((int) iconv(cd, (char **) &from, &from_len, (char **) &to, &to_len) == -1) - { -#ifdef HAVE_ERRNO_H - if (errno == EINVAL) - error ("invalid end of input string"); - else if (errno == EILSEQ) - error ("invalid code in input string"); - else if (errno == E2BIG) - error ("output buffer overflow at do_convert()"); - else -#endif - error ("something happen"); - strcpy ((char *) to, (const char *) from); - return; - } - - if (iconv_close (cd) != 0) - { - error ("iconv_close() error"); - } -#else - int p1, p2, i, j; - int jisx0208 = FALSE; - int hankaku = FALSE; - - j = 0; - if (strcmp (code, NEWJISSTR) == 0 || strcmp (code, OLDJISSTR) == 0) - { - for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) - { - if (from[i] == ESC) - { - i++; - if (from[i] == '$') - { - jisx0208 = TRUE; - hankaku = FALSE; - i++; - } - else if (from[i] == '(') - { - jisx0208 = FALSE; - i++; - if (from[i] == 'I') /* Hankaku Kana */ - hankaku = TRUE; - else - hankaku = FALSE; - } - } - else - { - if (jisx0208) - to[j++] = from[i] + 128; - else if (hankaku) - { - to[j++] = SS2; - to[j++] = from[i] + 128; - } - else - to[j++] = from[i]; - } - } - } - else if (strcmp (code, SJISSTR) == 0) - { - for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) - { - p1 = from[i]; - if (p1 < 127) - to[j++] = p1; - else if ((p1 >= 161) && (p1 <= 223)) - { /* Hankaku Kana */ - to[j++] = SS2; - to[j++] = p1; - } - else - { - p2 = from[++i]; - SJIStoJIS (&p1, &p2); - to[j++] = p1 + 128; - to[j++] = p2 + 128; - } - } - } - else - { - error ("invalid code specification: \"%s\"", code); - return; - } - - if (j >= BUFSIZ) - { - error ("output buffer overflow at do_convert()"); - ustrcpy (to, from); - } - else - to[j] = '\0'; -#endif /* HAVE_ICONV */ -} - -static int -do_check_and_conv (unsigned char *to, unsigned char *from) -{ - static unsigned char tmp[BUFSIZ]; - int p1, p2, i, j; - int kanji = TRUE; - - switch (DetectKanjiCode (from)) - { - case NEW: - debug ("Kanji code is New JIS."); - do_convert (tmp, from, NEWJISSTR); - break; - case OLD: - debug ("Kanji code is Old JIS."); - do_convert (tmp, from, OLDJISSTR); - break; - case ESCI: - debug ("This string includes Hankaku-Kana (jisx0201) escape sequence [ESC] + ( + I."); - do_convert (tmp, from, NEWJISSTR); - break; - case NEC: - debug ("Kanji code is NEC Kanji."); - error ("cannot convert NEC Kanji."); - ustrcpy (tmp, from); - kanji = FALSE; - break; - case EUC: - debug ("Kanji code is EUC."); - ustrcpy (tmp, from); - break; - case SJIS: - debug ("Kanji code is SJIS."); - do_convert (tmp, from, SJISSTR); - break; - case EUCORSJIS: - debug ("Kanji code is EUC or SJIS."); - ustrcpy (tmp, from); - kanji = FALSE; - break; - case ASCII: - debug ("This is ASCII string."); - ustrcpy (tmp, from); - kanji = FALSE; - break; - default: - debug ("This string includes unknown code."); - ustrcpy (tmp, from); - kanji = FALSE; - break; - } - - /* Hankaku Kana ---> Zenkaku Kana */ - if (kanji) - { - j = 0; - for (i = 0; tmp[i] != '\0' && j < BUFSIZ; i++) - { - if (tmp[i] == SS2) - { - p1 = tmp[++i]; - if (tmp[i + 1] == SS2) - { - p2 = tmp[i + 2]; - if (p2 == 222 || p2 == 223) - i += 2; - else - p2 = 0; - } - else - p2 = 0; - han2zen (&p1, &p2); - SJIStoJIS (&p1, &p2); - to[j++] = p1 + 128; - to[j++] = p2 + 128; - } - else - to[j++] = tmp[i]; - } - - if (j >= BUFSIZ) - { - error ("output buffer overflow at Hankaku --> Zenkaku"); - ustrcpy (to, tmp); - } - else - to[j] = '\0'; - } - else - ustrcpy (to, tmp); - - return kanji; -} - -int -any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max) -{ - static unsigned char tmp_dest[BUFSIZ]; - int ret; - - if (strlen ((const char *) src) >= BUFSIZ) - { - error ("input string too large"); - return -1; - } - if (dest_max > BUFSIZ) - { - error ("invalid maximum size of destination\nit should be less than %d.", BUFSIZ); - return -1; - } - ret = do_check_and_conv (tmp_dest, src); - if (strlen ((const char *) tmp_dest) >= dest_max) - { - error ("output buffer overflow"); - ustrcpy (dest, src); - return -1; - } - ustrcpy (dest, tmp_dest); - return ret; -} - -#if 0 -unsigned int -strwidth (unsigned char *s) -{ - unsigned char *t; - unsigned int i; - - t = (unsigned char *) gdMalloc (BUFSIZ); - any2eucjp (t, s, BUFSIZ); - i = strlen (t); - gdFree (t); - return i; -} - -#ifdef DEBUG -int -main () -{ - unsigned char input[BUFSIZ]; - unsigned char *output; - unsigned char *str; - int c, i = 0; - - while ((c = fgetc (stdin)) != '\n' && i < BUFSIZ) - input[i++] = c; - input[i] = '\0'; - - printf ("input : %d bytes\n", strlen ((const char *) input)); - printf ("output: %d bytes\n", strwidth (input)); - - output = (unsigned char *) gdMalloc (BUFSIZ); - any2eucjp (output, input, BUFSIZ); - str = output; - while (*str != '\0') - putchar (*(str++)); - putchar ('\n'); - gdFree (output); - - return 0; -} -#endif -#endif diff --git a/ext/gd/libgd/gdparttopng.c b/ext/gd/libgd/gdparttopng.c deleted file mode 100644 index 677a0b571013e..0000000000000 --- a/ext/gd/libgd/gdparttopng.c +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include /* For atoi */ -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in, *out; - int x, y, w, h; - - if (argc != 7) - { - fprintf (stderr, "Usage: gdparttopng filename.gd filename.png x y w h\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - - x = atoi (argv[3]); - y = atoi (argv[4]); - w = atoi (argv[5]); - h = atoi (argv[6]); - - printf ("Extracting from (%d, %d), size is %dx%d\n", x, y, w, h); - - im = gdImageCreateFromGd2Part (in, x, y, w, h); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in PNG format!\n"); - exit (1); - } - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } -#ifdef HAVE_LIBPNG - gdImagePng (im, out); -#else - fprintf(stderr, "No PNG library support.\n"); -#endif - fclose (out); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/gdtables.c b/ext/gd/libgd/gdtables.c deleted file mode 100644 index 46f94eaea2e0a..0000000000000 --- a/ext/gd/libgd/gdtables.c +++ /dev/null @@ -1,730 +0,0 @@ - -#include "php_compat.h" - -int gdCosT[] = -{ - 1024, - 1023, - 1023, - 1022, - 1021, - 1020, - 1018, - 1016, - 1014, - 1011, - 1008, - 1005, - 1001, - 997, - 993, - 989, - 984, - 979, - 973, - 968, - 962, - 955, - 949, - 942, - 935, - 928, - 920, - 912, - 904, - 895, - 886, - 877, - 868, - 858, - 848, - 838, - 828, - 817, - 806, - 795, - 784, - 772, - 760, - 748, - 736, - 724, - 711, - 698, - 685, - 671, - 658, - 644, - 630, - 616, - 601, - 587, - 572, - 557, - 542, - 527, - 512, - 496, - 480, - 464, - 448, - 432, - 416, - 400, - 383, - 366, - 350, - 333, - 316, - 299, - 282, - 265, - 247, - 230, - 212, - 195, - 177, - 160, - 142, - 124, - 107, - 89, - 71, - 53, - 35, - 17, - 0, - -17, - -35, - -53, - -71, - -89, - -107, - -124, - -142, - -160, - -177, - -195, - -212, - -230, - -247, - -265, - -282, - -299, - -316, - -333, - -350, - -366, - -383, - -400, - -416, - -432, - -448, - -464, - -480, - -496, - -512, - -527, - -542, - -557, - -572, - -587, - -601, - -616, - -630, - -644, - -658, - -671, - -685, - -698, - -711, - -724, - -736, - -748, - -760, - -772, - -784, - -795, - -806, - -817, - -828, - -838, - -848, - -858, - -868, - -877, - -886, - -895, - -904, - -912, - -920, - -928, - -935, - -942, - -949, - -955, - -962, - -968, - -973, - -979, - -984, - -989, - -993, - -997, - -1001, - -1005, - -1008, - -1011, - -1014, - -1016, - -1018, - -1020, - -1021, - -1022, - -1023, - -1023, - -1024, - -1023, - -1023, - -1022, - -1021, - -1020, - -1018, - -1016, - -1014, - -1011, - -1008, - -1005, - -1001, - -997, - -993, - -989, - -984, - -979, - -973, - -968, - -962, - -955, - -949, - -942, - -935, - -928, - -920, - -912, - -904, - -895, - -886, - -877, - -868, - -858, - -848, - -838, - -828, - -817, - -806, - -795, - -784, - -772, - -760, - -748, - -736, - -724, - -711, - -698, - -685, - -671, - -658, - -644, - -630, - -616, - -601, - -587, - -572, - -557, - -542, - -527, - -512, - -496, - -480, - -464, - -448, - -432, - -416, - -400, - -383, - -366, - -350, - -333, - -316, - -299, - -282, - -265, - -247, - -230, - -212, - -195, - -177, - -160, - -142, - -124, - -107, - -89, - -71, - -53, - -35, - -17, - 0, - 17, - 35, - 53, - 71, - 89, - 107, - 124, - 142, - 160, - 177, - 195, - 212, - 230, - 247, - 265, - 282, - 299, - 316, - 333, - 350, - 366, - 383, - 400, - 416, - 432, - 448, - 464, - 480, - 496, - 512, - 527, - 542, - 557, - 572, - 587, - 601, - 616, - 630, - 644, - 658, - 671, - 685, - 698, - 711, - 724, - 736, - 748, - 760, - 772, - 784, - 795, - 806, - 817, - 828, - 838, - 848, - 858, - 868, - 877, - 886, - 895, - 904, - 912, - 920, - 928, - 935, - 942, - 949, - 955, - 962, - 968, - 973, - 979, - 984, - 989, - 993, - 997, - 1001, - 1005, - 1008, - 1011, - 1014, - 1016, - 1018, - 1020, - 1021, - 1022, - 1023, - 1023 -}; - -int gdSinT[] = -{ - 0, - 17, - 35, - 53, - 71, - 89, - 107, - 124, - 142, - 160, - 177, - 195, - 212, - 230, - 247, - 265, - 282, - 299, - 316, - 333, - 350, - 366, - 383, - 400, - 416, - 432, - 448, - 464, - 480, - 496, - 512, - 527, - 542, - 557, - 572, - 587, - 601, - 616, - 630, - 644, - 658, - 671, - 685, - 698, - 711, - 724, - 736, - 748, - 760, - 772, - 784, - 795, - 806, - 817, - 828, - 838, - 848, - 858, - 868, - 877, - 886, - 895, - 904, - 912, - 920, - 928, - 935, - 942, - 949, - 955, - 962, - 968, - 973, - 979, - 984, - 989, - 993, - 997, - 1001, - 1005, - 1008, - 1011, - 1014, - 1016, - 1018, - 1020, - 1021, - 1022, - 1023, - 1023, - 1024, - 1023, - 1023, - 1022, - 1021, - 1020, - 1018, - 1016, - 1014, - 1011, - 1008, - 1005, - 1001, - 997, - 993, - 989, - 984, - 979, - 973, - 968, - 962, - 955, - 949, - 942, - 935, - 928, - 920, - 912, - 904, - 895, - 886, - 877, - 868, - 858, - 848, - 838, - 828, - 817, - 806, - 795, - 784, - 772, - 760, - 748, - 736, - 724, - 711, - 698, - 685, - 671, - 658, - 644, - 630, - 616, - 601, - 587, - 572, - 557, - 542, - 527, - 512, - 496, - 480, - 464, - 448, - 432, - 416, - 400, - 383, - 366, - 350, - 333, - 316, - 299, - 282, - 265, - 247, - 230, - 212, - 195, - 177, - 160, - 142, - 124, - 107, - 89, - 71, - 53, - 35, - 17, - 0, - -17, - -35, - -53, - -71, - -89, - -107, - -124, - -142, - -160, - -177, - -195, - -212, - -230, - -247, - -265, - -282, - -299, - -316, - -333, - -350, - -366, - -383, - -400, - -416, - -432, - -448, - -464, - -480, - -496, - -512, - -527, - -542, - -557, - -572, - -587, - -601, - -616, - -630, - -644, - -658, - -671, - -685, - -698, - -711, - -724, - -736, - -748, - -760, - -772, - -784, - -795, - -806, - -817, - -828, - -838, - -848, - -858, - -868, - -877, - -886, - -895, - -904, - -912, - -920, - -928, - -935, - -942, - -949, - -955, - -962, - -968, - -973, - -979, - -984, - -989, - -993, - -997, - -1001, - -1005, - -1008, - -1011, - -1014, - -1016, - -1018, - -1020, - -1021, - -1022, - -1023, - -1023, - -1024, - -1023, - -1023, - -1022, - -1021, - -1020, - -1018, - -1016, - -1014, - -1011, - -1008, - -1005, - -1001, - -997, - -993, - -989, - -984, - -979, - -973, - -968, - -962, - -955, - -949, - -942, - -935, - -928, - -920, - -912, - -904, - -895, - -886, - -877, - -868, - -858, - -848, - -838, - -828, - -817, - -806, - -795, - -784, - -772, - -760, - -748, - -736, - -724, - -711, - -698, - -685, - -671, - -658, - -644, - -630, - -616, - -601, - -587, - -572, - -557, - -542, - -527, - -512, - -496, - -480, - -464, - -448, - -432, - -416, - -400, - -383, - -366, - -350, - -333, - -316, - -299, - -282, - -265, - -247, - -230, - -212, - -195, - -177, - -160, - -142, - -124, - -107, - -89, - -71, - -53, - -35, - -17 -}; diff --git a/ext/gd/libgd/gdtest.c b/ext/gd/libgd/gdtest.c deleted file mode 100644 index f4300bb3fd5b2..0000000000000 --- a/ext/gd/libgd/gdtest.c +++ /dev/null @@ -1,409 +0,0 @@ -#include -#ifdef _WIN32 -#include -int -unlink (const char *filename) -{ - return _unlink (filename); -} -#else -#include /* for getpid(), unlink() */ -#endif -#include "gd.h" - -void CompareImages (char *msg, gdImagePtr im1, gdImagePtr im2); - -static int freadWrapper (void *context, char *buf, int len); -static int fwriteWrapper (void *context, const char *buffer, int len); - -int -main (int argc, char **argv) -{ - gdImagePtr im, ref, im2, im3; - FILE *in, *out; - void *iptr; - int sz; - gdIOCtxPtr ctx; - char of[256]; - int colRed, colBlu; - gdSource imgsrc; - gdSink imgsnk; - int foreground; - int i; - if (argc != 2) - { - fprintf (stderr, "Usage: gdtest filename.png\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromPng (in); - - rewind (in); - ref = gdImageCreateFromPng (in); - - fclose (in); - - printf ("Reference File has %d Palette entries\n", ref->colorsTotal); - - CompareImages ("Initial Versions", ref, im); - - - /* */ - /* Send to PNG File then Ptr */ - /* */ - sprintf (of, "%s.png", argv[1]); - out = fopen (of, "wb"); - gdImagePng (im, out); - fclose (out); - - in = fopen (of, "rb"); - if (!in) - { - fprintf (stderr, "PNG Output file does not exist!\n"); - exit (1); - } - im2 = gdImageCreateFromPng (in); - fclose (in); - - CompareImages ("GD->PNG File->GD", ref, im2); - - unlink (of); - gdImageDestroy (im2); - - iptr = gdImagePngPtr (im, &sz); - ctx = gdNewDynamicCtx (sz, iptr); - im2 = gdImageCreateFromPngCtx (ctx); - - CompareImages ("GD->PNG ptr->GD", ref, im2); - - gdImageDestroy (im2); - ctx->gd_free (ctx); - - - /* */ - /* Send to GD2 File then Ptr */ - /* */ - sprintf (of, "%s.gd2", argv[1]); - out = fopen (of, "wb"); - gdImageGd2 (im, out, 128, 2); - fclose (out); - - in = fopen (of, "rb"); - if (!in) - { - fprintf (stderr, "GD2 Output file does not exist!\n"); - exit (1); - } - im2 = gdImageCreateFromGd2 (in); - fclose (in); - - CompareImages ("GD->GD2 File->GD", ref, im2); - - unlink (of); - gdImageDestroy (im2); - - iptr = gdImageGd2Ptr (im, 128, 2, &sz); - /*printf("Got ptr %d (size %d)\n",iptr, sz); */ - ctx = gdNewDynamicCtx (sz, iptr); - /*printf("Got ctx %d\n",ctx); */ - im2 = gdImageCreateFromGd2Ctx (ctx); - /*printf("Got img2 %d\n",im2); */ - - CompareImages ("GD->GD2 ptr->GD", ref, im2); - - gdImageDestroy (im2); - ctx->gd_free (ctx); - - - /* */ - /* Send to GD File then Ptr */ - /* */ - sprintf (of, "%s.gd", argv[1]); - out = fopen (of, "wb"); - gdImageGd (im, out); - fclose (out); - - in = fopen (of, "rb"); - if (!in) - { - fprintf (stderr, "GD Output file does not exist!\n"); - exit (1); - } - im2 = gdImageCreateFromGd (in); - fclose (in); - - CompareImages ("GD->GD File->GD", ref, im2); - - unlink (of); - gdImageDestroy (im2); - - iptr = gdImageGdPtr (im, &sz); - /*printf("Got ptr %d (size %d)\n",iptr, sz); */ - ctx = gdNewDynamicCtx (sz, iptr); - /*printf("Got ctx %d\n",ctx); */ - im2 = gdImageCreateFromGdCtx (ctx); - /*printf("Got img2 %d\n",im2); */ - - CompareImages ("GD->GD ptr->GD", ref, im2); - - gdImageDestroy (im2); - ctx->gd_free (ctx); - - /* - ** Test gdImageCreateFromPngSource' - * */ - - in = fopen (argv[1], "rb"); - - imgsrc.source = freadWrapper; - imgsrc.context = in; - im2 = gdImageCreateFromPngSource (&imgsrc); - fclose (in); - - if (im2 == NULL) - { - printf ("GD Source: ERROR Null returned by gdImageCreateFromPngSource\n"); - } - else - { - CompareImages ("GD Source", ref, im2); - gdImageDestroy (im2); - }; - - - /* - ** Test gdImagePngToSink' - * */ - - sprintf (of, "%s.snk", argv[1]); - out = fopen (of, "wb"); - imgsnk.sink = fwriteWrapper; - imgsnk.context = out; - gdImagePngToSink (im, &imgsnk); - fclose (out); - in = fopen (of, "rb"); - if (!in) - { - fprintf (stderr, "GD Sink: ERROR - GD Sink Output file does not exist!\n"); - } - else - { - im2 = gdImageCreateFromPng (in); - fclose (in); - - CompareImages ("GD Sink", ref, im2); - gdImageDestroy (im2); - }; - - unlink (of); - - /* */ - /* Test Extraction */ - /* */ - in = fopen ("test/gdtest_200_300_150_100.png", "rb"); - if (!in) - { - fprintf (stderr, "gdtest_200_300_150_100.png does not exist!\n"); - exit (1); - } - im2 = gdImageCreateFromPng (in); - fclose (in); - - - in = fopen ("test/gdtest.gd2", "rb"); - if (!in) - { - fprintf (stderr, "gdtest.gd2 does not exist!\n"); - exit (1); - } - im3 = gdImageCreateFromGd2Part (in, 200, 300, 150, 100); - fclose (in); - - CompareImages ("GD2Part (gdtest_200_300_150_100.png, gdtest.gd2(part))", im2, im3); - - gdImageDestroy (im2); - gdImageDestroy (im3); - - /* */ - /* Copy Blend */ - /* */ - in = fopen ("test/gdtest.png", "rb"); - if (!in) - { - fprintf (stderr, "gdtest.png does not exist!\n"); - exit (1); - } - im2 = gdImageCreateFromPng (in); - fclose (in); - - im3 = gdImageCreate (100, 60); - colRed = gdImageColorAllocate (im3, 255, 0, 0); - colBlu = gdImageColorAllocate (im3, 0, 0, 255); - gdImageFilledRectangle (im3, 0, 0, 49, 30, colRed); - gdImageFilledRectangle (im3, 50, 30, 99, 59, colBlu); - - gdImageCopyMerge (im2, im3, 150, 200, 10, 10, 90, 50, 50); - gdImageCopyMerge (im2, im3, 180, 70, 10, 10, 90, 50, 50); - - gdImageCopyMergeGray (im2, im3, 250, 160, 10, 10, 90, 50, 50); - gdImageCopyMergeGray (im2, im3, 80, 70, 10, 10, 90, 50, 50); - - gdImageDestroy (im3); - - in = fopen ("test/gdtest_merge.png", "rb"); - if (!in) - { - fprintf (stderr, "gdtest_merge.png does not exist!\n"); - exit (1); - } - im3 = gdImageCreateFromPng (in); - fclose (in); - - printf ("[Merged Image has %d colours]\n", im2->colorsTotal); - CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3); - - gdImageDestroy (im2); - gdImageDestroy (im3); - -#ifdef HAVE_JPEG - out = fopen ("test/gdtest.jpg", "wb"); - if (!out) - { - fprintf (stderr, "Can't create file test/gdtest.jpg.\n"); - exit (1); - } - gdImageJpeg (im, out, -1); - fclose (out); - in = fopen ("test/gdtest.jpg", "rb"); - if (!in) - { - fprintf (stderr, "Can't open file test/gdtest.jpg.\n"); - exit (1); - } - im2 = gdImageCreateFromJpeg (in); - fclose (in); - if (!im2) - { - fprintf (stderr, "gdImageCreateFromJpeg failed.\n"); - exit (1); - } - gdImageDestroy (im2); - printf ("Created test/gdtest.jpg successfully. Compare this image\n" - "to the input image manually. Some difference must be\n" - "expected as JPEG is a lossy file format.\n"); -#endif /* HAVE_JPEG */ - /* Assume the color closest to black is the foreground - color for the B&W wbmp image. */ - fprintf (stderr, "NOTE: the WBMP output image will NOT match the original unless the original\n" - "is also black and white. This is OK!\n"); - foreground = gdImageColorClosest (im, 0, 0, 0); - fprintf (stderr, "Foreground index is %d\n", foreground); - if (foreground == -1) - { - fprintf (stderr, "Source image has no colors, skipping wbmp test.\n"); - } - else - { - out = fopen ("test/gdtest.wbmp", "wb"); - if (!out) - { - fprintf (stderr, "Can't create file test/gdtest.wbmp.\n"); - exit (1); - } - gdImageWBMP (im, foreground, out); - fclose (out); - in = fopen ("test/gdtest.wbmp", "rb"); - if (!in) - { - fprintf (stderr, "Can't open file test/gdtest.wbmp.\n"); - exit (1); - } - im2 = gdImageCreateFromWBMP (in); - fprintf (stderr, "WBMP has %d colors\n", gdImageColorsTotal (im2)); - fprintf (stderr, "WBMP colors are:\n"); - for (i = 0; (i < gdImageColorsTotal (im2)); i++) - { - fprintf (stderr, "%02X%02X%02X\n", - gdImageRed (im2, i), - gdImageGreen (im2, i), - gdImageBlue (im2, i)); - } - fclose (in); - if (!im2) - { - fprintf (stderr, "gdImageCreateFromWBMP failed.\n"); - exit (1); - } - CompareImages ("WBMP test (gdtest.png, gdtest.wbmp)", ref, im2); - out = fopen ("test/gdtest_wbmp_to_png.png", "wb"); - if (!out) - { - fprintf (stderr, "Can't create file test/gdtest_wbmp_to_png.png.\n"); - exit (1); - } - gdImagePng (im2, out); - fclose (out); - gdImageDestroy (im2); - } - gdImageDestroy (im); - gdImageDestroy (ref); - - return 0; -} - -void -CompareImages (char *msg, gdImagePtr im1, gdImagePtr im2) -{ - int cmpRes; - - cmpRes = gdImageCompare (im1, im2); - - if (cmpRes & GD_CMP_IMAGE) - { - printf ("%%%s: ERROR images differ: BAD\n", msg); - } - else if (cmpRes != 0) - { - printf ("%%%s: WARNING images differ: WARNING - Probably OK\n", msg); - } - else - { - printf ("%%%s: OK\n", msg); - return; - } - - if (cmpRes & (GD_CMP_SIZE_X + GD_CMP_SIZE_Y)) - { - printf ("-%s: INFO image sizes differ\n", msg); - } - - if (cmpRes & GD_CMP_NUM_COLORS) - { - printf ("-%s: INFO number of pallette entries differ %d Vs. %d\n", msg, - im1->colorsTotal, im2->colorsTotal); - } - - if (cmpRes & GD_CMP_COLOR) - { - printf ("-%s: INFO actual colours of pixels differ\n", msg); - } -} - - -static int -freadWrapper (void *context, char *buf, int len) -{ - int got = fread (buf, 1, len, (FILE *) context); - return got; -} - -static int -fwriteWrapper (void *context, const char *buffer, int len) -{ - return fwrite (buffer, 1, len, (FILE *) context); -} diff --git a/ext/gd/libgd/gdtestft.c b/ext/gd/libgd/gdtestft.c deleted file mode 100644 index 1bd0dfc51564d..0000000000000 --- a/ext/gd/libgd/gdtestft.c +++ /dev/null @@ -1,108 +0,0 @@ - -#include "gd.h" -#include - -#define PI 3.141592 -#define DEG2RAD(x) ((x)*PI/180.) - -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - -#define MAX4(x,y,z,w) \ - ((MAX((x),(y))) > (MAX((z),(w))) ? (MAX((x),(y))) : (MAX((z),(w)))) -#define MIN4(x,y,z,w) \ - ((MIN((x),(y))) < (MIN((z),(w))) ? (MIN((x),(y))) : (MIN((z),(w)))) - -#define MAXX(x) MAX4(x[0],x[2],x[4],x[6]) -#define MINX(x) MIN4(x[0],x[2],x[4],x[6]) -#define MAXY(x) MAX4(x[1],x[3],x[5],x[7]) -#define MINY(x) MIN4(x[1],x[3],x[5],x[7]) - -int -main (int argc, char *argv[]) -{ -#ifndef HAVE_LIBFREETYPE - fprintf (stderr, "gd was not compiled with HAVE_LIBFREETYPE defined.\n"); - fprintf (stderr, "Install the FreeType library, including the\n"); - fprintf (stderr, "header files. Then edit the gd Makefile, type\n"); - fprintf (stderr, "make clean, and type make again.\n"); - return 1; -#else - gdImagePtr im; - int black; - int white; - int brect[8]; - int x, y; - char *err; - FILE *out; -#ifdef JISX0208 - char *s = "Hello. ‚ħ‚ñ‚É‚ż‚Í Qyjpqg,"; /* String to draw. */ -#else - char *s = "Hello. Qyjpqg,"; /* String to draw. */ -#endif - - double sz = 40.; - -#if 0 - double angle = 0.; -#else - double angle = DEG2RAD (-90); -#endif - -#ifdef JISX0208 - char *f = "/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf"; /* UNICODE */ - /* char *f = "/usr/local/lib/fonts/truetype/DynaFont/dfpop1.ttf"; *//* SJIS */ -#else - char *f = "times"; /* TrueType font */ -#endif - - /* obtain brect so that we can size the image */ - err = gdImageStringFT ((gdImagePtr) NULL, &brect[0], 0, f, sz, angle, 0, 0, s); - if (err) - { - fprintf (stderr, "%s", err); - return 1; - } - - /* create an image just big enough for the string */ - x = MAXX (brect) - MINX (brect) + 6; - y = MAXY (brect) - MINY (brect) + 6; -#if 0 - im = gdImageCreate (500, 500); -#else - /* gd 2.0: true color images can use freetype too */ - im = gdImageCreateTrueColor (x, y); -#endif - - /* Background color. gd 2.0: fill the image with it; truecolor - images have a black background otherwise. */ - white = gdImageColorResolve (im, 255, 255, 255); - gdImageFilledRectangle (im, 0, 0, x, y, white); - black = gdImageColorResolve (im, 0, 0, 0); - - /* render the string, offset origin to center string */ - x = 0 - MINX (brect) + 3; - y = 0 - MINY (brect) + 3; - - err = gdImageStringFT (im, NULL, black, f, sz, angle, x, y, s); - if (err) - { - fprintf (stderr, "%s", err); - return 1; - } - /* TBB: Write img to test/fttest.png */ - out = fopen ("test/fttest.png", "wb"); - if (!out) - { - fprintf (stderr, "Can't create test/fttest.png\n"); - exit (1); - } - gdImagePng (im, out); - fclose (out); - fprintf (stderr, "Test image written to test/fttest.png\n"); - /* Destroy it */ - gdImageDestroy (im); - - return 0; -#endif /* HAVE_FREETYPE */ -} diff --git a/ext/gd/libgd/gdtopng.c b/ext/gd/libgd/gdtopng.c deleted file mode 100644 index 9de34990ab0bb..0000000000000 --- a/ext/gd/libgd/gdtopng.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in, *out; - if (argc != 3) - { - fprintf (stderr, "Usage: gdtopng filename.gd filename.png\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromGd (in); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in PNG format!\n"); - exit (1); - } - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } - gdImagePng (im, out); - fclose (out); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/gdxpm.c b/ext/gd/libgd/gdxpm.c deleted file mode 100644 index 785afb3680727..0000000000000 --- a/ext/gd/libgd/gdxpm.c +++ /dev/null @@ -1,139 +0,0 @@ - -/* - add ability to load xpm files to gd, requires the xpm - library. - Caolan.McNamara@ul.ie - http://www.csn.ul.ie/~caolan - */ -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#ifdef HAVE_XPM - -#include - -gdImagePtr gdImageCreateFromXpm (char *filename) -{ - XpmInfo info; - XpmImage image; - int i, j, k, number; - char buf[5]; - gdImagePtr im = 0; - char *apixel; - int *pointer; - int red = 0, green = 0, blue = 0; - int *colors; - int ret; - - ret = XpmReadFileToXpmImage(filename, &image, &info); - if (ret != XpmSuccess) { - return 0; - } - - if (!(im = gdImageCreate(image.width, image.height))) { - return 0; - } - - number = image.ncolors; - colors = (int *) safe_emalloc(number, sizeof(int), 0); - for (i = 0; i < number; i++) { - switch (strlen (image.colorTable[i].c_color)) { - case 4: - buf[1] = '\0'; - buf[0] = image.colorTable[i].c_color[1]; - red = strtol(buf, NULL, 16); - - buf[0] = image.colorTable[i].c_color[2]; - green = strtol(buf, NULL, 16); - - buf[0] = image.colorTable[i].c_color[3]; - blue = strtol(buf, NULL, 16); - break; - - case 7: - buf[2] = '\0'; - buf[0] = image.colorTable[i].c_color[1]; - buf[1] = image.colorTable[i].c_color[2]; - red = strtol(buf, NULL, 16); - - buf[0] = image.colorTable[i].c_color[3]; - buf[1] = image.colorTable[i].c_color[4]; - green = strtol(buf, NULL, 16); - - buf[0] = image.colorTable[i].c_color[5]; - buf[1] = image.colorTable[i].c_color[6]; - blue = strtol(buf, NULL, 16); - break; - - case 10: - buf[3] = '\0'; - buf[0] = image.colorTable[i].c_color[1]; - buf[1] = image.colorTable[i].c_color[2]; - buf[2] = image.colorTable[i].c_color[3]; - red = strtol(buf, NULL, 16); - red /= 64; - - buf[0] = image.colorTable[i].c_color[4]; - buf[1] = image.colorTable[i].c_color[5]; - buf[2] = image.colorTable[i].c_color[6]; - green = strtol(buf, NULL, 16); - green /= 64; - - buf[0] = image.colorTable[i].c_color[7]; - buf[1] = image.colorTable[i].c_color[8]; - buf[2] = image.colorTable[i].c_color[9]; - blue = strtol(buf, NULL, 16); - blue /= 64; - break; - - case 13: - buf[4] = '\0'; - buf[0] = image.colorTable[i].c_color[1]; - buf[1] = image.colorTable[i].c_color[2]; - buf[2] = image.colorTable[i].c_color[3]; - buf[3] = image.colorTable[i].c_color[4]; - red = strtol(buf, NULL, 16); - red /= 256; - - buf[0] = image.colorTable[i].c_color[5]; - buf[1] = image.colorTable[i].c_color[6]; - buf[2] = image.colorTable[i].c_color[7]; - buf[3] = image.colorTable[i].c_color[8]; - green = strtol(buf, NULL, 16); - green /= 256; - - buf[0] = image.colorTable[i].c_color[9]; - buf[1] = image.colorTable[i].c_color[10]; - buf[2] = image.colorTable[i].c_color[11]; - buf[3] = image.colorTable[i].c_color[12]; - blue = strtol(buf, NULL, 16); - blue /= 256; - break; - } - - - colors[i] = gdImageColorResolve(im, red, green, blue); - if (colors[i] == -1) { - php_gd_error("ARRRGH"); - } - } - - apixel = (char *) gdMalloc(image.cpp + 1); - apixel[image.cpp] = '\0'; - - pointer = (int *) image.data; - for (i = 0; i < image.height; i++) { - for (j = 0; j < image.width; j++) { - k = *pointer++; - gdImageSetPixel(im, j, i, colors[k]); - } - } - - gdFree(apixel); - gdFree(colors); - return im; -} -#endif diff --git a/ext/gd/libgd/jisx0208.h b/ext/gd/libgd/jisx0208.h deleted file mode 100644 index f8a8b510fa6cb..0000000000000 --- a/ext/gd/libgd/jisx0208.h +++ /dev/null @@ -1,1205 +0,0 @@ -#ifndef JISX0208_H -#define JISX0208_H -/* This file was derived from "src/VF_Ftype.c" in VFlib2-2.24.2 - by Dr. Kakugawa */ - -/* JIS -> Unicode mapping table */ -static unsigned short UnicodeTbl[][94] = { -{ /* category 01 */ -0x0000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A, 0xFF1B, -0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8, 0xFF3E, -0xFFE3, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003, 0x4EDD, -0x3005, 0x3006, 0x3007, 0x30FC, 0x2015, 0x2010, 0xFF0F, 0xFF3C, -0xFF5E, 0x2225, 0xFF5C, 0x2026, 0x2025, 0x2018, 0x2019, 0x201C, -0x201D, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B, 0xFF3D, 0xFF5B, -0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E, -0x300F, 0x3010, 0x3011, 0xFF0B, 0xFF0D, 0x00B1, 0x00D7, 0x00F7, -0xFF1D, 0x2260, 0xFF1C, 0xFF1E, 0x2266, 0x2267, 0x221E, 0x2234, -0x2642, 0x2640, 0x00B0, 0x2032, 0x2033, 0x2103, 0xFFE5, 0xFF04, -0xFFE0, 0xFFE1, 0xFF05, 0xFF03, 0xFF06, 0xFF0A, 0xFF20, 0x00A7, -0x2606, 0x2605, 0x25CB, 0x25CF, 0x25CE, 0x25C7}, -{ /* category 02 */ -0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC, 0x203B, -0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x2208, 0x220B, 0x2286, 0x2287, 0x2282, 0x2283, 0x222A, -0x2229, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x2227, 0x2228, 0xFFE2, 0x21D2, 0x21D4, 0x2200, 0x2203, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x2220, 0x22A5, 0x2312, 0x2202, 0x2207, -0x2261, 0x2252, 0x226A, 0x226B, 0x221A, 0x223D, 0x221D, 0x2235, -0x222B, 0x222C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A, 0x2020, 0x2021, /**/ -0x00B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x25EF}, -{ /* category 03 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF10, -0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18, -0xFF19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, -0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, -0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, -0xFF39, 0xFF3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, -0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, -0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, -0xFF59, 0xFF5A, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 04 */ -0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, -0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F, 0x3050, -0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, -0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, -0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, -0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, -0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, -0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, -0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, -0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, -0x3091, 0x3092, 0x3093, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 05 */ -0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, -0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, -0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, -0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, -0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, -0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, -0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, -0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, -0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, -0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, -0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 06 */ -0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, -0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, -0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, -0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, -0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 07 */ -0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, -0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, -0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, -0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, -0x042F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, -0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, -0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, -0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, -0x044F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 08 */ -0x2500, 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C, 0x252C, -0x2524, 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513, 0x251B, -0x2517, 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520, 0x252F, -0x2528, 0x2537, 0x253F, 0x251D, 0x2530, 0x2525, 0x2538, 0x2542, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 09 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 10 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 11 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 12 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 13 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 14 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 15 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 16 */ -0x4E9C, 0x5516, 0x5A03, 0x963F, 0x54C0, 0x611B, 0x6328, 0x59F6, -0x9022, 0x8475, 0x831C, 0x7A50, 0x60AA, 0x63E1, 0x6E25, 0x65ED, -0x8466, 0x82A6, 0x9BF5, 0x6893, 0x5727, 0x65A1, 0x6271, 0x5B9B, -0x59D0, 0x867B, 0x98F4, 0x7D62, 0x7DBE, 0x9B8E, 0x6216, 0x7C9F, -0x88B7, 0x5B89, 0x5EB5, 0x6309, 0x6697, 0x6848, 0x95C7, 0x978D, -0x674F, 0x4EE5, 0x4F0A, 0x4F4D, 0x4F9D, 0x5049, 0x56F2, 0x5937, -0x59D4, 0x5A01, 0x5C09, 0x60DF, 0x610F, 0x6170, 0x6613, 0x6905, -0x70BA, 0x754F, 0x7570, 0x79FB, 0x7DAD, 0x7DEF, 0x80C3, 0x840E, -0x8863, 0x8B02, 0x9055, 0x907A, 0x533B, 0x4E95, 0x4EA5, 0x57DF, -0x80B2, 0x90C1, 0x78EF, 0x4E00, 0x58F1, 0x6EA2, 0x9038, 0x7A32, -0x8328, 0x828B, 0x9C2F, 0x5141, 0x5370, 0x54BD, 0x54E1, 0x56E0, -0x59FB, 0x5F15, 0x98F2, 0x6DEB, 0x80E4, 0x852D}, -{ /* category 17 */ -0x9662, 0x9670, 0x96A0, 0x97FB, 0x540B, 0x53F3, 0x5B87, 0x70CF, -0x7FBD, 0x8FC2, 0x96E8, 0x536F, 0x9D5C, 0x7ABA, 0x4E11, 0x7893, -0x81FC, 0x6E26, 0x5618, 0x5504, 0x6B1D, 0x851A, 0x9C3B, 0x59E5, -0x53A9, 0x6D66, 0x74DC, 0x958F, 0x5642, 0x4E91, 0x904B, 0x96F2, -0x834F, 0x990C, 0x53E1, 0x55B6, 0x5B30, 0x5F71, 0x6620, 0x66F3, -0x6804, 0x6C38, 0x6CF3, 0x6D29, 0x745B, 0x76C8, 0x7A4E, 0x9834, -0x82F1, 0x885B, 0x8A60, 0x92ED, 0x6DB2, 0x75AB, 0x76CA, 0x99C5, -0x60A6, 0x8B01, 0x8D8A, 0x95B2, 0x698E, 0x53AD, 0x5186, 0x5712, -0x5830, 0x5944, 0x5BB4, 0x5EF6, 0x6028, 0x63A9, 0x63F4, 0x6CBF, -0x6F14, 0x708E, 0x7114, 0x7159, 0x71D5, 0x733F, 0x7E01, 0x8276, -0x82D1, 0x8597, 0x9060, 0x925B, 0x9D1B, 0x5869, 0x65BC, 0x6C5A, -0x7525, 0x51F9, 0x592E, 0x5965, 0x5F80, 0x5FDC}, -{ /* category 18 */ -0x62BC, 0x65FA, 0x6A2A, 0x6B27, 0x6BB4, 0x738B, 0x7FC1, 0x8956, -0x9D2C, 0x9D0E, 0x9EC4, 0x5CA1, 0x6C96, 0x837B, 0x5104, 0x5C4B, -0x61B6, 0x81C6, 0x6876, 0x7261, 0x4E59, 0x4FFA, 0x5378, 0x6069, -0x6E29, 0x7A4F, 0x97F3, 0x4E0B, 0x5316, 0x4EEE, 0x4F55, 0x4F3D, -0x4FA1, 0x4F73, 0x52A0, 0x53EF, 0x5609, 0x590F, 0x5AC1, 0x5BB6, -0x5BE1, 0x79D1, 0x6687, 0x679C, 0x67B6, 0x6B4C, 0x6CB3, 0x706B, -0x73C2, 0x798D, 0x79BE, 0x7A3C, 0x7B87, 0x82B1, 0x82DB, 0x8304, -0x8377, 0x83EF, 0x83D3, 0x8766, 0x8AB2, 0x5629, 0x8CA8, 0x8FE6, -0x904E, 0x971E, 0x868A, 0x4FC4, 0x5CE8, 0x6211, 0x7259, 0x753B, -0x81E5, 0x82BD, 0x86FE, 0x8CC0, 0x96C5, 0x9913, 0x99D5, 0x4ECB, -0x4F1A, 0x89E3, 0x56DE, 0x584A, 0x58CA, 0x5EFB, 0x5FEB, 0x602A, -0x6094, 0x6062, 0x61D0, 0x6212, 0x62D0, 0x6539}, -{ /* category 19 */ -0x9B41, 0x6666, 0x68B0, 0x6D77, 0x7070, 0x754C, 0x7686, 0x7D75, -0x82A5, 0x87F9, 0x958B, 0x968E, 0x8C9D, 0x51F1, 0x52BE, 0x5916, -0x54B3, 0x5BB3, 0x5D16, 0x6168, 0x6982, 0x6DAF, 0x788D, 0x84CB, -0x8857, 0x8A72, 0x93A7, 0x9AB8, 0x6D6C, 0x99A8, 0x86D9, 0x57A3, -0x67FF, 0x86CE, 0x920E, 0x5283, 0x5687, 0x5404, 0x5ED3, 0x62E1, -0x64B9, 0x683C, 0x6838, 0x6BBB, 0x7372, 0x78BA, 0x7A6B, 0x899A, -0x89D2, 0x8D6B, 0x8F03, 0x90ED, 0x95A3, 0x9694, 0x9769, 0x5B66, -0x5CB3, 0x697D, 0x984D, 0x984E, 0x639B, 0x7B20, 0x6A2B, 0x6A7F, -0x68B6, 0x9C0D, 0x6F5F, 0x5272, 0x559D, 0x6070, 0x62EC, 0x6D3B, -0x6E07, 0x6ED1, 0x845B, 0x8910, 0x8F44, 0x4E14, 0x9C39, 0x53F6, -0x691B, 0x6A3A, 0x9784, 0x682A, 0x515C, 0x7AC3, 0x84B2, 0x91DC, -0x938C, 0x565B, 0x9D28, 0x6822, 0x8305, 0x8431}, -{ /* category 20 */ -0x7CA5, 0x5208, 0x82C5, 0x74E6, 0x4E7E, 0x4F83, 0x51A0, 0x5BD2, -0x520A, 0x52D8, 0x52E7, 0x5DFB, 0x559A, 0x582A, 0x59E6, 0x5B8C, -0x5B98, 0x5BDB, 0x5E72, 0x5E79, 0x60A3, 0x611F, 0x6163, 0x61BE, -0x63DB, 0x6562, 0x67D1, 0x6853, 0x68FA, 0x6B3E, 0x6B53, 0x6C57, -0x6F22, 0x6F97, 0x6F45, 0x74B0, 0x7518, 0x76E3, 0x770B, 0x7AFF, -0x7BA1, 0x7C21, 0x7DE9, 0x7F36, 0x7FF0, 0x809D, 0x8266, 0x839E, -0x89B3, 0x8ACC, 0x8CAB, 0x9084, 0x9451, 0x9593, 0x9591, 0x95A2, -0x9665, 0x97D3, 0x9928, 0x8218, 0x4E38, 0x542B, 0x5CB8, 0x5DCC, -0x73A9, 0x764C, 0x773C, 0x5CA9, 0x7FEB, 0x8D0B, 0x96C1, 0x9811, -0x9854, 0x9858, 0x4F01, 0x4F0E, 0x5371, 0x559C, 0x5668, 0x57FA, -0x5947, 0x5B09, 0x5BC4, 0x5C90, 0x5E0C, 0x5E7E, 0x5FCC, 0x63EE, -0x673A, 0x65D7, 0x65E2, 0x671F, 0x68CB, 0x68C4}, -{ /* category 21 */ -0x6A5F, 0x5E30, 0x6BC5, 0x6C17, 0x6C7D, 0x757F, 0x7948, 0x5B63, -0x7A00, 0x7D00, 0x5FBD, 0x898F, 0x8A18, 0x8CB4, 0x8D77, 0x8ECC, -0x8F1D, 0x98E2, 0x9A0E, 0x9B3C, 0x4E80, 0x507D, 0x5100, 0x5993, -0x5B9C, 0x622F, 0x6280, 0x64EC, 0x6B3A, 0x72A0, 0x7591, 0x7947, -0x7FA9, 0x87FB, 0x8ABC, 0x8B70, 0x63AC, 0x83CA, 0x97A0, 0x5409, -0x5403, 0x55AB, 0x6854, 0x6A58, 0x8A70, 0x7827, 0x6775, 0x9ECD, -0x5374, 0x5BA2, 0x811A, 0x8650, 0x9006, 0x4E18, 0x4E45, 0x4EC7, -0x4F11, 0x53CA, 0x5438, 0x5BAE, 0x5F13, 0x6025, 0x6551, 0x673D, -0x6C42, 0x6C72, 0x6CE3, 0x7078, 0x7403, 0x7A76, 0x7AAE, 0x7B08, -0x7D1A, 0x7CFE, 0x7D66, 0x65E7, 0x725B, 0x53BB, 0x5C45, 0x5DE8, -0x62D2, 0x62E0, 0x6319, 0x6E20, 0x865A, 0x8A31, 0x8DDD, 0x92F8, -0x6F01, 0x79A6, 0x9B5A, 0x4EA8, 0x4EAB, 0x4EAC}, -{ /* category 22 */ -0x4F9B, 0x4FA0, 0x50D1, 0x5147, 0x7AF6, 0x5171, 0x51F6, 0x5354, -0x5321, 0x537F, 0x53EB, 0x55AC, 0x5883, 0x5CE1, 0x5F37, 0x5F4A, -0x602F, 0x6050, 0x606D, 0x631F, 0x6559, 0x6A4B, 0x6CC1, 0x72C2, -0x72ED, 0x77EF, 0x80F8, 0x8105, 0x8208, 0x854E, 0x90F7, 0x93E1, -0x97FF, 0x9957, 0x9A5A, 0x4EF0, 0x51DD, 0x5C2D, 0x6681, 0x696D, -0x5C40, 0x66F2, 0x6975, 0x7389, 0x6850, 0x7C81, 0x50C5, 0x52E4, -0x5747, 0x5DFE, 0x9326, 0x65A4, 0x6B23, 0x6B3D, 0x7434, 0x7981, -0x79BD, 0x7B4B, 0x7DCA, 0x82B9, 0x83CC, 0x887F, 0x895F, 0x8B39, -0x8FD1, 0x91D1, 0x541F, 0x9280, 0x4E5D, 0x5036, 0x53E5, 0x533A, -0x72D7, 0x7396, 0x77E9, 0x82E6, 0x8EAF, 0x99C6, 0x99C8, 0x99D2, -0x5177, 0x611A, 0x865E, 0x55B0, 0x7A7A, 0x5076, 0x5BD3, 0x9047, -0x9685, 0x4E32, 0x6ADB, 0x91E7, 0x5C51, 0x5C48}, -{ /* category 23 */ -0x6398, 0x7A9F, 0x6C93, 0x9774, 0x8F61, 0x7AAA, 0x718A, 0x9688, -0x7C82, 0x6817, 0x7E70, 0x6851, 0x936C, 0x52F2, 0x541B, 0x85AB, -0x8A13, 0x7FA4, 0x8ECD, 0x90E1, 0x5366, 0x8888, 0x7941, 0x4FC2, -0x50BE, 0x5211, 0x5144, 0x5553, 0x572D, 0x73EA, 0x578B, 0x5951, -0x5F62, 0x5F84, 0x6075, 0x6176, 0x6167, 0x61A9, 0x63B2, 0x643A, -0x656C, 0x666F, 0x6842, 0x6E13, 0x7566, 0x7A3D, 0x7CFB, 0x7D4C, -0x7D99, 0x7E4B, 0x7F6B, 0x830E, 0x834A, 0x86CD, 0x8A08, 0x8A63, -0x8B66, 0x8EFD, 0x981A, 0x9D8F, 0x82B8, 0x8FCE, 0x9BE8, 0x5287, -0x621F, 0x6483, 0x6FC0, 0x9699, 0x6841, 0x5091, 0x6B20, 0x6C7A, -0x6F54, 0x7A74, 0x7D50, 0x8840, 0x8A23, 0x6708, 0x4EF6, 0x5039, -0x5026, 0x5065, 0x517C, 0x5238, 0x5263, 0x55A7, 0x570F, 0x5805, -0x5ACC, 0x5EFA, 0x61B2, 0x61F8, 0x62F3, 0x6372}, -{ /* category 24 */ -0x691C, 0x6A29, 0x727D, 0x72AC, 0x732E, 0x7814, 0x786F, 0x7D79, -0x770C, 0x80A9, 0x898B, 0x8B19, 0x8CE2, 0x8ED2, 0x9063, 0x9375, -0x967A, 0x9855, 0x9A13, 0x9E78, 0x5143, 0x539F, 0x53B3, 0x5E7B, -0x5F26, 0x6E1B, 0x6E90, 0x7384, 0x73FE, 0x7D43, 0x8237, 0x8A00, -0x8AFA, 0x9650, 0x4E4E, 0x500B, 0x53E4, 0x547C, 0x56FA, 0x59D1, -0x5B64, 0x5DF1, 0x5EAB, 0x5F27, 0x6238, 0x6545, 0x67AF, 0x6E56, -0x72D0, 0x7CCA, 0x88B4, 0x80A1, 0x80E1, 0x83F0, 0x864E, 0x8A87, -0x8DE8, 0x9237, 0x96C7, 0x9867, 0x9F13, 0x4E94, 0x4E92, 0x4F0D, -0x5348, 0x5449, 0x543E, 0x5A2F, 0x5F8C, 0x5FA1, 0x609F, 0x68A7, -0x6A8E, 0x745A, 0x7881, 0x8A9E, 0x8AA4, 0x8B77, 0x9190, 0x4E5E, -0x9BC9, 0x4EA4, 0x4F7C, 0x4FAF, 0x5019, 0x5016, 0x5149, 0x516C, -0x529F, 0x52B9, 0x52FE, 0x539A, 0x53E3, 0x5411}, -{ /* category 25 */ -0x540E, 0x5589, 0x5751, 0x57A2, 0x597D, 0x5B54, 0x5B5D, 0x5B8F, -0x5DE5, 0x5DE7, 0x5DF7, 0x5E78, 0x5E83, 0x5E9A, 0x5EB7, 0x5F18, -0x6052, 0x614C, 0x6297, 0x62D8, 0x63A7, 0x653B, 0x6602, 0x6643, -0x66F4, 0x676D, 0x6821, 0x6897, 0x69CB, 0x6C5F, 0x6D2A, 0x6D69, -0x6E2F, 0x6E9D, 0x7532, 0x7687, 0x786C, 0x7A3F, 0x7CE0, 0x7D05, -0x7D18, 0x7D5E, 0x7DB1, 0x8015, 0x8003, 0x80AF, 0x80B1, 0x8154, -0x818F, 0x822A, 0x8352, 0x884C, 0x8861, 0x8B1B, 0x8CA2, 0x8CFC, -0x90CA, 0x9175, 0x9271, 0x783F, 0x92FC, 0x95A4, 0x964D, 0x9805, -0x9999, 0x9AD8, 0x9D3B, 0x525B, 0x52AB, 0x53F7, 0x5408, 0x58D5, -0x62F7, 0x6FE0, 0x8C6A, 0x8F5F, 0x9EB9, 0x514B, 0x523B, 0x544A, -0x56FD, 0x7A40, 0x9177, 0x9D60, 0x9ED2, 0x7344, 0x6F09, 0x8170, -0x7511, 0x5FFD, 0x60DA, 0x9AA8, 0x72DB, 0x8FBC}, -{ /* category 26 */ -0x6B64, 0x9803, 0x4ECA, 0x56F0, 0x5764, 0x58BE, 0x5A5A, 0x6068, -0x61C7, 0x660F, 0x6606, 0x6839, 0x68B1, 0x6DF7, 0x75D5, 0x7D3A, -0x826E, 0x9B42, 0x4E9B, 0x4F50, 0x53C9, 0x5506, 0x5D6F, 0x5DE6, -0x5DEE, 0x67FB, 0x6C99, 0x7473, 0x7802, 0x8A50, 0x9396, 0x88DF, -0x5750, 0x5EA7, 0x632B, 0x50B5, 0x50AC, 0x518D, 0x6700, 0x54C9, -0x585E, 0x59BB, 0x5BB0, 0x5F69, 0x624D, 0x63A1, 0x683D, 0x6B73, -0x6E08, 0x707D, 0x91C7, 0x7280, 0x7815, 0x7826, 0x796D, 0x658E, -0x7D30, 0x83DC, 0x88C1, 0x8F09, 0x969B, 0x5264, 0x5728, 0x6750, -0x7F6A, 0x8CA1, 0x51B4, 0x5742, 0x962A, 0x583A, 0x698A, 0x80B4, -0x54B2, 0x5D0E, 0x57FC, 0x7895, 0x9DFA, 0x4F5C, 0x524A, 0x548B, -0x643E, 0x6628, 0x6714, 0x67F5, 0x7A84, 0x7B56, 0x7D22, 0x932F, -0x685C, 0x9BAD, 0x7B39, 0x5319, 0x518A, 0x5237}, -{ /* category 27 */ -0x5BDF, 0x62F6, 0x64AE, 0x64E6, 0x672D, 0x6BBA, 0x85A9, 0x96D1, -0x7690, 0x9BD6, 0x634C, 0x9306, 0x9BAB, 0x76BF, 0x6652, 0x4E09, -0x5098, 0x53C2, 0x5C71, 0x60E8, 0x6492, 0x6563, 0x685F, 0x71E6, -0x73CA, 0x7523, 0x7B97, 0x7E82, 0x8695, 0x8B83, 0x8CDB, 0x9178, -0x9910, 0x65AC, 0x66AB, 0x6B8B, 0x4ED5, 0x4ED4, 0x4F3A, 0x4F7F, -0x523A, 0x53F8, 0x53F2, 0x55E3, 0x56DB, 0x58EB, 0x59CB, 0x59C9, -0x59FF, 0x5B50, 0x5C4D, 0x5E02, 0x5E2B, 0x5FD7, 0x601D, 0x6307, -0x652F, 0x5B5C, 0x65AF, 0x65BD, 0x65E8, 0x679D, 0x6B62, 0x6B7B, -0x6C0F, 0x7345, 0x7949, 0x79C1, 0x7CF8, 0x7D19, 0x7D2B, 0x80A2, -0x8102, 0x81F3, 0x8996, 0x8A5E, 0x8A69, 0x8A66, 0x8A8C, 0x8AEE, -0x8CC7, 0x8CDC, 0x96CC, 0x98FC, 0x6B6F, 0x4E8B, 0x4F3C, 0x4F8D, -0x5150, 0x5B57, 0x5BFA, 0x6148, 0x6301, 0x6642}, -{ /* category 28 */ -0x6B21, 0x6ECB, 0x6CBB, 0x723E, 0x74BD, 0x75D4, 0x78C1, 0x793A, -0x800C, 0x8033, 0x81EA, 0x8494, 0x8F9E, 0x6C50, 0x9E7F, 0x5F0F, -0x8B58, 0x9D2B, 0x7AFA, 0x8EF8, 0x5B8D, 0x96EB, 0x4E03, 0x53F1, -0x57F7, 0x5931, 0x5AC9, 0x5BA4, 0x6089, 0x6E7F, 0x6F06, 0x75BE, -0x8CEA, 0x5B9F, 0x8500, 0x7BE0, 0x5072, 0x67F4, 0x829D, 0x5C61, -0x854A, 0x7E1E, 0x820E, 0x5199, 0x5C04, 0x6368, 0x8D66, 0x659C, -0x716E, 0x793E, 0x7D17, 0x8005, 0x8B1D, 0x8ECA, 0x906E, 0x86C7, -0x90AA, 0x501F, 0x52FA, 0x5C3A, 0x6753, 0x707C, 0x7235, 0x914C, -0x91C8, 0x932B, 0x82E5, 0x5BC2, 0x5F31, 0x60F9, 0x4E3B, 0x53D6, -0x5B88, 0x624B, 0x6731, 0x6B8A, 0x72E9, 0x73E0, 0x7A2E, 0x816B, -0x8DA3, 0x9152, 0x9996, 0x5112, 0x53D7, 0x546A, 0x5BFF, 0x6388, -0x6A39, 0x7DAC, 0x9700, 0x56DA, 0x53CE, 0x5468}, -{ /* category 29 */ -0x5B97, 0x5C31, 0x5DDE, 0x4FEE, 0x6101, 0x62FE, 0x6D32, 0x79C0, -0x79CB, 0x7D42, 0x7E4D, 0x7FD2, 0x81ED, 0x821F, 0x8490, 0x8846, -0x8972, 0x8B90, 0x8E74, 0x8F2F, 0x9031, 0x914B, 0x916C, 0x96C6, -0x919C, 0x4EC0, 0x4F4F, 0x5145, 0x5341, 0x5F93, 0x620E, 0x67D4, -0x6C41, 0x6E0B, 0x7363, 0x7E26, 0x91CD, 0x9283, 0x53D4, 0x5919, -0x5BBF, 0x6DD1, 0x795D, 0x7E2E, 0x7C9B, 0x587E, 0x719F, 0x51FA, -0x8853, 0x8FF0, 0x4FCA, 0x5CFB, 0x6625, 0x77AC, 0x7AE3, 0x821C, -0x99FF, 0x51C6, 0x5FAA, 0x65EC, 0x696F, 0x6B89, 0x6DF3, 0x6E96, -0x6F64, 0x76FE, 0x7D14, 0x5DE1, 0x9075, 0x9187, 0x9806, 0x51E6, -0x521D, 0x6240, 0x6691, 0x66D9, 0x6E1A, 0x5EB6, 0x7DD2, 0x7F72, -0x66F8, 0x85AF, 0x85F7, 0x8AF8, 0x52A9, 0x53D9, 0x5973, 0x5E8F, -0x5F90, 0x6055, 0x92E4, 0x9664, 0x50B7, 0x511F}, -{ /* category 30 */ -0x52DD, 0x5320, 0x5347, 0x53EC, 0x54E8, 0x5546, 0x5531, 0x5617, -0x5968, 0x59BE, 0x5A3C, 0x5BB5, 0x5C06, 0x5C0F, 0x5C11, 0x5C1A, -0x5E84, 0x5E8A, 0x5EE0, 0x5F70, 0x627F, 0x6284, 0x62DB, 0x638C, -0x6377, 0x6607, 0x660C, 0x662D, 0x6676, 0x677E, 0x68A2, 0x6A1F, -0x6A35, 0x6CBC, 0x6D88, 0x6E09, 0x6E58, 0x713C, 0x7126, 0x7167, -0x75C7, 0x7701, 0x785D, 0x7901, 0x7965, 0x79F0, 0x7AE0, 0x7B11, -0x7CA7, 0x7D39, 0x8096, 0x83D6, 0x848B, 0x8549, 0x885D, 0x88F3, -0x8A1F, 0x8A3C, 0x8A54, 0x8A73, 0x8C61, 0x8CDE, 0x91A4, 0x9266, -0x937E, 0x9418, 0x969C, 0x9798, 0x4E0A, 0x4E08, 0x4E1E, 0x4E57, -0x5197, 0x5270, 0x57CE, 0x5834, 0x58CC, 0x5B22, 0x5E38, 0x60C5, -0x64FE, 0x6761, 0x6756, 0x6D44, 0x72B6, 0x7573, 0x7A63, 0x84B8, -0x8B72, 0x91B8, 0x9320, 0x5631, 0x57F4, 0x98FE}, -{ /* category 31 */ -0x62ED, 0x690D, 0x6B96, 0x71ED, 0x7E54, 0x8077, 0x8272, 0x89E6, -0x98DF, 0x8755, 0x8FB1, 0x5C3B, 0x4F38, 0x4FE1, 0x4FB5, 0x5507, -0x5A20, 0x5BDD, 0x5BE9, 0x5FC3, 0x614E, 0x632F, 0x65B0, 0x664B, -0x68EE, 0x699B, 0x6D78, 0x6DF1, 0x7533, 0x75B9, 0x771F, 0x795E, -0x79E6, 0x7D33, 0x81E3, 0x82AF, 0x85AA, 0x89AA, 0x8A3A, 0x8EAB, -0x8F9B, 0x9032, 0x91DD, 0x9707, 0x4EBA, 0x4EC1, 0x5203, 0x5875, -0x58EC, 0x5C0B, 0x751A, 0x5C3D, 0x814E, 0x8A0A, 0x8FC5, 0x9663, -0x976D, 0x7B25, 0x8ACF, 0x9808, 0x9162, 0x56F3, 0x53A8, 0x9017, -0x5439, 0x5782, 0x5E25, 0x63A8, 0x6C34, 0x708A, 0x7761, 0x7C8B, -0x7FE0, 0x8870, 0x9042, 0x9154, 0x9310, 0x9318, 0x968F, 0x745E, -0x9AC4, 0x5D07, 0x5D69, 0x6570, 0x67A2, 0x8DA8, 0x96DB, 0x636E, -0x6749, 0x6919, 0x83C5, 0x9817, 0x96C0, 0x88FE}, -{ /* category 32 */ -0x6F84, 0x647A, 0x5BF8, 0x4E16, 0x702C, 0x755D, 0x662F, 0x51C4, -0x5236, 0x52E2, 0x59D3, 0x5F81, 0x6027, 0x6210, 0x653F, 0x6574, -0x661F, 0x6674, 0x68F2, 0x6816, 0x6B63, 0x6E05, 0x7272, 0x751F, -0x76DB, 0x7CBE, 0x8056, 0x58F0, 0x88FD, 0x897F, 0x8AA0, 0x8A93, -0x8ACB, 0x901D, 0x9192, 0x9752, 0x9759, 0x6589, 0x7A0E, 0x8106, -0x96BB, 0x5E2D, 0x60DC, 0x621A, 0x65A5, 0x6614, 0x6790, 0x77F3, -0x7A4D, 0x7C4D, 0x7E3E, 0x810A, 0x8CAC, 0x8D64, 0x8DE1, 0x8E5F, -0x78A9, 0x5207, 0x62D9, 0x63A5, 0x6442, 0x6298, 0x8A2D, 0x7A83, -0x7BC0, 0x8AAC, 0x96EA, 0x7D76, 0x820C, 0x8749, 0x4ED9, 0x5148, -0x5343, 0x5360, 0x5BA3, 0x5C02, 0x5C16, 0x5DDD, 0x6226, 0x6247, -0x64B0, 0x6813, 0x6834, 0x6CC9, 0x6D45, 0x6D17, 0x67D3, 0x6F5C, -0x714E, 0x717D, 0x65CB, 0x7A7F, 0x7BAD, 0x7DDA}, -{ /* category 33 */ -0x7E4A, 0x7FA8, 0x817A, 0x821B, 0x8239, 0x85A6, 0x8A6E, 0x8CCE, -0x8DF5, 0x9078, 0x9077, 0x92AD, 0x9291, 0x9583, 0x9BAE, 0x524D, -0x5584, 0x6F38, 0x7136, 0x5168, 0x7985, 0x7E55, 0x81B3, 0x7CCE, -0x564C, 0x5851, 0x5CA8, 0x63AA, 0x66FE, 0x66FD, 0x695A, 0x72D9, -0x758F, 0x758E, 0x790E, 0x7956, 0x79DF, 0x7C97, 0x7D20, 0x7D44, -0x8607, 0x8A34, 0x963B, 0x9061, 0x9F20, 0x50E7, 0x5275, 0x53CC, -0x53E2, 0x5009, 0x55AA, 0x58EE, 0x594F, 0x723D, 0x5B8B, 0x5C64, -0x531D, 0x60E3, 0x60F3, 0x635C, 0x6383, 0x633F, 0x63BB, 0x64CD, -0x65E9, 0x66F9, 0x5DE3, 0x69CD, 0x69FD, 0x6F15, 0x71E5, 0x4E89, -0x75E9, 0x76F8, 0x7A93, 0x7CDF, 0x7DCF, 0x7D9C, 0x8061, 0x8349, -0x8358, 0x846C, 0x84BC, 0x85FB, 0x88C5, 0x8D70, 0x9001, 0x906D, -0x9397, 0x971C, 0x9A12, 0x50CF, 0x5897, 0x618E}, -{ /* category 34 */ -0x81D3, 0x8535, 0x8D08, 0x9020, 0x4FC3, 0x5074, 0x5247, 0x5373, -0x606F, 0x6349, 0x675F, 0x6E2C, 0x8DB3, 0x901F, 0x4FD7, 0x5C5E, -0x8CCA, 0x65CF, 0x7D9A, 0x5352, 0x8896, 0x5176, 0x63C3, 0x5B58, -0x5B6B, 0x5C0A, 0x640D, 0x6751, 0x905C, 0x4ED6, 0x591A, 0x592A, -0x6C70, 0x8A51, 0x553E, 0x5815, 0x59A5, 0x60F0, 0x6253, 0x67C1, -0x8235, 0x6955, 0x9640, 0x99C4, 0x9A28, 0x4F53, 0x5806, 0x5BFE, -0x8010, 0x5CB1, 0x5E2F, 0x5F85, 0x6020, 0x614B, 0x6234, 0x66FF, -0x6CF0, 0x6EDE, 0x80CE, 0x817F, 0x82D4, 0x888B, 0x8CB8, 0x9000, -0x902E, 0x968A, 0x9EDB, 0x9BDB, 0x4EE3, 0x53F0, 0x5927, 0x7B2C, -0x918D, 0x984C, 0x9DF9, 0x6EDD, 0x7027, 0x5353, 0x5544, 0x5B85, -0x6258, 0x629E, 0x62D3, 0x6CA2, 0x6FEF, 0x7422, 0x8A17, 0x9438, -0x6FC1, 0x8AFE, 0x8338, 0x51E7, 0x86F8, 0x53EA}, -{ /* category 35 */ -0x53E9, 0x4F46, 0x9054, 0x8FB0, 0x596A, 0x8131, 0x5DFD, 0x7AEA, -0x8FBF, 0x68DA, 0x8C37, 0x72F8, 0x9C48, 0x6A3D, 0x8AB0, 0x4E39, -0x5358, 0x5606, 0x5766, 0x62C5, 0x63A2, 0x65E6, 0x6B4E, 0x6DE1, -0x6E5B, 0x70AD, 0x77ED, 0x7AEF, 0x7BAA, 0x7DBB, 0x803D, 0x80C6, -0x86CB, 0x8A95, 0x935B, 0x56E3, 0x58C7, 0x5F3E, 0x65AD, 0x6696, -0x6A80, 0x6BB5, 0x7537, 0x8AC7, 0x5024, 0x77E5, 0x5730, 0x5F1B, -0x6065, 0x667A, 0x6C60, 0x75F4, 0x7A1A, 0x7F6E, 0x81F4, 0x8718, -0x9045, 0x99B3, 0x7BC9, 0x755C, 0x7AF9, 0x7B51, 0x84C4, 0x9010, -0x79E9, 0x7A92, 0x8336, 0x5AE1, 0x7740, 0x4E2D, 0x4EF2, 0x5B99, -0x5FE0, 0x62BD, 0x663C, 0x67F1, 0x6CE8, 0x866B, 0x8877, 0x8A3B, -0x914E, 0x92F3, 0x99D0, 0x6A17, 0x7026, 0x732A, 0x82E7, 0x8457, -0x8CAF, 0x4E01, 0x5146, 0x51CB, 0x558B, 0x5BF5}, -{ /* category 36 */ -0x5E16, 0x5E33, 0x5E81, 0x5F14, 0x5F35, 0x5F6B, 0x5FB4, 0x61F2, -0x6311, 0x66A2, 0x671D, 0x6F6E, 0x7252, 0x753A, 0x773A, 0x8074, -0x8139, 0x8178, 0x8776, 0x8ABF, 0x8ADC, 0x8D85, 0x8DF3, 0x929A, -0x9577, 0x9802, 0x9CE5, 0x52C5, 0x6357, 0x76F4, 0x6715, 0x6C88, -0x73CD, 0x8CC3, 0x93AE, 0x9673, 0x6D25, 0x589C, 0x690E, 0x69CC, -0x8FFD, 0x939A, 0x75DB, 0x901A, 0x585A, 0x6802, 0x63B4, 0x69FB, -0x4F43, 0x6F2C, 0x67D8, 0x8FBB, 0x8526, 0x7DB4, 0x9354, 0x693F, -0x6F70, 0x576A, 0x58F7, 0x5B2C, 0x7D2C, 0x722A, 0x540A, 0x91E3, -0x9DB4, 0x4EAD, 0x4F4E, 0x505C, 0x5075, 0x5243, 0x8C9E, 0x5448, -0x5824, 0x5B9A, 0x5E1D, 0x5E95, 0x5EAD, 0x5EF7, 0x5F1F, 0x608C, -0x62B5, 0x633A, 0x63D0, 0x68AF, 0x6C40, 0x7887, 0x798E, 0x7A0B, -0x7DE0, 0x8247, 0x8A02, 0x8AE6, 0x8E44, 0x9013}, -{ /* category 37 */ -0x90B8, 0x912D, 0x91D8, 0x9F0E, 0x6CE5, 0x6458, 0x64E2, 0x6575, -0x6EF4, 0x7684, 0x7B1B, 0x9069, 0x93D1, 0x6EBA, 0x54F2, 0x5FB9, -0x64A4, 0x8F4D, 0x8FED, 0x9244, 0x5178, 0x586B, 0x5929, 0x5C55, -0x5E97, 0x6DFB, 0x7E8F, 0x751C, 0x8CBC, 0x8EE2, 0x985B, 0x70B9, -0x4F1D, 0x6BBF, 0x6FB1, 0x7530, 0x96FB, 0x514E, 0x5410, 0x5835, -0x5857, 0x59AC, 0x5C60, 0x5F92, 0x6597, 0x675C, 0x6E21, 0x767B, -0x83DF, 0x8CED, 0x9014, 0x90FD, 0x934D, 0x7825, 0x783A, 0x52AA, -0x5EA6, 0x571F, 0x5974, 0x6012, 0x5012, 0x515A, 0x51AC, 0x51CD, -0x5200, 0x5510, 0x5854, 0x5858, 0x5957, 0x5B95, 0x5CF6, 0x5D8B, -0x60BC, 0x6295, 0x642D, 0x6771, 0x6843, 0x68BC, 0x68DF, 0x76D7, -0x6DD8, 0x6E6F, 0x6D9B, 0x706F, 0x71C8, 0x5F53, 0x75D8, 0x7977, -0x7B49, 0x7B54, 0x7B52, 0x7CD6, 0x7D71, 0x5230}, -{ /* category 38 */ -0x8463, 0x8569, 0x85E4, 0x8A0E, 0x8B04, 0x8C46, 0x8E0F, 0x9003, -0x900F, 0x9419, 0x9676, 0x982D, 0x9A30, 0x95D8, 0x50CD, 0x52D5, -0x540C, 0x5802, 0x5C0E, 0x61A7, 0x649E, 0x6D1E, 0x77B3, 0x7AE5, -0x80F4, 0x8404, 0x9053, 0x9285, 0x5CE0, 0x9D07, 0x533F, 0x5F97, -0x5FB3, 0x6D9C, 0x7279, 0x7763, 0x79BF, 0x7BE4, 0x6BD2, 0x72EC, -0x8AAD, 0x6803, 0x6A61, 0x51F8, 0x7A81, 0x6934, 0x5C4A, 0x9CF6, -0x82EB, 0x5BC5, 0x9149, 0x701E, 0x5678, 0x5C6F, 0x60C7, 0x6566, -0x6C8C, 0x8C5A, 0x9041, 0x9813, 0x5451, 0x66C7, 0x920D, 0x5948, -0x90A3, 0x5185, 0x4E4D, 0x51EA, 0x8599, 0x8B0E, 0x7058, 0x637A, -0x934B, 0x6962, 0x99B4, 0x7E04, 0x7577, 0x5357, 0x6960, 0x8EDF, -0x96E3, 0x6C5D, 0x4E8C, 0x5C3C, 0x5F10, 0x8FE9, 0x5302, 0x8CD1, -0x8089, 0x8679, 0x5EFF, 0x65E5, 0x4E73, 0x5165}, -{ /* category 39 */ -0x5982, 0x5C3F, 0x97EE, 0x4EFB, 0x598A, 0x5FCD, 0x8A8D, 0x6FE1, -0x79B0, 0x7962, 0x5BE7, 0x8471, 0x732B, 0x71B1, 0x5E74, 0x5FF5, -0x637B, 0x649A, 0x71C3, 0x7C98, 0x4E43, 0x5EFC, 0x4E4B, 0x57DC, -0x56A2, 0x60A9, 0x6FC3, 0x7D0D, 0x80FD, 0x8133, 0x81BF, 0x8FB2, -0x8997, 0x86A4, 0x5DF4, 0x628A, 0x64AD, 0x8987, 0x6777, 0x6CE2, -0x6D3E, 0x7436, 0x7834, 0x5A46, 0x7F75, 0x82AD, 0x99AC, 0x4FF3, -0x5EC3, 0x62DD, 0x6392, 0x6557, 0x676F, 0x76C3, 0x724C, 0x80CC, -0x80BA, 0x8F29, 0x914D, 0x500D, 0x57F9, 0x5A92, 0x6885, 0x6973, -0x7164, 0x72FD, 0x8CB7, 0x58F2, 0x8CE0, 0x966A, 0x9019, 0x877F, -0x79E4, 0x77E7, 0x8429, 0x4F2F, 0x5265, 0x535A, 0x62CD, 0x67CF, -0x6CCA, 0x767D, 0x7B94, 0x7C95, 0x8236, 0x8584, 0x8FEB, 0x66DD, -0x6F20, 0x7206, 0x7E1B, 0x83AB, 0x99C1, 0x9EA6}, -{ /* category 40 */ -0x51FD, 0x7BB1, 0x7872, 0x7BB8, 0x8087, 0x7B48, 0x6AE8, 0x5E61, -0x808C, 0x7551, 0x7560, 0x516B, 0x9262, 0x6E8C, 0x767A, 0x9197, -0x9AEA, 0x4F10, 0x7F70, 0x629C, 0x7B4F, 0x95A5, 0x9CE9, 0x567A, -0x5859, 0x86E4, 0x96BC, 0x4F34, 0x5224, 0x534A, 0x53CD, 0x53DB, -0x5E06, 0x642C, 0x6591, 0x677F, 0x6C3E, 0x6C4E, 0x7248, 0x72AF, -0x73ED, 0x7554, 0x7E41, 0x822C, 0x85E9, 0x8CA9, 0x7BC4, 0x91C6, -0x7169, 0x9812, 0x98EF, 0x633D, 0x6669, 0x756A, 0x76E4, 0x78D0, -0x8543, 0x86EE, 0x532A, 0x5351, 0x5426, 0x5983, 0x5E87, 0x5F7C, -0x60B2, 0x6249, 0x6279, 0x62AB, 0x6590, 0x6BD4, 0x6CCC, 0x75B2, -0x76AE, 0x7891, 0x79D8, 0x7DCB, 0x7F77, 0x80A5, 0x88AB, 0x8AB9, -0x8CBB, 0x907F, 0x975E, 0x98DB, 0x6A0B, 0x7C38, 0x5099, 0x5C3E, -0x5FAE, 0x6787, 0x6BD8, 0x7435, 0x7709, 0x7F8E}, -{ /* category 41 */ -0x9F3B, 0x67CA, 0x7A17, 0x5339, 0x758B, 0x9AED, 0x5F66, 0x819D, -0x83F1, 0x8098, 0x5F3C, 0x5FC5, 0x7562, 0x7B46, 0x903C, 0x6867, -0x59EB, 0x5A9B, 0x7D10, 0x767E, 0x8B2C, 0x4FF5, 0x5F6A, 0x6A19, -0x6C37, 0x6F02, 0x74E2, 0x7968, 0x8868, 0x8A55, 0x8C79, 0x5EDF, -0x63CF, 0x75C5, 0x79D2, 0x82D7, 0x9328, 0x92F2, 0x849C, 0x86ED, -0x9C2D, 0x54C1, 0x5F6C, 0x658C, 0x6D5C, 0x7015, 0x8CA7, 0x8CD3, -0x983B, 0x654F, 0x74F6, 0x4E0D, 0x4ED8, 0x57E0, 0x592B, 0x5A66, -0x5BCC, 0x51A8, 0x5E03, 0x5E9C, 0x6016, 0x6276, 0x6577, 0x65A7, -0x666E, 0x6D6E, 0x7236, 0x7B26, 0x8150, 0x819A, 0x8299, 0x8B5C, -0x8CA0, 0x8CE6, 0x8D74, 0x961C, 0x9644, 0x4FAE, 0x64AB, 0x6B66, -0x821E, 0x8461, 0x856A, 0x90E8, 0x5C01, 0x6953, 0x98A8, 0x847A, -0x8557, 0x4F0F, 0x526F, 0x5FA9, 0x5E45, 0x670D}, -{ /* category 42 */ -0x798F, 0x8179, 0x8907, 0x8986, 0x6DF5, 0x5F17, 0x6255, 0x6CB8, -0x4ECF, 0x7269, 0x9B92, 0x5206, 0x543B, 0x5674, 0x58B3, 0x61A4, -0x626E, 0x711A, 0x596E, 0x7C89, 0x7CDE, 0x7D1B, 0x96F0, 0x6587, -0x805E, 0x4E19, 0x4F75, 0x5175, 0x5840, 0x5E63, 0x5E73, 0x5F0A, -0x67C4, 0x4E26, 0x853D, 0x9589, 0x965B, 0x7C73, 0x9801, 0x50FB, -0x58C1, 0x7656, 0x78A7, 0x5225, 0x77A5, 0x8511, 0x7B86, 0x504F, -0x5909, 0x7247, 0x7BC7, 0x7DE8, 0x8FBA, 0x8FD4, 0x904D, 0x4FBF, -0x52C9, 0x5A29, 0x5F01, 0x97AD, 0x4FDD, 0x8217, 0x92EA, 0x5703, -0x6355, 0x6B69, 0x752B, 0x88DC, 0x8F14, 0x7A42, 0x52DF, 0x5893, -0x6155, 0x620A, 0x66AE, 0x6BCD, 0x7C3F, 0x83E9, 0x5023, 0x4FF8, -0x5305, 0x5446, 0x5831, 0x5949, 0x5B9D, 0x5CF0, 0x5CEF, 0x5D29, -0x5E96, 0x62B1, 0x6367, 0x653E, 0x65B9, 0x670B}, -{ /* category 43 */ -0x6CD5, 0x6CE1, 0x70F9, 0x7832, 0x7E2B, 0x80DE, 0x82B3, 0x840C, -0x84EC, 0x8702, 0x8912, 0x8A2A, 0x8C4A, 0x90A6, 0x92D2, 0x98FD, -0x9CF3, 0x9D6C, 0x4E4F, 0x4EA1, 0x508D, 0x5256, 0x574A, 0x59A8, -0x5E3D, 0x5FD8, 0x5FD9, 0x623F, 0x66B4, 0x671B, 0x67D0, 0x68D2, -0x5192, 0x7D21, 0x80AA, 0x81A8, 0x8B00, 0x8C8C, 0x8CBF, 0x927E, -0x9632, 0x5420, 0x982C, 0x5317, 0x50D5, 0x535C, 0x58A8, 0x64B2, -0x6734, 0x7267, 0x7766, 0x7A46, 0x91E6, 0x52C3, 0x6CA1, 0x6B86, -0x5800, 0x5E4C, 0x5954, 0x672C, 0x7FFB, 0x51E1, 0x76C6, 0x6469, -0x78E8, 0x9B54, 0x9EBB, 0x57CB, 0x59B9, 0x6627, 0x679A, 0x6BCE, -0x54E9, 0x69D9, 0x5E55, 0x819C, 0x6795, 0x9BAA, 0x67FE, 0x9C52, -0x685D, 0x4EA6, 0x4FE3, 0x53C8, 0x62B9, 0x672B, 0x6CAB, 0x8FC4, -0x4FAD, 0x7E6D, 0x9EBF, 0x4E07, 0x6162, 0x6E80}, -{ /* category 44 */ -0x6F2B, 0x8513, 0x5473, 0x672A, 0x9B45, 0x5DF3, 0x7B95, 0x5CAC, -0x5BC6, 0x871C, 0x6E4A, 0x84D1, 0x7A14, 0x8108, 0x5999, 0x7C8D, -0x6C11, 0x7720, 0x52D9, 0x5922, 0x7121, 0x725F, 0x77DB, 0x9727, -0x9D61, 0x690B, 0x5A7F, 0x5A18, 0x51A5, 0x540D, 0x547D, 0x660E, -0x76DF, 0x8FF7, 0x9298, 0x9CF4, 0x59EA, 0x725D, 0x6EC5, 0x514D, -0x68C9, 0x7DBF, 0x7DEC, 0x9762, 0x9EBA, 0x6478, 0x6A21, 0x8302, -0x5984, 0x5B5F, 0x6BDB, 0x731B, 0x76F2, 0x7DB2, 0x8017, 0x8499, -0x5132, 0x6728, 0x9ED9, 0x76EE, 0x6762, 0x52FF, 0x9905, 0x5C24, -0x623B, 0x7C7E, 0x8CB0, 0x554F, 0x60B6, 0x7D0B, 0x9580, 0x5301, -0x4E5F, 0x51B6, 0x591C, 0x723A, 0x8036, 0x91CE, 0x5F25, 0x77E2, -0x5384, 0x5F79, 0x7D04, 0x85AC, 0x8A33, 0x8E8D, 0x9756, 0x67F3, -0x85AE, 0x9453, 0x6109, 0x6108, 0x6CB9, 0x7652}, -{ /* category 45 */ -0x8AED, 0x8F38, 0x552F, 0x4F51, 0x512A, 0x52C7, 0x53CB, 0x5BA5, -0x5E7D, 0x60A0, 0x6182, 0x63D6, 0x6709, 0x67DA, 0x6E67, 0x6D8C, -0x7336, 0x7337, 0x7531, 0x7950, 0x88D5, 0x8A98, 0x904A, 0x9091, -0x90F5, 0x96C4, 0x878D, 0x5915, 0x4E88, 0x4F59, 0x4E0E, 0x8A89, -0x8F3F, 0x9810, 0x50AD, 0x5E7C, 0x5996, 0x5BB9, 0x5EB8, 0x63DA, -0x63FA, 0x64C1, 0x66DC, 0x694A, 0x69D8, 0x6D0B, 0x6EB6, 0x7194, -0x7528, 0x7AAF, 0x7F8A, 0x8000, 0x8449, 0x84C9, 0x8981, 0x8B21, -0x8E0A, 0x9065, 0x967D, 0x990A, 0x617E, 0x6291, 0x6B32, 0x6C83, -0x6D74, 0x7FCC, 0x7FFC, 0x6DC0, 0x7F85, 0x87BA, 0x88F8, 0x6765, -0x83B1, 0x983C, 0x96F7, 0x6D1B, 0x7D61, 0x843D, 0x916A, 0x4E71, -0x5375, 0x5D50, 0x6B04, 0x6FEB, 0x85CD, 0x862D, 0x89A7, 0x5229, -0x540F, 0x5C65, 0x674E, 0x68A8, 0x7406, 0x7483}, -{ /* category 46 */ -0x75E2, 0x88CF, 0x88E1, 0x91CC, 0x96E2, 0x9678, 0x5F8B, 0x7387, -0x7ACB, 0x844E, 0x63A0, 0x7565, 0x5289, 0x6D41, 0x6E9C, 0x7409, -0x7559, 0x786B, 0x7C92, 0x9686, 0x7ADC, 0x9F8D, 0x4FB6, 0x616E, -0x65C5, 0x865C, 0x4E86, 0x4EAE, 0x50DA, 0x4E21, 0x51CC, 0x5BEE, -0x6599, 0x6881, 0x6DBC, 0x731F, 0x7642, 0x77AD, 0x7A1C, 0x7CE7, -0x826F, 0x8AD2, 0x907C, 0x91CF, 0x9675, 0x9818, 0x529B, 0x7DD1, -0x502B, 0x5398, 0x6797, 0x6DCB, 0x71D0, 0x7433, 0x81E8, 0x8F2A, -0x96A3, 0x9C57, 0x9E9F, 0x7460, 0x5841, 0x6D99, 0x7D2F, 0x985E, -0x4EE4, 0x4F36, 0x4F8B, 0x51B7, 0x52B1, 0x5DBA, 0x601C, 0x73B2, -0x793C, 0x82D3, 0x9234, 0x96B7, 0x96F6, 0x970A, 0x9E97, 0x9F62, -0x66A6, 0x6B74, 0x5217, 0x52A3, 0x70C8, 0x88C2, 0x5EC9, 0x604B, -0x6190, 0x6F23, 0x7149, 0x7C3E, 0x7DF4, 0x806F}, -{ /* category 47 */ -0x84EE, 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089, 0x8CC2, -0x8DEF, 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717, 0x697C, -0x6994, 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001, 0x807E, -0x874B, 0x90CE, 0x516D, 0x9E93, 0x7984, 0x808B, 0x9332, 0x8AD6, -0x502D, 0x548C, 0x8A71, 0x6B6A, 0x8CC4, 0x8107, 0x60D1, 0x67A0, -0x9DF2, 0x4E99, 0x4E98, 0x9C10, 0x8A6B, 0x85C1, 0x8568, 0x6900, -0x6E7E, 0x7897, 0x8155, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 48 */ -0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36, 0x4E3C, 0x4E3F, -0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B, 0x4E8A, 0x8212, -0x5F0D, 0x4E8E, 0x4E9E, 0x4E9F, 0x4EA0, 0x4EA2, 0x4EB0, 0x4EB3, -0x4EB6, 0x4ECE, 0x4ECD, 0x4EC4, 0x4EC6, 0x4EC2, 0x4ED7, 0x4EDE, -0x4EED, 0x4EDF, 0x4EF7, 0x4F09, 0x4F5A, 0x4F30, 0x4F5B, 0x4F5D, -0x4F57, 0x4F47, 0x4F76, 0x4F88, 0x4F8F, 0x4F98, 0x4F7B, 0x4F69, -0x4F70, 0x4F91, 0x4F6F, 0x4F86, 0x4F96, 0x5118, 0x4FD4, 0x4FDF, -0x4FCE, 0x4FD8, 0x4FDB, 0x4FD1, 0x4FDA, 0x4FD0, 0x4FE4, 0x4FE5, -0x501A, 0x5028, 0x5014, 0x502A, 0x5025, 0x5005, 0x4F1C, 0x4FF6, -0x5021, 0x5029, 0x502C, 0x4FFE, 0x4FEF, 0x5011, 0x5006, 0x5043, -0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505A, 0x5056, 0x506C, -0x5078, 0x5080, 0x509A, 0x5085, 0x50B4, 0x50B2}, -{ /* category 49 */ -0x50C9, 0x50CA, 0x50B3, 0x50C2, 0x50D6, 0x50DE, 0x50E5, 0x50ED, -0x50E3, 0x50EE, 0x50F9, 0x50F5, 0x5109, 0x5101, 0x5102, 0x5116, -0x5115, 0x5114, 0x511A, 0x5121, 0x513A, 0x5137, 0x513C, 0x513B, -0x513F, 0x5140, 0x5152, 0x514C, 0x5154, 0x5162, 0x7AF8, 0x5169, -0x516A, 0x516E, 0x5180, 0x5182, 0x56D8, 0x518C, 0x5189, 0x518F, -0x5191, 0x5193, 0x5195, 0x5196, 0x51A4, 0x51A6, 0x51A2, 0x51A9, -0x51AA, 0x51AB, 0x51B3, 0x51B1, 0x51B2, 0x51B0, 0x51B5, 0x51BD, -0x51C5, 0x51C9, 0x51DB, 0x51E0, 0x8655, 0x51E9, 0x51ED, 0x51F0, -0x51F5, 0x51FE, 0x5204, 0x520B, 0x5214, 0x520E, 0x5227, 0x522A, -0x522E, 0x5233, 0x5239, 0x524F, 0x5244, 0x524B, 0x524C, 0x525E, -0x5254, 0x526A, 0x5274, 0x5269, 0x5273, 0x527F, 0x527D, 0x528D, -0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8FA8}, -{ /* category 50 */ -0x8FA7, 0x52AC, 0x52AD, 0x52BC, 0x52B5, 0x52C1, 0x52CD, 0x52D7, -0x52DE, 0x52E3, 0x52E6, 0x98ED, 0x52E0, 0x52F3, 0x52F5, 0x52F8, -0x52F9, 0x5306, 0x5308, 0x7538, 0x530D, 0x5310, 0x530F, 0x5315, -0x531A, 0x5323, 0x532F, 0x5331, 0x5333, 0x5338, 0x5340, 0x5346, -0x5345, 0x4E17, 0x5349, 0x534D, 0x51D6, 0x535E, 0x5369, 0x536E, -0x5918, 0x537B, 0x5377, 0x5382, 0x5396, 0x53A0, 0x53A6, 0x53A5, -0x53AE, 0x53B0, 0x53B6, 0x53C3, 0x7C12, 0x96D9, 0x53DF, 0x66FC, -0x71EE, 0x53EE, 0x53E8, 0x53ED, 0x53FA, 0x5401, 0x543D, 0x5440, -0x542C, 0x542D, 0x543C, 0x542E, 0x5436, 0x5429, 0x541D, 0x544E, -0x548F, 0x5475, 0x548E, 0x545F, 0x5471, 0x5477, 0x5470, 0x5492, -0x547B, 0x5480, 0x5476, 0x5484, 0x5490, 0x5486, 0x54C7, 0x54A2, -0x54B8, 0x54A5, 0x54AC, 0x54C4, 0x54C8, 0x54A8}, -{ /* category 51 */ -0x54AB, 0x54C2, 0x54A4, 0x54BE, 0x54BC, 0x54D8, 0x54E5, 0x54E6, -0x550F, 0x5514, 0x54FD, 0x54EE, 0x54ED, 0x54FA, 0x54E2, 0x5539, -0x5540, 0x5563, 0x554C, 0x552E, 0x555C, 0x5545, 0x5556, 0x5557, -0x5538, 0x5533, 0x555D, 0x5599, 0x5580, 0x54AF, 0x558A, 0x559F, -0x557B, 0x557E, 0x5598, 0x559E, 0x55AE, 0x557C, 0x5583, 0x55A9, -0x5587, 0x55A8, 0x55DA, 0x55C5, 0x55DF, 0x55C4, 0x55DC, 0x55E4, -0x55D4, 0x5614, 0x55F7, 0x5616, 0x55FE, 0x55FD, 0x561B, 0x55F9, -0x564E, 0x5650, 0x71DF, 0x5634, 0x5636, 0x5632, 0x5638, 0x566B, -0x5664, 0x562F, 0x566C, 0x566A, 0x5686, 0x5680, 0x568A, 0x56A0, -0x5694, 0x568F, 0x56A5, 0x56AE, 0x56B6, 0x56B4, 0x56C2, 0x56BC, -0x56C1, 0x56C3, 0x56C0, 0x56C8, 0x56CE, 0x56D1, 0x56D3, 0x56D7, -0x56EE, 0x56F9, 0x5700, 0x56FF, 0x5704, 0x5709}, -{ /* category 52 */ -0x5708, 0x570B, 0x570D, 0x5713, 0x5718, 0x5716, 0x55C7, 0x571C, -0x5726, 0x5737, 0x5738, 0x574E, 0x573B, 0x5740, 0x574F, 0x5769, -0x57C0, 0x5788, 0x5761, 0x577F, 0x5789, 0x5793, 0x57A0, 0x57B3, -0x57A4, 0x57AA, 0x57B0, 0x57C3, 0x57C6, 0x57D4, 0x57D2, 0x57D3, -0x580A, 0x57D6, 0x57E3, 0x580B, 0x5819, 0x581D, 0x5872, 0x5821, -0x5862, 0x584B, 0x5870, 0x6BC0, 0x5852, 0x583D, 0x5879, 0x5885, -0x58B9, 0x589F, 0x58AB, 0x58BA, 0x58DE, 0x58BB, 0x58B8, 0x58AE, -0x58C5, 0x58D3, 0x58D1, 0x58D7, 0x58D9, 0x58D8, 0x58E5, 0x58DC, -0x58E4, 0x58DF, 0x58EF, 0x58FA, 0x58F9, 0x58FB, 0x58FC, 0x58FD, -0x5902, 0x590A, 0x5910, 0x591B, 0x68A6, 0x5925, 0x592C, 0x592D, -0x5932, 0x5938, 0x593E, 0x7AD2, 0x5955, 0x5950, 0x594E, 0x595A, -0x5958, 0x5962, 0x5960, 0x5967, 0x596C, 0x5969}, -{ /* category 53 */ -0x5978, 0x5981, 0x599D, 0x4F5E, 0x4FAB, 0x59A3, 0x59B2, 0x59C6, -0x59E8, 0x59DC, 0x598D, 0x59D9, 0x59DA, 0x5A25, 0x5A1F, 0x5A11, -0x5A1C, 0x5A09, 0x5A1A, 0x5A40, 0x5A6C, 0x5A49, 0x5A35, 0x5A36, -0x5A62, 0x5A6A, 0x5A9A, 0x5ABC, 0x5ABE, 0x5ACB, 0x5AC2, 0x5ABD, -0x5AE3, 0x5AD7, 0x5AE6, 0x5AE9, 0x5AD6, 0x5AFA, 0x5AFB, 0x5B0C, -0x5B0B, 0x5B16, 0x5B32, 0x5AD0, 0x5B2A, 0x5B36, 0x5B3E, 0x5B43, -0x5B45, 0x5B40, 0x5B51, 0x5B55, 0x5B5A, 0x5B5B, 0x5B65, 0x5B69, -0x5B70, 0x5B73, 0x5B75, 0x5B78, 0x6588, 0x5B7A, 0x5B80, 0x5B83, -0x5BA6, 0x5BB8, 0x5BC3, 0x5BC7, 0x5BC9, 0x5BD4, 0x5BD0, 0x5BE4, -0x5BE6, 0x5BE2, 0x5BDE, 0x5BE5, 0x5BEB, 0x5BF0, 0x5BF6, 0x5BF3, -0x5C05, 0x5C07, 0x5C08, 0x5C0D, 0x5C13, 0x5C20, 0x5C22, 0x5C28, -0x5C38, 0x5C39, 0x5C41, 0x5C46, 0x5C4E, 0x5C53}, -{ /* category 54 */ -0x5C50, 0x5C4F, 0x5B71, 0x5C6C, 0x5C6E, 0x4E62, 0x5C76, 0x5C79, -0x5C8C, 0x5C91, 0x5C94, 0x599B, 0x5CAB, 0x5CBB, 0x5CB6, 0x5CBC, -0x5CB7, 0x5CC5, 0x5CBE, 0x5CC7, 0x5CD9, 0x5CE9, 0x5CFD, 0x5CFA, -0x5CED, 0x5D8C, 0x5CEA, 0x5D0B, 0x5D15, 0x5D17, 0x5D5C, 0x5D1F, -0x5D1B, 0x5D11, 0x5D14, 0x5D22, 0x5D1A, 0x5D19, 0x5D18, 0x5D4C, -0x5D52, 0x5D4E, 0x5D4B, 0x5D6C, 0x5D73, 0x5D76, 0x5D87, 0x5D84, -0x5D82, 0x5DA2, 0x5D9D, 0x5DAC, 0x5DAE, 0x5DBD, 0x5D90, 0x5DB7, -0x5DBC, 0x5DC9, 0x5DCD, 0x5DD3, 0x5DD2, 0x5DD6, 0x5DDB, 0x5DEB, -0x5DF2, 0x5DF5, 0x5E0B, 0x5E1A, 0x5E19, 0x5E11, 0x5E1B, 0x5E36, -0x5E37, 0x5E44, 0x5E43, 0x5E40, 0x5E4E, 0x5E57, 0x5E54, 0x5E5F, -0x5E62, 0x5E64, 0x5E47, 0x5E75, 0x5E76, 0x5E7A, 0x9EBC, 0x5E7F, -0x5EA0, 0x5EC1, 0x5EC2, 0x5EC8, 0x5ED0, 0x5ECF}, -{ /* category 55 */ -0x5ED6, 0x5EE3, 0x5EDD, 0x5EDA, 0x5EDB, 0x5EE2, 0x5EE1, 0x5EE8, -0x5EE9, 0x5EEC, 0x5EF1, 0x5EF3, 0x5EF0, 0x5EF4, 0x5EF8, 0x5EFE, -0x5F03, 0x5F09, 0x5F5D, 0x5F5C, 0x5F0B, 0x5F11, 0x5F16, 0x5F29, -0x5F2D, 0x5F38, 0x5F41, 0x5F48, 0x5F4C, 0x5F4E, 0x5F2F, 0x5F51, -0x5F56, 0x5F57, 0x5F59, 0x5F61, 0x5F6D, 0x5F73, 0x5F77, 0x5F83, -0x5F82, 0x5F7F, 0x5F8A, 0x5F88, 0x5F91, 0x5F87, 0x5F9E, 0x5F99, -0x5F98, 0x5FA0, 0x5FA8, 0x5FAD, 0x5FBC, 0x5FD6, 0x5FFB, 0x5FE4, -0x5FF8, 0x5FF1, 0x5FDD, 0x60B3, 0x5FFF, 0x6021, 0x6060, 0x6019, -0x6010, 0x6029, 0x600E, 0x6031, 0x601B, 0x6015, 0x602B, 0x6026, -0x600F, 0x603A, 0x605A, 0x6041, 0x606A, 0x6077, 0x605F, 0x604A, -0x6046, 0x604D, 0x6063, 0x6043, 0x6064, 0x6042, 0x606C, 0x606B, -0x6059, 0x6081, 0x608D, 0x60E7, 0x6083, 0x609A}, -{ /* category 56 */ -0x6084, 0x609B, 0x6096, 0x6097, 0x6092, 0x60A7, 0x608B, 0x60E1, -0x60B8, 0x60E0, 0x60D3, 0x60B4, 0x5FF0, 0x60BD, 0x60C6, 0x60B5, -0x60D8, 0x614D, 0x6115, 0x6106, 0x60F6, 0x60F7, 0x6100, 0x60F4, -0x60FA, 0x6103, 0x6121, 0x60FB, 0x60F1, 0x610D, 0x610E, 0x6147, -0x613E, 0x6128, 0x6127, 0x614A, 0x613F, 0x613C, 0x612C, 0x6134, -0x613D, 0x6142, 0x6144, 0x6173, 0x6177, 0x6158, 0x6159, 0x615A, -0x616B, 0x6174, 0x616F, 0x6165, 0x6171, 0x615F, 0x615D, 0x6153, -0x6175, 0x6199, 0x6196, 0x6187, 0x61AC, 0x6194, 0x619A, 0x618A, -0x6191, 0x61AB, 0x61AE, 0x61CC, 0x61CA, 0x61C9, 0x61F7, 0x61C8, -0x61C3, 0x61C6, 0x61BA, 0x61CB, 0x7F79, 0x61CD, 0x61E6, 0x61E3, -0x61F6, 0x61FA, 0x61F4, 0x61FF, 0x61FD, 0x61FC, 0x61FE, 0x6200, -0x6208, 0x6209, 0x620D, 0x620C, 0x6214, 0x621B}, -{ /* category 57 */ -0x621E, 0x6221, 0x622A, 0x622E, 0x6230, 0x6232, 0x6233, 0x6241, -0x624E, 0x625E, 0x6263, 0x625B, 0x6260, 0x6268, 0x627C, 0x6282, -0x6289, 0x627E, 0x6292, 0x6293, 0x6296, 0x62D4, 0x6283, 0x6294, -0x62D7, 0x62D1, 0x62BB, 0x62CF, 0x62FF, 0x62C6, 0x64D4, 0x62C8, -0x62DC, 0x62CC, 0x62CA, 0x62C2, 0x62C7, 0x629B, 0x62C9, 0x630C, -0x62EE, 0x62F1, 0x6327, 0x6302, 0x6308, 0x62EF, 0x62F5, 0x6350, -0x633E, 0x634D, 0x641C, 0x634F, 0x6396, 0x638E, 0x6380, 0x63AB, -0x6376, 0x63A3, 0x638F, 0x6389, 0x639F, 0x63B5, 0x636B, 0x6369, -0x63BE, 0x63E9, 0x63C0, 0x63C6, 0x63E3, 0x63C9, 0x63D2, 0x63F6, -0x63C4, 0x6416, 0x6434, 0x6406, 0x6413, 0x6426, 0x6436, 0x651D, -0x6417, 0x6428, 0x640F, 0x6467, 0x646F, 0x6476, 0x644E, 0x652A, -0x6495, 0x6493, 0x64A5, 0x64A9, 0x6488, 0x64BC}, -{ /* category 58 */ -0x64DA, 0x64D2, 0x64C5, 0x64C7, 0x64BB, 0x64D8, 0x64C2, 0x64F1, -0x64E7, 0x8209, 0x64E0, 0x64E1, 0x62AC, 0x64E3, 0x64EF, 0x652C, -0x64F6, 0x64F4, 0x64F2, 0x64FA, 0x6500, 0x64FD, 0x6518, 0x651C, -0x6505, 0x6524, 0x6523, 0x652B, 0x6534, 0x6535, 0x6537, 0x6536, -0x6538, 0x754B, 0x6548, 0x6556, 0x6555, 0x654D, 0x6558, 0x655E, -0x655D, 0x6572, 0x6578, 0x6582, 0x6583, 0x8B8A, 0x659B, 0x659F, -0x65AB, 0x65B7, 0x65C3, 0x65C6, 0x65C1, 0x65C4, 0x65CC, 0x65D2, -0x65DB, 0x65D9, 0x65E0, 0x65E1, 0x65F1, 0x6772, 0x660A, 0x6603, -0x65FB, 0x6773, 0x6635, 0x6636, 0x6634, 0x661C, 0x664F, 0x6644, -0x6649, 0x6641, 0x665E, 0x665D, 0x6664, 0x6667, 0x6668, 0x665F, -0x6662, 0x6670, 0x6683, 0x6688, 0x668E, 0x6689, 0x6684, 0x6698, -0x669D, 0x66C1, 0x66B9, 0x66C9, 0x66BE, 0x66BC}, -{ /* category 59 */ -0x66C4, 0x66B8, 0x66D6, 0x66DA, 0x66E0, 0x663F, 0x66E6, 0x66E9, -0x66F0, 0x66F5, 0x66F7, 0x670F, 0x6716, 0x671E, 0x6726, 0x6727, -0x9738, 0x672E, 0x673F, 0x6736, 0x6741, 0x6738, 0x6737, 0x6746, -0x675E, 0x6760, 0x6759, 0x6763, 0x6764, 0x6789, 0x6770, 0x67A9, -0x677C, 0x676A, 0x678C, 0x678B, 0x67A6, 0x67A1, 0x6785, 0x67B7, -0x67EF, 0x67B4, 0x67EC, 0x67B3, 0x67E9, 0x67B8, 0x67E4, 0x67DE, -0x67DD, 0x67E2, 0x67EE, 0x67B9, 0x67CE, 0x67C6, 0x67E7, 0x6A9C, -0x681E, 0x6846, 0x6829, 0x6840, 0x684D, 0x6832, 0x684E, 0x68B3, -0x682B, 0x6859, 0x6863, 0x6877, 0x687F, 0x689F, 0x688F, 0x68AD, -0x6894, 0x689D, 0x689B, 0x6883, 0x6AAE, 0x68B9, 0x6874, 0x68B5, -0x68A0, 0x68BA, 0x690F, 0x688D, 0x687E, 0x6901, 0x68CA, 0x6908, -0x68D8, 0x6922, 0x6926, 0x68E1, 0x690C, 0x68CD}, -{ /* category 60 */ -0x68D4, 0x68E7, 0x68D5, 0x6936, 0x6912, 0x6904, 0x68D7, 0x68E3, -0x6925, 0x68F9, 0x68E0, 0x68EF, 0x6928, 0x692A, 0x691A, 0x6923, -0x6921, 0x68C6, 0x6979, 0x6977, 0x695C, 0x6978, 0x696B, 0x6954, -0x697E, 0x696E, 0x6939, 0x6974, 0x693D, 0x6959, 0x6930, 0x6961, -0x695E, 0x695D, 0x6981, 0x696A, 0x69B2, 0x69AE, 0x69D0, 0x69BF, -0x69C1, 0x69D3, 0x69BE, 0x69CE, 0x5BE8, 0x69CA, 0x69DD, 0x69BB, -0x69C3, 0x69A7, 0x6A2E, 0x6991, 0x69A0, 0x699C, 0x6995, 0x69B4, -0x69DE, 0x69E8, 0x6A02, 0x6A1B, 0x69FF, 0x6B0A, 0x69F9, 0x69F2, -0x69E7, 0x6A05, 0x69B1, 0x6A1E, 0x69ED, 0x6A14, 0x69EB, 0x6A0A, -0x6A12, 0x6AC1, 0x6A23, 0x6A13, 0x6A44, 0x6A0C, 0x6A72, 0x6A36, -0x6A78, 0x6A47, 0x6A62, 0x6A59, 0x6A66, 0x6A48, 0x6A38, 0x6A22, -0x6A90, 0x6A8D, 0x6AA0, 0x6A84, 0x6AA2, 0x6AA3}, -{ /* category 61 */ -0x6A97, 0x8617, 0x6ABB, 0x6AC3, 0x6AC2, 0x6AB8, 0x6AB3, 0x6AAC, -0x6ADE, 0x6AD1, 0x6ADF, 0x6AAA, 0x6ADA, 0x6AEA, 0x6AFB, 0x6B05, -0x8616, 0x6AFA, 0x6B12, 0x6B16, 0x9B31, 0x6B1F, 0x6B38, 0x6B37, -0x76DC, 0x6B39, 0x98EE, 0x6B47, 0x6B43, 0x6B49, 0x6B50, 0x6B59, -0x6B54, 0x6B5B, 0x6B5F, 0x6B61, 0x6B78, 0x6B79, 0x6B7F, 0x6B80, -0x6B84, 0x6B83, 0x6B8D, 0x6B98, 0x6B95, 0x6B9E, 0x6BA4, 0x6BAA, -0x6BAB, 0x6BAF, 0x6BB2, 0x6BB1, 0x6BB3, 0x6BB7, 0x6BBC, 0x6BC6, -0x6BCB, 0x6BD3, 0x6BDF, 0x6BEC, 0x6BEB, 0x6BF3, 0x6BEF, 0x9EBE, -0x6C08, 0x6C13, 0x6C14, 0x6C1B, 0x6C24, 0x6C23, 0x6C5E, 0x6C55, -0x6C62, 0x6C6A, 0x6C82, 0x6C8D, 0x6C9A, 0x6C81, 0x6C9B, 0x6C7E, -0x6C68, 0x6C73, 0x6C92, 0x6C90, 0x6CC4, 0x6CF1, 0x6CD3, 0x6CBD, -0x6CD7, 0x6CC5, 0x6CDD, 0x6CAE, 0x6CB1, 0x6CBE}, -{ /* category 62 */ -0x6CBA, 0x6CDB, 0x6CEF, 0x6CD9, 0x6CEA, 0x6D1F, 0x884D, 0x6D36, -0x6D2B, 0x6D3D, 0x6D38, 0x6D19, 0x6D35, 0x6D33, 0x6D12, 0x6D0C, -0x6D63, 0x6D93, 0x6D64, 0x6D5A, 0x6D79, 0x6D59, 0x6D8E, 0x6D95, -0x6FE4, 0x6D85, 0x6DF9, 0x6E15, 0x6E0A, 0x6DB5, 0x6DC7, 0x6DE6, -0x6DB8, 0x6DC6, 0x6DEC, 0x6DDE, 0x6DCC, 0x6DE8, 0x6DD2, 0x6DC5, -0x6DFA, 0x6DD9, 0x6DE4, 0x6DD5, 0x6DEA, 0x6DEE, 0x6E2D, 0x6E6E, -0x6E2E, 0x6E19, 0x6E72, 0x6E5F, 0x6E3E, 0x6E23, 0x6E6B, 0x6E2B, -0x6E76, 0x6E4D, 0x6E1F, 0x6E43, 0x6E3A, 0x6E4E, 0x6E24, 0x6EFF, -0x6E1D, 0x6E38, 0x6E82, 0x6EAA, 0x6E98, 0x6EC9, 0x6EB7, 0x6ED3, -0x6EBD, 0x6EAF, 0x6EC4, 0x6EB2, 0x6ED4, 0x6ED5, 0x6E8F, 0x6EA5, -0x6EC2, 0x6E9F, 0x6F41, 0x6F11, 0x704C, 0x6EEC, 0x6EF8, 0x6EFE, -0x6F3F, 0x6EF2, 0x6F31, 0x6EEF, 0x6F32, 0x6ECC}, -{ /* category 63 */ -0x6F3E, 0x6F13, 0x6EF7, 0x6F86, 0x6F7A, 0x6F78, 0x6F81, 0x6F80, -0x6F6F, 0x6F5B, 0x6FF3, 0x6F6D, 0x6F82, 0x6F7C, 0x6F58, 0x6F8E, -0x6F91, 0x6FC2, 0x6F66, 0x6FB3, 0x6FA3, 0x6FA1, 0x6FA4, 0x6FB9, -0x6FC6, 0x6FAA, 0x6FDF, 0x6FD5, 0x6FEC, 0x6FD4, 0x6FD8, 0x6FF1, -0x6FEE, 0x6FDB, 0x7009, 0x700B, 0x6FFA, 0x7011, 0x7001, 0x700F, -0x6FFE, 0x701B, 0x701A, 0x6F74, 0x701D, 0x7018, 0x701F, 0x7030, -0x703E, 0x7032, 0x7051, 0x7063, 0x7099, 0x7092, 0x70AF, 0x70F1, -0x70AC, 0x70B8, 0x70B3, 0x70AE, 0x70DF, 0x70CB, 0x70DD, 0x70D9, -0x7109, 0x70FD, 0x711C, 0x7119, 0x7165, 0x7155, 0x7188, 0x7166, -0x7162, 0x714C, 0x7156, 0x716C, 0x718F, 0x71FB, 0x7184, 0x7195, -0x71A8, 0x71AC, 0x71D7, 0x71B9, 0x71BE, 0x71D2, 0x71C9, 0x71D4, -0x71CE, 0x71E0, 0x71EC, 0x71E7, 0x71F5, 0x71FC}, -{ /* category 64 */ -0x71F9, 0x71FF, 0x720D, 0x7210, 0x721B, 0x7228, 0x722D, 0x722C, -0x7230, 0x7232, 0x723B, 0x723C, 0x723F, 0x7240, 0x7246, 0x724B, -0x7258, 0x7274, 0x727E, 0x7282, 0x7281, 0x7287, 0x7292, 0x7296, -0x72A2, 0x72A7, 0x72B9, 0x72B2, 0x72C3, 0x72C6, 0x72C4, 0x72CE, -0x72D2, 0x72E2, 0x72E0, 0x72E1, 0x72F9, 0x72F7, 0x500F, 0x7317, -0x730A, 0x731C, 0x7316, 0x731D, 0x7334, 0x732F, 0x7329, 0x7325, -0x733E, 0x734E, 0x734F, 0x9ED8, 0x7357, 0x736A, 0x7368, 0x7370, -0x7378, 0x7375, 0x737B, 0x737A, 0x73C8, 0x73B3, 0x73CE, 0x73BB, -0x73C0, 0x73E5, 0x73EE, 0x73DE, 0x74A2, 0x7405, 0x746F, 0x7425, -0x73F8, 0x7432, 0x743A, 0x7455, 0x743F, 0x745F, 0x7459, 0x7441, -0x745C, 0x7469, 0x7470, 0x7463, 0x746A, 0x7476, 0x747E, 0x748B, -0x749E, 0x74A7, 0x74CA, 0x74CF, 0x74D4, 0x73F1}, -{ /* category 65 */ -0x74E0, 0x74E3, 0x74E7, 0x74E9, 0x74EE, 0x74F2, 0x74F0, 0x74F1, -0x74F8, 0x74F7, 0x7504, 0x7503, 0x7505, 0x750C, 0x750E, 0x750D, -0x7515, 0x7513, 0x751E, 0x7526, 0x752C, 0x753C, 0x7544, 0x754D, -0x754A, 0x7549, 0x755B, 0x7546, 0x755A, 0x7569, 0x7564, 0x7567, -0x756B, 0x756D, 0x7578, 0x7576, 0x7586, 0x7587, 0x7574, 0x758A, -0x7589, 0x7582, 0x7594, 0x759A, 0x759D, 0x75A5, 0x75A3, 0x75C2, -0x75B3, 0x75C3, 0x75B5, 0x75BD, 0x75B8, 0x75BC, 0x75B1, 0x75CD, -0x75CA, 0x75D2, 0x75D9, 0x75E3, 0x75DE, 0x75FE, 0x75FF, 0x75FC, -0x7601, 0x75F0, 0x75FA, 0x75F2, 0x75F3, 0x760B, 0x760D, 0x7609, -0x761F, 0x7627, 0x7620, 0x7621, 0x7622, 0x7624, 0x7634, 0x7630, -0x763B, 0x7647, 0x7648, 0x7646, 0x765C, 0x7658, 0x7661, 0x7662, -0x7668, 0x7669, 0x766A, 0x7667, 0x766C, 0x7670}, -{ /* category 66 */ -0x7672, 0x7676, 0x7678, 0x767C, 0x7680, 0x7683, 0x7688, 0x768B, -0x768E, 0x7696, 0x7693, 0x7699, 0x769A, 0x76B0, 0x76B4, 0x76B8, -0x76B9, 0x76BA, 0x76C2, 0x76CD, 0x76D6, 0x76D2, 0x76DE, 0x76E1, -0x76E5, 0x76E7, 0x76EA, 0x862F, 0x76FB, 0x7708, 0x7707, 0x7704, -0x7729, 0x7724, 0x771E, 0x7725, 0x7726, 0x771B, 0x7737, 0x7738, -0x7747, 0x775A, 0x7768, 0x776B, 0x775B, 0x7765, 0x777F, 0x777E, -0x7779, 0x778E, 0x778B, 0x7791, 0x77A0, 0x779E, 0x77B0, 0x77B6, -0x77B9, 0x77BF, 0x77BC, 0x77BD, 0x77BB, 0x77C7, 0x77CD, 0x77D7, -0x77DA, 0x77DC, 0x77E3, 0x77EE, 0x77FC, 0x780C, 0x7812, 0x7926, -0x7820, 0x792A, 0x7845, 0x788E, 0x7874, 0x7886, 0x787C, 0x789A, -0x788C, 0x78A3, 0x78B5, 0x78AA, 0x78AF, 0x78D1, 0x78C6, 0x78CB, -0x78D4, 0x78BE, 0x78BC, 0x78C5, 0x78CA, 0x78EC}, -{ /* category 67 */ -0x78E7, 0x78DA, 0x78FD, 0x78F4, 0x7907, 0x7912, 0x7911, 0x7919, -0x792C, 0x792B, 0x7940, 0x7960, 0x7957, 0x795F, 0x795A, 0x7955, -0x7953, 0x797A, 0x797F, 0x798A, 0x799D, 0x79A7, 0x9F4B, 0x79AA, -0x79AE, 0x79B3, 0x79B9, 0x79BA, 0x79C9, 0x79D5, 0x79E7, 0x79EC, -0x79E1, 0x79E3, 0x7A08, 0x7A0D, 0x7A18, 0x7A19, 0x7A20, 0x7A1F, -0x7980, 0x7A31, 0x7A3B, 0x7A3E, 0x7A37, 0x7A43, 0x7A57, 0x7A49, -0x7A61, 0x7A62, 0x7A69, 0x9F9D, 0x7A70, 0x7A79, 0x7A7D, 0x7A88, -0x7A97, 0x7A95, 0x7A98, 0x7A96, 0x7AA9, 0x7AC8, 0x7AB0, 0x7AB6, -0x7AC5, 0x7AC4, 0x7ABF, 0x9083, 0x7AC7, 0x7ACA, 0x7ACD, 0x7ACF, -0x7AD5, 0x7AD3, 0x7AD9, 0x7ADA, 0x7ADD, 0x7AE1, 0x7AE2, 0x7AE6, -0x7AED, 0x7AF0, 0x7B02, 0x7B0F, 0x7B0A, 0x7B06, 0x7B33, 0x7B18, -0x7B19, 0x7B1E, 0x7B35, 0x7B28, 0x7B36, 0x7B50}, -{ /* category 68 */ -0x7B7A, 0x7B04, 0x7B4D, 0x7B0B, 0x7B4C, 0x7B45, 0x7B75, 0x7B65, -0x7B74, 0x7B67, 0x7B70, 0x7B71, 0x7B6C, 0x7B6E, 0x7B9D, 0x7B98, -0x7B9F, 0x7B8D, 0x7B9C, 0x7B9A, 0x7B8B, 0x7B92, 0x7B8F, 0x7B5D, -0x7B99, 0x7BCB, 0x7BC1, 0x7BCC, 0x7BCF, 0x7BB4, 0x7BC6, 0x7BDD, -0x7BE9, 0x7C11, 0x7C14, 0x7BE6, 0x7BE5, 0x7C60, 0x7C00, 0x7C07, -0x7C13, 0x7BF3, 0x7BF7, 0x7C17, 0x7C0D, 0x7BF6, 0x7C23, 0x7C27, -0x7C2A, 0x7C1F, 0x7C37, 0x7C2B, 0x7C3D, 0x7C4C, 0x7C43, 0x7C54, -0x7C4F, 0x7C40, 0x7C50, 0x7C58, 0x7C5F, 0x7C64, 0x7C56, 0x7C65, -0x7C6C, 0x7C75, 0x7C83, 0x7C90, 0x7CA4, 0x7CAD, 0x7CA2, 0x7CAB, -0x7CA1, 0x7CA8, 0x7CB3, 0x7CB2, 0x7CB1, 0x7CAE, 0x7CB9, 0x7CBD, -0x7CC0, 0x7CC5, 0x7CC2, 0x7CD8, 0x7CD2, 0x7CDC, 0x7CE2, 0x9B3B, -0x7CEF, 0x7CF2, 0x7CF4, 0x7CF6, 0x7CFA, 0x7D06}, -{ /* category 69 */ -0x7D02, 0x7D1C, 0x7D15, 0x7D0A, 0x7D45, 0x7D4B, 0x7D2E, 0x7D32, -0x7D3F, 0x7D35, 0x7D46, 0x7D73, 0x7D56, 0x7D4E, 0x7D72, 0x7D68, -0x7D6E, 0x7D4F, 0x7D63, 0x7D93, 0x7D89, 0x7D5B, 0x7D8F, 0x7D7D, -0x7D9B, 0x7DBA, 0x7DAE, 0x7DA3, 0x7DB5, 0x7DC7, 0x7DBD, 0x7DAB, -0x7E3D, 0x7DA2, 0x7DAF, 0x7DDC, 0x7DB8, 0x7D9F, 0x7DB0, 0x7DD8, -0x7DDD, 0x7DE4, 0x7DDE, 0x7DFB, 0x7DF2, 0x7DE1, 0x7E05, 0x7E0A, -0x7E23, 0x7E21, 0x7E12, 0x7E31, 0x7E1F, 0x7E09, 0x7E0B, 0x7E22, -0x7E46, 0x7E66, 0x7E3B, 0x7E35, 0x7E39, 0x7E43, 0x7E37, 0x7E32, -0x7E3A, 0x7E67, 0x7E5D, 0x7E56, 0x7E5E, 0x7E59, 0x7E5A, 0x7E79, -0x7E6A, 0x7E69, 0x7E7C, 0x7E7B, 0x7E83, 0x7DD5, 0x7E7D, 0x8FAE, -0x7E7F, 0x7E88, 0x7E89, 0x7E8C, 0x7E92, 0x7E90, 0x7E93, 0x7E94, -0x7E96, 0x7E8E, 0x7E9B, 0x7E9C, 0x7F38, 0x7F3A}, -{ /* category 70 */ -0x7F45, 0x7F4C, 0x7F4D, 0x7F4E, 0x7F50, 0x7F51, 0x7F55, 0x7F54, -0x7F58, 0x7F5F, 0x7F60, 0x7F68, 0x7F69, 0x7F67, 0x7F78, 0x7F82, -0x7F86, 0x7F83, 0x7F88, 0x7F87, 0x7F8C, 0x7F94, 0x7F9E, 0x7F9D, -0x7F9A, 0x7FA3, 0x7FAF, 0x7FB2, 0x7FB9, 0x7FAE, 0x7FB6, 0x7FB8, -0x8B71, 0x7FC5, 0x7FC6, 0x7FCA, 0x7FD5, 0x7FD4, 0x7FE1, 0x7FE6, -0x7FE9, 0x7FF3, 0x7FF9, 0x98DC, 0x8006, 0x8004, 0x800B, 0x8012, -0x8018, 0x8019, 0x801C, 0x8021, 0x8028, 0x803F, 0x803B, 0x804A, -0x8046, 0x8052, 0x8058, 0x805A, 0x805F, 0x8062, 0x8068, 0x8073, -0x8072, 0x8070, 0x8076, 0x8079, 0x807D, 0x807F, 0x8084, 0x8086, -0x8085, 0x809B, 0x8093, 0x809A, 0x80AD, 0x5190, 0x80AC, 0x80DB, -0x80E5, 0x80D9, 0x80DD, 0x80C4, 0x80DA, 0x80D6, 0x8109, 0x80EF, -0x80F1, 0x811B, 0x8129, 0x8123, 0x812F, 0x814B}, -{ /* category 71 */ -0x968B, 0x8146, 0x813E, 0x8153, 0x8151, 0x80FC, 0x8171, 0x816E, -0x8165, 0x8166, 0x8174, 0x8183, 0x8188, 0x818A, 0x8180, 0x8182, -0x81A0, 0x8195, 0x81A4, 0x81A3, 0x815F, 0x8193, 0x81A9, 0x81B0, -0x81B5, 0x81BE, 0x81B8, 0x81BD, 0x81C0, 0x81C2, 0x81BA, 0x81C9, -0x81CD, 0x81D1, 0x81D9, 0x81D8, 0x81C8, 0x81DA, 0x81DF, 0x81E0, -0x81E7, 0x81FA, 0x81FB, 0x81FE, 0x8201, 0x8202, 0x8205, 0x8207, -0x820A, 0x820D, 0x8210, 0x8216, 0x8229, 0x822B, 0x8238, 0x8233, -0x8240, 0x8259, 0x8258, 0x825D, 0x825A, 0x825F, 0x8264, 0x8262, -0x8268, 0x826A, 0x826B, 0x822E, 0x8271, 0x8277, 0x8278, 0x827E, -0x828D, 0x8292, 0x82AB, 0x829F, 0x82BB, 0x82AC, 0x82E1, 0x82E3, -0x82DF, 0x82D2, 0x82F4, 0x82F3, 0x82FA, 0x8393, 0x8303, 0x82FB, -0x82F9, 0x82DE, 0x8306, 0x82DC, 0x8309, 0x82D9}, -{ /* category 72 */ -0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340, 0x8339, 0x8350, -0x8345, 0x832F, 0x832B, 0x8317, 0x8318, 0x8385, 0x839A, 0x83AA, -0x839F, 0x83A2, 0x8396, 0x8323, 0x838E, 0x8387, 0x838A, 0x837C, -0x83B5, 0x8373, 0x8375, 0x83A0, 0x8389, 0x83A8, 0x83F4, 0x8413, -0x83EB, 0x83CE, 0x83FD, 0x8403, 0x83D8, 0x840B, 0x83C1, 0x83F7, -0x8407, 0x83E0, 0x83F2, 0x840D, 0x8422, 0x8420, 0x83BD, 0x8438, -0x8506, 0x83FB, 0x846D, 0x842A, 0x843C, 0x855A, 0x8484, 0x8477, -0x846B, 0x84AD, 0x846E, 0x8482, 0x8469, 0x8446, 0x842C, 0x846F, -0x8479, 0x8435, 0x84CA, 0x8462, 0x84B9, 0x84BF, 0x849F, 0x84D9, -0x84CD, 0x84BB, 0x84DA, 0x84D0, 0x84C1, 0x84C6, 0x84D6, 0x84A1, -0x8521, 0x84FF, 0x84F4, 0x8517, 0x8518, 0x852C, 0x851F, 0x8515, -0x8514, 0x84FC, 0x8540, 0x8563, 0x8558, 0x8548}, -{ /* category 73 */ -0x8541, 0x8602, 0x854B, 0x8555, 0x8580, 0x85A4, 0x8588, 0x8591, -0x858A, 0x85A8, 0x856D, 0x8594, 0x859B, 0x85EA, 0x8587, 0x859C, -0x8577, 0x857E, 0x8590, 0x85C9, 0x85BA, 0x85CF, 0x85B9, 0x85D0, -0x85D5, 0x85DD, 0x85E5, 0x85DC, 0x85F9, 0x860A, 0x8613, 0x860B, -0x85FE, 0x85FA, 0x8606, 0x8622, 0x861A, 0x8630, 0x863F, 0x864D, -0x4E55, 0x8654, 0x865F, 0x8667, 0x8671, 0x8693, 0x86A3, 0x86A9, -0x86AA, 0x868B, 0x868C, 0x86B6, 0x86AF, 0x86C4, 0x86C6, 0x86B0, -0x86C9, 0x8823, 0x86AB, 0x86D4, 0x86DE, 0x86E9, 0x86EC, 0x86DF, -0x86DB, 0x86EF, 0x8712, 0x8706, 0x8708, 0x8700, 0x8703, 0x86FB, -0x8711, 0x8709, 0x870D, 0x86F9, 0x870A, 0x8734, 0x873F, 0x8737, -0x873B, 0x8725, 0x8729, 0x871A, 0x8760, 0x875F, 0x8778, 0x874C, -0x874E, 0x8774, 0x8757, 0x8768, 0x876E, 0x8759}, -{ /* category 74 */ -0x8753, 0x8763, 0x876A, 0x8805, 0x87A2, 0x879F, 0x8782, 0x87AF, -0x87CB, 0x87BD, 0x87C0, 0x87D0, 0x96D6, 0x87AB, 0x87C4, 0x87B3, -0x87C7, 0x87C6, 0x87BB, 0x87EF, 0x87F2, 0x87E0, 0x880F, 0x880D, -0x87FE, 0x87F6, 0x87F7, 0x880E, 0x87D2, 0x8811, 0x8816, 0x8815, -0x8822, 0x8821, 0x8831, 0x8836, 0x8839, 0x8827, 0x883B, 0x8844, -0x8842, 0x8852, 0x8859, 0x885E, 0x8862, 0x886B, 0x8881, 0x887E, -0x889E, 0x8875, 0x887D, 0x88B5, 0x8872, 0x8882, 0x8897, 0x8892, -0x88AE, 0x8899, 0x88A2, 0x888D, 0x88A4, 0x88B0, 0x88BF, 0x88B1, -0x88C3, 0x88C4, 0x88D4, 0x88D8, 0x88D9, 0x88DD, 0x88F9, 0x8902, -0x88FC, 0x88F4, 0x88E8, 0x88F2, 0x8904, 0x890C, 0x890A, 0x8913, -0x8943, 0x891E, 0x8925, 0x892A, 0x892B, 0x8941, 0x8944, 0x893B, -0x8936, 0x8938, 0x894C, 0x891D, 0x8960, 0x895E}, -{ /* category 75 */ -0x8966, 0x8964, 0x896D, 0x896A, 0x896F, 0x8974, 0x8977, 0x897E, -0x8983, 0x8988, 0x898A, 0x8993, 0x8998, 0x89A1, 0x89A9, 0x89A6, -0x89AC, 0x89AF, 0x89B2, 0x89BA, 0x89BD, 0x89BF, 0x89C0, 0x89DA, -0x89DC, 0x89DD, 0x89E7, 0x89F4, 0x89F8, 0x8A03, 0x8A16, 0x8A10, -0x8A0C, 0x8A1B, 0x8A1D, 0x8A25, 0x8A36, 0x8A41, 0x8A5B, 0x8A52, -0x8A46, 0x8A48, 0x8A7C, 0x8A6D, 0x8A6C, 0x8A62, 0x8A85, 0x8A82, -0x8A84, 0x8AA8, 0x8AA1, 0x8A91, 0x8AA5, 0x8AA6, 0x8A9A, 0x8AA3, -0x8AC4, 0x8ACD, 0x8AC2, 0x8ADA, 0x8AEB, 0x8AF3, 0x8AE7, 0x8AE4, -0x8AF1, 0x8B14, 0x8AE0, 0x8AE2, 0x8AF7, 0x8ADE, 0x8ADB, 0x8B0C, -0x8B07, 0x8B1A, 0x8AE1, 0x8B16, 0x8B10, 0x8B17, 0x8B20, 0x8B33, -0x97AB, 0x8B26, 0x8B2B, 0x8B3E, 0x8B28, 0x8B41, 0x8B4C, 0x8B4F, -0x8B4E, 0x8B49, 0x8B56, 0x8B5B, 0x8B5A, 0x8B6B}, -{ /* category 76 */ -0x8B5F, 0x8B6C, 0x8B6F, 0x8B74, 0x8B7D, 0x8B80, 0x8B8C, 0x8B8E, -0x8B92, 0x8B93, 0x8B96, 0x8B99, 0x8B9A, 0x8C3A, 0x8C41, 0x8C3F, -0x8C48, 0x8C4C, 0x8C4E, 0x8C50, 0x8C55, 0x8C62, 0x8C6C, 0x8C78, -0x8C7A, 0x8C82, 0x8C89, 0x8C85, 0x8C8A, 0x8C8D, 0x8C8E, 0x8C94, -0x8C7C, 0x8C98, 0x621D, 0x8CAD, 0x8CAA, 0x8CBD, 0x8CB2, 0x8CB3, -0x8CAE, 0x8CB6, 0x8CC8, 0x8CC1, 0x8CE4, 0x8CE3, 0x8CDA, 0x8CFD, -0x8CFA, 0x8CFB, 0x8D04, 0x8D05, 0x8D0A, 0x8D07, 0x8D0F, 0x8D0D, -0x8D10, 0x9F4E, 0x8D13, 0x8CCD, 0x8D14, 0x8D16, 0x8D67, 0x8D6D, -0x8D71, 0x8D73, 0x8D81, 0x8D99, 0x8DC2, 0x8DBE, 0x8DBA, 0x8DCF, -0x8DDA, 0x8DD6, 0x8DCC, 0x8DDB, 0x8DCB, 0x8DEA, 0x8DEB, 0x8DDF, -0x8DE3, 0x8DFC, 0x8E08, 0x8E09, 0x8DFF, 0x8E1D, 0x8E1E, 0x8E10, -0x8E1F, 0x8E42, 0x8E35, 0x8E30, 0x8E34, 0x8E4A}, -{ /* category 77 */ -0x8E47, 0x8E49, 0x8E4C, 0x8E50, 0x8E48, 0x8E59, 0x8E64, 0x8E60, -0x8E2A, 0x8E63, 0x8E55, 0x8E76, 0x8E72, 0x8E7C, 0x8E81, 0x8E87, -0x8E85, 0x8E84, 0x8E8B, 0x8E8A, 0x8E93, 0x8E91, 0x8E94, 0x8E99, -0x8EAA, 0x8EA1, 0x8EAC, 0x8EB0, 0x8EC6, 0x8EB1, 0x8EBE, 0x8EC5, -0x8EC8, 0x8ECB, 0x8EDB, 0x8EE3, 0x8EFC, 0x8EFB, 0x8EEB, 0x8EFE, -0x8F0A, 0x8F05, 0x8F15, 0x8F12, 0x8F19, 0x8F13, 0x8F1C, 0x8F1F, -0x8F1B, 0x8F0C, 0x8F26, 0x8F33, 0x8F3B, 0x8F39, 0x8F45, 0x8F42, -0x8F3E, 0x8F4C, 0x8F49, 0x8F46, 0x8F4E, 0x8F57, 0x8F5C, 0x8F62, -0x8F63, 0x8F64, 0x8F9C, 0x8F9F, 0x8FA3, 0x8FAD, 0x8FAF, 0x8FB7, -0x8FDA, 0x8FE5, 0x8FE2, 0x8FEA, 0x8FEF, 0x9087, 0x8FF4, 0x9005, -0x8FF9, 0x8FFA, 0x9011, 0x9015, 0x9021, 0x900D, 0x901E, 0x9016, -0x900B, 0x9027, 0x9036, 0x9035, 0x9039, 0x8FF8}, -{ /* category 78 */ -0x904F, 0x9050, 0x9051, 0x9052, 0x900E, 0x9049, 0x903E, 0x9056, -0x9058, 0x905E, 0x9068, 0x906F, 0x9076, 0x96A8, 0x9072, 0x9082, -0x907D, 0x9081, 0x9080, 0x908A, 0x9089, 0x908F, 0x90A8, 0x90AF, -0x90B1, 0x90B5, 0x90E2, 0x90E4, 0x6248, 0x90DB, 0x9102, 0x9112, -0x9119, 0x9132, 0x9130, 0x914A, 0x9156, 0x9158, 0x9163, 0x9165, -0x9169, 0x9173, 0x9172, 0x918B, 0x9189, 0x9182, 0x91A2, 0x91AB, -0x91AF, 0x91AA, 0x91B5, 0x91B4, 0x91BA, 0x91C0, 0x91C1, 0x91C9, -0x91CB, 0x91D0, 0x91D6, 0x91DF, 0x91E1, 0x91DB, 0x91FC, 0x91F5, -0x91F6, 0x921E, 0x91FF, 0x9214, 0x922C, 0x9215, 0x9211, 0x925E, -0x9257, 0x9245, 0x9249, 0x9264, 0x9248, 0x9295, 0x923F, 0x924B, -0x9250, 0x929C, 0x9296, 0x9293, 0x929B, 0x925A, 0x92CF, 0x92B9, -0x92B7, 0x92E9, 0x930F, 0x92FA, 0x9344, 0x932E}, -{ /* category 79 */ -0x9319, 0x9322, 0x931A, 0x9323, 0x933A, 0x9335, 0x933B, 0x935C, -0x9360, 0x937C, 0x936E, 0x9356, 0x93B0, 0x93AC, 0x93AD, 0x9394, -0x93B9, 0x93D6, 0x93D7, 0x93E8, 0x93E5, 0x93D8, 0x93C3, 0x93DD, -0x93D0, 0x93C8, 0x93E4, 0x941A, 0x9414, 0x9413, 0x9403, 0x9407, -0x9410, 0x9436, 0x942B, 0x9435, 0x9421, 0x943A, 0x9441, 0x9452, -0x9444, 0x945B, 0x9460, 0x9462, 0x945E, 0x946A, 0x9229, 0x9470, -0x9475, 0x9477, 0x947D, 0x945A, 0x947C, 0x947E, 0x9481, 0x947F, -0x9582, 0x9587, 0x958A, 0x9594, 0x9596, 0x9598, 0x9599, 0x95A0, -0x95A8, 0x95A7, 0x95AD, 0x95BC, 0x95BB, 0x95B9, 0x95BE, 0x95CA, -0x6FF6, 0x95C3, 0x95CD, 0x95CC, 0x95D5, 0x95D4, 0x95D6, 0x95DC, -0x95E1, 0x95E5, 0x95E2, 0x9621, 0x9628, 0x962E, 0x962F, 0x9642, -0x964C, 0x964F, 0x964B, 0x9677, 0x965C, 0x965E}, -{ /* category 80 */ -0x965D, 0x965F, 0x9666, 0x9672, 0x966C, 0x968D, 0x9698, 0x9695, -0x9697, 0x96AA, 0x96A7, 0x96B1, 0x96B2, 0x96B0, 0x96B4, 0x96B6, -0x96B8, 0x96B9, 0x96CE, 0x96CB, 0x96C9, 0x96CD, 0x894D, 0x96DC, -0x970D, 0x96D5, 0x96F9, 0x9704, 0x9706, 0x9708, 0x9713, 0x970E, -0x9711, 0x970F, 0x9716, 0x9719, 0x9724, 0x972A, 0x9730, 0x9739, -0x973D, 0x973E, 0x9744, 0x9746, 0x9748, 0x9742, 0x9749, 0x975C, -0x9760, 0x9764, 0x9766, 0x9768, 0x52D2, 0x976B, 0x9771, 0x9779, -0x9785, 0x977C, 0x9781, 0x977A, 0x9786, 0x978B, 0x978F, 0x9790, -0x979C, 0x97A8, 0x97A6, 0x97A3, 0x97B3, 0x97B4, 0x97C3, 0x97C6, -0x97C8, 0x97CB, 0x97DC, 0x97ED, 0x9F4F, 0x97F2, 0x7ADF, 0x97F6, -0x97F5, 0x980F, 0x980C, 0x9838, 0x9824, 0x9821, 0x9837, 0x983D, -0x9846, 0x984F, 0x984B, 0x986B, 0x986F, 0x9870}, -{ /* category 81 */ -0x9871, 0x9874, 0x9873, 0x98AA, 0x98AF, 0x98B1, 0x98B6, 0x98C4, -0x98C3, 0x98C6, 0x98E9, 0x98EB, 0x9903, 0x9909, 0x9912, 0x9914, -0x9918, 0x9921, 0x991D, 0x991E, 0x9924, 0x9920, 0x992C, 0x992E, -0x993D, 0x993E, 0x9942, 0x9949, 0x9945, 0x9950, 0x994B, 0x9951, -0x9952, 0x994C, 0x9955, 0x9997, 0x9998, 0x99A5, 0x99AD, 0x99AE, -0x99BC, 0x99DF, 0x99DB, 0x99DD, 0x99D8, 0x99D1, 0x99ED, 0x99EE, -0x99F1, 0x99F2, 0x99FB, 0x99F8, 0x9A01, 0x9A0F, 0x9A05, 0x99E2, -0x9A19, 0x9A2B, 0x9A37, 0x9A45, 0x9A42, 0x9A40, 0x9A43, 0x9A3E, -0x9A55, 0x9A4D, 0x9A5B, 0x9A57, 0x9A5F, 0x9A62, 0x9A65, 0x9A64, -0x9A69, 0x9A6B, 0x9A6A, 0x9AAD, 0x9AB0, 0x9ABC, 0x9AC0, 0x9ACF, -0x9AD1, 0x9AD3, 0x9AD4, 0x9ADE, 0x9ADF, 0x9AE2, 0x9AE3, 0x9AE6, -0x9AEF, 0x9AEB, 0x9AEE, 0x9AF4, 0x9AF1, 0x9AF7}, -{ /* category 82 */ -0x9AFB, 0x9B06, 0x9B18, 0x9B1A, 0x9B1F, 0x9B22, 0x9B23, 0x9B25, -0x9B27, 0x9B28, 0x9B29, 0x9B2A, 0x9B2E, 0x9B2F, 0x9B32, 0x9B44, -0x9B43, 0x9B4F, 0x9B4D, 0x9B4E, 0x9B51, 0x9B58, 0x9B74, 0x9B93, -0x9B83, 0x9B91, 0x9B96, 0x9B97, 0x9B9F, 0x9BA0, 0x9BA8, 0x9BB4, -0x9BC0, 0x9BCA, 0x9BB9, 0x9BC6, 0x9BCF, 0x9BD1, 0x9BD2, 0x9BE3, -0x9BE2, 0x9BE4, 0x9BD4, 0x9BE1, 0x9C3A, 0x9BF2, 0x9BF1, 0x9BF0, -0x9C15, 0x9C14, 0x9C09, 0x9C13, 0x9C0C, 0x9C06, 0x9C08, 0x9C12, -0x9C0A, 0x9C04, 0x9C2E, 0x9C1B, 0x9C25, 0x9C24, 0x9C21, 0x9C30, -0x9C47, 0x9C32, 0x9C46, 0x9C3E, 0x9C5A, 0x9C60, 0x9C67, 0x9C76, -0x9C78, 0x9CE7, 0x9CEC, 0x9CF0, 0x9D09, 0x9D08, 0x9CEB, 0x9D03, -0x9D06, 0x9D2A, 0x9D26, 0x9DAF, 0x9D23, 0x9D1F, 0x9D44, 0x9D15, -0x9D12, 0x9D41, 0x9D3F, 0x9D3E, 0x9D46, 0x9D48}, -{ /* category 83 */ -0x9D5D, 0x9D5E, 0x9D64, 0x9D51, 0x9D50, 0x9D59, 0x9D72, 0x9D89, -0x9D87, 0x9DAB, 0x9D6F, 0x9D7A, 0x9D9A, 0x9DA4, 0x9DA9, 0x9DB2, -0x9DC4, 0x9DC1, 0x9DBB, 0x9DB8, 0x9DBA, 0x9DC6, 0x9DCF, 0x9DC2, -0x9DD9, 0x9DD3, 0x9DF8, 0x9DE6, 0x9DED, 0x9DEF, 0x9DFD, 0x9E1A, -0x9E1B, 0x9E1E, 0x9E75, 0x9E79, 0x9E7D, 0x9E81, 0x9E88, 0x9E8B, -0x9E8C, 0x9E92, 0x9E95, 0x9E91, 0x9E9D, 0x9EA5, 0x9EA9, 0x9EB8, -0x9EAA, 0x9EAD, 0x9761, 0x9ECC, 0x9ECE, 0x9ECF, 0x9ED0, 0x9ED4, -0x9EDC, 0x9EDE, 0x9EDD, 0x9EE0, 0x9EE5, 0x9EE8, 0x9EEF, 0x9EF4, -0x9EF6, 0x9EF7, 0x9EF9, 0x9EFB, 0x9EFC, 0x9EFD, 0x9F07, 0x9F08, -0x76B7, 0x9F15, 0x9F21, 0x9F2C, 0x9F3E, 0x9F4A, 0x9F52, 0x9F54, -0x9F63, 0x9F5F, 0x9F60, 0x9F61, 0x9F66, 0x9F67, 0x9F6C, 0x9F6A, -0x9F77, 0x9F72, 0x9F76, 0x9F95, 0x9F9C, 0x9FA0}, -{ /* category 84 */ -0x582F, 0x69C7, 0x9059, 0x7464, 0x51DC, 0x7199, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 85 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 86 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 87 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 88 */ -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, -{ /* category 89 */ -0x7E8A, 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB, 0x6631, -0x68C8, 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC, 0x4F00, -0x4F03, 0x4F39, 0x4F56, 0x4F92, 0x4F8A, 0x4F9A, 0x4F94, 0x4FCD, -0x5040, 0x5022, 0x4FFF, 0x501E, 0x5046, 0x5070, 0x5042, 0x5094, -0x50F4, 0x50D8, 0x514A, 0x5164, 0x519D, 0x51BE, 0x51EC, 0x5215, -0x529C, 0x52A6, 0x52C0, 0x52DB, 0x5300, 0x5307, 0x5324, 0x5372, -0x5393, 0x53B2, 0x53DD, 0xFA0E, 0x549C, 0x548A, 0x54A9, 0x54FF, -0x5586, 0x5759, 0x5765, 0x57AC, 0x57C8, 0x57C7, 0xFA0F, 0xFA10, -0x589E, 0x58B2, 0x590B, 0x5953, 0x595B, 0x595D, 0x5963, 0x59A4, -0x59BA, 0x5B56, 0x5BC0, 0x752F, 0x5BD8, 0x5BEC, 0x5C1E, 0x5CA6, -0x5CBA, 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D, 0x5DB8, -0x5DB9, 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7}, -{ /* category 90 */ -0x5FDE, 0x605D, 0x6085, 0x608A, 0x60DE, 0x60D5, 0x6120, 0x60F2, -0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62A6, 0x63F5, 0x6460, -0x649D, 0x64CE, 0x654E, 0x6600, 0x6615, 0x663B, 0x6609, 0x662E, -0x661E, 0x6624, 0x6665, 0x6657, 0x6659, 0xFA12, 0x6673, 0x6699, -0x66A0, 0x66B2, 0x66BF, 0x66FA, 0x670E, 0xF929, 0x6766, 0x67BB, -0x6852, 0x67C0, 0x6801, 0x6844, 0x68CF, 0xFA13, 0x6968, 0xFA14, -0x6998, 0x69E2, 0x6A30, 0x6A6B, 0x6A46, 0x6A73, 0x6A7E, 0x6AE2, -0x6AE4, 0x6BD6, 0x6C3F, 0x6C5C, 0x6C86, 0x6C6F, 0x6CDA, 0x6D04, -0x6D87, 0x6D6F, 0x6D96, 0x6DAC, 0x6DCF, 0x6DF8, 0x6DF2, 0x6DFC, -0x6E39, 0x6E5C, 0x6E27, 0x6E3C, 0x6EBF, 0x6F88, 0x6FB5, 0x6FF5, -0x7005, 0x7007, 0x7028, 0x7085, 0x70AB, 0x710F, 0x7104, 0x715C, -0x7146, 0x7147, 0xFA15, 0x71C1, 0x71FE, 0x72B1}, -{ /* category 91 */ -0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9, 0x73D6, 0x73E3, -0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429, 0x742E, 0x7462, -0x7489, 0x749F, 0x7501, 0x756F, 0x7682, 0x769C, 0x769E, 0x769B, -0x76A6, 0xFA17, 0x7746, 0x52AF, 0x7821, 0x784E, 0x7864, 0x787A, -0x7930, 0xFA18, 0xFA19, 0xFA1A, 0x7994, 0xFA1B, 0x799B, 0x7AD1, -0x7AE7, 0xFA1C, 0x7AEB, 0x7B9E, 0xFA1D, 0x7D48, 0x7D5C, 0x7DB7, -0x7DA0, 0x7DD6, 0x7E52, 0x7F47, 0x7FA1, 0xFA1E, 0x8301, 0x8362, -0x837F, 0x83C7, 0x83F6, 0x8448, 0x84B4, 0x8553, 0x8559, 0x856B, -0xFA1F, 0x85B0, 0xFA20, 0xFA21, 0x8807, 0x88F5, 0x8A12, 0x8A37, -0x8A79, 0x8AA7, 0x8ABE, 0x8ADF, 0xFA22, 0x8AF6, 0x8B53, 0x8B7F, -0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF, 0xFA24, 0xFA25, -0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA}, -{ /* category 92 */ -0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206, 0x9210, -0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251, 0x9239, -0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9, 0x92D0, -0xFA27, 0x92D5, 0x92E0, 0x92D3, 0x9325, 0x9321, 0x92FB, 0xFA28, -0x931E, 0x92FF, 0x931D, 0x9302, 0x9370, 0x9357, 0x93A4, 0x93C6, -0x93DE, 0x93F8, 0x9431, 0x9445, 0x9448, 0x9592, 0xF9DC, 0xFA29, -0x969D, 0x96AF, 0x9733, 0x973B, 0x9743, 0x974D, 0x974F, 0x9751, -0x9755, 0x9857, 0x9865, 0xFA2A, 0xFA2B, 0x9927, 0xFA2C, 0x999E, -0x9A4E, 0x9AD9, 0x9ADC, 0x9B75, 0x9B72, 0x9B8F, 0x9BB1, 0x9BBB, -0x9C00, 0x9D70, 0x9D6B, 0xFA2D, 0x9E19, 0x9ED1, 0x0000, 0x0000, -0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, -0x2178, 0x2179, 0xFFE2, 0xFFE4, 0xFF07, 0xFF02}}; - -#endif /* JISX0208_H */ diff --git a/ext/gd/libgd/mathmake.c b/ext/gd/libgd/mathmake.c deleted file mode 100644 index 3950c4b09c81c..0000000000000 --- a/ext/gd/libgd/mathmake.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -#define scale 1024 - -int basis[91]; -int cost[360]; - -main (void) -{ - int i; - printf ("#define costScale %d\n", scale); - printf ("int cost[] = {\n "); - for (i = 0; (i <= 90); i++) - { - basis[i] = cos ((double) i * .0174532925) * scale; - } - for (i = 0; (i < 90); i++) - { - printf ("%d,\n ", cost[i] = basis[i]); - } - for (i = 90; (i < 180); i++) - { - printf ("%d,\n ", cost[i] = -basis[180 - i]); - } - for (i = 180; (i < 270); i++) - { - printf ("%d,\n ", cost[i] = -basis[i - 180]); - } - for (i = 270; (i < 359); i++) - { - printf ("%d,\n ", cost[i] = basis[360 - i]); - } - printf ("%d\n", cost[359] = basis[1]); - printf ("};\n"); - printf ("#define sintScale %d\n", scale); - printf ("int sint[] = {\n "); - for (i = 0; (i < 360); i++) - { - int val; - val = cost[(i + 270) % 360]; - if (i != 359) - { - printf ("%d,\n ", val); - } - else - { - printf ("%d\n", val); - } - } - printf ("};\n"); -} diff --git a/ext/gd/libgd/pngtogd.c b/ext/gd/libgd/pngtogd.c deleted file mode 100644 index b663b170b710c..0000000000000 --- a/ext/gd/libgd/pngtogd.c +++ /dev/null @@ -1,45 +0,0 @@ - -#include -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in, *out; - if (argc != 3) - { - fprintf (stderr, "Usage: pngtogd filename.png filename.gd\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromPng (in); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in PNG format!\n"); - exit (1); - } - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } - gdImageGd (im, out); - fclose (out); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/pngtogd2.c b/ext/gd/libgd/pngtogd2.c deleted file mode 100644 index c8b1d843af136..0000000000000 --- a/ext/gd/libgd/pngtogd2.c +++ /dev/null @@ -1,52 +0,0 @@ - -#include -#include -#include "gd.h" - -/* A short program which converts a .png file into a .gd file, for - your convenience in creating images on the fly from a - basis image that must be loaded quickly. The .gd format - is not intended to be a general-purpose format. */ - -int -main (int argc, char **argv) -{ - gdImagePtr im; - FILE *in, *out; - int cs, fmt; - - if (argc != 5) - { - fprintf (stderr, "Usage: pngtogd2 filename.png filename.gd2 cs fmt\n"); - fprintf (stderr, " where cs is the chunk size\n"); - fprintf (stderr, " fmt is 1 for raw, 2 for compressed\n"); - exit (1); - } - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Input file does not exist!\n"); - exit (1); - } - im = gdImageCreateFromPng (in); - fclose (in); - if (!im) - { - fprintf (stderr, "Input is not in PNG format!\n"); - exit (1); - } - out = fopen (argv[2], "wb"); - if (!out) - { - fprintf (stderr, "Output file cannot be written to!\n"); - gdImageDestroy (im); - exit (1); - } - cs = atoi (argv[3]); - fmt = atoi (argv[4]); - gdImageGd2 (im, out, cs, fmt); - fclose (out); - gdImageDestroy (im); - - return 0; -} diff --git a/ext/gd/libgd/testac.c b/ext/gd/libgd/testac.c deleted file mode 100644 index 30c54e1641fab..0000000000000 --- a/ext/gd/libgd/testac.c +++ /dev/null @@ -1,129 +0,0 @@ - -#include -#include "gd.h" - -/* If palette is true, we convert from truecolor to palette at the end, - to test gdImageTrueColorToPalette and see file size/ - quality tradeoffs. */ - -void testDrawing ( - gdImagePtr im_in, - double scale, - int blending, - int palette, - char *filename); - -int -main (int argc, char *argv[]) -{ - /* Input and output files */ - FILE *in; - FILE *out; - - /* Input image */ - gdImagePtr im_in = 0; - - /* Colors */ - int lightBlue; - - if (argc != 2) - { - fprintf (stderr, "Usage: testac filename.png\n"); - exit (1); - } - /* Load original PNG, which should contain alpha channel - information. We will use it in two ways: preserving it - literally, for use with compatible browsers, and - compositing it ourselves against a background of our - choosing (alpha blending). We'll change its size - and try creating palette versions of it. */ - in = fopen (argv[1], "rb"); - if (!in) - { - fprintf (stderr, "Can't load %s.\n", argv[1]); - exit (1); - } - else - { - im_in = gdImageCreateFromPng (in); - fclose (in); - } - testDrawing (im_in, 1.0, 0, 0, "noblending-fullsize-truecolor.png"); - testDrawing (im_in, 1.0, 1, 0, "blending-fullsize-truecolor.png"); - testDrawing (im_in, 0.5, 0, 0, "noblending-halfsize-truecolor.png"); - testDrawing (im_in, 0.5, 1, 0, "blending-halfsize-truecolor.png"); - testDrawing (im_in, 2.0, 0, 0, "noblending-doublesize-truecolor.png"); - testDrawing (im_in, 2.0, 1, 0, "blending-doublesize-truecolor.png"); - testDrawing (im_in, 1.0, 0, 1, "noblending-fullsize-palette.png"); - testDrawing (im_in, 1.0, 1, 1, "blending-fullsize-palette.png"); - testDrawing (im_in, 0.5, 0, 1, "noblending-halfsize-palette.png"); - testDrawing (im_in, 0.5, 1, 1, "blending-halfsize-palette.png"); - testDrawing (im_in, 2.0, 0, 1, "noblending-doublesize-palette.png"); - testDrawing (im_in, 2.0, 1, 1, "blending-doublesize-palette.png"); - gdImageDestroy (im_in); - return 0; -} - -/* If palette is true, we convert from truecolor to palette at the end, - to test gdImageTrueColorToPalette and see file size/ - quality tradeoffs. */ -void -testDrawing ( - gdImagePtr im_in, - double scale, - int blending, - int palette, - char *filename) -{ - gdImagePtr im_out; - FILE *out; - /* Create output image. */ - im_out = gdImageCreateTrueColor ((int) (gdImageSX (im_in) * scale), - (int) (gdImageSY (im_in) * scale)); - /* - Request alpha blending. This causes future - drawing operations to perform alpha channel blending - with the background, resulting in an opaque image. - Without this call, pixels in the foreground color are - copied literally, *including* the alpha channel value, - resulting in an output image which is potentially - not opaque. This flag can be set and cleared as often - as desired. */ - gdImageAlphaBlending (im_out, blending); - - /* Flood with light blue. */ - gdImageFill (im_out, (int) (gdImageSX (im_in) * scale / 2), - (int) (gdImageSY (im_in) * scale / 2), - gdTrueColor (192, 192, 255)); - /* Copy the source image. Alpha blending should result in - compositing against red. With blending turned off, the - browser or viewer will composite against its preferred - background, or, if it does not support an alpha channel, - we will see the original colors for the pixels that - ought to be transparent or semitransparent. */ - gdImageCopyResampled (im_out, im_in, - 0, 0, - 0, 0, - (int) (gdImageSX (im_in) * scale), (int) (gdImageSY (im_in) * scale), - gdImageSX (im_in), gdImageSY (im_in)); - /* Write PNG */ - out = fopen (filename, "wb"); - - /* If this image is the result of alpha channel blending, - it will not contain an interesting alpha channel itself. - Save a little file size by not saving the alpha channel. - Otherwise the file would typically be slightly larger. */ - gdImageSaveAlpha (im_out, !blending); - - /* If requested, convert from truecolor to palette. */ - if (palette) - { - /* Dithering, 256 colors. */ - gdImageTrueColorToPalette (im_out, 1, 256); - } - - gdImagePng (im_out, out); - fclose (out); - - gdImageDestroy (im_out); -} diff --git a/ext/gd/libgd/wbmp.c b/ext/gd/libgd/wbmp.c deleted file mode 100644 index d63c684ac7924..0000000000000 --- a/ext/gd/libgd/wbmp.c +++ /dev/null @@ -1,369 +0,0 @@ - -/* WBMP - ** ---- - ** WBMP Level 0: B/W, Uncompressed - ** This implements the WBMP format as specified in WAPSpec 1.1 and 1.2. - ** It does not support ExtHeaders as defined in the spec. The spec states - ** that a WAP client does not need to implement ExtHeaders. - ** - ** (c) 2000 Johan Van den Brande - */ - - -#include -#include -#include -#include - -#include "wbmp.h" -#include "gd.h" -#include "gdhelpers.h" - -#ifdef NOTDEF -#define __TEST /* Compile with main function */ -#define __DEBUG /* Extra verbose when with __TEST */ -#define __WRITE /* readwbmp and writewbmp(stdout) */ -#define __VIEW /* view the wbmp on stdout */ -#endif - -/* getmbi - ** ------ - ** Get a multibyte integer from a generic getin function - ** 'getin' can be getc, with in = NULL - ** you can find getin as a function just above the main function - ** This way you gain a lot of flexibilty about how this package - ** reads a wbmp file. - */ -int -getmbi (int (*getin) (void *in), void *in) -{ - int i, mbi = 0; - - do - { - i = getin (in); - if (i < 0) - return (-1); - mbi = (mbi << 7) | (i & 0x7f); - } - while (i & 0x80); - - return (mbi); -} - - -/* putmbi - ** ------ - ** Put a multibyte intgerer in some kind of output stream - ** I work here with a function pointer, to make it as generic - ** as possible. Look at this function as an iterator on the - ** mbi integers it spits out. - ** - */ -void -putmbi (int i, void (*putout) (int c, void *out), void *out) -{ - int cnt, l, accu; - - /* Get number of septets */ - cnt = 0; - accu = 0; - while (accu != i) - accu += i & 0x7f << 7 * cnt++; - - /* Produce the multibyte output */ - for (l = cnt - 1; l > 0; l--) - putout (0x80 | (i & 0x7f << 7 * l) >> 7 * l, out); - - putout (i & 0x7f, out); - -} - - - -/* skipheader - ** ---------- - ** Skips the ExtHeader. Not needed for the moment - ** - */ -int -skipheader (int (*getin) (void *in), void *in) -{ - int i; - - do - { - i = getin (in); - if (i < 0) - return (-1); - } - while (i & 0x80); - - return (0); -} - -/* create wbmp - ** ----------- - ** create an empty wbmp - ** - */ -Wbmp * -createwbmp (int width, int height, int color) -{ - int i; - - Wbmp *wbmp; - if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) - return (NULL); - - if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), width * height, 0)) == NULL) - { - gdFree (wbmp); - return (NULL); - } - - wbmp->width = width; - wbmp->height = height; - - for (i = 0; i < width * height; wbmp->bitmap[i++] = color); - - return (wbmp); -} - - - -/* readwbmp - ** ------- - ** Actually reads the WBMP format from an open file descriptor - ** It goes along by returning a pointer to a WBMP struct. - ** - */ -int -readwbmp (int (*getin) (void *in), void *in, Wbmp ** return_wbmp) -{ - int row, col, byte, pel, pos; - Wbmp *wbmp; - - if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) - return (-1); - - wbmp->type = getin (in); - if (wbmp->type != 0) - { - gdFree (wbmp); - return (-1); - } - - if (skipheader (getin, in)) - return (-1); - - - wbmp->width = getmbi (getin, in); - if (wbmp->width == -1) - { - gdFree (wbmp); - return (-1); - } - - wbmp->height = getmbi (getin, in); - if (wbmp->height == -1) - { - gdFree (wbmp); - return (-1); - } - -#ifdef __DEBUG - printf ("W: %d, H: %d\n", wbmp->width, wbmp->height); -#endif - - if ((wbmp->bitmap = (int *) safe_emalloc(wbmp->width * wbmp->height, sizeof(int), 0)) == NULL) - { - gdFree (wbmp); - return (-1); - } - -#ifdef __DEBUG - printf ("DATA CONSTRUCTED\n"); -#endif - - pos = 0; - for (row = 0; row < wbmp->height; row++) - { - for (col = 0; col < wbmp->width;) - { - byte = getin (in); - - for (pel = 7; pel >= 0; pel--) - { - if (col++ < wbmp->width) - { - if (byte & 1 << pel) - { - wbmp->bitmap[pos] = WBMP_WHITE; - } - else - { - wbmp->bitmap[pos] = WBMP_BLACK; - } - pos++; - } - } - } - } - - *return_wbmp = wbmp; - - return (0); -} - - -/* writewbmp - ** --------- - ** Write a wbmp to a file descriptor - ** - ** Why not just giving a filedescriptor to this function? - ** Well, the incentive to write this function was the complete - ** integration in gd library from www.boutell.com. They use - ** their own io functions, so the passing of a function seemed to be - ** a logic(?) decision ... - ** - */ -int -writewbmp (Wbmp * wbmp, void (*putout) (int c, void *out), void *out) -{ - int row, col; - int bitpos, octet; - - /* Generate the header */ - putout (0, out); /* WBMP Type 0: B/W, Uncompressed bitmap */ - putout (0, out); /* FixHeaderField */ - - - - /* Size of the image */ - putmbi (wbmp->width, putout, out); /* width */ - putmbi (wbmp->height, putout, out); /* height */ - - - /* Image data */ - for (row = 0; row < wbmp->height; row++) - { - bitpos = 8; - octet = 0; - for (col = 0; col < wbmp->width; col++) - { - octet |= ((wbmp->bitmap[row * wbmp->width + col] == 1) ? WBMP_WHITE : WBMP_BLACK) << --bitpos; - if (bitpos == 0) - { - bitpos = 8; - putout (octet, out); - octet = 0; - } - } - if (bitpos != 8) - putout (octet, out); - - } - return (0); - -} - - -/* freewbmp - ** -------- - ** gdFrees up memory occupied by a WBMP structure - ** - */ -void -freewbmp (Wbmp * wbmp) -{ - gdFree (wbmp->bitmap); - gdFree (wbmp); -} - - -/* printwbmp - ** --------- - ** print a WBMP to stdout for visualisation - ** - */ -void -printwbmp (Wbmp * wbmp) -{ - int row, col; - for (row = 0; row < wbmp->height; row++) - { - for (col = 0; col < wbmp->width; col++) - { - if (wbmp->bitmap[wbmp->width * row + col] == WBMP_BLACK) - { - putchar ('#'); - } - else - { - putchar (' '); - } - } - putchar ('\n'); - } -} - -#ifdef __TEST - -/* putout to file descriptor - ** ------------------------- - */ -int -putout (int c, void *out) -{ - return (putc (c, (FILE *) out)); -} - -/* getin from file descriptor - ** -------------------------- - */ -int -getin (void *in) -{ - return (getc ((FILE *) in)); -} - - -/* Main function - ** ------------- - ** - */ -int -main (int argc, char *argv[]) -{ - FILE *wbmp_file; - Wbmp *wbmp; - - wbmp_file = fopen (argv[1], "rb"); - if (wbmp_file) - { - readwbmp (&getin, wbmp_file, &wbmp); - -#ifdef __VIEW - -#ifdef __DEBUG - printf ("\nVIEWING IMAGE\n"); -#endif - - printwbmp (wbmp); -#endif - -#ifdef __WRITE - -#ifdef __DEBUG - printf ("\nDUMPING WBMP to STDOUT\n"); -#endif - - writewbmp (wbmp, &putout, stdout); -#endif - - freewbmp (wbmp); - fclose (wbmp_file); - } -} -#endif diff --git a/ext/gd/libgd/wbmp.h b/ext/gd/libgd/wbmp.h deleted file mode 100644 index 4c239d83cf2a1..0000000000000 --- a/ext/gd/libgd/wbmp.h +++ /dev/null @@ -1,48 +0,0 @@ -/* WBMP -** ---- -** WBMP Level 0: B/W, Uncompressed -** This implements the WBMP format as specified in WAPSpec 1.1 and 1.2. -** It does not support ExtHeaders as defined in the spec. The spec states -** that a WAP client does not need to implement ExtHeaders. -** -** (c) 2000 Johan Van den Brande -** -** Header file -*/ -#ifndef __WBMP_H -#define __WBMP_H 1 - -#include "php_compat.h" - -/* WBMP struct -** ----------- -** A Wireless bitmap structure -** -*/ - -typedef struct Wbmp_ -{ - int type; /* type of the wbmp */ - int width; /* width of the image */ - int height; /* height of the image */ - int *bitmap; /* pointer to data: 0 = WHITE , 1 = BLACK */ -} Wbmp; - -#define WBMP_WHITE 1 -#define WBMP_BLACK 0 - - -/* Proto's -** ------- -** -*/ -void putmbi( int i, void (*putout)(int c, void *out), void *out); -int getmbi ( int (*getin)(void *in), void *in ); -int skipheader( int (*getin)(void *in), void *in ); -Wbmp *createwbmp( int width, int height, int color ); -int readwbmp( int (*getin)(void *in), void *in, Wbmp **wbmp ); -int writewbmp( Wbmp *wbmp, void (*putout)( int c, void *out), void *out); -void freewbmp( Wbmp *wbmp ); -void printwbmp( Wbmp *wbmp ); - -#endif diff --git a/ext/gd/libgd/webpng.c b/ext/gd/libgd/webpng.c deleted file mode 100644 index 81a00e749c78e..0000000000000 --- a/ext/gd/libgd/webpng.c +++ /dev/null @@ -1,289 +0,0 @@ -/* Bring in the gd library functions */ -#include "gd.h" - -/* Bring in standard I/O and string manipulation functions */ -#include -#include /* for atoi() */ -#include - -#ifdef _WIN32 -#include -int -getpid () -{ - return _getpid (); -} -#else -#include /* for getpid(), unlink() */ -#endif -int -main (int argc, char **argv) -{ - FILE *in; - FILE *out; - char outFn[20]; - int useStdinStdout = 0; - - /* Declare our image pointer */ - gdImagePtr im = 0; - int i; - /* We'll clear 'no' once we know the user has made a - reasonable request. */ - int no = 1; - /* We'll set 'write' once we know the user's request - requires that the image be written back to disk. */ - int write = 0; - /* C programs always get at least one argument; we want at - least one more (the image), more in practice. */ - if (argc < 2 || !strcmp (argv[1], "--help")) - { - no = 1; - goto usage; - } - - /* The last argument should be the image. Open the file. */ - if (strcmp ("-", argv[argc - 1]) == 0) - { /* - is synonymous with STDIN */ - useStdinStdout = 1; - in = stdin; - } - else - { - in = fopen (argv[argc - 1], "rb"); - } - if (!in) - { - fprintf (stderr, - "Error: can't open file %s.\n", argv[argc - 1]); - exit (1); - } - /* Now load the image. */ - im = gdImageCreateFromPng (in); - fclose (in); - /* If the load failed, it must not be a PNG file. */ - if (!im) - { - fprintf (stderr, - "Error: %s is not a valid PNG file.\n", argv[argc - 1]); - exit (1); - } - /* Consider each argument in turn. */ - for (i = 1; (i < (argc - 1)); i++) - { - /* -i turns on and off interlacing. */ - if (!strcmp (argv[i], "--help")) - { - /* Every program should use this for help! :) */ - no = 1; - goto usage; - } - else if (!strcmp (argv[i], "-i")) - { - if (i == (argc - 2)) - { - fprintf (stderr, - "Error: -i specified without y or n.\n"); - no = 1; - goto usage; - } - if (!strcmp (argv[i + 1], "y")) - { - /* Set interlace. */ - gdImageInterlace (im, 1); - } - else if (!strcmp (argv[i + 1], "n")) - { - /* Clear interlace. */ - gdImageInterlace (im, 0); - } - else - { - fprintf (stderr, - "Error: -i specified without y or n.\n"); - no = 1; - goto usage; - } - i++; - no = 0; - write = 1; - } - else if (!strcmp (argv[i], "-t")) - { - /* Set transparent index (or none). */ - int index; - if (i == (argc - 2)) - { - fprintf (stderr, - "Error: -t specified without a color table index.\n"); - no = 1; - goto usage; - } - if (!strcmp (argv[i + 1], "none")) - { - /* -1 means not transparent. */ - gdImageColorTransparent (im, -1); - } - else - { - /* OK, get an integer and set the index. */ - index = atoi (argv[i + 1]); - gdImageColorTransparent (im, index); - } - i++; - write = 1; - no = 0; - } - else if (!strcmp (argv[i], "-l")) - { - /* List the colors in the color table. */ - int j; - if (!im->trueColor) - { - /* Tabs used below. */ - printf ("Index Red Green Blue Alpha\n"); - for (j = 0; (j < gdImageColorsTotal (im)); j++) - { - /* Use access macros to learn colors. */ - printf ("%d %d %d %d %d\n", - j, - gdImageRed (im, j), - gdImageGreen (im, j), - gdImageBlue (im, j), - gdImageAlpha (im, j)); - } - } - else - { - printf ("Truecolor image, no palette entries to list.\n"); - } - no = 0; - } - else if (!strcmp (argv[i], "-d")) - { - /* Output dimensions, etc. */ - int t; - printf ("Width: %d Height: %d Colors: %d\n", - gdImageSX (im), gdImageSY (im), - gdImageColorsTotal (im)); - t = gdImageGetTransparent (im); - if (t != (-1)) - { - printf ("First 100%% transparent index: %d\n", t); - } - else - { - /* -1 means the image is not transparent. */ - printf ("First 100%% transparent index: none\n"); - } - if (gdImageGetInterlaced (im)) - { - printf ("Interlaced: yes\n"); - } - else - { - printf ("Interlaced: no\n"); - } - no = 0; - } - else if (!strcmp(argv[i], "-a")) - { - int maxx, maxy, x, y, alpha, pix, nalpha = 0; - - maxx = gdImageSX(im); - maxy = gdImageSY(im); - - printf("alpha channel information:\n"); - - if (im->trueColor) { - for (y = 0; y < maxy; y++) { - for (x = 0; x < maxx; x++) { - pix = gdImageGetPixel(im, x, y); - alpha = gdTrueColorGetAlpha(pix); - - if (alpha > gdAlphaOpaque) { - /* Use access macros to learn colors. */ - printf ("%d %d %d %d\n", - gdTrueColorGetRed(pix), - gdTrueColorGetGreen(pix), - gdTrueColorGetBlue(pix), - alpha); - nalpha++; - } - - } - } - } - else - printf("NOT a true color image\n"); - no = 0; - printf("%d alpha channels\n", nalpha); - - } - else - { - fprintf (stderr, "Unknown argument: %s\n", argv[i]); - break; - } - } -usage: - if (no) - { - /* If the command failed, output an explanation. */ - fprintf (stderr, - "Usage: webpng [-i y|n ] [-l] [-t index|none ] [-d] pngname.png\n" - - " -i [y|n] Turns on/off interlace\n" - " -l Prints the table of color indexes\n" - " -t [index] Set the transparent color to the specified index (0-255 or \"none\")\n" - " -d Reports the dimensions and other characteristics of the image.\n" - " -a Prints all alpha channels that are not 100%% opaque.\n" - "\n" - "If you specify '-' as the input file, stdin/stdout will be used input/output.\n" - ); - } - if (write) - { - if (useStdinStdout) - { - out = stdout; - } - else - { - /* Open a temporary file. */ - - /* "temp.tmp" is not good temporary filename. */ - sprintf (outFn, "webpng.tmp%d", getpid ()); - out = fopen (outFn, "wb"); - - if (!out) - { - fprintf (stderr, - "Unable to write to %s -- exiting\n", outFn); - exit (1); - } - } - - /* Write the new PNG. */ - gdImagePng (im, out); - - if (!useStdinStdout) - { - fclose (out); - /* Erase the old PNG. */ - unlink (argv[argc - 1]); - /* Rename the new to the old. */ - if (rename (outFn, argv[argc - 1]) != 0) - { - perror ("rename"); - exit (1); - } - } - } - /* Delete the image from memory. */ - if (im) - { - gdImageDestroy (im); - } - /* All's well that ends well. */ - return 0; -} diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c deleted file mode 100644 index ddbef0642bd8e..0000000000000 --- a/ext/gd/libgd/xbm.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#include -#include "gd.h" -#include "gdhelpers.h" - -#include "php.h" - -#define MAX_XBM_LINE_SIZE 255 - -/* {{{ gdImagePtr gdImageCreateFromXbm */ -gdImagePtr gdImageCreateFromXbm(FILE * fd) -{ - char fline[MAX_XBM_LINE_SIZE]; - char iname[MAX_XBM_LINE_SIZE]; - char *type; - int value; - unsigned int width = 0, height = 0; - int fail = 0; - int max_bit = 0; - - gdImagePtr im; - int bytes = 0, i; - int bit, x = 0, y = 0; - int ch; - char h[8]; - unsigned int b; - - rewind(fd); - while (fgets(fline, MAX_XBM_LINE_SIZE, fd)) { - fline[MAX_XBM_LINE_SIZE-1] = '\0'; - if (strlen(fline) == MAX_XBM_LINE_SIZE-1) { - return 0; - } - if (sscanf(fline, "#define %s %d", iname, &value) == 2) { - if (!(type = strrchr(iname, '_'))) { - type = iname; - } else { - type++; - } - - if (!strcmp("width", type)) { - width = (unsigned int) value; - } - if (!strcmp("height", type)) { - height = (unsigned int) value; - } - } else { - if ( sscanf(fline, "static unsigned char %s = {", iname) == 1 - || sscanf(fline, "static char %s = {", iname) == 1) - { - max_bit = 128; - } else if (sscanf(fline, "static unsigned short %s = {", iname) == 1 - || sscanf(fline, "static short %s = {", iname) == 1) - { - max_bit = 32768; - } - if (max_bit) { - bytes = (width * height / 8) + 1; - if (!bytes) { - return 0; - } - if (!(type = strrchr(iname, '_'))) { - type = iname; - } else { - type++; - } - if (!strcmp("bits[]", type)) { - break; - } - } - } - } - if (!bytes || !max_bit) { - return 0; - } - - im = gdImageCreate(width, height); - gdImageColorAllocate(im, 255, 255, 255); - gdImageColorAllocate(im, 0, 0, 0); - h[2] = '\0'; - h[4] = '\0'; - for (i = 0; i < bytes; i++) { - while (1) { - if ((ch=getc(fd)) == EOF) { - fail = 1; - break; - } - if (ch == 'x') { - break; - } - } - if (fail) { - break; - } - /* Get hex value */ - if ((ch=getc(fd)) == EOF) { - break; - } - h[0] = ch; - if ((ch=getc(fd)) == EOF) { - break; - } - h[1] = ch; - if (max_bit == 32768) { - if ((ch=getc(fd)) == EOF) { - break; - } - h[2] = ch; - if ((ch=getc(fd)) == EOF) { - break; - } - h[3] = ch; - } - sscanf(h, "%x", &b); - for (bit = 1; bit <= max_bit; bit = bit << 1) { - gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0); - if (x == im->sx) { - x = 0; - y++; - if (y == im->sy) { - return im; - } - break; - } - } - } - - php_gd_error("EOF before image was complete"); - gdImageDestroy(im); - return 0; -} -/* }}} */ - -/* {{{ gdCtxPrintf */ -void gdCtxPrintf(gdIOCtx * out, const char *format, ...) -{ - char *buf; - int len; - va_list args; - - va_start(args, format); - len = vspprintf(&buf, 0, format, args); - va_end(args); - out->putBuf(out, buf, len); - efree(buf); -} -/* }}} */ - -/* {{{ gdImageXbmCtx */ -void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out) -{ - int x, y, c, b, sx, sy, p; - char *name, *f; - size_t i, l; - - name = file_name; - if ((f = strrchr(name, '/')) != NULL) name = f+1; - if ((f = strrchr(name, '\\')) != NULL) name = f+1; - name = estrdup(name); - if ((f = strrchr(name, '.')) != NULL && !strcasecmp(f, ".XBM")) *f = '\0'; - if ((l = strlen(name)) == 0) { - efree(name); - name = estrdup("image"); - } else { - for (i=0; i | - | Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GD_H -#define PHP_GD_H - -#define HAVE_GDIMAGECREATEFROMPNG 1 - -#if HAVE_LIBFREETYPE -#define ENABLE_GD_TTF -#endif - -#if HAVE_LIBGD - -#define PHP_GDIMG_TYPE_GIF 1 -#define PHP_GDIMG_TYPE_PNG 2 -#define PHP_GDIMG_TYPE_JPG 3 -#define PHP_GDIMG_TYPE_WBM 4 -#define PHP_GDIMG_TYPE_XBM 5 -#define PHP_GDIMG_TYPE_XPM 6 -#define PHP_GDIMG_CONVERT_WBM 7 -#define PHP_GDIMG_TYPE_GD 8 -#define PHP_GDIMG_TYPE_GD2 9 -#define PHP_GDIMG_TYPE_GD2PART 10 - -#ifdef PHP_WIN32 -#define PHP_GD_API __declspec(dllexport) -#else -#define PHP_GD_API -#endif - -PHPAPI extern const char php_sig_gif[3]; -PHPAPI extern const char php_sig_jpg[3]; -PHPAPI extern const char php_sig_png[3]; - -extern zend_module_entry gd_module_entry; -#define phpext_gd_ptr &gd_module_entry - -/* gd.c functions */ -PHP_MINFO_FUNCTION(gd); -PHP_MINIT_FUNCTION(gd); -PHP_MSHUTDOWN_FUNCTION(gd); -#if HAVE_LIBGD20 && HAVE_GD_STRINGFT -PHP_RSHUTDOWN_FUNCTION(gd); -#endif - -PHP_FUNCTION(gd_info); -PHP_FUNCTION(imagearc); -PHP_FUNCTION(imageellipse); -PHP_FUNCTION(imagechar); -PHP_FUNCTION(imagecharup); -PHP_FUNCTION(imageistruecolor); -PHP_FUNCTION(imagecolorallocate); -PHP_FUNCTION(imagepalettecopy); -PHP_FUNCTION(imagecolorat); -PHP_FUNCTION(imagecolorclosest); -PHP_FUNCTION(imagecolorclosesthwb); -PHP_FUNCTION(imagecolordeallocate); -PHP_FUNCTION(imagecolorresolve); -PHP_FUNCTION(imagecolorexact); -PHP_FUNCTION(imagecolorset); -PHP_FUNCTION(imagecolorstotal); -PHP_FUNCTION(imagecolorsforindex); -PHP_FUNCTION(imagecolortransparent); -PHP_FUNCTION(imagecopy); -PHP_FUNCTION(imagecopymerge); -PHP_FUNCTION(imagecopyresized); -PHP_FUNCTION(imagetypes); -PHP_FUNCTION(imagecreate); -PHP_FUNCTION(imageftbbox); -PHP_FUNCTION(imagefttext); - -#ifdef HAVE_LIBGD20 -PHP_FUNCTION(imagecreatetruecolor); -PHP_FUNCTION(imagetruecolortopalette); -PHP_FUNCTION(imagesetthickness); -PHP_FUNCTION(imagefilledellipse); -PHP_FUNCTION(imagefilledarc); -PHP_FUNCTION(imagealphablending); -PHP_FUNCTION(imagesavealpha); -PHP_FUNCTION(imagecolorallocatealpha); -PHP_FUNCTION(imagecolorresolvealpha); -PHP_FUNCTION(imagecolorclosestalpha); -PHP_FUNCTION(imagecolorexactalpha); -PHP_FUNCTION(imagecopyresampled); -#endif - -#ifdef HAVE_GD_BUNDLED -PHP_FUNCTION(imagerotate); -PHP_FUNCTION(imageantialias); -#endif - -PHP_FUNCTION(imagesetthickness); -PHP_FUNCTION(imagecopymergegray); -PHP_FUNCTION(imagesetbrush); -PHP_FUNCTION(imagesettile); -PHP_FUNCTION(imagesetstyle); - -PHP_FUNCTION(imagecreatefromstring); -PHP_FUNCTION(imagecreatefromgif); -PHP_FUNCTION(imagecreatefromjpeg); -PHP_FUNCTION(imagecreatefromxbm); -PHP_FUNCTION(imagecreatefrompng); -PHP_FUNCTION(imagecreatefromwbmp); -PHP_FUNCTION(imagecreatefromgd); -PHP_FUNCTION(imagecreatefromgd2); -PHP_FUNCTION(imagecreatefromgd2part); -#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) -PHP_FUNCTION(imagecreatefromxpm); -#endif - -PHP_FUNCTION(imagegammacorrect); -PHP_FUNCTION(imagedestroy); -PHP_FUNCTION(imagefill); -PHP_FUNCTION(imagefilledpolygon); -PHP_FUNCTION(imagefilledrectangle); -PHP_FUNCTION(imagefilltoborder); -PHP_FUNCTION(imagefontwidth); -PHP_FUNCTION(imagefontheight); - -PHP_FUNCTION(imagegif ); -PHP_FUNCTION(imagejpeg ); -PHP_FUNCTION(imagepng); -PHP_FUNCTION(imagewbmp); -PHP_FUNCTION(imagegd); -PHP_FUNCTION(imagegd2); - -PHP_FUNCTION(imageinterlace); -PHP_FUNCTION(imageline); -PHP_FUNCTION(imageloadfont); -PHP_FUNCTION(imagepolygon); -PHP_FUNCTION(imagerectangle); -PHP_FUNCTION(imagesetpixel); -PHP_FUNCTION(imagestring); -PHP_FUNCTION(imagestringup); -PHP_FUNCTION(imagesx); -PHP_FUNCTION(imagesy); -PHP_FUNCTION(imagedashedline); -PHP_FUNCTION(imagettfbbox); -PHP_FUNCTION(imagettftext); -PHP_FUNCTION(imagepsloadfont); -/* -PHP_FUNCTION(imagepscopyfont); -*/ -PHP_FUNCTION(imagepsfreefont); -PHP_FUNCTION(imagepsencodefont); -PHP_FUNCTION(imagepsextendfont); -PHP_FUNCTION(imagepsslantfont); -PHP_FUNCTION(imagepstext); -PHP_FUNCTION(imagepsbbox); - -PHP_FUNCTION(jpeg2wbmp); -PHP_FUNCTION(png2wbmp); -PHP_FUNCTION(image2wbmp); - -#if HAVE_GD_BUNDLED -PHP_FUNCTION(imagelayereffect); -PHP_FUNCTION(imagecolormatch); -PHP_FUNCTION(imagefilter); -PHP_FUNCTION(imageconvolution); -PHP_FUNCTION(imagexbm); -#endif - -PHP_GD_API int phpi_get_le_gd(void); - -#else - -#define phpext_gd_ptr NULL - -#endif - -#endif /* PHP_GD_H */ diff --git a/ext/gd/tests/bug19366.phpt b/ext/gd/tests/bug19366.phpt deleted file mode 100644 index c83d816c15b20..0000000000000 --- a/ext/gd/tests/bug19366.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Alive: create image -Alive: Define colors -Alive: Draw -Alive: ImageString -Alive: Send to browser -Alive: Free resources -Alive: Done diff --git a/ext/gd/tests/bug22544.phpt b/ext/gd/tests/bug22544.phpt deleted file mode 100644 index 3c21f0b3c97b4..0000000000000 --- a/ext/gd/tests/bug22544.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #22544 (TrueColor transparency in PNG images). ---SKIPIF-- - ---FILE-- - ---EXPECT-- -10a57d09a2c63fad87b85b38d6b258d6 diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt deleted file mode 100644 index a7cf9ef73a8b2..0000000000000 --- a/ext/gd/tests/bug24155.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #24155 (gdImageRotate270 rotation problem). ---SKIPIF-- - ---FILE-- - ---EXPECT-- -16776960 diff --git a/ext/gd/tests/bug24594.phpt b/ext/gd/tests/bug24594.phpt deleted file mode 100644 index e7b9a653f2af9..0000000000000 --- a/ext/gd/tests/bug24594.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Bug #24594 (Filling an area using tiles). ---SKIPIF-- - ---FILE-- - ---EXPECT-- -000000111111101010 -111111111111111111 diff --git a/ext/gd/tests/bug27582_1.phpt b/ext/gd/tests/bug27582_1.phpt deleted file mode 100644 index b85f7457e01b8..0000000000000 --- a/ext/gd/tests/bug27582_1.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -1 diff --git a/ext/gd/tests/bug28147.phpt b/ext/gd/tests/bug28147.phpt deleted file mode 100644 index b3551a6393339..0000000000000 --- a/ext/gd/tests/bug28147.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #28147 (Crash with anti-aliased line) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Alive diff --git a/ext/gd/tests/conv_test.gif b/ext/gd/tests/conv_test.gif deleted file mode 100644 index 40aa4331cced0..0000000000000 Binary files a/ext/gd/tests/conv_test.gif and /dev/null differ diff --git a/ext/gd/tests/conv_test.jpeg b/ext/gd/tests/conv_test.jpeg deleted file mode 100644 index 7283d1a4754ba..0000000000000 Binary files a/ext/gd/tests/conv_test.jpeg and /dev/null differ diff --git a/ext/gd/tests/conv_test.png b/ext/gd/tests/conv_test.png deleted file mode 100644 index f8c12dfd061bd..0000000000000 Binary files a/ext/gd/tests/conv_test.png and /dev/null differ diff --git a/ext/gd/tests/conv_test.xbm b/ext/gd/tests/conv_test.xbm deleted file mode 100644 index a91667187fe74..0000000000000 --- a/ext/gd/tests/conv_test.xbm +++ /dev/null @@ -1,4 +0,0 @@ -#define conv_test_xbm_width 16 -#define conv_test_xbm_height 5 -static unsigned char conv_test_xbm_bits[] = { - 0x4c, 0x0d, 0x54, 0x15, 0xcc, 0x0d, 0x44, 0x05, 0x44, 0x05}; \ No newline at end of file diff --git a/ext/gd/tests/conv_test.xpm b/ext/gd/tests/conv_test.xpm deleted file mode 100644 index b1126c1ba7c07..0000000000000 --- a/ext/gd/tests/conv_test.xpm +++ /dev/null @@ -1,1588 +0,0 @@ -/* XPM */ -static char * conv_test_xpm[] = { -"50 50 1535 2", -" c None", -". c #F81010", -"+ c #F71112", -"@ c #F51314", -"# c #F31517", -"$ c #F01619", -"% c #EE181C", -"& c #EC191E", -"* c #E91B21", -"= c #E71D24", -"- c #E41E26", -"; c #E22028", -"> c #E0212B", -", c #DE232D", -"' c #DB2430", -") c #D92632", -"! c #D62835", -"~ c #D42938", -"{ c #D22B3A", -"] c #CF2C3D", -"^ c #CD2E3F", -"/ c #CB2F41", -"( c #C93144", -"_ c #C63346", -": c #C43449", -"< c #C1364C", -"[ c #BF374E", -"} c #BD3951", -"| c #BB3B53", -"1 c #B83C55", -"2 c #B63E58", -"3 c #B43F5A", -"4 c #B1415D", -"5 c #AF4360", -"6 c #AC4462", -"7 c #AA4665", -"8 c #A84767", -"9 c #A6496A", -"0 c #A34A6C", -"a c #A14C6E", -"b c #9F4D71", -"c c #9C4F74", -"d c #9A5176", -"e c #975279", -"f c #95547B", -"g c #93557E", -"h c #F71212", -"i c #F51315", -"j c #F21517", -"k c #F0161A", -"l c #EB191E", -"m c #E22029", -"n c #DD232E", -"o c #D92633", -"p c #D42A38", -"q c #CF2D3D", -"r c #CD2F3F", -"s c #CB3142", -"t c #C83244", -"u c #C63347", -"v c #C43549", -"w c #BF384E", -"x c #BA3B53", -"y c #B83C56", -"z c #B33F5B", -"A c #A5496A", -"B c #A14C6F", -"C c #9E4E71", -"D c #93567E", -"E c #905780", -"F c #F41315", -"G c #EB191F", -"H c #E61D24", -"I c #DB2530", -"J c #D92733", -"K c #D62936", -"L c #D22C3A", -"M c #D02E3D", -"N c #CD303F", -"O c #C93344", -"P c #C73447", -"Q c #C53649", -"R c #C2384C", -"S c #C0394F", -"T c #BD3A51", -"U c #BB3C53", -"V c #B83D56", -"W c #B63F58", -"X c #B3405B", -"Y c #AE4360", -"Z c #AC4463", -"` c #A74767", -" . c #A34B6C", -".. c #995177", -"+. c #975379", -"@. c #95547C", -"#. c #8E5983", -"$. c #F71213", -"%. c #ED181C", -"&. c #EB1A1F", -"*. c #E91B22", -"=. c #E41E27", -"-. c #DF222C", -";. c #DB2630", -">. c #D82833", -",. c #D42B38", -"'. c #D22D3B", -"). c #D02F3D", -"!. c #CE3040", -"~. c #CB3242", -"{. c #C93444", -"]. c #C73547", -"^. c #C53749", -"/. c #C03A4F", -"(. c #BE3B51", -"_. c #BB3D54", -":. c #B93E56", -"<. c #B64059", -"[. c #B4415B", -"}. c #B2425D", -"|. c #AF4460", -"1. c #AC4563", -"2. c #A74868", -"3. c #A34B6D", -"4. c #A04C6F", -"5. c #9E4E72", -"6. c #9C5074", -"7. c #92567E", -"8. c #905781", -"9. c #8B5B86", -"0. c #F61213", -"a. c #F21518", -"b. c #F0171A", -"c. c #ED181D", -"d. c #E81B22", -"e. c #E41F27", -"f. c #E12029", -"g. c #DD242E", -"h. c #DB2631", -"i. c #D62A36", -"j. c #D42C38", -"k. c #D22E3B", -"l. c #D0303D", -"m. c #CD3140", -"n. c #CB3342", -"o. c #C93545", -"p. c #C73647", -"q. c #C5384A", -"r. c #C3394C", -"s. c #C03B4F", -"t. c #BE3D51", -"u. c #BC3E54", -"v. c #BA3F56", -"w. c #B74159", -"x. c #B5425B", -"y. c #B2435E", -"z. c #B04560", -"A. c #AD4663", -"B. c #AA4765", -"C. c #A84868", -"D. c #9B5075", -"E. c #94547C", -"F. c #905881", -"G. c #895C88", -"H. c #F81111", -"I. c #F41415", -"J. c #EF171A", -"K. c #E81C22", -"L. c #E61D25", -"M. c #DA2731", -"N. c #D92933", -"O. c #D42D39", -"P. c #D0303E", -"Q. c #CD3240", -"R. c #C33A4D", -"S. c #BE3D52", -"T. c #B94056", -"U. c #B04561", -"V. c #AE4763", -"W. c #AB4866", -"X. c #A94A68", -"Y. c #A64B6B", -"Z. c #A34C6D", -"`. c #A14D6F", -" + c #97537A", -".+ c #94557C", -"++ c #92567F", -"@+ c #8D5983", -"#+ c #865E8B", -"$+ c #F41416", -"%+ c #F11518", -"&+ c #EF171B", -"*+ c #E31F27", -"=+ c #E1202A", -"-+ c #DF232C", -";+ c #DC252F", -">+ c #D62B36", -",+ c #D22F3B", -"'+ c #CF303E", -")+ c #CB3343", -"!+ c #C73648", -"~+ c #C23A4D", -"{+ c #BB3E54", -"]+ c #B94057", -"^+ c #B5425C", -"/+ c #B2445E", -"(+ c #AC4866", -"_+ c #AA4A68", -":+ c #A74C6B", -"<+ c #A44D6D", -"[+ c #A24E70", -"}+ c #9F4F72", -"|+ c #9C5075", -"1+ c #995277", -"2+ c #96537A", -"3+ c #8D5984", -"4+ c #895C89", -"5+ c #84608E", -"6+ c #ED191D", -"7+ c #EA1A20", -"8+ c #E1212A", -"9+ c #D92934", -"0+ c #C83545", -"a+ c #B74259", -"b+ c #B4425C", -"c+ c #AE4764", -"d+ c #AC4966", -"e+ c #A54D6D", -"f+ c #A34F70", -"g+ c #A05072", -"h+ c #9D5275", -"i+ c #9A5378", -"j+ c #97547A", -"k+ c #8F5881", -"l+ c #885D89", -"m+ c #865E8C", -"n+ c #816191", -"o+ c #F11618", -"p+ c #EC191D", -"q+ c #E81C23", -"r+ c #E51E25", -"s+ c #E31F28", -"t+ c #D92A34", -"u+ c #D62C37", -"v+ c #D12F3C", -"w+ c #CD3241", -"x+ c #CA3343", -"y+ c #C73748", -"z+ c #C03B50", -"A+ c #BD3D52", -"B+ c #BB3F55", -"C+ c #B6425A", -"D+ c #B4435C", -"E+ c #AF4661", -"F+ c #AD4764", -"G+ c #A94A69", -"H+ c #A54D6E", -"I+ c #9E5275", -"J+ c #9B5478", -"K+ c #99557A", -"L+ c #96567D", -"M+ c #93577F", -"N+ c #905882", -"O+ c #8D5A84", -"P+ c #8B5B87", -"Q+ c #83608E", -"R+ c #816291", -"S+ c #7F6393", -"T+ c #E71C23", -"U+ c #DC262F", -"V+ c #DA2832", -"W+ c #D82A34", -"X+ c #D32D39", -"Y+ c #CA3443", -"Z+ c #C83546", -"`+ c #C4394B", -" @ c #C23B4E", -".@ c #C03D51", -"+@ c #BE3F54", -"@@ c #BC4157", -"#@ c #BA435A", -"$@ c #B7445C", -"%@ c #B5455F", -"&@ c #B24661", -"*@ c #B04763", -"=@ c #AE4865", -"-@ c #A24F70", -";@ c #A05173", -">@ c #97577D", -",@ c #94587F", -"'@ c #915982", -")@ c #8E5B84", -"!@ c #865F8C", -"~@ c #7C6596", -"{@ c #E51E26", -"]@ c #E0212A", -"^@ c #D32D3A", -"/@ c #CF313E", -"(@ c #CC3241", -"_@ c #C63749", -":@ c #C43A4D", -"<@ c #C23D50", -"[@ c #C03F53", -"}@ c #BE4157", -"|@ c #BC4359", -"1@ c #BA455C", -"2@ c #B8465F", -"3@ c #B64861", -"4@ c #B44964", -"5@ c #B14A66", -"6@ c #AF4B68", -"7@ c #AD4C6A", -"8@ c #AA4D6B", -"9@ c #A74E6D", -"0@ c #A54E6E", -"a@ c #9D5276", -"b@ c #99567B", -"c@ c #96577D", -"d@ c #945980", -"e@ c #925A82", -"f@ c #8F5C84", -"g@ c #8C5C87", -"h@ c #895E89", -"i@ c #83608F", -"j@ c #7E6394", -"k@ c #7A6698", -"l@ c #EA1B20", -"m@ c #E21F28", -"n@ c #DC2530", -"o@ c #D52C37", -"p@ c #D32E3A", -"q@ c #CE313F", -"r@ c #CA3444", -"s@ c #C83646", -"t@ c #C6394A", -"u@ c #C53B4E", -"v@ c #C33E52", -"w@ c #C14155", -"x@ c #BF4358", -"y@ c #BD455C", -"z@ c #BB475F", -"A@ c #B94961", -"B@ c #B74B64", -"C@ c #B54C66", -"D@ c #B34D68", -"E@ c #B04F6B", -"F@ c #AE4F6C", -"G@ c #AC506E", -"H@ c #A95170", -"I@ c #A65272", -"J@ c #A35273", -"K@ c #A05274", -"L@ c #9D5376", -"M@ c #905C85", -"N@ c #8E5E87", -"O@ c #8A5F8A", -"P@ c #87608C", -"Q@ c #84618F", -"R@ c #7E6494", -"S@ c #7A6799", -"T@ c #77689B", -"U@ c #D92832", -"V@ c #D82A35", -"W@ c #C83647", -"X@ c #C6394B", -"Y@ c #C53D4F", -"Z@ c #C33F53", -"`@ c #C14257", -" # c #C0445A", -".# c #BE475D", -"+# c #BC4961", -"@# c #BA4B63", -"## c #B84D66", -"$# c #B64F69", -"%# c #B4506B", -"&# c #B2526D", -"*# c #AF536F", -"=# c #AD5471", -"-# c #AB5473", -";# c #A85574", -"># c #A55576", -",# c #A25678", -"'# c #9F5679", -")# c #9C567A", -"!# c #925B82", -"~# c #8C5F8A", -"{# c #88618D", -"]# c #86628F", -"^# c #826392", -"/# c #7F6494", -"(# c #796799", -"_# c #756A9E", -":# c #D72A35", -"<# c #D52C38", -"[# c #CC3342", -"}# c #C83747", -"|# c #C63A4B", -"1# c #C53D50", -"2# c #C34054", -"3# c #C24358", -"4# c #C0455B", -"5# c #BE485F", -"6# c #BC4B62", -"7# c #BB4D65", -"8# c #B94F68", -"9# c #B7516B", -"0# c #B5536E", -"a# c #B35470", -"b# c #B05672", -"c# c #AE5774", -"d# c #AD5876", -"e# c #AA5878", -"f# c #A75979", -"g# c #A4597A", -"h# c #A15A7C", -"i# c #9E5A7D", -"j# c #9B5A7E", -"k# c #975A80", -"l# c #945A81", -"m# c #915B83", -"n# c #8B5F8A", -"o# c #89618D", -"p# c #86638F", -"q# c #846492", -"r# c #806594", -"s# c #7D6697", -"t# c #77689C", -"u# c #726CA1", -"v# c #C63A4C", -"w# c #C34154", -"x# c #C0465C", -"y# c #BE4960", -"z# c #BD4C64", -"A# c #BB4F67", -"B# c #BA516A", -"C# c #B8536D", -"D# c #B65570", -"E# c #B45772", -"F# c #B25975", -"G# c #B05A77", -"H# c #AD5B79", -"I# c #AC5C7B", -"J# c #A95C7C", -"K# c #A65D7E", -"L# c #A35D7F", -"M# c #A05D80", -"N# c #9D5D81", -"O# c #9A5D82", -"P# c #965D83", -"Q# c #935D85", -"R# c #905D86", -"S# c #8D5E88", -"T# c #826694", -"U# c #7E6797", -"V# c #7B6899", -"W# c #78699C", -"X# c #706DA3", -"Y# c #DF212B", -"Z# c #D62935", -"`# c #C43D50", -" $ c #C34155", -".$ c #C14459", -"+$ c #C0475D", -"@$ c #BF4A61", -"#$ c #BD4D65", -"$$ c #BC5068", -"%$ c #BA536C", -"&$ c #BA5870", -"*$ c #B95C75", -"=$ c #B85E79", -"-$ c #B6607B", -";$ c #B4617D", -">$ c #B2627F", -",$ c #B06380", -"'$ c #AD6280", -")$ c #A96080", -"!$ c #A56082", -"~$ c #A26183", -"{$ c #9F6184", -"]$ c #9C6185", -"^$ c #996186", -"/$ c #956187", -"($ c #926088", -"_$ c #8F6089", -":$ c #8B608B", -"<$ c #866390", -"[$ c #826695", -"}$ c #7F6897", -"|$ c #7D6999", -"1$ c #796A9C", -"2$ c #766B9E", -"3$ c #6F6EA4", -"4$ c #6D6FA6", -"5$ c #DB2531", -"6$ c #D82733", -"7$ c #CE3140", -"8$ c #C93445", -"9$ c #C5394B", -"0$ c #C14359", -"a$ c #BF4B61", -"b$ c #BD4E66", -"c$ c #BC5169", -"d$ c #BC566D", -"e$ c #BC5B74", -"f$ c #B95C77", -"g$ c #B85D78", -"h$ c #B65F79", -"i$ c #B4617C", -"j$ c #B2627E", -"k$ c #AE6483", -"l$ c #AC6686", -"m$ c #AB6888", -"n$ c #A76787", -"o$ c #A26487", -"p$ c #9E6488", -"q$ c #9B6489", -"r$ c #98648A", -"s$ c #94648B", -"t$ c #91638C", -"u$ c #8D638D", -"v$ c #8A638E", -"w$ c #846592", -"x$ c #816695", -"y$ c #7D699A", -"z$ c #7A6B9C", -"A$ c #776C9F", -"B$ c #746DA1", -"C$ c #706EA4", -"D$ c #6B71A9", -"E$ c #DA2531", -"F$ c #D82633", -"G$ c #C43C4F", -"H$ c #C24054", -"I$ c #C14358", -"J$ c #BE4A61", -"K$ c #BC516A", -"L$ c #BD586F", -"M$ c #BB5B76", -"N$ c #BA5C76", -"O$ c #B95F78", -"P$ c #B8617B", -"Q$ c #B6637E", -"R$ c #B56580", -"S$ c #B36783", -"T$ c #B16885", -"U$ c #AF6986", -"V$ c #AC6988", -"W$ c #A96989", -"X$ c #A66A8D", -"Y$ c #A56B8D", -"Z$ c #9E688C", -"`$ c #9A678D", -" % c #96678E", -".% c #93678F", -"+% c #906690", -"@% c #8C6691", -"#% c #886692", -"$% c #846593", -"%% c #786C9F", -"&% c #756EA2", -"*% c #726FA4", -"=% c #6E6FA7", -"-% c #6872AB", -";% c #D62836", -">% c #D32B39", -",% c #D02F3E", -"'% c #C33B4E", -")% c #C23F53", -"!% c #C04358", -"~% c #BF465C", -"{% c #BA5D76", -"]% c #B96079", -"^% c #B9637D", -"/% c #B96680", -"(% c #B96883", -"_% c #B86A86", -":% c #B66C88", -"<% c #B46D8A", -"[% c #B06D8B", -"}% c #AD6D8C", -"|% c #AA6D8D", -"1% c #A66D8E", -"2% c #A26D91", -"3% c #A06E92", -"4% c #996A91", -"5% c #956A91", -"6% c #926992", -"7% c #8F6993", -"8% c #8B6994", -"9% c #876895", -"0% c #826896", -"a% c #7F6898", -"b% c #7C699A", -"c% c #7A6B9D", -"d% c #786D9F", -"e% c #766EA2", -"f% c #7370A4", -"g% c #7070A7", -"h% c #6C71A9", -"i% c #6873AC", -"j% c #6674AE", -"k% c #D32A39", -"l% c #D12D3B", -"m% c #CF2F3E", -"n% c #C13E52", -"o% c #C04256", -"p% c #BE455B", -"q% c #BD4960", -"r% c #BC4D65", -"s% c #BB5069", -"t% c #BB566E", -"u% c #BA6079", -"v% c #BA647E", -"w% c #BB6882", -"x% c #BD6B86", -"y% c #BD6E89", -"z% c #BE708C", -"A% c #BC718E", -"B% c #B9728F", -"C% c #B57290", -"D% c #B07191", -"E% c #AC7191", -"F% c #A67092", -"G% c #A26F93", -"H% c #9E7096", -"I% c #9B7095", -"J% c #946D95", -"K% c #916C96", -"L% c #8D6C96", -"M% c #896B97", -"N% c #856B98", -"O% c #816A99", -"P% c #7D6A9B", -"Q% c #766FA2", -"R% c #7470A4", -"S% c #7172A7", -"T% c #6E72A9", -"U% c #6A73AC", -"V% c #6376B1", -"W% c #D02C3B", -"X% c #CF2E3E", -"Y% c #C03C50", -"Z% c #BF4055", -"`% c #BE445A", -" & c #BC485F", -".& c #BB4C63", -"+& c #BA4F68", -"@& c #BA536D", -"#& c #BB5C75", -"$& c #B95C76", -"%& c #B9607A", -"&& c #BC6882", -"*& c #BF6C87", -"=& c #C1708B", -"-& c #C5778F", -";& c #C97D92", -">& c #C77F94", -",& c #C27C95", -"'& c #BB7896", -")& c #B47696", -"!& c #AE7596", -"~& c #A87496", -"{& c #A27396", -"]& c #9D7297", -"^& c #9B739A", -"/& c #947098", -"(& c #906F99", -"_& c #8C6E9A", -":& c #886E9B", -"<& c #836D9B", -"[& c #7F6D9C", -"}& c #7B6C9D", -"|& c #776D9F", -"1& c #7470A5", -"2& c #6F73AA", -"3& c #6C74AC", -"4& c #6875AE", -"5& c #6476B1", -"6& c #6178B3", -"7& c #D02C3C", -"8& c #CE2E3E", -"9& c #CC3041", -"0& c #C4384A", -"a& c #BD4259", -"b& c #BB465E", -"c& c #BA4A62", -"d& c #B94E67", -"e& c #B8526B", -"f& c #B95870", -"g& c #B95D78", -"h& c #B85F79", -"i& c #C3738C", -"j& c #CD8091", -"k& c #D18695", -"l& c #D18998", -"m& c #D08A9B", -"n& c #CE8A9B", -"o& c #C9879B", -"p& c #BB7D9B", -"q& c #B1799A", -"r& c #AA779A", -"s& c #A37699", -"t& c #9C759A", -"u& c #98749C", -"v& c #95759C", -"w& c #8E719C", -"x& c #8A709D", -"y& c #86709E", -"z& c #826F9F", -"A& c #7D6FA0", -"B& c #796FA1", -"C& c #7370A5", -"D& c #6C75AC", -"E& c #6A76AF", -"F& c #6677B1", -"G& c #6278B4", -"H& c #5E79B6", -"I& c #CE2D3E", -"J& c #CA3243", -"K& c #C83446", -"L& c #C4384B", -"M& c #BF3C50", -"N& c #BB4157", -"O& c #BA445C", -"P& c #B94861", -"Q& c #B84C65", -"R& c #B7506A", -"S& c #B7546F", -"T& c #B85D76", -"U& c #B65E79", -"V& c #B7627C", -"W& c #B96681", -"X& c #BC6B86", -"Y& c #C1718B", -"Z& c #D28897", -"`& c #D991A0", -" * c #DE98A9", -".* c #DE9AAB", -"+* c #D895A6", -"@* c #CE8EA1", -"#* c #C88A9F", -"$* c #B57E9E", -"%* c #AC7A9D", -"&* c #A3789D", -"** c #9C779D", -"=* c #96769E", -"-* c #9578A1", -";* c #8D739F", -">* c #8873A0", -",* c #8472A0", -"'* c #8072A2", -")* c #7B71A3", -"!* c #7771A4", -"~* c #6F74AA", -"{* c #6A77AF", -"]* c #6778B1", -"^* c #6379B4", -"/* c #607AB7", -"(* c #5C7BB9", -"_* c #C93143", -":* c #C63648", -"<* c #BD3D53", -"[* c #B9425A", -"}* c #B74A63", -"|* c #B64E68", -"1* c #B5526D", -"2* c #B55672", -"3* c #B75F7A", -"4* c #B5607B", -"5* c #B6647F", -"6* c #B86984", -"7* c #C5788F", -"8* c #E4A1B2", -"9* c #ECB7C4", -"0* c #ECBAC7", -"a* c #E4A8BA", -"b* c #D898AB", -"c* c #CB8EA3", -"d* c #BC86A2", -"e* c #AD7DA1", -"f* c #A47BA0", -"g* c #9B79A0", -"h* c #9578A0", -"i* c #9379A4", -"j* c #8C76A2", -"k* c #8675A3", -"l* c #8274A3", -"m* c #7E73A4", -"n* c #7973A5", -"o* c #7573A6", -"p* c #7172A8", -"q* c #6E74AA", -"r* c #6C75AD", -"s* c #6878B2", -"t* c #6579B4", -"u* c #617BB7", -"v* c #5D7BB9", -"w* c #597DBC", -"x* c #C73346", -"y* c #C3384B", -"z* c #C23A4E", -"A* c #BA3F55", -"B* c #B84158", -"C* c #B7445D", -"D* c #B64862", -"E* c #B35874", -"F* c #B5617C", -"G* c #B3627D", -"H* c #B46682", -"I* c #B76B87", -"J* c #BD708C", -"K* c #C87E93", -"L* c #D18999", -"M* c #F9E0E6", -"N* c #FAE6EB", -"O* c #EEC2CE", -"P* c #DDA1B5", -"Q* c #CC91A8", -"R* c #C18BA5", -"S* c #AE7FA3", -"T* c #A37DA2", -"U* c #9A7BA2", -"V* c #937AA3", -"W* c #917BA6", -"X* c #8B78A4", -"Y* c #8476A5", -"Z* c #8076A6", -"`* c #7C75A7", -" = c #7775A8", -".= c #7375A9", -"+= c #6778B2", -"@= c #657AB4", -"#= c #627BB7", -"$= c #5F7CB9", -"%= c #5B7DBC", -"&= c #577EBE", -"*= c #C3374B", -"== c #C13A4E", -"-= c #BF3C51", -";= c #BD3E53", -">= c #B6425B", -",= c #B4465F", -"'= c #B34A64", -")= c #B24E69", -"!= c #B2526E", -"~= c #B15672", -"{= c #B15A77", -"]= c #B3627F", -"^= c #B16380", -"/= c #B26784", -"(= c #B66D89", -"_= c #BB728F", -":= c #C77F95", -"<= c #D08B9B", -"[= c #FBEBF0", -"}= c #EEC6D1", -"|= c #DDA2B7", -"1= c #CC93AA", -"2= c #BF8CA7", -"3= c #AC81A6", -"4= c #A17FA5", -"5= c #987DA5", -"6= c #927BA5", -"7= c #8F7CA8", -"8= c #8879A7", -"9= c #8278A8", -"0= c #7E78A9", -"a= c #7977AA", -"b= c #7576AB", -"c= c #7176AC", -"d= c #6C76AD", -"e= c #6977AF", -"f= c #6779B2", -"g= c #627CB7", -"h= c #607DBA", -"i= c #5C7EBC", -"j= c #587FBF", -"k= c #5580C1", -"l= c #C2364B", -"m= c #C0394E", -"n= c #BF3B51", -"o= c #BC3E53", -"p= c #B3435D", -"q= c #B24762", -"r= c #B14B66", -"s= c #AF5370", -"t= c #AE5775", -"u= c #AE5B79", -"v= c #B16381", -"w= c #AF6482", -"x= c #B06986", -"y= c #B36D8B", -"z= c #B87290", -"A= c #C17D96", -"B= c #CE8A9C", -"C= c #D895A7", -"D= c #E5AFC2", -"E= c #D79DB2", -"F= c #C891AA", -"G= c #BA8AA8", -"H= c #A981A7", -"I= c #9F80A7", -"J= c #967EA7", -"K= c #907DA8", -"L= c #8D7EAB", -"M= c #857AA9", -"N= c #8079AA", -"O= c #7B79AB", -"P= c #7778AC", -"Q= c #7378AD", -"R= c #6E78AE", -"S= c #6A77B0", -"T= c #657AB5", -"U= c #607EBA", -"V= c #5D7EBC", -"W= c #5A80BF", -"X= c #5681C1", -"Y= c #5282C4", -"Z= c #BC3D53", -"`= c #B14560", -" - c #AF4864", -".- c #AE4C69", -"+- c #AE506D", -"@- c #AD5472", -"#- c #AD5877", -"$- c #AD6585", -"%- c #AD6988", -"&- c #AF6E8C", -"*- c #B37391", -"=- c #BA7896", -"-- c #C8889C", -";- c #CE8EA2", -">- c #DDA3B7", -",- c #CC95AC", -"'- c #C390AA", -")- c #AF84A9", -"!- c #A481A8", -"~- c #9A80A8", -"{- c #937FA9", -"]- c #8D7DAA", -"^- c #8B7FAD", -"/- c #827BAB", -"(- c #7D7BAC", -"_- c #787AAD", -":- c #757AAE", -"<- c #7079B0", -"[- c #6C79B1", -"}- c #647AB5", -"|- c #627CB8", -"1- c #5D7FBD", -"2- c #5B80BF", -"3- c #5781C1", -"4- c #5382C4", -"5- c #5083C6", -"6- c #BC3A51", -"7- c #BB3C54", -"8- c #BA3E56", -"9- c #B74158", -"0- c #AE4662", -"a- c #AD4966", -"b- c #AC4E6B", -"c- c #AC5270", -"d- c #AB5574", -"e- c #AA5979", -"f- c #AA5D7D", -"g- c #AB6482", -"h- c #AB6788", -"i- c #AB6A89", -"j- c #AC6E8E", -"k- c #AF7292", -"l- c #B37797", -"m- c #BA7E9C", -"n- c #C78AA0", -"o- c #CB8EA4", -"p- c #CC92A8", -"q- c #C892AA", -"r- c #B387AA", -"s- c #A882AA", -"t- c #9E81AA", -"u- c #9580AA", -"v- c #8F7FAA", -"w- c #8A7EAC", -"x- c #8880AD", -"y- c #7E7CAD", -"z- c #7A7CAE", -"A- c #767BB0", -"B- c #727BB1", -"C- c #6D7BB2", -"D- c #697BB3", -"E- c #647BB5", -"F- c #5F7EBA", -"G- c #5B81BF", -"H- c #5882C2", -"I- c #5583C4", -"J- c #5184C7", -"K- c #4D85C9", -"L- c #BC3951", -"M- c #BA3B54", -"N- c #B74059", -"O- c #B3435E", -"P- c #AE4663", -"Q- c #AC4865", -"R- c #AB4B68", -"S- c #AA4F6D", -"T- c #A95372", -"U- c #A85676", -"V- c #A75A7B", -"W- c #A75E7F", -"X- c #A76283", -"Y- c #A96A8A", -"Z- c #A76A8B", -"`- c #A86E8F", -" ; c #AA7293", -".; c #AD7697", -"+; c #B07A9B", -"@; c #B57F9F", -"#; c #BC87A3", -"$; c #C08BA5", -"%; c #BA8AA9", -"&; c #A782AA", -"*; c #9F81AA", -"=; c #9781AB", -"-; c #9180AB", -";; c #8B80AC", -">; c #8981AF", -",; c #827EAE", -"'; c #7B7DAF", -"); c #777DB0", -"!; c #737CB2", -"~; c #6F7CB3", -"{; c #6A7CB4", -"]; c #667CB6", -"^; c #5D80BD", -"/; c #5982C2", -"(; c #5683C4", -"_; c #5284C7", -":; c #4E85C9", -"<; c #4A87CC", -"[; c #B73D56", -"}; c #B63F59", -"|; c #B4425B", -"1; c #A84C6B", -"2; c #A7506F", -"3; c #A65373", -"4; c #A55778", -"5; c #A45B7C", -"6; c #A45E80", -"7; c #A36285", -"8; c #A56889", -"9; c #A56B8F", -"0; c #A46E90", -"a; c #A57193", -"b; c #A77597", -"c; c #A9789B", -"d; c #AB7B9F", -"e; c #AD7EA2", -"f; c #AD80A4", -"g; c #AC81A7", -"h; c #A981A8", -"i; c #A481A9", -"j; c #9D81AA", -"k; c #9281AC", -"l; c #8C80AD", -"m; c #8880AF", -"n; c #8681B0", -"o; c #7C7EB0", -"p; c #787EB1", -"q; c #747EB2", -"r; c #707DB4", -"s; c #6C7DB5", -"t; c #677DB7", -"u; c #627DB8", -"v; c #5F7EBB", -"w; c #5B81C0", -"x; c #5385C7", -"y; c #4F86C9", -"z; c #4B87CC", -"A; c #4789CF", -"B; c #B73D57", -"C; c #B53E59", -"D; c #B3415C", -"E; c #B1435E", -"F; c #A45071", -"G; c #A35475", -"H; c #A25879", -"I; c #A15B7E", -"J; c #A05F82", -"K; c #A06286", -"L; c #9F668A", -"M; c #A26D8F", -"N; c #A06E93", -"O; c #A07195", -"P; c #A07498", -"Q; c #A1779B", -"R; c #A2799E", -"S; c #A37CA1", -"T; c #A27EA4", -"U; c #A17FA6", -"V; c #9E80A8", -"W; c #9981A9", -"X; c #9181AC", -"Y; c #8782B1", -"Z; c #7E7FB1", -"`; c #797FB2", -" > c #757FB3", -".> c #717EB5", -"+> c #6D7EB6", -"@> c #687EB7", -"#> c #647EB9", -"$> c #5783C5", -"%> c #5485C7", -"&> c #5087CA", -"*> c #4C87CC", -"=> c #4889CF", -"-> c #458AD1", -";> c #B53F59", -">> c #B2405C", -",> c #B0425E", -"'> c #AF4461", -")> c #A15173", -"!> c #A05577", -"~> c #9F587B", -"{> c #9E5C7F", -"]> c #9D5F83", -"^> c #9D6387", -"/> c #9C668B", -"(> c #9C698F", -"_> c #9E7094", -":> c #9C7198", -"<> c #9B7399", -"[> c #9B769C", -"}> c #9B789F", -"|> c #9A7AA1", -"1> c #997CA4", -"2> c #977DA6", -"3> c #957FA8", -"4> c #927FAA", -"5> c #8F80AB", -"6> c #8B80AD", -"7> c #8880B0", -"8> c #8682B1", -"9> c #7E80B1", -"0> c #767FB4", -"a> c #727FB5", -"b> c #6D7FB6", -"c> c #697FB8", -"d> c #647FBA", -"e> c #607FBB", -"f> c #5C80BD", -"g> c #5784C5", -"h> c #5187CA", -"i> c #4D88CC", -"j> c #4989CF", -"k> c #458BD2", -"l> c #428CD4", -"m> c #AE4461", -"n> c #AC4663", -"o> c #9C5579", -"p> c #9C597D", -"q> c #9B5C81", -"r> c #9A5F85", -"s> c #996389", -"t> c #98668C", -"u> c #976990", -"v> c #976C93", -"w> c #997197", -"x> c #99759C", -"y> c #96759E", -"z> c #9577A0", -"A> c #9379A2", -"B> c #917CA7", -"C> c #8F7DA9", -"D> c #8C7EAA", -"E> c #897FAD", -"F> c #8881B0", -"G> c #8582B1", -"H> c #7D7FB1", -"I> c #797FB3", -"J> c #757FB4", -"K> c #6E80B7", -"L> c #6A7FB8", -"M> c #6580BA", -"N> c #6180BC", -"O> c #5D80BE", -"P> c #5982C3", -"Q> c #5684C5", -"R> c #5485C8", -"S> c #4E88CC", -"T> c #4A8ACF", -"U> c #468BD2", -"V> c #408ED7", -"W> c #B0425F", -"X> c #AD4361", -"Y> c #AB4564", -"Z> c #A94766", -"`> c #A84969", -" , c #A64C6B", -"., c #99567A", -"+, c #98597E", -"@, c #975C82", -"#, c #966086", -"$, c #95638A", -"%, c #94668E", -"&, c #946991", -"*, c #936C94", -"=, c #926E98", -"-, c #92719A", -";, c #94769E", -">, c #9479A2", -",, c #927AA5", -"', c #8E7DAA", -"), c #8C7FAC", -"!, c #8A80AE", -"~, c #8780AE", -"{, c #817FAF", -"], c #7C7EB1", -"^, c #787FB2", -"/, c #727FB6", -"(, c #6A80B9", -"_, c #6680BA", -":, c #5882C3", -"<, c #5287CA", -"[, c #4E88CD", -"}, c #4B8ACF", -"|, c #478BD2", -"1, c #438CD4", -"2, c #3D8FD9", -"3, c #AD4461", -"4, c #A74969", -"5, c #A54B6B", -"6, c #A44D6E", -"7, c #955980", -"8, c #945D84", -"9, c #936087", -"0, c #92638B", -"a, c #91668F", -"b, c #906992", -"c, c #906C96", -"d, c #8F6E99", -"e, c #8D709C", -"f, c #8C739E", -"g, c #8B75A1", -"h, c #8A77A4", -"i, c #8979A6", -"j, c #877AA8", -"k, c #847BAB", -"l, c #807CAD", -"m, c #7D7DAF", -"n, c #7A7EB1", -"o, c #777EB2", -"p, c #717FB5", -"q, c #6D80B7", -"r, c #6580BB", -"s, c #6181BC", -"t, c #5D81BE", -"u, c #5A81C1", -"v, c #4F89CD", -"w, c #4B8AD0", -"x, c #488BD2", -"y, c #438CD5", -"z, c #3D90D9", -"A, c #3B91DC", -"B, c #A64969", -"C, c #A44A6C", -"D, c #A24C6E", -"E, c #A14E71", -"F, c #9F5173", -"G, c #905D85", -"H, c #906089", -"I, c #8F638C", -"J, c #8E6690", -"K, c #8D6893", -"L, c #8C6B97", -"M, c #8A6E9A", -"N, c #89709D", -"O, c #8872A0", -"P, c #8674A2", -"Q, c #8278A7", -"R, c #8079A9", -"S, c #7E7BAC", -"T, c #7B7CAE", -"U, c #797DB0", -"V, c #767EB2", -"W, c #747EB4", -"X, c #707FB6", -"Y, c #6980B9", -"Z, c #5684C6", -"`, c #5386C8", -" ' c #5187CB", -".' c #4C8AD0", -"+' c #488CD2", -"@' c #448DD5", -"#' c #3D90DA", -"$' c #3B91DD", -"%' c #9E5073", -"&' c #9C5276", -"*' c #98567B", -"=' c #8C608A", -"-' c #8B638E", -";' c #8A6691", -">' c #896894", -",' c #876B98", -"'' c #866D9B", -")' c #85709E", -"!' c #8372A1", -"~' c #7E77A8", -"{' c #7C79AB", -"]' c #797AAD", -"^' c #777BAF", -"/' c #757CB1", -"(' c #727DB3", -"_' c #6F7EB5", -":' c #6C7FB7", -"<' c #6880B9", -"[' c #6181BD", -"}' c #5883C3", -"|' c #4C8BD0", -"1' c #488CD3", -"2' c #458DD5", -"3' c #418ED7", -"4' c #9C4F73", -"5' c #9B5176", -"6' c #995378", -"7' c #98557B", -"8' c #96577E", -"9' c #925B83", -"0' c #89618C", -"a' c #87638F", -"b' c #866692", -"c' c #846896", -"d' c #836B99", -"e' c #826D9C", -"f' c #806F9F", -"g' c #7F72A2", -"h' c #7D73A4", -"i' c #7B75A7", -"j' c #737BB1", -"k' c #707CB3", -"l' c #6D7DB5", -"m' c #6A7EB7", -"n' c #677FB8", -"o' c #6380BB", -"p' c #6080BD", -"q' c #5C81BF", -"r' c #5883C4", -"s' c #5584C6", -"t' c #498CD3", -"u' c #458ED5", -"v' c #418ED8", -"w' c #985279", -"x' c #96547B", -"y' c #95577E", -"z' c #935980", -"A' c #8E5E88", -"B' c #806897", -"C' c #7F6A9A", -"D' c #7D6D9D", -"E' c #7C6FA0", -"F' c #7A71A3", -"G' c #7873A6", -"H' c #7577AB", -"I' c #717AB0", -"J' c #6E7BB2", -"K' c #6B7CB4", -"L' c #697DB6", -"M' c #657EB8", -"N' c #627FBA", -"O' c #5F80BC", -"P' c #5386C9", -"Q' c #5188CB", -"R' c #4E89CE", -"S' c #418FD8", -"T' c #3E90DA", -"U' c #925880", -"V' c #905A83", -"W' c #8F5C85", -"X' c #8B608A", -"Y' c #7B6B9C", -"Z' c #796D9F", -"`' c #776FA1", -" ) c #7671A4", -".) c #7573A7", -"+) c #7375AA", -"@) c #6E78AF", -"#) c #647DB8", -"$) c #5E7FBD", -"%) c #5A81C2", -"&) c #5783C4", -"*) c #5585C6", -"=) c #5088CB", -"-) c #4C8BD1", -";) c #498DD3", -">) c #458ED6", -",) c #8D5B86", -"') c #8B5D88", -")) c #766EA1", -"!) c #756FA3", -"~) c #7271A6", -"{) c #7073A9", -"]) c #6E75AB", -"^) c #6C76AE", -"/) c #6978B0", -"() c #6779B3", -"_) c #5585C7", -":) c #5088CC", -"<) c #4B8BD1", -"[) c #488DD3", -"}) c #3E90DB", -"|) c #8A5C88", -"1) c #885E8B", -"2) c #86608D", -"3) c #856290", -"4) c #836492", -"5) c #6D74AB", -"6) c #6B76AE", -"7) c #6679B3", -"8) c #5286C9", -"9) c #875E8B", -"0) c #855F8D", -"a) c #836290", -"b) c #826493", -"c) c #806595", -"d) c #7E6898", -"e) c #7271A7", -"f) c #6F73A9", -"g) c #6D75AC", -"h) c #6878B1", -"i) c #4D8ACE", -"j) c #4A8BD1", -"k) c #478DD4", -"l) c #448ED6", -"m) c #418FD9", -"n) c #3D91DB", -"o) c #826190", -"p) c #806393", -"q) c #7E6595", -"r) c #7C6798", -"s) c #7B699A", -"t) c #796A9D", -"u) c #647BB6", -"v) c #617CB8", -"w) c #4F88CC", -"x) c #4D8ACF", -"y) c #438ED6", -"z) c #408FD9", -"A) c #7D6595", -"B) c #79689A", -"C) c #776A9D", -"D) c #766C9F", -"E) c #746DA2", -"F) c #7071A7", -"G) c #6E73AA", -"H) c #6A76AE", -"I) c #617DB8", -"J) c #5C80BE", -"K) c #4C8ACF", -"L) c #498BD2", -"M) c #468DD4", -"N) c #438ED7", -"O) c #3F8FD9", -"P) c #3C91DB", -"Q) c #91567F", -"R) c #8F5882", -"S) c #816190", -"T) c #7D6596", -"U) c #78689B", -"V) c #76699D", -"W) c #746BA0", -"X) c #726CA2", -"Y) c #706FA4", -"Z) c #6E71A7", -"`) c #6D72AA", -" ! c #6B74AC", -".! c #6976AF", -"+! c #6777B1", -"@! c #637BB6", -"#! c #5E7EBB", -"$! c #5C7FBE", -"%! c #5A81C0", -"&! c #5584C5", -"*! c #5385C8", -"=! c #4D88CD", -"-! c #458CD4", -";! c #3C91DC", -">! c #8A5B87", -",! c #75699D", -"'! c #736BA0", -")! c #716DA2", -"!! c #6F6EA5", -"~! c #6C70A7", -"{! c #6B71AA", -"]! c #6973AC", -"^! c #6775AF", -"/! c #6577B1", -"(! c #617AB6", -"_! c #5D7EBB", -":! c #5B7FBE", -" , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g ", -". . . . . h i j k % l * = - m > n ' o ! p { q r s t u v < w } x y 2 z 4 5 6 7 8 A 0 B C c d e f D E ", -". . . . h F j k % G * H - m > n I J K p L M N s O P Q R S T U V W X 4 Y Z 7 ` A .B C c ..+.@.D E #.", -". . . $.F j k %.&.*.H =.m -.n ;.>.K ,.'.).!.~.{.].^.R /.(._.:.<.[.}.|.1.7 2.A 3.4.5.6...+.@.7.8.#.9.", -". . 0.F a.b.c.&.d.H e.f.-.g.h.>.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.A 3.4.5.D...+.E.7.F.#.9.G.", -"H.0.I.a.J.c.&.K.L.e.f.-.g.M.N.i.O.k.P.Q.n.o.p.q.R.s.S.u.T.w.x.y.U.V.W.X.Y.Z.`.5.D... +.+++F.@+9.G.#+", -"0.$+%+&+c.&.K.L.*+=+-+;+M.N.>+O.,+'+Q.)+o.!+q.~+s.S.{+]+w.^+/+U.V.(+_+:+<+[+}+|+1+2+.+++F.3+9.4+#+5+", -"$+%+&+6+7+K.L.*+8+-+;+M.9+>+O.,+'+Q.)+0+!+q.~+s.S.{+]+a+b+/+U.c+d+_+:+e+f+g+h+i+j+.+++k+3+9.l+m+5+n+", -"o+&+p+7+q+r+s+8+, ;+M.t+u+O.v+'+w+x+0+y+q.~+z+A+B+]+C+D+/+E+F+d+G+:+H+f+g+I+J+K+L+M+N+O+P+l+m+Q+R+S+", -"&+& 7+T+r+s+8+, U+V+W+u+X+v+'+w+Y+Z+y+`+ @.@+@@@#@$@%@&@*@=@d+G+:+H+-@;@h+J+K+>@,@'@)@P+l+!@Q+R+S+~@", -"& 7+T+{@s+]@, ;+V+W+u+^@v+/@(@Y+Z+_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@-@;@a@J+b@c@d@e@f@g@h@!@i@R+j@~@k@", -"l@T+{@m@> , n@V+W+o@p@v+q@(@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@J+b@c@d@e@M@N@O@P@Q@R+R@~@S@T@", -"T+{@; > , I U@V@o@p@v+q@(@r@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#b@c@d@!#M@N@~#{#]#^#/#~@(#T@_#", -"- m > , I U@:#<#p@).q@[#r@}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#M@N@n#o#p#q#r#s#(#t#_#u#", -"m > n I J :#<#p@l.q@[#{.W@v#1#w#3#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#n#o#p#q#T#U#V#W#_#u#X#", -"Y#n I J Z#<#k.l.q@n.{.W@v#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$/$($_$:${#<$q#[$}$|$1$2$u#3$4$", -"n 5$6$Z#,.k.l.7$n.8$p.9$`#w#0$+$a$b$c$d$e$f$g$h$i$j$,$k$l$m$n$o$p$q$r$s$t$u$v$<$w$x$}$y$z$A$B$C$4$D$", -"E$F$K ,.'.l.m.n.o.p.q.G$H$I$+$J$b$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%x$}$y$z$%%&%*%=%D$-%", -"6$;%>%'.,%Q.)+o.p.q.'%)%!%~%J$#$c$L$M${%]%^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%", -";%k%l%m%m.)+o.!+q.R.n%o%p%q%r%s%t%M${%u%v%w%x%y%z%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%c%d%Q%R%S%T%U%j%V%", -"k%W%X%m.)+0+!+q.~+Y%Z%`% &.&+&@&#&$&%&v%&&*&=&-&;&>&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&Q%1&S%2&3&4&5&6&", -"7&8&9&x+Z+y+0&~+z++@a&b&c&d&e&f&g&h&^%w%*&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z&A&B&Q%C&S%2&D&E&F&G&H&", -"I&9&J&K&y+L&~+M&A+N&O&P&Q&R&S&T&U&V&W&X&Y&j&Z&`& *.*+*@*#*$*%*&***=*-*;*>*,*'*)*!*1&S%~*D&{*]*^*/*(*", -"/ _*K&:*L&~+M&<*B+[*2@}*|*1*2*3*4*5*6*y%7*k&`&8*9*0*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*{*s*t*u*v*w*", -"( x*Q y*z*M&<*A*B*C*D*C@%#a#E*F*G*H*I*J*K*L* *9*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=~*r*{*+=@=#=$=%=&=", -"_ v *===-=;=A*B*>=,='=)=!=~={=]=^=/=(=_=:=<=.*0*N*[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=d=e=f=@=g=h=i=j=k=", -": l=m=n=o=v.B*>=p=q=r=E@s=t=u=v=w=x=y=z=A=B=C=a*O*}=D=E=F=G=H=I=J=K=L=M=N=O=P=Q=R=S=f=T=g=U=V=W=X=Y=", -"< w (.Z=v.B*x.p=`= -.-+-@-#-I#w=$-%-&-*-=---;-b*P*>-E=,-'-)-!-~-{-]-^-/-(-_-:-<-[-f=}-|-U=1-2-3-4-5-", -"w 6-7-8-9-x.p=`=0-a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-1=q-'-r-s-t-u-v-w-x-y-z-A-B-C-D-E-|-F-1-G-H-I-J-K-", -"L-M-:.N-x.O-z.P-Q-R-S-T-U-V-W-X-Y-Z-`- ;.;+;@;#;$;2=%;)-&;*;=;-;;;>;,;';);!;~;{;];|-F-^;G-/;(;_;:;<;", -"M-[;};|;O-z.P-(+_+1;2;3;4;5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;=;k;l;m;n;o;p;q;r;s;t;u;v;^;w;/;(;x;y;z;A;", -"B;C;D;E;z.V.(+_+1;e+F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;u-X;l;m;Y;Z;`; >.>+>@>#>v;^;w;/;$>%>&>*>=>->", -";>>>,>'>V.d+_+:+e+f+)>!>~>{>]>^>/>(>_>:><>[>}>|>1>2>3>4>5>6>7>8>9>`;0>a>b>c>d>e>f>w;/;g>%>h>i>j>k>l>", -">>,>m>n>W.G+:+e+f+g+I+o>p>q>r>s>t>u>v>w>x>y>z>A>6=B>C>D>E>F>G>H>I>J>a>K>L>M>N>O>w;P>Q>R>h>S>T>U>l>V>", -"W>X>Y>Z>`> ,H+-@;@I+J+.,+,@,#,$,%,&,*,=,-,;,>,,,7=',),!,~,{,],^,J>/,K>(,_,N>O>w;:,Q>R><,[,},|,1,V>2,", -"3,Y>8 4,5,6,-@;@I+J+b@c@7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,J>p,q,(,r,s,t,u,:,Q>R>h>v,w,x,y,V>z,A,", -"Y>8 B,C,D,E,F,h+J+b@c@d@e@G,H,I,J,K,L,M,N,O,P,Y*Q,R,S,T,U,V,W,X,q,Y,r,s,t,u,:,Z,`, 'v,.'+'@'V>#'A,$'", -"8 B,0 a b %'&'J+*'c@d@e@M@N@='-';'>',''')'!'l*Z*~'{']'^'/'('_':'<'r,['t,u,}'Z,`, 'v,|'1'2'3'#'A,$'$'", -"9 0 a b 4'5'6'7'8'd@9'M@N@n#0'a'b'c'd'e'f'g'h'i'a=P=:-j'k'l'm'n'o'p'q'u,r's'`, 'v,|'t'u'v'#'A,$'$'$'", -"0 B C c d w'x'y'z'm#M@A'n#o#a'q#T#B'C'D'E'F'G' =H'Q=I'J'K'L'M'N'O'q'u,r's'P'Q'R'|'t'u'S'T'$'$'$'$'$'", -"B C c d e @.D U'V'W'S#X'o#p#q#T#}$|$Y'Z'`' ).)+)c=@)[-D-];#)U=$)G-%)&)*)P'=)R'-);)>)S'T'$'$'$'$'$'$'", -"5.c d +.@.7.8.#.,)')O@{#p#w$x$}$y$Y'%%))!)~){)])^)/)()E-g=F-1-G-/;&)_)P':)R'<)[)>)S'})$'$'$'$'$'$'$'", -"6...+.@.7.F.#.9.|)1)2)3)4)x$}$y$z$%%))R%~){)5)6)/)7)E-|-F-^;G-/;&)_)8):)R'<)[)>)S'})$'$'$'$'$'$'$'$'", -"..+..+++F.@+9.G.9)0)a)b)c)d)b%z$d%))R%e)f)g)6)h)7)E-|-v;^;w;/;$>_)8):)i)j)k)l)m)n)$'$'$'$'$'$'$'$'$'", -"+..+++F.3+9.4+#+5+o)p)q)r)s)t)A$&%R%S%f)g)6)h)7)u)v)v;^;w;/;$>%><,w)x)j)k)y)z)n)$'$'$'$'$'$'$'$'$'$'", -".+++k+3+9.l+#+5+o)S+A)k@B)C)D)E)*%F)G)g)H)h)7)u)I)v;J)w;/;Q>%>h>w)K)L)M)N)O)P)$'$'$'$'$'$'$'$'$'$'$'", -"Q)R)O+P+l+#+5+S)S+T)k@U)V)W)X)Y)Z)`) !.!+!t*@!v)#!$!%!:,&!*!&>=!},x,-!3'O);!$'$'$'$'$'$'$'$'$'$'$'$'", -"R)O+>!l+m+Q+R+S+~@k@U),!'!)!!!~!{!]!^!/!^*(!$=_!:!U>1,3'3!;!$'$'$'$'$'$'$'$'$'$'$'$'$'", -"4!>!l+!@Q+R+j@~@5!U)6!'!)!7!8!9!0!a!V%b!c!v*%=d!e!f!g!h!i!j!=>k>k!V>#'A,$'$'$'$'$'$'$'$'$'$'$'$'$'$'", -"l!m!n!Q+R+R@~@S@T@_#'!X#7!8!9!0!a!o!p!q!(*w*&=k=r!5-s!t!u!v!w!k!x!#'A,$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'"}; diff --git a/ext/gd/tests/gif2gd.phpt b/ext/gd/tests/gif2gd.phpt deleted file mode 100644 index 75291777d8b50..0000000000000 --- a/ext/gd/tests/gif2gd.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -gif --> gd1/gd2 conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -GIF to GD1 conversion: ok -GIF to GD2 conversion: ok diff --git a/ext/gd/tests/gif2jpg.phpt b/ext/gd/tests/gif2jpg.phpt deleted file mode 100644 index efea3525cfe9b..0000000000000 --- a/ext/gd/tests/gif2jpg.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -gif --> jpeg conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -GIF to JPEG conversion: ok diff --git a/ext/gd/tests/gif2png.phpt b/ext/gd/tests/gif2png.phpt deleted file mode 100644 index 6ac99bb22fa46..0000000000000 --- a/ext/gd/tests/gif2png.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -gif --> png conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -GIF to PNG conversion: ok diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt deleted file mode 100644 index 9857b53a00789..0000000000000 --- a/ext/gd/tests/imagefilter.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -imagefilter() function test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -IMG_FILTER_NEGATE success -IMG_FILTER_GRAYSCALE success -IMG_FILTER_EDGEDETECT success -IMG_FILTER_GAUSSIAN_BLUR success -IMG_FILTER_SELECTIVE_BLUR success -IMG_FILTER_EMBOSS success -IMG_FILTER_MEAN_REMOVAL success -IMG_FILTER_SMOOTH success -IMG_FILTER_COLORIZE success -IMG_FILTER_CONTRAST success -IMG_FILTER_BRIGHTNESS success diff --git a/ext/gd/tests/imagefttext.phpt b/ext/gd/tests/imagefttext.phpt deleted file mode 100644 index 16e0495ef034d..0000000000000 --- a/ext/gd/tests/imagefttext.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -imagefttext() function test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) diff --git a/ext/gd/tests/jpeg2png.phpt b/ext/gd/tests/jpeg2png.phpt deleted file mode 100644 index c86cb4fe4a8a2..0000000000000 --- a/ext/gd/tests/jpeg2png.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -jpeg <--> png conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -PNG to JPEG conversion: ok -Generated JPEG to PNG conversion: ok -JPEG to PNG conversion: ok -Generated PNG to JPEG conversion: ok diff --git a/ext/gd/tests/jpg2gd.phpt b/ext/gd/tests/jpg2gd.phpt deleted file mode 100644 index 24d1940faf3c0..0000000000000 --- a/ext/gd/tests/jpg2gd.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -jpeg <--> gd1/gd2 conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -JPEG to GD1 conversion: ok -JPEG to GD2 conversion: ok -GD1 to JPEG conversion: ok -GD2 to JPEG conversion: ok diff --git a/ext/gd/tests/png2gd.phpt b/ext/gd/tests/png2gd.phpt deleted file mode 100644 index d74e888d6c156..0000000000000 --- a/ext/gd/tests/png2gd.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -png <--> gd1/gd2 conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -PNG to GD1 conversion: ok -PNG to GD2 conversion: ok -GD1 to PNG conversion: ok -GD2 to PNG conversion: ok diff --git a/ext/gd/tests/test.png b/ext/gd/tests/test.png deleted file mode 100644 index 27c5d46444419..0000000000000 Binary files a/ext/gd/tests/test.png and /dev/null differ diff --git a/ext/gd/tests/test8859.ttf b/ext/gd/tests/test8859.ttf deleted file mode 100644 index dff237cd295c5..0000000000000 Binary files a/ext/gd/tests/test8859.ttf and /dev/null differ diff --git a/ext/gd/tests/xbm2png.phpt b/ext/gd/tests/xbm2png.phpt deleted file mode 100644 index 6edebc0b8d563..0000000000000 --- a/ext/gd/tests/xbm2png.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -xbm --> png conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -XBM to PNG conversion: ok diff --git a/ext/gd/tests/xpm2gd.phpt b/ext/gd/tests/xpm2gd.phpt deleted file mode 100644 index 9c6cca4eb9ad8..0000000000000 --- a/ext/gd/tests/xpm2gd.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -xpm --> gd1/gd2 conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -XPM to GD1 conversion: ok -XPM to GD2 conversion: ok diff --git a/ext/gd/tests/xpm2jpg.phpt b/ext/gd/tests/xpm2jpg.phpt deleted file mode 100644 index 3df491ce44eff..0000000000000 --- a/ext/gd/tests/xpm2jpg.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -xpm --> jpeg conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -XPM to JPEG conversion: ok diff --git a/ext/gd/tests/xpm2png.phpt b/ext/gd/tests/xpm2png.phpt deleted file mode 100644 index 520cc3da0a74d..0000000000000 --- a/ext/gd/tests/xpm2png.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -xpm --> png conversion test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -XPM to PNG conversion: ok diff --git a/ext/gettext/CREDITS b/ext/gettext/CREDITS deleted file mode 100644 index acaebd7fae5fd..0000000000000 --- a/ext/gettext/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GetText -Alex Plotnick diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 deleted file mode 100644 index 02d436c6e760b..0000000000000 --- a/ext/gettext/config.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(gettext,for GNU gettext support, -[ --with-gettext[=DIR] Include GNU gettext support]) - -if test "$PHP_GETTEXT" != "no"; then - for i in $PHP_GETTEXT /usr/local /usr; do - test -r $i/include/libintl.h && GETTEXT_DIR=$i && break - done - - if test -z "$GETTEXT_DIR"; then - AC_MSG_ERROR(Cannot locate header file libintl.h) - fi - - GETTEXT_LIBDIR=$GETTEXT_DIR/$PHP_LIBDIR - GETTEXT_INCDIR=$GETTEXT_DIR/include - - O_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" - AC_CHECK_LIB(intl, bindtextdomain, [ - GETTEXT_LIBS=intl - GETTEXT_CHECK_IN_LIB=intl - ], - AC_CHECK_LIB(c, bindtextdomain, [ - GETTEXT_LIBS= - GETTEXT_CHECK_IN_LIB=c - ],[ - AC_MSG_ERROR(Unable to find required gettext library) - ]) - ) - LDFLAGS=$O_LDFLAGS - - AC_DEFINE(HAVE_LIBINTL,1,[ ]) - PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared) - PHP_SUBST(GETTEXT_SHARED_LIBADD) - - if test -n "$GETTEXT_LIBS"; then - PHP_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD) - fi - - PHP_ADD_INCLUDE($GETTEXT_INCDIR) - - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])]) - -fi diff --git a/ext/gettext/config.w32 b/ext/gettext/config.w32 deleted file mode 100644 index b2c0c5ee28d4a..0000000000000 --- a/ext/gettext/config.w32 +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("gettext", "gettext support", "no"); - -if (PHP_GETTEXT != "no") { - if (CHECK_LIB("libintl.lib", "gettext", PHP_GETTEXT) && CHECK_HEADER_ADD_INCLUDE("libintl.h", "CFLAGS_GETTEXT")) { - EXTENSION("gettext", "gettext.c", PHP_GETTEXT_SHARED, "-DHAVE_BIND_TEXTDOMAIN_CODESET=1 -DHAVE_DNGETTEXT=1 -DHAVE_NGETTEXT=1 -DHAVE_LIBINTL=1"); - } else { - WARNING("gettext not enabled; libraries and headers not found"); - } -} diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c deleted file mode 100644 index d47a0f6315baf..0000000000000 --- a/ext/gettext/gettext.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Alex Plotnick | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_LIBINTL - -#include -#include "ext/standard/info.h" -#include "php_gettext.h" - -/* {{{ php_gettext_functions[] - */ -function_entry php_gettext_functions[] = { - PHP_NAMED_FE(textdomain, zif_textdomain, NULL) - PHP_NAMED_FE(gettext, zif_gettext, NULL) - /* Alias for gettext() */ - PHP_NAMED_FE(_, zif_gettext, NULL) - PHP_NAMED_FE(dgettext, zif_dgettext, NULL) - PHP_NAMED_FE(dcgettext, zif_dcgettext, NULL) - PHP_NAMED_FE(bindtextdomain, zif_bindtextdomain, NULL) -#if HAVE_NGETTEXT - PHP_NAMED_FE(ngettext, zif_ngettext, NULL) -#endif -#if HAVE_DNGETTEXT - PHP_NAMED_FE(dngettext, zif_dngettext, NULL) -#endif -#if HAVE_DCNGETTEXT - PHP_NAMED_FE(dcngettext, zif_dcngettext, NULL) -#endif -#if HAVE_BIND_TEXTDOMAIN_CODESET - PHP_NAMED_FE(bind_textdomain_codeset, zif_bind_textdomain_codeset, NULL) -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -#include - -zend_module_entry php_gettext_module_entry = { - STANDARD_MODULE_HEADER, - "gettext", - php_gettext_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(php_gettext), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_GETTEXT -ZEND_GET_MODULE(php_gettext) -#endif - -PHP_MINFO_FUNCTION(php_gettext) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "GetText Support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto string textdomain(string domain) - Set the textdomain to "domain". Returns the current domain */ -PHP_NAMED_FUNCTION(zif_textdomain) -{ - zval **domain; - char *domain_name, *retval; - char *val; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain); - - val = Z_STRVAL_PP(domain); - if (strcmp(val, "") && strcmp(val, "0")) { - domain_name = val; - } else { - domain_name = NULL; - } - - retval = textdomain(domain_name); - - RETURN_STRING(retval, 1); -} -/* }}} */ - -/* {{{ proto string gettext(string msgid) - Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */ -PHP_NAMED_FUNCTION(zif_gettext) -{ - zval **msgid; - char *msgstr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(msgid); - - msgstr = gettext(Z_STRVAL_PP(msgid)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string dgettext(string domain_name, string msgid) - Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */ -PHP_NAMED_FUNCTION(zif_dgettext) -{ - zval **domain_name, **msgid; - char *msgstr; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &msgid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(msgid); - - msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string dcgettext(string domain_name, string msgid, long category) - Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */ -PHP_NAMED_FUNCTION(zif_dcgettext) -{ - zval **domain_name, **msgid, **category; - char *msgstr; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &domain_name, &msgid, &category) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(msgid); - convert_to_long_ex(category); - - msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string bindtextdomain(string domain_name, string dir) - Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */ -PHP_NAMED_FUNCTION(zif_bindtextdomain) -{ - zval **domain_name, **dir; - char *retval, dir_name[MAXPATHLEN]; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &dir) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(dir); - - if (Z_STRVAL_PP(domain_name)[0] == '\0') { - php_error(E_WARNING, "The first parameter of bindtextdomain must not be empty"); - RETURN_FALSE; - } - - if (Z_STRVAL_PP(dir)[0] != '\0' && strcmp(Z_STRVAL_PP(dir), "0")) { - VCWD_REALPATH(Z_STRVAL_PP(dir), dir_name); - } else { - VCWD_GETCWD(dir_name, MAXPATHLEN); - } - - retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name); - - RETURN_STRING(retval, 1); -} -/* }}} */ - -#if HAVE_NGETTEXT -/* {{{ proto string ngettext(string MSGID1, string MSGID2, int N) - Plural version of gettext() */ -PHP_NAMED_FUNCTION(zif_ngettext) -{ - zval **msgid1, **msgid2, **count; - char *msgstr; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &msgid1, &msgid2, &count) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - - msgstr = ngettext(Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); - if (msgstr) { - RETVAL_STRING (msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_DNGETTEXT -/* {{{ proto string dngettext (string domain, string msgid1, string msgid2, int count) - Plural version of dgettext() */ -PHP_NAMED_FUNCTION(zif_dngettext) -{ - zval **domain, **msgid1, **msgid2, **count; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - char *msgstr; - - convert_to_string_ex(domain); - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - - msgstr = dngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); - if (msgstr) { - RETVAL_STRING(msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_DCNGETTEXT -/* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, int n, int category) - Plural version of dcgettext() */ -PHP_NAMED_FUNCTION(zif_dcngettext) -{ - zval **domain, **msgid1, **msgid2, **count, **category; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count, &category) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - char* msgstr = NULL; - - convert_to_string_ex(domain); - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - convert_to_long_ex(category); - - msgstr = dcngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count), Z_LVAL_PP(category)); - - if (msgstr) { - RETVAL_STRING(msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_BIND_TEXTDOMAIN_CODESET - -/* {{{ proto string bind_textdomain_codeset (string domain, string codeset) - Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */ -PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset) -{ - zval **domain, **codeset; - char *retval; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain, &codeset) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - convert_to_string_ex(domain); - convert_to_string_ex(codeset); - - retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset)); - - if (!retval) { - RETURN_FALSE; - } - RETURN_STRING(retval, 1); - } -} -/* }}} */ -#endif - - -#endif /* HAVE_LIBINTL */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ - diff --git a/ext/gettext/gettext.dsp b/ext/gettext/gettext.dsp deleted file mode 100644 index 79ea194854ca0..0000000000000 --- a/ext/gettext/gettext.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gettext" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=gettext - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "gettext.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "gettext.mak" CFG="gettext - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "gettext - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gettext - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "gettext - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php5ts.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "gettext - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS" -# ADD LINK32 php5ts_debug.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "gettext - Win32 Release_TS" -# Name "gettext - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\gettext.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_gettext.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h deleted file mode 100644 index bfbc832241fa6..0000000000000 --- a/ext/gettext/php_gettext.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Alex Plotnick | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GETTEXT_H -#define PHP_GETTEXT_H - -#if HAVE_LIBINTL - -extern zend_module_entry php_gettext_module_entry; -#define gettext_module_ptr &php_gettext_module_entry - -PHP_MINFO_FUNCTION(php_gettext); - -PHP_NAMED_FUNCTION(zif_textdomain); -PHP_NAMED_FUNCTION(zif_gettext); -PHP_NAMED_FUNCTION(zif_dgettext); -PHP_NAMED_FUNCTION(zif_dcgettext); -PHP_NAMED_FUNCTION(zif_bindtextdomain); -#if HAVE_NGETTEXT -PHP_NAMED_FUNCTION(zif_ngettext); -#endif -#if HAVE_DNGETTEXT -PHP_NAMED_FUNCTION(zif_dngettext); -#endif -#if HAVE_DCNGETTEXT -PHP_NAMED_FUNCTION(zif_dcngettext); -#endif -#if HAVE_BIND_TEXTDOMAIN_CODESET -PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset); -#endif - -#else -#define gettext_module_ptr NULL -#endif /* HAVE_LIBINTL */ - -#define phpext_gettext_ptr gettext_module_ptr - -#endif /* PHP_GETTEXT_H */ diff --git a/ext/gettext/tests/gettext_basic.phpt b/ext/gettext/tests/gettext_basic.phpt deleted file mode 100644 index 441ca57a8348c..0000000000000 --- a/ext/gettext/tests/gettext_basic.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Gettext basic test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Perustesti -Perustesti diff --git a/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.mo b/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.mo deleted file mode 100644 index 55f4d1a341c78..0000000000000 Binary files a/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.mo and /dev/null differ diff --git a/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.po b/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.po deleted file mode 100644 index 3505156f74405..0000000000000 --- a/ext/gettext/tests/locale/fi/LC_MESSAGES/messages.po +++ /dev/null @@ -1,15 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: gettext_basic.phpt:11 -msgid "Basic test" -msgstr "Perustesti" diff --git a/ext/gmp/CREDITS b/ext/gmp/CREDITS deleted file mode 100644 index 7e0346dc2487c..0000000000000 --- a/ext/gmp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GNU GMP support -Stanislav Malyshev diff --git a/ext/gmp/README b/ext/gmp/README deleted file mode 100644 index e142e2e0313d6..0000000000000 --- a/ext/gmp/README +++ /dev/null @@ -1,5 +0,0 @@ -Arbitrary length number support with GNU MP library. -Please see the PGP manual for more documentation. -See also GNU MP home page at http://www.swox.com/gmp/. -GNU MP library is available under the tems of GNU LGPL -license. Please see http://www.swox.com/gmp/lgpl.html diff --git a/ext/gmp/TODO b/ext/gmp/TODO deleted file mode 100644 index 81098a9cc1b69..0000000000000 --- a/ext/gmp/TODO +++ /dev/null @@ -1,22 +0,0 @@ -mpz_mul_2exp -mpz_[ft]div_[qr]_2exp - -V 3: -mpz_nextprime -mpz_addmul -mpz_root -mpz_perfect_power_p -mpz_lcm -mpz_si_kronecker -mpz_kronecker_si -mpz_remove -mpz_bin_ui -mpz_fib_ui -mpz_cmpabs -mpz_xor -mpz_tstbit -mpz_urandom[bm] -mpz_fits_slong_p -mpz_mul_si -mpz_odd_p -mpz_even_p diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 deleted file mode 100644 index 9606b2f56d4d4..0000000000000 --- a/ext/gmp/config.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(gmp, for GNU MP support, -[ --with-gmp[=DIR] Include GNU MP support]) - -if test "$PHP_GMP" != "no"; then - - for i in $PHP_GMP /usr/local /usr; do - test -f $i/include/gmp.h && GMP_DIR=$i && break - done - - if test -z "$GMP_DIR"; then - AC_MSG_ERROR(Unable to locate gmp.h) - fi - - PHP_CHECK_LIBRARY(gmp, __gmp_randinit_lc_2exp_size, - [],[ - PHP_CHECK_LIBRARY(gmp, gmp_randinit_lc_2exp_size, - [],[ - AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.]) - ],[ - -L$GMP_DIR/$PHP_LIBDIR - ]) - ],[ - -L$GMP_DIR/$PHP_LIBDIR - ]) - - PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD) - PHP_ADD_INCLUDE($GMP_DIR/include) - - PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared) - PHP_SUBST(GMP_SHARED_LIBADD) - AC_DEFINE(HAVE_GMP, 1, [ ]) -fi diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32 deleted file mode 100644 index 2aff16b77bb05..0000000000000 --- a/ext/gmp/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("gmp", "Include GNU MP support.", "no"); - -if (PHP_GMP != "no") { - if (CHECK_LIB("libgmp_a.lib", "gmp", PHP_GMP) && - CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP)) { - EXTENSION("gmp", "gmp.c"); - AC_DEFINE('HAVE_GMP', 1, 'GMP support'); - } else { - WARNING("GMP not enabled; libraries and headers not found"); - } -} diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c deleted file mode 100644 index d72a2d9828c43..0000000000000 --- a/ext/gmp/gmp.c +++ /dev/null @@ -1,1379 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stanislav Malyshev | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_gmp.h" -#include "ext/standard/info.h" - -#if HAVE_GMP - -#include - -/* Needed for gmp_random() */ -#include "ext/standard/php_rand.h" -#include "ext/standard/php_lcg.h" -#define GMP_ABS(x) ((x) >= 0 ? (x) : -(x)) - -/* True global resources - no need for thread safety here */ -static int le_gmp; - -/* {{{ gmp_functions[] - */ -function_entry gmp_functions[] = { - ZEND_FE(gmp_init, NULL) - ZEND_FE(gmp_intval, NULL) - ZEND_FE(gmp_strval, NULL) - ZEND_FE(gmp_add, NULL) - ZEND_FE(gmp_sub, NULL) - ZEND_FE(gmp_mul, NULL) - ZEND_FE(gmp_div_qr, NULL) - ZEND_FE(gmp_div_q, NULL) - ZEND_FE(gmp_div_r, NULL) - ZEND_FALIAS(gmp_div, gmp_div_q, NULL) - ZEND_FE(gmp_mod, NULL) - ZEND_FE(gmp_divexact, NULL) - ZEND_FE(gmp_neg, NULL) - ZEND_FE(gmp_abs, NULL) - ZEND_FE(gmp_fact, NULL) - ZEND_FE(gmp_sqrt, NULL) - ZEND_FE(gmp_sqrtrem, NULL) - ZEND_FE(gmp_pow, NULL) - ZEND_FE(gmp_powm, NULL) - ZEND_FE(gmp_perfect_square, NULL) - ZEND_FE(gmp_prob_prime, NULL) - ZEND_FE(gmp_gcd, NULL) - ZEND_FE(gmp_gcdext, NULL) - ZEND_FE(gmp_invert, NULL) - ZEND_FE(gmp_jacobi, NULL) - ZEND_FE(gmp_legendre, NULL) - ZEND_FE(gmp_cmp, NULL) - ZEND_FE(gmp_sign, NULL) - ZEND_FE(gmp_random, NULL) - ZEND_FE(gmp_and, NULL) - ZEND_FE(gmp_or, NULL) - ZEND_FE(gmp_com, NULL) - ZEND_FE(gmp_xor, NULL) - ZEND_FE(gmp_setbit, first_arg_force_ref) - ZEND_FE(gmp_clrbit, first_arg_force_ref) - ZEND_FE(gmp_scan0, NULL) - ZEND_FE(gmp_scan1, NULL) - ZEND_FE(gmp_popcount, NULL) - ZEND_FE(gmp_hamdist, NULL) - {NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */ -}; -/* }}} */ - -/* {{{ gmp_module_entry - */ -zend_module_entry gmp_module_entry = { - STANDARD_MODULE_HEADER, - "gmp", - gmp_functions, - ZEND_MODULE_STARTUP_N(gmp), - ZEND_MODULE_SHUTDOWN_N(gmp), - NULL, - ZEND_MODULE_DEACTIVATE_N(gmp), - ZEND_MODULE_INFO_N(gmp), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(gmp) - -#ifdef COMPILE_DL_GMP -ZEND_GET_MODULE(gmp) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#define GMP_RESOURCE_NAME "GMP integer" - -#define GMP_ROUND_ZERO 0 -#define GMP_ROUND_PLUSINF 1 -#define GMP_ROUND_MINUSINF 2 - -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - -/* {{{ php_gmp_init_globals - */ -static void php_gmp_init_globals(zend_gmp_globals *gmp_globals) -{ - gmp_globals->rand_initialized = 0; -} -/* }}} */ - -/* {{{ ZEND_MINIT_FUNCTION - */ -ZEND_MODULE_STARTUP_D(gmp) -{ - ZEND_INIT_MODULE_GLOBALS(gmp, php_gmp_init_globals, NULL); - - le_gmp = zend_register_list_destructors_ex(_php_gmpnum_free, NULL, GMP_RESOURCE_NAME, module_number); - REGISTER_LONG_CONSTANT("GMP_ROUND_ZERO", GMP_ROUND_ZERO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GMP_ROUND_PLUSINF", GMP_ROUND_PLUSINF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GMP_ROUND_MINUSINF", GMP_ROUND_MINUSINF, CONST_CS | CONST_PERSISTENT); - - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - - return SUCCESS; -} -/* }}} */ - -/* {{{ ZEND_RSHUTDOWN_FUNCTION - */ -ZEND_MODULE_DEACTIVATE_D(gmp) -{ - if (GMPG(rand_initialized)) { - gmp_randclear(GMPG(rand_state)); - GMPG(rand_initialized) = 0; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ ZEND_MSHUTDOWN_FUNCTION - */ -ZEND_MODULE_SHUTDOWN_D(gmp) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ ZEND_MINFO_FUNCTION - */ -ZEND_MODULE_INFO_D(gmp) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "gmp support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -/* Fetch zval to be GMP number. - Initially, zval can be also number or string */ -#define FETCH_GMP_ZVAL(gmpnumber, zval) \ -if (Z_TYPE_PP(zval) == IS_RESOURCE) { \ - ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ -} else {\ - if (convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) {\ - RETURN_FALSE;\ - }\ - ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ -} - -/* create a new initialized GMP number */ -#define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } -#define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } - -/* {{{ convert_to_gmp - * Convert zval to be gmp number */ -static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base TSRMLS_DC) -{ - int ret = 0; - int skip_lead = 0; - - *gmpnumber = emalloc(sizeof(mpz_t)); - - switch (Z_TYPE_PP(val)) { - case IS_LONG: - case IS_BOOL: - case IS_CONSTANT: - { - convert_to_long_ex(val); - mpz_init_set_si(**gmpnumber, Z_LVAL_PP(val)); - } - break; - case IS_STRING: - { - char *numstr = Z_STRVAL_PP(val); - - if (Z_STRLEN_PP(val) > 2) { - if (numstr[0] == '0') { - if (numstr[1] == 'x' || numstr[1] == 'X') { - base = 16; - skip_lead = 1; - } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) { - base = 2; - skip_lead = 1; - } - } - } - ret = mpz_init_set_str(**gmpnumber, (skip_lead ? &numstr[2] : numstr), base); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to convert variable to GMP - wrong type"); - efree(*gmpnumber); - return FAILURE; - } - - if (ret) { - FREE_GMP_NUM(*gmpnumber); - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ typedefs - */ -typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); -typedef int (*gmp_unary_opl_t)(mpz_srcptr); - -typedef void (*gmp_unary_ui_op_t)(mpz_ptr, unsigned long); - -typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr); - -typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); -typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); -/* }}} */ - -#define gmp_zval_binary_ui_op(r, a, b, o, u) gmp_zval_binary_ui_op_ex(r, a, b, o, u, 0, 0 TSRMLS_CC) -#define gmp_zval_binary_ui_op2(r, a, b, o, u) gmp_zval_binary_ui_op2_ex(r, a, b, o, u, 0, 0 TSRMLS_CC) - -#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) -#define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL) -#define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) - -/* Unary operations */ -#define gmp_unary_op(op) _gmp_unary_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) - -/* {{{ gmp_zval_binary_ui_op_ex - Execute GMP binary operation. - May return GMP resource or long if operation allows this -*/ -static inline void gmp_zval_binary_ui_op_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int allow_ui_return, int check_b_zero TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; - unsigned long long_result = 0; - int use_ui = 0; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { - use_ui = 1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - if(check_b_zero) { - int b_is_zero = 0; - if(use_ui) { - b_is_zero = (Z_LVAL_PP(b_arg) == 0); - } else { - b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); - } - - if(b_is_zero) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); - RETURN_FALSE; - } - } - - INIT_GMP_NUM(gmpnum_result); - - if (use_ui && gmp_ui_op) { - if (allow_ui_return) { - long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } else { - gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } - } else { - gmp_op(*gmpnum_result, *gmpnum_a, *gmpnum_b); - } - - if (use_ui && allow_ui_return) { - FREE_GMP_NUM(gmpnum_result); - RETURN_LONG((long)long_result); - } else { - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - } -} -/* }}} */ - -/* {{{ gmp_zval_binary_ui_op2_ex - Execute GMP binary operation which returns 2 values. - May return GMP resources or longs if operation allows this. -*/ -static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int allow_ui_return, int check_b_zero TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result1, *gmpnum_result2; - zval r; - int use_ui = 0; - unsigned long long_result = 0; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { - /* use _ui function */ - use_ui = 1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - if(check_b_zero) { - int b_is_zero = 0; - if(use_ui) { - b_is_zero = (Z_LVAL_PP(b_arg) == 0); - } else { - b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); - } - - if(b_is_zero) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); - RETURN_FALSE; - } - } - - INIT_GMP_NUM(gmpnum_result1); - INIT_GMP_NUM(gmpnum_result2); - - if (use_ui && gmp_ui_op) { - if (allow_ui_return) { - long_result = gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } else { - gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } - } else { - gmp_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, *gmpnum_b); - } - - array_init(return_value); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); - add_index_resource(return_value, 0, Z_LVAL(r)); - if (use_ui && allow_ui_return) { - mpz_clear(*gmpnum_result2); - add_index_long(return_value, 1, long_result); - } else { - ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); - add_index_resource(return_value, 1, Z_LVAL(r)); - } -} -/* }}} */ - -/* {{{ _gmp_binary_ui_op - */ -static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) -{ - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op); -} -/* }}} */ - -/* Unary operations */ - -/* {{{ gmp_zval_unary_op - */ -static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_result; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - INIT_GMP_NUM(gmpnum_result); - gmp_op(*gmpnum_result, *gmpnum_a); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ gmp_zval_unary_ui_op - */ -static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op) -{ - mpz_t *gmpnum_result; - - convert_to_long_ex(a_arg); - - INIT_GMP_NUM(gmpnum_result); - gmp_op(*gmpnum_result, Z_LVAL_PP(a_arg)); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ _gmp_unary_ui_op - Execute GMP unary operation. -*/ -static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) -{ - zval **a_arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_unary_ui_op(return_value, a_arg, gmp_op); -} -/* }}} */ - -/* {{{ _gmp_unary_op - */ -static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) -{ - zval **a_arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC); -} -/* }}} */ - -/* {{{ _gmp_unary_opl - */ -static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(gmp_op(*gmpnum_a)); -} -/* }}} */ - -/* {{{ _gmp_binary_opl - */ -static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, a_arg); - - RETURN_LONG(gmp_op(*gmpnum_a, *gmpnum_b)); -} -/* }}} */ - -/* {{{ proto resource gmp_init(mixed number [, int base]) - Initializes GMP number */ -ZEND_FUNCTION(gmp_init) -{ - zval **number_arg, **base_arg; - mpz_t * gmpnumber; - int argc; - int base=0; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &number_arg, &base_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if (argc == 2) { - convert_to_long_ex(base_arg); - base = Z_LVAL_PP(base_arg); - if (base < 2 || base > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); - RETURN_FALSE; - } - } - - if (convert_to_gmp(&gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) { - RETURN_FALSE; - } - - /* Write your own code here to handle argument number. */ - ZEND_REGISTER_RESOURCE(return_value, gmpnumber, le_gmp); -} -/* }}} */ - -/* {{{ proto int gmp_intval(resource gmpnumber) - Gets signed long value of GMP number */ -ZEND_FUNCTION(gmp_intval) -{ - zval **gmpnumber_arg; - mpz_t * gmpnum; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &gmpnumber_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(gmpnumber_arg) == IS_RESOURCE) { - ZEND_FETCH_RESOURCE(gmpnum, mpz_t *, gmpnumber_arg, -1, GMP_RESOURCE_NAME, le_gmp); - RETVAL_LONG(mpz_get_si(*gmpnum)); - } else { - convert_to_long_ex(gmpnumber_arg); - RETVAL_LONG(Z_LVAL_PP(gmpnumber_arg)); - } -} -/* }}} */ - -/* {{{ proto string gmp_strval(resource gmpnumber [, int base]) - Gets string representation of GMP number */ -ZEND_FUNCTION(gmp_strval) -{ - zval **gmpnumber_arg, **base_arg; - int base=10, num_len, argc; - mpz_t * gmpnum; - char *out_string; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &base_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum, gmpnumber_arg); - - switch (argc) { - case 2: - convert_to_long_ex(base_arg); - base = Z_LVAL_PP(base_arg); - break; - case 1: - base = 10; - break; - } - - if (base < 2 || base > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d", base); - RETURN_FALSE; - } - - num_len = mpz_sizeinbase(*gmpnum, base); - out_string = emalloc(num_len+2); - if (mpz_sgn(*gmpnum) < 0) { - num_len++; - } - mpz_get_str(out_string, base, *gmpnum); - - /* - From GMP documentation for mpz_sizeinbase(): - The returned value will be exact or 1 too big. If base is a power of - 2, the returned value will always be exact. - - So let's check to see if we already have a \0 byte... - */ - - if (out_string[num_len-1] == '\0') { - num_len--; - } else { - out_string[num_len] = '\0'; - } - RETVAL_STRINGL(out_string, num_len, 0); -} -/* }}} */ - -/* {{{ proto resource gmp_add(resource a, resource b) - Add a and b */ -ZEND_FUNCTION(gmp_add) -{ - gmp_binary_ui_op(mpz_add, (gmp_binary_ui_op_t)mpz_add_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_sub(resource a, resource b) - Subtract b from a */ -ZEND_FUNCTION(gmp_sub) -{ - gmp_binary_ui_op(mpz_sub, (gmp_binary_ui_op_t)mpz_sub_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_mul(resource a, resource b) - Multiply a and b */ -ZEND_FUNCTION(gmp_mul) -{ - gmp_binary_ui_op(mpz_mul, (gmp_binary_ui_op_t)mpz_mul_ui); -} -/* }}} */ - -/* {{{ proto array gmp_div_qr(resource a, resource b [, int round]) - Divide a by b, returns quotient and reminder */ -ZEND_FUNCTION(gmp_div_qr) -{ - zval **a_arg, **b_arg, **round_arg; - int round = GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch (round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t)mpz_tdiv_qr_ui, 0, 1 TSRMLS_CC); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t)mpz_cdiv_qr_ui, 0, 1 TSRMLS_CC); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t)mpz_fdiv_qr_ui, 0, 1 TSRMLS_CC); - break; - } - -} -/* }}} */ - -/* {{{ proto resource gmp_div_r(resource a, resource b [, int round]) - Divide a by b, returns reminder only */ -ZEND_FUNCTION(gmp_div_r) -{ - zval **a_arg, **b_arg, **round_arg; - int round = GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch (round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui, 1, 1 TSRMLS_CC); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui, 1, 1 TSRMLS_CC); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui, 1, 1 TSRMLS_CC); - break; - } -} -/* }}} */ - -/* {{{ proto resource gmp_div_q(resource a, resource b [, int round]) - Divide a by b, returns quotient only */ -ZEND_FUNCTION(gmp_div_q) -{ - zval **a_arg, **b_arg, **round_arg; - int round = GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch (round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t)mpz_tdiv_q_ui, 0, 1 TSRMLS_CC); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t)mpz_cdiv_q_ui, 0, 1 TSRMLS_CC); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t)mpz_fdiv_q_ui, 0, 1 TSRMLS_CC); - break; - } - -} -/* }}} */ - -/* {{{ proto resource gmp_mod(resource a, resource b) - Computes a modulo b */ -ZEND_FUNCTION(gmp_mod) -{ - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto resource gmp_divexact(resource a, resource b) - Divide a by b using exact division algorithm */ -ZEND_FUNCTION(gmp_divexact) -{ - gmp_binary_op(mpz_divexact); -} -/* }}} */ - -/* {{{ proto resource gmp_neg(resource a) - Negates a number */ -ZEND_FUNCTION(gmp_neg) -{ - gmp_unary_op(mpz_neg); -} -/* }}} */ - -/* {{{ proto resource gmp_abs(resource a) - Calculates absolute value */ -ZEND_FUNCTION(gmp_abs) -{ - gmp_unary_op(mpz_abs); -} -/* }}} */ - -/* {{{ proto resource gmp_fact(int a) - Calculates factorial function */ -ZEND_FUNCTION(gmp_fact) -{ - zval **a_arg; - mpz_t *gmpnum_tmp; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { - FETCH_GMP_ZVAL(gmpnum_tmp, a_arg); - if (mpz_sgn(*gmpnum_tmp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); - RETURN_FALSE; - } - } else { - convert_to_long_ex(a_arg); - if (Z_LVAL_PP(a_arg) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); - RETURN_FALSE; - } - } - - gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_pow(resource base, int exp) - Raise base to power exp */ -ZEND_FUNCTION(gmp_pow) -{ - zval **base_arg, **exp_arg; - mpz_t *gmpnum_result, *gmpnum_base; - int use_ui = 0; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &base_arg, &exp_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(base_arg) == IS_LONG && Z_LVAL_PP(base_arg) >= 0) { - use_ui = 1; - } else { - FETCH_GMP_ZVAL(gmpnum_base, base_arg); - } - - convert_to_long_ex(exp_arg); - - if (Z_LVAL_PP(exp_arg) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Negative exponent not supported"); - RETURN_FALSE; - } - - INIT_GMP_NUM(gmpnum_result); - if (use_ui) { - mpz_ui_pow_ui(*gmpnum_result, Z_LVAL_PP(base_arg), Z_LVAL_PP(exp_arg)); - } else { - mpz_pow_ui(*gmpnum_result, *gmpnum_base, Z_LVAL_PP(exp_arg)); - } - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto resource gmp_powm(resource base, resource exp, resource mod) - Raise base to power exp and take result modulo mod */ -ZEND_FUNCTION(gmp_powm) -{ - zval **base_arg, **exp_arg, **mod_arg; - mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; - int use_ui = 0; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &base_arg, &exp_arg, &mod_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_base, base_arg); - - if (Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) { - use_ui = 1; - } else { - FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); - if (mpz_sgn(*gmpnum_exp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); - RETURN_FALSE; - } - } - FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); - - if (!mpz_cmp_ui(*gmpnum_mod, 0)) { - RETURN_FALSE; - } - - INIT_GMP_NUM(gmpnum_result); - if (use_ui) { - mpz_powm_ui(*gmpnum_result, *gmpnum_base, (unsigned long)Z_LVAL_PP(exp_arg), *gmpnum_mod); - } else { - mpz_powm(*gmpnum_result, *gmpnum_base, *gmpnum_exp, *gmpnum_mod); - } - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - -} -/* }}} */ - -/* {{{ proto resource gmp_sqrt(resource a) - Takes integer part of square root of a */ -ZEND_FUNCTION(gmp_sqrt) -{ - zval **a_arg; - mpz_t *gmpnum_a, *gmpnum_result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if (mpz_sgn(*gmpnum_a) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); - RETURN_FALSE; - } - - INIT_GMP_NUM(gmpnum_result); - mpz_sqrt(*gmpnum_result, *gmpnum_a); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto array gmp_sqrtrem(resource a) - Square root with remainder */ -ZEND_FUNCTION(gmp_sqrtrem) -{ - zval **a_arg; - mpz_t *gmpnum_a, *gmpnum_result1, *gmpnum_result2; - zval r; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if (mpz_sgn(*gmpnum_a) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); - RETURN_FALSE; - } - - INIT_GMP_NUM(gmpnum_result1); - INIT_GMP_NUM(gmpnum_result2); - - mpz_sqrtrem(*gmpnum_result1, *gmpnum_result2, *gmpnum_a); - - array_init(return_value); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); - add_index_resource(return_value, 0, Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); - add_index_resource(return_value, 1, Z_LVAL(r)); -} -/* }}} */ - -/* {{{ proto bool gmp_perfect_square(resource a) - Checks if a is an exact square */ -ZEND_FUNCTION(gmp_perfect_square) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_BOOL((mpz_perfect_square_p(*gmpnum_a)!=0)); -} -/* }}} */ - -/* {{{ proto int gmp_prob_prime(resource a[, int reps]) - Checks if a is "probably prime" */ -ZEND_FUNCTION(gmp_prob_prime) -{ - zval **gmpnumber_arg, **reps_arg; - mpz_t *gmpnum_a; - int argc, reps = 10; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &reps_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, gmpnumber_arg); - - switch (argc) { - case 2: - convert_to_long_ex(reps_arg); - reps = Z_LVAL_PP(reps_arg); - break; - case 1: - reps = 10; - break; - } - - RETURN_LONG(mpz_probab_prime_p(*gmpnum_a, reps)); -} -/* }}} */ - -/* {{{ proto resource gmp_gcd(resource a, resource b) - Computes greatest common denominator (gcd) of a and b */ -ZEND_FUNCTION(gmp_gcd) -{ - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_gcd, (gmp_binary_ui_op_t)mpz_gcd_ui, 1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto array gmp_gcdext(resource a, resource b) - Computes G, S, and T, such that AS + BT = G = `gcd' (A, B) */ -ZEND_FUNCTION(gmp_gcdext) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_t, *gmpnum_s, *gmpnum_g; - zval r; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - INIT_GMP_NUM(gmpnum_g); - INIT_GMP_NUM(gmpnum_s); - INIT_GMP_NUM(gmpnum_t); - - mpz_gcdext(*gmpnum_g, *gmpnum_s, *gmpnum_t, *gmpnum_a, *gmpnum_b); - - array_init(return_value); - - ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp); - add_assoc_resource(return_value, "g", Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp); - add_assoc_resource(return_value, "s", Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp); - add_assoc_resource(return_value, "t", Z_LVAL(r)); -} -/* }}} */ - -/* {{{ proto resource gmp_invert(resource a, resource b) - Computes the inverse of a modulo b */ -ZEND_FUNCTION(gmp_invert) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - INIT_GMP_NUM(gmpnum_result); - if (mpz_invert(*gmpnum_result, *gmpnum_a, *gmpnum_b)) { - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - } else { - FREE_GMP_NUM(gmpnum_result); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int gmp_jacobi(resource a, resource b) - Computes Jacobi symbol */ -ZEND_FUNCTION(gmp_jacobi) -{ - gmp_binary_opl(mpz_jacobi); -} -/* }}} */ - -/* {{{ proto int gmp_legendre(resource a, resource b) - Computes Legendre symbol */ -ZEND_FUNCTION(gmp_legendre) -{ - gmp_binary_opl(mpz_legendre); -} -/* }}} */ - -/* {{{ proto int gmp_cmp(resource a, resource b) - Compares two numbers */ -ZEND_FUNCTION(gmp_cmp) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - int use_si = 0, res; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if (Z_TYPE_PP(b_arg) == IS_LONG) { - use_si = 1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - if (use_si) { - res = mpz_cmp_si(*gmpnum_a, Z_LVAL_PP(b_arg)); - } else { - res = mpz_cmp(*gmpnum_a, *gmpnum_b); - } - - RETURN_LONG(res); -} -/* }}} */ - -/* {{{ proto int gmp_sign(resource a) - Gets the sign of the number */ -ZEND_FUNCTION(gmp_sign) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(mpz_sgn(*gmpnum_a)); -} -/* }}} */ - -/* {{{ proto resource gmp_random([int limiter]) - Gets random number */ -ZEND_FUNCTION(gmp_random) -{ - zval **limiter_arg; - int limiter, argc; - mpz_t *gmpnum_result; - - argc = ZEND_NUM_ARGS(); - - if (argc == 0) { - limiter = 20; - } else if (argc == 1 && zend_get_parameters_ex(1, &limiter_arg) == SUCCESS) { - convert_to_long_ex(limiter_arg); - limiter = Z_LVAL_PP(limiter_arg); - } else { - WRONG_PARAM_COUNT; - } - - INIT_GMP_NUM(gmpnum_result); - - if (!GMPG(rand_initialized)) { - /* Initialize */ - gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); - - /* Seed */ - gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); - - GMPG(rand_initialized) = 1; - } - mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto resource gmp_and(resource a, resource b) - Calculates logical AND of a and b */ -ZEND_FUNCTION(gmp_and) -{ - gmp_binary_op(mpz_and); -} -/* }}} */ - -/* {{{ proto resource gmp_or(resource a, resource b) - Calculates logical OR of a and b */ -ZEND_FUNCTION(gmp_or) -{ - gmp_binary_op(mpz_ior); -} -/* }}} */ - -/* {{{ proto resource gmp_com(resource a) - Calculates one's complement of a */ -ZEND_FUNCTION(gmp_com) -{ - gmp_unary_op(mpz_com); -} -/* }}} */ - -/* {{{ proto resource gmp_xor(resource a, resource b) - Calculates logical exclusive OR of a and b */ -ZEND_FUNCTION(gmp_xor) -{ - /* use formula: a^b = (a|b)&^(a&b) */ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result, *gmpnum_t; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - INIT_GMP_NUM(gmpnum_result); - INIT_GMP_NUM(gmpnum_t); - - mpz_and(*gmpnum_t, *gmpnum_a, *gmpnum_b); - mpz_com(*gmpnum_t, *gmpnum_t); - - mpz_ior(*gmpnum_result, *gmpnum_a, *gmpnum_b); - mpz_and(*gmpnum_result, *gmpnum_result, *gmpnum_t); - - FREE_GMP_NUM(gmpnum_t); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto void gmp_setbit(resource &a, int index[, bool set_clear]) - Sets or clear bit in a */ -ZEND_FUNCTION(gmp_setbit) -{ - zval **a_arg, **ind_arg, **set_c_arg; - int argc, index, set = 1; - mpz_t *gmpnum_a; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &ind_arg, &set_c_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); - - convert_to_long_ex(ind_arg); - index = Z_LVAL_PP(ind_arg); - - switch (argc) { - case 3: - convert_to_long_ex(set_c_arg); - set = Z_LVAL_PP(set_c_arg); - break; - case 2: - set = 1; - break; - } - - if (set) { - mpz_setbit(*gmpnum_a, index); - } else { - mpz_clrbit(*gmpnum_a, index); - } -} -/* }}} */ - -/* {{{ proto void gmp_clrbit(resource &a, int index) - Clears bit in a */ -ZEND_FUNCTION(gmp_clrbit) -{ - zval **a_arg, **ind_arg; - int index; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &ind_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); - - convert_to_long_ex(ind_arg); - index = Z_LVAL_PP(ind_arg); - - mpz_clrbit(*gmpnum_a, index); -} -/* }}} */ - -/* {{{ proto int gmp_popcount(resource a) - Calculates the population count of a */ -ZEND_FUNCTION(gmp_popcount) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(mpz_popcount(*gmpnum_a)); -} -/* }}} */ - -/* {{{ proto int gmp_hamdist(resource a, resource b) - Calculates hamming distance between a and b */ -ZEND_FUNCTION(gmp_hamdist) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - RETURN_LONG(mpz_hamdist(*gmpnum_a, *gmpnum_b)); -} -/* }}} */ - -/* {{{ proto int gmp_scan0(resource a, int start) - Finds first zero bit */ -ZEND_FUNCTION(gmp_scan0) -{ - zval **a_arg, **start_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - convert_to_long_ex(start_arg); - - RETURN_LONG(mpz_scan0(*gmpnum_a, Z_LVAL_PP(start_arg))); -} -/* }}} */ - -/* {{{ proto int gmp_scan1(resource a, int start) - Finds first non-zero bit */ -ZEND_FUNCTION(gmp_scan1) -{ - zval **a_arg, **start_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - convert_to_long_ex(start_arg); - - RETURN_LONG(mpz_scan1(*gmpnum_a, Z_LVAL_PP(start_arg))); -} -/* }}} */ - -/* {{{ _php_gmpnum_free - */ -static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mpz_t *gmpnum = (mpz_t *)rsrc->ptr; - - FREE_GMP_NUM(gmpnum); -} -/* }}} */ - -#endif /* HAVE_GMP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h deleted file mode 100644 index ecf19cc6ac820..0000000000000 --- a/ext/gmp/php_gmp.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stanislav Malyshev | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_GMP_H -#define PHP_GMP_H - -#if HAVE_GMP - -#include - -extern zend_module_entry gmp_module_entry; -#define phpext_gmp_ptr &gmp_module_entry - -#ifdef ZEND_WIN32 -#define GMP_API __declspec(dllexport) -#else -#define GMP_API -#endif - -ZEND_MODULE_STARTUP_D(gmp); -ZEND_MODULE_SHUTDOWN_D(gmp); -ZEND_MODULE_DEACTIVATE_D(gmp); -ZEND_MODULE_INFO_D(gmp); - -ZEND_FUNCTION(gmp_init); -ZEND_FUNCTION(gmp_intval); -ZEND_FUNCTION(gmp_strval); -ZEND_FUNCTION(gmp_add); -ZEND_FUNCTION(gmp_sub); -ZEND_FUNCTION(gmp_mul); -ZEND_FUNCTION(gmp_div_qr); -ZEND_FUNCTION(gmp_div_q); -ZEND_FUNCTION(gmp_div_r); -ZEND_FUNCTION(gmp_mod); -ZEND_FUNCTION(gmp_divexact); -ZEND_FUNCTION(gmp_neg); -ZEND_FUNCTION(gmp_abs); -ZEND_FUNCTION(gmp_fact); -ZEND_FUNCTION(gmp_sqrt); -ZEND_FUNCTION(gmp_pow); -ZEND_FUNCTION(gmp_powm); -ZEND_FUNCTION(gmp_sqrtrem); -ZEND_FUNCTION(gmp_perfect_square); -ZEND_FUNCTION(gmp_prob_prime); -ZEND_FUNCTION(gmp_gcd); -ZEND_FUNCTION(gmp_gcdext); -ZEND_FUNCTION(gmp_invert); -ZEND_FUNCTION(gmp_jacobi); -ZEND_FUNCTION(gmp_legendre); -ZEND_FUNCTION(gmp_cmp); -ZEND_FUNCTION(gmp_sign); -ZEND_FUNCTION(gmp_and); -ZEND_FUNCTION(gmp_or); -ZEND_FUNCTION(gmp_com); -ZEND_FUNCTION(gmp_xor); -ZEND_FUNCTION(gmp_random); -ZEND_FUNCTION(gmp_setbit); -ZEND_FUNCTION(gmp_clrbit); -ZEND_FUNCTION(gmp_scan0); -ZEND_FUNCTION(gmp_scan1); -ZEND_FUNCTION(gmp_popcount); -ZEND_FUNCTION(gmp_hamdist); - -ZEND_BEGIN_MODULE_GLOBALS(gmp) - zend_bool rand_initialized; - gmp_randstate_t rand_state; -ZEND_END_MODULE_GLOBALS(gmp) - -#ifdef ZTS -#define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v) -#else -#define GMPG(v) (gmp_globals.v) -#endif - -#else - -#define phpext_gmp_ptr NULL - -#endif - -#endif /* PHP_GMP_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/gmp/tests/001.phpt b/ext/gmp/tests/001.phpt deleted file mode 100644 index 382d374cb9c57..0000000000000 --- a/ext/gmp/tests/001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Check for gmp presence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -gmp extension is available \ No newline at end of file diff --git a/ext/gmp/tests/002.phpt b/ext/gmp/tests/002.phpt deleted file mode 100644 index ac2a7a5494628..0000000000000 --- a/ext/gmp/tests/002.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -GMP functionality test - factorial ---SKIPIF-- - ---FILE-- - ---EXPECT-- -402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/ext/gmp/tests/003.phpt b/ext/gmp/tests/003.phpt deleted file mode 100644 index 379833024d05a..0000000000000 --- a/ext/gmp/tests/003.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Check for number base recognition ---SKIPIF-- - ---FILE-- - ---EXPECT-- -1234 -1234 -10011010010 -1234 -1234 -1234 -2322 -1234 -1234 -1234 -1234 -1234 -0 -1234 diff --git a/ext/gmp/tests/bug32773.phpt b/ext/gmp/tests/bug32773.phpt deleted file mode 100644 index feb9d8d755222..0000000000000 --- a/ext/gmp/tests/bug32773.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #32773 binary GMP functions returns unexpected value, when second parameter is int(0) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -10 + 0 = 10 -10 + "0" = 10 - -Warning: gmp_div(): Zero operand not allowed in %s on line %d -0 - -Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d -0 diff --git a/ext/hwapi/CREDITS b/ext/hwapi/CREDITS deleted file mode 100644 index 8416199c543a1..0000000000000 --- a/ext/hwapi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -HwAPI -Uwe Steinmann diff --git a/ext/hwapi/config.m4 b/ext/hwapi/config.m4 deleted file mode 100644 index af8069fd213d3..0000000000000 --- a/ext/hwapi/config.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl $Id$ - -PHP_ARG_WITH(hwapi, for hwapi support, -[ --with-hwapi[=DIR] Include official Hyperwave API support]) - -if test "$PHP_HWAPI" != "no"; then - if test -r $PHP_HWAPI/include/sdk/api/object.h; then - HWAPI_DIR=$PHP_HWAPI - else - AC_MSG_CHECKING(for HWAPI in default path) - for i in /usr/local /usr; do - if test -r $i/include/hwapi/sdk/api/object.h; then - HWAPI_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$HWAPI_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please install the hwapi >= 1.0.0 distribution) - fi - - PHP_ADD_INCLUDE($HWAPI_DIR/include/hwapi) - PHP_SUBST(HWAPI_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(hwapi, $HWAPI_DIR/lib, HWAPI_SHARED_LIBADD) - AC_DEFINE(HAVE_HWAPI,1,[ ]) - - PHP_REQUIRE_CXX - PHP_NEW_EXTENSION(hwapi, hwapi.cpp, $ext_shared) - PHP_ADD_LIBRARY(hwapi) - PHP_ADD_LIBRARY(pthread) - PHP_ADD_LIBRARY(stdc++) - PHP_ADD_INCLUDE($HWAPI_DIR/include) -fi diff --git a/ext/hwapi/hwapi.cpp b/ext/hwapi/hwapi.cpp deleted file mode 100644 index 920711e05c378..0000000000000 --- a/ext/hwapi/hwapi.cpp +++ /dev/null @@ -1,5023 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Uwe Steinmann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include - -extern "C" -{ -#include "php.h" -#include "php_globals.h" -#include "ext/standard/head.h" -#include "ext/standard/info.h" -#if 0 -#include "ext/standard/php_standard.h" -#include "fopen-wrappers.h" -#endif -#include "SAPI.h" -} - -#ifdef PHP_WIN32 -#include -#endif -#ifdef HAVE_MMAP -#include -#endif - -#if HAVE_HWAPI - -static int le_hwapip; -static int le_hwapi_objectp; -static int le_hwapi_attributep; -static int le_hwapi_errorp; -static int le_hwapi_contentp; -static int le_hwapi_reasonp; - -static zend_class_entry *hw_api_class_entry_ptr; -static zend_class_entry *hw_api_object_class_entry_ptr; -static zend_class_entry *hw_api_attribute_class_entry_ptr; -static zend_class_entry *hw_api_error_class_entry_ptr; -static zend_class_entry *hw_api_content_class_entry_ptr; -static zend_class_entry *hw_api_reason_class_entry_ptr; - -#include "php_ini.h" -#include "php_hwapi.h" - -//#ifdef __cplusplus -//extern "C" { -#include -#include -//} -//#endif - -function_entry hwapi_functions[] = { - PHP_FE(hwapi_dummy, NULL) - PHP_FE(hwapi_init, NULL) - PHP_FE(hwapi_hgcsp, NULL) - PHP_FE(hwapi_object, NULL) - PHP_FE(hwapi_children, NULL) - PHP_FE(hwapi_parents, NULL) - PHP_FE(hwapi_find, NULL) - PHP_FE(hwapi_identify, NULL) - PHP_FE(hwapi_remove, NULL) - PHP_FE(hwapi_content, NULL) - PHP_FE(hwapi_copy, NULL) - PHP_FE(hwapi_link, NULL) - PHP_FE(hwapi_move, NULL) - PHP_FE(hwapi_lock, NULL) - PHP_FE(hwapi_unlock, NULL) - PHP_FE(hwapi_replace, NULL) - PHP_FE(hwapi_object_new, NULL) - PHP_FE(hwapi_object_count, NULL) - PHP_FE(hwapi_object_title, NULL) - PHP_FE(hwapi_object_attreditable, NULL) - PHP_FE(hwapi_object_assign, NULL) - PHP_FE(hwapi_object_attribute, NULL) - PHP_FE(hwapi_object_insert, NULL) - PHP_FE(hwapi_object_remove, NULL) - PHP_FE(hwapi_object_value, NULL) - PHP_FE(hwapi_attribute_new, NULL) - PHP_FE(hwapi_attribute_key, NULL) - PHP_FE(hwapi_attribute_value, NULL) - PHP_FE(hwapi_attribute_values, NULL) - PHP_FE(hwapi_attribute_langdepvalue, NULL) - PHP_FE(hwapi_content_new, NULL) - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_functions[] = { - {"hgcsp", PHP_FN(hwapi_hgcsp), NULL}, - {"object", PHP_FN(hwapi_object), NULL}, - {"children", PHP_FN(hwapi_children), NULL}, - {"mychildren", PHP_FN(hwapi_mychildren), NULL}, - {"parents", PHP_FN(hwapi_parents), NULL}, - {"find", PHP_FN(hwapi_find), NULL}, - {"identify", PHP_FN(hwapi_identify), NULL}, - {"remove", PHP_FN(hwapi_remove), NULL}, - {"content", PHP_FN(hwapi_content), NULL}, - {"copy", PHP_FN(hwapi_copy), NULL}, - {"link", PHP_FN(hwapi_link), NULL}, - {"move", PHP_FN(hwapi_move), NULL}, - {"lock", PHP_FN(hwapi_lock), NULL}, - {"unlock", PHP_FN(hwapi_unlock), NULL}, - {"replace", PHP_FN(hwapi_replace), NULL}, - {"insert", PHP_FN(hwapi_insert), NULL}, - {"insertdocument", PHP_FN(hwapi_insertdocument), NULL}, - {"insertcollection", PHP_FN(hwapi_insertcollection), NULL}, - {"srcanchors", PHP_FN(hwapi_srcanchors), NULL}, - {"dstanchors", PHP_FN(hwapi_dstanchors), NULL}, - {"objectbyanchor", PHP_FN(hwapi_objectbyanchor), NULL}, - {"dstofsrcanchor", PHP_FN(hwapi_dstofsrcanchor), NULL}, - {"srcsofdst", PHP_FN(hwapi_srcsofdst), NULL}, - {"checkin", PHP_FN(hwapi_checkin), NULL}, - {"checkout", PHP_FN(hwapi_checkout), NULL}, - {"setcommittedversion", PHP_FN(hwapi_setcommittedversion), NULL}, - {"revert", PHP_FN(hwapi_revert), NULL}, - {"history", PHP_FN(hwapi_history), NULL}, - {"removeversion", PHP_FN(hwapi_removeversion), NULL}, - {"freeversion", PHP_FN(hwapi_freeversion), NULL}, - {"configurationhistory", PHP_FN(hwapi_configurationhistory), NULL}, - {"saveconfiguration", PHP_FN(hwapi_saveconfiguration), NULL}, - {"restoreconfiguration", PHP_FN(hwapi_restoreconfiguration), NULL}, - {"removeconfiguration", PHP_FN(hwapi_removeconfiguration), NULL}, - {"mergeconfiguration", PHP_FN(hwapi_mergeconfiguration), NULL}, - {"user", PHP_FN(hwapi_user), NULL}, - {"userlist", PHP_FN(hwapi_userlist), NULL}, - {"hwstat", PHP_FN(hwapi_hwstat), NULL}, - {"dcstat", PHP_FN(hwapi_dcstat), NULL}, - {"dbstat", PHP_FN(hwapi_dbstat), NULL}, - {"ftstat", PHP_FN(hwapi_ftstat), NULL}, - {"info", PHP_FN(hwapi_info), NULL}, - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_object_functions[] = { - {"hw_api_object", PHP_FN(hwapi_object_new), NULL}, - {"count", PHP_FN(hwapi_object_count), NULL}, - {"title", PHP_FN(hwapi_object_title), NULL}, - {"attributeeditable", PHP_FN(hwapi_object_attreditable), NULL}, - {"assign", PHP_FN(hwapi_object_assign), NULL}, - {"attribute", PHP_FN(hwapi_object_attribute), NULL}, - {"insert", PHP_FN(hwapi_object_insert), NULL}, - {"remove", PHP_FN(hwapi_object_remove), NULL}, - {"value", PHP_FN(hwapi_object_value), NULL}, - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_attribute_functions[] = { - {"hw_api_attribute", PHP_FN(hwapi_attribute_new), NULL}, - {"key", PHP_FN(hwapi_attribute_key), NULL}, - {"value", PHP_FN(hwapi_attribute_value), NULL}, - {"values", PHP_FN(hwapi_attribute_values), NULL}, - {"langdepvalue", PHP_FN(hwapi_attribute_langdepvalue), NULL}, - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_error_functions[] = { - {"count", PHP_FN(hwapi_error_count), NULL}, - {"reason", PHP_FN(hwapi_error_reason), NULL}, - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_content_functions[] = { - {"hw_api_content", PHP_FN(hwapi_content_new), NULL}, - {"read", PHP_FN(hwapi_content_read), NULL}, - {"mimetype", PHP_FN(hwapi_content_mimetype), NULL}, - {NULL, NULL, NULL} -}; - -static function_entry php_hw_api_reason_functions[] = { - {"type", PHP_FN(hwapi_reason_type), NULL}, - {"description", PHP_FN(hwapi_reason_description), NULL}, - {NULL, NULL, NULL} -}; - -void hw_api_class_startup(); -void hw_api_object_class_startup(); -void hw_api_attribute_class_startup(); -void hw_api_error_class_startup(); -void hw_api_content_class_startup(); -void hw_api_reason_class_startup(); -static zval *php_hwapi_object_new(void *obj, int rsrc_type); - -zend_module_entry hwapi_module_entry = { - STANDARD_MODULE_HEADER, - "hwapi", - hwapi_functions, - PHP_MINIT(hwapi), - NULL, - NULL, - NULL, - PHP_MINFO(hwapi), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef ZTS -int hwapi_globals_id; -#else -PHP_HWAPI_API zend_hwapi_globals hwapi_globals; -#endif - -#ifdef COMPILE_DL_HWAPI -ZEND_GET_MODULE(hwapi) -#endif - -static void print_reason(const HW_API_Reason& reason) { - HW_API_String str_type; - switch(reason.type()) { - case HW_API_Reason::HW_API_ERROR: - str_type = "Error"; - break; - case HW_API_Reason::HW_API_WARNING: - str_type = "Warning"; - break; - case HW_API_Reason::HW_API_MESSAGE: - str_type = "Message"; - break; - } - fprintf(stderr, "%s: %s\n", str_type.string(), reason.description("en").string()); -} - -static void print_error(const HW_API_Error& error) { - for (int i=0; i < error.count(); i++) { - HW_API_Reason reason; - error.reason(i, reason); - print_reason(reason); - } -} - -static void print_object(const HW_API_Object& object) { - fprintf(stderr, "%s\n", object.title("en").string()); - for (int i=0; i < object.count(); i++) { - HW_API_Attribute attrib; - object.attribute(i, attrib); - fprintf(stderr, "%s=%s\n", attrib.key().string(), attrib.value().string()); - } -} - -static void php_hwapi_init_globals(zend_hwapi_globals *hwapi_globals) { -} - -static void php_free_hwapi(zend_rsrc_list_entry *rsrc) { - HW_API *obj; - - obj = (HW_API *) (rsrc->ptr); - delete obj; -} - -static void php_free_hwapi_object(zend_rsrc_list_entry *rsrc) { - HW_API_Object *obj; - - obj = (HW_API_Object *) (rsrc->ptr); - delete obj; -} - -static void php_free_hwapi_attribute(zend_rsrc_list_entry *rsrc) { - HW_API_Attribute *obj; - - obj = (HW_API_Attribute *) (rsrc->ptr); - if(obj) - delete obj; -} - -static void php_free_hwapi_error(zend_rsrc_list_entry *rsrc) { - HW_API_Error *obj; - - obj = (HW_API_Error *) (rsrc->ptr); - if(obj) - delete obj; -} - -static void php_free_hwapi_content(zend_rsrc_list_entry *rsrc) { - HW_API_Content *obj; - - obj = (HW_API_Content *) (rsrc->ptr); - if(obj) - delete obj; -} - -static void php_free_hwapi_reason(zend_rsrc_list_entry *rsrc) { - HW_API_Reason *obj; - - obj = (HW_API_Reason *) (rsrc->ptr); - if(obj) - delete obj; -} - -static void print_hwapi_stringarray(const HW_API_StringArray& strings) { - for(int i=0; icount(); i++) { - HW_API_String str; - values->string(i, str); - str.string(); - add_next_index_string(*return_value, (char *) str.string(), 1); - } - return 1; -} - -static int objectArray2indexArray(pval **return_value, HW_API_ObjectArray *objarr) { - array_init(*return_value); - - for(int i=0; icount(); i++) { - zval *child; - HW_API_Object obj, *objp; - objarr->object(i, obj); - objp = new HW_API_Object(obj); - child = php_hwapi_object_new(objp, le_hwapi_objectp); - add_next_index_zval(*return_value, child); - } - return 1; -} - -static void *php_hwapi_get_object(zval *wrapper, int rsrc_type1) { - void *obj; - zval **handle; - int type; - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrapper is not an object"); - } - if (zend_hash_find(Z_OBJPROP_P(wrapper), "this", sizeof("this"), (void **)&handle) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Underlying object missing"); - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || (type != rsrc_type1)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Underlying object missing or of invalid type"); - } - return obj; -} - -static zval *php_hwapi_object_new(void *obj, int rsrc_type) { - zval *wrapper, *handle; - int ret; - - MAKE_STD_ZVAL(wrapper); - if (!obj) { - ZVAL_NULL(wrapper); - return wrapper; - } - - /* construct an object with some methods */ - if(rsrc_type == le_hwapi_attributep) - object_init_ex(wrapper, hw_api_attribute_class_entry_ptr); - else if(rsrc_type == le_hwapi_objectp) - object_init_ex(wrapper, hw_api_object_class_entry_ptr); - else if(rsrc_type == le_hwapip) - object_init_ex(wrapper, hw_api_class_entry_ptr); - else if(rsrc_type == le_hwapi_errorp) - object_init_ex(wrapper, hw_api_error_class_entry_ptr); - else if(rsrc_type == le_hwapi_contentp) - object_init_ex(wrapper, hw_api_content_class_entry_ptr); - else if(rsrc_type == le_hwapi_reasonp) - object_init_ex(wrapper, hw_api_reason_class_entry_ptr); - - MAKE_STD_ZVAL(handle); - ZEND_REGISTER_RESOURCE(handle, obj, rsrc_type); - zend_hash_update(Z_OBJPROP_P(wrapper), "this", sizeof("this"), &handle, sizeof(zval *), NULL); - return(wrapper); -} - -static HW_API_StringArray *make_HW_API_StringArray(HashTable *lht) { - int count, j; - HW_API_StringArray *sarr; - - sarr = new HW_API_StringArray(); - - count = zend_hash_num_elements(lht); - zend_hash_internal_pointer_reset(lht); - for(j=0; jtype) { - case IS_STRING: - sarr->insert((HW_API_String) (*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return sarr; -} - -static HW_API_object_In *make_HW_API_object_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_object_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_object_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_children_In *make_HW_API_children_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_children_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_children_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_parents_In *make_HW_API_parents_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_parents_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_parents_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_find_In *make_HW_API_find_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_find_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_find_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "keyQuery")) - in->setKeyQuery((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "fullTextQuery")) - in->setFullTextQuery((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "startIndex")) - in->setStartIndex((*keydata)->value.lval); - else if(!strcmp(key, "numberOfObjectsToGet")) - in->setNumberOfObjectsToGet((*keydata)->value.lval); - else if(!strcmp(key, "exactMatchLimit")) - in->setExactMatchLimit((*keydata)->value.lval); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } else if(!strcmp(key, "languages")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setLanguages(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } else if(!strcmp(key, "scope")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setScope(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_identify_In *make_HW_API_identify_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_identify_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_identify_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "username")) - in->setUsername((*keydata)->value.str.val); - else if(!strcmp(key, "password")) - in->setPassword((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_remove_In *make_HW_API_remove_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_remove_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_remove_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "parentIdentifier")) - in->setParentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_content_In *make_HW_API_content_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_content_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_content_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_copy_In *make_HW_API_copy_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_copy_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_copy_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "destinationParentIdentifier")) - in->setDestinationParentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_link_In *make_HW_API_link_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_link_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_link_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "destinationParentIdentifier")) - in->setDestinationParentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_move_In *make_HW_API_move_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_move_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_move_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "destinationParentIdentifier")) - in->setDestinationParentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "sourceParentIdentifier")) - in->setSourceParentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_lock_In *make_HW_API_lock_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_lock_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_lock_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_unlock_In *make_HW_API_unlock_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_unlock_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_unlock_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_replace_In *make_HW_API_replace_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_replace_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_replace_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_OBJECT: { - zend_class_entry *ce; - ce = zend_get_class_entry(*keydata); - if(!strcmp(key, "object")) { -// if(!((*keydata)->value.obj.ce->name, "hw_api_object")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setObject(*obj); - } - } else if(!strcmp(key, "parameters")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setParameters(*obj); - } - } else if(!strcmp(key, "content")) { - if(!strcmp(ce->name, "hw_api_content")) { - HW_API_Content *obj; - obj = (HW_API_Content *) php_hwapi_get_object(*keydata, le_hwapi_contentp); - in->setContent(*obj); - } - } - /* FIXME: HW_API_Object and HW_API_Content needs to be handelt */ - break; - } - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_insert_In *make_HW_API_insert_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_insert_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_insert_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_OBJECT: { - zend_class_entry *ce; - ce = zend_get_class_entry(*keydata); - if(!strcmp(key, "object")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setObject(*obj); - } - } else if(!strcmp(key, "parameters")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setParameters(*obj); - } - } else if(!strcmp(key, "content")) { - if(!strcmp(ce->name, "hw_api_content")) { - HW_API_Content *obj; - obj = (HW_API_Content *) php_hwapi_get_object(*keydata, le_hwapi_contentp); - in->setContent(*obj); - } - } - /* FIXME: HW_API_Object and HW_API_Content needs to be handelt */ - break; - } - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_insertDocument_In *make_HW_API_insertDocument_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_insertDocument_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_insertDocument_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_OBJECT: { - zend_class_entry *ce; - ce = zend_get_class_entry(*keydata); - if(!strcmp(key, "object")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setObject(*obj); - } - } else if(!strcmp(key, "parameters")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setParameters(*obj); - } - } else if(!strcmp(key, "content")) { - if(!strcmp(ce->name, "hw_api_content")) { - HW_API_Content *obj; - obj = (HW_API_Content *) php_hwapi_get_object(*keydata, le_hwapi_contentp); - in->setContent(*obj); - } - } - /* FIXME: HW_API_Object and HW_API_Content needs to be handelt */ - break; - } - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - case IS_STRING: - if(!strcmp(key, "parentIdentifier")) - in->setParentIdentifier((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_insertCollection_In *make_HW_API_insertCollection_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_insertCollection_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_insertCollection_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "parentIdentifier")) - in->setParentIdentifier((*keydata)->value.str.val); - break; - case IS_OBJECT: { - zend_class_entry *ce; - ce = zend_get_class_entry(*keydata); - if(!strcmp(key, "object")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setObject(*obj); - } - } else if(!strcmp(key, "parameters")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setParameters(*obj); - } - } - /* FIXME: HW_API_Object and HW_API_Content needs to be handelt */ - break; - } - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_insertAnchor_In *make_HW_API_insertAnchor_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_insertAnchor_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_insertAnchor_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "documentIdentifier")) - in->setDocumentIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "destinationIdentifier")) - in->setDestinationIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "hint")) - in->setHint((*keydata)->value.str.val); - break; - case IS_OBJECT: { - zend_class_entry *ce; - ce = zend_get_class_entry(*keydata); - if(!strcmp(key, "object")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setObject(*obj); - } - } else if(!strcmp(key, "parameters")) { - if(!strcmp(ce->name, "hw_api_object")) { - HW_API_Object *obj; - obj = (HW_API_Object *) php_hwapi_get_object(*keydata, le_hwapi_objectp); - in->setParameters(*obj); - } - } - /* FIXME: HW_API_Object and HW_API_Content needs to be handelt */ - break; - } - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_srcAnchors_In *make_HW_API_srcAnchors_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_srcAnchors_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_srcAnchors_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_dstAnchors_In *make_HW_API_dstAnchors_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_dstAnchors_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_dstAnchors_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_dstOfSrcAnchor_In *make_HW_API_dstOfSrcAnchor_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_dstOfSrcAnchor_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_dstOfSrcAnchor_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_objectByAnchor_In *make_HW_API_objectByAnchor_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_objectByAnchor_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_objectByAnchor_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_srcsOfDst_In *make_HW_API_srcsOfDst_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_srcsOfDst_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_srcsOfDst_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly by freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_checkIn_In *make_HW_API_checkIn_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_checkIn_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_checkIn_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - else if(!strcmp(key, "comment")) - in->setComment((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_checkOut_In *make_HW_API_checkOut_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_checkOut_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_checkOut_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_setCommittedVersion_In *make_HW_API_setCommittedVersion_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_setCommittedVersion_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_setCommittedVersion_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_revert_In *make_HW_API_revert_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_revert_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_revert_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "objectQuery")) - in->setObjectQuery((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_history_In *make_HW_API_history(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_history_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_history_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); -/* else if(!strcmp(key, "objectQuery")) - in->objectQuery((*keydata)->value.str.val);*/ - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_removeVersion_In *make_HW_API_removeVersion_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_removeVersion_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_removeVersion_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_freeVersion_In *make_HW_API_freeVersion_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_freeVersion_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_freeVersion_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_configurationHistory_In *make_HW_API_configurationHistory_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_configurationHistory_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_configurationHistory_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_saveConfiguration_In *make_HW_API_saveConfiguration_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_saveConfiguration_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_saveConfiguration_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - else if(!strcmp(key, "comment")) - in->setComment((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_restoreConfiguration_In *make_HW_API_restoreConfiguration_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_restoreConfiguration_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_restoreConfiguration_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_removeConfiguration_In *make_HW_API_removeConfiguration_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_removeConfiguration_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_removeConfiguration_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_mergeConfiguration_In *make_HW_API_mergeConfiguration_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_mergeConfiguration_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_mergeConfiguration_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_STRING: - if(!strcmp(key, "objectIdentifier")) - in->setObjectIdentifier((*keydata)->value.str.val); - else if(!strcmp(key, "version")) - in->setVersion((*keydata)->value.str.val); - break; - case IS_LONG: - if(!strcmp(key, "mode")) - in->setMode((*keydata)->value.lval); - break; - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_user_In *make_HW_API_user_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_user_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_user_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_userlist_In *make_HW_API_userlist_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_userlist_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_userlist_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_hwStat_In *make_HW_API_hwStat_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_hwStat_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_hwStat_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_dcStat_In *make_HW_API_dcStat_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_dcStat_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_dcStat_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_dbStat_In *make_HW_API_dbStat_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_dbStat_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_dbStat_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_ftStat_In *make_HW_API_ftStat_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_ftStat_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_ftStat_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -static HW_API_info_In *make_HW_API_info_In(zval *arg1) { - int count, i; - HashTable *lht; - HW_API_info_In *in; - - lht = arg1->value.ht; - - if(0 == (count = zend_hash_num_elements(lht))) { - return NULL; - } - - in = new HW_API_info_In(); - - zend_hash_internal_pointer_reset(lht); - for(i=0; itype) { - case IS_ARRAY: { - HW_API_StringArray *sarr; - - if(!strcmp(key, "attributeSelector")) { - sarr = make_HW_API_StringArray((*keydata)->value.ht); - in->setAttributeSelector(*sarr); - /* FIXME: sarr can be propperly be freed now */ - } - break; - } - } - zend_hash_move_forward(lht); - } - return(in); -} - -PHP_INI_BEGIN() -// STD_PHP_INI_ENTRY("hwapi.allow_persistent", "0", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_hwapi_globals, hwapi_globals) -PHP_INI_END() - -PHP_MINIT_FUNCTION(hwapi) { - ZEND_INIT_MODULE_GLOBALS(hwapi, php_hwapi_init_globals, NULL); - - le_hwapip = zend_register_list_destructors_ex(php_free_hwapi, NULL, "hw_api", module_number); - le_hwapi_attributep = zend_register_list_destructors_ex(php_free_hwapi_attribute, NULL, "hw_api_attribute", module_number); - le_hwapi_objectp = zend_register_list_destructors_ex(php_free_hwapi_object, NULL, "hw_api_object", module_number); - le_hwapi_errorp = zend_register_list_destructors_ex(php_free_hwapi_error, NULL, "hw_api_error", module_number); - le_hwapi_contentp = zend_register_list_destructors_ex(php_free_hwapi_content, NULL, "hw_api_content", module_number); - le_hwapi_reasonp = zend_register_list_destructors_ex(php_free_hwapi_reason, NULL, "hw_api_reason", module_number); - hw_api_class_startup(); - hw_api_object_class_startup(); - hw_api_attribute_class_startup(); - hw_api_error_class_startup(); - hw_api_content_class_startup(); - hw_api_reason_class_startup(); - - REGISTER_LONG_CONSTANT("HW_API_REMOVE_NORMAL", HW_API_remove_In::NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REMOVE_PHYSICAL", HW_API_remove_In::PHYSICAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REMOVE_REMOVELINKS", HW_API_remove_In::REMOVELINKS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REMOVE_NONRECURSIVE", HW_API_remove_In::NONRECURSIVE, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("HW_API_REPLACE_NORMAL", HW_API_replace_In::NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_FORCE_VERSION_CONTROL", HW_API_replace_In::FORCE_VERSION_CONTROL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_AUTOMATIC_CHECKOUT", HW_API_replace_In::AUTOMATIC_CHECKOUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_AUTOMATIC_CHECKIN", HW_API_replace_In::AUTOMATIC_CHECKIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_PLAIN", HW_API_replace_In::PLAIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_REVERT_IF_NOT_CHANGED", HW_API_replace_In::REVERT_IF_NOT_CHANGED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REPLACE_KEEP_TIME_MODIFIED", HW_API_replace_In::KEEP_TIME_MODIFIED, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("HW_API_INSERT_NORMAL", HW_API_insert_In::NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_INSERT_FORCE_VERSION_CONTROL", HW_API_insert_In::FORCE_VERSION_CONTROL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_INSERT_AUTOMATIC_CHECKOUT", HW_API_insert_In::AUTOMATIC_CHECKOUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_INSERT_PLAIN", HW_API_insert_In::PLAIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_INSERT_KEEP_TIME_MODIFIED", HW_API_insert_In::KEEP_TIME_MODIFIED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_INSERT_DELAY_INDEXING", HW_API_insert_In::DELAY_INDEXING, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("HW_API_LOCK_NORMAL", HW_API_lock_In::NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_LOCK_RECURSIVE", HW_API_lock_In::RECURSIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_LOCK_SESSION", HW_API_lock_In::SESSION, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("HW_API_CONTENT_ALLLINKS", HW_API_content_In::ALLLINKS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_CONTENT_REACHABLELINKS", HW_API_content_In::REACHABLELINKS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_CONTENT_PLAIN", HW_API_content_In::PLAIN, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("HW_API_REASON_ERROR", HW_API_Reason::HW_API_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REASON_WARNING", HW_API_Reason::HW_API_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_API_REASON_MESSAGE", HW_API_Reason::HW_API_MESSAGE, CONST_CS | CONST_PERSISTENT); - - /* Make sure there are at least default values, though the MessageFilePath - * is bogus. If it isn't set at all the web server dies. - */ - HW_API_init_In initargs; - initargs.setArgv0("PHP HWAPI"); - initargs.setMessageFilePath(""); - HW_API::init(initargs); - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(hwapi) { - php_info_print_table_start(); - php_info_print_table_row(2, "Hyperwave API Support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto bool hwapi_dummy(int link, int id, int msgid) - Hyperwave dummy function */ -PHP_FUNCTION(hwapi_dummy) { - pval **arg1, **arg2, **arg3; - int link, id, type, msgid; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_init(string hostname, int port) - Hyperwave initialisation */ -PHP_FUNCTION(hwapi_init) { - zval **argv[2], *id; - HW_API_init_In initargs; - HW_API_init_Out out; - int ret; - HW_API_HGCSP *db; - zval *rv; - int argc = ZEND_NUM_ARGS(); - - if (((argc < 1) || (argc > 2)) || zend_get_parameters_array_ex(argc, argv) == FAILURE) { - WRONG_PARAM_COUNT; - } - - id = getThis(); - - convert_to_string_ex(argv[0]); - initargs.setArgv0("PHP HWAPI"); - initargs.setMessageFilePath(Z_STRVAL_PP(argv[0])); - if(argc == 2) { - convert_to_string_ex(argv[1]); - initargs.setWhatString(Z_STRVAL_PP(argv[1])) ; - } - if(id) { - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - if(!db) { - RETURN_FALSE; - } - out = db->init(initargs); - } else { - out = HW_API::init(initargs); - } - - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string hwapi_hgcsp(string hostname, int port) - */ -PHP_FUNCTION(hwapi_hgcsp) { - zval **argv[2]; - HW_API_HGCSP *db; - zval *rv; - int argc = ZEND_NUM_ARGS(); - - if (((argc < 1) || (argc > 2)) || zend_get_parameters_array_ex(argc, argv) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(argv[0]); - if(argc == 2) { - convert_to_long_ex(argv[1]); - db = new HW_API_HGCSP(Z_STRVAL_PP(argv[0]), Z_LVAL_PP(argv[1])); - } else { - db = new HW_API_HGCSP(Z_STRVAL_PP(argv[0])); - } - - rv = php_hwapi_object_new((HW_API_HGCSP *) db, le_hwapip); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - -// ret = zend_list_insert(db, le_hwapip); - - /* construct an object with some methods */ -// object_init_ex(return_value, hw_api_class_entry_ptr); -// add_property_resource(return_value, "this", ret); -} -/* }}} */ - -/* {{{ proto object hwapi_object(array object_in) - */ -PHP_FUNCTION(hwapi_object) { - pval **arg1, *rv, *id; - HW_API_Object *newobj; - HW_API_object_In *in; - HW_API_object_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_object_In(*arg1); - - out = db->object(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - //Frage: Diese Zeile erzeugt erst mit dem Konstruktor von HW_API_Object - //eine Kopie und danach durch das assign. Wie kann man das verhindern. - newobj = new HW_API_Object(); - *newobj = out.object(); -// newobj = new HW_API_Object(out.object()); - - rv = php_hwapi_object_new(newobj, le_hwapi_objectp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto array hwapi_mychildren(string parameters) - */ -PHP_FUNCTION(hwapi_mychildren) { - zval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_children_In *in; - HW_API_children_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = new HW_API_children_In(); - in->setObjectIdentifier(Z_STRVAL_PP(arg1)); - out = db->children(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - array_init(return_value); - - for(i=0; ichildren(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_parents(array parameters) - */ -PHP_FUNCTION(hwapi_parents) { - zval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_parents_In *in; - HW_API_parents_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_parents_In(*arg1); - - out = db->parents(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto array hwapi_find(array parameters) - Finds objects */ -PHP_FUNCTION(hwapi_find) { - zval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_find_In *in; - HW_API_find_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_find_In(*arg1); - - out = db->find(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - objarr = (HW_API_ObjectArray) out.objects(); - - /* FIXME: No a good idea to return just the objects. There is actually - * more to return. Changing this to an object of type hw_api_find_out would - * mean to change hw_api_parents() and hw_api_children() as well. */ - array_init(return_value); - - /* FIXME: More than just the list of objects is returned by find() */ - if(0 == objectArray2indexArray(&rv, &objarr)) { - RETURN_FALSE; - } - zend_hash_add(return_value->value.ht, "objects", 8, &rv, sizeof(zval *), NULL); - add_assoc_long(return_value, "endIndex", out.endIndex()); - add_assoc_bool(return_value, "haveMore", out.haveMore() ? true : false); - add_assoc_long(return_value, "numberOfThingsFound", out.numberOfThingsFound()); -} -/* }}} */ - -/* {{{ proto bool hwapi_identify(array parameters) - Hyperwave dummy function */ -PHP_FUNCTION(hwapi_identify) { - pval **arg1, *id, *rv; - HW_API_identify_In *in; - HW_API_identify_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_identify_In(*arg1); - - out = db->identify(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_identify\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_remove(array parameters) - Remove an object */ -PHP_FUNCTION(hwapi_remove) { - pval **arg1, *id, *rv; - HW_API_remove_In *in; - HW_API_remove_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_remove_In(*arg1); - - out = db->remove(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_remove\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object hwapi_content(array parameters) - Retrieve content of object */ -PHP_FUNCTION(hwapi_content) { - pval **arg1, *id, *rv; - HW_API_content_In *in; - HW_API_content_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_content_In(*arg1); - - out = db->content(*in); - delete in; - if (!out.error().error()) { - HW_API_Content *content = new HW_API_Content(out.content()); - rv = php_hwapi_object_new(content, le_hwapi_contentp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_copy(array parameters) - */ -PHP_FUNCTION(hwapi_copy) { - pval **arg1, *id, *rv; - HW_API_copy_In *in; - HW_API_copy_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_copy_In(*arg1); - - out = db->copy(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new((HW_API_Object*) object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_copy\n"); -} -/* }}} */ - -/* {{{ proto bool hwapi_link(array parameters) - Hyperwave dummy function */ -PHP_FUNCTION(hwapi_link) { - pval **arg1, *id, *rv; - HW_API_link_In *in; - HW_API_link_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_link_In(*arg1); - - out = db->link(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_link\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_move(array parameters) - */ -PHP_FUNCTION(hwapi_move) { - pval **arg1, *id, *rv; - HW_API_move_In *in; - HW_API_move_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_move_In(*arg1); - - out = db->move(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_move\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_lock(array parameters) - */ -PHP_FUNCTION(hwapi_lock) { - pval **arg1, *id, *rv; - HW_API_lock_In *in; - HW_API_lock_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_lock_In(*arg1); - - out = db->lock(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_lock\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_unlock(array parameters) - */ -PHP_FUNCTION(hwapi_unlock) { - pval **arg1, *id, *rv; - HW_API_unlock_In *in; - HW_API_unlock_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_unlock_In(*arg1); - - out = db->unlock(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } - - printf("hwapi_unlock\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object hwapi_replace(array parameters) - */ -PHP_FUNCTION(hwapi_replace) { - pval **arg1, *id, *rv; - HW_API_replace_In *in; - HW_API_replace_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_replace_In(*arg1); - - out = db->replace(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_insert(array parameters) - */ -PHP_FUNCTION(hwapi_insert) { - pval **arg1, *id, *rv; - HW_API_insert_In *in; - HW_API_insert_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_insert_In(*arg1); - - out = db->insert(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_insertdocument(array parameters) - */ -PHP_FUNCTION(hwapi_insertdocument) { - pval **arg1, *id, *rv; - HW_API_insertDocument_In *in; - HW_API_insertDocument_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_insertDocument_In(*arg1); - - out = db->insertDocument(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_insertdocument\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_insertcollection(array parameters) - */ -PHP_FUNCTION(hwapi_insertcollection) { - pval **arg1, *id, *rv; - HW_API_insertCollection_In *in; - HW_API_insertCollection_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_insertCollection_In(*arg1); - - out = db->insertCollection(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) &err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_insertcollection\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_insertanchor(array parameters) - */ -PHP_FUNCTION(hwapi_insertanchor) { - pval **arg1, *id, *rv; - HW_API_insertAnchor_In *in; - HW_API_insertAnchor_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_insertAnchor_In(*arg1); - - out = db->insertAnchor(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_insertanchor\n"); -} -/* }}} */ - -/* {{{ proto array hwapi_srcanchors(array parameters) - */ -PHP_FUNCTION(hwapi_srcanchors) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_srcAnchors_In *in; - HW_API_srcAnchors_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_srcAnchors_In(*arg1); - - out = db->srcAnchors(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto array hwapi_dstanchors(array parameters) - */ -PHP_FUNCTION(hwapi_dstanchors) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_dstAnchors_In *in; - HW_API_dstAnchors_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_dstAnchors_In(*arg1); - - out = db->dstAnchors(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_objectbyanchor(array parameters) - */ -PHP_FUNCTION(hwapi_objectbyanchor) { - pval **arg1, *id, *rv; - HW_API_objectByAnchor_In *in; - HW_API_objectByAnchor_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_objectByAnchor_In(*arg1); - /* FIXME: return value of any make_HW_API_xxx function should be checked - * for NULL - */ - - out = db->objectByAnchor(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_objectbyanchor\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_dstofsrcanchor(array parameters) - */ -PHP_FUNCTION(hwapi_dstofsrcanchor) { - pval **arg1, *id, *rv; - HW_API_dstOfSrcAnchor_In *in; - HW_API_dstOfSrcAnchor_Out out; - HW_API_HGCSP *db; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_dstOfSrcAnchor_In(*arg1); - - out = db->dstOfSrcAnchor(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_dstofsrcanchor\n"); -} -/* }}} */ - -/* {{{ proto array hwapi_srcsofdst(array parameters) - */ -PHP_FUNCTION(hwapi_srcsofdst) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_srcsOfDst_In *in; - HW_API_srcsOfDst_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_srcsOfDst_In(*arg1); - - out = db->srcsOfDst(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_checkin(array parameters) - Checking in a document */ -PHP_FUNCTION(hwapi_checkin) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_checkIn_In *in; - HW_API_checkIn_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_checkIn_In(*arg1); - - out = db->checkIn(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_TRUE; - } - - printf("hwapi_checkin\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_checkout(array parameters) - Checking out a document */ -PHP_FUNCTION(hwapi_checkout) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_checkOut_In *in; - HW_API_checkOut_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_checkOut_In(*arg1); - - out = db->checkOut(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_TRUE; - } - - printf("hwapi_checkout\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_setcommittedversion(array parameters) - setcommittedversion */ -PHP_FUNCTION(hwapi_setcommittedversion) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_setCommittedVersion_In *in; - HW_API_setCommittedVersion_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_setCommittedVersion_In(*arg1); - - out = db->setCommittedVersion(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_setcommittedversion\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_revert(array parameters) - Reverting to a former document */ -PHP_FUNCTION(hwapi_revert) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_revert_In *in; - HW_API_revert_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_revert_In(*arg1); - - out = db->revert(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_TRUE; - } - - printf("hwapi_revert\n"); -} -/* }}} */ - -/* {{{ proto array hwapi_history(array parameters) - history */ -PHP_FUNCTION(hwapi_history) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_history_In *in; - HW_API_history_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_history(*arg1); - - out = db->history(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_removeversion(array parameters) - Reverting to a former document */ -PHP_FUNCTION(hwapi_removeversion) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_removeVersion_In *in; - HW_API_removeVersion_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_removeVersion_In(*arg1); - - out = db->removeVersion(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_TRUE; - } - - printf("hwapi_removeversion\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_freeversion(array parameters) - freeversion */ -PHP_FUNCTION(hwapi_freeversion) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_freeVersion_In *in; - HW_API_freeVersion_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_freeVersion_In(*arg1); - - out = db->freeVersion(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_freeversion\n"); -} -/* }}} */ - -/* {{{ proto array hwapi_configurationhistory(array parameters) - Returns configuration history of object */ -PHP_FUNCTION(hwapi_configurationhistory) { - zval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_configurationHistory_In *in; - HW_API_configurationHistory_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_configurationHistory_In(*arg1); - - out = db->configurationHistory(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_saveconfiguration(array parameters) - Save configuration for an object */ -PHP_FUNCTION(hwapi_saveconfiguration) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_saveConfiguration_In *in; - HW_API_saveConfiguration_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_saveConfiguration_In(*arg1); - - out = db->saveConfiguration(*in); - delete in; - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_saveconfiguration\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_restoreconfiguration(array parameters) - Restore configuration for an object */ -PHP_FUNCTION(hwapi_restoreconfiguration) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_restoreConfiguration_In *in; - HW_API_restoreConfiguration_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_restoreConfiguration_In(*arg1); - - out = db->restoreConfiguration(*in); - delete in; - if (!out.error().error()) { - RETURN_STRING((char *) (out.progressIdentifier().string()), 1); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_restoreconfiguration\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_mergeconfiguration(array parameters) - Merge configuration for an object */ -PHP_FUNCTION(hwapi_mergeconfiguration) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_mergeConfiguration_In *in; - HW_API_mergeConfiguration_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_mergeConfiguration_In(*arg1); - - out = db->mergeConfiguration(*in); - delete in; - if (!out.error().error()) { - RETURN_STRING((char *) (out.progressIdentifier().string()), 1); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_mergeconfiguration\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_removeconfiguration(array parameters) - Removes configuration */ -PHP_FUNCTION(hwapi_removeconfiguration) { - pval **arg1, *id, *rv; - HW_API_ObjectArray objarr; - HW_API_removeConfiguration_In *in; - HW_API_removeConfiguration_Out out; - HW_API_HGCSP *db; - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - in = make_HW_API_removeConfiguration_In(*arg1); - - out = db->removeConfiguration(*in); - delete in; - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_TRUE; - } - - printf("hwapi_removeconfiguration\n"); -} -/* }}} */ - -/* {{{ proto object hwapi_user(array parameters) - Returns information about user */ -PHP_FUNCTION(hwapi_user) { - pval **arg1, *id, *rv; - HW_API_user_In *in; - HW_API_user_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->user(HW_API_user_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_user_In(*arg1); - if(NULL == in) - out = db->user(HW_API_user_In()); - else - out = db->user(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - -} -/* }}} */ - -/* {{{ proto array hwapi_userlist(array parameters) - Returns list of login in users */ -PHP_FUNCTION(hwapi_userlist) { - zval **arg1, *id, *rv; - HW_API_userlist_In *in; - HW_API_userlist_Out out; - HW_API_ObjectArray objarr; - HW_API_HGCSP *db; - int i; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->userlist(HW_API_userlist_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_userlist_In(*arg1); - if(NULL == in) - out = db->userlist(HW_API_userlist_In()); - else - out = db->userlist(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (out.error().error()) { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new((HW_API_Error *) err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - objarr = (HW_API_ObjectArray) out.objects(); - } - - objectArray2indexArray(&return_value, &objarr); -} -/* }}} */ - -/* {{{ proto object hwapi_hwstat(array parameters) - Returns information about hgserver */ -PHP_FUNCTION(hwapi_hwstat) { - pval **arg1, *id, *rv; - HW_API_hwStat_In *in; - HW_API_hwStat_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->hwStat(HW_API_hwStat_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_hwStat_In(*arg1); - if(NULL == in) - out = db->hwStat(HW_API_hwStat_In()); - else - out = db->hwStat(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_dcstat(array parameters) - Returns information about hgserver */ -PHP_FUNCTION(hwapi_dcstat) { - pval **arg1, *id, *rv; - HW_API_dcStat_In *in; - HW_API_dcStat_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->dcStat(HW_API_dcStat_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_dcStat_In(*arg1); - if(NULL == in) - out = db->dcStat(HW_API_dcStat_In()); - else - out = db->dcStat(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_dbstat(array parameters) - Returns information about hgserver */ -PHP_FUNCTION(hwapi_dbstat) { - pval **arg1, *id, *rv; - HW_API_dbStat_In *in; - HW_API_dbStat_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->dbStat(HW_API_dbStat_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_dbStat_In(*arg1); - if(NULL == in) - out = db->dbStat(HW_API_dbStat_In()); - else - out = db->dbStat(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object hwapi_ftstat(array parameters) - Returns information about ftserver */ -PHP_FUNCTION(hwapi_ftstat) { - pval **arg1, *id, *rv; - HW_API_ftStat_In *in; - HW_API_ftStat_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->ftStat(HW_API_ftStat_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_ftStat_In(*arg1); - if(NULL == in) - out = db->ftStat(HW_API_ftStat_In()); - else - out = db->ftStat(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_Object *object = new HW_API_Object(out.object()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - } - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto array hwapi_info(array parameters) - Returns information about server */ -PHP_FUNCTION(hwapi_info) { - pval **arg1, *id, *rv, *rv1, *rv2, *rv3; - HW_API_info_In *in; - HW_API_info_Out out; - HW_API_HGCSP *db; - int argc; - - id = getThis(); - db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip); - - if(!db) { - RETURN_FALSE; - } - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - out = db->info(HW_API_info_In()); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_array_ex(arg1); - in = make_HW_API_info_In(*arg1); - if(NULL == in) - out = db->info(HW_API_info_In()); - else - out = db->info(*in); - delete in; - break; - default: - WRONG_PARAM_COUNT; - } - - if (!out.error().error()) { - HW_API_StringArray languages, customidx, systemidx; - array_init(return_value); - HW_API_Object *object = new HW_API_Object(out.typeInfo()); - rv = php_hwapi_object_new(object, le_hwapi_objectp); - zend_hash_add(return_value->value.ht, "typeInfo", 9, &rv, sizeof(zval *), NULL); - languages = out.languages(); - MAKE_STD_ZVAL(rv1); - if(0 == stringArray2indexArray(&rv1, &languages)) - RETURN_FALSE; - zend_hash_add(return_value->value.ht, "languages", 10, &rv1, sizeof(zval *), NULL); - customidx = out.customIdx(); - MAKE_STD_ZVAL(rv2); - if(0 == stringArray2indexArray(&rv2, &customidx)) - RETURN_FALSE; - zend_hash_add(return_value->value.ht, "customIdx", 10, &rv2, sizeof(zval *), NULL); - systemidx = out.systemIdx(); - MAKE_STD_ZVAL(rv3); - if(0 == stringArray2indexArray(&rv3, &systemidx)) - RETURN_FALSE; - zend_hash_add(return_value->value.ht, "systemIdx", 10, &rv3, sizeof(zval *), NULL); - } else { - HW_API_Error *err = new HW_API_Error(out.error()); - rv = php_hwapi_object_new(err, le_hwapi_errorp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - } -} -/* }}} */ - -/* {{{ proto object hwapi_object_new() - Creates new HW_API_Object */ -PHP_FUNCTION(hwapi_object_new) { - pval **arg1, **arg2, *rv; - HW_API_Object *obj; - const HW_API_Object *srcobj; - int ret; - - switch(ZEND_NUM_ARGS()) { - case 0: - obj = new HW_API_Object(); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) - WRONG_PARAM_COUNT; - srcobj = (const HW_API_Object *) php_hwapi_get_object(*arg1, le_hwapi_objectp); - obj = new HW_API_Object(*srcobj); - break; - default: - WRONG_PARAM_COUNT; - } - - rv = php_hwapi_object_new(obj, le_hwapi_objectp); -//zend_print_pval_r(rv, 0); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto int hwapi_object_count() - Counts number of attributes of an HW_API_Object */ -PHP_FUNCTION(hwapi_object_count) { - zval *id, **tmp; - HW_API_Object *objp; - int value; - - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - - if(!objp) { - RETURN_FALSE; - } - value = objp->count(); - - RETURN_LONG(value); -} -/* }}} */ - -/* {{{ proto string hwapi_object_title(string language) - Returns title of HW_API_Object for given language */ -PHP_FUNCTION(hwapi_object_title) { - zval **arg1, *id, **tmp; - HW_API_Object *objp; - char *value; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - - convert_to_string_ex(arg1); - - // Warning: It is import to duplicate the string before RETURN. - // If that is not done the HW_API_String destructor will be called - // before RETURN_STRING can duplicate the string. - value = (char *) estrdup(objp->title(Z_STRVAL_PP(arg1)).string()); - - RETURN_STRING(value, 0); -} -/* }}} */ - -/* {{{ proto bool hwapi_object_attreditable(int attr, string username, bool is_system) - Hyperwave object_attreditable function */ -PHP_FUNCTION(hwapi_object_attreditable) { - zval *id, **arg1, **arg2, **arg3; - HW_API_Object *objp; - HW_API_Attribute *attrp; - bool value; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - convert_to_string_ex(arg2); - convert_to_long_ex(arg3); - switch(Z_TYPE_PP(arg1)) { - case IS_STRING: - convert_to_string_ex(arg1); - value = objp->attributeEditable((char *) Z_STRVAL_PP(arg1), (char *) Z_STRVAL_PP(arg2), (bool) Z_LVAL_PP(arg3)); - break; - case IS_OBJECT: - attrp = (HW_API_Attribute *) php_hwapi_get_object(*arg1, le_hwapi_attributep); - value = objp->attributeEditable(*attrp, (char *) Z_STRVAL_PP(arg2), (bool) Z_LVAL_PP(arg3)); - break; - } - if(value) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool hwapi_object_assign(int object) - Hyperwave object_assign function */ -PHP_FUNCTION(hwapi_object_assign) { - zval *id, **arg1, **arg2; - - printf("hwapi_object_assign\n"); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object hwapi_object_attribute(int index, object &attribute) - Hyperwave object_attribute function */ -PHP_FUNCTION(hwapi_object_attribute) { - zval **arg1, *id, *rv; - HW_API_Attribute *attrp, attr; - HW_API_Object *objp; - int error; - - if ((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - if(!objp) { - RETURN_FALSE; - } - - switch(Z_TYPE_PP(arg1)) { - case IS_LONG: - error = objp->attribute(Z_LVAL_PP(arg1), attr); - break; - case IS_STRING: - error = objp->attribute(HW_API_String(Z_STRVAL_PP(arg1)), attr); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "HW_API_Object::attribute() needs string or long as parameter"); - RETURN_FALSE; - } - - if(error) { - attrp = new HW_API_Attribute(attr); - rv = php_hwapi_object_new(attrp, le_hwapi_attributep); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool hwapi_object_insert(object attr) - Inserts new HW_API_Attribute into HW_API_Object */ -PHP_FUNCTION(hwapi_object_insert) { - zval **arg1, *id; - HW_API_Object *objp; - HW_API_Attribute *attrp; - char *value; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - if(!objp) { - RETURN_FALSE; - } - attrp = (HW_API_Attribute *) php_hwapi_get_object(*arg1, le_hwapi_attributep); - - objp->insert(*attrp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool hwapi_object_remove(string name) - Removes HW_API_Attribute with given name from HW_API_Object */ -PHP_FUNCTION(hwapi_object_remove) { - zval **arg1, *id, **tmp; - HW_API_Object *objp; - int error; - - if ((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - if(!objp) { - RETURN_FALSE; - } - - error = objp->remove(Z_STRVAL_PP(arg1)); - - if(!error) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string hwapi_object_value(string name) - Returns attribute value of given attribute */ -PHP_FUNCTION(hwapi_object_value) { - zval **arg1, *id; - HW_API_Object *objp; - HW_API_Attribute *attrp; - HW_API_String value; - int error; - - if ((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - id = getThis(); - objp = (HW_API_Object *) php_hwapi_get_object(id, le_hwapi_objectp); - if(!objp) { - RETURN_FALSE; - } - - error = objp->value((HW_API_String) Z_STRVAL_PP(arg1), value); - - printf("hwapi_object_value\n"); - if(error) { - char *str = (char *) estrdup(value.string()); - RETURN_STRING(str, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object hwapi_attribute_new([string name][, string value]) - Creates new HW_API_Attribute */ -PHP_FUNCTION(hwapi_attribute_new) { - zval *rv, **arg1, **arg2; - HW_API_Attribute *attrp; - int ret; - - /* FIXME: I'm not sure if the constructor of HW_API_Attribute takes normal C-Strings - * or if it has to be HW_API_String. Currently C-Strings are passed. - */ - switch(ZEND_NUM_ARGS()) { - case 0: - break; - attrp = new HW_API_Attribute(); - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - attrp = new HW_API_Attribute(Z_STRVAL_PP(arg1)); - break; - case 2: //* FIXME: Second Parameter can be string or array of strings - if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - switch((*arg2)->type) { - case IS_ARRAY: { - HashTable *lht = (*arg2)->value.ht; - int i, count; - HW_API_StringArray values; - if(NULL == lht) - RETURN_FALSE; - - if(0 == (count = zend_hash_num_elements(lht))) { - attrp = new HW_API_Attribute(Z_STRVAL_PP(arg1)); - break; - } - zend_hash_internal_pointer_reset(lht); - for(i=0; ivalue.str.val); - zend_hash_move_forward(lht); - } - attrp = new HW_API_Attribute(Z_STRVAL_PP(arg1), values); - break; - } - default: - convert_to_string_ex(arg2); - attrp = new HW_API_Attribute(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2)); - } - break; - default: - WRONG_PARAM_COUNT; - } - - rv = php_hwapi_object_new(attrp, le_hwapi_attributep); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - - printf("hwapi_attribute_new\n"); -} -/* }}} */ - -/* {{{ proto string hwapi_attribute_key(void) - Returns key of an hwapi_attribute */ -PHP_FUNCTION(hwapi_attribute_key) { - zval *id; - HW_API_Attribute *attrp; - char *value; - - id = getThis(); - attrp = (HW_API_Attribute *) php_hwapi_get_object(id, le_hwapi_attributep); - - // Warning: It is import to duplicate the string before RETURN. - // If that is not done the HW_API_String destructor will be called - // before RETURN_STRING can duplicate the string. - value = (char *) estrdup((attrp->key()).string()); - - RETURN_STRING(value, 0); -} -/* }}} */ - -/* {{{ proto string hwapi_attribute_value(void) - Returns value of hw_api_attribute */ -PHP_FUNCTION(hwapi_attribute_value) { - zval *id; - HW_API_Attribute *attrp; - char *value; - - id = getThis(); - attrp = (HW_API_Attribute *) php_hwapi_get_object(id, le_hwapi_attributep); - - // Warning: It is import to duplicate the string before RETURN. - // If that is not done the HW_API_String destructor will be called - // before RETURN_STRING can duplicate the string. - value = (char *) estrdup(attrp->value().string()); - - RETURN_STRING(value, 0); -} -/* }}} */ - -/* {{{ proto array hwapi_attribute_values(void) - Returns all values of an attribute as an array */ -PHP_FUNCTION(hwapi_attribute_values) { - zval *id, **tmp; - HW_API_Attribute *attrp; - HW_API_StringArray values; - - id = getThis(); - attrp = (HW_API_Attribute *) php_hwapi_get_object(id, le_hwapi_attributep); - - values = attrp->values(); - if(0 == stringArray2indexArray(&return_value, &values)) - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string hwapi_attribute_langdepvalue(string language) - Returns value of attribute with givenn language */ -PHP_FUNCTION(hwapi_attribute_langdepvalue) { - zval **arg1, *id, **tmp; - HW_API_Attribute *attrp; - char *value; - - if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - - id = getThis(); - attrp = (HW_API_Attribute *) php_hwapi_get_object(id, le_hwapi_attributep); - - value = (char *) attrp->langDepValue((*arg1)->value.str.val).string(); - printf("hwapi_attribute_langdepvalue\n"); - RETURN_STRING(value, 1); -} -/* }}} */ - -/* {{{ proto object hwapi_content_new([string name][, string value]) - Creates new HW_API_Content */ -PHP_FUNCTION(hwapi_content_new) { - zval *rv, **arg1, **arg2, **arg3; - HW_API_Content *contp; - int ret; - - switch(ZEND_NUM_ARGS()) { - case 0: - contp = new HW_API_Content(); - break; - case 1: - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - switch((*arg1)->type) { - case IS_OBJECT: - break; - default: - convert_to_string_ex(arg1); - contp = new HW_API_Content(Z_STRVAL_PP(arg1)); - } - break; - case 2: //First Parameter is long, second the file name - if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg1); - convert_to_string_ex(arg2); - contp = new HW_API_Content(HW_API_Content::File, Z_STRVAL_PP(arg2)); - break; - case 3: //First Parameter is long or string, second and third is string - if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - switch((*arg1)->type) { - case IS_LONG: - convert_to_string_ex(arg2); - convert_to_string_ex(arg3); - contp = new HW_API_Content(HW_API_Content::File, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3)); - break; - default: - convert_to_string_ex(arg1); - convert_to_string_ex(arg2); - convert_to_string_ex(arg3); - contp = new HW_API_Content(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3)); - } - break; - default: - WRONG_PARAM_COUNT; - } - - rv = php_hwapi_object_new(contp, le_hwapi_contentp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto int hwapi_content_read(string buffer, int length) - Reads length bytes from content */ -PHP_FUNCTION(hwapi_content_read) { - zval **arg1, **arg2, *id, **tmp; - HW_API_Content *contentp; - char *value; - int len; - - if((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg2); - - id = getThis(); - contentp = (HW_API_Content *) php_hwapi_get_object(id, le_hwapi_contentp); - - zval_dtor(*arg1); - Z_TYPE_PP(arg1) = IS_STRING; - /* FIXME: Need to finish the new zval */ - value = (char *) emalloc(Z_LVAL_PP(arg2)+1); - - Z_STRVAL_PP(arg1) = value; - len = contentp->read(value, Z_LVAL_PP(arg2)); - value[len] = '\0'; - Z_STRLEN_PP(arg1) = len; - - RETURN_LONG(len); -} -/* }}} */ - -/* {{{ proto string hwapi_content_mimetype(void) - Returns MimeType of document */ -PHP_FUNCTION(hwapi_content_mimetype) { - zval *id; - HW_API_Content *contentp; - HW_API_String hwstr; - - id = getThis(); - contentp = (HW_API_Content *) php_hwapi_get_object(id, le_hwapi_contentp); - - hwstr = contentp->mimetype(); - - RETURN_STRING((char *) hwstr.string(), 1); -} -/* }}} */ - -/* {{{ proto int hwapi_error_count() - Counts number of reasons of an HW_API_Error */ -PHP_FUNCTION(hwapi_error_count) { - zval *id, **tmp; - HW_API_Error *objp; - int value; - - id = getThis(); - objp = (HW_API_Error *) php_hwapi_get_object(id, le_hwapi_errorp); - - if(!objp) { - RETURN_FALSE; - } - value = objp->count(); - - RETURN_LONG(value); -} -/* }}} */ - -/* {{{ proto object hwapi_error_reason(int index) - Returns a reason of an HW_API_Error */ -PHP_FUNCTION(hwapi_error_reason) { - zval **arg1, *id, **tmp; - HW_API_Error *objp; - HW_API_Reason reason; - bool error; - - if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg1); - - id = getThis(); - objp = (HW_API_Error *) php_hwapi_get_object(id, le_hwapi_errorp); - - if(!objp) { - RETURN_FALSE; - } - if(!objp->error()) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This is not an error"); - - error = objp->reason(Z_LVAL_PP(arg1), reason); - if(error) { - zval *rv; - HW_API_Reason *reasonp = new HW_API_Reason(reason); - rv = php_hwapi_object_new(reasonp, le_hwapi_reasonp); - SEPARATE_ZVAL(&rv); - *return_value = *rv; - FREE_ZVAL(rv); - return; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int hwapi_reason_type(void) - Returns the type of HW_API_Reason */ -PHP_FUNCTION(hwapi_reason_type) { - zval **arg1, *id, **tmp; - HW_API_Reason *objp; - - id = getThis(); - objp = (HW_API_Reason *) php_hwapi_get_object(id, le_hwapi_reasonp); - - if(!objp) { - RETURN_FALSE; - } - RETURN_LONG((long) (objp->type())); -} -/* }}} */ - -/* {{{ proto string hwapi_reason_description(string language) - Returns description of HW_API_Reason */ -PHP_FUNCTION(hwapi_reason_description) { - zval **arg1, *id, **tmp; - HW_API_Reason *objp; - HW_API_String desc; - - if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - - id = getThis(); - objp = (HW_API_Reason *) php_hwapi_get_object(id, le_hwapi_reasonp); - - if(!objp) { - RETURN_FALSE; - } - desc = objp->description((HW_API_String) (Z_STRVAL_PP(arg1))); - RETURN_STRING((char *) desc.string(), 1); -} -/* }}} */ - -/* hw_api_class_get_property(zend_property_reference *property_reference) {{{ - * - */ -pval hw_api_class_get_property(zend_property_reference *property_reference) { - pval result; - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - - printf("Reading a property from a HW_API object:\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - Z_STRVAL(result) = estrndup("testing", 7); - Z_STRLEN(result) = 7; - Z_TYPE(result) = IS_STRING; - return result; -} -/* }}} */ - -/* hw_api_class_set_property(zend_property_reference *property_reference, pval *value) {{{ - */ -int hw_api_class_set_property(zend_property_reference *property_reference, pval *value) { - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - printf("Writing to a property from a HW_API object:\n"); - printf("Writing '"); - zend_print_variable(value); - printf("'\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - return 0; -} -/* }}} */ - -/* hw_api_class_startup() {{{ - */ -void hw_api_class_startup() { - zend_class_entry ce; - - INIT_OVERLOADED_CLASS_ENTRY(ce, "HW_API", php_hw_api_functions, - NULL, - NULL, - NULL); - - hw_api_class_entry_ptr = zend_register_internal_class_ex(&ce, NULL, NULL); -} -/* }}} */ - -/* hw_api_object_class_get_property(zend_property_reference *property_reference) {{{ - */ -pval hw_api_object_class_get_property(zend_property_reference *property_reference) { - pval result; - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - - printf("Reading a property from a HW_API_Object object:\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - Z_STRVAL(result) = estrndup("testing", 7); - Z_STRLEN(result) = 7; - Z_TYPE(result) = IS_STRING; - return result; -} -/* }}} */ - -/* hw_api_object_class_set_property(zend_property_reference *property_reference, pval *value) {{{ - */ -int hw_api_object_class_set_property(zend_property_reference *property_reference, pval *value) { - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - printf("Writing to a property from a HW_API_Object object:\n"); - printf("Writing '"); - zend_print_variable(value); - printf("'\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - return 0; -} -/* }}} */ - -/* {{{ hw_api_object_class_startup() - */ -void hw_api_object_class_startup() { - zend_class_entry ce; - - INIT_OVERLOADED_CLASS_ENTRY(ce, "hw_api_object", php_hw_api_object_functions, - NULL, - NULL, - NULL); - - hw_api_object_class_entry_ptr = zend_register_internal_class_ex(&ce, NULL, NULL); -} -/* }}} */ - -/* hw_api_attribute_class_get_property(zend_property_reference *property_reference) {{{ - */ -pval hw_api_attribute_class_get_property(zend_property_reference *property_reference) { - pval result; - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - printf("Reading a property from a HW_API_Attribute object:\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - Z_STRVAL(result) = estrndup("testing", 7); - Z_STRLEN(result) = 7; - Z_TYPE(result) = IS_STRING; - return result; -} -/* }}} */ - -/* hw_api_attribute_class_set_property(zend_property_reference *property_reference, pval *value) {{{ - */ -int hw_api_attribute_class_set_property(zend_property_reference *property_reference, pval *value) { - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - - printf("Writing to a property from a HW_API_Attribute object:\n"); - printf("Writing '"); - zend_print_variable(value); - printf("'\n"); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - printf("Array offset: "); - break; - case OE_IS_OBJECT: - printf("Object property: "); - break; - } - switch (Z_TYPE(overloaded_property->element)) { - case IS_LONG: - printf("%ld (numeric)\n", Z_LVAL(overloaded_property->element)); - break; - case IS_STRING: - printf("'%s'\n", Z_STRVAL(overloaded_property->element)); - break; - } - pval_destructor(&overloaded_property->element); - } - - return 0; -} -/* }}} */ - -/* hw_api_attribute_class_startup() {{{ - */ -void hw_api_attribute_class_startup() { - zend_class_entry hw_api_attribute_class_entry; - - INIT_OVERLOADED_CLASS_ENTRY(hw_api_attribute_class_entry, "HW_API_Attribute", php_hw_api_attribute_functions, - NULL, - NULL, - NULL); - - hw_api_attribute_class_entry_ptr = zend_register_internal_class(&hw_api_attribute_class_entry); -} -/* }}} */ - -/* hw_api_error_class_startup() {{{ - */ -void hw_api_error_class_startup() { - zend_class_entry hw_api_error_class_entry; - - INIT_OVERLOADED_CLASS_ENTRY(hw_api_error_class_entry, "HW_API_Error", php_hw_api_error_functions, - NULL, - NULL, - NULL); - - hw_api_error_class_entry_ptr = zend_register_internal_class(&hw_api_error_class_entry); -} -/* }}} */ - -/* hw_api_content_class_startup() {{{ - */ -void hw_api_content_class_startup() { - zend_class_entry hw_api_content_class_entry; - - INIT_OVERLOADED_CLASS_ENTRY(hw_api_content_class_entry, "HW_API_Content", php_hw_api_content_functions, - NULL, - NULL, - NULL); - - hw_api_content_class_entry_ptr = zend_register_internal_class(&hw_api_content_class_entry); -} -/* }}} */ - -/* hw_api_reason_class_startup() {{{ - */ -void hw_api_reason_class_startup() { - zend_class_entry hw_api_reason_class_entry; - - INIT_OVERLOADED_CLASS_ENTRY(hw_api_reason_class_entry, "HW_API_Reason", php_hw_api_reason_functions, - NULL, - NULL, - NULL); - - hw_api_reason_class_entry_ptr = zend_register_internal_class(&hw_api_reason_class_entry); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/hwapi/php_hwapi.h b/ext/hwapi/php_hwapi.h deleted file mode 100644 index 654a9e9c43889..0000000000000 --- a/ext/hwapi/php_hwapi.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_HWAPI_H -#define PHP_HWAPI_H - -#ifdef PHP_WIN32 -#define PHP_HWAPI_API __declspec(dllexport) -#else -#define PHP_HWAPI_API -#endif - -#if HAVE_HWAPI -#ifndef DLEXPORT -#define DLEXPORT -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry hwapi_module_entry; -#define hwapi_module_ptr &hwapi_module_entry - -typedef struct { - long default_link; - long default_port; - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - int le_socketp, le_psocketp, le_document; -} zend_hwapi_globals; - -#ifdef ZTS -# define HwApiSLS_D zend_hwapi_globals *hwapi_globals -# define HwApiSLS_DC , HwApiSLS_D -# define HwApiSLS_C hwapi_globals -# define HwApiSLS_CC , HwApiSLS_C -# define HwApiSG(v) (hwapi_globals->v) -# define HwApiSLS_FETCH() zend_hwapi_globals *hwapi_globals = ts_resource(hwapi_globals_id) -#else -# define HwApiSLS_D -# define HwApiSLS_DC -# define HwApiSLS_C -# define HwApiSLS_CC -# define HwApiSG(v) (hwapi_globals.v) -# define HwApiSLS_FETCH() -extern PHP_HWAPI_API zend_hwapi_globals hwapi_globals; -#endif - -extern PHP_MINIT_FUNCTION(hwapi); -PHP_MINFO_FUNCTION(hwapi); - -/* HW_API */ -PHP_FUNCTION(hwapi_dummy); -PHP_FUNCTION(hwapi_init); -PHP_FUNCTION(hwapi_hgcsp); -PHP_FUNCTION(hwapi_object); -PHP_FUNCTION(hwapi_children); -PHP_FUNCTION(hwapi_mychildren); -PHP_FUNCTION(hwapi_parents); -PHP_FUNCTION(hwapi_find); -PHP_FUNCTION(hwapi_identify); -PHP_FUNCTION(hwapi_remove); -PHP_FUNCTION(hwapi_content); -PHP_FUNCTION(hwapi_copy); -PHP_FUNCTION(hwapi_link); -PHP_FUNCTION(hwapi_move); -PHP_FUNCTION(hwapi_lock); -PHP_FUNCTION(hwapi_unlock); -PHP_FUNCTION(hwapi_replace); -PHP_FUNCTION(hwapi_insert); -PHP_FUNCTION(hwapi_insertdocument); -PHP_FUNCTION(hwapi_insertcollection); - -PHP_FUNCTION(hwapi_srcanchors); -PHP_FUNCTION(hwapi_dstanchors); -PHP_FUNCTION(hwapi_objectbyanchor); -PHP_FUNCTION(hwapi_dstofsrcanchor); -PHP_FUNCTION(hwapi_srcsofdst); - -PHP_FUNCTION(hwapi_checkin); -PHP_FUNCTION(hwapi_checkout); -PHP_FUNCTION(hwapi_setcommittedversion); -PHP_FUNCTION(hwapi_revert); -PHP_FUNCTION(hwapi_history); -PHP_FUNCTION(hwapi_removeversion); -PHP_FUNCTION(hwapi_freeversion); - -PHP_FUNCTION(hwapi_configurationhistory); -PHP_FUNCTION(hwapi_saveconfiguration); -PHP_FUNCTION(hwapi_restoreconfiguration); -PHP_FUNCTION(hwapi_mergeconfiguration); -PHP_FUNCTION(hwapi_removeconfiguration); - -PHP_FUNCTION(hwapi_user); -PHP_FUNCTION(hwapi_userlist); -PHP_FUNCTION(hwapi_hwstat); -PHP_FUNCTION(hwapi_dcstat); -PHP_FUNCTION(hwapi_dbstat); -PHP_FUNCTION(hwapi_ftstat); -PHP_FUNCTION(hwapi_info); - -/* HW_Object */ -PHP_FUNCTION(hwapi_object_new); -PHP_FUNCTION(hwapi_object_count); -PHP_FUNCTION(hwapi_object_title); -PHP_FUNCTION(hwapi_object_attreditable); -PHP_FUNCTION(hwapi_object_assign); -PHP_FUNCTION(hwapi_object_attribute); -PHP_FUNCTION(hwapi_object_insert); -PHP_FUNCTION(hwapi_object_remove); -PHP_FUNCTION(hwapi_object_value); - -/* HW_Attribute */ -PHP_FUNCTION(hwapi_attribute_new); -PHP_FUNCTION(hwapi_attribute_key); -PHP_FUNCTION(hwapi_attribute_value); -PHP_FUNCTION(hwapi_attribute_values); -PHP_FUNCTION(hwapi_attribute_langdepvalue); - -/* HW_Content */ -PHP_FUNCTION(hwapi_content_new); -PHP_FUNCTION(hwapi_content_read); -PHP_FUNCTION(hwapi_content_mimetype); - -/* HW_Error */ -PHP_FUNCTION(hwapi_error_count); -PHP_FUNCTION(hwapi_error_reason); - -/* HW_Reason */ -PHP_FUNCTION(hwapi_reason_type); -PHP_FUNCTION(hwapi_reason_description); - -#else -#define hwapi_module_ptr NULL -#endif /* HAVE_HWAPI */ -#define phpext_hwapi_ptr hwapi_module_ptr -#endif /* PHP_HWAPI_H */ - diff --git a/ext/iconv/CREDITS b/ext/iconv/CREDITS deleted file mode 100644 index 70d3825ac3a01..0000000000000 --- a/ext/iconv/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Iconv -Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 deleted file mode 100644 index 8df214561c62b..0000000000000 --- a/ext/iconv/config.m4 +++ /dev/null @@ -1,153 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(iconv, for iconv support, -[ --without-iconv[=DIR] Exclude iconv support], yes) - -if test "$PHP_ICONV" != "no"; then - - PHP_SETUP_ICONV(ICONV_SHARED_LIBADD, [ - iconv_avail="yes"; - ],[ - iconv_avail="no"; - ]) - - if test "$iconv_avail" != "no"; then - iconv_cflags_save="$CFLAGS" - iconv_ldflags_save="$LDFLAGS" - - if test -z "$ICONV_DIR"; then - for i in /usr/local /usr; do - if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then - PHP_ICONV_PREFIX="$i" - break - fi - done - if test -z "$PHP_ICONV_PREFIX"; then - PHP_ICONV_PREFIX="/usr" - fi - else - PHP_ICONV_PREFIX="$ICONV_DIR" - fi - - CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS" - LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS" - - if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h" - else - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h" - fi - - if test -z "$iconv_lib_name"; then - AC_MSG_CHECKING([if iconv is glibc's]) - AC_TRY_LINK([#include ],[gnu_get_libc_version();], - [ - AC_MSG_RESULT(yes) - iconv_impl_name="glibc" - ],[ - AC_MSG_RESULT(no) - ]) - else - case "$iconv_lib_name" in - iconv [)] - AC_MSG_CHECKING([if iconv is Konstantin Chuguev's]) - AC_TRY_LINK([#include ],[iconv_ccs_init(NULL, NULL);], - [ - AC_MSG_RESULT(yes) - iconv_impl_name="bsd" - ],[ - AC_MSG_RESULT(no) - iconv_impl_name="gnu_libiconv" - ]) - ;; - - giconv [)] - iconv_impl_name="gnu_libiconv" - ;; - - biconv [)] - iconv_impl_name="bsd" - ;; - esac - fi - - echo > ext/iconv/php_have_bsd_iconv.h - echo > ext/iconv/php_have_glibc_iconv.h - - case "$iconv_impl_name" in - gnu_libiconv [)] - PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv]) - AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use]) - ;; - - bsd [)] - PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv]) - AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chuguev's iconv implementation]) - PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv]) - AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use]) - ;; - - glibc [)] - PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv]) - AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation]) - PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv]) - AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use]) - ;; - esac - - AC_MSG_CHECKING([if iconv supports errno]) - AC_TRY_RUN([ -#include <$PHP_ICONV_H_PATH> -#include - -int main() { - iconv_t cd; - cd = iconv_open( "*blahblah*", "*blahblah*" ); - if (cd == (iconv_t)(-1)) { - if (errno == EINVAL) { - return 0; - } else { - return 1; - } - } - iconv_close( cd ); - return 2; -} - ],[ - AC_MSG_RESULT(yes) - PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv]) - AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not]) - ],[ - AC_MSG_RESULT(no) - PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv]) - AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not]) - ],[ - AC_MSG_RESULT(no, cross-compiling) - PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv]) - AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not]) - ]) - - AC_MSG_CHECKING([if your cpp allows macro usage in include lines]) - AC_TRY_COMPILE([ -#define FOO <$PHP_ICONV_H_PATH> -#include FOO - ], [], [ - AC_MSG_RESULT([yes]) - PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv]) - AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h]) - ], [ - AC_MSG_RESULT([no]) - ]) - - CFLAGS="$iconv_cflags_save" - LDFLAGS="$iconv_ldflags_save" - - PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"]) - PHP_SUBST(ICONV_SHARED_LIBADD) - PHP_INSTALL_HEADERS([ext/iconv/]) - else - AC_MSG_ERROR(Please reinstall the iconv library.) - fi -fi diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32 deleted file mode 100644 index 8b38e2c37b5f7..0000000000000 --- a/ext/iconv/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// vim: ft=javascript - -ARG_WITH("iconv", "iconv support", "yes"); - -if (PHP_ICONV != "no") { - if (/*CHECK_LIB("iconv.lib", "iconv", PHP_ICONV) &&*/ - CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) { - EXTENSION("iconv", "iconv.c"); - - AC_DEFINE("HAVE_ICONV", 1, "Define if iconv extension is enabled"); - AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available"); - AC_DEFINE("PHP_ICONV_IMPL", "\"libiconv\"", "Which iconv implementation to use"); - AC_DEFINE("ICONV_SUPPORTS_ERRNO", 1, "Whether iconv supports errno or not"); - ADD_FLAG("CFLAGS_ICONV", "/D PHP_ICONV_EXPORTS "); - if (!PHP_ICONV_SHARED) { - ADD_DEF_FILE("ext\\iconv\\php_iconv.def"); - } - } -} - diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c deleted file mode 100644 index 4ad189587ea3f..0000000000000 --- a/ext/iconv/iconv.c +++ /dev/null @@ -1,2708 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rui Hirokawa | - | Stig Bakken | - | Moriyoshi Koizumi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "main/php_output.h" -#include "SAPI.h" -#include "php_ini.h" - -#ifdef HAVE_STDLIB_H -# include -#endif - -#include - -#include "php_iconv.h" - -#ifdef HAVE_ICONV - -#ifdef PHP_ICONV_H_PATH -#include PHP_ICONV_H_PATH -#else -#include -#endif - -#ifdef HAVE_GLIBC_ICONV -#include -#endif - -#ifdef HAVE_LIBICONV -#undef iconv -#endif - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/base64.h" -#include "ext/standard/quot_print.h" - -#define _php_iconv_memequal(a, b, c) \ - ((c) == sizeof(unsigned long) ? *((unsigned long *)(a)) == *((unsigned long *)(b)) : ((c) == sizeof(unsigned int) ? *((unsigned int *)(a)) == *((unsigned int *)(b)) : memcmp(a, b, c) == 0)) - -/* {{{ iconv_functions[] - */ -function_entry iconv_functions[] = { - PHP_NAMED_FE(iconv,php_if_iconv, NULL) - PHP_FE(ob_iconv_handler, NULL) - PHP_FE(iconv_get_encoding, NULL) - PHP_FE(iconv_set_encoding, NULL) - PHP_FE(iconv_strlen, NULL) - PHP_FE(iconv_substr, NULL) - PHP_FE(iconv_strpos, NULL) - PHP_FE(iconv_strrpos, NULL) - PHP_FE(iconv_mime_encode, NULL) - PHP_FE(iconv_mime_decode, NULL) - PHP_FE(iconv_mime_decode_headers, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ iconv_module_entry - */ -zend_module_entry iconv_module_entry = { - STANDARD_MODULE_HEADER, - "iconv", - iconv_functions, - PHP_MINIT(miconv), - PHP_MSHUTDOWN(miconv), - NULL, - NULL, - PHP_MINFO(miconv), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(iconv) - -#ifdef COMPILE_DL_ICONV -ZEND_GET_MODULE(iconv) -#endif - -#ifdef HAVE_LIBICONV -#define iconv libiconv -#endif - -/* {{{ typedef enum php_iconv_enc_scheme_t */ -typedef enum _php_iconv_enc_scheme_t { - PHP_ICONV_ENC_SCHEME_BASE64, - PHP_ICONV_ENC_SCHEME_QPRINT -} php_iconv_enc_scheme_t; -/* }}} */ - -#define PHP_ICONV_MIME_DECODE_STRICT (1<<0) -#define PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR (1<<1) - -/* {{{ prototypes */ -static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd); -static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd); - -static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC); - -static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char *str, size_t nbytes, const char *enc); - -static php_iconv_err_t _php_iconv_substr(smart_str *pretval, const char *str, size_t nbytes, int offset, int len, const char *enc); - -static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval, const char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, int offset, const char *enc); - -static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, unsigned int max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc); - -static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode); - -static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D); -static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D); -/* }}} */ - -/* {{{ static globals */ -static char _generic_superset_name[] = "UCS-4LE"; -#define GENERIC_SUPERSET_NAME _generic_superset_name -#define GENERIC_SUPERSET_NBYTES 4 -/* }}} */ - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("iconv.input_encoding", ICONV_INPUT_ENCODING, PHP_INI_ALL, OnUpdateString, input_encoding, zend_iconv_globals, iconv_globals) - STD_PHP_INI_ENTRY("iconv.output_encoding", ICONV_OUTPUT_ENCODING, PHP_INI_ALL, OnUpdateString, output_encoding, zend_iconv_globals, iconv_globals) - STD_PHP_INI_ENTRY("iconv.internal_encoding", ICONV_INTERNAL_ENCODING, PHP_INI_ALL, OnUpdateString, internal_encoding, zend_iconv_globals, iconv_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_iconv_init_globals */ -static void php_iconv_init_globals(zend_iconv_globals *iconv_globals) -{ - iconv_globals->input_encoding = NULL; - iconv_globals->output_encoding = NULL; - iconv_globals->internal_encoding = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(miconv) -{ - char *version = "unknown"; - - ZEND_INIT_MODULE_GLOBALS(iconv, php_iconv_init_globals, NULL); - REGISTER_INI_ENTRIES(); - -#if HAVE_LIBICONV - { - static char buf[16]; - snprintf(buf, sizeof(buf), "%d.%d", - ((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f)); - version = buf; - } -#elif HAVE_GLIBC_ICONV - version = (char *)gnu_get_libc_version(); -#endif - -#ifdef PHP_ICONV_IMPL - REGISTER_STRING_CONSTANT("ICONV_IMPL", PHP_ICONV_IMPL, CONST_CS | CONST_PERSISTENT); -#elif HAVE_LIBICONV - REGISTER_STRING_CONSTANT("ICONV_IMPL", "libiconv", CONST_CS | CONST_PERSISTENT); -#else - REGISTER_STRING_CONSTANT("ICONV_IMPL", "unknown", CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_STRING_CONSTANT("ICONV_VERSION", version, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_STRICT", PHP_ICONV_MIME_DECODE_STRICT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_CONTINUE_ON_ERROR", PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR, CONST_CS | CONST_PERSISTENT); - - if (php_iconv_stream_filter_register_factory(TSRMLS_C) != PHP_ICONV_ERR_SUCCESS) { - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(miconv) -{ - php_iconv_stream_filter_unregister_factory(TSRMLS_C); - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(miconv) -{ - zval iconv_impl, iconv_ver; - - zend_get_constant("ICONV_IMPL", sizeof("ICONV_IMPL")-1, &iconv_impl TSRMLS_CC); - zend_get_constant("ICONV_VERSION", sizeof("ICONV_VERSION")-1, &iconv_ver TSRMLS_CC); - - convert_to_string(&iconv_impl); - convert_to_string(&iconv_ver); - - php_info_print_table_start(); - php_info_print_table_row(2, "iconv support", "enabled"); - php_info_print_table_row(2, "iconv implementation", Z_STRVAL(iconv_impl)); - php_info_print_table_row(2, "iconv library version", Z_STRVAL(iconv_ver)); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - zval_dtor(&iconv_impl); - zval_dtor(&iconv_ver); -} -/* }}} */ - -/* {{{ _php_iconv_appendl() */ -static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd) -{ - const char *in_p = s; - size_t in_left = l; - char *out_p; - size_t out_left = 0; - size_t buf_growth = 128; -#if !ICONV_SUPPORTS_ERRNO - size_t prev_in_left = in_left; -#endif - - if (in_p != NULL) { - while (in_left > 0) { - out_left = buf_growth - out_left; - { - size_t newlen; - smart_str_alloc((d), out_left, 0); - } - - out_p = (d)->c + (d)->len; - - if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - return PHP_ICONV_ERR_ILLEGAL_CHAR; - - case EILSEQ: - return PHP_ICONV_ERR_ILLEGAL_SEQ; - - case E2BIG: - break; - - default: - return PHP_ICONV_ERR_UNKNOWN; - } -#else - if (prev_in_left == in_left) { - return PHP_ICONV_ERR_UNKNOWN; - } -#endif - } -#if !ICONV_SUPPORTS_ERRNO - prev_in_left = in_left; -#endif - (d)->len += (buf_growth - out_left); - buf_growth <<= 1; - } - } else { - for (;;) { - out_left = buf_growth - out_left; - { - size_t newlen; - smart_str_alloc((d), out_left, 0); - } - - out_p = (d)->c + (d)->len; - - if (iconv(cd, NULL, NULL, (char **) &out_p, &out_left) == (size_t)0) { - (d)->len += (buf_growth - out_left); - break; - } else { -#if ICONV_SUPPORTS_ERRNO - if (errno != E2BIG) { - return PHP_ICONV_ERR_UNKNOWN; - } -#else - if (out_left != 0) { - return PHP_ICONV_ERR_UNKNOWN; - } -#endif - } - (d)->len += (buf_growth - out_left); - buf_growth <<= 1; - } - } - return PHP_ICONV_ERR_SUCCESS; -} -/* }}} */ - -/* {{{ _php_iconv_appendc() */ -static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd) -{ - return _php_iconv_appendl(d, &c, 1, cd); -} -/* }}} */ - -/* {{{ php_iconv_string() - */ -PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len, - char **out, size_t *out_len, - const char *out_charset, const char *in_charset) -{ -#if !ICONV_SUPPORTS_ERRNO - size_t in_size, out_size, out_left; - char *out_buffer, *out_p; - iconv_t cd; - size_t result; - - *out = NULL; - *out_len = 0; - - /* - This is not the right way to get output size... - This is not space efficient for large text. - This is also problem for encoding like UTF-7/UTF-8/ISO-2022 which - a single char can be more than 4 bytes. - I added 15 extra bytes for safety. - */ - out_size = in_len * sizeof(int) + 15; - out_left = out_size; - - in_size = in_len; - - cd = iconv_open(out_charset, in_charset); - - if (cd == (iconv_t)(-1)) { - return PHP_ICONV_ERR_UNKNOWN; - } - - out_buffer = (char *) emalloc(out_size + 1); - out_p = out_buffer; - - result = iconv(cd, (const char **) &in_p, &in_size, (char **) - &out_p, &out_left); - - if (result == (size_t)(-1)) { - efree(out_buffer); - return PHP_ICONV_ERR_UNKNOWN; - } - - if (out_left < 8) { - out_buffer = (char *) erealloc(out_buffer, out_size + 8); - } - - /* flush the shift-out sequences */ - result = iconv(cd, NULL, NULL, &out_p, &out_left); - - if (result == (size_t)(-1)) { - efree(out_buffer); - return PHP_ICONV_ERR_UNKNOWN; - } - - *out_len = out_size - out_left; - out_buffer[*out_len] = '\0'; - *out = out_buffer; - - iconv_close(cd); - - return PHP_ICONV_ERR_SUCCESS; - -#else - /* - iconv supports errno. Handle it better way. - */ - iconv_t cd; - size_t in_left, out_size, out_left; - char *out_p, *out_buf, *tmp_buf; - size_t bsz, result = 0; - php_iconv_err_t retval = PHP_ICONV_ERR_SUCCESS; - - *out = NULL; - *out_len = 0; - - cd = iconv_open(out_charset, in_charset); - - if (cd == (iconv_t)(-1)) { - if (errno == EINVAL) { - return PHP_ICONV_ERR_WRONG_CHARSET; - } else { - return PHP_ICONV_ERR_CONVERTER; - } - } - in_left= in_len; - out_left = in_len + 32; /* Avoid realloc() most cases */ - out_size = 0; - bsz = out_left; - out_buf = (char *) emalloc(bsz+1); - out_p = out_buf; - - while (in_left > 0) { - result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left); - out_size = bsz - out_left; - if (result == (size_t)(-1)) { - if (errno == E2BIG && in_left > 0) { - /* converted string is longer than out buffer */ - bsz += in_len; - - tmp_buf = (char*) erealloc(out_buf, bsz+1); - out_p = out_buf = tmp_buf; - out_p += out_size; - out_left = bsz - out_size; - continue; - } - } - break; - } - - if (result != (size_t)(-1)) { - /* flush the shift-out sequences */ - for (;;) { - result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left); - out_size = bsz - out_left; - - if (result != (size_t)(-1)) { - break; - } - - if (errno == E2BIG) { - bsz += 16; - tmp_buf = (char *) erealloc(out_buf, bsz); - - out_p = out_buf = tmp_buf; - out_p += out_size; - out_left = bsz - out_size; - } else { - break; - } - } - } - - iconv_close(cd); - - if (result == (size_t)(-1)) { - switch (errno) { - case EINVAL: - retval = PHP_ICONV_ERR_ILLEGAL_CHAR; - break; - - case EILSEQ: - retval = PHP_ICONV_ERR_ILLEGAL_SEQ; - break; - - case E2BIG: - /* should not happen */ - retval = PHP_ICONV_ERR_TOO_BIG; - break; - - default: - /* other error */ - retval = PHP_ICONV_ERR_UNKNOWN; - efree(out_buf); - return PHP_ICONV_ERR_UNKNOWN; - } - } - *out_p = '\0'; - *out = out_buf; - *out_len = out_size; - return retval; -#endif -} -/* }}} */ - -/* {{{ _php_iconv_strlen() */ -static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char *str, size_t nbytes, const char *enc) -{ - char buf[GENERIC_SUPERSET_NBYTES*2]; - - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - - iconv_t cd; - - const char *in_p; - size_t in_left; - - char *out_p; - size_t out_left; - - unsigned int cnt; - - *pretval = (unsigned int)-1; - - cd = iconv_open(GENERIC_SUPERSET_NAME, enc); - - if (cd == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - return PHP_ICONV_ERR_WRONG_CHARSET; - } else { - return PHP_ICONV_ERR_CONVERTER; - } -#else - return PHP_ICONV_ERR_UNKNOWN; -#endif - } - - errno = out_left = 0; - - for (in_p = str, in_left = nbytes, cnt = 0; in_left > 0; cnt+=2) { - size_t prev_in_left; - out_p = buf; - out_left = sizeof(buf); - - prev_in_left = in_left; - - if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { - if (prev_in_left == in_left) { - break; - } - } - } - - if (out_left > 0) { - cnt -= out_left / GENERIC_SUPERSET_NBYTES; - } - -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - err = PHP_ICONV_ERR_ILLEGAL_CHAR; - break; - - case EILSEQ: - err = PHP_ICONV_ERR_ILLEGAL_SEQ; - break; - - case E2BIG: - case 0: - *pretval = cnt; - break; - - default: - err = PHP_ICONV_ERR_UNKNOWN; - break; - } -#else - *pretval = cnt; -#endif - - iconv_close(cd); - - return err; -} - -/* }}} */ - -/* {{{ _php_iconv_substr() */ -static php_iconv_err_t _php_iconv_substr(smart_str *pretval, - const char *str, size_t nbytes, int offset, int len, const char *enc) -{ - char buf[GENERIC_SUPERSET_NBYTES]; - - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - - iconv_t cd1, cd2; - - const char *in_p; - size_t in_left; - - char *out_p; - size_t out_left; - - unsigned int cnt; - unsigned int total_len; - - err = _php_iconv_strlen(&total_len, str, nbytes, enc); - if (err != PHP_ICONV_ERR_SUCCESS) { - return err; - } - - /* normalize the offset and the length */ - if (offset < 0) { - if ((offset += total_len) < 0) { - offset = 0; - } - } - if (len < 0) { - if ((len += (total_len - offset)) < 0) { - len = 0; - } - } - - if (offset >= total_len) { - return PHP_ICONV_ERR_SUCCESS; - } - - if ((offset + len) > total_len) { - /* trying to compute the length */ - len = total_len - offset; - } - - if (len == 0) { - return PHP_ICONV_ERR_SUCCESS; - } - - cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc); - - if (cd1 == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - return PHP_ICONV_ERR_WRONG_CHARSET; - } else { - return PHP_ICONV_ERR_CONVERTER; - } -#else - return PHP_ICONV_ERR_UNKNOWN; -#endif - } - - cd2 = NULL; - - for (in_p = str, in_left = nbytes, cnt = 0; in_left > 0 && len > 0; ++cnt) { - size_t prev_in_left; - out_p = buf; - out_left = sizeof(buf); - - prev_in_left = in_left; - - if (iconv(cd1, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { - if (prev_in_left == in_left) { - break; - } - } - - if (cnt >= (unsigned int)offset) { - if (cd2 == NULL) { - cd2 = iconv_open(enc, GENERIC_SUPERSET_NAME); - - if (cd2 == (iconv_t)(-1)) { - cd2 = NULL; -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - err = PHP_ICONV_ERR_WRONG_CHARSET; - } else { - err = PHP_ICONV_ERR_CONVERTER; - } -#else - err = PHP_ICONV_ERR_UNKNOWN; -#endif - break; - } - } - - _php_iconv_appendl(pretval, buf, sizeof(buf), cd2); - --len; - } - - } - -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - err = PHP_ICONV_ERR_ILLEGAL_CHAR; - break; - - case EILSEQ: - err = PHP_ICONV_ERR_ILLEGAL_SEQ; - break; - - case E2BIG: - break; - - default: - err = PHP_ICONV_ERR_UNKNOWN; - break; - } -#endif - if (err == PHP_ICONV_ERR_SUCCESS) { - if (cd2 != NULL) { - _php_iconv_appendl(pretval, NULL, 0, cd2); - } - smart_str_0(pretval); - } - - if (cd1 != NULL) { - iconv_close(cd1); - } - - if (cd2 != NULL) { - iconv_close(cd2); - } - return err; -} - -/* }}} */ - -/* {{{ _php_iconv_strpos() */ -static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval, - const char *haystk, size_t haystk_nbytes, - const char *ndl, size_t ndl_nbytes, - int offset, const char *enc) -{ - char buf[GENERIC_SUPERSET_NBYTES]; - - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - - iconv_t cd; - - const char *in_p; - size_t in_left; - - char *out_p; - size_t out_left; - - unsigned int cnt; - - char *ndl_buf; - const char *ndl_buf_p; - size_t ndl_buf_len, ndl_buf_left; - - unsigned int match_ofs; - - *pretval = (unsigned int)-1; - - err = php_iconv_string(ndl, ndl_nbytes, - &ndl_buf, &ndl_buf_len, GENERIC_SUPERSET_NAME, enc); - - if (err != PHP_ICONV_ERR_SUCCESS) { - if (ndl_buf != NULL) { - efree(ndl_buf); - } - return err; - } - - cd = iconv_open(GENERIC_SUPERSET_NAME, enc); - - if (cd == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - return PHP_ICONV_ERR_WRONG_CHARSET; - } else { - return PHP_ICONV_ERR_CONVERTER; - } -#else - return PHP_ICONV_ERR_UNKNOWN; -#endif - } - - ndl_buf_p = ndl_buf; - ndl_buf_left = ndl_buf_len; - match_ofs = (unsigned int)-1; - - for (in_p = haystk, in_left = haystk_nbytes, cnt = 0; in_left > 0; ++cnt) { - size_t prev_in_left; - out_p = buf; - out_left = sizeof(buf); - - prev_in_left = in_left; - - if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { - if (prev_in_left == in_left) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - err = PHP_ICONV_ERR_ILLEGAL_CHAR; - break; - - case EILSEQ: - err = PHP_ICONV_ERR_ILLEGAL_SEQ; - break; - - case E2BIG: - break; - - default: - err = PHP_ICONV_ERR_UNKNOWN; - break; - } -#endif - break; - } - } - if (offset >= 0) { - if (cnt >= (unsigned int)offset) { - if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) { - if (match_ofs == (unsigned int)-1) { - match_ofs = cnt; - } - ndl_buf_p += GENERIC_SUPERSET_NBYTES; - ndl_buf_left -= GENERIC_SUPERSET_NBYTES; - if (ndl_buf_left == 0) { - *pretval = match_ofs; - break; - } - } else { - unsigned int i, j, lim; - - i = 0; - j = GENERIC_SUPERSET_NBYTES; - lim = (unsigned int)(ndl_buf_p - ndl_buf); - - while (j < lim) { - if (_php_iconv_memequal(&ndl_buf[j], &ndl_buf[i], - GENERIC_SUPERSET_NBYTES)) { - i += GENERIC_SUPERSET_NBYTES; - } else { - j -= i; - i = 0; - } - j += GENERIC_SUPERSET_NBYTES; - } - - if (!_php_iconv_memequal(buf, &ndl_buf[i], sizeof(buf))) { - i = 0; - } - - if (i == 0) { - match_ofs = (unsigned int)-1; - } else { - match_ofs += (lim - i) / GENERIC_SUPERSET_NBYTES; - i += GENERIC_SUPERSET_NBYTES; - } - ndl_buf_p = &ndl_buf[i]; - ndl_buf_left = ndl_buf_len - i; - } - } - } else { - if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) { - if (match_ofs == (unsigned int)-1) { - match_ofs = cnt; - } - ndl_buf_p += GENERIC_SUPERSET_NBYTES; - ndl_buf_left -= GENERIC_SUPERSET_NBYTES; - if (ndl_buf_left == 0) { - *pretval = match_ofs; - ndl_buf_p = ndl_buf; - ndl_buf_left = ndl_buf_len; - match_ofs = -1; - } - } else { - unsigned int i, j, lim; - - i = 0; - j = GENERIC_SUPERSET_NBYTES; - lim = (unsigned int)(ndl_buf_p - ndl_buf); - - while (j < lim) { - if (_php_iconv_memequal(&ndl_buf[j], &ndl_buf[i], - GENERIC_SUPERSET_NBYTES)) { - i += GENERIC_SUPERSET_NBYTES; - } else { - j -= i; - i = 0; - } - j += GENERIC_SUPERSET_NBYTES; - } - - if (!_php_iconv_memequal(buf, &ndl_buf[i], sizeof(buf))) { - i = 0; - } - - if (i == 0) { - match_ofs = (unsigned int)-1; - } else { - match_ofs += (lim - i) / GENERIC_SUPERSET_NBYTES; - i += GENERIC_SUPERSET_NBYTES; - } - ndl_buf_p = &ndl_buf[i]; - ndl_buf_left = ndl_buf_len - i; - } - } - } - - if (ndl_buf) { - efree(ndl_buf); - } - - iconv_close(cd); - - return err; -} -/* }}} */ - -/* {{{ _php_iconv_mime_encode() */ -static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, unsigned int max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc) -{ - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - iconv_t cd = (iconv_t)(-1), cd_pl = (iconv_t)(-1); - unsigned int char_cnt = 0; - size_t out_charset_len; - size_t lfchars_len; - char *buf = NULL; - char *encoded = NULL; - size_t encoded_len; - const char *in_p; - size_t in_left; - char *out_p; - size_t out_left; - static int qp_table[256] = { - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x00 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 */ - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x20 */ - 1, 1, 1, 1, 1, 1, 1 ,1, 1, 1, 1, 1, 1, 3, 1, 3, /* 0x30 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, /* 0x50 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, /* 0x70 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x80 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x90 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xA0 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xB0 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xC0 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xD0 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xE0 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 /* 0xF0 */ - }; - - out_charset_len = strlen(out_charset); - lfchars_len = strlen(lfchars); - - if ((fname_nbytes + 2) >= max_line_len - || (out_charset_len + 12) >= max_line_len) { - /* field name is too long */ - err = PHP_ICONV_ERR_TOO_BIG; - goto out; - } - - cd_pl = iconv_open("ASCII", enc); - if (cd_pl == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - err = PHP_ICONV_ERR_WRONG_CHARSET; - } else { - err = PHP_ICONV_ERR_CONVERTER; - } -#else - err = PHP_ICONV_ERR_UNKNOWN; -#endif - goto out; - } - - cd = iconv_open(out_charset, enc); - if (cd == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - err = PHP_ICONV_ERR_WRONG_CHARSET; - } else { - err = PHP_ICONV_ERR_CONVERTER; - } -#else - err = PHP_ICONV_ERR_UNKNOWN; -#endif - goto out; - } - - buf = emalloc(max_line_len + 5); - - char_cnt = max_line_len; - - _php_iconv_appendl(pretval, fname, fname_nbytes, cd_pl); - char_cnt -= fname_nbytes; - smart_str_appendl(pretval, ": ", sizeof(": ") - 1); - char_cnt -= 2; - - in_p = fval; - in_left = fval_nbytes; - - do { - size_t prev_in_left; - size_t out_size; - - if (char_cnt < (out_charset_len + 12)) { - /* lfchars must be encoded in ASCII here*/ - smart_str_appendl(pretval, lfchars, lfchars_len); - smart_str_appendc(pretval, ' '); - char_cnt = max_line_len - 1; - } - - smart_str_appendl(pretval, "=?", sizeof("=?") - 1); - char_cnt -= 2; - smart_str_appendl(pretval, out_charset, out_charset_len); - char_cnt -= out_charset_len; - smart_str_appendc(pretval, '?'); - char_cnt --; - - switch (enc_scheme) { - case PHP_ICONV_ENC_SCHEME_BASE64: { - size_t ini_in_left; - const char *ini_in_p; - size_t out_reserved = 4; - int dummy; - - smart_str_appendc(pretval, 'B'); - char_cnt--; - smart_str_appendc(pretval, '?'); - char_cnt--; - - prev_in_left = ini_in_left = in_left; - ini_in_p = in_p; - - out_size = (char_cnt - 2) / 4 * 3; - - for (;;) { - out_p = buf; - - if (out_size <= out_reserved) { - err = PHP_ICONV_ERR_TOO_BIG; - goto out; - } - - out_left = out_size - out_reserved; - - if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - err = PHP_ICONV_ERR_ILLEGAL_CHAR; - goto out; - - case EILSEQ: - err = PHP_ICONV_ERR_ILLEGAL_SEQ; - goto out; - - case E2BIG: - if (prev_in_left == in_left) { - err = PHP_ICONV_ERR_TOO_BIG; - goto out; - } - break; - - default: - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#else - if (prev_in_left == in_left) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#endif - } - - out_left += out_reserved; - - if (iconv(cd, NULL, NULL, (char **) &out_p, &out_left) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - if (errno != E2BIG) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#else - if (out_left != 0) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#endif - } else { - break; - } - - if (iconv(cd, NULL, NULL, NULL, NULL) == (size_t)-1) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } - - out_reserved += 4; - in_left = ini_in_left; - in_p = ini_in_p; - } - - prev_in_left = in_left; - - encoded = php_base64_encode(buf, (int)(out_size - out_left), &dummy); - encoded_len = (size_t)dummy; - - if (char_cnt < encoded_len) { - /* something went wrong! */ - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } - - smart_str_appendl(pretval, encoded, encoded_len); - char_cnt -= encoded_len; - smart_str_appendl(pretval, "?=", sizeof("?=") - 1); - char_cnt -= 2; - - efree(encoded); - encoded = NULL; - } break; /* case PHP_ICONV_ENC_SCHEME_BASE64: */ - - case PHP_ICONV_ENC_SCHEME_QPRINT: { - size_t ini_in_left; - const char *ini_in_p; - const unsigned char *p; - size_t nbytes_required; - - smart_str_appendc(pretval, 'Q'); - char_cnt--; - smart_str_appendc(pretval, '?'); - char_cnt--; - - prev_in_left = ini_in_left = in_left; - ini_in_p = in_p; - - for (out_size = char_cnt; out_size > 0;) { - size_t prev_out_left; - - nbytes_required = 0; - - out_p = buf; - out_left = out_size; - - if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EINVAL: - err = PHP_ICONV_ERR_ILLEGAL_CHAR; - goto out; - - case EILSEQ: - err = PHP_ICONV_ERR_ILLEGAL_SEQ; - goto out; - - case E2BIG: - if (prev_in_left == in_left) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } - break; - - default: - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#else - if (prev_in_left == in_left) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#endif - } - - prev_out_left = out_left; - if (iconv(cd, NULL, NULL, (char **) &out_p, &out_left) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - if (errno != E2BIG) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#else - if (out_left == prev_out_left) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } -#endif - } - - for (p = (unsigned char *)buf; p < (unsigned char *)out_p; p++) { - nbytes_required += qp_table[*p]; - } - - if (nbytes_required <= char_cnt - 2) { - break; - } - - out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / (3 - 1); - in_left = ini_in_left; - in_p = ini_in_p; - } - - for (p = (unsigned char *)buf; p < (unsigned char *)out_p; p++) { - if (qp_table[*p] == 1) { - smart_str_appendc(pretval, *(char *)p); - char_cnt--; - } else { - static char qp_digits[] = "0123456789ABCDEF"; - smart_str_appendc(pretval, '='); - smart_str_appendc(pretval, qp_digits[(*p >> 4) & 0x0f]); - smart_str_appendc(pretval, qp_digits[(*p & 0x0f)]); - char_cnt -= 3; - } - } - prev_in_left = in_left; - - smart_str_appendl(pretval, "?=", sizeof("?=") - 1); - char_cnt -= 2; - - if (iconv(cd, NULL, NULL, NULL, NULL) == (size_t)-1) { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } - - } break; /* case PHP_ICONV_ENC_SCHEME_QPRINT: */ - } - } while (in_left > 0); - - smart_str_0(pretval); - -out: - if (cd != (iconv_t)(-1)) { - iconv_close(cd); - } - if (cd_pl != (iconv_t)(-1)) { - iconv_close(cd_pl); - } - if (encoded != NULL) { - efree(encoded); - } - if (buf != NULL) { - efree(buf); - } - return err; -} -/* }}} */ - -/* {{{ _php_iconv_mime_decode() */ -static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode) -{ - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - - iconv_t cd = (iconv_t)(-1), cd_pl = (iconv_t)(-1); - - const char *p1; - size_t str_left; - unsigned int scan_stat = 0; - const char *csname = NULL; - size_t csname_len; - const char *encoded_text = NULL; - size_t encoded_text_len = 0; - const char *encoded_word = NULL; - const char *spaces = NULL; - - php_iconv_enc_scheme_t enc_scheme = PHP_ICONV_ENC_SCHEME_BASE64; - - if (next_pos != NULL) { - *next_pos = NULL; - } - - cd_pl = iconv_open(enc, "ASCII"); - - if (cd_pl == (iconv_t)(-1)) { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - err = PHP_ICONV_ERR_WRONG_CHARSET; - } else { - err = PHP_ICONV_ERR_CONVERTER; - } -#else - err = PHP_ICONV_ERR_UNKNOWN; -#endif - goto out; - } - - p1 = str; - for (str_left = str_nbytes; str_left > 0; str_left--, p1++) { - int eos = 0; - - switch (scan_stat) { - case 0: /* expecting any character */ - switch (*p1) { - case '\r': /* part of an EOL sequence? */ - scan_stat = 7; - break; - - case '\n': - scan_stat = 8; - break; - - case '=': /* first letter of an encoded chunk */ - encoded_word = p1; - scan_stat = 1; - break; - - case ' ': case '\t': /* a chunk of whitespaces */ - spaces = p1; - scan_stat = 11; - break; - - default: /* first letter of a non-encoded word */ - _php_iconv_appendc(pretval, *p1, cd_pl); - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } - break; - } - break; - - case 1: /* expecting a delimiter */ - if (*p1 != '?') { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } - csname = p1 + 1; - scan_stat = 2; - break; - - case 2: /* expecting a charset name */ - switch (*p1) { - case '?': /* normal delimiter: encoding scheme follows */ - scan_stat = 3; - break; - - case '*': /* new style delimiter: locale id follows */ - scan_stat = 10; - break; - } - if (scan_stat != 2) { - char tmpbuf[80]; - - if (csname == NULL) { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - - csname_len = (size_t)(p1 - csname); - - if (csname_len > sizeof(tmpbuf) - 1) { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - } - - memcpy(tmpbuf, csname, csname_len); - tmpbuf[csname_len] = '\0'; - - if (cd != (iconv_t)(-1)) { - iconv_close(cd); - } - - cd = iconv_open(enc, tmpbuf); - - if (cd == (iconv_t)(-1)) { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { -#if ICONV_SUPPORTS_ERRNO - if (errno == EINVAL) { - err = PHP_ICONV_ERR_WRONG_CHARSET; - } else { - err = PHP_ICONV_ERR_CONVERTER; - } -#else - err = PHP_ICONV_ERR_UNKNOWN; -#endif - goto out; - } - } - } - break; - - case 3: /* expecting a encoding scheme specifier */ - switch (*p1) { - case 'B': - enc_scheme = PHP_ICONV_ENC_SCHEME_BASE64; - scan_stat = 4; - break; - - case 'Q': - enc_scheme = PHP_ICONV_ENC_SCHEME_QPRINT; - scan_stat = 4; - break; - - default: - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - } - break; - - case 4: /* expecting a delimiter */ - if (*p1 != '?') { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - } - encoded_text = p1 + 1; - scan_stat = 5; - break; - - case 5: /* expecting an encoded portion */ - if (*p1 == '?') { - encoded_text_len = (size_t)(p1 - encoded_text); - scan_stat = 6; - } - break; - - case 7: /* expecting a "\n" character */ - if (*p1 == '\n') { - scan_stat = 8; - } else { - /* bare CR */ - _php_iconv_appendc(pretval, '\r', cd_pl); - _php_iconv_appendc(pretval, *p1, cd_pl); - scan_stat = 0; - } - break; - - case 8: /* checking whether the following line is part of a - folded header */ - if (*p1 != ' ' && *p1 != '\t') { - --p1; - str_left = 1; /* quit_loop */ - break; - } - if (encoded_word == NULL) { - _php_iconv_appendc(pretval, ' ', cd_pl); - } - spaces = NULL; - scan_stat = 11; - break; - - case 6: /* expecting a End-Of-Chunk character "=" */ - if (*p1 != '=') { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - } - scan_stat = 9; - if (str_left == 1) { - eos = 1; - } else { - break; - } - - case 9: /* choice point, seeing what to do next.*/ - switch (*p1) { - default: - /* Handle non-RFC-compliant formats - * - * RFC2047 requires the character that comes right - * after an encoded word (chunk) to be a whitespace, - * while there are lots of broken implementations that - * generate such malformed headers that don't fulfill - * that requirement. - */ - if (!eos) { - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - scan_stat = 12; - break; - } - } - /* break is omitted intentionally */ - - case '\r': case '\n': case ' ': case '\t': { - char *decoded_text; - size_t decoded_text_len; - int dummy; - - switch (enc_scheme) { - case PHP_ICONV_ENC_SCHEME_BASE64: - decoded_text = (char *)php_base64_decode((unsigned char*)encoded_text, (int)encoded_text_len, &dummy); - decoded_text_len = (size_t)dummy; - break; - - case PHP_ICONV_ENC_SCHEME_QPRINT: - decoded_text = (char *)php_quot_print_decode((unsigned char*)encoded_text, (int)encoded_text_len, &decoded_text_len, 1); - break; - default: - decoded_text = NULL; - break; - } - - if (decoded_text == NULL) { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } else { - err = PHP_ICONV_ERR_UNKNOWN; - goto out; - } - } - - err = _php_iconv_appendl(pretval, decoded_text, decoded_text_len, cd); - efree(decoded_text); - - if (err != PHP_ICONV_ERR_SUCCESS) { - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl); - if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; - } - encoded_word = NULL; - } else { - goto out; - } - } - - if (eos) { /* reached end-of-string. done. */ - scan_stat = 0; - break; - } - - switch (*p1) { - case '\r': /* part of an EOL sequence? */ - scan_stat = 7; - break; - - case '\n': - scan_stat = 8; - break; - - case '=': /* first letter of an encoded chunk */ - scan_stat = 1; - break; - - case ' ': case '\t': /* medial whitespaces */ - spaces = p1; - scan_stat = 11; - break; - - default: /* first letter of a non-encoded word */ - _php_iconv_appendc(pretval, *p1, cd_pl); - scan_stat = 12; - break; - } - } break; - } - break; - - case 10: /* expects a language specifier. dismiss it for now */ - if (*p1 == '?') { - scan_stat = 3; - } - break; - - case 11: /* expecting a chunk of whitespaces */ - switch (*p1) { - case '\r': /* part of an EOL sequence? */ - scan_stat = 7; - break; - - case '\n': - scan_stat = 8; - break; - - case '=': /* first letter of an encoded chunk */ - if (spaces != NULL && encoded_word == NULL) { - _php_iconv_appendl(pretval, spaces, (size_t)(p1 - spaces), cd_pl); - spaces = NULL; - } - encoded_word = p1; - scan_stat = 1; - break; - - case ' ': case '\t': - break; - - default: /* first letter of a non-encoded word */ - if (spaces != NULL) { - _php_iconv_appendl(pretval, spaces, (size_t)(p1 - spaces), cd_pl); - spaces = NULL; - } - _php_iconv_appendc(pretval, *p1, cd_pl); - encoded_word = NULL; - if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { - scan_stat = 12; - } else { - scan_stat = 0; - } - break; - } - break; - - case 12: /* expecting a non-encoded word */ - switch (*p1) { - case '\r': /* part of an EOL sequence? */ - scan_stat = 7; - break; - - case '\n': - scan_stat = 8; - break; - - case ' ': case '\t': - spaces = p1; - scan_stat = 11; - break; - - case '=': /* first letter of an encoded chunk */ - if (!(mode & PHP_ICONV_MIME_DECODE_STRICT)) { - encoded_word = p1; - scan_stat = 1; - break; - } - /* break is omitted intentionally */ - - default: - _php_iconv_appendc(pretval, *p1, cd_pl); - break; - } - break; - } - } - switch (scan_stat) { - case 0: case 8: case 11: case 12: - break; - default: - if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - if (scan_stat == 1) { - _php_iconv_appendc(pretval, '=', cd_pl); - } - err = PHP_ICONV_ERR_SUCCESS; - } else { - err = PHP_ICONV_ERR_MALFORMED; - goto out; - } - } - - if (next_pos != NULL) { - *next_pos = p1; - } - - smart_str_0(pretval); -out: - if (cd != (iconv_t)(-1)) { - iconv_close(cd); - } - if (cd_pl != (iconv_t)(-1)) { - iconv_close(cd_pl); - } - return err; -} -/* }}} */ - -/* {{{ php_iconv_show_error() */ -static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC) -{ - switch (err) { - case PHP_ICONV_ERR_SUCCESS: - break; - - case PHP_ICONV_ERR_CONVERTER: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot open converter"); - break; - - case PHP_ICONV_ERR_WRONG_CHARSET: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed", - in_charset, out_charset); - break; - - case PHP_ICONV_ERR_ILLEGAL_CHAR: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an incomplete multibyte character in input string"); - break; - - case PHP_ICONV_ERR_ILLEGAL_SEQ: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an illegal character in input string"); - break; - - case PHP_ICONV_ERR_TOO_BIG: - /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Run out of buffer"); - break; - - case PHP_ICONV_ERR_MALFORMED: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Malformed string"); - break; - - default: - /* other error */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown error (%d)", errno); - break; - } -} -/* }}} */ - -/* {{{ proto int iconv_strlen(string str [, string charset]) - Returns the character count of str */ -PHP_FUNCTION(iconv_strlen) -{ - char *charset; - int charset_len; - char *str; - int str_len; - - php_iconv_err_t err; - - unsigned int retval; - - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", - &str, &str_len, &charset, &charset_len) == FAILURE) { - RETURN_FALSE; - } - - err = _php_iconv_strlen(&retval, str, str_len, charset); - _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); - if (err == PHP_ICONV_ERR_SUCCESS) { - RETVAL_LONG(retval); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string iconv_substr(string str, int offset, [int length, string charset]) - Returns specified part of a string */ -PHP_FUNCTION(iconv_substr) -{ - char *charset; - int charset_len; - char *str; - int str_len; - long offset, length; - zval *len_z = NULL; - - php_iconv_err_t err; - - smart_str retval = {0}; - - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", - &str, &str_len, &offset, &len_z, - &charset, &charset_len) == FAILURE) { - RETURN_FALSE; - } - - if (len_z == NULL) { - length = str_len; - } else { - convert_to_long_ex(&len_z); - length = Z_LVAL_P(len_z); - } - - err = _php_iconv_substr(&retval, str, str_len, offset, length, charset); - _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); - - if (err == PHP_ICONV_ERR_SUCCESS && str != NULL) { - if (retval.c != NULL) { - RETVAL_STRINGL(retval.c, retval.len, 0); - } else { - RETVAL_EMPTY_STRING(); - } - } else { - smart_str_free(&retval); - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int iconv_strpos(string haystack, string needle, int offset [, string charset]) - Finds position of first occurrence of needle within part of haystack beginning with offset */ -PHP_FUNCTION(iconv_strpos) -{ - char *charset; - int charset_len; - char *haystk; - int haystk_len; - char *ndl; - int ndl_len; - long offset; - - php_iconv_err_t err; - - unsigned int retval; - - offset = 0; - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", - &haystk, &haystk_len, &ndl, &ndl_len, - &offset, &charset, &charset_len) == FAILURE) { - RETURN_FALSE; - } - - if (offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); - RETURN_FALSE; - } - - err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len, - offset, charset); - _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); - - if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) { - RETVAL_LONG((long)retval); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int iconv_strrpos(string haystack, string needle [, string charset]) - Finds position of last occurrence of needle within part of haystack beginning with offset */ -PHP_FUNCTION(iconv_strrpos) -{ - char *charset; - int charset_len; - char *haystk; - int haystk_len; - char *ndl; - int ndl_len; - - php_iconv_err_t err; - - unsigned int retval; - - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", - &haystk, &haystk_len, &ndl, &ndl_len, - &charset, &charset_len) == FAILURE) { - RETURN_FALSE; - } - - err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len, - -1, charset); - _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); - - if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) { - RETVAL_LONG((long)retval); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string iconv_mime_encode(string field_name, string field_value, [, array preference]) - Composes a mime header field with field_name and field_value in a specified scheme */ -PHP_FUNCTION(iconv_mime_encode) -{ - const char *field_name = NULL; - int field_name_len; - const char *field_value = NULL; - int field_value_len; - zval *pref = NULL; - zval tmp_zv, *tmp_zv_p = NULL; - smart_str retval = {0}; - php_iconv_err_t err; - - const char *in_charset = ICONVG(internal_encoding); - const char *out_charset = in_charset; - long line_len = 76; - const char *lfchars = "\r\n"; - php_iconv_enc_scheme_t scheme_id = PHP_ICONV_ENC_SCHEME_BASE64; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a", - &field_name, &field_name_len, &field_value, &field_value_len, - &pref) == FAILURE) { - - RETURN_FALSE; - } - - if (pref != NULL) { - zval **ppval; - - if (zend_hash_find(Z_ARRVAL_P(pref), "scheme", sizeof("scheme"), (void **)&ppval) == SUCCESS) { - if (Z_TYPE_PP(ppval) == IS_STRING && Z_STRLEN_PP(ppval) > 0) { - switch (Z_STRVAL_PP(ppval)[0]) { - case 'B': case 'b': - scheme_id = PHP_ICONV_ENC_SCHEME_BASE64; - break; - - case 'Q': case 'q': - scheme_id = PHP_ICONV_ENC_SCHEME_QPRINT; - break; - } - } - } - - if (zend_hash_find(Z_ARRVAL_P(pref), "input-charset", sizeof("input-charset"), (void **)&ppval) == SUCCESS) { - if (Z_TYPE_PP(ppval) == IS_STRING && Z_STRLEN_PP(ppval) > 0) { - in_charset = Z_STRVAL_PP(ppval); - } - } - - - if (zend_hash_find(Z_ARRVAL_P(pref), "output-charset", sizeof("output-charset"), (void **)&ppval) == SUCCESS) { - if (Z_TYPE_PP(ppval) == IS_STRING && Z_STRLEN_PP(ppval) > 0) { - out_charset = Z_STRVAL_PP(ppval); - } - } - - if (zend_hash_find(Z_ARRVAL_P(pref), "line-length", sizeof("line-length"), (void **)&ppval) == SUCCESS) { - zval val, *pval = *ppval; - - if (Z_TYPE_P(pval) != IS_LONG) { - val = *pval; - zval_copy_ctor(&val); - convert_to_long(&val); - pval = &val; - } - - line_len = Z_LVAL_P(pval); - - if (pval == &val) { - zval_dtor(&val); - } - } - - if (zend_hash_find(Z_ARRVAL_P(pref), "line-break-chars", sizeof("line-break-chars"), (void **)&ppval) == SUCCESS) { - if (Z_TYPE_PP(ppval) != IS_STRING) { - tmp_zv = **ppval; - zval_copy_ctor(&tmp_zv); - convert_to_string(&tmp_zv); - - lfchars = Z_STRVAL(tmp_zv); - - tmp_zv_p = &tmp_zv; - } else { - lfchars = Z_STRVAL_PP(ppval); - } - } - } - - err = _php_iconv_mime_encode(&retval, field_name, field_name_len, - field_value, field_value_len, line_len, lfchars, scheme_id, - out_charset, in_charset); - _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC); - - if (err == PHP_ICONV_ERR_SUCCESS) { - if (retval.c != NULL) { - RETVAL_STRINGL(retval.c, retval.len, 0); - } else { - RETVAL_EMPTY_STRING(); - } - } else { - smart_str_free(&retval); - RETVAL_FALSE; - } - - if (tmp_zv_p != NULL) { - zval_dtor(tmp_zv_p); - } -} -/* }}} */ - -/* {{{ proto string iconv_mime_decode(string encoded_string [, int mode, string charset]) - Decodes a mime header field */ -PHP_FUNCTION(iconv_mime_decode) -{ - char *encoded_str; - int encoded_str_len; - char *charset; - int charset_len; - long mode = 0; - - smart_str retval = {0}; - - php_iconv_err_t err; - - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", - &encoded_str, &encoded_str_len, &mode, &charset, &charset_len) == FAILURE) { - - RETURN_FALSE; - } - - err = _php_iconv_mime_decode(&retval, encoded_str, encoded_str_len, charset, NULL, mode); - _php_iconv_show_error(err, charset, "???" TSRMLS_CC); - - if (err == PHP_ICONV_ERR_SUCCESS) { - if (retval.c != NULL) { - RETVAL_STRINGL(retval.c, retval.len, 0); - } else { - RETVAL_EMPTY_STRING(); - } - } else { - smart_str_free(&retval); - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto array iconv_mime_decode_headers(string headers [, int mode, string charset]) - Decodes multiple mime header fields */ -PHP_FUNCTION(iconv_mime_decode_headers) -{ - const char *encoded_str; - int encoded_str_len; - char *charset; - int charset_len; - long mode = 0; - - php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; - - charset = ICONVG(internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", - &encoded_str, &encoded_str_len, &mode, &charset, &charset_len) == FAILURE) { - - RETURN_FALSE; - } - - array_init(return_value); - - while (encoded_str_len > 0) { - smart_str decoded_header = {0}; - char *header_name = NULL; - size_t header_name_len = 0; - char *header_value = NULL; - size_t header_value_len = 0; - char *p, *limit; - const char *next_pos; - - if (PHP_ICONV_ERR_SUCCESS != (err = _php_iconv_mime_decode(&decoded_header, encoded_str, encoded_str_len, charset, &next_pos, mode))) { - smart_str_free(&decoded_header); - break; - } - - if (decoded_header.c == NULL) { - break; - } - - limit = decoded_header.c + decoded_header.len; - for (p = decoded_header.c; p < limit; p++) { - if (*p == ':') { - *p = '\0'; - header_name = decoded_header.c; - header_name_len = (p - decoded_header.c) + 1; - - while (++p < limit) { - if (*p != ' ' && *p != '\t') { - break; - } - } - - header_value = p; - header_value_len = limit - p; - - break; - } - } - - if (header_name != NULL) { - zval **elem; - - if (zend_hash_find(Z_ARRVAL_P(return_value), header_name, header_name_len, (void **)&elem) == SUCCESS) { - if (Z_TYPE_PP(elem) != IS_ARRAY) { - zval *new_elem; - - MAKE_STD_ZVAL(new_elem); - array_init(new_elem); - - ZVAL_ADDREF(*elem); - add_next_index_zval(new_elem, *elem); - - zend_hash_update(Z_ARRVAL_P(return_value), header_name, header_name_len, (void *)&new_elem, sizeof(new_elem), NULL); - - elem = &new_elem; - } - add_next_index_stringl(*elem, header_value, header_value_len, 1); - } else { - add_assoc_stringl_ex(return_value, header_name, header_name_len, header_value, header_value_len, 1); - } - } - encoded_str_len -= next_pos - encoded_str; - encoded_str = next_pos; - - smart_str_free(&decoded_header); - } - - if (err != PHP_ICONV_ERR_SUCCESS) { - _php_iconv_show_error(err, charset, "???" TSRMLS_CC); - zval_dtor(return_value); - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string iconv(string in_charset, string out_charset, string str) - Returns str converted to the out_charset character set */ -PHP_NAMED_FUNCTION(php_if_iconv) -{ - char *in_charset, *out_charset, *in_buffer, *out_buffer; - size_t out_len; - int in_charset_len, out_charset_len, in_buffer_len; - php_iconv_err_t err; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", - &in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer, &in_buffer_len) == FAILURE) - return; - - err = php_iconv_string(in_buffer, (size_t)in_buffer_len, - &out_buffer, &out_len, out_charset, in_charset); - _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC); - if (out_buffer != NULL) { - RETVAL_STRINGL(out_buffer, out_len, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string ob_iconv_handler(string contents, int status) - Returns str in output buffer converted to the iconv.output_encoding character set */ -PHP_FUNCTION(ob_iconv_handler) -{ - char *out_buffer, *content_type, *mimetype = NULL, *s; - zval *zv_string; - size_t out_len; - int mimetype_alloced = 0; - long status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zv_string, &status) == FAILURE) - return; - - convert_to_string_ex(&zv_string); - - if (SG(sapi_headers).mimetype && - strncasecmp(SG(sapi_headers).mimetype, "text/", 5) == 0) { - if ((s = strchr(SG(sapi_headers).mimetype,';')) == NULL){ - mimetype = SG(sapi_headers).mimetype; - } else { - mimetype = estrndup(SG(sapi_headers).mimetype, s-SG(sapi_headers).mimetype); - mimetype_alloced = 1; - } - } else if (SG(sapi_headers).send_default_content_type) { - mimetype =(SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE); - } - if (mimetype != NULL) { - php_iconv_err_t err = php_iconv_string(Z_STRVAL_P(zv_string), - Z_STRLEN_P(zv_string), &out_buffer, &out_len, - ICONVG(output_encoding), ICONVG(internal_encoding)); - _php_iconv_show_error(err, ICONVG(output_encoding), ICONVG(internal_encoding) TSRMLS_CC); - if (out_buffer != NULL) { - spprintf(&content_type, 0, "Content-Type:%s; charset=%s", mimetype, ICONVG(output_encoding)); - if (content_type && sapi_add_header(content_type, strlen(content_type), 0) != FAILURE) { - SG(sapi_headers).send_default_content_type = 0; - } - RETURN_STRINGL(out_buffer, out_len, 0); - } - if (mimetype_alloced) { - efree(mimetype); - } - } - - zval_dtor(return_value); - *return_value = *zv_string; - zval_copy_ctor(return_value); -} -/* }}} */ - -/* {{{ proto bool iconv_set_encoding(string type, string charset) - Sets internal encoding and output encoding for ob_iconv_handler() */ -PHP_FUNCTION(iconv_set_encoding) -{ - char *type, *charset; - int type_len, charset_len, retval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &type, &type_len, &charset, &charset_len) == FAILURE) - return; - - if(!strcasecmp("input_encoding", type)) { - retval = zend_alter_ini_entry("iconv.input_encoding", sizeof("iconv.input_encoding"), charset, charset_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } else if(!strcasecmp("output_encoding", type)) { - retval = zend_alter_ini_entry("iconv.output_encoding", sizeof("iconv.output_encoding"), charset, charset_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } else if(!strcasecmp("internal_encoding", type)) { - retval = zend_alter_ini_entry("iconv.internal_encoding", sizeof("iconv.internal_encoding"), charset, charset_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } else { - RETURN_FALSE; - } - - if (retval == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto mixed iconv_get_encoding([string type]) - Get internal encoding and output encoding for ob_iconv_handler() */ -PHP_FUNCTION(iconv_get_encoding) -{ - char *type = "all"; - int type_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE) - return; - - if (!strcasecmp("all", type)) { - array_init(return_value); - add_assoc_string(return_value, "input_encoding", ICONVG(input_encoding), 1); - add_assoc_string(return_value, "output_encoding", ICONVG(output_encoding), 1); - add_assoc_string(return_value, "internal_encoding", ICONVG(internal_encoding), 1); - } else if (!strcasecmp("input_encoding", type)) { - RETVAL_STRING(ICONVG(input_encoding), 1); - } else if (!strcasecmp("output_encoding", type)) { - RETVAL_STRING(ICONVG(output_encoding), 1); - } else if (!strcasecmp("internal_encoding", type)) { - RETVAL_STRING(ICONVG(internal_encoding), 1); - } else { - RETURN_FALSE; - } - -} -/* }}} */ - -#ifdef SMG_0 /* UTODO: Needs updating for unicode */ - -/* {{{ iconv stream filter */ -typedef struct _php_iconv_stream_filter { - iconv_t cd; - int persistent; - char *to_charset; - size_t to_charset_len; - char *from_charset; - size_t from_charset_len; - char stub[128]; - size_t stub_len; -} php_iconv_stream_filter; - -/* {{{ php_iconv_stream_filter_dtor */ -static void php_iconv_stream_filter_dtor(php_iconv_stream_filter *self) -{ - iconv_close(self->cd); - pefree(self->to_charset, self->persistent); - pefree(self->from_charset, self->persistent); -} -/* }}} */ - -/* {{{ php_iconv_stream_filter_ctor() */ -static php_iconv_err_t php_iconv_stream_filter_ctor(php_iconv_stream_filter *self, - const char *to_charset, size_t to_charset_len, - const char *from_charset, size_t from_charset_len, int persistent) -{ - if (NULL == (self->to_charset = pemalloc(to_charset_len + 1, persistent))) { - return PHP_ICONV_ERR_ALLOC; - } - self->to_charset_len = to_charset_len; - if (NULL == (self->from_charset = pemalloc(from_charset_len + 1, persistent))) { - pefree(self->to_charset, persistent); - return PHP_ICONV_ERR_ALLOC; - } - self->from_charset_len = from_charset_len; - - memcpy(self->to_charset, to_charset, to_charset_len); - self->to_charset[to_charset_len] = '\0'; - memcpy(self->from_charset, from_charset, from_charset_len); - self->from_charset[from_charset_len] = '\0'; - - if ((iconv_t)-1 == (self->cd = iconv_open(self->to_charset, self->from_charset))) { - pefree(self->from_charset, persistent); - pefree(self->to_charset, persistent); - return PHP_ICONV_ERR_UNKNOWN; - } - self->persistent = persistent; - self->stub_len = 0; - return PHP_ICONV_ERR_SUCCESS; -} -/* }}} */ - -/* {{{ php_iconv_stream_filter_append_bucket */ -static int php_iconv_stream_filter_append_bucket( - php_iconv_stream_filter *self, - php_stream *stream, php_stream_filter *filter, - php_stream_bucket_brigade *buckets_out, - const char *ps, size_t buf_len, size_t *consumed, - int persistent TSRMLS_DC) -{ - php_stream_bucket *new_bucket; - char *out_buf = NULL; - size_t out_buf_size; - char *pd, *pt; - size_t ocnt, prev_ocnt, icnt, tcnt; - size_t initial_out_buf_size; - - if (ps == NULL) { - initial_out_buf_size = 64; - icnt = 1; - } else { - initial_out_buf_size = buf_len; - icnt = buf_len; - } - - out_buf_size = ocnt = prev_ocnt = initial_out_buf_size; - if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { - return FAILURE; - } - - pd = out_buf; - - if (self->stub_len > 0) { - pt = self->stub; - tcnt = self->stub_len; - - while (tcnt > 0) { - if (iconv(self->cd, &pt, &tcnt, &pd, &ocnt) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EILSEQ: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset); - goto out_failure; - - case EINVAL: - if (ps != NULL) { - if (icnt > 0) { - if (self->stub_len >= sizeof(self->stub)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset); - goto out_failure; - } - self->stub[self->stub_len++] = *(ps++); - icnt--; - pt = self->stub; - tcnt = self->stub_len; - } else { - tcnt = 0; - break; - } - } - break; - - case E2BIG: { - char *new_out_buf; - size_t new_out_buf_size; - - new_out_buf_size = out_buf_size << 1; - - if (new_out_buf_size < out_buf_size) { - /* whoa! no bigger buckets are sold anywhere... */ - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { - goto out_failure; - } - - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - - out_buf_size = ocnt = initial_out_buf_size; - if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { - return FAILURE; - } - pd = out_buf; - } else { - if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { - goto out_failure; - } - - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - return FAILURE; - } - pd = new_out_buf + (pd - out_buf); - ocnt += (new_out_buf_size - out_buf_size); - out_buf = new_out_buf; - out_buf_size = new_out_buf_size; - } - } break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset); - goto out_failure; - } -#else - if (ocnt == prev_ocnt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset); - goto out_failure; - } -#endif - } - prev_ocnt = ocnt; - } - memmove(self->stub, pt, tcnt); - self->stub_len = tcnt; - } - - while (icnt > 0) { - if ((ps == NULL ? iconv(self->cd, NULL, NULL, &pd, &ocnt): - iconv(self->cd, (char **)&ps, &icnt, &pd, &ocnt)) == (size_t)-1) { -#if ICONV_SUPPORTS_ERRNO - switch (errno) { - case EILSEQ: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset); - goto out_failure; - - case EINVAL: - if (ps != NULL) { - if (icnt > sizeof(self->stub)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset); - goto out_failure; - } - memcpy(self->stub, ps, icnt); - self->stub_len = icnt; - ps += icnt; - icnt = 0; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset); - goto out_failure; - } - break; - - case E2BIG: { - char *new_out_buf; - size_t new_out_buf_size; - - new_out_buf_size = out_buf_size << 1; - - if (new_out_buf_size < out_buf_size) { - /* whoa! no bigger buckets are sold anywhere... */ - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { - goto out_failure; - } - - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - - out_buf_size = ocnt = initial_out_buf_size; - if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { - return FAILURE; - } - pd = out_buf; - } else { - if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { - goto out_failure; - } - - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - return FAILURE; - } - pd = new_out_buf + (pd - out_buf); - ocnt += (new_out_buf_size - out_buf_size); - out_buf = new_out_buf; - out_buf_size = new_out_buf_size; - } - } break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset); - goto out_failure; - } -#else - if (ocnt == prev_ocnt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset); - goto out_failure; - } -#endif - } else { - if (ps == NULL) { - break; - } - } - prev_ocnt = ocnt; - } - - if (out_buf_size - ocnt > 0) { - if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { - goto out_failure; - } - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - } else { - pefree(out_buf, persistent); - } - *consumed += buf_len - icnt; - - return SUCCESS; - -out_failure: - pefree(out_buf, persistent); - return FAILURE; -} - -/* {{{ php_iconv_stream_filter_do_filter */ -static php_stream_filter_status_t php_iconv_stream_filter_do_filter( - php_stream *stream, php_stream_filter *filter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, int flags TSRMLS_DC) -{ - php_stream_bucket *bucket = NULL; - size_t consumed = 0; - php_iconv_stream_filter *self = (php_iconv_stream_filter *)filter->abstract; - - while (buckets_in->head != NULL) { - bucket = buckets_in->head; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - - if (php_iconv_stream_filter_append_bucket(self, stream, filter, - buckets_out, bucket->buf, bucket->buflen, &consumed, - php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) { - goto out_failure; - } - - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags != PSFS_FLAG_NORMAL) { - if (php_iconv_stream_filter_append_bucket(self, stream, filter, - buckets_out, NULL, 0, &consumed, - php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) { - goto out_failure; - } - } - - if (bytes_consumed != NULL) { - *bytes_consumed = consumed; - } - - return PSFS_PASS_ON; - -out_failure: - if (bucket != NULL) { - php_stream_bucket_delref(bucket TSRMLS_CC); - } - return PSFS_ERR_FATAL; -} -/* }}} */ - -/* {{{ php_iconv_stream_filter_cleanup */ -static void php_iconv_stream_filter_cleanup(php_stream_filter *filter TSRMLS_DC) -{ - php_iconv_stream_filter_dtor((php_iconv_stream_filter *)filter->abstract); - pefree(filter->abstract, ((php_iconv_stream_filter *)filter->abstract)->persistent); -} -/* }}} */ - -static php_stream_filter_ops php_iconv_stream_filter_ops = { - php_iconv_stream_filter_do_filter, - php_iconv_stream_filter_cleanup, - "convert.iconv.*" -}; - -/* {{{ php_iconv_stream_filter_create */ -static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent TSRMLS_DC) -{ - php_stream_filter *retval = NULL; - php_iconv_stream_filter *inst; - char *from_charset = NULL, *to_charset = NULL; - size_t from_charset_len, to_charset_len; - - if ((from_charset = strchr(name, '.')) == NULL) { - return NULL; - } - ++from_charset; - if ((from_charset = strchr(from_charset, '.')) == NULL) { - return NULL; - } - ++from_charset; - if ((to_charset = strchr(from_charset, '/')) == NULL) { - return NULL; - } - from_charset_len = to_charset - from_charset; - ++to_charset; - to_charset_len = strlen(to_charset); - - if (NULL == (inst = pemalloc(sizeof(php_iconv_stream_filter), persistent))) { - return NULL; - } - - if (php_iconv_stream_filter_ctor(inst, to_charset, to_charset_len, from_charset, from_charset_len, persistent) != PHP_ICONV_ERR_SUCCESS) { - pefree(inst, persistent); - return NULL; - } - - if (NULL == (retval = php_stream_filter_alloc(&php_iconv_stream_filter_ops, inst, persistent))) { - php_iconv_stream_filter_dtor(inst); - pefree(inst, persistent); - } - - return retval; -} -/* }}} */ - -/* {{{ php_iconv_stream_register_factory */ -static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D) -{ - static php_stream_filter_factory filter_factory = { - php_iconv_stream_filter_factory_create - }; - - if (FAILURE == php_stream_filter_register_factory( - php_iconv_stream_filter_ops.label, - &filter_factory TSRMLS_CC)) { - return PHP_ICONV_ERR_UNKNOWN; - } - return PHP_ICONV_ERR_SUCCESS; -} -/* }}} */ - -/* {{{ php_iconv_stream_unregister_factory */ -static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D) -{ - if (FAILURE == php_stream_filter_unregister_factory( - php_iconv_stream_filter_ops.label TSRMLS_CC)) { - return PHP_ICONV_ERR_UNKNOWN; - } - return PHP_ICONV_ERR_SUCCESS; -} -/* }}} */ -#else /* Make dummy bypasses for the register/unregister loop */ -static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D) -{ - return PHP_ICONV_ERR_SUCCESS; -} -static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D) -{ - return PHP_ICONV_ERR_SUCCESS; -} -#endif /* unicode bypass */ - - -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/iconv/iconv.dsp b/ext/iconv/iconv.dsp deleted file mode 100644 index 2d66cf00abea0..0000000000000 --- a/ext/iconv/iconv.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="iconv" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=iconv - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "iconv.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "iconv.mak" CFG="iconv - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "iconv - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "iconv - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "iconv - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "ICONV_SUPPORTS_ERRNO" /D "HAVE_LIBICONV" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_iconv.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "iconv - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_iconv.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "iconv - Win32 Release_TS" -# Name "iconv - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\iconv.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_iconv.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/iconv/php_iconv.def b/ext/iconv/php_iconv.def deleted file mode 100644 index 2f77aa4c79ece..0000000000000 --- a/ext/iconv/php_iconv.def +++ /dev/null @@ -1,6 +0,0 @@ -EXPORTS -_libiconv_version -libiconv_close -libiconv -libiconv_open -libiconv_set_relocation_prefix diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h deleted file mode 100644 index d7dfb782bb64b..0000000000000 --- a/ext/iconv/php_iconv.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rui Hirokawa | - | Stig Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Revision$ */ - -#ifndef PHP_ICONV_H -#define PHP_ICONV_H - -#ifdef PHP_WIN32 -#ifdef PHP_ICONV_EXPORTS -#define PHP_ICONV_API __declspec(dllexport) -#else -#define PHP_ICONV_API __declspec(dllimport) -#endif -#else -#define PHP_ICONV_API -#endif - -#ifdef PHP_ATOM_INC -#include "ext/iconv/php_have_iconv.h" -#include "ext/iconv/php_have_libiconv.h" -#include "ext/iconv/php_have_glibc_iconv.h" -#include "ext/iconv/php_have_bsd_iconv.h" -#include "ext/iconv/php_iconv_supports_errno.h" -#include "ext/iconv/php_php_iconv_impl.h" -#include "ext/iconv/php_php_iconv_h_path.h" -#endif - - -#ifdef HAVE_ICONV -extern zend_module_entry iconv_module_entry; -#define iconv_module_ptr &iconv_module_entry - -PHP_MINIT_FUNCTION(miconv); -PHP_MSHUTDOWN_FUNCTION(miconv); -PHP_MINFO_FUNCTION(miconv); - -PHP_NAMED_FUNCTION(php_if_iconv); -PHP_FUNCTION(ob_iconv_handler); -PHP_FUNCTION(iconv_get_encoding); -PHP_FUNCTION(iconv_set_encoding); -PHP_FUNCTION(iconv_strlen); -PHP_FUNCTION(iconv_substr); -PHP_FUNCTION(iconv_strpos); -PHP_FUNCTION(iconv_strrpos); -PHP_FUNCTION(iconv_mime_encode); -PHP_FUNCTION(iconv_mime_decode); -PHP_FUNCTION(iconv_mime_decode_headers); - -ZEND_BEGIN_MODULE_GLOBALS(iconv) - char *input_encoding; - char *internal_encoding; - char *output_encoding; -ZEND_END_MODULE_GLOBALS(iconv) - -#ifdef ZTS -#define ICONVG(v) TSRMG(iconv_globals_id, zend_iconv_globals *, v) -#else -#define ICONVG(v) (iconv_globals.v) -#endif - -#define ICONV_INPUT_ENCODING "ISO-8859-1" -#define ICONV_OUTPUT_ENCODING "ISO-8859-1" -#define ICONV_INTERNAL_ENCODING "ISO-8859-1" - -/* {{{ typedef enum php_iconv_err_t */ -typedef enum _php_iconv_err_t { - PHP_ICONV_ERR_SUCCESS = SUCCESS, - PHP_ICONV_ERR_CONVERTER = 1, - PHP_ICONV_ERR_WRONG_CHARSET = 2, - PHP_ICONV_ERR_TOO_BIG = 3, - PHP_ICONV_ERR_ILLEGAL_SEQ = 4, - PHP_ICONV_ERR_ILLEGAL_CHAR = 5, - PHP_ICONV_ERR_UNKNOWN = 6, - PHP_ICONV_ERR_MALFORMED = 7, - PHP_ICONV_ERR_ALLOC = 8 -} php_iconv_err_t; -/* }}} */ - -PHP_ICONV_API php_iconv_err_t php_iconv_string(const char * in_p, size_t in_len, char **out, size_t *out_len, const char *in_charset, const char *out_charset); - -#else - -#define iconv_module_ptr NULL - -#endif /* HAVE_ICONV */ - -#define phpext_iconv_ptr iconv_module_ptr - -#endif /* PHP_ICONV_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/iconv/tests/Quotes.UTF-8 b/ext/iconv/tests/Quotes.UTF-8 deleted file mode 100644 index 3d48ee970ac88..0000000000000 --- a/ext/iconv/tests/Quotes.UTF-8 +++ /dev/null @@ -1,4 +0,0 @@ -“Hello” -‘Hello’ -„Hello” -‚Hello’ diff --git a/ext/iconv/tests/bug16069.phpt b/ext/iconv/tests/bug16069.phpt deleted file mode 100644 index 246b90c6cd306..0000000000000 --- a/ext/iconv/tests/bug16069.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #16069 ---SKIPIF-- - ---INI-- -error_reporting=2039 ---FILE-- - ---EXPECT-- -ßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵëßêĦĵë(Ħë§Ħë) diff --git a/ext/iconv/tests/eucjp2iso2022jp.phpt b/ext/iconv/tests/eucjp2iso2022jp.phpt deleted file mode 100644 index 9eb6944f01b8c..0000000000000 --- a/ext/iconv/tests/eucjp2iso2022jp.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -EUC-JP to ISO-2022-JP ---SKIPIF-- - ---INI-- -error_reporting=2039 -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - ---EXPECT-- -1b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c2546252d2539254824481b284220456e676c69736820746578741b2442467c4b5c386c1b2842 - diff --git a/ext/iconv/tests/eucjp2sjis.phpt b/ext/iconv/tests/eucjp2sjis.phpt deleted file mode 100644 index 80c07636c81ce..0000000000000 --- a/ext/iconv/tests/eucjp2sjis.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -EUC-JP to SJIS ---SKIPIF-- - ---INI-- -error_reporting=2039 -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - ---EXPECT-- -CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0CpP6lnuM6oNlg0yDWINngsZFbmdsaXNoIFRleHQKk/qWe4zqg2WDTINYg2eCxkVuZ2xpc2ggVGV4dAqT+pZ7jOqDZYNMg1iDZ4LGRW5nbGlzaCBUZXh0Cg== - diff --git a/ext/iconv/tests/eucjp2utf8.phpt b/ext/iconv/tests/eucjp2utf8.phpt deleted file mode 100644 index 2b74516ce9a15..0000000000000 --- a/ext/iconv/tests/eucjp2utf8.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -EUC-JP to UTF8 ---SKIPIF-- - ---INI-- -error_reporting=2039 -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - ---EXPECT-- -CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0CuaXpeacrOiqnuODhuOCreOCueODiOOBqEVuZ2xpc2ggVGV4dArml6XmnKzoqp7jg4bjgq3jgrnjg4jjgahFbmdsaXNoIFRleHQK5pel5pys6Kqe44OG44Kt44K544OI44GoRW5nbGlzaCBUZXh0Cg== - diff --git a/ext/iconv/tests/iconv001.phpt b/ext/iconv/tests/iconv001.phpt deleted file mode 100644 index 0402f371a126b..0000000000000 --- a/ext/iconv/tests/iconv001.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -iconv() test 1 ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -error_reporting=2039 ---FILE-- - ---EXPECT-- -iconv extension is available -string(15) "ISO-8859-1: ĉĝċ" -string(13) "UTF-8: Ĥ¸" diff --git a/ext/iconv/tests/iconv002.phpt b/ext/iconv/tests/iconv002.phpt deleted file mode 100644 index 034b3761faf79..0000000000000 --- a/ext/iconv/tests/iconv002.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -iconv() test 2 (UCS4BE to ASCII) ---SKIPIF-- - ---INI-- -error_reporting=2039 ---FILE-- - ---EXPECT-- -abcd -abcd diff --git a/ext/iconv/tests/iconv003.phpt b/ext/iconv/tests/iconv003.phpt deleted file mode 100644 index 9fcfe4b0cdb48..0000000000000 --- a/ext/iconv/tests/iconv003.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -iconv() test 3 ---FILE-- - ---EXPECT-- -success diff --git a/ext/iconv/tests/iconv004.phpt b/ext/iconv/tests/iconv004.phpt deleted file mode 100644 index 0e40ed4fcc431..0000000000000 --- a/ext/iconv/tests/iconv004.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -iconv_mime_encode() sanity cheeck. ---FILE-- - 1))); -?> ---EXPECT-- -string(19) ": =?ISO-8859-1?B??=" -string(19) ": =?ISO-8859-1?B??=" diff --git a/ext/iconv/tests/iconv_mime_decode.phpt b/ext/iconv/tests/iconv_mime_decode.phpt deleted file mode 100644 index 24d1794f3fd4c..0000000000000 --- a/ext/iconv/tests/iconv_mime_decode.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -iconv_mime_decode() ---SKIPIF-- - ---INI-- -iconv.internal_charset=iso-8859-1 ---FILE-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -iconv.internal_charset=iso-8859-1 ---FILE-- - -Received: from pb1.pair.com (pb1.pair.com [16.92.131.4]) by ***.example.com - (8.12.10/8.12.10/1970-09-30) with SMTP id hALLmpea023899 for - <***@***.example.com>; Sat, 22 Jan 1970 06:48:51 +0900 (JST) - (envelope-from - internals-return-5651-***=***.example.com@lists.php.net) -Received: (qmail 63472 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000 -Mailing-List: contact internals-help@lists.php.net; run by ezmlm -Precedence: bulk -List-Help: -List-Unsubscribe: -List-Post: -Delivered-To: mailing list internals@lists.php.net -Received: (qmail 63459 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000 -Delivered-To: ezmlm-scan-internals@lists.php.net -Delivered-To: ezmlm-internals@lists.php.net -Date: Thu, 1 Jan 1970 00:00:00 -0000 (GMT) -From: *** *** *** <***@***.example.com> -X-X-Sender: ***@***.example.com -To: internals@lists.php.net -Message-Id: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -Subject: [PHP-DEV] [ICONV] test for =?US-ASCII?Q?iconv_mime_decode_headers=28=29?= -X-UIDL: @eH!!h2:!!EOS!!A_c"! -HERE; -var_dump(iconv_mime_decode_headers($headers)); -?> ---EXPECT-- -array(17) { - ["Return-Path"]=> - string(57) "" - ["Received"]=> - array(3) { - [0]=> - string(259) "from pb1.pair.com (pb1.pair.com [16.92.131.4]) by ***.example.com (8.12.10/8.12.10/1970-09-30) with SMTP id hALLmpea023899 for <***@***.example.com>; Sat, 22 Jan 1970 06:48:51 +0900 (JST) (envelope-from internals-return-5651-***=***.example.com@lists.php.net)" - [1]=> - string(59) "(qmail 63472 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000" - [2]=> - string(59) "(qmail 63459 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000" - } - ["Mailing-List"]=> - string(50) "contact internals-help@lists.php.net; run by ezmlm" - ["Precedence"]=> - string(4) "bulk" - ["List-Help"]=> - string(37) "" - ["List-Unsubscribe"]=> - string(44) "" - ["List-Post"]=> - string(32) "" - ["Delivered-To"]=> - array(3) { - [0]=> - string(36) "mailing list internals@lists.php.net" - [1]=> - string(34) "ezmlm-scan-internals@lists.php.net" - [2]=> - string(29) "ezmlm-internals@lists.php.net" - } - ["Date"]=> - string(36) "Thu, 1 Jan 1970 00:00:00 -0000 (GMT)" - ["From"]=> - string(33) "*** *** *** <***@***.example.com>" - ["X-X-Sender"]=> - string(19) "***@***.example.com" - ["To"]=> - string(23) "internals@lists.php.net" - ["Message-Id"]=> - string(44) "" - ["MIME-Version"]=> - string(3) "1.0" - ["Content-Type"]=> - string(28) "TEXT/PLAIN; charset=US-ASCII" - ["Subject"]=> - string(54) "[PHP-DEV] [ICONV] test for iconv mime decode headers()" - ["X-UIDL"]=> - string(20) "@eH!!h2:!!EOS!!A_c"!" -} - diff --git a/ext/iconv/tests/iconv_mime_encode.phpt b/ext/iconv/tests/iconv_mime_encode.phpt deleted file mode 100644 index 38655c27e2cc0..0000000000000 --- a/ext/iconv/tests/iconv_mime_encode.phpt +++ /dev/null @@ -1,428 +0,0 @@ ---TEST-- -iconv_mime_encode() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -iconv.internal_charset=iso-8859-1 ---FILE-- - "B", - "output-charset" => "ISO-2022-JP", - "input-charset" => "EUC-JP", - "line-break-chars" => "\n" -); -for ($line_len= 0; $line_len < 80; ++$line_len) { - print "-------- line length=$line_len\n"; - $preference["line-length"] = $line_len; - $result = iconv_mime_encode("From", "µó×ëʸğúÎóµó×ëʸğúÎóĈüËܸìĈ­ıÈ", $preference); - var_dump($result); - if ($result !== false) { - $max = max(array_map("strlen", explode("\n", $result))); - print "-------- "; - var_dump(($max <= $line_len)); - } else { - print "-------- \n"; - } -} -?> ---EXPECTF-- --------- line length=0 -2: %s -bool(false) --------- --------- line length=1 -2: %s -bool(false) --------- --------- line length=2 -2: %s -bool(false) --------- --------- line length=3 -2: %s -bool(false) --------- --------- line length=4 -2: %s -bool(false) --------- --------- line length=5 -2: %s -bool(false) --------- --------- line length=6 -2: %s -bool(false) --------- --------- line length=7 -2: %s -bool(false) --------- --------- line length=8 -2: %s -bool(false) --------- --------- line length=9 -2: %s -bool(false) --------- --------- line length=10 -2: %s -bool(false) --------- --------- line length=11 -2: %s -bool(false) --------- --------- line length=12 -2: %s -bool(false) --------- --------- line length=13 -2: %s -bool(false) --------- --------- line length=14 -2: %s -bool(false) --------- --------- line length=15 -2: %s -bool(false) --------- --------- line length=16 -2: %s -bool(false) --------- --------- line length=17 -2: %s -bool(false) --------- --------- line length=18 -2: %s -bool(false) --------- --------- line length=19 -2: %s -bool(false) --------- --------- line length=20 -2: %s -bool(false) --------- --------- line length=21 -2: %s -bool(false) --------- --------- line length=22 -2: %s -bool(false) --------- --------- line length=23 -2: %s -bool(false) --------- --------- line length=24 -2: %s -bool(false) --------- --------- line length=25 -2: %s -bool(false) --------- --------- line length=26 -2: %s -bool(false) --------- --------- line length=27 -2: %s -bool(false) --------- --------- line length=28 -2: %s -bool(false) --------- --------- line length=29 -2: %s -bool(false) --------- --------- line length=30 -2: %s -bool(false) --------- --------- line length=31 -2: %s -bool(false) --------- --------- line length=32 -2: %s -bool(false) --------- --------- line length=33 -2: %s -bool(false) --------- --------- line length=34 -2: %s -bool(false) --------- --------- line length=35 -2: %s -bool(false) --------- --------- line length=36 -string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?= - =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?= - =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?= - =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?= - =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=37 -string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?= - =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?= - =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?= - =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?= - =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=38 -string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?= - =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?= - =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?= - =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?= - =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=39 -string(236) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?= - =?ISO-2022-JP?B?GyRCJXMlVyVrSjgbKEI=?= - =?ISO-2022-JP?B?GyRCO3pOcyU1JXMbKEI=?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwbKEI=?= - =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=40 -string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=41 -string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=42 -string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=43 -string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bBsoQg==?= - =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=44 -string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?= - =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=45 -string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?= - =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=46 -string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?= - =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?= - =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=47 -string(176) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?= - =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcyVXJWsbKEI=?= - =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=48 -string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?= - =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=49 -string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?= - =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=50 -string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?= - =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=51 -string(152) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?= - =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjg7ehsoQg==?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=52 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?=" --------- bool(true) --------- line length=53 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?=" --------- bool(true) --------- line length=54 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?= - =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?=" --------- bool(true) --------- line length=55 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?= - =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfEtcOGwbKEI=?= - =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=56 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?= - =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=57 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?= - =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=58 -string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?= - =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?= - =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?=" --------- bool(true) --------- line length=59 -string(152) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?= - =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYlLRsoQg==?= - =?ISO-2022-JP?B?GyRCJTklSBsoQg==?=" --------- bool(true) --------- line length=60 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=61 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=62 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=63 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?= - =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=64 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=65 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=66 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=67 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?= - =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=68 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=69 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=70 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=71 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?= - =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=72 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=73 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=74 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=75 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?= - =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?=" --------- bool(true) --------- line length=76 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?= - =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=77 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?= - =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=78 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?= - =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?=" --------- bool(true) --------- line length=79 -string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?= - =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?=" --------- bool(true) diff --git a/ext/iconv/tests/iconv_stream_filter.phpt b/ext/iconv/tests/iconv_stream_filter.phpt deleted file mode 100644 index 70facdcf563ef..0000000000000 --- a/ext/iconv/tests/iconv_stream_filter.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -iconv stream filter ---SKIPIF-- - ---INI-- -iconv.internal_charset=iso-8859-1 ---FILE-- - ---EXPECTF-- -string(20) "1b244224332473244b24" -string(10) "41244f1b28" -string(2) "42" -string(20) "a4b3a4f3a4cba4c1a4cf" -string(10) "69636f6e76" -string(2) "0a" - -Warning: fread(): iconv stream filter ("ISO-2022-JP"=>"EUC-JP"): invalid multibyte sequence in %s on line %d -string(0) "" -string(0) "" -string(0) "" diff --git a/ext/iconv/tests/iconv_stream_filter.txt b/ext/iconv/tests/iconv_stream_filter.txt deleted file mode 100644 index 1074d2a48b509..0000000000000 --- a/ext/iconv/tests/iconv_stream_filter.txt +++ /dev/null @@ -1 +0,0 @@ -$B$3$s$K$A$O(Biconv diff --git a/ext/iconv/tests/iconv_strlen.phpt b/ext/iconv/tests/iconv_strlen.phpt deleted file mode 100644 index b7605ba943018..0000000000000 --- a/ext/iconv/tests/iconv_strlen.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -iconv_strlen() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - ---EXPECT-- -int(3) -int(3) -int(13) -int(10) diff --git a/ext/iconv/tests/iconv_strpos.phpt b/ext/iconv/tests/iconv_strpos.phpt deleted file mode 100644 index 5820b150ce09c..0000000000000 --- a/ext/iconv/tests/iconv_strpos.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -iconv_strpos() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -iconv.internal_charset=ISO-8859-1 ---FILE-- - ---EXPECTF-- -2: %s -bool(false) -2: %s -bool(false) -2: %s -bool(false) -bool(false) -int(7) -int(7) -int(16) -int(16) -int(300) -int(300) -int(302) -int(151) -int(1) -int(300) diff --git a/ext/iconv/tests/iconv_strrpos.phpt b/ext/iconv/tests/iconv_strrpos.phpt deleted file mode 100644 index c395834e55603..0000000000000 --- a/ext/iconv/tests/iconv_strrpos.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -iconv_strrpos() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -iconv.internal_charset=ISO-8859-1 ---FILE-- - ---EXPECT-- -int(14) -int(9) -int(605) -int(300) -int(305) -int(151) -int(600) -bool(false) -int(601) -int(300) -int(602) -int(301) -int(603) -int(302) -int(604) -int(303) -int(605) -int(304) -int(606) -int(305) diff --git a/ext/iconv/tests/iconv_substr.phpt b/ext/iconv/tests/iconv_substr.phpt deleted file mode 100644 index 1a6bd3053445d..0000000000000 --- a/ext/iconv/tests/iconv_substr.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -iconv_substr() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -iconv.internal_charset=ISO-8859-1 ---FILE-- - ---EXPECT-- -666768696a6b6c -666768696a6b6c -a6a4a8a4aaa4ab -a4aba4ada4afa4b1a4b3a4b5a4b7 -bool(false) -string(0) "" -string(14) "This is a test" -string(14) "This is a test" -string(3) "est" -string(3) "est" -string(5) "This " -string(5) "This " -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(10) "¤Á¤Ï ISO-2" diff --git a/ext/iconv/tests/ob_iconv_handler.phpt b/ext/iconv/tests/ob_iconv_handler.phpt deleted file mode 100644 index 43beada2fbb04..0000000000000 --- a/ext/iconv/tests/ob_iconv_handler.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ob_iconv_handler() ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 -error_reporting=2039 ---FILE-- - ---EXPECT-- -‚ ‚˘‚¤‚Ĥ‚¨ diff --git a/ext/iconv/tests/skipif.inc b/ext/iconv/tests/skipif.inc deleted file mode 100644 index 6f7bbf2b86523..0000000000000 --- a/ext/iconv/tests/skipif.inc +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/ext/iconv/tests/test.inc b/ext/iconv/tests/test.inc deleted file mode 100644 index 78f180462f700..0000000000000 --- a/ext/iconv/tests/test.inc +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/ext/iconv/tests/translit-failure.phpt b/ext/iconv/tests/translit-failure.phpt deleted file mode 100644 index d8b9fbff839b0..0000000000000 --- a/ext/iconv/tests/translit-failure.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Translit failure ---SKIPIF-- - ---INI-- -error_reporting=2039 ---FILE-- - ---EXPECT-- -string(14) "'Ecrit par %s." diff --git a/ext/iconv/tests/translit-utf8.phpt b/ext/iconv/tests/translit-utf8.phpt deleted file mode 100644 index aa5131f2c312b..0000000000000 --- a/ext/iconv/tests/translit-utf8.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Translit UTF-8 quotes ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 -error_reporting=2047 ---FILE-- - ---EXPECT-- -"Hello" -`Hello´ -"Hello" -`Hello´ -"Hello" -'Hello' -"Hello" -'Hello' diff --git a/ext/imap/CREDITS b/ext/imap/CREDITS deleted file mode 100644 index 2d19ecd24a327..0000000000000 --- a/ext/imap/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -IMAP -Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky diff --git a/ext/imap/IMAP_Win32_HOWTO.txt b/ext/imap/IMAP_Win32_HOWTO.txt deleted file mode 100644 index 5fbd859a6d6e6..0000000000000 --- a/ext/imap/IMAP_Win32_HOWTO.txt +++ /dev/null @@ -1,32 +0,0 @@ -Rules for building IMAP ------------------------ - -Note 1: You *must* use NT's cmd.exe for this job; 4NT.exe will NOT work properly. -Note 2: During the entire build process, you can ignore warnings about - inconsistent DLL linkage. - -- Open IMAP under php_build. Rename this directory to 'IMAP'. -- Change to the IMAP directory. -- Edit .\src\osdep\nt\makefile.nt: - Search for '/MT', and change it to '/MD'. If you're compiling in DEBUG mode, - use '/MDd' instead. - Search for 'ERASE'. Comment out the line that contains the ERASE command. -- Run 'nmake nt' - ----Begin Win2K only--- -- At some point, the build will fail. Rerun 'nmake nt'. -- After a while, the build will fail again, failing to find auths.c. -- Change directory to 'c-client' -- Create an a file named auths.c, that includes the following line: - #include "auth_md5.c" -- Run 'nmake -f makefile.nt' ----End Win2K only--- - -At this point (even if the last build apparently failed), you should have the -client library ready (cclient.lib). - -Start Visual Studio, load php_modules.dsw, select the IMAP projects, and build -it. - - - \ No newline at end of file diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 deleted file mode 100644 index e2782e3265bfa..0000000000000 --- a/ext/imap/config.m4 +++ /dev/null @@ -1,186 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then - AC_DEFINE(HAVE_IMAP2000, 1, [ ]) - IMAP_DIR=$i - IMAP_INC_DIR=$i$1 - break - elif test -r "$i$1/rfc822.h"; then - IMAP_DIR=$i; - IMAP_INC_DIR=$i$1 - break -]) - -AC_DEFUN([IMAP_LIB_CHK],[ - str="$IMAP_DIR/$1/lib$lib.*" - for i in `echo $str`; do - test -r $i && IMAP_LIBDIR=$IMAP_DIR/$1 && break 2 - done -]) - -dnl PHP_IMAP_TEST_BUILD(function, action-if-ok, action-if-not-ok, extra-libs) -AC_DEFUN([PHP_IMAP_TEST_BUILD], [ - PHP_TEST_BUILD([$1], [$2], [$3], [$4], - [ - void mm_log(void){} - void mm_dlog(void){} - void mm_flags(void){} - void mm_fatal(void){} - void mm_critical(void){} - void mm_nocritical(void){} - void mm_notify(void){} - void mm_login(void){} - void mm_diskerror(void){} - void mm_status(void){} - void mm_lsub(void){} - void mm_list(void){} - void mm_exists(void){} - void mm_searched(void){} - void mm_expunged(void){} - ]) -]) - -AC_DEFUN([PHP_IMAP_KRB_CHK], [ - if test "$PHP_KERBEROS" != "no"; then - PHP_SETUP_KERBEROS(IMAP_SHARED_LIBADD, - [ - AC_DEFINE(HAVE_IMAP_KRB,1,[ ]) - ], [ - AC_MSG_ERROR([Kerberos libraries not found. - - Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr ) - ]) - ]) - else - AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [ - AC_MSG_ERROR([This c-client library is built with Kerberos support. - - Add --with-kerberos to your configure line. Check config.log for details. - ]) - ]) - fi -]) - -AC_DEFUN([PHP_IMAP_SSL_CHK], [ - if test "$PHP_IMAP_SSL" != "no"; then - PHP_SETUP_OPENSSL(IMAP_SHARED_LIBADD, - [ - AC_DEFINE(HAVE_IMAP_SSL,1,[ ]) - ], [ - AC_MSG_ERROR([OpenSSL libraries not found. - - Check the path given to --with-openssl-dir and output in config.log) - ]) - ]) - elif test -f "$IMAP_INC_DIR/linkage.c"; then - AC_EGREP_HEADER(ssl_onceonlyinit, $IMAP_INC_DIR/linkage.c, [ - AC_MSG_ERROR([This c-client library is built with SSL support. - - Add --with-imap-ssl to your configure line. Check config.log for details. - ]) - ]) - fi -]) - - -PHP_ARG_WITH(imap,for IMAP support, -[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix]) - -PHP_ARG_WITH(kerberos,for IMAP Kerberos support, -[ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install prefix], no, no) - -PHP_ARG_WITH(imap-ssl,for IMAP SSL support, -[ --with-imap-ssl[=DIR] IMAP: Include SSL support. DIR is the OpenSSL install prefix], no, no) - - -if test "$PHP_IMAP" != "no"; then - PHP_SUBST(IMAP_SHARED_LIBADD) - PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared) - AC_DEFINE(HAVE_IMAP,1,[ ]) - - for i in $PHP_IMAP /usr/local /usr; do - IMAP_INC_CHK() - el[]IMAP_INC_CHK(/include/c-client) - el[]IMAP_INC_CHK(/include/imap) - el[]IMAP_INC_CHK(/include) - el[]IMAP_INC_CHK(/imap) - el[]IMAP_INC_CHK(/c-client) - fi - done - - dnl Check for c-client version 2004 - AC_EGREP_HEADER(mail_fetch_overview_sequence, $IMAP_INC_DIR/mail.h, [ - AC_DEFINE(HAVE_IMAP2004,1,[ ]) - ]) - - dnl Check for c-client version 2001 - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$IMAP_INC_DIR - AC_EGREP_CPP(this_is_true, [ -#include "imap4r1.h" -#if defined(IMAPSSLPORT) - this_is_true -#endif - ],[ - AC_DEFINE(HAVE_IMAP2001, 1, [ ]) - ],[]) - CPPFLAGS=$old_CPPFLAGS - - PHP_CHECK_LIBRARY(pam, pam_start, - [ - PHP_ADD_LIBRARY(pam,, IMAP_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBPAM,1,[ ]) - ]) - - PHP_CHECK_LIBRARY(crypt, crypt, - [ - PHP_ADD_LIBRARY(crypt,, IMAP_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBCRYPT,1,[ ]) - ]) - - PHP_EXPAND_PATH($IMAP_DIR, IMAP_DIR) - - if test -z "$IMAP_DIR"; then - AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) - fi - - if test -r "$IMAP_DIR/c-client/c-client.a"; then - ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 - elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then - ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 - fi - - for lib in c-client4 c-client imap; do - IMAP_LIB=$lib - IMAP_LIB_CHK($PHP_LIBDIR) - IMAP_LIB_CHK(c-client) - done - - if test -z "$IMAP_LIBDIR"; then - AC_MSG_ERROR(Cannot find imap library (libc-client.a). Please check your c-client installation.) - fi - - PHP_ADD_INCLUDE($IMAP_INC_DIR) - PHP_ADD_LIBRARY_DEFER($IMAP_LIB,, IMAP_SHARED_LIBADD) - PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD) - PHP_IMAP_KRB_CHK - PHP_IMAP_SSL_CHK - - dnl Test the build in the end - TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD" - - dnl Check if auth_gss exists - PHP_IMAP_TEST_BUILD(auth_gssapi_valid, [ - AC_DEFINE(HAVE_IMAP_AUTH_GSS, 1, [ ]) - ], [], $TST_LIBS) - - AC_MSG_CHECKING(whether build with IMAP works) - PHP_IMAP_TEST_BUILD(mail_newbody, [ - AC_MSG_RESULT(yes) - ], [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([build test failed. Please check the config.log for details.]) - ], $TST_LIBS) -fi diff --git a/ext/imap/config.w32 b/ext/imap/config.w32 deleted file mode 100644 index 3a6c8fe5f04d3..0000000000000 --- a/ext/imap/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("imap", "IMAP Support", "no"); - -if (PHP_IMAP == "yes") { - if (CHECK_LIB("cclient.lib", "imap") && - (CHECK_HEADER_ADD_INCLUDE("c-client.h", "CFLAGS_IMAP")|| - CHECK_HEADER_ADD_INCLUDE("c-client/c-client.h", "CFLAGS_IMAP", null, null, true))) { - CHECK_LIB("winmm.lib", "imap"); - CHECK_LIB("ws2_32.lib", "imap"); - CHECK_LIB("Secur32.lib", "imap"); - CHECK_LIB("crypt32.lib", "imap"); - EXTENSION("imap", "php_imap.c"); - - ADD_FLAG("CFLAGS_IMAP", "/D HAVE_IMAP2000=1 /D HAVE_IMAP2004=1 /D HAVE_IMAP_SSL=1"); - AC_DEFINE('HAVE_IMAP', 1, 'Have IMAP support', true); - } else { - WARNING("imap not enabled; libraries and headers not found"); - } -} diff --git a/ext/imap/imap.dsp b/ext/imap/imap.dsp deleted file mode 100644 index ef05d49f205ff..0000000000000 --- a/ext/imap/imap.dsp +++ /dev/null @@ -1,176 +0,0 @@ -# Microsoft Developer Studio Project File - Name="imap" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=imap - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "imap.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "imap.mak" CFG="imap - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "imap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "imap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "imap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "imap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "imap - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /machine:I386 /out:"Release/php_imap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\IMAP\C-Client" - -!ELSEIF "$(CFG)" == "imap - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_imap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\IMAP\C-Client" - -!ELSEIF "$(CFG)" == "imap - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "ZTS" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_imap.dll" /pdbtype:sept /libpath:"..\..\..\\" /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "imap - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\imap\c-client" /D "ZTS" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /D HAVE_IMAP2001=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib wsock32.lib winmm.lib cclient.lib Secur32.lib CertIdl.Lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\imap" -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "imap - Win32 Release" -# Name "imap - Win32 Debug" -# Name "imap - Win32 Debug_TS" -# Name "imap - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_imap.c -# End Source File -# Begin Source File - -SOURCE=..\..\win32\sendmail.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_imap.h -# End Source File -# Begin Source File - -SOURCE=..\..\win32\sendmail.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\IMAP_Win32_HOWTO.txt -# End Source File -# End Target -# End Project diff --git a/ext/imap/imap.h b/ext/imap/imap.h deleted file mode 100644 index 914d12831661d..0000000000000 --- a/ext/imap/imap.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _INCLUDED_IMAP_H -#define _INCLUDED_IMAP_H - -#if COMPILE_DL -#undef HAVE_IMAP -#define HAVE_IMAP 1 -#endif - -#if HAVE_IMAP - -#ifndef PHP_WIN32 -#include "build-defs.h" -#endif - -/* Functions accessable to PHP */ -extern zend_module_entry imap_module_entry; -#define imap_module_ptr &imap_module_entry - -extern PHP_MINIT_FUNCTION(imap); -extern PHP_RINIT_FUNCTION(imap); -extern PHP_RSHUTDOWN_FUNCTION(imap); -PHP_MINFO_FUNCTION(imap); -PHP_FUNCTION(imap_open); -PHP_FUNCTION(imap_popen); -PHP_FUNCTION(imap_reopen); -PHP_FUNCTION(imap_num_msg); -PHP_FUNCTION(imap_num_recent); -PHP_FUNCTION(imap_headers); -PHP_FUNCTION(imap_headerinfo); -PHP_FUNCTION(imap_rfc822_parse_headers); -PHP_FUNCTION(imap_body); -PHP_FUNCTION(imap_fetchstructure); -PHP_FUNCTION(imap_fetchbody); -PHP_FUNCTION(imap_expunge); -PHP_FUNCTION(imap_delete); -PHP_FUNCTION(imap_undelete); -PHP_FUNCTION(imap_check); -PHP_FUNCTION(imap_close); -PHP_FUNCTION(imap_mail_copy); -PHP_FUNCTION(imap_mail_move); -PHP_FUNCTION(imap_createmailbox); -PHP_FUNCTION(imap_renamemailbox); -PHP_FUNCTION(imap_deletemailbox); -PHP_FUNCTION(imap_listmailbox); -PHP_FUNCTION(imap_scanmailbox); -PHP_FUNCTION(imap_subscribe); -PHP_FUNCTION(imap_unsubscribe); -PHP_FUNCTION(imap_append); -PHP_FUNCTION(imap_ping); -PHP_FUNCTION(imap_base64); -PHP_FUNCTION(imap_qprint); -PHP_FUNCTION(imap_8bit); -PHP_FUNCTION(imap_binary); -PHP_FUNCTION(imap_mailboxmsginfo); -PHP_FUNCTION(imap_rfc822_write_address); -PHP_FUNCTION(imap_rfc822_parse_adrlist); -PHP_FUNCTION(imap_setflag_full); -PHP_FUNCTION(imap_clearflag_full); -PHP_FUNCTION(imap_sort); -PHP_FUNCTION(imap_fetchheader); -PHP_FUNCTION(imap_fetchtext); -PHP_FUNCTION(imap_uid); -PHP_FUNCTION(imap_msgno); -PHP_FUNCTION(imap_list); -PHP_FUNCTION(imap_list_full); -PHP_FUNCTION(imap_listscan); -PHP_FUNCTION(imap_lsub); -PHP_FUNCTION(imap_lsub_full); -PHP_FUNCTION(imap_create); -PHP_FUNCTION(imap_rename); -PHP_FUNCTION(imap_status); -PHP_FUNCTION(imap_bodystruct); -PHP_FUNCTION(imap_fetch_overview); -PHP_FUNCTION(imap_mail_compose); -PHP_FUNCTION(imap_alerts); -PHP_FUNCTION(imap_errors); -PHP_FUNCTION(imap_last_error); -PHP_FUNCTION(imap_mail); -PHP_FUNCTION(imap_search); -PHP_FUNCTION(imap_utf8); -PHP_FUNCTION(imap_utf7_decode); -PHP_FUNCTION(imap_utf7_encode); -PHP_FUNCTION(imap_mime_header_decode); -#else -#define imap_module_ptr NULL -#endif /* HAVE_IMAP */ - -#endif - - - - - - -#define phpext_imap_ptr imap_module_ptr - - - - - - - - diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c deleted file mode 100644 index 8825244b482fd..0000000000000 --- a/ext/imap/php_imap.c +++ /dev/null @@ -1,4392 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rex Logan | - | Mark Musone | - | Brian Wang | - | Kaj-Michael Lang | - | Antoni Pamies Olive | - | Rasmus Lerdorf | - | Chuck Hagenbuch | - | Andrew Skalski | - | Hartmut Holzgraefe | - | Jani Taskinen | - | Daniel R. Kalowsky | - | PHP 4.0 updates: Zeev Suraski | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#define IMAP41 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" - -#ifdef ERROR -#undef ERROR -#endif -#include "php_imap.h" - -#include -#include -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#include "win32/sendmail.h" -MAILSTREAM DEFAULTPROTO; -#endif - -#define CRLF "\015\012" -#define CRLF_LEN sizeof("\015\012") - 1 -#define PHP_EXPUNGE 32768 -#define PHP_IMAP_ADDRESS_SIZE_BUF 10 - -static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC); -static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC); -static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, zval *paddress TSRMLS_DC); -static int _php_imap_address_size(ADDRESS *addresslist); - -/* These function declarations are missing from the IMAP header files... */ -void rfc822_date(char *date); -char *cpystr(const char *str); -char *cpytxt(SIZEDTEXT *dst, char *text, unsigned long size); -long utf8_mime2text(SIZEDTEXT *src, SIZEDTEXT *dst); -unsigned long find_rightmost_bit(unsigned long *valptr); -void fs_give(void **block); -void *fs_get(size_t size); - - -/* {{{ imap_functions[] - */ -function_entry imap_functions[] = { - PHP_FE(imap_open, NULL) - PHP_FE(imap_reopen, NULL) - PHP_FE(imap_close, NULL) - PHP_FE(imap_num_msg, NULL) - PHP_FE(imap_num_recent, NULL) - PHP_FE(imap_headers, NULL) - PHP_FE(imap_headerinfo, NULL) - PHP_FE(imap_rfc822_parse_headers, NULL) - PHP_FE(imap_rfc822_write_address, NULL) - PHP_FE(imap_rfc822_parse_adrlist, NULL) - PHP_FE(imap_body, NULL) - PHP_FE(imap_bodystruct, NULL) - PHP_FE(imap_fetchbody, NULL) - PHP_FE(imap_fetchheader, NULL) - PHP_FE(imap_fetchstructure, NULL) - PHP_FE(imap_expunge, NULL) - PHP_FE(imap_delete, NULL) - PHP_FE(imap_undelete, NULL) - PHP_FE(imap_check, NULL) - PHP_FE(imap_mail_copy, NULL) - PHP_FE(imap_mail_move, NULL) - PHP_FE(imap_mail_compose, NULL) - PHP_FE(imap_createmailbox, NULL) - PHP_FE(imap_renamemailbox, NULL) - PHP_FE(imap_deletemailbox, NULL) - PHP_FE(imap_subscribe, NULL) - PHP_FE(imap_unsubscribe, NULL) - PHP_FE(imap_append, NULL) - PHP_FE(imap_ping, NULL) - PHP_FE(imap_base64, NULL) - PHP_FE(imap_qprint, NULL) - PHP_FE(imap_8bit, NULL) - PHP_FE(imap_binary, NULL) - PHP_FE(imap_utf8, NULL) - PHP_FE(imap_status, NULL) - PHP_FE(imap_mailboxmsginfo, NULL) - PHP_FE(imap_setflag_full, NULL) - PHP_FE(imap_clearflag_full, NULL) - PHP_FE(imap_sort, NULL) - PHP_FE(imap_uid, NULL) - PHP_FE(imap_msgno, NULL) - PHP_FE(imap_list, NULL) - PHP_FE(imap_lsub, NULL) - PHP_FE(imap_fetch_overview, NULL) - PHP_FE(imap_alerts, NULL) - PHP_FE(imap_errors, NULL) - PHP_FE(imap_last_error, NULL) - PHP_FE(imap_search, NULL) - PHP_FE(imap_utf7_decode, NULL) - PHP_FE(imap_utf7_encode, NULL) - PHP_FE(imap_mime_header_decode, NULL) - PHP_FE(imap_thread, NULL) - PHP_FE(imap_timeout, NULL) - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) - PHP_FE(imap_get_quota, NULL) - PHP_FE(imap_get_quotaroot, NULL) - PHP_FE(imap_set_quota, NULL) - PHP_FE(imap_setacl, NULL) - PHP_FE(imap_getacl, NULL) -#endif - - PHP_FE(imap_mail, NULL) - - PHP_FALIAS(imap_header, imap_headerinfo, NULL) - PHP_FALIAS(imap_listmailbox, imap_list, NULL) - PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL) - PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL) - PHP_FALIAS(imap_listsubscribed, imap_lsub, NULL) - PHP_FALIAS(imap_getsubscribed, imap_lsub_full, NULL) - PHP_FALIAS(imap_fetchtext, imap_body, NULL) - PHP_FALIAS(imap_scan, imap_listscan, NULL) - PHP_FALIAS(imap_create, imap_createmailbox, NULL) - PHP_FALIAS(imap_rename, imap_renamemailbox, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ imap_module_entry - */ -zend_module_entry imap_module_entry = { - STANDARD_MODULE_HEADER, - "imap", - imap_functions, - PHP_MINIT(imap), - NULL, - PHP_RINIT(imap), - PHP_RSHUTDOWN(imap), - PHP_MINFO(imap), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(imap) - -#ifdef COMPILE_DL_IMAP -ZEND_GET_MODULE(imap) -#endif - -/* True globals, no need for thread safety */ -static int le_imap; - -#define PHP_IMAP_CHECK_MSGNO(msgindex) \ - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); \ - RETURN_FALSE; \ - } \ - -/* {{{ mail_close_it - */ -static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - pils *imap_le_struct = (pils *)rsrc->ptr; - - mail_close_full(imap_le_struct->imap_stream, imap_le_struct->flags); - - if (IMAPG(imap_user)) { - efree(IMAPG(imap_user)); - IMAPG(imap_user) = 0; - } - if (IMAPG(imap_password)) { - efree(IMAPG(imap_password)); - IMAPG(imap_password) = 0; - } - - efree(imap_le_struct); -} -/* }}} */ - -/* {{{ add_assoc_object - */ -static int add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC) -{ - HashTable *symtable; - - if (Z_TYPE_P(arg) == IS_OBJECT) { - symtable = Z_OBJPROP_P(arg); - } else { - symtable = Z_ARRVAL_P(arg); - } - return zend_hash_update(symtable, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ add_next_index_object - */ -static inline int add_next_index_object(zval *arg, zval *tmp TSRMLS_DC) -{ - HashTable *symtable; - - if (Z_TYPE_P(arg) == IS_OBJECT) { - symtable = Z_OBJPROP_P(arg); - } else { - symtable = Z_ARRVAL_P(arg); - } - - return zend_hash_next_index_insert(symtable, (void *) &tmp, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ mail_newfolderobjectlist - * - * Mail instantiate FOBJECTLIST - * Returns: new FOBJECTLIST list - * Author: CJH - */ -FOBJECTLIST *mail_newfolderobjectlist(void) -{ - return (FOBJECTLIST *) memset(fs_get(sizeof(FOBJECTLIST)), 0, sizeof(FOBJECTLIST)); -} -/* }}} */ - -/* {{{ mail_free_foblist - * - * Mail garbage collect FOBJECTLIST - * Accepts: pointer to FOBJECTLIST pointer - * Author: CJH - */ -void mail_free_foblist(FOBJECTLIST **foblist, FOBJECTLIST **tail) -{ - FOBJECTLIST *cur, *next; - - for (cur=*foblist, next=cur->next; cur; cur=next) { - next = cur->next; - - if(cur->text.data) - fs_give((void **)&(cur->text.data)); - - fs_give((void **)&cur); - } - - *tail = NIL; - *foblist = NIL; -} -/* }}} */ - -/* {{{ mail_newerrorlist - * - * Mail instantiate ERRORLIST - * Returns: new ERRORLIST list - * Author: CJH - */ -ERRORLIST *mail_newerrorlist(void) -{ - return (ERRORLIST *) memset(fs_get(sizeof(ERRORLIST)), 0, sizeof(ERRORLIST)); -} -/* }}} */ - -/* {{{ mail_free_errorlist - * - * Mail garbage collect FOBJECTLIST - * Accepts: pointer to FOBJECTLIST pointer - * Author: CJH - */ -void mail_free_errorlist(ERRORLIST **errlist) -{ - if (*errlist) { /* only free if exists */ - if ((*errlist)->text.data) { - fs_give((void **) &(*errlist)->text.data); - } - mail_free_errorlist (&(*errlist)->next); - fs_give((void **) errlist); /* return string to free storage */ - } -} -/* }}} */ - -/* {{{ mail_newmessagelist - * - * Mail instantiate MESSAGELIST - * Returns: new MESSAGELIST list - * Author: CJH - */ -MESSAGELIST *mail_newmessagelist(void) -{ - return (MESSAGELIST *) memset(fs_get(sizeof(MESSAGELIST)), 0, sizeof(MESSAGELIST)); -} -/* }}} */ - -/* {{{ mail_free_messagelist - * - * Mail garbage collect MESSAGELIST - * Accepts: pointer to MESSAGELIST pointer - * Author: CJH - */ -void mail_free_messagelist(MESSAGELIST **msglist, MESSAGELIST **tail) -{ - MESSAGELIST *cur, *next; - - for (cur = *msglist, next = cur->next; cur; cur = next) { - next = cur->next; - fs_give((void **)&cur); - } - - *tail = NIL; - *msglist = NIL; -} -/* }}} */ - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) -/* {{{ mail_getquota - * - * Mail GET_QUOTA callback - * Called via the mail_parameter function in c-client:src/c-client/mail.c - * Author DRK - */ - -void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist) -{ - zval *t_map, *return_value; - TSRMLS_FETCH(); - - return_value = *IMAPG(quota_return); - -/* put parsing code here */ - for(; qlist; qlist = qlist->next) { - MAKE_STD_ZVAL(t_map); - array_init(t_map); - if (strncmp(qlist->name, "STORAGE", 7) == 0) - { - /* this is to add backwards compatibility */ - add_assoc_long_ex(return_value, "usage", sizeof("usage"), qlist->usage); - add_assoc_long_ex(return_value, "limit", sizeof("limit"), qlist->limit); - } - - add_assoc_long_ex(t_map, "usage", sizeof("usage"), qlist->usage); - add_assoc_long_ex(t_map, "limit", sizeof("limit"), qlist->limit); - add_assoc_zval_ex(return_value, qlist->name, strlen(qlist->name)+1, t_map); - } -} -/* }}} */ - - -/* {{{ mail_getquota - * - * Mail GET_ACL callback - * Called via the mail_parameter function in c-client:src/c-client/mail.c - */ -void mail_getacl(MAILSTREAM *stream, char *mailbox, ACLLIST *alist) -{ - TSRMLS_FETCH(); - - /* walk through the ACLLIST */ - for(; alist; alist = alist->next) { - add_assoc_stringl(IMAPG(imap_acl_list), alist->identifier, alist->rights, strlen(alist->rights), 1); - } -} -/* }}} */ - -#endif - - -/* {{{ php_imap_init_globals - */ -static void php_imap_init_globals(zend_imap_globals *imap_globals) -{ - imap_globals->imap_user = NIL; - imap_globals->imap_password = NIL; - - imap_globals->imap_alertstack = NIL; - imap_globals->imap_errorstack = NIL; - - imap_globals->imap_folders = NIL; - imap_globals->imap_folders_tail = NIL; - imap_globals->imap_sfolders = NIL; - imap_globals->imap_sfolders_tail = NIL; - imap_globals->imap_messages = NIL; - imap_globals->imap_messages_tail = NIL; - imap_globals->imap_folder_objects = NIL; - imap_globals->imap_folder_objects_tail = NIL; - imap_globals->imap_sfolder_objects = NIL; - imap_globals->imap_sfolder_objects_tail = NIL; - - imap_globals->folderlist_style = FLIST_ARRAY; -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) - imap_globals->quota_return = NIL; - imap_globals->imap_acl_list = NIL; -#endif -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(imap) -{ - unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN | SA_UIDNEXT | SA_UIDVALIDITY; - - ZEND_INIT_MODULE_GLOBALS(imap, php_imap_init_globals, NULL) - -#ifndef PHP_WIN32 - mail_link(&unixdriver); /* link in the unix driver */ - mail_link(&mhdriver); /* link in the mh driver */ - /* mail_link(&mxdriver); */ /* According to c-client docs (internal.txt) this shouldn't be used. */ - mail_link(&mmdfdriver); /* link in the mmdf driver */ - mail_link(&newsdriver); /* link in the news driver */ - mail_link(&philedriver); /* link in the phile driver */ -#endif - mail_link(&imapdriver); /* link in the imap driver */ - mail_link(&nntpdriver); /* link in the nntp driver */ - mail_link(&pop3driver); /* link in the pop3 driver */ - mail_link(&mbxdriver); /* link in the mbx driver */ - mail_link(&tenexdriver); /* link in the tenex driver */ - mail_link(&mtxdriver); /* link in the mtx driver */ - mail_link(&dummydriver); /* link in the dummy driver */ - -#ifndef PHP_WIN32 - auth_link(&auth_log); /* link in the log authenticator */ - auth_link(&auth_md5); /* link in the cram-md5 authenticator */ -#if HAVE_IMAP_KRB && defined(HAVE_IMAP_AUTH_GSS) - auth_link(&auth_gss); /* link in the gss authenticator */ -#endif - -#ifdef HAVE_IMAP_SSL - ssl_onceonlyinit (); -#endif -#endif - - /* lets allow NIL */ - REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_CS); - - /* set default timeout values */ - mail_parameters(NIL, SET_OPENTIMEOUT, (void *) FG(default_socket_timeout)); - mail_parameters(NIL, SET_READTIMEOUT, (void *) FG(default_socket_timeout)); - mail_parameters(NIL, SET_WRITETIMEOUT, (void *) FG(default_socket_timeout)); - mail_parameters(NIL, SET_CLOSETIMEOUT, (void *) FG(default_socket_timeout)); - - /* timeout constants */ - REGISTER_LONG_CONSTANT("IMAP_OPENTIMEOUT", 1, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("IMAP_READTIMEOUT", 2, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("IMAP_WRITETIMEOUT", 3, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("IMAP_CLOSETIMEOUT", 4, CONST_PERSISTENT | CONST_CS); - - /* Open Options */ - - REGISTER_LONG_CONSTANT("OP_DEBUG", OP_DEBUG, CONST_PERSISTENT | CONST_CS); - /* debug protocol negotiations */ - REGISTER_LONG_CONSTANT("OP_READONLY", OP_READONLY, CONST_PERSISTENT | CONST_CS); - /* read-only open */ - REGISTER_LONG_CONSTANT("OP_ANONYMOUS", OP_ANONYMOUS, CONST_PERSISTENT | CONST_CS); - /* anonymous open of newsgroup */ - REGISTER_LONG_CONSTANT("OP_SHORTCACHE", OP_SHORTCACHE, CONST_PERSISTENT | CONST_CS); - /* short (elt-only) caching */ - REGISTER_LONG_CONSTANT("OP_SILENT", OP_SILENT, CONST_PERSISTENT | CONST_CS); - /* don't pass up events (internal use) */ - REGISTER_LONG_CONSTANT("OP_PROTOTYPE", OP_PROTOTYPE, CONST_PERSISTENT | CONST_CS); - /* return driver prototype */ - REGISTER_LONG_CONSTANT("OP_HALFOPEN", OP_HALFOPEN, CONST_PERSISTENT | CONST_CS); - /* half-open (IMAP connect but no select) */ - REGISTER_LONG_CONSTANT("OP_EXPUNGE", OP_EXPUNGE, CONST_PERSISTENT | CONST_CS); - /* silently expunge recycle stream */ - REGISTER_LONG_CONSTANT("OP_SECURE", OP_SECURE, CONST_PERSISTENT | CONST_CS); - /* don't do non-secure authentication */ - - /* - PHP re-assigns CL_EXPUNGE a custom value that can be used as part of the imap_open() bitfield - because it seems like a good idea to be able to indicate that the mailbox should be - automatically expunged during imap_open in case the script get interrupted and it doesn't get - to the imap_close() where this option is normally placed. If the c-client library adds other - options and the value for this one conflicts, simply make PHP_EXPUNGE higher at the top of - this file - */ - REGISTER_LONG_CONSTANT("CL_EXPUNGE", PHP_EXPUNGE, CONST_PERSISTENT | CONST_CS); - /* expunge silently */ - - - /* Fetch options */ - - REGISTER_LONG_CONSTANT("FT_UID", FT_UID, CONST_PERSISTENT | CONST_CS); - /* argument is a UID */ - REGISTER_LONG_CONSTANT("FT_PEEK", FT_PEEK, CONST_PERSISTENT | CONST_CS); - /* peek at data */ - REGISTER_LONG_CONSTANT("FT_NOT", FT_NOT, CONST_PERSISTENT | CONST_CS); - /* NOT flag for header lines fetch */ - REGISTER_LONG_CONSTANT("FT_INTERNAL", FT_INTERNAL, CONST_PERSISTENT | CONST_CS); - /* text can be internal strings */ - REGISTER_LONG_CONSTANT("FT_PREFETCHTEXT", FT_PREFETCHTEXT, CONST_PERSISTENT | CONST_CS); - /* IMAP prefetch text when fetching header */ - - - /* Flagging options */ - - REGISTER_LONG_CONSTANT("ST_UID", ST_UID, CONST_PERSISTENT | CONST_CS); - /* argument is a UID sequence */ - REGISTER_LONG_CONSTANT("ST_SILENT", ST_SILENT, CONST_PERSISTENT | CONST_CS); - /* don't return results */ - REGISTER_LONG_CONSTANT("ST_SET", ST_SET, CONST_PERSISTENT | CONST_CS); - /* set vs. clear */ - - - /* Copy options */ - - REGISTER_LONG_CONSTANT("CP_UID", CP_UID, CONST_PERSISTENT | CONST_CS); - /* argument is a UID sequence */ - REGISTER_LONG_CONSTANT("CP_MOVE", CP_MOVE, CONST_PERSISTENT | CONST_CS); - /* delete from source after copying */ - - - /* Search/sort options */ - - REGISTER_LONG_CONSTANT("SE_UID", SE_UID, CONST_PERSISTENT | CONST_CS); - /* return UID */ - REGISTER_LONG_CONSTANT("SE_FREE", SE_FREE, CONST_PERSISTENT | CONST_CS); - /* free search program after finished */ - REGISTER_LONG_CONSTANT("SE_NOPREFETCH", SE_NOPREFETCH, CONST_PERSISTENT | CONST_CS); - /* no search prefetching */ - REGISTER_LONG_CONSTANT("SO_FREE", SO_FREE, CONST_PERSISTENT | CONST_CS); - /* free sort program after finished */ - REGISTER_LONG_CONSTANT("SO_NOSERVER", SO_NOSERVER, CONST_PERSISTENT | CONST_CS); - /* don't do server-based sort */ - - - /* Status options */ - - REGISTER_LONG_CONSTANT("SA_MESSAGES", SA_MESSAGES , CONST_PERSISTENT | CONST_CS); - /* number of messages */ - REGISTER_LONG_CONSTANT("SA_RECENT", SA_RECENT, CONST_PERSISTENT | CONST_CS); - /* number of recent messages */ - REGISTER_LONG_CONSTANT("SA_UNSEEN", SA_UNSEEN , CONST_PERSISTENT | CONST_CS); - /* number of unseen messages */ - REGISTER_LONG_CONSTANT("SA_UIDNEXT", SA_UIDNEXT, CONST_PERSISTENT | CONST_CS); - /* next UID to be assigned */ - REGISTER_LONG_CONSTANT("SA_UIDVALIDITY", SA_UIDVALIDITY , CONST_PERSISTENT | CONST_CS); - /* UID validity value */ - REGISTER_LONG_CONSTANT("SA_ALL", sa_all, CONST_PERSISTENT | CONST_CS); - /* get all status information */ - - - /* Bits for mm_list() and mm_lsub() */ - - REGISTER_LONG_CONSTANT("LATT_NOINFERIORS", LATT_NOINFERIORS , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LATT_NOSELECT", LATT_NOSELECT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LATT_MARKED", LATT_MARKED, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LATT_UNMARKED", LATT_UNMARKED , CONST_PERSISTENT | CONST_CS); - -#ifdef LATT_REFERRAL - REGISTER_LONG_CONSTANT("LATT_REFERRAL", LATT_REFERRAL, CONST_PERSISTENT | CONST_CS); -#endif - -#ifdef LATT_HASCHILDREN - REGISTER_LONG_CONSTANT("LATT_HASCHILDREN", LATT_HASCHILDREN, CONST_PERSISTENT | CONST_CS); -#endif - -#ifdef LATT_HASNOCHILDREN - REGISTER_LONG_CONSTANT("LATT_HASNOCHILDREN", LATT_HASNOCHILDREN, CONST_PERSISTENT | CONST_CS); -#endif - - /* Sort functions */ - - REGISTER_LONG_CONSTANT("SORTDATE", SORTDATE , CONST_PERSISTENT | CONST_CS); - /* date */ - REGISTER_LONG_CONSTANT("SORTARRIVAL", SORTARRIVAL , CONST_PERSISTENT | CONST_CS); - /* arrival date */ - REGISTER_LONG_CONSTANT("SORTFROM", SORTFROM , CONST_PERSISTENT | CONST_CS); - /* from */ - REGISTER_LONG_CONSTANT("SORTSUBJECT", SORTSUBJECT , CONST_PERSISTENT | CONST_CS); - /* subject */ - REGISTER_LONG_CONSTANT("SORTTO", SORTTO , CONST_PERSISTENT | CONST_CS); - /* to */ - REGISTER_LONG_CONSTANT("SORTCC", SORTCC , CONST_PERSISTENT | CONST_CS); - /* cc */ - REGISTER_LONG_CONSTANT("SORTSIZE", SORTSIZE , CONST_PERSISTENT | CONST_CS); - /* size */ - - REGISTER_LONG_CONSTANT("TYPETEXT", TYPETEXT , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEMULTIPART", TYPEMULTIPART , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEMESSAGE", TYPEMESSAGE , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEAPPLICATION", TYPEAPPLICATION , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEAUDIO", TYPEAUDIO , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEIMAGE", TYPEIMAGE , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEVIDEO", TYPEVIDEO , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEMODEL", TYPEMODEL , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("TYPEOTHER", TYPEOTHER , CONST_PERSISTENT | CONST_CS); - /* - TYPETEXT unformatted text - TYPEMULTIPART multiple part - TYPEMESSAGE encapsulated message - TYPEAPPLICATION application data - TYPEAUDIO audio - TYPEIMAGE static image (GIF, JPEG, etc.) - TYPEVIDEO video - TYPEMODEL model - TYPEOTHER unknown - */ - - REGISTER_LONG_CONSTANT("ENC7BIT", ENC7BIT , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("ENC8BIT", ENC8BIT , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("ENCBINARY", ENCBINARY , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("ENCBASE64", ENCBASE64, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("ENCQUOTEDPRINTABLE", ENCQUOTEDPRINTABLE , CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("ENCOTHER", ENCOTHER , CONST_PERSISTENT | CONST_CS); - /* - ENC7BIT 7 bit SMTP semantic data - ENC8BIT 8 bit SMTP semantic data - ENCBINARY 8 bit binary data - ENCBASE64 base-64 encoded data - ENCQUOTEDPRINTABLE human-readable 8-as-7 bit data - ENCOTHER unknown - */ - - le_imap = zend_register_list_destructors_ex(mail_close_it, NULL, "imap", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(imap) -{ - IMAPG(imap_errorstack) = NIL; - IMAPG(imap_alertstack) = NIL; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(imap) -{ - ERRORLIST *ecur = NIL; - STRINGLIST *acur = NIL; - - if (IMAPG(imap_errorstack) != NIL) { - /* output any remaining errors at their original error level */ - if (EG(error_reporting) & E_NOTICE) { - ecur = IMAPG(imap_errorstack); - while (ecur != NIL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg); - ecur = ecur->next; - } - } - mail_free_errorlist(&IMAPG(imap_errorstack)); - } - - if (IMAPG(imap_alertstack) != NIL) { - /* output any remaining alerts at E_NOTICE level */ - if (EG(error_reporting) & E_NOTICE) { - acur = IMAPG(imap_alertstack); - while (acur != NIL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", acur->LTEXT); - acur = acur->next; - } - } - mail_free_stringlist(&IMAPG(imap_alertstack)); - IMAPG(imap_alertstack) = NIL; - } - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(imap) -{ - php_info_print_table_start(); -#if HAVE_IMAP2004 - php_info_print_table_row(2, "IMAP c-Client Version", "2004"); -#elif HAVE_IMAP2001 - php_info_print_table_row(2, "IMAP c-Client Version", "2001"); -#elif HAVE_IMAP2000 - php_info_print_table_row(2, "IMAP c-Client Version", "2000"); -#elif defined(IMAP41) - php_info_print_table_row(2, "IMAP c-Client Version", "4.1"); -#else - php_info_print_table_row(2, "IMAP c-Client Version", "4.0"); -#endif -#if HAVE_IMAP_SSL - php_info_print_table_row(2, "SSL Support", "enabled"); -#endif -#if HAVE_IMAP_KRB && HAVE_IMAP_AUTH_GSS - php_info_print_table_row(2, "Kerberos Support", "enabled"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ imap_do_open - */ -static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - zval **mailbox, **user, **passwd, **options; - MAILSTREAM *imap_stream; - pils *imap_le_struct; - long flags=NIL; - long cl_flags=NIL; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &mailbox, &user, &passwd, &options) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(mailbox); - convert_to_string_ex(user); - convert_to_string_ex(passwd); - if (myargc ==4) { - convert_to_long_ex(options); - flags = Z_LVAL_PP(options); - if (flags & PHP_EXPUNGE) { - cl_flags = CL_EXPUNGE; - flags ^= PHP_EXPUNGE; - } - } - - if (IMAPG(imap_user)) { - efree(IMAPG(imap_user)); - } - - if (IMAPG(imap_password)) { - efree(IMAPG(imap_password)); - } - - IMAPG(imap_user) = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user)); - IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), Z_STRLEN_PP(passwd)); - - imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags); - - if (imap_stream == NIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't open stream %s", Z_STRVAL_PP(mailbox)); - efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; - efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; - RETURN_FALSE; - } - - imap_le_struct = emalloc(sizeof(pils)); - imap_le_struct->imap_stream = imap_stream; - imap_le_struct->flags = cl_flags; - - ZEND_REGISTER_RESOURCE(return_value, imap_le_struct, le_imap); -} -/* }}} */ - -/* {{{ proto resource imap_open(string mailbox, string user, string password [, int options]) - Open an IMAP stream to a mailbox */ -PHP_FUNCTION(imap_open) -{ - php_imap_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool imap_reopen(resource stream_id, string mailbox [, int options]) - Reopen an IMAP stream to a new mailbox */ -PHP_FUNCTION(imap_reopen) -{ - zval **streamind, **mailbox, **options; - pils *imap_le_struct; - MAILSTREAM *imap_stream; - long flags=NIL; - long cl_flags=NIL; - int myargc=ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &mailbox, &options) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(mailbox); - - if (myargc == 3) { - convert_to_long_ex(options); - flags = Z_LVAL_PP(options); - if (flags & PHP_EXPUNGE) { - cl_flags = CL_EXPUNGE; - flags ^= PHP_EXPUNGE; - } - imap_le_struct->flags = cl_flags; - } - imap_stream = mail_open(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), flags); - if (imap_stream == NIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream"); - RETURN_FALSE; - } - imap_le_struct->imap_stream = imap_stream; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imap_append(resource stream_id, string folder, string message [, string options]) - Append a new message to a specified mailbox */ -PHP_FUNCTION(imap_append) -{ - zval **streamind, **folder, **message, **flags; - pils *imap_le_struct; - STRING st; - int myargc=ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &streamind, &folder, &message, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(folder); - convert_to_string_ex(message); - - if (myargc == 4) { - convert_to_string_ex(flags); - } - - INIT (&st, mail_string, (void *) Z_STRVAL_PP(message), Z_STRLEN_PP(message)); - - if (mail_append_full(imap_le_struct->imap_stream, Z_STRVAL_PP(folder), myargc==4 ? Z_STRVAL_PP(flags) : NIL, NIL, &st)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int imap_num_msg(resource stream_id) - Gives the number of messages in the current mailbox */ -PHP_FUNCTION(imap_num_msg) -{ - zval **streamind; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - RETURN_LONG(imap_le_struct->imap_stream->nmsgs); -} -/* }}} */ - -/* {{{ proto bool imap_ping(resource stream_id) - Check if the IMAP stream is still active */ -PHP_FUNCTION(imap_ping) -{ - zval **streamind; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - RETURN_BOOL(mail_ping(imap_le_struct->imap_stream)); -} -/* }}} */ - -/* {{{ proto int imap_num_recent(resource stream_id) - Gives the number of recent messages in current mailbox */ -PHP_FUNCTION(imap_num_recent) -{ - zval **streamind; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - RETURN_LONG(imap_le_struct->imap_stream->recent); -} -/* }}} */ - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) -/* {{{ proto array imap_get_quota(resource stream_id, string qroot) - Returns the quota set to the mailbox account qroot */ -PHP_FUNCTION(imap_get_quota) -{ - zval **streamind, **qroot; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &qroot) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(qroot); - - array_init(return_value); - IMAPG(quota_return) = &return_value; - - /* set the callback for the GET_QUOTA function */ - mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota); - if(!imap_getquota(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquota failed"); - zval_dtor(return_value); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array imap_get_quotaroot(resource stream_id, string mbox) - Returns the quota set to the mailbox account mbox */ -PHP_FUNCTION(imap_get_quotaroot) -{ - zval **streamind, **mbox; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mbox) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(mbox); - - array_init(return_value); - IMAPG(quota_return) = &return_value; - - /* set the callback for the GET_QUOTAROOT function */ - mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota); - if(!imap_getquotaroot(imap_le_struct->imap_stream, Z_STRVAL_PP(mbox))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquotaroot failed"); - zval_dtor(return_value); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_set_quota(resource stream_id, string qroot, int mailbox_size) - Will set the quota for qroot mailbox */ -PHP_FUNCTION(imap_set_quota) -{ - zval **streamind, **qroot, **mailbox_size; - pils *imap_le_struct; - STRINGLIST limits; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &qroot, &mailbox_size) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(qroot); - convert_to_long_ex(mailbox_size); - - limits.text.data = "STORAGE"; - limits.text.size = Z_LVAL_PP(mailbox_size); - limits.next = NIL; - - RETURN_BOOL(imap_setquota(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot), &limits)); -} -/* }}} */ - -/* {{{ proto bool imap_setacl(resource stream_id, string mailbox, string id, string rights) - Sets the ACL for a given mailbox */ -PHP_FUNCTION(imap_setacl) -{ - zval **streamind, **mailbox, **id, **rights; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &mailbox, &id, &rights) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(mailbox); - convert_to_string_ex(rights); - - RETURN_BOOL(imap_setacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights))); -} -/* }}} */ - - -/* {{{ proto array imap_getacl(resource stream_id, string mailbox) - Gets the ACL for a given mailbox */ -PHP_FUNCTION(imap_getacl) -{ - zval **streamind, **mailbox; - pils *imap_le_struct; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(mailbox); - - /* initializing the special array for the return values */ - array_init(return_value); - - IMAPG(imap_acl_list) = return_value; - - /* set the callback for the GET_ACL function */ - mail_parameters(NIL, SET_ACL, (void *) mail_getacl); - if(!imap_getacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox))) { - php_error(E_WARNING, "c-client imap_getacl failed"); - zval_dtor(return_value); - RETURN_FALSE; - } - - IMAPG(imap_acl_list) = NIL; -} -/* }}} */ - -#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */ - - -/* {{{ proto bool imap_expunge(resource stream_id) - Permanently delete all messages marked for deletion */ -PHP_FUNCTION(imap_expunge) -{ - zval **streamind; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - mail_expunge (imap_le_struct->imap_stream); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imap_close(resource stream_id [, int options]) - Close an IMAP stream */ -PHP_FUNCTION(imap_close) -{ - zval **options, **streamind=NULL; - pils *imap_le_struct=NULL; - long flags = NIL; - int myargcount=ZEND_NUM_ARGS(); - - if (myargcount < 1 || myargcount > 2 || zend_get_parameters_ex(myargcount, &streamind, &options) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - if (myargcount == 2) { - convert_to_long_ex(options); - flags = Z_LVAL_PP(options); - /* Do the translation from PHP's internal PHP_EXPUNGE define to c-client's CL_EXPUNGE */ - if (flags & PHP_EXPUNGE) { - flags ^= PHP_EXPUNGE; - flags |= CL_EXPUNGE; - } - imap_le_struct->flags = flags; - } - - zend_list_delete(Z_RESVAL_PP(streamind)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array imap_headers(resource stream_id) - Returns headers for all messages in a mailbox */ -PHP_FUNCTION(imap_headers) -{ - zval **streamind; - pils *imap_le_struct; - unsigned long i; - char *t; - unsigned int msgno; - char tmp[MAILTMPLEN]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - /* Initialize return array */ - array_init(return_value); - - for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { - MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno); - mail_fetchstructure(imap_le_struct->imap_stream, msgno, NIL); - tmp[0] = cache->recent ? (cache->seen ? 'R': 'N') : ' '; - tmp[1] = (cache->recent | cache->seen) ? ' ' : 'U'; - tmp[2] = cache->flagged ? 'F' : ' '; - tmp[3] = cache->answered ? 'A' : ' '; - tmp[4] = cache->deleted ? 'D' : ' '; - tmp[5] = cache->draft ? 'X' : ' '; - sprintf(tmp + 6, "%4ld) ", cache->msgno); - mail_date(tmp+11, cache); - tmp[22] = ' '; - tmp[23] = '\0'; - mail_fetchfrom(tmp+23, imap_le_struct->imap_stream, msgno, (long)20); - strcat(tmp, " "); - if ((i = cache->user_flags)) { - strcat(tmp, "{"); - while (i) { - strcat(tmp, imap_le_struct->imap_stream->user_flags[find_rightmost_bit (&i)]); - if (i) strcat(tmp, " "); - } - strcat(tmp, "} "); - } - mail_fetchsubject(t = tmp + strlen(tmp), imap_le_struct->imap_stream, msgno, (long)25); - sprintf(t += strlen(t), " (%ld chars)", cache->rfc822_size); - add_next_index_string(return_value, tmp, 1); - } -} -/* }}} */ - -/* {{{ proto string imap_body(resource stream_id, int msg_no [, int options]) - Read the message body */ -PHP_FUNCTION(imap_body) -{ - zval **streamind, **msgno, **flags; - pils *imap_le_struct; - int msgindex, myargc=ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &msgno, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - if (myargc == 3) { - convert_to_long_ex(flags); - } - - if ((myargc == 3) && (Z_LVAL_PP(flags) & FT_UID)) { - /* This should be cached; if it causes an extra RTT to the - IMAP server, then that's the price we pay for making - sure we don't crash. */ - msgindex = mail_msgno(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)); - } else { - msgindex = Z_LVAL_PP(msgno); - } - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); - RETURN_FALSE; - } - - RETVAL_STRING(mail_fetchtext_full (imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, myargc==3 ? Z_LVAL_PP(flags) : NIL), 1); -} -/* }}} */ - -/* {{{ proto bool imap_mail_copy(resource stream_id, int msg_no, string mailbox [, int options]) - Copy specified message to a mailbox */ -PHP_FUNCTION(imap_mail_copy) -{ - zval **streamind, **seq, **folder, **options; - pils *imap_le_struct; - int myargcount = ZEND_NUM_ARGS(); - - if (myargcount > 4 || myargcount < 3 || zend_get_parameters_ex(myargcount, &streamind, &seq, &folder, &options) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(seq); - convert_to_string_ex(folder); - if (myargcount == 4) { - convert_to_long_ex(options); - } - - if (mail_copy_full(imap_le_struct->imap_stream, Z_STRVAL_PP(seq), Z_STRVAL_PP(folder), myargcount==4 ? Z_LVAL_PP(options) : NIL)==T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_mail_move(resource stream_id, int msg_no, string mailbox [, int options]) - Move specified message to a mailbox */ -PHP_FUNCTION(imap_mail_move) -{ - zval **streamind, **seq, **folder, **options; - pils *imap_le_struct; - int myargcount = ZEND_NUM_ARGS(); - - if (myargcount > 4 || myargcount < 3 || zend_get_parameters_ex(myargcount, &streamind, &seq, &folder, &options) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(seq); - convert_to_string_ex(folder); - if (myargcount == 4) { - convert_to_long_ex(options); - } - - if (mail_copy_full(imap_le_struct->imap_stream, Z_STRVAL_PP(seq), Z_STRVAL_PP(folder), myargcount == 4 ? (Z_LVAL_PP(options) | CP_MOVE) : CP_MOVE) == T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_createmailbox(resource stream_id, string mailbox) - Create a new mailbox */ -PHP_FUNCTION(imap_createmailbox) -{ - zval **streamind, **folder; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &folder) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(folder); - - if (mail_create(imap_le_struct->imap_stream, Z_STRVAL_PP(folder)) == T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_renamemailbox(resource stream_id, string old_name, string new_name) - Rename a mailbox */ -PHP_FUNCTION(imap_renamemailbox) -{ - zval **streamind, **old_mailbox, **new_mailbox; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &old_mailbox, &new_mailbox) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(old_mailbox); - convert_to_string_ex(new_mailbox); - - if (mail_rename(imap_le_struct->imap_stream, Z_STRVAL_PP(old_mailbox), Z_STRVAL_PP(new_mailbox))==T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_deletemailbox(resource stream_id, string mailbox) - Delete a mailbox */ -PHP_FUNCTION(imap_deletemailbox) -{ - zval **streamind, **folder; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &folder) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(folder); - - if (mail_delete(imap_le_struct->imap_stream, Z_STRVAL_PP(folder))==T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array imap_list(resource stream_id, string ref, string pattern) - Read the list of mailboxes */ -PHP_FUNCTION(imap_list) -{ - zval **streamind, **ref, **pat; - pils *imap_le_struct; - STRINGLIST *cur=NIL; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &ref, &pat) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(ref); - convert_to_string_ex(pat); - - /* set flag for normal, old mailbox list */ - IMAPG(folderlist_style) = FLIST_ARRAY; - - IMAPG(imap_folders) = IMAPG(imap_folders_tail) = NIL; - mail_list(imap_le_struct->imap_stream, Z_STRVAL_PP(ref), Z_STRVAL_PP(pat)); - if (IMAPG(imap_folders) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - cur=IMAPG(imap_folders); - while (cur != NIL) { - add_next_index_string(return_value, cur->LTEXT, 1); - cur=cur->next; - } - mail_free_stringlist (&IMAPG(imap_folders)); - IMAPG(imap_folders) = IMAPG(imap_folders_tail) = NIL; -} - -/* }}} */ - -/* {{{ proto array imap_getmailboxes(resource stream_id, string ref, string pattern) - Reads the list of mailboxes and returns a full array of objects containing name, attributes, and delimiter */ -/* Author: CJH */ -PHP_FUNCTION(imap_list_full) -{ - zval **streamind, **ref, **pat, *mboxob; - pils *imap_le_struct; - FOBJECTLIST *cur=NIL; - char *delim=NIL; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &ref, &pat) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(ref); - convert_to_string_ex(pat); - - /* set flag for new, improved array of objects mailbox list */ - IMAPG(folderlist_style) = FLIST_OBJECT; - - IMAPG(imap_folder_objects) = IMAPG(imap_folder_objects_tail) = NIL; - mail_list(imap_le_struct->imap_stream, Z_STRVAL_PP(ref), Z_STRVAL_PP(pat)); - if (IMAPG(imap_folder_objects) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - delim = safe_emalloc(2, sizeof(char), 0); - cur=IMAPG(imap_folder_objects); - while (cur != NIL) { - MAKE_STD_ZVAL(mboxob); - object_init(mboxob); - add_property_string(mboxob, "name", cur->LTEXT, 1); - add_property_long(mboxob, "attributes", cur->attributes); -#ifdef IMAP41 - delim[0] = (char)cur->delimiter; - delim[1] = 0; - add_property_string(mboxob, "delimiter", delim, 1); -#else - add_property_string(mboxob, "delimiter", cur->delimiter, 1); -#endif - add_next_index_object(return_value, mboxob TSRMLS_CC); - cur=cur->next; - } - mail_free_foblist(&IMAPG(imap_folder_objects), &IMAPG(imap_folder_objects_tail)); - efree(delim); - IMAPG(folderlist_style) = FLIST_ARRAY; /* reset to default */ -} -/* }}} */ - -/* {{{ proto array imap_scan(resource stream_id, string ref, string pattern, string content) - Read list of mailboxes containing a certain string */ -PHP_FUNCTION(imap_listscan) -{ - zval **streamind, **ref, **pat, **content; - pils *imap_le_struct; - STRINGLIST *cur=NIL; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &ref, &pat, &content) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(ref); - convert_to_string_ex(pat); - convert_to_string_ex(content); - - IMAPG(imap_folders) = NIL; - mail_scan(imap_le_struct->imap_stream, Z_STRVAL_PP(ref), Z_STRVAL_PP(pat), Z_STRVAL_PP(content)); - if (IMAPG(imap_folders) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - cur=IMAPG(imap_folders); - while (cur != NIL) { - add_next_index_string(return_value, cur->LTEXT, 1); - cur=cur->next; - } - mail_free_stringlist (&IMAPG(imap_folders)); - IMAPG(imap_folders) = IMAPG(imap_folders_tail) = NIL; -} - -/* }}} */ - -/* {{{ proto object imap_check(resource stream_id) - Get mailbox properties */ -PHP_FUNCTION(imap_check) -{ - zval **streamind; - pils *imap_le_struct; - char date[100]; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - if (mail_ping (imap_le_struct->imap_stream) == NIL) { - RETURN_FALSE; - } - - if (imap_le_struct->imap_stream && imap_le_struct->imap_stream->mailbox) { - rfc822_date(date); - object_init(return_value); - add_property_string(return_value, "Date", date, 1); - add_property_string(return_value, "Driver", imap_le_struct->imap_stream->dtb->name, 1); - add_property_string(return_value, "Mailbox", imap_le_struct->imap_stream->mailbox, 1); - add_property_long(return_value, "Nmsgs", imap_le_struct->imap_stream->nmsgs); - add_property_long(return_value, "Recent", imap_le_struct->imap_stream->recent); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_delete(resource stream_id, int msg_no [, int options]) - Mark a message for deletion */ -PHP_FUNCTION(imap_delete) -{ - zval **streamind, **sequence, **flags; - pils *imap_le_struct; - int myargc=ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &sequence, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(sequence); - if (myargc == 3) { - convert_to_long_ex(flags); - } - - mail_setflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), "\\DELETED", myargc==3 ? Z_LVAL_PP(flags) : NIL); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto bool imap_undelete(resource stream_id, int msg_no) - Remove the delete flag from a message */ -PHP_FUNCTION(imap_undelete) -{ - zval **streamind, **sequence, **flags; - pils *imap_le_struct; - int myargc=ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &sequence, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(sequence); - if (myargc == 3) { - convert_to_long_ex(flags); - } - - mail_clearflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), "\\DELETED", myargc==3 ? Z_LVAL_PP(flags) : NIL); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto object imap_headerinfo(resource stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]]) - Read the headers of the message */ -PHP_FUNCTION(imap_headerinfo) -{ - zval **streamind, **msgno, **fromlength, **subjectlength, **defaulthost; - pils *imap_le_struct; - MESSAGECACHE *cache; - ENVELOPE *en; - char dummy[2000], fulladdress[MAILTMPLEN]; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 5 || zend_get_parameters_ex(myargc, &streamind, &msgno, &fromlength, &subjectlength, &defaulthost) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - if (myargc >= 3) { - convert_to_long_ex(fromlength); - if (Z_LVAL_PP(fromlength) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be greater than or equal to 0"); - RETURN_FALSE; - } - } else { - fromlength = 0x00; - } - if (myargc >= 4) { - convert_to_long_ex(subjectlength); - if (Z_LVAL_PP(subjectlength) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be greater than or equal to 0"); - RETURN_FALSE; - } - } else { - subjectlength = 0x00; - } - if (myargc == 5) { - convert_to_string_ex(defaulthost); - } - - PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno)); - - if (mail_fetchstructure(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL)) { - cache = mail_elt(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)); - } else { - RETURN_FALSE; - } - - en = mail_fetchenvelope(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)); - - /* call a function to parse all the text, so that we can use the - same function to parse text from other sources */ - _php_make_header_object(return_value, en TSRMLS_CC); - - /* now run through properties that are only going to be returned - from a server, not text headers */ - add_property_string(return_value, "Recent", cache->recent ? (cache->seen ? "R": "N") : " ", 1); - add_property_string(return_value, "Unseen", (cache->recent | cache->seen) ? " " : "U", 1); - add_property_string(return_value, "Flagged", cache->flagged ? "F" : " ", 1); - add_property_string(return_value, "Answered", cache->answered ? "A" : " ", 1); - add_property_string(return_value, "Deleted", cache->deleted ? "D" : " ", 1); - add_property_string(return_value, "Draft", cache->draft ? "X" : " ", 1); - - sprintf(dummy, "%4ld", cache->msgno); - add_property_string(return_value, "Msgno", dummy, 1); - - mail_date(dummy, cache); - add_property_string(return_value, "MailDate", dummy, 1); - - sprintf(dummy, "%ld", cache->rfc822_size); - add_property_string(return_value, "Size", dummy, 1); - - add_property_long(return_value, "udate", mail_longdate(cache)); - - if (en->from && fromlength) { - fulladdress[0] = 0x00; - mail_fetchfrom(fulladdress, imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_LVAL_PP(fromlength)); - add_property_string(return_value, "fetchfrom", fulladdress, 1); - } - if (en->subject && subjectlength) { - fulladdress[0] = 0x00; - mail_fetchsubject(fulladdress, imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_LVAL_PP(subjectlength)); - add_property_string(return_value, "fetchsubject", fulladdress, 1); - } -} -/* }}} */ - -/* {{{ proto object imap_rfc822_parse_headers(string headers [, string default_host]) - Parse a set of mail headers contained in a string, and return an object similar to imap_headerinfo() */ -PHP_FUNCTION(imap_rfc822_parse_headers) -{ - zval **headers, **defaulthost; - ENVELOPE *en; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 1 || myargc > 2 || zend_get_parameters_ex(myargc, &headers, &defaulthost) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(headers); - if (myargc == 2) { - convert_to_string_ex(defaulthost); - } - - if (myargc == 2) { - rfc822_parse_msg(&en, NULL, Z_STRVAL_PP(headers), Z_STRLEN_PP(headers), NULL, Z_STRVAL_PP(defaulthost), NIL); - } else { - rfc822_parse_msg(&en, NULL, Z_STRVAL_PP(headers), Z_STRLEN_PP(headers), NULL, "UNKNOWN", NIL); - } - - /* call a function to parse all the text, so that we can use the - same function no matter where the headers are from */ - _php_make_header_object(return_value, en TSRMLS_CC); - mail_free_envelope(&en); -} -/* }}} */ - - -/* KMLANG */ -/* {{{ proto array imap_lsub(resource stream_id, string ref, string pattern) - Return a list of subscribed mailboxes */ -PHP_FUNCTION(imap_lsub) -{ - zval **streamind, **ref, **pat; - pils *imap_le_struct; - STRINGLIST *cur=NIL; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &ref, &pat) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(ref); - convert_to_string_ex(pat); - - /* set flag for normal, old mailbox list */ - IMAPG(folderlist_style) = FLIST_ARRAY; - - IMAPG(imap_sfolders) = NIL; - mail_lsub(imap_le_struct->imap_stream, Z_STRVAL_PP(ref), Z_STRVAL_PP(pat)); - if (IMAPG(imap_sfolders) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - cur=IMAPG(imap_sfolders); - while (cur != NIL) { - add_next_index_string(return_value, cur->LTEXT, 1); - cur=cur->next; - } - mail_free_stringlist (&IMAPG(imap_sfolders)); - IMAPG(imap_sfolders) = IMAPG(imap_sfolders_tail) = NIL; -} -/* }}} */ - -/* {{{ proto array imap_getsubscribed(resource stream_id, string ref, string pattern) - Return a list of subscribed mailboxes, in the same format as imap_getmailboxes() */ -/* Author: CJH */ -PHP_FUNCTION(imap_lsub_full) -{ - zval **streamind, **ref, **pat, *mboxob; - pils *imap_le_struct; - FOBJECTLIST *cur=NIL; - char *delim=NIL; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &ref, &pat) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(ref); - convert_to_string_ex(pat); - - /* set flag for new, improved array of objects list */ - IMAPG(folderlist_style) = FLIST_OBJECT; - - IMAPG(imap_sfolder_objects) = IMAPG(imap_sfolder_objects_tail) = NIL; - mail_lsub(imap_le_struct->imap_stream, Z_STRVAL_PP(ref), Z_STRVAL_PP(pat)); - if (IMAPG(imap_sfolder_objects) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - delim = safe_emalloc(2, sizeof(char), 0); - cur=IMAPG(imap_sfolder_objects); - while (cur != NIL) { - MAKE_STD_ZVAL(mboxob); - object_init(mboxob); - add_property_string(mboxob, "name", cur->LTEXT, 1); - add_property_long(mboxob, "attributes", cur->attributes); -#ifdef IMAP41 - delim[0] = (char)cur->delimiter; - delim[1] = 0; - add_property_string(mboxob, "delimiter", delim, 1); -#else - add_property_string(mboxob, "delimiter", cur->delimiter, 1); -#endif - add_next_index_object(return_value, mboxob TSRMLS_CC); - cur=cur->next; - } - mail_free_foblist (&IMAPG(imap_sfolder_objects), &IMAPG(imap_sfolder_objects_tail)); - efree(delim); - IMAPG(folderlist_style) = FLIST_ARRAY; /* reset to default */ -} -/* }}} */ - -/* {{{ proto bool imap_subscribe(resource stream_id, string mailbox) - Subscribe to a mailbox */ -PHP_FUNCTION(imap_subscribe) -{ - zval **streamind, **folder; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &folder) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(folder); - - if (mail_subscribe(imap_le_struct->imap_stream, Z_STRVAL_PP(folder))==T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool imap_unsubscribe(resource stream_id, string mailbox) - Unsubscribe from a mailbox */ -PHP_FUNCTION(imap_unsubscribe) -{ - zval **streamind, **folder; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &folder) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(folder); - - if (mail_unsubscribe(imap_le_struct->imap_stream, Z_STRVAL_PP(folder))==T) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object imap_fetchstructure(resource stream_id, int msg_no [, int options]) - Read the full structure of a message */ -PHP_FUNCTION(imap_fetchstructure) -{ - zval **streamind, **msgno, **flags; - pils *imap_le_struct; - BODY *body; - int msgindex, myargc=ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &msgno, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - if (Z_LVAL_PP(msgno) < 1) { - RETURN_FALSE; - } - if (myargc == 3) { - convert_to_long_ex(flags); - } - - object_init(return_value); - - if ((myargc == 3) && (Z_LVAL_PP(flags) & FT_UID)) { - /* This should be cached; if it causes an extra RTT to the - IMAP server, then that's the price we pay for making - sure we don't crash. */ - msgindex = mail_msgno(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)); - } else { - msgindex = Z_LVAL_PP(msgno); - } - PHP_IMAP_CHECK_MSGNO(msgindex); - - mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL); - - if (!body) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available"); - RETURN_FALSE; - } - - _php_imap_add_body(return_value, body TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string imap_fetchbody(resource stream_id, int msg_no, string section [, int options]) - Get a specific body section */ -PHP_FUNCTION(imap_fetchbody) -{ - zval **streamind, **msgno, **sec, **flags; - pils *imap_le_struct; - char *body; - unsigned long len; - int myargc=ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &streamind, &msgno, &sec, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - convert_to_string_ex(sec); - if (myargc == 4) { - convert_to_long_ex(flags); - } - - if (myargc < 4 || !(Z_LVAL_PP(flags) & FT_UID)) { - /* only perform the check if the msgno is a message number and not a UID */ - PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno)); - } - - body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL); - - if (!body) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available"); - RETURN_FALSE; - } - RETVAL_STRINGL(body, len, 1); -} - -/* }}} */ - -/* {{{ proto string imap_base64(string text) - Decode BASE64 encoded text */ -PHP_FUNCTION(imap_base64) -{ - zval **text; - char *decode; - unsigned long newlength; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &text) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(text); - - decode = (char *) rfc822_base64((unsigned char *) Z_STRVAL_PP(text), Z_STRLEN_PP(text), &newlength); - - if (decode == NULL) { - RETURN_FALSE; - } - - RETVAL_STRINGL(decode, newlength, 1); - fs_give((void**) &decode); -} -/* }}} */ - -/* {{{ proto string imap_qprint(string text) - Convert a quoted-printable string to an 8-bit string */ -PHP_FUNCTION(imap_qprint) -{ - zval **text; - char *decode; - unsigned long newlength; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &text) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(text); - - decode = (char *) rfc822_qprint((unsigned char *) Z_STRVAL_PP(text), Z_STRLEN_PP(text), &newlength); - - if (decode == NULL) { - RETURN_FALSE; - } - - RETVAL_STRINGL(decode, newlength, 1); - fs_give((void**) &decode); -} -/* }}} */ - -/* {{{ proto string imap_8bit(string text) - Convert an 8-bit string to a quoted-printable string */ -PHP_FUNCTION(imap_8bit) -{ - zval **text; - char *decode; - unsigned long newlength; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &text) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(text); - - decode = (char *) rfc822_8bit((unsigned char *) Z_STRVAL_PP(text), Z_STRLEN_PP(text), &newlength); - - if (decode == NULL) { - RETURN_FALSE; - } - - RETVAL_STRINGL(decode, newlength, 1); - fs_give((void**) &decode); -} -/* }}} */ - -/* {{{ proto string imap_binary(string text) - Convert an 8bit string to a base64 string */ -PHP_FUNCTION(imap_binary) -{ - zval **text; - char *decode; - unsigned long newlength; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &text) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(text); - - decode = rfc822_binary(Z_STRVAL_PP(text), Z_STRLEN_PP(text), &newlength); - - if (decode == NULL) { - RETURN_FALSE; - } - - RETVAL_STRINGL(decode, newlength, 1); - fs_give((void**) &decode); -} -/* }}} */ - -/* {{{ proto object imap_mailboxmsginfo(resource stream_id) - Returns info about the current mailbox */ -PHP_FUNCTION(imap_mailboxmsginfo) -{ - zval **streamind; - pils *imap_le_struct; - char date[100]; - unsigned int msgno, unreadmsg, deletedmsg, msize; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &streamind) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - /* Initialize return object */ - object_init(return_value); - - unreadmsg = 0; - deletedmsg = 0; - msize = 0; - - for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { - MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno); - mail_fetchstructure (imap_le_struct->imap_stream, msgno, NIL); - - if (!cache->seen || cache->recent) { - unreadmsg++; - } - - if (cache->deleted) { - deletedmsg++; - } - msize = msize + cache->rfc822_size; - } - add_property_long(return_value, "Unread", unreadmsg); - add_property_long(return_value, "Deleted", deletedmsg); - add_property_long(return_value, "Nmsgs", imap_le_struct->imap_stream->nmsgs); - add_property_long(return_value, "Size", msize); - rfc822_date(date); - add_property_string(return_value, "Date", date, 1); - add_property_string(return_value, "Driver", imap_le_struct->imap_stream->dtb->name, 1); - add_property_string(return_value, "Mailbox", imap_le_struct->imap_stream->mailbox, 1); - add_property_long(return_value, "Recent", imap_le_struct->imap_stream->recent); -} -/* }}} */ - -/* {{{ proto string imap_rfc822_write_address(string mailbox, string host, string personal) - Returns a properly formatted email address given the mailbox, host, and personal info */ -PHP_FUNCTION(imap_rfc822_write_address) -{ - zval **mailbox, **host, **personal; - ADDRESS *addr; - char string[MAILTMPLEN]; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &mailbox, &host, &personal) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(mailbox); - convert_to_string_ex(host); - convert_to_string_ex(personal); - - addr=mail_newaddr(); - - if (mailbox) { - addr->mailbox = cpystr(Z_STRVAL_PP(mailbox)); - } - - if (host) { - addr->host = cpystr(Z_STRVAL_PP(host)); - } - - if (personal) { - addr->personal = cpystr(Z_STRVAL_PP(personal)); - } - - addr->next=NIL; - addr->error=NIL; - addr->adl=NIL; - - if (_php_imap_address_size(addr) >= MAILTMPLEN) { - RETURN_FALSE; - } - - string[0]='\0'; - rfc822_write_address(string, addr); - RETVAL_STRING(string, 1); -} -/* }}} */ - -/* {{{ proto array imap_rfc822_parse_adrlist(string address_string, string default_host) - Parses an address string */ -PHP_FUNCTION(imap_rfc822_parse_adrlist) -{ - zval **str, **defaulthost, *tovals; - ADDRESS *addresstmp; - ENVELOPE *env; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &defaulthost) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - SEPARATE_ZVAL(str); - convert_to_string_ex(str); - convert_to_string_ex(defaulthost); - - env = mail_newenvelope(); - - rfc822_parse_adrlist(&env->to, Z_STRVAL_PP(str), Z_STRVAL_PP(defaulthost)); - - array_init(return_value); - - addresstmp = env->to; - - if (addresstmp) do { - MAKE_STD_ZVAL(tovals); - object_init(tovals); - if (addresstmp->mailbox) { - add_property_string(tovals, "mailbox", addresstmp->mailbox, 1); - } - if (addresstmp->host) { - add_property_string(tovals, "host", addresstmp->host, 1); - } - if (addresstmp->personal) { - add_property_string(tovals, "personal", addresstmp->personal, 1); - } - if (addresstmp->adl) { - add_property_string(tovals, "adl", addresstmp->adl, 1); - } - add_next_index_object(return_value, tovals TSRMLS_CC); - } while ((addresstmp = addresstmp->next)); -} -/* }}} */ - -/* {{{ proto string imap_utf8(string mime_encoded_text) - Convert a mime-encoded text to UTF-8 */ -PHP_FUNCTION(imap_utf8) -{ - zval **str; - SIZEDTEXT src, dest; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(str); - - src.data = NULL; - src.size = 0; - dest.data = NULL; - dest.size = 0; - - cpytxt(&src, Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - utf8_mime2text(&src, &dest); - RETURN_STRINGL(dest.data, strlen(dest.data), 1); -} -/* }}} */ - - -/* {{{ macros for the modified utf7 conversion functions - * - * author: Andrew Skalski - */ - -/* tests `c' and returns true if it is a special character */ -#define SPECIAL(c) ((c) <= 0x1f || (c) >= 0x7f) - -/* validate a modified-base64 character */ -#define B64CHAR(c) (isalnum(c) || (c) == '+' || (c) == ',') - -/* map the low 64 bits of `n' to the modified-base64 characters */ -#define B64(n) ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ - "abcdefghijklmnopqrstuvwxyz0123456789+,"[(n) & 0x3f]) - -/* map the modified-base64 character `c' to its 64 bit value */ -#define UNB64(c) ((c) == '+' ? 62 : (c) == ',' ? 63 : (c) >= 'a' ? \ - (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4) -/* }}} */ - -/* {{{ proto string imap_utf7_decode(string buf) - Decode a modified UTF-7 string */ -PHP_FUNCTION(imap_utf7_decode) -{ - /* author: Andrew Skalski */ - zval **arg; - const unsigned char *in, *inp, *endp; - unsigned char *out, *outp; - unsigned char c; - int inlen, outlen; - enum { - ST_NORMAL, /* printable text */ - ST_DECODE0, /* encoded text rotation... */ - ST_DECODE1, - ST_DECODE2, - ST_DECODE3 - } state; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(arg); /* Is this string really modified? - If it is use and you don't want it to be seen outside of the function - then use zend_get_parameters() */ - - in = (const unsigned char *) Z_STRVAL_PP(arg); - inlen = Z_STRLEN_PP(arg); - - /* validate and compute length of output string */ - outlen = 0; - state = ST_NORMAL; - for (endp = (inp = in) + inlen; inp < endp; inp++) { - if (state == ST_NORMAL) { - /* process printable character */ - if (SPECIAL(*inp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified UTF-7 character: `%c'", *inp); - RETURN_FALSE; - } else if (*inp != '&') { - outlen++; - } else if (inp + 1 == endp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string"); - RETURN_FALSE; - } else if (inp[1] != '-') { - state = ST_DECODE0; - } else { - outlen++; - inp++; - } - } else if (*inp == '-') { - /* return to NORMAL mode */ - if (state == ST_DECODE1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stray modified base64 character: `%c'", *--inp); - RETURN_FALSE; - } - state = ST_NORMAL; - } else if (!B64CHAR(*inp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified base64 character: `%c'", *inp); - RETURN_FALSE; - } else { - switch (state) { - case ST_DECODE3: - outlen++; - state = ST_DECODE0; - break; - case ST_DECODE2: - case ST_DECODE1: - outlen++; - case ST_DECODE0: - state++; - case ST_NORMAL: - break; - } - } - } - - /* enforce end state */ - if (state != ST_NORMAL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string"); - RETURN_FALSE; - } - - /* allocate output buffer */ - out = emalloc(outlen + 1); - - /* decode input string */ - outp = out; - state = ST_NORMAL; - for (endp = (inp = in) + inlen; inp < endp; inp++) { - if (state == ST_NORMAL) { - if (*inp == '&' && inp[1] != '-') { - state = ST_DECODE0; - } - else if ((*outp++ = *inp) == '&') { - inp++; - } - } - else if (*inp == '-') { - state = ST_NORMAL; - } - else { - /* decode input character */ - switch (state) { - case ST_DECODE0: - *outp = UNB64(*inp) << 2; - state = ST_DECODE1; - break; - case ST_DECODE1: - outp[1] = UNB64(*inp); - c = outp[1] >> 4; - *outp++ |= c; - *outp <<= 4; - state = ST_DECODE2; - break; - case ST_DECODE2: - outp[1] = UNB64(*inp); - c = outp[1] >> 2; - *outp++ |= c; - *outp <<= 6; - state = ST_DECODE3; - break; - case ST_DECODE3: - *outp++ |= UNB64(*inp); - state = ST_DECODE0; - case ST_NORMAL: - break; - } - } - } - - *outp = 0; - -#if PHP_DEBUG - /* warn if we computed outlen incorrectly */ - if (outp - out != outlen) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "outp - out [%d] != outlen [%d]", outp - out, outlen); - } -#endif - - RETURN_STRINGL(out, outlen, 0); -} -/* }}} */ - -/* {{{ proto string imap_utf7_encode(string buf) - Encode a string in modified UTF-7 */ -PHP_FUNCTION(imap_utf7_encode) -{ - /* author: Andrew Skalski */ - zval **arg; - const unsigned char *in, *inp, *endp; - unsigned char *out, *outp; - unsigned char c; - int inlen, outlen; - enum { - ST_NORMAL, /* printable text */ - ST_ENCODE0, /* encoded text rotation... */ - ST_ENCODE1, - ST_ENCODE2 - } state; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(arg); - - in = (const unsigned char *) Z_STRVAL_PP(arg); - inlen = Z_STRLEN_PP(arg); - - /* compute the length of the result string */ - outlen = 0; - state = ST_NORMAL; - endp = (inp = in) + inlen; - while (inp < endp) { - if (state == ST_NORMAL) { - if (SPECIAL(*inp)) { - state = ST_ENCODE0; - outlen++; - } else if (*inp++ == '&') { - outlen++; - } - outlen++; - } else if (!SPECIAL(*inp)) { - state = ST_NORMAL; - } else { - /* ST_ENCODE0 -> ST_ENCODE1 - two chars - * ST_ENCODE1 -> ST_ENCODE2 - one char - * ST_ENCODE2 -> ST_ENCODE0 - one char - */ - if (state == ST_ENCODE2) { - state = ST_ENCODE0; - } - else if (state++ == ST_ENCODE0) { - outlen++; - } - outlen++; - inp++; - } - } - - /* allocate output buffer */ - out = emalloc(outlen + 1); - - /* encode input string */ - outp = out; - state = ST_NORMAL; - endp = (inp = in) + inlen; - while (inp < endp || state != ST_NORMAL) { - if (state == ST_NORMAL) { - if (SPECIAL(*inp)) { - /* begin encoding */ - *outp++ = '&'; - state = ST_ENCODE0; - } else if ((*outp++ = *inp++) == '&') { - *outp++ = '-'; - } - } else if (inp == endp || !SPECIAL(*inp)) { - /* flush overflow and terminate region */ - if (state != ST_ENCODE0) { - c = B64(*outp); - *outp++ = c; - } - *outp++ = '-'; - state = ST_NORMAL; - } else { - /* encode input character */ - switch (state) { - case ST_ENCODE0: - *outp++ = B64(*inp >> 2); - *outp = *inp++ << 4; - state = ST_ENCODE1; - break; - case ST_ENCODE1: - c = B64(*outp | *inp >> 4); - *outp++ = c; - *outp = *inp++ << 2; - state = ST_ENCODE2; - break; - case ST_ENCODE2: - c = B64(*outp | *inp >> 6); - *outp++ = c; - *outp++ = B64(*inp++); - state = ST_ENCODE0; - case ST_NORMAL: - break; - } - } - } - - *outp = 0; - -#if PHP_DEBUG - /* warn if we computed outlen incorrectly */ - if (outp - out != outlen) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "outp - out [%d] != outlen [%d]", outp - out, outlen); - } -#endif - - RETURN_STRINGL(out, outlen, 0); -} -/* }}} */ - -#undef SPECIAL -#undef B64CHAR -#undef B64 -#undef UNB64 - -/* {{{ proto bool imap_setflag_full(resource stream_id, string sequence, string flag [, int options]) - Sets flags on messages */ -PHP_FUNCTION(imap_setflag_full) -{ - zval **streamind, **sequence, **flag, **flags; - pils *imap_le_struct; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &streamind, &sequence, &flag, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(sequence); - convert_to_string_ex(flag); - if (myargc==4) { - convert_to_long_ex(flags); - } - - mail_setflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), Z_STRVAL_PP(flag), myargc==4 ? Z_LVAL_PP(flags) : NIL); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imap_clearflag_full(resource stream_id, string sequence, string flag [, int options]) - Clears flags on messages */ -PHP_FUNCTION(imap_clearflag_full) -{ - zval **streamind, **sequence, **flag, **flags; - pils *imap_le_struct; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &streamind, &sequence, &flag, &flags) ==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(sequence); - convert_to_string_ex(flag); - if (myargc==4) { - convert_to_long_ex(flags); - } - - mail_clearflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), Z_STRVAL_PP(flag), myargc==4 ? Z_LVAL_PP(flags) : NIL); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array imap_sort(resource stream_id, int criteria, int reverse [, int options [, string search_criteria [, string charset]]]) - Sort an array of message headers, optionally including only messages that meet specified criteria. */ -PHP_FUNCTION(imap_sort) -{ - zval **streamind, **pgm, **rev, **flags, **criteria, **charset; - pils *imap_le_struct; - unsigned long *slst, *sl; - char *search_criteria; - SORTPGM *mypgm=NIL; - SEARCHPGM *spg=NIL; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 3 || myargc > 6 || zend_get_parameters_ex(myargc, &streamind, &pgm, &rev, &flags, &criteria, &charset) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(rev); - convert_to_long_ex(pgm); - if (Z_LVAL_PP(pgm) > SORTSIZE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized sort criteria"); - RETURN_FALSE; - } - if (myargc >= 4) { - convert_to_long_ex(flags); - if (Z_LVAL_PP(flags) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search options parameter has to be greater than or equal to 0"); - RETURN_FALSE; - } - } - if (myargc >= 5) { - convert_to_string_ex(criteria); - search_criteria = estrndup(Z_STRVAL_PP(criteria), Z_STRLEN_PP(criteria)); - spg = mail_criteria(search_criteria); - efree(search_criteria); - if (myargc == 6) { - convert_to_string_ex(charset); - } - } else { - spg = mail_newsearchpgm(); - } - - mypgm = mail_newsortpgm(); - mypgm->reverse = Z_LVAL_PP(rev); - mypgm->function = (short) Z_LVAL_PP(pgm); - mypgm->next = NIL; - - slst = mail_sort(imap_le_struct->imap_stream, (myargc == 6 ? Z_STRVAL_PP(charset) : NIL), spg, mypgm, (myargc >= 4 ? Z_LVAL_PP(flags) : NIL)); - - if (spg) { - mail_free_searchpgm(&spg); - } - - array_init(return_value); - if (slst != NIL && slst != 0) { - for (sl = slst; *sl; sl++) { - add_next_index_long(return_value, *sl); - } - fs_give ((void **) &slst); - } -} -/* }}} */ - -/* {{{ proto string imap_fetchheader(resource stream_id, int msg_no [, int options]) - Get the full unfiltered header for a message */ -PHP_FUNCTION(imap_fetchheader) -{ - zval **streamind, **msgno, **flags; - pils *imap_le_struct; - int msgindex, myargc = ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &msgno, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - if (myargc == 3) { - convert_to_long_ex(flags); - } - - if ((myargc == 3) && (Z_LVAL_PP(flags) & FT_UID)) { - /* This should be cached; if it causes an extra RTT to the - IMAP server, then that's the price we pay for making sure - we don't crash. */ - msgindex = mail_msgno(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)); - } else { - msgindex = Z_LVAL_PP(msgno); - } - - PHP_IMAP_CHECK_MSGNO(msgindex); - - RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1); -} -/* }}} */ - -/* {{{ proto int imap_uid(resource stream_id, int msg_no) - Get the unique message id associated with a standard sequential message number */ -PHP_FUNCTION(imap_uid) -{ - zval **streamind, **msgno; - pils *imap_le_struct; - int msgindex; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &msgno) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - - msgindex = Z_LVAL_PP(msgno); - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); - RETURN_FALSE; - } - - RETURN_LONG(mail_uid(imap_le_struct->imap_stream, Z_LVAL_PP(msgno))); -} -/* }}} */ - -/* {{{ proto int imap_msgno(resource stream_id, int unique_msg_id) - Get the sequence number associated with a UID */ -PHP_FUNCTION(imap_msgno) -{ - zval **streamind, **msgno; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &msgno) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msgno); - - RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, Z_LVAL_PP(msgno))); -} -/* }}} */ - -/* {{{ proto object imap_status(resource stream_id, string mailbox, int options) - Get status info from a mailbox */ -PHP_FUNCTION(imap_status) -{ - zval **streamind, **mbx, **flags; - pils *imap_le_struct; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &mbx, &flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(mbx); - convert_to_long_ex(flags); - - object_init(return_value); - - if (mail_status(imap_le_struct->imap_stream, Z_STRVAL_PP(mbx), Z_LVAL_PP(flags))) { - add_property_long(return_value, "flags", IMAPG(status_flags)); - if (IMAPG(status_flags) & SA_MESSAGES) { - add_property_long(return_value, "messages", IMAPG(status_messages)); - } - if (IMAPG(status_flags) & SA_RECENT) { - add_property_long(return_value, "recent", IMAPG(status_recent)); - } - if (IMAPG(status_flags) & SA_UNSEEN) { - add_property_long(return_value, "unseen", IMAPG(status_unseen)); - } - if (IMAPG(status_flags) & SA_UIDNEXT) { - add_property_long(return_value, "uidnext", IMAPG(status_uidnext)); - } - if (IMAPG(status_flags) & SA_UIDVALIDITY) { - add_property_long(return_value, "uidvalidity", IMAPG(status_uidvalidity)); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object imap_bodystruct(resource stream_id, int msg_no, string section) - Read the structure of a specified body section of a specific message */ -PHP_FUNCTION(imap_bodystruct) -{ - zval **streamind, **msg, **section; - pils *imap_le_struct; - zval *parametres, *param, *dparametres, *dparam; - PARAMETER *par, *dpar; - BODY *body; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &msg, §ion) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_long_ex(msg); - convert_to_string_ex(section); - - if (!Z_LVAL_PP(msg) || Z_LVAL_PP(msg) < 1 || (unsigned) Z_LVAL_PP(msg) > imap_le_struct->imap_stream->nmsgs) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); - RETURN_FALSE; - } - - object_init(return_value); - - body=mail_body(imap_le_struct->imap_stream, Z_LVAL_PP(msg), Z_STRVAL_PP(section)); - if (body == NULL) { - zval_dtor(return_value); - RETURN_FALSE; - } - if (body->type <= TYPEMAX) { - add_property_long(return_value, "type", body->type); - } - if (body->encoding <= ENCMAX) { - add_property_long(return_value, "encoding", body->encoding); - } - - if (body->subtype) { - add_property_long(return_value, "ifsubtype", 1); - add_property_string(return_value, "subtype", body->subtype, 1); - } else { - add_property_long(return_value, "ifsubtype", 0); - } - - if (body->description) { - add_property_long(return_value, "ifdescription", 1); - add_property_string(return_value, "description", body->description, 1); - } else { - add_property_long(return_value, "ifdescription", 0); - } - if (body->id) { - add_property_long(return_value, "ifid", 1); - add_property_string(return_value, "id", body->id, 1); - } else { - add_property_long(return_value, "ifid", 0); - } - - - if (body->size.lines) { - add_property_long(return_value, "lines", body->size.lines); - } - if (body->size.bytes) { - add_property_long(return_value, "bytes", body->size.bytes); - } -#ifdef IMAP41 - if (body->disposition.type) { - add_property_long(return_value, "ifdisposition", 1); - add_property_string(return_value, "disposition", body->disposition.type, 1); - } else { - add_property_long(return_value, "ifdisposition", 0); - } - - if (body->disposition.parameter) { - dpar = body->disposition.parameter; - add_property_long(return_value, "ifdparameters", 1); - MAKE_STD_ZVAL(dparametres); - array_init(dparametres); - do { - MAKE_STD_ZVAL(dparam); - object_init(dparam); - add_property_string(dparam, "attribute", dpar->attribute, 1); - add_property_string(dparam, "value", dpar->value, 1); - add_next_index_object(dparametres, dparam TSRMLS_CC); - } while ((dpar = dpar->next)); - add_assoc_object(return_value, "dparameters", dparametres TSRMLS_CC); - } else { - add_property_long(return_value, "ifdparameters", 0); - } -#endif - - if ((par = body->parameter)) { - add_property_long(return_value, "ifparameters", 1); - - MAKE_STD_ZVAL(parametres); - array_init(parametres); - do { - MAKE_STD_ZVAL(param); - object_init(param); - if (par->attribute) { - add_property_string(param, "attribute", par->attribute, 1); - } - if (par->value) { - add_property_string(param, "value", par->value, 1); - } - - add_next_index_object(parametres, param TSRMLS_CC); - } while ((par = par->next)); - } else { - MAKE_STD_ZVAL(parametres); - object_init(parametres); - add_property_long(return_value, "ifparameters", 0); - } - add_assoc_object(return_value, "parameters", parametres TSRMLS_CC); -} - -/* }}} */ - -/* {{{ proto array imap_fetch_overview(resource stream_id, int msg_no [, int options]) - Read an overview of the information in the headers of the given message sequence */ -PHP_FUNCTION(imap_fetch_overview) -{ - zval **streamind, **sequence, **pflags; - pils *imap_le_struct; - zval *myoverview; - char address[MAILTMPLEN]; - long status, flags=0L; - int myargc = ZEND_NUM_ARGS(); - - if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, &streamind, &sequence, &pflags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(sequence); - if(myargc == 3) { - convert_to_long_ex(pflags); - flags = Z_LVAL_PP(pflags); - } - - array_init(return_value); - - status = (flags & FT_UID) - ? mail_uid_sequence (imap_le_struct->imap_stream, Z_STRVAL_PP(sequence)) - : mail_sequence (imap_le_struct->imap_stream, Z_STRVAL_PP(sequence)); - - if (status) { - MESSAGECACHE *elt; - ENVELOPE *env; - unsigned long i; - - for (i = 1; i <= imap_le_struct->imap_stream->nmsgs; i++) { - if (((elt = mail_elt (imap_le_struct->imap_stream, i))->sequence) && - (env = mail_fetch_structure (imap_le_struct->imap_stream, i, NIL, NIL))) { - MAKE_STD_ZVAL(myoverview); - object_init(myoverview); - if (env->subject) { - add_property_string(myoverview, "subject", env->subject, 1); - } - if (env->from && _php_imap_address_size(env->from) < MAILTMPLEN) { - env->from->next=NULL; - address[0] = '\0'; - rfc822_write_address(address, env->from); - add_property_string(myoverview, "from", address, 1); - } - if (env->to && _php_imap_address_size(env->to) < MAILTMPLEN) { - env->to->next = NULL; - address[0] = '\0'; - rfc822_write_address(address, env->to); - add_property_string(myoverview, "to", address, 1); - } - if (env->date) { - add_property_string(myoverview, "date", env->date, 1); - } - if (env->message_id) { - add_property_string(myoverview, "message_id", env->message_id, 1); - } - if (env->references) { - add_property_string(myoverview, "references", env->references, 1); - } - if (env->in_reply_to) { - add_property_string(myoverview, "in_reply_to", env->in_reply_to, 1); - } - add_property_long(myoverview, "size", elt->rfc822_size); - add_property_long(myoverview, "uid", mail_uid(imap_le_struct->imap_stream, i)); - add_property_long(myoverview, "msgno", i); - add_property_long(myoverview, "recent", elt->recent); - add_property_long(myoverview, "flagged", elt->flagged); - add_property_long(myoverview, "answered", elt->answered); - add_property_long(myoverview, "deleted", elt->deleted); - add_property_long(myoverview, "seen", elt->seen); - add_property_long(myoverview, "draft", elt->draft); - add_next_index_object(return_value, myoverview TSRMLS_CC); - } - } - } -} -/* }}} */ - -/* {{{ proto string imap_mail_compose(array envelope, array body) - Create a MIME message based on given envelope and body sections */ -PHP_FUNCTION(imap_mail_compose) -{ - zval **envelope, **body; - char *key; - zval **data, **pvalue, **disp_data, **env_data; - ulong ind; - char *cookie = NIL; - ENVELOPE *env; - BODY *bod=NULL, *topbod=NULL; - PART *mypart=NULL, *toppart=NULL, *part; - PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, *tmp_param = NULL; - char tmp[8 * MAILTMPLEN], *mystring=NULL, *t=NULL, *tempstring=NULL; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &envelope, &body) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (Z_TYPE_PP(envelope) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected Array as envelope parameter"); - RETURN_FALSE; - } - - if (Z_TYPE_PP(body) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected Array as body parameter"); - RETURN_FALSE; - } - - env = mail_newenvelope(); - if (zend_hash_find(Z_ARRVAL_PP(envelope), "remail", sizeof("remail"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - env->remail=cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "return_path", sizeof("return_path"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue) - rfc822_parse_adrlist(&env->return_path, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "date", sizeof("date"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - env->date=cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "from", sizeof("from"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - rfc822_parse_adrlist (&env->from, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "reply_to", sizeof("reply_to"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - rfc822_parse_adrlist (&env->reply_to, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "in_reply_to", sizeof("in_reply_to"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - env->in_reply_to=cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "subject", sizeof("subject"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - env->subject=cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "to", sizeof("to"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - rfc822_parse_adrlist (&env->to, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "cc", sizeof("cc"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - rfc822_parse_adrlist (&env->cc, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "bcc", sizeof("bcc"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - rfc822_parse_adrlist (&env->bcc, Z_STRVAL_PP(pvalue), "NO HOST"); - } - if (zend_hash_find(Z_ARRVAL_PP(envelope), "message_id", sizeof("message_id"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - env->message_id=cpystr(Z_STRVAL_PP(pvalue)); - } - - if (zend_hash_find(Z_ARRVAL_PP(envelope), "custom_headers", sizeof("custom_headers"), (void **) &pvalue)== SUCCESS) { - if (Z_TYPE_PP(pvalue) == IS_ARRAY) { - custom_headers_param = tmp_param = NULL; - while (zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) &env_data) == SUCCESS) { - custom_headers_param = mail_newbody_parameter(); - convert_to_string_ex(env_data); - custom_headers_param->value = (char *) fs_get(Z_STRLEN_PP(env_data) + 1); - custom_headers_param->attribute = NULL; - memcpy(custom_headers_param->value, Z_STRVAL_PP(env_data), Z_STRLEN_PP(env_data) + 1); - zend_hash_move_forward(Z_ARRVAL_PP(pvalue)); - custom_headers_param->next = tmp_param; - tmp_param = custom_headers_param; - } - } - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body)); - if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter cannot be empty"); - RETURN_FALSE; - } - zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind, 0); /* FIXME: is this necessary? we're not using key/ind */ - - if (Z_TYPE_PP(data) == IS_ARRAY) { - bod = mail_newbody(); - topbod = bod; - - if (zend_hash_find(Z_ARRVAL_PP(data), "type", sizeof("type"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->type = (short) Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "encoding", sizeof("encoding"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->encoding = (short) Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "charset", sizeof("charset"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - tmp_param = mail_newbody_parameter(); - tmp_param->value = cpystr(Z_STRVAL_PP(pvalue)); - tmp_param->attribute = cpystr("CHARSET"); - tmp_param->next = bod->parameter; - bod->parameter = tmp_param; - } - if (zend_hash_find(Z_ARRVAL_PP(data), "type.parameters", sizeof("type.parameters"), (void **) &pvalue)== SUCCESS) { - if(Z_TYPE_PP(pvalue) == IS_ARRAY) { - disp_param = tmp_param = NULL; - while (zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) &disp_data) == SUCCESS) { - disp_param = mail_newbody_parameter(); - zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), &key, &ind, 0); - disp_param->attribute = cpystr(key); - convert_to_string_ex(disp_data); - disp_param->value = (char *) fs_get(Z_STRLEN_PP(disp_data) + 1); - memcpy(disp_param->value, Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1); - zend_hash_move_forward(Z_ARRVAL_PP(pvalue)); - disp_param->next = tmp_param; - tmp_param = disp_param; - } - bod->parameter = disp_param; - } - } - if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->subtype = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "id", sizeof("id"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->id = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "description", sizeof("description"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->description = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "disposition.type", sizeof("disposition.type"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->disposition.type = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); - memcpy(bod->disposition.type, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue)+1); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "disposition", sizeof("disposition"), (void **) &pvalue)== SUCCESS) { - if (Z_TYPE_PP(pvalue) == IS_ARRAY) { - disp_param = tmp_param = NULL; - while (zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) &disp_data) == SUCCESS) { - disp_param = mail_newbody_parameter(); - zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), &key, &ind, 0); - disp_param->attribute = cpystr(key); - convert_to_string_ex(disp_data); - disp_param->value = (char *) fs_get(Z_STRLEN_PP(disp_data) + 1); - memcpy(disp_param->value, Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1); - zend_hash_move_forward(Z_ARRVAL_PP(pvalue)); - disp_param->next = tmp_param; - tmp_param = disp_param; - } - bod->disposition.parameter = disp_param; - } - } - if (zend_hash_find(Z_ARRVAL_PP(data), "contents.data", sizeof("contents.data"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->contents.text.data = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); - memcpy(bod->contents.text.data, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue)+1); - bod->contents.text.size = Z_STRLEN_PP(pvalue); - } else { - bod->contents.text.data = (char *) fs_get(1); - memcpy(bod->contents.text.data, "", 1); - bod->contents.text.size = 0; - } - if (zend_hash_find(Z_ARRVAL_PP(data), "lines", sizeof("lines"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->size.lines = Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "bytes", sizeof("bytes"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->size.bytes = Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "md5", sizeof("md5"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->md5 = cpystr(Z_STRVAL_PP(pvalue)); - } - } - - zend_hash_move_forward(Z_ARRVAL_PP(body)); - - while (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data) == SUCCESS) { - zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind, 0); /* FIXME: Is this necessary? We're not using key/ind */ - if (Z_TYPE_PP(data) == IS_ARRAY) { - if (!toppart) { - bod->nested.part = mail_newbody_part(); - mypart = bod->nested.part; - toppart = mypart; - bod=&mypart->body; - } else { - mypart->next = mail_newbody_part(); - mypart = mypart->next; - bod = &mypart->body; - } - - if (zend_hash_find(Z_ARRVAL_PP(data), "type", sizeof("type"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->type = (short) Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "encoding", sizeof("encoding"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->encoding = (short) Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "charset", sizeof("charset"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - tmp_param = mail_newbody_parameter(); - tmp_param->value = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); - memcpy(tmp_param->value, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue) + 1); - tmp_param->attribute = cpystr("CHARSET"); - tmp_param->next = bod->parameter; - bod->parameter = tmp_param; - } - if (zend_hash_find(Z_ARRVAL_PP(data), "type.parameters", sizeof("type.parameters"), (void **) &pvalue)== SUCCESS) { - if(Z_TYPE_PP(pvalue) == IS_ARRAY) { - disp_param = tmp_param = NULL; - while (zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) &disp_data) == SUCCESS) { - disp_param = mail_newbody_parameter(); - zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), &key, &ind, 0); - disp_param->attribute = cpystr(key); - convert_to_string_ex(disp_data); - disp_param->value = (char *) fs_get(Z_STRLEN_PP(disp_data) + 1); - memcpy(disp_param->value, Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1); - zend_hash_move_forward(Z_ARRVAL_PP(pvalue)); - disp_param->next = tmp_param; - tmp_param = disp_param; - } - bod->parameter = disp_param; - } - } - if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->subtype = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "id", sizeof("id"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->id = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "description", sizeof("description"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->description = cpystr(Z_STRVAL_PP(pvalue)); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "disposition.type", sizeof("disposition.type"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->disposition.type = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); - memcpy(bod->disposition.type, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue)+1); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "disposition", sizeof("disposition"), (void **) &pvalue)== SUCCESS) { - if (Z_TYPE_PP(pvalue) == IS_ARRAY) { - disp_param = tmp_param = NULL; - while (zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) &disp_data) == SUCCESS) { - disp_param = mail_newbody_parameter(); - zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), &key, &ind, 0); - disp_param->attribute = cpystr(key); - convert_to_string_ex(disp_data); - disp_param->value = (char *) fs_get(Z_STRLEN_PP(disp_data) + 1); - memcpy(disp_param->value, Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1); - zend_hash_move_forward(Z_ARRVAL_PP(pvalue)); - disp_param->next = tmp_param; - tmp_param = disp_param; - } - bod->disposition.parameter = disp_param; - } - } - if (zend_hash_find(Z_ARRVAL_PP(data), "contents.data", sizeof("contents.data"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->contents.text.data = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); - memcpy(bod->contents.text.data, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue) + 1); - bod->contents.text.size = Z_STRLEN_PP(pvalue); - } else { - bod->contents.text.data = (char *) fs_get(1); - memcpy(bod->contents.text.data, "", 1); - bod->contents.text.size = 0; - } - if (zend_hash_find(Z_ARRVAL_PP(data), "lines", sizeof("lines"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->size.lines = Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "bytes", sizeof("bytes"), (void **) &pvalue)== SUCCESS) { - convert_to_long_ex(pvalue); - bod->size.bytes = Z_LVAL_PP(pvalue); - } - if (zend_hash_find(Z_ARRVAL_PP(data), "md5", sizeof("md5"), (void **) &pvalue)== SUCCESS) { - convert_to_string_ex(pvalue); - bod->md5 = cpystr(Z_STRVAL_PP(pvalue)); - } - } - zend_hash_move_forward(Z_ARRVAL_PP(body)); - } - - if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot generate multipart e-mail without components."); - RETVAL_FALSE; - goto done; - } - - if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot generate multipart e-mail without components."); - RETVAL_FALSE; - goto done; - } - - rfc822_encode_body_7bit(env, topbod); - rfc822_header (tmp, env, topbod); - - /* add custom envelope headers */ - if (custom_headers_param) { - int l = strlen(tmp) - 2, l2; - PARAMETER *tp = custom_headers_param; - - /* remove last CRLF from tmp */ - tmp[l] = '\0'; - tempstring = emalloc(l); - memcpy(tempstring, tmp, l); - - do { - l2 = strlen(custom_headers_param->value); - tempstring = erealloc(tempstring, l + l2 + CRLF_LEN + 1); - memcpy(tempstring + l, custom_headers_param->value, l2); - memcpy(tempstring + l + l2, CRLF, CRLF_LEN); - l += l2 + CRLF_LEN; - } while ((custom_headers_param = custom_headers_param->next)); - - mail_free_body_parameter(&tp); - - mystring = emalloc(l + CRLF_LEN + 1); - memcpy(mystring, tempstring, l); - memcpy(mystring + l , CRLF, CRLF_LEN); - mystring[l + CRLF_LEN] = '\0'; - - efree(tempstring); - } else { - mystring = estrdup(tmp); - } - - bod = topbod; - - if (bod && bod->type == TYPEMULTIPART) { - - /* first body part */ - part = bod->nested.part; - - /* find cookie */ - for (param = bod->parameter; param && !cookie; param = param->next) { - if (!strcmp (param->attribute, "BOUNDARY")) { - cookie = param->value; - } - } - - /* yucky default */ - if (!cookie) { - cookie = "-"; - } - - /* for each part */ - do { - t=tmp; - /* build cookie */ - sprintf (t, "--%s%s", cookie, CRLF); - - /* append mini-header */ - rfc822_write_body_header(&t, &part->body); - - /* write terminating blank line */ - strcat (t, CRLF); - - /* output cookie, mini-header, and contents */ - tempstring=emalloc(strlen(mystring)+strlen(tmp)+1); - sprintf(tempstring, "%s%s", mystring, tmp); - efree(mystring); - mystring=tempstring; - - bod=&part->body; - - tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1); - sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF); - efree(mystring); - mystring=tempstring; - } while ((part = part->next)); /* until done */ - - /* output trailing cookie */ - sprintf(tmp, "--%s--", cookie); - tempstring=emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1); - sprintf(tempstring, "%s%s%s", mystring, tmp, CRLF); - efree(mystring); - mystring=tempstring; - } else if (bod) { - tempstring = emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1); - sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF); - efree(mystring); - mystring=tempstring; - } else { - efree(mystring); - RETVAL_FALSE; - goto done; - } - - RETVAL_STRING(tempstring, 0); -done: - mail_free_body(&topbod); - mail_free_envelope(&env); -} -/* }}} */ - - -/* {{{ _php_imap_mail - */ -int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath TSRMLS_DC) -{ -#ifdef PHP_WIN32 - int tsm_err; -#else - FILE *sendmail; - int ret; -#endif - -#ifdef PHP_WIN32 - char *tempMailTo; - char *tsm_errmsg = NULL; - ADDRESS *addr; - char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL, *bufferHeader = NULL; - int offset, bufferLen = 0;; - - if (headers) { - bufferLen += strlen(headers); - } - if (to) { - bufferLen += strlen(to) + 6; - } - if (cc) { - bufferLen += strlen(cc) + 6; - } - -#define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) efree(bufferCc); if (bufferBcc) efree(bufferBcc); if (bufferHeader) efree(bufferHeader); -#define PHP_IMAP_BAD_DEST PHP_IMAP_CLEAN; efree(tempMailTo); return (BAD_MSG_DESTINATION); - - bufferHeader = (char *)emalloc(bufferLen); - memset(bufferHeader, 0, bufferLen); - if (to && *to) { - strcat(bufferHeader, "To: "); - strcat(bufferHeader, to); - strcat(bufferHeader, "\r\n"); - tempMailTo = estrdup(to); - bufferTo = (char *)emalloc(strlen(to)); - offset = 0; - addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); - while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { - PHP_IMAP_BAD_DEST; - } else { - offset += sprintf(bufferTo + offset, "%s@%s,", addr->mailbox, addr->host); - } - addr = addr->next; - } - efree(tempMailTo); - if (offset>0) { - bufferTo[offset-1] = 0; - } - } - - if (cc && *cc) { - strcat(bufferHeader, "Cc: "); - strcat(bufferHeader, cc); - strcat(bufferHeader, "\r\n"); - tempMailTo = estrdup(cc); - bufferCc = (char *)emalloc(strlen(cc)); - offset = 0; - addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); - while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { - PHP_IMAP_BAD_DEST; - } else { - offset += sprintf(bufferCc + offset, "%s@%s,", addr->mailbox, addr->host); - } - addr = addr->next; - } - efree(tempMailTo); - if (offset>0) { - bufferCc[offset-1] = 0; - } - } - - if (bcc && *bcc) { - tempMailTo = estrdup(bcc); - bufferBcc = (char *)emalloc(strlen(bcc)); - offset = 0; - addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); - while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { - PHP_IMAP_BAD_DEST; - } else { - offset += sprintf(bufferBcc + offset, "%s@%s,", addr->mailbox, addr->host); - } - addr = addr->next; - } - efree(tempMailTo); - if (offset>0) { - bufferBcc[offset-1] = 0; - } - } - - if (headers && *headers) { - strcat(bufferHeader, headers); - } - - if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) { - if (tsm_errmsg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg); - efree(tsm_errmsg); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err)); - } - PHP_IMAP_CLEAN; - return 0; - } - PHP_IMAP_CLEAN; -#else - if (!INI_STR("sendmail_path")) { - return 0; - } - sendmail = popen(INI_STR("sendmail_path"), "w"); - if (sendmail) { - if (rpath && rpath[0]) fprintf(sendmail, "From: %s\n", rpath); - fprintf(sendmail, "To: %s\n", to); - if (cc && cc[0]) fprintf(sendmail, "Cc: %s\n", cc); - if (bcc && bcc[0]) fprintf(sendmail, "Bcc: %s\n", bcc); - fprintf(sendmail, "Subject: %s\n", subject); - if (headers != NULL) { - fprintf(sendmail, "%s\n", headers); - } - fprintf(sendmail, "\n%s\n", message); - ret = pclose(sendmail); - if (ret == -1) { - return 0; - } else { - return 1; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program"); - return 0; - } -#endif - return 1; -} -/* }}} */ - -/* {{{ proto bool imap_mail(string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]]) - Send an email message */ -PHP_FUNCTION(imap_mail) -{ - zval **argv[7]; - char *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *cc=NULL, *bcc=NULL, *rpath=NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 3 || argc > 7 || zend_get_parameters_array_ex(argc, argv) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - /* To: */ - convert_to_string_ex(argv[0]); - if (Z_STRVAL_PP(argv[0])) { - to = Z_STRVAL_PP(argv[0]); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No to field in mail command"); - RETURN_FALSE; - } - - /* Subject: */ - convert_to_string_ex(argv[1]); - if (Z_STRVAL_PP(argv[1])) { - subject = Z_STRVAL_PP(argv[1]); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No subject field in mail command"); - RETURN_FALSE; - } - - /* message body */ - convert_to_string_ex(argv[2]); - if (Z_STRVAL_PP(argv[2])) { - message = Z_STRVAL_PP(argv[2]); - } else { - /* this is not really an error, so it is allowed. */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message string in mail command"); - message = NULL; - } - - /* other headers */ - if (argc > 3) { - convert_to_string_ex(argv[3]); - headers = Z_STRVAL_PP(argv[3]); - } - - /* cc */ - if (argc > 4) { - convert_to_string_ex(argv[4]); - cc = Z_STRVAL_PP(argv[4]); - } - - /* bcc */ - if (argc > 5) { - convert_to_string_ex(argv[5]); - bcc = Z_STRVAL_PP(argv[5]); - } - - /* rpath */ - if (argc > 6) { - convert_to_string_ex(argv[6]); - rpath = Z_STRVAL_PP(argv[6]); - } - - if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array imap_search(resource stream_id, string criteria [, int options [, string charset]]) - Return a list of messages matching the given criteria */ -PHP_FUNCTION(imap_search) -{ - zval **streamind, **criteria, **search_flags, **charset; - pils *imap_le_struct; - long flags; - char *search_criteria; - MESSAGELIST *cur; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 4 || zend_get_parameters_ex(argc, &streamind, &criteria, &search_flags, &charset) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - convert_to_string_ex(criteria); - search_criteria = estrndup(Z_STRVAL_PP(criteria), Z_STRLEN_PP(criteria)); - - if (argc == 2) { - flags = SE_FREE; - } else { - convert_to_long_ex(search_flags); - flags = Z_LVAL_PP(search_flags); - if (argc == 4) { - convert_to_string_ex(charset); - } - } - - IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL; - mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? Z_STRVAL_PP(charset) : NIL), mail_criteria(search_criteria), flags); - if (IMAPG(imap_messages) == NIL) { - efree(search_criteria); - RETURN_FALSE; - } - - array_init(return_value); - - cur = IMAPG(imap_messages); - while (cur != NIL) { - add_next_index_long(return_value, cur->msgid); - cur = cur->next; - } - mail_free_messagelist(&IMAPG(imap_messages), &IMAPG(imap_messages_tail)); - efree(search_criteria); -} -/* }}} */ - -/* {{{ proto array imap_alerts(void) - Returns an array of all IMAP alerts that have been generated since the last page load or since the last imap_alerts() call, whichever came last. The alert stack is cleared after imap_alerts() is called. */ -/* Author: CJH */ -PHP_FUNCTION(imap_alerts) -{ - STRINGLIST *cur=NIL; - - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (IMAPG(imap_alertstack) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - - cur = IMAPG(imap_alertstack); - while (cur != NIL) { - add_next_index_string(return_value, cur->LTEXT, 1); - cur = cur->next; - } - mail_free_stringlist(&IMAPG(imap_alertstack)); - IMAPG(imap_alertstack) = NIL; -} -/* }}} */ - -/* {{{ proto array imap_errors(void) - Returns an array of all IMAP errors generated since the last page load, or since the last imap_errors() call, whichever came last. The error stack is cleared after imap_errors() is called. */ -/* Author: CJH */ -PHP_FUNCTION(imap_errors) -{ - ERRORLIST *cur=NIL; - - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (IMAPG(imap_errorstack) == NIL) { - RETURN_FALSE; - } - - array_init(return_value); - - cur = IMAPG(imap_errorstack); - while (cur != NIL) { - add_next_index_string(return_value, cur->LTEXT, 1); - cur = cur->next; - } - mail_free_errorlist(&IMAPG(imap_errorstack)); - IMAPG(imap_errorstack) = NIL; -} -/* }}} */ - -/* {{{ proto string imap_last_error(void) - Returns the last error that was generated by an IMAP function. The error stack is NOT cleared after this call. */ -/* Author: CJH */ -PHP_FUNCTION(imap_last_error) -{ - ERRORLIST *cur=NIL; - - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (IMAPG(imap_errorstack) == NIL) { - RETURN_FALSE; - } - - cur = IMAPG(imap_errorstack); - while (cur != NIL) { - if (cur->next == NIL) { - RETURN_STRING(cur->LTEXT, 1); - } - cur = cur->next; - } -} -/* }}} */ - -/* {{{ proto array imap_mime_header_decode(string str) - Decode mime header element in accordance with RFC 2047 and return array of objects containing 'charset' encoding and decoded 'text' */ -PHP_FUNCTION(imap_mime_header_decode) -{ - /* Author: Ted Parnefors */ - zval **str, *myobject; - char *string, *charset, encoding, *text, *decode; - long charset_token, encoding_token, end_token, end, offset=0, i; - unsigned long newlength; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(str); - - array_init(return_value); - - string = Z_STRVAL_PP(str); - end = Z_STRLEN_PP(str); - - charset = (char *) safe_emalloc((end + 1), 2, 0); - text = &charset[end + 1]; - while (offset < end) { /* Reached end of the string? */ - if ((charset_token = (long)php_memnstr(&string[offset], "=?", 2, string + end))) { /* Is there anything encoded in the string? */ - charset_token -= (long)string; - if (offset != charset_token) { /* Is there anything before the encoded data? */ - /* Retrieve unencoded data that is found before encoded data */ - memcpy(text, &string[offset], charset_token-offset); - text[charset_token - offset] = 0x00; - MAKE_STD_ZVAL(myobject); - object_init(myobject); - add_property_string(myobject, "charset", "default", 1); - add_property_string(myobject, "text", text, 1); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)&myobject, sizeof(zval *), NULL); - } - if ((encoding_token = (long)php_memnstr(&string[charset_token+2], "?", 1, string+end))) { /* Find token for encoding */ - encoding_token -= (long)string; - if ((end_token = (long)php_memnstr(&string[encoding_token+3], "?=", 2, string+end))) { /* Find token for end of encoded data */ - end_token -= (long)string; - memcpy(charset, &string[charset_token + 2], encoding_token - (charset_token + 2)); /* Extract charset encoding */ - charset[encoding_token-(charset_token + 2)] = 0x00; - encoding=string[encoding_token + 1]; /* Extract encoding from string */ - memcpy(text, &string[encoding_token + 3], end_token - (encoding_token + 3)); /* Extract text */ - text[end_token - (encoding_token + 3)] = 0x00; - decode = text; - if (encoding == 'q' || encoding == 'Q') { /* Decode 'q' encoded data */ - for(i=0; text[i] != 0x00; i++) if (text[i] == '_') text[i] = ' '; /* Replace all *_' with space. */ - decode = (char *)rfc822_qprint((unsigned char *) text, strlen(text), &newlength); - } else if (encoding == 'b' || encoding == 'B') { - decode = (char *)rfc822_base64((unsigned char *) text, strlen(text), &newlength); /* Decode 'B' encoded data */ - } - if (decode == NULL) { - efree(charset); - zval_dtor(return_value); - RETURN_FALSE; - } - MAKE_STD_ZVAL(myobject); - object_init(myobject); - add_property_string(myobject, "charset", charset, 1); - add_property_string(myobject, "text", decode, 1); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)&myobject, sizeof(zval *), NULL); - - /* only free decode if it was allocated by rfc822_qprint or rfc822_base64 */ - if (decode != text) { - fs_give((void**)&decode); - } - - offset = end_token+2; - for (i = 0; (string[offset + i] == ' ') || (string[offset + i] == 0x0a) || (string[offset + i] == 0x0d); i++); - if ((string[offset + i] == '=') && (string[offset + i + 1] == '?') && (offset + i < end)) { - offset += i; - } - continue; /*/ Iterate the loop again please. */ - } - } - } else { - /* Just some tweaking to optimize the code, and get the end statements work in a general manner. - * If we end up here we didn't find a position for "charset_token", - * so we need to set it to the start of the yet unextracted data. - */ - charset_token = offset; - } - /* Return the rest of the data as unencoded, as it was either unencoded or was missing separators - which rendered the the remainder of the string impossible for us to decode. */ - memcpy(text, &string[charset_token], end - charset_token); /* Extract unencoded text from string */ - text[end - charset_token] = 0x00; - MAKE_STD_ZVAL(myobject); - object_init(myobject); - add_property_string(myobject, "charset", "default", 1); - add_property_string(myobject, "text", text, 1); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)&myobject, sizeof(zval *), NULL); - - offset = end; /* We have reached the end of the string. */ - } - efree(charset); -} -/* }}} */ - -/* {{{ _php_rfc822_len - * Calculate string length based on imap's rfc822_cat function. - */ -static int _php_rfc822_len(char *str) -{ - int len; - char *p; - - if (!str || !*str) { - return 0; - } - - /* strings with special characters will need to be quoted, as a safety measure we - * add 2 bytes for the quotes just in case. - */ - len = strlen(str) + 2; - p = str; - /* rfc822_cat() will escape all " and \ characters, therefor we need to increase - * our buffer length to account for these characters. - */ - while ((p = strpbrk(p, "\\\""))) { - p++; - len++; - } - - return len; -} -/* }}} */ - -/* Support Functions */ -/* {{{ _php_imap_get_address_size - */ -static int _php_imap_address_size (ADDRESS *addresslist) -{ - ADDRESS *tmp; - int ret=0, num_ent=0; - - tmp = addresslist; - - if (tmp) do { - ret += _php_rfc822_len(tmp->personal); - ret += _php_rfc822_len(tmp->adl); - ret += _php_rfc822_len(tmp->mailbox); - ret += _php_rfc822_len(tmp->host); - num_ent++; - } while ((tmp = tmp->next)); - - /* - * rfc822_write_address_full() needs some extra space for '<>,', etc. - * for this perpouse we allocate additional PHP_IMAP_ADDRESS_SIZE_BUF bytes - * by default this buffer is 10 bytes long - */ - ret += (ret) ? num_ent*PHP_IMAP_ADDRESS_SIZE_BUF : 0; - - return ret; -} - -/* }}} */ - - -/* {{{ _php_imap_parse_address - */ -static void _php_imap_parse_address (ADDRESS *addresslist, char **fulladdress, zval *paddress TSRMLS_DC) -{ - ADDRESS *addresstmp; - zval *tmpvals; - char *tmpstr; - int len=0; - - addresstmp = addresslist; - - if ((len = _php_imap_address_size(addresstmp))) { - tmpstr = (char *) malloc(len + 1); - tmpstr[0] = '\0'; - rfc822_write_address(tmpstr, addresstmp); - *fulladdress = tmpstr; - } else { - *fulladdress = NULL; - } - - addresstmp = addresslist; - do { - MAKE_STD_ZVAL(tmpvals); - object_init(tmpvals); - if (addresstmp->personal) add_property_string(tmpvals, "personal", addresstmp->personal, 1); - if (addresstmp->adl) add_property_string(tmpvals, "adl", addresstmp->adl, 1); - if (addresstmp->mailbox) add_property_string(tmpvals, "mailbox", addresstmp->mailbox, 1); - if (addresstmp->host) add_property_string(tmpvals, "host", addresstmp->host, 1); - add_next_index_object(paddress, tmpvals TSRMLS_CC); - } while ((addresstmp = addresstmp->next)); -} -/* }}} */ - -/* {{{ _php_make_header_object - */ -static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC) -{ - zval *paddress; - char *fulladdress=NULL; - - object_init(myzvalue); - - if (en->remail) add_property_string(myzvalue, "remail", en->remail, 1); - if (en->date) add_property_string(myzvalue, "date", en->date, 1); - if (en->date) add_property_string(myzvalue, "Date", en->date, 1); - if (en->subject) add_property_string(myzvalue, "subject", en->subject, 1); - if (en->subject) add_property_string(myzvalue, "Subject", en->subject, 1); - if (en->in_reply_to) add_property_string(myzvalue, "in_reply_to", en->in_reply_to, 1); - if (en->message_id) add_property_string(myzvalue, "message_id", en->message_id, 1); - if (en->newsgroups) add_property_string(myzvalue, "newsgroups", en->newsgroups, 1); - if (en->followup_to) add_property_string(myzvalue, "followup_to", en->followup_to, 1); - if (en->references) add_property_string(myzvalue, "references", en->references, 1); - - if (en->to) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->to, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "toaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "to", paddress TSRMLS_CC); - } - - if (en->from) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->from, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "fromaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "from", paddress TSRMLS_CC); - } - - if (en->cc) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->cc, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "ccaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "cc", paddress TSRMLS_CC); - } - - if (en->bcc) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->bcc, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "bccaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "bcc", paddress TSRMLS_CC); - } - - if (en->reply_to) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->reply_to, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "reply_toaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "reply_to", paddress TSRMLS_CC); - } - - if (en->sender) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->sender, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "senderaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "sender", paddress TSRMLS_CC); - } - - if (en->return_path) { - MAKE_STD_ZVAL(paddress); - array_init(paddress); - _php_imap_parse_address(en->return_path, &fulladdress, paddress TSRMLS_CC); - if (fulladdress) { - add_property_string(myzvalue, "return_pathaddress", fulladdress, 1); - free(fulladdress); - } - add_assoc_object(myzvalue, "return_path", paddress TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ _php_imap_add_body - */ -void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC) -{ - zval *parametres, *param, *dparametres, *dparam; - PARAMETER *par, *dpar; - PART *part; - - if (body->type <= TYPEMAX) { - add_property_long(arg, "type", body->type); - } - - if (body->encoding <= ENCMAX) { - add_property_long(arg, "encoding", body->encoding); - } - - if (body->subtype) { - add_property_long(arg, "ifsubtype", 1); - add_property_string(arg, "subtype", body->subtype, 1); - } else { - add_property_long(arg, "ifsubtype", 0); - } - - if (body->description) { - add_property_long(arg, "ifdescription", 1); - add_property_string(arg, "description", body->description, 1); - } else { - add_property_long(arg, "ifdescription", 0); - } - - if (body->id) { - add_property_long(arg, "ifid", 1); - add_property_string(arg, "id", body->id, 1); - } else { - add_property_long(arg, "ifid", 0); - } - - if (body->size.lines) { - add_property_long(arg, "lines", body->size.lines); - } - - if (body->size.bytes) { - add_property_long(arg, "bytes", body->size.bytes); - } - -#ifdef IMAP41 - if (body->disposition.type) { - add_property_long(arg, "ifdisposition", 1); - add_property_string(arg, "disposition", body->disposition.type, 1); - } else { - add_property_long(arg, "ifdisposition", 0); - } - - if (body->disposition.parameter) { - dpar = body->disposition.parameter; - add_property_long(arg, "ifdparameters", 1); - MAKE_STD_ZVAL(dparametres); - array_init(dparametres); - do { - MAKE_STD_ZVAL(dparam); - object_init(dparam); - add_property_string(dparam, "attribute", dpar->attribute, 1); - add_property_string(dparam, "value", dpar->value, 1); - add_next_index_object(dparametres, dparam TSRMLS_CC); - } while ((dpar = dpar->next)); - add_assoc_object(arg, "dparameters", dparametres TSRMLS_CC); - } else { - add_property_long(arg, "ifdparameters", 0); - } -#endif - - if ((par = body->parameter)) { - add_property_long(arg, "ifparameters", 1); - - MAKE_STD_ZVAL(parametres); - array_init(parametres); - do { - MAKE_STD_ZVAL(param); - object_init(param); - if (par->attribute) { - add_property_string(param, "attribute", par->attribute, 1); - } - if (par->value) { - add_property_string(param, "value", par->value, 1); - } - - add_next_index_object(parametres, param TSRMLS_CC); - } while ((par = par->next)); - } else { - MAKE_STD_ZVAL(parametres); - object_init(parametres); - add_property_long(arg, "ifparameters", 0); - } - add_assoc_object(arg, "parameters", parametres TSRMLS_CC); - - /* multipart message ? */ - if (body->type == TYPEMULTIPART) { - MAKE_STD_ZVAL(parametres); - array_init(parametres); - for (part = body->CONTENT_PART; part; part = part->next) { - MAKE_STD_ZVAL(param); - object_init(param); - _php_imap_add_body(param, &part->body TSRMLS_CC); - add_next_index_object(parametres, param TSRMLS_CC); - } - add_assoc_object(arg, "parts", parametres TSRMLS_CC); - } - - /* encapsulated message ? */ - if ((body->type == TYPEMESSAGE) && (!strcasecmp(body->subtype, "rfc822"))) { - body = body->CONTENT_MSG_BODY; - MAKE_STD_ZVAL(parametres); - array_init(parametres); - MAKE_STD_ZVAL(param); - object_init(param); - _php_imap_add_body(param, body TSRMLS_CC); - add_next_index_object(parametres, param TSRMLS_CC); - add_assoc_object(arg, "parts", parametres TSRMLS_CC); - } -} -/* }}} */ - - -/* imap_thread, stealing this from header cclient -rjs3 */ -/* {{{ build_thread_tree_helper - */ -static void build_thread_tree_helper(THREADNODE *cur, zval *tree, long *numNodes, char *buf) -{ - unsigned long thisNode = *numNodes; - - /* define "#.num" */ - snprintf(buf, 25, "%ld.num", thisNode); - - add_assoc_long(tree, buf, cur->num); - - snprintf(buf, 25, "%ld.next", thisNode); - if(cur->next) { - (*numNodes)++; - add_assoc_long(tree, buf, *numNodes); - build_thread_tree_helper(cur->next, tree, numNodes, buf); - } else { /* "null pointer" */ - add_assoc_long(tree, buf, 0); - } - - snprintf(buf, 25, "%ld.branch", thisNode); - if(cur->branch) { - (*numNodes)++; - add_assoc_long(tree, buf, *numNodes); - build_thread_tree_helper(cur->branch, tree, numNodes, buf); - } else { /* "null pointer" */ - add_assoc_long(tree, buf, 0); - } -} -/* }}} */ - -/* {{{ build_thread_tree - */ -static int build_thread_tree(THREADNODE *top, zval **tree) -{ - long numNodes = 0; - char buf[25]; - - array_init(*tree); - - build_thread_tree_helper(top, *tree, &numNodes, buf); - - return SUCCESS; -} -/* }}} */ - -/* {{{ proto array imap_thread(resource stream_id [, int options]) - Return threaded by REFERENCES tree */ -PHP_FUNCTION(imap_thread) -{ - zval **streamind, **search_flags; - pils *imap_le_struct; - long flags; - char criteria[] = "ALL"; - THREADNODE *top; - int argc = ZEND_NUM_ARGS(); - - if ( argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &streamind, &search_flags) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); - - if (argc == 1) { - flags = SE_FREE; - } else { - convert_to_long_ex(search_flags); - flags = Z_LVAL_PP(search_flags); - } - - top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, mail_criteria(criteria), flags); - - if(top == NIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function returned an empty tree"); - RETURN_FALSE; - } - - /* Populate our return value data structure here. */ - if(build_thread_tree(top, &return_value) == FAILURE) { - mail_free_threadnode(&top); - RETURN_FALSE; - } - mail_free_threadnode(&top); -} -/* }}} */ - -/* {{{ proto mixed imap_timeout(int timeout_type [, int timeout]) - Set or fetch imap timeout */ -PHP_FUNCTION(imap_timeout) -{ - long ttype, timeout=-1; - int timeout_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &ttype, &timeout) == FAILURE) { - RETURN_FALSE; - } - - if (timeout == -1) { - switch (ttype) { - case 1: - timeout_type = GET_OPENTIMEOUT; - break; - case 2: - timeout_type = GET_READTIMEOUT; - break; - case 3: - timeout_type = GET_WRITETIMEOUT; - break; - case 4: - timeout_type = GET_CLOSETIMEOUT; - break; - default: - RETURN_FALSE; - break; - } - - timeout = (long) mail_parameters(NIL, timeout_type, NIL); - RETURN_LONG(timeout); - } else if (timeout >= 0) { - switch (ttype) { - case 1: - timeout_type = SET_OPENTIMEOUT; - break; - case 2: - timeout_type = SET_READTIMEOUT; - break; - case 3: - timeout_type = SET_WRITETIMEOUT; - break; - case 4: - timeout_type = SET_CLOSETIMEOUT; - break; - default: - RETURN_FALSE; - break; - } - - timeout = (long) mail_parameters(NIL, timeout_type, (void *) timeout); - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Interfaces to C-client - */ -void mm_searched(MAILSTREAM *stream, unsigned long number) -{ - MESSAGELIST *cur = NIL; - TSRMLS_FETCH(); - - if (IMAPG(imap_messages) == NIL) { - IMAPG(imap_messages) = mail_newmessagelist(); - IMAPG(imap_messages)->msgid = number; - IMAPG(imap_messages)->next = NIL; - IMAPG(imap_messages_tail) = IMAPG(imap_messages); - } else { - cur = IMAPG(imap_messages_tail); - cur->next = mail_newmessagelist(); - cur = cur->next; - cur->msgid = number; - cur->next = NIL; - IMAPG(imap_messages_tail) = cur; - } -} - -void mm_exists(MAILSTREAM *stream, unsigned long number) -{ -} - -void mm_expunged(MAILSTREAM *stream, unsigned long number) -{ -} - -void mm_flags(MAILSTREAM *stream, unsigned long number) -{ -} - -/* Author: CJH */ -void mm_notify(MAILSTREAM *stream, char *str, long errflg) -{ - STRINGLIST *cur = NIL; - TSRMLS_FETCH(); - - if (strncmp(str, "[ALERT] ", 8) == 0) { - if (IMAPG(imap_alertstack) == NIL) { - IMAPG(imap_alertstack) = mail_newstringlist(); - IMAPG(imap_alertstack)->LSIZE = strlen(IMAPG(imap_alertstack)->LTEXT = cpystr(str)); - IMAPG(imap_alertstack)->next = NIL; - } else { - cur = IMAPG(imap_alertstack); - while (cur->next != NIL) { - cur = cur->next; - } - cur->next = mail_newstringlist (); - cur = cur->next; - cur->LSIZE = strlen(cur->LTEXT = cpystr(str)); - cur->next = NIL; - } - } -} - -void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) -{ - STRINGLIST *cur=NIL; - FOBJECTLIST *ocur=NIL; - TSRMLS_FETCH(); - - if (IMAPG(folderlist_style) == FLIST_OBJECT) { - /* build up a the new array of objects */ - /* Author: CJH */ - if (IMAPG(imap_folder_objects) == NIL) { - IMAPG(imap_folder_objects) = mail_newfolderobjectlist(); - IMAPG(imap_folder_objects)->LSIZE=strlen(IMAPG(imap_folder_objects)->LTEXT=cpystr(mailbox)); - IMAPG(imap_folder_objects)->delimiter = delimiter; - IMAPG(imap_folder_objects)->attributes = attributes; - IMAPG(imap_folder_objects)->next = NIL; - IMAPG(imap_folder_objects_tail) = IMAPG(imap_folder_objects); - } else { - ocur=IMAPG(imap_folder_objects_tail); - ocur->next=mail_newfolderobjectlist(); - ocur=ocur->next; - ocur->LSIZE = strlen(ocur->LTEXT = cpystr(mailbox)); - ocur->delimiter = delimiter; - ocur->attributes = attributes; - ocur->next = NIL; - IMAPG(imap_folder_objects_tail) = ocur; - } - - } else { - /* build the old IMAPG(imap_folders) variable to allow old imap_listmailbox() to work */ - if (!(attributes & LATT_NOSELECT)) { - if (IMAPG(imap_folders) == NIL) { - IMAPG(imap_folders)=mail_newstringlist(); - IMAPG(imap_folders)->LSIZE=strlen(IMAPG(imap_folders)->LTEXT=cpystr(mailbox)); - IMAPG(imap_folders)->next=NIL; - IMAPG(imap_folders_tail) = IMAPG(imap_folders); - } else { - cur=IMAPG(imap_folders_tail); - cur->next=mail_newstringlist (); - cur=cur->next; - cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); - cur->next = NIL; - IMAPG(imap_folders_tail) = cur; - } - } - } -} - -void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) -{ - STRINGLIST *cur=NIL; - FOBJECTLIST *ocur=NIL; - TSRMLS_FETCH(); - - if (IMAPG(folderlist_style) == FLIST_OBJECT) { - /* build the array of objects */ - /* Author: CJH */ - if (IMAPG(imap_sfolder_objects) == NIL) { - IMAPG(imap_sfolder_objects) = mail_newfolderobjectlist(); - IMAPG(imap_sfolder_objects)->LSIZE=strlen(IMAPG(imap_sfolder_objects)->LTEXT=cpystr(mailbox)); - IMAPG(imap_sfolder_objects)->delimiter = delimiter; - IMAPG(imap_sfolder_objects)->attributes = attributes; - IMAPG(imap_sfolder_objects)->next = NIL; - IMAPG(imap_sfolder_objects_tail) = IMAPG(imap_sfolder_objects); - } else { - ocur=IMAPG(imap_sfolder_objects_tail); - ocur->next=mail_newfolderobjectlist(); - ocur=ocur->next; - ocur->LSIZE=strlen(ocur->LTEXT = cpystr(mailbox)); - ocur->delimiter = delimiter; - ocur->attributes = attributes; - ocur->next = NIL; - IMAPG(imap_sfolder_objects_tail) = ocur; - } - } else { - /* build the old simple array for imap_listsubscribed() */ - if (IMAPG(imap_sfolders) == NIL) { - IMAPG(imap_sfolders)=mail_newstringlist(); - IMAPG(imap_sfolders)->LSIZE=strlen(IMAPG(imap_sfolders)->LTEXT=cpystr(mailbox)); - IMAPG(imap_sfolders)->next=NIL; - IMAPG(imap_sfolders_tail) = IMAPG(imap_sfolders); - } else { - cur=IMAPG(imap_sfolders_tail); - cur->next=mail_newstringlist (); - cur=cur->next; - cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); - cur->next = NIL; - IMAPG(imap_sfolders_tail) = cur; - } - } -} - -void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) -{ - TSRMLS_FETCH(); - - IMAPG(status_flags)=status->flags; - if (IMAPG(status_flags) & SA_MESSAGES) { - IMAPG(status_messages)=status->messages; - } - if (IMAPG(status_flags) & SA_RECENT) { - IMAPG(status_recent)=status->recent; - } - if (IMAPG(status_flags) & SA_UNSEEN) { - IMAPG(status_unseen)=status->unseen; - } - if (IMAPG(status_flags) & SA_UIDNEXT) { - IMAPG(status_uidnext)=status->uidnext; - } - if (IMAPG(status_flags) & SA_UIDVALIDITY) { - IMAPG(status_uidvalidity)=status->uidvalidity; - } -} - -void mm_log(char *str, long errflg) -{ - ERRORLIST *cur = NIL; - TSRMLS_FETCH(); - - /* Author: CJH */ - if (errflg != NIL) { /* CJH: maybe put these into a more comprehensive log for debugging purposes? */ - if (IMAPG(imap_errorstack) == NIL) { - IMAPG(imap_errorstack) = mail_newerrorlist(); - IMAPG(imap_errorstack)->LSIZE = strlen(IMAPG(imap_errorstack)->LTEXT = cpystr(str)); - IMAPG(imap_errorstack)->errflg = errflg; - IMAPG(imap_errorstack)->next = NIL; - } else { - cur = IMAPG(imap_errorstack); - while (cur->next != NIL) { - cur = cur->next; - } - cur->next = mail_newerrorlist(); - cur = cur->next; - cur->LSIZE = strlen(cur->LTEXT = cpystr(str)); - cur->errflg = errflg; - cur->next = NIL; - } - } -} - -void mm_dlog(char *str) -{ - /* CJH: this is for debugging; it might be useful to allow setting - the stream to debug mode and capturing this somewhere - syslog? - php debugger? */ -} - -void mm_login(NETMBX *mb, char *user, char *pwd, long trial) -{ - TSRMLS_FETCH(); - - if (*mb->user) { - strlcpy (user, mb->user, MAILTMPLEN); - } else { - strlcpy (user, IMAPG(imap_user), MAILTMPLEN); - } - strlcpy (pwd, IMAPG(imap_password), MAILTMPLEN); -} - -void mm_critical(MAILSTREAM *stream) -{ -} - -void mm_nocritical(MAILSTREAM *stream) -{ -} - -long mm_diskerror(MAILSTREAM *stream, long errcode, long serious) -{ - return 1; -} - -void mm_fatal(char *str) -{ -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h deleted file mode 100644 index 91f5e95009894..0000000000000 --- a/ext/imap/php_imap.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rex Logan | - | Mark Musone | - | Brian Wang | - | Kaj-Michael Lang | - | Antoni Pamies Olive | - | Rasmus Lerdorf | - | Chuck Hagenbuch | - | Andrew Skalski | - | Hartmut Holzgraefe | - | Jani Taskinen | - | Daniel R. Kalowsky | - | PHP 4.0 updates: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_IMAP_H -#define PHP_IMAP_H - -#if HAVE_IMAP - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) - /* these are used for quota support */ -# include "c-client.h" /* includes mail.h and rfc822.h */ -# include "imap4r1.h" /* location of c-client quota functions */ -#else -# include "mail.h" -# include "rfc822.h" -#endif - -extern zend_module_entry imap_module_entry; -#define imap_module_ptr &imap_module_entry - - -/* Data types */ - -#ifdef IMAP41 -#define LSIZE text.size -#define LTEXT text.data -#define DTYPE int -#define CONTENT_PART nested.part -#define CONTENT_MSG_BODY nested.msg->body -#define IMAPVER "Imap 4R1" -#else -#define LSIZE size -#define LTEXT text -#define DTYPE char -#define CONTENT_PART contents.part -#define CONTENT_MSG_BODY contents.msg.body -#define IMAPVER "Imap 4" -#endif - - -/* Determines how mm_list() and mm_lsub() are to return their results. */ -typedef enum { - FLIST_ARRAY, - FLIST_OBJECT -} folderlist_style_t; - -typedef struct php_imap_le_struct { - MAILSTREAM *imap_stream; - long flags; -} pils; - -typedef struct php_imap_mailbox_struct { - SIZEDTEXT text; - DTYPE delimiter; - long attributes; - struct php_imap_mailbox_struct *next; -} FOBJECTLIST; - -typedef struct php_imap_error_struct { - SIZEDTEXT text; - long errflg; - struct php_imap_error_struct *next; -} ERRORLIST; - -typedef struct _php_imap_message_struct { - unsigned long msgid; - struct _php_imap_message_struct *next; -} MESSAGELIST; - - -/* Functions */ - -PHP_MINIT_FUNCTION(imap); -PHP_RINIT_FUNCTION(imap); -PHP_RSHUTDOWN_FUNCTION(imap); -PHP_MINFO_FUNCTION(imap); - -PHP_FUNCTION(imap_open); -PHP_FUNCTION(imap_popen); -PHP_FUNCTION(imap_reopen); -PHP_FUNCTION(imap_num_msg); -PHP_FUNCTION(imap_num_recent); -PHP_FUNCTION(imap_headers); -PHP_FUNCTION(imap_headerinfo); -PHP_FUNCTION(imap_rfc822_parse_headers); -PHP_FUNCTION(imap_body); -PHP_FUNCTION(imap_fetchstructure); -PHP_FUNCTION(imap_fetchbody); -PHP_FUNCTION(imap_expunge); -PHP_FUNCTION(imap_delete); -PHP_FUNCTION(imap_undelete); -PHP_FUNCTION(imap_check); -PHP_FUNCTION(imap_close); -PHP_FUNCTION(imap_mail_copy); -PHP_FUNCTION(imap_mail_move); -PHP_FUNCTION(imap_createmailbox); -PHP_FUNCTION(imap_renamemailbox); -PHP_FUNCTION(imap_deletemailbox); -PHP_FUNCTION(imap_listmailbox); -PHP_FUNCTION(imap_scanmailbox); -PHP_FUNCTION(imap_subscribe); -PHP_FUNCTION(imap_unsubscribe); -PHP_FUNCTION(imap_append); -PHP_FUNCTION(imap_ping); -PHP_FUNCTION(imap_base64); -PHP_FUNCTION(imap_qprint); -PHP_FUNCTION(imap_8bit); -PHP_FUNCTION(imap_binary); -PHP_FUNCTION(imap_mailboxmsginfo); -PHP_FUNCTION(imap_rfc822_write_address); -PHP_FUNCTION(imap_rfc822_parse_adrlist); -PHP_FUNCTION(imap_setflag_full); -PHP_FUNCTION(imap_clearflag_full); -PHP_FUNCTION(imap_sort); -PHP_FUNCTION(imap_fetchheader); -PHP_FUNCTION(imap_fetchtext); -PHP_FUNCTION(imap_uid); -PHP_FUNCTION(imap_msgno); -PHP_FUNCTION(imap_list); -PHP_FUNCTION(imap_list_full); -PHP_FUNCTION(imap_listscan); -PHP_FUNCTION(imap_lsub); -PHP_FUNCTION(imap_lsub_full); -PHP_FUNCTION(imap_create); -PHP_FUNCTION(imap_rename); -PHP_FUNCTION(imap_status); -PHP_FUNCTION(imap_bodystruct); -PHP_FUNCTION(imap_fetch_overview); -PHP_FUNCTION(imap_mail_compose); -PHP_FUNCTION(imap_alerts); -PHP_FUNCTION(imap_errors); -PHP_FUNCTION(imap_last_error); -PHP_FUNCTION(imap_mail); -PHP_FUNCTION(imap_search); -PHP_FUNCTION(imap_utf8); -PHP_FUNCTION(imap_utf7_decode); -PHP_FUNCTION(imap_utf7_encode); -PHP_FUNCTION(imap_mime_header_decode); -PHP_FUNCTION(imap_thread); -PHP_FUNCTION(imap_timeout); - -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) -PHP_FUNCTION(imap_get_quota); -PHP_FUNCTION(imap_get_quotaroot); -PHP_FUNCTION(imap_set_quota); -PHP_FUNCTION(imap_setacl); -PHP_FUNCTION(imap_getacl); -#endif - - -ZEND_BEGIN_MODULE_GLOBALS(imap) - char *imap_user; - char *imap_password; - - STRINGLIST *imap_alertstack; - ERRORLIST *imap_errorstack; - - STRINGLIST *imap_folders; - STRINGLIST *imap_folders_tail; - STRINGLIST *imap_sfolders; - STRINGLIST *imap_sfolders_tail; - MESSAGELIST *imap_messages; - MESSAGELIST *imap_messages_tail; - FOBJECTLIST *imap_folder_objects; - FOBJECTLIST *imap_folder_objects_tail; - FOBJECTLIST *imap_sfolder_objects; - FOBJECTLIST *imap_sfolder_objects_tail; - - folderlist_style_t folderlist_style; - long status_flags; - unsigned long status_messages; - unsigned long status_recent; - unsigned long status_unseen; - unsigned long status_uidnext; - unsigned long status_uidvalidity; -#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) - zval **quota_return; - zval *imap_acl_list; -#endif -ZEND_END_MODULE_GLOBALS(imap) - -#ifdef ZTS -# define IMAPG(v) TSRMG(imap_globals_id, zend_imap_globals *, v) -#else -# define IMAPG(v) (imap_globals.v) -#endif - -#else - -#define imap_module_ptr NULL - -#endif - -#define phpext_imap_ptr imap_module_ptr - -#endif /* PHP_IMAP_H */ diff --git a/ext/imap/tests/bug31142_1.phpt b/ext/imap/tests/bug31142_1.phpt deleted file mode 100644 index efb92b7b45b2f..0000000000000 --- a/ext/imap/tests/bug31142_1.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bug #31142 test #1 (imap_mail_compose() generates incorrect output) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -From: joe@example.com -To: foo@example.com -cc: bar@example.com -MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" - ---%s -Content-Type: APPLICATION/octet-stream -Content-Transfer-Encoding: BASE64 -Content-Description: some file - -QUJD - ---%s -Content-Type: TEXT/plain; CHARSET=US-ASCII -Content-Description: description3 - -contents.data3 - - - ---%s-- diff --git a/ext/imap/tests/bug31142_2.phpt b/ext/imap/tests/bug31142_2.phpt deleted file mode 100644 index 2a81760a7b965..0000000000000 --- a/ext/imap/tests/bug31142_2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #31142 test #2 (imap_mail_compose() generates incorrect output) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -From: host@domain.com -MIME-Version: 1.0 -Content-Type: TEXT/plain; CHARSET=iso-8859-2 -Content-Transfer-Encoding: QUOTED-PRINTABLE - -asn =C5=99kl \ No newline at end of file diff --git a/ext/imap/tests/bug32589.phpt b/ext/imap/tests/bug32589.phpt deleted file mode 100644 index c5030e8970a44..0000000000000 --- a/ext/imap/tests/bug32589.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #32589 (crash inside imap_mail_compose() function) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" - -%s -Content-Type: TEXT/plain; CHARSET=ISO-8859-2 -Content-Description: text_message - -hello -%s diff --git a/ext/informix/CREDITS b/ext/informix/CREDITS deleted file mode 100644 index b98418479b93b..0000000000000 --- a/ext/informix/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Informix -Danny Heijl, Christian Cartus, Corne' Cornelius diff --git a/ext/informix/Makefile.frag b/ext/informix/Makefile.frag deleted file mode 100644 index be573572bc57d..0000000000000 --- a/ext/informix/Makefile.frag +++ /dev/null @@ -1,12 +0,0 @@ - -OVERALL_TARGET += $(srcdir)/ifx.c - -$(srcdir)/ifx.c: $(srcdir)/ifx.ec - (if test -d $(INFORMIXDIR); then \ - THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; mv ifx.c $@; \ - THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; \ - mv ifx.c $@ || true; \ - else \ - touch $@; \ - fi) - diff --git a/ext/informix/config.m4 b/ext/informix/config.m4 deleted file mode 100644 index bbad564fdd975..0000000000000 --- a/ext/informix/config.m4 +++ /dev/null @@ -1,109 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(informix,for Informix support, -[ --with-informix[=DIR] Include Informix support. DIR is the Informix base - install directory, defaults to ${INFORMIXDIR:-nothing}]) - -if test "$PHP_INFORMIX" != "no"; then - - if test "$INFORMIXDIR" = ""; then - AC_MSG_ERROR([INFORMIXDIR environment variable is not set.]) - fi - - if test "$PHP_INFORMIX" = "yes"; then - IFX_INCLUDE=-I$INFORMIXDIR/incl/esql - PHP_ADD_LIBPATH($INFORMIXDIR/lib, INFORMIX_SHARED_LIBADD) - PHP_ADD_LIBPATH($INFORMIXDIR/lib/esql, INFORMIX_SHARED_LIBADD) - else - if test "$PHP_INFORMIX" != "$INFORMIXDIR"; then - AC_MSG_ERROR([Specified Informix base install directory is different than your INFORMIXDIR environment variable.]) - fi - IFX_INCLUDE=-I$PHP_INFORMIX/incl/esql - PHP_ADD_LIBPATH($PHP_INFORMIX/lib, INFORMIX_SHARED_LIBADD) - PHP_ADD_LIBPATH($PHP_INFORMIX/lib/esql, INFORMIX_SHARED_LIBADD) - fi - - dnl Check if thread safety flags are needed - if test "$enable_experimental_zts" = "yes"; then - IFX_ESQL_FLAGS="-thread" - CPPFLAGS="$CPPFLAGS -DIFX_THREAD" - else - IFX_ESQL_FLAGS="" - fi - - IFX_LIBS=`THREADLIB=POSIX $INFORMIXDIR/bin/esql $IFX_ESQL_FLAGS -libs` - IFX_LIBS=`echo $IFX_LIBS | sed -e 's/Libraries to be used://g' -e 's/esql: error -55923: No source or object file\.//g'` - dnl Seems to get rid of newlines. - dnl According to Perls DBD-Informix, might contain these strings. - - case "$host_alias" in - *aix*) - CPPFLAGS="$CPPFLAGS -D__H_LOCALEDEF";; - esac - - AC_MSG_CHECKING([Informix version]) - IFX_IBM_VERSION=[`$INFORMIXDIR/bin/esql -V | grep "IBM Informix-ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`] - IFX_VERSION=[`$INFORMIXDIR/bin/esql -V | grep "ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`] - - if test "$IFX_IBM_VERSION"; then - if test $IFX_IBM_VERSION -ge "290" && test $IFX_IBM_VERSION -lt "300"; then - IFX_VERSION=960 - else - IFX_VERSION=$IFX_IBM_VERSION - fi - AC_MSG_RESULT([IBM: $IFX_VERSION]) - else - AC_MSG_RESULT([$IFX_VERSION]) - fi - - AC_DEFINE_UNQUOTED(IFX_VERSION, $IFX_VERSION, [ ]) - - if test $IFX_VERSION -ge "900"; then - AC_DEFINE(HAVE_IFX_IUS,1,[ ]) - IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EDHAVE_IFX_IUS" - else - IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EUHAVE_IFX_IUS" - fi - - PHP_NEW_EXTENSION(informix, ifx.c, $ext_shared,, $IFX_INCLUDE) - PHP_ADD_MAKEFILE_FRAGMENT - - for i in $IFX_LIBS; do - case "$i" in - *.o) - DLIBS="$DLIBS $i" - ;; - -lm) - ;; - -lc) - ;; - -l*) - lib=`echo $i | cut -c 3-` - PHP_ADD_LIBRARY_DEFER($lib, 1, INFORMIX_SHARED_LIBADD) - ;; - *.a) - case "`uname -s 2>/dev/null`" in - UnixWare | SCO_SV | UNIX_SV) - DLIBS="$DLIBS $i" - ;; - *) - ac_dir="`echo $i|sed 's#[^/]*$##;s#\/$##'`" - ac_lib="`echo $i|sed 's#^/.*/lib##g;s#\.a##g'`" - DLIBS="$DLIBS -L$ac_dir -l$ac_lib" - ;; - esac - ;; - esac - done - - PHP_SUBST(INFORMIX_SHARED_LIBADD) - PHP_SUBST(INFORMIXDIR) - PHP_SUBST(IFX_ESQL_FLAGS) - AC_DEFINE(HAVE_IFX,1,[ ]) - - if test "$ext_shared" = "yes"; then - with_tags= - fi -fi diff --git a/ext/informix/config.w32 b/ext/informix/config.w32 deleted file mode 100644 index c01d3567a05ff..0000000000000 --- a/ext/informix/config.w32 +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("informix", "informix support", "no"); - -if (PHP_INFORMIX != "no") { - - php_ifx_esql = PATH_PROG('esql', PHP_INFORMIX + ";\\ifx-client\\bin", 'IFX_ESQL'); - - if (php_ifx_esql) { - php_ifx_libs = execute(php_ifx_esql + " -thread -libs"); - php_ifx_libs = php_ifx_libs.replace("Libraries to be used:", "").replace(/^\s+/, ""); - ADD_FLAG("LIBS_INFORMIX", php_ifx_libs); - - php_ifx_bin = FSO.GetParentFolderName(php_ifx_esql); - php_ifx_dir = FSO.GetParentFolderName(php_ifx_bin); - - ADD_FLAG("CFLAGS_INFORMIX", "/I " + php_ifx_dir + "\\incl\\esql "); - - EXTENSION('informix', 'ifx.c', null, "/D IFX_VERSION=921 /D HAVE_IFX_IUS=1 /D HAVE_IFX=1", "php_ifx.dll"); - MFO.WriteLine(configure_module_dirname + "\\ifx.c: " + configure_module_dirname + "\\ifx.ec"); - MFO.WriteLine("\t< -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ifx - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ifx.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ifx.mak" CFG="ifx - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ifx - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ifx - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ifx - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /D ZEND_DEBUG=0 /D HAVE_IFX_IUS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 isqlt09a.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\..\Release_TS/php_ifx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ifx - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ifx___W0" -# PROP BASE Intermediate_Dir "ifx___W0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /D HAVE_IFX_IUS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x406 /d "_DEBUG" -# ADD RSC /l 0x406 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 isqlt09a.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug_TS/php_ifx.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "ifx - Win32 Release_TS" -# Name "ifx - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ifx.c -# End Source File -# Begin Source File - -SOURCE=.\ifx.ec - -!IF "$(CFG)" == "ifx - Win32 Release_TS" - -# Begin Custom Build -InputPath=.\ifx.ec - -".\ifx.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - esql.exe -dcmdl -p -G -subsystem:windows -EDHAVE_IFX_IUS=1 -thread -I..\.. ifx.ec - -# End Custom Build - -!ELSEIF "$(CFG)" == "ifx - Win32 Debug_TS" - -# Begin Custom Build -InputPath=.\ifx.ec - -".\ifx.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - esql.exe -dcmdl -p -G -subsystem:windows -EDHAVE_IFX_IUS=1 -thread -I..\.. ifx.ec - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_informix.h -# End Source File -# Begin Source File - -SOURCE=.\php_informix_includes.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec deleted file mode 100644 index 16a1e6054f5fc..0000000000000 --- a/ext/informix/ifx.ec +++ /dev/null @@ -1,4712 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Danny Heijl : initial cut (ODS 7.2x) | - | PHP 4 port | - | Christian Cartus : blobs, and IUS 9 | - | Jouni Ahto : configuration stuff | - | Corne' Cornelius : input descriptors | - | Based on the MySQL code by: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* ------------------------------------------------------------------- - * if you want a function reference : "grep '^\*\*' ifx.ec" will give - * you a very short one - * ------------------------------------------------------------------- -*/ - -/* TODO: - * - * ? Safe mode implementation - */ - -/* prevent mod_ssl.h's header file from being included. */ -#define AP_HOOK_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/php_standard.h" -#include "php_open_temporary_file.h" -#include "php_informix.h" -#include "php_informix_includes.h" -#include "php_globals.h" -#include "php_ini.h" - -#ifdef PHP_WIN32 -#include -#endif - -#ifdef ZTS -#define IFX_THRD_ID tsrm_thread_id() -#else -#define IFX_THRD_ID 0 -#endif - -#if HAVE_SYS_TYPES_H -#include -#endif - -#if HAVE_NETDB_H -#include -#endif - -#if HAVE_NETINET_IN_H -#include -#endif - -#if HAVE_IFX - -/* local function prototypes */ -static void php_ifx_set_default_link(int id TSRMLS_DC); -static long php_intifx_getType(long id, HashTable *list TSRMLS_DC); -static long php_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list TSRMLS_DC); -static long php_intifx_init_blob(loc_t *blob, long mode, long new TSRMLS_DC); -static long php_intifx_init_blob_inmem(loc_t *blob, long new TSRMLS_DC); -static long php_intifx_init_blob_infile(loc_t *blob, long new TSRMLS_DC); -static void php_intifx_release_blob(loc_t *blob TSRMLS_DC); -static long php_intifx_free_blob(long id, HashTable *list TSRMLS_DC); -static long php_intifx_get_blob(long bid, HashTable *list, char** content TSRMLS_DC); -static long php_intifx_update_blob(long bid, char* param, long len, HashTable *list TSRMLS_DC); -static loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC); -static char* php_intifx_create_tmpfile(TSRMLS_D); -static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC); -static long php_intifx_alloc_ibind(IFX_RES *Ifx_Result, int items TSRMLS_DC); -static long php_intifx_preparse(char *statement TSRMLS_DC); -static long php_intifx_count_descriptors(char *p_statemid TSRMLS_DC); -static char* php_intifx_null(TSRMLS_D); -static long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS_DC); -static long php_intifx_free_char(long id, HashTable *list TSRMLS_DC); -static long php_intifx_update_char(long bid, char* param, long len, HashTable *list TSRMLS_DC); -static long php_intifx_get_char(long bid, HashTable *list, char** content TSRMLS_DC); -#if HAVE_IFX_IUS -static long php_intifxus_create_slob(long create_mode, HashTable *list TSRMLS_DC); -static long php_intifxus_free_slob(long bid, HashTable *list TSRMLS_DC); -static long php_intifxus_close_slob(long bid, HashTable *list TSRMLS_DC); -static long php_intifxus_open_slob(long bid, long create_mode, HashTable *list TSRMLS_DC); -static long php_intifxus_new_slob(HashTable *list TSRMLS_DC); -static ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list TSRMLS_DC); -#endif - -/* 7.10 on (at least) AIX is missing this */ -#ifndef CLIENT_SQLI_VER -#define CLIENT_SQLI_VER IFX_VERSION -#endif - -#define TYPE_BLBYTE 0 -#define TYPE_BLTEXT 1 -#define TYPE_SLOB 2 -#define TYPE_CHAR 3 - -#define BLMODE_INMEM 0 -#define BLMODE_INFILE 1 - -#define IFX_SCROLL 1 -#define IFX_HOLD 2 - -EXEC SQL include locator; -EXEC SQL include sqltypes; -EXEC SQL include sqlstype; - -#include - -typedef char IFX[128]; -#define SAFE_STRING(s) ((s) ? (s) : "") -#define PHP_IFX_CHECK_CONNECTION(ifx) \ - do { \ - if (ifx_check() < 0) { \ - char *ifx_err = ifx_error(ifx); \ - IFXG(sv_sqlcode) = SQLCODE; \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", ifx, ifx_err); \ - efree(ifx_err); \ - RETURN_FALSE; \ - } \ - } while (0) - -function_entry ifx_functions[] = { - PHP_FE(ifx_connect, NULL) - PHP_FE(ifx_pconnect, NULL) - PHP_FE(ifx_close, NULL) - PHP_FE(ifx_query, NULL) - PHP_FE(ifx_prepare, NULL) - PHP_FE(ifx_do, NULL) - PHP_FE(ifx_error, NULL) - PHP_FE(ifx_errormsg, NULL) - PHP_FE(ifx_affected_rows, NULL) - PHP_FE(ifx_num_rows, NULL) - PHP_FE(ifx_num_fields, NULL) - PHP_FE(ifx_fetch_row, NULL) - PHP_FE(ifx_free_result, NULL) - PHP_FE(ifx_htmltbl_result, NULL) - PHP_FE(ifx_fieldtypes, NULL) - PHP_FE(ifx_fieldproperties, NULL) - PHP_FE(ifx_getsqlca, NULL) - - PHP_FE(ifx_create_blob, NULL) - PHP_FE(ifx_free_blob, NULL) - PHP_FE(ifx_get_blob, NULL) - PHP_FE(ifx_update_blob, NULL) - PHP_FE(ifx_copy_blob, NULL) - PHP_FE(ifx_textasvarchar, NULL) - PHP_FE(ifx_byteasvarchar, NULL) - PHP_FE(ifx_nullformat, NULL) - PHP_FE(ifx_blobinfile_mode, NULL) - - PHP_FE(ifx_create_char, NULL) - PHP_FE(ifx_free_char, NULL) - PHP_FE(ifx_get_char, NULL) - PHP_FE(ifx_update_char, NULL) - -$ifdef HAVE_IFX_IUS; - PHP_FE(ifxus_create_slob, NULL) - PHP_FE(ifxus_close_slob, NULL) - PHP_FE(ifxus_open_slob, NULL) - PHP_FE(ifxus_free_slob, NULL) - PHP_FE(ifxus_read_slob, NULL) - PHP_FE(ifxus_write_slob, NULL) - PHP_FE(ifxus_seek_slob, NULL) - PHP_FE(ifxus_tell_slob, NULL) -$endif; - - {NULL,NULL,NULL} -}; - -zend_module_entry ifx_module_entry = { - STANDARD_MODULE_HEADER, - "informix", - ifx_functions, - PHP_MINIT(ifx), - PHP_MSHUTDOWN(ifx), - PHP_RINIT(ifx), - NULL, - PHP_MINFO(ifx), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -ZEND_DECLARE_MODULE_GLOBALS(ifx) - -#ifdef COMPILE_DL_INFORMIX -ZEND_GET_MODULE(ifx) -#endif - -/* True globals, no need for thread safety */ -static int le_link, le_plink, le_result, le_idresult; - -#define DUP 1 - -EXEC SQL DEFINE IFX_SUCCESS 0; -EXEC SQL DEFINE IFX_WARNING 1; -EXEC SQL DEFINE IFX_ERROR -1; -EXEC SQL DEFINE IFX_NODATA 100; - -static int ifx_check() -{ - int _ifx_check; - - _ifx_check = IFX_ERROR; - - if (SQLSTATE[0] == '0') { - switch (SQLSTATE[1]) { - case '0': - _ifx_check = IFX_SUCCESS; - break; - case '1': - _ifx_check = IFX_WARNING; - break; - case '2': - _ifx_check = IFX_NODATA; - break; - default : - _ifx_check = IFX_ERROR; - break; - } - } - return _ifx_check; -} - -static char *ifx_error(ifx) -EXEC SQL BEGIN DECLARE SECTION; - PARAMETER char *ifx; -EXEC SQL END DECLARE SECTION; -{ - char *ifx_err_msg; - char c; - int errorcode; - TSRMLS_FETCH(); - - if (IFXG(sv_sqlcode) == 0) { - errorcode = SQLCODE; - } else { - errorcode = IFXG(sv_sqlcode); - } - - switch (ifx_check()) { - case IFX_SUCCESS: - c = ' '; - break; - case IFX_WARNING: - c = 'W'; - break; - case IFX_ERROR: - c = 'E'; - break; - case IFX_NODATA: - c = 'N'; - break; - default: - c = '?'; - break; - } - - ifx_err_msg = emalloc(64); - sprintf(ifx_err_msg, "%c [SQLSTATE=%c%c %c%c%c SQLCODE=%d]", - c, - SQLSTATE[0], - SQLSTATE[1], - SQLSTATE[2], - SQLSTATE[3], - SQLSTATE[4], - errorcode - ); - - return(ifx_err_msg); -} - -static void ifx_do_close(link) -EXEC SQL BEGIN DECLARE SECTION; - PARAMETER char *link; -EXEC SQL END DECLARE SECTION; -{ - char *ifx_err = NULL; - TSRMLS_FETCH(); - - EXEC SQL SET CONNECTION :link; - - if (ifx_check() >= 0) { - EXEC SQL DISCONNECT :link; - - /* check if were in a transaction */ - if (SQLCODE == -1800) { - EXEC SQL SET CONNECTION :link; - EXEC SQL ROLLBACK WORK; - if (ifx_check() == 0) { - /* DISCONNECT again, after rollback */ - EXEC SQL DISCONNECT :link; - if (ifx_check() < 0) { - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s after Automatic Rollback fails (%s)", link, (ifx_err = ifx_error(link))); - } - } - if (ifx_check() < 0) { - /* CLOSE database if rollback or disconnect fails */ - EXEC SQL CLOSE DATABASE; - if (ifx_check() < 0) { - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Close database fails %s (%s)", link, (ifx_err = ifx_error(link))); - } - } - } - else if (SQLCODE < 0) { - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s fails (%s)", link, (ifx_err = ifx_error(link))); - } - } - else { - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", link, (ifx_err = ifx_error(link))); - } - - if (ifx_err) { - efree(ifx_err); - } -} - -static void _close_ifx_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - char *link; - - link=(char *)rsrc->ptr; - - ifx_do_close(link); - - efree(link); - IFXG(num_links)--; -} - -static void _close_ifx_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - char *link; - - link = (char *)rsrc->ptr; - - ifx_do_close(link); - - free(link); - IFXG(num_persistent)--; - IFXG(num_links)--; -} - -static void ifx_free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - IFX_RES *Ifx_Result = (IFX_RES *)rsrc->ptr; - efree(Ifx_Result); -} - -static void ifx_free_blob(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob = (IFX_IDRES *)rsrc->ptr; - - php_intifx_release_blob(&Ifx_blob->BLOB.blob_data TSRMLS_CC); - efree(Ifx_blob); -} - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("ifx.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY_EX("ifx.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_ifx_globals, ifx_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("ifx.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_ifx_globals, ifx_globals, display_link_numbers) - STD_PHP_INI_ENTRY("ifx.default_host", NULL, PHP_INI_SYSTEM, OnUpdateString, default_host, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.default_user", NULL, PHP_INI_SYSTEM, OnUpdateString, default_user, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.default_password", NULL, PHP_INI_SYSTEM, OnUpdateString, default_password, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.blobinfile", "1", PHP_INI_ALL, OnUpdateLong, blobinfile, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.textasvarchar", "0", PHP_INI_ALL, OnUpdateLong, textasvarchar, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.byteasvarchar", "0", PHP_INI_ALL, OnUpdateLong, byteasvarchar, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.charasvarchar", "0", PHP_INI_ALL, OnUpdateLong, charasvarchar, zend_ifx_globals, ifx_globals) - STD_PHP_INI_ENTRY("ifx.nullformat", "0", PHP_INI_ALL, OnUpdateLong, nullformat, zend_ifx_globals, ifx_globals) -PHP_INI_END() - -static void php_ifx_init_globals(zend_ifx_globals *ifx_globals) -{ - ifx_globals->num_persistent = 0; - ifx_globals->nullvalue[0] = 0; - strcpy(ifx_globals->nullstring, "NULL"); - ifx_globals->num_persistent = 0; - ifx_globals->sv_sqlcode = 0; -} - -PHP_MINIT_FUNCTION(ifx) -{ - ZEND_INIT_MODULE_GLOBALS(ifx, php_ifx_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - le_result = zend_register_list_destructors_ex(ifx_free_result, NULL, "informix result", module_number); - le_idresult = zend_register_list_destructors_ex(ifx_free_blob, NULL, "informix id result", module_number); - le_link = zend_register_list_destructors_ex(_close_ifx_link, NULL, "informix link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_ifx_plink, "informix persistent link", module_number); - ifx_module_entry.type = type; - - REGISTER_LONG_CONSTANT("IFX_SCROLL", IFX_SCROLL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_HOLD", IFX_HOLD, CONST_CS | CONST_PERSISTENT); -$ifdef HAVE_IFX_IUS; - REGISTER_LONG_CONSTANT("IFX_LO_RDONLY", LO_RDONLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_LO_WRONLY", LO_WRONLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_LO_APPEND", LO_APPEND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_LO_RDWR", LO_RDWR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_LO_BUFFER", LO_BUFFER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IFX_LO_NOBUFFER", LO_NOBUFFER, CONST_CS | CONST_PERSISTENT); -$endif; - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(ifx) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(ifx) -{ - IFXG(default_link) = -1; - IFXG(num_links) = IFXG(num_persistent); - return SUCCESS; -} -PHP_MINFO_FUNCTION(ifx) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "Informix support", "enabled"); - sprintf(buf, "%ld", IFXG(num_persistent)); - php_info_print_table_row(2, "Active Persistent links", buf); - sprintf(buf, "%ld", IFXG(num_links)); - php_info_print_table_row(2, "Active links", buf); - sprintf(buf, "%02.2f", (double)(IFX_VERSION/100.0)); - php_info_print_table_row(2, "ESQL/C Version", buf); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -static void php_ifx_set_default_link(int id TSRMLS_DC) -{ - if (IFXG(default_link) != -1) { - zend_list_delete(IFXG(default_link)); - } - IFXG(default_link) = id; - zend_list_addref(id); -} - -/* ---------------------------------------------------------------------- -** int ifx_(p)connect(string database, string userid, string password) -** -** connects to $database (db@server syntax) using $userid and $password -** -** returns a connection id on success or FALSE one error -** ---------------------------------------------------------------------- -*/ - -static void php_ifx_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *hashed_details; - int hashed_details_length; - -EXEC SQL BEGIN DECLARE SECTION; - char *user,*passwd,*host; - char *ifx; -EXEC SQL END DECLARE SECTION; - - if (PG(sql_safe_mode)) { - if (ZEND_NUM_ARGS() > 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information"); - } - host = passwd = NULL; - user = php_get_current_user(); - hashed_details_length = strlen(user) + 3 + 3; - hashed_details = (char *) emalloc(hashed_details_length + 1); - sprintf(hashed_details, "ifx__%s_", user); - } else { - int host_len = 0, user_len = 0, passwd_len = 0; - host = user = passwd = NULL; - - /* set default values if any are available */ - if (IFXG(default_host)) { - host = IFXG(default_host); - host_len = strlen(host); - } - if (IFXG(default_user)) { - user = IFXG(default_user); - user_len = strlen(IFXG(default_user)); - } - if (IFXG(default_password)) { - passwd = IFXG(default_password); - passwd_len = strlen(IFXG(default_password)); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &host, &host_len, &user, &user_len, &passwd, &passwd_len) == FAILURE) { - return; - } - - hashed_details_length = sizeof("ifx___") - 1 + host_len + user_len + passwd_len; - hashed_details = (char *) emalloc(hashed_details_length + 1); - sprintf(hashed_details, "ifx_%s_%s_%s", SAFE_STRING(host), SAFE_STRING(user), SAFE_STRING(passwd)); - } - - IFXG(sv_sqlcode) = 0; - - if (!IFXG(allow_persistent)) { - persistent = 0; - } - - if (persistent) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le) == FAILURE) { /* we don't */ - list_entry new_le; - - if (IFXG(max_links) != -1 && IFXG(num_links) >= IFXG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", IFXG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - if (IFXG(max_persistent) != -1 && IFXG(num_persistent) >= IFXG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", IFXG(num_persistent)); - efree(hashed_details); - RETURN_FALSE; - } - - /* create the link */ - ifx = (char *) malloc(sizeof(IFX)); - IFXG(connectionid)++; - sprintf(ifx, "%s%x_%x", SAFE_STRING(user), IFX_THRD_ID,IFXG(connectionid)); - - EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION; - - if (ifx_check() == IFX_ERROR) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_err); - efree(ifx_err); - free(ifx); - efree(hashed_details); - RETURN_FALSE; - } - - /* hash it up */ - new_le.type = le_plink; - new_le.ptr = ifx; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void *) &new_le, sizeof(list_entry), NULL) == FAILURE) { - free(ifx); - efree(hashed_details); - RETURN_FALSE; - } - IFXG(num_persistent)++; - IFXG(num_links)++; - } else { /* we do */ - if (le->type != le_plink) { - RETURN_FALSE; - } - /* ensure that the link did not die */ - ifx = le->ptr; - EXEC SQL SET CONNECTION :ifx; - if (ifx_check() == IFX_ERROR) { /* the link died */ - ifx = le->ptr; /* reconnect silently */ - EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION; - - if (ifx_check() == IFX_ERROR) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect (%s)", ifx_err); - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length + 1); - efree(ifx_err); - efree(hashed_details); - RETURN_FALSE; - } - } - ifx = le->ptr; - } - ZEND_REGISTER_RESOURCE(return_value, ifx, le_plink); - } else { /* non persistent */ - list_entry *index_ptr,new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual ifx link sits. - * if it doesn't, open a new ifx link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length + 1, (void **) &index_ptr) == SUCCESS) - { - int type,link; - void *ptr; - - if (index_ptr->type != le_index_ptr) { - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type == le_link || type == le_plink)) { - /* ensure that the link is not closed */ - ifx = ptr; - EXEC SQL SET CONNECTION :ifx; - if (ifx_check() == IFX_ERROR) { - /* the link is closed */ - ifx = ptr; /* reconnect silently */ - EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION; - - if (ifx_check() == IFX_ERROR) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect (%s)", ifx_err); - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length + 1); - efree(hashed_details); - efree(ifx_err); - RETURN_FALSE; - } - } - zend_list_addref(link); - return_value->value.lval = link; - php_ifx_set_default_link(link TSRMLS_CC); - return_value->type = IS_RESOURCE; - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length + 1); - } - } - if (IFXG(max_links) != -1 && IFXG(num_links) >= IFXG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", IFXG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - - ifx = (char *) emalloc(sizeof(IFX)); - IFXG(connectionid)++; - sprintf(ifx, "connec%x_%x", IFX_THRD_ID, IFXG(connectionid)); - - EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION; - - if (ifx_check() == IFX_ERROR) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_err); - efree(ifx_err); - efree(hashed_details); - efree(ifx); - RETURN_FALSE; - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, ifx, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) return_value->value.lval; - new_index_ptr.type = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1, (void *) &new_index_ptr, sizeof(list_entry), NULL) == FAILURE) { - efree(hashed_details); - RETURN_FALSE; - } - IFXG(num_links)++; - } - efree(hashed_details); - php_ifx_set_default_link(return_value->value.lval TSRMLS_CC); -} - -/* {{{ proto resource ifx_connect([string database [, string userid [, string password]]]) - Connects to database using userid/password, returns connection id */ -PHP_FUNCTION(ifx_connect) -{ - php_ifx_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} -/* }}} */ - -/* {{{ proto resource ifx_pconnect([string database [, string userid [, string password]]]) - Connects to database using userid/password, returns connection id */ -PHP_FUNCTION(ifx_pconnect) -{ - php_ifx_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_close(int connid) -** -** closes connection connid -** always returns TRUE -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_close([resource connid]) - Close informix connection */ -PHP_FUNCTION(ifx_close) -{ - zval **ifx_link = NULL; - int id; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; -EXEC SQL END DECLARE SECTION; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = IFXG(default_link); - break; - case 1: - if (zend_get_parameters_ex(1, &ifx_link) == FAILURE) { - RETURN_FALSE; - } - id=-1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE2(ifx, char *, ifx_link, id, "Informix link", le_link, le_plink); - - if (id == -1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(ifx_link)); - } - - if (id != -1 || (ifx_link && Z_RESVAL_PP(ifx_link) == IFXG(default_link))) { - zend_list_delete(IFXG(default_link)); - IFXG(default_link) = -1; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_query(string query, int connid -** [, int cursortype] [, array blobidarray]) -** cursortype and blobidarray are optional -** -** executes query query on connection connid -** for select queries a cursor is declared and opened -** non-select queries are "execute immediate" -** select queries accept an optional cursortype param: -** IFX_SCROLL, IFX_HOLD (or'ed mask) -** non-select queries accept an optional "blobarryid" parameter -** blobsupport: mark the blob-column(s) with ? in the insert/update query -** and add a blob-id-array-functionparameter -** select queries return "blob-ids" for blob columns -** except if text/byteasvarchar is set -** example: ifx_query("insert into catalog (stock_num, manu_code, -** cat_descr,cat_picture) values(1,'HRO',?,?)",$cid,$bidarray); -** -** returns a "result id" on success or FALSE on error -** also sets "affected_rows for retrieval by ifx_affected_rows() -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto resource ifx_query(string query, resource connid [, int cursortype] [, array idarray]) - Perform a query on a given connection */ -PHP_FUNCTION(ifx_query) -{ - zval **query, **ifx_link, **cursortype, **dummy; - int id=-1; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char cursorid[32]; /* query cursor id */ - char statemid[32]; /* statement id */ - char descrpid[32]; /* descriptor id */ - char i_descrpid[32]; /* input descriptor binding */ - char *statement; /* query text */ - int fieldcount; /* field count */ - int i; /* field index */ - short fieldtype; - loc_t *locator=NULL; - int loc_t_type=CLOCATORTYPE; /* WORKAROUND:TYPE=CLOCATORTYPE doesn't work, */ - int sqlchar_type=SQLCHAR; /* don't ask me, why. */ - char *char_tmp; - long len; - int indicator; - int desc_count; -$ifdef HAVE_IFX_IUS; - fixed binary 'blob' ifx_lo_t *slocator; -$endif; -EXEC SQL END DECLARE SECTION; - - int locind; - int ctype; - int affected_rows; - long sqlerrd[6]; - int e; - int query_type; - int cursoryproc; - int argc=ZEND_NUM_ARGS(); - long ifx_type; - int num_params; - - if (argc < 2 || zend_get_parameters_ex(argc, &query, &ifx_link, &dummy, &dummy) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(ifx, char *, ifx_link, id, "Informix link", le_link, le_plink); - - IFXG(sv_sqlcode) = 0; - affected_rows = -1; /* invalid */ - - convert_to_string_ex(query); - statement = Z_STRVAL_PP(query); - - IFXG(cursorid)++; - sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid)); - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - EXEC SQL PREPARE :statemid FROM :statement; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - affected_rows = sqlca.sqlerrd[0]; /* save estimated affected rows */ - for (e = 0; e < 6; e++) sqlerrd[e] = sqlca.sqlerrd[e]; - - num_params = php_intifx_preparse(statement TSRMLS_CC); - - Ifx_Result = (IFX_RES *) emalloc(sizeof(IFX_RES)); - if (Ifx_Result == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory allocating IFX_RES"); - EXEC SQL free :statemid; - RETURN_FALSE; - } - - /* initialize result data structure */ - Ifx_Result->rowid = 0; - strcpy(Ifx_Result->connecid, ifx); - strcpy(Ifx_Result->cursorid, cursorid); - strcpy(Ifx_Result->descrpid, descrpid); - strcpy(Ifx_Result->i_descrpid, i_descrpid); - strcpy(Ifx_Result->statemid, statemid); - Ifx_Result->numcols = 0; - Ifx_Result->numicols = 0; - - for (i = 0; i < MAX_RESID; ++i) { - Ifx_Result->res_id[i] = -1; - } - - if (!php_intifx_alloc_ibind(Ifx_Result, num_params TSRMLS_CC)) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - desc_count = php_intifx_count_descriptors(statemid TSRMLS_CC); - if (desc_count == 0) { - desc_count = 1; - } - - EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX :desc_count; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_err); - EXEC SQL free :statemid; - efree(ifx_err); - RETURN_FALSE; - } - - EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_err); - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - efree(ifx_err); - RETURN_FALSE; - } - - query_type = sqlca.sqlcode; - - cursoryproc = 0; - if (query_type == SQ_EXECPROC) { - EXEC SQL GET DESCRIPTOR :descrpid :i = COUNT; - if (i > 0) { - cursoryproc = 1; - } - } - - Ifx_Result->iscursory = -1; /* prevent ifx_do */ - Ifx_Result->paramquery = 0; - - if ((query_type != 0) && (!cursoryproc)) { /* NO RESULT SET */ - /* ## - ## NONSELECT-STATEMENT - ## - */ - zval **pblobidarr, **tmp; - - /* We don't need this descriptor anymore, NONSELECT-STATEMENT */ - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - - Ifx_Result->iscursory = 0; - - if (argc > 3) { - WRONG_PARAM_COUNT; - } - - if (argc == 3) { - - if (Ifx_Result->numicols <= 0) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No placeholders (?) in Statement, but blob array param supplied"); - RETURN_FALSE; - } - - if (zend_get_parameters_ex(3, &dummy, &dummy, &pblobidarr) == FAILURE) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get blob array param"); - RETURN_FALSE; - } - if (Z_TYPE_PP(pblobidarr) != IS_ARRAY) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Blob-parameter is not an array"); - RETURN_FALSE; - } - - zend_hash_internal_pointer_reset((*pblobidarr)->value.ht); - for (i = 1; i <= Ifx_Result->numicols && (zend_hash_get_current_data((*pblobidarr)->value.ht, (void **) &tmp) == SUCCESS); ++i) { - convert_to_long(*tmp); - - ifx_type = php_intifx_getType((int)(*tmp)->value.lval, &EG(regular_list) TSRMLS_CC); - switch (ifx_type) { - case TYPE_BLTEXT: - case TYPE_BLBYTE: - locator = php_intifx_get_blobloc((int)((*tmp)->value.lval), &EG(regular_list) TSRMLS_CC); - if (locator == NULL) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an Informix blob-result index", (int)((*tmp)->value.lval)); - RETURN_FALSE; - } - if (locator->loc_loctype == LOCFNAME) { - locator->loc_oflags=LOC_RONLY; - } - EXEC SQL SET DESCRIPTOR :i_descrpid VALUE :i DATA = :*locator, TYPE = :loc_t_type; - break; - - case TYPE_CHAR: - len = php_intifx_get_char((int) ((*tmp)->value.lval), &EG(regular_list), &char_tmp TSRMLS_CC); - indicator = 0; - if (char_tmp == NULL || len < 0) { - indicator = -1; - } - len++; - - EXEC SQL SET DESCRIPTOR :i_descrpid VALUE :i - DATA= :char_tmp, - LENGTH= :len, - INDICATOR= :indicator, - TYPE= :sqlchar_type; - break; - } - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - zend_hash_move_forward((*pblobidarr)->value.ht); - } - Ifx_Result->paramquery=1; - - if (i - 1 != Ifx_Result->numicols) { - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : number of created blobs doesn't match placeholders (?)"); - RETURN_FALSE; - } - EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :i_descrpid; - } else { - EXEC SQL EXECUTE :statemid; - } - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - if (Ifx_Result->numicols > 0) { - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - } - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ - for (e = 0; e < 6; e++) { - Ifx_Result->sqlerrd[e] = sqlca.sqlerrd[e]; - } - } else { - /* ## - ## SELECT-STATEMENT - ## - */ - - ctype = 0; /* preset */ - - switch(argc) { - case 2: - break; - case 3: - if (zend_get_parameters_ex(3, &dummy, &dummy, &cursortype) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(cursortype); - ctype = Z_LVAL_PP(cursortype); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */ - for (e = 0; e < 6; e++) { - Ifx_Result->sqlerrd[e] = sqlerrd[e]; - } - - EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - Ifx_Result->numcols = fieldcount; - Ifx_Result->isscroll = Ifx_Result->ishold = 0; - - if (ctype & IFX_SCROLL) { - Ifx_Result->isscroll = 1; - } - if (ctype & IFX_HOLD) { - Ifx_Result->ishold = 1; - } - - /* - * ifx_do() part - */ - - if (Ifx_Result->isscroll) { - if (Ifx_Result->ishold) { - EXEC SQL DECLARE :cursorid SCROLL CURSOR WITH HOLD FOR :statemid; - } else { - EXEC SQL DECLARE :cursorid SCROLL CURSOR FOR :statemid; - } - } else { - if (Ifx_Result->ishold) { - EXEC SQL DECLARE :cursorid CURSOR WITH HOLD FOR :statemid; - } else { - EXEC SQL DECLARE :cursorid CURSOR FOR :statemid; - } - } - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - EXEC SQL OPEN :cursorid; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - EXEC SQL free :cursorid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - /* check for text/blob columns */ - locind = 0; - for (i = 1; i <= fieldcount; ++i) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; - if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES) -$ifdef HAVE_IFX_IUS; - || (fieldtype == SQLUDTFIXED) -$endif; - ) { - int bid = 0; - if (fieldtype == SQLTEXT) { - if (IFXG(blobinfile) == 0) { - bid = php_intifx_create_blob(TYPE_BLTEXT,BLMODE_INMEM, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } else { - bid = php_intifx_create_blob(TYPE_BLTEXT,BLMODE_INFILE, "",-1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } - - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*locator; - } else if (fieldtype == SQLBYTES) { - if (IFXG(blobinfile) == 0) { - bid = php_intifx_create_blob(TYPE_BLBYTE, BLMODE_INMEM, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } else { - bid = php_intifx_create_blob(TYPE_BLBYTE,BLMODE_INFILE, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*locator; - } - - php_intifx_release_blob(locator TSRMLS_CC); -$ifdef HAVE_IFX_IUS; - if (fieldtype == SQLUDTFIXED) { - bid = php_intifxus_new_slob(&EG(regular_list) TSRMLS_CC); - slocator = php_intifxus_get_slobloc(bid, &EG(regular_list) TSRMLS_CC); - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*slocator; - } -$endif; - Ifx_Result->res_id[locind]=bid; - ++locind; - } - } - } - ZEND_REGISTER_RESOURCE(return_value, Ifx_Result, le_result); -} -/* }}} */ - - -/* ---------------------------------------------------------------------- -** int ifx_prepare(string query, int connid, -** [, int cursortype] [, array blobidarry]) -** -** $hold, $scroll are optional and valid only for select queries -** $blobidarray is optional, an array of blob id's -** -** prepares query $query on connection $connid -** select queries accept an optional cursortype param: IFX_SCROLL, IFX_HOLD (or'ed mask) -** blobsupport: mark the blob-column with ? and add a blob-id-functionparameter -** example: ifx_query("insert into catalog (stock_num, manu_code ,cat_descr, -** cat_picture) values(1,'HRO',?,?)",$cid,$bid1,$bid2); -** -** returns a "result id" on success or FALSE on error -** also sets "affected_rows for retrieval by ifx_affected_rows -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto resource ifx_prepare(string query, resource connid [, int cursortype] [, array idarray]) - Prepare a query on a given connection */ -PHP_FUNCTION(ifx_prepare) -{ - zval **query, **ifx_link, **cursortype, **dummy; - int id=-1; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char cursorid[32]; /* query cursor id */ - char statemid[32]; /* statement id */ - char descrpid[32]; /* descriptor id */ - char i_descrpid[32]; /* input descriptor binding */ - char *statement; /* query text */ - int fieldcount; /* field count */ - int i; /* field index */ - loc_t *locator; - int loc_t_type=CLOCATORTYPE; /* WORKAROUND: TYPE=CLOCATORTYPE doesn't work, */ - int sqlchar_type=SQLCHAR; /* don't ask me, why. */ - char *char_tmp; - long len; - int indicator; - long sqlerrd[6]; - int e; - int desc_count; -EXEC SQL END DECLARE SECTION; - int ctype; - int affected_rows; - int query_type; - int cursoryproc; - int argc=ZEND_NUM_ARGS(); - long ifx_type; - int num_params; - - if (argc < 2 || zend_get_parameters_ex(argc, &query, &ifx_link, &dummy, &dummy) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(ifx, char *, ifx_link, id, "Informix link", le_link, le_plink); - - IFXG(sv_sqlcode) = 0; - affected_rows = -1; /* invalid */ - - convert_to_string_ex(query); - statement = Z_STRVAL_PP(query); - - IFXG(cursorid)++; - sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid)); - sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid)); - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - EXEC SQL PREPARE :statemid FROM :statement; - if (ifx_check() < 0) { - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_error(ifx)); - RETURN_FALSE; - } - - affected_rows = sqlca.sqlerrd[0]; /* save estimated affected rows */ - for (e = 0; e < 6; e++) { - sqlerrd[e] = sqlca.sqlerrd[e]; - } - num_params = php_intifx_preparse(statement TSRMLS_CC); - - Ifx_Result = (IFX_RES *) emalloc(sizeof(IFX_RES)); - if (Ifx_Result == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory allocating IFX_RES"); - EXEC SQL free :statemid; - RETURN_FALSE; - } - - /* initialize result data structure */ - - Ifx_Result->rowid = 0; - strcpy(Ifx_Result->connecid, ifx); - strcpy(Ifx_Result->cursorid, cursorid); - strcpy(Ifx_Result->descrpid, descrpid); - strcpy(Ifx_Result->i_descrpid, i_descrpid); - strcpy(Ifx_Result->statemid, statemid); - Ifx_Result->numcols = 0; - Ifx_Result->numicols = 0; - - for (i = 0; i < MAX_RESID; ++i) { - Ifx_Result->res_id[i] = -1; - } - - if (!php_intifx_alloc_ibind(Ifx_Result, num_params TSRMLS_CC)) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - desc_count = php_intifx_count_descriptors(statemid TSRMLS_CC); - if (desc_count == 0) { - desc_count = 1; - } - - EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX :desc_count; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_err); - EXEC SQL free :statemid; - efree(ifx_err); - RETURN_FALSE; - } - - EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_err); - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - efree(ifx_err); - RETURN_FALSE; - } - - query_type = sqlca.sqlcode; - - cursoryproc = 0; - if (query_type == SQ_EXECPROC) { - EXEC SQL GET DESCRIPTOR :descrpid :i = COUNT; - if (i > 0) { - cursoryproc = 1; - } - } - - Ifx_Result->iscursory = -1; /* prevent ifx_do */ - Ifx_Result->paramquery=0; - - if ((query_type != 0) && (!cursoryproc)) { /* NO RESULT SET */ - /* ## - ## NONSELECT-STATEMENT - ## - */ - zval **pblobidarr, **tmp; - - /* We don't need this descriptor anymore, NONSELECT-STATEMENT */ - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - - Ifx_Result->iscursory = 0; - - if (argc > 3) { - WRONG_PARAM_COUNT; - } - - if (argc == 3) { - Ifx_Result->paramquery = 1; - - if (Ifx_Result->numicols <= 0) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No placeholders (?) in Statement, but blob array param supplied"); - RETURN_FALSE; - } - - if (zend_get_parameters_ex(3, &dummy, &dummy, &pblobidarr) == FAILURE) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get blob array param"); - RETURN_FALSE; - } - - if ((*pblobidarr)->type != IS_ARRAY) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Blob-parameter not an array"); - RETURN_FALSE; - } - - zend_hash_internal_pointer_reset((*pblobidarr)->value.ht); - for (i = 1; i <= num_params && (zend_hash_get_current_data((*pblobidarr)->value.ht, (void **) &tmp) == SUCCESS); ++i) { - convert_to_long(*tmp); - - ifx_type = php_intifx_getType((int)(*tmp)->value.lval, &EG(regular_list) TSRMLS_CC); - switch (ifx_type) { - case TYPE_BLTEXT: - case TYPE_BLBYTE: - locator = php_intifx_get_blobloc((int)((*tmp)->value.lval), &EG(regular_list) TSRMLS_CC); - if (locator == NULL) { - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", (int)((*tmp)->value.lval)); - RETURN_FALSE; - } - if (locator->loc_loctype == LOCFNAME) { - locator->loc_oflags=LOC_RONLY; - } - EXEC SQL SET DESCRIPTOR :i_descrpid VALUE :i DATA = :*locator, TYPE = :loc_t_type; - break; - case TYPE_CHAR: - len = php_intifx_get_char((int)((*tmp)->value.lval), &EG(regular_list), &char_tmp TSRMLS_CC); - - indicator = 0; - if (char_tmp == NULL || len < 0) { - indicator = -1; - } - len++; - - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i - DATA= :char_tmp, - LENGTH= :len, - INDICATOR= :indicator, - TYPE= :sqlchar_type; - break; - } - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails : %s", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - zend_hash_move_forward((*pblobidarr)->value.ht); - } - - if (i - 1 != Ifx_Result->numicols) { - EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails : number of created blobs doesn't match placeholders (?)"); - RETURN_FALSE; - } - - } - - Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */ - for (e = 0; e < 6; e++) { - Ifx_Result->sqlerrd[e] = sqlerrd[e]; - } - - } else { - /* ## - ## SELECT-STATEMENT - ## - */ - ctype = 0; /* preset */ - - switch (argc) { - case 2: - break; - case 3: - if (zend_get_parameters_ex(3, &dummy, &dummy, &cursortype) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(cursortype); - ctype = Z_LVAL_PP(cursortype); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - Ifx_Result->iscursory = 1; - - Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */ - for (e = 0; e < 6; e++) { - Ifx_Result->sqlerrd[e] = sqlerrd[e]; - } - - EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT; - if (ifx_check() < 0) { - char *ifx_err; - IFXG(sv_sqlcode) = SQLCODE; - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - EXEC SQL free :statemid; - efree(Ifx_Result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, (ifx_err = ifx_error(ifx))); - efree(ifx_err); - RETURN_FALSE; - } - Ifx_Result->numcols = fieldcount; - Ifx_Result->isscroll = Ifx_Result->ishold = 0; - - if (ctype & IFX_SCROLL) { - Ifx_Result->isscroll = 1; - } - if (ctype & IFX_HOLD) { - Ifx_Result->ishold = 1; - } - } - - ZEND_REGISTER_RESOURCE(return_value, Ifx_Result, le_result); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_do(int resultid) -** -** executes a previously prepared query or opens a cursor for it -** -** returns TRUE on success, false on error -** does NOT free $resultid on error !!! -** -** also sets (real) affected_rows for non-select statements -** for retrieval by ifx_affected_rows -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_do(resource resultid) - Executes a previously prepared query or opens a cursor for it */ -PHP_FUNCTION(ifx_do) -{ - zval **result; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ - char *i_descrpid; /* descriptor id */ - int fieldcount; /* field count */ - int i; /* field index */ - short fieldtype; - loc_t *locator=NULL; - int e; -$ifdef HAVE_IFX_IUS; - fixed binary 'blob' ifx_lo_t *slocator; -$endif; -EXEC SQL END DECLARE SECTION; - - int locind; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &result) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - IFXG(sv_sqlcode) = 0; - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - i_descrpid = Ifx_Result->i_descrpid; - fieldcount = Ifx_Result->numcols; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - if (Ifx_Result->iscursory < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Resultindex %d is not a prepared query", Z_LVAL_PP(result)); - RETURN_FALSE; - } - - if (Ifx_Result->iscursory == 0) { /* execute immediate */ - if (Ifx_Result->paramquery != 0) { - EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :i_descrpid; - } else { - EXEC SQL EXECUTE :statemid; - } - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails: %s", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ - for (e = 0; e < 6; e++) { - Ifx_Result->sqlerrd[e] = sqlca.sqlerrd[e]; - } - } else { /* open cursor */ - if (Ifx_Result->isscroll) { - if (Ifx_Result->ishold) { - EXEC SQL DECLARE :cursorid SCROLL CURSOR WITH HOLD FOR :statemid; - } else { - EXEC SQL DECLARE :cursorid SCROLL CURSOR FOR :statemid; - } - } else { - if (Ifx_Result->ishold) { - EXEC SQL DECLARE :cursorid CURSOR WITH HOLD FOR :statemid; - } else { - EXEC SQL DECLARE :cursorid CURSOR FOR :statemid; - } - } - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - EXEC SQL OPEN :cursorid; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - /* check for text/blob columns */ - locind = 0; - for (i = 1; i <= fieldcount; ++i) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; - if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES) -$ifdef HAVE_IFX_IUS; - || (fieldtype == SQLUDTFIXED) -$endif; - ) { - - int bid = 0; - if (fieldtype == SQLTEXT) { - if (IFXG(blobinfile) == 0) { - bid = php_intifx_create_blob(TYPE_BLTEXT,BLMODE_INMEM, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } else { - bid = php_intifx_create_blob(TYPE_BLTEXT,BLMODE_INFILE, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } - - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*locator; - } - else if (fieldtype == SQLBYTES) { - if (IFXG(blobinfile) == 0) { - bid = php_intifx_create_blob(TYPE_BLBYTE,BLMODE_INMEM, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - } else { - bid = php_intifx_create_blob(TYPE_BLBYTE,BLMODE_INFILE, "", -1, &EG(regular_list) TSRMLS_CC); - locator = php_intifx_get_blobloc(bid, &EG(regular_list) TSRMLS_CC); - locator->loc_oflags = LOC_WONLY; - } - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*locator; - } - - php_intifx_release_blob(locator TSRMLS_CC); -$ifdef HAVE_IFX_IUS; - if (fieldtype == SQLUDTFIXED) { - bid = php_intifxus_new_slob(&EG(regular_list) TSRMLS_CC); - slocator = php_intifxus_get_slobloc(bid, &EG(regular_list) TSRMLS_CC); - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*slocator; - } -$endif; - Ifx_Result->res_id[locind] = bid; - ++locind; - } - } - } /* end open cursor */ - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** string ifx_error([int connection_id]); -** -** returns the Informix error codes (SQLSTATE & SQLCODE) -** -** connection id is not checked, but remains for compatibility -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto string ifx_error([resource connection_id]) - Returns the Informix error codes (SQLSTATE & SQLCODE) */ -PHP_FUNCTION(ifx_error) -{ - zval **ifx_link; - int id; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = IFXG(default_link); - break; - case 1: - if (zend_get_parameters_ex(1, &ifx_link) == FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - RETURN_STRING(ifx_error(0), 0); /* ifx_error returns emalloced string */ -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** string ifx_errormsg([int errorcode]) -** -** returns the Informix errormessage associated with -** the most recent Informix error if SQLCODE is nonzero, or, -** when the optional "errocode" param is present, the errormessage -** corresponding to "errorcode". -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto string ifx_errormsg([int errorcode]) - Returns the Informix errormessage associated with */ -PHP_FUNCTION(ifx_errormsg) -{ - zval **errcode; - int ifx_errorcode; - int msglen, maxmsglen; - char *ifx_errmsg; - char * returnmsg; - - switch(ZEND_NUM_ARGS()) { - case 0: - if (IFXG(sv_sqlcode) == 0) { - ifx_errorcode = SQLCODE; - } else { - ifx_errorcode = IFXG(sv_sqlcode); - } - break; - case 1: - if (zend_get_parameters_ex(1, &errcode) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(errcode); - ifx_errorcode = Z_LVAL_PP(errcode); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - maxmsglen = 255; - msglen = maxmsglen; /* Some bug fix, rgetlmsg doesnt always set the value */ - ifx_errmsg = (char *)emalloc(maxmsglen + 1); - if (ifx_errorcode != 0) { - rgetlmsg(ifx_errorcode, ifx_errmsg, maxmsglen, &msglen); - if (msglen > maxmsglen) { - maxmsglen = msglen; - ifx_errmsg = (char *)erealloc(ifx_errmsg, maxmsglen + 1); - rgetlmsg(ifx_errorcode, ifx_errmsg, maxmsglen, &msglen); - } - } else { - ifx_errmsg[0] = 0; - } - - returnmsg = (char *) emalloc(strlen(ifx_errmsg) + 128); - sprintf(returnmsg, ifx_errmsg, sqlca.sqlerrm); - efree(ifx_errmsg); - RETURN_STRING(returnmsg,0); -} -/* }}} */ - -/* -------------------------------------------------------------- -** int ifx_affected_rows(int resultid) -** -** returns the number of rows affected by query $resultid -** -** for selects : estimated number of rows (sqlerrd[0]) -** for insert/update/delete : real number (sqlerrd[2]) -** --------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_affected_rows(resource resultid) - Returns the number of rows affected by query identified by resultid */ -PHP_FUNCTION(ifx_affected_rows) -{ - zval **result; - IFX_RES *Ifx_Result; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &result)) == FAILURE) { - WRONG_PARAM_COUNT; - } - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - RETURN_LONG(Ifx_Result->affected_rows); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** array ifx_fetch_row(int resultid [, mixed $position]) -** -** fetches the next row, or if using a scroll cursor, and position -** is present, the row as given in position, into an associative -** array with the fieldnames as key -** -** returns FALSE on error -** -** position can be : "FIRST", "NEXT", "LAST", "PREVIOUS", "CURRENT" -** or an absolute row number -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto array ifx_fetch_row(resource resultid [, mixed position]) - Fetches the next row or row if using a scroll cursor */ -PHP_FUNCTION(ifx_fetch_row) -{ - zval **result, **position; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ - int fieldcount; /* field count */ - int i; /* an index */ - char fieldname[64]; /* fieldname */ - short fieldtype; /* field type */ - int fieldleng; /* field length */ -$ifdef HAVE_IFX_IUS; - ifx_int8_t int8_var; - lvarchar *lvar_tmp; -$endif; - short indicator; - int int_data; - char *char_data; - long date_data; - interval intvl_data = {0}; - datetime dt_data = {0}; - decimal dec_data = {0}; - short short_data; - loc_t *locator_b; -$ifdef HAVE_IFX_IUS; - fixed binary 'blob' ifx_lo_t *slocator; -$endif; - float float_data; - double double_data; - int fetch_row; -EXEC SQL END DECLARE SECTION; - - int num_fields; - int locind,bid,bid_b; - char string_data[256]; - long long_data; - char *p; - char *fetch_pos; - char *nullstr; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result) == FAILURE) { - RETURN_FALSE; - } - fetch_pos = NULL; - fetch_row = 0; - break; - case 2: - if (zend_get_parameters_ex(2, &result, &position) == FAILURE) { - RETURN_FALSE; - } - if (Z_TYPE_PP(position) != IS_STRING) { - fetch_pos = NULL; - fetch_row = Z_LVAL_PP(position); - } else { - fetch_pos = Z_STRVAL_PP(position); - fetch_row = 0; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - nullstr = php_intifx_null(TSRMLS_C); - IFXG(sv_sqlcode) = 0; - - if (strcmp(Ifx_Result->cursorid, "") == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); - RETURN_FALSE; - } - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - fieldcount = Ifx_Result->numcols; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - locind = 0; - for (i = 1; i <= Ifx_Result->numcols; i++) { - - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; - if (fieldtype == SQLBYTES || fieldtype == SQLTEXT) { - - bid_b = Ifx_Result->res_id[locind]; - - if ((locator_b = php_intifx_get_blobloc(bid_b, &EG(regular_list) TSRMLS_CC)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cant get BLOB from Result Set!"); - RETURN_FALSE; - } - - locind++; - - if (IFXG(blobinfile) == 0) { - php_intifx_init_blob(locator_b, BLMODE_INMEM, 1 TSRMLS_CC); - } else { - php_intifx_init_blob(locator_b, BLMODE_INFILE, 1 TSRMLS_CC); - } - - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*locator_b; - - } - } - - if (!Ifx_Result->isscroll) { - EXEC SQL FETCH :cursorid USING SQL DESCRIPTOR :descrpid; - } else { - if (fetch_pos == NULL) { - if (fetch_row != 0) { - EXEC SQL FETCH ABSOLUTE :fetch_row :cursorid USING SQL DESCRIPTOR :descrpid; - } else { - EXEC SQL FETCH NEXT :cursorid USING SQL DESCRIPTOR :descrpid; - } - } else { - if (!strcasecmp(fetch_pos, "NEXT")) { - EXEC SQL FETCH NEXT :cursorid USING SQL DESCRIPTOR :descrpid; - } else if (!strcasecmp(fetch_pos, "PREVIOUS")) { - EXEC SQL FETCH PREVIOUS :cursorid USING SQL DESCRIPTOR :descrpid; - } else if (!strcasecmp(fetch_pos, "FIRST")) { - EXEC SQL FETCH FIRST :cursorid USING SQL DESCRIPTOR :descrpid; - } else if (!strcasecmp(fetch_pos, "LAST")) { - EXEC SQL FETCH LAST :cursorid USING SQL DESCRIPTOR :descrpid; - } else if (!strcasecmp(fetch_pos, "CURRENT")) { - EXEC SQL FETCH CURRENT :cursorid USING SQL DESCRIPTOR :descrpid; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid positioning arg on fetch"); - } - } - } - - if (SQLCODE != -451) { - switch (ifx_check()) { - case IFX_ERROR: - IFXG(sv_sqlcode) = SQLCODE; - { - char *ifx_err = ifx_error(ifx); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch row on cursor %s (%s)", ifx_err, cursorid); - efree(ifx_err); - RETURN_FALSE; - } - break; - case IFX_NODATA: - RETURN_FALSE; - break; - default: - break; - } - } - Ifx_Result->rowid++; - - array_init(return_value); - num_fields = fieldcount; - - locind = 0; - for (i = 1; i <= num_fields; i++) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i - :fieldtype = TYPE, - :fieldname = NAME, - :fieldleng = LENGTH, - :indicator = INDICATOR; - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - p = fieldname; /* rtrim fieldname */ - while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; - *p = 0; - if (strcmp("(expression)", fieldname) == 0) { /* stored proc */ - sprintf(fieldname, "[Expr_%d]", i); - } - - if (indicator == -1) { /* NULL */ - if ((IFXG(textasvarchar) == 0 && fieldtype == SQLTEXT) || - (IFXG(byteasvarchar) == 0 && fieldtype == SQLBYTES)) { - bid_b = Ifx_Result->res_id[locind]; - /* call php_intifx_get_blobloc() to reset locator_b */ - locator_b = php_intifx_get_blobloc(bid_b, &EG(regular_list) TSRMLS_CC); - bid = php_intifx_copy_blob(bid_b, &EG(regular_list) TSRMLS_CC); - php_intifx_update_blob(bid,nullstr, strlen(nullstr), &EG(regular_list) TSRMLS_CC); - add_assoc_long(return_value, fieldname, bid); - ++locind; - php_intifx_release_blob(locator_b TSRMLS_CC); - continue; - } - if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES) -$ifdef HAVE_IFX_IUS; - || (fieldtype == SQLUDTFIXED) -$endif; - ) { - /* call php_intifx_get_blobloc() to reset locator_b */ - bid_b = Ifx_Result->res_id[locind]; - locator_b = php_intifx_get_blobloc(bid_b, &EG(regular_list) TSRMLS_CC); - ++locind; - php_intifx_release_blob(locator_b TSRMLS_CC); - } - add_assoc_string(return_value, fieldname, nullstr, DUP); - continue; - } /* NULL */ - - switch (fieldtype) { - case SQLSERIAL: - case SQLINT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int_data = DATA; - long_data = int_data; - sprintf(string_data, "%ld", long_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLSMINT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :short_data = DATA; - long_data = short_data; - sprintf(string_data, "%ld", long_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLDECIMAL: - case SQLMONEY: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :dec_data = DATA; - memset(string_data, 0x20, 64); - dectoasc(&dec_data, string_data, 63, -1); - for (p = string_data; *p != ' '; ++p) ; - *p = 0; - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLSMFLOAT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :float_data = DATA; - double_data = float_data; - sprintf(string_data, "%17.17g", double_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLFLOAT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :double_data = DATA; - sprintf(string_data, "%17.17g", double_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLDATE: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :date_data = DATA; - rdatestr(date_data, string_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLDTIME: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :dt_data = DATA; - dttoasc(&dt_data, string_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLINTERVAL: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :intvl_data = DATA; - intoasc(&intvl_data, string_data); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; -$ifdef HAVE_IFX_IUS; - case SQLSERIAL8: - case SQLINT8: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; - memset(string_data, ' ', sizeof(string_data)); - ifx_int8toasc(&int8_var, string_data, 200); - p = string_data; /* rtrim string_data */ - while ((*p != ' ') && (p < &string_data[sizeof(string_data) - 1])) ++p; - *p = 0; - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - case SQLLVARCHAR: - ifx_var_flag(&lvar_tmp, 1); - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :lvar_tmp = DATA; - fieldleng = ifx_var_getlen(&lvar_tmp); - if (fieldleng > 2) { /* fix by Alex Shepherd */ - fieldleng -= 2; - } - if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); - RETURN_FALSE; - } - memcpy(char_data, ifx_var_getdata(&lvar_tmp), fieldleng); - ifx_var_dealloc(&lvar_tmp); - add_assoc_stringl(return_value, fieldname, char_data, fieldleng, 0); - break; - case SQLBOOL: -$endif; - case SQLVCHAR: - case SQLNVCHAR: - case SQLCHAR: - case SQLNCHAR: - if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); - RETURN_FALSE; - } - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :char_data = DATA; - if (IFXG(charasvarchar) != 0 && (fieldtype == SQLCHAR || fieldtype == SQLNCHAR)) { - ldchar(char_data, fieldleng, char_data); - } - add_assoc_string(return_value, fieldname, char_data, DUP); - efree(char_data); - char_data = NULL; - break; -$ifdef HAVE_IFX_IUS; - case SQLUDTFIXED: - bid_b = Ifx_Result->res_id[locind]; - add_assoc_long(return_value, fieldname,bid_b); - bid = php_intifxus_new_slob(&EG(regular_list) TSRMLS_CC); - slocator = php_intifxus_get_slobloc(bid, &EG(regular_list) TSRMLS_CC); - EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA = :*slocator; - Ifx_Result->res_id[locind] = bid; - ++locind; - break; -$endif; - case SQLBYTES: - case SQLTEXT: - bid_b = Ifx_Result->res_id[locind]; - locator_b = php_intifx_get_blobloc(bid_b, &EG(regular_list) TSRMLS_CC); - ++locind; - - if (IFXG(blobinfile) == 0) { - php_intifx_init_blob(locator_b, BLMODE_INMEM, 0 TSRMLS_CC); - } else { - php_intifx_init_blob(locator_b, BLMODE_INFILE, 0 TSRMLS_CC); - } - - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA; - - /* work around for ESQL/C bug with NULL values and BLOBS */ - if ((locator_b->loc_status < 0) && (locator_b->loc_bufsize == 0)){ - locator_b->loc_indicator = -1; - } - - /* normal check for NULL values */ - if (locator_b->loc_indicator == -1) { - if ((IFXG(textasvarchar) == 0 && fieldtype == SQLTEXT) || - (IFXG(byteasvarchar) == 0 && fieldtype == SQLBYTES) - ) { - bid = php_intifx_copy_blob(bid_b, &EG(regular_list) TSRMLS_CC); - php_intifx_update_blob(bid,nullstr, strlen(nullstr), &EG(regular_list) TSRMLS_CC); - add_assoc_long(return_value, fieldname, bid); - php_intifx_release_blob(locator_b TSRMLS_CC); - break; - } - if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES) -$ifdef HAVE_IFX_IUS; - || (fieldtype == SQLUDTFIXED) -$endif; - ) { - add_assoc_string(return_value, fieldname, nullstr, DUP); - php_intifx_release_blob(locator_b TSRMLS_CC); - break; - } - } - - if (locator_b->loc_status < 0) { /* blob too large */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory (%d bytes) for blob", locator_b->loc_bufsize); - RETURN_FALSE; - } - - /* return blob as VARCHAR ? */ - /* note that in case of "blobinfile" */ - /* you get the file name */ - /* a new one for every row ! */ - if ((IFXG(textasvarchar) != 0 && fieldtype == SQLTEXT) || - (IFXG(byteasvarchar) != 0 && fieldtype == SQLBYTES) - ) { - char *content; - long lg; - - lg = php_intifx_get_blob(bid_b, &EG(regular_list), &content TSRMLS_CC); - if (content == NULL || lg < 0) { - add_assoc_string(return_value, fieldname, nullstr, DUP); - } else { - add_assoc_stringl(return_value, fieldname, content, lg, DUP); - } - - php_intifx_release_blob(locator_b TSRMLS_CC); - break; - } - - /* copy blob */ - bid = php_intifx_copy_blob(bid_b, &EG(regular_list) TSRMLS_CC); - - /* no, return as blob id */ - add_assoc_long(return_value, fieldname, bid); - php_intifx_release_blob(locator_b TSRMLS_CC); - break; - - default: - sprintf(string_data, "ESQL/C : %s : unsupported field type[%d]", fieldname, fieldleng); - add_assoc_string(return_value, fieldname, string_data, DUP); - break; - } - continue; - } -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_htmltbl_result(int resultid [, string htmltableoptions]) -** -** formats all rows of the resultid query into a html table -** the optional second argument is a string of tag options -** -** returns the number of rows printed or FALSE on error -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_htmltbl_result(resource resultid [, string htmltableoptions]) - Formats all rows of the resultid query into a html table */ -PHP_FUNCTION(ifx_htmltbl_result) -{ - zval **result, **arg2; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ - int fieldcount; /* field count */ - int i; /* an index */ - char fieldname[64]; /* fieldname */ - short fieldtype; /* field type */ - int fieldleng; /* field length */ -$ifdef HAVE_IFX_IUS; - ifx_int8_t int8_var; - lvarchar *lvar_tmp; -$endif; - short indicator; - int int_data; - char *char_data = NULL; - long date_data; - interval intvl_data = {0}; - datetime dt_data = {0}; - decimal dec_data = {0}; - short short_data; - float float_data; - double double_data; - loc_t *locator_b; -EXEC SQL END DECLARE SECTION; - - char *content; - char *copy_content; - long lg; - char *nullstr; - int num_fields; - char string_data[256]; - long long_data; - char *p; - int locind,bid_b; - char *table_options; - int moredata; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result) == FAILURE) { - RETURN_FALSE; - } - table_options = NULL; - break; - case 2: - if (zend_get_parameters_ex(2, &result, &arg2) == FAILURE) { - RETURN_FALSE; - } - table_options = (*arg2)->value.str.val; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - if (strcmp(Ifx_Result->cursorid, "") == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); - RETURN_FALSE; - } - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - fieldcount = Ifx_Result->numcols; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - /* try to fetch the first row */ - EXEC SQL FETCH :cursorid USING SQL DESCRIPTOR :descrpid; - switch (ifx_check()) { - case IFX_ERROR: - IFXG(sv_sqlcode) = SQLCODE; - { - char *ifx_err = ifx_error(ifx); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_err, cursorid); - efree(ifx_err); - } - RETURN_FALSE; - break; - case IFX_NODATA: - moredata = 0; - break; - default: - Ifx_Result->rowid = moredata = 1; - break; - } - - if (!moredata) { - php_printf("

No rows found

\n"); - RETURN_LONG(0); - } - num_fields = fieldcount; - nullstr = php_intifx_null(TSRMLS_C); - - /* start table tag */ - if (table_options == NULL) { - php_printf("
"); - } else { - php_printf("
", table_options); - } - - /* table headings */ - for (i = 1; i <= num_fields; i++) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - p = fieldname; /* Capitalize and rtrim fieldname */ - *p = toupper(*p); - while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; - *p = 0; - if (strcmp("(expression)", fieldname) == 0) { /* stored proc */ - sprintf(fieldname, "[Expr_%d]", i); - } - php_printf("", fieldname); - } - php_printf("\n"); - - /* start spitting out rows untill none left */ - while (moredata) { - php_printf(""); - locind = 0; - for (i = 1; i <= num_fields; i++) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i - :fieldtype = TYPE, - :fieldleng = LENGTH, - :indicator = INDICATOR; - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - if (indicator == -1) { /* NULL */ - if (fieldtype == SQLTEXT || fieldtype == SQLBYTES) { - ++locind; - } - php_printf("", nullstr); - continue; - } - - switch (fieldtype) { - case SQLSERIAL: - case SQLINT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int_data = DATA; - long_data = int_data; - sprintf(string_data, "%ld", long_data); - php_printf("", string_data); - break; - case SQLSMINT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :short_data = DATA; - long_data = short_data; - sprintf(string_data, "%ld", long_data); - php_printf("", string_data); - break; - case SQLDECIMAL: - case SQLMONEY: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :dec_data = DATA; - memset(string_data, 0x20, 64); - dectoasc(&dec_data, string_data, 63, -1); - for (p = string_data; *p != ' '; ++p) ; - *p = 0; - php_printf("", string_data); - break; - case SQLSMFLOAT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :float_data = DATA; - double_data = float_data; - sprintf(string_data, "%17.17g", double_data); - php_printf("", string_data); - break; - case SQLFLOAT: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :double_data = DATA; - sprintf(string_data, "%17.17g", double_data); - php_printf("", string_data); - break; - case SQLDATE: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :date_data = DATA; - rdatestr(date_data, string_data); - php_printf("", string_data); - break; - case SQLDTIME: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :dt_data = DATA; - dttoasc(&dt_data, string_data); - php_printf("", string_data); - break; - case SQLINTERVAL: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :intvl_data = DATA; - intoasc(&intvl_data, string_data); - php_printf("", string_data); - break; -$ifdef HAVE_IFX_IUS; - case SQLSERIAL8: - case SQLINT8: - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; - memset(string_data, ' ', sizeof(string_data)); - ifx_int8toasc(&int8_var, string_data, 200); - p = string_data; /* rtrim string_data */ - while ((*p != ' ') && (p < &string_data[sizeof(string_data) - 1])) ++p; - *p = 0; - php_printf("", string_data); - break; - case SQLLVARCHAR: - ifx_var_flag(&lvar_tmp, 1); - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :lvar_tmp = DATA; - fieldleng = ifx_var_getlen(&lvar_tmp); - if (fieldleng > 2) { /* fix by Alex Shepherd */ - fieldleng -= 2; - } - if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); - RETURN_FALSE; - } - memcpy(char_data, ifx_var_getdata(&lvar_tmp), fieldleng); - ifx_var_dealloc(&lvar_tmp); - add_assoc_stringl(return_value, fieldname, char_data, fieldleng, 0); - break; - case SQLBOOL: -$endif; - case SQLCHAR: - case SQLVCHAR: - case SQLNCHAR: - case SQLNVCHAR: - if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); - RETURN_FALSE; - } - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :char_data = DATA; - if (IFXG(charasvarchar) != 0 && (fieldtype == SQLCHAR || fieldtype == SQLNCHAR)) { - ldchar(char_data, fieldleng, char_data); - } - php_printf("", char_data); - efree(char_data); - char_data = NULL; - break; - case SQLTEXT : - /* treated always as a long VARCHAR here */ - /* if blobinbfile, too bad */ - bid_b = Ifx_Result->res_id[locind]; - ++locind; - locator_b = php_intifx_get_blobloc(bid_b, &EG(regular_list) TSRMLS_CC); - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA; - - /* work around for ESQL/C bug with NULL values and BLOBS */ - if ((locator_b->loc_status < 0) && (locator_b->loc_bufsize == 0)){ - locator_b->loc_indicator = -1; - } - - /* normal check for NULL values */ - if (locator_b->loc_indicator == -1) { - if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES) -$ifdef HAVE_IFX_IUS; - || (fieldtype == SQLUDTFIXED) -$endif; - ) { - php_printf("", nullstr); - break; - } - } - if (locator_b->loc_status < 0) { /* blob too large */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough memory (%d bytes) for blob", locator_b->loc_bufsize); - RETURN_FALSE; - } - - /* get blob contents */ - lg = php_intifx_get_blob(bid_b, &EG(regular_list), &content TSRMLS_CC); - - if (content == NULL || lg < 0) { - php_printf("", nullstr); - } else { - /* need an extra byte for string terminator */ - copy_content = emalloc(lg + 1); - if (copy_content == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough memory for TEXT column"); - RETURN_FALSE; - } - memcpy(copy_content, content, lg); - copy_content[lg] = 0; - php_printf("", copy_content); - efree(copy_content); - } - break; - - case SQLBYTES : - ++locind; - php_printf(""); - break; - default : - sprintf(string_data, "ESQL/C: %s : unsupported field type[%d]", fieldname, fieldleng); - php_printf("", string_data); - break; - } - continue; - } - php_printf("\n"); - - /* fetch next row */ - EXEC SQL FETCH :cursorid USING SQL DESCRIPTOR :descrpid; - switch (ifx_check()) { - case IFX_ERROR: - IFXG(sv_sqlcode) = SQLCODE; - { - char *ifx_err = ifx_error(ifx); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_err, cursorid); - efree(ifx_err); - } - RETURN_FALSE; - break; - case IFX_NODATA: - moredata = 0; - break; - default: - break; - } /* switch() */ - Ifx_Result->rowid++; - } /* endwhile (moredata); */ - php_printf("
%s
%s%s%s%s%s%s%s%s%s%s%s%s%s%s(BYTE)%s
\n"); - RETURN_LONG(Ifx_Result->rowid); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** array ifx_fieldtypes(int resultid) -** -** returns an associative array with fieldnames as key -** and SQL fieldtypes as data for query $resultid -** -** returns FALSE on error -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto array ifx_fieldtypes(resource resultid) - Returns an associative array with fieldnames as key for query */ -PHP_FUNCTION(ifx_fieldtypes) -{ - zval **result; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ - int fieldcount; /* field count */ - int i; /* an index */ - char fieldname[64]; /* fieldname */ - short fieldtype; /* field type */ - char *char_data = NULL; -EXEC SQL END DECLARE SECTION; - int num_fields; - char *p; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - if (strcmp(Ifx_Result->cursorid, "") == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); - RETURN_FALSE; - } - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - fieldcount = Ifx_Result->numcols; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - array_init(return_value); - num_fields = fieldcount; - for (i = 1; i <= num_fields; i++) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME, :fieldtype = TYPE; - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - p = fieldname; /* rtrim fieldname */ - while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; - *p = 0; - if (strcmp("(expression)", fieldname) == 0) { /* stored proc */ - sprintf(fieldname, "[Expr_%d]", i); - } - - switch (fieldtype) { - case SQLSERIAL: - char_data = "SQLSERIAL"; - break; - case SQLINT: - char_data = "SQLINT"; - break; - case SQLSMINT: - char_data = "SQLSMINT"; - break; - case SQLDECIMAL: - char_data = "SQLDECIMAL"; - break; - case SQLMONEY: - char_data = "SQLMONEY"; - break; - case SQLSMFLOAT: - char_data = "SQLSMFLOAT"; - break; - case SQLFLOAT: - char_data = "SQLFLOAT"; - break; - case SQLDATE: - char_data = "SQLDATE"; - break; - case SQLDTIME: - char_data = "SQLDTIME"; - break; - case SQLINTERVAL: - char_data = "SQLINTERVAL"; - break; - case SQLCHAR: - char_data = "SQLCHAR"; - break; - case SQLVCHAR: - char_data = "SQLVCHAR"; - break; - case SQLNCHAR: - char_data = "SQLNCHAR"; - break; - case SQLNVCHAR: - char_data = "SQLNVCHAR"; - break; - case SQLTEXT: - char_data = "SQLTEXT"; - break; - case SQLBYTES: - char_data = "SQLBYTES"; - break; -$ifdef HAVE_IFX_IUS; - case SQLUDTFIXED: - char_data = "SQLUDTFIXED"; - break; - case SQLBOOL: - char_data = "SQLBOOL"; - break; - case SQLINT8: - char_data = "SQLINT8"; - break; - case SQLSERIAL8: - char_data = "SQLSERIAL8"; - break; - case SQLLVARCHAR: - char_data = "SQLLVARCHAR"; - break; -$endif; - default: - char_data = emalloc(20); - sprintf(char_data, "ESQL/C : %i", fieldtype); - break; - } /* switch (fieldtype) */ - - add_assoc_string(return_value, fieldname, char_data, DUP); - } /* for() */ -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** array ifx_fieldproperties(int resultid) -** -** returns an associative array with fieldnames as key -** and SQL fieldproperties as data for query $resultid -** -** properties are encoded as : "SQLTYPE;length;precision;scale;ISNULLABLE" -** where SQLTYPE = the Informix type like "SQLVCHAR" etc... -** ISNULLABLE = "Y" or "N" -** -** returns FALSE on error -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto array ifx_fieldproperties(resource resultid) - Returns an associative for query array with fieldnames as key */ -PHP_FUNCTION(ifx_fieldproperties) -{ - zval **result; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ - int fieldcount; /* field count */ - int i; /* an index */ - char fieldname[64]; /* fieldname */ - short fieldtype; /* field type */ - char *char_data = NULL; - int size; - int precision; - int scale; - int isnullable; -EXEC SQL END DECLARE SECTION; - int num_fields; - char string_data[256]; - char *p; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - if (strcmp(Ifx_Result->cursorid, "") == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); - RETURN_FALSE; - } - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - fieldcount = Ifx_Result->numcols; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - array_init(return_value); - num_fields = fieldcount; - - for (i = 1; i <= num_fields; i++) { - EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME, - :fieldtype = TYPE, - :size = LENGTH, - :precision = PRECISION, - :scale = SCALE, - :isnullable = NULLABLE; - - if (ifx_check() < 0) { - char *ifx_err = ifx_error(ifx); - IFXG(sv_sqlcode) = SQLCODE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err); - efree(ifx_err); - RETURN_FALSE; - } - - p = fieldname; /* rtrim fieldname */ - while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; - *p = 0; - if (strcmp("(expression)", fieldname) == 0) { /* stored proc */ - sprintf(fieldname, "[Expr_%d]", i); - } - - switch (fieldtype) { - case SQLSERIAL: - char_data = "SQLSERIAL"; - break; - case SQLINT: - char_data = "SQLINT"; - break; - case SQLSMINT: - char_data = "SQLSMINT"; - break; - case SQLDECIMAL: - char_data = "SQLDECIMAL"; - break; - case SQLMONEY: - char_data = "SQLMONEY"; - break; - case SQLSMFLOAT: - char_data = "SQLSMFLOAT"; - break; - case SQLFLOAT: - char_data = "SQLFLOAT"; - break; - case SQLDATE: - char_data = "SQLDATE"; - break; - case SQLDTIME: - char_data = "SQLDTIME"; - break; - case SQLINTERVAL: - char_data = "SQLINTERVAL"; - break; - case SQLCHAR: - char_data = "SQLCHAR"; - break; - case SQLVCHAR: - char_data = "SQLVCHAR"; - break; - case SQLTEXT: - char_data = "SQLTEXT"; - break; - case SQLBYTES: - char_data = "SQLBYTES"; - break; - case SQLNCHAR: - char_data = "SQLNCHAR"; - break; - case SQLNVCHAR: - char_data = "SQLNVCHAR"; - break; -$ifdef HAVE_IFX_IUS; - case SQLUDTFIXED: - char_data = "SQLUDTFIXED"; - break; - case SQLBOOL: - char_data = "SQLBOOL"; - break; - case SQLINT8: - char_data = "SQLINT8"; - break; - case SQLSERIAL8: - char_data = "SQLSERIAL8"; - break; - case SQLLVARCHAR: - char_data = "SQLLVARCHAR"; - break; -$endif; - default: - char_data = emalloc(20); - sprintf(char_data, "ESQL/C : %i", fieldtype); - break; - } /* switch (fieldtype) */ - - sprintf(string_data, "%s;%d;%d;%d;%c", char_data, size, precision, scale, (isnullable ? 'Y' : 'N')); - add_assoc_string(return_value, fieldname, string_data, DUP); - } /* for() */ -} -/* }}} */ - -/* -------------------------------------------------------------- -** int ifx_num_rows(int resultid) -** -** returns the number of rows already fetched for query resultid -** -** --------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_num_rows(resource resultid) - Returns the number of rows already fetched for query identified by resultid */ -PHP_FUNCTION(ifx_num_rows) -{ - zval **result; - IFX_RES *Ifx_Result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - RETURN_LONG(Ifx_Result->rowid); -} -/* }}} */ - -/* -------------------------------------------------------------- -** int ifx_getsqlca(int resultid) -** -** returns the sqlerrd[] fields of the sqlca struct for query resultid -** following the prepare (select) or execute immediate (insert/update/execute procedure) -** -** --------------------------------------------------------------- -*/ - -/* {{{ proto array ifx_getsqlca(resource resultid) - Returns the sqlerrd[] fields of the sqlca struct for query resultid */ -PHP_FUNCTION(ifx_getsqlca) -{ - zval **result; - IFX_RES *Ifx_Result; - char fieldname[16]; - int e; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - /* create pseudo-row array to return */ - array_init(return_value); - - /* fill array with 6 fields sqlerrd0 .. sqlerrd5 */ - /* each ESQLC call saves these sqlca values */ - for (e = 0; e < 6; e++) { - sprintf(fieldname, "sqlerrd%d", e); - add_assoc_long(return_value, fieldname, Ifx_Result->sqlerrd[e]); - } -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_num_fields(int resultid) -** -** returns the number of columns in query resultid -** or FALSE on error -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_num_fields(resource resultid) - Returns the number of columns in query resultid */ -PHP_FUNCTION(ifx_num_fields) -{ - zval **result; - IFX_RES *Ifx_Result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode) = 0; - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - RETURN_LONG(Ifx_Result->numcols); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifx_free_result(int resultid) -** -** releases resources for query associated with resultid -** -** returns FALSE on error -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_free_result(resource resultid) - Releases resources for query associated with resultid */ -PHP_FUNCTION(ifx_free_result) -{ - zval **result; - IFX_RES *Ifx_Result; - -EXEC SQL BEGIN DECLARE SECTION; - char *ifx; /* connection ID */ - char *cursorid; /* query cursor id */ - char *statemid; /* statement id */ - char *descrpid; /* descriptor id */ -EXEC SQL END DECLARE SECTION; - - int i; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - IFXG(sv_sqlcode = 0); - - ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); - - for (i = 0; i < MAX_RESID; ++i) { - if (Ifx_Result->res_id[i] > 0) { - zend_list_delete(Ifx_Result->res_id[i]); - Ifx_Result->res_id[i] = -1; - } - } - - ifx = Ifx_Result->connecid; - cursorid = Ifx_Result->cursorid; - statemid = Ifx_Result->statemid; - descrpid = Ifx_Result->descrpid; - - EXEC SQL set connection :ifx; - PHP_IFX_CHECK_CONNECTION(ifx); - - EXEC SQL free :statemid; - if (strlen(cursorid) != 0) { - EXEC SQL CLOSE :cursorid; - EXEC SQL FREE :cursorid; - } - - EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; - - zend_list_delete(Z_RESVAL_PP(result)); - RETURN_TRUE; -} -/* }}} */ - - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_getType(long id, HashTable *list) - * - * returns the type of an id-object - * bid: Id of object - * list: internal hashlist of php - * - * return -1 on error otherwise the type: TYPE_BLTEXT, TYPE_BLBYTE, TYPE_SLOB - * ---------------------------------------------------------------------- -*/ -static long php_intifx_getType(long id, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_res; - int type; - - Ifx_res = (IFX_IDRES *) zend_list_find(id, &type); - if (type != le_idresult) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix id-result index", id); - return -1; - } - return Ifx_res->type; -} - -/* ---------------------------------------------------------------------- -** int ifx_create_blob(int type, int mode, string param) -** -** creates a blob-object -** type: 1=TEXT, 0=BYTE -** mode: blob-object holds 0=the content in memory, 1=content in file -** param: if mode=0: pointer to the content -** mode=1: pointer to the filestring -** return false on error otherwise the new Blob-Object-id -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_create_blob(int type, int mode, string param) - Creates a blob-object */ -PHP_FUNCTION(ifx_create_blob) -{ - zval **pmode, **pparam,**ptype; - long id; - long mode,type; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &ptype, &pmode, &pparam) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pmode); - convert_to_string_ex(pparam); - convert_to_long_ex(ptype); - - type = Z_LVAL_PP(ptype); - if (type != 0) { - type = TYPE_BLTEXT; - } - - mode = Z_LVAL_PP(pmode); - if (mode != 0) { - mode=BLMODE_INFILE; - } - - id = php_intifx_create_blob(type, mode, Z_STRVAL_PP(pparam), Z_STRLEN_PP(pparam), &EG(regular_list) TSRMLS_CC); - - if (id < 0) { - RETURN_FALSE; - } - RETURN_LONG(id); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list TSRMLS_DC) - * - * creates an blob-object for the PHP Resource list - * type: 1=TEXT, 0=BYTE - * mode: blob-object holds 0=the content in momory, 1=content in file - * param: if mode=0: pointer to the content - * mode=1: pointer to the filestring - * len: length of param - * list: internal hashlist of php - * return -1 on error otherwise the new Blob-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob; - - Ifx_blob=emalloc(sizeof(IFX_IDRES)); - if (Ifx_blob == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - - memset(Ifx_blob, 0, sizeof(IFX_IDRES)); - - if (type == 0 ) { - Ifx_blob->type = TYPE_BLBYTE; - } else { - Ifx_blob->type = TYPE_BLTEXT; - } - Ifx_blob->BLOB.mode = (int) mode; - - if (php_intifx_init_blob(&Ifx_blob->BLOB.blob_data, mode, 1 TSRMLS_CC) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - - if (mode == BLMODE_INMEM) { - if (len >= 0) { - char *content = emalloc(len); - if (content == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - memcpy(content,param,len); - Ifx_blob->BLOB.blob_data.loc_buffer = content; - Ifx_blob->BLOB.blob_data.loc_bufsize = len; - Ifx_blob->BLOB.blob_data.loc_size = len; - Ifx_blob->BLOB.blob_data.loc_oflags = 0; - } - } else { - - if (*param && param != "") { - - /* - * copy the filename in param to filename in loc_fname - * otherwise we'll unlink non-temporary files - * - * loc_fname gets filled by php_intifx_init_blob_infile - */ - if (Ifx_blob->BLOB.blob_data.loc_fname != NULL) { - if (php_copy_file(param, Ifx_blob->BLOB.blob_data.loc_fname TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create blob-resource file. File copy failed: %s", param); - return -1; - } - Ifx_blob->BLOB.blob_data.loc_size = -1; - } - } - } - - return zend_list_insert(Ifx_blob,le_idresult); -} - -static long php_intifx_init_blob(loc_t *blob, long mode, long new TSRMLS_DC) -{ - if (new) { - memset(blob, 0, sizeof(loc_t)); - } - - blob->loc_status = 0; - blob->loc_type = SQLTEXT; - blob->loc_xfercount = 0; - blob->loc_indicator = 0; - - if (mode == BLMODE_INMEM) { - return php_intifx_init_blob_inmem(blob, new TSRMLS_CC); - } else { - return php_intifx_init_blob_infile(blob, new TSRMLS_CC); - } - - return 1; -} - -static long php_intifx_init_blob_inmem(loc_t *blob, long new TSRMLS_DC) -{ - blob->loc_loctype = LOCMEMORY; - - if (new) { - blob->loc_buffer = NULL; - blob->loc_bufsize = -1; - blob->loc_size = 0; - } - - blob->loc_mflags = 0; - blob->loc_oflags = 0; - - return 1; -} - -static long php_intifx_init_blob_infile(loc_t *blob, long new TSRMLS_DC) -{ - char *filename; - - blob->loc_loctype = LOCFNAME; - - if (new) { - - filename = php_intifx_create_tmpfile(TSRMLS_C); - - if (filename == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - - blob->loc_fname = filename; - blob->loc_size = 0; - blob->loc_fd = -1; - } - - return 1; -} - -static void php_intifx_release_blob(loc_t *blob TSRMLS_DC) -{ - -#if IFX_VERSION < 724 /* this Informix memory leak is fixed from 7.24 on */ - /* according to the current PERL DBD::Informix */ - /* and otherwise I get segmenation violations with 7.30 */ - - /* Not set to NULL, so function will free resources */ -#else - /* Set to NULL so php_intifx_release_blob() doens't try to free stuff it shouldn't */ - - if (blob->loc_loctype == LOCMEMORY) { - blob->loc_buffer = NULL; - } -#endif - - switch (blob->loc_loctype) { - - case LOCMEMORY: - if (blob->loc_buffer != NULL) { - efree(blob->loc_buffer); - blob->loc_buffer = NULL; - } - break; - - case LOCFNAME: - if (blob->loc_fd >= 0) { - close(blob->loc_fd); - } - blob->loc_fd = -1; - - if (blob->loc_fname != NULL) { - unlink(blob->loc_fname); - efree(blob->loc_fname); - blob->loc_fname = NULL; - } - break; - - case LOCFILE: - case LOCUSER: - default: - break; - } -} - - -/* ---------------------------------------------------------------------- -** int ifx_copy_blob(int bid) -** -** duplicates the given blob-object -** bid: Id of Blobobject -** -** return false on error otherwise the new Blob-Object-id -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_copy_blob(int bid) - Duplicates the given blob-object */ -PHP_FUNCTION(ifx_copy_blob) -{ - zval **pbid; - long newid; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - - newid = php_intifx_copy_blob(Z_LVAL_PP(pbid), &EG(regular_list) TSRMLS_CC); - - if (newid < 0) { - RETURN_FALSE; - } - RETURN_LONG(newid); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_copy_blob(long bid, HashTable *list) - * - * duplicates the given blob-object in the PHP resource list - * bid: Id of Blobobject - * list: internal hashlist of php - * - * return -1 on error otherwise the new Blob-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob, *Ifx_blob_orig; - loc_t *locator, *locator_orig; - int type; - - Ifx_blob_orig = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || !(Ifx_blob_orig->type == TYPE_BLBYTE || Ifx_blob_orig->type == TYPE_BLTEXT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); - return -1; - } - - Ifx_blob = emalloc(sizeof(IFX_IDRES)); - if (Ifx_blob == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - - memset(Ifx_blob, 0, sizeof(IFX_IDRES)); - - Ifx_blob->type = Ifx_blob_orig->type; - Ifx_blob->BLOB.mode = Ifx_blob_orig->BLOB.mode; - - locator = &(Ifx_blob->BLOB.blob_data); - locator_orig = &(Ifx_blob_orig->BLOB.blob_data); - - if (php_intifx_init_blob(locator, Ifx_blob->BLOB.mode, 1 TSRMLS_CC) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - - if (Ifx_blob->BLOB.mode == BLMODE_INMEM) { - char *content; - if (locator_orig->loc_bufsize >= 0 && locator_orig->loc_buffer != NULL) { - if ((content = emalloc(locator_orig->loc_bufsize)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - memcpy(content,locator_orig->loc_buffer, locator_orig->loc_bufsize); - locator->loc_buffer = content; - locator->loc_bufsize = locator_orig->loc_bufsize; - locator->loc_size = locator_orig->loc_size; - } - } else { /* BLMODE_INFILE */ - - if (locator_orig->loc_size) { - php_copy_file(locator_orig->loc_fname, locator->loc_fname TSRMLS_CC); - } - - } - - return zend_list_insert(Ifx_blob, le_idresult); -} - -/* ---------------------------------------------------------------------- -** int ifx_free_blob(int bid) -** -** deletes the blob-object -** bid: Id of Blobobject -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_free_blob(int bid) - Deletes the blob-object */ -PHP_FUNCTION(ifx_free_blob) -{ - zval **pid; - long ret; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pid); - - ret = php_intifx_free_blob(Z_LVAL_PP(pid), &EG(regular_list) TSRMLS_CC); - if (ret < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_free_blob(long bid, HashTable *list) - * - * deletes the blob-object from the PHP Resource List - * bid: Id of Blobobject - * list: internal hashlist of php - * - * return -1 on error otherwise 0 - * FREES BYTE-MEMORY WITH EFREE() - * ---------------------------------------------------------------------- -*/ -static long php_intifx_free_blob(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob; - int type; - - Ifx_blob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_blob->type == TYPE_BLTEXT || Ifx_blob->type == TYPE_BLBYTE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); - return -1; - } - - if (!(Ifx_blob->type == TYPE_BLTEXT || Ifx_blob->type == TYPE_BLBYTE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix BYTE or TEXT type", bid); - return -1; - } - - zend_list_delete(bid); - - return 0; -} - -/* ---------------------------------------------------------------------- -** string ifx_get_blob(int bid) -** -** returns the content of the blob-object -** bid: Id of Blobobject -** return the content -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto string ifx_get_blob(int bid) - Returns the content of the blob-object */ -PHP_FUNCTION(ifx_get_blob) -{ - zval **pbid; - char *content; - long len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - - len = php_intifx_get_blob(Z_LVAL_PP(pbid), &EG(regular_list), &content TSRMLS_CC); - if (content == NULL || len < 0) { - RETURN_STRING(php_intifx_null(TSRMLS_C), 1); - } - RETURN_STRINGL(content, len, 1); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_get_blob(long bid, HashTable *list, char** content) - * - * returns the content of the blob-object - * bid: Id of Blobobject - * list: internal hashlist of php - * - * return -1 on error - * returns the pointer to the content in char** content and the amount of content in bytes - * ---------------------------------------------------------------------- -*/ -static long php_intifx_get_blob(long bid, HashTable *list, char** content TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob; - int type; - - Ifx_blob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_blob->type == TYPE_BLTEXT || Ifx_blob->type == TYPE_BLBYTE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); - return -1; - } - - if (Ifx_blob->BLOB.mode == BLMODE_INMEM) { - *content = Ifx_blob->BLOB.blob_data.loc_buffer; - return Ifx_blob->BLOB.blob_data.loc_size; - } - *content = Ifx_blob->BLOB.blob_data.loc_fname; - return strlen(Ifx_blob->BLOB.blob_data.loc_fname); -} - -/* ---------------------------------------------------------------------- - * internal function - * loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC) - * - * returns the blob-locator-structur - * bid: Id of Blobobject - * list: internal hashlist of php - * return NULL on error or the pointer to the locator-structur - * ---------------------------------------------------------------------- -*/ -static loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob; - int type; - - Ifx_blob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_blob->type == TYPE_BLTEXT || Ifx_blob->type == TYPE_BLBYTE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); - return NULL; - } - return &(Ifx_blob->BLOB.blob_data); -} - - -/* ---------------------------------------------------------------------- -** int update_blob(int bid, string content) -** -** updates the content of the blob-object -** bid: Id of Blobobject -** content: string of new data -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_update_blob(int bid, string content) - Updates the content of the blob-object */ -PHP_FUNCTION(ifx_update_blob) -{ - zval **pbid, **pparam; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pbid, &pparam) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - convert_to_string_ex(pparam); - - if (php_intifx_update_blob(Z_LVAL_PP(pbid), Z_STRVAL_PP(pparam), Z_STRLEN_PP(pparam), &EG(regular_list) TSRMLS_CC) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_update_blob(long bid, char* param, long len, HashTable *list) - * - * updates the content of the blob-object - * bid: Id of Blobobject - * param: string of new data - * len: length of string - * list: internal hashlist of php - * return nothing - * ---------------------------------------------------------------------- -*/ -static long php_intifx_update_blob(long bid, char* param, long len, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_blob; - int type; - - Ifx_blob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_blob->type == TYPE_BLTEXT || Ifx_blob->type == TYPE_BLBYTE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); - return -1; - } - - if (Ifx_blob->BLOB.mode == BLMODE_INMEM) { - char *content; - - if (Ifx_blob->BLOB.blob_data.loc_buffer != NULL) { - efree(Ifx_blob->BLOB.blob_data.loc_buffer); - } - if (len >= 0) { - if ((content = emalloc(len)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - memcpy(content, param, len); - Ifx_blob->BLOB.blob_data.loc_buffer = content; - Ifx_blob->BLOB.blob_data.loc_bufsize = len; - Ifx_blob->BLOB.blob_data.loc_size = len; - } else { - Ifx_blob->BLOB.blob_data.loc_buffer = NULL; - Ifx_blob->BLOB.blob_data.loc_bufsize = -1; - Ifx_blob->BLOB.blob_data.loc_size = -1; - } - Ifx_blob->BLOB.blob_data.loc_mflags = 0; - Ifx_blob->BLOB.blob_data.loc_oflags = 0; - } else { - char *filename; - - if (Ifx_blob->BLOB.blob_data.loc_fname != NULL) { - efree(Ifx_blob->BLOB.blob_data.loc_fname); - } - if ((filename = emalloc(len + 1)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); - return -1; - } - memcpy(filename, param, len); - filename[len] = 0; - Ifx_blob->BLOB.blob_data.loc_fname = filename; - Ifx_blob->BLOB.blob_data.loc_size = -1; - } - return 0; -} - -/*------------------------------------------------- - * internal function - * - * php_intifx_create_tmpfile(TSRMLS_D) - * creates a temporary file to store a blob in - *------------------------------------------------- -*/ -static char* php_intifx_create_tmpfile(TSRMLS_D) -{ - char filename[10]; - char *blobdir; - char *retval; - char *opened_path; - FILE *fp; - - if ((blobdir = getenv("php_blobdir")) == NULL) { - blobdir = "."; - } - - sprintf(filename, "blb"); - - if ((fp = php_open_temporary_file(blobdir, filename, &opened_path TSRMLS_CC))) { - fclose(fp); - retval = estrndup(opened_path, strlen(opened_path)); - efree(opened_path); - } else { - retval = NULL; - } - return retval; -} - -/* ---------------------------------------------------------------------- - * int php_intifx_alloc_ibind(IFX_RES *Ifx_Result, int items TSRMLS_DC) - * - * Allocates descriptors for input parameters - * return 0 for error. 1 for ok - * ---------------------------------------------------------------------- -*/ -static long php_intifx_alloc_ibind(IFX_RES *Ifx_Result, int items TSRMLS_DC) -{ - EXEC SQL BEGIN DECLARE SECTION; - char *i_bind = Ifx_Result->i_descrpid; - int bind_size = items; - EXEC SQL END DECLARE SECTION; - - if (items > Ifx_Result->numicols) { - - if (Ifx_Result->numicols > 0) { - EXEC SQL DEALLOCATE DESCRIPTOR :i_bind; - if (ifx_check() < 0) { - return 0; - } - } - - EXEC SQL ALLOCATE DESCRIPTOR :i_bind WITH MAX :bind_size; - if (ifx_check() < 0) { - return 0; - } - - Ifx_Result->numicols = items; - } - - return 1; -} - -/* ---------------------------------------------------------------------- - * int php_intifx_preparse(char *statement TSRMLS_DC) - * - * Count the placeholders (?) parameters in the statement - * return -1 for error. 0 or number of question marks - * - * Thanks to DBD-Informix - * - * ---------------------------------------------------------------------- -*/ -static long php_intifx_preparse(char *statement TSRMLS_DC) -{ - char end_quote = '\0'; - char *src; - char *dst; - int idx = 0; - int style = 0; - int laststyle = 0; - char ch; - - src = statement; - dst = statement; - - while ((ch = *src++) != '\0') { - if (ch == end_quote) { - end_quote = '\0'; - } else if (end_quote != '\0') { - *dst++ = ch; - continue; - } else if (ch == '\'' || ch == '\"') { - end_quote = ch; - } else if (ch == '{') { - end_quote = '}'; - } else if (ch == '-' && *src == '-') { - end_quote = '\n'; - } - - if (ch == '?') { - /* X/Open standard */ - *dst++ = '?'; - idx++; - style = 3; - } else { - /* Perhaps ':=' PL/SQL construct or dbase:table in Informix */ - /* Or it could be :2 or :22 as part of a DATETIME/INTERVAL */ - *dst++ = ch; - continue; - } - - if (laststyle && style != laststyle) { - return -1; - } - laststyle = style; - } - - *dst = '\0'; - return(idx); -} - -/* ---------------------------------------------------------------------- - * int php_intifx_count_descriptors(char *p_statemid TSRMLS_DC) - * - * count the number of descriptors allocated for a certain statement - * return 384 or number of descriptors - * ---------------------------------------------------------------------- -*/ -static long php_intifx_count_descriptors(char *p_statemid TSRMLS_DC) -{ - EXEC SQL BEGIN DECLARE SECTION; - char *statemid = p_statemid; - EXEC SQL END DECLARE SECTION; - - struct sqlda *s_da; - int ret = 384; - - EXEC SQL DESCRIBE :statemid INTO s_da; - - if (ifx_check() >= 0) { - - ret = s_da->sqld; - - /* - * Thanks to DBD-Informix - */ - -#if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600)) - SqlFreeMem(s_da, SQLDA_FREE); - } else { - free(s_da); -#endif - } - - return ret; -} - -/* ---------------------------------------------------------------------- -** void ifx_blobinfile_mode(int mode) -** -** sets the default blob-mode for all select-queries -** mode=0: save Byte-Blobs in momory -** mode=1: save Byte-Blobs in a file -** return nothing -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_blobinfile_mode(int mode) - Sets the default blob-mode for all select-queries */ -PHP_FUNCTION(ifx_blobinfile_mode) -{ - zval **pmode; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pmode); - - IFXG(blobinfile) = Z_LVAL_PP(pmode); - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** void ifx_textasvarchar(int mode) -** -** sets the default text-mode for all select-queries -** mode=0: select returns a blob-id -** mode=1: select returns a varchar with text-content -** return nothing -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_textasvarchar(int mode) - Sets the default text-mode for all select-queries */ -PHP_FUNCTION(ifx_textasvarchar) -{ - zval **pmode; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pmode); - - IFXG(textasvarchar) = Z_LVAL_PP(pmode); - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** void ifx_byteasvarchar(int mode) -** -** sets the default byte-mode for all select-queries -** mode=0: select returns a blob-id -** mode=1: select returns a varchar with byte-content -** return nothing -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_byteasvarchar(int mode) - Sets the default byte-mode for all select-queries */ -PHP_FUNCTION(ifx_byteasvarchar) -{ - zval **pmode; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pmode); - - IFXG(byteasvarchar) = Z_LVAL_PP(pmode); - RETURN_TRUE; -} - -/* ---------------------------------------------------------------------- -** void ifx_nullformat(int mode) -** -** sets the default return value of a NULL-value on a fetch-row -** mode=0: return "" -** mode=1: return "NULL" -** return nothing -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_nullformat(int mode) - Sets the default return value of a NULL-value on a fetch-row */ -PHP_FUNCTION(ifx_nullformat) -{ - zval **pmode; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pmode); - - IFXG(nullformat) = Z_LVAL_PP(pmode); - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * void php_intifx_null() - * - * return the NULL-string depending on .nullformat - * return "" or "NULL" - * ---------------------------------------------------------------------- -*/ -static char* php_intifx_null(TSRMLS_D) -{ - char* tmp; - - if (IFXG(nullformat) == 0) { - tmp = IFXG(nullvalue); - } else { - tmp = IFXG(nullstring); - } - return tmp; -} - -/* ---------------------------------------------------------------------- -** int ifx_create_char(string param) -** -** creates an char-object -** param: content -** return false on error otherwise the new char-Object-id -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifx_create_char(string param) - Creates a char-object */ -PHP_FUNCTION(ifx_create_char) -{ - zval **pparam; - long id; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pparam) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pparam); - - id = php_intifx_create_char(Z_STRVAL_PP(pparam), Z_STRLEN_PP(pparam), &EG(regular_list) TSRMLS_CC); - - if (id < 0) { - RETURN_FALSE; - } - RETURN_LONG(id); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS_DC) - * - * creates an char-object - * param: content - * len: length of param - * list: internal hashlist of php - * return -1 on error otherwise the new char-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_char; - - Ifx_char = emalloc(sizeof(IFX_IDRES)); - if (Ifx_char == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); - return -1; - } - - Ifx_char->type = TYPE_CHAR; - - if (param == NULL || len < 0) { - Ifx_char->CHAR.char_data = NULL; - Ifx_char->CHAR.len = 0; - } else { - Ifx_char->CHAR.char_data = emalloc(len + 1); - if (Ifx_char->CHAR.char_data == NULL) { - efree(Ifx_char); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); - return -1; - } - memcpy(Ifx_char->CHAR.char_data, param,len); - Ifx_char->CHAR.char_data[len] = 0; - Ifx_char->CHAR.len = len; - } - return zend_list_insert(Ifx_char, le_idresult); -} - -/* ---------------------------------------------------------------------- -** string ifx_get_char(int bid) -** -** returns the content of the char-object -** bid: Id of charobject -** return the content -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto string ifx_get_char(int bid) - Returns the content of the char-object */ -PHP_FUNCTION(ifx_get_char) -{ - zval **pbid; - char *content; - long len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - - len = php_intifx_get_char(Z_LVAL_PP(pbid), &EG(regular_list), &content TSRMLS_CC); - if (content == NULL || len < 0) { - RETURN_STRING("", 1); - } - RETURN_STRINGL(content, len, 1); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_get_char(long bid, HashTable *list, char** content) - * - * returns the content of the char-object - * bid: Id of charobject - * list: internal hashlist of php - * - * return -1 on error - * returns the pointer to the content in char** content and the amount of content in bytes - * ---------------------------------------------------------------------- -*/ - -static long php_intifx_get_char(long bid, HashTable *list, char** content TSRMLS_DC) -{ - IFX_IDRES *Ifx_char; - int type; - - Ifx_char = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_char->type == TYPE_CHAR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); - return -1; - } - - *content = Ifx_char->CHAR.char_data; - return Ifx_char->CHAR.len; -} - -/* ---------------------------------------------------------------------- -** int ifx_free_char(int bid) -** -** deletes the char-object -** bid: Id of charobject -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_free_char(int bid) - Deletes the char-object */ -PHP_FUNCTION(ifx_free_char) -{ - zval **pid; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pid); - - if (php_intifx_free_char(Z_LVAL_PP(pid), &EG(regular_list) TSRMLS_CC) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_free_char(long bid, HashTable *list TSRMLS_DC) - * - * deletes the char-object - * bid: Id of Charobject - * list: internal hashlist of php - * - * return -1 on error otherwise 0 - * ---------------------------------------------------------------------- -*/ -static long php_intifx_free_char(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_char; - int type; - - Ifx_char = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_char->type == TYPE_CHAR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); - return -1; - } - - if (Ifx_char->CHAR.char_data != NULL) { - efree(Ifx_char->CHAR.char_data); - } - zend_list_delete(bid); - efree(Ifx_char); - return 0; -} - -/* ---------------------------------------------------------------------- -** int ifx_update_char(int bid, string content) -** -** updates the content of the char-object -** bid: Id of charobject -** content: string of new data -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifx_update_char(int bid, string content) - Updates the content of the char-object */ -PHP_FUNCTION(ifx_update_char) -{ - zval **pbid, **pparam; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pbid, &pparam) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - convert_to_string_ex(pparam); - - if (php_intifx_update_char(Z_LVAL_PP(pbid), Z_STRVAL_PP(pparam), Z_STRLEN_PP(pparam), &EG(regular_list) TSRMLS_CC) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_update_char(long bid, char* param, long len, HashTable *list) - * - * updates the content of the char-object - * bid: Id of charobject - * param: string of new data - * len: length of string - * list: internal hashlist of php - * return nothing - * ---------------------------------------------------------------------- -*/ -static long php_intifx_update_char(long bid, char* param, long len, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_char; - int type; - - Ifx_char = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult && !(Ifx_char->type == TYPE_CHAR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); - return -1; - } - - if (Ifx_char->CHAR.char_data != NULL) { - efree(Ifx_char->CHAR.char_data); - } - Ifx_char->CHAR.char_data = NULL; - Ifx_char->CHAR.len = 0; - - if (param == NULL || len < 0) { - Ifx_char->CHAR.char_data = NULL; - Ifx_char->CHAR.len = 0; - } else { - Ifx_char->CHAR.char_data = emalloc(len + 1); - if (Ifx_char->CHAR.char_data == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); - return -1; - } - memcpy(Ifx_char->CHAR.char_data, param,len); - Ifx_char->CHAR.char_data[len] = 0; - Ifx_char->CHAR.len = len; - } - return 0; -} - -$ifdef HAVE_IFX_IUS; - -/* ---------------------------------------------------------------------- -** int ifxus_create_slob(int mode) -** -** creates an slob-object and opens it -** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER -> or-mask -** return false on error otherwise the new Slob-Object-id -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifxus_create_slob(int mode) - Creates a slob-object and opens it */ -PHP_FUNCTION(ifxus_create_slob) -{ - zval **pmode; - long id; - long mode, create_mode; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pmode); - mode = Z_LVAL_PP(pmode); - - create_mode = 0; - if ((mode & 1) != 0) { - create_mode |= LO_RDONLY; - } - if ((mode & 2) != 0) { - create_mode |= LO_WRONLY; - } - if ((mode & 4) != 0) { - create_mode |= LO_APPEND; - } - if ((mode & 8) != 0) { - create_mode |= LO_RDWR; - } - if ((mode & 16) != 0) { - create_mode |= LO_BUFFER; - } - if ((mode & 32) != 0) { - create_mode |= LO_NOBUFFER; - } - - id = php_intifxus_create_slob(create_mode, &EG(regular_list) TSRMLS_CC); - - if (id < 0) { - RETURN_FALSE; - } - RETURN_LONG(id); -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifx_create_slob(long create_mode, HashTable *list TSRMLS_DC) - * - * creates an slob-object and opens it - * mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER -> or-mask - * list: internal hashlist of php - * return -1 on error otherwise the new Blob-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifxus_create_slob(long create_mode, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - int errcode; - - Ifx_slob = emalloc(sizeof(IFX_IDRES)); - if (Ifx_slob == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource"); - return -1; - } - - errcode = ifx_lo_def_create_spec(&(Ifx_slob->SLOB.createspec)); - if (errcode < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource: %d", errcode); - return -1; - } - - Ifx_slob->type = TYPE_SLOB; - Ifx_slob->SLOB.lofd = ifx_lo_create(Ifx_slob->SLOB.createspec, create_mode, &(Ifx_slob->SLOB.slob_data), &errcode); - if (errcode < 0 || Ifx_slob->SLOB.lofd < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource: %d", errcode); - return -1; - } - return zend_list_insert(Ifx_slob, le_idresult); -} - -/* ---------------------------------------------------------------------- -** int ifxus_free_slob(int bid) -** -** deletes the slob-object -** bid: Id of Slobobject -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifxus_free_slob(int bid) - Deletes the slob-object */ -PHP_FUNCTION(ifxus_free_slob) -{ - zval **pid; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pid); - - if (php_intifxus_free_slob(Z_LVAL_PP(pid), &EG(regular_list) TSRMLS_CC) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifxus_free_slob(long bid, HashTable *list) - * - * deletes the slob-object - * bid: Id of Slobobject - * list: internal hashlist of php - * - * return -1 on error otherwise 0 - * ---------------------------------------------------------------------- -*/ -static long php_intifxus_free_slob(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - int type; - - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - return -1; - } - - if (php_intifxus_close_slob(bid, &EG(regular_list) TSRMLS_CC) < 0) { - return -1; - } - - if (Ifx_slob->SLOB.createspec != NULL) { - ifx_lo_spec_free(Ifx_slob->SLOB.createspec); - Ifx_slob->SLOB.createspec = NULL; - } - efree(Ifx_slob); - zend_list_delete(bid); - return 0; -} - -/* ---------------------------------------------------------------------- -** int ifxus_close_slob(int bid) -** -** deletes the slob-object -** bid: Id of Slobobject -** return false on error otherwise true -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto bool ifxus_close_slob(int bid) - Deletes the slob-object */ -PHP_FUNCTION(ifxus_close_slob) -{ - zval **pid; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pid); - - if (php_intifxus_close_slob(Z_LVAL_PP(pid), &EG(regular_list) TSRMLS_CC) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifxus_close_slob(long bid, HashTable *list) - * - * deletes the slob-object - * bid: Id of Slobobject - * list: internal hashlist of php - * - * return -1 on error otherwise 0 - * ---------------------------------------------------------------------- -*/ -static long php_intifxus_close_slob(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - int type; - - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - return -1; - } - - if (Ifx_slob->SLOB.lofd < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Slob-resource already closed"); - return -1; - } - - if (ifx_lo_close(Ifx_slob->SLOB.lofd) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't close slob-resource"); - return -1; - } - Ifx_slob->SLOB.lofd = -1; - return 0; -} - -/* ---------------------------------------------------------------------- -** int ifxus_open_slob(long bid, int mode) -** -** opens an slob-object -** bid: existing slob-id -** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER -> or-mask -** return false on error otherwise the new Slob-Object-id -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifxus_open_slob(int bid, int mode) - Opens an slob-object */ -PHP_FUNCTION(ifxus_open_slob) -{ - zval **pbid, **pmode; - long mode,create_mode; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(1, &pbid, &pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pmode); - convert_to_long_ex(pbid); - - mode = Z_LVAL_PP(pmode); - create_mode = 0; - if ((mode & 1) != 0) { - create_mode|=LO_RDONLY; - } - if ((mode & 2) != 0) { - create_mode|=LO_WRONLY; - } - if ((mode & 4) != 0) { - create_mode|=LO_APPEND; - } - if ((mode & 8) != 0) { - create_mode|=LO_RDWR; - } - if ((mode & 16) != 0) { - create_mode|=LO_BUFFER; - } - if ((mode & 32) != 0) { - create_mode|=LO_NOBUFFER; - } - - RETURN_LONG(php_intifxus_open_slob(Z_LVAL_PP(pbid), create_mode, &EG(regular_list) TSRMLS_CC)); -} -/* }}} */ - - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifxus_open_slob(long bid,long create_mode, HashTable *list) - * - * opens an slob-object - * mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER -> or-mask - * list: internal hashlist of php - * return -1 on error otherwise the new Blob-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifxus_open_slob(long bid, long create_mode, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - int errcode; - int type; - - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - return -1; - } - - if (Ifx_slob->SLOB.lofd > 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Slob-resource already open"); - return -1; - } - - Ifx_slob->SLOB.lofd = ifx_lo_open(&(Ifx_slob->SLOB.slob_data), create_mode, &errcode); - if (errcode < 0 || Ifx_slob->SLOB.lofd < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open slob-resource: %d", errcode); - return -1; - } - return 0; -} - -/* ---------------------------------------------------------------------- - * internal function - * long php_intifxus_new_slob(HashTable *list TSRMLS_DC) - * - * creates an slob-object but don't open it - * list: internal hashlist of php - * return -1 on error otherwise the new slob-Object-id - * ---------------------------------------------------------------------- -*/ -static long php_intifxus_new_slob(HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - - Ifx_slob = emalloc(sizeof(IFX_IDRES)); - if (Ifx_slob == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource"); - return -1; - } - - Ifx_slob->type = TYPE_SLOB; - Ifx_slob->SLOB.lofd = -1; - Ifx_slob->SLOB.createspec = NULL; - return zend_list_insert(Ifx_slob, le_idresult); -} - -/* ---------------------------------------------------------------------- - * internal function - * ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list) - * - * retuens the ifx_lo_t-structure of a slob-object - * list: internal hashlist of php - * return -1 on error otherwise the new Blob-Object-id - * ---------------------------------------------------------------------- -*/ -static ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list TSRMLS_DC) -{ - IFX_IDRES *Ifx_slob; - int type; - - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - return NULL; - } - return &(Ifx_slob->SLOB.slob_data); -} - -/* ---------------------------------------------------------------------- -** int ifxus_tell_slob(long bid) -** -** returns the current file or seek position of an open slob-object -** bid: existing slob-id -** return false on error otherwise the seek-position -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifxus_tell_slob(int bid) - Returns the current file or seek position of an open slob-object */ -PHP_FUNCTION(ifxus_tell_slob) -{ - zval **pbid; - long bid; - IFX_IDRES *Ifx_slob; - ifx_int8_t akt_seek_pos; - int type; - long lakt_seek_pos; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - bid = Z_LVAL_PP(pbid); - - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - RETURN_FALSE; - } - - if (ifx_lo_tell(Ifx_slob->SLOB.lofd, &akt_seek_pos) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't perform tell-operation"); - RETURN_FALSE; - } - - if (ifx_int8tolong(&akt_seek_pos, &lakt_seek_pos) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Seek-position to large for long"); - RETURN_FALSE; - } - RETURN_LONG(lakt_seek_pos); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifxus_seek_slob(long bid, int mode, long offset) -** -** sets the current file or seek position of an open slob-object -** bid: existing slob-id -** mode: 0=LO_SEEK_SET, 1=LO_SEEK_CUR, 2=LO_SEEK_END -** offset: byte-offset -** return false on error otherwise the seek-position -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifxus_seek_slob(int bid, int mode, long offset) - Sets the current file or seek position of an open slob-object */ -PHP_FUNCTION(ifxus_seek_slob) -{ - zval **pbid, **pmode, **poffset; - long bid,lakt_seek_pos; - IFX_IDRES *Ifx_slob; - ifx_int8_t akt_seek_pos, offset; - int type, mode; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &pbid, &pmode, &poffset) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - convert_to_long_ex(pmode); - convert_to_long_ex(poffset); - - bid = Z_LVAL_PP(pbid); - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - RETURN_FALSE; - } - - mode = LO_SEEK_SET; - if (Z_LVAL_PP(pmode) == 1) { - mode = LO_SEEK_CUR; - } - if (Z_LVAL_PP(pmode) == 2) { - mode = LO_SEEK_END; - } - - ifx_int8cvlong(Z_LVAL_PP(poffset), &offset); - if (ifx_lo_seek(Ifx_slob->SLOB.lofd, &offset, mode, &akt_seek_pos) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't perform seek-operation"); - RETURN_FALSE; - } - - if (ifx_int8tolong(&akt_seek_pos, &lakt_seek_pos) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Seek-position to large for long"); - RETURN_FALSE; - } - RETURN_LONG(lakt_seek_pos); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifxus_read_slob(long bid, long nbytes) -** -** reads nbytes of the slob-object -** bid: existing slob-id -** nbytes: bytes zu read -** return false on error otherwise the string -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto string ifxus_read_slob(int bid, int nbytes) - Reads nbytes of the slob-object */ -PHP_FUNCTION(ifxus_read_slob) -{ - zval **pbid, **pnbytes; - long bid, nbytes; - IFX_IDRES *Ifx_slob; - int errcode, type; - char *buffer; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pbid, &pnbytes) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - convert_to_long_ex(pnbytes); - - bid = Z_LVAL_PP(pbid); - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - RETURN_FALSE; - } - - nbytes = Z_LVAL_PP(pnbytes); - buffer = emalloc(nbytes); - - if (ifx_lo_read(Ifx_slob->SLOB.lofd, buffer, nbytes, &errcode) < 0) { - efree(buffer); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading slob: %d", errcode); - RETURN_FALSE; - } - RETURN_STRINGL(buffer, nbytes, 0); -} -/* }}} */ - -/* ---------------------------------------------------------------------- -** int ifxus_write_slob(long bid, string content) -** -** writes a string into the slob-object -** bid: existing slob-id -** content: content to write -** return false on error otherwise bytes written -** ---------------------------------------------------------------------- -*/ - -/* {{{ proto int ifxus_write_slob(int bid, string content) - Writes a string into the slob-object */ -PHP_FUNCTION(ifxus_write_slob) -{ - zval **pbid, **pcontent; - long bid, nbytes; - IFX_IDRES *Ifx_slob; - int errcode, type; - char *buffer; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pbid, &pcontent) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pbid); - convert_to_string_ex(pcontent); - - bid = Z_LVAL_PP(pbid); - Ifx_slob = (IFX_IDRES *) zend_list_find(bid, &type); - if (type != le_idresult || Ifx_slob->type != TYPE_SLOB) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); - RETURN_FALSE; - } - - buffer = Z_STRVAL_PP(pcontent); - nbytes = Z_STRLEN_PP(pcontent); - - if (nbytes <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "String has no content"); - RETURN_FALSE; - } - - if ((nbytes = ifx_lo_write(Ifx_slob->SLOB.lofd, buffer, nbytes, &errcode)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error writing slob: %d", errcode); - RETURN_FALSE; - } - - RETURN_LONG(nbytes); -} -/* }}} */ - -$endif; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/informix/php_informix.h b/ext/informix/php_informix.h deleted file mode 100644 index 326026e7f922f..0000000000000 --- a/ext/informix/php_informix.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Danny Heijl , initial cut (ODS 7) | - | Christian Cartus , blobs, and IUS 9 | - | Jouni Ahto , configuration stuff | - | Corne' Cornelius , input descriptors | - | based on mysql code by: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_INFORMIX_H -#define PHP_INFORMIX_H - -#ifdef PHP_WIN32 -#define PHP_IFX_API __declspec(dllexport) -#else -#define PHP_IFX_API -#endif - -#if HAVE_IFX /* with Informix */ - -#ifndef DLEXPORT -#define DLEXPORT -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry ifx_module_entry; -#define ifx_module_ptr &ifx_module_entry - -/* user functions */ -PHP_MINIT_FUNCTION(ifx); -PHP_RINIT_FUNCTION(ifx); -PHP_MSHUTDOWN_FUNCTION(ifx); -PHP_MINFO_FUNCTION(ifx); -/* functions common to all Informix versions */ -PHP_FUNCTION(ifx_connect); -PHP_FUNCTION(ifx_pconnect); -PHP_FUNCTION(ifx_close); -PHP_FUNCTION(ifx_query); -PHP_FUNCTION(ifx_prepare); -PHP_FUNCTION(ifx_do); -PHP_FUNCTION(ifx_error); -PHP_FUNCTION(ifx_errormsg); -PHP_FUNCTION(ifx_affected_rows); -PHP_FUNCTION(ifx_num_rows); -PHP_FUNCTION(ifx_num_fields); -PHP_FUNCTION(ifx_fetch_row); -PHP_FUNCTION(ifx_free_result); -PHP_FUNCTION(ifx_htmltbl_result); -PHP_FUNCTION(ifx_fieldtypes); -PHP_FUNCTION(ifx_fieldproperties); -PHP_FUNCTION(ifx_getsqlca); -/* BLOB related stuff, IDS & IUS only */ -PHP_FUNCTION(ifx_create_blob); -PHP_FUNCTION(ifx_free_blob) ; -PHP_FUNCTION(ifx_get_blob); -PHP_FUNCTION(ifx_update_blob); -PHP_FUNCTION(ifx_blobinfile_mode); -PHP_FUNCTION(ifx_copy_blob); -PHP_FUNCTION(ifx_textasvarchar); -PHP_FUNCTION(ifx_byteasvarchar); -PHP_FUNCTION(ifx_nullformat); -PHP_FUNCTION(ifx_create_char); -PHP_FUNCTION(ifx_free_char) ; -PHP_FUNCTION(ifx_update_char); -PHP_FUNCTION(ifx_get_char); - -/* SLOB, CLOB : IUS only functions */ -#if HAVE_IFX_IUS -PHP_FUNCTION(ifxus_create_slob); -PHP_FUNCTION(ifxus_free_slob) ; -PHP_FUNCTION(ifxus_close_slob) ; -PHP_FUNCTION(ifxus_open_slob) ; -PHP_FUNCTION(ifxus_read_slob); -PHP_FUNCTION(ifxus_write_slob); -PHP_FUNCTION(ifxus_seek_slob); -PHP_FUNCTION(ifxus_tell_slob); -#endif - -ZEND_BEGIN_MODULE_GLOBALS(ifx) - long default_link; - long num_links, num_persistent; - long max_links, max_persistent; - long allow_persistent; - char *default_host, *default_user, *default_password; - int connectionid; - int cursorid; - int sv_sqlcode; /* saved informix SQLCODE value */ - long blobinfile; /* 0=save in memory, 1=save in file */ - long textasvarchar; /* 0=as id, 1=as varchar */ - long byteasvarchar; /* 0=as id, 1=as varchar */ - long charasvarchar; /* 0=don't strip trailing blanks, 1=strip */ - long nullformat; /* 0=NULL as "", 1= NULL as "NULL" */ - char nullvalue[1]; /* "" */ - char nullstring[5]; /* "NULL" */ -ZEND_END_MODULE_GLOBALS(ifx) - -#ifdef ZTS -# define IFXG(v) TSRMG(ifx_globals_id, zend_ifx_globals *, v) -#else -# define IFXG(v) (ifx_globals.v) -#endif - -#else /* not HAVE_IFX */ -#define ifx_module_ptr NULL -#endif -#define phpext_informix_ptr ifx_module_ptr -#endif /* PHP_INFORMIX_H */ diff --git a/ext/informix/php_informix_includes.h b/ext/informix/php_informix_includes.h deleted file mode 100644 index a9fdb83e9487c..0000000000000 --- a/ext/informix/php_informix_includes.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Danny Heijl , initial cut (ODS 7) | - | Christian Cartus , blobs, and IUS 9 | - | Jouni Ahto , configuration stuff | - | Corne' Cornelius , input descriptors | - | based on mysql code by: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_INFORMIX_INCLUDES_H -#define PHP_INFORMIX_INCLUDES_H - -#if HAVE_IFX /* with Informix */ - -#undef TYPEMAX -#undef CHAR - -#include "locator.h" -#include "sqltypes.h" - -#define MAX_RESID 64 -#define BLOBINFILE 0 /* 0=in memory, 1=in file */ - -/* query result set data */ -typedef struct ifx_res { - char connecid[32]; - char cursorid[32]; - char descrpid[32]; - char i_descrpid[32]; - char statemid[32]; - int isscroll; - int ishold; - int iscursory; - int paramquery; - int numcols; - int numicols; - int rowid; - int affected_rows; - long sqlerrd[6]; - int res_id[MAX_RESID]; -} IFX_RES; - -typedef struct _IFX_IDRES { - int type; - union { - struct { - int mode; - loc_t blob_data; - } BLOBRES; - - struct { - char *char_data; - int len; - } CHARRES; - -#if HAVE_IFX_IUS - struct { - ifx_lo_t slob_data; - ifx_lo_create_spec_t *createspec; - int lofd; - } SLOBRES; -#endif - } DATARES; -} IFX_IDRES; - -#define BLOB DATARES.BLOBRES -#define CHAR DATARES.CHARRES - -#if HAVE_IFX_IUS -#define SLOB DATARES.SLOBRES -#endif - -#endif /* HAVE_IFX */ - -#endif /* PHP_INFORMIX_INCLUDES_H */ diff --git a/ext/interbase/CREDITS b/ext/interbase/CREDITS deleted file mode 100644 index d66f13b5f3715..0000000000000 --- a/ext/interbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -InterBase -Jouni Ahto, Andrew Avdeev, Ard Biesheuvel diff --git a/ext/interbase/config.m4 b/ext/interbase/config.m4 deleted file mode 100644 index 5f8d66ba8b42e..0000000000000 --- a/ext/interbase/config.m4 +++ /dev/null @@ -1,46 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(interbase,for InterBase support, -[ --with-interbase[=DIR] Include InterBase support. DIR is the InterBase base - install directory, defaults to /usr/interbase]) - -if test "$PHP_INTERBASE" != "no"; then - if test "$PHP_INTERBASE" = "yes"; then - IBASE_INCDIR=/usr/interbase/include - IBASE_LIBDIR=/usr/interbase/lib - else - IBASE_INCDIR=$PHP_INTERBASE/include - IBASE_LIBDIR=$PHP_INTERBASE/lib - fi - - PHP_CHECK_LIBRARY(fbclient, isc_detach_database, - [ - IBASE_LIBNAME=fbclient - ], [ - PHP_CHECK_LIBRARY(gds, isc_detach_database, - [ - IBASE_LIBNAME=gds - ], [ - PHP_CHECK_LIBRARY(ib_util, isc_detach_database, - [ - IBASE_LIBNAME=ib_util - ], [ - AC_MSG_ERROR([libgds, libib_util or libfbclient not found! Check config.log for more information.]) - ], [ - -L$IBASE_LIBDIR - ]) - ], [ - -L$IBASE_LIBDIR - ]) - ], [ - -L$IBASE_LIBDIR - ]) - - PHP_ADD_LIBRARY_WITH_PATH($IBASE_LIBNAME, $IBASE_LIBDIR, INTERBASE_SHARED_LIBADD) - PHP_ADD_INCLUDE($IBASE_INCDIR) - AC_DEFINE(HAVE_IBASE,1,[ ]) - PHP_NEW_EXTENSION(interbase, interbase.c ibase_query.c ibase_service.c ibase_events.c ibase_blobs.c, $ext_shared) - PHP_SUBST(INTERBASE_SHARED_LIBADD) -fi diff --git a/ext/interbase/config.w32 b/ext/interbase/config.w32 deleted file mode 100644 index 78a442d8ca59a..0000000000000 --- a/ext/interbase/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("interbase", "InterBase support", "no"); - -if (PHP_INTERBASE != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_INTERBASE", PHP_PHP_BUILD + "\\interbase\\include;" + PHP_INTERBASE) && - (CHECK_LIB("fbclient_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE) || - CHECK_LIB("gds32_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE))) { - - EXTENSION("interbase", "interbase.c ibase_query.c ibase_service.c ibase_events.c ibase_blobs.c"); - AC_DEFINE('HAVE_IBASE', 1, 'Have interbase library'); - } else { - WARNING("interbase not enabled; libraries and headers not found"); - } -} diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c deleted file mode 100644 index 0d3cffc254e44..0000000000000 --- a/ext/interbase/ibase_blobs.c +++ /dev/null @@ -1,594 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_IBASE - -#include "php_interbase.h" -#include "php_ibase_includes.h" - -#define BLOB_CLOSE 1 -#define BLOB_CANCEL 2 - -static int le_blob; - -static void _php_ibase_free_blob(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_blob *ib_blob = (ibase_blob *)rsrc->ptr; - - if (ib_blob->bl_handle != NULL) { /* blob open*/ - if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) { - _php_ibase_module_error("You can lose data. Close any blob after reading from or " - "writing to it. Use ibase_blob_close() before calling ibase_close()" TSRMLS_CC); - } - } - efree(ib_blob); -} -/* }}} */ - -void php_ibase_blobs_minit(INIT_FUNC_ARGS) /* {{{ */ -{ - le_blob = zend_register_list_destructors_ex(_php_ibase_free_blob, NULL, - "interbase blob", module_number); -} -/* }}} */ - -int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd) /* {{{ */ -{ - /* shortcut for most common case */ - if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) { - return sscanf(id, BLOB_ID_MASK, (ISC_UINT64 *) qd); - } else { - ISC_UINT64 res; - if (sscanf(id, BLOB_ID_MASK, &res)) { - qd->gds_quad_high = (ISC_LONG) (res >> 0x20); - qd->gds_quad_low = (ISC_LONG) (res & 0xFFFFFFFF); - return 1; - } - return 0; - } -} -/* }}} */ - -char *_php_ibase_quad_to_string(ISC_QUAD const qd) /* {{{ */ -{ - char *result = (char *) emalloc(BLOB_ID_LEN+1); - - /* shortcut for most common case */ - if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) { - sprintf(result, "0x%0*" LL_MASK "x", 16, *(ISC_UINT64*)(void *) &qd); - } else { - ISC_UINT64 res = ((ISC_UINT64) qd.gds_quad_high << 0x20) | qd.gds_quad_low; - sprintf(result, "0x%0*" LL_MASK "x", 16, res); - } - result[BLOB_ID_LEN] = '\0'; - return result; -} -/* }}} */ - -typedef struct { /* {{{ */ - ISC_LONG max_segment; /* Length of longest segment */ - ISC_LONG num_segments; /* Total number of segments */ - ISC_LONG total_length; /* Total length of blob */ - int bl_stream; /* blob is stream ? */ -/* }}} */ -} IBASE_BLOBINFO; - -int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC) /* {{{ */ -{ - if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/ - - ISC_STATUS stat; - char *bl_data; - unsigned long cur_len; - unsigned short seg_len; - - bl_data = emalloc(max_len + 1); - - for (cur_len = stat = 0; (stat == 0 || stat == isc_segment) && cur_len < max_len; cur_len += seg_len) { - - unsigned short chunk_size = (max_len-cur_len) > USHRT_MAX ? USHRT_MAX - : (unsigned short)(max_len-cur_len); - - stat = isc_get_segment(IB_STATUS, &ib_blob->bl_handle, &seg_len, chunk_size, &bl_data[cur_len]); - } - - bl_data[cur_len] = '\0'; - if (IB_STATUS[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment)) { - efree(bl_data); - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - RETVAL_STRINGL(bl_data, cur_len, 0); - } else { /* null blob */ - RETVAL_STRING("", 1); /* empty string */ - } - return SUCCESS; -} -/* }}} */ - -int _php_ibase_blob_add(zval **string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{ */ -{ - unsigned long put_cnt = 0, rem_cnt; - unsigned short chunk_size; - - convert_to_string_ex(string_arg); - - for (rem_cnt = Z_STRLEN_PP(string_arg); rem_cnt > 0; rem_cnt -= chunk_size) { - - chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt; - - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size, &Z_STRVAL_PP(string_arg)[put_cnt] )) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - put_cnt += chunk_size; - } - return SUCCESS; -} -/* }}} */ - -static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info TSRMLS_DC) /* {{{ */ -{ - static char bl_items[] = { - isc_info_blob_num_segments, - isc_info_blob_max_segment, - isc_info_blob_total_length, - isc_info_blob_type - }; - - char bl_inf[sizeof(long)*8], *p; - - bl_info->max_segment = 0; - bl_info->num_segments = 0; - bl_info->total_length = 0; - bl_info->bl_stream = 0; - - if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_inf), bl_inf)) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - - for (p = bl_inf; *p != isc_info_end && p < bl_inf + sizeof(bl_inf);) { - unsigned short item_len; - int item = *p++; - - item_len = (short) isc_vax_integer(p, 2); - p += 2; - switch (item) { - case isc_info_blob_num_segments: - bl_info->num_segments = isc_vax_integer(p, item_len); - break; - case isc_info_blob_max_segment: - bl_info->max_segment = isc_vax_integer(p, item_len); - break; - case isc_info_blob_total_length: - bl_info->total_length = isc_vax_integer(p, item_len); - break; - case isc_info_blob_type: - bl_info->bl_stream = isc_vax_integer(p, item_len); - break; - case isc_info_end: - break; - case isc_info_truncated: - case isc_info_error: /* hmm. don't think so...*/ - _php_ibase_module_error("PHP module internal error" TSRMLS_CC); - return FAILURE; - } /* switch */ - p += item_len; - } /* for */ - return SUCCESS; -} -/* }}} */ - -/* {{{ proto resource ibase_blob_create([resource link_identifier]) - Create blob for adding data */ -PHP_FUNCTION(ibase_blob_create) -{ - zval *link = NULL; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - ibase_blob *ib_blob; - - RESET_ERRMSG; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link)) { - RETURN_FALSE; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - ib_blob = (ibase_blob *) emalloc(sizeof(ibase_blob)); - ib_blob->bl_handle = NULL; - ib_blob->type = BLOB_INPUT; - - if (isc_create_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) { - _php_ibase_error(TSRMLS_C); - efree(ib_blob); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, ib_blob, le_blob); -} -/* }}} */ - -/* {{{ proto resource ibase_blob_open([ resource link_identifier, ] string blob_id) - Open blob for retrieving data parts */ -PHP_FUNCTION(ibase_blob_open) -{ - char *blob_id; - int blob_id_len; - zval *link = NULL; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - ibase_blob *ib_blob; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - default: - WRONG_PARAM_COUNT; - case 1: - if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - case 2: - if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - ib_blob = (ibase_blob *) emalloc(sizeof(ibase_blob)); - ib_blob->bl_handle = NULL; - ib_blob->type = BLOB_OUTPUT; - - do { - if (! _php_ibase_string_to_quad(blob_id, &ib_blob->bl_qd)) { - _php_ibase_module_error("String is not a BLOB ID" TSRMLS_CC); - break; - } - - if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle, - &ib_blob->bl_qd)) { - _php_ibase_error(TSRMLS_C); - break; - } - - ZEND_REGISTER_RESOURCE(return_value, ib_blob, le_blob); - return; - - } while (0); - - efree(ib_blob); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool ibase_blob_add(resource blob_handle, string data) - Add data into created blob */ -PHP_FUNCTION(ibase_blob_add) -{ - zval **blob_arg, **string_arg; - ibase_blob *ib_blob; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &blob_arg, &string_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob); - - if (ib_blob->type != BLOB_INPUT) { - _php_ibase_module_error("BLOB is not open for input" TSRMLS_CC); - RETURN_FALSE; - } - - if (_php_ibase_blob_add(string_arg, ib_blob TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string ibase_blob_get(resource blob_handle, int len) - Get len bytes data from open blob */ -PHP_FUNCTION(ibase_blob_get) -{ - zval **blob_arg, **len_arg; - ibase_blob *ib_blob; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &blob_arg, &len_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob); - - if (ib_blob->type != BLOB_OUTPUT) { - _php_ibase_module_error("BLOB is not open for output" TSRMLS_CC); - RETURN_FALSE; - } - - convert_to_long_ex(len_arg); - - if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_PP(len_arg) TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; - } -} -/* }}} */ - -static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) /* {{{ */ -{ - zval **blob_arg; - ibase_blob *ib_blob; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &blob_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob); - - if (bl_end == BLOB_CLOSE) { /* return id here */ - - if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/ - if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - } - ib_blob->bl_handle = NULL; - - RETVAL_STRINGL(_php_ibase_quad_to_string(ib_blob->bl_qd), BLOB_ID_LEN, 0); - } else { /* discard created blob */ - if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - ib_blob->bl_handle = NULL; - RETVAL_TRUE; - } - zend_list_delete(Z_LVAL_PP(blob_arg)); -} -/* }}} */ - -/* {{{ proto string ibase_blob_close(resource blob_handle) - Close blob */ -PHP_FUNCTION(ibase_blob_close) -{ - _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, BLOB_CLOSE); -} -/* }}} */ - -/* {{{ proto bool ibase_blob_cancel(resource blob_handle) - Cancel creating blob */ -PHP_FUNCTION(ibase_blob_cancel) -{ - _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, BLOB_CANCEL); -} -/* }}} */ - -/* {{{ proto array ibase_blob_info([ resource link_identifier, ] string blob_id) - Return blob length and other useful info */ -PHP_FUNCTION(ibase_blob_info) -{ - char *blob_id; - int blob_id_len; - zval *link = NULL; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - ibase_blob ib_blob = { NULL, BLOB_INPUT }; - IBASE_BLOBINFO bl_info; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - default: - WRONG_PARAM_COUNT; - case 1: - if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - case 2: - if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - if (! _php_ibase_string_to_quad(blob_id, &ib_blob.bl_qd)) { - _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC); - RETURN_FALSE; - } - - if (ib_blob.bl_qd.gds_quad_high || ib_blob.bl_qd.gds_quad_low) { /* not null ? */ - if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob.bl_handle, - &ib_blob.bl_qd)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - if (_php_ibase_blob_info(ib_blob.bl_handle, &bl_info TSRMLS_CC)) { - RETURN_FALSE; - } - if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - } else { /* null blob, all values to zero */ - bl_info.max_segment = 0; - bl_info.num_segments = 0; - bl_info.total_length = 0; - bl_info.bl_stream = 0; - } - - array_init(return_value); - - add_index_long(return_value, 0, bl_info.total_length); - add_assoc_long(return_value, "length", bl_info.total_length); - - add_index_long(return_value, 1, bl_info.num_segments); - add_assoc_long(return_value, "numseg", bl_info.num_segments); - - add_index_long(return_value, 2, bl_info.max_segment); - add_assoc_long(return_value, "maxseg", bl_info.max_segment); - - add_index_bool(return_value, 3, bl_info.bl_stream); - add_assoc_bool(return_value, "stream", bl_info.bl_stream); - - add_index_bool(return_value, 4, (!ib_blob.bl_qd.gds_quad_high && !ib_blob.bl_qd.gds_quad_low)); - add_assoc_bool(return_value, "isnull", (!ib_blob.bl_qd.gds_quad_high && !ib_blob.bl_qd.gds_quad_low)); -} -/* }}} */ - -/* {{{ proto bool ibase_blob_echo([ resource link_identifier, ] string blob_id) - Output blob contents to browser */ -PHP_FUNCTION(ibase_blob_echo) -{ - char *blob_id; - int blob_id_len; - zval *link = NULL; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - ibase_blob ib_blob_id = { NULL, BLOB_OUTPUT }; - char bl_data[IBASE_BLOB_SEG]; - unsigned short seg_len; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - default: - WRONG_PARAM_COUNT; - case 1: - if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - case 2: - if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) { - RETURN_FALSE; - } - break; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - if (! _php_ibase_string_to_quad(blob_id, &ib_blob_id.bl_qd)) { - _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC); - RETURN_FALSE; - } - - do { - if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob_id.bl_handle, - &ib_blob_id.bl_qd)) { - break; - } - - while (!isc_get_segment(IB_STATUS, &ib_blob_id.bl_handle, &seg_len, sizeof(bl_data), bl_data) - || IB_STATUS[1] == isc_segment) { - PHPWRITE(bl_data, seg_len); - } - - if (IB_STATUS[0] && (IB_STATUS[1] != isc_segstr_eof)) { - break; - } - - if (isc_close_blob(IB_STATUS, &ib_blob_id.bl_handle)) { - break; - } - RETURN_TRUE; - } while (0); - - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string ibase_blob_import([ resource link_identifier, ] resource file) - Create blob, copy file in it, and close it */ -PHP_FUNCTION(ibase_blob_import) -{ - zval *link = NULL, *file; - int size; - unsigned short b; - ibase_blob ib_blob = { NULL, 0 }; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - char bl_data[IBASE_BLOB_SEG]; - php_stream *stream; - - RESET_ERRMSG; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|r", - (ZEND_NUM_ARGS()-1) ? &link : &file, &file)) { - RETURN_FALSE; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - php_stream_from_zval(stream, &file); - - do { - if (isc_create_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob.bl_handle, - &ib_blob.bl_qd)) { - break; - } - - for (size = 0; (b = php_stream_read(stream, bl_data, sizeof(bl_data))); size += b) { - if (isc_put_segment(IB_STATUS, &ib_blob.bl_handle, b, bl_data)) { - break; - } - } - - if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) { - break; - } - RETURN_STRINGL( _php_ibase_quad_to_string(ib_blob.bl_qd), BLOB_ID_LEN, 0); - } while (0); - - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; -} -/* }}} */ - -#endif /* HAVE_IBASE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c deleted file mode 100644 index c8b59ebe12f46..0000000000000 --- a/ext/interbase/ibase_events.c +++ /dev/null @@ -1,385 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_IBASE - -#include "php_interbase.h" -#include "php_ibase_includes.h" - -static int le_event; - -static void _php_ibase_event_free(char *event_buf, char *result_buf) /* {{{ */ -{ - isc_free(event_buf); - isc_free(result_buf); -} -/* }}} */ - -void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */ -{ - unsigned short i; - - event->state = DEAD; - - if (event->link != NULL) { - ibase_event **node; - - if (event->link->handle != NULL && - isc_cancel_events(IB_STATUS, &event->link->handle, &event->event_id)) { - _php_ibase_error(TSRMLS_C); - } - - /* delete this event from the link struct */ - for (node = &event->link->event_head; *node != event; node = &(*node)->event_next); - *node = event->event_next; - } - - if (event->callback) { - zval_dtor(event->callback); - FREE_ZVAL(event->callback); - event->callback = NULL; - - _php_ibase_event_free(event->event_buffer,event->result_buffer); - - for (i = 0; i < event->event_count; ++i) { - efree(event->events[i]); - } - efree(event->events); - } -} -/* }}} */ - -static void _php_ibase_free_event_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_event *e = (ibase_event *) rsrc->ptr; - - _php_ibase_free_event(e TSRMLS_CC); - - efree(e); -} -/* }}} */ - -void php_ibase_events_minit(INIT_FUNC_ARGS) /* {{{ */ -{ - le_event = zend_register_list_destructors_ex(_php_ibase_free_event_rsrc, NULL, - "interbase event", module_number); -} -/* }}} */ - -static void _php_ibase_event_block(ibase_db_link *ib_link, unsigned short count, /* {{{ */ - char **events, unsigned short *l, char **event_buf, char **result_buf) -{ - ISC_STATUS dummy_result[20]; - unsigned long dummy_count[15]; - - /** - * Unfortunately, there's no clean and portable way in C to pass arguments to - * a variadic function if you don't know the number of arguments at compile time. - * (And even if there were a way, the Interbase API doesn't provide a version of - * this function that takes a va_list as an argument) - * - * In this case, the number of arguments is limited to 18 by the underlying API, - * so we can work around it. - */ - - *l = (unsigned short) isc_event_block(event_buf, result_buf, count, events[0], - events[1], events[2], events[3], events[4], events[5], events[6], events[7], - events[8], events[9], events[10], events[11], events[12], events[13], events[14]); - - /** - * Currently, this is the only way to correctly initialize an event buffer. - * This is clearly something that should be fixed, cause the semantics of - * isc_wait_for_event() indicate that it blocks until an event occurs. - * If the Firebird people ever fix this, these lines should be removed, - * otherwise, events will have to fire twice before ibase_wait_event() returns. - */ - - isc_wait_for_event(dummy_result, &ib_link->handle, *l, *event_buf, *result_buf); - isc_event_counts(dummy_count, *l, *event_buf, *result_buf); -} -/* }}} */ - -/* {{{ proto string ibase_wait_event([resource link_identifier,] string event [, string event [, ...]]) - Waits for any one of the passed Interbase events to be posted by the database, and returns its name */ -PHP_FUNCTION(ibase_wait_event) -{ - zval **args[16]; - ibase_db_link *ib_link; - char *event_buffer, *result_buffer, *events[15]; - unsigned short i = 0, event_count = 0, buffer_size; - unsigned long occurred_event[15]; - - RESET_ERRMSG; - - /* no more than 15 events */ - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 16) { - WRONG_PARAM_COUNT; - } - - if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { - RETURN_FALSE; - } - - if (Z_TYPE_PP(args[0]) == IS_RESOURCE) { - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, args[0], -1, "InterBase link", le_link, le_plink); - i = 1; - - } else { - - if (ZEND_NUM_ARGS() > 15) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), "InterBase link", le_link, le_plink); - } - - for (; i < ZEND_NUM_ARGS(); ++i) { - convert_to_string_ex(args[i]); - events[event_count++] = Z_STRVAL_PP(args[i]); - } - - /* fills the required data structure with information about the events */ - _php_ibase_event_block(ib_link, event_count, events, &buffer_size, &event_buffer, &result_buffer); - - /* now block until an event occurs */ - if (isc_wait_for_event(IB_STATUS, &ib_link->handle, buffer_size, event_buffer, result_buffer)) { - _php_ibase_error(TSRMLS_C); - _php_ibase_event_free(event_buffer,result_buffer); - RETURN_FALSE; - } - - /* find out which event occurred */ - isc_event_counts(occurred_event, buffer_size, event_buffer, result_buffer); - for (i = 0; i < event_count; ++i) { - if (occurred_event[i]) { - char *result = estrdup(events[i]); - _php_ibase_event_free(event_buffer,result_buffer); - RETURN_STRING(result,0); - } - } - - /* If we reach this line, isc_wait_for_event() did return, but we don't know - which event fired. */ - _php_ibase_event_free(event_buffer,result_buffer); - RETURN_FALSE; -} -/* }}} */ - -static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */ - unsigned short buffer_size, char *result_buf) -{ - /* this function is called asynchronously by the Interbase client library. */ - TSRMLS_FETCH_FROM_CTX(event->thread_ctx); - - /** - * The callback function is called when the event is first registered and when the event - * is cancelled. I consider this is a bug. By clearing event->callback first and setting - * it to -1 later, we make sure nothing happens if no event was actually posted. - */ - switch (event->state) { - unsigned short i; - unsigned long occurred_event[15]; - zval event_name, link_id, return_value, *args[2]; - - default: /* == DEAD */ - break; - case ACTIVE: - args[0] = &event_name; - args[1] = &link_id; - - /* copy the updated results into the result buffer */ - memcpy(event->result_buffer, result_buf, buffer_size); - - INIT_ZVAL(event_name); - INIT_ZVAL(link_id); - ZVAL_RESOURCE(&link_id, event->link_res_id); - - /* find out which event occurred */ - isc_event_counts(occurred_event, buffer_size, event->event_buffer, event->result_buffer); - for (i = 0; i < event->event_count; ++i) { - if (occurred_event[i]) { - ZVAL_STRING(&event_name,event->events[i],0); - break; - } - } - - /* call the callback provided by the user */ - if (SUCCESS != call_user_function(EG(function_table), NULL, - event->callback, &return_value, 2, args TSRMLS_CC)) { - _php_ibase_module_error("Error calling callback %s" TSRMLS_CC, Z_STRVAL_P(event->callback)); - break; - } - - if (Z_TYPE(return_value) == IS_BOOL && !Z_BVAL(return_value)) { - event->state = DEAD; - break; - } - case NEW: - /* re-register the event */ - if (isc_que_events(IB_STATUS, &event->link->handle, &event->event_id, buffer_size, - event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) { - - _php_ibase_error(TSRMLS_C); - } - event->state = ACTIVE; - } - return 0; -} -/* }}} */ - -/* {{{ proto resource ibase_set_event_handler([resource link_identifier,] callback handler, string event [, string event [, ...]]) - Register the callback for handling each of the named events */ -PHP_FUNCTION(ibase_set_event_handler) -{ - /** - * The callback passed to this function should take an event name (string) and a - * link resource id (int) as arguments. The value returned from the function is - * used to determine if the event handler should remain set. - */ - - zval **args[17], **cb_arg; - ibase_db_link *ib_link; - ibase_event *event; - unsigned short i = 1, buffer_size; - int link_res_id; - - RESET_ERRMSG; - - /* no more than 15 events */ - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 17) { - WRONG_PARAM_COUNT; - } - - if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { - RETURN_FALSE; - } - - /* get a working link */ - if (Z_TYPE_PP(args[0]) != IS_STRING) { - - cb_arg = args[1]; - i = 2; - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, args[0], -1, - "InterBase link", le_link, le_plink); - - convert_to_long_ex(args[0]); - link_res_id = Z_LVAL_PP(args[0]); - - } else { - - if (ZEND_NUM_ARGS() > 16) { - WRONG_PARAM_COUNT; - } - - cb_arg = args[0]; - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), - "InterBase link", le_link, le_plink); - link_res_id = IBG(default_link); - } - - /* get the callback */ - if (!zend_is_callable(*cb_arg, 0, NULL)) { - _php_ibase_module_error("Callback argument %s is not a callable function" - TSRMLS_CC, Z_STRVAL_PP(cb_arg)); - RETURN_FALSE; - } - - /* allocate the event resource */ - event = (ibase_event *) safe_emalloc(sizeof(ibase_event), 1, 0); - TSRMLS_SET_CTX(event->thread_ctx); - event->link_res_id = link_res_id; - event->link = ib_link; - event->event_count = 0; - event->state = NEW; - event->events = (char **) safe_emalloc(sizeof(char *),ZEND_NUM_ARGS()-i,0); - - ALLOC_ZVAL(event->callback); - *event->callback = **cb_arg; - INIT_PZVAL(event->callback); - zval_copy_ctor(event->callback); - - for (; i < ZEND_NUM_ARGS(); ++i) { - convert_to_string_ex(args[i]); - event->events[event->event_count++] = estrdup(Z_STRVAL_PP(args[i])); - } - - /* fills the required data structure with information about the events */ - _php_ibase_event_block(ib_link, event->event_count, event->events, - &buffer_size, &event->event_buffer, &event->result_buffer); - - /* now register the events with the Interbase API */ - if (isc_que_events(IB_STATUS, &ib_link->handle, &event->event_id, buffer_size, - event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) { - - _php_ibase_error(TSRMLS_C); - efree(event); - RETURN_FALSE; - } - - event->event_next = ib_link->event_head; - ib_link->event_head = event; - - ZEND_REGISTER_RESOURCE(return_value, event, le_event); - zend_list_addref(Z_LVAL_P(return_value)); -} -/* }}} */ - -/* {{{ proto bool ibase_free_event_handler(resource event) - Frees the event handler set by ibase_set_event_handler() */ -PHP_FUNCTION(ibase_free_event_handler) -{ - zval *event_arg; - - RESET_ERRMSG; - - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &event_arg)) { - ibase_event *event; - - ZEND_FETCH_RESOURCE(event, ibase_event *, &event_arg, -1, "Interbase event", le_event); - - event->state = DEAD; - - zend_list_delete(Z_LVAL_P(event_arg)); - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -#endif /* HAVE_IBASE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c deleted file mode 100644 index f43bd2b34f3f5..0000000000000 --- a/ext/interbase/ibase_query.c +++ /dev/null @@ -1,2116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" - -#if HAVE_IBASE - -#include "ext/standard/php_standard.h" -#include "php_interbase.h" -#include "php_ibase_includes.h" - -#define ISC_LONG_MIN INT_MIN -#define ISC_LONG_MAX INT_MAX - -#define QUERY_RESULT 1 -#define EXECUTE_RESULT 2 - -#define FETCH_ROW 1 -#define FETCH_ARRAY 2 - -typedef struct { - ISC_ARRAY_DESC ar_desc; - ISC_LONG ar_size; /* size of entire array in bytes */ - unsigned short el_type, el_size; -} ibase_array; - -typedef struct { - ibase_db_link *link; - ibase_trans *trans; - isc_stmt_handle stmt; - unsigned short type; - unsigned char has_more_rows, statement_type; - XSQLDA *out_sqlda; - ibase_array out_array[1]; /* last member */ -} ibase_result; - -typedef struct { - ibase_db_link *link; - ibase_trans *trans; - int result_res_id; - isc_stmt_handle stmt; - XSQLDA *in_sqlda, *out_sqlda; - ibase_array *in_array, *out_array; - unsigned short in_array_cnt, out_array_cnt; - unsigned short dialect; - char statement_type; - char *query; - long trans_res_id; -} ibase_query; - -typedef struct { - unsigned short vary_length; - char vary_string[1]; -} IBVARY; - -/* sql variables union - * used for convert and binding input variables - */ -typedef struct { - union { - short sval; - float fval; - ISC_LONG lval; - ISC_QUAD qval; - ISC_TIMESTAMP tsval; - ISC_DATE dtval; - ISC_TIME tmval; - } val; - short sqlind; -} BIND_BUF; - -static int le_result, le_query; - -#define LE_RESULT "Firebird/InterBase result" -#define LE_QUERY "Firebird/InterBase query" - -static void _php_ibase_free_xsqlda(XSQLDA *sqlda) /* {{{ */ -{ - int i; - XSQLVAR *var; - - IBDEBUG("Free XSQLDA?"); - if (sqlda) { - IBDEBUG("Freeing XSQLDA..."); - var = sqlda->sqlvar; - for (i = 0; i < sqlda->sqld; i++, var++) { - efree(var->sqldata); - if (var->sqlind) { - efree(var->sqlind); - } - } - efree(sqlda); - } -} -/* }}} */ - -static void _php_ibase_free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_result *ib_result = (ibase_result *) rsrc->ptr; - - IBDEBUG("Freeing result by dtor..."); - if (ib_result) { - _php_ibase_free_xsqlda(ib_result->out_sqlda); - if (ib_result->stmt && ib_result->type != EXECUTE_RESULT) { - IBDEBUG("Dropping statement handle (free_result dtor)..."); - isc_dsql_free_statement(IB_STATUS, &ib_result->stmt, DSQL_drop); - } - efree(ib_result); - } -} -/* }}} */ - -static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */ -{ - IBDEBUG("Freeing query..."); - - if (ib_query->in_sqlda) { - efree(ib_query->in_sqlda); - } - if (ib_query->out_sqlda) { - efree(ib_query->out_sqlda); - } - if (ib_query->stmt) { - IBDEBUG("Dropping statement handle (free_query)..."); - if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_drop)) { - _php_ibase_error(TSRMLS_C); - } - } - if (ib_query->in_array) { - efree(ib_query->in_array); - } - if (ib_query->out_array) { - efree(ib_query->out_array); - } - if (ib_query->query) { - efree(ib_query->query); - } -} -/* }}} */ - -static void php_ibase_free_query_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_query *ib_query = (ibase_query *)rsrc->ptr; - - if (ib_query != NULL) { - IBDEBUG("Preparing to free query by dtor..."); - - _php_ibase_free_query(ib_query TSRMLS_CC); - if (ib_query->statement_type != isc_info_sql_stmt_exec_procedure) { - zend_list_delete(ib_query->result_res_id); - } - efree(ib_query); - } -} -/* }}} */ - -void php_ibase_query_minit(INIT_FUNC_ARGS) /* {{{ */ -{ - le_result = zend_register_list_destructors_ex(_php_ibase_free_result, NULL, - "interbase result", module_number); - le_query = zend_register_list_destructors_ex(php_ibase_free_query_rsrc, NULL, - "interbase query", module_number); -} -/* }}} */ - -static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ */ - isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt TSRMLS_DC) -{ - unsigned short i, n; - ibase_array *ar; - - /* first check if we have any arrays at all */ - for (i = *array_cnt = 0; i < sqlda->sqld; ++i) { - if ((sqlda->sqlvar[i].sqltype & ~1) == SQL_ARRAY) { - ++*array_cnt; - } - } - if (! *array_cnt) return SUCCESS; - - ar = safe_emalloc(sizeof(ibase_array), *array_cnt, 0); - - for (i = n = 0; i < sqlda->sqld; ++i) { - unsigned short dim; - unsigned long ar_size = 1; - XSQLVAR *var = &sqlda->sqlvar[i]; - - if ((var->sqltype & ~1) == SQL_ARRAY) { - ibase_array *a = &ar[n++]; - ISC_ARRAY_DESC *ar_desc = &a->ar_desc; - - if (isc_array_lookup_bounds(IB_STATUS, &link, &trans, var->relname, - var->sqlname, ar_desc)) { - _php_ibase_error(TSRMLS_C); - efree(ar); - return FAILURE; - } - - switch (ar_desc->array_desc_dtype) { - case blr_text: - case blr_text2: - a->el_type = SQL_TEXT; - a->el_size = ar_desc->array_desc_length; - break; - case blr_short: - a->el_type = SQL_SHORT; - a->el_size = sizeof(short); - break; - case blr_long: - a->el_type = SQL_LONG; - a->el_size = sizeof(ISC_LONG); - break; - case blr_float: - a->el_type = SQL_FLOAT; - a->el_size = sizeof(float); - break; - case blr_double: - a->el_type = SQL_DOUBLE; - a->el_size = sizeof(double); - break; - case blr_int64: - a->el_type = SQL_INT64; - a->el_size = sizeof(ISC_INT64); - break; - case blr_timestamp: - a->el_type = SQL_TIMESTAMP; - a->el_size = sizeof(ISC_TIMESTAMP); - break; - case blr_sql_date: - a->el_type = SQL_TYPE_DATE; - a->el_size = sizeof(ISC_DATE); - break; - case blr_sql_time: - a->el_type = SQL_TYPE_TIME; - a->el_size = sizeof(ISC_TIME); - break; - case blr_varying: - case blr_varying2: - /** - * IB has a strange way of handling VARCHAR arrays. It doesn't store - * the length in the first short, as with VARCHAR fields. It does, - * however, expect the extra short to be allocated for each element. - */ - a->el_type = SQL_TEXT; - a->el_size = ar_desc->array_desc_length + sizeof(short); - break; - case blr_quad: - case blr_blob_id: - case blr_cstring: - case blr_cstring2: - /** - * These types are mentioned as array types in the manual, but I - * wouldn't know how to create an array field with any of these - * types. I assume these types are not applicable to arrays, and - * were mentioned erroneously. - */ - default: - _php_ibase_module_error("Unsupported array type %d in relation '%s' column '%s'" - TSRMLS_CC, ar_desc->array_desc_dtype, var->relname, var->sqlname); - efree(ar); - return FAILURE; - } /* switch array_desc_type */ - - /* calculate elements count */ - for (dim = 0; dim < ar_desc->array_desc_dimensions; dim++) { - ar_size *= 1 + ar_desc->array_desc_bounds[dim].array_bound_upper - -ar_desc->array_desc_bounds[dim].array_bound_lower; - } - a->ar_size = a->el_size * ar_size; - } /* if SQL_ARRAY */ - } /* for column */ - *ib_arrayp = ar; - return SUCCESS; -} -/* }}} */ - -/* allocate and prepare query */ -static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* {{{ */ - ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id TSRMLS_DC) -{ - static char info_type[] = {isc_info_sql_stmt_type}; - char result[8]; - - ib_query->link = link; - ib_query->trans = trans; - ib_query->result_res_id = 0; - ib_query->stmt = NULL; - ib_query->in_array = NULL; - ib_query->out_array = NULL; - ib_query->dialect = dialect; - ib_query->query = estrdup(query); - ib_query->trans_res_id = trans_res_id; - ib_query->out_sqlda = NULL; - ib_query->in_sqlda = NULL; - - if (isc_dsql_allocate_statement(IB_STATUS, &link->handle, &ib_query->stmt)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - - ib_query->out_sqlda = (XSQLDA *) emalloc(XSQLDA_LENGTH(1)); - ib_query->out_sqlda->sqln = 1; - ib_query->out_sqlda->version = SQLDA_CURRENT_VERSION; - - if (isc_dsql_prepare(IB_STATUS, &ib_query->trans->handle, &ib_query->stmt, - 0, query, dialect, ib_query->out_sqlda)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - - /* find out what kind of statement was prepared */ - if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type), - info_type, sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - ib_query->statement_type = result[3]; - - /* not enough output variables ? */ - if (ib_query->out_sqlda->sqld > ib_query->out_sqlda->sqln) { - ib_query->out_sqlda = erealloc(ib_query->out_sqlda, XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); - ib_query->out_sqlda->sqln = ib_query->out_sqlda->sqld; - ib_query->out_sqlda->version = SQLDA_CURRENT_VERSION; - if (isc_dsql_describe(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->out_sqlda)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - } - - /* maybe have input placeholders? */ - ib_query->in_sqlda = emalloc(XSQLDA_LENGTH(1)); - ib_query->in_sqlda->sqln = 1; - ib_query->in_sqlda->version = SQLDA_CURRENT_VERSION; - if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - - /* not enough input variables ? */ - if (ib_query->in_sqlda->sqln < ib_query->in_sqlda->sqld) { - ib_query->in_sqlda = erealloc(ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld)); - ib_query->in_sqlda->sqln = ib_query->in_sqlda->sqld; - ib_query->in_sqlda->version = SQLDA_CURRENT_VERSION; - - if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, - SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_alloc_query_error; - } - } - - /* no, haven't placeholders at all */ - if (ib_query->in_sqlda->sqld == 0) { - efree(ib_query->in_sqlda); - ib_query->in_sqlda = NULL; - } else if (FAILURE == _php_ibase_alloc_array(&ib_query->in_array, ib_query->in_sqlda, - link->handle, trans->handle, &ib_query->in_array_cnt TSRMLS_CC)) { - goto _php_ibase_alloc_query_error; - } - - if (ib_query->out_sqlda->sqld == 0) { - efree(ib_query->out_sqlda); - ib_query->out_sqlda = NULL; - } else if (FAILURE == _php_ibase_alloc_array(&ib_query->out_array, ib_query->out_sqlda, - link->handle, trans->handle, &ib_query->out_array_cnt TSRMLS_CC)) { - goto _php_ibase_alloc_query_error; - } - - return SUCCESS; - -_php_ibase_alloc_query_error: - - if (ib_query->out_sqlda) { - efree(ib_query->out_sqlda); - } - if (ib_query->in_sqlda) { - efree(ib_query->in_sqlda); - } - if (ib_query->out_array) { - efree(ib_query->out_array); - } - if (ib_query->query) { - efree(ib_query->query); - } - return FAILURE; -} -/* }}} */ - -static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /* {{{ */ - ibase_array *array, int dim TSRMLS_DC) -{ - zval null_val, *pnull_val = &null_val; - int u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper, - l_bound = array->ar_desc.array_desc_bounds[dim].array_bound_lower, - dim_len = 1 + u_bound - l_bound; - - ZVAL_NULL(pnull_val); - - if (dim < array->ar_desc.array_desc_dimensions) { - unsigned long slice_size = buf_size / dim_len; - unsigned short i; - zval **subval = &val; - - if (Z_TYPE_P(val) == IS_ARRAY) { - zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); - } - - for (i = 0; i < dim_len; ++i) { - - if (Z_TYPE_P(val) == IS_ARRAY && - zend_hash_get_current_data(Z_ARRVAL_P(val), (void *) &subval) == FAILURE) - { - subval = &pnull_val; - } - - if (_php_ibase_bind_array(*subval, buf, slice_size, array, dim+1 TSRMLS_CC) == FAILURE) - { - return FAILURE; - } - buf += slice_size; - - if (Z_TYPE_P(val) == IS_ARRAY) { - zend_hash_move_forward(Z_ARRVAL_P(val)); - } - } - - if (Z_TYPE_P(val) == IS_ARRAY) { - zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); - } - - } else { - /* expect a single value */ - if (Z_TYPE_P(val) == IS_NULL) { - memset(buf, 0, buf_size); - } else if (array->ar_desc.array_desc_scale < 0) { - - /* no coercion for array types */ - double l; - - convert_to_double(val); - - if (Z_DVAL_P(val) > 0) { - l = Z_DVAL_P(val) * pow(10, -array->ar_desc.array_desc_scale) + .5; - } else { - l = Z_DVAL_P(val) * pow(10, -array->ar_desc.array_desc_scale) - .5; - } - - switch (array->el_type) { - case SQL_SHORT: - if (l > SHRT_MAX || l < SHRT_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); - return FAILURE; - } - *(short*) buf = (short) l; - break; - case SQL_LONG: - if (l > ISC_LONG_MAX || l < ISC_LONG_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); - return FAILURE; - } - *(ISC_LONG*) buf = (ISC_LONG) l; - break; - case SQL_INT64: - { - long double l; - - convert_to_string(val); - - if (!sscanf(Z_STRVAL_P(val), "%Lf", &l)) { - _php_ibase_module_error("Cannot convert '%s' to long double" - TSRMLS_CC, Z_STRVAL_P(val)); - return FAILURE; - } - - if (l > 0) { - *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, - -array->ar_desc.array_desc_scale) + .5); - } else { - *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, - -array->ar_desc.array_desc_scale) - .5); - } - } - break; - } - } else { - struct tm t = { 0, 0, 0, 0, 0, 0 }; - - switch (array->el_type) { - unsigned short n; - ISC_INT64 l; - - case SQL_SHORT: - convert_to_long(val); - if (Z_LVAL_P(val) > SHRT_MAX || Z_LVAL_P(val) < SHRT_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); - return FAILURE; - } - *(short *) buf = (short) Z_LVAL_P(val); - break; - case SQL_LONG: - convert_to_long(val); -#if (SIZEOF_LONG > 4) - if (Z_LVAL_P(val) > ISC_LONG_MAX || Z_LVAL_P(val) < ISC_LONG_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); - return FAILURE; - } -#endif - *(ISC_LONG *) buf = (ISC_LONG) Z_LVAL_P(val); - break; - case SQL_INT64: -#if (SIZEOF_LONG >= 8) - convert_to_long(val); - *(long *) buf = Z_LVAL_P(val); -#else - convert_to_string(val); - if (!sscanf(Z_STRVAL_P(val), "%" LL_MASK "d", &l)) { - _php_ibase_module_error("Cannot convert '%s' to long integer" - TSRMLS_CC, Z_STRVAL_P(val)); - return FAILURE; - } else { - *(ISC_INT64 *) buf = l; - } -#endif - break; - case SQL_FLOAT: - convert_to_double(val); - *(float*) buf = (float) Z_DVAL_P(val); - break; - case SQL_DOUBLE: - convert_to_double(val); - *(double*) buf = Z_DVAL_P(val); - break; - case SQL_TIMESTAMP: - convert_to_string(val); -#ifdef HAVE_STRPTIME - strptime(Z_STRVAL_P(val), INI_STR("ibase.timestampformat"), &t); -#else - n = sscanf(Z_STRVAL_P(val), "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", - &t.tm_mon, &t.tm_mday, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec); - - if (n != 3 && n != 6) { - _php_ibase_module_error("Invalid date/time format (expected 3 or 6 fields, got %d." - " Use format 'm/d/Y H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val)); - return FAILURE; - } - t.tm_year -= 1900; - t.tm_mon--; -#endif - isc_encode_timestamp(&t, (ISC_TIMESTAMP * ) buf); - break; - case SQL_TYPE_DATE: - convert_to_string(val); -#ifdef HAVE_STRPTIME - strptime(Z_STRVAL_P(val), INI_STR("ibase.dateformat"), &t); -#else - n = sscanf(Z_STRVAL_P(val), "%d%*[/]%d%*[/]%d", &t.tm_mon, &t.tm_mday, &t.tm_year); - - if (n != 3) { - _php_ibase_module_error("Invalid date format (expected 3 fields, got %d. " - "Use format 'm/d/Y' You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val)); - return FAILURE; - } - t.tm_year -= 1900; - t.tm_mon--; -#endif - isc_encode_sql_date(&t, (ISC_DATE *) buf); - break; - case SQL_TYPE_TIME: - convert_to_string(val); -#ifdef HAVE_STRPTIME - strptime(Z_STRVAL_P(val), INI_STR("ibase.timeformat"), &t); -#else - n = sscanf(Z_STRVAL_P(val), "%d%*[:]%d%*[:]%d", &t.tm_hour, &t.tm_min, &t.tm_sec); - - if (n != 3) { - _php_ibase_module_error("Invalid time format (expected 3 fields, got %d. " - "Use format 'H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val)); - return FAILURE; - } -#endif - isc_encode_sql_time(&t, (ISC_TIME *) buf); - break; - default: - convert_to_string(val); - strncpy(buf, Z_STRVAL_P(val), array->el_size); - buf[array->el_size-1] = '\0'; - } - } - } - return SUCCESS; -} -/* }}} */ - -static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{ */ - ibase_query *ib_query TSRMLS_DC) -{ - int i, array_cnt = 0, rv = SUCCESS; - - for (i = 0; i < sqlda->sqld; ++i) { /* bound vars */ - - zval *b_var = *b_vars[i]; - XSQLVAR *var = &sqlda->sqlvar[i]; - - var->sqlind = &buf[i].sqlind; - - /* check if a NULL should be inserted */ - switch (Z_TYPE_P(b_var)) { - int force_null; - - case IS_STRING: - - force_null = 0; - - /* for these types, an empty string can be handled like a NULL value */ - switch (var->sqltype & ~1) { - case SQL_SHORT: - case SQL_LONG: - case SQL_INT64: - case SQL_FLOAT: - case SQL_DOUBLE: - case SQL_TIMESTAMP: - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - force_null = (Z_STRLEN_P(b_var) == 0); - } - - if (! force_null) break; - - case IS_NULL: - - /* complain if this field doesn't allow NULL values */ - if (! (var->sqltype & 1)) { - _php_ibase_module_error("Parameter %d: non-empty value required" TSRMLS_CC, i+1); - rv = FAILURE; - } else { - buf[i].sqlind = -1; - } - - if (var->sqltype & SQL_ARRAY) ++array_cnt; - - continue; - } - - /* if we make it to this point, we must provide a value for the parameter */ - - buf[i].sqlind = 0; - - var->sqldata = (void*)&buf[i].val; - - switch (var->sqltype & ~1) { - struct tm t; - - case SQL_TIMESTAMP: - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - if (Z_TYPE_P(b_var) == IS_LONG) { - /* insert timestamp directly */ - t = *gmtime(&Z_LVAL_P(b_var)); - } else { -#ifdef HAVE_STRPTIME - char *format = INI_STR("ibase.timestampformat"); - - convert_to_string(b_var); - - switch (var->sqltype & ~1) { - case SQL_TYPE_DATE: - format = INI_STR("ibase.dateformat"); - break; - case SQL_TYPE_TIME: - format = INI_STR("ibase.timeformat"); - } - if (! strptime(Z_STRVAL_P(b_var), format, &t)) { - /* strptime() cannot handle it, so let IB have a try */ - break; - } -#else /* ifndef HAVE_STRPTIME */ - break; /* let IB parse it as a string */ -#endif - } - - switch (var->sqltype & ~1) { - default: /* == case SQL_TIMESTAMP */ - isc_encode_timestamp(&t, &buf[i].val.tsval); - break; - case SQL_TYPE_DATE: - isc_encode_sql_date(&t, &buf[i].val.dtval); - break; - case SQL_TYPE_TIME: - isc_encode_sql_time(&t, &buf[i].val.tmval); - break; - } - continue; - - case SQL_BLOB: - - convert_to_string(b_var); - - if (Z_STRLEN_P(b_var) != BLOB_ID_LEN || - !_php_ibase_string_to_quad(Z_STRVAL_P(b_var), &buf[i].val.qval)) { - - ibase_blob ib_blob = { NULL, BLOB_INPUT }; - - if (isc_create_blob(IB_STATUS, &ib_query->link->handle, - &ib_query->trans->handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - - if (_php_ibase_blob_add(&b_var, &ib_blob TSRMLS_CC) != SUCCESS) { - return FAILURE; - } - - if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - buf[i].val.qval = ib_blob.bl_qd; - } - continue; - - case SQL_ARRAY: - - if (Z_TYPE_P(b_var) != IS_ARRAY) { - convert_to_string(b_var); - - if (Z_STRLEN_P(b_var) != BLOB_ID_LEN || - !_php_ibase_string_to_quad(Z_STRVAL_P(b_var), &buf[i].val.qval)) { - - _php_ibase_module_error("Parameter %d: invalid array ID" TSRMLS_CC,i+1); - rv = FAILURE; - } - } else { - /* convert the array data into something IB can understand */ - ibase_array *ar = &ib_query->in_array[array_cnt]; - void *array_data = emalloc(ar->ar_size); - ISC_QUAD array_id = { 0, 0 }; - - if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size, - ar, 0 TSRMLS_CC)) { - _php_ibase_module_error("Parameter %d: failed to bind array argument" - TSRMLS_CC,i+1); - efree(array_data); - rv = FAILURE; - continue; - } - - if (isc_array_put_slice(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle, - &array_id, &ar->ar_desc, array_data, &ar->ar_size)) { - _php_ibase_error(TSRMLS_C); - efree(array_data); - return FAILURE; - } - buf[i].val.qval = array_id; - efree(array_data); - } - ++array_cnt; - continue; - } /* switch */ - - /* we end up here if none of the switch cases handled the field */ - convert_to_string(b_var); - var->sqldata = Z_STRVAL_P(b_var); - var->sqllen = Z_STRLEN_P(b_var); - var->sqltype = SQL_TEXT; - } /* for */ - return rv; -} -/* }}} */ - -static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda) /* {{{ */ -{ - int i; - - for (i = 0; i < sqlda->sqld; i++) { - XSQLVAR *var = &sqlda->sqlvar[i]; - - switch (var->sqltype & ~1) { - case SQL_TEXT: - var->sqldata = safe_emalloc(sizeof(char), var->sqllen, 0); - break; - case SQL_VARYING: - var->sqldata = safe_emalloc(sizeof(char), var->sqllen + sizeof(short), 0); - break; - case SQL_SHORT: - var->sqldata = emalloc(sizeof(short)); - break; - case SQL_LONG: - var->sqldata = emalloc(sizeof(ISC_LONG)); - break; - case SQL_FLOAT: - var->sqldata = emalloc(sizeof(float)); - break; - case SQL_DOUBLE: - var->sqldata = emalloc(sizeof(double)); - break; - case SQL_INT64: - var->sqldata = emalloc(sizeof(ISC_INT64)); - break; - case SQL_TIMESTAMP: - var->sqldata = emalloc(sizeof(ISC_TIMESTAMP)); - break; - case SQL_TYPE_DATE: - var->sqldata = emalloc(sizeof(ISC_DATE)); - break; - case SQL_TYPE_TIME: - var->sqldata = emalloc(sizeof(ISC_TIME)); - break; - case SQL_BLOB: - case SQL_ARRAY: - var->sqldata = emalloc(sizeof(ISC_QUAD)); - break; - } /* switch */ - - if (var->sqltype & 1) { /* sql NULL flag */ - var->sqlind = emalloc(sizeof(short)); - } else { - var->sqlind = NULL; - } - } /* for */ -} -/* }}} */ - -static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resultp, /* {{{ */ - ibase_query *ib_query, zval ***args) -{ - XSQLDA *in_sqlda = NULL, *out_sqlda = NULL; - BIND_BUF *bind_buf = NULL; - int i, rv = FAILURE; - static char info_count[] = { isc_info_sql_records }; - char result[64]; - ISC_STATUS isc_result; - int argc = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0; - - RESET_ERRMSG; - - for (i = 0; i < argc; ++i) { - SEPARATE_ZVAL(args[i]); - } - - switch (ib_query->statement_type) { - isc_tr_handle tr; - ibase_tr_list **l; - ibase_trans *trans; - - case isc_info_sql_stmt_start_trans: - - /* a SET TRANSACTION statement should be executed with a NULL trans handle */ - tr = NULL; - - if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0, - ib_query->query, ib_query->dialect, NULL)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_exec_error; - } - - trans = (ibase_trans *) emalloc(sizeof(ibase_trans)); - trans->handle = tr; - trans->link_cnt = 1; - trans->affected_rows = 0; - trans->db_link[0] = ib_query->link; - - if (ib_query->link->tr_list == NULL) { - ib_query->link->tr_list = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); - ib_query->link->tr_list->trans = NULL; - ib_query->link->tr_list->next = NULL; - } - - /* link the transaction into the connection-transaction list */ - for (l = &ib_query->link->tr_list; *l != NULL; l = &(*l)->next); - *l = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); - (*l)->trans = trans; - (*l)->next = NULL; - - ZEND_REGISTER_RESOURCE(return_value, trans, le_trans); - - return SUCCESS; - - case isc_info_sql_stmt_commit: - case isc_info_sql_stmt_rollback: - - if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, - &ib_query->trans->handle, 0, ib_query->query, ib_query->dialect, NULL)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_exec_error; - } - - if (ib_query->trans->handle == NULL && ib_query->trans_res_id != 0) { - /* transaction was released by the query and was a registered resource, - so we have to release it */ - zend_list_delete(ib_query->trans_res_id); - } - - RETVAL_TRUE; - - return SUCCESS; - - default: - RETVAL_FALSE; - } - - /* allocate sqlda and output buffers */ - if (ib_query->out_sqlda) { /* output variables in select, select for update */ - ibase_result *res; - - IBDEBUG("Query wants XSQLDA for output"); - res = emalloc(sizeof(ibase_result)+sizeof(ibase_array)*max(0,ib_query->out_array_cnt-1)); - res->link = ib_query->link; - res->trans = ib_query->trans; - res->stmt = ib_query->stmt; - res->statement_type = ib_query->statement_type; - res->has_more_rows = 1; - - out_sqlda = res->out_sqlda = emalloc(XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); - memcpy(out_sqlda, ib_query->out_sqlda, XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); - _php_ibase_alloc_xsqlda(out_sqlda); - - if (ib_query->out_array) { - memcpy(&res->out_array, ib_query->out_array, sizeof(ibase_array)*ib_query->out_array_cnt); - } - *ib_resultp = res; - } - - if (ib_query->in_sqlda) { /* has placeholders */ - IBDEBUG("Query wants XSQLDA for input"); - in_sqlda = emalloc(XSQLDA_LENGTH(ib_query->in_sqlda->sqld)); - memcpy(in_sqlda, ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld)); - bind_buf = safe_emalloc(sizeof(BIND_BUF), ib_query->in_sqlda->sqld, 0); - if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query TSRMLS_CC) == FAILURE) { - IBDEBUG("Could not bind input XSQLDA"); - goto _php_ibase_exec_error; - } - } - - if (ib_query->statement_type == isc_info_sql_stmt_exec_procedure) { - isc_result = isc_dsql_execute2(IB_STATUS, &ib_query->trans->handle, - &ib_query->stmt, SQLDA_CURRENT_VERSION, in_sqlda, out_sqlda); - } else { - isc_result = isc_dsql_execute(IB_STATUS, &ib_query->trans->handle, - &ib_query->stmt, SQLDA_CURRENT_VERSION, in_sqlda); - } - if (isc_result) { - IBDEBUG("Could not execute query"); - _php_ibase_error(TSRMLS_C); - goto _php_ibase_exec_error; - } - ib_query->trans->affected_rows = 0; - - switch (ib_query->statement_type) { - - unsigned long affected_rows; - - case isc_info_sql_stmt_insert: - case isc_info_sql_stmt_update: - case isc_info_sql_stmt_delete: - case isc_info_sql_stmt_exec_procedure: - - if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_count), - info_count, sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_exec_error; - } - - affected_rows = 0; - - if (result[0] == isc_info_sql_records) { - unsigned i = 3, result_size = isc_vax_integer(&result[1],2); - - while (result[i] != isc_info_end && i < result_size) { - short len = (short)isc_vax_integer(&result[i+1],2); - if (result[i] != isc_info_req_select_count) { - affected_rows += isc_vax_integer(&result[i+3],len); - } - i += len+3; - } - } - - ib_query->trans->affected_rows = affected_rows; - - if (!ib_query->out_sqlda) { /* no result set is being returned */ - if (affected_rows) { - RETVAL_LONG(affected_rows); - } else { - /* this return value evaluates to bool(true) and to int(0) */ - RETVAL_STRINGL("0 ",2,1); - } - break; - } - default: - RETVAL_TRUE; - } - - rv = SUCCESS; - -_php_ibase_exec_error: - - if (in_sqlda) { - efree(in_sqlda); - } - if (bind_buf) - efree(bind_buf); - - if (rv == FAILURE) { - if (*ib_resultp) { - efree(*ib_resultp); - *ib_resultp = NULL; - } - if (out_sqlda) { - _php_ibase_free_xsqlda(out_sqlda); - } - } - - return rv; -} -/* }}} */ - -/* {{{ proto mixed ibase_query([resource link_identifier, [ resource link_identifier, ]] string query [, mixed bind_arg [, mixed bind_arg [, ...]]]) - Execute a query */ -PHP_FUNCTION(ibase_query) -{ - zval *zlink, *ztrans, ***bind_args = NULL; - char *query; - int bind_i, query_len; - long trans_res_id = 0; - ibase_db_link *ib_link = NULL; - ibase_trans *trans = NULL; - ibase_query ib_query = { NULL, NULL, 0, 0 }; - ibase_result *result = NULL; - - RESET_ERRMSG; - - RETVAL_FALSE; - - switch (ZEND_NUM_ARGS()) { - long l; - - default: - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3 TSRMLS_CC, "rrs", - &zlink, &ztrans, &query, &query_len)) { - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, &zlink, -1, LE_LINK, le_link, le_plink); - ZEND_FETCH_RESOURCE(trans, ibase_trans*, &ztrans, -1, LE_TRANS, le_trans); - - trans_res_id = Z_LVAL_P(ztrans); - bind_i = 3; - break; - } - case 2: - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2 TSRMLS_CC, "rs", - &zlink, &query, &query_len)) { - _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, &zlink, &ib_link, &trans); - - if (trans != NULL) { - trans_res_id = Z_LVAL_P(zlink); - } - bind_i = 2; - break; - } - - /* the statement is 'CREATE DATABASE ...' if the link argument is IBASE_CREATE */ - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() - TSRMLS_CC, "ls", &l, &query, &query_len) && l == PHP_IBASE_CREATE) { - isc_db_handle db = NULL; - isc_tr_handle trans = NULL; - - if (PG(sql_safe_mode)) { - _php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode" - TSRMLS_CC); - - } else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) { - _php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count " - "(%ld) reached" TSRMLS_CC, l); - - } else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len, - query, SQL_DIALECT_CURRENT, NULL)) { - _php_ibase_error(TSRMLS_C); - - } else if (!db) { - _php_ibase_module_error("Connection to created database could not be " - "established" TSRMLS_CC); - - } else { - - /* register the link as a resource; unfortunately, we cannot register - it in the hash table, because we don't know the connection params */ - ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link)); - ib_link->handle = db; - ib_link->dialect = SQL_DIALECT_CURRENT; - ib_link->tr_list = NULL; - ib_link->event_head = NULL; - - ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link); - zend_list_addref(Z_LVAL_P(return_value)); - IBG(default_link) = Z_LVAL_P(return_value); - ++IBG(num_links); - } - return; - } - case 1: - case 0: - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0 TSRMLS_CC, "s|z", &query, - &query_len)) { - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, - le_link, le_plink); - - bind_i = 1; - break; - } - return; - } - - /* open default transaction */ - if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC) - || FAILURE == _php_ibase_alloc_query(&ib_query, ib_link, trans, query, ib_link->dialect, - trans_res_id TSRMLS_CC)) { - return; - } - - do { - int bind_n = ZEND_NUM_ARGS() - bind_i, - expected_n = ib_query.in_sqlda ? ib_query.in_sqlda->sqld : 0; - - if (bind_n != expected_n) { - php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE, - "Statement expects %d arguments, %d given", expected_n, bind_n); - if (bind_n < expected_n) { - break; - } - } else if (bind_n > 0) { - bind_args = (zval ***) emalloc(sizeof(zval **) * ZEND_NUM_ARGS()); - - if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), bind_args)) { - break; - } - } - - if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, &ib_query, - &bind_args[bind_i])) { - break; - } - - if (result != NULL) { /* statement returns a result */ - result->type = QUERY_RESULT; - - /* EXECUTE PROCEDURE returns only one row => statement can be released immediately */ - if (ib_query.statement_type != isc_info_sql_stmt_exec_procedure) { - ib_query.stmt = NULL; /* keep stmt when free query */ - } - ZEND_REGISTER_RESOURCE(return_value, result, le_result); - } - } while (0); - - _php_ibase_free_query(&ib_query TSRMLS_CC); - - if (bind_args) { - efree(bind_args); - } -} -/* }}} */ - -/* {{{ proto int ibase_affected_rows( [ resource link_identifier ] ) - Returns the number of rows affected by the previous INSERT, UPDATE or DELETE statement */ -PHP_FUNCTION(ibase_affected_rows) -{ - ibase_trans *trans = NULL; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - - ibase_db_link *ib_link; - zval **arg; - - case 0: - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, - le_link, le_plink); - if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) { - RETURN_FALSE; - } - trans = ib_link->tr_list->trans; - break; - - case 1: - if (zend_get_parameters_ex(1, &arg) == FAILURE) { - RETURN_FALSE; - } - /* one id was passed, could be db or trans id */ - _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, arg, &ib_link, &trans); - if (trans == NULL) { - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, arg, -1, LE_LINK, le_link, le_plink); - - if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) { - RETURN_FALSE; - } - trans = ib_link->tr_list->trans; - } - break; - - default: - WRONG_PARAM_COUNT; - break; - } - RETURN_LONG(trans->affected_rows); -} -/* }}} */ - -/* {{{ proto int ibase_num_rows( resource result_identifier ) - Return the number of rows that are available in a result */ -#if abies_0 -PHP_FUNCTION(ibase_num_rows) -{ - /** - * As this function relies on the InterBase API function isc_dsql_sql_info() - * which has a couple of limitations (which I hope will be fixed in future - * releases of Firebird), this function is fairly useless. I'm leaving it - * in place for people who can live with the limitations, which I only - * found out about after I had implemented it anyway. - * - * Currently, there's no way to determine how many rows can be fetched from - * a cursor. The only number that _can_ be determined is the number of rows - * that have already been pre-fetched by the client library. - * This implies the following: - * - num_rows() always returns zero before the first fetch; - * - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a - * higher number than the number of records fetched so far (no pre-fetch); - * - the result of num_rows() for other statements is merely a lower bound - * on the number of records => calling ibase_num_rows() again after a couple - * of fetches will most likely return a new (higher) figure for large result - * sets. - */ - - zval **result_arg; - ibase_result *ib_result; - static char info_count[] = {isc_info_sql_records}; - char result[64]; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); - - if (isc_dsql_sql_info(IB_STATUS, &ib_result->stmt, sizeof(info_count), info_count, - sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - if (result[0] == isc_info_sql_records) { - unsigned i = 3, result_size = isc_vax_integer(&result[1],2); - - while (result[i] != isc_info_end && i < result_size) { - short len = (short)isc_vax_integer(&result[i+1],2); - if (result[i] == isc_info_req_select_count) { - RETURN_LONG(isc_vax_integer(&result[i+3],len)); - } - i += len+3; - } - } -} -#endif -/* }}} */ - -static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */ - int scale, int flag TSRMLS_DC) -{ - static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 100000000, 1000000000, - 1000000000, LL_LIT(10000000000),LL_LIT(100000000000),LL_LIT(10000000000000),LL_LIT(100000000000000), - LL_LIT(1000000000000000),LL_LIT(1000000000000000),LL_LIT(1000000000000000000) }; - - switch (type & ~1) { - unsigned short l; - long n; - char string_data[255]; - struct tm t; - char *format; - - case SQL_VARYING: - len = ((IBVARY *) data)->vary_length; - data = ((IBVARY *) data)->vary_string; - /* no break */ - case SQL_TEXT: - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(val) = php_addslashes(data, len, &Z_STRLEN_P(val), 0 TSRMLS_CC); - Z_TYPE_P(val) = IS_STRING; - } else { - ZVAL_STRINGL(val,(char *) data,len,1); - } - break; - case SQL_SHORT: - n = *(short *) data; - goto _sql_long; - case SQL_INT64: -#if (SIZEOF_LONG >= 8) - n = *(long *) data; - goto _sql_long; -#else - if (scale == 0) { - l = sprintf(string_data, "%" LL_MASK "d", *(ISC_INT64 *) data); - ZVAL_STRINGL(val,string_data,l,1); - } else { - ISC_INT64 n = *(ISC_INT64 *) data, f = scales[-scale]; - - if (n >= 0) { - l = sprintf(string_data, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, n % f); - } else if (n <= -f) { - l = sprintf(string_data, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, -n % f); - } else { - l = sprintf(string_data, "-0.%0*" LL_MASK "d", -scale, -n % f); - } - ZVAL_STRINGL(val,string_data,l,1); - } - break; -#endif - case SQL_LONG: - n = *(ISC_LONG *) data; - _sql_long: - if (scale == 0) { - ZVAL_LONG(val,n); - } else { - long f = (long) scales[-scale]; - - if (n >= 0) { - l = sprintf(string_data, "%ld.%0*ld", n / f, -scale, n % f); - } else if (n <= -f) { - l = sprintf(string_data, "%ld.%0*ld", n / f, -scale, -n % f); - } else { - l = sprintf(string_data, "-0.%0*ld", -scale, -n % f); - } - ZVAL_STRINGL(val,string_data,l,1); - } - break; - case SQL_FLOAT: - ZVAL_DOUBLE(val, *(float *) data); - break; - case SQL_DOUBLE: - ZVAL_DOUBLE(val, *(double *) data); - break; - case SQL_DATE: /* == case SQL_TIMESTAMP: */ - format = INI_STR("ibase.timestampformat"); - isc_decode_timestamp((ISC_TIMESTAMP *) data, &t); - goto format_date_time; - case SQL_TYPE_DATE: - format = INI_STR("ibase.dateformat"); - isc_decode_sql_date((ISC_DATE *) data, &t); - goto format_date_time; - case SQL_TYPE_TIME: - format = INI_STR("ibase.timeformat"); - isc_decode_sql_time((ISC_TIME *) data, &t); - -format_date_time: - /* - XXX - Might have to remove this later - seems that isc_decode_date() - always sets tm_isdst to 0, sometimes incorrectly (InterBase 6 bug?) - */ - t.tm_isdst = -1; -#if HAVE_TM_ZONE - t.tm_zone = tzname[0]; -#endif - if (flag & PHP_IBASE_UNIXTIME) { - ZVAL_LONG(val, mktime(&t)); - } else { -#if HAVE_STRFTIME - l = strftime(string_data, sizeof(string_data), format, &t); -#else - switch (type & ~1) { - default: - l = sprintf(string_data, "%02d/%02d/%4d %02d:%02d:%02d", t.tm_mon+1, t.tm_mday, - t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec); - break; - case SQL_TYPE_DATE: - l = sprintf(string_data, "%02d/%02d/%4d", t.tm_mon + 1, t.tm_mday, t.tm_year+1900); - break; - case SQL_TYPE_TIME: - l = sprintf(string_data, "%02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); - break; - } -#endif - ZVAL_STRINGL(val,string_data,l,1); - break; - } - } /* switch (type) */ - return SUCCESS; -} -/* }}} */ - -static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_size, /* {{{ */ - ibase_array *ib_array, int dim, int flag TSRMLS_DC) -{ - /** - * Create multidimension array - recursion function - */ - int - u_bound = ib_array->ar_desc.array_desc_bounds[dim].array_bound_upper, - l_bound = ib_array->ar_desc.array_desc_bounds[dim].array_bound_lower, - dim_len = 1 + u_bound - l_bound; - unsigned short i; - - if (dim < ib_array->ar_desc.array_desc_dimensions) { /* array again */ - unsigned long slice_size = data_size / dim_len; - - array_init(ar_zval); - - for (i = 0; i < dim_len; ++i) { - zval *slice_zval; - ALLOC_INIT_ZVAL(slice_zval); - - /* recursion here */ - if (FAILURE == _php_ibase_arr_zval(slice_zval, data, slice_size, ib_array, dim + 1, - flag TSRMLS_CC)) { - return FAILURE; - } - data += slice_size; - - add_index_zval(ar_zval,l_bound+i,slice_zval); - } - } else { /* data at last */ - - if (FAILURE == _php_ibase_var_zval(ar_zval, data, ib_array->el_type, - ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag TSRMLS_CC)) { - return FAILURE; - } - - /* fix for peculiar handling of VARCHAR arrays; - truncate the field to the cstring length */ - if (ib_array->ar_desc.array_desc_dtype == blr_varying || - ib_array->ar_desc.array_desc_dtype == blr_varying2) { - - Z_STRLEN_P(ar_zval) = strlen(Z_STRVAL_P(ar_zval)); - } - } - return SUCCESS; -} -/* }}} */ - -static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) /* {{{ */ -{ - zval **result_arg, **flag_arg; - long i, array_cnt = 0, flag = 0; - ibase_result *ib_result; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (FAILURE == zend_get_parameters_ex(1, &result_arg)) { - RETURN_FALSE; - } - break; - case 2: - if (FAILURE == zend_get_parameters_ex(2, &result_arg, &flag_arg)) { - RETURN_FALSE; - } - convert_to_long_ex(flag_arg); - flag = Z_LVAL_PP(flag_arg); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); - - if (ib_result->out_sqlda == NULL || !ib_result->has_more_rows) { - RETURN_FALSE; - } - - if (ib_result->statement_type != isc_info_sql_stmt_exec_procedure) { - - if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1, ib_result->out_sqlda)) { - - ib_result->has_more_rows = 0; - if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */ - _php_ibase_error(TSRMLS_C); - } - RETURN_FALSE; - } - } else { - ib_result->has_more_rows = 0; - } - - array_init(return_value); - - for (i = 0; i < ib_result->out_sqlda->sqld; ++i) { - XSQLVAR *var = &ib_result->out_sqlda->sqlvar[i]; - char buf[METADATALENGTH+4], *alias = var->aliasname; - - if (! (fetch_type & FETCH_ROW)) { - int i = 0; - char const *base = "FIELD"; /* use 'FIELD' if name is empty */ - - /** - * Ensure no two columns have identical names: - * keep generating new names until we find one that is unique. - */ - switch (*alias) { - void *p; - - default: - i = 1; - base = alias; - - while (SUCCESS == zend_symtable_find( - Z_ARRVAL_P(return_value),alias,strlen(alias)+1,&p)) { - - case '\0': - sprintf(alias = buf, "%s_%02d", base, i++); - } - } - } - - if (((var->sqltype & 1) == 0) || *var->sqlind != -1) { - zval *result; - ALLOC_INIT_ZVAL(result); - - switch (var->sqltype & ~1) { - - default: - _php_ibase_var_zval(result, var->sqldata, var->sqltype, var->sqllen, - var->sqlscale, flag TSRMLS_CC); - break; - case SQL_BLOB: - if (flag & PHP_IBASE_FETCH_BLOBS) { /* fetch blob contents into hash */ - - ibase_blob blob_handle; - unsigned long max_len = 0; - static char bl_items[] = {isc_info_blob_total_length}; - char bl_info[20]; - unsigned short i; - - blob_handle.bl_handle = NULL; - blob_handle.bl_qd = *(ISC_QUAD *) var->sqldata; - - if (isc_open_blob(IB_STATUS, &ib_result->link->handle, &ib_result->trans->handle, - &blob_handle.bl_handle, &blob_handle.bl_qd)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_fetch_error; - } - - if (isc_blob_info(IB_STATUS, &blob_handle.bl_handle, sizeof(bl_items), - bl_items, sizeof(bl_info), bl_info)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_fetch_error; - } - - /* find total length of blob's data */ - for (i = 0; i < sizeof(bl_info); ) { - unsigned short item_len; - char item = bl_info[i++]; - - if (item == isc_info_end || item == isc_info_truncated || - item == isc_info_error || i >= sizeof(bl_info)) { - - _php_ibase_module_error("Could not determine BLOB size (internal error)" - TSRMLS_CC); - goto _php_ibase_fetch_error; - } - - item_len = (unsigned short) isc_vax_integer(&bl_info[i], 2); - - if (item == isc_info_blob_total_length) { - max_len = isc_vax_integer(&bl_info[i+2], item_len); - break; - } - i += item_len+2; - } - - if (max_len == 0) { - ZVAL_STRING(result, "", 1); - } else if (SUCCESS != _php_ibase_blob_get(result, &blob_handle, - max_len TSRMLS_CC)) { - goto _php_ibase_fetch_error; - } - - if (isc_close_blob(IB_STATUS, &blob_handle.bl_handle)) { - _php_ibase_error(TSRMLS_C); - goto _php_ibase_fetch_error; - } - - } else { /* blob id only */ - ISC_QUAD bl_qd = *(ISC_QUAD *) var->sqldata; - ZVAL_STRINGL(result,_php_ibase_quad_to_string(bl_qd), BLOB_ID_LEN, 0); - } - break; - case SQL_ARRAY: - if (flag & PHP_IBASE_FETCH_ARRAYS) { /* array can be *huge* so only fetch if asked */ - ISC_QUAD ar_qd = *(ISC_QUAD *) var->sqldata; - ibase_array *ib_array = &ib_result->out_array[array_cnt++]; - void *ar_data = emalloc(ib_array->ar_size); - - if (isc_array_get_slice(IB_STATUS, &ib_result->link->handle, - &ib_result->trans->handle, &ar_qd, &ib_array->ar_desc, - ar_data, &ib_array->ar_size)) { - _php_ibase_error(TSRMLS_C); - efree(ar_data); - goto _php_ibase_fetch_error; - } - - if (FAILURE == _php_ibase_arr_zval(result, ar_data, ib_array->ar_size, ib_array, - 0, flag TSRMLS_CC)) { - efree(ar_data); - goto _php_ibase_fetch_error; - } - efree(ar_data); - - } else { /* blob id only */ - ISC_QUAD ar_qd = *(ISC_QUAD *) var->sqldata; - ZVAL_STRINGL(result,_php_ibase_quad_to_string(ar_qd), BLOB_ID_LEN, 0); - } - break; - _php_ibase_fetch_error: - zval_dtor(result); - FREE_ZVAL(result); - RETURN_FALSE; - } /* switch */ - - if (fetch_type & FETCH_ROW) { - add_index_zval(return_value, i, result); - } else { - add_assoc_zval(return_value, alias, result); - } - } else { - if (fetch_type & FETCH_ROW) { - add_index_null(return_value, i); - } else { - add_assoc_null(return_value, alias); - } - } - } /* for field */ -} -/* }}} */ - -/* {{{ proto array ibase_fetch_row(resource result [, int fetch_flags]) - Fetch a row from the results of a query */ -PHP_FUNCTION(ibase_fetch_row) -{ - _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FETCH_ROW); -} -/* }}} */ - -/* {{{ proto array ibase_fetch_assoc(resource result [, int fetch_flags]) - Fetch a row from the results of a query */ -PHP_FUNCTION(ibase_fetch_assoc) -{ - _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FETCH_ARRAY); -} -/* }}} */ - -/* {{{ proto object ibase_fetch_object(resource result [, int fetch_flags]) - Fetch a object from the results of a query */ -PHP_FUNCTION(ibase_fetch_object) -{ - _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FETCH_ARRAY); - - if (Z_TYPE_P(return_value) == IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - - -/* {{{ proto bool ibase_name_result(resource result, string name) - Assign a name to a result for use with ... WHERE CURRENT OF statements */ -PHP_FUNCTION(ibase_name_result) -{ - zval **result_arg, **name_arg; - ibase_result *ib_result; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result_arg, &name_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); - convert_to_string_ex(name_arg); - - if (isc_dsql_set_cursor_name(IB_STATUS, &ib_result->stmt, Z_STRVAL_PP(name_arg), 0)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool ibase_free_result(resource result) - Free the memory used by a result */ -PHP_FUNCTION(ibase_free_result) -{ - zval **result_arg; - ibase_result *ib_result; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); - zend_list_delete(Z_LVAL_PP(result_arg)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto resource ibase_prepare([resource link_identifier, ] string query) - Prepare a query for later execution */ -PHP_FUNCTION(ibase_prepare) -{ - zval **link_arg, **trans_arg, **query_arg; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - int trans_res_id = 0; - ibase_query *ib_query; - char *query; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query_arg) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, - le_link, le_plink); - break; - case 2: - if (zend_get_parameters_ex(2, &link_arg, &query_arg) == FAILURE) { - RETURN_FALSE; - } - _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, link_arg, &ib_link, &trans); - - if (trans != NULL) { - convert_to_long_ex(link_arg); - trans_res_id = Z_LVAL_PP(link_arg); - } - - break; - case 3: - if (zend_get_parameters_ex(3, &link_arg, &trans_arg, &query_arg) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, link_arg, -1, LE_LINK, le_link, le_plink); - ZEND_FETCH_RESOURCE(trans, ibase_trans*, trans_arg, -1, LE_TRANS, le_trans); - - convert_to_long_ex(trans_arg); - trans_res_id = Z_LVAL_PP(trans_arg); - - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(query_arg); - query = Z_STRVAL_PP(query_arg); - - if (FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)) { - RETURN_FALSE; - } - - ib_query = (ibase_query *) emalloc(sizeof(ibase_query)); - - if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, - trans_res_id TSRMLS_CC)) { - efree(ib_query); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, ib_query, le_query); -} -/* }}} */ - -/* {{{ proto mixed ibase_execute(resource query [, mixed bind_arg [, mixed bind_arg [, ...]]]) - Execute a previously prepared query */ -PHP_FUNCTION(ibase_execute) -{ - zval *query, ***args = NULL; - ibase_query *ib_query; - ibase_result *result = NULL; - - RESET_ERRMSG; - - RETVAL_FALSE; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0 TSRMLS_CC, "r", &query)) { - return; - } - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, &query, -1, LE_QUERY, le_query); - - do { - int bind_n = ZEND_NUM_ARGS() - 1, - expected_n = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0; - - if (bind_n != expected_n) { - php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE, - "Statement expects %d arguments, %d given", expected_n, bind_n); - if (bind_n < expected_n) { - break; - } - - } else if (bind_n > 0) { /* have variables to bind */ - args = (zval ***) do_alloca(ZEND_NUM_ARGS() * sizeof(zval **)); - - if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args)) { - break; - } - } - - /* Have we used this cursor before and it's still open (exec proc has no cursor) ? */ - if (ib_query->result_res_id != 0 - && ib_query->statement_type != isc_info_sql_stmt_exec_procedure) { - IBDEBUG("Implicitly closing a cursor"); - - if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_close)) { - _php_ibase_error(TSRMLS_C); - break; - } - /* invalidate previous results returned by this query (not necessary for exec proc) */ - zend_list_delete(ib_query->result_res_id); - } - - if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, ib_query, - &args[1])) { - break; - } - - /* free the query if trans handle was released */ - if (ib_query->trans->handle == NULL) { - zend_list_delete(Z_LVAL_P(query)); - } - - if (result != NULL) { - result->type = EXECUTE_RESULT; - if (ib_query->statement_type == isc_info_sql_stmt_exec_procedure) { - result->stmt = NULL; - } - ib_query->result_res_id = zend_list_insert(result, le_result); - RETVAL_RESOURCE(ib_query->result_res_id); - } - } while (0); - - if (args) { - free_alloca(args); - } -} -/* }}} */ - -/* {{{ proto bool ibase_free_query(resource query) - Free memory used by a query */ -PHP_FUNCTION(ibase_free_query) -{ - zval **query_arg; - ibase_query *ib_query; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &query_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, query_arg, -1, LE_QUERY, le_query); - zend_list_delete(Z_LVAL_PP(query_arg)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ibase_num_fields(resource query_result) - Get the number of fields in result */ -PHP_FUNCTION(ibase_num_fields) -{ - zval **result; - int type; - XSQLDA *sqlda; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - zend_list_find(Z_LVAL_PP(result), &type); - - if (type == le_query) { - ibase_query *ib_query; - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, result, -1, LE_QUERY, le_query); - sqlda = ib_query->out_sqlda; - } else { - ibase_result *ib_result; - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result, -1, LE_RESULT, le_result); - sqlda = ib_result->out_sqlda; - } - - if (sqlda == NULL) { - RETURN_LONG(0); - } else { - RETURN_LONG(sqlda->sqld); - } -} -/* }}} */ - -static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */ -{ - unsigned short len; - char buf[16], *s = buf; - - array_init(return_value); - - add_index_stringl(return_value, 0, var->sqlname, var->sqlname_length, 1); - add_assoc_stringl(return_value, "name", var->sqlname, var->sqlname_length, 1); - - add_index_stringl(return_value, 1, var->aliasname, var->aliasname_length, 1); - add_assoc_stringl(return_value, "alias", var->aliasname, var->aliasname_length, 1); - - add_index_stringl(return_value, 2, var->relname, var->relname_length, 1); - add_assoc_stringl(return_value, "relation", var->relname, var->relname_length, 1); - - len = sprintf(buf, "%d", var->sqllen); - add_index_stringl(return_value, 3, buf, len, 1); - add_assoc_stringl(return_value, "length", buf, len, 1); - - if (var->sqlscale < 0) { - unsigned short precision = 0; - - switch (var->sqltype & ~1) { - - case SQL_SHORT: - precision = 4; - break; - case SQL_LONG: - precision = 9; - break; - case SQL_INT64: - precision = 18; - break; - } - len = sprintf(buf, "NUMERIC(%d,%d)", precision, -var->sqlscale); - add_index_stringl(return_value, 4, s, len, 1); - add_assoc_stringl(return_value, "type", s, len, 1); - } else { - switch (var->sqltype & ~1) { - case SQL_TEXT: - s = "CHAR"; - break; - case SQL_VARYING: - s = "VARCHAR"; - break; - case SQL_SHORT: - s = "SMALLINT"; - break; - case SQL_LONG: - s = "INTEGER"; - break; - case SQL_FLOAT: - s = "FLOAT"; break; - case SQL_DOUBLE: - case SQL_D_FLOAT: - s = "DOUBLE PRECISION"; break; - case SQL_INT64: - s = "BIGINT"; - break; - case SQL_TIMESTAMP: - s = "TIMESTAMP"; - break; - case SQL_TYPE_DATE: - s = "DATE"; - break; - case SQL_TYPE_TIME: - s = "TIME"; - break; - case SQL_BLOB: - s = "BLOB"; - break; - case SQL_ARRAY: - s = "ARRAY"; - break; - /* FIXME: provide more detailed information about the field type, field size - * and array dimensions */ - case SQL_QUAD: - s = "QUAD"; - break; - } - add_index_string(return_value, 4, s, 1); - add_assoc_string(return_value, "type", s, 1); - } -} -/* }}} */ - -/* {{{ proto array ibase_field_info(resource query_result, int field_number) - Get information about a field */ -PHP_FUNCTION(ibase_field_info) -{ - zval **result_arg, **field_arg; - int type; - XSQLDA *sqlda; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &result_arg, &field_arg)==FAILURE) { - WRONG_PARAM_COUNT; - } - - zend_list_find(Z_LVAL_PP(result_arg), &type); - - if (type == le_query) { - ibase_query *ib_query; - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, result_arg, -1, LE_QUERY, le_query); - sqlda = ib_query->out_sqlda; - } else { - ibase_result *ib_result; - - ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); - sqlda = ib_result->out_sqlda; - } - - if (sqlda == NULL) { - _php_ibase_module_error("Trying to get field info from a non-select query" TSRMLS_CC); - RETURN_FALSE; - } - - convert_to_long_ex(field_arg); - - if (Z_LVAL_PP(field_arg) < 0 || Z_LVAL_PP(field_arg) >= sqlda->sqld) { - RETURN_FALSE; - } - _php_ibase_field_info(return_value,sqlda->sqlvar + Z_LVAL_PP(field_arg)); -} -/* }}} */ - -/* {{{ proto int ibase_num_params(resource query) - Get the number of params in a prepared query */ -PHP_FUNCTION(ibase_num_params) -{ - zval **result; - ibase_query *ib_query; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, result, -1, LE_QUERY, le_query); - - if (ib_query->in_sqlda == NULL) { - RETURN_LONG(0); - } else { - RETURN_LONG(ib_query->in_sqlda->sqld); - } -} -/* }}} */ - -/* {{{ proto array ibase_param_info(resource query, int field_number) - Get information about a parameter */ -PHP_FUNCTION(ibase_param_info) -{ - zval **result_arg, **field_arg; - ibase_query *ib_query; - - RESET_ERRMSG; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result_arg, &field_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ib_query, ibase_query *, result_arg, -1, LE_QUERY, le_query); - - if (ib_query->in_sqlda == NULL) { - RETURN_FALSE; - } - - convert_to_long_ex(field_arg); - - if (Z_LVAL_PP(field_arg) < 0 || Z_LVAL_PP(field_arg) >= ib_query->in_sqlda->sqld) { - RETURN_FALSE; - } - - _php_ibase_field_info(return_value,ib_query->in_sqlda->sqlvar + Z_LVAL_PP(field_arg)); -} -/* }}} */ - -#endif /* HAVE_IBASE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c deleted file mode 100644 index 6bd98c2092cd9..0000000000000 --- a/ext/interbase/ibase_service.c +++ /dev/null @@ -1,629 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_IBASE - -#include "php_interbase.h" -#include "php_ibase_includes.h" - -typedef struct { - isc_svc_handle handle; - char *hostname; - char *username; - long res_id; -} ibase_service; - -static int le_service; - -static void _php_ibase_free_service(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_service *sv = (ibase_service *) rsrc->ptr; - - if (isc_service_detach(IB_STATUS, &sv->handle)) { - _php_ibase_error(TSRMLS_C); - } - - if (sv->hostname) { - efree(sv->hostname); - } - if (sv->username) { - efree(sv->username); - } - - efree(sv); -} -/* }}} */ - -/* the svc api seems to get confused after an error has occurred, - so invalidate the handle on errors */ -#define IBASE_SVC_ERROR(svm) \ - do { zend_list_delete(svm->res_id); _php_ibase_error(TSRMLS_C); } while (0) - - -void php_ibase_service_minit(INIT_FUNC_ARGS) /* {{{ */ -{ - le_service = zend_register_list_destructors_ex(_php_ibase_free_service, NULL, - "interbase service manager handle", module_number); - - /* backup options */ - REGISTER_LONG_CONSTANT("IBASE_BKP_IGNORE_CHECKSUMS", isc_spb_bkp_ignore_checksums, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_IGNORE_LIMBO", isc_spb_bkp_ignore_limbo, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_METADATA_ONLY", isc_spb_bkp_metadata_only, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_NO_GARBAGE_COLLECT", isc_spb_bkp_no_garbage_collect, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_OLD_DESCRIPTIONS", isc_spb_bkp_old_descriptions, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_NON_TRANSPORTABLE", isc_spb_bkp_non_transportable, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_BKP_CONVERT", isc_spb_bkp_convert, CONST_PERSISTENT); - - /* restore options */ - REGISTER_LONG_CONSTANT("IBASE_RES_DEACTIVATE_IDX", isc_spb_res_deactivate_idx, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_NO_SHADOW", isc_spb_res_no_shadow, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_NO_VALIDITY", isc_spb_res_no_validity, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_ONE_AT_A_TIME", isc_spb_res_one_at_a_time, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_REPLACE", isc_spb_res_replace, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_CREATE", isc_spb_res_create, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RES_USE_ALL_SPACE", isc_spb_res_use_all_space, CONST_PERSISTENT); - - /* manage options */ - REGISTER_LONG_CONSTANT("IBASE_PRP_PAGE_BUFFERS", isc_spb_prp_page_buffers, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_SWEEP_INTERVAL", isc_spb_prp_sweep_interval, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_SHUTDOWN_DB", isc_spb_prp_shutdown_db, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_DENY_NEW_TRANSACTIONS", isc_spb_prp_deny_new_transactions, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_DENY_NEW_ATTACHMENTS", isc_spb_prp_deny_new_attachments, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_RESERVE_SPACE", isc_spb_prp_reserve_space, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_RES_USE_FULL", isc_spb_prp_res_use_full, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_RES", isc_spb_prp_res, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_WRITE_MODE", isc_spb_prp_write_mode, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_WM_ASYNC", isc_spb_prp_wm_async, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_WM_SYNC", isc_spb_prp_wm_sync, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_ACCESS_MODE", isc_spb_prp_access_mode, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_AM_READONLY", isc_spb_prp_am_readonly, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_AM_READWRITE", isc_spb_prp_am_readwrite, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_SET_SQL_DIALECT", isc_spb_prp_set_sql_dialect, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_ACTIVATE", isc_spb_prp_activate, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_PRP_DB_ONLINE", isc_spb_prp_db_online, CONST_PERSISTENT); - - /* repair options */ - REGISTER_LONG_CONSTANT("IBASE_RPR_CHECK_DB", isc_spb_rpr_check_db, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_IGNORE_CHECKSUM", isc_spb_rpr_ignore_checksum, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_KILL_SHADOWS", isc_spb_rpr_kill_shadows, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_MEND_DB", isc_spb_rpr_mend_db, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_VALIDATE_DB", isc_spb_rpr_validate_db, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_FULL", isc_spb_rpr_full, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_RPR_SWEEP_DB", isc_spb_rpr_sweep_db, CONST_PERSISTENT); - - /* db info arguments */ - REGISTER_LONG_CONSTANT("IBASE_STS_DATA_PAGES", isc_spb_sts_data_pages, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_STS_DB_LOG", isc_spb_sts_db_log, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_STS_HDR_PAGES", isc_spb_sts_hdr_pages, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_STS_IDX_PAGES", isc_spb_sts_idx_pages, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_STS_SYS_RELATIONS", isc_spb_sts_sys_relations, CONST_PERSISTENT); - - /* server info arguments */ - REGISTER_LONG_CONSTANT("IBASE_SVC_SERVER_VERSION", isc_info_svc_server_version, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_IMPLEMENTATION", isc_info_svc_implementation, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_GET_ENV", isc_info_svc_get_env, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_GET_ENV_LOCK", isc_info_svc_get_env_lock, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_GET_ENV_MSG", isc_info_svc_get_env_msg, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_USER_DBPATH", isc_info_svc_user_dbpath, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_SVR_DB_INFO", isc_info_svc_svr_db_info, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_SVC_GET_USERS", isc_info_svc_get_users, CONST_PERSISTENT); -} -/* }}} */ - -static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{ */ -{ - /* user = 0, password = 1, first_name = 2, middle_name = 3, last_name = 4 */ - static char const user_flags[] = { isc_spb_sec_username, isc_spb_sec_password, - isc_spb_sec_firstname, isc_spb_sec_middlename, isc_spb_sec_lastname }; - char buf[128], *args[] = { NULL, NULL, NULL, NULL, NULL }; - int i, args_len[] = { 0, 0, 0, 0, 0 }; - unsigned short spb_len = 1; - zval *res; - ibase_service *svm; - - RESET_ERRMSG; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - (operation == isc_action_svc_delete_user) ? "rs" : "rss|sss", - &res, &args[0], &args_len[0], &args[1], &args_len[1], &args[2], &args_len[2], - &args[3], &args_len[3], &args[4], &args_len[4])) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(svm, ibase_service *, &res, -1, "Interbase service manager handle", - le_service); - - buf[0] = operation; - - for (i = 0; i < sizeof(user_flags); ++i) { - if (args[i] != NULL) { - int chunk = snprintf(&buf[spb_len], sizeof(buf) - spb_len, "%c%c%c%s", - user_flags[i], (char)args_len[i], (char)(args_len[i] >> 8), args[i]); - - if ((spb_len + chunk) > sizeof(buf) || chunk <= 0) { - _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" - TSRMLS_CC, spb_len); - RETURN_FALSE; - } - spb_len += chunk; - } - } - - /* now start the job */ - if (isc_service_start(IB_STATUS, &svm->handle, NULL, spb_len, buf)) { - IBASE_SVC_ERROR(svm); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ibase_add_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]]) - Add a user to security database */ -PHP_FUNCTION(ibase_add_user) -{ - _php_ibase_user(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_add_user); -} -/* }}} */ - -/* {{{ proto bool ibase_modify_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]]) - Modify a user in security database */ -PHP_FUNCTION(ibase_modify_user) -{ - _php_ibase_user(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_modify_user); -} -/* }}} */ - -/* {{{ proto bool ibase_delete_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]]) - Delete a user from security database */ -PHP_FUNCTION(ibase_delete_user) -{ - _php_ibase_user(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_delete_user); -} -/* }}} */ - -/* {{{ proto resource ibase_service_attach(string host, string dba_username, string dba_password) - Connect to the service manager */ -PHP_FUNCTION(ibase_service_attach) -{ - int hlen, ulen, plen, spb_len; - ibase_service *svm; - char buf[128], *host, *user, *pass, *loc; - isc_svc_handle handle = NULL; - - RESET_ERRMSG; - - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", - &host, &hlen, &user, &ulen, &pass, &plen)) { - - RETURN_FALSE; - } - - /* construct the spb, hack the service name into it as well */ - spb_len = snprintf(buf, sizeof(buf), "%c%c%c%c%s%c%c%s" "%s:service_mgr", - isc_spb_version, isc_spb_current_version, isc_spb_user_name, (char)ulen, - user, isc_spb_password, (char)plen, pass, host); - - if (spb_len > sizeof(buf) || spb_len == -1) { - _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)" - TSRMLS_CC, spb_len); - RETURN_FALSE; - } - - spb_len -= hlen + 12; - loc = buf + spb_len; /* points to %s:service_mgr part */ - - /* attach to the service manager */ - if (isc_service_attach(IB_STATUS, 0, loc, &handle, (unsigned short)spb_len, buf)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - svm = (ibase_service*)emalloc(sizeof(ibase_service)); - svm->handle = handle; - svm->hostname = estrdup(host); - svm->username = estrdup(user); - - ZEND_REGISTER_RESOURCE(return_value, svm, le_service); - svm->res_id = Z_LVAL_P(return_value); -} -/* }}} */ - -/* {{{ proto bool ibase_service_detach(resource service_handle) - Disconnect from the service manager */ -PHP_FUNCTION(ibase_service_detach) -{ - zval *res; - - RESET_ERRMSG; - - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res)) { - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_P(res)); - - RETURN_TRUE; -} -/* }}} */ - -static void _php_ibase_service_query(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */ - ibase_service *svm, char info_action) -{ - static char spb[] = { isc_info_svc_timeout, 10, 0, 0, 0 }; - - char res_buf[400], *result, *heap_buf = NULL, *heap_p; - long heap_buf_size = 200, line_len; - - /* info about users requires an action first */ - if (info_action == isc_info_svc_get_users) { - static char action[] = { isc_action_svc_display_user }; - - if (isc_service_start(IB_STATUS, &svm->handle, NULL, sizeof(action), action)) { - IBASE_SVC_ERROR(svm); - RETURN_FALSE; - } - } - -query_loop: - result = res_buf; - - if (isc_service_query(IB_STATUS, &svm->handle, NULL, sizeof(spb), spb, - 1, &info_action, sizeof(res_buf), res_buf)) { - - IBASE_SVC_ERROR(svm); - RETURN_FALSE; - } - while (*result != isc_info_end) { - switch (*result++) { - default: - RETURN_FALSE; - - case isc_info_svc_line: - if (! (line_len = isc_vax_integer(result, 2))) { - /* done */ - if (heap_buf) { - RETURN_STRING(heap_buf,0); - } else { - RETURN_TRUE; - } - } - if (!heap_buf || (heap_p - heap_buf + line_len +2) > heap_buf_size) { - long res_size = heap_buf ? heap_p - heap_buf : 0; - - while (heap_buf_size < (res_size + line_len +2)) { - heap_buf_size *= 2; - } - heap_buf = (char*) erealloc(heap_buf, heap_buf_size); - heap_p = heap_buf + res_size; - } - result += 2; - sprintf(heap_p, "%s\n", result); - heap_p += line_len +2; - goto query_loop; /* repeat until result is exhausted */ - - case isc_info_svc_server_version: - case isc_info_svc_implementation: - case isc_info_svc_get_env: - case isc_info_svc_get_env_lock: - case isc_info_svc_get_env_msg: - case isc_info_svc_user_dbpath: - RETURN_STRINGL(result + 2, isc_vax_integer(result, 2), 1); - - case isc_info_svc_svr_db_info: - array_init(return_value); - - do { - switch (*result++) { - int len; - - case isc_spb_num_att: - add_assoc_long(return_value, "attachments", isc_vax_integer(result,4)); - result += 4; - break; - - case isc_spb_num_db: - add_assoc_long(return_value, "databases", isc_vax_integer(result,4)); - result += 4; - break; - - case isc_spb_dbname: - len = isc_vax_integer(result,2); - add_next_index_stringl(return_value, result +2, len, 1); - result += len+2; - } - } while (*result != isc_info_flag_end); - return; - - case isc_info_svc_get_users: { - zval *user; - array_init(return_value); - - while (*result != isc_info_end) { - - switch (*result++) { - int len; - - case isc_spb_sec_username: - /* it appears that the username is always first */ - ALLOC_INIT_ZVAL(user); - array_init(user); - add_next_index_zval(return_value, user); - - len = isc_vax_integer(result,2); - add_assoc_stringl(user, "user_name", result +2, len, 1); - result += len+2; - break; - - case isc_spb_sec_firstname: - len = isc_vax_integer(result,2); - add_assoc_stringl(user, "first_name", result +2, len, 1); - result += len+2; - break; - - case isc_spb_sec_middlename: - len = isc_vax_integer(result,2); - add_assoc_stringl(user, "middle_name", result +2, len, 1); - result += len+2; - break; - - case isc_spb_sec_lastname: - len = isc_vax_integer(result,2); - add_assoc_stringl(user, "last_name", result +2, len, 1); - result += len+2; - break; - - case isc_spb_sec_userid: - add_assoc_long(user, "user_id", isc_vax_integer(result, 4)); - result += 4; - break; - - case isc_spb_sec_groupid: - add_assoc_long(user, "group_id", isc_vax_integer(result, 4)); - result += 4; - break; - } - } - return; - } - } - } -} -/* }}} */ - -static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{ */ -{ - /** - * It appears that the service API is a little bit confused about which flag - * to use for the source and destination in the case of a restore operation. - * When passing the backup file as isc_spb_dbname and the destination db as - * bpk_file, things work well. - */ - zval *res; - char *db, *bk, buf[200]; - long dblen, bklen, spb_len, opts = 0; - zend_bool verbose = 0; - ibase_service *svm; - - RESET_ERRMSG; - - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|lb", - &res, &db, &dblen, &bk, &bklen, &opts, &verbose)) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(svm, ibase_service *, &res, -1, - "Interbase service manager handle", le_service); - - /* fill the param buffer */ - spb_len = snprintf(buf, sizeof(buf), "%c%c%c%c%s%c%c%c%s%c%c%c%c%c", - operation, isc_spb_dbname, (char)dblen, (char)(dblen >> 8), db, - isc_spb_bkp_file, (char)bklen, (char)(bklen >> 8), bk, isc_spb_options, - (char)opts,(char)(opts >> 8), (char)(opts >> 16), (char)(opts >> 24)); - - if (verbose) { - buf[spb_len++] = isc_spb_verbose; - } - - if (spb_len > sizeof(buf) || spb_len <= 0) { - _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)" - TSRMLS_CC, spb_len); - RETURN_FALSE; - } - - /* now start the backup/restore job */ - if (isc_service_start(IB_STATUS, &svm->handle, NULL, (unsigned short)spb_len, buf)) { - IBASE_SVC_ERROR(svm); - RETURN_FALSE; - } - - if (!verbose) { - RETURN_TRUE; - } else { - _php_ibase_service_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, svm, isc_info_svc_line); - } -} -/* }}} */ - -/* {{{ proto mixed ibase_backup(resource service_handle, string source_db, string dest_file [, int options [, bool verbose]]) - Initiates a backup task in the service manager and returns immediately */ -PHP_FUNCTION(ibase_backup) -{ - _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_backup); -} -/* }}} */ - -/* {{{ proto mixed ibase_restore(resource service_handle, string source_file, string dest_db [, int options [, bool verbose]]) - Initiates a restore task in the service manager and returns immediately */ -PHP_FUNCTION(ibase_restore) -{ - _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_restore); -} -/* }}} */ - -static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_action) /* {{{ */ -{ - zval *res; - char buf[128], *db; - long action, spb_len, dblen, argument = 0; - ibase_service *svm; - - RESET_ERRMSG; - - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl|l", - &res, &db, &dblen, &action, &argument)) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(svm, ibase_service *, &res, -1, - "Interbase service manager handle", le_service); - - if (svc_action == isc_action_svc_db_stats) { - switch (action) { - default: - goto unknown_option; - - case isc_spb_sts_data_pages: - case isc_spb_sts_db_log: - case isc_spb_sts_hdr_pages: - case isc_spb_sts_idx_pages: - case isc_spb_sts_sys_relations: - goto options_argument; - } - } else { - /* these actions all expect different types of arguments */ - switch (action) { - default: -unknown_option: - _php_ibase_module_error("Unrecognised option (%ld)" TSRMLS_CC, action); - RETURN_FALSE; - - case isc_spb_rpr_check_db: - case isc_spb_rpr_ignore_checksum: - case isc_spb_rpr_kill_shadows: - case isc_spb_rpr_mend_db: - case isc_spb_rpr_validate_db: - case isc_spb_rpr_sweep_db: - svc_action = isc_action_svc_repair; - - case isc_spb_prp_activate: - case isc_spb_prp_db_online: -options_argument: - argument |= action; - action = isc_spb_options; - - case isc_spb_prp_page_buffers: - case isc_spb_prp_sweep_interval: - case isc_spb_prp_shutdown_db: - case isc_spb_prp_deny_new_transactions: - case isc_spb_prp_deny_new_attachments: - case isc_spb_prp_set_sql_dialect: - spb_len = snprintf(buf, sizeof(buf), "%c%c%c%c%s%c%c%c%c%c", - svc_action, isc_spb_dbname, (char)dblen, (char)(dblen >> 8), db, - (char)action, (char)argument, (char)(argument >> 8), (char)(argument >> 16), - (char)(argument >> 24)); - break; - - case isc_spb_prp_reserve_space: - case isc_spb_prp_write_mode: - case isc_spb_prp_access_mode: - spb_len = snprintf(buf, sizeof(buf), "%c%c%c%c%s%c%c", - isc_action_svc_properties, isc_spb_dbname, (char)dblen, (char)(dblen >> 8), - db, (char)action, (char)argument); - } - } - - if (spb_len > sizeof(buf) || spb_len == -1) { - _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)" - TSRMLS_CC, spb_len); - RETURN_FALSE; - } - - if (isc_service_start(IB_STATUS, &svm->handle, NULL, (unsigned short)spb_len, buf)) { - IBASE_SVC_ERROR(svm); - RETURN_FALSE; - } - - if (svc_action == isc_action_svc_db_stats) { - _php_ibase_service_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, svm, isc_info_svc_line); - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ibase_maintain_db(resource service_handle, string db, int action [, int argument]) - Execute a maintenance command on the database server */ -PHP_FUNCTION(ibase_maintain_db) -{ - _php_ibase_service_action(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_properties); -} -/* }}} */ - -/* {{{ proto string ibase_db_info(resource service_handle, string db, int action [, int argument]) - Request statistics about a database */ -PHP_FUNCTION(ibase_db_info) -{ - _php_ibase_service_action(INTERNAL_FUNCTION_PARAM_PASSTHRU, isc_action_svc_db_stats); -} -/* }}} */ - -/* {{{ proto string ibase_server_info(resource service_handle, int action) - Request information about a database server */ -PHP_FUNCTION(ibase_server_info) -{ - zval *res; - long action; - ibase_service *svm; - - RESET_ERRMSG; - - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &action)) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(svm, ibase_service *, &res, -1, - "Interbase service manager handle", le_service); - - _php_ibase_service_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, svm, (char)action); -} -/* }}} */ - -#else - -void php_ibase_register_service_constants(INIT_FUNC_ARGS) { /* nop */ } - -#endif /* HAVE_IBASE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c deleted file mode 100644 index dbb810cb8552f..0000000000000 --- a/ext/interbase/interbase.c +++ /dev/null @@ -1,1206 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jouni Ahto | - | Andrew Avdeev | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define _GNU_SOURCE - -#include "php.h" - -#if HAVE_IBASE - -#include "php_ini.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/md5.h" -#include "php_interbase.h" -#include "php_ibase_includes.h" -#include "SAPI.h" - -#include - -#define ROLLBACK 0 -#define COMMIT 1 -#define RETAIN 2 - -/* {{{ extension definition structures */ -function_entry ibase_functions[] = { - PHP_FE(ibase_connect, NULL) - PHP_FE(ibase_pconnect, NULL) - PHP_FE(ibase_close, NULL) - PHP_FE(ibase_drop_db, NULL) - PHP_FE(ibase_query, NULL) - PHP_FE(ibase_fetch_row, NULL) - PHP_FE(ibase_fetch_assoc, NULL) - PHP_FE(ibase_fetch_object, NULL) - PHP_FE(ibase_free_result, NULL) - PHP_FE(ibase_name_result, NULL) - PHP_FE(ibase_prepare, NULL) - PHP_FE(ibase_execute, NULL) - PHP_FE(ibase_free_query, NULL) - PHP_FE(ibase_gen_id, NULL) - PHP_FE(ibase_num_fields, NULL) - PHP_FE(ibase_num_params, NULL) -#if abies_0 - PHP_FE(ibase_num_rows, NULL) -#endif - PHP_FE(ibase_affected_rows, NULL) - PHP_FE(ibase_field_info, NULL) - PHP_FE(ibase_param_info, NULL) - - PHP_FE(ibase_trans, NULL) - PHP_FE(ibase_commit, NULL) - PHP_FE(ibase_rollback, NULL) - PHP_FE(ibase_commit_ret, NULL) - PHP_FE(ibase_rollback_ret, NULL) - - PHP_FE(ibase_blob_info, NULL) - PHP_FE(ibase_blob_create, NULL) - PHP_FE(ibase_blob_add, NULL) - PHP_FE(ibase_blob_cancel, NULL) - PHP_FE(ibase_blob_close, NULL) - PHP_FE(ibase_blob_open, NULL) - PHP_FE(ibase_blob_get, NULL) - PHP_FE(ibase_blob_echo, NULL) - PHP_FE(ibase_blob_import, NULL) - PHP_FE(ibase_errmsg, NULL) - PHP_FE(ibase_errcode, NULL) - - PHP_FE(ibase_add_user, NULL) - PHP_FE(ibase_modify_user, NULL) - PHP_FE(ibase_delete_user, NULL) - - PHP_FE(ibase_service_attach, NULL) - PHP_FE(ibase_service_detach, NULL) - PHP_FE(ibase_backup, NULL) - PHP_FE(ibase_restore, NULL) - PHP_FE(ibase_maintain_db, NULL) - PHP_FE(ibase_db_info, NULL) - PHP_FE(ibase_server_info, NULL) - - PHP_FE(ibase_wait_event, NULL) - PHP_FE(ibase_set_event_handler, NULL) - PHP_FE(ibase_free_event_handler, NULL) - - /** - * These aliases are provided in order to maintain forward compatibility. As Firebird - * and InterBase are developed independently, functionality might be different between - * the two branches in future versions. - * Firebird users should use the aliases, so future InterBase-specific changes will - * not affect their code - */ - PHP_FALIAS(fbird_connect,ibase_connect, NULL) - PHP_FALIAS(fbird_pconnect,ibase_pconnect, NULL) - PHP_FALIAS(fbird_close,ibase_close, NULL) - PHP_FALIAS(fbird_drop_db,ibase_drop_db, NULL) - PHP_FALIAS(fbird_query,ibase_query, NULL) - PHP_FALIAS(fbird_fetch_row,ibase_fetch_row, NULL) - PHP_FALIAS(fbird_fetch_assoc,ibase_fetch_assoc, NULL) - PHP_FALIAS(fbird_fetch_object,ibase_fetch_object, NULL) - PHP_FALIAS(fbird_free_result,ibase_free_result, NULL) - PHP_FALIAS(fbird_name_result,ibase_name_result, NULL) - PHP_FALIAS(fbird_prepare,ibase_prepare, NULL) - PHP_FALIAS(fbird_execute,ibase_execute, NULL) - PHP_FALIAS(fbird_free_query,ibase_free_query, NULL) - PHP_FALIAS(fbird_gen_id,ibase_gen_id, NULL) - PHP_FALIAS(fbird_num_fields,ibase_num_fields, NULL) - PHP_FALIAS(fbird_num_params,ibase_num_params, NULL) -#if abies_0 - PHP_FALIAS(fbird_num_rows,ibase_num_rows, NULL) -#endif - PHP_FALIAS(fbird_affected_rows,ibase_affected_rows, NULL) - PHP_FALIAS(fbird_field_info,ibase_field_info, NULL) - PHP_FALIAS(fbird_param_info,ibase_param_info, NULL) - - PHP_FALIAS(fbird_trans,ibase_trans, NULL) - PHP_FALIAS(fbird_commit,ibase_commit, NULL) - PHP_FALIAS(fbird_rollback,ibase_rollback, NULL) - PHP_FALIAS(fbird_commit_ret,ibase_commit_ret, NULL) - PHP_FALIAS(fbird_rollback_ret,ibase_rollback_ret, NULL) - - PHP_FALIAS(fbird_blob_info,ibase_blob_info, NULL) - PHP_FALIAS(fbird_blob_create,ibase_blob_create, NULL) - PHP_FALIAS(fbird_blob_add,ibase_blob_add, NULL) - PHP_FALIAS(fbird_blob_cancel,ibase_blob_cancel, NULL) - PHP_FALIAS(fbird_blob_close,ibase_blob_close, NULL) - PHP_FALIAS(fbird_blob_open,ibase_blob_open, NULL) - PHP_FALIAS(fbird_blob_get,ibase_blob_get, NULL) - PHP_FALIAS(fbird_blob_echo,ibase_blob_echo, NULL) - PHP_FALIAS(fbird_blob_import,ibase_blob_import, NULL) - PHP_FALIAS(fbird_errmsg,ibase_errmsg, NULL) - PHP_FALIAS(fbird_errcode,ibase_errcode, NULL) - - PHP_FALIAS(fbird_add_user,ibase_add_user, NULL) - PHP_FALIAS(fbird_modify_user,ibase_modify_user, NULL) - PHP_FALIAS(fbird_delete_user,ibase_delete_user, NULL) - - PHP_FALIAS(fbird_service_attach,ibase_service_attach, NULL) - PHP_FALIAS(fbird_service_detach,ibase_service_detach, NULL) - PHP_FALIAS(fbird_backup,ibase_backup, NULL) - PHP_FALIAS(fbird_restore,ibase_restore, NULL) - PHP_FALIAS(fbird_maintain_db,ibase_maintain_db, NULL) - PHP_FALIAS(fbird_db_info,ibase_db_info, NULL) - PHP_FALIAS(fbird_server_info,ibase_server_info, NULL) - - PHP_FALIAS(fbird_wait_event,ibase_wait_event, NULL) - PHP_FALIAS(fbird_set_event_handler,ibase_set_event_handler, NULL) - PHP_FALIAS(fbird_free_event_handler,ibase_free_event_handler, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry ibase_module_entry = { - STANDARD_MODULE_HEADER, - "interbase", - ibase_functions, - PHP_MINIT(ibase), - PHP_MSHUTDOWN(ibase), - NULL, - PHP_RSHUTDOWN(ibase), - PHP_MINFO(ibase), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_INTERBASE -ZEND_GET_MODULE(ibase) -#endif - -/* True globals, no need for thread safety */ -int le_link, le_plink, le_trans; - -ZEND_DECLARE_MODULE_GLOBALS(ibase) - -/* }}} */ - -/* error handling ---------------------------- */ - -/* {{{ proto string ibase_errmsg(void) - Return error message */ -PHP_FUNCTION(ibase_errmsg) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (IBG(sql_code) != 0) { - RETURN_STRING(IBG(errmsg), 1); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int ibase_errcode(void) - Return error code */ -PHP_FUNCTION(ibase_errcode) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (IBG(sql_code) != 0) { - RETURN_LONG(IBG(sql_code)); - } - RETURN_FALSE; -} -/* }}} */ - -/* print interbase error and save it for ibase_errmsg() */ -void _php_ibase_error(TSRMLS_D) /* {{{ */ -{ - char *s = IBG(errmsg); - ISC_STATUS *statusp = IB_STATUS; - - IBG(sql_code) = isc_sqlcode(IB_STATUS); - - while ((s - IBG(errmsg)) < MAX_ERRMSG - (IBASE_MSGSIZE + 2) && isc_interprete(s, &statusp)) { - strcat(IBG(errmsg), " "); - s = IBG(errmsg) + strlen(IBG(errmsg)); - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg)); -} -/* }}} */ - -/* print php interbase module error and save it for ibase_errmsg() */ -void _php_ibase_module_error(char *msg TSRMLS_DC, ...) /* {{{ */ -{ - va_list ap; - -#ifdef ZTS - va_start(ap, TSRMLS_C); -#else - va_start(ap, msg); -#endif - - /* vsnprintf NUL terminates the buf and writes at most n-1 chars+NUL */ - vsnprintf(IBG(errmsg), MAX_ERRMSG, msg, ap); - va_end(ap); - - IBG(sql_code) = -999; /* no SQL error */ - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg)); -} -/* }}} */ - -/* {{{ internal macros, functions and structures */ -typedef struct { - isc_db_handle *db_ptr; - long tpb_len; - char *tpb_ptr; -} ISC_TEB; - -/* }}} */ - -/* Fill ib_link and trans with the correct database link and transaction. */ -void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */ - zval **link_id, ibase_db_link **ib_link, ibase_trans **trans) -{ - int type; - - IBDEBUG("Transaction or database link?"); - if (zend_list_find(Z_LVAL_PP(link_id), &type)) { - if (type == le_trans) { - /* Transaction resource: make sure it refers to one link only, then - fetch it; database link is stored in ib_trans->db_link[]. */ - IBDEBUG("Type is le_trans"); - ZEND_FETCH_RESOURCE(*trans, ibase_trans *, link_id, -1, LE_TRANS, le_trans); - if ((*trans)->link_cnt > 1) { - _php_ibase_module_error("Link id is ambiguous: transaction spans multiple connections." - TSRMLS_CC); - return; - } - *ib_link = (*trans)->db_link[0]; - return; - } - } - IBDEBUG("Type is le_[p]link or id not found"); - /* Database link resource, use default transaction. */ - *trans = NULL; - ZEND_FETCH_RESOURCE2(*ib_link, ibase_db_link *, link_id, -1, LE_LINK, le_link, le_plink); -} -/* }}} */ - -/* destructors ---------------------- */ - -static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */ -{ - unsigned short i = 0, j; - ibase_tr_list *l; - ibase_event *e; - IBDEBUG("Checking transactions to close..."); - - for (l = link->tr_list; l != NULL; ++i) { - ibase_tr_list *p = l; - if (p->trans != NULL) { - if (i == 0) { - if (p->trans->handle != NULL) { - IBDEBUG("Committing default transaction..."); - if (isc_commit_transaction(IB_STATUS, &p->trans->handle)) { - _php_ibase_error(TSRMLS_C); - } - } - efree(p->trans); /* default transaction is not a registered resource: clean up */ - } else { - if (p->trans->handle != NULL) { - /* non-default trans might have been rolled back by other call of this dtor */ - IBDEBUG("Rolling back other transactions..."); - if (isc_rollback_transaction(IB_STATUS, &p->trans->handle)) { - _php_ibase_error(TSRMLS_C); - } - } - /* set this link pointer to NULL in the transaction */ - for (j = 0; j < p->trans->link_cnt; ++j) { - if (p->trans->db_link[j] == link) { - p->trans->db_link[j] = NULL; - break; - } - } - } - } - l = l->next; - efree(p); - } - link->tr_list = NULL; - - for (e = link->event_head; e; e = e->event_next) { - _php_ibase_free_event(e TSRMLS_CC); - e->link = NULL; - } -} - -/* }}} */ - -static void php_ibase_commit_link_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_db_link *link = (ibase_db_link *) rsrc->ptr; - - _php_ibase_commit_link(link TSRMLS_CC); -} -/* }}} */ - -static void _php_ibase_close_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_db_link *link = (ibase_db_link *) rsrc->ptr; - - _php_ibase_commit_link(link TSRMLS_CC); - if (link->handle != NULL) { - IBDEBUG("Closing normal link..."); - isc_detach_database(IB_STATUS, &link->handle); - } - IBG(num_links)--; - efree(link); -} -/* }}} */ - -static void _php_ibase_close_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_db_link *link = (ibase_db_link *) rsrc->ptr; - - _php_ibase_commit_link(link TSRMLS_CC); - IBDEBUG("Closing permanent link..."); - if (link->handle != NULL) { - isc_detach_database(IB_STATUS, &link->handle); - } - IBG(num_persistent)--; - IBG(num_links)--; - free(link); -} -/* }}} */ - -static void _php_ibase_free_trans(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - ibase_trans *trans = (ibase_trans *)rsrc->ptr; - unsigned short i; - - IBDEBUG("Cleaning up transaction resource..."); - if (trans->handle != NULL) { - IBDEBUG("Rolling back unhandled transaction..."); - if (isc_rollback_transaction(IB_STATUS, &trans->handle)) { - _php_ibase_error(TSRMLS_C); - } - } - - /* now remove this transaction from all the connection-transaction lists */ - for (i = 0; i < trans->link_cnt; ++i) { - if (trans->db_link[i] != NULL) { - ibase_tr_list **l; - for (l = &trans->db_link[i]->tr_list; *l != NULL; l = &(*l)->next) { - if ( (*l)->trans == trans) { - ibase_tr_list *p = *l; - *l = p->next; - efree(p); - break; - } - } - } - } - efree(trans); -} -/* }}} */ - -/* TODO this function should be part of either Zend or PHP API */ -static PHP_INI_DISP(php_ibase_password_displayer_cb) -{ - TSRMLS_FETCH(); - - if ((type == PHP_INI_DISPLAY_ORIG && ini_entry->orig_value) - || (type == PHP_INI_DISPLAY_ACTIVE && ini_entry->value)) { - PUTS("********"); - } else if (!sapi_module.phpinfo_as_text) { - PUTS("no value"); - } else { - PUTS("no value"); - } -} - -/* {{{ startup, shutdown and info functions */ -PHP_INI_BEGIN() - PHP_INI_ENTRY_EX("ibase.allow_persistent", "1", PHP_INI_SYSTEM, NULL, zend_ini_boolean_displayer_cb) - PHP_INI_ENTRY_EX("ibase.max_persistent", "-1", PHP_INI_SYSTEM, NULL, display_link_numbers) - PHP_INI_ENTRY_EX("ibase.max_links", "-1", PHP_INI_SYSTEM, NULL, display_link_numbers) - PHP_INI_ENTRY("ibase.default_db", NULL, PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("ibase.default_user", NULL, PHP_INI_ALL, NULL) - PHP_INI_ENTRY_EX("ibase.default_password", NULL, PHP_INI_ALL, NULL, php_ibase_password_displayer_cb) - PHP_INI_ENTRY("ibase.default_charset", NULL, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("ibase.timestampformat", IB_DEF_DATE_FMT " " IB_DEF_TIME_FMT, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("ibase.dateformat", IB_DEF_DATE_FMT, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("ibase.timeformat", IB_DEF_TIME_FMT, PHP_INI_ALL, NULL) -PHP_INI_END() - -static void php_ibase_init_globals(zend_ibase_globals *ibase_globals) -{ - ibase_globals->num_persistent = ibase_globals->num_links = 0; - ibase_globals->sql_code = *ibase_globals->errmsg = 0; - ibase_globals->default_link = -1; -} - -PHP_MINIT_FUNCTION(ibase) -{ - ZEND_INIT_MODULE_GLOBALS(ibase, php_ibase_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - le_link = zend_register_list_destructors_ex(_php_ibase_close_link, NULL, LE_LINK, module_number); - le_plink = zend_register_list_destructors_ex(php_ibase_commit_link_rsrc, _php_ibase_close_plink, LE_PLINK, module_number); - le_trans = zend_register_list_destructors_ex(_php_ibase_free_trans, NULL, LE_TRANS, module_number); - - REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_CREATE", PHP_IBASE_CREATE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_TEXT", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT); /* deprecated, for BC only */ - REGISTER_LONG_CONSTANT("IBASE_FETCH_BLOBS", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_FETCH_ARRAYS", PHP_IBASE_FETCH_ARRAYS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_UNIXTIME", PHP_IBASE_UNIXTIME, CONST_PERSISTENT); - - /* transactions */ - REGISTER_LONG_CONSTANT("IBASE_WRITE", PHP_IBASE_WRITE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_READ", PHP_IBASE_READ, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_COMMITTED", PHP_IBASE_COMMITTED, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_CONSISTENCY", PHP_IBASE_CONSISTENCY, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_CONCURRENCY", PHP_IBASE_CONCURRENCY, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_REC_VERSION", PHP_IBASE_REC_VERSION, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_REC_NO_VERSION", PHP_IBASE_REC_NO_VERSION, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_NOWAIT", PHP_IBASE_NOWAIT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IBASE_WAIT", PHP_IBASE_WAIT, CONST_PERSISTENT); - - php_ibase_query_minit(INIT_FUNC_ARGS_PASSTHRU); - php_ibase_blobs_minit(INIT_FUNC_ARGS_PASSTHRU); - php_ibase_events_minit(INIT_FUNC_ARGS_PASSTHRU); - php_ibase_service_minit(INIT_FUNC_ARGS_PASSTHRU); - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(ibase) -{ -#ifndef PHP_WIN32 - /** - * When the Interbase client API library libgds.so is first loaded, it registers a call to - * gds__cleanup() with atexit(), in order to clean up after itself when the process exits. - * This means that the library is called at process shutdown, and cannot be unloaded beforehand. - * PHP tries to unload modules after every request [dl()'ed modules], and right before the - * process shuts down [modules loaded from php.ini]. This results in a segfault for this module. - * By NULLing the dlopen() handle in the module entry, Zend omits the call to dlclose(), - * ensuring that the module will remain present until the process exits. However, the functions - * and classes exported by the module will not be available until the module is 'reloaded'. - * When reloaded, dlopen() will return the handle of the already loaded module. The module will - * be unloaded automatically when the process exits. - */ - zend_module_entry *ibase_entry; - if (SUCCESS == zend_hash_find(&module_registry, ibase_module_entry.name, - strlen(ibase_module_entry.name) +1, (void*) &ibase_entry)) { - ibase_entry->handle = NULL; - } -#endif - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(ibase) -{ - IBG(num_links) = IBG(num_persistent); - IBG(default_link)= -1; - - RESET_ERRMSG; - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(ibase) -{ - char tmp[64], *s; - - php_info_print_table_start(); - php_info_print_table_row(2, "Firebird/InterBase Support", -#ifdef COMPILE_DL_INTERBASE - "dynamic"); -#else - "static"); -#endif - -#ifdef FB_API_VER - sprintf( (s = tmp), "Firebird API version %d", FB_API_VER); -#elif (SQLDA_CURRENT_VERSION > 1) - s = "Interbase 7.0 and up"; -#elif !defined(DSC_null) - s = "Interbase 6"; -#else - s = "Firebird 1.0"; -#endif - php_info_print_table_row(2, "Compile-time Client Library Version", s); - -#if defined(__GNUC__) || defined(PHP_WIN32) - do { - info_func_t info_func = NULL; -#ifdef __GNUC__ - info_func = (info_func_t)dlsym(RTLD_DEFAULT, "isc_get_client_version"); -#else - HMODULE l = GetModuleHandle("fbclient"); - - if (!l && !(l = GetModuleHandle("gds32"))) { - break; - } - info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version"); -#endif - if (info_func) { - info_func(s = tmp); - } else { - s = "Firebird 1.0/Interbase 6"; - } - php_info_print_table_row(2, "Run-time Client Library Version", s); - } while (0); -#endif - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - -} -/* }}} */ - -enum connect_args { DB = 0, USER = 1, PASS = 2, CSET = 3, ROLE = 4, BUF = 0, DLECT = 1, SYNC = 2 }; - -static char const dpb_args[] = { - 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name, 0 -}; - -int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db TSRMLS_DC) -{ - short i; - char dpb_buffer[256] = { isc_dpb_version1 }, *dpb; - - dpb = dpb_buffer + 1; - - for (i = 0; i < sizeof(dpb_args); ++i) { - if (dpb_args[i] && args[i] && len[i]) { - dpb += sprintf(dpb, "%c%c%s", dpb_args[i],(unsigned char)len[i],args[i]); - } - } - if (largs[BUF]) { - dpb += sprintf(dpb, "%c\2%c%c", isc_dpb_num_buffers, - (char)(largs[BUF] >> 8), (char)(largs[BUF] & 0xff)); - } - if (largs[SYNC]) { - dpb += sprintf(dpb, "%c\1%c", isc_dpb_force_write, largs[SYNC] == isc_spb_prp_wm_sync ? 1 : 0); - } - if (isc_attach_database(IB_STATUS, (short)len[DB], args[DB], db, (short)(dpb-dpb_buffer), dpb_buffer)) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* {{{ */ -{ - char *c, hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL }; - int i, len[] = { 0, 0, 0, 0, 0 }; - long largs[] = { 0, 0, 0 }; - PHP_MD5_CTX hash_context; - list_entry new_index_ptr, *le; - isc_db_handle db_handle = NULL; - ibase_db_link *ib_link; - - RESET_ERRMSG; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssllsl", - &args[DB], &len[DB], &args[USER], &len[USER], &args[PASS], &len[PASS], - &args[CSET], &len[CSET], &largs[BUF], &largs[DLECT], &args[ROLE], &len[ROLE], - &largs[SYNC])) { - RETURN_FALSE; - } - - /* restrict to the server/db in the .ini if in safe mode */ - if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) { - args[DB] = c; - len[DB] = strlen(c); - } - if (!len[USER] && (c = INI_STR("ibase.default_user"))) { - args[USER] = c; - len[USER] = strlen(c); - } - if (!len[PASS] && (c = INI_STR("ibase.default_password"))) { - args[PASS] = c; - len[PASS] = strlen(c); - } - if (!len[CSET] && (c = INI_STR("ibase.default_charset"))) { - args[CSET] = c; - len[CSET] = strlen(c); - } - - /* don't want usernames and passwords floating around */ - PHP_MD5Init(&hash_context); - for (i = 0; i < sizeof(args)/sizeof(char*); ++i) { - PHP_MD5Update(&hash_context,args[i],len[i]); - } - for (i = 0; i < sizeof(largs)/sizeof(long); ++i) { - PHP_MD5Update(&hash_context,(char*)&largs[i],sizeof(long)); - } - PHP_MD5Final(hash, &hash_context); - - /* try to reuse a connection */ - if (SUCCESS == zend_hash_find(&EG(regular_list), hash, sizeof(hash), (void *) &le)) { - long xlink; - int type; - - if (Z_TYPE_P(le) != le_index_ptr) { - RETURN_FALSE; - } - - xlink = (long) le->ptr; - if (zend_list_find(xlink, &type) && ((!persistent && type == le_link) || type == le_plink)) { - zend_list_addref(xlink); - RETURN_RESOURCE(IBG(default_link) = xlink); - } else { - zend_hash_del(&EG(regular_list), hash, sizeof(hash)); - } - } - - /* ... or a persistent one */ - switch (zend_hash_find(&EG(persistent_list), hash, sizeof(hash), (void *) &le)) { - long l; - - static char info[] = { isc_info_base_level, isc_info_end }; - char result[8]; - ISC_STATUS status[20]; - - case SUCCESS: - - if (Z_TYPE_P(le) != le_plink) { - RETURN_FALSE; - } - /* check if connection has timed out */ - ib_link = (ibase_db_link *) le->ptr; - if (!isc_database_info(status, &ib_link->handle, sizeof(info), info, sizeof(result), result)) { - ZEND_REGISTER_RESOURCE(return_value, ib_link, le_plink); - break; - } - zend_hash_del(&EG(persistent_list), hash, sizeof(hash)); - - default: - - /* no link found, so we have to open one */ - - if ((l = INI_INT("ibase.max_links")) != -1 && IBG(num_links) >= l) { - _php_ibase_module_error("Too many open links (%ld)" TSRMLS_CC, IBG(num_links)); - RETURN_FALSE; - } - - /* create the ib_link */ - if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle TSRMLS_CC)) { - RETURN_FALSE; - } - - /* use non-persistent if allowed number of persistent links is exceeded */ - if (!persistent || ((l = INI_INT("ibase.max_persistent") != -1) && IBG(num_persistent) >= l)) { - ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link)); - ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link); - } else { - list_entry new_le; - - ib_link = (ibase_db_link *) malloc(sizeof(ibase_db_link)); - - /* hash it up */ - Z_TYPE(new_le) = le_plink; - new_le.ptr = ib_link; - if (FAILURE == zend_hash_update(&EG(persistent_list), hash, sizeof(hash), - (void *) &new_le, sizeof(list_entry), NULL)) { - free(ib_link); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, ib_link, le_plink); - ++IBG(num_persistent); - } - ib_link->handle = db_handle; - ib_link->dialect = largs[DLECT] ? (unsigned short)largs[DLECT] : SQL_DIALECT_CURRENT; - ib_link->tr_list = NULL; - ib_link->event_head = NULL; - - ++IBG(num_links); - } - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (FAILURE == zend_hash_update(&EG(regular_list), hash, sizeof(hash), - (void *) &new_index_ptr, sizeof(list_entry), NULL)) { - RETURN_FALSE; - } - zend_list_addref(IBG(default_link) = Z_LVAL_P(return_value)); -} -/* }}} */ - -/* {{{ proto resource ibase_connect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]) - Open a connection to an InterBase database */ -PHP_FUNCTION(ibase_connect) -{ - _php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource ibase_pconnect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]) - Open a persistent connection to an InterBase database */ -PHP_FUNCTION(ibase_pconnect) -{ - _php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INI_INT("ibase.allow_persistent")); -} -/* }}} */ - -/* {{{ proto bool ibase_close([resource link_identifier]) - Close an InterBase connection */ -PHP_FUNCTION(ibase_close) -{ - zval **link_arg = NULL; - ibase_db_link *ib_link; - int link_id; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - case 0: - link_id = IBG(default_link); - IBG(default_link) = -1; - break; - case 1: - if (zend_get_parameters_ex(1, &link_arg) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(link_arg); - link_id = Z_LVAL_PP(link_arg); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink); - zend_list_delete(link_id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ibase_drop_db([resource link_identifier]) - Drop an InterBase database */ -PHP_FUNCTION(ibase_drop_db) -{ - zval **link_arg = NULL; - ibase_db_link *ib_link; - ibase_tr_list *l; - int link_id; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - case 0: - link_id = IBG(default_link); - IBG(default_link) = -1; - break; - case 1: - if (zend_get_parameters_ex(1, &link_arg) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(link_arg); - link_id = Z_LVAL_PP(link_arg); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink); - - if (isc_drop_database(IB_STATUS, &ib_link->handle)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - /* isc_drop_database() doesn't invalidate the transaction handles */ - for (l = ib_link->tr_list; l != NULL; l = l->next) { - if (l->trans != NULL) l->trans->handle = NULL; - } - - zend_list_delete(link_id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto resource ibase_trans([int trans_args [, resource link_identifier [, ... ], int trans_args [, resource link_identifier [, ... ]] [, ...]]]) - Start a transaction over one or several databases */ - -#define TPB_MAX_SIZE (8*sizeof(char)) - -PHP_FUNCTION(ibase_trans) -{ - unsigned short i, argn, link_cnt = 0, tpb_len = 0; - char last_tpb[TPB_MAX_SIZE]; - ibase_db_link **ib_link = NULL; - ibase_trans *ib_trans; - isc_tr_handle tr_handle = NULL; - ISC_STATUS result; - - RESET_ERRMSG; - - argn = ZEND_NUM_ARGS(); - - /* (1+argn) is an upper bound for the number of links this trans connects to */ - ib_link = (ibase_db_link **) safe_emalloc(sizeof(ibase_db_link *),1+argn,0); - - if (argn > 0) { - long trans_argl = 0; - char *tpb; - ISC_TEB *teb; - zval ***args = (zval ***) safe_emalloc(sizeof(zval **),argn,0); - - if (zend_get_parameters_array_ex(argn, args) == FAILURE) { - efree(args); - efree(ib_link); - RETURN_FALSE; - } - - teb = (ISC_TEB *) safe_emalloc(sizeof(ISC_TEB),argn,0); - tpb = (char *) safe_emalloc(TPB_MAX_SIZE,argn,0); - - /* enumerate all the arguments: assume every non-resource argument - specifies modifiers for the link ids that follow it */ - for (i = 0; i < argn; ++i) { - - if (Z_TYPE_PP(args[i]) == IS_RESOURCE) { - - ZEND_FETCH_RESOURCE2(ib_link[link_cnt], ibase_db_link *, args[i], -1, - LE_LINK, le_link, le_plink); - - /* copy the most recent modifier string into tbp[] */ - memcpy(&tpb[TPB_MAX_SIZE * link_cnt], last_tpb, TPB_MAX_SIZE); - - /* add a database handle to the TEB with the most recently specified set of modifiers */ - teb[link_cnt].db_ptr = &ib_link[link_cnt]->handle; - teb[link_cnt].tpb_len = tpb_len; - teb[link_cnt].tpb_ptr = &tpb[TPB_MAX_SIZE * link_cnt]; - - ++link_cnt; - - } else { - - tpb_len = 0; - - convert_to_long_ex(args[i]); - trans_argl = Z_LVAL_PP(args[i]); - - if (trans_argl != PHP_IBASE_DEFAULT) { - last_tpb[tpb_len++] = isc_tpb_version3; - - /* access mode */ - if (PHP_IBASE_READ == (trans_argl & PHP_IBASE_READ)) { - last_tpb[tpb_len++] = isc_tpb_read; - } else if (PHP_IBASE_WRITE == (trans_argl & PHP_IBASE_WRITE)) { - last_tpb[tpb_len++] = isc_tpb_write; - } - - /* isolation level */ - if (PHP_IBASE_COMMITTED == (trans_argl & PHP_IBASE_COMMITTED)) { - last_tpb[tpb_len++] = isc_tpb_read_committed; - if (PHP_IBASE_REC_VERSION == (trans_argl & PHP_IBASE_REC_VERSION)) { - last_tpb[tpb_len++] = isc_tpb_rec_version; - } else if (PHP_IBASE_REC_NO_VERSION == (trans_argl & PHP_IBASE_REC_NO_VERSION)) { - last_tpb[tpb_len++] = isc_tpb_no_rec_version; - } - } else if (PHP_IBASE_CONSISTENCY == (trans_argl & PHP_IBASE_CONSISTENCY)) { - last_tpb[tpb_len++] = isc_tpb_consistency; - } else if (PHP_IBASE_CONCURRENCY == (trans_argl & PHP_IBASE_CONCURRENCY)) { - last_tpb[tpb_len++] = isc_tpb_concurrency; - } - - /* lock resolution */ - if (PHP_IBASE_NOWAIT == (trans_argl & PHP_IBASE_NOWAIT)) { - last_tpb[tpb_len++] = isc_tpb_nowait; - } else if (PHP_IBASE_WAIT == (trans_argl & PHP_IBASE_WAIT)) { - last_tpb[tpb_len++] = isc_tpb_wait; - } - } - } - } - - if (link_cnt > 0) { - result = isc_start_multiple(IB_STATUS, &tr_handle, link_cnt, teb); - } - - efree(args); - efree(tpb); - efree(teb); - } - - if (link_cnt == 0) { - link_cnt = 1; - ZEND_FETCH_RESOURCE2(ib_link[0], ibase_db_link *, NULL, IBG(default_link), LE_LINK, - le_link, le_plink); - result = isc_start_transaction(IB_STATUS, &tr_handle, 1, &ib_link[0]->handle, tpb_len, last_tpb); - } - - /* start the transaction */ - if (result) { - _php_ibase_error(TSRMLS_C); - efree(ib_link); - RETURN_FALSE; - } - - /* register the transaction in our own data structures */ - ib_trans = (ibase_trans *) safe_emalloc(link_cnt-1, sizeof(ibase_db_link *), sizeof(ibase_trans)); - ib_trans->handle = tr_handle; - ib_trans->link_cnt = link_cnt; - ib_trans->affected_rows = 0; - for (i = 0; i < link_cnt; ++i) { - ibase_tr_list **l; - ib_trans->db_link[i] = ib_link[i]; - - /* the first item in the connection-transaction list is reserved for the default transaction */ - if (ib_link[i]->tr_list == NULL) { - ib_link[i]->tr_list = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); - ib_link[i]->tr_list->trans = NULL; - ib_link[i]->tr_list->next = NULL; - } - - /* link the transaction into the connection-transaction list */ - for (l = &ib_link[i]->tr_list; *l != NULL; l = &(*l)->next); - *l = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); - (*l)->trans = ib_trans; - (*l)->next = NULL; - } - efree(ib_link); - ZEND_REGISTER_RESOURCE(return_value, ib_trans, le_trans); -} -/* }}} */ - -int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC) /* {{{ */ -{ - if (ib_link == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database link"); - return FAILURE; - } - - /* the first item in the connection-transaction list is reserved for the default transaction */ - if (ib_link->tr_list == NULL) { - ib_link->tr_list = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); - ib_link->tr_list->trans = NULL; - ib_link->tr_list->next = NULL; - } - - if (*trans == NULL) { - ibase_trans *tr = ib_link->tr_list->trans; - - if (tr == NULL) { - tr = (ibase_trans *) emalloc(sizeof(ibase_trans)); - tr->handle = NULL; - tr->link_cnt = 1; - tr->affected_rows = 0; - tr->db_link[0] = ib_link; - ib_link->tr_list->trans = tr; - } - if (tr->handle == NULL) { - if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL)) { - _php_ibase_error(TSRMLS_C); - return FAILURE; - } - } - *trans = tr; - } - return SUCCESS; -} -/* }}} */ - -static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{{ */ -{ - ibase_trans *trans = NULL; - int res_id = 0; - ISC_STATUS result; - - RESET_ERRMSG; - - switch (ZEND_NUM_ARGS()) { - - ibase_db_link *ib_link; - zval **arg; - int type; - - case 0: - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, - le_link, le_plink); - if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) { - /* this link doesn't have a default transaction */ - _php_ibase_module_error("Default link has no default transaction" TSRMLS_CC); - RETURN_FALSE; - } - trans = ib_link->tr_list->trans; - break; - - case 1: - if (zend_get_parameters_ex(1, &arg) == FAILURE) { - RETURN_FALSE; - } - /* one id was passed, could be db or trans id */ - if (zend_list_find(Z_LVAL_PP(arg), &type) && type == le_trans) { - ZEND_FETCH_RESOURCE(trans, ibase_trans *, arg, -1, LE_TRANS, le_trans); - - convert_to_long_ex(arg); - res_id = Z_LVAL_PP(arg); - } else { - ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, arg, -1, LE_LINK, le_link, le_plink); - - if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) { - /* this link doesn't have a default transaction */ - _php_ibase_module_error("Link has no default transaction" TSRMLS_CC); - RETURN_FALSE; - } - trans = ib_link->tr_list->trans; - } - break; - - default: - WRONG_PARAM_COUNT; - break; - } - - switch (commit) { - - default: /* == case ROLLBACK: */ - result = isc_rollback_transaction(IB_STATUS, &trans->handle); - break; - case COMMIT: - result = isc_commit_transaction(IB_STATUS, &trans->handle); - break; - case (ROLLBACK | RETAIN): - result = isc_rollback_retaining(IB_STATUS, &trans->handle); - break; - case (COMMIT | RETAIN): - result = isc_commit_retaining(IB_STATUS, &trans->handle); - break; - } - - if (result) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - /* Don't try to destroy implicitly opened transaction from list... */ - if ( (commit & RETAIN) == 0 && res_id != 0) { - zend_list_delete(res_id); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ibase_commit( resource link_identifier ) - Commit transaction */ -PHP_FUNCTION(ibase_commit) -{ - _php_ibase_trans_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, COMMIT); -} -/* }}} */ - -/* {{{ proto bool ibase_rollback( resource link_identifier ) - Rollback transaction */ -PHP_FUNCTION(ibase_rollback) -{ - _php_ibase_trans_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, ROLLBACK); -} -/* }}} */ - -/* {{{ proto bool ibase_commit_ret( resource link_identifier ) - Commit transaction and retain the transaction context */ -PHP_FUNCTION(ibase_commit_ret) -{ - _php_ibase_trans_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, COMMIT | RETAIN); -} -/* }}} */ - -/* {{{ proto bool ibase_rollback_ret( resource link_identifier ) - Rollback transaction and retain the transaction context */ -PHP_FUNCTION(ibase_rollback_ret) -{ - _php_ibase_trans_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, ROLLBACK | RETAIN); -} -/* }}} */ - -/* {{{ proto int ibase_gen_id(string generator [, int increment [, resource link_identifier ]]) - Increments the named generator and returns its new value */ -PHP_FUNCTION(ibase_gen_id) -{ - zval *link = NULL; - char query[128], *generator; - int gen_len; - long inc = 1; - ibase_db_link *ib_link; - ibase_trans *trans = NULL; - XSQLDA out_sqlda; - ISC_INT64 result; - - RESET_ERRMSG; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &generator, &gen_len, - &inc, &link)) { - RETURN_FALSE; - } - - PHP_IBASE_LINK_TRANS(link, ib_link, trans); - - sprintf(query, "SELECT GEN_ID(%s,%ld) FROM rdb$database", generator, inc); - - /* allocate a minimal descriptor area */ - out_sqlda.sqln = out_sqlda.sqld = 1; - out_sqlda.version = SQLDA_CURRENT_VERSION; - - /* allocate the field for the result */ - out_sqlda.sqlvar[0].sqltype = SQL_INT64; - out_sqlda.sqlvar[0].sqlscale = 0; - out_sqlda.sqlvar[0].sqllen = sizeof(result); - out_sqlda.sqlvar[0].sqldata = (void*) &result; - - /* execute the query */ - if (isc_dsql_exec_immed2(IB_STATUS, &ib_link->handle, &trans->handle, 0, query, - SQL_DIALECT_CURRENT, NULL, &out_sqlda)) { - _php_ibase_error(TSRMLS_C); - RETURN_FALSE; - } - - /* don't return the generator value as a string unless it doesn't fit in a long */ -#if SIZEOF_LONG < 8 - if (result < LONG_MIN || result > LONG_MAX) { - char res[24]; - - sprintf(res, "%" LL_MASK "d", result); - RETURN_STRING(res,1); - } -#endif - RETURN_LONG((long)result); -} - -/* }}} */ - -#endif /* HAVE_IBASE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/interbase/interbase.dsp b/ext/interbase/interbase.dsp deleted file mode 100644 index c151deb40cb67..0000000000000 --- a/ext/interbase/interbase.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="interbase" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=interbase - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "interbase.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "interbase.mak" CFG="interbase - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "interbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "interbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "interbase" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "interbase - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib gds32_ms.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "interbase - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D ZEND_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gds32_ms.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ENDIF - -# Begin Target - -# Name "interbase - Win32 Debug_TS" -# Name "interbase - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ibase_blobs.c -# End Source File -# Begin Source File - -SOURCE=.\ibase_events.c -# End Source File -# Begin Source File - -SOURCE=.\ibase_query.c -# End Source File -# Begin Source File - -SOURCE=.\ibase_service.c -# End Source File -# Begin Source File - -SOURCE=.\interbase.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_interbase.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\interbase.rc -# ADD BASE RSC /l 0x413 -# ADD RSC /l 0x413 /i "..\..\main" /i "..\..\win32" /d "PHP_H" -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/interbase/interbase.rc b/ext/interbase/interbase.rc deleted file mode 100644 index 3e780497df0f7..0000000000000 --- a/ext/interbase/interbase.rc +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef APSTUDIO_INVOKED -#error This file cannot be opened from the Visual Studio IDE -#endif - -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -#include "winres.h" -#undef APSTUDIO_READONLY_SYMBOLS - -#include "php_version.h" - -#ifdef _DEBUG -# define BUILD_TYPE "Debug" -#else -# define BUILD_TYPE "Release" -#endif - -#include -#include "interbase.c" - -#ifdef FB_SQLDA -#define CLIENT_LIB "fbclient.dll" -#else -#define CLIENT_LIB "gds32.dll" -#endif - -#ifndef _MAC - -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 -#ifndef _DEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEFLAGSMASK 0x3fL - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", "PHP Interbase module\0" - VALUE "FileVersion", PHP_VERSION "\0" - VALUE "LegalCopyright", "Copyright İ 2003 The PHP Group\0" - VALUE "Build Type", BUILD_TYPE "\0" - VALUE "Client Library", CLIENT_LIB "\0" - VALUE "URL", "http://www.php.net\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - -#endif // !_MAC diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h deleted file mode 100755 index e17169cb8b7b8..0000000000000 --- a/ext/interbase/php_ibase_includes.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jouni Ahto | - | Andrew Avdeev | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_IBASE_INCLUDES_H -#define PHP_IBASE_INCLUDES_H - -#include - -#ifndef SQLDA_CURRENT_VERSION -#define SQLDA_CURRENT_VERSION SQLDA_VERSION1 -#endif - -#ifndef METADATALENGTH -#define METADATALENGTH 32 -#endif - -#define RESET_ERRMSG do { IBG(errmsg)[0] = '\0'; IBG(sql_code) = 0; } while (0) - -#define IB_STATUS (IBG(status)) - -#ifdef ZEND_DEBUG_ -#define IBDEBUG(a) php_printf("::: %s (%d)\n", a, __LINE__); -#endif - -#ifndef IBDEBUG -#define IBDEBUG(a) -#endif - -extern int le_link, le_plink, le_trans; - -#define LE_LINK "Firebird/InterBase link" -#define LE_PLINK "Firebird/InterBase persistent link" -#define LE_TRANS "Firebird/InterBase transaction" - -#define IBASE_MSGSIZE 256 -#define MAX_ERRMSG (IBASE_MSGSIZE*2) - -#define IB_DEF_DATE_FMT "%Y-%m-%d" -#define IB_DEF_TIME_FMT "%H:%M:%S" - -/* this value should never be > USHRT_MAX */ -#define IBASE_BLOB_SEG 4096 - -ZEND_BEGIN_MODULE_GLOBALS(ibase) - ISC_STATUS status[20]; - long default_link; - long num_links, num_persistent; - char errmsg[MAX_ERRMSG]; - long sql_code; -ZEND_END_MODULE_GLOBALS(ibase) - -ZEND_EXTERN_MODULE_GLOBALS(ibase) - -typedef struct { - isc_db_handle handle; - struct tr_list *tr_list; - unsigned short dialect; - struct event *event_head; -} ibase_db_link; - -typedef struct { - isc_tr_handle handle; - unsigned short link_cnt; - unsigned long affected_rows; - ibase_db_link *db_link[1]; /* last member */ -} ibase_trans; - -typedef struct tr_list { - ibase_trans *trans; - struct tr_list *next; -} ibase_tr_list; - -typedef struct { - isc_blob_handle bl_handle; - unsigned short type; - ISC_QUAD bl_qd; -} ibase_blob; - -typedef struct event { - ibase_db_link *link; - long link_res_id; - ISC_LONG event_id; - unsigned short event_count; - char **events; - char *event_buffer, *result_buffer; - zval *callback; - void **thread_ctx; - struct event *event_next; - enum event_state { NEW, ACTIVE, DEAD } state; -} ibase_event; - -enum php_interbase_option { - PHP_IBASE_DEFAULT = 0, - PHP_IBASE_CREATE = 0, - /* fetch flags */ - PHP_IBASE_FETCH_BLOBS = 1, - PHP_IBASE_FETCH_ARRAYS = 2, - PHP_IBASE_UNIXTIME = 4, - /* transaction access mode */ - PHP_IBASE_WRITE = 1, - PHP_IBASE_READ = 2, - /* transaction isolation level */ - PHP_IBASE_CONCURRENCY = 4, - PHP_IBASE_COMMITTED = 8, - PHP_IBASE_REC_NO_VERSION = 32, - PHP_IBASE_REC_VERSION = 64, - PHP_IBASE_CONSISTENCY = 16, - /* transaction lock resolution */ - PHP_IBASE_WAIT = 128, - PHP_IBASE_NOWAIT = 256 -}; - -#ifdef ZTS -#define IBG(v) TSRMG(ibase_globals_id, zend_ibase_globals *, v) -#else -#define IBG(v) (ibase_globals.v) -#endif - -#define BLOB_ID_LEN 18 -#define BLOB_ID_MASK "0x%" LL_MASK "x" - -#define BLOB_INPUT 1 -#define BLOB_OUTPUT 2 - -#ifdef PHP_WIN32 -#define LL_MASK "I64" -#define LL_LIT(lit) lit ## I64 -typedef void (__stdcall *info_func_t)(char*); -#else -#define LL_MASK "ll" -#define LL_LIT(lit) lit ## ll -typedef void (*info_func_t)(char*); -#endif - -void _php_ibase_error(TSRMLS_D); -void _php_ibase_module_error(char * TSRMLS_DC, ...) - PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2); - -/* determine if a resource is a link or transaction handle */ -#define PHP_IBASE_LINK_TRANS(pzval, lh, th) \ - do { if (!pzval) { \ - ZEND_FETCH_RESOURCE2(lh, ibase_db_link *, NULL, IBG(default_link), \ - "InterBase link", le_link, le_plink) } \ - else \ - _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, &pzval, &lh, &th); \ - if (SUCCESS != _php_ibase_def_trans(lh, &th TSRMLS_CC)) { RETURN_FALSE; } \ - } while (0) - -int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC); -void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval **link_id, - ibase_db_link **ib_link, ibase_trans **trans); - -/* provided by ibase_query.c */ -void php_ibase_query_minit(INIT_FUNC_ARGS); - -/* provided by ibase_blobs.c */ -void php_ibase_blobs_minit(INIT_FUNC_ARGS); -int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd); -char *_php_ibase_quad_to_string(ISC_QUAD const qd); -int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC); -int _php_ibase_blob_add(zval **string_arg, ibase_blob *ib_blob TSRMLS_DC); - -/* provided by ibase_events.c */ -void php_ibase_events_minit(INIT_FUNC_ARGS); -void _php_ibase_free_event(ibase_event *event TSRMLS_DC); - -/* provided by ibase_service.c */ -void php_ibase_service_minit(INIT_FUNC_ARGS); - -#ifndef max -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -#endif /* PHP_IBASE_INCLUDES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c deleted file mode 100644 index 4c9796213c1c0..0000000000000 --- a/ext/interbase/php_ibase_udf.c +++ /dev/null @@ -1,405 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/** -* This UDF library adds the ability to call PHP functions from SQL -* statements. Because of SQL's strong typing, you will have to declare -* an external function for every combination { output type, #args } that -* your application requires. -* -* Declare the functions like this: -* -* DECLARE EXTERNAL FUNCTION CALL_PHP1 -* CSTRING(xx), -* BY DESCRIPTOR, -* INTEGER BY DESCRIPTOR -* RETURNS PARAMETER 2 -* ENTRY_POINT 'udf_call_php1' MODULE_NAME 'php_ibase_udf' -* -* DECLARE EXTERNAL FUNCTION CALL_PHP2 -* CSTRING(xx), -* BY DESCRIPTOR, -* INTEGER BY DESCRIPTOR, -* INTEGER BY DESCRIPTOR -* RETURNS PARAMETER 2 -* ENTRY_POINT 'udf_call_php2' MODULE_NAME 'php_ibase_udf' -* -* ... and so on. [for up to 8 input arguments] -* -* The first input parameter contains the name of the PHP function you want -* to call. The second argument is the result. (omit this argument when calling -* the function) The return type of the function is the declared type of the -* result. The value returned from the PHP function being called will -* automatically be converted if necessary. -* The arguments should have their types declared as well, but you're free -* to pass arguments of other types instead. They will be converted to the -* best matching PHP type before being passed to the PHP function. -* -* The declared functions can be called from SQL like: -* -* SELECT * FROM WHERE CALL_PHP1('soundex',) NOT LIKE ? -* or -* UPDATE
SET = CALL_PHP1('ucwords',) -* -* Additionally, there's a function 'exec_php' which allows the contents -* of text BLOB fields to be parsed and executed by PHP. This is most useful -* for declaring functions that can then be called with CALL_PHPx. -* -* DECLARE EXTERNAL FUNCTION EXEC_PHP -* BLOB, -* INTEGER BY DESCRIPTOR, -* SMALLINT -* RETURNS PARAMETER 2 -* ENTRY_POINT 'exec_php' MODULE_NAME 'php_ibase_udf' -* -* The function will return 1 if execution succeeded and 0 if an error -* occurred. The result that is returned from the executed PHP code is -* ignored. You can pass a non-zero value as second argument to force -* the embedded PHP engine to re-initialise. -* -* There are several ways to build this library, depending on which way the -* database is accessed. If you're using the classic server on a local -* connection, you should compile the library like this: -* -* gcc -shared `php-config --includes` `php-config --ldflags` \ -* `php-config --libs` -o php_ibase_udf.so php_ibase_udf.c -* -* If you connect to the classic server by TCP/IP, you should build the -* PHP embedded static library and link against that. -* -* gcc -shared `php-config --includes` `php-config --ldflags` \ -* `php-config --libs` -o php_ibase_udf.so php_ibase_udf.c \ -* /usr/lib/libphp5.a -* -* If you use the super server, you should also link against the embedded -* library, but be sure to enable thread safety, as the super server is -* multi-threaded. After building, copy the resulting file to the folder -* where your database expects to find its UDFs. -*/ - -#include "zend.h" -#include "zend_API.h" - -#include "php.h" -#include "php_ini.h" - -#include "ibase.h" - -#define min(a,b) ((a)<(b)?(a):(b)) - -#ifdef PHP_WIN32 -#define LL_LIT(lit) lit ## I64 -#else -#define LL_LIT(lit) lit ## ll -#endif - -#ifdef ZTS -# include - -static void ***tsrm_ls; -pthread_mutex_t mtx_res = PTHREAD_MUTEX_INITIALIZER; - -#define LOCK() do { pthread_mutex_lock(&mtx_res); } while (0) -#define UNLOCK() do { pthread_mutex_unlock(&mtx_res); } while (0) -#else -#define LOCK() -#define UNLOCK() -#endif - -#ifdef PHP_EMBED -# include "php_main.h" -# include "sapi/embed/php_embed.h" - -static void __attribute__((constructor)) init() -{ - php_embed_init(0, NULL PTSRMLS_CC); -} - -static void __attribute__((destructor)) fini() -{ - php_embed_shutdown(TSRMLS_C); -} - -#endif - -/** -* Gets the contents of the BLOB b and offers it to Zend for parsing/execution -*/ -void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init) -{ - int result, remaining = b->blob_total_length, i = 0; - char *code = malloc(remaining+1); - ISC_USHORT read; - - for (code[remaining] = '\0'; remaining > 0; remaining -= read) - b->blob_get_segment(b->blob_handle, &code[i++<<16],min(0x10000,remaining), &read); - - LOCK(); - - switch (init && *init) { - - default: -#ifdef PHP_EMBED - php_request_shutdown(NULL); - if (FAILURE == (result = php_request_startup(TSRMLS_C))) { - break; - } - case 0: -#endif - /* feed it to the parser */ - zend_first_try { - result = zend_eval_string(code, NULL, "Firebird Embedded PHP engine" TSRMLS_CC); - } zend_end_try(); - } - - UNLOCK(); - - free(code); - - res->dsc_dtype = dtype_long; - *(ISC_LONG*)res->dsc_address = (result == SUCCESS); -} - -static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 100000000, 1000000000, - 1000000000, LL_LIT(10000000000),LL_LIT(100000000000),LL_LIT(10000000000000),LL_LIT(100000000000000), - LL_LIT(1000000000000000),LL_LIT(1000000000000000),LL_LIT(1000000000000000000) }; - - -static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) -{ - do { - zval callback, args[4], *argp[4], return_value; - PARAMVARY *res = (PARAMVARY*)r->dsc_address; - int i; - - INIT_ZVAL(callback); - ZVAL_STRING(&callback,name,0); - - /* check if the requested function exists */ - if (!zend_is_callable(&callback, 0, NULL)) { - break; - } - - /* create the argument array */ - for (i = 0; i < argc; ++i) { - - INIT_ZVAL(args[i]); - argp[i] = &args[i]; - - /* test arg for null */ - if (argv[i]->dsc_flags & DSC_null) { - ZVAL_NULL(argp[i]); - continue; - } - - switch (argv[i]->dsc_dtype) { - ISC_INT64 l; - struct tm t; - char const *fmt; - char d[64]; - - case dtype_cstring: - ZVAL_STRING(argp[i], (char*)argv[i]->dsc_address,0); - break; - - case dtype_text: - ZVAL_STRINGL(argp[i], (char*)argv[i]->dsc_address, argv[i]->dsc_length,0); - break; - - case dtype_varying: - ZVAL_STRINGL(argp[i], ((PARAMVARY*)argv[i]->dsc_address)->vary_string, - ((PARAMVARY*)argv[i]->dsc_address)->vary_length,0); - break; - - case dtype_short: - if (argv[i]->dsc_scale == 0) { - ZVAL_LONG(argp[i], *(short*)argv[i]->dsc_address); - } else { - ZVAL_DOUBLE(argp[i], - ((double)*(short*)argv[i]->dsc_address)/scales[-argv[i]->dsc_scale]); - } - break; - - case dtype_long: - if (argv[i]->dsc_scale == 0) { - ZVAL_LONG(argp[i], *(ISC_LONG*)argv[i]->dsc_address); - } else { - ZVAL_DOUBLE(argp[i], - ((double)*(ISC_LONG*)argv[i]->dsc_address)/scales[-argv[i]->dsc_scale]); - } - break; - - case dtype_int64: - l = *(ISC_INT64*)argv[i]->dsc_address; - - if (argv[i]->dsc_scale == 0 && l <= LONG_MAX && l >= LONG_MIN) { - ZVAL_LONG(argp[i], (long)l); - } else { - ZVAL_DOUBLE(argp[i], ((double)l)/scales[-argv[i]->dsc_scale]); - } - break; - - case dtype_real: - ZVAL_DOUBLE(argp[i], *(float*)argv[i]->dsc_address); - break; - - case dtype_double: - ZVAL_DOUBLE(argp[i], *(double*)argv[i]->dsc_address); - break; - - case dtype_sql_date: - isc_decode_sql_date((ISC_DATE*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(argp[i], d, strftime(d, sizeof(d), INI_STR("ibase.dateformat"), &t),1); - break; - - case dtype_sql_time: - isc_decode_sql_time((ISC_TIME*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(argp[i], d, strftime(d, sizeof(d), INI_STR("ibase.timeformat"), &t),1); - break; - - case dtype_timestamp: - isc_decode_timestamp((ISC_TIMESTAMP*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(argp[i], d, strftime(d, sizeof(d), INI_STR("ibase.timestampformat"), &t),1); - break; - } - } - - LOCK(); - - /* now call the function */ - if (FAILURE == call_user_function(EG(function_table), NULL, - &callback, &return_value, argc, argp TSRMLS_CC)) { - UNLOCK(); - break; - } - - UNLOCK(); - - for (i = 0; i < argc; ++i) { - switch (argv[i]->dsc_dtype) { - case dtype_sql_date: - case dtype_sql_time: - case dtype_timestamp: - zval_dtor(argp[i]); - - } - } - - /* return whatever type we got back from the callback: let DB handle conversion */ - switch (Z_TYPE(return_value)) { - - case IS_LONG: - r->dsc_dtype = dtype_long; - *(long*)r->dsc_address = Z_LVAL(return_value); - r->dsc_length = sizeof(long); - break; - - case IS_DOUBLE: - r->dsc_dtype = dtype_double; - *(double*)r->dsc_address = Z_DVAL(return_value); - r->dsc_length = sizeof(double); - break; - - case IS_NULL: - r->dsc_flags |= DSC_null; - break; - - default: - convert_to_string(&return_value); - - case IS_STRING: - r->dsc_dtype = dtype_varying; - memcpy(res->vary_string, Z_STRVAL(return_value), - (res->vary_length = min(r->dsc_length-2,Z_STRLEN(return_value)))); - r->dsc_length = res->vary_length+2; - break; - } - - zval_dtor(&return_value); - - return; - - } while (0); - - /** - * If we end up here, we should report an error back to the DB engine, but - * that's not possible. We can however report it back to PHP. - */ - LOCK(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling function '%s' from database", name); - UNLOCK(); -} - - -/* Entry points for the DB engine */ - -void udf_call_php1(char *name, PARAMDSC *r, PARAMDSC *arg1) -{ - PARAMDSC *args[1] = { arg1 }; - call_php(name, r, 1, args); -} - -void udf_call_php2(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2) -{ - PARAMDSC *args[2] = { arg1, arg2 }; - call_php(name, r, 2, args); -} - -void udf_call_php3(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3) -{ - PARAMDSC *args[3] = { arg1, arg2, arg3 }; - call_php(name, r, 3, args); -} - -void udf_call_php4(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, - PARAMDSC *arg4) -{ - PARAMDSC *args[4] = { arg1, arg2, arg3, arg4 }; - call_php(name, r, 4, args); -} - -void udf_call_php5(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, - PARAMDSC *arg4, PARAMDSC *arg5) -{ - PARAMDSC *args[5] = { arg1, arg2, arg3, arg4, arg5 }; - call_php(name, r, 5, args); -} - -void udf_call_php6(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, - PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6) -{ - PARAMDSC *args[6] = { arg1, arg2, arg3, arg4, arg5, arg6 }; - call_php(name, r, 6, args); -} - -void udf_call_php7(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, - PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6, PARAMDSC *arg7) -{ - PARAMDSC *args[7] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; - call_php(name, r, 7, args); -} - -void udf_call_php8(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, - PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6, PARAMDSC *arg7, PARAMDSC *arg8) -{ - PARAMDSC *args[8] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; - call_php(name, r, 8, args); -} - diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h deleted file mode 100644 index f3290958a9642..0000000000000 --- a/ext/interbase/php_interbase.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jouni Ahto | - | Andrew Avdeev | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_INTERBASE_H -#define PHP_INTERBASE_H - -extern zend_module_entry ibase_module_entry; -#define phpext_interbase_ptr &ibase_module_entry - -PHP_MINIT_FUNCTION(ibase); -PHP_RINIT_FUNCTION(ibase); -PHP_MSHUTDOWN_FUNCTION(ibase); -PHP_RSHUTDOWN_FUNCTION(ibase); -PHP_MINFO_FUNCTION(ibase); - -PHP_FUNCTION(ibase_connect); -PHP_FUNCTION(ibase_pconnect); -PHP_FUNCTION(ibase_close); -PHP_FUNCTION(ibase_drop_db); -PHP_FUNCTION(ibase_query); -PHP_FUNCTION(ibase_fetch_row); -PHP_FUNCTION(ibase_fetch_assoc); -PHP_FUNCTION(ibase_fetch_object); -PHP_FUNCTION(ibase_free_result); -PHP_FUNCTION(ibase_name_result); -PHP_FUNCTION(ibase_prepare); -PHP_FUNCTION(ibase_execute); -PHP_FUNCTION(ibase_free_query); - -PHP_FUNCTION(ibase_timefmt); - -PHP_FUNCTION(ibase_gen_id); -PHP_FUNCTION(ibase_num_fields); -PHP_FUNCTION(ibase_num_params); -#if abies_0 -PHP_FUNCTION(ibase_num_rows); -#endif -PHP_FUNCTION(ibase_affected_rows); -PHP_FUNCTION(ibase_field_info); -PHP_FUNCTION(ibase_param_info); - -PHP_FUNCTION(ibase_trans); -PHP_FUNCTION(ibase_commit); -PHP_FUNCTION(ibase_rollback); -PHP_FUNCTION(ibase_commit_ret); -PHP_FUNCTION(ibase_rollback_ret); - -PHP_FUNCTION(ibase_blob_create); -PHP_FUNCTION(ibase_blob_add); -PHP_FUNCTION(ibase_blob_cancel); -PHP_FUNCTION(ibase_blob_open); -PHP_FUNCTION(ibase_blob_get); -PHP_FUNCTION(ibase_blob_close); -PHP_FUNCTION(ibase_blob_echo); -PHP_FUNCTION(ibase_blob_info); -PHP_FUNCTION(ibase_blob_import); - -PHP_FUNCTION(ibase_add_user); -PHP_FUNCTION(ibase_modify_user); -PHP_FUNCTION(ibase_delete_user); - -PHP_FUNCTION(ibase_service_attach); -PHP_FUNCTION(ibase_service_detach); -PHP_FUNCTION(ibase_backup); -PHP_FUNCTION(ibase_restore); -PHP_FUNCTION(ibase_maintain_db); -PHP_FUNCTION(ibase_db_info); -PHP_FUNCTION(ibase_server_info); - -PHP_FUNCTION(ibase_errmsg); -PHP_FUNCTION(ibase_errcode); - -PHP_FUNCTION(ibase_wait_event); -PHP_FUNCTION(ibase_set_event_handler); -PHP_FUNCTION(ibase_free_event_handler); - -#else - -#define phpext_interbase_ptr NULL - -#endif /* PHP_INTERBASE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt deleted file mode 100644 index 070a6f0069034..0000000000000 --- a/ext/interbase/tests/002.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -InterBase: connect, close and pconnect ---SKIPIF-- - ---FILE-- - ---EXPECT-- ---- test1 --- -1 test table not created with isql ---- ---- test1 --- -1 test table not created with isql ---- diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt deleted file mode 100644 index 0263010b0236f..0000000000000 --- a/ext/interbase/tests/003.phpt +++ /dev/null @@ -1,183 +0,0 @@ ---TEST-- -InterBase: misc sql types (may take a while) ---SKIPIF-- - ---FILE-- -V_CHAR,0,strlen($v_char)) != $v_char){ - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date){ - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL4_2 != $v_decimal4_2){ - echo " DECIMAL4_2 fail\n"; - echo " in: $v_decimal4_2\n"; - echo " out: $row->V_DECIMAL4_2\n"; - } - if($row->V_DECIMAL4_0 != $v_decimal4_0){ - echo " DECIMAL4_0 fail\n"; - echo " in: $v_decimal4_0\n"; - echo " out: $row->V_DECIMAL4_0\n"; - } - if($row->V_DECIMAL7_2 != $v_decimal7_2){ - echo " DECIMAL7_2 fail\n"; - echo " in: $v_decimal7_2\n"; - echo " out: $row->V_DECIMAL7_2\n"; - } - if($row->V_DECIMAL7_0 != $v_decimal7_0){ - echo " DECIMAL7_0 fail\n"; - echo " in: $v_decimal7_0\n"; - echo " out: $row->V_DECIMAL7_0\n"; - } - if($row->V_NUMERIC15_15 != $v_numeric15_15){ - echo " NUMERIC15_15 fail\n"; - echo " in: $v_numeric15_15\n"; - echo " out: $row->V_NUMERIC15_15\n"; - } - if($row->V_NUMERIC15_0 != (string)$v_numeric15_0){ - echo " NUMERIC15_0 fail\n"; - echo " in: $v_numeric15_0\n"; - echo " out: $row->V_NUMERIC15_0\n"; - } - - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer){ - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if($row->V_SMALLINT != $v_smallint){ - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - - if(substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar){ - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - - ibase_free_result($sel); - } /* for($iter) */ - - /* check for correct handling of duplicate field names */ - $q = ibase_query('SELECT 1 AS id, 2 AS id, 3 AS id, 4 AS id, 5 AS id, 6 AS id, 7 AS id, 8 AS id, 9 AS id, - 10 AS id, 11 AS id, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 FROM rdb$database'); - var_dump(ibase_fetch_assoc($q)); - - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -array(22) { - ["ID"]=> - int(1) - ["ID_01"]=> - int(2) - ["ID_02"]=> - int(3) - ["ID_03"]=> - int(4) - ["ID_04"]=> - int(5) - ["ID_05"]=> - int(6) - ["ID_06"]=> - int(7) - ["ID_07"]=> - int(8) - ["ID_08"]=> - int(9) - ["ID_09"]=> - int(10) - ["ID_10"]=> - int(11) - ["FIELD_00"]=> - int(12) - ["FIELD_01"]=> - int(13) - ["FIELD_02"]=> - int(14) - ["FIELD_03"]=> - int(15) - ["FIELD_04"]=> - int(16) - ["FIELD_05"]=> - int(17) - ["FIELD_06"]=> - int(18) - ["FIELD_07"]=> - int(19) - ["FIELD_08"]=> - int(20) - ["FIELD_09"]=> - int(21) - ["FIELD_10"]=> - int(22) -} -end of test diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt deleted file mode 100644 index 579445dbdd8cb..0000000000000 --- a/ext/interbase/tests/004.phpt +++ /dev/null @@ -1,182 +0,0 @@ ---TEST-- -InterBase: BLOB test ---SKIPIF-- - ---FILE-- -V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (1)\n"; - ibase_blob_close($bl_h); - - $bl_h = ibase_blob_open($link,$row->V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 100 * 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (2)\n"; - ibase_blob_close($bl_h); - ibase_free_result($q); - unset($blob); - - echo "create blob 2\n"; - - ibase_query("INSERT INTO test4 (v_integer, v_blob) VALUES (2, ?)", $blob_str); - - echo "test blob 2\n"; - - $q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 2"); - $row = ibase_fetch_object($q,IBASE_TEXT); - - if($row->V_BLOB != $blob_str) - echo " BLOB 2 fail\n"; - ibase_free_result($q); - unset($blob); - - - echo "create blob 3\n"; - - $bl_h = ibase_blob_create($link); - - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| PHP HTML Embedded Scripting Language Version 3.0 |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| Copyright (c) 1997-2000 PHP Development Team (See Credits file) |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| This program is free software; you can redistribute it and/or modify |\n"); - ibase_blob_add($bl_h, "| it under the terms of one of the following licenses: |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| A) the GNU General Public License as published by the Free Software |\n"); - ibase_blob_add($bl_h, "| Foundation; either version 2 of the License, or (at your option) |\n"); - ibase_blob_add($bl_h, "| any later version. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| B) the PHP License as published by the PHP Development Team and |\n"); - ibase_blob_add($bl_h, "| included in the distribution in the file: LICENSE |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| This program is distributed in the hope that it will be useful, |\n"); - ibase_blob_add($bl_h, "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n"); - ibase_blob_add($bl_h, "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |\n"); - ibase_blob_add($bl_h, "| GNU General Public License for more details. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| You should have received a copy of both licenses referred to here. |\n"); - ibase_blob_add($bl_h, "| If you did not, or have any questions about PHP licensing, please |\n"); - ibase_blob_add($bl_h, "| contact core@php.net. |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - $bl_s = ibase_blob_close($bl_h); - ibase_query("INSERT INTO test4 (v_integer, v_blob) VALUES (3, ?)", $bl_s); - ibase_commit(); - echo "echo blob 3\n"; - - $q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 3"); - $row = ibase_fetch_object($q); - ibase_commit(); - ibase_close(); - - ibase_connect($test_base); - ibase_blob_echo($link, $row->V_BLOB); - ibase_free_result($q); - - echo "fetch blob 3\n"; - $q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 3"); - $row = ibase_fetch_object($q,IBASE_TEXT); - echo $row->V_BLOB; - ibase_free_result($q); - - ibase_close(); - unlink($name); - echo "end of test\n"; -?> ---EXPECT-- -import blob 1 -test blob 1 -create blob 2 -test blob 2 -create blob 3 -echo blob 3 -+----------------------------------------------------------------------+ -| PHP HTML Embedded Scripting Language Version 3.0 | -+----------------------------------------------------------------------+ -| Copyright (c) 1997-2000 PHP Development Team (See Credits file) | -+----------------------------------------------------------------------+ -| This program is free software; you can redistribute it and/or modify | -| it under the terms of one of the following licenses: | -| | -| A) 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. | -| | -| B) the PHP License as published by the PHP Development Team and | -| included in the distribution in the file: LICENSE | -| | -| This program 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 both licenses referred to here. | -| If you did not, or have any questions about PHP licensing, please | -| contact core@php.net. | -+----------------------------------------------------------------------+ -fetch blob 3 -+----------------------------------------------------------------------+ -| PHP HTML Embedded Scripting Language Version 3.0 | -+----------------------------------------------------------------------+ -| Copyright (c) 1997-2000 PHP Development Team (See Credits file) | -+----------------------------------------------------------------------+ -| This program is free software; you can redistribute it and/or modify | -| it under the terms of one of the following licenses: | -| | -| A) 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. | -| | -| B) the PHP License as published by the PHP Development Team and | -| included in the distribution in the file: LICENSE | -| | -| This program 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 both licenses referred to here. | -| If you did not, or have any questions about PHP licensing, please | -| contact core@php.net. | -+----------------------------------------------------------------------+ -end of test diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt deleted file mode 100644 index 5b16ac2917679..0000000000000 --- a/ext/interbase/tests/005.phpt +++ /dev/null @@ -1,290 +0,0 @@ ---TEST-- -InterBase: transactions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -default transaction: -empty table ---- test5 --- ---- -one row ---- test5 --- -1 ---- -after rollback table empty again ---- test5 --- ---- -one row ---- test5 --- -2 ---- -one row ---- test5 --- -2 ---- -one row... again. ---- test5 --- -2 ---- -one row. ---- test5 --- -2 ---- -one row ---- test5 --- -2 ---- -two rows ---- test5 --- -2 -3 ---- -two rows again ---- test5 --- -2 -4 ---- -one row in second transaction ---- test5 --- -2 ---- -three rows in third transaction ---- test5 --- -2 -3 -4 ---- -three rows in fourth transaction with deadlock ---- test5 --- -2 -3 -4 -errmsg [lock conflict on no wait transaction deadlock ] ---- -three rows ---- test5 --- -2 -3 -4 ---- -four rows ---- test5 --- -2 -3 -4 -5 ---- -four rows again ---- test5 --- -2 -3 -4 -5 ---- -end of test - diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt deleted file mode 100644 index 8155c9f41e853..0000000000000 --- a/ext/interbase/tests/006.phpt +++ /dev/null @@ -1,301 +0,0 @@ ---TEST-- -InterBase: binding (may take a while) ---SKIPIF-- - ---FILE-- -V_CHAR,0,strlen($v_char)) != $v_char) { - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date) { - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL != $v_decimal) { - echo " DECIMAL fail\n"; - echo " in: $v_decimal\n"; - echo " out: $row->V_DECIMAL\n"; - } - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)) { - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)) { - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer) { - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if ($row->V_NUMERIC != $v_numeric) { - echo " NUMERIC fail\n"; - echo " in: $v_numeric\n"; - echo " out: $row->V_NUMERIC\n"; - } - if ($row->V_SMALLINT != $v_smallint) { - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - if ($row->V_VARCHAR != $v_varchar) { - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - ibase_free_result($sel); - }/* for($iter)*/ - - echo "select\n"; - for($iter = 0; $iter < 3; $iter++) { - /* prepare data */ - $v_char = rand_str(1000); - $v_date = (int)rand_number(10,0,0); - $v_decimal = rand_number(12,3); - $v_double = rand_number(20); - $v_float = rand_number(7); - $v_integer = rand_number(9,0); - $v_numeric = rand_number(4,2); - $v_smallint = rand_number(5) % 32767; - $v_varchar = rand_str(10000); - - /* clear table*/ - ibase_query("delete from test6"); - - /* make one record */ - ibase_query("insert into test6 - (iter, v_char,v_date,v_decimal, - v_integer,v_numeric,v_smallint,v_varchar) - values (666, '$v_char',?,$v_decimal, $v_integer, - $v_numeric, $v_smallint, '$v_varchar')",$v_date); - - /* test all types */ - if(!($sel = ibase_query( - "select iter from test6 where v_char = ?", $v_char)) || - !ibase_fetch_row($sel)) { - echo "CHAR fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_date = ?", $v_date)) || - !ibase_fetch_row($sel)) { - echo "DATE fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_decimal = ?", $v_decimal)) || - !ibase_fetch_row($sel)) { - echo "DECIMAL fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_integer = ?", $v_integer)) || - !ibase_fetch_row($sel)) { - echo "INTEGER fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_numeric = ?", $v_numeric)) || - !ibase_fetch_row($sel)) { - echo "NUMERIC fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_smallint = ?", $v_smallint)) || - !ibase_fetch_row($sel)) { - echo "SMALLINT fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_varchar = ?", $v_varchar)) || - !ibase_fetch_row($sel)) { - echo "VARCHAR fail\n"; - } - ibase_free_result($sel); - - } /*for iter*/ - - echo "prepare and exec insert\n"; - - /* prepare table */ - ibase_query("delete from test6"); - - /* prepare query */ - $query = ibase_prepare( - "insert into test6 (v_integer) values (?)"); - - for($i = 0; $i < 10; $i++) { - ibase_execute($query, $i); - } - - out_table("test6"); - - ibase_free_query($query); - - echo "prepare and exec select\n"; - - /* prepare query */ - $query = ibase_prepare("select * from test6 - where v_integer between ? and ?"); - - $low_border = 2; - $high_border = 6; - - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $low_border = 0; - $high_border = 4; - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $res = ibase_execute($query, "5", 7.5); - out_result($res, "test6"); - ibase_free_result($res); - - ibase_free_query($query); - - /* test execute procedure */ - $query = ibase_prepare("execute procedure add1(?)"); - $res = array(); - for ($i = 0; $i < 10; $i++) { - $res[] = ibase_execute($query,$i); - } - ibase_free_query($query); - foreach ($res as $r) { - out_result($r, "proc add1"); - ibase_free_result($r); - } - - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -insert -select -prepare and exec insert ---- test6 --- - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 ---- -prepare and exec select ---- test6 --- - 2 - 3 - 4 - 5 - 6 ---- ---- test6 --- - 0 - 1 - 2 - 3 - 4 ---- ---- test6 --- - 5 - 6 - 7 ---- ---- proc add1 --- -1 ---- ---- proc add1 --- -2 ---- ---- proc add1 --- -3 ---- ---- proc add1 --- -4 ---- ---- proc add1 --- -5 ---- ---- proc add1 --- -6 ---- ---- proc add1 --- -7 ---- ---- proc add1 --- -8 ---- ---- proc add1 --- -9 ---- ---- proc add1 --- -10 ---- -end of test - diff --git a/ext/interbase/tests/007.phpt b/ext/interbase/tests/007.phpt deleted file mode 100644 index 069b7eda26cec..0000000000000 --- a/ext/interbase/tests/007.phpt +++ /dev/null @@ -1,183 +0,0 @@ ---TEST-- -InterBase: array handling ---SKIPIF-- - ---FILE-- -V_CHAR[$i],$v_char[$i],strlen($v_char[$i])) != 0) { - echo " CHAR[$i] fail:\n"; - echo " in: ".$v_char[$i]."\n"; - echo " out: ".$row->V_CHAR[$i]."\n"; - } - if($row->V_DATE[$i] != $v_date[$i]) { - echo " DATE[$i] fail\n"; - echo " in: ".$v_date[$i]."\n"; - echo " out: ".$row->V_DATE[$i]."\n"; - } - if($row->V_DECIMAL[$i] != $v_decimal[$i]) { - echo " DECIMAL[$i] fail\n"; - echo " in: ".$v_decimal[$i]."\n"; - echo " out: ".$row->V_DECIMAL[$i]."\n"; - } - if(abs($row->V_DOUBLE[$i] - $v_double[$i]) > abs($v_double[$i] / 1E15)) { - echo " DOUBLE[$i] fail\n"; - echo " in: ".$v_double[$i]."\n"; - echo " out: ".$row->V_DOUBLE[$i]."\n"; - } - if(abs($row->V_FLOAT[$i] - $v_float[$i]) > abs($v_float[$i] / 1E7)) { - echo " FLOAT[$i] fail\n"; - echo " in: ".$v_float[$i]."\n"; - echo " out: ".$row->V_FLOAT[$i]."\n"; - } - if($row->V_INTEGER[$i] != $v_integer[$i]) { - echo " INTEGER[$i] fail\n"; - echo " in: ".$v_integer[$i]."\n"; - echo " out: ".$row->V_INTEGER[$i]."\n"; - } - if ($row->V_NUMERIC[$i] != $v_numeric[$i]) { - echo " NUMERIC[$i] fail\n"; - echo " in: ".$v_numeric[$i]."\n"; - echo " out: ".$row->V_NUMERIC[$i]."\n"; - } - if ($row->V_SMALLINT[$i] != $v_smallint[$i]) { - echo " SMALLINT[$i] fail\n"; - echo " in: ".$v_smallint[$i]."\n"; - echo " out: ".$row->V_SMALLINT[$i]."\n"; - } - if ($row->V_VARCHAR[$i] != $v_varchar[$i]) { - echo " VARCHAR[$i] fail:\n"; - echo " in: ".$v_varchar[$i]."\n"; - echo " out: ".$row->V_VARCHAR[$i]."\n"; - } - } - ibase_free_result($sel); - }/* for($iter) */ - - echo "select\n"; - - $sel = ibase_query("SELECT v_multi[5,5,5],v_multi[10,10,10] FROM test7 WHERE iter = 0"); - print_r(ibase_fetch_row($sel)); - ibase_free_result($sel); - - for($iter = 1; $iter <= 3; $iter++) { - - if(!($sel = ibase_query( - "select iter from test7 where v_char[$iter] LIKE ?", $v_char[$iter]."%")) || - !ibase_fetch_row($sel)) { - echo "CHAR fail\n"; - } - ibase_free_result($sel); - - if(!($sel = ibase_query( - "select iter from test7 where v_date[$iter] = ?", $v_date[$iter])) || - !ibase_fetch_row($sel)) { - echo "DATE fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_decimal[$iter] = ?", $v_decimal[$iter])) || - !ibase_fetch_row($sel)) { - echo "DECIMAL fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_integer[$iter] = ?", $v_integer[$iter])) || - !ibase_fetch_row($sel)) { - echo "INTEGER fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_numeric[$iter] = ?", $v_numeric[$iter])) || - !ibase_fetch_row($sel)) { - echo "NUMERIC fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_smallint[$iter] = ?", $v_smallint[$iter])) || - !ibase_fetch_row($sel)) { - echo "SMALLINT fail\n"; - } - ibase_free_result($sel); - } - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -insert -select -Array -( - [0] => 125 - [1] => 1000 -) -end of test diff --git a/ext/interbase/tests/008.phpt b/ext/interbase/tests/008.phpt deleted file mode 100755 index 8292fc38c567b..0000000000000 --- a/ext/interbase/tests/008.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -InterBase: event handling ---SKIPIF-- - ---FILE-- - 5) echo "FAIL ($count)\n"; -echo "end of test\n"; - -?> ---EXPECT-- -end of test diff --git a/ext/interbase/tests/interbase.inc b/ext/interbase/tests/interbase.inc deleted file mode 100755 index 1401d9b8214a2..0000000000000 --- a/ext/interbase/tests/interbase.inc +++ /dev/null @@ -1,117 +0,0 @@ - diff --git a/ext/interbase/tests/skipif.inc b/ext/interbase/tests/skipif.inc deleted file mode 100755 index 337abe7cfff22..0000000000000 --- a/ext/interbase/tests/skipif.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/ext/ldap/CREDITS b/ext/ldap/CREDITS deleted file mode 100644 index 5dc3d0197474f..0000000000000 --- a/ext/ldap/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -LDAP -Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas diff --git a/ext/ldap/LDAP_Win32_HOWTO.txt b/ext/ldap/LDAP_Win32_HOWTO.txt deleted file mode 100644 index bcee731e888a7..0000000000000 --- a/ext/ldap/LDAP_Win32_HOWTO.txt +++ /dev/null @@ -1,33 +0,0 @@ -Rules for building LDAP ------------------------ - -Note 1: During the entire build process, you can ignore warnings about - inconsistent DLL linkage. - - -- Open LDAP under php_build. Rename this directory to 'OpenLDAP'. -- Rename OpenLDAP\include\portable.h.nt to OpenLDAP\include\portable.h -- Rename OpenLDAP\include\ldapconfig.h.nt to OpenLDAP\include\ldapconfig.h -- Launch Visual Studio with OpenLDAP\libraries\libldap\libldap.dsw -- Enter Project->Settings. - Select the C/C++ tab, and select 'Code Generation' in the Category box. - For 'Win32 Debug', change the runtime library to 'Debug Multithreaded DLL' - For 'Win32 Release', change the runtime library to 'Multithreaded DLL' - Select the Preprocessor tab, select 'All Configurations'. - Add '..\..\..\..\php5\regex' to the 'Additional include directories' list. - Add 'HAVE_MKTEMP' to the 'Preprocessor definitions' list. -- Compile (you can compile both Debug and Release versions). - - -- Launch Visual Studio with OpenLDAP\libraries\liblber\liblber.dsw -- Enter Project->Settings. - Select the C/C++ tab, and select 'Code Generation' in the Category box. - For 'Win32 Debug', change the runtime library to 'Debug Multithreaded DLL' - For 'Win32 Release', change the runtime library to 'Multithreaded DLL' - Select the Preprocessor tab, select 'All Configurations'. - Add 'HAVE_MKTEMP' to the 'Preprocessor definitions' list. -- Compile (you can compile both Debug and Release versions). - - -Start Visual Studio, load php_modules.dsw, select the LDAP project, and build -it. diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 deleted file mode 100644 index 1d6282a55451f..0000000000000 --- a/ext/ldap/config.m4 +++ /dev/null @@ -1,193 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_LDAP_CHECKS], [ - if test -f $1/include/ldap.h; then - LDAP_DIR=$1 - LDAP_INCDIR=$1/include - LDAP_LIBDIR=$1/$PHP_LIBDIR - elif test -f $1/include/umich-ldap/ldap.h; then - LDAP_DIR=$1 - LDAP_INCDIR=$1/include/umich-ldap - LDAP_LIBDIR=$1/$PHP_LIBDIR - elif test -f $1/ldap/public/ldap.h; then - LDAP_DIR=$1 - LDAP_INCDIR=$1/ldap/public - LDAP_LIBDIR=$1/$PHP_LIBDIR - fi -]) - -AC_DEFUN([PHP_LDAP_SASL_CHECKS], [ - if test "$1" = "yes"; then - SEARCH_DIRS="/usr/local /usr" - else - SEARCH_DIRS=$1 - fi - - for i in $SEARCH_DIRS; do - if test -f $i/include/sasl/sasl.h; then - LDAP_SASL_DIR=$i - AC_DEFINE(HAVE_LDAP_SASL_SASL_H,1,[ ]) - break - elif test -f $i/include/sasl.h; then - LDAP_SASL_DIR=$i - AC_DEFINE(HAVE_LDAP_SASL_H,1,[ ]) - break - fi - done - - if test "$LDAP_SASL_DIR"; then - LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include - LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR - else - AC_MSG_ERROR([sasl.h not found!]) - fi - - if test "$PHP_LDAP_SASL" = "yes"; then - SASL_LIB="-lsasl2" - else - SASL_LIB="-L$LDAP_SASL_LIBDIR -lsasl2" - fi - - PHP_CHECK_LIBRARY(ldap, sasl_version, - [ - PHP_ADD_INCLUDE($LDAP_SASL_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(sasl2, $LDAP_SASL_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_LDAP_SASL, 1, [LDAP SASL support]) - ], [ - AC_MSG_ERROR([LDAP SASL check failed. Please check config.log for more information.]) - ], [ - $LDAP_SHARED_LIBADD $SASL_LIB - ]) -]) - -PHP_ARG_WITH(ldap,for LDAP support, -[ --with-ldap[=DIR] Include LDAP support]) - -PHP_ARG_WITH(ldap-sasl,for LDAP Cyrus SASL support, -[ --with-ldap-sasl[=DIR] LDAP: Include Cyrus SASL support], no, no) - -if test "$PHP_LDAP" != "no"; then - - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared) - - if test "$PHP_LDAP" = "yes"; then - for i in /usr/local /usr; do - PHP_LDAP_CHECKS($i) - done - else - PHP_LDAP_CHECKS($PHP_LDAP) - fi - - if test -z "$LDAP_DIR"; then - AC_MSG_ERROR(Cannot find ldap.h) - fi - - dnl The Linux version of the SDK need -lpthread - dnl I have tested Solaris, and it doesn't, but others may. Add - dnl these here if necessary. -RL - dnl Is this really necessary? -Troels Arvin - - if test `uname` = "Linux"; then - LDAP_PTHREAD=pthread - else - LDAP_PTHREAD= - fi - - if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then - PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - - elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 -o -f $LDAP_LIBDIR/libldap.3.dylib; then - PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - - elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then - if test -n "$LDAP_PTHREAD"; then - PHP_ADD_LIBRARY($LDAP_PTHREAD) - fi - PHP_ADD_LIBRARY_WITH_PATH(nspr4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(plc4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(plds4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ssldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(prldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_NSLDAP,1,[ ]) - - elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then - if test -n "$LDAP_PTHREAD"; then - PHP_ADD_LIBRARY($LDAP_PTHREAD) - fi - PHP_ADD_LIBRARY_WITH_PATH(nspr3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(plc3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(plds3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ldapssl41, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_NSLDAP,1,[ ]) - - elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then - if test -n "$LDAP_PTHREAD"; then - PHP_ADD_LIBRARY($LDAP_PTHREAD) - fi - PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_NSLDAP,1,[ ]) - - elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then - if test -n "$LDAP_PTHREAD"; then - PHP_ADD_LIBRARY($LDAP_PTHREAD) - fi - PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_NSLDAP,1,[ ]) - - elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then - PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - - elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then - PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_ORALDAP,1,[ ]) - if test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - AC_DEFINE(HAVE_ORALDAP_10,1,[ ]) - fi - else - AC_MSG_ERROR(Cannot find ldap libraries in $LDAP_LIBDIR.) - fi - - PHP_ADD_INCLUDE($LDAP_INCDIR) - PHP_SUBST(LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_LDAP,1,[ ]) - - dnl Check for 3 arg ldap_set_rebind_proc - _SAVE_CPPFLAGS=$CPPFLAGS - _SAVE_LDFLAGS=$LDFLAGS - CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR" - AC_CACHE_CHECK([for 3 arg ldap_set_rebind_proc], ac_cv_3arg_setrebindproc, - [AC_TRY_COMPILE([#include ], [ldap_set_rebind_proc(0,0,0)], - ac_cv_3arg_setrebindproc=yes, ac_cv_3arg_setrebindproc=no)]) - if test "$ac_cv_3arg_setrebindproc" = yes; then - AC_DEFINE(HAVE_3ARG_SETREBINDPROC,1,[Whether 3 arg set_rebind_proc()]) - fi - CPPFLAGS=$_SAVE_CPPFLAGS - - dnl Solaris 2.8 claims to be 2004 API, but doesn't have - dnl ldap_parse_reference() nor ldap_start_tls_s() - AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s]) - LDFLAGS=$_SAVE_LDFLAGS - - dnl - dnl SASL check - dnl - if test "$PHP_LDAP_SASL" != "no"; then - PHP_LDAP_SASL_CHECKS([$PHP_LDAP_SASL]) - fi - - dnl - dnl Sanity check - dnl - _SAVE_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $LDAP_SHARED_LIBADD" - AC_CHECK_FUNC(ldap_bind_s, [], [ - AC_MSG_ERROR([LDAP build check failed. Please check config.log for more information.]) - ]) - LDFLAGS=$_SAVE_LDFLAGS -fi diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32 deleted file mode 100644 index 77a34fe8c962b..0000000000000 --- a/ext/ldap/config.w32 +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("ldap", "LDAP support", "no"); - -if (PHP_LDAP != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("ldap.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) && - CHECK_LIB("ssleay32.lib", "ldap", PHP_LDAP) && - CHECK_LIB("libeay32.lib", "ldap", PHP_LDAP) && - CHECK_LIB("oldap32.lib", "ldap", PHP_LDAP) && - CHECK_LIB("olber32.lib", "ldap", PHP_LDAP)) { - EXTENSION('ldap', 'ldap.c'); - - AC_DEFINE('HAVE_LDAP_PARSE_REFERENCE', 1); - AC_DEFINE('HAVE_LDAP_START_TLS_S', 1); - AC_DEFINE('HAVE_LDAP', 1); - - } else { - WARNING("ldap not enabled; libraries and headers not found"); - } -} - diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c deleted file mode 100644 index bffe17c11b2fc..0000000000000 --- a/ext/ldap/ldap.c +++ /dev/null @@ -1,2307 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Amitay Isaacs | - | Eric Warnke | - | Rasmus Lerdorf | - | Gerrit Thomson <334647@swin.edu.au> | - | Jani Taskinen | - | Stig Venaas | - | PHP 4.0 updates: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* Additional headers for NetWare */ -#if defined(NETWARE) && (NEW_LIBC) -#include -#include -#endif - -#include "php.h" -#include "php_ini.h" - -#include - -#include "ext/standard/dl.h" -#include "php_ldap.h" - -#ifdef PHP_WIN32 -#include -#if HAVE_NSLDAP -#include -#endif -#define strdup _strdup -#undef WINDOWS -#undef strcasecmp -#undef strncasecmp -#define WINSOCK 1 -#define __STDC__ 1 -#endif - -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" - -#ifdef HAVE_LDAP_SASL_H -#include -#elif defined(HAVE_LDAP_SASL_SASL_H) -#include -#endif - -typedef struct { - LDAP *link; -#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) - zval *rebindproc; -#endif -} ldap_linkdata; - -typedef struct { - LDAPMessage *data; - int id; -} ldap_resultentry; - -ZEND_DECLARE_MODULE_GLOBALS(ldap) - -static - ZEND_BEGIN_ARG_INFO(arg3to6of6_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static int le_link, le_result, le_result_entry, le_ber_entry; - -/* - This is just a small subset of the functionality provided by the LDAP library. All the - operations are synchronous. Referrals are not handled automatically. -*/ -/* {{{ ldap_functions[] - */ -function_entry ldap_functions[] = { - PHP_FE(ldap_connect, NULL) - PHP_FALIAS(ldap_close, ldap_unbind, NULL) - PHP_FE(ldap_bind, NULL) -#ifdef HAVE_LDAP_SASL - PHP_FE(ldap_sasl_bind, NULL) -#endif - PHP_FE(ldap_unbind, NULL) - PHP_FE(ldap_read, NULL) - PHP_FE(ldap_list, NULL) - PHP_FE(ldap_search, NULL) - PHP_FE(ldap_free_result, NULL) - PHP_FE(ldap_count_entries, NULL) - PHP_FE(ldap_first_entry, NULL) - PHP_FE(ldap_next_entry, NULL) - PHP_FE(ldap_get_entries, NULL) - PHP_FE(ldap_first_attribute, third_arg_force_ref) - PHP_FE(ldap_next_attribute, third_arg_force_ref) - PHP_FE(ldap_get_attributes, NULL) - PHP_FE(ldap_get_values, NULL) - PHP_FE(ldap_get_values_len, NULL) - PHP_FE(ldap_get_dn, NULL) - PHP_FE(ldap_explode_dn, NULL) - PHP_FE(ldap_dn2ufn, NULL) - PHP_FE(ldap_add, NULL) - PHP_FE(ldap_delete, NULL) - PHP_FALIAS(ldap_modify, ldap_mod_replace, NULL) - -/* additional functions for attribute based modifications, Gerrit Thomson */ - PHP_FE(ldap_mod_add, NULL) - PHP_FE(ldap_mod_replace, NULL) - PHP_FE(ldap_mod_del, NULL) -/* end gjt mod */ - - PHP_FE(ldap_errno, NULL) - PHP_FE(ldap_err2str, NULL) - PHP_FE(ldap_error, NULL) - PHP_FE(ldap_compare, NULL) - PHP_FE(ldap_sort, NULL) - -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 - PHP_FE(ldap_rename, NULL) - PHP_FE(ldap_get_option, third_arg_force_ref) - PHP_FE(ldap_set_option, NULL) - PHP_FE(ldap_first_reference, NULL) - PHP_FE(ldap_next_reference, NULL) -#ifdef HAVE_LDAP_PARSE_REFERENCE - PHP_FE(ldap_parse_reference, third_arg_force_ref) -#endif -#ifdef HAVE_LDAP_PARSE_RESULT - PHP_FE(ldap_parse_result, arg3to6of6_force_ref) -#endif -#ifdef HAVE_LDAP_START_TLS_S - PHP_FE(ldap_start_tls, NULL) -#endif -#endif - -#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) - PHP_FE(ldap_set_rebind_proc, NULL) -#endif - -#ifdef STR_TRANSLATION - PHP_FE(ldap_t61_to_8859, NULL) - PHP_FE(ldap_8859_to_t61, NULL) -#endif - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry ldap_module_entry = { - STANDARD_MODULE_HEADER, - "ldap", - ldap_functions, - PHP_MINIT(ldap), - PHP_MSHUTDOWN(ldap), - NULL, - NULL, - PHP_MINFO(ldap), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_LDAP -ZEND_GET_MODULE(ldap) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -static void _close_ldap_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr; - - ldap_unbind_s(ld->link); -#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) - if (ld->rebindproc != NULL) { - zval_dtor(ld->rebindproc); - FREE_ZVAL(ld->rebindproc); - } -#endif - efree(ld); - LDAPG(num_links)--; -} - -static void _free_ldap_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - LDAPMessage *result = (LDAPMessage *)rsrc->ptr; - ldap_msgfree(result); -} - -static void _free_ldap_result_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - ldap_resultentry *entry = (ldap_resultentry *)rsrc->ptr; - zend_list_delete(entry->id); - efree(entry); -} - -/* {{{ PHP_INI_BEGIN - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY_EX("ldap.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_ldap_globals, ldap_globals, display_link_numbers) -PHP_INI_END() -/* }}} */ - -/* {{{ php_ldap_init_globals - */ -static void php_ldap_init_globals(zend_ldap_globals *ldap_globals) -{ - ldap_globals->num_links = 0; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(ldap) -{ - ZEND_INIT_MODULE_GLOBALS(ldap, php_ldap_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - /* Constants to be used with deref-parameter in php_ldap_do_search() */ - REGISTER_LONG_CONSTANT("LDAP_DEREF_NEVER", LDAP_DEREF_NEVER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_DEREF_SEARCHING", LDAP_DEREF_SEARCHING, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS); - -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 - /* LDAP options */ - REGISTER_LONG_CONSTANT("LDAP_OPT_DEREF", LDAP_OPT_DEREF, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_SIZELIMIT", LDAP_OPT_SIZELIMIT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_TIMELIMIT", LDAP_OPT_TIMELIMIT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_PROTOCOL_VERSION", LDAP_OPT_PROTOCOL_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_ERROR_NUMBER", LDAP_OPT_ERROR_NUMBER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_REFERRALS", LDAP_OPT_REFERRALS, CONST_PERSISTENT | CONST_CS); -#ifdef LDAP_OPT_RESTART - REGISTER_LONG_CONSTANT("LDAP_OPT_RESTART", LDAP_OPT_RESTART, CONST_PERSISTENT | CONST_CS); -#endif -#ifdef LDAP_OPT_HOST_NAME - REGISTER_LONG_CONSTANT("LDAP_OPT_HOST_NAME", LDAP_OPT_HOST_NAME, CONST_PERSISTENT | CONST_CS); -#endif - REGISTER_LONG_CONSTANT("LDAP_OPT_ERROR_STRING", LDAP_OPT_ERROR_STRING, CONST_PERSISTENT | CONST_CS); -#ifdef LDAP_OPT_MATCHED_DN - REGISTER_LONG_CONSTANT("LDAP_OPT_MATCHED_DN", LDAP_OPT_MATCHED_DN, CONST_PERSISTENT | CONST_CS); -#endif - REGISTER_LONG_CONSTANT("LDAP_OPT_SERVER_CONTROLS", LDAP_OPT_SERVER_CONTROLS, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_CLIENT_CONTROLS", LDAP_OPT_CLIENT_CONTROLS, CONST_PERSISTENT | CONST_CS); -#endif -#ifdef LDAP_OPT_DEBUG_LEVEL - REGISTER_LONG_CONSTANT("LDAP_OPT_DEBUG_LEVEL", LDAP_OPT_DEBUG_LEVEL, CONST_PERSISTENT | CONST_CS); -#endif - -#ifdef HAVE_LDAP_SASL - REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_MECH", LDAP_OPT_X_SASL_MECH, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_REALM", LDAP_OPT_X_SASL_REALM, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_AUTHCID", LDAP_OPT_X_SASL_AUTHCID, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_AUTHZID", LDAP_OPT_X_SASL_AUTHZID, CONST_PERSISTENT | CONST_CS); -#endif - -#ifdef ORALDAP - REGISTER_LONG_CONSTANT("GSLC_SSL_NO_AUTH", GSLC_SSL_NO_AUTH, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("GSLC_SSL_ONEWAY_AUTH", GSLC_SSL_ONEWAY_AUTH, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("GSLC_SSL_TWOWAY_AUTH", GSLC_SSL_TWOWAY_AUTH, CONST_PERSISTENT | CONST_CS); -#endif - - le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, "ldap result", module_number); - le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number); - le_result_entry = zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, "ldap result entry", module_number); - le_ber_entry = zend_register_list_destructors_ex(NULL, NULL, "ldap ber entry", module_number); - - Z_TYPE(ldap_module_entry) = type; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(ldap) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(ldap) -{ - char tmp[32]; -#if HAVE_NSLDAP - LDAPVersion ver; - double SDKVersion; -#endif - - php_info_print_table_start(); - php_info_print_table_row(2, "LDAP Support", "enabled"); - php_info_print_table_row(2, "RCS Version", "$Id$"); - - if (LDAPG(max_links) == -1) { - snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links)); - } else { - snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links)); - } - php_info_print_table_row(2, "Total Links", tmp); - -#ifdef LDAP_API_VERSION - snprintf(tmp, 31, "%d", LDAP_API_VERSION); - php_info_print_table_row(2, "API Version", tmp); -#endif - -#ifdef LDAP_VENDOR_NAME - php_info_print_table_row(2, "Vendor Name", LDAP_VENDOR_NAME); -#endif - -#ifdef LDAP_VENDOR_VERSION - snprintf(tmp, 31, "%d", LDAP_VENDOR_VERSION); - php_info_print_table_row(2, "Vendor Version", tmp); -#endif - -#if HAVE_NSLDAP - SDKVersion = ldap_version(&ver); - snprintf(tmp, 31, "%f", SDKVersion/100.0); - php_info_print_table_row(2, "SDK Version", tmp); - - snprintf(tmp, 31, "%f", ver.protocol_version/100.0); - php_info_print_table_row(2, "Highest LDAP Protocol Supported", tmp); - - snprintf(tmp, 31, "%f", ver.SSL_version/100.0); - php_info_print_table_row(2, "SSL Level Supported", tmp); - - if (ver.security_level != LDAP_SECURITY_NONE) { - snprintf(tmp, 31, "%d", ver.security_level); - } else { - strcpy(tmp, "SSL not enabled"); - } - php_info_print_table_row(2, "Level of Encryption", tmp); -#endif - -#ifdef HAVE_LDAP_SASL - php_info_print_table_row(2, "SASL Support", "Enabled"); -#endif - - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto resource ldap_connect([string host [, int port]]) - Connect to an LDAP server */ -PHP_FUNCTION(ldap_connect) -{ - char *host = NULL; - int hostlen; - long port = 389; /* Default port */ -#ifdef HAVE_ORALDAP - char *wallet, *walletpasswd; - int walletlen, walletpasswdlen; - long authmode; - int ssl=0; -#endif - ldap_linkdata *ld; - LDAP *ldap; - -#ifdef HAVE_ORALDAP - if (ZEND_NUM_ARGS() == 3 || ZEND_NUM_ARGS() == 4) { - WRONG_PARAM_COUNT; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) == FAILURE) { - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() == 5) { - ssl = 1; - } -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &host, &hostlen, &port) == FAILURE) { - RETURN_FALSE; - } -#endif - - if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", LDAPG(num_links)); - RETURN_FALSE; - } - - ld = ecalloc(1, sizeof(ldap_linkdata)); - -#ifdef LDAP_API_FEATURE_X_OPENLDAP - if (host != NULL && strchr(host, '/')) { - int rc; - - rc = ldap_initialize(&ldap, host); - if (rc != LDAP_SUCCESS) { - efree(ld); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create session handle: %s", ldap_err2string(rc)); - RETURN_FALSE; - } - } else { - ldap = ldap_init(host, port); - } -#else - ldap = ldap_open(host, port); -#endif - - if (ldap == NULL) { - efree(ld); - RETURN_FALSE; - } else { -#ifdef HAVE_ORALDAP - if (ssl) { - if (ldap_init_SSL(&ldap->ld_sb, wallet, walletpasswd, authmode)) { - efree(ld); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL init failed"); - RETURN_FALSE; - } - } -#endif - LDAPG(num_links)++; - ld->link = ldap; - ZEND_REGISTER_RESOURCE(return_value, ld, le_link); - } - -} -/* }}} */ - -/* {{{ _get_lderrno - */ -static int _get_lderrno(LDAP *ldap) -{ -#if !HAVE_NSLDAP -#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP_10 - int lderr; - - /* New versions of OpenLDAP do it this way */ - ldap_get_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr); - return lderr; -#else - return ldap->ld_errno; -#endif -#else - return ldap_get_lderrno(ldap, NULL, NULL); -#endif -} -/* }}} */ - -/* {{{ proto bool ldap_bind(resource link [, string dn, string password]) - Bind to LDAP directory */ -PHP_FUNCTION(ldap_bind) -{ - zval *link; - char *ldap_bind_dn = NULL, *ldap_bind_pw = NULL; - int ldap_bind_dnlen, ldap_bind_pwlen; - ldap_linkdata *ld; - int rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - - if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -#ifdef HAVE_LDAP_SASL -typedef struct { - char *mech; - char *realm; - char *authcid; - char *passwd; - char *authzid; -} php_ldap_bictx; - -/* {{{ _php_sasl_setdefs - */ -static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char *sasl_realm, char *binddn, char *pass, char *sasl_authz_id) -{ - php_ldap_bictx *ctx; - - ctx = ber_memalloc(sizeof(php_ldap_bictx)); - ctx->mech = (sasl_mech) ? ber_strdup(sasl_mech) : NULL; - ctx->realm = (sasl_realm) ? ber_strdup(sasl_realm) : NULL; - ctx->authcid = (binddn) ? ber_strdup(binddn) : NULL; - ctx->passwd = (pass) ? ber_strdup(pass) : NULL; - ctx->authzid = (sasl_authz_id) ? ber_strdup(sasl_authz_id) : NULL; - - if (ctx->mech == NULL) { - ldap_get_option(ld, LDAP_OPT_X_SASL_MECH, &ctx->mech); - } - if (ctx->realm == NULL) { - ldap_get_option(ld, LDAP_OPT_X_SASL_REALM, &ctx->realm); - } - if (ctx->authcid == NULL) { - ldap_get_option(ld, LDAP_OPT_X_SASL_AUTHCID, &ctx->authcid); - } - if (ctx->authzid == NULL) { - ldap_get_option(ld, LDAP_OPT_X_SASL_AUTHZID, &ctx->authzid); - } - - return ctx; -} - -/* {{{ _php_sasl_setdefs - */ -static void _php_sasl_freedefs(php_ldap_bictx *ctx) -{ - if (ctx->mech) ber_memfree(ctx->mech); - if (ctx->realm) ber_memfree(ctx->realm); - if (ctx->authcid) ber_memfree(ctx->authcid); - if (ctx->passwd) ber_memfree(ctx->passwd); - if (ctx->authzid) ber_memfree(ctx->authzid); - ber_memfree(ctx); -} - -/* {{{ _php_sasl_interact - Internal interact function for SASL */ -static int _php_sasl_interact(LDAP *ld, unsigned flags, void *defaults, void *in) -{ - sasl_interact_t *interact = in; - const char *p; - php_ldap_bictx *ctx = defaults; - - for (;interact->id != SASL_CB_LIST_END;interact++) { - p = NULL; - switch(interact->id) { - case SASL_CB_GETREALM: - p = ctx->realm; - break; - case SASL_CB_AUTHNAME: - p = ctx->authcid; - break; - case SASL_CB_USER: - p = ctx->authzid; - break; - case SASL_CB_PASS: - p = ctx->passwd; - break; - } - if (p) { - interact->result = p; - interact->len = strlen(interact->result); - } - } - return LDAP_SUCCESS; -} - -/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string password, string sasl_mech, string sasl_realm, string sasl_authz_id, string props]) - Bind to LDAP directory using SASL */ -PHP_FUNCTION(ldap_sasl_bind) -{ - zval *link; - ldap_linkdata *ld; - char *binddn = NULL; - char *pass = NULL; - char *sasl_mech = NULL; - char *sasl_realm = NULL; - char *sasl_authz_id = NULL; - char *props = NULL; - int rc, dn_len, pass_len, mech_len, realm_len, authz_id_len, props_len; - php_ldap_bictx *ctx; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ssssss", &link, &binddn, &dn_len, &pass, &pass_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authz_id, &authz_id_len, &props, &props_len) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - - ctx = _php_sasl_setdefs(ld->link, sasl_mech, sasl_realm, binddn, pass, sasl_authz_id); - - if (props) { - ldap_set_option(ld->link, LDAP_OPT_X_SASL_SECPROPS, props); - } - - rc = ldap_sasl_interactive_bind_s(ld->link, binddn, ctx->mech, NULL, NULL, LDAP_SASL_QUIET, _php_sasl_interact, ctx); - if (rc != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); - RETVAL_FALSE; - } else { - RETVAL_TRUE; - } - _php_sasl_freedefs(ctx); -} -/* }}} */ -#endif /* HAVE_LDAP_SASL */ - -/* {{{ proto bool ldap_unbind(resource link) - Unbind from LDAP directory */ -PHP_FUNCTION(ldap_unbind) -{ - zval *link; - ldap_linkdata *ld; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - - zend_list_delete(Z_LVAL_P(link)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_set_opts - */ -static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref) -{ - /* sizelimit */ - if (sizelimit > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 - ldap_set_option(ldap, LDAP_OPT_SIZELIMIT, &sizelimit); -#else - ldap->ld_sizelimit = sizelimit; -#endif - } - - /* timelimit */ - if (timelimit > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 - ldap_set_option(ldap, LDAP_OPT_TIMELIMIT, &timelimit); -#else - ldap->ld_timelimit = timelimit; -#endif - } - - /* deref */ - if (deref > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 - ldap_set_option(ldap, LDAP_OPT_DEREF, &deref); -#else - ldap->ld_deref = deref; -#endif - } -} -/* }}} */ - -/* {{{ php_ldap_do_search - */ -static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope) -{ - zval **link, **base_dn, **filter, **attrs, **attr, **attrsonly, **sizelimit, **timelimit, **deref; - char *ldap_base_dn = NULL; - char *ldap_filter = NULL; - char **ldap_attrs = NULL; - ldap_linkdata *ld; - LDAPMessage *ldap_res; - int ldap_attrsonly = 0; - int ldap_sizelimit = -1; - int ldap_timelimit = -1; - int ldap_deref = -1; - int num_attribs = 0; - int i, errno; - int myargcount = ZEND_NUM_ARGS(); - - if (myargcount < 3 || myargcount > 8 || zend_get_parameters_ex(myargcount, &link, &base_dn, &filter, &attrs, &attrsonly, &sizelimit, &timelimit, &deref) == FAILURE) { - WRONG_PARAM_COUNT; - } - - /* Reverse -> fall through */ - switch (myargcount) { - case 8 : - convert_to_long_ex(deref); - ldap_deref = Z_LVAL_PP(deref); - - case 7 : - convert_to_long_ex(timelimit); - ldap_timelimit = Z_LVAL_PP(timelimit); - - case 6 : - convert_to_long_ex(sizelimit); - ldap_sizelimit = Z_LVAL_PP(sizelimit); - - case 5 : - convert_to_long_ex(attrsonly); - ldap_attrsonly = Z_LVAL_PP(attrsonly); - - case 4 : - if (Z_TYPE_PP(attrs) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected Array as last element"); - RETURN_FALSE; - } - - num_attribs = zend_hash_num_elements(Z_ARRVAL_PP(attrs)); - ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0); - - for (i = 0; ilink, ldap_sizelimit, ldap_timelimit, ldap_deref); - - /* Run the actual search */ - rcs[i] = ldap_search(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly); - lds[i] = ld; - zend_hash_move_forward(Z_ARRVAL_PP(link)); - } - - if (ldap_attrs != NULL) { - efree(ldap_attrs); - } - - array_init(return_value); - - /* Collect results from the searches */ - for (i=0; ilink, LDAP_RES_ANY, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); - } - if (rcs[i] != -1) { - ZEND_REGISTER_RESOURCE(resource, ldap_res, le_result); - add_next_index_zval(return_value, resource); - } else { - add_next_index_bool(return_value, 0); - } - } - efree(lds); - efree(rcs); - return; - } - - ld = (ldap_linkdata *) zend_fetch_resource(link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link); - if (ld == NULL) { - if (ldap_attrs != NULL) { - efree(ldap_attrs); - } - RETURN_FALSE; - } - - php_set_opts(ld->link, ldap_sizelimit, ldap_timelimit, ldap_deref); - - /* Run the actual search */ - errno = ldap_search_s(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly, &ldap_res); - - if (ldap_attrs != NULL) { - efree(ldap_attrs); - } - - if (errno != LDAP_SUCCESS - && errno != LDAP_SIZELIMIT_EXCEEDED -#ifdef LDAP_ADMINLIMIT_EXCEEDED - && errno != LDAP_ADMINLIMIT_EXCEEDED -#endif -#ifdef LDAP_REFERRAL - && errno != LDAP_REFERRAL -#endif - ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search: %s", ldap_err2string(errno)); - RETVAL_FALSE; - } else { - if (errno == LDAP_SIZELIMIT_EXCEEDED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Sizelimit exceeded."); - } -#ifdef LDAP_ADMINLIMIT_EXCEEDED - else if (errno == LDAP_ADMINLIMIT_EXCEEDED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Adminlimit exceeded."); - } -#endif - - ZEND_REGISTER_RESOURCE(return_value, ldap_res, le_result); - } -} -/* }}} */ - -/* {{{ proto resource ldap_read(resource link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) - Read an entry */ -PHP_FUNCTION(ldap_read) -{ - php_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_BASE); -} -/* }}} */ - -/* {{{ proto resource ldap_list(resource link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) - Single-level search */ -PHP_FUNCTION(ldap_list) -{ - php_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_ONELEVEL); -} -/* }}} */ - -/* {{{ proto resource ldap_search(resource link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) - Search LDAP tree under base_dn */ -PHP_FUNCTION(ldap_search) -{ - php_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_SUBTREE); -} -/* }}} */ - -/* {{{ proto bool ldap_free_result(resource result) - Free result memory */ -PHP_FUNCTION(ldap_free_result) -{ - zval **result; - LDAPMessage *ldap_result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - zend_list_delete(Z_LVAL_PP(result)); /* Delete list entry and call registered destructor function */ - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int ldap_count_entries(resource link, resource result) - Count the number of entries in a search result */ -PHP_FUNCTION(ldap_count_entries) -{ - zval **link, **result; - ldap_linkdata *ld; - LDAPMessage *ldap_result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - RETURN_LONG(ldap_count_entries(ld->link, ldap_result)); -} -/* }}} */ - -/* {{{ proto resource ldap_first_entry(resource link, resource result) - Return first result id */ -PHP_FUNCTION(ldap_first_entry) -{ - zval **link, **result; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - LDAPMessage *ldap_result, *entry; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - if ((entry = ldap_first_entry(ld->link, ldap_result)) == NULL) { - RETVAL_FALSE; - } else { - resultentry = emalloc(sizeof(ldap_resultentry)); - ZEND_REGISTER_RESOURCE(return_value, resultentry, le_result_entry); - resultentry->id = Z_LVAL_PP(result); - zend_list_addref(resultentry->id); - resultentry->data = entry; - } -} -/* }}} */ - -/* {{{ proto resource ldap_next_entry(resource link, resource result_entry) - Get next result entry */ -PHP_FUNCTION(ldap_next_entry) -{ - zval **link, **result_entry; - ldap_linkdata *ld; - ldap_resultentry *resultentry, *resultentry_next; - LDAPMessage *entry_next; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result_entry) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - if ((entry_next = ldap_next_entry(ld->link, resultentry->data)) == NULL) { - RETVAL_FALSE; - } else { - resultentry_next = emalloc(sizeof(ldap_resultentry)); - ZEND_REGISTER_RESOURCE(return_value, resultentry_next, le_result_entry); - resultentry_next->id = resultentry->id; - zend_list_addref(resultentry->id); - resultentry_next->data = entry_next; - } -} -/* }}} */ - -/* {{{ proto array ldap_get_entries(resource link, resource result) - Get all result entries */ -PHP_FUNCTION(ldap_get_entries) -{ - zval **link, **result; - LDAPMessage *ldap_result, *ldap_result_entry; - zval *tmp1, *tmp2; - ldap_linkdata *ld; - LDAP *ldap; - int num_entries, num_attrib, num_values, i; - BerElement *ber; - char *attribute; - size_t attr_len; - char **ldap_value; - char *dn; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - ldap = ld->link; - num_entries = ldap_count_entries(ldap, ldap_result); - - array_init(return_value); - add_assoc_long(return_value, "count", num_entries); - - if (num_entries == 0) return; - num_entries = 0; - - ldap_result_entry = ldap_first_entry(ldap, ldap_result); - if (ldap_result_entry == NULL) RETURN_FALSE; - - while (ldap_result_entry != NULL) { - - MAKE_STD_ZVAL(tmp1); - array_init(tmp1); - - num_attrib = 0; - attribute = ldap_first_attribute(ldap, ldap_result_entry, &ber); - - while (attribute != NULL) { - ldap_value = ldap_get_values(ldap, ldap_result_entry, attribute); - num_values = ldap_count_values(ldap_value); - - MAKE_STD_ZVAL(tmp2); - array_init(tmp2); - add_assoc_long(tmp2, "count", num_values); - for (i = 0; i < num_values; i++) { - add_index_string(tmp2, i, ldap_value[i], 1); - } - ldap_value_free(ldap_value); - - attr_len = strlen(attribute); - zend_hash_update(Z_ARRVAL_P(tmp1), php_strtolower(attribute, attr_len), attr_len+1, (void *) &tmp2, sizeof(zval *), NULL); - add_index_string(tmp1, num_attrib, attribute, 1); - - num_attrib++; -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(attribute); -#endif - attribute = ldap_next_attribute(ldap, ldap_result_entry, ber); - } -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - if (ber != NULL) - ber_free(ber, 0); -#endif - - add_assoc_long(tmp1, "count", num_attrib); - dn = ldap_get_dn(ldap, ldap_result_entry); - add_assoc_string(tmp1, "dn", dn, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(dn); -#else - free(dn); -#endif - - zend_hash_index_update(Z_ARRVAL_P(return_value), num_entries, (void *) &tmp1, sizeof(zval *), NULL); - - num_entries++; - ldap_result_entry = ldap_next_entry(ldap, ldap_result_entry); - } - - add_assoc_long(return_value, "count", num_entries); - -} -/* }}} */ - -/* {{{ proto string ldap_first_attribute(resource link, resource result_entry, int ber) - Return first attribute */ -PHP_FUNCTION(ldap_first_attribute) -{ - zval **link, **result_entry, **berp; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - BerElement *ber; - char *attribute; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &result_entry, &berp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - if ((attribute = ldap_first_attribute(ld->link, resultentry->data, &ber)) == NULL) { - RETURN_FALSE; - } else { - ZEND_REGISTER_RESOURCE(*berp, ber, le_ber_entry); - - RETVAL_STRING(attribute, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(attribute); -#endif - } -} -/* }}} */ - -/* {{{ proto string ldap_next_attribute(resource link, resource result_entry, resource ber) - Get the next attribute in result */ -PHP_FUNCTION(ldap_next_attribute) -{ - zval **link, **result_entry, **berp; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - BerElement *ber; - char *attribute; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &result_entry, &berp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - ZEND_FETCH_RESOURCE(ber, BerElement *, berp, -1, "ldap ber entry", le_ber_entry); - - if ((attribute = ldap_next_attribute(ld->link, resultentry->data, ber)) == NULL) { - RETURN_FALSE; - } else { - ZEND_REGISTER_RESOURCE(*berp, ber, le_ber_entry); - - RETVAL_STRING(attribute, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(attribute); -#endif - } -} -/* }}} */ - -/* {{{ proto array ldap_get_attributes(resource link, resource result_entry) - Get attributes from a search result entry */ -PHP_FUNCTION(ldap_get_attributes) -{ - zval **link, **result_entry; - zval *tmp; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - char *attribute; - char **ldap_value; - int i, num_values, num_attrib; - BerElement *ber; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result_entry) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - array_init(return_value); - num_attrib = 0; - - attribute = ldap_first_attribute(ld->link, resultentry->data, &ber); - while (attribute != NULL) { - ldap_value = ldap_get_values(ld->link, resultentry->data, attribute); - num_values = ldap_count_values(ldap_value); - - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_long(tmp, "count", num_values); - for (i = 0; i < num_values; i++) { - add_index_string(tmp, i, ldap_value[i], 1); - } - ldap_value_free(ldap_value); - - zend_hash_update(Z_ARRVAL_P(return_value), attribute, strlen(attribute)+1, (void *) &tmp, sizeof(zval *), NULL); - add_index_string(return_value, num_attrib, attribute, 1); - - num_attrib++; -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(attribute); -#endif - attribute = ldap_next_attribute(ld->link, resultentry->data, ber); - } -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - if (ber != NULL) { - ber_free(ber, 0); - } -#endif - - add_assoc_long(return_value, "count", num_attrib); -} -/* }}} */ - -/* {{{ proto array ldap_get_values(resource link, resource result_entry, string attribute) - Get all values from a result entry */ -PHP_FUNCTION(ldap_get_values) -{ - zval **link, **result_entry, **attr; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - char *attribute; - char **ldap_value; - int i, num_values; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &result_entry, &attr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - convert_to_string_ex(attr); - attribute = Z_STRVAL_PP(attr); - - if ((ldap_value = ldap_get_values(ld->link, resultentry->data, attribute)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link))); - RETURN_FALSE; - } - - num_values = ldap_count_values(ldap_value); - - array_init(return_value); - - for (i = 0; ilink, resultentry->data, attribute)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link))); - RETURN_FALSE; - } - - num_values = ldap_count_values_len(ldap_value_len); - array_init(return_value); - - for (i=0; ibv_val, ldap_value_len[i]->bv_len, 1); - } - - add_assoc_long(return_value, "count", num_values); - ldap_value_free_len(ldap_value_len); - -} -/* }}} */ - -/* {{{ proto string ldap_get_dn(resource link, resource result_entry) - Get the DN of a result entry */ -PHP_FUNCTION(ldap_get_dn) -{ - zval **link, **result_entry; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - char *text; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result_entry) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - text = ldap_get_dn(ld->link, resultentry->data); - if (text != NULL) { - RETVAL_STRING(text, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(text); -#else - free(text); -#endif - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array ldap_explode_dn(string dn, int with_attrib) - Splits DN into its component parts */ -PHP_FUNCTION(ldap_explode_dn) -{ - zval **dn, **with_attrib; - char **ldap_value; - int i, count; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dn, &with_attrib) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(dn); - convert_to_long_ex(with_attrib); - - if (!(ldap_value = ldap_explode_dn(Z_STRVAL_PP(dn), Z_LVAL_PP(with_attrib)))) { - /* Invalid parameters were passed to ldap_explode_dn */ - RETURN_FALSE; - } - - i=0; - while (ldap_value[i] != NULL) i++; - count = i; - - array_init(return_value); - - add_assoc_long(return_value, "count", count); - for (i = 0; i 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS - ldap_memfree(ufn); -#endif - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* added to fix use of ldap_modify_add for doing an ldap_add, gerrit thomson. */ -#define PHP_LD_FULL_ADD 0xff -/* {{{ php_ldap_do_modify - */ -static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper) -{ - zval **link, **dn, **entry, **value, **ivalue; - ldap_linkdata *ld; - char *ldap_dn; - LDAPMod **ldap_mods; - int i, j, num_attribs, num_values; - int *num_berval; - char *attribute; - ulong index; - int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */ - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &dn, &entry) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(entry) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected Array as the last element"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - convert_to_string_ex(dn); - ldap_dn = Z_STRVAL_PP(dn); - - num_attribs = zend_hash_num_elements(Z_ARRVAL_PP(entry)); - ldap_mods = safe_emalloc((num_attribs+1), sizeof(LDAPMod *), 0); - num_berval = safe_emalloc(num_attribs, sizeof(int), 0); - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(entry)); - - /* added by gerrit thomson to fix ldap_add using ldap_mod_add */ - if (oper == PHP_LD_FULL_ADD) { - oper = LDAP_MOD_ADD; - is_full_add = 1; - } - /* end additional , gerrit thomson */ - - for (i = 0; i < num_attribs; i++) { - ldap_mods[i] = emalloc(sizeof(LDAPMod)); - ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES; - - if (zend_hash_get_current_key(Z_ARRVAL_PP(entry), &attribute, &index, 0) == HASH_KEY_IS_STRING) { - ldap_mods[i]->mod_type = estrdup(attribute); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown attribute in the data"); - /* Free allocated memory */ - while (i >= 0) { - efree(ldap_mods[i--]); - } - efree(num_berval); - efree(ldap_mods); - RETURN_FALSE; - } - - zend_hash_get_current_data(Z_ARRVAL_PP(entry), (void **)&value); - - if (Z_TYPE_PP(value) != IS_ARRAY) { - num_values = 1; - } else { - num_values = zend_hash_num_elements(Z_ARRVAL_PP(value)); - } - - num_berval[i] = num_values; - ldap_mods[i]->mod_bvalues = safe_emalloc((num_values + 1), sizeof(struct berval *), 0); - -/* allow for arrays with one element, no allowance for arrays with none but probably not required, gerrit thomson. */ - if ((num_values == 1) && (Z_TYPE_PP(value) != IS_ARRAY)) { - convert_to_string_ex(value); - ldap_mods[i]->mod_bvalues[0] = (struct berval *) emalloc (sizeof(struct berval)); - ldap_mods[i]->mod_bvalues[0]->bv_len = Z_STRLEN_PP(value); - ldap_mods[i]->mod_bvalues[0]->bv_val = Z_STRVAL_PP(value); - } else { - for (j = 0; j < num_values; j++) { - if (zend_hash_index_find(Z_ARRVAL_PP(value), j, (void **) &ivalue) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Value array must have consecutive indices 0, 1, ..."); - num_berval[i] = j; - num_attribs = i + 1; - RETVAL_FALSE; - goto errexit; - } - convert_to_string_ex(ivalue); - ldap_mods[i]->mod_bvalues[j] = (struct berval *) emalloc (sizeof(struct berval)); - ldap_mods[i]->mod_bvalues[j]->bv_len = Z_STRLEN_PP(ivalue); - ldap_mods[i]->mod_bvalues[j]->bv_val = Z_STRVAL_PP(ivalue); - } - } - ldap_mods[i]->mod_bvalues[num_values] = NULL; - zend_hash_move_forward(Z_ARRVAL_PP(entry)); - } - ldap_mods[num_attribs] = NULL; - -/* check flag to see if do_mod was called to perform full add , gerrit thomson */ - if (is_full_add == 1) { - if ((i = ldap_add_s(ld->link, ldap_dn, ldap_mods)) != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Add: %s", ldap_err2string(i)); - RETVAL_FALSE; - } else RETVAL_TRUE; - } else { - if ((i = ldap_modify_s(ld->link, ldap_dn, ldap_mods)) != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modify: %s", ldap_err2string(i)); - RETVAL_FALSE; - } else RETVAL_TRUE; - } - -errexit: - for (i = 0; i < num_attribs; i++) { - efree(ldap_mods[i]->mod_type); - for (j = 0; j < num_berval[i]; j++) { - efree(ldap_mods[i]->mod_bvalues[j]); - } - efree(ldap_mods[i]->mod_bvalues); - efree(ldap_mods[i]); - } - efree(num_berval); - efree(ldap_mods); - - return; -} -/* }}} */ - -/* {{{ proto bool ldap_add(resource link, string dn, array entry) - Add entries to LDAP directory */ -PHP_FUNCTION(ldap_add) -{ - /* use a newly define parameter into the do_modify so ldap_mod_add can be used the way it is supposed to be used , Gerrit THomson */ - php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD); -} -/* }}} */ - -/* three functions for attribute base modifications, gerrit Thomson */ - -/* {{{ proto bool ldap_mod_replace(resource link, string dn, array entry) - Replace attribute values with new ones */ -PHP_FUNCTION(ldap_mod_replace) -{ - php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE); -} -/* }}} */ - -/* {{{ proto bool ldap_mod_add(resource link, string dn, array entry) - Add attribute values to current */ -PHP_FUNCTION(ldap_mod_add) -{ - php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD); -} -/* }}} */ - -/* {{{ proto bool ldap_mod_del(resource link, string dn, array entry) - Delete attribute values */ -PHP_FUNCTION(ldap_mod_del) -{ - php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE); -} -/* }}} */ - -/* {{{ proto bool ldap_delete(resource link, string dn) - Delete an entry from a directory */ -PHP_FUNCTION(ldap_delete) -{ - zval **link, **dn; - ldap_linkdata *ld; - char *ldap_dn; - int rc; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &dn) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - convert_to_string_ex(dn); - ldap_dn = Z_STRVAL_PP(dn); - - if ((rc = ldap_delete_s(ld->link, ldap_dn)) != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delete: %s", ldap_err2string(rc)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ldap_errno(resource link) - Get the current ldap error number */ -PHP_FUNCTION(ldap_errno) -{ - zval **link; - ldap_linkdata *ld; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ht, &link) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - RETURN_LONG(_get_lderrno(ld->link)); -} -/* }}} */ - -/* {{{ proto string ldap_err2str(int errno) - Convert error number to error string */ -PHP_FUNCTION(ldap_err2str) -{ - zval **perrno; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ht, &perrno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(perrno); - RETURN_STRING(ldap_err2string(Z_LVAL_PP(perrno)), 1); -} -/* }}} */ - -/* {{{ proto string ldap_error(resource link) - Get the current ldap error string */ -PHP_FUNCTION(ldap_error) -{ - zval **link; - ldap_linkdata *ld; - int ld_errno; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ht, &link) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - ld_errno = _get_lderrno(ld->link); - - RETURN_STRING(ldap_err2string(ld_errno), 1); -} -/* }}} */ - -/* {{{ proto bool ldap_compare(resource link, string dn, string attr, string value) - Determine if an entry has a specific value for one of its attributes */ -PHP_FUNCTION(ldap_compare) -{ - zval **link, **dn, **attr, **value; - char *ldap_dn, *ldap_attr, *ldap_value; - ldap_linkdata *ld; - int errno; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &link, &dn, &attr, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - convert_to_string_ex(dn); - convert_to_string_ex(attr); - convert_to_string_ex(value); - - ldap_dn = Z_STRVAL_PP(dn); - ldap_attr = Z_STRVAL_PP(attr); - ldap_value = Z_STRVAL_PP(value); - - errno = ldap_compare_s(ld->link, ldap_dn, ldap_attr, ldap_value); - - switch (errno) { - case LDAP_COMPARE_TRUE: - RETURN_TRUE; - break; - - case LDAP_COMPARE_FALSE: - RETURN_FALSE; - break; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Compare: %s", ldap_err2string(errno)); - RETURN_LONG(-1); - -} -/* }}} */ - -/* {{{ proto bool ldap_sort(resource link, resource result, string sortfilter) - Sort LDAP result entries */ -PHP_FUNCTION(ldap_sort) -{ - zval *link, *result; - ldap_linkdata *ld; - char *sortfilter; - int sflen; - zend_rsrc_list_entry *le; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result, &sortfilter, &sflen) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - - if (zend_hash_index_find(&EG(regular_list), Z_LVAL_P(result), (void **) &le) == FAILURE || le->type != le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied resource is not a valid ldap result resource"); - RETURN_FALSE; - } - - if (ldap_sort_entries(ld->link, (LDAPMessage **) &le->ptr, sflen ? sortfilter : NULL, strcmp) != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ldap_err2string(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 -/* {{{ proto bool ldap_get_option(resource link, int option, mixed retval) - Get the current value of various session-wide parameters */ -PHP_FUNCTION(ldap_get_option) -{ - zval **link, **option, **retval; - ldap_linkdata *ld; - int opt; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &option, &retval) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - convert_to_long_ex(option); - opt = Z_LVAL_PP(option); - - switch (opt) { - /* options with int value */ - case LDAP_OPT_DEREF: - case LDAP_OPT_SIZELIMIT: - case LDAP_OPT_TIMELIMIT: - case LDAP_OPT_PROTOCOL_VERSION: - case LDAP_OPT_ERROR_NUMBER: - case LDAP_OPT_REFERRALS: -#ifdef LDAP_OPT_RESTART - case LDAP_OPT_RESTART: -#endif - { - int val; - if (ldap_get_option(ld->link, opt, &val)) { - RETURN_FALSE; - } - zval_dtor(*retval); - ZVAL_LONG(*retval, val); - } break; - /* options with string value */ - case LDAP_OPT_ERROR_STRING: -#ifdef LDAP_OPT_HOST_NAME - case LDAP_OPT_HOST_NAME: -#endif -#ifdef HAVE_LDAP_SASL - case LDAP_OPT_X_SASL_MECH: - case LDAP_OPT_X_SASL_REALM: - case LDAP_OPT_X_SASL_AUTHCID: - case LDAP_OPT_X_SASL_AUTHZID: -#endif -#ifdef LDAP_OPT_MATCHED_DN - case LDAP_OPT_MATCHED_DN: -#endif - { - char *val = NULL; - - if (ldap_get_option(ld->link, opt, &val) || val == NULL || *val == '\0') { - if (val) { - ldap_memfree(val); - } - RETURN_FALSE; - } - zval_dtor(*retval); - ZVAL_STRING(*retval, val, 1); - ldap_memfree(val); - } break; -/* options not implemented - case LDAP_OPT_SERVER_CONTROLS: - case LDAP_OPT_CLIENT_CONTROLS: - case LDAP_OPT_API_INFO: - case LDAP_OPT_API_FEATURE_INFO: -*/ - default: - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ldap_set_option(resource link, int option, mixed newval) - Set the value of various session-wide parameters */ -PHP_FUNCTION(ldap_set_option) -{ - zval **link, **option, **newval; - ldap_linkdata *ld; - LDAP *ldap; - int opt; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &option, &newval) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(link) == IS_NULL) { - ldap = NULL; - } else { - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ldap = ld->link; - } - - convert_to_long_ex(option); - opt = Z_LVAL_PP(option); - - switch (opt) { - /* options with int value */ - case LDAP_OPT_DEREF: - case LDAP_OPT_SIZELIMIT: - case LDAP_OPT_TIMELIMIT: - case LDAP_OPT_PROTOCOL_VERSION: - case LDAP_OPT_ERROR_NUMBER: -#ifdef LDAP_OPT_DEBUG_LEVEL - case LDAP_OPT_DEBUG_LEVEL: -#endif - { - int val; - convert_to_long_ex(newval); - val = Z_LVAL_PP(newval); - if (ldap_set_option(ldap, opt, &val)) { - RETURN_FALSE; - } - } break; - /* options with string value */ - case LDAP_OPT_ERROR_STRING: -#ifdef LDAP_OPT_HOST_NAME - case LDAP_OPT_HOST_NAME: -#endif -#ifdef HAVE_LDAP_SASL - case LDAP_OPT_X_SASL_MECH: - case LDAP_OPT_X_SASL_REALM: - case LDAP_OPT_X_SASL_AUTHCID: - case LDAP_OPT_X_SASL_AUTHZID: -#endif -#ifdef LDAP_OPT_MATCHED_DN - case LDAP_OPT_MATCHED_DN: -#endif - { - char *val; - convert_to_string_ex(newval); - val = Z_STRVAL_PP(newval); - if (ldap_set_option(ldap, opt, val)) { - RETURN_FALSE; - } - } break; - /* options with boolean value */ - case LDAP_OPT_REFERRALS: -#ifdef LDAP_OPT_RESTART - case LDAP_OPT_RESTART: -#endif - { - void *val; - convert_to_boolean_ex(newval); - val = Z_LVAL_PP(newval) - ? LDAP_OPT_ON : LDAP_OPT_OFF; - if (ldap_set_option(ldap, opt, val)) { - RETURN_FALSE; - } - } break; - /* options with control list value */ - case LDAP_OPT_SERVER_CONTROLS: - case LDAP_OPT_CLIENT_CONTROLS: - { - LDAPControl *ctrl, **ctrls, **ctrlp; - zval **ctrlval, **val; - int ncontrols; - char error=0; - - if ((Z_TYPE_PP(newval) != IS_ARRAY) || !(ncontrols = zend_hash_num_elements(Z_ARRVAL_PP(newval)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected non-empty array value for this option"); - RETURN_FALSE; - } - ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0); - *ctrls = NULL; - ctrlp = ctrls; - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(newval)); - while (zend_hash_get_current_data(Z_ARRVAL_PP(newval), (void**)&ctrlval) == SUCCESS) { - if (Z_TYPE_PP(ctrlval) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array value must contain only arrays, where each array is a control"); - error = 1; - break; - } - if (zend_hash_find(Z_ARRVAL_PP(ctrlval), "oid", sizeof("oid"), (void **) &val) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Control must have an oid key"); - error = 1; - break; - } - ctrl = *ctrlp = emalloc(sizeof(**ctrlp)); - convert_to_string_ex(val); - ctrl->ldctl_oid = Z_STRVAL_PP(val); - if (zend_hash_find(Z_ARRVAL_PP(ctrlval), "value", sizeof("value"), (void **) &val) == SUCCESS) { - convert_to_string_ex(val); - ctrl->ldctl_value.bv_val = Z_STRVAL_PP(val); - ctrl->ldctl_value.bv_len = Z_STRLEN_PP(val); - } else { - ctrl->ldctl_value.bv_val = NULL; - ctrl->ldctl_value.bv_len = 0; - } - if (zend_hash_find(Z_ARRVAL_PP(ctrlval), "iscritical", sizeof("iscritical"), (void **) &val) == SUCCESS) { - convert_to_boolean_ex(val); - ctrl->ldctl_iscritical = Z_BVAL_PP(val); - } else { - ctrl->ldctl_iscritical = 0; - } - - ++ctrlp; - *ctrlp = NULL; - zend_hash_move_forward(Z_ARRVAL_PP(newval)); - } - if (!error) { - error = ldap_set_option(ldap, opt, ctrls); - } - ctrlp = ctrls; - while (*ctrlp) { - efree(*ctrlp); - ctrlp++; - } - efree(ctrls); - if (error) { - RETURN_FALSE; - } - } break; - default: - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -#ifdef HAVE_LDAP_PARSE_RESULT -/* {{{ proto bool ldap_parse_result(resource link, resource result, int errcode, string matcheddn, string errmsg, array referrals) - Extract information from result */ -PHP_FUNCTION(ldap_parse_result) -{ - zval **link, **result, **errcode, **matcheddn, **errmsg, **referrals; - ldap_linkdata *ld; - LDAPMessage *ldap_result; - char **lreferrals, **refp; - char *lmatcheddn, *lerrmsg; - int rc, lerrcode, myargcount = ZEND_NUM_ARGS(); - - if (myargcount < 3 || myargcount > 6 || zend_get_parameters_ex(myargcount, &link, &result, &errcode, &matcheddn, &errmsg, &referrals) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - rc = ldap_parse_result(ld->link, ldap_result, &lerrcode, - myargcount > 3 ? &lmatcheddn : NULL, - myargcount > 4 ? &lerrmsg : NULL, - myargcount > 5 ? &lreferrals : NULL, - NULL /* &serverctrls */, - 0); - if (rc != LDAP_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc)); - RETURN_FALSE; - } - - zval_dtor(*errcode); - ZVAL_LONG(*errcode, lerrcode); - - /* Reverse -> fall through */ - switch (myargcount) { - case 6: - zval_dtor(*referrals); - array_init(*referrals); - if (lreferrals != NULL) { - refp = lreferrals; - while (*refp) { - add_next_index_string(*referrals, *refp, 1); - refp++; - } - ldap_value_free(lreferrals); - } - case 5: - zval_dtor(*errmsg); - if (lerrmsg == NULL) { - ZVAL_EMPTY_STRING(*errmsg); - } else { - ZVAL_STRING(*errmsg, lerrmsg, 1); - ldap_memfree(lerrmsg); - } - case 4: - zval_dtor(*matcheddn); - if (lmatcheddn == NULL) { - ZVAL_EMPTY_STRING(*matcheddn); - } else { - ZVAL_STRING(*matcheddn, lmatcheddn, 1); - ldap_memfree(lmatcheddn); - } - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto resource ldap_first_reference(resource link, resource result) - Return first reference */ -PHP_FUNCTION(ldap_first_reference) -{ - zval **link, **result; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - LDAPMessage *ldap_result, *entry; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, result, -1, "ldap result", le_result); - - if ((entry = ldap_first_reference(ld->link, ldap_result)) == NULL) { - RETVAL_FALSE; - } else { - resultentry = emalloc(sizeof(ldap_resultentry)); - ZEND_REGISTER_RESOURCE(return_value, resultentry, le_result_entry); - resultentry->id = Z_LVAL_PP(result); - zend_list_addref(resultentry->id); - resultentry->data = entry; - } -} -/* }}} */ - -/* {{{ proto resource ldap_next_reference(resource link, resource reference_entry) - Get next reference */ -PHP_FUNCTION(ldap_next_reference) -{ - zval **link, **result_entry; - ldap_linkdata *ld; - ldap_resultentry *resultentry, *resultentry_next; - LDAPMessage *entry_next; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, &result_entry) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - if ((entry_next = ldap_next_reference(ld->link, resultentry->data)) == NULL) { - RETVAL_FALSE; - } else { - resultentry_next = emalloc(sizeof(ldap_resultentry)); - ZEND_REGISTER_RESOURCE(return_value, resultentry_next, le_result_entry); - resultentry_next->id = resultentry->id; - zend_list_addref(resultentry->id); - resultentry_next->data = entry_next; - } -} -/* }}} */ - -#ifdef HAVE_LDAP_PARSE_REFERENCE -/* {{{ proto bool ldap_parse_reference(resource link, resource reference_entry, array referrals) - Extract information from reference entry */ -PHP_FUNCTION(ldap_parse_reference) -{ - zval **link, **result_entry, **referrals; - ldap_linkdata *ld; - ldap_resultentry *resultentry; - char **lreferrals, **refp; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &result_entry, &referrals) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry); - - if (ldap_parse_reference(ld->link, resultentry->data, &lreferrals, NULL /* &serverctrls */, 0) != LDAP_SUCCESS) { - RETURN_FALSE; - } - - zval_dtor(*referrals); - array_init(*referrals); - if (lreferrals != NULL) { - refp = lreferrals; - while (*refp) { - add_next_index_string(*referrals, *refp, 1); - refp++; - } - ldap_value_free(lreferrals); - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool ldap_rename(resource link, string dn, string newrdn, string newparent, bool deleteoldrdn); - Modify the name of an entry */ -PHP_FUNCTION(ldap_rename) -{ - zval **link, **dn, **newrdn, **newparent, **deleteoldrdn; - ldap_linkdata *ld; - int rc; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &link, &dn, &newrdn, &newparent, &deleteoldrdn) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - convert_to_string_ex(dn); - convert_to_string_ex(newrdn); - convert_to_string_ex(newparent); - convert_to_boolean_ex(deleteoldrdn); - -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 - rc = ldap_rename_s(ld->link, Z_STRVAL_PP(dn), Z_STRVAL_PP(newrdn), Z_STRVAL_PP(newparent), Z_BVAL_PP(deleteoldrdn), NULL, NULL); -#else - if (Z_STRLEN_PP(newparent) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN"); - RETURN_FALSE; - } -/* could support old APIs but need check for ldap_modrdn2()/ldap_modrdn() */ - rc = ldap_modrdn2_s(ld->link, Z_STRVAL_PP(dn), Z_STRVAL_PP(newrdn), Z_BVAL_PP(deleteoldrdn)); -#endif - - if (rc == LDAP_SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -#ifdef HAVE_LDAP_START_TLS_S -/* {{{ proto bool ldap_start_tls(resource link) - Start TLS */ -PHP_FUNCTION(ldap_start_tls) -{ - zval **link; - ldap_linkdata *ld; - int rc, protocol = LDAP_VERSION3; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &link) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - - if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) != LDAP_SUCCESS) || - ((rc = ldap_start_tls_s(ld->link, NULL, NULL)) != LDAP_SUCCESS) - ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to start TLS: %s", ldap_err2string(rc)); - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ -#endif -#endif /* (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 */ - -#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) -/* {{{ _ldap_rebind_proc() -*/ -int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgid, void *params) -{ - ldap_linkdata *ld; - int retval; - zval *cb_url; - zval **cb_args[2]; - zval *cb_retval; - zval *cb_link = (zval *) params; - TSRMLS_FETCH(); - - ld = (ldap_linkdata *) zend_fetch_resource(&cb_link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link); - - /* link exists and callback set? */ - if (ld == NULL || ld->rebindproc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link not found or no callback set"); - return LDAP_OTHER; - } - - /* callback */ - MAKE_STD_ZVAL(cb_url); - ZVAL_STRING(cb_url, estrdup(url), 0); - cb_args[0] = &cb_link; - cb_args[1] = &cb_url; - if (call_user_function_ex(EG(function_table), NULL, ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL TSRMLS_CC) == SUCCESS && cb_retval) { - convert_to_long_ex(&cb_retval); - retval = Z_LVAL_P(cb_retval); - zval_ptr_dtor(&cb_retval); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "rebind_proc PHP callback failed"); - retval = LDAP_OTHER; - } - zval_dtor(cb_url); - FREE_ZVAL(cb_url); - return retval; -} -/* }}} */ - -/* {{{ proto bool ldap_set_rebind_proc(resource link, string callback) - Set a callback function to do re-binds on referral chasing. */ -PHP_FUNCTION(ldap_set_rebind_proc) -{ - zval *link, *callback; - ldap_linkdata *ld; - zval callback_name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &link, &callback) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); - - if (Z_TYPE_P(callback) == IS_STRING && Z_STRLEN_P(callback) == 0) { - /* unregister rebind procedure */ - if (ld->rebindproc != NULL) { - zval_dtor(ld->rebindproc); - ld->rebindproc = NULL; - ldap_set_rebind_proc(ld->link, NULL, NULL); - } - RETURN_TRUE; - } - - /* callable? */ - if (!zend_is_callable(callback, 0, &callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Two arguments expected for '%R' to be a valid callback", Z_TYPE(callback_name), Z_UNIVAL(callback_name)); - zval_dtor(&callback_name); - RETURN_FALSE; - } - zval_dtor(&callback_name); - - /* register rebind procedure */ - if (ld->rebindproc == NULL) { - ldap_set_rebind_proc(ld->link, _ldap_rebind_proc, (void *) link); - } else { - zval_dtor(ld->rebindproc); - } - - ALLOC_ZVAL(ld->rebindproc); - *ld->rebindproc = *callback; - zval_copy_ctor(ld->rebindproc); - RETURN_TRUE; -} -/* }}} */ -#endif - -#ifdef STR_TRANSLATION -/* {{{ php_ldap_do_translate - */ -static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way) -{ - zval **value; - char *ldap_buf; - unsigned long ldap_len; - int result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(value); - ldap_buf = Z_STRVAL_PP(value); - ldap_len = Z_STRLEN_PP(value); - - if (ldap_len == 0) { - RETURN_FALSE; - } - - if (way == 1) { - result = ldap_8859_to_t61(&ldap_buf, &ldap_len, 0); - } else { - result = ldap_t61_to_8859(&ldap_buf, &ldap_len, 0); - } - - if (result == LDAP_SUCCESS) { - RETVAL_STRINGL(ldap_buf, ldap_len, 1); - free(ldap_buf); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Conversion from iso-8859-1 to t61 failed: %s", ldap_err2string(result)); - RETVAL_FALSE; - } - - return; -} -/* }}} */ - -/* {{{ proto string ldap_t61_to_8859(string value) - Translate t61 characters to 8859 characters */ -PHP_FUNCTION(ldap_t61_to_8859) -{ - php_ldap_do_translate(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string ldap_8859_to_t61(string value) - Translate 8859 characters to t61 characters */ -PHP_FUNCTION(ldap_8859_to_t61) -{ - php_ldap_do_translate(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ldap/ldap.dsp b/ext/ldap/ldap.dsp deleted file mode 100644 index a97ebe41054b6..0000000000000 --- a/ext/ldap/ldap.dsp +++ /dev/null @@ -1,288 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ldap" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ldap - Win32 Debug_TS_SSL -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ldap.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ldap.mak" CFG="ldap - Win32 Debug_TS_SSL" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Release_TS SASL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Debug_TS SASL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ldap - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ldap - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_ldap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\openldap\libraries\Release" - -!ELSEIF "$(CFG)" == "ldap - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 oldap32.lib olber32.lib php5nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\openldap\libraries\Debug" - -!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=1 /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib php5nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\openldap\libraries\Debug" /libpath:"..\..\Debug" -# ADD LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug" - -!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS SASL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ldap___Win32_Release_TS_SASL" -# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SASL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_SASL" -# PROP Intermediate_Dir "Release_TS_SASL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 oldap32.lib olber32.lib libsasl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS SASL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SASL" -# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SASL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS_SASL" -# PROP Intermediate_Dir "Debug_TS_SASL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug" -# ADD LINK32 oldap32.lib olber32.lib libsasl.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug" - -!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ldap___Win32_Release_TS_SSL" -# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_SSL" -# PROP Intermediate_Dir "Release_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php5ts.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SSL" -# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS_SSL" -# PROP Intermediate_Dir "Debug_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug" -# ADD LINK32 php5ts_debug.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug" - -!ENDIF - -# Begin Target - -# Name "ldap - Win32 Release" -# Name "ldap - Win32 Debug" -# Name "ldap - Win32 Debug_TS" -# Name "ldap - Win32 Release_TS" -# Name "ldap - Win32 Release_TS SASL" -# Name "ldap - Win32 Debug_TS SASL" -# Name "ldap - Win32 Release_TS_SSL" -# Name "ldap - Win32 Debug_TS_SSL" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ldap.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_ldap.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\LDAP_Win32_HOWTO.txt -# End Source File -# End Target -# End Project diff --git a/ext/ldap/ldap.mak b/ext/ldap/ldap.mak deleted file mode 100644 index 959fe16cf118c..0000000000000 --- a/ext/ldap/ldap.mak +++ /dev/null @@ -1,173 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = php_ldap -MODULE_DESC = "PHP 5 - LDAP Extension" -VMAJ = 3 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = ldap.c \ - start.c - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS += -c -maxerrors 25 -msgstyle gcc -C_FLAGS += -wchar_t on -bool on -C_FLAGS += -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DNEW_LIBC -C_FLAGS += -DCOMPILE_DL_LDAP -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(LDAP_DIR)/inc -C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include - -ifndef STACK_SIZE -STACK_SIZE=8192 -endif - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off - C_FLAGS += -opt intrinsics - C_FLAGS += -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - -# Dependencies -MODULE = LibC \ - ldapsdk \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(LDAP_DIR)/lib/nlm/Ldapsdk.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $( $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h deleted file mode 100644 index bf669cddb05f1..0000000000000 --- a/ext/ldap/php_ldap.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Amitay Isaacs | - | Eric Warnke | - | Jani Taskinen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_LDAP_H -#define PHP_LDAP_H - -#ifndef HAVE_ORALDAP -#include -#endif -#include - -extern zend_module_entry ldap_module_entry; -#define ldap_module_ptr &ldap_module_entry - -/* LDAP functions */ -PHP_MINIT_FUNCTION(ldap); -PHP_MSHUTDOWN_FUNCTION(ldap); -PHP_MINFO_FUNCTION(ldap); - -PHP_FUNCTION(ldap_connect); -PHP_FUNCTION(ldap_bind); -#ifdef HAVE_LDAP_SASL -PHP_FUNCTION(ldap_sasl_bind); -#endif -PHP_FUNCTION(ldap_unbind); -PHP_FUNCTION(ldap_read); -PHP_FUNCTION(ldap_list); -PHP_FUNCTION(ldap_search); -PHP_FUNCTION(ldap_free_result); -PHP_FUNCTION(ldap_count_entries); -PHP_FUNCTION(ldap_first_entry); -PHP_FUNCTION(ldap_next_entry); -PHP_FUNCTION(ldap_get_entries); -PHP_FUNCTION(ldap_first_attribute); -PHP_FUNCTION(ldap_next_attribute); -PHP_FUNCTION(ldap_get_attributes); -PHP_FUNCTION(ldap_get_values); -PHP_FUNCTION(ldap_get_values_len); -PHP_FUNCTION(ber_free); -PHP_FUNCTION(ldap_get_dn); -PHP_FUNCTION(ldap_explode_dn); -PHP_FUNCTION(ldap_dn2ufn); -PHP_FUNCTION(ldap_add); -PHP_FUNCTION(ldap_delete); -PHP_FUNCTION(ldap_mod_add); -PHP_FUNCTION(ldap_mod_replace); -PHP_FUNCTION(ldap_mod_del); -PHP_FUNCTION(ldap_errno); -PHP_FUNCTION(ldap_err2str); -PHP_FUNCTION(ldap_error); -PHP_FUNCTION(ldap_compare); -PHP_FUNCTION(ldap_sort); - -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 -PHP_FUNCTION(ldap_get_option); -PHP_FUNCTION(ldap_set_option); -PHP_FUNCTION(ldap_first_reference); -PHP_FUNCTION(ldap_next_reference); -PHP_FUNCTION(ldap_rename); -#ifdef HAVE_LDAP_PARSE_RESULT -PHP_FUNCTION(ldap_parse_result); -#endif -#ifdef HAVE_LDAP_PARSE_REFERENCE -PHP_FUNCTION(ldap_parse_reference); -#endif -#endif - -#if LDAP_API_VERSION > 2000 -PHP_FUNCTION(ldap_start_tls); -#endif - -#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) -PHP_FUNCTION(ldap_set_rebind_proc); -#endif - -#ifdef STR_TRANSLATION -PHP_FUNCTION(ldap_t61_to_8859); -PHP_FUNCTION(ldap_8859_to_t61); -#endif - -ZEND_BEGIN_MODULE_GLOBALS(ldap) - long num_links; - long max_links; -ZEND_END_MODULE_GLOBALS(ldap) - -#ifdef ZTS -# define LDAPG(v) TSRMG(ldap_globals_id, zend_ldap_globals *, v) -#else -# define LDAPG(v) (ldap_globals.v) -#endif - - -#define phpext_ldap_ptr ldap_module_ptr - -#endif /* PHP_LDAP_H */ diff --git a/ext/libxml/CREDITS b/ext/libxml/CREDITS deleted file mode 100644 index 9b744ae5fbbd0..0000000000000 --- a/ext/libxml/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -LIBXML -Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo diff --git a/ext/libxml/config.w32 b/ext/libxml/config.w32 deleted file mode 100644 index 22fae9fb6c7c2..0000000000000 --- a/ext/libxml/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("libxml", "LibXML support", "yes"); - -if (PHP_LIBXML == "yes") { - if (CHECK_LIB("libxml2_a.lib;libxml2.lib", "libxml") && - CHECK_LIB("iconv_a.lib;iconv.lib", "libxml") && - CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS")) { - - EXTENSION("libxml", "libxml.c", false /* never shared */); - AC_DEFINE("HAVE_LIBXML", 1, "LibXML support"); - ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC "); - if (!PHP_LIBXML_SHARED) { - ADD_DEF_FILE("ext\\libxml\\php_libxml2.def"); - } - ADD_EXTENSION_DEP('libxml', 'iconv'); - } -} - - diff --git a/ext/libxml/config0.m4 b/ext/libxml/config0.m4 deleted file mode 100644 index b6ff14edef23a..0000000000000 --- a/ext/libxml/config0.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(libxml, whether to enable LIBXML support, -[ --disable-libxml Disable new LIBXML support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir[=DIR] libxml2 install prefix], no, no) -fi - -if test "$PHP_LIBXML" != "no"; then - - dnl This extension can not be build as shared - ext_shared=no - - PHP_SETUP_LIBXML(LIBXML_SHARED_LIBADD, [ - AC_DEFINE(HAVE_LIBXML,1,[ ]) - PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared) - PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h]) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c deleted file mode 100644 index 4de655f6974ea..0000000000000 --- a/ext/libxml/libxml.c +++ /dev/null @@ -1,1032 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#define PHP_XML_INTERNAL -#include "zend_variables.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" - -#if HAVE_LIBXML - -#include -#include -#include -#include -#include -#include -#ifdef LIBXML_SCHEMAS_ENABLED -#include -#endif - -#include "php_libxml.h" - -#define PHP_LIBXML_ERROR 0 -#define PHP_LIBXML_CTX_ERROR 1 -#define PHP_LIBXML_CTX_WARNING 2 - -/* a true global for initialization */ -int _php_libxml_initialized = 0; - -typedef struct _php_libxml_func_handler { - php_libxml_export_node export_func; -} php_libxml_func_handler; - -static HashTable php_libxml_exports; - -#ifdef ZTS -int libxml_globals_id; -#else -PHP_LIBXML_API php_libxml_globals libxml_globals; -#endif - -zend_class_entry *libxmlerror_class_entry; - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_LIBXML -ZEND_GET_MODULE(libxml) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif /* COMPILE_DL_LIBXML */ -/* }}} */ - -/* {{{ function prototypes */ -PHP_MINIT_FUNCTION(libxml); -PHP_RINIT_FUNCTION(libxml); -PHP_MSHUTDOWN_FUNCTION(libxml); -PHP_RSHUTDOWN_FUNCTION(libxml); -PHP_MINFO_FUNCTION(libxml); - -/* }}} */ - -/* {{{ extension definition structures */ -function_entry libxml_functions[] = { - PHP_FE(libxml_set_streams_context, NULL) - PHP_FE(libxml_use_internal_errors, NULL) - PHP_FE(libxml_get_last_error, NULL) - PHP_FE(libxml_clear_errors, NULL) - PHP_FE(libxml_get_errors, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry libxml_module_entry = { - STANDARD_MODULE_HEADER, - "libxml", /* extension name */ - libxml_functions, /* extension function list */ - PHP_MINIT(libxml), /* extension-wide startup function */ - PHP_MSHUTDOWN(libxml), /* extension-wide shutdown function */ - PHP_RINIT(libxml), /* per-request startup function */ - PHP_RSHUTDOWN(libxml), /* per-request shutdown function */ - PHP_MINFO(libxml), /* information function */ - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* }}} */ - -/* {{{ internal functions for interoperability */ -static int php_libxml_dec_node(php_libxml_node_ptr *nodeptr) -{ - int ret_refcount; - - ret_refcount = --nodeptr->refcount; - if (ret_refcount == 0) { - if (nodeptr->node != NULL && nodeptr->node->type != XML_DOCUMENT_NODE) { - nodeptr->node->_private = NULL; - } - /* node is destroyed by another object. reset ret_refcount to 1 and node to NULL - so the php_libxml_node_ptr is detroyed when the object is destroyed */ - nodeptr->refcount = 1; - nodeptr->node = NULL; - } - - return ret_refcount; -} - -static int php_libxml_clear_object(php_libxml_node_object *object TSRMLS_DC) -{ - if (object->properties) { - object->properties = NULL; - } - php_libxml_decrement_node_ptr(object TSRMLS_CC); - return php_libxml_decrement_doc_ref(object TSRMLS_CC); -} - -static int php_libxml_unregister_node(xmlNodePtr nodep TSRMLS_DC) -{ - php_libxml_node_object *wrapper; - - php_libxml_node_ptr *nodeptr = nodep->_private; - - if (nodeptr != NULL) { - wrapper = nodeptr->_private; - if (wrapper) { - php_libxml_clear_object(wrapper TSRMLS_CC); - } else { - php_libxml_dec_node(nodeptr); - } - } - - return -1; -} - -static void php_libxml_node_free(xmlNodePtr node) -{ - if(node) { - if (node->_private != NULL) { - ((php_libxml_node_ptr *) node->_private)->node = NULL; - } - switch (node->type) { - case XML_ATTRIBUTE_NODE: - xmlFreeProp((xmlAttrPtr) node); - break; - case XML_ENTITY_DECL: - case XML_ELEMENT_DECL: - case XML_ATTRIBUTE_DECL: - break; - case XML_NOTATION_NODE: - /* These require special handling */ - if (node->name != NULL) { - xmlFree((char *) node->name); - } - if (((xmlEntityPtr) node)->ExternalID != NULL) { - xmlFree((char *) ((xmlEntityPtr) node)->ExternalID); - } - if (((xmlEntityPtr) node)->SystemID != NULL) { - xmlFree((char *) ((xmlEntityPtr) node)->SystemID); - } - xmlFree(node); - break; - case XML_NAMESPACE_DECL: - if (node->ns) { - xmlFreeNs(node->ns); - node->ns = NULL; - } - node->type = XML_ELEMENT_NODE; - default: - xmlFreeNode(node); - } - } -} - -static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC) -{ - xmlNodePtr curnode; - - if (node != NULL) { - curnode = node; - while (curnode != NULL) { - node = curnode; - switch (node->type) { - /* Skip property freeing for the following types */ - case XML_NOTATION_NODE: - break; - case XML_ENTITY_REF_NODE: - php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); - break; - case XML_ATTRIBUTE_DECL: - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_ENTITY_DECL: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - php_libxml_node_free_list(node->children TSRMLS_CC); - break; - default: - php_libxml_node_free_list(node->children TSRMLS_CC); - php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); - } - - curnode = node->next; - xmlUnlinkNode(node); - if (php_libxml_unregister_node(node TSRMLS_CC) == 0) { - node->doc = NULL; - } - php_libxml_node_free(node); - } - } -} - -/* }}} */ - -/* {{{ startup, shutdown and info functions */ -#ifdef ZTS -static void php_libxml_init_globals(php_libxml_globals *libxml_globals_p TSRMLS_DC) -{ - LIBXML(stream_context) = NULL; - LIBXML(error_buffer).c = NULL; - LIBXML(error_list) = NULL; -} -#endif - -/* Channel libxml file io layer through the PHP streams subsystem. - * This allows use of ftps:// and https:// urls */ - -void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, const int read_only) -{ - php_stream_statbuf ssbuf; - php_stream_context *context = NULL; - php_stream_wrapper *wrapper = NULL; - char *resolved_path, *path_to_open = NULL; - void *ret_val = NULL; - int isescaped=0; - xmlURI *uri; - - TSRMLS_FETCH(); - - uri = xmlParseURI((xmlChar *)filename); - if (uri && (uri->scheme == NULL || (xmlStrncmp(uri->scheme, "file", 4) == 0))) { - resolved_path = xmlURIUnescapeString(filename, 0, NULL); - isescaped = 1; - } else { - resolved_path = (char *)filename; - } - - if (uri) { - xmlFreeURI(uri); - } - - if (resolved_path == NULL) { - return NULL; - } - - /* logic copied from _php_stream_stat, but we only want to fail - if the wrapper supports stat, otherwise, figure it out from - the open. This logic is only to support hiding warnings - that the streams layer puts out at times, but for libxml we - may try to open files that don't exist, but it is not a failure - in xml processing (eg. DTD files) */ - wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC); - if (wrapper && read_only && wrapper->wops->url_stat) { - if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) { - if (isescaped) { - xmlFree(resolved_path); - } - return NULL; - } - } - - if (LIBXML(stream_context)) { - context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()); - } - - ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context); - if (isescaped) { - xmlFree(resolved_path); - } - return ret_val; -} - -void *php_libxml_streams_IO_open_read_wrapper(const char *filename) -{ - return php_libxml_streams_IO_open_wrapper(filename, "rb", 1); -} - -void *php_libxml_streams_IO_open_write_wrapper(const char *filename) -{ - return php_libxml_streams_IO_open_wrapper(filename, "wb", 0); -} - -int php_libxml_streams_IO_read(void *context, char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_read((php_stream*)context, buffer, len); -} - -int php_libxml_streams_IO_write(void *context, const char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_write((php_stream*)context, buffer, len); -} - -int php_libxml_streams_IO_close(void *context) -{ - TSRMLS_FETCH(); - return php_stream_close((php_stream*)context); -} - -xmlParserInputBufferPtr -php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc) -{ - xmlParserInputBufferPtr ret; - void *context = NULL; - - if (URI == NULL) - return(NULL); - - context = php_libxml_streams_IO_open_read_wrapper(URI); - - if (context == NULL) { - return(NULL); - } - - /* Allocate the Input buffer front-end. */ - ret = xmlAllocParserInputBuffer(enc); - if (ret != NULL) { - ret->context = context; - ret->readcallback = php_libxml_streams_IO_read; - ret->closecallback = php_libxml_streams_IO_close; - } else - php_libxml_streams_IO_close(context); - - return(ret); -} - -xmlOutputBufferPtr -php_libxml_output_buffer_create_filename(const char *URI, - xmlCharEncodingHandlerPtr encoder, - int compression ATTRIBUTE_UNUSED) -{ - xmlOutputBufferPtr ret; - xmlURIPtr puri; - void *context = NULL; - char *unescaped = NULL; - - if (URI == NULL) - return(NULL); - - puri = xmlParseURI(URI); - if (puri != NULL) { - if (puri->scheme != NULL) - unescaped = xmlURIUnescapeString(URI, 0, NULL); - xmlFreeURI(puri); - } - - if (unescaped != NULL) { - context = php_libxml_streams_IO_open_write_wrapper(unescaped); - xmlFree(unescaped); - } - - /* try with a non-escaped URI this may be a strange filename */ - if (context == NULL) { - context = php_libxml_streams_IO_open_write_wrapper(URI); - } - - if (context == NULL) { - return(NULL); - } - - /* Allocate the Output buffer front-end. */ - ret = xmlAllocOutputBuffer(encoder); - if (ret != NULL) { - ret->context = context; - ret->writecallback = php_libxml_streams_IO_write; - ret->closecallback = php_libxml_streams_IO_close; - } - - return(ret); -} - -static int _php_libxml_free_error(xmlErrorPtr error) { - /* This will free the libxml alloc'd memory */ - xmlResetError(error); - return 1; -} - -static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg) -{ - xmlError error_copy; - int ret; - - TSRMLS_FETCH(); - - memset(&error_copy, 0, sizeof(xmlError)); - - if (error) { - ret = xmlCopyError(error, &error_copy); - } else { - error_copy.domain = 0; - error_copy.code = XML_ERR_INTERNAL_ERROR; - error_copy.level = XML_ERR_ERROR; - error_copy.line = 0; - error_copy.node = NULL; - error_copy.int1 = 0; - error_copy.int2 = 0; - error_copy.ctxt = NULL; - error_copy.message = xmlStrdup(msg); - error_copy.file = NULL; - error_copy.str1 = NULL; - error_copy.str2 = NULL; - error_copy.str3 = NULL; - ret = 0; - } - - if (ret == 0) { - zend_llist_add_element(LIBXML(error_list), &error_copy); - } -} - -static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSRMLS_DC) -{ - xmlParserCtxtPtr parser; - - parser = (xmlParserCtxtPtr) ctx; - - if (parser != NULL && parser->input != NULL) { - if (parser->input->filename) { - php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line); - } else { - php_error_docref(NULL TSRMLS_CC, level, "%s in Entity, line: %d", msg, parser->input->line); - } - } -} - -void php_libxml_issue_error(int level, const char *msg TSRMLS_DC) -{ - if (LIBXML(error_list)) { - _php_list_set_error_structure(NULL, msg); - } else { - php_error_docref(NULL TSRMLS_CC, level, "%s", msg); - } -} - -static void php_libxml_internal_error_handler(int error_type, void *ctx, const char **msg, va_list ap) -{ - char *buf; - int len, len_iter, output = 0; - - TSRMLS_FETCH(); - - len = vspprintf(&buf, 0, *msg, ap); - len_iter = len; - - /* remove any trailing \n */ - while (len_iter && buf[--len_iter] == '\n') { - buf[len_iter] = '\0'; - output = 1; - } - - smart_str_appendl(&LIBXML(error_buffer), buf, len); - - efree(buf); - - if (output == 1) { - if (LIBXML(error_list)) { - _php_list_set_error_structure(NULL, LIBXML(error_buffer).c); - } else { - switch (error_type) { - case PHP_LIBXML_CTX_ERROR: - php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).c TSRMLS_CC); - break; - case PHP_LIBXML_CTX_WARNING: - php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).c TSRMLS_CC); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", LIBXML(error_buffer).c); - } - } - smart_str_free(&LIBXML(error_buffer)); - } -} - -void php_libxml_ctx_error(void *ctx, const char *msg, ...) -{ - va_list args; - va_start(args, msg); - php_libxml_internal_error_handler(PHP_LIBXML_CTX_ERROR, ctx, &msg, args); - va_end(args); -} - -void php_libxml_ctx_warning(void *ctx, const char *msg, ...) -{ - va_list args; - va_start(args, msg); - php_libxml_internal_error_handler(PHP_LIBXML_CTX_WARNING, ctx, &msg, args); - va_end(args); -} - -PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error) -{ - _php_list_set_error_structure(error, NULL); - - return; -} - -PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...) -{ - va_list args; - va_start(args, msg); - php_libxml_internal_error_handler(PHP_LIBXML_ERROR, ctx, &msg, args); - va_end(args); -} - - -PHP_LIBXML_API void php_libxml_initialize() { - if (!_php_libxml_initialized) { - /* we should be the only one's to ever init!! */ - xmlInitParser(); - - zend_hash_init(&php_libxml_exports, 0, NULL, NULL, 1); - - _php_libxml_initialized = 1; - } -} - -PHP_LIBXML_API void php_libxml_shutdown() { - if (_php_libxml_initialized) { -#if defined(LIBXML_SCHEMAS_ENABLED) - xmlRelaxNGCleanupTypes(); -#endif - xmlCleanupParser(); - zend_hash_destroy(&php_libxml_exports); - _php_libxml_initialized = 0; - } -} - -PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC) { - zval *oldcontext; - - oldcontext = LIBXML(stream_context); - LIBXML(stream_context) = context; - return oldcontext; - -} - -PHP_MINIT_FUNCTION(libxml) -{ - zend_class_entry ce; - - php_libxml_initialize(); - -#ifdef ZTS - ts_allocate_id(&libxml_globals_id, sizeof(php_libxml_globals), (ts_allocate_ctor) php_libxml_init_globals, NULL); -#else - LIBXML(stream_context) = NULL; - LIBXML(error_buffer).c = NULL; - LIBXML(error_list) = NULL; -#endif - - REGISTER_LONG_CONSTANT("LIBXML_VERSION", LIBXML_VERSION, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("LIBXML_DOTTED_VERSION", LIBXML_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT); - - /* For use with loading xml */ - REGISTER_LONG_CONSTANT("LIBXML_NOENT", XML_PARSE_NOENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_DTDLOAD", XML_PARSE_DTDLOAD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_DTDATTR", XML_PARSE_DTDATTR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_DTDVALID", XML_PARSE_DTDVALID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NOERROR", XML_PARSE_NOERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NOWARNING", XML_PARSE_NOWARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NOBLANKS", XML_PARSE_NOBLANKS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_XINCLUDE", XML_PARSE_XINCLUDE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NSCLEAN", XML_PARSE_NSCLEAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NOCDATA", XML_PARSE_NOCDATA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NONET", XML_PARSE_NONET, CONST_CS | CONST_PERSISTENT); -#if LIBXML_VERSION >= 20621 - REGISTER_LONG_CONSTANT("LIBXML_COMPACT", XML_PARSE_COMPACT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_NOXMLDECL", XML_SAVE_NO_DECL, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT); - - /* Error levels */ - REGISTER_LONG_CONSTANT("LIBXML_ERR_NONE", XML_ERR_NONE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_ERR_WARNING", XML_ERR_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_ERR_ERROR", XML_ERR_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LIBXML_ERR_FATAL", XML_ERR_FATAL, CONST_CS | CONST_PERSISTENT); - - INIT_CLASS_ENTRY(ce, "LibXMLError", NULL); - libxmlerror_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - return SUCCESS; -} - - -PHP_RINIT_FUNCTION(libxml) -{ - /* report errors via handler rather than stderr */ - xmlSetGenericErrorFunc(NULL, php_libxml_error_handler); - xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename); - xmlOutputBufferCreateFilenameDefault(php_libxml_output_buffer_create_filename); - return SUCCESS; -} - - -PHP_MSHUTDOWN_FUNCTION(libxml) -{ - php_libxml_shutdown(); - - return SUCCESS; -} - - -PHP_RSHUTDOWN_FUNCTION(libxml) -{ - /* reset libxml generic error handling */ - xmlSetGenericErrorFunc(NULL, NULL); - xmlSetStructuredErrorFunc(NULL, NULL); - - xmlParserInputBufferCreateFilenameDefault(NULL); - xmlOutputBufferCreateFilenameDefault(NULL); - - smart_str_free(&LIBXML(error_buffer)); - if (LIBXML(error_list)) { - zend_llist_destroy(LIBXML(error_list)); - efree(LIBXML(error_list)); - LIBXML(error_list) = NULL; - } - - return SUCCESS; -} - - -PHP_MINFO_FUNCTION(libxml) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "libXML support", "active"); - php_info_print_table_row(2, "libXML Version", LIBXML_DOTTED_VERSION); - php_info_print_table_row(2, "libXML streams", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - - -/* {{{ proto void libxml_set_streams_context(resource streams_context) - Set the streams context for the next libxml document load or write */ -PHP_FUNCTION(libxml_set_streams_context) -{ - zval *arg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { - return; - } - if (LIBXML(stream_context)) { - zval_ptr_dtor(&LIBXML(stream_context)); - LIBXML(stream_context) = NULL; - } - ZVAL_ADDREF(arg); - LIBXML(stream_context) = arg; -} -/* }}} */ - -/* {{{ proto void libxml_use_internal_errors(boolean use_errors) - Disable libxml errors and allow user to fetch error information as needed */ -PHP_FUNCTION(libxml_use_internal_errors) -{ - xmlStructuredErrorFunc current_handler; - int use_errors=0, retval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &use_errors) == FAILURE) { - return; - } - - current_handler = xmlStructuredError; - if (current_handler && current_handler == php_libxml_structured_error_handler) { - retval = 1; - } else { - retval = 0; - } - - if (ZEND_NUM_ARGS() == 0) { - RETURN_BOOL(retval); - } - - if (use_errors == 0) { - xmlSetStructuredErrorFunc(NULL, NULL); - if (LIBXML(error_list)) { - zend_llist_destroy(LIBXML(error_list)); - efree(LIBXML(error_list)); - LIBXML(error_list) = NULL; - } - } else { - xmlSetStructuredErrorFunc(NULL, php_libxml_structured_error_handler); - if (LIBXML(error_list) == NULL) { - LIBXML(error_list) = (zend_llist *) emalloc(sizeof(zend_llist)); - zend_llist_init(LIBXML(error_list), sizeof(xmlError), (llist_dtor_func_t) _php_libxml_free_error, 0); - } - } - RETURN_BOOL(retval); -} - -/* {{{ proto object libxml_get_last_error() - Retrieve last error from libxml */ -PHP_FUNCTION(libxml_get_last_error) -{ - xmlErrorPtr error; - - error = xmlGetLastError(); - - if (error) { - object_init_ex(return_value, libxmlerror_class_entry); - add_property_long(return_value, "level", error->level); - add_property_long(return_value, "code", error->code); - add_property_long(return_value, "column", error->int2); - if (error->message) { - add_property_string(return_value, "message", error->message, 1); - } else { - add_property_stringl(return_value, "message", "", 0, 1); - } - if (error->file) { - add_property_string(return_value, "file", error->file, 1); - } else { - add_property_stringl(return_value, "file", "", 0, 1); - } - add_property_long(return_value, "line", error->line); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object libxml_get_errors() - Retrieve array of errors */ -PHP_FUNCTION(libxml_get_errors) -{ - - xmlErrorPtr error; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - if (LIBXML(error_list)) { - - error = zend_llist_get_first(LIBXML(error_list)); - - while (error != NULL) { - zval *z_error; - MAKE_STD_ZVAL(z_error); - - object_init_ex(z_error, libxmlerror_class_entry); - add_property_long(z_error, "level", error->level); - add_property_long(z_error, "code", error->code); - add_property_long(z_error, "column", error->int2); - if (error->message) { - add_property_string(z_error, "message", error->message, 1); - } else { - add_property_stringl(z_error, "message", "", 0, 1); - } - if (error->file) { - add_property_string(z_error, "file", error->file, 1); - } else { - add_property_stringl(z_error, "file", "", 0, 1); - } - add_property_long(z_error, "line", error->line); - add_next_index_zval(return_value, z_error); - - error = zend_llist_get_next(LIBXML(error_list)); - } - } -} -/* }}} */ - -/* {{{ proto void libxml_clear_errors() - Clear last error from libxml */ -PHP_FUNCTION(libxml_clear_errors) -{ - xmlResetLastError(); - if (LIBXML(error_list)) { - zend_llist_clean(LIBXML(error_list)); - } -} -/* }}} */ - -/* {{{ Common functions shared by extensions */ -int php_libxml_xmlCheckUTF8(const unsigned char *s) -{ - int i; - unsigned char c; - - for (i = 0; (c = s[i++]);) { - if ((c & 0x80) == 0) { - } else if ((c & 0xe0) == 0xc0) { - if ((s[i++] & 0xc0) != 0x80) { - return 0; - } - } else if ((c & 0xf0) == 0xe0) { - if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) { - return 0; - } - } else if ((c & 0xf8) == 0xf0) { - if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) { - return 0; - } - } else { - return 0; - } - } - return 1; -} - -int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function) -{ - php_libxml_func_handler export_hnd; - - /* Initialize in case this module hasnt been loaded yet */ - php_libxml_initialize(); - export_hnd.export_func = export_function; - - if (zend_hash_add(&php_libxml_exports, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL) == SUCCESS) { - int ret; - UChar *uname; - - uname = malloc(UBYTES(ce->name_length+1)); - u_charsToUChars(ce->name, uname, ce->name_length+1); - ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); - free(uname); - return ret; - } - return FAILURE; -} - -PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC) -{ - zend_class_entry *ce = NULL; - xmlNodePtr node = NULL; - php_libxml_func_handler *export_hnd; - - if (object->type == IS_OBJECT) { - ce = Z_OBJCE_P(object); - while (ce->parent != NULL) { - ce = ce->parent; - } - if (zend_u_hash_find(&php_libxml_exports, UG(unicode)?IS_UNICODE:IS_STRING, ce->name, ce->name_length + 1, (void **) &export_hnd) == SUCCESS) { - node = export_hnd->export_func(object TSRMLS_CC); - } - } - - return node; - -} - -int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC) -{ - int ret_refcount = -1; - - if (object != NULL && node != NULL) { - if (object->node != NULL) { - if (object->node->node == node) { - return object->node->refcount; - } else { - php_libxml_decrement_node_ptr(object TSRMLS_CC); - } - } - if (node->_private != NULL) { - object->node = node->_private; - ret_refcount = ++object->node->refcount; - /* Only dom uses _private */ - if (object->node->_private == NULL) { - object->node->_private = private_data; - } - } else { - ret_refcount = 1; - object->node = emalloc(sizeof(php_libxml_node_ptr)); - object->node->node = node; - object->node->refcount = 1; - object->node->_private = private_data; - node->_private = object->node; - } - } - - return ret_refcount; -} - -int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC) { - int ret_refcount = -1; - php_libxml_node_ptr *obj_node; - - if (object != NULL && object->node != NULL) { - obj_node = (php_libxml_node_ptr *) object->node; - ret_refcount = --obj_node->refcount; - if (ret_refcount == 0) { - if (obj_node->node != NULL) { - obj_node->node->_private = NULL; - } - efree(obj_node); - } - object->node = NULL; - } - - return ret_refcount; -} - -int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC) { - int ret_refcount = -1; - - if (object->document != NULL) { - object->document->refcount++; - ret_refcount = object->document->refcount; - } else if (docp != NULL) { - ret_refcount = 1; - object->document = emalloc(sizeof(php_libxml_ref_obj)); - object->document->ptr = docp; - object->document->refcount = ret_refcount; - object->document->doc_props = NULL; - } - - return ret_refcount; -} - -int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC) { - int ret_refcount = -1; - - if (object != NULL && object->document != NULL) { - ret_refcount = --object->document->refcount; - if (ret_refcount == 0) { - if (object->document->ptr != NULL) { - xmlFreeDoc((xmlDoc *) object->document->ptr); - } - if (object->document->doc_props != NULL) { - efree(object->document->doc_props); - } - efree(object->document); - } - object->document = NULL; - } - - return ret_refcount; -} - -void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC) -{ - if (!node) { - return; - } - - switch (node->type) { - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - break; - default: - if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) { - php_libxml_node_free_list((xmlNodePtr) node->children TSRMLS_CC); - switch (node->type) { - /* Skip property freeing for the following types */ - case XML_ATTRIBUTE_DECL: - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_ENTITY_DECL: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - break; - default: - php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); - } - if (php_libxml_unregister_node(node TSRMLS_CC) == 0) { - node->doc = NULL; - } - php_libxml_node_free(node); - } else { - php_libxml_unregister_node(node TSRMLS_CC); - } - } -} - -void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC) -{ - int ret_refcount = -1; - xmlNodePtr nodep; - php_libxml_node_ptr *obj_node; - - if (object != NULL && object->node != NULL) { - obj_node = (php_libxml_node_ptr *) object->node; - nodep = object->node->node; - ret_refcount = php_libxml_decrement_node_ptr(object TSRMLS_CC); - if (ret_refcount == 0) { - php_libxml_node_free_resource(nodep TSRMLS_CC); - } else { - if (obj_node && object == obj_node->_private) { - obj_node->_private = NULL; - } - } - /* Safe to call as if the resource were freed then doc pointer is NULL */ - php_libxml_decrement_doc_ref(object TSRMLS_CC); - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h deleted file mode 100644 index 584465fd37ca2..0000000000000 --- a/ext/libxml/php_libxml.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_LIBXML_H -#define PHP_LIBXML_H - -#if HAVE_LIBXML -extern zend_module_entry libxml_module_entry; -#define libxml_module_ptr &libxml_module_entry - -#ifdef PHP_WIN32 -#define PHP_LIBXML_API __declspec(dllexport) -#else -#define PHP_LIBXML_API -#endif - -#include "ext/standard/php_smart_str.h" -#include - -#define LIBXML_SAVE_NOEMPTYTAG 1<<2 - -typedef struct { - zval *stream_context; - smart_str error_buffer; - zend_llist *error_list; -} php_libxml_globals; - -typedef struct _php_libxml_ref_obj { - void *ptr; - int refcount; - void *doc_props; -} php_libxml_ref_obj; - -typedef struct _php_libxml_node_ptr { - xmlNodePtr node; - int refcount; - void *_private; -} php_libxml_node_ptr; - -typedef struct _php_libxml_node_object { - zend_object std; - php_libxml_node_ptr *node; - php_libxml_ref_obj *document; - HashTable *properties; -} php_libxml_node_object; - -typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC); - -PHP_FUNCTION(libxml_set_streams_context); -PHP_FUNCTION(libxml_use_internal_errors); -PHP_FUNCTION(libxml_get_last_error); -PHP_FUNCTION(libxml_clear_errors); -PHP_FUNCTION(libxml_get_errors); - -int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC); -int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC); -PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC); -PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC); -PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC); -PHP_LIBXML_API int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function); -/* When an explicit freeing of node and children is required */ -void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC); -/* When object dtor is called as node may still be referenced */ -void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC); -PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...); -void php_libxml_ctx_warning(void *ctx, const char *msg, ...); -void php_libxml_ctx_error(void *ctx, const char *msg, ...); -PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); -PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); -PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC); - -/* Init/shutdown functions*/ -PHP_LIBXML_API void php_libxml_initialize(); -PHP_LIBXML_API void php_libxml_shutdown(); - -#ifdef ZTS -#define LIBXML(v) TSRMG(libxml_globals_id, php_libxml_globals *, v) -#else -#define LIBXML(v) (libxml_globals.v) -#endif - -#else /* HAVE_LIBXML */ -#define libxml_module_ptr NULL -#endif - -#define phpext_libxml_ptr libxml_module_ptr - -#endif /* PHP_LIBXML_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/libxml/php_libxml2.def b/ext/libxml/php_libxml2.def deleted file mode 100644 index 0dd470afced29..0000000000000 --- a/ext/libxml/php_libxml2.def +++ /dev/null @@ -1,1571 +0,0 @@ -EXPORTS -__docbDefaultSAXHandler -__htmlDefaultSAXHandler -__oldXMLWDcompatibility -__xmlBufferAllocScheme -__xmlDefaultBufferSize -__xmlDefaultSAXHandler -__xmlDefaultSAXLocator -__xmlDeregisterNodeDefaultValue -__xmlDoValidityCheckingDefaultValue -xmlFree DATA -__xmlGenericError -__xmlGenericErrorContext -__xmlGetWarningsDefaultValue -__xmlIndentTreeOutput -xmlIsBaseCharGroup DATA -xmlIsCharGroup DATA -xmlIsCombiningGroup DATA -xmlIsDigitGroup DATA -xmlIsExtenderGroup DATA -xmlIsIdeographicGroup DATA -xmlIsPubidChar_tab DATA -__xmlKeepBlanksDefaultValue -xmlLastError DATA -__xmlLineNumbersDefaultValue -__xmlLoadExtDtdDefaultValue -xmlMalloc DATA -xmlMallocAtomic DATA -xmlMemStrdup DATA -__xmlParserDebugEntities -xmlParserMaxDepth DATA -__xmlParserVersion -__xmlPedanticParserDefaultValue -xmlRealloc DATA -__xmlRegisterNodeDefaultValue -__xmlSaveNoEmptyTags -xmlStringComment DATA -xmlStringText DATA -xmlStringTextNoenc DATA -xmlStructuredError DATA -__xmlSubstituteEntitiesDefaultValue -__xmlTreeIndentString -xmlXPathNAN DATA -xmlXPathNINF DATA -xmlXPathPINF DATA -UTF8ToHtml -UTF8Toisolat1 -attribute -attributeDecl -cdataBlock -characters -checkNamespace -comment -docbCreateFileParserCtxt -docbCreatePushParserCtxt -docbDefaultSAXHandlerInit -docbEncodeEntities -docbFreeParserCtxt -docbParseChunk -docbParseDoc -docbParseDocument -docbParseFile -docbSAXParseDoc -docbSAXParseFile -elementDecl -endDocument -endElement -entityDecl -externalSubset -getColumnNumber -getEntity -getLineNumber -getNamespace -getParameterEntity -getPublicId -getSystemId -globalNamespace -hasExternalSubset -hasInternalSubset -htmlAttrAllowed -htmlAutoCloseTag -htmlCreateFileParserCtxt -htmlCreateMemoryParserCtxt -htmlCreatePushParserCtxt -htmlCtxtReadDoc -htmlCtxtReadFd -htmlCtxtReadFile -htmlCtxtReadIO -htmlCtxtReadMemory -htmlCtxtReset -htmlCtxtUseOptions -htmlDefaultSAXHandlerInit -htmlDocContentDumpFormatOutput -htmlDocContentDumpOutput -htmlDocDump -htmlDocDumpMemory -htmlElementAllowedHere -htmlElementStatusHere -htmlEncodeEntities -htmlEntityLookup -htmlEntityValueLookup -htmlFreeParserCtxt -htmlGetMetaEncoding -htmlHandleOmittedElem -htmlInitAutoClose -htmlIsAutoClosed -htmlIsBooleanAttr -htmlIsScriptAttribute -htmlNewDoc -htmlNewDocNoDtD -htmlNodeDump -htmlNodeDumpFile -htmlNodeDumpFileFormat -htmlNodeDumpFormatOutput -htmlNodeDumpOutput -htmlNodeStatus -htmlParseCharRef -htmlParseChunk -htmlParseDoc -htmlParseDocument -htmlParseElement -htmlParseEntityRef -htmlParseFile -htmlReadDoc -htmlReadFd -htmlReadFile -htmlReadIO -htmlReadMemory -htmlSAXParseDoc -htmlSAXParseFile -htmlSaveFile -htmlSaveFileEnc -htmlSaveFileFormat -htmlSetMetaEncoding -htmlTagLookup -ignorableWhitespace -initGenericErrorDefaultFunc -initdocbDefaultSAXHandler -inithtmlDefaultSAXHandler -initxmlDefaultSAXHandler -inputPop -inputPush -internalSubset -isStandalone -isolat1ToUTF8 -namePop -namePush -namespaceDecl -nodePop -nodePush -notationDecl -processingInstruction -reference -resolveEntity -setDocumentLocator -setNamespace -startDocument -startElement -unparsedEntityDecl -valuePop -valuePush -xmlACatalogAdd -xmlACatalogDump -xmlACatalogRemove -xmlACatalogResolve -xmlACatalogResolvePublic -xmlACatalogResolveSystem -xmlACatalogResolveURI -xmlAddAttributeDecl -xmlAddChild -xmlAddChildList -xmlAddDocEntity -xmlAddDtdEntity -xmlAddElementDecl -xmlAddEncodingAlias -xmlAddID -xmlAddNextSibling -xmlAddNotationDecl -xmlAddPrevSibling -xmlAddRef -xmlAddSibling -xmlAllocOutputBuffer -xmlAllocParserInputBuffer -xmlAttrSerializeTxtContent -xmlAutomataCompile -xmlAutomataGetInitState -xmlAutomataIsDeterminist -xmlAutomataNewAllTrans -xmlAutomataNewCountTrans -xmlAutomataNewCountedTrans -xmlAutomataNewCounter -xmlAutomataNewCounterTrans -xmlAutomataNewEpsilon -xmlAutomataNewOnceTrans -xmlAutomataNewState -xmlAutomataNewTransition -xmlAutomataNewTransition2 -xmlAutomataSetFinalState -xmlBoolToText -xmlBufferAdd -xmlBufferAddHead -xmlBufferCCat -xmlBufferCat -xmlBufferContent -xmlBufferCreate -xmlBufferCreateSize -xmlBufferCreateStatic -xmlBufferDump -xmlBufferEmpty -xmlBufferFree -xmlBufferGrow -xmlBufferLength -xmlBufferResize -xmlBufferSetAllocationScheme -xmlBufferShrink -xmlBufferWriteCHAR -xmlBufferWriteChar -xmlBufferWriteQuotedString -xmlBuildQName -xmlBuildURI -xmlByteConsumed -xmlC14NDocDumpMemory -xmlC14NDocSave -xmlC14NDocSaveTo -xmlC14NExecute -xmlCanonicPath -xmlCatalogAdd -xmlCatalogAddLocal -xmlCatalogCleanup -xmlCatalogConvert -xmlCatalogDump -xmlCatalogFreeLocal -xmlCatalogGetDefaults -xmlCatalogGetPublic -xmlCatalogGetSystem -xmlCatalogIsEmpty -xmlCatalogLocalResolve -xmlCatalogLocalResolveURI -xmlCatalogRemove -xmlCatalogResolve -xmlCatalogResolvePublic -xmlCatalogResolveSystem -xmlCatalogResolveURI -xmlCatalogSetDebug -xmlCatalogSetDefaultPrefer -xmlCatalogSetDefaults -xmlCharEncCloseFunc -xmlCharEncFirstLine -xmlCharEncInFunc -xmlCharEncOutFunc -xmlCharInRange -xmlCharStrdup -xmlCharStrndup -xmlCheckFilename -xmlCheckHTTPInput -xmlCheckLanguageID -xmlCheckUTF8 -xmlCheckVersion -xmlCleanupCharEncodingHandlers -xmlCleanupEncodingAliases -xmlCleanupGlobals -xmlCleanupInputCallbacks -xmlCleanupMemory -xmlCleanupOutputCallbacks -xmlCleanupParser -xmlCleanupPredefinedEntities -xmlCleanupThreads -xmlClearNodeInfoSeq -xmlClearParserCtxt -xmlConvertSGMLCatalog -xmlCopyAttributeTable -xmlCopyChar -xmlCopyCharMultiByte -xmlCopyDoc -xmlCopyDtd -xmlCopyElementContent -xmlCopyElementTable -xmlCopyEntitiesTable -xmlCopyEnumeration -xmlCopyError -xmlCopyNamespace -xmlCopyNamespaceList -xmlCopyNode -xmlCopyNodeList -xmlCopyNotationTable -xmlCopyProp -xmlCopyPropList -xmlCreateDocParserCtxt -xmlCreateEntitiesTable -xmlCreateEntityParserCtxt -xmlCreateEnumeration -xmlCreateFileParserCtxt -xmlCreateIOParserCtxt -xmlCreateIntSubset -xmlCreateMemoryParserCtxt -xmlCreatePushParserCtxt -xmlCreateURI -xmlCreateURLParserCtxt -xmlCtxtGetLastError -xmlCtxtReadDoc -xmlCtxtReadFd -xmlCtxtReadFile -xmlCtxtReadIO -xmlCtxtReadMemory -xmlCtxtReset -xmlCtxtResetLastError -xmlCtxtResetPush -xmlCtxtUseOptions -xmlCurrentChar -xmlDictCreate -xmlDictCreateSub -xmlDictFree -xmlDictLookup -xmlDictOwns -xmlDictQLookup -xmlDictReference -xmlDictSize -xmlDebugDumpAttr -xmlDebugDumpAttrList -xmlDebugDumpDTD -xmlDebugDumpDocument -xmlDebugDumpDocumentHead -xmlDebugDumpEntities -xmlDebugDumpNode -xmlDebugDumpNodeList -xmlDebugDumpOneNode -xmlDebugDumpString -xmlDecodeEntities -xmlDefaultSAXHandlerInit -xmlDelEncodingAlias -xmlDeregisterNodeDefault -xmlDetectCharEncoding -xmlDictCreate -xmlDictCreateSub -xmlDictFree -xmlDictLookup -xmlDictOwns -xmlDictQLookup -xmlDictReference -xmlDictSize -xmlDocCopyNode -xmlDocDump -xmlDocDumpFormatMemory -xmlDocDumpFormatMemoryEnc -xmlDocDumpMemory -xmlDocDumpMemoryEnc -xmlDocFormatDump -xmlDocGetRootElement -xmlDocSetRootElement -xmlDumpAttributeDecl -xmlDumpAttributeTable -xmlDumpElementDecl -xmlDumpElementTable -xmlDumpEntitiesTable -xmlDumpEntityDecl -xmlDumpNotationDecl -xmlDumpNotationTable -xmlElemDump -xmlEncodeEntities -xmlEncodeEntitiesReentrant -xmlEncodeSpecialChars -xmlErrMemory -xmlFileClose -xmlFileMatch -xmlFileOpen -xmlFileRead -xmlFindCharEncodingHandler -xmlFreeAttributeTable -xmlFreeAutomata -xmlFreeCatalog -xmlFreeDoc -xmlFreeDtd -xmlFreeElementContent -xmlFreeElementTable -xmlFreeEntitiesTable -xmlFreeEnumeration -xmlFreeIDTable -xmlFreeInputStream -xmlFreeMutex -xmlFreeNode -xmlFreeNodeList -xmlFreeNotationTable -xmlFreeNs -xmlFreeNsList -xmlFreeParserCtxt -xmlFreeParserInputBuffer -xmlFreePattern -xmlFreePatternList -xmlFreeProp -xmlFreePropList -xmlFreeRMutex -xmlFreeRefTable -xmlFreeTextReader -xmlFreeTextWriter -xmlFreeURI -xmlFreeValidCtxt -xmlGcMemGet -xmlGcMemSetup -xmlGetBufferAllocationScheme -xmlGetCharEncodingHandler -xmlGetCharEncodingName -xmlGetCompressMode -xmlGetDocCompressMode -xmlGetDocEntity -xmlGetDtdAttrDesc -xmlGetDtdElementDesc -xmlGetDtdEntity -xmlGetDtdNotationDesc -xmlGetDtdQAttrDesc -xmlGetDtdQElementDesc -xmlGetEncodingAlias -xmlGetExternalEntityLoader -xmlGetFeature -xmlGetFeaturesList -xmlGetGlobalState -xmlGetID -xmlGetIntSubset -xmlGetLastChild -xmlGetLastError -xmlGetLineNo -xmlGetNoNsProp -xmlGetNodePath -xmlGetNsList -xmlGetNsProp -xmlGetParameterEntity -xmlGetPredefinedEntity -xmlGetProp -xmlGetRefs -xmlGetThreadId -xmlGetUTF8Char -xmlHandleEntity -xmlHasNsProp -xmlHasProp -xmlHashAddEntry -xmlHashAddEntry2 -xmlHashAddEntry3 -xmlHashCopy -xmlHashCreate -xmlHashFree -xmlHashLookup -xmlHashLookup2 -xmlHashLookup3 -xmlHashQLookup -xmlHashQLookup2 -xmlHashQLookup3 -xmlHashRemoveEntry -xmlHashRemoveEntry2 -xmlHashRemoveEntry3 -xmlHashScan -xmlHashScan3 -xmlHashScanFull -xmlHashScanFull3 -xmlHashSize -xmlHashUpdateEntry -xmlHashUpdateEntry2 -xmlHashUpdateEntry3 -xmlIOFTPClose -xmlIOFTPMatch -xmlIOFTPOpen -xmlIOFTPRead -xmlIOHTTPClose -xmlIOHTTPMatch -xmlIOHTTPOpen -xmlIOHTTPOpenW -xmlIOHTTPRead -xmlIOParseDTD -xmlInitCharEncodingHandlers -xmlInitGlobals -xmlInitMemory -xmlInitNodeInfoSeq -xmlInitParser -xmlInitParserCtxt -xmlInitThreads -xmlInitializeCatalog -xmlInitializeGlobalState -xmlInitializePredefinedEntities -xmlIsBaseChar -xmlIsBlank -xmlIsBlankNode -xmlIsChar -xmlIsCombining -xmlIsDigit -xmlIsExtender -xmlIsID -xmlIsIdeographic -xmlIsLetter -xmlIsMainThread -xmlIsMixedElement -xmlIsPubidChar -xmlIsRef -xmlIsXHTML -xmlIsBaseCharGroup DATA -xmlIsCharGroup DATA -xmlIsCombiningGroup DATA -xmlIsDigitGroup DATA -xmlIsExtenderGroup DATA -xmlIsIdeographicGroup DATA -xmlKeepBlanksDefault -xmlLineNumbersDefault -xmlLinkGetData -xmlListAppend -xmlListClear -xmlListCopy -xmlListCreate -xmlListDelete -xmlListDup -xmlListEmpty -xmlListEnd -xmlListFront -xmlListInsert -xmlListMerge -xmlListPopBack -xmlListPopFront -xmlListPushBack -xmlListPushFront -xmlListRemoveAll -xmlListRemoveFirst -xmlListRemoveLast -xmlListReverse -xmlListReverseSearch -xmlListReverseWalk -xmlListSearch -xmlListSize -xmlListSort -xmlListWalk -xmlLoadACatalog -xmlLoadCatalog -xmlLoadCatalogs -xmlLoadExternalEntity -xmlLoadSGMLSuperCatalog -xmlLockLibrary -xmlLsCountNode -xmlLsOneNode -xmlMallocAtomicLoc -xmlMallocLoc -xmlMemDisplay -xmlMemFree -xmlMemGet -xmlMemMalloc -xmlMemRealloc -xmlMemSetup -xmlMemShow -xmlMemStrdupLoc -xmlMemUsed -xmlMemoryDump -xmlMemoryStrdup -xmlMutexLock -xmlMutexUnlock -xmlNamespaceParseNCName -xmlNamespaceParseNSDef -xmlNamespaceParseQName -xmlNanoFTPCheckResponse -xmlNanoFTPCleanup -xmlNanoFTPClose -xmlNanoFTPCloseConnection -xmlNanoFTPConnect -xmlNanoFTPConnectTo -xmlNanoFTPCwd -xmlNanoFTPDele -xmlNanoFTPFreeCtxt -xmlNanoFTPGet -xmlNanoFTPGetConnection -xmlNanoFTPGetResponse -xmlNanoFTPGetSocket -xmlNanoFTPInit -xmlNanoFTPList -xmlNanoFTPNewCtxt -xmlNanoFTPOpen -xmlNanoFTPProxy -xmlNanoFTPQuit -xmlNanoFTPRead -xmlNanoFTPScanProxy -xmlNanoFTPUpdateURL -xmlNanoHTTPAuthHeader -xmlNanoHTTPCleanup -xmlNanoHTTPClose -xmlNanoHTTPEncoding -xmlNanoHTTPFetch -xmlNanoHTTPInit -xmlNanoHTTPMethod -xmlNanoHTTPMethodRedir -xmlNanoHTTPMimeType -xmlNanoHTTPOpen -xmlNanoHTTPOpenRedir -xmlNanoHTTPRead -xmlNanoHTTPRedir -xmlNanoHTTPReturnCode -xmlNanoHTTPSave -xmlNanoHTTPScanProxy -xmlNewAutomata -xmlNewCDataBlock -xmlNewCatalog -xmlNewCharEncodingHandler -xmlNewCharRef -xmlNewChild -xmlNewComment -xmlNewDoc -xmlNewDocComment -xmlNewDocFragment -xmlNewDocNode -xmlNewDocNodeEatName -xmlNewDocProp -xmlNewDocRawNode -xmlNewDocText -xmlNewDocTextLen -xmlNewDtd -xmlNewElementContent -xmlNewEntityInputStream -xmlNewGlobalNs -xmlNewIOInputStream -xmlNewInputFromFile -xmlNewInputStream -xmlNewMutex -xmlNewNode -xmlNewNodeEatName -xmlNewNs -xmlNewNsProp -xmlNewNsPropEatName -xmlNewPI -xmlNewParserCtxt -xmlNewProp -xmlNewRMutex -xmlNewReference -xmlNewStringInputStream -xmlNewText -xmlNewTextChild -xmlNewTextLen -xmlNewTextReader -xmlNewTextReaderFilename -xmlNewTextWriter -xmlNewTextWriterDoc -xmlNewTextWriterFilename -xmlNewTextWriterMemory -xmlNewTextWriterPushParser -xmlNewTextWriterTree -xmlNewValidCtxt -xmlNextChar -xmlNoNetExternalEntityLoader -xmlNodeAddContent -xmlNodeAddContentLen -xmlNodeBufGetContent -xmlNodeDump -xmlNodeDumpOutput -xmlNodeGetBase -xmlNodeGetContent -xmlNodeGetLang -xmlNodeGetSpacePreserve -xmlNodeIsText -xmlNodeListGetRawString -xmlNodeListGetString -xmlNodeSetBase -xmlNodeSetContent -xmlNodeSetContentLen -xmlNodeSetLang -xmlNodeSetName -xmlNodeSetSpacePreserve -xmlNormalizeURIPath -xmlNormalizeWindowsPath -xmlOutputBufferClose -xmlOutputBufferCreateFd -xmlOutputBufferCreateFile -xmlOutputBufferCreateFilename -xmlOutputBufferCreateIO -xmlOutputBufferFlush -xmlOutputBufferWrite -xmlOutputBufferWriteString -xmlParseAttValue -xmlParseAttribute -xmlParseAttributeListDecl -xmlParseAttributeType -xmlParseBalancedChunkMemory -xmlParseBalancedChunkMemoryRecover -xmlParseCDSect -xmlParseCatalogFile -xmlParseCharData -xmlParseCharEncoding -xmlParseCharRef -xmlParseChunk -xmlParseComment -xmlParseContent -xmlParseCtxtExternalEntity -xmlParseDTD -xmlParseDefaultDecl -xmlParseDoc -xmlParseDocTypeDecl -xmlParseDocument -xmlParseElement -xmlParseElementChildrenContentDecl -xmlParseElementContentDecl -xmlParseElementDecl -xmlParseElementMixedContentDecl -xmlParseEncName -xmlParseEncodingDecl -xmlParseEndTag -xmlParseEntity -xmlParseEntityDecl -xmlParseEntityRef -xmlParseEntityValue -xmlParseEnumeratedType -xmlParseEnumerationType -xmlParseExtParsedEnt -xmlParseExternalEntity -xmlParseExternalID -xmlParseExternalSubset -xmlParseFile -xmlParseMarkupDecl -xmlParseMemory -xmlParseMisc -xmlParseName -xmlParseNamespace -xmlParseNmtoken -xmlParseNotationDecl -xmlParseNotationType -xmlParsePEReference -xmlParsePI -xmlParsePITarget -xmlParsePubidLiteral -xmlParseQuotedString -xmlParseReference -xmlParseSDDecl -xmlParseStartTag -xmlParseSystemLiteral -xmlParseTextDecl -xmlParseURI -xmlParseURIReference -xmlParseVersionInfo -xmlParseVersionNum -xmlParseXMLDecl -xmlParserAddNodeInfo -xmlParserError -xmlParserFindNodeInfo -xmlParserFindNodeInfoIndex -xmlParserGetDirectory -xmlParserHandlePEReference -xmlParserHandleReference -xmlParserInputBufferCreateFd -xmlParserInputBufferCreateFile -xmlParserInputBufferCreateFilename -xmlParserInputBufferCreateIO -xmlParserInputBufferCreateMem -xmlParserInputBufferCreateStatic -xmlParserInputBufferGrow -xmlParserInputBufferPush -xmlParserInputBufferRead -xmlParserInputGrow -xmlParserInputRead -xmlParserInputShrink -xmlParserPrintFileContext -xmlParserPrintFileInfo -xmlParserValidityError -xmlParserValidityWarning -xmlParserWarning -xmlPatternMatch -xmlPatterncompile -xmlPedanticParserDefault -xmlPopInput -xmlPrintURI -xmlPushInput -xmlRMutexLock -xmlRMutexUnlock -xmlReadDoc -xmlReadFd -xmlReadFile -xmlReadIO -xmlReadMemory -xmlReaderForDoc -xmlReaderForFd -xmlReaderForFile -xmlReaderForIO -xmlReaderForMemory -xmlReaderNewDoc -xmlReaderNewFd -xmlReaderNewFile -xmlReaderNewIO -xmlReaderNewMemory -xmlReaderNewWalker -xmlReaderWalker -xmlReallocLoc -xmlReconciliateNs -xmlRecoverDoc -xmlRecoverFile -xmlRecoverMemory -xmlRegExecPushString -xmlRegExecPushString2 -xmlRegFreeExecCtxt -xmlRegFreeRegexp -xmlRegNewExecCtxt -xmlRegexpCompile -xmlRegexpExec -xmlRegexpIsDeterminist -xmlRegexpPrint -xmlRegisterCharEncodingHandler -xmlRegisterDefaultInputCallbacks -xmlRegisterDefaultOutputCallbacks -xmlRegisterHTTPPostCallbacks -xmlRegisterInputCallbacks -xmlRegisterNodeDefault -xmlRegisterOutputCallbacks -xmlRelaxNGCleanupTypes -xmlRelaxNGDump -xmlRelaxNGDumpTree -xmlRelaxNGFree -xmlRelaxNGFreeParserCtxt -xmlRelaxNGFreeValidCtxt -xmlRelaxNGGetParserErrors -xmlRelaxNGGetValidErrors -xmlRelaxNGNewDocParserCtxt -xmlRelaxNGNewMemParserCtxt -xmlRelaxNGNewParserCtxt -xmlRelaxNGNewValidCtxt -xmlRelaxNGParse -xmlRelaxNGSetParserErrors -xmlRelaxNGSetValidErrors -xmlRelaxNGValidateDoc -xmlRelaxNGValidateFullElement -xmlRelaxNGValidatePopElement -xmlRelaxNGValidatePushCData -xmlRelaxNGValidatePushElement -xmlRelaxParserSetFlag -xmlRemoveID -xmlRemoveProp -xmlRemoveRef -xmlReplaceNode -xmlResetError -xmlResetLastError -xmlSAX2AttributeDecl -xmlSAX2CDataBlock -xmlSAX2Characters -xmlSAX2Comment -xmlSAX2ElementDecl -xmlSAX2EndDocument -xmlSAX2EndElement -xmlSAX2EndElementNs -xmlSAX2EntityDecl -xmlSAX2ExternalSubset -xmlSAX2GetColumnNumber -xmlSAX2GetEntity -xmlSAX2GetLineNumber -xmlSAX2GetParameterEntity -xmlSAX2GetPublicId -xmlSAX2GetSystemId -xmlSAX2HasExternalSubset -xmlSAX2HasInternalSubset -xmlSAX2IgnorableWhitespace -xmlSAX2InitDefaultSAXHandler -xmlSAX2InitDocbDefaultSAXHandler -xmlSAX2InitHtmlDefaultSAXHandler -xmlSAX2InternalSubset -xmlSAX2IsStandalone -xmlSAX2NotationDecl -xmlSAX2ProcessingInstruction -xmlSAX2Reference -xmlSAX2ResolveEntity -xmlSAX2SetDocumentLocator -xmlSAX2StartDocument -xmlSAX2StartElement -xmlSAX2StartElementNs -xmlSAX2UnparsedEntityDecl -xmlSAXDefaultVersion -xmlSAXParseDTD -xmlSAXParseDoc -xmlSAXParseEntity -xmlSAXParseFile -xmlSAXParseFileWithData -xmlSAXParseMemory -xmlSAXParseMemoryWithData -xmlSAXUserParseFile -xmlSAXUserParseMemory -xmlSAXVersion -xmlSaveFile -xmlSaveFileEnc -xmlSaveFileTo -xmlSaveFormatFile -xmlSaveFormatFileEnc -xmlSaveFormatFileTo -xmlSaveUri -xmlScanName -xmlSchemaCheckFacet -xmlSchemaCleanupTypes -xmlSchemaCompareValues -xmlSchemaDump -xmlSchemaFree -xmlSchemaFreeFacet -xmlSchemaFreeParserCtxt -xmlSchemaFreeType -xmlSchemaFreeValidCtxt -xmlSchemaFreeValue -xmlSchemaGetPredefinedType -xmlSchemaInitTypes -xmlSchemaNewDocParserCtxt -xmlSchemaNewFacet -xmlSchemaNewMemParserCtxt -xmlSchemaNewParserCtxt -xmlSchemaNewValidCtxt -xmlSchemaParse -xmlSchemaSetParserErrors -xmlSchemaSetValidErrors -xmlSchemaValPredefTypeNode -xmlSchemaValidateDoc -xmlSchemaValidateFacet -xmlSchemaValidatePredefinedType -xmlSchemaValidateStream -xmlSearchNs -xmlSearchNsByHref -xmlSetBufferAllocationScheme -xmlSetCompressMode -xmlSetDocCompressMode -xmlSetEntityReferenceFunc -xmlSetExternalEntityLoader -xmlSetFeature -xmlSetGenericErrorFunc -xmlSetListDoc -xmlSetNs -xmlSetNsProp -xmlSetProp -xmlSetStructuredErrorFunc -xmlSetTreeDoc -xmlSetupParserForBuffer -xmlShell -xmlShellBase -xmlShellCat -xmlShellDir -xmlShellDu -xmlShellList -xmlShellLoad -xmlShellPrintNode -xmlShellPrintXPathError -xmlShellPrintXPathResult -xmlShellPwd -xmlShellSave -xmlShellValidate -xmlShellWrite -xmlSkipBlankChars -xmlSnprintfElementContent -xmlSplitQName -xmlSplitQName2 -xmlSplitQName3 -xmlSprintfElementContent -xmlStopParser -xmlStrEqual -xmlStrPrintf -xmlStrQEqual -xmlStrVPrintf -xmlStrcasecmp -xmlStrcasestr -xmlStrcat -xmlStrchr -xmlStrcmp -xmlStrdup -xmlStringCurrentChar -xmlStringDecodeEntities -xmlStringGetNodeList -xmlStringLenDecodeEntities -xmlStringLenGetNodeList -xmlStrlen -xmlStrncasecmp -xmlStrncat -xmlStrncatNew -xmlStrncmp -xmlStrndup -xmlStrstr -xmlStrsub -xmlSubstituteEntitiesDefault -xmlSwitchEncoding -xmlSwitchInputEncoding -xmlSwitchToEncoding -xmlTextConcat -xmlTextMerge -xmlTextReaderAttributeCount -xmlTextReaderBaseUri -xmlTextReaderClose -xmlTextReaderConstBaseUri -xmlTextReaderConstLocalName -xmlTextReaderConstName -xmlTextReaderConstNamespaceUri -xmlTextReaderConstPrefix -xmlTextReaderConstString -xmlTextReaderConstValue -xmlTextReaderConstXmlLang -xmlTextReaderCurrentDoc -xmlTextReaderCurrentNode -xmlTextReaderDepth -xmlTextReaderExpand -xmlTextReaderGetAttribute -xmlTextReaderGetAttributeNo -xmlTextReaderGetAttributeNs -xmlTextReaderGetErrorHandler -xmlTextReaderGetParserProp -xmlTextReaderGetRemainder -xmlTextReaderHasAttributes -xmlTextReaderHasValue -xmlTextReaderIsDefault -xmlTextReaderIsEmptyElement -xmlTextReaderIsValid -xmlTextReaderLocalName -xmlTextReaderLocatorBaseURI -xmlTextReaderLocatorLineNumber -xmlTextReaderLookupNamespace -xmlTextReaderMoveToAttribute -xmlTextReaderMoveToAttributeNo -xmlTextReaderMoveToAttributeNs -xmlTextReaderMoveToElement -xmlTextReaderMoveToFirstAttribute -xmlTextReaderMoveToNextAttribute -xmlTextReaderName -xmlTextReaderNamespaceUri -xmlTextReaderNext -xmlTextReaderNextSibling -xmlTextReaderNodeType -xmlTextReaderNormalization -xmlTextReaderPrefix -xmlTextReaderPreserve -xmlTextReaderPreservePattern -xmlTextReaderQuoteChar -xmlTextReaderRead -xmlTextReaderReadAttributeValue -xmlTextReaderReadInnerXml -xmlTextReaderReadOuterXml -xmlTextReaderReadState -xmlTextReaderReadString -xmlTextReaderRelaxNGSetSchema -xmlTextReaderRelaxNGValidate -xmlTextReaderSetErrorHandler -xmlTextReaderSetParserProp -xmlTextReaderSetStructuredErrorHandler -xmlTextReaderValue -xmlTextReaderXmlLang -xmlTextWriterEndAttribute -xmlTextWriterEndCDATA -xmlTextWriterEndComment -xmlTextWriterEndDTD -xmlTextWriterEndDocument -xmlTextWriterEndElement -xmlTextWriterEndPI -xmlTextWriterFlush -xmlTextWriterFullEndElement -xmlTextWriterSetIndent -xmlTextWriterSetIndentString -xmlTextWriterStartAttribute -xmlTextWriterStartAttributeNS -xmlTextWriterStartCDATA -xmlTextWriterStartComment -xmlTextWriterStartDTD -xmlTextWriterStartDTDAttlist -xmlTextWriterStartDTDElement -xmlTextWriterStartDTDEntity -xmlTextWriterStartDocument -xmlTextWriterStartElement -xmlTextWriterStartElementNS -xmlTextWriterStartPI -xmlTextWriterWriteAttribute -xmlTextWriterWriteAttributeNS -xmlTextWriterWriteBase64 -xmlTextWriterWriteBinHex -xmlTextWriterWriteCDATA -xmlTextWriterWriteComment -xmlTextWriterWriteDTD -xmlTextWriterWriteDTDAttlist -xmlTextWriterWriteDTDElement -xmlTextWriterWriteDTDEntity -xmlTextWriterWriteDTDExternalEntity -xmlTextWriterWriteDTDInternalEntity -xmlTextWriterWriteDTDNotation -xmlTextWriterWriteElement -xmlTextWriterWriteElementNS -xmlTextWriterWriteFormatAttribute -xmlTextWriterWriteFormatAttributeNS -xmlTextWriterWriteFormatCDATA -xmlTextWriterWriteFormatComment -xmlTextWriterWriteFormatDTD -xmlTextWriterWriteFormatDTDAttlist -xmlTextWriterWriteFormatDTDElement -xmlTextWriterWriteFormatDTDInternalEntity -xmlTextWriterWriteFormatElement -xmlTextWriterWriteFormatElementNS -xmlTextWriterWriteFormatPI -xmlTextWriterWriteFormatRaw -xmlTextWriterWriteFormatString -xmlTextWriterWritePI -xmlTextWriterWriteRaw -xmlTextWriterWriteRawLen -xmlTextWriterWriteString -xmlTextWriterWriteVFormatAttribute -xmlTextWriterWriteVFormatAttributeNS -xmlTextWriterWriteVFormatCDATA -xmlTextWriterWriteVFormatComment -xmlTextWriterWriteVFormatDTD -xmlTextWriterWriteVFormatDTDAttlist -xmlTextWriterWriteVFormatDTDElement -xmlTextWriterWriteVFormatDTDInternalEntity -xmlTextWriterWriteVFormatElement -xmlTextWriterWriteVFormatElementNS -xmlTextWriterWriteVFormatPI -xmlTextWriterWriteVFormatRaw -xmlTextWriterWriteVFormatString -xmlThrDefBufferAllocScheme -xmlThrDefDefaultBufferSize -xmlThrDefDeregisterNodeDefault -xmlThrDefDoValidityCheckingDefaultValue -xmlThrDefGetWarningsDefaultValue -xmlThrDefIndentTreeOutput -xmlThrDefKeepBlanksDefaultValue -xmlThrDefLineNumbersDefaultValue -xmlThrDefLoadExtDtdDefaultValue -xmlThrDefParserDebugEntities -xmlThrDefPedanticParserDefaultValue -xmlThrDefRegisterNodeDefault -xmlThrDefSaveNoEmptyTags -xmlThrDefSetGenericErrorFunc -xmlThrDefSetStructuredErrorFunc -xmlThrDefSubstituteEntitiesDefaultValue -xmlThrDefTreeIndentString -xmlUCSIsAegeanNumbers -xmlUCSIsAlphabeticPresentationForms -xmlUCSIsArabic -xmlUCSIsArabicPresentationFormsA -xmlUCSIsArabicPresentationFormsB -xmlUCSIsArmenian -xmlUCSIsArrows -xmlUCSIsBasicLatin -xmlUCSIsBengali -xmlUCSIsBlock -xmlUCSIsBlockElements -xmlUCSIsBopomofo -xmlUCSIsBopomofoExtended -xmlUCSIsBoxDrawing -xmlUCSIsBraillePatterns -xmlUCSIsBuhid -xmlUCSIsByzantineMusicalSymbols -xmlUCSIsCJKCompatibility -xmlUCSIsCJKCompatibilityForms -xmlUCSIsCJKCompatibilityIdeographs -xmlUCSIsCJKCompatibilityIdeographsSupplement -xmlUCSIsCJKRadicalsSupplement -xmlUCSIsCJKSymbolsandPunctuation -xmlUCSIsCJKUnifiedIdeographs -xmlUCSIsCJKUnifiedIdeographsExtensionA -xmlUCSIsCJKUnifiedIdeographsExtensionB -xmlUCSIsCat -xmlUCSIsCatC -xmlUCSIsCatCc -xmlUCSIsCatCf -xmlUCSIsCatCo -xmlUCSIsCatCs -xmlUCSIsCatL -xmlUCSIsCatLl -xmlUCSIsCatLm -xmlUCSIsCatLo -xmlUCSIsCatLt -xmlUCSIsCatLu -xmlUCSIsCatM -xmlUCSIsCatMc -xmlUCSIsCatMe -xmlUCSIsCatMn -xmlUCSIsCatN -xmlUCSIsCatNd -xmlUCSIsCatNl -xmlUCSIsCatNo -xmlUCSIsCatP -xmlUCSIsCatPc -xmlUCSIsCatPd -xmlUCSIsCatPe -xmlUCSIsCatPf -xmlUCSIsCatPi -xmlUCSIsCatPo -xmlUCSIsCatPs -xmlUCSIsCatS -xmlUCSIsCatSc -xmlUCSIsCatSk -xmlUCSIsCatSm -xmlUCSIsCatSo -xmlUCSIsCatZ -xmlUCSIsCatZl -xmlUCSIsCatZp -xmlUCSIsCatZs -xmlUCSIsCherokee -xmlUCSIsCombiningDiacriticalMarks -xmlUCSIsCombiningDiacriticalMarksforSymbols -xmlUCSIsCombiningHalfMarks -xmlUCSIsCombiningMarksforSymbols -xmlUCSIsControlPictures -xmlUCSIsCurrencySymbols -xmlUCSIsCypriotSyllabary -xmlUCSIsCyrillic -xmlUCSIsCyrillicSupplement -xmlUCSIsDeseret -xmlUCSIsDevanagari -xmlUCSIsDingbats -xmlUCSIsEnclosedAlphanumerics -xmlUCSIsEnclosedCJKLettersandMonths -xmlUCSIsEthiopic -xmlUCSIsGeneralPunctuation -xmlUCSIsGeometricShapes -xmlUCSIsGeorgian -xmlUCSIsGothic -xmlUCSIsGreek -xmlUCSIsGreekExtended -xmlUCSIsGreekandCoptic -xmlUCSIsGujarati -xmlUCSIsGurmukhi -xmlUCSIsHalfwidthandFullwidthForms -xmlUCSIsHangulCompatibilityJamo -xmlUCSIsHangulJamo -xmlUCSIsHangulSyllables -xmlUCSIsHanunoo -xmlUCSIsHebrew -xmlUCSIsHighPrivateUseSurrogates -xmlUCSIsHighSurrogates -xmlUCSIsHiragana -xmlUCSIsIPAExtensions -xmlUCSIsIdeographicDescriptionCharacters -xmlUCSIsKanbun -xmlUCSIsKangxiRadicals -xmlUCSIsKannada -xmlUCSIsKatakana -xmlUCSIsKatakanaPhoneticExtensions -xmlUCSIsKhmer -xmlUCSIsKhmerSymbols -xmlUCSIsLao -xmlUCSIsLatin1Supplement -xmlUCSIsLatinExtendedA -xmlUCSIsLatinExtendedAdditional -xmlUCSIsLatinExtendedB -xmlUCSIsLetterlikeSymbols -xmlUCSIsLimbu -xmlUCSIsLinearBIdeograms -xmlUCSIsLinearBSyllabary -xmlUCSIsLowSurrogates -xmlUCSIsMalayalam -xmlUCSIsMathematicalAlphanumericSymbols -xmlUCSIsMathematicalOperators -xmlUCSIsMiscellaneousMathematicalSymbolsA -xmlUCSIsMiscellaneousMathematicalSymbolsB -xmlUCSIsMiscellaneousSymbols -xmlUCSIsMiscellaneousSymbolsandArrows -xmlUCSIsMiscellaneousTechnical -xmlUCSIsMongolian -xmlUCSIsMusicalSymbols -xmlUCSIsMyanmar -xmlUCSIsNumberForms -xmlUCSIsOgham -xmlUCSIsOldItalic -xmlUCSIsOpticalCharacterRecognition -xmlUCSIsOriya -xmlUCSIsOsmanya -xmlUCSIsPhoneticExtensions -xmlUCSIsPrivateUse -xmlUCSIsPrivateUseArea -xmlUCSIsRunic -xmlUCSIsShavian -xmlUCSIsSinhala -xmlUCSIsSmallFormVariants -xmlUCSIsSpacingModifierLetters -xmlUCSIsSpecials -xmlUCSIsSuperscriptsandSubscripts -xmlUCSIsSupplementalArrowsA -xmlUCSIsSupplementalArrowsB -xmlUCSIsSupplementalMathematicalOperators -xmlUCSIsSupplementaryPrivateUseAreaA -xmlUCSIsSupplementaryPrivateUseAreaB -xmlUCSIsSyriac -xmlUCSIsTagalog -xmlUCSIsTagbanwa -xmlUCSIsTags -xmlUCSIsTaiLe -xmlUCSIsTaiXuanJingSymbols -xmlUCSIsTamil -xmlUCSIsTelugu -xmlUCSIsThaana -xmlUCSIsThai -xmlUCSIsTibetan -xmlUCSIsUgaritic -xmlUCSIsUnifiedCanadianAboriginalSyllabics -xmlUCSIsVariationSelectors -xmlUCSIsVariationSelectorsSupplement -xmlUCSIsYiRadicals -xmlUCSIsYiSyllables -xmlUCSIsYijingHexagramSymbols -xmlURIEscape -xmlURIEscapeStr -xmlURIUnescapeString -xmlUTF8Charcmp -xmlUTF8Size -xmlUTF8Strlen -xmlUTF8Strloc -xmlUTF8Strndup -xmlUTF8Strpos -xmlUTF8Strsize -xmlUTF8Strsub -xmlUnlinkNode -xmlUnlockLibrary -xmlUnsetNsProp -xmlUnsetProp -xmlValidBuildContentModel -xmlValidCtxtNormalizeAttributeValue -xmlValidGetPotentialChildren -xmlValidGetValidElements -xmlValidNormalizeAttributeValue -xmlValidateAttributeDecl -xmlValidateAttributeValue -xmlValidateDocument -xmlValidateDocumentFinal -xmlValidateDtd -xmlValidateDtdFinal -xmlValidateElement -xmlValidateElementDecl -xmlValidateNCName -xmlValidateNMToken -xmlValidateName -xmlValidateNameValue -xmlValidateNamesValue -xmlValidateNmtokenValue -xmlValidateNmtokensValue -xmlValidateNotationDecl -xmlValidateNotationUse -xmlValidateOneAttribute -xmlValidateOneElement -xmlValidateOneNamespace -xmlValidatePopElement -xmlValidatePushCData -xmlValidatePushElement -xmlValidateQName -xmlValidateRoot -xmlXIncludeFreeContext -xmlXIncludeNewContext -xmlXIncludeProcess -xmlXIncludeProcessFlags -xmlXIncludeProcessNode -xmlXIncludeProcessTree -xmlXIncludeProcessTreeFlags -xmlXIncludeSetFlags -xmlXPathAddValues -xmlXPathBooleanFunction -xmlXPathCastBooleanToNumber -xmlXPathCastBooleanToString -xmlXPathCastNodeSetToBoolean -xmlXPathCastNodeSetToNumber -xmlXPathCastNodeSetToString -xmlXPathCastNodeToNumber -xmlXPathCastNodeToString -xmlXPathCastNumberToBoolean -xmlXPathCastNumberToString -xmlXPathCastStringToBoolean -xmlXPathCastStringToNumber -xmlXPathCastToBoolean -xmlXPathCastToNumber -xmlXPathCastToString -xmlXPathCeilingFunction -xmlXPathCmpNodes -xmlXPathCtxtCompile -xmlXPathCompareValues -xmlXPathCompile -xmlXPathCompiledEval -xmlXPathConcatFunction -xmlXPathContainsFunction -xmlXPathConvertBoolean -xmlXPathConvertNumber -xmlXPathConvertString -xmlXPathCountFunction -xmlXPathCtxtCompile -xmlXPathDebugDumpCompExpr -xmlXPathDebugDumpObject -xmlXPathDifference -xmlXPathDistinct -xmlXPathDistinctSorted -xmlXPathDivValues -xmlXPathEqualValues -xmlXPathErr -xmlXPathEval -xmlXPathEvalExpr -xmlXPathEvalExpression -xmlXPathEvalPredicate -xmlXPathEvaluatePredicateResult -xmlXPathFalseFunction -xmlXPathFloorFunction -xmlXPathFreeCompExpr -xmlXPathFreeContext -xmlXPathFreeNodeSet -xmlXPathFreeNodeSetList -xmlXPathFreeObject -xmlXPathFreeParserContext -xmlXPathFunctionLookup -xmlXPathFunctionLookupNS -xmlXPathHasSameNodes -xmlXPathIdFunction -xmlXPathInit -xmlXPathIntersection -xmlXPathIsInf -xmlXPathIsNaN -xmlXPathIsNodeType -xmlXPathLangFunction -xmlXPathLastFunction -xmlXPathLeading -xmlXPathLeadingSorted -xmlXPathLocalNameFunction -xmlXPathModValues -xmlXPathMultValues -xmlXPathNamespaceURIFunction -xmlXPathNewBoolean -xmlXPathNewCString -xmlXPathNewContext -xmlXPathNewFloat -xmlXPathNewNodeSet -xmlXPathNewNodeSetList -xmlXPathNewParserContext -xmlXPathNewString -xmlXPathNewValueTree -xmlXPathNextAncestor -xmlXPathNextAncestorOrSelf -xmlXPathNextAttribute -xmlXPathNextChild -xmlXPathNextDescendant -xmlXPathNextDescendantOrSelf -xmlXPathNextFollowing -xmlXPathNextFollowingSibling -xmlXPathNextNamespace -xmlXPathNextParent -xmlXPathNextPreceding -xmlXPathNextPrecedingSibling -xmlXPathNextSelf -xmlXPathNodeLeading -xmlXPathNodeLeadingSorted -xmlXPathNodeSetAdd -xmlXPathNodeSetAddNs -xmlXPathNodeSetAddUnique -xmlXPathNodeSetContains -xmlXPathNodeSetCreate -xmlXPathNodeSetDel -xmlXPathNodeSetFreeNs -xmlXPathNodeSetMerge -xmlXPathNodeSetRemove -xmlXPathNodeSetSort -xmlXPathNodeTrailing -xmlXPathNodeTrailingSorted -xmlXPathNormalizeFunction -xmlXPathNotEqualValues -xmlXPathNotFunction -xmlXPathNsLookup -xmlXPathNumberFunction -xmlXPathObjectCopy -xmlXPathOrderDocElems -xmlXPathParseNCName -xmlXPathParseName -xmlXPathPopBoolean -xmlXPathPopExternal -xmlXPathPopNodeSet -xmlXPathPopNumber -xmlXPathPopString -xmlXPathPositionFunction -xmlXPathRegisterAllFunctions -xmlXPathRegisterFunc -xmlXPathRegisterFuncLookup -xmlXPathRegisterFuncNS -xmlXPathRegisterNs -xmlXPathRegisterVariable -xmlXPathRegisterVariableLookup -xmlXPathRegisterVariableNS -xmlXPathRegisteredFuncsCleanup -xmlXPathRegisteredNsCleanup -xmlXPathRegisteredVariablesCleanup -xmlXPathRoot -xmlXPathRoundFunction -xmlXPathStartsWithFunction -xmlXPathStringEvalNumber -xmlXPathStringFunction -xmlXPathStringLengthFunction -xmlXPathSubValues -xmlXPathSubstringAfterFunction -xmlXPathSubstringBeforeFunction -xmlXPathSubstringFunction -xmlXPathSumFunction -xmlXPathTrailing -xmlXPathTrailingSorted -xmlXPathTranslateFunction -xmlXPathTrueFunction -xmlXPathValueFlipSign -xmlXPathVariableLookup -xmlXPathVariableLookupNS -xmlXPathWrapCString -xmlXPathWrapExternal -xmlXPathWrapNodeSet -xmlXPathWrapString -xmlXPathErr -xmlXPatherror -xmlXPtrBuildNodeList -xmlXPtrEval -xmlXPtrEvalRangePredicate -xmlXPtrFreeLocationSet -xmlXPtrLocationSetAdd -xmlXPtrLocationSetCreate -xmlXPtrLocationSetDel -xmlXPtrLocationSetMerge -xmlXPtrLocationSetRemove -xmlXPtrNewCollapsedRange -xmlXPtrNewContext -xmlXPtrNewLocationSetNodeSet -xmlXPtrNewLocationSetNodes -xmlXPtrNewRange -xmlXPtrNewRangeNodeObject -xmlXPtrNewRangeNodePoint -xmlXPtrNewRangeNodes -xmlXPtrNewRangePointNode -xmlXPtrNewRangePoints -xmlXPtrRangeToFunction -xmlXPtrWrapLocationSet -xmlNewTextWriter -xmlNewTextWriterDoc -xmlNewTextWriterFilename -xmlNewTextWriterMemory -xmlNewTextWriterPushParser -xmlNewTextWriterTree -xmlFreeTextWriter -xmlTextWriterEndAttribute -xmlTextWriterEndCDATA -xmlTextWriterEndComment -xmlTextWriterEndDTD -xmlTextWriterEndDTDAttlist -xmlTextWriterEndDTDElement -xmlTextWriterEndDTDEntity -xmlTextWriterEndDocument -xmlTextWriterEndElement -xmlTextWriterEndPI -xmlTextWriterFlush -xmlTextWriterFullEndElement -xmlTextWriterSetIndent -xmlTextWriterSetIndentString -xmlTextWriterStartAttribute -xmlTextWriterStartAttributeNS -xmlTextWriterStartCDATA -xmlTextWriterStartComment -xmlTextWriterStartDTD -xmlTextWriterStartDTDAttlist -xmlTextWriterStartDTDElement -xmlTextWriterStartDTDEntity -xmlTextWriterStartDocument -xmlTextWriterStartElement -xmlTextWriterStartElementNS -xmlTextWriterStartPI -xmlTextWriterWriteAttribute -xmlTextWriterWriteAttributeNS -xmlTextWriterWriteBase64 -xmlTextWriterWriteBinHex -xmlTextWriterWriteCDATA -xmlTextWriterWriteComment -xmlTextWriterWriteDTD -xmlTextWriterWriteDTDAttlist -xmlTextWriterWriteDTDElement -xmlTextWriterWriteDTDEntity -xmlTextWriterWriteDTDExternalEntity -xmlTextWriterWriteDTDExternalEntityContents -xmlTextWriterWriteDTDInternalEntity -xmlTextWriterWriteDTDNotation -xmlTextWriterWriteElement -xmlTextWriterWriteElementNS -xmlTextWriterWriteFormatAttribute -xmlTextWriterWriteFormatAttributeNS -xmlTextWriterWriteFormatCDATA -xmlTextWriterWriteFormatComment -xmlTextWriterWriteFormatDTD -xmlTextWriterWriteFormatDTDAttlist -xmlTextWriterWriteFormatDTDElement -xmlTextWriterWriteFormatDTDInternalEntity -xmlTextWriterWriteFormatElement -xmlTextWriterWriteFormatElementNS -xmlTextWriterWriteFormatPI -xmlTextWriterWriteFormatRaw -xmlTextWriterWriteFormatString -xmlTextWriterWritePI -xmlTextWriterWriteRaw -xmlTextWriterWriteRawLen -xmlTextWriterWriteString diff --git a/ext/mbstring/CREDITS b/ext/mbstring/CREDITS deleted file mode 100644 index d03463b3d225b..0000000000000 --- a/ext/mbstring/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Multibyte String Functions -Tsukada Takuya, Rui Hirokawa diff --git a/ext/mbstring/README b/ext/mbstring/README deleted file mode 100644 index 338aa79fcd022..0000000000000 --- a/ext/mbstring/README +++ /dev/null @@ -1,17 +0,0 @@ -!!Caution: DO NOT ADD/CHANGE MBSTRING CODE!! - -New mbstring is under development, anyone who would like -add new feature/change behavior should access to development -source. - -http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/ - -All changes made after 2002/5/19 are subject to be -removed. - -You are warned in php-dev and php-cvs lists many times -already. If you are curious, search archive for details. - -Thank you. - - diff --git a/ext/mbstring/README.libmbfl b/ext/mbstring/README.libmbfl deleted file mode 100644 index 4f1174e2f7401..0000000000000 --- a/ext/mbstring/README.libmbfl +++ /dev/null @@ -1,16 +0,0 @@ - -libmbfl is a streamable multibyte character code filter and -converter library. -libmbfl is distributed under LGPL 2.1 and bundled with PHP. - -The original version of libmbfl is developed and distributed -at http://sourceforge.jp/project/php-i18n/ . - -If you need to modify the bundled libmbfl, the change also have to be applied for -the libmbfl on sourceforge.jp. - -If you have question about libmbfl, please ask to - hirokawa@php.net, moriyoshi@php.net. - -See libmbfl/DISCLAIMER for licensing information of libmbfl. - diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja deleted file mode 100644 index cac00b82a1ad4..0000000000000 --- a/ext/mbstring/README_PHP3-i18n-ja +++ /dev/null @@ -1,774 +0,0 @@ -========================================== - README for I18N Package -========================================== - -o Name and location of package - -Name: php-3.0.18-i18n-ja-2 -Location: http://www.happysize.co.jp/techie/php-ja-jp/ - ftp://ftp.happysize.co.jp/php-ja-jp/ - http://php.vdomains.org/ - ftp://ftp.vdomains.org/pub/php-ja-jp/ - http://php.jpnnet.com/ - -Currently, this I18N version of PHP only adds Japanese support to base -PHP. It allows you to use Japanese in scripts, as well as conversion -between various Japanese encodings. It will work perfectly fine with -ASCII with i18n option enabled. (note: executable is bit larger due -to UNICODE table). The basic design aproach is to allow for other -languages to be added in the future. Developers are encourage to join -us! - -For more information on Japanese encodings, please refer to the -section "Additional Notes." - - -o What is this package? - -This package allows you to handle multiple Japanese encodings (SJIS, EUC, -UTF-8, JIS) in PHP. If you find any bugs in this package, please report -them to the appropriate mailing list. For now, the PHP-jp mailing list -is the best place for this. - -PHP-jp ML mailto:PHP-jp@sidecar.ics.es.osaka-u.ac.jp - http://sidecar.ics.es.osaka-u.ac.jp/php-jp/ - (discussions are in Japanese) - - -o Who should use this - -Due to lack of documentation, it's not intended for beginners. If -something goes wrong, be prepared to fix it on your own. - - -o Warranty and Copyright - -There is no warranty with this package. Use it at your own risk. - -Please refer to the source code for the copyrights. In general, each -program's copyright is owned by the programmer. Unless you obey the -copyright holders restrictions, you are not allowed to use it in any -form. - - -o Redistribution - -As described in the source code, this package and the components are -allowed to be redistributed with certain restrictions. - -Due to this package being still in beta, please try to redistribute -it as an entire package. Please try not to distribute it as a form -of patch. Because we would prefer to have this package distributed -as one single package (not patch of patch of patch), avoid releasing -any patch to this package. - - -o Who made this - -A team of volunteers, PHP3 Internationalization, has been contributing -their free time producing it. Although we are not related to the core -PHP programmers, we are hoping to have our modifications merged into the -core distribution in the near future. Thus, we did not call this a -"Japanese Patch" (or distribution). Our final goal is to have true -i18nized PHP! - -For anyone interested in this project, please drop us a line. - -Contact Address: - phpj-dev@kage.net - (Discussions are in Japanese, but feel free to write us in English) - -Webpage (English and Japanese): - http://php.jpnnet.com/ - -Project Outline (Japanese): - http://www.happysize.co.jp/techie/php-ja-jp/spec.htm - -Developers: - Hironori Sato - Shigeru Kanemoto - Tsukada Takuya - U. Kenkichi - Tateyama - Other gracious contributors - - -o Future plans - -- fulfilling what's written in outline -- support for other languages other than Japanese -- make the character conversion as a library (?) -- more testing - - -o Special Thanks to - -PHP Japanese webpage maintainer, Hirokawa-san - http://www.cityfujisawa.ne.jp/%7Elouis/apps/phpfi/ -PHP-JP ML's Yamamoto-san - http://sidecar.ics.es.osaka-u.ac.jp/php-jp/ -Previous jp-patch developers - - - -========================================== - Advantages of using I18N package -========================================== - -- allows you to use various character encodings for script files and - http output -- distinguish character encoding in POST/GET/COOKIE -- proper mail output using JIS as body and MIME/Base64/JIS subject -- if http output's Content-Type is text/html, it will set proper charset -- stable character encoding conversion -- multibyte regex - - - -========================================== - Installation -========================================== - -o Summary - -Add --enable-i18n option when running configure. For your own setup, -add any other appropriate options as well. - -Don't forget to copy php3.ini-dist to desired location. -(ex. /usr/local/lib/php3.ini) - -If you have already installed PHP3, copy all the entries in php3.ini-dist -which start with "i18n.xxxx" to php3.ini. - - -o configure option - --enable-i18n - include i18n features - - --enable-mbregex - include multibyte regex library - (without i18n enabled, mbregex functions will not function) - - -o creating cgi version - - % tar xvzf php-3.0.18-i18n-ja-2.tar.gz - % cd php-3.0.18-i18n-ja-2 - % ./configure --enable-i18n --enable-mbregex - % make - - -o creating Apache version (regular module) - - % tar xvzf php-3.0.18-i18n-ja-2.tar.gz - % tar xvzf apache_1.3.x.tar.gz - % cd apache_1.3.x - % ./configure - % cd ../php-3.0.18-i18n-ja-2 - % ./configure --with-apache=../apache_1.3.x --enable-i18n --enable-mbregex - % make - % make install - % cd ../apache_1.3.x - % ./configure --activate-module=src/modules/php3/libphp3.a - % make - % make install - - -o creating Apache DSO version - - create DSO capable Apache first - % tar xvzf apache_1.3.x.tar.gz - % cd apache-1.3.x - % ./configure --enable-shared=max - % make - % make install - - now create php3 - % cd php-3.0.18-i18n-ja-2 - % ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-i18n \ - --enable-mbregex - % make - % make install - - -========================================== - Additional Notes -========================================== - -o Multibyte regex library - -From beta4, we have included the multibyte (mb) regex library which comes with -Ruby. With this addition, you can now use regex in EUC, SJIS and UTF-8 -encoding. To avoid any conflicts with HSREGEX included with Apache, -each function name has been changed. Therefore, mb regex functions are -named differently from the original ereg functions in PHP. The character -encoding used in mb regex is configured in i18n.internal_encoding. - - -o Binary Output - -If http output encoding is set to other than 'pass', conversion of encoding -from internal encoding to http output is done automatically. Thus, -if you prefer to spit out anything in raw binary format, your data -may be corrupted. In such event, set http_output to 'pass'. - -ex. - - - -o Content-Type - -Depending on the setting of http_output, PHP will output the proper charset. -ex. Content-Type: text/html; charset="..." - -Be aware of following: - -- If you set Content-Type header using header() function, that will - override the automatic addition of charset. -- Be cautious when you set i18n_http_output, since if any output is - made prior to this, proper header may have been sent out to the - client already. - - -o In the event of trouble - -If you find any bugs or trouble, please contact us at the above address. -It may help us to track the problem if you send us the script as well. - -If you encounter any memory related error such as segmentation violation, -add --enable-debug when you run configure. This will give you more -detail information on where error has occurred. The error is stored -in the server log or regular http output in CGI mode. - - -o About Japanese encodings - -Due to historical reason, there are multiple character encodings used -for Japanese. The most common encodings are: SJIS, EUC, JIS, and UTF-8. -Here are (very) brief description of them: - -EUC - commonly used in UNIX environment - 8bit-8bit combo - always >=0x80 - -SJIS - commonly used in Mac or PCs - similar to EUC - mostly 8bit-8bit (some 8bit-7bit) - mostly >=0x80 - there are some halfwidth (size of ASCII) multibytes - -JIS - commonly used in 7bit environment (nntp and smtp) - starts with escaping char, \033 and a few more characters - -UTF-8 - 16bit+ encoding - defines many languages existing in this world - see http://www.unicode.org/ for more detail - -Because of having all these character encodings, PHP needs to translate -between these encodings on the fly. Also, the addition of the mb regex -library allows you to handle mb strings without fear of getting mb char -chopped in half. - -Since Japanese is not the only language with multiple encodings, we -encourage other developers to modify our code to suit your needs. We -definitely need people to work with Korean, Chinese (both traditional -and simplified), and Russian. Let us know if you are interested in -this project! - - - -========================================== - php3.ini setting -========================================== - -The following init options will allow you to change the default settings. -Define these settings in the global section of php3.ini. - -All keywords are case-insensitive. - -o Encoding naming - - For each encoding, there are three names: standarized, alias, MIME - - - UTF-8 - standard: UTF-8 - alias: N/A - mime: UTF-8 - - - ASCII - standard: ASCII - alias: N/A - mime: US-ASCII - - - Japanese EUC - standard: EUC-JP - alias: EUC, EUC_JP, eucJP, x-euc-jp - mime: EUC-JP - - - Shift JIS - standard: SJIS - alias: x-sjis, MS_Kanji - mime: Shift_JIS - - - JIS - standard: JIS - alias: N/A - mime: ISO-2022-JP - - - Quoted-Printable - standard: Quoted-Printable - alias: qprint - mime: N/A - - - BASE64 - standard: BASE64 - alias: N/A - mime: N/A - - - no conversion - standard: pass - alias: none - mime: N/A - - - auto encoding detection - standard: auto - alias: unknown - mime: N/A - - * N/A - Not Applicapable - -o i18n.http_output - default http output encoding - - i18n.http_output = EUC-JP|SJIS|JIS|UTF-8|pass - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - pass: no conversion - - The default is pass (internal encoding is used) - It can be re-configured on the fly using i18n_http_output(). - - -o i18n.internal_encoding - internal encoding - - i18n.internal_encoding = EUC-JP|SJIS|UTF-8 - EUC-JP : EUC - SJIS: SJIS - UTF-8: UTF-8 - - The default is EUC-JP. - - PHP parser is designed based on using ISO-8859-1. For other - encodings, following conditions have to be satisfied in order - to use them: - - per byte encoding - - single byte charactor in range of 00h-7fh which is compatible - with ASCII - - multibyte without 00h-7fh - In case of Japanese, EUC-JP and UTF-8 are the only encoding that - meets this criteria. - - If i18n.internal_encoding and i18n.http_output differs, conversion - takes place at the time of output. If you convert any data within - PHP scripts to URL encoding, BASE64 or Quoted-Printable, encoding - stays as defined in i18n.internal_encoding. Thus, if you would - prefer to encode in compliance with i18n.http_output, you need - to manually convert encoding. - - ex. $str = urlencode( i18n_convert($str, i18n_http_output()) ); - - Encoding such as ISO-2022-** and HZ encoding which uses escape - sequences can not be used as internal encoding. If used, they - result in following errors: - - parser pukes funky error - - magic_quotes_*** breaks encoding (SJIS may have similar problem) - - string manipulation and regex will malfunction - - -o i18n.script_encoding - script encoding - - i18n.script_encoding = auto|EUC-JP|SJIS|JIS|UTF-8 - auto: automatic - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - The default is auto. - The script's encoding is converted to i18n.internal_encoding before - entering the script parser. - - Be aware that auto detection may fail under some conditions. - For best auto detection, add multibyte charactor at begining of - script. - - -o i18n.http_input - handling of http input (GET/POST/COOKIE) - - i18n.http_input = pass|auto - auto: auto conversion - pass: no conversion - - The default is auto. - If set to pass, no conversion will take place. - If set to auto, it will automatically detect the encoding. If - detection is successful, it will convert to the proper internal - encoding. If not, it will assume the input as defined in - i18n.http_input_default. - -o i18n.http_input_default - default http input encoding - - i18n.http_input_default = pass|EUC-JP|SJIS|JIS|UTF-8 - pass: no conversion - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - The default is pass. - This option is only effective as long as i18n.http_input is set to - auto. If the auto detection fails, this encoding is used as an - assumption to convert the http input to the internal encoding. - If set to pass, no conversion will take place. - -o sample settings - - 1) For most flexibility, we recommend using following example. - i18n.http_output = SJIS - i18n.internal_encoding = EUC-JP - i18n.script_encoding = auto - i18n.http_input = auto - i18n.http_input_default = SJIS - - 2) To avoid unexpected encoding problems, try these: - - i18n.http_output = pass - i18n.internal_encoding = EUC-JP - i18n.script_encoding = pass - i18n.http_input = pass - i18n.http_input_default = pass - - - -========================================== - PHP functions -========================================== - -The following describes the additional PHP functions. - -All keywords are case-insensitive. - -o i18n_http_output(encoding) -o encoding = i18n_http_output() - - This will set the http output encoding. Any output following this - function will be controlled by this function. If no argument is given, - the current http output encode setting is returned. - - encodings - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - pass: no conversion - - NONE is not allowed - - -o encoding = i18n_internal_encoding() - - Returns the current internal encoding as a string. - - internal encoding - EUC-JP : EUC - SJIS: SJIS - UTF-8: UTF-8 - - -o encoding = i18n_http_input() - - Returns http input encoding. - - encodings - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - pass: no conversion (only if i18n.http_input is set to pass) - - -o string = i18n_convert(string, encoding) - string = i18n_convert(string, encoding, pre-conversion-encoding) - - Returns converted string in desired encoding. If - pre-conversion-encoding is not defined, the given - string is assumed to be in internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - pass: no conversion - - pre-conversion-encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - pass: no conversion - auto: auto detection - - -o encoding = i18n_discover_encoding(string) - - Encoding of the given string is returned (as a string). - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - ASCII: ASCII (only 09h, 0Ah, 0Dh, 20h-7Eh) - pass: unable to determine (text is too short to determine) - unknown: unknown or possible error - - -o int = mbstrlen(string) -o int = mbstrlen(string, encoding) - - Returns character length of a given string. If no encoding is defined, - the encoding of string is assumed to be the internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - auto: automatic - - -o int = mbstrpos(string1, string2) -o int = mbstrpos(string1, string2, start) -o int = mbstrpos(string1, string2, start, encoding) - - Same as strpos. If no encoding is defined, the encoding of string - is assumed to be the internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - -o int = mbstrrpos(string1, string2) -o int = mbstrrpos(string1, string2, encoding) - - Same as strrpos. If no encoding is defined, the encoding of string - is assumed to be the internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - -o string = mbsubstr(string, position) -o string = mbsubstr(string, position, length) -o string = mbsubstr(string, position, length, encoding) - - Same as substr. If no encoding is defined, the encoding of string - is assumed to be the internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - -o string = mbstrcut(string, position) -o string = mbstrcut(string, position, length) -o string = mbstrcut(string, position, length, encoding) - - Same as subcut. If position is the 2nd byte of a mb character, it will cut - from the first byte of that character. It will cut the string without - chopping a single byte from a mb character. In another words, if you - set length to 5, you will only get two mb characters. If no encoding - is defined, the encoding of string is assumed to be the internal encoding. - - encoding - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - -o string = i18n_mime_header_encode(string) - MIME encode the string in the format of =?ISO-2022-JP?B?[string]?=. - - -o string = i18n_mime_header_decode(string) - MIME decodes the string. - - -o string = i18n_ja_jp_hantozen(string) -o string = i18n_ja_jp_hantozen(string, option) -o string = i18n_ja_jp_hantozen(string, option, encoding) - - Conversion between full width character and halfwidth character. - - option - The following options are allowed. The default is "KV". - Acronym: FW = fullwidth, HW = halfwidth - - "r" : FW alphabet -> HW alphabet - - "R" : HW alphabet -> FW alphabet - - "n" : FW number -> HW number - - "N" : HW number -> FW number - - "a" : FW alpha numeric (21h-7Eh) -> HW alpha numeric - - "A" : HW alpha numeric (21h-7Eh) -> FW alpha numeric - - "k" : FW katakana -> HW katakana - - "K" : HW katakana -> FW katakana - - "h" : FW hiragana -> HW hiragana - - "H" : HW hiragana -> FW katakana - - "c" : FW katakana -> FW hiragana - - "C" : FW hiragana -> FW katakana - - "V" : merge dakuon character. only works with "K" and "H" option - - encoding - If no encoding is defined, the encoding of string is assumed to be - the internal encoding. - EUC-JP : EUC - SJIS: SJIS - JIS : JIS - UTF-8: UTF-8 - - -int = mbereg(regex_pattern, string, string) -int = mberegi(regex_pattern, string, string) - mb version of ereg() and eregi() - - -string = mbereg_replace(regex_pattern, string, string) -string = mberegi_replace(regex_pattern, string, string) - mb version of ereg_replace() and eregi_replace() - - -string_array = mbsplit(regex, string, limit) - mb version of split() - - - -========================================== - FAQ -========================================== - -Here, we have gathered some commonly asked questions on PHP-jp mailing -list. - -o To use Japanese in GET method - -If you need to assign Japanese text in GET method with argument, such as; -xxxx.php?data=, use urlencode function in PHP. If not, -text may not be passed onto action php properly. - -ex: Link - - -o When passing data via GET/POST/COOKIE, \ character sneaks in - -When using SJIS as internal encoding, or passed-on data includes '"\, -PHP automatically inserts escaping character, \. Set magic_quotes_gpc -in php3.ini from On to Off. An alternative work around to this problem -is to use StripSlashes(). - -If $quote_str is in SJIS and you would like to extract Japanese text, -use ereg_replace as follows: - -ereg_replace(sprintf("([%c-%c%c-%c]\\\\)\\\\",0x81,0x9f,0xe0,0xfc), - "\\1",$quote_str); - -This will effectively extract Japanese text out of $quote_str. - - -o Sometimes, encoding detection fails - -If i18n_http_input() returns 'pass', it's likely that PHP failed to -detect whether it's SJIS or EUC. In such case, use to properly detect the incoming text's -encoding. - - - -========================================== - Japanese Manual -========================================== -Translated manual done by "PHP Japanese Manual Project" : - -http://www.php.net/manual/ja/manual.php - -Starting 3.0.18-i18n-ja, we have removed doc-jp from tarball package. - - -========================================== - Change Logs -========================================== - -o 2000-10-28, Rui Hirokawa - -This patch is derived from php-3.0.15-i18n-ja as well as php-3.0.16 by -Kuwamura applied to original php-3.0.18. It also includes following fixes: - -1) allows you to set charset in mail(). -2) fixed mbregex definitions to avoid conflicts with system regex -3) php3.ini-dist now uses PASS for http_output instead of SJIS - -o 2000-11-24, Hironori Sato - -Applied above patched and added detection for gdImageStringTTF in configure. -Following setups are known to work: - -gd-1.3-6, gd-devel-1.3-6, freetype-1.3.1-5, freetype-devel-1.3.1-5 - ImageTTFText($im,$size,$angle,$x1,$y1,$color,"/path/to/font.ttf", - i18n_convert("ĈüËܸì", "UTF-8")); - ImageGif($im); - -gd-1.7.3-1k1, gd-devel-1.7.3-1k1, freetype-1.3.1-5, freetype-devel-1.3.1-5 - ImageTTFText($im,$size,$angle,$x1,$y1,$color,"/path/to/font.ttf","ĈüËܸì"); - ImagePng($im); - * i18n_internal_encoding = EUC Ëô¤Ï SJIS - -For any gd libraries before 1.6.2, you need to use i18n_convert. For -gd-1.5.2/3, upgrade to anything above 1.7 to use ImageTTFText without -using i18n_convert. As long as you have internal_encoding set to EUC or -SJIS, ImageTTFText should work without mojibake. Again, make sure you -have i18n_http_output("pass") before calling ImageGif, ImagePng, ImageJpeg! - -o 2000-12-09, Rui Hirokawa - -Fixed mail() which was causing segmentation fault when header was null. - diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4 deleted file mode 100644 index aefc7b55f048d..0000000000000 --- a/ext/mbstring/config.m4 +++ /dev/null @@ -1,285 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_MBSTRING_ADD_SOURCES], [ - PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES $1" -]) - -AC_DEFUN([PHP_MBSTRING_ADD_BASE_SOURCES], [ - PHP_MBSTRING_BASE_SOURCES="$PHP_MBSTRING_BASE_SOURCES $1" -]) - -AC_DEFUN([PHP_MBSTRING_ADD_BUILD_DIR], [ - PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS $1" -]) - -AC_DEFUN([PHP_MBSTRING_ADD_INCLUDE], [ - PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES $1" -]) - -AC_DEFUN([PHP_MBSTRING_ADD_CONFIG_HEADER], [ - PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS $1" -]) - -AC_DEFUN([PHP_MBSTRING_ADD_CFLAG], [ - PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS $1" -]) - -AC_DEFUN([PHP_MBSTRING_EXTENSION], [ - PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS) - PHP_SUBST(MBSTRING_SHARED_LIBADD) - - for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do - PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1) - done - - for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do - PHP_ADD_INCLUDE([$ext_srcdir/$dir]) - PHP_ADD_INCLUDE([$ext_builddir/$dir]) - done - - if test "$ext_shared" = "no"; then - PHP_ADD_SOURCES(PHP_EXT_DIR(mbstring), $PHP_MBSTRING_BASE_SOURCES) - out="php_config.h" - else - PHP_ADD_SOURCES_X(PHP_EXT_DIR(mbstring),$PHP_MBSTRING_BASE_SOURCES,,shared_objects_mbstring,yes) - if test -f "$ext_builddir/config.h.in"; then - out="$abs_builddir/config.h" - else - out="php_config.h" - fi - fi - - for cfg in $PHP_MBSTRING_EXTRA_CONFIG_HEADERS; do - cat > $ext_builddir/$cfg <], [ -int foo(int x, ...) { - va_list va; - va_start(va, x); - va_arg(va, int); - va_arg(va, char *); - va_arg(va, double); - return 0; -} -int main() { return foo(10, "", 3.14); } - ], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no]) - ]) - - AC_CHECK_HEADERS([stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h]) - AC_CHECK_SIZEOF(int, 4) - AC_CHECK_SIZEOF(short, 2) - AC_CHECK_SIZEOF(long, 4) - AC_C_CONST - AC_HEADER_TIME - AC_FUNC_ALLOCA - AC_FUNC_MEMCMP - - if test "$cv_php_mbstring_stdarg" = "yes"; then - AC_DEFINE([HAVE_STDARG_PROTOTYPES], 1, [Define if stdarg.h is available]) - fi - AC_DEFINE([HAVE_MBREGEX], 1, [whether to have multibyte regex support]) - - PHP_MBSTRING_ADD_CFLAG([-DNOT_RUBY]) - PHP_MBSTRING_ADD_BUILD_DIR([oniguruma]) - PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/enc]) - PHP_MBSTRING_ADD_INCLUDE([oniguruma]) - PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/config.h]) - - PHP_MBSTRING_ADD_BASE_SOURCES([php_mbregex.c]) - PHP_MBSTRING_ADD_SOURCES([ - oniguruma/regcomp.c - oniguruma/regerror.c - oniguruma/regexec.c - oniguruma/reggnu.c - oniguruma/regparse.c - oniguruma/regenc.c - oniguruma/regext.c - oniguruma/regsyntax.c - oniguruma/regtrav.c - oniguruma/regversion.c - oniguruma/st.c - oniguruma/enc/unicode.c - oniguruma/enc/ascii.c - oniguruma/enc/utf8.c - oniguruma/enc/euc_jp.c - oniguruma/enc/euc_tw.c - oniguruma/enc/euc_kr.c - oniguruma/enc/sjis.c - oniguruma/enc/iso8859_1.c - oniguruma/enc/iso8859_2.c - oniguruma/enc/iso8859_3.c - oniguruma/enc/iso8859_4.c - oniguruma/enc/iso8859_5.c - oniguruma/enc/iso8859_6.c - oniguruma/enc/iso8859_7.c - oniguruma/enc/iso8859_8.c - oniguruma/enc/iso8859_9.c - oniguruma/enc/iso8859_10.c - oniguruma/enc/iso8859_11.c - oniguruma/enc/iso8859_13.c - oniguruma/enc/iso8859_14.c - oniguruma/enc/iso8859_15.c - oniguruma/enc/iso8859_16.c - oniguruma/enc/koi8.c - oniguruma/enc/koi8_r.c - oniguruma/enc/big5.c - oniguruma/enc/utf16_be.c - oniguruma/enc/utf16_le.c - oniguruma/enc/utf32_be.c - oniguruma/enc/utf32_le.c - ]) - fi -]) - -AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [ - dnl libmbfl is required and can not be disabled - if test "$PHP_LIBMBFL" = "yes" || test "$PHP_LIBMBFL" = "no"; then - dnl - dnl Bundled libmbfl - dnl - PHP_MBSTRING_ADD_BUILD_DIR([libmbfl]) - PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/mbfl]) - PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/filters]) - PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/nls]) - PHP_MBSTRING_ADD_INCLUDE([libmbfl]) - PHP_MBSTRING_ADD_INCLUDE([libmbfl/mbfl]) - PHP_MBSTRING_ADD_CONFIG_HEADER([libmbfl/config.h]) - - PHP_MBSTRING_ADD_SOURCES([ - libmbfl/filters/html_entities.c - libmbfl/filters/mbfilter_7bit.c - libmbfl/filters/mbfilter_ascii.c - libmbfl/filters/mbfilter_base64.c - libmbfl/filters/mbfilter_big5.c - libmbfl/filters/mbfilter_byte2.c - libmbfl/filters/mbfilter_byte4.c - libmbfl/filters/mbfilter_cp1251.c - libmbfl/filters/mbfilter_cp1252.c - libmbfl/filters/mbfilter_cp866.c - libmbfl/filters/mbfilter_cp932.c - libmbfl/filters/mbfilter_cp936.c - libmbfl/filters/mbfilter_euc_cn.c - libmbfl/filters/mbfilter_euc_jp.c - libmbfl/filters/mbfilter_euc_jp_win.c - libmbfl/filters/mbfilter_euc_kr.c - libmbfl/filters/mbfilter_euc_tw.c - libmbfl/filters/mbfilter_htmlent.c - libmbfl/filters/mbfilter_hz.c - libmbfl/filters/mbfilter_iso2022_kr.c - libmbfl/filters/mbfilter_iso8859_1.c - libmbfl/filters/mbfilter_iso8859_10.c - libmbfl/filters/mbfilter_iso8859_13.c - libmbfl/filters/mbfilter_iso8859_14.c - libmbfl/filters/mbfilter_iso8859_15.c - libmbfl/filters/mbfilter_iso8859_16.c - libmbfl/filters/mbfilter_iso8859_2.c - libmbfl/filters/mbfilter_iso8859_3.c - libmbfl/filters/mbfilter_iso8859_4.c - libmbfl/filters/mbfilter_iso8859_5.c - libmbfl/filters/mbfilter_iso8859_6.c - libmbfl/filters/mbfilter_iso8859_7.c - libmbfl/filters/mbfilter_iso8859_8.c - libmbfl/filters/mbfilter_iso8859_9.c - libmbfl/filters/mbfilter_jis.c - libmbfl/filters/mbfilter_koi8r.c - libmbfl/filters/mbfilter_armscii8.c - libmbfl/filters/mbfilter_qprint.c - libmbfl/filters/mbfilter_sjis.c - libmbfl/filters/mbfilter_ucs2.c - libmbfl/filters/mbfilter_ucs4.c - libmbfl/filters/mbfilter_uhc.c - libmbfl/filters/mbfilter_utf16.c - libmbfl/filters/mbfilter_utf32.c - libmbfl/filters/mbfilter_utf7.c - libmbfl/filters/mbfilter_utf7imap.c - libmbfl/filters/mbfilter_utf8.c - libmbfl/filters/mbfilter_uuencode.c - libmbfl/mbfl/mbfilter.c - libmbfl/mbfl/mbfilter_8bit.c - libmbfl/mbfl/mbfilter_pass.c - libmbfl/mbfl/mbfilter_wchar.c - libmbfl/mbfl/mbfl_convert.c - libmbfl/mbfl/mbfl_encoding.c - libmbfl/mbfl/mbfl_filter_output.c - libmbfl/mbfl/mbfl_ident.c - libmbfl/mbfl/mbfl_language.c - libmbfl/mbfl/mbfl_memory_device.c - libmbfl/mbfl/mbfl_string.c - libmbfl/mbfl/mbfl_allocators.c - libmbfl/nls/nls_de.c - libmbfl/nls/nls_en.c - libmbfl/nls/nls_ja.c - libmbfl/nls/nls_kr.c - libmbfl/nls/nls_neutral.c - libmbfl/nls/nls_ru.c - libmbfl/nls/nls_uni.c - libmbfl/nls/nls_zh.c - libmbfl/nls/nls_hy.c - ]) - PHP_MBSTRING_ADD_CFLAG([-DHAVE_CONFIG_H]) - else - dnl - dnl External libmfl - dnl - for inc in include include/mbfl-1.0 include/mbfl; do - if test -f "$PHP_LIBMBFL/$inc/mbfilter.h"; then - PHP_LIBMBFL_INCLUDE="$inc" - break - fi - done - - if test -z "$PHP_LIBMBFL_INCLUDE"; then - AC_MSG_ERROR([mbfilter.h not found. Please reinstall libmbfl library.]) - else - PHP_ADD_INCLUDE([$PHP_LIBMBFL_INCLUDE]) - fi - - PHP_CHECK_LIBRARY(mbfl, mbfl_buffer_converter_new, [ - PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL/$PHP_LIBDIR, MBSTRING_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libmbfl. Please check config.log for more information.]) - ], [ - -LPHP_LIBMBFL/$PHP_LIBDIR - ]) - fi -]) - -dnl -dnl Main config -dnl - -PHP_ARG_ENABLE(mbstring, whether to enable multibyte string support, -[ --enable-mbstring Enable multibyte string support]) - -PHP_ARG_ENABLE([mbregex], [whether to enable multibyte regex support], -[ --disable-mbregex MBSTRING: Disable multibyte regex support], yes, no) - -PHP_ARG_WITH(libmbfl, [for external libmbfl], -[ --with-libmbfl[=DIR] MBSTRING: Use external libmbfl. DIR is the libmbfl install prefix. - If DIR is not set, the bundled libmbfl will be used], no, no) - -if test "$PHP_MBSTRING" != "no"; then - AC_DEFINE([HAVE_MBSTRING],1,[whether to have multibyte string support]) - - PHP_MBSTRING_ADD_BASE_SOURCES([mbstring.c php_unicode.c mb_gpc.c]) - - if test "$PHP_MBREGEX" != "no"; then - PHP_MBSTRING_SETUP_MBREGEX - fi - - dnl libmbfl is required - PHP_MBSTRING_SETUP_LIBMBFL - PHP_MBSTRING_EXTENSION - PHP_INSTALL_HEADERS([ext/mbstring], [libmbfl libmbfl/mbfl]) -fi - -# vim600: sts=2 sw=2 et diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32 deleted file mode 100644 index b047cc7487eff..0000000000000 --- a/ext/mbstring/config.w32 +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("mbstring", "multibyte string functions", "no"); -ARG_ENABLE("mbregex", "multibyte regex support", "no"); - -if (PHP_MBSTRING == "yes") { - - FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.vc6", - "ext\\mbstring\\libmbfl\\config.h", true); - FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h", - "ext\\mbstring\\oniguruma\\config.h", true); - - EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", null, - "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \ - -Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \ - /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \ - /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT"); - - ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \ - mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \ - mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \ - mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_euc_cn.c \ - mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \ - mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \ - mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \ - mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \ - mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \ - mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \ - mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \ - mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \ - mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \ - mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c \ - mbfilter_uuencode.c mbfilter_armscii8.c", "mbstring"); - - ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \ - mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \ - mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \ - mbfl_string.c mbfl_allocators.c", "mbstring"); - - ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \ - nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \ - ", "mbstring"); - - AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support'); - AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN'); - AC_DEFINE('HAVE_MBSTR_JA', 1, 'JA'); - AC_DEFINE('HAVE_MBSTR_KR', 1, 'KR'); - AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU'); - AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW'); - - if (PHP_MBREGEX != "no") { - AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h'); - AC_DEFINE('HAVE_MBREGEX', 1); - ADD_SOURCES("ext/mbstring/oniguruma", "regcomp.c regerror.c \ - regenc.c regexec.c reggnu.c regparse.c regposerr.c \ - regext.c regsyntax.c regtrav.c regversion.c st.c", "mbstring"); - ADD_SOURCES("ext/mbstring/oniguruma/enc", "ascii.c big5.c \ - euc_jp.c euc_kr.c euc_tw.c iso8859_1.c iso8859_2.c \ - iso8859_3.c iso8859_4.c iso8859_5.c iso8859_6.c \ - iso8859_7.c iso8859_8.c iso8859_9.c iso8859_10.c \ - iso8859_11.c iso8859_13.c iso8859_14.c iso8859_15.c iso8859_16.c \ - koi8.c koi8_r.c sjis.c utf8.c unicode.c utf16_be.c utf16_le.c \ - utf32_be.c utf32_le.c", "mbstring"); - ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring"); - } -} diff --git a/ext/mbstring/libmbfl/AUTHORS b/ext/mbstring/libmbfl/AUTHORS deleted file mode 100644 index e6062315182a9..0000000000000 --- a/ext/mbstring/libmbfl/AUTHORS +++ /dev/null @@ -1,10 +0,0 @@ -Den V. Tsopa -Hironori Sato -Marcus Boerger -Moriyoshi Koizumi -Rui Hirokawa -Shigeru Kanemoto -Tsukada Takuya -Tateyama -U. Kenkichi -Wez Furlong diff --git a/ext/mbstring/libmbfl/DISCLAIMER b/ext/mbstring/libmbfl/DISCLAIMER deleted file mode 100644 index 97fe77c33c09c..0000000000000 --- a/ext/mbstring/libmbfl/DISCLAIMER +++ /dev/null @@ -1,69 +0,0 @@ -# charset=UTF-8 -# vim600: encoding=UTF-8 - - "streamable kanji code filter and converter" - - Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved. - - This software is released under the GNU Lesser General Public License. - (Version 2.1, February 1999) - Please read the following detail of the licence (in japanese). - - â—†ä½żç”¨è¨ħèĞĉĦäğĥ◆ - - “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Żĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚şĞ‚ˆ£Ĥ開発•‚Œ—Ÿ€‚ĉ Şċĵäĵšç¤ƒƒƒ - ƒ”ƒĵ‚µ‚¤‚şŻ€è‘—作ĉ¨İĉ³•Š‚ˆ³ä¸‡ċ›½è‘—作ĉ¨İĉĦ約ċš‚Ğ‚ˆ‚Š€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ğ関 - ™‚‹™ıĤĉ¨İċˆİ‚’ç•™äż™‚‹ĉ¨İċˆİ‚’ĉŒĦ€““ĞèĦŒä½ż—™€‚ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤ - ‚şŻäğ下Ğĉ˜Žè¨˜—ŸĉĦäğĥĞċ“£Ĥ€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨™‚‹ĉŽ’äğ–çš„§ŻŞ„ĉ¨İċˆİ - ‚’Šċ˘ĉ§˜Ğè¨ħèЁ—™€‚ä½•äşşŸ‚Š¨‚‚€äğ下ĉĦäğĥĞċ—Ĥ“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨ - ™‚‹“¨Ż§›‚“€‚ - - “‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’€ŒGNU Lesser General Public License (Version 2.1, February - 1999)€Ğ示•‚ŒŸĉĦäğĥ§ä½żç”¨™‚‹“¨‚’€ċ…¨Ĥĉ–ıĞè¨ħèЁ—™€‚€ŒGNU Lesser - General Public License€‚’ĉş€Ÿ•Ş„ä½żç”¨ĞŻ€ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş‹‚‰ĉ›¸é˘ - Ğ‚ˆ‚‹è¨ħèĞ‚’ċ—‚‹ċż…èĤŒ‚‚Š™€‚ - - €ŒGNU Lesser General Public License€ċ…¨ĉ–‡Żäğ下‚Ĥ‚§ƒ–ƒšƒĵ‚¸‹‚‰ċ–ċ—§ - ™€‚€ŒGNU Lesser General Public License€¨Ż€“‚Œ§Library General - Public License¨ċ‘ĵ°‚ŒĤ„Ÿ‚‚§™€‚ - http://www.gnu.org/ --- GNU‚Ĥ‚§ƒ–‚µ‚¤ƒˆ - http://www.gnu.org/copyleft/lesser.html --- ƒİ‚¤‚ğƒ³‚ıĉ–‡é˘ - “ƒİ‚¤‚ğƒ³‚ıċ†…ċıŒ‚‹‚‰Ş„ĉ–ı€ċˆ‚ŒŞ„ĉ–ıĞŻä½żç”¨‚’è¨ħèЁ—›‚“€‚ - - —‹—ŞŒ‚‰€ċ½“礁¨GNUƒ—ƒ­‚¸‚§‚Żƒˆ¨ç‰ıċšé–˘äż‚‚’示ċ”†ŸŻä¸ğċĵµ™‚‹‚‚§ - Ż‚‚Š›‚“€‚ - - ◆保è¨ĵċ†…ċı◆ - - “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€ĉœŸċ…•‚ŒŸċ‹•ä½œƒğĉݟ能ƒğĉ€§èƒ½‚’ĉŒ¤“¨‚’ç›ĉ¨™¨—Ĥ設計•‚Œ - 開発•‚ŒĤ„™Œ€“‚Œ‚’保è¨ĵ™‚‹‚‚§Ż‚‚Š›‚“€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€Œ“ - €çŠĥĉ…‹§ĉä›•‚ŒĤŠ‚Š€Ÿ¨ˆ°“‚½ƒ•ƒˆ‚Ĥ‚§‚˘ĉœ‰ç”¨ĉ€§Ş„—ç‰ıċš - ç›çš„Ğċˆè‡´™‚‹“¨¨„£Ÿ€ä½•‚‰‹äżè¨ĵċ†…ċıŒ€ĉ˜Žç¤ş•‚ŒŸ‚Šĉš—éğ™Ğ示•‚ŒĤ„ - ‚‹ċ ´ċˆ§‚£Ĥ‚‚€äżè¨ĵŻç„ĦċŠı§™€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨—ŸçµĉžœŞ„—ä½ż - 用—Ş‹£ŸçµĉžœĞ‚ˆ£Ĥ€ç›´ĉŽ‚‚‹„Żé–“ĉŽĞċ—‘ŸèşĞ体的Şċ‚·ċ³€è²Ħ産上ĉċ³ - €ƒ‡ƒĵ‚żĉċ¤ħ‚‚‹„Żäğ–ċ…¨Ĥĉċ³Ğ¤„ĤŻ€ĉċ³ċŻèƒ½ĉ€§Œä½żç”¨è€… - €ċ½“礁‚‚‹„ŻçĴĴ三者Ğ‚ˆ£Ĥè­Ĥċ‘Š•‚ŒĤ„Ÿċ ´ċˆ§‚£Ĥ‚‚€ċ½“礁Żĉċ³è³  - ċ„ŸŠ‚ˆ³è£œċĦĞ‚’èĦŒ„›‚“€‚“èĤċšŻäğ–ċ…¨Ĥ€ĉ›¸é˘ä¸ŠŸŻĉ›¸é˘Ğç„Ħ„保è¨ĵƒğ - ċ‘ç´„ƒğèĤċšĞċ„Şċ…ˆ—™€‚ - - ◆著作ĉ¨İ者é€£çµĦċ…ˆŠ‚ˆ³ä½żç”¨ĉĦäğĥĞ¤„Ĥċ•„ċˆ‚›ċ…ˆâ—† - - €’102-0073 - ĉħäşĴ都ċƒäğ£ç”°ċŒşäıĉµċŒ—1-13-5ĉ—ĉœĴċœ°ĉ‰€çĴĴ一ƒ“ƒĞ4F - ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş - Phone: 03-3512-3655, Fax: 03-3512-3656 - Email: sales@happysize.co.jp - Web: http://happysize.com/ - - ◆著者◆ - - 金ĉœĴ€€èŒ‚ - - ◆ċħĉ­´â—† - - 1998/11/10 sgk implementation in C++ - 1999/4/25 sgk C§ĉ›¸ŞŠ—€‚ - 1999/4/26 sgk ċ…ċŠ›ƒ•‚£ƒĞ‚ż‚’ċŸè£…€‚ĉĵ˘ċ­—‚³ƒĵƒ‰‚’ĉŽ¨ċš—ŞŒ‚‰ƒ•‚£ƒĞ‚ż‚’èż½ċŠ €‚ - 1999/6/?? Unicode‚µƒƒĵƒˆ€‚ - 1999/6/22 sgk ƒİ‚¤‚ğƒ³‚ı‚’LGPLĞċ¤‰ĉ›´€‚ - diff --git a/ext/mbstring/libmbfl/INSTALL b/ext/mbstring/libmbfl/INSTALL deleted file mode 100644 index b07c9157cd53b..0000000000000 --- a/ext/mbstring/libmbfl/INSTALL +++ /dev/null @@ -1,12 +0,0 @@ - -For UNIX compatible system, - -./buildconf -./configure -make -make install - -For Windows, - -Visual C++ 6.0 and Borland C++ 5.0 is suppoted. - diff --git a/ext/mbstring/libmbfl/LICENSE b/ext/mbstring/libmbfl/LICENSE deleted file mode 100644 index 3b204400cf3d5..0000000000000 --- a/ext/mbstring/libmbfl/LICENSE +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/ext/mbstring/libmbfl/Makefile.am b/ext/mbstring/libmbfl/Makefile.am deleted file mode 100644 index 7f60683435c74..0000000000000 --- a/ext/mbstring/libmbfl/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTRA_DIST=AUTHORS DISCLAIMER LICENSE Makefile.bcc32 \ - config.h.bcc32 config.h.vc6 \ - libmbfl.dsp libmbfl.dsw libmbfl.sln libmbfl.vcproj mbfl.rc \ - mksbcc32.bat rules.mak.bcc32 -SUBDIRS = nls filters mbfl diff --git a/ext/mbstring/libmbfl/Makefile.bcc32 b/ext/mbstring/libmbfl/Makefile.bcc32 deleted file mode 100644 index 6dde6b8384f44..0000000000000 --- a/ext/mbstring/libmbfl/Makefile.bcc32 +++ /dev/null @@ -1,33 +0,0 @@ -!include rules.mak.bcc32 - -SUBDIRS=mbfl nls filters - -all: mbfl.dll mbfl.lib - -mbfl.lib: mbfl.dll - implib -a mbfl.lib mbfl.dll - -mbfl.dll: compile mbfl.res - @if exist linker.rsp del linker.rsp - @for %i in ($(SUBDIRS)) do @for %j in (%i\*.obj) do @echo %j+ >> linker.rsp - ilink32 $(LDFLAGS) @linker.rsp,mbfl.dll,,$(LIBS),,mbfl.res - del linker.rsp - -mbfl.res: mbfl.rc - brcc32 -r mbfl.rc - -prepare: config.h.bcc32 - @if exist linker.rsp del linker.rsp - @copy config.h.bcc32 config.h - -clean: - @for %i in ($(SUBDIRS)) do $(COMSPEC) /C mksbcc32.bat $(MAKE) %i clean - @if exist linker.rsp del linker.rsp - @if exist mbfl.RES del mbfl.RES - @if exist mbfl.dll del mbfl.dll - @if exist mbfl.lib del mbfl.lib - @if exist config.h del config.h - -compile: prepare - @for %i in ($(SUBDIRS)) do $(COMSPEC) /C mksbcc32.bat $(MAKE) %i - diff --git a/ext/mbstring/libmbfl/README b/ext/mbstring/libmbfl/README deleted file mode 100644 index 5a3255560e8da..0000000000000 --- a/ext/mbstring/libmbfl/README +++ /dev/null @@ -1,8 +0,0 @@ -This is Libmbfl, a streamable multibyte character code filter and -converter library. - -See LICENSE and DISCLAIMER for licensing information. - -See the file INSTALL for building and installation instructions. - -# $Id$ diff --git a/ext/mbstring/libmbfl/buildconf b/ext/mbstring/libmbfl/buildconf deleted file mode 100755 index 981812ad6485e..0000000000000 --- a/ext/mbstring/libmbfl/buildconf +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -libtoolize -c -f --automake -aclocal -autoheader -automake -a -c --foreign -autoconf diff --git a/ext/mbstring/libmbfl/config.h.bcc32 b/ext/mbstring/libmbfl/config.h.bcc32 deleted file mode 100644 index 7458e441eb51d..0000000000000 --- a/ext/mbstring/libmbfl/config.h.bcc32 +++ /dev/null @@ -1,12 +0,0 @@ -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_ASSERT_H 1 -#define HAVE_MEMORY_H 1 -/* #undef HAVE_STRINGS_H */ -#define HAVE_STRING_H 1 -/* #undef HAVE_STRCASECMP */ -#define HAVE_STRICMP 1 -#define HAVE_WIN32_NATIVE_THREAD 1 -#define USE_WIN32_NATIVE_THREAD 1 -#define ENABLE_THREADS 1 diff --git a/ext/mbstring/libmbfl/config.h.in b/ext/mbstring/libmbfl/config.h.in deleted file mode 100644 index 8e7493257e7c5..0000000000000 --- a/ext/mbstring/libmbfl/config.h.in +++ /dev/null @@ -1,87 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/ext/mbstring/libmbfl/config.h.vc6 b/ext/mbstring/libmbfl/config.h.vc6 deleted file mode 100644 index 7458e441eb51d..0000000000000 --- a/ext/mbstring/libmbfl/config.h.vc6 +++ /dev/null @@ -1,12 +0,0 @@ -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_ASSERT_H 1 -#define HAVE_MEMORY_H 1 -/* #undef HAVE_STRINGS_H */ -#define HAVE_STRING_H 1 -/* #undef HAVE_STRCASECMP */ -#define HAVE_STRICMP 1 -#define HAVE_WIN32_NATIVE_THREAD 1 -#define USE_WIN32_NATIVE_THREAD 1 -#define ENABLE_THREADS 1 diff --git a/ext/mbstring/libmbfl/configure.in b/ext/mbstring/libmbfl/configure.in deleted file mode 100644 index 25d2e59373c99..0000000000000 --- a/ext/mbstring/libmbfl/configure.in +++ /dev/null @@ -1,38 +0,0 @@ -# Process this file with autoconf to produce a configure script. -AC_INIT(mbfl/mbfilter.c) -AM_INIT_AUTOMAKE(libmbfl, 1.0.0) -AC_CONFIG_SRCDIR(mbfl/mbfilter.c) -AM_CONFIG_HEADER(config.h) - -SHLIB_VERSION="1:0:0" -AC_SUBST(SHLIB_VERSION) - -# Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_LIBTOOL -AC_PROG_RANLIB - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS([stdlib.h stddef.h assert.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -# Checks for library functions. -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_CHECK_FUNCS([strcasecmp strchr]) - -AC_CHECK_PROGS([FETCH_VIA_FTP], [wget curl ncftpget]) - -if test "$FETCH_VIA_FTP" = "curl"; then - FETCH_VIA_FTP="curl -O" -fi - -AC_CONFIG_FILES([Makefile mbfl/Makefile filters/Makefile nls/Makefile]) -AC_OUTPUT diff --git a/ext/mbstring/libmbfl/cvsclean b/ext/mbstring/libmbfl/cvsclean deleted file mode 100755 index 60ae246a50e97..0000000000000 --- a/ext/mbstring/libmbfl/cvsclean +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -function cvsclean_sub() { - prev_pwd=`pwd` - cd $1 - cat .cvsignore | while read fname; do - rm -r -f $fname - done - cd "$prev_pwd" -} - -cvsclean_sub . -cvsclean_sub mbfl -cvsclean_sub filters -cvsclean_sub nls diff --git a/ext/mbstring/libmbfl/filters/Makefile.am b/ext/mbstring/libmbfl/filters/Makefile.am deleted file mode 100644 index 0c71c8604b6ff..0000000000000 --- a/ext/mbstring/libmbfl/filters/Makefile.am +++ /dev/null @@ -1,104 +0,0 @@ -EXTRA_DIST=Makefile.bcc32 mk_sb_tbl.awk -noinst_LTLIBRARIES=libmbfl_filters.la -INCLUDES=-I../mbfl -libmbfl_filters_la_LDFLAGS=-version-info $(SHLIB_VERSION) -libmbfl_filters_la_SOURCES=mbfilter_cp936.c mbfilter_hz.c mbfilter_euc_tw.c mbfilter_big5.c mbfilter_euc_jp.c mbfilter_jis.c mbfilter_iso8859_1.c mbfilter_iso8859_2.c mbfilter_cp1252.c mbfilter_cp1251.c mbfilter_ascii.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c mbfilter_htmlent.c mbfilter_byte2.c mbfilter_byte4.c mbfilter_uuencode.c mbfilter_base64.c mbfilter_sjis.c mbfilter_7bit.c mbfilter_qprint.c mbfilter_ucs4.c mbfilter_ucs2.c mbfilter_utf32.c mbfilter_utf16.c mbfilter_utf8.c mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_euc_jp_win.c mbfilter_cp932.c mbfilter_euc_cn.c mbfilter_euc_kr.c mbfilter_uhc.c mbfilter_iso2022_kr.c mbfilter_cp866.c mbfilter_koi8r.c mbfilter_armscii8.c html_entities.c cp932_table.h html_entities.h mbfilter_7bit.h mbfilter_ascii.h mbfilter_base64.h mbfilter_big5.h mbfilter_byte2.h mbfilter_byte4.h mbfilter_cp1251.h mbfilter_cp1252.h mbfilter_cp866.h mbfilter_cp932.h mbfilter_cp936.h mbfilter_euc_cn.h mbfilter_euc_jp.h mbfilter_euc_jp_win.h mbfilter_euc_kr.h mbfilter_euc_tw.h mbfilter_htmlent.h mbfilter_hz.h mbfilter_iso2022_kr.h mbfilter_iso8859_1.h mbfilter_iso8859_10.h mbfilter_iso8859_13.h mbfilter_iso8859_14.h mbfilter_iso8859_15.h mbfilter_iso8859_16.h mbfilter_iso8859_2.h mbfilter_iso8859_3.h mbfilter_iso8859_4.h mbfilter_iso8859_5.h mbfilter_iso8859_6.h mbfilter_iso8859_7.h mbfilter_iso8859_8.h mbfilter_iso8859_9.h mbfilter_jis.h mbfilter_koi8r.h mbfilter_armscii8.h mbfilter_qprint.h mbfilter_sjis.h mbfilter_ucs2.h mbfilter_ucs4.h mbfilter_uhc.h mbfilter_utf16.h mbfilter_utf32.h mbfilter_utf7.h mbfilter_utf7imap.h mbfilter_utf8.h mbfilter_uuencode.h unicode_prop.h unicode_table_big5.h unicode_table_cns11643.h unicode_table_cp1251.h unicode_table_cp1252.h unicode_table_cp866.h unicode_table_cp932_ext.h unicode_table_cp936.h unicode_table_iso8859_10.h unicode_table_iso8859_13.h unicode_table_iso8859_14.h unicode_table_iso8859_15.h unicode_table_iso8859_16.h unicode_table_iso8859_2.h unicode_table_iso8859_3.h unicode_table_iso8859_4.h unicode_table_iso8859_5.h unicode_table_iso8859_6.h unicode_table_iso8859_7.h unicode_table_iso8859_8.h unicode_table_iso8859_9.h unicode_table_jis.h unicode_table_koi8r.h unicode_table_armscii8.h unicode_table_uhc.h - -mbfilter_iso8859_2.c: unicode_table_iso8859_2.h - -mbfilter_iso8859_3.c: unicode_table_iso8859_3.h - -mbfilter_iso8859_4.c: unicode_table_iso8859_4.h - -mbfilter_iso8859_5.c: unicode_table_iso8859_5.h - -mbfilter_iso8859_6.c: unicode_table_iso8859_6.h - -mbfilter_iso8859_7.c: unicode_table_iso8859_7.h - -mbfilter_iso8859_8.c: unicode_table_iso8859_8.h - -mbfilter_iso8859_9.c: unicode_table_iso8859_9.h - -mbfilter_iso8859_10.c: unicode_table_iso8859_10.h - -mbfilter_iso8859_11.c: unicode_table_iso8859_11.h - -mbfilter_iso8859_13.c: unicode_table_iso8859_13.h - -mbfilter_iso8859_14.c: unicode_table_iso8859_13.h - -mbfilter_iso8859_15.c: unicode_table_iso8859_15.h - -mbfilter_iso8859_16.c: unicode_table_iso8859_16.h - -8859-1.TXT 8859-2.TXT 8859-3.TXT 8859-4.TXT 8859-5.TXT 8859-6.TXT \ -8859-7.TXT 8859-8.TXT 8859-9.TXT 8859-10.TXT 8859-11.TXT 8859-13.TXT \ -8859-14.TXT 8859-15.TXT 8859-16.TXT: - $(FETCH_VIA_FTP) ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/$@ - -unicode_table_iso8859_1.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_1_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_1_H -f mk_sb_tbl.awk 8859-1.TXT > $@ - -unicode_table_iso8859_2.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_2_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_2_H -f mk_sb_tbl.awk 8859-2.TXT > $@ - -unicode_table_iso8859_3.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_3_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_3_H -f mk_sb_tbl.awk 8859-3.TXT > $@ - -unicode_table_iso8859_4.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_4_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_4_H -f mk_sb_tbl.awk 8859-4.TXT > $@ - -unicode_table_iso8859_5.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_5_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_5_H -f mk_sb_tbl.awk 8859-5.TXT > $@ - -unicode_table_iso8859_6.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_6_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_6_H -f mk_sb_tbl.awk 8859-6.TXT > $@ - -unicode_table_iso8859_7.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_7_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_7_H -f mk_sb_tbl.awk 8859-7.TXT > $@ - -unicode_table_iso8859_8.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_8_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_8_H -f mk_sb_tbl.awk 8859-8.TXT > $@ - -unicode_table_iso8859_9.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_9_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_9_H -f mk_sb_tbl.awk 8859-9.TXT > $@ - -unicode_table_iso8859_10.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_10_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_10_H -f mk_sb_tbl.awk 8859-10.TXT > $@ - -unicode_table_iso8859_11.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_11_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_11_H -f mk_sb_tbl.awk 8859-11.TXT > $@ - -unicode_table_iso8859_13.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_13_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_13_H -f mk_sb_tbl.awk 8859-13.TXT > $@ - -unicode_table_iso8859_14.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_14_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_14_H -f mk_sb_tbl.awk 8859-14.TXT > $@ - -unicode_table_iso8859_15.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_15_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLE_ISO8859_15_H -f mk_sb_tbl.awk 8859-15.TXT > $@ - -unicode_table_iso8859_16.h: mk_sb_tbl.awk - $(AWK) -v TABLE_NAME=iso8859_16_ucs_table \ - -v IFNDEF_NAME=UNICODE_TABLEISO8859_16_H -f mk_sb_tbl.awk 8859-16.TXT > $@ - -unidata: 8859-1.TXT 8859-2.TXT 8859-3.TXT 8859-4.TXT 8859-5.TXT 8859-6.TXT \ -8859-7.TXT 8859-8.TXT 8859-9.TXT 8859-10.TXT 8859-11.TXT 8859-13.TXT \ -8859-14.TXT 8859-15.TXT 8859-16.TXT - -.PHONY: unidata diff --git a/ext/mbstring/libmbfl/filters/Makefile.bcc32 b/ext/mbstring/libmbfl/filters/Makefile.bcc32 deleted file mode 100644 index 03e1d88024560..0000000000000 --- a/ext/mbstring/libmbfl/filters/Makefile.bcc32 +++ /dev/null @@ -1,9 +0,0 @@ -!include ..\rules.mak.bcc32 -INCLUDES=$(INCLUDES) -I../mbfl -OBJS=mbfilter_cp936.obj mbfilter_hz.obj mbfilter_euc_tw.obj mbfilter_big5.obj mbfilter_euc_jp.obj mbfilter_jis.obj mbfilter_iso8859_1.obj mbfilter_iso8859_2.obj mbfilter_cp1252.obj mbfilter_cp1251.obj mbfilter_ascii.obj mbfilter_iso8859_3.obj mbfilter_iso8859_4.obj mbfilter_iso8859_5.obj mbfilter_iso8859_6.obj mbfilter_iso8859_7.obj mbfilter_iso8859_8.obj mbfilter_iso8859_9.obj mbfilter_iso8859_10.obj mbfilter_iso8859_13.obj mbfilter_iso8859_14.obj mbfilter_iso8859_15.obj mbfilter_iso8859_16.obj mbfilter_htmlent.obj mbfilter_byte2.obj mbfilter_byte4.obj mbfilter_uuencode.obj mbfilter_base64.obj mbfilter_sjis.obj mbfilter_7bit.obj mbfilter_qprint.obj mbfilter_ucs4.obj mbfilter_ucs2.obj mbfilter_utf32.obj mbfilter_utf16.obj mbfilter_utf8.obj mbfilter_utf7.obj mbfilter_utf7imap.obj mbfilter_euc_jp_win.obj mbfilter_cp932.obj mbfilter_euc_cn.obj mbfilter_euc_kr.obj mbfilter_uhc.obj mbfilter_iso2022_kr.obj mbfilter_cp866.obj mbfilter_koi8r.obj html_entities.obj mbfilter_armscii8.obj - -all: $(OBJS) - -clean: - @for %i in ($(OBJS)) do @if exist %i del %i - diff --git a/ext/mbstring/libmbfl/filters/cp932_table.h b/ext/mbstring/libmbfl/filters/cp932_table.h deleted file mode 100644 index d8cbb7f0a85ab..0000000000000 --- a/ext/mbstring/libmbfl/filters/cp932_table.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ - -#ifndef CP932_TABLE_H -#define CP932_TABLE_H - -/* - * cp932 table - */ -static const unsigned short cp932ext3_eucjp_table[] = { - /* ku 115 */ - 0xF3F3,0xF3F4,0xF3F5,0xF3F6,0xF3F7,0xF3F8,0xF3F9,0xF3FA, - 0xF3FB,0xF3FC,0xF3FD,0xF3FE,0xF4A1,0xF4A2,0xF4A3,0xF4A4, - 0xF4A5,0xF4A6,0xF4A7,0xF4A8,0x224C,0xA2C3,0xF4A9,0xF4AA, - 0xF4AB,0xF4AC,0xF4AD,0x2268,0xD4E3,0xDCDF,0xE4E9,0xE3F8, - 0xD9A1,0xB1BB,0xF4AE,0xC2AD,0xC3FC,0xE4D0,0xC2BF,0xBCF4, - 0xB0A9,0xB0C8,0xF4AF,0xB0D2,0xB0D4,0xB0E3,0xB0EE,0xB1A7, - 0xB1A3,0xB1AC,0xB1A9,0xB1BE,0xB1DF,0xB1D8,0xB1C8,0xB1D7, - 0xB1E3,0xB1F4,0xB1E1,0xB2A3,0xF4B0,0xB2BB,0xB2E6,0xB2ED, - 0xB2F5,0xB2FC,0xF4B1,0xB3B5,0xB3D8,0xB3DB,0xB3E5,0xB3EE, - 0xB3FB,0xF4B2,0xF4B3,0xB4C0,0xB4C7,0xB4D0,0xB4DE,0xF4B4, - 0xB5AA,0xF4B5,0xB5AF,0xB5C4,0xB5E8,0xF4B6,0xB7C2,0xB7E4, - 0xB7E8,0xB7E7,0xF4B7,0xF4B8,0xF4B9,0xB8CE, - - /* ku 116 */ - 0xB8E1,0xB8F5,0xB8F7,0xB8F8,0xB8FC,0xB9AF,0xB9B7,0xBABE, - 0xBADB,0xCDAA,0xBAE1,0xF4BA,0xBAEB,0xBBB3,0xBBB8,0xF4BB, - 0xBBCA,0xF4BC,0xF4BD,0xBBD0,0xBBDE,0xBBF4,0xBBF5,0xBBF9, - 0xBCE4,0xBCED,0xBCFE,0xF4BE,0xBDC2,0xBDE7,0xF4BF,0xBDF0, - 0xBEB0,0xBEAC,0xF4C0,0xBEB3,0xBEBD,0xBECD,0xBEC9,0xBEE4, - 0xBFA8,0xBFC9,0xC0C4,0xC0E4,0xC0F4,0xC1A6,0xF4C1,0xC1F5, - 0xC1FC,0xF4C2,0xC1F8,0xC2AB,0xC2A1,0xC2A5,0xF4C3,0xC2B8, - 0xC2BA,0xF4C4,0xC2C4,0xC2D2,0xC2D7,0xC2DB,0xC2DE,0xC2ED, - 0xC2F0,0xF4C5,0xC3A1,0xC3B5,0xC3C9,0xC3B9,0xF4C6,0xC3D8, - 0xC3FE,0xF4C7,0xC4CC,0xF4C8,0xC4D9,0xC4EA,0xC4FD,0xF4C9, - 0xC5A7,0xC5B5,0xC5B6,0xF4CA,0xC5D5,0xC6B8,0xC6D7,0xC6E0, - 0xC6EA,0xC6E3,0xC7A1,0xC7AB,0xC7C7,0xC7C3, - - /* ku 117 */ - 0xC7CB,0xC7CF,0xC7D9,0xF4CB,0xF4CC,0xC7E6,0xC7EE,0xC7FC, - 0xC7EB,0xC7F0,0xC8B1,0xC8E5,0xC8F8,0xC9A6,0xC9AB,0xC9AD, - 0xF4CD,0xC9CA,0xC9D3,0xC9E9,0xC9E3,0xC9FC,0xC9F4,0xC9F5, - 0xF4CE,0xCAB3,0xCABD,0xCAEF,0xCAF1,0xCBAE,0xF4CF,0xCBCA, - 0xCBE6,0xCBEA,0xCBF0,0xCBF4,0xCBEE,0xCCA5,0xCBF9,0xCCAB, - 0xCCAE,0xCCAD,0xCCB2,0xCCC2,0xCCD0,0xCCD9,0xF4D0,0xCDBB, - 0xF4D1,0xCEBB,0xF4D2,0xCEBA,0xCEC3,0xF4D3,0xCEF2,0xB3DD, - 0xCFD5,0xCFE2,0xCFE9,0xCFED,0xF4D4,0xF4D5,0xF4D6,0xF4D7, - 0xD0E5,0xF4D8,0xD0E9,0xD1E8,0xF4D9,0xF4DA,0xD1EC,0xD2BB, - 0xF4DB,0xD3E1,0xD3E8,0xD4A7,0xF4DC,0xF4DD,0xD4D4,0xD4F2, - 0xD5AE,0xF4DE,0xD7DE,0xF4DF,0xD8A2,0xD8B7,0xD8C1,0xD8D1, - 0xD8F4,0xD9C6,0xD9C8,0xD9D1,0xF4E0,0xF4E1, - - /* ku 118 */ - 0xF4E2,0xF4E3,0xF4E4,0xDCD3,0xDDC8,0xDDD4,0xDDEA,0xDDFA, - 0xDEA4,0xDEB0,0xF4E5,0xDEB5,0xDECB,0xF4E6,0xDFB9,0xF4E7, - 0xDFC3,0xF4E8,0xF4E9,0xE0D9,0xF4EA,0xF4EB,0xE1E2,0xF4EC, - 0xF4ED,0xF4EE,0xE2C7,0xE3A8,0xE3A6,0xE3A9,0xE3AF,0xE3B0, - 0xE3AA,0xE3AB,0xE3BC,0xE3C1,0xE3BF,0xE3D5,0xE3D8,0xE3D6, - 0xE3DF,0xE3E3,0xE3E1,0xE3D4,0xE3E9,0xE4A6,0xE3F1,0xE3F2, - 0xE4CB,0xE4C1,0xE4C3,0xE4BE,0xF4EF,0xE4C0,0xE4C7,0xE4BF, - 0xE4E0,0xE4DE,0xE4D1,0xF4F0,0xE4DC,0xE4D2,0xE4DB,0xE4D4, - 0xE4FA,0xE4EF,0xE5B3,0xE5BF,0xE5C9,0xE5D0,0xE5E2,0xE5EA, - 0xE5EB,0xF4F1,0xF4F2,0xF4F3,0xE6E8,0xE6EF,0xE7AC,0xF4F4, - 0xE7AE,0xF4F5,0xE7B1,0xF4F6,0xE7B2,0xE8B1,0xE8B6,0xF4F7, - 0xF4F8,0xE8DD,0xF4F9,0xF4FA,0xE9D1,0xF4FB, - - /* ku 119 */ - 0xE9ED,0xEACD,0xF4FC,0xEADB,0xEAE6,0xEAEA,0xEBA5,0xEBFB, - 0xEBFA,0xF4FD,0xECD6,0xF4FE -}; - -static const int cp932ext3_eucjp_table_size = (sizeof (cp932ext3_eucjp_table) / sizeof (unsigned short)); - -#endif /* CP932_TABLE_H */ diff --git a/ext/mbstring/libmbfl/filters/html_entities.c b/ext/mbstring/libmbfl/filters/html_entities.c deleted file mode 100644 index 5551952b1c500..0000000000000 --- a/ext/mbstring/libmbfl/filters/html_entities.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Marcus Boerger - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "html_entities.h" - -const mbfl_html_entity_entry mbfl_html_entity_list[] = { - {"quot", 34}, - {"amp", 38}, - {"lt", 60}, - {"gt", 62}, - {"nbsp", 160}, - {"iexcl", 161}, - {"cent", 162}, - {"pound", 163}, - {"curren", 164}, - {"yen", 165}, - {"brvbar", 166}, - {"sect", 167}, - {"uml", 168}, - {"copy", 169}, - {"ordf", 170}, - {"laquo", 171}, - {"not", 172}, - {"shy", 173}, - {"reg", 174}, - {"macr", 175}, - {"deg", 176}, - {"plusmn", 177}, - {"sup2", 178}, - {"sup3", 179}, - {"acute", 180}, - {"micro", 181}, - {"para", 182}, - {"middot", 183}, - {"cedil", 184}, - {"sup1", 185}, - {"ordm", 186}, - {"raquo", 187}, - {"frac14", 188}, - {"frac12", 189}, - {"frac34", 190}, - {"iquest", 191}, - {"Agrave", 192}, - {"Aacute", 193}, - {"Acirc", 194}, - {"Atilde", 195}, - {"Auml", 196}, - {"Aring", 197}, - {"AElig", 198}, - {"Ccedil", 199}, - {"Egrave", 200}, - {"Eacute", 201}, - {"Ecirc", 202}, - {"Euml", 203}, - {"Igrave", 204}, - {"Iacute", 205}, - {"Icirc", 206}, - {"Iuml", 207}, - {"ETH", 208}, - {"Ntilde", 209}, - {"Ograve", 210}, - {"Oacute", 211}, - {"Ocirc", 212}, - {"Otilde", 213}, - {"Ouml", 214}, - {"times", 215}, - {"Oslash", 216}, - {"Ugrave", 217}, - {"Uacute", 218}, - {"Ucirc", 219}, - {"Uuml", 220}, - {"Yacute", 221}, - {"THORN", 222}, - {"szlig", 223}, - {"agrave", 224}, - {"aacute", 225}, - {"acirc", 226}, - {"atilde", 227}, - {"auml", 228}, - {"aring", 229}, - {"aelig", 230}, - {"ccedil", 231}, - {"egrave", 232}, - {"eacute", 233}, - {"ecirc", 234}, - {"euml", 235}, - {"igrave", 236}, - {"iacute", 237}, - {"icirc", 238}, - {"iuml", 239}, - {"eth", 240}, - {"ntilde", 241}, - {"ograve", 242}, - {"oacute", 243}, - {"ocirc", 244}, - {"otilde", 245}, - {"ouml", 246}, - {"divide", 247}, - {"oslash", 248}, - {"ugrave", 249}, - {"uacute", 250}, - {"ucirc", 251}, - {"uuml", 252}, - {"yacute", 253}, - {"thorn", 254}, - {"yuml", 255}, - {"OElig", 338}, - {"oelig", 339}, - {"Scaron", 352}, - {"scaron", 353}, - {"Yuml", 376}, - {"fnof", 402}, - {"circ", 710}, - {"tilde", 732}, - {"Alpha", 913}, - {"Beta", 914}, - {"Gamma", 915}, - {"Delta", 916}, - {"Epsilon", 917}, - {"Zeta", 918}, - {"Eta", 919}, - {"Theta", 920}, - {"Iota", 921}, - {"Kappa", 922}, - {"Lambda", 923}, - {"Mu", 924}, - {"Nu", 925}, - {"Xi", 926}, - {"Omicron", 927}, - {"Pi", 928}, - {"Rho", 929}, - {"Sigma", 931}, - {"Tau", 932}, - {"Upsilon", 933}, - {"Phi", 934}, - {"Chi", 935}, - {"Psi", 936}, - {"Omega", 937}, - {"alpha", 945}, - {"beta", 946}, - {"gamma", 947}, - {"delta", 948}, - {"epsilon", 949}, - {"zeta", 950}, - {"eta", 951}, - {"theta", 952}, - {"iota", 953}, - {"kappa", 954}, - {"lambda", 955}, - {"mu", 956}, - {"nu", 957}, - {"xi", 958}, - {"omicron", 959}, - {"pi", 960}, - {"rho", 961}, - {"sigmaf", 962}, - {"sigma", 963}, - {"tau", 964}, - {"upsilon", 965}, - {"phi", 966}, - {"chi", 967}, - {"psi", 968}, - {"omega", 969}, - {"thetasym", 977}, - {"upsih", 978}, - {"piv", 982}, - {"ensp", 8194}, - {"emsp", 8195}, - {"thinsp", 8201}, - {"zwnj", 8204}, - {"zwj", 8205}, - {"lrm", 8206}, - {"rlm", 8207}, - {"ndash", 8211}, - {"mdash", 8212}, - {"lsquo", 8216}, - {"rsquo", 8217}, - {"sbquo", 8218}, - {"ldquo", 8220}, - {"rdquo", 8221}, - {"bdquo", 8222}, - {"dagger", 8224}, - {"Dagger", 8225}, - {"bull", 8226}, - {"hellip", 8230}, - {"permil", 8240}, - {"prime", 8242}, - {"Prime", 8243}, - {"lsaquo", 8249}, - {"rsaquo", 8250}, - {"oline", 8254}, - {"frasl", 8260}, - {"euro", 8364}, - {"weierp", 8472}, - {"image", 8465}, - {"real", 8476}, - {"trade", 8482}, - {"alefsym", 8501}, - {"larr", 8592}, - {"uarr", 8593}, - {"rarr", 8594}, - {"darr", 8595}, - {"harr", 8596}, - {"crarr", 8629}, - {"lArr", 8656}, - {"uArr", 8657}, - {"rArr", 8658}, - {"dArr", 8659}, - {"hArr", 8660}, - {"forall", 8704}, - {"part", 8706}, - {"exist", 8707}, - {"empty", 8709}, - {"nabla", 8711}, - {"isin", 8712}, - {"notin", 8713}, - {"ni", 8715}, - {"prod", 8719}, - {"sum", 8721}, - {"minus", 8722}, - {"lowast", 8727}, - {"radic", 8730}, - {"prop", 8733}, - {"infin", 8734}, - {"ang", 8736}, - {"and", 8743}, - {"or", 8744}, - {"cap", 8745}, - {"cup", 8746}, - {"int", 8747}, - {"there4", 8756}, - {"sim", 8764}, - {"cong", 8773}, - {"asymp", 8776}, - {"ne", 8800}, - {"equiv", 8801}, - {"le", 8804}, - {"ge", 8805}, - {"sub", 8834}, - {"sup", 8835}, - {"nsub", 8836}, - {"sube", 8838}, - {"supe", 8839}, - {"oplus", 8853}, - {"otimes", 8855}, - {"perp", 8869}, - {"sdot", 8901}, - {"lceil", 8968}, - {"rceil", 8969}, - {"lfloor", 8970}, - {"rfloor", 8971}, - {"lang", 9001}, - {"rang", 9002}, - {"loz", 9674}, - {"spades", 9824}, - {"clubs", 9827}, - {"hearts", 9829}, - {"diams", 9830}, - {NULL, -1} /* mark end of table */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/libmbfl/filters/html_entities.h b/ext/mbstring/libmbfl/filters/html_entities.h deleted file mode 100644 index a73b9d5bbd629..0000000000000 --- a/ext/mbstring/libmbfl/filters/html_entities.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Marcus Boerger - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_HTML_ENTITIES_H -#define MBFL_HTML_ENTITIES_H - -typedef struct _mbfl_html_entity_entry { - char * name; - int code; -} mbfl_html_entity_entry; - -extern const mbfl_html_entity_entry mbfl_html_entity_list[]; - -#endif /* MBFL_HTML_ENTITIES_H */ - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_7bit.c b/ext/mbstring/libmbfl/filters/mbfilter_7bit.c deleted file mode 100644 index 7b793cd540be0..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_7bit.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_7bit.h" - -const mbfl_encoding mbfl_encoding_7bit = { - mbfl_no_encoding_7bit, - "7bit", - "7bit", - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_8bit_7bit = { - mbfl_no_encoding_8bit, - mbfl_no_encoding_7bit, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_any_7bit, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_7bit_8bit = { - mbfl_no_encoding_7bit, - mbfl_no_encoding_8bit, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_7bit_any, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -int mbfl_filt_conv_7bit_any(int c, mbfl_convert_filter *filter) -{ - return (*filter->output_function)(c, filter->data); -} - - -int mbfl_filt_conv_any_7bit(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < 0x80) { - CK((*filter->output_function)(c, filter->data)); - } - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_7bit.h b/ext/mbstring/libmbfl/filters/mbfilter_7bit.h deleted file mode 100644 index d9a285fb1bb16..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_7bit.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_7BIT_H -#define MBFL_MBFILTER_7BIT_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_7bit; -extern const struct mbfl_convert_vtbl vtbl_8bit_7bit; -extern const struct mbfl_convert_vtbl vtbl_7bit_8bit; - -int mbfl_filt_conv_7bit_any(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_any_7bit(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_7BIT_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c deleted file mode 100644 index 2d1fc8d7b0972..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Hayk Chamyan - * - */ - -/* - * "armenian code filter and converter" - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_armscii8.h" -#include "unicode_table_armscii8.h" - -static int mbfl_filt_ident_armscii8(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_armscii8_aliases[] = {"ArmSCII-8", "ArmSCII8", "ARMSCII-8", "ARMSCII8", NULL}; - -const mbfl_encoding mbfl_encoding_armscii8 = { - mbfl_no_encoding_armscii8, - "ArmSCII-8", - "ArmSCII-8", - (const char *(*)[])&mbfl_encoding_armscii8_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_armscii8 = { - mbfl_no_encoding_armscii8, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_armscii8 -}; - -const struct mbfl_convert_vtbl vtbl_wchar_armscii8 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_armscii8, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_armscii8, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_armscii8_wchar = { - mbfl_no_encoding_armscii8, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_armscii8_wchar, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * armscii8 => wchar - */ -int mbfl_filt_conv_armscii8_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < armscii8_ucs_table_min) { - s = c; - } else if (c >= armscii8_ucs_table_min && c < 0x100) { - s = armscii8_ucs_table[c - armscii8_ucs_table_min]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_ARMSCII8; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => armscii8 - */ -int mbfl_filt_conv_wchar_armscii8(int c, mbfl_convert_filter *filter) -{ - - int s, n; - - if (c >= 0x28 && c < 0x30) { - s = ucs_armscii8_table[c-0x28]; - } else if (c < armscii8_ucs_table_min) { - s = c; - } else { - s = -1; - n = armscii8_ucs_table_len-1; - while (n >= 0) { - if (c == armscii8_ucs_table[n]) { - s = armscii8_ucs_table_min + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_ARMSCII8) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_armscii8(int c, mbfl_identify_filter *filter) -{ - if (c >= armscii8_ucs_table_min && c <= 0xff) - filter->flag = 0; - else - filter->flag = 1; /* not it */ - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h deleted file mode 100644 index fc84827564619..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Hayk Chamyan - * - */ - -#ifndef MBFL_MBFILTER_ARMSCII8_H -#define MBFL_MBFILTER_ARMSCII8_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_armscii8; -extern const struct mbfl_identify_vtbl vtbl_identify_armscii8; -extern const struct mbfl_convert_vtbl vtbl_wchar_armscii8; -extern const struct mbfl_convert_vtbl vtbl_armscii8_wchar; - -int mbfl_filt_conv_armscii8_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_armscii8(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ARMSCII8_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c b/ext/mbstring/libmbfl/filters/mbfilter_ascii.c deleted file mode 100644 index 34366db6c021a..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_ascii.h" - -static int mbfl_filt_ident_ascii(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_ascii_aliases[] = {"ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "US-ASCII", "ISO646-US", "us", "IBM367", "cp367", "csASCII", NULL}; - -const mbfl_encoding mbfl_encoding_ascii = { - mbfl_no_encoding_ascii, - "ASCII", - "US-ASCII", /* preferred MIME name */ - (const char *(*)[])&mbfl_encoding_ascii_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_ascii = { - mbfl_no_encoding_ascii, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_ascii -}; - -const struct mbfl_convert_vtbl vtbl_ascii_wchar = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ascii_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ascii = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ascii, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ascii, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ASCII => wchar - */ -int mbfl_filt_conv_ascii_wchar(int c, mbfl_convert_filter *filter) -{ - return (*filter->output_function)(c, filter->data); -} - - -/* - * wchar => ASCII - */ -int mbfl_filt_conv_wchar_ascii(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < 0x80) { - CK((*filter->output_function)(c, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_ascii(int c, mbfl_identify_filter *filter) -{ - if (c >= 0x20 && c < 0x80) { - ; - } else if (c == 0x0d || c == 0x0a || c == 0x09 || c == 0) { /* CR or LF or HTAB or null */ - ; - } else { - filter->flag = 1; - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ascii.h b/ext/mbstring/libmbfl/filters/mbfilter_ascii.h deleted file mode 100644 index c48ced644774e..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ascii.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_ASCII_H -#define MBFL_MBFILTER_ASCII_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_ascii; -extern const struct mbfl_identify_vtbl vtbl_identify_ascii; -extern const struct mbfl_convert_vtbl vtbl_ascii_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ascii; - -int mbfl_filt_conv_ascii_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_ascii(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ASCII_H */ - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_base64.c b/ext/mbstring/libmbfl/filters/mbfilter_base64.c deleted file mode 100644 index 13341f9e9fa19..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_base64.c +++ /dev/null @@ -1,214 +0,0 @@ - /* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_base64.h" - -const mbfl_encoding mbfl_encoding_base64 = { - mbfl_no_encoding_base64, - "BASE64", - "BASE64", - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_8bit_b64 = { - mbfl_no_encoding_8bit, - mbfl_no_encoding_base64, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_base64enc, - mbfl_filt_conv_base64enc_flush -}; - -const struct mbfl_convert_vtbl vtbl_b64_8bit = { - mbfl_no_encoding_base64, - mbfl_no_encoding_8bit, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_base64dec, - mbfl_filt_conv_base64dec_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * any => BASE64 - */ -static const unsigned char mbfl_base64_table[] = { - /* 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', */ - 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d, - /* 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', */ - 0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a, - /* 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', */ - 0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d, - /* 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', */ - 0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a, - /* '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' */ - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2b,0x2f,0x00 -}; - -int mbfl_filt_conv_base64enc(int c, mbfl_convert_filter *filter) -{ - int n; - - n = (filter->status & 0xff); - if (n == 0) { - filter->status++; - filter->cache = (c & 0xff) << 16; - } else if (n == 1) { - filter->status++; - filter->cache |= (c & 0xff) << 8; - } else { - filter->status &= ~0xff; - if ((filter->status & MBFL_BASE64_STS_MIME_HEADER) == 0) { - n = (filter->status & 0xff00) >> 8; - if (n > 72) { - CK((*filter->output_function)(0x0d, filter->data)); /* CR */ - CK((*filter->output_function)(0x0a, filter->data)); /* LF */ - filter->status &= ~0xff00; - } - filter->status += 0x400; - } - n = filter->cache | (c & 0xff); - CK((*filter->output_function)(mbfl_base64_table[(n >> 18) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(n >> 12) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(n >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[n & 0x3f], filter->data)); - } - - return c; -} - -int mbfl_filt_conv_base64enc_flush(mbfl_convert_filter *filter) -{ - int status, cache, len; - - status = filter->status & 0xff; - cache = filter->cache; - len = (filter->status & 0xff00) >> 8; - filter->status &= ~0xffff; - filter->cache = 0; - /* flush fragments */ - if (status >= 1) { - if ((filter->status & MBFL_BASE64_STS_MIME_HEADER) == 0) { - if (len > 72){ - CK((*filter->output_function)(0x0d, filter->data)); /* CR */ - CK((*filter->output_function)(0x0a, filter->data)); /* LF */ - } - } - CK((*filter->output_function)(mbfl_base64_table[(cache >> 18) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache >> 12) & 0x3f], filter->data)); - if (status == 1) { - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - } else { - CK((*filter->output_function)(mbfl_base64_table[(cache >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - } - } - return 0; -} - -/* - * BASE64 => any - */ -int mbfl_filt_conv_base64dec(int c, mbfl_convert_filter *filter) -{ - int n; - - if (c == 0x0d || c == 0x0a || c == 0x20 || c == 0x09 || c == 0x3d) { /* CR or LF or SPACE or HTAB or '=' */ - return c; - } - - n = 0; - if (c >= 0x41 && c <= 0x5a) { /* A - Z */ - n = c - 65; - } else if (c >= 0x61 && c <= 0x7a) { /* a - z */ - n = c - 71; - } else if (c >= 0x30 && c <= 0x39) { /* 0 - 9 */ - n = c + 4; - } else if (c == 0x2b) { /* '+' */ - n = 62; - } else if (c == 0x2f) { /* '/' */ - n = 63; - } - n &= 0x3f; - - switch (filter->status) { - case 0: - filter->status = 1; - filter->cache = n << 18; - break; - case 1: - filter->status = 2; - filter->cache |= n << 12; - break; - case 2: - filter->status = 3; - filter->cache |= n << 6; - break; - default: - filter->status = 0; - n |= filter->cache; - CK((*filter->output_function)((n >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(n & 0xff, filter->data)); - break; - } - - return c; -} - -int mbfl_filt_conv_base64dec_flush(mbfl_convert_filter *filter) -{ - int status, cache; - - status = filter->status; - cache = filter->cache; - filter->status = 0; - filter->cache = 0; - /* flush fragments */ - if (status >= 2) { - CK((*filter->output_function)((cache >> 16) & 0xff, filter->data)); - if (status >= 3) { - CK((*filter->output_function)((cache >> 8) & 0xff, filter->data)); - } - } - return 0; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_base64.h b/ext/mbstring/libmbfl/filters/mbfilter_base64.h deleted file mode 100644 index 6bd525fd3ed11..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_base64.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_BASE64_H -#define MBFL_MBFILTER_BASE64_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_base64; -extern const struct mbfl_convert_vtbl vtbl_b64_8bit; -extern const struct mbfl_convert_vtbl vtbl_8bit_b64; - -int mbfl_filt_conv_base64enc(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_base64enc_flush(mbfl_convert_filter *filter); -int mbfl_filt_conv_base64dec(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_base64dec_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_BASE64_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_big5.c b/ext/mbstring/libmbfl/filters/mbfilter_big5.c deleted file mode 100644 index fe5effe044467..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_big5.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ -/* - * The source code included in this files was separated from mbfilter_tw.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_big5.h" - -#include "unicode_table_big5.h" - -static int mbfl_filt_ident_big5(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_big5[] = { /* 0x81-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_big5_aliases[] = {"CN-BIG5", "BIG-FIVE", "BIGFIVE", "CP950", NULL}; - -const mbfl_encoding mbfl_encoding_big5 = { - mbfl_no_encoding_big5, - "BIG-5", - "BIG5", - (const char *(*)[])&mbfl_encoding_big5_aliases, - mblen_table_big5, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_big5 = { - mbfl_no_encoding_big5, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_big5 -}; - -const struct mbfl_convert_vtbl vtbl_big5_wchar = { - mbfl_no_encoding_big5, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_big5_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_big5 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_big5, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_big5, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * Big5 => wchar - */ -int -mbfl_filt_conv_big5_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff) { /* dbcs lead byte */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status = 0; - c1 = filter->cache; - if ((c > 0x39 && c < 0x7f) | (c > 0xa0 && c < 0xff)) { - if (c < 0x7f){ - w = (c1 - 0xa1)*157 + (c - 0x40); - } else { - w = (c1 - 0xa1)*157 + (c - 0xa1) + 0x3f; - } - if (w >= 0 && w < big5_ucs_table_size) { - w = big5_ucs_table[w]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_BIG5; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => Big5 - */ -int -mbfl_filt_conv_wchar_big5(int c, mbfl_convert_filter *filter) -{ - int c1, s; - - s = 0; - if (c >= ucs_a1_big5_table_min && c < ucs_a1_big5_table_max) { - s = ucs_a1_big5_table[c - ucs_a1_big5_table_min]; - } else if (c >= ucs_a2_big5_table_min && c < ucs_a2_big5_table_max) { - s = ucs_a2_big5_table[c - ucs_a2_big5_table_min]; - } else if (c >= ucs_a3_big5_table_min && c < ucs_a3_big5_table_max) { - s = ucs_a3_big5_table[c - ucs_a3_big5_table_min]; - } else if (c >= ucs_i_big5_table_min && c < ucs_i_big5_table_max) { - s = ucs_i_big5_table[c - ucs_i_big5_table_min]; - } else if (c >= ucs_pua_big5_table_min && c < ucs_pua_big5_table_max) { - s = ucs_pua_big5_table[c - ucs_pua_big5_table_min]; - } else if (c >= ucs_r1_big5_table_min && c < ucs_r1_big5_table_max) { - s = ucs_r1_big5_table[c - ucs_r1_big5_table_min]; - } else if (c >= ucs_r2_big5_table_min && c < ucs_r2_big5_table_max) { - s = ucs_r2_big5_table[c - ucs_r2_big5_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_BIG5) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_big5(int c, mbfl_identify_filter *filter) -{ - if (filter->status) { /* kanji second char */ - if (c < 0x40 || (c > 0x7e && c < 0xa1) ||c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - } else if (c >= 0 && c < 0x80) { /* latin ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* DBCS lead byte */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_big5.h b/ext/mbstring/libmbfl/filters/mbfilter_big5.h deleted file mode 100644 index 6b6a26563b9e0..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_big5.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ -/* - * The source code included in this files was separated from mbfilter_tw.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_BIG5_H -#define MBFL_MBFILTER_BIG5_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_big5; -extern const struct mbfl_identify_vtbl vtbl_identify_big5; -extern const struct mbfl_convert_vtbl vtbl_big5_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_big5; - -int mbfl_filt_conv_big5_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_big5(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_BIG5_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte2.c b/ext/mbstring/libmbfl/filters/mbfilter_byte2.c deleted file mode 100644 index 03b471bf5bdbc..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_byte2.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_byte2.h" - -const mbfl_encoding mbfl_encoding_byte2be = { - mbfl_no_encoding_byte2be, - "byte2be", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const mbfl_encoding mbfl_encoding_byte2le = { - mbfl_no_encoding_byte2le, - "byte2le", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_byte2be_wchar = { - mbfl_no_encoding_byte2be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_byte2be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_byte2be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_byte2be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_byte2be, - mbfl_filt_conv_common_flush }; - -const struct mbfl_convert_vtbl vtbl_byte2le_wchar = { - mbfl_no_encoding_byte2le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_byte2le_wchar, - mbfl_filt_conv_common_flush }; - -const struct mbfl_convert_vtbl vtbl_wchar_byte2le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_byte2le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_byte2le, - mbfl_filt_conv_common_flush }; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -int mbfl_filt_conv_byte2be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff) << 8; - filter->cache = n; - } else { - filter->status = 0; - n = (c & 0xff) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -int mbfl_filt_conv_wchar_byte2be(int c, mbfl_convert_filter *filter) -{ - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - return c; -} - -int mbfl_filt_conv_byte2le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = c & 0xff; - filter->cache = n; - } else { - filter->status = 0; - n = ((c & 0xff) << 8) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -int mbfl_filt_conv_wchar_byte2le(int c, mbfl_convert_filter *filter) -{ - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte2.h b/ext/mbstring/libmbfl/filters/mbfilter_byte2.h deleted file mode 100644 index e762a9db7f9eb..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_byte2.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_BYTE2_H -#define MBFL_MBFILTER_BYTE2_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_byte2be; -extern const mbfl_encoding mbfl_encoding_byte2le; -extern const struct mbfl_convert_vtbl vtbl_byte2be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_byte2be; -extern const struct mbfl_convert_vtbl vtbl_byte2le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_byte2le; - -int mbfl_filt_conv_wchar_byte2be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_byte2be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_byte2le(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_byte2le_wchar(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_BYTE2_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte4.c b/ext/mbstring/libmbfl/filters/mbfilter_byte4.c deleted file mode 100644 index 24b7367fead94..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_byte4.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_byte4.h" - -const mbfl_encoding mbfl_encoding_byte4be = { - mbfl_no_encoding_byte4be, - "byte4be", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const mbfl_encoding mbfl_encoding_byte4le = { - mbfl_no_encoding_byte4le, - "byte4le", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_byte4be_wchar = { - mbfl_no_encoding_byte4be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_byte4be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_byte4be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_byte4be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_byte4be, - mbfl_filt_conv_common_flush }; - -const struct mbfl_convert_vtbl vtbl_byte4le_wchar = { - mbfl_no_encoding_byte4le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_byte4le_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_byte4le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_byte4le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_byte4le, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -int mbfl_filt_conv_byte4be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff) << 24; - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 16; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 8; - filter->cache |= n; - } else { - filter->status = 0; - n = (c & 0xff) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -int mbfl_filt_conv_wchar_byte4be(int c, mbfl_convert_filter *filter) -{ - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - return c; -} - -int mbfl_filt_conv_byte4le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff); - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 8; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 16; - filter->cache |= n; - } else { - filter->status = 0; - n = ((c & 0xff) << 24) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -int mbfl_filt_conv_wchar_byte4le(int c, mbfl_convert_filter *filter) -{ - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte4.h b/ext/mbstring/libmbfl/filters/mbfilter_byte4.h deleted file mode 100644 index f6c0aed2beed8..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_byte4.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_BYTE4_H -#define MBFL_MBFILTER_BYTE4_H - -extern const mbfl_encoding mbfl_encoding_byte4be; -extern const mbfl_encoding mbfl_encoding_byte4le; -extern const struct mbfl_convert_vtbl vtbl_byte4be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_byte4be; -extern const struct mbfl_convert_vtbl vtbl_byte4le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_byte4le; - -int mbfl_filt_conv_wchar_byte4be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_byte4be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_byte4le(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_byte4le_wchar(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_BYTE4_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c deleted file mode 100644 index b5ab8e71b5551..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * The source code included in this files was separated from mbfilter_ru.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_cp1251.h" -#include "unicode_table_cp1251.h" - -static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_cp1251_aliases[] = {"CP1251", "CP-1251", "WINDOWS-1251", NULL}; - -const mbfl_encoding mbfl_encoding_cp1251 = { - mbfl_no_encoding_cp1251, - "Windows-1251", - "Windows-1251", - (const char *(*)[])&mbfl_encoding_cp1251_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_cp1251 = { - mbfl_no_encoding_cp1251, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_cp1251 -}; - -const struct mbfl_convert_vtbl vtbl_wchar_cp1251 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_cp1251, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_cp1251, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_cp1251_wchar = { - mbfl_no_encoding_cp1251, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_cp1251_wchar, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * cp1251 => wchar - */ -int -mbfl_filt_conv_cp1251_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < cp1251_ucs_table_min) { - s = c; - } else if (c >= cp1251_ucs_table_min && c < 0x100) { - s = cp1251_ucs_table[c - cp1251_ucs_table_min]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_CP1251; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => cp1251 - */ -int -mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c < 0x80) { - s = c; - } else { - s = -1; - n = cp1251_ucs_table_len-1; - while (n >= 0) { - if (c == cp1251_ucs_table[n]) { - s = cp1251_ucs_table_min + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1251) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -/* all of this is so ugly now! */ -static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter) -{ - if (c >= 0x80 && c < 0xff) - filter->flag = 0; - else - filter->flag = 1; /* not it */ - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.h b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.h deleted file mode 100644 index 6c0f680b29881..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * the source code included in this files was separated from mbfilter_ru.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_CP1251_H -#define MBFL_MBFILTER_CP1251_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_cp1251; -extern const struct mbfl_identify_vtbl vtbl_identify_cp1251; -extern const struct mbfl_convert_vtbl vtbl_wchar_cp1251; -extern const struct mbfl_convert_vtbl vtbl_cp1251_wchar; - -int mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_cp1251_wchar(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_CP1251_H */ - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c deleted file mode 100644 index ad160821a5f47..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Wez Furlong - * - */ -/* - * the source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_cp1252.h" -#include "unicode_table_cp1252.h" - -static int mbfl_filt_ident_cp1252(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_cp1252_aliases[] = {"cp1252", NULL}; - -const mbfl_encoding mbfl_encoding_cp1252 = { - mbfl_no_encoding_cp1252, - "Windows-1252", - "Windows-1252", - (const char *(*)[])&mbfl_encoding_cp1252_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_cp1252 = { - mbfl_no_encoding_cp1252, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_cp1252 -}; - -const struct mbfl_convert_vtbl vtbl_cp1252_wchar = { - mbfl_no_encoding_cp1252, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_cp1252_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_cp1252 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_cp1252, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_cp1252, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * wchar => cp1252 - */ -int mbfl_filt_conv_wchar_cp1252(int c, mbfl_convert_filter *filter) -{ - int s=-1, n; - - if (c >= 0x100) { - /* look it up from the cp1252 table */ - s = -1; - n = 31; - while (n >= 0) { - if (c == cp1252_ucs_table[n] && c != 0xfffe) { - s = 0x80 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_1) - { - s = c & MBFL_WCSPLANE_MASK; - } - } - else if (c >= 0 && c < 0x100) { - s = c; - } - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - return c; -} - -/* - * cp1252 => wchar - */ -int mbfl_filt_conv_cp1252_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0x80 && c < 0xa0) { - s = cp1252_ucs_table[c - 0x80]; - } else { - s = c; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* We only distinguish the MS extensions to ISO-8859-1. - * Actually, this is pretty much a NO-OP, since the identification - * system doesn't allow us to discriminate between a positive match, - * a possible match and a definite non-match. - * The problem here is that cp1252 looks like SJIS for certain chars. - * */ -static int mbfl_filt_ident_cp1252(int c, mbfl_identify_filter *filter) -{ - if (c >= 0x80 && c < 0xa0) - filter->flag = 0; - else - filter->flag = 1; /* not it */ - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.h b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.h deleted file mode 100644 index 032c30eb9e15f..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Wez Furlong - * - */ -/* - * the source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_CP1252_H -#define MBFL_MBFILTER_CP1252_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_cp1252; -extern const struct mbfl_identify_vtbl vtbl_identify_cp1252; -extern const struct mbfl_convert_vtbl vtbl_cp1252_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_cp1252; - -int mbfl_filt_conv_wchar_cp1252(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_cp1252_wchar(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_CP1252_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c b/ext/mbstring/libmbfl/filters/mbfilter_cp866.c deleted file mode 100644 index 7725d7a266fe3..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * The source code included in this files was separated from mbfilter_ru.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_cp866.h" -#include "unicode_table_cp866.h" - -static int mbfl_filt_ident_cp866(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_cp866_aliases[] = {"CP866", "CP-866", "IBM-866", NULL}; - -const mbfl_encoding mbfl_encoding_cp866 = { - mbfl_no_encoding_cp866, - "CP866", - "CP866", - (const char *(*)[])&mbfl_encoding_cp866_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_cp866 = { - mbfl_no_encoding_cp866, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_cp866 -}; - -const struct mbfl_convert_vtbl vtbl_wchar_cp866 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_cp866, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_cp866, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_cp866_wchar = { - mbfl_no_encoding_cp866, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_cp866_wchar, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * cp866 => wchar - */ -int -mbfl_filt_conv_cp866_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < cp866_ucs_table_min) { - s = c; - } else if (c >= cp866_ucs_table_min && c < 0x100) { - s = cp866_ucs_table[c - cp866_ucs_table_min]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_CP866; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => cp866 - */ -int -mbfl_filt_conv_wchar_cp866(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c < 0x80) { - s = c; - } else { - s = -1; - n = cp866_ucs_table_len-1; - while (n >= 0) { - if (c == cp866_ucs_table[n]) { - s = cp866_ucs_table_min + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP866) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_cp866(int c, mbfl_identify_filter *filter) -{ - if (c >= 0x80 && c < 0xff) - filter->flag = 0; - else - filter->flag = 1; /* not it */ - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp866.h b/ext/mbstring/libmbfl/filters/mbfilter_cp866.h deleted file mode 100644 index 9cb4e257e32b9..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp866.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * The source code included in this files was separated from mbfilter_ru.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_CP866_H -#define MBFL_MBFILTER_CP866_H - -extern const mbfl_encoding mbfl_encoding_cp866; -extern const struct mbfl_identify_vtbl vtbl_identify_cp866; -extern const struct mbfl_convert_vtbl vtbl_wchar_cp866; -extern const struct mbfl_convert_vtbl vtbl_cp866_wchar; - -int mbfl_filt_conv_cp866_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_cp866(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_CP866_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c deleted file mode 100644 index 80f7bfbc6bc90..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * the source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_cp932.h" - -#include "unicode_table_cp932_ext.h" -#include "unicode_table_jis.h" - -static int mbfl_filt_ident_sjiswin(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_sjis[] = { /* 0x80-0x9f,0xE0-0xFF */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static const char *mbfl_encoding_sjis_win_aliases[] = {"SJIS-open", "CP932", "Windows-31J", "MS_Kanji", NULL}; - -const mbfl_encoding mbfl_encoding_sjis_win = { - mbfl_no_encoding_sjis_win, - "SJIS-win", - "Shift_JIS", - (const char *(*)[])&mbfl_encoding_sjis_win_aliases, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_sjiswin = { - mbfl_no_encoding_sjis_win, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_sjiswin -}; - -const struct mbfl_convert_vtbl vtbl_sjiswin_wchar = { - mbfl_no_encoding_sjis_win, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjiswin_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjiswin = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_win, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjiswin, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -#define SJIS_ENCODE(c1,c2,s1,s2) \ - do { \ - s1 = c1; \ - s1--; \ - s1 >>= 1; \ - if ((c1) < 0x5f) { \ - s1 += 0x71; \ - } else { \ - s1 += 0xb1; \ - } \ - s2 = c2; \ - if ((c1) & 1) { \ - if ((c2) < 0x60) { \ - s2--; \ - } \ - s2 += 0x20; \ - } else { \ - s2 += 0x7e; \ - } \ - } while (0) - -#define SJIS_DECODE(c1,c2,s1,s2) \ - do { \ - s1 = c1; \ - if (s1 < 0xa0) { \ - s1 -= 0x81; \ - } else { \ - s1 -= 0xc1; \ - } \ - s1 <<= 1; \ - s1 += 0x21; \ - s2 = c2; \ - if (s2 < 0x9f) { \ - if (s2 < 0x7f) { \ - s2++; \ - } \ - s2 -= 0x20; \ - } else { \ - s1++; \ - s2 -= 0x7e; \ - } \ - } while (0) - - -/* - * SJIS-win => wchar - */ -int -mbfl_filt_conv_sjiswin_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, s1, s2, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xe0) { /* kana */ - CK((*filter->output_function)(0xfec0 + c, filter->data)); - } else if (c > 0x80 && c < 0xfd && c != 0xa0) { /* kanji first char */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* kanji second char */ - filter->status = 0; - c1 = filter->cache; - if (c > 0x39 && c < 0xfd && c != 0x7f) { - w = 0; - SJIS_DECODE(c1, c, s1, s2); - s = (s1 - 0x21)*94 + s2 - 0x21; - if (s <= 137) { - if (s == 31) { - w = 0xff3c; /* FULLWIDTH REVERSE SOLIDUS */ - } else if (s == 32) { - w = 0xff5e; /* FULLWIDTH TILDE */ - } else if (s == 33) { - w = 0x2225; /* PARALLEL TO */ - } else if (s == 60) { - w = 0xff0d; /* FULLWIDTH HYPHEN-MINUS */ - } else if (s == 80) { - w = 0xffe0; /* FULLWIDTH CENT SIGN */ - } else if (s == 81) { - w = 0xffe1; /* FULLWIDTH POUND SIGN */ - } else if (s == 137) { - w = 0xffe2; /* FULLWIDTH NOT SIGN */ - } - } - if (w == 0) { - if (s >= cp932ext1_ucs_table_min && s < cp932ext1_ucs_table_max) { /* vendor ext1 (13ku) */ - w = cp932ext1_ucs_table[s - cp932ext1_ucs_table_min]; - } else if (s >= 0 && s < jisx0208_ucs_table_size) { /* X 0208 */ - w = jisx0208_ucs_table[s]; - } else if (s >= cp932ext2_ucs_table_min && s < cp932ext2_ucs_table_max) { /* vendor ext2 (89ku - 92ku) */ - w = cp932ext2_ucs_table[s - cp932ext2_ucs_table_min]; - } else if (s >= cp932ext3_ucs_table_min && s < cp932ext3_ucs_table_max) { /* vendor ext3 (115ku - 119ku) */ - w = cp932ext3_ucs_table[s - cp932ext3_ucs_table_min]; - } else if (s >= (94*94) && s < (114*94)) { /* user (95ku - 114ku) */ - w = s - (94*94) + 0xe000; - } - } - if (w <= 0) { - w = (s1 << 8) | s2; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_WINCP932; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => SJIS-win - */ -int -mbfl_filt_conv_wchar_sjiswin(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s1, s2; - - s1 = 0; - s2 = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s1 = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s1 = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s1 = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s1 = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } else if (c >= 0xe000 && c < (0xe000 + 20*94)) { /* user (95ku - 114ku) */ - s1 = c - 0xe000; - c1 = s1/94 + 0x7f; - c2 = s1%94 + 0x21; - s1 = (c1 << 8) | c2; - s2 = 1; - } - if (s1 <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_WINCP932) { - s1 = c & MBFL_WCSPLANE_MASK; - s2 = 1; - } else if (c1 == MBFL_WCSPLANE_JIS0208) { - s1 = c & MBFL_WCSPLANE_MASK; - } else if (c1 == MBFL_WCSPLANE_JIS0212) { - s1 = c & MBFL_WCSPLANE_MASK; - s1 |= 0x8080; - } else if (c == 0xa5) { /* YEN SIGN */ - s1 = 0x216f; /* FULLWIDTH YEN SIGN */ - } else if (c == 0x203e) { /* OVER LINE */ - s1 = 0x2131; /* FULLWIDTH MACRON */ - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s1 = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s1 = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s1 = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s1 = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s1 = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s1 = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s1 = 0x224c; - } - } - if ((s1 <= 0) || (s1 >= 0x8080 && s2 == 0)) { /* not found or X 0212 */ - s1 = -1; - c1 = 0; - c2 = cp932ext1_ucs_table_max - cp932ext1_ucs_table_min; - while (c1 < c2) { /* CP932 vendor ext1 (13ku) */ - if (c == cp932ext1_ucs_table[c1]) { - s1 = ((c1/94 + 0x2d) << 8) + (c1%94 + 0x21); - break; - } - c1++; - } - if (s1 <= 0) { - c1 = 0; - c2 = cp932ext3_ucs_table_max - cp932ext3_ucs_table_min; - while (c1 < c2) { /* CP932 vendor ext3 (115ku - 119ku) */ - if (c == cp932ext3_ucs_table[c1]) { - s1 = ((c1/94 + 0x93) << 8) + (c1%94 + 0x21); - break; - } - c1++; - } - } - if (c == 0) { - s1 = 0; - } else if (s1 <= 0) { - s1 = -1; - } - } - if (s1 >= 0) { - if (s1 < 0x100) { /* latin or kana */ - CK((*filter->output_function)(s1, filter->data)); - } else { /* kanji */ - c1 = (s1 >> 8) & 0xff; - c2 = s1 & 0xff; - SJIS_ENCODE(c1, c2, s1, s2); - CK((*filter->output_function)(s1, filter->data)); - CK((*filter->output_function)(s2, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_sjiswin(int c, mbfl_identify_filter *filter) -{ - if (filter->status) { /* kanji second char */ - if (c < 0x40 || c > 0xfc || c == 0x7f) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - } else if (c >= 0 && c < 0x80) { /* latin ok */ - ; - } else if (c > 0xa0 && c < 0xe0) { /* kana ok */ - ; - } else if (c > 0x80 && c < 0xfd && c != 0xa0) { /* kanji first char */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp932.h b/ext/mbstring/libmbfl/filters/mbfilter_cp932.h deleted file mode 100644 index f66baabea5bc4..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp932.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * the source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_CP932_H -#define MBFL_MBFILTER_CP932_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_sjis_win; -extern const struct mbfl_identify_vtbl vtbl_identify_sjiswin; -extern const struct mbfl_convert_vtbl vtbl_sjiswin_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_sjiswin; - -int mbfl_filt_conv_sjiswin_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_sjiswin(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_CP932_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c deleted file mode 100644 index 9cdd0520e848d..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * the source code included in this files was separated from mbfilter_cn.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_cp936.h" - -#include "unicode_table_cp936.h" - -static int mbfl_filt_ident_cp936(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_cp936[] = { /* 0x81-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_cp936_aliases[] = {"CP-936", "GBK", NULL}; - -const mbfl_encoding mbfl_encoding_cp936 = { - mbfl_no_encoding_cp936, - "CP936", - "CP936", - (const char *(*)[])&mbfl_encoding_cp936_aliases, - mblen_table_cp936, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_cp936 = { - mbfl_no_encoding_cp936, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_cp936 -}; - -const struct mbfl_convert_vtbl vtbl_cp936_wchar = { - mbfl_no_encoding_cp936, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_cp936_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_cp936 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_cp936, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_cp936, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * CP936 => wchar - */ -int -mbfl_filt_conv_cp936_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c == 0x80) { /* euro sign */ - CK((*filter->output_function)(0x20ac, filter->data)); - } else if (c > 0x80 && c < 0xff) { /* dbcs lead byte */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status = 0; - c1 = filter->cache; - if ( c1 < 0xff && c1 > 0x80 && c > 0x39 && c < 0xff && c != 0x7f) { - w = (c1 - 0x81)*192 + (c - 0x40); - if (w >= 0 && w < cp936_ucs_table_size) { - w = cp936_ucs_table[w]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_WINCP936; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => CP936 - */ -int -mbfl_filt_conv_wchar_cp936(int c, mbfl_convert_filter *filter) -{ - int c1, s; - - s = 0; - if (c >= ucs_a1_cp936_table_min && c < ucs_a1_cp936_table_max) { - s = ucs_a1_cp936_table[c - ucs_a1_cp936_table_min]; - } else if (c >= ucs_a2_cp936_table_min && c < ucs_a2_cp936_table_max) { - s = ucs_a2_cp936_table[c - ucs_a2_cp936_table_min]; - } else if (c >= ucs_a3_cp936_table_min && c < ucs_a3_cp936_table_max) { - s = ucs_a3_cp936_table[c - ucs_a3_cp936_table_min]; - } else if (c >= ucs_i_cp936_table_min && c < ucs_i_cp936_table_max) { - s = ucs_i_cp936_table[c - ucs_i_cp936_table_min]; - } else if (c >= ucs_ci_cp936_table_min && c < ucs_ci_cp936_table_max) { - s = ucs_ci_cp936_table[c - ucs_ci_cp936_table_min]; - } else if (c >= ucs_cf_cp936_table_min && c < ucs_cf_cp936_table_max) { - s = ucs_cf_cp936_table[c - ucs_cf_cp936_table_min]; - } else if (c >= ucs_sfv_cp936_table_min && c < ucs_sfv_cp936_table_max) { - s = ucs_sfv_cp936_table[c - ucs_sfv_cp936_table_min]; - } else if (c >= ucs_hff_cp936_table_min && c < ucs_hff_cp936_table_max) { - s = ucs_hff_cp936_table[c - ucs_hff_cp936_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_WINCP936) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_cp936(int c, mbfl_identify_filter *filter) -{ - if (filter->status) { /* kanji second char */ - if (c < 0x40 || c > 0xfe || c == 0x7f) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - } else if (c >= 0 && c < 0x80) { /* latin ok */ - ; - } else if (c > 0x80 && c < 0xff) { /* DBCS lead byte */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.h b/ext/mbstring/libmbfl/filters/mbfilter_cp936.h deleted file mode 100644 index 1bd603d157d29..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * the source code included in this files was separated from mbfilter_cn.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_CP936_H -#define MBFL_MBFILTER_CP936_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_cp936; -extern const struct mbfl_identify_vtbl vtbl_identify_cp936; -extern const struct mbfl_convert_vtbl vtbl_cp936_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_cp936; - -int mbfl_filt_conv_cp936_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_cp936(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_CP936_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c deleted file mode 100644 index cc2bcc1cee220..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_cn.c - * by Moriyoshi Koizumi on 4 Dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_euc_cn.h" - -#include "unicode_table_cp936.h" - -static int mbfl_filt_ident_euccn(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_euccn[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_euc_cn_aliases[] = {"CN-GB", "EUC_CN", "eucCN", "x-euc-cn", "gb2312", NULL}; - -const mbfl_encoding mbfl_encoding_euc_cn = { - mbfl_no_encoding_euc_cn, - "EUC-CN", - "CN-GB", - (const char *(*)[])&mbfl_encoding_euc_cn_aliases, - mblen_table_euccn, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_euccn = { - mbfl_no_encoding_euc_cn, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_euccn -}; - -const struct mbfl_convert_vtbl vtbl_euccn_wchar = { - mbfl_no_encoding_euc_cn, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_euccn_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_euccn = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_euc_cn, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_euccn, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * EUC-CN => wchar - */ -int -mbfl_filt_conv_euccn_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff) { /* dbcs lead byte */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status = 0; - c1 = filter->cache; - if (c1 > 0xa0 && c1 < 0xff && c > 0xa0 && c < 0xff) { - w = (c1 - 0x81)*192 + (c - 0x40); - if (w >= 0 && w < cp936_ucs_table_size) { - w = cp936_ucs_table[w]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_GB2312; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => EUC-CN - */ -int -mbfl_filt_conv_wchar_euccn(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s; - - s = 0; - if (c >= ucs_a1_cp936_table_min && c < ucs_a1_cp936_table_max) { - s = ucs_a1_cp936_table[c - ucs_a1_cp936_table_min]; - } else if (c >= ucs_a2_cp936_table_min && c < ucs_a2_cp936_table_max) { - s = ucs_a2_cp936_table[c - ucs_a2_cp936_table_min]; - } else if (c >= ucs_a3_cp936_table_min && c < ucs_a3_cp936_table_max) { - s = ucs_a3_cp936_table[c - ucs_a3_cp936_table_min]; - } else if (c >= ucs_i_cp936_table_min && c < ucs_i_cp936_table_max) { - s = ucs_i_cp936_table[c - ucs_i_cp936_table_min]; - } else if (c >= ucs_hff_cp936_table_min && c < ucs_hff_cp936_table_max) { - s = ucs_hff_cp936_table[c - ucs_hff_cp936_table_min]; - } - c1 = (s >> 8) & 0xff; - c2 = s & 0xff; - - if (c1 < 0xa1 || c2 < 0xa1) { /* exclude CP936 extension */ - s = c; - } - - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_GB2312) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_euccn(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* DBCS lead byte */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - break; - - case 1: /* got lead byte */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.h b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.h deleted file mode 100644 index e72bc08ebfdc9..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_euc_cn.h - * by Moriyoshi Koizumi on 4 Dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_EUC_CN_H -#define MBFL_MBFILTER_EUC_CN_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_euc_cn; -extern const struct mbfl_identify_vtbl vtbl_identify_euccn; -extern const struct mbfl_convert_vtbl vtbl_euccn_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_euccn; - -int mbfl_filt_conv_euccn_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_euccn(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_EUC_CN_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c deleted file mode 100644 index f5c9643772221..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_euc_jp.h" - -#include "unicode_table_cp932_ext.h" -#include "unicode_table_jis.h" - -static int mbfl_filt_ident_eucjp(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_eucjp[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_euc_jp_aliases[] = {"EUC", "EUC_JP", "eucJP", "x-euc-jp", NULL}; - -const mbfl_encoding mbfl_encoding_euc_jp = { - mbfl_no_encoding_euc_jp, - "EUC-JP", - "EUC-JP", - (const char *(*)[])&mbfl_encoding_euc_jp_aliases, - mblen_table_eucjp, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_eucjp = { - mbfl_no_encoding_euc_jp, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_eucjp -}; - -const struct mbfl_convert_vtbl vtbl_eucjp_wchar = { - mbfl_no_encoding_euc_jp, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_eucjp_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_eucjp = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_euc_jp, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_eucjp, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * EUC-JP => wchar - */ -int -mbfl_filt_conv_eucjp_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff) { /* X 0208 first char */ - filter->status = 1; - filter->cache = c; - } else if (c == 0x8e) { /* kana first char */ - filter->status = 2; - } else if (c == 0x8f) { /* X 0212 first char */ - filter->status = 3; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* got first half */ - filter->status = 0; - c1 = filter->cache; - if (c > 0xa0 && c < 0xff) { - s = (c1 - 0xa1)*94 + c - 0xa1; - if (s >= 0 && s < jisx0208_ucs_table_size) { - w = jisx0208_ucs_table[s]; - } else { - w = 0; - } - if (w <= 0) { - w = ((c1 & 0x7f) << 8) | (c & 0x7f); - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0208; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 2: /* got 0x8e */ - filter->status = 0; - if (c > 0xa0 && c < 0xe0) { - w = 0xfec0 + c; - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = 0x8e00 | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 3: /* got 0x8f, X 0212 first char */ - if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else { - filter->status++; - filter->cache = c; - } - break; - case 4: /* got 0x8f, X 0212 second char */ - filter->status = 0; - c1 = filter->cache; - if (c1 > 0xa0 && c1 < 0xff && c > 0xa0 && c < 0xff) { - s = (c1 - 0xa1)*94 + c - 0xa1; - if (s >= 0 && s < jisx0212_ucs_table_size) { - w = jisx0212_ucs_table[s]; - } else { - w = 0; - } - if (w <= 0) { - w = ((c1 & 0x7f) << 8) | (c & 0x7f); - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0212; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c | 0x8f0000; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => EUC-JP - */ -int -mbfl_filt_conv_wchar_eucjp(int c, mbfl_convert_filter *filter) -{ - int c1, s; - - s = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_JIS0208) { - s = c & MBFL_WCSPLANE_MASK; - } else if (c1 == MBFL_WCSPLANE_JIS0212) { - s = c & MBFL_WCSPLANE_MASK; - s |= 0x8080; - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s = 0x224c; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else if (s < 0x100) { /* kana */ - CK((*filter->output_function)(0x8e, filter->data)); - CK((*filter->output_function)(s, filter->data)); - } else if (s < 0x8080) { /* X 0208 */ - CK((*filter->output_function)(((s >> 8) & 0xff) | 0x80, filter->data)); - CK((*filter->output_function)((s & 0xff) | 0x80, filter->data)); - } else { /* X 0212 */ - CK((*filter->output_function)(0x8f, filter->data)); - CK((*filter->output_function)(((s >> 8) & 0xff) | 0x80, filter->data)); - CK((*filter->output_function)((s & 0xff) | 0x80, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_eucjp(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* kanji first char */ - filter->status = 1; - } else if (c == 0x8e) { /* kana first char */ - filter->status = 2; - } else if (c == 0x8f) { /* X 0212 first char */ - filter->status = 3; - } else { /* bad */ - filter->flag = 1; - } - break; - - case 1: /* got first half */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 2: /* got 0x8e */ - if (c < 0xa1 || c > 0xdf) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 3: /* got 0x8f */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status++; - break; - case 4: /* got 0x8f */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.h b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.h deleted file mode 100644 index de1212dfa830f..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_EUC_JP_H -#define MBFL_MBFILTER_EUC_JP_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_euc_jp; -extern const struct mbfl_identify_vtbl vtbl_identify_eucjp; -extern const struct mbfl_convert_vtbl vtbl_eucjp_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_eucjp; - -int mbfl_filt_conv_eucjp_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_eucjp(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_EUC_JP_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c deleted file mode 100644 index e57ae69356248..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c +++ /dev/null @@ -1,420 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_euc_jp_win.h" - -#include "unicode_table_cp932_ext.h" -#include "unicode_table_jis.h" -#include "cp932_table.h" - -static int mbfl_filt_ident_eucjp_win(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_eucjp[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - - -static const char *mbfl_encoding_eucjp_win_aliases[] = {"eucJP-open", NULL}; - -const struct mbfl_identify_vtbl vtbl_identify_eucjpwin = { - mbfl_no_encoding_eucjp_win, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_eucjp_win -}; - -const mbfl_encoding mbfl_encoding_eucjp_win = { - mbfl_no_encoding_eucjp_win, - "eucJP-win", - "EUC-JP", - (const char *(*)[])&mbfl_encoding_eucjp_win_aliases, - mblen_table_eucjp, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_convert_vtbl vtbl_eucjpwin_wchar = { - mbfl_no_encoding_eucjp_win, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_eucjpwin_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_eucjpwin = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_eucjp_win, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_eucjpwin, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * eucJP-win => wchar - */ -int -mbfl_filt_conv_eucjpwin_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, w, n; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff) { /* CP932 first char */ - filter->status = 1; - filter->cache = c; - } else if (c == 0x8e) { /* kana first char */ - filter->status = 2; - } else if (c == 0x8f) { /* X 0212 first char */ - filter->status = 3; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* got first half */ - filter->status = 0; - c1 = filter->cache; - if (c > 0xa0 && c < 0xff) { - w = 0; - s = (c1 - 0xa1)*94 + c - 0xa1; - if (s <= 137) { - if (s == 31) { - w = 0xff3c; /* FULLWIDTH REVERSE SOLIDUS */ - } else if (s == 32) { - w = 0xff5e; /* FULLWIDTH TILDE */ - } else if (s == 33) { - w = 0x2225; /* PARALLEL TO */ - } else if (s == 60) { - w = 0xff0d; /* FULLWIDTH HYPHEN-MINUS */ - } else if (s == 80) { - w = 0xffe0; /* FULLWIDTH CENT SIGN */ - } else if (s == 81) { - w = 0xffe1; /* FULLWIDTH POUND SIGN */ - } else if (s == 137) { - w = 0xffe2; /* FULLWIDTH NOT SIGN */ - } - } - if (w == 0) { - if (s >= cp932ext1_ucs_table_min && s < cp932ext1_ucs_table_max) { /* vendor ext1 (13ku) */ - w = cp932ext1_ucs_table[s - cp932ext1_ucs_table_min]; - } else if (s >= 0 && s < jisx0208_ucs_table_size) { /* X 0208 */ - w = jisx0208_ucs_table[s]; - } else if (s >= (84*94)) { /* user (85ku - 94ku) */ - w = s - (84*94) + 0xe000; - } - } - if (w <= 0) { - w = ((c1 & 0x7f) << 8) | (c & 0x7f); - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_WINCP932; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 2: /* got 0x8e, X0201 kana */ - filter->status = 0; - if (c > 0xa0 && c < 0xe0) { - w = 0xfec0 + c; - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = 0x8e00 | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 3: /* got 0x8f, X 0212 first char */ - if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else { - filter->status++; - filter->cache = c; - } - break; - case 4: /* got 0x8f, X 0212 second char */ - filter->status = 0; - c1 = filter->cache; - if (c1 > 0xa0 && c1 < 0xff && c > 0xa0 && c < 0xff) { - s = (c1 - 0xa1)*94 + c - 0xa1; - if (s >= 0 && s < jisx0212_ucs_table_size) { - w = jisx0212_ucs_table[s]; - } else if (s >= (82*94) && s < (84*94)) { /* vender ext3 (83ku - 84ku) <-> CP932 (115ku -120ku) */ - s = (c1<< 8) | c; - w = 0; - n = 0; - while (n < cp932ext3_eucjp_table_size) { - if (s == cp932ext3_eucjp_table[n]) { - if (n < (cp932ext3_ucs_table_max - cp932ext3_ucs_table_min)) { - w = cp932ext3_ucs_table[n]; - } - break; - } - n++; - } - } else if (s >= (84*94)) { /* user (85ku - 94ku) */ - w = s - (84*94) + (0xe000 + (94*10)); - } else { - w = 0; - } - if (w <= 0) { - w = ((c1 & 0x7f) << 8) | (c & 0x7f); - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0212; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c | 0x8f0000; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => eucJP-win - */ -int -mbfl_filt_conv_wchar_eucjpwin(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s1; - - s1 = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s1 = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s1 = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s1 = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s1 = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } else if (c >= 0xe000 && c < (0xe000 + 10*94)) { /* user (X0208 85ku - 94ku) */ - s1 = c - 0xe000; - c1 = s1/94 + 0x75; - c2 = s1%94 + 0x21; - s1 = (c1 << 8) | c2; - } else if (c >= (0xe000 + 10*94) && c < (0xe000 + 20*94)) { /* user (X0212 85ku - 94ku) */ - s1 = c - (0xe000 + 10*94); - c1 = s1/94 + 0xf5; - c2 = s1%94 + 0xa1; - s1 = (c1 << 8) | c2; - } - if (s1 <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_WINCP932) { - s1 = c & MBFL_WCSPLANE_MASK; - if (s1 >= ((85 + 0x20) << 8)) { /* 85ku - 120ku */ - s1 = -1; - } - } else if (c1 == MBFL_WCSPLANE_JIS0208) { - s1 = c & MBFL_WCSPLANE_MASK; - if (s1 >= ((85 + 0x20) << 8)) { /* 85ku - 94ku */ - s1 = -1; - } - } else if (c1 == MBFL_WCSPLANE_JIS0212) { - s1 = c & MBFL_WCSPLANE_MASK; - if (s1 >= ((83 + 0x20) << 8)) { /* 83ku - 94ku */ - s1 = -1; - } else { - s1 |= 0x8080; - } - } else if (c == 0xa5) { /* YEN SIGN */ - s1 = 0x216f; /* FULLWIDTH YEN SIGN */ - } else if (c == 0x203e) { /* OVER LINE */ - s1 = 0x2131; /* FULLWIDTH MACRON */ - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s1 = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s1 = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s1 = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s1 = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s1 = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s1 = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s1 = 0x224c; - } else { - s1 = -1; - c1 = 0; - c2 = cp932ext1_ucs_table_max - cp932ext1_ucs_table_min; - while (c1 < c2) { /* CP932 vendor ext1 (13ku) */ - if (c == cp932ext1_ucs_table[c1]) { - s1 = ((c1/94 + 0x2d) << 8) + (c1%94 + 0x21); - break; - } - c1++; - } - if (s1 < 0) { - c1 = 0; - c2 = cp932ext3_ucs_table_max - cp932ext3_ucs_table_min; - while (c1 < c2) { /* CP932 vendor ext3 (115ku - 119ku) */ - if (c == cp932ext3_ucs_table[c1]) { - if (c1 < cp932ext3_eucjp_table_size) { - s1 = cp932ext3_eucjp_table[c1]; - } - break; - } - c1++; - } - } - } - if (c == 0) { - s1 = 0; - } else if (s1 <= 0) { - s1 = -1; - } - } - - if (s1 >= 0) { - if (s1 < 0x80) { /* latin */ - CK((*filter->output_function)(s1, filter->data)); - } else if (s1 < 0x100) { /* kana */ - CK((*filter->output_function)(0x8e, filter->data)); - CK((*filter->output_function)(s1, filter->data)); - } else if (s1 < 0x8080) { /* X 0208 */ - CK((*filter->output_function)(((s1 >> 8) & 0xff) | 0x80, filter->data)); - CK((*filter->output_function)((s1 & 0xff) | 0x80, filter->data)); - } else { /* X 0212 */ - CK((*filter->output_function)(0x8f, filter->data)); - CK((*filter->output_function)(((s1 >> 8) & 0xff) | 0x80, filter->data)); - CK((*filter->output_function)((s1 & 0xff) | 0x80, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_eucjp_win(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* kanji first char */ - filter->status = 1; - } else if (c == 0x8e) { /* kana first char */ - filter->status = 2; - } else if (c == 0x8f) { /* X 0212 first char */ - filter->status = 3; - } else { /* bad */ - filter->flag = 1; - } - break; - - case 1: /* got first half */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 2: /* got 0x8e */ - if (c < 0xa1 || c > 0xdf) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 3: /* got 0x8f */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status++; - break; - case 4: /* got 0x8f */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.h b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.h deleted file mode 100644 index 8b79a7241fdf0..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_EUC_JP_WIN_H -#define MBFL_MBFILTER_EUC_JP_WIN_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_eucjp_win; -extern const struct mbfl_identify_vtbl vtbl_identify_eucjpwin; -extern const struct mbfl_convert_vtbl vtbl_eucjpwin_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_eucjpwin; - -int mbfl_filt_conv_eucjpwin_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_eucjpwin(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_EUC_JP_WIN_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c deleted file mode 100644 index 211a3ad5adaed..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_euc_kr.h" -#include "unicode_table_uhc.h" - -static int mbfl_filt_ident_euckr(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_euckr[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_euc_kr_aliases[] = {"EUC_KR", "eucKR", "x-euc-kr", NULL}; - -const mbfl_encoding mbfl_encoding_euc_kr = { - mbfl_no_encoding_euc_kr, - "EUC-KR", - "EUC-KR", - (const char *(*)[])&mbfl_encoding_euc_kr_aliases, - mblen_table_euckr, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_euckr = { - mbfl_no_encoding_euc_kr, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_euckr -}; - -const struct mbfl_convert_vtbl vtbl_euckr_wchar = { - mbfl_no_encoding_euc_kr, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_euckr_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_euckr = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_euc_kr, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_euckr, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * EUC-KR => wchar - */ -int -mbfl_filt_conv_euckr_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w, flag; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff && c != 0xc9) { /* dbcs lead byte */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status = 0; - c1 = filter->cache; - flag = 0; - if (c1 >= 0xa1 && c1 <= 0xc6) { - flag = 1; - } else if (c1 >= 0xc7 && c1 <= 0xfe && c1 != 0xc9) { - flag = 2; - } - if (flag > 0 && c >= 0xa1 && c <= 0xfe) { - if (flag == 1){ /* 1st: 0xa1..0xc6, 2nd: 0x41..0x7a, 0x81..0xfe */ - w = (c1 - 0xa1)*190 + (c - 0x41); - if (w >= 0 && w < uhc2_ucs_table_size) { - w = uhc2_ucs_table[w]; - } else { - w = 0; - } - } else { /* 1st: 0xc7..0xc8,0xca..0xfe, 2nd: 0xa1..0xfe */ - w = (c1 - 0xc7)*94 + (c - 0xa1); - if (w >= 0 && w < uhc3_ucs_table_size) { - w = uhc3_ucs_table[w]; - } else { - w = 0; - } - } - - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_KSC5601; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => EUC-KR - */ -int -mbfl_filt_conv_wchar_euckr(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s; - - s = 0; - - if (c >= ucs_a1_uhc_table_min && c < ucs_a1_uhc_table_max) { - s = ucs_a1_uhc_table[c - ucs_a1_uhc_table_min]; - } else if (c >= ucs_a2_uhc_table_min && c < ucs_a2_uhc_table_max) { - s = ucs_a2_uhc_table[c - ucs_a2_uhc_table_min]; - } else if (c >= ucs_a3_uhc_table_min && c < ucs_a3_uhc_table_max) { - s = ucs_a3_uhc_table[c - ucs_a3_uhc_table_min]; - } else if (c >= ucs_i_uhc_table_min && c < ucs_i_uhc_table_max) { - s = ucs_i_uhc_table[c - ucs_i_uhc_table_min]; - } else if (c >= ucs_s_uhc_table_min && c < ucs_s_uhc_table_max) { - s = ucs_s_uhc_table[c - ucs_s_uhc_table_min]; - } else if (c >= ucs_r1_uhc_table_min && c < ucs_r1_uhc_table_max) { - s = ucs_r1_uhc_table[c - ucs_r1_uhc_table_min]; - } else if (c >= ucs_r2_uhc_table_min && c < ucs_r2_uhc_table_max) { - s = ucs_r2_uhc_table[c - ucs_r2_uhc_table_min]; - } - - c1 = (s >> 8) & 0xff; - c2 = s & 0xff; - /* exclude UHC extension area */ - if (c1 < 0xa1 || c2 < 0xa1){ - s = c; - } - - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_KSC5601) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_euckr(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* DBCS lead byte */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - break; - - case 1: /* got lead byte */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.h b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.h deleted file mode 100644 index 5ccbe7944582f..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_EUC_KR_H -#define MBFL_MBFILTER_EUC_KR_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_euc_kr; -extern const struct mbfl_identify_vtbl vtbl_identify_euckr; -extern const struct mbfl_convert_vtbl vtbl_euckr_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_euckr; - -int mbfl_filt_conv_euckr_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_euckr(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_EUC_KR_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c deleted file mode 100644 index 95665d056266b..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ -/* - * The source code included in this files was separated from mbfilter_tw.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_euc_tw.h" - -#include "unicode_table_cns11643.h" - -static int mbfl_filt_ident_euctw(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_euctw[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - - -static const char *mbfl_encoding_euc_tw_aliases[] = {"EUC_TW", "eucTW", "x-euc-tw", NULL}; - -const mbfl_encoding mbfl_encoding_euc_tw = { - mbfl_no_encoding_euc_tw, - "EUC-TW", - "EUC-TW", - (const char *(*)[])&mbfl_encoding_euc_tw_aliases, - mblen_table_euctw, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_euctw = { - mbfl_no_encoding_euc_tw, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_euctw -}; - -const struct mbfl_convert_vtbl vtbl_euctw_wchar = { - mbfl_no_encoding_euc_tw, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_euctw_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_euctw = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_euc_tw, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_euctw, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * EUC-TW => wchar - */ -int -mbfl_filt_conv_euctw_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, w, plane; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xff) { /* dbcs first byte */ - filter->status = 1; - filter->cache = c; - } else if (c == 0x8e) { /* mbcs first byte */ - filter->status = 2; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* mbcs second byte */ - filter->status = 0; - c1 = filter->cache; - if (c > 0xa0 && c < 0xff) { - w = (c1 - 0xa1)*94 + (c - 0xa1); - if (w >= 0 && w < cns11643_1_ucs_table_size) { - w = cns11643_1_ucs_table[w]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_CNS11643; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 2: /* got 0x8e, first char */ - c1 = filter->cache; - if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else if (c > 0xa0 && c < 0xaf) { - filter->status = 3; - filter->cache = c - 0xa1; - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 3: /* got 0x8e, third char */ - filter->status = 0; - c1 = filter->cache; - if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else if (c > 0xa0 && c < 0xff) { - filter->status = 4; - filter->cache = (c1 << 8) + c - 0xa1; - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 4: /* mbcs fourth char */ - filter->status = 0; - c1 = filter->cache; - if (c1 >= 0x100 && c1 <= 0xdff && c > 0xa0 && c < 0xff) { - plane = (c1 & 0xf00) >> 8; - s = (c1 & 0xff)*94 + c - 0xa1; - w = 0; - if (s >= 0) { - if (plane == 1 && s < cns11643_2_ucs_table_size) { - w = cns11643_2_ucs_table[s]; - } - if (plane == 13 && s < cns11643_14_ucs_table_size) { - w = cns11643_14_ucs_table[s]; - } - } - if (w <= 0) { - w = ((c1 & 0x7f) << 8) | (c & 0x7f); - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_CNS11643; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c | 0x8e0000; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => EUC-TW - */ -int -mbfl_filt_conv_wchar_euctw(int c, mbfl_convert_filter *filter) -{ - int c1, s, plane; - - s = 0; - if (c >= ucs_a1_cns11643_table_min && c < ucs_a1_cns11643_table_max) { - s = ucs_a1_cns11643_table[c - ucs_a1_cns11643_table_min]; - } else if (c >= ucs_a2_cns11643_table_min && c < ucs_a2_cns11643_table_max) { - s = ucs_a2_cns11643_table[c - ucs_a2_cns11643_table_min]; - } else if (c >= ucs_a3_cns11643_table_min && c < ucs_a3_cns11643_table_max) { - s = ucs_a3_cns11643_table[c - ucs_a3_cns11643_table_min]; - } else if (c >= ucs_i_cns11643_table_min && c < ucs_i_cns11643_table_max) { - s = ucs_i_cns11643_table[c - ucs_i_cns11643_table_min]; - } else if (c >= ucs_r_cns11643_table_min && c < ucs_r_cns11643_table_max) { - s = ucs_r_cns11643_table[c - ucs_r_cns11643_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_CNS11643) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - plane = (s & 0x1f0000) >> 16; - if (plane <= 1){ - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - s = (s & 0xffff) | 0x8080; - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - s = (0x8ea00000 + (plane << 16)) | ((s & 0xffff) | 0x8080); - CK((*filter->output_function)(0x8e , filter->data)); - CK((*filter->output_function)((s >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - return c; -} - -static int mbfl_filt_ident_euctw(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c > 0xa0 && c < 0xff) { /* DBCS lead byte */ - filter->status = 1; - } else if (c == 0x8e) { /* DBCS lead byte */ - filter->status = 2; - } else { /* bad */ - filter->flag = 1; - } - break; - - case 1: /* got lead byte */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 2: /* got lead byte */ - if (c >= 0xa1 && c < 0xaf) { /* ok */ - filter->status = 3; - } else { - filter->flag = 1; /* bad */ - } - break; - - case 3: /* got lead byte */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 4; - break; - - case 4: /* got lead byte */ - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.h b/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.h deleted file mode 100644 index 64071809d0024..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ -/* - * The source code included in this files was separated from mbfilter_tw.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_EUC_TW_H -#define MBFL_MBFILTER_EUC_TW_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_euc_tw; -extern const struct mbfl_identify_vtbl vtbl_identify_euctw; -extern const struct mbfl_convert_vtbl vtbl_euctw_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_euctw; - -int mbfl_filt_conv_euctw_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_euctw(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_EUC_TW_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c deleted file mode 100644 index 40c24c3424e56..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Marcus Boerger - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#include "mbfilter.h" -#include "mbfilter_htmlent.h" -#include "html_entities.h" - -static const int htmlentitifieds[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -static const char *mbfl_encoding_html_ent_aliases[] = {"HTML", "html", NULL}; - -const mbfl_encoding mbfl_encoding_html_ent = { - mbfl_no_encoding_html_ent, - "HTML-ENTITIES", - "HTML-ENTITIES", - (const char *(*)[])&mbfl_encoding_html_ent_aliases, - NULL, - MBFL_ENCTYPE_HTML_ENT -}; - -const struct mbfl_convert_vtbl vtbl_wchar_html = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_html_ent, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_html_enc, - mbfl_filt_conv_html_enc_flush -}; - -const struct mbfl_convert_vtbl vtbl_html_wchar = { - mbfl_no_encoding_html_ent, - mbfl_no_encoding_wchar, - mbfl_filt_conv_html_dec_ctor, - mbfl_filt_conv_html_dec_dtor, - mbfl_filt_conv_html_dec, - mbfl_filt_conv_html_dec_flush }; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * any => HTML - */ -int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter) -{ - int tmp[64]; - int i; - unsigned int uc; - const mbfl_html_entity_entry *e; - - if (c < sizeof(htmlentitifieds) / sizeof(htmlentitifieds[0]) && - htmlentitifieds[c] != 1) { - CK((*filter->output_function)(c, filter->data)); - } else { - CK((*filter->output_function)('&', filter->data)); - for (i = 0; (e = &mbfl_html_entity_list[i])->name != NULL; i++) { - if (c == e->code) { - char *p; - - for (p = e->name; *p != '\0'; p++) { - CK((*filter->output_function)((int)*p, filter->data)); - } - goto last; - } - } - - { - int *p = tmp + sizeof(tmp) / sizeof(tmp[0]); - - CK((*filter->output_function)('#', filter->data)); - - uc = (unsigned int)c; - - *(--p) = '\0'; - do { - *(--p) = "0123456789"[uc % 10]; - uc /= 10; - } while (uc); - - for (; *p != '\0'; p++) { - CK((*filter->output_function)(*p, filter->data)); - } - } - last: - CK((*filter->output_function)(';', filter->data)); - } - return c; -} - -int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter) -{ - filter->status = 0; - filter->opaque = NULL; - return 0; -} - -/* - * HTML => any - */ -#define html_enc_buffer_size 16 -static const char html_entity_chars[] = "#0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - -void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter) -{ - filter->status = 0; - filter->opaque = mbfl_malloc(html_enc_buffer_size+1); -} - -void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter) -{ - filter->status = 0; - if (filter->opaque) - { - mbfl_free((void*)filter->opaque); - } - filter->opaque = NULL; -} - -int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter) -{ - int pos, ent = 0; - mbfl_html_entity_entry *entity; - char *buffer = (char*)filter->opaque; - - if (!filter->status) { - if (c == '&' ) { - filter->status = 1; - buffer[0] = '&'; - } else { - CK((*filter->output_function)(c, filter->data)); - } - } else { - if (c == ';') { - buffer[filter->status] = 0; - if (buffer[1]=='#') { - /* numeric entity */ - for (pos=2; posstatus; pos++) { - ent = ent*10 + (buffer[pos] - '0'); - } - CK((*filter->output_function)(ent, filter->data)); - filter->status = 0; - /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/ - } else { - /* named entity */ - entity = (mbfl_html_entity_entry *)mbfl_html_entity_list; - while (entity->name) { - if (!strcmp(buffer+1, entity->name)) { - ent = entity->code; - break; - } - entity++; - } - if (ent) { - /* decoded */ - CK((*filter->output_function)(ent, filter->data)); - filter->status = 0; - /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE,"mbstring decoded '%s'=%d", buffer, ent);*/ - } else { - /* failure */ - buffer[filter->status++] = ';'; - buffer[filter->status] = 0; - /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer); */ - mbfl_filt_conv_html_dec_flush(filter); - } - } - } else { - /* add character */ - buffer[filter->status++] = c; - /* add character and check */ - if (!strchr(html_entity_chars, c) || filter->status+1==html_enc_buffer_size || (c=='#' && filter->status>2)) - { - /* illegal character or end of buffer */ - if (c=='&') - filter->status--; - buffer[filter->status] = 0; - /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer)l */ - mbfl_filt_conv_html_dec_flush(filter); - if (c=='&') - { - filter->status = 1; - buffer[0] = '&'; - } - } - } - } - return c; -} - -int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter) -{ - int status, pos = 0; - char *buffer; - - buffer = (char*)filter->opaque; - status = filter->status; - /* flush fragments */ - while (status--) { - CK((*filter->output_function)(buffer[pos++], filter->data)); - } - filter->status = 0; - /*filter->buffer = 0; of cause NOT*/ - return 0; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.h b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.h deleted file mode 100644 index 99827c2303a3c..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Marcus Boerger - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_HTMLENT_H -#define MBFL_MBFILTER_HTMLENT_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_html_ent; -extern const struct mbfl_convert_vtbl vtbl_wchar_html; -extern const struct mbfl_convert_vtbl vtbl_html_wchar; - -void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter); -void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter); -int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter); -int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter); -void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter); -void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_HTMLENT_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_hz.c b/ext/mbstring/libmbfl/filters/mbfilter_hz.c deleted file mode 100644 index 7c7eaffc070c0..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_hz.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_cn.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_hz.h" - -#include "unicode_table_cp936.h" - -static int mbfl_filt_ident_hz(int c, mbfl_identify_filter *filter); - -const mbfl_encoding mbfl_encoding_hz = { - mbfl_no_encoding_hz, - "HZ", - "HZ-GB-2312", - NULL, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const struct mbfl_identify_vtbl vtbl_identify_hz = { - mbfl_no_encoding_hz, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_hz -}; - -const struct mbfl_convert_vtbl vtbl_hz_wchar = { - mbfl_no_encoding_hz, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_hz_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_hz = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_hz, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_hz, - mbfl_filt_conv_any_hz_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * HZ => wchar - */ -int -mbfl_filt_conv_hz_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, w; - - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: GB2312 */ - case 0: - if (c == 0x7e) { - filter->status += 2; - } else if (filter->status == 0x10 && c > 0x20 && c < 0x7f) { /* DBCS first char */ - filter->cache = c; - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - -/* case 0x11: GB2312 second char */ - case 1: - filter->status &= ~0xf; - c1 = filter->cache; - if (c1 > 0x20 && c1 < 0x7f && c > 0x20 && c < 0x7f) { - s = (c1 - 1)*192 + c + 0x40; /* GB2312 */ - if (s >= 0 && s < cp936_ucs_table_size) { - w = cp936_ucs_table[s]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_GB2312; - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - /* '~' */ - case 2: - if (c == 0x7d) { /* '}' */ - filter->status = 0x0; - } else if (c == 0x7b) { /* '{' */ - filter->status = 0x10; - } else if (c == 0x7e) { /* '~' */ - filter->status = 0x0; - CK((*filter->output_function)(0x007e, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => HZ - */ -int -mbfl_filt_conv_wchar_hz(int c, mbfl_convert_filter *filter) -{ - int s; - - s = 0; - if (c >= ucs_a1_cp936_table_min && c < ucs_a1_cp936_table_max) { - s = ucs_a1_cp936_table[c - ucs_a1_cp936_table_min]; - } else if (c >= ucs_a2_cp936_table_min && c < ucs_a2_cp936_table_max) { - s = ucs_a2_cp936_table[c - ucs_a2_cp936_table_min]; - } else if (c >= ucs_a3_cp936_table_min && c < ucs_a3_cp936_table_max) { - s = ucs_a3_cp936_table[c - ucs_a3_cp936_table_min]; - } else if (c >= ucs_i_cp936_table_min && c < ucs_i_cp936_table_max) { - s = ucs_i_cp936_table[c - ucs_i_cp936_table_min]; - } else if (c >= ucs_hff_cp936_table_min && c < ucs_hff_cp936_table_max) { - s = ucs_hff_cp936_table[c - ucs_hff_cp936_table_min]; - } - if (s & 0x8000) { - s -= 0x8080; - } - - if (s <= 0) { - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } else if ((s >= 0x80 && s < 0x2121) || (s > 0x8080)) { - s = -1; - } - if (s >= 0) { - if (s < 0x80) { /* ASCII */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x7e, filter->data)); /* '~' */ - CK((*filter->output_function)(0x7d, filter->data)); /* '}' */ - } - filter->status = 0; - if (s == 0x7e){ - CK((*filter->output_function)(0x7e, filter->data)); - } - CK((*filter->output_function)(s, filter->data)); - } else { /* GB 2312-80 */ - if ((filter->status & 0xff00) != 0x200) { - CK((*filter->output_function)(0x7e, filter->data)); /* '~' */ - CK((*filter->output_function)(0x7b, filter->data)); /* '{' */ - } - filter->status = 0x200; - CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); - CK((*filter->output_function)(s & 0x7f, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -int -mbfl_filt_conv_any_hz_flush(mbfl_convert_filter *filter) -{ - /* back to latin */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x7e, filter->data)); /* ~ */ - CK((*filter->output_function)(0x7d, filter->data)); /* '{' */ - } - filter->status &= 0xff; - return 0; -} - -static int mbfl_filt_ident_hz(int c, mbfl_identify_filter *filter) -{ - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: GB2312 */ - case 0: - if (c == 0x7e) { - filter->status += 2; - } else if (filter->status == 0x10 && c > 0x20 && c < 0x7f) { /* DBCS first char */ - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - ; - } else { - filter->flag = 1; /* bad */ - } - break; - -/* case 0x11: GB2312 second char */ - case 1: - filter->status &= ~0xf; - if (c < 0x21 || c > 0x7e) { /* bad */ - filter->flag = 1; - } - break; - - case 2: - if (c == 0x7d) { /* '}' */ - filter->status = 0; - } else if (c == 0x7b) { /* '{' */ - filter->status = 0x10; - } else if (c == 0x7e) { /* '~' */ - filter->status = 0; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_hz.h b/ext/mbstring/libmbfl/filters/mbfilter_hz.h deleted file mode 100644 index 1e7ebc334d9c7..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_hz.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_cn.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_HZ_H -#define MBFL_MBFILTER_HZ_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_hz; -extern const struct mbfl_identify_vtbl vtbl_identify_hz; -extern const struct mbfl_convert_vtbl vtbl_hz_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_hz; - -int mbfl_filt_conv_hz_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_hz(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_any_hz_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_HZ_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c deleted file mode 100644 index 263476d628880..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso2022_kr.h" -#include "unicode_table_uhc.h" - -static int mbfl_filt_ident_2022kr(int c, mbfl_identify_filter *filter); - -const mbfl_encoding mbfl_encoding_2022kr = { - mbfl_no_encoding_2022kr, - "ISO-2022-KR", - "ISO-2022-KR", - NULL, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const struct mbfl_identify_vtbl vtbl_identify_2022kr = { - mbfl_no_encoding_2022kr, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_2022kr -}; - -const struct mbfl_convert_vtbl vtbl_wchar_2022kr = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_2022kr, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_2022kr, - mbfl_filt_conv_any_2022kr_flush -}; - -const struct mbfl_convert_vtbl vtbl_2022kr_wchar = { - mbfl_no_encoding_2022kr, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_2022kr_wchar, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-2022-KR => wchar - */ -int -mbfl_filt_conv_2022kr_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w, flag; - -retry: - switch (filter->status & 0xf) { - /* case 0x00: ASCII */ - /* case 0x10: KSC5601 */ - case 0: - if (c == 0x1b) { /* ESC */ - filter->status += 2; - } else if (c == 0x0f) { /* SI (ASCII) */ - filter->status &= ~0xff; - } else if (c == 0x0e) { /* SO (KSC5601) */ - filter->status |= 0x10; - } else if ((filter->status & 0x10) != 0 && c > 0x20 && c < 0x7f) { - /* KSC5601 lead byte */ - filter->cache = c; - filter->status += 1; - } else if ((filter->status & 0x10) == 0 && c >= 0 && c < 0x80) { - /* latin, CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status &= ~0xf; - c1 = filter->cache; - flag = 0; - if (c1 > 0x20 && c1 < 0x47) { - flag = 1; - } else if (c1 >= 0x47 && c1 <= 0x7e && c1 != 0x49) { - flag = 2; - } - if (flag > 0 && c > 0x20 && c < 0x7f) { - if (flag == 1){ - w = (c1 - 0x21)*190 + (c - 0x41) + 0x80; - if (w >= 0 && w < uhc2_ucs_table_size) { - w = uhc2_ucs_table[w]; - } else { - w = 0; - } - } else { - w = (c1 - 0x47)*94 + (c - 0x21); - if (w >= 0 && w < uhc3_ucs_table_size) { - w = uhc3_ucs_table[w]; - } else { - w = 0; - } - } - - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_KSC5601; - } - CK((*filter->output_function)(w, filter->data)); - } else if (c == 0x1b) { /* ESC */ - filter->status++; - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 2: /* ESC */ - if (c == 0x24) { /* '$' */ - filter->status++; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - goto retry; - } - break; - case 3: /* ESC $ */ - if (c == 0x29) { /* ')' */ - filter->status++; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - CK((*filter->output_function)(0x24, filter->data)); - goto retry; - } - break; - case 4: /* ESC $ ) */ - if (c == 0x43) { /* 'C' */ - filter->status &= ~0xf; - filter->status |= 0x100; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - CK((*filter->output_function)(0x24, filter->data)); - CK((*filter->output_function)(0x29, filter->data)); - goto retry; - } - break; - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => ISO-2022-KR - */ -int -mbfl_filt_conv_wchar_2022kr(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s; - - s = 0; - - if (c >= ucs_a1_uhc_table_min && c < ucs_a1_uhc_table_max) { - s = ucs_a1_uhc_table[c - ucs_a1_uhc_table_min]; - } else if (c >= ucs_a2_uhc_table_min && c < ucs_a2_uhc_table_max) { - s = ucs_a2_uhc_table[c - ucs_a2_uhc_table_min]; - } else if (c >= ucs_a3_uhc_table_min && c < ucs_a3_uhc_table_max) { - s = ucs_a3_uhc_table[c - ucs_a3_uhc_table_min]; - } else if (c >= ucs_i_uhc_table_min && c < ucs_i_uhc_table_max) { - s = ucs_i_uhc_table[c - ucs_i_uhc_table_min]; - } else if (c >= ucs_s_uhc_table_min && c < ucs_s_uhc_table_max) { - s = ucs_s_uhc_table[c - ucs_s_uhc_table_min]; - } else if (c >= ucs_r1_uhc_table_min && c < ucs_r1_uhc_table_max) { - s = ucs_r1_uhc_table[c - ucs_r1_uhc_table_min]; - } else if (c >= ucs_r2_uhc_table_min && c < ucs_r2_uhc_table_max) { - s = ucs_r2_uhc_table[c - ucs_r2_uhc_table_min]; - } - - c1 = (s >> 8) & 0xff; - c2 = s & 0xff; - /* exclude UHC extension area */ - if (c1 < 0xa1 || c2 < 0xa1){ - s = c; - } - if (s & 0x8000) { - s -= 0x8080; - } - - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_KSC5601) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } else if ((s >= 0x80 && s < 0x2121) || (s > 0x8080)) { - s = -1; - } - if (s >= 0) { - if (s < 0x80 && s > 0) { /* ASCII */ - if ((filter->status & 0x10) != 0) { - CK((*filter->output_function)(0x0f, filter->data)); /* SI */ - filter->status &= ~0x10; - } - CK((*filter->output_function)(s, filter->data)); - } else { - if ( (filter->status & 0x100) == 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x29, filter->data)); /* ')' */ - CK((*filter->output_function)(0x43, filter->data)); /* 'C' */ - filter->status |= 0x100; - } - if ((filter->status & 0x10) == 0) { - CK((*filter->output_function)(0x0e, filter->data)); /* SO */ - filter->status |= 0x10; - } - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -int -mbfl_filt_conv_any_2022kr_flush(mbfl_convert_filter *filter) -{ - /* back to ascii */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x0f, filter->data)); /* SI */ - } - filter->status &= 0xff; - return 0; -} - -static int mbfl_filt_ident_2022kr(int c, mbfl_identify_filter *filter) -{ -retry: - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: KSC5601 mode */ -/* case 0x20: KSC5601 DBCS */ -/* case 0x40: KSC5601 SBCS */ - case 0: - if (!(filter->status & 0x10)) { - if (c == 0x1b) - filter->status += 2; - } else if (filter->status == 0x20 && c > 0x20 && c < 0x7f) { /* kanji first char */ - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - ; - } else { - filter->flag = 1; /* bad */ - } - break; - -/* case 0x21: KSC5601 second char */ - case 1: - filter->status &= ~0xf; - if (c < 0x21 || c > 0x7e) { /* bad */ - filter->flag = 1; - } - break; - - /* ESC */ - case 2: - if (c == 0x24) { /* '$' */ - filter->status++; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC $ */ - case 3: - if (c == 0x29) { /* ')' */ - filter->status++; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC $) */ - case 5: - if (c == 0x43) { /* 'C' */ - filter->status = 0x10; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.h b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.h deleted file mode 100644 index 1dd9f693519b7..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO2022_KR_H -#define MBFL_MBFILTER_ISO2022_KR_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_2022kr; -extern const struct mbfl_identify_vtbl vtbl_identify_2022kr; -extern const struct mbfl_convert_vtbl vtbl_wchar_2022kr; -extern const struct mbfl_convert_vtbl vtbl_2022kr_wchar; - -int mbfl_filt_conv_2022kr_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_2022kr(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_any_2022kr_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO2022_KR_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c deleted file mode 100644 index 901bbb7eec07c..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_1.h" - -static const char *mbfl_encoding_8859_1_aliases[] = {"ISO_8859-1", "latin1", NULL}; - -const mbfl_encoding mbfl_encoding_8859_1 = { - mbfl_no_encoding_8859_1, - "ISO-8859-1", - "ISO-8859-1", - (const char *(*)[])&mbfl_encoding_8859_1_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_1 = { - mbfl_no_encoding_8859_1, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_1_wchar = { - mbfl_no_encoding_8859_1, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_1_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_1 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_1, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_1, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-1 => wchar - */ -int mbfl_filt_conv_8859_1_wchar(int c, mbfl_convert_filter *filter) -{ - return (*filter->output_function)(c, filter->data); -} - -/* - * wchar => ISO-8859-1 - */ -int mbfl_filt_conv_wchar_8859_1(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < 0x100) { - CK((*filter->output_function)(c, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.h deleted file mode 100644 index d55a457679d7e..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_1_H -#define MBFL_MBFILTER_ISO8859_1_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_1; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_1; -extern const struct mbfl_convert_vtbl vtbl_8859_1_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_1; - -int mbfl_filt_conv_8859_1_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_1(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_1_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c deleted file mode 100644 index b0f80e7a1722d..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_10.h" -#include "unicode_table_iso8859_10.h" - -static const char *mbfl_encoding_8859_10_aliases[] = {"ISO_8859-10", "latin6", NULL}; - -const mbfl_encoding mbfl_encoding_8859_10 = { - mbfl_no_encoding_8859_10, - "ISO-8859-10", - "ISO-8859-10", - (const char *(*)[])&mbfl_encoding_8859_10_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_10 = { - mbfl_no_encoding_8859_10, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_10_wchar = { - mbfl_no_encoding_8859_10, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_10_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_10 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_10, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_10, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-10 => wchar - */ -int mbfl_filt_conv_8859_10_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_10_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_10; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-10 - */ -int mbfl_filt_conv_wchar_8859_10(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_10_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_10) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.h deleted file mode 100644 index 3743422c6d1ae..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_10_H -#define MBFL_MBFILTER_ISO8859_10_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_10; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_10; -extern const struct mbfl_convert_vtbl vtbl_8859_10_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_10; - -int mbfl_filt_conv_8859_10_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_10(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_10_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c deleted file mode 100644 index 674db7e4698e6..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_13.h" -#include "unicode_table_iso8859_13.h" - -static const char *mbfl_encoding_8859_13_aliases[] = {"ISO_8859-13", NULL}; - -const mbfl_encoding mbfl_encoding_8859_13 = { - mbfl_no_encoding_8859_13, - "ISO-8859-13", - "ISO-8859-13", - (const char *(*)[])&mbfl_encoding_8859_13_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_13 = { - mbfl_no_encoding_8859_13, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_13_wchar = { - mbfl_no_encoding_8859_13, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_13_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_13 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_13, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_13, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-13 => wchar - */ -int mbfl_filt_conv_8859_13_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_13_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_13; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-13 - */ -int mbfl_filt_conv_wchar_8859_13(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_13_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_13) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.h deleted file mode 100644 index 594575c981beb..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_13_H -#define MBFL_MBFILTER_ISO8859_13_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_13; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_13; -extern const struct mbfl_convert_vtbl vtbl_8859_13_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_13; - -int mbfl_filt_conv_8859_13_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_13(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_13_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c deleted file mode 100644 index c0d241c8425e7..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_14.h" -#include "unicode_table_iso8859_14.h" - -static const char *mbfl_encoding_8859_14_aliases[] = {"ISO_8859-14", "latin8", NULL}; - -const mbfl_encoding mbfl_encoding_8859_14 = { - mbfl_no_encoding_8859_14, - "ISO-8859-14", - "ISO-8859-14", - (const char *(*)[])&mbfl_encoding_8859_14_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_14 = { - mbfl_no_encoding_8859_14, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_14_wchar = { - mbfl_no_encoding_8859_14, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_14_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_14 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_14, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_14, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-14 => wchar - */ -int mbfl_filt_conv_8859_14_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_14_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_14; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-14 - */ -int mbfl_filt_conv_wchar_8859_14(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_14_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_14) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.h deleted file mode 100644 index 0006baedb6540..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * COPYRIGHT NOTICE - * - * This file is a portion of "streamable kanji code filter and converter" - * library, which is distributed under GNU Lesser General Public License - * version 2.1. - * - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_14_H -#define MBFL_MBFILTER_ISO8859_14_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_14; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_14; -extern const struct mbfl_convert_vtbl vtbl_8859_14_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_14; - -int mbfl_filt_conv_8859_14_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_14(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_14_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c deleted file mode 100644 index af321d671f0d1..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_15.h" -#include "unicode_table_iso8859_15.h" - -static const char *mbfl_encoding_8859_15_aliases[] = {"ISO_8859-15", NULL}; - -const mbfl_encoding mbfl_encoding_8859_15 = { - mbfl_no_encoding_8859_15, - "ISO-8859-15", - "ISO-8859-15", - (const char *(*)[])&mbfl_encoding_8859_15_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_15 = { - mbfl_no_encoding_8859_15, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_15_wchar = { - mbfl_no_encoding_8859_15, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_15_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_15 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_15, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_15, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-15 => wchar - */ -int mbfl_filt_conv_8859_15_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_15_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_15; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-15 - */ -int mbfl_filt_conv_wchar_8859_15(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_15_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_15) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.h deleted file mode 100644 index b5054dec2c431..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * COPYRIGHT NOTICE - * - * This file is a portion of "streamable kanji code filter and converter" - * library, which is distributed under GNU Lesser General Public License - * version 2.1. - * - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 4 Dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_15_H -#define MBFL_MBFILTER_ISO8859_15_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_15; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_15; -extern const struct mbfl_convert_vtbl vtbl_8859_15_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_15; - -int mbfl_filt_conv_8859_15_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_15(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_15_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c deleted file mode 100755 index 8f12feb47e866..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_16.h" -#include "unicode_table_iso8859_16.h" - -static const char *mbfl_encoding_8859_16_aliases[] = {"ISO_8859-16", NULL}; - -const mbfl_encoding mbfl_encoding_8859_16 = { - mbfl_no_encoding_8859_16, - "ISO-8859-16", - "ISO-8859-16", - (const char *(*)[])&mbfl_encoding_8859_16_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_16 = { - mbfl_no_encoding_8859_16, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_16_wchar = { - mbfl_no_encoding_8859_16, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_16_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_16 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_16, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_16, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-16 => wchar - */ -int mbfl_filt_conv_8859_16_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_16_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_16; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-16 - */ -int mbfl_filt_conv_wchar_8859_16(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_16_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_16) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.h deleted file mode 100755 index a5e2d2fbef631..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * COPYRIGHT NOTICE - * - * This file is a portion of "streamable kanji code filter and converter" - * library, which is distributed under GNU Lesser General Public License - * version 2.1. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_16_H -#define MBFL_MBFILTER_ISO8859_16_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_16; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_16; -extern const struct mbfl_convert_vtbl vtbl_8859_16_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_16; - -int mbfl_filt_conv_8859_16_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_16(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_16_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c deleted file mode 100644 index c52c72ae627ff..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_2.h" -#include "unicode_table_iso8859_2.h" - -static const char *mbfl_encoding_8859_2_aliases[] = {"ISO_8859-2", "latin2", NULL}; - -const mbfl_encoding mbfl_encoding_8859_2 = { - mbfl_no_encoding_8859_2, - "ISO-8859-2", - "ISO-8859-2", - (const char *(*)[])&mbfl_encoding_8859_2_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_2 = { - mbfl_no_encoding_8859_2, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_2_wchar = { - mbfl_no_encoding_8859_2, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_2_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_2 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_2, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_2, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-2 => wchar - */ -int mbfl_filt_conv_8859_2_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_2_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_2; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-2 - */ -int mbfl_filt_conv_wchar_8859_2(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_2_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_2) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.h deleted file mode 100644 index 732e9194e66fe..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_2_H -#define MBFL_MBFILTER_ISO8859_2_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_2; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_2; -extern const struct mbfl_convert_vtbl vtbl_8859_2_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_2; - -int mbfl_filt_conv_8859_2_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_2(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_2_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c deleted file mode 100644 index d47098ceb51fd..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_3.h" -#include "unicode_table_iso8859_3.h" - -static const char *mbfl_encoding_8859_3_aliases[] = {"ISO_8859-3", "latin3", NULL}; - -const mbfl_encoding mbfl_encoding_8859_3 = { - mbfl_no_encoding_8859_3, - "ISO-8859-3", - "ISO-8859-3", - (const char *(*)[])&mbfl_encoding_8859_3_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_3 = { - mbfl_no_encoding_8859_3, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_3_wchar = { - mbfl_no_encoding_8859_3, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_3_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_3 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_3, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_3, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-3 => wchar - */ -int mbfl_filt_conv_8859_3_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_3_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_3; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-3 - */ -int mbfl_filt_conv_wchar_8859_3(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_3_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_3) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.h deleted file mode 100644 index 88ab3be6cdf30..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_3_H -#define MBFL_MBFILTER_ISO8859_3_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_3; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_3; -extern const struct mbfl_convert_vtbl vtbl_8859_3_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_3; - -int mbfl_filt_conv_8859_3_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_3(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_3_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c deleted file mode 100644 index 65c539eb4a87a..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_4.h" -#include "unicode_table_iso8859_4.h" - -static const char *mbfl_encoding_8859_4_aliases[] = {"ISO_8859-4", "latin4", NULL}; - -const mbfl_encoding mbfl_encoding_8859_4 = { - mbfl_no_encoding_8859_4, - "ISO-8859-4", - "ISO-8859-4", - (const char *(*)[])&mbfl_encoding_8859_4_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_4 = { - mbfl_no_encoding_8859_4, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true }; - -const struct mbfl_convert_vtbl vtbl_8859_4_wchar = { - mbfl_no_encoding_8859_4, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_4_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_4 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_4, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_4, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-4 => wchar - */ -int mbfl_filt_conv_8859_4_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_4_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_4; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-4 - */ -int mbfl_filt_conv_wchar_8859_4(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_4_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_4) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.h deleted file mode 100644 index c68239100af30..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_4_H -#define MBFL_MBFILTER_ISO8859_4_H - -extern const mbfl_encoding mbfl_encoding_8859_4; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_4; -extern const struct mbfl_convert_vtbl vtbl_8859_4_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_4; - -int mbfl_filt_conv_8859_4_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_4(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_4_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c deleted file mode 100644 index 3a41398bf3042..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_5.h" -#include "unicode_table_iso8859_5.h" - -static const char *mbfl_encoding_8859_5_aliases[] = {"ISO_8859-5", "cyrillic", NULL}; - -const mbfl_encoding mbfl_encoding_8859_5 = { - mbfl_no_encoding_8859_5, - "ISO-8859-5", - "ISO-8859-5", - (const char *(*)[])&mbfl_encoding_8859_5_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_5 = { - mbfl_no_encoding_8859_5, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_5_wchar = { - mbfl_no_encoding_8859_5, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_5_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_5 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_5, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_5, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-5 => wchar - */ -int mbfl_filt_conv_8859_5_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_5_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_5; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-5 - */ -int mbfl_filt_conv_wchar_8859_5(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_5_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_5) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.h deleted file mode 100644 index 531c1c1a726e8..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_5_H -#define MBFL_MBFILTER_ISO8859_5_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_5; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_5; -extern const struct mbfl_convert_vtbl vtbl_8859_5_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_5; - -int mbfl_filt_conv_8859_5_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_5(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_5_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c deleted file mode 100644 index 9823064e7e4db..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_6.h" -#include "unicode_table_iso8859_6.h" - -static const char *mbfl_encoding_8859_6_aliases[] = {"ISO_8859-6", "arabic", NULL}; - -const mbfl_encoding mbfl_encoding_8859_6 = { - mbfl_no_encoding_8859_6, - "ISO-8859-6", - "ISO-8859-6", - (const char *(*)[])&mbfl_encoding_8859_6_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_6 = { - mbfl_no_encoding_8859_6, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_6_wchar = { - mbfl_no_encoding_8859_6, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_6_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_6 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_6, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_6, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-6 => wchar - */ -int mbfl_filt_conv_8859_6_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_6_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_6; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-6 - */ -int mbfl_filt_conv_wchar_8859_6(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_6_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_6) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.h deleted file mode 100644 index bc27f3eb31eb7..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_6_H -#define MBFL_MBFILTER_ISO8859_6_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_6; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_6; -extern const struct mbfl_convert_vtbl vtbl_8859_6_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_6; - -int mbfl_filt_conv_8859_6_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_6(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_6_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c deleted file mode 100644 index a02ce7fb67377..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_7.h" -#include "unicode_table_iso8859_7.h" - -static const char *mbfl_encoding_8859_7_aliases[] = {"ISO_8859-7", "greek", NULL}; - -const mbfl_encoding mbfl_encoding_8859_7 = { - mbfl_no_encoding_8859_7, - "ISO-8859-7", - "ISO-8859-7", - (const char *(*)[])&mbfl_encoding_8859_7_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_7 = { - mbfl_no_encoding_8859_7, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_7_wchar = { - mbfl_no_encoding_8859_7, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_7_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_7 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_7, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_7, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-7 => wchar - */ -int mbfl_filt_conv_8859_7_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_7_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_7; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-7 - */ -int mbfl_filt_conv_wchar_8859_7(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_7_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_7) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.h deleted file mode 100644 index d3042f3e4bd01..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_7_H -#define MBFL_MBFILTER_ISO8859_7_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_7; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_7; -extern const struct mbfl_convert_vtbl vtbl_8859_7_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_7; - -int mbfl_filt_conv_8859_7_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_7(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_7_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c deleted file mode 100644 index fa4571aa31237..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_8.h" -#include "unicode_table_iso8859_8.h" - -static const char *mbfl_encoding_8859_8_aliases[] = {"ISO_8859-8", "hebrew", NULL}; - -const mbfl_encoding mbfl_encoding_8859_8 = { - mbfl_no_encoding_8859_8, - "ISO-8859-8", - "ISO-8859-8", - (const char *(*)[])&mbfl_encoding_8859_8_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_8 = { - mbfl_no_encoding_8859_8, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_8_wchar = { - mbfl_no_encoding_8859_8, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_8_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_8 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_8, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_8, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-8 => wchar - */ -int mbfl_filt_conv_8859_8_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_8_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_8; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-8 - */ -int mbfl_filt_conv_wchar_8859_8(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_8_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_8) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.h deleted file mode 100644 index 884d5095e0f80..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_8_H -#define MBFL_MBFILTER_ISO8859_8_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_8; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_8; -extern const struct mbfl_convert_vtbl vtbl_8859_8_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_8; - -int mbfl_filt_conv_8859_8_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_8(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_8_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c deleted file mode 100644 index 57d2e3777ce0d..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_iso8859_9.h" -#include "unicode_table_iso8859_9.h" - -static const char *mbfl_encoding_8859_9_aliases[] = {"ISO_8859-9", "latin5", NULL}; - -const mbfl_encoding mbfl_encoding_8859_9 = { - mbfl_no_encoding_8859_9, - "ISO-8859-9", - "ISO-8859-9", - (const char *(*)[])&mbfl_encoding_8859_9_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_8859_9 = { - mbfl_no_encoding_8859_9, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_true -}; - -const struct mbfl_convert_vtbl vtbl_8859_9_wchar = { - mbfl_no_encoding_8859_9, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_8859_9_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_8859_9 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_8859_9, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_8859_9, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * ISO-8859-9 => wchar - */ -int mbfl_filt_conv_8859_9_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < 0xa0) { - s = c; - } else if (c >= 0xa0 && c < 0x100) { - s = iso8859_9_ucs_table[c - 0xa0]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_8859_9; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => ISO-8859-9 - */ -int mbfl_filt_conv_wchar_8859_9(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c >= 0 && c < 0xa0) { - s = c; - } else { - s = -1; - n = 95; - while (n >= 0) { - if (c == iso8859_9_ucs_table[n]) { - s = 0xa0 + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_8859_9) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.h b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.h deleted file mode 100644 index 3731eda82ae0c..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_ISO8859_9_H -#define MBFL_MBFILTER_ISO8859_9_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_8859_9; -extern const struct mbfl_identify_vtbl vtbl_identify_8859_9; -extern const struct mbfl_convert_vtbl vtbl_8859_9_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_8859_9; - -int mbfl_filt_conv_8859_9_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_8859_9(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ISO8859_9_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_jis.c b/ext/mbstring/libmbfl/filters/mbfilter_jis.c deleted file mode 100644 index 58336d4e284b3..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_jis.c +++ /dev/null @@ -1,658 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_jis.h" - -#include "unicode_table_cp932_ext.h" -#include "unicode_table_jis.h" - -static int mbfl_filt_ident_jis(int c, mbfl_identify_filter *filter); -static int mbfl_filt_ident_2022jp(int c, mbfl_identify_filter *filter); - -const mbfl_encoding mbfl_encoding_jis = { - mbfl_no_encoding_jis, - "JIS", - "ISO-2022-JP", - NULL, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const mbfl_encoding mbfl_encoding_2022jp = { - mbfl_no_encoding_2022jp, - "ISO-2022-JP", - "ISO-2022-JP", - NULL, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const struct mbfl_identify_vtbl vtbl_identify_jis = { - mbfl_no_encoding_jis, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_jis -}; - -const struct mbfl_identify_vtbl vtbl_identify_2022jp = { - mbfl_no_encoding_2022jp, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_2022jp -}; - -const struct mbfl_convert_vtbl vtbl_jis_wchar = { - mbfl_no_encoding_jis, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_jis_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_jis = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_jis, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_jis, - mbfl_filt_conv_any_jis_flush -}; - -const struct mbfl_convert_vtbl vtbl_2022jp_wchar = { - mbfl_no_encoding_2022jp, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_jis_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_2022jp = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_2022jp, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_2022jp, - mbfl_filt_conv_any_jis_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * JIS => wchar - */ -int -mbfl_filt_conv_jis_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s, w; - -retry: - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: X 0201 latin */ -/* case 0x20: X 0201 kana */ -/* case 0x80: X 0208 */ -/* case 0x90: X 0212 */ - case 0: - if (c == 0x1b) { - filter->status += 2; - } else if (c == 0x0e) { /* "kana in" */ - filter->status = 0x20; - } else if (c == 0x0f) { /* "kana out" */ - filter->status = 0; - } else if (filter->status == 0x10 && c == 0x5c) { /* YEN SIGN */ - CK((*filter->output_function)(0xa5, filter->data)); - } else if (filter->status == 0x10 && c == 0x7e) { /* OVER LINE */ - CK((*filter->output_function)(0x203e, filter->data)); - } else if (filter->status == 0x20 && c > 0x20 && c < 0x60) { /* kana */ - CK((*filter->output_function)(0xff40 + c, filter->data)); - } else if ((filter->status == 0x80 || filter->status == 0x90) && c > 0x20 && c < 0x7f) { /* kanji first char */ - filter->cache = c; - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xe0) { /* GR kana */ - CK((*filter->output_function)(0xfec0 + c, filter->data)); - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - -/* case 0x81: X 0208 second char */ -/* case 0x91: X 0212 second char */ - case 1: - filter->status &= ~0xf; - c1 = filter->cache; - if (c > 0x20 && c < 0x7f) { - s = (c1 - 0x21)*94 + c - 0x21; - if (filter->status == 0x80) { - if (s >= 0 && s < jisx0208_ucs_table_size) { - w = jisx0208_ucs_table[s]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0208; - } - } else { - if (s >= 0 && s < jisx0212_ucs_table_size) { - w = jisx0212_ucs_table[s]; - } else { - w = 0; - } - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0212; - } - } - CK((*filter->output_function)(w, filter->data)); - } else if (c == 0x1b) { - filter->status += 2; - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - /* ESC */ -/* case 0x02: */ -/* case 0x12: */ -/* case 0x22: */ -/* case 0x82: */ -/* case 0x92: */ - case 2: - if (c == 0x24) { /* '$' */ - filter->status++; - } else if (c == 0x28) { /* '(' */ - filter->status += 3; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - goto retry; - } - break; - - /* ESC $ */ -/* case 0x03: */ -/* case 0x13: */ -/* case 0x23: */ -/* case 0x83: */ -/* case 0x93: */ - case 3: - if (c == 0x40 || c == 0x42) { /* '@' or 'B' */ - filter->status = 0x80; - } else if (c == 0x28) { /* '(' */ - filter->status++; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - CK((*filter->output_function)(0x24, filter->data)); - goto retry; - } - break; - - /* ESC $ ( */ -/* case 0x04: */ -/* case 0x14: */ -/* case 0x24: */ -/* case 0x84: */ -/* case 0x94: */ - case 4: - if (c == 0x40 || c == 0x42) { /* '@' or 'B' */ - filter->status = 0x80; - } else if (c == 0x44) { /* 'D' */ - filter->status = 0x90; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - CK((*filter->output_function)(0x24, filter->data)); - CK((*filter->output_function)(0x28, filter->data)); - goto retry; - } - break; - - /* ESC ( */ -/* case 0x05: */ -/* case 0x15: */ -/* case 0x25: */ -/* case 0x85: */ -/* case 0x95: */ - case 5: - if (c == 0x42 || c == 0x48) { /* 'B' or 'H' */ - filter->status = 0; - } else if (c == 0x4a) { /* 'J' */ - filter->status = 0x10; - } else if (c == 0x49) { /* 'I' */ - filter->status = 0x20; - } else { - filter->status &= ~0xf; - CK((*filter->output_function)(0x1b, filter->data)); - CK((*filter->output_function)(0x28, filter->data)); - goto retry; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => JIS - */ -int -mbfl_filt_conv_wchar_jis(int c, mbfl_convert_filter *filter) -{ - int c1, s; - - s = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_JIS0208) { - s = c & MBFL_WCSPLANE_MASK; - } else if (c1 == MBFL_WCSPLANE_JIS0212) { - s = c & MBFL_WCSPLANE_MASK; - s |= 0x8080; - } else if (c == 0xa5) { /* YEN SIGN */ - s = 0x1005c; - } else if (c == 0x203e) { /* OVER LINE */ - s = 0x1007e; - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s = 0x224c; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* ASCII */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - filter->status = 0; - CK((*filter->output_function)(s, filter->data)); - } else if (s < 0x100) { /* kana */ - if ((filter->status & 0xff00) != 0x100) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x49, filter->data)); /* 'I' */ - } - filter->status = 0x100; - CK((*filter->output_function)(s & 0x7f, filter->data)); - } else if (s < 0x8080) { /* X 0208 */ - if ((filter->status & 0xff00) != 0x200) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - filter->status = 0x200; - CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); - CK((*filter->output_function)(s & 0x7f, filter->data)); - } else if (s < 0x10000) { /* X 0212 */ - if ((filter->status & 0xff00) != 0x300) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x44, filter->data)); /* 'D' */ - } - filter->status = 0x300; - CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); - CK((*filter->output_function)(s & 0x7f, filter->data)); - } else { /* X 0201 latin */ - if ((filter->status & 0xff00) != 0x400) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x4a, filter->data)); /* 'J' */ - } - filter->status = 0x400; - CK((*filter->output_function)(s & 0x7f, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - -/* - * wchar => ISO-2022-JP - */ -int -mbfl_filt_conv_wchar_2022jp(int c, mbfl_convert_filter *filter) -{ - int s; - - s = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } - if (s <= 0) { - if (c == 0xa5) { /* YEN SIGN */ - s = 0x1005c; - } else if (c == 0x203e) { /* OVER LINE */ - s = 0x1007e; - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s = 0x224c; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } else if ((s >= 0x80 && s < 0x2121) || (s > 0x8080)) { - s = -1; - } - if (s >= 0) { - if (s < 0x80) { /* ASCII */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - filter->status = 0; - CK((*filter->output_function)(s, filter->data)); - } else if (s < 0x10000) { /* X 0208 */ - if ((filter->status & 0xff00) != 0x200) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - filter->status = 0x200; - CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); - CK((*filter->output_function)(s & 0x7f, filter->data)); - } else { /* X 0201 latin */ - if ((filter->status & 0xff00) != 0x400) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x4a, filter->data)); /* 'J' */ - } - filter->status = 0x400; - CK((*filter->output_function)(s & 0x7f, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -int -mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter) -{ - /* back to latin */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - filter->status &= 0xff; - return 0; -} - -static int mbfl_filt_ident_jis(int c, mbfl_identify_filter *filter) -{ -retry: - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: X 0201 latin */ -/* case 0x20: X 0201 kana */ -/* case 0x80: X 0208 */ -/* case 0x90: X 0212 */ - case 0: - if (c == 0x1b) { - filter->status += 2; - } else if (c == 0x0e) { /* "kana in" */ - filter->status = 0x20; - } else if (c == 0x0f) { /* "kana out" */ - filter->status = 0; - } else if ((filter->status == 0x80 || filter->status == 0x90) && c > 0x20 && c < 0x7f) { /* kanji first char */ - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - ; - } else { - filter->flag = 1; /* bad */ - } - break; - -/* case 0x81: X 0208 second char */ -/* case 0x91: X 0212 second char */ - case 1: - filter->status &= ~0xf; - if (c == 0x1b) { - goto retry; - } else if (c < 0x21 || c > 0x7e) { /* bad */ - filter->flag = 1; - } - break; - - /* ESC */ - case 2: - if (c == 0x24) { /* '$' */ - filter->status++; - } else if (c == 0x28) { /* '(' */ - filter->status += 3; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC $ */ - case 3: - if (c == 0x40 || c == 0x42) { /* '@' or 'B' */ - filter->status = 0x80; - } else if (c == 0x28) { /* '(' */ - filter->status++; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC $ ( */ - case 4: - if (c == 0x40 || c == 0x42) { /* '@' or 'B' */ - filter->status = 0x80; - } else if (c == 0x44) { /* 'D' */ - filter->status = 0x90; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC ( */ - case 5: - if (c == 0x42 || c == 0x48) { /* 'B' or 'H' */ - filter->status = 0; - } else if (c == 0x4a) { /* 'J' */ - filter->status = 0x10; - } else if (c == 0x49) { /* 'I' */ - filter->status = 0x20; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -static int mbfl_filt_ident_2022jp(int c, mbfl_identify_filter *filter) -{ -retry: - switch (filter->status & 0xf) { -/* case 0x00: ASCII */ -/* case 0x10: X 0201 latin */ -/* case 0x80: X 0208 */ - case 0: - if (c == 0x1b) { - filter->status += 2; - } else if (filter->status == 0x80 && c > 0x20 && c < 0x7f) { /* kanji first char */ - filter->status += 1; - } else if (c >= 0 && c < 0x80) { /* latin, CTLs */ - ; - } else { - filter->flag = 1; /* bad */ - } - break; - -/* case 0x81: X 0208 second char */ - case 1: - if (c == 0x1b) { - filter->status++; - } else { - filter->status &= ~0xf; - if (c < 0x21 || c > 0x7e) { /* bad */ - filter->flag = 1; - } - } - break; - - /* ESC */ - case 2: - if (c == 0x24) { /* '$' */ - filter->status++; - } else if (c == 0x28) { /* '(' */ - filter->status += 3; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC $ */ - case 3: - if (c == 0x40 || c == 0x42) { /* '@' or 'B' */ - filter->status = 0x80; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - /* ESC ( */ - case 5: - if (c == 0x42) { /* 'B' */ - filter->status = 0; - } else if (c == 0x4a) { /* 'J' */ - filter->status = 0x10; - } else { - filter->flag = 1; /* bad */ - filter->status &= ~0xf; - goto retry; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_jis.h b/ext/mbstring/libmbfl/filters/mbfilter_jis.h deleted file mode 100644 index 037530726375b..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_jis.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_JIS_H -#define MBFL_MBFILTER_JIS_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_jis; -extern const mbfl_encoding mbfl_encoding_2022jp; -extern const struct mbfl_identify_vtbl vtbl_identify_2022jp; -extern const struct mbfl_identify_vtbl vtbl_identify_jis; -extern const struct mbfl_convert_vtbl vtbl_jis_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_jis; -extern const struct mbfl_convert_vtbl vtbl_2022jp_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_2022jp; - -int mbfl_filt_conv_jis_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_jis(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_2022jp(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_JIS_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c deleted file mode 100644 index 892bf152130e9..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * The source code included in this files was separated from mbfilter_ru.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_koi8r.h" -#include "unicode_table_koi8r.h" - -static int mbfl_filt_ident_koi8r(int c, mbfl_identify_filter *filter); - -static const char *mbfl_encoding_koi8r_aliases[] = {"KOI8-R", "KOI8R", NULL}; - -const mbfl_encoding mbfl_encoding_koi8r = { - mbfl_no_encoding_koi8r, - "KOI8-R", - "KOI8-R", - (const char *(*)[])&mbfl_encoding_koi8r_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_koi8r = { - mbfl_no_encoding_koi8r, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_koi8r -}; - -const struct mbfl_convert_vtbl vtbl_wchar_koi8r = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_koi8r, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_koi8r, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_koi8r_wchar = { - mbfl_no_encoding_koi8r, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_koi8r_wchar, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * koi8r => wchar - */ -int -mbfl_filt_conv_koi8r_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c >= 0 && c < koi8r_ucs_table_min) { - s = c; - } else if (c >= koi8r_ucs_table_min && c < 0x100) { - s = koi8r_ucs_table[c - koi8r_ucs_table_min]; - if (s <= 0) { - s = c; - s &= MBFL_WCSPLANE_MASK; - s |= MBFL_WCSPLANE_KOI8R; - } - } else { - s = c; - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - } - - CK((*filter->output_function)(s, filter->data)); - - return c; -} - -/* - * wchar => koi8r - */ -int -mbfl_filt_conv_wchar_koi8r(int c, mbfl_convert_filter *filter) -{ - int s, n; - - if (c < 0x80) { - s = c; - } else { - s = -1; - n = koi8r_ucs_table_len-1; - while (n >= 0) { - if (c == koi8r_ucs_table[n]) { - s = koi8r_ucs_table_min + n; - break; - } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8R) { - s = c & MBFL_WCSPLANE_MASK; - } - } - - if (s >= 0) { - CK((*filter->output_function)(s, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_koi8r(int c, mbfl_identify_filter *filter) -{ - if (c >= 0x80 && c < 0xff) - filter->flag = 0; - else - filter->flag = 1; /* not it */ - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.h b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.h deleted file mode 100644 index 8298631f97c0a..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this part: Den V. Tsopa - * - */ -/* - * The source code included in this files was separated from mbfilter_ru.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_KOI8R_H -#define MBFL_MBFILTER_KOI8R_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_koi8r; -extern const struct mbfl_identify_vtbl vtbl_identify_koi8r; -extern const struct mbfl_convert_vtbl vtbl_wchar_koi8r; -extern const struct mbfl_convert_vtbl vtbl_koi8r_wchar; - -int mbfl_filt_conv_koi8r_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_koi8r(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_KOI8R_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_qprint.c b/ext/mbstring/libmbfl/filters/mbfilter_qprint.c deleted file mode 100644 index 188d088ed0a11..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_qprint.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_qprint.h" -#include "unicode_prop.h" - -static const char *mbfl_encoding_qprint_aliases[] = {"qprint", NULL}; - -const mbfl_encoding mbfl_encoding_qprint = { - mbfl_no_encoding_qprint, - "Quoted-Printable", - "Quoted-Printable", - (const char *(*)[])&mbfl_encoding_qprint_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_8bit_qprint = { - mbfl_no_encoding_8bit, - mbfl_no_encoding_qprint, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_qprintenc, - mbfl_filt_conv_qprintenc_flush }; - -const struct mbfl_convert_vtbl vtbl_qprint_8bit = { - mbfl_no_encoding_qprint, - mbfl_no_encoding_8bit, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_qprintdec, - mbfl_filt_conv_qprintdec_flush }; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * any => Quoted-Printable - */ - -int mbfl_filt_conv_qprintenc(int c, mbfl_convert_filter *filter) -{ - int s, n; - - switch (filter->status & 0xff) { - case 0: - filter->cache = c; - filter->status++; - break; - default: - s = filter->cache; - filter->cache = c; - n = (filter->status & 0xff00) >> 8; - - if (s == 0) { /* null */ - CK((*filter->output_function)(s, filter->data)); - filter->status &= ~0xff00; - break; - } - - if ((filter->status & MBFL_QPRINT_STS_MIME_HEADER) == 0) { - if (s == 0x0a || (s == 0x0d && c != 0x0a)) { /* line feed */ - CK((*filter->output_function)(0x0d, filter->data)); /* CR */ - CK((*filter->output_function)(0x0a, filter->data)); /* LF */ - filter->status &= ~0xff00; - break; - } else if (s == 0x0d) { - break; - } - } - - if ((filter->status & MBFL_QPRINT_STS_MIME_HEADER) == 0 && n >= 72) { /* soft line feed */ - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - CK((*filter->output_function)(0x0d, filter->data)); /* CR */ - CK((*filter->output_function)(0x0a, filter->data)); /* LF */ - filter->status &= ~0xff00; - } - - if (s <= 0 || s >= 0x80 || s == 0x3d /* not ASCII or '=' */ - || ((filter->status & MBFL_QPRINT_STS_MIME_HEADER) != 0 && - (mbfl_charprop_table[s] & MBFL_CHP_MMHQENC) != 0)) { - /* hex-octet */ - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - n = (s >> 4) & 0xf; - if (n < 10) { - n += 48; /* '0' */ - } else { - n += 55; /* 'A' - 10 */ - } - CK((*filter->output_function)(n, filter->data)); - n = s & 0xf; - if (n < 10) { - n += 48; - } else { - n += 55; - } - CK((*filter->output_function)(n, filter->data)); - if ((filter->status & MBFL_QPRINT_STS_MIME_HEADER) == 0) { - filter->status += 0x300; - } - } else { - CK((*filter->output_function)(s, filter->data)); - if ((filter->status & MBFL_QPRINT_STS_MIME_HEADER) == 0) { - filter->status += 0x100; - } - } - break; - } - - return c; -} - -int mbfl_filt_conv_qprintenc_flush(mbfl_convert_filter *filter) -{ - /* flush filter cache */ - (*filter->filter_function)('\0', filter); - filter->status &= ~0xffff; - filter->cache = 0; - return 0; -} - -/* - * Quoted-Printable => any - */ -int mbfl_filt_conv_qprintdec(int c, mbfl_convert_filter *filter) -{ - int n, m; - - static int hex2code_map[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - switch (filter->status) { - case 1: - if (hex2code_map[c & 0xff] >= 0) { - filter->cache = c; - filter->status = 2; - } else if (c == 0x0d) { /* soft line feed */ - filter->status = 3; - } else if (c == 0x0a) { /* soft line feed */ - filter->status = 0; - } else { - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } - break; - case 2: - m = hex2code_map[c & 0xff]; - if (m < 0) { - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - CK((*filter->output_function)(filter->cache, filter->data)); - n = c; - } else { - n = hex2code_map[filter->cache] << 4 | m; - } - CK((*filter->output_function)(n, filter->data)); - filter->status = 0; - break; - case 3: - if (c != 0x0a) { /* LF */ - CK((*filter->output_function)(c, filter->data)); - } - filter->status = 0; - break; - default: - if (c == 0x3d) { /* '=' */ - filter->status = 1; - } else { - CK((*filter->output_function)(c, filter->data)); - } - break; - } - - return c; -} - -int mbfl_filt_conv_qprintdec_flush(mbfl_convert_filter *filter) -{ - int status, cache; - - status = filter->status; - cache = filter->cache; - filter->status = 0; - filter->cache = 0; - /* flush fragments */ - if (status == 1) { - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - } else if (status == 2) { - CK((*filter->output_function)(0x3d, filter->data)); /* '=' */ - CK((*filter->output_function)(cache, filter->data)); - } - - return 0; -} - - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_qprint.h b/ext/mbstring/libmbfl/filters/mbfilter_qprint.h deleted file mode 100644 index 3a39fa740268b..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_qprint.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_QPRINT_H -#define MBFL_MBFILTER_QPRINT_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_qprint; -extern const struct mbfl_convert_vtbl vtbl_8bit_qprint; -extern const struct mbfl_convert_vtbl vtbl_qprint_8bit; - -int mbfl_filt_conv_qprintenc(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_qprintenc_flush(mbfl_convert_filter *filter); -int mbfl_filt_conv_qprintdec(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_qprintdec_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_ASCII_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c deleted file mode 100644 index f9d7ff671dd35..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_sjis.h" - -#include "unicode_table_cp932_ext.h" -#include "unicode_table_jis.h" - -static int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_sjis[] = { /* 0x80-0x9f,0xE0-0xFF */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static const char *mbfl_encoding_sjis_aliases[] = {"x-sjis", "SHIFT-JIS", NULL}; - -const mbfl_encoding mbfl_encoding_sjis = { - mbfl_no_encoding_sjis, - "SJIS", - "Shift_JIS", - (const char *(*)[])&mbfl_encoding_sjis_aliases, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_sjis = { - mbfl_no_encoding_sjis, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_sjis -}; - -const struct mbfl_convert_vtbl vtbl_sjis_wchar = { - mbfl_no_encoding_sjis, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -#define SJIS_ENCODE(c1,c2,s1,s2) \ - do { \ - s1 = c1; \ - s1--; \ - s1 >>= 1; \ - if ((c1) < 0x5f) { \ - s1 += 0x71; \ - } else { \ - s1 += 0xb1; \ - } \ - s2 = c2; \ - if ((c1) & 1) { \ - if ((c2) < 0x60) { \ - s2--; \ - } \ - s2 += 0x20; \ - } else { \ - s2 += 0x7e; \ - } \ - } while (0) - -#define SJIS_DECODE(c1,c2,s1,s2) \ - do { \ - s1 = c1; \ - if (s1 < 0xa0) { \ - s1 -= 0x81; \ - } else { \ - s1 -= 0xc1; \ - } \ - s1 <<= 1; \ - s1 += 0x21; \ - s2 = c2; \ - if (s2 < 0x9f) { \ - if (s2 < 0x7f) { \ - s2++; \ - } \ - s2 -= 0x20; \ - } else { \ - s1++; \ - s2 -= 0x7e; \ - } \ - } while (0) - - -/* - * SJIS => wchar - */ -int -mbfl_filt_conv_sjis_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, s1, s2, w; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0xa0 && c < 0xe0) { /* kana */ - CK((*filter->output_function)(0xfec0 + c, filter->data)); - } else if (c > 0x80 && c < 0xfd && c != 0xa0) { /* kanji first char */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* kanji second char */ - filter->status = 0; - c1 = filter->cache; - if (c > 0x39 && c < 0xfd && c != 0x7f) { - SJIS_DECODE(c1, c, s1, s2); - w = (s1 - 0x21)*94 + s2 - 0x21; - if (w >= 0 && w < jisx0208_ucs_table_size) { - w = jisx0208_ucs_table[w]; - } else { - w = 0; - } - if (w <= 0) { - if (s1 < 0x7f && s2 < 0x7f) { - w = (s1 << 8) | s2; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_JIS0208; - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - } - } - CK((*filter->output_function)(w, filter->data)); - } else if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => SJIS - */ -int -mbfl_filt_conv_wchar_sjis(int c, mbfl_convert_filter *filter) -{ - int c1, c2, s1, s2; - - s1 = 0; - if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) { - s1 = ucs_a1_jis_table[c - ucs_a1_jis_table_min]; - } else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) { - s1 = ucs_a2_jis_table[c - ucs_a2_jis_table_min]; - } else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) { - s1 = ucs_i_jis_table[c - ucs_i_jis_table_min]; - } else if (c >= ucs_r_jis_table_min && c < ucs_r_jis_table_max) { - s1 = ucs_r_jis_table[c - ucs_r_jis_table_min]; - } - if (s1 <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_JIS0208) { - s1 = c & MBFL_WCSPLANE_MASK; - } else if (c == 0xa5) { /* YEN SIGN */ - s1 = 0x216f; /* FULLWIDTH YEN SIGN */ - } else if (c == 0x203e) { /* OVER LINE */ - s1 = 0x2131; /* FULLWIDTH MACRON */ - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s1 = 0x2140; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s1 = 0x2141; - } else if (c == 0x2225) { /* PARALLEL TO */ - s1 = 0x2142; - } else if (c == 0xff0d) { /* FULLWIDTH HYPHEN-MINUS */ - s1 = 0x215d; - } else if (c == 0xffe0) { /* FULLWIDTH CENT SIGN */ - s1 = 0x2171; - } else if (c == 0xffe1) { /* FULLWIDTH POUND SIGN */ - s1 = 0x2172; - } else if (c == 0xffe2) { /* FULLWIDTH NOT SIGN */ - s1 = 0x224c; - } - if (c == 0) { - s1 = 0; - } else if (s1 <= 0) { - s1 = -1; - } - } else if (s1 >= 0x8080) { - s1 = -1; - } - if (s1 >= 0) { - if (s1 < 0x100) { /* latin or kana */ - CK((*filter->output_function)(s1, filter->data)); - } else { /* kanji */ - c1 = (s1 >> 8) & 0xff; - c2 = s1 & 0xff; - SJIS_ENCODE(c1, c2, s1, s2); - CK((*filter->output_function)(s1, filter->data)); - CK((*filter->output_function)(s2, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter) -{ - if (filter->status) { /* kanji second char */ - if (c < 0x40 || c > 0xfc || c == 0x7f) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - } else if (c >= 0 && c < 0x80) { /* latin ok */ - ; - } else if (c > 0xa0 && c < 0xe0) { /* kana ok */ - ; - } else if (c > 0x80 && c < 0xf0 && c != 0xa0) { /* kanji first char */ - filter->status = 1; - } else { /* bad */ - filter->flag = 1; - } - - return c; -} - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis.h b/ext/mbstring/libmbfl/filters/mbfilter_sjis.h deleted file mode 100644 index cb9146fd8973c..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_ja.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_SJIS_H -#define MBFL_MBFILTER_SJIS_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_sjis; -extern const struct mbfl_identify_vtbl vtbl_identify_sjis; -extern const struct mbfl_convert_vtbl vtbl_sjis_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_sjis; - -int mbfl_filt_conv_sjis_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_sjis(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_SJIS_H */ - -/* - * charset=UTF-8 - */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c deleted file mode 100644 index 4d83af0bf157e..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_ucs2.h" - -static const char *mbfl_encoding_ucs2_aliases[] = {"ISO-10646-UCS-2", "UCS2" , "UNICODE", NULL}; - -const mbfl_encoding mbfl_encoding_ucs2 = { - mbfl_no_encoding_ucs2, - "UCS-2", - "UCS-2", - (const char *(*)[])&mbfl_encoding_ucs2_aliases, - NULL, - MBFL_ENCTYPE_WCS2BE -}; - -const mbfl_encoding mbfl_encoding_ucs2be = { - mbfl_no_encoding_ucs2be, - "UCS-2BE", - "UCS-2BE", - NULL, - NULL, - MBFL_ENCTYPE_WCS2BE -}; - -const mbfl_encoding mbfl_encoding_ucs2le = { - mbfl_no_encoding_ucs2le, - "UCS-2LE", - "UCS-2LE", - NULL, - NULL, - MBFL_ENCTYPE_WCS2LE -}; - -const struct mbfl_convert_vtbl vtbl_ucs2_wchar = { - mbfl_no_encoding_ucs2, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs2_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs2 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs2, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs2be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_ucs2be_wchar = { - mbfl_no_encoding_ucs2be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs2be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs2be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs2be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs2be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_ucs2le_wchar = { - mbfl_no_encoding_ucs2le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs2le_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs2le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs2le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs2le, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UCS-2 => wchar - */ -int mbfl_filt_conv_ucs2_wchar(int c, mbfl_convert_filter *filter) -{ - int n, endian; - - endian = filter->status & 0xff00; - switch (filter->status & 0xff) { - case 0: - if (endian) { - n = c & 0xff; - } else { - n = (c & 0xff) << 8; - } - filter->cache = n; - filter->status++; - break; - default: - if (endian) { - n = (c & 0xff) << 8; - } else { - n = c & 0xff; - } - n |= filter->cache; - if (n == 0xfffe) { - if (endian) { - filter->status = 0; /* big-endian */ - } else { - filter->status = 0x100; /* little-endian */ - } - CK((*filter->output_function)(0xfeff, filter->data)); - } else { - filter->status &= ~0xff; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * UCS-2BE => wchar - */ -int mbfl_filt_conv_ucs2be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff) << 8; - filter->cache = n; - } else { - filter->status = 0; - n = (c & 0xff) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -/* - * wchar => UCS-2BE - */ -int mbfl_filt_conv_wchar_ucs2be(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -/* - * UCS-2LE => wchar - */ -int mbfl_filt_conv_ucs2le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = c & 0xff; - filter->cache = n; - } else { - filter->status = 0; - n = ((c & 0xff) << 8) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - - -/* - * wchar => UCS-2LE - */ -int mbfl_filt_conv_wchar_ucs2le(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.h b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.h deleted file mode 100644 index 6dd1e6569751f..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UCS2_H -#define MBFL_MBFILTER_UCS2_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_ucs2; -extern const mbfl_encoding mbfl_encoding_ucs2be; -extern const mbfl_encoding mbfl_encoding_ucs2le; -extern const struct mbfl_convert_vtbl vtbl_ucs2_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs2; -extern const struct mbfl_convert_vtbl vtbl_ucs2be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs2be; -extern const struct mbfl_convert_vtbl vtbl_ucs2le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs2le; - -int mbfl_filt_conv_ucs2_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_ucs2be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_ucs2be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_ucs2le_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_ucs2le(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UCS2_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c deleted file mode 100644 index 12a2033e0ca4f..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_ucs4.h" - -static const char *mbfl_encoding_ucs4_aliases[] = {"ISO-10646-UCS-4", "UCS4", NULL}; - -const mbfl_encoding mbfl_encoding_ucs4 = { - mbfl_no_encoding_ucs4, - "UCS-4", - "UCS-4", - (const char *(*)[])&mbfl_encoding_ucs4_aliases, - NULL, - MBFL_ENCTYPE_WCS4BE -}; - -const mbfl_encoding mbfl_encoding_ucs4be = { - mbfl_no_encoding_ucs4be, - "UCS-4BE", - "UCS-4BE", - NULL, - NULL, - MBFL_ENCTYPE_WCS4BE -}; - -const mbfl_encoding mbfl_encoding_ucs4le = { - mbfl_no_encoding_ucs4le, - "UCS-4LE", - "UCS-4LE", - NULL, - NULL, - MBFL_ENCTYPE_WCS4LE -}; - -const struct mbfl_convert_vtbl vtbl_ucs4_wchar = { - mbfl_no_encoding_ucs4, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs4_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs4 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs4, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs4be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_ucs4be_wchar = { - mbfl_no_encoding_ucs4be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs4be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs4be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs4be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs4be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_ucs4le_wchar = { - mbfl_no_encoding_ucs4le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_ucs4le_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_ucs4le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_ucs4le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_ucs4le, - mbfl_filt_conv_common_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UCS-4 => wchar - */ -int mbfl_filt_conv_ucs4_wchar(int c, mbfl_convert_filter *filter) -{ - int n, endian; - - endian = filter->status & 0xff00; - switch (filter->status & 0xff) { - case 0: - if (endian) { - n = c & 0xff; - } else { - n = (c & 0xff) << 24; - } - filter->cache = n; - filter->status++; - break; - case 1: - if (endian) { - n = (c & 0xff) << 8; - } else { - n = (c & 0xff) << 16; - } - filter->cache |= n; - filter->status++; - break; - case 2: - if (endian) { - n = (c & 0xff) << 16; - } else { - n = (c & 0xff) << 8; - } - filter->cache |= n; - filter->status++; - break; - default: - if (endian) { - n = (c & 0xff) << 24; - } else { - n = c & 0xff; - } - n |= filter->cache; - if ((n & 0xffff) == 0 && ((n >> 16) & 0xffff) == 0xfffe) { - if (endian) { - filter->status = 0; /* big-endian */ - } else { - filter->status = 0x100; /* little-endian */ - } - CK((*filter->output_function)(0xfeff, filter->data)); - } else { - filter->status &= ~0xff; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * UCS-4BE => wchar - */ -int mbfl_filt_conv_ucs4be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff) << 24; - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 16; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 8; - filter->cache |= n; - } else { - filter->status = 0; - n = (c & 0xff) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -/* - * wchar => UCS-4BE - */ -int mbfl_filt_conv_wchar_ucs4be(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -/* - * UCS-4LE => wchar - */ -int mbfl_filt_conv_ucs4le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff); - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 8; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 16; - filter->cache |= n; - } else { - filter->status = 0; - n = ((c & 0xff) << 24) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -/* - * wchar => UCS-4LE - */ -int mbfl_filt_conv_wchar_ucs4le(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.h b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.h deleted file mode 100644 index 718c7e1c2c4ca..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UCS4_H -#define MBFL_MBFILTER_UCS4_H - -extern const mbfl_encoding mbfl_encoding_ucs4; -extern const mbfl_encoding mbfl_encoding_ucs4le; -extern const mbfl_encoding mbfl_encoding_ucs4be; -extern const struct mbfl_convert_vtbl vtbl_ucs4_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs4; -extern const struct mbfl_convert_vtbl vtbl_ucs4be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs4be; -extern const struct mbfl_convert_vtbl vtbl_ucs4le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_ucs4le; - -int mbfl_filt_conv_ucs4_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_ucs4be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_ucs4be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_ucs4le_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_ucs4le(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UCS4_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c deleted file mode 100644 index c72d93f5fb758..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_uhc.h" -#include "unicode_table_uhc.h" - -static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_uhc[] = { /* 0x81-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static const char *mbfl_encoding_uhc_aliases[] = {"CP949", NULL}; - -const mbfl_encoding mbfl_encoding_uhc = { - mbfl_no_encoding_uhc, - "UHC", - "UHC", - (const char *(*)[])&mbfl_encoding_uhc_aliases, - mblen_table_uhc, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_uhc = { - mbfl_no_encoding_uhc, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_uhc -}; - -const struct mbfl_convert_vtbl vtbl_uhc_wchar = { - mbfl_no_encoding_uhc, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_uhc_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_uhc = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_uhc, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_uhc, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UHC => wchar - */ -int -mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter) -{ - int c1, w = 0, flag = 0; - - switch (filter->status) { - case 0: - if (c >= 0 && c < 0x80) { /* latin */ - CK((*filter->output_function)(c, filter->data)); - } else if (c > 0x80 && c < 0xff && c != 0xc9) { /* dbcs lead byte */ - filter->status = 1; - filter->cache = c; - } else { - w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - break; - - case 1: /* dbcs second byte */ - filter->status = 0; - c1 = filter->cache; - - if ( c1 >= 0x81 && c1 <= 0xa0){ - w = (c1 - 0x81)*190 + (c - 0x41); - if (w >= 0 && w < uhc1_ucs_table_size) { - flag = 1; - w = uhc1_ucs_table[w]; - } else { - w = 0; - } - } else if ( c1 >= 0xa1 && c1 <= 0xc6){ - w = (c1 - 0xa1)*190 + (c - 0x41); - if (w >= 0 && w < uhc2_ucs_table_size) { - flag = 2; - w = uhc2_ucs_table[w]; - } else { - w = 0; - } - } else if ( c1 >= 0xc7 && c1 <= 0xfe){ - w = (c1 - 0xc7)*94 + (c - 0xa1); - if (w >= 0 && w < uhc3_ucs_table_size) { - flag = 3; - w = uhc3_ucs_table[w]; - } else { - w = 0; - } - } - if (flag > 0){ - if (w <= 0) { - w = (c1 << 8) | c; - w &= MBFL_WCSPLANE_MASK; - w |= MBFL_WCSPLANE_UHC; - } - CK((*filter->output_function)(w, filter->data)); - } else { - if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ - CK((*filter->output_function)(c, filter->data)); - } else { - w = (c1 << 8) | c; - w &= MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - } - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => UHC - */ -int -mbfl_filt_conv_wchar_uhc(int c, mbfl_convert_filter *filter) -{ - int c1, s; - - s = 0; - if (c >= ucs_a1_uhc_table_min && c < ucs_a1_uhc_table_max) { - s = ucs_a1_uhc_table[c - ucs_a1_uhc_table_min]; - } else if (c >= ucs_a2_uhc_table_min && c < ucs_a2_uhc_table_max) { - s = ucs_a2_uhc_table[c - ucs_a2_uhc_table_min]; - } else if (c >= ucs_a3_uhc_table_min && c < ucs_a3_uhc_table_max) { - s = ucs_a3_uhc_table[c - ucs_a3_uhc_table_min]; - } else if (c >= ucs_i_uhc_table_min && c < ucs_i_uhc_table_max) { - s = ucs_i_uhc_table[c - ucs_i_uhc_table_min]; - } else if (c >= ucs_s_uhc_table_min && c < ucs_s_uhc_table_max) { - s = ucs_s_uhc_table[c - ucs_s_uhc_table_min]; - } else if (c >= ucs_r1_uhc_table_min && c < ucs_r1_uhc_table_max) { - s = ucs_r1_uhc_table[c - ucs_r1_uhc_table_min]; - } else if (c >= ucs_r2_uhc_table_min && c < ucs_r2_uhc_table_max) { - s = ucs_r2_uhc_table[c - ucs_r2_uhc_table_min]; - } - if (s <= 0) { - c1 = c & ~MBFL_WCSPLANE_MASK; - if (c1 == MBFL_WCSPLANE_UHC) { - s = c & MBFL_WCSPLANE_MASK; - } - if (c == 0) { - s = 0; - } else if (s <= 0) { - s = -1; - } - } - if (s >= 0) { - if (s < 0x80) { /* latin */ - CK((*filter->output_function)(s, filter->data)); - } else { - CK((*filter->output_function)((s >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(s & 0xff, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c >= 0x81 && c <= 0xa0) { /* dbcs first char */ - filter->status= 1; - } else if (c >= 0xa1 && c <= 0xc6) { /* dbcs first char */ - filter->status= 2; - } else if (c >= 0xc7 && c <= 0xfe) { /* dbcs first char */ - filter->status= 3; - } else { /* bad */ - filter->flag = 1; - } - - case 1: - case 2: - if (c < 0x41 || (c > 0x5a && c < 0x61) - || (c > 0x7a && c < 0x81) || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 3: - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uhc.h b/ext/mbstring/libmbfl/filters/mbfilter_uhc.h deleted file mode 100644 index f964249197273..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_uhc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter_kr.h - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UHC_H -#define MBFL_MBFILTER_UHC_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_uhc; -extern const struct mbfl_identify_vtbl vtbl_identify_uhc; -extern const struct mbfl_convert_vtbl vtbl_uhc_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_uhc; - -int mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_uhc(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UHC_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c b/ext/mbstring/libmbfl/filters/mbfilter_utf16.c deleted file mode 100644 index b6c2aeda5b3e1..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_utf16.h" - -static const char *mbfl_encoding_utf16_aliases[] = {"utf16", NULL}; - -const mbfl_encoding mbfl_encoding_utf16 = { - mbfl_no_encoding_utf16, - "UTF-16", - "UTF-16", - (const char *(*)[])&mbfl_encoding_utf16_aliases, - NULL, - MBFL_ENCTYPE_MWC2BE -}; - -const mbfl_encoding mbfl_encoding_utf16be = { - mbfl_no_encoding_utf16be, - "UTF-16BE", - "UTF-16BE", - NULL, - NULL, - MBFL_ENCTYPE_MWC2BE -}; - -const mbfl_encoding mbfl_encoding_utf16le = { - mbfl_no_encoding_utf16le, - "UTF-16LE", - "UTF-16LE", - NULL, - NULL, - MBFL_ENCTYPE_MWC2LE -}; - -const struct mbfl_convert_vtbl vtbl_utf16_wchar = { - mbfl_no_encoding_utf16, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf16_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf16 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf16, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf16be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_utf16be_wchar = { - mbfl_no_encoding_utf16be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf16be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf16be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf16be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf16be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_utf16le_wchar = { - mbfl_no_encoding_utf16le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf16le_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf16le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf16le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf16le, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UTF-16 => wchar - */ -int mbfl_filt_conv_utf16_wchar(int c, mbfl_convert_filter *filter) -{ - int n, endian; - - endian = filter->status & 0xff00; - switch (filter->status & 0xff) { - case 0: - if (endian) { - n = c & 0xff; - } else { - n = (c & 0xff) << 8; - } - filter->cache |= n; - filter->status++; - break; - default: - if (endian) { - n = (c & 0xff) << 8; - } else { - n = c & 0xff; - } - n |= filter->cache & 0xffff; - filter->status &= ~0xff; - if (n == 0xfffe) { - if (endian) { - filter->status = 0; /* big-endian */ - } else { - filter->status = 0x100; /* little-endian */ - } - CK((*filter->output_function)(0xfeff, filter->data)); - } else if (n >= 0xd800 && n < 0xdc00) { - filter->cache = ((n & 0x3ff) << 16) + 0x400000; - } else if (n >= 0xdc00 && n < 0xe000) { - n &= 0x3ff; - n |= (filter->cache & 0xfff0000) >> 6; - filter->cache = 0; - if (n >= MBFL_WCSPLANE_SUPMIN && n < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(n, filter->data)); - } else { /* illegal character */ - n &= MBFL_WCSGROUP_MASK; - n |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(n, filter->data)); - } - } else { - filter->cache = 0; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * UTF-16BE => wchar - */ -int mbfl_filt_conv_utf16be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - switch (filter->status) { - case 0: - filter->status = 1; - n = (c & 0xff) << 8; - filter->cache |= n; - break; - default: - filter->status = 0; - n = (filter->cache & 0xff00) | (c & 0xff); - if (n >= 0xd800 && n < 0xdc00) { - filter->cache = ((n & 0x3ff) << 16) + 0x400000; - } else if (n >= 0xdc00 && n < 0xe000) { - n &= 0x3ff; - n |= (filter->cache & 0xfff0000) >> 6; - filter->cache = 0; - if (n >= MBFL_WCSPLANE_SUPMIN && n < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(n, filter->data)); - } else { /* illegal character */ - n &= MBFL_WCSGROUP_MASK; - n |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(n, filter->data)); - } - } else { - filter->cache = 0; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * wchar => UTF-16BE - */ -int mbfl_filt_conv_wchar_utf16be(int c, mbfl_convert_filter *filter) -{ - int n; - - if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - } else if (c >= MBFL_WCSPLANE_SUPMIN && c < MBFL_WCSPLANE_SUPMAX) { - n = ((c >> 10) - 0x40) | 0xd800; - CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(n & 0xff, filter->data)); - n = (c & 0x3ff) | 0xdc00; - CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(n & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -/* - * UTF-16LE => wchar - */ -int mbfl_filt_conv_utf16le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - switch (filter->status) { - case 0: - filter->status = 1; - n = c & 0xff; - filter->cache |= n; - break; - default: - filter->status = 0; - n = (filter->cache & 0xff) | ((c & 0xff) << 8); - if (n >= 0xd800 && n < 0xdc00) { - filter->cache = ((n & 0x3ff) << 16) + 0x400000; - } else if (n >= 0xdc00 && n < 0xe000) { - n &= 0x3ff; - n |= (filter->cache & 0xfff0000) >> 6; - filter->cache = 0; - if (n >= MBFL_WCSPLANE_SUPMIN && n < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(n, filter->data)); - } else { /* illegal character */ - n &= MBFL_WCSGROUP_MASK; - n |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(n, filter->data)); - } - } else { - filter->cache = 0; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * wchar => UTF-16LE - */ -int mbfl_filt_conv_wchar_utf16le(int c, mbfl_convert_filter *filter) -{ - int n; - - if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - } else if (c >= MBFL_WCSPLANE_SUPMIN && c < MBFL_WCSPLANE_SUPMAX) { - n = ((c >> 10) - 0x40) | 0xd800; - CK((*filter->output_function)(n & 0xff, filter->data)); - CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); - n = (c & 0x3ff) | 0xdc00; - CK((*filter->output_function)(n & 0xff, filter->data)); - CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf16.h b/ext/mbstring/libmbfl/filters/mbfilter_utf16.h deleted file mode 100644 index f54bb00573399..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf16.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UTF16_H -#define MBFL_MBFILTER_UTF16_H - -extern const mbfl_encoding mbfl_encoding_utf16; -extern const mbfl_encoding mbfl_encoding_utf16be; -extern const mbfl_encoding mbfl_encoding_utf16le; -extern const struct mbfl_convert_vtbl vtbl_utf16_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf16; -extern const struct mbfl_convert_vtbl vtbl_utf16be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf16be; -extern const struct mbfl_convert_vtbl vtbl_utf16le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf16le; - -int mbfl_filt_conv_utf16_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_utf16be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf16be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_utf16le_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf16le(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UTF16_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c b/ext/mbstring/libmbfl/filters/mbfilter_utf32.c deleted file mode 100644 index 4b0e9b9e0f04e..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 20 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_utf32.h" - -static const char *mbfl_encoding_utf32_aliases[] = {"utf32", NULL}; - -const mbfl_encoding mbfl_encoding_utf32 = { - mbfl_no_encoding_utf32, - "UTF-32", - "UTF-32", - (const char *(*)[])&mbfl_encoding_utf32_aliases, - NULL, - MBFL_ENCTYPE_WCS4BE -}; - -const mbfl_encoding mbfl_encoding_utf32be = { - mbfl_no_encoding_utf32be, - "UTF-32BE", - "UTF-32BE", - NULL, - NULL, - MBFL_ENCTYPE_WCS4BE -}; - -const mbfl_encoding mbfl_encoding_utf32le = { - mbfl_no_encoding_utf32le, - "UTF-32LE", - "UTF-32LE", - NULL, - NULL, - MBFL_ENCTYPE_WCS4LE -}; - -const struct mbfl_convert_vtbl vtbl_utf32_wchar = { - mbfl_no_encoding_utf32, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf32_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf32 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf32, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf32be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_utf32be_wchar = { - mbfl_no_encoding_utf32be, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf32be_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf32be = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf32be, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf32be, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_utf32le_wchar = { - mbfl_no_encoding_utf32le, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf32le_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf32le = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf32le, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf32le, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UTF-32 => wchar - */ -int mbfl_filt_conv_utf32_wchar(int c, mbfl_convert_filter *filter) -{ - int n, endian; - - endian = filter->status & 0xff00; - switch (filter->status & 0xff) { - case 0: - if (endian) { - n = c & 0xff; - } else { - n = (c & 0xff) << 24; - } - filter->cache = n; - filter->status++; - break; - case 1: - if (endian) { - n = (c & 0xff) << 8; - } else { - n = (c & 0xff) << 16; - } - filter->cache |= n; - filter->status++; - break; - case 2: - if (endian) { - n = (c & 0xff) << 16; - } else { - n = (c & 0xff) << 8; - } - filter->cache |= n; - filter->status++; - break; - default: - if (endian) { - n = (c & 0xff) << 24; - } else { - n = c & 0xff; - } - n |= filter->cache; - if ((n & 0xffff) == 0 && ((n >> 16) & 0xffff) == 0xfffe) { - if (endian) { - filter->status = 0; /* big-endian */ - } else { - filter->status = 0x100; /* little-endian */ - } - CK((*filter->output_function)(0xfeff, filter->data)); - } else { - filter->status &= ~0xff; - CK((*filter->output_function)(n, filter->data)); - } - break; - } - - return c; -} - -/* - * UTF-32BE => wchar - */ -int mbfl_filt_conv_utf32be_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff) << 24; - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 16; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 8; - filter->cache |= n; - } else { - filter->status = 0; - n = (c & 0xff) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -/* - * wchar => UTF-32BE - */ -int mbfl_filt_conv_wchar_utf32be(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)(c & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -/* - * UTF-32LE => wchar - */ -int mbfl_filt_conv_utf32le_wchar(int c, mbfl_convert_filter *filter) -{ - int n; - - if (filter->status == 0) { - filter->status = 1; - n = (c & 0xff); - filter->cache = n; - } else if (filter->status == 1) { - filter->status = 2; - n = (c & 0xff) << 8; - filter->cache |= n; - } else if (filter->status == 2) { - filter->status = 3; - n = (c & 0xff) << 16; - filter->cache |= n; - } else { - filter->status = 0; - n = ((c & 0xff) << 24) | filter->cache; - CK((*filter->output_function)(n, filter->data)); - } - return c; -} - -/* - * wchar => UTF-32LE - */ -int mbfl_filt_conv_wchar_utf32le(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { - CK((*filter->output_function)(c & 0xff, filter->data)); - CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); - CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf32.h b/ext/mbstring/libmbfl/filters/mbfilter_utf32.h deleted file mode 100644 index c280e9f3761c2..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf32.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 20 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UTF32_H -#define MBFL_MBFILTER_UTF32_H - -extern const mbfl_encoding mbfl_encoding_utf32; -extern const mbfl_encoding mbfl_encoding_utf32be; -extern const mbfl_encoding mbfl_encoding_utf32le; -extern const struct mbfl_convert_vtbl vtbl_utf32_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf32; -extern const struct mbfl_convert_vtbl vtbl_utf32be_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf32be; -extern const struct mbfl_convert_vtbl vtbl_utf32le_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf32le; - -int mbfl_filt_conv_utf32_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_utf32be_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf32be(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_utf32le_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf32le(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UTF32_H */ - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c deleted file mode 100644 index ea37073761c1a..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c +++ /dev/null @@ -1,460 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_utf7.h" - -static int mbfl_filt_ident_utf7(int c, mbfl_identify_filter *filter); - -static const unsigned char mbfl_base64_table[] = { - /* 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', */ - 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d, - /* 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', */ - 0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a, - /* 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', */ - 0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d, - /* 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', */ - 0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a, - /* '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' */ - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2b,0x2f,0x00 -}; - -static const char *mbfl_encoding_utf7_aliases[] = {"utf7", NULL}; - -const mbfl_encoding mbfl_encoding_utf7 = { - mbfl_no_encoding_utf7, - "UTF-7", - "UTF-7", - (const char *(*)[])&mbfl_encoding_utf7_aliases, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const struct mbfl_identify_vtbl vtbl_identify_utf7 = { - mbfl_no_encoding_utf7, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_utf7 -}; - -const struct mbfl_convert_vtbl vtbl_utf7_wchar = { - mbfl_no_encoding_utf7, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf7_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf7 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf7, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf7, - mbfl_filt_conv_wchar_utf7_flush -}; - - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UTF-7 => wchar - */ -int mbfl_filt_conv_utf7_wchar(int c, mbfl_convert_filter *filter) -{ - int s, n; - - n = -1; - if (filter->status != 0) { /* Modified Base64 */ - if (c >= 0x41 && c <= 0x5a) { /* A - Z */ - n = c - 65; - } else if (c >= 0x61 && c <= 0x7a) { /* a - z */ - n = c - 71; - } else if (c >= 0x30 && c <= 0x39) { /* 0 - 9 */ - n = c + 4; - } else if (c == 0x2b) { /* '+' */ - n = 62; - } else if (c == 0x2f) { /* '/' */ - n = 63; - } - if (n < 0 || n > 63) { - if (c == 0x2d) { - if (filter->status == 1) { /* "+-" -> "+" */ - CK((*filter->output_function)(0x2b, filter->data)); - } - } else if (c >= 0 && c < 0x80) { /* ASCII exclude '-' */ - CK((*filter->output_function)(c, filter->data)); - } else { /* illegal character */ - s = c & MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - filter->cache = 0; - filter->status = 0; - return c; - } - } - - switch (filter->status) { - /* directly encoded characters */ - case 0: - if (c == 0x2b) { /* '+' shift character */ - filter->status = 1; - } else if (c >= 0 && c < 0x80) { /* ASCII */ - CK((*filter->output_function)(c, filter->data)); - } else { /* illegal character */ - s = c & MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - break; - - /* decode Modified Base64 */ - case 1: - case 2: - filter->cache |= n << 10; - filter->status = 3; - break; - case 3: - filter->cache |= n << 4; - filter->status = 4; - break; - case 4: - s = ((n >> 2) & 0xf) | (filter->cache & 0xffff); - n = (n & 0x3) << 14; - filter->status = 5; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000) | n; - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = n; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = n; - CK((*filter->output_function)(s, filter->data)); - } - break; - - case 5: - filter->cache |= n << 8; - filter->status = 6; - break; - case 6: - filter->cache |= n << 2; - filter->status = 7; - break; - case 7: - s = ((n >> 4) & 0x3) | (filter->cache & 0xffff); - n = (n & 0xf) << 12; - filter->status = 8; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000) | n; - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = n; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = n; - CK((*filter->output_function)(s, filter->data)); - } - break; - - case 8: - filter->cache |= n << 6; - filter->status = 9; - break; - case 9: - s = n | (filter->cache & 0xffff); - filter->status = 2; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000); - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = 0; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = 0; - CK((*filter->output_function)(s, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -/* - * wchar => UTF-7 - */ -int mbfl_filt_conv_wchar_utf7(int c, mbfl_convert_filter *filter) -{ - int s, n; - - n = 0; - if (c >= 0 && c < 0x80) { /* ASCII */ - if (c >= 0x41 && c <= 0x5a) { /* A - Z */ - n = 1; - } else if (c >= 0x61 && c <= 0x7a) { /* a - z */ - n = 1; - } else if (c >= 0x30 && c <= 0x39) { /* 0 - 9 */ - n = 1; - } else if (c == '\0') { /* '\0' */ - n = 1; - } else if (c == 0x2f) { /* '/' */ - n = 1; - } else if (c == 0x2d) { /* '-' */ - n = 1; - } else if (c == 0x20) { /* SPACE */ - n = 2; - } else if (c == 0x09) { /* HTAB */ - n = 2; - } else if (c == 0x0d) { /* CR */ - n = 2; - } else if (c == 0x0a) { /* LF */ - n = 2; - } else if (c == 0x27) { /* "'" */ - n = 2; - } else if (c == 0x28) { /* '(' */ - n = 2; - } else if (c == 0x29) { /* ')' */ - n = 2; - } else if (c == 0x2c) { /* ',' */ - n = 2; - } else if (c == 0x2e) { /* '.' */ - n = 2; - } else if (c == 0x3a) { /* ':' */ - n = 2; - } else if (c == 0x3f) { /* '?' */ - n = 2; - } - } else if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - ; - } else if (c >= MBFL_WCSPLANE_SUPMIN && c < MBFL_WCSPLANE_SUPMAX) { - s = ((c >> 10) - 0x40) | 0xd800; - CK((*filter->filter_function)(s, filter)); - s = (c & 0x3ff) | 0xdc00; - CK((*filter->filter_function)(s, filter)); - return c; - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - return c; - } - - switch (filter->status) { - case 0: - if (n != 0) { /* directly encode characters */ - CK((*filter->output_function)(c, filter->data)); - } else { /* Modified Base64 */ - CK((*filter->output_function)(0x2b, filter->data)); /* '+' */ - filter->status++; - filter->cache = c; - } - break; - - /* encode Modified Base64 */ - case 1: - s = filter->cache; - CK((*filter->output_function)(mbfl_base64_table[(s >> 10) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(s >> 4) & 0x3f], filter->data)); - if (n != 0) { - CK((*filter->output_function)(mbfl_base64_table[(s << 2) & 0x3c], filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else { - filter->status++; - filter->cache = ((s & 0xf) << 16) | c; - } - break; - - case 2: - s = filter->cache; - CK((*filter->output_function)(mbfl_base64_table[(s >> 14) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(s >> 8) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(s >> 2) & 0x3f], filter->data)); - if (n != 0) { - CK((*filter->output_function)(mbfl_base64_table[(s << 4) & 0x30], filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else { - filter->status++; - filter->cache = ((s & 0x3) << 16) | c; - } - break; - - case 3: - s = filter->cache; - CK((*filter->output_function)(mbfl_base64_table[(s >> 12) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(s >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[s & 0x3f], filter->data)); - if (n != 0) { - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - CK((*filter->output_function)(c, filter->data)); - filter->status = 0; - } else { - filter->status = 1; - filter->cache = c; - } - break; - - default: - filter->status = 0; - break; - } - - return c; - -} - -int mbfl_filt_conv_wchar_utf7_flush(mbfl_convert_filter *filter) -{ - int status, cache; - - status = filter->status; - cache = filter->cache; - filter->status = 0; - filter->cache = 0; - /* flush fragments */ - switch (status) { - case 1: - CK((*filter->output_function)(mbfl_base64_table[(cache >> 10) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache >> 4) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache << 2) & 0x3c], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - - case 2: - CK((*filter->output_function)(mbfl_base64_table[(cache >> 14) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache >> 8) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache >> 2) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache << 4) & 0x30], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - - case 3: - CK((*filter->output_function)(mbfl_base64_table[(cache >> 12) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[(cache >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_base64_table[cache & 0x3f], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - } - return 0; -} - -static int mbfl_filt_ident_utf7(int c, mbfl_identify_filter *filter) -{ - int n; - - switch (filter->status) { - /* directly encoded characters */ - case 0: - if (c == 0x2b) { /* '+' shift character */ - filter->status++; - } else if (c == 0x5c || c == 0x7e || c < 0 || c > 0x7f) { /* illegal character */ - filter->flag = 1; /* bad */ - } - break; - - /* Modified Base64 */ - case 1: - case 2: - n = 0; - if (c >= 0x41 && c <= 0x5a) { /* A - Z */ - n = 1; - } else if (c >= 0x61 && c <= 0x7a) { /* a - z */ - n = 1; - } else if (c >= 0x30 && c <= 0x39) { /* 0 - 9 */ - n = 1; - } else if (c == 0x2b) { /* '+' */ - n = 1; - } else if (c == 0x2f) { /* '/' */ - n = 1; - } - if (n <= 0) { - if (filter->status == 1 && c != 0x2d) { - filter->flag = 1; /* bad */ - } else if (c < 0 || c > 0x7f) { - filter->flag = 1; /* bad */ - } - filter->status = 0; - } else { - filter->status = 2; - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7.h b/ext/mbstring/libmbfl/filters/mbfilter_utf7.h deleted file mode 100644 index 0da3b02c0e606..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UTF7_H -#define MBFL_MBFILTER_UTF7_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_utf7; -extern const struct mbfl_identify_vtbl vtbl_identify_utf7; -extern const struct mbfl_convert_vtbl vtbl_utf7_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf7; - -int mbfl_filt_conv_utf7_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf7(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf7_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UTF7_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c deleted file mode 100644 index b32095cd33700..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_utf7imap.h" - -const mbfl_encoding mbfl_encoding_utf7imap = { - mbfl_no_encoding_utf7imap, - "UTF7-IMAP", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE -}; - -const struct mbfl_convert_vtbl vtbl_utf7imap_wchar = { - mbfl_no_encoding_utf7imap, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf7imap_wchar, - mbfl_filt_conv_common_flush }; - -const struct mbfl_convert_vtbl vtbl_wchar_utf7imap = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf7imap, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf7imap, - mbfl_filt_conv_wchar_utf7imap_flush }; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UTF7-IMAP => wchar - */ -int mbfl_filt_conv_utf7imap_wchar(int c, mbfl_convert_filter *filter) -{ - int s, n; - - n = -1; - if (filter->status != 0) { /* Modified Base64 */ - if (c >= 0x41 && c <= 0x5a) { /* A - Z */ - n = c - 65; - } else if (c >= 0x61 && c <= 0x7a) { /* a - z */ - n = c - 71; - } else if (c >= 0x30 && c <= 0x39) { /* 0 - 9 */ - n = c + 4; - } else if (c == 0x2b) { /* '+' */ - n = 62; - } else if (c == 0x2c) { /* ',' */ - n = 63; - } - if (n < 0 || n > 63) { - if (c == 0x2d) { - if (filter->status == 1) { /* "&-" -> "&" */ - CK((*filter->output_function)(0x26, filter->data)); - } - } else if (c >= 0 && c < 0x80) { /* ASCII exclude '-' */ - CK((*filter->output_function)(c, filter->data)); - } else { /* illegal character */ - s = c & MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - filter->cache = 0; - filter->status = 0; - return c; - } - } - - switch (filter->status) { - /* directly encoded characters */ - case 0: - if (c == 0x26) { /* '&' shift character */ - filter->status++; - } else if (c >= 0 && c < 0x80) { /* ASCII */ - CK((*filter->output_function)(c, filter->data)); - } else { /* illegal character */ - s = c & MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - break; - - /* decode Modified Base64 */ - case 1: - case 2: - filter->cache |= n << 10; - filter->status = 3; - break; - case 3: - filter->cache |= n << 4; - filter->status = 4; - break; - case 4: - s = ((n >> 2) & 0xf) | (filter->cache & 0xffff); - n = (n & 0x3) << 14; - filter->status = 5; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000) | n; - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = n; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = n; - CK((*filter->output_function)(s, filter->data)); - } - break; - - case 5: - filter->cache |= n << 8; - filter->status = 6; - break; - case 6: - filter->cache |= n << 2; - filter->status = 7; - break; - case 7: - s = ((n >> 4) & 0x3) | (filter->cache & 0xffff); - n = (n & 0xf) << 12; - filter->status = 8; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000) | n; - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = n; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = n; - CK((*filter->output_function)(s, filter->data)); - } - break; - - case 8: - filter->cache |= n << 6; - filter->status = 9; - break; - case 9: - s = n | (filter->cache & 0xffff); - filter->status = 2; - if (s >= 0xd800 && s < 0xdc00) { - s = (((s & 0x3ff) << 16) + 0x400000); - filter->cache = s; - } else if (s >= 0xdc00 && s < 0xe000) { - s &= 0x3ff; - s |= (filter->cache & 0xfff0000) >> 6; - filter->cache = 0; - if (s >= MBFL_WCSPLANE_SUPMIN && s < MBFL_WCSPLANE_SUPMAX) { - CK((*filter->output_function)(s, filter->data)); - } else { /* illegal character */ - s &= MBFL_WCSGROUP_MASK; - s |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(s, filter->data)); - } - } else { - filter->cache = 0; - CK((*filter->output_function)(s, filter->data)); - } - break; - - default: - filter->status = 0; - break; - } - - return c; -} - -static const unsigned char mbfl_utf7imap_base64_table[] = -{ - /* 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', */ - 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d, - /* 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', */ - 0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a, - /* 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', */ - 0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d, - /* 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', */ - 0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a, - /* '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', ',', '\0' */ - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2b,0x2c,0x00 -}; - -/* - * wchar => UTF7-IMAP - */ -int mbfl_filt_conv_wchar_utf7imap(int c, mbfl_convert_filter *filter) -{ - int n, s; - - n = 0; - if (c == 0x26) { - n = 1; - } else if ((c >= 0x20 && c <= 0x7e) || c == 0) { - n = 2; - } else if (c >= 0 && c < MBFL_WCSPLANE_UCS2MAX) { - ; - } else if (c >= MBFL_WCSPLANE_SUPMIN && c < MBFL_WCSPLANE_SUPMAX) { - s = ((c >> 10) - 0x40) | 0xd800; - CK((*filter->filter_function)(s, filter)); - s = (c & 0x3ff) | 0xdc00; - CK((*filter->filter_function)(s, filter)); - return c; - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - return c; - } - - switch (filter->status) { - case 0: - if (n != 0) { /* directly encode characters */ - CK((*filter->output_function)(c, filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - } else { /* Modified Base64 */ - CK((*filter->output_function)(0x26, filter->data)); /* '&' */ - filter->status = 1; - filter->cache = c; - } - break; - - /* encode Modified Base64 */ - case 1: - s = filter->cache; - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 10) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 4) & 0x3f], filter->data)); - if (n != 0) { - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s << 2) & 0x3c], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - CK((*filter->output_function)(c, filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - filter->status = 0; - } else { - filter->status = 2; - filter->cache = ((s & 0xf) << 16) | c; - } - break; - - case 2: - s = filter->cache; - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 14) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 8) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 2) & 0x3f], filter->data)); - if (n != 0) { - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s << 4) & 0x30], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - CK((*filter->output_function)(c, filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - filter->status = 0; - } else { - filter->status = 3; - filter->cache = ((s & 0x3) << 16) | c; - } - break; - - case 3: - s = filter->cache; - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 12) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(s >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[s & 0x3f], filter->data)); - if (n != 0) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - CK((*filter->output_function)(c, filter->data)); - if (n == 1) { - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - } - filter->status = 0; - } else { - filter->status = 1; - filter->cache = c; - } - break; - - default: - filter->status = 0; - break; - } - - return c; - -} - -int mbfl_filt_conv_wchar_utf7imap_flush(mbfl_convert_filter *filter) -{ - int status, cache; - - status = filter->status; - cache = filter->cache; - filter->status = 0; - filter->cache = 0; - /* flush fragments */ - switch (status) { - case 1: - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 10) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 4) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache << 2) & 0x3c], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - - case 2: - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 14) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 8) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 2) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache << 4) & 0x30], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - - case 3: - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 12) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[(cache >> 6) & 0x3f], filter->data)); - CK((*filter->output_function)(mbfl_utf7imap_base64_table[cache & 0x3f], filter->data)); - CK((*filter->output_function)(0x2d, filter->data)); /* '-' */ - break; - } - return 0; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.h b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.h deleted file mode 100644 index d6c54789c3157..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UTF7IMAP_H -#define MBFL_MBFILTER_UTF7IMAP_H - -#include "mbfilter.h" - -extern const mbfl_encoding mbfl_encoding_utf7imap; -extern const struct mbfl_convert_vtbl vtbl_utf7imap_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf7imap; - -int mbfl_filt_conv_utf7imap_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf7imap(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf7imap_flush(mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UTF7IMAP_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c deleted file mode 100644 index 8b95897eac751..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_utf8.h" - -static int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter); - -static const unsigned char mblen_table_utf8[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 -}; - -static const char *mbfl_encoding_utf8_aliases[] = {"utf8", NULL}; - -const mbfl_encoding mbfl_encoding_utf8 = { - mbfl_no_encoding_utf8, - "UTF-8", - "UTF-8", - (const char *(*)[])&mbfl_encoding_utf8_aliases, - mblen_table_utf8, - MBFL_ENCTYPE_MBCS -}; - -const struct mbfl_identify_vtbl vtbl_identify_utf8 = { - mbfl_no_encoding_utf8, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_utf8 -}; - -const struct mbfl_convert_vtbl vtbl_utf8_wchar = { - mbfl_no_encoding_utf8, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_utf8_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_utf8, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_utf8, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* - * UTF-8 => wchar - */ -int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) -{ - int s; - - if (c < 0x80) { - if (c >= 0) { - CK((*filter->output_function)(c, filter->data)); - } - filter->status = 0; - } else if (c < 0xc0) { - switch (filter->status & 0xff) { - case 0x10: /* 2byte code 2nd char */ - case 0x21: /* 3byte code 3rd char */ - case 0x32: /* 4byte code 4th char */ - case 0x43: /* 5byte code 5th char */ - case 0x54: /* 6byte code 6th char */ - filter->status = 0; - s = filter->cache | (c & 0x3f); - if (s >= 0x80) { - CK((*filter->output_function)(s, filter->data)); - } - break; - case 0x20: /* 3byte code 2nd char */ - case 0x31: /* 4byte code 3rd char */ - case 0x42: /* 5byte code 4th char */ - case 0x53: /* 6byte code 5th char */ - filter->cache |= ((c & 0x3f) << 6); - filter->status++; - break; - case 0x30: /* 4byte code 2nd char */ - case 0x41: /* 5byte code 3rd char */ - case 0x52: /* 6byte code 4th char */ - filter->cache |= ((c & 0x3f) << 12); - filter->status++; - break; - case 0x40: /* 5byte code 2nd char */ - case 0x51: /* 6byte code 3rd char */ - filter->cache |= ((c & 0x3f) << 18); - filter->status++; - break; - case 0x50: /* 6byte code 2nd char */ - filter->cache |= ((c & 0x3f) << 24); - filter->status++; - break; - default: - filter->status = 0; - break; - } - } else if (c < 0xe0) { /* 2byte code first char */ - filter->status = 0x10; - filter->cache = (c & 0x1f) << 6; - } else if (c < 0xf0) { /* 3byte code first char */ - filter->status = 0x20; - filter->cache = (c & 0xf) << 12; - } else if (c < 0xf8) { /* 4byte code first char */ - filter->status = 0x30; - filter->cache = (c & 0x7) << 18; - } else if (c < 0xfc) { /* 5byte code first char */ - filter->status = 0x40; - filter->cache = (c & 0x3) << 24; - } else if (c < 0xfe) { /* 6 byte code first char */ - filter->status = 0x50; - filter->cache = (c & 0x1) << 30; - } else { - filter->status = 0; - filter->cache = 0; - } - - return c; -} - -/* - * wchar => UTF-8 - */ -int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter) -{ - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { - if (c < 0x80) { - CK((*filter->output_function)(c, filter->data)); - } else if (c < 0x800) { - CK((*filter->output_function)(((c >> 6) & 0x1f) | 0xc0, filter->data)); - CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x10000) { - CK((*filter->output_function)(((c >> 12) & 0x0f) | 0xe0, filter->data)); - CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x200000) { - CK((*filter->output_function)(((c >> 18) & 0x07) | 0xf0, filter->data)); - CK((*filter->output_function)(((c >> 12) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x4000000) { - CK((*filter->output_function)(((c >> 24) & 0x03) | 0xf8, filter->data)); - CK((*filter->output_function)(((c >> 18) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 12) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else { - CK((*filter->output_function)(((c >> 30) & 0x01) | 0xfc, filter->data)); - CK((*filter->output_function)(((c >> 24) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 18) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 12) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); - CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } - } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } - } - - return c; -} - -static int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter) -{ - if (c < 0x80) { - if (c < 0) { - filter->flag = 1; /* bad */ - } else if (c != 0 && filter->status) { - filter->flag = 1; /* bad */ - } - filter->status = 0; - } else if (c < 0xc0) { - switch (filter->status) { - case 0x20: /* 3 byte code 2nd char */ - case 0x30: /* 4 byte code 2nd char */ - case 0x31: /* 4 byte code 3rd char */ - case 0x40: /* 5 byte code 2nd char */ - case 0x41: /* 5 byte code 3rd char */ - case 0x42: /* 5 byte code 4th char */ - case 0x50: /* 6 byte code 2nd char */ - case 0x51: /* 6 byte code 3rd char */ - case 0x52: /* 6 byte code 4th char */ - case 0x53: /* 6 byte code 5th char */ - filter->status++; - break; - case 0x10: /* 2 byte code 2nd char */ - case 0x21: /* 3 byte code 3rd char */ - case 0x32: /* 4 byte code 4th char */ - case 0x43: /* 5 byte code 5th char */ - case 0x54: /* 6 byte code 6th char */ - filter->status = 0; - break; - default: - filter->flag = 1; /* bad */ - filter->status = 0; - break; - } - } else { - if (filter->status) { - filter->flag = 1; /* bad */ - } - filter->status = 0; - if (c < 0xe0) { /* 2 byte code first char */ - filter->status = 0x10; - } else if (c < 0xf0) { /* 3 byte code 1st char */ - filter->status = 0x20; - } else if (c < 0xf8) { /* 4 byte code 1st char */ - filter->status = 0x30; - } else if (c < 0xfc) { /* 5 byte code 1st char */ - filter->status = 0x40; - } else if (c < 0xfe) { /* 6 byte code 1st char */ - filter->status = 0x50; - } else { - filter->flag = 1; /* bad */ - } - } - - return c; -} diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h b/ext/mbstring/libmbfl/filters/mbfilter_utf8.h deleted file mode 100644 index 07bf655022a18..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UTF8_H -#define MBFL_MBFILTER_UTF8_H - -extern const mbfl_encoding mbfl_encoding_utf8; -extern const struct mbfl_identify_vtbl vtbl_identify_utf8; -extern const struct mbfl_convert_vtbl vtbl_utf8_wchar; -extern const struct mbfl_convert_vtbl vtbl_wchar_utf8; - -int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UTF8_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c deleted file mode 100644 index 64fc39d19bdb1..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfilter.h" -#include "mbfilter_uuencode.h" - -const mbfl_encoding mbfl_encoding_uuencode = { - mbfl_no_encoding_uuencode, - "UUENCODE", - "x-uuencode", - NULL, - NULL, - MBFL_ENCTYPE_SBCS -}; - -const struct mbfl_convert_vtbl vtbl_uuencode_8bit = { - mbfl_no_encoding_uuencode, - mbfl_no_encoding_8bit, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_uudec, - mbfl_filt_conv_common_flush -}; - -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -/* uuencode => any */ -#define UUDEC(c) (char)(((c)-' ')&077) -static const char * uuenc_begin_text = "begin "; -enum { uudec_state_ground=0, uudec_state_inbegin, - uudec_state_until_newline, - uudec_state_size, uudec_state_a, uudec_state_b, uudec_state_c, uudec_state_d, - uudec_state_skip_newline}; - -int mbfl_filt_conv_uudec(int c, mbfl_convert_filter * filter) -{ - int n; - - switch(filter->status) { - case uudec_state_ground: - /* looking for "begin 0666 filename\n" line */ - if (filter->cache == 0 && c == 'b') - { - filter->status = uudec_state_inbegin; - filter->cache = 1; /* move to 'e' */ - } - else if (c == '\n') - filter->cache = 0; - else - filter->cache++; - break; - case uudec_state_inbegin: - if (uuenc_begin_text[filter->cache++] != c) { - /* doesn't match pattern */ - filter->status = uudec_state_ground; - break; - } - if (filter->cache == 5) - { - /* thats good enough - wait for a newline */ - filter->status = uudec_state_until_newline; - filter->cache = 0; - } - break; - case uudec_state_until_newline: - if (c == '\n') - filter->status = uudec_state_size; - break; - case uudec_state_size: - /* get "size" byte */ - n = UUDEC(c); - filter->cache = n << 24; - filter->status = uudec_state_a; - break; - case uudec_state_a: - /* get "a" byte */ - n = UUDEC(c); - filter->cache |= (n << 16); - filter->status = uudec_state_b; - break; - case uudec_state_b: - /* get "b" byte */ - n = UUDEC(c); - filter->cache |= (n << 8); - filter->status = uudec_state_c; - break; - case uudec_state_c: - /* get "c" byte */ - n = UUDEC(c); - filter->cache |= n; - filter->status = uudec_state_d; - break; - case uudec_state_d: - /* get "d" byte */ - { - int A, B, C, D = UUDEC(c); - A = (filter->cache >> 16) & 0xff; - B = (filter->cache >> 8) & 0xff; - C = (filter->cache) & 0xff; - n = (filter->cache >> 24) & 0xff; - if (n-- > 0) - CK((*filter->output_function)( (A << 2) | (B >> 4), filter->data)); - if (n-- > 0) - CK((*filter->output_function)( (B << 4) | (C >> 2), filter->data)); - if (n-- > 0) - CK((*filter->output_function)( (C << 6) | D, filter->data)); - filter->cache = n << 24; - - if (n == 0) - filter->status = uudec_state_skip_newline; /* skip next byte (newline) */ - else - filter->status = uudec_state_a; /* go back to fetch "A" byte */ - } - break; - case uudec_state_skip_newline: - /* skip newline */ - filter->status = uudec_state_size; - } - return c; -} - - diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.h b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.h deleted file mode 100644 index ca7521c39c33c..0000000000000 --- a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_UUENCODE_H -#define MBFL_MBFILTER_UUENCODE_H - -extern const mbfl_encoding mbfl_encoding_uuencode; -extern const struct mbfl_convert_vtbl vtbl_uuencode_8bit; - -int mbfl_filt_conv_uudec(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_UUENCODE_H */ - diff --git a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk deleted file mode 100755 index f0ad290e24173..0000000000000 --- a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/awk -f -# -# $Id$ -# -# Description: a script that generates a single byte code set to Unicode -# mapping table. -# - -function conv(str) { - if (!match(str, "^0[xX]")) { - return 0 + str - } - - retval = 0 - - for (i = 3; i <= length(str); i++) { - n = index("0123456789abcdefABCDEF", substr(str, i, 1)) - 1 - - if (n < 0) { - return 0 + str; - } else if (n >= 16) { - n -= 6; - } - - retval = retval * 16 + n - } - - return retval -} - -BEGIN { - FS="[ \t#]" -} - -/^#/ { - # Do nothing -} - -{ - tbl[conv($1)] = conv($2) -} - -END { - print "/* This file is automatically generated. Do not edit! */" - if (IFNDEF_NAME) { - print "#ifndef " IFNDEF_NAME - } - - print "static const int " TABLE_NAME "[] = {" - i = 160; - for (;;) { - printf("\t0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x", tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++]); - if (i != 256) { - printf(",\n"); - } else { - print "" - break; - } - } - print "};" - - if (IFNDEF_NAME) { - print "#endif /* " IFNDEF_NAME " */" - } -} diff --git a/ext/mbstring/libmbfl/filters/unicode_prop.h b/ext/mbstring/libmbfl/filters/unicode_prop.h deleted file mode 100644 index d21ec61dfb1c9..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_prop.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The authors of this file: PHP3 Internationalization team - * - */ - -/* charactor property table */ -#define MBFL_CHP_CTL 0x01 -#define MBFL_CHP_DIGIT 0x02 -#define MBFL_CHP_UALPHA 0x04 -#define MBFL_CHP_LALPHA 0x08 -#define MBFL_CHP_MMHQENC 0x10 /* must Q-encoding in MIME Header encoded-word */ -#define MBFL_CHP_MSPECIAL 0x20 /* RFC822 Special characters */ - -/* - * Unicode table - */ - -static const unsigned char mbfl_charprop_table[] = { -/* NUL 0 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC, -/* SCH 1 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SIX 2 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* EIX 3 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* EOT 4 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* ENQ 5 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* ACK 6 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* BEL 7 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* BS 8 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* HI 9 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* LF 10 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* VI 11 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* FF 12 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* CR 13 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SO 14 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SI 15 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SLE 16 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* CSI 17 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* DC2 18 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* DC3 19 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* DC4 20 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* NAK 21 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SYN 22 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* EIB 23 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* CAN 24 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* EM 25 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SLB 26 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* ESC 27 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* FS 28 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* GS 29 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* RS 30 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* US 31 */ MBFL_CHP_CTL | MBFL_CHP_MMHQENC , -/* SP 32 */ MBFL_CHP_MMHQENC , -/* ! 33 */ 0 , -/* " 34 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* # 35 */ MBFL_CHP_MMHQENC , -/* $ 36 */ MBFL_CHP_MMHQENC , -/* % 37 */ MBFL_CHP_MMHQENC , -/* & 38 */ MBFL_CHP_MMHQENC , -/* ' 39 */ MBFL_CHP_MMHQENC , -/* ( 40 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* ) 41 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* * 42 */ 0 , -/* + 43 */ 0 , -/* , 44 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* - 45 */ 0 , -/* . 46 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* / 47 */ 0 , -/* 0 48 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 1 49 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 2 50 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 3 51 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 4 52 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 5 53 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 6 54 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 7 55 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 8 56 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* 9 57 */ MBFL_CHP_DIGIT | MBFL_CHP_MMHQENC , -/* : 58 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* ; 59 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* < 60 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* = 61 */ 0 , -/* > 62 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* ? 63 */ MBFL_CHP_MMHQENC , -/* @ 64 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* A 65 */ MBFL_CHP_UALPHA , -/* B 66 */ MBFL_CHP_UALPHA , -/* C 67 */ MBFL_CHP_UALPHA , -/* D 68 */ MBFL_CHP_UALPHA , -/* E 69 */ MBFL_CHP_UALPHA , -/* F 70 */ MBFL_CHP_UALPHA , -/* G 71 */ MBFL_CHP_UALPHA , -/* H 72 */ MBFL_CHP_UALPHA , -/* I 73 */ MBFL_CHP_UALPHA , -/* J 74 */ MBFL_CHP_UALPHA , -/* K 75 */ MBFL_CHP_UALPHA , -/* L 76 */ MBFL_CHP_UALPHA , -/* M 77 */ MBFL_CHP_UALPHA , -/* N 78 */ MBFL_CHP_UALPHA , -/* O 79 */ MBFL_CHP_UALPHA , -/* P 80 */ MBFL_CHP_UALPHA , -/* Q 81 */ MBFL_CHP_UALPHA , -/* R 82 */ MBFL_CHP_UALPHA , -/* S 83 */ MBFL_CHP_UALPHA , -/* T 84 */ MBFL_CHP_UALPHA , -/* U 85 */ MBFL_CHP_UALPHA , -/* V 86 */ MBFL_CHP_UALPHA , -/* W 87 */ MBFL_CHP_UALPHA , -/* X 88 */ MBFL_CHP_UALPHA , -/* Y 89 */ MBFL_CHP_UALPHA , -/* Z 90 */ MBFL_CHP_UALPHA , -/* [ 91 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* \ 92 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* ] 93 */ MBFL_CHP_MMHQENC | MBFL_CHP_MSPECIAL , -/* ^ 94 */ MBFL_CHP_MMHQENC , -/* _ 95 */ MBFL_CHP_MMHQENC , -/* ` 96 */ MBFL_CHP_MMHQENC , -/* a 97 */ MBFL_CHP_LALPHA , -/* b 98 */ MBFL_CHP_LALPHA , -/* c 99 */ MBFL_CHP_LALPHA , -/* d 100 */ MBFL_CHP_LALPHA , -/* e 101 */ MBFL_CHP_LALPHA , -/* f 102 */ MBFL_CHP_LALPHA , -/* g 103 */ MBFL_CHP_LALPHA , -/* h 104 */ MBFL_CHP_LALPHA , -/* i 105 */ MBFL_CHP_LALPHA , -/* j 106 */ MBFL_CHP_LALPHA , -/* k 107 */ MBFL_CHP_LALPHA , -/* l 108 */ MBFL_CHP_LALPHA , -/* m 109 */ MBFL_CHP_LALPHA , -/* n 110 */ MBFL_CHP_LALPHA , -/* o 111 */ MBFL_CHP_LALPHA , -/* p 112 */ MBFL_CHP_LALPHA , -/* q 113 */ MBFL_CHP_LALPHA , -/* r 114 */ MBFL_CHP_LALPHA , -/* s 115 */ MBFL_CHP_LALPHA , -/* t 116 */ MBFL_CHP_LALPHA , -/* u 117 */ MBFL_CHP_LALPHA , -/* v 118 */ MBFL_CHP_LALPHA , -/* w 119 */ MBFL_CHP_LALPHA , -/* x 120 */ MBFL_CHP_LALPHA , -/* y 121 */ MBFL_CHP_LALPHA , -/* z 122 */ MBFL_CHP_LALPHA , -/* { 123 */ MBFL_CHP_MMHQENC , -/* | 124 */ MBFL_CHP_MMHQENC , -/* } 125 */ MBFL_CHP_MMHQENC , -/* ~ 126 */ MBFL_CHP_MMHQENC , -/* DEL 127 */ MBFL_CHP_MMHQENC -}; - diff --git a/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h b/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h deleted file mode 100644 index 174e95de7a831..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Hayk Chamyan - * - */ - -#ifndef UNICODE_TABLE_ARMSCII8_H -#define UNICODE_TABLE_ARMSCII8_H - -/* ArmSCII-8 to Unicode table */ -static const unsigned short armscii8_ucs_table[] = { -/*0x00a0, 0x00a1, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,*/ -0x00a0, 0xfffd, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab, -0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c, -0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563, -0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567, -0x0538, 0x0568, 0x0539, 0x0569, 0x053a, 0x056a, 0x053b, 0x056b, -0x053c, 0x056c, 0x053d, 0x056d, 0x053e, 0x056e, 0x053f, 0x056f, -0x0540, 0x0570, 0x0541, 0x0571, 0x0542, 0x0572, 0x0543, 0x0573, -0x0544, 0x0574, 0x0545, 0x0575, 0x0546, 0x0576, 0x0547, 0x0577, -0x0548, 0x0578, 0x0549, 0x0579, 0x054a, 0x057a, 0x054b, 0x057b, -0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f, -0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583, -/*0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0x00ff*/ -0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd -}; - -static const unsigned char ucs_armscii8_table[] = { -0xa5, 0xa4, 0x2a, 0x2b, 0xab, 0xac, 0xa9, 0x2f -}; - -static const int armscii8_ucs_table_min = 0xa0; -static const int armscii8_ucs_table_len = (sizeof (armscii8_ucs_table) / sizeof (unsigned short)); -static const int armscii8_ucs_table_max = 0xa0 + (sizeof (armscii8_ucs_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_ARMSCII8_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_big5.h b/ext/mbstring/libmbfl/filters/unicode_table_big5.h deleted file mode 100644 index 2616d0433a47e..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_big5.h +++ /dev/null @@ -1,5123 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ - -#ifndef UNICODE_TABLE_BIG5_H -#define UNICODE_TABLE_BIG5_H - -/* Big5 -> UCS */ -static const unsigned short big5_ucs_table[] = { -0x3000,0xff0c,0x3001,0x3002,0xff0e,0x2027,0xff1b,0xff1a, -0xff1f,0xff01,0xfe30,0x2026,0x2025,0xfe50,0xfe51,0xfe52, -0x00b7,0xfe54,0xfe55,0xfe56,0xfe57,0xff5c,0x2013,0xfe31, -0x2014,0xfe33,0x2574,0xfe34,0xfe4f,0xff08,0xff09,0xfe35, -0xfe36,0xff5b,0xff5d,0xfe37,0xfe38,0x3014,0x3015,0xfe39, -0xfe3a,0x3010,0x3011,0xfe3b,0xfe3c,0x300a,0x300b,0xfe3d, -0xfe3e,0x3008,0x3009,0xfe3f,0xfe40,0x300c,0x300d,0xfe41, -0xfe42,0x300e,0x300f,0xfe43,0xfe44,0xfe59,0xfe5a,0xfe5b, -0xfe5c,0xfe5d,0xfe5e,0x2018,0x2019,0x201c,0x201d,0x301d, -0x301e,0x2035,0x2032,0xff03,0xff06,0xff0a,0x203b,0x00a7, -0x3003,0x25cb,0x25cf,0x25b3,0x25b2,0x25ce,0x2606,0x2605, -0x25c7,0x25c6,0x25a1,0x25a0,0x25bd,0x25bc,0x32a3,0x2105, -0x00af,0xffe3,0xff3f,0x02cd,0xfe49,0xfe4a,0xfe4d,0xfe4e, -0xfe4b,0xfe4c,0xfe5f,0xfe60,0xfe61,0xff0b,0xff0d,0x00d7, -0x00f7,0x00b1,0x221a,0xff1c,0xff1e,0xff1d,0x2266,0x2267, -0x2260,0x221e,0x2252,0x2261,0xfe62,0xfe63,0xfe64,0xfe65, -0xfe66,0xff5e,0x2229,0x222a,0x22a5,0x2220,0x221f,0x22bf, -0x33d2,0x33d1,0x222b,0x222e,0x2235,0x2234,0x2640,0x2642, -0x2295,0x2299,0x2191,0x2193,0x2190,0x2192,0x2196,0x2197, -0x2199,0x2198,0x2225,0x2223,0xff0f,0xff3c,0x2215,0xfe68, -0xff04,0xffe5,0x3012,0xffe0,0xffe1,0xff05,0xff20,0x2103, -0x2109,0xfe69,0xfe6a,0xfe6b,0x33d5,0x339c,0x339d,0x339e, -0x33ce,0x33a1,0x338e,0x338f,0x33c4,0x00b0,0x5159,0x515b, -0x515e,0x515d,0x5161,0x5163,0x55e7,0x74e9,0x7cce,0x2581, -0x2582,0x2583,0x2584,0x2585,0x2586,0x2587,0x2588,0x258f, -0x258e,0x258d,0x258c,0x258b,0x258a,0x2589,0x253c,0x2534, -0x252c,0x2524,0x251c,0x2594,0x2500,0x2502,0x2595,0x250c, -0x2510,0x2514,0x2518,0x256d,0x256e,0x2570,0x256f,0x2550, -0x255e,0x256a,0x2561,0x25e2,0x25e3,0x25e5,0x25e4,0x2571, -0x2572,0x2573,0xff10,0xff11,0xff12,0xff13,0xff14,0xff15, -0xff16,0xff17,0xff18,0xff19,0x2160,0x2161,0x2162,0x2163, -0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x3021,0x3022, -0x3023,0x3024,0x3025,0x3026,0x3027,0x3028,0x3029,0x5341, -0x5344,0x5345,0xff21,0xff22,0xff23,0xff24,0xff25,0xff26, -0xff27,0xff28,0xff29,0xff2a,0xff2b,0xff2c,0xff2d,0xff2e, -0xff2f,0xff30,0xff31,0xff32,0xff33,0xff34,0xff35,0xff36, -0xff37,0xff38,0xff39,0xff3a,0xff41,0xff42,0xff43,0xff44, -0xff45,0xff46,0xff47,0xff48,0xff49,0xff4a,0xff4b,0xff4c, -0xff4d,0xff4e,0xff4f,0xff50,0xff51,0xff52,0xff53,0xff54, -0xff55,0xff56,0xff57,0xff58,0xff59,0xff5a,0x0391,0x0392, -0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399,0x039a, -0x039b,0x039c,0x039d,0x039e,0x039f,0x03a0,0x03a1,0x03a3, -0x03a4,0x03a5,0x03a6,0x03a7,0x03a8,0x03a9,0x03b1,0x03b2, -0x03b3,0x03b4,0x03b5,0x03b6,0x03b7,0x03b8,0x03b9,0x03ba, -0x03bb,0x03bc,0x03bd,0x03be,0x03bf,0x03c0,0x03c1,0x03c3, -0x03c4,0x03c5,0x03c6,0x03c7,0x03c8,0x03c9,0x3105,0x3106, -0x3107,0x3108,0x3109,0x310a,0x310b,0x310c,0x310d,0x310e, -0x310f,0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116, -0x3117,0x3118,0x3119,0x311a,0x311b,0x311c,0x311d,0x311e, -0x311f,0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126, -0x3127,0x3128,0x3129,0x02d9,0x02c9,0x02ca,0x02c7,0x02cb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x20ac,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x4e00, -0x4e59,0x4e01,0x4e03,0x4e43,0x4e5d,0x4e86,0x4e8c,0x4eba, -0x513f,0x5165,0x516b,0x51e0,0x5200,0x5201,0x529b,0x5315, -0x5341,0x535c,0x53c8,0x4e09,0x4e0b,0x4e08,0x4e0a,0x4e2b, -0x4e38,0x51e1,0x4e45,0x4e48,0x4e5f,0x4e5e,0x4e8e,0x4ea1, -0x5140,0x5203,0x52fa,0x5343,0x53c9,0x53e3,0x571f,0x58eb, -0x5915,0x5927,0x5973,0x5b50,0x5b51,0x5b53,0x5bf8,0x5c0f, -0x5c22,0x5c38,0x5c71,0x5ddd,0x5de5,0x5df1,0x5df2,0x5df3, -0x5dfe,0x5e72,0x5efe,0x5f0b,0x5f13,0x624d,0x4e11,0x4e10, -0x4e0d,0x4e2d,0x4e30,0x4e39,0x4e4b,0x5c39,0x4e88,0x4e91, -0x4e95,0x4e92,0x4e94,0x4ea2,0x4ec1,0x4ec0,0x4ec3,0x4ec6, -0x4ec7,0x4ecd,0x4eca,0x4ecb,0x4ec4,0x5143,0x5141,0x5167, -0x516d,0x516e,0x516c,0x5197,0x51f6,0x5206,0x5207,0x5208, -0x52fb,0x52fe,0x52ff,0x5316,0x5339,0x5348,0x5347,0x5345, -0x535e,0x5384,0x53cb,0x53ca,0x53cd,0x58ec,0x5929,0x592b, -0x592a,0x592d,0x5b54,0x5c11,0x5c24,0x5c3a,0x5c6f,0x5df4, -0x5e7b,0x5eff,0x5f14,0x5f15,0x5fc3,0x6208,0x6236,0x624b, -0x624e,0x652f,0x6587,0x6597,0x65a4,0x65b9,0x65e5,0x66f0, -0x6708,0x6728,0x6b20,0x6b62,0x6b79,0x6bcb,0x6bd4,0x6bdb, -0x6c0f,0x6c34,0x706b,0x722a,0x7236,0x723b,0x7247,0x7259, -0x725b,0x72ac,0x738b,0x4e19,0x4e16,0x4e15,0x4e14,0x4e18, -0x4e3b,0x4e4d,0x4e4f,0x4e4e,0x4ee5,0x4ed8,0x4ed4,0x4ed5, -0x4ed6,0x4ed7,0x4ee3,0x4ee4,0x4ed9,0x4ede,0x5145,0x5144, -0x5189,0x518a,0x51ac,0x51f9,0x51fa,0x51f8,0x520a,0x52a0, -0x529f,0x5305,0x5306,0x5317,0x531d,0x4edf,0x534a,0x5349, -0x5361,0x5360,0x536f,0x536e,0x53bb,0x53ef,0x53e4,0x53f3, -0x53ec,0x53ee,0x53e9,0x53e8,0x53fc,0x53f8,0x53f5,0x53eb, -0x53e6,0x53ea,0x53f2,0x53f1,0x53f0,0x53e5,0x53ed,0x53fb, -0x56db,0x56da,0x5916,0x592e,0x5931,0x5974,0x5976,0x5b55, -0x5b83,0x5c3c,0x5de8,0x5de7,0x5de6,0x5e02,0x5e03,0x5e73, -0x5e7c,0x5f01,0x5f18,0x5f17,0x5fc5,0x620a,0x6253,0x6254, -0x6252,0x6251,0x65a5,0x65e6,0x672e,0x672c,0x672a,0x672b, -0x672d,0x6b63,0x6bcd,0x6c11,0x6c10,0x6c38,0x6c41,0x6c40, -0x6c3e,0x72af,0x7384,0x7389,0x74dc,0x74e6,0x7518,0x751f, -0x7528,0x7529,0x7530,0x7531,0x7532,0x7533,0x758b,0x767d, -0x76ae,0x76bf,0x76ee,0x77db,0x77e2,0x77f3,0x793a,0x79be, -0x7a74,0x7acb,0x4e1e,0x4e1f,0x4e52,0x4e53,0x4e69,0x4e99, -0x4ea4,0x4ea6,0x4ea5,0x4eff,0x4f09,0x4f19,0x4f0a,0x4f15, -0x4f0d,0x4f10,0x4f11,0x4f0f,0x4ef2,0x4ef6,0x4efb,0x4ef0, -0x4ef3,0x4efd,0x4f01,0x4f0b,0x5149,0x5147,0x5146,0x5148, -0x5168,0x5171,0x518d,0x51b0,0x5217,0x5211,0x5212,0x520e, -0x5216,0x52a3,0x5308,0x5321,0x5320,0x5370,0x5371,0x5409, -0x540f,0x540c,0x540a,0x5410,0x5401,0x540b,0x5404,0x5411, -0x540d,0x5408,0x5403,0x540e,0x5406,0x5412,0x56e0,0x56de, -0x56dd,0x5733,0x5730,0x5728,0x572d,0x572c,0x572f,0x5729, -0x5919,0x591a,0x5937,0x5938,0x5984,0x5978,0x5983,0x597d, -0x5979,0x5982,0x5981,0x5b57,0x5b58,0x5b87,0x5b88,0x5b85, -0x5b89,0x5bfa,0x5c16,0x5c79,0x5dde,0x5e06,0x5e76,0x5e74, -0x5f0f,0x5f1b,0x5fd9,0x5fd6,0x620e,0x620c,0x620d,0x6210, -0x6263,0x625b,0x6258,0x6536,0x65e9,0x65e8,0x65ec,0x65ed, -0x66f2,0x66f3,0x6709,0x673d,0x6734,0x6731,0x6735,0x6b21, -0x6b64,0x6b7b,0x6c16,0x6c5d,0x6c57,0x6c59,0x6c5f,0x6c60, -0x6c50,0x6c55,0x6c61,0x6c5b,0x6c4d,0x6c4e,0x7070,0x725f, -0x725d,0x767e,0x7af9,0x7c73,0x7cf8,0x7f36,0x7f8a,0x7fbd, -0x8001,0x8003,0x800c,0x8012,0x8033,0x807f,0x8089,0x808b, -0x808c,0x81e3,0x81ea,0x81f3,0x81fc,0x820c,0x821b,0x821f, -0x826e,0x8272,0x827e,0x866b,0x8840,0x884c,0x8863,0x897f, -0x9621,0x4e32,0x4ea8,0x4f4d,0x4f4f,0x4f47,0x4f57,0x4f5e, -0x4f34,0x4f5b,0x4f55,0x4f30,0x4f50,0x4f51,0x4f3d,0x4f3a, -0x4f38,0x4f43,0x4f54,0x4f3c,0x4f46,0x4f63,0x4f5c,0x4f60, -0x4f2f,0x4f4e,0x4f36,0x4f59,0x4f5d,0x4f48,0x4f5a,0x514c, -0x514b,0x514d,0x5175,0x51b6,0x51b7,0x5225,0x5224,0x5229, -0x522a,0x5228,0x52ab,0x52a9,0x52aa,0x52ac,0x5323,0x5373, -0x5375,0x541d,0x542d,0x541e,0x543e,0x5426,0x544e,0x5427, -0x5446,0x5443,0x5433,0x5448,0x5442,0x541b,0x5429,0x544a, -0x5439,0x543b,0x5438,0x542e,0x5435,0x5436,0x5420,0x543c, -0x5440,0x5431,0x542b,0x541f,0x542c,0x56ea,0x56f0,0x56e4, -0x56eb,0x574a,0x5751,0x5740,0x574d,0x5747,0x574e,0x573e, -0x5750,0x574f,0x573b,0x58ef,0x593e,0x599d,0x5992,0x59a8, -0x599e,0x59a3,0x5999,0x5996,0x598d,0x59a4,0x5993,0x598a, -0x59a5,0x5b5d,0x5b5c,0x5b5a,0x5b5b,0x5b8c,0x5b8b,0x5b8f, -0x5c2c,0x5c40,0x5c41,0x5c3f,0x5c3e,0x5c90,0x5c91,0x5c94, -0x5c8c,0x5deb,0x5e0c,0x5e8f,0x5e87,0x5e8a,0x5ef7,0x5f04, -0x5f1f,0x5f64,0x5f62,0x5f77,0x5f79,0x5fd8,0x5fcc,0x5fd7, -0x5fcd,0x5ff1,0x5feb,0x5ff8,0x5fea,0x6212,0x6211,0x6284, -0x6297,0x6296,0x6280,0x6276,0x6289,0x626d,0x628a,0x627c, -0x627e,0x6279,0x6273,0x6292,0x626f,0x6298,0x626e,0x6295, -0x6293,0x6291,0x6286,0x6539,0x653b,0x6538,0x65f1,0x66f4, -0x675f,0x674e,0x674f,0x6750,0x6751,0x675c,0x6756,0x675e, -0x6749,0x6746,0x6760,0x6753,0x6757,0x6b65,0x6bcf,0x6c42, -0x6c5e,0x6c99,0x6c81,0x6c88,0x6c89,0x6c85,0x6c9b,0x6c6a, -0x6c7a,0x6c90,0x6c70,0x6c8c,0x6c68,0x6c96,0x6c92,0x6c7d, -0x6c83,0x6c72,0x6c7e,0x6c74,0x6c86,0x6c76,0x6c8d,0x6c94, -0x6c98,0x6c82,0x7076,0x707c,0x707d,0x7078,0x7262,0x7261, -0x7260,0x72c4,0x72c2,0x7396,0x752c,0x752b,0x7537,0x7538, -0x7682,0x76ef,0x77e3,0x79c1,0x79c0,0x79bf,0x7a76,0x7cfb, -0x7f55,0x8096,0x8093,0x809d,0x8098,0x809b,0x809a,0x80b2, -0x826f,0x8292,0x828b,0x828d,0x898b,0x89d2,0x8a00,0x8c37, -0x8c46,0x8c55,0x8c9d,0x8d64,0x8d70,0x8db3,0x8eab,0x8eca, -0x8f9b,0x8fb0,0x8fc2,0x8fc6,0x8fc5,0x8fc4,0x5de1,0x9091, -0x90a2,0x90aa,0x90a6,0x90a3,0x9149,0x91c6,0x91cc,0x9632, -0x962e,0x9631,0x962a,0x962c,0x4e26,0x4e56,0x4e73,0x4e8b, -0x4e9b,0x4e9e,0x4eab,0x4eac,0x4f6f,0x4f9d,0x4f8d,0x4f73, -0x4f7f,0x4f6c,0x4f9b,0x4f8b,0x4f86,0x4f83,0x4f70,0x4f75, -0x4f88,0x4f69,0x4f7b,0x4f96,0x4f7e,0x4f8f,0x4f91,0x4f7a, -0x5154,0x5152,0x5155,0x5169,0x5177,0x5176,0x5178,0x51bd, -0x51fd,0x523b,0x5238,0x5237,0x523a,0x5230,0x522e,0x5236, -0x5241,0x52be,0x52bb,0x5352,0x5354,0x5353,0x5351,0x5366, -0x5377,0x5378,0x5379,0x53d6,0x53d4,0x53d7,0x5473,0x5475, -0x5496,0x5478,0x5495,0x5480,0x547b,0x5477,0x5484,0x5492, -0x5486,0x547c,0x5490,0x5471,0x5476,0x548c,0x549a,0x5462, -0x5468,0x548b,0x547d,0x548e,0x56fa,0x5783,0x5777,0x576a, -0x5769,0x5761,0x5766,0x5764,0x577c,0x591c,0x5949,0x5947, -0x5948,0x5944,0x5954,0x59be,0x59bb,0x59d4,0x59b9,0x59ae, -0x59d1,0x59c6,0x59d0,0x59cd,0x59cb,0x59d3,0x59ca,0x59af, -0x59b3,0x59d2,0x59c5,0x5b5f,0x5b64,0x5b63,0x5b97,0x5b9a, -0x5b98,0x5b9c,0x5b99,0x5b9b,0x5c1a,0x5c48,0x5c45,0x5c46, -0x5cb7,0x5ca1,0x5cb8,0x5ca9,0x5cab,0x5cb1,0x5cb3,0x5e18, -0x5e1a,0x5e16,0x5e15,0x5e1b,0x5e11,0x5e78,0x5e9a,0x5e97, -0x5e9c,0x5e95,0x5e96,0x5ef6,0x5f26,0x5f27,0x5f29,0x5f80, -0x5f81,0x5f7f,0x5f7c,0x5fdd,0x5fe0,0x5ffd,0x5ff5,0x5fff, -0x600f,0x6014,0x602f,0x6035,0x6016,0x602a,0x6015,0x6021, -0x6027,0x6029,0x602b,0x601b,0x6216,0x6215,0x623f,0x623e, -0x6240,0x627f,0x62c9,0x62cc,0x62c4,0x62bf,0x62c2,0x62b9, -0x62d2,0x62db,0x62ab,0x62d3,0x62d4,0x62cb,0x62c8,0x62a8, -0x62bd,0x62bc,0x62d0,0x62d9,0x62c7,0x62cd,0x62b5,0x62da, -0x62b1,0x62d8,0x62d6,0x62d7,0x62c6,0x62ac,0x62ce,0x653e, -0x65a7,0x65bc,0x65fa,0x6614,0x6613,0x660c,0x6606,0x6602, -0x660e,0x6600,0x660f,0x6615,0x660a,0x6607,0x670d,0x670b, -0x676d,0x678b,0x6795,0x6771,0x679c,0x6773,0x6777,0x6787, -0x679d,0x6797,0x676f,0x6770,0x677f,0x6789,0x677e,0x6790, -0x6775,0x679a,0x6793,0x677c,0x676a,0x6772,0x6b23,0x6b66, -0x6b67,0x6b7f,0x6c13,0x6c1b,0x6ce3,0x6ce8,0x6cf3,0x6cb1, -0x6ccc,0x6ce5,0x6cb3,0x6cbd,0x6cbe,0x6cbc,0x6ce2,0x6cab, -0x6cd5,0x6cd3,0x6cb8,0x6cc4,0x6cb9,0x6cc1,0x6cae,0x6cd7, -0x6cc5,0x6cf1,0x6cbf,0x6cbb,0x6ce1,0x6cdb,0x6cca,0x6cac, -0x6cef,0x6cdc,0x6cd6,0x6ce0,0x7095,0x708e,0x7092,0x708a, -0x7099,0x722c,0x722d,0x7238,0x7248,0x7267,0x7269,0x72c0, -0x72ce,0x72d9,0x72d7,0x72d0,0x73a9,0x73a8,0x739f,0x73ab, -0x73a5,0x753d,0x759d,0x7599,0x759a,0x7684,0x76c2,0x76f2, -0x76f4,0x77e5,0x77fd,0x793e,0x7940,0x7941,0x79c9,0x79c8, -0x7a7a,0x7a79,0x7afa,0x7cfe,0x7f54,0x7f8c,0x7f8b,0x8005, -0x80ba,0x80a5,0x80a2,0x80b1,0x80a1,0x80ab,0x80a9,0x80b4, -0x80aa,0x80af,0x81e5,0x81fe,0x820d,0x82b3,0x829d,0x8299, -0x82ad,0x82bd,0x829f,0x82b9,0x82b1,0x82ac,0x82a5,0x82af, -0x82b8,0x82a3,0x82b0,0x82be,0x82b7,0x864e,0x8671,0x521d, -0x8868,0x8ecb,0x8fce,0x8fd4,0x8fd1,0x90b5,0x90b8,0x90b1, -0x90b6,0x91c7,0x91d1,0x9577,0x9580,0x961c,0x9640,0x963f, -0x963b,0x9644,0x9642,0x96b9,0x96e8,0x9752,0x975e,0x4e9f, -0x4ead,0x4eae,0x4fe1,0x4fb5,0x4faf,0x4fbf,0x4fe0,0x4fd1, -0x4fcf,0x4fdd,0x4fc3,0x4fb6,0x4fd8,0x4fdf,0x4fca,0x4fd7, -0x4fae,0x4fd0,0x4fc4,0x4fc2,0x4fda,0x4fce,0x4fde,0x4fb7, -0x5157,0x5192,0x5191,0x51a0,0x524e,0x5243,0x524a,0x524d, -0x524c,0x524b,0x5247,0x52c7,0x52c9,0x52c3,0x52c1,0x530d, -0x5357,0x537b,0x539a,0x53db,0x54ac,0x54c0,0x54a8,0x54ce, -0x54c9,0x54b8,0x54a6,0x54b3,0x54c7,0x54c2,0x54bd,0x54aa, -0x54c1,0x54c4,0x54c8,0x54af,0x54ab,0x54b1,0x54bb,0x54a9, -0x54a7,0x54bf,0x56ff,0x5782,0x578b,0x57a0,0x57a3,0x57a2, -0x57ce,0x57ae,0x5793,0x5955,0x5951,0x594f,0x594e,0x5950, -0x59dc,0x59d8,0x59ff,0x59e3,0x59e8,0x5a03,0x59e5,0x59ea, -0x59da,0x59e6,0x5a01,0x59fb,0x5b69,0x5ba3,0x5ba6,0x5ba4, -0x5ba2,0x5ba5,0x5c01,0x5c4e,0x5c4f,0x5c4d,0x5c4b,0x5cd9, -0x5cd2,0x5df7,0x5e1d,0x5e25,0x5e1f,0x5e7d,0x5ea0,0x5ea6, -0x5efa,0x5f08,0x5f2d,0x5f65,0x5f88,0x5f85,0x5f8a,0x5f8b, -0x5f87,0x5f8c,0x5f89,0x6012,0x601d,0x6020,0x6025,0x600e, -0x6028,0x604d,0x6070,0x6068,0x6062,0x6046,0x6043,0x606c, -0x606b,0x606a,0x6064,0x6241,0x62dc,0x6316,0x6309,0x62fc, -0x62ed,0x6301,0x62ee,0x62fd,0x6307,0x62f1,0x62f7,0x62ef, -0x62ec,0x62fe,0x62f4,0x6311,0x6302,0x653f,0x6545,0x65ab, -0x65bd,0x65e2,0x6625,0x662d,0x6620,0x6627,0x662f,0x661f, -0x6628,0x6631,0x6624,0x66f7,0x67ff,0x67d3,0x67f1,0x67d4, -0x67d0,0x67ec,0x67b6,0x67af,0x67f5,0x67e9,0x67ef,0x67c4, -0x67d1,0x67b4,0x67da,0x67e5,0x67b8,0x67cf,0x67de,0x67f3, -0x67b0,0x67d9,0x67e2,0x67dd,0x67d2,0x6b6a,0x6b83,0x6b86, -0x6bb5,0x6bd2,0x6bd7,0x6c1f,0x6cc9,0x6d0b,0x6d32,0x6d2a, -0x6d41,0x6d25,0x6d0c,0x6d31,0x6d1e,0x6d17,0x6d3b,0x6d3d, -0x6d3e,0x6d36,0x6d1b,0x6cf5,0x6d39,0x6d27,0x6d38,0x6d29, -0x6d2e,0x6d35,0x6d0e,0x6d2b,0x70ab,0x70ba,0x70b3,0x70ac, -0x70af,0x70ad,0x70b8,0x70ae,0x70a4,0x7230,0x7272,0x726f, -0x7274,0x72e9,0x72e0,0x72e1,0x73b7,0x73ca,0x73bb,0x73b2, -0x73cd,0x73c0,0x73b3,0x751a,0x752d,0x754f,0x754c,0x754e, -0x754b,0x75ab,0x75a4,0x75a5,0x75a2,0x75a3,0x7678,0x7686, -0x7687,0x7688,0x76c8,0x76c6,0x76c3,0x76c5,0x7701,0x76f9, -0x76f8,0x7709,0x770b,0x76fe,0x76fc,0x7707,0x77dc,0x7802, -0x7814,0x780c,0x780d,0x7946,0x7949,0x7948,0x7947,0x79b9, -0x79ba,0x79d1,0x79d2,0x79cb,0x7a7f,0x7a81,0x7aff,0x7afd, -0x7c7d,0x7d02,0x7d05,0x7d00,0x7d09,0x7d07,0x7d04,0x7d06, -0x7f38,0x7f8e,0x7fbf,0x8004,0x8010,0x800d,0x8011,0x8036, -0x80d6,0x80e5,0x80da,0x80c3,0x80c4,0x80cc,0x80e1,0x80db, -0x80ce,0x80de,0x80e4,0x80dd,0x81f4,0x8222,0x82e7,0x8303, -0x8305,0x82e3,0x82db,0x82e6,0x8304,0x82e5,0x8302,0x8309, -0x82d2,0x82d7,0x82f1,0x8301,0x82dc,0x82d4,0x82d1,0x82de, -0x82d3,0x82df,0x82ef,0x8306,0x8650,0x8679,0x867b,0x867a, -0x884d,0x886b,0x8981,0x89d4,0x8a08,0x8a02,0x8a03,0x8c9e, -0x8ca0,0x8d74,0x8d73,0x8db4,0x8ecd,0x8ecc,0x8ff0,0x8fe6, -0x8fe2,0x8fea,0x8fe5,0x8fed,0x8feb,0x8fe4,0x8fe8,0x90ca, -0x90ce,0x90c1,0x90c3,0x914b,0x914a,0x91cd,0x9582,0x9650, -0x964b,0x964c,0x964d,0x9762,0x9769,0x97cb,0x97ed,0x97f3, -0x9801,0x98a8,0x98db,0x98df,0x9996,0x9999,0x4e58,0x4eb3, -0x500c,0x500d,0x5023,0x4fef,0x5026,0x5025,0x4ff8,0x5029, -0x5016,0x5006,0x503c,0x501f,0x501a,0x5012,0x5011,0x4ffa, -0x5000,0x5014,0x5028,0x4ff1,0x5021,0x500b,0x5019,0x5018, -0x4ff3,0x4fee,0x502d,0x502a,0x4ffe,0x502b,0x5009,0x517c, -0x51a4,0x51a5,0x51a2,0x51cd,0x51cc,0x51c6,0x51cb,0x5256, -0x525c,0x5254,0x525b,0x525d,0x532a,0x537f,0x539f,0x539d, -0x53df,0x54e8,0x5510,0x5501,0x5537,0x54fc,0x54e5,0x54f2, -0x5506,0x54fa,0x5514,0x54e9,0x54ed,0x54e1,0x5509,0x54ee, -0x54ea,0x54e6,0x5527,0x5507,0x54fd,0x550f,0x5703,0x5704, -0x57c2,0x57d4,0x57cb,0x57c3,0x5809,0x590f,0x5957,0x5958, -0x595a,0x5a11,0x5a18,0x5a1c,0x5a1f,0x5a1b,0x5a13,0x59ec, -0x5a20,0x5a23,0x5a29,0x5a25,0x5a0c,0x5a09,0x5b6b,0x5c58, -0x5bb0,0x5bb3,0x5bb6,0x5bb4,0x5bae,0x5bb5,0x5bb9,0x5bb8, -0x5c04,0x5c51,0x5c55,0x5c50,0x5ced,0x5cfd,0x5cfb,0x5cea, -0x5ce8,0x5cf0,0x5cf6,0x5d01,0x5cf4,0x5dee,0x5e2d,0x5e2b, -0x5eab,0x5ead,0x5ea7,0x5f31,0x5f92,0x5f91,0x5f90,0x6059, -0x6063,0x6065,0x6050,0x6055,0x606d,0x6069,0x606f,0x6084, -0x609f,0x609a,0x608d,0x6094,0x608c,0x6085,0x6096,0x6247, -0x62f3,0x6308,0x62ff,0x634e,0x633e,0x632f,0x6355,0x6342, -0x6346,0x634f,0x6349,0x633a,0x6350,0x633d,0x632a,0x632b, -0x6328,0x634d,0x634c,0x6548,0x6549,0x6599,0x65c1,0x65c5, -0x6642,0x6649,0x664f,0x6643,0x6652,0x664c,0x6645,0x6641, -0x66f8,0x6714,0x6715,0x6717,0x6821,0x6838,0x6848,0x6846, -0x6853,0x6839,0x6842,0x6854,0x6829,0x68b3,0x6817,0x684c, -0x6851,0x683d,0x67f4,0x6850,0x6840,0x683c,0x6843,0x682a, -0x6845,0x6813,0x6818,0x6841,0x6b8a,0x6b89,0x6bb7,0x6c23, -0x6c27,0x6c28,0x6c26,0x6c24,0x6cf0,0x6d6a,0x6d95,0x6d88, -0x6d87,0x6d66,0x6d78,0x6d77,0x6d59,0x6d93,0x6d6c,0x6d89, -0x6d6e,0x6d5a,0x6d74,0x6d69,0x6d8c,0x6d8a,0x6d79,0x6d85, -0x6d65,0x6d94,0x70ca,0x70d8,0x70e4,0x70d9,0x70c8,0x70cf, -0x7239,0x7279,0x72fc,0x72f9,0x72fd,0x72f8,0x72f7,0x7386, -0x73ed,0x7409,0x73ee,0x73e0,0x73ea,0x73de,0x7554,0x755d, -0x755c,0x755a,0x7559,0x75be,0x75c5,0x75c7,0x75b2,0x75b3, -0x75bd,0x75bc,0x75b9,0x75c2,0x75b8,0x768b,0x76b0,0x76ca, -0x76cd,0x76ce,0x7729,0x771f,0x7720,0x7728,0x77e9,0x7830, -0x7827,0x7838,0x781d,0x7834,0x7837,0x7825,0x782d,0x7820, -0x781f,0x7832,0x7955,0x7950,0x7960,0x795f,0x7956,0x795e, -0x795d,0x7957,0x795a,0x79e4,0x79e3,0x79e7,0x79df,0x79e6, -0x79e9,0x79d8,0x7a84,0x7a88,0x7ad9,0x7b06,0x7b11,0x7c89, -0x7d21,0x7d17,0x7d0b,0x7d0a,0x7d20,0x7d22,0x7d14,0x7d10, -0x7d15,0x7d1a,0x7d1c,0x7d0d,0x7d19,0x7d1b,0x7f3a,0x7f5f, -0x7f94,0x7fc5,0x7fc1,0x8006,0x8018,0x8015,0x8019,0x8017, -0x803d,0x803f,0x80f1,0x8102,0x80f0,0x8105,0x80ed,0x80f4, -0x8106,0x80f8,0x80f3,0x8108,0x80fd,0x810a,0x80fc,0x80ef, -0x81ed,0x81ec,0x8200,0x8210,0x822a,0x822b,0x8228,0x822c, -0x82bb,0x832b,0x8352,0x8354,0x834a,0x8338,0x8350,0x8349, -0x8335,0x8334,0x834f,0x8332,0x8339,0x8336,0x8317,0x8340, -0x8331,0x8328,0x8343,0x8654,0x868a,0x86aa,0x8693,0x86a4, -0x86a9,0x868c,0x86a3,0x869c,0x8870,0x8877,0x8881,0x8882, -0x887d,0x8879,0x8a18,0x8a10,0x8a0e,0x8a0c,0x8a15,0x8a0a, -0x8a17,0x8a13,0x8a16,0x8a0f,0x8a11,0x8c48,0x8c7a,0x8c79, -0x8ca1,0x8ca2,0x8d77,0x8eac,0x8ed2,0x8ed4,0x8ecf,0x8fb1, -0x9001,0x9006,0x8ff7,0x9000,0x8ffa,0x8ff4,0x9003,0x8ffd, -0x9005,0x8ff8,0x9095,0x90e1,0x90dd,0x90e2,0x9152,0x914d, -0x914c,0x91d8,0x91dd,0x91d7,0x91dc,0x91d9,0x9583,0x9662, -0x9663,0x9661,0x965b,0x965d,0x9664,0x9658,0x965e,0x96bb, -0x98e2,0x99ac,0x9aa8,0x9ad8,0x9b25,0x9b32,0x9b3c,0x4e7e, -0x507a,0x507d,0x505c,0x5047,0x5043,0x504c,0x505a,0x5049, -0x5065,0x5076,0x504e,0x5055,0x5075,0x5074,0x5077,0x504f, -0x500f,0x506f,0x506d,0x515c,0x5195,0x51f0,0x526a,0x526f, -0x52d2,0x52d9,0x52d8,0x52d5,0x5310,0x530f,0x5319,0x533f, -0x5340,0x533e,0x53c3,0x66fc,0x5546,0x556a,0x5566,0x5544, -0x555e,0x5561,0x5543,0x554a,0x5531,0x5556,0x554f,0x5555, -0x552f,0x5564,0x5538,0x552e,0x555c,0x552c,0x5563,0x5533, -0x5541,0x5557,0x5708,0x570b,0x5709,0x57df,0x5805,0x580a, -0x5806,0x57e0,0x57e4,0x57fa,0x5802,0x5835,0x57f7,0x57f9, -0x5920,0x5962,0x5a36,0x5a41,0x5a49,0x5a66,0x5a6a,0x5a40, -0x5a3c,0x5a62,0x5a5a,0x5a46,0x5a4a,0x5b70,0x5bc7,0x5bc5, -0x5bc4,0x5bc2,0x5bbf,0x5bc6,0x5c09,0x5c08,0x5c07,0x5c60, -0x5c5c,0x5c5d,0x5d07,0x5d06,0x5d0e,0x5d1b,0x5d16,0x5d22, -0x5d11,0x5d29,0x5d14,0x5d19,0x5d24,0x5d27,0x5d17,0x5de2, -0x5e38,0x5e36,0x5e33,0x5e37,0x5eb7,0x5eb8,0x5eb6,0x5eb5, -0x5ebe,0x5f35,0x5f37,0x5f57,0x5f6c,0x5f69,0x5f6b,0x5f97, -0x5f99,0x5f9e,0x5f98,0x5fa1,0x5fa0,0x5f9c,0x607f,0x60a3, -0x6089,0x60a0,0x60a8,0x60cb,0x60b4,0x60e6,0x60bd,0x60c5, -0x60bb,0x60b5,0x60dc,0x60bc,0x60d8,0x60d5,0x60c6,0x60df, -0x60b8,0x60da,0x60c7,0x621a,0x621b,0x6248,0x63a0,0x63a7, -0x6372,0x6396,0x63a2,0x63a5,0x6377,0x6367,0x6398,0x63aa, -0x6371,0x63a9,0x6389,0x6383,0x639b,0x636b,0x63a8,0x6384, -0x6388,0x6399,0x63a1,0x63ac,0x6392,0x638f,0x6380,0x637b, -0x6369,0x6368,0x637a,0x655d,0x6556,0x6551,0x6559,0x6557, -0x555f,0x654f,0x6558,0x6555,0x6554,0x659c,0x659b,0x65ac, -0x65cf,0x65cb,0x65cc,0x65ce,0x665d,0x665a,0x6664,0x6668, -0x6666,0x665e,0x66f9,0x52d7,0x671b,0x6881,0x68af,0x68a2, -0x6893,0x68b5,0x687f,0x6876,0x68b1,0x68a7,0x6897,0x68b0, -0x6883,0x68c4,0x68ad,0x6886,0x6885,0x6894,0x689d,0x68a8, -0x689f,0x68a1,0x6882,0x6b32,0x6bba,0x6beb,0x6bec,0x6c2b, -0x6d8e,0x6dbc,0x6df3,0x6dd9,0x6db2,0x6de1,0x6dcc,0x6de4, -0x6dfb,0x6dfa,0x6e05,0x6dc7,0x6dcb,0x6daf,0x6dd1,0x6dae, -0x6dde,0x6df9,0x6db8,0x6df7,0x6df5,0x6dc5,0x6dd2,0x6e1a, -0x6db5,0x6dda,0x6deb,0x6dd8,0x6dea,0x6df1,0x6dee,0x6de8, -0x6dc6,0x6dc4,0x6daa,0x6dec,0x6dbf,0x6de6,0x70f9,0x7109, -0x710a,0x70fd,0x70ef,0x723d,0x727d,0x7281,0x731c,0x731b, -0x7316,0x7313,0x7319,0x7387,0x7405,0x740a,0x7403,0x7406, -0x73fe,0x740d,0x74e0,0x74f6,0x74f7,0x751c,0x7522,0x7565, -0x7566,0x7562,0x7570,0x758f,0x75d4,0x75d5,0x75b5,0x75ca, -0x75cd,0x768e,0x76d4,0x76d2,0x76db,0x7737,0x773e,0x773c, -0x7736,0x7738,0x773a,0x786b,0x7843,0x784e,0x7965,0x7968, -0x796d,0x79fb,0x7a92,0x7a95,0x7b20,0x7b28,0x7b1b,0x7b2c, -0x7b26,0x7b19,0x7b1e,0x7b2e,0x7c92,0x7c97,0x7c95,0x7d46, -0x7d43,0x7d71,0x7d2e,0x7d39,0x7d3c,0x7d40,0x7d30,0x7d33, -0x7d44,0x7d2f,0x7d42,0x7d32,0x7d31,0x7f3d,0x7f9e,0x7f9a, -0x7fcc,0x7fce,0x7fd2,0x801c,0x804a,0x8046,0x812f,0x8116, -0x8123,0x812b,0x8129,0x8130,0x8124,0x8202,0x8235,0x8237, -0x8236,0x8239,0x838e,0x839e,0x8398,0x8378,0x83a2,0x8396, -0x83bd,0x83ab,0x8392,0x838a,0x8393,0x8389,0x83a0,0x8377, -0x837b,0x837c,0x8386,0x83a7,0x8655,0x5f6a,0x86c7,0x86c0, -0x86b6,0x86c4,0x86b5,0x86c6,0x86cb,0x86b1,0x86af,0x86c9, -0x8853,0x889e,0x8888,0x88ab,0x8892,0x8896,0x888d,0x888b, -0x8993,0x898f,0x8a2a,0x8a1d,0x8a23,0x8a25,0x8a31,0x8a2d, -0x8a1f,0x8a1b,0x8a22,0x8c49,0x8c5a,0x8ca9,0x8cac,0x8cab, -0x8ca8,0x8caa,0x8ca7,0x8d67,0x8d66,0x8dbe,0x8dba,0x8edb, -0x8edf,0x9019,0x900d,0x901a,0x9017,0x9023,0x901f,0x901d, -0x9010,0x9015,0x901e,0x9020,0x900f,0x9022,0x9016,0x901b, -0x9014,0x90e8,0x90ed,0x90fd,0x9157,0x91ce,0x91f5,0x91e6, -0x91e3,0x91e7,0x91ed,0x91e9,0x9589,0x966a,0x9675,0x9673, -0x9678,0x9670,0x9674,0x9676,0x9677,0x966c,0x96c0,0x96ea, -0x96e9,0x7ae0,0x7adf,0x9802,0x9803,0x9b5a,0x9ce5,0x9e75, -0x9e7f,0x9ea5,0x9ebb,0x50a2,0x508d,0x5085,0x5099,0x5091, -0x5080,0x5096,0x5098,0x509a,0x6700,0x51f1,0x5272,0x5274, -0x5275,0x5269,0x52de,0x52dd,0x52db,0x535a,0x53a5,0x557b, -0x5580,0x55a7,0x557c,0x558a,0x559d,0x5598,0x5582,0x559c, -0x55aa,0x5594,0x5587,0x558b,0x5583,0x55b3,0x55ae,0x559f, -0x553e,0x55b2,0x559a,0x55bb,0x55ac,0x55b1,0x557e,0x5589, -0x55ab,0x5599,0x570d,0x582f,0x582a,0x5834,0x5824,0x5830, -0x5831,0x5821,0x581d,0x5820,0x58f9,0x58fa,0x5960,0x5a77, -0x5a9a,0x5a7f,0x5a92,0x5a9b,0x5aa7,0x5b73,0x5b71,0x5bd2, -0x5bcc,0x5bd3,0x5bd0,0x5c0a,0x5c0b,0x5c31,0x5d4c,0x5d50, -0x5d34,0x5d47,0x5dfd,0x5e45,0x5e3d,0x5e40,0x5e43,0x5e7e, -0x5eca,0x5ec1,0x5ec2,0x5ec4,0x5f3c,0x5f6d,0x5fa9,0x5faa, -0x5fa8,0x60d1,0x60e1,0x60b2,0x60b6,0x60e0,0x611c,0x6123, -0x60fa,0x6115,0x60f0,0x60fb,0x60f4,0x6168,0x60f1,0x610e, -0x60f6,0x6109,0x6100,0x6112,0x621f,0x6249,0x63a3,0x638c, -0x63cf,0x63c0,0x63e9,0x63c9,0x63c6,0x63cd,0x63d2,0x63e3, -0x63d0,0x63e1,0x63d6,0x63ed,0x63ee,0x6376,0x63f4,0x63ea, -0x63db,0x6452,0x63da,0x63f9,0x655e,0x6566,0x6562,0x6563, -0x6591,0x6590,0x65af,0x666e,0x6670,0x6674,0x6676,0x666f, -0x6691,0x667a,0x667e,0x6677,0x66fe,0x66ff,0x671f,0x671d, -0x68fa,0x68d5,0x68e0,0x68d8,0x68d7,0x6905,0x68df,0x68f5, -0x68ee,0x68e7,0x68f9,0x68d2,0x68f2,0x68e3,0x68cb,0x68cd, -0x690d,0x6912,0x690e,0x68c9,0x68da,0x696e,0x68fb,0x6b3e, -0x6b3a,0x6b3d,0x6b98,0x6b96,0x6bbc,0x6bef,0x6c2e,0x6c2f, -0x6c2c,0x6e2f,0x6e38,0x6e54,0x6e21,0x6e32,0x6e67,0x6e4a, -0x6e20,0x6e25,0x6e23,0x6e1b,0x6e5b,0x6e58,0x6e24,0x6e56, -0x6e6e,0x6e2d,0x6e26,0x6e6f,0x6e34,0x6e4d,0x6e3a,0x6e2c, -0x6e43,0x6e1d,0x6e3e,0x6ecb,0x6e89,0x6e19,0x6e4e,0x6e63, -0x6e44,0x6e72,0x6e69,0x6e5f,0x7119,0x711a,0x7126,0x7130, -0x7121,0x7136,0x716e,0x711c,0x724c,0x7284,0x7280,0x7336, -0x7325,0x7334,0x7329,0x743a,0x742a,0x7433,0x7422,0x7425, -0x7435,0x7436,0x7434,0x742f,0x741b,0x7426,0x7428,0x7525, -0x7526,0x756b,0x756a,0x75e2,0x75db,0x75e3,0x75d9,0x75d8, -0x75de,0x75e0,0x767b,0x767c,0x7696,0x7693,0x76b4,0x76dc, -0x774f,0x77ed,0x785d,0x786c,0x786f,0x7a0d,0x7a08,0x7a0b, -0x7a05,0x7a00,0x7a98,0x7a97,0x7a96,0x7ae5,0x7ae3,0x7b49, -0x7b56,0x7b46,0x7b50,0x7b52,0x7b54,0x7b4d,0x7b4b,0x7b4f, -0x7b51,0x7c9f,0x7ca5,0x7d5e,0x7d50,0x7d68,0x7d55,0x7d2b, -0x7d6e,0x7d72,0x7d61,0x7d66,0x7d62,0x7d70,0x7d73,0x5584, -0x7fd4,0x7fd5,0x800b,0x8052,0x8085,0x8155,0x8154,0x814b, -0x8151,0x814e,0x8139,0x8146,0x813e,0x814c,0x8153,0x8174, -0x8212,0x821c,0x83e9,0x8403,0x83f8,0x840d,0x83e0,0x83c5, -0x840b,0x83c1,0x83ef,0x83f1,0x83f4,0x8457,0x840a,0x83f0, -0x840c,0x83cc,0x83fd,0x83f2,0x83ca,0x8438,0x840e,0x8404, -0x83dc,0x8407,0x83d4,0x83df,0x865b,0x86df,0x86d9,0x86ed, -0x86d4,0x86db,0x86e4,0x86d0,0x86de,0x8857,0x88c1,0x88c2, -0x88b1,0x8983,0x8996,0x8a3b,0x8a60,0x8a55,0x8a5e,0x8a3c, -0x8a41,0x8a54,0x8a5b,0x8a50,0x8a46,0x8a34,0x8a3a,0x8a36, -0x8a56,0x8c61,0x8c82,0x8caf,0x8cbc,0x8cb3,0x8cbd,0x8cc1, -0x8cbb,0x8cc0,0x8cb4,0x8cb7,0x8cb6,0x8cbf,0x8cb8,0x8d8a, -0x8d85,0x8d81,0x8dce,0x8ddd,0x8dcb,0x8dda,0x8dd1,0x8dcc, -0x8ddb,0x8dc6,0x8efb,0x8ef8,0x8efc,0x8f9c,0x902e,0x9035, -0x9031,0x9038,0x9032,0x9036,0x9102,0x90f5,0x9109,0x90fe, -0x9163,0x9165,0x91cf,0x9214,0x9215,0x9223,0x9209,0x921e, -0x920d,0x9210,0x9207,0x9211,0x9594,0x958f,0x958b,0x9591, -0x9593,0x9592,0x958e,0x968a,0x968e,0x968b,0x967d,0x9685, -0x9686,0x968d,0x9672,0x9684,0x96c1,0x96c5,0x96c4,0x96c6, -0x96c7,0x96ef,0x96f2,0x97cc,0x9805,0x9806,0x9808,0x98e7, -0x98ea,0x98ef,0x98e9,0x98f2,0x98ed,0x99ae,0x99ad,0x9ec3, -0x9ecd,0x9ed1,0x4e82,0x50ad,0x50b5,0x50b2,0x50b3,0x50c5, -0x50be,0x50ac,0x50b7,0x50bb,0x50af,0x50c7,0x527f,0x5277, -0x527d,0x52df,0x52e6,0x52e4,0x52e2,0x52e3,0x532f,0x55df, -0x55e8,0x55d3,0x55e6,0x55ce,0x55dc,0x55c7,0x55d1,0x55e3, -0x55e4,0x55ef,0x55da,0x55e1,0x55c5,0x55c6,0x55e5,0x55c9, -0x5712,0x5713,0x585e,0x5851,0x5858,0x5857,0x585a,0x5854, -0x586b,0x584c,0x586d,0x584a,0x5862,0x5852,0x584b,0x5967, -0x5ac1,0x5ac9,0x5acc,0x5abe,0x5abd,0x5abc,0x5ab3,0x5ac2, -0x5ab2,0x5d69,0x5d6f,0x5e4c,0x5e79,0x5ec9,0x5ec8,0x5f12, -0x5f59,0x5fac,0x5fae,0x611a,0x610f,0x6148,0x611f,0x60f3, -0x611b,0x60f9,0x6101,0x6108,0x614e,0x614c,0x6144,0x614d, -0x613e,0x6134,0x6127,0x610d,0x6106,0x6137,0x6221,0x6222, -0x6413,0x643e,0x641e,0x642a,0x642d,0x643d,0x642c,0x640f, -0x641c,0x6414,0x640d,0x6436,0x6416,0x6417,0x6406,0x656c, -0x659f,0x65b0,0x6697,0x6689,0x6687,0x6688,0x6696,0x6684, -0x6698,0x668d,0x6703,0x6994,0x696d,0x695a,0x6977,0x6960, -0x6954,0x6975,0x6930,0x6982,0x694a,0x6968,0x696b,0x695e, -0x6953,0x6979,0x6986,0x695d,0x6963,0x695b,0x6b47,0x6b72, -0x6bc0,0x6bbf,0x6bd3,0x6bfd,0x6ea2,0x6eaf,0x6ed3,0x6eb6, -0x6ec2,0x6e90,0x6e9d,0x6ec7,0x6ec5,0x6ea5,0x6e98,0x6ebc, -0x6eba,0x6eab,0x6ed1,0x6e96,0x6e9c,0x6ec4,0x6ed4,0x6eaa, -0x6ea7,0x6eb4,0x714e,0x7159,0x7169,0x7164,0x7149,0x7167, -0x715c,0x716c,0x7166,0x714c,0x7165,0x715e,0x7146,0x7168, -0x7156,0x723a,0x7252,0x7337,0x7345,0x733f,0x733e,0x746f, -0x745a,0x7455,0x745f,0x745e,0x7441,0x743f,0x7459,0x745b, -0x745c,0x7576,0x7578,0x7600,0x75f0,0x7601,0x75f2,0x75f1, -0x75fa,0x75ff,0x75f4,0x75f3,0x76de,0x76df,0x775b,0x776b, -0x7766,0x775e,0x7763,0x7779,0x776a,0x776c,0x775c,0x7765, -0x7768,0x7762,0x77ee,0x788e,0x78b0,0x7897,0x7898,0x788c, -0x7889,0x787c,0x7891,0x7893,0x787f,0x797a,0x797f,0x7981, -0x842c,0x79bd,0x7a1c,0x7a1a,0x7a20,0x7a14,0x7a1f,0x7a1e, -0x7a9f,0x7aa0,0x7b77,0x7bc0,0x7b60,0x7b6e,0x7b67,0x7cb1, -0x7cb3,0x7cb5,0x7d93,0x7d79,0x7d91,0x7d81,0x7d8f,0x7d5b, -0x7f6e,0x7f69,0x7f6a,0x7f72,0x7fa9,0x7fa8,0x7fa4,0x8056, -0x8058,0x8086,0x8084,0x8171,0x8170,0x8178,0x8165,0x816e, -0x8173,0x816b,0x8179,0x817a,0x8166,0x8205,0x8247,0x8482, -0x8477,0x843d,0x8431,0x8475,0x8466,0x846b,0x8449,0x846c, -0x845b,0x843c,0x8435,0x8461,0x8463,0x8469,0x846d,0x8446, -0x865e,0x865c,0x865f,0x86f9,0x8713,0x8708,0x8707,0x8700, -0x86fe,0x86fb,0x8702,0x8703,0x8706,0x870a,0x8859,0x88df, -0x88d4,0x88d9,0x88dc,0x88d8,0x88dd,0x88e1,0x88ca,0x88d5, -0x88d2,0x899c,0x89e3,0x8a6b,0x8a72,0x8a73,0x8a66,0x8a69, -0x8a70,0x8a87,0x8a7c,0x8a63,0x8aa0,0x8a71,0x8a85,0x8a6d, -0x8a62,0x8a6e,0x8a6c,0x8a79,0x8a7b,0x8a3e,0x8a68,0x8c62, -0x8c8a,0x8c89,0x8cca,0x8cc7,0x8cc8,0x8cc4,0x8cb2,0x8cc3, -0x8cc2,0x8cc5,0x8de1,0x8ddf,0x8de8,0x8def,0x8df3,0x8dfa, -0x8dea,0x8de4,0x8de6,0x8eb2,0x8f03,0x8f09,0x8efe,0x8f0a, -0x8f9f,0x8fb2,0x904b,0x904a,0x9053,0x9042,0x9054,0x903c, -0x9055,0x9050,0x9047,0x904f,0x904e,0x904d,0x9051,0x903e, -0x9041,0x9112,0x9117,0x916c,0x916a,0x9169,0x91c9,0x9237, -0x9257,0x9238,0x923d,0x9240,0x923e,0x925b,0x924b,0x9264, -0x9251,0x9234,0x9249,0x924d,0x9245,0x9239,0x923f,0x925a, -0x9598,0x9698,0x9694,0x9695,0x96cd,0x96cb,0x96c9,0x96ca, -0x96f7,0x96fb,0x96f9,0x96f6,0x9756,0x9774,0x9776,0x9810, -0x9811,0x9813,0x980a,0x9812,0x980c,0x98fc,0x98f4,0x98fd, -0x98fe,0x99b3,0x99b1,0x99b4,0x9ae1,0x9ce9,0x9e82,0x9f0e, -0x9f13,0x9f20,0x50e7,0x50ee,0x50e5,0x50d6,0x50ed,0x50da, -0x50d5,0x50cf,0x50d1,0x50f1,0x50ce,0x50e9,0x5162,0x51f3, -0x5283,0x5282,0x5331,0x53ad,0x55fe,0x5600,0x561b,0x5617, -0x55fd,0x5614,0x5606,0x5609,0x560d,0x560e,0x55f7,0x5616, -0x561f,0x5608,0x5610,0x55f6,0x5718,0x5716,0x5875,0x587e, -0x5883,0x5893,0x588a,0x5879,0x5885,0x587d,0x58fd,0x5925, -0x5922,0x5924,0x596a,0x5969,0x5ae1,0x5ae6,0x5ae9,0x5ad7, -0x5ad6,0x5ad8,0x5ae3,0x5b75,0x5bde,0x5be7,0x5be1,0x5be5, -0x5be6,0x5be8,0x5be2,0x5be4,0x5bdf,0x5c0d,0x5c62,0x5d84, -0x5d87,0x5e5b,0x5e63,0x5e55,0x5e57,0x5e54,0x5ed3,0x5ed6, -0x5f0a,0x5f46,0x5f70,0x5fb9,0x6147,0x613f,0x614b,0x6177, -0x6162,0x6163,0x615f,0x615a,0x6158,0x6175,0x622a,0x6487, -0x6458,0x6454,0x64a4,0x6478,0x645f,0x647a,0x6451,0x6467, -0x6434,0x646d,0x647b,0x6572,0x65a1,0x65d7,0x65d6,0x66a2, -0x66a8,0x669d,0x699c,0x69a8,0x6995,0x69c1,0x69ae,0x69d3, -0x69cb,0x699b,0x69b7,0x69bb,0x69ab,0x69b4,0x69d0,0x69cd, -0x69ad,0x69cc,0x69a6,0x69c3,0x69a3,0x6b49,0x6b4c,0x6c33, -0x6f33,0x6f14,0x6efe,0x6f13,0x6ef4,0x6f29,0x6f3e,0x6f20, -0x6f2c,0x6f0f,0x6f02,0x6f22,0x6eff,0x6eef,0x6f06,0x6f31, -0x6f38,0x6f32,0x6f23,0x6f15,0x6f2b,0x6f2f,0x6f88,0x6f2a, -0x6eec,0x6f01,0x6ef2,0x6ecc,0x6ef7,0x7194,0x7199,0x717d, -0x718a,0x7184,0x7192,0x723e,0x7292,0x7296,0x7344,0x7350, -0x7464,0x7463,0x746a,0x7470,0x746d,0x7504,0x7591,0x7627, -0x760d,0x760b,0x7609,0x7613,0x76e1,0x76e3,0x7784,0x777d, -0x777f,0x7761,0x78c1,0x789f,0x78a7,0x78b3,0x78a9,0x78a3, -0x798e,0x798f,0x798d,0x7a2e,0x7a31,0x7aaa,0x7aa9,0x7aed, -0x7aef,0x7ba1,0x7b95,0x7b8b,0x7b75,0x7b97,0x7b9d,0x7b94, -0x7b8f,0x7bb8,0x7b87,0x7b84,0x7cb9,0x7cbd,0x7cbe,0x7dbb, -0x7db0,0x7d9c,0x7dbd,0x7dbe,0x7da0,0x7dca,0x7db4,0x7db2, -0x7db1,0x7dba,0x7da2,0x7dbf,0x7db5,0x7db8,0x7dad,0x7dd2, -0x7dc7,0x7dac,0x7f70,0x7fe0,0x7fe1,0x7fdf,0x805e,0x805a, -0x8087,0x8150,0x8180,0x818f,0x8188,0x818a,0x817f,0x8182, -0x81e7,0x81fa,0x8207,0x8214,0x821e,0x824b,0x84c9,0x84bf, -0x84c6,0x84c4,0x8499,0x849e,0x84b2,0x849c,0x84cb,0x84b8, -0x84c0,0x84d3,0x8490,0x84bc,0x84d1,0x84ca,0x873f,0x871c, -0x873b,0x8722,0x8725,0x8734,0x8718,0x8755,0x8737,0x8729, -0x88f3,0x8902,0x88f4,0x88f9,0x88f8,0x88fd,0x88e8,0x891a, -0x88ef,0x8aa6,0x8a8c,0x8a9e,0x8aa3,0x8a8d,0x8aa1,0x8a93, -0x8aa4,0x8aaa,0x8aa5,0x8aa8,0x8a98,0x8a91,0x8a9a,0x8aa7, -0x8c6a,0x8c8d,0x8c8c,0x8cd3,0x8cd1,0x8cd2,0x8d6b,0x8d99, -0x8d95,0x8dfc,0x8f14,0x8f12,0x8f15,0x8f13,0x8fa3,0x9060, -0x9058,0x905c,0x9063,0x9059,0x905e,0x9062,0x905d,0x905b, -0x9119,0x9118,0x911e,0x9175,0x9178,0x9177,0x9174,0x9278, -0x9280,0x9285,0x9298,0x9296,0x927b,0x9293,0x929c,0x92a8, -0x927c,0x9291,0x95a1,0x95a8,0x95a9,0x95a3,0x95a5,0x95a4, -0x9699,0x969c,0x969b,0x96cc,0x96d2,0x9700,0x977c,0x9785, -0x97f6,0x9817,0x9818,0x98af,0x98b1,0x9903,0x9905,0x990c, -0x9909,0x99c1,0x9aaf,0x9ab0,0x9ae6,0x9b41,0x9b42,0x9cf4, -0x9cf6,0x9cf3,0x9ebc,0x9f3b,0x9f4a,0x5104,0x5100,0x50fb, -0x50f5,0x50f9,0x5102,0x5108,0x5109,0x5105,0x51dc,0x5287, -0x5288,0x5289,0x528d,0x528a,0x52f0,0x53b2,0x562e,0x563b, -0x5639,0x5632,0x563f,0x5634,0x5629,0x5653,0x564e,0x5657, -0x5674,0x5636,0x562f,0x5630,0x5880,0x589f,0x589e,0x58b3, -0x589c,0x58ae,0x58a9,0x58a6,0x596d,0x5b09,0x5afb,0x5b0b, -0x5af5,0x5b0c,0x5b08,0x5bee,0x5bec,0x5be9,0x5beb,0x5c64, -0x5c65,0x5d9d,0x5d94,0x5e62,0x5e5f,0x5e61,0x5ee2,0x5eda, -0x5edf,0x5edd,0x5ee3,0x5ee0,0x5f48,0x5f71,0x5fb7,0x5fb5, -0x6176,0x6167,0x616e,0x615d,0x6155,0x6182,0x617c,0x6170, -0x616b,0x617e,0x61a7,0x6190,0x61ab,0x618e,0x61ac,0x619a, -0x61a4,0x6194,0x61ae,0x622e,0x6469,0x646f,0x6479,0x649e, -0x64b2,0x6488,0x6490,0x64b0,0x64a5,0x6493,0x6495,0x64a9, -0x6492,0x64ae,0x64ad,0x64ab,0x649a,0x64ac,0x6499,0x64a2, -0x64b3,0x6575,0x6577,0x6578,0x66ae,0x66ab,0x66b4,0x66b1, -0x6a23,0x6a1f,0x69e8,0x6a01,0x6a1e,0x6a19,0x69fd,0x6a21, -0x6a13,0x6a0a,0x69f3,0x6a02,0x6a05,0x69ed,0x6a11,0x6b50, -0x6b4e,0x6ba4,0x6bc5,0x6bc6,0x6f3f,0x6f7c,0x6f84,0x6f51, -0x6f66,0x6f54,0x6f86,0x6f6d,0x6f5b,0x6f78,0x6f6e,0x6f8e, -0x6f7a,0x6f70,0x6f64,0x6f97,0x6f58,0x6ed5,0x6f6f,0x6f60, -0x6f5f,0x719f,0x71ac,0x71b1,0x71a8,0x7256,0x729b,0x734e, -0x7357,0x7469,0x748b,0x7483,0x747e,0x7480,0x757f,0x7620, -0x7629,0x761f,0x7624,0x7626,0x7621,0x7622,0x769a,0x76ba, -0x76e4,0x778e,0x7787,0x778c,0x7791,0x778b,0x78cb,0x78c5, -0x78ba,0x78ca,0x78be,0x78d5,0x78bc,0x78d0,0x7a3f,0x7a3c, -0x7a40,0x7a3d,0x7a37,0x7a3b,0x7aaf,0x7aae,0x7bad,0x7bb1, -0x7bc4,0x7bb4,0x7bc6,0x7bc7,0x7bc1,0x7ba0,0x7bcc,0x7cca, -0x7de0,0x7df4,0x7def,0x7dfb,0x7dd8,0x7dec,0x7ddd,0x7de8, -0x7de3,0x7dda,0x7dde,0x7de9,0x7d9e,0x7dd9,0x7df2,0x7df9, -0x7f75,0x7f77,0x7faf,0x7fe9,0x8026,0x819b,0x819c,0x819d, -0x81a0,0x819a,0x8198,0x8517,0x853d,0x851a,0x84ee,0x852c, -0x852d,0x8513,0x8511,0x8523,0x8521,0x8514,0x84ec,0x8525, -0x84ff,0x8506,0x8782,0x8774,0x8776,0x8760,0x8766,0x8778, -0x8768,0x8759,0x8757,0x874c,0x8753,0x885b,0x885d,0x8910, -0x8907,0x8912,0x8913,0x8915,0x890a,0x8abc,0x8ad2,0x8ac7, -0x8ac4,0x8a95,0x8acb,0x8af8,0x8ab2,0x8ac9,0x8ac2,0x8abf, -0x8ab0,0x8ad6,0x8acd,0x8ab6,0x8ab9,0x8adb,0x8c4c,0x8c4e, -0x8c6c,0x8ce0,0x8cde,0x8ce6,0x8ce4,0x8cec,0x8ced,0x8ce2, -0x8ce3,0x8cdc,0x8cea,0x8ce1,0x8d6d,0x8d9f,0x8da3,0x8e2b, -0x8e10,0x8e1d,0x8e22,0x8e0f,0x8e29,0x8e1f,0x8e21,0x8e1e, -0x8eba,0x8f1d,0x8f1b,0x8f1f,0x8f29,0x8f26,0x8f2a,0x8f1c, -0x8f1e,0x8f25,0x9069,0x906e,0x9068,0x906d,0x9077,0x9130, -0x912d,0x9127,0x9131,0x9187,0x9189,0x918b,0x9183,0x92c5, -0x92bb,0x92b7,0x92ea,0x92ac,0x92e4,0x92c1,0x92b3,0x92bc, -0x92d2,0x92c7,0x92f0,0x92b2,0x95ad,0x95b1,0x9704,0x9706, -0x9707,0x9709,0x9760,0x978d,0x978b,0x978f,0x9821,0x982b, -0x981c,0x98b3,0x990a,0x9913,0x9912,0x9918,0x99dd,0x99d0, -0x99df,0x99db,0x99d1,0x99d5,0x99d2,0x99d9,0x9ab7,0x9aee, -0x9aef,0x9b27,0x9b45,0x9b44,0x9b77,0x9b6f,0x9d06,0x9d09, -0x9d03,0x9ea9,0x9ebe,0x9ece,0x58a8,0x9f52,0x5112,0x5118, -0x5114,0x5110,0x5115,0x5180,0x51aa,0x51dd,0x5291,0x5293, -0x52f3,0x5659,0x566b,0x5679,0x5669,0x5664,0x5678,0x566a, -0x5668,0x5665,0x5671,0x566f,0x566c,0x5662,0x5676,0x58c1, -0x58be,0x58c7,0x58c5,0x596e,0x5b1d,0x5b34,0x5b78,0x5bf0, -0x5c0e,0x5f4a,0x61b2,0x6191,0x61a9,0x618a,0x61cd,0x61b6, -0x61be,0x61ca,0x61c8,0x6230,0x64c5,0x64c1,0x64cb,0x64bb, -0x64bc,0x64da,0x64c4,0x64c7,0x64c2,0x64cd,0x64bf,0x64d2, -0x64d4,0x64be,0x6574,0x66c6,0x66c9,0x66b9,0x66c4,0x66c7, -0x66b8,0x6a3d,0x6a38,0x6a3a,0x6a59,0x6a6b,0x6a58,0x6a39, -0x6a44,0x6a62,0x6a61,0x6a4b,0x6a47,0x6a35,0x6a5f,0x6a48, -0x6b59,0x6b77,0x6c05,0x6fc2,0x6fb1,0x6fa1,0x6fc3,0x6fa4, -0x6fc1,0x6fa7,0x6fb3,0x6fc0,0x6fb9,0x6fb6,0x6fa6,0x6fa0, -0x6fb4,0x71be,0x71c9,0x71d0,0x71d2,0x71c8,0x71d5,0x71b9, -0x71ce,0x71d9,0x71dc,0x71c3,0x71c4,0x7368,0x749c,0x74a3, -0x7498,0x749f,0x749e,0x74e2,0x750c,0x750d,0x7634,0x7638, -0x763a,0x76e7,0x76e5,0x77a0,0x779e,0x779f,0x77a5,0x78e8, -0x78da,0x78ec,0x78e7,0x79a6,0x7a4d,0x7a4e,0x7a46,0x7a4c, -0x7a4b,0x7aba,0x7bd9,0x7c11,0x7bc9,0x7be4,0x7bdb,0x7be1, -0x7be9,0x7be6,0x7cd5,0x7cd6,0x7e0a,0x7e11,0x7e08,0x7e1b, -0x7e23,0x7e1e,0x7e1d,0x7e09,0x7e10,0x7f79,0x7fb2,0x7ff0, -0x7ff1,0x7fee,0x8028,0x81b3,0x81a9,0x81a8,0x81fb,0x8208, -0x8258,0x8259,0x854a,0x8559,0x8548,0x8568,0x8569,0x8543, -0x8549,0x856d,0x856a,0x855e,0x8783,0x879f,0x879e,0x87a2, -0x878d,0x8861,0x892a,0x8932,0x8925,0x892b,0x8921,0x89aa, -0x89a6,0x8ae6,0x8afa,0x8aeb,0x8af1,0x8b00,0x8adc,0x8ae7, -0x8aee,0x8afe,0x8b01,0x8b02,0x8af7,0x8aed,0x8af3,0x8af6, -0x8afc,0x8c6b,0x8c6d,0x8c93,0x8cf4,0x8e44,0x8e31,0x8e34, -0x8e42,0x8e39,0x8e35,0x8f3b,0x8f2f,0x8f38,0x8f33,0x8fa8, -0x8fa6,0x9075,0x9074,0x9078,0x9072,0x907c,0x907a,0x9134, -0x9192,0x9320,0x9336,0x92f8,0x9333,0x932f,0x9322,0x92fc, -0x932b,0x9304,0x931a,0x9310,0x9326,0x9321,0x9315,0x932e, -0x9319,0x95bb,0x96a7,0x96a8,0x96aa,0x96d5,0x970e,0x9711, -0x9716,0x970d,0x9713,0x970f,0x975b,0x975c,0x9766,0x9798, -0x9830,0x9838,0x983b,0x9837,0x982d,0x9839,0x9824,0x9910, -0x9928,0x991e,0x991b,0x9921,0x991a,0x99ed,0x99e2,0x99f1, -0x9ab8,0x9abc,0x9afb,0x9aed,0x9b28,0x9b91,0x9d15,0x9d23, -0x9d26,0x9d28,0x9d12,0x9d1b,0x9ed8,0x9ed4,0x9f8d,0x9f9c, -0x512a,0x511f,0x5121,0x5132,0x52f5,0x568e,0x5680,0x5690, -0x5685,0x5687,0x568f,0x58d5,0x58d3,0x58d1,0x58ce,0x5b30, -0x5b2a,0x5b24,0x5b7a,0x5c37,0x5c68,0x5dbc,0x5dba,0x5dbd, -0x5db8,0x5e6b,0x5f4c,0x5fbd,0x61c9,0x61c2,0x61c7,0x61e6, -0x61cb,0x6232,0x6234,0x64ce,0x64ca,0x64d8,0x64e0,0x64f0, -0x64e6,0x64ec,0x64f1,0x64e2,0x64ed,0x6582,0x6583,0x66d9, -0x66d6,0x6a80,0x6a94,0x6a84,0x6aa2,0x6a9c,0x6adb,0x6aa3, -0x6a7e,0x6a97,0x6a90,0x6aa0,0x6b5c,0x6bae,0x6bda,0x6c08, -0x6fd8,0x6ff1,0x6fdf,0x6fe0,0x6fdb,0x6fe4,0x6feb,0x6fef, -0x6f80,0x6fec,0x6fe1,0x6fe9,0x6fd5,0x6fee,0x6ff0,0x71e7, -0x71df,0x71ee,0x71e6,0x71e5,0x71ed,0x71ec,0x71f4,0x71e0, -0x7235,0x7246,0x7370,0x7372,0x74a9,0x74b0,0x74a6,0x74a8, -0x7646,0x7642,0x764c,0x76ea,0x77b3,0x77aa,0x77b0,0x77ac, -0x77a7,0x77ad,0x77ef,0x78f7,0x78fa,0x78f4,0x78ef,0x7901, -0x79a7,0x79aa,0x7a57,0x7abf,0x7c07,0x7c0d,0x7bfe,0x7bf7, -0x7c0c,0x7be0,0x7ce0,0x7cdc,0x7cde,0x7ce2,0x7cdf,0x7cd9, -0x7cdd,0x7e2e,0x7e3e,0x7e46,0x7e37,0x7e32,0x7e43,0x7e2b, -0x7e3d,0x7e31,0x7e45,0x7e41,0x7e34,0x7e39,0x7e48,0x7e35, -0x7e3f,0x7e2f,0x7f44,0x7ff3,0x7ffc,0x8071,0x8072,0x8070, -0x806f,0x8073,0x81c6,0x81c3,0x81ba,0x81c2,0x81c0,0x81bf, -0x81bd,0x81c9,0x81be,0x81e8,0x8209,0x8271,0x85aa,0x8584, -0x857e,0x859c,0x8591,0x8594,0x85af,0x859b,0x8587,0x85a8, -0x858a,0x8667,0x87c0,0x87d1,0x87b3,0x87d2,0x87c6,0x87ab, -0x87bb,0x87ba,0x87c8,0x87cb,0x893b,0x8936,0x8944,0x8938, -0x893d,0x89ac,0x8b0e,0x8b17,0x8b19,0x8b1b,0x8b0a,0x8b20, -0x8b1d,0x8b04,0x8b10,0x8c41,0x8c3f,0x8c73,0x8cfa,0x8cfd, -0x8cfc,0x8cf8,0x8cfb,0x8da8,0x8e49,0x8e4b,0x8e48,0x8e4a, -0x8f44,0x8f3e,0x8f42,0x8f45,0x8f3f,0x907f,0x907d,0x9084, -0x9081,0x9082,0x9080,0x9139,0x91a3,0x919e,0x919c,0x934d, -0x9382,0x9328,0x9375,0x934a,0x9365,0x934b,0x9318,0x937e, -0x936c,0x935b,0x9370,0x935a,0x9354,0x95ca,0x95cb,0x95cc, -0x95c8,0x95c6,0x96b1,0x96b8,0x96d6,0x971c,0x971e,0x97a0, -0x97d3,0x9846,0x98b6,0x9935,0x9a01,0x99ff,0x9bae,0x9bab, -0x9baa,0x9bad,0x9d3b,0x9d3f,0x9e8b,0x9ecf,0x9ede,0x9edc, -0x9edd,0x9edb,0x9f3e,0x9f4b,0x53e2,0x5695,0x56ae,0x58d9, -0x58d8,0x5b38,0x5f5d,0x61e3,0x6233,0x64f4,0x64f2,0x64fe, -0x6506,0x64fa,0x64fb,0x64f7,0x65b7,0x66dc,0x6726,0x6ab3, -0x6aac,0x6ac3,0x6abb,0x6ab8,0x6ac2,0x6aae,0x6aaf,0x6b5f, -0x6b78,0x6baf,0x7009,0x700b,0x6ffe,0x7006,0x6ffa,0x7011, -0x700f,0x71fb,0x71fc,0x71fe,0x71f8,0x7377,0x7375,0x74a7, -0x74bf,0x7515,0x7656,0x7658,0x7652,0x77bd,0x77bf,0x77bb, -0x77bc,0x790e,0x79ae,0x7a61,0x7a62,0x7a60,0x7ac4,0x7ac5, -0x7c2b,0x7c27,0x7c2a,0x7c1e,0x7c23,0x7c21,0x7ce7,0x7e54, -0x7e55,0x7e5e,0x7e5a,0x7e61,0x7e52,0x7e59,0x7f48,0x7ff9, -0x7ffb,0x8077,0x8076,0x81cd,0x81cf,0x820a,0x85cf,0x85a9, -0x85cd,0x85d0,0x85c9,0x85b0,0x85ba,0x85b9,0x85a6,0x87ef, -0x87ec,0x87f2,0x87e0,0x8986,0x89b2,0x89f4,0x8b28,0x8b39, -0x8b2c,0x8b2b,0x8c50,0x8d05,0x8e59,0x8e63,0x8e66,0x8e64, -0x8e5f,0x8e55,0x8ec0,0x8f49,0x8f4d,0x9087,0x9083,0x9088, -0x91ab,0x91ac,0x91d0,0x9394,0x938a,0x9396,0x93a2,0x93b3, -0x93ae,0x93ac,0x93b0,0x9398,0x939a,0x9397,0x95d4,0x95d6, -0x95d0,0x95d5,0x96e2,0x96dc,0x96d9,0x96db,0x96de,0x9724, -0x97a3,0x97a6,0x97ad,0x97f9,0x984d,0x984f,0x984c,0x984e, -0x9853,0x98ba,0x993e,0x993f,0x993d,0x992e,0x99a5,0x9a0e, -0x9ac1,0x9b03,0x9b06,0x9b4f,0x9b4e,0x9b4d,0x9bca,0x9bc9, -0x9bfd,0x9bc8,0x9bc0,0x9d51,0x9d5d,0x9d60,0x9ee0,0x9f15, -0x9f2c,0x5133,0x56a5,0x58de,0x58df,0x58e2,0x5bf5,0x9f90, -0x5eec,0x61f2,0x61f7,0x61f6,0x61f5,0x6500,0x650f,0x66e0, -0x66dd,0x6ae5,0x6add,0x6ada,0x6ad3,0x701b,0x701f,0x7028, -0x701a,0x701d,0x7015,0x7018,0x7206,0x720d,0x7258,0x72a2, -0x7378,0x737a,0x74bd,0x74ca,0x74e3,0x7587,0x7586,0x765f, -0x7661,0x77c7,0x7919,0x79b1,0x7a6b,0x7a69,0x7c3e,0x7c3f, -0x7c38,0x7c3d,0x7c37,0x7c40,0x7e6b,0x7e6d,0x7e79,0x7e69, -0x7e6a,0x7f85,0x7e73,0x7fb6,0x7fb9,0x7fb8,0x81d8,0x85e9, -0x85dd,0x85ea,0x85d5,0x85e4,0x85e5,0x85f7,0x87fb,0x8805, -0x880d,0x87f9,0x87fe,0x8960,0x895f,0x8956,0x895e,0x8b41, -0x8b5c,0x8b58,0x8b49,0x8b5a,0x8b4e,0x8b4f,0x8b46,0x8b59, -0x8d08,0x8d0a,0x8e7c,0x8e72,0x8e87,0x8e76,0x8e6c,0x8e7a, -0x8e74,0x8f54,0x8f4e,0x8fad,0x908a,0x908b,0x91b1,0x91ae, -0x93e1,0x93d1,0x93df,0x93c3,0x93c8,0x93dc,0x93dd,0x93d6, -0x93e2,0x93cd,0x93d8,0x93e4,0x93d7,0x93e8,0x95dc,0x96b4, -0x96e3,0x972a,0x9727,0x9761,0x97dc,0x97fb,0x985e,0x9858, -0x985b,0x98bc,0x9945,0x9949,0x9a16,0x9a19,0x9b0d,0x9be8, -0x9be7,0x9bd6,0x9bdb,0x9d89,0x9d61,0x9d72,0x9d6a,0x9d6c, -0x9e92,0x9e97,0x9e93,0x9eb4,0x52f8,0x56a8,0x56b7,0x56b6, -0x56b4,0x56bc,0x58e4,0x5b40,0x5b43,0x5b7d,0x5bf6,0x5dc9, -0x61f8,0x61fa,0x6518,0x6514,0x6519,0x66e6,0x6727,0x6aec, -0x703e,0x7030,0x7032,0x7210,0x737b,0x74cf,0x7662,0x7665, -0x7926,0x792a,0x792c,0x792b,0x7ac7,0x7af6,0x7c4c,0x7c43, -0x7c4d,0x7cef,0x7cf0,0x8fae,0x7e7d,0x7e7c,0x7e82,0x7f4c, -0x8000,0x81da,0x8266,0x85fb,0x85f9,0x8611,0x85fa,0x8606, -0x860b,0x8607,0x860a,0x8814,0x8815,0x8964,0x89ba,0x89f8, -0x8b70,0x8b6c,0x8b66,0x8b6f,0x8b5f,0x8b6b,0x8d0f,0x8d0d, -0x8e89,0x8e81,0x8e85,0x8e82,0x91b4,0x91cb,0x9418,0x9403, -0x93fd,0x95e1,0x9730,0x98c4,0x9952,0x9951,0x99a8,0x9a2b, -0x9a30,0x9a37,0x9a35,0x9c13,0x9c0d,0x9e79,0x9eb5,0x9ee8, -0x9f2f,0x9f5f,0x9f63,0x9f61,0x5137,0x5138,0x56c1,0x56c0, -0x56c2,0x5914,0x5c6c,0x5dcd,0x61fc,0x61fe,0x651d,0x651c, -0x6595,0x66e9,0x6afb,0x6b04,0x6afa,0x6bb2,0x704c,0x721b, -0x72a7,0x74d6,0x74d4,0x7669,0x77d3,0x7c50,0x7e8f,0x7e8c, -0x7fbc,0x8617,0x862d,0x861a,0x8823,0x8822,0x8821,0x881f, -0x896a,0x896c,0x89bd,0x8b74,0x8b77,0x8b7d,0x8d13,0x8e8a, -0x8e8d,0x8e8b,0x8f5f,0x8faf,0x91ba,0x942e,0x9433,0x9435, -0x943a,0x9438,0x9432,0x942b,0x95e2,0x9738,0x9739,0x9732, -0x97ff,0x9867,0x9865,0x9957,0x9a45,0x9a43,0x9a40,0x9a3e, -0x9acf,0x9b54,0x9b51,0x9c2d,0x9c25,0x9daf,0x9db4,0x9dc2, -0x9db8,0x9e9d,0x9eef,0x9f19,0x9f5c,0x9f66,0x9f67,0x513c, -0x513b,0x56c8,0x56ca,0x56c9,0x5b7f,0x5dd4,0x5dd2,0x5f4e, -0x61ff,0x6524,0x6b0a,0x6b61,0x7051,0x7058,0x7380,0x74e4, -0x758a,0x766e,0x766c,0x79b3,0x7c60,0x7c5f,0x807e,0x807d, -0x81df,0x8972,0x896f,0x89fc,0x8b80,0x8d16,0x8d17,0x8e91, -0x8e93,0x8f61,0x9148,0x9444,0x9451,0x9452,0x973d,0x973e, -0x97c3,0x97c1,0x986b,0x9955,0x9a55,0x9a4d,0x9ad2,0x9b1a, -0x9c49,0x9c31,0x9c3e,0x9c3b,0x9dd3,0x9dd7,0x9f34,0x9f6c, -0x9f6a,0x9f94,0x56cc,0x5dd6,0x6200,0x6523,0x652b,0x652a, -0x66ec,0x6b10,0x74da,0x7aca,0x7c64,0x7c63,0x7c65,0x7e93, -0x7e96,0x7e94,0x81e2,0x8638,0x863f,0x8831,0x8b8a,0x9090, -0x908f,0x9463,0x9460,0x9464,0x9768,0x986f,0x995c,0x9a5a, -0x9a5b,0x9a57,0x9ad3,0x9ad4,0x9ad1,0x9c54,0x9c57,0x9c56, -0x9de5,0x9e9f,0x9ef4,0x56d1,0x58e9,0x652c,0x705e,0x7671, -0x7672,0x77d7,0x7f50,0x7f88,0x8836,0x8839,0x8862,0x8b93, -0x8b92,0x8b96,0x8277,0x8d1b,0x91c0,0x946a,0x9742,0x9748, -0x9744,0x97c6,0x9870,0x9a5f,0x9b22,0x9b58,0x9c5f,0x9df9, -0x9dfa,0x9e7c,0x9e7d,0x9f07,0x9f77,0x9f72,0x5ef3,0x6b16, -0x7063,0x7c6c,0x7c6e,0x883b,0x89c0,0x8ea1,0x91c1,0x9472, -0x9470,0x9871,0x995e,0x9ad6,0x9b23,0x9ecc,0x7064,0x77da, -0x8b9a,0x9477,0x97c9,0x9a62,0x9a65,0x7e9c,0x8b9c,0x8eaa, -0x91c5,0x947d,0x947e,0x947c,0x9c77,0x9c78,0x9ef7,0x8c54, -0x947f,0x9e1a,0x7228,0x9a6a,0x9b31,0x9e1b,0x9e1e,0x7c72, -0xf6b1,0xf6b2,0xf6b3,0xf6b4,0xf6b5,0xf6b6,0xf6b7,0xf6b8, -0xf6b9,0xf6ba,0xf6bb,0xf6bc,0xf6bd,0xf6be,0xf6bf,0xf6c0, -0xf6c1,0xf6c2,0xf6c3,0xf6c4,0xf6c5,0xf6c6,0xf6c7,0xf6c8, -0xf6c9,0xf6ca,0xf6cb,0xf6cc,0xf6cd,0xf6ce,0xf6cf,0xf6d0, -0xf6d1,0xf6d2,0xf6d3,0xf6d4,0xf6d5,0xf6d6,0xf6d7,0xf6d8, -0xf6d9,0xf6da,0xf6db,0xf6dc,0xf6dd,0xf6de,0xf6df,0xf6e0, -0xf6e1,0xf6e2,0xf6e3,0xf6e4,0xf6e5,0xf6e6,0xf6e7,0xf6e8, -0xf6e9,0xf6ea,0xf6eb,0xf6ec,0xf6ed,0xf6ee,0xf6ef,0xf6f0, -0xf6f1,0xf6f2,0xf6f3,0xf6f4,0xf6f5,0xf6f6,0xf6f7,0xf6f8, -0xf6f9,0xf6fa,0xf6fb,0xf6fc,0xf6fd,0xf6fe,0xf6ff,0xf700, -0xf701,0xf702,0xf703,0xf704,0xf705,0xf706,0xf707,0xf708, -0xf709,0xf70a,0xf70b,0xf70c,0xf70d,0xf70e,0xf70f,0xf710, -0xf711,0xf712,0xf713,0xf714,0xf715,0xf716,0xf717,0xf718, -0xf719,0xf71a,0xf71b,0xf71c,0xf71d,0xf71e,0xf71f,0xf720, -0xf721,0xf722,0xf723,0xf724,0xf725,0xf726,0xf727,0xf728, -0xf729,0xf72a,0xf72b,0xf72c,0xf72d,0xf72e,0xf72f,0xf730, -0xf731,0xf732,0xf733,0xf734,0xf735,0xf736,0xf737,0xf738, -0xf739,0xf73a,0xf73b,0xf73c,0xf73d,0xf73e,0xf73f,0xf740, -0xf741,0xf742,0xf743,0xf744,0xf745,0xf746,0xf747,0xf748, -0xf749,0xf74a,0xf74b,0xf74c,0xf74d,0xf74e,0xf74f,0xf750, -0xf751,0xf752,0xf753,0xf754,0xf755,0xf756,0xf757,0xf758, -0xf759,0xf75a,0xf75b,0xf75c,0xf75d,0xf75e,0xf75f,0xf760, -0xf761,0xf762,0xf763,0xf764,0xf765,0xf766,0xf767,0xf768, -0xf769,0xf76a,0xf76b,0xf76c,0xf76d,0xf76e,0xf76f,0xf770, -0xf771,0xf772,0xf773,0xf774,0xf775,0xf776,0xf777,0xf778, -0xf779,0xf77a,0xf77b,0xf77c,0xf77d,0xf77e,0xf77f,0xf780, -0xf781,0xf782,0xf783,0xf784,0xf785,0xf786,0xf787,0xf788, -0xf789,0xf78a,0xf78b,0xf78c,0xf78d,0xf78e,0xf78f,0xf790, -0xf791,0xf792,0xf793,0xf794,0xf795,0xf796,0xf797,0xf798, -0xf799,0xf79a,0xf79b,0xf79c,0xf79d,0xf79e,0xf79f,0xf7a0, -0xf7a1,0xf7a2,0xf7a3,0xf7a4,0xf7a5,0xf7a6,0xf7a7,0xf7a8, -0xf7a9,0xf7aa,0xf7ab,0xf7ac,0xf7ad,0xf7ae,0xf7af,0xf7b0, -0xf7b1,0xf7b2,0xf7b3,0xf7b4,0xf7b5,0xf7b6,0xf7b7,0xf7b8, -0xf7b9,0xf7ba,0xf7bb,0xf7bc,0xf7bd,0xf7be,0xf7bf,0xf7c0, -0xf7c1,0xf7c2,0xf7c3,0xf7c4,0xf7c5,0xf7c6,0xf7c7,0xf7c8, -0xf7c9,0xf7ca,0xf7cb,0xf7cc,0xf7cd,0xf7ce,0xf7cf,0xf7d0, -0xf7d1,0xf7d2,0xf7d3,0xf7d4,0xf7d5,0xf7d6,0xf7d7,0xf7d8, -0xf7d9,0xf7da,0xf7db,0xf7dc,0xf7dd,0xf7de,0xf7df,0xf7e0, -0xf7e1,0xf7e2,0xf7e3,0xf7e4,0xf7e5,0xf7e6,0xf7e7,0xf7e8, -0xf7e9,0xf7ea,0xf7eb,0xf7ec,0xf7ed,0xf7ee,0xf7ef,0xf7f0, -0xf7f1,0xf7f2,0xf7f3,0xf7f4,0xf7f5,0xf7f6,0xf7f7,0xf7f8, -0xf7f9,0xf7fa,0xf7fb,0xf7fc,0xf7fd,0xf7fe,0xf7ff,0xf800, -0xf801,0xf802,0xf803,0xf804,0xf805,0xf806,0xf807,0xf808, -0xf809,0xf80a,0xf80b,0xf80c,0xf80d,0xf80e,0xf80f,0xf810, -0xf811,0xf812,0xf813,0xf814,0xf815,0xf816,0xf817,0xf818, -0xf819,0xf81a,0xf81b,0xf81c,0xf81d,0xf81e,0xf81f,0xf820, -0xf821,0xf822,0xf823,0xf824,0xf825,0xf826,0xf827,0xf828, -0xf829,0xf82a,0xf82b,0xf82c,0xf82d,0xf82e,0xf82f,0xf830, -0xf831,0xf832,0xf833,0xf834,0xf835,0xf836,0xf837,0xf838, -0xf839,0xf83a,0xf83b,0xf83c,0xf83d,0xf83e,0xf83f,0xf840, -0xf841,0xf842,0xf843,0xf844,0xf845,0xf846,0xf847,0xf848, -0x4e42,0x4e5c,0x51f5,0x531a,0x5382,0x4e07,0x4e0c,0x4e47, -0x4e8d,0x56d7,0xfa0c,0x5c6e,0x5f73,0x4e0f,0x5187,0x4e0e, -0x4e2e,0x4e93,0x4ec2,0x4ec9,0x4ec8,0x5198,0x52fc,0x536c, -0x53b9,0x5720,0x5903,0x592c,0x5c10,0x5dff,0x65e1,0x6bb3, -0x6bcc,0x6c14,0x723f,0x4e31,0x4e3c,0x4ee8,0x4edc,0x4ee9, -0x4ee1,0x4edd,0x4eda,0x520c,0x531c,0x534c,0x5722,0x5723, -0x5917,0x592f,0x5b81,0x5b84,0x5c12,0x5c3b,0x5c74,0x5c73, -0x5e04,0x5e80,0x5e82,0x5fc9,0x6209,0x6250,0x6c15,0x6c36, -0x6c43,0x6c3f,0x6c3b,0x72ae,0x72b0,0x738a,0x79b8,0x808a, -0x961e,0x4f0e,0x4f18,0x4f2c,0x4ef5,0x4f14,0x4ef1,0x4f00, -0x4ef7,0x4f08,0x4f1d,0x4f02,0x4f05,0x4f22,0x4f13,0x4f04, -0x4ef4,0x4f12,0x51b1,0x5213,0x5209,0x5210,0x52a6,0x5322, -0x531f,0x534d,0x538a,0x5407,0x56e1,0x56df,0x572e,0x572a, -0x5734,0x593c,0x5980,0x597c,0x5985,0x597b,0x597e,0x5977, -0x597f,0x5b56,0x5c15,0x5c25,0x5c7c,0x5c7a,0x5c7b,0x5c7e, -0x5ddf,0x5e75,0x5e84,0x5f02,0x5f1a,0x5f74,0x5fd5,0x5fd4, -0x5fcf,0x625c,0x625e,0x6264,0x6261,0x6266,0x6262,0x6259, -0x6260,0x625a,0x6265,0x65ef,0x65ee,0x673e,0x6739,0x6738, -0x673b,0x673a,0x673f,0x673c,0x6733,0x6c18,0x6c46,0x6c52, -0x6c5c,0x6c4f,0x6c4a,0x6c54,0x6c4b,0x6c4c,0x7071,0x725e, -0x72b4,0x72b5,0x738e,0x752a,0x767f,0x7a75,0x7f51,0x8278, -0x827c,0x8280,0x827d,0x827f,0x864d,0x897e,0x9099,0x9097, -0x9098,0x909b,0x9094,0x9622,0x9624,0x9620,0x9623,0x4f56, -0x4f3b,0x4f62,0x4f49,0x4f53,0x4f64,0x4f3e,0x4f67,0x4f52, -0x4f5f,0x4f41,0x4f58,0x4f2d,0x4f33,0x4f3f,0x4f61,0x518f, -0x51b9,0x521c,0x521e,0x5221,0x52ad,0x52ae,0x5309,0x5363, -0x5372,0x538e,0x538f,0x5430,0x5437,0x542a,0x5454,0x5445, -0x5419,0x541c,0x5425,0x5418,0x543d,0x544f,0x5441,0x5428, -0x5424,0x5447,0x56ee,0x56e7,0x56e5,0x5741,0x5745,0x574c, -0x5749,0x574b,0x5752,0x5906,0x5940,0x59a6,0x5998,0x59a0, -0x5997,0x598e,0x59a2,0x5990,0x598f,0x59a7,0x59a1,0x5b8e, -0x5b92,0x5c28,0x5c2a,0x5c8d,0x5c8f,0x5c88,0x5c8b,0x5c89, -0x5c92,0x5c8a,0x5c86,0x5c93,0x5c95,0x5de0,0x5e0a,0x5e0e, -0x5e8b,0x5e89,0x5e8c,0x5e88,0x5e8d,0x5f05,0x5f1d,0x5f78, -0x5f76,0x5fd2,0x5fd1,0x5fd0,0x5fed,0x5fe8,0x5fee,0x5ff3, -0x5fe1,0x5fe4,0x5fe3,0x5ffa,0x5fef,0x5ff7,0x5ffb,0x6000, -0x5ff4,0x623a,0x6283,0x628c,0x628e,0x628f,0x6294,0x6287, -0x6271,0x627b,0x627a,0x6270,0x6281,0x6288,0x6277,0x627d, -0x6272,0x6274,0x6537,0x65f0,0x65f4,0x65f3,0x65f2,0x65f5, -0x6745,0x6747,0x6759,0x6755,0x674c,0x6748,0x675d,0x674d, -0x675a,0x674b,0x6bd0,0x6c19,0x6c1a,0x6c78,0x6c67,0x6c6b, -0x6c84,0x6c8b,0x6c8f,0x6c71,0x6c6f,0x6c69,0x6c9a,0x6c6d, -0x6c87,0x6c95,0x6c9c,0x6c66,0x6c73,0x6c65,0x6c7b,0x6c8e, -0x7074,0x707a,0x7263,0x72bf,0x72bd,0x72c3,0x72c6,0x72c1, -0x72ba,0x72c5,0x7395,0x7397,0x7393,0x7394,0x7392,0x753a, -0x7539,0x7594,0x7595,0x7681,0x793d,0x8034,0x8095,0x8099, -0x8090,0x8092,0x809c,0x8290,0x828f,0x8285,0x828e,0x8291, -0x8293,0x828a,0x8283,0x8284,0x8c78,0x8fc9,0x8fbf,0x909f, -0x90a1,0x90a5,0x909e,0x90a7,0x90a0,0x9630,0x9628,0x962f, -0x962d,0x4e33,0x4f98,0x4f7c,0x4f85,0x4f7d,0x4f80,0x4f87, -0x4f76,0x4f74,0x4f89,0x4f84,0x4f77,0x4f4c,0x4f97,0x4f6a, -0x4f9a,0x4f79,0x4f81,0x4f78,0x4f90,0x4f9c,0x4f94,0x4f9e, -0x4f92,0x4f82,0x4f95,0x4f6b,0x4f6e,0x519e,0x51bc,0x51be, -0x5235,0x5232,0x5233,0x5246,0x5231,0x52bc,0x530a,0x530b, -0x533c,0x5392,0x5394,0x5487,0x547f,0x5481,0x5491,0x5482, -0x5488,0x546b,0x547a,0x547e,0x5465,0x546c,0x5474,0x5466, -0x548d,0x546f,0x5461,0x5460,0x5498,0x5463,0x5467,0x5464, -0x56f7,0x56f9,0x576f,0x5772,0x576d,0x576b,0x5771,0x5770, -0x5776,0x5780,0x5775,0x577b,0x5773,0x5774,0x5762,0x5768, -0x577d,0x590c,0x5945,0x59b5,0x59ba,0x59cf,0x59ce,0x59b2, -0x59cc,0x59c1,0x59b6,0x59bc,0x59c3,0x59d6,0x59b1,0x59bd, -0x59c0,0x59c8,0x59b4,0x59c7,0x5b62,0x5b65,0x5b93,0x5b95, -0x5c44,0x5c47,0x5cae,0x5ca4,0x5ca0,0x5cb5,0x5caf,0x5ca8, -0x5cac,0x5c9f,0x5ca3,0x5cad,0x5ca2,0x5caa,0x5ca7,0x5c9d, -0x5ca5,0x5cb6,0x5cb0,0x5ca6,0x5e17,0x5e14,0x5e19,0x5f28, -0x5f22,0x5f23,0x5f24,0x5f54,0x5f82,0x5f7e,0x5f7d,0x5fde, -0x5fe5,0x602d,0x6026,0x6019,0x6032,0x600b,0x6034,0x600a, -0x6017,0x6033,0x601a,0x601e,0x602c,0x6022,0x600d,0x6010, -0x602e,0x6013,0x6011,0x600c,0x6009,0x601c,0x6214,0x623d, -0x62ad,0x62b4,0x62d1,0x62be,0x62aa,0x62b6,0x62ca,0x62ae, -0x62b3,0x62af,0x62bb,0x62a9,0x62b0,0x62b8,0x653d,0x65a8, -0x65bb,0x6609,0x65fc,0x6604,0x6612,0x6608,0x65fb,0x6603, -0x660b,0x660d,0x6605,0x65fd,0x6611,0x6610,0x66f6,0x670a, -0x6785,0x676c,0x678e,0x6792,0x6776,0x677b,0x6798,0x6786, -0x6784,0x6774,0x678d,0x678c,0x677a,0x679f,0x6791,0x6799, -0x6783,0x677d,0x6781,0x6778,0x6779,0x6794,0x6b25,0x6b80, -0x6b7e,0x6bde,0x6c1d,0x6c93,0x6cec,0x6ceb,0x6cee,0x6cd9, -0x6cb6,0x6cd4,0x6cad,0x6ce7,0x6cb7,0x6cd0,0x6cc2,0x6cba, -0x6cc3,0x6cc6,0x6ced,0x6cf2,0x6cd2,0x6cdd,0x6cb4,0x6c8a, -0x6c9d,0x6c80,0x6cde,0x6cc0,0x6d30,0x6ccd,0x6cc7,0x6cb0, -0x6cf9,0x6ccf,0x6ce9,0x6cd1,0x7094,0x7098,0x7085,0x7093, -0x7086,0x7084,0x7091,0x7096,0x7082,0x709a,0x7083,0x726a, -0x72d6,0x72cb,0x72d8,0x72c9,0x72dc,0x72d2,0x72d4,0x72da, -0x72cc,0x72d1,0x73a4,0x73a1,0x73ad,0x73a6,0x73a2,0x73a0, -0x73ac,0x739d,0x74dd,0x74e8,0x753f,0x7540,0x753e,0x758c, -0x7598,0x76af,0x76f3,0x76f1,0x76f0,0x76f5,0x77f8,0x77fc, -0x77f9,0x77fb,0x77fa,0x77f7,0x7942,0x793f,0x79c5,0x7a78, -0x7a7b,0x7afb,0x7c75,0x7cfd,0x8035,0x808f,0x80ae,0x80a3, -0x80b8,0x80b5,0x80ad,0x8220,0x82a0,0x82c0,0x82ab,0x829a, -0x8298,0x829b,0x82b5,0x82a7,0x82ae,0x82bc,0x829e,0x82ba, -0x82b4,0x82a8,0x82a1,0x82a9,0x82c2,0x82a4,0x82c3,0x82b6, -0x82a2,0x8670,0x866f,0x866d,0x866e,0x8c56,0x8fd2,0x8fcb, -0x8fd3,0x8fcd,0x8fd6,0x8fd5,0x8fd7,0x90b2,0x90b4,0x90af, -0x90b3,0x90b0,0x9639,0x963d,0x963c,0x963a,0x9643,0x4fcd, -0x4fc5,0x4fd3,0x4fb2,0x4fc9,0x4fcb,0x4fc1,0x4fd4,0x4fdc, -0x4fd9,0x4fbb,0x4fb3,0x4fdb,0x4fc7,0x4fd6,0x4fba,0x4fc0, -0x4fb9,0x4fec,0x5244,0x5249,0x52c0,0x52c2,0x533d,0x537c, -0x5397,0x5396,0x5399,0x5398,0x54ba,0x54a1,0x54ad,0x54a5, -0x54cf,0x54c3,0x830d,0x54b7,0x54ae,0x54d6,0x54b6,0x54c5, -0x54c6,0x54a0,0x5470,0x54bc,0x54a2,0x54be,0x5472,0x54de, -0x54b0,0x57b5,0x579e,0x579f,0x57a4,0x578c,0x5797,0x579d, -0x579b,0x5794,0x5798,0x578f,0x5799,0x57a5,0x579a,0x5795, -0x58f4,0x590d,0x5953,0x59e1,0x59de,0x59ee,0x5a00,0x59f1, -0x59dd,0x59fa,0x59fd,0x59fc,0x59f6,0x59e4,0x59f2,0x59f7, -0x59db,0x59e9,0x59f3,0x59f5,0x59e0,0x59fe,0x59f4,0x59ed, -0x5ba8,0x5c4c,0x5cd0,0x5cd8,0x5ccc,0x5cd7,0x5ccb,0x5cdb, -0x5cde,0x5cda,0x5cc9,0x5cc7,0x5cca,0x5cd6,0x5cd3,0x5cd4, -0x5ccf,0x5cc8,0x5cc6,0x5cce,0x5cdf,0x5cf8,0x5df9,0x5e21, -0x5e22,0x5e23,0x5e20,0x5e24,0x5eb0,0x5ea4,0x5ea2,0x5e9b, -0x5ea3,0x5ea5,0x5f07,0x5f2e,0x5f56,0x5f86,0x6037,0x6039, -0x6054,0x6072,0x605e,0x6045,0x6053,0x6047,0x6049,0x605b, -0x604c,0x6040,0x6042,0x605f,0x6024,0x6044,0x6058,0x6066, -0x606e,0x6242,0x6243,0x62cf,0x630d,0x630b,0x62f5,0x630e, -0x6303,0x62eb,0x62f9,0x630f,0x630c,0x62f8,0x62f6,0x6300, -0x6313,0x6314,0x62fa,0x6315,0x62fb,0x62f0,0x6541,0x6543, -0x65aa,0x65bf,0x6636,0x6621,0x6632,0x6635,0x661c,0x6626, -0x6622,0x6633,0x662b,0x663a,0x661d,0x6634,0x6639,0x662e, -0x670f,0x6710,0x67c1,0x67f2,0x67c8,0x67ba,0x67dc,0x67bb, -0x67f8,0x67d8,0x67c0,0x67b7,0x67c5,0x67eb,0x67e4,0x67df, -0x67b5,0x67cd,0x67b3,0x67f7,0x67f6,0x67ee,0x67e3,0x67c2, -0x67b9,0x67ce,0x67e7,0x67f0,0x67b2,0x67fc,0x67c6,0x67ed, -0x67cc,0x67ae,0x67e6,0x67db,0x67fa,0x67c9,0x67ca,0x67c3, -0x67ea,0x67cb,0x6b28,0x6b82,0x6b84,0x6bb6,0x6bd6,0x6bd8, -0x6be0,0x6c20,0x6c21,0x6d28,0x6d34,0x6d2d,0x6d1f,0x6d3c, -0x6d3f,0x6d12,0x6d0a,0x6cda,0x6d33,0x6d04,0x6d19,0x6d3a, -0x6d1a,0x6d11,0x6d00,0x6d1d,0x6d42,0x6d01,0x6d18,0x6d37, -0x6d03,0x6d0f,0x6d40,0x6d07,0x6d20,0x6d2c,0x6d08,0x6d22, -0x6d09,0x6d10,0x70b7,0x709f,0x70be,0x70b1,0x70b0,0x70a1, -0x70b4,0x70b5,0x70a9,0x7241,0x7249,0x724a,0x726c,0x7270, -0x7273,0x726e,0x72ca,0x72e4,0x72e8,0x72eb,0x72df,0x72ea, -0x72e6,0x72e3,0x7385,0x73cc,0x73c2,0x73c8,0x73c5,0x73b9, -0x73b6,0x73b5,0x73b4,0x73eb,0x73bf,0x73c7,0x73be,0x73c3, -0x73c6,0x73b8,0x73cb,0x74ec,0x74ee,0x752e,0x7547,0x7548, -0x75a7,0x75aa,0x7679,0x76c4,0x7708,0x7703,0x7704,0x7705, -0x770a,0x76f7,0x76fb,0x76fa,0x77e7,0x77e8,0x7806,0x7811, -0x7812,0x7805,0x7810,0x780f,0x780e,0x7809,0x7803,0x7813, -0x794a,0x794c,0x794b,0x7945,0x7944,0x79d5,0x79cd,0x79cf, -0x79d6,0x79ce,0x7a80,0x7a7e,0x7ad1,0x7b00,0x7b01,0x7c7a, -0x7c78,0x7c79,0x7c7f,0x7c80,0x7c81,0x7d03,0x7d08,0x7d01, -0x7f58,0x7f91,0x7f8d,0x7fbe,0x8007,0x800e,0x800f,0x8014, -0x8037,0x80d8,0x80c7,0x80e0,0x80d1,0x80c8,0x80c2,0x80d0, -0x80c5,0x80e3,0x80d9,0x80dc,0x80ca,0x80d5,0x80c9,0x80cf, -0x80d7,0x80e6,0x80cd,0x81ff,0x8221,0x8294,0x82d9,0x82fe, -0x82f9,0x8307,0x82e8,0x8300,0x82d5,0x833a,0x82eb,0x82d6, -0x82f4,0x82ec,0x82e1,0x82f2,0x82f5,0x830c,0x82fb,0x82f6, -0x82f0,0x82ea,0x82e4,0x82e0,0x82fa,0x82f3,0x82ed,0x8677, -0x8674,0x867c,0x8673,0x8841,0x884e,0x8867,0x886a,0x8869, -0x89d3,0x8a04,0x8a07,0x8d72,0x8fe3,0x8fe1,0x8fee,0x8fe0, -0x90f1,0x90bd,0x90bf,0x90d5,0x90c5,0x90be,0x90c7,0x90cb, -0x90c8,0x91d4,0x91d3,0x9654,0x964f,0x9651,0x9653,0x964a, -0x964e,0x501e,0x5005,0x5007,0x5013,0x5022,0x5030,0x501b, -0x4ff5,0x4ff4,0x5033,0x5037,0x502c,0x4ff6,0x4ff7,0x5017, -0x501c,0x5020,0x5027,0x5035,0x502f,0x5031,0x500e,0x515a, -0x5194,0x5193,0x51ca,0x51c4,0x51c5,0x51c8,0x51ce,0x5261, -0x525a,0x5252,0x525e,0x525f,0x5255,0x5262,0x52cd,0x530e, -0x539e,0x5526,0x54e2,0x5517,0x5512,0x54e7,0x54f3,0x54e4, -0x551a,0x54ff,0x5504,0x5508,0x54eb,0x5511,0x5505,0x54f1, -0x550a,0x54fb,0x54f7,0x54f8,0x54e0,0x550e,0x5503,0x550b, -0x5701,0x5702,0x57cc,0x5832,0x57d5,0x57d2,0x57ba,0x57c6, -0x57bd,0x57bc,0x57b8,0x57b6,0x57bf,0x57c7,0x57d0,0x57b9, -0x57c1,0x590e,0x594a,0x5a19,0x5a16,0x5a2d,0x5a2e,0x5a15, -0x5a0f,0x5a17,0x5a0a,0x5a1e,0x5a33,0x5b6c,0x5ba7,0x5bad, -0x5bac,0x5c03,0x5c56,0x5c54,0x5cec,0x5cff,0x5cee,0x5cf1, -0x5cf7,0x5d00,0x5cf9,0x5e29,0x5e28,0x5ea8,0x5eae,0x5eaa, -0x5eac,0x5f33,0x5f30,0x5f67,0x605d,0x605a,0x6067,0x6041, -0x60a2,0x6088,0x6080,0x6092,0x6081,0x609d,0x6083,0x6095, -0x609b,0x6097,0x6087,0x609c,0x608e,0x6219,0x6246,0x62f2, -0x6310,0x6356,0x632c,0x6344,0x6345,0x6336,0x6343,0x63e4, -0x6339,0x634b,0x634a,0x633c,0x6329,0x6341,0x6334,0x6358, -0x6354,0x6359,0x632d,0x6347,0x6333,0x635a,0x6351,0x6338, -0x6357,0x6340,0x6348,0x654a,0x6546,0x65c6,0x65c3,0x65c4, -0x65c2,0x664a,0x665f,0x6647,0x6651,0x6712,0x6713,0x681f, -0x681a,0x6849,0x6832,0x6833,0x683b,0x684b,0x684f,0x6816, -0x6831,0x681c,0x6835,0x682b,0x682d,0x682f,0x684e,0x6844, -0x6834,0x681d,0x6812,0x6814,0x6826,0x6828,0x682e,0x684d, -0x683a,0x6825,0x6820,0x6b2c,0x6b2f,0x6b2d,0x6b31,0x6b34, -0x6b6d,0x8082,0x6b88,0x6be6,0x6be4,0x6be8,0x6be3,0x6be2, -0x6be7,0x6c25,0x6d7a,0x6d63,0x6d64,0x6d76,0x6d0d,0x6d61, -0x6d92,0x6d58,0x6d62,0x6d6d,0x6d6f,0x6d91,0x6d8d,0x6def, -0x6d7f,0x6d86,0x6d5e,0x6d67,0x6d60,0x6d97,0x6d70,0x6d7c, -0x6d5f,0x6d82,0x6d98,0x6d2f,0x6d68,0x6d8b,0x6d7e,0x6d80, -0x6d84,0x6d16,0x6d83,0x6d7b,0x6d7d,0x6d75,0x6d90,0x70dc, -0x70d3,0x70d1,0x70dd,0x70cb,0x7f39,0x70e2,0x70d7,0x70d2, -0x70de,0x70e0,0x70d4,0x70cd,0x70c5,0x70c6,0x70c7,0x70da, -0x70ce,0x70e1,0x7242,0x7278,0x7277,0x7276,0x7300,0x72fa, -0x72f4,0x72fe,0x72f6,0x72f3,0x72fb,0x7301,0x73d3,0x73d9, -0x73e5,0x73d6,0x73bc,0x73e7,0x73e3,0x73e9,0x73dc,0x73d2, -0x73db,0x73d4,0x73dd,0x73da,0x73d7,0x73d8,0x73e8,0x74de, -0x74df,0x74f4,0x74f5,0x7521,0x755b,0x755f,0x75b0,0x75c1, -0x75bb,0x75c4,0x75c0,0x75bf,0x75b6,0x75ba,0x768a,0x76c9, -0x771d,0x771b,0x7710,0x7713,0x7712,0x7723,0x7711,0x7715, -0x7719,0x771a,0x7722,0x7727,0x7823,0x782c,0x7822,0x7835, -0x782f,0x7828,0x782e,0x782b,0x7821,0x7829,0x7833,0x782a, -0x7831,0x7954,0x795b,0x794f,0x795c,0x7953,0x7952,0x7951, -0x79eb,0x79ec,0x79e0,0x79ee,0x79ed,0x79ea,0x79dc,0x79de, -0x79dd,0x7a86,0x7a89,0x7a85,0x7a8b,0x7a8c,0x7a8a,0x7a87, -0x7ad8,0x7b10,0x7b04,0x7b13,0x7b05,0x7b0f,0x7b08,0x7b0a, -0x7b0e,0x7b09,0x7b12,0x7c84,0x7c91,0x7c8a,0x7c8c,0x7c88, -0x7c8d,0x7c85,0x7d1e,0x7d1d,0x7d11,0x7d0e,0x7d18,0x7d16, -0x7d13,0x7d1f,0x7d12,0x7d0f,0x7d0c,0x7f5c,0x7f61,0x7f5e, -0x7f60,0x7f5d,0x7f5b,0x7f96,0x7f92,0x7fc3,0x7fc2,0x7fc0, -0x8016,0x803e,0x8039,0x80fa,0x80f2,0x80f9,0x80f5,0x8101, -0x80fb,0x8100,0x8201,0x822f,0x8225,0x8333,0x832d,0x8344, -0x8319,0x8351,0x8325,0x8356,0x833f,0x8341,0x8326,0x831c, -0x8322,0x8342,0x834e,0x831b,0x832a,0x8308,0x833c,0x834d, -0x8316,0x8324,0x8320,0x8337,0x832f,0x8329,0x8347,0x8345, -0x834c,0x8353,0x831e,0x832c,0x834b,0x8327,0x8348,0x8653, -0x8652,0x86a2,0x86a8,0x8696,0x868d,0x8691,0x869e,0x8687, -0x8697,0x8686,0x868b,0x869a,0x8685,0x86a5,0x8699,0x86a1, -0x86a7,0x8695,0x8698,0x868e,0x869d,0x8690,0x8694,0x8843, -0x8844,0x886d,0x8875,0x8876,0x8872,0x8880,0x8871,0x887f, -0x886f,0x8883,0x887e,0x8874,0x887c,0x8a12,0x8c47,0x8c57, -0x8c7b,0x8ca4,0x8ca3,0x8d76,0x8d78,0x8db5,0x8db7,0x8db6, -0x8ed1,0x8ed3,0x8ffe,0x8ff5,0x9002,0x8fff,0x8ffb,0x9004, -0x8ffc,0x8ff6,0x90d6,0x90e0,0x90d9,0x90da,0x90e3,0x90df, -0x90e5,0x90d8,0x90db,0x90d7,0x90dc,0x90e4,0x9150,0x914e, -0x914f,0x91d5,0x91e2,0x91da,0x965c,0x965f,0x96bc,0x98e3, -0x9adf,0x9b2f,0x4e7f,0x5070,0x506a,0x5061,0x505e,0x5060, -0x5053,0x504b,0x505d,0x5072,0x5048,0x504d,0x5041,0x505b, -0x504a,0x5062,0x5015,0x5045,0x505f,0x5069,0x506b,0x5063, -0x5064,0x5046,0x5040,0x506e,0x5073,0x5057,0x5051,0x51d0, -0x526b,0x526d,0x526c,0x526e,0x52d6,0x52d3,0x532d,0x539c, -0x5575,0x5576,0x553c,0x554d,0x5550,0x5534,0x552a,0x5551, -0x5562,0x5536,0x5535,0x5530,0x5552,0x5545,0x550c,0x5532, -0x5565,0x554e,0x5539,0x5548,0x552d,0x553b,0x5540,0x554b, -0x570a,0x5707,0x57fb,0x5814,0x57e2,0x57f6,0x57dc,0x57f4, -0x5800,0x57ed,0x57fd,0x5808,0x57f8,0x580b,0x57f3,0x57cf, -0x5807,0x57ee,0x57e3,0x57f2,0x57e5,0x57ec,0x57e1,0x580e, -0x57fc,0x5810,0x57e7,0x5801,0x580c,0x57f1,0x57e9,0x57f0, -0x580d,0x5804,0x595c,0x5a60,0x5a58,0x5a55,0x5a67,0x5a5e, -0x5a38,0x5a35,0x5a6d,0x5a50,0x5a5f,0x5a65,0x5a6c,0x5a53, -0x5a64,0x5a57,0x5a43,0x5a5d,0x5a52,0x5a44,0x5a5b,0x5a48, -0x5a8e,0x5a3e,0x5a4d,0x5a39,0x5a4c,0x5a70,0x5a69,0x5a47, -0x5a51,0x5a56,0x5a42,0x5a5c,0x5b72,0x5b6e,0x5bc1,0x5bc0, -0x5c59,0x5d1e,0x5d0b,0x5d1d,0x5d1a,0x5d20,0x5d0c,0x5d28, -0x5d0d,0x5d26,0x5d25,0x5d0f,0x5d30,0x5d12,0x5d23,0x5d1f, -0x5d2e,0x5e3e,0x5e34,0x5eb1,0x5eb4,0x5eb9,0x5eb2,0x5eb3, -0x5f36,0x5f38,0x5f9b,0x5f96,0x5f9f,0x608a,0x6090,0x6086, -0x60be,0x60b0,0x60ba,0x60d3,0x60d4,0x60cf,0x60e4,0x60d9, -0x60dd,0x60c8,0x60b1,0x60db,0x60b7,0x60ca,0x60bf,0x60c3, -0x60cd,0x60c0,0x6332,0x6365,0x638a,0x6382,0x637d,0x63bd, -0x639e,0x63ad,0x639d,0x6397,0x63ab,0x638e,0x636f,0x6387, -0x6390,0x636e,0x63af,0x6375,0x639c,0x636d,0x63ae,0x637c, -0x63a4,0x633b,0x639f,0x6378,0x6385,0x6381,0x6391,0x638d, -0x6370,0x6553,0x65cd,0x6665,0x6661,0x665b,0x6659,0x665c, -0x6662,0x6718,0x6879,0x6887,0x6890,0x689c,0x686d,0x686e, -0x68ae,0x68ab,0x6956,0x686f,0x68a3,0x68ac,0x68a9,0x6875, -0x6874,0x68b2,0x688f,0x6877,0x6892,0x687c,0x686b,0x6872, -0x68aa,0x6880,0x6871,0x687e,0x689b,0x6896,0x688b,0x68a0, -0x6889,0x68a4,0x6878,0x687b,0x6891,0x688c,0x688a,0x687d, -0x6b36,0x6b33,0x6b37,0x6b38,0x6b91,0x6b8f,0x6b8d,0x6b8e, -0x6b8c,0x6c2a,0x6dc0,0x6dab,0x6db4,0x6db3,0x6e74,0x6dac, -0x6de9,0x6de2,0x6db7,0x6df6,0x6dd4,0x6e00,0x6dc8,0x6de0, -0x6ddf,0x6dd6,0x6dbe,0x6de5,0x6ddc,0x6ddd,0x6ddb,0x6df4, -0x6dca,0x6dbd,0x6ded,0x6df0,0x6dba,0x6dd5,0x6dc2,0x6dcf, -0x6dc9,0x6dd0,0x6df2,0x6dd3,0x6dfd,0x6dd7,0x6dcd,0x6de3, -0x6dbb,0x70fa,0x710d,0x70f7,0x7117,0x70f4,0x710c,0x70f0, -0x7104,0x70f3,0x7110,0x70fc,0x70ff,0x7106,0x7113,0x7100, -0x70f8,0x70f6,0x710b,0x7102,0x710e,0x727e,0x727b,0x727c, -0x727f,0x731d,0x7317,0x7307,0x7311,0x7318,0x730a,0x7308, -0x72ff,0x730f,0x731e,0x7388,0x73f6,0x73f8,0x73f5,0x7404, -0x7401,0x73fd,0x7407,0x7400,0x73fa,0x73fc,0x73ff,0x740c, -0x740b,0x73f4,0x7408,0x7564,0x7563,0x75ce,0x75d2,0x75cf, -0x75cb,0x75cc,0x75d1,0x75d0,0x768f,0x7689,0x76d3,0x7739, -0x772f,0x772d,0x7731,0x7732,0x7734,0x7733,0x773d,0x7725, -0x773b,0x7735,0x7848,0x7852,0x7849,0x784d,0x784a,0x784c, -0x7826,0x7845,0x7850,0x7964,0x7967,0x7969,0x796a,0x7963, -0x796b,0x7961,0x79bb,0x79fa,0x79f8,0x79f6,0x79f7,0x7a8f, -0x7a94,0x7a90,0x7b35,0x7b47,0x7b34,0x7b25,0x7b30,0x7b22, -0x7b24,0x7b33,0x7b18,0x7b2a,0x7b1d,0x7b31,0x7b2b,0x7b2d, -0x7b2f,0x7b32,0x7b38,0x7b1a,0x7b23,0x7c94,0x7c98,0x7c96, -0x7ca3,0x7d35,0x7d3d,0x7d38,0x7d36,0x7d3a,0x7d45,0x7d2c, -0x7d29,0x7d41,0x7d47,0x7d3e,0x7d3f,0x7d4a,0x7d3b,0x7d28, -0x7f63,0x7f95,0x7f9c,0x7f9d,0x7f9b,0x7fca,0x7fcb,0x7fcd, -0x7fd0,0x7fd1,0x7fc7,0x7fcf,0x7fc9,0x801f,0x801e,0x801b, -0x8047,0x8043,0x8048,0x8118,0x8125,0x8119,0x811b,0x812d, -0x811f,0x812c,0x811e,0x8121,0x8115,0x8127,0x811d,0x8122, -0x8211,0x8238,0x8233,0x823a,0x8234,0x8232,0x8274,0x8390, -0x83a3,0x83a8,0x838d,0x837a,0x8373,0x83a4,0x8374,0x838f, -0x8381,0x8395,0x8399,0x8375,0x8394,0x83a9,0x837d,0x8383, -0x838c,0x839d,0x839b,0x83aa,0x838b,0x837e,0x83a5,0x83af, -0x8388,0x8397,0x83b0,0x837f,0x83a6,0x8387,0x83ae,0x8376, -0x839a,0x8659,0x8656,0x86bf,0x86b7,0x86c2,0x86c1,0x86c5, -0x86ba,0x86b0,0x86c8,0x86b9,0x86b3,0x86b8,0x86cc,0x86b4, -0x86bb,0x86bc,0x86c3,0x86bd,0x86be,0x8852,0x8889,0x8895, -0x88a8,0x88a2,0x88aa,0x889a,0x8891,0x88a1,0x889f,0x8898, -0x88a7,0x8899,0x889b,0x8897,0x88a4,0x88ac,0x888c,0x8893, -0x888e,0x8982,0x89d6,0x89d9,0x89d5,0x8a30,0x8a27,0x8a2c, -0x8a1e,0x8c39,0x8c3b,0x8c5c,0x8c5d,0x8c7d,0x8ca5,0x8d7d, -0x8d7b,0x8d79,0x8dbc,0x8dc2,0x8db9,0x8dbf,0x8dc1,0x8ed8, -0x8ede,0x8edd,0x8edc,0x8ed7,0x8ee0,0x8ee1,0x9024,0x900b, -0x9011,0x901c,0x900c,0x9021,0x90ef,0x90ea,0x90f0,0x90f4, -0x90f2,0x90f3,0x90d4,0x90eb,0x90ec,0x90e9,0x9156,0x9158, -0x915a,0x9153,0x9155,0x91ec,0x91f4,0x91f1,0x91f3,0x91f8, -0x91e4,0x91f9,0x91ea,0x91eb,0x91f7,0x91e8,0x91ee,0x957a, -0x9586,0x9588,0x967c,0x966d,0x966b,0x9671,0x966f,0x96bf, -0x976a,0x9804,0x98e5,0x9997,0x509b,0x5095,0x5094,0x509e, -0x508b,0x50a3,0x5083,0x508c,0x508e,0x509d,0x5068,0x509c, -0x5092,0x5082,0x5087,0x515f,0x51d4,0x5312,0x5311,0x53a4, -0x53a7,0x5591,0x55a8,0x55a5,0x55ad,0x5577,0x5645,0x55a2, -0x5593,0x5588,0x558f,0x55b5,0x5581,0x55a3,0x5592,0x55a4, -0x557d,0x558c,0x55a6,0x557f,0x5595,0x55a1,0x558e,0x570c, -0x5829,0x5837,0x5819,0x581e,0x5827,0x5823,0x5828,0x57f5, -0x5848,0x5825,0x581c,0x581b,0x5833,0x583f,0x5836,0x582e, -0x5839,0x5838,0x582d,0x582c,0x583b,0x5961,0x5aaf,0x5a94, -0x5a9f,0x5a7a,0x5aa2,0x5a9e,0x5a78,0x5aa6,0x5a7c,0x5aa5, -0x5aac,0x5a95,0x5aae,0x5a37,0x5a84,0x5a8a,0x5a97,0x5a83, -0x5a8b,0x5aa9,0x5a7b,0x5a7d,0x5a8c,0x5a9c,0x5a8f,0x5a93, -0x5a9d,0x5bea,0x5bcd,0x5bcb,0x5bd4,0x5bd1,0x5bca,0x5bce, -0x5c0c,0x5c30,0x5d37,0x5d43,0x5d6b,0x5d41,0x5d4b,0x5d3f, -0x5d35,0x5d51,0x5d4e,0x5d55,0x5d33,0x5d3a,0x5d52,0x5d3d, -0x5d31,0x5d59,0x5d42,0x5d39,0x5d49,0x5d38,0x5d3c,0x5d32, -0x5d36,0x5d40,0x5d45,0x5e44,0x5e41,0x5f58,0x5fa6,0x5fa5, -0x5fab,0x60c9,0x60b9,0x60cc,0x60e2,0x60ce,0x60c4,0x6114, -0x60f2,0x610a,0x6116,0x6105,0x60f5,0x6113,0x60f8,0x60fc, -0x60fe,0x60c1,0x6103,0x6118,0x611d,0x6110,0x60ff,0x6104, -0x610b,0x624a,0x6394,0x63b1,0x63b0,0x63ce,0x63e5,0x63e8, -0x63ef,0x63c3,0x649d,0x63f3,0x63ca,0x63e0,0x63f6,0x63d5, -0x63f2,0x63f5,0x6461,0x63df,0x63be,0x63dd,0x63dc,0x63c4, -0x63d8,0x63d3,0x63c2,0x63c7,0x63cc,0x63cb,0x63c8,0x63f0, -0x63d7,0x63d9,0x6532,0x6567,0x656a,0x6564,0x655c,0x6568, -0x6565,0x658c,0x659d,0x659e,0x65ae,0x65d0,0x65d2,0x667c, -0x666c,0x667b,0x6680,0x6671,0x6679,0x666a,0x6672,0x6701, -0x690c,0x68d3,0x6904,0x68dc,0x692a,0x68ec,0x68ea,0x68f1, -0x690f,0x68d6,0x68f7,0x68eb,0x68e4,0x68f6,0x6913,0x6910, -0x68f3,0x68e1,0x6907,0x68cc,0x6908,0x6970,0x68b4,0x6911, -0x68ef,0x68c6,0x6914,0x68f8,0x68d0,0x68fd,0x68fc,0x68e8, -0x690b,0x690a,0x6917,0x68ce,0x68c8,0x68dd,0x68de,0x68e6, -0x68f4,0x68d1,0x6906,0x68d4,0x68e9,0x6915,0x6925,0x68c7, -0x6b39,0x6b3b,0x6b3f,0x6b3c,0x6b94,0x6b97,0x6b99,0x6b95, -0x6bbd,0x6bf0,0x6bf2,0x6bf3,0x6c30,0x6dfc,0x6e46,0x6e47, -0x6e1f,0x6e49,0x6e88,0x6e3c,0x6e3d,0x6e45,0x6e62,0x6e2b, -0x6e3f,0x6e41,0x6e5d,0x6e73,0x6e1c,0x6e33,0x6e4b,0x6e40, -0x6e51,0x6e3b,0x6e03,0x6e2e,0x6e5e,0x6e68,0x6e5c,0x6e61, -0x6e31,0x6e28,0x6e60,0x6e71,0x6e6b,0x6e39,0x6e22,0x6e30, -0x6e53,0x6e65,0x6e27,0x6e78,0x6e64,0x6e77,0x6e55,0x6e79, -0x6e52,0x6e66,0x6e35,0x6e36,0x6e5a,0x7120,0x711e,0x712f, -0x70fb,0x712e,0x7131,0x7123,0x7125,0x7122,0x7132,0x711f, -0x7128,0x713a,0x711b,0x724b,0x725a,0x7288,0x7289,0x7286, -0x7285,0x728b,0x7312,0x730b,0x7330,0x7322,0x7331,0x7333, -0x7327,0x7332,0x732d,0x7326,0x7323,0x7335,0x730c,0x742e, -0x742c,0x7430,0x742b,0x7416,0x741a,0x7421,0x742d,0x7431, -0x7424,0x7423,0x741d,0x7429,0x7420,0x7432,0x74fb,0x752f, -0x756f,0x756c,0x75e7,0x75da,0x75e1,0x75e6,0x75dd,0x75df, -0x75e4,0x75d7,0x7695,0x7692,0x76da,0x7746,0x7747,0x7744, -0x774d,0x7745,0x774a,0x774e,0x774b,0x774c,0x77de,0x77ec, -0x7860,0x7864,0x7865,0x785c,0x786d,0x7871,0x786a,0x786e, -0x7870,0x7869,0x7868,0x785e,0x7862,0x7974,0x7973,0x7972, -0x7970,0x7a02,0x7a0a,0x7a03,0x7a0c,0x7a04,0x7a99,0x7ae6, -0x7ae4,0x7b4a,0x7b3b,0x7b44,0x7b48,0x7b4c,0x7b4e,0x7b40, -0x7b58,0x7b45,0x7ca2,0x7c9e,0x7ca8,0x7ca1,0x7d58,0x7d6f, -0x7d63,0x7d53,0x7d56,0x7d67,0x7d6a,0x7d4f,0x7d6d,0x7d5c, -0x7d6b,0x7d52,0x7d54,0x7d69,0x7d51,0x7d5f,0x7d4e,0x7f3e, -0x7f3f,0x7f65,0x7f66,0x7fa2,0x7fa0,0x7fa1,0x7fd7,0x8051, -0x804f,0x8050,0x80fe,0x80d4,0x8143,0x814a,0x8152,0x814f, -0x8147,0x813d,0x814d,0x813a,0x81e6,0x81ee,0x81f7,0x81f8, -0x81f9,0x8204,0x823c,0x823d,0x823f,0x8275,0x833b,0x83cf, -0x83f9,0x8423,0x83c0,0x83e8,0x8412,0x83e7,0x83e4,0x83fc, -0x83f6,0x8410,0x83c6,0x83c8,0x83eb,0x83e3,0x83bf,0x8401, -0x83dd,0x83e5,0x83d8,0x83ff,0x83e1,0x83cb,0x83ce,0x83d6, -0x83f5,0x83c9,0x8409,0x840f,0x83de,0x8411,0x8406,0x83c2, -0x83f3,0x83d5,0x83fa,0x83c7,0x83d1,0x83ea,0x8413,0x83c3, -0x83ec,0x83ee,0x83c4,0x83fb,0x83d7,0x83e2,0x841b,0x83db, -0x83fe,0x86d8,0x86e2,0x86e6,0x86d3,0x86e3,0x86da,0x86ea, -0x86dd,0x86eb,0x86dc,0x86ec,0x86e9,0x86d7,0x86e8,0x86d1, -0x8848,0x8856,0x8855,0x88ba,0x88d7,0x88b9,0x88b8,0x88c0, -0x88be,0x88b6,0x88bc,0x88b7,0x88bd,0x88b2,0x8901,0x88c9, -0x8995,0x8998,0x8997,0x89dd,0x89da,0x89db,0x8a4e,0x8a4d, -0x8a39,0x8a59,0x8a40,0x8a57,0x8a58,0x8a44,0x8a45,0x8a52, -0x8a48,0x8a51,0x8a4a,0x8a4c,0x8a4f,0x8c5f,0x8c81,0x8c80, -0x8cba,0x8cbe,0x8cb0,0x8cb9,0x8cb5,0x8d84,0x8d80,0x8d89, -0x8dd8,0x8dd3,0x8dcd,0x8dc7,0x8dd6,0x8ddc,0x8dcf,0x8dd5, -0x8dd9,0x8dc8,0x8dd7,0x8dc5,0x8eef,0x8ef7,0x8efa,0x8ef9, -0x8ee6,0x8eee,0x8ee5,0x8ef5,0x8ee7,0x8ee8,0x8ef6,0x8eeb, -0x8ef1,0x8eec,0x8ef4,0x8ee9,0x902d,0x9034,0x902f,0x9106, -0x912c,0x9104,0x90ff,0x90fc,0x9108,0x90f9,0x90fb,0x9101, -0x9100,0x9107,0x9105,0x9103,0x9161,0x9164,0x915f,0x9162, -0x9160,0x9201,0x920a,0x9225,0x9203,0x921a,0x9226,0x920f, -0x920c,0x9200,0x9212,0x91ff,0x91fd,0x9206,0x9204,0x9227, -0x9202,0x921c,0x9224,0x9219,0x9217,0x9205,0x9216,0x957b, -0x958d,0x958c,0x9590,0x9687,0x967e,0x9688,0x9689,0x9683, -0x9680,0x96c2,0x96c8,0x96c3,0x96f1,0x96f0,0x976c,0x9770, -0x976e,0x9807,0x98a9,0x98eb,0x9ce6,0x9ef9,0x4e83,0x4e84, -0x4eb6,0x50bd,0x50bf,0x50c6,0x50ae,0x50c4,0x50ca,0x50b4, -0x50c8,0x50c2,0x50b0,0x50c1,0x50ba,0x50b1,0x50cb,0x50c9, -0x50b6,0x50b8,0x51d7,0x527a,0x5278,0x527b,0x527c,0x55c3, -0x55db,0x55cc,0x55d0,0x55cb,0x55ca,0x55dd,0x55c0,0x55d4, -0x55c4,0x55e9,0x55bf,0x55d2,0x558d,0x55cf,0x55d5,0x55e2, -0x55d6,0x55c8,0x55f2,0x55cd,0x55d9,0x55c2,0x5714,0x5853, -0x5868,0x5864,0x584f,0x584d,0x5849,0x586f,0x5855,0x584e, -0x585d,0x5859,0x5865,0x585b,0x583d,0x5863,0x5871,0x58fc, -0x5ac7,0x5ac4,0x5acb,0x5aba,0x5ab8,0x5ab1,0x5ab5,0x5ab0, -0x5abf,0x5ac8,0x5abb,0x5ac6,0x5ab7,0x5ac0,0x5aca,0x5ab4, -0x5ab6,0x5acd,0x5ab9,0x5a90,0x5bd6,0x5bd8,0x5bd9,0x5c1f, -0x5c33,0x5d71,0x5d63,0x5d4a,0x5d65,0x5d72,0x5d6c,0x5d5e, -0x5d68,0x5d67,0x5d62,0x5df0,0x5e4f,0x5e4e,0x5e4a,0x5e4d, -0x5e4b,0x5ec5,0x5ecc,0x5ec6,0x5ecb,0x5ec7,0x5f40,0x5faf, -0x5fad,0x60f7,0x6149,0x614a,0x612b,0x6145,0x6136,0x6132, -0x612e,0x6146,0x612f,0x614f,0x6129,0x6140,0x6220,0x9168, -0x6223,0x6225,0x6224,0x63c5,0x63f1,0x63eb,0x6410,0x6412, -0x6409,0x6420,0x6424,0x6433,0x6443,0x641f,0x6415,0x6418, -0x6439,0x6437,0x6422,0x6423,0x640c,0x6426,0x6430,0x6428, -0x6441,0x6435,0x642f,0x640a,0x641a,0x6440,0x6425,0x6427, -0x640b,0x63e7,0x641b,0x642e,0x6421,0x640e,0x656f,0x6592, -0x65d3,0x6686,0x668c,0x6695,0x6690,0x668b,0x668a,0x6699, -0x6694,0x6678,0x6720,0x6966,0x695f,0x6938,0x694e,0x6962, -0x6971,0x693f,0x6945,0x696a,0x6939,0x6942,0x6957,0x6959, -0x697a,0x6948,0x6949,0x6935,0x696c,0x6933,0x693d,0x6965, -0x68f0,0x6978,0x6934,0x6969,0x6940,0x696f,0x6944,0x6976, -0x6958,0x6941,0x6974,0x694c,0x693b,0x694b,0x6937,0x695c, -0x694f,0x6951,0x6932,0x6952,0x692f,0x697b,0x693c,0x6b46, -0x6b45,0x6b43,0x6b42,0x6b48,0x6b41,0x6b9b,0xfa0d,0x6bfb, -0x6bfc,0x6bf9,0x6bf7,0x6bf8,0x6e9b,0x6ed6,0x6ec8,0x6e8f, -0x6ec0,0x6e9f,0x6e93,0x6e94,0x6ea0,0x6eb1,0x6eb9,0x6ec6, -0x6ed2,0x6ebd,0x6ec1,0x6e9e,0x6ec9,0x6eb7,0x6eb0,0x6ecd, -0x6ea6,0x6ecf,0x6eb2,0x6ebe,0x6ec3,0x6edc,0x6ed8,0x6e99, -0x6e92,0x6e8e,0x6e8d,0x6ea4,0x6ea1,0x6ebf,0x6eb3,0x6ed0, -0x6eca,0x6e97,0x6eae,0x6ea3,0x7147,0x7154,0x7152,0x7163, -0x7160,0x7141,0x715d,0x7162,0x7172,0x7178,0x716a,0x7161, -0x7142,0x7158,0x7143,0x714b,0x7170,0x715f,0x7150,0x7153, -0x7144,0x714d,0x715a,0x724f,0x728d,0x728c,0x7291,0x7290, -0x728e,0x733c,0x7342,0x733b,0x733a,0x7340,0x734a,0x7349, -0x7444,0x744a,0x744b,0x7452,0x7451,0x7457,0x7440,0x744f, -0x7450,0x744e,0x7442,0x7446,0x744d,0x7454,0x74e1,0x74ff, -0x74fe,0x74fd,0x751d,0x7579,0x7577,0x6983,0x75ef,0x760f, -0x7603,0x75f7,0x75fe,0x75fc,0x75f9,0x75f8,0x7610,0x75fb, -0x75f6,0x75ed,0x75f5,0x75fd,0x7699,0x76b5,0x76dd,0x7755, -0x775f,0x7760,0x7752,0x7756,0x775a,0x7769,0x7767,0x7754, -0x7759,0x776d,0x77e0,0x7887,0x789a,0x7894,0x788f,0x7884, -0x7895,0x7885,0x7886,0x78a1,0x7883,0x7879,0x7899,0x7880, -0x7896,0x787b,0x797c,0x7982,0x797d,0x7979,0x7a11,0x7a18, -0x7a19,0x7a12,0x7a17,0x7a15,0x7a22,0x7a13,0x7a1b,0x7a10, -0x7aa3,0x7aa2,0x7a9e,0x7aeb,0x7b66,0x7b64,0x7b6d,0x7b74, -0x7b69,0x7b72,0x7b65,0x7b73,0x7b71,0x7b70,0x7b61,0x7b78, -0x7b76,0x7b63,0x7cb2,0x7cb4,0x7caf,0x7d88,0x7d86,0x7d80, -0x7d8d,0x7d7f,0x7d85,0x7d7a,0x7d8e,0x7d7b,0x7d83,0x7d7c, -0x7d8c,0x7d94,0x7d84,0x7d7d,0x7d92,0x7f6d,0x7f6b,0x7f67, -0x7f68,0x7f6c,0x7fa6,0x7fa5,0x7fa7,0x7fdb,0x7fdc,0x8021, -0x8164,0x8160,0x8177,0x815c,0x8169,0x815b,0x8162,0x8172, -0x6721,0x815e,0x8176,0x8167,0x816f,0x8144,0x8161,0x821d, -0x8249,0x8244,0x8240,0x8242,0x8245,0x84f1,0x843f,0x8456, -0x8476,0x8479,0x848f,0x848d,0x8465,0x8451,0x8440,0x8486, -0x8467,0x8430,0x844d,0x847d,0x845a,0x8459,0x8474,0x8473, -0x845d,0x8507,0x845e,0x8437,0x843a,0x8434,0x847a,0x8443, -0x8478,0x8432,0x8445,0x8429,0x83d9,0x844b,0x842f,0x8442, -0x842d,0x845f,0x8470,0x8439,0x844e,0x844c,0x8452,0x846f, -0x84c5,0x848e,0x843b,0x8447,0x8436,0x8433,0x8468,0x847e, -0x8444,0x842b,0x8460,0x8454,0x846e,0x8450,0x870b,0x8704, -0x86f7,0x870c,0x86fa,0x86d6,0x86f5,0x874d,0x86f8,0x870e, -0x8709,0x8701,0x86f6,0x870d,0x8705,0x88d6,0x88cb,0x88cd, -0x88ce,0x88de,0x88db,0x88da,0x88cc,0x88d0,0x8985,0x899b, -0x89df,0x89e5,0x89e4,0x89e1,0x89e0,0x89e2,0x89dc,0x89e6, -0x8a76,0x8a86,0x8a7f,0x8a61,0x8a3f,0x8a77,0x8a82,0x8a84, -0x8a75,0x8a83,0x8a81,0x8a74,0x8a7a,0x8c3c,0x8c4b,0x8c4a, -0x8c65,0x8c64,0x8c66,0x8c86,0x8c84,0x8c85,0x8ccc,0x8d68, -0x8d69,0x8d91,0x8d8c,0x8d8e,0x8d8f,0x8d8d,0x8d93,0x8d94, -0x8d90,0x8d92,0x8df0,0x8de0,0x8dec,0x8df1,0x8dee,0x8dd0, -0x8de9,0x8de3,0x8de2,0x8de7,0x8df2,0x8deb,0x8df4,0x8f06, -0x8eff,0x8f01,0x8f00,0x8f05,0x8f07,0x8f08,0x8f02,0x8f0b, -0x9052,0x903f,0x9044,0x9049,0x903d,0x9110,0x910d,0x910f, -0x9111,0x9116,0x9114,0x910b,0x910e,0x916e,0x916f,0x9248, -0x9252,0x9230,0x923a,0x9266,0x9233,0x9265,0x925e,0x9283, -0x922e,0x924a,0x9246,0x926d,0x926c,0x924f,0x9260,0x9267, -0x926f,0x9236,0x9261,0x9270,0x9231,0x9254,0x9263,0x9250, -0x9272,0x924e,0x9253,0x924c,0x9256,0x9232,0x959f,0x959c, -0x959e,0x959b,0x9692,0x9693,0x9691,0x9697,0x96ce,0x96fa, -0x96fd,0x96f8,0x96f5,0x9773,0x9777,0x9778,0x9772,0x980f, -0x980d,0x980e,0x98ac,0x98f6,0x98f9,0x99af,0x99b2,0x99b0, -0x99b5,0x9aad,0x9aab,0x9b5b,0x9cea,0x9ced,0x9ce7,0x9e80, -0x9efd,0x50e6,0x50d4,0x50d7,0x50e8,0x50f3,0x50db,0x50ea, -0x50dd,0x50e4,0x50d3,0x50ec,0x50f0,0x50ef,0x50e3,0x50e0, -0x51d8,0x5280,0x5281,0x52e9,0x52eb,0x5330,0x53ac,0x5627, -0x5615,0x560c,0x5612,0x55fc,0x560f,0x561c,0x5601,0x5613, -0x5602,0x55fa,0x561d,0x5604,0x55ff,0x55f9,0x5889,0x587c, -0x5890,0x5898,0x5886,0x5881,0x587f,0x5874,0x588b,0x587a, -0x5887,0x5891,0x588e,0x5876,0x5882,0x5888,0x587b,0x5894, -0x588f,0x58fe,0x596b,0x5adc,0x5aee,0x5ae5,0x5ad5,0x5aea, -0x5ada,0x5aed,0x5aeb,0x5af3,0x5ae2,0x5ae0,0x5adb,0x5aec, -0x5ade,0x5add,0x5ad9,0x5ae8,0x5adf,0x5b77,0x5be0,0x5be3, -0x5c63,0x5d82,0x5d80,0x5d7d,0x5d86,0x5d7a,0x5d81,0x5d77, -0x5d8a,0x5d89,0x5d88,0x5d7e,0x5d7c,0x5d8d,0x5d79,0x5d7f, -0x5e58,0x5e59,0x5e53,0x5ed8,0x5ed1,0x5ed7,0x5ece,0x5edc, -0x5ed5,0x5ed9,0x5ed2,0x5ed4,0x5f44,0x5f43,0x5f6f,0x5fb6, -0x612c,0x6128,0x6141,0x615e,0x6171,0x6173,0x6152,0x6153, -0x6172,0x616c,0x6180,0x6174,0x6154,0x617a,0x615b,0x6165, -0x613b,0x616a,0x6161,0x6156,0x6229,0x6227,0x622b,0x642b, -0x644d,0x645b,0x645d,0x6474,0x6476,0x6472,0x6473,0x647d, -0x6475,0x6466,0x64a6,0x644e,0x6482,0x645e,0x645c,0x644b, -0x6453,0x6460,0x6450,0x647f,0x643f,0x646c,0x646b,0x6459, -0x6465,0x6477,0x6573,0x65a0,0x66a1,0x66a0,0x669f,0x6705, -0x6704,0x6722,0x69b1,0x69b6,0x69c9,0x69a0,0x69ce,0x6996, -0x69b0,0x69ac,0x69bc,0x6991,0x6999,0x698e,0x69a7,0x698d, -0x69a9,0x69be,0x69af,0x69bf,0x69c4,0x69bd,0x69a4,0x69d4, -0x69b9,0x69ca,0x699a,0x69cf,0x69b3,0x6993,0x69aa,0x69a1, -0x699e,0x69d9,0x6997,0x6990,0x69c2,0x69b5,0x69a5,0x69c6, -0x6b4a,0x6b4d,0x6b4b,0x6b9e,0x6b9f,0x6ba0,0x6bc3,0x6bc4, -0x6bfe,0x6ece,0x6ef5,0x6ef1,0x6f03,0x6f25,0x6ef8,0x6f37, -0x6efb,0x6f2e,0x6f09,0x6f4e,0x6f19,0x6f1a,0x6f27,0x6f18, -0x6f3b,0x6f12,0x6eed,0x6f0a,0x6f36,0x6f73,0x6ef9,0x6eee, -0x6f2d,0x6f40,0x6f30,0x6f3c,0x6f35,0x6eeb,0x6f07,0x6f0e, -0x6f43,0x6f05,0x6efd,0x6ef6,0x6f39,0x6f1c,0x6efc,0x6f3a, -0x6f1f,0x6f0d,0x6f1e,0x6f08,0x6f21,0x7187,0x7190,0x7189, -0x7180,0x7185,0x7182,0x718f,0x717b,0x7186,0x7181,0x7197, -0x7244,0x7253,0x7297,0x7295,0x7293,0x7343,0x734d,0x7351, -0x734c,0x7462,0x7473,0x7471,0x7475,0x7472,0x7467,0x746e, -0x7500,0x7502,0x7503,0x757d,0x7590,0x7616,0x7608,0x760c, -0x7615,0x7611,0x760a,0x7614,0x76b8,0x7781,0x777c,0x7785, -0x7782,0x776e,0x7780,0x776f,0x777e,0x7783,0x78b2,0x78aa, -0x78b4,0x78ad,0x78a8,0x787e,0x78ab,0x789e,0x78a5,0x78a0, -0x78ac,0x78a2,0x78a4,0x7998,0x798a,0x798b,0x7996,0x7995, -0x7994,0x7993,0x7997,0x7988,0x7992,0x7990,0x7a2b,0x7a4a, -0x7a30,0x7a2f,0x7a28,0x7a26,0x7aa8,0x7aab,0x7aac,0x7aee, -0x7b88,0x7b9c,0x7b8a,0x7b91,0x7b90,0x7b96,0x7b8d,0x7b8c, -0x7b9b,0x7b8e,0x7b85,0x7b98,0x5284,0x7b99,0x7ba4,0x7b82, -0x7cbb,0x7cbf,0x7cbc,0x7cba,0x7da7,0x7db7,0x7dc2,0x7da3, -0x7daa,0x7dc1,0x7dc0,0x7dc5,0x7d9d,0x7dce,0x7dc4,0x7dc6, -0x7dcb,0x7dcc,0x7daf,0x7db9,0x7d96,0x7dbc,0x7d9f,0x7da6, -0x7dae,0x7da9,0x7da1,0x7dc9,0x7f73,0x7fe2,0x7fe3,0x7fe5, -0x7fde,0x8024,0x805d,0x805c,0x8189,0x8186,0x8183,0x8187, -0x818d,0x818c,0x818b,0x8215,0x8497,0x84a4,0x84a1,0x849f, -0x84ba,0x84ce,0x84c2,0x84ac,0x84ae,0x84ab,0x84b9,0x84b4, -0x84c1,0x84cd,0x84aa,0x849a,0x84b1,0x84d0,0x849d,0x84a7, -0x84bb,0x84a2,0x8494,0x84c7,0x84cc,0x849b,0x84a9,0x84af, -0x84a8,0x84d6,0x8498,0x84b6,0x84cf,0x84a0,0x84d7,0x84d4, -0x84d2,0x84db,0x84b0,0x8491,0x8661,0x8733,0x8723,0x8728, -0x876b,0x8740,0x872e,0x871e,0x8721,0x8719,0x871b,0x8743, -0x872c,0x8741,0x873e,0x8746,0x8720,0x8732,0x872a,0x872d, -0x873c,0x8712,0x873a,0x8731,0x8735,0x8742,0x8726,0x8727, -0x8738,0x8724,0x871a,0x8730,0x8711,0x88f7,0x88e7,0x88f1, -0x88f2,0x88fa,0x88fe,0x88ee,0x88fc,0x88f6,0x88fb,0x88f0, -0x88ec,0x88eb,0x899d,0x89a1,0x899f,0x899e,0x89e9,0x89eb, -0x89e8,0x8aab,0x8a99,0x8a8b,0x8a92,0x8a8f,0x8a96,0x8c3d, -0x8c68,0x8c69,0x8cd5,0x8ccf,0x8cd7,0x8d96,0x8e09,0x8e02, -0x8dff,0x8e0d,0x8dfd,0x8e0a,0x8e03,0x8e07,0x8e06,0x8e05, -0x8dfe,0x8e00,0x8e04,0x8f10,0x8f11,0x8f0e,0x8f0d,0x9123, -0x911c,0x9120,0x9122,0x911f,0x911d,0x911a,0x9124,0x9121, -0x911b,0x917a,0x9172,0x9179,0x9173,0x92a5,0x92a4,0x9276, -0x929b,0x927a,0x92a0,0x9294,0x92aa,0x928d,0x92a6,0x929a, -0x92ab,0x9279,0x9297,0x927f,0x92a3,0x92ee,0x928e,0x9282, -0x9295,0x92a2,0x927d,0x9288,0x92a1,0x928a,0x9286,0x928c, -0x9299,0x92a7,0x927e,0x9287,0x92a9,0x929d,0x928b,0x922d, -0x969e,0x96a1,0x96ff,0x9758,0x977d,0x977a,0x977e,0x9783, -0x9780,0x9782,0x977b,0x9784,0x9781,0x977f,0x97ce,0x97cd, -0x9816,0x98ad,0x98ae,0x9902,0x9900,0x9907,0x999d,0x999c, -0x99c3,0x99b9,0x99bb,0x99ba,0x99c2,0x99bd,0x99c7,0x9ab1, -0x9ae3,0x9ae7,0x9b3e,0x9b3f,0x9b60,0x9b61,0x9b5f,0x9cf1, -0x9cf2,0x9cf5,0x9ea7,0x50ff,0x5103,0x5130,0x50f8,0x5106, -0x5107,0x50f6,0x50fe,0x510b,0x510c,0x50fd,0x510a,0x528b, -0x528c,0x52f1,0x52ef,0x5648,0x5642,0x564c,0x5635,0x5641, -0x564a,0x5649,0x5646,0x5658,0x565a,0x5640,0x5633,0x563d, -0x562c,0x563e,0x5638,0x562a,0x563a,0x571a,0x58ab,0x589d, -0x58b1,0x58a0,0x58a3,0x58af,0x58ac,0x58a5,0x58a1,0x58ff, -0x5aff,0x5af4,0x5afd,0x5af7,0x5af6,0x5b03,0x5af8,0x5b02, -0x5af9,0x5b01,0x5b07,0x5b05,0x5b0f,0x5c67,0x5d99,0x5d97, -0x5d9f,0x5d92,0x5da2,0x5d93,0x5d95,0x5da0,0x5d9c,0x5da1, -0x5d9a,0x5d9e,0x5e69,0x5e5d,0x5e60,0x5e5c,0x7df3,0x5edb, -0x5ede,0x5ee1,0x5f49,0x5fb2,0x618b,0x6183,0x6179,0x61b1, -0x61b0,0x61a2,0x6189,0x619b,0x6193,0x61af,0x61ad,0x619f, -0x6192,0x61aa,0x61a1,0x618d,0x6166,0x61b3,0x622d,0x646e, -0x6470,0x6496,0x64a0,0x6485,0x6497,0x649c,0x648f,0x648b, -0x648a,0x648c,0x64a3,0x649f,0x6468,0x64b1,0x6498,0x6576, -0x657a,0x6579,0x657b,0x65b2,0x65b3,0x66b5,0x66b0,0x66a9, -0x66b2,0x66b7,0x66aa,0x66af,0x6a00,0x6a06,0x6a17,0x69e5, -0x69f8,0x6a15,0x69f1,0x69e4,0x6a20,0x69ff,0x69ec,0x69e2, -0x6a1b,0x6a1d,0x69fe,0x6a27,0x69f2,0x69ee,0x6a14,0x69f7, -0x69e7,0x6a40,0x6a08,0x69e6,0x69fb,0x6a0d,0x69fc,0x69eb, -0x6a09,0x6a04,0x6a18,0x6a25,0x6a0f,0x69f6,0x6a26,0x6a07, -0x69f4,0x6a16,0x6b51,0x6ba5,0x6ba3,0x6ba2,0x6ba6,0x6c01, -0x6c00,0x6bff,0x6c02,0x6f41,0x6f26,0x6f7e,0x6f87,0x6fc6, -0x6f92,0x6f8d,0x6f89,0x6f8c,0x6f62,0x6f4f,0x6f85,0x6f5a, -0x6f96,0x6f76,0x6f6c,0x6f82,0x6f55,0x6f72,0x6f52,0x6f50, -0x6f57,0x6f94,0x6f93,0x6f5d,0x6f00,0x6f61,0x6f6b,0x6f7d, -0x6f67,0x6f90,0x6f53,0x6f8b,0x6f69,0x6f7f,0x6f95,0x6f63, -0x6f77,0x6f6a,0x6f7b,0x71b2,0x71af,0x719b,0x71b0,0x71a0, -0x719a,0x71a9,0x71b5,0x719d,0x71a5,0x719e,0x71a4,0x71a1, -0x71aa,0x719c,0x71a7,0x71b3,0x7298,0x729a,0x7358,0x7352, -0x735e,0x735f,0x7360,0x735d,0x735b,0x7361,0x735a,0x7359, -0x7362,0x7487,0x7489,0x748a,0x7486,0x7481,0x747d,0x7485, -0x7488,0x747c,0x7479,0x7508,0x7507,0x757e,0x7625,0x761e, -0x7619,0x761d,0x761c,0x7623,0x761a,0x7628,0x761b,0x769c, -0x769d,0x769e,0x769b,0x778d,0x778f,0x7789,0x7788,0x78cd, -0x78bb,0x78cf,0x78cc,0x78d1,0x78ce,0x78d4,0x78c8,0x78c3, -0x78c4,0x78c9,0x799a,0x79a1,0x79a0,0x799c,0x79a2,0x799b, -0x6b76,0x7a39,0x7ab2,0x7ab4,0x7ab3,0x7bb7,0x7bcb,0x7bbe, -0x7bac,0x7bce,0x7baf,0x7bb9,0x7bca,0x7bb5,0x7cc5,0x7cc8, -0x7ccc,0x7ccb,0x7df7,0x7ddb,0x7dea,0x7de7,0x7dd7,0x7de1, -0x7e03,0x7dfa,0x7de6,0x7df6,0x7df1,0x7df0,0x7dee,0x7ddf, -0x7f76,0x7fac,0x7fb0,0x7fad,0x7fed,0x7feb,0x7fea,0x7fec, -0x7fe6,0x7fe8,0x8064,0x8067,0x81a3,0x819f,0x819e,0x8195, -0x81a2,0x8199,0x8197,0x8216,0x824f,0x8253,0x8252,0x8250, -0x824e,0x8251,0x8524,0x853b,0x850f,0x8500,0x8529,0x850e, -0x8509,0x850d,0x851f,0x850a,0x8527,0x851c,0x84fb,0x852b, -0x84fa,0x8508,0x850c,0x84f4,0x852a,0x84f2,0x8515,0x84f7, -0x84eb,0x84f3,0x84fc,0x8512,0x84ea,0x84e9,0x8516,0x84fe, -0x8528,0x851d,0x852e,0x8502,0x84fd,0x851e,0x84f6,0x8531, -0x8526,0x84e7,0x84e8,0x84f0,0x84ef,0x84f9,0x8518,0x8520, -0x8530,0x850b,0x8519,0x852f,0x8662,0x8756,0x8763,0x8764, -0x8777,0x87e1,0x8773,0x8758,0x8754,0x875b,0x8752,0x8761, -0x875a,0x8751,0x875e,0x876d,0x876a,0x8750,0x874e,0x875f, -0x875d,0x876f,0x876c,0x877a,0x876e,0x875c,0x8765,0x874f, -0x877b,0x8775,0x8762,0x8767,0x8769,0x885a,0x8905,0x890c, -0x8914,0x890b,0x8917,0x8918,0x8919,0x8906,0x8916,0x8911, -0x890e,0x8909,0x89a2,0x89a4,0x89a3,0x89ed,0x89f0,0x89ec, -0x8acf,0x8ac6,0x8ab8,0x8ad3,0x8ad1,0x8ad4,0x8ad5,0x8abb, -0x8ad7,0x8abe,0x8ac0,0x8ac5,0x8ad8,0x8ac3,0x8aba,0x8abd, -0x8ad9,0x8c3e,0x8c4d,0x8c8f,0x8ce5,0x8cdf,0x8cd9,0x8ce8, -0x8cda,0x8cdd,0x8ce7,0x8da0,0x8d9c,0x8da1,0x8d9b,0x8e20, -0x8e23,0x8e25,0x8e24,0x8e2e,0x8e15,0x8e1b,0x8e16,0x8e11, -0x8e19,0x8e26,0x8e27,0x8e14,0x8e12,0x8e18,0x8e13,0x8e1c, -0x8e17,0x8e1a,0x8f2c,0x8f24,0x8f18,0x8f1a,0x8f20,0x8f23, -0x8f16,0x8f17,0x9073,0x9070,0x906f,0x9067,0x906b,0x912f, -0x912b,0x9129,0x912a,0x9132,0x9126,0x912e,0x9185,0x9186, -0x918a,0x9181,0x9182,0x9184,0x9180,0x92d0,0x92c3,0x92c4, -0x92c0,0x92d9,0x92b6,0x92cf,0x92f1,0x92df,0x92d8,0x92e9, -0x92d7,0x92dd,0x92cc,0x92ef,0x92c2,0x92e8,0x92ca,0x92c8, -0x92ce,0x92e6,0x92cd,0x92d5,0x92c9,0x92e0,0x92de,0x92e7, -0x92d1,0x92d3,0x92b5,0x92e1,0x92c6,0x92b4,0x957c,0x95ac, -0x95ab,0x95ae,0x95b0,0x96a4,0x96a2,0x96d3,0x9705,0x9708, -0x9702,0x975a,0x978a,0x978e,0x9788,0x97d0,0x97cf,0x981e, -0x981d,0x9826,0x9829,0x9828,0x9820,0x981b,0x9827,0x98b2, -0x9908,0x98fa,0x9911,0x9914,0x9916,0x9917,0x9915,0x99dc, -0x99cd,0x99cf,0x99d3,0x99d4,0x99ce,0x99c9,0x99d6,0x99d8, -0x99cb,0x99d7,0x99cc,0x9ab3,0x9aec,0x9aeb,0x9af3,0x9af2, -0x9af1,0x9b46,0x9b43,0x9b67,0x9b74,0x9b71,0x9b66,0x9b76, -0x9b75,0x9b70,0x9b68,0x9b64,0x9b6c,0x9cfc,0x9cfa,0x9cfd, -0x9cff,0x9cf7,0x9d07,0x9d00,0x9cf9,0x9cfb,0x9d08,0x9d05, -0x9d04,0x9e83,0x9ed3,0x9f0f,0x9f10,0x511c,0x5113,0x5117, -0x511a,0x5111,0x51de,0x5334,0x53e1,0x5670,0x5660,0x566e, -0x5673,0x5666,0x5663,0x566d,0x5672,0x565e,0x5677,0x571c, -0x571b,0x58c8,0x58bd,0x58c9,0x58bf,0x58ba,0x58c2,0x58bc, -0x58c6,0x5b17,0x5b19,0x5b1b,0x5b21,0x5b14,0x5b13,0x5b10, -0x5b16,0x5b28,0x5b1a,0x5b20,0x5b1e,0x5bef,0x5dac,0x5db1, -0x5da9,0x5da7,0x5db5,0x5db0,0x5dae,0x5daa,0x5da8,0x5db2, -0x5dad,0x5daf,0x5db4,0x5e67,0x5e68,0x5e66,0x5e6f,0x5ee9, -0x5ee7,0x5ee6,0x5ee8,0x5ee5,0x5f4b,0x5fbc,0x619d,0x61a8, -0x6196,0x61c5,0x61b4,0x61c6,0x61c1,0x61cc,0x61ba,0x61bf, -0x61b8,0x618c,0x64d7,0x64d6,0x64d0,0x64cf,0x64c9,0x64bd, -0x6489,0x64c3,0x64db,0x64f3,0x64d9,0x6533,0x657f,0x657c, -0x65a2,0x66c8,0x66be,0x66c0,0x66ca,0x66cb,0x66cf,0x66bd, -0x66bb,0x66ba,0x66cc,0x6723,0x6a34,0x6a66,0x6a49,0x6a67, -0x6a32,0x6a68,0x6a3e,0x6a5d,0x6a6d,0x6a76,0x6a5b,0x6a51, -0x6a28,0x6a5a,0x6a3b,0x6a3f,0x6a41,0x6a6a,0x6a64,0x6a50, -0x6a4f,0x6a54,0x6a6f,0x6a69,0x6a60,0x6a3c,0x6a5e,0x6a56, -0x6a55,0x6a4d,0x6a4e,0x6a46,0x6b55,0x6b54,0x6b56,0x6ba7, -0x6baa,0x6bab,0x6bc8,0x6bc7,0x6c04,0x6c03,0x6c06,0x6fad, -0x6fcb,0x6fa3,0x6fc7,0x6fbc,0x6fce,0x6fc8,0x6f5e,0x6fc4, -0x6fbd,0x6f9e,0x6fca,0x6fa8,0x7004,0x6fa5,0x6fae,0x6fba, -0x6fac,0x6faa,0x6fcf,0x6fbf,0x6fb8,0x6fa2,0x6fc9,0x6fab, -0x6fcd,0x6faf,0x6fb2,0x6fb0,0x71c5,0x71c2,0x71bf,0x71b8, -0x71d6,0x71c0,0x71c1,0x71cb,0x71d4,0x71ca,0x71c7,0x71cf, -0x71bd,0x71d8,0x71bc,0x71c6,0x71da,0x71db,0x729d,0x729e, -0x7369,0x7366,0x7367,0x736c,0x7365,0x736b,0x736a,0x747f, -0x749a,0x74a0,0x7494,0x7492,0x7495,0x74a1,0x750b,0x7580, -0x762f,0x762d,0x7631,0x763d,0x7633,0x763c,0x7635,0x7632, -0x7630,0x76bb,0x76e6,0x779a,0x779d,0x77a1,0x779c,0x779b, -0x77a2,0x77a3,0x7795,0x7799,0x7797,0x78dd,0x78e9,0x78e5, -0x78ea,0x78de,0x78e3,0x78db,0x78e1,0x78e2,0x78ed,0x78df, -0x78e0,0x79a4,0x7a44,0x7a48,0x7a47,0x7ab6,0x7ab8,0x7ab5, -0x7ab1,0x7ab7,0x7bde,0x7be3,0x7be7,0x7bdd,0x7bd5,0x7be5, -0x7bda,0x7be8,0x7bf9,0x7bd4,0x7bea,0x7be2,0x7bdc,0x7beb, -0x7bd8,0x7bdf,0x7cd2,0x7cd4,0x7cd7,0x7cd0,0x7cd1,0x7e12, -0x7e21,0x7e17,0x7e0c,0x7e1f,0x7e20,0x7e13,0x7e0e,0x7e1c, -0x7e15,0x7e1a,0x7e22,0x7e0b,0x7e0f,0x7e16,0x7e0d,0x7e14, -0x7e25,0x7e24,0x7f43,0x7f7b,0x7f7c,0x7f7a,0x7fb1,0x7fef, -0x802a,0x8029,0x806c,0x81b1,0x81a6,0x81ae,0x81b9,0x81b5, -0x81ab,0x81b0,0x81ac,0x81b4,0x81b2,0x81b7,0x81a7,0x81f2, -0x8255,0x8256,0x8257,0x8556,0x8545,0x856b,0x854d,0x8553, -0x8561,0x8558,0x8540,0x8546,0x8564,0x8541,0x8562,0x8544, -0x8551,0x8547,0x8563,0x853e,0x855b,0x8571,0x854e,0x856e, -0x8575,0x8555,0x8567,0x8560,0x858c,0x8566,0x855d,0x8554, -0x8565,0x856c,0x8663,0x8665,0x8664,0x879b,0x878f,0x8797, -0x8793,0x8792,0x8788,0x8781,0x8796,0x8798,0x8779,0x8787, -0x87a3,0x8785,0x8790,0x8791,0x879d,0x8784,0x8794,0x879c, -0x879a,0x8789,0x891e,0x8926,0x8930,0x892d,0x892e,0x8927, -0x8931,0x8922,0x8929,0x8923,0x892f,0x892c,0x891f,0x89f1, -0x8ae0,0x8ae2,0x8af2,0x8af4,0x8af5,0x8add,0x8b14,0x8ae4, -0x8adf,0x8af0,0x8ac8,0x8ade,0x8ae1,0x8ae8,0x8aff,0x8aef, -0x8afb,0x8c91,0x8c92,0x8c90,0x8cf5,0x8cee,0x8cf1,0x8cf0, -0x8cf3,0x8d6c,0x8d6e,0x8da5,0x8da7,0x8e33,0x8e3e,0x8e38, -0x8e40,0x8e45,0x8e36,0x8e3c,0x8e3d,0x8e41,0x8e30,0x8e3f, -0x8ebd,0x8f36,0x8f2e,0x8f35,0x8f32,0x8f39,0x8f37,0x8f34, -0x9076,0x9079,0x907b,0x9086,0x90fa,0x9133,0x9135,0x9136, -0x9193,0x9190,0x9191,0x918d,0x918f,0x9327,0x931e,0x9308, -0x931f,0x9306,0x930f,0x937a,0x9338,0x933c,0x931b,0x9323, -0x9312,0x9301,0x9346,0x932d,0x930e,0x930d,0x92cb,0x931d, -0x92fa,0x9325,0x9313,0x92f9,0x92f7,0x9334,0x9302,0x9324, -0x92ff,0x9329,0x9339,0x9335,0x932a,0x9314,0x930c,0x930b, -0x92fe,0x9309,0x9300,0x92fb,0x9316,0x95bc,0x95cd,0x95be, -0x95b9,0x95ba,0x95b6,0x95bf,0x95b5,0x95bd,0x96a9,0x96d4, -0x970b,0x9712,0x9710,0x9799,0x9797,0x9794,0x97f0,0x97f8, -0x9835,0x982f,0x9832,0x9924,0x991f,0x9927,0x9929,0x999e, -0x99ee,0x99ec,0x99e5,0x99e4,0x99f0,0x99e3,0x99ea,0x99e9, -0x99e7,0x9ab9,0x9abf,0x9ab4,0x9abb,0x9af6,0x9afa,0x9af9, -0x9af7,0x9b33,0x9b80,0x9b85,0x9b87,0x9b7c,0x9b7e,0x9b7b, -0x9b82,0x9b93,0x9b92,0x9b90,0x9b7a,0x9b95,0x9b7d,0x9b88, -0x9d25,0x9d17,0x9d20,0x9d1e,0x9d14,0x9d29,0x9d1d,0x9d18, -0x9d22,0x9d10,0x9d19,0x9d1f,0x9e88,0x9e86,0x9e87,0x9eae, -0x9ead,0x9ed5,0x9ed6,0x9efa,0x9f12,0x9f3d,0x5126,0x5125, -0x5122,0x5124,0x5120,0x5129,0x52f4,0x5693,0x568c,0x568d, -0x5686,0x5684,0x5683,0x567e,0x5682,0x567f,0x5681,0x58d6, -0x58d4,0x58cf,0x58d2,0x5b2d,0x5b25,0x5b32,0x5b23,0x5b2c, -0x5b27,0x5b26,0x5b2f,0x5b2e,0x5b7b,0x5bf1,0x5bf2,0x5db7, -0x5e6c,0x5e6a,0x5fbe,0x5fbb,0x61c3,0x61b5,0x61bc,0x61e7, -0x61e0,0x61e5,0x61e4,0x61e8,0x61de,0x64ef,0x64e9,0x64e3, -0x64eb,0x64e4,0x64e8,0x6581,0x6580,0x65b6,0x65da,0x66d2, -0x6a8d,0x6a96,0x6a81,0x6aa5,0x6a89,0x6a9f,0x6a9b,0x6aa1, -0x6a9e,0x6a87,0x6a93,0x6a8e,0x6a95,0x6a83,0x6aa8,0x6aa4, -0x6a91,0x6a7f,0x6aa6,0x6a9a,0x6a85,0x6a8c,0x6a92,0x6b5b, -0x6bad,0x6c09,0x6fcc,0x6fa9,0x6ff4,0x6fd4,0x6fe3,0x6fdc, -0x6fed,0x6fe7,0x6fe6,0x6fde,0x6ff2,0x6fdd,0x6fe2,0x6fe8, -0x71e1,0x71f1,0x71e8,0x71f2,0x71e4,0x71f0,0x71e2,0x7373, -0x736e,0x736f,0x7497,0x74b2,0x74ab,0x7490,0x74aa,0x74ad, -0x74b1,0x74a5,0x74af,0x7510,0x7511,0x7512,0x750f,0x7584, -0x7643,0x7648,0x7649,0x7647,0x76a4,0x76e9,0x77b5,0x77ab, -0x77b2,0x77b7,0x77b6,0x77b4,0x77b1,0x77a8,0x77f0,0x78f3, -0x78fd,0x7902,0x78fb,0x78fc,0x78f2,0x7905,0x78f9,0x78fe, -0x7904,0x79ab,0x79a8,0x7a5c,0x7a5b,0x7a56,0x7a58,0x7a54, -0x7a5a,0x7abe,0x7ac0,0x7ac1,0x7c05,0x7c0f,0x7bf2,0x7c00, -0x7bff,0x7bfb,0x7c0e,0x7bf4,0x7c0b,0x7bf3,0x7c02,0x7c09, -0x7c03,0x7c01,0x7bf8,0x7bfd,0x7c06,0x7bf0,0x7bf1,0x7c10, -0x7c0a,0x7ce8,0x7e2d,0x7e3c,0x7e42,0x7e33,0x9848,0x7e38, -0x7e2a,0x7e49,0x7e40,0x7e47,0x7e29,0x7e4c,0x7e30,0x7e3b, -0x7e36,0x7e44,0x7e3a,0x7f45,0x7f7f,0x7f7e,0x7f7d,0x7ff4, -0x7ff2,0x802c,0x81bb,0x81c4,0x81cc,0x81ca,0x81c5,0x81c7, -0x81bc,0x81e9,0x825b,0x825a,0x825c,0x8583,0x8580,0x858f, -0x85a7,0x8595,0x85a0,0x858b,0x85a3,0x857b,0x85a4,0x859a, -0x859e,0x8577,0x857c,0x8589,0x85a1,0x857a,0x8578,0x8557, -0x858e,0x8596,0x8586,0x858d,0x8599,0x859d,0x8581,0x85a2, -0x8582,0x8588,0x8585,0x8579,0x8576,0x8598,0x8590,0x859f, -0x8668,0x87be,0x87aa,0x87ad,0x87c5,0x87b0,0x87ac,0x87b9, -0x87b5,0x87bc,0x87ae,0x87c9,0x87c3,0x87c2,0x87cc,0x87b7, -0x87af,0x87c4,0x87ca,0x87b4,0x87b6,0x87bf,0x87b8,0x87bd, -0x87de,0x87b2,0x8935,0x8933,0x893c,0x893e,0x8941,0x8952, -0x8937,0x8942,0x89ad,0x89af,0x89ae,0x89f2,0x89f3,0x8b1e, -0x8b18,0x8b16,0x8b11,0x8b05,0x8b0b,0x8b22,0x8b0f,0x8b12, -0x8b15,0x8b07,0x8b0d,0x8b08,0x8b06,0x8b1c,0x8b13,0x8b1a, -0x8c4f,0x8c70,0x8c72,0x8c71,0x8c6f,0x8c95,0x8c94,0x8cf9, -0x8d6f,0x8e4e,0x8e4d,0x8e53,0x8e50,0x8e4c,0x8e47,0x8f43, -0x8f40,0x9085,0x907e,0x9138,0x919a,0x91a2,0x919b,0x9199, -0x919f,0x91a1,0x919d,0x91a0,0x93a1,0x9383,0x93af,0x9364, -0x9356,0x9347,0x937c,0x9358,0x935c,0x9376,0x9349,0x9350, -0x9351,0x9360,0x936d,0x938f,0x934c,0x936a,0x9379,0x9357, -0x9355,0x9352,0x934f,0x9371,0x9377,0x937b,0x9361,0x935e, -0x9363,0x9367,0x9380,0x934e,0x9359,0x95c7,0x95c0,0x95c9, -0x95c3,0x95c5,0x95b7,0x96ae,0x96b0,0x96ac,0x9720,0x971f, -0x9718,0x971d,0x9719,0x979a,0x97a1,0x979c,0x979e,0x979d, -0x97d5,0x97d4,0x97f1,0x9841,0x9844,0x984a,0x9849,0x9845, -0x9843,0x9925,0x992b,0x992c,0x992a,0x9933,0x9932,0x992f, -0x992d,0x9931,0x9930,0x9998,0x99a3,0x99a1,0x9a02,0x99fa, -0x99f4,0x99f7,0x99f9,0x99f8,0x99f6,0x99fb,0x99fd,0x99fe, -0x99fc,0x9a03,0x9abe,0x9afe,0x9afd,0x9b01,0x9afc,0x9b48, -0x9b9a,0x9ba8,0x9b9e,0x9b9b,0x9ba6,0x9ba1,0x9ba5,0x9ba4, -0x9b86,0x9ba2,0x9ba0,0x9baf,0x9d33,0x9d41,0x9d67,0x9d36, -0x9d2e,0x9d2f,0x9d31,0x9d38,0x9d30,0x9d45,0x9d42,0x9d43, -0x9d3e,0x9d37,0x9d40,0x9d3d,0x7ff5,0x9d2d,0x9e8a,0x9e89, -0x9e8d,0x9eb0,0x9ec8,0x9eda,0x9efb,0x9eff,0x9f24,0x9f23, -0x9f22,0x9f54,0x9fa0,0x5131,0x512d,0x512e,0x5698,0x569c, -0x5697,0x569a,0x569d,0x5699,0x5970,0x5b3c,0x5c69,0x5c6a, -0x5dc0,0x5e6d,0x5e6e,0x61d8,0x61df,0x61ed,0x61ee,0x61f1, -0x61ea,0x61f0,0x61eb,0x61d6,0x61e9,0x64ff,0x6504,0x64fd, -0x64f8,0x6501,0x6503,0x64fc,0x6594,0x65db,0x66da,0x66db, -0x66d8,0x6ac5,0x6ab9,0x6abd,0x6ae1,0x6ac6,0x6aba,0x6ab6, -0x6ab7,0x6ac7,0x6ab4,0x6aad,0x6b5e,0x6bc9,0x6c0b,0x7007, -0x700c,0x700d,0x7001,0x7005,0x7014,0x700e,0x6fff,0x7000, -0x6ffb,0x7026,0x6ffc,0x6ff7,0x700a,0x7201,0x71ff,0x71f9, -0x7203,0x71fd,0x7376,0x74b8,0x74c0,0x74b5,0x74c1,0x74be, -0x74b6,0x74bb,0x74c2,0x7514,0x7513,0x765c,0x7664,0x7659, -0x7650,0x7653,0x7657,0x765a,0x76a6,0x76bd,0x76ec,0x77c2, -0x77ba,0x78ff,0x790c,0x7913,0x7914,0x7909,0x7910,0x7912, -0x7911,0x79ad,0x79ac,0x7a5f,0x7c1c,0x7c29,0x7c19,0x7c20, -0x7c1f,0x7c2d,0x7c1d,0x7c26,0x7c28,0x7c22,0x7c25,0x7c30, -0x7e5c,0x7e50,0x7e56,0x7e63,0x7e58,0x7e62,0x7e5f,0x7e51, -0x7e60,0x7e57,0x7e53,0x7fb5,0x7fb3,0x7ff7,0x7ff8,0x8075, -0x81d1,0x81d2,0x81d0,0x825f,0x825e,0x85b4,0x85c6,0x85c0, -0x85c3,0x85c2,0x85b3,0x85b5,0x85bd,0x85c7,0x85c4,0x85bf, -0x85cb,0x85ce,0x85c8,0x85c5,0x85b1,0x85b6,0x85d2,0x8624, -0x85b8,0x85b7,0x85be,0x8669,0x87e7,0x87e6,0x87e2,0x87db, -0x87eb,0x87ea,0x87e5,0x87df,0x87f3,0x87e4,0x87d4,0x87dc, -0x87d3,0x87ed,0x87d8,0x87e3,0x87a4,0x87d7,0x87d9,0x8801, -0x87f4,0x87e8,0x87dd,0x8953,0x894b,0x894f,0x894c,0x8946, -0x8950,0x8951,0x8949,0x8b2a,0x8b27,0x8b23,0x8b33,0x8b30, -0x8b35,0x8b47,0x8b2f,0x8b3c,0x8b3e,0x8b31,0x8b25,0x8b37, -0x8b26,0x8b36,0x8b2e,0x8b24,0x8b3b,0x8b3d,0x8b3a,0x8c42, -0x8c75,0x8c99,0x8c98,0x8c97,0x8cfe,0x8d04,0x8d02,0x8d00, -0x8e5c,0x8e62,0x8e60,0x8e57,0x8e56,0x8e5e,0x8e65,0x8e67, -0x8e5b,0x8e5a,0x8e61,0x8e5d,0x8e69,0x8e54,0x8f46,0x8f47, -0x8f48,0x8f4b,0x9128,0x913a,0x913b,0x913e,0x91a8,0x91a5, -0x91a7,0x91af,0x91aa,0x93b5,0x938c,0x9392,0x93b7,0x939b, -0x939d,0x9389,0x93a7,0x938e,0x93aa,0x939e,0x93a6,0x9395, -0x9388,0x9399,0x939f,0x938d,0x93b1,0x9391,0x93b2,0x93a4, -0x93a8,0x93b4,0x93a3,0x93a5,0x95d2,0x95d3,0x95d1,0x96b3, -0x96d7,0x96da,0x5dc2,0x96df,0x96d8,0x96dd,0x9723,0x9722, -0x9725,0x97ac,0x97ae,0x97a8,0x97ab,0x97a4,0x97aa,0x97a2, -0x97a5,0x97d7,0x97d9,0x97d6,0x97d8,0x97fa,0x9850,0x9851, -0x9852,0x98b8,0x9941,0x993c,0x993a,0x9a0f,0x9a0b,0x9a09, -0x9a0d,0x9a04,0x9a11,0x9a0a,0x9a05,0x9a07,0x9a06,0x9ac0, -0x9adc,0x9b08,0x9b04,0x9b05,0x9b29,0x9b35,0x9b4a,0x9b4c, -0x9b4b,0x9bc7,0x9bc6,0x9bc3,0x9bbf,0x9bc1,0x9bb5,0x9bb8, -0x9bd3,0x9bb6,0x9bc4,0x9bb9,0x9bbd,0x9d5c,0x9d53,0x9d4f, -0x9d4a,0x9d5b,0x9d4b,0x9d59,0x9d56,0x9d4c,0x9d57,0x9d52, -0x9d54,0x9d5f,0x9d58,0x9d5a,0x9e8e,0x9e8c,0x9edf,0x9f01, -0x9f00,0x9f16,0x9f25,0x9f2b,0x9f2a,0x9f29,0x9f28,0x9f4c, -0x9f55,0x5134,0x5135,0x5296,0x52f7,0x53b4,0x56ab,0x56ad, -0x56a6,0x56a7,0x56aa,0x56ac,0x58da,0x58dd,0x58db,0x5912, -0x5b3d,0x5b3e,0x5b3f,0x5dc3,0x5e70,0x5fbf,0x61fb,0x6507, -0x6510,0x650d,0x6509,0x650c,0x650e,0x6584,0x65de,0x65dd, -0x66de,0x6ae7,0x6ae0,0x6acc,0x6ad1,0x6ad9,0x6acb,0x6adf, -0x6adc,0x6ad0,0x6aeb,0x6acf,0x6acd,0x6ade,0x6b60,0x6bb0, -0x6c0c,0x7019,0x7027,0x7020,0x7016,0x702b,0x7021,0x7022, -0x7023,0x7029,0x7017,0x7024,0x701c,0x702a,0x720c,0x720a, -0x7207,0x7202,0x7205,0x72a5,0x72a6,0x72a4,0x72a3,0x72a1, -0x74cb,0x74c5,0x74b7,0x74c3,0x7516,0x7660,0x77c9,0x77ca, -0x77c4,0x77f1,0x791d,0x791b,0x7921,0x791c,0x7917,0x791e, -0x79b0,0x7a67,0x7a68,0x7c33,0x7c3c,0x7c39,0x7c2c,0x7c3b, -0x7cec,0x7cea,0x7e76,0x7e75,0x7e78,0x7e70,0x7e77,0x7e6f, -0x7e7a,0x7e72,0x7e74,0x7e68,0x7f4b,0x7f4a,0x7f83,0x7f86, -0x7fb7,0x7ffd,0x7ffe,0x8078,0x81d7,0x81d5,0x8264,0x8261, -0x8263,0x85eb,0x85f1,0x85ed,0x85d9,0x85e1,0x85e8,0x85da, -0x85d7,0x85ec,0x85f2,0x85f8,0x85d8,0x85df,0x85e3,0x85dc, -0x85d1,0x85f0,0x85e6,0x85ef,0x85de,0x85e2,0x8800,0x87fa, -0x8803,0x87f6,0x87f7,0x8809,0x880c,0x880b,0x8806,0x87fc, -0x8808,0x87ff,0x880a,0x8802,0x8962,0x895a,0x895b,0x8957, -0x8961,0x895c,0x8958,0x895d,0x8959,0x8988,0x89b7,0x89b6, -0x89f6,0x8b50,0x8b48,0x8b4a,0x8b40,0x8b53,0x8b56,0x8b54, -0x8b4b,0x8b55,0x8b51,0x8b42,0x8b52,0x8b57,0x8c43,0x8c77, -0x8c76,0x8c9a,0x8d06,0x8d07,0x8d09,0x8dac,0x8daa,0x8dad, -0x8dab,0x8e6d,0x8e78,0x8e73,0x8e6a,0x8e6f,0x8e7b,0x8ec2, -0x8f52,0x8f51,0x8f4f,0x8f50,0x8f53,0x8fb4,0x9140,0x913f, -0x91b0,0x91ad,0x93de,0x93c7,0x93cf,0x93c2,0x93da,0x93d0, -0x93f9,0x93ec,0x93cc,0x93d9,0x93a9,0x93e6,0x93ca,0x93d4, -0x93ee,0x93e3,0x93d5,0x93c4,0x93ce,0x93c0,0x93d2,0x93e7, -0x957d,0x95da,0x95db,0x96e1,0x9729,0x972b,0x972c,0x9728, -0x9726,0x97b3,0x97b7,0x97b6,0x97dd,0x97de,0x97df,0x985c, -0x9859,0x985d,0x9857,0x98bf,0x98bd,0x98bb,0x98be,0x9948, -0x9947,0x9943,0x99a6,0x99a7,0x9a1a,0x9a15,0x9a25,0x9a1d, -0x9a24,0x9a1b,0x9a22,0x9a20,0x9a27,0x9a23,0x9a1e,0x9a1c, -0x9a14,0x9ac2,0x9b0b,0x9b0a,0x9b0e,0x9b0c,0x9b37,0x9bea, -0x9beb,0x9be0,0x9bde,0x9be4,0x9be6,0x9be2,0x9bf0,0x9bd4, -0x9bd7,0x9bec,0x9bdc,0x9bd9,0x9be5,0x9bd5,0x9be1,0x9bda, -0x9d77,0x9d81,0x9d8a,0x9d84,0x9d88,0x9d71,0x9d80,0x9d78, -0x9d86,0x9d8b,0x9d8c,0x9d7d,0x9d6b,0x9d74,0x9d75,0x9d70, -0x9d69,0x9d85,0x9d73,0x9d7b,0x9d82,0x9d6f,0x9d79,0x9d7f, -0x9d87,0x9d68,0x9e94,0x9e91,0x9ec0,0x9efc,0x9f2d,0x9f40, -0x9f41,0x9f4d,0x9f56,0x9f57,0x9f58,0x5337,0x56b2,0x56b5, -0x56b3,0x58e3,0x5b45,0x5dc6,0x5dc7,0x5eee,0x5eef,0x5fc0, -0x5fc1,0x61f9,0x6517,0x6516,0x6515,0x6513,0x65df,0x66e8, -0x66e3,0x66e4,0x6af3,0x6af0,0x6aea,0x6ae8,0x6af9,0x6af1, -0x6aee,0x6aef,0x703c,0x7035,0x702f,0x7037,0x7034,0x7031, -0x7042,0x7038,0x703f,0x703a,0x7039,0x7040,0x703b,0x7033, -0x7041,0x7213,0x7214,0x72a8,0x737d,0x737c,0x74ba,0x76ab, -0x76aa,0x76be,0x76ed,0x77cc,0x77ce,0x77cf,0x77cd,0x77f2, -0x7925,0x7923,0x7927,0x7928,0x7924,0x7929,0x79b2,0x7a6e, -0x7a6c,0x7a6d,0x7af7,0x7c49,0x7c48,0x7c4a,0x7c47,0x7c45, -0x7cee,0x7e7b,0x7e7e,0x7e81,0x7e80,0x7fba,0x7fff,0x8079, -0x81db,0x81d9,0x820b,0x8268,0x8269,0x8622,0x85ff,0x8601, -0x85fe,0x861b,0x8600,0x85f6,0x8604,0x8609,0x8605,0x860c, -0x85fd,0x8819,0x8810,0x8811,0x8817,0x8813,0x8816,0x8963, -0x8966,0x89b9,0x89f7,0x8b60,0x8b6a,0x8b5d,0x8b68,0x8b63, -0x8b65,0x8b67,0x8b6d,0x8dae,0x8e86,0x8e88,0x8e84,0x8f59, -0x8f56,0x8f57,0x8f55,0x8f58,0x8f5a,0x908d,0x9143,0x9141, -0x91b7,0x91b5,0x91b2,0x91b3,0x940b,0x9413,0x93fb,0x9420, -0x940f,0x9414,0x93fe,0x9415,0x9410,0x9428,0x9419,0x940d, -0x93f5,0x9400,0x93f7,0x9407,0x940e,0x9416,0x9412,0x93fa, -0x9409,0x93f8,0x940a,0x93ff,0x93fc,0x940c,0x93f6,0x9411, -0x9406,0x95de,0x95e0,0x95df,0x972e,0x972f,0x97b9,0x97bb, -0x97fd,0x97fe,0x9860,0x9862,0x9863,0x985f,0x98c1,0x98c2, -0x9950,0x994e,0x9959,0x994c,0x994b,0x9953,0x9a32,0x9a34, -0x9a31,0x9a2c,0x9a2a,0x9a36,0x9a29,0x9a2e,0x9a38,0x9a2d, -0x9ac7,0x9aca,0x9ac6,0x9b10,0x9b12,0x9b11,0x9c0b,0x9c08, -0x9bf7,0x9c05,0x9c12,0x9bf8,0x9c40,0x9c07,0x9c0e,0x9c06, -0x9c17,0x9c14,0x9c09,0x9d9f,0x9d99,0x9da4,0x9d9d,0x9d92, -0x9d98,0x9d90,0x9d9b,0x9da0,0x9d94,0x9d9c,0x9daa,0x9d97, -0x9da1,0x9d9a,0x9da2,0x9da8,0x9d9e,0x9da3,0x9dbf,0x9da9, -0x9d96,0x9da6,0x9da7,0x9e99,0x9e9b,0x9e9a,0x9ee5,0x9ee4, -0x9ee7,0x9ee6,0x9f30,0x9f2e,0x9f5b,0x9f60,0x9f5e,0x9f5d, -0x9f59,0x9f91,0x513a,0x5139,0x5298,0x5297,0x56c3,0x56bd, -0x56be,0x5b48,0x5b47,0x5dcb,0x5dcf,0x5ef1,0x61fd,0x651b, -0x6b02,0x6afc,0x6b03,0x6af8,0x6b00,0x7043,0x7044,0x704a, -0x7048,0x7049,0x7045,0x7046,0x721d,0x721a,0x7219,0x737e, -0x7517,0x766a,0x77d0,0x792d,0x7931,0x792f,0x7c54,0x7c53, -0x7cf2,0x7e8a,0x7e87,0x7e88,0x7e8b,0x7e86,0x7e8d,0x7f4d, -0x7fbb,0x8030,0x81dd,0x8618,0x862a,0x8626,0x861f,0x8623, -0x861c,0x8619,0x8627,0x862e,0x8621,0x8620,0x8629,0x861e, -0x8625,0x8829,0x881d,0x881b,0x8820,0x8824,0x881c,0x882b, -0x884a,0x896d,0x8969,0x896e,0x896b,0x89fa,0x8b79,0x8b78, -0x8b45,0x8b7a,0x8b7b,0x8d10,0x8d14,0x8daf,0x8e8e,0x8e8c, -0x8f5e,0x8f5b,0x8f5d,0x9146,0x9144,0x9145,0x91b9,0x943f, -0x943b,0x9436,0x9429,0x943d,0x943c,0x9430,0x9439,0x942a, -0x9437,0x942c,0x9440,0x9431,0x95e5,0x95e4,0x95e3,0x9735, -0x973a,0x97bf,0x97e1,0x9864,0x98c9,0x98c6,0x98c0,0x9958, -0x9956,0x9a39,0x9a3d,0x9a46,0x9a44,0x9a42,0x9a41,0x9a3a, -0x9a3f,0x9acd,0x9b15,0x9b17,0x9b18,0x9b16,0x9b3a,0x9b52, -0x9c2b,0x9c1d,0x9c1c,0x9c2c,0x9c23,0x9c28,0x9c29,0x9c24, -0x9c21,0x9db7,0x9db6,0x9dbc,0x9dc1,0x9dc7,0x9dca,0x9dcf, -0x9dbe,0x9dc5,0x9dc3,0x9dbb,0x9db5,0x9dce,0x9db9,0x9dba, -0x9dac,0x9dc8,0x9db1,0x9dad,0x9dcc,0x9db3,0x9dcd,0x9db2, -0x9e7a,0x9e9c,0x9eeb,0x9eee,0x9eed,0x9f1b,0x9f18,0x9f1a, -0x9f31,0x9f4e,0x9f65,0x9f64,0x9f92,0x4eb9,0x56c6,0x56c5, -0x56cb,0x5971,0x5b4b,0x5b4c,0x5dd5,0x5dd1,0x5ef2,0x6521, -0x6520,0x6526,0x6522,0x6b0b,0x6b08,0x6b09,0x6c0d,0x7055, -0x7056,0x7057,0x7052,0x721e,0x721f,0x72a9,0x737f,0x74d8, -0x74d5,0x74d9,0x74d7,0x766d,0x76ad,0x7935,0x79b4,0x7a70, -0x7a71,0x7c57,0x7c5c,0x7c59,0x7c5b,0x7c5a,0x7cf4,0x7cf1, -0x7e91,0x7f4f,0x7f87,0x81de,0x826b,0x8634,0x8635,0x8633, -0x862c,0x8632,0x8636,0x882c,0x8828,0x8826,0x882a,0x8825, -0x8971,0x89bf,0x89be,0x89fb,0x8b7e,0x8b84,0x8b82,0x8b86, -0x8b85,0x8b7f,0x8d15,0x8e95,0x8e94,0x8e9a,0x8e92,0x8e90, -0x8e96,0x8e97,0x8f60,0x8f62,0x9147,0x944c,0x9450,0x944a, -0x944b,0x944f,0x9447,0x9445,0x9448,0x9449,0x9446,0x973f, -0x97e3,0x986a,0x9869,0x98cb,0x9954,0x995b,0x9a4e,0x9a53, -0x9a54,0x9a4c,0x9a4f,0x9a48,0x9a4a,0x9a49,0x9a52,0x9a50, -0x9ad0,0x9b19,0x9b2b,0x9b3b,0x9b56,0x9b55,0x9c46,0x9c48, -0x9c3f,0x9c44,0x9c39,0x9c33,0x9c41,0x9c3c,0x9c37,0x9c34, -0x9c32,0x9c3d,0x9c36,0x9ddb,0x9dd2,0x9dde,0x9dda,0x9dcb, -0x9dd0,0x9ddc,0x9dd1,0x9ddf,0x9de9,0x9dd9,0x9dd8,0x9dd6, -0x9df5,0x9dd5,0x9ddd,0x9eb6,0x9ef0,0x9f35,0x9f33,0x9f32, -0x9f42,0x9f6b,0x9f95,0x9fa2,0x513d,0x5299,0x58e8,0x58e7, -0x5972,0x5b4d,0x5dd8,0x882f,0x5f4f,0x6201,0x6203,0x6204, -0x6529,0x6525,0x6596,0x66eb,0x6b11,0x6b12,0x6b0f,0x6bca, -0x705b,0x705a,0x7222,0x7382,0x7381,0x7383,0x7670,0x77d4, -0x7c67,0x7c66,0x7e95,0x826c,0x863a,0x8640,0x8639,0x863c, -0x8631,0x863b,0x863e,0x8830,0x8832,0x882e,0x8833,0x8976, -0x8974,0x8973,0x89fe,0x8b8c,0x8b8e,0x8b8b,0x8b88,0x8c45, -0x8d19,0x8e98,0x8f64,0x8f63,0x91bc,0x9462,0x9455,0x945d, -0x9457,0x945e,0x97c4,0x97c5,0x9800,0x9a56,0x9a59,0x9b1e, -0x9b1f,0x9b20,0x9c52,0x9c58,0x9c50,0x9c4a,0x9c4d,0x9c4b, -0x9c55,0x9c59,0x9c4c,0x9c4e,0x9dfb,0x9df7,0x9def,0x9de3, -0x9deb,0x9df8,0x9de4,0x9df6,0x9de1,0x9dee,0x9de6,0x9df2, -0x9df0,0x9de2,0x9dec,0x9df4,0x9df3,0x9de8,0x9ded,0x9ec2, -0x9ed0,0x9ef2,0x9ef3,0x9f06,0x9f1c,0x9f38,0x9f37,0x9f36, -0x9f43,0x9f4f,0x9f71,0x9f70,0x9f6e,0x9f6f,0x56d3,0x56cd, -0x5b4e,0x5c6d,0x652d,0x66ed,0x66ee,0x6b13,0x705f,0x7061, -0x705d,0x7060,0x7223,0x74db,0x74e5,0x77d5,0x7938,0x79b7, -0x79b6,0x7c6a,0x7e97,0x7f89,0x826d,0x8643,0x8838,0x8837, -0x8835,0x884b,0x8b94,0x8b95,0x8e9e,0x8e9f,0x8ea0,0x8e9d, -0x91be,0x91bd,0x91c2,0x946b,0x9468,0x9469,0x96e5,0x9746, -0x9743,0x9747,0x97c7,0x97e5,0x9a5e,0x9ad5,0x9b59,0x9c63, -0x9c67,0x9c66,0x9c62,0x9c5e,0x9c60,0x9e02,0x9dfe,0x9e07, -0x9e03,0x9e06,0x9e05,0x9e00,0x9e01,0x9e09,0x9dff,0x9dfd, -0x9e04,0x9ea0,0x9f1e,0x9f46,0x9f74,0x9f75,0x9f76,0x56d4, -0x652e,0x65b8,0x6b18,0x6b19,0x6b17,0x6b1a,0x7062,0x7226, -0x72aa,0x77d8,0x77d9,0x7939,0x7c69,0x7c6b,0x7cf6,0x7e9a, -0x7e98,0x7e9b,0x7e99,0x81e0,0x81e1,0x8646,0x8647,0x8648, -0x8979,0x897a,0x897c,0x897b,0x89ff,0x8b98,0x8b99,0x8ea5, -0x8ea4,0x8ea3,0x946e,0x946d,0x946f,0x9471,0x9473,0x9749, -0x9872,0x995f,0x9c68,0x9c6e,0x9c6d,0x9e0b,0x9e0d,0x9e10, -0x9e0f,0x9e12,0x9e11,0x9ea1,0x9ef5,0x9f09,0x9f47,0x9f78, -0x9f7b,0x9f7a,0x9f79,0x571e,0x7066,0x7c6f,0x883c,0x8db2, -0x8ea6,0x91c3,0x9474,0x9478,0x9476,0x9475,0x9a60,0x9c74, -0x9c73,0x9c71,0x9c75,0x9e14,0x9e13,0x9ef6,0x9f0a,0x9fa4, -0x7068,0x7065,0x7cf7,0x866a,0x883e,0x883d,0x883f,0x8b9e, -0x8c9c,0x8ea9,0x8ec9,0x974b,0x9873,0x9874,0x98cc,0x9961, -0x99ab,0x9a64,0x9a66,0x9a67,0x9b24,0x9e15,0x9e17,0x9f48, -0x6207,0x6b1e,0x7227,0x864c,0x8ea8,0x9482,0x9480,0x9481, -0x9a69,0x9a68,0x9b2e,0x9e19,0x7229,0x864b,0x8b9f,0x9483, -0x9c79,0x9eb7,0x7675,0x9a6b,0x9c7a,0x9e1d,0x7069,0x706a, -0x9ea4,0x9f7e,0x9f49,0x9f98,0x7881,0x92b9,0x88cf,0x58bb, -0x6052,0x7ca7,0x5afa,0x2554,0x2566,0x2557,0x2560,0x256c, -0x2563,0x255a,0x2569,0x255d,0x2552,0x2564,0x2555,0x255e, -0x256a,0x2561,0x2558,0x2567,0x255b,0x2553,0x2565,0x2556, -0x255f,0x256b,0x2562,0x2559,0x2568,0x255c,0x2551,0x2550, -0x256d,0x256e,0x2570,0x256f,0x2593}; - -static const int big5_ucs_table_size = sizeof(big5_ucs_table)/sizeof(unsigned short); - -/* UCS -> Big5 */ -static const unsigned short ucs_a1_big5_table[] = { -/* 0x0000 */ -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x007f, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1b1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1c2, -0xa258,0xa1d3,0x0000,0x0000,0x0000,0x0000,0x0000,0xa150, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1d1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1d2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa3be, -0x0000,0xa3bc,0xa3bd,0xa3bf,0x0000,0xa1c5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa3bb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa344,0xa345,0xa346,0xa347,0xa348,0xa349,0xa34a, -0xa34b,0xa34c,0xa34d,0xa34e,0xa34f,0xa350,0xa351,0xa352, -0xa353,0xa354,0x0000,0xa355,0xa356,0xa357,0xa358,0xa359, -0xa35a,0xa35b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa35c,0xa35d,0xa35e,0xa35f,0xa360,0xa361,0xa362, -0xa363,0xa364,0xa365,0xa366,0xa367,0xa368,0xa369,0xa36a, -0xa36b,0xa36c,0x0000,0xa36d,0xa36e,0xa36f,0xa370,0xa371, -0xa372,0xa373}; - -static const int ucs_a1_big5_table_min = 0x0000; -static const int ucs_a1_big5_table_max = 0x0000 + (sizeof (ucs_a1_big5_table) / sizeof (unsigned short)); - - -static const unsigned short ucs_a2_big5_table[] = { -/* 0x2000 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa156,0xa158,0x0000,0x0000,0x0000, -0xa1a5,0xa1a6,0x0000,0x0000,0xa1a7,0xa1a8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa14c,0xa14b,0xa145, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1ac,0x0000,0x0000,0xa1ab,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa1b0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa3e1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2100 */ -0x0000,0x0000,0x0000,0xa24a,0x0000,0xa1c1,0x0000,0x0000, -0x0000,0xa24b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2b9,0xa2ba,0xa2bb,0xa2bc,0xa2bd,0xa2be,0xa2bf,0xa2c0, -0xa2c1,0xa2c2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1f6,0xa1f4,0xa1f7,0xa1f5,0x0000,0x0000,0xa1f8,0xa1f9, -0xa1fb,0xa1fa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa241,0x0000,0x0000, -0x0000,0x0000,0xa1d4,0x0000,0x0000,0x0000,0xa1db,0xa1e8, -0xa1e7,0x0000,0x0000,0xa1fd,0x0000,0xa1fc,0x0000,0x0000, -0x0000,0xa1e4,0xa1e5,0xa1ec,0x0000,0x0000,0xa1ed,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1ef,0xa1ee,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1dc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1da,0xa1dd,0x0000,0x0000,0x0000,0x0000,0xa1d8,0xa1d9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1f2,0x0000,0x0000, -0x0000,0xa1f3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1e6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1e9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa277,0x0000,0xa278,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa27a,0x0000,0x0000,0x0000, -0xa27b,0x0000,0x0000,0x0000,0xa27c,0x0000,0x0000,0x0000, -0xa27d,0x0000,0x0000,0x0000,0xa275,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa274,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa273,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa272,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa271,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf9f9,0xf9f8,0xf9e6,0xf9ef,0xf9dd,0xf9e8,0xf9f1,0xf9df, -0xf9ec,0xf9f5,0xf9e3,0xf9ee,0xf9f7,0xf9e5,0xf9e9,0xf9f2, -0xf9e0,0xf9eb,0xf9f4,0xf9e2,0xf9e7,0xf9f0,0xf9de,0xf9ed, -0xf9f6,0xf9e4,0xf9ea,0xf9f3,0xf9e1,0xf9fa,0xf9fb,0xf9fd, -0xf9fc,0xa2ac,0xa2ad,0xa2ae,0xa15a,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa262,0xa263,0xa264,0xa265,0xa266,0xa267,0xa268, -0xa269,0xa270,0xa26f,0xa26e,0xa26d,0xa26c,0xa26b,0xa26a, -0x0000,0x0000,0x0000,0xf9fe,0xa276,0xa279,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1bd,0xa1bc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1b6,0xa1b5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1bf,0xa1be,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1bb,0xa1ba, -0x0000,0x0000,0x0000,0xa1b3,0x0000,0x0000,0xa1b7,0xa1b4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa2a8,0xa2a9,0xa2ab,0xa2aa,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1b9,0xa1b8,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1f0,0x0000,0xa1f1}; - -static const int ucs_a2_big5_table_min = 0x2000; -static const int ucs_a2_big5_table_max = 0x2000 + (sizeof (ucs_a2_big5_table) / sizeof (unsigned short)); - - -static const unsigned short ucs_a3_big5_table[] = { -/* 0x2f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa140,0xa142,0xa143,0xa1b2,0x0000,0x0000,0x0000,0x0000, -0xa171,0xa172,0xa16d,0xa16e,0xa175,0xa176,0xa179,0xa17a, -0xa169,0xa16a,0xa245,0x0000,0xa165,0xa166,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1a9,0xa1aa,0x0000, -0x0000,0xa2c3,0xa2c4,0xa2c5,0xa2c6,0xa2c7,0xa2c8,0xa2c9, -0xa2ca,0xa2cb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa374,0xa375,0xa376, -0xa377,0xa378,0xa379,0xa37a,0xa37b,0xa37c,0xa37d,0xa37e, -0xa3a1,0xa3a2,0xa3a3,0xa3a4,0xa3a5,0xa3a6,0xa3a7,0xa3a8, -0xa3a9,0xa3aa,0xa3ab,0xa3ac,0xa3ad,0xa3ae,0xa3af,0xa3b0, -0xa3b1,0xa3b2,0xa3b3,0xa3b4,0xa3b5,0xa3b6,0xa3b7,0xa3b8, -0xa3b9,0xa3ba,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa1c0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa255,0xa256, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa250,0xa251,0xa252,0x0000, -0x0000,0xa254,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa257,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa253,0x0000, -0x0000,0xa1eb,0xa1ea,0x0000,0x0000,0xa24f}; - -static const int ucs_a3_big5_table_min = 0x2f00; -static const int ucs_a3_big5_table_max = 0x2f00 + (sizeof (ucs_a3_big5_table) / sizeof (unsigned short)); - -static const unsigned short ucs_i_big5_table[] = { -/* 0x4d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa440,0xa442,0x0000,0xa443,0x0000,0x0000,0x0000,0xc945, -0xa456,0xa454,0xa457,0xa455,0xc946,0xa4a3,0xc94f,0xc94d, -0xa4a2,0xa4a1,0x0000,0x0000,0xa542,0xa541,0xa540,0x0000, -0xa543,0xa4fe,0x0000,0x0000,0x0000,0x0000,0xa5e0,0xa5e1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8c3,0x0000, -0x0000,0x0000,0x0000,0xa458,0x0000,0xa4a4,0xc950,0x0000, -0xa4a5,0xc963,0xa6ea,0xcbb1,0x0000,0x0000,0x0000,0x0000, -0xa459,0xa4a6,0x0000,0xa544,0xc964,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc940,0xa444,0x0000,0xa45b,0x0000,0xc947, -0xa45c,0x0000,0x0000,0xa4a7,0x0000,0xa545,0xa547,0xa546, -0x0000,0x0000,0xa5e2,0xa5e3,0x0000,0x0000,0xa8c4,0x0000, -0xadbc,0xa441,0x0000,0x0000,0xc941,0xa445,0xa45e,0xa45d, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa5e4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8c5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb0ae,0xd44b, -0x0000,0x0000,0xb6c3,0xdcb1,0xdcb2,0x0000,0xa446,0x0000, -0xa4a9,0x0000,0x0000,0xa8c6,0xa447,0xc948,0xa45f,0x0000, -0x0000,0xa4aa,0xa4ac,0xc951,0xa4ad,0xa4ab,0x0000,0x0000, -0x0000,0xa5e5,0x0000,0xa8c7,0x0000,0x0000,0xa8c8,0xab45, -0x0000,0xa460,0xa4ae,0x0000,0xa5e6,0xa5e8,0xa5e7,0x0000, -0xa6eb,0x0000,0x0000,0xa8c9,0xa8ca,0xab46,0xab47,0x0000, -0x0000,0x0000,0x0000,0xadbd,0x0000,0x0000,0xdcb3,0x0000, -0x0000,0xf6d6,0xa448,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa4b0,0xa4af,0xc952,0xa4b1,0xa4b7,0x0000,0xa4b2,0xa4b3, -0xc954,0xc953,0xa4b5,0xa4b6,0x0000,0xa4b4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa54a,0xa54b,0xa54c,0xa54d, -0xa549,0xa550,0xc96a,0x0000,0xc966,0xc969,0xa551,0xa561, -0x0000,0xc968,0x0000,0xa54e,0xa54f,0xa548,0x0000,0x0000, -0xc965,0xc967,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa5f5,0xc9b0,0xa5f2,0xa5f6,0xc9ba,0xc9ae,0xa5f3,0xc9b2, -0x0000,0x0000,0x0000,0xa5f4,0x0000,0xa5f7,0x0000,0xa5e9, -0xc9b1,0xa5f8,0xc9b5,0x0000,0xc9b9,0xc9b6,0x0000,0x0000, -0xc9b3,0xa5ea,0xa5ec,0xa5f9,0x0000,0xa5ee,0xc9ab,0xa5f1, -0xa5ef,0xa5f0,0xc9bb,0xc9b8,0xc9af,0xa5ed,0x0000,0x0000, -0xc9ac,0xa5eb,0x0000,0x0000,0x0000,0xc9b4,0x0000,0x0000, -0x0000,0x0000,0xc9b7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc9ad,0xca66,0x0000,0xa742, -0xa6f4,0x0000,0x0000,0xca67,0xa6f1,0x0000,0xa744,0x0000, -0xa6f9,0x0000,0xa6f8,0xca5b,0xa6fc,0xa6f7,0xca60,0xca68, -0x0000,0xca64,0x0000,0xa6fa,0x0000,0x0000,0xa6fd,0xa6ee, -0xa747,0xca5d,0x0000,0x0000,0xcbbd,0xa6ec,0xa743,0xa6ed, -0xa6f5,0xa6f6,0xca62,0xca5e,0xa6fb,0xa6f3,0xca5a,0xa6ef, -0xca65,0xa745,0xa748,0xa6f2,0xa740,0xa746,0xa6f0,0xca63, -0xa741,0xca69,0xca5c,0xa6fe,0xca5f,0x0000,0x0000,0xca61, -0x0000,0xa8d8,0xcbbf,0xcbcb,0xa8d0,0x0000,0xcbcc,0xa8cb, -0xa8d5,0x0000,0x0000,0xa8ce,0xcbb9,0xa8d6,0xcbb8,0xcbbc, -0xcbc3,0xcbc1,0xa8de,0xa8d9,0xcbb3,0xcbb5,0xa8db,0xa8cf, -0xcbb6,0xcbc2,0xcbc9,0xa8d4,0xcbbb,0xcbb4,0xa8d3,0xcbb7, -0xa8d7,0xcbba,0x0000,0xa8d2,0x0000,0xa8cd,0x0000,0xa8dc, -0xcbc4,0xa8dd,0xcbc8,0x0000,0xcbc6,0xcbca,0xa8da,0xcbbe, -0xcbb2,0x0000,0xcbc0,0xa8d1,0xcbc5,0xa8cc,0xcbc7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xab56,0xab4a, -0x0000,0x0000,0xcde0,0xcde8,0x0000,0xab49,0xab51,0xab5d, -0x0000,0xcdee,0xcdec,0xcde7,0x0000,0x0000,0x0000,0xab4b, -0xcded,0xcde3,0xab59,0xab50,0xab58,0xcdde,0x0000,0xcdea, -0x0000,0xcde1,0xab54,0xcde2,0x0000,0xcddd,0xab5b,0xab4e, -0xab57,0xab4d,0x0000,0xcddf,0xcde4,0x0000,0xcdeb,0xab55, -0xab52,0xcde6,0xab5a,0xcde9,0xcde5,0xab4f,0xab5c,0xab53, -0xab4c,0xab48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcdef,0x0000,0xadd7,0xadc1, -0x0000,0xadd1,0x0000,0xadd6,0xd0d0,0xd0cf,0xd0d4,0xd0d5, -0xadc4,0x0000,0xadcd,0x0000,0x0000,0x0000,0xadda,0x0000, -0xadce,0x0000,0x0000,0x0000,0x0000,0xd0c9,0xadc7,0xd0ca, -0x0000,0xaddc,0x0000,0xadd3,0xadbe,0xadbf,0xd0dd,0xb0bf, -0x0000,0xadcc,0xadcb,0xd0cb,0xadcf,0xd45b,0xadc6,0xd0d6, -0xadd5,0xadd4,0xadca,0xd0ce,0xd0d7,0x0000,0xd0c8,0xadc9, -0xd0d8,0xadd2,0xd0cc,0xadc0,0x0000,0xadc3,0xadc2,0xd0d9, -0xadd0,0xadc5,0xadd9,0xaddb,0xd0d3,0xadd8,0x0000,0xd0db, -0xd0cd,0xd0dc,0x0000,0xd0d1,0x0000,0xd0da,0x0000,0xd0d2, -0x0000,0x0000,0x0000,0x0000,0xadc8,0x0000,0x0000,0x0000, -0xd463,0xd457,0x0000,0xb0b3,0x0000,0xd45c,0xd462,0xb0b2, -0xd455,0xb0b6,0xd459,0xd452,0xb0b4,0xd456,0xb0b9,0xb0be, -0x0000,0xd467,0x0000,0xd451,0x0000,0xb0ba,0x0000,0xd466, -0x0000,0x0000,0xb0b5,0xd458,0xb0b1,0xd453,0xd44f,0xd45d, -0xd450,0xd44e,0xd45a,0xd460,0xd461,0xb0b7,0x0000,0x0000, -0xd85b,0xd45e,0xd44d,0xd45f,0x0000,0xb0c1,0xd464,0xb0c0, -0xd44c,0x0000,0xd454,0xd465,0xb0bc,0xb0bb,0xb0b8,0xb0bd, -0x0000,0x0000,0xb0af,0x0000,0x0000,0xb0b0,0x0000,0x0000, -0xb3c8,0x0000,0xd85e,0xd857,0x0000,0xb3c5,0x0000,0xd85f, -0x0000,0x0000,0x0000,0xd855,0xd858,0xb3c4,0xd859,0x0000, -0x0000,0xb3c7,0xd85d,0x0000,0xd853,0xd852,0xb3c9,0x0000, -0xb3ca,0xb3c6,0xb3cb,0xd851,0xd85c,0xd85a,0xd854,0x0000, -0x0000,0x0000,0xb3c3,0xd856,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb6ca,0xb6c4,0xdcb7,0xb6cd, -0xdcbd,0xdcc0,0xb6c6,0xb6c7,0xdcba,0xb6c5,0xdcc3,0xb6cb, -0xdcc4,0x0000,0xdcbf,0xb6cc,0x0000,0xdcb4,0xb6c9,0xdcb5, -0x0000,0xdcbe,0xdcbc,0x0000,0xdcb8,0xb6c8,0xdcb6,0xb6ce, -0xdcbb,0xdcc2,0xdcb9,0xdcc1,0x0000,0x0000,0xb9b6,0xb9b3, -0x0000,0xb9b4,0x0000,0xe0f9,0xe0f1,0xb9b2,0xb9af,0xe0f2, -0x0000,0x0000,0xb9b1,0xe0f5,0x0000,0xe0f7,0x0000,0x0000, -0xe0fe,0x0000,0x0000,0xe0fd,0xe0f8,0xb9ae,0xe0f0,0xb9ac, -0xe0f3,0xb9b7,0xe0f6,0x0000,0xe0fa,0xb9b0,0xb9ad,0xe0fc, -0xe0fb,0xb9b5,0x0000,0xe0f4,0x0000,0xbbf8,0xe4ec,0x0000, -0xe4e9,0xbbf9,0x0000,0xbbf7,0x0000,0xe4f0,0xe4ed,0xe4e6, -0xbbf6,0x0000,0xbbfa,0xe4e7,0xbbf5,0xbbfd,0xe4ea,0xe4eb, -0xbbfb,0xbbfc,0xe4f1,0xe4ee,0xe4ef,0x0000,0x0000,0x0000, -0xbeaa,0xe8f8,0xbea7,0xe8f5,0xbea9,0xbeab,0x0000,0xe8f6, -0xbea8,0x0000,0xe8f7,0x0000,0xe8f4,0x0000,0x0000,0xc076, -0xecbd,0xc077,0xecbb,0x0000,0xecbc,0xecba,0xecb9,0x0000, -0x0000,0xecbe,0xc075,0x0000,0x0000,0xefb8,0xefb9,0x0000, -0xe4e8,0xefb7,0xc078,0xc35f,0xf1eb,0xf1ec,0x0000,0xc4d7, -0xc4d8,0xf5c1,0xf5c0,0xc56c,0xc56b,0xf7d0,0x0000,0xa449, -0xa461,0xa4b9,0x0000,0xa4b8,0xa553,0xa552,0xa5fc,0xa5fb, -0xa5fd,0xa5fa,0x0000,0xa74a,0xa749,0xa74b,0x0000,0x0000, -0x0000,0x0000,0xa8e0,0x0000,0xa8df,0xa8e1,0x0000,0xab5e, -0x0000,0xa259,0xd0de,0xa25a,0xb0c2,0xa25c,0xa25b,0xd860, -0x0000,0xa25d,0xb9b8,0xa25e,0x0000,0xa44a,0x0000,0xa4ba, -0xa5fe,0xa8e2,0x0000,0xa44b,0xa4bd,0xa4bb,0xa4bc,0x0000, -0x0000,0xa640,0x0000,0x0000,0x0000,0xa74c,0xa8e4,0xa8e3, -0xa8e5,0x0000,0x0000,0x0000,0xaddd,0x0000,0x0000,0x0000, -0xbeac,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc94e, -0x0000,0xa554,0xa555,0x0000,0x0000,0xa641,0x0000,0xca6a, -0x0000,0xab60,0xab5f,0xd0e0,0xd0df,0xb0c3,0x0000,0xa4be, -0xc955,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbcd,0x0000, -0xab61,0x0000,0xade0,0x0000,0xadde,0xaddf,0x0000,0x0000, -0x0000,0x0000,0xbead,0x0000,0xa556,0x0000,0x0000,0x0000, -0xa642,0xc9bc,0x0000,0x0000,0x0000,0x0000,0xa74d,0xa74e, -0x0000,0xca6b,0x0000,0x0000,0xcbce,0xa8e6,0xcbcf,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd0e2,0xd0e3,0xade3,0x0000, -0xd0e4,0x0000,0xd0e1,0xade4,0xade2,0xade1,0xd0e5,0x0000, -0xd468,0x0000,0x0000,0x0000,0xd861,0x0000,0x0000,0xdcc5, -0xe140,0x0000,0x0000,0x0000,0xbbfe,0xbeae,0xe8f9,0x0000, -0xa44c,0xa45a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb0c4,0xb3cd,0x0000,0xb9b9,0x0000,0xc942,0xa4bf,0x0000, -0xa559,0xa557,0xa558,0x0000,0x0000,0xa8e7,0x0000,0x0000, -0xa44d,0xa44e,0x0000,0xa462,0x0000,0x0000,0xa4c0,0xa4c1, -0xa4c2,0xc9be,0xa55a,0x0000,0xc96b,0x0000,0xa646,0x0000, -0xc9bf,0xa644,0xa645,0xc9bd,0x0000,0x0000,0xa647,0xa643, -0x0000,0x0000,0x0000,0x0000,0xca6c,0xaaec,0xca6d,0x0000, -0x0000,0xca6e,0x0000,0x0000,0xa750,0xa74f,0x0000,0x0000, -0xa753,0xa751,0xa752,0x0000,0x0000,0x0000,0xa8ed,0x0000, -0xa8ec,0xcbd4,0xcbd1,0xcbd2,0x0000,0xcbd0,0xa8ee,0xa8ea, -0xa8e9,0x0000,0xa8eb,0xa8e8,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa8ef,0x0000,0xab63,0xcdf0,0x0000,0xcbd3,0xab68, -0x0000,0xcdf1,0xab64,0xab67,0xab66,0xab65,0xab62,0x0000, -0x0000,0x0000,0xd0e8,0x0000,0xade7,0xd0eb,0xade5,0x0000, -0x0000,0x0000,0xd0e7,0xade8,0xade6,0xade9,0xd0e9,0xd0ea, -0x0000,0xd0e6,0xd0ec,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xb3d1,0xb0c5,0xd469,0xd46b,0xd46a,0xd46c,0xb0c6, -0x0000,0x0000,0xb3ce,0x0000,0xb3cf,0xb3d0,0x0000,0xb6d0, -0xdcc7,0x0000,0xdcc6,0xdcc8,0xdcc9,0xb6d1,0x0000,0xb6cf, -0xe141,0xe142,0xb9bb,0xb9ba,0xe35a,0x0000,0x0000,0xbc40, -0xbc41,0xbc42,0xbc44,0xe4f2,0xe4f3,0xbc43,0x0000,0x0000, -0x0000,0xbeaf,0x0000,0xbeb0,0x0000,0x0000,0xf1ed,0xf5c3, -0xf5c2,0xf7d1,0x0000,0xa44f,0x0000,0x0000,0x0000,0xa55c, -0xa55b,0x0000,0x0000,0xa648,0x0000,0x0000,0xc9c0,0x0000, -0x0000,0xa755,0xa756,0xa754,0xa757,0xca6f,0xca70,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8f1,0xcbd5,0x0000,0xa8f0,0x0000, -0xcdf2,0xab6c,0xcdf3,0xab6b,0x0000,0x0000,0x0000,0xab69, -0x0000,0xab6a,0x0000,0x0000,0x0000,0xd0ed,0x0000,0x0000, -0x0000,0x0000,0xb0c7,0xd46e,0x0000,0xb0ca,0xd46d,0xb1e5, -0xb0c9,0xb0c8,0x0000,0xb3d4,0x0000,0xb3d3,0xb3d2,0xb6d2, -0x0000,0x0000,0xb6d5,0xb6d6,0xb6d4,0x0000,0xb6d3,0x0000, -0x0000,0xe143,0x0000,0xe144,0x0000,0x0000,0x0000,0xe4f5, -0xbc45,0xe4f4,0x0000,0xbeb1,0xecbf,0xc079,0x0000,0xf1ee, -0xc455,0x0000,0xa463,0xa4c3,0xc956,0x0000,0xa4c4,0xa4c5, -/* 0x5300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa55d,0xa55e,0x0000, -0xa649,0xca71,0xcbd6,0xcbd7,0x0000,0xab6d,0xd0ee,0xb0cc, -0xb0cb,0xd863,0xd862,0x0000,0x0000,0xa450,0xa4c6,0xa55f, -0x0000,0xb0cd,0xc943,0x0000,0xc96c,0xa560,0x0000,0xc9c2, -0xa64b,0xa64a,0xc9c1,0xa758,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xadea,0x0000,0x0000,0xd46f,0x0000,0xb6d7, -0xe145,0xb9bc,0x0000,0x0000,0xe8fa,0x0000,0x0000,0xf3fd, -0x0000,0xa4c7,0x0000,0x0000,0xcbd8,0xcdf4,0xb0d0,0xb0ce, -0xb0cf,0xa451,0x0000,0xa464,0xa2cd,0xa4ca,0x0000,0xa4c9, -0xa4c8,0xa563,0xa562,0x0000,0xc96d,0xc9c3,0x0000,0x0000, -0x0000,0xa8f5,0xa8f2,0xa8f4,0xa8f3,0x0000,0x0000,0xab6e, -0x0000,0x0000,0xb3d5,0x0000,0xa452,0x0000,0xa4cb,0x0000, -0xa565,0xa564,0x0000,0xca72,0x0000,0x0000,0xa8f6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc957,0x0000,0xa567,0xa566, -0xa64c,0xa64d,0xca73,0xa759,0x0000,0xa75a,0x0000,0xa8f7, -0xa8f8,0xa8f9,0x0000,0xab6f,0xcdf5,0x0000,0x0000,0xadeb, -0x0000,0x0000,0xc944,0x0000,0xa4cc,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc9c4,0x0000,0x0000,0x0000,0xca74,0xca75, -0x0000,0x0000,0xcbd9,0x0000,0xcbda,0x0000,0xcdf7,0xcdf6, -0xcdf9,0xcdf8,0xab70,0x0000,0xd470,0xaded,0xd0ef,0xadec, -0x0000,0x0000,0x0000,0x0000,0xd864,0xb3d6,0x0000,0xd865, -0x0000,0x0000,0x0000,0x0000,0xe146,0xb9bd,0x0000,0x0000, -0x0000,0x0000,0xbc46,0x0000,0xf1ef,0x0000,0x0000,0x0000, -0x0000,0xc958,0x0000,0xa568,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xb0d1,0x0000,0x0000,0x0000,0x0000, -0xa453,0xa465,0xa4ce,0xa4cd,0x0000,0xa4cf,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa8fb,0x0000,0xa8fa,0xa8fc, -0x0000,0x0000,0x0000,0xab71,0x0000,0x0000,0x0000,0xadee, -0x0000,0xe8fb,0xc24f,0xa466,0xa56a,0xa579,0xa574,0x0000, -0xa56f,0xa56e,0xa575,0xa573,0xa56c,0xa57a,0xa56d,0xa569, -0xa578,0xa577,0xa576,0xa56b,0x0000,0xa572,0x0000,0x0000, -0xa571,0x0000,0x0000,0xa57b,0xa570,0x0000,0x0000,0x0000, -/* 0x5400 */ -0x0000,0xa653,0x0000,0xa659,0xa655,0x0000,0xa65b,0xc9c5, -0xa658,0xa64e,0xa651,0xa654,0xa650,0xa657,0xa65a,0xa64f, -0xa652,0xa656,0xa65c,0x0000,0x0000,0x0000,0x0000,0x0000, -0xca7e,0xca7b,0x0000,0xa767,0xca7c,0xa75b,0xa75d,0xa775, -0xa770,0x0000,0x0000,0x0000,0xcaa5,0xca7d,0xa75f,0xa761, -0xcaa4,0xa768,0xca78,0xa774,0xa776,0xa75c,0xa76d,0x0000, -0xca76,0xa773,0x0000,0xa764,0x0000,0xa76e,0xa76f,0xca77, -0xa76c,0xa76a,0x0000,0xa76b,0xa771,0xcaa1,0xa75e,0x0000, -0xa772,0xcaa3,0xa766,0xa763,0x0000,0xca7a,0xa762,0xcaa6, -0xa765,0x0000,0xa769,0x0000,0x0000,0x0000,0xa760,0xcaa2, -0x0000,0x0000,0x0000,0x0000,0xca79,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcbeb,0xcbea,0xa94f,0xcbed,0xcbef,0xcbe4,0xcbe7,0xcbee, -0xa950,0x0000,0x0000,0xcbe1,0xcbe5,0x0000,0x0000,0xcbe9, -0xce49,0xa94b,0xce4d,0xa8fd,0xcbe6,0xa8fe,0xa94c,0xa945, -0xa941,0x0000,0xcbe2,0xa944,0xa949,0xa952,0xcbe3,0xcbdc, -0xa943,0xcbdd,0xcbdf,0x0000,0xa946,0x0000,0xa948,0xcbdb, -0xcbe0,0x0000,0x0000,0xa951,0xa94d,0xcbe8,0xa953,0x0000, -0xa94a,0xcbde,0xa947,0x0000,0x0000,0xa942,0xa940,0x0000, -0xcbec,0x0000,0xa94e,0x0000,0x0000,0x0000,0x0000,0x0000, -0xce48,0xcdfb,0xce4b,0x0000,0x0000,0xcdfd,0xab78,0xaba8, -0xab74,0xaba7,0xab7d,0xaba4,0xab72,0xcdfc,0xce43,0xaba3, -0xce4f,0xaba5,0x0000,0xab79,0x0000,0x0000,0xce45,0xce42, -0xab77,0x0000,0xcdfa,0xaba6,0xce4a,0xab7c,0xce4c,0xaba9, -0xab73,0xab7e,0xab7b,0xce40,0xaba1,0xce46,0xce47,0xab7a, -0xaba2,0xab76,0x0000,0x0000,0x0000,0x0000,0xab75,0xcdfe, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xce44,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xce4e,0x0000, -0xd144,0xadfb,0xd0f1,0x0000,0xd0f6,0xadf4,0xae40,0xd0f4, -0xadef,0xadf9,0xadfe,0xd0fb,0x0000,0xadfa,0xadfd,0x0000, -0x0000,0xd0fe,0xadf5,0xd0f5,0x0000,0x0000,0x0000,0xd142, -0xd143,0x0000,0xadf7,0xd141,0xadf3,0xae43,0x0000,0xd0f8, -/* 0x5500 */ -0x0000,0xadf1,0x0000,0xd146,0xd0f9,0xd0fd,0xadf6,0xae42, -0xd0fa,0xadfc,0xd140,0xd147,0xd4a1,0x0000,0xd145,0xae44, -0xadf0,0xd0fc,0xd0f3,0x0000,0xadf8,0x0000,0x0000,0xd0f2, -0x0000,0x0000,0xd0f7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0f0,0xae41, -0x0000,0x0000,0xd477,0x0000,0xb0e4,0xd4a7,0xb0e2,0xb0df, -0xd47c,0xb0db,0xd4a2,0xb0e6,0xd476,0xd47b,0xd47a,0xadf2, -0xb0e1,0xd4a5,0x0000,0xd4a8,0xd473,0x0000,0xb3e8,0x0000, -0xd4a9,0xb0e7,0x0000,0xb0d9,0xb0d6,0xd47e,0xb0d3,0x0000, -0xd4a6,0x0000,0xb0da,0xd4aa,0x0000,0xd474,0xd4a4,0xb0dd, -0xd475,0xd478,0xd47d,0x0000,0x0000,0xb0de,0xb0dc,0xb0e8, -0x0000,0x0000,0x0000,0x0000,0xb0e3,0x0000,0xb0d7,0xb1d2, -0x0000,0xb0d8,0xd479,0xb0e5,0xb0e0,0xd4a3,0xb0d5,0x0000, -0x0000,0x0000,0xb0d4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd471,0xd472,0xd86a, -0x0000,0x0000,0x0000,0xb3d7,0xb3da,0xd875,0xb3ee,0xd878, -0xb3d8,0xd871,0xb3de,0xb3e4,0xb5bd,0x0000,0x0000,0xb3e2, -0xd86e,0xb3ef,0xb3db,0xb3e3,0xd876,0xdcd7,0xd87b,0xd86f, -0x0000,0xd866,0xd873,0xd86d,0xb3e1,0xd879,0x0000,0x0000, -0xb3dd,0xb3f1,0xb3ea,0x0000,0xb3df,0xb3dc,0x0000,0xb3e7, -0x0000,0xd87a,0xd86c,0xd872,0xd874,0xd868,0xd877,0xb3d9, -0xd867,0x0000,0xb3e0,0xb3f0,0xb3ec,0xd869,0xb3e6,0x0000, -0x0000,0xb3ed,0xb3e9,0xb3e5,0x0000,0xd870,0x0000,0x0000, -0x0000,0x0000,0x0000,0xb3eb,0x0000,0x0000,0x0000,0xdcd5, -0xdcd1,0x0000,0xdce0,0xdcca,0xdcd3,0xb6e5,0xb6e6,0xb6de, -0xdcdc,0xb6e8,0xdccf,0xdcce,0xdccc,0xdcde,0xb6dc,0xdcd8, -0xdccd,0xb6df,0xdcd6,0xb6da,0xdcd2,0xdcd9,0xdcdb,0x0000, -0x0000,0xdcdf,0xb6e3,0xdccb,0xb6dd,0xdcd0,0x0000,0xb6d8, -0x0000,0xb6e4,0xdcda,0xb6e0,0xb6e1,0xb6e7,0xb6db,0xa25f, -0xb6d9,0xdcd4,0x0000,0x0000,0x0000,0x0000,0x0000,0xb6e2, -0x0000,0x0000,0xdcdd,0x0000,0x0000,0x0000,0xb9cd,0xb9c8, -0x0000,0xe155,0xe151,0x0000,0xe14b,0xb9c2,0xb9be,0xe154, -0xb9bf,0xe14e,0xe150,0x0000,0xe153,0x0000,0xb9c4,0x0000, -0xb9cb,0xb9c5,0x0000,0x0000,0xe149,0xb9c6,0xb9c7,0xe14c, -0xb9cc,0x0000,0xe14a,0xe14f,0xb9c3,0xe148,0xb9c9,0xb9c1, -0x0000,0x0000,0x0000,0xb9c0,0xe14d,0xe152,0x0000,0xb9ca, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe147, -0x0000,0xbc4d,0xe547,0x0000,0xe544,0x0000,0xbc47,0xbc53, -0xbc54,0x0000,0xbc4a,0xe542,0xbc4c,0xe4f9,0xbc52,0x0000, -0xe546,0xbc49,0xe548,0xbc48,0x0000,0xe543,0xe545,0xbc4b, -0xe541,0xe4fa,0xe4f7,0x0000,0x0000,0xd86b,0xe4fd,0x0000, -0xe4f6,0xe4fc,0xe4fb,0x0000,0xe4f8,0x0000,0xbc4f,0x0000, -0x0000,0x0000,0x0000,0xbc4e,0x0000,0x0000,0x0000,0xbc50, -0xe4fe,0xbeb2,0xe540,0x0000,0x0000,0x0000,0xe945,0x0000, -0xe8fd,0x0000,0xbebe,0xe942,0xbeb6,0xbeba,0xe941,0x0000, -0xbeb9,0xbeb5,0xbeb8,0xbeb3,0xbebd,0xe943,0xe8fe,0xbebc, -0xe8fc,0xbebb,0xe944,0xe940,0xbc51,0x0000,0xbebf,0xe946, -0xbeb7,0xbeb4,0x0000,0x0000,0x0000,0x0000,0xecc6,0xecc8, -0xc07b,0xecc9,0xecc7,0xecc5,0xecc4,0xc07d,0xecc3,0xc07e, -0x0000,0x0000,0x0000,0x0000,0xecc1,0xecc2,0xc07a,0xc0a1, -0xc07c,0x0000,0x0000,0xecc0,0x0000,0xc250,0x0000,0xefbc, -0xefba,0xefbf,0xefbd,0x0000,0xefbb,0xefbe,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xc360,0xf1f2,0xf1f3, -0xc456,0x0000,0xf1f4,0xf1f0,0xf1f5,0xf1f1,0xc251,0x0000, -0x0000,0x0000,0xf3fe,0xf441,0xc459,0xf440,0xc458,0xc457, -0x0000,0x0000,0x0000,0x0000,0xc45a,0xf5c5,0xf5c6,0x0000, -0xc4da,0xc4d9,0xc4db,0xf5c4,0x0000,0xf6d8,0xf6d7,0x0000, -0xc56d,0xc56f,0xc56e,0xf6d9,0xc5c8,0xf8a6,0x0000,0x0000, -0x0000,0xc5f1,0x0000,0xf8a5,0xf8ee,0x0000,0x0000,0xc949, -0x0000,0x0000,0xa57d,0xa57c,0x0000,0xa65f,0xa65e,0xc9c7, -0xa65d,0xc9c6,0x0000,0x0000,0xa779,0xcaa9,0x0000,0xcaa8, -0x0000,0x0000,0xa777,0xa77a,0x0000,0x0000,0xcaa7,0x0000, -0xa778,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbf0, -0x0000,0xcbf1,0xa954,0x0000,0x0000,0x0000,0x0000,0xabaa, -/* 0x5700 */ -0x0000,0xd148,0xd149,0xae45,0xae46,0x0000,0x0000,0xd4ac, -0xb0e9,0xb0eb,0xd4ab,0xb0ea,0xd87c,0xb3f2,0x0000,0x0000, -0x0000,0x0000,0xb6e9,0xb6ea,0xdce1,0x0000,0xb9cf,0x0000, -0xb9ce,0x0000,0xe549,0xe948,0xe947,0x0000,0xf96b,0xa467, -0xc959,0x0000,0xc96e,0xc96f,0x0000,0x0000,0x0000,0x0000, -0xa662,0xa666,0xc9c9,0x0000,0xa664,0xa663,0xc9c8,0xa665, -0xa661,0x0000,0x0000,0xa660,0xc9ca,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa7a6,0x0000,0x0000,0xa7a3,0x0000, -0xa77d,0xcaaa,0x0000,0x0000,0x0000,0xcaab,0x0000,0xa7a1, -0x0000,0xcaad,0xa77b,0xcaae,0xcaac,0xa77e,0xa7a2,0xa7a5, -0xa7a4,0xa77c,0xcaaf,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa959,0xcbfe,0x0000,0xa95b,0x0000,0xa95a,0x0000, -0xcc40,0xa958,0xa957,0xcbf5,0x0000,0xcbf4,0x0000,0xcbf2, -0xcbf7,0xcbf6,0xcbf3,0xcbfc,0xcbfd,0xcbfa,0xcbf8,0xa956, -0x0000,0x0000,0x0000,0xcbfb,0xa95c,0xcc41,0x0000,0x0000, -0xcbf9,0x0000,0xabab,0xa955,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xabac,0xce54,0x0000,0x0000,0xce5a, -0x0000,0x0000,0x0000,0xabb2,0xce58,0xce5e,0x0000,0xce55, -0xce59,0xce5b,0xce5d,0xce57,0x0000,0xce56,0xce51,0xce52, -0xabad,0x0000,0xabaf,0xabae,0xce53,0xce5c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xabb1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xce50,0xd153,0x0000, -0xd152,0xd157,0xd14e,0x0000,0xd151,0xd150,0x0000,0xd154, -0x0000,0xd158,0xae47,0xae4a,0x0000,0x0000,0xd14f,0xd155, -0x0000,0x0000,0x0000,0xae49,0xd14a,0x0000,0xabb0,0xd4ba, -0xd156,0x0000,0xd14d,0x0000,0xae48,0xd14c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4b1,0x0000,0x0000,0xb0ec, -0xb0f0,0xd4c1,0xd4af,0xd4bd,0xb0f1,0xd4bf,0x0000,0xd4c5, -0x0000,0xd4c9,0x0000,0x0000,0xd4c0,0xd4b4,0xd4bc,0x0000, -0xd4ca,0xd4c8,0xd4be,0xd4b9,0xd4b2,0xd8a6,0xd4b0,0xb0f5, -0xd4b7,0xb0f6,0xb0f2,0xd4ad,0xd4c3,0xd4b5,0x0000,0x0000, -0xd4b3,0xd4c6,0xb0f3,0x0000,0xd4cc,0xb0ed,0xb0ef,0xd4bb, -0xd4b6,0xae4b,0xb0ee,0xd4b8,0xd4c7,0xd4cb,0xd4c2,0x0000, -0xd4c4,0x0000,0x0000,0x0000,0xd4ae,0x0000,0x0000,0x0000, -0x0000,0xd8a1,0x0000,0xd8aa,0xd8a9,0xb3fa,0xd8a2,0x0000, -0xb3fb,0xb3f9,0x0000,0xd8a4,0xb3f6,0xd8a8,0x0000,0xd8a3, -0xd8a5,0xd87d,0xb3f4,0x0000,0xd8b2,0xd8b1,0xd8ae,0xb3f3, -0xb3f7,0xb3f8,0xd14b,0xd8ab,0xb3f5,0xb0f4,0xd8ad,0xd87e, -0xd8b0,0xd8af,0x0000,0xd8b3,0x0000,0xdcef,0x0000,0xd8ac, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd8a7,0xdce7,0xb6f4,0xb6f7,0xb6f2,0xdce6,0xdcea,0xdce5, -0x0000,0xb6ec,0xb6f6,0xdce2,0xb6f0,0xdce9,0x0000,0xb6ee, -0xb6ed,0xdcec,0xb6ef,0xdcee,0x0000,0xdceb,0xb6eb,0x0000, -0x0000,0x0000,0xb6f5,0xdcf0,0xdce4,0xdced,0x0000,0x0000, -0xdce3,0x0000,0x0000,0xb6f1,0x0000,0xb6f3,0x0000,0xdce8, -0x0000,0xdcf1,0x0000,0x0000,0xe15d,0xb9d0,0xe163,0x0000, -0x0000,0xb9d5,0xe15f,0xe166,0xe157,0xb9d7,0xb9d1,0xe15c, -0xbc55,0xe15b,0xe164,0xb9d2,0x0000,0xb9d6,0xe15a,0xe160, -0xe165,0xe156,0xb9d4,0xe15e,0x0000,0x0000,0xe162,0xe168, -0xe158,0xe161,0x0000,0xb9d3,0xe167,0x0000,0x0000,0x0000, -0xe159,0x0000,0x0000,0x0000,0xbc59,0xe54b,0xbc57,0xbc56, -0xe54d,0xe552,0x0000,0xe54e,0x0000,0xe551,0xbc5c,0x0000, -0xbea5,0xbc5b,0x0000,0xe54a,0xe550,0x0000,0xbc5a,0xe54f, -0x0000,0xe54c,0x0000,0xbc58,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe94d,0xf9d9,0xe94f,0xe94a,0xbec1,0xe94c, -0x0000,0xbec0,0xe94e,0x0000,0x0000,0xbec3,0xe950,0xbec2, -0xe949,0xe94b,0x0000,0x0000,0x0000,0x0000,0xc0a5,0xeccc, -0x0000,0xc0a4,0xeccd,0xc0a3,0xeccb,0xc0a2,0xecca,0x0000, -0xc253,0xc252,0xf1f6,0xf1f8,0x0000,0xf1f7,0xc361,0xc362, -0x0000,0x0000,0xc363,0xf442,0xc45b,0x0000,0x0000,0xf7d3, -0xf7d2,0xc5f2,0x0000,0xa468,0xa4d0,0x0000,0x0000,0xa7a7, -0x0000,0x0000,0x0000,0x0000,0xce5f,0x0000,0x0000,0x0000, -0x0000,0xb3fc,0xb3fd,0x0000,0xdcf2,0xb9d8,0xe169,0xe553, -/* 0x5900 */ -0x0000,0x0000,0x0000,0xc95a,0x0000,0x0000,0xcab0,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcc42,0xce60,0xd159,0xae4c, -0x0000,0x0000,0xf1f9,0x0000,0xc4dc,0xa469,0xa57e,0xc970, -0x0000,0xa667,0xa668,0x0000,0xa95d,0x0000,0x0000,0x0000, -0xb0f7,0x0000,0xb9da,0x0000,0xb9db,0xb9d9,0x0000,0xa46a, -0x0000,0xa4d1,0xa4d3,0xa4d2,0xc95b,0xa4d4,0xa5a1,0xc971, -0x0000,0xa5a2,0x0000,0x0000,0x0000,0x0000,0x0000,0xa669, -0xa66a,0x0000,0x0000,0x0000,0xc9cb,0x0000,0xa7a8,0x0000, -0xcab1,0x0000,0x0000,0x0000,0xa961,0xcc43,0x0000,0xa95f, -0xa960,0xa95e,0xd15a,0x0000,0x0000,0x0000,0xabb6,0xabb5, -0xabb7,0xabb4,0x0000,0xce61,0xa962,0xabb3,0x0000,0xae4d, -0xae4e,0x0000,0xae4f,0x0000,0xd4cd,0x0000,0x0000,0x0000, -0xb3fe,0xd8b4,0xb0f8,0x0000,0x0000,0x0000,0x0000,0xb6f8, -0x0000,0xb9dd,0xb9dc,0xe16a,0x0000,0xbc5d,0xbec4,0x0000, -0xefc0,0xf6da,0xf7d4,0xa46b,0xa5a3,0x0000,0xa5a4,0xc9d1, -0xa66c,0xa66f,0x0000,0xc9cf,0xc9cd,0xa66e,0xc9d0,0xc9d2, -0xc9cc,0xa671,0xa670,0xa66d,0xa66b,0xc9ce,0x0000,0x0000, -0x0000,0x0000,0xa7b3,0x0000,0x0000,0xa7b0,0xcab6,0xcab9, -0xcab8,0x0000,0xa7aa,0xa7b2,0x0000,0x0000,0xa7af,0xcab5, -0xcab3,0xa7ae,0x0000,0x0000,0x0000,0xa7a9,0xa7ac,0x0000, -0xcab4,0xcabb,0xcab7,0xa7ad,0xa7b1,0xa7b4,0xcab2,0xcaba, -0xa7ab,0x0000,0x0000,0x0000,0x0000,0x0000,0xa967,0xa96f, -0x0000,0xcc4f,0xcc48,0xa970,0xcc53,0xcc44,0xcc4b,0x0000, -0x0000,0xa966,0xcc45,0xa964,0xcc4c,0xcc50,0xa963,0x0000, -0xcc51,0xcc4a,0x0000,0xcc4d,0x0000,0xa972,0xa969,0xcc54, -0xcc52,0x0000,0xa96e,0xa96c,0xcc49,0xa96b,0xcc47,0xcc46, -0xa96a,0xa968,0xa971,0xa96d,0xa965,0x0000,0xcc4e,0x0000, -0xabb9,0x0000,0xabc0,0xce6f,0xabb8,0xce67,0xce63,0x0000, -0xce73,0xce62,0x0000,0xabbb,0xce6c,0xabbe,0xabc1,0x0000, -0xabbc,0xce70,0xabbf,0x0000,0xae56,0xce76,0xce64,0x0000, -0x0000,0xce66,0xce6d,0xce71,0xce75,0xce72,0xce6b,0xce6e, -0x0000,0x0000,0xce68,0xabc3,0xce6a,0xce69,0xce74,0xabba, -0xce65,0xabc2,0x0000,0xabbd,0x0000,0x0000,0x0000,0x0000, -0x0000,0xae5c,0xd162,0x0000,0xae5b,0x0000,0x0000,0xd160, -0x0000,0xae50,0x0000,0xae55,0x0000,0xd15f,0xd15c,0xd161, -0xae51,0xd15b,0x0000,0xae54,0xae52,0x0000,0xd163,0xae53, -0xae57,0x0000,0x0000,0xae58,0x0000,0xae5a,0x0000,0x0000, -0x0000,0xae59,0x0000,0x0000,0x0000,0xd15d,0xd15e,0x0000, -0x0000,0x0000,0x0000,0xd164,0x0000,0xd4d4,0xb0f9,0xd8c2, -0xd4d3,0xd4e6,0x0000,0x0000,0xb140,0x0000,0xd4e4,0x0000, -0xb0fe,0xb0fa,0xd4ed,0xd4dd,0xd4e0,0x0000,0xb143,0xd4ea, -0xd4e2,0xb0fb,0xb144,0x0000,0xd4e7,0xd4e5,0x0000,0x0000, -0xd4d6,0xd4eb,0xd4df,0xd4da,0x0000,0xd4d0,0xd4ec,0xd4dc, -0xd4cf,0x0000,0xb142,0xd4e1,0xd4ee,0xd4de,0xd4d2,0xd4d7, -0xd4ce,0x0000,0xb141,0x0000,0xd4db,0xd4d8,0xb0fc,0xd4d1, -0x0000,0xd4e9,0xb0fd,0x0000,0xd4d9,0xd4d5,0x0000,0x0000, -0xd4e8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb440, -0xd8bb,0x0000,0xd8b8,0xd8c9,0xd8bd,0xd8ca,0x0000,0xb442, -0x0000,0x0000,0x0000,0xd8c6,0xd8c3,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd8c4,0xd8c7,0xd8cb,0x0000,0xd4e3,0xd8cd, -0xdd47,0x0000,0xb443,0xd8ce,0xd8b6,0xd8c0,0x0000,0xd8c5, -0x0000,0x0000,0xb441,0xb444,0xd8cc,0xd8cf,0xd8ba,0xd8b7, -0x0000,0x0000,0xd8b9,0x0000,0x0000,0xd8be,0xd8bc,0xb445, -0x0000,0xd8c8,0x0000,0x0000,0xd8bf,0x0000,0xd8c1,0xd8b5, -0xdcfa,0xdcf8,0xb742,0xb740,0xdd43,0xdcf9,0xdd44,0xdd40, -0xdcf7,0xdd46,0xdcf6,0xdcfd,0xb6fe,0xb6fd,0xb6fc,0xdcfb, -0xdd41,0xb6f9,0xb741,0x0000,0xdcf4,0x0000,0xdcfe,0xdcf3, -0xdcfc,0xb6fa,0xdd42,0xdcf5,0xb6fb,0xdd45,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe16e,0xb9e2,0xb9e1, -0xb9e3,0xe17a,0xe170,0xe176,0xe16b,0xe179,0xe178,0xe17c, -0xe175,0xb9de,0xe174,0xb9e4,0x0000,0xe16d,0xb9df,0x0000, -0xe17b,0xb9e0,0xe16f,0xe172,0xe177,0xe171,0xe16c,0x0000, -0x0000,0x0000,0x0000,0xe173,0xe555,0xbc61,0xe558,0xe557, -0xe55a,0xe55c,0xf9dc,0xbc5f,0x0000,0xe556,0x0000,0xe554, -/* 0x5b00 */ -0x0000,0xe55d,0xe55b,0xe559,0x0000,0xe55f,0x0000,0xe55e, -0xbc63,0xbc5e,0x0000,0xbc60,0xbc62,0x0000,0x0000,0xe560, -0xe957,0x0000,0x0000,0xe956,0xe955,0x0000,0xe958,0xe951, -0x0000,0xe952,0xe95a,0xe953,0x0000,0xbec5,0xe95c,0x0000, -0xe95b,0xe954,0x0000,0xecd1,0xc0a8,0xeccf,0xecd4,0xecd3, -0xe959,0x0000,0xc0a7,0x0000,0xecd2,0xecce,0xecd6,0xecd5, -0xc0a6,0x0000,0xecd0,0x0000,0xbec6,0x0000,0x0000,0x0000, -0xc254,0x0000,0x0000,0x0000,0xefc1,0xf1fa,0xf1fb,0xf1fc, -0xc45c,0x0000,0x0000,0xc45d,0x0000,0xf443,0x0000,0xf5c8, -0xf5c7,0x0000,0x0000,0xf6db,0xf6dc,0xf7d5,0xf8a7,0x0000, -0xa46c,0xa46d,0x0000,0xa46e,0xa4d5,0xa5a5,0xc9d3,0xa672, -0xa673,0x0000,0xa7b7,0xa7b8,0xa7b6,0xa7b5,0x0000,0xa973, -0x0000,0x0000,0xcc55,0xa975,0xa974,0xcc56,0x0000,0x0000, -0x0000,0xabc4,0x0000,0xae5d,0xd165,0x0000,0xd4f0,0x0000, -0xb145,0xb447,0xd4ef,0xb446,0x0000,0xb9e5,0x0000,0xe17d, -0xbec7,0x0000,0xc0a9,0xecd7,0x0000,0xc45e,0x0000,0xc570, -0x0000,0xc972,0x0000,0xa5a6,0xc973,0xa676,0x0000,0xa674, -0xa675,0xa677,0x0000,0xa7ba,0xa7b9,0x0000,0xcabc,0xa7bb, -0x0000,0x0000,0xcabd,0xcc57,0x0000,0xcc58,0x0000,0xa976, -0xa978,0xa97a,0xa977,0xa97b,0xa979,0x0000,0x0000,0x0000, -0x0000,0x0000,0xabc8,0xabc5,0xabc7,0xabc9,0xabc6,0xd166, -0xce77,0x0000,0x0000,0x0000,0xd168,0xd167,0xae63,0x0000, -0xae5f,0x0000,0x0000,0xae60,0xae62,0xae64,0xae61,0x0000, -0xae66,0xae65,0x0000,0x0000,0x0000,0x0000,0x0000,0xb14a, -0xd4f2,0xd4f1,0xb149,0x0000,0xb148,0xb147,0xb14b,0xb146, -0x0000,0x0000,0xd8d5,0xd8d2,0xb449,0xd8d1,0xd8d6,0x0000, -0xb44b,0xd8d4,0xb448,0xb44a,0xd8d3,0x0000,0xdd48,0x0000, -0xdd49,0xdd4a,0x0000,0x0000,0x0000,0x0000,0xb9e6,0xb9ee, -0xe17e,0xb9e8,0xb9ec,0xe1a1,0xb9ed,0xb9e9,0xb9ea,0xb9e7, -0xb9eb,0xbc66,0xd8d0,0xbc67,0xbc65,0x0000,0xbc64,0xe95d, -0xbec8,0xecd8,0xecd9,0x0000,0x0000,0xc364,0xc45f,0x0000, -0xa46f,0x0000,0xa678,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5c00 */ -0x0000,0xabca,0x0000,0xd169,0xae67,0x0000,0x0000,0xb14e, -0xb14d,0xb14c,0xb44c,0xb44d,0xd8d7,0xb9ef,0xbec9,0xa470, -0xc95c,0xa4d6,0xc974,0x0000,0x0000,0xc9d4,0xa679,0x0000, -0x0000,0x0000,0xa97c,0x0000,0x0000,0x0000,0x0000,0xdd4b, -0x0000,0x0000,0xa471,0x0000,0xa4d7,0xc9d5,0x0000,0x0000, -0xcabe,0x0000,0xcabf,0x0000,0xa7bc,0x0000,0x0000,0x0000, -0xd8d8,0xb44e,0x0000,0xdd4c,0x0000,0x0000,0x0000,0xc0aa, -0xa472,0xa4a8,0xa4d8,0xc975,0xa5a7,0x0000,0xa7c0,0xa7bf, -0xa7bd,0xa7be,0x0000,0x0000,0xcc59,0xa97e,0xa9a1,0xcc5a, -0xa97d,0x0000,0x0000,0xabce,0xce78,0xabcd,0xabcb,0xabcc, -0xae6a,0xae68,0x0000,0x0000,0xd16b,0xae69,0xd16a,0x0000, -0xae5e,0xd4f3,0x0000,0x0000,0xb150,0xb151,0x0000,0x0000, -0xb14f,0x0000,0xb9f0,0xe1a2,0xbc68,0xbc69,0x0000,0xe561, -0xc0ab,0xefc2,0xefc3,0x0000,0xc4dd,0xf8a8,0xc94b,0xa4d9, -0x0000,0xa473,0x0000,0xc977,0xc976,0x0000,0x0000,0x0000, -0x0000,0xa67a,0xc9d7,0xc9d8,0xc9d6,0x0000,0xc9d9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcac7,0x0000, -0xcac2,0xcac4,0xcac6,0xcac3,0xa7c4,0xcac0,0x0000,0xcac1, -0xa7c1,0xa7c2,0xcac5,0xcac8,0xa7c3,0xcac9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcc68,0x0000,0xcc62, -0xcc5d,0xa9a3,0xcc65,0xcc63,0xcc5c,0xcc69,0xcc6c,0xcc67, -0xcc60,0xa9a5,0xcc66,0xa9a6,0xcc61,0xcc64,0xcc5b,0xcc5f, -0xcc6b,0xa9a7,0x0000,0xa9a8,0x0000,0xcc5e,0xcc6a,0xa9a2, -0xa9a4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xceab,0xcea4, -0xceaa,0xcea3,0xcea5,0xce7d,0xce7b,0x0000,0xceac,0xcea9, -0xce79,0x0000,0xabd0,0xcea7,0xcea8,0x0000,0xcea6,0xce7c, -0xce7a,0xabcf,0xcea2,0xce7e,0x0000,0x0000,0xcea1,0xcead, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xae6f,0x0000,0xae6e,0x0000,0xd16c,0xae6b,0xd16e,0x0000, -0xae70,0xd16f,0x0000,0x0000,0xae73,0x0000,0xae71,0xd170, -0xceae,0xd172,0x0000,0xae6d,0x0000,0xae6c,0x0000,0xd16d, -0xd171,0xae72,0x0000,0x0000,0x0000,0x0000,0xb153,0xb152, -0x0000,0x0000,0x0000,0xd4f5,0xd4f9,0xd4fb,0xb154,0xd4fe, -0x0000,0xb158,0xd541,0x0000,0xb15a,0x0000,0xb156,0xb15e, -0x0000,0xb15b,0xd4f7,0xb155,0x0000,0xd4f6,0xd4f4,0xd543, -0xd4f8,0x0000,0xb157,0xd542,0xb15c,0xd4fd,0xd4fc,0xb15d, -0xd4fa,0xb159,0x0000,0x0000,0x0000,0x0000,0xd544,0x0000, -0xd540,0xd8e7,0xd8ee,0xd8e3,0xb451,0xd8df,0xd8ef,0xd8d9, -0xd8ec,0xd8ea,0xd8e4,0x0000,0xd8ed,0xd8e6,0x0000,0xd8de, -0xd8f0,0xd8dc,0xd8e9,0xd8da,0x0000,0xd8f1,0x0000,0xb452, -0x0000,0xd8eb,0xdd4f,0xd8dd,0xb44f,0x0000,0xd8e1,0x0000, -0xb450,0xd8e0,0xd8e5,0x0000,0x0000,0xd8e2,0x0000,0x0000, -0x0000,0xd8e8,0x0000,0x0000,0x0000,0x0000,0xdd53,0x0000, -0x0000,0x0000,0xdd56,0xdd4e,0x0000,0xdd50,0x0000,0xdd55, -0xdd54,0xb743,0x0000,0xd8db,0xdd52,0x0000,0x0000,0xb744, -0x0000,0xdd4d,0xdd51,0x0000,0x0000,0x0000,0x0000,0xe1a9, -0x0000,0xe1b0,0xe1a7,0x0000,0xe1ae,0xe1a5,0xe1ad,0xe1b1, -0xe1a4,0xe1a8,0xe1a3,0x0000,0xb9f1,0x0000,0xe1a6,0xb9f2, -0xe1ac,0xe1ab,0xe1aa,0x0000,0x0000,0xe1af,0x0000,0x0000, -0x0000,0x0000,0xe565,0xe567,0xbc6b,0xe568,0x0000,0xe563, -0x0000,0xe562,0xe56c,0x0000,0xe56a,0xbc6a,0xe56d,0xe564, -0xe569,0xe56b,0xe566,0x0000,0x0000,0x0000,0x0000,0xe961, -0xe966,0xe960,0xe965,0x0000,0xe95e,0xe968,0xe964,0xe969, -0xe963,0xe95f,0xe967,0x0000,0xe96a,0xe962,0x0000,0xecda, -0xc0af,0x0000,0xc0ad,0x0000,0xc0ac,0xc0ae,0x0000,0x0000, -0xefc4,0x0000,0xf172,0xf1fd,0x0000,0x0000,0xf444,0xf445, -0x0000,0xc460,0x0000,0xf5c9,0x0000,0xc4de,0x0000,0xf5ca, -0x0000,0xf6de,0xc572,0x0000,0xc571,0xf6dd,0xc5c9,0x0000, -0xf7d6,0x0000,0x0000,0x0000,0x0000,0xa474,0xa67b,0xc9da, -0xcaca,0xa8b5,0xb15f,0x0000,0x0000,0xa475,0xa5aa,0xa5a9, -0xa5a8,0x0000,0x0000,0xa7c5,0x0000,0x0000,0xae74,0x0000, -0xdd57,0xa476,0xa477,0xa478,0xa4da,0x0000,0x0000,0xabd1, -0x0000,0xceaf,0x0000,0x0000,0x0000,0xb453,0xa479,0xc95d, -/* 0x5e00 */ -0x0000,0x0000,0xa5ab,0xa5ac,0xc978,0x0000,0xa67c,0x0000, -0x0000,0x0000,0xcacb,0x0000,0xa7c6,0x0000,0xcacc,0x0000, -0x0000,0xa9ae,0x0000,0x0000,0xcc6e,0xa9ac,0xa9ab,0xcc6d, -0xa9a9,0xcc6f,0xa9aa,0xa9ad,0x0000,0xabd2,0x0000,0xabd4, -0xceb3,0xceb0,0xceb1,0xceb2,0xceb4,0xabd3,0x0000,0x0000, -0xd174,0xd173,0x0000,0xae76,0x0000,0xae75,0x0000,0x0000, -0x0000,0x0000,0x0000,0xb162,0xd546,0x0000,0xb161,0xb163, -0xb160,0x0000,0x0000,0x0000,0x0000,0xb455,0xd545,0x0000, -0xb456,0xd8f3,0x0000,0xb457,0xd8f2,0xb454,0x0000,0x0000, -0x0000,0x0000,0xdd5a,0xdd5c,0xb745,0xdd5b,0xdd59,0xdd58, -0x0000,0x0000,0x0000,0xe1b4,0xb9f7,0xb9f5,0x0000,0xb9f6, -0xe1b2,0xe1b3,0x0000,0xb9f3,0xe571,0xe56f,0x0000,0xbc6d, -0xe570,0xbc6e,0xbc6c,0xb9f4,0x0000,0x0000,0xe96d,0xe96b, -0xe96c,0xe56e,0xecdc,0xc0b0,0xecdb,0xefc5,0xefc6,0xe96e, -0xf1fe,0x0000,0xa47a,0xa5ad,0xa67e,0xc9db,0xa67d,0x0000, -0xa9af,0xb746,0x0000,0xa4db,0xa5ae,0xabd5,0xb458,0x0000, -0xc979,0x0000,0xc97a,0x0000,0xc9dc,0x0000,0x0000,0xa7c8, -0xcad0,0xcace,0xa7c9,0xcacd,0xcacf,0xcad1,0x0000,0xa7c7, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa9b3,0xa9b4,0xa9b1, -0x0000,0x0000,0xa9b0,0xceb8,0xa9b2,0x0000,0x0000,0x0000, -0xabd6,0x0000,0xceb7,0xceb9,0xceb6,0xceba,0xabd7,0xae79, -0xd175,0x0000,0xd177,0xae77,0xd178,0xae78,0xd176,0x0000, -0xceb5,0xd547,0xd54a,0xd54b,0xd548,0xb167,0xb166,0xb164, -0xb165,0xd549,0x0000,0x0000,0x0000,0x0000,0xb168,0x0000, -0x0000,0xb45a,0xb45b,0x0000,0xb45c,0xdd5d,0xdd5f,0xdd61, -0xb748,0xb747,0xb459,0xdd60,0xdd5e,0x0000,0xe1b8,0x0000, -0x0000,0xe1b6,0xe1bc,0xb9f8,0xe1bd,0xe1ba,0xb9f9,0xe1b7, -0xe1b5,0xe1bb,0xbc70,0xe573,0xe1b9,0xbc72,0xe574,0xbc71, -0xbc74,0xe575,0xbc6f,0xbc73,0x0000,0xe973,0xe971,0xe970, -0xe972,0xe96f,0x0000,0x0000,0xc366,0x0000,0xf446,0xf447, -0x0000,0xf5cb,0xf6df,0xc655,0x0000,0x0000,0xa9b5,0xa7ca, -0x0000,0x0000,0xabd8,0x0000,0x0000,0x0000,0xa47b,0xa4dc, -/* 0x5f00 */ -0x0000,0xa5af,0xc9dd,0x0000,0xa7cb,0xcad2,0x0000,0xcebb, -0xabd9,0x0000,0xb9fa,0xa47c,0x0000,0x0000,0x0000,0xa6a1, -0x0000,0x0000,0xb749,0xa47d,0xa4dd,0xa4de,0x0000,0xa5b1, -0xa5b0,0x0000,0xc9de,0xa6a2,0x0000,0xcad3,0x0000,0xa7cc, -0x0000,0x0000,0xcc71,0xcc72,0xcc73,0x0000,0xa9b6,0xa9b7, -0xcc70,0xa9b8,0x0000,0x0000,0x0000,0xabda,0xcebc,0x0000, -0xd17a,0xae7a,0x0000,0xd179,0x0000,0xb169,0xd54c,0xb16a, -0xd54d,0x0000,0x0000,0x0000,0xb45d,0x0000,0x0000,0x0000, -0xdd62,0x0000,0x0000,0xe1bf,0xe1be,0x0000,0xb9fb,0x0000, -0xbc75,0xe576,0xbeca,0xe974,0xc0b1,0x0000,0xc573,0xf7d8, -0x0000,0x0000,0x0000,0x0000,0xcc74,0x0000,0xcebd,0xb16b, -0xd8f4,0xb74a,0x0000,0x0000,0x0000,0xc255,0x0000,0x0000, -0x0000,0x0000,0xa7ce,0x0000,0xa7cd,0xabdb,0x0000,0xd17b, -0x0000,0xb16d,0xb343,0xb16e,0xb16c,0xb45e,0x0000,0xe1c0, -0xb9fc,0xbc76,0x0000,0xc94c,0xc9df,0x0000,0xcad5,0xa7cf, -0xcad4,0xa7d0,0x0000,0x0000,0xa9bc,0xcc77,0xcc76,0xa9bb, -0xa9b9,0xa9ba,0xcc75,0x0000,0x0000,0xabdd,0xcebe,0xabe0, -0xabdc,0xabe2,0xabde,0xabdf,0xabe1,0x0000,0x0000,0x0000, -0xae7d,0xae7c,0xae7b,0x0000,0x0000,0x0000,0xd54f,0xb16f, -0xb172,0xb170,0x0000,0xd54e,0xb175,0x0000,0xb171,0xd550, -0xb174,0xb173,0x0000,0x0000,0x0000,0xd8f6,0xd8f5,0x0000, -0xb461,0xb45f,0xb460,0xd8f7,0xb74b,0xdd64,0xb74c,0xdd63, -0x0000,0x0000,0xe577,0x0000,0x0000,0xbc78,0xe1c1,0xbc77, -0x0000,0xb9fd,0x0000,0xecde,0xe975,0xc0b2,0xecdd,0xf240, -0xf448,0xf449,0x0000,0xa4df,0x0000,0xa5b2,0x0000,0x0000, -0x0000,0xc97b,0x0000,0x0000,0xa7d2,0xa7d4,0x0000,0xc9e2, -0xcad8,0xcad7,0xcad6,0x0000,0xc9e1,0xc9e0,0xa6a4,0xa7d3, -0xa7d1,0xa6a3,0x0000,0x0000,0x0000,0xa9bd,0xcc78,0x0000, -0xa9be,0xcadd,0x0000,0xcadf,0xcade,0xcc79,0x0000,0x0000, -0xcada,0x0000,0xa7d8,0xa7d6,0x0000,0xcad9,0xcadb,0xcae1, -0x0000,0xa7d5,0x0000,0xcadc,0xcae5,0xa9c0,0x0000,0xcae2, -0xa7d7,0x0000,0xcae0,0xcae3,0x0000,0xa9bf,0x0000,0xa9c1, -0xcae4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xccaf,0xcca2,0xcc7e,0xccae,0xcca9,0xabe7,0xa9c2, -0xccaa,0xccad,0xabe3,0xccac,0xa9c3,0xa9c8,0xa9c6,0xcca3, -0x0000,0xcc7c,0xcca5,0xa9cd,0xccb0,0xabe4,0xcca6,0x0000, -0xabe5,0xa9c9,0xcca8,0x0000,0xcecd,0xabe6,0xcc7b,0xa9ca, -0xabe8,0xa9cb,0xa9c7,0xa9cc,0xcca7,0xcc7a,0xccab,0xa9c4, -0x0000,0x0000,0xcc7d,0xcca4,0xcca1,0xa9c5,0x0000,0xcebf, -0x0000,0xcec0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xceca,0xd1a1,0xcecb,0xabee,0xcece,0xcec4,0xabed,0xcec6, -0x0000,0xcec7,0x0000,0x0000,0xcec9,0xabe9,0x0000,0x0000, -0xaea3,0x0000,0xf9da,0xcec5,0xcec1,0xaea4,0x0000,0x0000, -0xcecf,0xae7e,0xd17d,0xcec8,0x0000,0xd17c,0xcec3,0xcecc, -0x0000,0x0000,0xabec,0xaea1,0xabf2,0xaea2,0xced0,0xd17e, -0xabeb,0xaea6,0xabf1,0xabf0,0xabef,0xaea5,0xced1,0xaea7, -0xabea,0x0000,0xcec2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb176, -0xd1a4,0xd1a6,0x0000,0xd1a8,0xaea8,0xaeae,0xd553,0xd1ac, -0xd1a3,0xb178,0xd551,0x0000,0xaead,0xaeab,0xd1ae,0x0000, -0xd552,0x0000,0xd1a5,0x0000,0xaeac,0xd1a9,0xaeaf,0xd1ab, -0x0000,0x0000,0xaeaa,0xd1aa,0xd1ad,0xd1a7,0x0000,0xaea9, -0xb179,0x0000,0xd1a2,0xb177,0x0000,0x0000,0x0000,0x0000, -0xb17a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd555,0xd55e,0xb464,0x0000,0xb17c,0xb1a3,0xb465,0xd560, -0xb1aa,0xd8f9,0xd556,0xb1a2,0xb1a5,0xb17e,0xd554,0xd562, -0xd565,0xd949,0x0000,0xd563,0xd8fd,0xb1a1,0xb1a8,0xb1ac, -0xd55d,0xd8f8,0xd561,0xb17b,0xd8fa,0xd564,0xd8fc,0xd559, -0x0000,0xb462,0x0000,0xd557,0xd558,0xb1a7,0x0000,0x0000, -0xb1a6,0xd55b,0xb1ab,0xd55f,0xb1a4,0xd55c,0x0000,0xb1a9, -0xb466,0xb463,0xd8fb,0x0000,0xd55a,0x0000,0xb17d,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb46b,0xb46f,0xd940,0xb751,0xb46d,0xd944,0xb471,0xdd65, -0xd946,0xb753,0xb469,0xb46c,0xd947,0x0000,0xd948,0xd94e, -0xb473,0xb754,0x0000,0xd94a,0xd94f,0xd943,0xb75e,0x0000, -0xb755,0xb472,0xd941,0xd950,0x0000,0xb75d,0xb470,0xb74e, -0xd94d,0x0000,0xb474,0xd945,0xd8fe,0xb46a,0xd942,0x0000, -0xd94b,0x0000,0xb74d,0xb752,0xb467,0xd94c,0x0000,0xb750, -0x0000,0x0000,0x0000,0xb468,0x0000,0x0000,0x0000,0xb75c, -0xe1c3,0xdd70,0x0000,0xdd68,0xe1c2,0x0000,0xdd6c,0xdd6e, -0x0000,0x0000,0xdd6b,0x0000,0xb75b,0x0000,0xdd6a,0xb75f, -0x0000,0x0000,0x0000,0xe1d2,0x0000,0x0000,0xb75a,0xba40, -0xdd71,0xe1c4,0x0000,0x0000,0xb758,0xdd69,0xdd6d,0xb9fe, -0xb74f,0xdd66,0xdd67,0xba41,0xb757,0xb759,0xb756,0xdd6f, -0x0000,0x0000,0xe1c8,0xe1c9,0xe1ce,0xbc7d,0xe1d5,0x0000, -0xba47,0x0000,0xba46,0xe1d0,0x0000,0xbc7c,0xe1c5,0xba45, -0x0000,0xe1d4,0xba43,0xba44,0x0000,0xe1d1,0xe5aa,0xbc7a, -0xb46e,0x0000,0xe1d3,0xbca3,0xe1cb,0x0000,0xbc7b,0x0000, -0xbca2,0xe1c6,0xe1ca,0xe1c7,0xe1cd,0xba48,0xbc79,0xba42, -0x0000,0xe57a,0xe1cf,0x0000,0xbca1,0x0000,0xbca4,0x0000, -0xe1cc,0x0000,0xbc7e,0xe579,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe57e,0xbece,0xe578,0xe9a3,0xe5a9,0xbca8,0x0000, -0xbca6,0xbecc,0xe5a6,0xe5a2,0xbcac,0x0000,0xe978,0x0000, -0x0000,0x0000,0xbcaa,0xe5a1,0x0000,0xe976,0x0000,0xe5a5, -0x0000,0xe5a8,0xe57d,0x0000,0xbcab,0x0000,0x0000,0xbca5, -0xe977,0xbecd,0xe5a7,0xbca7,0xbca9,0xe5a4,0xbcad,0xe5a3, -0xe57c,0xe57b,0xbecb,0xe5ab,0xe97a,0xece0,0xbed0,0x0000, -0xe9a2,0x0000,0xe97e,0x0000,0xece1,0x0000,0xbed1,0xe9a1, -0x0000,0xe97c,0xc0b4,0xecdf,0x0000,0xe979,0xe97b,0xc0b5, -0xbed3,0xc0b3,0xbed2,0xc0b7,0xe97d,0xbecf,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xefcf,0x0000, -0xefc7,0x0000,0x0000,0x0000,0x0000,0x0000,0xece7,0xefc8, -0xece3,0x0000,0x0000,0xc256,0xece5,0xece4,0xc0b6,0xece2, -0xece6,0xefd0,0xefcc,0xefce,0x0000,0xefc9,0xefca,0x0000, -0xefcd,0xefcb,0xc367,0x0000,0x0000,0xc36a,0xc369,0xc368, -0xc461,0xf44a,0xc462,0xf241,0xc4df,0xf5cc,0xc4e0,0xc574, -0xc5ca,0xf7d9,0x0000,0xf7da,0xf7db,0x0000,0x0000,0xf9ba, -0xa4e0,0xc97c,0xa5b3,0x0000,0xa6a6,0xa6a7,0xa6a5,0x0000, -0xa6a8,0xa7da,0xa7d9,0x0000,0xccb1,0xa9cf,0xa9ce,0x0000, -0x0000,0xd1af,0xb1ad,0xb1ae,0x0000,0x0000,0x0000,0xb475, -0xdd72,0xb760,0xb761,0xdd74,0xdd76,0xdd75,0x0000,0xe1d7, -0x0000,0xe1d6,0xba49,0xe1d8,0x0000,0xe5ac,0xbcae,0x0000, -0xbed4,0x0000,0xc0b8,0xc257,0xc0b9,0x0000,0xa4e1,0x0000, -0x0000,0x0000,0xcae6,0x0000,0x0000,0xccb2,0xa9d1,0xa9d0, -0xa9d2,0xabf3,0xced2,0xced3,0x0000,0x0000,0xd1b0,0xaeb0, -0xb1af,0xb476,0xd951,0xa4e2,0x0000,0xa47e,0xa4e3,0x0000, -0xc97d,0xa5b7,0xa5b6,0xa5b4,0xa5b5,0x0000,0x0000,0x0000, -0xa6ab,0xc9e9,0xc9eb,0xa6aa,0xc9e3,0x0000,0xc9e4,0x0000, -0xc9ea,0xc9e6,0xc9e8,0xa6a9,0xc9e5,0xc9ec,0xc9e7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa7e1,0xa7ea,0xa7e8, -0xcaf0,0xcaed,0xcaf5,0xa7e6,0xcaf6,0x0000,0xa7df,0xcaf3, -0x0000,0xa7e5,0xcaef,0xcaee,0xa7e3,0xcaf4,0xa7e4,0xa9d3, -0xa7de,0xcaf1,0x0000,0xcae7,0xa7db,0x0000,0xa7ee,0xcaec, -0xcaf2,0xa7e0,0xa7e2,0x0000,0xcae8,0x0000,0xcae9,0xcaea, -0x0000,0xa7ed,0xa7e7,0xa7ec,0xcaeb,0xa7eb,0xa7dd,0xa7dc, -0xa7e9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa9e1,0xccbe,0xccb7,0xa9dc,0xa9ef,0xccb3,0xccba,0xccbc, -0xccbf,0xa9ea,0x0000,0xccbb,0xccb4,0xa9e8,0xccb8,0x0000, -0xccc0,0xa9d9,0x0000,0xccbd,0xa9e3,0xa9e2,0xccb6,0xa9d7, -0x0000,0x0000,0xa9d8,0x0000,0xa9d6,0x0000,0xa9ee,0xa9e6, -0xa9e0,0xa9d4,0xccb9,0xa9df,0xa9d5,0xa9e7,0xa9f0,0xced4, -0xa9e4,0xccb5,0xa9da,0xa9dd,0xa9de,0x0000,0xa9ec,0xa9ed, -0xa9eb,0xa9e5,0xa9e9,0xa9db,0xabf4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xceda,0xac41,0xabf8,0xabfa,0xac40, -0xcee6,0xabfd,0xd1b1,0xaeb1,0xac43,0xced7,0xcedf,0xabfe, -0xcede,0xcedb,0xcee3,0xcee5,0xabf7,0xabfb,0xac42,0xaeb3, -0xcee0,0xabf9,0xac45,0xced9,0x0000,0x0000,0x0000,0xabfc, -0xaeb2,0xabf6,0x0000,0xced6,0xcedd,0xced5,0xced8,0xcedc, -0xd1b2,0xac44,0x0000,0xcee1,0xcee2,0xcee4,0xabf5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xaec1,0xd1be,0xaebf,0xaec0,0xd1b4,0xd1c4,0x0000,0xaeb6, -0x0000,0x0000,0xd566,0xd1c6,0xd1c0,0x0000,0xd1b7,0x0000, -0xd1c9,0xd1ba,0xaebc,0xd57d,0xd1bd,0xaebe,0xaeb5,0x0000, -0xd1cb,0xd1bf,0xaeb8,0xd1b8,0xd1b5,0xd1b6,0xaeb9,0xd1c5, -0xd1cc,0xaebb,0xd1bc,0xd1bb,0xaec3,0xaec2,0xaeb4,0xaeba, -0xaebd,0xd1c8,0x0000,0x0000,0xd1c2,0xaeb7,0xd1b3,0xd1ca, -0xd1c1,0xd1c3,0xd1c7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd567,0x0000,0xb1b7, -0xb1cb,0xb1ca,0x0000,0xb1bf,0x0000,0xd579,0xd575,0xd572, -0xd5a6,0xb1ba,0xb1b2,0x0000,0x0000,0xd577,0xb4a8,0xb1b6, -0xd5a1,0x0000,0xb1cc,0xb1c9,0xd57b,0xd56a,0x0000,0x0000, -0xb1c8,0xd5a3,0xd569,0xb1bd,0xb1c1,0xd5a2,0x0000,0xd573, -0xb1c2,0xb1bc,0xd568,0x0000,0xb478,0xd5a5,0xd571,0xb1c7, -0xd574,0xd5a4,0xb1c6,0x0000,0xd952,0x0000,0xb1b3,0xd56f, -0xb1b8,0xb1c3,0x0000,0xb1be,0xd578,0xd56e,0xd56c,0xd57e, -0xb1b0,0xb1c4,0xb1b4,0xb477,0xd57c,0xb1b5,0x0000,0xb1b1, -0xb1c0,0xb1bb,0xb1b9,0xd570,0xb1c5,0xd56d,0xd57a,0xd576, -0xd954,0xd953,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd56b,0xd964,0x0000, -0xb47a,0x0000,0xd96a,0xd959,0xd967,0xdd77,0xb47d,0xd96b, -0xd96e,0xb47c,0xd95c,0xd96d,0xd96c,0xb47e,0xd955,0xb479, -0xb4a3,0x0000,0xb4a1,0xd969,0x0000,0xd95f,0xb4a5,0xd970, -0xd968,0xd971,0xb4ad,0xb4ab,0xd966,0xd965,0x0000,0xd963, -0xd95d,0xb4a4,0x0000,0xb4a2,0xd1b9,0xd956,0x0000,0xddb7, -0xd957,0xb47b,0xb4aa,0xdd79,0x0000,0xb4a6,0xb4a7,0xd958, -0xd96f,0xdd78,0xd960,0xd95b,0xb4a9,0xd961,0xd95e,0x0000, -0x0000,0xb4ae,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x6400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb770,0x0000, -0x0000,0xdd7c,0xddb1,0xddb6,0xddaa,0xb76c,0xddbb,0xb769, -0xdd7a,0x0000,0xdd7b,0xb762,0xb76b,0xdda4,0xb76e,0xb76f, -0xdda5,0x0000,0xddb2,0xddb8,0xb76a,0x0000,0xb764,0xdda3, -0xdd7d,0xddba,0xdda8,0xdda9,0xdd7e,0xddb4,0xddab,0xddb5, -0xddad,0x0000,0xb765,0xe1d9,0xb768,0xb766,0xddb9,0xddb0, -0xddac,0x0000,0x0000,0xdda1,0xba53,0xddaf,0xb76d,0xdda7, -0x0000,0xdda6,0x0000,0x0000,0x0000,0xb767,0xb763,0xe1ee, -0xddb3,0xddae,0x0000,0xdda2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe1e9,0x0000,0xe1da,0xe1e5,0x0000, -0xe1ec,0xba51,0xb4ac,0xe1ea,0xba4c,0x0000,0x0000,0x0000, -0xba4b,0xe1f1,0x0000,0xe1db,0xe1e8,0xe1dc,0xe1e7,0xba4f, -0xe1eb,0xd962,0x0000,0x0000,0x0000,0xe1f2,0xe1e3,0xba52, -0xe5ba,0xbcaf,0x0000,0xe1f0,0xe1ef,0xba54,0xe5ad,0xbcb0, -0xe5ae,0x0000,0xe1df,0xe1e0,0xe1dd,0xe1e2,0xe1de,0xe1f3, -0xba4e,0xbcb1,0xba50,0xba55,0x0000,0xe1e1,0x0000,0xe1ed, -0x0000,0x0000,0xe1e6,0x0000,0x0000,0xe5b1,0x0000,0xba4a, -0xbcb4,0xe9aa,0xe5b6,0xe5b5,0xe5b7,0x0000,0x0000,0xe5b4, -0xbcb5,0x0000,0xbcbb,0xbcb8,0x0000,0xbcb9,0xe5af,0xe5b2, -0xe5bc,0xbcc1,0xbcbf,0x0000,0xe5b3,0xd95a,0xbcb2,0xe5b9, -0xe5b0,0x0000,0xbcc2,0xe5b8,0xba4d,0xbcb7,0xe1e4,0x0000, -0x0000,0xbcba,0x0000,0xbcbe,0xbcc0,0xbcbd,0xbcbc,0x0000, -0xbcb6,0xe5bb,0xbcb3,0xbcc3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xbed8,0xbed9,0xe9a9,0xbee2,0xbedf, -0x0000,0xbed6,0xbedd,0xe9ab,0xbedb,0xbed5,0x0000,0xbedc, -0x0000,0xe9a8,0xc0bb,0xbed7,0x0000,0xbede,0xc0ba,0xe9a7, -0xe9a6,0x0000,0xbee0,0x0000,0xbee1,0x0000,0xe9a5,0xe9a4, -0xc0bc,0xe9ae,0xbeda,0xe9ac,0x0000,0x0000,0x0000,0x0000, -0xc0bd,0x0000,0xc0c2,0xecea,0xecec,0x0000,0xc0bf,0x0000, -0xeced,0xece9,0x0000,0xeceb,0xc0c0,0xc0c3,0x0000,0xece8, -0xc0be,0xc0c1,0xc259,0xe9ad,0xc258,0x0000,0x0000,0xc25e, -0xefd4,0x0000,0xc25c,0xc25d,0xefd7,0xefd3,0xc25a,0xefd1, -0xc36b,0xefd5,0x0000,0xefd6,0xefd2,0x0000,0xc25b,0xf242, -0x0000,0xf245,0x0000,0x0000,0xf246,0xf244,0xf247,0xc36c, -0xf243,0x0000,0x0000,0xf44e,0xc464,0xf44d,0xf44c,0xf44b, -0xc463,0xc465,0x0000,0xf5cd,0xc4e2,0xc4e1,0x0000,0x0000, -0xf6e1,0xf6e0,0xf6e3,0xc5cb,0xc575,0xf7dd,0xf6e2,0x0000, -0x0000,0xf7dc,0xc5cd,0xc5cc,0xc5f3,0xf8a9,0xf8ef,0xa4e4, -0x0000,0x0000,0xd972,0xe9af,0x0000,0x0000,0xa6ac,0xcaf7, -0xa7f1,0xa7ef,0x0000,0xa7f0,0x0000,0xccc1,0xa9f1,0xac46, -0x0000,0xcee7,0x0000,0xcee8,0x0000,0xac47,0xd1ce,0x0000, -0xaec4,0xaec5,0xd1cd,0x0000,0x0000,0x0000,0x0000,0xb1d3, -0x0000,0xb1cf,0x0000,0xd5a7,0xb1d6,0xb1d5,0xb1ce,0xb1d1, -0xb1d4,0xb1d0,0x0000,0x0000,0xd976,0xb1cd,0xb4af,0x0000, -0x0000,0x0000,0xb4b1,0xb4b2,0xd975,0xd978,0xb4b0,0xd973, -0xd977,0x0000,0xd974,0x0000,0xb771,0x0000,0x0000,0xddbc, -0x0000,0x0000,0xba56,0xe1f4,0xbee3,0xbcc4,0xe5bd,0xbcc5, -0xbcc6,0xe5bf,0xe5be,0xe5c0,0xe9b1,0x0000,0x0000,0xe9b0, -0xecef,0xecee,0xc0c4,0xc0c5,0xf248,0x0000,0x0000,0xa4e5, -0x0000,0x0000,0x0000,0x0000,0xd979,0x0000,0x0000,0x0000, -0xb4b4,0xb4b3,0xddbd,0x0000,0xefd8,0xc4e3,0xf7de,0xa4e6, -0x0000,0xaec6,0x0000,0xb1d8,0xb1d7,0xd97a,0xd97b,0xb772, -0xe1f5,0xba57,0xe9b2,0x0000,0xa4e7,0xa5b8,0x0000,0xa9f2, -0xccc2,0x0000,0xcee9,0xac48,0xb1d9,0x0000,0xd97c,0xb4b5, -0xb773,0x0000,0xe5c1,0xe5c2,0x0000,0x0000,0xecf0,0xc25f, -0xf8f0,0xa4e8,0x0000,0xccc3,0xa9f3,0xac49,0x0000,0xceea, -0x0000,0xaec7,0xd1d2,0xd1d0,0xd1d1,0xaec8,0xd1cf,0x0000, -0x0000,0x0000,0x0000,0xb1db,0xb1dc,0xd5a8,0xb1dd,0xb1da, -0xd97d,0x0000,0xd97e,0xddbe,0x0000,0x0000,0xba59,0xba58, -0x0000,0x0000,0xecf1,0xefd9,0x0000,0xf24a,0xf249,0xf44f, -0x0000,0xc95e,0xac4a,0x0000,0x0000,0xa4e9,0xa5b9,0x0000, -0xa6ae,0xa6ad,0x0000,0x0000,0xa6af,0xa6b0,0xc9ee,0xc9ed, -0xcaf8,0xa7f2,0xcafb,0xcafa,0xcaf9,0xcafc,0x0000,0x0000, -0x0000,0x0000,0xa9f4,0xccc9,0xccc5,0xccce,0x0000,0x0000, -0xa9fb,0x0000,0xa9f9,0xccca,0xccc6,0xcccd,0xa9f8,0xaa40, -0xccc8,0xccc4,0xa9fe,0xcccb,0xa9f7,0xcccc,0xa9fa,0xa9fc, -0xccd0,0xcccf,0xccc7,0xa9f6,0xa9f5,0xa9fd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xceef,0xcef5,0x0000,0xac50, -0xac4d,0xceec,0xcef1,0x0000,0xac53,0xac4b,0xcef0,0xac4e, -0xac51,0x0000,0x0000,0xcef3,0x0000,0xac4c,0xcef8,0xac4f, -0x0000,0xac52,0xceed,0xcef2,0xcef6,0xceee,0xceeb,0x0000, -0x0000,0xcef7,0xcef4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xaed0,0xaec9,0xaecc,0x0000,0xaecf,0x0000,0xd1d5, -0x0000,0xaeca,0xd1d3,0x0000,0xaece,0x0000,0x0000,0xaecb, -0x0000,0xd1d6,0xaecd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd5ac,0xb1df,0xd5ab,0xd5ad,0xb1de,0xb1e3,0xd1d4, -0x0000,0xd5aa,0xd5ae,0x0000,0xb1e0,0xd5a9,0xb1e2,0x0000, -0xb1e1,0x0000,0xd9a7,0x0000,0xd9a2,0x0000,0xb4b6,0xb4ba, -0xb4b7,0xd9a5,0xd9a8,0x0000,0xb4b8,0x0000,0xb4b9,0xb4be, -0xddc7,0xd9a6,0xb4bc,0xd9a3,0xd9a1,0x0000,0xb4bd,0x0000, -0xd9a4,0x0000,0x0000,0x0000,0xb779,0x0000,0xddbf,0xb776, -0xb777,0xb775,0xddc4,0xddc3,0xddc0,0xb77b,0x0000,0x0000, -0xddc2,0xb4bb,0x0000,0x0000,0xddc6,0xddc1,0xb778,0xb774, -0xb77a,0xddc5,0x0000,0x0000,0x0000,0xba5c,0x0000,0xe1f8, -0xe1f7,0xe1f6,0xba5a,0x0000,0x0000,0x0000,0x0000,0x0000, -0xba5b,0xe5c5,0xe5c8,0xbcc8,0x0000,0x0000,0xbcc7,0xe5c9, -0xe5c4,0xbcca,0xe5c6,0x0000,0xbcc9,0xe5c3,0x0000,0xe5c7, -0xbee9,0xbee6,0xe9bb,0xe9ba,0x0000,0xe9b9,0xe9b4,0x0000, -0xe9b5,0x0000,0x0000,0x0000,0xbee7,0x0000,0xbee4,0xbee8, -0xe9b3,0xbee5,0xe9b6,0xe9b7,0xe9bc,0x0000,0x0000,0xe9b8, -0x0000,0x0000,0xecf2,0x0000,0x0000,0x0000,0xc0c7,0x0000, -0xefdc,0xc0c6,0xefda,0xefdb,0xc260,0xc36e,0xf24b,0x0000, -0xc36d,0x0000,0x0000,0xf451,0xf452,0x0000,0xc466,0x0000, -0xf450,0xc4e4,0x0000,0xf7df,0xc5ce,0xf8aa,0xf8ab,0x0000, -0xa4ea,0x0000,0xa6b1,0xa6b2,0xa7f3,0x0000,0xccd1,0xac54, -0xaed1,0xb1e4,0x0000,0x0000,0xb0d2,0x0000,0xb4bf,0xb4c0, -0xb3cc,0xd9a9,0x0000,0xb77c,0xe1fa,0xe1f9,0x0000,0x0000, -0xa4eb,0xa6b3,0xccd2,0xaa42,0x0000,0xaa41,0x0000,0xcef9, -0xcefa,0x0000,0xd1d7,0xd1d8,0xaed2,0xaed3,0x0000,0xaed4, -0xd5af,0x0000,0x0000,0xb1e6,0x0000,0xb4c2,0x0000,0xb4c1, -0xddc8,0xdf7a,0xe1fb,0xe9bd,0x0000,0x0000,0xc261,0xc467, -0xa4ec,0x0000,0xa5bc,0xa5bd,0xa5bb,0xa5be,0xa5ba,0x0000, -0x0000,0xa6b6,0x0000,0xc9f6,0xa6b5,0xa6b7,0x0000,0x0000, -0xc9f1,0xc9f0,0xc9f3,0xc9f2,0xc9f5,0xa6b4,0xc9ef,0xc9f4, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcafd,0xa7fd,0xcafe, -0xcb43,0xa7fc,0x0000,0xcb47,0xcb42,0xcb45,0xa7f5,0xa7f6, -0xa7f7,0xa7f8,0x0000,0xa840,0x0000,0xcb41,0xa7fa,0xa841, -0x0000,0xcb40,0xcb46,0x0000,0xa7f9,0xcb44,0xa7fb,0xa7f4, -0xa7fe,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xaa57,0x0000,0xccd4,0xaa43,0x0000,0xaa4d, -0xaa4e,0xaa46,0xaa58,0xaa48,0xccdc,0xaa53,0xccd7,0xaa49, -0xcce6,0xcce7,0xccdf,0xccd8,0xaa56,0xcce4,0xaa51,0xaa4f, -0x0000,0xcce5,0x0000,0xcce3,0xccdb,0xccd3,0xccda,0xaa4a, -0x0000,0xaa50,0x0000,0xaa44,0xccde,0xccdd,0xccd5,0x0000, -0xaa52,0xcce1,0xccd6,0xaa55,0xcce8,0xaa45,0x0000,0xaa4c, -0xccd9,0xcce2,0xaa54,0x0000,0xaa47,0xaa4b,0x0000,0xcce0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcf5b,0xac5c, -0xac69,0x0000,0xcf56,0xcf4c,0xac62,0xcf4a,0xac5b,0xcf45, -0xac65,0xcf52,0xcefe,0xcf41,0x0000,0x0000,0x0000,0x0000, -0xcf44,0xcefb,0xcf51,0xcf61,0xac60,0xcf46,0xcf58,0x0000, -0xcefd,0xcf5f,0xcf60,0xcf63,0xcf5a,0xcf4b,0xcf53,0xac66, -0xac59,0xac61,0xac6d,0xac56,0xac58,0x0000,0x0000,0x0000, -0xcf43,0xac6a,0xac63,0xcf5d,0xcf40,0xac6c,0xac67,0xcf49, -0x0000,0x0000,0xac6b,0xcf50,0xcf48,0xac64,0xcf5c,0xcf54, -0x0000,0xac5e,0xcf62,0xcf47,0xac5a,0xcf59,0xcf4f,0xac5f, -0xcf55,0xac57,0xcefc,0xac68,0xaee3,0xac5d,0xcf4e,0xcf4d, -0xcf42,0x0000,0xcf5e,0x0000,0xcf57,0x0000,0x0000,0xac55, -/* 0x6800 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd1ec,0xaeea,0xd1ed,0x0000,0xd1e1,0xaedf, -0xaeeb,0x0000,0xd1da,0x0000,0xd1e3,0xd1eb,0x0000,0xd1d9, -0xd1f4,0xaed5,0x0000,0x0000,0x0000,0xd1f3,0xd1ee,0x0000, -0xd1ef,0xaedd,0xaee8,0xd1e5,0x0000,0xd1e6,0xd1f0,0xd1e7, -0x0000,0xd1e2,0xd1dc,0xd1dd,0xd1ea,0xd1e4,0x0000,0x0000, -0xaed6,0xaeda,0xd1f2,0xd1de,0xaee6,0xaee2,0x0000,0x0000, -0xaee5,0xaeec,0xaedb,0xaee7,0xd1e9,0xaee9,0xaed8,0x0000, -0xaed7,0xd1db,0x0000,0xd1df,0xaee0,0xd1f1,0xd1e8,0xd1e0, -0xaee4,0xaee1,0x0000,0xaed9,0xaedc,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5c4,0x0000,0xd5b4,0xd5b5,0xd5b9, -0x0000,0xd5c8,0xd5c5,0x0000,0xd5be,0xd5bd,0xb1ed,0xd5c1, -0xd5d0,0xd5b0,0x0000,0xd5d1,0xd5c3,0xd5d5,0xd5c9,0xb1ec, -0xd5c7,0xb1e7,0xb1fc,0xb1f2,0x0000,0xb1f6,0xb1f5,0xd5b1, -0x0000,0xd5ce,0xd5d4,0xd5cc,0xd5d3,0x0000,0x0000,0xd5c0, -0xd5b2,0xd5d2,0xd5c2,0xb1ea,0xb1f7,0x0000,0xd5cb,0xb1f0, -0x0000,0x0000,0x0000,0xd5ca,0xd5b3,0xb1f8,0x0000,0xb1fa, -0xd5cd,0xb1fb,0xb1e9,0xd5ba,0xd5cf,0x0000,0x0000,0xb1ef, -0xb1f9,0xd5bc,0xd5c6,0xd5b7,0xd5bb,0xb1f4,0xd5b6,0xb1e8, -0xb1f1,0xb1ee,0xd5bf,0xaede,0xd9c0,0xb1eb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb1f3,0x0000,0xd9c3,0xd9d9, -0xd9ce,0xb4d6,0x0000,0xb4d1,0xd9bd,0xb4d2,0xd9cd,0x0000, -0xd9c6,0xd9d3,0xb4ce,0xd9ab,0xd9d5,0xb4c4,0xd9b3,0xb4c7, -0xb4c6,0x0000,0xb4d7,0x0000,0xd9ad,0xd9cf,0xd9d0,0xb4c9, -0xb4c5,0xd9bb,0x0000,0xb4d0,0xd9b6,0x0000,0xd9d1,0xb4cc, -0xd9c9,0xd9d6,0xd9b0,0xd9b5,0xd9af,0x0000,0xb4cb,0xd9c2, -0xddde,0xd9b1,0xb4cf,0xd9ba,0xd9d2,0xb4ca,0xd9b7,0xd9b4, -0xd9c5,0xb4cd,0xb4c3,0xb4d9,0xd9c8,0xd9c7,0x0000,0x0000, -/* 0x6900 */ -0x0000,0x0000,0x0000,0x0000,0xd9ac,0xb4c8,0xd9d4,0xd9bc, -0xd9be,0x0000,0xd9cb,0xd9ca,0xd9aa,0xb4d3,0xb4d5,0xd9b2, -0xd9b9,0xd9c1,0xb4d4,0xd9b8,0xd9c4,0xd9d7,0x0000,0xd9cc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd9d8,0x0000,0x0000, -0x0000,0x0000,0xd9ae,0x0000,0x0000,0x0000,0x0000,0xddf2, -0xb7a6,0x0000,0xddf0,0xdddb,0xdde0,0xddd9,0x0000,0xddec, -0xddcb,0xddd2,0x0000,0xddea,0xddf4,0xdddc,0x0000,0xddcf, -0xdde2,0xdde7,0xddd3,0x0000,0xdde4,0xddd0,0x0000,0x0000, -0xddd7,0xddd8,0xb7a8,0xddeb,0xdde9,0x0000,0xddcc,0xddee, -0x0000,0xddef,0xddf1,0xb7ac,0xb7a4,0x0000,0xd5b8,0xddd4, -0xdde6,0xddd5,0xb7a1,0xb7b1,0xdded,0xb7af,0xb7ab,0xddca, -0xb7a3,0x0000,0xddcd,0xb7b0,0x0000,0xdddd,0xddc9,0x0000, -0xb7a9,0xdde1,0xddd1,0xb7aa,0xddda,0xb77e,0xb4d8,0xdde3, -0xd9bf,0xddce,0x0000,0x0000,0xdde8,0xb7a5,0xdde5,0xb7a2, -0xdddf,0xb7ad,0xddd6,0xddf3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb7a7,0xdec6,0x0000,0x0000,0xb7ae,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe24a,0xe248,0x0000, -0xe25e,0xe246,0x0000,0xe258,0xb77d,0xba5f,0xe242,0xe25d, -0x0000,0xe247,0xe255,0xba64,0xba5d,0x0000,0xe25b,0x0000, -0xe240,0xe25a,0x0000,0xba6f,0xe251,0xe261,0xba6d,0xe249, -0xba5e,0xe24b,0xe259,0xba67,0xe244,0xba6b,0xba61,0xe24d, -0xe243,0xe1fc,0x0000,0xe257,0xba68,0xe260,0xe1fd,0xba65, -0x0000,0xe253,0x0000,0xba66,0xe245,0xe250,0xe24c,0xe24e, -0x0000,0xba60,0xe25f,0xba6e,0xe24f,0x0000,0xe262,0x0000, -0x0000,0xe1fe,0xe254,0xba63,0xba6c,0xba6a,0xe241,0xe256, -0xba69,0x0000,0x0000,0xba62,0xe252,0x0000,0x0000,0x0000, -0x0000,0xe25c,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe5d5,0x0000,0xe5d1,0xe5cd,0xe5e1,0xe5de, -0xbccd,0x0000,0x0000,0xe5e5,0xe5d4,0xbcd8,0xe5db,0x0000, -0x0000,0xe5d0,0xe5da,0xbcd5,0xe5ee,0x0000,0xe5eb,0xe5dd, -0xe5ce,0x0000,0x0000,0xe5e2,0xe5e4,0xbcd1,0xe5d8,0xe5d3, -0xe5ca,0xbcce,0xbcd6,0x0000,0xe5e7,0xbcd7,0xe5cb,0xe5ed, -0xe5e0,0xe5e6,0xbcd4,0x0000,0x0000,0xe5e3,0x0000,0xe5ea, -0x0000,0xbcd9,0x0000,0xbcd3,0xe5dc,0xe5cf,0xe5ef,0xe5cc, -0xe5e8,0xbcd0,0x0000,0xe5d6,0x0000,0xe5d7,0xbccf,0xbccc, -0xe5d2,0xbcd2,0x0000,0xbccb,0x0000,0xe5e9,0xe5ec,0xe5d9, -0xe9ca,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9c2,0x0000,0xe9be,0xbef6,0x0000,0x0000, -0xbeeb,0xbef0,0xbeec,0xe9cc,0xe9d7,0xbeea,0xe9c4,0xe9cd, -0xe5df,0xe9ce,0x0000,0x0000,0xbef1,0x0000,0xe9dd,0xbef5, -0xbef8,0xe9c0,0x0000,0xbef4,0x0000,0xe9db,0xe9dc,0xe9d2, -0xe9d1,0xe9c9,0x0000,0x0000,0xe9d3,0xe9da,0xe9d9,0x0000, -0xbeef,0xbeed,0xe9cb,0xe9c8,0x0000,0xe9c5,0xe9d8,0xbef7, -0xe9d6,0xbef3,0xbef2,0x0000,0xe9d0,0x0000,0xe9bf,0xe9c1, -0xe9c3,0xe9d5,0xe9cf,0xbeee,0x0000,0xe9c6,0x0000,0xe9d4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9c7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc0cf,0xed45, -0xc0c8,0xecf5,0x0000,0xed41,0xc0ca,0xed48,0x0000,0xecfc, -0x0000,0xecf7,0x0000,0x0000,0xed49,0xecf3,0xecfe,0x0000, -0xc0d1,0xed44,0xed4a,0xecfd,0xc0c9,0xed40,0xecf4,0xc0d0, -0x0000,0x0000,0xed47,0xecf9,0xc0cc,0x0000,0xecfb,0xecf8, -0xc0d2,0xecfa,0xc0cb,0xc0ce,0xed43,0xecf6,0xed46,0x0000, -0xed42,0x0000,0x0000,0x0000,0xc263,0xefe7,0xc268,0xc269, -0x0000,0x0000,0x0000,0xc262,0xefe6,0x0000,0xefe3,0xefe4, -0xc266,0xefde,0xefe2,0xc265,0x0000,0xefdf,0x0000,0x0000, -0x0000,0x0000,0xc267,0xc264,0x0000,0xefdd,0xefe1,0xefe5, -0x0000,0x0000,0x0000,0xf251,0xf24e,0xf257,0x0000,0xf256, -0xf254,0xf24f,0x0000,0xc372,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf250,0xc371,0xc0cd,0xf253,0xc370,0xf258,0xf252, -0xf24d,0xefe0,0x0000,0x0000,0x0000,0xc36f,0x0000,0xf24c, -0xf456,0x0000,0xf455,0xf255,0xc468,0x0000,0xf459,0xf45a, -0xf454,0xf458,0x0000,0xf453,0x0000,0x0000,0x0000,0x0000, -0xf5d1,0xf457,0xc4e7,0xc4e5,0xf5cf,0x0000,0x0000,0x0000, -0xf5d2,0x0000,0xf5ce,0xf5d0,0xc4e6,0x0000,0x0000,0x0000, -0xf6e5,0xf6e6,0xc576,0xf6e4,0x0000,0x0000,0x0000,0xf7e2, -0xc5cf,0xf7e0,0xf7e1,0xf8ac,0x0000,0x0000,0xc656,0xf8f3, -0xf8f1,0xf8f2,0xf8f4,0x0000,0x0000,0x0000,0xf9bb,0x0000, -0xa4ed,0xa6b8,0x0000,0xaa59,0x0000,0xcce9,0x0000,0x0000, -0xcf64,0x0000,0x0000,0x0000,0xd1f5,0xd1f7,0x0000,0xd1f6, -0x0000,0xd1f8,0xb1fd,0xd5d7,0xd1f9,0x0000,0xd5d6,0xd5d8, -0xd5d9,0xd9da,0xb4db,0xd9db,0xd9dd,0xb4dc,0xb4da,0xd9dc, -0x0000,0xddfa,0xddf8,0xddf7,0x0000,0xddf6,0xddf5,0xb7b2, -0xddf9,0xba70,0xe263,0xe265,0xba71,0xe264,0xbcdb,0x0000, -0xbcda,0xe5f0,0x0000,0x0000,0xe9df,0xe9de,0xe9e0,0x0000, -0x0000,0xbef9,0x0000,0xed4b,0xc0d3,0x0000,0xefe8,0xc26a, -0xf259,0xc577,0xa4ee,0xa5bf,0xa6b9,0xa842,0xaa5a,0xaa5b, -0x0000,0x0000,0xac6e,0x0000,0x0000,0xd1fa,0x0000,0x0000, -0x0000,0x0000,0xb7b3,0x0000,0x0000,0x0000,0xe6d1,0xbefa, -0xc26b,0xa4ef,0x0000,0xa6ba,0x0000,0x0000,0xcceb,0xaa5c, -0xccea,0x0000,0xcf65,0xac6f,0xcf66,0x0000,0xac70,0x0000, -0xd1fc,0xaeee,0xaeed,0x0000,0xd5de,0xd5dc,0xd5dd,0xd5db, -0x0000,0xd5da,0x0000,0x0000,0xd9de,0xd9e1,0xb4de,0xd9df, -0xb4dd,0xd9e0,0x0000,0xddfb,0x0000,0x0000,0xe266,0xe267, -0xe268,0x0000,0xe5f3,0xe5f2,0xbcdc,0xe5f1,0xe5f4,0xe9e1, -0x0000,0x0000,0xe9e2,0xe9e3,0x0000,0xed4c,0xc0d4,0xc26c, -0xf25a,0x0000,0xc4e8,0xc95f,0x0000,0xac71,0xcf67,0xaeef, -0x0000,0x0000,0xb1fe,0x0000,0xb4df,0xd9e2,0x0000,0xb7b5, -0xb7b4,0x0000,0x0000,0xe269,0xe26a,0xbcdd,0xbcde,0xe9e5, -0xe9e4,0xefe9,0xf7e3,0xa4f0,0xc960,0xa5c0,0x0000,0xa843, -0xcb48,0x0000,0xac72,0xb7b6,0xa4f1,0x0000,0xcf68,0xac73, -0xcf69,0x0000,0xc0d5,0xa4f2,0x0000,0x0000,0xccec,0x0000, -0xcf6a,0x0000,0xd242,0xd241,0xd1fe,0x0000,0xd1fd,0xd243, -0xd240,0x0000,0x0000,0xb240,0xb241,0x0000,0x0000,0xb4e0, -0xd9e3,0x0000,0xd9e4,0xd9e5,0x0000,0x0000,0x0000,0xde41, -0xde42,0xde40,0x0000,0xddfd,0xddfe,0xb7b7,0xe26b,0xe5f7, -0xe5f6,0xe5f5,0xe5f8,0xe9e7,0xe9e6,0xbefb,0xe9e8,0x0000, -0xc0d6,0xed4d,0x0000,0xefea,0xf25b,0xf6e7,0x0000,0xa4f3, -0xa5c2,0xa5c1,0x0000,0xaa5d,0xc961,0xc97e,0xa6bb,0x0000, -0xc9f7,0xcb49,0xcb4a,0xaa5e,0x0000,0xcced,0x0000,0xac74, -0xcf6b,0xcf6c,0x0000,0xaef0,0xaef4,0xd244,0xaef3,0xaef1, -0xaef2,0x0000,0xd5df,0xb242,0xb4e3,0x0000,0xb4e1,0xb4e2, -0xd9e6,0x0000,0x0000,0xba72,0xa4f4,0x0000,0xc9a1,0x0000, -0xa5c3,0x0000,0x0000,0xc9a4,0x0000,0x0000,0xa5c6,0xc9a3, -0xa5c5,0xa5c4,0xa844,0xc9a2,0x0000,0x0000,0xc9f8,0x0000, -0x0000,0x0000,0xc9fc,0xc9fe,0xca40,0xa6c5,0xa6c6,0xc9fb, -0xa6c1,0x0000,0xc9f9,0x0000,0xc9fd,0xa6c2,0x0000,0xa6bd, -0x0000,0xa6be,0x0000,0xa6c4,0xc9fa,0xa6bc,0xa845,0xa6bf, -0xa6c0,0xa6c3,0x0000,0x0000,0x0000,0xcb5b,0xcb59,0xcb4c, -0xa851,0xcb53,0xa84c,0xcb4d,0x0000,0xcb55,0x0000,0xcb52, -0xa84f,0xcb51,0xa856,0xcb5a,0xa858,0x0000,0xa85a,0x0000, -0xcb4b,0x0000,0xa84d,0xcb5c,0x0000,0xa854,0xa857,0x0000, -0xcd45,0xa847,0xa85e,0xa855,0xcb4e,0xa84a,0xa859,0xcb56, -0xa848,0xa849,0xcd43,0xcb4f,0xa850,0xa85b,0xcb5d,0xcb50, -0xa84e,0x0000,0xa853,0xccee,0xa85c,0xcb57,0xa852,0x0000, -0xa85d,0xa846,0xcb54,0xa84b,0xcb58,0xcd44,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xaa6a,0xaa7a,0xccf5,0xaa71,0x0000, -0xcd4b,0xaa62,0x0000,0xaa65,0xcd42,0x0000,0xccf3,0xccf7, -0xaa6d,0xaa6f,0xccfa,0xaa76,0xaa68,0xaa66,0xaa67,0xaa75, -0xcd47,0xaa70,0xccf9,0xccfb,0xaa6e,0xaa73,0xccfc,0xcd4a, -0x0000,0xac75,0xaa79,0x0000,0xaa63,0xcd49,0x0000,0xcd4d, -0xccf8,0xcd4f,0xcd40,0xaa6c,0xccf4,0xaa6b,0xaa7d,0xaa72, -0x0000,0xccf2,0xcf75,0xaa78,0xaa7c,0xcd41,0xcd46,0x0000, -0xaa7e,0xaa77,0xaa69,0xaa5f,0x0000,0xaa64,0x0000,0xccf6, -0xaa60,0xcd4e,0x0000,0xccf0,0xccef,0xccfd,0xccf1,0xaa7b, -0xaef5,0xaa74,0xccfe,0xaa61,0x0000,0xaca6,0x0000,0x0000, -0x0000,0xcd4c,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcf7c,0xcfa1,0x0000,0xcfa4,0xcf77,0x0000,0x0000,0xcfa7, -0xcfaa,0xcfac,0xcf74,0xac76,0xac7b,0xd249,0xacad,0xcfa5, -0xcfad,0xcf7b,0xcf73,0x0000,0x0000,0x0000,0xd264,0xac7e, -0xcfa2,0xcf78,0xcf7a,0xaca5,0x0000,0xcf7d,0xac7d,0xcf70, -0xcfa8,0x0000,0xcfab,0x0000,0x0000,0xac7a,0x0000,0xaca8, -0xcf6d,0xacaa,0xac78,0xacae,0xcfa9,0xcf6f,0xacab,0xd25e, -0xcd48,0xac7c,0xac77,0xcf76,0xcf6e,0xacac,0xaca4,0xcfa3, -0xaca9,0xaca7,0xcf79,0xaca1,0xcf71,0xaca2,0xaca3,0xcf72, -0xcfa6,0xac79,0xcf7e,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd24c,0xaefd,0xaf43,0x0000,0x0000,0x0000,0xd255,0xd25b, -0xd257,0xd24a,0xd24d,0xd246,0xd247,0xaf4a,0xaefa,0xd256, -0xd25f,0xaf45,0xaef6,0x0000,0xaf40,0xd24e,0xaf42,0xd24f, -0xd259,0x0000,0x0000,0x0000,0xaf44,0xd268,0xd248,0xaefc, -0xaefb,0xaf48,0xd245,0xd266,0xd25a,0xd267,0xd261,0xd253, -0xd262,0x0000,0xd25c,0xd265,0xd263,0xaf49,0xd254,0xaef9, -0xaef8,0xaf41,0xaf47,0xd260,0xaf46,0xd251,0xb243,0x0000, -0xd269,0xd250,0xd24b,0xaefe,0xaf4b,0xaef7,0x0000,0xd258, -0xd25d,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb265,0xd5e1,0xd5e5,0x0000,0xb252,0xb250, -0x0000,0x0000,0xb247,0xd5e3,0xd5e2,0xb25b,0x0000,0xd5e8, -0xb255,0x0000,0xd5fa,0xd647,0xb244,0xd5f7,0xd5f0,0xb267, -0xd5e0,0x0000,0xd5fc,0x0000,0xb264,0xb258,0xb263,0xb24e, -0xd5ec,0xd5fe,0xd5f6,0xb24f,0xb249,0xd645,0x0000,0xd5fd, -0xd640,0xb251,0xb259,0xd642,0xd5ea,0xd5fb,0xd5ef,0xd644, -0xb25e,0xb246,0xb25c,0xd5f4,0xd5f2,0xd5f3,0xb253,0xd5ee, -0xd5ed,0xb248,0xd5e7,0xd646,0xb24a,0xd5f1,0xb268,0x0000, -0xb262,0xd5e6,0xb25f,0xb25d,0xb266,0xd5f8,0xb261,0xd252, -0xd5f9,0xb260,0xd641,0xb245,0xd5f5,0xb257,0xd5e9,0xb256, -0x0000,0xb254,0xb24c,0xb24b,0xd9e7,0xd643,0x0000,0x0000, -0xd5eb,0x0000,0x0000,0xd9fc,0x0000,0xb24d,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xb541,0xb25a,0xb4ee,0xd9f6,0xb4fc,0x0000,0xd9ea, -0xb4eb,0xb4e7,0xda49,0xb4ed,0xb4f1,0xb4ec,0xb4f5,0xda4d, -0xda44,0x0000,0x0000,0xd9f1,0xb4fa,0xb4f4,0xd9fd,0xb4e4, -0xda4a,0xda43,0xb4e8,0xd9f7,0xb4f7,0xda55,0xda56,0x0000, -0xb4e5,0xda48,0xb4f9,0xd9fb,0xd9ed,0xd9ee,0xb4fd,0xd9f2, -0xd9f9,0xd9f3,0x0000,0xb4fb,0xb544,0xd9ef,0xd9e8,0xd9e9, -0x0000,0xd9eb,0xb4ea,0xd9f8,0x0000,0xb4f8,0xb542,0x0000, -0x0000,0xd9fa,0xda53,0xda4b,0xb4e6,0xda51,0xb4f2,0x0000, -0xb4f0,0x0000,0xda57,0xb4ef,0xda41,0xd9f4,0xd9fe,0xb547, -0xda45,0xda42,0xd9f0,0xb543,0xda4f,0xda4c,0xda54,0xb4e9, -0xda40,0xb546,0x0000,0xda47,0x0000,0x0000,0xb4f3,0xb4f6, -0x0000,0xda46,0xb545,0xd9f5,0xd5e4,0x0000,0x0000,0xda50, -0xda4e,0xda52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd9ec,0xb540,0x0000,0x0000,0x0000,0xde61,0xde60,0xde46, -0xb7bd,0x0000,0xde5f,0xde49,0xde4a,0x0000,0xb7c7,0xde68, -0xb7c2,0xde5e,0x0000,0xde43,0xb7c8,0xb7be,0xde52,0xde48, -0xde4b,0xde63,0xb7b8,0xde6a,0xde62,0xb7c1,0xde57,0xb7cc, -0x0000,0x0000,0xb7cb,0xb7c5,0x0000,0x0000,0xde69,0xb7b9, -0xde55,0xde4c,0xde59,0xde65,0xb7cd,0x0000,0xb7bb,0xde54, -0x0000,0xde4d,0xb7c4,0x0000,0xb7c3,0xde50,0xde5a,0xde64, -0xde47,0xde51,0xb7bc,0xde5b,0xb7c9,0xb7c0,0xde4e,0xb7bf, -0xde45,0xde53,0xde67,0xb4fe,0xbab0,0xde56,0xe26c,0xde58, -0xde66,0xb7c6,0xde4f,0xb7ba,0xb7ca,0xbcf0,0xde44,0x0000, -0xde5d,0x0000,0x0000,0x0000,0xde5c,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe2aa,0xbaad,0xe27d,0xe2a4,0xbaa2, -0x0000,0xe26e,0xbaaf,0x0000,0xba77,0xe26d,0xe2b0,0xbab1, -0xe271,0xe2a3,0x0000,0xe273,0xe2b3,0xe2af,0xba75,0xbaa1, -0xe653,0xbaae,0xba7d,0xe26f,0x0000,0xe2ae,0xbaa3,0xe2ab, -0xe2b8,0xe275,0xe27e,0x0000,0x0000,0xe2b6,0xe2ac,0xba7c, -0x0000,0x0000,0xe27c,0xba76,0xba74,0xbaa8,0x0000,0x0000, -0xe27a,0xe277,0xe278,0x0000,0xe2b2,0x0000,0xe2b7,0xe2b5, -0xba7a,0xe2b9,0xba7e,0xbaa7,0x0000,0xe270,0xe5fa,0xe279, -0x0000,0xba78,0xbaac,0xbaa9,0xba7b,0xe2a5,0xe274,0xbaaa, -0xe2a7,0xbaa4,0xbaa6,0xba73,0x0000,0xe2a9,0xe2a1,0xe272, -0xbaa5,0xe2b1,0xe2b4,0xe27b,0xe2a8,0x0000,0xba79,0xbcdf, -0xe2a6,0xe5f9,0x0000,0xe2ad,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe276,0xe644, -0xe64e,0xbce2,0xe64d,0xe659,0xbce4,0xe64b,0x0000,0xe64f, -0xbcef,0x0000,0xe646,0xbce7,0x0000,0xe652,0xe9f0,0xbcf3, -0xbcf2,0xe654,0xe643,0xe65e,0xbced,0x0000,0xbce3,0xe657, -0x0000,0xe65b,0xe660,0xe655,0xe649,0xbce6,0xbce9,0xbcf1, -0xbcec,0x0000,0xe64c,0xe2a2,0x0000,0x0000,0xe648,0xe65f, -0xbce8,0x0000,0xbceb,0xe661,0xbce0,0xe656,0xe5fb,0xe65c, -0xc0df,0x0000,0xe64a,0x0000,0xbce1,0xe645,0xbce5,0xe5fc, -0xbaab,0xe641,0x0000,0xe65a,0xe642,0xe640,0xbcea,0x0000, -0xe658,0x0000,0xe5fe,0xe651,0xe650,0xe65d,0xe647,0xbcee, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9f3,0x0000, -0xbf49,0xbefe,0xea40,0xe9eb,0xbf41,0xe9f7,0xbf48,0xbf43, -0xe9f5,0xed4f,0xe9fb,0xea42,0xe9fa,0xe9e9,0xe9f8,0xea44, -0xea46,0xbefd,0xea45,0xbf44,0xbf4a,0x0000,0xbf47,0x0000, -0xe9fe,0xbf46,0xe9f9,0x0000,0xe9ed,0xe9f2,0x0000,0xe9fd, -0xbf45,0xbf42,0xbefc,0xbf40,0xe9f1,0x0000,0xe5fd,0xe9ec, -0xe9ef,0xea41,0xe9f4,0xe9ea,0xed4e,0xea43,0xe9ee,0xe9fc, -0x0000,0x0000,0x0000,0x0000,0xed51,0xc0e3,0x0000,0x0000, -0xc0d7,0x0000,0x0000,0xc0db,0xed53,0xed59,0xed57,0xc0d9, -0xc0da,0xc0e1,0xed5a,0xed52,0xc0dc,0x0000,0xed56,0xed55, -0xed5b,0xc0e2,0x0000,0xc0dd,0xc0e0,0xed54,0xc0e4,0xc0de, -0xc0e5,0xc0d8,0xed58,0x0000,0xed50,0x0000,0x0000,0xeff7, -0x0000,0x0000,0xc271,0xeff4,0xeff6,0x0000,0xc26f,0xeff2, -0xeff3,0xefee,0x0000,0x0000,0xe9f6,0xefef,0xc270,0xefeb, -0x0000,0xc26d,0xeff8,0xc26e,0xefec,0xefed,0xeff1,0xc273, -0x0000,0xc272,0x0000,0x0000,0xeff0,0xc378,0xf25f,0xf265, -0xc379,0xf25c,0xc376,0xc373,0xf267,0xc377,0x0000,0xc374, -0xf25e,0xf261,0xf262,0xf263,0xf266,0x0000,0xeff5,0xf25d, -0xc375,0xf264,0xf268,0xf260,0x0000,0x0000,0x0000,0xf45d, -0xc46a,0xf460,0xc46b,0xf468,0xf45f,0xf45c,0x0000,0xf45e, -0xf462,0xf465,0xf464,0xf467,0xf45b,0x0000,0xc469,0xf463, -0xf466,0xf469,0xf461,0xf5d3,0xf5d4,0xf5d8,0xf5d9,0x0000, -0xf5d6,0xf5d7,0xf5d5,0x0000,0xc4e9,0x0000,0x0000,0x0000, -0x0000,0xc578,0xf6eb,0x0000,0x0000,0xf6e8,0xf6e9,0xf6ea, -0xc579,0x0000,0xf7e5,0xf7e4,0x0000,0xf8af,0xc5f4,0xf8ad, -0xf8b0,0xf8ae,0xf8f5,0xc657,0xc665,0xf9a3,0xf96c,0x0000, -0xf9a2,0xf9d0,0xf9d1,0xa4f5,0x0000,0x0000,0x0000,0x0000, -0xa6c7,0xca41,0x0000,0x0000,0xcb5e,0x0000,0xa85f,0x0000, -0xa862,0x0000,0xcb5f,0x0000,0xa860,0xa861,0x0000,0x0000, -0x0000,0x0000,0xcd58,0xcd5a,0xcd55,0xcd52,0xcd54,0x0000, -0x0000,0x0000,0xaaa4,0x0000,0x0000,0x0000,0xaaa2,0x0000, -0x0000,0xcd56,0xaaa3,0xcd53,0xcd50,0xaaa1,0xcd57,0x0000, -0xcd51,0xaaa5,0xcd59,0x0000,0x0000,0x0000,0x0000,0xcfaf, -0x0000,0xcfb3,0x0000,0x0000,0xacb7,0x0000,0x0000,0x0000, -0x0000,0xcfb6,0x0000,0xacaf,0xacb2,0xacb4,0xacb6,0xacb3, -0xcfb2,0xcfb1,0x0000,0xacb1,0xcfb4,0xcfb5,0x0000,0xcfae, -0xacb5,0x0000,0xacb0,0x0000,0x0000,0x0000,0xcfb0,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd277,0xd278,0xd279, -0xaf50,0x0000,0xaf4c,0xd26e,0x0000,0xd276,0xd27b,0xaf51, -0x0000,0xd26c,0xd272,0xd26b,0xd275,0x0000,0x0000,0xd271, -0xaf4d,0xaf4f,0xd27a,0x0000,0xd26a,0xd26d,0xd273,0x0000, -0xd274,0xd27c,0xd270,0x0000,0xaf4e,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb26d, -0xd64e,0x0000,0x0000,0xd650,0xd64c,0x0000,0xd658,0xd64a, -0xd657,0xb269,0xd648,0xda5b,0xd652,0xb26c,0x0000,0xd653, -0xd656,0x0000,0xd65a,0x0000,0xd64f,0x0000,0xd654,0x0000, -0x0000,0xb26a,0xb26b,0xd659,0xd64d,0xd649,0xd65b,0x0000, -0xd651,0x0000,0x0000,0xd655,0x0000,0x0000,0x0000,0xd64b, -0x0000,0xb548,0xb549,0xda65,0xb54f,0x0000,0xda59,0xda62, -0xda58,0xb54c,0xda60,0xda5e,0x0000,0xda5f,0xb54a,0x0000, -0xda63,0x0000,0x0000,0x0000,0x0000,0x0000,0xda5c,0xda5a, -0xb54b,0xda5d,0xda61,0x0000,0x0000,0x0000,0xb54d,0x0000, -0x0000,0x0000,0xda64,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xde70,0xde77,0xde79,0xdea1,0x0000,0xb7da,0xde6b, -0x0000,0xb7d2,0x0000,0xde7a,0xb7d7,0xdea2,0xb7ce,0x0000, -0xde7d,0x0000,0xde6d,0xde7e,0xde6c,0x0000,0xb7dc,0x0000, -0xde78,0xb7cf,0xdea3,0x0000,0xb7d4,0xde71,0xb7d9,0xde7c, -0xde6f,0xde76,0xde72,0xde6e,0xb7d1,0xb7d8,0xb7d6,0xb7d3, -0xb7db,0xb7d0,0xde75,0x0000,0xb7d5,0x0000,0xb54e,0x0000, -0xde7b,0x0000,0xde73,0x0000,0x0000,0x0000,0x0000,0x0000, -0xde74,0x0000,0x0000,0xe2c1,0x0000,0xbab4,0x0000,0x0000, -0xe2bd,0xe2c3,0xe2bf,0x0000,0xbab6,0xe2be,0xe2c2,0xe2ba, -0x0000,0xe2bc,0xbab5,0x0000,0x0000,0x0000,0x0000,0xe2c0, -0xe2bb,0x0000,0xbab7,0x0000,0xbab2,0x0000,0x0000,0xe2c4, -0x0000,0xbab3,0xe667,0xe664,0xe670,0xe66a,0xe66c,0xbcf4, -0xe666,0xe66e,0x0000,0x0000,0xe66d,0xe66b,0x0000,0xe671, -0xbcf7,0xe668,0xe66f,0x0000,0xbcf5,0x0000,0x0000,0xe663, -0xe665,0xbcf6,0xe662,0xe672,0x0000,0xe669,0x0000,0x0000, -0xea4a,0xbf51,0x0000,0x0000,0xea55,0xea53,0xbf4b,0xea49, -0xea4c,0xea4d,0xea48,0xbf55,0xbf56,0xea47,0xea56,0xea51, -0xbf4f,0xbf4c,0xea50,0xea4e,0x0000,0x0000,0xbf52,0xea52, -0xbf4d,0x0000,0xbf4e,0x0000,0xea4f,0xbf50,0xea4b,0x0000, -0xea54,0xbf53,0xea57,0xea58,0xbf54,0x0000,0x0000,0xc0e7, -0xc0ee,0xed5c,0xed62,0x0000,0xed60,0xc0ea,0xc0e9,0xc0e6, -0xed5e,0x0000,0x0000,0x0000,0xc0ec,0xc0eb,0xc0e8,0x0000, -0xed61,0xed5d,0xed5f,0x0000,0xc0ed,0x0000,0x0000,0x0000, -0xc277,0xeffb,0x0000,0xc274,0xc275,0xeffd,0xc276,0xeffa, -/* 0x7200 */ -0x0000,0xeff9,0xf26c,0xeffc,0x0000,0xf26d,0xc37a,0xf26b, -0x0000,0x0000,0xf26a,0x0000,0xf269,0xc37b,0x0000,0x0000, -0xc46c,0x0000,0x0000,0xf46a,0xf46b,0x0000,0x0000,0x0000, -0x0000,0xf5dc,0xf5db,0xc4ea,0x0000,0xf5da,0xf6ec,0xf6ed, -0x0000,0x0000,0xf7e6,0xf8b1,0x0000,0x0000,0xf8f6,0xf9bc, -0xc679,0xf9c6,0xa4f6,0x0000,0xaaa6,0xaaa7,0x0000,0x0000, -0xacb8,0x0000,0x0000,0x0000,0x0000,0xc0ef,0xa4f7,0x0000, -0xaaa8,0xaf52,0xb7dd,0xa4f8,0x0000,0xb26e,0xbab8,0xc962, -0x0000,0xcfb7,0xd27d,0x0000,0xe2c5,0x0000,0xc0f0,0xa4f9, -0xaaa9,0xcfb8,0xcfb9,0xda66,0xb550,0x0000,0x0000,0xdea4, -0x0000,0x0000,0xb7de,0xe2c6,0x0000,0x0000,0xbcf8,0x0000, -0xc37c,0xa4fa,0xda67,0xa4fb,0x0000,0xa6c9,0xca42,0xa6c8, -0xa865,0xa864,0xa863,0xcb60,0x0000,0x0000,0x0000,0xaaaa, -0x0000,0xaaab,0xcd5b,0x0000,0xcfba,0x0000,0xcfbd,0xacba, -0xcfbb,0x0000,0xacb9,0xcfbc,0xacbb,0x0000,0xd2a2,0xd2a1, -0xd27e,0xaf53,0x0000,0xd65d,0xd65e,0xb26f,0xd65c,0xd65f, -0xb552,0xb270,0x0000,0x0000,0xb551,0xda6b,0xda6a,0x0000, -0xda68,0xda69,0x0000,0xda6c,0xdea6,0xdea5,0xdea9,0x0000, -0xdea8,0xdea7,0xbab9,0xe2c9,0x0000,0xe2c8,0xbaba,0xe2c7, -0xe673,0x0000,0xe674,0xbcf9,0x0000,0xea59,0xea5a,0x0000, -0x0000,0xf272,0xc37d,0xf271,0xf270,0xf26e,0xf26f,0xc4eb, -0xf46c,0xf6ee,0xf8f7,0x0000,0xa4fc,0x0000,0xc9a5,0xa5c7, -0xc9a6,0x0000,0x0000,0x0000,0xca43,0xca44,0x0000,0x0000, -0x0000,0x0000,0xcb66,0x0000,0x0000,0xcb62,0x0000,0xcb61, -0xaaac,0xcb65,0xa867,0xcb63,0xa866,0xcb67,0xcb64,0x0000, -0x0000,0xcd5f,0xcfbe,0xcd5d,0xcd64,0x0000,0xaaad,0x0000, -0xaab0,0xcd65,0xcd61,0x0000,0xcd62,0x0000,0xcd5c,0xaaaf, -0xcd5e,0xaaae,0xcd63,0x0000,0xcd60,0x0000,0x0000,0xcfc2, -0xacbd,0xacbe,0x0000,0xcfc5,0xcfbf,0x0000,0xcfc4,0x0000, -0xcfc0,0xacbc,0xcfc3,0xcfc1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd2a8,0xd2a5,0x0000,0xd2a7,0xaf58, -0xaf57,0xaf55,0xd2a4,0xd2a9,0xaf54,0xaf56,0xd2a6,0xd667, -0xd2a3,0xd2aa,0x0000,0x0000,0x0000,0x0000,0x0000,0xd662, -0xd666,0x0000,0xd665,0xda6e,0xda79,0x0000,0x0000,0xd668, -0x0000,0xd663,0xda6d,0xb274,0x0000,0x0000,0xb273,0xd661, -0xd664,0xb275,0x0000,0xb272,0xb271,0xd660,0xd669,0x0000, -0x0000,0x0000,0xda70,0xda77,0x0000,0xb554,0xda76,0xda73, -0x0000,0xb556,0x0000,0x0000,0x0000,0xda75,0x0000,0x0000, -0xda6f,0xda71,0xda74,0xda72,0xb555,0xda78,0xb553,0xb7df, -0x0000,0x0000,0xdead,0xdeac,0xdeaa,0x0000,0xb7e2,0xb7e1, -0xdeae,0x0000,0xdeab,0xe2ca,0xbabb,0xb7e0,0x0000,0x0000, -0x0000,0xdeb0,0xdeaf,0x0000,0xe2cd,0xe2cb,0xbcfa,0x0000, -0xbabc,0xe2cc,0xe676,0x0000,0x0000,0x0000,0x0000,0xbcfb, -0xe675,0xe67e,0xe67d,0xe67b,0x0000,0xe67a,0xe677,0xe678, -0xe679,0xe67c,0xe6a1,0x0000,0x0000,0xea5f,0xea5c,0xea5d, -0xbf57,0xea5b,0xea61,0xea60,0xea5e,0x0000,0xed64,0xed65, -0xc0f1,0x0000,0xc0f2,0xed63,0x0000,0xc279,0xeffe,0xc278, -0xc37e,0x0000,0xc3a1,0xc46d,0xf46e,0xf46d,0xf5dd,0xf6ef, -0xc57a,0xf7e8,0xf7e7,0xf7e9,0xa5c8,0xcfc6,0xaf59,0xb276, -0xd66a,0xa5c9,0xc9a7,0xa4fd,0x0000,0x0000,0xca45,0x0000, -0x0000,0x0000,0xcb6c,0xcb6a,0xcb6b,0xcb68,0xa868,0xcb69, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcd6d,0x0000,0xaab3, -0xcd6b,0xcd67,0xcd6a,0x0000,0xcd66,0xaab5,0xcd69,0x0000, -0xaab2,0xaab1,0x0000,0xaab4,0xcd6c,0xcd68,0x0000,0x0000, -0x0000,0x0000,0xacc2,0xacc5,0xcfce,0xcfcd,0xcfcc,0xacbf, -0xcfd5,0xcfcb,0x0000,0xacc1,0xd2af,0x0000,0xcfd2,0xcfd0, -0xacc4,0x0000,0xcfc8,0xcfd3,0x0000,0xcfca,0xcfd4,0xcfd1, -0xcfc9,0x0000,0xacc0,0xcfd6,0xcfc7,0xacc3,0x0000,0x0000, -0x0000,0x0000,0xd2b4,0xd2ab,0xd2b6,0x0000,0xd2ae,0xd2b9, -0xd2ba,0xd2ac,0xd2b8,0xd2b5,0xd2b3,0xd2b7,0xaf5f,0x0000, -0xaf5d,0x0000,0x0000,0xd2b1,0x0000,0xd2ad,0x0000,0xd2b0, -0xd2bb,0xd2b2,0xaf5e,0xcfcf,0x0000,0xaf5a,0xaf5c,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd678,0xd66d,0xd66b,0x0000, -0xd66c,0x0000,0xd673,0x0000,0xd674,0xd670,0xb27b,0xd675, -0xd672,0xd66f,0x0000,0xb279,0xd66e,0xb277,0xb27a,0xd671, -0xd679,0xaf5b,0xb278,0xd677,0xd676,0xb27c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xda7e,0x0000, -0x0000,0x0000,0xdaa1,0xb560,0x0000,0xdaa7,0x0000,0x0000, -0xdaa9,0xdaa2,0xb55a,0xdaa6,0xdaa5,0xb55b,0xb561,0x0000, -0xb562,0xdaa8,0xb558,0xda7d,0xda7b,0xdaa3,0xda7a,0xb55f, -0xda7c,0xdaa4,0xdaaa,0xb559,0xb55e,0xb55c,0xb55d,0x0000, -0x0000,0x0000,0xb557,0x0000,0x0000,0x0000,0x0000,0xb7e9, -0xdeb7,0xb7e8,0xdebb,0x0000,0xdeb1,0x0000,0xdebc,0x0000, -0x0000,0x0000,0xdeb2,0xdeb3,0x0000,0xdebd,0xdeba,0xdeb8, -0xdeb9,0xdeb5,0xdeb4,0x0000,0xdebe,0xb7e5,0x0000,0xdeb6, -0x0000,0xb7ea,0xb7e4,0xb7eb,0xb7ec,0x0000,0xb7e7,0xb7e6, -0x0000,0x0000,0xe2ce,0xbabe,0xbabd,0x0000,0x0000,0xe2d3, -0x0000,0xbcfc,0xbabf,0x0000,0x0000,0xbac1,0xe2d4,0xb7e3, -0xbac0,0xe2d0,0xe2d2,0xe2cf,0x0000,0xe2d1,0x0000,0x0000, -0x0000,0xe6ab,0x0000,0x0000,0xe6aa,0xe6a7,0xbd40,0xea62, -0xbd41,0xe6a6,0x0000,0xbcfe,0x0000,0xe6a8,0xe6a5,0xe6a2, -0xe6a9,0xe6a3,0xe6a4,0xbcfd,0x0000,0x0000,0x0000,0x0000, -0xed69,0x0000,0xea66,0x0000,0xea65,0xea67,0x0000,0xed66, -0xbf5a,0x0000,0xea63,0x0000,0xbf58,0x0000,0xbf5c,0xbf5b, -0xea64,0xea68,0x0000,0xbf59,0x0000,0xed6d,0xc0f5,0xc27a, -0xc0f6,0xc0f3,0xed6a,0xed68,0x0000,0xed6b,0x0000,0xed6e, -0xc0f4,0xed6c,0xed67,0x0000,0x0000,0xf042,0xf045,0xf275, -0xf040,0x0000,0xf46f,0xf046,0x0000,0xc3a2,0xf044,0xc27b, -0xf041,0xf043,0xf047,0xf276,0x0000,0xf274,0x0000,0x0000, -0x0000,0x0000,0xc3a3,0xf273,0x0000,0x0000,0x0000,0xc46e, -0x0000,0x0000,0x0000,0x0000,0xc4ed,0xf6f1,0xc4ec,0xf6f3, -0xf6f0,0xf6f2,0xc5d0,0xf8b2,0xa5ca,0xcd6e,0xd2bc,0xd2bd, -0xb27d,0xdebf,0xbf5d,0xc3a4,0xc57b,0xf8b3,0xa5cb,0x0000, -0xcd6f,0xa260,0x0000,0x0000,0xcfd7,0x0000,0xcfd8,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd2be,0xd2bf,0xb27e,0xb2a1, -0x0000,0x0000,0x0000,0xdaab,0x0000,0xdec2,0xdec1,0xdec0, -0xe2d5,0x0000,0xe2d6,0xe2d7,0xbac2,0x0000,0x0000,0xe6ad, -0xe6ac,0x0000,0x0000,0xea69,0xbf5e,0xbf5f,0x0000,0xed72, -0xed6f,0xed70,0xed71,0xf049,0xf048,0xc27c,0xf277,0xf5de, -0xa5cc,0x0000,0xacc6,0x0000,0xb2a2,0xdec3,0x0000,0xa5cd, -0x0000,0xd2c0,0xb2a3,0x0000,0x0000,0xb563,0xb564,0x0000, -0xa5ce,0xa5cf,0xca46,0xa86a,0xa869,0xacc7,0xcfd9,0xdaac, -0xa5d0,0xa5d1,0xa5d2,0xa5d3,0x0000,0x0000,0x0000,0xa86b, -0xa86c,0xcb6e,0xcb6d,0x0000,0x0000,0xaab6,0xcd72,0xcd70, -0xcd71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfda, -0xcfdb,0x0000,0x0000,0xaccb,0xacc9,0x0000,0xacca,0xacc8, -0x0000,0x0000,0x0000,0x0000,0xaf60,0x0000,0x0000,0x0000, -0x0000,0xaf64,0xaf63,0xd2c1,0xaf62,0xaf61,0x0000,0xd2c2, -0x0000,0x0000,0xb2a6,0xd67b,0xd67a,0xb2a4,0xb2a5,0x0000, -0x0000,0x0000,0xb566,0xb565,0xdaae,0x0000,0x0000,0xdaad, -0xb2a7,0x0000,0x0000,0x0000,0x0000,0x0000,0xb7ed,0xdec5, -0xb7ee,0xdec4,0x0000,0x0000,0x0000,0xe2d8,0xe6ae,0xbd42, -0xea6a,0x0000,0x0000,0x0000,0xed73,0x0000,0xc3a6,0xc3a5, -0x0000,0x0000,0xc57c,0xa5d4,0xcd73,0x0000,0x0000,0xb2a8, -0xe2d9,0xbac3,0x0000,0x0000,0xcb6f,0xcb70,0x0000,0x0000, -0xcd74,0xaab8,0xaab9,0x0000,0x0000,0xaab7,0x0000,0x0000, -0x0000,0x0000,0xaccf,0xacd0,0xaccd,0xacce,0x0000,0xcfdc, -0x0000,0x0000,0xcfdd,0xaccc,0x0000,0x0000,0x0000,0x0000, -0xd2c3,0x0000,0xaf68,0xaf69,0x0000,0xb2ab,0xd2c9,0x0000, -0xaf6e,0xaf6c,0xd2ca,0xd2c5,0xaf6b,0xaf6a,0xaf65,0xd2c8, -0xd2c7,0xd2c4,0xaf6d,0x0000,0xd2c6,0xaf66,0x0000,0xaf67, -0x0000,0x0000,0xb2ac,0xd6a1,0xd6a2,0xb2ad,0xd67c,0xd67e, -0xd6a4,0xd6a3,0xd67d,0x0000,0xb2a9,0xb2aa,0x0000,0xdab6, -0xb56b,0xb56a,0xdab0,0xb568,0x0000,0xdab3,0xb56c,0xdab4, -0xb56d,0xdab1,0xb567,0xb569,0xdab5,0x0000,0xdab2,0xdaaf, -0x0000,0x0000,0x0000,0x0000,0x0000,0xded2,0x0000,0xdec7, -0xb7f0,0xb7f3,0xb7f2,0xb7f7,0xb7f6,0xded3,0xded1,0xdeca, -0xdece,0xdecd,0xb7f4,0xded0,0xdecc,0xded4,0xdecb,0xb7f5, -0xb7ef,0xb7f1,0x0000,0xdec9,0x0000,0x0000,0x0000,0x0000, -0xe2db,0xbac7,0xe2df,0xbac6,0xe2dc,0xbac5,0x0000,0xdec8, -0xdecf,0xe2de,0x0000,0xbac8,0xe2e0,0xe2dd,0xe2da,0x0000, -0x0000,0xe6b1,0xe6b5,0xe6b7,0xe6b3,0xe6b2,0xe6b0,0xbd45, -0xbd43,0xbd48,0xbd49,0xe6b4,0xbd46,0xe6af,0xbd47,0xbac4, -0xe6b6,0xbd44,0x0000,0x0000,0x0000,0xea6c,0x0000,0xea6b, -0xea73,0xea6d,0xea72,0xea6f,0xbf60,0xea71,0x0000,0x0000, -0xbf61,0x0000,0xbf62,0x0000,0xea70,0xea6e,0x0000,0x0000, -0x0000,0x0000,0xc0f8,0xed74,0x0000,0x0000,0xc0f7,0xed77, -0xed75,0xed76,0x0000,0x0000,0xc0f9,0x0000,0x0000,0x0000, -0xf04d,0x0000,0xc2a1,0xf04e,0x0000,0x0000,0xc27d,0xf04f, -0xc27e,0xf04c,0xf050,0x0000,0xf04a,0x0000,0x0000,0xc3a7, -0xf278,0xc3a8,0xc46f,0x0000,0xf04b,0xc470,0x0000,0x0000, -0x0000,0xc4ee,0xf5df,0x0000,0xc57e,0xf6f4,0xc57d,0x0000, -0xf7ea,0xc5f5,0xc5f6,0x0000,0x0000,0xf9cc,0x0000,0x0000, -0xacd1,0xcfde,0x0000,0xb56e,0xb56f,0xa5d5,0xa6ca,0xca47, -0x0000,0xcb71,0xa86d,0x0000,0xaaba,0x0000,0xacd2,0xacd3, -0xacd4,0xd6a6,0xd2cb,0xaf6f,0x0000,0x0000,0xb2ae,0xd6a5, -0x0000,0x0000,0xdab8,0xb571,0x0000,0xdab7,0xb570,0x0000, -0x0000,0xded5,0xbd4a,0xe6bb,0xe6b8,0xe6b9,0xe6ba,0x0000, -0x0000,0x0000,0x0000,0x0000,0xed78,0x0000,0xf051,0x0000, -0x0000,0x0000,0xf471,0xf470,0x0000,0xf6f5,0xa5d6,0xcd75, -0xaf70,0x0000,0x0000,0x0000,0xb572,0xded6,0x0000,0x0000, -0xe2e1,0x0000,0xbd4b,0xea74,0x0000,0xf052,0xf472,0xa5d7, -0x0000,0x0000,0xaabb,0xacd7,0xcfdf,0xacd8,0xacd6,0x0000, -0xacd5,0xd2cc,0xaf71,0x0000,0x0000,0xaf72,0xaf73,0x0000, -0x0000,0x0000,0xb2b0,0xd6a7,0xb2af,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdab9,0xb2b1,0xb573,0xded7,0xb7f8,0xb7f9, -0x0000,0xbac9,0x0000,0xbaca,0xbd4c,0xbf64,0xea75,0xbf63, -0x0000,0xed79,0xc0fa,0x0000,0xf053,0xf473,0xa5d8,0xa86e, -0xcd78,0xcd77,0xaabc,0xcd76,0xaabd,0xcd79,0x0000,0xcfe5, -0xacdb,0xacda,0xcfe7,0xcfe6,0xacdf,0x0000,0xacde,0x0000, -/* 0x7700 */ -0x0000,0xacd9,0x0000,0xcfe1,0xcfe2,0xcfe3,0x0000,0xace0, -0xcfe0,0xacdc,0xcfe4,0xacdd,0x0000,0x0000,0x0000,0x0000, -0xd2cf,0xd2d3,0xd2d1,0xd2d0,0x0000,0xd2d4,0x0000,0x0000, -0x0000,0xd2d5,0xd2d6,0xd2ce,0x0000,0xd2cd,0x0000,0xaf75, -0xaf76,0x0000,0xd2d7,0xd2d2,0x0000,0xd6b0,0x0000,0xd2d8, -0xaf77,0xaf74,0x0000,0x0000,0x0000,0xd6aa,0x0000,0xd6a9, -0x0000,0xd6ab,0xd6ac,0xd6ae,0xd6ad,0xd6b2,0xb2b5,0xb2b2, -0xb2b6,0xd6a8,0xb2b7,0xd6b1,0xb2b4,0xd6af,0xb2b3,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdabc,0xdabe,0xdaba,0xdabb, -0x0000,0x0000,0xdabf,0xdac1,0xdac2,0xdabd,0xdac0,0xb574, -0x0000,0x0000,0xdedb,0x0000,0xdee0,0xded8,0xdedc,0x0000, -0x0000,0xdee1,0xdedd,0xb7fa,0xb843,0x0000,0xb7fd,0xded9, -0xdeda,0xbace,0xb846,0xb7fe,0x0000,0xb844,0xb7fc,0xdedf, -0xb845,0xdede,0xb841,0xb7fb,0xb842,0xdee2,0xe2e6,0xe2e8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xb840,0x0000,0x0000,0xe2e3,0xbacc,0xe2e9,0xbacd, -0xe2e7,0xe2e2,0xe2e5,0xe2ea,0xbacb,0xe2e4,0x0000,0xbd4e, -0xe6bf,0xe6be,0x0000,0xbd51,0xbd4f,0xe6bc,0xbd4d,0xe6bd, -0x0000,0xbd50,0x0000,0x0000,0x0000,0xea7d,0x0000,0xeaa1, -0x0000,0xea7e,0xea76,0xea7a,0xea79,0xea77,0xbf66,0xbf67, -0xbf65,0xea78,0xea7b,0xea7c,0x0000,0xbf68,0x0000,0xc140, -0xeda3,0x0000,0xc0fc,0xed7b,0xc0fe,0xc141,0x0000,0x0000, -0xc0fd,0xeda2,0xed7c,0xc0fb,0xeda1,0xed7a,0xed7e,0xed7d, -0x0000,0x0000,0xf055,0xc2a4,0xc2a5,0xc2a2,0x0000,0xc2a3, -0x0000,0x0000,0xf054,0x0000,0xf27b,0x0000,0x0000,0xc3a9, -0x0000,0xf279,0xf27a,0x0000,0xf474,0xf477,0xf475,0xf476, -0xf5e0,0x0000,0x0000,0xc4ef,0xf7eb,0xf8b4,0x0000,0xc5f7, -0xf8f8,0xf8f9,0xc666,0xa5d9,0xace1,0x0000,0xdac3,0x0000, -0xdee3,0x0000,0xa5da,0xa86f,0x0000,0xaabe,0x0000,0xcfe8, -0xcfe9,0xaf78,0x0000,0x0000,0xdac4,0xb575,0xb847,0xc142, -0xeda4,0xf27c,0xf478,0xa5db,0x0000,0x0000,0x0000,0xcda1, -0xcd7a,0xcd7c,0xcd7e,0xcd7d,0xcd7b,0xaabf,0x0000,0x0000, -/* 0x7800 */ -0x0000,0x0000,0xace2,0xcff2,0x0000,0xcfed,0xcfea,0x0000, -0x0000,0xcff1,0x0000,0x0000,0xace4,0xace5,0xcff0,0xcfef, -0xcfee,0xcfeb,0xcfec,0xcff3,0xace3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xaf7c,0x0000,0xafa4, -0xafa3,0xd2e1,0xd2db,0xd2d9,0x0000,0xafa1,0xd6b9,0xaf7a, -0xd2de,0xd2e2,0xd2e4,0xd2e0,0xd2da,0xafa2,0xd2df,0xd2dd, -0xaf79,0xd2e5,0xafa5,0xd2e3,0xaf7d,0xd2dc,0x0000,0xaf7e, -0xaf7b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xb2b9,0x0000,0xd6ba,0x0000,0x0000, -0xd6b3,0xd6b5,0xd6b7,0x0000,0xd6b8,0xd6b6,0xb2ba,0x0000, -0xd6bb,0x0000,0xd6b4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdac8,0xb576,0xdad0,0x0000, -0xdac5,0x0000,0xdad1,0x0000,0xdac6,0xdac7,0x0000,0x0000, -0xdacf,0xdace,0xdacb,0xb2b8,0xb577,0xdac9,0xdacc,0xb578, -0xdacd,0xdaca,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdeee,0x0000,0xdef2,0xb84e,0x0000,0xe2f0,0xb851, -0xdef0,0xf9d6,0x0000,0xdeed,0xdee8,0xdeea,0xdeeb,0xdee4, -0x0000,0xb84d,0x0000,0x0000,0xb84c,0x0000,0xb848,0xdee7, -0x0000,0xb84f,0x0000,0xb850,0xdee6,0xdee9,0xdef1,0xb84a, -0xb84b,0xdeef,0xdee5,0x0000,0x0000,0x0000,0xe2f2,0xbad0, -0xe2f4,0xdeec,0xe2f6,0xbad4,0xe2f7,0xe2f3,0x0000,0xbad1, -0xe2ef,0xbad3,0xe2ec,0xe2f1,0xe2f5,0xe2ee,0x0000,0x0000, -0xb849,0x0000,0xe2eb,0xbad2,0xe2ed,0x0000,0x0000,0x0000, -0x0000,0x0000,0xbd54,0xe6c1,0xbd58,0x0000,0xbd56,0x0000, -0x0000,0xbacf,0x0000,0xe6c8,0xe6c9,0xbd53,0x0000,0x0000, -0xe6c7,0xe6ca,0xbd55,0xbd52,0xe6c3,0xe6c0,0xe6c5,0xe6c2, -0xbd59,0xe6c4,0x0000,0x0000,0xe6c6,0xbd57,0x0000,0x0000, -0x0000,0x0000,0xbf6a,0xeaa8,0x0000,0xeaa2,0xeaa6,0xeaac, -0xeaad,0xeaa9,0xeaaa,0xeaa7,0x0000,0xeaa4,0x0000,0xbf6c, -0xbf69,0xeaa3,0xeaa5,0x0000,0xbf6b,0xeaab,0x0000,0xc146, -0x0000,0x0000,0xedaa,0xeda5,0xc145,0x0000,0x0000,0xc143, -0x0000,0xedac,0xc144,0xeda8,0xeda9,0xeda6,0xedad,0xf056, -/* 0x7900 */ -0x0000,0xc147,0xeda7,0x0000,0xedae,0xedab,0x0000,0x0000, -0x0000,0xf05a,0x0000,0x0000,0xf057,0x0000,0xc2a6,0x0000, -0xf05b,0xf05d,0xf05c,0xf058,0xf059,0x0000,0x0000,0xf2a3, -0x0000,0xc3aa,0x0000,0xf27e,0xf2a2,0xf27d,0xf2a4,0x0000, -0x0000,0xf2a1,0x0000,0xf47a,0xf47d,0xf479,0xc471,0xf47b, -0xf47c,0xf47e,0xc472,0xc474,0xc473,0xf5e1,0x0000,0xf5e3, -0x0000,0xf5e2,0x0000,0x0000,0x0000,0xf6f6,0x0000,0x0000, -0xf8b5,0xf8fa,0xa5dc,0x0000,0x0000,0xcb72,0xaac0,0xcda3, -0xaac1,0xaac2,0xcda2,0x0000,0xcff8,0xcff7,0xace6,0xace9, -0xace8,0xace7,0xcff4,0xcff6,0xcff5,0x0000,0x0000,0xd2e8, -0xafa7,0xd2ec,0xd2eb,0xd2ea,0xd2e6,0xafa6,0xafaa,0xafad, -0x0000,0x0000,0xafae,0xd2e7,0xd2e9,0xafac,0xafab,0xafa9, -0xafa8,0xd6c2,0x0000,0xd6c0,0xd6bc,0xb2bb,0x0000,0xd6bd, -0xb2bc,0xd6be,0xd6bf,0xd6c1,0x0000,0xb2bd,0x0000,0x0000, -0xdad5,0x0000,0xdad4,0xdad3,0xdad2,0x0000,0x0000,0x0000, -0x0000,0xdef6,0xb852,0x0000,0xdef3,0xdef5,0x0000,0xb853, -0x0000,0xb854,0xdef4,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe341,0x0000,0xe2f9,0xe2fa,0x0000,0xbad7,0xbad5,0xbad6, -0xe343,0x0000,0xe342,0xe2fe,0xe2fd,0xe2fc,0xe2fb,0xe340, -0xe2f8,0x0000,0xe6cb,0xe6d0,0xe6ce,0x0000,0x0000,0x0000, -0xe6cd,0xe6cc,0xe6cf,0x0000,0xeaae,0x0000,0xbf6d,0xc148, -0xedb0,0x0000,0xc149,0xedaf,0xf05f,0xf05e,0xc2a7,0x0000, -0xf2a5,0xc3ab,0xf4a1,0xc5a1,0xf6f7,0x0000,0xf8b7,0xf8b6, -0xc9a8,0xacea,0xaceb,0xd6c3,0x0000,0xb856,0xa5dd,0xa872, -0xa871,0xa870,0x0000,0x0000,0x0000,0xcda4,0x0000,0x0000, -0xaac4,0xaac3,0x0000,0xacee,0x0000,0xcffa,0xcffd,0xcffb, -0x0000,0xacec,0xaced,0x0000,0x0000,0xcff9,0xcffc,0x0000, -0xafb5,0x0000,0x0000,0x0000,0xd2f3,0xd2f5,0xd2f4,0xafb2, -0xd2ef,0x0000,0x0000,0xafb0,0xafaf,0x0000,0xafb3,0xafb1, -0x0000,0xafb4,0xd2f2,0xd2ed,0xd2ee,0xd2f1,0xd2f0,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6c6,0xd6c7, -0xd6c5,0x0000,0xd6c4,0xb2be,0x0000,0x0000,0x0000,0x0000, -0xb57d,0x0000,0xdad6,0xdad8,0xdada,0xb57c,0x0000,0x0000, -0xb57a,0x0000,0xdad7,0xb57b,0xdad9,0xb579,0x0000,0x0000, -0xdf41,0xdef7,0xdefa,0xdefe,0xb85a,0xdefc,0x0000,0xdefb, -0xdef8,0xdef9,0xb858,0xdf40,0xb857,0x0000,0xb85c,0xb85b, -0xb859,0x0000,0xdefd,0x0000,0x0000,0x0000,0xe349,0x0000, -0xe348,0x0000,0x0000,0xe344,0x0000,0x0000,0xbad8,0xe347, -0xe346,0xbad9,0x0000,0x0000,0x0000,0x0000,0x0000,0xbd5e, -0x0000,0xe6d2,0x0000,0xbd5f,0xbd5b,0xbd5d,0x0000,0xbd5a, -0xbd5c,0x0000,0x0000,0x0000,0xeaaf,0x0000,0xbf70,0xeab1, -0xeab0,0x0000,0xe345,0xbf72,0xbf71,0xbf6e,0xbf6f,0x0000, -0x0000,0x0000,0x0000,0x0000,0xedb5,0x0000,0xedb3,0xc14a, -0xedb4,0x0000,0xedb6,0xedb2,0xedb1,0x0000,0x0000,0xf060, -0xc2aa,0xc2a8,0xc2a9,0x0000,0x0000,0x0000,0x0000,0xf2a6, -0xf2a7,0xc3ad,0x0000,0xc3ac,0xf4a3,0xf4a4,0xf4a2,0x0000, -0xf6f8,0xf6f9,0x0000,0x0000,0xa5de,0xca48,0xa873,0x0000, -0xcda5,0xaac6,0xaac5,0xcda6,0x0000,0x0000,0xd040,0xacef, -0xcffe,0xacf0,0x0000,0x0000,0xafb6,0xd2f8,0xd2f6,0xd2fc, -0xafb7,0xd2f7,0xd2fb,0xd2f9,0xd2fa,0x0000,0x0000,0xd6c8, -0xd6ca,0x0000,0xb2bf,0x0000,0xd6c9,0xb2c0,0xb5a2,0xb5a1, -0xb57e,0xdadb,0x0000,0x0000,0x0000,0x0000,0xdf44,0xb85d, -0xb85e,0x0000,0xdf43,0xdf42,0x0000,0x0000,0x0000,0x0000, -0xe34a,0xbadb,0xbada,0xe34b,0xe34c,0x0000,0xbd61,0xbd60, -0x0000,0xeab5,0xe6d3,0xe6d5,0xe6d4,0xeab4,0xeab2,0xeab6, -0xeab3,0x0000,0xbf73,0x0000,0x0000,0x0000,0xedb7,0xc14b, -0xedb8,0xedb9,0x0000,0x0000,0xc2ab,0xc2ac,0x0000,0xc475, -0x0000,0x0000,0xc5d1,0xa5df,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd041,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd2fd,0xafb8,0x0000,0x0000,0x0000,0x0000,0x0000,0xb3ba, -0xb3b9,0x0000,0x0000,0xb5a4,0xdadd,0xb5a3,0xdadc,0x0000, -0x0000,0x0000,0x0000,0xdf45,0x0000,0xbadc,0xe34d,0xbadd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc476,0xf4a5, -0x0000,0xa6cb,0xaac7,0xcda7,0x0000,0xacf2,0x0000,0xacf1, -0xd042,0xd043,0x0000,0x0000,0xd340,0xd342,0xafb9,0x0000, -0xd344,0xd347,0xd345,0x0000,0x0000,0x0000,0xd346,0xd343, -0xd2fe,0xafba,0xd348,0xd341,0x0000,0x0000,0x0000,0x0000, -0xd6d3,0xb2c6,0xd6dc,0xb2c3,0x0000,0xd6d5,0xb2c7,0x0000, -0xb2c1,0x0000,0xd6d0,0xd6dd,0xd6d1,0xd6ce,0xb2c5,0x0000, -0xb2c2,0x0000,0xd6d4,0xd6d7,0xb2c4,0xd6d8,0xb2c8,0xd6d9, -0xd6cf,0xd6d6,0xd6da,0xd6d2,0xd6cd,0xd6cb,0x0000,0x0000, -0xd6db,0x0000,0x0000,0xdadf,0x0000,0x0000,0x0000,0x0000, -0xdae4,0x0000,0x0000,0x0000,0xdae0,0xdae6,0xb5a7,0xd6cc, -0xdae1,0xb5a5,0xdade,0xb5ac,0xdae2,0xb5ab,0xdae3,0xb5ad, -0xb5a8,0xb5ae,0xb5a9,0x0000,0xb5aa,0x0000,0xb5a6,0x0000, -0xdae5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb861,0xdf50,0x0000,0xdf53,0xdf47,0xdf4c,0xdf46,0xb863, -0x0000,0xdf4a,0x0000,0x0000,0x0000,0xdf48,0xb862,0x0000, -0xdf4f,0xdf4e,0xdf4b,0xdf4d,0xdf49,0xbae1,0xdf52,0xb85f, -0xdf51,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe35d,0x0000,0xbae8,0xe358,0x0000,0xbae7, -0xe34e,0x0000,0xe350,0xbae0,0xe355,0xe354,0xe357,0xbae5, -0xe352,0xe351,0x0000,0x0000,0xbae4,0xbadf,0xe353,0xbae2, -0xe359,0xe35b,0x0000,0xe356,0xe34f,0xbae3,0x0000,0x0000, -0xbd69,0xbade,0x0000,0x0000,0xe35c,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe6d9,0xbd62,0x0000,0xe6db, -0x0000,0xbd63,0x0000,0x0000,0xbd65,0xe6de,0x0000,0xe6d6, -0xbae6,0xe6dc,0x0000,0x0000,0x0000,0x0000,0xe6d8,0x0000, -0xb860,0xbd68,0x0000,0x0000,0xbd64,0x0000,0xbd66,0xbd67, -0x0000,0xbf76,0xe6dd,0xe6d7,0xbd6a,0x0000,0xe6da,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeac0,0xeabb,0x0000,0x0000, -0xeac5,0xbf74,0xeabd,0xbf78,0xeac3,0xeaba,0xeab7,0xeac6, -0xc151,0xbf79,0xeac2,0xeab8,0xbf77,0xeabc,0xbf7b,0xeab9, -0xeabe,0xbf7a,0xeac1,0xeac4,0x0000,0x0000,0x0000,0x0000, -0xedcb,0xedcc,0xedbc,0xedc3,0xedc1,0x0000,0x0000,0xc14f, -0xedc8,0xeabf,0x0000,0xedbf,0x0000,0xedc9,0xc14e,0xedbe, -0xedbd,0xedc7,0xedc4,0xedc6,0x0000,0xedba,0xedca,0xc14c, -0x0000,0xedc5,0xedce,0xedc2,0xc150,0xc14d,0xedc0,0xedbb, -0xedcd,0xbf75,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf063,0x0000,0x0000,0xf061,0xf067,0xc2b0,0xf065, -0xf064,0xc2b2,0xf06a,0xc2b1,0x0000,0xf06b,0xf068,0xc2ae, -0xf069,0xf062,0xc2af,0xc2ad,0xf2ab,0xf066,0x0000,0x0000, -0xf06c,0x0000,0x0000,0xf2a8,0x0000,0x0000,0x0000,0xc3b2, -0xc3b0,0xf2aa,0x0000,0xf2ac,0xf2a9,0xc3b1,0xc3ae,0xc3af, -0xc3b3,0x0000,0x0000,0xc478,0x0000,0xf4aa,0x0000,0xf4a9, -0xf4a7,0xf4a6,0xf4a8,0x0000,0xc477,0xc479,0x0000,0x0000, -0xc4f0,0x0000,0x0000,0xf5e5,0xf5e4,0x0000,0x0000,0xf6fa, -0x0000,0xf6fc,0xf6fe,0xf6fd,0xf6fb,0x0000,0x0000,0xc5a3, -0xc5a2,0x0000,0x0000,0xc5d3,0xc5d2,0xc5d4,0xf7ed,0xf7ec, -0x0000,0xf8fb,0xf8b8,0xf8fc,0xc658,0x0000,0xc659,0xf96d, -0x0000,0x0000,0xc67e,0xa6cc,0x0000,0xcda8,0x0000,0x0000, -0xd045,0xd046,0xd044,0x0000,0x0000,0xacf3,0x0000,0xd047, -0xd048,0xd049,0x0000,0x0000,0xd349,0xd34f,0x0000,0x0000, -0xd34d,0xafbb,0xd34b,0x0000,0xd34c,0xd34e,0x0000,0x0000, -0x0000,0xd34a,0xb2c9,0x0000,0xd6de,0xb2cb,0xd6e0,0xb2ca, -0xd6df,0x0000,0x0000,0x0000,0x0000,0x0000,0xdae8,0xb5af, -0x0000,0xdaea,0xdae7,0xd6e1,0x0000,0xb5b0,0x0000,0xf9db, -0xdae9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdf56, -0x0000,0xb864,0xdf54,0xb865,0xdf55,0xb866,0x0000,0x0000, -0x0000,0xbae9,0xe361,0xe35e,0xe360,0xbaea,0xbaeb,0xe35f, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6df,0x0000,0x0000, -0xe6e0,0x0000,0xbd6b,0xe6e2,0xe6e1,0x0000,0xa261,0x0000, -0xeaca,0xeacb,0xeac7,0x0000,0xeac8,0xbf7c,0xbf7d,0xeac9, -0x0000,0xc157,0x0000,0x0000,0xc153,0xc158,0xc154,0xc156, -0xc152,0x0000,0xc155,0x0000,0x0000,0x0000,0x0000,0xc2b3, -0xedcf,0x0000,0xf2ae,0x0000,0xf2ad,0x0000,0xf4ab,0xc47a, -0xc47b,0xf741,0xf5e6,0x0000,0xf740,0x0000,0xf8fd,0xf9a4, -0xa6cd,0x0000,0x0000,0xa874,0x0000,0xcda9,0xaac8,0x0000, -0xacf6,0xd04c,0xacf4,0xd04a,0xacf9,0xacf5,0xacfa,0xacf8, -0xd04b,0xacf7,0xafbf,0xafbe,0xd35a,0xafc7,0xd353,0xd359, -0xafc3,0xd352,0xd358,0xd356,0xafc2,0xafc4,0xd355,0xafbd, -0xd354,0xafc8,0xafc5,0xafc9,0xafc6,0xd351,0xd350,0xd357, -0xafc0,0xafbc,0xafc1,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd6f0,0xd6e9,0x0000,0xb5b5,0xd6e8,0x0000,0xb2cf,0xb2d6, -0xb2d3,0xb2d9,0xb2d8,0xb2d4,0x0000,0xd6e2,0xd6e5,0x0000, -0xd6e4,0xb2d0,0xd6e6,0xd6ef,0xb2d1,0xd6e3,0xd6ec,0xd6ed, -0xb2d2,0xd6ea,0xb2d7,0xb2cd,0xb2d5,0xd6e7,0xb2cc,0xd6eb, -0x0000,0x0000,0xd6ee,0x0000,0x0000,0x0000,0xdafb,0xdaf2, -0xb5b2,0xdaf9,0xdaf6,0xdaee,0xdaf7,0xb5b4,0xdaef,0x0000, -0xdaeb,0x0000,0x0000,0xb86c,0xdaf4,0x0000,0xb5b1,0xdafa, -0x0000,0xb5b8,0xb5ba,0xdaed,0x0000,0x0000,0xb5b9,0xdaf0, -0xb5b3,0xdaf8,0xdaf1,0xdaf5,0x0000,0xdaf3,0xb5b6,0xdaec, -0xb5bb,0xb2ce,0xb5b7,0xb5bc,0x0000,0x0000,0x0000,0x0000, -0x0000,0xb868,0xdf5d,0xdf5f,0xdf61,0xdf65,0x0000,0xdf5b, -0xdf59,0xb86a,0x0000,0xdf60,0xdf64,0xdf5c,0xdf58,0x0000, -0xdf57,0x0000,0x0000,0x0000,0xdf62,0xdf5a,0xdf5e,0xb86b, -0x0000,0xb869,0xdf66,0xb867,0xdf63,0x0000,0xe372,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbaee,0xe36a,0xbd78,0xe374, -0xbaf1,0xe378,0xbaf7,0xe365,0x0000,0x0000,0xe375,0xe362, -0x0000,0xe377,0xe366,0x0000,0xbafe,0xbafb,0xe376,0xe370, -0xbaed,0xbaf5,0xbaf4,0x0000,0xbaf3,0xbaf9,0x0000,0xe363, -0xbafa,0xe371,0xbaf6,0xbaec,0xe373,0xbaef,0xbaf0,0xbaf8, -0xe368,0xe367,0xe364,0x0000,0xe36c,0xe369,0xe36d,0xbafd, -0x0000,0xe379,0xbaf2,0xe36e,0xe36f,0x0000,0xe36b,0x0000, -0x0000,0x0000,0xbafc,0x0000,0x0000,0x0000,0x0000,0xe6e7, -0xbd70,0xbd79,0xbd75,0xe6e4,0x0000,0xbd72,0xbd76,0xe6f0, -0xbd6c,0xe6e8,0x0000,0xbd74,0x0000,0x0000,0xe6eb,0xe6e6, -0xbd73,0xbd77,0xe6e5,0x0000,0xbd71,0x0000,0xe6ef,0xbd6e, -0xe6ee,0xe6ed,0xbd7a,0xe572,0xbd6d,0x0000,0xe6ec,0xe6e3, -0x0000,0xbd7b,0xe6ea,0xbd6f,0x0000,0x0000,0x0000,0x0000, -/* 0x7e00 */ -0x0000,0x0000,0x0000,0xe6e9,0x0000,0x0000,0x0000,0x0000, -0xbfa2,0xbfa7,0xbf7e,0xead8,0xeacf,0xeadb,0xead3,0xead9, -0xbfa8,0xbfa1,0xeacc,0xead2,0xeadc,0xead5,0xeada,0xeace, -0x0000,0x0000,0xead6,0xbfa3,0xead4,0xbfa6,0xbfa5,0xead0, -0xead1,0xeacd,0xead7,0xbfa4,0xeade,0xeadd,0x0000,0x0000, -0x0000,0xedda,0xedd6,0xc15f,0x0000,0xedd0,0xc159,0xc169, -0xeddc,0xc161,0xc15d,0xedd3,0xc164,0xc167,0xedde,0xc15c, -0xedd5,0xc165,0xede0,0xeddd,0xedd1,0xc160,0xc15a,0xc168, -0xedd8,0xc163,0xedd2,0xc15e,0xeddf,0xc162,0xc15b,0xedd9, -0xc166,0xedd7,0x0000,0x0000,0xeddb,0x0000,0x0000,0x0000, -0xf06e,0xf074,0xc2b9,0xf077,0xc2b4,0xc2b5,0xf06f,0xf076, -0xf071,0xc2ba,0xc2b7,0x0000,0xf06d,0x0000,0xc2b6,0xf073, -0xf075,0xc2b8,0xf072,0xf070,0x0000,0x0000,0x0000,0x0000, -0xf2b8,0xc3b7,0xc3b8,0xc3b4,0x0000,0xc3b5,0x0000,0xf2b4, -0xf2b2,0x0000,0xf2b6,0xc3ba,0xf2b7,0xf2b0,0xf2af,0xf2b3, -0xf2b1,0xc3b6,0xf2b5,0xf4ac,0xc47e,0xc47d,0xf4ad,0x0000, -0xf4af,0xf4ae,0xc4a1,0x0000,0x0000,0x0000,0xf5eb,0xf5e8, -0xf5e9,0x0000,0xf5e7,0xf5ea,0xc4f2,0xf5ec,0x0000,0xc4f1, -0x0000,0xf742,0x0000,0xc5d5,0xc5d7,0xf7ee,0xc5d6,0xf8b9, -0xf940,0xf942,0xf8fe,0xf941,0xc66c,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x7f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa6ce,0x0000, -0xacfb,0xd26f,0xafca,0x0000,0x0000,0xb2da,0xdafc,0xdafd, -0x0000,0x0000,0x0000,0xeadf,0xc16a,0xede1,0x0000,0x0000, -0xc2bb,0x0000,0xf2ba,0xf2b9,0xc4a2,0xf5ed,0x0000,0xf743, -0xc5f8,0xca49,0x0000,0x0000,0xaac9,0xa875,0x0000,0x0000, -0xd04d,0x0000,0x0000,0xd360,0xd35b,0xd35f,0xd35d,0xafcb, -0xd35e,0xd35c,0x0000,0xd6f1,0x0000,0xdafe,0xdb40,0xdf69, -0xdf6a,0xb86e,0xb86f,0xdf68,0xdf6b,0xdf67,0xb86d,0x0000, -0xbb40,0x0000,0xb870,0xe37a,0x0000,0xbd7c,0xe6f1,0xbd7d, -0x0000,0xbfa9,0xeae2,0xeae0,0xeae1,0xede4,0xede3,0xede2, -0x0000,0x0000,0x0000,0xf2bb,0x0000,0xc3b9,0xf2bc,0xf744, -0xc5f9,0xf8ba,0xa6cf,0xaacb,0xaaca,0xd04f,0xacfc,0x0000, -0x0000,0xd04e,0xd362,0x0000,0xafcc,0xd6f2,0xd361,0x0000, -0x0000,0x0000,0xb2dc,0xd6f5,0xd6f3,0xd6f4,0xb2db,0x0000, -0xdb42,0xdb43,0xdb41,0x0000,0xb873,0xdf6d,0xdf6c,0xdf6e, -0xb872,0xb871,0x0000,0x0000,0xe6f2,0xe6f4,0x0000,0xbd7e, -0xe6f3,0xeae3,0xbfaa,0xf079,0x0000,0xf078,0xc3bb,0xf2bd, -0xc3bd,0xc3bc,0xf4b0,0xf5ee,0xc4f3,0xa6d0,0xd050,0xacfd, -0xd365,0xafce,0xd364,0xd363,0x0000,0xafcd,0x0000,0xd6fb, -0x0000,0xd6fd,0xd6f6,0xd6f7,0xb2dd,0xd6f8,0xb2de,0xd6fc, -0xd6f9,0xd6fa,0xb2df,0x0000,0xb5be,0xb5bf,0x0000,0xdb44, -0x0000,0x0000,0x0000,0xdf6f,0xdf70,0x0000,0xe37e,0xbb43, -0xbb41,0xbb42,0xe37b,0xe37c,0x0000,0xe37d,0xe6f9,0x0000, -0xe6fa,0xbda1,0xe6f7,0xe6f6,0xe6f8,0xe6f5,0xbfad,0xeae4, -0xbfab,0xbfac,0xede6,0xc16b,0xede5,0xefa8,0x0000,0xf07a, -0xf07b,0xc2bc,0x0000,0xc2bd,0xc16c,0xf2be,0xf2bf,0xf4b1, -0xc4a3,0xa6d1,0x0000,0xa6d2,0xacfe,0xaacc,0xafcf,0xd051, -0x0000,0x0000,0x0000,0xb5c0,0xa6d3,0xad41,0xd052,0xd053, -0xad40,0xad42,0xa6d4,0x0000,0xd054,0xafd1,0xd366,0xafd3, -0xafd0,0xafd2,0x0000,0xd741,0xb2e0,0x0000,0xd740,0xd6fe, -0x0000,0xdf71,0x0000,0x0000,0xe3a1,0x0000,0xbda2,0x0000, -0xbfae,0xeae6,0xeae5,0x0000,0xede7,0x0000,0x0000,0x0000, -0xf5ef,0x0000,0x0000,0xa6d5,0xcb73,0xcdaa,0xad43,0xd055, -0x0000,0xd368,0x0000,0x0000,0x0000,0xafd4,0xd367,0xafd5, -0x0000,0x0000,0x0000,0xd743,0x0000,0x0000,0xb2e2,0xd742, -0xd744,0x0000,0xb2e1,0x0000,0x0000,0x0000,0x0000,0xdb46, -0xdb47,0xdb45,0xb5c1,0x0000,0x0000,0x0000,0xb874,0x0000, -0xb875,0x0000,0xbb45,0x0000,0xe3a3,0xe3a2,0xbb44,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe6fb,0x0000,0x0000,0xe6fc, -0x0000,0x0000,0x0000,0x0000,0xeae7,0x0000,0x0000,0xc170, -0xc16f,0xc16d,0xc16e,0xc171,0x0000,0xf07c,0xc2bf,0xc2be, -0xf2c0,0xf4b2,0x0000,0x0000,0x0000,0xc5a5,0xc5a4,0xa6d6, -0x0000,0x0000,0xd1fb,0x0000,0xb877,0xb5c2,0xb876,0xbb46, -0x0000,0xa6d7,0xc9a9,0xa6d8,0xa6d9,0x0000,0x0000,0xcdab, -0xcb76,0x0000,0xcb77,0xa877,0x0000,0xcb74,0xa876,0x0000, -0xa879,0xcb75,0xa87b,0xa87a,0xcb78,0xa878,0x0000,0x0000, -0x0000,0xaad1,0xaacf,0xcdad,0x0000,0xaace,0x0000,0x0000, -0x0000,0xaad3,0xaad5,0xaad2,0x0000,0xcdb0,0xcdac,0xaad6, -0x0000,0xaad0,0xa87c,0x0000,0xaad4,0xcdaf,0x0000,0x0000, -0xcdae,0x0000,0xaacd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd05b,0xad47,0xad48,0xd05d,0x0000,0xd057, -0xd05a,0xd063,0xd061,0x0000,0xad49,0xd067,0xad4c,0xd064, -0xd05c,0xd059,0x0000,0x0000,0xdb49,0xd062,0xad44,0xd065, -0xd056,0xd05f,0xad46,0xad4b,0xd060,0xad4f,0xad4d,0x0000, -0xd058,0xad4a,0x0000,0xd05e,0xad4e,0xad45,0xd066,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xafda,0x0000,0xafe3, -0xafd8,0xafd6,0xd36a,0xafde,0xafdb,0xd36c,0x0000,0x0000, -0xafdd,0xd36b,0xd369,0xd36e,0xafe2,0xafe0,0xdb48,0x0000, -0xd36f,0xd36d,0xafd7,0x0000,0x0000,0xafd9,0xafdc,0x0000, -0xafdf,0x0000,0xafe1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd74e,0xb2e4,0x0000, -0xd745,0xd747,0x0000,0xd748,0x0000,0xd750,0xd74c,0xd74a, -0x0000,0xd74d,0xd751,0xb2e5,0xb2e9,0xd746,0x0000,0xd74f, -0x0000,0xb2e7,0x0000,0xb2e6,0xd74b,0xd749,0x0000,0xb2e3, -0xb2e8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xb5c8,0xdb51,0x0000,0x0000,0xdb4f,0xb5ca,0x0000, -0x0000,0x0000,0x0000,0xdb4a,0xdfa1,0x0000,0xb5c9,0xdb4e, -0x0000,0x0000,0xdb4b,0xb5c5,0xb5cb,0xdb50,0xb5c7,0xdb4d, -0xbb47,0xb5c6,0xdb4c,0xb5cc,0xb5c4,0xb5c3,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdf77,0xdf75,0x0000,0xdf7b,0x0000, -0xdf73,0xdfa2,0xdf78,0x0000,0xdf72,0xb87b,0xb8a3,0xdf7d, -0x0000,0xdf76,0x0000,0xb87e,0x0000,0x0000,0xb87c,0xdf7e, -0xb879,0xb878,0xdf79,0xb87d,0xb5cd,0x0000,0xdf7c,0xdf74, -0xb87a,0xb8a1,0xb8a2,0x0000,0x0000,0x0000,0x0000,0xbb4c, -0xbb48,0x0000,0xbb4d,0xe3a6,0x0000,0x0000,0xe3a5,0xe3a7, -0xbb4a,0xe3a4,0xbb4b,0xe3aa,0xe3a9,0xe3a8,0x0000,0xbb49, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe741,0x0000,0xe744, -0xbda8,0xe743,0xbda7,0xbda3,0xbda4,0xbda5,0xe740,0xe6fe, -0xbda6,0x0000,0xe742,0xe6fd,0x0000,0x0000,0xeae9,0xeaf3, -0xbfb1,0xbfb0,0x0000,0xeaed,0xeaef,0x0000,0xeaea,0x0000, -0xeaee,0xeae8,0xeaf1,0xbfaf,0xeaf0,0xeaec,0x0000,0xeaf2, -0x0000,0xeaeb,0xc174,0xede8,0xedee,0xc178,0xc17a,0xc177, -0xc176,0x0000,0xc175,0xc173,0xede9,0xedec,0xc172,0xeded, -0x0000,0xc179,0xedeb,0x0000,0xedea,0xc2c0,0x0000,0xc2c1, -0xf0a1,0xf07d,0xf07e,0x0000,0x0000,0xf2c2,0x0000,0xf2c1, -0xc3be,0xf4b4,0xc4a4,0xf4b3,0x0000,0xf5f0,0xf745,0xc5a6, -0xf943,0xf944,0xc5d8,0xa6da,0x0000,0xaad7,0xdb52,0xbb4e, -0xc17b,0xedef,0xa6db,0x0000,0xafe5,0xafe4,0xdb53,0x0000, -0x0000,0x0000,0xeaf4,0xa6dc,0xad50,0x0000,0x0000,0xdb54, -0xdb55,0xdb56,0xbb4f,0xbfb2,0xa6dd,0x0000,0xaad8,0xd068, -0xafe6,0xd370,0xb2ea,0x0000,0xdb57,0xb8a4,0x0000,0xbb50, -0xbfb3,0xc17c,0xc2c2,0xf4b5,0xa6de,0xaad9,0x0000,0x0000, -0xafe7,0xd752,0xb5ce,0x0000,0xbb51,0xe3ab,0xe745,0x0000, -0x0000,0x0000,0x0000,0xa6df,0xb5cf,0xdfa3,0xbb52,0xa6e0, -0xcdb1,0xd069,0xad51,0x0000,0x0000,0xd372,0x0000,0x0000, -0xafea,0x0000,0xafe8,0xafe9,0xafeb,0x0000,0x0000,0xd371, -0x0000,0x0000,0xd757,0xd754,0xd756,0xb2eb,0xb2ed,0xb2ec, -0xd753,0xb2ee,0xd755,0x0000,0xdb58,0xdb59,0x0000,0xdb5a, -0xdfa6,0x0000,0xdfa7,0x0000,0xdfa5,0xdfa8,0x0000,0xb8a5, -0x0000,0xdfa4,0x0000,0xbb53,0x0000,0x0000,0xe74a,0xe746, -0xe749,0xe74b,0xe748,0xe747,0x0000,0xeaf5,0xeaf6,0xeaf7, -0xbfb4,0xbfb5,0xedf1,0xedf0,0xedf2,0x0000,0xf0a3,0xf0a2, -0x0000,0xf2c4,0x0000,0xf2c5,0xf2c3,0x0000,0xc4a5,0x0000, -0xf4b6,0xf4b7,0x0000,0xf746,0xf7ef,0xf8bb,0xa6e1,0xa87d, -0x0000,0xc17d,0xa6e2,0x0000,0xd758,0xdb5b,0x0000,0xc641, -0xca4a,0x0000,0x0000,0x0000,0xca4b,0xca4d,0xa6e3,0xca4e, -0xca4c,0x0000,0x0000,0xcba2,0xcba3,0xcb7b,0x0000,0x0000, -0x0000,0x0000,0xcba1,0xa8a1,0x0000,0xa8a2,0xcb7c,0xcb7a, -0xcb79,0xcb7d,0xa87e,0xcb7e,0xd06a,0x0000,0x0000,0x0000, -0xcdb6,0xaadc,0xcdb5,0xcdb7,0x0000,0xaadb,0xcdbc,0xaadf, -0xcdb2,0xcdc0,0xcdc6,0xaae6,0xcdc3,0xaae3,0x0000,0xcdb9, -0xcdbf,0xcdc1,0x0000,0xcdb4,0xaae2,0xaadd,0xcdba,0xaae4, -0xaae7,0xaae1,0x0000,0xaada,0xcdbe,0xcdb8,0xcdc5,0xaae9, -0xaae5,0xaae0,0xcdbd,0xafec,0xcdbb,0xaade,0xaae8,0x0000, -0xcdb3,0x0000,0xcdc2,0xcdc4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xad62,0xad5c,0xad64,0xad61,0xd071,0xd074,0xad5d, -0x0000,0xd06b,0x0000,0xad56,0xad60,0x0000,0xad63,0xad65, -0xd0a2,0xd077,0x0000,0xad55,0xd0a1,0xad59,0xad57,0xad52, -0xd06f,0x0000,0xd07e,0xd073,0xd076,0xd0a5,0x0000,0xad66, -0xd07d,0xad5e,0xd078,0xd0a4,0xd075,0xd079,0xd07c,0x0000, -0x0000,0xd06d,0xd0a3,0xd07b,0x0000,0x0000,0xd06c,0x0000, -0xd070,0xad5f,0xad5a,0xad53,0xad58,0xad54,0xad67,0xd06e, -0xd3a5,0xad5b,0x0000,0x0000,0xd07a,0xce41,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3a8,0xaffa, -0x0000,0xd376,0x0000,0xd3a3,0xd37d,0x0000,0xd3b2,0x0000, -0xd3aa,0x0000,0xd37e,0x0000,0xd3a9,0xd378,0xd37c,0xd3b5, -0xaffd,0xd3ad,0xd3a4,0xafed,0xd3b3,0xd374,0x0000,0xd3ac, -0x0000,0xaffc,0xaff7,0xd373,0xaff5,0xaff4,0xaff9,0xd3ab, -0xaff1,0xaff8,0xd072,0xdb5c,0xd3a6,0x0000,0x0000,0xd37a, -0xaffb,0xd37b,0xd3a1,0xaffe,0xd375,0xd3af,0x0000,0xd3ae, -0xd3b6,0xaff3,0xaff0,0xd3b4,0xd3b0,0xd3a7,0xd3a2,0xaff6, -0xaff2,0xd377,0xafee,0xd3b1,0xafef,0x0000,0xd379,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd75e,0xd760,0xd765,0xd779,0xb2fc, -0xb2f2,0x0000,0xd75d,0xb2fd,0xb2fe,0xd768,0xd76f,0xd775, -0x0000,0xd762,0x0000,0xd769,0x0000,0x0000,0xb340,0xd777, -0xd772,0xb2fa,0xb2f8,0xd76e,0xd76a,0xd75c,0xb2ef,0xd761, -0xd759,0x0000,0xb2f7,0xb2f9,0xd766,0xd763,0xb2f4,0xd773, -0xb2f1,0xd764,0xd77a,0xd76c,0x0000,0xd76b,0xb2f0,0x0000, -0xb2fb,0x0000,0xb2f3,0xd75a,0xd75f,0xd770,0xd776,0xb341, -0xd75b,0xd767,0xd76d,0xb2f6,0x0000,0x0000,0xd778,0xd771, -0xd774,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xb2f5,0x0000,0xdb6c, -0xdb60,0xb5d7,0xdb7d,0xdba7,0xdbaa,0xb5d5,0xdb68,0xdba3, -0xdb69,0xdb77,0xb5e2,0xdb73,0xb5df,0x0000,0xdb74,0xdb5d, -0x0000,0xdba4,0x0000,0x0000,0xb5e8,0xdba1,0xdb75,0xdbac, -0xdb70,0xdfc8,0x0000,0xdbaf,0xb5e6,0xdb6e,0xdb7a,0xb5e9, -0xb5d4,0xdb72,0xdbad,0xdb6b,0xdb64,0xdb6f,0x0000,0xdb63, -0xdb61,0xb5d0,0xdba5,0xdb6a,0xdba8,0x0000,0xdba9,0xb5d8, -0xb5dd,0xb5d9,0xb5e1,0xdb7e,0xb5da,0xdb76,0xdb66,0x0000, -0xb5d2,0xdb5e,0xdba2,0xdbab,0xdb65,0xb5e0,0xdbb0,0xdb71, -/* 0x8400 */ -0x0000,0xdb6d,0x0000,0xb5d1,0xb5e5,0x0000,0xdb7c,0xb5e7, -0x0000,0xdb78,0xb5dc,0xb5d6,0xb5de,0xb5d3,0xb5e4,0xdb79, -0xdb67,0xdb7b,0xdb62,0xdba6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdbae,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdb5f,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdfc7,0x0000,0xdfdd,0xb855,0xdfcc,0x0000,0xdfca, -0xdfb5,0xb8a9,0xdfc5,0xdfd9,0xdfc1,0xb8b1,0xdfd8,0xdfbf, -0xb5e3,0xdfcf,0xdfc0,0xdfd6,0xb8b0,0xb8a8,0x0000,0xdfaa, -0xdfb2,0x0000,0xdfcb,0xdfc3,0xdfdc,0xdfc6,0xb8b6,0xdfd7, -0x0000,0xb8ad,0x0000,0xdfc9,0xdfd1,0xdfb6,0xdfd0,0x0000, -0xdfe1,0xdfb1,0xdfd2,0x0000,0xdfdf,0x0000,0xdfab,0xb5db, -0x0000,0xdfb9,0xdfb8,0xb8af,0x0000,0xdfbc,0xdfbe,0xdfcd, -0xdfde,0xb8b2,0x0000,0xb8b3,0x0000,0xdfb0,0xb8ab,0xdfb4, -0xdfda,0xb8b4,0x0000,0xb8ac,0xb8ae,0xb8b5,0xdfe0,0xdfd3, -0xdfce,0x0000,0x0000,0xdfbb,0xdfba,0xb8aa,0xdfac,0xb8a7, -0xdfc4,0xdfad,0xdfc2,0x0000,0x0000,0xdfb7,0xdfdb,0x0000, -0x0000,0x0000,0xb8a6,0x0000,0x0000,0x0000,0xdfb3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdfaf,0xdfd5,0xdfae, -0xbb60,0xe3d3,0x0000,0x0000,0xe3c2,0x0000,0x0000,0xe3ac, -0xe3ca,0xbb58,0xe3bb,0xe3c5,0xbb5b,0xe3be,0xbb59,0xe3af, -0xe3cd,0xe3ae,0xe3c1,0x0000,0xe3ad,0x0000,0x0000,0xe3bf, -0xe3c8,0xe3c6,0xe3ba,0xe3b5,0xe3b3,0x0000,0xe3b4,0xe3c7, -0xe3d2,0xe3bc,0xbb5a,0x0000,0xe3b7,0x0000,0xe3cb,0x0000, -0xbb5d,0xe3b6,0xe3b0,0xe3c0,0xbb61,0x0000,0x0000,0xbb55, -0xbb5e,0xe3b8,0xe3b2,0x0000,0xbb57,0xdfd4,0xbb56,0xe3c3, -0x0000,0xbb54,0xbb63,0xbb5c,0xe3c4,0xe3b9,0xe3b1,0xe3cc, -0xe3bd,0xbb62,0xe3d0,0xbb5f,0xe3cf,0x0000,0xe3c9,0xe3ce, -0x0000,0x0000,0x0000,0xe3d1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe773, -0xe774,0xe767,0xe766,0xe762,0xbdb4,0x0000,0xbdac,0xe776, -0xe775,0xdfa9,0xe75f,0xe763,0xe75d,0x0000,0xe770,0xe761, -0x0000,0xe777,0xe75a,0xe758,0xe764,0xe76e,0xe769,0xbdb6, -0xe74f,0x0000,0xe76d,0x0000,0x0000,0x0000,0xbdb7,0xdfbd, -0xe75b,0xe752,0xe755,0xe77b,0xe75c,0xe753,0xe751,0xe74e, -0x0000,0xbdb0,0xe765,0xbdaf,0xbdb3,0xe760,0xe768,0xbda9, -0xe778,0xe77c,0xbdab,0x0000,0xe757,0xe76b,0xe76f,0xe754, -0xe779,0xbdb2,0x0000,0xbdb1,0xe74c,0xbdb5,0xe772,0xe756, -0xe76a,0xe750,0xe75e,0xe759,0xbdad,0xbdae,0xe76c,0xe77d, -0xe77a,0xe771,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe74d,0x0000,0xbdaa,0xeb49,0x0000, -0xeb40,0xeb43,0x0000,0xbfbb,0xeb45,0xeaf9,0xeb41,0xeb47, -0xbfb8,0xbfbc,0xbfb6,0x0000,0x0000,0xeafb,0xeb4c,0x0000, -0x0000,0xeb46,0x0000,0xeafc,0xeb55,0xeb4f,0xeaf8,0xee46, -0xeafe,0xbfb7,0x0000,0xeb4a,0x0000,0xeb54,0xbfbf,0x0000, -0xeb51,0xeafd,0xeb44,0xeb48,0xeb42,0xeb56,0xeb53,0xeb50, -0xbfb9,0xbfba,0xbfbe,0xeafa,0xeb57,0xbfbd,0xeb4d,0x0000, -0x0000,0xeb4b,0x0000,0x0000,0x0000,0xeb4e,0xee53,0xee40, -0xee45,0xee52,0xee44,0xedfb,0xee41,0x0000,0xc1a2,0x0000, -0xedf4,0xee4d,0xee4f,0xedf3,0xc1a1,0xee51,0xee49,0xc1a8, -0xee50,0xee42,0xc1aa,0xedf9,0xeb52,0xee4a,0xee47,0xedf5, -0xee55,0xc1a4,0x0000,0x0000,0xc1a5,0xedf7,0xee48,0x0000, -0xee54,0xee4b,0xedfd,0xc1a7,0xc1a3,0xee4c,0xedfe,0xee56, -0xedf8,0xee43,0xee4e,0xedfa,0xedfc,0x0000,0xc2cb,0xedf6, -0xc1a9,0xc2c4,0xc17e,0x0000,0x0000,0x0000,0x0000,0xc1a6, -0xc2c8,0xf0b3,0x0000,0xf0a9,0xf0a4,0xf0aa,0xf0b4,0xf0b8, -0xf0b7,0xc2ca,0xc2c9,0x0000,0x0000,0xf0ab,0xf0b9,0xf0ae, -0xf0a6,0x0000,0xf0a8,0xf0a7,0xf0ad,0xf0b2,0xf0a5,0xf0ac, -0xf0b1,0xc2c7,0x0000,0xf0af,0x0000,0xc2c5,0xf0b0,0xc2c3, -0xc2c6,0xf2d5,0xf0b5,0x0000,0x0000,0xc3c2,0x0000,0xf2cd, -0xf2d1,0xf2c9,0xf2cc,0x0000,0xf2d4,0xc3c0,0xf2d9,0xf2d2, -0x0000,0xf2ca,0xf2da,0xf2d3,0xc3c3,0xc3c4,0xf2d7,0x0000, -0xf2cb,0xc3bf,0xc3c1,0xf2c6,0xf2ce,0xf2c8,0x0000,0xf2d8, -0xf2d6,0xf2c7,0xf2cf,0x0000,0x0000,0x0000,0xf4be,0xc3c5, -0xf2d0,0xc4a7,0xc4a9,0xc4a6,0x0000,0xf4c3,0xf4bb,0xf4b9, -0xf4bd,0xf4ba,0x0000,0x0000,0xf4bf,0xf4c1,0xc4aa,0xc4ac, -0x0000,0xf4c0,0xc4ad,0xc4ab,0xf4c2,0x0000,0x0000,0x0000, -0x0000,0xc4a8,0x0000,0x0000,0x0000,0x0000,0x0000,0xc4f4, -0xf5f1,0xf5f7,0xc4f6,0xf4bc,0xf5f6,0x0000,0xf5fd,0xf5f4, -0xf5fb,0xf5fa,0xf4b8,0xf5f5,0xf0b6,0xf5fe,0xf5f3,0xf5f8, -0x0000,0xf5fc,0xf5f2,0x0000,0xf74a,0xc4f5,0xf5f9,0x0000, -0x0000,0xf7f4,0xf74b,0xf749,0xf747,0xf748,0xf74c,0x0000, -0xc5d9,0xf7f2,0xf7f0,0xf7f5,0xf7f3,0x0000,0xf7f6,0xc5da, -0xf7f1,0x0000,0x0000,0xf8bc,0x0000,0x0000,0xf945,0xf946, -0xf947,0x0000,0x0000,0xf9c7,0xf9bd,0xca4f,0xaaea,0x0000, -0xad68,0x0000,0xd3b8,0xd3b7,0xb040,0xb342,0xd77c,0x0000, -0x0000,0xd77b,0x0000,0xb5ea,0xb8b8,0x0000,0xb8b7,0xb8b9, -0x0000,0xe3d4,0xe77e,0xeb58,0xeb5a,0xeb59,0x0000,0xc1ab, -0xee57,0xf0ba,0xf9a5,0xa6e4,0x0000,0xcdc9,0xcdca,0xcdc8, -0xcdc7,0xaaeb,0x0000,0xd0a9,0xd0a7,0x0000,0x0000,0xd0a6, -0x0000,0xad69,0xad6b,0xad6a,0xd0a8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd3c4,0xd3c1,0xd3bf, -0x0000,0x0000,0xb041,0xd3c2,0xb046,0xd3bc,0xd3cb,0x0000, -0xd3cd,0xd3bd,0x0000,0xb043,0xd3ce,0xd3c9,0xd3bb,0xd3c0, -0xd3ca,0xd3c6,0xd3c3,0x0000,0xb048,0xd3cc,0xd3be,0x0000, -0x0000,0xd3c7,0xd3b9,0xb047,0xb044,0xd3c5,0x0000,0xd3c8, -0xd3ba,0xb045,0xb042,0x0000,0x0000,0x0000,0x0000,0xb34c, -0xd7a5,0xb34b,0x0000,0xd7a8,0xd7ab,0xb348,0xb346,0xd77e, -0xd7a9,0xd7a7,0xd7a4,0xd7ac,0xd7ad,0xd7af,0xd7b0,0xd77d, -0xb345,0xd7a2,0xd7a1,0xd7ae,0xb347,0xd7a3,0xb349,0xb344, -0xd7a6,0xb34d,0x0000,0xb34a,0xd7aa,0x0000,0x0000,0x0000, -0xb5f1,0xdbbf,0x0000,0xdbb4,0xb5ee,0x0000,0xdfe7,0xdbbd, -0xdbb1,0xb5ec,0xdbb6,0xb5ef,0xdbba,0xdbb8,0xb5f2,0xb5eb, -0x0000,0x0000,0xdbb2,0xdbb5,0xb5f0,0x0000,0xdbb3,0x0000, -0xdbbe,0xdbbc,0xdbb7,0xdbb9,0xdbbb,0xb5ed,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdfe8,0xdfee,0xdfe4, -0xdfea,0xb8ba,0xdfe6,0xb8c0,0x0000,0x0000,0xb8bf,0x0000, -0xb8be,0xdfed,0xb8c1,0xb8c2,0xdfe3,0xdff0,0xb8c3,0xb8bd, -0xb8bc,0xdfec,0xb8c4,0xdfe2,0xdfe5,0xdfef,0xdfeb,0x0000, -0x0000,0xe3f4,0xe3e9,0xb8bb,0x0000,0x0000,0x0000,0x0000, -0xbb6a,0xe3dd,0xe3f2,0xe3de,0xbb65,0x0000,0xe3db,0x0000, -0xe3e4,0xe3dc,0xbb67,0xe3d6,0xe3f1,0xbb68,0xe3ee,0xe3ef, -0xe3d7,0xbb6d,0xe3e6,0x0000,0xe3e0,0xe3e7,0xe3da,0x0000, -0xe3f3,0xe3eb,0xe3e5,0xe3d5,0xbb69,0xe3ec,0x0000,0xbb6c, -0xe3f0,0x0000,0xe3ea,0xbb66,0xe3e8,0x0000,0xe3e2,0xbb64, -0xe3d9,0xe3e1,0xe3ed,0xe3df,0x0000,0x0000,0xe3e3,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbdc1,0xdfe9,0xe7b2,0xe7bb, -0xe7b1,0xe7ad,0xe7aa,0xbdc2,0xe7a8,0xbb6b,0xe7a1,0xbdc0, -0xe7a7,0xbdbf,0xe7ac,0xe7a9,0xe7b9,0xe7b4,0xe7ae,0xe7b3, -0xbdbb,0xe7ab,0xe7be,0xe7a2,0xe7a3,0xe7ba,0xbdbc,0xe7bf, -0xbdbe,0xe7c0,0xe7b0,0xe3d8,0xe7b6,0xe7af,0xe7b8,0xe7b5, -0x0000,0x0000,0x0000,0xe7a6,0xbdb9,0xe7bd,0xbdba,0xe7a4, -0xbdbd,0xeb64,0xe7b7,0xe7bc,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeb61,0xbdb8,0xbfc0,0xeb6b,0xeb67,0x0000,0xeb65, -0xeb60,0xeb6f,0x0000,0x0000,0x0000,0xbfc4,0x0000,0xeb5c, -0xeb68,0xeb69,0xeb5f,0xeb5e,0xeb6c,0x0000,0xeb62,0xeb5d, -0xeb63,0x0000,0xeb6e,0xeb5b,0xeb6d,0xeb6a,0xbfc2,0xbfc1, -0x0000,0x0000,0xbfc3,0xeb66,0xf0cb,0x0000,0x0000,0x0000, -0x0000,0x0000,0xee59,0xc1b1,0xee5d,0xee5a,0xee61,0xee67, -0xee5c,0x0000,0xee70,0xc1ae,0xee6a,0xee5f,0xee6b,0xee66, -0xee6d,0xee5e,0xc1b3,0xc1b2,0xee60,0xee6e,0xee58,0xee6c, -0xc1ac,0x0000,0xee64,0xee63,0xee68,0xee5b,0xc1b0,0x0000, -0xc1b4,0xee62,0xee69,0xc1b5,0xee65,0x0000,0x0000,0x0000, -0x0000,0xc1ad,0xc1af,0xf0c7,0xf0c5,0x0000,0x0000,0xf0cc, -0xf0c9,0xf0cd,0x0000,0xf0be,0xf0c6,0xf0d1,0xee6f,0xf0c2, -0xc2cf,0xe7a5,0xf0bd,0xf0ca,0xf0c4,0xf0c1,0xf0bc,0xf0bb, -0xf0d0,0x0000,0xf0c0,0xf0bf,0xc2cd,0xf0c8,0x0000,0xc2cc, -0x0000,0x0000,0xc2ce,0xf0c3,0xf0cf,0x0000,0xf2de,0xf2df, -0x0000,0xc3c9,0xf2dc,0xc3c6,0xf2e4,0x0000,0xc3ca,0xf2e6, -0xf2db,0xf0ce,0xf2e8,0xf2dd,0x0000,0xc3c7,0xf2e3,0x0000, -0xf2e5,0xf2e0,0xf2e7,0xf2e2,0xf2e1,0xc3c8,0x0000,0x0000, -0xf4c5,0xf4c6,0x0000,0xf4c8,0xc4ae,0xc4af,0xf4c9,0xf4c7, -0x0000,0xf4c4,0x0000,0xf642,0xf645,0xf641,0x0000,0xc4fa, -0xf643,0xc4f9,0xc4f8,0xc4f7,0xf644,0xf751,0xf74f,0x0000, -0xf74e,0xf640,0xf750,0xf646,0xf74d,0x0000,0xf7f9,0xf7d7, -0xf7f7,0xc5db,0xf7f8,0xf7fa,0x0000,0xf8bf,0xc5fa,0xf8be, -0xf8bd,0xc5fb,0x0000,0xc65a,0xf96e,0xf9a7,0xf9a6,0xf9a8, -0xa6e5,0xd0aa,0x0000,0xd3cf,0xd3d0,0x0000,0x0000,0x0000, -0xdbc0,0x0000,0xf647,0xf8c0,0xa6e6,0xad6c,0xd0ab,0x0000, -0x0000,0x0000,0xd7b1,0xb34e,0x0000,0xdbc2,0xdbc1,0xb5f3, -0x0000,0xb8c5,0xe7c1,0xbdc3,0x0000,0xbdc4,0x0000,0x0000, -0x0000,0xbfc5,0xc5fc,0xa6e7,0x0000,0x0000,0x0000,0xd0ac, -0xaaed,0xd0ae,0xd0ad,0xad6d,0x0000,0xd3d1,0x0000,0xd3d8, -0xb049,0xd3d6,0xd3d4,0x0000,0xd3db,0xd3d2,0xd3d3,0xb04a, -0x0000,0xb04e,0x0000,0x0000,0xd3dc,0xb04d,0xd3da,0xd3d7, -0xd3d5,0xb04b,0xb04c,0xd3d9,0x0000,0x0000,0x0000,0x0000, -0xb350,0xd7b2,0x0000,0xb355,0xd7c2,0xb354,0xd7c4,0x0000, -0x0000,0xd7b8,0xb352,0xd7c3,0x0000,0xd7b3,0xb353,0xd7bf, -0xd7bb,0xd7bd,0xd7b7,0xd7be,0x0000,0x0000,0xb34f,0xd7ba, -0x0000,0xd7b9,0xd7b5,0x0000,0xd7c0,0x0000,0x0000,0xd7bc, -0xd7b4,0x0000,0xd7b6,0xb351,0xd7c1,0x0000,0x0000,0x0000, -0x0000,0xb5f6,0xdbcd,0x0000,0x0000,0x0000,0xdbc9,0xdbcb, -0xdbc6,0xdbc5,0xdbc3,0x0000,0xdbca,0xdbcc,0xdbc8,0x0000, -0xdbc7,0xb5f4,0xb5f5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdbcf,0xb8cd,0xdff2,0xdff8,0xdff3,0xdff4,0xf9d8, -0xdff9,0x0000,0xb8cf,0x0000,0xb8c7,0xb8ce,0xdff1,0xdbc4, -0xb8ca,0xb8c8,0xdff7,0xdff6,0xb8c9,0xb8cb,0xdff5,0xb8c6, -0x0000,0xb8cc,0x0000,0x0000,0x0000,0x0000,0x0000,0xe3f6, -0xbb74,0x0000,0x0000,0xe442,0xe441,0x0000,0xe3fb,0xbb76, -0xe440,0xe3f7,0xe3f8,0xbb6e,0xbb70,0x0000,0xe3fd,0xe3f5, -0xbb72,0xbb71,0xe3f9,0xe3fe,0xe3fc,0xbb73,0xe3fa,0x0000, -/* 0x8900 */ -0x0000,0xdbce,0xbb6f,0x0000,0x0000,0xe7c2,0xe7c9,0xbdc6, -0x0000,0xe7cd,0xbdca,0xe7c5,0xe7c3,0x0000,0xe7cc,0x0000, -0xbdc5,0xe7cb,0xbdc7,0xbdc8,0xe7c4,0xbdc9,0xe7ca,0xe7c6, -0xe7c7,0xe7c8,0xbb75,0x0000,0x0000,0x0000,0xeb70,0xeb7c, -0x0000,0xbfca,0xeb77,0xeb79,0x0000,0xbfc8,0xeb71,0xeb75, -0x0000,0xeb78,0xbfc6,0xbfc9,0xeb7b,0xeb73,0xeb74,0xeb7a, -0xeb72,0xeb76,0xbfc7,0xee72,0x0000,0xee71,0xc1b7,0xee77, -0xc1b9,0x0000,0x0000,0xc1b6,0xee73,0xc1ba,0xee74,0x0000, -0x0000,0xee75,0xee78,0x0000,0xc1b8,0x0000,0xf0d6,0x0000, -0x0000,0xf0d9,0x0000,0xf0d3,0xf0d5,0x0000,0x0000,0xf0d4, -0xf0d7,0xf0d8,0xee76,0xf0d2,0x0000,0x0000,0xc3cd,0xf2ec, -0xf2ef,0xf2f1,0xf2ea,0xf2eb,0xf2ee,0xf2f0,0xc3ce,0xc3cc, -0xc3cb,0xf2ed,0xf2e9,0xf4ca,0xc4b0,0x0000,0xf4cb,0x0000, -0x0000,0xf649,0xc4fb,0xf64b,0xc4fc,0xf648,0xf64a,0xc5a8, -0x0000,0xf752,0xc5a7,0xf7fd,0xf7fc,0x0000,0xf7fb,0x0000, -0x0000,0xf948,0xf949,0xf94b,0xf94a,0x0000,0xca50,0xa6e8, -0x0000,0xad6e,0xd7c5,0xb5f7,0x0000,0xdffa,0xc2d0,0x0000, -0xf2f2,0x0000,0x0000,0xa8a3,0x0000,0x0000,0x0000,0xb357, -0x0000,0x0000,0x0000,0xb356,0x0000,0xdbd0,0xb5f8,0xdbd2, -0xdbd1,0x0000,0x0000,0xdffb,0xb8d0,0xe443,0xe446,0xe445, -0x0000,0xe444,0xe7ce,0xe7d0,0xe7cf,0x0000,0xbfcc,0x0000, -0x0000,0x0000,0xbfcb,0x0000,0xc1bb,0xee79,0xee7b,0xee7a, -0x0000,0x0000,0xc2d1,0x0000,0x0000,0x0000,0xf2f4,0xf2f3, -0x0000,0xf4cc,0xc4b1,0x0000,0x0000,0xc4fd,0xf754,0xf753, -0xc65b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa8a4,0xd0af,0xad6f,0xd7c8,0xd7c6,0x0000, -0x0000,0xd7c7,0xdbd4,0xdbd5,0xe043,0xdbd3,0x0000,0xdffc, -0xe041,0xe040,0xe042,0xb8d1,0xdffe,0xdffd,0xe044,0x0000, -0xe449,0xe447,0x0000,0xe448,0xe7d3,0xe7d1,0x0000,0x0000, -0xe7d2,0xeb7d,0xee7c,0xee7d,0xc2d2,0x0000,0xf2f5,0xf4cd, -0xc4b2,0x0000,0xf64c,0xf755,0xc5a9,0x0000,0xf7fe,0xf94c, -0xa8a5,0x0000,0xad71,0xad72,0xd0b0,0x0000,0x0000,0xd0b1, -0xad70,0x0000,0xb054,0x0000,0xb052,0x0000,0xb051,0xb058, -0xb050,0xb059,0xd3dd,0xb056,0x0000,0xb053,0xb057,0xb055, -0xb04f,0x0000,0x0000,0xb35f,0x0000,0xb359,0xd7cc,0xb35e, -0x0000,0x0000,0xb360,0xb35a,0x0000,0xb35b,0x0000,0xd7ca, -0x0000,0x0000,0xb358,0x0000,0xd7cb,0xb35d,0x0000,0x0000, -0xd7c9,0xb35c,0x0000,0x0000,0xb644,0x0000,0xb646,0x0000, -0x0000,0xdbd8,0xb645,0xb5f9,0xb5fd,0x0000,0xb8e4,0xe049, -0xdbda,0xb5fe,0x0000,0x0000,0xdbdd,0xdbde,0xb643,0x0000, -0xdbe0,0x0000,0xdbe2,0x0000,0xdbe3,0xdbd7,0xdbd6,0xdbe4, -0xb642,0xdbe1,0xdbdf,0x0000,0xb640,0xb5fb,0xb647,0xdbdb, -0xdbdc,0xdbd9,0x0000,0xb641,0x0000,0x0000,0xb5fc,0x0000, -0xb5fa,0xe048,0xb8df,0xb8da,0x0000,0x0000,0xb8d5,0x0000, -0xb8e5,0xb8d6,0x0000,0xb8d2,0xb8e1,0xb8de,0xb8e0,0x0000, -0xb8d7,0xb8dc,0xb8d3,0xb8d4,0xe050,0xe04d,0xe045,0xe04a, -0x0000,0xb8e2,0xe051,0xb8e3,0xb8d9,0x0000,0x0000,0xe047, -0x0000,0xe04f,0xe04b,0xe04e,0xe04c,0xb8dd,0xe046,0xb8d8, -0x0000,0x0000,0x0000,0xe44c,0xbb78,0xbb7b,0x0000,0xe44e, -0x0000,0xbba5,0xe44d,0xbb7d,0x0000,0xbdcf,0xe44f,0x0000, -0xbba4,0xe44b,0xbba6,0x0000,0x0000,0x0000,0xbb79,0x0000, -0xb8db,0xbb7c,0x0000,0xbb7a,0xbb7e,0xbba2,0xbb77,0xbba7, -0xbba3,0x0000,0xbba1,0xe44a,0x0000,0x0000,0x0000,0x0000, -0xbdd6,0x0000,0xbdd2,0x0000,0x0000,0x0000,0xbdd9,0x0000, -0xe7d6,0xbdda,0xe7e2,0xe7db,0xbdcb,0xe7e3,0xe7dd,0xbdd5, -0xe7de,0x0000,0xbdd4,0xe7e1,0xbdce,0xe7df,0xe7d5,0xbdcd, -0xebaa,0xbdd3,0x0000,0xbdd0,0x0000,0xbdd8,0x0000,0xe7d4, -0x0000,0xe7d8,0xbdcc,0xe7d7,0xe7d9,0xe7da,0xbdd7,0xe7dc, -0xe7e0,0xe7e4,0x0000,0xbddb,0xbfd2,0xeba5,0xebab,0xeba8, -0xeb7e,0xebac,0xeba1,0x0000,0xeba7,0x0000,0xbfcd,0xbfd3, -0xebad,0x0000,0x0000,0xbfcf,0x0000,0xbfd9,0xbfd4,0xebaf, -0xeba9,0xbfd0,0xeba2,0xbfda,0xeba3,0xeba4,0xbfdb,0xbfd8, -0xbdd1,0x0000,0xbfce,0xebb0,0xbfdc,0x0000,0xbfd5,0xebae, -0xbfd1,0xbfd6,0xbfd7,0x0000,0xc1c3,0xeea4,0xeead,0xeeaa, -0xeeac,0x0000,0xc1c0,0xeea5,0x0000,0xeeab,0xc1bc,0xeea7, -0xc1c4,0xeea3,0xeea8,0xeeaf,0xeba6,0xeea9,0xeea2,0xc1bd, -0xeea1,0xc1be,0xeeb0,0xc1bf,0xeeae,0xc1c2,0xee7e,0x0000, -0xc1c1,0x0000,0xeea6,0xf0dc,0xf0ea,0xf0e5,0xf0e7,0xf0db, -0xc2d3,0x0000,0xf0da,0xc2d6,0xc2d5,0x0000,0xf0e9,0xf0e1, -0xf0de,0xf0e4,0x0000,0xf0dd,0x0000,0xf0df,0xf0e8,0xf0e6, -0x0000,0xc2d4,0xf0ed,0xf0eb,0xf0e2,0xf0ec,0xf0e3,0x0000, -0xf2f9,0xc3cf,0xf341,0x0000,0x0000,0xf64f,0xc3d6,0xf0e0, -0xf2f7,0xc3d2,0xf2f8,0xf2fd,0x0000,0x0000,0xc3d4,0xc3d5, -0xf2f6,0xf340,0xf342,0xf2fa,0xf2fc,0xf2fe,0xf2fb,0xf343, -0xc3d1,0xc3d7,0xc3d3,0x0000,0xc3d0,0xf4d0,0x0000,0xc4b7, -0xf4ce,0x0000,0x0000,0xf4d2,0x0000,0xf4d3,0xc4b5,0xf4d4, -0xf4d1,0x0000,0xf4cf,0xc4b8,0xc4b4,0xf4d5,0x0000,0xc4b6, -0xc4b3,0x0000,0x0000,0x0000,0xc4fe,0x0000,0x0000,0xc540, -0xf64e,0xf64d,0xf650,0xf651,0x0000,0xc541,0xf756,0xf75b, -0xc5aa,0x0000,0xf758,0x0000,0xf757,0xf75a,0xf759,0x0000, -0xf843,0x0000,0xc5dc,0xf842,0xf840,0x0000,0xf841,0x0000, -0x0000,0x0000,0xc5fe,0xc5fd,0xf8c1,0xf8c2,0xc640,0x0000, -0xf94d,0xf94e,0xc667,0x0000,0xc66d,0x0000,0xf9a9,0xf9c8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x8c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8a6, -0x0000,0xd7cd,0x0000,0xd7ce,0xe052,0xe450,0xe7e5,0xc1c6, -0x0000,0xc1c5,0xf0ee,0xf344,0x0000,0xf844,0xa8a7,0xd3de, -0xb05a,0xb361,0xe054,0xe053,0xbddc,0xe7e6,0xbddd,0xeeb1, -0xc2d7,0x0000,0x0000,0x0000,0xc676,0xa8a8,0xcdcb,0xd3df, -0x0000,0x0000,0xb362,0x0000,0xd7cf,0xd7d0,0x0000,0xdbe5, -0x0000,0xb648,0xb8e6,0x0000,0xe056,0xe055,0xe057,0x0000, -0xe451,0xe452,0xbba8,0xbfdd,0xbdde,0xbfde,0x0000,0xeeb5, -0xeeb2,0xeeb4,0xeeb3,0xc1c7,0x0000,0xf0ef,0xf346,0xf345, -0xcba4,0xb05c,0xb05b,0xd3e0,0x0000,0xd7d1,0x0000,0x0000, -0xdbe7,0xdbe6,0xb649,0x0000,0xe059,0xe05a,0xe058,0x0000, -0x0000,0xb8e8,0xb8e7,0x0000,0xbbaa,0xbba9,0x0000,0xe7e7, -0xebb3,0xebb1,0xebb2,0xbfdf,0xeeb7,0xeeb6,0x0000,0xf0f2, -0xf0f1,0xf0f0,0xf347,0x0000,0xf9aa,0xa8a9,0xad73,0x0000, -0xad74,0xb05d,0xb05e,0xd3e2,0xd3e1,0xd7d2,0x0000,0xb368, -0xb366,0xb363,0xb367,0xb365,0xb364,0x0000,0x0000,0xb64a, -0xdbea,0x0000,0xb8ed,0xb64c,0xb651,0xdbec,0xb653,0xb652, -0xb655,0xdbeb,0xdbe8,0xb64f,0xb64b,0xb64d,0xdbe9,0xb654, -0xb650,0xb64e,0xb8ef,0xb8ee,0xb8ec,0xb8f0,0x0000,0xb8ea, -0xb8eb,0x0000,0xb8e9,0x0000,0xe05b,0x0000,0x0000,0xe454, -0x0000,0xbbac,0xbbad,0xbbab,0x0000,0xe453,0x0000,0xe455, -0x0000,0xe7ea,0xe7ec,0x0000,0xbde7,0xe7ed,0xbde0,0xe7e9, -0xbddf,0xbde9,0xbde5,0xbde6,0xbde2,0xe7e8,0xbde1,0xe7ee, -0xe7eb,0x0000,0xbde8,0x0000,0xbde3,0xbde4,0xebb5,0x0000, -0xebb7,0xebb6,0x0000,0xebb8,0xbfe0,0xebb4,0x0000,0x0000, -0xc1cb,0xeeb8,0xc1c8,0xc1cc,0xc1ca,0xc1c9,0xf0f3,0x0000, -0xf0f6,0x0000,0xf0f5,0x0000,0xf0f4,0xc2d8,0xf348,0xf349, -0xc3d8,0xf34a,0xc3d9,0x0000,0x0000,0xc4ba,0x0000,0xc4b9, -0xf652,0x0000,0x0000,0xc542,0xf653,0xf75c,0xc5ab,0xc5ac, -0x0000,0xf845,0x0000,0xc642,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa8aa,0x0000,0xb36a,0xb369, -0xe05c,0xe05d,0x0000,0xbbae,0xebb9,0xbdea,0xebba,0xeeb9, -0xa8ab,0x0000,0xd0b2,0xad76,0xad75,0x0000,0xd3e3,0xb05f, -0xd3e4,0xd7d5,0x0000,0xd7d4,0x0000,0xd7d3,0x0000,0x0000, -0xdbee,0xb658,0x0000,0x0000,0xdbed,0xb657,0x0000,0x0000, -0x0000,0xdbef,0xb656,0x0000,0xe05f,0xe062,0xe060,0xe061, -0xe065,0xe05e,0xe066,0xe063,0xe064,0xbbb0,0xe456,0x0000, -0x0000,0xbbaf,0x0000,0xe7f2,0xe7f0,0x0000,0x0000,0xbdeb, -0xe7ef,0xe7f1,0x0000,0xbdec,0x0000,0xebbb,0x0000,0xebbc, -0xc1cd,0x0000,0xf34c,0xf34e,0xf34b,0xf34d,0xf4d6,0xf654, -0x0000,0x0000,0xf96f,0xa8ac,0xad77,0xd3e5,0xd3e7,0xd3e6, -0x0000,0xd7d8,0xb36c,0x0000,0xd7d6,0x0000,0xb36b,0xd7d9, -0x0000,0xd7da,0xd7d7,0x0000,0x0000,0xdbfb,0xb660,0xdbf3, -0xdbf9,0x0000,0x0000,0xb65b,0xb65e,0xdbf2,0xb659,0xdbf6, -0xe06c,0xb65d,0x0000,0xdbf1,0x0000,0xdbf7,0xdbf4,0xdbfa, -0xdbf0,0xdbf8,0xb65c,0xb65f,0xdbf5,0xb65a,0x0000,0xb8f2, -0xe068,0xb8f1,0xe06f,0xe06e,0xb8f8,0x0000,0xb8f9,0xe070, -0xb8f3,0xe06d,0xb8f7,0xe072,0xe069,0x0000,0xe06b,0xb8f4, -0xe067,0xe06a,0xe071,0xb8f5,0xe073,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb8f6,0x0000,0xbbb1,0xe45b,0xe461,0xe459, -0xe462,0x0000,0xe458,0xe45d,0xe463,0xe460,0xe45f,0xe45e, -0x0000,0xe457,0xe45c,0x0000,0x0000,0xe45a,0x0000,0xbdf1, -0xbdee,0xe7fb,0xe841,0xe843,0xe840,0xe7f8,0xe7fa,0xe845, -0xe842,0xe7fc,0xe846,0xe7f9,0xe844,0xbdef,0xbdf5,0xbdf3, -0xe7f3,0xbdf4,0xbdf0,0xe7f4,0xe7f6,0xe7f5,0xe7fd,0xe7fe, -0x0000,0xbdf2,0x0000,0xbded,0x0000,0x0000,0xe7f7,0x0000, -0xebc6,0xbfe2,0x0000,0xebbd,0xbfe3,0xbfe6,0xebc2,0x0000, -0xebbf,0xbfe5,0x0000,0x0000,0xebc3,0xebc4,0xebbe,0xebc7, -0xebc0,0xebc5,0xbfe4,0x0000,0xbfe1,0xebc1,0x0000,0xeebf, -0xc1d0,0xc1ce,0xc1d1,0xc1cf,0xeebe,0xeebb,0xeeba,0x0000, -0xeebd,0x0000,0x0000,0xeebc,0xf145,0xc2de,0xf0fb,0xf0fa, -0x0000,0xc2d9,0xf141,0xf140,0xf0f7,0xf143,0xf0fc,0xc2dd, -0xf0f9,0xf142,0xf0f8,0xc2da,0xc2dc,0xf0fd,0xc2db,0xf0fe, -0x0000,0xf144,0xf352,0x0000,0xc3de,0xf34f,0x0000,0xf353, -0x0000,0x0000,0xc3db,0xf351,0xc3e0,0x0000,0xc3dd,0x0000, -0xf350,0x0000,0xc3df,0xf354,0xc3da,0x0000,0x0000,0x0000, -0x0000,0xc4bc,0xc4be,0x0000,0xf4d9,0xc4bd,0xf4d7,0xc3dc, -0xf4d8,0xc4bb,0xc543,0xc545,0xf656,0xc544,0xf655,0x0000, -0xf761,0xc5ad,0xf760,0xc5ae,0xf75e,0xf75d,0xf762,0xf763, -0xf846,0x0000,0xf75f,0x0000,0x0000,0xf8c6,0xf8c3,0xf8c4, -0xf8c5,0xc65c,0x0000,0xf951,0xf950,0xf94f,0xf970,0x0000, -0xf9be,0xf9ab,0xc66e,0xa8ad,0xb060,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb8fa,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xbdf6,0x0000,0x0000,0xebc8,0x0000,0x0000, -0xc2df,0x0000,0xf355,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf9ac,0xa8ae,0xaaee,0xad79,0xad78,0x0000,0xb063, -0x0000,0xd3e8,0xb061,0xd3e9,0xb062,0x0000,0x0000,0xd7df, -0xd7db,0x0000,0x0000,0xb36d,0xd7de,0xd7dd,0xd7dc,0xb36e, -0xd7e0,0xd7e1,0x0000,0x0000,0x0000,0xdc43,0xdc41,0xdc45, -0xdc46,0xdc4c,0x0000,0xdc48,0xdc4a,0x0000,0xdc42,0xdbfc, -0x0000,0xdc49,0x0000,0x0000,0xdc4b,0xdc44,0xdc47,0xdbfd, -0xb662,0xdc40,0xdbfe,0xb661,0xb663,0x0000,0xb8fd,0xe075, -0xe077,0xe076,0xe07b,0xb8fb,0x0000,0xe078,0xe074,0xe079, -0xe07a,0xb8fc,0xb8fe,0xe07c,0x0000,0xe467,0xe466,0x0000, -0xe464,0xe465,0xbbb3,0xbbb5,0xbbb2,0xbbb4,0xe84d,0xe84e, -0xe849,0x0000,0xe84a,0xbdf8,0xbdfd,0xbdf7,0xbdfe,0xbdf9, -0xe84b,0x0000,0x0000,0xe84c,0xe848,0xbe40,0xbdfb,0x0000, -0x0000,0xbdfa,0xbdfc,0x0000,0xe847,0x0000,0xebca,0xbfe8, -0x0000,0x0000,0xebcc,0xbfea,0xebcf,0xebcb,0xebc9,0xebce, -0xbfe9,0xebcd,0x0000,0xbfe7,0x0000,0x0000,0xc1d3,0xc1d6, -0xeec1,0x0000,0xc1d4,0xeec0,0xc1d2,0xc1d5,0xf146,0xf147, -0xf148,0xc2e0,0x0000,0xf149,0x0000,0xc2e1,0xc3e2,0xf358, -0xf359,0xf357,0xf356,0xf35a,0xc3e1,0xf4dd,0xf4db,0xf4dc, -0xf4de,0xf4da,0xf4df,0xf658,0x0000,0xf659,0xf657,0xc546, -0xf764,0xc5af,0xf765,0xf848,0xf847,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8af,0xb664,0x0000,0x0000,0xb940, -0x0000,0x0000,0x0000,0xbbb6,0x0000,0x0000,0xbfec,0x0000, -0xbfeb,0x0000,0x0000,0x0000,0x0000,0xc3e3,0xc47c,0xc547, -0xa8b0,0xb064,0xb941,0x0000,0xf35b,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcba6, -0x0000,0x0000,0xa8b1,0x0000,0xa8b4,0xa8b3,0xa8b2,0x0000, -0x0000,0xcba5,0x0000,0xcdcd,0x0000,0xcdcf,0xaaef,0x0000, -0x0000,0xaaf1,0xcdcc,0xcdce,0xaaf0,0xcdd1,0xcdd0,0xcdd2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0b6,0xd0b4,0xad7c,0xd0b3,0xada3,0xad7e,0xad7b,0x0000, -0xada4,0x0000,0xad7d,0xada2,0x0000,0xada1,0xd0b5,0x0000, -0xad7a,0x0000,0x0000,0x0000,0xb06a,0xd3eb,0xd3f1,0xb067, -0xb06e,0x0000,0xb069,0xd3ee,0xd3f0,0xb06c,0xd3ea,0xd3ed, -0xb068,0xb065,0xd3ec,0xb06b,0xd3ef,0xb06d,0xb066,0x0000, -0x0000,0x0000,0x0000,0xd7e3,0xd7e6,0xb370,0x0000,0xb37a, -0xb376,0xd7e4,0x0000,0x0000,0xb37e,0xb377,0xb37c,0xb372, -0x0000,0xb36f,0xb371,0xb37d,0xd7e5,0xb375,0xb378,0xb374, -0xb379,0xd7e7,0xb37b,0xb373,0xd7e2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdc4d,0xb665,0xdc4f, -0x0000,0xb667,0xb669,0x0000,0xdc4e,0xb666,0xb66a,0x0000, -0xb668,0x0000,0x0000,0x0000,0xb947,0xe0a3,0xb94f,0xe07e, -0x0000,0xb950,0xb945,0x0000,0xe0a1,0x0000,0x0000,0xb94a, -0x0000,0xe0a2,0xb943,0xb942,0x0000,0xb94d,0xb94c,0xb94b, -0xb949,0xb94e,0xe07d,0xb944,0xb946,0xb948,0x0000,0x0000, -0xbbb8,0xbbbb,0x0000,0xbbbf,0xbbb9,0xbbbe,0xbbbc,0x0000, -0xbbb7,0x0000,0xbbbd,0xbbba,0x0000,0x0000,0x0000,0xe852, -0xbe43,0xbe41,0x0000,0xe853,0x0000,0xbe44,0xbe42,0xe851, -0xe850,0x0000,0xbff0,0xe84f,0xbfee,0xbfed,0xebd0,0xbe45, -0xbfef,0xebd1,0xbff2,0xebd2,0xbff1,0xc1d8,0xeec3,0xc1d7, -0xc1dc,0xc1da,0xc1db,0xc2e3,0xc1d9,0xeec2,0xebd3,0xc2e2, -0xc2e4,0x0000,0xc3e4,0xc3e5,0x0000,0xf4e0,0x0000,0xc5de, -0xc5dd,0xa8b6,0x0000,0x0000,0xca55,0xb06f,0x0000,0xca52, -0xca53,0xca51,0x0000,0xca54,0x0000,0x0000,0xcbaa,0xcba7, -0xcbac,0xcba8,0xa8b7,0xa8ba,0x0000,0xcba9,0xa8b9,0xcbab, -0x0000,0x0000,0xa8b8,0x0000,0x0000,0x0000,0x0000,0xcdd5, -0xcdd7,0xaaf4,0xcdd3,0xcdd6,0xcdd4,0xaaf2,0xaaf5,0x0000, -0xaaf3,0x0000,0x0000,0x0000,0x0000,0xd0b8,0xd0bc,0xd0b9, -0x0000,0xada7,0x0000,0xada8,0x0000,0xd0bb,0x0000,0xd0bd, -0xd0bf,0x0000,0xada5,0xd0be,0x0000,0x0000,0xada6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd7ee,0xd0ba,0xd3f2,0xd3fb, -0xd3f9,0xd3f4,0xd3f5,0xd3fa,0xd3fc,0xb071,0x0000,0xd3f7, -0xd3f3,0xb070,0xb072,0xd3f6,0xd3fd,0xd3f8,0x0000,0x0000, -0xb3a1,0xd7f1,0xd7e9,0xd7ef,0xd7f0,0xb3a2,0x0000,0xd7e8, -0xd7ea,0xd0b7,0xd7ec,0xd7ed,0xd7eb,0xb66c,0x0000,0x0000, -0x0000,0xdc56,0xebd4,0xdc57,0xdc54,0xb3a3,0xb66e,0xdc53, -0xdc59,0xdc58,0xb66b,0xdc5c,0xdc52,0xdc5b,0xdc50,0xdc5a, -0xdc55,0xb66d,0x0000,0xe0aa,0x0000,0xe0a5,0xe0ab,0xe0a6, -0xe0a4,0xe0a7,0xb951,0x0000,0xe0a9,0x0000,0xe0a8,0xb952, -0xbbc1,0xbbc0,0xe46e,0xe471,0xe469,0xe46d,0xbbc2,0xe46c, -0xe46a,0xe470,0xe46b,0xe468,0xe46f,0x0000,0xe859,0xbe48, -0xf14a,0xe856,0xe857,0xe855,0xdc51,0xbe47,0xe85a,0xe854, -0xbe46,0xbe49,0xe858,0xebd5,0xbff3,0xebd6,0xebd7,0x0000, -0xeec4,0xc1dd,0xf14b,0xf14c,0x0000,0x0000,0xf14d,0xf35d, -0xf35c,0xf4e2,0x0000,0xf4e1,0xf65b,0xf65c,0xf65a,0xf766, -0xc5b0,0xa8bb,0xadaa,0xada9,0xb075,0xb074,0xd440,0xd441, -0xd3fe,0x0000,0xb073,0xd7f5,0x0000,0xd7f6,0xd7f2,0xb3a4, -0xd7f3,0x0000,0xd7f4,0x0000,0x0000,0x0000,0x0000,0xdc5f, -0xdc61,0xdc5d,0xdc60,0xb66f,0xdc5e,0xb670,0x0000,0x0000, -0xdd73,0xb955,0xb954,0x0000,0xb953,0x0000,0xe0ac,0xe0ad, -0x0000,0x0000,0xe473,0xe475,0xbbc6,0xbbc3,0x0000,0xbbc5, -0xbbc4,0xe474,0xe472,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe861,0xe85e,0xe85f,0xbe4d,0xe860,0xe85b,0xe85c,0xbe4a, -0x0000,0xbe4b,0xe85d,0xbe4c,0x0000,0xebdb,0x0000,0xebdc, -0xebd9,0xebda,0xbff4,0xebd8,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeec8,0xeec5,0xeec7,0xc1e0,0xeecb,0xc1df,0xeec9, -0xeecc,0xeeca,0xeec6,0xc1de,0x0000,0xf14f,0x0000,0xf150, -0xf14e,0x0000,0xf152,0xc2e5,0xc2e6,0xf35f,0xc3e7,0xf151, -0xf35e,0xc3e6,0xf4e5,0xf4e6,0xc4bf,0xf4e4,0x0000,0xf4e3, -0x0000,0xf65d,0xc548,0x0000,0xf849,0xf8c8,0xf8c7,0x0000, -0xc643,0xc65d,0xf8c9,0xf971,0x0000,0xc66f,0xa8bc,0xaaf6, -0x0000,0xb956,0x0000,0xc4c0,0xa8bd,0xadab,0xb3a5,0xb671, -0xc2e7,0xaaf7,0x0000,0xd0c1,0xd0c0,0xd442,0x0000,0xb078, -0xb076,0xb07a,0xd444,0x0000,0xb079,0xb077,0x0000,0x0000, -0x0000,0x0000,0xd443,0xb3a8,0xd7fc,0x0000,0xb3a7,0xb3a9, -0xd842,0xb3ab,0xd7fe,0xd840,0xd7f7,0xb3aa,0xd843,0x0000, -0x0000,0xd7f9,0x0000,0xd7fa,0xd7f8,0xb3a6,0x0000,0xd841, -0xd7fb,0xd7fd,0x0000,0x0000,0x0000,0xdc6d,0x0000,0xdc6c, -0xdc6a,0xdc62,0xdc71,0xdc65,0xdc6f,0xdc76,0xdc6e,0xb679, -0x0000,0xb675,0xdc63,0x0000,0xdc69,0xb677,0x0000,0xdc68, -0xb678,0xb67a,0xdc6b,0x0000,0xb672,0xb673,0xdc77,0xdc75, -0x0000,0xdc74,0xdc66,0x0000,0xdc72,0x0000,0xb676,0x0000, -0x0000,0x0000,0x0000,0xb674,0xdc73,0xdc64,0xdc67,0xdc70, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe4ba,0xe0b7,0x0000, -0xe0b0,0xe0c3,0xe0cc,0xe0b3,0xb961,0x0000,0xe0c0,0xb957, -0xb959,0xb965,0xe0b1,0x0000,0x0000,0xb95a,0xb95c,0xb966, -0xb95b,0x0000,0x0000,0x0000,0x0000,0xb964,0xe0b9,0x0000, -0xe0ae,0xb962,0xe0b8,0xb95e,0xe0ca,0xb963,0xe0c8,0xe0bc, -0xe0c6,0xb960,0xe0af,0xe0c9,0xe0c4,0x0000,0xe0cb,0xb958, -0x0000,0x0000,0xb967,0xb95d,0x0000,0x0000,0xe0b5,0x0000, -0xe0bd,0xe0c1,0x0000,0xe0c5,0xb95f,0xe0b4,0xe0b2,0xe0be, -0x0000,0x0000,0x0000,0x0000,0xe0bb,0xe0ba,0x0000,0xe0bf, -0xe0c2,0x0000,0xe0c7,0x0000,0x0000,0x0000,0xe478,0x0000, -0xbbc7,0xe4a4,0xe47a,0xbbcc,0xbbd0,0xe4ad,0xe4b5,0xe4a6, -0xbbc8,0x0000,0xe4aa,0xe0b6,0x0000,0xbbc9,0xe4b1,0xe4b6, -0xe4ae,0x0000,0xe4b0,0xe4b9,0xe4b2,0xe47e,0xe4a9,0x0000, -0x0000,0xbbd1,0x0000,0xbbcd,0xe47c,0xe4ab,0xbbcb,0xe4a5, -0xbbca,0xe4b3,0xe4a2,0xe479,0xbbce,0xe4b8,0x0000,0x0000, -0xe47b,0xe4af,0xe4ac,0xe4a7,0xe477,0xe476,0xe4a1,0xe4b4, -0xbbcf,0xe4b7,0xe47d,0xe4a3,0xbe52,0x0000,0x0000,0x0000, -0x0000,0x0000,0xbe5a,0xbe55,0xe8a4,0xe8a1,0xe867,0xbe50, -0x0000,0xf9d7,0x0000,0xbe4f,0xbe56,0x0000,0x0000,0x0000, -0xe865,0xbe54,0xe871,0xe863,0xe864,0xbe4e,0xe8a3,0xbe58, -0xe874,0xe879,0xe873,0xebee,0xe86f,0xe877,0xe875,0xe868, -0xe862,0xe87d,0xbe57,0xe87e,0x0000,0xe878,0x0000,0xe86d, -0xe86b,0xe866,0x0000,0x0000,0x0000,0xe86e,0xe87b,0xe86a, -0xe87a,0xe8a2,0x0000,0x0000,0xbe53,0x0000,0xe876,0xe87c, -0xe872,0xe86c,0xbe51,0x0000,0x0000,0x0000,0xe4a8,0xe870, -0xbe59,0xe869,0x0000,0x0000,0x0000,0x0000,0x0000,0xebf4, -0xbff7,0xebf3,0xebf0,0xec44,0xbffb,0x0000,0xec41,0xebf8, -0xec43,0xebe9,0xebf6,0x0000,0xbffd,0x0000,0xebe1,0x0000, -0xebdf,0xec42,0x0000,0xec40,0xebfe,0xebed,0xebec,0xebe2, -0xc040,0x0000,0xebe8,0xebf2,0xebfd,0xc043,0xec45,0x0000, -0xc1e8,0xc045,0xbffe,0xebe6,0x0000,0xebef,0xebde,0xebe0, -0xbff5,0xc042,0xbffa,0xebe7,0xebf7,0xebf1,0xc041,0xebdd, -0xc1e3,0xebf9,0xebfc,0xbffc,0x0000,0xebeb,0xc044,0xbff9, -0x0000,0x0000,0x0000,0xbff8,0xebf5,0xebfb,0xbff6,0x0000, -0xebe4,0xebfa,0x0000,0x0000,0xebe5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xebea,0xeed2, -0x0000,0xeed7,0xc1e5,0xc1e7,0xeedd,0xc1e1,0xeeec,0xeee3, -0xeed8,0xeed9,0xeee2,0x0000,0xc1ee,0xeee1,0xeed1,0xeee0, -0xeed4,0xeeed,0xc1ed,0xc1eb,0xeed5,0x0000,0xeee8,0x0000, -0xeeda,0xeee7,0x0000,0xeee9,0xeed0,0xc1e6,0x0000,0xeeea, -0x0000,0x0000,0xeede,0x0000,0xc1ea,0xeedb,0x0000,0x0000, -0xc1ec,0xeee4,0x0000,0x0000,0x0000,0xc1e4,0xeed6,0xeee5, -0x0000,0xeedf,0xebe3,0xeee6,0xeed3,0x0000,0xc1e9,0x0000, -0xeeeb,0x0000,0xc1e2,0xeece,0x0000,0x0000,0x0000,0x0000, -0xf160,0xf159,0xc2e9,0x0000,0xf154,0xf163,0xf15b,0xeedc, -0x0000,0xf165,0xf155,0x0000,0xc2e8,0xf15f,0xc2ea,0xc2f2, -0xc2f0,0xf161,0xc2f1,0xf157,0x0000,0xf158,0xf15d,0xf162, -0x0000,0xeecd,0xc2eb,0xf16a,0xf167,0xf16b,0xf15e,0xf15a, -0xf168,0xf36a,0xf15c,0x0000,0xc2ee,0x0000,0xc2ed,0xeecf, -0xc2ef,0xf164,0xf166,0xc2ec,0xf169,0xf153,0x0000,0xf156, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf373,0x0000,0xf363,0xc3eb,0xf371,0x0000,0x0000,0xf361, -0xc3ec,0x0000,0xf36c,0x0000,0xf368,0xc3f1,0xf372,0xf362, -0xf365,0xc3e9,0xf374,0x0000,0xf36d,0xf370,0xc3ef,0xc3f4, -0xc3f2,0xf369,0xf364,0x0000,0xc3ed,0xc3ee,0xf360,0xc3ea, -0x0000,0xc3e8,0xc3f0,0xf36f,0xc3f3,0x0000,0xf36b,0xf375, -0xc3f5,0x0000,0x0000,0x0000,0xf367,0x0000,0xf36e,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4f3,0xf542,0xf4f5, -0xf4fc,0xf366,0xf4fa,0xf4e9,0xf540,0xc4c3,0xf4ed,0xf4fe, -0xf4f4,0x0000,0x0000,0xc4c2,0x0000,0x0000,0xf544,0xf4f6, -0x0000,0xf4fb,0xf4fd,0xf4e7,0xf541,0xf4f2,0xf4f7,0xf4eb, -0xf4ef,0xf543,0xf4f9,0xf4e8,0xf4ec,0xf4ee,0xf4f8,0x0000, -0xc4c1,0xf4f1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf4ea,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf4f0,0xf661,0xf666,0xc54f,0xf668,0x0000,0xc549,0x0000, -0xf664,0xf66a,0xc54e,0xc54a,0x0000,0xc54b,0xf660,0xf667, -0xc54d,0xf665,0xc54c,0xf65f,0xf663,0xf662,0x0000,0xf65e, -0xf669,0x0000,0x0000,0x0000,0xc5b1,0xf76d,0xf770,0xf76c, -0xf76e,0xf76f,0xf769,0xf76a,0xf767,0x0000,0x0000,0xf76b, -0xf768,0xc5b2,0xc5b3,0x0000,0x0000,0xf84b,0x0000,0xf84d, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf84c,0xf84e,0x0000, -0xc5e0,0x0000,0xf84a,0xc5df,0xc5e1,0x0000,0x0000,0x0000, -0xf8cb,0xf8cc,0xc644,0xf8ca,0x0000,0xf953,0xf952,0xf954, -0xc65f,0xf955,0xc65e,0xf956,0xf972,0xf975,0xf974,0xc668, -0xf973,0x0000,0x0000,0x0000,0xc672,0xc670,0xc671,0xc677, -0xf9c0,0xf9c1,0xf9bf,0xf9c9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9500 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xaaf8, -0x0000,0x0000,0xd844,0xdc78,0xe8a5,0xf376,0x0000,0x0000, -0xaaf9,0x0000,0xadac,0xb07b,0x0000,0x0000,0xd845,0x0000, -0xd846,0xb3ac,0x0000,0xb67d,0xdc7a,0xdc79,0xb6a3,0xb67c, -0xdc7b,0xb67e,0xb6a2,0xb6a1,0xb67b,0x0000,0x0000,0x0000, -0xb968,0x0000,0x0000,0xe0d0,0xe0ce,0x0000,0xe0cf,0xe0cd, -0x0000,0xbbd2,0x0000,0xbbd5,0xbbd7,0xbbd6,0x0000,0x0000, -0xbbd3,0xbbd4,0x0000,0xe8a7,0xe8a6,0xbe5b,0xe8a8,0x0000, -0xe8a9,0xbe5c,0x0000,0x0000,0x0000,0xec4d,0xec4b,0xeef3, -0x0000,0xec49,0xec4a,0xc046,0xec46,0xec4e,0xec48,0xec4c, -0xeeef,0x0000,0x0000,0xeef1,0x0000,0xeef2,0xc1f3,0xeeee, -0xc1f2,0xeef0,0xc1ef,0xc1f0,0xc1f1,0xec47,0x0000,0x0000, -0xc2f5,0xf16e,0xf16c,0xf16d,0xc2f3,0xc2f6,0xc2f4,0x0000, -0x0000,0x0000,0xf377,0xf378,0xc3f6,0x0000,0xf545,0xf547, -0xf546,0xc4c4,0xc550,0xf66d,0xf66c,0xf66b,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xaafa,0x0000,0xc9aa,0x0000, -0xca58,0xa6e9,0xca56,0xca59,0xca57,0x0000,0x0000,0x0000, -0xcbae,0x0000,0xa8c1,0x0000,0xa8c2,0xcbb0,0xa8bf,0xcbaf, -0xcbad,0xa8c0,0xa8be,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcdd8,0xcddb,0xaafd,0xcdda,0xcdd9,0x0000,0xaafc, -0xaafb,0x0000,0xab40,0xcddc,0xaafe,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd0c6,0xadae,0xadaf,0xadb0,0xd0c7,0xd0c3, -0xadad,0xd0c4,0x0000,0xd0c5,0xd0c2,0x0000,0x0000,0x0000, -0xb0a4,0x0000,0x0000,0xb0a1,0xd445,0xb0a2,0xb0a5,0xd446, -0x0000,0xb07e,0xb07c,0xb07d,0xb0a3,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb3ad,0xd849,0xb3b5,0xd848,0x0000,0xd84b, -0xb3b1,0xd84a,0xb6ab,0xb3af,0xb3b2,0xb3ae,0xb3b3,0xb3b4, -0xb3b0,0x0000,0x0000,0x0000,0xd847,0xb6a7,0xdc7d,0x0000, -0xdca3,0x0000,0x0000,0xdca2,0xb6ac,0xb6a8,0xb6a9,0xdc7c, -0xdc7e,0xdca1,0xb6a4,0xb6a6,0x0000,0xb6aa,0xb6a5,0x0000, -0x0000,0xe0d3,0xe0d1,0xe0d2,0xb96a,0xb96b,0x0000,0xe0d4, -0xb969,0xbbd8,0x0000,0xbbda,0xbbd9,0x0000,0xe4bb,0x0000, -0x0000,0xe4bc,0xe8ab,0x0000,0xe8aa,0x0000,0x0000,0xc047, -0xc048,0xec4f,0xc049,0x0000,0xeef6,0x0000,0xeef4,0x0000, -0xeef5,0xc1f4,0x0000,0xf16f,0xc3f7,0x0000,0x0000,0x0000, -0xc1f5,0xab41,0x0000,0xb0a6,0xd447,0x0000,0x0000,0xd84c, -0xb3b6,0xb6ad,0xdca4,0xdca6,0xb6af,0xb6ae,0xb6b0,0xb6b1, -0xdca5,0xb96e,0xb96f,0xb96d,0xbbdb,0xb96c,0xe0d5,0x0000, -0x0000,0x0000,0xbbdc,0xe8ac,0xec50,0xc04a,0xc1f6,0xf170, -0xf174,0xc2f9,0xf171,0xc2fa,0xc2f8,0xf175,0xc2fb,0xf173, -0x0000,0xf379,0xc2f7,0xc3f8,0x0000,0xf8cd,0x0000,0x0000, -0xab42,0xb3b8,0xb3b7,0x0000,0x0000,0x0000,0x0000,0xb6b2, -0xdca8,0xdca7,0xb6b3,0x0000,0x0000,0xe0d9,0xb973,0xb970, -0xe0d8,0xb972,0xe0d6,0xb971,0x0000,0xe0d7,0x0000,0xe4bd, -0xbbdd,0x0000,0xe8af,0x0000,0xbe5d,0xe8ad,0xbe5e,0xbe5f, -0xe8ae,0xbe60,0x0000,0xec51,0x0000,0xc04e,0xc04b,0xc050, -0xec53,0xc04c,0xec52,0xc04f,0x0000,0x0000,0xc04d,0x0000, -0xeef9,0xeefb,0x0000,0x0000,0xc1f7,0xeefa,0xc1f8,0xeef8, -0xeef7,0x0000,0xf177,0xf176,0xc2fc,0xf178,0xf37e,0xc3fa, -0xf37d,0xf37a,0xc3f9,0xf37b,0xf37c,0x0000,0xf548,0xf549, -0xc4c5,0x0000,0xc553,0x0000,0x0000,0xf66e,0x0000,0x0000, -0xc551,0xc552,0xf66f,0x0000,0x0000,0xc5b4,0xc5b5,0xf771, -0x0000,0x0000,0xc645,0xf8cf,0xc647,0x0000,0xf8ce,0xf8d0, -0xc646,0xf957,0x0000,0xf9ad,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xab43,0x0000,0x0000,0x0000,0xb974,0x0000, -0xe4be,0x0000,0xe8b0,0xc051,0xc052,0x0000,0xab44,0x0000, -0xbe61,0xc3fb,0xadb1,0x0000,0x0000,0x0000,0xc053,0x0000, -0xc5e2,0xadb2,0xd84d,0x0000,0xdca9,0x0000,0xdcab,0x0000, -0xdcaa,0x0000,0xe0dd,0xe0da,0xb975,0x0000,0xb976,0xe0db, -0xe0dc,0x0000,0xe4c0,0xe4c5,0xbbde,0xe4bf,0xe4c1,0xe4c8, -0xe4c3,0xe4c7,0xe4c4,0xe4c2,0xe4c6,0xbbdf,0x0000,0x0000, -0xe8b3,0x0000,0xe8b1,0xbe63,0x0000,0xbe62,0xe8b2,0xbe64, -0x0000,0x0000,0x0000,0x0000,0xec56,0x0000,0x0000,0xec55, -0xc054,0xec54,0xeefc,0x0000,0xeefe,0xef41,0xef40,0x0000, -0xc1f9,0xeefd,0xf1a1,0xc2fd,0xf17d,0xf1a2,0xc2fe,0x0000, -0xf17b,0x0000,0xf17e,0xf17c,0xf179,0xc340,0xf17a,0x0000, -0x0000,0x0000,0x0000,0xf3a1,0x0000,0x0000,0xf3a3,0xf3a2, -0x0000,0xf54a,0x0000,0xf54b,0x0000,0x0000,0x0000,0xf670, -0x0000,0xc5b7,0x0000,0xc5b6,0xf84f,0xf850,0xc648,0xf8d1, -0x0000,0xc669,0x0000,0xadb3,0xb6b4,0xe4ca,0xe4c9,0xe8b5, -0xe8b4,0x0000,0x0000,0xc1fa,0xef43,0xef42,0xf1a5,0xf1a3, -0xf1a6,0xf1a4,0x0000,0x0000,0xc3fc,0xf3a4,0xf3a5,0xf3a6, -0x0000,0xf671,0x0000,0xf772,0x0000,0xf8d2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xadb4,0x0000,0x0000, -0xec57,0xef44,0x0000,0xadb5,0x0000,0x0000,0xbbe0,0x0000, -0xec58,0xc341,0xf1a7,0xc3fd,0x0000,0xf54c,0xf54d,0xc554, -0xf851,0xadb6,0xb3bb,0xb3bc,0xd84e,0xb6b5,0xb6b6,0xdcac, -0xb6b7,0x0000,0xb97a,0x0000,0xb97c,0xe0df,0xe0e0,0xe0de, -0xb977,0xb978,0xb97b,0xb979,0x0000,0x0000,0xe4cb,0xbbe1, -0xbbe2,0x0000,0x0000,0xe8bc,0xbe67,0xe8b7,0xe8b6,0x0000, -0xe8bb,0xbe65,0x0000,0x0000,0xc05b,0x0000,0xe8b8,0xe8bd, -0xe8ba,0xe8b9,0x0000,0xbe66,0x0000,0xc059,0x0000,0xec5a, -0xc055,0x0000,0xec5b,0x0000,0x0000,0xec59,0x0000,0xc058, -0xc056,0xc05a,0x0000,0xc057,0x0000,0x0000,0x0000,0x0000, -0x0000,0xef45,0x0000,0xef4a,0xef46,0xef49,0xc1fb,0x0000, -0xedd4,0xef48,0xef47,0x0000,0xc344,0xc342,0xc345,0xc343, -0xf1a8,0xf1a9,0xf1aa,0xc346,0x0000,0x0000,0x0000,0xf3aa, -0xc440,0xf3a8,0x0000,0xc441,0xf3a7,0xf3a9,0xc3fe,0xf551, -0xf54e,0x0000,0xf54f,0xf550,0xf672,0xc556,0x0000,0xc555, -0x0000,0xf774,0xf773,0xc5b8,0x0000,0x0000,0x0000,0xc5e3, -0xc649,0xc660,0xf958,0xf9ae,0xf9af,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xadb7,0xdcad,0x0000,0x0000,0xe0e1,0xe4cc,0xe4cd,0xbbe3, -0x0000,0xbbe4,0xe8be,0xbe68,0x0000,0x0000,0xc1fc,0x0000, -0xf1ab,0x0000,0xc347,0xf3ad,0xc442,0xf3ac,0xf3ae,0xf3ab, -0xf675,0xf552,0xf553,0x0000,0xc4c6,0x0000,0xf674,0x0000, -0x0000,0xf673,0x0000,0xf775,0xf9b0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xadb8,0x0000,0x0000,0x0000,0xadb9, -0x0000,0x0000,0xb0a7,0xd448,0x0000,0xd84f,0x0000,0xb6b8, -0x0000,0xb6bb,0xb6b9,0xdcae,0x0000,0xb6bd,0x0000,0xb6ba, -0x0000,0x0000,0xb6bc,0x0000,0xb97e,0x0000,0xe0e2,0x0000, -0x0000,0xe0e3,0xe8c0,0x0000,0xb97d,0xb9a1,0xb9a2,0x0000, -0xe4cf,0x0000,0xe4ce,0xbbe5,0x0000,0xbbe6,0x0000,0xe4d0, -0xe8bf,0xbbe8,0xbe69,0x0000,0xbbe7,0x0000,0x0000,0x0000, -0xc05c,0xe8c1,0xbe6b,0xbe6a,0xe8c2,0xe8c5,0xe8c3,0xe8c4, -0xbe6c,0x0000,0xc061,0xc05f,0x0000,0x0000,0xc05e,0xec5d, -0x0000,0xc060,0x0000,0x0000,0xec5c,0xef4b,0x0000,0xec5e, -0xc05d,0xec5f,0xef4e,0xef4c,0xef4d,0xef52,0xc34b,0xef51, -0xef54,0xef53,0xef50,0xef4f,0x0000,0xc1fd,0x0000,0x0000, -0x0000,0x0000,0xf1ae,0x0000,0xf1ad,0xc34a,0xc348,0xc349, -0x0000,0xf1ac,0x0000,0xf3b1,0x0000,0xc443,0x0000,0xf3b0, -0xf3af,0xc444,0x0000,0xf558,0xf557,0x0000,0xf555,0x0000, -0xf554,0xc4c8,0xc4c7,0xf559,0xf776,0xc5b9,0xf677,0xc557, -0xf676,0xf556,0x0000,0xf777,0xc5e4,0x0000,0xc661,0xf959, -0x0000,0xf9b1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xadba,0xd850, -0xef55,0xadbb,0x0000,0x0000,0xe4d2,0xe4d1,0xec60,0x0000, -0x0000,0xef57,0x0000,0xef56,0x0000,0xc34c,0xf3b2,0xf3b3, -0xc4c9,0x0000,0x0000,0xf9b2,0xb0a8,0xb6bf,0xb6be,0xe0e4, -0xe0e6,0xb9a4,0xe0e5,0xb9a3,0xb9a5,0xe0e7,0x0000,0x0000, -0x0000,0xe4d4,0xe4d6,0xe4d5,0x0000,0xe4d8,0x0000,0x0000, -0x0000,0xbbe9,0xe4d7,0xe4d3,0x0000,0x0000,0x0000,0xe4d9, -0x0000,0xe8cc,0x0000,0xe8cf,0xe8d1,0xe8c7,0xe8cb,0xe8c8, -0xbe6e,0xbe71,0xbe73,0xe8c9,0xe8ca,0xbe72,0xe8cd,0xe8d0, -0xe8ce,0xbe74,0x0000,0xbe70,0xe8c6,0xbe6d,0x0000,0xbe6f, -0x0000,0x0000,0xc063,0xec66,0xec64,0xec63,0x0000,0xec69, -0x0000,0xec68,0xec67,0x0000,0xec62,0xc062,0xec61,0x0000, -0xec65,0xc064,0x0000,0x0000,0xef5a,0x0000,0xef5e,0xef5b, -0xef5d,0xef5c,0xef59,0xef5f,0xef62,0xef60,0xef61,0xc240, -/* 0x9a00 */ -0x0000,0xc1fe,0xef58,0xef63,0xf1b3,0xf1b6,0xf1b8,0xf1b7, -0x0000,0xf1b1,0xf1b5,0xf1b0,0x0000,0xf1b2,0xc34d,0xf1af, -0x0000,0xf1b4,0x0000,0x0000,0xf3c0,0xf3b5,0xc445,0x0000, -0x0000,0xc446,0xf3b4,0xf3b9,0xf3bf,0xf3b7,0xf3be,0x0000, -0xf3bb,0x0000,0xf3ba,0xf3bd,0xf3b8,0xf3b6,0x0000,0xf3bc, -0x0000,0xf560,0xf55e,0xc4ca,0xf55d,0xf563,0xf561,0x0000, -0xc4cb,0xf55c,0xf55a,0x0000,0xf55b,0xc4cd,0xf55f,0xc4cc, -0xf562,0xf678,0xf67e,0x0000,0x0000,0xf679,0xc55b,0xf6a1, -0xc55a,0xf67d,0xf67c,0xc559,0xf67b,0xc558,0xf67a,0x0000, -0xf77d,0xf7a1,0xf77e,0x0000,0xf77b,0xc5bb,0xf778,0xf77c, -0xf7a3,0x0000,0xf7a2,0xf779,0xf77a,0xc5ba,0xf852,0xc5e7, -0x0000,0xf853,0xc5e5,0xc5e6,0x0000,0x0000,0xf8d3,0xc64a, -0xf976,0x0000,0xc66a,0x0000,0xf9b3,0xc66b,0xf9b4,0xf9b5, -0xf9c3,0xf9c2,0xc67a,0xf9cd,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb0a9,0x0000,0x0000,0xe0e9,0x0000,0xe0e8,0x0000,0xbbea, -0xbbeb,0xe4da,0x0000,0xe8d2,0xec6c,0x0000,0x0000,0xbe75, -0xc065,0xec6a,0x0000,0xec6d,0xc066,0x0000,0xef64,0xec6b, -0xf1b9,0xc34e,0xf3c1,0x0000,0x0000,0x0000,0xf566,0xf564, -0x0000,0x0000,0xf565,0x0000,0x0000,0xf6a2,0x0000,0xc55c, -0xf7a4,0xc5ea,0xc5bc,0xc5e8,0xc5e9,0xf8d4,0xc662,0x0000, -0xb0aa,0x0000,0x0000,0x0000,0xf1ba,0x0000,0x0000,0xd449, -0x0000,0xb9a6,0x0000,0xe4db,0x0000,0x0000,0xbbec,0xe4dc, -0x0000,0x0000,0x0000,0xe8d4,0xe8d3,0xc068,0xbe76,0xbe77, -0x0000,0xe8d7,0xe8d6,0xe8d5,0x0000,0x0000,0xec6e,0xec71, -0x0000,0xec70,0xec6f,0xc067,0xef68,0xef66,0xef65,0x0000, -/* 0x9b00 */ -0x0000,0xef67,0x0000,0xc34f,0xf1bc,0xf1bd,0xc350,0x0000, -0xf1bb,0x0000,0xf3c3,0xf3c2,0xf3c5,0xc447,0xf3c4,0x0000, -0xf567,0xf569,0xf568,0x0000,0x0000,0xf6a3,0xf6a6,0xf6a4, -0xf6a5,0xf7a5,0xc5bd,0x0000,0x0000,0x0000,0xf854,0xf855, -0xf856,0x0000,0xc64b,0xc663,0xf9b6,0xb0ab,0x0000,0xbe78, -0xc069,0xf1be,0x0000,0xf7a6,0x0000,0x0000,0xf9c4,0xd44a, -0x0000,0xc67b,0xb0ac,0xec72,0x0000,0xf1bf,0x0000,0xf3c6, -0x0000,0x0000,0xf6a7,0xf7a7,0xb0ad,0x0000,0xe4dd,0xe4de, -0x0000,0xbbed,0xbbee,0xe8d9,0xbe7a,0xbe79,0xe8d8,0x0000, -0xef69,0x0000,0xf1c0,0xf1c2,0xf1c1,0xc353,0xc352,0xc351, -0x0000,0xc55e,0xf6a8,0x0000,0xc55d,0xf7a9,0xf7a8,0x0000, -0xc64c,0xf8d5,0xb3bd,0xe0ea,0x0000,0x0000,0x0000,0xe4e1, -0xe4df,0xe4e0,0x0000,0x0000,0xe8e2,0x0000,0xe8dd,0xe8da, -0xe8e1,0x0000,0x0000,0x0000,0xe8e3,0x0000,0x0000,0xbe7c, -0xe8e0,0xe8dc,0x0000,0x0000,0xe8db,0xe8df,0xe8de,0xbe7b, -0x0000,0x0000,0xec7d,0xec78,0xec76,0xeca1,0xec77,0x0000, -0xec73,0x0000,0xec79,0x0000,0x0000,0xec74,0xef72,0xec75, -0xeca2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xec7c,0xc06a,0xec7b,0xec7a,0x0000,0xec7e,0x0000,0x0000, -0x0000,0x0000,0xef6a,0xef6d,0x0000,0x0000,0xef6c,0x0000, -0xef74,0xef6f,0xef73,0x0000,0xef71,0xef70,0xef6e,0x0000, -0xef6b,0x0000,0xc243,0xc242,0x0000,0xc244,0xc241,0xef75, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf1c8,0xf1cb,0x0000, -0xf1c9,0xf1cd,0x0000,0x0000,0x0000,0xf1ce,0x0000,0xf1c6, -0xc358,0xf1c7,0x0000,0xf1c5,0xf1cc,0x0000,0xf1c4,0xf1c3, -0xc357,0xc355,0xc354,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf1ca,0xf3cf,0xf3d5,0xc44a,0xf3d0, -0x0000,0xf3d3,0xf3d7,0xc44b,0xf3d2,0x0000,0xf3ca,0x0000, -0xf3c9,0xf3d6,0xf3cd,0x0000,0xf3cb,0xf3d4,0xf3cc,0xc449, -0xc448,0x0000,0xf3c7,0xf3c8,0xf3d1,0x0000,0x0000,0x0000, -0xf3ce,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf56c, -0xf56f,0x0000,0x0000,0x0000,0x0000,0xc356,0x0000,0x0000, -/* 0x9c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xf56d,0xf573,0xf571, -0xf56b,0xf576,0x0000,0xf56a,0x0000,0xc4cf,0xf572,0x0000, -0x0000,0x0000,0xf56e,0xc4ce,0xf575,0x0000,0x0000,0xf574, -0x0000,0x0000,0x0000,0x0000,0xf6ab,0xf6aa,0x0000,0x0000, -0x0000,0xf6b1,0x0000,0xf6ad,0xf6b0,0xc560,0x0000,0x0000, -0xf6ae,0xf6af,0x0000,0xf6a9,0xf6ac,0xc55f,0x0000,0x0000, -0x0000,0xc5bf,0xf7b4,0xf7af,0xf7b3,0x0000,0xf7b6,0xf7b2, -0x0000,0xf7ae,0x0000,0xc5c1,0xf7b1,0xf7b5,0xc5c0,0xf7ac, -0xf570,0xf7b0,0x0000,0x0000,0xf7ad,0x0000,0xf7aa,0x0000, -0xf7ab,0xc5be,0xf85a,0xf85c,0xf85f,0xf85b,0xf860,0x0000, -0xf859,0x0000,0xf857,0x0000,0xc5eb,0xf85d,0xc5ed,0xc5ec, -0xf858,0xf85e,0x0000,0x0000,0x0000,0x0000,0xf8da,0xc64d, -0xf8db,0x0000,0xf8d9,0xf8d6,0x0000,0x0000,0xf8d8,0xf8d7, -0xf95a,0x0000,0x0000,0x0000,0x0000,0xf95c,0xf95b,0x0000, -0x0000,0xf979,0x0000,0xf978,0xf977,0xf97a,0x0000,0xc673, -0xc674,0xf9ca,0xf9ce,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xb3be,0xdcaf,0xe0ed, -0x0000,0xb9a7,0xe0eb,0x0000,0x0000,0xe0ec,0x0000,0x0000, -0x0000,0xe4e2,0xe4e3,0xbbf1,0xbbef,0xe4e4,0xbbf0,0xe8e8, -0x0000,0xe8eb,0xe8e5,0xe8ec,0xe8e4,0xe8e6,0x0000,0xe8e7, -0xe8ea,0x0000,0x0000,0xbea1,0xe8ef,0xe8ee,0xbe7d,0xe8e9, -0xe8ed,0xbe7e,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xecac,0x0000,0xc06f,0x0000,0xeca7,0xc06b,0x0000,0xeca4, -0xecaa,0xecad,0x0000,0xc070,0x0000,0xeca9,0xeca6,0xecae, -0xeca5,0x0000,0xecab,0xc06c,0x0000,0xeca3,0xc06d,0x0000, -0xc06e,0xeca8,0x0000,0x0000,0x0000,0xefa9,0xef7a,0xef7b, -0xef7e,0xef7c,0x0000,0xef76,0x0000,0x0000,0xef79,0xefa5, -0xef7d,0x0000,0x0000,0xc245,0x0000,0xefa7,0xefa4,0xc246, -0xefa6,0xef77,0xefa2,0xefa3,0x0000,0xefa1,0x0000,0x0000, -0x0000,0x0000,0xf1d2,0xf1d4,0xf1d7,0x0000,0x0000,0xf1d1, -0x0000,0xc359,0xf1d9,0xf1d0,0xf1da,0x0000,0xf1d6,0xf1d8, -0xf1dc,0xf1d5,0xf1dd,0xf1d3,0xf1cf,0xc35a,0x0000,0xf1db, -0xc35b,0xc44d,0x0000,0x0000,0x0000,0x0000,0x0000,0xef78, -0xf3f1,0xf3e8,0xc44f,0xf3e4,0xc450,0x0000,0x0000,0xf3ed, -0xf3e7,0xf3dd,0xc44e,0xf3ea,0xf3e5,0xf3e6,0x0000,0xf3d8, -0xf3df,0xf3ee,0x0000,0xf3eb,0x0000,0xf3e3,0x0000,0xf3ef, -0xf3de,0xf3d9,0xf3ec,0x0000,0xf3db,0xf3e9,0xf3e0,0xf3f0, -0xf3dc,0xc44c,0xf3da,0xf3e1,0xf3e2,0x0000,0x0000,0x0000, -0xf57d,0x0000,0xf57b,0x0000,0xf5a2,0x0000,0xf5ae,0xf5a5, -0xf57c,0xf578,0xf5a7,0xf57e,0xf5a3,0xf57a,0xf5aa,0xf577, -0xf5a1,0xf5a6,0xf5a8,0xf5ab,0xf579,0x0000,0xf5af,0xf5b0, -0xf5a9,0xf5ad,0xf5a4,0x0000,0xf6c1,0xf6c4,0x0000,0xc561, -0x0000,0xf6c3,0xf6c8,0xf6c6,0xc562,0xf6bd,0xf6b3,0xf6b2, -0xc564,0xf6bf,0xf6c0,0xf6bc,0xf6b4,0x0000,0xf6b9,0xf5ac, -0x0000,0xf6b5,0xc563,0xf6bb,0x0000,0xf6ba,0x0000,0xf6b6, -0xf6c2,0x0000,0xf6b7,0xf7bb,0xf6c5,0xf6c7,0xf6be,0xf6b8, -0xf7bc,0xf7be,0xf7b8,0xc5c2,0x0000,0xf7c5,0xf7c3,0xc5c3, -0xf7c2,0xf7c1,0xf7ba,0xf7b7,0xf7bd,0xf7c6,0xf7b9,0xf7bf, -0x0000,0xf869,0xf86e,0xf864,0xf867,0xc5ee,0xf86b,0x0000, -0xf872,0xf7c0,0x0000,0xf865,0xf86f,0xf873,0xf86a,0xf863, -0xf86d,0x0000,0xf86c,0xf871,0xf870,0xf7c4,0xf868,0xf862, -0xf866,0xc64e,0xc64f,0xf861,0x0000,0xf8e6,0xf8dd,0xf8e5, -0xf8e2,0xf8e3,0xf8dc,0xf8df,0xf8e7,0xf8e1,0xf8e0,0xf8de, -0x0000,0xf8e4,0x0000,0xf95d,0x0000,0xf95e,0x0000,0xf960, -0xf95f,0xf962,0xf961,0xf97c,0xf97b,0xf9b7,0x0000,0xf9b8, -0x0000,0xf9c5,0xc678,0xc67c,0x0000,0xf9cf,0xc67d,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xb3bf,0x0000,0x0000, -0x0000,0xc4d0,0xf6c9,0x0000,0xc650,0xc651,0x0000,0xb3c0, -0xe0ee,0x0000,0xb9a8,0xe8f0,0x0000,0x0000,0xecb0,0xecb1, -0xecaf,0xefab,0xefaa,0xc247,0xf1df,0xefac,0xf1de,0x0000, -0x0000,0xf3f3,0xc451,0xc453,0xf3f2,0x0000,0x0000,0xc452, -0x0000,0xf5b1,0xf5b3,0xf5b2,0xf6ca,0xc565,0x0000,0xc5ef, -0xf8e8,0xf963,0x0000,0x0000,0xf9d2,0xb3c1,0x0000,0xe4e5, -0x0000,0xbea2,0x0000,0x0000,0x0000,0xecb3,0xecb2,0x0000, -0xefad,0x0000,0x0000,0x0000,0xc454,0xc4d1,0xf7c7,0xf9cb, -0x0000,0x0000,0x0000,0xb3c2,0xbbf2,0x0000,0xbea3,0x0000, -0xf3f4,0x0000,0xf874,0xb6c0,0x0000,0x0000,0x0000,0x0000, -0xefae,0x0000,0x0000,0x0000,0xc664,0xb6c1,0xbea4,0xc248, -0xf875,0xb6c2,0x0000,0xe8f1,0xc072,0xecb4,0xecb5,0x0000, -0xc071,0x0000,0xefaf,0xc24c,0xc24a,0xc24b,0xc249,0xf1e0, -0xc35c,0x0000,0x0000,0x0000,0xf5b5,0xf5b4,0xf5b7,0xf5b6, -0xc4d2,0x0000,0x0000,0xf6cb,0x0000,0xf6cd,0xf6cc,0xc566, -0xf7c8,0x0000,0xf876,0xf877,0xc5f0,0xf964,0xf97d,0xc675, -0x0000,0xdcb0,0xecb6,0xefb0,0xf3f5,0xe0ef,0x0000,0xefb1, -0xf1e2,0xf1e1,0x0000,0x0000,0x0000,0x0000,0xf878,0xc652, -0x0000,0xf965,0xf97e,0x0000,0x0000,0x0000,0xb9a9,0xe8f2, -0xe8f3,0x0000,0xecb7,0xb9aa,0x0000,0xc35d,0xf1e3,0x0000, -0xf6cf,0xc567,0xf6d0,0xf6ce,0xf879,0x0000,0xf8e9,0x0000, -0xb9ab,0x0000,0xefb4,0xefb3,0xefb2,0xf1e4,0x0000,0x0000, -0xf1e8,0xf1e7,0xf1e6,0xf1e5,0xc35e,0xf3f6,0xf5b9,0xc4d3, -0xf5b8,0xf6d1,0xf7cb,0xf7ca,0xc5c4,0xf7c9,0xf87c,0xf87b, -0xf87a,0x0000,0x0000,0xbbf3,0x0000,0xecb8,0xc24d,0x0000, -0xf3f7,0xf3f8,0xf7cc,0xf87d,0x0000,0x0000,0xf8ea,0xf966, -0xf9b9,0xf9d4,0xbbf4,0xc24e,0xf1e9,0xf3f9,0xf6d2,0xf87e, -0x0000,0x0000,0xbea6,0x0000,0xefb5,0xf1ea,0xf3fa,0xf3fb, -0xf3fc,0xf5be,0x0000,0xf5ba,0xc568,0xf5bd,0xf5bc,0xc4d4, -0xf5bb,0xc4d6,0x0000,0xc4d5,0xf6d4,0xf6d3,0xc569,0xc56a, -0x0000,0x0000,0xc5c6,0xf7cd,0xc5c5,0x0000,0xf8a3,0xf8a4, -0xf8a2,0xf8a1,0xc654,0x0000,0xf8eb,0xf8ec,0xf8ed,0xc653, -0xf967,0xf96a,0xf969,0xf968,0x0000,0x0000,0xf9d3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xc073,0x0000,0x0000, -0xc365,0xf5bf,0xf6d5,0x0000,0xc5c7,0xf7ce,0x0000,0x0000, -0xf9d5,0x0000,0x0000,0x0000,0xc074,0x0000,0x0000,0x0000, -0xefb6,0x0000,0xf7cf,0x0000,0xf9a1}; - -static const int ucs_i_big5_table_min = 0x4d00; -static const int ucs_i_big5_table_max = 0x4d00 + (sizeof (ucs_i_big5_table) / sizeof (unsigned short)); - -static const unsigned short ucs_pua_big5_table[] = { -/* 0xf600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xc6a1,0xc6a2,0xc6a3,0xc6a4,0xc6a5,0xc6a6,0xc6a7, -0xc6a8,0xc6a9,0xc6aa,0xc6ab,0xc6ac,0xc6ad,0xc6ae,0xc6af, -0xc6b0,0xc6b1,0xc6b2,0xc6b3,0xc6b4,0xc6b5,0xc6b6,0xc6b7, -0xc6b8,0xc6b9,0xc6ba,0xc6bb,0xc6bc,0xc6bd,0xc6be,0xc6bf, -0xc6c0,0xc6c1,0xc6c2,0xc6c3,0xc6c4,0xc6c5,0xc6c6,0xc6c7, -0xc6c8,0xc6c9,0xc6ca,0xc6cb,0xc6cc,0xc6cd,0xc6ce,0xc6cf, -0xc6d0,0xc6d1,0xc6d2,0xc6d3,0xc6d4,0xc6d5,0xc6d6,0xc6d7, -0xc6d8,0xc6d9,0xc6da,0xc6db,0xc6dc,0xc6dd,0xc6de,0xc6df, -0xc6e0,0xc6e1,0xc6e2,0xc6e3,0xc6e4,0xc6e5,0xc6e6,0xc6e7, -0xc6e8,0xc6e9,0xc6ea,0xc6eb,0xc6ec,0xc6ed,0xc6ee,0xc6ef, -0xc6f0,0xc6f1,0xc6f2,0xc6f3,0xc6f4,0xc6f5,0xc6f6,0xc6f7, -0xc6f8,0xc6f9,0xc6fa,0xc6fb,0xc6fc,0xc6fd,0xc6fe,0xc740, -0xc741,0xc742,0xc743,0xc744,0xc745,0xc746,0xc747,0xc748, -0xc749,0xc74a,0xc74b,0xc74c,0xc74d,0xc74e,0xc74f,0xc750, -0xc751,0xc752,0xc753,0xc754,0xc755,0xc756,0xc757,0xc758, -0xc759,0xc75a,0xc75b,0xc75c,0xc75d,0xc75e,0xc75f,0xc760, -0xc761,0xc762,0xc763,0xc764,0xc765,0xc766,0xc767,0xc768, -0xc769,0xc76a,0xc76b,0xc76c,0xc76d,0xc76e,0xc76f,0xc770, -0xc771,0xc772,0xc773,0xc774,0xc775,0xc776,0xc777,0xc778, -0xc779,0xc77a,0xc77b,0xc77c,0xc77d,0xc77e,0xc7a1,0xc7a2, -0xc7a3,0xc7a4,0xc7a5,0xc7a6,0xc7a7,0xc7a8,0xc7a9,0xc7aa, -0xc7ab,0xc7ac,0xc7ad,0xc7ae,0xc7af,0xc7b0,0xc7b1,0xc7b2, -0xc7b3,0xc7b4,0xc7b5,0xc7b6,0xc7b7,0xc7b8,0xc7b9,0xc7ba, -0xc7bb,0xc7bc,0xc7bd,0xc7be,0xc7bf,0xc7c0,0xc7c1,0xc7c2, -0xc7c3,0xc7c4,0xc7c5,0xc7c6,0xc7c7,0xc7c8,0xc7c9,0xc7ca, -0xc7cb,0xc7cc,0xc7cd,0xc7ce,0xc7cf,0xc7d0,0xc7d1,0xc7d2, -0xc7d3,0xc7d4,0xc7d5,0xc7d6,0xc7d7,0xc7d8,0xc7d9,0xc7da, -0xc7db,0xc7dc,0xc7dd,0xc7de,0xc7df,0xc7e0,0xc7e1,0xc7e2, -0xc7e3,0xc7e4,0xc7e5,0xc7e6,0xc7e7,0xc7e8,0xc7e9,0xc7ea, -0xc7eb,0xc7ec,0xc7ed,0xc7ee,0xc7ef,0xc7f0,0xc7f1,0xc7f2, -0xc7f3,0xc7f4,0xc7f5,0xc7f6,0xc7f7,0xc7f8,0xc7f9,0xc7fa, -0xc7fb,0xc7fc,0xc7fd,0xc7fe,0xc840,0xc841,0xc842,0xc843, -0xc844,0xc845,0xc846,0xc847,0xc848,0xc849,0xc84a,0xc84b, -0xc84c,0xc84d,0xc84e,0xc84f,0xc850,0xc851,0xc852,0xc853, -0xc854,0xc855,0xc856,0xc857,0xc858,0xc859,0xc85a,0xc85b, -0xc85c,0xc85d,0xc85e,0xc85f,0xc860,0xc861,0xc862,0xc863, -0xc864,0xc865,0xc866,0xc867,0xc868,0xc869,0xc86a,0xc86b, -0xc86c,0xc86d,0xc86e,0xc86f,0xc870,0xc871,0xc872,0xc873, -0xc874,0xc875,0xc876,0xc877,0xc878,0xc879,0xc87a,0xc87b, -0xc87c,0xc87d,0xc87e,0xc8a1,0xc8a2,0xc8a3,0xc8a4,0xc8a5, -0xc8a6,0xc8a7,0xc8a8,0xc8a9,0xc8aa,0xc8ab,0xc8ac,0xc8ad, -0xc8ae,0xc8af,0xc8b0,0xc8b1,0xc8b2,0xc8b3,0xc8b4,0xc8b5, -0xc8b6,0xc8b7,0xc8b8,0xc8b9,0xc8ba,0xc8bb,0xc8bc,0xc8bd, -0xc8be,0xc8bf,0xc8c0,0xc8c1,0xc8c2,0xc8c3,0xc8c4,0xc8c5, -0xc8c6,0xc8c7,0xc8c8,0xc8c9,0xc8ca,0xc8cb,0xc8cc,0xc8cd, -0xc8ce,0xc8cf,0xc8d0,0xc8d1,0xc8d2,0xc8d3,0xc8d4,0xc8d5, -0xc8d6,0xc8d7,0xc8d8,0xc8d9,0xc8da,0xc8db,0xc8dc,0xc8dd, -0xc8de,0xc8df,0xc8e0,0xc8e1,0xc8e2,0xc8e3,0xc8e4,0xc8e5, -0xc8e6,0xc8e7,0xc8e8,0xc8e9,0xc8ea,0xc8eb,0xc8ec,0xc8ed, -0xc8ee,0xc8ef,0xc8f0,0xc8f1,0xc8f2,0xc8f3,0xc8f4,0xc8f5, -0xc8f6,0xc8f7,0xc8f8,0xc8f9,0xc8fa,0xc8fb,0xc8fc,0xc8fd, -0xc8fe}; - -static const int ucs_pua_big5_table_min = 0xf600; -static const int ucs_pua_big5_table_max = 0xf600 + (sizeof (ucs_pua_big5_table) / sizeof (unsigned short)); - -static const unsigned short ucs_r1_big5_table[] = { -/* 0xfa00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc94a,0xddfc}; - -static const int ucs_r1_big5_table_min = 0xfa00; -static const int ucs_r1_big5_table_max = 0xfa00 + (sizeof (ucs_r1_big5_table) / sizeof (unsigned short)); - -static const unsigned short ucs_r2_big5_table[] = { -/* 0xfe00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa14a,0xa157,0x0000,0xa159,0xa15b,0xa15f,0xa160,0xa163, -0xa164,0xa167,0xa168,0xa16b,0xa16c,0xa16f,0xa170,0xa173, -0xa174,0xa177,0xa178,0xa17b,0xa17c,0x0000,0x0000,0x0000, -0x0000,0xa1c6,0xa1c7,0xa1ca,0xa1cb,0xa1c8,0xa1c9,0xa15c, -0xa14d,0xa14e,0xa14f,0x0000,0xa151,0xa152,0xa153,0xa154, -0x0000,0xa17d,0xa17e,0xa1a1,0xa1a2,0xa1a3,0xa1a4,0xa1cc, -0xa1cd,0xa1ce,0xa1de,0xa1df,0xa1e0,0xa1e1,0xa1e2,0x0000, -0xa242,0xa24c,0xa24d,0xa24e,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xff00 */ -0x0000,0xa149,0x0000,0xa1ad,0xa243,0xa248,0xa1ae,0x0000, -0xa15d,0xa15e,0xa1af,0xa1cf,0xa141,0xa1d0,0xa144,0xa1fe, -0xa2af,0xa2b0,0xa2b1,0xa2b2,0xa2b3,0xa2b4,0xa2b5,0xa2b6, -0xa2b7,0xa2b8,0xa147,0xa146,0xa1d5,0xa1d7,0xa1d6,0xa148, -0xa249,0xa2cf,0xa2d0,0xa2d1,0xa2d2,0xa2d3,0xa2d4,0xa2d5, -0xa2d6,0xa2d7,0xa2d8,0xa2d9,0xa2da,0xa2db,0xa2dc,0xa2dd, -0xa2de,0xa2df,0xa2e0,0xa2e1,0xa2e2,0xa2e3,0xa2e4,0xa2e5, -0xa2e6,0xa2e7,0xa2e8,0x0000,0xa240,0x0000,0x0000,0xa1c4, -0x0000,0xa2e9,0xa2ea,0xa2eb,0xa2ec,0xa2ed,0xa2ee,0xa2ef, -0xa2f0,0xa2f1,0xa2f2,0xa2f3,0xa2f4,0xa2f5,0xa2f6,0xa2f7, -0xa2f8,0xa2f9,0xa2fa,0xa2fb,0xa2fc,0xa2fd,0xa2fe,0xa340, -0xa341,0xa342,0xa343,0xa161,0xa155,0xa162,0xa1e3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa246,0xa247,0x0000,0xa1c3,0x0000,0xa244}; - -static const int ucs_r2_big5_table_min = 0xfe00; -static const int ucs_r2_big5_table_max = 0xfe00 + (sizeof (ucs_r2_big5_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_BIG5_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cns11643.h b/ext/mbstring/libmbfl/filters/unicode_table_cns11643.h deleted file mode 100644 index 0c17e1e616536..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cns11643.h +++ /dev/null @@ -1,6149 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ - -#ifndef UNICODE_TABLE_CNS11643_H -#define UNICODE_TABLE_CNS11643_H - -/* - * Unicode table - */ - -/* CNS11643 -> UCS */ -static const unsigned short cns11643_1_ucs_table[] = { -0x3000,0xff0c,0x3001,0x3002,0xff0e,0x30fb,0xff1b,0xff1a, -0xff1f,0xff01,0xfe30,0x2026,0x2025,0xfe50,0xfe51,0xfe52, -0x00b7,0xfe54,0xfe55,0xfe56,0xfe57,0xfe31,0x2014,0xfe32, -0x2013,0x0000,0x0000,0x0000,0x0000,0xff08,0xff09,0xfe35, -0xfe36,0xff5b,0xff5d,0xfe37,0xfe38,0x3014,0x3015,0xfe39, -0xfe3a,0x3010,0x3011,0xfe3b,0xfe3c,0x300a,0x300b,0xfe3d, -0xfe3e,0x3008,0x3009,0xfe3f,0xfe40,0x300c,0x300d,0xfe41, -0xfe42,0x300e,0x300f,0xfe43,0xfe44,0xfe59,0xfe5a,0xfe5b, -0xfe5c,0xfe5d,0xfe5e,0x2018,0x2019,0x201c,0x201d,0x301d, -0x301e,0x2032,0x2035,0xff03,0xff06,0xff0a,0x203b,0x00a7, -0x3003,0x25cb,0x25cf,0x25b3,0x25b2,0x25ce,0x2606,0x2605, -0x25c7,0x25c6,0x25a1,0x25a0,0x25bd,0x25bc,0x32a3,0x2105, -0x203e,0x0000,0xff3f,0x0000,0xfe49,0xfe4a,0xfe4d,0xfe4e, -0xfe4b,0xfe4c,0xfe5f,0xfe60,0xfe61,0xff0b,0xff0d,0x00d7, -0x00f7,0x00b1,0x221a,0xff1c,0xff1e,0xff1d,0x2266,0x2267, -0x2260,0x221e,0x2252,0x2261,0xfe62,0xfe63,0xfe64,0xfe66, -0xfe65,0x223c,0x2229,0x222a,0x22a5,0x2220,0x221f,0x22bf, -0x33d2,0x33d1,0x222b,0x222e,0x2235,0x2234,0x2640,0x2642, -0x2641,0x2609,0x2191,0x2193,0x2192,0x2190,0x2196,0x2197, -0x2199,0x2198,0x2016,0xff5c,0xff0f,0xff3c,0x2215,0xfe68, -0xff04,0xffe5,0x3012,0xffe0,0xffe1,0xff05,0xff20,0x2103, -0x2109,0xfe69,0xfe6a,0xfe6b,0x33d5,0x339c,0x339d,0x339e, -0x33ce,0x33a1,0x338e,0x338f,0x33c4,0x00b0,0x5159,0x515b, -0x515e,0x515d,0x5161,0x5163,0x55e7,0x74e9,0x7cce,0x2581, -0x2582,0x2583,0x2584,0x2585,0x2586,0x2587,0x2588,0x258f, -0x258e,0x258d,0x258c,0x258b,0x258a,0x2589,0x253c,0x2534, -0x252c,0x2524,0x251c,0x2594,0x2500,0x2502,0x2595,0x250c, -0x2510,0x2514,0x2518,0x256d,0x256e,0x2570,0x256f,0x2550, -0x255e,0x256a,0x2561,0x25e2,0x25e3,0x25e5,0x25e4,0x2571, -0x2572,0x2573,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xff10,0xff11,0xff12,0xff13,0xff14,0xff15, -0xff16,0xff17,0xff18,0xff19,0x2160,0x2161,0x2162,0x2163, -0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x3021,0x3022, -0x3023,0x3024,0x3025,0x3026,0x3027,0x3028,0x3029,0x0000, -0x5344,0x0000,0xff21,0xff22,0xff23,0xff24,0xff25,0xff26, -0xff27,0xff28,0xff29,0xff2a,0xff2b,0xff2c,0xff2d,0xff2e, -0xff2f,0xff30,0xff31,0xff32,0xff33,0xff34,0xff35,0xff36, -0xff37,0xff38,0xff39,0xff3a,0xff41,0xff42,0xff43,0xff44, -0xff45,0xff46,0xff47,0xff48,0xff49,0xff4a,0xff4b,0xff4c, -0xff4d,0xff4e,0xff4f,0xff50,0xff51,0xff52,0xff53,0xff54, -0xff55,0xff56,0xff57,0xff58,0xff59,0xff5a,0x0391,0x0392, -0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399,0x039a, -0x039b,0x039c,0x039d,0x039e,0x039f,0x03a0,0x03a1,0x03a3, -0x03a4,0x03a5,0x03a6,0x03a7,0x03a8,0x03a9,0x03b1,0x03b2, -0x03b3,0x03b4,0x03b5,0x03b6,0x03b7,0x03b8,0x03b9,0x03ba, -0x03bb,0x03bc,0x03bd,0x03be,0x03bf,0x03c0,0x03c1,0x03c3, -0x03c4,0x03c5,0x03c6,0x03c7,0x03c8,0x03c9,0x3105,0x3106, -0x3107,0x3108,0x3109,0x310a,0x310b,0x310c,0x310d,0x310e, -0x310f,0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116, -0x3117,0x3118,0x3119,0x311a,0x311b,0x311c,0x311d,0x311e, -0x311f,0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126, -0x3127,0x3128,0x3129,0x02d9,0x02c9,0x02ca,0x02c7,0x02cb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2460,0x2461, -0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,0x2469, -0x2474,0x2475,0x2476,0x2477,0x2478,0x2479,0x247a,0x247b, -0x247c,0x247d,0x2170,0x2171,0x2172,0x2173,0x2174,0x2175, -0x2176,0x2177,0x2178,0x2179,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2400,0x2401, -0x2402,0x2403,0x2404,0x2405,0x2406,0x2407,0x2408,0x2409, -0x240a,0x240b,0x240c,0x240d,0x240e,0x240f,0x2410,0x2411, -0x2412,0x2413,0x2414,0x2415,0x2416,0x2417,0x2418,0x2419, -0x241a,0x241b,0x241c,0x241d,0x241e,0x241f,0x2421,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x4e00,0x4e59,0x4e01,0x4e03,0x4e43,0x4e5d, -0x4e86,0x4e8c,0x4eba,0x513f,0x5165,0x516b,0x51e0,0x5200, -0x5201,0x529b,0x5315,0x5341,0x535c,0x53c8,0x4e09,0x4e0b, -0x4e08,0x4e0a,0x4e2b,0x4e38,0x51e1,0x4e45,0x4e48,0x4e5f, -0x4e5e,0x4e8e,0x4ea1,0x5140,0x5203,0x52fa,0x5343,0x53c9, -0x53e3,0x571f,0x58eb,0x5915,0x5927,0x5973,0x5b50,0x5b51, -0x5b53,0x5bf8,0x5c0f,0x5c22,0x5c38,0x5c71,0x5ddd,0x5de5, -0x5df1,0x5df2,0x5df3,0x5dfe,0x5e72,0x5efe,0x5f0b,0x5f13, -0x624d,0x4e11,0x4e10,0x4e0d,0x4e2d,0x4e30,0x4e39,0x4e4b, -0x5c39,0x4e88,0x4e91,0x4e95,0x4e92,0x4e94,0x4ea2,0x4ec1, -0x4ec0,0x4ec3,0x4ec6,0x4ec7,0x4ecd,0x4eca,0x4ecb,0x4ec4, -0x5143,0x5141,0x5167,0x516d,0x516e,0x516c,0x5197,0x51f6, -0x5206,0x5207,0x5208,0x52fb,0x52fe,0x52ff,0x5316,0x5339, -0x5348,0x5347,0x5345,0x535e,0x5384,0x53cb,0x53ca,0x53cd, -0x58ec,0x5929,0x592b,0x592a,0x592d,0x5b54,0x5c11,0x5c24, -0x5c3a,0x5c6f,0x5df4,0x5e7b,0x5eff,0x5f14,0x5f15,0x5fc3, -0x6208,0x6236,0x624b,0x624e,0x652f,0x6587,0x6597,0x65a4, -0x65b9,0x65e5,0x66f0,0x6708,0x6728,0x6b20,0x6b62,0x6b79, -0x6bcb,0x6bd4,0x6bdb,0x6c0f,0x6c34,0x706b,0x722a,0x7236, -0x723b,0x7247,0x7259,0x725b,0x72ac,0x738b,0x4e19,0x4e16, -0x4e15,0x4e14,0x4e18,0x4e3b,0x4e4d,0x4e4f,0x4e4e,0x4ee5, -0x4ed8,0x4ed4,0x4ed5,0x4ed6,0x4ed7,0x4ee3,0x4ee4,0x4ed9, -0x4ede,0x5145,0x5144,0x5189,0x518a,0x51ac,0x51f9,0x51fa, -0x51f8,0x520a,0x52a0,0x529f,0x5305,0x5306,0x5317,0x531d, -0x4edf,0x534a,0x5349,0x5361,0x5360,0x536f,0x536e,0x53bb, -0x53ef,0x53e4,0x53f3,0x53ec,0x53ee,0x53e9,0x53e8,0x53fc, -0x53f8,0x53f5,0x53eb,0x53e6,0x53ea,0x53f2,0x53f1,0x53f0, -0x53e5,0x53ed,0x53fb,0x56db,0x56da,0x5916,0x592e,0x5931, -0x5974,0x5976,0x5b55,0x5b83,0x5c3c,0x5de8,0x5de7,0x5de6, -0x5e02,0x5e03,0x5e73,0x5e7c,0x5f01,0x5f18,0x5f17,0x5fc5, -0x620a,0x6253,0x6254,0x6252,0x6251,0x65a5,0x65e6,0x672e, -0x672c,0x672a,0x672b,0x672d,0x6b63,0x6bcd,0x6c11,0x6c10, -0x6c38,0x6c41,0x6c40,0x6c3e,0x72af,0x7384,0x7389,0x74dc, -0x74e6,0x7518,0x751f,0x7528,0x7529,0x7530,0x7531,0x7532, -0x7533,0x758b,0x767d,0x76ae,0x76bf,0x76ee,0x77db,0x77e2, -0x77f3,0x793a,0x79be,0x7a74,0x7acb,0x4e1e,0x4e1f,0x4e52, -0x4e53,0x4e69,0x4e99,0x4ea4,0x4ea6,0x4ea5,0x4eff,0x4f09, -0x4f19,0x4f0a,0x4f15,0x4f0d,0x4f10,0x4f11,0x4f0f,0x4ef2, -0x4ef6,0x4efb,0x4ef0,0x4ef3,0x4efd,0x4f01,0x4f0b,0x5149, -0x5147,0x5146,0x5148,0x5168,0x5171,0x518d,0x51b0,0x5217, -0x5211,0x5212,0x520e,0x5216,0x52a3,0x5308,0x5321,0x5320, -0x5370,0x5371,0x5409,0x540f,0x540c,0x540a,0x5410,0x5401, -0x540b,0x5404,0x5411,0x540d,0x5408,0x5403,0x540e,0x5406, -0x5412,0x56e0,0x56de,0x56dd,0x5733,0x5730,0x5728,0x572d, -0x572c,0x572f,0x5729,0x5919,0x591a,0x5937,0x5938,0x5984, -0x5978,0x5983,0x597d,0x5979,0x5982,0x5981,0x5b57,0x5b58, -0x5b87,0x5b88,0x5b85,0x5b89,0x5bfa,0x5c16,0x5c79,0x5dde, -0x5e06,0x5e76,0x5e74,0x5f0f,0x5f1b,0x5fd9,0x5fd6,0x620e, -0x620c,0x620d,0x6210,0x6263,0x625b,0x6258,0x6536,0x65e9, -0x65e8,0x65ec,0x65ed,0x66f2,0x66f3,0x6709,0x673d,0x6734, -0x6731,0x6735,0x6b21,0x6b64,0x6b7b,0x6c16,0x6c5d,0x6c57, -0x6c59,0x6c5f,0x6c60,0x6c50,0x6c55,0x6c61,0x6c5b,0x6c4d, -0x6c4e,0x7070,0x725f,0x725d,0x767e,0x7af9,0x7c73,0x7cf8, -0x7f36,0x7f8a,0x7fbd,0x8001,0x8003,0x800c,0x8012,0x8033, -0x807f,0x8089,0x808b,0x808c,0x81e3,0x81ea,0x81f3,0x81fc, -0x820c,0x821b,0x821f,0x826e,0x8272,0x827e,0x866b,0x8840, -0x884c,0x8863,0x897f,0x9621,0x4e32,0x4ea8,0x4f4d,0x4f4f, -0x4f47,0x4f57,0x4f5e,0x4f34,0x4f5b,0x4f55,0x4f30,0x4f50, -0x4f51,0x4f3d,0x4f3a,0x4f38,0x4f43,0x4f54,0x4f3c,0x4f46, -0x4f63,0x4f5c,0x4f60,0x4f2f,0x4f4e,0x4f36,0x4f59,0x4f5d, -0x4f48,0x4f5a,0x514c,0x514b,0x514d,0x5175,0x51b6,0x51b7, -0x5225,0x5224,0x5229,0x522a,0x5228,0x52ab,0x52a9,0x52aa, -0x52ac,0x5323,0x5373,0x5375,0x541d,0x542d,0x541e,0x543e, -0x5426,0x544e,0x5427,0x5446,0x5443,0x5433,0x5448,0x5442, -0x541b,0x5429,0x544a,0x5439,0x543b,0x5438,0x542e,0x5435, -0x5436,0x5420,0x543c,0x5440,0x5431,0x542b,0x541f,0x542c, -0x56ea,0x56f0,0x56e4,0x56eb,0x574a,0x5751,0x5740,0x574d, -0x5747,0x574e,0x573e,0x5750,0x574f,0x573b,0x58ef,0x593e, -0x599d,0x5992,0x59a8,0x599e,0x59a3,0x5999,0x5996,0x598d, -0x59a4,0x5993,0x598a,0x59a5,0x5b5d,0x5b5c,0x5b5a,0x5b5b, -0x5b8c,0x5b8b,0x5b8f,0x5c2c,0x5c40,0x5c41,0x5c3f,0x5c3e, -0x5c90,0x5c91,0x5c94,0x5c8c,0x5deb,0x5e0c,0x5e8f,0x5e87, -0x5e8a,0x5ef7,0x5f04,0x5f1f,0x5f64,0x5f62,0x5f77,0x5f79, -0x5fd8,0x5fcc,0x5fd7,0x5fcd,0x5ff1,0x5feb,0x5ff8,0x5fea, -0x6212,0x6211,0x6284,0x6297,0x6296,0x6280,0x6276,0x6289, -0x626d,0x628a,0x627c,0x627e,0x6279,0x6273,0x6292,0x626f, -0x6298,0x626e,0x6295,0x6293,0x6291,0x6286,0x6539,0x653b, -0x6538,0x65f1,0x66f4,0x675f,0x674e,0x674f,0x6750,0x6751, -0x675c,0x6756,0x675e,0x6749,0x6746,0x6760,0x6753,0x6757, -0x6b65,0x6bcf,0x6c42,0x6c5e,0x6c99,0x6c81,0x6c88,0x6c89, -0x6c85,0x6c9b,0x6c6a,0x6c7a,0x6c90,0x6c70,0x6c8c,0x6c68, -0x6c96,0x6c92,0x6c7d,0x6c83,0x6c72,0x6c7e,0x6c74,0x6c86, -0x6c76,0x6c8d,0x6c94,0x6c98,0x6c82,0x7076,0x707c,0x707d, -0x7078,0x7262,0x7261,0x7260,0x72c4,0x72c2,0x7396,0x752c, -0x752b,0x7537,0x7538,0x7682,0x76ef,0x77e3,0x79c1,0x79c0, -0x79bf,0x7a76,0x7cfb,0x7f55,0x8096,0x8093,0x809d,0x8098, -0x809b,0x809a,0x80b2,0x826f,0x8292,0x828b,0x828d,0x898b, -0x89d2,0x8a00,0x8c37,0x8c46,0x8c55,0x8c9d,0x8d64,0x8d70, -0x8db3,0x8eab,0x8eca,0x8f9b,0x8fb0,0x8fc2,0x8fc6,0x8fc5, -0x8fc4,0x5de1,0x9091,0x90a2,0x90aa,0x90a6,0x90a3,0x9149, -0x91c6,0x91cc,0x9632,0x962e,0x9631,0x962a,0x962c,0x4e26, -0x4e56,0x4e73,0x4e8b,0x4e9b,0x4e9e,0x4eab,0x4eac,0x4f6f, -0x4f9d,0x4f8d,0x4f73,0x4f7f,0x4f6c,0x4f9b,0x4f8b,0x4f86, -0x4f83,0x4f70,0x4f75,0x4f88,0x4f69,0x4f7b,0x4f96,0x4f7e, -0x4f8f,0x4f91,0x4f7a,0x5154,0x5152,0x5155,0x5169,0x5177, -0x5176,0x5178,0x51bd,0x51fd,0x523b,0x5238,0x5237,0x523a, -0x5230,0x522e,0x5236,0x5241,0x52be,0x52bb,0x5352,0x5354, -0x5353,0x5351,0x5366,0x5377,0x5378,0x5379,0x53d6,0x53d4, -0x53d7,0x5473,0x5475,0x5496,0x5478,0x5495,0x5480,0x547b, -0x5477,0x5484,0x5492,0x5486,0x547c,0x5490,0x5471,0x5476, -0x548c,0x549a,0x5462,0x5468,0x548b,0x547d,0x548e,0x56fa, -0x5783,0x5777,0x576a,0x5769,0x5761,0x5766,0x5764,0x577c, -0x591c,0x5949,0x5947,0x5948,0x5944,0x5954,0x59be,0x59bb, -0x59d4,0x59b9,0x59ae,0x59d1,0x59c6,0x59d0,0x59cd,0x59cb, -0x59d3,0x59ca,0x59af,0x59b3,0x59d2,0x59c5,0x5b5f,0x5b64, -0x5b63,0x5b97,0x5b9a,0x5b98,0x5b9c,0x5b99,0x5b9b,0x5c1a, -0x5c48,0x5c45,0x5c46,0x5cb7,0x5ca1,0x5cb8,0x5ca9,0x5cab, -0x5cb1,0x5cb3,0x5e18,0x5e1a,0x5e16,0x5e15,0x5e1b,0x5e11, -0x5e78,0x5e9a,0x5e97,0x5e9c,0x5e95,0x5e96,0x5ef6,0x5f26, -0x5f27,0x5f29,0x5f80,0x5f81,0x5f7f,0x5f7c,0x5fdd,0x5fe0, -0x5ffd,0x5ff5,0x5fff,0x600f,0x6014,0x602f,0x6035,0x6016, -0x602a,0x6015,0x6021,0x6027,0x6029,0x602b,0x601b,0x6216, -0x6215,0x623f,0x623e,0x6240,0x627f,0x62c9,0x62cc,0x62c4, -0x62bf,0x62c2,0x62b9,0x62d2,0x62db,0x62ab,0x62d3,0x62d4, -0x62cb,0x62c8,0x62a8,0x62bd,0x62bc,0x62d0,0x62d9,0x62c7, -0x62cd,0x62b5,0x62da,0x62b1,0x62d8,0x62d6,0x62d7,0x62c6, -0x62ac,0x62ce,0x653e,0x65a7,0x65bc,0x65fa,0x6614,0x6613, -0x660c,0x6606,0x6602,0x660e,0x6600,0x660f,0x6615,0x660a, -0x6607,0x670d,0x670b,0x676d,0x678b,0x6795,0x6771,0x679c, -0x6773,0x6777,0x6787,0x679d,0x6797,0x676f,0x6770,0x677f, -0x6789,0x677e,0x6790,0x6775,0x679a,0x6793,0x677c,0x676a, -0x6772,0x6b23,0x6b66,0x6b67,0x6b7f,0x6c13,0x6c1b,0x6ce3, -0x6ce8,0x6cf3,0x6cb1,0x6ccc,0x6ce5,0x6cb3,0x6cbd,0x6cbe, -0x6cbc,0x6ce2,0x6cab,0x6cd5,0x6cd3,0x6cb8,0x6cc4,0x6cb9, -0x6cc1,0x6cae,0x6cd7,0x6cc5,0x6cf1,0x6cbf,0x6cbb,0x6ce1, -0x6cdb,0x6cca,0x6cac,0x6cef,0x6cdc,0x6cd6,0x6ce0,0x7095, -0x708e,0x7092,0x708a,0x7099,0x722c,0x722d,0x7238,0x7248, -0x7267,0x7269,0x72c0,0x72ce,0x72d9,0x72d7,0x72d0,0x73a9, -0x73a8,0x739f,0x73ab,0x73a5,0x753d,0x759d,0x7599,0x759a, -0x7684,0x76c2,0x76f2,0x76f4,0x77e5,0x77fd,0x793e,0x7940, -0x7941,0x79c9,0x79c8,0x7a7a,0x7a79,0x7afa,0x7cfe,0x7f54, -0x7f8c,0x7f8b,0x8005,0x80ba,0x80a5,0x80a2,0x80b1,0x80a1, -0x80ab,0x80a9,0x80b4,0x80aa,0x80af,0x81e5,0x81fe,0x820d, -0x82b3,0x829d,0x8299,0x82ad,0x82bd,0x829f,0x82b9,0x82b1, -0x82ac,0x82a5,0x82af,0x82b8,0x82a3,0x82b0,0x82be,0x82b7, -0x864e,0x8671,0x521d,0x8868,0x8ecb,0x8fce,0x8fd4,0x8fd1, -0x90b5,0x90b8,0x90b1,0x90b6,0x91c7,0x91d1,0x9577,0x9580, -0x961c,0x9640,0x963f,0x963b,0x9644,0x9642,0x96b9,0x96e8, -0x9752,0x975e,0x4e9f,0x4ead,0x4eae,0x4fe1,0x4fb5,0x4faf, -0x4fbf,0x4fe0,0x4fd1,0x4fcf,0x4fdd,0x4fc3,0x4fb6,0x4fd8, -0x4fdf,0x4fca,0x4fd7,0x4fae,0x4fd0,0x4fc4,0x4fc2,0x4fda, -0x4fce,0x4fde,0x4fb7,0x5157,0x5192,0x5191,0x51a0,0x524e, -0x5243,0x524a,0x524d,0x524c,0x524b,0x5247,0x52c7,0x52c9, -0x52c3,0x52c1,0x530d,0x5357,0x537b,0x539a,0x53db,0x54ac, -0x54c0,0x54a8,0x54ce,0x54c9,0x54b8,0x54a6,0x54b3,0x54c7, -0x54c2,0x54bd,0x54aa,0x54c1,0x54c4,0x54c8,0x54af,0x54ab, -0x54b1,0x54bb,0x54a9,0x54a7,0x54bf,0x56ff,0x5782,0x578b, -0x57a0,0x57a3,0x57a2,0x57ce,0x57ae,0x5793,0x5955,0x5951, -0x594f,0x594e,0x5950,0x59dc,0x59d8,0x59ff,0x59e3,0x59e8, -0x5a03,0x59e5,0x59ea,0x59da,0x59e6,0x5a01,0x59fb,0x5b69, -0x5ba3,0x5ba6,0x5ba4,0x5ba2,0x5ba5,0x5c01,0x5c4e,0x5c4f, -0x5c4d,0x5c4b,0x5cd9,0x5cd2,0x5df7,0x5e1d,0x5e25,0x5e1f, -0x5e7d,0x5ea0,0x5ea6,0x5efa,0x5f08,0x5f2d,0x5f65,0x5f88, -0x5f85,0x5f8a,0x5f8b,0x5f87,0x5f8c,0x5f89,0x6012,0x601d, -0x6020,0x6025,0x600e,0x6028,0x604d,0x6070,0x6068,0x6062, -0x6046,0x6043,0x606c,0x606b,0x606a,0x6064,0x6241,0x62dc, -0x6316,0x6309,0x62fc,0x62ed,0x6301,0x62ee,0x62fd,0x6307, -0x62f1,0x62f7,0x62ef,0x62ec,0x62fe,0x62f4,0x6311,0x6302, -0x653f,0x6545,0x65ab,0x65bd,0x65e2,0x6625,0x662d,0x6620, -0x6627,0x662f,0x661f,0x6628,0x6631,0x6624,0x66f7,0x67ff, -0x67d3,0x67f1,0x67d4,0x67d0,0x67ec,0x67b6,0x67af,0x67f5, -0x67e9,0x67ef,0x67c4,0x67d1,0x67b4,0x67da,0x67e5,0x67b8, -0x67cf,0x67de,0x67f3,0x67b0,0x67d9,0x67e2,0x67dd,0x67d2, -0x6b6a,0x6b83,0x6b86,0x6bb5,0x6bd2,0x6bd7,0x6c1f,0x6cc9, -0x6d0b,0x6d32,0x6d2a,0x6d41,0x6d25,0x6d0c,0x6d31,0x6d1e, -0x6d17,0x6d3b,0x6d3d,0x6d3e,0x6d36,0x6d1b,0x6cf5,0x6d39, -0x6d27,0x6d38,0x6d29,0x6d2e,0x6d35,0x6d0e,0x6d2b,0x70ab, -0x70ba,0x70b3,0x70ac,0x70af,0x70ad,0x70b8,0x70ae,0x70a4, -0x7230,0x7272,0x726f,0x7274,0x72e9,0x72e0,0x72e1,0x73b7, -0x73ca,0x73bb,0x73b2,0x73cd,0x73c0,0x73b3,0x751a,0x752d, -0x754f,0x754c,0x754e,0x754b,0x75ab,0x75a4,0x75a5,0x75a2, -0x75a3,0x7678,0x7686,0x7687,0x7688,0x76c8,0x76c6,0x76c3, -0x76c5,0x7701,0x76f9,0x76f8,0x7709,0x770b,0x76fe,0x76fc, -0x7707,0x77dc,0x7802,0x7814,0x780c,0x780d,0x7946,0x7949, -0x7948,0x7947,0x79b9,0x79ba,0x79d1,0x79d2,0x79cb,0x7a7f, -0x7a81,0x7aff,0x7afd,0x7c7d,0x7d02,0x7d05,0x7d00,0x7d09, -0x7d07,0x7d04,0x7d06,0x7f38,0x7f8e,0x7fbf,0x8010,0x800d, -0x8011,0x8036,0x80d6,0x80e5,0x80da,0x80c3,0x80c4,0x80cc, -0x80e1,0x80db,0x80ce,0x80de,0x80e4,0x80dd,0x81f4,0x8222, -0x82e7,0x8303,0x8305,0x82e3,0x82db,0x82e6,0x8304,0x82e5, -0x8302,0x8309,0x82d2,0x82d7,0x82f1,0x8301,0x82dc,0x82d4, -0x82d1,0x82de,0x82d3,0x82df,0x82ef,0x8306,0x8650,0x8679, -0x867b,0x867a,0x884d,0x886b,0x8981,0x89d4,0x8a08,0x8a02, -0x8a03,0x8c9e,0x8ca0,0x8d74,0x8d73,0x8db4,0x8ecd,0x8ecc, -0x8ff0,0x8fe6,0x8fe2,0x8fea,0x8fe5,0x8fed,0x8feb,0x8fe4, -0x8fe8,0x90ca,0x90ce,0x90c1,0x90c3,0x914b,0x914a,0x91cd, -0x9582,0x9650,0x964b,0x964c,0x964d,0x9762,0x9769,0x97cb, -0x97ed,0x97f3,0x9801,0x98a8,0x98db,0x98df,0x9996,0x9999, -0x4e58,0x4eb3,0x500c,0x500d,0x5023,0x4fef,0x5026,0x5025, -0x4ff8,0x5029,0x5016,0x5006,0x503c,0x501f,0x501a,0x5012, -0x5011,0x4ffa,0x5000,0x5014,0x5028,0x4ff1,0x5021,0x500b, -0x5019,0x5018,0x4ff3,0x4fee,0x502d,0x502a,0x4ffe,0x502b, -0x5009,0x517c,0x51a4,0x51a5,0x51a2,0x51cd,0x51cc,0x51c6, -0x51cb,0x5256,0x525c,0x5254,0x525b,0x525d,0x532a,0x537f, -0x539f,0x539d,0x53df,0x54e8,0x5510,0x5501,0x5537,0x54fc, -0x54e5,0x54f2,0x5506,0x54fa,0x5514,0x54e9,0x54ed,0x54e1, -0x5509,0x54ee,0x54ea,0x54e6,0x5527,0x5507,0x54fd,0x550f, -0x5703,0x5704,0x57c2,0x57d4,0x57cb,0x57c3,0x5809,0x590f, -0x5957,0x5958,0x595a,0x5a11,0x5a18,0x5a1c,0x5a1f,0x5a1b, -0x5a13,0x59ec,0x5a20,0x5a23,0x5a29,0x5a25,0x5a0c,0x5a09, -0x5b6b,0x5c58,0x5bb0,0x5bb3,0x5bb6,0x5bb4,0x5bae,0x5bb5, -0x5bb9,0x5bb8,0x5c04,0x5c51,0x5c55,0x5c50,0x5ced,0x5cfd, -0x5cfb,0x5cea,0x5ce8,0x5cf0,0x5cf6,0x5d01,0x5cf4,0x5dee, -0x5e2d,0x5e2b,0x5eab,0x5ead,0x5ea7,0x5f31,0x5f92,0x5f91, -0x5f90,0x6059,0x6063,0x6065,0x6050,0x6055,0x606d,0x6069, -0x606f,0x6084,0x609f,0x609a,0x608d,0x6094,0x608c,0x6085, -0x6096,0x6247,0x62f3,0x6308,0x62ff,0x634e,0x633e,0x632f, -0x6355,0x6342,0x6346,0x634f,0x6349,0x633a,0x6350,0x633d, -0x632a,0x632b,0x6328,0x634d,0x634c,0x6548,0x6549,0x6599, -0x65c1,0x65c5,0x6642,0x6649,0x664f,0x6643,0x6652,0x664c, -0x6645,0x6641,0x66f8,0x6714,0x6715,0x6717,0x6821,0x6838, -0x6848,0x6846,0x6853,0x6839,0x6842,0x6854,0x6829,0x68b3, -0x6817,0x684c,0x6851,0x683d,0x67f4,0x6850,0x6840,0x683c, -0x6843,0x682a,0x6845,0x6813,0x6818,0x6841,0x6b8a,0x6b89, -0x6bb7,0x6c23,0x6c27,0x6c28,0x6c26,0x6c24,0x6cf0,0x6d6a, -0x6d95,0x6d88,0x6d87,0x6d66,0x6d78,0x6d77,0x6d59,0x6d93, -0x6d6c,0x6d89,0x6d6e,0x6d5a,0x6d74,0x6d69,0x6d8c,0x6d8a, -0x6d79,0x6d85,0x6d65,0x6d94,0x70ca,0x70d8,0x70e4,0x70d9, -0x70c8,0x70cf,0x7239,0x7279,0x72fc,0x72f9,0x72fd,0x72f8, -0x72f7,0x7386,0x73ed,0x7409,0x73ee,0x73e0,0x73ea,0x73de, -0x7554,0x755d,0x755c,0x755a,0x7559,0x75be,0x75c5,0x75c7, -0x75b2,0x75b3,0x75bd,0x75bc,0x75b9,0x75c2,0x75b8,0x768b, -0x76b0,0x76ca,0x76cd,0x76ce,0x7729,0x771f,0x7720,0x7728, -0x77e9,0x7830,0x7827,0x7838,0x781d,0x7834,0x7837,0x7825, -0x782d,0x7820,0x781f,0x7832,0x7955,0x7950,0x7960,0x795f, -0x7956,0x795e,0x795d,0x7957,0x795a,0x79e4,0x79e3,0x79e7, -0x79df,0x79e6,0x79e9,0x79d8,0x7a84,0x7a88,0x7ad9,0x7b06, -0x7b11,0x7c89,0x7d21,0x7d17,0x7d0b,0x7d0a,0x7d20,0x7d22, -0x7d14,0x7d10,0x7d15,0x7d1a,0x7d1c,0x7d0d,0x7d19,0x7d1b, -0x7f3a,0x7f5f,0x7f94,0x7fc5,0x7fc1,0x8006,0x8004,0x8018, -0x8015,0x8019,0x8017,0x803d,0x803f,0x80f1,0x8102,0x80f0, -0x8105,0x80ed,0x80f4,0x8106,0x80f8,0x80f3,0x8108,0x80fd, -0x810a,0x80fc,0x80ef,0x81ed,0x81ec,0x8200,0x8210,0x822a, -0x822b,0x8228,0x822c,0x82bb,0x832b,0x8352,0x8354,0x834a, -0x8338,0x8350,0x8349,0x8335,0x8334,0x834f,0x8332,0x8339, -0x8336,0x8317,0x8340,0x8331,0x8328,0x8343,0x8654,0x868a, -0x86aa,0x8693,0x86a4,0x86a9,0x868c,0x86a3,0x869c,0x8870, -0x8877,0x8881,0x8882,0x887d,0x8879,0x8a18,0x8a10,0x8a0e, -0x8a0c,0x8a15,0x8a0a,0x8a17,0x8a13,0x8a16,0x8a0f,0x8a11, -0x8c48,0x8c7a,0x8c79,0x8ca1,0x8ca2,0x8d77,0x8eac,0x8ed2, -0x8ed4,0x8ecf,0x8fb1,0x9001,0x9006,0x8ff7,0x9000,0x8ffa, -0x8ff4,0x9003,0x8ffd,0x9005,0x8ff8,0x9095,0x90e1,0x90dd, -0x90e2,0x9152,0x914d,0x914c,0x91d8,0x91dd,0x91d7,0x91dc, -0x91d9,0x9583,0x9662,0x9663,0x9661,0x965b,0x965d,0x9664, -0x9658,0x965e,0x96bb,0x98e2,0x99ac,0x9aa8,0x9ad8,0x9b25, -0x9b32,0x9b3c,0x4e7e,0x507a,0x507d,0x505c,0x5047,0x5043, -0x504c,0x505a,0x5049,0x5065,0x5076,0x504e,0x5055,0x5075, -0x5074,0x5077,0x504f,0x500f,0x506f,0x506d,0x515c,0x5195, -0x51f0,0x526a,0x526f,0x52d2,0x52d9,0x52d8,0x52d5,0x5310, -0x530f,0x5319,0x533f,0x5340,0x533e,0x53c3,0x66fc,0x5546, -0x556a,0x5566,0x5544,0x555e,0x5561,0x5543,0x554a,0x5531, -0x5556,0x554f,0x5555,0x552f,0x5564,0x5538,0x552e,0x555c, -0x552c,0x5563,0x5533,0x5541,0x5557,0x5708,0x570b,0x5709, -0x57df,0x5805,0x580a,0x5806,0x57e0,0x57e4,0x57fa,0x5802, -0x5835,0x57f7,0x57f9,0x5920,0x5962,0x5a36,0x5a41,0x5a49, -0x5a66,0x5a6a,0x5a40,0x5a3c,0x5a62,0x5a5a,0x5a46,0x5a4a, -0x5b70,0x5bc7,0x5bc5,0x5bc4,0x5bc2,0x5bbf,0x5bc6,0x5c09, -0x5c08,0x5c07,0x5c60,0x5c5c,0x5c5d,0x5d07,0x5d06,0x5d0e, -0x5d1b,0x5d16,0x5d22,0x5d11,0x5d29,0x5d14,0x5d19,0x5d24, -0x5d27,0x5d17,0x5de2,0x5e38,0x5e36,0x5e33,0x5e37,0x5eb7, -0x5eb8,0x5eb6,0x5eb5,0x5ebe,0x5f35,0x5f37,0x5f57,0x5f6c, -0x5f69,0x5f6b,0x5f97,0x5f99,0x5f9e,0x5f98,0x5fa1,0x5fa0, -0x5f9c,0x607f,0x60a3,0x6089,0x60a0,0x60a8,0x60cb,0x60b4, -0x60e6,0x60bd,0x60c5,0x60bb,0x60b5,0x60dc,0x60bc,0x60d8, -0x60d5,0x60c6,0x60df,0x60b8,0x60da,0x60c7,0x621a,0x621b, -0x6248,0x63a0,0x63a7,0x6372,0x6396,0x63a2,0x63a5,0x6377, -0x6367,0x6398,0x63aa,0x6371,0x63a9,0x6389,0x6383,0x639b, -0x636b,0x63a8,0x6384,0x6388,0x6399,0x63a1,0x63ac,0x6392, -0x638f,0x6380,0x637b,0x6369,0x6368,0x637a,0x655d,0x6556, -0x6551,0x6559,0x6557,0x555f,0x654f,0x6558,0x6555,0x6554, -0x659c,0x659b,0x65ac,0x65cf,0x65cb,0x65cc,0x65ce,0x665d, -0x665a,0x6664,0x6668,0x6666,0x665e,0x66f9,0x52d7,0x671b, -0x6881,0x68af,0x68a2,0x6893,0x68b5,0x687f,0x6876,0x68b1, -0x68a7,0x6897,0x68b0,0x6883,0x68c4,0x68ad,0x6886,0x6885, -0x6894,0x689d,0x68a8,0x689f,0x68a1,0x6882,0x6b32,0x6bba, -0x6beb,0x6bec,0x6c2b,0x6d8e,0x6dbc,0x6df3,0x6dd9,0x6db2, -0x6de1,0x6dcc,0x6de4,0x6dfb,0x6dfa,0x6e05,0x6dc7,0x6dcb, -0x6daf,0x6dd1,0x6dae,0x6dde,0x6df9,0x6db8,0x6df7,0x6df5, -0x6dc5,0x6dd2,0x6e1a,0x6db5,0x6dda,0x6deb,0x6dd8,0x6dea, -0x6df1,0x6dee,0x6de8,0x6dc6,0x6dc4,0x6daa,0x6dec,0x6dbf, -0x6de6,0x70f9,0x7109,0x710a,0x70fd,0x70ef,0x723d,0x727d, -0x7281,0x731c,0x731b,0x7316,0x7313,0x7319,0x7387,0x7405, -0x740a,0x7403,0x7406,0x73fe,0x740d,0x74e0,0x74f6,0x74f7, -0x751c,0x7522,0x7565,0x7566,0x7562,0x7570,0x758f,0x75d4, -0x75d5,0x75b5,0x75ca,0x75cd,0x768e,0x76d4,0x76d2,0x76db, -0x7737,0x773e,0x773c,0x7736,0x7738,0x773a,0x786b,0x7843, -0x784e,0x7965,0x7968,0x796d,0x79fb,0x7a92,0x7a95,0x7b20, -0x7b28,0x7b1b,0x7b2c,0x7b26,0x7b19,0x7b1e,0x7b2e,0x7c92, -0x7c97,0x7c95,0x7d46,0x7d43,0x7d71,0x7d2e,0x7d39,0x7d3c, -0x7d40,0x7d30,0x7d33,0x7d44,0x7d2f,0x7d42,0x7d32,0x7d31, -0x7f3d,0x7f9e,0x7f9a,0x7fcc,0x7fce,0x7fd2,0x801c,0x804a, -0x8046,0x812f,0x8116,0x8123,0x812b,0x8129,0x8130,0x8124, -0x8202,0x8235,0x8237,0x8236,0x8239,0x838e,0x839e,0x8398, -0x8378,0x83a2,0x8396,0x83bd,0x83ab,0x8392,0x838a,0x8393, -0x8389,0x83a0,0x8377,0x837b,0x837c,0x8386,0x83a7,0x8655, -0x5f6a,0x86c7,0x86c0,0x86b6,0x86c4,0x86b5,0x86c6,0x86cb, -0x86b1,0x86af,0x86c9,0x8853,0x889e,0x8888,0x88ab,0x8892, -0x8896,0x888d,0x888b,0x8993,0x898f,0x8a2a,0x8a1d,0x8a23, -0x8a25,0x8a31,0x8a2d,0x8a1f,0x8a1b,0x8a22,0x8c49,0x8c5a, -0x8ca9,0x8cac,0x8cab,0x8ca8,0x8caa,0x8ca7,0x8d67,0x8d66, -0x8dbe,0x8dba,0x8edb,0x8edf,0x9019,0x900d,0x901a,0x9017, -0x9023,0x901f,0x901d,0x9010,0x9015,0x901e,0x9020,0x900f, -0x9022,0x9016,0x901b,0x9014,0x90e8,0x90ed,0x90fd,0x9157, -0x91ce,0x91f5,0x91e6,0x91e3,0x91e7,0x91ed,0x91e9,0x9589, -0x966a,0x9675,0x9673,0x9678,0x9670,0x9674,0x9676,0x9677, -0x966c,0x96c0,0x96ea,0x96e9,0x7ae0,0x7adf,0x9802,0x9803, -0x9b5a,0x9ce5,0x9e75,0x9e7f,0x9ea5,0x9ebb,0x50a2,0x508d, -0x5085,0x5099,0x5091,0x5080,0x5096,0x5098,0x509a,0x6700, -0x51f1,0x5272,0x5274,0x5275,0x5269,0x52de,0x52dd,0x52db, -0x535a,0x53a5,0x557b,0x5580,0x55a7,0x557c,0x558a,0x559d, -0x5598,0x5582,0x559c,0x55aa,0x5594,0x5587,0x558b,0x5583, -0x55b3,0x55ae,0x559f,0x553e,0x55b2,0x559a,0x55bb,0x55ac, -0x55b1,0x557e,0x5589,0x55ab,0x5599,0x570d,0x582f,0x582a, -0x5834,0x5824,0x5830,0x5831,0x5821,0x581d,0x5820,0x58f9, -0x58fa,0x5960,0x5a77,0x5a9a,0x5a7f,0x5a92,0x5a9b,0x5aa7, -0x5b73,0x5b71,0x5bd2,0x5bcc,0x5bd3,0x5bd0,0x5c0a,0x5c0b, -0x5c31,0x5d4c,0x5d50,0x5d34,0x5d47,0x5dfd,0x5e45,0x5e3d, -0x5e40,0x5e43,0x5e7e,0x5eca,0x5ec1,0x5ec2,0x5ec4,0x5f3c, -0x5f6d,0x5fa9,0x5faa,0x5fa8,0x60d1,0x60e1,0x60b2,0x60b6, -0x60e0,0x611c,0x6123,0x60fa,0x6115,0x60f0,0x60fb,0x60f4, -0x6168,0x60f1,0x610e,0x60f6,0x6109,0x6100,0x6112,0x621f, -0x6249,0x63a3,0x638c,0x63cf,0x63c0,0x63e9,0x63c9,0x63c6, -0x63cd,0x63d2,0x63e3,0x63d0,0x63e1,0x63d6,0x63ed,0x63ee, -0x6376,0x63f4,0x63ea,0x63db,0x6452,0x63da,0x63f9,0x655e, -0x6566,0x6562,0x6563,0x6591,0x6590,0x65af,0x666e,0x6670, -0x6674,0x6676,0x666f,0x6691,0x667a,0x667e,0x6677,0x66fe, -0x66ff,0x671f,0x671d,0x68fa,0x68d5,0x68e0,0x68d8,0x68d7, -0x6905,0x68df,0x68f5,0x68ee,0x68e7,0x68f9,0x68d2,0x68f2, -0x68e3,0x68cb,0x68cd,0x690d,0x6912,0x690e,0x68c9,0x68da, -0x696e,0x68fb,0x6b3e,0x6b3a,0x6b3d,0x6b98,0x6b96,0x6bbc, -0x6bef,0x6c2e,0x6c2f,0x6c2c,0x6e2f,0x6e38,0x6e54,0x6e21, -0x6e32,0x6e67,0x6e4a,0x6e20,0x6e25,0x6e23,0x6e1b,0x6e5b, -0x6e58,0x6e24,0x6e56,0x6e6e,0x6e2d,0x6e26,0x6e6f,0x6e34, -0x6e4d,0x6e3a,0x6e2c,0x6e43,0x6e1d,0x6e3e,0x6ecb,0x6e89, -0x6e19,0x6e4e,0x6e63,0x6e44,0x6e72,0x6e69,0x6e5f,0x7119, -0x711a,0x7126,0x7130,0x7121,0x7136,0x716e,0x711c,0x724c, -0x7284,0x7280,0x7336,0x7325,0x7334,0x7329,0x743a,0x742a, -0x7433,0x7422,0x7425,0x7435,0x7436,0x7434,0x742f,0x741b, -0x7426,0x7428,0x7525,0x7526,0x756b,0x756a,0x75e2,0x75db, -0x75e3,0x75d9,0x75d8,0x75de,0x75e0,0x767b,0x767c,0x7696, -0x7693,0x76b4,0x76dc,0x774f,0x77ed,0x785d,0x786c,0x786f, -0x7a0d,0x7a08,0x7a0b,0x7a05,0x7a00,0x7a98,0x7a97,0x7a96, -0x7ae5,0x7ae3,0x7b49,0x7b56,0x7b46,0x7b50,0x7b52,0x7b54, -0x7b4d,0x7b4b,0x7b4f,0x7b51,0x7c9f,0x7ca5,0x7d5e,0x7d50, -0x7d68,0x7d55,0x7d2b,0x7d6e,0x7d72,0x7d61,0x7d66,0x7d62, -0x7d70,0x7d73,0x5584,0x7fd4,0x7fd5,0x800b,0x8052,0x8085, -0x8155,0x8154,0x814b,0x8151,0x814e,0x8139,0x8146,0x813e, -0x814c,0x8153,0x8174,0x8212,0x821c,0x83e9,0x8403,0x83f8, -0x840d,0x83e0,0x83c5,0x840b,0x83c1,0x83ef,0x83f1,0x83f4, -0x8457,0x840a,0x83f0,0x840c,0x83cc,0x83fd,0x83f2,0x83ca, -0x8438,0x840e,0x8404,0x83dc,0x8407,0x83d4,0x83df,0x865b, -0x86df,0x86d9,0x86ed,0x86d4,0x86db,0x86e4,0x86d0,0x86de, -0x8857,0x88c1,0x88c2,0x88b1,0x8983,0x8996,0x8a3b,0x8a60, -0x8a55,0x8a5e,0x8a3c,0x8a41,0x8a54,0x8a5b,0x8a50,0x8a46, -0x8a34,0x8a3a,0x8a36,0x8a56,0x8c61,0x8c82,0x8caf,0x8cbc, -0x8cb3,0x8cbd,0x8cc1,0x8cbb,0x8cc0,0x8cb4,0x8cb7,0x8cb6, -0x8cbf,0x8cb8,0x8d8a,0x8d85,0x8d81,0x8dce,0x8ddd,0x8dcb, -0x8dda,0x8dd1,0x8dcc,0x8ddb,0x8dc6,0x8efb,0x8ef8,0x8efc, -0x8f9c,0x902e,0x9035,0x9031,0x9038,0x9032,0x9036,0x9102, -0x90f5,0x9109,0x90fe,0x9163,0x9165,0x91cf,0x9214,0x9215, -0x9223,0x9209,0x921e,0x920d,0x9210,0x9207,0x9211,0x9594, -0x958f,0x958b,0x9591,0x9593,0x9592,0x958e,0x968a,0x968e, -0x968b,0x967d,0x9685,0x9686,0x968d,0x9672,0x9684,0x96c1, -0x96c5,0x96c4,0x96c6,0x96c7,0x96ef,0x96f2,0x97cc,0x9805, -0x9806,0x9808,0x98e7,0x98ea,0x98ef,0x98e9,0x98f2,0x98ed, -0x99ae,0x99ad,0x9ec3,0x9ecd,0x9ed1,0x4e82,0x50ad,0x50b5, -0x50b2,0x50b3,0x50c5,0x50be,0x50ac,0x50b7,0x50bb,0x50af, -0x50c7,0x527f,0x5277,0x527d,0x52df,0x52e6,0x52e4,0x52e2, -0x52e3,0x532f,0x55df,0x55e8,0x55d3,0x55e6,0x55ce,0x55dc, -0x55c7,0x55d1,0x55e3,0x55e4,0x55ef,0x55da,0x55e1,0x55c5, -0x55c6,0x55e5,0x55c9,0x5712,0x5713,0x585e,0x5851,0x5858, -0x5857,0x585a,0x5854,0x586b,0x584c,0x586d,0x584a,0x5862, -0x5852,0x584b,0x5967,0x5ac1,0x5ac9,0x5acc,0x5abe,0x5abd, -0x5abc,0x5ab3,0x5ac2,0x5ab2,0x5d69,0x5d6f,0x5e4c,0x5e79, -0x5ec9,0x5ec8,0x5f12,0x5f59,0x5fac,0x5fae,0x611a,0x610f, -0x6148,0x611f,0x60f3,0x611b,0x60f9,0x6101,0x6108,0x614e, -0x614c,0x6144,0x614d,0x613e,0x6134,0x6127,0x610d,0x6106, -0x6137,0x6221,0x6222,0x6413,0x643e,0x641e,0x642a,0x642d, -0x643d,0x642c,0x640f,0x641c,0x6414,0x640d,0x6436,0x6416, -0x6417,0x6406,0x656c,0x659f,0x65b0,0x6697,0x6689,0x6687, -0x6688,0x6696,0x6684,0x6698,0x668d,0x6703,0x6994,0x696d, -0x695a,0x6977,0x6960,0x6954,0x6975,0x6930,0x6982,0x694a, -0x6968,0x696b,0x695e,0x6953,0x6979,0x6986,0x695d,0x6963, -0x695b,0x6b47,0x6b72,0x6bc0,0x6bbf,0x6bd3,0x6bfd,0x6ea2, -0x6eaf,0x6ed3,0x6eb6,0x6ec2,0x6e90,0x6e9d,0x6ec7,0x6ec5, -0x6ea5,0x6e98,0x6ebc,0x6eba,0x6eab,0x6ed1,0x6e96,0x6e9c, -0x6ec4,0x6ed4,0x6eaa,0x6ea7,0x6eb4,0x714e,0x7159,0x7169, -0x7164,0x7149,0x7167,0x715c,0x716c,0x7166,0x714c,0x7165, -0x715e,0x7146,0x7168,0x7156,0x723a,0x7252,0x7337,0x7345, -0x733f,0x733e,0x746f,0x745a,0x7455,0x745f,0x745e,0x7441, -0x743f,0x7459,0x745b,0x745c,0x7576,0x7578,0x7600,0x75f0, -0x7601,0x75f2,0x75f1,0x75fa,0x75ff,0x75f4,0x75f3,0x76de, -0x76df,0x775b,0x776b,0x7766,0x775e,0x7763,0x7779,0x776a, -0x776c,0x775c,0x7765,0x7768,0x7762,0x77ee,0x788e,0x78b0, -0x7897,0x7898,0x788c,0x7889,0x787c,0x7891,0x7893,0x787f, -0x797a,0x797f,0x7981,0x842c,0x79bd,0x7a1c,0x7a1a,0x7a20, -0x7a14,0x7a1f,0x7a1e,0x7a9f,0x7aa0,0x7b77,0x7bc0,0x7b60, -0x7b6e,0x7b67,0x7cb1,0x7cb3,0x7cb5,0x7d93,0x7d79,0x7d91, -0x7d81,0x7d8f,0x7d5b,0x7f6e,0x7f69,0x7f6a,0x7f72,0x7fa9, -0x7fa8,0x7fa4,0x8056,0x8058,0x8086,0x8084,0x8171,0x8170, -0x8178,0x8165,0x816e,0x8173,0x816b,0x8179,0x817a,0x8166, -0x8205,0x8247,0x8482,0x8477,0x843d,0x8431,0x8475,0x8466, -0x846b,0x8449,0x846c,0x845b,0x843c,0x8435,0x8461,0x8463, -0x8469,0x846d,0x8446,0x865e,0x865c,0x865f,0x86f9,0x8713, -0x8708,0x8707,0x8700,0x86fe,0x86fb,0x8702,0x8703,0x8706, -0x870a,0x8859,0x88df,0x88d4,0x88d9,0x88dc,0x88d8,0x88dd, -0x88e1,0x88ca,0x88d5,0x88d2,0x899c,0x89e3,0x8a6b,0x8a72, -0x8a73,0x8a66,0x8a69,0x8a70,0x8a87,0x8a7c,0x8a63,0x8aa0, -0x8a71,0x8a85,0x8a6d,0x8a62,0x8a6e,0x8a6c,0x8a79,0x8a7b, -0x8a3e,0x8a68,0x8c62,0x8c8a,0x8c89,0x8cca,0x8cc7,0x8cc8, -0x8cc4,0x8cb2,0x8cc3,0x8cc2,0x8cc5,0x8de1,0x8ddf,0x8de8, -0x8def,0x8df3,0x8dfa,0x8dea,0x8de4,0x8de6,0x8eb2,0x8f03, -0x8f09,0x8efe,0x8f0a,0x8f9f,0x8fb2,0x904b,0x904a,0x9053, -0x9042,0x9054,0x903c,0x9055,0x9050,0x9047,0x904f,0x904e, -0x904d,0x9051,0x903e,0x9041,0x9112,0x9117,0x916c,0x916a, -0x9169,0x91c9,0x9237,0x9257,0x9238,0x923d,0x9240,0x923e, -0x925b,0x924b,0x9264,0x9251,0x9234,0x9249,0x924d,0x9245, -0x9239,0x923f,0x925a,0x9598,0x9698,0x9694,0x9695,0x96cd, -0x96cb,0x96c9,0x96ca,0x96f7,0x96fb,0x96f9,0x96f6,0x9756, -0x9774,0x9776,0x9810,0x9811,0x9813,0x980a,0x9812,0x980c, -0x98fc,0x98f4,0x98fd,0x98fe,0x99b3,0x99b1,0x99b4,0x9ae1, -0x9ce9,0x9e82,0x9f0e,0x9f13,0x9f20,0x50e7,0x50ee,0x50e5, -0x50d6,0x50ed,0x50da,0x50d5,0x50cf,0x50d1,0x50f1,0x50ce, -0x50e9,0x5162,0x51f3,0x5283,0x5282,0x5331,0x53ad,0x55fe, -0x5600,0x561b,0x5617,0x55fd,0x5614,0x5606,0x5609,0x560d, -0x560e,0x55f7,0x5616,0x561f,0x5608,0x5610,0x55f6,0x5718, -0x5716,0x5875,0x587e,0x5883,0x5893,0x588a,0x5879,0x5885, -0x587d,0x58fd,0x5925,0x5922,0x5924,0x596a,0x5969,0x5ae1, -0x5ae6,0x5ae9,0x5ad7,0x5ad6,0x5ad8,0x5ae3,0x5b75,0x5bde, -0x5be7,0x5be1,0x5be5,0x5be6,0x5be8,0x5be2,0x5be4,0x5bdf, -0x5c0d,0x5c62,0x5d84,0x5d87,0x5e5b,0x5e63,0x5e55,0x5e57, -0x5e54,0x5ed3,0x5ed6,0x5f0a,0x5f46,0x5f70,0x5fb9,0x6147, -0x613f,0x614b,0x6177,0x6162,0x6163,0x615f,0x615a,0x6158, -0x6175,0x622a,0x6487,0x6458,0x6454,0x64a4,0x6478,0x645f, -0x647a,0x6451,0x6467,0x6434,0x646d,0x647b,0x6572,0x65a1, -0x65d7,0x65d6,0x66a2,0x66a8,0x669d,0x699c,0x69a8,0x6995, -0x69c1,0x69ae,0x69d3,0x69cb,0x699b,0x69b7,0x69bb,0x69ab, -0x69b4,0x69d0,0x69cd,0x69ad,0x69cc,0x69a6,0x69c3,0x69a3, -0x6b49,0x6b4c,0x6c33,0x6f33,0x6f14,0x6efe,0x6f13,0x6ef4, -0x6f29,0x6f3e,0x6f20,0x6f2c,0x6f0f,0x6f02,0x6f22,0x6eff, -0x6eef,0x6f06,0x6f31,0x6f38,0x6f32,0x6f23,0x6f15,0x6f2b, -0x6f2f,0x6f88,0x6f2a,0x6eec,0x6f01,0x6ef2,0x6ecc,0x6ef7, -0x7194,0x7199,0x717d,0x718a,0x7184,0x7192,0x723e,0x7292, -0x7296,0x7344,0x7350,0x7464,0x7463,0x746a,0x7470,0x746d, -0x7504,0x7591,0x7627,0x760d,0x760b,0x7609,0x7613,0x76e1, -0x76e3,0x7784,0x777d,0x777f,0x7761,0x78c1,0x789f,0x78a7, -0x78b3,0x78a9,0x78a3,0x798e,0x798f,0x798d,0x7a2e,0x7a31, -0x7aaa,0x7aa9,0x7aed,0x7aef,0x7ba1,0x7b95,0x7b8b,0x7b75, -0x7b97,0x7b9d,0x7b94,0x7b8f,0x7bb8,0x7b87,0x7b84,0x7cb9, -0x7cbd,0x7cbe,0x7dbb,0x7db0,0x7d9c,0x7dbd,0x7dbe,0x7da0, -0x7dca,0x7db4,0x7db2,0x7db1,0x7dba,0x7da2,0x7dbf,0x7db5, -0x7db8,0x7dad,0x7dd2,0x7dc7,0x7dac,0x7f70,0x7fe0,0x7fe1, -0x7fdf,0x805e,0x805a,0x8087,0x8150,0x8180,0x818f,0x8188, -0x818a,0x817f,0x8182,0x81e7,0x81fa,0x8207,0x8214,0x821e, -0x824b,0x84c9,0x84bf,0x84c6,0x84c4,0x8499,0x849e,0x84b2, -0x849c,0x84cb,0x84b8,0x84c0,0x84d3,0x8490,0x84bc,0x84d1, -0x84ca,0x873f,0x871c,0x873b,0x8722,0x8725,0x8734,0x8718, -0x8755,0x8737,0x8729,0x88f3,0x8902,0x88f4,0x88f9,0x88f8, -0x88fd,0x88e8,0x891a,0x88ef,0x8aa6,0x8a8c,0x8a9e,0x8aa3, -0x8a8d,0x8aa1,0x8a93,0x8aa4,0x8aaa,0x8aa5,0x8aa8,0x8a98, -0x8a91,0x8a9a,0x8aa7,0x8c6a,0x8c8d,0x8c8c,0x8cd3,0x8cd1, -0x8cd2,0x8d6b,0x8d99,0x8d95,0x8dfc,0x8f14,0x8f12,0x8f15, -0x8f13,0x8fa3,0x9060,0x9058,0x905c,0x9063,0x9059,0x905e, -0x9062,0x905d,0x905b,0x9119,0x9118,0x911e,0x9175,0x9178, -0x9177,0x9174,0x9278,0x92ac,0x9280,0x9285,0x9298,0x9296, -0x927b,0x9293,0x929c,0x92a8,0x927c,0x9291,0x95a1,0x95a8, -0x95a9,0x95a3,0x95a5,0x95a4,0x9699,0x969c,0x969b,0x96cc, -0x96d2,0x9700,0x977c,0x9785,0x97f6,0x9817,0x9818,0x98af, -0x98b1,0x9903,0x9905,0x990c,0x9909,0x99c1,0x9aaf,0x9ab0, -0x9ae6,0x9b41,0x9b42,0x9cf4,0x9cf6,0x9cf3,0x9ebc,0x9f3b, -0x9f4a,0x5104,0x5100,0x50fb,0x50f5,0x50f9,0x5102,0x5108, -0x5109,0x5105,0x51dc,0x5287,0x5288,0x5289,0x528d,0x528a, -0x52f0,0x53b2,0x562e,0x563b,0x5639,0x5632,0x563f,0x5634, -0x5629,0x5653,0x564e,0x5657,0x5674,0x5636,0x562f,0x5630, -0x5880,0x589f,0x589e,0x58b3,0x589c,0x58ae,0x58a9,0x58a6, -0x596d,0x5b09,0x5afb,0x5b0b,0x5af5,0x5b0c,0x5b08,0x5bee, -0x5bec,0x5be9,0x5beb,0x5c64,0x5c65,0x5d9d,0x5d94,0x5e62, -0x5e5f,0x5e61,0x5ee2,0x5eda,0x5edf,0x5edd,0x5ee3,0x5ee0, -0x5f48,0x5f71,0x5fb7,0x5fb5,0x6176,0x6167,0x616e,0x615d, -0x6155,0x6182,0x617c,0x6170,0x616b,0x617e,0x61a7,0x6190, -0x61ab,0x618e,0x61ac,0x619a,0x61a4,0x6194,0x61ae,0x622e, -0x6469,0x646f,0x6479,0x649e,0x64b2,0x6488,0x6490,0x64b0, -0x64a5,0x6493,0x6495,0x64a9,0x6492,0x64ae,0x64ad,0x64ab, -0x649a,0x64ac,0x6499,0x64a2,0x64b3,0x6575,0x6577,0x6578, -0x66ae,0x66ab,0x66b4,0x66b1,0x6a23,0x6a1f,0x69e8,0x6a01, -0x6a1e,0x6a19,0x69fd,0x6a21,0x6a13,0x6a0a,0x69f3,0x6a02, -0x6a05,0x69ed,0x6a11,0x6b50,0x6b4e,0x6ba4,0x6bc5,0x6bc6, -0x6f3f,0x6f7c,0x6f84,0x6f51,0x6f66,0x6f54,0x6f86,0x6f6d, -0x6f5b,0x6f78,0x6f6e,0x6f8e,0x6f7a,0x6f70,0x6f64,0x6f97, -0x6f58,0x6ed5,0x6f6f,0x6f60,0x6f5f,0x719f,0x71ac,0x71b1, -0x71a8,0x7256,0x729b,0x734e,0x7357,0x7469,0x748b,0x7483, -0x747e,0x7480,0x757f,0x7620,0x7629,0x761f,0x7624,0x7626, -0x7621,0x7622,0x769a,0x76ba,0x76e4,0x778e,0x7787,0x778c, -0x7791,0x778b,0x78cb,0x78c5,0x78ba,0x78ca,0x78be,0x78d5, -0x78bc,0x78d0,0x7a3f,0x7a3c,0x7a40,0x7a3d,0x7a37,0x7a3b, -0x7aaf,0x7aae,0x7bad,0x7bb1,0x7bc4,0x7bb4,0x7bc6,0x7bc7, -0x7bc1,0x7ba0,0x7bcc,0x7cca,0x7de0,0x7df4,0x7def,0x7dfb, -0x7dd8,0x7dec,0x7ddd,0x7de8,0x7de3,0x7dda,0x7dde,0x7de9, -0x7d9e,0x7dd9,0x7df2,0x7df9,0x7f75,0x7f77,0x7faf,0x7fe9, -0x8026,0x819b,0x819c,0x819d,0x81a0,0x819a,0x8198,0x8517, -0x853d,0x851a,0x84ee,0x852c,0x852d,0x8513,0x8511,0x8523, -0x8521,0x8514,0x84ec,0x8525,0x84ff,0x8506,0x8782,0x8774, -0x8776,0x8760,0x8766,0x8778,0x8768,0x8759,0x8757,0x874c, -0x8753,0x885b,0x885d,0x8910,0x8907,0x8912,0x8913,0x8915, -0x890a,0x8abc,0x8ad2,0x8ac7,0x8ac4,0x8a95,0x8acb,0x8af8, -0x8ab2,0x8ac9,0x8ac2,0x8abf,0x8ab0,0x8ad6,0x8acd,0x8ab6, -0x8ab9,0x8adb,0x8c4c,0x8c4e,0x8c6c,0x8ce0,0x8cde,0x8ce6, -0x8ce4,0x8cec,0x8ced,0x8ce2,0x8ce3,0x8cdc,0x8cea,0x8ce1, -0x8d6d,0x8d9f,0x8da3,0x8e2b,0x8e10,0x8e1d,0x8e22,0x8e0f, -0x8e29,0x8e1f,0x8e21,0x8e1e,0x8eba,0x8f1d,0x8f1b,0x8f1f, -0x8f29,0x8f26,0x8f2a,0x8f1c,0x8f1e,0x8f25,0x9069,0x906e, -0x9068,0x906d,0x9077,0x9130,0x912d,0x9127,0x9131,0x9187, -0x9189,0x918b,0x9183,0x92c5,0x92bb,0x92b7,0x92ea,0x92e4, -0x92c1,0x92b3,0x92bc,0x92d2,0x92c7,0x92f0,0x92b2,0x95ad, -0x95b1,0x9704,0x9706,0x9707,0x9709,0x9760,0x978d,0x978b, -0x978f,0x9821,0x982b,0x981c,0x98b3,0x990a,0x9913,0x9912, -0x9918,0x99dd,0x99d0,0x99df,0x99db,0x99d1,0x99d5,0x99d2, -0x99d9,0x9ab7,0x9aee,0x9aef,0x9b27,0x9b45,0x9b44,0x9b77, -0x9b6f,0x9d06,0x9d09,0x9d03,0x9ea9,0x9ebe,0x9ece,0x58a8, -0x9f52,0x5112,0x5118,0x5114,0x5110,0x5115,0x5180,0x51aa, -0x51dd,0x5291,0x5293,0x52f3,0x5659,0x566b,0x5679,0x5669, -0x5664,0x5678,0x566a,0x5668,0x5665,0x5671,0x566f,0x566c, -0x5662,0x5676,0x58c1,0x58be,0x58c7,0x58c5,0x596e,0x5b1d, -0x5b34,0x5b78,0x5bf0,0x5c0e,0x5f4a,0x61b2,0x6191,0x61a9, -0x618a,0x61cd,0x61b6,0x61be,0x61ca,0x61c8,0x6230,0x64c5, -0x64c1,0x64cb,0x64bb,0x64bc,0x64da,0x64c4,0x64c7,0x64c2, -0x64cd,0x64bf,0x64d2,0x64d4,0x64be,0x6574,0x66c6,0x66c9, -0x66b9,0x66c4,0x66c7,0x66b8,0x6a3d,0x6a38,0x6a3a,0x6a59, -0x6a6b,0x6a58,0x6a39,0x6a44,0x6a62,0x6a61,0x6a4b,0x6a47, -0x6a35,0x6a5f,0x6a48,0x6b59,0x6b77,0x6c05,0x6fc2,0x6fb1, -0x6fa1,0x6fc3,0x6fa4,0x6fc1,0x6fa7,0x6fb3,0x6fc0,0x6fb9, -0x6fb6,0x6fa6,0x6fa0,0x6fb4,0x71be,0x71c9,0x71d0,0x71d2, -0x71c8,0x71d5,0x71b9,0x71ce,0x71d9,0x71dc,0x71c3,0x71c4, -0x7368,0x749c,0x74a3,0x7498,0x749f,0x749e,0x74e2,0x750c, -0x750d,0x7634,0x7638,0x763a,0x76e7,0x76e5,0x77a0,0x779e, -0x779f,0x77a5,0x78e8,0x78da,0x78ec,0x78e7,0x79a6,0x7a4d, -0x7a4e,0x7a46,0x7a4c,0x7a4b,0x7aba,0x7bd9,0x7c11,0x7bc9, -0x7be4,0x7bdb,0x7be1,0x7be9,0x7be6,0x7cd5,0x7cd6,0x7e0a, -0x7e11,0x7e08,0x7e1b,0x7e23,0x7e1e,0x7e1d,0x7e09,0x7e10, -0x7f79,0x7fb2,0x7ff0,0x7ff1,0x7fee,0x8028,0x81b3,0x81a9, -0x81a8,0x81fb,0x8208,0x8258,0x8259,0x854a,0x8559,0x8548, -0x8568,0x8569,0x8543,0x8549,0x856d,0x856a,0x855e,0x8783, -0x879f,0x879e,0x87a2,0x878d,0x8861,0x892a,0x8932,0x8925, -0x892b,0x8921,0x89aa,0x89a6,0x8ae6,0x8afa,0x8aeb,0x8af1, -0x8b00,0x8adc,0x8ae7,0x8aee,0x8afe,0x8b01,0x8b02,0x8af7, -0x8aed,0x8af3,0x8af6,0x8afc,0x8c6b,0x8c6d,0x8c93,0x8cf4, -0x8e44,0x8e31,0x8e34,0x8e42,0x8e39,0x8e35,0x8f3b,0x8f2f, -0x8f38,0x8f33,0x8fa8,0x8fa6,0x9075,0x9074,0x9078,0x9072, -0x907c,0x907a,0x9134,0x9192,0x9320,0x9336,0x92f8,0x9333, -0x932f,0x9322,0x92fc,0x932b,0x9304,0x931a,0x9310,0x9326, -0x9321,0x9315,0x932e,0x9319,0x95bb,0x96a7,0x96a8,0x96aa, -0x96d5,0x970e,0x9711,0x9716,0x970d,0x9713,0x970f,0x975b, -0x975c,0x9766,0x9798,0x9830,0x9838,0x983b,0x9837,0x982d, -0x9839,0x9824,0x9910,0x9928,0x991e,0x991b,0x9921,0x991a, -0x99ed,0x99e2,0x99f1,0x9ab8,0x9abc,0x9afb,0x9aed,0x9b28, -0x9b91,0x9d15,0x9d23,0x9d26,0x9d28,0x9d12,0x9d1b,0x9ed8, -0x9ed4,0x9f8d,0x9f9c,0x512a,0x511f,0x5121,0x5132,0x52f5, -0x568e,0x5680,0x5690,0x5685,0x5687,0x568f,0x58d5,0x58d3, -0x58d1,0x58ce,0x5b30,0x5b2a,0x5b24,0x5b7a,0x5c37,0x5c68, -0x5dbc,0x5dba,0x5dbd,0x5db8,0x5e6b,0x5f4c,0x5fbd,0x61c9, -0x61c2,0x61c7,0x61e6,0x61cb,0x6232,0x6234,0x64ce,0x64ca, -0x64d8,0x64e0,0x64f0,0x64e6,0x64ec,0x64f1,0x64e2,0x64ed, -0x6582,0x6583,0x66d9,0x66d6,0x6a80,0x6a94,0x6a84,0x6aa2, -0x6a9c,0x6adb,0x6aa3,0x6a7e,0x6a97,0x6a90,0x6aa0,0x6b5c, -0x6bae,0x6bda,0x6c08,0x6fd8,0x6ff1,0x6fdf,0x6fe0,0x6fdb, -0x6fe4,0x6feb,0x6fef,0x6f80,0x6fec,0x6fe1,0x6fe9,0x6fd5, -0x6fee,0x6ff0,0x71e7,0x71df,0x71ee,0x71e6,0x71e5,0x71ed, -0x71ec,0x71f4,0x71e0,0x7235,0x7246,0x7370,0x7372,0x74a9, -0x74b0,0x74a6,0x74a8,0x7646,0x7642,0x764c,0x76ea,0x77b3, -0x77aa,0x77b0,0x77ac,0x77a7,0x77ad,0x77ef,0x78f7,0x78fa, -0x78f4,0x78ef,0x7901,0x79a7,0x79aa,0x7a57,0x7abf,0x7c07, -0x7c0d,0x7bfe,0x7bf7,0x7c0c,0x7be0,0x7ce0,0x7cdc,0x7cde, -0x7ce2,0x7cdf,0x7cd9,0x7cdd,0x7e2e,0x7e3e,0x7e46,0x7e37, -0x7e32,0x7e43,0x7e2b,0x7e3d,0x7e31,0x7e45,0x7e41,0x7e34, -0x7e39,0x7e48,0x7e35,0x7e3f,0x7e2f,0x7f44,0x7ff3,0x7ffc, -0x8071,0x8072,0x8070,0x806f,0x8073,0x81c6,0x81c3,0x81ba, -0x81c2,0x81c0,0x81bf,0x81bd,0x81c9,0x81be,0x81e8,0x8209, -0x8271,0x85aa,0x8584,0x857e,0x859c,0x8591,0x8594,0x85af, -0x859b,0x8587,0x85a8,0x858a,0x85a6,0x8667,0x87c0,0x87d1, -0x87b3,0x87d2,0x87c6,0x87ab,0x87bb,0x87ba,0x87c8,0x87cb, -0x893b,0x8936,0x8944,0x8938,0x893d,0x89ac,0x8b0e,0x8b17, -0x8b19,0x8b1b,0x8b0a,0x8b20,0x8b1d,0x8b04,0x8b10,0x8c41, -0x8c3f,0x8c73,0x8cfa,0x8cfd,0x8cfc,0x8cf8,0x8cfb,0x8da8, -0x8e49,0x8e4b,0x8e48,0x8e4a,0x8f44,0x8f3e,0x8f42,0x8f45, -0x8f3f,0x907f,0x907d,0x9084,0x9081,0x9082,0x9080,0x9139, -0x91a3,0x919e,0x919c,0x934d,0x9382,0x9328,0x9375,0x934a, -0x9365,0x934b,0x9318,0x937e,0x936c,0x935b,0x9370,0x935a, -0x9354,0x95ca,0x95cb,0x95cc,0x95c8,0x95c6,0x96b1,0x96b8, -0x96d6,0x971c,0x971e,0x97a0,0x97d3,0x9846,0x98b6,0x9935, -0x9a01,0x99ff,0x9bae,0x9bab,0x9baa,0x9bad,0x9d3b,0x9d3f, -0x9e8b,0x9ecf,0x9ede,0x9edc,0x9edd,0x9edb,0x9f3e,0x9f4b, -0x53e2,0x5695,0x56ae,0x58d9,0x58d8,0x5b38,0x5f5e,0x61e3, -0x6233,0x64f4,0x64f2,0x64fe,0x6506,0x64fa,0x64fb,0x64f7, -0x65b7,0x66dc,0x6726,0x6ab3,0x6aac,0x6ac3,0x6abb,0x6ab8, -0x6ac2,0x6aae,0x6aaf,0x6b5f,0x6b78,0x6baf,0x7009,0x700b, -0x6ffe,0x7006,0x6ffa,0x7011,0x700f,0x71fb,0x71fc,0x71fe, -0x71f8,0x7377,0x7375,0x74a7,0x74bf,0x7515,0x7656,0x7658, -0x7652,0x77bd,0x77bf,0x77bb,0x77bc,0x790e,0x79ae,0x7a61, -0x7a62,0x7a60,0x7ac4,0x7ac5,0x7c2b,0x7c27,0x7c2a,0x7c1e, -0x7c23,0x7c21,0x7ce7,0x7e54,0x7e55,0x7e5e,0x7e5a,0x7e61, -0x7e52,0x7e59,0x7f48,0x7ff9,0x7ffb,0x8077,0x8076,0x81cd, -0x81cf,0x820a,0x85cf,0x85a9,0x85cd,0x85d0,0x85c9,0x85b0, -0x85ba,0x85b9,0x87ef,0x87ec,0x87f2,0x87e0,0x8986,0x89b2, -0x89f4,0x8b28,0x8b39,0x8b2c,0x8b2b,0x8c50,0x8d05,0x8e59, -0x8e63,0x8e66,0x8e64,0x8e5f,0x8e55,0x8ec0,0x8f49,0x8f4d, -0x9087,0x9083,0x9088,0x91ab,0x91ac,0x91d0,0x9394,0x938a, -0x9396,0x93a2,0x93b3,0x93ae,0x93ac,0x93b0,0x9398,0x939a, -0x9397,0x95d4,0x95d6,0x95d0,0x95d5,0x96e2,0x96dc,0x96d9, -0x96db,0x96de,0x9724,0x97a3,0x97a6,0x97ad,0x97f9,0x984d, -0x984f,0x984c,0x984e,0x9853,0x98ba,0x993e,0x993f,0x993d, -0x992e,0x99a5,0x9a0e,0x9ac1,0x9b03,0x9b06,0x9b4f,0x9b4e, -0x9b4d,0x9bca,0x9bc9,0x9bfd,0x9bc8,0x9bc0,0x9d51,0x9d5d, -0x9d60,0x9ee0,0x9f15,0x9f2c,0x5133,0x56a5,0x56a8,0x58de, -0x58df,0x58e2,0x5bf5,0x9f90,0x5eec,0x61f2,0x61f7,0x61f6, -0x61f5,0x6500,0x650f,0x66e0,0x66dd,0x6ae5,0x6add,0x6ada, -0x6ad3,0x701b,0x701f,0x7028,0x701a,0x701d,0x7015,0x7018, -0x7206,0x720d,0x7258,0x72a2,0x7378,0x737a,0x74bd,0x74ca, -0x74e3,0x7587,0x7586,0x765f,0x7661,0x77c7,0x7919,0x79b1, -0x7a6b,0x7a69,0x7c3e,0x7c3f,0x7c38,0x7c3d,0x7c37,0x7c40, -0x7e6b,0x7e6d,0x7e79,0x7e69,0x7e6a,0x7e73,0x7f85,0x7fb6, -0x7fb9,0x7fb8,0x81d8,0x85e9,0x85dd,0x85ea,0x85d5,0x85e4, -0x85e5,0x85f7,0x87fb,0x8805,0x880d,0x87f9,0x87fe,0x8960, -0x895f,0x8956,0x895e,0x8b41,0x8b5c,0x8b58,0x8b49,0x8b5a, -0x8b4e,0x8b4f,0x8b46,0x8b59,0x8d08,0x8d0a,0x8e7c,0x8e72, -0x8e87,0x8e76,0x8e6c,0x8e7a,0x8e74,0x8f54,0x8f4e,0x8fad, -0x908a,0x908b,0x91b1,0x91ae,0x93e1,0x93d1,0x93df,0x93c3, -0x93c8,0x93dc,0x93dd,0x93d6,0x93e2,0x93cd,0x93d8,0x93e4, -0x93d7,0x93e8,0x95dc,0x96b4,0x96e3,0x972a,0x9727,0x9761, -0x97dc,0x97fb,0x985e,0x9858,0x985b,0x98bc,0x9945,0x9949, -0x9a16,0x9a19,0x9b0d,0x9be8,0x9be7,0x9bd6,0x9bdb,0x9d89, -0x9d61,0x9d72,0x9d6a,0x9d6c,0x9e92,0x9e97,0x9e93,0x9eb4, -0x52f8,0x56b7,0x56b6,0x56b4,0x56bc,0x58e4,0x5b40,0x5b43, -0x5b7d,0x5bf6,0x5dc9,0x61f8,0x61fa,0x6518,0x6514,0x6519, -0x66e6,0x6727,0x6aec,0x703e,0x7030,0x7032,0x7210,0x737b, -0x74cf,0x7662,0x7665,0x7926,0x792a,0x792c,0x792b,0x7ac7, -0x7af6,0x7c4c,0x7c43,0x7c4d,0x7cef,0x7cf0,0x8fae,0x7e7d, -0x7e7c,0x7e82,0x7f4c,0x8000,0x81da,0x8266,0x85fb,0x85f9, -0x8611,0x85fa,0x8606,0x860b,0x8607,0x860a,0x8814,0x8815, -0x8964,0x89ba,0x89f8,0x8b70,0x8b6c,0x8b66,0x8b6f,0x8b5f, -0x8b6b,0x8d0f,0x8d0d,0x8e89,0x8e81,0x8e85,0x8e82,0x91b4, -0x91cb,0x9418,0x9403,0x93fd,0x95e1,0x9730,0x98c4,0x9952, -0x9951,0x99a8,0x9a2b,0x9a30,0x9a37,0x9a35,0x9c13,0x9c0d, -0x9e79,0x9eb5,0x9ee8,0x9f2f,0x9f5f,0x9f63,0x9f61,0x5137, -0x5138,0x56c1,0x56c0,0x56c2,0x5914,0x5c6c,0x5dcd,0x61fc, -0x61fe,0x651d,0x651c,0x6595,0x66e9,0x6afb,0x6b04,0x6afa, -0x6bb2,0x704c,0x721b,0x72a7,0x74d6,0x74d4,0x7669,0x77d3, -0x7c50,0x7e8f,0x7e8c,0x7fbc,0x8617,0x862d,0x861a,0x8823, -0x8822,0x8821,0x881f,0x896a,0x896c,0x89bd,0x8b74,0x8b77, -0x8b7d,0x8d13,0x8e8a,0x8e8d,0x8e8b,0x8f5f,0x8faf,0x91ba, -0x942e,0x9433,0x9435,0x943a,0x9438,0x9432,0x942b,0x95e2, -0x9738,0x9739,0x9732,0x97ff,0x9867,0x9865,0x9957,0x9a45, -0x9a43,0x9a40,0x9a3e,0x9acf,0x9b54,0x9b51,0x9c2d,0x9c25, -0x9daf,0x9db4,0x9dc2,0x9db8,0x9e9d,0x9eef,0x9f19,0x9f5c, -0x9f66,0x9f67,0x513c,0x513b,0x56c8,0x56ca,0x56c9,0x5b7f, -0x5dd4,0x5dd2,0x5f4e,0x61ff,0x6524,0x6b0a,0x6b61,0x7051, -0x7058,0x7380,0x74e4,0x758a,0x766e,0x766c,0x79b3,0x7c60, -0x7c5f,0x807e,0x807d,0x81df,0x8972,0x896f,0x89fc,0x8b80, -0x8d16,0x8d17,0x8e91,0x8e93,0x8f61,0x9148,0x9444,0x9451, -0x9452,0x973d,0x973e,0x97c3,0x97c1,0x986b,0x9955,0x9a55, -0x9a4d,0x9ad2,0x9b1a,0x9c49,0x9c31,0x9c3e,0x9c3b,0x9dd3, -0x9dd7,0x9f34,0x9f6c,0x9f6a,0x9f94,0x56cc,0x5dd6,0x6200, -0x6523,0x652b,0x652a,0x66ec,0x6b10,0x74da,0x7aca,0x7c64, -0x7c63,0x7c65,0x7e93,0x7e96,0x7e94,0x81e2,0x8638,0x863f, -0x8831,0x8b8a,0x9090,0x908f,0x9463,0x9460,0x9464,0x9768, -0x986f,0x995c,0x9a5a,0x9a5b,0x9a57,0x9ad3,0x9ad4,0x9ad1, -0x9c54,0x9c57,0x9c56,0x9de5,0x9e9f,0x9ef4,0x56d1,0x58e9, -0x652c,0x705e,0x7671,0x7672,0x77d7,0x7f50,0x7f88,0x8836, -0x8839,0x8862,0x8b93,0x8b92,0x8b96,0x8277,0x8d1b,0x91c0, -0x946a,0x9742,0x9748,0x9744,0x97c6,0x9870,0x9a5f,0x9b22, -0x9b58,0x9c5f,0x9df9,0x9dfa,0x9e7c,0x9e7d,0x9f07,0x9f77, -0x9f72,0x5ef3,0x6b16,0x7063,0x7c6c,0x7c6e,0x883b,0x89c0, -0x8ea1,0x91c1,0x9472,0x9470,0x9871,0x995e,0x9ad6,0x9b23, -0x9ecc,0x7064,0x77da,0x8b9a,0x9477,0x97c9,0x9a62,0x9a65, -0x7e9c,0x8b9c,0x8eaa,0x91c5,0x947d,0x947e,0x947c,0x9c77, -0x9c78,0x9ef7,0x8c54,0x947f,0x9e1a,0x7228,0x9a6a,0x9b31, -0x9e1b,0x9e1e,0x7c72}; - -static const int cns11643_1_ucs_table_size = (sizeof(cns11643_1_ucs_table)/sizeof(unsigned short)); - -static const unsigned short cns11643_2_ucs_table[] = { -0x4e42,0x4e5c,0x51f5,0x531a,0x5382,0x4e07,0x4e0c,0x4e47, -0x4e8d,0x56d7,0x5c6e,0x5f73,0x4e0f,0x5187,0x4e0e,0x4e2e, -0x4e93,0x4ec2,0x4ec9,0x4ec8,0x5198,0x52fc,0x536c,0x53b9, -0x5720,0x5903,0x592c,0x5c10,0x5dff,0x65e1,0x6bb3,0x6bcc, -0x6c14,0x723f,0x4e31,0x4e3c,0x4ee8,0x4edc,0x4ee9,0x4ee1, -0x4edd,0x4eda,0x520c,0x5209,0x531c,0x534c,0x5722,0x5723, -0x5917,0x592f,0x5b81,0x5b84,0x5c12,0x5c3b,0x5c74,0x5c73, -0x5e04,0x5e80,0x5e82,0x5fc9,0x6209,0x6250,0x6c15,0x6c36, -0x6c43,0x6c3f,0x6c3b,0x72ae,0x72b0,0x738a,0x79b8,0x808a, -0x961e,0x4f0e,0x4f18,0x4f2c,0x4ef5,0x4f14,0x4ef1,0x4f00, -0x4ef7,0x4f08,0x4f1d,0x4f02,0x4f05,0x4f22,0x4f13,0x4f04, -0x4ef4,0x4f12,0x51b1,0x5213,0x5210,0x52a6,0x5322,0x531f, -0x534d,0x538a,0x5407,0x56e1,0x56df,0x572e,0x572a,0x5734, -0x593c,0x5980,0x597c,0x5985,0x597b,0x597e,0x5977,0x597f, -0x5b56,0x5c15,0x5c25,0x5c7c,0x5c7a,0x5c7b,0x5c7e,0x5ddf, -0x5e75,0x5e84,0x5f02,0x5f1a,0x5f74,0x5fd5,0x5fd4,0x5fcf, -0x625c,0x625e,0x6264,0x6261,0x6266,0x6262,0x6259,0x6260, -0x625a,0x6265,0x6537,0x65ef,0x65ee,0x673e,0x6739,0x6738, -0x673b,0x673a,0x673f,0x673c,0x6733,0x6c18,0x6c46,0x6c52, -0x6c5c,0x6c4f,0x6c4a,0x6c54,0x6c4b,0x6c4c,0x7071,0x725e, -0x72b4,0x72b5,0x738e,0x752a,0x767f,0x7a75,0x7f51,0x8278, -0x827c,0x8280,0x827d,0x827f,0x864d,0x897e,0x9099,0x9097, -0x9098,0x909b,0x9094,0x9622,0x9624,0x9620,0x9623,0x4f56, -0x4f3b,0x4f62,0x4f49,0x4f53,0x4f64,0x4f3e,0x4f67,0x4f52, -0x4f5f,0x4f41,0x4f58,0x4f2d,0x4f33,0x4f3f,0x4f61,0x518f, -0x51b9,0x521c,0x521e,0x5221,0x52ad,0x52ae,0x5309,0x5363, -0x5372,0x538e,0x538f,0x5430,0x5437,0x542a,0x5454,0x5445, -0x5419,0x541c,0x5425,0x5418,0x543d,0x544f,0x5441,0x5428, -0x5424,0x5447,0x56ee,0x56e7,0x56e5,0x5741,0x5745,0x574c, -0x5749,0x574b,0x5752,0x5906,0x5940,0x59a6,0x5998,0x59a0, -0x5997,0x598e,0x59a2,0x5990,0x598f,0x59a7,0x59a1,0x5b8e, -0x5b92,0x5c28,0x5c2a,0x5c8d,0x5c8f,0x5c88,0x5c8b,0x5c89, -0x5c92,0x5c8a,0x5c86,0x5c93,0x5c95,0x5de0,0x5e0a,0x5e0e, -0x5e8b,0x5e89,0x5e8c,0x5e88,0x5e8d,0x5f05,0x5f1d,0x5f78, -0x5f76,0x5fd2,0x5fd1,0x5fd0,0x5fed,0x5fe8,0x5fee,0x5ff3, -0x5fe1,0x5fe4,0x5fe3,0x5ffa,0x5fef,0x5ff7,0x5ffb,0x6000, -0x5ff4,0x623a,0x6283,0x628c,0x628e,0x628f,0x6294,0x6287, -0x6271,0x627b,0x627a,0x6270,0x6281,0x6288,0x6277,0x627d, -0x6272,0x6274,0x65f0,0x65f4,0x65f3,0x65f2,0x65f5,0x6745, -0x6747,0x6759,0x6755,0x674c,0x6748,0x675d,0x674d,0x675a, -0x674b,0x6bd0,0x6c19,0x6c1a,0x6c78,0x6c67,0x6c6b,0x6c84, -0x6c8b,0x6c8f,0x6c71,0x6c6f,0x6c69,0x6c9a,0x6c6d,0x6c87, -0x6c95,0x6c9c,0x6c66,0x6c73,0x6c65,0x6c7b,0x6c8e,0x7074, -0x707a,0x7263,0x72bf,0x72bd,0x72c3,0x72c6,0x72c1,0x72ba, -0x72c5,0x7395,0x7397,0x7393,0x7394,0x7392,0x753a,0x7539, -0x7594,0x7595,0x7681,0x793d,0x8034,0x8095,0x8099,0x8090, -0x8092,0x809c,0x8290,0x828f,0x8285,0x828e,0x8291,0x8293, -0x828a,0x8283,0x8284,0x8c78,0x8fc9,0x8fbf,0x909f,0x90a1, -0x90a5,0x909e,0x90a7,0x90a0,0x9630,0x9628,0x962f,0x962d, -0x4e33,0x4f98,0x4f7c,0x4f85,0x4f7d,0x4f80,0x4f87,0x4f76, -0x4f74,0x4f89,0x4f84,0x4f77,0x4f4c,0x4f97,0x4f6a,0x4f9a, -0x4f79,0x4f81,0x4f78,0x4f90,0x4f9c,0x4f94,0x4f9e,0x4f92, -0x4f82,0x4f95,0x4f6b,0x4f6e,0x519e,0x51bc,0x51be,0x5235, -0x5232,0x5233,0x5246,0x5231,0x52bc,0x530a,0x530b,0x533c, -0x5392,0x5394,0x5487,0x547f,0x5481,0x5491,0x5482,0x5488, -0x546b,0x547a,0x547e,0x5465,0x546c,0x5474,0x5466,0x548d, -0x546f,0x5461,0x5460,0x5498,0x5463,0x5467,0x5464,0x56f7, -0x56f9,0x576f,0x5772,0x576d,0x576b,0x5771,0x5770,0x5776, -0x5780,0x5775,0x577b,0x5773,0x5774,0x5762,0x5768,0x577d, -0x590c,0x5945,0x59b5,0x59ba,0x59cf,0x59ce,0x59b2,0x59cc, -0x59c1,0x59b6,0x59bc,0x59c3,0x59d6,0x59b1,0x59bd,0x59c0, -0x59c8,0x59b4,0x59c7,0x5b62,0x5b65,0x5b93,0x5b95,0x5c44, -0x5c47,0x5cae,0x5ca4,0x5ca0,0x5cb5,0x5caf,0x5ca8,0x5cac, -0x5c9f,0x5ca3,0x5cad,0x5ca2,0x5caa,0x5ca7,0x5c9d,0x5ca5, -0x5cb6,0x5cb0,0x5ca6,0x5e17,0x5e14,0x5e19,0x5f28,0x5f22, -0x5f23,0x5f24,0x5f54,0x5f82,0x5f7e,0x5f7d,0x5fde,0x5fe5, -0x602d,0x6026,0x6019,0x6032,0x600b,0x6034,0x600a,0x6017, -0x6033,0x601a,0x601e,0x602c,0x6022,0x600d,0x6010,0x602e, -0x6013,0x6011,0x600c,0x6009,0x601c,0x6214,0x623d,0x62ad, -0x62b4,0x62d1,0x62be,0x62aa,0x62b6,0x62ca,0x62ae,0x62b3, -0x62af,0x62bb,0x62a9,0x62b0,0x62b8,0x653d,0x65a8,0x65bb, -0x6609,0x65fc,0x6604,0x6612,0x6608,0x65fb,0x6603,0x660b, -0x660d,0x6605,0x65fd,0x6611,0x6610,0x66f6,0x670a,0x6785, -0x676c,0x678e,0x6792,0x6776,0x677b,0x6798,0x6786,0x6784, -0x6774,0x678d,0x678c,0x677a,0x679f,0x6791,0x6799,0x6783, -0x677d,0x6781,0x6778,0x6779,0x6794,0x6b25,0x6b80,0x6b7e, -0x6bde,0x6c1d,0x6c93,0x6cec,0x6ceb,0x6cee,0x6cd9,0x6cb6, -0x6cd4,0x6cad,0x6ce7,0x6cb7,0x6cd0,0x6cc2,0x6cba,0x6cc3, -0x6cc6,0x6ced,0x6cf2,0x6cd2,0x6cdd,0x6cb4,0x6c8a,0x6c9d, -0x6c80,0x6cde,0x6cc0,0x6d30,0x6ccd,0x6cc7,0x6cb0,0x6cf9, -0x6ccf,0x6ce9,0x6cd1,0x7094,0x7098,0x7085,0x7093,0x7086, -0x7084,0x7091,0x7096,0x7082,0x709a,0x7083,0x726a,0x72d6, -0x72cb,0x72d8,0x72c9,0x72dc,0x72d2,0x72d4,0x72da,0x72cc, -0x72d1,0x73a4,0x73a1,0x73ad,0x73a6,0x73a2,0x73a0,0x73ac, -0x739d,0x74dd,0x74e8,0x753f,0x7540,0x753e,0x758c,0x7598, -0x76af,0x76f3,0x76f1,0x76f0,0x76f5,0x77f8,0x77fc,0x77f9, -0x77fb,0x77fa,0x77f7,0x7942,0x793f,0x79c5,0x7a78,0x7a7b, -0x7afb,0x7c75,0x7cfd,0x8035,0x808f,0x80ae,0x80a3,0x80b8, -0x80b5,0x80ad,0x8220,0x82a0,0x82c0,0x82ab,0x829a,0x8298, -0x829b,0x82b5,0x82a7,0x82ae,0x82bc,0x829e,0x82ba,0x82b4, -0x82a8,0x82a1,0x82a9,0x82c2,0x82a4,0x82c3,0x82b6,0x82a2, -0x8670,0x866f,0x866d,0x866e,0x8c56,0x8fd2,0x8fcb,0x8fd3, -0x8fcd,0x8fd6,0x8fd5,0x8fd7,0x90b2,0x90b4,0x90af,0x90b3, -0x90b0,0x9639,0x963d,0x963c,0x963a,0x9643,0x4fcd,0x4fc5, -0x4fd3,0x4fb2,0x4fc9,0x4fcb,0x4fc1,0x4fd4,0x4fdc,0x4fd9, -0x4fbb,0x4fb3,0x4fdb,0x4fc7,0x4fd6,0x4fba,0x4fc0,0x4fb9, -0x4fec,0x5244,0x5249,0x52c0,0x52c2,0x533d,0x537c,0x5397, -0x5396,0x5399,0x5398,0x54ba,0x54a1,0x54ad,0x54a5,0x54cf, -0x54c3,0x830d,0x54b7,0x54ae,0x54d6,0x54b6,0x54c5,0x54c6, -0x54a0,0x5470,0x54bc,0x54a2,0x54be,0x5472,0x54de,0x54b0, -0x57b5,0x579e,0x579f,0x57a4,0x578c,0x5797,0x579d,0x579b, -0x5794,0x5798,0x578f,0x5799,0x57a5,0x579a,0x5795,0x58f4, -0x590d,0x5953,0x59e1,0x59de,0x59ee,0x5a00,0x59f1,0x59dd, -0x59fa,0x59fd,0x59fc,0x59f6,0x59e4,0x59f2,0x59f7,0x59db, -0x59e9,0x59f3,0x59f5,0x59e0,0x59fe,0x59f4,0x59ed,0x5ba8, -0x5c4c,0x5cd0,0x5cd8,0x5ccc,0x5cd7,0x5ccb,0x5cdb,0x5cde, -0x5cda,0x5cc9,0x5cc7,0x5cca,0x5cd6,0x5cd3,0x5cd4,0x5ccf, -0x5cc8,0x5cc6,0x5cce,0x5cdf,0x5cf8,0x5df9,0x5e21,0x5e22, -0x5e23,0x5e20,0x5e24,0x5eb0,0x5ea4,0x5ea2,0x5e9b,0x5ea3, -0x5ea5,0x5f07,0x5f2e,0x5f56,0x5f86,0x6037,0x6039,0x6054, -0x6072,0x605e,0x6045,0x6053,0x6047,0x6049,0x605b,0x604c, -0x6040,0x6042,0x605f,0x6024,0x6044,0x6058,0x6066,0x606e, -0x6242,0x6243,0x62cf,0x630d,0x630b,0x62f5,0x630e,0x6303, -0x62eb,0x62f9,0x630f,0x630c,0x62f8,0x62f6,0x6300,0x6313, -0x6314,0x62fa,0x6315,0x62fb,0x62f0,0x6541,0x6543,0x65aa, -0x65bf,0x6636,0x6621,0x6632,0x6635,0x661c,0x6626,0x6622, -0x6633,0x662b,0x663a,0x661d,0x6634,0x6639,0x662e,0x670f, -0x6710,0x67c1,0x67f2,0x67c8,0x67ba,0x67dc,0x67bb,0x67f8, -0x67d8,0x67c0,0x67b7,0x67c5,0x67eb,0x67e4,0x67df,0x67b5, -0x67cd,0x67b3,0x67f7,0x67f6,0x67ee,0x67e3,0x67c2,0x67b9, -0x67ce,0x67e7,0x67f0,0x67b2,0x67fc,0x67c6,0x67ed,0x67cc, -0x67ae,0x67e6,0x67db,0x67fa,0x67c9,0x67ca,0x67c3,0x67ea, -0x67cb,0x6b28,0x6b82,0x6b84,0x6bb6,0x6bd6,0x6bd8,0x6be0, -0x6c20,0x6c21,0x6d28,0x6d34,0x6d2d,0x6d1f,0x6d3c,0x6d3f, -0x6d12,0x6d0a,0x6cda,0x6d33,0x6d04,0x6d19,0x6d3a,0x6d1a, -0x6d11,0x6d00,0x6d1d,0x6d42,0x6d01,0x6d18,0x6d37,0x6d03, -0x6d0f,0x6d40,0x6d07,0x6d20,0x6d2c,0x6d08,0x6d22,0x6d09, -0x6d10,0x70b7,0x709f,0x70be,0x70b1,0x70b0,0x70a1,0x70b4, -0x70b5,0x70a9,0x7241,0x7249,0x724a,0x726c,0x7270,0x7273, -0x726e,0x72ca,0x72e4,0x72e8,0x72eb,0x72df,0x72ea,0x72e6, -0x72e3,0x7385,0x73cc,0x73c2,0x73c8,0x73c5,0x73b9,0x73b6, -0x73b5,0x73b4,0x73eb,0x73bf,0x73c7,0x73be,0x73c3,0x73c6, -0x73b8,0x73cb,0x74ec,0x74ee,0x752e,0x7547,0x7548,0x75a7, -0x75aa,0x7679,0x76c4,0x7708,0x7703,0x7704,0x7705,0x770a, -0x76f7,0x76fb,0x76fa,0x77e7,0x77e8,0x7806,0x7811,0x7812, -0x7805,0x7810,0x780f,0x780e,0x7809,0x7803,0x7813,0x794a, -0x794c,0x794b,0x7945,0x7944,0x79d5,0x79cd,0x79cf,0x79d6, -0x79ce,0x7a80,0x7a7e,0x7ad1,0x7b00,0x7b01,0x7c7a,0x7c78, -0x7c79,0x7c7f,0x7c80,0x7c81,0x7d03,0x7d08,0x7d01,0x7f58, -0x7f91,0x7f8d,0x7fbe,0x8007,0x800e,0x800f,0x8014,0x8037, -0x80d8,0x80c7,0x80e0,0x80d1,0x80c8,0x80c2,0x80d0,0x80c5, -0x80e3,0x80d9,0x80dc,0x80ca,0x80d5,0x80c9,0x80cf,0x80d7, -0x80e6,0x80cd,0x81ff,0x8221,0x8294,0x82d9,0x82fe,0x82f9, -0x8307,0x82e8,0x8300,0x82d5,0x833a,0x82eb,0x82d6,0x82f4, -0x82ec,0x82e1,0x82f2,0x82f5,0x830c,0x82fb,0x82f6,0x82f0, -0x82ea,0x82e4,0x82e0,0x82fa,0x82f3,0x82ed,0x8677,0x8674, -0x867c,0x8673,0x8841,0x884e,0x8867,0x886a,0x8869,0x89d3, -0x8a04,0x8a07,0x8d72,0x8fe3,0x8fe1,0x8fee,0x8fe0,0x90f1, -0x90bd,0x90bf,0x90d5,0x90c5,0x90be,0x90c7,0x90cb,0x90c8, -0x91d4,0x91d3,0x9654,0x964f,0x9651,0x9653,0x964a,0x964e, -0x501e,0x5005,0x5007,0x5013,0x5022,0x5030,0x501b,0x4ff5, -0x4ff4,0x5033,0x5037,0x502c,0x4ff6,0x4ff7,0x5017,0x501c, -0x5020,0x5027,0x5035,0x502f,0x5031,0x500e,0x515a,0x5194, -0x5193,0x51ca,0x51c4,0x51c5,0x51c8,0x51ce,0x5261,0x525a, -0x5252,0x525e,0x525f,0x5255,0x5262,0x52cd,0x530e,0x539e, -0x5526,0x54e2,0x5517,0x5512,0x54e7,0x54f3,0x54e4,0x551a, -0x54ff,0x5504,0x5508,0x54eb,0x5511,0x5505,0x54f1,0x550a, -0x54fb,0x54f7,0x54f8,0x54e0,0x550e,0x5503,0x550b,0x5701, -0x5702,0x57cc,0x5832,0x57d5,0x57d2,0x57ba,0x57c6,0x57bd, -0x57bc,0x57b8,0x57b6,0x57bf,0x57c7,0x57d0,0x57b9,0x57c1, -0x590e,0x594a,0x5a19,0x5a16,0x5a2d,0x5a2e,0x5a15,0x5a0f, -0x5a17,0x5a0a,0x5a1e,0x5a33,0x5b6c,0x5ba7,0x5bad,0x5bac, -0x5c03,0x5c56,0x5c54,0x5cec,0x5cff,0x5cee,0x5cf1,0x5cf7, -0x5d00,0x5cf9,0x5e29,0x5e28,0x5ea8,0x5eae,0x5eaa,0x5eac, -0x5f33,0x5f30,0x5f67,0x605d,0x605a,0x6067,0x6041,0x60a2, -0x6088,0x6080,0x6092,0x6081,0x609d,0x6083,0x6095,0x609b, -0x6097,0x6087,0x609c,0x608e,0x6219,0x6246,0x62f2,0x6310, -0x6356,0x632c,0x6344,0x6345,0x6336,0x6343,0x63e4,0x6339, -0x634b,0x634a,0x633c,0x6329,0x6341,0x6334,0x6358,0x6354, -0x6359,0x632d,0x6347,0x6333,0x635a,0x6351,0x6338,0x6357, -0x6340,0x6348,0x654a,0x6546,0x65c6,0x65c3,0x65c4,0x65c2, -0x664a,0x665f,0x6647,0x6651,0x6712,0x6713,0x681f,0x681a, -0x6849,0x6832,0x6833,0x683b,0x684b,0x684f,0x6816,0x6831, -0x681c,0x6835,0x682b,0x682d,0x682f,0x684e,0x6844,0x6834, -0x681d,0x6812,0x6814,0x6826,0x6828,0x682e,0x684d,0x683a, -0x6825,0x6820,0x6b2c,0x6b2f,0x6b2d,0x6b31,0x6b34,0x6b6d, -0x8082,0x6b88,0x6be6,0x6be4,0x6be8,0x6be3,0x6be2,0x6be7, -0x6c25,0x6d7a,0x6d63,0x6d64,0x6d76,0x6d0d,0x6d61,0x6d92, -0x6d58,0x6d62,0x6d6d,0x6d6f,0x6d91,0x6d8d,0x6def,0x6d7f, -0x6d86,0x6d5e,0x6d67,0x6d60,0x6d97,0x6d70,0x6d7c,0x6d5f, -0x6d82,0x6d98,0x6d2f,0x6d68,0x6d8b,0x6d7e,0x6d80,0x6d84, -0x6d16,0x6d83,0x6d7b,0x6d7d,0x6d75,0x6d90,0x70dc,0x70d3, -0x70d1,0x70dd,0x70cb,0x7f39,0x70e2,0x70d7,0x70d2,0x70de, -0x70e0,0x70d4,0x70cd,0x70c5,0x70c6,0x70c7,0x70da,0x70ce, -0x70e1,0x7242,0x7278,0x7277,0x7276,0x7300,0x72fa,0x72f4, -0x72fe,0x72f6,0x72f3,0x72fb,0x7301,0x73d3,0x73d9,0x73e5, -0x73d6,0x73bc,0x73e7,0x73e3,0x73e9,0x73dc,0x73d2,0x73db, -0x73d4,0x73dd,0x73da,0x73d7,0x73d8,0x73e8,0x74de,0x74df, -0x74f4,0x74f5,0x7521,0x755b,0x755f,0x75b0,0x75c1,0x75bb, -0x75c4,0x75c0,0x75bf,0x75b6,0x75ba,0x768a,0x76c9,0x771d, -0x771b,0x7710,0x7713,0x7712,0x7723,0x7711,0x7715,0x7719, -0x771a,0x7722,0x7727,0x7823,0x782c,0x7822,0x7835,0x782f, -0x7828,0x782e,0x782b,0x7821,0x7829,0x7833,0x782a,0x7831, -0x7954,0x795b,0x794f,0x795c,0x7953,0x7952,0x7951,0x79eb, -0x79ec,0x79e0,0x79ee,0x79ed,0x79ea,0x79dc,0x79de,0x79dd, -0x7a86,0x7a89,0x7a85,0x7a8b,0x7a8c,0x7a8a,0x7a87,0x7ad8, -0x7b10,0x7b04,0x7b13,0x7b05,0x7b0f,0x7b08,0x7b0a,0x7b0e, -0x7b09,0x7b12,0x7c84,0x7c91,0x7c8a,0x7c8c,0x7c88,0x7c8d, -0x7c85,0x7d1e,0x7d1d,0x7d11,0x7d0e,0x7d18,0x7d16,0x7d13, -0x7d1f,0x7d12,0x7d0f,0x7d0c,0x7f5c,0x7f61,0x7f5e,0x7f60, -0x7f5d,0x7f5b,0x7f96,0x7f92,0x7fc3,0x7fc2,0x7fc0,0x8016, -0x803e,0x8039,0x80fa,0x80f2,0x80f9,0x80f5,0x8101,0x80fb, -0x8100,0x8201,0x822f,0x8225,0x8333,0x832d,0x8344,0x8319, -0x8351,0x8325,0x8356,0x833f,0x8341,0x8326,0x831c,0x8322, -0x8342,0x834e,0x831b,0x832a,0x8308,0x833c,0x834d,0x8316, -0x8324,0x8320,0x8337,0x832f,0x8329,0x8347,0x8345,0x834c, -0x8353,0x831e,0x832c,0x834b,0x8327,0x8348,0x8653,0x8652, -0x86a2,0x86a8,0x8696,0x868d,0x8691,0x869e,0x8687,0x8697, -0x8686,0x868b,0x869a,0x8685,0x86a5,0x8699,0x86a1,0x86a7, -0x8695,0x8698,0x868e,0x869d,0x8690,0x8694,0x8843,0x8844, -0x886d,0x8875,0x8876,0x8872,0x8880,0x8871,0x887f,0x886f, -0x8883,0x887e,0x8874,0x887c,0x8a12,0x8c47,0x8c57,0x8c7b, -0x8ca4,0x8ca3,0x8d76,0x8d78,0x8db5,0x8db7,0x8db6,0x8ed1, -0x8ed3,0x8ffe,0x8ff5,0x9002,0x8fff,0x8ffb,0x9004,0x8ffc, -0x8ff6,0x90d6,0x90e0,0x90d9,0x90da,0x90e3,0x90df,0x90e5, -0x90d8,0x90db,0x90d7,0x90dc,0x90e4,0x9150,0x914e,0x914f, -0x91d5,0x91e2,0x91da,0x965c,0x965f,0x96bc,0x98e3,0x9adf, -0x9b2f,0x4e7f,0x5070,0x506a,0x5061,0x505e,0x5060,0x5053, -0x504b,0x505d,0x5072,0x5048,0x504d,0x5041,0x505b,0x504a, -0x5062,0x5015,0x5045,0x505f,0x5069,0x506b,0x5063,0x5064, -0x5046,0x5040,0x506e,0x5073,0x5057,0x5051,0x51d0,0x526b, -0x526d,0x526c,0x526e,0x52d6,0x52d3,0x532d,0x539c,0x5575, -0x5576,0x553c,0x554d,0x5550,0x5534,0x552a,0x5551,0x5562, -0x5536,0x5535,0x5530,0x5552,0x5545,0x550c,0x5532,0x5565, -0x554e,0x5539,0x5548,0x552d,0x553b,0x5540,0x554b,0x570a, -0x5707,0x57fb,0x5814,0x57e2,0x57f6,0x57dc,0x57f4,0x5800, -0x57ed,0x57fd,0x5808,0x57f8,0x580b,0x57f3,0x57cf,0x5807, -0x57ee,0x57e3,0x57f2,0x57e5,0x57ec,0x57e1,0x580e,0x57fc, -0x5810,0x57e7,0x5801,0x580c,0x57f1,0x57e9,0x57f0,0x580d, -0x5804,0x595c,0x5a60,0x5a58,0x5a55,0x5a67,0x5a5e,0x5a38, -0x5a35,0x5a6d,0x5a50,0x5a5f,0x5a65,0x5a6c,0x5a53,0x5a64, -0x5a57,0x5a43,0x5a5d,0x5a52,0x5a44,0x5a5b,0x5a48,0x5a8e, -0x5a3e,0x5a4d,0x5a39,0x5a4c,0x5a70,0x5a69,0x5a47,0x5a51, -0x5a56,0x5a42,0x5a5c,0x5b72,0x5b6e,0x5bc1,0x5bc0,0x5c59, -0x5d1e,0x5d0b,0x5d1d,0x5d1a,0x5d20,0x5d0c,0x5d28,0x5d0d, -0x5d26,0x5d25,0x5d0f,0x5d30,0x5d12,0x5d23,0x5d1f,0x5d2e, -0x5e3e,0x5e34,0x5eb1,0x5eb4,0x5eb9,0x5eb2,0x5eb3,0x5f36, -0x5f38,0x5f9b,0x5f96,0x5f9f,0x608a,0x6090,0x6086,0x60be, -0x60b0,0x60ba,0x60d3,0x60d4,0x60cf,0x60e4,0x60d9,0x60dd, -0x60c8,0x60b1,0x60db,0x60b7,0x60ca,0x60bf,0x60c3,0x60cd, -0x60c0,0x6332,0x6365,0x638a,0x6382,0x637d,0x63bd,0x639e, -0x63ad,0x639d,0x6397,0x63ab,0x638e,0x636f,0x6387,0x6390, -0x636e,0x63af,0x6375,0x639c,0x636d,0x63ae,0x637c,0x63a4, -0x633b,0x639f,0x6378,0x6385,0x6381,0x6391,0x638d,0x6370, -0x6553,0x65cd,0x6665,0x6661,0x665b,0x6659,0x665c,0x6662, -0x6718,0x6879,0x6887,0x6890,0x689c,0x686d,0x686e,0x68ae, -0x68ab,0x6956,0x686f,0x68a3,0x68ac,0x68a9,0x6875,0x6874, -0x68b2,0x688f,0x6877,0x6892,0x687c,0x686b,0x6872,0x68aa, -0x6880,0x6871,0x687e,0x689b,0x6896,0x688b,0x68a0,0x6889, -0x68a4,0x6878,0x687b,0x6891,0x688c,0x688a,0x687d,0x6b36, -0x6b33,0x6b37,0x6b38,0x6b91,0x6b8f,0x6b8d,0x6b8e,0x6b8c, -0x6c2a,0x6dc0,0x6dab,0x6db4,0x6db3,0x6e74,0x6dac,0x6de9, -0x6de2,0x6db7,0x6df6,0x6dd4,0x6e00,0x6dc8,0x6de0,0x6ddf, -0x6dd6,0x6dbe,0x6de5,0x6ddc,0x6ddd,0x6ddb,0x6df4,0x6dca, -0x6dbd,0x6ded,0x6df0,0x6dba,0x6dd5,0x6dc2,0x6dcf,0x6dc9, -0x6dd0,0x6df2,0x6dd3,0x6dfd,0x6dd7,0x6dcd,0x6de3,0x6dbb, -0x70fa,0x710d,0x70f7,0x7117,0x70f4,0x710c,0x70f0,0x7104, -0x70f3,0x7110,0x70fc,0x70ff,0x7106,0x7113,0x7100,0x70f8, -0x70f6,0x710b,0x7102,0x710e,0x727e,0x727b,0x727c,0x727f, -0x731d,0x7317,0x7307,0x7311,0x7318,0x730a,0x7308,0x72ff, -0x730f,0x731e,0x7388,0x73f6,0x73f8,0x73f5,0x7404,0x7401, -0x73fd,0x7407,0x7400,0x73fa,0x73fc,0x73ff,0x740c,0x740b, -0x73f4,0x7408,0x7564,0x7563,0x75ce,0x75d2,0x75cf,0x75cb, -0x75cc,0x75d1,0x75d0,0x768f,0x7689,0x76d3,0x7739,0x772f, -0x772d,0x7731,0x7732,0x7734,0x7733,0x773d,0x7725,0x773b, -0x7735,0x7848,0x7852,0x7849,0x784d,0x784a,0x784c,0x7826, -0x7845,0x7850,0x7964,0x7967,0x7969,0x796a,0x7963,0x796b, -0x7961,0x79bb,0x79fa,0x79f8,0x79f6,0x79f7,0x7a8f,0x7a94, -0x7a90,0x7b35,0x7b3b,0x7b34,0x7b25,0x7b30,0x7b22,0x7b24, -0x7b33,0x7b18,0x7b2a,0x7b1d,0x7b31,0x7b2b,0x7b2d,0x7b2f, -0x7b32,0x7b38,0x7b1a,0x7b23,0x7c94,0x7c98,0x7c96,0x7ca3, -0x7d35,0x7d3d,0x7d38,0x7d36,0x7d3a,0x7d45,0x7d2c,0x7d29, -0x7d41,0x7d47,0x7d3e,0x7d3f,0x7d4a,0x7d3b,0x7d28,0x7f63, -0x7f95,0x7f9c,0x7f9d,0x7f9b,0x7fca,0x7fcb,0x7fcd,0x7fd0, -0x7fd1,0x7fc7,0x7fcf,0x7fc9,0x801f,0x801e,0x801b,0x8047, -0x8043,0x8048,0x8118,0x8125,0x8119,0x811b,0x812d,0x811f, -0x812c,0x811e,0x8121,0x8115,0x8127,0x811d,0x8122,0x8211, -0x8238,0x8233,0x823a,0x8234,0x8232,0x8274,0x8390,0x83a3, -0x83a8,0x838d,0x837a,0x8373,0x83a4,0x8374,0x838f,0x8381, -0x8395,0x8399,0x8375,0x8394,0x83a9,0x837d,0x8383,0x838c, -0x839d,0x839b,0x83aa,0x838b,0x837e,0x83a5,0x83af,0x8388, -0x8397,0x83b0,0x837f,0x83a6,0x8387,0x83ae,0x8376,0x8659, -0x8656,0x86bf,0x86b7,0x86c2,0x86c1,0x86c5,0x86ba,0x86b0, -0x86c8,0x86b9,0x86b3,0x86b8,0x86cc,0x86b4,0x86bb,0x86bc, -0x86c3,0x86bd,0x86be,0x8852,0x8889,0x8895,0x88a8,0x88a2, -0x88aa,0x889a,0x8891,0x88a1,0x889f,0x8898,0x88a7,0x8899, -0x889b,0x8897,0x88a4,0x88ac,0x888c,0x8893,0x888e,0x8982, -0x89d6,0x89d9,0x89d5,0x8a30,0x8a27,0x8a2c,0x8a1e,0x8c39, -0x8c3b,0x8c5c,0x8c5d,0x8c7d,0x8ca5,0x8d7d,0x8d7b,0x8d79, -0x8dbc,0x8dc2,0x8db9,0x8dbf,0x8dc1,0x8ed8,0x8ede,0x8edd, -0x8edc,0x8ed7,0x8ee0,0x8ee1,0x9024,0x900b,0x9011,0x901c, -0x900c,0x9021,0x90ef,0x90ea,0x90f0,0x90f4,0x90f2,0x90f3, -0x90d4,0x90eb,0x90ec,0x90e9,0x9156,0x9158,0x915a,0x9153, -0x9155,0x91ec,0x91f4,0x91f1,0x91f3,0x91f8,0x91e4,0x91f9, -0x91ea,0x91eb,0x91f7,0x91e8,0x91ee,0x957a,0x9586,0x9588, -0x967c,0x966d,0x966b,0x9671,0x966f,0x96bf,0x976a,0x9804, -0x98e5,0x9997,0x509b,0x5095,0x5094,0x509e,0x508b,0x50a3, -0x5083,0x508c,0x508e,0x509d,0x5068,0x509c,0x5092,0x5082, -0x5087,0x515f,0x51d4,0x5312,0x5311,0x53a4,0x53a7,0x5591, -0x55a8,0x55a5,0x55ad,0x5577,0x5645,0x55a2,0x5593,0x5588, -0x558f,0x55b5,0x5581,0x55a3,0x5592,0x55a4,0x557d,0x558c, -0x55a6,0x557f,0x5595,0x55a1,0x558e,0x570c,0x5829,0x5837, -0x5819,0x581e,0x5827,0x5823,0x5828,0x57f5,0x5848,0x5825, -0x581c,0x581b,0x5833,0x583f,0x5836,0x582e,0x5839,0x5838, -0x582d,0x582c,0x583b,0x5961,0x5aaf,0x5a94,0x5a9f,0x5a7a, -0x5aa2,0x5a9e,0x5a78,0x5aa6,0x5a7c,0x5aa5,0x5aac,0x5a95, -0x5aae,0x5a37,0x5a84,0x5a8a,0x5a97,0x5a83,0x5a8b,0x5aa9, -0x5a7b,0x5a7d,0x5a8c,0x5a9c,0x5a8f,0x5a93,0x5a9d,0x5bea, -0x5bcd,0x5bcb,0x5bd4,0x5bd1,0x5bca,0x5bce,0x5c0c,0x5c30, -0x5d37,0x5d43,0x5d6b,0x5d41,0x5d4b,0x5d3f,0x5d35,0x5d51, -0x5d4e,0x5d55,0x5d33,0x5d3a,0x5d52,0x5d3d,0x5d31,0x5d59, -0x5d42,0x5d39,0x5d49,0x5d38,0x5d3c,0x5d32,0x5d36,0x5d40, -0x5d45,0x5e44,0x5e41,0x5f58,0x5fa6,0x5fa5,0x5fab,0x60c9, -0x60b9,0x60cc,0x60e2,0x60ce,0x60c4,0x6114,0x60f2,0x610a, -0x6116,0x6105,0x60f5,0x6113,0x60f8,0x60fc,0x60fe,0x60c1, -0x6103,0x6118,0x611d,0x6110,0x60ff,0x6104,0x610b,0x624a, -0x6394,0x63b1,0x63b0,0x63ce,0x63e5,0x63e8,0x63ef,0x63c3, -0x649d,0x63f3,0x63ca,0x63e0,0x63f6,0x63d5,0x63f2,0x63f5, -0x6461,0x63df,0x63be,0x63dd,0x63dc,0x63c4,0x63d8,0x63d3, -0x63c2,0x63c7,0x63cc,0x63cb,0x63c8,0x63f0,0x63d7,0x63d9, -0x6532,0x6567,0x656a,0x6564,0x655c,0x6568,0x6565,0x658c, -0x659d,0x659e,0x65ae,0x65d0,0x65d2,0x667c,0x666c,0x667b, -0x6680,0x6671,0x6679,0x666a,0x6672,0x6701,0x690c,0x68d3, -0x6904,0x68dc,0x692a,0x68ec,0x68ea,0x68f1,0x690f,0x68d6, -0x68f7,0x68eb,0x68e4,0x68f6,0x6913,0x6910,0x68f3,0x68e1, -0x6907,0x68cc,0x6908,0x6970,0x68b4,0x6911,0x68ef,0x68c6, -0x6914,0x68f8,0x68d0,0x68fd,0x68fc,0x68e8,0x690b,0x690a, -0x6917,0x68ce,0x68c8,0x68dd,0x68de,0x68e6,0x68f4,0x68d1, -0x6906,0x68d4,0x68e9,0x6915,0x6925,0x68c7,0x6b39,0x6b3b, -0x6b3f,0x6b3c,0x6b94,0x6b97,0x6b99,0x6b95,0x6bbd,0x6bf0, -0x6bf2,0x6bf3,0x6c30,0x6dfc,0x6e46,0x6e47,0x6e1f,0x6e49, -0x6e88,0x6e3c,0x6e3d,0x6e45,0x6e62,0x6e2b,0x6e3f,0x6e41, -0x6e5d,0x6e73,0x6e1c,0x6e33,0x6e4b,0x6e40,0x6e51,0x6e3b, -0x6e03,0x6e2e,0x6e5e,0x6e68,0x6e5c,0x6e61,0x6e31,0x6e28, -0x6e60,0x6e71,0x6e6b,0x6e39,0x6e22,0x6e30,0x6e53,0x6e65, -0x6e27,0x6e78,0x6e64,0x6e77,0x6e55,0x6e79,0x6e52,0x6e66, -0x6e35,0x6e36,0x6e5a,0x7120,0x711e,0x712f,0x70fb,0x712e, -0x7131,0x7123,0x7125,0x7122,0x7132,0x711f,0x7128,0x713a, -0x711b,0x724b,0x725a,0x7288,0x7289,0x7286,0x7285,0x728b, -0x7312,0x730b,0x7330,0x7322,0x7331,0x7333,0x7327,0x7332, -0x732d,0x7326,0x7323,0x7335,0x730c,0x742e,0x742c,0x7430, -0x742b,0x7416,0x741a,0x7421,0x742d,0x7431,0x7424,0x7423, -0x741d,0x7429,0x7420,0x7432,0x74fb,0x752f,0x756f,0x756c, -0x75e7,0x75da,0x75e1,0x75e6,0x75dd,0x75df,0x75e4,0x75d7, -0x7695,0x7692,0x76da,0x7746,0x7747,0x7744,0x774d,0x7745, -0x774a,0x774e,0x774b,0x774c,0x77de,0x77ec,0x7860,0x7864, -0x7865,0x785c,0x786d,0x7871,0x786a,0x786e,0x7870,0x7869, -0x7868,0x785e,0x7862,0x7974,0x7973,0x7972,0x7970,0x7a02, -0x7a0a,0x7a03,0x7a0c,0x7a04,0x7a99,0x7ae6,0x7ae4,0x7b4a, -0x7b47,0x7b44,0x7b48,0x7b4c,0x7b4e,0x7b40,0x7b58,0x7b45, -0x7ca2,0x7c9e,0x7ca8,0x7ca1,0x7d58,0x7d6f,0x7d63,0x7d53, -0x7d56,0x7d67,0x7d6a,0x7d4f,0x7d6d,0x7d5c,0x7d6b,0x7d52, -0x7d54,0x7d69,0x7d51,0x7d5f,0x7d4e,0x7f3e,0x7f3f,0x7f65, -0x7f66,0x7fa2,0x7fa0,0x7fa1,0x7fd7,0x8051,0x804f,0x8050, -0x80fe,0x80d4,0x8143,0x814a,0x8152,0x814f,0x8147,0x813d, -0x814d,0x813a,0x81e6,0x81ee,0x81f7,0x81f8,0x81f9,0x8204, -0x823c,0x823d,0x823f,0x8275,0x833b,0x83cf,0x83f9,0x8423, -0x83c0,0x83e8,0x8412,0x83e7,0x83e4,0x83fc,0x83f6,0x8410, -0x83c6,0x83c8,0x83eb,0x83e3,0x83bf,0x8401,0x83dd,0x83e5, -0x83d8,0x83ff,0x83e1,0x83cb,0x83ce,0x83d6,0x83f5,0x83c9, -0x8409,0x840f,0x83de,0x8411,0x8406,0x83c2,0x83f3,0x83d5, -0x83fa,0x83c7,0x83d1,0x83ea,0x8413,0x839a,0x83c3,0x83ec, -0x83ee,0x83c4,0x83fb,0x83d7,0x83e2,0x841b,0x83db,0x83fe, -0x86d8,0x86e2,0x86e6,0x86d3,0x86e3,0x86da,0x86ea,0x86dd, -0x86eb,0x86dc,0x86ec,0x86e9,0x86d7,0x86e8,0x86d1,0x8848, -0x8856,0x8855,0x88ba,0x88d7,0x88b9,0x88b8,0x88c0,0x88be, -0x88b6,0x88bc,0x88b7,0x88bd,0x88b2,0x8901,0x88c9,0x8995, -0x8998,0x8997,0x89dd,0x89da,0x89db,0x8a4e,0x8a4d,0x8a39, -0x8a59,0x8a40,0x8a57,0x8a58,0x8a44,0x8a45,0x8a52,0x8a48, -0x8a51,0x8a4a,0x8a4c,0x8a4f,0x8c5f,0x8c81,0x8c80,0x8cba, -0x8cbe,0x8cb0,0x8cb9,0x8cb5,0x8d84,0x8d80,0x8d89,0x8dd8, -0x8dd3,0x8dcd,0x8dc7,0x8dd6,0x8ddc,0x8dcf,0x8dd5,0x8dd9, -0x8dc8,0x8dd7,0x8dc5,0x8eef,0x8ef7,0x8efa,0x8ef9,0x8ee6, -0x8eee,0x8ee5,0x8ef5,0x8ee7,0x8ee8,0x8ef6,0x8eeb,0x8ef1, -0x8eec,0x8ef4,0x8ee9,0x902d,0x9034,0x902f,0x9106,0x912c, -0x9104,0x90ff,0x90fc,0x9108,0x90f9,0x90fb,0x9101,0x9100, -0x9107,0x9105,0x9103,0x9161,0x9164,0x915f,0x9162,0x9160, -0x9201,0x920a,0x9225,0x9203,0x921a,0x9226,0x920f,0x920c, -0x9200,0x9212,0x91ff,0x91fd,0x9206,0x9204,0x9227,0x9202, -0x921c,0x9224,0x9219,0x9217,0x9205,0x9216,0x957b,0x958d, -0x958c,0x9590,0x9687,0x967e,0x9688,0x9689,0x9683,0x9680, -0x96c2,0x96c8,0x96c3,0x96f1,0x96f0,0x976c,0x9770,0x976e, -0x9807,0x98a9,0x98eb,0x9ce6,0x9ef9,0x4e83,0x4e84,0x4eb6, -0x50bd,0x50bf,0x50c6,0x50ae,0x50c4,0x50ca,0x50b4,0x50c8, -0x50c2,0x50b0,0x50c1,0x50ba,0x50b1,0x50cb,0x50c9,0x50b6, -0x50b8,0x51d7,0x527a,0x5278,0x527b,0x527c,0x55c3,0x55db, -0x55cc,0x55d0,0x55cb,0x55ca,0x55dd,0x55c0,0x55d4,0x55c4, -0x55e9,0x55bf,0x55d2,0x558d,0x55cf,0x55d5,0x55e2,0x55d6, -0x55c8,0x55f2,0x55cd,0x55d9,0x55c2,0x5714,0x5853,0x5868, -0x5864,0x584f,0x584d,0x5849,0x586f,0x5855,0x584e,0x585d, -0x5859,0x5865,0x585b,0x583d,0x5863,0x5871,0x58fc,0x5ac7, -0x5ac4,0x5acb,0x5aba,0x5ab8,0x5ab1,0x5ab5,0x5ab0,0x5abf, -0x5ac8,0x5abb,0x5ac6,0x5ab7,0x5ac0,0x5aca,0x5ab4,0x5ab6, -0x5acd,0x5ab9,0x5a90,0x5bd6,0x5bd8,0x5bd9,0x5c1f,0x5c33, -0x5d71,0x5d63,0x5d4a,0x5d65,0x5d72,0x5d6c,0x5d5e,0x5d68, -0x5d67,0x5d62,0x5df0,0x5e4f,0x5e4e,0x5e4a,0x5e4d,0x5e4b, -0x5ec5,0x5ecc,0x5ec6,0x5ecb,0x5ec7,0x5f40,0x5faf,0x5fad, -0x60f7,0x6149,0x614a,0x612b,0x6145,0x6136,0x6132,0x612e, -0x6146,0x612f,0x614f,0x6129,0x6140,0x6220,0x9168,0x6223, -0x6225,0x6224,0x63c5,0x63f1,0x63eb,0x6410,0x6412,0x6409, -0x6420,0x6424,0x6433,0x6443,0x641f,0x6415,0x6418,0x6439, -0x6437,0x6422,0x6423,0x640c,0x6426,0x6430,0x6428,0x6441, -0x6435,0x642f,0x640a,0x641a,0x6440,0x6425,0x6427,0x640b, -0x63e7,0x641b,0x642e,0x6421,0x640e,0x656f,0x6592,0x65d3, -0x6686,0x668c,0x6695,0x6690,0x668b,0x668a,0x6699,0x6694, -0x6678,0x6720,0x6966,0x695f,0x6938,0x694e,0x6962,0x6971, -0x693f,0x6945,0x696a,0x6939,0x6942,0x6957,0x6959,0x697a, -0x6948,0x6949,0x6935,0x696c,0x6933,0x693d,0x6965,0x68f0, -0x6978,0x6934,0x6969,0x6940,0x696f,0x6944,0x6976,0x6958, -0x6941,0x6974,0x694c,0x693b,0x694b,0x6937,0x695c,0x694f, -0x6951,0x6932,0x6952,0x692f,0x697b,0x693c,0x6b46,0x6b45, -0x6b43,0x6b42,0x6b48,0x6b41,0x6b9b,0x6bfb,0x6bfc,0x6bf9, -0x6bf7,0x6bf8,0x6e9b,0x6ed6,0x6ec8,0x6e8f,0x6ec0,0x6e9f, -0x6e93,0x6e94,0x6ea0,0x6eb1,0x6eb9,0x6ec6,0x6ed2,0x6ebd, -0x6ec1,0x6e9e,0x6ec9,0x6eb7,0x6eb0,0x6ecd,0x6ea6,0x6ecf, -0x6eb2,0x6ebe,0x6ec3,0x6edc,0x6ed8,0x6e99,0x6e92,0x6e8e, -0x6e8d,0x6ea4,0x6ea1,0x6ebf,0x6eb3,0x6ed0,0x6eca,0x6e97, -0x6eae,0x6ea3,0x7147,0x7154,0x7152,0x7163,0x7160,0x7141, -0x715d,0x7162,0x7172,0x7178,0x716a,0x7161,0x7142,0x7158, -0x7143,0x714b,0x7170,0x715f,0x7150,0x7153,0x7144,0x714d, -0x715a,0x724f,0x728d,0x728c,0x7291,0x7290,0x728e,0x733c, -0x7342,0x733b,0x733a,0x7340,0x734a,0x7349,0x7444,0x744a, -0x744b,0x7452,0x7451,0x7457,0x7440,0x744f,0x7450,0x744e, -0x7442,0x7446,0x744d,0x7454,0x74e1,0x74ff,0x74fe,0x74fd, -0x751d,0x7579,0x7577,0x6983,0x75ef,0x760f,0x7603,0x75f7, -0x75fe,0x75fc,0x75f9,0x75f8,0x7610,0x75fb,0x75f6,0x75ed, -0x75f5,0x75fd,0x7699,0x76b5,0x76dd,0x7755,0x775f,0x7760, -0x7752,0x7756,0x775a,0x7769,0x7767,0x7754,0x7759,0x776d, -0x77e0,0x7887,0x789a,0x7894,0x788f,0x7884,0x7895,0x7885, -0x7886,0x78a1,0x7883,0x7879,0x7899,0x7880,0x7896,0x787b, -0x797c,0x7982,0x797d,0x7979,0x7a11,0x7a18,0x7a19,0x7a12, -0x7a17,0x7a15,0x7a22,0x7a13,0x7a1b,0x7a10,0x7aa3,0x7aa2, -0x7a9e,0x7aeb,0x7b66,0x7b64,0x7b6d,0x7b74,0x7b69,0x7b72, -0x7b65,0x7b73,0x7b71,0x7b70,0x7b61,0x7b78,0x7b76,0x7b63, -0x7cb2,0x7cb4,0x7caf,0x7d88,0x7d86,0x7d80,0x7d8d,0x7d7f, -0x7d85,0x7d7a,0x7d8e,0x7d7b,0x7d83,0x7d7c,0x7d8c,0x7d94, -0x7d84,0x7d7d,0x7d92,0x7f6d,0x7f6b,0x7f67,0x7f68,0x7f6c, -0x7fa6,0x7fa5,0x7fa7,0x7fdb,0x7fdc,0x8021,0x8164,0x8160, -0x8177,0x815c,0x8169,0x815b,0x8162,0x8172,0x6721,0x815e, -0x8176,0x8167,0x816f,0x8144,0x8161,0x821d,0x8249,0x8244, -0x8240,0x8242,0x8245,0x84f1,0x843f,0x8456,0x8476,0x8479, -0x848f,0x848d,0x8465,0x8451,0x8440,0x8486,0x8467,0x8430, -0x844d,0x847d,0x845a,0x8459,0x8474,0x8473,0x845d,0x8507, -0x845e,0x8437,0x843a,0x8434,0x847a,0x8443,0x8478,0x8432, -0x8445,0x8429,0x83d9,0x844b,0x842f,0x8442,0x842d,0x845f, -0x8470,0x8439,0x844e,0x844c,0x8452,0x846f,0x84c5,0x848e, -0x843b,0x8447,0x8436,0x8433,0x8468,0x847e,0x8444,0x842b, -0x8460,0x8454,0x846e,0x8450,0x870b,0x8704,0x86f7,0x870c, -0x86fa,0x86d6,0x86f5,0x874d,0x86f8,0x870e,0x8709,0x8701, -0x86f6,0x870d,0x8705,0x88d6,0x88cb,0x88cd,0x88ce,0x88de, -0x88db,0x88da,0x88cc,0x88d0,0x8985,0x899b,0x89df,0x89e5, -0x89e4,0x89e1,0x89e0,0x89e2,0x89dc,0x89e6,0x8a76,0x8a86, -0x8a7f,0x8a61,0x8a3f,0x8a77,0x8a82,0x8a84,0x8a75,0x8a83, -0x8a81,0x8a74,0x8a7a,0x8c3c,0x8c4b,0x8c4a,0x8c65,0x8c64, -0x8c66,0x8c86,0x8c84,0x8c85,0x8ccc,0x8d68,0x8d69,0x8d91, -0x8d8c,0x8d8e,0x8d8f,0x8d8d,0x8d93,0x8d94,0x8d90,0x8d92, -0x8df0,0x8de0,0x8dec,0x8df1,0x8dee,0x8dd0,0x8de9,0x8de3, -0x8de2,0x8de7,0x8df2,0x8deb,0x8df4,0x8f06,0x8eff,0x8f01, -0x8f00,0x8f05,0x8f07,0x8f08,0x8f02,0x8f0b,0x9052,0x903f, -0x9044,0x9049,0x903d,0x9110,0x910d,0x910f,0x9111,0x9116, -0x9114,0x910b,0x910e,0x916e,0x916f,0x9248,0x9252,0x9230, -0x923a,0x9266,0x9233,0x9265,0x925e,0x9283,0x922e,0x924a, -0x9246,0x926d,0x926c,0x924f,0x9260,0x9267,0x926f,0x9236, -0x9261,0x9270,0x9231,0x9254,0x9263,0x9250,0x9272,0x924e, -0x9253,0x924c,0x9256,0x9232,0x959f,0x959c,0x959e,0x959b, -0x9692,0x9693,0x9691,0x9697,0x96ce,0x96fa,0x96fd,0x96f8, -0x96f5,0x9773,0x9777,0x9778,0x9772,0x980f,0x980d,0x980e, -0x98ac,0x98f6,0x98f9,0x99af,0x99b2,0x99b0,0x99b5,0x9aad, -0x9aab,0x9b5b,0x9cea,0x9ced,0x9ce7,0x9e80,0x9efd,0x50e6, -0x50d4,0x50d7,0x50e8,0x50f3,0x50db,0x50ea,0x50dd,0x50e4, -0x50d3,0x50ec,0x50f0,0x50ef,0x50e3,0x50e0,0x51d8,0x5280, -0x5281,0x52e9,0x52eb,0x5330,0x53ac,0x5627,0x5615,0x560c, -0x5612,0x55fc,0x560f,0x561c,0x5601,0x5613,0x5602,0x55fa, -0x561d,0x5604,0x55ff,0x55f9,0x5889,0x587c,0x5890,0x5898, -0x5886,0x5881,0x587f,0x5874,0x588b,0x587a,0x5887,0x5891, -0x588e,0x5876,0x5882,0x5888,0x587b,0x5894,0x588f,0x58fe, -0x596b,0x5adc,0x5aee,0x5ae5,0x5ad5,0x5aea,0x5ada,0x5aed, -0x5aeb,0x5af3,0x5ae2,0x5ae0,0x5adb,0x5aec,0x5ade,0x5add, -0x5ad9,0x5ae8,0x5adf,0x5b77,0x5be0,0x5be3,0x5c63,0x5d82, -0x5d80,0x5d7d,0x5d86,0x5d7a,0x5d81,0x5d77,0x5d8a,0x5d89, -0x5d88,0x5d7e,0x5d7c,0x5d8d,0x5d79,0x5d7f,0x5e58,0x5e59, -0x5e53,0x5ed8,0x5ed1,0x5ed7,0x5ece,0x5edc,0x5ed5,0x5ed9, -0x5ed2,0x5ed4,0x5f44,0x5f43,0x5f6f,0x5fb6,0x612c,0x6128, -0x6141,0x615e,0x6171,0x6173,0x6152,0x6153,0x6172,0x616c, -0x6180,0x6174,0x6154,0x617a,0x615b,0x6165,0x613b,0x616a, -0x6161,0x6156,0x6229,0x6227,0x622b,0x642b,0x644d,0x645b, -0x645d,0x6474,0x6476,0x6472,0x6473,0x647d,0x6475,0x6466, -0x64a6,0x644e,0x6482,0x645e,0x645c,0x644b,0x6453,0x6460, -0x6450,0x647f,0x643f,0x646c,0x646b,0x6459,0x6465,0x6477, -0x6573,0x65a0,0x66a1,0x66a0,0x669f,0x6705,0x6704,0x6722, -0x69b1,0x69b6,0x69c9,0x69a0,0x69ce,0x6996,0x69b0,0x69ac, -0x69bc,0x6991,0x6999,0x698e,0x69a7,0x698d,0x69a9,0x69be, -0x69af,0x69bf,0x69c4,0x69bd,0x69a4,0x69d4,0x69b9,0x69ca, -0x699a,0x69cf,0x69b3,0x6993,0x69aa,0x69a1,0x699e,0x69d9, -0x6997,0x6990,0x69c2,0x69b5,0x69a5,0x69c6,0x6b4a,0x6b4d, -0x6b4b,0x6b9e,0x6b9f,0x6ba0,0x6bc3,0x6bc4,0x6bfe,0x6ece, -0x6ef5,0x6ef1,0x6f03,0x6f25,0x6ef8,0x6f37,0x6efb,0x6f2e, -0x6f09,0x6f4e,0x6f19,0x6f1a,0x6f27,0x6f18,0x6f3b,0x6f12, -0x6eed,0x6f0a,0x6f36,0x6f73,0x6ef9,0x6eee,0x6f2d,0x6f40, -0x6f30,0x6f3c,0x6f35,0x6eeb,0x6f07,0x6f0e,0x6f43,0x6f05, -0x6efd,0x6ef6,0x6f39,0x6f1c,0x6efc,0x6f3a,0x6f1f,0x6f0d, -0x6f1e,0x6f08,0x6f21,0x7187,0x7190,0x7189,0x7180,0x7185, -0x7182,0x718f,0x717b,0x7186,0x7181,0x7197,0x7244,0x7253, -0x7297,0x7295,0x7293,0x7343,0x734d,0x7351,0x734c,0x7462, -0x7473,0x7471,0x7475,0x7472,0x7467,0x746e,0x7500,0x7502, -0x7503,0x757d,0x7590,0x7616,0x7608,0x760c,0x7615,0x7611, -0x760a,0x7614,0x76b8,0x7781,0x777c,0x7785,0x7782,0x776e, -0x7780,0x776f,0x777e,0x7783,0x78b2,0x78aa,0x78b4,0x78ad, -0x78a8,0x787e,0x78ab,0x789e,0x78a5,0x78a0,0x78ac,0x78a2, -0x78a4,0x7998,0x798a,0x798b,0x7996,0x7995,0x7994,0x7993, -0x7997,0x7988,0x7992,0x7990,0x7a2b,0x7a4a,0x7a30,0x7a2f, -0x7a28,0x7a26,0x7aa8,0x7aab,0x7aac,0x7aee,0x7b88,0x7b9c, -0x7b8a,0x7b91,0x7b90,0x7b96,0x7b8d,0x7b8c,0x7b9b,0x7b8e, -0x7b85,0x7b98,0x5284,0x7b99,0x7ba4,0x7b82,0x7cbb,0x7cbf, -0x7cbc,0x7cba,0x7da7,0x7db7,0x7dc2,0x7da3,0x7daa,0x7dc1, -0x7dc0,0x7dc5,0x7d9d,0x7dce,0x7dc4,0x7dc6,0x7dcb,0x7dcc, -0x7daf,0x7db9,0x7d96,0x7dbc,0x7d9f,0x7da6,0x7dae,0x7da9, -0x7da1,0x7dc9,0x7f73,0x7fe2,0x7fe3,0x7fe5,0x7fde,0x8024, -0x805d,0x805c,0x8189,0x8186,0x8183,0x8187,0x818d,0x818c, -0x818b,0x8215,0x8497,0x84a4,0x84a1,0x849f,0x84ba,0x84ce, -0x84c2,0x84ac,0x84ae,0x84ab,0x84b9,0x84b4,0x84c1,0x84cd, -0x84aa,0x849a,0x84b1,0x84d0,0x849d,0x84a7,0x84bb,0x84a2, -0x8494,0x84c7,0x84cc,0x849b,0x84a9,0x84af,0x84a8,0x84d6, -0x8498,0x84b6,0x84cf,0x84a0,0x84d7,0x84d4,0x84d2,0x84db, -0x84b0,0x8491,0x8661,0x8733,0x8723,0x8728,0x876b,0x8740, -0x872e,0x871e,0x8721,0x8719,0x871b,0x8743,0x872c,0x8741, -0x873e,0x8746,0x8720,0x8732,0x872a,0x872d,0x873c,0x8712, -0x873a,0x8731,0x8735,0x8742,0x8726,0x8727,0x8738,0x8724, -0x871a,0x8730,0x8711,0x88f7,0x88e7,0x88f1,0x88f2,0x88fa, -0x88fe,0x88ee,0x88fc,0x88f6,0x88fb,0x88f0,0x88ec,0x88eb, -0x899d,0x89a1,0x899f,0x899e,0x89e9,0x89eb,0x89e8,0x8aab, -0x8a99,0x8a8b,0x8a92,0x8a8f,0x8a96,0x8c3d,0x8c68,0x8c69, -0x8cd5,0x8ccf,0x8cd7,0x8d96,0x8e09,0x8e02,0x8dff,0x8e0d, -0x8dfd,0x8e0a,0x8e03,0x8e07,0x8e06,0x8e05,0x8dfe,0x8e00, -0x8e04,0x8f10,0x8f11,0x8f0e,0x8f0d,0x9123,0x911c,0x9120, -0x9122,0x911f,0x911d,0x911a,0x9124,0x9121,0x911b,0x917a, -0x9172,0x9179,0x9173,0x92a5,0x92a4,0x9276,0x929b,0x927a, -0x92a0,0x9294,0x92aa,0x928d,0x92a6,0x929a,0x92ab,0x9279, -0x9297,0x927f,0x92a3,0x92ee,0x928e,0x9282,0x9295,0x92a2, -0x927d,0x9288,0x92a1,0x928a,0x9286,0x928c,0x9299,0x92a7, -0x927e,0x9287,0x92a9,0x929d,0x928b,0x922d,0x969e,0x96a1, -0x96ff,0x9758,0x977d,0x977a,0x977e,0x9783,0x9780,0x9782, -0x977b,0x9784,0x9781,0x977f,0x97ce,0x97cd,0x9816,0x98ad, -0x98ae,0x9902,0x9900,0x9907,0x999d,0x999c,0x99c3,0x99b9, -0x99bb,0x99ba,0x99c2,0x99bd,0x99c7,0x9ab1,0x9ae3,0x9ae7, -0x9b3e,0x9b3f,0x9b60,0x9b61,0x9b5f,0x9cf1,0x9cf2,0x9cf5, -0x9ea7,0x50ff,0x5103,0x5130,0x50f8,0x5106,0x5107,0x50f6, -0x50fe,0x510b,0x510c,0x50fd,0x510a,0x528b,0x528c,0x52f1, -0x52ef,0x5648,0x5642,0x564c,0x5635,0x5641,0x564a,0x5649, -0x5646,0x5658,0x565a,0x5640,0x5633,0x563d,0x562c,0x563e, -0x5638,0x562a,0x563a,0x571a,0x58ab,0x589d,0x58b1,0x58a0, -0x58a3,0x58af,0x58ac,0x58a5,0x58a1,0x58ff,0x5aff,0x5af4, -0x5afd,0x5af7,0x5af6,0x5b03,0x5af8,0x5b02,0x5af9,0x5b01, -0x5b07,0x5b05,0x5b0f,0x5c67,0x5d99,0x5d97,0x5d9f,0x5d92, -0x5da2,0x5d93,0x5d95,0x5da0,0x5d9c,0x5da1,0x5d9a,0x5d9e, -0x5e69,0x5e5d,0x5e60,0x5e5c,0x7df3,0x5edb,0x5ede,0x5ee1, -0x5f49,0x5fb2,0x618b,0x6183,0x6179,0x61b1,0x61b0,0x61a2, -0x6189,0x619b,0x6193,0x61af,0x61ad,0x619f,0x6192,0x61aa, -0x61a1,0x618d,0x6166,0x61b3,0x622d,0x646e,0x6470,0x6496, -0x64a0,0x6485,0x6497,0x649c,0x648f,0x648b,0x648a,0x648c, -0x64a3,0x649f,0x6468,0x64b1,0x6498,0x6576,0x657a,0x6579, -0x657b,0x65b2,0x65b3,0x66b5,0x66b0,0x66a9,0x66b2,0x66b7, -0x66aa,0x66af,0x6a00,0x6a06,0x6a17,0x69e5,0x69f8,0x6a15, -0x69f1,0x69e4,0x6a20,0x69ff,0x69ec,0x69e2,0x6a1b,0x6a1d, -0x69fe,0x6a27,0x69f2,0x69ee,0x6a14,0x69f7,0x69e7,0x6a40, -0x6a08,0x69e6,0x69fb,0x6a0d,0x69fc,0x69eb,0x6a09,0x6a04, -0x6a18,0x6a25,0x6a0f,0x69f6,0x6a26,0x6a07,0x69f4,0x6a16, -0x6b51,0x6ba5,0x6ba3,0x6ba2,0x6ba6,0x6c01,0x6c00,0x6bff, -0x6c02,0x6f41,0x6f26,0x6f7e,0x6f87,0x6fc6,0x6f92,0x6f8d, -0x6f89,0x6f8c,0x6f62,0x6f4f,0x6f85,0x6f5a,0x6f96,0x6f76, -0x6f6c,0x6f82,0x6f55,0x6f72,0x6f52,0x6f50,0x6f57,0x6f94, -0x6f93,0x6f5d,0x6f00,0x6f61,0x6f6b,0x6f7d,0x6f67,0x6f90, -0x6f53,0x6f8b,0x6f69,0x6f7f,0x6f95,0x6f63,0x6f77,0x6f6a, -0x6f7b,0x71b2,0x71af,0x719b,0x71b0,0x71a0,0x719a,0x71a9, -0x71b5,0x719d,0x71a5,0x719e,0x71a4,0x71a1,0x71aa,0x719c, -0x71a7,0x71b3,0x7298,0x729a,0x7358,0x7352,0x735e,0x735f, -0x7360,0x735d,0x735b,0x7361,0x735a,0x7359,0x7362,0x7487, -0x7489,0x748a,0x7486,0x7481,0x747d,0x7485,0x7488,0x747c, -0x7479,0x7508,0x7507,0x757e,0x7625,0x761e,0x7619,0x761d, -0x761c,0x7623,0x761a,0x7628,0x761b,0x769c,0x769d,0x769e, -0x769b,0x778d,0x778f,0x7789,0x7788,0x78cd,0x78bb,0x78cf, -0x78cc,0x78d1,0x78ce,0x78d4,0x78c8,0x78c3,0x78c4,0x78c9, -0x799a,0x79a1,0x79a0,0x799c,0x79a2,0x799b,0x6b76,0x7a39, -0x7ab2,0x7ab4,0x7ab3,0x7bb7,0x7bcb,0x7bbe,0x7bac,0x7bce, -0x7baf,0x7bb9,0x7bca,0x7bb5,0x7cc5,0x7cc8,0x7ccc,0x7ccb, -0x7df7,0x7ddb,0x7dea,0x7de7,0x7dd7,0x7de1,0x7e03,0x7dfa, -0x7de6,0x7df6,0x7df1,0x7df0,0x7dee,0x7ddf,0x7f76,0x7fac, -0x7fb0,0x7fad,0x7fed,0x7feb,0x7fea,0x7fec,0x7fe6,0x7fe8, -0x8064,0x8067,0x81a3,0x819f,0x819e,0x8195,0x81a2,0x8199, -0x8197,0x8216,0x824f,0x8253,0x8252,0x8250,0x824e,0x8251, -0x8524,0x853b,0x850f,0x8500,0x8529,0x850e,0x8509,0x850d, -0x851f,0x850a,0x8527,0x851c,0x84fb,0x852b,0x84fa,0x8508, -0x850c,0x84f4,0x852a,0x84f2,0x8515,0x84f7,0x84eb,0x84f3, -0x84fc,0x8512,0x84ea,0x84e9,0x8516,0x84fe,0x8528,0x851d, -0x852e,0x8502,0x84fd,0x851e,0x84f6,0x8531,0x8526,0x84e7, -0x84e8,0x84f0,0x84ef,0x84f9,0x8518,0x8520,0x8530,0x850b, -0x8519,0x852f,0x8662,0x8756,0x8763,0x8764,0x8777,0x87e1, -0x8773,0x8758,0x8754,0x875b,0x8752,0x8761,0x875a,0x8751, -0x875e,0x876d,0x876a,0x8750,0x874e,0x875f,0x875d,0x876f, -0x876c,0x877a,0x876e,0x875c,0x8765,0x874f,0x877b,0x8775, -0x8762,0x8767,0x8769,0x885a,0x8905,0x890c,0x8914,0x890b, -0x8917,0x8918,0x8919,0x8906,0x8916,0x8911,0x890e,0x8909, -0x89a2,0x89a4,0x89a3,0x89ed,0x89f0,0x89ec,0x8acf,0x8ac6, -0x8ab8,0x8ad3,0x8ad1,0x8ad4,0x8ad5,0x8abb,0x8ad7,0x8abe, -0x8ac0,0x8ac5,0x8ad8,0x8ac3,0x8aba,0x8abd,0x8ad9,0x8c3e, -0x8c4d,0x8c8f,0x8ce5,0x8cdf,0x8cd9,0x8ce8,0x8cda,0x8cdd, -0x8ce7,0x8da0,0x8d9c,0x8da1,0x8d9b,0x8e20,0x8e23,0x8e25, -0x8e24,0x8e2e,0x8e15,0x8e1b,0x8e16,0x8e11,0x8e19,0x8e26, -0x8e27,0x8e14,0x8e12,0x8e18,0x8e13,0x8e1c,0x8e17,0x8e1a, -0x8f2c,0x8f24,0x8f18,0x8f1a,0x8f20,0x8f23,0x8f16,0x8f17, -0x9073,0x9070,0x906f,0x9067,0x906b,0x912f,0x912b,0x9129, -0x912a,0x9132,0x9126,0x912e,0x9185,0x9186,0x918a,0x9181, -0x9182,0x9184,0x9180,0x92d0,0x92c3,0x92c4,0x92c0,0x92d9, -0x92b6,0x92cf,0x92f1,0x92df,0x92d8,0x92e9,0x92d7,0x92dd, -0x92cc,0x92ef,0x92c2,0x92e8,0x92ca,0x92c8,0x92ce,0x92e6, -0x92cd,0x92d5,0x92c9,0x92e0,0x92de,0x92e7,0x92d1,0x92d3, -0x92b5,0x92e1,0x9325,0x92c6,0x92b4,0x957c,0x95ac,0x95ab, -0x95ae,0x95b0,0x96a4,0x96a2,0x96d3,0x9705,0x9708,0x9702, -0x975a,0x978a,0x978e,0x9788,0x97d0,0x97cf,0x981e,0x981d, -0x9826,0x9829,0x9828,0x9820,0x981b,0x9827,0x98b2,0x9908, -0x98fa,0x9911,0x9914,0x9916,0x9917,0x9915,0x99dc,0x99cd, -0x99cf,0x99d3,0x99d4,0x99ce,0x99c9,0x99d6,0x99d8,0x99cb, -0x99d7,0x99cc,0x9ab3,0x9aec,0x9aeb,0x9af3,0x9af2,0x9af1, -0x9b46,0x9b43,0x9b67,0x9b74,0x9b71,0x9b66,0x9b76,0x9b75, -0x9b70,0x9b68,0x9b64,0x9b6c,0x9cfc,0x9cfa,0x9cfd,0x9cff, -0x9cf7,0x9d07,0x9d00,0x9cf9,0x9cfb,0x9d08,0x9d05,0x9d04, -0x9e83,0x9ed3,0x9f0f,0x9f10,0x511c,0x5113,0x5117,0x511a, -0x5111,0x51de,0x5334,0x53e1,0x5670,0x5660,0x566e,0x5673, -0x5666,0x5663,0x566d,0x5672,0x565e,0x5677,0x571c,0x571b, -0x58c8,0x58bd,0x58c9,0x58bf,0x58ba,0x58c2,0x58bc,0x58c6, -0x5b17,0x5b19,0x5b1b,0x5b21,0x5b14,0x5b13,0x5b10,0x5b16, -0x5b28,0x5b1a,0x5b20,0x5b1e,0x5bef,0x5dac,0x5db1,0x5da9, -0x5da7,0x5db5,0x5db0,0x5dae,0x5daa,0x5da8,0x5db2,0x5dad, -0x5daf,0x5db4,0x5e67,0x5e68,0x5e66,0x5e6f,0x5ee9,0x5ee7, -0x5ee6,0x5ee8,0x5ee5,0x5f4b,0x5fbc,0x5fbb,0x619d,0x61a8, -0x6196,0x61c5,0x61b4,0x61c6,0x61c1,0x61cc,0x61ba,0x61bf, -0x61b8,0x618c,0x64d7,0x64d6,0x64d0,0x64cf,0x64c9,0x64bd, -0x6489,0x64c3,0x64db,0x64f3,0x64d9,0x6533,0x657f,0x657c, -0x65a2,0x66c8,0x66be,0x66c0,0x66ca,0x66cb,0x66cf,0x66bd, -0x66bb,0x66ba,0x66cc,0x6723,0x6a34,0x6a66,0x6a49,0x6a67, -0x6a32,0x6a68,0x6a3e,0x6a5d,0x6a6d,0x6a76,0x6a5b,0x6a51, -0x6a28,0x6a5a,0x6a3b,0x6a3f,0x6a41,0x6a6a,0x6a64,0x6a50, -0x6a4f,0x6a54,0x6a6f,0x6a69,0x6a60,0x6a3c,0x6a5e,0x6a56, -0x6a55,0x6a4d,0x6a4e,0x6a46,0x6b55,0x6b54,0x6b56,0x6ba7, -0x6baa,0x6bab,0x6bc8,0x6bc7,0x6c04,0x6c03,0x6c06,0x6fad, -0x6fcb,0x6fa3,0x6fc7,0x6fbc,0x6fce,0x6fc8,0x6f5e,0x6fc4, -0x6fbd,0x6f9e,0x6fca,0x6fa8,0x7004,0x6fa5,0x6fae,0x6fba, -0x6fac,0x6faa,0x6fcf,0x6fbf,0x6fb8,0x6fa2,0x6fc9,0x6fab, -0x6fcd,0x6faf,0x6fb2,0x6fb0,0x71c5,0x71c2,0x71bf,0x71b8, -0x71d6,0x71c0,0x71c1,0x71cb,0x71d4,0x71ca,0x71c7,0x71cf, -0x71bd,0x71d8,0x71bc,0x71c6,0x71da,0x71db,0x729d,0x729e, -0x7369,0x7366,0x7367,0x736c,0x7365,0x736b,0x736a,0x747f, -0x749a,0x74a0,0x7494,0x7492,0x7495,0x74a1,0x750b,0x7580, -0x762f,0x762d,0x7631,0x763d,0x7633,0x763c,0x7635,0x7632, -0x7630,0x76bb,0x76e6,0x779a,0x779d,0x77a1,0x779c,0x779b, -0x77a2,0x77a3,0x7795,0x7799,0x7797,0x78dd,0x78e9,0x78e5, -0x78ea,0x78de,0x78e3,0x78db,0x78e1,0x78e2,0x78ed,0x78df, -0x78e0,0x79a4,0x7a44,0x7a48,0x7a47,0x7ab6,0x7ab8,0x7ab5, -0x7ab1,0x7ab7,0x7bde,0x7be3,0x7be7,0x7bdd,0x7bd5,0x7be5, -0x7bda,0x7be8,0x7bf9,0x7bd4,0x7bea,0x7be2,0x7bdc,0x7beb, -0x7bd8,0x7bdf,0x7cd2,0x7cd4,0x7cd7,0x7cd0,0x7cd1,0x7e12, -0x7e21,0x7e17,0x7e0c,0x7e1f,0x7e20,0x7e13,0x7e0e,0x7e1c, -0x7e15,0x7e1a,0x7e22,0x7e0b,0x7e0f,0x7e16,0x7e0d,0x7e14, -0x7e25,0x7e24,0x7f43,0x7f7b,0x7f7c,0x7f7a,0x7fb1,0x7fef, -0x802a,0x8029,0x806c,0x81b1,0x81a6,0x81ae,0x81b9,0x81b5, -0x81ab,0x81b0,0x81ac,0x81b4,0x81b2,0x81b7,0x81a7,0x81f2, -0x8255,0x8256,0x8257,0x8556,0x8545,0x856b,0x854d,0x8553, -0x8561,0x8558,0x8540,0x8546,0x8564,0x8541,0x8562,0x8544, -0x8551,0x8547,0x8563,0x853e,0x855b,0x8571,0x854e,0x856e, -0x8575,0x8555,0x8567,0x8560,0x858c,0x8566,0x855d,0x8554, -0x8565,0x856c,0x8663,0x8665,0x8664,0x87a4,0x879b,0x878f, -0x8797,0x8793,0x8792,0x8788,0x8781,0x8796,0x8798,0x8779, -0x8787,0x87a3,0x8785,0x8790,0x8791,0x879d,0x8784,0x8794, -0x879c,0x879a,0x8789,0x891e,0x8926,0x8930,0x892d,0x892e, -0x8927,0x8931,0x8922,0x8929,0x8923,0x892f,0x892c,0x891f, -0x89f1,0x8ae0,0x8ae2,0x8af2,0x8af4,0x8af5,0x8add,0x8b14, -0x8ae4,0x8adf,0x8af0,0x8ac8,0x8ade,0x8ae1,0x8ae8,0x8aff, -0x8aef,0x8afb,0x8c91,0x8c92,0x8c90,0x8cf5,0x8cee,0x8cf1, -0x8cf0,0x8cf3,0x8d6c,0x8d6e,0x8da5,0x8da7,0x8e33,0x8e3e, -0x8e38,0x8e40,0x8e45,0x8e36,0x8e3c,0x8e3d,0x8e41,0x8e30, -0x8e3f,0x8ebd,0x8f36,0x8f2e,0x8f35,0x8f32,0x8f39,0x8f37, -0x8f34,0x9076,0x9079,0x907b,0x9086,0x90fa,0x9133,0x9135, -0x9136,0x9193,0x9190,0x9191,0x918d,0x918f,0x9327,0x931e, -0x9308,0x931f,0x9306,0x930f,0x937a,0x9338,0x933c,0x931b, -0x9323,0x9312,0x9301,0x9346,0x932d,0x930e,0x930d,0x92cb, -0x931d,0x92fa,0x9313,0x92f9,0x92f7,0x9334,0x9302,0x9324, -0x92ff,0x9329,0x9339,0x9335,0x932a,0x9314,0x930c,0x930b, -0x92fe,0x9309,0x9300,0x92fb,0x9316,0x95bc,0x95cd,0x95be, -0x95b9,0x95ba,0x95b6,0x95bf,0x95b5,0x95bd,0x96a9,0x96d4, -0x970b,0x9712,0x9710,0x9799,0x9797,0x9794,0x97f0,0x97f8, -0x9835,0x982f,0x9832,0x9924,0x991f,0x9927,0x9929,0x999e, -0x99ee,0x99ec,0x99e5,0x99e4,0x99f0,0x99e3,0x99ea,0x99e9, -0x99e7,0x9ab9,0x9abf,0x9ab4,0x9abb,0x9af6,0x9afa,0x9af9, -0x9af7,0x9b33,0x9b80,0x9b85,0x9b87,0x9b7c,0x9b7e,0x9b7b, -0x9b82,0x9b93,0x9b92,0x9b90,0x9b7a,0x9b95,0x9b7d,0x9b88, -0x9d25,0x9d17,0x9d20,0x9d1e,0x9d14,0x9d29,0x9d1d,0x9d18, -0x9d22,0x9d10,0x9d19,0x9d1f,0x9e88,0x9e86,0x9e87,0x9eae, -0x9ead,0x9ed5,0x9ed6,0x9efa,0x9f12,0x9f3d,0x5126,0x5125, -0x5122,0x5124,0x5120,0x5129,0x52f4,0x5693,0x568c,0x568d, -0x5686,0x5684,0x5683,0x567e,0x5682,0x567f,0x5681,0x58d6, -0x58d4,0x58cf,0x58d2,0x5b2d,0x5b25,0x5b32,0x5b23,0x5b2c, -0x5b27,0x5b26,0x5b2f,0x5b2e,0x5b7b,0x5bf1,0x5bf2,0x5db7, -0x5e6c,0x5e6a,0x5fbe,0x61c3,0x61b5,0x61bc,0x61e7,0x61e0, -0x61e5,0x61e4,0x61e8,0x61de,0x64ef,0x64e9,0x64e3,0x64eb, -0x64e4,0x64e8,0x6581,0x6580,0x65b6,0x65da,0x66d2,0x6a8d, -0x6a96,0x6a81,0x6aa5,0x6a89,0x6a9f,0x6a9b,0x6aa1,0x6a9e, -0x6a87,0x6a93,0x6a8e,0x6a95,0x6a83,0x6aa8,0x6aa4,0x6a91, -0x6a7f,0x6aa6,0x6a9a,0x6a85,0x6a8c,0x6a92,0x6b5b,0x6bad, -0x6c09,0x6fcc,0x6fa9,0x6ff4,0x6fd4,0x6fe3,0x6fdc,0x6fed, -0x6fe7,0x6fe6,0x6fde,0x6ff2,0x6fdd,0x6fe2,0x6fe8,0x71e1, -0x71f1,0x71e8,0x71f2,0x71e4,0x71f0,0x71e2,0x7373,0x736e, -0x736f,0x7497,0x74b2,0x74ab,0x7490,0x74aa,0x74ad,0x74b1, -0x74a5,0x74af,0x7510,0x7511,0x7512,0x750f,0x7584,0x7643, -0x7648,0x7649,0x7647,0x76a4,0x76e9,0x77b5,0x77ab,0x77b2, -0x77b7,0x77b6,0x77b4,0x77b1,0x77a8,0x77f0,0x78f3,0x78fd, -0x7902,0x78fb,0x78fc,0x78ff,0x78f2,0x7905,0x78f9,0x78fe, -0x7904,0x79ab,0x79a8,0x7a5c,0x7a5b,0x7a56,0x7a58,0x7a54, -0x7a5a,0x7abe,0x7ac0,0x7ac1,0x7c05,0x7c0f,0x7bf2,0x7c00, -0x7bff,0x7bfb,0x7c0e,0x7bf4,0x7c0b,0x7bf3,0x7c02,0x7c09, -0x7c03,0x7c01,0x7bf8,0x7bfd,0x7c06,0x7bf0,0x7bf1,0x7c10, -0x7c0a,0x7ce8,0x7e2d,0x7e3c,0x7e42,0x7e33,0x9848,0x7e38, -0x7e2a,0x7e49,0x7e40,0x7e47,0x7e29,0x7e4c,0x7e30,0x7e3b, -0x7e36,0x7e44,0x7e3a,0x7f45,0x7f7f,0x7f7e,0x7f7d,0x7ff4, -0x7ff2,0x802c,0x81bb,0x81c4,0x81cc,0x81ca,0x81c5,0x81c7, -0x81bc,0x81e9,0x825b,0x825a,0x825c,0x8583,0x8580,0x858f, -0x85a7,0x8595,0x85a0,0x858b,0x85a3,0x857b,0x85a4,0x859a, -0x859e,0x8577,0x857c,0x8589,0x85a1,0x857a,0x8578,0x8557, -0x858e,0x8596,0x8586,0x858d,0x8599,0x859d,0x8581,0x85a2, -0x8582,0x8588,0x8585,0x8579,0x8576,0x8598,0x8590,0x859f, -0x8668,0x87be,0x87aa,0x87ad,0x87c5,0x87b0,0x87ac,0x87b9, -0x87b5,0x87bc,0x87ae,0x87c9,0x87c3,0x87c2,0x87cc,0x87b7, -0x87af,0x87c4,0x87ca,0x87b4,0x87b6,0x87bf,0x87b8,0x87bd, -0x87de,0x87b2,0x8935,0x8933,0x893c,0x893e,0x8941,0x8952, -0x8937,0x8942,0x89ad,0x89af,0x89ae,0x89f2,0x89f3,0x8b1e, -0x8b18,0x8b16,0x8b11,0x8b05,0x8b0b,0x8b22,0x8b0f,0x8b12, -0x8b15,0x8b07,0x8b0d,0x8b08,0x8b06,0x8b1c,0x8b13,0x8b1a, -0x8c4f,0x8c70,0x8c72,0x8c71,0x8c6f,0x8c95,0x8c94,0x8cf9, -0x8d6f,0x8e4e,0x8e4d,0x8e53,0x8e50,0x8e4c,0x8e47,0x8f43, -0x8f40,0x9085,0x907e,0x9138,0x919a,0x91a2,0x919b,0x9199, -0x919f,0x91a1,0x919d,0x91a0,0x93a1,0x9383,0x93af,0x9364, -0x9356,0x9347,0x937c,0x9358,0x935c,0x9376,0x9349,0x9350, -0x9351,0x9360,0x936d,0x938f,0x934c,0x936a,0x9379,0x9357, -0x9355,0x9352,0x934f,0x9371,0x9377,0x937b,0x9361,0x935e, -0x9363,0x9367,0x934e,0x9359,0x95c7,0x95c0,0x95c9,0x95c3, -0x95c5,0x95b7,0x96ae,0x96b0,0x96ac,0x9720,0x971f,0x9718, -0x971d,0x9719,0x979a,0x97a1,0x979c,0x979e,0x979d,0x97d5, -0x97d4,0x97f1,0x9841,0x9844,0x984a,0x9849,0x9845,0x9843, -0x9925,0x992b,0x992c,0x992a,0x9933,0x9932,0x992f,0x992d, -0x9931,0x9930,0x9998,0x99a3,0x99a1,0x9a02,0x99fa,0x99f4, -0x99f7,0x99f9,0x99f8,0x99f6,0x99fb,0x99fd,0x99fe,0x99fc, -0x9a03,0x9abe,0x9afe,0x9afd,0x9b01,0x9afc,0x9b48,0x9b9a, -0x9ba8,0x9b9e,0x9b9b,0x9ba6,0x9ba1,0x9ba5,0x9ba4,0x9b86, -0x9ba2,0x9ba0,0x9baf,0x9d33,0x9d41,0x9d67,0x9d36,0x9d2e, -0x9d2f,0x9d31,0x9d38,0x9d30,0x9d45,0x9d42,0x9d43,0x9d3e, -0x9d37,0x9d40,0x9d3d,0x7ff5,0x9d2d,0x9e8a,0x9e89,0x9e8d, -0x9eb0,0x9ec8,0x9eda,0x9efb,0x9eff,0x9f24,0x9f23,0x9f22, -0x9f54,0x9fa0,0x5131,0x512d,0x512e,0x5698,0x569c,0x5697, -0x569a,0x569d,0x5699,0x5970,0x5b3c,0x5c69,0x5c6a,0x5dc0, -0x5e6d,0x5e6e,0x61d8,0x61df,0x61ed,0x61ee,0x61f1,0x61ea, -0x61f0,0x61eb,0x61d6,0x61e9,0x64ff,0x6504,0x64fd,0x64f8, -0x6501,0x6503,0x64fc,0x6594,0x65db,0x66da,0x66db,0x66d8, -0x6ac5,0x6ab9,0x6abd,0x6ae1,0x6ac6,0x6aba,0x6ab6,0x6ab7, -0x6ac7,0x6ab4,0x6aad,0x6b5e,0x6bc9,0x6c0b,0x7007,0x700c, -0x700d,0x7001,0x7005,0x7014,0x700e,0x6fff,0x7000,0x6ffb, -0x7026,0x6ffc,0x6ff7,0x700a,0x7201,0x71ff,0x71f9,0x7203, -0x71fd,0x7376,0x74b8,0x74c0,0x74b5,0x74c1,0x74be,0x74b6, -0x74bb,0x74c2,0x7514,0x7513,0x765c,0x7664,0x7659,0x7650, -0x7653,0x7657,0x765a,0x76a6,0x76bd,0x76ec,0x77c2,0x77ba, -0x790c,0x7913,0x7914,0x7909,0x7910,0x7912,0x7911,0x79ad, -0x79ac,0x7a5f,0x7c1c,0x7c29,0x7c19,0x7c20,0x7c1f,0x7c2d, -0x7c1d,0x7c26,0x7c28,0x7c22,0x7c25,0x7c30,0x7e5c,0x7e50, -0x7e56,0x7e63,0x7e58,0x7e62,0x7e5f,0x7e51,0x7e60,0x7e57, -0x7e53,0x7fb5,0x7fb3,0x7ff7,0x7ff8,0x8075,0x81d1,0x81d2, -0x81d0,0x825f,0x825e,0x85b4,0x85c6,0x85c0,0x85c3,0x85c2, -0x85b3,0x85b5,0x85bd,0x85c7,0x85c4,0x85bf,0x85cb,0x85ce, -0x85c8,0x85c5,0x85b1,0x85b6,0x85d2,0x8624,0x85b8,0x85b7, -0x85be,0x8669,0x87e7,0x87e6,0x87e2,0x87db,0x87eb,0x87ea, -0x87e5,0x87df,0x87f3,0x87e4,0x87d4,0x87dc,0x87d3,0x87ed, -0x87d8,0x87e3,0x87d7,0x87d9,0x8801,0x87f4,0x87e8,0x87dd, -0x8953,0x894b,0x894f,0x894c,0x8946,0x8950,0x8951,0x8949, -0x8b2a,0x8b27,0x8b23,0x8b33,0x8b30,0x8b35,0x8b47,0x8b2f, -0x8b3c,0x8b3e,0x8b31,0x8b25,0x8b37,0x8b26,0x8b36,0x8b2e, -0x8b24,0x8b3b,0x8b3d,0x8b3a,0x8c42,0x8c75,0x8c99,0x8c98, -0x8c97,0x8cfe,0x8d04,0x8d02,0x8d00,0x8e5c,0x8e62,0x8e60, -0x8e57,0x8e56,0x8e5e,0x8e65,0x8e67,0x8e5b,0x8e5a,0x8e61, -0x8e5d,0x8e69,0x8e54,0x8f46,0x8f47,0x8f48,0x8f4b,0x9128, -0x913a,0x913b,0x913e,0x91a8,0x91a5,0x91a7,0x91af,0x91aa, -0x93b5,0x938c,0x9392,0x93b7,0x939b,0x939d,0x9389,0x93a7, -0x938e,0x93aa,0x939e,0x93a6,0x9395,0x9388,0x9399,0x939f, -0x9380,0x938d,0x93b1,0x9391,0x93b2,0x93a4,0x93a8,0x93b4, -0x93a3,0x95d2,0x95d3,0x95d1,0x96b3,0x96d7,0x96da,0x5dc2, -0x96df,0x96d8,0x96dd,0x9723,0x9722,0x9725,0x97ac,0x97ae, -0x97a8,0x97ab,0x97a4,0x97aa,0x97a2,0x97a5,0x97d7,0x97d9, -0x97d6,0x97d8,0x97fa,0x9850,0x9851,0x9852,0x98b8,0x9941, -0x993c,0x993a,0x9a0f,0x9a0b,0x9a09,0x9a0d,0x9a04,0x9a11, -0x9a0a,0x9a05,0x9a07,0x9a06,0x9ac0,0x9adc,0x9b08,0x9b04, -0x9b05,0x9b29,0x9b35,0x9b4a,0x9b4c,0x9b4b,0x9bc7,0x9bc6, -0x9bc3,0x9bbf,0x9bc1,0x9bb5,0x9bb8,0x9bd3,0x9bb6,0x9bc4, -0x9bb9,0x9bbd,0x9d5c,0x9d53,0x9d4f,0x9d4a,0x9d5b,0x9d4b, -0x9d59,0x9d56,0x9d4c,0x9d57,0x9d52,0x9d54,0x9d5f,0x9d58, -0x9d5a,0x9e8e,0x9e8c,0x9edf,0x9f01,0x9f00,0x9f16,0x9f25, -0x9f2b,0x9f2a,0x9f29,0x9f28,0x9f4c,0x9f55,0x5134,0x5135, -0x5296,0x52f7,0x53b4,0x56ab,0x56ad,0x56a6,0x56a7,0x56aa, -0x56ac,0x58da,0x58dd,0x58db,0x5912,0x5b3d,0x5b3e,0x5b3f, -0x5dc3,0x5e70,0x5fbf,0x61fb,0x6507,0x6510,0x650d,0x6509, -0x650c,0x650e,0x6584,0x65de,0x65dd,0x66de,0x6ae7,0x6ae0, -0x6acc,0x6ad1,0x6ad9,0x6acb,0x6adf,0x6adc,0x6ad0,0x6aeb, -0x6acf,0x6acd,0x6ade,0x6b60,0x6bb0,0x6c0c,0x7019,0x7027, -0x7020,0x7016,0x702b,0x7021,0x7022,0x7023,0x7029,0x7017, -0x7024,0x701c,0x720c,0x720a,0x7207,0x7202,0x7205,0x72a5, -0x72a6,0x72a4,0x72a3,0x72a1,0x74cb,0x74c5,0x74b7,0x74c3, -0x7516,0x7660,0x77c9,0x77ca,0x77c4,0x77f1,0x791d,0x791b, -0x7921,0x791c,0x7917,0x791e,0x79b0,0x7a67,0x7a68,0x7c33, -0x7c3c,0x7c39,0x7c2c,0x7c3b,0x7cec,0x7cea,0x7e76,0x7e75, -0x7e78,0x7e70,0x7e77,0x7e6f,0x7e7a,0x7e72,0x7e74,0x7e68, -0x7f4b,0x7f4a,0x7f83,0x7f86,0x7fb7,0x7ffd,0x7ffe,0x8078, -0x81d7,0x81d5,0x820b,0x8264,0x8261,0x8263,0x85eb,0x85f1, -0x85ed,0x85d9,0x85e1,0x85e8,0x85da,0x85d7,0x85ec,0x85f2, -0x85f8,0x85d8,0x85df,0x85e3,0x85dc,0x85d1,0x85f0,0x85e6, -0x85ef,0x85de,0x85e2,0x8800,0x87fa,0x8803,0x87f6,0x87f7, -0x8809,0x880c,0x880b,0x8806,0x87fc,0x8808,0x87ff,0x880a, -0x8802,0x8962,0x895a,0x895b,0x8957,0x8961,0x895c,0x8958, -0x895d,0x8959,0x8988,0x89b7,0x89b6,0x89f6,0x8b50,0x8b48, -0x8b4a,0x8b40,0x8b53,0x8b56,0x8b54,0x8b4b,0x8b55,0x8b51, -0x8b42,0x8b52,0x8b57,0x8c43,0x8c77,0x8c76,0x8c9a,0x8d06, -0x8d07,0x8d09,0x8dac,0x8daa,0x8dad,0x8dab,0x8e6d,0x8e78, -0x8e73,0x8e6a,0x8e6f,0x8e7b,0x8ec2,0x8f52,0x8f51,0x8f4f, -0x8f50,0x8f53,0x8fb4,0x9140,0x913f,0x91b0,0x91ad,0x93de, -0x93c7,0x93cf,0x93c2,0x93da,0x93d0,0x93f9,0x93ec,0x93cc, -0x93d9,0x93a9,0x93e6,0x93ca,0x93d4,0x93ee,0x93e3,0x93d5, -0x93c4,0x93ce,0x93c0,0x93d2,0x93a5,0x93e7,0x957d,0x95da, -0x95db,0x96e1,0x9729,0x972b,0x972c,0x9728,0x9726,0x97b3, -0x97b7,0x97b6,0x97dd,0x97de,0x97df,0x985c,0x9859,0x985d, -0x9857,0x98bf,0x98bd,0x98bb,0x98be,0x9948,0x9947,0x9943, -0x99a6,0x99a7,0x9a1a,0x9a15,0x9a25,0x9a1d,0x9a24,0x9a1b, -0x9a22,0x9a20,0x9a27,0x9a23,0x9a1e,0x9a1c,0x9a14,0x9ac2, -0x9b0b,0x9b0a,0x9b0e,0x9b0c,0x9b37,0x9bea,0x9beb,0x9be0, -0x9bde,0x9be4,0x9be6,0x9be2,0x9bf0,0x9bd4,0x9bd7,0x9bec, -0x9bdc,0x9bd9,0x9be5,0x9bd5,0x9be1,0x9bda,0x9d77,0x9d81, -0x9d8a,0x9d84,0x9d88,0x9d71,0x9d80,0x9d78,0x9d86,0x9d8b, -0x9d8c,0x9d7d,0x9d6b,0x9d74,0x9d75,0x9d70,0x9d69,0x9d85, -0x9d73,0x9d7b,0x9d82,0x9d6f,0x9d79,0x9d7f,0x9d87,0x9d68, -0x9e94,0x9e91,0x9ec0,0x9efc,0x9f2d,0x9f40,0x9f41,0x9f4d, -0x9f56,0x9f57,0x9f58,0x5337,0x56b2,0x56b5,0x56b3,0x58e3, -0x5b45,0x5dc6,0x5dc7,0x5eee,0x5eef,0x5fc0,0x5fc1,0x61f9, -0x6517,0x6516,0x6515,0x6513,0x65df,0x66e8,0x66e3,0x66e4, -0x6af3,0x6af0,0x6aea,0x6ae8,0x6af9,0x6af1,0x6aee,0x6aef, -0x703c,0x7035,0x702f,0x7037,0x7034,0x7031,0x7042,0x7038, -0x703f,0x703a,0x7039,0x702a,0x7040,0x703b,0x7033,0x7041, -0x7213,0x7214,0x72a8,0x737d,0x737c,0x74ba,0x76ab,0x76aa, -0x76be,0x76ed,0x77cc,0x77ce,0x77cf,0x77cd,0x77f2,0x7925, -0x7923,0x7927,0x7928,0x7924,0x7929,0x79b2,0x7a6e,0x7a6c, -0x7a6d,0x7af7,0x7c49,0x7c48,0x7c4a,0x7c47,0x7c45,0x7cee, -0x7e7b,0x7e7e,0x7e81,0x7e80,0x7fba,0x7fff,0x8079,0x81db, -0x81d9,0x8268,0x8269,0x8622,0x85ff,0x8601,0x85fe,0x861b, -0x8600,0x85f6,0x8604,0x8609,0x8605,0x860c,0x85fd,0x8819, -0x8810,0x8811,0x8817,0x8813,0x8816,0x8963,0x8966,0x89b9, -0x89f7,0x8b60,0x8b6a,0x8b5d,0x8b68,0x8b63,0x8b65,0x8b67, -0x8b6d,0x8dae,0x8e86,0x8e88,0x8e84,0x8f59,0x8f56,0x8f57, -0x8f55,0x8f58,0x8f5a,0x908d,0x9143,0x9141,0x91b7,0x91b5, -0x91b2,0x91b3,0x940b,0x9413,0x93fb,0x9420,0x940f,0x9414, -0x93fe,0x9415,0x9410,0x9428,0x9419,0x940d,0x93f5,0x9400, -0x93f7,0x9407,0x940e,0x9416,0x9412,0x93fa,0x9409,0x93f8, -0x943c,0x940a,0x93ff,0x93fc,0x940c,0x93f6,0x9411,0x9406, -0x95de,0x95e0,0x95df,0x972e,0x972f,0x97b9,0x97bb,0x97fd, -0x97fe,0x9860,0x9862,0x9863,0x985f,0x98c1,0x98c2,0x9950, -0x994e,0x9959,0x994c,0x994b,0x9953,0x9a32,0x9a34,0x9a31, -0x9a2c,0x9a2a,0x9a36,0x9a29,0x9a2e,0x9a38,0x9a2d,0x9ac7, -0x9aca,0x9ac6,0x9b10,0x9b12,0x9b11,0x9c0b,0x9c08,0x9bf7, -0x9c05,0x9c12,0x9bf8,0x9c40,0x9c07,0x9c0e,0x9c06,0x9c17, -0x9c14,0x9c09,0x9d9f,0x9d99,0x9da4,0x9d9d,0x9d92,0x9d98, -0x9d90,0x9d9b,0x9da0,0x9d94,0x9d9c,0x9daa,0x9d97,0x9da1, -0x9d9a,0x9da2,0x9da8,0x9d9e,0x9da3,0x9dbf,0x9da9,0x9d96, -0x9da6,0x9da7,0x9e99,0x9e9b,0x9e9a,0x9ee5,0x9ee4,0x9ee7, -0x9ee6,0x9f30,0x9f2e,0x9f5b,0x9f60,0x9f5e,0x9f5d,0x9f59, -0x9f91,0x513a,0x5139,0x5298,0x5297,0x56c3,0x56bd,0x56be, -0x5b48,0x5b47,0x5dcb,0x5dcf,0x5ef1,0x61fd,0x651b,0x6b02, -0x6afc,0x6b03,0x6af8,0x6b00,0x7043,0x7044,0x704a,0x7048, -0x7049,0x7045,0x7046,0x721d,0x721a,0x7219,0x737e,0x7517, -0x766a,0x77d0,0x792d,0x7931,0x792f,0x7c54,0x7c53,0x7cf2, -0x7e8a,0x7e87,0x7e88,0x7e8b,0x7e86,0x7e8d,0x7f4d,0x7fbb, -0x8030,0x81dd,0x8618,0x862a,0x8626,0x861f,0x8623,0x861c, -0x8619,0x8627,0x862e,0x8621,0x8620,0x8629,0x861e,0x8625, -0x8829,0x881d,0x881b,0x8820,0x8824,0x881c,0x882b,0x884a, -0x896d,0x8969,0x896e,0x896b,0x89fa,0x8b79,0x8b78,0x8b45, -0x8b7a,0x8b7b,0x8d10,0x8d14,0x8daf,0x8e8e,0x8e8c,0x8f5e, -0x8f5b,0x8f5d,0x9146,0x9144,0x9145,0x91b9,0x943f,0x943b, -0x9436,0x9429,0x943d,0x9430,0x9439,0x942a,0x9437,0x942c, -0x9440,0x9431,0x95e5,0x95e4,0x95e3,0x9735,0x973a,0x97bf, -0x97e1,0x9864,0x98c9,0x98c6,0x98c0,0x9958,0x9956,0x9a39, -0x9a3d,0x9a46,0x9a44,0x9a42,0x9a41,0x9a3a,0x9a3f,0x9acd, -0x9b15,0x9b17,0x9b18,0x9b16,0x9b3a,0x9b52,0x9c2b,0x9c1d, -0x9c1c,0x9c2c,0x9c23,0x9c28,0x9c29,0x9c24,0x9c21,0x9db7, -0x9db6,0x9dbc,0x9dc1,0x9dc7,0x9dca,0x9dcf,0x9dbe,0x9dc5, -0x9dc3,0x9dbb,0x9db5,0x9dce,0x9db9,0x9dba,0x9dac,0x9dc8, -0x9db1,0x9dad,0x9dcc,0x9db3,0x9dcd,0x9db2,0x9e7a,0x9e9c, -0x9eeb,0x9eee,0x9eed,0x9f1b,0x9f18,0x9f1a,0x9f31,0x9f4e, -0x9f65,0x9f64,0x9f92,0x4eb9,0x56c6,0x56c5,0x56cb,0x5971, -0x5b4b,0x5b4c,0x5dd5,0x5dd1,0x5ef2,0x6521,0x6520,0x6526, -0x6522,0x6b0b,0x6b08,0x6b09,0x6c0d,0x7055,0x7056,0x7057, -0x7052,0x721e,0x721f,0x72a9,0x737f,0x74d8,0x74d5,0x74d9, -0x74d7,0x766d,0x76ad,0x7935,0x79b4,0x7a70,0x7a71,0x7c57, -0x7c5c,0x7c59,0x7c5b,0x7c5a,0x7cf4,0x7cf1,0x7e91,0x7f4f, -0x7f87,0x81de,0x826b,0x8634,0x8635,0x8633,0x862c,0x8632, -0x8636,0x882c,0x8828,0x8826,0x882a,0x8825,0x8971,0x89bf, -0x89be,0x89fb,0x8b7e,0x8b84,0x8b82,0x8b86,0x8b85,0x8b7f, -0x8d15,0x8e95,0x8e94,0x8e9a,0x8e92,0x8e90,0x8e96,0x8e97, -0x8f60,0x8f62,0x9147,0x944c,0x9450,0x944a,0x944b,0x944f, -0x9447,0x9445,0x9448,0x9449,0x9446,0x973f,0x97e3,0x986a, -0x9869,0x98cb,0x9954,0x995b,0x9a4e,0x9a53,0x9a54,0x9a4c, -0x9a4f,0x9a48,0x9a4a,0x9a49,0x9a52,0x9a50,0x9ad0,0x9b19, -0x9b2b,0x9b3b,0x9b56,0x9b55,0x9c46,0x9c48,0x9c3f,0x9c44, -0x9c39,0x9c33,0x9c41,0x9c3c,0x9c37,0x9c34,0x9c32,0x9c3d, -0x9c36,0x9ddb,0x9dd2,0x9dde,0x9dda,0x9dcb,0x9dd0,0x9ddc, -0x9dd1,0x9ddf,0x9de9,0x9dd9,0x9dd8,0x9dd6,0x9df5,0x9dd5, -0x9ddd,0x9eb6,0x9ef0,0x9f35,0x9f33,0x9f32,0x9f42,0x9f6b, -0x9f95,0x9fa2,0x513d,0x5299,0x58e8,0x58e7,0x5972,0x5b4d, -0x5dd8,0x882f,0x5f4f,0x6201,0x6203,0x6204,0x6529,0x6525, -0x6596,0x66eb,0x6b11,0x6b12,0x6b0f,0x6bca,0x705b,0x705a, -0x7222,0x7382,0x7381,0x7383,0x7670,0x77d4,0x7c67,0x7c66, -0x7e95,0x826c,0x863a,0x8640,0x8639,0x863c,0x8631,0x863b, -0x863e,0x8830,0x8832,0x882e,0x8833,0x8976,0x8974,0x8973, -0x89fe,0x8b8c,0x8b8e,0x8b8b,0x8b88,0x8c45,0x8d19,0x8e98, -0x8f64,0x8f63,0x91bc,0x9462,0x9455,0x945d,0x9457,0x945e, -0x97c4,0x97c5,0x9800,0x9a56,0x9a59,0x9b1e,0x9b1f,0x9b20, -0x9c52,0x9c58,0x9c50,0x9c4a,0x9c4d,0x9c4b,0x9c55,0x9c59, -0x9c4c,0x9c4e,0x9dfb,0x9df7,0x9def,0x9de3,0x9deb,0x9df8, -0x9de4,0x9df6,0x9de1,0x9dee,0x9de6,0x9df2,0x9df0,0x9de2, -0x9dec,0x9df4,0x9df3,0x9de8,0x9ded,0x9ec2,0x9ed0,0x9ef2, -0x9ef3,0x9f06,0x9f1c,0x9f38,0x9f37,0x9f36,0x9f43,0x9f4f, -0x9f71,0x9f70,0x9f6e,0x9f6f,0x56d3,0x56cd,0x5b4e,0x5c6d, -0x652d,0x66ed,0x66ee,0x6b13,0x705f,0x7061,0x705d,0x7060, -0x7223,0x74db,0x74e5,0x77d5,0x7938,0x79b7,0x79b6,0x7c6a, -0x7e97,0x7f89,0x826d,0x8643,0x8838,0x8837,0x8835,0x884b, -0x8b94,0x8b95,0x8e9e,0x8e9f,0x8ea0,0x8e9d,0x91be,0x91bd, -0x91c2,0x946b,0x9468,0x9469,0x96e5,0x9746,0x9743,0x9747, -0x97c7,0x97e5,0x9a5e,0x9ad5,0x9b59,0x9c63,0x9c67,0x9c66, -0x9c62,0x9c5e,0x9c60,0x9e02,0x9dfe,0x9e07,0x9e03,0x9e06, -0x9e05,0x9e00,0x9e01,0x9e09,0x9dff,0x9dfd,0x9e04,0x9ea0, -0x9f1e,0x9f46,0x9f74,0x9f75,0x9f76,0x56d4,0x652e,0x65b8, -0x6b18,0x6b19,0x6b17,0x6b1a,0x7062,0x7226,0x72aa,0x77d8, -0x77d9,0x7939,0x7c69,0x7c6b,0x7cf6,0x7e9a,0x7e98,0x7e9b, -0x7e99,0x81e0,0x81e1,0x8646,0x8647,0x8648,0x8979,0x897a, -0x897c,0x897b,0x89ff,0x8b98,0x8b99,0x8ea5,0x8ea4,0x8ea3, -0x946e,0x946d,0x946f,0x9471,0x9473,0x9749,0x9872,0x995f, -0x9c68,0x9c6e,0x9c6d,0x9e0b,0x9e0d,0x9e10,0x9e0f,0x9e12, -0x9e11,0x9ea1,0x9ef5,0x9f09,0x9f47,0x9f78,0x9f7b,0x9f7a, -0x9f79,0x571e,0x7066,0x7c6f,0x883c,0x8db2,0x8ea6,0x91c3, -0x9474,0x9478,0x9476,0x9475,0x9a60,0x9b2e,0x9c74,0x9c73, -0x9c71,0x9c75,0x9e14,0x9e13,0x9ef6,0x9f0a,0x9fa4,0x7068, -0x7065,0x7cf7,0x866a,0x883e,0x883d,0x883f,0x8b9e,0x8c9c, -0x8ea9,0x8ec9,0x974b,0x9873,0x9874,0x98cc,0x9961,0x99ab, -0x9a64,0x9a66,0x9a67,0x9b24,0x9e15,0x9e17,0x9f48,0x6207, -0x6b1e,0x7227,0x864c,0x8ea8,0x9482,0x9480,0x9481,0x9a69, -0x9a68,0x9e19,0x864b,0x8b9f,0x9483,0x9c79,0x9eb7,0x7675, -0x9a6b,0x9c7a,0x9e1d,0x7069,0x706a,0x7229,0x9ea4,0x9f7e, -0x9f49,0x9f98}; - -static const int cns11643_2_ucs_table_size = (sizeof (cns11643_2_ucs_table) / sizeof (unsigned short)); - -static const unsigned short cns11643_14_ucs_table[] = { -0x4e28,0x4e36,0x4e3f,0x4e85,0x4e05,0x4e04,0x5182,0x5196, -0x5338,0x5369,0x53b6,0x4e2a,0x4e87,0x4e49,0x51e2,0x4e46, -0x4e8f,0x4ebc,0x4ebe,0x5166,0x51e3,0x5204,0x529c,0x0000, -0x5902,0x590a,0x5b80,0x5ddb,0x5e7a,0x5e7f,0x5ef4,0x5f50, -0x5f51,0x5f61,0x961d,0x0000,0x4e63,0x4e62,0x4ea3,0x5185, -0x4ec5,0x4ecf,0x4ece,0x4ecc,0x5184,0x5186,0x0000,0x0000, -0x51e4,0x5205,0x529e,0x529d,0x52fd,0x5300,0x533a,0x0000, -0x5346,0x535d,0x5386,0x53b7,0x0000,0x53cc,0x0000,0x53ce, -0x5721,0x0000,0x5e00,0x5f0c,0x6237,0x6238,0x6534,0x6535, -0x65e0,0x0000,0x738d,0x4e97,0x4ee0,0x0000,0x0000,0x4ee7, -0x0000,0x4ee6,0x0000,0x0000,0x0000,0x0000,0x56d8,0x518b, -0x518c,0x5199,0x51e5,0x0000,0x520b,0x0000,0x0000,0x5304, -0x5303,0x5307,0x0000,0x531e,0x535f,0x536d,0x5389,0x53ba, -0x53d0,0x0000,0x53f6,0x53f7,0x53f9,0x0000,0x53f4,0x0000, -0x0000,0x5724,0x5904,0x5918,0x5932,0x5930,0x5934,0x0000, -0x5975,0x0000,0x5b82,0x5bf9,0x5c14,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x5e81,0x5e83,0x5f0d,0x5f52, -0x0000,0x5fca,0x5fc7,0x6239,0x0000,0x624f,0x65e7,0x672f, -0x6b7a,0x6c39,0x0000,0x0000,0x6c37,0x6c44,0x6c45,0x738c, -0x7592,0x7676,0x9093,0x9092,0x0000,0x0000,0x4e21,0x4e20, -0x4e22,0x4e68,0x4e89,0x4e98,0x4ef9,0x4eef,0x0000,0x0000, -0x4ef8,0x4f06,0x4f03,0x4efc,0x4eee,0x4f16,0x0000,0x4f28, -0x4f1c,0x4f07,0x4f1a,0x4efa,0x4f17,0x514a,0x0000,0x5172, -0x0000,0x51b4,0x51b3,0x51b2,0x0000,0x51e8,0x0000,0x5214, -0x520f,0x5215,0x5218,0x52a8,0x0000,0x534b,0x534f,0x0000, -0x5350,0x0000,0x538b,0x0000,0x53be,0x0000,0x53d2,0x5416, -0x53ff,0x0000,0x5400,0x0000,0x5405,0x5413,0x5415,0x0000, -0x0000,0x56e3,0x5735,0x5736,0x5731,0x5732,0x58ee,0x5905, -0x4e54,0x0000,0x5936,0x0000,0x0000,0x0000,0x597a,0x0000, -0x5986,0x0000,0x0000,0x5b86,0x5f53,0x5c18,0x0000,0x5c3d, -0x5c78,0x0000,0x0000,0x0000,0x0000,0x5c80,0x0000,0x5e08, -0x0000,0x0000,0x0000,0x0000,0x5ef5,0x5f0e,0x0000,0x0000, -0x0000,0x5fd3,0x5fda,0x0000,0x5fdb,0x0000,0x620f,0x625d, -0x625f,0x6267,0x6257,0x9f50,0x0000,0x65eb,0x65ea,0x0000, -0x6737,0x0000,0x6732,0x6736,0x6b22,0x6bce,0x0000,0x6c58, -0x6c51,0x6c77,0x6c3c,0x0000,0x6c5a,0x0000,0x6c53,0x706f, -0x7072,0x706e,0x0000,0x0000,0x7073,0x72b1,0x72b2,0x0000, -0x738f,0x0000,0x0000,0x0000,0x793c,0x0000,0x808d,0x808e, -0x0000,0x827b,0x0000,0x8d71,0x8fb9,0x9096,0x909a,0x0000, -0x4e24,0x4e71,0x0000,0x4e9c,0x4f45,0x4f4a,0x4f39,0x4f37, -0x0000,0x4f32,0x4f42,0x0000,0x4f44,0x4f4b,0x0000,0x4f40, -0x4f35,0x4f31,0x5151,0x0000,0x5150,0x514e,0x0000,0x0000, -0x519d,0x0000,0x51b5,0x51b8,0x51ec,0x5223,0x5227,0x5226, -0x521f,0x522b,0x5220,0x52b4,0x52b3,0x0000,0x5325,0x533b, -0x5374,0x0000,0x0000,0x0000,0x0000,0x0000,0x544d,0x0000, -0x0000,0x543a,0x0000,0x0000,0x5444,0x544c,0x5423,0x541a, -0x5432,0x544b,0x5421,0x0000,0x5434,0x5449,0x5450,0x5422, -0x543f,0x5451,0x545a,0x542f,0x0000,0x56e9,0x56f2,0x56f3, -0x56ef,0x56ed,0x56ec,0x56e6,0x5748,0x0000,0x5744,0x573f, -0x573c,0x5753,0x5756,0x0000,0x575f,0x5743,0x5758,0x5757, -0x0000,0x0000,0x0000,0x5746,0x0000,0x573d,0x0000,0x5742, -0x5754,0x5755,0x58f1,0x58f2,0x58f0,0x590b,0x9ea6,0x56f1, -0x593d,0x0000,0x5994,0x598c,0x0000,0x599c,0x0000,0x0000, -0x599f,0x0000,0x599b,0x0000,0x5989,0x599a,0x0000,0x6588, -0x0000,0x5b8d,0x0000,0x5bfe,0x5bff,0x5bfd,0x5c2b,0x0000, -0x5c84,0x5c8e,0x5c9c,0x0000,0x0000,0x5c85,0x5df5,0x5e09, -0x0000,0x0000,0x5e0b,0x0000,0x5e92,0x5e90,0x5f03,0x0000, -0x5f1e,0x5f63,0x0000,0x5fe7,0x5ffe,0x5fe6,0x5fdc,0x5fce, -0x0000,0x5ffc,0x5fdf,0x5fec,0x5ff6,0x0000,0x5ff2,0x5ff0, -0x5ff9,0x0000,0x6213,0x0000,0x0000,0x623b,0x623c,0x6282, -0x0000,0x0000,0x0000,0x6278,0x628b,0x0000,0x629e,0x62a5, -0x629b,0x629c,0x6299,0x628d,0x6285,0x629d,0x6275,0x0000, -0x0000,0x0000,0x65f6,0x0000,0x0000,0x0000,0x66f5,0x675b, -0x0000,0x6754,0x6752,0x0000,0x6758,0x6744,0x674a,0x6761, -0x0000,0x6c7f,0x6c91,0x6c9e,0x0000,0x6c6e,0x6c7c,0x6c9f, -0x6c75,0x0000,0x6c56,0x6ca2,0x6c79,0x0000,0x6ca1,0x0000, -0x6caa,0x6ca0,0x0000,0x7079,0x7077,0x707e,0x0000,0x7075, -0x707b,0x7264,0x0000,0x72bb,0x72bc,0x72c7,0x72b9,0x72be, -0x72b6,0x0000,0x0000,0x7398,0x0000,0x0000,0x0000,0x0000, -0x7593,0x7680,0x0000,0x7683,0x76c0,0x76c1,0x0000,0x0000, -0x77f4,0x77f5,0x0000,0x7acc,0x7acd,0x7cfa,0x809f,0x8091, -0x8097,0x8094,0x0000,0x8286,0x828c,0x0000,0x8295,0x0000, -0x866c,0x0000,0x8fb5,0x8fbe,0x8fc7,0x0000,0x8fc1,0x90a9, -0x90a4,0x0000,0x0000,0x0000,0x90a8,0x9627,0x9626,0x962b, -0x9633,0x9634,0x9629,0x4e3d,0x0000,0x4e9d,0x4f93,0x4f8a, -0x0000,0x0000,0x4f6d,0x4f8e,0x4fa0,0x4fa2,0x4fa1,0x4f9f, -0x4fa3,0x0000,0x4f72,0x0000,0x4f8c,0x5156,0x0000,0x0000, -0x5190,0x0000,0x0000,0x0000,0x51ed,0x51fe,0x522f,0x0000, -0x523c,0x5234,0x5239,0x52b9,0x52b5,0x52bf,0x5355,0x0000, -0x5376,0x537a,0x5393,0x0000,0x53c1,0x53c2,0x53d5,0x5485, -0x0000,0x545f,0x5493,0x5489,0x5479,0x9efe,0x548f,0x5469, -0x546d,0x0000,0x5494,0x546a,0x548a,0x0000,0x56fd,0x56fb, -0x56f8,0x0000,0x56fc,0x56f6,0x5765,0x5781,0x5763,0x5767, -0x0000,0x576e,0x5778,0x577f,0x0000,0x0000,0x58f3,0x594b, -0x594c,0x0000,0x0000,0x0000,0x59ad,0x0000,0x59c4,0x0000, -0x59c2,0x59b0,0x0000,0x0000,0x0000,0x0000,0x59bf,0x0000, -0x59c9,0x59b8,0x59ac,0x0000,0x0000,0x0000,0x59b7,0x59d7, -0x0000,0x5b60,0x0000,0x5b96,0x5b9e,0x5b94,0x5b9f,0x5b9d, -0x0000,0x5c00,0x5c19,0x0000,0x0000,0x5c49,0x5c4a,0x0000, -0x5cbb,0x5cc1,0x0000,0x0000,0x0000,0x5cb9,0x5c9e,0x5cb4, -0x5cba,0x5df6,0x5e13,0x5e12,0x5e77,0x0000,0x5e98,0x0000, -0x5e99,0x5e9d,0x5ef8,0x0000,0x5ef9,0x0000,0x5f06,0x5f21, -0x0000,0x5f25,0x5f55,0x0000,0x0000,0x0000,0x5f84,0x5f83, -0x6030,0x6007,0x0000,0x6036,0x0000,0x0000,0x0000,0x5fe9, -0x603d,0x6008,0x0000,0x0000,0x62ba,0x62b2,0x0000,0x62b7, -0x62e4,0x62a7,0x0000,0x0000,0x0000,0x62d5,0x62e1,0x62dd, -0x62a6,0x62c1,0x62c5,0x62c0,0x62df,0x62e0,0x62de,0x0000, -0x6589,0x0000,0x65a6,0x65ba,0x0000,0x65ff,0x0000,0x6617, -0x6618,0x6601,0x65fe,0x0000,0x670c,0x0000,0x676b,0x6796, -0x6782,0x678a,0x0000,0x67a3,0x0000,0x67a2,0x678f,0x0000, -0x67f9,0x6780,0x6b26,0x6b27,0x6b68,0x6b69,0x0000,0x6b81, -0x6bb4,0x6bd1,0x0000,0x0000,0x6c1c,0x0000,0x0000,0x0000, -0x0000,0x0000,0x6c97,0x6c6c,0x6cdf,0x0000,0x6cea,0x0000, -0x6ce4,0x6cd8,0x6cb2,0x6cce,0x6cc8,0x0000,0x708b,0x7088, -0x7090,0x708f,0x0000,0x7087,0x7089,0x708d,0x7081,0x0000, -0x708c,0x0000,0x0000,0x7240,0x0000,0x0000,0x7265,0x7266, -0x7268,0x0000,0x0000,0x72cd,0x72d3,0x72db,0x0000,0x72cf, -0x73a7,0x73a3,0x739e,0x0000,0x73af,0x0000,0x0000,0x73aa, -0x739c,0x0000,0x7542,0x7544,0x753b,0x7541,0x0000,0x759b, -0x759e,0x0000,0x79c4,0x79c3,0x79c6,0x0000,0x0000,0x79c7, -0x0000,0x79ca,0x0000,0x0000,0x7acf,0x7c76,0x7c74,0x7cff, -0x7cfc,0x0000,0x0000,0x7f59,0x80a8,0x0000,0x0000,0x80b0, -0x0000,0x80b3,0x0000,0x80a4,0x80b6,0x80a7,0x80ac,0x0000, -0x80a6,0x5367,0x820e,0x82c4,0x833e,0x829c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x82aa,0x0000,0x82c9,0x0000,0x0000, -0x82a6,0x82b2,0x0000,0x0000,0x0000,0x8fcc,0x8fd9,0x8fca, -0x8fd8,0x8fcf,0x90b7,0x0000,0x90ad,0x90b9,0x9637,0x0000, -0x9641,0x963e,0x96b6,0x9751,0x9763,0x4e57,0x4e79,0x4eb2, -0x4eb0,0x4eaf,0x4eb1,0x4fd2,0x4fd5,0x0000,0x4fbe,0x4fb8, -0x4fb0,0x4fb1,0x4fc8,0x0000,0x0000,0x4fc6,0x4fcc,0x4fe5, -0x4fe3,0x4fb4,0x516a,0x0000,0x519f,0x0000,0x51c1,0x0000, -0x51c2,0x51c3,0x5245,0x5248,0x0000,0x0000,0x524f,0x0000, -0x0000,0x52c5,0x52ca,0x52c4,0x5327,0x5358,0x537d,0x0000, -0x53dd,0x53dc,0x53da,0x53d9,0x54b9,0x0000,0x54d0,0x54b4, -0x54ca,0x0000,0x54a3,0x54da,0x54a4,0x0000,0x54b2,0x549e, -0x549f,0x54b5,0x0000,0x0000,0x54cd,0x0000,0x54cc,0x0000, -0x5700,0x57ac,0x5791,0x578e,0x578d,0x5792,0x57a1,0x5790, -0x57a6,0x57a8,0x0000,0x579c,0x5796,0x57a7,0x0000,0x0000, -0x0000,0x0000,0x58f5,0x0000,0x5909,0x5908,0x0000,0x5952, -0x0000,0x0000,0x59df,0x0000,0x59eb,0x59ef,0x59f0,0x59d5, -0x5a0d,0x5a04,0x59f9,0x5a02,0x59f8,0x59e2,0x59d9,0x59e7, -0x5b6a,0x0000,0x0000,0x5bab,0x0000,0x5c1b,0x5c2f,0x0000, -0x663c,0x0000,0x0000,0x0000,0x5cd1,0x5cdc,0x5ce6,0x5ce1, -0x5ccd,0x0000,0x5ce2,0x5cdd,0x5ce5,0x5dfb,0x5dfa,0x5e1e, -0x0000,0x5ea1,0x0000,0x0000,0x5efc,0x5efb,0x5f2f,0x0000, -0x0000,0x5f66,0x0000,0x0000,0x0000,0x605c,0x0000,0x604e, -0x6051,0x0000,0x0000,0x6023,0x6031,0x607c,0x6052,0x0000, -0x6060,0x604a,0x6061,0x0000,0x6218,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x631f,0x6317,0x62ea,0x6321, -0x6304,0x6305,0x0000,0x6531,0x6544,0x6540,0x0000,0x6542, -0x65be,0x0000,0x6629,0x661b,0x0000,0x6623,0x662c,0x661a, -0x6630,0x663b,0x661e,0x6637,0x6638,0x0000,0x670e,0x0000, -0x0000,0x67e8,0x67d6,0x0000,0x67c7,0x67bc,0x6852,0x67bf, -0x67d5,0x67fe,0x8363,0x67fb,0x0000,0x67b1,0x6801,0x6805, -0x6800,0x67d7,0x0000,0x6b2a,0x6b6b,0x0000,0x0000,0x0000, -0x0000,0x6be1,0x0000,0x0000,0x6d23,0x6cff,0x6d14,0x6d05, -0x6d13,0x6d06,0x6d21,0x0000,0x6d15,0x6caf,0x6cf4,0x6d02, -0x6d45,0x0000,0x6d26,0x0000,0x6d44,0x0000,0x6d24,0x70a5, -0x0000,0x70a3,0x0000,0x70a2,0x70bb,0x70a0,0x70aa,0x0000, -0x0000,0x70a8,0x70b6,0x70b2,0x70a7,0x0000,0x0000,0x70b9, -0x722e,0x0000,0x723c,0x0000,0x726d,0x0000,0x0000,0x72e7, -0x72ed,0x0000,0x72ec,0x72e5,0x72e2,0x0000,0x73c4,0x73bd, -0x73cf,0x73c9,0x73c1,0x73d0,0x0000,0x73ce,0x74ed,0x74eb, -0x0000,0x74ef,0x7549,0x7550,0x7546,0x754a,0x0000,0x754d, -0x75a6,0x0000,0x0000,0x0000,0x75a8,0x0000,0x0000,0x76c7, -0x76ff,0x0000,0x76fd,0x77e6,0x780a,0x0000,0x7804,0x780b, -0x7807,0x0000,0x7815,0x7808,0x0000,0x79d3,0x79d4,0x79d0, -0x79d7,0x7a7c,0x0000,0x0000,0x7a7d,0x7a83,0x7a82,0x0000, -0x7ad4,0x7ad5,0x7ad3,0x7ad0,0x7ad2,0x7afe,0x7afc,0x7c77, -0x7c7c,0x7c7b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x7f8f,0x80d3,0x0000,0x80cb,0x80d2,0x0000, -0x8109,0x80e2,0x80df,0x80c6,0x0000,0x8224,0x82f7,0x82d8, -0x82dd,0x0000,0x0000,0x82f8,0x82fc,0x0000,0x0000,0x82e9, -0x0000,0x82ee,0x0000,0x82d0,0x830e,0x82e2,0x830b,0x82fd, -0x5179,0x8676,0x0000,0x8678,0x0000,0x0000,0x8675,0x867d, -0x0000,0x8842,0x8866,0x0000,0x898c,0x8a05,0x0000,0x8a06, -0x0000,0x8c9f,0x0000,0x8ff1,0x8fe7,0x8fe9,0x8fef,0x90c2, -0x90bc,0x0000,0x90c6,0x90c0,0x0000,0x0000,0x90cd,0x90c9, -0x0000,0x90c4,0x0000,0x9581,0x0000,0x9cec,0x5032,0x4ff9, -0x501d,0x4fff,0x5004,0x4ff0,0x5003,0x0000,0x5002,0x4ffc, -0x4ff2,0x5024,0x5008,0x5036,0x502e,0x0000,0x5010,0x5038, -0x5039,0x4ffd,0x5056,0x4ffb,0x51a3,0x51a6,0x51a1,0x0000, -0x0000,0x51c7,0x51c9,0x5260,0x5264,0x5259,0x5265,0x5267, -0x5257,0x5263,0x0000,0x5253,0x0000,0x52cf,0x0000,0x52ce, -0x52d0,0x52d1,0x52cc,0x0000,0x0000,0x0000,0x550d,0x54f4, -0x0000,0x5513,0x54ef,0x54f5,0x54f9,0x5502,0x5500,0x0000, -0x0000,0x5518,0x54f0,0x54f6,0x0000,0x0000,0x5519,0x0000, -0x5705,0x57c9,0x0000,0x57b7,0x57cd,0x0000,0x0000,0x0000, -0x57be,0x57bb,0x0000,0x57db,0x57c8,0x57c4,0x57c5,0x57d1, -0x57ca,0x57c0,0x0000,0x0000,0x5a21,0x5a2a,0x0000,0x5a1d, -0x0000,0x5a0b,0x0000,0x0000,0x0000,0x0000,0x5a22,0x0000, -0x0000,0x5a24,0x0000,0x5a14,0x5a31,0x0000,0x5a2f,0x5a1a, -0x5a12,0x0000,0x0000,0x5a26,0x0000,0x0000,0x5bbc,0x5bbb, -0x5bb7,0x5c05,0x5c06,0x5c52,0x5c53,0x0000,0x0000,0x5cfa, -0x5ceb,0x0000,0x5cf3,0x5cf5,0x5ce9,0x5cef,0x0000,0x5e2a, -0x5e30,0x5e2e,0x5e2c,0x5e2f,0x5eaf,0x5ea9,0x0000,0x5efd, -0x5f32,0x5f8e,0x5f93,0x5f8f,0x604f,0x6099,0x0000,0x607e, -0x0000,0x6074,0x604b,0x6073,0x6075,0x0000,0x0000,0x6056, -0x60a9,0x608b,0x60a6,0x0000,0x6093,0x60ae,0x609e,0x60a7, -0x6245,0x0000,0x0000,0x632e,0x0000,0x6352,0x6330,0x635b, -0x0000,0x6319,0x631b,0x0000,0x6331,0x635d,0x6337,0x6335, -0x6353,0x0000,0x635c,0x633f,0x654b,0x0000,0x0000,0x658b, -0x0000,0x659a,0x6650,0x6646,0x664e,0x6640,0x0000,0x664b, -0x6648,0x0000,0x6660,0x6644,0x664d,0x0000,0x6837,0x6824, -0x0000,0x0000,0x681b,0x6836,0x0000,0x682c,0x6819,0x6856, -0x6847,0x683e,0x681e,0x0000,0x6815,0x6822,0x6827,0x6859, -0x6858,0x6855,0x6830,0x6823,0x6b2e,0x6b2b,0x6b30,0x6b6c, -0x0000,0x6b8b,0x0000,0x6be9,0x6bea,0x6be5,0x6d6b,0x0000, -0x0000,0x6d73,0x6d57,0x0000,0x0000,0x6d5d,0x6d56,0x6d8f, -0x6d5b,0x6d1c,0x6d9a,0x6d9b,0x6d99,0x0000,0x6d81,0x6d71, -0x0000,0x0000,0x6d72,0x6d5c,0x6d96,0x70c4,0x70db,0x70cc, -0x70d0,0x70e3,0x70df,0x0000,0x70d6,0x70ee,0x70d5,0x0000, -0x0000,0x0000,0x0000,0x727a,0x0000,0x72f5,0x7302,0x0000, -0x0000,0x73e2,0x73ec,0x73d5,0x73f9,0x73df,0x73e6,0x0000, -0x0000,0x0000,0x0000,0x73e4,0x73e1,0x74f3,0x0000,0x0000, -0x0000,0x0000,0x7556,0x7555,0x7558,0x7557,0x755e,0x75c3, -0x0000,0x0000,0x75b4,0x0000,0x75b1,0x0000,0x0000,0x76cb, -0x76cc,0x772a,0x0000,0x7716,0x770f,0x0000,0x0000,0x773f, -0x772b,0x770e,0x7724,0x0000,0x7721,0x7718,0x77dd,0x0000, -0x0000,0x7824,0x7836,0x0000,0x7958,0x7959,0x0000,0x7962, -0x79da,0x79d9,0x0000,0x79e1,0x79e5,0x79e8,0x79db,0x0000, -0x79e2,0x79f0,0x0000,0x0000,0x0000,0x0000,0x7ada,0x7add, -0x0000,0x7adb,0x7adc,0x0000,0x0000,0x7b0d,0x7b0b,0x7b14, -0x7c8e,0x7c86,0x0000,0x7c87,0x7c83,0x7c8b,0x0000,0x0000, -0x0000,0x0000,0x7d24,0x0000,0x0000,0x0000,0x7d25,0x7f62, -0x7f93,0x7f99,0x7f97,0x0000,0x0000,0x7fc4,0x7fc6,0x800a, -0x0000,0x0000,0x8040,0x803c,0x803b,0x80f6,0x80ff,0x80ee, -0x8104,0x8103,0x8107,0x0000,0x0000,0x80f7,0x0000,0x0000, -0x822d,0x0000,0x8227,0x8229,0x831f,0x8357,0x0000,0x0000, -0x0000,0x0000,0x8321,0x0000,0x0000,0x8318,0x8358,0x0000, -0x0000,0x0000,0x0000,0x0000,0x8684,0x869f,0x869b,0x8689, -0x86a6,0x8692,0x868f,0x86a0,0x884f,0x8878,0x887a,0x886e, -0x887b,0x8884,0x8873,0x0000,0x0000,0x8a0d,0x8a0b,0x8a19, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8ff9,0x9009, -0x9008,0x0000,0x90de,0x9151,0x0000,0x0000,0x91db,0x91df, -0x91de,0x91d6,0x91e0,0x9585,0x9660,0x9659,0x0000,0x9656, -0x0000,0x0000,0x96bd,0x0000,0x0000,0x5042,0x5059,0x0000, -0x5044,0x5066,0x5052,0x5054,0x5071,0x5050,0x507b,0x507c, -0x5058,0x0000,0x0000,0x5079,0x506c,0x5078,0x51a8,0x51d1, -0x51cf,0x5268,0x5276,0x52d4,0x0000,0x53a0,0x53c4,0x0000, -0x5558,0x554c,0x5568,0x0000,0x5549,0x0000,0x0000,0x555d, -0x5529,0x0000,0x5554,0x5553,0x0000,0x555a,0x0000,0x553a, -0x553f,0x552b,0x57ea,0x0000,0x57ef,0x0000,0x0000,0x57dd, -0x57fe,0x0000,0x57de,0x57e6,0x0000,0x57e8,0x57ff,0x5803, -0x58f7,0x68a6,0x591f,0x0000,0x595b,0x595d,0x595e,0x0000, -0x0000,0x5a2b,0x0000,0x5a3b,0x0000,0x0000,0x5a61,0x5a3a, -0x5a6e,0x5a4b,0x5a6b,0x0000,0x0000,0x5a45,0x5a4e,0x5a68, -0x5a3d,0x5a71,0x5a3f,0x5a6f,0x5a75,0x0000,0x5a73,0x5a2c, -0x5a59,0x5a54,0x5a4f,0x5a63,0x0000,0x0000,0x5bc8,0x0000, -0x5bc3,0x0000,0x5c5b,0x5c61,0x0000,0x5d21,0x5d0a,0x5d09, -0x0000,0x5d2c,0x5d08,0x0000,0x0000,0x5d2a,0x5d15,0x0000, -0x5d10,0x5d13,0x0000,0x5d2f,0x5d18,0x0000,0x5de3,0x5e39, -0x5e35,0x5e3a,0x5e32,0x0000,0x0000,0x0000,0x0000,0x5ebb, -0x5eba,0x5f34,0x5f39,0x0000,0x0000,0x0000,0x0000,0x6098, -0x0000,0x60d0,0x0000,0x0000,0x0000,0x60d7,0x60aa,0x0000, -0x60a1,0x60a4,0x0000,0x60ee,0x0000,0x60e7,0x0000,0x0000, -0x60de,0x0000,0x0000,0x637e,0x638b,0x0000,0x0000,0x6379, -0x6386,0x6393,0x0000,0x6373,0x636a,0x0000,0x636c,0x0000, -0x637f,0x0000,0x63b2,0x63ba,0x0000,0x0000,0x6366,0x6374, -0x0000,0x655a,0x0000,0x654e,0x654d,0x658d,0x658e,0x65ad, -0x0000,0x65c7,0x65ca,0x0000,0x65c9,0x0000,0x65e3,0x6657, -0x0000,0x6663,0x6667,0x671a,0x6719,0x6716,0x0000,0x0000, -0x689e,0x68b6,0x6898,0x6873,0x0000,0x689a,0x688e,0x68b7, -0x68db,0x68a5,0x686c,0x68c1,0x6884,0x0000,0x0000,0x6895, -0x687a,0x6899,0x0000,0x68b8,0x68b9,0x6870,0x0000,0x6b35, -0x0000,0x6b90,0x6bbb,0x6bed,0x0000,0x0000,0x0000,0x6dc1, -0x6dc3,0x6dce,0x0000,0x0000,0x6dad,0x6e04,0x0000,0x6db9, -0x0000,0x6de7,0x0000,0x6e08,0x6e06,0x0000,0x6e0a,0x6db0, -0x0000,0x6df8,0x6e0c,0x0000,0x6db1,0x0000,0x6e02,0x6e07, -0x6e09,0x6e01,0x6e17,0x6dff,0x6e12,0x0000,0x0000,0x7103, -0x7107,0x7101,0x70f5,0x70f1,0x7108,0x70f2,0x710f,0x0000, -0x70fe,0x0000,0x0000,0x0000,0x731a,0x7310,0x730e,0x7402, -0x73f3,0x0000,0x0000,0x73fb,0x0000,0x0000,0x0000,0x751b, -0x7523,0x7561,0x7568,0x0000,0x7567,0x75d3,0x0000,0x0000, -0x7690,0x0000,0x0000,0x76d5,0x76d7,0x76d6,0x7730,0x0000, -0x7726,0x0000,0x7740,0x0000,0x771e,0x0000,0x0000,0x0000, -0x7847,0x0000,0x784b,0x7851,0x784f,0x7842,0x7846,0x0000, -0x796e,0x796c,0x79f2,0x0000,0x79f1,0x79f5,0x79f3,0x79f9, -0x0000,0x0000,0x0000,0x7a9a,0x7a93,0x7a91,0x7ae1,0x0000, -0x0000,0x7b21,0x7b1c,0x7b16,0x7b17,0x7b36,0x7b1f,0x0000, -0x7c93,0x7c99,0x7c9a,0x7c9c,0x0000,0x7d49,0x0000,0x7d34, -0x7d37,0x0000,0x7d2d,0x0000,0x7d4c,0x0000,0x0000,0x7d48, -0x0000,0x0000,0x7f3b,0x0000,0x0000,0x0000,0x0000,0x8008, -0x801a,0x0000,0x801d,0x0000,0x8049,0x8045,0x8044,0x7c9b, -0x0000,0x0000,0x812a,0x812e,0x0000,0x0000,0x8131,0x0000, -0x811a,0x8134,0x8117,0x0000,0x0000,0x0000,0x831d,0x8371, -0x8384,0x8380,0x8372,0x83a1,0x0000,0x8379,0x8391,0x0000, -0x839f,0x83ad,0x0000,0x0000,0x8323,0x0000,0x8385,0x839c, -0x83b7,0x8658,0x865a,0x0000,0x8657,0x86b2,0x0000,0x86ae, -0x0000,0x0000,0x0000,0x8845,0x889c,0x8894,0x88a3,0x888f, -0x88a5,0x88a9,0x88a6,0x888a,0x88a0,0x8890,0x8992,0x8991, -0x8994,0x0000,0x8a26,0x8a32,0x8a28,0x0000,0x0000,0x8a1c, -0x0000,0x8a2b,0x8a20,0x0000,0x8a29,0x0000,0x0000,0x0000, -0x8a21,0x8c3a,0x0000,0x8c5b,0x8c58,0x8c7c,0x0000,0x8ca6, -0x8cae,0x8cad,0x8d65,0x0000,0x8d7e,0x0000,0x8d7c,0x8d7f, -0x8d7a,0x8dbd,0x0000,0x0000,0x8dc0,0x8dbb,0x8ead,0x8eaf, -0x8ed6,0x0000,0x0000,0x0000,0x0000,0x0000,0x8ed9,0x0000, -0x0000,0x9012,0x900e,0x9025,0x0000,0x9013,0x90ee,0x0000, -0x90ab,0x90f7,0x0000,0x9159,0x9154,0x91f2,0x91f0,0x91e5, -0x91f6,0x0000,0x0000,0x9587,0x0000,0x965a,0x0000,0x0000, -0x966e,0x0000,0x0000,0x0000,0x9679,0x0000,0x98e1,0x98e6, -0x0000,0x9ec4,0x9ed2,0x4e80,0x0000,0x4e81,0x508f,0x5097, -0x5088,0x5089,0x0000,0x0000,0x5081,0x5160,0x0000,0x0000, -0x5e42,0x51d3,0x0000,0x0000,0x51d2,0x51d6,0x5273,0x0000, -0x5270,0x0000,0x0000,0x0000,0x53a8,0x53a6,0x53c5,0x5597, -0x55de,0x0000,0x0000,0x5596,0x55b4,0x0000,0x5585,0x0000, -0x559b,0x55a0,0x0000,0x5559,0x0000,0x5586,0x0000,0x0000, -0x55af,0x557a,0x0000,0x0000,0x0000,0x559e,0x0000,0x55a9, -0x570f,0x570e,0x581a,0x0000,0x581f,0x0000,0x583c,0x5818, -0x583e,0x5826,0x0000,0x583a,0x0000,0x5822,0x0000,0x58fb, -0x5963,0x5964,0x0000,0x5aa8,0x5aa3,0x5a82,0x5a88,0x5aa1, -0x5a85,0x5a98,0x0000,0x5a99,0x0000,0x5a89,0x5a81,0x5a96, -0x5a80,0x0000,0x0000,0x5a91,0x0000,0x0000,0x0000,0x0000, -0x5acf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x5a87, -0x5aa0,0x0000,0x5a79,0x0000,0x5a86,0x5aab,0x5aaa,0x5aa4, -0x5a8d,0x5a7e,0x0000,0x5bd5,0x0000,0x0000,0x0000,0x5c1e, -0x5c5f,0x5c5e,0x5d44,0x5d3e,0x0000,0x5d48,0x5d1c,0x0000, -0x5d5b,0x5d4d,0x0000,0x0000,0x5d57,0x0000,0x5d53,0x5d4f, -0x0000,0x5d3b,0x5d46,0x0000,0x0000,0x5e46,0x5e47,0x0000, -0x5e48,0x5ec0,0x5ebd,0x5ebf,0x0000,0x5f11,0x0000,0x5f3e, -0x5f3b,0x0000,0x5f3a,0x0000,0x0000,0x0000,0x5fa7,0x0000, -0x60ea,0x0000,0x6107,0x6122,0x610c,0x0000,0x0000,0x60b3, -0x60d6,0x60d2,0x0000,0x60e3,0x60e5,0x60e9,0x0000,0x0000, -0x6111,0x60fd,0x0000,0x0000,0x611e,0x6120,0x6121,0x621e, -0x0000,0x63e2,0x63de,0x63e6,0x0000,0x0000,0x0000,0x0000, -0x63f8,0x0000,0x63fe,0x63c1,0x63bf,0x63f7,0x63d1,0x655f, -0x6560,0x6561,0x0000,0x0000,0x65d1,0x0000,0x0000,0x667d, -0x666b,0x667f,0x0000,0x0000,0x6673,0x6681,0x666d,0x6669, -0x0000,0x0000,0x671e,0x68ed,0x0000,0x0000,0x0000,0x0000, -0x6903,0x0000,0x68fe,0x68e5,0x691e,0x6902,0x0000,0x0000, -0x6909,0x68ca,0x6900,0x0000,0x6901,0x6918,0x68e2,0x68cf, -0x0000,0x692e,0x68c5,0x68ff,0x0000,0x691c,0x68c3,0x0000, -0x6b6f,0x0000,0x6b6e,0x0000,0x6bbe,0x0000,0x6bf4,0x6c2d, -0x0000,0x6db6,0x6e75,0x6e1e,0x0000,0x6e18,0x0000,0x6e48, -0x0000,0x6e4f,0x0000,0x6e42,0x6e6a,0x6e70,0x6dfe,0x0000, -0x0000,0x6e6d,0x0000,0x6e7b,0x6e7e,0x6e59,0x0000,0x6e57, -0x0000,0x6e80,0x6e50,0x0000,0x6e29,0x6e76,0x6e2a,0x6e4c, -0x712a,0x0000,0x7135,0x712c,0x7137,0x711d,0x0000,0x0000, -0x7138,0x0000,0x7134,0x712b,0x7133,0x7127,0x7124,0x0000, -0x712d,0x7232,0x7283,0x7282,0x7287,0x7306,0x7324,0x7338, -0x732a,0x732c,0x732b,0x0000,0x732f,0x7328,0x7417,0x0000, -0x0000,0x7419,0x7438,0x0000,0x741f,0x7414,0x743c,0x73f7, -0x741c,0x7415,0x7418,0x7439,0x74f9,0x7524,0x0000,0x0000, -0x0000,0x756e,0x756d,0x7571,0x758e,0x0000,0x75e5,0x0000, -0x0000,0x0000,0x0000,0x7694,0x76b3,0x0000,0x76d9,0x0000, -0x7748,0x7749,0x7743,0x0000,0x0000,0x7742,0x77df,0x0000, -0x7863,0x7876,0x0000,0x785f,0x7866,0x7966,0x7971,0x0000, -0x0000,0x7976,0x7984,0x7975,0x79ff,0x7a07,0x0000,0x7a0e, -0x7a09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7ae7, -0x7ae2,0x7b55,0x0000,0x0000,0x7b43,0x7b57,0x7b6c,0x7b42, -0x7b53,0x0000,0x7b41,0x0000,0x0000,0x7ca7,0x7ca0,0x7ca6, -0x7ca4,0x7d74,0x0000,0x7d59,0x0000,0x7d60,0x7d57,0x7d6c, -0x7d7e,0x7d64,0x0000,0x7d5a,0x7d5d,0x0000,0x0000,0x0000, -0x7d76,0x7d4d,0x7d75,0x0000,0x7fd3,0x7fd6,0x0000,0x0000, -0x8060,0x804e,0x8145,0x813b,0x0000,0x8148,0x8142,0x8149, -0x8140,0x8114,0x8141,0x0000,0x81ef,0x81f6,0x8203,0x0000, -0x83ed,0x0000,0x83da,0x8418,0x83d2,0x8408,0x0000,0x8400, -0x0000,0x0000,0x0000,0x8417,0x8346,0x8414,0x83d3,0x8405, -0x841f,0x8402,0x8416,0x83cd,0x83e6,0x0000,0x865d,0x86d5, -0x86e1,0x0000,0x0000,0x0000,0x0000,0x86ee,0x8847,0x8846, -0x0000,0x0000,0x88bb,0x0000,0x88bf,0x88b4,0x0000,0x88b5, -0x0000,0x899a,0x8a43,0x0000,0x0000,0x8a5a,0x0000,0x0000, -0x0000,0x8a35,0x8a38,0x8a42,0x8a49,0x8a5d,0x8a4b,0x8a3d, -0x0000,0x0000,0x0000,0x0000,0x8c60,0x8c5e,0x8c7f,0x8c7e, -0x8c83,0x0000,0x8cb1,0x8d87,0x0000,0x0000,0x8d88,0x8d83, -0x0000,0x0000,0x8d86,0x8d8b,0x8d82,0x8dca,0x8dd2,0x0000, -0x0000,0x8dd4,0x8dc9,0x8eb0,0x0000,0x0000,0x0000,0x8ef2, -0x8ee4,0x8ef3,0x8eea,0x0000,0x8efd,0x0000,0x8f9d,0x902b, -0x902a,0x0000,0x9028,0x9029,0x902c,0x0000,0x0000,0x903a, -0x9030,0x9037,0x903b,0x0000,0x910a,0x0000,0x0000,0x0000, -0x91fe,0x9220,0x0000,0x920b,0x0000,0x9218,0x9222,0x0000, -0x921b,0x9208,0x0000,0x920e,0x9213,0x0000,0x0000,0x9595, -0x0000,0x0000,0x0000,0x968c,0x967b,0x967f,0x9681,0x0000, -0x9682,0x0000,0x0000,0x0000,0x0000,0x0000,0x96ee,0x96ed, -0x0000,0x96ec,0x975f,0x976f,0x0000,0x976d,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x98f0,0x0000,0x0000,0x0000, -0x9aa9,0x0000,0x0000,0x9ae0,0x4eb7,0x0000,0x0000,0x50cc, -0x50bc,0x0000,0x50aa,0x50b9,0x0000,0x50ab,0x50c3,0x50cd, -0x517e,0x527e,0x5279,0x0000,0x0000,0x52e1,0x52e0,0x52e7, -0x5380,0x53ab,0x53aa,0x53a9,0x53e0,0x55ea,0x0000,0x55d7, -0x0000,0x0000,0x55c1,0x5715,0x0000,0x586c,0x0000,0x585c, -0x5850,0x5861,0x586a,0x5869,0x5856,0x5860,0x5866,0x585f, -0x5923,0x5966,0x5968,0x0000,0x0000,0x5ace,0x0000,0x5ac5, -0x5ac3,0x0000,0x0000,0x5ad0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x5b74,0x5b76,0x5bdc,0x5bd7,0x5bda,0x5bdb, -0x0000,0x5c20,0x5d6d,0x5d66,0x0000,0x5d64,0x5d6e,0x0000, -0x5d60,0x5f42,0x5f5a,0x5f6e,0x0000,0x0000,0x6130,0x613a, -0x612a,0x6143,0x6119,0x6131,0x0000,0x613d,0x0000,0x0000, -0x0000,0x6408,0x6432,0x6438,0x0000,0x6431,0x0000,0x6419, -0x0000,0x6411,0x0000,0x0000,0x6429,0x641d,0x0000,0x0000, -0x0000,0x643c,0x0000,0x6446,0x6447,0x0000,0x0000,0x643a, -0x6407,0x0000,0x656b,0x0000,0x6570,0x656d,0x0000,0x65e4, -0x6693,0x0000,0x0000,0x0000,0x0000,0x668f,0x0000,0x0000, -0x6692,0x0000,0x668e,0x0000,0x6946,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x6931,0x0000,0x0000,0x693e, -0x0000,0x697c,0x6943,0x0000,0x6973,0x0000,0x6955,0x0000, -0x0000,0x6985,0x694d,0x6950,0x6947,0x6967,0x6936,0x6964, -0x6961,0x0000,0x697d,0x6b44,0x6b40,0x6b71,0x6b73,0x6b9c, -0x0000,0x0000,0x0000,0x6bc1,0x0000,0x6bfa,0x6c31,0x6c32, -0x0000,0x0000,0x6eb8,0x6ea8,0x0000,0x6e91,0x6ebb,0x0000, -0x6e9a,0x0000,0x0000,0x6ea9,0x0000,0x0000,0x6eb5,0x6e6c, -0x6ee8,0x0000,0x6edd,0x6eda,0x6ee6,0x6eac,0x0000,0x0000, -0x0000,0x6ed9,0x6ee3,0x6ee9,0x6edb,0x0000,0x716f,0x0000, -0x0000,0x7148,0x0000,0x714a,0x716b,0x0000,0x714f,0x7157, -0x7174,0x0000,0x0000,0x0000,0x7145,0x7151,0x716d,0x0000, -0x7251,0x7250,0x724e,0x0000,0x7341,0x0000,0x732e,0x7346, -0x0000,0x7427,0x0000,0x7448,0x7453,0x743d,0x0000,0x745d, -0x7456,0x0000,0x741e,0x7447,0x7443,0x7458,0x7449,0x0000, -0x744c,0x7445,0x743e,0x0000,0x7501,0x751e,0x0000,0x0000, -0x757a,0x75ee,0x7602,0x7697,0x7698,0x0000,0x0000,0x0000, -0x775d,0x7764,0x7753,0x7758,0x7882,0x7890,0x788a,0x0000, -0x787a,0x787d,0x0000,0x788b,0x7878,0x0000,0x0000,0x788d, -0x7888,0x7892,0x7881,0x797e,0x7983,0x0000,0x0000,0x0000, -0x7980,0x0000,0x0000,0x0000,0x7a0f,0x0000,0x0000,0x7a1d, -0x0000,0x7aa1,0x7aa4,0x0000,0x7ae9,0x7aea,0x0000,0x7b62, -0x7b6b,0x0000,0x7b5e,0x0000,0x7b79,0x0000,0x0000,0x7b6f, -0x7b68,0x0000,0x0000,0x7cae,0x0000,0x0000,0x0000,0x7cb0, -0x0000,0x7d90,0x0000,0x7d8a,0x0000,0x7d8b,0x7d99,0x7d95, -0x0000,0x7d87,0x7d78,0x7d97,0x7d89,0x7d98,0x0000,0x0000, -0x0000,0x7fa3,0x0000,0x0000,0x0000,0x7fdd,0x8057,0x0000, -0x8163,0x816a,0x816c,0x0000,0x0000,0x0000,0x815d,0x8175, -0x0000,0x815f,0x0000,0x817d,0x816d,0x0000,0x0000,0x8241, -0x844f,0x8484,0x0000,0x847f,0x0000,0x8448,0x842a,0x847b, -0x8472,0x8464,0x842e,0x845c,0x8453,0x0000,0x8441,0x84c8, -0x0000,0x8462,0x8480,0x843e,0x8483,0x8471,0x0000,0x844a, -0x8455,0x8458,0x0000,0x0000,0x0000,0x86fc,0x86fd,0x8715, -0x0000,0x8716,0x86ff,0x0000,0x0000,0x0000,0x8858,0x88cf, -0x88e0,0x0000,0x0000,0x0000,0x0000,0x89e7,0x8a6a,0x8a80, -0x0000,0x8a6f,0x8a65,0x0000,0x8a78,0x8a7d,0x8a88,0x0000, -0x0000,0x8a64,0x8a7e,0x0000,0x8a67,0x8c63,0x8c88,0x0000, -0x8ccd,0x0000,0x8cc9,0x0000,0x8ded,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x8eb1,0x0000,0x0000,0x8f04, -0x8f9e,0x8fa0,0x9043,0x9046,0x9048,0x9045,0x9040,0x904c, -0x0000,0x0000,0x910c,0x9113,0x9115,0x0000,0x916b,0x9167, -0x925d,0x9255,0x9235,0x0000,0x9259,0x922f,0x923c,0x928f, -0x925c,0x926a,0x9262,0x925f,0x926b,0x926e,0x923b,0x9244, -0x9241,0x959a,0x0000,0x9599,0x0000,0x0000,0x0000,0x968f, -0x0000,0x9696,0x0000,0x0000,0x0000,0x96f4,0x96fc,0x0000, -0x9755,0x0000,0x9779,0x0000,0x0000,0x0000,0x97ee,0x97f5, -0x0000,0x980b,0x0000,0x98f3,0x0000,0x0000,0x98f7,0x98ff, -0x98f5,0x0000,0x98ec,0x98f1,0x0000,0x0000,0x999a,0x0000, -0x9ae2,0x9b3d,0x9b5d,0x9ce8,0x0000,0x9ceb,0x9cef,0x9cee, -0x9e81,0x9f14,0x50d0,0x50d9,0x50dc,0x50d8,0x0000,0x50e1, -0x50eb,0x0000,0x0000,0x50f4,0x50e2,0x50de,0x0000,0x0000, -0x0000,0x51f4,0x0000,0x0000,0x0000,0x52ed,0x52ea,0x0000, -0x5332,0x0000,0x53ae,0x53b0,0x0000,0x55fb,0x5603,0x560b, -0x0000,0x5607,0x0000,0x55f8,0x0000,0x5628,0x561e,0x0000, -0x5618,0x5611,0x5651,0x5605,0x5717,0x5892,0x0000,0x588c, -0x0000,0x5878,0x5884,0x5873,0x58ad,0x5897,0x5895,0x5877, -0x5872,0x5896,0x588d,0x5910,0x0000,0x596c,0x0000,0x5ae7, -0x0000,0x5ae4,0x0000,0x0000,0x5aef,0x5626,0x0000,0x0000, -0x5af0,0x5d7b,0x0000,0x5d83,0x0000,0x0000,0x5d8b,0x5d8c, -0x0000,0x5d78,0x5e52,0x0000,0x0000,0x5ed0,0x5ecf,0x0000, -0x5fb3,0x5fb4,0x0000,0x0000,0x0000,0x617b,0x0000,0x616f, -0x6181,0x613c,0x6142,0x6138,0x6133,0x0000,0x6160,0x6169, -0x617d,0x6186,0x622c,0x6228,0x0000,0x644c,0x0000,0x6457, -0x647c,0x0000,0x0000,0x6455,0x6462,0x6471,0x646a,0x6456, -0x643b,0x6481,0x0000,0x644f,0x647e,0x6464,0x0000,0x0000, -0x0000,0x0000,0x0000,0x6571,0x0000,0x0000,0x66a5,0x669a, -0x669c,0x0000,0x66a6,0x0000,0x66a4,0x698f,0x69c5,0x69c8, -0x6992,0x69b2,0x0000,0x0000,0x0000,0x69e3,0x69c0,0x69d6, -0x69d1,0x699f,0x69a2,0x69d2,0x0000,0x0000,0x0000,0x69e1, -0x69d5,0x699d,0x0000,0x0000,0x6998,0x0000,0x6b74,0x6ba1, -0x0000,0x6ef0,0x6ef3,0x0000,0x0000,0x6f1b,0x6f0c,0x6f1d, -0x6f34,0x6f28,0x6f17,0x0000,0x6f44,0x6f42,0x6f04,0x6f11, -0x6efa,0x6f4a,0x7191,0x718e,0x0000,0x718b,0x718d,0x717f, -0x718c,0x717e,0x717c,0x7183,0x0000,0x7188,0x0000,0x0000, -0x7294,0x0000,0x7355,0x7353,0x734f,0x7354,0x746c,0x7465, -0x7466,0x7461,0x746b,0x7468,0x7476,0x0000,0x7460,0x0000, -0x7474,0x7506,0x760e,0x0000,0x7607,0x0000,0x0000,0x76b9, -0x0000,0x76b7,0x76e2,0x0000,0x7774,0x7777,0x7776,0x7775, -0x0000,0x7778,0x7771,0x0000,0x777a,0x715b,0x777b,0x78a6, -0x78ae,0x78b8,0x0000,0x0000,0x0000,0x78b1,0x78af,0x0000, -0x7989,0x7987,0x0000,0x0000,0x7a29,0x0000,0x7a2a,0x0000, -0x7a2d,0x7a2c,0x0000,0x7a32,0x0000,0x7aec,0x7af0,0x7b81, -0x7b9e,0x7b83,0x0000,0x7b92,0x0000,0x7ba3,0x7b9f,0x7b93, -0x0000,0x7b86,0x7cb8,0x7cb7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x7dc8,0x7db6,0x0000,0x7dd1,0x0000,0x7da8,0x7dab, -0x0000,0x7db3,0x7dcd,0x0000,0x7dcf,0x7da4,0x0000,0x0000, -0x7f41,0x7f6f,0x7f71,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x8023,0x805b,0x0000,0x8061,0x805f,0x8181,0x0000, -0x0000,0x8184,0x8213,0x0000,0x824a,0x824c,0x0000,0x0000, -0x0000,0x84bd,0x8495,0x0000,0x8492,0x84c3,0x0000,0x8496, -0x84a5,0x84b5,0x84b3,0x84a3,0x84e4,0x84d8,0x84d5,0x0000, -0x84b7,0x84ad,0x84da,0x8493,0x8736,0x0000,0x0000,0x0000, -0x873d,0x872b,0x8747,0x8739,0x0000,0x8745,0x871d,0x0000, -0x88ff,0x88ea,0x0000,0x88f5,0x0000,0x8900,0x88ed,0x8903, -0x88e9,0x0000,0x0000,0x89ea,0x0000,0x8a9b,0x8a8e,0x8aa2, -0x0000,0x8a9c,0x8a94,0x8a90,0x8aa9,0x8aac,0x0000,0x8a9f, -0x0000,0x0000,0x8a9d,0x0000,0x8c67,0x0000,0x0000,0x8cd0, -0x8cd6,0x8cd4,0x8d98,0x8d9a,0x8d97,0x0000,0x0000,0x0000, -0x8e0b,0x8e08,0x8e01,0x8eb4,0x8eb3,0x0000,0x8fa1,0x8fa2, -0x0000,0x905a,0x0000,0x9061,0x905f,0x0000,0x0000,0x9125, -0x917b,0x9176,0x917c,0x0000,0x9289,0x92f6,0x92b1,0x92ad, -0x9292,0x9281,0x9284,0x0000,0x92ae,0x9290,0x929e,0x0000, -0x0000,0x0000,0x95a2,0x95a7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x96a0,0x969d,0x969f,0x96d0,0x0000,0x96d1,0x0000, -0x0000,0x9759,0x0000,0x9764,0x0000,0x0000,0x0000,0x9819, -0x0000,0x9814,0x9815,0x981a,0x0000,0x0000,0x0000,0x0000, -0x9906,0x0000,0x98f8,0x9901,0x0000,0x99be,0x99bc,0x99b7, -0x99b6,0x99c0,0x0000,0x99b8,0x0000,0x0000,0x0000,0x99c4, -0x0000,0x99bf,0x0000,0x9ada,0x9ae4,0x9ae9,0x9ae8,0x9aea, -0x9ae5,0x0000,0x9b26,0x0000,0x0000,0x9b40,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x9ebd,0x0000,0x0000, -0x0000,0x0000,0x510e,0x0000,0x50f7,0x0000,0x50fc,0x510d, -0x5101,0x51da,0x51d9,0x51db,0x5286,0x528e,0x52ee,0x5333, -0x53b1,0x0000,0x5647,0x562d,0x5654,0x0000,0x564b,0x5652, -0x5631,0x5644,0x5656,0x5650,0x562b,0x0000,0x564d,0x5637, -0x564f,0x58a2,0x58b7,0x0000,0x58b2,0x0000,0x58aa,0x58b5, -0x58b0,0x0000,0x58b4,0x58a4,0x58a7,0x0000,0x5926,0x5afe, -0x0000,0x5b04,0x0000,0x5afc,0x0000,0x5b06,0x5b0a,0x5afa, -0x5b0d,0x5b00,0x5b0e,0x0000,0x0000,0x0000,0x5d91,0x0000, -0x5d8f,0x5d90,0x5d98,0x5da4,0x5d9b,0x5da3,0x5d96,0x5de4, -0x5e5a,0x0000,0x0000,0x5e5e,0x0000,0x5fb8,0x6157,0x615c, -0x61a6,0x6195,0x6188,0x0000,0x61a3,0x618f,0x0000,0x6164, -0x0000,0x6159,0x6178,0x0000,0x6185,0x6187,0x619e,0x0000, -0x0000,0x6198,0x619c,0x0000,0x0000,0x622f,0x6480,0x649b, -0x648e,0x648d,0x6494,0x64c6,0x0000,0x64a8,0x6483,0x0000, -0x64b9,0x6486,0x64b4,0x64af,0x6491,0x0000,0x64aa,0x64a1, -0x64a7,0x66b6,0x66b3,0x0000,0x66bc,0x66ac,0x0000,0x66ad, -0x6a0e,0x0000,0x6a1c,0x6a1a,0x0000,0x0000,0x6a0b,0x0000, -0x69ef,0x6a0c,0x69f0,0x6a22,0x0000,0x69d8,0x0000,0x6a12, -0x69fa,0x0000,0x6a2a,0x0000,0x6a10,0x0000,0x0000,0x6a29, -0x69f9,0x69ea,0x6a2c,0x6a24,0x0000,0x69e9,0x6b52,0x6b4f, -0x6b53,0x0000,0x0000,0x6f10,0x6f65,0x6f75,0x0000,0x0000, -0x0000,0x0000,0x6fd0,0x0000,0x6f5c,0x6f3d,0x6f71,0x0000, -0x6f91,0x6f0b,0x6f79,0x6f81,0x6f8f,0x0000,0x6f59,0x6f74, -0x0000,0x71ae,0x0000,0x71a3,0x71ad,0x0000,0x0000,0x71ab, -0x71a6,0x71a2,0x0000,0x52f2,0x7257,0x7255,0x7299,0x734b, -0x747a,0x0000,0x0000,0x0000,0x748c,0x7484,0x0000,0x0000, -0x7482,0x7493,0x747b,0x0000,0x7509,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x778a,0x0000,0x7790,0x0000,0x78c6, -0x78d3,0x78c0,0x78d2,0x78c7,0x78c2,0x0000,0x799f,0x799d, -0x799e,0x0000,0x7a41,0x0000,0x7a38,0x7a3a,0x7a42,0x0000, -0x0000,0x7a3e,0x7ab0,0x7bae,0x7bb3,0x0000,0x0000,0x7bbf, -0x0000,0x0000,0x7bcd,0x0000,0x7bb2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x7cc4,0x7ccd,0x7cc2,0x7cc6, -0x7cc3,0x7cc9,0x7cc7,0x0000,0x7df8,0x0000,0x7ded,0x7de2, -0x0000,0x0000,0x0000,0x7ddc,0x7e02,0x7e01,0x0000,0x7dd6, -0x0000,0x7de4,0x7dfe,0x0000,0x7e00,0x7dfc,0x7dfd,0x0000, -0x7df5,0x7dff,0x0000,0x7deb,0x7de5,0x7f78,0x7fae,0x7fe7, -0x0000,0x8065,0x806a,0x8066,0x8068,0x806b,0x8194,0x81a1, -0x8192,0x8196,0x8193,0x0000,0x0000,0x8501,0x0000,0x84f8, -0x0000,0x84f5,0x0000,0x8504,0x0000,0x0000,0x0000,0x0000, -0x851b,0x8503,0x8533,0x8534,0x84ed,0x0000,0x0000,0x8535, -0x0000,0x8505,0x0000,0x0000,0x0000,0x0000,0x877d,0x0000, -0x0000,0x0000,0x8771,0x0000,0x885c,0x88e6,0x890f,0x891b, -0x0000,0x89a9,0x89a5,0x89ee,0x8ab1,0x0000,0x8acc,0x8ace, -0x0000,0x8ab7,0x0000,0x8ab5,0x8ae9,0x8ab4,0x0000,0x8ab3, -0x8ac1,0x8aaf,0x8aca,0x8ad0,0x0000,0x0000,0x0000,0x8c8e, -0x0000,0x0000,0x8ce9,0x8cdb,0x0000,0x8ceb,0x8da4,0x0000, -0x8da2,0x8d9d,0x0000,0x0000,0x0000,0x0000,0x8e2a,0x8e28, -0x0000,0x0000,0x8eb8,0x8eb6,0x8eb9,0x8eb7,0x8f22,0x8f2b, -0x8f27,0x8f19,0x8fa4,0x0000,0x8fb3,0x0000,0x9071,0x906a, -0x0000,0x0000,0x9188,0x918c,0x92bf,0x92b8,0x92be,0x92dc, -0x92e5,0x0000,0x0000,0x92d4,0x92d6,0x0000,0x92da,0x92ed, -0x92f3,0x92db,0x0000,0x92b9,0x92e2,0x92eb,0x95af,0x0000, -0x95b2,0x95b3,0x0000,0x0000,0x0000,0x96a3,0x96a5,0x0000, -0x0000,0x0000,0x0000,0x970a,0x0000,0x9787,0x9789,0x978c, -0x97ef,0x982a,0x9822,0x0000,0x981f,0x0000,0x9919,0x0000, -0x99ca,0x99da,0x0000,0x0000,0x0000,0x99de,0x99c8,0x99e0, -0x0000,0x9ab6,0x9ab5,0x0000,0x9af4,0x0000,0x9b6b,0x9b69, -0x9b72,0x9b63,0x0000,0x9d0d,0x0000,0x9d01,0x9d0c,0x0000, -0x9cf8,0x0000,0x0000,0x9cfe,0x9d02,0x9e84,0x0000,0x9eab, -0x9eaa,0x511d,0x5116,0x0000,0x512b,0x511e,0x511b,0x5290, -0x5294,0x5314,0x0000,0x0000,0x5667,0x0000,0x567b,0x0000, -0x565f,0x5661,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x58c3,0x58ca,0x58bb,0x58c0,0x58c4,0x5901,0x5b1f, -0x5b18,0x5b11,0x5b15,0x0000,0x5b12,0x5b1c,0x0000,0x5b22, -0x5b79,0x5da6,0x0000,0x5db3,0x5dab,0x5eea,0x0000,0x5f5b, -0x0000,0x0000,0x61b7,0x61ce,0x61b9,0x61bd,0x61cf,0x61c0, -0x6199,0x6197,0x0000,0x61bb,0x61d0,0x61c4,0x6231,0x0000, -0x64d3,0x64c0,0x0000,0x0000,0x0000,0x0000,0x64dc,0x64d1, -0x64c8,0x0000,0x64d5,0x66c3,0x0000,0x0000,0x66bf,0x66c5, -0x0000,0x66cd,0x66c1,0x6706,0x0000,0x6724,0x6a63,0x6a42, -0x6a52,0x0000,0x6a43,0x6a33,0x0000,0x6a6c,0x6a57,0x0000, -0x6a4c,0x6a6e,0x0000,0x0000,0x0000,0x0000,0x0000,0x6a37, -0x0000,0x6a71,0x6a4a,0x6a36,0x0000,0x6a53,0x0000,0x6a45, -0x6a70,0x0000,0x0000,0x6a5c,0x6b58,0x6b57,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x6fbb,0x0000,0x0000,0x6fbe, -0x0000,0x0000,0x0000,0x6fb5,0x6fd3,0x6f9f,0x0000,0x6fb7, -0x6ff5,0x71b7,0x0000,0x71bb,0x0000,0x71d1,0x0000,0x71ba, -0x0000,0x71b6,0x71cc,0x0000,0x0000,0x71d3,0x749b,0x0000, -0x0000,0x7496,0x74a2,0x749d,0x750a,0x750e,0x0000,0x7581, -0x762c,0x7637,0x7636,0x763b,0x0000,0x76a1,0x0000,0x0000, -0x7798,0x0000,0x7796,0x0000,0x0000,0x0000,0x78d6,0x78eb, -0x0000,0x78dc,0x0000,0x79a5,0x79a9,0x9834,0x7a53,0x7a45, -0x0000,0x7a4f,0x0000,0x7abd,0x7abb,0x7af1,0x0000,0x0000, -0x7bec,0x7bed,0x0000,0x0000,0x7cd3,0x0000,0x7ce1,0x0000, -0x7e19,0x0000,0x0000,0x0000,0x7e27,0x7e26,0x0000,0x0000, -0x806e,0x81af,0x0000,0x0000,0x81ad,0x0000,0x81aa,0x8218, -0x0000,0x0000,0x0000,0x0000,0x856f,0x854c,0x0000,0x8542, -0x0000,0x855c,0x8570,0x855f,0x0000,0x855a,0x854b,0x853f, -0x878a,0x0000,0x878b,0x87a1,0x878e,0x0000,0x0000,0x8799, -0x885e,0x885f,0x8924,0x89a7,0x8aea,0x8afd,0x8af9,0x8ae3, -0x8ae5,0x0000,0x0000,0x8aec,0x0000,0x0000,0x0000,0x0000, -0x8cf2,0x0000,0x8cef,0x0000,0x8da6,0x0000,0x0000,0x0000, -0x8e3b,0x8e43,0x0000,0x8e32,0x8f31,0x8f30,0x0000,0x8f2d, -0x8f3c,0x8fa7,0x8fa5,0x0000,0x0000,0x0000,0x9137,0x9195, -0x918e,0x0000,0x9196,0x0000,0x9345,0x930a,0x0000,0x0000, -0x92fd,0x9317,0x931c,0x9307,0x9331,0x9332,0x932c,0x9330, -0x9303,0x9305,0x0000,0x95c2,0x0000,0x95b8,0x0000,0x95c1, -0x0000,0x0000,0x0000,0x96ab,0x96b7,0x0000,0x0000,0x9715, -0x9714,0x0000,0x0000,0x970c,0x9717,0x0000,0x9793,0x0000, -0x97d2,0x0000,0x0000,0x9836,0x9831,0x9833,0x983c,0x982e, -0x983a,0x0000,0x983d,0x0000,0x98b5,0x9922,0x9923,0x9920, -0x991c,0x991d,0x0000,0x99a0,0x0000,0x99ef,0x99e8,0x99eb, -0x0000,0x0000,0x0000,0x99e1,0x99e6,0x0000,0x0000,0x9af8, -0x9af5,0x0000,0x0000,0x9b83,0x9b94,0x9b84,0x0000,0x9b8b, -0x9b8f,0x0000,0x9b8c,0x0000,0x9b89,0x0000,0x9b8e,0x0000, -0x0000,0x0000,0x9d24,0x9d0f,0x0000,0x9d13,0x9d0a,0x0000, -0x0000,0x0000,0x0000,0x9d2a,0x9d1a,0x0000,0x9d27,0x9d16, -0x9d21,0x0000,0x9e85,0x9eac,0x9ec6,0x9ec5,0x9ed7,0x9f53, -0x0000,0x5128,0x5127,0x51df,0x0000,0x5335,0x53b3,0x0000, -0x568a,0x567d,0x5689,0x0000,0x58cd,0x58d0,0x0000,0x5b2b, -0x5b33,0x5b29,0x5b35,0x5b31,0x5b37,0x5c36,0x5dbe,0x0000, -0x5db9,0x0000,0x5dbb,0x0000,0x61e2,0x61db,0x61dd,0x61dc, -0x61da,0x0000,0x61d9,0x0000,0x0000,0x64df,0x0000,0x0000, -0x64e1,0x0000,0x64ee,0x0000,0x65b5,0x66d4,0x66d5,0x0000, -0x66d0,0x66d1,0x66ce,0x66d7,0x0000,0x0000,0x6a7d,0x6a8a, -0x0000,0x6aa7,0x0000,0x6a99,0x6a82,0x6a88,0x0000,0x0000, -0x6a86,0x0000,0x6a98,0x6a9d,0x0000,0x0000,0x6a8f,0x0000, -0x6aaa,0x0000,0x6b5d,0x0000,0x6c0a,0x0000,0x6fd7,0x6fd6, -0x6fe5,0x0000,0x0000,0x0000,0x6fd9,0x6fda,0x6fea,0x0000, -0x6ff6,0x0000,0x0000,0x71e3,0x0000,0x71e9,0x0000,0x71eb, -0x71ef,0x71f3,0x71ea,0x0000,0x0000,0x0000,0x0000,0x0000, -0x7371,0x0000,0x74ae,0x0000,0x74b3,0x0000,0x74ac,0x0000, -0x0000,0x7583,0x7645,0x764e,0x7644,0x76a3,0x76a5,0x77a6, -0x77a4,0x0000,0x77a9,0x77af,0x0000,0x0000,0x0000,0x78f0, -0x78f8,0x78f1,0x0000,0x7a49,0x0000,0x0000,0x0000,0x7ac2, -0x7af2,0x7af3,0x7bfa,0x0000,0x7bf6,0x7bfc,0x7c18,0x7c08, -0x7c12,0x0000,0x0000,0x7cdb,0x7cda,0x0000,0x0000,0x0000, -0x7e2c,0x7e4d,0x0000,0x0000,0x7f46,0x7ff6,0x802b,0x8074, -0x81b8,0x81c8,0x0000,0x0000,0x0000,0x8592,0x8593,0x0000, -0x857f,0x85ab,0x8597,0x0000,0x0000,0x85ac,0x0000,0x0000, -0x0000,0x87ce,0x0000,0x87cd,0x0000,0x0000,0x87c1,0x87b1, -0x87c7,0x0000,0x8940,0x0000,0x893f,0x8939,0x0000,0x8943, -0x0000,0x0000,0x0000,0x89ab,0x0000,0x8b1f,0x8b09,0x8b0c, -0x0000,0x0000,0x8c40,0x0000,0x8c96,0x0000,0x8cf6,0x8cf7, -0x0000,0x8e46,0x8e4f,0x0000,0x0000,0x0000,0x8f3d,0x8f41, -0x9366,0x9378,0x935d,0x9369,0x9374,0x937d,0x936e,0x9372, -0x9373,0x9362,0x9348,0x9353,0x935f,0x9368,0x0000,0x937f, -0x936b,0x0000,0x95c4,0x0000,0x96af,0x96ad,0x96b2,0x0000, -0x0000,0x971a,0x971b,0x0000,0x0000,0x0000,0x0000,0x979b, -0x979f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x9840,0x0000,0x9847,0x0000,0x98b7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x99a2,0x0000,0x0000,0x9a00,0x99f3, -0x0000,0x0000,0x99f5,0x0000,0x0000,0x9abd,0x9b00,0x9b02, -0x0000,0x9b34,0x9b49,0x9b9f,0x0000,0x9ba3,0x9bcd,0x9b99, -0x9b9d,0x0000,0x0000,0x9d39,0x0000,0x9d44,0x0000,0x0000, -0x9d35,0x0000,0x0000,0x9eaf,0x0000,0x512f,0x0000,0x0000, -0x9f8e,0x0000,0x569f,0x569b,0x569e,0x5696,0x5694,0x56a0, -0x0000,0x5b3b,0x0000,0x0000,0x5b3a,0x5dc1,0x5f4d,0x5f5d, -0x61f3,0x0000,0x0000,0x0000,0x0000,0x64f6,0x64e5,0x64ea, -0x64e7,0x6505,0x0000,0x64f9,0x0000,0x0000,0x0000,0x6aab, -0x6aed,0x6ab2,0x6ab0,0x6ab5,0x6abe,0x6ac1,0x6ac8,0x0000, -0x6ac0,0x6abc,0x6ab1,0x6ac4,0x6abf,0x0000,0x0000,0x7008, -0x7003,0x6ffd,0x7010,0x7002,0x7013,0x0000,0x71fa,0x7200, -0x74b9,0x74bc,0x0000,0x765b,0x7651,0x764f,0x76eb,0x77b8, -0x0000,0x77b9,0x77c1,0x77c0,0x77be,0x790b,0x0000,0x7907, -0x790a,0x7908,0x0000,0x790d,0x7906,0x7915,0x79af,0x0000, -0x0000,0x0000,0x7af5,0x0000,0x0000,0x7c2e,0x0000,0x7c1b, -0x0000,0x7c1a,0x7c24,0x0000,0x0000,0x7ce6,0x7ce3,0x0000, -0x0000,0x7e5d,0x7e4f,0x7e66,0x7e5b,0x7f47,0x7fb4,0x0000, -0x0000,0x0000,0x7ffa,0x802e,0x0000,0x0000,0x81ce,0x0000, -0x0000,0x8219,0x0000,0x0000,0x85cc,0x85b2,0x0000,0x85bb, -0x85c1,0x0000,0x0000,0x0000,0x87e9,0x87ee,0x87f0,0x87d6, -0x880e,0x87da,0x8948,0x894a,0x894e,0x894d,0x89b1,0x89b0, -0x89b3,0x0000,0x8b38,0x8b32,0x0000,0x8b2d,0x0000,0x8b34, -0x0000,0x8b29,0x8c74,0x0000,0x0000,0x8d03,0x0000,0x0000, -0x8da9,0x8e58,0x0000,0x0000,0x8ebf,0x8ec1,0x8f4a,0x8fac, -0x0000,0x9089,0x913d,0x913c,0x91a9,0x93a0,0x0000,0x9390, -0x0000,0x9393,0x938b,0x93ad,0x93bb,0x93b8,0x0000,0x0000, -0x939c,0x95d8,0x95d7,0x0000,0x0000,0x0000,0x975d,0x97a9, -0x97da,0x0000,0x0000,0x0000,0x0000,0x9854,0x0000,0x9855, -0x984b,0x0000,0x983f,0x98b9,0x0000,0x0000,0x0000,0x0000, -0x9938,0x9936,0x9940,0x0000,0x993b,0x9939,0x99a4,0x0000, -0x0000,0x9a08,0x9a0c,0x0000,0x9a10,0x0000,0x9b07,0x0000, -0x9bd2,0x0000,0x9bc2,0x9bbb,0x9bcc,0x9bcb,0x0000,0x0000, -0x9d4d,0x9d63,0x9d4e,0x0000,0x9d50,0x9d55,0x0000,0x9d5e, -0x0000,0x9e90,0x9eb2,0x9eb1,0x0000,0x9eca,0x9f02,0x9f27, -0x9f26,0x0000,0x56af,0x58e0,0x58dc,0x0000,0x5b39,0x0000, -0x0000,0x5b7c,0x5bf3,0x0000,0x0000,0x5c6b,0x5dc4,0x650b, -0x6508,0x650a,0x0000,0x0000,0x65dc,0x0000,0x0000,0x66e1, -0x66df,0x6ace,0x6ad4,0x6ae3,0x6ad7,0x6ae2,0x0000,0x0000, -0x0000,0x0000,0x6ad8,0x6ad5,0x6ad2,0x0000,0x0000,0x701e, -0x702c,0x7025,0x6ff3,0x7204,0x7208,0x7215,0x0000,0x74c4, -0x74c9,0x74c7,0x74c8,0x76a9,0x77c6,0x77c5,0x7918,0x791a, -0x7920,0x0000,0x7a66,0x7a64,0x7a6a,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x7c35,0x7c34,0x0000,0x0000,0x7e6c, -0x0000,0x7e6e,0x7e71,0x0000,0x81d4,0x81d6,0x821a,0x8262, -0x8265,0x8276,0x85db,0x85d6,0x0000,0x85e7,0x0000,0x0000, -0x85f4,0x0000,0x87fd,0x87d5,0x8807,0x0000,0x880f,0x87f8, -0x0000,0x0000,0x8987,0x0000,0x89b5,0x89f5,0x0000,0x8b3f, -0x8b43,0x8b4c,0x0000,0x8d0b,0x8e6b,0x8e68,0x8e70,0x8e75, -0x8e77,0x0000,0x8ec3,0x0000,0x93e9,0x93ea,0x93cb,0x93c5, -0x93c6,0x0000,0x93ed,0x93d3,0x0000,0x93e5,0x0000,0x0000, -0x93db,0x93eb,0x93e0,0x93c1,0x0000,0x0000,0x95dd,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x97b2,0x97b4,0x97b1,0x97b5,0x97f2,0x0000,0x0000,0x0000, -0x9856,0x0000,0x0000,0x0000,0x9944,0x0000,0x9a26,0x9a1f, -0x9a18,0x9a21,0x9a17,0x0000,0x9b09,0x0000,0x0000,0x9bc5, -0x9bdf,0x0000,0x9be3,0x0000,0x9be9,0x9bee,0x0000,0x0000, -0x9d66,0x9d7a,0x0000,0x9d6e,0x9d91,0x9d83,0x9d76,0x9d7e, -0x9d6d,0x0000,0x9e95,0x9ee3,0x0000,0x0000,0x9f03,0x9f04, -0x0000,0x9f17,0x0000,0x5136,0x0000,0x5336,0x0000,0x5b42, -0x0000,0x0000,0x5b44,0x5b46,0x5b7e,0x5dca,0x5dc8,0x5dcc, -0x5ef0,0x0000,0x6585,0x66e5,0x66e7,0x0000,0x0000,0x0000, -0x6af4,0x0000,0x6ae9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x703d,0x0000,0x7036,0x0000,0x7216,0x0000,0x7212,0x720f, -0x7217,0x7211,0x720b,0x0000,0x0000,0x74cd,0x74d0,0x74cc, -0x74ce,0x74d1,0x0000,0x7589,0x0000,0x7a6f,0x7c4b,0x7c44, -0x0000,0x0000,0x0000,0x0000,0x0000,0x7e7f,0x8b71,0x0000, -0x802f,0x807a,0x807b,0x807c,0x0000,0x0000,0x0000,0x85fc, -0x8610,0x8602,0x0000,0x0000,0x85ee,0x8603,0x0000,0x860d, -0x8613,0x8608,0x860f,0x8818,0x8812,0x0000,0x0000,0x8967, -0x8965,0x89bb,0x8b69,0x8b62,0x0000,0x8b6e,0x0000,0x8b61, -0x0000,0x8b64,0x8b4d,0x8c51,0x0000,0x0000,0x8e83,0x8ec6, -0x0000,0x941f,0x0000,0x9404,0x9417,0x9408,0x9405,0x0000, -0x93f3,0x941e,0x9402,0x941a,0x941b,0x9427,0x941c,0x0000, -0x96b5,0x0000,0x0000,0x9733,0x0000,0x9734,0x9731,0x97b8, -0x97ba,0x0000,0x97fc,0x0000,0x0000,0x98c3,0x0000,0x994d, -0x0000,0x9a2f,0x0000,0x0000,0x0000,0x9ac9,0x0000,0x9ac8, -0x9ac4,0x9b2a,0x9b38,0x9b50,0x0000,0x9c0a,0x9bfb,0x9c04, -0x9bfc,0x9bfe,0x0000,0x0000,0x0000,0x9c02,0x9bf6,0x9c1b, -0x9bf9,0x9c15,0x9c10,0x9bff,0x9c00,0x9c0c,0x0000,0x0000, -0x9d95,0x9da5,0x0000,0x0000,0x0000,0x0000,0x9e98,0x9ec1, -0x0000,0x9f5a,0x5164,0x56bb,0x0000,0x58e6,0x5b49,0x5bf7, -0x0000,0x0000,0x5dd0,0x0000,0x5fc2,0x0000,0x6511,0x0000, -0x6aff,0x6afe,0x6afd,0x0000,0x6b01,0x0000,0x0000,0x704b, -0x704d,0x7047,0x74d3,0x7668,0x7667,0x0000,0x0000,0x77d1, -0x7930,0x7932,0x792e,0x0000,0x9f9d,0x7ac9,0x7ac8,0x0000, -0x7c56,0x7c51,0x0000,0x0000,0x0000,0x7e85,0x7e89,0x7e8e, -0x7e84,0x0000,0x826a,0x862b,0x862f,0x8628,0x0000,0x8616, -0x8615,0x861d,0x881a,0x0000,0x0000,0x0000,0x89bc,0x8b75, -0x8b7c,0x0000,0x8d11,0x8d12,0x8f5c,0x91bb,0x0000,0x93f4, -0x0000,0x0000,0x942d,0x0000,0x0000,0x96e4,0x9737,0x9736, -0x9767,0x97be,0x97bd,0x97e2,0x9868,0x9866,0x98c8,0x98ca, -0x98c7,0x98dc,0x0000,0x994f,0x99a9,0x9a3c,0x0000,0x9a3b, -0x9ace,0x0000,0x9b14,0x9b53,0x0000,0x9c2e,0x0000,0x9c1f, -0x0000,0x0000,0x0000,0x0000,0x9db0,0x9dbd,0x0000,0x0000, -0x9dae,0x9dc4,0x9e7b,0x0000,0x0000,0x9e9e,0x0000,0x9f05, -0x0000,0x9f69,0x9fa1,0x56c7,0x571d,0x5b4a,0x5dd3,0x0000, -0x5f72,0x6202,0x0000,0x6235,0x6527,0x651e,0x651f,0x0000, -0x0000,0x6b07,0x6b06,0x0000,0x0000,0x7054,0x721c,0x7220, -0x7af8,0x0000,0x7c5d,0x7c58,0x0000,0x7e92,0x7f4e,0x0000, -0x0000,0x0000,0x8827,0x0000,0x8b81,0x8b83,0x0000,0x8c44, -0x0000,0x0000,0x0000,0x0000,0x9442,0x944d,0x9454,0x944e, -0x0000,0x9443,0x0000,0x0000,0x973c,0x9740,0x97c0,0x0000, -0x0000,0x0000,0x0000,0x995a,0x9a51,0x0000,0x9add,0x0000, -0x0000,0x9c38,0x0000,0x9c45,0x9c3a,0x0000,0x9c35,0x0000, -0x0000,0x0000,0x9ef1,0x0000,0x9f93,0x529a,0x0000,0x0000, -0x8641,0x5dd7,0x0000,0x6528,0x0000,0x0000,0x0000,0x7053, -0x7059,0x0000,0x7221,0x0000,0x766f,0x7937,0x79b5,0x7c62, -0x7c5e,0x7cf5,0x0000,0x0000,0x863d,0x0000,0x882d,0x8989, -0x8b8d,0x8b87,0x8b90,0x8d1a,0x8e99,0x0000,0x0000,0x0000, -0x945f,0x0000,0x0000,0x9456,0x9461,0x945b,0x945a,0x945c, -0x9465,0x0000,0x9741,0x0000,0x0000,0x986e,0x986c,0x986d, -0x0000,0x99aa,0x9a5c,0x9a58,0x9ade,0x0000,0x9c4f,0x9c51, -0x0000,0x9c53,0x0000,0x0000,0x0000,0x9dfc,0x9f39,0x0000, -0x513e,0x0000,0x56d2,0x0000,0x5b4f,0x6b14,0x0000,0x7a72, -0x7a73,0x0000,0x0000,0x0000,0x8b91,0x0000,0x0000,0x91bf, -0x0000,0x946c,0x0000,0x0000,0x96e6,0x9745,0x0000,0x97c8, -0x97e4,0x995d,0x0000,0x9b21,0x0000,0x9b2c,0x9b57,0x0000, -0x0000,0x9c5d,0x9c61,0x9c65,0x9e08,0x0000,0x0000,0x0000, -0x0000,0x0000,0x9f45,0x0000,0x0000,0x6205,0x66ef,0x6b1b, -0x6b1d,0x7225,0x7224,0x7c6d,0x0000,0x8642,0x8649,0x0000, -0x8978,0x898a,0x8b97,0x0000,0x8c9b,0x8d1c,0x0000,0x8ea2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x9c6c,0x0000,0x9c6f,0x0000,0x9e0e,0x0000,0x9f08,0x9f1d, -0x9fa3,0x0000,0x0000,0x5f60,0x6b1c,0x0000,0x0000,0x0000, -0x7cf3,0x0000,0x8b9b,0x8ea7,0x91c4,0x0000,0x947a,0x0000, -0x0000,0x9a61,0x9a63,0x9ad7,0x9c76,0x0000,0x9fa5,0x0000, -0x7067,0x0000,0x72ab,0x864a,0x897d,0x8b9d,0x8c53,0x8f65, -0x947b,0x0000,0x98cd,0x98dd,0x0000,0x9b30,0x9e16,0x0000, -0x0000,0x0000,0x0000,0x0000,0x96e7,0x9e18,0x9ea2,0x0000, -0x9f7c,0x0000,0x7e9e,0x9484,0x0000,0x9e1c,0x0000,0x7c71, -0x97ca,0x0000,0x0000,0x0000,0x9ea3,0x0000,0x9c7b,0x9f97, -0x0000,0x0000,0x9750,0x0000,0x0000,0x0000,0x5727,0x5c13, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x5fc8,0x0000, -0x0000,0x0000,0x0000,0x0000,0x6765,0x0000,0x0000,0x52bd, -0x0000,0x5b66,0x0000,0x65f9,0x6788,0x6ce6,0x6ccb,0x0000, -0x4fbd,0x5f8d,0x0000,0x6018,0x6048,0x0000,0x6b29,0x70a6, -0x0000,0x7706,0x0000,0x0000,0x0000,0x5a10,0x5cfc,0x5cfe, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x70c9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x9579,0x0000, -0x96ba,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x7b29,0x8128,0x0000,0x8a2e,0x0000,0x0000,0x0000,0x9ad9, -0x0000,0x582b,0x5845,0x0000,0x63fa,0x0000,0x0000,0x0000, -0x6e86,0x0000,0x0000,0x0000,0x0000,0x0000,0x5867,0x0000, -0x5bdd,0x656e,0x0000,0x0000,0x0000,0x8c87,0x0000,0x50d2, -0x50df,0x0000,0x0000,0x0000,0x0000,0x69ba,0x0000,0x6b9d, -0x0000,0x8059,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6f8a,0x0000, -0x0000,0x7bc3,0x7bc2,0x0000,0x0000,0x0000,0x0000,0x90f6, -0x0000,0x9823,0x0000,0x0000,0x0000,0x0000,0x0000,0x71cd, -0x7499,0x0000,0x0000,0x0000,0x0000,0x0000,0x9842,0x0000, -0x0000,0x0000,0x0000,0x7f84,0x0000,0x0000,0x0000,0x0000, -0x0000,0x8d0e,0x0000,0x9861,0x0000,0x0000,0x8b73,0x0000, -0x9c27,0x0000,0x9458,0x77d6,0x9b2d,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x4f66,0x4f68,0x4fe7,0x503f,0x0000,0x50a6,0x510f, -0x523e,0x5324,0x5365,0x539b,0x517f,0x54cb,0x5573,0x5571, -0x556b,0x55f4,0x5622,0x5620,0x5692,0x56ba,0x5691,0x56b0, -0x5759,0x578a,0x580f,0x5812,0x5813,0x5847,0x589b,0x5900, -0x594d,0x5ad1,0x5ad3,0x5b67,0x5c57,0x5c77,0x5cd5,0x5d75, -0x5d8e,0x5da5,0x5db6,0x5dbf,0x5e65,0x5ecd,0x5eed,0x5f94, -0x5f9a,0x5fba,0x6125,0x6150,0x62a3,0x6360,0x6364,0x63b6, -0x6403,0x64b6,0x651a,0x7a25,0x5c21,0x66e2,0x6702,0x67a4, -0x67ac,0x6810,0x6806,0x685e,0x685a,0x692c,0x6929,0x6a2d, -0x6a77,0x6a7a,0x6aca,0x6ae6,0x6af5,0x6b0d,0x6b0e,0x6bdc, -0x6bdd,0x6bf6,0x6c1e,0x6c63,0x6da5,0x6e0f,0x6e8a,0x6e84, -0x6e8b,0x6e7c,0x6f4c,0x6f48,0x6f49,0x6f9d,0x6f99,0x6ff8, -0x702e,0x702d,0x705c,0x79cc,0x70bf,0x70ea,0x70e5,0x7111, -0x7112,0x713f,0x7139,0x713b,0x713d,0x7177,0x7175,0x7176, -0x7171,0x7196,0x7193,0x71b4,0x71dd,0x71de,0x720e,0x5911, -0x7218,0x7347,0x7348,0x73ef,0x7412,0x743b,0x74a4,0x748d, -0x74b4,0x7673,0x7677,0x76bc,0x7819,0x781b,0x783d,0x7853, -0x7854,0x7858,0x78b7,0x78d8,0x78ee,0x7922,0x794d,0x7986, -0x7999,0x79a3,0x79bc,0x7aa7,0x7b37,0x7b59,0x7bd0,0x7c2f, -0x7c32,0x7c42,0x7c4e,0x7c68,0x7ca9,0x7ced,0x7dd0,0x7e07, -0x7dd3,0x7e64,0x7f40,0x0000,0x8041,0x8063,0x80bb,0x6711, -0x6725,0x8248,0x8310,0x8362,0x8312,0x8421,0x841e,0x84e2, -0x84de,0x84e1,0x8573,0x85d4,0x85f5,0x8637,0x8645,0x8672, -0x874a,0x87a9,0x87a5,0x87f5,0x8834,0x8850,0x8887,0x8954, -0x8984,0x8b03,0x8c52,0x8cd8,0x8d0c,0x8d18,0x8db0,0x8ebc, -0x8ed5,0x8faa,0x909c,0x0000,0x915c,0x922b,0x9221,0x9273, -0x92f4,0x92f5,0x933f,0x9342,0x9386,0x93be,0x93bc,0x93bd, -0x93f1,0x93f2,0x93ef,0x9422,0x9423,0x9424,0x9467,0x9466, -0x9597,0x95ce,0x95e7,0x973b,0x974d,0x98e4,0x9942,0x9b1d, -0x9b98,0x0000,0x9d49,0x6449,0x5e71,0x5e85,0x61d3,0x990e, -0x8002,0x781e,0x0000,0x0000,0x5528,0x5572,0x55ba,0x55f0, -0x55ee,0x56b8,0x56b9,0x56c4,0x8053,0x92b0}; - -static const int cns11643_14_ucs_table_size = (sizeof(cns11643_14_ucs_table)/sizeof(unsigned short)); - -/* UCS -> CNS11643 */ -static const unsigned int ucs_a1_cns11643_table[] = { -/* 0x0000 */ -0x00000,0x00001,0x00002,0x00003,0x00004,0x00005,0x00006,0x00007, -0x00008,0x00009,0x0000a,0x0000b,0x0000c,0x0000d,0x0000e,0x0000f, -0x00010,0x00011,0x00012,0x00013,0x00014,0x00015,0x00016,0x00017, -0x00018,0x00019,0x0001a,0x0001b,0x0001c,0x0001d,0x0001e,0x0001f, -0x00020,0x00021,0x00022,0x00023,0x00024,0x00025,0x00026,0x00027, -0x00028,0x00029,0x0002a,0x0002b,0x0002c,0x0002d,0x0002e,0x0002f, -0x00030,0x00031,0x00032,0x00033,0x00034,0x00035,0x00036,0x00037, -0x00038,0x00039,0x0003a,0x0003b,0x0003c,0x0003d,0x0003e,0x0003f, -0x00040,0x00041,0x00042,0x00043,0x00044,0x00045,0x00046,0x00047, -0x00048,0x00049,0x0004a,0x0004b,0x0004c,0x0004d,0x0004e,0x0004f, -0x00050,0x00051,0x00052,0x00053,0x00054,0x00055,0x00056,0x00057, -0x00058,0x00059,0x0005a,0x0005b,0x0005c,0x0005d,0x0005e,0x0005f, -0x00060,0x00061,0x00062,0x00063,0x00064,0x00065,0x00066,0x00067, -0x00068,0x00069,0x0006a,0x0006b,0x0006c,0x0006d,0x0006e,0x0006f, -0x00070,0x00071,0x00072,0x00073,0x00074,0x00075,0x00076,0x00077, -0x00078,0x00079,0x0007a,0x0007b,0x0007c,0x0007d,0x0007e,0x0007f, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12170, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12278,0x12234,0x00000,0x00000,0x00000,0x00000,0x00000,0x12131, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12232, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12233, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x0100 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x0200 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x1256f, -0x00000,0x1256d,0x1256e,0x12570,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x1256c,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x0300 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x12475,0x12476,0x12477,0x12478,0x12479,0x1247a,0x1247b, -0x1247c,0x1247d,0x1247e,0x12521,0x12522,0x12523,0x12524,0x12525, -0x12526,0x12527,0x00000,0x12528,0x12529,0x1252a,0x1252b,0x1252c, -0x1252d,0x1252e,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x1252f,0x12530,0x12531,0x12532,0x12533,0x12534,0x12535, -0x12536,0x12537,0x12538,0x12539,0x1253a,0x1253b,0x1253c,0x1253d, -0x1253e,0x1253f,0x00000,0x12540,0x12541,0x12542,0x12543,0x12544, -0x12545,0x12546}; - -static const int ucs_a1_cns11643_table_min = 0x0000; -static const int ucs_a1_cns11643_table_max = 0x0000 + (sizeof (ucs_a1_cns11643_table) / sizeof (unsigned int)); - -static const unsigned int ucs_a2_cns11643_table[] = { -/* 0x2000 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x12139,0x12137,0x00000,0x1225d,0x00000, -0x12164,0x12165,0x00000,0x00000,0x12166,0x12167,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x1212d,0x1212c,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x1216a,0x00000,0x00000,0x1216b,0x00000,0x00000, -0x00000,0x00000,0x00000,0x1216f,0x00000,0x00000,0x12223,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x2100 */ -0x00000,0x00000,0x00000,0x1226a,0x00000,0x12222,0x00000,0x00000, -0x00000,0x1226b,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x1242b,0x1242c,0x1242d,0x1242e,0x1242f,0x12430,0x12431,0x12432, -0x12433,0x12434,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12635,0x12636,0x12637,0x12638,0x12639,0x1263a,0x1263b,0x1263c, -0x1263d,0x1263e,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12258,0x12255,0x12257,0x12256,0x00000,0x00000,0x12259,0x1225a, -0x1225c,0x1225b,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x2200 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x12261,0x00000,0x00000, -0x00000,0x00000,0x12235,0x00000,0x00000,0x00000,0x1223c,0x12249, -0x12248,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x12245,0x12246,0x1224d,0x00000,0x00000,0x1224e,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12250,0x1224f,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12244,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x1223d,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x1223b,0x1223e,0x00000,0x00000,0x00000,0x00000,0x12239,0x1223a, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x12247,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x1224a, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x2300 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x14221,0x14222,0x14223,0x14224,0x14225,0x14226,0x14227,0x14228, -0x14229,0x1422a,0x1422b,0x1422c,0x1422d,0x1422e,0x1422f,0x14230, -0x14231,0x14232,0x14233,0x14234,0x14235,0x14236,0x14237,0x14238, -0x14239,0x1423a,0x1423b,0x1423c,0x1423d,0x1423e,0x1423f,0x14240, -0x00000,0x14241,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12621,0x12622,0x12623,0x12624,0x12625,0x12626,0x12627,0x12628, -0x12629,0x1262a,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x1262b,0x1262c,0x1262d,0x1262e, -0x1262f,0x12630,0x12631,0x12632,0x12633,0x12634,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12339,0x00000,0x1233a,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x1233c,0x00000,0x00000,0x00000, -0x1233d,0x00000,0x00000,0x00000,0x1233e,0x00000,0x00000,0x00000, -0x1233f,0x00000,0x00000,0x00000,0x12337,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12336,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12335,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12334,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12333,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12344,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12345,0x00000, -0x00000,0x12347,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x12346,0x00000,0x00000,0x12340,0x12341,0x12343, -0x12342,0x1234c,0x1234d,0x1234e,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x12324,0x12325,0x12326,0x12327,0x12328,0x12329,0x1232a, -0x1232b,0x12332,0x12331,0x12330,0x1232f,0x1232e,0x1232d,0x1232c, -0x00000,0x00000,0x00000,0x00000,0x12338,0x1233b,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x1217c,0x1217b,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x12175,0x12174,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x1217e,0x1217d,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x1217a,0x12179, -0x00000,0x00000,0x00000,0x12172,0x00000,0x00000,0x12176,0x12173, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x12348,0x12349,0x1234b,0x1234a,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x2600 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x12178,0x12177,0x00000, -0x00000,0x12254,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12251,0x12253,0x12252}; - -static const int ucs_a2_cns11643_table_min = 0x2000; -static const int ucs_a2_cns11643_table_max = 0x2000 + (sizeof (ucs_a1_cns11643_table) / sizeof (unsigned int)); - -static const unsigned int ucs_a3_cns11643_table[] = { -/* 0x2f00 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12121,0x12123,0x12124,0x12171,0x00000,0x00000,0x00000,0x00000, -0x12152,0x12153,0x1214e,0x1214f,0x12156,0x12157,0x1215a,0x1215b, -0x1214a,0x1214b,0x12265,0x00000,0x12146,0x12147,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x12168,0x12169,0x00000, -0x00000,0x12435,0x12436,0x12437,0x12438,0x12439,0x1243a,0x1243b, -0x1243c,0x1243d,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x12126,0x00000,0x00000,0x00000,0x00000, -/* 0x3100 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x12547,0x12548,0x12549, -0x1254a,0x1254b,0x1254c,0x1254d,0x1254e,0x1254f,0x12550,0x12551, -0x12552,0x12553,0x12554,0x12555,0x12556,0x12557,0x12558,0x12559, -0x1255a,0x1255b,0x1255c,0x1255d,0x1255e,0x1255f,0x12560,0x12561, -0x12562,0x12563,0x12564,0x12565,0x12566,0x12567,0x12568,0x12569, -0x1256a,0x1256b,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x3200 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x12221,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x3300 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12275,0x12276, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12270,0x12271,0x12272,0x00000, -0x00000,0x12274,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x12277,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x12273,0x00000, -0x00000,0x1224c,0x1224b,0x00000,0x00000,0x1226f}; - -static const int ucs_a3_cns11643_table_min = 0x2f00; -static const int ucs_a3_cns11643_table_max = 0x2f00 + (sizeof (ucs_a3_cns11643_table) / sizeof (unsigned int)); - -static const unsigned int ucs_i_cns11643_table[] = { -/* 0x4d00 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x14421,0x14423,0x00000,0x14424,0xe2126,0xe2125,0x00000,0x22126, -0x14437,0x14435,0x14438,0x14436,0x22127,0x14462,0x2212f,0x2212d, -0x14461,0x14460,0x00000,0x00000,0x14562,0x14561,0x14560,0x00000, -0x14563,0x1455f,0x00000,0x00000,0x00000,0x00000,0x14722,0x14723, -0xe2262,0xe2261,0xe2263,0x00000,0xe243f,0x00000,0x14b64,0x00000, -0xe2121,0x00000,0xe212c,0x14439,0x00000,0x14463,0x22130,0x00000, -0x14464,0x22143,0x1486b,0x22531,0x00000,0x00000,0xe2122,0x00000, -0x1443a,0x14465,0x00000,0x14564,0x22144,0xe2740,0x00000,0xe2123, -0x00000,0x00000,0x22121,0x14425,0x00000,0x1443c,0xe2130,0x22128, -0x1443d,0xe212e,0x00000,0x14466,0x00000,0x14565,0x14567,0x14566, -0x00000,0x00000,0x14724,0x14725,0xe2345,0x00000,0x14b65,0xe2b22, -0x1537d,0x14422,0x00000,0x00000,0x22122,0x14426,0x1443f,0x1443e, -0x00000,0x00000,0xe2146,0xe2145,0x00000,0x00000,0x00000,0x00000, -0xe2264,0x14726,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe2440,0x00000,0x14b66,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe2b23,0x00000,0x00000,0x00000,0x00000,0x15871,0x2334e, -0xe396c,0xe396e,0x1632a,0x24156,0x24157,0xe2124,0x14427,0xe212d, -0x14468,0xe2265,0x00000,0x14b67,0x14428,0x22129,0x14440,0xe2131, -0x00000,0x14469,0x1446b,0x22131,0x1446c,0x1446a,0x00000,0xe216c, -0xe2266,0x14727,0x00000,0x14b68,0xe2442,0xe2742,0x14b69,0x14f67, -0x00000,0x14441,0x1446d,0xe2147,0x14728,0x1472a,0x14729,0x00000, -0x1486c,0x00000,0x00000,0x14b6a,0x14b6b,0x14f68,0x14f69,0xe2b26, -0xe2b25,0xe2b27,0xe2b24,0x1537e,0x00000,0x00000,0x24158,0xe4033, -0x00000,0x26d44,0x14429,0x00000,0xe2132,0x00000,0xe2133,0x00000, -0x1446f,0x1446e,0x22132,0x14470,0x14476,0xe2149,0x14471,0x14472, -0x22134,0x22133,0x14474,0x14475,0xe214c,0x14473,0xe214b,0xe214a, -0x00000,0x00000,0x00000,0x00000,0x1456a,0x1456b,0x1456c,0x1456d, -0x14569,0x14570,0x2214a,0x00000,0x22146,0x22149,0x14571,0x14623, -0xe216d,0x22148,0x00000,0x1456e,0x1456f,0x14568,0xe2172,0xe2170, -0x22145,0x22147,0x00000,0x00000,0x00000,0x00000,0xe226f,0xe2268, -0x14737,0x2216f,0x14734,0x14738,0x22179,0x2216d,0x14735,0x22171, -0xe226b,0xe2267,0xe2276,0x14736,0xe226e,0x14739,0x00000,0x1472b, -0x22170,0x1473a,0x22174,0xe226d,0x22178,0x22175,0xe226c,0xe2274, -0x22172,0x1472c,0x1472e,0x1473b,0x00000,0x14730,0x2216a,0x14733, -0x14731,0x14732,0x2217a,0x22177,0x2216e,0x1472f,0xe2270,0xe2277, -0x2216b,0x1472d,0xe2275,0x00000,0xe2273,0x22173,0x00000,0x00000, -0x00000,0x00000,0x22176,0x00000,0x00000,0x00000,0x00000,0x00000, -0xe2272,0x00000,0x00000,0x00000,0x2216c,0x22328,0x00000,0x14924, -0x14875,0xe2450,0xe2448,0x22329,0x14872,0xe244f,0x14926,0xe2446, -0x1487a,0xe2445,0x14879,0x2227b,0x1487d,0x14878,0x22322,0x2232a, -0xe244e,0x22326,0xe2449,0x1487b,0xe244b,0xe2443,0x1487e,0x1486f, -0x14929,0x2227d,0xe2444,0xe244c,0x2253d,0x1486d,0x14925,0x1486e, -0x14876,0x14877,0x22324,0x2227e,0x1487c,0x14874,0x2227a,0x14870, -0x22327,0x14927,0x1492a,0x14873,0x14922,0x14928,0x14871,0x22325, -0x14923,0x2232b,0x2227c,0x14921,0x22321,0x00000,0xe6448,0x22323, -0xe6449,0x14b79,0x2253f,0x2254b,0x14b71,0xe2747,0x2254c,0x14b6c, -0x14b76,0x00000,0xe274f,0x14b6f,0x22539,0x14b77,0x22538,0x2253c, -0x22543,0x22541,0x14c21,0x14b7a,0x22533,0x22535,0x14b7c,0x14b70, -0x22536,0x22542,0x22549,0x14b75,0x2253b,0x22534,0x14b74,0x22537, -0x14b78,0x2253a,0xe2744,0x14b73,0xe2751,0x14b6e,0xe2748,0x14b7d, -0x22544,0x14b7e,0x22548,0xe2743,0x22546,0x2254a,0x14b7b,0x2253e, -0x22532,0x00000,0x22540,0x14b72,0x22545,0x14b6d,0x22547,0xe274c, -0xe2749,0xe274b,0xe274a,0xe274d,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x14f78,0x14f6c, -0xe2b2d,0xe2b2e,0x22922,0x2292a,0xe2b36,0x14f6b,0x14f73,0x15021, -0xe2b2c,0x22930,0x2292e,0x22929,0x00000,0xe6263,0xe2b2b,0x14f6d, -0x2292f,0x22925,0x14f7b,0x14f72,0x14f7a,0x2287e,0xe2b32,0x2292c, -0xe2b2f,0x22923,0x14f76,0x22924,0xe2b33,0x2287d,0x14f7d,0x14f70, -0x14f79,0x14f6f,0xe2b28,0x22921,0x22926,0xe2b29,0x2292d,0x14f77, -0x14f74,0x22928,0x14f7c,0x2292b,0x22927,0x14f71,0x14f7e,0x14f75, -0x14f6e,0x14f6a,0x00000,0xe2b35,0x00000,0xe2b34,0x00000,0xe644a, -0x00000,0x00000,0x00000,0x00000,0x22931,0x00000,0x1543a,0x15424, -0xe2f48,0x15434,0xe2f4d,0x15439,0x22d71,0x22d70,0x22d75,0x22d76, -0x15427,0xe2f44,0x15430,0xe2f58,0xe2f4c,0xe2f56,0x1543d,0xe2f46, -0x15431,0x00000,0xe2f4b,0xe2f49,0xe2f47,0x22d6a,0x1542a,0x22d6b, -0xe2f4f,0x1543f,0x00000,0x15436,0x15421,0x15422,0x22d7e,0x15924, -0xe2f53,0x1542f,0x1542e,0x22d6c,0x15432,0x2335e,0x15429,0x22d77, -0x15438,0x15437,0x1542d,0x22d6f,0x22d78,0xe2f45,0x22d69,0x1542c, -0x22d79,0x15435,0x22d6d,0x15423,0xe2f4e,0x15426,0x15425,0x22d7a, -0x15433,0x15428,0x1543c,0x1543e,0x22d74,0x1543b,0xe2f51,0x22d7c, -0x22d6e,0x22d7d,0xe2f43,0x22d72,0x00000,0x22d7b,0xe2f50,0x22d73, -0xe2f54,0xe2f55,0x00000,0x00000,0x1542b,0x00000,0x00000,0xe644b, -0x23366,0x2335a,0xe343c,0x15876,0xe343f,0x2335f,0x23365,0x15875, -0x23358,0x15879,0x2335c,0x23355,0x15877,0x23359,0x1587c,0x15923, -0xe3444,0x2336a,0xe3441,0x23354,0xe3442,0x1587d,0xe2f57,0x23369, -0xe3447,0xe343d,0x15878,0x2335b,0x15874,0x23356,0x23352,0x23360, -0x23353,0x23351,0x2335d,0x23363,0x23364,0x1587a,0xe3440,0x00000, -0x23a3f,0x23361,0x23350,0x23362,0xe344b,0x15926,0x23367,0x15925, -0x2334f,0xe3443,0x23357,0x23368,0x15921,0x1587e,0x1587b,0x15922, -0xe344c,0xe344a,0x15872,0xe3445,0xe3446,0x15873,0x00000,0x00000, -0x15e2e,0xe3975,0x23a42,0x23a3b,0x00000,0x15e2b,0x00000,0x23a43, -0xe3971,0xe3972,0x00000,0x23a39,0x23a3c,0x15e2a,0x23a3d,0xe396f, -0x00000,0x15e2d,0x23a41,0x00000,0x23a37,0x23a36,0x15e2f,0xe3970, -0x15e30,0x15e2c,0x15e31,0x23a35,0x23a40,0x23a3e,0x23a38,0x00000, -0x00000,0x00000,0x15e29,0x23a3a,0x00000,0x00000,0xe644d,0x00000, -0x00000,0x00000,0xe4039,0xe403c,0x16331,0x1632b,0x2415c,0x16334, -0x24162,0x24165,0x1632d,0x1632e,0x2415f,0x1632c,0x24168,0x16332, -0x24169,0xe403a,0x24164,0x16333,0xe4037,0x24159,0x16330,0x2415a, -0x00000,0x24163,0x24161,0xe403d,0x2415d,0x1632f,0x2415b,0x16335, -0x24160,0x24167,0x2415e,0x24166,0xe4036,0xe403e,0x1677c,0x16779, -0xe456b,0x1677a,0xe634c,0x24921,0x24877,0x16778,0x16775,0x24878, -0xe456e,0xe456c,0x16777,0x2487b,0xe456d,0x2487d,0xe4576,0xe634d, -0x24926,0xe4570,0xe4575,0x24925,0x2487e,0x16774,0x24876,0x16772, -0x24879,0x1677d,0x2487c,0xe4571,0x24922,0x16776,0x16773,0x24924, -0x24923,0x1677b,0x00000,0x2487a,0xe4574,0x16c23,0x24f54,0xe4b29, -0x24f51,0x16c24,0x00000,0x16c22,0xe4b2b,0x24f58,0x24f55,0x24f4e, -0x16c21,0xe4b2d,0x16c25,0x24f4f,0x16b7e,0x16c28,0x24f52,0x24f53, -0x16c26,0x16c27,0x24f59,0x24f56,0x24f57,0xe4b2c,0xe4b27,0xe644e, -0x17033,0x25643,0x17030,0x25640,0x17032,0x17034,0xe5031,0x25641, -0x17031,0x00000,0x25642,0xe5035,0x2563f,0xe5030,0xe5034,0x17341, -0x25c49,0x17342,0x25c47,0x00000,0x25c48,0x25c46,0x25c45,0xe5441, -0xe5440,0x25c4a,0x17340,0xe5033,0x00000,0x26144,0x26145,0xe5752, -0x24f50,0x26143,0x17343,0x1782b,0x26537,0x26538,0xe5c32,0x17a62, -0x17a63,0x26b4f,0x26b4e,0x17b58,0x17b57,0x26e7d,0xe606f,0x1442a, -0x14442,0x14478,0x00000,0x14477,0x14573,0x14572,0x1473e,0x1473d, -0x1473f,0x1473c,0xe2278,0x1492c,0x1492b,0x1492d,0xe2454,0x00000, -0xe2453,0xe2451,0x14c23,0x00000,0x14c22,0x14c24,0xe2752,0x15022, -0x00000,0x12279,0x22e21,0x1227a,0x15927,0x1227c,0x1227b,0x23a44, -0xe3976,0x1227d,0x1677e,0x1227e,0xe5e25,0x1442b,0xe2134,0x14479, -0x14740,0x14c25,0xe2b37,0x1442c,0x1447c,0x1447a,0x1447b,0x00000, -0x00000,0x14741,0xe227a,0x00000,0x00000,0x1492e,0x14c27,0x14c26, -0x14c28,0xe2e7b,0x00000,0x00000,0x15440,0x00000,0xe403f,0xe6453, -0x17035,0x00000,0xe2127,0x00000,0xe214d,0xe2148,0xe214e,0x2212e, -0x00000,0x14574,0x14575,0xe2178,0xe2179,0x14742,0x00000,0x2232c, -0xe2755,0x15024,0x15023,0x22e23,0x22e22,0x15928,0xe2128,0x1447d, -0x22135,0xe217a,0x00000,0x00000,0x00000,0xe2457,0x2254d,0xe2b39, -0x15025,0xe2f5b,0x15443,0xe2f59,0x15441,0x15442,0xe2f5a,0x00000, -0xe344d,0x00000,0x17036,0x00000,0x14576,0x00000,0x00000,0x00000, -0x14743,0x2217b,0xe227e,0xe227d,0xe227c,0xe2459,0x1492f,0x14930, -0xe245a,0x2232d,0x00000,0x00000,0x2254e,0x14c29,0x2254f,0x00000, -0x00000,0xe2b3b,0xe2b3d,0xe2b3e,0x22e25,0x22e26,0x15446,0xe2f5e, -0x22e27,0xe2f5f,0x22e24,0x15447,0x15445,0x15444,0x22e28,0xe344f, -0x2336b,0xe344e,0xe397d,0xe397a,0x23a45,0x00000,0xe397e,0x2416a, -0x24927,0xe4b2f,0xe4b2e,0xe4b30,0x16c29,0x17037,0x25644,0xe5442, -0x1442d,0x1443b,0xe212f,0xe2135,0xe2151,0xe217b,0x00000,0x00000, -0xe2322,0x00000,0x00000,0x00000,0xe245b,0xe2759,0x00000,0x00000, -0x15929,0x15e33,0x00000,0x16821,0xe457a,0x22123,0x1447e,0x00000, -0x14579,0x14577,0x14578,0x00000,0x00000,0x14c2a,0xe275a,0x00000, -0x1442e,0x1442f,0x00000,0x14443,0xe2136,0xe2152,0x14521,0x14522, -0x14523,0x2214c,0x1457a,0xe217d,0x2214b,0x00000,0x14747,0xe2325, -0x2217d,0x14745,0x14746,0x2217c,0xe2324,0xe2326,0x14748,0x14744, -0xe2327,0x00000,0x00000,0x00000,0x2232e,0x14f4f,0x2232f,0xe245f, -0xe2461,0x22330,0x00000,0xe245c,0x14932,0x14931,0xe245e,0xe245d, -0x14935,0x14933,0x14934,0xe2460,0x00000,0x00000,0x14c30,0xe275b, -0x14c2f,0x22554,0x22551,0x22552,0xe275e,0x22550,0x14c31,0x14c2d, -0x14c2c,0xe275f,0x14c2e,0x14c2b,0xe275d,0x00000,0xe644f,0x00000, -0x00000,0x14c32,0x00000,0x15027,0x22932,0xe2b3f,0x22553,0x1502c, -0xe2b40,0x22933,0x15028,0x1502b,0x1502a,0x15029,0x15026,0xe2b43, -0x00000,0x00000,0x22e2b,0xe2f68,0x1544a,0x22e2e,0x15448,0xe2f65, -0x00000,0xe2f62,0x22e2a,0x1544b,0x15449,0x1544c,0x22e2c,0x22e2d, -0xe2f60,0x22e29,0x22e2f,0xe2f66,0xe2f61,0xe2f63,0x00000,0xe2f64, -0xe3450,0x15e37,0x1592a,0x2336c,0x2336e,0x2336d,0x2336f,0x1592b, -0xe3a23,0x00000,0x15e34,0xe3a21,0x15e35,0x15e36,0xe3451,0x16337, -0x2416c,0xe4041,0x2416b,0x2416d,0x2416e,0x16338,0xe4040,0x16336, -0x24928,0x24929,0x16823,0x16822,0x24c61,0x00000,0xe4b31,0x16c2a, -0x16c2b,0x16c2c,0x16c2e,0x24f5a,0x24f5b,0x16c2d,0xe4b32,0x00000, -0xe5036,0x17038,0x00000,0x17039,0xe5037,0x00000,0x26539,0x26b51, -0x26b50,0x26e7e,0xe602c,0x14430,0xe2137,0xe2154,0xe2153,0x1457c, -0x1457b,0x00000,0x00000,0x14749,0x00000,0x00000,0x2217e,0x00000, -0xe2328,0x14937,0x14938,0x14936,0x14939,0x22331,0x22332,0x00000, -0x00000,0x00000,0x00000,0xe2463,0xe2462,0xe2761,0x00000,0x00000, -0x00000,0xe2760,0x00000,0x14c34,0x22555,0xe625a,0x14c33,0xe2762, -0x22934,0x15030,0x22935,0x1502f,0xe2b48,0xe2b46,0x00000,0x1502d, -0x00000,0x1502e,0xe2b47,0x00000,0xe2f6f,0x22e30,0xe2f6c,0xe2f6a, -0xe2f6d,0xe2f6e,0x1592c,0x23371,0xe3452,0x1592f,0x23370,0x15b2b, -0x1592e,0x1592d,0x00000,0x15e3a,0x00000,0x15e39,0x15e38,0x16339, -0xe4045,0xe4044,0x1633c,0x1633d,0x1633b,0x00000,0x1633a,0xe4046, -0x00000,0x2492a,0xe4621,0x2492b,0x00000,0xe457e,0xe4b33,0x24f5d, -0x16c2f,0x24f5c,0xe4d2c,0x1703a,0x25c4b,0x17344,0x00000,0x2653a, -0x17961,0x00000,0x14444,0x14524,0x22136,0xe2155,0x14525,0x14526, -0xe2156,0x00000,0x00000,0xe2223,0xe2222,0x1457d,0x1457e,0xe2224, -0x1474a,0x22333,0x22556,0x22557,0x00000,0x15031,0x22e31,0x15931, -0x15930,0x23a47,0x23a46,0x00000,0xe5038,0x14431,0x14527,0x14621, -0x00000,0x15932,0x22124,0x00000,0x2214d,0x14622,0xe2226,0x22222, -0x1474c,0x1474b,0x22221,0x1493a,0xe6450,0xe2465,0x00000,0xe2b49, -0x00000,0x00000,0x1544d,0x00000,0x00000,0x23372,0x00000,0x1633e, -0x2492c,0x16824,0xe4623,0xe4b34,0x25645,0xe5444,0xe5c34,0x2686a, -0xe2129,0x14528,0xe2157,0xe2466,0x22558,0x22936,0x15935,0x15933, -0x15934,0x14432,0x00000,0x14445,0x1243f,0x1452b,0xe2159,0x1452a, -0x14529,0x14625,0x14624,0xe232a,0x2214e,0x22223,0x00000,0xe232b, -0xe232d,0x14c38,0x14c35,0x14c37,0x14c36,0xe2763,0x00000,0x15032, -0xe2b4a,0x00000,0x15e3b,0x00000,0x14433,0xe215a,0x1452c,0xe2227, -0x14627,0x14626,0x00000,0x22334,0x00000,0xe6451,0x14c39,0xe2a5c, -0x00000,0xe212a,0x00000,0x00000,0x22137,0xe2228,0x14629,0x14628, -0x1474d,0x1474e,0x22335,0x1493b,0xe2467,0x1493c,0xe2765,0x14c3a, -0x14c3b,0x14c3c,0xe2766,0x15033,0x22937,0xe2b4b,0x00000,0x1544e, -0xe4047,0x00000,0x22125,0x00000,0x1452d,0x00000,0xe215b,0x00000, -0x00000,0xe2229,0x22224,0xe232f,0x00000,0x00000,0x22336,0x22337, -0x00000,0x00000,0x22559,0xe2767,0x2255a,0x00000,0x22939,0x22938, -0x2293b,0x2293a,0x15034,0xe6452,0x23373,0x15450,0x22e32,0x1544f, -0xe3454,0x00000,0x00000,0x00000,0x23a48,0x15e3c,0xe3a28,0x23a49, -0xe3a27,0xe404a,0xe4049,0xe4048,0x2492d,0x16825,0xe4625,0x00000, -0xe4626,0xe4b35,0x16c30,0xe5445,0x2653b,0x00000,0xe212b,0xe215c, -0x00000,0x22138,0xe222a,0x1462a,0x00000,0x00000,0xe2331,0x00000, -0x00000,0xe2769,0xe276a,0x15936,0xe3455,0xe3a29,0x00000,0x00000, -0x14434,0x14446,0x1452f,0x1452e,0xe215e,0x14530,0xe2160,0x00000, -0xe222b,0x00000,0xe2333,0x00000,0x14c3e,0xe276b,0x14c3d,0x14c3f, -0x00000,0xe2b50,0xe2b4f,0x15035,0xe2b4e,0xe2b4d,0x00000,0x15451, -0xe404b,0x25646,0x1763b,0x14447,0x1462c,0x1463b,0x14636,0x00000, -0x14631,0x14630,0x14637,0x14635,0x1462e,0x1463c,0x1462f,0x1462b, -0x1463a,0x14639,0x14638,0x1462d,0xe2231,0x14634,0xe222d,0xe222e, -0x14633,0xe222f,0x00000,0x1463d,0x14632,0x00000,0x00000,0xe2335, -0xe2337,0x14754,0x00000,0x1475a,0x14756,0xe2339,0x1475c,0x22225, -0x14759,0x1474f,0x14752,0x14755,0x14751,0x14758,0x1475b,0x14750, -0x14753,0x14757,0x1475d,0xe233a,0x00000,0xe233b,0xe2334,0x00000, -0x22340,0x2233d,0xe2476,0x14949,0x2233e,0x1493d,0x1493f,0x14957, -0x14952,0xe2479,0xe247e,0xe2475,0x22345,0x2233f,0x14941,0x14943, -0x22344,0x1494a,0x2233a,0x14956,0x14958,0x1493e,0x1494f,0xe2524, -0x22338,0x14955,0xe2477,0x14946,0xe247b,0x14950,0x14951,0x22339, -0x1494e,0x1494c,0xe2470,0x1494d,0x14953,0x22341,0x14940,0xe2521, -0x14954,0x22343,0x14948,0x14945,0xe2473,0x2233c,0x14944,0x22346, -0x14947,0xe247c,0x1494b,0xe2478,0xe2474,0xe246d,0x14942,0x22342, -0xe247d,0xe2522,0x00000,0x00000,0x2233b,0x00000,0x00000,0x00000, -0x00000,0x00000,0xe2523,0x00000,0x00000,0x00000,0x00000,0xe276e, -0x2256b,0x2256a,0x14c51,0x2256d,0x2256f,0x22564,0x22567,0x2256e, -0x14c52,0xe2774,0xe2778,0x22561,0x22565,0xe2775,0x00000,0x22569, -0x2294a,0x14c4d,0x2294e,0x14c40,0x22566,0x14c41,0x14c4e,0x14c47, -0x14c43,0xe2771,0x22562,0x14c46,0x14c4b,0x14c54,0x22563,0x2255c, -0x14c45,0x2255d,0x2255f,0x00000,0x14c48,0xe276c,0x14c4a,0x2255b, -0x22560,0xe2770,0xe2779,0x14c53,0x14c4f,0x22568,0x14c55,0xe2773, -0x14c4c,0x2255e,0x14c49,0xe276f,0xe2777,0x14c44,0x14c42,0x00000, -0x2256c,0x00000,0x14c50,0x00000,0x00000,0x00000,0xe2b5c,0xe2b5d, -0x22949,0x2293d,0x2294c,0xe2b57,0xe2b59,0x2293f,0x1503c,0x1504a, -0x15038,0x15049,0x15041,0x15046,0x15036,0x2293e,0x22944,0x15045, -0x22950,0x15047,0xe2b5b,0x1503d,0xe2b54,0xe2b5e,0x22946,0x22943, -0x1503b,0xe2b51,0x2293c,0x15048,0x2294b,0x15040,0x2294d,0x1504b, -0x15037,0x15042,0x1503f,0x22941,0x15043,0x22947,0x22948,0x1503e, -0x15044,0x1503a,0xe2b55,0xe6454,0xe2b63,0xe2b61,0x15039,0x22940, -0xe2b53,0x00000,0x00000,0x00000,0x00000,0x00000,0x22945,0x00000, -0x00000,0x00000,0xe2b58,0x00000,0x00000,0x00000,0x2294f,0x00000, -0x22e46,0x1545e,0x22e34,0x00000,0x22e39,0x15457,0x15462,0x22e37, -0x15452,0x1545c,0x15461,0x22e3e,0x00000,0x1545d,0x15460,0xe2f77, -0xe3021,0x22e41,0x15458,0x22e38,0xe2f74,0xe2f78,0xe3022,0x22e44, -0x22e45,0xe2f79,0x1545a,0x22e43,0x15456,0x15465,0x00000,0x22e3b, -0xe2f7b,0x15454,0xe2f7a,0x22e48,0x22e3c,0x22e40,0x15459,0x15464, -0x22e3d,0x1545f,0x22e42,0x22e49,0x23424,0xe2f73,0x22e47,0x15466, -0x15453,0x22e3f,0x22e36,0xe2f76,0x1545b,0x00000,0x00000,0x22e35, -0xe2f7e,0xe3025,0x22e3a,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x22e33,0x15463, -0xe6721,0xe345f,0x2337a,0xe3468,0x15949,0x2342a,0x15947,0x15944, -0x23421,0x15940,0x23425,0x1594b,0x23379,0x2337e,0x2337d,0x15455, -0x15946,0x23428,0xe3466,0x2342b,0x23376,0x00000,0x15e4e,0xe3467, -0x2342c,0x1594c,0x00000,0x1593e,0x1593b,0x23423,0x15938,0x00000, -0x23429,0xe345b,0x1593f,0x2342d,0xe3458,0x23377,0x23427,0x15942, -0x23378,0x2337b,0x23422,0xe3462,0xe3461,0x15943,0x15941,0x1594d, -0xe3457,0xe3a36,0xe3464,0x00000,0x15948,0xe345e,0x1593c,0x15a76, -0x00000,0x1593d,0x2337c,0x1594a,0x15945,0x23426,0x1593a,0x00000, -0xe3459,0x00000,0x15939,0xe6457,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe6456,0xe6722,0xe6455,0x00000,0x23374,0x23375,0x23a4e, -0x00000,0x00000,0xe3a3c,0x15e3d,0x15e40,0x23a59,0x15e54,0x23a5c, -0x15e3e,0x23a55,0x15e44,0x15e4a,0x16143,0xe3a31,0xe3a38,0x15e48, -0x23a52,0x15e55,0x15e41,0x15e49,0x23a5a,0x2417c,0x23a5f,0x23a53, -0x00000,0x23a4a,0x23a57,0x23a51,0x15e47,0x23a5d,0xe3a2e,0xe3a2a, -0x15e43,0x15e57,0x15e50,0xe3a33,0x15e45,0x15e42,0xe3a40,0x15e4d, -0xe3a34,0x23a5e,0x23a50,0x23a56,0x23a58,0x23a4c,0x23a5b,0x15e3f, -0x23a4b,0xe3a42,0x15e46,0x15e56,0x15e52,0x23a4d,0x15e4c,0xe3a3b, -0x00000,0x15e53,0x15e4f,0x15e4b,0xe3a2f,0x23a54,0x00000,0x00000, -0x00000,0x00000,0xe6723,0x15e51,0x00000,0x00000,0x00000,0x2417a, -0x24176,0xe4051,0x24227,0x2416f,0x24178,0x1634c,0x1634d,0x16345, -0x24223,0x1634f,0x24174,0x24173,0x24171,0x24225,0x16343,0x2417d, -0x24172,0x16346,0x2417b,0x16341,0x24177,0x2417e,0x24222,0xe404e, -0x00000,0x24226,0x1634a,0x24170,0x16344,0x24175,0xe3a2b,0x1633f, -0x00000,0x1634b,0x24221,0x16347,0x16348,0x1634e,0x16342,0x12321, -0x16340,0x24179,0xe404c,0x00000,0x00000,0x00000,0xe6725,0x16349, -0xe6724,0x00000,0x24224,0x00000,0xe6458,0x00000,0x16835,0x16830, -0xe462e,0x2493c,0x24938,0xe4628,0x24932,0x1682a,0x16826,0x2493b, -0x16827,0x24935,0x24937,0xe4629,0x2493a,0xe4636,0x1682c,0xe462c, -0x16833,0x1682d,0x00000,0xe462a,0x24930,0x1682e,0x1682f,0x24933, -0x16834,0xe4634,0x24931,0x24936,0x1682b,0x2492f,0x16831,0x16829, -0xe4633,0x00000,0x00000,0x16828,0x24934,0x24939,0xe4631,0x16832, -0xe645a,0x00000,0xe6459,0x00000,0x00000,0x00000,0xe4650,0x2492e, -0xe4630,0x16c37,0x24f6e,0xe4b41,0x24f6b,0xe4b38,0x16c31,0x16c3d, -0x16c3e,0xe4b3d,0x16c34,0x24f69,0x16c36,0x24f61,0x16c3c,0xe4b44, -0x24f6d,0x16c33,0x24f6f,0x16c32,0x00000,0x24f6a,0x24f6c,0x16c35, -0x24f68,0x24f62,0x24f5f,0x00000,0xe4b3e,0x23a4f,0x24f65,0xe4b37, -0x24f5e,0x24f64,0x24f63,0xe4b3b,0x24f60,0xe4b43,0x16c39,0xe4b45, -0xe4b40,0xe4635,0xe4b3c,0x16c38,0xe4b39,0x00000,0xe4b3f,0x16c3a, -0x24f66,0x1703b,0x24f67,0x00000,0x00000,0x00000,0x2564f,0xe503f, -0x25648,0xe5040,0x17047,0x2564c,0x1703f,0x17043,0x2564b,0xe503b, -0x17042,0x1703e,0x17041,0x1703c,0x17046,0x2564d,0x25649,0x17045, -0x25647,0x17044,0x2564e,0x2564a,0x16c3b,0x00000,0x17048,0x25650, -0x17040,0x1703d,0x00000,0xe503d,0x00000,0xe5448,0x25c52,0x25c54, -0x17346,0x25c55,0x25c53,0x25c51,0x25c50,0x17348,0x25c4f,0x17349, -0x00000,0xe5449,0xe5447,0x00000,0x25c4d,0x25c4e,0x17345,0x1734a, -0x17347,0xe645d,0xe645b,0x25c4c,0xe575b,0x1763c,0xe575a,0x26148, -0x26146,0x2614b,0x26149,0xe5758,0x26147,0x2614a,0xe5759,0xe5757, -0xe575c,0x00000,0x00000,0x00000,0x00000,0x1782c,0x2653e,0x2653f, -0x1782d,0x00000,0x26540,0x2653c,0x26541,0x2653d,0x1763d,0xe5a2d, -0xe645e,0x00000,0x2686b,0x2686d,0x17964,0x2686c,0x17963,0x17962, -0xe6726,0xe6727,0xe645c,0xe5e26,0x17965,0x26b53,0x26b54,0x00000, -0x17a65,0x17a64,0x17a66,0x26b52,0xe6728,0x26d46,0x26d45,0xe5f40, -0x17b59,0x17b5b,0x17b5a,0x26d47,0x17c34,0x27034,0x00000,0x00000, -0x00000,0x17c5d,0xe6071,0x27033,0x2707c,0x00000,0x00000,0x2212a, -0xe2177,0x00000,0x1463f,0x1463e,0x00000,0x14760,0x1475f,0x22227, -0x1475e,0x22226,0x00000,0xe233e,0x1495b,0x22349,0xe252c,0x22348, -0x00000,0xe2526,0x14959,0x1495c,0xe252b,0xe252a,0x22347,0xe2529, -0x1495a,0xe2548,0xe2527,0xe2528,0x00000,0x00000,0xe2822,0x22570, -0xe277d,0x22571,0x14c56,0xe277c,0xe2821,0xe277b,0x00000,0x1504c, -0xe2b65,0x22e4a,0x22e4b,0x15467,0x15468,0xe3027,0x00000,0x2342f, -0x1594e,0x15950,0x2342e,0x1594f,0x23a60,0x15e58,0xe3a44,0xe3a43, -0x00000,0x00000,0x16350,0x16351,0x24228,0xe4052,0x16837,0xe4637, -0x16836,0x00000,0x24f70,0x25652,0x25651,0xe5f41,0x2715a,0x14448, -0x22139,0xe2161,0x2214f,0x22150,0xe2234,0x00000,0x00000,0xe6249, -0x14763,0x14767,0x22229,0x00000,0x14765,0x14764,0x22228,0x14766, -0x14762,0xe2341,0xe2342,0x14761,0x2222a,0xe233f,0xe2340,0x00000, -0x00000,0x00000,0x00000,0x14966,0xe2531,0xe253e,0x14963,0xe2530, -0x1495f,0x2234a,0xe2540,0xe2536,0xe252f,0x2234b,0xe253c,0x14961, -0xe252d,0x2234d,0x1495d,0x2234e,0x2234c,0x14960,0x14962,0x14965, -0x14964,0x1495e,0x2234f,0xe2532,0xe2541,0xe2542,0xe2533,0xe2538, -0xe2537,0xe645f,0x00000,0x00000,0x00000,0x00000,0x00000,0xe2535, -0x00000,0x14c5b,0x2257e,0xe2825,0x14c5d,0xe2823,0x14c5c,0xe2826, -0x22621,0x14c5a,0x14c59,0x22575,0x00000,0x22574,0xe2828,0x22572, -0x22577,0x22576,0x22573,0x2257c,0x2257d,0x2257a,0x22578,0x14c58, -0xe2829,0x00000,0x00000,0x2257b,0x14c5e,0x22622,0x00000,0xe282a, -0x22579,0xe2824,0x1504d,0x14c57,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0xe6460,0x1504e,0x22955,0xe2b69,0xe2b68,0x2295b, -0xe2b6c,0xe2b67,0xe2b6a,0x15054,0x22959,0x2295f,0xe2b71,0x22956, -0x2295a,0x2295c,0x2295e,0x22958,0xe2b70,0x22957,0x22952,0x22953, -0x1504f,0xe2b6b,0x15051,0x15050,0x22954,0x2295d,0xe2b6d,0xe2b72, -0xe2b6e,0x00000,0x00000,0x00000,0xe2b66,0x00000,0x15053,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x22951,0x22e55,0xe302a, -0x22e54,0x22e59,0x22e50,0xe3030,0x22e53,0x22e52,0xe302f,0x22e56, -0xe3038,0x22e5a,0x15469,0x1546c,0xe3034,0xe3035,0x22e51,0x22e57, -0xe3033,0xe3028,0xe3037,0x1546b,0x22e4c,0xe302b,0x15052,0x2343d, -0x22e58,0xe3036,0x22e4f,0x00000,0x1546a,0x22e4e,0x00000,0x00000, -0x00000,0x00000,0x00000,0xe3032,0x23434,0xe346e,0xe3471,0x15951, -0x15955,0x23444,0x23432,0x23440,0x15956,0x23442,0xe3472,0x23448, -0xe3474,0x2344c,0xe3469,0x00000,0x23443,0x23437,0x2343f,0xe346b, -0x2344d,0x2344b,0x23441,0x2343c,0x23435,0x23a68,0x23433,0x1595a, -0x2343a,0x1595b,0x15957,0x23430,0x23446,0x23438,0xe346f,0xe3475, -0x23436,0x23449,0x15958,0xe3476,0x2344f,0x15952,0x15954,0x2343e, -0x23439,0x1546d,0x15953,0x2343b,0x2344a,0x2344e,0x23445,0xe6461, -0x23447,0x00000,0xe6462,0xe6463,0x23431,0x00000,0x00000,0x00000, -0xe3a4a,0x23a63,0xe3a45,0x23a6c,0x23a6b,0x15e60,0x23a64,0xe3a47, -0x15e61,0x15e5f,0xe3a50,0x23a66,0x15e5c,0x23a6a,0xe3a4c,0x23a65, -0x23a67,0x23a61,0x15e5a,0xe6336,0x23a74,0x23a73,0x23a70,0x15e59, -0x15e5d,0x15e5e,0x22e4d,0x23a6d,0x15e5b,0x15959,0x23a6f,0x23a62, -0x23a72,0x23a71,0xe3a4e,0x23a75,0xe3a49,0x24236,0xe3a4b,0x23a6e, -0x00000,0x00000,0x00000,0x00000,0x00000,0xe6337,0x00000,0xe6464, -0x23a69,0x2422e,0x1635b,0x1635e,0x16359,0x2422d,0x24231,0x2422c, -0xe4057,0x16353,0x1635d,0x24229,0x16357,0x24230,0xe405b,0x16355, -0x16354,0x24233,0x16356,0x24235,0xe4056,0x24232,0x16352,0xe405e, -0xe405c,0xe4058,0x1635c,0x24237,0x2422b,0x24234,0xe405d,0xe6343, -0x2422a,0xe405a,0xe4059,0x16358,0xe4054,0x1635a,0x00000,0x2422f, -0x00000,0x24238,0xe4643,0xe463e,0x24944,0x16838,0x2494a,0xe4642, -0xe463c,0x1683d,0x24946,0x2494d,0x2493e,0x1683f,0x16839,0x24943, -0x16c3f,0x24942,0x2494b,0x1683a,0xe463d,0x1683e,0x24941,0x24947, -0x2494c,0x2493d,0x1683c,0x24945,0xe463a,0xe4645,0x24949,0x2494f, -0x2493f,0x24948,0xe4638,0x1683b,0x2494e,0xe4641,0xe4644,0xe4640, -0x24940,0x00000,0x00000,0xe6465,0x16c43,0x24f72,0x16c41,0x16c40, -0x24f74,0x24f79,0xe4b46,0x24f75,0xe4b50,0x24f78,0x16c46,0xe4b51, -0x1702e,0x16c45,0xe4b4b,0x24f71,0x24f77,0xe463f,0x16c44,0x24f76, -0xe4b4d,0x24f73,0xe4b49,0x16c42,0xe4b4f,0xe4b4c,0x00000,0xe4b47, -0x00000,0x00000,0x25657,0xe504a,0x25659,0x25654,0x1704a,0x25656, -0xe504b,0x17049,0x25658,0xe5048,0xe504c,0x1704c,0x2565a,0x1704b, -0x25653,0x25655,0xe5049,0x00000,0x00000,0xe544b,0x1734e,0x25c58, -0xe544c,0x1734d,0x25c59,0x1734c,0x25c57,0x1734b,0x25c56,0x00000, -0x1763f,0x1763e,0x26542,0x26544,0xe5a2f,0x26543,0x1782e,0x1782f, -0xe5a2e,0x00000,0x17830,0x2686e,0x17966,0x00000,0xe5e28,0x26f22, -0x26f21,0x17c5e,0x00000,0x14449,0x14531,0x00000,0xe2343,0x14967, -0xe2545,0xe2543,0xe2544,0xe282d,0x22960,0xe2b77,0x00000,0xe3477, -0x00000,0x15e62,0x15e63,0xe3a52,0x24239,0x16840,0x24950,0x24f7a, -0xe6466,0xe504d,0xe2139,0x2213a,0xe2235,0xe2344,0x22350,0x00000, -0xe2b7a,0xe2b79,0xe213a,0xe2546,0x22623,0x22961,0x22e5b,0x1546e, -0xe4646,0xe6560,0x26545,0x00000,0x17a67,0x1444a,0x14640,0x22151, -0xe2236,0x14768,0x14769,0x00000,0x14c5f,0x00000,0x00000,0xe3479, -0x1595c,0x00000,0x16842,0xe405f,0x16843,0x16841,0xe4b53,0x1444b, -0x00000,0x14532,0x14534,0x14533,0x2213b,0x14535,0x14641,0x22152, -0xe2238,0x14642,0xe2237,0x00000,0xe2239,0x00000,0xe2347,0x1476a, -0x1476b,0x00000,0x00000,0x00000,0x2222b,0xe2549,0x14968,0x00000, -0x22351,0x00000,0x00000,0x00000,0x14c63,0x22624,0x00000,0x14c61, -0x14c62,0x14c60,0x22e5c,0xe282e,0xe282f,0xe6467,0x15058,0x15057, -0x15059,0x15056,0xe2b7c,0x22962,0x14c64,0x15055,0x00000,0x1546f, -0x15470,0x00000,0x15471,0xe347b,0x23450,0xe347c,0xe347d,0x00000, -0x15e64,0x23a76,0x1595d,0xe3a53,0xe3a54,0x00000,0xe4060,0x1635f, -0xe4061,0x16845,0x16844,0x24951,0xe4648,0x16c47,0x1704d,0x00000, -0x2614c,0x26d48,0x26f23,0x1444c,0x14643,0xe223b,0x14644,0x22231, -0x1476d,0x14770,0xe234b,0x2222f,0x2222d,0x1476f,0x22230,0x22232, -0x2222c,0x14772,0x14771,0x1476e,0x1476c,0x2222e,0xe234d,0x00000, -0x00000,0xe2555,0x14973,0x00000,0xe254c,0x14970,0x22356,0x22359, -0x22358,0x00000,0x1496a,0x14972,0xe254b,0x00000,0x1496f,0x22355, -0x22353,0x1496e,0xe2556,0xe2553,0xe254e,0x14969,0x1496c,0xe2551, -0x22354,0x2235b,0x22357,0x1496d,0x14971,0x14974,0x22352,0x2235a, -0x1496b,0x00000,0x00000,0x00000,0xe2841,0xe2833,0x14c69,0x14c71, -0xe2838,0x22630,0x22629,0x14c72,0x22634,0x22625,0x2262c,0xe2845, -0xe2840,0x14c68,0x22626,0x14c66,0x2262d,0x22631,0x14c65,0xe283d, -0x22632,0x2262b,0xe2837,0x2262e,0xe2835,0x14c74,0x14c6b,0x22635, -0x22633,0xe283f,0x14c70,0x14c6e,0x2262a,0x14c6d,0x22628,0x22627, -0x14c6c,0x14c6a,0x14c73,0x14c6f,0x14c67,0xe2c26,0x2262f,0xe2846, -0x1505b,0xe2c2d,0x15062,0x22970,0x1505a,0x22968,0x22964,0xe2c21, -0x22974,0x22963,0xe2c2c,0x1505d,0x2296d,0x15060,0x15063,0xe2c2e, -0x1505e,0x22971,0x15061,0xe2c23,0x15478,0x22977,0x22965,0xe2c24, -0xe2c25,0x22967,0x2296e,0x22972,0x22976,0x22973,0x2296c,0x2296f, -0xe2c2b,0xe2c29,0x22969,0x15065,0x2296b,0x2296a,0x22975,0x1505c, -0x22966,0x15064,0xe2c2a,0x1505f,0xe2c28,0x00000,0x00000,0x00000, -0x00000,0x1547e,0x22e64,0xe3040,0x1547d,0xe2c27,0x00000,0x22e62, -0xe6270,0x15472,0xe304f,0x15477,0xe304a,0x22e61,0x22e5e,0x22e63, -0x15473,0x22e5d,0xe304e,0x15476,0x15474,0xe303e,0x22e65,0x15475, -0x15479,0xe303b,0xe3045,0x1547a,0xe3048,0x1547c,0xe3052,0x00000, -0x00000,0x1547b,0xe303c,0xe3522,0xe3538,0x22e5f,0x22e60,0xe304d, -0x00000,0xe304b,0x00000,0x22e66,0x00000,0x23457,0x1595e,0x23b26, -0x23456,0x23469,0xe3528,0xe3524,0x15964,0xe3531,0x23467,0xe3533, -0x15963,0x1595f,0x23470,0x23460,0x23463,0xe352e,0x15967,0x2346d, -0x23465,0x15960,0x15968,0xe352a,0x2346a,0x23468,0xe352f,0xe353b, -0x23459,0x2346e,0x23462,0x2345d,0xe353a,0x23453,0x2346f,0x2345f, -0x23452,0xe3539,0x15966,0x23464,0x23471,0x23461,0x23455,0x2345a, -0x23451,0xe3527,0x15965,0xe353c,0x2345e,0x2345b,0x15961,0x23454, -0xe3530,0x2346c,0x15962,0xe352b,0x2345c,0x23458,0xe3529,0xe3534, -0x2346b,0xe3532,0x00000,0xe3537,0x00000,0xe3535,0x00000,0x15e65, -0x23a7d,0xe3a75,0x23a7a,0x23b2d,0x23b21,0x23b2e,0xe3a7c,0x15e67, -0xe3a63,0xe3a61,0xe3a58,0x23b2a,0x23b27,0xe3a5b,0xe3a77,0xe3a72, -0xe3a59,0xe3a60,0x23b28,0x23b2b,0x23b2f,0xe3a7b,0x23466,0x23b31, -0x2424d,0xe3a66,0x15e68,0x23b32,0x23a78,0x23b24,0xe3a62,0x23b29, -0xe3a5c,0xe3a5e,0x15e66,0x15e69,0x23b30,0x23b33,0x23a7c,0x23a79, -0xe3a73,0xe3a5a,0x23a7b,0xe3a57,0xe3a7a,0x23b22,0x23a7e,0x15e6a, -0xe3a56,0x23b2c,0xe3a79,0xe3a78,0x23b23,0x00000,0x23b25,0x23a77, -0x24241,0x2423f,0x16368,0x16366,0x24249,0x24240,0x2424a,0x24246, -0x2423e,0x2424c,0x2423d,0x24244,0x16365,0x16364,0x16363,0x24242, -0x24247,0x16360,0x16367,0xe4067,0x2423b,0xe4066,0x24245,0x2423a, -0x24243,0x16361,0x24248,0x2423c,0x16362,0x2424b,0xe4064,0xe3a6b, -0xe406a,0xe6468,0x00000,0xe6469,0x00000,0x24955,0x1684a,0x16849, -0x1684b,0x24961,0x24957,0x2495d,0x24952,0x24960,0x2495f,0x24963, -0x2495c,0x16846,0x2495b,0x1684c,0xe464c,0x24954,0x16847,0xe464a, -0x24962,0x16848,0x24956,0x24959,0x2495e,0x24958,0x24953,0xe464f, -0xe4653,0x00000,0x00000,0x2495a,0x24f7c,0x16c4b,0x25021,0x24f7e, -0x25023,0x25025,0xe4b5c,0x16c49,0xe4b58,0x24f7d,0xe4b54,0x24f7b, -0xe4b5e,0x25026,0x25024,0x25022,0xe4b56,0x25028,0xe4b5a,0x25027, -0x16c4d,0x16c48,0xe4b5b,0x16c4a,0x16c4c,0xe4b5d,0xe4b5f,0x25029, -0x25661,0xe5050,0xe5053,0x25660,0x2565f,0xe5051,0x25662,0x2565b, -0xe504f,0x2565c,0x25664,0x2565d,0xe5054,0x1704e,0x25666,0xe504e, -0x25665,0x2565e,0xe5056,0x25c5d,0x17351,0x25c5b,0x25c60,0x25c5f, -0x25663,0xe5450,0x17350,0xe544e,0x25c5e,0x25c5a,0x25c62,0x25c61, -0x1734f,0xe5452,0x25c5c,0xe544f,0x1704f,0xe5451,0x00000,0xe5453, -0x17640,0xe5a31,0xe5761,0xe575e,0x2614d,0x26546,0x26547,0x26548, -0x17967,0x00000,0xe5c36,0x17968,0xe5c39,0x2686f,0xe5c3a,0x26b56, -0x26b55,0xe5e29,0xe5f42,0x26d49,0x26d4a,0x26f24,0x27035,0xe6073, -0x1444d,0x1444e,0x00000,0x1444f,0x14536,0x14645,0x22233,0x14773, -0x14774,0x00000,0x14977,0x14978,0x14976,0x14975,0x00000,0x14c75, -0xe2848,0x00000,0x22636,0x14c77,0x14c76,0x22637,0xe625c,0xe646a, -0x00000,0x15066,0xe2c2f,0x15521,0x22e67,0x00000,0x23473,0x00000, -0x15969,0x15e6c,0x23472,0x15e6b,0xe4071,0x1684d,0xe4072,0x24964, -0x17050,0xe5057,0x17352,0x25c63,0xe5a34,0x17969,0xe5c3b,0x17b5c, -0xe213b,0x22153,0xe223d,0x14646,0x22154,0x14777,0xe2350,0x14775, -0x14776,0x14778,0x00000,0x1497a,0x14979,0xe255a,0x2235c,0x1497b, -0x00000,0x00000,0x2235d,0x22638,0xe284c,0x22639,0xe284a,0x14c78, -0x14c7a,0x14c7c,0x14c79,0x14c7d,0x14c7b,0xe284e,0xe284b,0xe284d, -0x00000,0x00000,0x1506a,0x15067,0x15069,0x1506b,0x15068,0x22e68, -0x22978,0x00000,0x00000,0xe2c32,0x22e6a,0x22e69,0x15527,0x00000, -0x15523,0x00000,0x00000,0x15524,0x15526,0x15528,0x15525,0xe3057, -0x1552a,0x15529,0x00000,0xe3056,0xe3055,0x00000,0x00000,0x1596e, -0x23475,0x23474,0x1596d,0xe3541,0x1596c,0x1596b,0x1596f,0x1596a, -0xe353f,0x00000,0x23b39,0x23b36,0x15e6e,0x23b35,0x23b3a,0x00000, -0x15e70,0x23b38,0x15e6d,0x15e6f,0x23b37,0xe3a7e,0x2424e,0xe4074, -0x2424f,0x24250,0xe4075,0xe4076,0xe4073,0xe6345,0x1684e,0x16856, -0x24965,0x16850,0x16854,0x24966,0x16855,0x16851,0x16852,0x1684f, -0x16853,0x16c50,0x23b34,0x16c51,0x16c4f,0x00000,0x16c4e,0x25667, -0x17051,0x25c64,0x25c65,0xe5a35,0x00000,0x17831,0x1796a,0xe5e2a, -0x14450,0xe223e,0x14779,0x00000,0x00000,0xe255e,0xe255c,0xe255d, -0xe2850,0x1506c,0x00000,0x22e6b,0x1552b,0xe3058,0xe3059,0x15972, -0x15971,0x15970,0x15e71,0x15e72,0x23b3b,0x16857,0x17052,0x14451, -0x2213c,0x14537,0x22155,0xe624a,0xe223f,0x22234,0x1477a,0x00000, -0xe2352,0xe2851,0x14c7e,0xe2c34,0x00000,0x00000,0xe3b24,0x24251, -0xe4078,0xe6525,0x14452,0x00000,0x14538,0x22235,0x00000,0x00000, -0x2235e,0x00000,0x2235f,0xe255f,0x1497c,0x00000,0x00000,0xe2c35, -0x23b3c,0x15e73,0x00000,0x24252,0x00000,0x00000,0xe5454,0x17353, -0x14453,0x14467,0x14539,0x22156,0x14647,0xe2354,0x14a22,0x14a21, -0x1497d,0x1497e,0x00000,0x00000,0x2263a,0x14d22,0x14d23,0x2263b, -0x14d21,0xe2854,0xe2855,0x15070,0x22979,0x1506f,0x1506d,0x1506e, -0x1552e,0x1552c,0xe305a,0xe305b,0x22e6d,0x1552d,0x22e6c,0xe646b, -0x15522,0x23476,0x00000,0xe3543,0x15974,0x15975,0xe3b26,0xe3b25, -0x15973,0xe3544,0x16858,0x24967,0x16c52,0x16c53,0x00000,0x2502a, -0x17354,0x2614e,0x2614f,0xe5a38,0x17a68,0x27036,0x2212b,0x1453a, -0x00000,0x14454,0x00000,0x22158,0x22157,0x00000,0x00000,0xe646c, -0xe2355,0x1477b,0x22237,0x22238,0x22236,0x00000,0x22239,0x00000, -0xe235a,0x00000,0x00000,0x00000,0xe2561,0xe2566,0x22367,0x00000, -0x22362,0x22364,0x22366,0x22363,0x14a26,0x22360,0xe2562,0x22361, -0x14a23,0x14a24,0x22365,0x22368,0x14a25,0x22369,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0xe2563,0x22649,0xe285d,0x22643, -0x2263e,0x14d25,0x22646,0x22644,0x2263d,0x2264a,0x2264d,0x22648, -0x22641,0x14d27,0x22647,0x14d28,0x22642,0x22645,0x2263c,0x22640, -0x2264c,0x14d29,0x00000,0x14d2a,0xe285e,0x2263f,0x2264b,0x14d24, -0x14d26,0xe285c,0xe285f,0xe2857,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe2858,0x00000,0x00000,0x00000,0x00000,0x22a2c,0x22a25, -0x22a2b,0x22a24,0x22a26,0x2297e,0x2297c,0xe2c3f,0x22a2d,0x22a2a, -0x2297a,0xe2c3b,0x15072,0x22a28,0x22a29,0xe646d,0x22a27,0x2297d, -0x2297b,0x15071,0x22a23,0x22a21,0xe2c3c,0xe2c42,0x22a22,0x22a2e, -0x00000,0xe2c3e,0xe2c41,0x00000,0x00000,0xe2c43,0xe2c3d,0x00000, -0x15533,0xe3063,0x15532,0xe305f,0x22e6e,0x1552f,0x22e70,0xe3064, -0x15534,0x22e71,0x00000,0xe3061,0x15537,0xe3062,0x15535,0x22e72, -0x22a2f,0x22e74,0xe305e,0x15531,0xe6271,0x15530,0xe6272,0x22e6f, -0x22e73,0x15536,0x00000,0x00000,0x00000,0x00000,0x15977,0x15976, -0xe354b,0xe3548,0xe3547,0x23478,0x2347c,0x2347e,0x15978,0x23523, -0xe3551,0x1597c,0x23525,0xe3552,0x1597e,0xe354f,0x1597a,0x15a24, -0xe3555,0x15a21,0x2347a,0x15979,0xe3b2b,0x23479,0x23477,0x23527, -0x2347b,0xe3546,0x1597b,0x23526,0x15a22,0x23522,0x23521,0x15a23, -0x2347d,0x1597d,0xe354e,0x00000,0xe354a,0x00000,0x23528,0xe3554, -0x23524,0x23b4b,0x23b52,0x23b47,0x15e76,0x23b43,0x23b53,0x23b3d, -0x23b50,0x23b4e,0x23b48,0xe3b36,0x23b51,0x23b4a,0xe3b28,0x23b42, -0x23b54,0x23b40,0x23b4d,0x23b3e,0xe3b27,0x23b55,0xe3b37,0x15e77, -0xe3b2a,0x23b4f,0x24255,0x23b41,0x15e74,0xe3b2e,0x23b45,0xe3b34, -0x15e75,0x23b44,0x23b49,0xe3b33,0x00000,0x23b46,0x00000,0xe3b31, -0x00000,0x23b4c,0x00000,0xe3b2d,0x00000,0x00000,0x24259,0x00000, -0xe4121,0x00000,0x2425c,0x24254,0xe407c,0x24256,0xe407a,0x2425b, -0x2425a,0x16369,0x00000,0x23b3f,0x24258,0xe4079,0xe407d,0x1636a, -0x00000,0x24253,0x24257,0x00000,0x00000,0xe646e,0x00000,0x2496e, -0xe465c,0x24975,0x2496c,0xe4654,0x24973,0x2496a,0x24972,0x24976, -0x24969,0x2496d,0x24968,0xe4656,0x16859,0x00000,0x2496b,0x1685a, -0x24971,0x24970,0x2496f,0xe4659,0xe465a,0x24974,0xe646f,0xe4b65, -0xe4b66,0xe4b63,0x2502e,0x25030,0x16c55,0x25031,0xe4b6b,0x2502c, -0xe4b67,0x2502b,0x25035,0xe4b69,0x25033,0x16c54,0x25036,0x2502d, -0x25032,0x25034,0x2502f,0xe4b6a,0xe4b68,0xe6470,0xe5058,0x2566b, -0x25670,0x2566a,0x2566f,0xe505b,0x25668,0x25672,0x2566e,0x25673, -0x2566d,0x25669,0x25671,0xe505a,0x25674,0x2566c,0xe6471,0x25c66, -0x17358,0xe5457,0x17356,0xe5459,0x17355,0x17357,0xe5455,0xe6472, -0x26150,0xe5762,0x2643e,0x26549,0xe5a39,0x00000,0x26870,0x26871, -0xe5c3d,0x1796b,0xe5c3c,0x26b57,0xe5c3e,0x17a69,0x00000,0x26b58, -0xe5e2d,0x26d4c,0x17b5e,0xe5f43,0x17b5d,0x26d4b,0x17c35,0xe6030, -0x26f25,0x00000,0x00000,0xe213c,0x00000,0x14455,0x1477c,0x2223a, -0x2236a,0x14b56,0x15a25,0xe3557,0xe4b6c,0x14456,0x1464a,0x14649, -0x14648,0x00000,0x00000,0x14a27,0x00000,0x00000,0x15538,0x00000, -0x2425d,0x14457,0x14458,0x14459,0x1453b,0xe2567,0xe2860,0x15073, -0x00000,0x22a30,0xe2c45,0xe2c44,0x00000,0x15e78,0x1445a,0x2213d, -0xe2163,0x00000,0x1464b,0x1464c,0x22159,0x00000,0x1477d,0x00000, -0xe235c,0xe2568,0x2236b,0xe256b,0x14a28,0x00000,0x2236c,0x00000, -0x00000,0x14d30,0xe2862,0xe2861,0x2264f,0x14d2e,0x14d2d,0x2264e, -0x14d2b,0x22650,0x14d2c,0x14d2f,0x00000,0x15074,0xe2c46,0x15076, -0x22a34,0x22a31,0x22a32,0x22a33,0x22a35,0x15075,0x00000,0x00000, -0x22e76,0x22e75,0xe3066,0x1553a,0xe3069,0x15539,0xe3068,0xe306a, -0xe3067,0x00000,0xe355b,0x15a28,0x2352a,0xe3559,0x15a27,0x15a29, -0x15a26,0xe3558,0xe355a,0x00000,0x00000,0x15e7a,0x23529,0x00000, -0x15e7b,0x23b57,0xe3979,0x15e7c,0x23b56,0x15e79,0xe3b3a,0xe3b3b, -0xe3b3d,0x00000,0x24260,0x24262,0x1636b,0x24261,0x2425f,0x2425e, -0x00000,0x00000,0xe465d,0x24979,0x1685f,0x1685d,0x00000,0x1685e, -0x24977,0x24978,0xe4b6d,0x1685b,0x2503a,0x25038,0xe4b70,0x16c57, -0x25039,0x16c58,0x16c56,0x1685c,0x00000,0xe6473,0x25677,0x25675, -0x25676,0x25037,0x25c68,0x17359,0x25c67,0x26151,0x26152,0x25678, -0x2654a,0xe6677,0x1445b,0x1464d,0x14821,0x2223b,0x1477e,0xe2863, -0x14d31,0x1636c,0xe213d,0x1453c,0x1464e,0x15077,0x15e7d,0xe213e, -0x2215a,0xe2247,0x2215b,0xe2248,0x2223c,0xe6678,0x00000,0x14a2a, -0x22370,0x2236e,0x14a2b,0x2236d,0x2236f,0x22371,0x00000,0x14a29, -0xe256e,0x00000,0xe256d,0x00000,0x00000,0x14d35,0x14d36,0x14d33, -0xe2865,0xe2867,0x14d32,0x22a39,0x14d34,0xe2868,0x00000,0x00000, -0x15078,0xe2c48,0x22a38,0x22a3a,0x22a37,0x22a3b,0x15079,0x1553d, -0x22e77,0xe306c,0x22e79,0x1553b,0x22e7a,0x1553c,0x22e78,0xe306b, -0x22a36,0x2352b,0x2352e,0x2352f,0x2352c,0x15a2d,0x15a2c,0x15a2a, -0x15a2b,0x2352d,0xe3561,0xe3560,0x00000,0xe3b3f,0x15a2e,0xe3b40, -0xe3b3e,0x15f21,0x15f22,0x00000,0x15f23,0x24263,0x24265,0x24267, -0x1636e,0x1636d,0x15e7e,0x24266,0x24264,0xe6474,0x2497d,0xe4661, -0xe4660,0x2497b,0x24a23,0x16860,0x24a24,0x24a21,0x16861,0x2497c, -0x2497a,0x24a22,0x16c5a,0x2503c,0x2497e,0x16c5c,0x2503d,0x16c5b, -0x16c5e,0x2503e,0x16c59,0x16c5d,0x00000,0x2567d,0x2567b,0x2567a, -0x2567c,0x25679,0xe505c,0x00000,0x17833,0xe6475,0x26872,0x26873, -0xe5c3f,0x26b59,0x26d4d,0x17d22,0xe213f,0xe2361,0x14d37,0x14a2c, -0xe2869,0xe286b,0x1507a,0xe2c4c,0xe2c4b,0xe306e,0x1445c,0x1453d, -/* 0x5f00 */ -0x00000,0x1464f,0x2223d,0xe256f,0x14a2d,0x22372,0xe286d,0x22a3c, -0x1507b,0x00000,0x16862,0x1445d,0xe2164,0xe2249,0xe2362,0x14822, -0x00000,0xe3b42,0x1636f,0x1445e,0x1453e,0x1453f,0x00000,0x14651, -0x14650,0x00000,0x2223e,0x14823,0x00000,0x22373,0xe2571,0x14a2e, -0x00000,0xe286e,0x22652,0x22653,0x22654,0xe2870,0x14d38,0x14d39, -0x22651,0x14d3a,0x00000,0x00000,0x00000,0x1507c,0x22a3d,0xe2c4d, -0x22e7c,0x1553e,0xe306f,0x22e7b,0xe3562,0x15a2f,0x23530,0x15a30, -0x23531,0xe3563,0xe3b47,0xe3b45,0x15f24,0x00000,0xe3b44,0x00000, -0x24268,0x00000,0xe4122,0x24a26,0x24a25,0x00000,0x16863,0x00000, -0x16c5f,0x2503f,0x17053,0x2567e,0x1735a,0xe5763,0x17b5f,0x26f27, -0xe2140,0xe2141,0xe224a,0xe2351,0x22655,0xe2871,0x22a3e,0x15a31, -0x23b58,0x16370,0xe4123,0xe505e,0x00000,0xe5764,0x17641,0x00000, -0xe6164,0xe2142,0x14a30,0xe2572,0x14a2f,0x1507d,0xe2c50,0x22e7d, -0x00000,0x15a33,0x15d29,0x15a34,0x15a32,0x15f25,0xe4124,0x24a27, -0x16864,0x16c60,0xe5f45,0x2212c,0x2223f,0x00000,0x22375,0x14a31, -0x22374,0x14a32,0x00000,0x00000,0x14d3e,0x22658,0x22657,0x14d3d, -0x14d3b,0x14d3c,0x22656,0xe2876,0xe2875,0x15121,0x22a3f,0x15124, -0x1507e,0x15126,0x15122,0x15123,0x15125,0xe6264,0xe3070,0xe3072, -0x15541,0x15540,0x1553f,0xe3071,0xe6476,0x00000,0x23533,0x15a35, -0x15a38,0x15a36,0xe6477,0x23532,0x15a3b,0x00000,0x15a37,0x23534, -0x15a3a,0x15a39,0x00000,0x00000,0x00000,0x23b5a,0x23b59,0xe3b4b, -0x15f28,0x15f26,0x15f27,0x23b5b,0x16371,0x2426a,0x16372,0x24269, -0x00000,0x00000,0x25040,0xe4663,0xe4664,0x16c62,0x24a28,0x16c61, -0xe4b72,0x16865,0xe6478,0x25722,0x25721,0x1735b,0x25c69,0x2654b, -0x26874,0x26875,0xe5e2f,0x14540,0x00000,0x14652,0x00000,0xe224d, -0xe6251,0x2215c,0xe224c,0x00000,0x14a34,0x14a36,0xe2578,0x22242, -0x22378,0x22377,0x22376,0xe2366,0x22241,0x22240,0x14825,0x14a35, -0x14a33,0x14824,0xe2367,0xe2369,0xe2577,0x14d3f,0x22659,0xe257b, -0x14d40,0x2237d,0x00000,0x22421,0x2237e,0x2265a,0xe2576,0xe2574, -0x2237a,0xe287e,0x14a3a,0x14a38,0xe257c,0x22379,0x2237b,0x22423, -0xe2622,0x14a37,0xe2621,0x2237c,0x22427,0x14d42,0xe257d,0x22424, -0x14a39,0xe2623,0x22422,0x22425,0xe257a,0x14d41,0xe2575,0x14d43, -0x22426,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0xe2878, -0xe2922,0x2266e,0x22661,0x2265f,0x2266d,0x22668,0x1512b,0x14d44, -0x22669,0x2266c,0x15127,0x2266b,0x14d45,0x14d4a,0x14d48,0x22662, -0xe6266,0x2265d,0x22664,0x14d4f,0x2266f,0x15128,0x22665,0x00000, -0x15129,0x14d4b,0x22667,0xe2c5a,0x22a4e,0x1512a,0x2265c,0x14d4c, -0x1512c,0x14d4d,0x14d49,0x14d4e,0x22666,0x2265b,0x2266a,0x14d46, -0xe2877,0xe2c5b,0x2265e,0x22663,0x22660,0x14d47,0xe287a,0x22a40, -0x00000,0x22a41,0x00000,0x00000,0x00000,0xe2921,0x00000,0x00000, -0x22a4b,0x22f23,0x22a4c,0x15132,0x22a4f,0x22a45,0x15131,0x22a47, -0xe6267,0x22a48,0xe2c60,0xe3079,0x22a4a,0x1512d,0xe2c56,0xe3073, -0x15545,0xe2c57,0xe2c5d,0x22a46,0x22a42,0x15546,0xe307e,0x00000, -0x22a50,0x15542,0x22f21,0x22a49,0xe2c54,0x22e7e,0x22a44,0x22a4d, -0xe2c5f,0xe2c61,0x15130,0x15543,0x15136,0x15544,0x22a51,0x22f22, -0x1512f,0x15548,0x15135,0x15134,0x15133,0x15547,0x22a52,0x15549, -0x1512e,0x00000,0x22a43,0xe307a,0xe3078,0xe307b,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0xe2c5c,0x00000,0xe3076,0x15a3c, -0x22f26,0x22f28,0x00000,0x22f2a,0x1554a,0x15550,0x23537,0x22f2e, -0x22f25,0x15a3e,0x23535,0xe3122,0x1554f,0x1554d,0x22f30,0x00000, -0x23536,0x00000,0x22f27,0xe3125,0x1554e,0x22f2b,0x15551,0x22f2d, -0xe3568,0xe3074,0x1554c,0x22f2c,0x22f2f,0x22f29,0xe3127,0x1554b, -0x15a3f,0xe3571,0x22f24,0x15a3d,0xe3572,0x00000,0xe3123,0xe3128, -0x15a40,0xe3121,0xe356f,0x00000,0x00000,0x00000,0xe3126,0x00000, -0x23539,0x23542,0x15f2b,0xe3b54,0x15a42,0x15a47,0x15f2c,0x23544, -0x15a4e,0x23b5d,0x2353a,0x15a46,0x15a49,0x15a44,0x23538,0x23546, -0x23549,0x23b6c,0x00000,0x23547,0x23b61,0x15a45,0x15a4c,0x15a50, -0x23541,0x23b5c,0x23545,0x15a41,0x23b5e,0x23548,0x23b60,0x2353d, -0xe356a,0x15f29,0xe3b56,0x2353b,0x2353c,0x15a4b,0xe3b55,0xe356e, -0x15a4a,0x2353f,0x15a4f,0x23543,0x15a48,0x23540,0xe3579,0x15a4d, -0x15f2d,0x15f2a,0x23b5f,0xe3b58,0x2353e,0xe3b59,0x15a43,0xe3576, -0x00000,0xe3b5a,0xe3b4d,0x00000,0x00000,0x00000,0xe3574,0x00000, -0x15f32,0x15f36,0x23b63,0x16377,0x15f34,0x23b67,0x15f38,0x2426b, -0x23b69,0x16379,0x15f30,0x15f33,0x23b6a,0xe3b5e,0x23b6b,0x23b71, -0x15f3a,0x1637a,0x00000,0x23b6d,0x23b72,0x23b66,0x16426,0xe3b4f, -0x1637b,0x15f39,0x23b64,0x23b73,0xe3b51,0x16425,0x15f37,0x16374, -0x23b70,0xe3b5d,0x15f3b,0x23b68,0x23b62,0x15f31,0x23b65,0x00000, -0x23b6e,0xe412b,0x16373,0x16378,0x15f2e,0x23b6f,0xe3b61,0x16376, -0xe3b62,0xe3b63,0xe3b50,0x15f2f,0x00000,0xe6479,0x00000,0x16424, -0x24a2a,0x24276,0xe4129,0x2426e,0x24a29,0x00000,0x24272,0x24274, -0xe4127,0xe412c,0x24271,0xe466f,0x16423,0x00000,0x24270,0x16427, -0xe466e,0x00000,0xe4128,0x24a39,0xe466c,0xe412e,0x16422,0x16867, -0x24277,0x24a2b,0xe466d,0xe412a,0x1637e,0x2426f,0x24273,0x16866, -0x16375,0x2426c,0x2426d,0x16868,0x1637d,0x16421,0x1637c,0x24275, -0xe647a,0x00000,0x24a2f,0x24a30,0x24a35,0x16c67,0x24a3c,0xe4b73, -0x1686e,0xe4b7e,0x1686d,0x24a37,0xe4b74,0x16c66,0x24a2c,0x1686c, -0xe4671,0x24a3b,0x1686a,0x1686b,0xe4b7c,0x24a38,0x25051,0x16c64, -0x15f35,0xe4672,0x24a3a,0x16c6b,0x24a32,0x00000,0x16c65,0xe466a, -0x16c6a,0x24a2d,0x24a31,0x24a2e,0x24a34,0x1686f,0x16c63,0x16869, -0xe4c21,0x25043,0x24a36,0xe4668,0x16c69,0xe4673,0x16c6c,0x00000, -0x24a33,0xe466b,0x16c68,0x25042,0x00000,0xe4c23,0xe4674,0xe4c24, -0xe4b77,0x25047,0x17057,0x25041,0x2572e,0x25050,0x16c70,0xe4b7a, -0x16c6e,0x17055,0x2504d,0x25049,0x16c74,0xe4b76,0x25725,0xe5068, -0xe4c28,0xe5067,0x16c72,0x25048,0xe4c29,0x25723,0xe4c25,0x2504c, -0x00000,0x2504f,0x25046,0xe4b79,0x16c73,0x00000,0xe4b75,0x16c6d, -0x25724,0x17056,0x2504e,0x16c6f,0x16c71,0x2504b,0x16c75,0x2504a, -0x25045,0x25044,0x17054,0x25052,0x25727,0x25c6b,0x17059,0xe5061, -0x2572d,0xe5063,0x2572b,0xe506a,0x25c6c,0xe5064,0x1705a,0x2572c, -0xe5066,0x25729,0x1735d,0x25c6a,0xe506c,0x25726,0x25728,0x1735e, -0x1705c,0x1735c,0x1705b,0x17360,0x2572a,0x17058,0xe5062,0xe5065, -0xe506b,0x00000,0x00000,0xe6679,0x00000,0x00000,0x2615b,0x00000, -0x26153,0xe5461,0xe545f,0xe545c,0xe545e,0xe545d,0x25c72,0x26154, -0x25c6e,0x00000,0xe545b,0x17642,0x25c70,0x25c6f,0x1735f,0x25c6d, -0x25c71,0x2615c,0x26158,0x2615a,0x00000,0x26155,0x26156,0x00000, -0x26159,0x26157,0x17834,0xe5765,0x00000,0x17837,0x17836,0x17835, -0x1796c,0x26876,0x1796d,0x2654c,0x17a6a,0x26b5a,0x17a6b,0x17b60, -0x17c36,0x26f28,0xe5f46,0x26f29,0x26f2a,0xe613e,0x00000,0x2722a, -0x14541,0x2215d,0x14653,0x00000,0x14827,0x14828,0x14826,0xe236b, -0x14829,0x14a3c,0x14a3b,0xe2625,0x22670,0x14d51,0x14d50,0x00000, -0xe2c63,0x22f31,0x15a51,0x15a52,0x00000,0x00000,0xe3b64,0x15f3c, -0x24278,0x16428,0x16429,0x2427a,0x2427c,0x2427b,0x00000,0x24a3e, -0xe4676,0x24a3d,0x16870,0x24a3f,0xe4675,0x25053,0x16c76,0xe4c2c, -0x1705d,0xe506d,0x17361,0x17643,0x17362,0xe5f48,0x14542,0xe2165, -0xe2166,0xe224e,0x22428,0xe2628,0xe2629,0x22671,0x14d53,0x14d52, -0x14d54,0x15137,0x22a53,0x22a54,0x00000,0xe3129,0x22f32,0x15552, -0x15a53,0x15f3d,0x23b74,0x14543,0x00000,0x1445f,0x14544,0xe2250, -0x2215e,0x14657,0x14656,0x14654,0x14655,0x00000,0x00000,0xe236f, -0x1482c,0x22249,0x2224b,0x1482b,0x22243,0xe236c,0x22244,0xe236d, -0x2224a,0x22246,0x22248,0x1482a,0x22245,0x2224c,0x22247,0xe236e, -0x00000,0x00000,0x00000,0x00000,0x00000,0x14a43,0x14a4c,0x14a4a, -0x22432,0x2242f,0x22437,0x14a48,0x22438,0xe2639,0x14a41,0x22435, -0xe262e,0x14a47,0x22431,0x22430,0x14a45,0x22436,0x14a46,0x14d55, -0x14a40,0x22433,0xe262a,0x22429,0x14a3d,0xe2637,0x14a50,0x2242e, -0x22434,0x14a42,0x14a44,0xe262f,0x2242a,0xe2636,0x2242b,0x2242c, -0x00000,0x14a4f,0x14a49,0x14a4e,0x2242d,0x14a4d,0x14a3f,0x14a3e, -0x14a4b,0xe2635,0x00000,0xe2633,0xe2634,0xe2638,0xe2631,0x00000, -0x00000,0x00000,0x00000,0xe647b,0x00000,0xe2632,0xe2931,0xe292a, -0x14d63,0x2267d,0x22676,0x14d5e,0x14d71,0x22672,0x22679,0x2267b, -0x2267e,0x14d6c,0xe2926,0x2267a,0x22673,0x14d6a,0x22677,0xe2928, -0x22721,0x14d5b,0xe2925,0x2267c,0x14d65,0x14d64,0x22675,0x14d59, -0xe2934,0xe2932,0x14d5a,0x00000,0x14d58,0xe2933,0x14d70,0x14d68, -0x14d62,0x14d56,0x22678,0x14d61,0x14d57,0x14d69,0x14d72,0x22a55, -0x14d66,0x22674,0x14d5c,0x14d5f,0x14d60,0xe292e,0x14d6e,0x14d6f, -0x14d6d,0x14d67,0x14d6b,0x14d5d,0x15138,0xe2930,0xe2937,0xe2935, -0xe2936,0xe292f,0x00000,0x00000,0xe2929,0x00000,0x00000,0x00000, -0x00000,0x00000,0xe2c6d,0x22a5b,0x15144,0x1513c,0x1513e,0x15143, -0x22a67,0x15141,0x22f33,0x15553,0x15146,0x22a58,0x22a60,0x15142, -0x22a5f,0x22a5c,0x22a64,0x22a66,0x1513b,0x1513f,0x15145,0x15555, -0x22a61,0x1513d,0x15148,0x22a5a,0xe2c6f,0xe2c70,0x00000,0x15140, -0x15554,0x1513a,0x00000,0x22a57,0x22a5e,0x22a56,0x22a59,0x22a5d, -0x22f34,0x15147,0x00000,0x22a62,0x22a63,0x22a65,0x15139,0xe2c6c, -0x00000,0xe3132,0x00000,0xe3133,0x00000,0x00000,0x00000,0xe2c6b, -0x00000,0xe2c6e,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x15563,0x22f40,0x15561,0x15562,0x22f36,0x22f46,0xe312c,0x15558, -0xe312f,0xe3135,0x2354a,0x22f48,0x22f42,0xe3138,0x22f39,0xe3137, -0x22f4b,0x22f3c,0x1555e,0x23561,0x22f3f,0x15560,0x15557,0xe313c, -0x22f4d,0x22f41,0x1555a,0x22f3a,0x22f37,0x22f38,0x1555b,0x22f47, -0x22f4e,0x1555d,0x22f3e,0x22f3d,0x15565,0x15564,0x15556,0x1555c, -0x1555f,0x22f4a,0xe312e,0xe3139,0x22f44,0x15559,0x22f35,0x22f4c, -0x22f43,0x22f45,0x22f49,0xe3130,0xe313b,0xe3136,0x00000,0x00000, -0xe647c,0x00000,0x00000,0x00000,0xe647d,0x2354b,0xe3631,0x15a5b, -0x15a6f,0x15a6e,0xe3627,0x15a63,0xe3629,0x2355d,0x23559,0x23556, -0x23568,0x15a5e,0x15a56,0xe3626,0xe3632,0x2355b,0x15f4d,0x15a5a, -0x23563,0xe3622,0x15a70,0x15a6d,0x2355f,0x2354e,0xe357c,0xe362b, -0x15a6c,0x23565,0x2354d,0x15a61,0x15a65,0x23564,0xe3623,0x23557, -0x15a66,0x15a60,0x2354c,0xe357d,0x15f3f,0x23567,0x23555,0x15a6b, -0x23558,0x23566,0x15a6a,0xe3624,0x23b75,0x00000,0x15a57,0x23553, -0x15a5c,0x15a67,0x00000,0x15a62,0x2355c,0x23552,0x23550,0x23562, -0x15a54,0x15a68,0x15a58,0x15f3e,0x23560,0x15a59,0x00000,0x15a55, -0x15a64,0x15a5f,0x15a5d,0x23554,0x15a69,0x23551,0x2355e,0x2355a, -0x23b77,0x23b76,0xe362d,0x00000,0x00000,0x00000,0xe647e,0x00000, -0x00000,0x00000,0xe362e,0x00000,0x00000,0x2354f,0x23c29,0xe3b71, -0x15f41,0xe3b70,0x23c2f,0x23b7c,0x23c2c,0x2427d,0x15f44,0x23c30, -0x23c33,0x15f43,0x23c21,0x23c32,0x23c31,0x15f45,0x23b78,0x15f40, -0x15f48,0xe3b73,0x15f46,0x23c2e,0x00000,0x23c24,0x15f4a,0x23c35, -0x23c2d,0x23c36,0x15f52,0x15f50,0x23c2b,0x23c2a,0xe3b67,0x23c28, -0x23c22,0x15f49,0xe3b66,0x15f47,0x22f3b,0x23b79,0xe3b68,0x2433d, -0x23b7a,0x15f42,0x15f4f,0x24321,0x00000,0x15f4b,0x15f4c,0x23b7b, -0x23c34,0x2427e,0x23c25,0x23b7e,0x15f4e,0x23c26,0x23c23,0xe3b72, -0xe3b6d,0x15f53,0xe6339,0x00000,0x00000,0x00000,0xe3b6f,0x00000, -/* 0x6400 */ -0x00000,0x00000,0x00000,0xe6521,0x00000,0x00000,0x16438,0xe4149, -0xe4132,0x24324,0x24337,0x2433c,0x24330,0x16434,0x24341,0x16431, -0x24322,0xe413a,0x24323,0x1642a,0x16433,0x2432a,0x16436,0x16437, -0x2432b,0xe4138,0x24338,0x2433e,0x16432,0xe413e,0x1642c,0x24329, -0x24325,0x24340,0x2432e,0x2432f,0x24326,0x2433a,0x24331,0x2433b, -0x24333,0xe413d,0x1642d,0x24a40,0x16430,0x1642e,0x2433f,0x24336, -0x24332,0xe4136,0xe4133,0x24327,0x1687a,0x24335,0x16435,0x2432d, -0xe4134,0x2432c,0xe4148,0xe4725,0xe4142,0x1642f,0x1642b,0x24a55, -0x24339,0x24334,0x00000,0x24328,0x00000,0x00000,0xe4144,0xe4145, -0x00000,0xe6676,0x00000,0x24a50,0xe4678,0x24a41,0x24a4c,0xe4728, -0x24a53,0x16878,0x15f51,0x24a51,0x16873,0xe467e,0xe4724,0xe467a, -0x16872,0x24a58,0x00000,0x24a42,0x24a4f,0x24a43,0x24a4e,0x16876, -0x24a52,0x23c27,0xe4721,0x00000,0xe472a,0x24a59,0x24a4a,0x16879, -0x25061,0x16c77,0xe4723,0x24a57,0x24a56,0x1687b,0x25054,0x16c78, -0x25055,0xe4722,0x24a46,0x24a47,0x24a44,0x24a49,0x24a45,0x24a5a, -0x16875,0x16c79,0x16877,0x1687c,0xe467b,0x24a48,0xe4729,0x24a54, -0xe4c2d,0xe4726,0x24a4d,0xe4c35,0x00000,0x25058,0xe4c38,0x16871, -0x16c7c,0x25735,0x2505d,0x2505c,0x2505e,0xe4c30,0xe4c2f,0x2505b, -0x16c7d,0xe4c3b,0x16d25,0x16d22,0xe4c31,0x16d23,0x25056,0x25059, -0x25063,0x16d2b,0x16d29,0xe4c2e,0x2505a,0x23b7d,0x16c7a,0x25060, -0x25057,0xe4c3e,0x16d2c,0x2505f,0x16874,0x16d21,0x24a4b,0xe4c3f, -0xe4c34,0x16d24,0xe4c3d,0x16d28,0x16d2a,0x16d27,0x16d26,0xe4c3a, -0x16c7e,0x25062,0x16c7b,0x16d2d,0xe4c39,0x00000,0xe6522,0x00000, -0x00000,0xe4c37,0x00000,0x17061,0x17062,0x25734,0x1706b,0x17068, -0xe5070,0x1705f,0x17066,0x25736,0x17064,0x1705e,0xe4c32,0x17065, -0xe5077,0x25733,0x17364,0x17060,0x00000,0x17067,0x17363,0x25732, -0x25731,0xe5076,0x17069,0xe506f,0x1706a,0xe5079,0x25730,0x2572f, -0x17365,0x25739,0x17063,0x25737,0xe5075,0x00000,0x00000,0xe5464, -0x17366,0xe5467,0x1736b,0x25c75,0x25c77,0xe576b,0x17368,0xe576d, -0x25c78,0x25c74,0xe576c,0x25c76,0x17369,0x1736c,0xe5469,0x25c73, -0x17367,0x1736a,0x17645,0x25738,0x17644,0x00000,0xe576a,0x1764a, -0x26160,0xe5770,0x17648,0x17649,0x26163,0x2615f,0x17646,0x2615d, -0x17838,0x26161,0x00000,0x26162,0x2615e,0xe576e,0x17647,0x2654d, -0xe5a3b,0x26550,0xe5a3c,0xe5a3a,0x26551,0x2654f,0x26552,0x17839, -0x2654e,0xe5e31,0x00000,0x2687a,0x1796f,0x26879,0x26878,0x26877, -0x1796e,0x17970,0xe6523,0x26b5b,0x17a6d,0x17a6c,0xe5f4a,0xe5f4b, -0x26d4f,0x26d4e,0x26d51,0x17c37,0x17b61,0x26f2c,0x26d50,0xe5f49, -0xe6032,0x26f2b,0x17c39,0x17c38,0x17c5f,0x27037,0x2707d,0x14545, -0x00000,0xe2c72,0x23c37,0x2573a,0xe2167,0xe2168,0x1482d,0x2224d, -0x14a53,0x14a51,0x00000,0x14a52,0x00000,0x22722,0x14d73,0x15149, -0xe2c74,0x22a68,0xe2c76,0x22a69,0xe2c73,0x1514a,0x22f50,0x00000, -0x15566,0x15567,0x22f4f,0xe313d,0x00000,0xe3637,0xe3636,0x15a77, -0x00000,0x15a73,0x00000,0x23569,0x15a7a,0x15a79,0x15a72,0x15a75, -0x15a78,0x15a74,0xe3634,0x00000,0x23c3b,0x15a71,0x15f54,0xe3b74, -0xe3b75,0xe3b76,0x15f56,0x15f57,0x23c3a,0x23c3d,0x15f55,0x23c38, -0x23c3c,0x00000,0x23c39,0xe414b,0x16439,0xe414e,0xe6346,0x24342, -0xe414d,0xe4730,0x1687d,0x24a5b,0x1706c,0x16d2e,0x25064,0x16d2f, -0x16d30,0x25066,0x25065,0x25067,0x2573c,0x00000,0x00000,0x2573b, -0x25c7a,0x25c79,0x1736d,0x1736e,0x26553,0xe5c41,0x00000,0x14546, -0xe2558,0xe2939,0x00000,0xe3140,0x23c3e,0xe3638,0xe3639,0x00000, -0x15f59,0x15f58,0x24343,0x00000,0x26164,0x17a6e,0x26f2d,0x14547, -0x00000,0x15568,0xe3142,0x15a7c,0x15a7b,0x23c3f,0x23c40,0x1643a, -0x24a5c,0x1687e,0x2573d,0x00000,0x14548,0x14658,0xe293b,0x14d74, -0x22723,0x00000,0x22a6a,0x1514b,0x15a7d,0xe363a,0x23c41,0x15f5a, -0x1643b,0x00000,0x25068,0x25069,0x00000,0xe546b,0x25c7b,0x1764b, -0x2707e,0x14549,0xe293c,0x22724,0x14d75,0x1514c,0xe2c77,0x22a6b, -0x00000,0x15569,0x22f54,0x22f52,0x22f53,0x1556a,0x22f51,0xe363c, -0x00000,0xe363f,0xe363d,0x15b21,0x15b22,0x2356a,0x15b23,0x15a7e, -0x23c42,0xe3b79,0x23c43,0x24344,0x00000,0x00000,0x16922,0x16921, -0x00000,0x00000,0x25c7c,0x26165,0xe5a3f,0x26555,0x26554,0x2687b, -0xe2169,0x2213e,0x1514d,0xe3641,0xe4150,0x1454a,0x14659,0xe2251, -0x1482f,0x1482e,0xe2373,0xe2372,0x14830,0x14831,0x2224f,0x2224e, -0x22439,0x14a54,0x2243c,0x2243b,0x2243a,0x2243d,0xe263d,0x00000, -0x00000,0xe625e,0x14d76,0x2272a,0x22726,0x2272f,0xe2943,0xe293e, -0x14d7d,0xe2942,0x14d7b,0x2272b,0x22727,0x2272e,0x14d7a,0x14e23, -0x22729,0x22725,0x14e22,0x2272c,0x14d79,0x2272d,0x14d7c,0x14d7e, -0x22731,0x22730,0x22728,0x14d78,0x14d77,0x14e21,0x00000,0xe2940, -0xe2941,0x00000,0xe2c7e,0xe2c7a,0x22a70,0x22a76,0xe2d23,0x15153, -0x15150,0x22a6d,0x22a72,0xe2c7c,0x15156,0x1514e,0x22a71,0x15151, -0x15154,0xe2c79,0x00000,0x22a74,0xe2c7d,0x1514f,0x22a79,0x15152, -0xe2d21,0x15155,0x22a6e,0x22a73,0x22a77,0x22a6f,0x22a6c,0xe2d24, -0xe2d25,0x22a78,0x22a75,0xe2d22,0xe2c37,0x00000,0x00000,0x00000, -0xe3146,0x15572,0x1556b,0x1556e,0xe314c,0x15571,0xe3144,0x22f57, -0xe3149,0x1556c,0x22f55,0xe3148,0x15570,0xe314d,0xe3145,0x1556d, -0xe3143,0x22f58,0x1556f,0x00000,0x00000,0x00000,0x00000,0xe3642, -0x00000,0x2356e,0x15b25,0x2356d,0x2356f,0x15b24,0x15b29,0x22f56, -0xe314b,0x2356c,0x23570,0xe3644,0x15b26,0x2356b,0x15b28,0xe3645, -0x15b27,0xe3c26,0x23c4a,0xe3b7d,0x23c45,0xe3c25,0x15f5b,0x15f5f, -0x15f5c,0x23c48,0x23c4b,0xe3c23,0x15f5d,0x00000,0x15f5e,0x15f63, -0x2434d,0x23c49,0x15f61,0x23c46,0x23c44,0xe3b7c,0x15f62,0xe3b7e, -0x23c47,0xe3c24,0x00000,0x00000,0x16441,0x00000,0x24345,0x1643e, -0x1643f,0x1643d,0x2434a,0x24349,0x24346,0x16443,0xe415b,0xe4156, -0x24348,0x15f60,0xe4159,0xe4151,0x2434c,0x24347,0x16440,0x1643c, -0x16442,0x2434b,0xe4734,0x00000,0xe4735,0x16925,0x00000,0x24a5f, -0x24a5e,0x24a5d,0x16923,0x00000,0xe4739,0xe4733,0xe4737,0x00000, -0x16924,0x2506c,0x2506f,0x16d32,0xe4c44,0xe4c46,0x16d31,0x25070, -0x2506b,0x16d34,0x2506d,0xe4c41,0x16d33,0x2506a,0xe4c40,0x2506e, -0x17072,0x1706f,0x25746,0x25745,0xe4c43,0x25744,0x2573f,0xe507d, -0x25740,0xe5123,0x00000,0xe507a,0x17070,0xe507e,0x1706d,0x17071, -0x2573e,0x1706e,0x25741,0x25742,0x25747,0xe5122,0xe5471,0x25743, -0xe546f,0xe5470,0x25c7d,0x00000,0xe546c,0xe546d,0x17370,0xe5472, -0x26168,0x1736f,0x26166,0x26167,0x1764c,0x1783b,0x26556,0xe5a43, -0x1783a,0xe5a42,0xe6526,0x2687d,0x2687e,0xe5c42,0x17971,0xe5c43, -0x2687c,0x17a6f,0x00000,0x26f2e,0x17c3a,0x27038,0x27039,0xe613f, -0x1454b,0x00000,0x14832,0x14833,0x14a55,0xe2641,0x22732,0x15157, -0x15573,0x15b2a,0x00000,0x00000,0x15937,0x00000,0x15f64,0x15f65, -0x15e32,0x23c4c,0xe6527,0x16444,0x24a61,0x24a60,0xe5124,0x00000, -0x1454c,0x14834,0x22733,0x14e25,0xe2945,0x14e24,0xe2d27,0x22a7a, -0x22a7b,0xe6632,0x22f59,0x22f5a,0x15574,0x15575,0xe3648,0x15576, -0x23571,0xe3647,0xe3646,0x15b2c,0x00000,0x15f67,0xe3c29,0x15f66, -0x2434e,0x24641,0x24a62,0x25748,0xe5126,0xe6633,0x1764d,0x17972, -0x1454d,0x00000,0x1465c,0x1465d,0x1465b,0x1465e,0x1465a,0xe2252, -0x00000,0x14837,0xe2377,0x22257,0x14836,0x14838,0xe2378,0xe2375, -0x22252,0x22251,0x22254,0x22253,0x22256,0x14835,0x22250,0x22255, -0x00000,0x00000,0x00000,0x00000,0xe2648,0x2243e,0x14a5f,0x2243f, -0x22443,0x14a5e,0xe2649,0x22447,0x22442,0x22445,0x14a57,0x14a58, -0x14a59,0x14a5a,0xe2645,0x14a61,0xe2644,0x22441,0x14a5c,0x14a62, -0xe2647,0x22440,0x22446,0xe2642,0x14a5b,0x22444,0x14a5d,0x14a56, -0x14a60,0xe264a,0x00000,0x00000,0x00000,0xe6257,0x00000,0x00000, -0x00000,0x00000,0x14e3a,0xe2947,0x22735,0x14e26,0x00000,0x14e30, -0x14e31,0x14e29,0x14e3b,0x14e2b,0x2273d,0x14e36,0x22738,0x14e2c, -0x22747,0x22748,0x22740,0x22739,0x14e39,0x22745,0x14e34,0x14e32, -0xe2952,0x22746,0xe2949,0x22744,0x2273c,0x22734,0x2273b,0x14e2d, -0xe625f,0x14e33,0xe294a,0x14e27,0x2273f,0x2273e,0x22736,0xe294f, -0x14e35,0x22742,0x22737,0x14e38,0x22749,0x14e28,0xe2948,0x14e2f, -0x2273a,0x22743,0x14e37,0x00000,0x14e2a,0x14e2e,0x00000,0x22741, -0x00000,0x00000,0xe294e,0xe294c,0xe6528,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0xe6529,0x00000,0x22b3d,0x1515f, -0x1516c,0xe2d36,0x22b38,0x22b2e,0x15165,0x22b2c,0x1515e,0x22b27, -0x15168,0x22b34,0x22b21,0x22b23,0xe2d2e,0x00000,0x00000,0xe2d30, -0x22b26,0x22a7c,0x22b33,0x22b43,0x15163,0x22b28,0x22b3a,0xe2d2d, -0x22a7e,0x22b41,0x22b42,0x22b45,0x22b3c,0x22b2d,0x22b35,0x15169, -0x1515c,0x15164,0x15170,0x15159,0x1515b,0xe2d31,0xe2d2b,0xe2d3a, -0x22b25,0x1516d,0x15166,0x22b3f,0x22b22,0x1516f,0x1516a,0x22b2b, -0x00000,0x00000,0x1516e,0x22b32,0x22b2a,0x15167,0x22b3e,0x22b36, -0xe2d2a,0x15161,0x22b44,0x22b29,0x1515d,0x22b3b,0x22b31,0x15162, -0x22b37,0x1515a,0x22a7d,0x1516b,0x15627,0x15160,0x22b30,0x22b2f, -0x22b24,0xe2951,0x22b40,0xe2d34,0x22b39,0x00000,0xe2d32,0x15158, -0xe2d39,0xe2d37,0x00000,0x00000,0x00000,0xe2d38,0xe652b,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0xe652a,0x00000,0x22f6e,0x1562e,0x22f6f,0xe315d,0x22f63,0x15623, -0x1562f,0xe3157,0x22f5c,0xe3153,0x22f65,0x22f6d,0xe315b,0x22f5b, -0x22f76,0x15577,0xe315e,0xe3164,0xe3150,0x22f75,0x22f70,0xe315f, -0x22f71,0x15621,0x1562c,0x22f67,0xe3156,0x22f68,0x22f72,0x22f69, -0xe3163,0x22f64,0x22f5e,0x22f5f,0x22f6c,0x22f66,0xe3154,0xe314f, -0x15578,0x1557c,0x22f74,0x22f60,0x1562a,0x15626,0xe315a,0x00000, -0x15629,0x15630,0x1557d,0x1562b,0x22f6b,0x1562d,0x1557a,0xe3159, -0x15579,0x22f5d,0x00000,0x22f61,0x15624,0x22f73,0x22f6a,0x22f62, -0x15628,0x15625,0xe2d2f,0x1557b,0x1557e,0xe3162,0xe3158,0x00000, -0xe3161,0xe3160,0xe652d,0x00000,0x00000,0x00000,0xe652c,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x23628,0xe3655,0x23576,0x23577,0x2357b, -0xe3660,0x2362c,0x23629,0xe364e,0x23622,0x23621,0x15b33,0x23625, -0x23634,0x23572,0xe365b,0x23635,0x23627,0x23639,0x2362d,0x15b32, -0x2362b,0x15b2d,0x15b42,0x15b38,0xe3657,0x15b3c,0x15b3b,0x23573, -0x00000,0x23632,0x23638,0x23630,0x23637,0x00000,0xe3651,0x23624, -0x23574,0x23636,0x23626,0x15b30,0x15b3d,0xe365a,0x2362f,0x15b36, -0xe364d,0xe365c,0xe3650,0x2362e,0x23575,0x15b3e,0xe364b,0x15b40, -0x23631,0x15b41,0x15b2f,0x2357c,0x23633,0xe3654,0xe3478,0x15b35, -0x15b3f,0x2357e,0x2362a,0x23579,0x2357d,0x15b3a,0x23578,0x15b2e, -0x15b37,0x15b34,0x23623,0x15622,0x23c63,0x15b31,0xe364c,0xe3652, -0xe365e,0xe365f,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe3656,0x00000,0xe3c45,0x15b39,0xe3c41,0x23c66,0x23c7c, -0x23c71,0x15f7b,0xe3c38,0x15f76,0x23c60,0x15f77,0x23c70,0xe3c3e, -0x23c69,0x23c76,0x15f73,0x23c4e,0x23c78,0x15f69,0x23c56,0x15f6c, -0x15f6b,0x00000,0x15f7c,0xe3653,0x23c50,0x23c72,0x23c73,0x15f6e, -0x15f6a,0x23c5e,0xe3c3d,0x15f75,0x23c59,0xe3c32,0x23c74,0x15f71, -0x23c6c,0x23c79,0x23c53,0x23c58,0x23c52,0xe3c2a,0x15f70,0x23c65, -0x24364,0x23c54,0x15f74,0x23c5d,0x23c75,0x15f6f,0x23c5a,0x23c57, -0x23c68,0x15f72,0x15f68,0x15f7e,0x23c6b,0x23c6a,0xe3c31,0xe3c42, -0xe3c39,0xe3c3b,0xe3c34,0xe3c2f,0x23c4f,0x15f6d,0x23c77,0x23c5f, -0x23c61,0xe3c37,0x23c6e,0x23c6d,0x23c4d,0x15f78,0x15f7a,0x23c55, -0x23c5c,0x23c64,0x15f79,0x23c5b,0x23c67,0x23c7a,0x00000,0x23c6f, -0xe3c3c,0x00000,0x00000,0x00000,0xe3c44,0x00000,0xe3c33,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x23c7b,0x00000,0x00000, -0x00000,0xe652f,0x23c51,0x00000,0xe652e,0x00000,0xe3c40,0x24378, -0x1644c,0xe4165,0x24376,0x24361,0x24366,0x2435f,0xe4177,0x24372, -0x24351,0x24358,0x00000,0x24370,0x2437a,0x24362,0xe4168,0x24355, -0x24368,0x2436d,0x24359,0xe416b,0x2436a,0x24356,0xe415d,0xe4175, -0x2435d,0x2435e,0x1644e,0x24371,0x2436f,0xe4173,0x24352,0x24374, -0xe4174,0x24375,0x24377,0x16452,0x1644a,0xe416f,0x2357a,0x2435a, -0x2436c,0x2435b,0x16447,0x16457,0x24373,0x16455,0x16451,0x24350, -0x16449,0xe4179,0x24353,0x16456,0xe4178,0x24363,0x2434f,0xe4176, -0x1644f,0x24367,0x24357,0x16450,0x24360,0x16446,0x15f7d,0x24369, -0x23c62,0x24354,0x00000,0xe416d,0x2436e,0x1644b,0x2436b,0x16448, -0x24365,0x16453,0x2435c,0x24379,0xe416a,0xe417b,0x00000,0x00000, -0x00000,0x00000,0x1644d,0x2452c,0x00000,0xe4172,0x16454,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x24a70,0x24a6e,0xe473a, -0x24b26,0x24a6c,0xe473d,0x24a7e,0x16445,0x16928,0x24a68,0x24b25, -0xe4751,0x24a6d,0x24a7b,0x1692d,0x16926,0xe474e,0x24b23,0xe4746, -0x24a66,0x24b22,0xe4747,0x16938,0x24a77,0x24b29,0x16936,0x24a6f, -0x16927,0x24a71,0x24b21,0x16930,0x24a6a,0x16934,0x1692a,0x24a73, -0x24a69,0x24a63,0xe473e,0x24a7d,0x16931,0x24b28,0x24a64,0x1692e, -0x00000,0x24a79,0xe6352,0x1692f,0x24a6b,0x24a76,0x24a72,0x24a74, -0xe4743,0x16929,0x24b27,0x16937,0x24a75,0xe473b,0x24b2a,0x00000, -0xe473c,0x24a65,0x24a7a,0x1692c,0x16935,0x16933,0x24a67,0x24a7c, -0x16932,0xe4745,0xe4748,0x1692b,0x24a78,0xe474d,0xe4744,0x00000, -0xe4c54,0x24b24,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe474c,0x2507c,0xe4742,0x25078,0x25074,0x2512a,0x25127, -0x16d37,0xe4c64,0xe4c60,0x2512e,0x2507b,0x16d42,0x25124,0xe4c4f, -0xe4c51,0x25077,0x25123,0x16d3f,0x25137,0x00000,0x25134,0x25126, -0x25075,0xe4c5f,0xe4c57,0x2512b,0x2512d,0x16d3b,0x25121,0x2507a, -0x25071,0x16d38,0x16d40,0x00000,0x25130,0x16d41,0x25072,0x25136, -0x25129,0x2512f,0x16d3e,0xe4c4d,0xe4c50,0x2512c,0xe4c47,0x25133, -0xe4c5b,0x16d43,0xe4c56,0x16d3d,0x25125,0x25076,0x25138,0x25073, -0x25131,0x16d3a,0xe4c4a,0x2507d,0xe4c49,0x2507e,0x16d39,0x16d36, -0x25079,0x16d3c,0xe4c52,0x16d35,0xe4c62,0x25132,0x25135,0x25122, -0x25755,0xe4c5e,0xe4c59,0x00000,0xe4c61,0xe6530,0x00000,0x00000, -0x00000,0x00000,0x2574d,0xe512c,0x25749,0x17121,0xe513c,0xe5138, -0x17074,0x17079,0x17075,0x25757,0x25762,0x17073,0x2574f,0x25758, -0x25128,0x25759,0xe5128,0xe512b,0x1707a,0xe5140,0x25768,0x1707e, -0x17123,0x2574b,0xe513b,0x1707d,0xe5131,0x25766,0x25767,0x2575d, -0x2575c,0x25754,0xe5129,0xe513e,0x2575e,0x25765,0x25764,0xe512f, -0x17078,0x17076,0x25756,0x25753,0xe5144,0x25750,0x25763,0x17122, -0x25761,0x1707c,0x1707b,0xe5127,0x2575b,0x00000,0x2574a,0x2574c, -0x2574e,0x25760,0x2575a,0x17077,0xe512e,0x25751,0xe5132,0x2575f, -0xe5141,0xe513a,0x00000,0x00000,0x00000,0x00000,0x25752,0xe6531, -0x00000,0x00000,0xe6532,0x00000,0x00000,0xe5475,0x17378,0x25d31, -0x17371,0x25d22,0xe547b,0x25d2d,0x17373,0x25d34,0xe5521,0x25d29, -0xe547c,0x25d24,0xe5476,0x00000,0x25d35,0x25c7e,0x25d2b,0xe5527, -0x1737a,0x25d30,0x25d36,0x25d2a,0x17372,0x25d2c,0x25d21,0x17379, -0xe5523,0xe547a,0x25d33,0x25d26,0x17375,0xe5524,0x25d28,0x25d25, -0x1737b,0x25d27,0x17374,0x17377,0x25d2f,0x25d23,0x25d32,0xe5478, -0x25d2e,0x00000,0xe5529,0xe5774,0x1764f,0x26173,0x17654,0x17655, -0xe5777,0xe5821,0xe5776,0x1764e,0x26172,0xe5778,0x2616f,0x26170, -0x17652,0x2616a,0x2616e,0x17651,0xe577e,0x2616b,0xe5779,0xe5823, -0xe577d,0xe577a,0x17653,0x17650,0xe5822,0x26169,0x2616d,0x26171, -0xe577b,0x00000,0xe6533,0x2655c,0x26559,0x26562,0xe5a44,0x26561, -0x2655f,0x2655a,0xe5a4f,0x1783f,0xe5a45,0xe5a4e,0x00000,0xe5a47, -0xe5a4d,0x2655b,0x1783e,0x17376,0x2655e,0x1783d,0x26563,0x2655d, -0x26558,0x2616c,0xe5a48,0xe5a46,0x00000,0x1783c,0xe6534,0x26557, -0x26924,0xe5c49,0x26923,0x26560,0x17973,0xe5775,0x26927,0x26928, -0x26922,0x26926,0x00000,0x26921,0xe5c47,0xe6535,0x00000,0x00000, -0x26b5f,0x26925,0x17a72,0x17a70,0x26b5d,0xe5e35,0xe5e34,0xe5e33, -0x26b60,0xe5e37,0x26b5c,0x26b5e,0x17a71,0x00000,0xe5f4f,0xe5f4e, -0x26d53,0x26d54,0x17b62,0x26d52,0x00000,0xe6536,0xe6537,0x26f31, -0x17c3b,0x26f2f,0x26f30,0x2703a,0xe6074,0x00000,0x17d23,0x27123, -0x27121,0x27122,0x27124,0xe6140,0xe6165,0xe6141,0x2722b,0x00000, -0x1454e,0x14839,0xe2379,0x14e3c,0x00000,0x2274a,0xe2953,0xe2954, -0x22b46,0xe6269,0xe2d3c,0xe3166,0x22f77,0x22f79,0xe3165,0x22f78, -0xe3167,0x22f7a,0x15b43,0x2363b,0x22f7b,0xe3662,0x2363a,0x2363c, -0x2363d,0x23c7d,0x16022,0x23c7e,0x23d22,0x16023,0x16021,0x23d21, -0xe417d,0x24422,0x2437e,0x2437d,0xe417c,0x2437c,0x2437b,0x16458, -0x24421,0x16939,0x24b2b,0x24b2d,0x1693a,0x24b2c,0x16d45,0xe4c66, -0x16d44,0x25139,0xe4c65,0xe4c67,0x2576a,0x25769,0x2576b,0xe5146, -0xe5145,0x17124,0x00000,0x25d37,0x1737c,0xe552b,0x26174,0x17656, -0x26564,0x17b63,0x1454f,0x1465f,0x1483a,0x14a63,0x14e3d,0x14e3e, -0xe2955,0xe2956,0x15171,0xe2d3d,0xe3168,0x22f7c,0xe3c49,0xe3c47, -0x00000,0xe417e,0x16459,0xe4221,0xe4753,0x00000,0x25259,0x17125, -0x17657,0x14550,0xe2253,0x1483b,0x00000,0x00000,0x2274c,0x14e3f, -0x2274b,0xe2958,0x22b47,0x15172,0x22b48,0x00000,0x15173,0x00000, -0x22f7e,0x15632,0x15631,0xe316a,0x23642,0x23640,0x23641,0x2363f, -0xe3664,0x2363e,0x00000,0x00000,0x23d23,0x23d26,0x16025,0x23d24, -0x16024,0x23d25,0x00000,0x24423,0xe4222,0xe6354,0x24b2e,0x24b2f, -0x24b30,0xe4754,0x2513c,0x2513b,0x16d46,0x2513a,0x2513d,0x2576c, -0x00000,0x00000,0x2576d,0x2576e,0x00000,0x25d38,0x1737d,0x17658, -0x26565,0x00000,0x17a73,0x2213f,0xe2959,0x15174,0x22b49,0x15633, -0x00000,0x00000,0x15b44,0xe3665,0x16026,0x23d27,0xe3c4b,0x1645b, -0x1645a,0xe4226,0x00000,0x24b31,0x24b32,0x16d47,0x16d48,0x25770, -0x2576f,0x26175,0x26f32,0x14551,0x22140,0x14660,0xe237a,0x14a64, -0x22448,0xe295a,0x15175,0x1645c,0x14552,0x00000,0x22b4a,0x15176, -0x22b4b,0x00000,0x1737e,0x14553,0xe6538,0xe6539,0x2274d,0x00000, -0x22b4c,0xe2d42,0x23025,0x23024,0x23022,0xe316e,0x23021,0x23026, -0x23023,0xe316c,0xe316d,0x15b45,0x15b46,0xe3666,0x00000,0x16027, -0x23d28,0x00000,0x23d29,0x23d2a,0xe3c4d,0x00000,0xe653a,0x24427, -0x24428,0x24426,0xe4228,0x24424,0x24425,0x1645d,0x24b33,0x25140, -0x2513f,0x2513e,0x25141,0x25772,0x25771,0x17126,0x25773,0x00000, -0x17421,0x25d39,0xe552d,0x26176,0x26566,0x26d55,0x00000,0x14554, -0x14662,0x14661,0x00000,0x14e40,0x22141,0x2215f,0x1483c,0x00000, -0x22258,0x22449,0x2244a,0x14e41,0xe295d,0x2274e,0xe653b,0x15177, -0x22b4d,0x22b4e,0x00000,0x15634,0x15638,0x23027,0x15637,0x15635, -0x15636,0x00000,0x23643,0x15b47,0x1602a,0xe3c4e,0x16028,0x16029, -0x23d2b,0xe4229,0xe422a,0x1693b,0x14555,0x00000,0x22160,0xe2257, -0x14663,0xe2254,0x00000,0x22163,0xe2421,0x00000,0x14666,0x22162, -0x14665,0x14664,0x14a65,0x22161,0xe2258,0xe2259,0x22259,0x00000, -0x00000,0x00000,0x2225d,0x2225f,0x22260,0x14846,0x14847,0x2225c, -0x14842,0xe237d,0x2225a,0xe2425,0x2225e,0x14843,0xe2655,0x1483e, -0xe237c,0x1483f,0xe2423,0x14845,0x2225b,0x1483d,0x14a66,0x14840, -0x14841,0x14844,0x00000,0xe653c,0x00000,0x2245b,0x22459,0x2244c, -0x14a72,0x22453,0x14a6d,0x2244d,0xe2964,0x22455,0xe2650,0x22452, -0x14a70,0x22451,0x14a77,0x2245a,0x14a79,0xe2653,0x14a7b,0xe237e, -0x2244b,0xe2657,0x14a6e,0x2245c,0xe2651,0x14a75,0x14a78,0xe264c, -0x22765,0x14a68,0x14b21,0x14a76,0x2244e,0x14a6b,0x14a7a,0x22456, -0x14a69,0x14a6a,0x22763,0x2244f,0x14a71,0x14a7c,0x2245d,0x22450, -0x14a6f,0xe264d,0x14a74,0x2274f,0x14a7d,0x22457,0x14a73,0xe2963, -0x14a7e,0x14a67,0x22454,0x14a6c,0x22458,0x22764,0xe264e,0xe2652, -0xe265c,0xe2659,0xe2656,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0xe265b,0x14e4d,0x14e5d,0x22756,0x14e54,0xe2d4e, -0x2276b,0x14e45,0xe296b,0x14e48,0x22762,0x00000,0x22754,0x22758, -0x14e50,0x14e52,0x2275b,0x14e59,0x14e4b,0x14e49,0x14e4a,0x14e58, -0x22767,0x14e53,0x2275a,0x2275c,0x14e51,0x14e56,0x2275d,0x2276a, -0xe296d,0x15178,0x14e5c,0xe6261,0x14e46,0x22769,0xe296c,0x2276d, -0x22759,0x2276f,0x22760,0x14e4f,0x22755,0x14e4e,0x14e60,0x14e55, -0xe296a,0x22753,0x22b57,0x14e5b,0x14e5f,0x22761,0x22766,0xe2965, -0x14e61,0x14e5a,0x14e4c,0x14e42,0xe2969,0x14e47,0xe6260,0x22757, -0x14e43,0x2276e,0xe2967,0x22751,0x22750,0x2275e,0x22752,0x14e5e, -0x15639,0x14e57,0x2275f,0x14e44,0xe2d4f,0x15229,0x00000,0x00000, -0x00000,0x2276c,0x00000,0x00000,0x00000,0x00000,0x00000,0xe2d46, -0x22b5e,0x22b61,0xe2d50,0x22b64,0x22b59,0xe2d48,0xe2d4a,0x22b67, -0x22b6a,0x22b6c,0x22b56,0x15179,0x1517e,0x2302c,0x15230,0x22b65, -0x22b6d,0x22b5d,0x22b55,0xe2d49,0xe2d47,0xe2d4d,0x23047,0x15223, -0x22b62,0x22b5a,0x22b5c,0x15228,0xe317a,0x22b5f,0x15222,0x22b52, -0x22b68,0xe2d4b,0x22b6b,0xe2d45,0xe2d57,0x1517d,0xe2d53,0x1522b, -0x22b4f,0x1522d,0x1517b,0x15231,0x22b69,0x22b51,0x1522e,0x23041, -0x22768,0x15221,0x1517a,0x22b58,0x22b50,0x1522f,0x15227,0x22b63, -0x1522c,0x1522a,0x22b5b,0x15224,0x22b53,0x15225,0x15226,0x22b54, -0x22b66,0x1517c,0x22b60,0x00000,0xe2d55,0xe2d51,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0xe3177,0xe3173, -0x2302f,0x15641,0x15646,0xe3179,0xe3226,0xe3176,0x23038,0x2303e, -0x2303a,0x2302d,0x23030,0x23029,0x2302a,0x1564d,0x1563e,0x23039, -0x23042,0x15648,0x1563a,0xe316f,0x15643,0x23031,0x15645,0x23032, -0x2303c,0xe3222,0xe3225,0xe3172,0x15647,0x2304b,0x2302b,0x15640, -0x1563f,0x1564b,0x23028,0x23049,0x2303d,0x2304a,0x23044,0x23036, -0x23045,0xe3221,0x2303f,0x23048,0x23046,0x1564c,0x23037,0x1563d, -0x1563c,0x15644,0x1564a,0x23043,0x15649,0x23034,0x15b48,0xe3178, -0x2304c,0x23033,0x2302e,0x15642,0x1564e,0x1563b,0xe3227,0x2303b, -0x23040,0xe317d,0xe317b,0xe317c,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0xe653d,0x00000,0x00000, -0x00000,0x00000,0x15b6a,0x23645,0x23649,0xe366f,0x15b57,0x15b55, -0xe367a,0xe3721,0x15b4c,0x23647,0x23646,0x15b60,0xe3c50,0x2364c, -0x15b5a,0xe3672,0x2365e,0x2366a,0x15b49,0x2365b,0x23654,0x15b6c, -0x23644,0xe366a,0x23660,0xe366b,0x15b69,0x15b5d,0x15b68,0x15b53, -0x23650,0x23662,0x2365a,0x15b54,0x15b4e,0x23668,0xe366c,0x23661, -0x23663,0x15b56,0x15b5e,0x23665,0x2364e,0x2365f,0x23653,0x23667, -0x15b63,0x15b4b,0x15b61,0x23658,0x23656,0x23657,0x15b58,0x23652, -0x23651,0x15b4d,0x2364b,0x23669,0x15b4f,0x23655,0x15b6d,0xe3674, -0x15b67,0x2364a,0x15b64,0x15b62,0x15b6b,0x2365c,0x15b66,0x23035, -0x2365d,0x15b65,0x23664,0x15b4a,0x23659,0x15b5c,0x2364d,0x15b5b, -0xe367c,0x15b59,0x15b51,0x15b50,0x23d2c,0x23666,0xe3c5d,0xe3728, -0x2364f,0xe3726,0xe3723,0x23d41,0xe3670,0x15b52,0xe3677,0xe3724, -0xe3676,0xe3725,0xe3679,0x00000,0xe367d,0x00000,0x00000,0xe653e, -0x00000,0x00000,0xe3729,0x00000,0x00000,0x00000,0x00000,0xe3727, -0xe3c54,0x16047,0x15b5f,0x16035,0x23d3b,0x16043,0xe3c52,0x23d2f, -0x16032,0x1602e,0x23d4d,0x16034,0x16038,0x16033,0x1603c,0x23d51, -0x23d48,0xe3c6b,0xe3c6d,0x23d36,0x16041,0x1603b,0x23d42,0x1602b, -0x23d4e,0x23d47,0x1602f,0x23d3c,0x1603e,0x23d59,0x23d5a,0x00000, -0x1602c,0x23d4c,0x16040,0x23d40,0x23d32,0x23d33,0x16044,0x23d37, -0x23d3e,0x23d38,0xe3c5a,0x16042,0x1604a,0x23d34,0x23d2d,0x23d2e, -0xe3c56,0x23d30,0x16031,0x23d3d,0xe3c6e,0x1603f,0x16048,0xe3c58, -0xe3c69,0x23d3f,0x23d57,0x23d4f,0x1602d,0x23d55,0x16039,0xe3c66, -0x16037,0xe3c64,0x23d5b,0x16036,0x23d45,0x23d39,0x23d43,0x1604d, -0x23d49,0x23d46,0x23d35,0x16049,0x23d53,0x23d50,0x23d58,0x16030, -0x23d44,0x1604c,0xe3c5b,0x23d4b,0xe423a,0xe3c60,0x1603a,0x1603d, -0xe3c5c,0x23d4a,0x1604b,0x23d3a,0x23648,0xe3c51,0xe3c6c,0x23d54, -0x23d52,0x23d56,0x00000,0xe3c62,0xe6542,0x00000,0xe3c63,0x00000, -0xe3c68,0x00000,0x00000,0x00000,0xe6540,0x00000,0xe633d,0x00000, -0x23d31,0x16046,0xe653f,0xe6541,0x00000,0x24447,0x24446,0x2442c, -0x16463,0xe4230,0x24445,0x2442f,0x24430,0x00000,0x1646d,0x2444e, -0x16468,0x24444,0xe4233,0x24429,0x1646e,0x16464,0x24438,0x2442e, -0x24431,0x24449,0x1645e,0x24450,0x24448,0x16467,0x2443d,0x16472, -0xe422e,0xe4236,0x16471,0x1646b,0xe4240,0x00000,0x2444f,0x1645f, -0x2443b,0x24432,0x2443f,0x2444b,0x16473,0xe4239,0x16461,0x2443a, -0xe422d,0x24433,0x1646a,0xe4231,0x16469,0x24436,0x24440,0x2444a, -0x2442d,0x24437,0x16462,0x24441,0x1646f,0x16466,0x24434,0x16465, -0x2442b,0x24439,0x2444d,0x16045,0x16957,0x2443c,0x24b34,0x2443e, -0x2444c,0x1646c,0x24435,0x16460,0x16470,0x16d5a,0x2442a,0x00000, -0x24443,0xe4244,0xe423e,0xe4247,0x24442,0xe423d,0x00000,0x00000, -0x00000,0x00000,0x00000,0xe4245,0x00000,0x00000,0xe423f,0x00000, -0xe423b,0xe4246,0x00000,0x24b50,0x16954,0x24b45,0x24b4a,0x16949, -0xe4756,0x24b36,0x16956,0xe4757,0x16940,0x24b35,0x24b56,0x16958, -0x24b39,0x24b49,0xe4765,0x24b3b,0x24b59,0x24b55,0x1693e,0x16948, -0x2515b,0x16955,0x16946,0x24b37,0xe4763,0x24b54,0x1694a,0x24b51, -0x24b5e,0x24b3d,0x24b46,0xe4c78,0xe475b,0x24b5c,0x24b52,0x16945, -0xe4c6a,0xe4764,0x24b44,0x1693f,0x1693d,0x1694f,0x00000,0xe475f, -0x24b42,0x24b3f,0x24b40,0xe475a,0x24b58,0xe475c,0x24b5d,0x24b5b, -0x16943,0x24b5f,0x16947,0x1694e,0x00000,0x24b38,0x25143,0x24b41, -0xe475e,0x16941,0x16953,0x16950,0x16944,0x24b4b,0x24b3c,0x16951, -0x24b4d,0x1694b,0x1694d,0x1693c,0xe475d,0x24b4f,0x24b47,0x24b3a, -0x1694c,0x24b57,0x24b5a,0x24b43,0x24b4e,0xe4c74,0x16942,0x16d49, -0x24b4c,0x25142,0xe4762,0x24b53,0xe4761,0x00000,0x00000,0x00000, -0xe6544,0xe6545,0xe4766,0x00000,0xe6543,0x00000,0x24b3e,0x2514c, -0x25156,0x16d4c,0x25155,0x25161,0x16d4e,0x25153,0x00000,0x25157, -0x16d59,0xe4c7d,0x2514e,0x16d51,0xe4c73,0x2515a,0x2577b,0x16d5d, -0x16d5c,0x2515c,0x2514b,0x25166,0x16d57,0xe4c6b,0x16d4d,0x2515f, -0x00000,0x25163,0x25168,0x2515d,0x25151,0x16d50,0x16d53,0x16d5b, -0x16d56,0xe4c75,0x25154,0x24b48,0xe4c7e,0xe4c6c,0x25150,0x25167, -0x16d52,0xe4c79,0x16d55,0x25169,0x16d4a,0x2515e,0x25144,0x25164, -0x1742a,0xe4c7a,0x25152,0x00000,0x16d4b,0x2514d,0x16d4f,0x25145, -0x16952,0x25149,0xe6363,0x25162,0x2514a,0x25148,0x16d54,0xe4c7b, -0x25160,0xe4c77,0x25147,0x25159,0x25158,0x25165,0x2514f,0x16d58, -0x00000,0xe6547,0x00000,0x00000,0x00000,0xe6546,0x2577e,0xe5156, -0x17133,0x17129,0x2582c,0x25776,0x1712b,0x25824,0x17132,0x1712d, -0x25822,0x25d3b,0x25828,0x2582e,0x25827,0x25774,0x25825,0x25830, -0x25832,0x17128,0x25831,0x1712e,0x17134,0xe5154,0x17131,0xe5158, -0x2582b,0x17130,0x25826,0xe514d,0x25778,0x2577d,0xe5150,0x2582a, -0x1712f,0x1712c,0x17127,0x1712a,0x2577c,0x00000,0x25146,0x25777, -0x2577a,0x2582d,0x25821,0x25775,0x25d3a,0x2582f,0x25779,0x25829, -0xe4c71,0x00000,0x00000,0xe5155,0x25d3d,0x1742e,0xe5530,0xe552f, -0x17422,0xe5535,0xe5536,0x17426,0x25d3f,0x25d45,0x25d43,0x17424, -0x17425,0x1742c,0x25d46,0x25d3e,0x17427,0xe5531,0x25d42,0x25d41, -0x25d47,0x1742d,0xe5537,0x17428,0x1742b,0x25d40,0x1742f,0x17429, -0x17430,0x17423,0x25d44,0xe5a55,0x25d3c,0xe5159,0xe5539,0x26225, -0xe6548,0x00000,0x1765d,0x26222,0x26224,0xe5828,0x1765b,0x2617e, -0x26221,0x2617a,0xe582a,0xe5827,0x25823,0x2617b,0x1765c,0x26177, -0xe5826,0x17659,0x26226,0x1765a,0x26178,0x26179,0x2617d,0x1765f, -0xe5829,0x1765e,0x00000,0xe582b,0x2617c,0x17845,0x2656a,0x26570, -0x17846,0x26567,0x17843,0x17840,0x26572,0x17844,0xe5a52,0x17841, -0x26569,0x2656c,0x2656d,0x2656e,0x26571,0xe5a54,0x26223,0x26568, -0x17842,0x2656f,0x26934,0x2656b,0xe5a53,0xe654a,0xe6549,0x2692b, -0x17975,0x2692e,0x17976,0x26937,0x2692d,0x2692a,0xe5c51,0x2692c, -0x26930,0x26933,0x26932,0x26936,0x26929,0xe5c4f,0x17974,0x26931, -0x26935,0x26938,0x2692f,0x26b61,0x26b62,0x26b66,0x26b67,0xe5e3c, -0x26b64,0x26b65,0x26b63,0xe5e3a,0x17a74,0xe5e3b,0x00000,0x00000, -0x00000,0x17b64,0x26d59,0xe6036,0xe5f52,0x26d56,0x26d57,0x26d58, -0x17b65,0xe6037,0x26f34,0x26f33,0xe654b,0x2703d,0x17c60,0x2703b, -0x2703e,0x2703c,0x27125,0x17d24,0x17d32,0x27171,0x2715b,0xe6179, -0x27170,0x2723e,0x2723f,0x14556,0x00000,0x00000,0xe2428,0xe2426, -0x14848,0x22261,0xe2427,0xe242b,0x2245e,0xe2662,0x14b22,0xe265f, -0x14b25,0xe265e,0x2245f,0xe2663,0x14b23,0x14b24,0xe2660,0x00000, -0x00000,0xe2977,0x22778,0x2277a,0x22775,0x22772,0x22774,0xe2974, -0xe2970,0xe2975,0x14e65,0xe296f,0xe2979,0xe2976,0x14e63,0xe2972, -0xe2971,0x22776,0x14e64,0x22773,0x22770,0x14e62,0x22777,0x00000, -0x22771,0x14e66,0x22779,0x00000,0x00000,0x00000,0x00000,0x22b6f, -0xe2d5e,0x22b73,0xe2d5c,0xe2d5a,0x1523a,0xe2d58,0xe626a,0xe2d65, -0xe2d62,0x22b76,0xe2d5f,0x15232,0x15235,0x15237,0x15239,0x15236, -0x22b72,0x22b71,0xe2d64,0x15234,0x22b74,0x22b75,0xe2d63,0x22b6e, -0x15238,0xe2d68,0x15233,0xe2d5d,0x00000,0x00000,0x22b70,0xe654d, -0x00000,0x00000,0x00000,0x00000,0xe3228,0x2305a,0x2305b,0x2305c, -0x15653,0xe6279,0x1564f,0x23051,0xe322a,0x23059,0x2305e,0x15654, -0xe322b,0x2304f,0x23055,0x2304e,0x23058,0xe3231,0xe322f,0x23054, -0x15650,0x15652,0x2305d,0xe3229,0x2304d,0x23050,0x23056,0xe322d, -0x23057,0x2305f,0x23053,0xe322c,0x15651,0xe654f,0x00000,0x00000, -0x00000,0x00000,0xe654e,0x00000,0x00000,0x00000,0xe3230,0x15b72, -0x23671,0xe3730,0xe3732,0x23673,0x2366f,0xe372f,0x2367b,0x2366d, -0x2367a,0x15b6e,0x2366b,0x23d5f,0x23675,0x15b71,0xe3735,0x23676, -0x23679,0xe372e,0x2367d,0xe372c,0x23672,0x00000,0x23677,0xe372d, -0xe3731,0x15b6f,0x15b70,0x2367c,0x23670,0x2366c,0x2367e,0xe3733, -0x23674,0xe6550,0xe6551,0x23678,0x00000,0x00000,0x00000,0x2366e, -0x00000,0x1604e,0x1604f,0x23d69,0x16055,0xe3c74,0x23d5d,0x23d66, -0x23d5c,0x16052,0x23d64,0x23d62,0xe3c7d,0x23d63,0x16050,0xe3c7c, -0x23d67,0x00000,0xe3c6f,0xe3c7a,0xe3c72,0xe3d21,0x23d60,0x23d5e, -0x16051,0x23d61,0x23d65,0xe3c7b,0xe3c79,0xe3c71,0x16053,0xe3c73, -0xe3c77,0xe6553,0x23d68,0xe6554,0x00000,0xe6555,0x00000,0xe6552, -0x00000,0x24456,0x2445d,0x2445f,0x24465,0xe4257,0x16522,0x24451, -0xe424c,0x16478,0xe424e,0x24460,0x1647d,0x24466,0x16474,0xe4251, -0x24463,0xe4258,0x24453,0x24464,0x24452,0x00000,0x16524,0xe4252, -0x2445e,0x16475,0x24467,0xe483c,0x1647a,0x24457,0x16521,0x24462, -0x24455,0x2445c,0x24458,0x24454,0x16477,0x1647e,0x1647c,0x16479, -0x16523,0x16476,0x2445b,0xe424f,0x1647b,0xe4259,0x16054,0xe4249, -0x24461,0xe6559,0x24459,0x00000,0xe4253,0xe6557,0xe6558,0xe6556, -0x2445a,0x00000,0x00000,0x24b67,0xe476f,0x1695b,0xe476e,0xe476c, -0x24b63,0x24b69,0x24b65,0xe4770,0x1695d,0x24b64,0x24b68,0x24b60, -0xe4772,0x24b62,0x1695c,0xe476a,0xe476d,0xe476b,0xe4768,0x24b66, -0x24b61,0xe4767,0x1695e,0xe655b,0x16959,0x00000,0xe655a,0x24b6a, -0x00000,0x1695a,0x2516f,0x2516c,0x25178,0x25172,0x25174,0x16d5e, -0x2516e,0x25176,0xe4d2a,0xe4d24,0x25175,0x25173,0xe4d29,0x25179, -0x16d61,0x25170,0x25177,0xe4d28,0x16d5f,0xe4d25,0xe4d22,0x2516b, -0x2516d,0x16d60,0x2516a,0x2517a,0xe655c,0x25171,0xe5162,0xe515a, -0x25836,0x1713b,0xe5160,0xe515c,0x25841,0x2583f,0x17135,0x25835, -0x25838,0x25839,0x25834,0x1713f,0x17140,0x25833,0x25842,0x2583d, -0x17139,0x17136,0x2583c,0x2583a,0xe5163,0xe6374,0x1713c,0x2583e, -0x17137,0xe515e,0x17138,0xe5166,0x2583b,0x1713a,0x25837,0x00000, -0x25840,0x1713d,0x25843,0x25844,0x1713e,0xe655d,0xe655e,0x17432, -0x17439,0x25d48,0x25d4e,0xe553c,0x25d4c,0x17435,0x17434,0x17431, -0x25d4a,0xe553e,0xe5543,0xe5540,0x17437,0x17436,0x17433,0xe5541, -0x25d4d,0x25d49,0x25d4b,0xe5542,0x17438,0x00000,0x00000,0x00000, -0x17663,0x26229,0xe582d,0x17660,0x17661,0x2622b,0x17662,0x26228, -0xe582e,0x26227,0x26576,0x2622a,0xe5a56,0x26577,0x17847,0x26575, -0xe5a57,0x00000,0x26574,0xe5c59,0x26573,0x17848,0xe655f,0xe5c56, -0x17977,0xe5c58,0xe5c55,0x26939,0x2693a,0xe5a58,0xe5c53,0xe5c57, -0xe6561,0x26b6a,0x26b69,0x17a75,0xe5f53,0x26b68,0x26d5a,0x26d5b, -0xe5f54,0xe6039,0x26f35,0x2703f,0xe6143,0xe6142,0x27126,0x2722c, -0x17d46,0x27240,0x14557,0x00000,0x14e67,0x14e68,0xe2d69,0x00000, -0x1523b,0x00000,0xe3d22,0x00000,0x00000,0x1743a,0x14558,0x00000, -0x14e69,0x15655,0x16525,0x14559,0xe2d6b,0x15b73,0x1695f,0x22142, -0xe297c,0x22b77,0x23060,0x00000,0x24b6b,0x00000,0x1743b,0x1455a, -0x14e6a,0x22b78,0x22b79,0x23d6a,0x16056,0x00000,0xe425d,0x24468, -0xe425c,0xe425b,0x16526,0x24b6c,0x00000,0xe4d2e,0x16d62,0xe4d2d, -0x17849,0x1455b,0x23d6b,0x1455c,0x00000,0x1484a,0x22262,0x14849, -0x14b28,0x14b27,0x14b26,0x22460,0xe2664,0xe2a21,0xe2a22,0x14e6b, -0xe2a23,0x14e6c,0x2277b,0x00000,0x22b7a,0xe2d6d,0x22b7d,0x1523d, -0x22b7b,0x00000,0x1523c,0x22b7c,0x1523e,0x00000,0x23063,0x23062, -0x23061,0x15656,0xe3236,0x23722,0x23723,0x15b74,0x23721,0x23724, -0x16058,0x15b75,0xe3d24,0xe3d23,0x16057,0x23d6f,0x23d6e,0xe3d25, -0x23d6c,0x23d6d,0x00000,0x23d70,0x2446a,0x24469,0x2446d,0x00000, -0x2446c,0x2446b,0x16960,0x24b6f,0xe4775,0x24b6e,0x16961,0x24b6d, -0x2517b,0xe4d2f,0x2517c,0x16d63,0x00000,0x25845,0x25846,0x00000, -0x00000,0x2657c,0x1784a,0x2657b,0x2657a,0x26578,0x26579,0x17a76, -0x2693b,0x26d5c,0x27127,0xe617b,0x1455d,0x00000,0x22164,0x14667, -0x22165,0xe242c,0xe242d,0x00000,0x22263,0x22264,0xe266b,0x00000, -0x00000,0xe2669,0x22466,0xe2666,0xe2667,0x22462,0xe266a,0x22461, -0x14e6d,0x22465,0x14b2a,0x22463,0x14b29,0x22467,0x22464,0xe2668, -0x00000,0x22821,0x22b7e,0x2277d,0x22826,0xe2a26,0x14e6e,0xe2a2a, -0x14e71,0x22827,0x22823,0xe2a27,0x22824,0x00000,0x2277c,0x14e70, -0x2277e,0x14e6f,0x22825,0xe2a28,0x22822,0x00000,0x00000,0x22c24, -0x15240,0x15241,0xe2d75,0x22c27,0x22c21,0xe2d74,0x22c26,0xe2d70, -0x22c22,0x1523f,0x22c25,0x22c23,0xe2d73,0xe2d71,0x00000,0x00000, -0x00000,0x00000,0x00000,0x23069,0x23066,0xe3238,0x23068,0x1565b, -0x1565a,0x15658,0x23065,0x2306a,0x15657,0x15659,0x23067,0x2372c, -0x23064,0x2306b,0xe3239,0x00000,0x00000,0x00000,0xe3d26,0x23727, -0x2372b,0x00000,0x2372a,0x23d72,0x23d7d,0x00000,0xe373b,0x2372d, -0xe373a,0x23728,0x23d71,0x15b79,0x00000,0x00000,0x15b78,0x23726, -0x23729,0x15b7a,0xe3739,0x15b77,0x15b76,0x23725,0x2372e,0x00000, -0x00000,0x00000,0x23d74,0x23d7b,0xe3d27,0x1605a,0x23d7a,0x23d77, -0xe3d2e,0x1605c,0xe3d29,0xe3d2b,0xe3d2a,0x23d79,0xe4261,0xe3d2d, -0x23d73,0x23d75,0x23d78,0x23d76,0x1605b,0x23d7c,0x16059,0x16527, -0xe3d28,0x00000,0x24471,0x24470,0x2446e,0x00000,0x1652a,0x16529, -0x24472,0xe425f,0x2446f,0x24b70,0x16962,0x16528,0xe4262,0xe6562, -0xe6563,0x24474,0x24473,0xe4d30,0x24b73,0x24b71,0x16d64,0xe4779, -0x16963,0x24b72,0x2517e,0xe4778,0xe477a,0xe4777,0x00000,0x16d65, -0x2517d,0x25228,0x25227,0x25225,0x00000,0x25224,0x25221,0x25222, -0x25223,0x25226,0x25229,0x00000,0x00000,0x2584b,0x25848,0x25849, -0x17141,0x25847,0x2584d,0x2584c,0x2584a,0x00000,0x25d50,0x25d51, -0x1743c,0xe5549,0x1743d,0x25d4f,0x00000,0x17665,0x2622c,0x17664, -0x1784b,0x00000,0x1784c,0x17978,0x2693d,0x2693c,0x26b6b,0x26d5d, -0x17b66,0x26f37,0x26f36,0x26f38,0x14668,0x22c28,0x1565c,0x15b7b, -0x2372f,0x14669,0x22166,0x1455e,0xe225a,0xe216b,0x22265,0xe242f, -0x00000,0x00000,0x2246c,0x2246a,0x2246b,0x22468,0x14b2b,0x22469, -0xe266e,0x00000,0x00000,0x00000,0xe2a33,0x2282f,0xe2a2d,0x14e74, -0x2282d,0x22829,0x2282c,0xe2a2c,0x22828,0x14e76,0x2282b,0xe2a2b, -0x14e73,0x14e72,0xe2a32,0x14e75,0x2282e,0x2282a,0x00000,0xe2a2f, -0x00000,0x00000,0x15245,0x15248,0x22c30,0x22c2f,0x22c2e,0x15242, -0x22c37,0x22c2d,0x00000,0x15244,0x23070,0xe2d78,0x22c34,0x22c32, -0x15247,0xe2d7b,0x22c2a,0x22c35,0xe2d77,0x22c2c,0x22c36,0x22c33, -0x22c2b,0xe2d7a,0x15243,0x22c38,0x22c29,0x15246,0xe2d7e,0xe2d79, -0xe2d7c,0x00000,0x23075,0x2306c,0x23077,0xe323e,0x2306f,0x2307a, -0x2307b,0x2306d,0x23079,0x23076,0x23074,0x23078,0x15662,0xe3240, -0x15660,0xe3247,0xe323c,0x23072,0xe3246,0x2306e,0xe3241,0x23071, -0x2307c,0x23073,0x15661,0x22c31,0xe323d,0x1565d,0x1565f,0xe6564, -0x00000,0x00000,0x00000,0xe373d,0x2373d,0x23732,0x23730,0xe3d38, -0x23731,0xe323f,0x23738,0xe3740,0x23739,0x23735,0x15c22,0x2373a, -0x23737,0x23734,0xe373c,0x15b7e,0x23733,0x15b7c,0x15c21,0x23736, -0x2373e,0x1565e,0x15b7d,0x2373c,0x2373b,0x15c23,0x00000,0x00000, -0x00000,0x00000,0xe6565,0x00000,0xe3d36,0xe3d3a,0x23e24,0xe3d2f, -0xe3d3b,0xe3d32,0x23e25,0x16066,0xe3d39,0x23e2b,0xe426d,0xe3d35, -0x23e2d,0x23e26,0x16060,0x23e2a,0x23e29,0x16061,0x16067,0xe4264, -0x16068,0x23e2c,0x1605e,0x23e23,0x23e21,0x23e27,0x23d7e,0x16065, -0x23e22,0x23e28,0x23e2e,0x1605f,0x16064,0x16062,0x16063,0x00000, -0xe3d33,0xe3d3c,0x1605d,0xe6566,0xe3d37,0xe4268,0xe4275,0x16531, -0x2447b,0x16530,0x24521,0xe426f,0x24475,0xe4274,0x24522,0xe426e, -0xe4266,0xe4271,0x24476,0x24477,0xe4273,0x24523,0x2447e,0x2447c, -0x2447d,0x24479,0x24478,0xe4267,0x24524,0x1652d,0xe426b,0x2447a, -0xe4270,0x16532,0x1652c,0x16533,0x16534,0xe426a,0x1652f,0x1652e, -0xe4825,0xe477e,0x24b74,0x16965,0x16964,0xe477c,0xe477d,0x24b79, -0xe4822,0x16d66,0x16966,0xe4821,0xe477b,0x16968,0x24b7a,0x1652b, -0x16967,0x24b76,0x24b78,0x24b75,0xe4827,0x24b77,0xe4823,0x00000, -0x00000,0x25233,0xe4d31,0xe4d3b,0x25232,0x2522f,0x16d69,0x2584e, -0x16d6a,0x2522e,0xe4d39,0x16d68,0xe4d36,0x25230,0x2522d,0x2522a, -0x25231,0x2522b,0x2522c,0x16d67,0xe4d35,0xe6568,0x00000,0x00000, -0x25d55,0x00000,0x25852,0xe4d3a,0x25851,0x25853,0xe516a,0x25d52, -0x17144,0xe6375,0x2584f,0xe5167,0x17142,0xe516c,0x17146,0x17145, -0x25850,0x25854,0xe516b,0x17143,0xe6567,0x25d59,0x17440,0x17666, -0x17441,0x1743e,0x25d56,0x25d54,0xe554f,0x25d57,0xe554b,0x25d5a, -0x1743f,0x25d58,0x25d53,0xe554d,0xe6569,0x2622f,0x26232,0x26621, -0x2622d,0xe582f,0x2693e,0x26233,0xe5830,0x1784d,0x26231,0x17667, -0x2622e,0x26230,0x26234,0x26622,0xe5a5a,0x2657e,0x00000,0xe5a5c, -0xe5a5d,0xe5a5b,0x1784e,0x2657d,0xe5c5e,0xe5c5c,0xe5c5f,0x17979, -0xe5c5d,0xe5c60,0x00000,0xe5e3d,0x17a78,0x26d5f,0x17a77,0x26d61, -0x26d5e,0x26d60,0x17c3c,0x27040,0x1466a,0x22830,0x2307d,0x2307e, -0x15c24,0x24525,0x17147,0x1784f,0x17b67,0x27041,0x1466b,0x00000, -0x22831,0x12322,0x00000,0xe2e22,0x22c39,0xe2e21,0x22c3a,0xe2e24, -0x00000,0x00000,0x00000,0xe3248,0x23121,0x23122,0x15c25,0x15c26, -0x00000,0xe3d3d,0x00000,0x23e2f,0x00000,0x24528,0x24527,0x24526, -0x24b7b,0xe4277,0x24b7c,0x24b7d,0x16969,0x00000,0xe4828,0x25235, -0x25234,0xe4d3d,0xe516d,0x25855,0x17148,0x17149,0xe516e,0x25d5e, -0x25d5b,0x25d5c,0x25d5d,0x26236,0x26235,0x17668,0x26623,0x26b6c, -0x1466c,0x00000,0x15249,0xe3744,0x15c27,0x24529,0xe4278,0x1466d, -0x00000,0x23123,0x15c28,0xe3745,0xe3d3e,0x16069,0x1606a,0x00000, -0x1466e,0x1466f,0x22266,0x14b2d,0x14b2c,0x1524a,0x22c3b,0x23e30, -0x14670,0x14671,0x14672,0x14673,0x00000,0x00000,0x00000,0x14b2e, -0x14b2f,0x2246e,0x2246d,0xe2a37,0x00000,0x14e77,0x22834,0x22832, -0x22833,0xe2a38,0xe2a35,0x00000,0xe2a36,0x00000,0xe2e27,0x22c3c, -0x22c3d,0xe2e25,0xe2e28,0x1524e,0x1524c,0xe2e2a,0x1524d,0x1524b, -0xe2e26,0x00000,0x00000,0x00000,0x15663,0xe324e,0xe324d,0xe3250, -0xe324f,0x15667,0x15666,0x23124,0x15665,0x15664,0xe3251,0x23125, -0x00000,0xe3746,0x15c2b,0x23740,0x2373f,0x15c29,0x15c2a,0xe3749, -0xe3747,0x00000,0x1606c,0x1606b,0x23e32,0xe3d43,0xe3d42,0x23e31, -0x15c2c,0xe3d44,0x00000,0x00000,0x00000,0x00000,0x16535,0x2452b, -0x16536,0x2452a,0xe427b,0x00000,0x00000,0x24b7e,0x25236,0x16d6b, -0x25856,0xe5170,0x00000,0xe5552,0x25d5f,0x00000,0x17851,0x17850, -0x00000,0xe5c62,0x17b68,0x14674,0x22835,0x00000,0xe3d45,0x15c2d, -0x24c21,0x1696a,0xe225b,0xe2673,0x2246f,0x22470,0x00000,0x00000, -0x22836,0x14e79,0x14e7a,0xe2a3a,0x00000,0x14e78,0xe2a3b,0x00000, -0x00000,0x00000,0x15252,0x15253,0x15250,0x15251,0xe2e2b,0x22c3e, -0xe2e2f,0x00000,0x22c3f,0x1524f,0x00000,0x00000,0x00000,0x00000, -0x23126,0xe3257,0x1566b,0x1566c,0xe3255,0x15c30,0x2312c,0x00000, -0x15671,0x1566f,0x2312d,0x23128,0x1566e,0x1566d,0x15668,0x2312b, -0x2312a,0x23127,0x15670,0xe3252,0x23129,0x15669,0x00000,0x1566a, -0x00000,0x00000,0x15c31,0x23744,0x23745,0x15c32,0x23741,0x23743, -0x23747,0x23746,0x23742,0xe374a,0x15c2e,0x15c2f,0x00000,0x23e3a, -0x16071,0x16070,0x23e34,0x1606e,0x00000,0x23e37,0x16072,0x23e38, -0x16073,0x23e35,0x1606d,0x1606f,0x23e39,0xe3d47,0x23e36,0x23e33, -0x00000,0x00000,0x00000,0x00000,0x00000,0x24538,0xe427c,0x2452d, -0x16538,0x1653b,0x1653a,0x1653f,0x1653e,0x24539,0x24537,0x24530, -0x24534,0x24533,0x1653c,0x24536,0x24532,0x2453a,0x24531,0x1653d, -0x16537,0x16539,0xe427d,0x2452f,0x00000,0x00000,0x00000,0xe482b, -0x24c23,0x1696e,0x24c27,0x1696d,0x24c24,0x1696c,0xe4829,0x2452e, -0x24535,0x24c26,0x00000,0x1696f,0x24c28,0x24c25,0x24c22,0x00000, -0x00000,0x25239,0x2523d,0x2523f,0x2523b,0x2523a,0x25238,0x16d6e, -0x16d6c,0x16d71,0x16d72,0x2523c,0x16d6f,0x25237,0x16d70,0x1696b, -0x2523e,0x16d6d,0x00000,0x00000,0xe5171,0x25858,0x00000,0x25857, -0x2585f,0x25859,0x2585e,0x2585b,0x1714a,0x2585d,0xe5173,0xe5172, -0x1714b,0x00000,0x1714c,0xe5174,0x2585c,0x2585a,0x00000,0x00000, -0x00000,0x00000,0x17443,0x25d60,0xe5555,0xe5553,0x17442,0x25d63, -0x25d61,0x25d62,0x00000,0x00000,0x17444,0x00000,0xe5554,0xe5834, -0x2623a,0xe5833,0x1766b,0x2623b,0x00000,0x00000,0x17669,0x2623c, -0x1766a,0x26239,0x2623d,0xe5832,0x26237,0x00000,0x00000,0x17852, -0x26624,0x17853,0x1797a,0x00000,0x26238,0x1797b,0x00000,0xe5e3f, -0xe5e3e,0x17a79,0x26b6d,0x00000,0x17b6a,0x26d62,0x17b69,0xe603b, -0x26f39,0x17c61,0x17c62,0xe656a,0x00000,0x2723a,0xe225c,0xe656b, -0x15254,0x22c40,0x00000,0x16074,0x16075,0x14675,0x1484b,0x22267, -0xe2674,0x22471,0x14b30,0xe2676,0x14e7b,0x00000,0x15255,0x15256, -0x15257,0x23749,0x2312e,0x15672,0x00000,0x00000,0x15c33,0x23748, -0xe374d,0x00000,0x23e3c,0x16077,0xe3d4c,0x23e3b,0x16076,0xe427e, -0xe4321,0x2453b,0x16d73,0x25243,0x25240,0x25241,0x25242,0x00000, -0x00000,0xe5176,0x00000,0xe5556,0x25d64,0xe5557,0x2623e,0x00000, -0x00000,0xe5a5e,0x26940,0x2693f,0x00000,0x26d63,0x14676,0x22837, -0x15673,0x00000,0x00000,0xe3d4d,0x16078,0x2453c,0x00000,0xe4830, -0x24c29,0xe482e,0x16d74,0x25860,0xe656c,0x2623f,0x26941,0x14677, -0xe2677,0xe2678,0x14e7c,0x1525a,0x22c41,0x1525b,0x15259,0xe2e32, -0x15258,0x2312f,0x15674,0xe325a,0xe325b,0x15675,0x15676,0x00000, -0x00000,0x00000,0x15c35,0x2374a,0x15c34,0xe3750,0xe3752,0xe3751, -0x00000,0xe3d4f,0x23e3d,0x15c36,0x16079,0x2453d,0x16540,0x16541, -0x00000,0x16970,0xe4831,0x16971,0x16d75,0x1714e,0x25861,0x1714d, -0x00000,0x25d65,0x17445,0xe5835,0x26240,0x26942,0x14678,0x14b31, -0x2283a,0x22839,0x14e7d,0x22838,0x14e7e,0x2283b,0x00000,0x22c47, -0x1525e,0x1525d,0x22c49,0x22c48,0x15262,0xe2e35,0x15261,0xe2e33, -/* 0x7700 */ -0x00000,0x1525c,0x00000,0x22c43,0x22c44,0x22c45,0xe626c,0x15263, -0x22c42,0x1525f,0x22c46,0x15260,0x00000,0x00000,0xe3264,0xe325f, -0x23132,0x23136,0x23134,0x23133,0x00000,0x23137,0xe325e,0x00000, -0xe3268,0x23138,0x23139,0x23131,0x00000,0x23130,0xe3759,0x15678, -0x15679,0xe3267,0x2313a,0x23135,0xe3265,0x23753,0xe3755,0x2313b, -0x1567a,0x15677,0xe325c,0xe3263,0x00000,0x2374d,0x00000,0x2374c, -0xe3753,0x2374e,0x2374f,0x23751,0x23750,0x23755,0x15c3a,0x15c37, -0x15c3b,0x2374b,0x15c3c,0x23754,0x15c39,0x23752,0x15c38,0xe3262, -0xe3757,0x00000,0xe3d56,0xe3d53,0x23e40,0x23e42,0x23e3e,0x23e3f, -0xe3d51,0xe3d52,0x23e43,0x23e45,0x23e46,0x23e41,0x23e44,0x1607a, -0x00000,0x00000,0x24541,0xe4327,0x24546,0x2453e,0x24542,0x00000, -0xe4328,0x24547,0x24543,0x16542,0x1654a,0xe4325,0x16545,0x2453f, -0x24540,0x16975,0x1654d,0x16546,0xe4326,0x1654b,0x16544,0x24545, -0x1654c,0x24544,0x16548,0x16543,0x16549,0x24548,0x24c2e,0x24c30, -0x00000,0xe4839,0x00000,0x00000,0xe4833,0xe4836,0xe4835,0xe4834, -0xe4838,0x16547,0xe483b,0xe483d,0x24c2b,0x16973,0x24c31,0x16974, -0x24c2f,0x24c2a,0x24c2d,0x24c32,0x16972,0x24c2c,0x00000,0x16d77, -0x25247,0x25246,0xe4d44,0x16d7a,0x16d78,0x25244,0x16d76,0x25245, -0xe4d46,0x16d79,0x00000,0x00000,0x00000,0x25869,0xe517b,0x2586b, -0xe5179,0x2586a,0x25862,0x25866,0x25865,0x25863,0x17150,0x17151, -0x1714f,0x25864,0x25867,0x25868,0xe5559,0x17152,0xe5558,0x1744a, -0x25d6d,0xe555b,0x17447,0x25d67,0x17449,0x1744b,0x00000,0xe555c, -0x17448,0x25d6c,0x25d68,0x17446,0x25d6b,0x25d66,0x25d6a,0x25d69, -0xe5836,0xe5838,0x26242,0x1766e,0x1766f,0x1766c,0xe583b,0x1766d, -0xe583a,0xe5839,0x26241,0x00000,0x26627,0xe5a60,0xe5a5f,0x17854, -0x00000,0x26625,0x26626,0x00000,0x26943,0x26946,0x26944,0x26945, -0x26b6e,0xe5e42,0x00000,0x17a7a,0x26f3a,0x27042,0xe6432,0x17c63, -0x27128,0x27129,0x17d33,0x14679,0x15264,0xe3269,0x23e47,0xe3d57, -0x24549,0x00000,0x1467a,0x14b32,0x00000,0x14f21,0xe2e36,0x22c4a, -0x22c4b,0x1567b,0x00000,0x00000,0x23e48,0x1607b,0x1654e,0x1744c, -0x25d6e,0x26628,0x26947,0x1467b,0xe267b,0xe267c,0x00000,0x22841, -0x2283c,0x2283e,0x22840,0x2283f,0x2283d,0x14f22,0x00000,0x00000, -/* 0x7800 */ -0x00000,0x00000,0x15265,0x22c54,0xe2e39,0x22c4f,0x22c4c,0xe2e3b, -0xe2e3e,0x22c53,0xe2e37,0xe2e3a,0x15267,0x15268,0x22c52,0x22c51, -0x22c50,0x22c4d,0x22c4e,0x22c55,0x15266,0xe2e3d,0x00000,0x00000, -0x00000,0xe656d,0x00000,0xe656e,0x00000,0x15721,0xe667c,0x15727, -0x15726,0x23144,0x2313e,0x2313c,0xe326c,0x15724,0x2375c,0x1567d, -0x23141,0x23145,0x23147,0x23143,0x2313d,0x15725,0x23142,0x23140, -0x1567c,0x23148,0x15728,0x23146,0x15722,0x2313f,0xe326d,0x15723, -0x1567e,0x00000,0x00000,0x00000,0x00000,0xe656f,0x00000,0x00000, -0x00000,0x00000,0xe3762,0x15c3e,0x00000,0x2375d,0xe3763,0xe375d, -0x23756,0x23758,0x2375a,0xe375f,0x2375b,0x23759,0x15c3f,0xe3761, -0x2375e,0xe3760,0x23757,0xe6570,0xe6571,0x00000,0x00000,0x00000, -0xe6572,0x00000,0x00000,0x00000,0x23e4c,0x1607c,0x23e54,0xe3d5c, -0x23e49,0x00000,0x23e55,0xe3d59,0x23e4a,0x23e4b,0xe3d5d,0x00000, -0x23e53,0x23e52,0x23e4f,0x15c3d,0x1607d,0x23e4d,0x23e50,0x1607e, -0x23e51,0x23e4e,0x00000,0x00000,0x00000,0x00000,0xe3d5a,0x00000, -0xe4331,0x24554,0xe432d,0x24558,0x16555,0xe432e,0x24c38,0x16558, -0x24556,0xe4337,0xe4329,0x24553,0x2454e,0x24550,0x24551,0x2454a, -0xe4335,0x16554,0xe432b,0xe4330,0x16553,0xe4334,0x1654f,0x2454d, -0xe432a,0x16556,0xe4336,0x16557,0x2454c,0x2454f,0x24557,0x16551, -0x16552,0x24555,0x2454b,0x00000,0x00000,0x00000,0x24c3a,0x16977, -0x24c3c,0x24552,0x24c3e,0x1697b,0x24c3f,0x24c3b,0xe483e,0x16978, -0x24c37,0x1697a,0x24c34,0x24c39,0x24c3d,0x24c36,0xe483f,0xe4845, -0x16550,0xe4844,0x24c33,0x16979,0x24c35,0x00000,0x00000,0xe6573, -0xe4840,0x00000,0x16d7d,0x25249,0x16e23,0x00000,0x16e21,0x00000, -0xe4d4a,0x16976,0xe4d4d,0x25250,0x25251,0x16d7c,0xe4d48,0xe4d4c, -0x2524f,0x25252,0x16d7e,0x16d7b,0x2524b,0x25248,0x2524d,0x2524a, -0x16e24,0x2524c,0xe4d4b,0xe4d49,0x2524e,0x16e22,0xe5221,0x00000, -0xe6574,0x00000,0x17154,0x25872,0xe5224,0x2586c,0x25870,0x25876, -0x25877,0x25873,0x25874,0x25871,0x00000,0x2586e,0x00000,0x17156, -0x17153,0x2586d,0x2586f,0xe5222,0x17155,0x25875,0xe6575,0x17450, -0xe5560,0xe5562,0x25d75,0x25d6f,0x1744f,0x00000,0x00000,0x1744d, -0xe5561,0x25d77,0x1744e,0x25d72,0x25d73,0x25d70,0x25d78,0x25d74, -/* 0x7900 */ -0x00000,0x17451,0x25d71,0x00000,0x25d79,0x25d76,0xe5843,0xe583e, -0xe5840,0x26246,0xe583f,0xe583c,0x26243,0xe5842,0x17670,0x00000, -0x26247,0x26249,0x26248,0x26244,0x26245,0xe5844,0x00000,0x2662d, -0xe5a61,0x17855,0xe5a62,0x2662a,0x2662c,0x26629,0x2662e,0x00000, -0xe5a63,0x2662b,0xe6576,0x26949,0x2694c,0x26948,0x1797c,0x2694a, -0x2694b,0x2694d,0x1797d,0x17a21,0x1797e,0x26b6f,0xe5e45,0x26b71, -0xe5e43,0x26b70,0xe5e44,0x00000,0x00000,0x26d64,0x00000,0xe603c, -0x27043,0x2712a,0x1467c,0x00000,0xe2433,0x22472,0x14f23,0x22843, -0x14f24,0x14f25,0x22842,0x00000,0x22c5a,0x22c59,0x15269,0x1526c, -0x1526b,0x1526a,0x22c56,0x22c58,0x22c57,0xe6577,0x00000,0x2314b, -0x1572a,0x2314f,0x2314e,0x2314d,0x23149,0x15729,0x1572d,0x15730, -0xe326f,0xe3270,0x15731,0x2314a,0x2314c,0x1572f,0x1572e,0x1572c, -0x1572b,0x23765,0xe3272,0x23763,0x2375f,0x15c40,0xe3d5e,0x23760, -0x15c41,0x23761,0x23762,0x23764,0xe3766,0x15c42,0xe3765,0x00000, -0x23e59,0xe3d5f,0x23e58,0x23e57,0x23e56,0xe3d64,0xe3d62,0x00000, -0x00000,0x2455c,0x16559,0x00000,0x24559,0x2455b,0xe4338,0x1655a, -0xe433d,0x1655b,0x2455a,0xe4339,0xe3d63,0x00000,0xe6578,0xe4848, -0x24c48,0xe4847,0x24c41,0x24c42,0x00000,0x1697e,0x1697c,0x1697d, -0x24c4a,0x00000,0x24c49,0x24c46,0x24c45,0x24c44,0x24c43,0x24c47, -0x24c40,0xe6579,0x25253,0x25258,0x25256,0xe4d50,0xe4d51,0xe4d4f, -0x25255,0x25254,0x25257,0xe657a,0x25878,0xe5226,0x17157,0x17452, -0x25d7b,0xe5227,0x17453,0x25d7a,0x2624b,0x2624a,0x17671,0xe5845, -0x2662f,0x17856,0x2694e,0x17b6b,0x26d65,0xe603d,0x27045,0x27044, -0x22167,0x1526d,0x1526e,0x23766,0xe657b,0x1655d,0x1467d,0x14b35, -0x14b34,0x14b33,0x00000,0xe2a3e,0xe2a3d,0x22844,0xe2a3f,0xe2a42, -0x14f27,0x14f26,0xe2a44,0x15271,0xe654c,0x22c5c,0x22c5f,0x22c5d, -0xe2e42,0x1526f,0x15270,0xe2e40,0xe2e41,0x22c5b,0x22c5e,0xe2e43, -0x15738,0xe3274,0xe3273,0xe3279,0x23156,0x23158,0x23157,0x15735, -0x23152,0xe3276,0xe327b,0x15733,0x15732,0xe3277,0x15736,0x15734, -0xe3278,0x15737,0x23155,0x23150,0x23151,0x23154,0x23153,0x00000, -0xe327c,0xe3769,0xe3767,0xe376b,0x00000,0xe376a,0x23769,0x2376a, -0x23768,0xe376c,0x23767,0x15c43,0x00000,0x00000,0x00000,0xe3d65, -0x16125,0x00000,0x23e5a,0x23e5c,0x23e5e,0x16124,0x00000,0xe3d66, -0x16122,0xe3d69,0x23e5b,0x16123,0x23e5d,0x16121,0xe3d68,0xe4341, -0x24566,0x2455d,0x24560,0x24564,0x16561,0x24562,0x00000,0x24561, -0x2455e,0x2455f,0x1655f,0x24565,0x1655e,0xe4344,0x16563,0x16562, -0x16560,0x00000,0x24563,0x00000,0x00000,0xe6524,0x24c50,0x00000, -0x24c4f,0xe484b,0xe484d,0x24c4b,0xe4850,0xe484f,0x16a21,0x24c4e, -0x24c4d,0x16a22,0xe4852,0x00000,0x00000,0x00000,0x00000,0x16e29, -0xe4d55,0x2525a,0xe4d56,0x16e2a,0x16e26,0x16e28,0xe4d5a,0x16e25, -0x16e27,0xe4d53,0xe4d57,0x00000,0x25879,0xe522a,0x1715a,0x2587b, -0x2587a,0xe5564,0x24c4c,0x1715c,0x1715b,0x17158,0x17159,0xe522c, -0x00000,0x00000,0x00000,0xe5229,0x25e22,0x00000,0x25d7e,0x17454, -0x25e21,0x00000,0x25e23,0x25d7d,0x25d7c,0x00000,0x00000,0x2624c, -0x17674,0x17672,0x17673,0x00000,0xe5a66,0x00000,0xe5a65,0x26630, -0x26631,0x17858,0xe5a67,0x17857,0x26950,0x26951,0x2694f,0xe5c64, -0x26d66,0x26d67,0xe6076,0xe6077,0x1467e,0x22268,0x14b36,0x00000, -0x22845,0x14f29,0x14f28,0x22846,0xe2e44,0xe2e47,0x22c61,0x15272, -0x22c60,0x15273,0xe2e49,0xe2e48,0x15739,0x2315b,0x23159,0x2315f, -0x1573a,0x2315a,0x2315e,0x2315c,0x2315d,0x00000,0x00000,0x2376b, -0x2376d,0xe3772,0x15c44,0xe3771,0x2376c,0x15c45,0x16128,0x16127, -0x16126,0x23e5f,0xe3770,0x00000,0x00000,0x00000,0x24569,0x16564, -0x16565,0xe4346,0x24568,0x24567,0xe4347,0x00000,0x00000,0xe657c, -0x24c51,0x16a24,0x16a23,0x24c52,0x24c53,0x00000,0x16e2c,0x16e2b, -0xe4d5b,0x25921,0x2525b,0x2525d,0x2525c,0x2587e,0x2587c,0x25922, -0x2587d,0x00000,0x1715d,0xe522f,0x00000,0xe522e,0x25e24,0x17455, -0x25e25,0x25e26,0xe5568,0x00000,0x17675,0x17676,0x00000,0x17a22, -0xe5e49,0xe5e48,0x17c3d,0x14721,0xe267e,0xe2721,0x00000,0xe2a47, -0xe2e4e,0x22c62,0xe2e4f,0xe2e4d,0xe2e4b,0xe2e4c,0x00000,0x00000, -0x23160,0x1573b,0xe3323,0xe3326,0xe3327,0xe3324,0x00000,0x15d7e, -0x15d7d,0xe3773,0xe3d71,0x1612a,0x23e61,0x16129,0x23e60,0xe3d70, -0x00000,0xe4349,0xe434a,0x2456a,0xe4854,0x16a25,0x24c54,0x16a26, -0xe4855,0xe5230,0xe5569,0xe556a,0x00000,0xe5849,0x17a23,0x26952, -0xe5f55,0x1484c,0x14f2a,0x22847,0xe2e51,0x15275,0xe2e50,0x15274, -0x22c63,0x22c64,0x00000,0x00000,0x23162,0x23164,0x1573c,0x00000, -0x23166,0x23169,0x23167,0xe332b,0x00000,0xe332a,0x23168,0x23165, -0x23161,0x1573d,0x2316a,0x23163,0xe332c,0x00000,0xe3778,0xe3779, -0x23776,0x15c4b,0x23821,0x15c48,0xe3777,0x23778,0x15c4c,0xe377b, -0x15c46,0xe3776,0x23773,0x23822,0x23774,0x23771,0x15c4a,0x00000, -0x15c47,0xe632d,0x23777,0x2377a,0x15c49,0x2377b,0x15c4d,0x2377c, -0x23772,0x23779,0x2377d,0x23775,0x23770,0x2376e,0xe377a,0xe657d, -0x2377e,0x00000,0x00000,0x2376f,0x00000,0x00000,0x00000,0x00000, -0x23e68,0xe3d7b,0xe3d78,0xe3d75,0x23e64,0x23e6a,0x1612d,0x23e63, -0x23e65,0x1612b,0x23e62,0x16132,0x23e66,0x16131,0x23e67,0x16133, -0x1612e,0x16134,0x1612f,0xe3d79,0x16130,0xe3d72,0x1612c,0xe3d76, -0x23e69,0xe657e,0x00000,0x00000,0x00000,0x00000,0xe434f,0x00000, -0x16568,0x24575,0xe434c,0x24578,0x2456c,0x24571,0x2456b,0x1656a, -0xe4355,0x2456f,0x00000,0xe434d,0xe3d77,0x2456d,0x16569,0xe4354, -0x24574,0x24573,0x24570,0x24572,0x2456e,0x16a2a,0x24577,0x16566, -0x24576,0xe4351,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe4856,0x24c64,0xe4858,0x16a31,0x24c5f,0xe4860,0x16a30, -0x24c55,0x00000,0x24c57,0x16a29,0x24c5c,0x24c5b,0x24c5e,0x16a2e, -0x24c59,0x24c58,0xe485a,0xe485e,0x16a2d,0x16a28,0x24c5a,0x16a2b, -0x24c60,0x24c62,0x00000,0x24c5d,0x24c56,0x16a2c,0xe4857,0xe485d, -0x16e34,0x16a27,0x00000,0xe485c,0x24c63,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x25261,0x16e2d,0xe4d5c,0x25263, -0x00000,0x16e2e,0xe4d65,0xe4d5d,0x16e30,0x25266,0x00000,0x2525e, -0x16a2f,0x25264,0x00000,0x00000,0x00000,0x00000,0x25260,0xe4d60, -0x16567,0x16e33,0xe6367,0xe6366,0x16e2f,0x00000,0x16e31,0x16e32, -0x00000,0x17160,0x25265,0x2525f,0x16e35,0xe4d63,0x25262,0x00000, -0xe6621,0x00000,0x00000,0x00000,0x2592c,0x25927,0x00000,0x00000, -0x25931,0x1715e,0x25929,0x17162,0x2592f,0x25926,0x25923,0x25932, -0x1745b,0x17163,0x2592e,0x25924,0x17161,0x25928,0x17165,0x25925, -0x2592a,0x17164,0x2592d,0x25930,0xe5233,0xe5234,0x00000,0x00000, -0x25e38,0x25e39,0x25e29,0x25e30,0x25e2e,0x00000,0xe556d,0x17459, -0x25e35,0x2592b,0xe556b,0x25e2c,0xe556e,0x25e36,0x17458,0x25e2b, -0x25e2a,0x25e34,0x25e31,0x25e33,0x00000,0x25e27,0x25e37,0x17456, -0xe5570,0x25e32,0x25e3b,0x25e2f,0x1745a,0x17457,0x25e2d,0x25e28, -0x25e3a,0x1715f,0xe5571,0x00000,0x00000,0x00000,0x00000,0x00000, -0xe556f,0x2624f,0xe5850,0xe584e,0x2624d,0x26253,0x1767a,0x26251, -0x26250,0x1767c,0x26256,0x1767b,0xe5851,0x26257,0x26254,0x17678, -0x26255,0x2624e,0x17679,0x17677,0x26635,0x26252,0xe584c,0xe6622, -0x26258,0x00000,0xe6623,0x26632,0xe5a6f,0xe5a6e,0x00000,0x1785d, -0x1785b,0x26634,0x00000,0x26636,0x26633,0x1785c,0x17859,0x1785a, -0x1785e,0x00000,0xe6624,0x17a25,0xe5c66,0x26957,0x00000,0x26956, -0x26954,0x26953,0x26955,0xe5c65,0x17a24,0x17a26,0xe6625,0x00000, -0x17a7b,0xe5e4c,0x00000,0x26b73,0x26b72,0x00000,0xe5e4b,0x26d68, -0xe5f58,0x26d6a,0x26d6c,0x26d6b,0x26d69,0xe5f57,0xe603f,0x17b6d, -0x17b6c,0x00000,0xe603e,0x17c3f,0x17c3e,0x17c40,0x26f3c,0x26f3b, -0xe6626,0x2712b,0x27046,0x2712c,0x17d25,0xe6144,0x17d26,0x2715c, -0x00000,0xe623a,0x17d4b,0x1484d,0xe2a49,0x22848,0xe2a48,0xe2e52, -0x22c66,0x22c67,0x22c65,0xe2e54,0xe2e53,0x15276,0x00000,0x22c68, -0x22c69,0x22c6a,0x00000,0xe3331,0x2316b,0x23171,0xe332e,0xe3330, -0x2316f,0x1573e,0x2316d,0xe3332,0x2316e,0x23170,0xe332d,0x00000, -0x00000,0x2316c,0x15c4e,0xe377d,0x23823,0x15c50,0x23825,0x15c4f, -0x23824,0xe377e,0xe3821,0xe383e,0xe3822,0x00000,0x23e6c,0x16135, -0xe3e21,0x23e6e,0x23e6b,0x23826,0xe3e23,0x16136,0xe3e22,0xe3d7e, -0x23e6d,0xe6627,0x00000,0x00000,0x00000,0x00000,0xe4358,0x2457b, -0xe435c,0x1656b,0x24579,0x1656c,0x2457a,0x1656d,0x00000,0xe4862, -0xe4861,0x16a32,0x24c68,0x24c65,0x24c67,0x16a33,0x16a34,0x24c66, -0x00000,0x00000,0xe4d6f,0xe4d71,0xe4d6d,0x25267,0xe4d70,0xe4d73, -0x25268,0xe4d72,0x16e36,0x2526a,0x25269,0xe4d6e,0x12323,0x00000, -0x25936,0x25937,0x25933,0xe5237,0x25934,0x17166,0x17167,0x25935, -0x00000,0x17461,0xe5575,0xe5574,0x1745d,0x17462,0x1745e,0x17460, -0x1745c,0xe5239,0x1745f,0xe5855,0x00000,0x00000,0xe5854,0x1767d, -0x25e3c,0x00000,0x26638,0x00000,0x26637,0xe6628,0x26958,0x17a27, -0x17a28,0x26d6e,0x26b74,0xe6169,0x26d6d,0xe6040,0x2712d,0x27172, -0x1484e,0x00000,0xe2722,0x14b37,0xe2a4b,0x22849,0x14f2b,0xe2a4a, -0x15279,0x22c6d,0x15277,0x22c6b,0x1527c,0x15278,0x1527d,0x1527b, -0x22c6c,0x1527a,0x15742,0x15741,0x2317c,0x1574a,0x23175,0x2317b, -0x15746,0x23174,0x2317a,0x23178,0x15745,0x15747,0x23177,0x15740, -0x23176,0x1574b,0x15748,0x1574c,0x15749,0x23173,0x23172,0x23179, -0x15743,0x1573f,0x15744,0x00000,0xe3337,0xe333b,0x00000,0x00000, -0x23835,0x2382e,0x00000,0x1613b,0x2382d,0xe3829,0x15c54,0x15c5b, -0x15c58,0x15c5e,0x15c5d,0x15c59,0xe3826,0x23827,0x2382a,0xe3827, -0x23829,0x15c55,0x2382b,0x23834,0x15c56,0x23828,0x23831,0x23832, -0x15c57,0x2382f,0x15c5c,0x15c52,0x15c5a,0x2382c,0x15c51,0x23830, -0xe382e,0xe3824,0x23833,0x00000,0xe382b,0xe3e34,0x23f21,0x23e76, -0x16138,0x23e7d,0x23e7a,0x23e72,0x23e7b,0x1613a,0x23e73,0xe3e29, -0x23e6f,0xe3e26,0xe3e2e,0x16573,0x23e78,0xe3e2f,0x16137,0x23e7e, -0xe3e28,0x1613e,0x16140,0x23e71,0xe3e2c,0x00000,0x1613f,0x23e74, -0x16139,0x23e7c,0x23e75,0x23e79,0xe3e2a,0x23e77,0x1613c,0x23e70, -0x16141,0x15c53,0x1613d,0x16142,0xe3e24,0xe3e35,0xe3e33,0x00000, -0xe4367,0x1656f,0x24624,0x24626,0x24628,0x2462c,0xe3e2b,0x24622, -0x2457e,0x16571,0x00000,0x24627,0x2462b,0x24623,0x2457d,0xe4366, -0x2457c,0xe4369,0xe4360,0xe4362,0x24629,0x24621,0x24625,0x16572, -0xe435e,0x16570,0x2462d,0x1656e,0x2462a,0xe4364,0x24c79,0xe4368, -0xe436a,0xe4363,0x00000,0x00000,0x16a37,0x24c71,0x16e43,0x24c7b, -0x16a3a,0x24d21,0x16a40,0x24c6c,0xe4874,0x00000,0x24c7c,0x24c69, -0xe486d,0x24c7e,0x24c6d,0xe486e,0x16a47,0x16a44,0x24c7d,0x24c77, -0x16a36,0x16a3e,0x16a3d,0xe4870,0x16a3c,0x16a42,0xe4869,0x24c6a, -0x16a43,0x24c78,0x16a3f,0x16a35,0x24c7a,0x16a38,0x16a39,0x16a41, -0x24c6f,0x24c6e,0x24c6b,0x00000,0x24c73,0x24c70,0x24c74,0x16a46, -0xe4868,0x24d22,0x16a3b,0x24c75,0x24c76,0xe4871,0x24c72,0xe4873, -0xe6629,0xe486b,0x16a45,0xe662b,0x00000,0x00000,0xe4e22,0x2526f, -0x16e3b,0x16e44,0x16e40,0x2526c,0xe4d7c,0x16e3d,0x16e41,0x25278, -0x16e37,0x25270,0xe4d78,0x16e3f,0xe4e24,0xe4e2f,0x25273,0x2526e, -0x16e3e,0x16e42,0x2526d,0xe4e2e,0x16e3c,0xe4d77,0x25277,0x16e39, -0x25276,0x25275,0x16e45,0x2503b,0x16e38,0xe4e2b,0x25274,0x2526b, -0xe4d75,0x16e46,0x25272,0x16e3a,0xe4e28,0xe4e29,0xe4e25,0xe4e2c, -0xe4e27,0xe4d7e,0xe4d7d,0x25271,0x00000,0x00000,0x00000,0xe662a, -0x1716a,0x1716f,0x17168,0x25944,0x2593b,0x25947,0x2593f,0x25945, -0x17170,0x17169,0x25938,0x2593e,0x25948,0x25941,0x25946,0x2593a, -0x00000,0xe523b,0x25942,0x1716b,0x25940,0x1716e,0x1716d,0x2593c, -0x2593d,0x25939,0x25943,0x1716c,0x2594a,0x25949,0xe5240,0xe523f, -0x00000,0x25e47,0x25e43,0x17469,0xe5579,0x25e3d,0x17463,0x17473, -0x25e49,0x1746b,0x17467,0x25e40,0x1746e,0x17471,0x25e4b,0x17466, -0x25e42,0x1746f,0x25e4d,0x25e4a,0x25e3e,0x1746a,0x17464,0x17472, -0x25e45,0x1746d,0x25e3f,0x17468,0x25e4c,0x1746c,0x17465,0x25e46, -0x17470,0x25e44,0x00000,0x00000,0x25e48,0xe557a,0x00000,0xe5859, -0x2625a,0x26260,0x17725,0x26263,0x1767e,0x17721,0x2625b,0x26262, -0x2625d,0x17726,0x17723,0xe585b,0x26259,0xe5858,0x17722,0x2625f, -0x26261,0x17724,0x2625e,0x2625c,0xe662c,0x00000,0xe585a,0x00000, -0x26642,0x17862,0x17863,0x1785f,0xe5a72,0x17860,0xe5a74,0x2663e, -0x2663c,0xe5a75,0x26640,0x17864,0x26641,0x2663a,0x26639,0x2663d, -0x2663b,0x17861,0x2663f,0x26959,0x17a2b,0x17a2a,0x2695a,0xe5c6c, -0x2695c,0x2695b,0x17a2c,0x00000,0xe5e53,0xe5e50,0x26b79,0x26b76, -0x26b77,0xe5e51,0x26b75,0x26b78,0x17a7d,0x26b7a,0xe5e52,0x17a7c, -0x00000,0x26d6f,0xe5f5a,0x17c41,0x17c43,0x26f3d,0x17c42,0x27047, -0x2712f,0x27131,0x2712e,0x27130,0x17d39,0x00000,0xe6235,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x7f00 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x1484f,0x00000, -0x1527e,0x23052,0x1574d,0xe3831,0x00000,0x15c5f,0x23f22,0x23f23, -0xe662d,0xe4877,0x00000,0x2594b,0x17474,0x25e4e,0xe557d,0xe585c, -0x17727,0x00000,0x26644,0x26643,0x17a2d,0x26b7b,0xe5f5b,0x26d70, -0x17c64,0x22269,0x00000,0x00000,0x14f2c,0x14b38,0x00000,0x00000, -0x22c6e,0xe2a4e,0x00000,0x23224,0x2317d,0x23223,0x23221,0x1574e, -0x23222,0x2317e,0xe333c,0x23836,0x00000,0x23f24,0x23f25,0x24630, -0x24631,0x16575,0x16576,0x2462f,0x24632,0x2462e,0x16574,0xe4878, -0x16a48,0xe4879,0x16577,0x24d23,0x00000,0x16e47,0x25279,0x16e48, -0xe4e30,0x17171,0x2594e,0x2594c,0x2594d,0x25e51,0x25e50,0x25e4f, -0x00000,0x00000,0x00000,0x26645,0xe6422,0x17865,0x26646,0x26d71, -0x17c65,0x27048,0x14850,0x14f2e,0x14f2d,0x22c70,0x15321,0xe2e5d, -0x00000,0x22c6f,0x23226,0xe333d,0x1574f,0x23837,0x23225,0xe333f, -0x00000,0xe333e,0x15c61,0x2383a,0x23838,0x23839,0x15c60,0x00000, -0x23f27,0x23f28,0x23f26,0xe436e,0x1657a,0x24634,0x24633,0x24635, -0x16579,0x16578,0x00000,0x00000,0x2527a,0x2527c,0xe4e31,0x16e49, -0x2527b,0x2594f,0x17172,0x26265,0xe585d,0x26264,0x17866,0x26647, -0x17868,0x17867,0x2695d,0x26b7c,0x17a7e,0x14851,0x22c71,0x15322, -0x23229,0x15751,0x23228,0x23227,0xe3342,0x15750,0xe3343,0x23840, -0x00000,0x23842,0x2383b,0x2383c,0x15c62,0x2383d,0x15c63,0x23841, -0x2383e,0x2383f,0x15c64,0xe3e37,0x16144,0x16145,0xe3e38,0x23f29, -0x00000,0x00000,0x00000,0x24636,0x24637,0xe4372,0x24d27,0x16a4b, -0x16a49,0x16a4a,0x24d24,0x24d25,0x00000,0x24d26,0x25323,0xe4e32, -0x25324,0x16e4a,0x25321,0x2527e,0x25322,0x2527d,0x17175,0x25950, -0x17173,0x17174,0x25e53,0x17475,0x25e52,0x26134,0xe557e,0x26266, -0x26267,0x17728,0xe5861,0x17729,0x17476,0x26648,0x26649,0x2695e, -0x17a2e,0x14852,0xe667b,0x14853,0x15753,0x14f2f,0x15752,0x22c72, -0xe3836,0x00000,0xe3344,0x16146,0x14854,0x15324,0x22c73,0x22c74, -0x15323,0x15325,0x14855,0x00000,0x22c75,0x15755,0x2322a,0x15757, -0x15754,0x15756,0xe3837,0x23845,0x15c65,0xe3839,0x23844,0x23843, -0x00000,0x24638,0x00000,0xe4922,0x24d28,0x00000,0x16e4b,0x00000, -0x17176,0x25952,0x25951,0xe5621,0x25e54,0x00000,0xe5862,0xe5c6f, -0x26b7d,0x00000,0x00000,0x14856,0x22473,0x2284a,0x15326,0x22c76, -0x00000,0x2322c,0x00000,0xe3349,0xe3348,0x15758,0x2322b,0x15759, -0xe3347,0xe662f,0x00000,0x23847,0xe383d,0xe383c,0x15c67,0x23846, -0x23848,0xe383b,0x15c66,0x00000,0x00000,0x00000,0xe3e3c,0x23f2b, -0x23f2c,0x23f2a,0x16147,0xe6729,0x00000,0x00000,0x1657b,0xe4373, -0x1657c,0xe6356,0x16a4d,0xe4923,0x24d2a,0x24d29,0x16a4c,0xe4926, -0xe3e3b,0xe4925,0x00000,0xe6630,0x25325,0xe4e34,0xe4e36,0x25326, -0xe4e37,0x00000,0xe4e35,0xe4e38,0x25953,0x00000,0xe5243,0x1747a, -0x17479,0x17477,0x17478,0x1747b,0xe5622,0x26268,0x1772b,0x1772a, -0x2664a,0x2695f,0xe5c70,0xe5c71,0xe5c72,0x17b6f,0x17b6e,0x14857, -0x00000,0x00000,0x22f7d,0x00000,0x1657e,0x16148,0x1657d,0x16a4e, -0x00000,0x14858,0x22168,0x14859,0x1485a,0xe2435,0xe2436,0x2284b, -0x22476,0xe2724,0x22477,0x14b3a,0xe2726,0x22474,0x14b39,0xe2725, -0x14b3c,0x22475,0x14b3e,0x14b3d,0x22478,0x14b3b,0x00000,0xe2723, -0x00000,0x14f34,0x14f32,0x2284d,0xe2a56,0x14f31,0xe2a5b,0xe2a58, -0xe2a4f,0x14f36,0x14f38,0x14f35,0xe2a59,0x22850,0x2284c,0x14f39, -0xe2a52,0x14f33,0x14b3f,0xe2a54,0x14f37,0x2284f,0xe2a57,0x00000, -0x2284e,0x00000,0x14f30,0xe6631,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x22c7c,0x1532a,0x1532b,0x22c7e,0xe2e66,0x22c78, -0x22c7b,0x22d26,0x22d24,0xe2e60,0x1532c,0x22d2a,0x1532f,0x22d27, -0x22c7d,0x22c7a,0xe2e61,0xe2e5e,0x23f2e,0x22d25,0x15327,0x22d28, -0x22c77,0x22d22,0x15329,0x1532e,0x22d23,0x15332,0x15330,0xe2e65, -0x22c79,0x1532d,0xe2e64,0x22d21,0x15331,0x15328,0x22d29,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x1575e,0xe334c,0x15767, -0x1575c,0x1575a,0x2322e,0x15762,0x1575f,0x23230,0xe334a,0xe3352, -0x15761,0x2322f,0x2322d,0x23232,0x15766,0x15764,0x23f2d,0xe334b, -0x23233,0x23231,0x1575b,0xe334e,0xe334d,0x1575d,0x15760,0xe334f, -0x15763,0xe2e63,0x15765,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0xe3e44,0x23852,0x15c69,0xe3849, -0x23849,0x2384b,0xe3847,0x2384c,0x00000,0x23854,0x23850,0x2384e, -0x00000,0x23851,0x23855,0x15c6a,0x15c6e,0x2384a,0x00000,0x23853, -0xe632e,0x15c6c,0xe3841,0x15c6b,0x2384f,0x2384d,0xe3842,0x15c68, -0x15c6d,0xe3845,0x00000,0x00000,0xe3848,0x00000,0x00000,0x00000, -0x00000,0x1614e,0x23f36,0xe3e3e,0x00000,0x23f34,0x16150,0x00000, -0xe3e43,0xe3e45,0xe3e41,0x23f2f,0x24646,0xe3e3d,0x1614f,0x23f33, -0xe3e40,0xe3e42,0x23f30,0x1614b,0x16151,0x23f35,0x1614d,0x23f32, -0x16a4f,0x1614c,0x23f31,0x16152,0x1614a,0x16149,0x00000,0x00000, -0x00000,0x00000,0x00000,0x2463e,0x2463c,0xe437b,0x24642,0xe437e, -0x2463a,0x24647,0x2463f,0xe4375,0x24639,0x16624,0x1662a,0x24644, -0x00000,0x2463d,0xe4376,0x16627,0xe4377,0xe4423,0x16625,0x24645, -0x16622,0x16621,0x24640,0x16626,0x16153,0xe437c,0x24643,0x2463b, -0x16623,0x16628,0x16629,0x00000,0x00000,0xe4422,0x00000,0x16a54, -0x16a50,0xe4927,0x16a55,0x24d2d,0xe492a,0x00000,0x24d2c,0x24d2e, -0x16a52,0x24d2b,0x16a53,0x24d31,0x24d30,0x24d2f,0x00000,0x16a51, -0x00000,0x00000,0xe4e3b,0xe4e3d,0xe4e39,0x2532a,0xe4e3c,0x2532d, -0x16e51,0x2532c,0x16e50,0x16e4c,0x16e4d,0x16e4e,0x25329,0x25328, -0x16e4f,0xe4e3a,0x2532b,0x25327,0x00000,0x00000,0x25955,0x2595f, -0x17179,0x17178,0xe5249,0x25959,0x2595b,0xe5247,0x25956,0xe5244, -0x2595a,0x25954,0x2595d,0x17177,0x2595c,0x25958,0x00000,0x2595e, -0xe5623,0x25957,0x1747e,0x25e55,0x25e5b,0x17524,0x17526,0x17523, -0x17522,0x00000,0x17521,0x1747d,0x25e56,0x25e59,0x1747c,0x25e5a, -0xe5624,0x17525,0x25e58,0x00000,0x25e57,0x1772c,0xe5865,0x1772d, -0x2626b,0x26269,0x2626a,0x00000,0xe5a77,0x2664c,0xe5a78,0x2664b, -0x17869,0x26961,0x17a2f,0x26960,0x00000,0x26b7e,0x26d72,0x17b70, -0x27132,0x27133,0x17c44,0x1485b,0x00000,0x14f3a,0x23f37,0x16a56, -0x17527,0x25e5c,0x1485c,0x00000,0x15769,0x15768,0x23f38,0xe3e47, -0x00000,0x00000,0x25960,0x1485d,0x15333,0x00000,0xe3e48,0x23f39, -0x23f3a,0x23f3b,0x16a57,0x1717a,0x1485e,0x00000,0x14f3b,0x22d2b, -0x1576a,0x23234,0x15c6f,0xe3e49,0x23f3c,0x1662b,0x00000,0x16a58, -0x1717b,0x17528,0x1772e,0x2664d,0x1485f,0x14f3c,0xe2a5d,0x00000, -0x1576b,0x23856,0x16154,0xe492b,0x16a59,0x24d32,0x2532e,0x00000, -0xe524a,0xe5868,0xe5a79,0x14860,0x16155,0x24648,0x16a5a,0x14861, -0x22851,0x22d2c,0x15334,0x00000,0xe2e68,0x23236,0x00000,0xe3357, -0x1576e,0xe3358,0x1576c,0x1576d,0x1576f,0xe3355,0x00000,0x23235, -0x00000,0x00000,0x2385b,0x23858,0x2385a,0x15c70,0x15c72,0x15c71, -0x23857,0x15c73,0x23859,0x00000,0x23f3d,0x23f3e,0x00000,0x23f3f, -0x2464b,0xe4426,0x2464c,0x00000,0x2464a,0x2464d,0x00000,0x1662c, -0xe6634,0x24649,0xe492d,0x16a5b,0xe492e,0x00000,0x25333,0x2532f, -0x25332,0x25334,0x25331,0x25330,0x00000,0x25961,0x25962,0x25963, -0x1717c,0x1717d,0x25e5e,0x25e5d,0x25e5f,0x00000,0x2626d,0x2626c, -0x00000,0x2664f,0xe5a7a,0x26650,0x2664e,0xe5a7b,0x17a30,0x00000, -0x26962,0x26963,0xe5e55,0x26d73,0x26f3e,0x27049,0x14862,0x14b40, -0x00000,0x17529,0x14863,0x00000,0x2385c,0x23f40,0xe5a7c,0x17c6c, -0x2226a,0x00000,0x00000,0xe2438,0x2226b,0x2226d,0x14864,0x2226e, -0x2226c,0x00000,0x00000,0x22522,0x22523,0x2247b,0xe2728,0x00000, -0x00000,0x00000,0x22521,0x14b42,0xe2729,0x14b43,0x2247c,0x2247a, -0x22479,0x2247d,0x14b41,0x2247e,0x22d2d,0xe272b,0x00000,0x00000, -0x22856,0x14f3f,0x22855,0x22857,0xe2a60,0x14f3e,0x2285c,0x14f42, -0x22852,0x22860,0x22866,0x14f49,0x22863,0x14f46,0xe2a6b,0x22859, -0x2285f,0x22861,0xe2a66,0x22854,0x14f45,0x14f40,0x2285a,0x14f47, -0x14f4a,0x14f44,0xe2a6c,0x14f3d,0x2285e,0x22858,0x22865,0x14f4c, -0x14f48,0x14f43,0x2285d,0x15770,0x2285b,0x14f41,0x14f4b,0x00000, -0x22853,0x00000,0x22862,0x22864,0xe2a5e,0x00000,0x00000,0x00000, -0x00000,0xe2a68,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0xe2e76,0x15345,0x1533f,0x15347,0x15344,0x22d34,0x22d37,0x15340, -0xe2e6a,0x22d2e,0x00000,0x15339,0x15343,0xe2e6b,0x15346,0x15348, -0x22d43,0x22d3a,0xe2e78,0x15338,0x22d42,0x1533c,0x1533a,0x15335, -0x22d32,0xe2e72,0x22d41,0x22d36,0x22d39,0x22d46,0xe2e74,0x15349, -0x22d40,0x15341,0x22d3b,0x22d45,0x22d38,0x22d3c,0x22d3f,0xe2e69, -0xe2e6e,0x22d30,0x22d44,0x22d3e,0xe2e6f,0xe2e7a,0x22d2f,0x00000, -0x22d33,0x15342,0x1533d,0x15336,0x1533b,0x15337,0x1534a,0x22d31, -0x23247,0x1533e,0x00000,0xe2e79,0x22d3d,0x22942,0xe2e77,0x00000, -0xe6635,0x00000,0xe6637,0x00000,0x00000,0x00000,0x2324a,0x1577e, -0xe3362,0x2323a,0x00000,0x23245,0x23241,0xe384d,0x23254,0xe3359, -0x2324c,0xe335f,0x23242,0xe385b,0x2324b,0x2323c,0x23240,0x23257, -0x15823,0x2324f,0x23246,0x15771,0x23255,0x23238,0x00000,0x2324e, -0x00000,0x15822,0x1577b,0x23237,0x15779,0x15778,0x1577d,0x2324d, -0x15775,0x1577c,0x22d35,0x23f41,0x23248,0x00000,0xe2a5f,0x2323e, -0x15821,0x2323f,0x23243,0x15824,0x23239,0x23251,0xe3e57,0x23250, -0x23258,0x15777,0x15774,0x23256,0x23252,0x23249,0x23244,0x1577a, -0x15776,0x2323b,0x15772,0x23253,0x15773,0x00000,0x2323d,0xe335a, -0xe3363,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0xe6636,0xe2d33,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0xe384e,0xe3851,0x23862,0x23864,0x23869,0x2387d,0x15d23, -0x15c77,0xe3854,0x23861,0x15d24,0x15d25,0x2386c,0x23873,0x23879, -0xe3850,0x23866,0x00000,0x2386d,0xe384f,0xe385d,0x15d26,0x2387b, -0x23876,0x15d21,0x15c7d,0x23872,0x2386e,0x23860,0x15c74,0x23865, -0x2385d,0xe3855,0x15c7c,0x15c7e,0x2386a,0x23867,0x15c79,0x23877, -0x15c76,0x23868,0x23f6a,0x23870,0xe385e,0x2386f,0x15c75,0xe3857, -0x15d22,0xe3852,0x15c78,0x2385e,0x23863,0x23874,0x2387a,0x15d27, -0x2385f,0x2386b,0x23871,0x15c7b,0x00000,0xe3858,0x2387c,0x23875, -0x23878,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0xe385f, -0x00000,0x00000,0x00000,0x00000,0x00000,0x15c7a,0x00000,0x23f51, -0x23f45,0x1615d,0x23f62,0x23f6b,0x23f6e,0x1615b,0x23f4d,0x23f66, -0x23f4e,0x23f5c,0x16168,0x23f58,0x16165,0xe3e5e,0x23f59,0x23f42, -0x00000,0x23f67,0xe3e4f,0xe3e59,0x1616e,0x23f64,0x23f5a,0x23f70, -0x23f55,0x2466d,0xe3e4d,0x23f73,0x1616c,0x23f53,0x23f5f,0x1616f, -0x1615a,0x23f57,0x23f71,0x23f50,0x23f49,0x23f54,0xe3e5f,0x23f48, -0x23f46,0x16156,0x23f68,0x23f4f,0x23f6c,0xe3e4b,0x23f6d,0x1615e, -0x16163,0x1615f,0x16167,0x23f63,0x16160,0x23f5b,0x23f4b,0x00000, -0x16158,0x23f43,0x23f65,0x23f6f,0x23f4a,0x16166,0x23f74,0x23f56, -0xe3e52,0x23f52,0xe3e5c,0x16157,0x1616b,0xe3e5a,0x23f61,0x1616d, -0xe3e50,0x23f5d,0x16162,0x1615c,0x16164,0x16159,0x1616a,0x23f5e, -0x23f4c,0x23f60,0x23f47,0x23f69,0xe3e58,0x00000,0xe3e5d,0xe3e56, -0xe3e4e,0x00000,0x00000,0x23f72,0x00000,0x00000,0xe6639,0xe3e5b, -0x00000,0xe6638,0x00000,0x23f44,0x00000,0x00000,0x00000,0x00000, -0x00000,0x2466c,0xe442d,0x24724,0x1655c,0x24671,0xe4431,0x2466f, -0x2465a,0x16630,0x2466a,0x2467e,0x24666,0x16638,0x2467d,0x24664, -0x16169,0x24674,0x24665,0x2467b,0x16637,0x1662f,0xe443a,0x2464f, -0x24657,0xe4435,0x24670,0x24668,0x24723,0x2466b,0x1663d,0x2467c, -0xe442c,0x16634,0xe443e,0x2466e,0x24676,0x2465b,0x24675,0xe4427, -0x24728,0x24656,0x24677,0xe4433,0x24726,0xe443f,0x24650,0x16161, -0xe4440,0x2465e,0x2465d,0x16636,0xe4432,0x24661,0x24663,0x24672, -0x24725,0x16639,0xe4438,0x1663a,0xe4430,0x24655,0x16632,0x24659, -0x24721,0x1663b,0x00000,0x16633,0x16635,0x1663c,0x24727,0x24678, -0x24673,0xe443c,0xe442f,0x24660,0x2465f,0x16631,0x24651,0x1662e, -0x24669,0x24652,0x24667,0xe442e,0x00000,0x2465c,0x24722,0xe442a, -0xe4439,0x00000,0x1662d,0xe443b,0xe4428,0x00000,0x24658,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x24654,0x2467a,0x24653, -0x16a68,0x24d5a,0xe4935,0xe4944,0x24d49,0xe4933,0xe4938,0x24d33, -0x24d51,0x16a60,0x24d42,0x24d4c,0x16a63,0x24d45,0x16a61,0x24d36, -0x24d54,0x24d35,0x24d48,0xe493c,0x24d34,0xe4939,0x00000,0x24d46, -0x24d4f,0x24d4d,0x24d41,0x24d3c,0x24d3a,0xe4942,0x24d3b,0x24d4e, -0x24d59,0x24d43,0x16a62,0xe493b,0x24d3e,0xe493a,0x24d52,0xe4941, -0x16a65,0x24d3d,0x24d37,0x24d47,0x16a69,0xe4932,0x00000,0x16a5d, -0x16a66,0x24d3f,0x24d39,0xe4936,0x16a5f,0x24679,0x16a5e,0x24d4a, -0xe4436,0x16a5c,0x16a6b,0x16a64,0x24d4b,0x24d40,0x24d38,0x24d53, -0x24d44,0x16a6a,0x24d57,0x16a67,0x24d56,0xe493f,0x24d50,0x24d55, -0xe493e,0x00000,0xe4943,0x24d58,0x00000,0x00000,0xe663b,0x00000, -0x00000,0xe663c,0xe663a,0x00000,0xe493d,0x00000,0x00000,0x2535c, -0x2535d,0x25350,0x2534f,0x2534b,0x16e5d,0xe4e4f,0x16e55,0x2535f, -0x2535e,0x2464e,0x25348,0x2534c,0x25346,0xe4e44,0x25359,0x2534a, -0xe4e42,0x25360,0x25343,0x25341,0x2534d,0x25357,0x25352,0x16e5f, -0x25338,0xe4e40,0x25356,0xe4e4c,0xe4e46,0xe4e54,0x16e60,0x24662, -0x25344,0x2533b,0x2533e,0x25364,0x25345,0x2533c,0x2533a,0x25337, -0x00000,0x16e59,0x2534e,0x16e58,0x16e5c,0x25349,0x25351,0x16e52, -0x25361,0x25365,0x16e54,0xe4e4b,0x25340,0x25354,0x25358,0x2533d, -0x25362,0x16e5b,0x00000,0x16e5a,0x25335,0x16e5e,0x2535b,0x2533f, -0x25353,0x25339,0x25347,0x25342,0x16e56,0x16e57,0x25355,0x25366, -0x25363,0x2535a,0x00000,0xe4e4d,0xe4e4e,0xe4e52,0x00000,0x00000, -0x00000,0x00000,0x00000,0x25336,0x00000,0x16e53,0x25974,0xe525a, -0x2596b,0x2596e,0xe5252,0x17225,0x25970,0x25965,0x2596c,0x25972, -0x17222,0x17226,0x1717e,0xe5259,0xe5250,0x25967,0x25977,0x00000, -0x00000,0x25971,0x00000,0x25968,0x25a22,0x2597a,0x25964,0x25e72, -0x2596a,0x17221,0xe5258,0x25975,0xe5254,0x25a21,0x17229,0xe5256, -0x2597c,0x25969,0x2596f,0x25973,0x2596d,0x25a23,0x2597e,0x2597b, -0x17223,0x17224,0x17228,0x25966,0x25a24,0x17227,0x25978,0xe524f, -0xe5255,0x25976,0x00000,0xe663d,0x00000,0x25979,0x25f21,0x25e6c, -0x25e71,0x25e7e,0x25e70,0x25e68,0x25e6d,0x00000,0x1752c,0xe562b, -0x25e61,0x25e79,0x25e7b,0x25e60,0x1752b,0x25e7d,0x25e75,0x17532, -0x25e7c,0x25e6e,0x17534,0x25e66,0x2597d,0x25e76,0x25e73,0x25e62, -0x25f23,0x1752e,0xe5628,0xe5629,0x1752f,0x25e64,0x25e74,0xe562d, -0x25f22,0x25e77,0x25e6a,0x17531,0x1752d,0x25e78,0x25e6b,0x25f24, -0x25e65,0x25e6f,0x25e7a,0x25e67,0x25e69,0x00000,0x17535,0x25e63, -0x17533,0x17730,0x1752a,0xe562c,0xe5630,0x00000,0x00000,0x17530, -0x17734,0x2627d,0xe586c,0x26273,0x2626e,0x26274,0x2627e,0x26324, -0x26323,0x17736,0x17735,0xe586e,0x00000,0x26275,0x26325,0x26278, -0x26270,0xe586f,0x26272,0x26271,0x26277,0x2627c,0x2626f,0x26276, -0x2627b,0x17733,0x00000,0x26279,0xe586b,0x17731,0x2627a,0x1772f, -0x17732,0x26660,0x26321,0x00000,0xe663e,0x1786d,0xe5a7e,0x26658, -0x2665c,0x26654,0x26657,0xe5a7d,0x2665f,0x1786b,0x26664,0x2665d, -0x00000,0x26655,0x26665,0x2665e,0x1786e,0x1786f,0x26662,0xe5b22, -0x26656,0x1786a,0x1786c,0x26651,0x26659,0x26653,0xe5c7b,0x26663, -0x26661,0x26652,0x2665a,0x00000,0xe5b25,0xe663f,0x2696a,0x17870, -0x2665b,0x17a32,0x17a34,0x17a31,0xe5c76,0x2696f,0x26967,0x26965, -0x26969,0x26966,0xe5c78,0xe5c7c,0x2696b,0x2696d,0x17a35,0x17a37, -0xe5d22,0x2696c,0x17a38,0x17a36,0x2696e,0xe5c7e,0x00000,0xe5d23, -0xe5c77,0x17a33,0x00000,0xe5d21,0x00000,0xe5e5b,0xe5e5a,0x17b21, -0x26c21,0x26c27,0x17b23,0x26968,0x26c26,0xe5e5c,0x26c2d,0x26c24, -0x26c2b,0x26c2a,0x26964,0x26c25,0x26322,0x26c2e,0x26c23,0x26c28, -0xe5e58,0x26c2c,0x26c22,0xe5e56,0x26d77,0x17b22,0x26c29,0xe5e57, -0x00000,0x26f43,0x26d78,0x26d76,0x26d74,0x26d75,0x26d79,0xe6640, -0x17c45,0x26f41,0x26f3f,0x26f44,0x26f42,0xe6043,0x26f45,0x17c46, -0x26f40,0xe602f,0xe6146,0x2704a,0x00000,0xe6641,0x27134,0x27135, -0x27136,0xe6147,0xe617c,0x27235,0x2722d,0x2226f,0x14f4d,0x00000, -0x1534b,0x00000,0x2325a,0x23259,0x15825,0x15d28,0x23921,0xe3863, -0xe3860,0x2387e,0xe3861,0x16170,0x1663f,0xe3e61,0x1663e,0x16640, -0x00000,0x24d5b,0x25367,0x25a25,0x25a27,0x25a26,0x00000,0x17536, -0x25f25,0x26326,0x27173,0x14865,0xe272d,0x22869,0x2286a,0x22868, -0x22867,0x14f4e,0xe6642,0x22d4a,0x22d48,0xe2f23,0xe2e7c,0x22d47, -0xe2e7e,0x1534c,0x1534e,0x1534d,0x22d49,0xe2f24,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0xe3369,0x23266,0x23263,0x23261, -0x00000,0xe336c,0x15826,0x23264,0x1582b,0x2325e,0x2326d,0xe336f, -0x2326f,0x2325f,0xe336e,0x15828,0x23270,0x2326b,0x2325d,0x23262, -0x2326c,0x23268,0x23265,0xe336b,0x1582d,0x2326e,0x23260,0xe336a, -0xe3370,0x23269,0x2325b,0x1582c,0x15829,0x23267,0xe336d,0x2326a, -0x2325c,0x1582a,0x15827,0x00000,0x00000,0x00000,0xe3866,0x15d32, -0x23928,0x15d31,0xe3864,0x2392b,0x2392e,0x15d2e,0x15d2c,0x23923, -0x2392c,0x2392a,0x23927,0x2392f,0x23930,0x23932,0x23933,0x23922, -0x15d2b,0x23925,0x23924,0x23931,0x15d2d,0x23926,0x15d2f,0x15d2a, -0x23929,0x15d33,0x00000,0x15d30,0x2392d,0x00000,0x00000,0x00000, -0x16177,0x24025,0x00000,0x23f78,0x16174,0xe3e62,0x2472e,0x24023, -0x23f75,0x16172,0x23f7a,0x16175,0x23f7e,0x23f7c,0x16178,0x16171, -0x00000,0xe3e63,0x23f76,0x23f79,0x16176,0x00000,0x23f77,0x00000, -0x24024,0x24022,0x23f7b,0x23f7d,0x24021,0x16173,0xe3e68,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x2472f,0x24735,0x2472b, -0x24731,0x16641,0x2472d,0x16647,0xe4444,0xe4445,0x16646,0xe4449, -0x16645,0x24734,0x16648,0x16649,0x2472a,0x24737,0x1664a,0x16644, -0x16643,0x24733,0x1664b,0x24729,0x2472c,0x24736,0x24732,0x00000, -0x00000,0x24d7b,0x24d70,0x16642,0x00000,0xe4446,0xe4448,0x00000, -0x16a72,0x24d64,0x24d79,0x24d65,0x16a6d,0xe494f,0x24d62,0x00000, -0x24d6b,0x24d63,0x16a6f,0x24d5d,0x24d78,0x16a70,0x24d75,0x24d76, -0x24d5e,0x16a75,0x24d6d,0xe494a,0x24d67,0x24d6e,0x24d61,0x00000, -0x24d7a,0x24d72,0x24d6c,0x24d5c,0x16a71,0x24d73,0xe4945,0x16a74, -0x24d77,0xe494c,0x24d71,0x16a6e,0x24d6f,0xe4949,0x24d69,0x16a6c, -0x24d60,0x24d68,0x24d74,0x24d66,0x00000,0xe494e,0x24d6a,0xe494b, -0x00000,0x00000,0xe6643,0x00000,0x16e6a,0x24730,0x25379,0x25424, -0x25378,0x25374,0x25371,0x16e6b,0x2536f,0x16a73,0x25368,0x16e69, -0x2536e,0x16e68,0x25373,0x25370,0x25422,0x2537b,0x25375,0x2537a, -0x16e64,0x25372,0x25427,0x25369,0x2536a,0x25423,0x16e65,0x25428, -0x16e67,0x25429,0x25377,0x24d5f,0x2537d,0x25376,0x25421,0x2537c, -0x00000,0xe4e5d,0x00000,0x2536d,0x16e62,0x25426,0x16e63,0x2536b, -0x16e66,0x25a32,0x2537e,0x25425,0x00000,0xe4e59,0x00000,0x00000, -0x00000,0x25a2f,0x16e61,0x1722a,0x25a39,0x25a35,0x00000,0x25a33, -0x25a2e,0x25a3d,0xe525b,0xe525d,0x00000,0x1722e,0xe525f,0x25a2a, -0x25a36,0x25a37,0x25a2d,0x25a2c,0x25a3a,0x00000,0x25a30,0x25a2b, -0x25a31,0xe5262,0x25a3c,0x25a29,0x25a3b,0x25a38,0x1722c,0x1722b, -0x00000,0xe525e,0x1722d,0x25a34,0x25a28,0xe6645,0x00000,0x00000, -0x00000,0xe6644,0x25f27,0x1753c,0x25f2b,0x25f28,0x25f2f,0x25f35, -0x25f2a,0xe563a,0x25f3e,0x17539,0x25f38,0x25f2d,0x25f39,0x25f34, -0x25f3b,0x25f2c,0x1753e,0x1753d,0x25f2e,0x25f3c,0x25f26,0x25f3a, -0x17537,0xe5639,0x25f32,0x25f31,0x25f36,0x25f29,0x1753b,0xe563b, -0x1753f,0x25f30,0x25f37,0x17540,0x25f33,0xe5636,0xe5634,0x00000, -0x00000,0x17538,0x1753a,0x26333,0x26331,0xe5b28,0xe5876,0x26337, -0x26335,0x26338,0xe5878,0x2632a,0x26332,0x2633c,0x25f3d,0x2632e, -0x1773a,0x2536c,0x26329,0x26336,0x26330,0x2632d,0x26328,0x26327, -0x2633b,0xe5873,0x2632c,0x2632b,0x17738,0x26334,0xe5874,0x17737, -0xe5875,0x00000,0x17739,0x2632f,0x2633a,0xe6646,0x26669,0x2666a, -0xe5b2c,0x17874,0x26667,0x17871,0x2666f,0xe5b27,0x17875,0x26671, -0x26666,0x26339,0x26673,0x26668,0x00000,0x17872,0x2666e,0xe5b29, -0x26670,0x2666b,0x26672,0x2666d,0x2666c,0x17873,0xe5877,0xe5b2b, -0x26971,0x26972,0xe5d25,0x26974,0x17a39,0x17a3a,0x26975,0x26973, -0xe5d24,0x26970,0xe5e5d,0x26c31,0x26c34,0x26c30,0x00000,0x17b27, -0x26c32,0x17b26,0x17b25,0x17b24,0x26c33,0x26d7e,0x26d7c,0xe5f5f, -0x26d7b,0x26c2f,0x26d7d,0x26c35,0x26d7a,0xe6045,0x26f48,0x26f26, -0x26f46,0x17c47,0x26f47,0x26f49,0xe6647,0x2704d,0x17c66,0x2704c, -0x2704b,0x17c67,0x00000,0x17d27,0x2715d,0x27175,0x27174,0x27176, -0x14866,0x22d4b,0xe2f26,0x23271,0x23272,0xe386a,0xe3e6a,0xe3e69, -0x24026,0x00000,0x26c36,0x2704e,0x14867,0x1534f,0x22d4c,0xe3371, -0xe6648,0x00000,0x23934,0x15d34,0x00000,0x24028,0x24027,0x16179, -0xe444d,0x1664c,0x2542a,0x16e6c,0xe4e5f,0x16e6d,0xe5263,0xe5264, -0x00000,0x1722f,0x17c68,0x14868,0x00000,0x00000,0xe2f27,0x22d4d, -0x14f50,0x22d4f,0x22d4e,0x15350,0x00000,0x23273,0xe3374,0x2327a, -0x1582e,0x23278,0x23276,0xe3377,0x2327d,0x23274,0x23275,0x1582f, -0xe3372,0x15833,0xe3373,0xe3375,0x2327e,0x15832,0x2327c,0x23279, -0x23277,0x15830,0x15831,0x2327b,0xe3376,0x00000,0x00000,0xe6649, -0x15d36,0x23935,0xe3872,0x15d3b,0x23945,0x15d3a,0x23947,0xe386e, -0xe3874,0x2393b,0x15d38,0x23946,0xe386c,0x23936,0x15d39,0x23942, -0x2393e,0x23940,0x2393a,0x23941,0xe386b,0x00000,0x15d35,0x2393d, -0xe3873,0x2393c,0x23938,0xe386d,0x23943,0xe386f,0xe3871,0x2393f, -0x23937,0xe3870,0x23939,0x15d37,0x23944,0x00000,0x00000,0x00000, -0x00000,0x1617c,0x24033,0x00000,0xe3e70,0xe3e72,0x2402f,0x24031, -0x2402c,0x2402b,0x24029,0xe3e6d,0x24030,0x24032,0x2402e,0xe3e6f, -0x2402d,0x1617a,0x1617b,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x24035,0x16654,0x24739,0x2473f,0x2473a,0x2473b,0xe444e, -0x24740,0x00000,0x16656,0x00000,0x1664e,0x16655,0x24738,0x2402a, -0x16651,0x1664f,0x2473e,0x2473d,0x16650,0x16652,0x2473c,0x1664d, -0xe444f,0x16653,0x00000,0x00000,0x00000,0x00000,0xe4e60,0x24d7d, -0x16a7c,0xe4959,0xe4952,0x24e2a,0x24e29,0xe4957,0x24e24,0x16a7e, -0x24e28,0x24d7e,0x24e21,0x16a76,0x16a78,0xe4954,0x24e26,0x24d7c, -0x16a7a,0x16a79,0x24e22,0x24e27,0x24e25,0x16a7b,0x24e23,0xe4951, -0xe4956,0x24034,0x16a77,0xe4958,0x00000,0x2542b,0x25432,0x16e6f, -0x00000,0x25436,0x16e73,0x2542e,0x2542c,0x00000,0x25435,0xe4e61, -0x16e6e,0x25434,0x16e70,0x16e71,0x2542d,0x16e72,0x25433,0x2542f, -0x25430,0x25431,0x16a7d,0xe4e62,0x00000,0x00000,0x25a3e,0x25a4a, -0x00000,0x17234,0x25a45,0x25a47,0xe5265,0x17232,0x25a3f,0x25a43, -0x00000,0x25a46,0x17230,0x17233,0x25a49,0x25a41,0x25a42,0x25a48, -0x25a40,0x25a44,0x17231,0x25f40,0x00000,0x25f3f,0x17542,0x25f45, -0x17544,0xe5640,0x00000,0x17541,0x25f41,0x17545,0x25f42,0xe563f, -0xe563d,0x25f43,0x25f46,0xe5642,0x17543,0x00000,0x26341,0x00000, -0xe5879,0x26344,0xe587a,0x2633e,0x26340,0xe587c,0xe587b,0x2633f, -0x26342,0x26343,0x25f44,0x2633d,0xe664a,0x00000,0x17878,0x26677, -0x2667a,0x2667c,0x26675,0x26676,0x26679,0x2667b,0x17879,0x17877, -0x17876,0x26678,0x26674,0x26976,0x17a3b,0xe5d29,0x26977,0xe5d28, -0x00000,0x26c38,0x17b28,0x26c3a,0x17b29,0x26c37,0x26c39,0x17b72, -0x00000,0x26e21,0x17b71,0x26f4c,0x26f4b,0x00000,0x26f4a,0x00000, -0xe6149,0x27137,0x27138,0x2713a,0x27139,0xe617d,0x22270,0x14869, -0x00000,0x15351,0x23948,0x1617d,0xe664b,0x24741,0x1773b,0xe5b2f, -0x2667d,0xe6046,0xe614a,0x14b44,0xe2f29,0x00000,0x00000,0x15d3d, -0x00000,0xe3876,0xe3875,0x15d3c,0xe3877,0x24036,0x1617e,0x24038, -0x24037,0x00000,0xe3e74,0x24742,0x16657,0x24e2b,0x24e2e,0x24e2d, -0x00000,0x24e2c,0x25437,0x25439,0x25438,0xe4e65,0x17236,0xe5266, -0x00000,0xe4e64,0x17235,0xe5646,0x17546,0x25f47,0x25f49,0x25f48, -0xe587e,0xe587d,0x1773c,0xe5921,0x00000,0xe5b31,0x26721,0x2667e, -0x00000,0x26978,0x17a3c,0xe5d2a,0xe5e61,0x17b2a,0x26e23,0x26e22, -0x17d28,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x14b45,0x22d50,0x15352,0x2394b,0x23949,0x00000, -0x00000,0x2394a,0x2403a,0x2403b,0x24749,0x24039,0x00000,0x24743, -0x24747,0x24746,0x24748,0x16658,0x24745,0x24744,0x2474a,0xe4454, -0x24e31,0x24e2f,0xe495c,0x24e30,0x2543c,0x2543a,0xe4e66,0x00000, -0x2543b,0x25a4b,0x25f4a,0x25f4b,0x1773d,0xe5b32,0x26722,0x26979, -0x17a3d,0x00000,0x26c3b,0x26e24,0x17b73,0x00000,0x26f4d,0x2713b, -0x14b46,0x00000,0x15354,0x15355,0x22d51,0xe2f2a,0xe2f2c,0x22d52, -0x15353,0x00000,0x15839,0xe337b,0x15837,0xe337a,0x15836,0x1583d, -0x15835,0x1583e,0x23321,0x1583b,0x00000,0x15838,0x1583c,0x1583a, -0x15834,0xe337c,0x00000,0x15d45,0xe387e,0x15d3f,0x2394f,0x15d44, -0xe3923,0xe3929,0x15d46,0x15d40,0x00000,0x15d41,0xe3879,0x2394d, -0xe387b,0xe3925,0x15d3e,0xe3922,0x2394e,0x15d43,0xe6330,0x00000, -0x2394c,0x15d42,0xe387a,0x00000,0x1622b,0xe3e7c,0x1622d,0x00000, -0xe3e7d,0x2403e,0x1622c,0x16221,0x16225,0xe3f24,0x1666b,0x2474f, -0x24040,0x16226,0xe3e7e,0xe3e75,0x24043,0x24044,0x1622a,0x00000, -0x24046,0xe3f21,0x24048,0xe3f23,0x24049,0x2403d,0x2403c,0x2404a, -0x16229,0x24047,0x24045,0x00000,0x16227,0x16223,0x1622e,0x24041, -0x24042,0x2403f,0xe3e78,0x16228,0x00000,0xe3f22,0x16224,0x00000, -0x16222,0x2474e,0x16666,0x16661,0xe4460,0xe4459,0x1665c,0xe4463, -0x1666c,0x1665d,0xe4455,0x16659,0x16668,0x16665,0x16667,0xe4458, -0x1665e,0x16663,0x1665a,0x1665b,0x24756,0x24753,0x2474b,0x24750, -0xe445b,0x16669,0x24757,0x1666a,0x16660,0xe445c,0xe4461,0x2474d, -0xe4456,0x24755,0x24751,0x24754,0x24752,0x16664,0x2474c,0x1665f, -0xe445d,0x00000,0x00000,0x24e34,0x16b22,0x16b25,0xe495f,0x24e36, -0xe4964,0x16b2d,0x24e35,0x16b27,0xe4963,0x16e78,0x24e37,0x00000, -0x16b2c,0x24e33,0x16b2e,0xe495e,0xe4962,0xe496b,0x16b23,0xe4968, -0x16662,0x16b26,0xe4960,0x16b24,0x16b28,0x16b2a,0x16b21,0x16b2f, -0x16b2b,0xe4965,0x16b29,0x24e32,0xe4966,0x00000,0x00000,0xe4e74, -0x16f21,0xe4e67,0x16e7b,0xe4e72,0xe4e70,0xe4e6e,0x16f24,0xe4e6c, -0x2543f,0x16f25,0x2544b,0x25444,0x16e74,0x2544c,0x25446,0x16e7e, -0x25447,0xe4e73,0x16e7d,0x2544a,0x16e77,0x25448,0x2543e,0x16e76, -0x25a56,0x16e7c,0xe4e75,0x16e79,0xe4e69,0x16f23,0xe4e6a,0x2543d, -0xe4e76,0x25441,0x16e75,0x25440,0x25442,0x25443,0x16f22,0x25445, -0x25449,0x2544d,0x00000,0x16f26,0x1723c,0x25a51,0x25a57,0x25a54, -0x25a4c,0x25a58,0x25a4d,0xe526a,0x25a53,0xe526b,0x17237,0x1723d, -0x25a59,0xe4e6f,0xe5267,0x17239,0xe526e,0x17243,0x1723e,0x25a5b, -0x25a55,0x1723a,0x25a4e,0x17244,0x25a4f,0x25a50,0x17245,0x17242, -0x16e7a,0xe5269,0x17238,0x25a5c,0x17246,0xe5268,0x1723f,0x25a5a, -0x1723b,0x17240,0x17241,0xe664c,0x1754e,0x25f50,0x25f59,0x25f56, -0x25f58,0xe5649,0x1754b,0x25f51,0xe564a,0x25f57,0x17547,0x25f53, -0x1754f,0x25f4f,0x25f54,0x25f5b,0x25a52,0x25f55,0x25f4e,0x17548, -0x25f4d,0x17549,0x25f5c,0x1754a,0x25f5a,0x1754d,0x25f4c,0xe5648, -0x1754c,0x00000,0x25f52,0x26347,0x26355,0x26350,0x26352,0x26346, -0x1773e,0xe592a,0x26345,0x17741,0x17740,0xe5926,0x26354,0x2634c, -0x26349,0x2634f,0xe5924,0x26348,0xe5928,0x2634a,0x26353,0x26351, -0xe5923,0x1773f,0x26358,0x26356,0x2634d,0x26357,0x2634e,0xe5b34, -0x26726,0x1787a,0x2672d,0xe5b35,0x00000,0x26c3e,0x17923,0x2634b, -0x26724,0x1787d,0x26725,0x2672a,0xe5b36,0xe5d33,0x17921,0x17922, -0x26723,0x2672c,0x2672e,0x26727,0x26729,0x2672b,0x26728,0x2672f, -0x1787c,0x17924,0x1787e,0x00000,0x1787b,0x2697c,0x00000,0x17a42, -0x2697a,0xe5d30,0xe5d2c,0x2697e,0xe5d32,0x26a21,0x17a40,0x26a22, -0x2697d,0xe5d2b,0x2697b,0x17a43,0x17a3f,0x26a23,0xe5d2e,0x17a41, -0x17a3e,0xe5c6d,0x00000,0xe642d,0x17b2b,0xe5e62,0x00000,0x17b2c, -0x26c3d,0x26c3c,0x26c3f,0x26c40,0xe5e63,0x17b2d,0x26e25,0x26e2a, -0x17b74,0xe5f61,0x26e27,0xe5f62,0x26e26,0x26e29,0x26e28,0xe6048, -0x26f51,0x00000,0x17c48,0x26f50,0x26f4e,0xe6047,0x26f4f,0x00000, -0xe6049,0xe607b,0x17c6a,0x17c69,0x2704f,0x27050,0x17c6b,0xe614b, -0x2713c,0x2713d,0x17d34,0xe616b,0x17d3a,0xe617e,0x27177,0x27236, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x8c00 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x14b47, -0x00000,0x23950,0xe392a,0x23951,0x24758,0x24e38,0x2544e,0x17551, -0xe564d,0x17550,0x26359,0x26730,0xe5f64,0x26f52,0x14b48,0x23322, -0x1583f,0x15d47,0x2475a,0x24759,0x16f27,0x2544f,0x16f28,0x25f5d, -0x17742,0xe5d34,0xe664d,0xe6221,0x17d43,0x14b49,0x2286b,0x23323, -0xe392d,0x00000,0x15d48,0xe392c,0x23952,0x23953,0xe3f2a,0x2404b, -0xe3f29,0x1622f,0x1666d,0xe4464,0x2475c,0x2475b,0x2475d,0xe496d, -0x24e39,0x24e3a,0x16b30,0x17247,0x16f29,0x17248,0x00000,0x25f61, -0x25f5e,0x25f60,0x25f5f,0x17552,0xe592b,0x2635a,0x26732,0x26731, -0x22524,0x15841,0x15840,0x23324,0xe392e,0x23954,0xe3f2c,0xe3f2b, -0x2404d,0x2404c,0x16230,0xe3f2d,0x2475f,0x24760,0x2475e,0xe634a, -0xe4465,0x1666f,0x1666e,0x00000,0x16b32,0x16b31,0xe4e7a,0x25450, -0x25a5f,0x25a5d,0x25a5e,0x17249,0x25f63,0x25f62,0xe564f,0x2635d, -0x2635c,0x2635b,0x26733,0xe614d,0x27178,0x14b4a,0x15356,0xe2f2e, -0x15357,0x15842,0x15843,0x23326,0x23325,0x23955,0xe3930,0x15d4e, -0x15d4c,0x15d49,0x15d4d,0x15d4b,0x15d4a,0xe3932,0xe3931,0x16231, -0x24050,0xe3f2f,0x16674,0x16233,0x16238,0x24052,0x1623a,0x16239, -0x1623c,0x24051,0x2404e,0x16236,0x16232,0x16234,0x2404f,0x1623b, -0x16237,0x16235,0x16676,0x16675,0x16673,0x16677,0x00000,0x16671, -0x16672,0xe4469,0x16670,0x00000,0x24761,0xe4467,0x00000,0x24e3c, -0xe4970,0x16b34,0x16b35,0x16b33,0xe4972,0x24e3b,0xe4971,0x24e3d, -0xe664e,0x25453,0x25455,0xe4e7e,0x16f32,0x25456,0x16f2b,0x25452, -0x16f2a,0x16f34,0x16f30,0x16f31,0x16f2d,0x25451,0x16f2c,0x25457, -0x25454,0xe4e7d,0x16f33,0xe4f22,0x16f2e,0x16f2f,0x25a61,0xe5275, -0x25a63,0x25a62,0xe5273,0x25a64,0x1724a,0x25a60,0xe5651,0xe5652, -0x17556,0x25f64,0x17553,0x17557,0x17555,0x17554,0x2635e,0x00000, -0x26361,0x00000,0x26360,0xe592e,0x2635f,0x17743,0x26734,0x26735, -0x17925,0x26736,0x17926,0xe5b38,0xe664f,0x17a45,0xe6428,0x17a44, -0x26c41,0xe5e65,0xe5e66,0x17b2e,0x26c42,0x26e2b,0x17b75,0x17b76, -0xe6650,0x26f53,0xe604a,0x17c6d,0xe614e,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x14b4b,0xe3933,0x15d50,0x15d4f, -0x24762,0x24763,0x00000,0x16b36,0x25a65,0x16f35,0x25a66,0x25f65, -0x14b4c,0xe243a,0x22d53,0x15359,0x15358,0x00000,0x23327,0x15844, -0x23328,0x23958,0xe3939,0x23957,0xe3937,0x23956,0xe3935,0xe3938, -0x24054,0x1623f,0xe3f39,0xe3f34,0x24053,0x1623e,0xe3f37,0xe3f30, -0xe3f33,0x24055,0x1623d,0xe3f38,0x24765,0x24768,0x24766,0x24767, -0x2476b,0x24764,0x2476c,0x24769,0x2476a,0x16b38,0x24e3e,0xe4975, -0xe4973,0x16b37,0xe4974,0x2545b,0x25459,0xe4f26,0x00000,0x16f36, -0x25458,0x2545a,0xe4f25,0x16f37,0xe4f23,0x25a67,0xe5277,0x25a68, -0x17558,0xe5931,0x26738,0x2673a,0x26737,0x26739,0x26a24,0x26c43, -0xe6651,0x00000,0x2715e,0x14b4d,0x1535a,0x23329,0x2332b,0x2332a, -0x00000,0x2395b,0x15d52,0xe393e,0x23959,0xe393a,0x15d51,0x2395c, -0xe393d,0x2395d,0x2395a,0x00000,0x00000,0x24061,0x16247,0x24059, -0x2405f,0xe3f3f,0xe3f3a,0x16242,0x16245,0x24058,0x16240,0x2405c, -0x24772,0x16244,0xe3f3b,0x24057,0xe3f3e,0x2405d,0x2405a,0x24060, -0x24056,0x2405e,0x16243,0x16246,0x2405b,0x16241,0x00000,0x16679, -0x2476e,0x16678,0x24775,0x24774,0x16721,0x00000,0x16722,0x24776, -0x1667a,0x24773,0x1667e,0x24778,0x2476f,0xe446b,0x24771,0x1667b, -0x2476d,0x24770,0x24777,0x1667c,0x24779,0x00000,0x00000,0x00000, -0x00000,0x00000,0x1667d,0x00000,0x16b39,0x24e43,0x24e49,0x24e41, -0x24e4a,0xe497b,0x24e40,0x24e45,0x24e4b,0x24e48,0x24e47,0x24e46, -0xe497a,0x24e3f,0x24e44,0xe4979,0x00000,0x24e42,0x00000,0x16f3c, -0x16f39,0x25464,0x25469,0x2546b,0x25468,0x25461,0x25463,0x2546d, -0x2546a,0x25465,0x2546e,0x25462,0x2546c,0x16f3a,0x16f40,0x16f3e, -0x2545c,0x16f3f,0x16f3b,0x2545d,0x2545f,0x2545e,0x25466,0x25467, -0xe4f2c,0x16f3d,0xe4f2b,0x16f38,0x00000,0x00000,0x25460,0x00000, -0x25a72,0x1724c,0xe527e,0x25a69,0x1724d,0x17250,0x25a6e,0x00000, -0x25a6b,0x1724f,0x00000,0xe527b,0x25a6f,0x25a70,0x25a6a,0x25a73, -0x25a6c,0x25a71,0x1724e,0xe527c,0x1724b,0x25a6d,0xe5654,0x25f6b, -0x1755b,0x17559,0x1755c,0x1755a,0x25f6a,0x25f67,0x25f66,0xe5655, -0x25f69,0x00000,0x00000,0x25f68,0x2636f,0x17749,0x26366,0x26365, -0xe5932,0x17744,0x2636b,0x2636a,0x26362,0x2636d,0x26367,0x17748, -0x26364,0x2636c,0x26363,0x17745,0x17747,0x26368,0x17746,0x26369, -0xe5b3a,0x2636e,0x2673e,0xe5b39,0x1792b,0x2673b,0x00000,0x2673f, -0xe5b3b,0x00000,0x17928,0x2673d,0x1792d,0xe5b3c,0x1792a,0xe5b3d, -0x2673c,0x00000,0x1792c,0x26740,0x17927,0x00000,0x00000,0x00000, -0x00000,0x17a47,0x17a49,0xe5d37,0x26a27,0x17a48,0x26a25,0x17929, -0x26a26,0x17a46,0x17b2f,0x17b31,0x26c45,0x17b30,0x26c44,0x00000, -0x26e30,0x17b77,0x26e2f,0x17b78,0x26e2d,0x26e2c,0x26e31,0x26e32, -0x26f54,0xe604b,0x26e2e,0x00000,0x00000,0x27054,0x27051,0x27052, -0x27053,0x17d29,0xe6150,0x27140,0x2713f,0x2713e,0x2715f,0xe616c, -0x2722e,0x27179,0x17d3b,0x14b4e,0x15845,0xe393f,0x00000,0xe3940, -0xe3f40,0xe4473,0x16723,0xe497d,0xe497c,0x00000,0xe4f30,0xe4f32, -0xe4f2f,0xe4f31,0x16f41,0x00000,0xe6652,0x25a74,0x00000,0xe5935, -0x1774a,0xe5936,0x26741,0xe5b3f,0x00000,0x00000,0xe5d38,0x00000, -0x00000,0x2717a,0x14b4f,0x14f51,0x1535c,0x1535b,0x00000,0x15848, -0x00000,0x2332c,0x15846,0x2332d,0x15847,0xe6653,0xe3941,0x23962, -0x2395e,0xe3947,0x00000,0x15d53,0x23961,0x23960,0x2395f,0x15d54, -0x23963,0x23964,0x00000,0x00000,0xe3f45,0x24068,0x24066,0x2406a, -0x2406b,0x24071,0xe3f47,0x2406d,0x2406f,0x00000,0x24067,0x24062, -0x00000,0x2406e,0xe3f44,0xe3f46,0x24070,0x24069,0x2406c,0x24063, -0x16249,0x24065,0x24064,0x16248,0x1624a,0xe3f49,0x16726,0x2477b, -0x2477d,0x2477c,0x24823,0x16724,0xe4476,0x2477e,0x2477a,0x24821, -0x24822,0x16725,0x16727,0x24824,0x00000,0x24e4f,0x24e4e,0x00000, -0x24e4c,0x24e4d,0x16b3b,0x16b3d,0x16b3a,0x16b3c,0x25475,0x25476, -0x25471,0xe4f36,0x25472,0x16f43,0x16f48,0x16f42,0x16f49,0x16f44, -0x25473,0x00000,0xe4f33,0x25474,0x25470,0x16f4a,0x16f46,0xe4f35, -0x00000,0x16f45,0x16f47,0xe4f34,0x2546f,0xe5324,0x25a76,0x17252, -0xe5322,0xe5321,0x25a78,0x17254,0x25a7b,0x25a77,0x25a75,0x25a7a, -0x17253,0x25a79,0x00000,0x17251,0xe5325,0xe5659,0x1755e,0x17561, -0x25f6d,0xe565a,0x1755f,0x25f6c,0x1755d,0x17560,0x26370,0x26371, -0x26372,0x1774b,0xe5937,0x26373,0x00000,0x1774c,0x1792f,0x26744, -0x26745,0x26743,0x26742,0x26746,0x1792e,0x26a2b,0x26a29,0x26a2a, -0x26a2c,0x26a28,0x26a2d,0x26c47,0xe5e67,0x26c48,0x26c46,0x17b32, -0x26e33,0x17b79,0x26e34,0x26f56,0x26f55,0xe6222,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x14b50,0x1624b,0xe3f4b,0xe4477,0x16728, -0xe4478,0xe4a21,0xe4a22,0x16b3e,0xe4f37,0xe5327,0x17256,0xe5326, -0x17255,0x00000,0xe6654,0x00000,0xe5938,0x17930,0x17a29,0x17b33, -0x14b51,0x15849,0x16729,0xe4f39,0x26747,0xe272f,0x00000,0x00000, -0x00000,0xe243b,0x00000,0x00000,0x00000,0x00000,0xe2730,0x22526, -0x00000,0xe2733,0x14b52,0x00000,0x14b55,0x14b54,0x14b53,0xe2731, -0x00000,0x22525,0xe2a72,0x2286d,0xe2a70,0x2286f,0x14f52,0xe2a74, -0x00000,0x14f54,0x2286c,0x2286e,0x14f53,0x22871,0x22870,0x22872, -0xe2a73,0xe2a71,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x22d57,0x22d55,0x1535f,0x22d54,0x15364,0x15361,0x1535e,0xe2f31, -0x15365,0xe2f32,0x15360,0x15363,0x00000,0x15362,0x22d56,0xe2f33, -0x1535d,0xe2f30,0x00000,0x00000,0x1584f,0x2332f,0x23335,0x1584c, -0x15853,0xe3425,0x1584e,0x23332,0x23334,0x15851,0x2332e,0x23331, -0x1584d,0x1584a,0x23330,0x15850,0x23333,0x15852,0x1584b,0x00000, -0xe3427,0xe3426,0x00000,0x23966,0x23969,0x15d56,0xe394b,0x15d60, -0x15d5c,0x23967,0xe394a,0xe394e,0x15d64,0x15d5d,0x15d62,0x15d58, -0x00000,0x15d55,0x15d57,0x15d63,0x23968,0x15d5b,0x15d5e,0x15d5a, -0x15d5f,0x2396a,0x15d61,0x15d59,0x23965,0xe394c,0x00000,0x00000, -0xe3f4f,0xe3f50,0xe3f4d,0xe3f4c,0xe3f51,0x24072,0x1624c,0x24074, -0xe3f55,0x1624e,0x16250,0x00000,0x24073,0x1624d,0x16251,0xe3f56, -0x1624f,0x00000,0xe3f54,0xe3f57,0x1672f,0x24829,0x16737,0x24826, -0xe447d,0x16738,0x1672d,0xe4479,0x24827,0xe447c,0xe447a,0x16732, -0xe447b,0x24828,0x1672b,0x1672a,0xe447e,0x16735,0x16734,0x16733, -0x16731,0x16736,0x24825,0x1672c,0x1672e,0x16730,0x00000,0x00000, -0x16b40,0x16b43,0xe4a24,0x16b47,0x16b41,0x16b46,0x16b44,0xe4a27, -0x16b3f,0xe4a26,0x16b45,0x16b42,0x00000,0x00000,0x00000,0x2547a, -0x16f4d,0x16f4b,0xe4f3c,0x2547b,0x00000,0x16f4e,0x16f4c,0x25479, -0x25478,0xe4f3b,0x1725a,0x25477,0x17258,0x17257,0x25a7c,0x16f4f, -0x17259,0x25a7d,0x1725c,0x25a7e,0x1725b,0x17563,0x25f6f,0x17562, -0x17567,0x17565,0x17566,0x1774e,0x17564,0x25f6e,0x25b21,0x1774d, -0x1774f,0xe593a,0x17931,0x17932,0x00000,0x26a2e,0x00000,0x17c4a, -0x17c49,0x14b57,0xe225e,0xe225d,0x22275,0x15854,0xe243c,0x22272, -0x22273,0x22271,0xe243d,0x22274,0xe6655,0x00000,0x2252a,0x22527, -0x2252c,0x22528,0x14b58,0x14b5b,0xe2735,0x22529,0x14b5a,0x2252b, -0xe2739,0xe2734,0x14b59,0xe3951,0x00000,0xe2a77,0x00000,0x22875, -0x22877,0x14f57,0x22873,0x22876,0x22874,0x14f55,0x14f58,0xe2a75, -0x14f56,0xe2a78,0x00000,0x00000,0xe2f35,0x22d59,0x22d5d,0x22d5a, -0xe2f38,0x15368,0xe2f34,0x15369,0xe2f3e,0x22d5c,0xe2f37,0x22d5e, -0x22d60,0xe2f3c,0x15366,0x22d5f,0x00000,0xe2f3b,0x15367,0x00000, -0x00000,0x00000,0x00000,0x00000,0x23971,0x22d5b,0x23336,0x2333f, -0x2333d,0x23338,0x23339,0x2333e,0x23340,0x15856,0xe3429,0x2333b, -0x23337,0x15855,0x15857,0x2333a,0x23341,0x2333c,0x00000,0x00000, -0x15d65,0x23974,0x2396c,0x23972,0x23973,0x15d66,0xe394f,0x2396b, -0x2396d,0x22d58,0x2396f,0x23970,0x2396e,0x16253,0xe636c,0xe3952, -0x00000,0x2407b,0x25b22,0x2407c,0x24079,0x15d67,0x16255,0x24078, -0x2407e,0x2407d,0x16252,0x24123,0x24077,0x24122,0x24075,0x24121, -0x2407a,0x16254,0xe3f59,0x24830,0xe4523,0x2482b,0x24831,0x2482c, -0x2482a,0x2482d,0x16739,0xe4524,0x2482f,0xe4525,0x2482e,0x1673a, -0x16b49,0x16b48,0x24e56,0x24e59,0x24e51,0x24e55,0x16b4a,0x24e54, -0x24e52,0x24e58,0x24e53,0x24e50,0x24e57,0xe4a2a,0x25523,0x16f52, -0x26374,0x2547e,0x25521,0x2547d,0x24076,0x16f51,0x25524,0x2547c, -0x16f50,0x16f53,0x25522,0x25b23,0x1725d,0x25b24,0x25b25,0xe532b, -0x25f70,0x17568,0x26375,0x26376,0xe593c,0xe593b,0x26377,0x26749, -0x26748,0x26a30,0x00000,0x26a2f,0x26c4a,0x26c4b,0x26c49,0x26e35, -0x17b7a,0x14b5c,0x1536b,0x1536a,0x1585a,0x15859,0x23343,0x23344, -0x23342,0xe342a,0x15858,0x23978,0xe3955,0x23979,0x23975,0x15d68, -0x23976,0xe3954,0x23977,0x00000,0xe6657,0x00000,0x00000,0x24126, -0x24128,0x24124,0x24127,0x16256,0x24125,0x16257,0x00000,0xe4528, -0x24279,0x1673d,0x1673c,0xe4527,0x1673b,0x00000,0x24832,0x24833, -0x00000,0x00000,0x24e5b,0x24e5d,0x16b4e,0x16b4b,0xe4a2c,0x16b4d, -0x16b4c,0x24e5c,0x24e5a,0xe4a2b,0xe4a2d,0x00000,0x00000,0x00000, -0x2552b,0x25528,0x25529,0x16f57,0x2552a,0x25525,0x25526,0x16f54, -0xe4f3f,0x16f55,0x25527,0x16f56,0xe4f40,0x25b29,0xe532d,0x25b2a, -0x25b27,0x25b28,0x1725e,0x25b26,0x00000,0xe532c,0xe532f,0x00000, -0x00000,0x25f74,0x25f71,0x25f73,0x1756b,0x25f77,0x1756a,0x25f75, -0x25f78,0x25f76,0x25f72,0x17569,0x00000,0x26379,0x00000,0x2637a, -0x26378,0xe593d,0x2637c,0x17750,0x17751,0x2674b,0x17934,0x2637b, -0x2674a,0x17933,0x26a33,0x26a34,0x17a4a,0x26a32,0x00000,0x26a31, -0x00000,0x26c4c,0x17b34,0xe5e68,0x26f57,0x27056,0x27055,0xe607e, -0x17c6e,0x17d2a,0x27057,0x27160,0xe616d,0x17d3c,0x14b5d,0x14f59, -0x00000,0x1673e,0x00000,0x17a4b,0x14b5e,0x1536c,0x15d69,0x16258, -0x17752,0x14f5a,0x00000,0x22d62,0x22d61,0x23345,0xe3430,0x1585d, -0x1585b,0x1585f,0x23347,0xe342d,0x1585e,0x1585c,0xe342f,0xe342e, -0xe3431,0x00000,0x23346,0x15d6c,0x23a21,0xe3958,0x15d6b,0x15d6d, -0x23a26,0x15d6f,0x23a23,0x23a24,0x2397a,0x15d6e,0x23a27,0x00000, -0xe3957,0x2397c,0xe3956,0x2397d,0x2397b,0x15d6a,0xe3959,0x23a25, -0x2397e,0x23a22,0x00000,0x00000,0x00000,0x24134,0xe3f5d,0x24133, -0x24131,0x24129,0x24138,0x2412c,0x24136,0x2413d,0x24135,0x16260, -0xe3f66,0x1625c,0x2412a,0xe3f60,0x24130,0x1625e,0xe3f68,0x2412f, -0x1625f,0x16261,0x24132,0xe3f69,0x16259,0x1625a,0x2413e,0x2413c, -0xe3f62,0x2413b,0x2412d,0xe3f65,0x24139,0x00000,0x1625d,0x00000, -0xe3f5e,0xe6659,0xe3f63,0x1625b,0x2413a,0x2412b,0x2412e,0x24137, -0x00000,0x00000,0x00000,0xe6658,0x00000,0x24f22,0x2483d,0xe452e, -0x24836,0x24849,0x24852,0x24839,0x16749,0xe452b,0x24846,0x1673f, -0x16741,0x1674d,0x24837,0xe4537,0xe452f,0x16742,0x16744,0x1674e, -0x16743,0xe4539,0x00000,0x00000,0xe4538,0x1674c,0x2483f,0x00000, -0x24834,0x1674a,0x2483e,0x16746,0x24850,0x1674b,0x2484e,0x24842, -0x2484c,0x16748,0x24835,0x2484f,0x2484a,0xe452a,0x24851,0x16740, -0x00000,0xe452d,0x1674f,0x16745,0xe4531,0xe4529,0x2483b,0xe4534, -0x24843,0x24847,0xe4533,0x2484b,0x16747,0x2483a,0x24838,0x24844, -0x00000,0x00000,0xe4532,0xe4535,0x24841,0x24840,0xe4536,0x24845, -0x24848,0x00000,0x2484d,0xe665a,0x00000,0x00000,0x24e60,0x00000, -0x16b4f,0x24e6a,0x24e62,0x16b55,0x16b59,0x24e73,0x24e7b,0x24e6c, -0x16b51,0xe4a34,0x24e70,0x2483c,0xe4a35,0x16b52,0x24e77,0x24e7c, -0x24e74,0xe4a2f,0x24e76,0x24f21,0x24e78,0x24e66,0x24e6f,0xe4530, -0xe4a38,0x16b5a,0xe4a33,0x16b56,0x24e64,0x24e71,0x16b54,0x24e6b, -0x16b53,0x24e79,0x24e68,0x24e61,0x16b57,0x24e7e,0xe4a39,0x00000, -0x24e63,0x24e75,0x24e72,0x24e6d,0x24e5f,0x24e5e,0x24e67,0x24e7a, -0x16b58,0x24e7d,0x24e65,0x24e69,0x16b50,0xe4a32,0xe4a37,0x00000, -0xe672a,0xe4a31,0x16f63,0x16f5e,0x2554d,0x25549,0x25531,0x16f5a, -0xe4f42,0xe4f50,0x00000,0x16f59,0x16f5f,0x00000,0xe4f43,0xe4f41, -0x2552f,0x16f5d,0x2553b,0x2552d,0x2552e,0x16f58,0x2554c,0x16f61, -0x2553e,0x25543,0x2553d,0x25b3c,0x25539,0x25541,0x2553f,0x25532, -0x2552c,0x25547,0x16f60,0x25548,0xe4f48,0x25542,0xe4f49,0x25537, -0x25535,0x25530,0xe4f4b,0xe4f4e,0xe4f44,0x25538,0x25545,0x25534, -0x25544,0x2554a,0xe4f51,0x00000,0x16f5c,0xe4f45,0x25540,0x25546, -0x2553c,0x25536,0x16f5b,0xe4f52,0x00000,0xe4f4c,0x24e6e,0x2553a, -0x16f62,0x25533,0x00000,0xe4f4d,0xe665b,0xe665c,0xe4a30,0x25b41, -0x17261,0x25b40,0x25b3e,0x25b50,0x17265,0xe5335,0x25b4d,0x25b45, -0x25b4f,0x25b37,0x25b43,0xe533d,0x17267,0xe533e,0x25b2f,0xe5338, -0x25b2d,0x25b4e,0xe5332,0x25b4c,0x25b4b,0x25b3b,0x25b3a,0x25b30, -0x17269,0x00000,0x25b36,0x25b3f,0x25b4a,0x1726c,0x25b51,0xe5336, -0x17573,0x1726e,0x17268,0x25b34,0xe5337,0x25b3d,0x25b2c,0x25b2e, -0x1725f,0x1726b,0x17264,0x25b35,0x25b44,0x2554b,0x1726a,0x25b2b, -0x1756e,0x25b46,0x25b49,0x17266,0xe533b,0x25b39,0x1726d,0x17263, -0xe533c,0xe5339,0xe533a,0x17262,0x25b42,0x25b48,0x17260,0x00000, -0x25b32,0x25b47,0x00000,0x00000,0x25b33,0x00000,0x00000,0xe665d, -0x00000,0x00000,0xe665e,0x00000,0x00000,0xe5331,0x25b38,0x25f7e, -0xe5665,0x26025,0x17570,0x17572,0x2602b,0x1756c,0x26039,0x26031, -0x26026,0x26027,0x26030,0xe5666,0x17579,0x2602f,0x25f7d,0x2602e, -0x26022,0x2603a,0x17578,0x17576,0x26023,0xe565d,0x26036,0xe5667, -0x26028,0x26035,0xe5664,0x26037,0x25f7c,0x17571,0xe565b,0x26038, -0xe5668,0xe565e,0x2602c,0xe566b,0x17575,0x26029,0xe5661,0x00000, -0x17577,0x26032,0xe5662,0xe5663,0xe565f,0x1756f,0x26024,0x26033, -0xe565c,0x2602d,0x25b31,0x26034,0x26021,0xe5660,0x17574,0xe566a, -0x2642f,0x00000,0x1756d,0x25f7a,0x00000,0x00000,0xe665f,0x00000, -0x2642c,0x26425,0x17754,0xe5943,0x2637e,0x26430,0x26427,0x2602a, -0xe5940,0x26432,0x26421,0xe5942,0x17753,0x2642b,0x17755,0x1775d, -0x1775b,0x2642d,0x1775c,0x26423,0xe5949,0x26424,0x26429,0x2642e, -0xe593e,0x25f79,0x17756,0x26437,0x26434,0x26761,0x2642a,0x26426, -0x26435,0x26756,0x26428,0x00000,0x17759,0xe5944,0x17758,0x25f7b, -0x1775a,0x26431,0x26433,0x17757,0x26436,0x2637d,0x00000,0x26422, -0xe5946,0x00000,0x00000,0xe5945,0xe6661,0xe6662,0xe6660,0x00000, -0x2675f,0xe5b50,0x2674f,0x17938,0x2675d,0xe5b44,0xe5b45,0x2674d, -0x17939,0x00000,0x26758,0xe5b43,0x26754,0x1793e,0x2675e,0x2674e, -0x26751,0x17936,0x26760,0xe5b48,0x26759,0x2675c,0x1793c,0x17941, -0x1793f,0x26755,0x26750,0xe5b4d,0x1793a,0x1793b,0x2674c,0x17937, -0xe5b4f,0x17935,0x1793d,0x2675b,0x17940,0xe5b4a,0x26757,0x26762, -0x17942,0xe5b41,0xe5b42,0xe5b4e,0x26753,0xe5b47,0x2675a,0xe6665, -0x00000,0xe6663,0xe6664,0xe5d41,0xe5e6a,0x26a41,0x26a50,0x26a43, -0x26a4a,0x26752,0x26a48,0x26a37,0x26a4e,0x17a4e,0x26a3b,0x26a4d, -0x26a42,0x00000,0xe5d43,0x17a4d,0xe5d3c,0xe5d3f,0x26a52,0x26a44, -0xe5d3e,0x26a49,0x26a4c,0x26a35,0x26a4f,0x26a40,0x26a45,0x26a39, -0x26a3d,0x26a51,0x26a47,0x26a36,0x26a3a,0x26a3c,0x26a46,0xe5d3d, -0x17a4c,0x26a3f,0xe5d44,0xe5d45,0xe5d47,0x00000,0xe5d42,0xe5d3a, -0x26a38,0x00000,0xe6666,0xe6667,0xe6668,0x00000,0x00000,0xe5d46, -0x26a3e,0x26c50,0x26c54,0x17b3b,0x26c56,0xe5e6d,0x17b35,0x00000, -0x26c52,0x26c58,0x17b3a,0x17b36,0x00000,0x17b37,0x26c4f,0x26c55, -0x17b39,0x26c53,0x17b38,0x26c4e,0x26a4b,0x26c51,0x00000,0x26c4d, -0x26c57,0x00000,0xe5f69,0xe5f6e,0x17b7b,0x26e3c,0x26e3f,0x26e3b, -0x26e3d,0x26e3e,0x26e38,0x26e39,0x26e36,0xe5f6a,0xe5f6c,0x26e3a, -0x26e37,0x17b7c,0x17b7d,0x00000,0xe5f6b,0x26f59,0xe6052,0x26f5b, -0xe6431,0x00000,0xe6055,0xe6054,0xe6056,0x26f5a,0x26f5c,0xe604f, -0x17c4c,0xe6053,0x26f58,0x17c4b,0x17c4d,0xe6057,0xe666a,0xe6669, -0x27059,0x2705a,0x17c6f,0x27058,0xe6122,0x27142,0x27141,0x27143, -0x17d2c,0x27144,0x17d2b,0x27145,0x27161,0x27164,0x27163,0x17d35, -0x27162,0x00000,0xe616f,0xe6223,0x17d3f,0x17d3d,0x17d3e,0x17d44, -0x27230,0x27231,0x2722f,0x27237,0xe6236,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x9500 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x14f5b, -0x00000,0xe6323,0x23a28,0x2413f,0x2554e,0x26763,0x00000,0x00000, -0x14f5c,0xe2f40,0x1536d,0x15860,0x00000,0xe3432,0x23a29,0xe395c, -0x23a2a,0x15d70,0x00000,0x16264,0x24141,0x24140,0x16268,0x16263, -0x24142,0x16265,0x16267,0x16266,0x16262,0xe3f6c,0x00000,0xe666b, -0x16750,0xe453c,0xe453a,0x24856,0x24854,0x00000,0x24855,0x24853, -0x00000,0x16b5b,0xe4a3d,0x16b5e,0x16b60,0x16b5f,0x00000,0xe4a3e, -0x16b5c,0x16b5d,0x00000,0x25550,0x2554f,0x16f64,0x25551,0xe4f53, -0x25552,0x16f65,0xe4f55,0xe4f56,0x00000,0x25b59,0x25b57,0x26040, -0xe5342,0x25b55,0x25b56,0x1726f,0x25b52,0x25b5a,0x25b54,0x25b58, -0x2603c,0xe5344,0xe5340,0x2603e,0xe566d,0x2603f,0x1757e,0x2603b, -0x1757d,0x2603d,0x1757a,0x1757b,0x1757c,0x25b53,0xe666c,0x00000, -0x17760,0x2643a,0x26438,0x26439,0x1775e,0x17761,0x1775f,0xe594b, -0xe594a,0x00000,0x26764,0x26765,0x17943,0xe5b53,0x26a53,0x26a55, -0x26a54,0x17a4f,0x17b3c,0x26c5b,0x26c5a,0x26c59,0x00000,0xe666d, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0x9600 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x14f5d,0xe2143,0x22169,0x00000, -0x22278,0x1486a,0x22276,0x22279,0x22277,0x00000,0xe273b,0xe273a, -0x2252e,0xe273f,0x14b62,0xe273c,0x14b63,0x22530,0x14b60,0x2252f, -0x2252d,0x14b61,0x14b5f,0xe273d,0xe273e,0x00000,0x00000,0xe2a79, -0x00000,0x22878,0x2287b,0x14f60,0x2287a,0x22879,0xe2a7c,0x14f5f, -0x14f5e,0xe2a7b,0x14f62,0x2287c,0x14f61,0x00000,0x00000,0x00000, -0x00000,0x00000,0x22d67,0x1536f,0x15370,0x15371,0x22d68,0x22d64, -0x1536e,0x22d65,0x00000,0x22d66,0x22d63,0x00000,0xe3436,0x00000, -0x15867,0xe3434,0xe395e,0x15864,0x23348,0x15865,0x15868,0x23349, -0xe3433,0x15863,0x15861,0x15862,0x15866,0x00000,0x00000,0x00000, -0x00000,0x00000,0x15d71,0x23a2d,0x15d79,0x23a2c,0xe3961,0x23a2f, -0x15d75,0x23a2e,0x16270,0x15d73,0x15d76,0x15d72,0x15d77,0x15d78, -0x15d74,0xe3965,0x00000,0xe3f71,0x23a2b,0x1626c,0x24144,0xe3f72, -0x24148,0xe3f73,0xe3f75,0x24147,0x16271,0x1626d,0x1626e,0x24143, -0x24145,0x24146,0x16269,0x1626b,0xe3f70,0x1626f,0x1626a,0xe4540, -0x00000,0x24859,0x24857,0x24858,0x16752,0x16753,0xe4542,0x2485a, -0x16751,0x16b61,0x00000,0x16b63,0x16b62,0xe4a45,0x24f23,0xe4a46, -0xe4a44,0x24f24,0x25554,0xe4f5a,0x25553,0xe4f5b,0x00000,0x17270, -0x17271,0x25b5b,0x17272,0xe5348,0x26043,0xe5670,0x26041,0xe566f, -0x26042,0x17621,0xe5671,0x2643b,0x17944,0xe5d49,0xe2a7d,0xe5349, -0x17622,0x14f63,0xe6325,0x15869,0x2334a,0xe3439,0x00000,0x23a30, -0x15d7a,0x16272,0x24149,0x2414b,0x16274,0x16273,0x16275,0x16276, -0x2414a,0x16756,0x16757,0x16755,0x16b64,0x16754,0x2485b,0x00000, -0xe4a47,0xe4a49,0x16b65,0x25555,0x25b5c,0x17273,0x17623,0x2643c, -0x26440,0x17764,0x2643d,0x17765,0x17763,0x26441,0x17766,0x2643f, -0x00000,0x26766,0x17762,0x17945,0xe5e70,0x2705b,0xe6125,0xe622f, -0x14f64,0x15d7c,0x15d7b,0x00000,0xe3f7e,0xe3f7c,0xe3f7b,0x16277, -0x2414d,0x2414c,0x16278,0x00000,0xe4546,0x2485f,0x1675b,0x16758, -0x2485e,0x1675a,0x2485c,0x16759,0xe4547,0x2485d,0x00000,0x24f25, -0x16b66,0x00000,0x25558,0x00000,0x16f66,0x25556,0x16f67,0x16f68, -0x25557,0x16f69,0xe4f60,0x25b5d,0xe5350,0x17277,0x17274,0x17279, -0x25b5f,0x17275,0x25b5e,0x17278,0xe534d,0xe534c,0x17276,0xe5351, -0x26046,0x26048,0xe5674,0xe5675,0x17624,0x26047,0x17625,0x26045, -0x26044,0x00000,0x26443,0x26442,0x17767,0x26444,0x2676b,0x17947, -0x2676a,0x26767,0x17946,0x26768,0x26769,0x00000,0x26a56,0x26a57, -0x17a50,0xe5d4f,0x17b3f,0xe5d4c,0xe5d4e,0x26c5c,0xe5e72,0xe5e71, -0x17b3d,0x17b3e,0x26c5d,0xe666e,0xe5f71,0x17b7e,0x17c21,0x26e40, -0xe5f72,0xe6059,0x17c70,0x2705d,0x17c72,0xe6126,0x2705c,0x2705e, -0x17c71,0x27146,0x00000,0x2717b,0x00000,0xe666f,0x00000,0x00000, -0xe6245,0xe2a7e,0x14f65,0x00000,0x00000,0xe4549,0x1675c,0x00000, -0x24f26,0xe4a4c,0x25559,0x1727a,0x1727b,0xe594f,0x14f66,0xe4021, -0x16f6a,0x17948,0x15372,0xe2b21,0xe4a4e,0x00000,0x1727c,0xe5e73, -0x17c4e,0x15373,0x23a31,0x00000,0x2414e,0xe4024,0x24150,0xe4022, -0x2414f,0x00000,0x24863,0x24860,0x1675d,0x00000,0x1675e,0x24861, -0x24862,0xe454b,0x24f28,0x24f2d,0x16b67,0x24f27,0x24f29,0x24f30, -0x24f2b,0x24f2f,0x24f2c,0x24f2a,0x24f2e,0x16b68,0x00000,0xe4f62, -0x2555c,0xe4f63,0x2555a,0x16f6c,0xe4f64,0x16f6b,0x2555b,0x16f6d, -0x00000,0x00000,0x00000,0xe5353,0x25b62,0x00000,0x00000,0x25b61, -0x1727d,0x25b60,0x26049,0xe567a,0x2604b,0x2604d,0x2604c,0xe567b, -0x17626,0x2604a,0x2644b,0x17768,0x26449,0x2644c,0x17769,0x00000, -0x26447,0xe5950,0x2644a,0x26448,0x26445,0x1776a,0x26446,0x00000, -0x00000,0xe5b5f,0xe5b5d,0x2676c,0xe5b5e,0xe5b60,0x2676e,0x2676d, -0xe5d50,0x26a58,0xe5d51,0x26a59,0x00000,0xe5e75,0xe5e74,0x26c5e, -0xe5f73,0x17c23,0x00000,0x17c22,0x26f5d,0x26f5e,0x17c73,0x2705f, -0xe6128,0x17d36,0xe623b,0x15374,0x16279,0x24f32,0x24f31,0x2555e, -0x2555d,0x00000,0xe5355,0x17627,0x2604f,0x2604e,0x2644f,0x2644d, -0x26450,0x2644e,0xe5951,0x00000,0x17949,0x2676f,0x26770,0x26771, -0x00000,0x26c5f,0xe5e76,0x26e41,0xe6129,0x27060,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x15375,0xe454f,0xe4f65, -0x25b63,0x26050,0xe5b61,0x15376,0x00000,0xe4550,0x16b69,0x00000, -0x25b64,0x1776b,0x26451,0x1794a,0xe5d53,0x26a5a,0x26a5b,0x17b40, -0x26f5f,0x15377,0x15e21,0x15e22,0x23a32,0x1627a,0x1627b,0x24151, -0x1627c,0x00000,0x16762,0xe4552,0x16764,0x24865,0x24866,0x24864, -0x1675f,0x16760,0x16763,0x16761,0xe4a54,0xe4a55,0x24f33,0x16b6a, -0x16b6b,0xe4a52,0xe4a56,0x25565,0x16f70,0x25560,0x2555f,0xe4f69, -0x25564,0x16f6e,0xe4f67,0xe636e,0x17326,0x00000,0x25561,0x25566, -0x25563,0x25562,0xe4f66,0x16f6f,0x00000,0x17324,0xe535c,0x25b66, -0x1727e,0xe5359,0x25b67,0xe535a,0xe5228,0x25b65,0xe5358,0x17323, -0x17321,0x17325,0xe535d,0x17322,0xe535b,0xe535f,0x00000,0xe595b, -0xe5726,0x26051,0xe637b,0x26056,0x26052,0x26055,0x17628,0xe5728, -0x25e41,0x26054,0x26053,0xe5959,0x1776e,0x1776c,0x1776f,0x1776d, -0x26452,0x26453,0x26454,0x17770,0xe5956,0xe5958,0xe5b65,0x26775, -0x1794c,0x26773,0x00000,0x1794d,0x26772,0x26774,0x1794b,0x26a5f, -0x26a5c,0xe642a,0x26a5d,0x26a5e,0x26c60,0x17b42,0xe5e78,0x17b41, -0xe5e77,0x26e43,0x26e42,0x17c24,0xe605d,0xe605e,0xe605c,0x17c4f, -0x17c74,0x17d2d,0x27147,0x2717c,0x2717d,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x15378,0x24152,0x00000,0x00000,0x24867,0x24f34,0x24f35,0x16b6c, -0x00000,0x16b6d,0x25567,0x16f71,0x00000,0xe5361,0x17629,0xe572a, -0x26455,0xe595c,0x17771,0x26778,0x1794e,0x26777,0x26779,0x26776, -0x26c63,0x26a60,0x26a61,0xe5d56,0x17a51,0x00000,0x26c62,0xe5e7b, -0xe5e79,0x26c61,0xe5e7a,0x26e44,0x2717e,0xe6225,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x15379,0xe5e7c,0xe6226,0x00000,0x1537a, -0x00000,0xe3967,0x1586a,0x2334b,0xe6670,0x23a33,0xe3968,0x1627d, -0x00000,0x16322,0x1627e,0x24153,0xe455b,0x16324,0x00000,0x16321, -0xe402b,0xe455c,0x16323,0xe4554,0x16766,0xe4559,0x24868,0xe4557, -0xe4a5d,0x24869,0x25569,0x00000,0x16765,0x16767,0x16768,0xe4558, -0x24f37,0xe4a5e,0x24f36,0x16b6e,0x00000,0x16b6f,0xe4a5b,0x24f38, -0x25568,0x16b71,0x16f72,0x00000,0x16b70,0x00000,0xe667a,0x00000, -0x17327,0x2556a,0x16f74,0x16f73,0x2556b,0x2556e,0x2556c,0x2556d, -0x16f75,0xe4f6b,0x1732c,0x1732a,0xe5365,0xe5366,0x17329,0x25b69, -0xe5364,0x1732b,0xe5362,0xe5363,0x25b68,0x26057,0x00000,0x25b6a, -0x17328,0x25b6b,0x2605a,0x26058,0x26059,0x2605e,0x17775,0x2605d, -0x26060,0x2605f,0x2605c,0x2605b,0x00000,0x1762a,0xe5962,0x00000, -0xe5961,0xe5966,0x26458,0xe5965,0x26457,0x17774,0x17772,0x17773, -0xe5963,0x26456,0xe6671,0x2677c,0xe5b69,0x1794f,0x00000,0x2677b, -0x2677a,0x17950,0x00000,0x26a66,0x26a65,0xe5d58,0x26a63,0xe5e7e, -0x26a62,0x17a53,0x17a52,0x26a67,0x26e45,0x17c25,0x26c65,0x17b43, -0x26c64,0x26a64,0xe5f78,0x26e46,0x17c50,0xe612a,0x17d2e,0x27148, -0x00000,0x27221,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x1537b,0x23a34, -0x26061,0x1537c,0xe455f,0x00000,0x24f3a,0x24f39,0x25b6c,0x00000, -0xe5368,0x26063,0xe5730,0x26062,0xe5967,0x17776,0x2677d,0x2677e, -0x17a54,0xe5f21,0xe6060,0x27222,0x1586b,0x16326,0x16325,0x2486a, -0x2486c,0x1676a,0x2486b,0x16769,0x1676b,0x2486d,0xe4a63,0xe4a62, -0xe4a66,0x24f3c,0x24f3e,0x24f3d,0xe4a61,0x24f40,0xe4a60,0xe4a6c, -0xe4a64,0x16b72,0x24f3f,0x24f3b,0xe4a6a,0x00000,0x00000,0x24f41, -0xe4f73,0x25575,0xe4f6d,0x25578,0x2557a,0x25570,0x25574,0x25571, -0x16f77,0x16f7a,0x16f7c,0x25572,0x25573,0x16f7b,0x25576,0x25579, -0x25577,0x16f7d,0xe4f6e,0x16f79,0x2556f,0x16f76,0xe4f72,0x16f78, -0xe4f74,0xe5370,0x1732e,0x25b72,0x25b70,0x25b6f,0xe5371,0x25b75, -0xe536b,0x25b74,0x25b73,0xe536c,0x25b6e,0x1732d,0x25b6d,0xe536a, -0x25b71,0x1732f,0x00000,0xe5734,0x26066,0xe5737,0x2606a,0x26067, -0x26069,0x26068,0x26065,0x2606b,0x2606e,0x2606c,0x2606d,0x1762c, -0xe5733,0x1762b,0x26064,0x2606f,0x2645d,0x26460,0x26462,0x26461, -0xe596a,0x2645b,0x2645f,0x2645a,0xe596b,0x2645c,0x17777,0x26459, -0xe596d,0x2645e,0x00000,0x00000,0x2682d,0x26822,0x17951,0xe5b6f, -0xe5b6d,0x17952,0x26821,0x26826,0x2682c,0x26824,0x2682b,0xe5b6c, -0x26828,0xe5b6e,0x26827,0x2682a,0x26825,0x26823,0xe5b6b,0x26829, -0x00000,0x26a6e,0x26a6c,0x17a55,0x26a6b,0x26a71,0x26a6f,0xe5d5a, -0x17a56,0x26a6a,0x26a68,0x00000,0x26a69,0x17a58,0x26a6d,0x17a57, -0x26a70,0x26c66,0x26c6c,0xe5f24,0xe5f22,0x26c67,0x17b47,0x26c6d, -0x17b46,0x26c6b,0x26c6a,0x17b45,0x26c69,0x17b44,0x26c68,0x00000, -0x26e4c,0x26e4e,0x26e4d,0x00000,0x26e4a,0x17c27,0x26e47,0x26e4b, -0x26e50,0xe5f79,0x26e4f,0x26e48,0x26e49,0x17c26,0x26f60,0x17c53, -0xe6062,0x26f61,0x17c51,0x17c52,0xe6061,0x00000,0x27061,0x17c75, -0x27165,0xe6172,0x17d37,0xe6173,0x27223,0x17d38,0x27224,0x27225, -0x27233,0x27232,0x17d47,0x2723b,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x1586c,0xe402f,0x00000,0x2486f,0x00000,0x2486e,0x00000,0x16b73, -0x16b74,0x24f42,0x00000,0x2557b,0x25b78,0xe4f77,0xe4f76,0x16f7e, -0x17330,0x25b76,0x00000,0x25b79,0x17331,0xe573a,0x26070,0x25b77, -0x26463,0x17778,0x2682e,0x00000,0xe5d61,0x00000,0x26a74,0x26a72, -0xe5d60,0xe5d5e,0x26a73,0x00000,0x00000,0x26c6e,0xe5f25,0x17b48, -0x26e51,0x17c56,0x17c28,0x17c54,0x17c55,0x27062,0x17d2f,0xe6174, -0x1586d,0xe6334,0xe4a6e,0x00000,0x26464,0xe5f7b,0xe6063,0x2334c, -0xe4032,0x1676c,0xe4561,0x24f43,0xe4a6f,0xe4a73,0x16b75,0x24f44, -0xe4a71,0xe4a70,0xe4a72,0x2557d,0x2557c,0x17333,0x17021,0x17022, -0x00000,0x25622,0x25621,0x2557e,0xe4f79,0xe5375,0x25b7a,0x25b7d, -0xe5374,0x25b7c,0x25b7b,0x17332,0x26074,0x26072,0x26071,0x00000, -0xe573b,0x26073,0xe573c,0x17779,0x26466,0x26467,0x1777a,0xe596f, -0x26465,0xe5b71,0x26830,0x2682f,0x26832,0x17953,0x26831,0x00000, -0x26a75,0x26a77,0x26a76,0x00000,0xe5f27,0x26c6f,0x26c72,0x26c70, -0x26c71,0x26e52,0x17c29,0x00000,0x00000,0xe6672,0x26f62,0x26f63, -0x26f64,0xe612c,0x17c76,0x17d30,0x27226,0x1586e,0xe4a75,0x17023, -0x17334,0x26468,0xe5d62,0x26e53,0xe612e,0xe6433,0x27166,0x2334d, -0xe6228,0x17d48,0x1586f,0x25b7e,0xe573e,0x26469,0x00000,0x26833, -0xe5d63,0x00000,0x26c73,0x26e54,0x15870,0xe4562,0x24f45,0x24f46, -0xe4a78,0x16b76,0x16b77,0x25624,0x17025,0x17024,0x25623,0x00000, -0x26075,0xe573f,0x2646a,0x2646c,0x2646b,0x1777d,0x1777c,0x1777b, -0xe5d64,0x17b4a,0x26c74,0xe5f28,0x17b49,0x26e56,0x26e55,0xe612f, -0x17c77,0x27063,0x15e23,0x24870,0x00000,0xe4563,0x00000,0x24f49, -0x24f47,0x24f48,0x00000,0xe4f7e,0x2562d,0x00000,0x25628,0x25625, -0x2562c,0xe4f7c,0x00000,0xe4f7b,0x2562e,0x00000,0x00000,0x17027, -0x2562b,0x25627,0xe4f7d,0x00000,0x25626,0x2562a,0x25629,0x17026, -0x00000,0x00000,0x25c2b,0x25c26,0x25c24,0x25c2d,0x25c25,0x00000, -0x25c21,0x00000,0x25c27,0xe5378,0xe537a,0x25c22,0x2607e,0x25c23, -0x25c2e,0xe5423,0x00000,0xe537c,0xe5421,0x00000,0xe5425,0xe537d, -0x25c2a,0x17335,0x25c29,0x25c28,0xe5379,0x25c2c,0x00000,0x00000, -0xe6673,0xe5744,0x26076,0x26079,0x00000,0xe5745,0x26078,0xe5740, -0x26122,0x2607b,0x26121,0xe5742,0x2607d,0x2607c,0x2607a,0x00000, -0x26077,0x00000,0x1762f,0x1762e,0x00000,0x17630,0x1762d,0x26123, -0x00000,0x00000,0x00000,0x00000,0x00000,0x26472,0x26475,0x00000, -0x26473,0x26477,0x00000,0xe5974,0x00000,0x26478,0x00000,0x26470, -0x17824,0x26471,0xe5973,0x2646f,0x26476,0xe5b74,0x2646e,0x2646d, -0x17823,0x17821,0x1777e,0xe5976,0xe5975,0xe5743,0x00000,0x00000, -0x00000,0x00000,0xe5971,0x26474,0x2683c,0x26842,0x17956,0x2683d, -0x00000,0x26840,0x26844,0x17957,0x2683f,0x00000,0x26837,0xe5b75, -0x26836,0x26843,0x2683a,0xe5b77,0x26838,0x26841,0x26839,0x17955, -0x17954,0xe5b79,0x26834,0x26835,0x2683e,0x00000,0xe5b7a,0x00000, -0x2683b,0x00000,0x00000,0x00000,0x00000,0x00000,0xe5d6f,0x26a7a, -0x26a7d,0xe5d71,0x00000,0xe5d67,0xe5d69,0x17822,0xe5d6a,0xe5d74, -0xe5d75,0x00000,0xe5d6e,0x00000,0xe5d68,0x26a7b,0x26b23,0x26b21, -0x26a79,0x26b26,0xe5d66,0x26a78,0xe5d76,0x17a5a,0x26b22,0x00000, -0xe5d73,0x00000,0x26a7c,0x17a59,0x26b25,0xe5d72,0x00000,0x26b24, -0x00000,0x00000,0x00000,0xe5d70,0x26c77,0x26c76,0x00000,0xe5f2c, -0x00000,0x26c7d,0x00000,0x26c79,0x26c7c,0x17b4c,0x00000,0xe642f, -0x26c7a,0x26c7b,0x00000,0x26c75,0x26c78,0x17b4b,0xe5f2a,0x00000, -0x00000,0x17c2b,0x26e61,0x26e5c,0x26e60,0xe6025,0x26e63,0x26e5f, -0xe5f7e,0x26e5b,0xe6023,0x17c2d,0x26e5e,0x26e62,0x17c2c,0x26e59, -0x26a7e,0x26e5d,0x00000,0x00000,0x26e5a,0xe6022,0x26e57,0x00000, -0x26e58,0x17c2a,0x26f68,0x26f6a,0x26f6d,0x26f69,0x26f6e,0xe6065, -0x26f67,0xe6066,0x26f65,0xe6068,0x17c57,0x26f6b,0x17c59,0x17c58, -0x26f66,0x26f6c,0x00000,0x00000,0x00000,0xe6132,0x27068,0x17c78, -0x27069,0xe6133,0x27067,0x27064,0x00000,0xe6134,0x27066,0x27065, -0x27149,0x00000,0x00000,0x00000,0xe6159,0x2714b,0x2714a,0xe615b, -0x00000,0x27169,0x00000,0x27168,0x27167,0x2716a,0xe6175,0x17d40, -0x17d41,0x27238,0x2723c,0xe6241,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x15e24,0x24154,0x24873, -0xe4564,0x1676d,0x24871,0xe4566,0xe2f42,0x24872,0xe4568,0xe4567, -0x00000,0x24f4a,0x24f4b,0x16b7a,0x16b78,0x24f4c,0x16b79,0x25633, -0xe5027,0x25636,0x25630,0x25637,0x2562f,0x25631,0xe502a,0x25632, -0x25635,0xe5024,0xe502b,0x1702a,0x2563a,0x25639,0x17028,0x25634, -0x25638,0x17029,0xe542d,0x00000,0xe5025,0xe5022,0x00000,0xe542a, -0x25c38,0x00000,0x1733a,0xe542c,0x25c33,0x17336,0xe5436,0x25c30, -0x25c36,0x25c39,0xe5433,0x1733b,0x00000,0x25c35,0x25c32,0x25c3a, -0x25c31,0xe5437,0x25c37,0x17337,0xe5429,0x25c2f,0x17338,0xe5435, -0x17339,0x25c34,0xe5432,0x00000,0x00000,0x26135,0x26128,0x26129, -0x2612c,0x2612a,0x00000,0x26124,0x00000,0xe574d,0x26127,0x26131, -0x2612b,0xe5748,0x00000,0x17631,0x00000,0x26133,0x26130,0x17632, -0x26132,0x26125,0x2612e,0x2612f,0xe574a,0x2612d,0x00000,0x00000, -0x00000,0xe6675,0x2647c,0x2647e,0x26523,0xe5979,0xe597b,0x2647b, -0xe597d,0x17825,0x26525,0x2647a,0x26526,0xe597e,0x26522,0x26524, -0x26528,0x26521,0x26529,0x2647d,0x26479,0x17826,0xe5a22,0x26527, -0x17827,0x17959,0x00000,0xe597a,0x00000,0x00000,0xe5b7d,0x26126, -0x2685e,0x26855,0x1795b,0x26851,0x1795c,0xe5c27,0xe5c22,0x2685a, -0x26854,0x2684a,0x1795a,0x26857,0x26852,0x26853,0xe5c25,0x26845, -0x2684c,0x2685b,0xe5b7e,0x26858,0x00000,0x26850,0xe5c26,0x2685c, -0x2684b,0x26846,0x26859,0xe5c24,0x26848,0x26856,0x2684d,0x2685d, -0x26849,0x17958,0x26847,0x2684e,0x2684f,0x00000,0x00000,0x00000, -0x26b2d,0xe5c23,0x26b2b,0x00000,0x26b30,0xe5d79,0x26b3c,0x26b33, -0x26b2c,0x26b28,0x26b35,0x26b2e,0x26b31,0x26b2a,0x26b38,0x26b27, -0x26b2f,0x26b34,0x26b36,0x26b39,0x26b29,0xe5d7a,0x26b3d,0x26b3e, -0x26b37,0x26b3b,0x26b32,0x00000,0x26d2f,0x26d32,0xe5f35,0x17b4d, -0xe5f31,0x26d31,0x26d36,0x26d34,0x17b4e,0x26d2b,0x26d21,0x26c7e, -0x17b50,0x26d2d,0x26d2e,0x26d2a,0x26d22,0xe5f32,0x26d27,0x26b3a, -0x00000,0x26d23,0x17b4f,0x26d29,0xe5f36,0x26d28,0x00000,0x26d24, -0x26d30,0x00000,0x26d25,0x26e68,0x26d33,0x26d35,0x26d2c,0x26d26, -0x26e69,0x26e6b,0x26e65,0x17c2e,0x00000,0x26e72,0x26e70,0x17c2f, -0x26e6f,0x26e6e,0x26e67,0x26e64,0x26e6a,0x26e73,0x26e66,0x26e6c, -0x00000,0x26f77,0x26f7c,0x26f72,0x26f75,0x17c5a,0x26f79,0x00000, -0x27022,0x26e6d,0x00000,0x26f73,0x26f7d,0x27023,0x26f78,0x26f71, -0x26f7b,0x00000,0x26f7a,0x27021,0x26f7e,0x26e71,0x26f76,0x26f70, -0x26f74,0x17c79,0x17c7a,0x26f6f,0xe606c,0x27074,0x2706b,0x27073, -0x27070,0x27071,0x2706a,0x2706d,0x27075,0x2706f,0x2706e,0x2706c, -0xe6135,0x27072,0x00000,0x2714c,0x00000,0x2714d,0xe615d,0x2714f, -0x2714e,0x27151,0x27150,0x2716c,0x2716b,0x27227,0xe6229,0x27228, -0xe6230,0x27234,0x17d45,0x17d49,0xe6238,0x2723d,0x17d4a,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x15e25,0x00000,0x00000, -0x00000,0x17a5b,0x26d37,0xe5f37,0x17c7b,0x17c7c,0x00000,0x15e26, -0x24874,0xe4569,0x1676e,0x2563b,0xe502c,0xe5439,0x25c3c,0x25c3d, -0x25c3b,0x26137,0x26136,0x17633,0x2652b,0x26138,0x2652a,0x00000, -0xe5a24,0x26860,0x1795d,0x1795f,0x2685f,0xe5c29,0x00000,0x1795e, -0xe5e21,0x26b3f,0x26b41,0x26b40,0x26d38,0x17b51,0xe5f3a,0x17c5b, -0x27076,0x27152,0xe6231,0xe623f,0x27241,0x15e27,0xe2547,0x24f4d, -0x00000,0x1702b,0xe502f,0xe502e,0xe543a,0x25c3f,0x25c3e,0xe5750, -0x26139,0xe5a26,0xe5a25,0x00000,0x17960,0x17a5c,0x26e74,0x27239, -0x00000,0x00000,0x00000,0x15e28,0x16b7b,0xe4b22,0x1702c,0x00000, -0x26861,0xe5e22,0x27024,0x16327,0xe396a,0xe543c,0xe543b,0x00000, -0x2613a,0x00000,0xe5a28,0x00000,0x17d31,0x16328,0x1702d,0x17634, -0x27025,0x16329,0xe396b,0x2563c,0x1733d,0x25c40,0x25c41,0xe543d, -0x1733c,0x00000,0x2613b,0x17638,0x17636,0x17637,0x17635,0x2652c, -0x17828,0x00000,0x00000,0xe5c2a,0x26b43,0x26b42,0x26b45,0x26b44, -0x17a5d,0x00000,0x00000,0x26d39,0x00000,0x26d3b,0x26d3a,0x17b52, -0x26e75,0xe6029,0x27026,0x27027,0x17c5c,0x27153,0x2716d,0x17d42, -0x00000,0x24155,0x25c42,0x2613c,0x26862,0x24875,0xe2772,0x2613d, -0x2652e,0x2652d,0xe5a29,0xe5c2d,0xe5c2e,0xe5f3c,0x27028,0x17c7d, -0xe615f,0x27154,0x2716e,0x00000,0x00000,0x00000,0x1676f,0x2563d, -0x2563e,0x00000,0x25c43,0x16770,0xe456a,0x17829,0x2652f,0xe5c30, -0x26d3d,0x17b53,0x26d3e,0x26d3c,0x27029,0xe6160,0x27077,0x00000, -0x16771,0x00000,0x26140,0x2613f,0x2613e,0x26530,0xe5a2b,0xe5a2a, -0x26534,0x26533,0x26532,0x26531,0x1782a,0x26863,0x26b47,0x17a5e, -0x26b46,0x26d3f,0x26e78,0x26e77,0x17c30,0x26e76,0x2702c,0x2702b, -0x2702a,0xe606d,0x00000,0x16b7c,0x00000,0x25c44,0x17639,0x00000, -0x26864,0x26865,0x26e79,0x2702d,0x00000,0xe613b,0x27078,0x27155, -0x27229,0x27243,0x16b7d,0x1763a,0x26535,0x26866,0x26d40,0x2702e, -0xe2370,0x00000,0x1702f,0xe543e,0x26141,0x26536,0x26867,0x26868, -0x26869,0x26b4c,0xe5e24,0x26b48,0x17b54,0x26b4b,0x26b4a,0x17a5f, -0x26b49,0x17a61,0x00000,0x17a60,0x26d42,0x26d41,0x17b55,0x17b56, -0x00000,0xe5f3e,0x17c32,0x26e7a,0x17c31,0x00000,0x27031,0x27032, -0x27030,0x2702f,0x17d21,0x00000,0x27079,0x2707a,0x2707b,0x17c7e, -0x27156,0x27159,0x27158,0x27157,0xe6233,0x00000,0x27242,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x1733e,0xe5755,0x00000, -0x17832,0x26b4d,0x26d43,0xe602b,0x17c33,0x26e7b,0x00000,0xe6242, -0x27244,0x00000,0x00000,0x00000,0x1733f,0xe5e47,0x00000,0x00000, -0x26142,0xe5f3f,0x26e7c,0xe6161,0x2716f,0xe6177}; - -static const int ucs_i_cns11643_table_min = 0x4d00; -static const int ucs_i_cns11643_table_max = 0x4d00 + (sizeof (ucs_i_cns11643_table) / sizeof (unsigned int)); - -static const unsigned int ucs_r_cns11643_table[] = { -/* 0xfe00 */ -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x1212b,0x12136,0x12138,0x00000,0x00000,0x12140,0x12141,0x12144, -0x12145,0x12148,0x12149,0x1214c,0x1214d,0x12150,0x12151,0x12154, -0x12155,0x12158,0x12159,0x1215c,0x1215d,0x00000,0x00000,0x00000, -0x00000,0x12227,0x12228,0x1222b,0x1222c,0x12229,0x1222a,0x00000, -0x1212e,0x1212f,0x12130,0x00000,0x12132,0x12133,0x12134,0x12135, -0x00000,0x1215e,0x1215f,0x12160,0x12161,0x12162,0x12163,0x1222d, -0x1222e,0x1222f,0x1223f,0x12240,0x12241,0x12243,0x12242,0x00000, -0x12262,0x1226c,0x1226d,0x1226e,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -/* 0xff00 */ -0x00000,0x1212a,0x00000,0x1216c,0x12263,0x12268,0x1216d,0x00000, -0x1213e,0x1213f,0x1216e,0x12230,0x12122,0x12231,0x12125,0x1225f, -0x12421,0x12422,0x12423,0x12424,0x12425,0x12426,0x12427,0x12428, -0x12429,0x1242a,0x12128,0x12127,0x12236,0x12238,0x12237,0x12129, -0x12269,0x12441,0x12442,0x12443,0x12444,0x12445,0x12446,0x12447, -0x12448,0x12449,0x1244a,0x1244b,0x1244c,0x1244d,0x1244e,0x1244f, -0x12450,0x12451,0x12452,0x12453,0x12454,0x12455,0x12456,0x12457, -0x12458,0x12459,0x1245a,0x00000,0x12260,0x00000,0x00000,0x12225, -0x00000,0x1245b,0x1245c,0x1245d,0x1245e,0x1245f,0x12460,0x12461, -0x12462,0x12463,0x12464,0x12465,0x12466,0x12467,0x12468,0x12469, -0x1246a,0x1246b,0x1246c,0x1246d,0x1246e,0x1246f,0x12470,0x12471, -0x12472,0x12473,0x12474,0x12142,0x1225e,0x12143,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000,0x00000, -0x12266,0x12267,0x00000,0x00000,0x00000,0x12264}; - -static const int ucs_r_cns11643_table_min = 0xfe00; -static const int ucs_r_cns11643_table_max = 0xfe00 + (sizeof (ucs_r_cns11643_table) / sizeof (unsigned int)); - - -#endif /* UNICODE_TABLE_CNS11643_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cp1251.h b/ext/mbstring/libmbfl/filters/unicode_table_cp1251.h deleted file mode 100644 index 99ec985b36a46..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cp1251.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The authors of this file: PHP3 internationalization team - * You can contact the primary author 金ĉœĴ€€èŒ‚ . - * - */ - -#ifndef UNICODE_TABLE_CP1251_H - -/* cp1251 to Unicode table */ -static const unsigned short cp1251_ucs_table[] = { - 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, - 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, - 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x003f, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, - 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, - 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, - 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, - 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f -}; -static const int cp1251_ucs_table_min = 0x80; -static const int cp1251_ucs_table_len = (sizeof (cp1251_ucs_table) / sizeof (unsigned short)); -static const int cp1251_ucs_table_max = 0x80 + (sizeof (cp1251_ucs_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_CP1251_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cp1252.h b/ext/mbstring/libmbfl/filters/unicode_table_cp1252.h deleted file mode 100644 index 8a33920f11c81..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cp1252.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The authors of this file: PHP3 internationalization team - * You can contact the primary author 金ĉœĴ€€èŒ‚ . - * - */ - -#ifndef UNICODE_TABLE_CP1252_H -#define UNICODE_TABLE_CP1252_H - -/* Windows CodePage 1252 - it's the same as iso-8859-1 but - * defines extra symbols in the range 0x80-0x9f. - * This table differs from the rest of the unicode tables below - * as it only covers this range, while the rest cover 0xa0 onwards */ - -static const unsigned short cp1252_ucs_table[] = { - 0x20ac,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021, - 0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0x017d,0xfffe, - 0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014, - 0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffe,0x017e,0x0178 -}; -#endif /* UNICODE_TABLE_CP1252_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cp866.h b/ext/mbstring/libmbfl/filters/unicode_table_cp866.h deleted file mode 100644 index 567493276f63c..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cp866.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The original author of this file: Den V. Tsopa - * - */ - -#ifndef UNICODE_TABLE_CP866_H -#define UNICODE_TABLE_CP866_H - -/* cp866_DOSCyrillicRussian to Unicode table */ -static const unsigned short cp866_ucs_table[] = { - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, - 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, - 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, - 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, - 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040e, 0x045e, - 0x00b0, 0x2219, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0 -}; -static const int cp866_ucs_table_min = 0x80; -static const int cp866_ucs_table_len = (sizeof (cp866_ucs_table) / sizeof (unsigned short)); -static const int cp866_ucs_table_max = 0x80 + (sizeof (cp866_ucs_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_CP866_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h b/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h deleted file mode 100644 index c948dfa16b3c4..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ - -#ifndef UNICODE_TABLE_CP932_EXT_H -#define UNICODE_TABLE_CP932_EXT_H - -static const unsigned short cp932ext1_ucs_table[] = { - /* ku 13 */ - 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, - 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, - 0x2470,0x2471,0x2472,0x2473,0x2160,0x2161,0x2162,0x2163, - 0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x0000,0x3349, - 0x3314,0x3322,0x334D,0x3318,0x3327,0x3303,0x3336,0x3351, - 0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,0x333B,0x339C, - 0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x337B,0x301D, - 0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7, - 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252, - 0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F, - 0x22BF,0x2235,0x2229,0x222A,0x0000,0x0000 -}; -static const int cp932ext1_ucs_table_min = (13 - 1)*94; -static const int cp932ext1_ucs_table_max = (13 - 1)*94 + (sizeof (cp932ext1_ucs_table) / sizeof (unsigned short)); - -static const unsigned short cp932ext2_ucs_table[] = { - /* ku 89 */ - 0x7E8A,0x891C,0x9348,0x9288,0x84DC,0x4FC9,0x70BB,0x6631, - 0x68C8,0x92F9,0x66FB,0x5F45,0x4E28,0x4EE1,0x4EFC,0x4F00, - 0x4F03,0x4F39,0x4F56,0x4F92,0x4F8A,0x4F9A,0x4F94,0x4FCD, - 0x5040,0x5022,0x4FFF,0x501E,0x5046,0x5070,0x5042,0x5094, - 0x50F4,0x50D8,0x514A,0x5164,0x519D,0x51BE,0x51EC,0x5215, - 0x529C,0x52A6,0x52C0,0x52DB,0x5300,0x5307,0x5324,0x5372, - 0x5393,0x53B2,0x53DD,0xFA0E,0x549C,0x548A,0x54A9,0x54FF, - 0x5586,0x5759,0x5765,0x57AC,0x57C8,0x57C7,0xFA0F,0xFA10, - 0x589E,0x58B2,0x590B,0x5953,0x595B,0x595D,0x5963,0x59A4, - 0x59BA,0x5B56,0x5BC0,0x752F,0x5BD8,0x5BEC,0x5C1E,0x5CA6, - 0x5CBA,0x5CF5,0x5D27,0x5D53,0xFA11,0x5D42,0x5D6D,0x5DB8, - 0x5DB9,0x5DD0,0x5F21,0x5F34,0x5F67,0x5FB7, - - /* ku 90 */ - 0x5FDE,0x605D,0x6085,0x608A,0x60DE,0x60D5,0x6120,0x60F2, - 0x6111,0x6137,0x6130,0x6198,0x6213,0x62A6,0x63F5,0x6460, - 0x649D,0x64CE,0x654E,0x6600,0x6615,0x663B,0x6609,0x662E, - 0x661E,0x6624,0x6665,0x6657,0x6659,0xFA12,0x6673,0x6699, - 0x66A0,0x66B2,0x66BF,0x66FA,0x670E,0xF929,0x6766,0x67BB, - 0x6852,0x67C0,0x6801,0x6844,0x68CF,0xFA13,0x6968,0xFA14, - 0x6998,0x69E2,0x6A30,0x6A6B,0x6A46,0x6A73,0x6A7E,0x6AE2, - 0x6AE4,0x6BD6,0x6C3F,0x6C5C,0x6C86,0x6C6F,0x6CDA,0x6D04, - 0x6D87,0x6D6F,0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC, - 0x6E39,0x6E5C,0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5, - 0x7005,0x7007,0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C, - 0x7146,0x7147,0xFA15,0x71C1,0x71FE,0x72B1, - - /* ku 91 */ - 0x72BE,0x7324,0xFA16,0x7377,0x73BD,0x73C9,0x73D6,0x73E3, - 0x73D2,0x7407,0x73F5,0x7426,0x742A,0x7429,0x742E,0x7462, - 0x7489,0x749F,0x7501,0x756F,0x7682,0x769C,0x769E,0x769B, - 0x76A6,0xFA17,0x7746,0x52AF,0x7821,0x784E,0x7864,0x787A, - 0x7930,0xFA18,0xFA19,0xFA1A,0x7994,0xFA1B,0x799B,0x7AD1, - 0x7AE7,0xFA1C,0x7AEB,0x7B9E,0xFA1D,0x7D48,0x7D5C,0x7DB7, - 0x7DA0,0x7DD6,0x7E52,0x7F47,0x7FA1,0xFA1E,0x8301,0x8362, - 0x837F,0x83C7,0x83F6,0x8448,0x84B4,0x8553,0x8559,0x856B, - 0xFA1F,0x85B0,0xFA20,0xFA21,0x8807,0x88F5,0x8A12,0x8A37, - 0x8A79,0x8AA7,0x8ABE,0x8ADF,0xFA22,0x8AF6,0x8B53,0x8B7F, - 0x8CF0,0x8CF4,0x8D12,0x8D76,0xFA23,0x8ECF,0xFA24,0xFA25, - 0x9067,0x90DE,0xFA26,0x9115,0x9127,0x91DA, - - /* ku 92 */ - 0x91D7,0x91DE,0x91ED,0x91EE,0x91E4,0x91E5,0x9206,0x9210, - 0x920A,0x923A,0x9240,0x923C,0x924E,0x9259,0x9251,0x9239, - 0x9267,0x92A7,0x9277,0x9278,0x92E7,0x92D7,0x92D9,0x92D0, - 0xFA27,0x92D5,0x92E0,0x92D3,0x9325,0x9321,0x92FB,0xFA28, - 0x931E,0x92FF,0x931D,0x9302,0x9370,0x9357,0x93A4,0x93C6, - 0x93DE,0x93F8,0x9431,0x9445,0x9448,0x9592,0xF9DC,0xFA29, - 0x969D,0x96AF,0x9733,0x973B,0x9743,0x974D,0x974F,0x9751, - 0x9755,0x9857,0x9865,0xFA2A,0xFA2B,0x9927,0xFA2C,0x999E, - 0x9A4E,0x9AD9,0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB, - 0x9C00,0x9D70,0x9D6B,0xFA2D,0x9E19,0x9ED1,0x0000,0x0000, - 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, - 0x2178,0x2179,0xFFE2,0xFFE4,0xFF07,0xFF02 -}; -static const int cp932ext2_ucs_table_min = (89 - 1)*94; -static const int cp932ext2_ucs_table_max = (89 - 1)*94 + (sizeof (cp932ext2_ucs_table) / sizeof (unsigned short)); - -static const unsigned short cp932ext3_ucs_table[] = { - /* ku 115 */ - 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, - 0x2178,0x2179,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165, - 0x2166,0x2167,0x2168,0x2169,0xFFE2,0xFFE4,0xFF07,0xFF02, - 0x3231,0x2116,0x2121,0x2235,0x7E8A,0x891C,0x9348,0x9288, - 0x84DC,0x4FC9,0x70BB,0x6631,0x68C8,0x92F9,0x66FB,0x5F45, - 0x4E28,0x4EE1,0x4EFC,0x4F00,0x4F03,0x4F39,0x4F56,0x4F92, - 0x4F8A,0x4F9A,0x4F94,0x4FCD,0x5040,0x5022,0x4FFF,0x501E, - 0x5046,0x5070,0x5042,0x5094,0x50F4,0x50D8,0x514A,0x5164, - 0x519D,0x51BE,0x51EC,0x5215,0x529C,0x52A6,0x52C0,0x52DB, - 0x5300,0x5307,0x5324,0x5372,0x5393,0x53B2,0x53DD,0xFA0E, - 0x549C,0x548A,0x54A9,0x54FF,0x5586,0x5759,0x5765,0x57AC, - 0x57C8,0x57C7,0xFA0F,0xFA10,0x589E,0x58B2, - - /* ku 116 */ - 0x590B,0x5953,0x595B,0x595D,0x5963,0x59A4,0x59BA,0x5B56, - 0x5BC0,0x752F,0x5BD8,0x5BEC,0x5C1E,0x5CA6,0x5CBA,0x5CF5, - 0x5D27,0x5D53,0xFA11,0x5D42,0x5D6D,0x5DB8,0x5DB9,0x5DD0, - 0x5F21,0x5F34,0x5F67,0x5FB7,0x5FDE,0x605D,0x6085,0x608A, - 0x60DE,0x60D5,0x6120,0x60F2,0x6111,0x6137,0x6130,0x6198, - 0x6213,0x62A6,0x63F5,0x6460,0x649D,0x64CE,0x654E,0x6600, - 0x6615,0x663B,0x6609,0x662E,0x661E,0x6624,0x6665,0x6657, - 0x6659,0xFA12,0x6673,0x6699,0x66A0,0x66B2,0x66BF,0x66FA, - 0x670E,0xF929,0x6766,0x67BB,0x6852,0x67C0,0x6801,0x6844, - 0x68CF,0xFA13,0x6968,0xFA14,0x6998,0x69E2,0x6A30,0x6A6B, - 0x6A46,0x6A73,0x6A7E,0x6AE2,0x6AE4,0x6BD6,0x6C3F,0x6C5C, - 0x6C86,0x6C6F,0x6CDA,0x6D04,0x6D87,0x6D6F, - - /* ku 117 */ - 0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC,0x6E39,0x6E5C, - 0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5,0x7005,0x7007, - 0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C,0x7146,0x7147, - 0xFA15,0x71C1,0x71FE,0x72B1,0x72BE,0x7324,0xFA16,0x7377, - 0x73BD,0x73C9,0x73D6,0x73E3,0x73D2,0x7407,0x73F5,0x7426, - 0x742A,0x7429,0x742E,0x7462,0x7489,0x749F,0x7501,0x756F, - 0x7682,0x769C,0x769E,0x769B,0x76A6,0xFA17,0x7746,0x52AF, - 0x7821,0x784E,0x7864,0x787A,0x7930,0xFA18,0xFA19,0xFA1A, - 0x7994,0xFA1B,0x799B,0x7AD1,0x7AE7,0xFA1C,0x7AEB,0x7B9E, - 0xFA1D,0x7D48,0x7D5C,0x7DB7,0x7DA0,0x7DD6,0x7E52,0x7F47, - 0x7FA1,0xFA1E,0x8301,0x8362,0x837F,0x83C7,0x83F6,0x8448, - 0x84B4,0x8553,0x8559,0x856B,0xFA1F,0x85B0, - - /* ku 118 */ - 0xFA20,0xFA21,0x8807,0x88F5,0x8A12,0x8A37,0x8A79,0x8AA7, - 0x8ABE,0x8ADF,0xFA22,0x8AF6,0x8B53,0x8B7F,0x8CF0,0x8CF4, - 0x8D12,0x8D76,0xFA23,0x8ECF,0xFA24,0xFA25,0x9067,0x90DE, - 0xFA26,0x9115,0x9127,0x91DA,0x91D7,0x91DE,0x91ED,0x91EE, - 0x91E4,0x91E5,0x9206,0x9210,0x920A,0x923A,0x9240,0x923C, - 0x924E,0x9259,0x9251,0x9239,0x9267,0x92A7,0x9277,0x9278, - 0x92E7,0x92D7,0x92D9,0x92D0,0xFA27,0x92D5,0x92E0,0x92D3, - 0x9325,0x9321,0x92FB,0xFA28,0x931E,0x92FF,0x931D,0x9302, - 0x9370,0x9357,0x93A4,0x93C6,0x93DE,0x93F8,0x9431,0x9445, - 0x9448,0x9592,0xF9DC,0xFA29,0x969D,0x96AF,0x9733,0x973B, - 0x9743,0x974D,0x974F,0x9751,0x9755,0x9857,0x9865,0xFA2A, - 0xFA2B,0x9927,0xFA2C,0x999E,0x9A4E,0x9AD9, - - /* ku 119 */ - 0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70, - 0x9D6B,0xFA2D,0x9E19,0x9ED1 -}; -static const int cp932ext3_ucs_table_min = (115 - 1)*94; -static const int cp932ext3_ucs_table_max = (115 - 1)*94 + (sizeof (cp932ext3_ucs_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_CP932_EXT_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_cp936.h b/ext/mbstring/libmbfl/filters/unicode_table_cp936.h deleted file mode 100644 index aa024d1a45fa8..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_cp936.h +++ /dev/null @@ -1,6489 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ - -#ifndef UNICODE_TABLE_CP936_H -#define UNICODE_TABLE_CP936_H - -/* - * Unicode table - */ - -static const unsigned short cp936_ucs_table[] = { -/* 0x8100 */ -0x4e02,0x4e04,0x4e05,0x4e06,0x4e0f,0x4e12,0x4e17,0x4e1f, -0x4e20,0x4e21,0x4e23,0x4e26,0x4e29,0x4e2e,0x4e2f,0x4e31, -0x4e33,0x4e35,0x4e37,0x4e3c,0x4e40,0x4e41,0x4e42,0x4e44, -0x4e46,0x4e4a,0x4e51,0x4e55,0x4e57,0x4e5a,0x4e5b,0x4e62, -0x4e63,0x4e64,0x4e65,0x4e67,0x4e68,0x4e6a,0x4e6b,0x4e6c, -0x4e6d,0x4e6e,0x4e6f,0x4e72,0x4e74,0x4e75,0x4e76,0x4e77, -0x4e78,0x4e79,0x4e7a,0x4e7b,0x4e7c,0x4e7d,0x4e7f,0x4e80, -0x4e81,0x4e82,0x4e83,0x4e84,0x4e85,0x4e87,0x4e8a,0x0000, -0x4e90,0x4e96,0x4e97,0x4e99,0x4e9c,0x4e9d,0x4e9e,0x4ea3, -0x4eaa,0x4eaf,0x4eb0,0x4eb1,0x4eb4,0x4eb6,0x4eb7,0x4eb8, -0x4eb9,0x4ebc,0x4ebd,0x4ebe,0x4ec8,0x4ecc,0x4ecf,0x4ed0, -0x4ed2,0x4eda,0x4edb,0x4edc,0x4ee0,0x4ee2,0x4ee6,0x4ee7, -0x4ee9,0x4eed,0x4eee,0x4eef,0x4ef1,0x4ef4,0x4ef8,0x4ef9, -0x4efa,0x4efc,0x4efe,0x4f00,0x4f02,0x4f03,0x4f04,0x4f05, -0x4f06,0x4f07,0x4f08,0x4f0b,0x4f0c,0x4f12,0x4f13,0x4f14, -0x4f15,0x4f16,0x4f1c,0x4f1d,0x4f21,0x4f23,0x4f28,0x4f29, -0x4f2c,0x4f2d,0x4f2e,0x4f31,0x4f33,0x4f35,0x4f37,0x4f39, -0x4f3b,0x4f3e,0x4f3f,0x4f40,0x4f41,0x4f42,0x4f44,0x4f45, -0x4f47,0x4f48,0x4f49,0x4f4a,0x4f4b,0x4f4c,0x4f52,0x4f54, -0x4f56,0x4f61,0x4f62,0x4f66,0x4f68,0x4f6a,0x4f6b,0x4f6d, -0x4f6e,0x4f71,0x4f72,0x4f75,0x4f77,0x4f78,0x4f79,0x4f7a, -0x4f7d,0x4f80,0x4f81,0x4f82,0x4f85,0x4f86,0x4f87,0x4f8a, -0x4f8c,0x4f8e,0x4f90,0x4f92,0x4f93,0x4f95,0x4f96,0x4f98, -0x4f99,0x4f9a,0x4f9c,0x4f9e,0x4f9f,0x4fa1,0x4fa2,0x0000, -/* 0x8200 */ -0x4fa4,0x4fab,0x4fad,0x4fb0,0x4fb1,0x4fb2,0x4fb3,0x4fb4, -0x4fb6,0x4fb7,0x4fb8,0x4fb9,0x4fba,0x4fbb,0x4fbc,0x4fbd, -0x4fbe,0x4fc0,0x4fc1,0x4fc2,0x4fc6,0x4fc7,0x4fc8,0x4fc9, -0x4fcb,0x4fcc,0x4fcd,0x4fd2,0x4fd3,0x4fd4,0x4fd5,0x4fd6, -0x4fd9,0x4fdb,0x4fe0,0x4fe2,0x4fe4,0x4fe5,0x4fe7,0x4feb, -0x4fec,0x4ff0,0x4ff2,0x4ff4,0x4ff5,0x4ff6,0x4ff7,0x4ff9, -0x4ffb,0x4ffc,0x4ffd,0x4fff,0x5000,0x5001,0x5002,0x5003, -0x5004,0x5005,0x5006,0x5007,0x5008,0x5009,0x500a,0x0000, -0x500b,0x500e,0x5010,0x5011,0x5013,0x5015,0x5016,0x5017, -0x501b,0x501d,0x501e,0x5020,0x5022,0x5023,0x5024,0x5027, -0x502b,0x502f,0x5030,0x5031,0x5032,0x5033,0x5034,0x5035, -0x5036,0x5037,0x5038,0x5039,0x503b,0x503d,0x503f,0x5040, -0x5041,0x5042,0x5044,0x5045,0x5046,0x5049,0x504a,0x504b, -0x504d,0x5050,0x5051,0x5052,0x5053,0x5054,0x5056,0x5057, -0x5058,0x5059,0x505b,0x505d,0x505e,0x505f,0x5060,0x5061, -0x5062,0x5063,0x5064,0x5066,0x5067,0x5068,0x5069,0x506a, -0x506b,0x506d,0x506e,0x506f,0x5070,0x5071,0x5072,0x5073, -0x5074,0x5075,0x5078,0x5079,0x507a,0x507c,0x507d,0x5081, -0x5082,0x5083,0x5084,0x5086,0x5087,0x5089,0x508a,0x508b, -0x508c,0x508e,0x508f,0x5090,0x5091,0x5092,0x5093,0x5094, -0x5095,0x5096,0x5097,0x5098,0x5099,0x509a,0x509b,0x509c, -0x509d,0x509e,0x509f,0x50a0,0x50a1,0x50a2,0x50a4,0x50a6, -0x50aa,0x50ab,0x50ad,0x50ae,0x50af,0x50b0,0x50b1,0x50b3, -0x50b4,0x50b5,0x50b6,0x50b7,0x50b8,0x50b9,0x50bc,0x0000, -/* 0x8300 */ -0x50bd,0x50be,0x50bf,0x50c0,0x50c1,0x50c2,0x50c3,0x50c4, -0x50c5,0x50c6,0x50c7,0x50c8,0x50c9,0x50ca,0x50cb,0x50cc, -0x50cd,0x50ce,0x50d0,0x50d1,0x50d2,0x50d3,0x50d4,0x50d5, -0x50d7,0x50d8,0x50d9,0x50db,0x50dc,0x50dd,0x50de,0x50df, -0x50e0,0x50e1,0x50e2,0x50e3,0x50e4,0x50e5,0x50e8,0x50e9, -0x50ea,0x50eb,0x50ef,0x50f0,0x50f1,0x50f2,0x50f4,0x50f6, -0x50f7,0x50f8,0x50f9,0x50fa,0x50fc,0x50fd,0x50fe,0x50ff, -0x5100,0x5101,0x5102,0x5103,0x5104,0x5105,0x5108,0x0000, -0x5109,0x510a,0x510c,0x510d,0x510e,0x510f,0x5110,0x5111, -0x5113,0x5114,0x5115,0x5116,0x5117,0x5118,0x5119,0x511a, -0x511b,0x511c,0x511d,0x511e,0x511f,0x5120,0x5122,0x5123, -0x5124,0x5125,0x5126,0x5127,0x5128,0x5129,0x512a,0x512b, -0x512c,0x512d,0x512e,0x512f,0x5130,0x5131,0x5132,0x5133, -0x5134,0x5135,0x5136,0x5137,0x5138,0x5139,0x513a,0x513b, -0x513c,0x513d,0x513e,0x5142,0x5147,0x514a,0x514c,0x514e, -0x514f,0x5150,0x5152,0x5153,0x5157,0x5158,0x5159,0x515b, -0x515d,0x515e,0x515f,0x5160,0x5161,0x5163,0x5164,0x5166, -0x5167,0x5169,0x516a,0x516f,0x5172,0x517a,0x517e,0x517f, -0x5183,0x5184,0x5186,0x5187,0x518a,0x518b,0x518e,0x518f, -0x5190,0x5191,0x5193,0x5194,0x5198,0x519a,0x519d,0x519e, -0x519f,0x51a1,0x51a3,0x51a6,0x51a7,0x51a8,0x51a9,0x51aa, -0x51ad,0x51ae,0x51b4,0x51b8,0x51b9,0x51ba,0x51be,0x51bf, -0x51c1,0x51c2,0x51c3,0x51c5,0x51c8,0x51ca,0x51cd,0x51ce, -0x51d0,0x51d2,0x51d3,0x51d4,0x51d5,0x51d6,0x51d7,0x0000, -/* 0x8400 */ -0x51d8,0x51d9,0x51da,0x51dc,0x51de,0x51df,0x51e2,0x51e3, -0x51e5,0x51e6,0x51e7,0x51e8,0x51e9,0x51ea,0x51ec,0x51ee, -0x51f1,0x51f2,0x51f4,0x51f7,0x51fe,0x5204,0x5205,0x5209, -0x520b,0x520c,0x520f,0x5210,0x5213,0x5214,0x5215,0x521c, -0x521e,0x521f,0x5221,0x5222,0x5223,0x5225,0x5226,0x5227, -0x522a,0x522c,0x522f,0x5231,0x5232,0x5234,0x5235,0x523c, -0x523e,0x5244,0x5245,0x5246,0x5247,0x5248,0x5249,0x524b, -0x524e,0x524f,0x5252,0x5253,0x5255,0x5257,0x5258,0x0000, -0x5259,0x525a,0x525b,0x525d,0x525f,0x5260,0x5262,0x5263, -0x5264,0x5266,0x5268,0x526b,0x526c,0x526d,0x526e,0x5270, -0x5271,0x5273,0x5274,0x5275,0x5276,0x5277,0x5278,0x5279, -0x527a,0x527b,0x527c,0x527e,0x5280,0x5283,0x5284,0x5285, -0x5286,0x5287,0x5289,0x528a,0x528b,0x528c,0x528d,0x528e, -0x528f,0x5291,0x5292,0x5294,0x5295,0x5296,0x5297,0x5298, -0x5299,0x529a,0x529c,0x52a4,0x52a5,0x52a6,0x52a7,0x52ae, -0x52af,0x52b0,0x52b4,0x52b5,0x52b6,0x52b7,0x52b8,0x52b9, -0x52ba,0x52bb,0x52bc,0x52bd,0x52c0,0x52c1,0x52c2,0x52c4, -0x52c5,0x52c6,0x52c8,0x52ca,0x52cc,0x52cd,0x52ce,0x52cf, -0x52d1,0x52d3,0x52d4,0x52d5,0x52d7,0x52d9,0x52da,0x52db, -0x52dc,0x52dd,0x52de,0x52e0,0x52e1,0x52e2,0x52e3,0x52e5, -0x52e6,0x52e7,0x52e8,0x52e9,0x52ea,0x52eb,0x52ec,0x52ed, -0x52ee,0x52ef,0x52f1,0x52f2,0x52f3,0x52f4,0x52f5,0x52f6, -0x52f7,0x52f8,0x52fb,0x52fc,0x52fd,0x5301,0x5302,0x5303, -0x5304,0x5307,0x5309,0x530a,0x530b,0x530c,0x530e,0x0000, -/* 0x8500 */ -0x5311,0x5312,0x5313,0x5314,0x5318,0x531b,0x531c,0x531e, -0x531f,0x5322,0x5324,0x5325,0x5327,0x5328,0x5329,0x532b, -0x532c,0x532d,0x532f,0x5330,0x5331,0x5332,0x5333,0x5334, -0x5335,0x5336,0x5337,0x5338,0x533c,0x533d,0x5340,0x5342, -0x5344,0x5346,0x534b,0x534c,0x534d,0x5350,0x5354,0x5358, -0x5359,0x535b,0x535d,0x5365,0x5368,0x536a,0x536c,0x536d, -0x5372,0x5376,0x5379,0x537b,0x537c,0x537d,0x537e,0x5380, -0x5381,0x5383,0x5387,0x5388,0x538a,0x538e,0x538f,0x0000, -0x5390,0x5391,0x5392,0x5393,0x5394,0x5396,0x5397,0x5399, -0x539b,0x539c,0x539e,0x53a0,0x53a1,0x53a4,0x53a7,0x53aa, -0x53ab,0x53ac,0x53ad,0x53af,0x53b0,0x53b1,0x53b2,0x53b3, -0x53b4,0x53b5,0x53b7,0x53b8,0x53b9,0x53ba,0x53bc,0x53bd, -0x53be,0x53c0,0x53c3,0x53c4,0x53c5,0x53c6,0x53c7,0x53ce, -0x53cf,0x53d0,0x53d2,0x53d3,0x53d5,0x53da,0x53dc,0x53dd, -0x53de,0x53e1,0x53e2,0x53e7,0x53f4,0x53fa,0x53fe,0x53ff, -0x5400,0x5402,0x5405,0x5407,0x540b,0x5414,0x5418,0x5419, -0x541a,0x541c,0x5422,0x5424,0x5425,0x542a,0x5430,0x5433, -0x5436,0x5437,0x543a,0x543d,0x543f,0x5441,0x5442,0x5444, -0x5445,0x5447,0x5449,0x544c,0x544d,0x544e,0x544f,0x5451, -0x545a,0x545d,0x545e,0x545f,0x5460,0x5461,0x5463,0x5465, -0x5467,0x5469,0x546a,0x546b,0x546c,0x546d,0x546e,0x546f, -0x5470,0x5474,0x5479,0x547a,0x547e,0x547f,0x5481,0x5483, -0x5485,0x5487,0x5488,0x5489,0x548a,0x548d,0x5491,0x5493, -0x5497,0x5498,0x549c,0x549e,0x549f,0x54a0,0x54a1,0x0000, -/* 0x8600 */ -0x54a2,0x54a5,0x54ae,0x54b0,0x54b2,0x54b5,0x54b6,0x54b7, -0x54b9,0x54ba,0x54bc,0x54be,0x54c3,0x54c5,0x54ca,0x54cb, -0x54d6,0x54d8,0x54db,0x54e0,0x54e1,0x54e2,0x54e3,0x54e4, -0x54eb,0x54ec,0x54ef,0x54f0,0x54f1,0x54f4,0x54f5,0x54f6, -0x54f7,0x54f8,0x54f9,0x54fb,0x54fe,0x5500,0x5502,0x5503, -0x5504,0x5505,0x5508,0x550a,0x550b,0x550c,0x550d,0x550e, -0x5512,0x5513,0x5515,0x5516,0x5517,0x5518,0x5519,0x551a, -0x551c,0x551d,0x551e,0x551f,0x5521,0x5525,0x5526,0x0000, -0x5528,0x5529,0x552b,0x552d,0x5532,0x5534,0x5535,0x5536, -0x5538,0x5539,0x553a,0x553b,0x553d,0x5540,0x5542,0x5545, -0x5547,0x5548,0x554b,0x554c,0x554d,0x554e,0x554f,0x5551, -0x5552,0x5553,0x5554,0x5557,0x5558,0x5559,0x555a,0x555b, -0x555d,0x555e,0x555f,0x5560,0x5562,0x5563,0x5568,0x5569, -0x556b,0x556f,0x5570,0x5571,0x5572,0x5573,0x5574,0x5579, -0x557a,0x557d,0x557f,0x5585,0x5586,0x558c,0x558d,0x558e, -0x5590,0x5592,0x5593,0x5595,0x5596,0x5597,0x559a,0x559b, -0x559e,0x55a0,0x55a1,0x55a2,0x55a3,0x55a4,0x55a5,0x55a6, -0x55a8,0x55a9,0x55aa,0x55ab,0x55ac,0x55ad,0x55ae,0x55af, -0x55b0,0x55b2,0x55b4,0x55b6,0x55b8,0x55ba,0x55bc,0x55bf, -0x55c0,0x55c1,0x55c2,0x55c3,0x55c6,0x55c7,0x55c8,0x55ca, -0x55cb,0x55ce,0x55cf,0x55d0,0x55d5,0x55d7,0x55d8,0x55d9, -0x55da,0x55db,0x55de,0x55e0,0x55e2,0x55e7,0x55e9,0x55ed, -0x55ee,0x55f0,0x55f1,0x55f4,0x55f6,0x55f8,0x55f9,0x55fa, -0x55fb,0x55fc,0x55ff,0x5602,0x5603,0x5604,0x5605,0x0000, -/* 0x8700 */ -0x5606,0x5607,0x560a,0x560b,0x560d,0x5610,0x5611,0x5612, -0x5613,0x5614,0x5615,0x5616,0x5617,0x5619,0x561a,0x561c, -0x561d,0x5620,0x5621,0x5622,0x5625,0x5626,0x5628,0x5629, -0x562a,0x562b,0x562e,0x562f,0x5630,0x5633,0x5635,0x5637, -0x5638,0x563a,0x563c,0x563d,0x563e,0x5640,0x5641,0x5642, -0x5643,0x5644,0x5645,0x5646,0x5647,0x5648,0x5649,0x564a, -0x564b,0x564f,0x5650,0x5651,0x5652,0x5653,0x5655,0x5656, -0x565a,0x565b,0x565d,0x565e,0x565f,0x5660,0x5661,0x0000, -0x5663,0x5665,0x5666,0x5667,0x566d,0x566e,0x566f,0x5670, -0x5672,0x5673,0x5674,0x5675,0x5677,0x5678,0x5679,0x567a, -0x567d,0x567e,0x567f,0x5680,0x5681,0x5682,0x5683,0x5684, -0x5687,0x5688,0x5689,0x568a,0x568b,0x568c,0x568d,0x5690, -0x5691,0x5692,0x5694,0x5695,0x5696,0x5697,0x5698,0x5699, -0x569a,0x569b,0x569c,0x569d,0x569e,0x569f,0x56a0,0x56a1, -0x56a2,0x56a4,0x56a5,0x56a6,0x56a7,0x56a8,0x56a9,0x56aa, -0x56ab,0x56ac,0x56ad,0x56ae,0x56b0,0x56b1,0x56b2,0x56b3, -0x56b4,0x56b5,0x56b6,0x56b8,0x56b9,0x56ba,0x56bb,0x56bd, -0x56be,0x56bf,0x56c0,0x56c1,0x56c2,0x56c3,0x56c4,0x56c5, -0x56c6,0x56c7,0x56c8,0x56c9,0x56cb,0x56cc,0x56cd,0x56ce, -0x56cf,0x56d0,0x56d1,0x56d2,0x56d3,0x56d5,0x56d6,0x56d8, -0x56d9,0x56dc,0x56e3,0x56e5,0x56e6,0x56e7,0x56e8,0x56e9, -0x56ea,0x56ec,0x56ee,0x56ef,0x56f2,0x56f3,0x56f6,0x56f7, -0x56f8,0x56fb,0x56fc,0x5700,0x5701,0x5702,0x5705,0x5707, -0x570b,0x570c,0x570d,0x570e,0x570f,0x5710,0x5711,0x0000, -/* 0x8800 */ -0x5712,0x5713,0x5714,0x5715,0x5716,0x5717,0x5718,0x5719, -0x571a,0x571b,0x571d,0x571e,0x5720,0x5721,0x5722,0x5724, -0x5725,0x5726,0x5727,0x572b,0x5731,0x5732,0x5734,0x5735, -0x5736,0x5737,0x5738,0x573c,0x573d,0x573f,0x5741,0x5743, -0x5744,0x5745,0x5746,0x5748,0x5749,0x574b,0x5752,0x5753, -0x5754,0x5755,0x5756,0x5758,0x5759,0x5762,0x5763,0x5765, -0x5767,0x576c,0x576e,0x5770,0x5771,0x5772,0x5774,0x5775, -0x5778,0x5779,0x577a,0x577d,0x577e,0x577f,0x5780,0x0000, -0x5781,0x5787,0x5788,0x5789,0x578a,0x578d,0x578e,0x578f, -0x5790,0x5791,0x5794,0x5795,0x5796,0x5797,0x5798,0x5799, -0x579a,0x579c,0x579d,0x579e,0x579f,0x57a5,0x57a8,0x57aa, -0x57ac,0x57af,0x57b0,0x57b1,0x57b3,0x57b5,0x57b6,0x57b7, -0x57b9,0x57ba,0x57bb,0x57bc,0x57bd,0x57be,0x57bf,0x57c0, -0x57c1,0x57c4,0x57c5,0x57c6,0x57c7,0x57c8,0x57c9,0x57ca, -0x57cc,0x57cd,0x57d0,0x57d1,0x57d3,0x57d6,0x57d7,0x57db, -0x57dc,0x57de,0x57e1,0x57e2,0x57e3,0x57e5,0x57e6,0x57e7, -0x57e8,0x57e9,0x57ea,0x57eb,0x57ec,0x57ee,0x57f0,0x57f1, -0x57f2,0x57f3,0x57f5,0x57f6,0x57f7,0x57fb,0x57fc,0x57fe, -0x57ff,0x5801,0x5803,0x5804,0x5805,0x5808,0x5809,0x580a, -0x580c,0x580e,0x580f,0x5810,0x5812,0x5813,0x5814,0x5816, -0x5817,0x5818,0x581a,0x581b,0x581c,0x581d,0x581f,0x5822, -0x5823,0x5825,0x5826,0x5827,0x5828,0x5829,0x582b,0x582c, -0x582d,0x582e,0x582f,0x5831,0x5832,0x5833,0x5834,0x5836, -0x5837,0x5838,0x5839,0x583a,0x583b,0x583c,0x583d,0x0000, -/* 0x8900 */ -0x583e,0x583f,0x5840,0x5841,0x5842,0x5843,0x5845,0x5846, -0x5847,0x5848,0x5849,0x584a,0x584b,0x584e,0x584f,0x5850, -0x5852,0x5853,0x5855,0x5856,0x5857,0x5859,0x585a,0x585b, -0x585c,0x585d,0x585f,0x5860,0x5861,0x5862,0x5863,0x5864, -0x5866,0x5867,0x5868,0x5869,0x586a,0x586d,0x586e,0x586f, -0x5870,0x5871,0x5872,0x5873,0x5874,0x5875,0x5876,0x5877, -0x5878,0x5879,0x587a,0x587b,0x587c,0x587d,0x587f,0x5882, -0x5884,0x5886,0x5887,0x5888,0x588a,0x588b,0x588c,0x0000, -0x588d,0x588e,0x588f,0x5890,0x5891,0x5894,0x5895,0x5896, -0x5897,0x5898,0x589b,0x589c,0x589d,0x58a0,0x58a1,0x58a2, -0x58a3,0x58a4,0x58a5,0x58a6,0x58a7,0x58aa,0x58ab,0x58ac, -0x58ad,0x58ae,0x58af,0x58b0,0x58b1,0x58b2,0x58b3,0x58b4, -0x58b5,0x58b6,0x58b7,0x58b8,0x58b9,0x58ba,0x58bb,0x58bd, -0x58be,0x58bf,0x58c0,0x58c2,0x58c3,0x58c4,0x58c6,0x58c7, -0x58c8,0x58c9,0x58ca,0x58cb,0x58cc,0x58cd,0x58ce,0x58cf, -0x58d0,0x58d2,0x58d3,0x58d4,0x58d6,0x58d7,0x58d8,0x58d9, -0x58da,0x58db,0x58dc,0x58dd,0x58de,0x58df,0x58e0,0x58e1, -0x58e2,0x58e3,0x58e5,0x58e6,0x58e7,0x58e8,0x58e9,0x58ea, -0x58ed,0x58ef,0x58f1,0x58f2,0x58f4,0x58f5,0x58f7,0x58f8, -0x58fa,0x58fb,0x58fc,0x58fd,0x58fe,0x58ff,0x5900,0x5901, -0x5903,0x5905,0x5906,0x5908,0x5909,0x590a,0x590b,0x590c, -0x590e,0x5910,0x5911,0x5912,0x5913,0x5917,0x5918,0x591b, -0x591d,0x591e,0x5920,0x5921,0x5922,0x5923,0x5926,0x5928, -0x592c,0x5930,0x5932,0x5933,0x5935,0x5936,0x593b,0x0000, -/* 0x8a00 */ -0x593d,0x593e,0x593f,0x5940,0x5943,0x5945,0x5946,0x594a, -0x594c,0x594d,0x5950,0x5952,0x5953,0x5959,0x595b,0x595c, -0x595d,0x595e,0x595f,0x5961,0x5963,0x5964,0x5966,0x5967, -0x5968,0x5969,0x596a,0x596b,0x596c,0x596d,0x596e,0x596f, -0x5970,0x5971,0x5972,0x5975,0x5977,0x597a,0x597b,0x597c, -0x597e,0x597f,0x5980,0x5985,0x5989,0x598b,0x598c,0x598e, -0x598f,0x5990,0x5991,0x5994,0x5995,0x5998,0x599a,0x599b, -0x599c,0x599d,0x599f,0x59a0,0x59a1,0x59a2,0x59a6,0x0000, -0x59a7,0x59ac,0x59ad,0x59b0,0x59b1,0x59b3,0x59b4,0x59b5, -0x59b6,0x59b7,0x59b8,0x59ba,0x59bc,0x59bd,0x59bf,0x59c0, -0x59c1,0x59c2,0x59c3,0x59c4,0x59c5,0x59c7,0x59c8,0x59c9, -0x59cc,0x59cd,0x59ce,0x59cf,0x59d5,0x59d6,0x59d9,0x59db, -0x59de,0x59df,0x59e0,0x59e1,0x59e2,0x59e4,0x59e6,0x59e7, -0x59e9,0x59ea,0x59eb,0x59ed,0x59ee,0x59ef,0x59f0,0x59f1, -0x59f2,0x59f3,0x59f4,0x59f5,0x59f6,0x59f7,0x59f8,0x59fa, -0x59fc,0x59fd,0x59fe,0x5a00,0x5a02,0x5a0a,0x5a0b,0x5a0d, -0x5a0e,0x5a0f,0x5a10,0x5a12,0x5a14,0x5a15,0x5a16,0x5a17, -0x5a19,0x5a1a,0x5a1b,0x5a1d,0x5a1e,0x5a21,0x5a22,0x5a24, -0x5a26,0x5a27,0x5a28,0x5a2a,0x5a2b,0x5a2c,0x5a2d,0x5a2e, -0x5a2f,0x5a30,0x5a33,0x5a35,0x5a37,0x5a38,0x5a39,0x5a3a, -0x5a3b,0x5a3d,0x5a3e,0x5a3f,0x5a41,0x5a42,0x5a43,0x5a44, -0x5a45,0x5a47,0x5a48,0x5a4b,0x5a4c,0x5a4d,0x5a4e,0x5a4f, -0x5a50,0x5a51,0x5a52,0x5a53,0x5a54,0x5a56,0x5a57,0x5a58, -0x5a59,0x5a5b,0x5a5c,0x5a5d,0x5a5e,0x5a5f,0x5a60,0x0000, -/* 0x8b00 */ -0x5a61,0x5a63,0x5a64,0x5a65,0x5a66,0x5a68,0x5a69,0x5a6b, -0x5a6c,0x5a6d,0x5a6e,0x5a6f,0x5a70,0x5a71,0x5a72,0x5a73, -0x5a78,0x5a79,0x5a7b,0x5a7c,0x5a7d,0x5a7e,0x5a80,0x5a81, -0x5a82,0x5a83,0x5a84,0x5a85,0x5a86,0x5a87,0x5a88,0x5a89, -0x5a8a,0x5a8b,0x5a8c,0x5a8d,0x5a8e,0x5a8f,0x5a90,0x5a91, -0x5a93,0x5a94,0x5a95,0x5a96,0x5a97,0x5a98,0x5a99,0x5a9c, -0x5a9d,0x5a9e,0x5a9f,0x5aa0,0x5aa1,0x5aa2,0x5aa3,0x5aa4, -0x5aa5,0x5aa6,0x5aa7,0x5aa8,0x5aa9,0x5aab,0x5aac,0x0000, -0x5aad,0x5aae,0x5aaf,0x5ab0,0x5ab1,0x5ab4,0x5ab6,0x5ab7, -0x5ab9,0x5aba,0x5abb,0x5abc,0x5abd,0x5abf,0x5ac0,0x5ac3, -0x5ac4,0x5ac5,0x5ac6,0x5ac7,0x5ac8,0x5aca,0x5acb,0x5acd, -0x5ace,0x5acf,0x5ad0,0x5ad1,0x5ad3,0x5ad5,0x5ad7,0x5ad9, -0x5ada,0x5adb,0x5add,0x5ade,0x5adf,0x5ae2,0x5ae4,0x5ae5, -0x5ae7,0x5ae8,0x5aea,0x5aec,0x5aed,0x5aee,0x5aef,0x5af0, -0x5af2,0x5af3,0x5af4,0x5af5,0x5af6,0x5af7,0x5af8,0x5af9, -0x5afa,0x5afb,0x5afc,0x5afd,0x5afe,0x5aff,0x5b00,0x5b01, -0x5b02,0x5b03,0x5b04,0x5b05,0x5b06,0x5b07,0x5b08,0x5b0a, -0x5b0b,0x5b0c,0x5b0d,0x5b0e,0x5b0f,0x5b10,0x5b11,0x5b12, -0x5b13,0x5b14,0x5b15,0x5b18,0x5b19,0x5b1a,0x5b1b,0x5b1c, -0x5b1d,0x5b1e,0x5b1f,0x5b20,0x5b21,0x5b22,0x5b23,0x5b24, -0x5b25,0x5b26,0x5b27,0x5b28,0x5b29,0x5b2a,0x5b2b,0x5b2c, -0x5b2d,0x5b2e,0x5b2f,0x5b30,0x5b31,0x5b33,0x5b35,0x5b36, -0x5b38,0x5b39,0x5b3a,0x5b3b,0x5b3c,0x5b3d,0x5b3e,0x5b3f, -0x5b41,0x5b42,0x5b43,0x5b44,0x5b45,0x5b46,0x5b47,0x0000, -/* 0x8c00 */ -0x5b48,0x5b49,0x5b4a,0x5b4b,0x5b4c,0x5b4d,0x5b4e,0x5b4f, -0x5b52,0x5b56,0x5b5e,0x5b60,0x5b61,0x5b67,0x5b68,0x5b6b, -0x5b6d,0x5b6e,0x5b6f,0x5b72,0x5b74,0x5b76,0x5b77,0x5b78, -0x5b79,0x5b7b,0x5b7c,0x5b7e,0x5b7f,0x5b82,0x5b86,0x5b8a, -0x5b8d,0x5b8e,0x5b90,0x5b91,0x5b92,0x5b94,0x5b96,0x5b9f, -0x5ba7,0x5ba8,0x5ba9,0x5bac,0x5bad,0x5bae,0x5baf,0x5bb1, -0x5bb2,0x5bb7,0x5bba,0x5bbb,0x5bbc,0x5bc0,0x5bc1,0x5bc3, -0x5bc8,0x5bc9,0x5bca,0x5bcb,0x5bcd,0x5bce,0x5bcf,0x0000, -0x5bd1,0x5bd4,0x5bd5,0x5bd6,0x5bd7,0x5bd8,0x5bd9,0x5bda, -0x5bdb,0x5bdc,0x5be0,0x5be2,0x5be3,0x5be6,0x5be7,0x5be9, -0x5bea,0x5beb,0x5bec,0x5bed,0x5bef,0x5bf1,0x5bf2,0x5bf3, -0x5bf4,0x5bf5,0x5bf6,0x5bf7,0x5bfd,0x5bfe,0x5c00,0x5c02, -0x5c03,0x5c05,0x5c07,0x5c08,0x5c0b,0x5c0c,0x5c0d,0x5c0e, -0x5c10,0x5c12,0x5c13,0x5c17,0x5c19,0x5c1b,0x5c1e,0x5c1f, -0x5c20,0x5c21,0x5c23,0x5c26,0x5c28,0x5c29,0x5c2a,0x5c2b, -0x5c2d,0x5c2e,0x5c2f,0x5c30,0x5c32,0x5c33,0x5c35,0x5c36, -0x5c37,0x5c43,0x5c44,0x5c46,0x5c47,0x5c4c,0x5c4d,0x5c52, -0x5c53,0x5c54,0x5c56,0x5c57,0x5c58,0x5c5a,0x5c5b,0x5c5c, -0x5c5d,0x5c5f,0x5c62,0x5c64,0x5c67,0x5c68,0x5c69,0x5c6a, -0x5c6b,0x5c6c,0x5c6d,0x5c70,0x5c72,0x5c73,0x5c74,0x5c75, -0x5c76,0x5c77,0x5c78,0x5c7b,0x5c7c,0x5c7d,0x5c7e,0x5c80, -0x5c83,0x5c84,0x5c85,0x5c86,0x5c87,0x5c89,0x5c8a,0x5c8b, -0x5c8e,0x5c8f,0x5c92,0x5c93,0x5c95,0x5c9d,0x5c9e,0x5c9f, -0x5ca0,0x5ca1,0x5ca4,0x5ca5,0x5ca6,0x5ca7,0x5ca8,0x0000, -/* 0x8d00 */ -0x5caa,0x5cae,0x5caf,0x5cb0,0x5cb2,0x5cb4,0x5cb6,0x5cb9, -0x5cba,0x5cbb,0x5cbc,0x5cbe,0x5cc0,0x5cc2,0x5cc3,0x5cc5, -0x5cc6,0x5cc7,0x5cc8,0x5cc9,0x5cca,0x5ccc,0x5ccd,0x5cce, -0x5ccf,0x5cd0,0x5cd1,0x5cd3,0x5cd4,0x5cd5,0x5cd6,0x5cd7, -0x5cd8,0x5cda,0x5cdb,0x5cdc,0x5cdd,0x5cde,0x5cdf,0x5ce0, -0x5ce2,0x5ce3,0x5ce7,0x5ce9,0x5ceb,0x5cec,0x5cee,0x5cef, -0x5cf1,0x5cf2,0x5cf3,0x5cf4,0x5cf5,0x5cf6,0x5cf7,0x5cf8, -0x5cf9,0x5cfa,0x5cfc,0x5cfd,0x5cfe,0x5cff,0x5d00,0x0000, -0x5d01,0x5d04,0x5d05,0x5d08,0x5d09,0x5d0a,0x5d0b,0x5d0c, -0x5d0d,0x5d0f,0x5d10,0x5d11,0x5d12,0x5d13,0x5d15,0x5d17, -0x5d18,0x5d19,0x5d1a,0x5d1c,0x5d1d,0x5d1f,0x5d20,0x5d21, -0x5d22,0x5d23,0x5d25,0x5d28,0x5d2a,0x5d2b,0x5d2c,0x5d2f, -0x5d30,0x5d31,0x5d32,0x5d33,0x5d35,0x5d36,0x5d37,0x5d38, -0x5d39,0x5d3a,0x5d3b,0x5d3c,0x5d3f,0x5d40,0x5d41,0x5d42, -0x5d43,0x5d44,0x5d45,0x5d46,0x5d48,0x5d49,0x5d4d,0x5d4e, -0x5d4f,0x5d50,0x5d51,0x5d52,0x5d53,0x5d54,0x5d55,0x5d56, -0x5d57,0x5d59,0x5d5a,0x5d5c,0x5d5e,0x5d5f,0x5d60,0x5d61, -0x5d62,0x5d63,0x5d64,0x5d65,0x5d66,0x5d67,0x5d68,0x5d6a, -0x5d6d,0x5d6e,0x5d70,0x5d71,0x5d72,0x5d73,0x5d75,0x5d76, -0x5d77,0x5d78,0x5d79,0x5d7a,0x5d7b,0x5d7c,0x5d7d,0x5d7e, -0x5d7f,0x5d80,0x5d81,0x5d83,0x5d84,0x5d85,0x5d86,0x5d87, -0x5d88,0x5d89,0x5d8a,0x5d8b,0x5d8c,0x5d8d,0x5d8e,0x5d8f, -0x5d90,0x5d91,0x5d92,0x5d93,0x5d94,0x5d95,0x5d96,0x5d97, -0x5d98,0x5d9a,0x5d9b,0x5d9c,0x5d9e,0x5d9f,0x5da0,0x0000, -/* 0x8e00 */ -0x5da1,0x5da2,0x5da3,0x5da4,0x5da5,0x5da6,0x5da7,0x5da8, -0x5da9,0x5daa,0x5dab,0x5dac,0x5dad,0x5dae,0x5daf,0x5db0, -0x5db1,0x5db2,0x5db3,0x5db4,0x5db5,0x5db6,0x5db8,0x5db9, -0x5dba,0x5dbb,0x5dbc,0x5dbd,0x5dbe,0x5dbf,0x5dc0,0x5dc1, -0x5dc2,0x5dc3,0x5dc4,0x5dc6,0x5dc7,0x5dc8,0x5dc9,0x5dca, -0x5dcb,0x5dcc,0x5dce,0x5dcf,0x5dd0,0x5dd1,0x5dd2,0x5dd3, -0x5dd4,0x5dd5,0x5dd6,0x5dd7,0x5dd8,0x5dd9,0x5dda,0x5ddc, -0x5ddf,0x5de0,0x5de3,0x5de4,0x5dea,0x5dec,0x5ded,0x0000, -0x5df0,0x5df5,0x5df6,0x5df8,0x5df9,0x5dfa,0x5dfb,0x5dfc, -0x5dff,0x5e00,0x5e04,0x5e07,0x5e09,0x5e0a,0x5e0b,0x5e0d, -0x5e0e,0x5e12,0x5e13,0x5e17,0x5e1e,0x5e1f,0x5e20,0x5e21, -0x5e22,0x5e23,0x5e24,0x5e25,0x5e28,0x5e29,0x5e2a,0x5e2b, -0x5e2c,0x5e2f,0x5e30,0x5e32,0x5e33,0x5e34,0x5e35,0x5e36, -0x5e39,0x5e3a,0x5e3e,0x5e3f,0x5e40,0x5e41,0x5e43,0x5e46, -0x5e47,0x5e48,0x5e49,0x5e4a,0x5e4b,0x5e4d,0x5e4e,0x5e4f, -0x5e50,0x5e51,0x5e52,0x5e53,0x5e56,0x5e57,0x5e58,0x5e59, -0x5e5a,0x5e5c,0x5e5d,0x5e5f,0x5e60,0x5e63,0x5e64,0x5e65, -0x5e66,0x5e67,0x5e68,0x5e69,0x5e6a,0x5e6b,0x5e6c,0x5e6d, -0x5e6e,0x5e6f,0x5e70,0x5e71,0x5e75,0x5e77,0x5e79,0x5e7e, -0x5e81,0x5e82,0x5e83,0x5e85,0x5e88,0x5e89,0x5e8c,0x5e8d, -0x5e8e,0x5e92,0x5e98,0x5e9b,0x5e9d,0x5ea1,0x5ea2,0x5ea3, -0x5ea4,0x5ea8,0x5ea9,0x5eaa,0x5eab,0x5eac,0x5eae,0x5eaf, -0x5eb0,0x5eb1,0x5eb2,0x5eb4,0x5eba,0x5ebb,0x5ebc,0x5ebd, -0x5ebf,0x5ec0,0x5ec1,0x5ec2,0x5ec3,0x5ec4,0x5ec5,0x0000, -/* 0x8f00 */ -0x5ec6,0x5ec7,0x5ec8,0x5ecb,0x5ecc,0x5ecd,0x5ece,0x5ecf, -0x5ed0,0x5ed4,0x5ed5,0x5ed7,0x5ed8,0x5ed9,0x5eda,0x5edc, -0x5edd,0x5ede,0x5edf,0x5ee0,0x5ee1,0x5ee2,0x5ee3,0x5ee4, -0x5ee5,0x5ee6,0x5ee7,0x5ee9,0x5eeb,0x5eec,0x5eed,0x5eee, -0x5eef,0x5ef0,0x5ef1,0x5ef2,0x5ef3,0x5ef5,0x5ef8,0x5ef9, -0x5efb,0x5efc,0x5efd,0x5f05,0x5f06,0x5f07,0x5f09,0x5f0c, -0x5f0d,0x5f0e,0x5f10,0x5f12,0x5f14,0x5f16,0x5f19,0x5f1a, -0x5f1c,0x5f1d,0x5f1e,0x5f21,0x5f22,0x5f23,0x5f24,0x0000, -0x5f28,0x5f2b,0x5f2c,0x5f2e,0x5f30,0x5f32,0x5f33,0x5f34, -0x5f35,0x5f36,0x5f37,0x5f38,0x5f3b,0x5f3d,0x5f3e,0x5f3f, -0x5f41,0x5f42,0x5f43,0x5f44,0x5f45,0x5f46,0x5f47,0x5f48, -0x5f49,0x5f4a,0x5f4b,0x5f4c,0x5f4d,0x5f4e,0x5f4f,0x5f51, -0x5f54,0x5f59,0x5f5a,0x5f5b,0x5f5c,0x5f5e,0x5f5f,0x5f60, -0x5f63,0x5f65,0x5f67,0x5f68,0x5f6b,0x5f6e,0x5f6f,0x5f72, -0x5f74,0x5f75,0x5f76,0x5f78,0x5f7a,0x5f7d,0x5f7e,0x5f7f, -0x5f83,0x5f86,0x5f8d,0x5f8e,0x5f8f,0x5f91,0x5f93,0x5f94, -0x5f96,0x5f9a,0x5f9b,0x5f9d,0x5f9e,0x5f9f,0x5fa0,0x5fa2, -0x5fa3,0x5fa4,0x5fa5,0x5fa6,0x5fa7,0x5fa9,0x5fab,0x5fac, -0x5faf,0x5fb0,0x5fb1,0x5fb2,0x5fb3,0x5fb4,0x5fb6,0x5fb8, -0x5fb9,0x5fba,0x5fbb,0x5fbe,0x5fbf,0x5fc0,0x5fc1,0x5fc2, -0x5fc7,0x5fc8,0x5fca,0x5fcb,0x5fce,0x5fd3,0x5fd4,0x5fd5, -0x5fda,0x5fdb,0x5fdc,0x5fde,0x5fdf,0x5fe2,0x5fe3,0x5fe5, -0x5fe6,0x5fe8,0x5fe9,0x5fec,0x5fef,0x5ff0,0x5ff2,0x5ff3, -0x5ff4,0x5ff6,0x5ff7,0x5ff9,0x5ffa,0x5ffc,0x6007,0x0000, -/* 0x9000 */ -0x6008,0x6009,0x600b,0x600c,0x6010,0x6011,0x6013,0x6017, -0x6018,0x601a,0x601e,0x601f,0x6022,0x6023,0x6024,0x602c, -0x602d,0x602e,0x6030,0x6031,0x6032,0x6033,0x6034,0x6036, -0x6037,0x6038,0x6039,0x603a,0x603d,0x603e,0x6040,0x6044, -0x6045,0x6046,0x6047,0x6048,0x6049,0x604a,0x604c,0x604e, -0x604f,0x6051,0x6053,0x6054,0x6056,0x6057,0x6058,0x605b, -0x605c,0x605e,0x605f,0x6060,0x6061,0x6065,0x6066,0x606e, -0x6071,0x6072,0x6074,0x6075,0x6077,0x607e,0x6080,0x0000, -0x6081,0x6082,0x6085,0x6086,0x6087,0x6088,0x608a,0x608b, -0x608e,0x608f,0x6090,0x6091,0x6093,0x6095,0x6097,0x6098, -0x6099,0x609c,0x609e,0x60a1,0x60a2,0x60a4,0x60a5,0x60a7, -0x60a9,0x60aa,0x60ae,0x60b0,0x60b3,0x60b5,0x60b6,0x60b7, -0x60b9,0x60ba,0x60bd,0x60be,0x60bf,0x60c0,0x60c1,0x60c2, -0x60c3,0x60c4,0x60c7,0x60c8,0x60c9,0x60cc,0x60cd,0x60ce, -0x60cf,0x60d0,0x60d2,0x60d3,0x60d4,0x60d6,0x60d7,0x60d9, -0x60db,0x60de,0x60e1,0x60e2,0x60e3,0x60e4,0x60e5,0x60ea, -0x60f1,0x60f2,0x60f5,0x60f7,0x60f8,0x60fb,0x60fc,0x60fd, -0x60fe,0x60ff,0x6102,0x6103,0x6104,0x6105,0x6107,0x610a, -0x610b,0x610c,0x6110,0x6111,0x6112,0x6113,0x6114,0x6116, -0x6117,0x6118,0x6119,0x611b,0x611c,0x611d,0x611e,0x6121, -0x6122,0x6125,0x6128,0x6129,0x612a,0x612c,0x612d,0x612e, -0x612f,0x6130,0x6131,0x6132,0x6133,0x6134,0x6135,0x6136, -0x6137,0x6138,0x6139,0x613a,0x613b,0x613c,0x613d,0x613e, -0x6140,0x6141,0x6142,0x6143,0x6144,0x6145,0x6146,0x0000, -/* 0x9100 */ -0x6147,0x6149,0x614b,0x614d,0x614f,0x6150,0x6152,0x6153, -0x6154,0x6156,0x6157,0x6158,0x6159,0x615a,0x615b,0x615c, -0x615e,0x615f,0x6160,0x6161,0x6163,0x6164,0x6165,0x6166, -0x6169,0x616a,0x616b,0x616c,0x616d,0x616e,0x616f,0x6171, -0x6172,0x6173,0x6174,0x6176,0x6178,0x6179,0x617a,0x617b, -0x617c,0x617d,0x617e,0x617f,0x6180,0x6181,0x6182,0x6183, -0x6184,0x6185,0x6186,0x6187,0x6188,0x6189,0x618a,0x618c, -0x618d,0x618f,0x6190,0x6191,0x6192,0x6193,0x6195,0x0000, -0x6196,0x6197,0x6198,0x6199,0x619a,0x619b,0x619c,0x619e, -0x619f,0x61a0,0x61a1,0x61a2,0x61a3,0x61a4,0x61a5,0x61a6, -0x61aa,0x61ab,0x61ad,0x61ae,0x61af,0x61b0,0x61b1,0x61b2, -0x61b3,0x61b4,0x61b5,0x61b6,0x61b8,0x61b9,0x61ba,0x61bb, -0x61bc,0x61bd,0x61bf,0x61c0,0x61c1,0x61c3,0x61c4,0x61c5, -0x61c6,0x61c7,0x61c9,0x61cc,0x61cd,0x61ce,0x61cf,0x61d0, -0x61d3,0x61d5,0x61d6,0x61d7,0x61d8,0x61d9,0x61da,0x61db, -0x61dc,0x61dd,0x61de,0x61df,0x61e0,0x61e1,0x61e2,0x61e3, -0x61e4,0x61e5,0x61e7,0x61e8,0x61e9,0x61ea,0x61eb,0x61ec, -0x61ed,0x61ee,0x61ef,0x61f0,0x61f1,0x61f2,0x61f3,0x61f4, -0x61f6,0x61f7,0x61f8,0x61f9,0x61fa,0x61fb,0x61fc,0x61fd, -0x61fe,0x6200,0x6201,0x6202,0x6203,0x6204,0x6205,0x6207, -0x6209,0x6213,0x6214,0x6219,0x621c,0x621d,0x621e,0x6220, -0x6223,0x6226,0x6227,0x6228,0x6229,0x622b,0x622d,0x622f, -0x6230,0x6231,0x6232,0x6235,0x6236,0x6238,0x6239,0x623a, -0x623b,0x623c,0x6242,0x6244,0x6245,0x6246,0x624a,0x0000, -/* 0x9200 */ -0x624f,0x6250,0x6255,0x6256,0x6257,0x6259,0x625a,0x625c, -0x625d,0x625e,0x625f,0x6260,0x6261,0x6262,0x6264,0x6265, -0x6268,0x6271,0x6272,0x6274,0x6275,0x6277,0x6278,0x627a, -0x627b,0x627d,0x6281,0x6282,0x6283,0x6285,0x6286,0x6287, -0x6288,0x628b,0x628c,0x628d,0x628e,0x628f,0x6290,0x6294, -0x6299,0x629c,0x629d,0x629e,0x62a3,0x62a6,0x62a7,0x62a9, -0x62aa,0x62ad,0x62ae,0x62af,0x62b0,0x62b2,0x62b3,0x62b4, -0x62b6,0x62b7,0x62b8,0x62ba,0x62be,0x62c0,0x62c1,0x0000, -0x62c3,0x62cb,0x62cf,0x62d1,0x62d5,0x62dd,0x62de,0x62e0, -0x62e1,0x62e4,0x62ea,0x62eb,0x62f0,0x62f2,0x62f5,0x62f8, -0x62f9,0x62fa,0x62fb,0x6300,0x6303,0x6304,0x6305,0x6306, -0x630a,0x630b,0x630c,0x630d,0x630f,0x6310,0x6312,0x6313, -0x6314,0x6315,0x6317,0x6318,0x6319,0x631c,0x6326,0x6327, -0x6329,0x632c,0x632d,0x632e,0x6330,0x6331,0x6333,0x6334, -0x6335,0x6336,0x6337,0x6338,0x633b,0x633c,0x633e,0x633f, -0x6340,0x6341,0x6344,0x6347,0x6348,0x634a,0x6351,0x6352, -0x6353,0x6354,0x6356,0x6357,0x6358,0x6359,0x635a,0x635b, -0x635c,0x635d,0x6360,0x6364,0x6365,0x6366,0x6368,0x636a, -0x636b,0x636c,0x636f,0x6370,0x6372,0x6373,0x6374,0x6375, -0x6378,0x6379,0x637c,0x637d,0x637e,0x637f,0x6381,0x6383, -0x6384,0x6385,0x6386,0x638b,0x638d,0x6391,0x6393,0x6394, -0x6395,0x6397,0x6399,0x639a,0x639b,0x639c,0x639d,0x639e, -0x639f,0x63a1,0x63a4,0x63a6,0x63ab,0x63af,0x63b1,0x63b2, -0x63b5,0x63b6,0x63b9,0x63bb,0x63bd,0x63bf,0x63c0,0x0000, -/* 0x9300 */ -0x63c1,0x63c2,0x63c3,0x63c5,0x63c7,0x63c8,0x63ca,0x63cb, -0x63cc,0x63d1,0x63d3,0x63d4,0x63d5,0x63d7,0x63d8,0x63d9, -0x63da,0x63db,0x63dc,0x63dd,0x63df,0x63e2,0x63e4,0x63e5, -0x63e6,0x63e7,0x63e8,0x63eb,0x63ec,0x63ee,0x63ef,0x63f0, -0x63f1,0x63f3,0x63f5,0x63f7,0x63f9,0x63fa,0x63fb,0x63fc, -0x63fe,0x6403,0x6404,0x6406,0x6407,0x6408,0x6409,0x640a, -0x640d,0x640e,0x6411,0x6412,0x6415,0x6416,0x6417,0x6418, -0x6419,0x641a,0x641d,0x641f,0x6422,0x6423,0x6424,0x0000, -0x6425,0x6427,0x6428,0x6429,0x642b,0x642e,0x642f,0x6430, -0x6431,0x6432,0x6433,0x6435,0x6436,0x6437,0x6438,0x6439, -0x643b,0x643c,0x643e,0x6440,0x6442,0x6443,0x6449,0x644b, -0x644c,0x644d,0x644e,0x644f,0x6450,0x6451,0x6453,0x6455, -0x6456,0x6457,0x6459,0x645a,0x645b,0x645c,0x645d,0x645f, -0x6460,0x6461,0x6462,0x6463,0x6464,0x6465,0x6466,0x6468, -0x646a,0x646b,0x646c,0x646e,0x646f,0x6470,0x6471,0x6472, -0x6473,0x6474,0x6475,0x6476,0x6477,0x647b,0x647c,0x647d, -0x647e,0x647f,0x6480,0x6481,0x6483,0x6486,0x6488,0x6489, -0x648a,0x648b,0x648c,0x648d,0x648e,0x648f,0x6490,0x6493, -0x6494,0x6497,0x6498,0x649a,0x649b,0x649c,0x649d,0x649f, -0x64a0,0x64a1,0x64a2,0x64a3,0x64a5,0x64a6,0x64a7,0x64a8, -0x64aa,0x64ab,0x64af,0x64b1,0x64b2,0x64b3,0x64b4,0x64b6, -0x64b9,0x64bb,0x64bd,0x64be,0x64bf,0x64c1,0x64c3,0x64c4, -0x64c6,0x64c7,0x64c8,0x64c9,0x64ca,0x64cb,0x64cc,0x64cf, -0x64d1,0x64d3,0x64d4,0x64d5,0x64d6,0x64d9,0x64da,0x0000, -/* 0x9400 */ -0x64db,0x64dc,0x64dd,0x64df,0x64e0,0x64e1,0x64e3,0x64e5, -0x64e7,0x64e8,0x64e9,0x64ea,0x64eb,0x64ec,0x64ed,0x64ee, -0x64ef,0x64f0,0x64f1,0x64f2,0x64f3,0x64f4,0x64f5,0x64f6, -0x64f7,0x64f8,0x64f9,0x64fa,0x64fb,0x64fc,0x64fd,0x64fe, -0x64ff,0x6501,0x6502,0x6503,0x6504,0x6505,0x6506,0x6507, -0x6508,0x650a,0x650b,0x650c,0x650d,0x650e,0x650f,0x6510, -0x6511,0x6513,0x6514,0x6515,0x6516,0x6517,0x6519,0x651a, -0x651b,0x651c,0x651d,0x651e,0x651f,0x6520,0x6521,0x0000, -0x6522,0x6523,0x6524,0x6526,0x6527,0x6528,0x6529,0x652a, -0x652c,0x652d,0x6530,0x6531,0x6532,0x6533,0x6537,0x653a, -0x653c,0x653d,0x6540,0x6541,0x6542,0x6543,0x6544,0x6546, -0x6547,0x654a,0x654b,0x654d,0x654e,0x6550,0x6552,0x6553, -0x6554,0x6557,0x6558,0x655a,0x655c,0x655f,0x6560,0x6561, -0x6564,0x6565,0x6567,0x6568,0x6569,0x656a,0x656d,0x656e, -0x656f,0x6571,0x6573,0x6575,0x6576,0x6578,0x6579,0x657a, -0x657b,0x657c,0x657d,0x657e,0x657f,0x6580,0x6581,0x6582, -0x6583,0x6584,0x6585,0x6586,0x6588,0x6589,0x658a,0x658d, -0x658e,0x658f,0x6592,0x6594,0x6595,0x6596,0x6598,0x659a, -0x659d,0x659e,0x65a0,0x65a2,0x65a3,0x65a6,0x65a8,0x65aa, -0x65ac,0x65ae,0x65b1,0x65b2,0x65b3,0x65b4,0x65b5,0x65b6, -0x65b7,0x65b8,0x65ba,0x65bb,0x65be,0x65bf,0x65c0,0x65c2, -0x65c7,0x65c8,0x65c9,0x65ca,0x65cd,0x65d0,0x65d1,0x65d3, -0x65d4,0x65d5,0x65d8,0x65d9,0x65da,0x65db,0x65dc,0x65dd, -0x65de,0x65df,0x65e1,0x65e3,0x65e4,0x65ea,0x65eb,0x0000, -/* 0x9500 */ -0x65f2,0x65f3,0x65f4,0x65f5,0x65f8,0x65f9,0x65fb,0x65fc, -0x65fd,0x65fe,0x65ff,0x6601,0x6604,0x6605,0x6607,0x6608, -0x6609,0x660b,0x660d,0x6610,0x6611,0x6612,0x6616,0x6617, -0x6618,0x661a,0x661b,0x661c,0x661e,0x6621,0x6622,0x6623, -0x6624,0x6626,0x6629,0x662a,0x662b,0x662c,0x662e,0x6630, -0x6632,0x6633,0x6637,0x6638,0x6639,0x663a,0x663b,0x663d, -0x663f,0x6640,0x6642,0x6644,0x6645,0x6646,0x6647,0x6648, -0x6649,0x664a,0x664d,0x664e,0x6650,0x6651,0x6658,0x0000, -0x6659,0x665b,0x665c,0x665d,0x665e,0x6660,0x6662,0x6663, -0x6665,0x6667,0x6669,0x666a,0x666b,0x666c,0x666d,0x6671, -0x6672,0x6673,0x6675,0x6678,0x6679,0x667b,0x667c,0x667d, -0x667f,0x6680,0x6681,0x6683,0x6685,0x6686,0x6688,0x6689, -0x668a,0x668b,0x668d,0x668e,0x668f,0x6690,0x6692,0x6693, -0x6694,0x6695,0x6698,0x6699,0x669a,0x669b,0x669c,0x669e, -0x669f,0x66a0,0x66a1,0x66a2,0x66a3,0x66a4,0x66a5,0x66a6, -0x66a9,0x66aa,0x66ab,0x66ac,0x66ad,0x66af,0x66b0,0x66b1, -0x66b2,0x66b3,0x66b5,0x66b6,0x66b7,0x66b8,0x66ba,0x66bb, -0x66bc,0x66bd,0x66bf,0x66c0,0x66c1,0x66c2,0x66c3,0x66c4, -0x66c5,0x66c6,0x66c7,0x66c8,0x66c9,0x66ca,0x66cb,0x66cc, -0x66cd,0x66ce,0x66cf,0x66d0,0x66d1,0x66d2,0x66d3,0x66d4, -0x66d5,0x66d6,0x66d7,0x66d8,0x66da,0x66de,0x66df,0x66e0, -0x66e1,0x66e2,0x66e3,0x66e4,0x66e5,0x66e7,0x66e8,0x66ea, -0x66eb,0x66ec,0x66ed,0x66ee,0x66ef,0x66f1,0x66f5,0x66f6, -0x66f8,0x66fa,0x66fb,0x66fd,0x6701,0x6702,0x6703,0x0000, -/* 0x9600 */ -0x6704,0x6705,0x6706,0x6707,0x670c,0x670e,0x670f,0x6711, -0x6712,0x6713,0x6716,0x6718,0x6719,0x671a,0x671c,0x671e, -0x6720,0x6721,0x6722,0x6723,0x6724,0x6725,0x6727,0x6729, -0x672e,0x6730,0x6732,0x6733,0x6736,0x6737,0x6738,0x6739, -0x673b,0x673c,0x673e,0x673f,0x6741,0x6744,0x6745,0x6747, -0x674a,0x674b,0x674d,0x6752,0x6754,0x6755,0x6757,0x6758, -0x6759,0x675a,0x675b,0x675d,0x6762,0x6763,0x6764,0x6766, -0x6767,0x676b,0x676c,0x676e,0x6771,0x6774,0x6776,0x0000, -0x6778,0x6779,0x677a,0x677b,0x677d,0x6780,0x6782,0x6783, -0x6785,0x6786,0x6788,0x678a,0x678c,0x678d,0x678e,0x678f, -0x6791,0x6792,0x6793,0x6794,0x6796,0x6799,0x679b,0x679f, -0x67a0,0x67a1,0x67a4,0x67a6,0x67a9,0x67ac,0x67ae,0x67b1, -0x67b2,0x67b4,0x67b9,0x67ba,0x67bb,0x67bc,0x67bd,0x67be, -0x67bf,0x67c0,0x67c2,0x67c5,0x67c6,0x67c7,0x67c8,0x67c9, -0x67ca,0x67cb,0x67cc,0x67cd,0x67ce,0x67d5,0x67d6,0x67d7, -0x67db,0x67df,0x67e1,0x67e3,0x67e4,0x67e6,0x67e7,0x67e8, -0x67ea,0x67eb,0x67ed,0x67ee,0x67f2,0x67f5,0x67f6,0x67f7, -0x67f8,0x67f9,0x67fa,0x67fb,0x67fc,0x67fe,0x6801,0x6802, -0x6803,0x6804,0x6806,0x680d,0x6810,0x6812,0x6814,0x6815, -0x6818,0x6819,0x681a,0x681b,0x681c,0x681e,0x681f,0x6820, -0x6822,0x6823,0x6824,0x6825,0x6826,0x6827,0x6828,0x682b, -0x682c,0x682d,0x682e,0x682f,0x6830,0x6831,0x6834,0x6835, -0x6836,0x683a,0x683b,0x683f,0x6847,0x684b,0x684d,0x684f, -0x6852,0x6856,0x6857,0x6858,0x6859,0x685a,0x685b,0x0000, -/* 0x9700 */ -0x685c,0x685d,0x685e,0x685f,0x686a,0x686c,0x686d,0x686e, -0x686f,0x6870,0x6871,0x6872,0x6873,0x6875,0x6878,0x6879, -0x687a,0x687b,0x687c,0x687d,0x687e,0x687f,0x6880,0x6882, -0x6884,0x6887,0x6888,0x6889,0x688a,0x688b,0x688c,0x688d, -0x688e,0x6890,0x6891,0x6892,0x6894,0x6895,0x6896,0x6898, -0x6899,0x689a,0x689b,0x689c,0x689d,0x689e,0x689f,0x68a0, -0x68a1,0x68a3,0x68a4,0x68a5,0x68a9,0x68aa,0x68ab,0x68ac, -0x68ae,0x68b1,0x68b2,0x68b4,0x68b6,0x68b7,0x68b8,0x0000, -0x68b9,0x68ba,0x68bb,0x68bc,0x68bd,0x68be,0x68bf,0x68c1, -0x68c3,0x68c4,0x68c5,0x68c6,0x68c7,0x68c8,0x68ca,0x68cc, -0x68ce,0x68cf,0x68d0,0x68d1,0x68d3,0x68d4,0x68d6,0x68d7, -0x68d9,0x68db,0x68dc,0x68dd,0x68de,0x68df,0x68e1,0x68e2, -0x68e4,0x68e5,0x68e6,0x68e7,0x68e8,0x68e9,0x68ea,0x68eb, -0x68ec,0x68ed,0x68ef,0x68f2,0x68f3,0x68f4,0x68f6,0x68f7, -0x68f8,0x68fb,0x68fd,0x68fe,0x68ff,0x6900,0x6902,0x6903, -0x6904,0x6906,0x6907,0x6908,0x6909,0x690a,0x690c,0x690f, -0x6911,0x6913,0x6914,0x6915,0x6916,0x6917,0x6918,0x6919, -0x691a,0x691b,0x691c,0x691d,0x691e,0x6921,0x6922,0x6923, -0x6925,0x6926,0x6927,0x6928,0x6929,0x692a,0x692b,0x692c, -0x692e,0x692f,0x6931,0x6932,0x6933,0x6935,0x6936,0x6937, -0x6938,0x693a,0x693b,0x693c,0x693e,0x6940,0x6941,0x6943, -0x6944,0x6945,0x6946,0x6947,0x6948,0x6949,0x694a,0x694b, -0x694c,0x694d,0x694e,0x694f,0x6950,0x6951,0x6952,0x6953, -0x6955,0x6956,0x6958,0x6959,0x695b,0x695c,0x695f,0x0000, -/* 0x9800 */ -0x6961,0x6962,0x6964,0x6965,0x6967,0x6968,0x6969,0x696a, -0x696c,0x696d,0x696f,0x6970,0x6972,0x6973,0x6974,0x6975, -0x6976,0x697a,0x697b,0x697d,0x697e,0x697f,0x6981,0x6983, -0x6985,0x698a,0x698b,0x698c,0x698e,0x698f,0x6990,0x6991, -0x6992,0x6993,0x6996,0x6997,0x6999,0x699a,0x699d,0x699e, -0x699f,0x69a0,0x69a1,0x69a2,0x69a3,0x69a4,0x69a5,0x69a6, -0x69a9,0x69aa,0x69ac,0x69ae,0x69af,0x69b0,0x69b2,0x69b3, -0x69b5,0x69b6,0x69b8,0x69b9,0x69ba,0x69bc,0x69bd,0x0000, -0x69be,0x69bf,0x69c0,0x69c2,0x69c3,0x69c4,0x69c5,0x69c6, -0x69c7,0x69c8,0x69c9,0x69cb,0x69cd,0x69cf,0x69d1,0x69d2, -0x69d3,0x69d5,0x69d6,0x69d7,0x69d8,0x69d9,0x69da,0x69dc, -0x69dd,0x69de,0x69e1,0x69e2,0x69e3,0x69e4,0x69e5,0x69e6, -0x69e7,0x69e8,0x69e9,0x69ea,0x69eb,0x69ec,0x69ee,0x69ef, -0x69f0,0x69f1,0x69f3,0x69f4,0x69f5,0x69f6,0x69f7,0x69f8, -0x69f9,0x69fa,0x69fb,0x69fc,0x69fe,0x6a00,0x6a01,0x6a02, -0x6a03,0x6a04,0x6a05,0x6a06,0x6a07,0x6a08,0x6a09,0x6a0b, -0x6a0c,0x6a0d,0x6a0e,0x6a0f,0x6a10,0x6a11,0x6a12,0x6a13, -0x6a14,0x6a15,0x6a16,0x6a19,0x6a1a,0x6a1b,0x6a1c,0x6a1d, -0x6a1e,0x6a20,0x6a22,0x6a23,0x6a24,0x6a25,0x6a26,0x6a27, -0x6a29,0x6a2b,0x6a2c,0x6a2d,0x6a2e,0x6a30,0x6a32,0x6a33, -0x6a34,0x6a36,0x6a37,0x6a38,0x6a39,0x6a3a,0x6a3b,0x6a3c, -0x6a3f,0x6a40,0x6a41,0x6a42,0x6a43,0x6a45,0x6a46,0x6a48, -0x6a49,0x6a4a,0x6a4b,0x6a4c,0x6a4d,0x6a4e,0x6a4f,0x6a51, -0x6a52,0x6a53,0x6a54,0x6a55,0x6a56,0x6a57,0x6a5a,0x0000, -/* 0x9900 */ -0x6a5c,0x6a5d,0x6a5e,0x6a5f,0x6a60,0x6a62,0x6a63,0x6a64, -0x6a66,0x6a67,0x6a68,0x6a69,0x6a6a,0x6a6b,0x6a6c,0x6a6d, -0x6a6e,0x6a6f,0x6a70,0x6a72,0x6a73,0x6a74,0x6a75,0x6a76, -0x6a77,0x6a78,0x6a7a,0x6a7b,0x6a7d,0x6a7e,0x6a7f,0x6a81, -0x6a82,0x6a83,0x6a85,0x6a86,0x6a87,0x6a88,0x6a89,0x6a8a, -0x6a8b,0x6a8c,0x6a8d,0x6a8f,0x6a92,0x6a93,0x6a94,0x6a95, -0x6a96,0x6a98,0x6a99,0x6a9a,0x6a9b,0x6a9c,0x6a9d,0x6a9e, -0x6a9f,0x6aa1,0x6aa2,0x6aa3,0x6aa4,0x6aa5,0x6aa6,0x0000, -0x6aa7,0x6aa8,0x6aaa,0x6aad,0x6aae,0x6aaf,0x6ab0,0x6ab1, -0x6ab2,0x6ab3,0x6ab4,0x6ab5,0x6ab6,0x6ab7,0x6ab8,0x6ab9, -0x6aba,0x6abb,0x6abc,0x6abd,0x6abe,0x6abf,0x6ac0,0x6ac1, -0x6ac2,0x6ac3,0x6ac4,0x6ac5,0x6ac6,0x6ac7,0x6ac8,0x6ac9, -0x6aca,0x6acb,0x6acc,0x6acd,0x6ace,0x6acf,0x6ad0,0x6ad1, -0x6ad2,0x6ad3,0x6ad4,0x6ad5,0x6ad6,0x6ad7,0x6ad8,0x6ad9, -0x6ada,0x6adb,0x6adc,0x6add,0x6ade,0x6adf,0x6ae0,0x6ae1, -0x6ae2,0x6ae3,0x6ae4,0x6ae5,0x6ae6,0x6ae7,0x6ae8,0x6ae9, -0x6aea,0x6aeb,0x6aec,0x6aed,0x6aee,0x6aef,0x6af0,0x6af1, -0x6af2,0x6af3,0x6af4,0x6af5,0x6af6,0x6af7,0x6af8,0x6af9, -0x6afa,0x6afb,0x6afc,0x6afd,0x6afe,0x6aff,0x6b00,0x6b01, -0x6b02,0x6b03,0x6b04,0x6b05,0x6b06,0x6b07,0x6b08,0x6b09, -0x6b0a,0x6b0b,0x6b0c,0x6b0d,0x6b0e,0x6b0f,0x6b10,0x6b11, -0x6b12,0x6b13,0x6b14,0x6b15,0x6b16,0x6b17,0x6b18,0x6b19, -0x6b1a,0x6b1b,0x6b1c,0x6b1d,0x6b1e,0x6b1f,0x6b25,0x6b26, -0x6b28,0x6b29,0x6b2a,0x6b2b,0x6b2c,0x6b2d,0x6b2e,0x0000, -/* 0x9a00 */ -0x6b2f,0x6b30,0x6b31,0x6b33,0x6b34,0x6b35,0x6b36,0x6b38, -0x6b3b,0x6b3c,0x6b3d,0x6b3f,0x6b40,0x6b41,0x6b42,0x6b44, -0x6b45,0x6b48,0x6b4a,0x6b4b,0x6b4d,0x6b4e,0x6b4f,0x6b50, -0x6b51,0x6b52,0x6b53,0x6b54,0x6b55,0x6b56,0x6b57,0x6b58, -0x6b5a,0x6b5b,0x6b5c,0x6b5d,0x6b5e,0x6b5f,0x6b60,0x6b61, -0x6b68,0x6b69,0x6b6b,0x6b6c,0x6b6d,0x6b6e,0x6b6f,0x6b70, -0x6b71,0x6b72,0x6b73,0x6b74,0x6b75,0x6b76,0x6b77,0x6b78, -0x6b7a,0x6b7d,0x6b7e,0x6b7f,0x6b80,0x6b85,0x6b88,0x0000, -0x6b8c,0x6b8e,0x6b8f,0x6b90,0x6b91,0x6b94,0x6b95,0x6b97, -0x6b98,0x6b99,0x6b9c,0x6b9d,0x6b9e,0x6b9f,0x6ba0,0x6ba2, -0x6ba3,0x6ba4,0x6ba5,0x6ba6,0x6ba7,0x6ba8,0x6ba9,0x6bab, -0x6bac,0x6bad,0x6bae,0x6baf,0x6bb0,0x6bb1,0x6bb2,0x6bb6, -0x6bb8,0x6bb9,0x6bba,0x6bbb,0x6bbc,0x6bbd,0x6bbe,0x6bc0, -0x6bc3,0x6bc4,0x6bc6,0x6bc7,0x6bc8,0x6bc9,0x6bca,0x6bcc, -0x6bce,0x6bd0,0x6bd1,0x6bd8,0x6bda,0x6bdc,0x6bdd,0x6bde, -0x6bdf,0x6be0,0x6be2,0x6be3,0x6be4,0x6be5,0x6be6,0x6be7, -0x6be8,0x6be9,0x6bec,0x6bed,0x6bee,0x6bf0,0x6bf1,0x6bf2, -0x6bf4,0x6bf6,0x6bf7,0x6bf8,0x6bfa,0x6bfb,0x6bfc,0x6bfe, -0x6bff,0x6c00,0x6c01,0x6c02,0x6c03,0x6c04,0x6c08,0x6c09, -0x6c0a,0x6c0b,0x6c0c,0x6c0e,0x6c12,0x6c17,0x6c1c,0x6c1d, -0x6c1e,0x6c20,0x6c23,0x6c25,0x6c2b,0x6c2c,0x6c2d,0x6c31, -0x6c33,0x6c36,0x6c37,0x6c39,0x6c3a,0x6c3b,0x6c3c,0x6c3e, -0x6c3f,0x6c43,0x6c44,0x6c45,0x6c48,0x6c4b,0x6c4c,0x6c4d, -0x6c4e,0x6c4f,0x6c51,0x6c52,0x6c53,0x6c56,0x6c58,0x0000, -/* 0x9b00 */ -0x6c59,0x6c5a,0x6c62,0x6c63,0x6c65,0x6c66,0x6c67,0x6c6b, -0x6c6c,0x6c6d,0x6c6e,0x6c6f,0x6c71,0x6c73,0x6c75,0x6c77, -0x6c78,0x6c7a,0x6c7b,0x6c7c,0x6c7f,0x6c80,0x6c84,0x6c87, -0x6c8a,0x6c8b,0x6c8d,0x6c8e,0x6c91,0x6c92,0x6c95,0x6c96, -0x6c97,0x6c98,0x6c9a,0x6c9c,0x6c9d,0x6c9e,0x6ca0,0x6ca2, -0x6ca8,0x6cac,0x6caf,0x6cb0,0x6cb4,0x6cb5,0x6cb6,0x6cb7, -0x6cba,0x6cc0,0x6cc1,0x6cc2,0x6cc3,0x6cc6,0x6cc7,0x6cc8, -0x6ccb,0x6ccd,0x6cce,0x6ccf,0x6cd1,0x6cd2,0x6cd8,0x0000, -0x6cd9,0x6cda,0x6cdc,0x6cdd,0x6cdf,0x6ce4,0x6ce6,0x6ce7, -0x6ce9,0x6cec,0x6ced,0x6cf2,0x6cf4,0x6cf9,0x6cff,0x6d00, -0x6d02,0x6d03,0x6d05,0x6d06,0x6d08,0x6d09,0x6d0a,0x6d0d, -0x6d0f,0x6d10,0x6d11,0x6d13,0x6d14,0x6d15,0x6d16,0x6d18, -0x6d1c,0x6d1d,0x6d1f,0x6d20,0x6d21,0x6d22,0x6d23,0x6d24, -0x6d26,0x6d28,0x6d29,0x6d2c,0x6d2d,0x6d2f,0x6d30,0x6d34, -0x6d36,0x6d37,0x6d38,0x6d3a,0x6d3f,0x6d40,0x6d42,0x6d44, -0x6d49,0x6d4c,0x6d50,0x6d55,0x6d56,0x6d57,0x6d58,0x6d5b, -0x6d5d,0x6d5f,0x6d61,0x6d62,0x6d64,0x6d65,0x6d67,0x6d68, -0x6d6b,0x6d6c,0x6d6d,0x6d70,0x6d71,0x6d72,0x6d73,0x6d75, -0x6d76,0x6d79,0x6d7a,0x6d7b,0x6d7d,0x6d7e,0x6d7f,0x6d80, -0x6d81,0x6d83,0x6d84,0x6d86,0x6d87,0x6d8a,0x6d8b,0x6d8d, -0x6d8f,0x6d90,0x6d92,0x6d96,0x6d97,0x6d98,0x6d99,0x6d9a, -0x6d9c,0x6da2,0x6da5,0x6dac,0x6dad,0x6db0,0x6db1,0x6db3, -0x6db4,0x6db6,0x6db7,0x6db9,0x6dba,0x6dbb,0x6dbc,0x6dbd, -0x6dbe,0x6dc1,0x6dc2,0x6dc3,0x6dc8,0x6dc9,0x6dca,0x0000, -/* 0x9c00 */ -0x6dcd,0x6dce,0x6dcf,0x6dd0,0x6dd2,0x6dd3,0x6dd4,0x6dd5, -0x6dd7,0x6dda,0x6ddb,0x6ddc,0x6ddf,0x6de2,0x6de3,0x6de5, -0x6de7,0x6de8,0x6de9,0x6dea,0x6ded,0x6def,0x6df0,0x6df2, -0x6df4,0x6df5,0x6df6,0x6df8,0x6dfa,0x6dfd,0x6dfe,0x6dff, -0x6e00,0x6e01,0x6e02,0x6e03,0x6e04,0x6e06,0x6e07,0x6e08, -0x6e09,0x6e0b,0x6e0f,0x6e12,0x6e13,0x6e15,0x6e18,0x6e19, -0x6e1b,0x6e1c,0x6e1e,0x6e1f,0x6e22,0x6e26,0x6e27,0x6e28, -0x6e2a,0x6e2c,0x6e2e,0x6e30,0x6e31,0x6e33,0x6e35,0x0000, -0x6e36,0x6e37,0x6e39,0x6e3b,0x6e3c,0x6e3d,0x6e3e,0x6e3f, -0x6e40,0x6e41,0x6e42,0x6e45,0x6e46,0x6e47,0x6e48,0x6e49, -0x6e4a,0x6e4b,0x6e4c,0x6e4f,0x6e50,0x6e51,0x6e52,0x6e55, -0x6e57,0x6e59,0x6e5a,0x6e5c,0x6e5d,0x6e5e,0x6e60,0x6e61, -0x6e62,0x6e63,0x6e64,0x6e65,0x6e66,0x6e67,0x6e68,0x6e69, -0x6e6a,0x6e6c,0x6e6d,0x6e6f,0x6e70,0x6e71,0x6e72,0x6e73, -0x6e74,0x6e75,0x6e76,0x6e77,0x6e78,0x6e79,0x6e7a,0x6e7b, -0x6e7c,0x6e7d,0x6e80,0x6e81,0x6e82,0x6e84,0x6e87,0x6e88, -0x6e8a,0x6e8b,0x6e8c,0x6e8d,0x6e8e,0x6e91,0x6e92,0x6e93, -0x6e94,0x6e95,0x6e96,0x6e97,0x6e99,0x6e9a,0x6e9b,0x6e9d, -0x6e9e,0x6ea0,0x6ea1,0x6ea3,0x6ea4,0x6ea6,0x6ea8,0x6ea9, -0x6eab,0x6eac,0x6ead,0x6eae,0x6eb0,0x6eb3,0x6eb5,0x6eb8, -0x6eb9,0x6ebc,0x6ebe,0x6ebf,0x6ec0,0x6ec3,0x6ec4,0x6ec5, -0x6ec6,0x6ec8,0x6ec9,0x6eca,0x6ecc,0x6ecd,0x6ece,0x6ed0, -0x6ed2,0x6ed6,0x6ed8,0x6ed9,0x6edb,0x6edc,0x6edd,0x6ee3, -0x6ee7,0x6eea,0x6eeb,0x6eec,0x6eed,0x6eee,0x6eef,0x0000, -/* 0x9d00 */ -0x6ef0,0x6ef1,0x6ef2,0x6ef3,0x6ef5,0x6ef6,0x6ef7,0x6ef8, -0x6efa,0x6efb,0x6efc,0x6efd,0x6efe,0x6eff,0x6f00,0x6f01, -0x6f03,0x6f04,0x6f05,0x6f07,0x6f08,0x6f0a,0x6f0b,0x6f0c, -0x6f0d,0x6f0e,0x6f10,0x6f11,0x6f12,0x6f16,0x6f17,0x6f18, -0x6f19,0x6f1a,0x6f1b,0x6f1c,0x6f1d,0x6f1e,0x6f1f,0x6f21, -0x6f22,0x6f23,0x6f25,0x6f26,0x6f27,0x6f28,0x6f2c,0x6f2e, -0x6f30,0x6f32,0x6f34,0x6f35,0x6f37,0x6f38,0x6f39,0x6f3a, -0x6f3b,0x6f3c,0x6f3d,0x6f3f,0x6f40,0x6f41,0x6f42,0x0000, -0x6f43,0x6f44,0x6f45,0x6f48,0x6f49,0x6f4a,0x6f4c,0x6f4e, -0x6f4f,0x6f50,0x6f51,0x6f52,0x6f53,0x6f54,0x6f55,0x6f56, -0x6f57,0x6f59,0x6f5a,0x6f5b,0x6f5d,0x6f5f,0x6f60,0x6f61, -0x6f63,0x6f64,0x6f65,0x6f67,0x6f68,0x6f69,0x6f6a,0x6f6b, -0x6f6c,0x6f6f,0x6f70,0x6f71,0x6f73,0x6f75,0x6f76,0x6f77, -0x6f79,0x6f7b,0x6f7d,0x6f7e,0x6f7f,0x6f80,0x6f81,0x6f82, -0x6f83,0x6f85,0x6f86,0x6f87,0x6f8a,0x6f8b,0x6f8f,0x6f90, -0x6f91,0x6f92,0x6f93,0x6f94,0x6f95,0x6f96,0x6f97,0x6f98, -0x6f99,0x6f9a,0x6f9b,0x6f9d,0x6f9e,0x6f9f,0x6fa0,0x6fa2, -0x6fa3,0x6fa4,0x6fa5,0x6fa6,0x6fa8,0x6fa9,0x6faa,0x6fab, -0x6fac,0x6fad,0x6fae,0x6faf,0x6fb0,0x6fb1,0x6fb2,0x6fb4, -0x6fb5,0x6fb7,0x6fb8,0x6fba,0x6fbb,0x6fbc,0x6fbd,0x6fbe, -0x6fbf,0x6fc1,0x6fc3,0x6fc4,0x6fc5,0x6fc6,0x6fc7,0x6fc8, -0x6fca,0x6fcb,0x6fcc,0x6fcd,0x6fce,0x6fcf,0x6fd0,0x6fd3, -0x6fd4,0x6fd5,0x6fd6,0x6fd7,0x6fd8,0x6fd9,0x6fda,0x6fdb, -0x6fdc,0x6fdd,0x6fdf,0x6fe2,0x6fe3,0x6fe4,0x6fe5,0x0000, -/* 0x9e00 */ -0x6fe6,0x6fe7,0x6fe8,0x6fe9,0x6fea,0x6feb,0x6fec,0x6fed, -0x6ff0,0x6ff1,0x6ff2,0x6ff3,0x6ff4,0x6ff5,0x6ff6,0x6ff7, -0x6ff8,0x6ff9,0x6ffa,0x6ffb,0x6ffc,0x6ffd,0x6ffe,0x6fff, -0x7000,0x7001,0x7002,0x7003,0x7004,0x7005,0x7006,0x7007, -0x7008,0x7009,0x700a,0x700b,0x700c,0x700d,0x700e,0x700f, -0x7010,0x7012,0x7013,0x7014,0x7015,0x7016,0x7017,0x7018, -0x7019,0x701c,0x701d,0x701e,0x701f,0x7020,0x7021,0x7022, -0x7024,0x7025,0x7026,0x7027,0x7028,0x7029,0x702a,0x0000, -0x702b,0x702c,0x702d,0x702e,0x702f,0x7030,0x7031,0x7032, -0x7033,0x7034,0x7036,0x7037,0x7038,0x703a,0x703b,0x703c, -0x703d,0x703e,0x703f,0x7040,0x7041,0x7042,0x7043,0x7044, -0x7045,0x7046,0x7047,0x7048,0x7049,0x704a,0x704b,0x704d, -0x704e,0x7050,0x7051,0x7052,0x7053,0x7054,0x7055,0x7056, -0x7057,0x7058,0x7059,0x705a,0x705b,0x705c,0x705d,0x705f, -0x7060,0x7061,0x7062,0x7063,0x7064,0x7065,0x7066,0x7067, -0x7068,0x7069,0x706a,0x706e,0x7071,0x7072,0x7073,0x7074, -0x7077,0x7079,0x707a,0x707b,0x707d,0x7081,0x7082,0x7083, -0x7084,0x7086,0x7087,0x7088,0x708b,0x708c,0x708d,0x708f, -0x7090,0x7091,0x7093,0x7097,0x7098,0x709a,0x709b,0x709e, -0x709f,0x70a0,0x70a1,0x70a2,0x70a3,0x70a4,0x70a5,0x70a6, -0x70a7,0x70a8,0x70a9,0x70aa,0x70b0,0x70b2,0x70b4,0x70b5, -0x70b6,0x70ba,0x70be,0x70bf,0x70c4,0x70c5,0x70c6,0x70c7, -0x70c9,0x70cb,0x70cc,0x70cd,0x70ce,0x70cf,0x70d0,0x70d1, -0x70d2,0x70d3,0x70d4,0x70d5,0x70d6,0x70d7,0x70da,0x0000, -/* 0x9f00 */ -0x70dc,0x70dd,0x70de,0x70e0,0x70e1,0x70e2,0x70e3,0x70e5, -0x70ea,0x70ee,0x70f0,0x70f1,0x70f2,0x70f3,0x70f4,0x70f5, -0x70f6,0x70f8,0x70fa,0x70fb,0x70fc,0x70fe,0x70ff,0x7100, -0x7101,0x7102,0x7103,0x7104,0x7105,0x7106,0x7107,0x7108, -0x710b,0x710c,0x710d,0x710e,0x710f,0x7111,0x7112,0x7114, -0x7117,0x711b,0x711c,0x711d,0x711e,0x711f,0x7120,0x7121, -0x7122,0x7123,0x7124,0x7125,0x7127,0x7128,0x7129,0x712a, -0x712b,0x712c,0x712d,0x712e,0x7132,0x7133,0x7134,0x0000, -0x7135,0x7137,0x7138,0x7139,0x713a,0x713b,0x713c,0x713d, -0x713e,0x713f,0x7140,0x7141,0x7142,0x7143,0x7144,0x7146, -0x7147,0x7148,0x7149,0x714b,0x714d,0x714f,0x7150,0x7151, -0x7152,0x7153,0x7154,0x7155,0x7156,0x7157,0x7158,0x7159, -0x715a,0x715b,0x715d,0x715f,0x7160,0x7161,0x7162,0x7163, -0x7165,0x7169,0x716a,0x716b,0x716c,0x716d,0x716f,0x7170, -0x7171,0x7174,0x7175,0x7176,0x7177,0x7179,0x717b,0x717c, -0x717e,0x717f,0x7180,0x7181,0x7182,0x7183,0x7185,0x7186, -0x7187,0x7188,0x7189,0x718b,0x718c,0x718d,0x718e,0x7190, -0x7191,0x7192,0x7193,0x7195,0x7196,0x7197,0x719a,0x719b, -0x719c,0x719d,0x719e,0x71a1,0x71a2,0x71a3,0x71a4,0x71a5, -0x71a6,0x71a7,0x71a9,0x71aa,0x71ab,0x71ad,0x71ae,0x71af, -0x71b0,0x71b1,0x71b2,0x71b4,0x71b6,0x71b7,0x71b8,0x71ba, -0x71bb,0x71bc,0x71bd,0x71be,0x71bf,0x71c0,0x71c1,0x71c2, -0x71c4,0x71c5,0x71c6,0x71c7,0x71c8,0x71c9,0x71ca,0x71cb, -0x71cc,0x71cd,0x71cf,0x71d0,0x71d1,0x71d2,0x71d3,0x0000, -/* 0xa000 */ -0x71d6,0x71d7,0x71d8,0x71d9,0x71da,0x71db,0x71dc,0x71dd, -0x71de,0x71df,0x71e1,0x71e2,0x71e3,0x71e4,0x71e6,0x71e8, -0x71e9,0x71ea,0x71eb,0x71ec,0x71ed,0x71ef,0x71f0,0x71f1, -0x71f2,0x71f3,0x71f4,0x71f5,0x71f6,0x71f7,0x71f8,0x71fa, -0x71fb,0x71fc,0x71fd,0x71fe,0x71ff,0x7200,0x7201,0x7202, -0x7203,0x7204,0x7205,0x7207,0x7208,0x7209,0x720a,0x720b, -0x720c,0x720d,0x720e,0x720f,0x7210,0x7211,0x7212,0x7213, -0x7214,0x7215,0x7216,0x7217,0x7218,0x7219,0x721a,0x0000, -0x721b,0x721c,0x721e,0x721f,0x7220,0x7221,0x7222,0x7223, -0x7224,0x7225,0x7226,0x7227,0x7229,0x722b,0x722d,0x722e, -0x722f,0x7232,0x7233,0x7234,0x723a,0x723c,0x723e,0x7240, -0x7241,0x7242,0x7243,0x7244,0x7245,0x7246,0x7249,0x724a, -0x724b,0x724e,0x724f,0x7250,0x7251,0x7253,0x7254,0x7255, -0x7257,0x7258,0x725a,0x725c,0x725e,0x7260,0x7263,0x7264, -0x7265,0x7268,0x726a,0x726b,0x726c,0x726d,0x7270,0x7271, -0x7273,0x7274,0x7276,0x7277,0x7278,0x727b,0x727c,0x727d, -0x7282,0x7283,0x7285,0x7286,0x7287,0x7288,0x7289,0x728c, -0x728e,0x7290,0x7291,0x7293,0x7294,0x7295,0x7296,0x7297, -0x7298,0x7299,0x729a,0x729b,0x729c,0x729d,0x729e,0x72a0, -0x72a1,0x72a2,0x72a3,0x72a4,0x72a5,0x72a6,0x72a7,0x72a8, -0x72a9,0x72aa,0x72ab,0x72ae,0x72b1,0x72b2,0x72b3,0x72b5, -0x72ba,0x72bb,0x72bc,0x72bd,0x72be,0x72bf,0x72c0,0x72c5, -0x72c6,0x72c7,0x72c9,0x72ca,0x72cb,0x72cc,0x72cf,0x72d1, -0x72d3,0x72d4,0x72d5,0x72d6,0x72d8,0x72da,0x72db,0x0000, -/* 0xa100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x3000,0x3001,0x3002,0x00b7,0x02c9,0x02c7,0x00a8, -0x3003,0x3005,0x2014,0xff5e,0x2016,0x2026,0x2018,0x2019, -0x201c,0x201d,0x3014,0x3015,0x3008,0x3009,0x300a,0x300b, -0x300c,0x300d,0x300e,0x300f,0x3016,0x3017,0x3010,0x3011, -0x00b1,0x00d7,0x00f7,0x2236,0x2227,0x2228,0x2211,0x220f, -0x222a,0x2229,0x2208,0x2237,0x221a,0x22a5,0x2225,0x2220, -0x2312,0x2299,0x222b,0x222e,0x2261,0x224c,0x2248,0x223d, -0x221d,0x2260,0x226e,0x226f,0x2264,0x2265,0x221e,0x2235, -0x2234,0x2642,0x2640,0x00b0,0x2032,0x2033,0x2103,0xff04, -0x00a4,0xffe0,0xffe1,0x2030,0x00a7,0x2116,0x2606,0x2605, -0x25cb,0x25cf,0x25ce,0x25c7,0x25c6,0x25a1,0x25a0,0x25b3, -0x25b2,0x203b,0x2192,0x2190,0x2191,0x2193,0x3013,0x0000, -/* 0xa200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176, -0x2177,0x2178,0x2179,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x2488,0x2489,0x248a,0x248b,0x248c,0x248d,0x248e, -0x248f,0x2490,0x2491,0x2492,0x2493,0x2494,0x2495,0x2496, -0x2497,0x2498,0x2499,0x249a,0x249b,0x2474,0x2475,0x2476, -0x2477,0x2478,0x2479,0x247a,0x247b,0x247c,0x247d,0x247e, -0x247f,0x2480,0x2481,0x2482,0x2483,0x2484,0x2485,0x2486, -0x2487,0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466, -0x2467,0x2468,0x2469,0x0000,0x0000,0x3220,0x3221,0x3222, -0x3223,0x3224,0x3225,0x3226,0x3227,0x3228,0x3229,0x0000, -0x0000,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166, -0x2167,0x2168,0x2169,0x216a,0x216b,0x0000,0x0000,0x0000, -/* 0xa300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xff01,0xff02,0xff03,0xffe5,0xff05,0xff06,0xff07, -0xff08,0xff09,0xff0a,0xff0b,0xff0c,0xff0d,0xff0e,0xff0f, -0xff10,0xff11,0xff12,0xff13,0xff14,0xff15,0xff16,0xff17, -0xff18,0xff19,0xff1a,0xff1b,0xff1c,0xff1d,0xff1e,0xff1f, -0xff20,0xff21,0xff22,0xff23,0xff24,0xff25,0xff26,0xff27, -0xff28,0xff29,0xff2a,0xff2b,0xff2c,0xff2d,0xff2e,0xff2f, -0xff30,0xff31,0xff32,0xff33,0xff34,0xff35,0xff36,0xff37, -0xff38,0xff39,0xff3a,0xff3b,0xff3c,0xff3d,0xff3e,0xff3f, -0xff40,0xff41,0xff42,0xff43,0xff44,0xff45,0xff46,0xff47, -0xff48,0xff49,0xff4a,0xff4b,0xff4c,0xff4d,0xff4e,0xff4f, -0xff50,0xff51,0xff52,0xff53,0xff54,0xff55,0xff56,0xff57, -0xff58,0xff59,0xff5a,0xff5b,0xff5c,0xff5d,0xffe3,0x0000, -/* 0xa400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047, -0x3048,0x3049,0x304a,0x304b,0x304c,0x304d,0x304e,0x304f, -0x3050,0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057, -0x3058,0x3059,0x305a,0x305b,0x305c,0x305d,0x305e,0x305f, -0x3060,0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067, -0x3068,0x3069,0x306a,0x306b,0x306c,0x306d,0x306e,0x306f, -0x3070,0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077, -0x3078,0x3079,0x307a,0x307b,0x307c,0x307d,0x307e,0x307f, -0x3080,0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087, -0x3088,0x3089,0x308a,0x308b,0x308c,0x308d,0x308e,0x308f, -0x3090,0x3091,0x3092,0x3093,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xa500 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x30a1,0x30a2,0x30a3,0x30a4,0x30a5,0x30a6,0x30a7, -0x30a8,0x30a9,0x30aa,0x30ab,0x30ac,0x30ad,0x30ae,0x30af, -0x30b0,0x30b1,0x30b2,0x30b3,0x30b4,0x30b5,0x30b6,0x30b7, -0x30b8,0x30b9,0x30ba,0x30bb,0x30bc,0x30bd,0x30be,0x30bf, -0x30c0,0x30c1,0x30c2,0x30c3,0x30c4,0x30c5,0x30c6,0x30c7, -0x30c8,0x30c9,0x30ca,0x30cb,0x30cc,0x30cd,0x30ce,0x30cf, -0x30d0,0x30d1,0x30d2,0x30d3,0x30d4,0x30d5,0x30d6,0x30d7, -0x30d8,0x30d9,0x30da,0x30db,0x30dc,0x30dd,0x30de,0x30df, -0x30e0,0x30e1,0x30e2,0x30e3,0x30e4,0x30e5,0x30e6,0x30e7, -0x30e8,0x30e9,0x30ea,0x30eb,0x30ec,0x30ed,0x30ee,0x30ef, -0x30f0,0x30f1,0x30f2,0x30f3,0x30f4,0x30f5,0x30f6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xa600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, -0x0398,0x0399,0x039a,0x039b,0x039c,0x039d,0x039e,0x039f, -0x03a0,0x03a1,0x03a3,0x03a4,0x03a5,0x03a6,0x03a7,0x03a8, -0x03a9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x03b1,0x03b2,0x03b3,0x03b4,0x03b5,0x03b6,0x03b7, -0x03b8,0x03b9,0x03ba,0x03bb,0x03bc,0x03bd,0x03be,0x03bf, -0x03c0,0x03c1,0x03c3,0x03c4,0x03c5,0x03c6,0x03c7,0x03c8, -0x03c9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfe35,0xfe36,0xfe39,0xfe3a,0xfe3f,0xfe40,0xfe3d,0xfe3e, -0xfe41,0xfe42,0xfe43,0xfe44,0x0000,0x0000,0xfe3b,0xfe3c, -0xfe37,0xfe38,0xfe31,0x0000,0xfe33,0xfe34,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xa700 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401, -0x0416,0x0417,0x0418,0x0419,0x041a,0x041b,0x041c,0x041d, -0x041e,0x041f,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425, -0x0426,0x0427,0x0428,0x0429,0x042a,0x042b,0x042c,0x042d, -0x042e,0x042f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451, -0x0436,0x0437,0x0438,0x0439,0x043a,0x043b,0x043c,0x043d, -0x043e,0x043f,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445, -0x0446,0x0447,0x0448,0x0449,0x044a,0x044b,0x044c,0x044d, -0x044e,0x044f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xa800 */ -0x02ca,0x02cb,0x02d9,0x2013,0x2015,0x2025,0x2035,0x2105, -0x2109,0x2196,0x2197,0x2198,0x2199,0x2215,0x221f,0x2223, -0x2252,0x2266,0x2267,0x22bf,0x2550,0x2551,0x2552,0x2553, -0x2554,0x2555,0x2556,0x2557,0x2558,0x2559,0x255a,0x255b, -0x255c,0x255d,0x255e,0x255f,0x2560,0x2561,0x2562,0x2563, -0x2564,0x2565,0x2566,0x2567,0x2568,0x2569,0x256a,0x256b, -0x256c,0x256d,0x256e,0x256f,0x2570,0x2571,0x2572,0x2573, -0x2581,0x2582,0x2583,0x2584,0x2585,0x2586,0x2587,0x0000, -0x2588,0x2589,0x258a,0x258b,0x258c,0x258d,0x258e,0x258f, -0x2593,0x2594,0x2595,0x25bc,0x25bd,0x25e2,0x25e3,0x25e4, -0x25e5,0x2609,0x2295,0x3012,0x301d,0x301e,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0101,0x00e1,0x01ce,0x00e0,0x0113,0x00e9,0x011b, -0x00e8,0x012b,0x00ed,0x01d0,0x00ec,0x014d,0x00f3,0x01d2, -0x00f2,0x016b,0x00fa,0x01d4,0x00f9,0x01d6,0x01d8,0x01da, -0x01dc,0x00fc,0x00ea,0x0251,0x0000,0x0144,0x0148,0x0000, -0x0261,0x0000,0x0000,0x0000,0x0000,0x3105,0x3106,0x3107, -0x3108,0x3109,0x310a,0x310b,0x310c,0x310d,0x310e,0x310f, -0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116,0x3117, -0x3118,0x3119,0x311a,0x311b,0x311c,0x311d,0x311e,0x311f, -0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126,0x3127, -0x3128,0x3129,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xa900 */ -0x3021,0x3022,0x3023,0x3024,0x3025,0x3026,0x3027,0x3028, -0x3029,0x32a3,0x338e,0x338f,0x339c,0x339d,0x339e,0x33a1, -0x33c4,0x33ce,0x33d1,0x33d2,0x33d5,0xfe30,0xffe2,0xffe4, -0x0000,0x2121,0x3231,0x0000,0x2010,0x0000,0x0000,0x0000, -0x30fc,0x309b,0x309c,0x30fd,0x30fe,0x3006,0x309d,0x309e, -0xfe49,0xfe4a,0xfe4b,0xfe4c,0xfe4d,0xfe4e,0xfe4f,0xfe50, -0xfe51,0xfe52,0xfe54,0xfe55,0xfe56,0xfe57,0xfe59,0xfe5a, -0xfe5b,0xfe5c,0xfe5d,0xfe5e,0xfe5f,0xfe60,0xfe61,0x0000, -0xfe62,0xfe63,0xfe64,0xfe65,0xfe66,0xfe68,0xfe69,0xfe6a, -0xfe6b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3007,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x2500,0x2501,0x2502,0x2503, -0x2504,0x2505,0x2506,0x2507,0x2508,0x2509,0x250a,0x250b, -0x250c,0x250d,0x250e,0x250f,0x2510,0x2511,0x2512,0x2513, -0x2514,0x2515,0x2516,0x2517,0x2518,0x2519,0x251a,0x251b, -0x251c,0x251d,0x251e,0x251f,0x2520,0x2521,0x2522,0x2523, -0x2524,0x2525,0x2526,0x2527,0x2528,0x2529,0x252a,0x252b, -0x252c,0x252d,0x252e,0x252f,0x2530,0x2531,0x2532,0x2533, -0x2534,0x2535,0x2536,0x2537,0x2538,0x2539,0x253a,0x253b, -0x253c,0x253d,0x253e,0x253f,0x2540,0x2541,0x2542,0x2543, -0x2544,0x2545,0x2546,0x2547,0x2548,0x2549,0x254a,0x254b, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xaa00 */ -0x72dc,0x72dd,0x72df,0x72e2,0x72e3,0x72e4,0x72e5,0x72e6, -0x72e7,0x72ea,0x72eb,0x72f5,0x72f6,0x72f9,0x72fd,0x72fe, -0x72ff,0x7300,0x7302,0x7304,0x7305,0x7306,0x7307,0x7308, -0x7309,0x730b,0x730c,0x730d,0x730f,0x7310,0x7311,0x7312, -0x7314,0x7318,0x7319,0x731a,0x731f,0x7320,0x7323,0x7324, -0x7326,0x7327,0x7328,0x732d,0x732f,0x7330,0x7332,0x7333, -0x7335,0x7336,0x733a,0x733b,0x733c,0x733d,0x7340,0x7341, -0x7342,0x7343,0x7344,0x7345,0x7346,0x7347,0x7348,0x0000, -0x7349,0x734a,0x734b,0x734c,0x734e,0x734f,0x7351,0x7353, -0x7354,0x7355,0x7356,0x7358,0x7359,0x735a,0x735b,0x735c, -0x735d,0x735e,0x735f,0x7361,0x7362,0x7363,0x7364,0x7365, -0x7366,0x7367,0x7368,0x7369,0x736a,0x736b,0x736e,0x7370, -0x7371,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xab00 */ -0x7372,0x7373,0x7374,0x7375,0x7376,0x7377,0x7378,0x7379, -0x737a,0x737b,0x737c,0x737d,0x737f,0x7380,0x7381,0x7382, -0x7383,0x7385,0x7386,0x7388,0x738a,0x738c,0x738d,0x738f, -0x7390,0x7392,0x7393,0x7394,0x7395,0x7397,0x7398,0x7399, -0x739a,0x739c,0x739d,0x739e,0x73a0,0x73a1,0x73a3,0x73a4, -0x73a5,0x73a6,0x73a7,0x73a8,0x73aa,0x73ac,0x73ad,0x73b1, -0x73b4,0x73b5,0x73b6,0x73b8,0x73b9,0x73bc,0x73bd,0x73be, -0x73bf,0x73c1,0x73c3,0x73c4,0x73c5,0x73c6,0x73c7,0x0000, -0x73cb,0x73cc,0x73ce,0x73d2,0x73d3,0x73d4,0x73d5,0x73d6, -0x73d7,0x73d8,0x73da,0x73db,0x73dc,0x73dd,0x73df,0x73e1, -0x73e2,0x73e3,0x73e4,0x73e6,0x73e8,0x73ea,0x73eb,0x73ec, -0x73ee,0x73ef,0x73f0,0x73f1,0x73f3,0x73f4,0x73f5,0x73f6, -0x73f7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xac00 */ -0x73f8,0x73f9,0x73fa,0x73fb,0x73fc,0x73fd,0x73fe,0x73ff, -0x7400,0x7401,0x7402,0x7404,0x7407,0x7408,0x740b,0x740c, -0x740d,0x740e,0x7411,0x7412,0x7413,0x7414,0x7415,0x7416, -0x7417,0x7418,0x7419,0x741c,0x741d,0x741e,0x741f,0x7420, -0x7421,0x7423,0x7424,0x7427,0x7429,0x742b,0x742d,0x742f, -0x7431,0x7432,0x7437,0x7438,0x7439,0x743a,0x743b,0x743d, -0x743e,0x743f,0x7440,0x7442,0x7443,0x7444,0x7445,0x7446, -0x7447,0x7448,0x7449,0x744a,0x744b,0x744c,0x744d,0x0000, -0x744e,0x744f,0x7450,0x7451,0x7452,0x7453,0x7454,0x7456, -0x7458,0x745d,0x7460,0x7461,0x7462,0x7463,0x7464,0x7465, -0x7466,0x7467,0x7468,0x7469,0x746a,0x746b,0x746c,0x746e, -0x746f,0x7471,0x7472,0x7473,0x7474,0x7475,0x7478,0x7479, -0x747a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xad00 */ -0x747b,0x747c,0x747d,0x747f,0x7482,0x7484,0x7485,0x7486, -0x7488,0x7489,0x748a,0x748c,0x748d,0x748f,0x7491,0x7492, -0x7493,0x7494,0x7495,0x7496,0x7497,0x7498,0x7499,0x749a, -0x749b,0x749d,0x749f,0x74a0,0x74a1,0x74a2,0x74a3,0x74a4, -0x74a5,0x74a6,0x74aa,0x74ab,0x74ac,0x74ad,0x74ae,0x74af, -0x74b0,0x74b1,0x74b2,0x74b3,0x74b4,0x74b5,0x74b6,0x74b7, -0x74b8,0x74b9,0x74bb,0x74bc,0x74bd,0x74be,0x74bf,0x74c0, -0x74c1,0x74c2,0x74c3,0x74c4,0x74c5,0x74c6,0x74c7,0x0000, -0x74c8,0x74c9,0x74ca,0x74cb,0x74cc,0x74cd,0x74ce,0x74cf, -0x74d0,0x74d1,0x74d3,0x74d4,0x74d5,0x74d6,0x74d7,0x74d8, -0x74d9,0x74da,0x74db,0x74dd,0x74df,0x74e1,0x74e5,0x74e7, -0x74e8,0x74e9,0x74ea,0x74eb,0x74ec,0x74ed,0x74f0,0x74f1, -0x74f2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xae00 */ -0x74f3,0x74f5,0x74f8,0x74f9,0x74fa,0x74fb,0x74fc,0x74fd, -0x74fe,0x7500,0x7501,0x7502,0x7503,0x7505,0x7506,0x7507, -0x7508,0x7509,0x750a,0x750b,0x750c,0x750e,0x7510,0x7512, -0x7514,0x7515,0x7516,0x7517,0x751b,0x751d,0x751e,0x7520, -0x7521,0x7522,0x7523,0x7524,0x7526,0x7527,0x752a,0x752e, -0x7534,0x7536,0x7539,0x753c,0x753d,0x753f,0x7541,0x7542, -0x7543,0x7544,0x7546,0x7547,0x7549,0x754a,0x754d,0x7550, -0x7551,0x7552,0x7553,0x7555,0x7556,0x7557,0x7558,0x0000, -0x755d,0x755e,0x755f,0x7560,0x7561,0x7562,0x7563,0x7564, -0x7567,0x7568,0x7569,0x756b,0x756c,0x756d,0x756e,0x756f, -0x7570,0x7571,0x7573,0x7575,0x7576,0x7577,0x757a,0x757b, -0x757c,0x757d,0x757e,0x7580,0x7581,0x7582,0x7584,0x7585, -0x7587,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xaf00 */ -0x7588,0x7589,0x758a,0x758c,0x758d,0x758e,0x7590,0x7593, -0x7595,0x7598,0x759b,0x759c,0x759e,0x75a2,0x75a6,0x75a7, -0x75a8,0x75a9,0x75aa,0x75ad,0x75b6,0x75b7,0x75ba,0x75bb, -0x75bf,0x75c0,0x75c1,0x75c6,0x75cb,0x75cc,0x75ce,0x75cf, -0x75d0,0x75d1,0x75d3,0x75d7,0x75d9,0x75da,0x75dc,0x75dd, -0x75df,0x75e0,0x75e1,0x75e5,0x75e9,0x75ec,0x75ed,0x75ee, -0x75ef,0x75f2,0x75f3,0x75f5,0x75f6,0x75f7,0x75f8,0x75fa, -0x75fb,0x75fd,0x75fe,0x7602,0x7604,0x7606,0x7607,0x0000, -0x7608,0x7609,0x760b,0x760d,0x760e,0x760f,0x7611,0x7612, -0x7613,0x7614,0x7616,0x761a,0x761c,0x761d,0x761e,0x7621, -0x7623,0x7627,0x7628,0x762c,0x762e,0x762f,0x7631,0x7632, -0x7636,0x7637,0x7639,0x763a,0x763b,0x763d,0x7641,0x7642, -0x7644,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xb000 */ -0x7645,0x7646,0x7647,0x7648,0x7649,0x764a,0x764b,0x764e, -0x764f,0x7650,0x7651,0x7652,0x7653,0x7655,0x7657,0x7658, -0x7659,0x765a,0x765b,0x765d,0x765f,0x7660,0x7661,0x7662, -0x7664,0x7665,0x7666,0x7667,0x7668,0x7669,0x766a,0x766c, -0x766d,0x766e,0x7670,0x7671,0x7672,0x7673,0x7674,0x7675, -0x7676,0x7677,0x7679,0x767a,0x767c,0x767f,0x7680,0x7681, -0x7683,0x7685,0x7689,0x768a,0x768c,0x768d,0x768f,0x7690, -0x7692,0x7694,0x7695,0x7697,0x7698,0x769a,0x769b,0x0000, -0x769c,0x769d,0x769e,0x769f,0x76a0,0x76a1,0x76a2,0x76a3, -0x76a5,0x76a6,0x76a7,0x76a8,0x76a9,0x76aa,0x76ab,0x76ac, -0x76ad,0x76af,0x76b0,0x76b3,0x76b5,0x76b6,0x76b7,0x76b8, -0x76b9,0x76ba,0x76bb,0x76bc,0x76bd,0x76be,0x76c0,0x76c1, -0x76c3,0x554a,0x963f,0x57c3,0x6328,0x54ce,0x5509,0x54c0, -0x7691,0x764c,0x853c,0x77ee,0x827e,0x788d,0x7231,0x9698, -0x978d,0x6c28,0x5b89,0x4ffa,0x6309,0x6697,0x5cb8,0x80fa, -0x6848,0x80ae,0x6602,0x76ce,0x51f9,0x6556,0x71ac,0x7ff1, -0x8884,0x50b2,0x5965,0x61ca,0x6fb3,0x82ad,0x634c,0x6252, -0x53ed,0x5427,0x7b06,0x516b,0x75a4,0x5df4,0x62d4,0x8dcb, -0x9776,0x628a,0x8019,0x575d,0x9738,0x7f62,0x7238,0x767d, -0x67cf,0x767e,0x6446,0x4f70,0x8d25,0x62dc,0x7a17,0x6591, -0x73ed,0x642c,0x6273,0x822c,0x9881,0x677f,0x7248,0x626e, -0x62cc,0x4f34,0x74e3,0x534a,0x529e,0x7eca,0x90a6,0x5e2e, -0x6886,0x699c,0x8180,0x7ed1,0x68d2,0x78c5,0x868c,0x9551, -0x508d,0x8c24,0x82de,0x80de,0x5305,0x8912,0x5265,0x0000, -/* 0xb100 */ -0x76c4,0x76c7,0x76c9,0x76cb,0x76cc,0x76d3,0x76d5,0x76d9, -0x76da,0x76dc,0x76dd,0x76de,0x76e0,0x76e1,0x76e2,0x76e3, -0x76e4,0x76e6,0x76e7,0x76e8,0x76e9,0x76ea,0x76eb,0x76ec, -0x76ed,0x76f0,0x76f3,0x76f5,0x76f6,0x76f7,0x76fa,0x76fb, -0x76fd,0x76ff,0x7700,0x7702,0x7703,0x7705,0x7706,0x770a, -0x770c,0x770e,0x770f,0x7710,0x7711,0x7712,0x7713,0x7714, -0x7715,0x7716,0x7717,0x7718,0x771b,0x771c,0x771d,0x771e, -0x7721,0x7723,0x7724,0x7725,0x7727,0x772a,0x772b,0x0000, -0x772c,0x772e,0x7730,0x7731,0x7732,0x7733,0x7734,0x7739, -0x773b,0x773d,0x773e,0x773f,0x7742,0x7744,0x7745,0x7746, -0x7748,0x7749,0x774a,0x774b,0x774c,0x774d,0x774e,0x774f, -0x7752,0x7753,0x7754,0x7755,0x7756,0x7757,0x7758,0x7759, -0x775c,0x8584,0x96f9,0x4fdd,0x5821,0x9971,0x5b9d,0x62b1, -0x62a5,0x66b4,0x8c79,0x9c8d,0x7206,0x676f,0x7891,0x60b2, -0x5351,0x5317,0x8f88,0x80cc,0x8d1d,0x94a1,0x500d,0x72c8, -0x5907,0x60eb,0x7119,0x88ab,0x5954,0x82ef,0x672c,0x7b28, -0x5d29,0x7ef7,0x752d,0x6cf5,0x8e66,0x8ff8,0x903c,0x9f3b, -0x6bd4,0x9119,0x7b14,0x5f7c,0x78a7,0x84d6,0x853d,0x6bd5, -0x6bd9,0x6bd6,0x5e01,0x5e87,0x75f9,0x95ed,0x655d,0x5f0a, -0x5fc5,0x8f9f,0x58c1,0x81c2,0x907f,0x965b,0x97ad,0x8fb9, -0x7f16,0x8d2c,0x6241,0x4fbf,0x53d8,0x535e,0x8fa8,0x8fa9, -0x8fab,0x904d,0x6807,0x5f6a,0x8198,0x8868,0x9cd6,0x618b, -0x522b,0x762a,0x5f6c,0x658c,0x6fd2,0x6ee8,0x5bbe,0x6448, -0x5175,0x51b0,0x67c4,0x4e19,0x79c9,0x997c,0x70b3,0x0000, -/* 0xb200 */ -0x775d,0x775e,0x775f,0x7760,0x7764,0x7767,0x7769,0x776a, -0x776d,0x776e,0x776f,0x7770,0x7771,0x7772,0x7773,0x7774, -0x7775,0x7776,0x7777,0x7778,0x777a,0x777b,0x777c,0x7781, -0x7782,0x7783,0x7786,0x7787,0x7788,0x7789,0x778a,0x778b, -0x778f,0x7790,0x7793,0x7794,0x7795,0x7796,0x7797,0x7798, -0x7799,0x779a,0x779b,0x779c,0x779d,0x779e,0x77a1,0x77a3, -0x77a4,0x77a6,0x77a8,0x77ab,0x77ad,0x77ae,0x77af,0x77b1, -0x77b2,0x77b4,0x77b6,0x77b7,0x77b8,0x77b9,0x77ba,0x0000, -0x77bc,0x77be,0x77c0,0x77c1,0x77c2,0x77c3,0x77c4,0x77c5, -0x77c6,0x77c7,0x77c8,0x77c9,0x77ca,0x77cb,0x77cc,0x77ce, -0x77cf,0x77d0,0x77d1,0x77d2,0x77d3,0x77d4,0x77d5,0x77d6, -0x77d8,0x77d9,0x77da,0x77dd,0x77de,0x77df,0x77e0,0x77e1, -0x77e4,0x75c5,0x5e76,0x73bb,0x83e0,0x64ad,0x62e8,0x94b5, -0x6ce2,0x535a,0x52c3,0x640f,0x94c2,0x7b94,0x4f2f,0x5e1b, -0x8236,0x8116,0x818a,0x6e24,0x6cca,0x9a73,0x6355,0x535c, -0x54fa,0x8865,0x57e0,0x4e0d,0x5e03,0x6b65,0x7c3f,0x90e8, -0x6016,0x64e6,0x731c,0x88c1,0x6750,0x624d,0x8d22,0x776c, -0x8e29,0x91c7,0x5f69,0x83dc,0x8521,0x9910,0x53c2,0x8695, -0x6b8b,0x60ed,0x60e8,0x707f,0x82cd,0x8231,0x4ed3,0x6ca7, -0x85cf,0x64cd,0x7cd9,0x69fd,0x66f9,0x8349,0x5395,0x7b56, -0x4fa7,0x518c,0x6d4b,0x5c42,0x8e6d,0x63d2,0x53c9,0x832c, -0x8336,0x67e5,0x78b4,0x643d,0x5bdf,0x5c94,0x5dee,0x8be7, -0x62c6,0x67f4,0x8c7a,0x6400,0x63ba,0x8749,0x998b,0x8c17, -0x7f20,0x94f2,0x4ea7,0x9610,0x98a4,0x660c,0x7316,0x0000, -/* 0xb300 */ -0x77e6,0x77e8,0x77ea,0x77ef,0x77f0,0x77f1,0x77f2,0x77f4, -0x77f5,0x77f7,0x77f9,0x77fa,0x77fb,0x77fc,0x7803,0x7804, -0x7805,0x7806,0x7807,0x7808,0x780a,0x780b,0x780e,0x780f, -0x7810,0x7813,0x7815,0x7819,0x781b,0x781e,0x7820,0x7821, -0x7822,0x7824,0x7828,0x782a,0x782b,0x782e,0x782f,0x7831, -0x7832,0x7833,0x7835,0x7836,0x783d,0x783f,0x7841,0x7842, -0x7843,0x7844,0x7846,0x7848,0x7849,0x784a,0x784b,0x784d, -0x784f,0x7851,0x7853,0x7854,0x7858,0x7859,0x785a,0x0000, -0x785b,0x785c,0x785e,0x785f,0x7860,0x7861,0x7862,0x7863, -0x7864,0x7865,0x7866,0x7867,0x7868,0x7869,0x786f,0x7870, -0x7871,0x7872,0x7873,0x7874,0x7875,0x7876,0x7878,0x7879, -0x787a,0x787b,0x787d,0x787e,0x787f,0x7880,0x7881,0x7882, -0x7883,0x573a,0x5c1d,0x5e38,0x957f,0x507f,0x80a0,0x5382, -0x655e,0x7545,0x5531,0x5021,0x8d85,0x6284,0x949e,0x671d, -0x5632,0x6f6e,0x5de2,0x5435,0x7092,0x8f66,0x626f,0x64a4, -0x63a3,0x5f7b,0x6f88,0x90f4,0x81e3,0x8fb0,0x5c18,0x6668, -0x5ff1,0x6c89,0x9648,0x8d81,0x886c,0x6491,0x79f0,0x57ce, -0x6a59,0x6210,0x5448,0x4e58,0x7a0b,0x60e9,0x6f84,0x8bda, -0x627f,0x901e,0x9a8b,0x79e4,0x5403,0x75f4,0x6301,0x5319, -0x6c60,0x8fdf,0x5f1b,0x9a70,0x803b,0x9f7f,0x4f88,0x5c3a, -0x8d64,0x7fc5,0x65a5,0x70bd,0x5145,0x51b2,0x866b,0x5d07, -0x5ba0,0x62bd,0x916c,0x7574,0x8e0c,0x7a20,0x6101,0x7b79, -0x4ec7,0x7ef8,0x7785,0x4e11,0x81ed,0x521d,0x51fa,0x6a71, -0x53a8,0x8e87,0x9504,0x96cf,0x6ec1,0x9664,0x695a,0x0000, -/* 0xb400 */ -0x7884,0x7885,0x7886,0x7888,0x788a,0x788b,0x788f,0x7890, -0x7892,0x7894,0x7895,0x7896,0x7899,0x789d,0x789e,0x78a0, -0x78a2,0x78a4,0x78a6,0x78a8,0x78a9,0x78aa,0x78ab,0x78ac, -0x78ad,0x78ae,0x78af,0x78b5,0x78b6,0x78b7,0x78b8,0x78ba, -0x78bb,0x78bc,0x78bd,0x78bf,0x78c0,0x78c2,0x78c3,0x78c4, -0x78c6,0x78c7,0x78c8,0x78cc,0x78cd,0x78ce,0x78cf,0x78d1, -0x78d2,0x78d3,0x78d6,0x78d7,0x78d8,0x78da,0x78db,0x78dc, -0x78dd,0x78de,0x78df,0x78e0,0x78e1,0x78e2,0x78e3,0x0000, -0x78e4,0x78e5,0x78e6,0x78e7,0x78e9,0x78ea,0x78eb,0x78ed, -0x78ee,0x78ef,0x78f0,0x78f1,0x78f3,0x78f5,0x78f6,0x78f8, -0x78f9,0x78fb,0x78fc,0x78fd,0x78fe,0x78ff,0x7900,0x7902, -0x7903,0x7904,0x7906,0x7907,0x7908,0x7909,0x790a,0x790b, -0x790c,0x7840,0x50a8,0x77d7,0x6410,0x89e6,0x5904,0x63e3, -0x5ddd,0x7a7f,0x693d,0x4f20,0x8239,0x5598,0x4e32,0x75ae, -0x7a97,0x5e62,0x5e8a,0x95ef,0x521b,0x5439,0x708a,0x6376, -0x9524,0x5782,0x6625,0x693f,0x9187,0x5507,0x6df3,0x7eaf, -0x8822,0x6233,0x7ef0,0x75b5,0x8328,0x78c1,0x96cc,0x8f9e, -0x6148,0x74f7,0x8bcd,0x6b64,0x523a,0x8d50,0x6b21,0x806a, -0x8471,0x56f1,0x5306,0x4ece,0x4e1b,0x51d1,0x7c97,0x918b, -0x7c07,0x4fc3,0x8e7f,0x7be1,0x7a9c,0x6467,0x5d14,0x50ac, -0x8106,0x7601,0x7cb9,0x6dec,0x7fe0,0x6751,0x5b58,0x5bf8, -0x78cb,0x64ae,0x6413,0x63aa,0x632b,0x9519,0x642d,0x8fbe, -0x7b54,0x7629,0x6253,0x5927,0x5446,0x6b79,0x50a3,0x6234, -0x5e26,0x6b86,0x4ee3,0x8d37,0x888b,0x5f85,0x902e,0x0000, -/* 0xb500 */ -0x790d,0x790e,0x790f,0x7910,0x7911,0x7912,0x7914,0x7915, -0x7916,0x7917,0x7918,0x7919,0x791a,0x791b,0x791c,0x791d, -0x791f,0x7920,0x7921,0x7922,0x7923,0x7925,0x7926,0x7927, -0x7928,0x7929,0x792a,0x792b,0x792c,0x792d,0x792e,0x792f, -0x7930,0x7931,0x7932,0x7933,0x7935,0x7936,0x7937,0x7938, -0x7939,0x793d,0x793f,0x7942,0x7943,0x7944,0x7945,0x7947, -0x794a,0x794b,0x794c,0x794d,0x794e,0x794f,0x7950,0x7951, -0x7952,0x7954,0x7955,0x7958,0x7959,0x7961,0x7963,0x0000, -0x7964,0x7966,0x7969,0x796a,0x796b,0x796c,0x796e,0x7970, -0x7971,0x7972,0x7973,0x7974,0x7975,0x7976,0x7979,0x797b, -0x797c,0x797d,0x797e,0x797f,0x7982,0x7983,0x7986,0x7987, -0x7988,0x7989,0x798b,0x798c,0x798d,0x798e,0x7990,0x7991, -0x7992,0x6020,0x803d,0x62c5,0x4e39,0x5355,0x90f8,0x63b8, -0x80c6,0x65e6,0x6c2e,0x4f46,0x60ee,0x6de1,0x8bde,0x5f39, -0x86cb,0x5f53,0x6321,0x515a,0x8361,0x6863,0x5200,0x6363, -0x8e48,0x5012,0x5c9b,0x7977,0x5bfc,0x5230,0x7a3b,0x60bc, -0x9053,0x76d7,0x5fb7,0x5f97,0x7684,0x8e6c,0x706f,0x767b, -0x7b49,0x77aa,0x51f3,0x9093,0x5824,0x4f4e,0x6ef4,0x8fea, -0x654c,0x7b1b,0x72c4,0x6da4,0x7fdf,0x5ae1,0x62b5,0x5e95, -0x5730,0x8482,0x7b2c,0x5e1d,0x5f1f,0x9012,0x7f14,0x98a0, -0x6382,0x6ec7,0x7898,0x70b9,0x5178,0x975b,0x57ab,0x7535, -0x4f43,0x7538,0x5e97,0x60e6,0x5960,0x6dc0,0x6bbf,0x7889, -0x53fc,0x96d5,0x51cb,0x5201,0x6389,0x540a,0x9493,0x8c03, -0x8dcc,0x7239,0x789f,0x8776,0x8fed,0x8c0d,0x53e0,0x0000, -/* 0xb600 */ -0x7993,0x7994,0x7995,0x7996,0x7997,0x7998,0x7999,0x799b, -0x799c,0x799d,0x799e,0x799f,0x79a0,0x79a1,0x79a2,0x79a3, -0x79a4,0x79a5,0x79a6,0x79a8,0x79a9,0x79aa,0x79ab,0x79ac, -0x79ad,0x79ae,0x79af,0x79b0,0x79b1,0x79b2,0x79b4,0x79b5, -0x79b6,0x79b7,0x79b8,0x79bc,0x79bf,0x79c2,0x79c4,0x79c5, -0x79c7,0x79c8,0x79ca,0x79cc,0x79ce,0x79cf,0x79d0,0x79d3, -0x79d4,0x79d6,0x79d7,0x79d9,0x79da,0x79db,0x79dc,0x79dd, -0x79de,0x79e0,0x79e1,0x79e2,0x79e5,0x79e8,0x79ea,0x0000, -0x79ec,0x79ee,0x79f1,0x79f2,0x79f3,0x79f4,0x79f5,0x79f6, -0x79f7,0x79f9,0x79fa,0x79fc,0x79fe,0x79ff,0x7a01,0x7a04, -0x7a05,0x7a07,0x7a08,0x7a09,0x7a0a,0x7a0c,0x7a0f,0x7a10, -0x7a11,0x7a12,0x7a13,0x7a15,0x7a16,0x7a18,0x7a19,0x7a1b, -0x7a1c,0x4e01,0x76ef,0x53ee,0x9489,0x9876,0x9f0e,0x952d, -0x5b9a,0x8ba2,0x4e22,0x4e1c,0x51ac,0x8463,0x61c2,0x52a8, -0x680b,0x4f97,0x606b,0x51bb,0x6d1e,0x515c,0x6296,0x6597, -0x9661,0x8c46,0x9017,0x75d8,0x90fd,0x7763,0x6bd2,0x728a, -0x72ec,0x8bfb,0x5835,0x7779,0x8d4c,0x675c,0x9540,0x809a, -0x5ea6,0x6e21,0x5992,0x7aef,0x77ed,0x953b,0x6bb5,0x65ad, -0x7f0e,0x5806,0x5151,0x961f,0x5bf9,0x58a9,0x5428,0x8e72, -0x6566,0x987f,0x56e4,0x949d,0x76fe,0x9041,0x6387,0x54c6, -0x591a,0x593a,0x579b,0x8eb2,0x6735,0x8dfa,0x8235,0x5241, -0x60f0,0x5815,0x86fe,0x5ce8,0x9e45,0x4fc4,0x989d,0x8bb9, -0x5a25,0x6076,0x5384,0x627c,0x904f,0x9102,0x997f,0x6069, -0x800c,0x513f,0x8033,0x5c14,0x9975,0x6d31,0x4e8c,0x0000, -/* 0xb700 */ -0x7a1d,0x7a1f,0x7a21,0x7a22,0x7a24,0x7a25,0x7a26,0x7a27, -0x7a28,0x7a29,0x7a2a,0x7a2b,0x7a2c,0x7a2d,0x7a2e,0x7a2f, -0x7a30,0x7a31,0x7a32,0x7a34,0x7a35,0x7a36,0x7a38,0x7a3a, -0x7a3e,0x7a40,0x7a41,0x7a42,0x7a43,0x7a44,0x7a45,0x7a47, -0x7a48,0x7a49,0x7a4a,0x7a4b,0x7a4c,0x7a4d,0x7a4e,0x7a4f, -0x7a50,0x7a52,0x7a53,0x7a54,0x7a55,0x7a56,0x7a58,0x7a59, -0x7a5a,0x7a5b,0x7a5c,0x7a5d,0x7a5e,0x7a5f,0x7a60,0x7a61, -0x7a62,0x7a63,0x7a64,0x7a65,0x7a66,0x7a67,0x7a68,0x0000, -0x7a69,0x7a6a,0x7a6b,0x7a6c,0x7a6d,0x7a6e,0x7a6f,0x7a71, -0x7a72,0x7a73,0x7a75,0x7a7b,0x7a7c,0x7a7d,0x7a7e,0x7a82, -0x7a85,0x7a87,0x7a89,0x7a8a,0x7a8b,0x7a8c,0x7a8e,0x7a8f, -0x7a90,0x7a93,0x7a94,0x7a99,0x7a9a,0x7a9b,0x7a9e,0x7aa1, -0x7aa2,0x8d30,0x53d1,0x7f5a,0x7b4f,0x4f10,0x4e4f,0x9600, -0x6cd5,0x73d0,0x85e9,0x5e06,0x756a,0x7ffb,0x6a0a,0x77fe, -0x9492,0x7e41,0x51e1,0x70e6,0x53cd,0x8fd4,0x8303,0x8d29, -0x72af,0x996d,0x6cdb,0x574a,0x82b3,0x65b9,0x80aa,0x623f, -0x9632,0x59a8,0x4eff,0x8bbf,0x7eba,0x653e,0x83f2,0x975e, -0x5561,0x98de,0x80a5,0x532a,0x8bfd,0x5420,0x80ba,0x5e9f, -0x6cb8,0x8d39,0x82ac,0x915a,0x5429,0x6c1b,0x5206,0x7eb7, -0x575f,0x711a,0x6c7e,0x7c89,0x594b,0x4efd,0x5fff,0x6124, -0x7caa,0x4e30,0x5c01,0x67ab,0x8702,0x5cf0,0x950b,0x98ce, -0x75af,0x70fd,0x9022,0x51af,0x7f1d,0x8bbd,0x5949,0x51e4, -0x4f5b,0x5426,0x592b,0x6577,0x80a4,0x5b75,0x6276,0x62c2, -0x8f90,0x5e45,0x6c1f,0x7b26,0x4f0f,0x4fd8,0x670d,0x0000, -/* 0xb800 */ -0x7aa3,0x7aa4,0x7aa7,0x7aa9,0x7aaa,0x7aab,0x7aae,0x7aaf, -0x7ab0,0x7ab1,0x7ab2,0x7ab4,0x7ab5,0x7ab6,0x7ab7,0x7ab8, -0x7ab9,0x7aba,0x7abb,0x7abc,0x7abd,0x7abe,0x7ac0,0x7ac1, -0x7ac2,0x7ac3,0x7ac4,0x7ac5,0x7ac6,0x7ac7,0x7ac8,0x7ac9, -0x7aca,0x7acc,0x7acd,0x7ace,0x7acf,0x7ad0,0x7ad1,0x7ad2, -0x7ad3,0x7ad4,0x7ad5,0x7ad7,0x7ad8,0x7ada,0x7adb,0x7adc, -0x7add,0x7ae1,0x7ae2,0x7ae4,0x7ae7,0x7ae8,0x7ae9,0x7aea, -0x7aeb,0x7aec,0x7aee,0x7af0,0x7af1,0x7af2,0x7af3,0x0000, -0x7af4,0x7af5,0x7af6,0x7af7,0x7af8,0x7afb,0x7afc,0x7afe, -0x7b00,0x7b01,0x7b02,0x7b05,0x7b07,0x7b09,0x7b0c,0x7b0d, -0x7b0e,0x7b10,0x7b12,0x7b13,0x7b16,0x7b17,0x7b18,0x7b1a, -0x7b1c,0x7b1d,0x7b1f,0x7b21,0x7b22,0x7b23,0x7b27,0x7b29, -0x7b2d,0x6d6e,0x6daa,0x798f,0x88b1,0x5f17,0x752b,0x629a, -0x8f85,0x4fef,0x91dc,0x65a7,0x812f,0x8151,0x5e9c,0x8150, -0x8d74,0x526f,0x8986,0x8d4b,0x590d,0x5085,0x4ed8,0x961c, -0x7236,0x8179,0x8d1f,0x5bcc,0x8ba3,0x9644,0x5987,0x7f1a, -0x5490,0x5676,0x560e,0x8be5,0x6539,0x6982,0x9499,0x76d6, -0x6e89,0x5e72,0x7518,0x6746,0x67d1,0x7aff,0x809d,0x8d76, -0x611f,0x79c6,0x6562,0x8d63,0x5188,0x521a,0x94a2,0x7f38, -0x809b,0x7eb2,0x5c97,0x6e2f,0x6760,0x7bd9,0x768b,0x9ad8, -0x818f,0x7f94,0x7cd5,0x641e,0x9550,0x7a3f,0x544a,0x54e5, -0x6b4c,0x6401,0x6208,0x9e3d,0x80f3,0x7599,0x5272,0x9769, -0x845b,0x683c,0x86e4,0x9601,0x9694,0x94ec,0x4e2a,0x5404, -0x7ed9,0x6839,0x8ddf,0x8015,0x66f4,0x5e9a,0x7fb9,0x0000, -/* 0xb900 */ -0x7b2f,0x7b30,0x7b32,0x7b34,0x7b35,0x7b36,0x7b37,0x7b39, -0x7b3b,0x7b3d,0x7b3f,0x7b40,0x7b41,0x7b42,0x7b43,0x7b44, -0x7b46,0x7b48,0x7b4a,0x7b4d,0x7b4e,0x7b53,0x7b55,0x7b57, -0x7b59,0x7b5c,0x7b5e,0x7b5f,0x7b61,0x7b63,0x7b64,0x7b65, -0x7b66,0x7b67,0x7b68,0x7b69,0x7b6a,0x7b6b,0x7b6c,0x7b6d, -0x7b6f,0x7b70,0x7b73,0x7b74,0x7b76,0x7b78,0x7b7a,0x7b7c, -0x7b7d,0x7b7f,0x7b81,0x7b82,0x7b83,0x7b84,0x7b86,0x7b87, -0x7b88,0x7b89,0x7b8a,0x7b8b,0x7b8c,0x7b8e,0x7b8f,0x0000, -0x7b91,0x7b92,0x7b93,0x7b96,0x7b98,0x7b99,0x7b9a,0x7b9b, -0x7b9e,0x7b9f,0x7ba0,0x7ba3,0x7ba4,0x7ba5,0x7bae,0x7baf, -0x7bb0,0x7bb2,0x7bb3,0x7bb5,0x7bb6,0x7bb7,0x7bb9,0x7bba, -0x7bbb,0x7bbc,0x7bbd,0x7bbe,0x7bbf,0x7bc0,0x7bc2,0x7bc3, -0x7bc4,0x57c2,0x803f,0x6897,0x5de5,0x653b,0x529f,0x606d, -0x9f9a,0x4f9b,0x8eac,0x516c,0x5bab,0x5f13,0x5de9,0x6c5e, -0x62f1,0x8d21,0x5171,0x94a9,0x52fe,0x6c9f,0x82df,0x72d7, -0x57a2,0x6784,0x8d2d,0x591f,0x8f9c,0x83c7,0x5495,0x7b8d, -0x4f30,0x6cbd,0x5b64,0x59d1,0x9f13,0x53e4,0x86ca,0x9aa8, -0x8c37,0x80a1,0x6545,0x987e,0x56fa,0x96c7,0x522e,0x74dc, -0x5250,0x5be1,0x6302,0x8902,0x4e56,0x62d0,0x602a,0x68fa, -0x5173,0x5b98,0x51a0,0x89c2,0x7ba1,0x9986,0x7f50,0x60ef, -0x704c,0x8d2f,0x5149,0x5e7f,0x901b,0x7470,0x89c4,0x572d, -0x7845,0x5f52,0x9f9f,0x95fa,0x8f68,0x9b3c,0x8be1,0x7678, -0x6842,0x67dc,0x8dea,0x8d35,0x523d,0x8f8a,0x6eda,0x68cd, -0x9505,0x90ed,0x56fd,0x679c,0x88f9,0x8fc7,0x54c8,0x0000, -/* 0xba00 */ -0x7bc5,0x7bc8,0x7bc9,0x7bca,0x7bcb,0x7bcd,0x7bce,0x7bcf, -0x7bd0,0x7bd2,0x7bd4,0x7bd5,0x7bd6,0x7bd7,0x7bd8,0x7bdb, -0x7bdc,0x7bde,0x7bdf,0x7be0,0x7be2,0x7be3,0x7be4,0x7be7, -0x7be8,0x7be9,0x7beb,0x7bec,0x7bed,0x7bef,0x7bf0,0x7bf2, -0x7bf3,0x7bf4,0x7bf5,0x7bf6,0x7bf8,0x7bf9,0x7bfa,0x7bfb, -0x7bfd,0x7bff,0x7c00,0x7c01,0x7c02,0x7c03,0x7c04,0x7c05, -0x7c06,0x7c08,0x7c09,0x7c0a,0x7c0d,0x7c0e,0x7c10,0x7c11, -0x7c12,0x7c13,0x7c14,0x7c15,0x7c17,0x7c18,0x7c19,0x0000, -0x7c1a,0x7c1b,0x7c1c,0x7c1d,0x7c1e,0x7c20,0x7c21,0x7c22, -0x7c23,0x7c24,0x7c25,0x7c28,0x7c29,0x7c2b,0x7c2c,0x7c2d, -0x7c2e,0x7c2f,0x7c30,0x7c31,0x7c32,0x7c33,0x7c34,0x7c35, -0x7c36,0x7c37,0x7c39,0x7c3a,0x7c3b,0x7c3c,0x7c3d,0x7c3e, -0x7c42,0x9ab8,0x5b69,0x6d77,0x6c26,0x4ea5,0x5bb3,0x9a87, -0x9163,0x61a8,0x90af,0x97e9,0x542b,0x6db5,0x5bd2,0x51fd, -0x558a,0x7f55,0x7ff0,0x64bc,0x634d,0x65f1,0x61be,0x608d, -0x710a,0x6c57,0x6c49,0x592f,0x676d,0x822a,0x58d5,0x568e, -0x8c6a,0x6beb,0x90dd,0x597d,0x8017,0x53f7,0x6d69,0x5475, -0x559d,0x8377,0x83cf,0x6838,0x79be,0x548c,0x4f55,0x5408, -0x76d2,0x8c89,0x9602,0x6cb3,0x6db8,0x8d6b,0x8910,0x9e64, -0x8d3a,0x563f,0x9ed1,0x75d5,0x5f88,0x72e0,0x6068,0x54fc, -0x4ea8,0x6a2a,0x8861,0x6052,0x8f70,0x54c4,0x70d8,0x8679, -0x9e3f,0x6d2a,0x5b8f,0x5f18,0x7ea2,0x5589,0x4faf,0x7334, -0x543c,0x539a,0x5019,0x540e,0x547c,0x4e4e,0x5ffd,0x745a, -0x58f6,0x846b,0x80e1,0x8774,0x72d0,0x7cca,0x6e56,0x0000, -/* 0xbb00 */ -0x7c43,0x7c44,0x7c45,0x7c46,0x7c47,0x7c48,0x7c49,0x7c4a, -0x7c4b,0x7c4c,0x7c4e,0x7c4f,0x7c50,0x7c51,0x7c52,0x7c53, -0x7c54,0x7c55,0x7c56,0x7c57,0x7c58,0x7c59,0x7c5a,0x7c5b, -0x7c5c,0x7c5d,0x7c5e,0x7c5f,0x7c60,0x7c61,0x7c62,0x7c63, -0x7c64,0x7c65,0x7c66,0x7c67,0x7c68,0x7c69,0x7c6a,0x7c6b, -0x7c6c,0x7c6d,0x7c6e,0x7c6f,0x7c70,0x7c71,0x7c72,0x7c75, -0x7c76,0x7c77,0x7c78,0x7c79,0x7c7a,0x7c7e,0x7c7f,0x7c80, -0x7c81,0x7c82,0x7c83,0x7c84,0x7c85,0x7c86,0x7c87,0x0000, -0x7c88,0x7c8a,0x7c8b,0x7c8c,0x7c8d,0x7c8e,0x7c8f,0x7c90, -0x7c93,0x7c94,0x7c96,0x7c99,0x7c9a,0x7c9b,0x7ca0,0x7ca1, -0x7ca3,0x7ca6,0x7ca7,0x7ca8,0x7ca9,0x7cab,0x7cac,0x7cad, -0x7caf,0x7cb0,0x7cb4,0x7cb5,0x7cb6,0x7cb7,0x7cb8,0x7cba, -0x7cbb,0x5f27,0x864e,0x552c,0x62a4,0x4e92,0x6caa,0x6237, -0x82b1,0x54d7,0x534e,0x733e,0x6ed1,0x753b,0x5212,0x5316, -0x8bdd,0x69d0,0x5f8a,0x6000,0x6dee,0x574f,0x6b22,0x73af, -0x6853,0x8fd8,0x7f13,0x6362,0x60a3,0x5524,0x75ea,0x8c62, -0x7115,0x6da3,0x5ba6,0x5e7b,0x8352,0x614c,0x9ec4,0x78fa, -0x8757,0x7c27,0x7687,0x51f0,0x60f6,0x714c,0x6643,0x5e4c, -0x604d,0x8c0e,0x7070,0x6325,0x8f89,0x5fbd,0x6062,0x86d4, -0x56de,0x6bc1,0x6094,0x6167,0x5349,0x60e0,0x6666,0x8d3f, -0x79fd,0x4f1a,0x70e9,0x6c47,0x8bb3,0x8bf2,0x7ed8,0x8364, -0x660f,0x5a5a,0x9b42,0x6d51,0x6df7,0x8c41,0x6d3b,0x4f19, -0x706b,0x83b7,0x6216,0x60d1,0x970d,0x8d27,0x7978,0x51fb, -0x573e,0x57fa,0x673a,0x7578,0x7a3d,0x79ef,0x7b95,0x0000, -/* 0xbc00 */ -0x7cbf,0x7cc0,0x7cc2,0x7cc3,0x7cc4,0x7cc6,0x7cc9,0x7ccb, -0x7cce,0x7ccf,0x7cd0,0x7cd1,0x7cd2,0x7cd3,0x7cd4,0x7cd8, -0x7cda,0x7cdb,0x7cdd,0x7cde,0x7ce1,0x7ce2,0x7ce3,0x7ce4, -0x7ce5,0x7ce6,0x7ce7,0x7ce9,0x7cea,0x7ceb,0x7cec,0x7ced, -0x7cee,0x7cf0,0x7cf1,0x7cf2,0x7cf3,0x7cf4,0x7cf5,0x7cf6, -0x7cf7,0x7cf9,0x7cfa,0x7cfc,0x7cfd,0x7cfe,0x7cff,0x7d00, -0x7d01,0x7d02,0x7d03,0x7d04,0x7d05,0x7d06,0x7d07,0x7d08, -0x7d09,0x7d0b,0x7d0c,0x7d0d,0x7d0e,0x7d0f,0x7d10,0x0000, -0x7d11,0x7d12,0x7d13,0x7d14,0x7d15,0x7d16,0x7d17,0x7d18, -0x7d19,0x7d1a,0x7d1b,0x7d1c,0x7d1d,0x7d1e,0x7d1f,0x7d21, -0x7d23,0x7d24,0x7d25,0x7d26,0x7d28,0x7d29,0x7d2a,0x7d2c, -0x7d2d,0x7d2e,0x7d30,0x7d31,0x7d32,0x7d33,0x7d34,0x7d35, -0x7d36,0x808c,0x9965,0x8ff9,0x6fc0,0x8ba5,0x9e21,0x59ec, -0x7ee9,0x7f09,0x5409,0x6781,0x68d8,0x8f91,0x7c4d,0x96c6, -0x53ca,0x6025,0x75be,0x6c72,0x5373,0x5ac9,0x7ea7,0x6324, -0x51e0,0x810a,0x5df1,0x84df,0x6280,0x5180,0x5b63,0x4f0e, -0x796d,0x5242,0x60b8,0x6d4e,0x5bc4,0x5bc2,0x8ba1,0x8bb0, -0x65e2,0x5fcc,0x9645,0x5993,0x7ee7,0x7eaa,0x5609,0x67b7, -0x5939,0x4f73,0x5bb6,0x52a0,0x835a,0x988a,0x8d3e,0x7532, -0x94be,0x5047,0x7a3c,0x4ef7,0x67b6,0x9a7e,0x5ac1,0x6b7c, -0x76d1,0x575a,0x5c16,0x7b3a,0x95f4,0x714e,0x517c,0x80a9, -0x8270,0x5978,0x7f04,0x8327,0x68c0,0x67ec,0x78b1,0x7877, -0x62e3,0x6361,0x7b80,0x4fed,0x526a,0x51cf,0x8350,0x69db, -0x9274,0x8df5,0x8d31,0x89c1,0x952e,0x7bad,0x4ef6,0x0000, -/* 0xbd00 */ -0x7d37,0x7d38,0x7d39,0x7d3a,0x7d3b,0x7d3c,0x7d3d,0x7d3e, -0x7d3f,0x7d40,0x7d41,0x7d42,0x7d43,0x7d44,0x7d45,0x7d46, -0x7d47,0x7d48,0x7d49,0x7d4a,0x7d4b,0x7d4c,0x7d4d,0x7d4e, -0x7d4f,0x7d50,0x7d51,0x7d52,0x7d53,0x7d54,0x7d55,0x7d56, -0x7d57,0x7d58,0x7d59,0x7d5a,0x7d5b,0x7d5c,0x7d5d,0x7d5e, -0x7d5f,0x7d60,0x7d61,0x7d62,0x7d63,0x7d64,0x7d65,0x7d66, -0x7d67,0x7d68,0x7d69,0x7d6a,0x7d6b,0x7d6c,0x7d6d,0x7d6f, -0x7d70,0x7d71,0x7d72,0x7d73,0x7d74,0x7d75,0x7d76,0x0000, -0x7d78,0x7d79,0x7d7a,0x7d7b,0x7d7c,0x7d7d,0x7d7e,0x7d7f, -0x7d80,0x7d81,0x7d82,0x7d83,0x7d84,0x7d85,0x7d86,0x7d87, -0x7d88,0x7d89,0x7d8a,0x7d8b,0x7d8c,0x7d8d,0x7d8e,0x7d8f, -0x7d90,0x7d91,0x7d92,0x7d93,0x7d94,0x7d95,0x7d96,0x7d97, -0x7d98,0x5065,0x8230,0x5251,0x996f,0x6e10,0x6e85,0x6da7, -0x5efa,0x50f5,0x59dc,0x5c06,0x6d46,0x6c5f,0x7586,0x848b, -0x6868,0x5956,0x8bb2,0x5320,0x9171,0x964d,0x8549,0x6912, -0x7901,0x7126,0x80f6,0x4ea4,0x90ca,0x6d47,0x9a84,0x5a07, -0x56bc,0x6405,0x94f0,0x77eb,0x4fa5,0x811a,0x72e1,0x89d2, -0x997a,0x7f34,0x7ede,0x527f,0x6559,0x9175,0x8f7f,0x8f83, -0x53eb,0x7a96,0x63ed,0x63a5,0x7686,0x79f8,0x8857,0x9636, -0x622a,0x52ab,0x8282,0x6854,0x6770,0x6377,0x776b,0x7aed, -0x6d01,0x7ed3,0x89e3,0x59d0,0x6212,0x85c9,0x82a5,0x754c, -0x501f,0x4ecb,0x75a5,0x8beb,0x5c4a,0x5dfe,0x7b4b,0x65a4, -0x91d1,0x4eca,0x6d25,0x895f,0x7d27,0x9526,0x4ec5,0x8c28, -0x8fdb,0x9773,0x664b,0x7981,0x8fd1,0x70ec,0x6d78,0x0000, -/* 0xbe00 */ -0x7d99,0x7d9a,0x7d9b,0x7d9c,0x7d9d,0x7d9e,0x7d9f,0x7da0, -0x7da1,0x7da2,0x7da3,0x7da4,0x7da5,0x7da7,0x7da8,0x7da9, -0x7daa,0x7dab,0x7dac,0x7dad,0x7daf,0x7db0,0x7db1,0x7db2, -0x7db3,0x7db4,0x7db5,0x7db6,0x7db7,0x7db8,0x7db9,0x7dba, -0x7dbb,0x7dbc,0x7dbd,0x7dbe,0x7dbf,0x7dc0,0x7dc1,0x7dc2, -0x7dc3,0x7dc4,0x7dc5,0x7dc6,0x7dc7,0x7dc8,0x7dc9,0x7dca, -0x7dcb,0x7dcc,0x7dcd,0x7dce,0x7dcf,0x7dd0,0x7dd1,0x7dd2, -0x7dd3,0x7dd4,0x7dd5,0x7dd6,0x7dd7,0x7dd8,0x7dd9,0x0000, -0x7dda,0x7ddb,0x7ddc,0x7ddd,0x7dde,0x7ddf,0x7de0,0x7de1, -0x7de2,0x7de3,0x7de4,0x7de5,0x7de6,0x7de7,0x7de8,0x7de9, -0x7dea,0x7deb,0x7dec,0x7ded,0x7dee,0x7def,0x7df0,0x7df1, -0x7df2,0x7df3,0x7df4,0x7df5,0x7df6,0x7df7,0x7df8,0x7df9, -0x7dfa,0x5c3d,0x52b2,0x8346,0x5162,0x830e,0x775b,0x6676, -0x9cb8,0x4eac,0x60ca,0x7cbe,0x7cb3,0x7ecf,0x4e95,0x8b66, -0x666f,0x9888,0x9759,0x5883,0x656c,0x955c,0x5f84,0x75c9, -0x9756,0x7adf,0x7ade,0x51c0,0x70af,0x7a98,0x63ea,0x7a76, -0x7ea0,0x7396,0x97ed,0x4e45,0x7078,0x4e5d,0x9152,0x53a9, -0x6551,0x65e7,0x81fc,0x8205,0x548e,0x5c31,0x759a,0x97a0, -0x62d8,0x72d9,0x75bd,0x5c45,0x9a79,0x83ca,0x5c40,0x5480, -0x77e9,0x4e3e,0x6cae,0x805a,0x62d2,0x636e,0x5de8,0x5177, -0x8ddd,0x8e1e,0x952f,0x4ff1,0x53e5,0x60e7,0x70ac,0x5267, -0x6350,0x9e43,0x5a1f,0x5026,0x7737,0x5377,0x7ee2,0x6485, -0x652b,0x6289,0x6398,0x5014,0x7235,0x89c9,0x51b3,0x8bc0, -0x7edd,0x5747,0x83cc,0x94a7,0x519b,0x541b,0x5cfb,0x0000, -/* 0xbf00 */ -0x7dfb,0x7dfc,0x7dfd,0x7dfe,0x7dff,0x7e00,0x7e01,0x7e02, -0x7e03,0x7e04,0x7e05,0x7e06,0x7e07,0x7e08,0x7e09,0x7e0a, -0x7e0b,0x7e0c,0x7e0d,0x7e0e,0x7e0f,0x7e10,0x7e11,0x7e12, -0x7e13,0x7e14,0x7e15,0x7e16,0x7e17,0x7e18,0x7e19,0x7e1a, -0x7e1b,0x7e1c,0x7e1d,0x7e1e,0x7e1f,0x7e20,0x7e21,0x7e22, -0x7e23,0x7e24,0x7e25,0x7e26,0x7e27,0x7e28,0x7e29,0x7e2a, -0x7e2b,0x7e2c,0x7e2d,0x7e2e,0x7e2f,0x7e30,0x7e31,0x7e32, -0x7e33,0x7e34,0x7e35,0x7e36,0x7e37,0x7e38,0x7e39,0x0000, -0x7e3a,0x7e3c,0x7e3d,0x7e3e,0x7e3f,0x7e40,0x7e42,0x7e43, -0x7e44,0x7e45,0x7e46,0x7e48,0x7e49,0x7e4a,0x7e4b,0x7e4c, -0x7e4d,0x7e4e,0x7e4f,0x7e50,0x7e51,0x7e52,0x7e53,0x7e54, -0x7e55,0x7e56,0x7e57,0x7e58,0x7e59,0x7e5a,0x7e5b,0x7e5c, -0x7e5d,0x4fca,0x7ae3,0x6d5a,0x90e1,0x9a8f,0x5580,0x5496, -0x5361,0x54af,0x5f00,0x63e9,0x6977,0x51ef,0x6168,0x520a, -0x582a,0x52d8,0x574e,0x780d,0x770b,0x5eb7,0x6177,0x7ce0, -0x625b,0x6297,0x4ea2,0x7095,0x8003,0x62f7,0x70e4,0x9760, -0x5777,0x82db,0x67ef,0x68f5,0x78d5,0x9897,0x79d1,0x58f3, -0x54b3,0x53ef,0x6e34,0x514b,0x523b,0x5ba2,0x8bfe,0x80af, -0x5543,0x57a6,0x6073,0x5751,0x542d,0x7a7a,0x6050,0x5b54, -0x63a7,0x62a0,0x53e3,0x6263,0x5bc7,0x67af,0x54ed,0x7a9f, -0x82e6,0x9177,0x5e93,0x88e4,0x5938,0x57ae,0x630e,0x8de8, -0x80ef,0x5757,0x7b77,0x4fa9,0x5feb,0x5bbd,0x6b3e,0x5321, -0x7b50,0x72c2,0x6846,0x77ff,0x7736,0x65f7,0x51b5,0x4e8f, -0x76d4,0x5cbf,0x7aa5,0x8475,0x594e,0x9b41,0x5080,0x0000, -/* 0xc000 */ -0x7e5e,0x7e5f,0x7e60,0x7e61,0x7e62,0x7e63,0x7e64,0x7e65, -0x7e66,0x7e67,0x7e68,0x7e69,0x7e6a,0x7e6b,0x7e6c,0x7e6d, -0x7e6e,0x7e6f,0x7e70,0x7e71,0x7e72,0x7e73,0x7e74,0x7e75, -0x7e76,0x7e77,0x7e78,0x7e79,0x7e7a,0x7e7b,0x7e7c,0x7e7d, -0x7e7e,0x7e7f,0x7e80,0x7e81,0x7e83,0x7e84,0x7e85,0x7e86, -0x7e87,0x7e88,0x7e89,0x7e8a,0x7e8b,0x7e8c,0x7e8d,0x7e8e, -0x7e8f,0x7e90,0x7e91,0x7e92,0x7e93,0x7e94,0x7e95,0x7e96, -0x7e97,0x7e98,0x7e99,0x7e9a,0x7e9c,0x7e9d,0x7e9e,0x0000, -0x7eae,0x7eb4,0x7ebb,0x7ebc,0x7ed6,0x7ee4,0x7eec,0x7ef9, -0x7f0a,0x7f10,0x7f1e,0x7f37,0x7f39,0x7f3b,0x7f3c,0x7f3d, -0x7f3e,0x7f3f,0x7f40,0x7f41,0x7f43,0x7f46,0x7f47,0x7f48, -0x7f49,0x7f4a,0x7f4b,0x7f4c,0x7f4d,0x7f4e,0x7f4f,0x7f52, -0x7f53,0x9988,0x6127,0x6e83,0x5764,0x6606,0x6346,0x56f0, -0x62ec,0x6269,0x5ed3,0x9614,0x5783,0x62c9,0x5587,0x8721, -0x814a,0x8fa3,0x5566,0x83b1,0x6765,0x8d56,0x84dd,0x5a6a, -0x680f,0x62e6,0x7bee,0x9611,0x5170,0x6f9c,0x8c30,0x63fd, -0x89c8,0x61d2,0x7f06,0x70c2,0x6ee5,0x7405,0x6994,0x72fc, -0x5eca,0x90ce,0x6717,0x6d6a,0x635e,0x52b3,0x7262,0x8001, -0x4f6c,0x59e5,0x916a,0x70d9,0x6d9d,0x52d2,0x4e50,0x96f7, -0x956d,0x857e,0x78ca,0x7d2f,0x5121,0x5792,0x64c2,0x808b, -0x7c7b,0x6cea,0x68f1,0x695e,0x51b7,0x5398,0x68a8,0x7281, -0x9ece,0x7bf1,0x72f8,0x79bb,0x6f13,0x7406,0x674e,0x91cc, -0x9ca4,0x793c,0x8389,0x8354,0x540f,0x6817,0x4e3d,0x5389, -0x52b1,0x783e,0x5386,0x5229,0x5088,0x4f8b,0x4fd0,0x0000, -/* 0xc100 */ -0x7f56,0x7f59,0x7f5b,0x7f5c,0x7f5d,0x7f5e,0x7f60,0x7f63, -0x7f64,0x7f65,0x7f66,0x7f67,0x7f6b,0x7f6c,0x7f6d,0x7f6f, -0x7f70,0x7f73,0x7f75,0x7f76,0x7f77,0x7f78,0x7f7a,0x7f7b, -0x7f7c,0x7f7d,0x7f7f,0x7f80,0x7f82,0x7f83,0x7f84,0x7f85, -0x7f86,0x7f87,0x7f88,0x7f89,0x7f8b,0x7f8d,0x7f8f,0x7f90, -0x7f91,0x7f92,0x7f93,0x7f95,0x7f96,0x7f97,0x7f98,0x7f99, -0x7f9b,0x7f9c,0x7fa0,0x7fa2,0x7fa3,0x7fa5,0x7fa6,0x7fa8, -0x7fa9,0x7faa,0x7fab,0x7fac,0x7fad,0x7fae,0x7fb1,0x0000, -0x7fb3,0x7fb4,0x7fb5,0x7fb6,0x7fb7,0x7fba,0x7fbb,0x7fbe, -0x7fc0,0x7fc2,0x7fc3,0x7fc4,0x7fc6,0x7fc7,0x7fc8,0x7fc9, -0x7fcb,0x7fcd,0x7fcf,0x7fd0,0x7fd1,0x7fd2,0x7fd3,0x7fd6, -0x7fd7,0x7fd9,0x7fda,0x7fdb,0x7fdc,0x7fdd,0x7fde,0x7fe2, -0x7fe3,0x75e2,0x7acb,0x7c92,0x6ca5,0x96b6,0x529b,0x7483, -0x54e9,0x4fe9,0x8054,0x83b2,0x8fde,0x9570,0x5ec9,0x601c, -0x6d9f,0x5e18,0x655b,0x8138,0x94fe,0x604b,0x70bc,0x7ec3, -0x7cae,0x51c9,0x6881,0x7cb1,0x826f,0x4e24,0x8f86,0x91cf, -0x667e,0x4eae,0x8c05,0x64a9,0x804a,0x50da,0x7597,0x71ce, -0x5be5,0x8fbd,0x6f66,0x4e86,0x6482,0x9563,0x5ed6,0x6599, -0x5217,0x88c2,0x70c8,0x52a3,0x730e,0x7433,0x6797,0x78f7, -0x9716,0x4e34,0x90bb,0x9cde,0x6dcb,0x51db,0x8d41,0x541d, -0x62ce,0x73b2,0x83f1,0x96f6,0x9f84,0x94c3,0x4f36,0x7f9a, -0x51cc,0x7075,0x9675,0x5cad,0x9886,0x53e6,0x4ee4,0x6e9c, -0x7409,0x69b4,0x786b,0x998f,0x7559,0x5218,0x7624,0x6d41, -0x67f3,0x516d,0x9f99,0x804b,0x5499,0x7b3c,0x7abf,0x0000, -/* 0xc200 */ -0x7fe4,0x7fe7,0x7fe8,0x7fea,0x7feb,0x7fec,0x7fed,0x7fef, -0x7ff2,0x7ff4,0x7ff5,0x7ff6,0x7ff7,0x7ff8,0x7ff9,0x7ffa, -0x7ffd,0x7ffe,0x7fff,0x8002,0x8007,0x8008,0x8009,0x800a, -0x800e,0x800f,0x8011,0x8013,0x801a,0x801b,0x801d,0x801e, -0x801f,0x8021,0x8023,0x8024,0x802b,0x802c,0x802d,0x802e, -0x802f,0x8030,0x8032,0x8034,0x8039,0x803a,0x803c,0x803e, -0x8040,0x8041,0x8044,0x8045,0x8047,0x8048,0x8049,0x804e, -0x804f,0x8050,0x8051,0x8053,0x8055,0x8056,0x8057,0x0000, -0x8059,0x805b,0x805c,0x805d,0x805e,0x805f,0x8060,0x8061, -0x8062,0x8063,0x8064,0x8065,0x8066,0x8067,0x8068,0x806b, -0x806c,0x806d,0x806e,0x806f,0x8070,0x8072,0x8073,0x8074, -0x8075,0x8076,0x8077,0x8078,0x8079,0x807a,0x807b,0x807c, -0x807d,0x9686,0x5784,0x62e2,0x9647,0x697c,0x5a04,0x6402, -0x7bd3,0x6f0f,0x964b,0x82a6,0x5362,0x9885,0x5e90,0x7089, -0x63b3,0x5364,0x864f,0x9c81,0x9e93,0x788c,0x9732,0x8def, -0x8d42,0x9e7f,0x6f5e,0x7984,0x5f55,0x9646,0x622e,0x9a74, -0x5415,0x94dd,0x4fa3,0x65c5,0x5c65,0x5c61,0x7f15,0x8651, -0x6c2f,0x5f8b,0x7387,0x6ee4,0x7eff,0x5ce6,0x631b,0x5b6a, -0x6ee6,0x5375,0x4e71,0x63a0,0x7565,0x62a1,0x8f6e,0x4f26, -0x4ed1,0x6ca6,0x7eb6,0x8bba,0x841d,0x87ba,0x7f57,0x903b, -0x9523,0x7ba9,0x9aa1,0x88f8,0x843d,0x6d1b,0x9a86,0x7edc, -0x5988,0x9ebb,0x739b,0x7801,0x8682,0x9a6c,0x9a82,0x561b, -0x5417,0x57cb,0x4e70,0x9ea6,0x5356,0x8fc8,0x8109,0x7792, -0x9992,0x86ee,0x6ee1,0x8513,0x66fc,0x6162,0x6f2b,0x0000, -/* 0xc300 */ -0x807e,0x8081,0x8082,0x8085,0x8088,0x808a,0x808d,0x808e, -0x808f,0x8090,0x8091,0x8092,0x8094,0x8095,0x8097,0x8099, -0x809e,0x80a3,0x80a6,0x80a7,0x80a8,0x80ac,0x80b0,0x80b3, -0x80b5,0x80b6,0x80b8,0x80b9,0x80bb,0x80c5,0x80c7,0x80c8, -0x80c9,0x80ca,0x80cb,0x80cf,0x80d0,0x80d1,0x80d2,0x80d3, -0x80d4,0x80d5,0x80d8,0x80df,0x80e0,0x80e2,0x80e3,0x80e6, -0x80ee,0x80f5,0x80f7,0x80f9,0x80fb,0x80fe,0x80ff,0x8100, -0x8101,0x8103,0x8104,0x8105,0x8107,0x8108,0x810b,0x0000, -0x810c,0x8115,0x8117,0x8119,0x811b,0x811c,0x811d,0x811f, -0x8120,0x8121,0x8122,0x8123,0x8124,0x8125,0x8126,0x8127, -0x8128,0x8129,0x812a,0x812b,0x812d,0x812e,0x8130,0x8133, -0x8134,0x8135,0x8137,0x8139,0x813a,0x813b,0x813c,0x813d, -0x813f,0x8c29,0x8292,0x832b,0x76f2,0x6c13,0x5fd9,0x83bd, -0x732b,0x8305,0x951a,0x6bdb,0x77db,0x94c6,0x536f,0x8302, -0x5192,0x5e3d,0x8c8c,0x8d38,0x4e48,0x73ab,0x679a,0x6885, -0x9176,0x9709,0x7164,0x6ca1,0x7709,0x5a92,0x9541,0x6bcf, -0x7f8e,0x6627,0x5bd0,0x59b9,0x5a9a,0x95e8,0x95f7,0x4eec, -0x840c,0x8499,0x6aac,0x76df,0x9530,0x731b,0x68a6,0x5b5f, -0x772f,0x919a,0x9761,0x7cdc,0x8ff7,0x8c1c,0x5f25,0x7c73, -0x79d8,0x89c5,0x6ccc,0x871c,0x5bc6,0x5e42,0x68c9,0x7720, -0x7ef5,0x5195,0x514d,0x52c9,0x5a29,0x7f05,0x9762,0x82d7, -0x63cf,0x7784,0x85d0,0x79d2,0x6e3a,0x5e99,0x5999,0x8511, -0x706d,0x6c11,0x62bf,0x76bf,0x654f,0x60af,0x95fd,0x660e, -0x879f,0x9e23,0x94ed,0x540d,0x547d,0x8c2c,0x6478,0x0000, -/* 0xc400 */ -0x8140,0x8141,0x8142,0x8143,0x8144,0x8145,0x8147,0x8149, -0x814d,0x814e,0x814f,0x8152,0x8156,0x8157,0x8158,0x815b, -0x815c,0x815d,0x815e,0x815f,0x8161,0x8162,0x8163,0x8164, -0x8166,0x8168,0x816a,0x816b,0x816c,0x816f,0x8172,0x8173, -0x8175,0x8176,0x8177,0x8178,0x8181,0x8183,0x8184,0x8185, -0x8186,0x8187,0x8189,0x818b,0x818c,0x818d,0x818e,0x8190, -0x8192,0x8193,0x8194,0x8195,0x8196,0x8197,0x8199,0x819a, -0x819e,0x819f,0x81a0,0x81a1,0x81a2,0x81a4,0x81a5,0x0000, -0x81a7,0x81a9,0x81ab,0x81ac,0x81ad,0x81ae,0x81af,0x81b0, -0x81b1,0x81b2,0x81b4,0x81b5,0x81b6,0x81b7,0x81b8,0x81b9, -0x81bc,0x81bd,0x81be,0x81bf,0x81c4,0x81c5,0x81c7,0x81c8, -0x81c9,0x81cb,0x81cd,0x81ce,0x81cf,0x81d0,0x81d1,0x81d2, -0x81d3,0x6479,0x8611,0x6a21,0x819c,0x78e8,0x6469,0x9b54, -0x62b9,0x672b,0x83ab,0x58a8,0x9ed8,0x6cab,0x6f20,0x5bde, -0x964c,0x8c0b,0x725f,0x67d0,0x62c7,0x7261,0x4ea9,0x59c6, -0x6bcd,0x5893,0x66ae,0x5e55,0x52df,0x6155,0x6728,0x76ee, -0x7766,0x7267,0x7a46,0x62ff,0x54ea,0x5450,0x94a0,0x90a3, -0x5a1c,0x7eb3,0x6c16,0x4e43,0x5976,0x8010,0x5948,0x5357, -0x7537,0x96be,0x56ca,0x6320,0x8111,0x607c,0x95f9,0x6dd6, -0x5462,0x9981,0x5185,0x5ae9,0x80fd,0x59ae,0x9713,0x502a, -0x6ce5,0x5c3c,0x62df,0x4f60,0x533f,0x817b,0x9006,0x6eba, -0x852b,0x62c8,0x5e74,0x78be,0x64b5,0x637b,0x5ff5,0x5a18, -0x917f,0x9e1f,0x5c3f,0x634f,0x8042,0x5b7d,0x556e,0x954a, -0x954d,0x6d85,0x60a8,0x67e0,0x72de,0x51dd,0x5b81,0x0000, -/* 0xc500 */ -0x81d4,0x81d5,0x81d6,0x81d7,0x81d8,0x81d9,0x81da,0x81db, -0x81dc,0x81dd,0x81de,0x81df,0x81e0,0x81e1,0x81e2,0x81e4, -0x81e5,0x81e6,0x81e8,0x81e9,0x81eb,0x81ee,0x81ef,0x81f0, -0x81f1,0x81f2,0x81f5,0x81f6,0x81f7,0x81f8,0x81f9,0x81fa, -0x81fd,0x81ff,0x8203,0x8207,0x8208,0x8209,0x820a,0x820b, -0x820e,0x820f,0x8211,0x8213,0x8215,0x8216,0x8217,0x8218, -0x8219,0x821a,0x821d,0x8220,0x8224,0x8225,0x8226,0x8227, -0x8229,0x822e,0x8232,0x823a,0x823c,0x823d,0x823f,0x0000, -0x8240,0x8241,0x8242,0x8243,0x8245,0x8246,0x8248,0x824a, -0x824c,0x824d,0x824e,0x8250,0x8251,0x8252,0x8253,0x8254, -0x8255,0x8256,0x8257,0x8259,0x825b,0x825c,0x825d,0x825e, -0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266,0x8267, -0x8269,0x62e7,0x6cde,0x725b,0x626d,0x94ae,0x7ebd,0x8113, -0x6d53,0x519c,0x5f04,0x5974,0x52aa,0x6012,0x5973,0x6696, -0x8650,0x759f,0x632a,0x61e6,0x7cef,0x8bfa,0x54e6,0x6b27, -0x9e25,0x6bb4,0x85d5,0x5455,0x5076,0x6ca4,0x556a,0x8db4, -0x722c,0x5e15,0x6015,0x7436,0x62cd,0x6392,0x724c,0x5f98, -0x6e43,0x6d3e,0x6500,0x6f58,0x76d8,0x78d0,0x76fc,0x7554, -0x5224,0x53db,0x4e53,0x5e9e,0x65c1,0x802a,0x80d6,0x629b, -0x5486,0x5228,0x70ae,0x888d,0x8dd1,0x6ce1,0x5478,0x80da, -0x57f9,0x88f4,0x8d54,0x966a,0x914d,0x4f69,0x6c9b,0x55b7, -0x76c6,0x7830,0x62a8,0x70f9,0x6f8e,0x5f6d,0x84ec,0x68da, -0x787c,0x7bf7,0x81a8,0x670b,0x9e4f,0x6367,0x78b0,0x576f, -0x7812,0x9739,0x6279,0x62ab,0x5288,0x7435,0x6bd7,0x0000, -/* 0xc600 */ -0x826a,0x826b,0x826c,0x826d,0x8271,0x8275,0x8276,0x8277, -0x8278,0x827b,0x827c,0x8280,0x8281,0x8283,0x8285,0x8286, -0x8287,0x8289,0x828c,0x8290,0x8293,0x8294,0x8295,0x8296, -0x829a,0x829b,0x829e,0x82a0,0x82a2,0x82a3,0x82a7,0x82b2, -0x82b5,0x82b6,0x82ba,0x82bb,0x82bc,0x82bf,0x82c0,0x82c2, -0x82c3,0x82c5,0x82c6,0x82c9,0x82d0,0x82d6,0x82d9,0x82da, -0x82dd,0x82e2,0x82e7,0x82e8,0x82e9,0x82ea,0x82ec,0x82ed, -0x82ee,0x82f0,0x82f2,0x82f3,0x82f5,0x82f6,0x82f8,0x0000, -0x82fa,0x82fc,0x82fd,0x82fe,0x82ff,0x8300,0x830a,0x830b, -0x830d,0x8310,0x8312,0x8313,0x8316,0x8318,0x8319,0x831d, -0x831e,0x831f,0x8320,0x8321,0x8322,0x8323,0x8324,0x8325, -0x8326,0x8329,0x832a,0x832e,0x8330,0x8332,0x8337,0x833b, -0x833d,0x5564,0x813e,0x75b2,0x76ae,0x5339,0x75de,0x50fb, -0x5c41,0x8b6c,0x7bc7,0x504f,0x7247,0x9a97,0x98d8,0x6f02, -0x74e2,0x7968,0x6487,0x77a5,0x62fc,0x9891,0x8d2b,0x54c1, -0x8058,0x4e52,0x576a,0x82f9,0x840d,0x5e73,0x51ed,0x74f6, -0x8bc4,0x5c4f,0x5761,0x6cfc,0x9887,0x5a46,0x7834,0x9b44, -0x8feb,0x7c95,0x5256,0x6251,0x94fa,0x4ec6,0x8386,0x8461, -0x83e9,0x84b2,0x57d4,0x6734,0x5703,0x666e,0x6d66,0x8c31, -0x66dd,0x7011,0x671f,0x6b3a,0x6816,0x621a,0x59bb,0x4e03, -0x51c4,0x6f06,0x67d2,0x6c8f,0x5176,0x68cb,0x5947,0x6b67, -0x7566,0x5d0e,0x8110,0x9f50,0x65d7,0x7948,0x7941,0x9a91, -0x8d77,0x5c82,0x4e5e,0x4f01,0x542f,0x5951,0x780c,0x5668, -0x6c14,0x8fc4,0x5f03,0x6c7d,0x6ce3,0x8bab,0x6390,0x0000, -/* 0xc700 */ -0x833e,0x833f,0x8341,0x8342,0x8344,0x8345,0x8348,0x834a, -0x834b,0x834c,0x834d,0x834e,0x8353,0x8355,0x8356,0x8357, -0x8358,0x8359,0x835d,0x8362,0x8370,0x8371,0x8372,0x8373, -0x8374,0x8375,0x8376,0x8379,0x837a,0x837e,0x837f,0x8380, -0x8381,0x8382,0x8383,0x8384,0x8387,0x8388,0x838a,0x838b, -0x838c,0x838d,0x838f,0x8390,0x8391,0x8394,0x8395,0x8396, -0x8397,0x8399,0x839a,0x839d,0x839f,0x83a1,0x83a2,0x83a3, -0x83a4,0x83a5,0x83a6,0x83a7,0x83ac,0x83ad,0x83ae,0x0000, -0x83af,0x83b5,0x83bb,0x83be,0x83bf,0x83c2,0x83c3,0x83c4, -0x83c6,0x83c8,0x83c9,0x83cb,0x83cd,0x83ce,0x83d0,0x83d1, -0x83d2,0x83d3,0x83d5,0x83d7,0x83d9,0x83da,0x83db,0x83de, -0x83e2,0x83e3,0x83e4,0x83e6,0x83e7,0x83e8,0x83eb,0x83ec, -0x83ed,0x6070,0x6d3d,0x7275,0x6266,0x948e,0x94c5,0x5343, -0x8fc1,0x7b7e,0x4edf,0x8c26,0x4e7e,0x9ed4,0x94b1,0x94b3, -0x524d,0x6f5c,0x9063,0x6d45,0x8c34,0x5811,0x5d4c,0x6b20, -0x6b49,0x67aa,0x545b,0x8154,0x7f8c,0x5899,0x8537,0x5f3a, -0x62a2,0x6a47,0x9539,0x6572,0x6084,0x6865,0x77a7,0x4e54, -0x4fa8,0x5de7,0x9798,0x64ac,0x7fd8,0x5ced,0x4fcf,0x7a8d, -0x5207,0x8304,0x4e14,0x602f,0x7a83,0x94a6,0x4fb5,0x4eb2, -0x79e6,0x7434,0x52e4,0x82b9,0x64d2,0x79bd,0x5bdd,0x6c81, -0x9752,0x8f7b,0x6c22,0x503e,0x537f,0x6e05,0x64ce,0x6674, -0x6c30,0x60c5,0x9877,0x8bf7,0x5e86,0x743c,0x7a77,0x79cb, -0x4e18,0x90b1,0x7403,0x6c42,0x56da,0x914b,0x6cc5,0x8d8b, -0x533a,0x86c6,0x66f2,0x8eaf,0x5c48,0x9a71,0x6e20,0x0000, -/* 0xc800 */ -0x83ee,0x83ef,0x83f3,0x83f4,0x83f5,0x83f6,0x83f7,0x83fa, -0x83fb,0x83fc,0x83fe,0x83ff,0x8400,0x8402,0x8405,0x8407, -0x8408,0x8409,0x840a,0x8410,0x8412,0x8413,0x8414,0x8415, -0x8416,0x8417,0x8419,0x841a,0x841b,0x841e,0x841f,0x8420, -0x8421,0x8422,0x8423,0x8429,0x842a,0x842b,0x842c,0x842d, -0x842e,0x842f,0x8430,0x8432,0x8433,0x8434,0x8435,0x8436, -0x8437,0x8439,0x843a,0x843b,0x843e,0x843f,0x8440,0x8441, -0x8442,0x8443,0x8444,0x8445,0x8447,0x8448,0x8449,0x0000, -0x844a,0x844b,0x844c,0x844d,0x844e,0x844f,0x8450,0x8452, -0x8453,0x8454,0x8455,0x8456,0x8458,0x845d,0x845e,0x845f, -0x8460,0x8462,0x8464,0x8465,0x8466,0x8467,0x8468,0x846a, -0x846e,0x846f,0x8470,0x8472,0x8474,0x8477,0x8479,0x847b, -0x847c,0x53d6,0x5a36,0x9f8b,0x8da3,0x53bb,0x5708,0x98a7, -0x6743,0x919b,0x6cc9,0x5168,0x75ca,0x62f3,0x72ac,0x5238, -0x529d,0x7f3a,0x7094,0x7638,0x5374,0x9e4a,0x69b7,0x786e, -0x96c0,0x88d9,0x7fa4,0x7136,0x71c3,0x5189,0x67d3,0x74e4, -0x58e4,0x6518,0x56b7,0x8ba9,0x9976,0x6270,0x7ed5,0x60f9, -0x70ed,0x58ec,0x4ec1,0x4eba,0x5fcd,0x97e7,0x4efb,0x8ba4, -0x5203,0x598a,0x7eab,0x6254,0x4ecd,0x65e5,0x620e,0x8338, -0x84c9,0x8363,0x878d,0x7194,0x6eb6,0x5bb9,0x7ed2,0x5197, -0x63c9,0x67d4,0x8089,0x8339,0x8815,0x5112,0x5b7a,0x5982, -0x8fb1,0x4e73,0x6c5d,0x5165,0x8925,0x8f6f,0x962e,0x854a, -0x745e,0x9510,0x95f0,0x6da6,0x82e5,0x5f31,0x6492,0x6d12, -0x8428,0x816e,0x9cc3,0x585e,0x8d5b,0x4e09,0x53c1,0x0000, -/* 0xc900 */ -0x847d,0x847e,0x847f,0x8480,0x8481,0x8483,0x8484,0x8485, -0x8486,0x848a,0x848d,0x848f,0x8490,0x8491,0x8492,0x8493, -0x8494,0x8495,0x8496,0x8498,0x849a,0x849b,0x849d,0x849e, -0x849f,0x84a0,0x84a2,0x84a3,0x84a4,0x84a5,0x84a6,0x84a7, -0x84a8,0x84a9,0x84aa,0x84ab,0x84ac,0x84ad,0x84ae,0x84b0, -0x84b1,0x84b3,0x84b5,0x84b6,0x84b7,0x84bb,0x84bc,0x84be, -0x84c0,0x84c2,0x84c3,0x84c5,0x84c6,0x84c7,0x84c8,0x84cb, -0x84cc,0x84ce,0x84cf,0x84d2,0x84d4,0x84d5,0x84d7,0x0000, -0x84d8,0x84d9,0x84da,0x84db,0x84dc,0x84de,0x84e1,0x84e2, -0x84e4,0x84e7,0x84e8,0x84e9,0x84ea,0x84eb,0x84ed,0x84ee, -0x84ef,0x84f1,0x84f2,0x84f3,0x84f4,0x84f5,0x84f6,0x84f7, -0x84f8,0x84f9,0x84fa,0x84fb,0x84fd,0x84fe,0x8500,0x8501, -0x8502,0x4f1e,0x6563,0x6851,0x55d3,0x4e27,0x6414,0x9a9a, -0x626b,0x5ac2,0x745f,0x8272,0x6da9,0x68ee,0x50e7,0x838e, -0x7802,0x6740,0x5239,0x6c99,0x7eb1,0x50bb,0x5565,0x715e, -0x7b5b,0x6652,0x73ca,0x82eb,0x6749,0x5c71,0x5220,0x717d, -0x886b,0x95ea,0x9655,0x64c5,0x8d61,0x81b3,0x5584,0x6c55, -0x6247,0x7f2e,0x5892,0x4f24,0x5546,0x8d4f,0x664c,0x4e0a, -0x5c1a,0x88f3,0x68a2,0x634e,0x7a0d,0x70e7,0x828d,0x52fa, -0x97f6,0x5c11,0x54e8,0x90b5,0x7ecd,0x5962,0x8d4a,0x86c7, -0x820c,0x820d,0x8d66,0x6444,0x5c04,0x6151,0x6d89,0x793e, -0x8bbe,0x7837,0x7533,0x547b,0x4f38,0x8eab,0x6df1,0x5a20, -0x7ec5,0x795e,0x6c88,0x5ba1,0x5a76,0x751a,0x80be,0x614e, -0x6e17,0x58f0,0x751f,0x7525,0x7272,0x5347,0x7ef3,0x0000, -/* 0xca00 */ -0x8503,0x8504,0x8505,0x8506,0x8507,0x8508,0x8509,0x850a, -0x850b,0x850d,0x850e,0x850f,0x8510,0x8512,0x8514,0x8515, -0x8516,0x8518,0x8519,0x851b,0x851c,0x851d,0x851e,0x8520, -0x8522,0x8523,0x8524,0x8525,0x8526,0x8527,0x8528,0x8529, -0x852a,0x852d,0x852e,0x852f,0x8530,0x8531,0x8532,0x8533, -0x8534,0x8535,0x8536,0x853e,0x853f,0x8540,0x8541,0x8542, -0x8544,0x8545,0x8546,0x8547,0x854b,0x854c,0x854d,0x854e, -0x854f,0x8550,0x8551,0x8552,0x8553,0x8554,0x8555,0x0000, -0x8557,0x8558,0x855a,0x855b,0x855c,0x855d,0x855f,0x8560, -0x8561,0x8562,0x8563,0x8565,0x8566,0x8567,0x8569,0x856a, -0x856b,0x856c,0x856d,0x856e,0x856f,0x8570,0x8571,0x8573, -0x8575,0x8576,0x8577,0x8578,0x857c,0x857d,0x857f,0x8580, -0x8581,0x7701,0x76db,0x5269,0x80dc,0x5723,0x5e08,0x5931, -0x72ee,0x65bd,0x6e7f,0x8bd7,0x5c38,0x8671,0x5341,0x77f3, -0x62fe,0x65f6,0x4ec0,0x98df,0x8680,0x5b9e,0x8bc6,0x53f2, -0x77e2,0x4f7f,0x5c4e,0x9a76,0x59cb,0x5f0f,0x793a,0x58eb, -0x4e16,0x67ff,0x4e8b,0x62ed,0x8a93,0x901d,0x52bf,0x662f, -0x55dc,0x566c,0x9002,0x4ed5,0x4f8d,0x91ca,0x9970,0x6c0f, -0x5e02,0x6043,0x5ba4,0x89c6,0x8bd5,0x6536,0x624b,0x9996, -0x5b88,0x5bff,0x6388,0x552e,0x53d7,0x7626,0x517d,0x852c, -0x67a2,0x68b3,0x6b8a,0x6292,0x8f93,0x53d4,0x8212,0x6dd1, -0x758f,0x4e66,0x8d4e,0x5b70,0x719f,0x85af,0x6691,0x66d9, -0x7f72,0x8700,0x9ecd,0x9f20,0x5c5e,0x672f,0x8ff0,0x6811, -0x675f,0x620d,0x7ad6,0x5885,0x5eb6,0x6570,0x6f31,0x0000, -/* 0xcb00 */ -0x8582,0x8583,0x8586,0x8588,0x8589,0x858a,0x858b,0x858c, -0x858d,0x858e,0x8590,0x8591,0x8592,0x8593,0x8594,0x8595, -0x8596,0x8597,0x8598,0x8599,0x859a,0x859d,0x859e,0x859f, -0x85a0,0x85a1,0x85a2,0x85a3,0x85a5,0x85a6,0x85a7,0x85a9, -0x85ab,0x85ac,0x85ad,0x85b1,0x85b2,0x85b3,0x85b4,0x85b5, -0x85b6,0x85b8,0x85ba,0x85bb,0x85bc,0x85bd,0x85be,0x85bf, -0x85c0,0x85c2,0x85c3,0x85c4,0x85c5,0x85c6,0x85c7,0x85c8, -0x85ca,0x85cb,0x85cc,0x85cd,0x85ce,0x85d1,0x85d2,0x0000, -0x85d4,0x85d6,0x85d7,0x85d8,0x85d9,0x85da,0x85db,0x85dd, -0x85de,0x85df,0x85e0,0x85e1,0x85e2,0x85e3,0x85e5,0x85e6, -0x85e7,0x85e8,0x85ea,0x85eb,0x85ec,0x85ed,0x85ee,0x85ef, -0x85f0,0x85f1,0x85f2,0x85f3,0x85f4,0x85f5,0x85f6,0x85f7, -0x85f8,0x6055,0x5237,0x800d,0x6454,0x8870,0x7529,0x5e05, -0x6813,0x62f4,0x971c,0x53cc,0x723d,0x8c01,0x6c34,0x7761, -0x7a0e,0x542e,0x77ac,0x987a,0x821c,0x8bf4,0x7855,0x6714, -0x70c1,0x65af,0x6495,0x5636,0x601d,0x79c1,0x53f8,0x4e1d, -0x6b7b,0x8086,0x5bfa,0x55e3,0x56db,0x4f3a,0x4f3c,0x9972, -0x5df3,0x677e,0x8038,0x6002,0x9882,0x9001,0x5b8b,0x8bbc, -0x8bf5,0x641c,0x8258,0x64de,0x55fd,0x82cf,0x9165,0x4fd7, -0x7d20,0x901f,0x7c9f,0x50f3,0x5851,0x6eaf,0x5bbf,0x8bc9, -0x8083,0x9178,0x849c,0x7b97,0x867d,0x968b,0x968f,0x7ee5, -0x9ad3,0x788e,0x5c81,0x7a57,0x9042,0x96a7,0x795f,0x5b59, -0x635f,0x7b0b,0x84d1,0x68ad,0x5506,0x7f29,0x7410,0x7d22, -0x9501,0x6240,0x584c,0x4ed6,0x5b83,0x5979,0x5854,0x0000, -/* 0xcc00 */ -0x85f9,0x85fa,0x85fc,0x85fd,0x85fe,0x8600,0x8601,0x8602, -0x8603,0x8604,0x8606,0x8607,0x8608,0x8609,0x860a,0x860b, -0x860c,0x860d,0x860e,0x860f,0x8610,0x8612,0x8613,0x8614, -0x8615,0x8617,0x8618,0x8619,0x861a,0x861b,0x861c,0x861d, -0x861e,0x861f,0x8620,0x8621,0x8622,0x8623,0x8624,0x8625, -0x8626,0x8628,0x862a,0x862b,0x862c,0x862d,0x862e,0x862f, -0x8630,0x8631,0x8632,0x8633,0x8634,0x8635,0x8636,0x8637, -0x8639,0x863a,0x863b,0x863d,0x863e,0x863f,0x8640,0x0000, -0x8641,0x8642,0x8643,0x8644,0x8645,0x8646,0x8647,0x8648, -0x8649,0x864a,0x864b,0x864c,0x8652,0x8653,0x8655,0x8656, -0x8657,0x8658,0x8659,0x865b,0x865c,0x865d,0x865f,0x8660, -0x8661,0x8663,0x8664,0x8665,0x8666,0x8667,0x8668,0x8669, -0x866a,0x736d,0x631e,0x8e4b,0x8e0f,0x80ce,0x82d4,0x62ac, -0x53f0,0x6cf0,0x915e,0x592a,0x6001,0x6c70,0x574d,0x644a, -0x8d2a,0x762b,0x6ee9,0x575b,0x6a80,0x75f0,0x6f6d,0x8c2d, -0x8c08,0x5766,0x6bef,0x8892,0x78b3,0x63a2,0x53f9,0x70ad, -0x6c64,0x5858,0x642a,0x5802,0x68e0,0x819b,0x5510,0x7cd6, -0x5018,0x8eba,0x6dcc,0x8d9f,0x70eb,0x638f,0x6d9b,0x6ed4, -0x7ee6,0x8404,0x6843,0x9003,0x6dd8,0x9676,0x8ba8,0x5957, -0x7279,0x85e4,0x817e,0x75bc,0x8a8a,0x68af,0x5254,0x8e22, -0x9511,0x63d0,0x9898,0x8e44,0x557c,0x4f53,0x66ff,0x568f, -0x60d5,0x6d95,0x5243,0x5c49,0x5929,0x6dfb,0x586b,0x7530, -0x751c,0x606c,0x8214,0x8146,0x6311,0x6761,0x8fe2,0x773a, -0x8df3,0x8d34,0x94c1,0x5e16,0x5385,0x542c,0x70c3,0x0000, -/* 0xcd00 */ -0x866d,0x866f,0x8670,0x8672,0x8673,0x8674,0x8675,0x8676, -0x8677,0x8678,0x8683,0x8684,0x8685,0x8686,0x8687,0x8688, -0x8689,0x868e,0x868f,0x8690,0x8691,0x8692,0x8694,0x8696, -0x8697,0x8698,0x8699,0x869a,0x869b,0x869e,0x869f,0x86a0, -0x86a1,0x86a2,0x86a5,0x86a6,0x86ab,0x86ad,0x86ae,0x86b2, -0x86b3,0x86b7,0x86b8,0x86b9,0x86bb,0x86bc,0x86bd,0x86be, -0x86bf,0x86c1,0x86c2,0x86c3,0x86c5,0x86c8,0x86cc,0x86cd, -0x86d2,0x86d3,0x86d5,0x86d6,0x86d7,0x86da,0x86dc,0x0000, -0x86dd,0x86e0,0x86e1,0x86e2,0x86e3,0x86e5,0x86e6,0x86e7, -0x86e8,0x86ea,0x86eb,0x86ec,0x86ef,0x86f5,0x86f6,0x86f7, -0x86fa,0x86fb,0x86fc,0x86fd,0x86ff,0x8701,0x8704,0x8705, -0x8706,0x870b,0x870c,0x870e,0x870f,0x8710,0x8711,0x8714, -0x8716,0x6c40,0x5ef7,0x505c,0x4ead,0x5ead,0x633a,0x8247, -0x901a,0x6850,0x916e,0x77b3,0x540c,0x94dc,0x5f64,0x7ae5, -0x6876,0x6345,0x7b52,0x7edf,0x75db,0x5077,0x6295,0x5934, -0x900f,0x51f8,0x79c3,0x7a81,0x56fe,0x5f92,0x9014,0x6d82, -0x5c60,0x571f,0x5410,0x5154,0x6e4d,0x56e2,0x63a8,0x9893, -0x817f,0x8715,0x892a,0x9000,0x541e,0x5c6f,0x81c0,0x62d6, -0x6258,0x8131,0x9e35,0x9640,0x9a6e,0x9a7c,0x692d,0x59a5, -0x62d3,0x553e,0x6316,0x54c7,0x86d9,0x6d3c,0x5a03,0x74e6, -0x889c,0x6b6a,0x5916,0x8c4c,0x5f2f,0x6e7e,0x73a9,0x987d, -0x4e38,0x70f7,0x5b8c,0x7897,0x633d,0x665a,0x7696,0x60cb, -0x5b9b,0x5a49,0x4e07,0x8155,0x6c6a,0x738b,0x4ea1,0x6789, -0x7f51,0x5f80,0x65fa,0x671b,0x5fd8,0x5984,0x5a01,0x0000, -/* 0xce00 */ -0x8719,0x871b,0x871d,0x871f,0x8720,0x8724,0x8726,0x8727, -0x8728,0x872a,0x872b,0x872c,0x872d,0x872f,0x8730,0x8732, -0x8733,0x8735,0x8736,0x8738,0x8739,0x873a,0x873c,0x873d, -0x8740,0x8741,0x8742,0x8743,0x8744,0x8745,0x8746,0x874a, -0x874b,0x874d,0x874f,0x8750,0x8751,0x8752,0x8754,0x8755, -0x8756,0x8758,0x875a,0x875b,0x875c,0x875d,0x875e,0x875f, -0x8761,0x8762,0x8766,0x8767,0x8768,0x8769,0x876a,0x876b, -0x876c,0x876d,0x876f,0x8771,0x8772,0x8773,0x8775,0x0000, -0x8777,0x8778,0x8779,0x877a,0x877f,0x8780,0x8781,0x8784, -0x8786,0x8787,0x8789,0x878a,0x878c,0x878e,0x878f,0x8790, -0x8791,0x8792,0x8794,0x8795,0x8796,0x8798,0x8799,0x879a, -0x879b,0x879c,0x879d,0x879e,0x87a0,0x87a1,0x87a2,0x87a3, -0x87a4,0x5dcd,0x5fae,0x5371,0x97e6,0x8fdd,0x6845,0x56f4, -0x552f,0x60df,0x4e3a,0x6f4d,0x7ef4,0x82c7,0x840e,0x59d4, -0x4f1f,0x4f2a,0x5c3e,0x7eac,0x672a,0x851a,0x5473,0x754f, -0x80c3,0x5582,0x9b4f,0x4f4d,0x6e2d,0x8c13,0x5c09,0x6170, -0x536b,0x761f,0x6e29,0x868a,0x6587,0x95fb,0x7eb9,0x543b, -0x7a33,0x7d0a,0x95ee,0x55e1,0x7fc1,0x74ee,0x631d,0x8717, -0x6da1,0x7a9d,0x6211,0x65a1,0x5367,0x63e1,0x6c83,0x5deb, -0x545c,0x94a8,0x4e4c,0x6c61,0x8bec,0x5c4b,0x65e0,0x829c, -0x68a7,0x543e,0x5434,0x6bcb,0x6b66,0x4e94,0x6342,0x5348, -0x821e,0x4f0d,0x4fae,0x575e,0x620a,0x96fe,0x6664,0x7269, -0x52ff,0x52a1,0x609f,0x8bef,0x6614,0x7199,0x6790,0x897f, -0x7852,0x77fd,0x6670,0x563b,0x5438,0x9521,0x727a,0x0000, -/* 0xcf00 */ -0x87a5,0x87a6,0x87a7,0x87a9,0x87aa,0x87ae,0x87b0,0x87b1, -0x87b2,0x87b4,0x87b6,0x87b7,0x87b8,0x87b9,0x87bb,0x87bc, -0x87be,0x87bf,0x87c1,0x87c2,0x87c3,0x87c4,0x87c5,0x87c7, -0x87c8,0x87c9,0x87cc,0x87cd,0x87ce,0x87cf,0x87d0,0x87d4, -0x87d5,0x87d6,0x87d7,0x87d8,0x87d9,0x87da,0x87dc,0x87dd, -0x87de,0x87df,0x87e1,0x87e2,0x87e3,0x87e4,0x87e6,0x87e7, -0x87e8,0x87e9,0x87eb,0x87ec,0x87ed,0x87ef,0x87f0,0x87f1, -0x87f2,0x87f3,0x87f4,0x87f5,0x87f6,0x87f7,0x87f8,0x0000, -0x87fa,0x87fb,0x87fc,0x87fd,0x87ff,0x8800,0x8801,0x8802, -0x8804,0x8805,0x8806,0x8807,0x8808,0x8809,0x880b,0x880c, -0x880d,0x880e,0x880f,0x8810,0x8811,0x8812,0x8814,0x8817, -0x8818,0x8819,0x881a,0x881c,0x881d,0x881e,0x881f,0x8820, -0x8823,0x7a00,0x606f,0x5e0c,0x6089,0x819d,0x5915,0x60dc, -0x7184,0x70ef,0x6eaa,0x6c50,0x7280,0x6a84,0x88ad,0x5e2d, -0x4e60,0x5ab3,0x559c,0x94e3,0x6d17,0x7cfb,0x9699,0x620f, -0x7ec6,0x778e,0x867e,0x5323,0x971e,0x8f96,0x6687,0x5ce1, -0x4fa0,0x72ed,0x4e0b,0x53a6,0x590f,0x5413,0x6380,0x9528, -0x5148,0x4ed9,0x9c9c,0x7ea4,0x54b8,0x8d24,0x8854,0x8237, -0x95f2,0x6d8e,0x5f26,0x5acc,0x663e,0x9669,0x73b0,0x732e, -0x53bf,0x817a,0x9985,0x7fa1,0x5baa,0x9677,0x9650,0x7ebf, -0x76f8,0x53a2,0x9576,0x9999,0x7bb1,0x8944,0x6e58,0x4e61, -0x7fd4,0x7965,0x8be6,0x60f3,0x54cd,0x4eab,0x9879,0x5df7, -0x6a61,0x50cf,0x5411,0x8c61,0x8427,0x785d,0x9704,0x524a, -0x54ee,0x56a3,0x9500,0x6d88,0x5bb5,0x6dc6,0x6653,0x0000, -/* 0xd000 */ -0x8824,0x8825,0x8826,0x8827,0x8828,0x8829,0x882a,0x882b, -0x882c,0x882d,0x882e,0x882f,0x8830,0x8831,0x8833,0x8834, -0x8835,0x8836,0x8837,0x8838,0x883a,0x883b,0x883d,0x883e, -0x883f,0x8841,0x8842,0x8843,0x8846,0x8847,0x8848,0x8849, -0x884a,0x884b,0x884e,0x884f,0x8850,0x8851,0x8852,0x8853, -0x8855,0x8856,0x8858,0x885a,0x885b,0x885c,0x885d,0x885e, -0x885f,0x8860,0x8866,0x8867,0x886a,0x886d,0x886f,0x8871, -0x8873,0x8874,0x8875,0x8876,0x8878,0x8879,0x887a,0x0000, -0x887b,0x887c,0x8880,0x8883,0x8886,0x8887,0x8889,0x888a, -0x888c,0x888e,0x888f,0x8890,0x8891,0x8893,0x8894,0x8895, -0x8897,0x8898,0x8899,0x889a,0x889b,0x889d,0x889e,0x889f, -0x88a0,0x88a1,0x88a3,0x88a5,0x88a6,0x88a7,0x88a8,0x88a9, -0x88aa,0x5c0f,0x5b5d,0x6821,0x8096,0x5578,0x7b11,0x6548, -0x6954,0x4e9b,0x6b47,0x874e,0x978b,0x534f,0x631f,0x643a, -0x90aa,0x659c,0x80c1,0x8c10,0x5199,0x68b0,0x5378,0x87f9, -0x61c8,0x6cc4,0x6cfb,0x8c22,0x5c51,0x85aa,0x82af,0x950c, -0x6b23,0x8f9b,0x65b0,0x5ffb,0x5fc3,0x4fe1,0x8845,0x661f, -0x8165,0x7329,0x60fa,0x5174,0x5211,0x578b,0x5f62,0x90a2, -0x884c,0x9192,0x5e78,0x674f,0x6027,0x59d3,0x5144,0x51f6, -0x80f8,0x5308,0x6c79,0x96c4,0x718a,0x4f11,0x4fee,0x7f9e, -0x673d,0x55c5,0x9508,0x79c0,0x8896,0x7ee3,0x589f,0x620c, -0x9700,0x865a,0x5618,0x987b,0x5f90,0x8bb8,0x84c4,0x9157, -0x53d9,0x65ed,0x5e8f,0x755c,0x6064,0x7d6e,0x5a7f,0x7eea, -0x7eed,0x8f69,0x55a7,0x5ba3,0x60ac,0x65cb,0x7384,0x0000, -/* 0xd100 */ -0x88ac,0x88ae,0x88af,0x88b0,0x88b2,0x88b3,0x88b4,0x88b5, -0x88b6,0x88b8,0x88b9,0x88ba,0x88bb,0x88bd,0x88be,0x88bf, -0x88c0,0x88c3,0x88c4,0x88c7,0x88c8,0x88ca,0x88cb,0x88cc, -0x88cd,0x88cf,0x88d0,0x88d1,0x88d3,0x88d6,0x88d7,0x88da, -0x88db,0x88dc,0x88dd,0x88de,0x88e0,0x88e1,0x88e6,0x88e7, -0x88e9,0x88ea,0x88eb,0x88ec,0x88ed,0x88ee,0x88ef,0x88f2, -0x88f5,0x88f6,0x88f7,0x88fa,0x88fb,0x88fd,0x88ff,0x8900, -0x8901,0x8903,0x8904,0x8905,0x8906,0x8907,0x8908,0x0000, -0x8909,0x890b,0x890c,0x890d,0x890e,0x890f,0x8911,0x8914, -0x8915,0x8916,0x8917,0x8918,0x891c,0x891d,0x891e,0x891f, -0x8920,0x8922,0x8923,0x8924,0x8926,0x8927,0x8928,0x8929, -0x892c,0x892d,0x892e,0x892f,0x8931,0x8932,0x8933,0x8935, -0x8937,0x9009,0x7663,0x7729,0x7eda,0x9774,0x859b,0x5b66, -0x7a74,0x96ea,0x8840,0x52cb,0x718f,0x5faa,0x65ec,0x8be2, -0x5bfb,0x9a6f,0x5de1,0x6b89,0x6c5b,0x8bad,0x8baf,0x900a, -0x8fc5,0x538b,0x62bc,0x9e26,0x9e2d,0x5440,0x4e2b,0x82bd, -0x7259,0x869c,0x5d16,0x8859,0x6daf,0x96c5,0x54d1,0x4e9a, -0x8bb6,0x7109,0x54bd,0x9609,0x70df,0x6df9,0x76d0,0x4e25, -0x7814,0x8712,0x5ca9,0x5ef6,0x8a00,0x989c,0x960e,0x708e, -0x6cbf,0x5944,0x63a9,0x773c,0x884d,0x6f14,0x8273,0x5830, -0x71d5,0x538c,0x781a,0x96c1,0x5501,0x5f66,0x7130,0x5bb4, -0x8c1a,0x9a8c,0x6b83,0x592e,0x9e2f,0x79e7,0x6768,0x626c, -0x4f6f,0x75a1,0x7f8a,0x6d0b,0x9633,0x6c27,0x4ef0,0x75d2, -0x517b,0x6837,0x6f3e,0x9080,0x8170,0x5996,0x7476,0x0000, -/* 0xd200 */ -0x8938,0x8939,0x893a,0x893b,0x893c,0x893d,0x893e,0x893f, -0x8940,0x8942,0x8943,0x8945,0x8946,0x8947,0x8948,0x8949, -0x894a,0x894b,0x894c,0x894d,0x894e,0x894f,0x8950,0x8951, -0x8952,0x8953,0x8954,0x8955,0x8956,0x8957,0x8958,0x8959, -0x895a,0x895b,0x895c,0x895d,0x8960,0x8961,0x8962,0x8963, -0x8964,0x8965,0x8967,0x8968,0x8969,0x896a,0x896b,0x896c, -0x896d,0x896e,0x896f,0x8970,0x8971,0x8972,0x8973,0x8974, -0x8975,0x8976,0x8977,0x8978,0x8979,0x897a,0x897c,0x0000, -0x897d,0x897e,0x8980,0x8982,0x8984,0x8985,0x8987,0x8988, -0x8989,0x898a,0x898b,0x898c,0x898d,0x898e,0x898f,0x8990, -0x8991,0x8992,0x8993,0x8994,0x8995,0x8996,0x8997,0x8998, -0x8999,0x899a,0x899b,0x899c,0x899d,0x899e,0x899f,0x89a0, -0x89a1,0x6447,0x5c27,0x9065,0x7a91,0x8c23,0x59da,0x54ac, -0x8200,0x836f,0x8981,0x8000,0x6930,0x564e,0x8036,0x7237, -0x91ce,0x51b6,0x4e5f,0x9875,0x6396,0x4e1a,0x53f6,0x66f3, -0x814b,0x591c,0x6db2,0x4e00,0x58f9,0x533b,0x63d6,0x94f1, -0x4f9d,0x4f0a,0x8863,0x9890,0x5937,0x9057,0x79fb,0x4eea, -0x80f0,0x7591,0x6c82,0x5b9c,0x59e8,0x5f5d,0x6905,0x8681, -0x501a,0x5df2,0x4e59,0x77e3,0x4ee5,0x827a,0x6291,0x6613, -0x9091,0x5c79,0x4ebf,0x5f79,0x81c6,0x9038,0x8084,0x75ab, -0x4ea6,0x88d4,0x610f,0x6bc5,0x5fc6,0x4e49,0x76ca,0x6ea2, -0x8be3,0x8bae,0x8c0a,0x8bd1,0x5f02,0x7ffc,0x7fcc,0x7ece, -0x8335,0x836b,0x56e0,0x6bb7,0x97f3,0x9634,0x59fb,0x541f, -0x94f6,0x6deb,0x5bc5,0x996e,0x5c39,0x5f15,0x9690,0x0000, -/* 0xd300 */ -0x89a2,0x89a3,0x89a4,0x89a5,0x89a6,0x89a7,0x89a8,0x89a9, -0x89aa,0x89ab,0x89ac,0x89ad,0x89ae,0x89af,0x89b0,0x89b1, -0x89b2,0x89b3,0x89b4,0x89b5,0x89b6,0x89b7,0x89b8,0x89b9, -0x89ba,0x89bb,0x89bc,0x89bd,0x89be,0x89bf,0x89c0,0x89c3, -0x89cd,0x89d3,0x89d4,0x89d5,0x89d7,0x89d8,0x89d9,0x89db, -0x89dd,0x89df,0x89e0,0x89e1,0x89e2,0x89e4,0x89e7,0x89e8, -0x89e9,0x89ea,0x89ec,0x89ed,0x89ee,0x89f0,0x89f1,0x89f2, -0x89f4,0x89f5,0x89f6,0x89f7,0x89f8,0x89f9,0x89fa,0x0000, -0x89fb,0x89fc,0x89fd,0x89fe,0x89ff,0x8a01,0x8a02,0x8a03, -0x8a04,0x8a05,0x8a06,0x8a08,0x8a09,0x8a0a,0x8a0b,0x8a0c, -0x8a0d,0x8a0e,0x8a0f,0x8a10,0x8a11,0x8a12,0x8a13,0x8a14, -0x8a15,0x8a16,0x8a17,0x8a18,0x8a19,0x8a1a,0x8a1b,0x8a1c, -0x8a1d,0x5370,0x82f1,0x6a31,0x5a74,0x9e70,0x5e94,0x7f28, -0x83b9,0x8424,0x8425,0x8367,0x8747,0x8fce,0x8d62,0x76c8, -0x5f71,0x9896,0x786c,0x6620,0x54df,0x62e5,0x4f63,0x81c3, -0x75c8,0x5eb8,0x96cd,0x8e0a,0x86f9,0x548f,0x6cf3,0x6d8c, -0x6c38,0x607f,0x52c7,0x7528,0x5e7d,0x4f18,0x60a0,0x5fe7, -0x5c24,0x7531,0x90ae,0x94c0,0x72b9,0x6cb9,0x6e38,0x9149, -0x6709,0x53cb,0x53f3,0x4f51,0x91c9,0x8bf1,0x53c8,0x5e7c, -0x8fc2,0x6de4,0x4e8e,0x76c2,0x6986,0x865e,0x611a,0x8206, -0x4f59,0x4fde,0x903e,0x9c7c,0x6109,0x6e1d,0x6e14,0x9685, -0x4e88,0x5a31,0x96e8,0x4e0e,0x5c7f,0x79b9,0x5b87,0x8bed, -0x7fbd,0x7389,0x57df,0x828b,0x90c1,0x5401,0x9047,0x55bb, -0x5cea,0x5fa1,0x6108,0x6b32,0x72f1,0x80b2,0x8a89,0x0000, -/* 0xd400 */ -0x8a1e,0x8a1f,0x8a20,0x8a21,0x8a22,0x8a23,0x8a24,0x8a25, -0x8a26,0x8a27,0x8a28,0x8a29,0x8a2a,0x8a2b,0x8a2c,0x8a2d, -0x8a2e,0x8a2f,0x8a30,0x8a31,0x8a32,0x8a33,0x8a34,0x8a35, -0x8a36,0x8a37,0x8a38,0x8a39,0x8a3a,0x8a3b,0x8a3c,0x8a3d, -0x8a3f,0x8a40,0x8a41,0x8a42,0x8a43,0x8a44,0x8a45,0x8a46, -0x8a47,0x8a49,0x8a4a,0x8a4b,0x8a4c,0x8a4d,0x8a4e,0x8a4f, -0x8a50,0x8a51,0x8a52,0x8a53,0x8a54,0x8a55,0x8a56,0x8a57, -0x8a58,0x8a59,0x8a5a,0x8a5b,0x8a5c,0x8a5d,0x8a5e,0x0000, -0x8a5f,0x8a60,0x8a61,0x8a62,0x8a63,0x8a64,0x8a65,0x8a66, -0x8a67,0x8a68,0x8a69,0x8a6a,0x8a6b,0x8a6c,0x8a6d,0x8a6e, -0x8a6f,0x8a70,0x8a71,0x8a72,0x8a73,0x8a74,0x8a75,0x8a76, -0x8a77,0x8a78,0x8a7a,0x8a7b,0x8a7c,0x8a7d,0x8a7e,0x8a7f, -0x8a80,0x6d74,0x5bd3,0x88d5,0x9884,0x8c6b,0x9a6d,0x9e33, -0x6e0a,0x51a4,0x5143,0x57a3,0x8881,0x539f,0x63f4,0x8f95, -0x56ed,0x5458,0x5706,0x733f,0x6e90,0x7f18,0x8fdc,0x82d1, -0x613f,0x6028,0x9662,0x66f0,0x7ea6,0x8d8a,0x8dc3,0x94a5, -0x5cb3,0x7ca4,0x6708,0x60a6,0x9605,0x8018,0x4e91,0x90e7, -0x5300,0x9668,0x5141,0x8fd0,0x8574,0x915d,0x6655,0x97f5, -0x5b55,0x531d,0x7838,0x6742,0x683d,0x54c9,0x707e,0x5bb0, -0x8f7d,0x518d,0x5728,0x54b1,0x6512,0x6682,0x8d5e,0x8d43, -0x810f,0x846c,0x906d,0x7cdf,0x51ff,0x85fb,0x67a3,0x65e9, -0x6fa1,0x86a4,0x8e81,0x566a,0x9020,0x7682,0x7076,0x71e5, -0x8d23,0x62e9,0x5219,0x6cfd,0x8d3c,0x600e,0x589e,0x618e, -0x66fe,0x8d60,0x624e,0x55b3,0x6e23,0x672d,0x8f67,0x0000, -/* 0xd500 */ -0x8a81,0x8a82,0x8a83,0x8a84,0x8a85,0x8a86,0x8a87,0x8a88, -0x8a8b,0x8a8c,0x8a8d,0x8a8e,0x8a8f,0x8a90,0x8a91,0x8a92, -0x8a94,0x8a95,0x8a96,0x8a97,0x8a98,0x8a99,0x8a9a,0x8a9b, -0x8a9c,0x8a9d,0x8a9e,0x8a9f,0x8aa0,0x8aa1,0x8aa2,0x8aa3, -0x8aa4,0x8aa5,0x8aa6,0x8aa7,0x8aa8,0x8aa9,0x8aaa,0x8aab, -0x8aac,0x8aad,0x8aae,0x8aaf,0x8ab0,0x8ab1,0x8ab2,0x8ab3, -0x8ab4,0x8ab5,0x8ab6,0x8ab7,0x8ab8,0x8ab9,0x8aba,0x8abb, -0x8abc,0x8abd,0x8abe,0x8abf,0x8ac0,0x8ac1,0x8ac2,0x0000, -0x8ac3,0x8ac4,0x8ac5,0x8ac6,0x8ac7,0x8ac8,0x8ac9,0x8aca, -0x8acb,0x8acc,0x8acd,0x8ace,0x8acf,0x8ad0,0x8ad1,0x8ad2, -0x8ad3,0x8ad4,0x8ad5,0x8ad6,0x8ad7,0x8ad8,0x8ad9,0x8ada, -0x8adb,0x8adc,0x8add,0x8ade,0x8adf,0x8ae0,0x8ae1,0x8ae2, -0x8ae3,0x94e1,0x95f8,0x7728,0x6805,0x69a8,0x548b,0x4e4d, -0x70b8,0x8bc8,0x6458,0x658b,0x5b85,0x7a84,0x503a,0x5be8, -0x77bb,0x6be1,0x8a79,0x7c98,0x6cbe,0x76cf,0x65a9,0x8f97, -0x5d2d,0x5c55,0x8638,0x6808,0x5360,0x6218,0x7ad9,0x6e5b, -0x7efd,0x6a1f,0x7ae0,0x5f70,0x6f33,0x5f20,0x638c,0x6da8, -0x6756,0x4e08,0x5e10,0x8d26,0x4ed7,0x80c0,0x7634,0x969c, -0x62db,0x662d,0x627e,0x6cbc,0x8d75,0x7167,0x7f69,0x5146, -0x8087,0x53ec,0x906e,0x6298,0x54f2,0x86f0,0x8f99,0x8005, -0x9517,0x8517,0x8fd9,0x6d59,0x73cd,0x659f,0x771f,0x7504, -0x7827,0x81fb,0x8d1e,0x9488,0x4fa6,0x6795,0x75b9,0x8bca, -0x9707,0x632f,0x9547,0x9635,0x84b8,0x6323,0x7741,0x5f81, -0x72f0,0x4e89,0x6014,0x6574,0x62ef,0x6b63,0x653f,0x0000, -/* 0xd600 */ -0x8ae4,0x8ae5,0x8ae6,0x8ae7,0x8ae8,0x8ae9,0x8aea,0x8aeb, -0x8aec,0x8aed,0x8aee,0x8aef,0x8af0,0x8af1,0x8af2,0x8af3, -0x8af4,0x8af5,0x8af6,0x8af7,0x8af8,0x8af9,0x8afa,0x8afb, -0x8afc,0x8afd,0x8afe,0x8aff,0x8b00,0x8b01,0x8b02,0x8b03, -0x8b04,0x8b05,0x8b06,0x8b08,0x8b09,0x8b0a,0x8b0b,0x8b0c, -0x8b0d,0x8b0e,0x8b0f,0x8b10,0x8b11,0x8b12,0x8b13,0x8b14, -0x8b15,0x8b16,0x8b17,0x8b18,0x8b19,0x8b1a,0x8b1b,0x8b1c, -0x8b1d,0x8b1e,0x8b1f,0x8b20,0x8b21,0x8b22,0x8b23,0x0000, -0x8b24,0x8b25,0x8b27,0x8b28,0x8b29,0x8b2a,0x8b2b,0x8b2c, -0x8b2d,0x8b2e,0x8b2f,0x8b30,0x8b31,0x8b32,0x8b33,0x8b34, -0x8b35,0x8b36,0x8b37,0x8b38,0x8b39,0x8b3a,0x8b3b,0x8b3c, -0x8b3d,0x8b3e,0x8b3f,0x8b40,0x8b41,0x8b42,0x8b43,0x8b44, -0x8b45,0x5e27,0x75c7,0x90d1,0x8bc1,0x829d,0x679d,0x652f, -0x5431,0x8718,0x77e5,0x80a2,0x8102,0x6c41,0x4e4b,0x7ec7, -0x804c,0x76f4,0x690d,0x6b96,0x6267,0x503c,0x4f84,0x5740, -0x6307,0x6b62,0x8dbe,0x53ea,0x65e8,0x7eb8,0x5fd7,0x631a, -0x63b7,0x81f3,0x81f4,0x7f6e,0x5e1c,0x5cd9,0x5236,0x667a, -0x79e9,0x7a1a,0x8d28,0x7099,0x75d4,0x6ede,0x6cbb,0x7a92, -0x4e2d,0x76c5,0x5fe0,0x949f,0x8877,0x7ec8,0x79cd,0x80bf, -0x91cd,0x4ef2,0x4f17,0x821f,0x5468,0x5dde,0x6d32,0x8bcc, -0x7ca5,0x8f74,0x8098,0x5e1a,0x5492,0x76b1,0x5b99,0x663c, -0x9aa4,0x73e0,0x682a,0x86db,0x6731,0x732a,0x8bf8,0x8bdb, -0x9010,0x7af9,0x70db,0x716e,0x62c4,0x77a9,0x5631,0x4e3b, -0x8457,0x67f1,0x52a9,0x86c0,0x8d2e,0x94f8,0x7b51,0x0000, -/* 0xd700 */ -0x8b46,0x8b47,0x8b48,0x8b49,0x8b4a,0x8b4b,0x8b4c,0x8b4d, -0x8b4e,0x8b4f,0x8b50,0x8b51,0x8b52,0x8b53,0x8b54,0x8b55, -0x8b56,0x8b57,0x8b58,0x8b59,0x8b5a,0x8b5b,0x8b5c,0x8b5d, -0x8b5e,0x8b5f,0x8b60,0x8b61,0x8b62,0x8b63,0x8b64,0x8b65, -0x8b67,0x8b68,0x8b69,0x8b6a,0x8b6b,0x8b6d,0x8b6e,0x8b6f, -0x8b70,0x8b71,0x8b72,0x8b73,0x8b74,0x8b75,0x8b76,0x8b77, -0x8b78,0x8b79,0x8b7a,0x8b7b,0x8b7c,0x8b7d,0x8b7e,0x8b7f, -0x8b80,0x8b81,0x8b82,0x8b83,0x8b84,0x8b85,0x8b86,0x0000, -0x8b87,0x8b88,0x8b89,0x8b8a,0x8b8b,0x8b8c,0x8b8d,0x8b8e, -0x8b8f,0x8b90,0x8b91,0x8b92,0x8b93,0x8b94,0x8b95,0x8b96, -0x8b97,0x8b98,0x8b99,0x8b9a,0x8b9b,0x8b9c,0x8b9d,0x8b9e, -0x8b9f,0x8bac,0x8bb1,0x8bbb,0x8bc7,0x8bd0,0x8bea,0x8c09, -0x8c1e,0x4f4f,0x6ce8,0x795d,0x9a7b,0x6293,0x722a,0x62fd, -0x4e13,0x7816,0x8f6c,0x64b0,0x8d5a,0x7bc6,0x6869,0x5e84, -0x88c5,0x5986,0x649e,0x58ee,0x72b6,0x690e,0x9525,0x8ffd, -0x8d58,0x5760,0x7f00,0x8c06,0x51c6,0x6349,0x62d9,0x5353, -0x684c,0x7422,0x8301,0x914c,0x5544,0x7740,0x707c,0x6d4a, -0x5179,0x54a8,0x8d44,0x59ff,0x6ecb,0x6dc4,0x5b5c,0x7d2b, -0x4ed4,0x7c7d,0x6ed3,0x5b50,0x81ea,0x6e0d,0x5b57,0x9b03, -0x68d5,0x8e2a,0x5b97,0x7efc,0x603b,0x7eb5,0x90b9,0x8d70, -0x594f,0x63cd,0x79df,0x8db3,0x5352,0x65cf,0x7956,0x8bc5, -0x963b,0x7ec4,0x94bb,0x7e82,0x5634,0x9189,0x6700,0x7f6a, -0x5c0a,0x9075,0x6628,0x5de6,0x4f50,0x67de,0x505a,0x4f5c, -0x5750,0x5ea7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xd800 */ -0x8c38,0x8c39,0x8c3a,0x8c3b,0x8c3c,0x8c3d,0x8c3e,0x8c3f, -0x8c40,0x8c42,0x8c43,0x8c44,0x8c45,0x8c48,0x8c4a,0x8c4b, -0x8c4d,0x8c4e,0x8c4f,0x8c50,0x8c51,0x8c52,0x8c53,0x8c54, -0x8c56,0x8c57,0x8c58,0x8c59,0x8c5b,0x8c5c,0x8c5d,0x8c5e, -0x8c5f,0x8c60,0x8c63,0x8c64,0x8c65,0x8c66,0x8c67,0x8c68, -0x8c69,0x8c6c,0x8c6d,0x8c6e,0x8c6f,0x8c70,0x8c71,0x8c72, -0x8c74,0x8c75,0x8c76,0x8c77,0x8c7b,0x8c7c,0x8c7d,0x8c7e, -0x8c7f,0x8c80,0x8c81,0x8c83,0x8c84,0x8c86,0x8c87,0x0000, -0x8c88,0x8c8b,0x8c8d,0x8c8e,0x8c8f,0x8c90,0x8c91,0x8c92, -0x8c93,0x8c95,0x8c96,0x8c97,0x8c99,0x8c9a,0x8c9b,0x8c9c, -0x8c9d,0x8c9e,0x8c9f,0x8ca0,0x8ca1,0x8ca2,0x8ca3,0x8ca4, -0x8ca5,0x8ca6,0x8ca7,0x8ca8,0x8ca9,0x8caa,0x8cab,0x8cac, -0x8cad,0x4e8d,0x4e0c,0x5140,0x4e10,0x5eff,0x5345,0x4e15, -0x4e98,0x4e1e,0x9b32,0x5b6c,0x5669,0x4e28,0x79ba,0x4e3f, -0x5315,0x4e47,0x592d,0x723b,0x536e,0x6c10,0x56df,0x80e4, -0x9997,0x6bd3,0x777e,0x9f17,0x4e36,0x4e9f,0x9f10,0x4e5c, -0x4e69,0x4e93,0x8288,0x5b5b,0x556c,0x560f,0x4ec4,0x538d, -0x539d,0x53a3,0x53a5,0x53ae,0x9765,0x8d5d,0x531a,0x53f5, -0x5326,0x532e,0x533e,0x8d5c,0x5366,0x5363,0x5202,0x5208, -0x520e,0x522d,0x5233,0x523f,0x5240,0x524c,0x525e,0x5261, -0x525c,0x84af,0x527d,0x5282,0x5281,0x5290,0x5293,0x5182, -0x7f54,0x4ebb,0x4ec3,0x4ec9,0x4ec2,0x4ee8,0x4ee1,0x4eeb, -0x4ede,0x4f1b,0x4ef3,0x4f22,0x4f64,0x4ef5,0x4f25,0x4f27, -0x4f09,0x4f2b,0x4f5e,0x4f67,0x6538,0x4f5a,0x4f5d,0x0000, -/* 0xd900 */ -0x8cae,0x8caf,0x8cb0,0x8cb1,0x8cb2,0x8cb3,0x8cb4,0x8cb5, -0x8cb6,0x8cb7,0x8cb8,0x8cb9,0x8cba,0x8cbb,0x8cbc,0x8cbd, -0x8cbe,0x8cbf,0x8cc0,0x8cc1,0x8cc2,0x8cc3,0x8cc4,0x8cc5, -0x8cc6,0x8cc7,0x8cc8,0x8cc9,0x8cca,0x8ccb,0x8ccc,0x8ccd, -0x8cce,0x8ccf,0x8cd0,0x8cd1,0x8cd2,0x8cd3,0x8cd4,0x8cd5, -0x8cd6,0x8cd7,0x8cd8,0x8cd9,0x8cda,0x8cdb,0x8cdc,0x8cdd, -0x8cde,0x8cdf,0x8ce0,0x8ce1,0x8ce2,0x8ce3,0x8ce4,0x8ce5, -0x8ce6,0x8ce7,0x8ce8,0x8ce9,0x8cea,0x8ceb,0x8cec,0x0000, -0x8ced,0x8cee,0x8cef,0x8cf0,0x8cf1,0x8cf2,0x8cf3,0x8cf4, -0x8cf5,0x8cf6,0x8cf7,0x8cf8,0x8cf9,0x8cfa,0x8cfb,0x8cfc, -0x8cfd,0x8cfe,0x8cff,0x8d00,0x8d01,0x8d02,0x8d03,0x8d04, -0x8d05,0x8d06,0x8d07,0x8d08,0x8d09,0x8d0a,0x8d0b,0x8d0c, -0x8d0d,0x4f5f,0x4f57,0x4f32,0x4f3d,0x4f76,0x4f74,0x4f91, -0x4f89,0x4f83,0x4f8f,0x4f7e,0x4f7b,0x4faa,0x4f7c,0x4fac, -0x4f94,0x4fe6,0x4fe8,0x4fea,0x4fc5,0x4fda,0x4fe3,0x4fdc, -0x4fd1,0x4fdf,0x4ff8,0x5029,0x504c,0x4ff3,0x502c,0x500f, -0x502e,0x502d,0x4ffe,0x501c,0x500c,0x5025,0x5028,0x507e, -0x5043,0x5055,0x5048,0x504e,0x506c,0x507b,0x50a5,0x50a7, -0x50a9,0x50ba,0x50d6,0x5106,0x50ed,0x50ec,0x50e6,0x50ee, -0x5107,0x510b,0x4edd,0x6c3d,0x4f58,0x4f65,0x4fce,0x9fa0, -0x6c46,0x7c74,0x516e,0x5dfd,0x9ec9,0x9998,0x5181,0x5914, -0x52f9,0x530d,0x8a07,0x5310,0x51eb,0x5919,0x5155,0x4ea0, -0x5156,0x4eb3,0x886e,0x88a4,0x4eb5,0x8114,0x88d2,0x7980, -0x5b34,0x8803,0x7fb8,0x51ab,0x51b1,0x51bd,0x51bc,0x0000, -/* 0xda00 */ -0x8d0e,0x8d0f,0x8d10,0x8d11,0x8d12,0x8d13,0x8d14,0x8d15, -0x8d16,0x8d17,0x8d18,0x8d19,0x8d1a,0x8d1b,0x8d1c,0x8d20, -0x8d51,0x8d52,0x8d57,0x8d5f,0x8d65,0x8d68,0x8d69,0x8d6a, -0x8d6c,0x8d6e,0x8d6f,0x8d71,0x8d72,0x8d78,0x8d79,0x8d7a, -0x8d7b,0x8d7c,0x8d7d,0x8d7e,0x8d7f,0x8d80,0x8d82,0x8d83, -0x8d86,0x8d87,0x8d88,0x8d89,0x8d8c,0x8d8d,0x8d8e,0x8d8f, -0x8d90,0x8d92,0x8d93,0x8d95,0x8d96,0x8d97,0x8d98,0x8d99, -0x8d9a,0x8d9b,0x8d9c,0x8d9d,0x8d9e,0x8da0,0x8da1,0x0000, -0x8da2,0x8da4,0x8da5,0x8da6,0x8da7,0x8da8,0x8da9,0x8daa, -0x8dab,0x8dac,0x8dad,0x8dae,0x8daf,0x8db0,0x8db2,0x8db6, -0x8db7,0x8db9,0x8dbb,0x8dbd,0x8dc0,0x8dc1,0x8dc2,0x8dc5, -0x8dc7,0x8dc8,0x8dc9,0x8dca,0x8dcd,0x8dd0,0x8dd2,0x8dd3, -0x8dd4,0x51c7,0x5196,0x51a2,0x51a5,0x8ba0,0x8ba6,0x8ba7, -0x8baa,0x8bb4,0x8bb5,0x8bb7,0x8bc2,0x8bc3,0x8bcb,0x8bcf, -0x8bce,0x8bd2,0x8bd3,0x8bd4,0x8bd6,0x8bd8,0x8bd9,0x8bdc, -0x8bdf,0x8be0,0x8be4,0x8be8,0x8be9,0x8bee,0x8bf0,0x8bf3, -0x8bf6,0x8bf9,0x8bfc,0x8bff,0x8c00,0x8c02,0x8c04,0x8c07, -0x8c0c,0x8c0f,0x8c11,0x8c12,0x8c14,0x8c15,0x8c16,0x8c19, -0x8c1b,0x8c18,0x8c1d,0x8c1f,0x8c20,0x8c21,0x8c25,0x8c27, -0x8c2a,0x8c2b,0x8c2e,0x8c2f,0x8c32,0x8c33,0x8c35,0x8c36, -0x5369,0x537a,0x961d,0x9622,0x9621,0x9631,0x962a,0x963d, -0x963c,0x9642,0x9649,0x9654,0x965f,0x9667,0x966c,0x9672, -0x9674,0x9688,0x968d,0x9697,0x96b0,0x9097,0x909b,0x909d, -0x9099,0x90ac,0x90a1,0x90b4,0x90b3,0x90b6,0x90ba,0x0000, -/* 0xdb00 */ -0x8dd5,0x8dd8,0x8dd9,0x8ddc,0x8de0,0x8de1,0x8de2,0x8de5, -0x8de6,0x8de7,0x8de9,0x8ded,0x8dee,0x8df0,0x8df1,0x8df2, -0x8df4,0x8df6,0x8dfc,0x8dfe,0x8dff,0x8e00,0x8e01,0x8e02, -0x8e03,0x8e04,0x8e06,0x8e07,0x8e08,0x8e0b,0x8e0d,0x8e0e, -0x8e10,0x8e11,0x8e12,0x8e13,0x8e15,0x8e16,0x8e17,0x8e18, -0x8e19,0x8e1a,0x8e1b,0x8e1c,0x8e20,0x8e21,0x8e24,0x8e25, -0x8e26,0x8e27,0x8e28,0x8e2b,0x8e2d,0x8e30,0x8e32,0x8e33, -0x8e34,0x8e36,0x8e37,0x8e38,0x8e3b,0x8e3c,0x8e3e,0x0000, -0x8e3f,0x8e43,0x8e45,0x8e46,0x8e4c,0x8e4d,0x8e4e,0x8e4f, -0x8e50,0x8e53,0x8e54,0x8e55,0x8e56,0x8e57,0x8e58,0x8e5a, -0x8e5b,0x8e5c,0x8e5d,0x8e5e,0x8e5f,0x8e60,0x8e61,0x8e62, -0x8e63,0x8e64,0x8e65,0x8e67,0x8e68,0x8e6a,0x8e6b,0x8e6e, -0x8e71,0x90b8,0x90b0,0x90cf,0x90c5,0x90be,0x90d0,0x90c4, -0x90c7,0x90d3,0x90e6,0x90e2,0x90dc,0x90d7,0x90db,0x90eb, -0x90ef,0x90fe,0x9104,0x9122,0x911e,0x9123,0x9131,0x912f, -0x9139,0x9143,0x9146,0x520d,0x5942,0x52a2,0x52ac,0x52ad, -0x52be,0x54ff,0x52d0,0x52d6,0x52f0,0x53df,0x71ee,0x77cd, -0x5ef4,0x51f5,0x51fc,0x9b2f,0x53b6,0x5f01,0x755a,0x5def, -0x574c,0x57a9,0x57a1,0x587e,0x58bc,0x58c5,0x58d1,0x5729, -0x572c,0x572a,0x5733,0x5739,0x572e,0x572f,0x575c,0x573b, -0x5742,0x5769,0x5785,0x576b,0x5786,0x577c,0x577b,0x5768, -0x576d,0x5776,0x5773,0x57ad,0x57a4,0x578c,0x57b2,0x57cf, -0x57a7,0x57b4,0x5793,0x57a0,0x57d5,0x57d8,0x57da,0x57d9, -0x57d2,0x57b8,0x57f4,0x57ef,0x57f8,0x57e4,0x57dd,0x0000, -/* 0xdc00 */ -0x8e73,0x8e75,0x8e77,0x8e78,0x8e79,0x8e7a,0x8e7b,0x8e7d, -0x8e7e,0x8e80,0x8e82,0x8e83,0x8e84,0x8e86,0x8e88,0x8e89, -0x8e8a,0x8e8b,0x8e8c,0x8e8d,0x8e8e,0x8e91,0x8e92,0x8e93, -0x8e95,0x8e96,0x8e97,0x8e98,0x8e99,0x8e9a,0x8e9b,0x8e9d, -0x8e9f,0x8ea0,0x8ea1,0x8ea2,0x8ea3,0x8ea4,0x8ea5,0x8ea6, -0x8ea7,0x8ea8,0x8ea9,0x8eaa,0x8ead,0x8eae,0x8eb0,0x8eb1, -0x8eb3,0x8eb4,0x8eb5,0x8eb6,0x8eb7,0x8eb8,0x8eb9,0x8ebb, -0x8ebc,0x8ebd,0x8ebe,0x8ebf,0x8ec0,0x8ec1,0x8ec2,0x0000, -0x8ec3,0x8ec4,0x8ec5,0x8ec6,0x8ec7,0x8ec8,0x8ec9,0x8eca, -0x8ecb,0x8ecc,0x8ecd,0x8ecf,0x8ed0,0x8ed1,0x8ed2,0x8ed3, -0x8ed4,0x8ed5,0x8ed6,0x8ed7,0x8ed8,0x8ed9,0x8eda,0x8edb, -0x8edc,0x8edd,0x8ede,0x8edf,0x8ee0,0x8ee1,0x8ee2,0x8ee3, -0x8ee4,0x580b,0x580d,0x57fd,0x57ed,0x5800,0x581e,0x5819, -0x5844,0x5820,0x5865,0x586c,0x5881,0x5889,0x589a,0x5880, -0x99a8,0x9f19,0x61ff,0x8279,0x827d,0x827f,0x828f,0x828a, -0x82a8,0x8284,0x828e,0x8291,0x8297,0x8299,0x82ab,0x82b8, -0x82be,0x82b0,0x82c8,0x82ca,0x82e3,0x8298,0x82b7,0x82ae, -0x82cb,0x82cc,0x82c1,0x82a9,0x82b4,0x82a1,0x82aa,0x829f, -0x82c4,0x82ce,0x82a4,0x82e1,0x8309,0x82f7,0x82e4,0x830f, -0x8307,0x82dc,0x82f4,0x82d2,0x82d8,0x830c,0x82fb,0x82d3, -0x8311,0x831a,0x8306,0x8314,0x8315,0x82e0,0x82d5,0x831c, -0x8351,0x835b,0x835c,0x8308,0x8392,0x833c,0x8334,0x8331, -0x839b,0x835e,0x832f,0x834f,0x8347,0x8343,0x835f,0x8340, -0x8317,0x8360,0x832d,0x833a,0x8333,0x8366,0x8365,0x0000, -/* 0xdd00 */ -0x8ee5,0x8ee6,0x8ee7,0x8ee8,0x8ee9,0x8eea,0x8eeb,0x8eec, -0x8eed,0x8eee,0x8eef,0x8ef0,0x8ef1,0x8ef2,0x8ef3,0x8ef4, -0x8ef5,0x8ef6,0x8ef7,0x8ef8,0x8ef9,0x8efa,0x8efb,0x8efc, -0x8efd,0x8efe,0x8eff,0x8f00,0x8f01,0x8f02,0x8f03,0x8f04, -0x8f05,0x8f06,0x8f07,0x8f08,0x8f09,0x8f0a,0x8f0b,0x8f0c, -0x8f0d,0x8f0e,0x8f0f,0x8f10,0x8f11,0x8f12,0x8f13,0x8f14, -0x8f15,0x8f16,0x8f17,0x8f18,0x8f19,0x8f1a,0x8f1b,0x8f1c, -0x8f1d,0x8f1e,0x8f1f,0x8f20,0x8f21,0x8f22,0x8f23,0x0000, -0x8f24,0x8f25,0x8f26,0x8f27,0x8f28,0x8f29,0x8f2a,0x8f2b, -0x8f2c,0x8f2d,0x8f2e,0x8f2f,0x8f30,0x8f31,0x8f32,0x8f33, -0x8f34,0x8f35,0x8f36,0x8f37,0x8f38,0x8f39,0x8f3a,0x8f3b, -0x8f3c,0x8f3d,0x8f3e,0x8f3f,0x8f40,0x8f41,0x8f42,0x8f43, -0x8f44,0x8368,0x831b,0x8369,0x836c,0x836a,0x836d,0x836e, -0x83b0,0x8378,0x83b3,0x83b4,0x83a0,0x83aa,0x8393,0x839c, -0x8385,0x837c,0x83b6,0x83a9,0x837d,0x83b8,0x837b,0x8398, -0x839e,0x83a8,0x83ba,0x83bc,0x83c1,0x8401,0x83e5,0x83d8, -0x5807,0x8418,0x840b,0x83dd,0x83fd,0x83d6,0x841c,0x8438, -0x8411,0x8406,0x83d4,0x83df,0x840f,0x8403,0x83f8,0x83f9, -0x83ea,0x83c5,0x83c0,0x8426,0x83f0,0x83e1,0x845c,0x8451, -0x845a,0x8459,0x8473,0x8487,0x8488,0x847a,0x8489,0x8478, -0x843c,0x8446,0x8469,0x8476,0x848c,0x848e,0x8431,0x846d, -0x84c1,0x84cd,0x84d0,0x84e6,0x84bd,0x84d3,0x84ca,0x84bf, -0x84ba,0x84e0,0x84a1,0x84b9,0x84b4,0x8497,0x84e5,0x84e3, -0x850c,0x750d,0x8538,0x84f0,0x8539,0x851f,0x853a,0x0000, -/* 0xde00 */ -0x8f45,0x8f46,0x8f47,0x8f48,0x8f49,0x8f4a,0x8f4b,0x8f4c, -0x8f4d,0x8f4e,0x8f4f,0x8f50,0x8f51,0x8f52,0x8f53,0x8f54, -0x8f55,0x8f56,0x8f57,0x8f58,0x8f59,0x8f5a,0x8f5b,0x8f5c, -0x8f5d,0x8f5e,0x8f5f,0x8f60,0x8f61,0x8f62,0x8f63,0x8f64, -0x8f65,0x8f6a,0x8f80,0x8f8c,0x8f92,0x8f9d,0x8fa0,0x8fa1, -0x8fa2,0x8fa4,0x8fa5,0x8fa6,0x8fa7,0x8faa,0x8fac,0x8fad, -0x8fae,0x8faf,0x8fb2,0x8fb3,0x8fb4,0x8fb5,0x8fb7,0x8fb8, -0x8fba,0x8fbb,0x8fbc,0x8fbf,0x8fc0,0x8fc3,0x8fc6,0x0000, -0x8fc9,0x8fca,0x8fcb,0x8fcc,0x8fcd,0x8fcf,0x8fd2,0x8fd6, -0x8fd7,0x8fda,0x8fe0,0x8fe1,0x8fe3,0x8fe7,0x8fec,0x8fef, -0x8ff1,0x8ff2,0x8ff4,0x8ff5,0x8ff6,0x8ffa,0x8ffb,0x8ffc, -0x8ffe,0x8fff,0x9007,0x9008,0x900c,0x900e,0x9013,0x9015, -0x9018,0x8556,0x853b,0x84ff,0x84fc,0x8559,0x8548,0x8568, -0x8564,0x855e,0x857a,0x77a2,0x8543,0x8572,0x857b,0x85a4, -0x85a8,0x8587,0x858f,0x8579,0x85ae,0x859c,0x8585,0x85b9, -0x85b7,0x85b0,0x85d3,0x85c1,0x85dc,0x85ff,0x8627,0x8605, -0x8629,0x8616,0x863c,0x5efe,0x5f08,0x593c,0x5941,0x8037, -0x5955,0x595a,0x5958,0x530f,0x5c22,0x5c25,0x5c2c,0x5c34, -0x624c,0x626a,0x629f,0x62bb,0x62ca,0x62da,0x62d7,0x62ee, -0x6322,0x62f6,0x6339,0x634b,0x6343,0x63ad,0x63f6,0x6371, -0x637a,0x638e,0x63b4,0x636d,0x63ac,0x638a,0x6369,0x63ae, -0x63bc,0x63f2,0x63f8,0x63e0,0x63ff,0x63c4,0x63de,0x63ce, -0x6452,0x63c6,0x63be,0x6445,0x6441,0x640b,0x641b,0x6420, -0x640c,0x6426,0x6421,0x645e,0x6484,0x646d,0x6496,0x0000, -/* 0xdf00 */ -0x9019,0x901c,0x9023,0x9024,0x9025,0x9027,0x9028,0x9029, -0x902a,0x902b,0x902c,0x9030,0x9031,0x9032,0x9033,0x9034, -0x9037,0x9039,0x903a,0x903d,0x903f,0x9040,0x9043,0x9045, -0x9046,0x9048,0x9049,0x904a,0x904b,0x904c,0x904e,0x9054, -0x9055,0x9056,0x9059,0x905a,0x905c,0x905d,0x905e,0x905f, -0x9060,0x9061,0x9064,0x9066,0x9067,0x9069,0x906a,0x906b, -0x906c,0x906f,0x9070,0x9071,0x9072,0x9073,0x9076,0x9077, -0x9078,0x9079,0x907a,0x907b,0x907c,0x907e,0x9081,0x0000, -0x9084,0x9085,0x9086,0x9087,0x9089,0x908a,0x908c,0x908d, -0x908e,0x908f,0x9090,0x9092,0x9094,0x9096,0x9098,0x909a, -0x909c,0x909e,0x909f,0x90a0,0x90a4,0x90a5,0x90a7,0x90a8, -0x90a9,0x90ab,0x90ad,0x90b2,0x90b7,0x90bc,0x90bd,0x90bf, -0x90c0,0x647a,0x64b7,0x64b8,0x6499,0x64ba,0x64c0,0x64d0, -0x64d7,0x64e4,0x64e2,0x6509,0x6525,0x652e,0x5f0b,0x5fd2, -0x7519,0x5f11,0x535f,0x53f1,0x53fd,0x53e9,0x53e8,0x53fb, -0x5412,0x5416,0x5406,0x544b,0x5452,0x5453,0x5454,0x5456, -0x5443,0x5421,0x5457,0x5459,0x5423,0x5432,0x5482,0x5494, -0x5477,0x5471,0x5464,0x549a,0x549b,0x5484,0x5476,0x5466, -0x549d,0x54d0,0x54ad,0x54c2,0x54b4,0x54d2,0x54a7,0x54a6, -0x54d3,0x54d4,0x5472,0x54a3,0x54d5,0x54bb,0x54bf,0x54cc, -0x54d9,0x54da,0x54dc,0x54a9,0x54aa,0x54a4,0x54dd,0x54cf, -0x54de,0x551b,0x54e7,0x5520,0x54fd,0x5514,0x54f3,0x5522, -0x5523,0x550f,0x5511,0x5527,0x552a,0x5567,0x558f,0x55b5, -0x5549,0x556d,0x5541,0x5555,0x553f,0x5550,0x553c,0x0000, -/* 0xe000 */ -0x90c2,0x90c3,0x90c6,0x90c8,0x90c9,0x90cb,0x90cc,0x90cd, -0x90d2,0x90d4,0x90d5,0x90d6,0x90d8,0x90d9,0x90da,0x90de, -0x90df,0x90e0,0x90e3,0x90e4,0x90e5,0x90e9,0x90ea,0x90ec, -0x90ee,0x90f0,0x90f1,0x90f2,0x90f3,0x90f5,0x90f6,0x90f7, -0x90f9,0x90fa,0x90fb,0x90fc,0x90ff,0x9100,0x9101,0x9103, -0x9105,0x9106,0x9107,0x9108,0x9109,0x910a,0x910b,0x910c, -0x910d,0x910e,0x910f,0x9110,0x9111,0x9112,0x9113,0x9114, -0x9115,0x9116,0x9117,0x9118,0x911a,0x911b,0x911c,0x0000, -0x911d,0x911f,0x9120,0x9121,0x9124,0x9125,0x9126,0x9127, -0x9128,0x9129,0x912a,0x912b,0x912c,0x912d,0x912e,0x9130, -0x9132,0x9133,0x9134,0x9135,0x9136,0x9137,0x9138,0x913a, -0x913b,0x913c,0x913d,0x913e,0x913f,0x9140,0x9141,0x9142, -0x9144,0x5537,0x5556,0x5575,0x5576,0x5577,0x5533,0x5530, -0x555c,0x558b,0x55d2,0x5583,0x55b1,0x55b9,0x5588,0x5581, -0x559f,0x557e,0x55d6,0x5591,0x557b,0x55df,0x55bd,0x55be, -0x5594,0x5599,0x55ea,0x55f7,0x55c9,0x561f,0x55d1,0x55eb, -0x55ec,0x55d4,0x55e6,0x55dd,0x55c4,0x55ef,0x55e5,0x55f2, -0x55f3,0x55cc,0x55cd,0x55e8,0x55f5,0x55e4,0x8f94,0x561e, -0x5608,0x560c,0x5601,0x5624,0x5623,0x55fe,0x5600,0x5627, -0x562d,0x5658,0x5639,0x5657,0x562c,0x564d,0x5662,0x5659, -0x565c,0x564c,0x5654,0x5686,0x5664,0x5671,0x566b,0x567b, -0x567c,0x5685,0x5693,0x56af,0x56d4,0x56d7,0x56dd,0x56e1, -0x56f5,0x56eb,0x56f9,0x56ff,0x5704,0x570a,0x5709,0x571c, -0x5e0f,0x5e19,0x5e14,0x5e11,0x5e31,0x5e3b,0x5e3c,0x0000, -/* 0xe100 */ -0x9145,0x9147,0x9148,0x9151,0x9153,0x9154,0x9155,0x9156, -0x9158,0x9159,0x915b,0x915c,0x915f,0x9160,0x9166,0x9167, -0x9168,0x916b,0x916d,0x9173,0x917a,0x917b,0x917c,0x9180, -0x9181,0x9182,0x9183,0x9184,0x9186,0x9188,0x918a,0x918e, -0x918f,0x9193,0x9194,0x9195,0x9196,0x9197,0x9198,0x9199, -0x919c,0x919d,0x919e,0x919f,0x91a0,0x91a1,0x91a4,0x91a5, -0x91a6,0x91a7,0x91a8,0x91a9,0x91ab,0x91ac,0x91b0,0x91b1, -0x91b2,0x91b3,0x91b6,0x91b7,0x91b8,0x91b9,0x91bb,0x0000, -0x91bc,0x91bd,0x91be,0x91bf,0x91c0,0x91c1,0x91c2,0x91c3, -0x91c4,0x91c5,0x91c6,0x91c8,0x91cb,0x91d0,0x91d2,0x91d3, -0x91d4,0x91d5,0x91d6,0x91d7,0x91d8,0x91d9,0x91da,0x91db, -0x91dd,0x91de,0x91df,0x91e0,0x91e1,0x91e2,0x91e3,0x91e4, -0x91e5,0x5e37,0x5e44,0x5e54,0x5e5b,0x5e5e,0x5e61,0x5c8c, -0x5c7a,0x5c8d,0x5c90,0x5c96,0x5c88,0x5c98,0x5c99,0x5c91, -0x5c9a,0x5c9c,0x5cb5,0x5ca2,0x5cbd,0x5cac,0x5cab,0x5cb1, -0x5ca3,0x5cc1,0x5cb7,0x5cc4,0x5cd2,0x5ce4,0x5ccb,0x5ce5, -0x5d02,0x5d03,0x5d27,0x5d26,0x5d2e,0x5d24,0x5d1e,0x5d06, -0x5d1b,0x5d58,0x5d3e,0x5d34,0x5d3d,0x5d6c,0x5d5b,0x5d6f, -0x5d5d,0x5d6b,0x5d4b,0x5d4a,0x5d69,0x5d74,0x5d82,0x5d99, -0x5d9d,0x8c73,0x5db7,0x5dc5,0x5f73,0x5f77,0x5f82,0x5f87, -0x5f89,0x5f8c,0x5f95,0x5f99,0x5f9c,0x5fa8,0x5fad,0x5fb5, -0x5fbc,0x8862,0x5f61,0x72ad,0x72b0,0x72b4,0x72b7,0x72b8, -0x72c3,0x72c1,0x72ce,0x72cd,0x72d2,0x72e8,0x72ef,0x72e9, -0x72f2,0x72f4,0x72f7,0x7301,0x72f3,0x7303,0x72fa,0x0000, -/* 0xe200 */ -0x91e6,0x91e7,0x91e8,0x91e9,0x91ea,0x91eb,0x91ec,0x91ed, -0x91ee,0x91ef,0x91f0,0x91f1,0x91f2,0x91f3,0x91f4,0x91f5, -0x91f6,0x91f7,0x91f8,0x91f9,0x91fa,0x91fb,0x91fc,0x91fd, -0x91fe,0x91ff,0x9200,0x9201,0x9202,0x9203,0x9204,0x9205, -0x9206,0x9207,0x9208,0x9209,0x920a,0x920b,0x920c,0x920d, -0x920e,0x920f,0x9210,0x9211,0x9212,0x9213,0x9214,0x9215, -0x9216,0x9217,0x9218,0x9219,0x921a,0x921b,0x921c,0x921d, -0x921e,0x921f,0x9220,0x9221,0x9222,0x9223,0x9224,0x0000, -0x9225,0x9226,0x9227,0x9228,0x9229,0x922a,0x922b,0x922c, -0x922d,0x922e,0x922f,0x9230,0x9231,0x9232,0x9233,0x9234, -0x9235,0x9236,0x9237,0x9238,0x9239,0x923a,0x923b,0x923c, -0x923d,0x923e,0x923f,0x9240,0x9241,0x9242,0x9243,0x9244, -0x9245,0x72fb,0x7317,0x7313,0x7321,0x730a,0x731e,0x731d, -0x7315,0x7322,0x7339,0x7325,0x732c,0x7338,0x7331,0x7350, -0x734d,0x7357,0x7360,0x736c,0x736f,0x737e,0x821b,0x5925, -0x98e7,0x5924,0x5902,0x9963,0x9967,0x9968,0x9969,0x996a, -0x996b,0x996c,0x9974,0x9977,0x997d,0x9980,0x9984,0x9987, -0x998a,0x998d,0x9990,0x9991,0x9993,0x9994,0x9995,0x5e80, -0x5e91,0x5e8b,0x5e96,0x5ea5,0x5ea0,0x5eb9,0x5eb5,0x5ebe, -0x5eb3,0x8d53,0x5ed2,0x5ed1,0x5edb,0x5ee8,0x5eea,0x81ba, -0x5fc4,0x5fc9,0x5fd6,0x5fcf,0x6003,0x5fee,0x6004,0x5fe1, -0x5fe4,0x5ffe,0x6005,0x6006,0x5fea,0x5fed,0x5ff8,0x6019, -0x6035,0x6026,0x601b,0x600f,0x600d,0x6029,0x602b,0x600a, -0x603f,0x6021,0x6078,0x6079,0x607b,0x607a,0x6042,0x0000, -/* 0xe300 */ -0x9246,0x9247,0x9248,0x9249,0x924a,0x924b,0x924c,0x924d, -0x924e,0x924f,0x9250,0x9251,0x9252,0x9253,0x9254,0x9255, -0x9256,0x9257,0x9258,0x9259,0x925a,0x925b,0x925c,0x925d, -0x925e,0x925f,0x9260,0x9261,0x9262,0x9263,0x9264,0x9265, -0x9266,0x9267,0x9268,0x9269,0x926a,0x926b,0x926c,0x926d, -0x926e,0x926f,0x9270,0x9271,0x9272,0x9273,0x9275,0x9276, -0x9277,0x9278,0x9279,0x927a,0x927b,0x927c,0x927d,0x927e, -0x927f,0x9280,0x9281,0x9282,0x9283,0x9284,0x9285,0x0000, -0x9286,0x9287,0x9288,0x9289,0x928a,0x928b,0x928c,0x928d, -0x928f,0x9290,0x9291,0x9292,0x9293,0x9294,0x9295,0x9296, -0x9297,0x9298,0x9299,0x929a,0x929b,0x929c,0x929d,0x929e, -0x929f,0x92a0,0x92a1,0x92a2,0x92a3,0x92a4,0x92a5,0x92a6, -0x92a7,0x606a,0x607d,0x6096,0x609a,0x60ad,0x609d,0x6083, -0x6092,0x608c,0x609b,0x60ec,0x60bb,0x60b1,0x60dd,0x60d8, -0x60c6,0x60da,0x60b4,0x6120,0x6126,0x6115,0x6123,0x60f4, -0x6100,0x610e,0x612b,0x614a,0x6175,0x61ac,0x6194,0x61a7, -0x61b7,0x61d4,0x61f5,0x5fdd,0x96b3,0x95e9,0x95eb,0x95f1, -0x95f3,0x95f5,0x95f6,0x95fc,0x95fe,0x9603,0x9604,0x9606, -0x9608,0x960a,0x960b,0x960c,0x960d,0x960f,0x9612,0x9615, -0x9616,0x9617,0x9619,0x961a,0x4e2c,0x723f,0x6215,0x6c35, -0x6c54,0x6c5c,0x6c4a,0x6ca3,0x6c85,0x6c90,0x6c94,0x6c8c, -0x6c68,0x6c69,0x6c74,0x6c76,0x6c86,0x6ca9,0x6cd0,0x6cd4, -0x6cad,0x6cf7,0x6cf8,0x6cf1,0x6cd7,0x6cb2,0x6ce0,0x6cd6, -0x6cfa,0x6ceb,0x6cee,0x6cb1,0x6cd3,0x6cef,0x6cfe,0x0000, -/* 0xe400 */ -0x92a8,0x92a9,0x92aa,0x92ab,0x92ac,0x92ad,0x92af,0x92b0, -0x92b1,0x92b2,0x92b3,0x92b4,0x92b5,0x92b6,0x92b7,0x92b8, -0x92b9,0x92ba,0x92bb,0x92bc,0x92bd,0x92be,0x92bf,0x92c0, -0x92c1,0x92c2,0x92c3,0x92c4,0x92c5,0x92c6,0x92c7,0x92c9, -0x92ca,0x92cb,0x92cc,0x92cd,0x92ce,0x92cf,0x92d0,0x92d1, -0x92d2,0x92d3,0x92d4,0x92d5,0x92d6,0x92d7,0x92d8,0x92d9, -0x92da,0x92db,0x92dc,0x92dd,0x92de,0x92df,0x92e0,0x92e1, -0x92e2,0x92e3,0x92e4,0x92e5,0x92e6,0x92e7,0x92e8,0x0000, -0x92e9,0x92ea,0x92eb,0x92ec,0x92ed,0x92ee,0x92ef,0x92f0, -0x92f1,0x92f2,0x92f3,0x92f4,0x92f5,0x92f6,0x92f7,0x92f8, -0x92f9,0x92fa,0x92fb,0x92fc,0x92fd,0x92fe,0x92ff,0x9300, -0x9301,0x9302,0x9303,0x9304,0x9305,0x9306,0x9307,0x9308, -0x9309,0x6d39,0x6d27,0x6d0c,0x6d43,0x6d48,0x6d07,0x6d04, -0x6d19,0x6d0e,0x6d2b,0x6d4d,0x6d2e,0x6d35,0x6d1a,0x6d4f, -0x6d52,0x6d54,0x6d33,0x6d91,0x6d6f,0x6d9e,0x6da0,0x6d5e, -0x6d93,0x6d94,0x6d5c,0x6d60,0x6d7c,0x6d63,0x6e1a,0x6dc7, -0x6dc5,0x6dde,0x6e0e,0x6dbf,0x6de0,0x6e11,0x6de6,0x6ddd, -0x6dd9,0x6e16,0x6dab,0x6e0c,0x6dae,0x6e2b,0x6e6e,0x6e4e, -0x6e6b,0x6eb2,0x6e5f,0x6e86,0x6e53,0x6e54,0x6e32,0x6e25, -0x6e44,0x6edf,0x6eb1,0x6e98,0x6ee0,0x6f2d,0x6ee2,0x6ea5, -0x6ea7,0x6ebd,0x6ebb,0x6eb7,0x6ed7,0x6eb4,0x6ecf,0x6e8f, -0x6ec2,0x6e9f,0x6f62,0x6f46,0x6f47,0x6f24,0x6f15,0x6ef9, -0x6f2f,0x6f36,0x6f4b,0x6f74,0x6f2a,0x6f09,0x6f29,0x6f89, -0x6f8d,0x6f8c,0x6f78,0x6f72,0x6f7c,0x6f7a,0x6fd1,0x0000, -/* 0xe500 */ -0x930a,0x930b,0x930c,0x930d,0x930e,0x930f,0x9310,0x9311, -0x9312,0x9313,0x9314,0x9315,0x9316,0x9317,0x9318,0x9319, -0x931a,0x931b,0x931c,0x931d,0x931e,0x931f,0x9320,0x9321, -0x9322,0x9323,0x9324,0x9325,0x9326,0x9327,0x9328,0x9329, -0x932a,0x932b,0x932c,0x932d,0x932e,0x932f,0x9330,0x9331, -0x9332,0x9333,0x9334,0x9335,0x9336,0x9337,0x9338,0x9339, -0x933a,0x933b,0x933c,0x933d,0x933f,0x9340,0x9341,0x9342, -0x9343,0x9344,0x9345,0x9346,0x9347,0x9348,0x9349,0x0000, -0x934a,0x934b,0x934c,0x934d,0x934e,0x934f,0x9350,0x9351, -0x9352,0x9353,0x9354,0x9355,0x9356,0x9357,0x9358,0x9359, -0x935a,0x935b,0x935c,0x935d,0x935e,0x935f,0x9360,0x9361, -0x9362,0x9363,0x9364,0x9365,0x9366,0x9367,0x9368,0x9369, -0x936b,0x6fc9,0x6fa7,0x6fb9,0x6fb6,0x6fc2,0x6fe1,0x6fee, -0x6fde,0x6fe0,0x6fef,0x701a,0x7023,0x701b,0x7039,0x7035, -0x704f,0x705e,0x5b80,0x5b84,0x5b95,0x5b93,0x5ba5,0x5bb8, -0x752f,0x9a9e,0x6434,0x5be4,0x5bee,0x8930,0x5bf0,0x8e47, -0x8b07,0x8fb6,0x8fd3,0x8fd5,0x8fe5,0x8fee,0x8fe4,0x8fe9, -0x8fe6,0x8ff3,0x8fe8,0x9005,0x9004,0x900b,0x9026,0x9011, -0x900d,0x9016,0x9021,0x9035,0x9036,0x902d,0x902f,0x9044, -0x9051,0x9052,0x9050,0x9068,0x9058,0x9062,0x905b,0x66b9, -0x9074,0x907d,0x9082,0x9088,0x9083,0x908b,0x5f50,0x5f57, -0x5f56,0x5f58,0x5c3b,0x54ab,0x5c50,0x5c59,0x5b71,0x5c63, -0x5c66,0x7fbc,0x5f2a,0x5f29,0x5f2d,0x8274,0x5f3c,0x9b3b, -0x5c6e,0x5981,0x5983,0x598d,0x59a9,0x59aa,0x59a3,0x0000, -/* 0xe600 */ -0x936c,0x936d,0x936e,0x936f,0x9370,0x9371,0x9372,0x9373, -0x9374,0x9375,0x9376,0x9377,0x9378,0x9379,0x937a,0x937b, -0x937c,0x937d,0x937e,0x937f,0x9380,0x9381,0x9382,0x9383, -0x9384,0x9385,0x9386,0x9387,0x9388,0x9389,0x938a,0x938b, -0x938c,0x938d,0x938e,0x9390,0x9391,0x9392,0x9393,0x9394, -0x9395,0x9396,0x9397,0x9398,0x9399,0x939a,0x939b,0x939c, -0x939d,0x939e,0x939f,0x93a0,0x93a1,0x93a2,0x93a3,0x93a4, -0x93a5,0x93a6,0x93a7,0x93a8,0x93a9,0x93aa,0x93ab,0x0000, -0x93ac,0x93ad,0x93ae,0x93af,0x93b0,0x93b1,0x93b2,0x93b3, -0x93b4,0x93b5,0x93b6,0x93b7,0x93b8,0x93b9,0x93ba,0x93bb, -0x93bc,0x93bd,0x93be,0x93bf,0x93c0,0x93c1,0x93c2,0x93c3, -0x93c4,0x93c5,0x93c6,0x93c7,0x93c8,0x93c9,0x93cb,0x93cc, -0x93cd,0x5997,0x59ca,0x59ab,0x599e,0x59a4,0x59d2,0x59b2, -0x59af,0x59d7,0x59be,0x5a05,0x5a06,0x59dd,0x5a08,0x59e3, -0x59d8,0x59f9,0x5a0c,0x5a09,0x5a32,0x5a34,0x5a11,0x5a23, -0x5a13,0x5a40,0x5a67,0x5a4a,0x5a55,0x5a3c,0x5a62,0x5a75, -0x80ec,0x5aaa,0x5a9b,0x5a77,0x5a7a,0x5abe,0x5aeb,0x5ab2, -0x5ad2,0x5ad4,0x5ab8,0x5ae0,0x5ae3,0x5af1,0x5ad6,0x5ae6, -0x5ad8,0x5adc,0x5b09,0x5b17,0x5b16,0x5b32,0x5b37,0x5b40, -0x5c15,0x5c1c,0x5b5a,0x5b65,0x5b73,0x5b51,0x5b53,0x5b62, -0x9a75,0x9a77,0x9a78,0x9a7a,0x9a7f,0x9a7d,0x9a80,0x9a81, -0x9a85,0x9a88,0x9a8a,0x9a90,0x9a92,0x9a93,0x9a96,0x9a98, -0x9a9b,0x9a9c,0x9a9d,0x9a9f,0x9aa0,0x9aa2,0x9aa3,0x9aa5, -0x9aa7,0x7e9f,0x7ea1,0x7ea3,0x7ea5,0x7ea8,0x7ea9,0x0000, -/* 0xe700 */ -0x93ce,0x93cf,0x93d0,0x93d1,0x93d2,0x93d3,0x93d4,0x93d5, -0x93d7,0x93d8,0x93d9,0x93da,0x93db,0x93dc,0x93dd,0x93de, -0x93df,0x93e0,0x93e1,0x93e2,0x93e3,0x93e4,0x93e5,0x93e6, -0x93e7,0x93e8,0x93e9,0x93ea,0x93eb,0x93ec,0x93ed,0x93ee, -0x93ef,0x93f0,0x93f1,0x93f2,0x93f3,0x93f4,0x93f5,0x93f6, -0x93f7,0x93f8,0x93f9,0x93fa,0x93fb,0x93fc,0x93fd,0x93fe, -0x93ff,0x9400,0x9401,0x9402,0x9403,0x9404,0x9405,0x9406, -0x9407,0x9408,0x9409,0x940a,0x940b,0x940c,0x940d,0x0000, -0x940e,0x940f,0x9410,0x9411,0x9412,0x9413,0x9414,0x9415, -0x9416,0x9417,0x9418,0x9419,0x941a,0x941b,0x941c,0x941d, -0x941e,0x941f,0x9420,0x9421,0x9422,0x9423,0x9424,0x9425, -0x9426,0x9427,0x9428,0x9429,0x942a,0x942b,0x942c,0x942d, -0x942e,0x7ead,0x7eb0,0x7ebe,0x7ec0,0x7ec1,0x7ec2,0x7ec9, -0x7ecb,0x7ecc,0x7ed0,0x7ed4,0x7ed7,0x7edb,0x7ee0,0x7ee1, -0x7ee8,0x7eeb,0x7eee,0x7eef,0x7ef1,0x7ef2,0x7f0d,0x7ef6, -0x7efa,0x7efb,0x7efe,0x7f01,0x7f02,0x7f03,0x7f07,0x7f08, -0x7f0b,0x7f0c,0x7f0f,0x7f11,0x7f12,0x7f17,0x7f19,0x7f1c, -0x7f1b,0x7f1f,0x7f21,0x7f22,0x7f23,0x7f24,0x7f25,0x7f26, -0x7f27,0x7f2a,0x7f2b,0x7f2c,0x7f2d,0x7f2f,0x7f30,0x7f31, -0x7f32,0x7f33,0x7f35,0x5e7a,0x757f,0x5ddb,0x753e,0x9095, -0x738e,0x7391,0x73ae,0x73a2,0x739f,0x73cf,0x73c2,0x73d1, -0x73b7,0x73b3,0x73c0,0x73c9,0x73c8,0x73e5,0x73d9,0x987c, -0x740a,0x73e9,0x73e7,0x73de,0x73ba,0x73f2,0x740f,0x742a, -0x745b,0x7426,0x7425,0x7428,0x7430,0x742e,0x742c,0x0000, -/* 0xe800 */ -0x942f,0x9430,0x9431,0x9432,0x9433,0x9434,0x9435,0x9436, -0x9437,0x9438,0x9439,0x943a,0x943b,0x943c,0x943d,0x943f, -0x9440,0x9441,0x9442,0x9443,0x9444,0x9445,0x9446,0x9447, -0x9448,0x9449,0x944a,0x944b,0x944c,0x944d,0x944e,0x944f, -0x9450,0x9451,0x9452,0x9453,0x9454,0x9455,0x9456,0x9457, -0x9458,0x9459,0x945a,0x945b,0x945c,0x945d,0x945e,0x945f, -0x9460,0x9461,0x9462,0x9463,0x9464,0x9465,0x9466,0x9467, -0x9468,0x9469,0x946a,0x946c,0x946d,0x946e,0x946f,0x0000, -0x9470,0x9471,0x9472,0x9473,0x9474,0x9475,0x9476,0x9477, -0x9478,0x9479,0x947a,0x947b,0x947c,0x947d,0x947e,0x947f, -0x9480,0x9481,0x9482,0x9483,0x9484,0x9491,0x9496,0x9498, -0x94c7,0x94cf,0x94d3,0x94d4,0x94da,0x94e6,0x94fb,0x951c, -0x9520,0x741b,0x741a,0x7441,0x745c,0x7457,0x7455,0x7459, -0x7477,0x746d,0x747e,0x749c,0x748e,0x7480,0x7481,0x7487, -0x748b,0x749e,0x74a8,0x74a9,0x7490,0x74a7,0x74d2,0x74ba, -0x97ea,0x97eb,0x97ec,0x674c,0x6753,0x675e,0x6748,0x6769, -0x67a5,0x6787,0x676a,0x6773,0x6798,0x67a7,0x6775,0x67a8, -0x679e,0x67ad,0x678b,0x6777,0x677c,0x67f0,0x6809,0x67d8, -0x680a,0x67e9,0x67b0,0x680c,0x67d9,0x67b5,0x67da,0x67b3, -0x67dd,0x6800,0x67c3,0x67b8,0x67e2,0x680e,0x67c1,0x67fd, -0x6832,0x6833,0x6860,0x6861,0x684e,0x6862,0x6844,0x6864, -0x6883,0x681d,0x6855,0x6866,0x6841,0x6867,0x6840,0x683e, -0x684a,0x6849,0x6829,0x68b5,0x688f,0x6874,0x6877,0x6893, -0x686b,0x68c2,0x696e,0x68fc,0x691f,0x6920,0x68f9,0x0000, -/* 0xe900 */ -0x9527,0x9533,0x953d,0x9543,0x9548,0x954b,0x9555,0x955a, -0x9560,0x956e,0x9574,0x9575,0x9577,0x9578,0x9579,0x957a, -0x957b,0x957c,0x957d,0x957e,0x9580,0x9581,0x9582,0x9583, -0x9584,0x9585,0x9586,0x9587,0x9588,0x9589,0x958a,0x958b, -0x958c,0x958d,0x958e,0x958f,0x9590,0x9591,0x9592,0x9593, -0x9594,0x9595,0x9596,0x9597,0x9598,0x9599,0x959a,0x959b, -0x959c,0x959d,0x959e,0x959f,0x95a0,0x95a1,0x95a2,0x95a3, -0x95a4,0x95a5,0x95a6,0x95a7,0x95a8,0x95a9,0x95aa,0x0000, -0x95ab,0x95ac,0x95ad,0x95ae,0x95af,0x95b0,0x95b1,0x95b2, -0x95b3,0x95b4,0x95b5,0x95b6,0x95b7,0x95b8,0x95b9,0x95ba, -0x95bb,0x95bc,0x95bd,0x95be,0x95bf,0x95c0,0x95c1,0x95c2, -0x95c3,0x95c4,0x95c5,0x95c6,0x95c7,0x95c8,0x95c9,0x95ca, -0x95cb,0x6924,0x68f0,0x690b,0x6901,0x6957,0x68e3,0x6910, -0x6971,0x6939,0x6960,0x6942,0x695d,0x6984,0x696b,0x6980, -0x6998,0x6978,0x6934,0x69cc,0x6987,0x6988,0x69ce,0x6989, -0x6966,0x6963,0x6979,0x699b,0x69a7,0x69bb,0x69ab,0x69ad, -0x69d4,0x69b1,0x69c1,0x69ca,0x69df,0x6995,0x69e0,0x698d, -0x69ff,0x6a2f,0x69ed,0x6a17,0x6a18,0x6a65,0x69f2,0x6a44, -0x6a3e,0x6aa0,0x6a50,0x6a5b,0x6a35,0x6a8e,0x6a79,0x6a3d, -0x6a28,0x6a58,0x6a7c,0x6a91,0x6a90,0x6aa9,0x6a97,0x6aab, -0x7337,0x7352,0x6b81,0x6b82,0x6b87,0x6b84,0x6b92,0x6b93, -0x6b8d,0x6b9a,0x6b9b,0x6ba1,0x6baa,0x8f6b,0x8f6d,0x8f71, -0x8f72,0x8f73,0x8f75,0x8f76,0x8f78,0x8f77,0x8f79,0x8f7a, -0x8f7c,0x8f7e,0x8f81,0x8f82,0x8f84,0x8f87,0x8f8b,0x0000, -/* 0xea00 */ -0x95cc,0x95cd,0x95ce,0x95cf,0x95d0,0x95d1,0x95d2,0x95d3, -0x95d4,0x95d5,0x95d6,0x95d7,0x95d8,0x95d9,0x95da,0x95db, -0x95dc,0x95dd,0x95de,0x95df,0x95e0,0x95e1,0x95e2,0x95e3, -0x95e4,0x95e5,0x95e6,0x95e7,0x95ec,0x95ff,0x9607,0x9613, -0x9618,0x961b,0x961e,0x9620,0x9623,0x9624,0x9625,0x9626, -0x9627,0x9628,0x9629,0x962b,0x962c,0x962d,0x962f,0x9630, -0x9637,0x9638,0x9639,0x963a,0x963e,0x9641,0x9643,0x964a, -0x964e,0x964f,0x9651,0x9652,0x9653,0x9656,0x9657,0x0000, -0x9658,0x9659,0x965a,0x965c,0x965d,0x965e,0x9660,0x9663, -0x9665,0x9666,0x966b,0x966d,0x966e,0x966f,0x9670,0x9671, -0x9673,0x9678,0x9679,0x967a,0x967b,0x967c,0x967d,0x967e, -0x967f,0x9680,0x9681,0x9682,0x9683,0x9684,0x9687,0x9689, -0x968a,0x8f8d,0x8f8e,0x8f8f,0x8f98,0x8f9a,0x8ece,0x620b, -0x6217,0x621b,0x621f,0x6222,0x6221,0x6225,0x6224,0x622c, -0x81e7,0x74ef,0x74f4,0x74ff,0x750f,0x7511,0x7513,0x6534, -0x65ee,0x65ef,0x65f0,0x660a,0x6619,0x6772,0x6603,0x6615, -0x6600,0x7085,0x66f7,0x661d,0x6634,0x6631,0x6636,0x6635, -0x8006,0x665f,0x6654,0x6641,0x664f,0x6656,0x6661,0x6657, -0x6677,0x6684,0x668c,0x66a7,0x669d,0x66be,0x66db,0x66dc, -0x66e6,0x66e9,0x8d32,0x8d33,0x8d36,0x8d3b,0x8d3d,0x8d40, -0x8d45,0x8d46,0x8d48,0x8d49,0x8d47,0x8d4d,0x8d55,0x8d59, -0x89c7,0x89ca,0x89cb,0x89cc,0x89ce,0x89cf,0x89d0,0x89d1, -0x726e,0x729f,0x725d,0x7266,0x726f,0x727e,0x727f,0x7284, -0x728b,0x728d,0x728f,0x7292,0x6308,0x6332,0x63b0,0x0000, -/* 0xeb00 */ -0x968c,0x968e,0x9691,0x9692,0x9693,0x9695,0x9696,0x969a, -0x969b,0x969d,0x969e,0x969f,0x96a0,0x96a1,0x96a2,0x96a3, -0x96a4,0x96a5,0x96a6,0x96a8,0x96a9,0x96aa,0x96ab,0x96ac, -0x96ad,0x96ae,0x96af,0x96b1,0x96b2,0x96b4,0x96b5,0x96b7, -0x96b8,0x96ba,0x96bb,0x96bf,0x96c2,0x96c3,0x96c8,0x96ca, -0x96cb,0x96d0,0x96d1,0x96d3,0x96d4,0x96d6,0x96d7,0x96d8, -0x96d9,0x96da,0x96db,0x96dc,0x96dd,0x96de,0x96df,0x96e1, -0x96e2,0x96e3,0x96e4,0x96e5,0x96e6,0x96e7,0x96eb,0x0000, -0x96ec,0x96ed,0x96ee,0x96f0,0x96f1,0x96f2,0x96f4,0x96f5, -0x96f8,0x96fa,0x96fb,0x96fc,0x96fd,0x96ff,0x9702,0x9703, -0x9705,0x970a,0x970b,0x970c,0x9710,0x9711,0x9712,0x9714, -0x9715,0x9717,0x9718,0x9719,0x971a,0x971b,0x971d,0x971f, -0x9720,0x643f,0x64d8,0x8004,0x6bea,0x6bf3,0x6bfd,0x6bf5, -0x6bf9,0x6c05,0x6c07,0x6c06,0x6c0d,0x6c15,0x6c18,0x6c19, -0x6c1a,0x6c21,0x6c29,0x6c24,0x6c2a,0x6c32,0x6535,0x6555, -0x656b,0x724d,0x7252,0x7256,0x7230,0x8662,0x5216,0x809f, -0x809c,0x8093,0x80bc,0x670a,0x80bd,0x80b1,0x80ab,0x80ad, -0x80b4,0x80b7,0x80e7,0x80e8,0x80e9,0x80ea,0x80db,0x80c2, -0x80c4,0x80d9,0x80cd,0x80d7,0x6710,0x80dd,0x80eb,0x80f1, -0x80f4,0x80ed,0x810d,0x810e,0x80f2,0x80fc,0x6715,0x8112, -0x8c5a,0x8136,0x811e,0x812c,0x8118,0x8132,0x8148,0x814c, -0x8153,0x8174,0x8159,0x815a,0x8171,0x8160,0x8169,0x817c, -0x817d,0x816d,0x8167,0x584d,0x5ab5,0x8188,0x8182,0x8191, -0x6ed5,0x81a3,0x81aa,0x81cc,0x6726,0x81ca,0x81bb,0x0000, -/* 0xec00 */ -0x9721,0x9722,0x9723,0x9724,0x9725,0x9726,0x9727,0x9728, -0x9729,0x972b,0x972c,0x972e,0x972f,0x9731,0x9733,0x9734, -0x9735,0x9736,0x9737,0x973a,0x973b,0x973c,0x973d,0x973f, -0x9740,0x9741,0x9742,0x9743,0x9744,0x9745,0x9746,0x9747, -0x9748,0x9749,0x974a,0x974b,0x974c,0x974d,0x974e,0x974f, -0x9750,0x9751,0x9754,0x9755,0x9757,0x9758,0x975a,0x975c, -0x975d,0x975f,0x9763,0x9764,0x9766,0x9767,0x9768,0x976a, -0x976b,0x976c,0x976d,0x976e,0x976f,0x9770,0x9771,0x0000, -0x9772,0x9775,0x9777,0x9778,0x9779,0x977a,0x977b,0x977d, -0x977e,0x977f,0x9780,0x9781,0x9782,0x9783,0x9784,0x9786, -0x9787,0x9788,0x9789,0x978a,0x978c,0x978e,0x978f,0x9790, -0x9793,0x9795,0x9796,0x9797,0x9799,0x979a,0x979b,0x979c, -0x979d,0x81c1,0x81a6,0x6b24,0x6b37,0x6b39,0x6b43,0x6b46, -0x6b59,0x98d1,0x98d2,0x98d3,0x98d5,0x98d9,0x98da,0x6bb3, -0x5f40,0x6bc2,0x89f3,0x6590,0x9f51,0x6593,0x65bc,0x65c6, -0x65c4,0x65c3,0x65cc,0x65ce,0x65d2,0x65d6,0x7080,0x709c, -0x7096,0x709d,0x70bb,0x70c0,0x70b7,0x70ab,0x70b1,0x70e8, -0x70ca,0x7110,0x7113,0x7116,0x712f,0x7131,0x7173,0x715c, -0x7168,0x7145,0x7172,0x714a,0x7178,0x717a,0x7198,0x71b3, -0x71b5,0x71a8,0x71a0,0x71e0,0x71d4,0x71e7,0x71f9,0x721d, -0x7228,0x706c,0x7118,0x7166,0x71b9,0x623e,0x623d,0x6243, -0x6248,0x6249,0x793b,0x7940,0x7946,0x7949,0x795b,0x795c, -0x7953,0x795a,0x7962,0x7957,0x7960,0x796f,0x7967,0x797a, -0x7985,0x798a,0x799a,0x79a7,0x79b3,0x5fd1,0x5fd0,0x0000, -/* 0xed00 */ -0x979e,0x979f,0x97a1,0x97a2,0x97a4,0x97a5,0x97a6,0x97a7, -0x97a8,0x97a9,0x97aa,0x97ac,0x97ae,0x97b0,0x97b1,0x97b3, -0x97b5,0x97b6,0x97b7,0x97b8,0x97b9,0x97ba,0x97bb,0x97bc, -0x97bd,0x97be,0x97bf,0x97c0,0x97c1,0x97c2,0x97c3,0x97c4, -0x97c5,0x97c6,0x97c7,0x97c8,0x97c9,0x97ca,0x97cb,0x97cc, -0x97cd,0x97ce,0x97cf,0x97d0,0x97d1,0x97d2,0x97d3,0x97d4, -0x97d5,0x97d6,0x97d7,0x97d8,0x97d9,0x97da,0x97db,0x97dc, -0x97dd,0x97de,0x97df,0x97e0,0x97e1,0x97e2,0x97e3,0x0000, -0x97e4,0x97e5,0x97e8,0x97ee,0x97ef,0x97f0,0x97f1,0x97f2, -0x97f4,0x97f7,0x97f8,0x97f9,0x97fa,0x97fb,0x97fc,0x97fd, -0x97fe,0x97ff,0x9800,0x9801,0x9802,0x9803,0x9804,0x9805, -0x9806,0x9807,0x9808,0x9809,0x980a,0x980b,0x980c,0x980d, -0x980e,0x603c,0x605d,0x605a,0x6067,0x6041,0x6059,0x6063, -0x60ab,0x6106,0x610d,0x615d,0x61a9,0x619d,0x61cb,0x61d1, -0x6206,0x8080,0x807f,0x6c93,0x6cf6,0x6dfc,0x77f6,0x77f8, -0x7800,0x7809,0x7817,0x7818,0x7811,0x65ab,0x782d,0x781c, -0x781d,0x7839,0x783a,0x783b,0x781f,0x783c,0x7825,0x782c, -0x7823,0x7829,0x784e,0x786d,0x7856,0x7857,0x7826,0x7850, -0x7847,0x784c,0x786a,0x789b,0x7893,0x789a,0x7887,0x789c, -0x78a1,0x78a3,0x78b2,0x78b9,0x78a5,0x78d4,0x78d9,0x78c9, -0x78ec,0x78f2,0x7905,0x78f4,0x7913,0x7924,0x791e,0x7934, -0x9f9b,0x9ef9,0x9efb,0x9efc,0x76f1,0x7704,0x770d,0x76f9, -0x7707,0x7708,0x771a,0x7722,0x7719,0x772d,0x7726,0x7735, -0x7738,0x7750,0x7751,0x7747,0x7743,0x775a,0x7768,0x0000, -/* 0xee00 */ -0x980f,0x9810,0x9811,0x9812,0x9813,0x9814,0x9815,0x9816, -0x9817,0x9818,0x9819,0x981a,0x981b,0x981c,0x981d,0x981e, -0x981f,0x9820,0x9821,0x9822,0x9823,0x9824,0x9825,0x9826, -0x9827,0x9828,0x9829,0x982a,0x982b,0x982c,0x982d,0x982e, -0x982f,0x9830,0x9831,0x9832,0x9833,0x9834,0x9835,0x9836, -0x9837,0x9838,0x9839,0x983a,0x983b,0x983c,0x983d,0x983e, -0x983f,0x9840,0x9841,0x9842,0x9843,0x9844,0x9845,0x9846, -0x9847,0x9848,0x9849,0x984a,0x984b,0x984c,0x984d,0x0000, -0x984e,0x984f,0x9850,0x9851,0x9852,0x9853,0x9854,0x9855, -0x9856,0x9857,0x9858,0x9859,0x985a,0x985b,0x985c,0x985d, -0x985e,0x985f,0x9860,0x9861,0x9862,0x9863,0x9864,0x9865, -0x9866,0x9867,0x9868,0x9869,0x986a,0x986b,0x986c,0x986d, -0x986e,0x7762,0x7765,0x777f,0x778d,0x777d,0x7780,0x778c, -0x7791,0x779f,0x77a0,0x77b0,0x77b5,0x77bd,0x753a,0x7540, -0x754e,0x754b,0x7548,0x755b,0x7572,0x7579,0x7583,0x7f58, -0x7f61,0x7f5f,0x8a48,0x7f68,0x7f74,0x7f71,0x7f79,0x7f81, -0x7f7e,0x76cd,0x76e5,0x8832,0x9485,0x9486,0x9487,0x948b, -0x948a,0x948c,0x948d,0x948f,0x9490,0x9494,0x9497,0x9495, -0x949a,0x949b,0x949c,0x94a3,0x94a4,0x94ab,0x94aa,0x94ad, -0x94ac,0x94af,0x94b0,0x94b2,0x94b4,0x94b6,0x94b7,0x94b8, -0x94b9,0x94ba,0x94bc,0x94bd,0x94bf,0x94c4,0x94c8,0x94c9, -0x94ca,0x94cb,0x94cc,0x94cd,0x94ce,0x94d0,0x94d1,0x94d2, -0x94d5,0x94d6,0x94d7,0x94d9,0x94d8,0x94db,0x94de,0x94df, -0x94e0,0x94e2,0x94e4,0x94e5,0x94e7,0x94e8,0x94ea,0x0000, -/* 0xef00 */ -0x986f,0x9870,0x9871,0x9872,0x9873,0x9874,0x988b,0x988e, -0x9892,0x9895,0x9899,0x98a3,0x98a8,0x98a9,0x98aa,0x98ab, -0x98ac,0x98ad,0x98ae,0x98af,0x98b0,0x98b1,0x98b2,0x98b3, -0x98b4,0x98b5,0x98b6,0x98b7,0x98b8,0x98b9,0x98ba,0x98bb, -0x98bc,0x98bd,0x98be,0x98bf,0x98c0,0x98c1,0x98c2,0x98c3, -0x98c4,0x98c5,0x98c6,0x98c7,0x98c8,0x98c9,0x98ca,0x98cb, -0x98cc,0x98cd,0x98cf,0x98d0,0x98d4,0x98d6,0x98d7,0x98db, -0x98dc,0x98dd,0x98e0,0x98e1,0x98e2,0x98e3,0x98e4,0x0000, -0x98e5,0x98e6,0x98e9,0x98ea,0x98eb,0x98ec,0x98ed,0x98ee, -0x98ef,0x98f0,0x98f1,0x98f2,0x98f3,0x98f4,0x98f5,0x98f6, -0x98f7,0x98f8,0x98f9,0x98fa,0x98fb,0x98fc,0x98fd,0x98fe, -0x98ff,0x9900,0x9901,0x9902,0x9903,0x9904,0x9905,0x9906, -0x9907,0x94e9,0x94eb,0x94ee,0x94ef,0x94f3,0x94f4,0x94f5, -0x94f7,0x94f9,0x94fc,0x94fd,0x94ff,0x9503,0x9502,0x9506, -0x9507,0x9509,0x950a,0x950d,0x950e,0x950f,0x9512,0x9513, -0x9514,0x9515,0x9516,0x9518,0x951b,0x951d,0x951e,0x951f, -0x9522,0x952a,0x952b,0x9529,0x952c,0x9531,0x9532,0x9534, -0x9536,0x9537,0x9538,0x953c,0x953e,0x953f,0x9542,0x9535, -0x9544,0x9545,0x9546,0x9549,0x954c,0x954e,0x954f,0x9552, -0x9553,0x9554,0x9556,0x9557,0x9558,0x9559,0x955b,0x955e, -0x955f,0x955d,0x9561,0x9562,0x9564,0x9565,0x9566,0x9567, -0x9568,0x9569,0x956a,0x956b,0x956c,0x956f,0x9571,0x9572, -0x9573,0x953a,0x77e7,0x77ec,0x96c9,0x79d5,0x79ed,0x79e3, -0x79eb,0x7a06,0x5d47,0x7a03,0x7a02,0x7a1e,0x7a14,0x0000, -/* 0xf000 */ -0x9908,0x9909,0x990a,0x990b,0x990c,0x990e,0x990f,0x9911, -0x9912,0x9913,0x9914,0x9915,0x9916,0x9917,0x9918,0x9919, -0x991a,0x991b,0x991c,0x991d,0x991e,0x991f,0x9920,0x9921, -0x9922,0x9923,0x9924,0x9925,0x9926,0x9927,0x9928,0x9929, -0x992a,0x992b,0x992c,0x992d,0x992f,0x9930,0x9931,0x9932, -0x9933,0x9934,0x9935,0x9936,0x9937,0x9938,0x9939,0x993a, -0x993b,0x993c,0x993d,0x993e,0x993f,0x9940,0x9941,0x9942, -0x9943,0x9944,0x9945,0x9946,0x9947,0x9948,0x9949,0x0000, -0x994a,0x994b,0x994c,0x994d,0x994e,0x994f,0x9950,0x9951, -0x9952,0x9953,0x9956,0x9957,0x9958,0x9959,0x995a,0x995b, -0x995c,0x995d,0x995e,0x995f,0x9960,0x9961,0x9962,0x9964, -0x9966,0x9973,0x9978,0x9979,0x997b,0x997e,0x9982,0x9983, -0x9989,0x7a39,0x7a37,0x7a51,0x9ecf,0x99a5,0x7a70,0x7688, -0x768e,0x7693,0x7699,0x76a4,0x74de,0x74e0,0x752c,0x9e20, -0x9e22,0x9e28,0x9e29,0x9e2a,0x9e2b,0x9e2c,0x9e32,0x9e31, -0x9e36,0x9e38,0x9e37,0x9e39,0x9e3a,0x9e3e,0x9e41,0x9e42, -0x9e44,0x9e46,0x9e47,0x9e48,0x9e49,0x9e4b,0x9e4c,0x9e4e, -0x9e51,0x9e55,0x9e57,0x9e5a,0x9e5b,0x9e5c,0x9e5e,0x9e63, -0x9e66,0x9e67,0x9e68,0x9e69,0x9e6a,0x9e6b,0x9e6c,0x9e71, -0x9e6d,0x9e73,0x7592,0x7594,0x7596,0x75a0,0x759d,0x75ac, -0x75a3,0x75b3,0x75b4,0x75b8,0x75c4,0x75b1,0x75b0,0x75c3, -0x75c2,0x75d6,0x75cd,0x75e3,0x75e8,0x75e6,0x75e4,0x75eb, -0x75e7,0x7603,0x75f1,0x75fc,0x75ff,0x7610,0x7600,0x7605, -0x760c,0x7617,0x760a,0x7625,0x7618,0x7615,0x7619,0x0000, -/* 0xf100 */ -0x998c,0x998e,0x999a,0x999b,0x999c,0x999d,0x999e,0x999f, -0x99a0,0x99a1,0x99a2,0x99a3,0x99a4,0x99a6,0x99a7,0x99a9, -0x99aa,0x99ab,0x99ac,0x99ad,0x99ae,0x99af,0x99b0,0x99b1, -0x99b2,0x99b3,0x99b4,0x99b5,0x99b6,0x99b7,0x99b8,0x99b9, -0x99ba,0x99bb,0x99bc,0x99bd,0x99be,0x99bf,0x99c0,0x99c1, -0x99c2,0x99c3,0x99c4,0x99c5,0x99c6,0x99c7,0x99c8,0x99c9, -0x99ca,0x99cb,0x99cc,0x99cd,0x99ce,0x99cf,0x99d0,0x99d1, -0x99d2,0x99d3,0x99d4,0x99d5,0x99d6,0x99d7,0x99d8,0x0000, -0x99d9,0x99da,0x99db,0x99dc,0x99dd,0x99de,0x99df,0x99e0, -0x99e1,0x99e2,0x99e3,0x99e4,0x99e5,0x99e6,0x99e7,0x99e8, -0x99e9,0x99ea,0x99eb,0x99ec,0x99ed,0x99ee,0x99ef,0x99f0, -0x99f1,0x99f2,0x99f3,0x99f4,0x99f5,0x99f6,0x99f7,0x99f8, -0x99f9,0x761b,0x763c,0x7622,0x7620,0x7640,0x762d,0x7630, -0x763f,0x7635,0x7643,0x763e,0x7633,0x764d,0x765e,0x7654, -0x765c,0x7656,0x766b,0x766f,0x7fca,0x7ae6,0x7a78,0x7a79, -0x7a80,0x7a86,0x7a88,0x7a95,0x7aa6,0x7aa0,0x7aac,0x7aa8, -0x7aad,0x7ab3,0x8864,0x8869,0x8872,0x887d,0x887f,0x8882, -0x88a2,0x88c6,0x88b7,0x88bc,0x88c9,0x88e2,0x88ce,0x88e3, -0x88e5,0x88f1,0x891a,0x88fc,0x88e8,0x88fe,0x88f0,0x8921, -0x8919,0x8913,0x891b,0x890a,0x8934,0x892b,0x8936,0x8941, -0x8966,0x897b,0x758b,0x80e5,0x76b2,0x76b4,0x77dc,0x8012, -0x8014,0x8016,0x801c,0x8020,0x8022,0x8025,0x8026,0x8027, -0x8029,0x8028,0x8031,0x800b,0x8035,0x8043,0x8046,0x804d, -0x8052,0x8069,0x8071,0x8983,0x9878,0x9880,0x9883,0x0000, -/* 0xf200 */ -0x99fa,0x99fb,0x99fc,0x99fd,0x99fe,0x99ff,0x9a00,0x9a01, -0x9a02,0x9a03,0x9a04,0x9a05,0x9a06,0x9a07,0x9a08,0x9a09, -0x9a0a,0x9a0b,0x9a0c,0x9a0d,0x9a0e,0x9a0f,0x9a10,0x9a11, -0x9a12,0x9a13,0x9a14,0x9a15,0x9a16,0x9a17,0x9a18,0x9a19, -0x9a1a,0x9a1b,0x9a1c,0x9a1d,0x9a1e,0x9a1f,0x9a20,0x9a21, -0x9a22,0x9a23,0x9a24,0x9a25,0x9a26,0x9a27,0x9a28,0x9a29, -0x9a2a,0x9a2b,0x9a2c,0x9a2d,0x9a2e,0x9a2f,0x9a30,0x9a31, -0x9a32,0x9a33,0x9a34,0x9a35,0x9a36,0x9a37,0x9a38,0x0000, -0x9a39,0x9a3a,0x9a3b,0x9a3c,0x9a3d,0x9a3e,0x9a3f,0x9a40, -0x9a41,0x9a42,0x9a43,0x9a44,0x9a45,0x9a46,0x9a47,0x9a48, -0x9a49,0x9a4a,0x9a4b,0x9a4c,0x9a4d,0x9a4e,0x9a4f,0x9a50, -0x9a51,0x9a52,0x9a53,0x9a54,0x9a55,0x9a56,0x9a57,0x9a58, -0x9a59,0x9889,0x988c,0x988d,0x988f,0x9894,0x989a,0x989b, -0x989e,0x989f,0x98a1,0x98a2,0x98a5,0x98a6,0x864d,0x8654, -0x866c,0x866e,0x867f,0x867a,0x867c,0x867b,0x86a8,0x868d, -0x868b,0x86ac,0x869d,0x86a7,0x86a3,0x86aa,0x8693,0x86a9, -0x86b6,0x86c4,0x86b5,0x86ce,0x86b0,0x86ba,0x86b1,0x86af, -0x86c9,0x86cf,0x86b4,0x86e9,0x86f1,0x86f2,0x86ed,0x86f3, -0x86d0,0x8713,0x86de,0x86f4,0x86df,0x86d8,0x86d1,0x8703, -0x8707,0x86f8,0x8708,0x870a,0x870d,0x8709,0x8723,0x873b, -0x871e,0x8725,0x872e,0x871a,0x873e,0x8748,0x8734,0x8731, -0x8729,0x8737,0x873f,0x8782,0x8722,0x877d,0x877e,0x877b, -0x8760,0x8770,0x874c,0x876e,0x878b,0x8753,0x8763,0x877c, -0x8764,0x8759,0x8765,0x8793,0x87af,0x87a8,0x87d2,0x0000, -/* 0xf300 */ -0x9a5a,0x9a5b,0x9a5c,0x9a5d,0x9a5e,0x9a5f,0x9a60,0x9a61, -0x9a62,0x9a63,0x9a64,0x9a65,0x9a66,0x9a67,0x9a68,0x9a69, -0x9a6a,0x9a6b,0x9a72,0x9a83,0x9a89,0x9a8d,0x9a8e,0x9a94, -0x9a95,0x9a99,0x9aa6,0x9aa9,0x9aaa,0x9aab,0x9aac,0x9aad, -0x9aae,0x9aaf,0x9ab2,0x9ab3,0x9ab4,0x9ab5,0x9ab9,0x9abb, -0x9abd,0x9abe,0x9abf,0x9ac3,0x9ac4,0x9ac6,0x9ac7,0x9ac8, -0x9ac9,0x9aca,0x9acd,0x9ace,0x9acf,0x9ad0,0x9ad2,0x9ad4, -0x9ad5,0x9ad6,0x9ad7,0x9ad9,0x9ada,0x9adb,0x9adc,0x0000, -0x9add,0x9ade,0x9ae0,0x9ae2,0x9ae3,0x9ae4,0x9ae5,0x9ae7, -0x9ae8,0x9ae9,0x9aea,0x9aec,0x9aee,0x9af0,0x9af1,0x9af2, -0x9af3,0x9af4,0x9af5,0x9af6,0x9af7,0x9af8,0x9afa,0x9afc, -0x9afd,0x9afe,0x9aff,0x9b00,0x9b01,0x9b02,0x9b04,0x9b05, -0x9b06,0x87c6,0x8788,0x8785,0x87ad,0x8797,0x8783,0x87ab, -0x87e5,0x87ac,0x87b5,0x87b3,0x87cb,0x87d3,0x87bd,0x87d1, -0x87c0,0x87ca,0x87db,0x87ea,0x87e0,0x87ee,0x8816,0x8813, -0x87fe,0x880a,0x881b,0x8821,0x8839,0x883c,0x7f36,0x7f42, -0x7f44,0x7f45,0x8210,0x7afa,0x7afd,0x7b08,0x7b03,0x7b04, -0x7b15,0x7b0a,0x7b2b,0x7b0f,0x7b47,0x7b38,0x7b2a,0x7b19, -0x7b2e,0x7b31,0x7b20,0x7b25,0x7b24,0x7b33,0x7b3e,0x7b1e, -0x7b58,0x7b5a,0x7b45,0x7b75,0x7b4c,0x7b5d,0x7b60,0x7b6e, -0x7b7b,0x7b62,0x7b72,0x7b71,0x7b90,0x7ba6,0x7ba7,0x7bb8, -0x7bac,0x7b9d,0x7ba8,0x7b85,0x7baa,0x7b9c,0x7ba2,0x7bab, -0x7bb4,0x7bd1,0x7bc1,0x7bcc,0x7bdd,0x7bda,0x7be5,0x7be6, -0x7bea,0x7c0c,0x7bfe,0x7bfc,0x7c0f,0x7c16,0x7c0b,0x0000, -/* 0xf400 */ -0x9b07,0x9b09,0x9b0a,0x9b0b,0x9b0c,0x9b0d,0x9b0e,0x9b10, -0x9b11,0x9b12,0x9b14,0x9b15,0x9b16,0x9b17,0x9b18,0x9b19, -0x9b1a,0x9b1b,0x9b1c,0x9b1d,0x9b1e,0x9b20,0x9b21,0x9b22, -0x9b24,0x9b25,0x9b26,0x9b27,0x9b28,0x9b29,0x9b2a,0x9b2b, -0x9b2c,0x9b2d,0x9b2e,0x9b30,0x9b31,0x9b33,0x9b34,0x9b35, -0x9b36,0x9b37,0x9b38,0x9b39,0x9b3a,0x9b3d,0x9b3e,0x9b3f, -0x9b40,0x9b46,0x9b4a,0x9b4b,0x9b4c,0x9b4e,0x9b50,0x9b52, -0x9b53,0x9b55,0x9b56,0x9b57,0x9b58,0x9b59,0x9b5a,0x0000, -0x9b5b,0x9b5c,0x9b5d,0x9b5e,0x9b5f,0x9b60,0x9b61,0x9b62, -0x9b63,0x9b64,0x9b65,0x9b66,0x9b67,0x9b68,0x9b69,0x9b6a, -0x9b6b,0x9b6c,0x9b6d,0x9b6e,0x9b6f,0x9b70,0x9b71,0x9b72, -0x9b73,0x9b74,0x9b75,0x9b76,0x9b77,0x9b78,0x9b79,0x9b7a, -0x9b7b,0x7c1f,0x7c2a,0x7c26,0x7c38,0x7c41,0x7c40,0x81fe, -0x8201,0x8202,0x8204,0x81ec,0x8844,0x8221,0x8222,0x8223, -0x822d,0x822f,0x8228,0x822b,0x8238,0x823b,0x8233,0x8234, -0x823e,0x8244,0x8249,0x824b,0x824f,0x825a,0x825f,0x8268, -0x887e,0x8885,0x8888,0x88d8,0x88df,0x895e,0x7f9d,0x7f9f, -0x7fa7,0x7faf,0x7fb0,0x7fb2,0x7c7c,0x6549,0x7c91,0x7c9d, -0x7c9c,0x7c9e,0x7ca2,0x7cb2,0x7cbc,0x7cbd,0x7cc1,0x7cc7, -0x7ccc,0x7ccd,0x7cc8,0x7cc5,0x7cd7,0x7ce8,0x826e,0x66a8, -0x7fbf,0x7fce,0x7fd5,0x7fe5,0x7fe1,0x7fe6,0x7fe9,0x7fee, -0x7ff3,0x7cf8,0x7d77,0x7da6,0x7dae,0x7e47,0x7e9b,0x9eb8, -0x9eb4,0x8d73,0x8d84,0x8d94,0x8d91,0x8db1,0x8d67,0x8d6d, -0x8c47,0x8c49,0x914a,0x9150,0x914e,0x914f,0x9164,0x0000, -/* 0xf500 */ -0x9b7c,0x9b7d,0x9b7e,0x9b7f,0x9b80,0x9b81,0x9b82,0x9b83, -0x9b84,0x9b85,0x9b86,0x9b87,0x9b88,0x9b89,0x9b8a,0x9b8b, -0x9b8c,0x9b8d,0x9b8e,0x9b8f,0x9b90,0x9b91,0x9b92,0x9b93, -0x9b94,0x9b95,0x9b96,0x9b97,0x9b98,0x9b99,0x9b9a,0x9b9b, -0x9b9c,0x9b9d,0x9b9e,0x9b9f,0x9ba0,0x9ba1,0x9ba2,0x9ba3, -0x9ba4,0x9ba5,0x9ba6,0x9ba7,0x9ba8,0x9ba9,0x9baa,0x9bab, -0x9bac,0x9bad,0x9bae,0x9baf,0x9bb0,0x9bb1,0x9bb2,0x9bb3, -0x9bb4,0x9bb5,0x9bb6,0x9bb7,0x9bb8,0x9bb9,0x9bba,0x0000, -0x9bbb,0x9bbc,0x9bbd,0x9bbe,0x9bbf,0x9bc0,0x9bc1,0x9bc2, -0x9bc3,0x9bc4,0x9bc5,0x9bc6,0x9bc7,0x9bc8,0x9bc9,0x9bca, -0x9bcb,0x9bcc,0x9bcd,0x9bce,0x9bcf,0x9bd0,0x9bd1,0x9bd2, -0x9bd3,0x9bd4,0x9bd5,0x9bd6,0x9bd7,0x9bd8,0x9bd9,0x9bda, -0x9bdb,0x9162,0x9161,0x9170,0x9169,0x916f,0x917d,0x917e, -0x9172,0x9174,0x9179,0x918c,0x9185,0x9190,0x918d,0x9191, -0x91a2,0x91a3,0x91aa,0x91ad,0x91ae,0x91af,0x91b5,0x91b4, -0x91ba,0x8c55,0x9e7e,0x8db8,0x8deb,0x8e05,0x8e59,0x8e69, -0x8db5,0x8dbf,0x8dbc,0x8dba,0x8dc4,0x8dd6,0x8dd7,0x8dda, -0x8dde,0x8dce,0x8dcf,0x8ddb,0x8dc6,0x8dec,0x8df7,0x8df8, -0x8de3,0x8df9,0x8dfb,0x8de4,0x8e09,0x8dfd,0x8e14,0x8e1d, -0x8e1f,0x8e2c,0x8e2e,0x8e23,0x8e2f,0x8e3a,0x8e40,0x8e39, -0x8e35,0x8e3d,0x8e31,0x8e49,0x8e41,0x8e42,0x8e51,0x8e52, -0x8e4a,0x8e70,0x8e76,0x8e7c,0x8e6f,0x8e74,0x8e85,0x8e8f, -0x8e94,0x8e90,0x8e9c,0x8e9e,0x8c78,0x8c82,0x8c8a,0x8c85, -0x8c98,0x8c94,0x659b,0x89d6,0x89de,0x89da,0x89dc,0x0000, -/* 0xf600 */ -0x9bdc,0x9bdd,0x9bde,0x9bdf,0x9be0,0x9be1,0x9be2,0x9be3, -0x9be4,0x9be5,0x9be6,0x9be7,0x9be8,0x9be9,0x9bea,0x9beb, -0x9bec,0x9bed,0x9bee,0x9bef,0x9bf0,0x9bf1,0x9bf2,0x9bf3, -0x9bf4,0x9bf5,0x9bf6,0x9bf7,0x9bf8,0x9bf9,0x9bfa,0x9bfb, -0x9bfc,0x9bfd,0x9bfe,0x9bff,0x9c00,0x9c01,0x9c02,0x9c03, -0x9c04,0x9c05,0x9c06,0x9c07,0x9c08,0x9c09,0x9c0a,0x9c0b, -0x9c0c,0x9c0d,0x9c0e,0x9c0f,0x9c10,0x9c11,0x9c12,0x9c13, -0x9c14,0x9c15,0x9c16,0x9c17,0x9c18,0x9c19,0x9c1a,0x0000, -0x9c1b,0x9c1c,0x9c1d,0x9c1e,0x9c1f,0x9c20,0x9c21,0x9c22, -0x9c23,0x9c24,0x9c25,0x9c26,0x9c27,0x9c28,0x9c29,0x9c2a, -0x9c2b,0x9c2c,0x9c2d,0x9c2e,0x9c2f,0x9c30,0x9c31,0x9c32, -0x9c33,0x9c34,0x9c35,0x9c36,0x9c37,0x9c38,0x9c39,0x9c3a, -0x9c3b,0x89e5,0x89eb,0x89ef,0x8a3e,0x8b26,0x9753,0x96e9, -0x96f3,0x96ef,0x9706,0x9701,0x9708,0x970f,0x970e,0x972a, -0x972d,0x9730,0x973e,0x9f80,0x9f83,0x9f85,0x9f86,0x9f87, -0x9f88,0x9f89,0x9f8a,0x9f8c,0x9efe,0x9f0b,0x9f0d,0x96b9, -0x96bc,0x96bd,0x96ce,0x96d2,0x77bf,0x96e0,0x928e,0x92ae, -0x92c8,0x933e,0x936a,0x93ca,0x938f,0x943e,0x946b,0x9c7f, -0x9c82,0x9c85,0x9c86,0x9c87,0x9c88,0x7a23,0x9c8b,0x9c8e, -0x9c90,0x9c91,0x9c92,0x9c94,0x9c95,0x9c9a,0x9c9b,0x9c9e, -0x9c9f,0x9ca0,0x9ca1,0x9ca2,0x9ca3,0x9ca5,0x9ca6,0x9ca7, -0x9ca8,0x9ca9,0x9cab,0x9cad,0x9cae,0x9cb0,0x9cb1,0x9cb2, -0x9cb3,0x9cb4,0x9cb5,0x9cb6,0x9cb7,0x9cba,0x9cbb,0x9cbc, -0x9cbd,0x9cc4,0x9cc5,0x9cc6,0x9cc7,0x9cca,0x9ccb,0x0000, -/* 0xf700 */ -0x9c3c,0x9c3d,0x9c3e,0x9c3f,0x9c40,0x9c41,0x9c42,0x9c43, -0x9c44,0x9c45,0x9c46,0x9c47,0x9c48,0x9c49,0x9c4a,0x9c4b, -0x9c4c,0x9c4d,0x9c4e,0x9c4f,0x9c50,0x9c51,0x9c52,0x9c53, -0x9c54,0x9c55,0x9c56,0x9c57,0x9c58,0x9c59,0x9c5a,0x9c5b, -0x9c5c,0x9c5d,0x9c5e,0x9c5f,0x9c60,0x9c61,0x9c62,0x9c63, -0x9c64,0x9c65,0x9c66,0x9c67,0x9c68,0x9c69,0x9c6a,0x9c6b, -0x9c6c,0x9c6d,0x9c6e,0x9c6f,0x9c70,0x9c71,0x9c72,0x9c73, -0x9c74,0x9c75,0x9c76,0x9c77,0x9c78,0x9c79,0x9c7a,0x0000, -0x9c7b,0x9c7d,0x9c7e,0x9c80,0x9c83,0x9c84,0x9c89,0x9c8a, -0x9c8c,0x9c8f,0x9c93,0x9c96,0x9c97,0x9c98,0x9c99,0x9c9d, -0x9caa,0x9cac,0x9caf,0x9cb9,0x9cbe,0x9cbf,0x9cc0,0x9cc1, -0x9cc2,0x9cc8,0x9cc9,0x9cd1,0x9cd2,0x9cda,0x9cdb,0x9ce0, -0x9ce1,0x9ccc,0x9ccd,0x9cce,0x9ccf,0x9cd0,0x9cd3,0x9cd4, -0x9cd5,0x9cd7,0x9cd8,0x9cd9,0x9cdc,0x9cdd,0x9cdf,0x9ce2, -0x977c,0x9785,0x9791,0x9792,0x9794,0x97af,0x97ab,0x97a3, -0x97b2,0x97b4,0x9ab1,0x9ab0,0x9ab7,0x9e58,0x9ab6,0x9aba, -0x9abc,0x9ac1,0x9ac0,0x9ac5,0x9ac2,0x9acb,0x9acc,0x9ad1, -0x9b45,0x9b43,0x9b47,0x9b49,0x9b48,0x9b4d,0x9b51,0x98e8, -0x990d,0x992e,0x9955,0x9954,0x9adf,0x9ae1,0x9ae6,0x9aef, -0x9aeb,0x9afb,0x9aed,0x9af9,0x9b08,0x9b0f,0x9b13,0x9b1f, -0x9b23,0x9ebd,0x9ebe,0x7e3b,0x9e82,0x9e87,0x9e88,0x9e8b, -0x9e92,0x93d6,0x9e9d,0x9e9f,0x9edb,0x9edc,0x9edd,0x9ee0, -0x9edf,0x9ee2,0x9ee9,0x9ee7,0x9ee5,0x9eea,0x9eef,0x9f22, -0x9f2c,0x9f2f,0x9f39,0x9f37,0x9f3d,0x9f3e,0x9f44,0x0000, -/* 0xf800 */ -0x9ce3,0x9ce4,0x9ce5,0x9ce6,0x9ce7,0x9ce8,0x9ce9,0x9cea, -0x9ceb,0x9cec,0x9ced,0x9cee,0x9cef,0x9cf0,0x9cf1,0x9cf2, -0x9cf3,0x9cf4,0x9cf5,0x9cf6,0x9cf7,0x9cf8,0x9cf9,0x9cfa, -0x9cfb,0x9cfc,0x9cfd,0x9cfe,0x9cff,0x9d00,0x9d01,0x9d02, -0x9d03,0x9d04,0x9d05,0x9d06,0x9d07,0x9d08,0x9d09,0x9d0a, -0x9d0b,0x9d0c,0x9d0d,0x9d0e,0x9d0f,0x9d10,0x9d11,0x9d12, -0x9d13,0x9d14,0x9d15,0x9d16,0x9d17,0x9d18,0x9d19,0x9d1a, -0x9d1b,0x9d1c,0x9d1d,0x9d1e,0x9d1f,0x9d20,0x9d21,0x0000, -0x9d22,0x9d23,0x9d24,0x9d25,0x9d26,0x9d27,0x9d28,0x9d29, -0x9d2a,0x9d2b,0x9d2c,0x9d2d,0x9d2e,0x9d2f,0x9d30,0x9d31, -0x9d32,0x9d33,0x9d34,0x9d35,0x9d36,0x9d37,0x9d38,0x9d39, -0x9d3a,0x9d3b,0x9d3c,0x9d3d,0x9d3e,0x9d3f,0x9d40,0x9d41, -0x9d42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xf900 */ -0x9d43,0x9d44,0x9d45,0x9d46,0x9d47,0x9d48,0x9d49,0x9d4a, -0x9d4b,0x9d4c,0x9d4d,0x9d4e,0x9d4f,0x9d50,0x9d51,0x9d52, -0x9d53,0x9d54,0x9d55,0x9d56,0x9d57,0x9d58,0x9d59,0x9d5a, -0x9d5b,0x9d5c,0x9d5d,0x9d5e,0x9d5f,0x9d60,0x9d61,0x9d62, -0x9d63,0x9d64,0x9d65,0x9d66,0x9d67,0x9d68,0x9d69,0x9d6a, -0x9d6b,0x9d6c,0x9d6d,0x9d6e,0x9d6f,0x9d70,0x9d71,0x9d72, -0x9d73,0x9d74,0x9d75,0x9d76,0x9d77,0x9d78,0x9d79,0x9d7a, -0x9d7b,0x9d7c,0x9d7d,0x9d7e,0x9d7f,0x9d80,0x9d81,0x0000, -0x9d82,0x9d83,0x9d84,0x9d85,0x9d86,0x9d87,0x9d88,0x9d89, -0x9d8a,0x9d8b,0x9d8c,0x9d8d,0x9d8e,0x9d8f,0x9d90,0x9d91, -0x9d92,0x9d93,0x9d94,0x9d95,0x9d96,0x9d97,0x9d98,0x9d99, -0x9d9a,0x9d9b,0x9d9c,0x9d9d,0x9d9e,0x9d9f,0x9da0,0x9da1, -0x9da2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfa00 */ -0x9da3,0x9da4,0x9da5,0x9da6,0x9da7,0x9da8,0x9da9,0x9daa, -0x9dab,0x9dac,0x9dad,0x9dae,0x9daf,0x9db0,0x9db1,0x9db2, -0x9db3,0x9db4,0x9db5,0x9db6,0x9db7,0x9db8,0x9db9,0x9dba, -0x9dbb,0x9dbc,0x9dbd,0x9dbe,0x9dbf,0x9dc0,0x9dc1,0x9dc2, -0x9dc3,0x9dc4,0x9dc5,0x9dc6,0x9dc7,0x9dc8,0x9dc9,0x9dca, -0x9dcb,0x9dcc,0x9dcd,0x9dce,0x9dcf,0x9dd0,0x9dd1,0x9dd2, -0x9dd3,0x9dd4,0x9dd5,0x9dd6,0x9dd7,0x9dd8,0x9dd9,0x9dda, -0x9ddb,0x9ddc,0x9ddd,0x9dde,0x9ddf,0x9de0,0x9de1,0x0000, -0x9de2,0x9de3,0x9de4,0x9de5,0x9de6,0x9de7,0x9de8,0x9de9, -0x9dea,0x9deb,0x9dec,0x9ded,0x9dee,0x9def,0x9df0,0x9df1, -0x9df2,0x9df3,0x9df4,0x9df5,0x9df6,0x9df7,0x9df8,0x9df9, -0x9dfa,0x9dfb,0x9dfc,0x9dfd,0x9dfe,0x9dff,0x9e00,0x9e01, -0x9e02,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfb00 */ -0x9e03,0x9e04,0x9e05,0x9e06,0x9e07,0x9e08,0x9e09,0x9e0a, -0x9e0b,0x9e0c,0x9e0d,0x9e0e,0x9e0f,0x9e10,0x9e11,0x9e12, -0x9e13,0x9e14,0x9e15,0x9e16,0x9e17,0x9e18,0x9e19,0x9e1a, -0x9e1b,0x9e1c,0x9e1d,0x9e1e,0x9e24,0x9e27,0x9e2e,0x9e30, -0x9e34,0x9e3b,0x9e3c,0x9e40,0x9e4d,0x9e50,0x9e52,0x9e53, -0x9e54,0x9e56,0x9e59,0x9e5d,0x9e5f,0x9e60,0x9e61,0x9e62, -0x9e65,0x9e6e,0x9e6f,0x9e72,0x9e74,0x9e75,0x9e76,0x9e77, -0x9e78,0x9e79,0x9e7a,0x9e7b,0x9e7c,0x9e7d,0x9e80,0x0000, -0x9e81,0x9e83,0x9e84,0x9e85,0x9e86,0x9e89,0x9e8a,0x9e8c, -0x9e8d,0x9e8e,0x9e8f,0x9e90,0x9e91,0x9e94,0x9e95,0x9e96, -0x9e97,0x9e98,0x9e99,0x9e9a,0x9e9b,0x9e9c,0x9e9e,0x9ea0, -0x9ea1,0x9ea2,0x9ea3,0x9ea4,0x9ea5,0x9ea7,0x9ea8,0x9ea9, -0x9eaa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfc00 */ -0x9eab,0x9eac,0x9ead,0x9eae,0x9eaf,0x9eb0,0x9eb1,0x9eb2, -0x9eb3,0x9eb5,0x9eb6,0x9eb7,0x9eb9,0x9eba,0x9ebc,0x9ebf, -0x9ec0,0x9ec1,0x9ec2,0x9ec3,0x9ec5,0x9ec6,0x9ec7,0x9ec8, -0x9eca,0x9ecb,0x9ecc,0x9ed0,0x9ed2,0x9ed3,0x9ed5,0x9ed6, -0x9ed7,0x9ed9,0x9eda,0x9ede,0x9ee1,0x9ee3,0x9ee4,0x9ee6, -0x9ee8,0x9eeb,0x9eec,0x9eed,0x9eee,0x9ef0,0x9ef1,0x9ef2, -0x9ef3,0x9ef4,0x9ef5,0x9ef6,0x9ef7,0x9ef8,0x9efa,0x9efd, -0x9eff,0x9f00,0x9f01,0x9f02,0x9f03,0x9f04,0x9f05,0x0000, -0x9f06,0x9f07,0x9f08,0x9f09,0x9f0a,0x9f0c,0x9f0f,0x9f11, -0x9f12,0x9f14,0x9f15,0x9f16,0x9f18,0x9f1a,0x9f1b,0x9f1c, -0x9f1d,0x9f1e,0x9f1f,0x9f21,0x9f23,0x9f24,0x9f25,0x9f26, -0x9f27,0x9f28,0x9f29,0x9f2a,0x9f2b,0x9f2d,0x9f2e,0x9f30, -0x9f31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfd00 */ -0x9f32,0x9f33,0x9f34,0x9f35,0x9f36,0x9f38,0x9f3a,0x9f3c, -0x9f3f,0x9f40,0x9f41,0x9f42,0x9f43,0x9f45,0x9f46,0x9f47, -0x9f48,0x9f49,0x9f4a,0x9f4b,0x9f4c,0x9f4d,0x9f4e,0x9f4f, -0x9f52,0x9f53,0x9f54,0x9f55,0x9f56,0x9f57,0x9f58,0x9f59, -0x9f5a,0x9f5b,0x9f5c,0x9f5d,0x9f5e,0x9f5f,0x9f60,0x9f61, -0x9f62,0x9f63,0x9f64,0x9f65,0x9f66,0x9f67,0x9f68,0x9f69, -0x9f6a,0x9f6b,0x9f6c,0x9f6d,0x9f6e,0x9f6f,0x9f70,0x9f71, -0x9f72,0x9f73,0x9f74,0x9f75,0x9f76,0x9f77,0x9f78,0x0000, -0x9f79,0x9f7a,0x9f7b,0x9f7c,0x9f7d,0x9f7e,0x9f81,0x9f82, -0x9f8d,0x9f8e,0x9f8f,0x9f90,0x9f91,0x9f92,0x9f93,0x9f94, -0x9f95,0x9f96,0x9f97,0x9f98,0x9f9c,0x9f9d,0x9f9e,0x9fa1, -0x9fa2,0x9fa3,0x9fa4,0x9fa5,0xf92c,0xf979,0xf995,0xf9e7, -0xf9f1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfe00 */ -0xfa0c,0xfa0d,0xfa0e,0xfa0f,0xfa11,0xfa13,0xfa14,0xfa18, -0xfa1f,0xfa20,0xfa21,0xfa23,0xfa24,0xfa27,0xfa28,0xfa29}; - -static const int cp936_ucs_table_size = (sizeof(cp936_ucs_table)/sizeof(unsigned short)); - - -/* UCS -> CP936 */ -static const unsigned short ucs_a1_cp936_table[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x007f, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1e8,0x0000,0x0000,0xa1ec, -0xa1a7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1e3,0xa1c0,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1a4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1c1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8a4,0xa8a2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8a8,0xa8a6,0xa8ba,0x0000,0xa8ac,0xa8aa,0x0000,0x0000, -0x0000,0x0000,0xa8b0,0xa8ae,0x0000,0x0000,0x0000,0xa1c2, -0x0000,0xa8b4,0xa8b2,0x0000,0xa8b9,0x0000,0x0000,0x0000, -/* 0x0100 */ -0x0000,0xa8a1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8a5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8a7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8a9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa8bd,0x0000,0x0000,0x0000, -0xa8be,0x0000,0x0000,0x0000,0x0000,0xa8ad,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8b1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8a3,0x0000, -0xa8ab,0x0000,0xa8af,0x0000,0xa8b3,0x0000,0xa8b5,0x0000, -0xa8b6,0x0000,0xa8b7,0x0000,0xa8b8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa8bb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa8c0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1a6, -0x0000,0xa1a5,0xa840,0xa841,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa842,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa6a1,0xa6a2,0xa6a3,0xa6a4,0xa6a5,0xa6a6,0xa6a7, -0xa6a8,0xa6a9,0xa6aa,0xa6ab,0xa6ac,0xa6ad,0xa6ae,0xa6af, -0xa6b0,0xa6b1,0x0000,0xa6b2,0xa6b3,0xa6b4,0xa6b5,0xa6b6, -0xa6b7,0xa6b8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa6c1,0xa6c2,0xa6c3,0xa6c4,0xa6c5,0xa6c6,0xa6c7, -0xa6c8,0xa6c9,0xa6ca,0xa6cb,0xa6cc,0xa6cd,0xa6ce,0xa6cf, -0xa6d0,0xa6d1,0x0000,0xa6d2,0xa6d3,0xa6d4,0xa6d5,0xa6d6, -0xa6d7,0xa6d8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0400 */ -0x0000,0xa7a7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa7a1,0xa7a2,0xa7a3,0xa7a4,0xa7a5,0xa7a6,0xa7a8,0xa7a9, -0xa7aa,0xa7ab,0xa7ac,0xa7ad,0xa7ae,0xa7af,0xa7b0,0xa7b1, -0xa7b2,0xa7b3,0xa7b4,0xa7b5,0xa7b6,0xa7b7,0xa7b8,0xa7b9, -0xa7ba,0xa7bb,0xa7bc,0xa7bd,0xa7be,0xa7bf,0xa7c0,0xa7c1, -0xa7d1,0xa7d2,0xa7d3,0xa7d4,0xa7d5,0xa7d6,0xa7d8,0xa7d9, -0xa7da,0xa7db,0xa7dc,0xa7dd,0xa7de,0xa7df,0xa7e0,0xa7e1, -0xa7e2,0xa7e3,0xa7e4,0xa7e5,0xa7e6,0xa7e7,0xa7e8,0xa7e9, -0xa7ea,0xa7eb,0xa7ec,0xa7ed,0xa7ee,0xa7ef,0xa7f0,0xa7f1, -0x0000,0xa7d7}; - -static const int ucs_a1_cp936_table_min = 0x0000; -static const int ucs_a1_cp936_table_max = 0x0000 + (sizeof (ucs_a1_cp936_table) / sizeof (unsigned short)); - -/* 0x2000 */ -static const unsigned short ucs_a2_cp936_table[] = { -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa95c,0x0000,0x0000,0xa843,0xa1aa,0xa844,0xa1ac,0x0000, -0xa1ae,0xa1af,0x0000,0x0000,0xa1b0,0xa1b1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa845,0xa1ad,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1eb,0x0000,0xa1e4,0xa1e5,0x0000,0xa846,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa1f9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0080,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2100 */ -0x0000,0x0000,0x0000,0xa1e6,0x0000,0xa847,0x0000,0x0000, -0x0000,0xa848,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1ed,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa959,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2f1,0xa2f2,0xa2f3,0xa2f4,0xa2f5,0xa2f6,0xa2f7,0xa2f8, -0xa2f9,0xa2fa,0xa2fb,0xa2fc,0x0000,0x0000,0x0000,0x0000, -0xa2a1,0xa2a2,0xa2a3,0xa2a4,0xa2a5,0xa2a6,0xa2a7,0xa2a8, -0xa2a9,0xa2aa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1fb,0xa1fc,0xa1fa,0xa1fd,0x0000,0x0000,0xa849,0xa84a, -0xa84b,0xa84c,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1ca,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1c7, -0x0000,0xa1c6,0x0000,0x0000,0x0000,0xa84d,0x0000,0x0000, -0x0000,0x0000,0xa1cc,0x0000,0x0000,0xa1d8,0xa1de,0xa84e, -0xa1cf,0x0000,0x0000,0xa84f,0x0000,0xa1ce,0x0000,0xa1c4, -0xa1c5,0xa1c9,0xa1c8,0xa1d2,0x0000,0x0000,0xa1d3,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1e0,0xa1df,0xa1c3,0xa1cb, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1d7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1d6,0x0000,0x0000,0x0000,0xa1d5,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa850,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1d9,0xa1d4,0x0000,0x0000,0xa1dc,0xa1dd,0xa851,0xa852, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1da,0xa1db, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa892,0x0000,0x0000, -0x0000,0xa1d1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1cd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa853, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1d0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2d9,0xa2da,0xa2db,0xa2dc,0xa2dd,0xa2de,0xa2df,0xa2e0, -0xa2e1,0xa2e2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa2c5,0xa2c6,0xa2c7,0xa2c8, -0xa2c9,0xa2ca,0xa2cb,0xa2cc,0xa2cd,0xa2ce,0xa2cf,0xa2d0, -0xa2d1,0xa2d2,0xa2d3,0xa2d4,0xa2d5,0xa2d6,0xa2d7,0xa2d8, -0xa2b1,0xa2b2,0xa2b3,0xa2b4,0xa2b5,0xa2b6,0xa2b7,0xa2b8, -0xa2b9,0xa2ba,0xa2bb,0xa2bc,0xa2bd,0xa2be,0xa2bf,0xa2c0, -0xa2c1,0xa2c2,0xa2c3,0xa2c4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2500 */ -0xa9a4,0xa9a5,0xa9a6,0xa9a7,0xa9a8,0xa9a9,0xa9aa,0xa9ab, -0xa9ac,0xa9ad,0xa9ae,0xa9af,0xa9b0,0xa9b1,0xa9b2,0xa9b3, -0xa9b4,0xa9b5,0xa9b6,0xa9b7,0xa9b8,0xa9b9,0xa9ba,0xa9bb, -0xa9bc,0xa9bd,0xa9be,0xa9bf,0xa9c0,0xa9c1,0xa9c2,0xa9c3, -0xa9c4,0xa9c5,0xa9c6,0xa9c7,0xa9c8,0xa9c9,0xa9ca,0xa9cb, -0xa9cc,0xa9cd,0xa9ce,0xa9cf,0xa9d0,0xa9d1,0xa9d2,0xa9d3, -0xa9d4,0xa9d5,0xa9d6,0xa9d7,0xa9d8,0xa9d9,0xa9da,0xa9db, -0xa9dc,0xa9dd,0xa9de,0xa9df,0xa9e0,0xa9e1,0xa9e2,0xa9e3, -0xa9e4,0xa9e5,0xa9e6,0xa9e7,0xa9e8,0xa9e9,0xa9ea,0xa9eb, -0xa9ec,0xa9ed,0xa9ee,0xa9ef,0x0000,0x0000,0x0000,0x0000, -0xa854,0xa855,0xa856,0xa857,0xa858,0xa859,0xa85a,0xa85b, -0xa85c,0xa85d,0xa85e,0xa85f,0xa860,0xa861,0xa862,0xa863, -0xa864,0xa865,0xa866,0xa867,0xa868,0xa869,0xa86a,0xa86b, -0xa86c,0xa86d,0xa86e,0xa86f,0xa870,0xa871,0xa872,0xa873, -0xa874,0xa875,0xa876,0xa877,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa878,0xa879,0xa87a,0xa87b,0xa87c,0xa87d,0xa87e, -0xa880,0xa881,0xa882,0xa883,0xa884,0xa885,0xa886,0xa887, -0x0000,0x0000,0x0000,0xa888,0xa889,0xa88a,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1f6,0xa1f5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1f8,0xa1f7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa88b,0xa88c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1f4,0xa1f3, -0x0000,0x0000,0x0000,0xa1f0,0x0000,0x0000,0xa1f2,0xa1f1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa88d,0xa88e,0xa88f,0xa890,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1ef,0xa1ee,0x0000, -0x0000,0xa891,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1e2,0x0000,0xa1e1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; -static const int ucs_a2_cp936_table_min = 0x2000; -static const int ucs_a2_cp936_table_max = 0x2000 + (sizeof (ucs_a2_cp936_table) / sizeof (unsigned short)); - -static const unsigned short ucs_a3_cp936_table[] = { -/* 0x2f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1a1,0xa1a2,0xa1a3,0xa1a8,0x0000,0xa1a9,0xa965,0xa996, -0xa1b4,0xa1b5,0xa1b6,0xa1b7,0xa1b8,0xa1b9,0xa1ba,0xa1bb, -0xa1be,0xa1bf,0xa893,0xa1fe,0xa1b2,0xa1b3,0xa1bc,0xa1bd, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa894,0xa895,0x0000, -0x0000,0xa940,0xa941,0xa942,0xa943,0xa944,0xa945,0xa946, -0xa947,0xa948,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa4a1,0xa4a2,0xa4a3,0xa4a4,0xa4a5,0xa4a6,0xa4a7, -0xa4a8,0xa4a9,0xa4aa,0xa4ab,0xa4ac,0xa4ad,0xa4ae,0xa4af, -0xa4b0,0xa4b1,0xa4b2,0xa4b3,0xa4b4,0xa4b5,0xa4b6,0xa4b7, -0xa4b8,0xa4b9,0xa4ba,0xa4bb,0xa4bc,0xa4bd,0xa4be,0xa4bf, -0xa4c0,0xa4c1,0xa4c2,0xa4c3,0xa4c4,0xa4c5,0xa4c6,0xa4c7, -0xa4c8,0xa4c9,0xa4ca,0xa4cb,0xa4cc,0xa4cd,0xa4ce,0xa4cf, -0xa4d0,0xa4d1,0xa4d2,0xa4d3,0xa4d4,0xa4d5,0xa4d6,0xa4d7, -0xa4d8,0xa4d9,0xa4da,0xa4db,0xa4dc,0xa4dd,0xa4de,0xa4df, -0xa4e0,0xa4e1,0xa4e2,0xa4e3,0xa4e4,0xa4e5,0xa4e6,0xa4e7, -0xa4e8,0xa4e9,0xa4ea,0xa4eb,0xa4ec,0xa4ed,0xa4ee,0xa4ef, -0xa4f0,0xa4f1,0xa4f2,0xa4f3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa961,0xa962,0xa966,0xa967,0x0000, -0x0000,0xa5a1,0xa5a2,0xa5a3,0xa5a4,0xa5a5,0xa5a6,0xa5a7, -0xa5a8,0xa5a9,0xa5aa,0xa5ab,0xa5ac,0xa5ad,0xa5ae,0xa5af, -0xa5b0,0xa5b1,0xa5b2,0xa5b3,0xa5b4,0xa5b5,0xa5b6,0xa5b7, -0xa5b8,0xa5b9,0xa5ba,0xa5bb,0xa5bc,0xa5bd,0xa5be,0xa5bf, -0xa5c0,0xa5c1,0xa5c2,0xa5c3,0xa5c4,0xa5c5,0xa5c6,0xa5c7, -0xa5c8,0xa5c9,0xa5ca,0xa5cb,0xa5cc,0xa5cd,0xa5ce,0xa5cf, -0xa5d0,0xa5d1,0xa5d2,0xa5d3,0xa5d4,0xa5d5,0xa5d6,0xa5d7, -0xa5d8,0xa5d9,0xa5da,0xa5db,0xa5dc,0xa5dd,0xa5de,0xa5df, -0xa5e0,0xa5e1,0xa5e2,0xa5e3,0xa5e4,0xa5e5,0xa5e6,0xa5e7, -0xa5e8,0xa5e9,0xa5ea,0xa5eb,0xa5ec,0xa5ed,0xa5ee,0xa5ef, -0xa5f0,0xa5f1,0xa5f2,0xa5f3,0xa5f4,0xa5f5,0xa5f6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa960,0xa963,0xa964,0x0000, -/* 0x3100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa8c5,0xa8c6,0xa8c7, -0xa8c8,0xa8c9,0xa8ca,0xa8cb,0xa8cc,0xa8cd,0xa8ce,0xa8cf, -0xa8d0,0xa8d1,0xa8d2,0xa8d3,0xa8d4,0xa8d5,0xa8d6,0xa8d7, -0xa8d8,0xa8d9,0xa8da,0xa8db,0xa8dc,0xa8dd,0xa8de,0xa8df, -0xa8e0,0xa8e1,0xa8e2,0xa8e3,0xa8e4,0xa8e5,0xa8e6,0xa8e7, -0xa8e8,0xa8e9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2e5,0xa2e6,0xa2e7,0xa2e8,0xa2e9,0xa2ea,0xa2eb,0xa2ec, -0xa2ed,0xa2ee,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa95a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa949,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa94a,0xa94b, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa94c,0xa94d,0xa94e,0x0000, -0x0000,0xa94f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa950,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa951,0x0000, -0x0000,0xa952,0xa953,0x0000,0x0000,0xa954,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; - -static const int ucs_a3_cp936_table_min = 0x2f00; -static const int ucs_a3_cp936_table_max = 0x2f00 + (sizeof (ucs_a3_cp936_table) / sizeof (unsigned short)); - -/* 4d00h CJK Unified Ideographs (+ Extension A) */ -static const unsigned short ucs_i_cp936_table[] = { -/* 0x4d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd2bb,0xb6a1,0x8140,0xc6df,0x8141,0x8142,0x8143,0xcdf2, -0xd5c9,0xc8fd,0xc9cf,0xcfc2,0xd8a2,0xb2bb,0xd3eb,0x8144, -0xd8a4,0xb3f3,0x8145,0xd7a8,0xc7d2,0xd8a7,0xcac0,0x8146, -0xc7f0,0xb1fb,0xd2b5,0xb4d4,0xb6ab,0xcbbf,0xd8a9,0x8147, -0x8148,0x8149,0xb6aa,0x814a,0xc1bd,0xd1cf,0x814b,0xc9a5, -0xd8ad,0x814c,0xb8f6,0xd1be,0xe3dc,0xd6d0,0x814d,0x814e, -0xb7e1,0x814f,0xb4ae,0x8150,0xc1d9,0x8151,0xd8bc,0x8152, -0xcde8,0xb5a4,0xceaa,0xd6f7,0x8153,0xc0f6,0xbed9,0xd8af, -0x8154,0x8155,0x8156,0xc4cb,0x8157,0xbec3,0x8158,0xd8b1, -0xc3b4,0xd2e5,0x8159,0xd6ae,0xceda,0xd5a7,0xbaf5,0xb7a6, -0xc0d6,0x815a,0xc6b9,0xc5d2,0xc7c7,0x815b,0xb9d4,0x815c, -0xb3cb,0xd2d2,0x815d,0x815e,0xd8bf,0xbec5,0xc6f2,0xd2b2, -0xcfb0,0xcfe7,0x815f,0x8160,0x8161,0x8162,0xcae9,0x8163, -0x8164,0xd8c0,0x8165,0x8166,0x8167,0x8168,0x8169,0x816a, -0xc2f2,0xc2d2,0x816b,0xc8e9,0x816c,0x816d,0x816e,0x816f, -0x8170,0x8171,0x8172,0x8173,0x8174,0x8175,0xc7ac,0x8176, -0x8177,0x8178,0x8179,0x817a,0x817b,0x817c,0xc1cb,0x817d, -0xd3e8,0xd5f9,0x817e,0xcac2,0xb6fe,0xd8a1,0xd3da,0xbff7, -0x8180,0xd4c6,0xbba5,0xd8c1,0xcee5,0xbeae,0x8181,0x8182, -0xd8a8,0x8183,0xd1c7,0xd0a9,0x8184,0x8185,0x8186,0xd8bd, -0xd9ef,0xcdf6,0xbfba,0x8187,0xbdbb,0xbaa5,0xd2e0,0xb2fa, -0xbae0,0xc4b6,0x8188,0xcfed,0xbea9,0xcda4,0xc1c1,0x8189, -0x818a,0x818b,0xc7d7,0xd9f1,0x818c,0xd9f4,0x818d,0x818e, -0x818f,0x8190,0xc8cb,0xd8e9,0x8191,0x8192,0x8193,0xd2da, -0xcab2,0xc8ca,0xd8ec,0xd8ea,0xd8c6,0xbdf6,0xc6cd,0xb3f0, -0x8194,0xd8eb,0xbdf1,0xbde9,0x8195,0xc8d4,0xb4d3,0x8196, -0x8197,0xc2d8,0x8198,0xb2d6,0xd7d0,0xcacb,0xcbfb,0xd5cc, -0xb8b6,0xcfc9,0x8199,0x819a,0x819b,0xd9da,0xd8f0,0xc7aa, -0x819c,0xd8ee,0x819d,0xb4fa,0xc1ee,0xd2d4,0x819e,0x819f, -0xd8ed,0x81a0,0xd2c7,0xd8ef,0xc3c7,0x81a1,0x81a2,0x81a3, -0xd1f6,0x81a4,0xd6d9,0xd8f2,0x81a5,0xd8f5,0xbcfe,0xbcdb, -0x81a6,0x81a7,0x81a8,0xc8ce,0x81a9,0xb7dd,0x81aa,0xb7c2, -0x81ab,0xc6f3,0x81ac,0x81ad,0x81ae,0x81af,0x81b0,0x81b1, -0x81b2,0xd8f8,0xd2c1,0x81b3,0x81b4,0xcee9,0xbcbf,0xb7fc, -0xb7a5,0xd0dd,0x81b5,0x81b6,0x81b7,0x81b8,0x81b9,0xd6da, -0xd3c5,0xbbef,0xbbe1,0xd8f1,0x81ba,0x81bb,0xc9a1,0xceb0, -0xb4ab,0x81bc,0xd8f3,0x81bd,0xc9cb,0xd8f6,0xc2d7,0xd8f7, -0x81be,0x81bf,0xceb1,0xd8f9,0x81c0,0x81c1,0x81c2,0xb2ae, -0xb9c0,0x81c3,0xd9a3,0x81c4,0xb0e9,0x81c5,0xc1e6,0x81c6, -0xc9ec,0x81c7,0xcbc5,0x81c8,0xcbc6,0xd9a4,0x81c9,0x81ca, -0x81cb,0x81cc,0x81cd,0xb5e8,0x81ce,0x81cf,0xb5ab,0x81d0, -0x81d1,0x81d2,0x81d3,0x81d4,0x81d5,0xcebb,0xb5cd,0xd7a1, -0xd7f4,0xd3d3,0x81d6,0xcce5,0x81d7,0xbace,0x81d8,0xd9a2, -0xd9dc,0xd3e0,0xd8fd,0xb7f0,0xd7f7,0xd8fe,0xd8fa,0xd9a1, -0xc4e3,0x81d9,0x81da,0xd3b6,0xd8f4,0xd9dd,0x81db,0xd8fb, -0x81dc,0xc5e5,0x81dd,0x81de,0xc0d0,0x81df,0x81e0,0xd1f0, -0xb0db,0x81e1,0x81e2,0xbcd1,0xd9a6,0x81e3,0xd9a5,0x81e4, -0x81e5,0x81e6,0x81e7,0xd9ac,0xd9ae,0x81e8,0xd9ab,0xcab9, -0x81e9,0x81ea,0x81eb,0xd9a9,0xd6b6,0x81ec,0x81ed,0x81ee, -0xb3de,0xd9a8,0x81ef,0xc0fd,0x81f0,0xcacc,0x81f1,0xd9aa, -0x81f2,0xd9a7,0x81f3,0x81f4,0xd9b0,0x81f5,0x81f6,0xb6b1, -0x81f7,0x81f8,0x81f9,0xb9a9,0x81fa,0xd2c0,0x81fb,0x81fc, -0xcfc0,0x81fd,0x81fe,0xc2c2,0x8240,0xbdc4,0xd5ec,0xb2e0, -0xc7c8,0xbfeb,0xd9ad,0x8241,0xd9af,0x8242,0xceea,0xbaee, -0x8243,0x8244,0x8245,0x8246,0x8247,0xc7d6,0x8248,0x8249, -0x824a,0x824b,0x824c,0x824d,0x824e,0x824f,0x8250,0xb1e3, -0x8251,0x8252,0x8253,0xb4d9,0xb6ed,0xd9b4,0x8254,0x8255, -0x8256,0x8257,0xbfa1,0x8258,0x8259,0x825a,0xd9de,0xc7ce, -0xc0fe,0xd9b8,0x825b,0x825c,0x825d,0x825e,0x825f,0xcbd7, -0xb7fd,0x8260,0xd9b5,0x8261,0xd9b7,0xb1a3,0xd3e1,0xd9b9, -0x8262,0xd0c5,0x8263,0xd9b6,0x8264,0x8265,0xd9b1,0x8266, -0xd9b2,0xc1a9,0xd9b3,0x8267,0x8268,0xbcf3,0xd0de,0xb8a9, -0x8269,0xbee3,0x826a,0xd9bd,0x826b,0x826c,0x826d,0x826e, -0xd9ba,0x826f,0xb0b3,0x8270,0x8271,0x8272,0xd9c2,0x8273, -0x8274,0x8275,0x8276,0x8277,0x8278,0x8279,0x827a,0x827b, -0x827c,0x827d,0x827e,0x8280,0xd9c4,0xb1b6,0x8281,0xd9bf, -0x8282,0x8283,0xb5b9,0x8284,0xbef3,0x8285,0x8286,0x8287, -0xccc8,0xbaf2,0xd2d0,0x8288,0xd9c3,0x8289,0x828a,0xbde8, -0x828b,0xb3ab,0x828c,0x828d,0x828e,0xd9c5,0xbeeb,0x828f, -0xd9c6,0xd9bb,0xc4df,0x8290,0xd9be,0xd9c1,0xd9c0,0x8291, -0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x8298,0x8299, -0x829a,0x829b,0xd5ae,0x829c,0xd6b5,0x829d,0xc7e3,0x829e, -0x829f,0x82a0,0x82a1,0xd9c8,0x82a2,0x82a3,0x82a4,0xbcd9, -0xd9ca,0x82a5,0x82a6,0x82a7,0xd9bc,0x82a8,0xd9cb,0xc6ab, -0x82a9,0x82aa,0x82ab,0x82ac,0x82ad,0xd9c9,0x82ae,0x82af, -0x82b0,0x82b1,0xd7f6,0x82b2,0xcda3,0x82b3,0x82b4,0x82b5, -0x82b6,0x82b7,0x82b8,0x82b9,0x82ba,0xbda1,0x82bb,0x82bc, -0x82bd,0x82be,0x82bf,0x82c0,0xd9cc,0x82c1,0x82c2,0x82c3, -0x82c4,0x82c5,0x82c6,0x82c7,0x82c8,0x82c9,0xc5bc,0xcdb5, -0x82ca,0x82cb,0x82cc,0xd9cd,0x82cd,0x82ce,0xd9c7,0xb3a5, -0xbffe,0x82cf,0x82d0,0x82d1,0x82d2,0xb8b5,0x82d3,0x82d4, -0xc0fc,0x82d5,0x82d6,0x82d7,0x82d8,0xb0f8,0x82d9,0x82da, -0x82db,0x82dc,0x82dd,0x82de,0x82df,0x82e0,0x82e1,0x82e2, -0x82e3,0x82e4,0x82e5,0x82e6,0x82e7,0x82e8,0x82e9,0x82ea, -0x82eb,0x82ec,0x82ed,0xb4f6,0x82ee,0xd9ce,0x82ef,0xd9cf, -0xb4a2,0xd9d0,0x82f0,0x82f1,0xb4df,0x82f2,0x82f3,0x82f4, -0x82f5,0x82f6,0xb0c1,0x82f7,0x82f8,0x82f9,0x82fa,0x82fb, -0x82fc,0x82fd,0xd9d1,0xc9b5,0x82fe,0x8340,0x8341,0x8342, -0x8343,0x8344,0x8345,0x8346,0x8347,0x8348,0x8349,0x834a, -0x834b,0x834c,0x834d,0x834e,0x834f,0x8350,0x8351,0xcff1, -0x8352,0x8353,0x8354,0x8355,0x8356,0x8357,0xd9d2,0x8358, -0x8359,0x835a,0xc1c5,0x835b,0x835c,0x835d,0x835e,0x835f, -0x8360,0x8361,0x8362,0x8363,0x8364,0x8365,0xd9d6,0xc9ae, -0x8366,0x8367,0x8368,0x8369,0xd9d5,0xd9d4,0xd9d7,0x836a, -0x836b,0x836c,0x836d,0xcbdb,0x836e,0xbda9,0x836f,0x8370, -0x8371,0x8372,0x8373,0xc6a7,0x8374,0x8375,0x8376,0x8377, -0x8378,0x8379,0x837a,0x837b,0x837c,0x837d,0xd9d3,0xd9d8, -0x837e,0x8380,0x8381,0xd9d9,0x8382,0x8383,0x8384,0x8385, -0x8386,0x8387,0xc8e5,0x8388,0x8389,0x838a,0x838b,0x838c, -0x838d,0x838e,0x838f,0x8390,0x8391,0x8392,0x8393,0x8394, -0x8395,0xc0dc,0x8396,0x8397,0x8398,0x8399,0x839a,0x839b, -0x839c,0x839d,0x839e,0x839f,0x83a0,0x83a1,0x83a2,0x83a3, -0x83a4,0x83a5,0x83a6,0x83a7,0x83a8,0x83a9,0x83aa,0x83ab, -0x83ac,0x83ad,0x83ae,0x83af,0x83b0,0x83b1,0x83b2,0xb6f9, -0xd8a3,0xd4ca,0x83b3,0xd4aa,0xd0d6,0xb3e4,0xd5d7,0x83b4, -0xcfc8,0xb9e2,0x83b5,0xbfcb,0x83b6,0xc3e2,0x83b7,0x83b8, -0x83b9,0xb6d2,0x83ba,0x83bb,0xcdc3,0xd9ee,0xd9f0,0x83bc, -0x83bd,0x83be,0xb5b3,0x83bf,0xb6b5,0x83c0,0x83c1,0x83c2, -0x83c3,0x83c4,0xbea4,0x83c5,0x83c6,0xc8eb,0x83c7,0x83c8, -0xc8ab,0x83c9,0x83ca,0xb0cb,0xb9ab,0xc1f9,0xd9e2,0x83cb, -0xc0bc,0xb9b2,0x83cc,0xb9d8,0xd0cb,0xb1f8,0xc6e4,0xbedf, -0xb5e4,0xd7c8,0x83cd,0xd1f8,0xbce6,0xcade,0x83ce,0x83cf, -0xbcbd,0xd9e6,0xd8e7,0x83d0,0x83d1,0xc4da,0x83d2,0x83d3, -0xb8d4,0xc8bd,0x83d4,0x83d5,0xb2e1,0xd4d9,0x83d6,0x83d7, -0x83d8,0x83d9,0xc3b0,0x83da,0x83db,0xc3e1,0xdaa2,0xc8df, -0x83dc,0xd0b4,0x83dd,0xbefc,0xc5a9,0x83de,0x83df,0x83e0, -0xb9da,0x83e1,0xdaa3,0x83e2,0xd4a9,0xdaa4,0x83e3,0x83e4, -0x83e5,0x83e6,0x83e7,0xd9fb,0xb6ac,0x83e8,0x83e9,0xb7eb, -0xb1f9,0xd9fc,0xb3e5,0xbef6,0x83ea,0xbff6,0xd2b1,0xc0e4, -0x83eb,0x83ec,0x83ed,0xb6b3,0xd9fe,0xd9fd,0x83ee,0x83ef, -0xbebb,0x83f0,0x83f1,0x83f2,0xc6e0,0x83f3,0xd7bc,0xdaa1, -0x83f4,0xc1b9,0x83f5,0xb5f2,0xc1e8,0x83f6,0x83f7,0xbcf5, -0x83f8,0xb4d5,0x83f9,0x83fa,0x83fb,0x83fc,0x83fd,0x83fe, -0x8440,0x8441,0x8442,0xc1dd,0x8443,0xc4fd,0x8444,0x8445, -0xbcb8,0xb7b2,0x8446,0x8447,0xb7ef,0x8448,0x8449,0x844a, -0x844b,0x844c,0x844d,0xd9ec,0x844e,0xc6be,0x844f,0xbfad, -0xbbcb,0x8450,0x8451,0xb5ca,0x8452,0xdbc9,0xd0d7,0x8453, -0xcdb9,0xb0bc,0xb3f6,0xbbf7,0xdbca,0xbaaf,0x8454,0xd4e4, -0xb5b6,0xb5f3,0xd8d6,0xc8d0,0x8455,0x8456,0xb7d6,0xc7d0, -0xd8d7,0x8457,0xbfaf,0x8458,0x8459,0xdbbb,0xd8d8,0x845a, -0x845b,0xd0cc,0xbbae,0x845c,0x845d,0x845e,0xebbe,0xc1d0, -0xc1f5,0xd4f2,0xb8d5,0xb4b4,0x845f,0xb3f5,0x8460,0x8461, -0xc9be,0x8462,0x8463,0x8464,0xc5d0,0x8465,0x8466,0x8467, -0xc5d9,0xc0fb,0x8468,0xb1f0,0x8469,0xd8d9,0xb9ce,0x846a, -0xb5bd,0x846b,0x846c,0xd8da,0x846d,0x846e,0xd6c6,0xcba2, -0xc8af,0xc9b2,0xb4cc,0xbfcc,0x846f,0xb9f4,0x8470,0xd8db, -0xd8dc,0xb6e7,0xbcc1,0xccea,0x8471,0x8472,0x8473,0x8474, -0x8475,0x8476,0xcff7,0x8477,0xd8dd,0xc7b0,0x8478,0x8479, -0xb9d0,0xbda3,0x847a,0x847b,0xccde,0x847c,0xc6ca,0x847d, -0x847e,0x8480,0x8481,0x8482,0xd8e0,0x8483,0xd8de,0x8484, -0x8485,0xd8df,0x8486,0x8487,0x8488,0xb0fe,0x8489,0xbee7, -0x848a,0xcaa3,0xbcf4,0x848b,0x848c,0x848d,0x848e,0xb8b1, -0x848f,0x8490,0xb8ee,0x8491,0x8492,0x8493,0x8494,0x8495, -0x8496,0x8497,0x8498,0x8499,0x849a,0xd8e2,0x849b,0xbdcb, -0x849c,0xd8e4,0xd8e3,0x849d,0x849e,0x849f,0x84a0,0x84a1, -0xc5fc,0x84a2,0x84a3,0x84a4,0x84a5,0x84a6,0x84a7,0x84a8, -0xd8e5,0x84a9,0x84aa,0xd8e6,0x84ab,0x84ac,0x84ad,0x84ae, -0x84af,0x84b0,0x84b1,0xc1a6,0x84b2,0xc8b0,0xb0ec,0xb9a6, -0xbcd3,0xcef1,0xdbbd,0xc1d3,0x84b3,0x84b4,0x84b5,0x84b6, -0xb6af,0xd6fa,0xc5ac,0xbdd9,0xdbbe,0xdbbf,0x84b7,0x84b8, -0x84b9,0xc0f8,0xbea2,0xc0cd,0x84ba,0x84bb,0x84bc,0x84bd, -0x84be,0x84bf,0x84c0,0x84c1,0x84c2,0x84c3,0xdbc0,0xcac6, -0x84c4,0x84c5,0x84c6,0xb2aa,0x84c7,0x84c8,0x84c9,0xd3c2, -0x84ca,0xc3e3,0x84cb,0xd1ab,0x84cc,0x84cd,0x84ce,0x84cf, -0xdbc2,0x84d0,0xc0d5,0x84d1,0x84d2,0x84d3,0xdbc3,0x84d4, -0xbfb1,0x84d5,0x84d6,0x84d7,0x84d8,0x84d9,0x84da,0xc4bc, -0x84db,0x84dc,0x84dd,0x84de,0xc7da,0x84df,0x84e0,0x84e1, -0x84e2,0x84e3,0x84e4,0x84e5,0x84e6,0x84e7,0x84e8,0x84e9, -0xdbc4,0x84ea,0x84eb,0x84ec,0x84ed,0x84ee,0x84ef,0x84f0, -0x84f1,0xd9e8,0xc9d7,0x84f2,0x84f3,0x84f4,0xb9b4,0xcef0, -0xd4c8,0x84f5,0x84f6,0x84f7,0x84f8,0xb0fc,0xb4d2,0x84f9, -0xd0d9,0x84fa,0x84fb,0x84fc,0x84fd,0xd9e9,0x84fe,0xdecb, -0xd9eb,0x8540,0x8541,0x8542,0x8543,0xd8b0,0xbbaf,0xb1b1, -0x8544,0xb3d7,0xd8ce,0x8545,0x8546,0xd4d1,0x8547,0x8548, -0xbdb3,0xbfef,0x8549,0xcfbb,0x854a,0x854b,0xd8d0,0x854c, -0x854d,0x854e,0xb7cb,0x854f,0x8550,0x8551,0xd8d1,0x8552, -0x8553,0x8554,0x8555,0x8556,0x8557,0x8558,0x8559,0x855a, -0x855b,0xc6a5,0xc7f8,0xd2bd,0x855c,0x855d,0xd8d2,0xc4e4, -0x855e,0xcaae,0x855f,0xc7a7,0x8560,0xd8a6,0x8561,0xc9fd, -0xcee7,0xbbdc,0xb0eb,0x8562,0x8563,0x8564,0xbbaa,0xd0ad, -0x8565,0xb1b0,0xd7e4,0xd7bf,0x8566,0xb5a5,0xc2f4,0xc4cf, -0x8567,0x8568,0xb2a9,0x8569,0xb2b7,0x856a,0xb1e5,0xdfb2, -0xd5bc,0xbfa8,0xc2ac,0xd8d5,0xc2b1,0x856b,0xd8d4,0xced4, -0x856c,0xdae0,0x856d,0xcec0,0x856e,0x856f,0xd8b4,0xc3ae, -0xd3a1,0xcea3,0x8570,0xbcb4,0xc8b4,0xc2d1,0x8571,0xbeed, -0xd0b6,0x8572,0xdae1,0x8573,0x8574,0x8575,0x8576,0xc7e4, -0x8577,0x8578,0xb3a7,0x8579,0xb6f2,0xccfc,0xc0fa,0x857a, -0x857b,0xc0f7,0x857c,0xd1b9,0xd1e1,0xd8c7,0x857d,0x857e, -0x8580,0x8581,0x8582,0x8583,0x8584,0xb2de,0x8585,0x8586, -0xc0e5,0x8587,0xbaf1,0x8588,0x8589,0xd8c8,0x858a,0xd4ad, -0x858b,0x858c,0xcfe1,0xd8c9,0x858d,0xd8ca,0xcfc3,0x858e, -0xb3f8,0xbec7,0x858f,0x8590,0x8591,0x8592,0xd8cb,0x8593, -0x8594,0x8595,0x8596,0x8597,0x8598,0x8599,0xdbcc,0x859a, -0x859b,0x859c,0x859d,0xc8a5,0x859e,0x859f,0x85a0,0xcfd8, -0x85a1,0xc8fe,0xb2ce,0x85a2,0x85a3,0x85a4,0x85a5,0x85a6, -0xd3d6,0xb2e6,0xbcb0,0xd3d1,0xcbab,0xb7b4,0x85a7,0x85a8, -0x85a9,0xb7a2,0x85aa,0x85ab,0xcae5,0x85ac,0xc8a1,0xcadc, -0xb1e4,0xd0f0,0x85ad,0xc5d1,0x85ae,0x85af,0x85b0,0xdbc5, -0xb5fe,0x85b1,0x85b2,0xbfda,0xb9c5,0xbee4,0xc1ed,0x85b3, -0xdfb6,0xdfb5,0xd6bb,0xbdd0,0xd5d9,0xb0c8,0xb6a3,0xbfc9, -0xcca8,0xdfb3,0xcab7,0xd3d2,0x85b4,0xd8cf,0xd2b6,0xbac5, -0xcbbe,0xccbe,0x85b5,0xdfb7,0xb5f0,0xdfb4,0x85b6,0x85b7, -0x85b8,0xd3f5,0x85b9,0xb3d4,0xb8f7,0x85ba,0xdfba,0x85bb, -0xbacf,0xbcaa,0xb5f5,0x85bc,0xcdac,0xc3fb,0xbaf3,0xc0f4, -0xcdc2,0xcff2,0xdfb8,0xcfc5,0x85bd,0xc2c0,0xdfb9,0xc2f0, -0x85be,0x85bf,0x85c0,0xbefd,0x85c1,0xc1df,0xcdcc,0xd2f7, -0xb7cd,0xdfc1,0x85c2,0xdfc4,0x85c3,0x85c4,0xb7f1,0xb0c9, -0xb6d6,0xb7d4,0x85c5,0xbaac,0xccfd,0xbfd4,0xcbb1,0xc6f4, -0x85c6,0xd6a8,0xdfc5,0x85c7,0xcee2,0xb3b3,0x85c8,0x85c9, -0xcefc,0xb4b5,0x85ca,0xcec7,0xbaf0,0x85cb,0xcee1,0x85cc, -0xd1bd,0x85cd,0x85ce,0xdfc0,0x85cf,0x85d0,0xb4f4,0x85d1, -0xb3ca,0x85d2,0xb8e6,0xdfbb,0x85d3,0x85d4,0x85d5,0x85d6, -0xc4c5,0x85d7,0xdfbc,0xdfbd,0xdfbe,0xc5bb,0xdfbf,0xdfc2, -0xd4b1,0xdfc3,0x85d8,0xc7ba,0xced8,0x85d9,0x85da,0x85db, -0x85dc,0x85dd,0xc4d8,0x85de,0xdfca,0x85df,0xdfcf,0x85e0, -0xd6dc,0x85e1,0x85e2,0x85e3,0x85e4,0x85e5,0x85e6,0x85e7, -0x85e8,0xdfc9,0xdfda,0xceb6,0x85e9,0xbac7,0xdfce,0xdfc8, -0xc5de,0x85ea,0x85eb,0xc9eb,0xbaf4,0xc3fc,0x85ec,0x85ed, -0xbed7,0x85ee,0xdfc6,0x85ef,0xdfcd,0x85f0,0xc5d8,0x85f1, -0x85f2,0x85f3,0x85f4,0xd5a6,0xbacd,0x85f5,0xbecc,0xd3bd, -0xb8c0,0x85f6,0xd6e4,0x85f7,0xdfc7,0xb9be,0xbfa7,0x85f8, -0x85f9,0xc1fc,0xdfcb,0xdfcc,0x85fa,0xdfd0,0x85fb,0x85fc, -0x85fd,0x85fe,0x8640,0xdfdb,0xdfe5,0x8641,0xdfd7,0xdfd6, -0xd7c9,0xdfe3,0xdfe4,0xe5eb,0xd2a7,0xdfd2,0x8642,0xbfa9, -0x8643,0xd4db,0x8644,0xbfc8,0xdfd4,0x8645,0x8646,0x8647, -0xcfcc,0x8648,0x8649,0xdfdd,0x864a,0xd1ca,0x864b,0xdfde, -0xb0a7,0xc6b7,0xdfd3,0x864c,0xbae5,0x864d,0xb6df,0xcddb, -0xb9fe,0xd4d5,0x864e,0x864f,0xdfdf,0xcfec,0xb0a5,0xdfe7, -0xdfd1,0xd1c6,0xdfd5,0xdfd8,0xdfd9,0xdfdc,0x8650,0xbba9, -0x8651,0xdfe0,0xdfe1,0x8652,0xdfe2,0xdfe6,0xdfe8,0xd3b4, -0x8653,0x8654,0x8655,0x8656,0x8657,0xb8e7,0xc5b6,0xdfea, -0xc9da,0xc1a8,0xc4c4,0x8658,0x8659,0xbfde,0xcff8,0x865a, -0x865b,0x865c,0xd5dc,0xdfee,0x865d,0x865e,0x865f,0x8660, -0x8661,0x8662,0xb2b8,0x8663,0xbadf,0xdfec,0x8664,0xdbc1, -0x8665,0xd1e4,0x8666,0x8667,0x8668,0x8669,0xcbf4,0xb4bd, -0x866a,0xb0a6,0x866b,0x866c,0x866d,0x866e,0x866f,0xdff1, -0xccc6,0xdff2,0x8670,0x8671,0xdfed,0x8672,0x8673,0x8674, -0x8675,0x8676,0x8677,0xdfe9,0x8678,0x8679,0x867a,0x867b, -0xdfeb,0x867c,0xdfef,0xdff0,0xbbbd,0x867d,0x867e,0xdff3, -0x8680,0x8681,0xdff4,0x8682,0xbba3,0x8683,0xcadb,0xcea8, -0xe0a7,0xb3aa,0x8684,0xe0a6,0x8685,0x8686,0x8687,0xe0a1, -0x8688,0x8689,0x868a,0x868b,0xdffe,0x868c,0xcdd9,0xdffc, -0x868d,0xdffa,0x868e,0xbfd0,0xd7c4,0x868f,0xc9cc,0x8690, -0x8691,0xdff8,0xb0a1,0x8692,0x8693,0x8694,0x8695,0x8696, -0xdffd,0x8697,0x8698,0x8699,0x869a,0xdffb,0xe0a2,0x869b, -0x869c,0x869d,0x869e,0x869f,0xe0a8,0x86a0,0x86a1,0x86a2, -0x86a3,0xb7c8,0x86a4,0x86a5,0xc6a1,0xc9b6,0xc0b2,0xdff5, -0x86a6,0x86a7,0xc5be,0x86a8,0xd8c4,0xdff9,0xc4f6,0x86a9, -0x86aa,0x86ab,0x86ac,0x86ad,0x86ae,0xe0a3,0xe0a4,0xe0a5, -0xd0a5,0x86af,0x86b0,0xe0b4,0xcce4,0x86b1,0xe0b1,0x86b2, -0xbfa6,0xe0af,0xceb9,0xe0ab,0xc9c6,0x86b3,0x86b4,0xc0ae, -0xe0ae,0xbaed,0xbab0,0xe0a9,0x86b5,0x86b6,0x86b7,0xdff6, -0x86b8,0xe0b3,0x86b9,0x86ba,0xe0b8,0x86bb,0x86bc,0x86bd, -0xb4ad,0xe0b9,0x86be,0x86bf,0xcfb2,0xbac8,0x86c0,0xe0b0, -0x86c1,0x86c2,0x86c3,0x86c4,0x86c5,0x86c6,0x86c7,0xd0fa, -0x86c8,0x86c9,0x86ca,0x86cb,0x86cc,0x86cd,0x86ce,0x86cf, -0x86d0,0xe0ac,0x86d1,0xd4fb,0x86d2,0xdff7,0x86d3,0xc5e7, -0x86d4,0xe0ad,0x86d5,0xd3f7,0x86d6,0xe0b6,0xe0b7,0x86d7, -0x86d8,0x86d9,0x86da,0x86db,0xe0c4,0xd0e1,0x86dc,0x86dd, -0x86de,0xe0bc,0x86df,0x86e0,0xe0c9,0xe0ca,0x86e1,0x86e2, -0x86e3,0xe0be,0xe0aa,0xc9a4,0xe0c1,0x86e4,0xe0b2,0x86e5, -0x86e6,0x86e7,0x86e8,0x86e9,0xcac8,0xe0c3,0x86ea,0xe0b5, -0x86eb,0xcecb,0x86ec,0xcbc3,0xe0cd,0xe0c6,0xe0c2,0x86ed, -0xe0cb,0x86ee,0xe0ba,0xe0bf,0xe0c0,0x86ef,0x86f0,0xe0c5, -0x86f1,0x86f2,0xe0c7,0xe0c8,0x86f3,0xe0cc,0x86f4,0xe0bb, -0x86f5,0x86f6,0x86f7,0x86f8,0x86f9,0xcbd4,0xe0d5,0x86fa, -0xe0d6,0xe0d2,0x86fb,0x86fc,0x86fd,0x86fe,0x8740,0x8741, -0xe0d0,0xbcce,0x8742,0x8743,0xe0d1,0x8744,0xb8c2,0xd8c5, -0x8745,0x8746,0x8747,0x8748,0x8749,0x874a,0x874b,0x874c, -0xd0ea,0x874d,0x874e,0xc2ef,0x874f,0x8750,0xe0cf,0xe0bd, -0x8751,0x8752,0x8753,0xe0d4,0xe0d3,0x8754,0x8755,0xe0d7, -0x8756,0x8757,0x8758,0x8759,0xe0dc,0xe0d8,0x875a,0x875b, -0x875c,0xd6f6,0xb3b0,0x875d,0xd7ec,0x875e,0xcbbb,0x875f, -0x8760,0xe0da,0x8761,0xcefb,0x8762,0x8763,0x8764,0xbad9, -0x8765,0x8766,0x8767,0x8768,0x8769,0x876a,0x876b,0x876c, -0x876d,0x876e,0x876f,0x8770,0xe0e1,0xe0dd,0xd2ad,0x8771, -0x8772,0x8773,0x8774,0x8775,0xe0e2,0x8776,0x8777,0xe0db, -0xe0d9,0xe0df,0x8778,0x8779,0xe0e0,0x877a,0x877b,0x877c, -0x877d,0x877e,0xe0de,0x8780,0xe0e4,0x8781,0x8782,0x8783, -0xc6f7,0xd8ac,0xd4eb,0xe0e6,0xcac9,0x8784,0x8785,0x8786, -0x8787,0xe0e5,0x8788,0x8789,0x878a,0x878b,0xb8c1,0x878c, -0x878d,0x878e,0x878f,0xe0e7,0xe0e8,0x8790,0x8791,0x8792, -0x8793,0x8794,0x8795,0x8796,0x8797,0xe0e9,0xe0e3,0x8798, -0x8799,0x879a,0x879b,0x879c,0x879d,0x879e,0xbabf,0xcce7, -0x879f,0x87a0,0x87a1,0xe0ea,0x87a2,0x87a3,0x87a4,0x87a5, -0x87a6,0x87a7,0x87a8,0x87a9,0x87aa,0x87ab,0x87ac,0x87ad, -0x87ae,0x87af,0x87b0,0xcff9,0x87b1,0x87b2,0x87b3,0x87b4, -0x87b5,0x87b6,0x87b7,0x87b8,0x87b9,0x87ba,0x87bb,0xe0eb, -0x87bc,0x87bd,0x87be,0x87bf,0x87c0,0x87c1,0x87c2,0xc8c2, -0x87c3,0x87c4,0x87c5,0x87c6,0xbdc0,0x87c7,0x87c8,0x87c9, -0x87ca,0x87cb,0x87cc,0x87cd,0x87ce,0x87cf,0x87d0,0x87d1, -0x87d2,0x87d3,0xc4d2,0x87d4,0x87d5,0x87d6,0x87d7,0x87d8, -0x87d9,0x87da,0x87db,0x87dc,0xe0ec,0x87dd,0x87de,0xe0ed, -0x87df,0x87e0,0xc7f4,0xcbc4,0x87e1,0xe0ee,0xbbd8,0xd8b6, -0xd2f2,0xe0ef,0xcdc5,0x87e2,0xb6da,0x87e3,0x87e4,0x87e5, -0x87e6,0x87e7,0x87e8,0xe0f1,0x87e9,0xd4b0,0x87ea,0x87eb, -0xc0a7,0xb4d1,0x87ec,0x87ed,0xcea7,0xe0f0,0x87ee,0x87ef, -0x87f0,0xe0f2,0xb9cc,0x87f1,0x87f2,0xb9fa,0xcdbc,0xe0f3, -0x87f3,0x87f4,0x87f5,0xc6d4,0xe0f4,0x87f6,0xd4b2,0x87f7, -0xc8a6,0xe0f6,0xe0f5,0x87f8,0x87f9,0x87fa,0x87fb,0x87fc, -0x87fd,0x87fe,0x8840,0x8841,0x8842,0x8843,0x8844,0x8845, -0x8846,0x8847,0x8848,0x8849,0xe0f7,0x884a,0x884b,0xcdc1, -0x884c,0x884d,0x884e,0xcaa5,0x884f,0x8850,0x8851,0x8852, -0xd4da,0xdbd7,0xdbd9,0x8853,0xdbd8,0xb9e7,0xdbdc,0xdbdd, -0xb5d8,0x8854,0x8855,0xdbda,0x8856,0x8857,0x8858,0x8859, -0x885a,0xdbdb,0xb3a1,0xdbdf,0x885b,0x885c,0xbbf8,0x885d, -0xd6b7,0x885e,0xdbe0,0x885f,0x8860,0x8861,0x8862,0xbef9, -0x8863,0x8864,0xb7bb,0x8865,0xdbd0,0xccae,0xbfb2,0xbbb5, -0xd7f8,0xbfd3,0x8866,0x8867,0x8868,0x8869,0x886a,0xbfe9, -0x886b,0x886c,0xbce1,0xccb3,0xdbde,0xb0d3,0xceeb,0xb7d8, -0xd7b9,0xc6c2,0x886d,0x886e,0xc0a4,0x886f,0xccb9,0x8870, -0xdbe7,0xdbe1,0xc6ba,0xdbe3,0x8871,0xdbe8,0x8872,0xc5f7, -0x8873,0x8874,0x8875,0xdbea,0x8876,0x8877,0xdbe9,0xbfc0, -0x8878,0x8879,0x887a,0xdbe6,0xdbe5,0x887b,0x887c,0x887d, -0x887e,0x8880,0xb4b9,0xc0ac,0xc2a2,0xdbe2,0xdbe4,0x8881, -0x8882,0x8883,0x8884,0xd0cd,0xdbed,0x8885,0x8886,0x8887, -0x8888,0x8889,0xc0dd,0xdbf2,0x888a,0x888b,0x888c,0x888d, -0x888e,0x888f,0x8890,0xb6e2,0x8891,0x8892,0x8893,0x8894, -0xdbf3,0xdbd2,0xb9b8,0xd4ab,0xdbec,0x8895,0xbfd1,0xdbf0, -0x8896,0xdbd1,0x8897,0xb5e6,0x8898,0xdbeb,0xbfe5,0x8899, -0x889a,0x889b,0xdbee,0x889c,0xdbf1,0x889d,0x889e,0x889f, -0xdbf9,0x88a0,0x88a1,0x88a2,0x88a3,0x88a4,0x88a5,0x88a6, -0x88a7,0x88a8,0xb9a1,0xb0a3,0x88a9,0x88aa,0x88ab,0x88ac, -0x88ad,0x88ae,0x88af,0xc2f1,0x88b0,0x88b1,0xb3c7,0xdbef, -0x88b2,0x88b3,0xdbf8,0x88b4,0xc6d2,0xdbf4,0x88b5,0x88b6, -0xdbf5,0xdbf7,0xdbf6,0x88b7,0x88b8,0xdbfe,0x88b9,0xd3f2, -0xb2ba,0x88ba,0x88bb,0x88bc,0xdbfd,0x88bd,0x88be,0x88bf, -0x88c0,0x88c1,0x88c2,0x88c3,0x88c4,0xdca4,0x88c5,0xdbfb, -0x88c6,0x88c7,0x88c8,0x88c9,0xdbfa,0x88ca,0x88cb,0x88cc, -0xdbfc,0xc5e0,0xbbf9,0x88cd,0x88ce,0xdca3,0x88cf,0x88d0, -0xdca5,0x88d1,0xccc3,0x88d2,0x88d3,0x88d4,0xb6d1,0xddc0, -0x88d5,0x88d6,0x88d7,0xdca1,0x88d8,0xdca2,0x88d9,0x88da, -0x88db,0xc7b5,0x88dc,0x88dd,0x88de,0xb6e9,0x88df,0x88e0, -0x88e1,0xdca7,0x88e2,0x88e3,0x88e4,0x88e5,0xdca6,0x88e6, -0xdca9,0xb1a4,0x88e7,0x88e8,0xb5cc,0x88e9,0x88ea,0x88eb, -0x88ec,0x88ed,0xbfb0,0x88ee,0x88ef,0x88f0,0x88f1,0x88f2, -0xd1df,0x88f3,0x88f4,0x88f5,0x88f6,0xb6c2,0x88f7,0x88f8, -0x88f9,0x88fa,0x88fb,0x88fc,0x88fd,0x88fe,0x8940,0x8941, -0x8942,0x8943,0x8944,0x8945,0xdca8,0x8946,0x8947,0x8948, -0x8949,0x894a,0x894b,0x894c,0xcbfa,0xebf3,0x894d,0x894e, -0x894f,0xcbdc,0x8950,0x8951,0xcbfe,0x8952,0x8953,0x8954, -0xccc1,0x8955,0x8956,0x8957,0x8958,0x8959,0xc8fb,0x895a, -0x895b,0x895c,0x895d,0x895e,0x895f,0xdcaa,0x8960,0x8961, -0x8962,0x8963,0x8964,0xccee,0xdcab,0x8965,0x8966,0x8967, -0x8968,0x8969,0x896a,0x896b,0x896c,0x896d,0x896e,0x896f, -0x8970,0x8971,0x8972,0x8973,0x8974,0x8975,0xdbd3,0x8976, -0xdcaf,0xdcac,0x8977,0xbeb3,0x8978,0xcafb,0x8979,0x897a, -0x897b,0xdcad,0x897c,0x897d,0x897e,0x8980,0x8981,0x8982, -0x8983,0x8984,0xc9ca,0xc4b9,0x8985,0x8986,0x8987,0x8988, -0x8989,0xc7bd,0xdcae,0x898a,0x898b,0x898c,0xd4f6,0xd0e6, -0x898d,0x898e,0x898f,0x8990,0x8991,0x8992,0x8993,0x8994, -0xc4ab,0xb6d5,0x8995,0x8996,0x8997,0x8998,0x8999,0x899a, -0x899b,0x899c,0x899d,0x899e,0x899f,0x89a0,0x89a1,0x89a2, -0x89a3,0x89a4,0x89a5,0x89a6,0xdbd4,0x89a7,0x89a8,0x89a9, -0x89aa,0xb1da,0x89ab,0x89ac,0x89ad,0xdbd5,0x89ae,0x89af, -0x89b0,0x89b1,0x89b2,0x89b3,0x89b4,0x89b5,0x89b6,0x89b7, -0x89b8,0xdbd6,0x89b9,0x89ba,0x89bb,0xbabe,0x89bc,0x89bd, -0x89be,0x89bf,0x89c0,0x89c1,0x89c2,0x89c3,0x89c4,0x89c5, -0x89c6,0x89c7,0x89c8,0x89c9,0xc8c0,0x89ca,0x89cb,0x89cc, -0x89cd,0x89ce,0x89cf,0xcabf,0xc8c9,0x89d0,0xd7b3,0x89d1, -0xc9f9,0x89d2,0x89d3,0xbfc7,0x89d4,0x89d5,0xbaf8,0x89d6, -0x89d7,0xd2bc,0x89d8,0x89d9,0x89da,0x89db,0x89dc,0x89dd, -0x89de,0x89df,0xe2ba,0x89e0,0xb4a6,0x89e1,0x89e2,0xb1b8, -0x89e3,0x89e4,0x89e5,0x89e6,0x89e7,0xb8b4,0x89e8,0xcfc4, -0x89e9,0x89ea,0x89eb,0x89ec,0xd9e7,0xcfa6,0xcde2,0x89ed, -0x89ee,0xd9ed,0xb6e0,0x89ef,0xd2b9,0x89f0,0x89f1,0xb9bb, -0x89f2,0x89f3,0x89f4,0x89f5,0xe2b9,0xe2b7,0x89f6,0xb4f3, -0x89f7,0xccec,0xccab,0xb7f2,0x89f8,0xd8b2,0xd1eb,0xbabb, -0x89f9,0xcaa7,0x89fa,0x89fb,0xcdb7,0x89fc,0x89fd,0xd2c4, -0xbfe4,0xbcd0,0xb6e1,0x89fe,0xdec5,0x8a40,0x8a41,0x8a42, -0x8a43,0xdec6,0xdbbc,0x8a44,0xd1d9,0x8a45,0x8a46,0xc6e6, -0xc4ce,0xb7ee,0x8a47,0xb7dc,0x8a48,0x8a49,0xbffc,0xd7e0, -0x8a4a,0xc6f5,0x8a4b,0x8a4c,0xb1bc,0xdec8,0xbdb1,0xccd7, -0xdeca,0x8a4d,0xdec9,0x8a4e,0x8a4f,0x8a50,0x8a51,0x8a52, -0xb5ec,0x8a53,0xc9dd,0x8a54,0x8a55,0xb0c2,0x8a56,0x8a57, -0x8a58,0x8a59,0x8a5a,0x8a5b,0x8a5c,0x8a5d,0x8a5e,0x8a5f, -0x8a60,0x8a61,0x8a62,0xc5ae,0xc5ab,0x8a63,0xc4cc,0x8a64, -0xbce9,0xcbfd,0x8a65,0x8a66,0x8a67,0xbac3,0x8a68,0x8a69, -0x8a6a,0xe5f9,0xc8e7,0xe5fa,0xcdfd,0x8a6b,0xd7b1,0xb8be, -0xc2e8,0x8a6c,0xc8d1,0x8a6d,0x8a6e,0xe5fb,0x8a6f,0x8a70, -0x8a71,0x8a72,0xb6ca,0xbccb,0x8a73,0x8a74,0xd1fd,0xe6a1, -0x8a75,0xc3ee,0x8a76,0x8a77,0x8a78,0x8a79,0xe6a4,0x8a7a, -0x8a7b,0x8a7c,0x8a7d,0xe5fe,0xe6a5,0xcdd7,0x8a7e,0x8a80, -0xb7c1,0xe5fc,0xe5fd,0xe6a3,0x8a81,0x8a82,0xc4dd,0xe6a8, -0x8a83,0x8a84,0xe6a7,0x8a85,0x8a86,0x8a87,0x8a88,0x8a89, -0x8a8a,0xc3c3,0x8a8b,0xc6de,0x8a8c,0x8a8d,0xe6aa,0x8a8e, -0x8a8f,0x8a90,0x8a91,0x8a92,0x8a93,0x8a94,0xc4b7,0x8a95, -0x8a96,0x8a97,0xe6a2,0xcabc,0x8a98,0x8a99,0x8a9a,0x8a9b, -0xbde3,0xb9c3,0xe6a6,0xd0d5,0xceaf,0x8a9c,0x8a9d,0xe6a9, -0xe6b0,0x8a9e,0xd2a6,0x8a9f,0xbdaa,0xe6ad,0x8aa0,0x8aa1, -0x8aa2,0x8aa3,0x8aa4,0xe6af,0x8aa5,0xc0d1,0x8aa6,0x8aa7, -0xd2cc,0x8aa8,0x8aa9,0x8aaa,0xbca7,0x8aab,0x8aac,0x8aad, -0x8aae,0x8aaf,0x8ab0,0x8ab1,0x8ab2,0x8ab3,0x8ab4,0x8ab5, -0x8ab6,0xe6b1,0x8ab7,0xd2f6,0x8ab8,0x8ab9,0x8aba,0xd7cb, -0x8abb,0xcdfe,0x8abc,0xcdde,0xc2a6,0xe6ab,0xe6ac,0xbdbf, -0xe6ae,0xe6b3,0x8abd,0x8abe,0xe6b2,0x8abf,0x8ac0,0x8ac1, -0x8ac2,0xe6b6,0x8ac3,0xe6b8,0x8ac4,0x8ac5,0x8ac6,0x8ac7, -0xc4ef,0x8ac8,0x8ac9,0x8aca,0xc4c8,0x8acb,0x8acc,0xbeea, -0xc9ef,0x8acd,0x8ace,0xe6b7,0x8acf,0xb6f0,0x8ad0,0x8ad1, -0x8ad2,0xc3e4,0x8ad3,0x8ad4,0x8ad5,0x8ad6,0x8ad7,0x8ad8, -0x8ad9,0xd3e9,0xe6b4,0x8ada,0xe6b5,0x8adb,0xc8a2,0x8adc, -0x8add,0x8ade,0x8adf,0x8ae0,0xe6bd,0x8ae1,0x8ae2,0x8ae3, -0xe6b9,0x8ae4,0x8ae5,0x8ae6,0x8ae7,0x8ae8,0xc6c5,0x8ae9, -0x8aea,0xcdf1,0xe6bb,0x8aeb,0x8aec,0x8aed,0x8aee,0x8aef, -0x8af0,0x8af1,0x8af2,0x8af3,0x8af4,0xe6bc,0x8af5,0x8af6, -0x8af7,0x8af8,0xbbe9,0x8af9,0x8afa,0x8afb,0x8afc,0x8afd, -0x8afe,0x8b40,0xe6be,0x8b41,0x8b42,0x8b43,0x8b44,0xe6ba, -0x8b45,0x8b46,0xc0b7,0x8b47,0x8b48,0x8b49,0x8b4a,0x8b4b, -0x8b4c,0x8b4d,0x8b4e,0x8b4f,0xd3a4,0xe6bf,0xc9f4,0xe6c3, -0x8b50,0x8b51,0xe6c4,0x8b52,0x8b53,0x8b54,0x8b55,0xd0f6, -0x8b56,0x8b57,0x8b58,0x8b59,0x8b5a,0x8b5b,0x8b5c,0x8b5d, -0x8b5e,0x8b5f,0x8b60,0x8b61,0x8b62,0x8b63,0x8b64,0x8b65, -0x8b66,0x8b67,0xc3bd,0x8b68,0x8b69,0x8b6a,0x8b6b,0x8b6c, -0x8b6d,0x8b6e,0xc3c4,0xe6c2,0x8b6f,0x8b70,0x8b71,0x8b72, -0x8b73,0x8b74,0x8b75,0x8b76,0x8b77,0x8b78,0x8b79,0x8b7a, -0x8b7b,0x8b7c,0xe6c1,0x8b7d,0x8b7e,0x8b80,0x8b81,0x8b82, -0x8b83,0x8b84,0xe6c7,0xcfb1,0x8b85,0xebf4,0x8b86,0x8b87, -0xe6ca,0x8b88,0x8b89,0x8b8a,0x8b8b,0x8b8c,0xe6c5,0x8b8d, -0x8b8e,0xbcde,0xc9a9,0x8b8f,0x8b90,0x8b91,0x8b92,0x8b93, -0x8b94,0xbcb5,0x8b95,0x8b96,0xcfd3,0x8b97,0x8b98,0x8b99, -0x8b9a,0x8b9b,0xe6c8,0x8b9c,0xe6c9,0x8b9d,0xe6ce,0x8b9e, -0xe6d0,0x8b9f,0x8ba0,0x8ba1,0xe6d1,0x8ba2,0x8ba3,0x8ba4, -0xe6cb,0xb5d5,0x8ba5,0xe6cc,0x8ba6,0x8ba7,0xe6cf,0x8ba8, -0x8ba9,0xc4db,0x8baa,0xe6c6,0x8bab,0x8bac,0x8bad,0x8bae, -0x8baf,0xe6cd,0x8bb0,0x8bb1,0x8bb2,0x8bb3,0x8bb4,0x8bb5, -0x8bb6,0x8bb7,0x8bb8,0x8bb9,0x8bba,0x8bbb,0x8bbc,0x8bbd, -0x8bbe,0x8bbf,0x8bc0,0x8bc1,0x8bc2,0x8bc3,0x8bc4,0x8bc5, -0x8bc6,0xe6d2,0x8bc7,0x8bc8,0x8bc9,0x8bca,0x8bcb,0x8bcc, -0x8bcd,0x8bce,0x8bcf,0x8bd0,0x8bd1,0x8bd2,0xe6d4,0xe6d3, -0x8bd3,0x8bd4,0x8bd5,0x8bd6,0x8bd7,0x8bd8,0x8bd9,0x8bda, -0x8bdb,0x8bdc,0x8bdd,0x8bde,0x8bdf,0x8be0,0x8be1,0x8be2, -0x8be3,0x8be4,0x8be5,0x8be6,0x8be7,0x8be8,0x8be9,0x8bea, -0x8beb,0x8bec,0xe6d5,0x8bed,0xd9f8,0x8bee,0x8bef,0xe6d6, -0x8bf0,0x8bf1,0x8bf2,0x8bf3,0x8bf4,0x8bf5,0x8bf6,0x8bf7, -0xe6d7,0x8bf8,0x8bf9,0x8bfa,0x8bfb,0x8bfc,0x8bfd,0x8bfe, -0x8c40,0x8c41,0x8c42,0x8c43,0x8c44,0x8c45,0x8c46,0x8c47, -0xd7d3,0xe6dd,0x8c48,0xe6de,0xbfd7,0xd4d0,0x8c49,0xd7d6, -0xb4e6,0xcbef,0xe6da,0xd8c3,0xd7ce,0xd0a2,0x8c4a,0xc3cf, -0x8c4b,0x8c4c,0xe6df,0xbcbe,0xb9c2,0xe6db,0xd1a7,0x8c4d, -0x8c4e,0xbaa2,0xc2cf,0x8c4f,0xd8ab,0x8c50,0x8c51,0x8c52, -0xcaeb,0xe5ee,0x8c53,0xe6dc,0x8c54,0xb7f5,0x8c55,0x8c56, -0x8c57,0x8c58,0xc8e6,0x8c59,0x8c5a,0xc4f5,0x8c5b,0x8c5c, -0xe5b2,0xc4fe,0x8c5d,0xcbfc,0xe5b3,0xd5ac,0x8c5e,0xd3ee, -0xcad8,0xb0b2,0x8c5f,0xcbce,0xcdea,0x8c60,0x8c61,0xbaea, -0x8c62,0x8c63,0x8c64,0xe5b5,0x8c65,0xe5b4,0x8c66,0xd7da, -0xb9d9,0xd6e6,0xb6a8,0xcdf0,0xd2cb,0xb1a6,0xcab5,0x8c67, -0xb3e8,0xc9f3,0xbfcd,0xd0fb,0xcad2,0xe5b6,0xbbc2,0x8c68, -0x8c69,0x8c6a,0xcfdc,0xb9ac,0x8c6b,0x8c6c,0x8c6d,0x8c6e, -0xd4d7,0x8c6f,0x8c70,0xbaa6,0xd1e7,0xcffc,0xbcd2,0x8c71, -0xe5b7,0xc8dd,0x8c72,0x8c73,0x8c74,0xbfed,0xb1f6,0xcbde, -0x8c75,0x8c76,0xbcc5,0x8c77,0xbcc4,0xd2fa,0xc3dc,0xbfdc, -0x8c78,0x8c79,0x8c7a,0x8c7b,0xb8bb,0x8c7c,0x8c7d,0x8c7e, -0xc3c2,0x8c80,0xbaae,0xd4a2,0x8c81,0x8c82,0x8c83,0x8c84, -0x8c85,0x8c86,0x8c87,0x8c88,0x8c89,0xc7de,0xc4af,0xb2ec, -0x8c8a,0xb9d1,0x8c8b,0x8c8c,0xe5bb,0xc1c8,0x8c8d,0x8c8e, -0xd5af,0x8c8f,0x8c90,0x8c91,0x8c92,0x8c93,0xe5bc,0x8c94, -0xe5be,0x8c95,0x8c96,0x8c97,0x8c98,0x8c99,0x8c9a,0x8c9b, -0xb4e7,0xb6d4,0xcbc2,0xd1b0,0xb5bc,0x8c9c,0x8c9d,0xcad9, -0x8c9e,0xb7e2,0x8c9f,0x8ca0,0xc9e4,0x8ca1,0xbdab,0x8ca2, -0x8ca3,0xcebe,0xd7f0,0x8ca4,0x8ca5,0x8ca6,0x8ca7,0xd0a1, -0x8ca8,0xc9d9,0x8ca9,0x8caa,0xb6fb,0xe6d8,0xbce2,0x8cab, -0xb3be,0x8cac,0xc9d0,0x8cad,0xe6d9,0xb3a2,0x8cae,0x8caf, -0x8cb0,0x8cb1,0xdecc,0x8cb2,0xd3c8,0xdecd,0x8cb3,0xd2a2, -0x8cb4,0x8cb5,0x8cb6,0x8cb7,0xdece,0x8cb8,0x8cb9,0x8cba, -0x8cbb,0xbecd,0x8cbc,0x8cbd,0xdecf,0x8cbe,0x8cbf,0x8cc0, -0xcaac,0xd2fc,0xb3df,0xe5ea,0xc4e1,0xbea1,0xceb2,0xc4f2, -0xbed6,0xc6a8,0xb2e3,0x8cc1,0x8cc2,0xbed3,0x8cc3,0x8cc4, -0xc7fc,0xcceb,0xbdec,0xcedd,0x8cc5,0x8cc6,0xcaba,0xc6c1, -0xe5ec,0xd0bc,0x8cc7,0x8cc8,0x8cc9,0xd5b9,0x8cca,0x8ccb, -0x8ccc,0xe5ed,0x8ccd,0x8cce,0x8ccf,0x8cd0,0xcaf4,0x8cd1, -0xcdc0,0xc2c5,0x8cd2,0xe5ef,0x8cd3,0xc2c4,0xe5f0,0x8cd4, -0x8cd5,0x8cd6,0x8cd7,0x8cd8,0x8cd9,0x8cda,0xe5f8,0xcdcd, -0x8cdb,0xc9bd,0x8cdc,0x8cdd,0x8cde,0x8cdf,0x8ce0,0x8ce1, -0x8ce2,0xd2d9,0xe1a8,0x8ce3,0x8ce4,0x8ce5,0x8ce6,0xd3ec, -0x8ce7,0xcbea,0xc6f1,0x8ce8,0x8ce9,0x8cea,0x8ceb,0x8cec, -0xe1ac,0x8ced,0x8cee,0x8cef,0xe1a7,0xe1a9,0x8cf0,0x8cf1, -0xe1aa,0xe1af,0x8cf2,0x8cf3,0xb2ed,0x8cf4,0xe1ab,0xb8da, -0xe1ad,0xe1ae,0xe1b0,0xb5ba,0xe1b1,0x8cf5,0x8cf6,0x8cf7, -0x8cf8,0x8cf9,0xe1b3,0xe1b8,0x8cfa,0x8cfb,0x8cfc,0x8cfd, -0x8cfe,0xd1d2,0x8d40,0xe1b6,0xe1b5,0xc1eb,0x8d41,0x8d42, -0x8d43,0xe1b7,0x8d44,0xd4c0,0x8d45,0xe1b2,0x8d46,0xe1ba, -0xb0b6,0x8d47,0x8d48,0x8d49,0x8d4a,0xe1b4,0x8d4b,0xbff9, -0x8d4c,0xe1b9,0x8d4d,0x8d4e,0xe1bb,0x8d4f,0x8d50,0x8d51, -0x8d52,0x8d53,0x8d54,0xe1be,0x8d55,0x8d56,0x8d57,0x8d58, -0x8d59,0x8d5a,0xe1bc,0x8d5b,0x8d5c,0x8d5d,0x8d5e,0x8d5f, -0x8d60,0xd6c5,0x8d61,0x8d62,0x8d63,0x8d64,0x8d65,0x8d66, -0x8d67,0xcfbf,0x8d68,0x8d69,0xe1bd,0xe1bf,0xc2cd,0x8d6a, -0xb6eb,0x8d6b,0xd3f8,0x8d6c,0x8d6d,0xc7cd,0x8d6e,0x8d6f, -0xb7e5,0x8d70,0x8d71,0x8d72,0x8d73,0x8d74,0x8d75,0x8d76, -0x8d77,0x8d78,0x8d79,0xbefe,0x8d7a,0x8d7b,0x8d7c,0x8d7d, -0x8d7e,0x8d80,0xe1c0,0xe1c1,0x8d81,0x8d82,0xe1c7,0xb3e7, -0x8d83,0x8d84,0x8d85,0x8d86,0x8d87,0x8d88,0xc6e9,0x8d89, -0x8d8a,0x8d8b,0x8d8c,0x8d8d,0xb4de,0x8d8e,0xd1c2,0x8d8f, -0x8d90,0x8d91,0x8d92,0xe1c8,0x8d93,0x8d94,0xe1c6,0x8d95, -0x8d96,0x8d97,0x8d98,0x8d99,0xe1c5,0x8d9a,0xe1c3,0xe1c2, -0x8d9b,0xb1c0,0x8d9c,0x8d9d,0x8d9e,0xd5b8,0xe1c4,0x8d9f, -0x8da0,0x8da1,0x8da2,0x8da3,0xe1cb,0x8da4,0x8da5,0x8da6, -0x8da7,0x8da8,0x8da9,0x8daa,0x8dab,0xe1cc,0xe1ca,0x8dac, -0x8dad,0x8dae,0x8daf,0x8db0,0x8db1,0x8db2,0x8db3,0xeffa, -0x8db4,0x8db5,0xe1d3,0xe1d2,0xc7b6,0x8db6,0x8db7,0x8db8, -0x8db9,0x8dba,0x8dbb,0x8dbc,0x8dbd,0x8dbe,0x8dbf,0x8dc0, -0xe1c9,0x8dc1,0x8dc2,0xe1ce,0x8dc3,0xe1d0,0x8dc4,0x8dc5, -0x8dc6,0x8dc7,0x8dc8,0x8dc9,0x8dca,0x8dcb,0x8dcc,0x8dcd, -0x8dce,0xe1d4,0x8dcf,0xe1d1,0xe1cd,0x8dd0,0x8dd1,0xe1cf, -0x8dd2,0x8dd3,0x8dd4,0x8dd5,0xe1d5,0x8dd6,0x8dd7,0x8dd8, -0x8dd9,0x8dda,0x8ddb,0x8ddc,0x8ddd,0x8dde,0x8ddf,0x8de0, -0x8de1,0x8de2,0xe1d6,0x8de3,0x8de4,0x8de5,0x8de6,0x8de7, -0x8de8,0x8de9,0x8dea,0x8deb,0x8dec,0x8ded,0x8dee,0x8def, -0x8df0,0x8df1,0x8df2,0x8df3,0x8df4,0x8df5,0x8df6,0x8df7, -0x8df8,0xe1d7,0x8df9,0x8dfa,0x8dfb,0xe1d8,0x8dfc,0x8dfd, -0x8dfe,0x8e40,0x8e41,0x8e42,0x8e43,0x8e44,0x8e45,0x8e46, -0x8e47,0x8e48,0x8e49,0x8e4a,0x8e4b,0x8e4c,0x8e4d,0x8e4e, -0x8e4f,0x8e50,0x8e51,0x8e52,0x8e53,0x8e54,0x8e55,0xe1da, -0x8e56,0x8e57,0x8e58,0x8e59,0x8e5a,0x8e5b,0x8e5c,0x8e5d, -0x8e5e,0x8e5f,0x8e60,0x8e61,0x8e62,0xe1db,0x8e63,0x8e64, -0x8e65,0x8e66,0x8e67,0x8e68,0x8e69,0xcea1,0x8e6a,0x8e6b, -0x8e6c,0x8e6d,0x8e6e,0x8e6f,0x8e70,0x8e71,0x8e72,0x8e73, -0x8e74,0x8e75,0x8e76,0xe7dd,0x8e77,0xb4a8,0xd6dd,0x8e78, -0x8e79,0xd1b2,0xb3b2,0x8e7a,0x8e7b,0xb9a4,0xd7f3,0xc7c9, -0xbede,0xb9ae,0x8e7c,0xced7,0x8e7d,0x8e7e,0xb2ee,0xdbcf, -0x8e80,0xbcba,0xd2d1,0xcbc8,0xb0cd,0x8e81,0x8e82,0xcfef, -0x8e83,0x8e84,0x8e85,0x8e86,0x8e87,0xd9e3,0xbded,0x8e88, -0x8e89,0xb1d2,0xcad0,0xb2bc,0x8e8a,0xcba7,0xb7ab,0x8e8b, -0xcaa6,0x8e8c,0x8e8d,0x8e8e,0xcfa3,0x8e8f,0x8e90,0xe0f8, -0xd5ca,0xe0fb,0x8e91,0x8e92,0xe0fa,0xc5c1,0xccfb,0x8e93, -0xc1b1,0xe0f9,0xd6e3,0xb2af,0xd6c4,0xb5db,0x8e94,0x8e95, -0x8e96,0x8e97,0x8e98,0x8e99,0x8e9a,0x8e9b,0xb4f8,0xd6a1, -0x8e9c,0x8e9d,0x8e9e,0x8e9f,0x8ea0,0xcfaf,0xb0ef,0x8ea1, -0x8ea2,0xe0fc,0x8ea3,0x8ea4,0x8ea5,0x8ea6,0x8ea7,0xe1a1, -0xb3a3,0x8ea8,0x8ea9,0xe0fd,0xe0fe,0xc3b1,0x8eaa,0x8eab, -0x8eac,0x8ead,0xc3dd,0x8eae,0xe1a2,0xb7f9,0x8eaf,0x8eb0, -0x8eb1,0x8eb2,0x8eb3,0x8eb4,0xbbcf,0x8eb5,0x8eb6,0x8eb7, -0x8eb8,0x8eb9,0x8eba,0x8ebb,0xe1a3,0xc4bb,0x8ebc,0x8ebd, -0x8ebe,0x8ebf,0x8ec0,0xe1a4,0x8ec1,0x8ec2,0xe1a5,0x8ec3, -0x8ec4,0xe1a6,0xb4b1,0x8ec5,0x8ec6,0x8ec7,0x8ec8,0x8ec9, -0x8eca,0x8ecb,0x8ecc,0x8ecd,0x8ece,0x8ecf,0x8ed0,0x8ed1, -0x8ed2,0x8ed3,0xb8c9,0xc6bd,0xc4ea,0x8ed4,0xb2a2,0x8ed5, -0xd0d2,0x8ed6,0xe7db,0xbbc3,0xd3d7,0xd3c4,0x8ed7,0xb9e3, -0xe2cf,0x8ed8,0x8ed9,0x8eda,0xd7af,0x8edb,0xc7ec,0xb1d3, -0x8edc,0x8edd,0xb4b2,0xe2d1,0x8ede,0x8edf,0x8ee0,0xd0f2, -0xc2ae,0xe2d0,0x8ee1,0xbfe2,0xd3a6,0xb5d7,0xe2d2,0xb5ea, -0x8ee2,0xc3ed,0xb8fd,0x8ee3,0xb8ae,0x8ee4,0xc5d3,0xb7cf, -0xe2d4,0x8ee5,0x8ee6,0x8ee7,0x8ee8,0xe2d3,0xb6c8,0xd7f9, -0x8ee9,0x8eea,0x8eeb,0x8eec,0x8eed,0xcda5,0x8eee,0x8eef, -0x8ef0,0x8ef1,0x8ef2,0xe2d8,0x8ef3,0xe2d6,0xcafc,0xbfb5, -0xd3b9,0xe2d5,0x8ef4,0x8ef5,0x8ef6,0x8ef7,0xe2d7,0x8ef8, -0x8ef9,0x8efa,0x8efb,0x8efc,0x8efd,0x8efe,0x8f40,0x8f41, -0x8f42,0xc1ae,0xc0c8,0x8f43,0x8f44,0x8f45,0x8f46,0x8f47, -0x8f48,0xe2db,0xe2da,0xc0aa,0x8f49,0x8f4a,0xc1ce,0x8f4b, -0x8f4c,0x8f4d,0x8f4e,0xe2dc,0x8f4f,0x8f50,0x8f51,0x8f52, -0x8f53,0x8f54,0x8f55,0x8f56,0x8f57,0x8f58,0x8f59,0x8f5a, -0xe2dd,0x8f5b,0xe2de,0x8f5c,0x8f5d,0x8f5e,0x8f5f,0x8f60, -0x8f61,0x8f62,0x8f63,0x8f64,0xdbc8,0x8f65,0xd1d3,0xcda2, -0x8f66,0x8f67,0xbda8,0x8f68,0x8f69,0x8f6a,0xdec3,0xd8a5, -0xbfaa,0xdbcd,0xd2ec,0xc6fa,0xc5aa,0x8f6b,0x8f6c,0x8f6d, -0xdec4,0x8f6e,0xb1d7,0xdfae,0x8f6f,0x8f70,0x8f71,0xcabd, -0x8f72,0xdfb1,0x8f73,0xb9ad,0x8f74,0xd2fd,0x8f75,0xb8a5, -0xbaeb,0x8f76,0x8f77,0xb3da,0x8f78,0x8f79,0x8f7a,0xb5dc, -0xd5c5,0x8f7b,0x8f7c,0x8f7d,0x8f7e,0xc3d6,0xcfd2,0xbba1, -0x8f80,0xe5f3,0xe5f2,0x8f81,0x8f82,0xe5f4,0x8f83,0xcde4, -0x8f84,0xc8f5,0x8f85,0x8f86,0x8f87,0x8f88,0x8f89,0x8f8a, -0x8f8b,0xb5af,0xc7bf,0x8f8c,0xe5f6,0x8f8d,0x8f8e,0x8f8f, -0xecb0,0x8f90,0x8f91,0x8f92,0x8f93,0x8f94,0x8f95,0x8f96, -0x8f97,0x8f98,0x8f99,0x8f9a,0x8f9b,0x8f9c,0x8f9d,0x8f9e, -0xe5e6,0x8f9f,0xb9e9,0xb5b1,0x8fa0,0xc2bc,0xe5e8,0xe5e7, -0xe5e9,0x8fa1,0x8fa2,0x8fa3,0x8fa4,0xd2cd,0x8fa5,0x8fa6, -0x8fa7,0xe1ea,0xd0ce,0x8fa8,0xcdae,0x8fa9,0xd1e5,0x8faa, -0x8fab,0xb2ca,0xb1eb,0x8fac,0xb1f2,0xc5ed,0x8fad,0x8fae, -0xd5c3,0xd3b0,0x8faf,0xe1dc,0x8fb0,0x8fb1,0x8fb2,0xe1dd, -0x8fb3,0xd2db,0x8fb4,0xb3b9,0xb1cb,0x8fb5,0x8fb6,0x8fb7, -0xcdf9,0xd5f7,0xe1de,0x8fb8,0xbeb6,0xb4fd,0x8fb9,0xe1df, -0xbadc,0xe1e0,0xbbb2,0xc2c9,0xe1e1,0x8fba,0x8fbb,0x8fbc, -0xd0ec,0x8fbd,0xcdbd,0x8fbe,0x8fbf,0xe1e2,0x8fc0,0xb5c3, -0xc5c7,0xe1e3,0x8fc1,0x8fc2,0xe1e4,0x8fc3,0x8fc4,0x8fc5, -0x8fc6,0xd3f9,0x8fc7,0x8fc8,0x8fc9,0x8fca,0x8fcb,0x8fcc, -0xe1e5,0x8fcd,0xd1ad,0x8fce,0x8fcf,0xe1e6,0xcea2,0x8fd0, -0x8fd1,0x8fd2,0x8fd3,0x8fd4,0x8fd5,0xe1e7,0x8fd6,0xb5c2, -0x8fd7,0x8fd8,0x8fd9,0x8fda,0xe1e8,0xbbd5,0x8fdb,0x8fdc, -0x8fdd,0x8fde,0x8fdf,0xd0c4,0xe2e0,0xb1d8,0xd2e4,0x8fe0, -0x8fe1,0xe2e1,0x8fe2,0x8fe3,0xbcc9,0xc8cc,0x8fe4,0xe2e3, -0xecfe,0xecfd,0xdfaf,0x8fe5,0x8fe6,0x8fe7,0xe2e2,0xd6be, -0xcdfc,0xc3a6,0x8fe8,0x8fe9,0x8fea,0xe3c3,0x8feb,0x8fec, -0xd6d2,0xe2e7,0x8fed,0x8fee,0xe2e8,0x8fef,0x8ff0,0xd3c7, -0x8ff1,0x8ff2,0xe2ec,0xbfec,0x8ff3,0xe2ed,0xe2e5,0x8ff4, -0x8ff5,0xb3c0,0x8ff6,0x8ff7,0x8ff8,0xc4ee,0x8ff9,0x8ffa, -0xe2ee,0x8ffb,0x8ffc,0xd0c3,0x8ffd,0xbaf6,0xe2e9,0xb7de, -0xbbb3,0xccac,0xcbcb,0xe2e4,0xe2e6,0xe2ea,0xe2eb,0x8ffe, -0x9040,0x9041,0xe2f7,0x9042,0x9043,0xe2f4,0xd4f5,0xe2f3, -0x9044,0x9045,0xc5ad,0x9046,0xd5fa,0xc5c2,0xb2c0,0x9047, -0x9048,0xe2ef,0x9049,0xe2f2,0xc1af,0xcbbc,0x904a,0x904b, -0xb5a1,0xe2f9,0x904c,0x904d,0x904e,0xbcb1,0xe2f1,0xd0d4, -0xd4b9,0xe2f5,0xb9d6,0xe2f6,0x904f,0x9050,0x9051,0xc7d3, -0x9052,0x9053,0x9054,0x9055,0x9056,0xe2f0,0x9057,0x9058, -0x9059,0x905a,0x905b,0xd7dc,0xeda1,0x905c,0x905d,0xe2f8, -0x905e,0xeda5,0xe2fe,0xcad1,0x905f,0x9060,0x9061,0x9062, -0x9063,0x9064,0x9065,0xc1b5,0x9066,0xbbd0,0x9067,0x9068, -0xbfd6,0x9069,0xbae3,0x906a,0x906b,0xcba1,0x906c,0x906d, -0x906e,0xeda6,0xeda3,0x906f,0x9070,0xeda2,0x9071,0x9072, -0x9073,0x9074,0xbbd6,0xeda7,0xd0f4,0x9075,0x9076,0xeda4, -0xbade,0xb6f7,0xe3a1,0xb6b2,0xccf1,0xb9a7,0x9077,0xcfa2, -0xc7a1,0x9078,0x9079,0xbfd2,0x907a,0x907b,0xb6f1,0x907c, -0xe2fa,0xe2fb,0xe2fd,0xe2fc,0xc4d5,0xe3a2,0x907d,0xd3c1, -0x907e,0x9080,0x9081,0xe3a7,0xc7c4,0x9082,0x9083,0x9084, -0x9085,0xcfa4,0x9086,0x9087,0xe3a9,0xbab7,0x9088,0x9089, -0x908a,0x908b,0xe3a8,0x908c,0xbbda,0x908d,0xe3a3,0x908e, -0x908f,0x9090,0xe3a4,0xe3aa,0x9091,0xe3a6,0x9092,0xcef2, -0xd3c6,0x9093,0x9094,0xbbbc,0x9095,0x9096,0xd4c3,0x9097, -0xc4fa,0x9098,0x9099,0xeda8,0xd0fc,0xe3a5,0x909a,0xc3f5, -0x909b,0xe3ad,0xb1af,0x909c,0xe3b2,0x909d,0x909e,0x909f, -0xbcc2,0x90a0,0x90a1,0xe3ac,0xb5bf,0x90a2,0x90a3,0x90a4, -0x90a5,0x90a6,0x90a7,0x90a8,0x90a9,0xc7e9,0xe3b0,0x90aa, -0x90ab,0x90ac,0xbeaa,0xcdef,0x90ad,0x90ae,0x90af,0x90b0, -0x90b1,0xbbf3,0x90b2,0x90b3,0x90b4,0xcce8,0x90b5,0x90b6, -0xe3af,0x90b7,0xe3b1,0x90b8,0xcfa7,0xe3ae,0x90b9,0xcea9, -0xbbdd,0x90ba,0x90bb,0x90bc,0x90bd,0x90be,0xb5eb,0xbee5, -0xb2d2,0xb3cd,0x90bf,0xb1b9,0xe3ab,0xb2d1,0xb5ac,0xb9df, -0xb6e8,0x90c0,0x90c1,0xcfeb,0xe3b7,0x90c2,0xbbcc,0x90c3, -0x90c4,0xc8c7,0xd0ca,0x90c5,0x90c6,0x90c7,0x90c8,0x90c9, -0xe3b8,0xb3ee,0x90ca,0x90cb,0x90cc,0x90cd,0xeda9,0x90ce, -0xd3fa,0xd3e4,0x90cf,0x90d0,0x90d1,0xedaa,0xe3b9,0xd2e2, -0x90d2,0x90d3,0x90d4,0x90d5,0x90d6,0xe3b5,0x90d7,0x90d8, -0x90d9,0x90da,0xd3de,0x90db,0x90dc,0x90dd,0x90de,0xb8d0, -0xe3b3,0x90df,0x90e0,0xe3b6,0xb7df,0x90e1,0xe3b4,0xc0a2, -0x90e2,0x90e3,0x90e4,0xe3ba,0x90e5,0x90e6,0x90e7,0x90e8, -0x90e9,0x90ea,0x90eb,0x90ec,0x90ed,0x90ee,0x90ef,0x90f0, -0x90f1,0x90f2,0x90f3,0x90f4,0x90f5,0x90f6,0x90f7,0xd4b8, -0x90f8,0x90f9,0x90fa,0x90fb,0x90fc,0x90fd,0x90fe,0x9140, -0xb4c8,0x9141,0xe3bb,0x9142,0xbbc5,0x9143,0xc9f7,0x9144, -0x9145,0xc9e5,0x9146,0x9147,0x9148,0xc4bd,0x9149,0x914a, -0x914b,0x914c,0x914d,0x914e,0x914f,0xedab,0x9150,0x9151, -0x9152,0x9153,0xc2fd,0x9154,0x9155,0x9156,0x9157,0xbbdb, -0xbfae,0x9158,0x9159,0x915a,0x915b,0x915c,0x915d,0x915e, -0xcebf,0x915f,0x9160,0x9161,0x9162,0xe3bc,0x9163,0xbfb6, -0x9164,0x9165,0x9166,0x9167,0x9168,0x9169,0x916a,0x916b, -0x916c,0x916d,0x916e,0x916f,0x9170,0x9171,0x9172,0x9173, -0x9174,0x9175,0x9176,0xb1ef,0x9177,0x9178,0xd4f7,0x9179, -0x917a,0x917b,0x917c,0x917d,0xe3be,0x917e,0x9180,0x9181, -0x9182,0x9183,0x9184,0x9185,0x9186,0xedad,0x9187,0x9188, -0x9189,0x918a,0x918b,0x918c,0x918d,0x918e,0x918f,0xe3bf, -0xbaa9,0xedac,0x9190,0x9191,0xe3bd,0x9192,0x9193,0x9194, -0x9195,0x9196,0x9197,0x9198,0x9199,0x919a,0x919b,0xe3c0, -0x919c,0x919d,0x919e,0x919f,0x91a0,0x91a1,0xbab6,0x91a2, -0x91a3,0x91a4,0xb6ae,0x91a5,0x91a6,0x91a7,0x91a8,0x91a9, -0xd0b8,0x91aa,0xb0c3,0xedae,0x91ab,0x91ac,0x91ad,0x91ae, -0x91af,0xedaf,0xc0c1,0x91b0,0xe3c1,0x91b1,0x91b2,0x91b3, -0x91b4,0x91b5,0x91b6,0x91b7,0x91b8,0x91b9,0x91ba,0x91bb, -0x91bc,0x91bd,0x91be,0x91bf,0x91c0,0x91c1,0xc5b3,0x91c2, -0x91c3,0x91c4,0x91c5,0x91c6,0x91c7,0x91c8,0x91c9,0x91ca, -0x91cb,0x91cc,0x91cd,0x91ce,0x91cf,0xe3c2,0x91d0,0x91d1, -0x91d2,0x91d3,0x91d4,0x91d5,0x91d6,0x91d7,0x91d8,0xdcb2, -0x91d9,0x91da,0x91db,0x91dc,0x91dd,0x91de,0xedb0,0x91df, -0xb8ea,0x91e0,0xceec,0xeaa7,0xd0e7,0xcaf9,0xc8d6,0xcfb7, -0xb3c9,0xced2,0xbde4,0x91e1,0x91e2,0xe3de,0xbbf2,0xeaa8, -0xd5bd,0x91e3,0xc6dd,0xeaa9,0x91e4,0x91e5,0x91e6,0xeaaa, -0x91e7,0xeaac,0xeaab,0x91e8,0xeaae,0xeaad,0x91e9,0x91ea, -0x91eb,0x91ec,0xbdd8,0x91ed,0xeaaf,0x91ee,0xc2be,0x91ef, -0x91f0,0x91f1,0x91f2,0xb4c1,0xb4f7,0x91f3,0x91f4,0xbba7, -0x91f5,0x91f6,0x91f7,0x91f8,0x91f9,0xece6,0xece5,0xb7bf, -0xcbf9,0xb1e2,0x91fa,0xece7,0x91fb,0x91fc,0x91fd,0xc9c8, -0xece8,0xece9,0x91fe,0xcad6,0xded0,0xb2c5,0xd4fa,0x9240, -0x9241,0xc6cb,0xb0c7,0xb4f2,0xc8d3,0x9242,0x9243,0x9244, -0xcdd0,0x9245,0x9246,0xbfb8,0x9247,0x9248,0x9249,0x924a, -0x924b,0x924c,0x924d,0xbfdb,0x924e,0x924f,0xc7a4,0xd6b4, -0x9250,0xc0a9,0xded1,0xc9a8,0xd1ef,0xc5a4,0xb0e7,0xb3b6, -0xc8c5,0x9251,0x9252,0xb0e2,0x9253,0x9254,0xb7f6,0x9255, -0x9256,0xc5fa,0x9257,0x9258,0xb6f3,0x9259,0xd5d2,0xb3d0, -0xbcbc,0x925a,0x925b,0x925c,0xb3ad,0x925d,0x925e,0x925f, -0x9260,0xbef1,0xb0d1,0x9261,0x9262,0x9263,0x9264,0x9265, -0x9266,0xd2d6,0xcae3,0xd7a5,0x9267,0xcdb6,0xb6b6,0xbfb9, -0xd5db,0x9268,0xb8a7,0xc5d7,0x9269,0x926a,0x926b,0xded2, -0xbfd9,0xc2d5,0xc7c0,0x926c,0xbba4,0xb1a8,0x926d,0x926e, -0xc5ea,0x926f,0x9270,0xc5fb,0xcca7,0x9271,0x9272,0x9273, -0x9274,0xb1a7,0x9275,0x9276,0x9277,0xb5d6,0x9278,0x9279, -0x927a,0xc4a8,0x927b,0xded3,0xd1ba,0xb3e9,0x927c,0xc3f2, -0x927d,0x927e,0xb7f7,0x9280,0xd6f4,0xb5a3,0xb2f0,0xc4b4, -0xc4e9,0xc0ad,0xded4,0x9281,0xb0e8,0xc5c4,0xc1e0,0x9282, -0xb9d5,0x9283,0xbedc,0xcdd8,0xb0ce,0x9284,0xcdcf,0xded6, -0xbed0,0xd7be,0xded5,0xd5d0,0xb0dd,0x9285,0x9286,0xc4e2, -0x9287,0x9288,0xc2a3,0xbcf0,0x9289,0xd3b5,0xc0b9,0xc5a1, -0xb2a6,0xd4f1,0x928a,0x928b,0xc0a8,0xcac3,0xded7,0xd5fc, -0x928c,0xb9b0,0x928d,0xc8ad,0xcba9,0x928e,0xded9,0xbfbd, -0x928f,0x9290,0x9291,0x9292,0xc6b4,0xd7a7,0xcab0,0xc4c3, -0x9293,0xb3d6,0xb9d2,0x9294,0x9295,0x9296,0x9297,0xd6b8, -0xeafc,0xb0b4,0x9298,0x9299,0x929a,0x929b,0xbfe6,0x929c, -0x929d,0xccf4,0x929e,0x929f,0x92a0,0x92a1,0xcdda,0x92a2, -0x92a3,0x92a4,0xd6bf,0xc2ce,0x92a5,0xcece,0xcca2,0xd0ae, -0xc4d3,0xb5b2,0xded8,0xd5f5,0xbcb7,0xbbd3,0x92a6,0x92a7, -0xb0a4,0x92a8,0xc5b2,0xb4ec,0x92a9,0x92aa,0x92ab,0xd5f1, -0x92ac,0x92ad,0xeafd,0x92ae,0x92af,0x92b0,0x92b1,0x92b2, -0x92b3,0xdeda,0xcda6,0x92b4,0x92b5,0xcdec,0x92b6,0x92b7, -0x92b8,0x92b9,0xcee6,0xdedc,0x92ba,0xcdb1,0xc0a6,0x92bb, -0x92bc,0xd7bd,0x92bd,0xdedb,0xb0c6,0xbab4,0xc9d3,0xc4f3, -0xbee8,0x92be,0x92bf,0x92c0,0x92c1,0xb2b6,0x92c2,0x92c3, -0x92c4,0x92c5,0x92c6,0x92c7,0x92c8,0x92c9,0xc0cc,0xcbf0, -0x92ca,0xbcf1,0xbbbb,0xb5b7,0x92cb,0x92cc,0x92cd,0xc5f5, -0x92ce,0xdee6,0x92cf,0x92d0,0x92d1,0xdee3,0xbedd,0x92d2, -0x92d3,0xdedf,0x92d4,0x92d5,0x92d6,0x92d7,0xb4b7,0xbddd, -0x92d8,0x92d9,0xdee0,0xc4ed,0x92da,0x92db,0x92dc,0x92dd, -0xcfc6,0x92de,0xb5e0,0x92df,0x92e0,0x92e1,0x92e2,0xb6de, -0xcada,0xb5f4,0xdee5,0x92e3,0xd5c6,0x92e4,0xdee1,0xcccd, -0xc6fe,0x92e5,0xc5c5,0x92e6,0x92e7,0x92e8,0xd2b4,0x92e9, -0xbef2,0x92ea,0x92eb,0x92ec,0x92ed,0x92ee,0x92ef,0x92f0, -0xc2d3,0x92f1,0xccbd,0xb3b8,0x92f2,0xbdd3,0x92f3,0xbfd8, -0xcdc6,0xd1da,0xb4eb,0x92f4,0xdee4,0xdedd,0xdee7,0x92f5, -0xeafe,0x92f6,0x92f7,0xc2b0,0xdee2,0x92f8,0x92f9,0xd6c0, -0xb5a7,0x92fa,0xb2f4,0x92fb,0xdee8,0x92fc,0xdef2,0x92fd, -0x92fe,0x9340,0x9341,0x9342,0xdeed,0x9343,0xdef1,0x9344, -0x9345,0xc8e0,0x9346,0x9347,0x9348,0xd7e1,0xdeef,0xc3e8, -0xcce1,0x9349,0xb2e5,0x934a,0x934b,0x934c,0xd2be,0x934d, -0x934e,0x934f,0x9350,0x9351,0x9352,0x9353,0xdeee,0x9354, -0xdeeb,0xced5,0x9355,0xb4a7,0x9356,0x9357,0x9358,0x9359, -0x935a,0xbfab,0xbebe,0x935b,0x935c,0xbdd2,0x935d,0x935e, -0x935f,0x9360,0xdee9,0x9361,0xd4ae,0x9362,0xdede,0x9363, -0xdeea,0x9364,0x9365,0x9366,0x9367,0xc0bf,0x9368,0xdeec, -0xb2f3,0xb8e9,0xc2a7,0x9369,0x936a,0xbdc1,0x936b,0x936c, -0x936d,0x936e,0x936f,0xdef5,0xdef8,0x9370,0x9371,0xb2ab, -0xb4a4,0x9372,0x9373,0xb4ea,0xc9a6,0x9374,0x9375,0x9376, -0x9377,0x9378,0x9379,0xdef6,0xcbd1,0x937a,0xb8e3,0x937b, -0xdef7,0xdefa,0x937c,0x937d,0x937e,0x9380,0xdef9,0x9381, -0x9382,0x9383,0xccc2,0x9384,0xb0e1,0xb4ee,0x9385,0x9386, -0x9387,0x9388,0x9389,0x938a,0xe5ba,0x938b,0x938c,0x938d, -0x938e,0x938f,0xd0af,0x9390,0x9391,0xb2eb,0x9392,0xeba1, -0x9393,0xdef4,0x9394,0x9395,0xc9e3,0xdef3,0xb0da,0xd2a1, -0xb1f7,0x9396,0xccaf,0x9397,0x9398,0x9399,0x939a,0x939b, -0x939c,0x939d,0xdef0,0x939e,0xcba4,0x939f,0x93a0,0x93a1, -0xd5aa,0x93a2,0x93a3,0x93a4,0x93a5,0x93a6,0xdefb,0x93a7, -0x93a8,0x93a9,0x93aa,0x93ab,0x93ac,0x93ad,0x93ae,0xb4dd, -0x93af,0xc4a6,0x93b0,0x93b1,0x93b2,0xdefd,0x93b3,0x93b4, -0x93b5,0x93b6,0x93b7,0x93b8,0x93b9,0x93ba,0x93bb,0x93bc, -0xc3fe,0xc4a1,0xdfa1,0x93bd,0x93be,0x93bf,0x93c0,0x93c1, -0x93c2,0x93c3,0xc1cc,0x93c4,0xdefc,0xbeef,0x93c5,0xc6b2, -0x93c6,0x93c7,0x93c8,0x93c9,0x93ca,0x93cb,0x93cc,0x93cd, -0x93ce,0xb3c5,0xc8f6,0x93cf,0x93d0,0xcbba,0xdefe,0x93d1, -0x93d2,0xdfa4,0x93d3,0x93d4,0x93d5,0x93d6,0xd7b2,0x93d7, -0x93d8,0x93d9,0x93da,0x93db,0xb3b7,0x93dc,0x93dd,0x93de, -0x93df,0xc1c3,0x93e0,0x93e1,0xc7cb,0xb2a5,0xb4e9,0x93e2, -0xd7ab,0x93e3,0x93e4,0x93e5,0x93e6,0xc4ec,0x93e7,0xdfa2, -0xdfa3,0x93e8,0xdfa5,0x93e9,0xbab3,0x93ea,0x93eb,0x93ec, -0xdfa6,0x93ed,0xc0de,0x93ee,0x93ef,0xc9c3,0x93f0,0x93f1, -0x93f2,0x93f3,0x93f4,0x93f5,0x93f6,0xb2d9,0xc7e6,0x93f7, -0xdfa7,0x93f8,0xc7dc,0x93f9,0x93fa,0x93fb,0x93fc,0xdfa8, -0xeba2,0x93fd,0x93fe,0x9440,0x9441,0x9442,0xcbd3,0x9443, -0x9444,0x9445,0xdfaa,0x9446,0xdfa9,0x9447,0xb2c1,0x9448, -0x9449,0x944a,0x944b,0x944c,0x944d,0x944e,0x944f,0x9450, -0x9451,0x9452,0x9453,0x9454,0x9455,0x9456,0x9457,0x9458, -0x9459,0x945a,0x945b,0x945c,0x945d,0x945e,0x945f,0x9460, -0xc5ca,0x9461,0x9462,0x9463,0x9464,0x9465,0x9466,0x9467, -0x9468,0xdfab,0x9469,0x946a,0x946b,0x946c,0x946d,0x946e, -0x946f,0x9470,0xd4dc,0x9471,0x9472,0x9473,0x9474,0x9475, -0xc8c1,0x9476,0x9477,0x9478,0x9479,0x947a,0x947b,0x947c, -0x947d,0x947e,0x9480,0x9481,0x9482,0xdfac,0x9483,0x9484, -0x9485,0x9486,0x9487,0xbef0,0x9488,0x9489,0xdfad,0xd6a7, -0x948a,0x948b,0x948c,0x948d,0xeab7,0xebb6,0xcad5,0x948e, -0xd8fc,0xb8c4,0x948f,0xb9a5,0x9490,0x9491,0xb7c5,0xd5fe, -0x9492,0x9493,0x9494,0x9495,0x9496,0xb9ca,0x9497,0x9498, -0xd0a7,0xf4cd,0x9499,0x949a,0xb5d0,0x949b,0x949c,0xc3f4, -0x949d,0xbec8,0x949e,0x949f,0x94a0,0xebb7,0xb0bd,0x94a1, -0x94a2,0xbdcc,0x94a3,0xc1b2,0x94a4,0xb1d6,0xb3a8,0x94a5, -0x94a6,0x94a7,0xb8d2,0xc9a2,0x94a8,0x94a9,0xb6d8,0x94aa, -0x94ab,0x94ac,0x94ad,0xebb8,0xbeb4,0x94ae,0x94af,0x94b0, -0xcafd,0x94b1,0xc7c3,0x94b2,0xd5fb,0x94b3,0x94b4,0xb7f3, -0x94b5,0x94b6,0x94b7,0x94b8,0x94b9,0x94ba,0x94bb,0x94bc, -0x94bd,0x94be,0x94bf,0x94c0,0x94c1,0x94c2,0x94c3,0xcec4, -0x94c4,0x94c5,0x94c6,0xd5ab,0xb1f3,0x94c7,0x94c8,0x94c9, -0xecb3,0xb0df,0x94ca,0xecb5,0x94cb,0x94cc,0x94cd,0xb6b7, -0x94ce,0xc1cf,0x94cf,0xf5fa,0xd0b1,0x94d0,0x94d1,0xd5e5, -0x94d2,0xced3,0x94d3,0x94d4,0xbdef,0xb3e2,0x94d5,0xb8ab, -0x94d6,0xd5b6,0x94d7,0xedbd,0x94d8,0xb6cf,0x94d9,0xcbb9, -0xd0c2,0x94da,0x94db,0x94dc,0x94dd,0x94de,0x94df,0x94e0, -0x94e1,0xb7bd,0x94e2,0x94e3,0xecb6,0xcaa9,0x94e4,0x94e5, -0x94e6,0xc5d4,0x94e7,0xecb9,0xecb8,0xc2c3,0xecb7,0x94e8, -0x94e9,0x94ea,0x94eb,0xd0fd,0xecba,0x94ec,0xecbb,0xd7e5, -0x94ed,0x94ee,0xecbc,0x94ef,0x94f0,0x94f1,0xecbd,0xc6ec, -0x94f2,0x94f3,0x94f4,0x94f5,0x94f6,0x94f7,0x94f8,0x94f9, -0xcede,0x94fa,0xbcc8,0x94fb,0x94fc,0xc8d5,0xb5a9,0xbec9, -0xd6bc,0xd4e7,0x94fd,0x94fe,0xd1ae,0xd0f1,0xeab8,0xeab9, -0xeaba,0xbab5,0x9540,0x9541,0x9542,0x9543,0xcab1,0xbff5, -0x9544,0x9545,0xcdfa,0x9546,0x9547,0x9548,0x9549,0x954a, -0xeac0,0x954b,0xb0ba,0xeabe,0x954c,0x954d,0xc0a5,0x954e, -0x954f,0x9550,0xeabb,0x9551,0xb2fd,0x9552,0xc3f7,0xbbe8, -0x9553,0x9554,0x9555,0xd2d7,0xcef4,0xeabf,0x9556,0x9557, -0x9558,0xeabc,0x9559,0x955a,0x955b,0xeac3,0x955c,0xd0c7, -0xd3b3,0x955d,0x955e,0x955f,0x9560,0xb4ba,0x9561,0xc3c1, -0xd7f2,0x9562,0x9563,0x9564,0x9565,0xd5d1,0x9566,0xcac7, -0x9567,0xeac5,0x9568,0x9569,0xeac4,0xeac7,0xeac6,0x956a, -0x956b,0x956c,0x956d,0x956e,0xd6e7,0x956f,0xcfd4,0x9570, -0x9571,0xeacb,0x9572,0xbbce,0x9573,0x9574,0x9575,0x9576, -0x9577,0x9578,0x9579,0xbdfa,0xc9ce,0x957a,0x957b,0xeacc, -0x957c,0x957d,0xc9b9,0xcffe,0xeaca,0xd4ce,0xeacd,0xeacf, -0x957e,0x9580,0xcded,0x9581,0x9582,0x9583,0x9584,0xeac9, -0x9585,0xeace,0x9586,0x9587,0xceee,0x9588,0xbbde,0x9589, -0xb3bf,0x958a,0x958b,0x958c,0x958d,0x958e,0xc6d5,0xbeb0, -0xcefa,0x958f,0x9590,0x9591,0xc7e7,0x9592,0xbea7,0xead0, -0x9593,0x9594,0xd6c7,0x9595,0x9596,0x9597,0xc1c0,0x9598, -0x9599,0x959a,0xd4dd,0x959b,0xead1,0x959c,0x959d,0xcfbe, -0x959e,0x959f,0x95a0,0x95a1,0xead2,0x95a2,0x95a3,0x95a4, -0x95a5,0xcaee,0x95a6,0x95a7,0x95a8,0x95a9,0xc5af,0xb0b5, -0x95aa,0x95ab,0x95ac,0x95ad,0x95ae,0xead4,0x95af,0x95b0, -0x95b1,0x95b2,0x95b3,0x95b4,0x95b5,0x95b6,0x95b7,0xead3, -0xf4df,0x95b8,0x95b9,0x95ba,0x95bb,0x95bc,0xc4ba,0x95bd, -0x95be,0x95bf,0x95c0,0x95c1,0xb1a9,0x95c2,0x95c3,0x95c4, -0x95c5,0xe5df,0x95c6,0x95c7,0x95c8,0x95c9,0xead5,0x95ca, -0x95cb,0x95cc,0x95cd,0x95ce,0x95cf,0x95d0,0x95d1,0x95d2, -0x95d3,0x95d4,0x95d5,0x95d6,0x95d7,0x95d8,0x95d9,0x95da, -0x95db,0x95dc,0x95dd,0x95de,0x95df,0x95e0,0x95e1,0x95e2, -0x95e3,0xcaef,0x95e4,0xead6,0xead7,0xc6d8,0x95e5,0x95e6, -0x95e7,0x95e8,0x95e9,0x95ea,0x95eb,0x95ec,0xead8,0x95ed, -0x95ee,0xead9,0x95ef,0x95f0,0x95f1,0x95f2,0x95f3,0x95f4, -0xd4bb,0x95f5,0xc7fa,0xd2b7,0xb8fc,0x95f6,0x95f7,0xeac2, -0x95f8,0xb2dc,0x95f9,0x95fa,0xc2fc,0x95fb,0xd4f8,0xcce6, -0xd7ee,0x95fc,0x95fd,0x95fe,0x9640,0x9641,0x9642,0x9643, -0xd4c2,0xd3d0,0xebc3,0xc5f3,0x9644,0xb7fe,0x9645,0x9646, -0xebd4,0x9647,0x9648,0x9649,0xcbb7,0xebde,0x964a,0xc0ca, -0x964b,0x964c,0x964d,0xcdfb,0x964e,0xb3af,0x964f,0xc6da, -0x9650,0x9651,0x9652,0x9653,0x9654,0x9655,0xebfc,0x9656, -0xc4be,0x9657,0xceb4,0xc4a9,0xb1be,0xd4fd,0x9658,0xcaf5, -0x9659,0xd6ec,0x965a,0x965b,0xc6d3,0xb6e4,0x965c,0x965d, -0x965e,0x965f,0xbbfa,0x9660,0x9661,0xd0e0,0x9662,0x9663, -0xc9b1,0x9664,0xd4d3,0xc8a8,0x9665,0x9666,0xb8cb,0x9667, -0xe8be,0xc9bc,0x9668,0x9669,0xe8bb,0x966a,0xc0ee,0xd0d3, -0xb2c4,0xb4e5,0x966b,0xe8bc,0x966c,0x966d,0xd5c8,0x966e, -0x966f,0x9670,0x9671,0x9672,0xb6c5,0x9673,0xe8bd,0xcaf8, -0xb8dc,0xccf5,0x9674,0x9675,0x9676,0xc0b4,0x9677,0x9678, -0xd1ee,0xe8bf,0xe8c2,0x9679,0x967a,0xbabc,0x967b,0xb1ad, -0xbddc,0x967c,0xeabd,0xe8c3,0x967d,0xe8c6,0x967e,0xe8cb, -0x9680,0x9681,0x9682,0x9683,0xe8cc,0x9684,0xcbc9,0xb0e5, -0x9685,0xbcab,0x9686,0x9687,0xb9b9,0x9688,0x9689,0xe8c1, -0x968a,0xcdf7,0x968b,0xe8ca,0x968c,0x968d,0x968e,0x968f, -0xcef6,0x9690,0x9691,0x9692,0x9693,0xd5ed,0x9694,0xc1d6, -0xe8c4,0x9695,0xc3b6,0x9696,0xb9fb,0xd6a6,0xe8c8,0x9697, -0x9698,0x9699,0xcae0,0xd4e6,0x969a,0xe8c0,0x969b,0xe8c5, -0xe8c7,0x969c,0xc7b9,0xb7e3,0x969d,0xe8c9,0x969e,0xbfdd, -0xe8d2,0x969f,0x96a0,0xe8d7,0x96a1,0xe8d5,0xbcdc,0xbccf, -0xe8db,0x96a2,0x96a3,0x96a4,0x96a5,0x96a6,0x96a7,0x96a8, -0x96a9,0xe8de,0x96aa,0xe8da,0xb1fa,0x96ab,0x96ac,0x96ad, -0x96ae,0x96af,0x96b0,0x96b1,0x96b2,0x96b3,0x96b4,0xb0d8, -0xc4b3,0xb8cc,0xc6e2,0xc8be,0xc8e1,0x96b5,0x96b6,0x96b7, -0xe8cf,0xe8d4,0xe8d6,0x96b8,0xb9f1,0xe8d8,0xd7f5,0x96b9, -0xc4fb,0x96ba,0xe8dc,0x96bb,0x96bc,0xb2e9,0x96bd,0x96be, -0x96bf,0xe8d1,0x96c0,0x96c1,0xbced,0x96c2,0x96c3,0xbfc2, -0xe8cd,0xd6f9,0x96c4,0xc1f8,0xb2f1,0x96c5,0x96c6,0x96c7, -0x96c8,0x96c9,0x96ca,0x96cb,0x96cc,0xe8df,0x96cd,0xcac1, -0xe8d9,0x96ce,0x96cf,0x96d0,0x96d1,0xd5a4,0x96d2,0xb1ea, -0xd5bb,0xe8ce,0xe8d0,0xb6b0,0xe8d3,0x96d3,0xe8dd,0xc0b8, -0x96d4,0xcaf7,0x96d5,0xcba8,0x96d6,0x96d7,0xc6dc,0xc0f5, -0x96d8,0x96d9,0x96da,0x96db,0x96dc,0xe8e9,0x96dd,0x96de, -0x96df,0xd0a3,0x96e0,0x96e1,0x96e2,0x96e3,0x96e4,0x96e5, -0x96e6,0xe8f2,0xd6ea,0x96e7,0x96e8,0x96e9,0x96ea,0x96eb, -0x96ec,0x96ed,0xe8e0,0xe8e1,0x96ee,0x96ef,0x96f0,0xd1f9, -0xbacb,0xb8f9,0x96f1,0x96f2,0xb8f1,0xd4d4,0xe8ef,0x96f3, -0xe8ee,0xe8ec,0xb9f0,0xccd2,0xe8e6,0xcea6,0xbff2,0x96f4, -0xb0b8,0xe8f1,0xe8f0,0x96f5,0xd7c0,0x96f6,0xe8e4,0x96f7, -0xcda9,0xc9a3,0x96f8,0xbbb8,0xbddb,0xe8ea,0x96f9,0x96fa, -0x96fb,0x96fc,0x96fd,0x96fe,0x9740,0x9741,0x9742,0x9743, -0xe8e2,0xe8e3,0xe8e5,0xb5b5,0xe8e7,0xc7c5,0xe8eb,0xe8ed, -0xbdb0,0xd7ae,0x9744,0xe8f8,0x9745,0x9746,0x9747,0x9748, -0x9749,0x974a,0x974b,0x974c,0xe8f5,0x974d,0xcdb0,0xe8f6, -0x974e,0x974f,0x9750,0x9751,0x9752,0x9753,0x9754,0x9755, -0x9756,0xc1ba,0x9757,0xe8e8,0x9758,0xc3b7,0xb0f0,0x9759, -0x975a,0x975b,0x975c,0x975d,0x975e,0x975f,0x9760,0xe8f4, -0x9761,0x9762,0x9763,0xe8f7,0x9764,0x9765,0x9766,0xb9a3, -0x9767,0x9768,0x9769,0x976a,0x976b,0x976c,0x976d,0x976e, -0x976f,0x9770,0xc9d2,0x9771,0x9772,0x9773,0xc3ce,0xcee0, -0xc0e6,0x9774,0x9775,0x9776,0x9777,0xcbf3,0x9778,0xccdd, -0xd0b5,0x9779,0x977a,0xcae1,0x977b,0xe8f3,0x977c,0x977d, -0x977e,0x9780,0x9781,0x9782,0x9783,0x9784,0x9785,0x9786, -0xbcec,0x9787,0xe8f9,0x9788,0x9789,0x978a,0x978b,0x978c, -0x978d,0xc3de,0x978e,0xc6e5,0x978f,0xb9f7,0x9790,0x9791, -0x9792,0x9793,0xb0f4,0x9794,0x9795,0xd7d8,0x9796,0x9797, -0xbcac,0x9798,0xc5ef,0x9799,0x979a,0x979b,0x979c,0x979d, -0xccc4,0x979e,0x979f,0xe9a6,0x97a0,0x97a1,0x97a2,0x97a3, -0x97a4,0x97a5,0x97a6,0x97a7,0x97a8,0x97a9,0xc9ad,0x97aa, -0xe9a2,0xc0e2,0x97ab,0x97ac,0x97ad,0xbfc3,0x97ae,0x97af, -0x97b0,0xe8fe,0xb9d7,0x97b1,0xe8fb,0x97b2,0x97b3,0x97b4, -0x97b5,0xe9a4,0x97b6,0x97b7,0x97b8,0xd2ce,0x97b9,0x97ba, -0x97bb,0x97bc,0x97bd,0xe9a3,0x97be,0xd6b2,0xd7b5,0x97bf, -0xe9a7,0x97c0,0xbdb7,0x97c1,0x97c2,0x97c3,0x97c4,0x97c5, -0x97c6,0x97c7,0x97c8,0x97c9,0x97ca,0x97cb,0x97cc,0xe8fc, -0xe8fd,0x97cd,0x97ce,0x97cf,0xe9a1,0x97d0,0x97d1,0x97d2, -0x97d3,0x97d4,0x97d5,0x97d6,0x97d7,0xcdd6,0x97d8,0x97d9, -0xd2ac,0x97da,0x97db,0x97dc,0xe9b2,0x97dd,0x97de,0x97df, -0x97e0,0xe9a9,0x97e1,0x97e2,0x97e3,0xb4aa,0x97e4,0xb4bb, -0x97e5,0x97e6,0xe9ab,0x97e7,0x97e8,0x97e9,0x97ea,0x97eb, -0x97ec,0x97ed,0x97ee,0x97ef,0x97f0,0x97f1,0x97f2,0x97f3, -0x97f4,0x97f5,0x97f6,0x97f7,0xd0a8,0x97f8,0x97f9,0xe9a5, -0x97fa,0x97fb,0xb3fe,0x97fc,0x97fd,0xe9ac,0xc0e3,0x97fe, -0xe9aa,0x9840,0x9841,0xe9b9,0x9842,0x9843,0xe9b8,0x9844, -0x9845,0x9846,0x9847,0xe9ae,0x9848,0x9849,0xe8fa,0x984a, -0x984b,0xe9a8,0x984c,0x984d,0x984e,0x984f,0x9850,0xbfac, -0xe9b1,0xe9ba,0x9851,0x9852,0xc2a5,0x9853,0x9854,0x9855, -0xe9af,0x9856,0xb8c5,0x9857,0xe9ad,0x9858,0xd3dc,0xe9b4, -0xe9b5,0xe9b7,0x9859,0x985a,0x985b,0xe9c7,0x985c,0x985d, -0x985e,0x985f,0x9860,0x9861,0xc0c6,0xe9c5,0x9862,0x9863, -0xe9b0,0x9864,0x9865,0xe9bb,0xb0f1,0x9866,0x9867,0x9868, -0x9869,0x986a,0x986b,0x986c,0x986d,0x986e,0x986f,0xe9bc, -0xd5a5,0x9870,0x9871,0xe9be,0x9872,0xe9bf,0x9873,0x9874, -0x9875,0xe9c1,0x9876,0x9877,0xc1f1,0x9878,0x9879,0xc8b6, -0x987a,0x987b,0x987c,0xe9bd,0x987d,0x987e,0x9880,0x9881, -0x9882,0xe9c2,0x9883,0x9884,0x9885,0x9886,0x9887,0x9888, -0x9889,0x988a,0xe9c3,0x988b,0xe9b3,0x988c,0xe9b6,0x988d, -0xbbb1,0x988e,0x988f,0x9890,0xe9c0,0x9891,0x9892,0x9893, -0x9894,0x9895,0x9896,0xbcf7,0x9897,0x9898,0x9899,0xe9c4, -0xe9c6,0x989a,0x989b,0x989c,0x989d,0x989e,0x989f,0x98a0, -0x98a1,0x98a2,0x98a3,0x98a4,0x98a5,0xe9ca,0x98a6,0x98a7, -0x98a8,0x98a9,0xe9ce,0x98aa,0x98ab,0x98ac,0x98ad,0x98ae, -0x98af,0x98b0,0x98b1,0x98b2,0x98b3,0xb2db,0x98b4,0xe9c8, -0x98b5,0x98b6,0x98b7,0x98b8,0x98b9,0x98ba,0x98bb,0x98bc, -0x98bd,0x98be,0xb7ae,0x98bf,0x98c0,0x98c1,0x98c2,0x98c3, -0x98c4,0x98c5,0x98c6,0x98c7,0x98c8,0x98c9,0x98ca,0xe9cb, -0xe9cc,0x98cb,0x98cc,0x98cd,0x98ce,0x98cf,0x98d0,0xd5c1, -0x98d1,0xc4a3,0x98d2,0x98d3,0x98d4,0x98d5,0x98d6,0x98d7, -0xe9d8,0x98d8,0xbae1,0x98d9,0x98da,0x98db,0x98dc,0xe9c9, -0x98dd,0xd3a3,0x98de,0x98df,0x98e0,0xe9d4,0x98e1,0x98e2, -0x98e3,0x98e4,0x98e5,0x98e6,0x98e7,0xe9d7,0xe9d0,0x98e8, -0x98e9,0x98ea,0x98eb,0x98ec,0xe9cf,0x98ed,0x98ee,0xc7c1, -0x98ef,0x98f0,0x98f1,0x98f2,0x98f3,0x98f4,0x98f5,0x98f6, -0xe9d2,0x98f7,0x98f8,0x98f9,0x98fa,0x98fb,0x98fc,0x98fd, -0xe9d9,0xb3c8,0x98fe,0xe9d3,0x9940,0x9941,0x9942,0x9943, -0x9944,0xcff0,0x9945,0x9946,0x9947,0xe9cd,0x9948,0x9949, -0x994a,0x994b,0x994c,0x994d,0x994e,0x994f,0x9950,0x9951, -0x9952,0xb3f7,0x9953,0x9954,0x9955,0x9956,0x9957,0x9958, -0x9959,0xe9d6,0x995a,0x995b,0xe9da,0x995c,0x995d,0x995e, -0xccb4,0x995f,0x9960,0x9961,0xcfad,0x9962,0x9963,0x9964, -0x9965,0x9966,0x9967,0x9968,0x9969,0x996a,0xe9d5,0x996b, -0xe9dc,0xe9db,0x996c,0x996d,0x996e,0x996f,0x9970,0xe9de, -0x9971,0x9972,0x9973,0x9974,0x9975,0x9976,0x9977,0x9978, -0xe9d1,0x9979,0x997a,0x997b,0x997c,0x997d,0x997e,0x9980, -0x9981,0xe9dd,0x9982,0xe9df,0xc3ca,0x9983,0x9984,0x9985, -0x9986,0x9987,0x9988,0x9989,0x998a,0x998b,0x998c,0x998d, -0x998e,0x998f,0x9990,0x9991,0x9992,0x9993,0x9994,0x9995, -0x9996,0x9997,0x9998,0x9999,0x999a,0x999b,0x999c,0x999d, -0x999e,0x999f,0x99a0,0x99a1,0x99a2,0x99a3,0x99a4,0x99a5, -0x99a6,0x99a7,0x99a8,0x99a9,0x99aa,0x99ab,0x99ac,0x99ad, -0x99ae,0x99af,0x99b0,0x99b1,0x99b2,0x99b3,0x99b4,0x99b5, -0x99b6,0x99b7,0x99b8,0x99b9,0x99ba,0x99bb,0x99bc,0x99bd, -0x99be,0x99bf,0x99c0,0x99c1,0x99c2,0x99c3,0x99c4,0x99c5, -0x99c6,0x99c7,0x99c8,0x99c9,0x99ca,0x99cb,0x99cc,0x99cd, -0x99ce,0x99cf,0x99d0,0x99d1,0x99d2,0x99d3,0x99d4,0x99d5, -0x99d6,0x99d7,0x99d8,0x99d9,0x99da,0x99db,0x99dc,0x99dd, -0x99de,0x99df,0x99e0,0x99e1,0x99e2,0x99e3,0x99e4,0x99e5, -0x99e6,0x99e7,0x99e8,0x99e9,0x99ea,0x99eb,0x99ec,0x99ed, -0x99ee,0x99ef,0x99f0,0x99f1,0x99f2,0x99f3,0x99f4,0x99f5, -0xc7b7,0xb4ce,0xbbb6,0xd0c0,0xeca3,0x99f6,0x99f7,0xc5b7, -0x99f8,0x99f9,0x99fa,0x99fb,0x99fc,0x99fd,0x99fe,0x9a40, -0x9a41,0x9a42,0xd3fb,0x9a43,0x9a44,0x9a45,0x9a46,0xeca4, -0x9a47,0xeca5,0xc6db,0x9a48,0x9a49,0x9a4a,0xbfee,0x9a4b, -0x9a4c,0x9a4d,0x9a4e,0xeca6,0x9a4f,0x9a50,0xeca7,0xd0aa, -0x9a51,0xc7b8,0x9a52,0x9a53,0xb8e8,0x9a54,0x9a55,0x9a56, -0x9a57,0x9a58,0x9a59,0x9a5a,0x9a5b,0x9a5c,0x9a5d,0x9a5e, -0x9a5f,0xeca8,0x9a60,0x9a61,0x9a62,0x9a63,0x9a64,0x9a65, -0x9a66,0x9a67,0xd6b9,0xd5fd,0xb4cb,0xb2bd,0xcee4,0xc6e7, -0x9a68,0x9a69,0xcde1,0x9a6a,0x9a6b,0x9a6c,0x9a6d,0x9a6e, -0x9a6f,0x9a70,0x9a71,0x9a72,0x9a73,0x9a74,0x9a75,0x9a76, -0x9a77,0xb4f5,0x9a78,0xcbc0,0xbcdf,0x9a79,0x9a7a,0x9a7b, -0x9a7c,0xe9e2,0xe9e3,0xd1ea,0xe9e5,0x9a7d,0xb4f9,0xe9e4, -0x9a7e,0xd1b3,0xcae2,0xb2d0,0x9a80,0xe9e8,0x9a81,0x9a82, -0x9a83,0x9a84,0xe9e6,0xe9e7,0x9a85,0x9a86,0xd6b3,0x9a87, -0x9a88,0x9a89,0xe9e9,0xe9ea,0x9a8a,0x9a8b,0x9a8c,0x9a8d, -0x9a8e,0xe9eb,0x9a8f,0x9a90,0x9a91,0x9a92,0x9a93,0x9a94, -0x9a95,0x9a96,0xe9ec,0x9a97,0x9a98,0x9a99,0x9a9a,0x9a9b, -0x9a9c,0x9a9d,0x9a9e,0xecaf,0xc5b9,0xb6ce,0x9a9f,0xd2f3, -0x9aa0,0x9aa1,0x9aa2,0x9aa3,0x9aa4,0x9aa5,0x9aa6,0xb5ee, -0x9aa7,0xbbd9,0xecb1,0x9aa8,0x9aa9,0xd2e3,0x9aaa,0x9aab, -0x9aac,0x9aad,0x9aae,0xcee3,0x9aaf,0xc4b8,0x9ab0,0xc3bf, -0x9ab1,0x9ab2,0xb6be,0xd8b9,0xb1c8,0xb1cf,0xb1d1,0xc5fe, -0x9ab3,0xb1d0,0x9ab4,0xc3ab,0x9ab5,0x9ab6,0x9ab7,0x9ab8, -0x9ab9,0xd5b1,0x9aba,0x9abb,0x9abc,0x9abd,0x9abe,0x9abf, -0x9ac0,0x9ac1,0xeba4,0xbac1,0x9ac2,0x9ac3,0x9ac4,0xccba, -0x9ac5,0x9ac6,0x9ac7,0xeba5,0x9ac8,0xeba7,0x9ac9,0x9aca, -0x9acb,0xeba8,0x9acc,0x9acd,0x9ace,0xeba6,0x9acf,0x9ad0, -0x9ad1,0x9ad2,0x9ad3,0x9ad4,0x9ad5,0xeba9,0xebab,0xebaa, -0x9ad6,0x9ad7,0x9ad8,0x9ad9,0x9ada,0xebac,0x9adb,0xcacf, -0xd8b5,0xc3f1,0x9adc,0xc3a5,0xc6f8,0xebad,0xc4ca,0x9add, -0xebae,0xebaf,0xebb0,0xb7d5,0x9ade,0x9adf,0x9ae0,0xb7fa, -0x9ae1,0xebb1,0xc7e2,0x9ae2,0xebb3,0x9ae3,0xbaa4,0xd1f5, -0xb0b1,0xebb2,0xebb4,0x9ae4,0x9ae5,0x9ae6,0xb5aa,0xc2c8, -0xc7e8,0x9ae7,0xebb5,0x9ae8,0xcbae,0xe3df,0x9ae9,0x9aea, -0xd3c0,0x9aeb,0x9aec,0x9aed,0x9aee,0xd9db,0x9aef,0x9af0, -0xcda1,0xd6ad,0xc7f3,0x9af1,0x9af2,0x9af3,0xd9e0,0xbbe3, -0x9af4,0xbaba,0xe3e2,0x9af5,0x9af6,0x9af7,0x9af8,0x9af9, -0xcfab,0x9afa,0x9afb,0x9afc,0xe3e0,0xc9c7,0x9afd,0xbab9, -0x9afe,0x9b40,0x9b41,0xd1b4,0xe3e1,0xc8ea,0xb9af,0xbdad, -0xb3d8,0xcedb,0x9b42,0x9b43,0xccc0,0x9b44,0x9b45,0x9b46, -0xe3e8,0xe3e9,0xcdf4,0x9b47,0x9b48,0x9b49,0x9b4a,0x9b4b, -0xccad,0x9b4c,0xbcb3,0x9b4d,0xe3ea,0x9b4e,0xe3eb,0x9b4f, -0x9b50,0xd0da,0x9b51,0x9b52,0x9b53,0xc6fb,0xb7da,0x9b54, -0x9b55,0xc7df,0xd2ca,0xced6,0x9b56,0xe3e4,0xe3ec,0x9b57, -0xc9f2,0xb3c1,0x9b58,0x9b59,0xe3e7,0x9b5a,0x9b5b,0xc6e3, -0xe3e5,0x9b5c,0x9b5d,0xedb3,0xe3e6,0x9b5e,0x9b5f,0x9b60, -0x9b61,0xc9b3,0x9b62,0xc5e6,0x9b63,0x9b64,0x9b65,0xb9b5, -0x9b66,0xc3bb,0x9b67,0xe3e3,0xc5bd,0xc1a4,0xc2d9,0xb2d7, -0x9b68,0xe3ed,0xbba6,0xc4ad,0x9b69,0xe3f0,0xbeda,0x9b6a, -0x9b6b,0xe3fb,0xe3f5,0xbad3,0x9b6c,0x9b6d,0x9b6e,0x9b6f, -0xb7d0,0xd3cd,0x9b70,0xd6ce,0xd5d3,0xb9c1,0xd5b4,0xd1d8, -0x9b71,0x9b72,0x9b73,0x9b74,0xd0b9,0xc7f6,0x9b75,0x9b76, -0x9b77,0xc8aa,0xb2b4,0x9b78,0xc3da,0x9b79,0x9b7a,0x9b7b, -0xe3ee,0x9b7c,0x9b7d,0xe3fc,0xe3ef,0xb7a8,0xe3f7,0xe3f4, -0x9b7e,0x9b80,0x9b81,0xb7ba,0x9b82,0x9b83,0xc5a2,0x9b84, -0xe3f6,0xc5dd,0xb2a8,0xc6fc,0x9b85,0xc4e0,0x9b86,0x9b87, -0xd7a2,0x9b88,0xc0e1,0xe3f9,0x9b89,0x9b8a,0xe3fa,0xe3fd, -0xcca9,0xe3f3,0x9b8b,0xd3be,0x9b8c,0xb1c3,0xedb4,0xe3f1, -0xe3f2,0x9b8d,0xe3f8,0xd0ba,0xc6c3,0xd4f3,0xe3fe,0x9b8e, -0x9b8f,0xbde0,0x9b90,0x9b91,0xe4a7,0x9b92,0x9b93,0xe4a6, -0x9b94,0x9b95,0x9b96,0xd1f3,0xe4a3,0x9b97,0xe4a9,0x9b98, -0x9b99,0x9b9a,0xc8f7,0x9b9b,0x9b9c,0x9b9d,0x9b9e,0xcfb4, -0x9b9f,0xe4a8,0xe4ae,0xc2e5,0x9ba0,0x9ba1,0xb6b4,0x9ba2, -0x9ba3,0x9ba4,0x9ba5,0x9ba6,0x9ba7,0xbdf2,0x9ba8,0xe4a2, -0x9ba9,0x9baa,0xbae9,0xe4aa,0x9bab,0x9bac,0xe4ac,0x9bad, -0x9bae,0xb6fd,0xd6de,0xe4b2,0x9baf,0xe4ad,0x9bb0,0x9bb1, -0x9bb2,0xe4a1,0x9bb3,0xbbee,0xcddd,0xc7a2,0xc5c9,0x9bb4, -0x9bb5,0xc1f7,0x9bb6,0xe4a4,0x9bb7,0xc7b3,0xbdac,0xbdbd, -0xe4a5,0x9bb8,0xd7c7,0xb2e2,0x9bb9,0xe4ab,0xbcc3,0xe4af, -0x9bba,0xbbeb,0xe4b0,0xc5a8,0xe4b1,0x9bbb,0x9bbc,0x9bbd, -0x9bbe,0xd5e3,0xbfa3,0x9bbf,0xe4ba,0x9bc0,0xe4b7,0x9bc1, -0xe4bb,0x9bc2,0x9bc3,0xe4bd,0x9bc4,0x9bc5,0xc6d6,0x9bc6, -0x9bc7,0xbac6,0xc0cb,0x9bc8,0x9bc9,0x9bca,0xb8a1,0xe4b4, -0x9bcb,0x9bcc,0x9bcd,0x9bce,0xd4a1,0x9bcf,0x9bd0,0xbaa3, -0xbdfe,0x9bd1,0x9bd2,0x9bd3,0xe4bc,0x9bd4,0x9bd5,0x9bd6, -0x9bd7,0x9bd8,0xcdbf,0x9bd9,0x9bda,0xc4f9,0x9bdb,0x9bdc, -0xcffb,0xc9e6,0x9bdd,0x9bde,0xd3bf,0x9bdf,0xcfd1,0x9be0, -0x9be1,0xe4b3,0x9be2,0xe4b8,0xe4b9,0xcce9,0x9be3,0x9be4, -0x9be5,0x9be6,0x9be7,0xccce,0x9be8,0xc0d4,0xe4b5,0xc1b0, -0xe4b6,0xced0,0x9be9,0xbbc1,0xb5d3,0x9bea,0xc8f3,0xbda7, -0xd5c7,0xc9ac,0xb8a2,0xe4ca,0x9beb,0x9bec,0xe4cc,0xd1c4, -0x9bed,0x9bee,0xd2ba,0x9bef,0x9bf0,0xbaad,0x9bf1,0x9bf2, -0xbad4,0x9bf3,0x9bf4,0x9bf5,0x9bf6,0x9bf7,0x9bf8,0xe4c3, -0xb5ed,0x9bf9,0x9bfa,0x9bfb,0xd7cd,0xe4c0,0xcffd,0xe4bf, -0x9bfc,0x9bfd,0x9bfe,0xc1dc,0xccca,0x9c40,0x9c41,0x9c42, -0x9c43,0xcae7,0x9c44,0x9c45,0x9c46,0x9c47,0xc4d7,0x9c48, -0xccd4,0xe4c8,0x9c49,0x9c4a,0x9c4b,0xe4c7,0xe4c1,0x9c4c, -0xe4c4,0xb5ad,0x9c4d,0x9c4e,0xd3d9,0x9c4f,0xe4c6,0x9c50, -0x9c51,0x9c52,0x9c53,0xd2f9,0xb4e3,0x9c54,0xbbb4,0x9c55, -0x9c56,0xc9ee,0x9c57,0xb4be,0x9c58,0x9c59,0x9c5a,0xbbec, -0x9c5b,0xd1cd,0x9c5c,0xcced,0xedb5,0x9c5d,0x9c5e,0x9c5f, -0x9c60,0x9c61,0x9c62,0x9c63,0x9c64,0xc7e5,0x9c65,0x9c66, -0x9c67,0x9c68,0xd4a8,0x9c69,0xe4cb,0xd7d5,0xe4c2,0x9c6a, -0xbda5,0xe4c5,0x9c6b,0x9c6c,0xd3e6,0x9c6d,0xe4c9,0xc9f8, -0x9c6e,0x9c6f,0xe4be,0x9c70,0x9c71,0xd3e5,0x9c72,0x9c73, -0xc7fe,0xb6c9,0x9c74,0xd4fc,0xb2b3,0xe4d7,0x9c75,0x9c76, -0x9c77,0xcec2,0x9c78,0xe4cd,0x9c79,0xcebc,0x9c7a,0xb8db, -0x9c7b,0x9c7c,0xe4d6,0x9c7d,0xbfca,0x9c7e,0x9c80,0x9c81, -0xd3ce,0x9c82,0xc3ec,0x9c83,0x9c84,0x9c85,0x9c86,0x9c87, -0x9c88,0x9c89,0x9c8a,0xc5c8,0xe4d8,0x9c8b,0x9c8c,0x9c8d, -0x9c8e,0x9c8f,0x9c90,0x9c91,0x9c92,0xcdc4,0xe4cf,0x9c93, -0x9c94,0x9c95,0x9c96,0xe4d4,0xe4d5,0x9c97,0xbafe,0x9c98, -0xcfe6,0x9c99,0x9c9a,0xd5bf,0x9c9b,0x9c9c,0x9c9d,0xe4d2, -0x9c9e,0x9c9f,0x9ca0,0x9ca1,0x9ca2,0x9ca3,0x9ca4,0x9ca5, -0x9ca6,0x9ca7,0x9ca8,0xe4d0,0x9ca9,0x9caa,0xe4ce,0x9cab, -0x9cac,0x9cad,0x9cae,0x9caf,0x9cb0,0x9cb1,0x9cb2,0x9cb3, -0x9cb4,0x9cb5,0x9cb6,0x9cb7,0x9cb8,0x9cb9,0xcde5,0xcaaa, -0x9cba,0x9cbb,0x9cbc,0xc0a3,0x9cbd,0xbda6,0xe4d3,0x9cbe, -0x9cbf,0xb8c8,0x9cc0,0x9cc1,0x9cc2,0x9cc3,0x9cc4,0xe4e7, -0xd4b4,0x9cc5,0x9cc6,0x9cc7,0x9cc8,0x9cc9,0x9cca,0x9ccb, -0xe4db,0x9ccc,0x9ccd,0x9cce,0xc1ef,0x9ccf,0x9cd0,0xe4e9, -0x9cd1,0x9cd2,0xd2e7,0x9cd3,0x9cd4,0xe4df,0x9cd5,0xe4e0, -0x9cd6,0x9cd7,0xcfaa,0x9cd8,0x9cd9,0x9cda,0x9cdb,0xcbdd, -0x9cdc,0xe4da,0xe4d1,0x9cdd,0xe4e5,0x9cde,0xc8dc,0xe4e3, -0x9cdf,0x9ce0,0xc4e7,0xe4e2,0x9ce1,0xe4e1,0x9ce2,0x9ce3, -0x9ce4,0xb3fc,0xe4e8,0x9ce5,0x9ce6,0x9ce7,0x9ce8,0xb5e1, -0x9ce9,0x9cea,0x9ceb,0xd7cc,0x9cec,0x9ced,0x9cee,0xe4e6, -0x9cef,0xbbac,0x9cf0,0xd7d2,0xcccf,0xebf8,0x9cf1,0xe4e4, -0x9cf2,0x9cf3,0xb9f6,0x9cf4,0x9cf5,0x9cf6,0xd6cd,0xe4d9, -0xe4dc,0xc2fa,0xe4de,0x9cf7,0xc2cb,0xc0c4,0xc2d0,0x9cf8, -0xb1f5,0xccb2,0x9cf9,0x9cfa,0x9cfb,0x9cfc,0x9cfd,0x9cfe, -0x9d40,0x9d41,0x9d42,0x9d43,0xb5ce,0x9d44,0x9d45,0x9d46, -0x9d47,0xe4ef,0x9d48,0x9d49,0x9d4a,0x9d4b,0x9d4c,0x9d4d, -0x9d4e,0x9d4f,0xc6af,0x9d50,0x9d51,0x9d52,0xc6e1,0x9d53, -0x9d54,0xe4f5,0x9d55,0x9d56,0x9d57,0x9d58,0x9d59,0xc2a9, -0x9d5a,0x9d5b,0x9d5c,0xc0ec,0xd1dd,0xe4ee,0x9d5d,0x9d5e, -0x9d5f,0x9d60,0x9d61,0x9d62,0x9d63,0x9d64,0x9d65,0x9d66, -0xc4ae,0x9d67,0x9d68,0x9d69,0xe4ed,0x9d6a,0x9d6b,0x9d6c, -0x9d6d,0xe4f6,0xe4f4,0xc2fe,0x9d6e,0xe4dd,0x9d6f,0xe4f0, -0x9d70,0xcafe,0x9d71,0xd5c4,0x9d72,0x9d73,0xe4f1,0x9d74, -0x9d75,0x9d76,0x9d77,0x9d78,0x9d79,0x9d7a,0xd1fa,0x9d7b, -0x9d7c,0x9d7d,0x9d7e,0x9d80,0x9d81,0x9d82,0xe4eb,0xe4ec, -0x9d83,0x9d84,0x9d85,0xe4f2,0x9d86,0xceab,0x9d87,0x9d88, -0x9d89,0x9d8a,0x9d8b,0x9d8c,0x9d8d,0x9d8e,0x9d8f,0x9d90, -0xc5cb,0x9d91,0x9d92,0x9d93,0xc7b1,0x9d94,0xc2ba,0x9d95, -0x9d96,0x9d97,0xe4ea,0x9d98,0x9d99,0x9d9a,0xc1ca,0x9d9b, -0x9d9c,0x9d9d,0x9d9e,0x9d9f,0x9da0,0xccb6,0xb3b1,0x9da1, -0x9da2,0x9da3,0xe4fb,0x9da4,0xe4f3,0x9da5,0x9da6,0x9da7, -0xe4fa,0x9da8,0xe4fd,0x9da9,0xe4fc,0x9daa,0x9dab,0x9dac, -0x9dad,0x9dae,0x9daf,0x9db0,0xb3ce,0x9db1,0x9db2,0x9db3, -0xb3ba,0xe4f7,0x9db4,0x9db5,0xe4f9,0xe4f8,0xc5ec,0x9db6, -0x9db7,0x9db8,0x9db9,0x9dba,0x9dbb,0x9dbc,0x9dbd,0x9dbe, -0x9dbf,0x9dc0,0x9dc1,0x9dc2,0xc0bd,0x9dc3,0x9dc4,0x9dc5, -0x9dc6,0xd4e8,0x9dc7,0x9dc8,0x9dc9,0x9dca,0x9dcb,0xe5a2, -0x9dcc,0x9dcd,0x9dce,0x9dcf,0x9dd0,0x9dd1,0x9dd2,0x9dd3, -0x9dd4,0x9dd5,0x9dd6,0xb0c4,0x9dd7,0x9dd8,0xe5a4,0x9dd9, -0x9dda,0xe5a3,0x9ddb,0x9ddc,0x9ddd,0x9dde,0x9ddf,0x9de0, -0xbca4,0x9de1,0xe5a5,0x9de2,0x9de3,0x9de4,0x9de5,0x9de6, -0x9de7,0xe5a1,0x9de8,0x9de9,0x9dea,0x9deb,0x9dec,0x9ded, -0x9dee,0xe4fe,0xb1f4,0x9def,0x9df0,0x9df1,0x9df2,0x9df3, -0x9df4,0x9df5,0x9df6,0x9df7,0x9df8,0x9df9,0xe5a8,0x9dfa, -0xe5a9,0xe5a6,0x9dfb,0x9dfc,0x9dfd,0x9dfe,0x9e40,0x9e41, -0x9e42,0x9e43,0x9e44,0x9e45,0x9e46,0x9e47,0xe5a7,0xe5aa, -0x9e48,0x9e49,0x9e4a,0x9e4b,0x9e4c,0x9e4d,0x9e4e,0x9e4f, -0x9e50,0x9e51,0x9e52,0x9e53,0x9e54,0x9e55,0x9e56,0x9e57, -0x9e58,0x9e59,0x9e5a,0x9e5b,0x9e5c,0x9e5d,0x9e5e,0x9e5f, -0x9e60,0x9e61,0x9e62,0x9e63,0x9e64,0x9e65,0x9e66,0x9e67, -0x9e68,0xc6d9,0x9e69,0x9e6a,0x9e6b,0x9e6c,0x9e6d,0x9e6e, -0x9e6f,0x9e70,0xe5ab,0xe5ad,0x9e71,0x9e72,0x9e73,0x9e74, -0x9e75,0x9e76,0x9e77,0xe5ac,0x9e78,0x9e79,0x9e7a,0x9e7b, -0x9e7c,0x9e7d,0x9e7e,0x9e80,0x9e81,0x9e82,0x9e83,0x9e84, -0x9e85,0x9e86,0x9e87,0x9e88,0x9e89,0xe5af,0x9e8a,0x9e8b, -0x9e8c,0xe5ae,0x9e8d,0x9e8e,0x9e8f,0x9e90,0x9e91,0x9e92, -0x9e93,0x9e94,0x9e95,0x9e96,0x9e97,0x9e98,0x9e99,0x9e9a, -0x9e9b,0x9e9c,0x9e9d,0x9e9e,0xb9e0,0x9e9f,0x9ea0,0xe5b0, -0x9ea1,0x9ea2,0x9ea3,0x9ea4,0x9ea5,0x9ea6,0x9ea7,0x9ea8, -0x9ea9,0x9eaa,0x9eab,0x9eac,0x9ead,0x9eae,0xe5b1,0x9eaf, -0x9eb0,0x9eb1,0x9eb2,0x9eb3,0x9eb4,0x9eb5,0x9eb6,0x9eb7, -0x9eb8,0x9eb9,0x9eba,0xbbf0,0xece1,0xc3f0,0x9ebb,0xb5c6, -0xbbd2,0x9ebc,0x9ebd,0x9ebe,0x9ebf,0xc1e9,0xd4ee,0x9ec0, -0xbec4,0x9ec1,0x9ec2,0x9ec3,0xd7c6,0x9ec4,0xd4d6,0xb2d3, -0xecbe,0x9ec5,0x9ec6,0x9ec7,0x9ec8,0xeac1,0x9ec9,0x9eca, -0x9ecb,0xc2af,0xb4b6,0x9ecc,0x9ecd,0x9ece,0xd1d7,0x9ecf, -0x9ed0,0x9ed1,0xb3b4,0x9ed2,0xc8b2,0xbfbb,0xecc0,0x9ed3, -0x9ed4,0xd6cb,0x9ed5,0x9ed6,0xecbf,0xecc1,0x9ed7,0x9ed8, -0x9ed9,0x9eda,0x9edb,0x9edc,0x9edd,0x9ede,0x9edf,0x9ee0, -0x9ee1,0x9ee2,0x9ee3,0xecc5,0xbee6,0xccbf,0xc5da,0xbebc, -0x9ee4,0xecc6,0x9ee5,0xb1fe,0x9ee6,0x9ee7,0x9ee8,0xecc4, -0xd5a8,0xb5e3,0x9ee9,0xecc2,0xc1b6,0xb3e3,0x9eea,0x9eeb, -0xecc3,0xcbb8,0xc0c3,0xccfe,0x9eec,0x9eed,0x9eee,0x9eef, -0xc1d2,0x9ef0,0xecc8,0x9ef1,0x9ef2,0x9ef3,0x9ef4,0x9ef5, -0x9ef6,0x9ef7,0x9ef8,0x9ef9,0x9efa,0x9efb,0x9efc,0x9efd, -0xbae6,0xc0d3,0x9efe,0xd6f2,0x9f40,0x9f41,0x9f42,0xd1cc, -0x9f43,0x9f44,0x9f45,0x9f46,0xbfbe,0x9f47,0xb7b3,0xc9d5, -0xecc7,0xbbe2,0x9f48,0xcccc,0xbdfd,0xc8c8,0x9f49,0xcfa9, -0x9f4a,0x9f4b,0x9f4c,0x9f4d,0x9f4e,0x9f4f,0x9f50,0xcde9, -0x9f51,0xc5eb,0x9f52,0x9f53,0x9f54,0xb7e9,0x9f55,0x9f56, -0x9f57,0x9f58,0x9f59,0x9f5a,0x9f5b,0x9f5c,0x9f5d,0x9f5e, -0x9f5f,0xd1c9,0xbab8,0x9f60,0x9f61,0x9f62,0x9f63,0x9f64, -0xecc9,0x9f65,0x9f66,0xecca,0x9f67,0xbbc0,0xeccb,0x9f68, -0xece2,0xb1ba,0xb7d9,0x9f69,0x9f6a,0x9f6b,0x9f6c,0x9f6d, -0x9f6e,0x9f6f,0x9f70,0x9f71,0x9f72,0x9f73,0xbdb9,0x9f74, -0x9f75,0x9f76,0x9f77,0x9f78,0x9f79,0x9f7a,0x9f7b,0xeccc, -0xd1e6,0xeccd,0x9f7c,0x9f7d,0x9f7e,0x9f80,0xc8bb,0x9f81, -0x9f82,0x9f83,0x9f84,0x9f85,0x9f86,0x9f87,0x9f88,0x9f89, -0x9f8a,0x9f8b,0x9f8c,0x9f8d,0x9f8e,0xecd1,0x9f8f,0x9f90, -0x9f91,0x9f92,0xecd3,0x9f93,0xbbcd,0x9f94,0xbce5,0x9f95, -0x9f96,0x9f97,0x9f98,0x9f99,0x9f9a,0x9f9b,0x9f9c,0x9f9d, -0x9f9e,0x9f9f,0x9fa0,0x9fa1,0xeccf,0x9fa2,0xc9b7,0x9fa3, -0x9fa4,0x9fa5,0x9fa6,0x9fa7,0xc3ba,0x9fa8,0xece3,0xd5d5, -0xecd0,0x9fa9,0x9faa,0x9fab,0x9fac,0x9fad,0xd6f3,0x9fae, -0x9faf,0x9fb0,0xecd2,0xecce,0x9fb1,0x9fb2,0x9fb3,0x9fb4, -0xecd4,0x9fb5,0xecd5,0x9fb6,0x9fb7,0xc9bf,0x9fb8,0x9fb9, -0x9fba,0x9fbb,0x9fbc,0x9fbd,0xcfa8,0x9fbe,0x9fbf,0x9fc0, -0x9fc1,0x9fc2,0xd0dc,0x9fc3,0x9fc4,0x9fc5,0x9fc6,0xd1ac, -0x9fc7,0x9fc8,0x9fc9,0x9fca,0xc8db,0x9fcb,0x9fcc,0x9fcd, -0xecd6,0xcef5,0x9fce,0x9fcf,0x9fd0,0x9fd1,0x9fd2,0xcaec, -0xecda,0x9fd3,0x9fd4,0x9fd5,0x9fd6,0x9fd7,0x9fd8,0x9fd9, -0xecd9,0x9fda,0x9fdb,0x9fdc,0xb0be,0x9fdd,0x9fde,0x9fdf, -0x9fe0,0x9fe1,0x9fe2,0xecd7,0x9fe3,0xecd8,0x9fe4,0x9fe5, -0x9fe6,0xece4,0x9fe7,0x9fe8,0x9fe9,0x9fea,0x9feb,0x9fec, -0x9fed,0x9fee,0x9fef,0xc8bc,0x9ff0,0x9ff1,0x9ff2,0x9ff3, -0x9ff4,0x9ff5,0x9ff6,0x9ff7,0x9ff8,0x9ff9,0xc1c7,0x9ffa, -0x9ffb,0x9ffc,0x9ffd,0x9ffe,0xecdc,0xd1e0,0xa040,0xa041, -0xa042,0xa043,0xa044,0xa045,0xa046,0xa047,0xa048,0xa049, -0xecdb,0xa04a,0xa04b,0xa04c,0xa04d,0xd4ef,0xa04e,0xecdd, -0xa04f,0xa050,0xa051,0xa052,0xa053,0xa054,0xdbc6,0xa055, -0xa056,0xa057,0xa058,0xa059,0xa05a,0xa05b,0xa05c,0xa05d, -0xa05e,0xecde,0xa05f,0xa060,0xa061,0xa062,0xa063,0xa064, -0xa065,0xa066,0xa067,0xa068,0xa069,0xa06a,0xb1ac,0xa06b, -0xa06c,0xa06d,0xa06e,0xa06f,0xa070,0xa071,0xa072,0xa073, -0xa074,0xa075,0xa076,0xa077,0xa078,0xa079,0xa07a,0xa07b, -0xa07c,0xa07d,0xa07e,0xa080,0xa081,0xecdf,0xa082,0xa083, -0xa084,0xa085,0xa086,0xa087,0xa088,0xa089,0xa08a,0xa08b, -0xece0,0xa08c,0xd7a6,0xa08d,0xc5c0,0xa08e,0xa08f,0xa090, -0xebbc,0xb0ae,0xa091,0xa092,0xa093,0xbef4,0xb8b8,0xd2af, -0xb0d6,0xb5f9,0xa094,0xd8b3,0xa095,0xcbac,0xa096,0xe3dd, -0xa097,0xa098,0xa099,0xa09a,0xa09b,0xa09c,0xa09d,0xc6ac, -0xb0e6,0xa09e,0xa09f,0xa0a0,0xc5c6,0xebb9,0xa0a1,0xa0a2, -0xa0a3,0xa0a4,0xebba,0xa0a5,0xa0a6,0xa0a7,0xebbb,0xa0a8, -0xa0a9,0xd1c0,0xa0aa,0xc5a3,0xa0ab,0xeaf2,0xa0ac,0xc4b2, -0xa0ad,0xc4b5,0xc0ce,0xa0ae,0xa0af,0xa0b0,0xeaf3,0xc4c1, -0xa0b1,0xceef,0xa0b2,0xa0b3,0xa0b4,0xa0b5,0xeaf0,0xeaf4, -0xa0b6,0xa0b7,0xc9fc,0xa0b8,0xa0b9,0xc7a3,0xa0ba,0xa0bb, -0xa0bc,0xccd8,0xcefe,0xa0bd,0xa0be,0xa0bf,0xeaf5,0xeaf6, -0xcfac,0xc0e7,0xa0c0,0xa0c1,0xeaf7,0xa0c2,0xa0c3,0xa0c4, -0xa0c5,0xa0c6,0xb6bf,0xeaf8,0xa0c7,0xeaf9,0xa0c8,0xeafa, -0xa0c9,0xa0ca,0xeafb,0xa0cb,0xa0cc,0xa0cd,0xa0ce,0xa0cf, -0xa0d0,0xa0d1,0xa0d2,0xa0d3,0xa0d4,0xa0d5,0xa0d6,0xeaf1, -0xa0d7,0xa0d8,0xa0d9,0xa0da,0xa0db,0xa0dc,0xa0dd,0xa0de, -0xa0df,0xa0e0,0xa0e1,0xa0e2,0xc8ae,0xe1eb,0xa0e3,0xb7b8, -0xe1ec,0xa0e4,0xa0e5,0xa0e6,0xe1ed,0xa0e7,0xd7b4,0xe1ee, -0xe1ef,0xd3cc,0xa0e8,0xa0e9,0xa0ea,0xa0eb,0xa0ec,0xa0ed, -0xa0ee,0xe1f1,0xbff1,0xe1f0,0xb5d2,0xa0ef,0xa0f0,0xa0f1, -0xb1b7,0xa0f2,0xa0f3,0xa0f4,0xa0f5,0xe1f3,0xe1f2,0xa0f6, -0xbafc,0xa0f7,0xe1f4,0xa0f8,0xa0f9,0xa0fa,0xa0fb,0xb9b7, -0xa0fc,0xbed1,0xa0fd,0xa0fe,0xaa40,0xaa41,0xc4fc,0xaa42, -0xbadd,0xbdc6,0xaa43,0xaa44,0xaa45,0xaa46,0xaa47,0xaa48, -0xe1f5,0xe1f7,0xaa49,0xaa4a,0xb6c0,0xcfc1,0xcaa8,0xe1f6, -0xd5f8,0xd3fc,0xe1f8,0xe1fc,0xe1f9,0xaa4b,0xaa4c,0xe1fa, -0xc0ea,0xaa4d,0xe1fe,0xe2a1,0xc0c7,0xaa4e,0xaa4f,0xaa50, -0xaa51,0xe1fb,0xaa52,0xe1fd,0xaa53,0xaa54,0xaa55,0xaa56, -0xaa57,0xaa58,0xe2a5,0xaa59,0xaa5a,0xaa5b,0xc1d4,0xaa5c, -0xaa5d,0xaa5e,0xaa5f,0xe2a3,0xaa60,0xe2a8,0xb2fe,0xe2a2, -0xaa61,0xaa62,0xaa63,0xc3cd,0xb2c2,0xe2a7,0xe2a6,0xaa64, -0xaa65,0xe2a4,0xe2a9,0xaa66,0xaa67,0xe2ab,0xaa68,0xaa69, -0xaa6a,0xd0c9,0xd6ed,0xc3a8,0xe2ac,0xaa6b,0xcfd7,0xaa6c, -0xaa6d,0xe2ae,0xaa6e,0xaa6f,0xbaef,0xaa70,0xaa71,0xe9e0, -0xe2ad,0xe2aa,0xaa72,0xaa73,0xaa74,0xaa75,0xbbab,0xd4b3, -0xaa76,0xaa77,0xaa78,0xaa79,0xaa7a,0xaa7b,0xaa7c,0xaa7d, -0xaa7e,0xaa80,0xaa81,0xaa82,0xaa83,0xe2b0,0xaa84,0xaa85, -0xe2af,0xaa86,0xe9e1,0xaa87,0xaa88,0xaa89,0xaa8a,0xe2b1, -0xaa8b,0xaa8c,0xaa8d,0xaa8e,0xaa8f,0xaa90,0xaa91,0xaa92, -0xe2b2,0xaa93,0xaa94,0xaa95,0xaa96,0xaa97,0xaa98,0xaa99, -0xaa9a,0xaa9b,0xaa9c,0xaa9d,0xe2b3,0xcca1,0xaa9e,0xe2b4, -0xaa9f,0xaaa0,0xab40,0xab41,0xab42,0xab43,0xab44,0xab45, -0xab46,0xab47,0xab48,0xab49,0xab4a,0xab4b,0xe2b5,0xab4c, -0xab4d,0xab4e,0xab4f,0xab50,0xd0fe,0xab51,0xab52,0xc2ca, -0xab53,0xd3f1,0xab54,0xcdf5,0xab55,0xab56,0xe7e0,0xab57, -0xab58,0xe7e1,0xab59,0xab5a,0xab5b,0xab5c,0xbec1,0xab5d, -0xab5e,0xab5f,0xab60,0xc2ea,0xab61,0xab62,0xab63,0xe7e4, -0xab64,0xab65,0xe7e3,0xab66,0xab67,0xab68,0xab69,0xab6a, -0xab6b,0xcde6,0xab6c,0xc3b5,0xab6d,0xab6e,0xe7e2,0xbbb7, -0xcfd6,0xab6f,0xc1e1,0xe7e9,0xab70,0xab71,0xab72,0xe7e8, -0xab73,0xab74,0xe7f4,0xb2a3,0xab75,0xab76,0xab77,0xab78, -0xe7ea,0xab79,0xe7e6,0xab7a,0xab7b,0xab7c,0xab7d,0xab7e, -0xe7ec,0xe7eb,0xc9ba,0xab80,0xab81,0xd5e4,0xab82,0xe7e5, -0xb7a9,0xe7e7,0xab83,0xab84,0xab85,0xab86,0xab87,0xab88, -0xab89,0xe7ee,0xab8a,0xab8b,0xab8c,0xab8d,0xe7f3,0xab8e, -0xd6e9,0xab8f,0xab90,0xab91,0xab92,0xe7ed,0xab93,0xe7f2, -0xab94,0xe7f1,0xab95,0xab96,0xab97,0xb0e0,0xab98,0xab99, -0xab9a,0xab9b,0xe7f5,0xab9c,0xab9d,0xab9e,0xab9f,0xaba0, -0xac40,0xac41,0xac42,0xac43,0xac44,0xac45,0xac46,0xac47, -0xac48,0xac49,0xac4a,0xc7f2,0xac4b,0xc0c5,0xc0ed,0xac4c, -0xac4d,0xc1f0,0xe7f0,0xac4e,0xac4f,0xac50,0xac51,0xe7f6, -0xcbf6,0xac52,0xac53,0xac54,0xac55,0xac56,0xac57,0xac58, -0xac59,0xac5a,0xe8a2,0xe8a1,0xac5b,0xac5c,0xac5d,0xac5e, -0xac5f,0xac60,0xd7c1,0xac61,0xac62,0xe7fa,0xe7f9,0xac63, -0xe7fb,0xac64,0xe7f7,0xac65,0xe7fe,0xac66,0xe7fd,0xac67, -0xe7fc,0xac68,0xac69,0xc1d5,0xc7d9,0xc5fd,0xc5c3,0xac6a, -0xac6b,0xac6c,0xac6d,0xac6e,0xc7ed,0xac6f,0xac70,0xac71, -0xac72,0xe8a3,0xac73,0xac74,0xac75,0xac76,0xac77,0xac78, -0xac79,0xac7a,0xac7b,0xac7c,0xac7d,0xac7e,0xac80,0xac81, -0xac82,0xac83,0xac84,0xac85,0xac86,0xe8a6,0xac87,0xe8a5, -0xac88,0xe8a7,0xbaf7,0xe7f8,0xe8a4,0xac89,0xc8f0,0xc9aa, -0xac8a,0xac8b,0xac8c,0xac8d,0xac8e,0xac8f,0xac90,0xac91, -0xac92,0xac93,0xac94,0xac95,0xac96,0xe8a9,0xac97,0xac98, -0xb9e5,0xac99,0xac9a,0xac9b,0xac9c,0xac9d,0xd1fe,0xe8a8, -0xac9e,0xac9f,0xaca0,0xad40,0xad41,0xad42,0xe8aa,0xad43, -0xe8ad,0xe8ae,0xad44,0xc1a7,0xad45,0xad46,0xad47,0xe8af, -0xad48,0xad49,0xad4a,0xe8b0,0xad4b,0xad4c,0xe8ac,0xad4d, -0xe8b4,0xad4e,0xad4f,0xad50,0xad51,0xad52,0xad53,0xad54, -0xad55,0xad56,0xad57,0xad58,0xe8ab,0xad59,0xe8b1,0xad5a, -0xad5b,0xad5c,0xad5d,0xad5e,0xad5f,0xad60,0xad61,0xe8b5, -0xe8b2,0xe8b3,0xad62,0xad63,0xad64,0xad65,0xad66,0xad67, -0xad68,0xad69,0xad6a,0xad6b,0xad6c,0xad6d,0xad6e,0xad6f, -0xad70,0xad71,0xe8b7,0xad72,0xad73,0xad74,0xad75,0xad76, -0xad77,0xad78,0xad79,0xad7a,0xad7b,0xad7c,0xad7d,0xad7e, -0xad80,0xad81,0xad82,0xad83,0xad84,0xad85,0xad86,0xad87, -0xad88,0xad89,0xe8b6,0xad8a,0xad8b,0xad8c,0xad8d,0xad8e, -0xad8f,0xad90,0xad91,0xad92,0xb9cf,0xad93,0xf0ac,0xad94, -0xf0ad,0xad95,0xc6b0,0xb0ea,0xc8bf,0xad96,0xcddf,0xad97, -0xad98,0xad99,0xad9a,0xad9b,0xad9c,0xad9d,0xcecd,0xeab1, -0xad9e,0xad9f,0xada0,0xae40,0xeab2,0xae41,0xc6bf,0xb4c9, -0xae42,0xae43,0xae44,0xae45,0xae46,0xae47,0xae48,0xeab3, -0xae49,0xae4a,0xae4b,0xae4c,0xd5e7,0xae4d,0xae4e,0xae4f, -0xae50,0xae51,0xae52,0xae53,0xae54,0xddf9,0xae55,0xeab4, -0xae56,0xeab5,0xae57,0xeab6,0xae58,0xae59,0xae5a,0xae5b, -0xb8ca,0xdfb0,0xc9f5,0xae5c,0xccf0,0xae5d,0xae5e,0xc9fa, -0xae5f,0xae60,0xae61,0xae62,0xae63,0xc9fb,0xae64,0xae65, -0xd3c3,0xcba6,0xae66,0xb8a6,0xf0ae,0xb1c2,0xae67,0xe5b8, -0xccef,0xd3c9,0xbcd7,0xc9ea,0xae68,0xb5e7,0xae69,0xc4d0, -0xb5e9,0xae6a,0xeeae,0xbbad,0xae6b,0xae6c,0xe7de,0xae6d, -0xeeaf,0xae6e,0xae6f,0xae70,0xae71,0xb3a9,0xae72,0xae73, -0xeeb2,0xae74,0xae75,0xeeb1,0xbde7,0xae76,0xeeb0,0xceb7, -0xae77,0xae78,0xae79,0xae7a,0xc5cf,0xae7b,0xae7c,0xae7d, -0xae7e,0xc1f4,0xdbce,0xeeb3,0xd0f3,0xae80,0xae81,0xae82, -0xae83,0xae84,0xae85,0xae86,0xae87,0xc2d4,0xc6e8,0xae88, -0xae89,0xae8a,0xb7ac,0xae8b,0xae8c,0xae8d,0xae8e,0xae8f, -0xae90,0xae91,0xeeb4,0xae92,0xb3eb,0xae93,0xae94,0xae95, -0xbbfb,0xeeb5,0xae96,0xae97,0xae98,0xae99,0xae9a,0xe7dc, -0xae9b,0xae9c,0xae9d,0xeeb6,0xae9e,0xae9f,0xbdae,0xaea0, -0xaf40,0xaf41,0xaf42,0xf1e2,0xaf43,0xaf44,0xaf45,0xcae8, -0xaf46,0xd2c9,0xf0da,0xaf47,0xf0db,0xaf48,0xf0dc,0xc1c6, -0xaf49,0xb8ed,0xbece,0xaf4a,0xaf4b,0xf0de,0xaf4c,0xc5b1, -0xf0dd,0xd1f1,0xaf4d,0xf0e0,0xb0cc,0xbdea,0xaf4e,0xaf4f, -0xaf50,0xaf51,0xaf52,0xd2df,0xf0df,0xaf53,0xb4af,0xb7e8, -0xf0e6,0xf0e5,0xc6a3,0xf0e1,0xf0e2,0xb4c3,0xaf54,0xaf55, -0xf0e3,0xd5ee,0xaf56,0xaf57,0xccdb,0xbed2,0xbcb2,0xaf58, -0xaf59,0xaf5a,0xf0e8,0xf0e7,0xf0e4,0xb2a1,0xaf5b,0xd6a2, -0xd3b8,0xbeb7,0xc8ac,0xaf5c,0xaf5d,0xf0ea,0xaf5e,0xaf5f, -0xaf60,0xaf61,0xd1f7,0xaf62,0xd6cc,0xbadb,0xf0e9,0xaf63, -0xb6bb,0xaf64,0xaf65,0xcdb4,0xaf66,0xaf67,0xc6a6,0xaf68, -0xaf69,0xaf6a,0xc1a1,0xf0eb,0xf0ee,0xaf6b,0xf0ed,0xf0f0, -0xf0ec,0xaf6c,0xbbbe,0xf0ef,0xaf6d,0xaf6e,0xaf6f,0xaf70, -0xccb5,0xf0f2,0xaf71,0xaf72,0xb3d5,0xaf73,0xaf74,0xaf75, -0xaf76,0xb1d4,0xaf77,0xaf78,0xf0f3,0xaf79,0xaf7a,0xf0f4, -0xf0f6,0xb4e1,0xaf7b,0xf0f1,0xaf7c,0xf0f7,0xaf7d,0xaf7e, -0xaf80,0xaf81,0xf0fa,0xaf82,0xf0f8,0xaf83,0xaf84,0xaf85, -0xf0f5,0xaf86,0xaf87,0xaf88,0xaf89,0xf0fd,0xaf8a,0xf0f9, -0xf0fc,0xf0fe,0xaf8b,0xf1a1,0xaf8c,0xaf8d,0xaf8e,0xcec1, -0xf1a4,0xaf8f,0xf1a3,0xaf90,0xc1f6,0xf0fb,0xcadd,0xaf91, -0xaf92,0xb4f1,0xb1f1,0xccb1,0xaf93,0xf1a6,0xaf94,0xaf95, -0xf1a7,0xaf96,0xaf97,0xf1ac,0xd5ce,0xf1a9,0xaf98,0xaf99, -0xc8b3,0xaf9a,0xaf9b,0xaf9c,0xf1a2,0xaf9d,0xf1ab,0xf1a8, -0xf1a5,0xaf9e,0xaf9f,0xf1aa,0xafa0,0xb040,0xb041,0xb042, -0xb043,0xb044,0xb045,0xb046,0xb0a9,0xf1ad,0xb047,0xb048, -0xb049,0xb04a,0xb04b,0xb04c,0xf1af,0xb04d,0xf1b1,0xb04e, -0xb04f,0xb050,0xb051,0xb052,0xf1b0,0xb053,0xf1ae,0xb054, -0xb055,0xb056,0xb057,0xd1a2,0xb058,0xb059,0xb05a,0xb05b, -0xb05c,0xb05d,0xb05e,0xf1b2,0xb05f,0xb060,0xb061,0xf1b3, -0xb062,0xb063,0xb064,0xb065,0xb066,0xb067,0xb068,0xb069, -0xb9ef,0xb06a,0xb06b,0xb5c7,0xb06c,0xb0d7,0xb0d9,0xb06d, -0xb06e,0xb06f,0xd4ed,0xb070,0xb5c4,0xb071,0xbdd4,0xbbca, -0xf0a7,0xb072,0xb073,0xb8de,0xb074,0xb075,0xf0a8,0xb076, -0xb077,0xb0a8,0xb078,0xf0a9,0xb079,0xb07a,0xcdee,0xb07b, -0xb07c,0xf0aa,0xb07d,0xb07e,0xb080,0xb081,0xb082,0xb083, -0xb084,0xb085,0xb086,0xb087,0xf0ab,0xb088,0xb089,0xb08a, -0xb08b,0xb08c,0xb08d,0xb08e,0xb08f,0xb090,0xc6a4,0xb091, -0xb092,0xd6e5,0xf1e4,0xb093,0xf1e5,0xb094,0xb095,0xb096, -0xb097,0xb098,0xb099,0xb09a,0xb09b,0xb09c,0xb09d,0xc3f3, -0xb09e,0xb09f,0xd3db,0xb0a0,0xb140,0xd6d1,0xc5e8,0xb141, -0xd3af,0xb142,0xd2e6,0xb143,0xb144,0xeec1,0xb0bb,0xd5b5, -0xd1ce,0xbce0,0xbad0,0xb145,0xbff8,0xb146,0xb8c7,0xb5c1, -0xc5cc,0xb147,0xb148,0xcaa2,0xb149,0xb14a,0xb14b,0xc3cb, -0xb14c,0xb14d,0xb14e,0xb14f,0xb150,0xeec2,0xb151,0xb152, -0xb153,0xb154,0xb155,0xb156,0xb157,0xb158,0xc4bf,0xb6a2, -0xb159,0xedec,0xc3a4,0xb15a,0xd6b1,0xb15b,0xb15c,0xb15d, -0xcfe0,0xedef,0xb15e,0xb15f,0xc5ce,0xb160,0xb6dc,0xb161, -0xb162,0xcaa1,0xb163,0xb164,0xeded,0xb165,0xb166,0xedf0, -0xedf1,0xc3bc,0xb167,0xbfb4,0xb168,0xedee,0xb169,0xb16a, -0xb16b,0xb16c,0xb16d,0xb16e,0xb16f,0xb170,0xb171,0xb172, -0xb173,0xedf4,0xedf2,0xb174,0xb175,0xb176,0xb177,0xd5e6, -0xc3df,0xb178,0xedf3,0xb179,0xb17a,0xb17b,0xedf6,0xb17c, -0xd5a3,0xd1a3,0xb17d,0xb17e,0xb180,0xedf5,0xb181,0xc3d0, -0xb182,0xb183,0xb184,0xb185,0xb186,0xedf7,0xbff4,0xbeec, -0xedf8,0xb187,0xccf7,0xb188,0xd1db,0xb189,0xb18a,0xb18b, -0xd7c5,0xd5f6,0xb18c,0xedfc,0xb18d,0xb18e,0xb18f,0xedfb, -0xb190,0xb191,0xb192,0xb193,0xb194,0xb195,0xb196,0xb197, -0xedf9,0xedfa,0xb198,0xb199,0xb19a,0xb19b,0xb19c,0xb19d, -0xb19e,0xb19f,0xedfd,0xbea6,0xb1a0,0xb240,0xb241,0xb242, -0xb243,0xcbaf,0xeea1,0xb6bd,0xb244,0xeea2,0xc4c0,0xb245, -0xedfe,0xb246,0xb247,0xbdde,0xb2c7,0xb248,0xb249,0xb24a, -0xb24b,0xb24c,0xb24d,0xb24e,0xb24f,0xb250,0xb251,0xb252, -0xb253,0xb6c3,0xb254,0xb255,0xb256,0xeea5,0xd8ba,0xeea3, -0xeea6,0xb257,0xb258,0xb259,0xc3e9,0xb3f2,0xb25a,0xb25b, -0xb25c,0xb25d,0xb25e,0xb25f,0xeea7,0xeea4,0xcfb9,0xb260, -0xb261,0xeea8,0xc2f7,0xb262,0xb263,0xb264,0xb265,0xb266, -0xb267,0xb268,0xb269,0xb26a,0xb26b,0xb26c,0xb26d,0xeea9, -0xeeaa,0xb26e,0xdeab,0xb26f,0xb270,0xc6b3,0xb271,0xc7c6, -0xb272,0xd6f5,0xb5c9,0xb273,0xcbb2,0xb274,0xb275,0xb276, -0xeeab,0xb277,0xb278,0xcdab,0xb279,0xeeac,0xb27a,0xb27b, -0xb27c,0xb27d,0xb27e,0xd5b0,0xb280,0xeead,0xb281,0xf6c4, -0xb282,0xb283,0xb284,0xb285,0xb286,0xb287,0xb288,0xb289, -0xb28a,0xb28b,0xb28c,0xb28d,0xb28e,0xdbc7,0xb28f,0xb290, -0xb291,0xb292,0xb293,0xb294,0xb295,0xb296,0xb297,0xb4a3, -0xb298,0xb299,0xb29a,0xc3ac,0xf1e6,0xb29b,0xb29c,0xb29d, -0xb29e,0xb29f,0xcab8,0xd2d3,0xb2a0,0xd6aa,0xb340,0xeff2, -0xb341,0xbed8,0xb342,0xbdc3,0xeff3,0xb6cc,0xb0ab,0xb343, -0xb344,0xb345,0xb346,0xcaaf,0xb347,0xb348,0xedb6,0xb349, -0xedb7,0xb34a,0xb34b,0xb34c,0xb34d,0xcef9,0xb7af,0xbff3, -0xedb8,0xc2eb,0xc9b0,0xb34e,0xb34f,0xb350,0xb351,0xb352, -0xb353,0xedb9,0xb354,0xb355,0xc6f6,0xbfb3,0xb356,0xb357, -0xb358,0xedbc,0xc5f8,0xb359,0xd1d0,0xb35a,0xd7a9,0xedba, -0xedbb,0xb35b,0xd1e2,0xb35c,0xedbf,0xedc0,0xb35d,0xedc4, -0xb35e,0xb35f,0xb360,0xedc8,0xb361,0xedc6,0xedce,0xd5e8, -0xb362,0xedc9,0xb363,0xb364,0xedc7,0xedbe,0xb365,0xb366, -0xc5e9,0xb367,0xb368,0xb369,0xc6c6,0xb36a,0xb36b,0xc9e9, -0xd4d2,0xedc1,0xedc2,0xedc3,0xedc5,0xb36c,0xc0f9,0xb36d, -0xb4a1,0xb36e,0xb36f,0xb370,0xb371,0xb9e8,0xb372,0xedd0, -0xb373,0xb374,0xb375,0xb376,0xedd1,0xb377,0xedca,0xb378, -0xedcf,0xb379,0xcef8,0xb37a,0xb37b,0xcbb6,0xedcc,0xedcd, -0xb37c,0xb37d,0xb37e,0xb380,0xb381,0xcff5,0xb382,0xb383, -0xb384,0xb385,0xb386,0xb387,0xb388,0xb389,0xb38a,0xb38b, -0xb38c,0xb38d,0xedd2,0xc1f2,0xd3b2,0xedcb,0xc8b7,0xb38e, -0xb38f,0xb390,0xb391,0xb392,0xb393,0xb394,0xb395,0xbcef, -0xb396,0xb397,0xb398,0xb399,0xc5f0,0xb39a,0xb39b,0xb39c, -0xb39d,0xb39e,0xb39f,0xb3a0,0xb440,0xb441,0xb442,0xedd6, -0xb443,0xb5ef,0xb444,0xb445,0xc2b5,0xb0ad,0xcbe9,0xb446, -0xb447,0xb1ae,0xb448,0xedd4,0xb449,0xb44a,0xb44b,0xcdeb, -0xb5e2,0xb44c,0xedd5,0xedd3,0xedd7,0xb44d,0xb44e,0xb5fa, -0xb44f,0xedd8,0xb450,0xedd9,0xb451,0xeddc,0xb452,0xb1cc, -0xb453,0xb454,0xb455,0xb456,0xb457,0xb458,0xb459,0xb45a, -0xc5f6,0xbcee,0xedda,0xccbc,0xb2ea,0xb45b,0xb45c,0xb45d, -0xb45e,0xeddb,0xb45f,0xb460,0xb461,0xb462,0xc4eb,0xb463, -0xb464,0xb4c5,0xb465,0xb466,0xb467,0xb0f5,0xb468,0xb469, -0xb46a,0xeddf,0xc0da,0xb4e8,0xb46b,0xb46c,0xb46d,0xb46e, -0xc5cd,0xb46f,0xb470,0xb471,0xeddd,0xbfc4,0xb472,0xb473, -0xb474,0xedde,0xb475,0xb476,0xb477,0xb478,0xb479,0xb47a, -0xb47b,0xb47c,0xb47d,0xb47e,0xb480,0xb481,0xb482,0xb483, -0xc4a5,0xb484,0xb485,0xb486,0xede0,0xb487,0xb488,0xb489, -0xb48a,0xb48b,0xede1,0xb48c,0xede3,0xb48d,0xb48e,0xc1d7, -0xb48f,0xb490,0xbbc7,0xb491,0xb492,0xb493,0xb494,0xb495, -0xb496,0xbdb8,0xb497,0xb498,0xb499,0xede2,0xb49a,0xb49b, -0xb49c,0xb49d,0xb49e,0xb49f,0xb4a0,0xb540,0xb541,0xb542, -0xb543,0xb544,0xb545,0xede4,0xb546,0xb547,0xb548,0xb549, -0xb54a,0xb54b,0xb54c,0xb54d,0xb54e,0xb54f,0xede6,0xb550, -0xb551,0xb552,0xb553,0xb554,0xede5,0xb555,0xb556,0xb557, -0xb558,0xb559,0xb55a,0xb55b,0xb55c,0xb55d,0xb55e,0xb55f, -0xb560,0xb561,0xb562,0xb563,0xede7,0xb564,0xb565,0xb566, -0xb567,0xb568,0xcabe,0xecea,0xc0f1,0xb569,0xc9e7,0xb56a, -0xeceb,0xc6ee,0xb56b,0xb56c,0xb56d,0xb56e,0xecec,0xb56f, -0xc6ed,0xeced,0xb570,0xb571,0xb572,0xb573,0xb574,0xb575, -0xb576,0xb577,0xb578,0xecf0,0xb579,0xb57a,0xd7e6,0xecf3, -0xb57b,0xb57c,0xecf1,0xecee,0xecef,0xd7a3,0xc9f1,0xcbee, -0xecf4,0xb57d,0xecf2,0xb57e,0xb580,0xcfe9,0xb581,0xecf6, -0xc6b1,0xb582,0xb583,0xb584,0xb585,0xbcc0,0xb586,0xecf5, -0xb587,0xb588,0xb589,0xb58a,0xb58b,0xb58c,0xb58d,0xb5bb, -0xbbf6,0xb58e,0xecf7,0xb58f,0xb590,0xb591,0xb592,0xb593, -0xd9f7,0xbdfb,0xb594,0xb595,0xc2bb,0xecf8,0xb596,0xb597, -0xb598,0xb599,0xecf9,0xb59a,0xb59b,0xb59c,0xb59d,0xb8a3, -0xb59e,0xb59f,0xb5a0,0xb640,0xb641,0xb642,0xb643,0xb644, -0xb645,0xb646,0xecfa,0xb647,0xb648,0xb649,0xb64a,0xb64b, -0xb64c,0xb64d,0xb64e,0xb64f,0xb650,0xb651,0xb652,0xecfb, -0xb653,0xb654,0xb655,0xb656,0xb657,0xb658,0xb659,0xb65a, -0xb65b,0xb65c,0xb65d,0xecfc,0xb65e,0xb65f,0xb660,0xb661, -0xb662,0xd3ed,0xd8ae,0xc0eb,0xb663,0xc7dd,0xbacc,0xb664, -0xd0e3,0xcbbd,0xb665,0xcdba,0xb666,0xb667,0xb8d1,0xb668, -0xb669,0xb1fc,0xb66a,0xc7ef,0xb66b,0xd6d6,0xb66c,0xb66d, -0xb66e,0xbfc6,0xc3eb,0xb66f,0xb670,0xeff5,0xb671,0xb672, -0xc3d8,0xb673,0xb674,0xb675,0xb676,0xb677,0xb678,0xd7e2, -0xb679,0xb67a,0xb67b,0xeff7,0xb3d3,0xb67c,0xc7d8,0xd1ed, -0xb67d,0xd6c8,0xb67e,0xeff8,0xb680,0xeff6,0xb681,0xbbfd, -0xb3c6,0xb682,0xb683,0xb684,0xb685,0xb686,0xb687,0xb688, -0xbdd5,0xb689,0xb68a,0xd2c6,0xb68b,0xbbe0,0xb68c,0xb68d, -0xcfa1,0xb68e,0xeffc,0xeffb,0xb68f,0xb690,0xeff9,0xb691, -0xb692,0xb693,0xb694,0xb3cc,0xb695,0xc9d4,0xcbb0,0xb696, -0xb697,0xb698,0xb699,0xb69a,0xeffe,0xb69b,0xb69c,0xb0de, -0xb69d,0xb69e,0xd6c9,0xb69f,0xb6a0,0xb740,0xeffd,0xb741, -0xb3ed,0xb742,0xb743,0xf6d5,0xb744,0xb745,0xb746,0xb747, -0xb748,0xb749,0xb74a,0xb74b,0xb74c,0xb74d,0xb74e,0xb74f, -0xb750,0xb751,0xb752,0xcec8,0xb753,0xb754,0xb755,0xf0a2, -0xb756,0xf0a1,0xb757,0xb5be,0xbcda,0xbbfc,0xb758,0xb8e5, -0xb759,0xb75a,0xb75b,0xb75c,0xb75d,0xb75e,0xc4c2,0xb75f, -0xb760,0xb761,0xb762,0xb763,0xb764,0xb765,0xb766,0xb767, -0xb768,0xf0a3,0xb769,0xb76a,0xb76b,0xb76c,0xb76d,0xcbeb, -0xb76e,0xb76f,0xb770,0xb771,0xb772,0xb773,0xb774,0xb775, -0xb776,0xb777,0xb778,0xb779,0xb77a,0xb77b,0xb77c,0xb77d, -0xb77e,0xb780,0xb781,0xb782,0xb783,0xb784,0xb785,0xb786, -0xf0a6,0xb787,0xb788,0xb789,0xd1a8,0xb78a,0xbebf,0xc7ee, -0xf1b6,0xf1b7,0xbfd5,0xb78b,0xb78c,0xb78d,0xb78e,0xb4a9, -0xf1b8,0xcdbb,0xb78f,0xc7d4,0xd5ad,0xb790,0xf1b9,0xb791, -0xf1ba,0xb792,0xb793,0xb794,0xb795,0xc7cf,0xb796,0xb797, -0xb798,0xd2a4,0xd6cf,0xb799,0xb79a,0xf1bb,0xbdd1,0xb4b0, -0xbebd,0xb79b,0xb79c,0xb79d,0xb4dc,0xced1,0xb79e,0xbfdf, -0xf1bd,0xb79f,0xb7a0,0xb840,0xb841,0xbffa,0xf1bc,0xb842, -0xf1bf,0xb843,0xb844,0xb845,0xf1be,0xf1c0,0xb846,0xb847, -0xb848,0xb849,0xb84a,0xf1c1,0xb84b,0xb84c,0xb84d,0xb84e, -0xb84f,0xb850,0xb851,0xb852,0xb853,0xb854,0xb855,0xc1fe, -0xb856,0xb857,0xb858,0xb859,0xb85a,0xb85b,0xb85c,0xb85d, -0xb85e,0xb85f,0xb860,0xc1a2,0xb861,0xb862,0xb863,0xb864, -0xb865,0xb866,0xb867,0xb868,0xb869,0xb86a,0xcafa,0xb86b, -0xb86c,0xd5be,0xb86d,0xb86e,0xb86f,0xb870,0xbeba,0xbeb9, -0xd5c2,0xb871,0xb872,0xbfa2,0xb873,0xcdaf,0xf1b5,0xb874, -0xb875,0xb876,0xb877,0xb878,0xb879,0xbddf,0xb87a,0xb6cb, -0xb87b,0xb87c,0xb87d,0xb87e,0xb880,0xb881,0xb882,0xb883, -0xb884,0xd6f1,0xf3c3,0xb885,0xb886,0xf3c4,0xb887,0xb8cd, -0xb888,0xb889,0xb88a,0xf3c6,0xf3c7,0xb88b,0xb0ca,0xb88c, -0xf3c5,0xb88d,0xf3c9,0xcbf1,0xb88e,0xb88f,0xb890,0xf3cb, -0xb891,0xd0a6,0xb892,0xb893,0xb1ca,0xf3c8,0xb894,0xb895, -0xb896,0xf3cf,0xb897,0xb5d1,0xb898,0xb899,0xf3d7,0xb89a, -0xf3d2,0xb89b,0xb89c,0xb89d,0xf3d4,0xf3d3,0xb7fb,0xb89e, -0xb1bf,0xb89f,0xf3ce,0xf3ca,0xb5da,0xb8a0,0xf3d0,0xb940, -0xb941,0xf3d1,0xb942,0xf3d5,0xb943,0xb944,0xb945,0xb946, -0xf3cd,0xb947,0xbce3,0xb948,0xc1fd,0xb949,0xf3d6,0xb94a, -0xb94b,0xb94c,0xb94d,0xb94e,0xb94f,0xf3da,0xb950,0xf3cc, -0xb951,0xb5c8,0xb952,0xbdee,0xf3dc,0xb953,0xb954,0xb7a4, -0xbff0,0xd6fe,0xcdb2,0xb955,0xb4f0,0xb956,0xb2df,0xb957, -0xf3d8,0xb958,0xf3d9,0xc9b8,0xb959,0xf3dd,0xb95a,0xb95b, -0xf3de,0xb95c,0xf3e1,0xb95d,0xb95e,0xb95f,0xb960,0xb961, -0xb962,0xb963,0xb964,0xb965,0xb966,0xb967,0xf3df,0xb968, -0xb969,0xf3e3,0xf3e2,0xb96a,0xb96b,0xf3db,0xb96c,0xbfea, -0xb96d,0xb3ef,0xb96e,0xf3e0,0xb96f,0xb970,0xc7a9,0xb971, -0xbcf2,0xb972,0xb973,0xb974,0xb975,0xf3eb,0xb976,0xb977, -0xb978,0xb979,0xb97a,0xb97b,0xb97c,0xb9bf,0xb97d,0xb97e, -0xf3e4,0xb980,0xb981,0xb982,0xb2ad,0xbbfe,0xb983,0xcbe3, -0xb984,0xb985,0xb986,0xb987,0xf3ed,0xf3e9,0xb988,0xb989, -0xb98a,0xb9dc,0xf3ee,0xb98b,0xb98c,0xb98d,0xf3e5,0xf3e6, -0xf3ea,0xc2e1,0xf3ec,0xf3ef,0xf3e8,0xbcfd,0xb98e,0xb98f, -0xb990,0xcfe4,0xb991,0xb992,0xf3f0,0xb993,0xb994,0xb995, -0xf3e7,0xb996,0xb997,0xb998,0xb999,0xb99a,0xb99b,0xb99c, -0xb99d,0xf3f2,0xb99e,0xb99f,0xb9a0,0xba40,0xd7ad,0xc6aa, -0xba41,0xba42,0xba43,0xba44,0xf3f3,0xba45,0xba46,0xba47, -0xba48,0xf3f1,0xba49,0xc2a8,0xba4a,0xba4b,0xba4c,0xba4d, -0xba4e,0xb8dd,0xf3f5,0xba4f,0xba50,0xf3f4,0xba51,0xba52, -0xba53,0xb4db,0xba54,0xba55,0xba56,0xf3f6,0xf3f7,0xba57, -0xba58,0xba59,0xf3f8,0xba5a,0xba5b,0xba5c,0xc0ba,0xba5d, -0xba5e,0xc0e9,0xba5f,0xba60,0xba61,0xba62,0xba63,0xc5f1, -0xba64,0xba65,0xba66,0xba67,0xf3fb,0xba68,0xf3fa,0xba69, -0xba6a,0xba6b,0xba6c,0xba6d,0xba6e,0xba6f,0xba70,0xb4d8, -0xba71,0xba72,0xba73,0xf3fe,0xf3f9,0xba74,0xba75,0xf3fc, -0xba76,0xba77,0xba78,0xba79,0xba7a,0xba7b,0xf3fd,0xba7c, -0xba7d,0xba7e,0xba80,0xba81,0xba82,0xba83,0xba84,0xf4a1, -0xba85,0xba86,0xba87,0xba88,0xba89,0xba8a,0xf4a3,0xbbc9, -0xba8b,0xba8c,0xf4a2,0xba8d,0xba8e,0xba8f,0xba90,0xba91, -0xba92,0xba93,0xba94,0xba95,0xba96,0xba97,0xba98,0xba99, -0xf4a4,0xba9a,0xba9b,0xba9c,0xba9d,0xba9e,0xba9f,0xb2be, -0xf4a6,0xf4a5,0xbaa0,0xbb40,0xbb41,0xbb42,0xbb43,0xbb44, -0xbb45,0xbb46,0xbb47,0xbb48,0xbb49,0xbcae,0xbb4a,0xbb4b, -0xbb4c,0xbb4d,0xbb4e,0xbb4f,0xbb50,0xbb51,0xbb52,0xbb53, -0xbb54,0xbb55,0xbb56,0xbb57,0xbb58,0xbb59,0xbb5a,0xbb5b, -0xbb5c,0xbb5d,0xbb5e,0xbb5f,0xbb60,0xbb61,0xbb62,0xbb63, -0xbb64,0xbb65,0xbb66,0xbb67,0xbb68,0xbb69,0xbb6a,0xbb6b, -0xbb6c,0xbb6d,0xbb6e,0xc3d7,0xd9e1,0xbb6f,0xbb70,0xbb71, -0xbb72,0xbb73,0xbb74,0xc0e0,0xf4cc,0xd7d1,0xbb75,0xbb76, -0xbb77,0xbb78,0xbb79,0xbb7a,0xbb7b,0xbb7c,0xbb7d,0xbb7e, -0xbb80,0xb7db,0xbb81,0xbb82,0xbb83,0xbb84,0xbb85,0xbb86, -0xbb87,0xf4ce,0xc1a3,0xbb88,0xbb89,0xc6c9,0xbb8a,0xb4d6, -0xd5b3,0xbb8b,0xbb8c,0xbb8d,0xf4d0,0xf4cf,0xf4d1,0xcbda, -0xbb8e,0xbb8f,0xf4d2,0xbb90,0xd4c1,0xd6e0,0xbb91,0xbb92, -0xbb93,0xbb94,0xb7e0,0xbb95,0xbb96,0xbb97,0xc1b8,0xbb98, -0xbb99,0xc1bb,0xf4d3,0xbeac,0xbb9a,0xbb9b,0xbb9c,0xbb9d, -0xbb9e,0xb4e2,0xbb9f,0xbba0,0xf4d4,0xf4d5,0xbeab,0xbc40, -0xbc41,0xf4d6,0xbc42,0xbc43,0xbc44,0xf4db,0xbc45,0xf4d7, -0xf4da,0xbc46,0xbafd,0xbc47,0xf4d8,0xf4d9,0xbc48,0xbc49, -0xbc4a,0xbc4b,0xbc4c,0xbc4d,0xbc4e,0xb8e2,0xccc7,0xf4dc, -0xbc4f,0xb2da,0xbc50,0xbc51,0xc3d3,0xbc52,0xbc53,0xd4e3, -0xbfb7,0xbc54,0xbc55,0xbc56,0xbc57,0xbc58,0xbc59,0xbc5a, -0xf4dd,0xbc5b,0xbc5c,0xbc5d,0xbc5e,0xbc5f,0xbc60,0xc5b4, -0xbc61,0xbc62,0xbc63,0xbc64,0xbc65,0xbc66,0xbc67,0xbc68, -0xf4e9,0xbc69,0xbc6a,0xcfb5,0xbc6b,0xbc6c,0xbc6d,0xbc6e, -0xbc6f,0xbc70,0xbc71,0xbc72,0xbc73,0xbc74,0xbc75,0xbc76, -0xbc77,0xbc78,0xcec9,0xbc79,0xbc7a,0xbc7b,0xbc7c,0xbc7d, -0xbc7e,0xbc80,0xbc81,0xbc82,0xbc83,0xbc84,0xbc85,0xbc86, -0xbc87,0xbc88,0xbc89,0xbc8a,0xbc8b,0xbc8c,0xbc8d,0xbc8e, -0xcbd8,0xbc8f,0xcbf7,0xbc90,0xbc91,0xbc92,0xbc93,0xbdf4, -0xbc94,0xbc95,0xbc96,0xd7cf,0xbc97,0xbc98,0xbc99,0xc0db, -0xbc9a,0xbc9b,0xbc9c,0xbc9d,0xbc9e,0xbc9f,0xbca0,0xbd40, -0xbd41,0xbd42,0xbd43,0xbd44,0xbd45,0xbd46,0xbd47,0xbd48, -0xbd49,0xbd4a,0xbd4b,0xbd4c,0xbd4d,0xbd4e,0xbd4f,0xbd50, -0xbd51,0xbd52,0xbd53,0xbd54,0xbd55,0xbd56,0xbd57,0xbd58, -0xbd59,0xbd5a,0xbd5b,0xbd5c,0xbd5d,0xbd5e,0xbd5f,0xbd60, -0xbd61,0xbd62,0xbd63,0xbd64,0xbd65,0xbd66,0xbd67,0xbd68, -0xbd69,0xbd6a,0xbd6b,0xbd6c,0xbd6d,0xbd6e,0xbd6f,0xbd70, -0xbd71,0xbd72,0xbd73,0xbd74,0xbd75,0xbd76,0xd0f5,0xbd77, -0xbd78,0xbd79,0xbd7a,0xbd7b,0xbd7c,0xbd7d,0xbd7e,0xf4ea, -0xbd80,0xbd81,0xbd82,0xbd83,0xbd84,0xbd85,0xbd86,0xbd87, -0xbd88,0xbd89,0xbd8a,0xbd8b,0xbd8c,0xbd8d,0xbd8e,0xbd8f, -0xbd90,0xbd91,0xbd92,0xbd93,0xbd94,0xbd95,0xbd96,0xbd97, -0xbd98,0xbd99,0xbd9a,0xbd9b,0xbd9c,0xbd9d,0xbd9e,0xbd9f, -0xbda0,0xbe40,0xbe41,0xbe42,0xbe43,0xbe44,0xbe45,0xbe46, -0xbe47,0xbe48,0xbe49,0xbe4a,0xbe4b,0xbe4c,0xf4eb,0xbe4d, -0xbe4e,0xbe4f,0xbe50,0xbe51,0xbe52,0xbe53,0xf4ec,0xbe54, -0xbe55,0xbe56,0xbe57,0xbe58,0xbe59,0xbe5a,0xbe5b,0xbe5c, -0xbe5d,0xbe5e,0xbe5f,0xbe60,0xbe61,0xbe62,0xbe63,0xbe64, -0xbe65,0xbe66,0xbe67,0xbe68,0xbe69,0xbe6a,0xbe6b,0xbe6c, -0xbe6d,0xbe6e,0xbe6f,0xbe70,0xbe71,0xbe72,0xbe73,0xbe74, -0xbe75,0xbe76,0xbe77,0xbe78,0xbe79,0xbe7a,0xbe7b,0xbe7c, -0xbe7d,0xbe7e,0xbe80,0xbe81,0xbe82,0xbe83,0xbe84,0xbe85, -0xbe86,0xbe87,0xbe88,0xbe89,0xbe8a,0xbe8b,0xbe8c,0xbe8d, -0xbe8e,0xbe8f,0xbe90,0xbe91,0xbe92,0xbe93,0xbe94,0xbe95, -0xbe96,0xbe97,0xbe98,0xbe99,0xbe9a,0xbe9b,0xbe9c,0xbe9d, -0xbe9e,0xbe9f,0xbea0,0xbf40,0xbf41,0xbf42,0xbf43,0xbf44, -0xbf45,0xbf46,0xbf47,0xbf48,0xbf49,0xbf4a,0xbf4b,0xbf4c, -0xbf4d,0xbf4e,0xbf4f,0xbf50,0xbf51,0xbf52,0xbf53,0xbf54, -0xbf55,0xbf56,0xbf57,0xbf58,0xbf59,0xbf5a,0xbf5b,0xbf5c, -0xbf5d,0xbf5e,0xbf5f,0xbf60,0xbf61,0xbf62,0xbf63,0xbf64, -0xbf65,0xbf66,0xbf67,0xbf68,0xbf69,0xbf6a,0xbf6b,0xbf6c, -0xbf6d,0xbf6e,0xbf6f,0xbf70,0xbf71,0xbf72,0xbf73,0xbf74, -0xbf75,0xbf76,0xbf77,0xbf78,0xbf79,0xbf7a,0xbf7b,0xbf7c, -0xbf7d,0xbf7e,0xbf80,0xf7e3,0xbf81,0xbf82,0xbf83,0xbf84, -0xbf85,0xb7b1,0xbf86,0xbf87,0xbf88,0xbf89,0xbf8a,0xf4ed, -0xbf8b,0xbf8c,0xbf8d,0xbf8e,0xbf8f,0xbf90,0xbf91,0xbf92, -0xbf93,0xbf94,0xbf95,0xbf96,0xbf97,0xbf98,0xbf99,0xbf9a, -0xbf9b,0xbf9c,0xbf9d,0xbf9e,0xbf9f,0xbfa0,0xc040,0xc041, -0xc042,0xc043,0xc044,0xc045,0xc046,0xc047,0xc048,0xc049, -0xc04a,0xc04b,0xc04c,0xc04d,0xc04e,0xc04f,0xc050,0xc051, -0xc052,0xc053,0xc054,0xc055,0xc056,0xc057,0xc058,0xc059, -0xc05a,0xc05b,0xc05c,0xc05d,0xc05e,0xc05f,0xc060,0xc061, -0xc062,0xc063,0xd7eb,0xc064,0xc065,0xc066,0xc067,0xc068, -0xc069,0xc06a,0xc06b,0xc06c,0xc06d,0xc06e,0xc06f,0xc070, -0xc071,0xc072,0xc073,0xc074,0xc075,0xc076,0xc077,0xc078, -0xc079,0xc07a,0xc07b,0xf4ee,0xc07c,0xc07d,0xc07e,0xe6f9, -0xbec0,0xe6fa,0xbaec,0xe6fb,0xcfcb,0xe6fc,0xd4bc,0xbcb6, -0xe6fd,0xe6fe,0xbccd,0xc8d2,0xceb3,0xe7a1,0xc080,0xb4bf, -0xe7a2,0xc9b4,0xb8d9,0xc4c9,0xc081,0xd7dd,0xc2da,0xb7d7, -0xd6bd,0xcec6,0xb7c4,0xc082,0xc083,0xc5a6,0xe7a3,0xcfdf, -0xe7a4,0xe7a5,0xe7a6,0xc1b7,0xd7e9,0xc9f0,0xcfb8,0xd6af, -0xd6d5,0xe7a7,0xb0ed,0xe7a8,0xe7a9,0xc9dc,0xd2ef,0xbead, -0xe7aa,0xb0f3,0xc8de,0xbde1,0xe7ab,0xc8c6,0xc084,0xe7ac, -0xbbe6,0xb8f8,0xd1a4,0xe7ad,0xc2e7,0xbef8,0xbdca,0xcdb3, -0xe7ae,0xe7af,0xbeee,0xd0e5,0xc085,0xcbe7,0xccd0,0xbccc, -0xe7b0,0xbca8,0xd0f7,0xe7b1,0xc086,0xd0f8,0xe7b2,0xe7b3, -0xb4c2,0xe7b4,0xe7b5,0xc9fe,0xceac,0xc3e0,0xe7b7,0xb1c1, -0xb3f1,0xc087,0xe7b8,0xe7b9,0xd7db,0xd5c0,0xe7ba,0xc2cc, -0xd7ba,0xe7bb,0xe7bc,0xe7bd,0xbcea,0xc3e5,0xc0c2,0xe7be, -0xe7bf,0xbca9,0xc088,0xe7c0,0xe7c1,0xe7b6,0xb6d0,0xe7c2, -0xc089,0xe7c3,0xe7c4,0xbbba,0xb5de,0xc2c6,0xb1e0,0xe7c5, -0xd4b5,0xe7c6,0xb8bf,0xe7c8,0xe7c7,0xb7ec,0xc08a,0xe7c9, -0xb2f8,0xe7ca,0xe7cb,0xe7cc,0xe7cd,0xe7ce,0xe7cf,0xe7d0, -0xd3a7,0xcbf5,0xe7d1,0xe7d2,0xe7d3,0xe7d4,0xc9c9,0xe7d5, -0xe7d6,0xe7d7,0xe7d8,0xe7d9,0xbdc9,0xe7da,0xf3be,0xc08b, -0xb8d7,0xc08c,0xc8b1,0xc08d,0xc08e,0xc08f,0xc090,0xc091, -0xc092,0xc093,0xf3bf,0xc094,0xf3c0,0xf3c1,0xc095,0xc096, -0xc097,0xc098,0xc099,0xc09a,0xc09b,0xc09c,0xc09d,0xc09e, -0xb9de,0xcdf8,0xc09f,0xc0a0,0xd8e8,0xbab1,0xc140,0xc2de, -0xeeb7,0xc141,0xb7a3,0xc142,0xc143,0xc144,0xc145,0xeeb9, -0xc146,0xeeb8,0xb0d5,0xc147,0xc148,0xc149,0xc14a,0xc14b, -0xeebb,0xd5d6,0xd7ef,0xc14c,0xc14d,0xc14e,0xd6c3,0xc14f, -0xc150,0xeebd,0xcaf0,0xc151,0xeebc,0xc152,0xc153,0xc154, -0xc155,0xeebe,0xc156,0xc157,0xc158,0xc159,0xeec0,0xc15a, -0xc15b,0xeebf,0xc15c,0xc15d,0xc15e,0xc15f,0xc160,0xc161, -0xc162,0xc163,0xd1f2,0xc164,0xc7bc,0xc165,0xc3c0,0xc166, -0xc167,0xc168,0xc169,0xc16a,0xb8e1,0xc16b,0xc16c,0xc16d, -0xc16e,0xc16f,0xc1e7,0xc170,0xc171,0xf4c6,0xd0df,0xf4c7, -0xc172,0xcfdb,0xc173,0xc174,0xc8ba,0xc175,0xc176,0xf4c8, -0xc177,0xc178,0xc179,0xc17a,0xc17b,0xc17c,0xc17d,0xf4c9, -0xf4ca,0xc17e,0xf4cb,0xc180,0xc181,0xc182,0xc183,0xc184, -0xd9fa,0xb8fe,0xc185,0xc186,0xe5f1,0xd3f0,0xc187,0xf4e0, -0xc188,0xcecc,0xc189,0xc18a,0xc18b,0xb3e1,0xc18c,0xc18d, -0xc18e,0xc18f,0xf1b4,0xc190,0xd2ee,0xc191,0xf4e1,0xc192, -0xc193,0xc194,0xc195,0xc196,0xcfe8,0xf4e2,0xc197,0xc198, -0xc7cc,0xc199,0xc19a,0xc19b,0xc19c,0xc19d,0xc19e,0xb5d4, -0xb4e4,0xf4e4,0xc19f,0xc1a0,0xc240,0xf4e3,0xf4e5,0xc241, -0xc242,0xf4e6,0xc243,0xc244,0xc245,0xc246,0xf4e7,0xc247, -0xbab2,0xb0bf,0xc248,0xf4e8,0xc249,0xc24a,0xc24b,0xc24c, -0xc24d,0xc24e,0xc24f,0xb7ad,0xd2ed,0xc250,0xc251,0xc252, -0xd2ab,0xc0cf,0xc253,0xbfbc,0xeba3,0xd5df,0xeac8,0xc254, -0xc255,0xc256,0xc257,0xf1f3,0xb6f8,0xcba3,0xc258,0xc259, -0xc4cd,0xc25a,0xf1e7,0xc25b,0xf1e8,0xb8fb,0xf1e9,0xbac4, -0xd4c5,0xb0d2,0xc25c,0xc25d,0xf1ea,0xc25e,0xc25f,0xc260, -0xf1eb,0xc261,0xf1ec,0xc262,0xc263,0xf1ed,0xf1ee,0xf1ef, -0xf1f1,0xf1f0,0xc5d5,0xc264,0xc265,0xc266,0xc267,0xc268, -0xc269,0xf1f2,0xc26a,0xb6fa,0xc26b,0xf1f4,0xd2ae,0xdec7, -0xcbca,0xc26c,0xc26d,0xb3dc,0xc26e,0xb5a2,0xc26f,0xb9a2, -0xc270,0xc271,0xc4f4,0xf1f5,0xc272,0xc273,0xf1f6,0xc274, -0xc275,0xc276,0xc1c4,0xc1fb,0xd6b0,0xf1f7,0xc277,0xc278, -0xc279,0xc27a,0xf1f8,0xc27b,0xc1aa,0xc27c,0xc27d,0xc27e, -0xc6b8,0xc280,0xbedb,0xc281,0xc282,0xc283,0xc284,0xc285, -0xc286,0xc287,0xc288,0xc289,0xc28a,0xc28b,0xc28c,0xc28d, -0xc28e,0xf1f9,0xb4cf,0xc28f,0xc290,0xc291,0xc292,0xc293, -0xc294,0xf1fa,0xc295,0xc296,0xc297,0xc298,0xc299,0xc29a, -0xc29b,0xc29c,0xc29d,0xc29e,0xc29f,0xc2a0,0xc340,0xedb2, -0xedb1,0xc341,0xc342,0xcbe0,0xd2de,0xc343,0xcbc1,0xd5d8, -0xc344,0xc8e2,0xc345,0xc0df,0xbca1,0xc346,0xc347,0xc348, -0xc349,0xc34a,0xc34b,0xebc1,0xc34c,0xc34d,0xd0a4,0xc34e, -0xd6e2,0xc34f,0xb6c7,0xb8d8,0xebc0,0xb8ce,0xc350,0xebbf, -0xb3a6,0xb9c9,0xd6ab,0xc351,0xb7f4,0xb7ca,0xc352,0xc353, -0xc354,0xbce7,0xb7be,0xebc6,0xc355,0xebc7,0xb0b9,0xbfcf, -0xc356,0xebc5,0xd3fd,0xc357,0xebc8,0xc358,0xc359,0xebc9, -0xc35a,0xc35b,0xb7ce,0xc35c,0xebc2,0xebc4,0xc9f6,0xd6d7, -0xd5cd,0xd0b2,0xebcf,0xceb8,0xebd0,0xc35d,0xb5a8,0xc35e, -0xc35f,0xc360,0xc361,0xc362,0xb1b3,0xebd2,0xcca5,0xc363, -0xc364,0xc365,0xc366,0xc367,0xc368,0xc369,0xc5d6,0xebd3, -0xc36a,0xebd1,0xc5df,0xebce,0xcaa4,0xebd5,0xb0fb,0xc36b, -0xc36c,0xbafa,0xc36d,0xc36e,0xd8b7,0xf1e3,0xc36f,0xebca, -0xebcb,0xebcc,0xebcd,0xebd6,0xe6c0,0xebd9,0xc370,0xbfe8, -0xd2c8,0xebd7,0xebdc,0xb8ec,0xebd8,0xc371,0xbdba,0xc372, -0xd0d8,0xc373,0xb0b7,0xc374,0xebdd,0xc4dc,0xc375,0xc376, -0xc377,0xc378,0xd6ac,0xc379,0xc37a,0xc37b,0xb4e0,0xc37c, -0xc37d,0xc2f6,0xbcb9,0xc37e,0xc380,0xebda,0xebdb,0xd4e0, -0xc6ea,0xc4d4,0xebdf,0xc5a7,0xd9f5,0xc381,0xb2b1,0xc382, -0xebe4,0xc383,0xbdc5,0xc384,0xc385,0xc386,0xebe2,0xc387, -0xc388,0xc389,0xc38a,0xc38b,0xc38c,0xc38d,0xc38e,0xc38f, -0xc390,0xc391,0xc392,0xc393,0xebe3,0xc394,0xc395,0xb8ac, -0xc396,0xcdd1,0xebe5,0xc397,0xc398,0xc399,0xebe1,0xc39a, -0xc1b3,0xc39b,0xc39c,0xc39d,0xc39e,0xc39f,0xc6a2,0xc3a0, -0xc440,0xc441,0xc442,0xc443,0xc444,0xc445,0xccf3,0xc446, -0xebe6,0xc447,0xc0b0,0xd2b8,0xebe7,0xc448,0xc449,0xc44a, -0xb8af,0xb8ad,0xc44b,0xebe8,0xc7bb,0xcdf3,0xc44c,0xc44d, -0xc44e,0xebea,0xebeb,0xc44f,0xc450,0xc451,0xc452,0xc453, -0xebed,0xc454,0xc455,0xc456,0xc457,0xd0c8,0xc458,0xebf2, -0xc459,0xebee,0xc45a,0xc45b,0xc45c,0xebf1,0xc8f9,0xc45d, -0xd1fc,0xebec,0xc45e,0xc45f,0xebe9,0xc460,0xc461,0xc462, -0xc463,0xb8b9,0xcfd9,0xc4e5,0xebef,0xebf0,0xccda,0xcdc8, -0xb0f2,0xc464,0xebf6,0xc465,0xc466,0xc467,0xc468,0xc469, -0xebf5,0xc46a,0xb2b2,0xc46b,0xc46c,0xc46d,0xc46e,0xb8e0, -0xc46f,0xebf7,0xc470,0xc471,0xc472,0xc473,0xc474,0xc475, -0xb1ec,0xc476,0xc477,0xccc5,0xc4a4,0xcfa5,0xc478,0xc479, -0xc47a,0xc47b,0xc47c,0xebf9,0xc47d,0xc47e,0xeca2,0xc480, -0xc5f2,0xc481,0xebfa,0xc482,0xc483,0xc484,0xc485,0xc486, -0xc487,0xc488,0xc489,0xc9c5,0xc48a,0xc48b,0xc48c,0xc48d, -0xc48e,0xc48f,0xe2df,0xebfe,0xc490,0xc491,0xc492,0xc493, -0xcdce,0xeca1,0xb1db,0xd3b7,0xc494,0xc495,0xd2dc,0xc496, -0xc497,0xc498,0xebfd,0xc499,0xebfb,0xc49a,0xc49b,0xc49c, -0xc49d,0xc49e,0xc49f,0xc4a0,0xc540,0xc541,0xc542,0xc543, -0xc544,0xc545,0xc546,0xc547,0xc548,0xc549,0xc54a,0xc54b, -0xc54c,0xc54d,0xc54e,0xb3bc,0xc54f,0xc550,0xc551,0xeab0, -0xc552,0xc553,0xd7d4,0xc554,0xf4ab,0xb3f4,0xc555,0xc556, -0xc557,0xc558,0xc559,0xd6c1,0xd6c2,0xc55a,0xc55b,0xc55c, -0xc55d,0xc55e,0xc55f,0xd5e9,0xbeca,0xc560,0xf4a7,0xc561, -0xd2a8,0xf4a8,0xf4a9,0xc562,0xf4aa,0xbecb,0xd3df,0xc563, -0xc564,0xc565,0xc566,0xc567,0xc9e0,0xc9e1,0xc568,0xc569, -0xf3c2,0xc56a,0xcae6,0xc56b,0xccf2,0xc56c,0xc56d,0xc56e, -0xc56f,0xc570,0xc571,0xe2b6,0xcbb4,0xc572,0xcee8,0xd6db, -0xc573,0xf4ad,0xf4ae,0xf4af,0xc574,0xc575,0xc576,0xc577, -0xf4b2,0xc578,0xbabd,0xf4b3,0xb0e3,0xf4b0,0xc579,0xf4b1, -0xbda2,0xb2d5,0xc57a,0xf4b6,0xf4b7,0xb6e6,0xb2b0,0xcfcf, -0xf4b4,0xb4ac,0xc57b,0xf4b5,0xc57c,0xc57d,0xf4b8,0xc57e, -0xc580,0xc581,0xc582,0xc583,0xf4b9,0xc584,0xc585,0xcda7, -0xc586,0xf4ba,0xc587,0xf4bb,0xc588,0xc589,0xc58a,0xf4bc, -0xc58b,0xc58c,0xc58d,0xc58e,0xc58f,0xc590,0xc591,0xc592, -0xcbd2,0xc593,0xf4bd,0xc594,0xc595,0xc596,0xc597,0xf4be, -0xc598,0xc599,0xc59a,0xc59b,0xc59c,0xc59d,0xc59e,0xc59f, -0xf4bf,0xc5a0,0xc640,0xc641,0xc642,0xc643,0xf4de,0xc1bc, -0xbce8,0xc644,0xc9ab,0xd1de,0xe5f5,0xc645,0xc646,0xc647, -0xc648,0xdcb3,0xd2d5,0xc649,0xc64a,0xdcb4,0xb0ac,0xdcb5, -0xc64b,0xc64c,0xbdda,0xc64d,0xdcb9,0xc64e,0xc64f,0xc650, -0xd8c2,0xc651,0xdcb7,0xd3f3,0xc652,0xc9d6,0xdcba,0xdcb6, -0xc653,0xdcbb,0xc3a2,0xc654,0xc655,0xc656,0xc657,0xdcbc, -0xdcc5,0xdcbd,0xc658,0xc659,0xcedf,0xd6a5,0xc65a,0xdccf, -0xc65b,0xdccd,0xc65c,0xc65d,0xdcd2,0xbde6,0xc2ab,0xc65e, -0xdcb8,0xdccb,0xdcce,0xdcbe,0xb7d2,0xb0c5,0xdcc7,0xd0be, -0xdcc1,0xbba8,0xc65f,0xb7bc,0xdccc,0xc660,0xc661,0xdcc6, -0xdcbf,0xc7db,0xc662,0xc663,0xc664,0xd1bf,0xdcc0,0xc665, -0xc666,0xdcca,0xc667,0xc668,0xdcd0,0xc669,0xc66a,0xcead, -0xdcc2,0xc66b,0xdcc3,0xdcc8,0xdcc9,0xb2d4,0xdcd1,0xcbd5, -0xc66c,0xd4b7,0xdcdb,0xdcdf,0xcca6,0xdce6,0xc66d,0xc3e7, -0xdcdc,0xc66e,0xc66f,0xbfc1,0xdcd9,0xc670,0xb0fa,0xb9b6, -0xdce5,0xdcd3,0xc671,0xdcc4,0xdcd6,0xc8f4,0xbfe0,0xc672, -0xc673,0xc674,0xc675,0xc9bb,0xc676,0xc677,0xc678,0xb1bd, -0xc679,0xd3a2,0xc67a,0xc67b,0xdcda,0xc67c,0xc67d,0xdcd5, -0xc67e,0xc6bb,0xc680,0xdcde,0xc681,0xc682,0xc683,0xc684, -0xc685,0xd7c2,0xc3af,0xb7b6,0xc7d1,0xc3a9,0xdce2,0xdcd8, -0xdceb,0xdcd4,0xc686,0xc687,0xdcdd,0xc688,0xbea5,0xdcd7, -0xc689,0xdce0,0xc68a,0xc68b,0xdce3,0xdce4,0xc68c,0xdcf8, -0xc68d,0xc68e,0xdce1,0xdda2,0xdce7,0xc68f,0xc690,0xc691, -0xc692,0xc693,0xc694,0xc695,0xc696,0xc697,0xc698,0xbceb, -0xb4c4,0xc699,0xc69a,0xc3a3,0xb2e7,0xdcfa,0xc69b,0xdcf2, -0xc69c,0xdcef,0xc69d,0xdcfc,0xdcee,0xd2f0,0xb2e8,0xc69e, -0xc8d7,0xc8e3,0xdcfb,0xc69f,0xdced,0xc6a0,0xc740,0xc741, -0xdcf7,0xc742,0xc743,0xdcf5,0xc744,0xc745,0xbea3,0xdcf4, -0xc746,0xb2dd,0xc747,0xc748,0xc749,0xc74a,0xc74b,0xdcf3, -0xbcf6,0xdce8,0xbbc4,0xc74c,0xc0f3,0xc74d,0xc74e,0xc74f, -0xc750,0xc751,0xbcd4,0xdce9,0xdcea,0xc752,0xdcf1,0xdcf6, -0xdcf9,0xb5b4,0xc753,0xc8d9,0xbbe7,0xdcfe,0xdcfd,0xd3ab, -0xdda1,0xdda3,0xdda5,0xd2f1,0xdda4,0xdda6,0xdda7,0xd2a9, -0xc754,0xc755,0xc756,0xc757,0xc758,0xc759,0xc75a,0xbac9, -0xdda9,0xc75b,0xc75c,0xddb6,0xddb1,0xddb4,0xc75d,0xc75e, -0xc75f,0xc760,0xc761,0xc762,0xc763,0xddb0,0xc6ce,0xc764, -0xc765,0xc0f2,0xc766,0xc767,0xc768,0xc769,0xc9af,0xc76a, -0xc76b,0xc76c,0xdcec,0xddae,0xc76d,0xc76e,0xc76f,0xc770, -0xddb7,0xc771,0xc772,0xdcf0,0xddaf,0xc773,0xddb8,0xc774, -0xddac,0xc775,0xc776,0xc777,0xc778,0xc779,0xc77a,0xc77b, -0xddb9,0xddb3,0xddad,0xc4aa,0xc77c,0xc77d,0xc77e,0xc780, -0xdda8,0xc0b3,0xc1ab,0xddaa,0xddab,0xc781,0xddb2,0xbbf1, -0xddb5,0xd3a8,0xddba,0xc782,0xddbb,0xc3a7,0xc783,0xc784, -0xddd2,0xddbc,0xc785,0xc786,0xc787,0xddd1,0xc788,0xb9bd, -0xc789,0xc78a,0xbed5,0xc78b,0xbefa,0xc78c,0xc78d,0xbaca, -0xc78e,0xc78f,0xc790,0xc791,0xddca,0xc792,0xddc5,0xc793, -0xddbf,0xc794,0xc795,0xc796,0xb2cb,0xddc3,0xc797,0xddcb, -0xb2a4,0xddd5,0xc798,0xc799,0xc79a,0xddbe,0xc79b,0xc79c, -0xc79d,0xc6d0,0xddd0,0xc79e,0xc79f,0xc7a0,0xc840,0xc841, -0xddd4,0xc1e2,0xb7c6,0xc842,0xc843,0xc844,0xc845,0xc846, -0xddce,0xddcf,0xc847,0xc848,0xc849,0xddc4,0xc84a,0xc84b, -0xc84c,0xddbd,0xc84d,0xddcd,0xccd1,0xc84e,0xddc9,0xc84f, -0xc850,0xc851,0xc852,0xddc2,0xc3c8,0xc6bc,0xceae,0xddcc, -0xc853,0xddc8,0xc854,0xc855,0xc856,0xc857,0xc858,0xc859, -0xddc1,0xc85a,0xc85b,0xc85c,0xddc6,0xc2dc,0xc85d,0xc85e, -0xc85f,0xc860,0xc861,0xc862,0xd3a9,0xd3aa,0xddd3,0xcff4, -0xc8f8,0xc863,0xc864,0xc865,0xc866,0xc867,0xc868,0xc869, -0xc86a,0xdde6,0xc86b,0xc86c,0xc86d,0xc86e,0xc86f,0xc870, -0xddc7,0xc871,0xc872,0xc873,0xdde0,0xc2e4,0xc874,0xc875, -0xc876,0xc877,0xc878,0xc879,0xc87a,0xc87b,0xdde1,0xc87c, -0xc87d,0xc87e,0xc880,0xc881,0xc882,0xc883,0xc884,0xc885, -0xc886,0xddd7,0xc887,0xc888,0xc889,0xc88a,0xc88b,0xd6f8, -0xc88c,0xddd9,0xddd8,0xb8f0,0xddd6,0xc88d,0xc88e,0xc88f, -0xc890,0xc6cf,0xc891,0xb6ad,0xc892,0xc893,0xc894,0xc895, -0xc896,0xdde2,0xc897,0xbaf9,0xd4e1,0xdde7,0xc898,0xc899, -0xc89a,0xb4d0,0xc89b,0xddda,0xc89c,0xbffb,0xdde3,0xc89d, -0xdddf,0xc89e,0xdddd,0xc89f,0xc8a0,0xc940,0xc941,0xc942, -0xc943,0xc944,0xb5d9,0xc945,0xc946,0xc947,0xc948,0xdddb, -0xdddc,0xddde,0xc949,0xbdaf,0xdde4,0xc94a,0xdde5,0xc94b, -0xc94c,0xc94d,0xc94e,0xc94f,0xc950,0xc951,0xc952,0xddf5, -0xc953,0xc3c9,0xc954,0xc955,0xcbe2,0xc956,0xc957,0xc958, -0xc959,0xddf2,0xc95a,0xc95b,0xc95c,0xc95d,0xc95e,0xc95f, -0xc960,0xc961,0xc962,0xc963,0xc964,0xc965,0xc966,0xd8e1, -0xc967,0xc968,0xc6d1,0xc969,0xddf4,0xc96a,0xc96b,0xc96c, -0xd5f4,0xddf3,0xddf0,0xc96d,0xc96e,0xddec,0xc96f,0xddef, -0xc970,0xdde8,0xc971,0xc972,0xd0ee,0xc973,0xc974,0xc975, -0xc976,0xc8d8,0xddee,0xc977,0xc978,0xdde9,0xc979,0xc97a, -0xddea,0xcbf2,0xc97b,0xdded,0xc97c,0xc97d,0xb1cd,0xc97e, -0xc980,0xc981,0xc982,0xc983,0xc984,0xc0b6,0xc985,0xbcbb, -0xddf1,0xc986,0xc987,0xddf7,0xc988,0xddf6,0xddeb,0xc989, -0xc98a,0xc98b,0xc98c,0xc98d,0xc5ee,0xc98e,0xc98f,0xc990, -0xddfb,0xc991,0xc992,0xc993,0xc994,0xc995,0xc996,0xc997, -0xc998,0xc999,0xc99a,0xc99b,0xdea4,0xc99c,0xc99d,0xdea3, -0xc99e,0xc99f,0xc9a0,0xca40,0xca41,0xca42,0xca43,0xca44, -0xca45,0xca46,0xca47,0xca48,0xddf8,0xca49,0xca4a,0xca4b, -0xca4c,0xc3ef,0xca4d,0xc2fb,0xca4e,0xca4f,0xca50,0xd5e1, -0xca51,0xca52,0xceb5,0xca53,0xca54,0xca55,0xca56,0xddfd, -0xca57,0xb2cc,0xca58,0xca59,0xca5a,0xca5b,0xca5c,0xca5d, -0xca5e,0xca5f,0xca60,0xc4e8,0xcadf,0xca61,0xca62,0xca63, -0xca64,0xca65,0xca66,0xca67,0xca68,0xca69,0xca6a,0xc7be, -0xddfa,0xddfc,0xddfe,0xdea2,0xb0aa,0xb1ce,0xca6b,0xca6c, -0xca6d,0xca6e,0xca6f,0xdeac,0xca70,0xca71,0xca72,0xca73, -0xdea6,0xbdb6,0xc8ef,0xca74,0xca75,0xca76,0xca77,0xca78, -0xca79,0xca7a,0xca7b,0xca7c,0xca7d,0xca7e,0xdea1,0xca80, -0xca81,0xdea5,0xca82,0xca83,0xca84,0xca85,0xdea9,0xca86, -0xca87,0xca88,0xca89,0xca8a,0xdea8,0xca8b,0xca8c,0xca8d, -0xdea7,0xca8e,0xca8f,0xca90,0xca91,0xca92,0xca93,0xca94, -0xca95,0xca96,0xdead,0xca97,0xd4cc,0xca98,0xca99,0xca9a, -0xca9b,0xdeb3,0xdeaa,0xdeae,0xca9c,0xca9d,0xc0d9,0xca9e, -0xca9f,0xcaa0,0xcb40,0xcb41,0xb1a1,0xdeb6,0xcb42,0xdeb1, -0xcb43,0xcb44,0xcb45,0xcb46,0xcb47,0xcb48,0xcb49,0xdeb2, -0xcb4a,0xcb4b,0xcb4c,0xcb4d,0xcb4e,0xcb4f,0xcb50,0xcb51, -0xcb52,0xcb53,0xcb54,0xd1a6,0xdeb5,0xcb55,0xcb56,0xcb57, -0xcb58,0xcb59,0xcb5a,0xcb5b,0xdeaf,0xcb5c,0xcb5d,0xcb5e, -0xdeb0,0xcb5f,0xd0bd,0xcb60,0xcb61,0xcb62,0xdeb4,0xcaed, -0xdeb9,0xcb63,0xcb64,0xcb65,0xcb66,0xcb67,0xcb68,0xdeb8, -0xcb69,0xdeb7,0xcb6a,0xcb6b,0xcb6c,0xcb6d,0xcb6e,0xcb6f, -0xcb70,0xdebb,0xcb71,0xcb72,0xcb73,0xcb74,0xcb75,0xcb76, -0xcb77,0xbde5,0xcb78,0xcb79,0xcb7a,0xcb7b,0xcb7c,0xb2d8, -0xc3ea,0xcb7d,0xcb7e,0xdeba,0xcb80,0xc5ba,0xcb81,0xcb82, -0xcb83,0xcb84,0xcb85,0xcb86,0xdebc,0xcb87,0xcb88,0xcb89, -0xcb8a,0xcb8b,0xcb8c,0xcb8d,0xccd9,0xcb8e,0xcb8f,0xcb90, -0xcb91,0xb7aa,0xcb92,0xcb93,0xcb94,0xcb95,0xcb96,0xcb97, -0xcb98,0xcb99,0xcb9a,0xcb9b,0xcb9c,0xcb9d,0xcb9e,0xcb9f, -0xcba0,0xcc40,0xcc41,0xd4e5,0xcc42,0xcc43,0xcc44,0xdebd, -0xcc45,0xcc46,0xcc47,0xcc48,0xcc49,0xdebf,0xcc4a,0xcc4b, -0xcc4c,0xcc4d,0xcc4e,0xcc4f,0xcc50,0xcc51,0xcc52,0xcc53, -0xcc54,0xc4a2,0xcc55,0xcc56,0xcc57,0xcc58,0xdec1,0xcc59, -0xcc5a,0xcc5b,0xcc5c,0xcc5d,0xcc5e,0xcc5f,0xcc60,0xcc61, -0xcc62,0xcc63,0xcc64,0xcc65,0xcc66,0xcc67,0xcc68,0xdebe, -0xcc69,0xdec0,0xcc6a,0xcc6b,0xcc6c,0xcc6d,0xcc6e,0xcc6f, -0xcc70,0xcc71,0xcc72,0xcc73,0xcc74,0xcc75,0xcc76,0xcc77, -0xd5ba,0xcc78,0xcc79,0xcc7a,0xdec2,0xcc7b,0xcc7c,0xcc7d, -0xcc7e,0xcc80,0xcc81,0xcc82,0xcc83,0xcc84,0xcc85,0xcc86, -0xcc87,0xcc88,0xcc89,0xcc8a,0xcc8b,0xf2ae,0xbba2,0xc2b2, -0xc5b0,0xc2c7,0xcc8c,0xcc8d,0xf2af,0xcc8e,0xcc8f,0xcc90, -0xcc91,0xcc92,0xd0e9,0xcc93,0xcc94,0xcc95,0xd3dd,0xcc96, -0xcc97,0xcc98,0xebbd,0xcc99,0xcc9a,0xcc9b,0xcc9c,0xcc9d, -0xcc9e,0xcc9f,0xcca0,0xb3e6,0xf2b0,0xcd40,0xf2b1,0xcd41, -0xcd42,0xcaad,0xcd43,0xcd44,0xcd45,0xcd46,0xcd47,0xcd48, -0xcd49,0xbae7,0xf2b3,0xf2b5,0xf2b4,0xcbe4,0xcfba,0xf2b2, -0xcab4,0xd2cf,0xc2ec,0xcd4a,0xcd4b,0xcd4c,0xcd4d,0xcd4e, -0xcd4f,0xcd50,0xcec3,0xf2b8,0xb0f6,0xf2b7,0xcd51,0xcd52, -0xcd53,0xcd54,0xcd55,0xf2be,0xcd56,0xb2cf,0xcd57,0xcd58, -0xcd59,0xcd5a,0xcd5b,0xcd5c,0xd1c1,0xf2ba,0xcd5d,0xcd5e, -0xcd5f,0xcd60,0xcd61,0xf2bc,0xd4e9,0xcd62,0xcd63,0xf2bb, -0xf2b6,0xf2bf,0xf2bd,0xcd64,0xf2b9,0xcd65,0xcd66,0xf2c7, -0xf2c4,0xf2c6,0xcd67,0xcd68,0xf2ca,0xf2c2,0xf2c0,0xcd69, -0xcd6a,0xcd6b,0xf2c5,0xcd6c,0xcd6d,0xcd6e,0xcd6f,0xcd70, -0xd6fb,0xcd71,0xcd72,0xcd73,0xf2c1,0xcd74,0xc7f9,0xc9df, -0xcd75,0xf2c8,0xb9c6,0xb5b0,0xcd76,0xcd77,0xf2c3,0xf2c9, -0xf2d0,0xf2d6,0xcd78,0xcd79,0xbbd7,0xcd7a,0xcd7b,0xcd7c, -0xf2d5,0xcddc,0xcd7d,0xd6eb,0xcd7e,0xcd80,0xf2d2,0xf2d4, -0xcd81,0xcd82,0xcd83,0xcd84,0xb8f2,0xcd85,0xcd86,0xcd87, -0xcd88,0xf2cb,0xcd89,0xcd8a,0xcd8b,0xf2ce,0xc2f9,0xcd8c, -0xd5dd,0xf2cc,0xf2cd,0xf2cf,0xf2d3,0xcd8d,0xcd8e,0xcd8f, -0xf2d9,0xd3bc,0xcd90,0xcd91,0xcd92,0xcd93,0xb6ea,0xcd94, -0xcaf1,0xcd95,0xb7e4,0xf2d7,0xcd96,0xcd97,0xcd98,0xf2d8, -0xf2da,0xf2dd,0xf2db,0xcd99,0xcd9a,0xf2dc,0xcd9b,0xcd9c, -0xcd9d,0xcd9e,0xd1d1,0xf2d1,0xcd9f,0xcdc9,0xcda0,0xcecf, -0xd6a9,0xce40,0xf2e3,0xce41,0xc3db,0xce42,0xf2e0,0xce43, -0xce44,0xc0af,0xf2ec,0xf2de,0xce45,0xf2e1,0xce46,0xce47, -0xce48,0xf2e8,0xce49,0xce4a,0xce4b,0xce4c,0xf2e2,0xce4d, -0xce4e,0xf2e7,0xce4f,0xce50,0xf2e6,0xce51,0xce52,0xf2e9, -0xce53,0xce54,0xce55,0xf2df,0xce56,0xce57,0xf2e4,0xf2ea, -0xce58,0xce59,0xce5a,0xce5b,0xce5c,0xce5d,0xce5e,0xd3ac, -0xf2e5,0xb2f5,0xce5f,0xce60,0xf2f2,0xce61,0xd0ab,0xce62, -0xce63,0xce64,0xce65,0xf2f5,0xce66,0xce67,0xce68,0xbbc8, -0xce69,0xf2f9,0xce6a,0xce6b,0xce6c,0xce6d,0xce6e,0xce6f, -0xf2f0,0xce70,0xce71,0xf2f6,0xf2f8,0xf2fa,0xce72,0xce73, -0xce74,0xce75,0xce76,0xce77,0xce78,0xce79,0xf2f3,0xce7a, -0xf2f1,0xce7b,0xce7c,0xce7d,0xbafb,0xce7e,0xb5fb,0xce80, -0xce81,0xce82,0xce83,0xf2ef,0xf2f7,0xf2ed,0xf2ee,0xce84, -0xce85,0xce86,0xf2eb,0xf3a6,0xce87,0xf3a3,0xce88,0xce89, -0xf3a2,0xce8a,0xce8b,0xf2f4,0xce8c,0xc8da,0xce8d,0xce8e, -0xce8f,0xce90,0xce91,0xf2fb,0xce92,0xce93,0xce94,0xf3a5, -0xce95,0xce96,0xce97,0xce98,0xce99,0xce9a,0xce9b,0xc3f8, -0xce9c,0xce9d,0xce9e,0xce9f,0xcea0,0xcf40,0xcf41,0xcf42, -0xf2fd,0xcf43,0xcf44,0xf3a7,0xf3a9,0xf3a4,0xcf45,0xf2fc, -0xcf46,0xcf47,0xcf48,0xf3ab,0xcf49,0xf3aa,0xcf4a,0xcf4b, -0xcf4c,0xcf4d,0xc2dd,0xcf4e,0xcf4f,0xf3ae,0xcf50,0xcf51, -0xf3b0,0xcf52,0xcf53,0xcf54,0xcf55,0xcf56,0xf3a1,0xcf57, -0xcf58,0xcf59,0xf3b1,0xf3ac,0xcf5a,0xcf5b,0xcf5c,0xcf5d, -0xcf5e,0xf3af,0xf2fe,0xf3ad,0xcf5f,0xcf60,0xcf61,0xcf62, -0xcf63,0xcf64,0xcf65,0xf3b2,0xcf66,0xcf67,0xcf68,0xcf69, -0xf3b4,0xcf6a,0xcf6b,0xcf6c,0xcf6d,0xf3a8,0xcf6e,0xcf6f, -0xcf70,0xcf71,0xf3b3,0xcf72,0xcf73,0xcf74,0xf3b5,0xcf75, -0xcf76,0xcf77,0xcf78,0xcf79,0xcf7a,0xcf7b,0xcf7c,0xcf7d, -0xcf7e,0xd0b7,0xcf80,0xcf81,0xcf82,0xcf83,0xf3b8,0xcf84, -0xcf85,0xcf86,0xcf87,0xd9f9,0xcf88,0xcf89,0xcf8a,0xcf8b, -0xcf8c,0xcf8d,0xf3b9,0xcf8e,0xcf8f,0xcf90,0xcf91,0xcf92, -0xcf93,0xcf94,0xcf95,0xf3b7,0xcf96,0xc8e4,0xf3b6,0xcf97, -0xcf98,0xcf99,0xcf9a,0xf3ba,0xcf9b,0xcf9c,0xcf9d,0xcf9e, -0xcf9f,0xf3bb,0xb4c0,0xcfa0,0xd040,0xd041,0xd042,0xd043, -0xd044,0xd045,0xd046,0xd047,0xd048,0xd049,0xd04a,0xd04b, -0xd04c,0xd04d,0xeec3,0xd04e,0xd04f,0xd050,0xd051,0xd052, -0xd053,0xf3bc,0xd054,0xd055,0xf3bd,0xd056,0xd057,0xd058, -0xd1aa,0xd059,0xd05a,0xd05b,0xf4ac,0xd0c6,0xd05c,0xd05d, -0xd05e,0xd05f,0xd060,0xd061,0xd0d0,0xd1dc,0xd062,0xd063, -0xd064,0xd065,0xd066,0xd067,0xcfce,0xd068,0xd069,0xbdd6, -0xd06a,0xd1c3,0xd06b,0xd06c,0xd06d,0xd06e,0xd06f,0xd070, -0xd071,0xbae2,0xe1e9,0xd2c2,0xf1c2,0xb2b9,0xd072,0xd073, -0xb1ed,0xf1c3,0xd074,0xc9c0,0xb3c4,0xd075,0xd9f2,0xd076, -0xcba5,0xd077,0xf1c4,0xd078,0xd079,0xd07a,0xd07b,0xd6d4, -0xd07c,0xd07d,0xd07e,0xd080,0xd081,0xf1c5,0xf4c0,0xf1c6, -0xd082,0xd4ac,0xf1c7,0xd083,0xb0c0,0xf4c1,0xd084,0xd085, -0xf4c2,0xd086,0xd087,0xb4fc,0xd088,0xc5db,0xd089,0xd08a, -0xd08b,0xd08c,0xccbb,0xd08d,0xd08e,0xd08f,0xd0e4,0xd090, -0xd091,0xd092,0xd093,0xd094,0xcde0,0xd095,0xd096,0xd097, -0xd098,0xd099,0xf1c8,0xd09a,0xd9f3,0xd09b,0xd09c,0xd09d, -0xd09e,0xd09f,0xd0a0,0xb1bb,0xd140,0xcfae,0xd141,0xd142, -0xd143,0xb8a4,0xd144,0xd145,0xd146,0xd147,0xd148,0xf1ca, -0xd149,0xd14a,0xd14b,0xd14c,0xf1cb,0xd14d,0xd14e,0xd14f, -0xd150,0xb2c3,0xc1d1,0xd151,0xd152,0xd7b0,0xf1c9,0xd153, -0xd154,0xf1cc,0xd155,0xd156,0xd157,0xd158,0xf1ce,0xd159, -0xd15a,0xd15b,0xd9f6,0xd15c,0xd2e1,0xd4a3,0xd15d,0xd15e, -0xf4c3,0xc8b9,0xd15f,0xd160,0xd161,0xd162,0xd163,0xf4c4, -0xd164,0xd165,0xf1cd,0xf1cf,0xbfe3,0xf1d0,0xd166,0xd167, -0xf1d4,0xd168,0xd169,0xd16a,0xd16b,0xd16c,0xd16d,0xd16e, -0xf1d6,0xf1d1,0xd16f,0xc9d1,0xc5e1,0xd170,0xd171,0xd172, -0xc2e3,0xb9fc,0xd173,0xd174,0xf1d3,0xd175,0xf1d5,0xd176, -0xd177,0xd178,0xb9d3,0xd179,0xd17a,0xd17b,0xd17c,0xd17d, -0xd17e,0xd180,0xf1db,0xd181,0xd182,0xd183,0xd184,0xd185, -0xbad6,0xd186,0xb0fd,0xf1d9,0xd187,0xd188,0xd189,0xd18a, -0xd18b,0xf1d8,0xf1d2,0xf1da,0xd18c,0xd18d,0xd18e,0xd18f, -0xd190,0xf1d7,0xd191,0xd192,0xd193,0xc8ec,0xd194,0xd195, -0xd196,0xd197,0xcdca,0xf1dd,0xd198,0xd199,0xd19a,0xd19b, -0xe5bd,0xd19c,0xd19d,0xd19e,0xf1dc,0xd19f,0xf1de,0xd1a0, -0xd240,0xd241,0xd242,0xd243,0xd244,0xd245,0xd246,0xd247, -0xd248,0xf1df,0xd249,0xd24a,0xcfe5,0xd24b,0xd24c,0xd24d, -0xd24e,0xd24f,0xd250,0xd251,0xd252,0xd253,0xd254,0xd255, -0xd256,0xd257,0xd258,0xd259,0xd25a,0xd25b,0xd25c,0xd25d, -0xd25e,0xd25f,0xd260,0xd261,0xd262,0xd263,0xf4c5,0xbdf3, -0xd264,0xd265,0xd266,0xd267,0xd268,0xd269,0xf1e0,0xd26a, -0xd26b,0xd26c,0xd26d,0xd26e,0xd26f,0xd270,0xd271,0xd272, -0xd273,0xd274,0xd275,0xd276,0xd277,0xd278,0xd279,0xd27a, -0xd27b,0xd27c,0xd27d,0xf1e1,0xd27e,0xd280,0xd281,0xcef7, -0xd282,0xd2aa,0xd283,0xf1fb,0xd284,0xd285,0xb8b2,0xd286, -0xd287,0xd288,0xd289,0xd28a,0xd28b,0xd28c,0xd28d,0xd28e, -0xd28f,0xd290,0xd291,0xd292,0xd293,0xd294,0xd295,0xd296, -0xd297,0xd298,0xd299,0xd29a,0xd29b,0xd29c,0xd29d,0xd29e, -0xd29f,0xd2a0,0xd340,0xd341,0xd342,0xd343,0xd344,0xd345, -0xd346,0xd347,0xd348,0xd349,0xd34a,0xd34b,0xd34c,0xd34d, -0xd34e,0xd34f,0xd350,0xd351,0xd352,0xd353,0xd354,0xd355, -0xd356,0xd357,0xd358,0xd359,0xd35a,0xd35b,0xd35c,0xd35d, -0xd35e,0xbcfb,0xb9db,0xd35f,0xb9e6,0xc3d9,0xcad3,0xeae8, -0xc0c0,0xbef5,0xeae9,0xeaea,0xeaeb,0xd360,0xeaec,0xeaed, -0xeaee,0xeaef,0xbdc7,0xd361,0xd362,0xd363,0xf5fb,0xd364, -0xd365,0xd366,0xf5fd,0xd367,0xf5fe,0xd368,0xf5fc,0xd369, -0xd36a,0xd36b,0xd36c,0xbde2,0xd36d,0xf6a1,0xb4a5,0xd36e, -0xd36f,0xd370,0xd371,0xf6a2,0xd372,0xd373,0xd374,0xf6a3, -0xd375,0xd376,0xd377,0xecb2,0xd378,0xd379,0xd37a,0xd37b, -0xd37c,0xd37d,0xd37e,0xd380,0xd381,0xd382,0xd383,0xd384, -0xd1d4,0xd385,0xd386,0xd387,0xd388,0xd389,0xd38a,0xd9ea, -0xd38b,0xd38c,0xd38d,0xd38e,0xd38f,0xd390,0xd391,0xd392, -0xd393,0xd394,0xd395,0xd396,0xd397,0xd398,0xd399,0xd39a, -0xd39b,0xd39c,0xd39d,0xd39e,0xd39f,0xd3a0,0xd440,0xd441, -0xd442,0xd443,0xd444,0xd445,0xd446,0xd447,0xd448,0xd449, -0xd44a,0xd44b,0xd44c,0xd44d,0xd44e,0xd44f,0xd450,0xd451, -0xd452,0xd453,0xd454,0xd455,0xd456,0xd457,0xd458,0xd459, -0xd45a,0xd45b,0xd45c,0xd45d,0xd45e,0xd45f,0xf6a4,0xd460, -0xd461,0xd462,0xd463,0xd464,0xd465,0xd466,0xd467,0xd468, -0xeeba,0xd469,0xd46a,0xd46b,0xd46c,0xd46d,0xd46e,0xd46f, -0xd470,0xd471,0xd472,0xd473,0xd474,0xd475,0xd476,0xd477, -0xd478,0xd479,0xd47a,0xd47b,0xd47c,0xd47d,0xd47e,0xd480, -0xd481,0xd482,0xd483,0xd484,0xd485,0xd486,0xd487,0xd488, -0xd489,0xd48a,0xd48b,0xd48c,0xd48d,0xd48e,0xd48f,0xd490, -0xd491,0xd492,0xd493,0xd494,0xd495,0xd496,0xd497,0xd498, -0xd499,0xd5b2,0xd49a,0xd49b,0xd49c,0xd49d,0xd49e,0xd49f, -0xd4a0,0xd540,0xd541,0xd542,0xd543,0xd544,0xd545,0xd546, -0xd547,0xd3fe,0xccdc,0xd548,0xd549,0xd54a,0xd54b,0xd54c, -0xd54d,0xd54e,0xd54f,0xcac4,0xd550,0xd551,0xd552,0xd553, -0xd554,0xd555,0xd556,0xd557,0xd558,0xd559,0xd55a,0xd55b, -0xd55c,0xd55d,0xd55e,0xd55f,0xd560,0xd561,0xd562,0xd563, -0xd564,0xd565,0xd566,0xd567,0xd568,0xd569,0xd56a,0xd56b, -0xd56c,0xd56d,0xd56e,0xd56f,0xd570,0xd571,0xd572,0xd573, -0xd574,0xd575,0xd576,0xd577,0xd578,0xd579,0xd57a,0xd57b, -0xd57c,0xd57d,0xd57e,0xd580,0xd581,0xd582,0xd583,0xd584, -0xd585,0xd586,0xd587,0xd588,0xd589,0xd58a,0xd58b,0xd58c, -0xd58d,0xd58e,0xd58f,0xd590,0xd591,0xd592,0xd593,0xd594, -0xd595,0xd596,0xd597,0xd598,0xd599,0xd59a,0xd59b,0xd59c, -0xd59d,0xd59e,0xd59f,0xd5a0,0xd640,0xd641,0xd642,0xd643, -0xd644,0xd645,0xd646,0xd647,0xd648,0xd649,0xd64a,0xd64b, -0xd64c,0xd64d,0xd64e,0xd64f,0xd650,0xd651,0xd652,0xd653, -0xd654,0xd655,0xd656,0xd657,0xd658,0xd659,0xd65a,0xd65b, -0xd65c,0xd65d,0xd65e,0xd65f,0xd660,0xd661,0xd662,0xe5c0, -0xd663,0xd664,0xd665,0xd666,0xd667,0xd668,0xd669,0xd66a, -0xd66b,0xd66c,0xd66d,0xd66e,0xd66f,0xd670,0xd671,0xd672, -0xd673,0xd674,0xd675,0xd676,0xd677,0xd678,0xd679,0xd67a, -0xd67b,0xd67c,0xd67d,0xd67e,0xd680,0xd681,0xf6a5,0xd682, -0xd683,0xd684,0xd685,0xd686,0xd687,0xd688,0xd689,0xd68a, -0xd68b,0xd68c,0xd68d,0xd68e,0xd68f,0xd690,0xd691,0xd692, -0xd693,0xd694,0xd695,0xd696,0xd697,0xd698,0xd699,0xd69a, -0xd69b,0xd69c,0xd69d,0xd69e,0xd69f,0xd6a0,0xd740,0xd741, -0xd742,0xd743,0xd744,0xd745,0xd746,0xd747,0xd748,0xd749, -0xd74a,0xd74b,0xd74c,0xd74d,0xd74e,0xd74f,0xd750,0xd751, -0xd752,0xd753,0xd754,0xd755,0xd756,0xd757,0xd758,0xd759, -0xd75a,0xd75b,0xd75c,0xd75d,0xd75e,0xd75f,0xbeaf,0xd760, -0xd761,0xd762,0xd763,0xd764,0xc6a9,0xd765,0xd766,0xd767, -0xd768,0xd769,0xd76a,0xd76b,0xd76c,0xd76d,0xd76e,0xd76f, -0xd770,0xd771,0xd772,0xd773,0xd774,0xd775,0xd776,0xd777, -0xd778,0xd779,0xd77a,0xd77b,0xd77c,0xd77d,0xd77e,0xd780, -0xd781,0xd782,0xd783,0xd784,0xd785,0xd786,0xd787,0xd788, -0xd789,0xd78a,0xd78b,0xd78c,0xd78d,0xd78e,0xd78f,0xd790, -0xd791,0xd792,0xd793,0xd794,0xd795,0xd796,0xd797,0xd798, -0xdaa5,0xbcc6,0xb6a9,0xb8bc,0xc8cf,0xbca5,0xdaa6,0xdaa7, -0xccd6,0xc8c3,0xdaa8,0xc6fd,0xd799,0xd1b5,0xd2e9,0xd1b6, -0xbcc7,0xd79a,0xbdb2,0xbbe4,0xdaa9,0xdaaa,0xd1c8,0xdaab, -0xd0ed,0xb6ef,0xc2db,0xd79b,0xcbcf,0xb7ed,0xc9e8,0xb7c3, -0xbef7,0xd6a4,0xdaac,0xdaad,0xc6c0,0xd7e7,0xcab6,0xd79c, -0xd5a9,0xcbdf,0xd5ef,0xdaae,0xd6df,0xb4ca,0xdab0,0xdaaf, -0xd79d,0xd2eb,0xdab1,0xdab2,0xdab3,0xcad4,0xdab4,0xcaab, -0xdab5,0xdab6,0xb3cf,0xd6ef,0xdab7,0xbbb0,0xb5ae,0xdab8, -0xdab9,0xb9ee,0xd1af,0xd2e8,0xdaba,0xb8c3,0xcfea,0xb2ef, -0xdabb,0xdabc,0xd79e,0xbdeb,0xcedc,0xd3ef,0xdabd,0xcef3, -0xdabe,0xd3d5,0xbbe5,0xdabf,0xcbb5,0xcbd0,0xdac0,0xc7eb, -0xd6ee,0xdac1,0xc5b5,0xb6c1,0xdac2,0xb7cc,0xbfce,0xdac3, -0xdac4,0xcbad,0xdac5,0xb5f7,0xdac6,0xc1c2,0xd7bb,0xdac7, -0xccb8,0xd79f,0xd2ea,0xc4b1,0xdac8,0xb5fd,0xbbd1,0xdac9, -0xd0b3,0xdaca,0xdacb,0xcebd,0xdacc,0xdacd,0xdace,0xb2f7, -0xdad1,0xdacf,0xd1e8,0xdad0,0xc3d5,0xdad2,0xd7a0,0xdad3, -0xdad4,0xdad5,0xd0bb,0xd2a5,0xb0f9,0xdad6,0xc7ab,0xdad7, -0xbdf7,0xc3a1,0xdad8,0xdad9,0xc3fd,0xccb7,0xdada,0xdadb, -0xc0be,0xc6d7,0xdadc,0xdadd,0xc7b4,0xdade,0xdadf,0xb9c8, -0xd840,0xd841,0xd842,0xd843,0xd844,0xd845,0xd846,0xd847, -0xd848,0xbbed,0xd849,0xd84a,0xd84b,0xd84c,0xb6b9,0xf4f8, -0xd84d,0xf4f9,0xd84e,0xd84f,0xcde3,0xd850,0xd851,0xd852, -0xd853,0xd854,0xd855,0xd856,0xd857,0xf5b9,0xd858,0xd859, -0xd85a,0xd85b,0xebe0,0xd85c,0xd85d,0xd85e,0xd85f,0xd860, -0xd861,0xcff3,0xbbbf,0xd862,0xd863,0xd864,0xd865,0xd866, -0xd867,0xd868,0xbac0,0xd4a5,0xd869,0xd86a,0xd86b,0xd86c, -0xd86d,0xd86e,0xd86f,0xe1d9,0xd870,0xd871,0xd872,0xd873, -0xf5f4,0xb1aa,0xb2f2,0xd874,0xd875,0xd876,0xd877,0xd878, -0xd879,0xd87a,0xf5f5,0xd87b,0xd87c,0xf5f7,0xd87d,0xd87e, -0xd880,0xbad1,0xf5f6,0xd881,0xc3b2,0xd882,0xd883,0xd884, -0xd885,0xd886,0xd887,0xd888,0xf5f9,0xd889,0xd88a,0xd88b, -0xf5f8,0xd88c,0xd88d,0xd88e,0xd88f,0xd890,0xd891,0xd892, -0xd893,0xd894,0xd895,0xd896,0xd897,0xd898,0xd899,0xd89a, -0xd89b,0xd89c,0xd89d,0xd89e,0xd89f,0xd8a0,0xd940,0xd941, -0xd942,0xd943,0xd944,0xd945,0xd946,0xd947,0xd948,0xd949, -0xd94a,0xd94b,0xd94c,0xd94d,0xd94e,0xd94f,0xd950,0xd951, -0xd952,0xd953,0xd954,0xd955,0xd956,0xd957,0xd958,0xd959, -0xd95a,0xd95b,0xd95c,0xd95d,0xd95e,0xd95f,0xd960,0xd961, -0xd962,0xd963,0xd964,0xd965,0xd966,0xd967,0xd968,0xd969, -0xd96a,0xd96b,0xd96c,0xd96d,0xd96e,0xd96f,0xd970,0xd971, -0xd972,0xd973,0xd974,0xd975,0xd976,0xd977,0xd978,0xd979, -0xd97a,0xd97b,0xd97c,0xd97d,0xd97e,0xd980,0xd981,0xd982, -0xd983,0xd984,0xd985,0xd986,0xd987,0xd988,0xd989,0xd98a, -0xd98b,0xd98c,0xd98d,0xd98e,0xd98f,0xd990,0xd991,0xd992, -0xd993,0xd994,0xd995,0xd996,0xd997,0xd998,0xd999,0xd99a, -0xd99b,0xd99c,0xd99d,0xd99e,0xd99f,0xd9a0,0xda40,0xda41, -0xda42,0xda43,0xda44,0xda45,0xda46,0xda47,0xda48,0xda49, -0xda4a,0xda4b,0xda4c,0xda4d,0xda4e,0xb1b4,0xd5ea,0xb8ba, -0xda4f,0xb9b1,0xb2c6,0xd4f0,0xcfcd,0xb0dc,0xd5cb,0xbbf5, -0xd6ca,0xb7b7,0xccb0,0xc6b6,0xb1e1,0xb9ba,0xd6fc,0xb9e1, -0xb7a1,0xbcfa,0xeada,0xeadb,0xccf9,0xb9f3,0xeadc,0xb4fb, -0xc3b3,0xb7d1,0xbad8,0xeadd,0xd4f4,0xeade,0xbcd6,0xbbdf, -0xeadf,0xc1de,0xc2b8,0xd4df,0xd7ca,0xeae0,0xeae1,0xeae4, -0xeae2,0xeae3,0xc9de,0xb8b3,0xb6c4,0xeae5,0xcaea,0xc9cd, -0xb4cd,0xda50,0xda51,0xe2d9,0xc5e2,0xeae6,0xc0b5,0xda52, -0xd7b8,0xeae7,0xd7ac,0xc8fc,0xd8d3,0xd8cd,0xd4de,0xda53, -0xd4f9,0xc9c4,0xd3ae,0xb8d3,0xb3e0,0xda54,0xc9e2,0xf4f6, -0xda55,0xda56,0xda57,0xbad5,0xda58,0xf4f7,0xda59,0xda5a, -0xd7df,0xda5b,0xda5c,0xf4f1,0xb8b0,0xd5d4,0xb8cf,0xc6f0, -0xda5d,0xda5e,0xda5f,0xda60,0xda61,0xda62,0xda63,0xda64, -0xda65,0xb3c3,0xda66,0xda67,0xf4f2,0xb3ac,0xda68,0xda69, -0xda6a,0xda6b,0xd4bd,0xc7f7,0xda6c,0xda6d,0xda6e,0xda6f, -0xda70,0xf4f4,0xda71,0xda72,0xf4f3,0xda73,0xda74,0xda75, -0xda76,0xda77,0xda78,0xda79,0xda7a,0xda7b,0xda7c,0xcccb, -0xda7d,0xda7e,0xda80,0xc8a4,0xda81,0xda82,0xda83,0xda84, -0xda85,0xda86,0xda87,0xda88,0xda89,0xda8a,0xda8b,0xda8c, -0xda8d,0xf4f5,0xda8e,0xd7e3,0xc5bf,0xf5c0,0xda8f,0xda90, -0xf5bb,0xda91,0xf5c3,0xda92,0xf5c2,0xda93,0xd6ba,0xf5c1, -0xda94,0xda95,0xda96,0xd4be,0xf5c4,0xda97,0xf5cc,0xda98, -0xda99,0xda9a,0xda9b,0xb0cf,0xb5f8,0xda9c,0xf5c9,0xf5ca, -0xda9d,0xc5dc,0xda9e,0xda9f,0xdaa0,0xdb40,0xf5c5,0xf5c6, -0xdb41,0xdb42,0xf5c7,0xf5cb,0xdb43,0xbee0,0xf5c8,0xb8fa, -0xdb44,0xdb45,0xdb46,0xf5d0,0xf5d3,0xdb47,0xdb48,0xdb49, -0xbfe7,0xdb4a,0xb9f2,0xf5bc,0xf5cd,0xdb4b,0xdb4c,0xc2b7, -0xdb4d,0xdb4e,0xdb4f,0xccf8,0xdb50,0xbcf9,0xdb51,0xf5ce, -0xf5cf,0xf5d1,0xb6e5,0xf5d2,0xdb52,0xf5d5,0xdb53,0xdb54, -0xdb55,0xdb56,0xdb57,0xdb58,0xdb59,0xf5bd,0xdb5a,0xdb5b, -0xdb5c,0xf5d4,0xd3bb,0xdb5d,0xb3ec,0xdb5e,0xdb5f,0xcca4, -0xdb60,0xdb61,0xdb62,0xdb63,0xf5d6,0xdb64,0xdb65,0xdb66, -0xdb67,0xdb68,0xdb69,0xdb6a,0xdb6b,0xf5d7,0xbee1,0xf5d8, -0xdb6c,0xdb6d,0xccdf,0xf5db,0xdb6e,0xdb6f,0xdb70,0xdb71, -0xdb72,0xb2c8,0xd7d9,0xdb73,0xf5d9,0xdb74,0xf5da,0xf5dc, -0xdb75,0xf5e2,0xdb76,0xdb77,0xdb78,0xf5e0,0xdb79,0xdb7a, -0xdb7b,0xf5df,0xf5dd,0xdb7c,0xdb7d,0xf5e1,0xdb7e,0xdb80, -0xf5de,0xf5e4,0xf5e5,0xdb81,0xcce3,0xdb82,0xdb83,0xe5bf, -0xb5b8,0xf5e3,0xf5e8,0xcca3,0xdb84,0xdb85,0xdb86,0xdb87, -0xdb88,0xf5e6,0xf5e7,0xdb89,0xdb8a,0xdb8b,0xdb8c,0xdb8d, -0xdb8e,0xf5be,0xdb8f,0xdb90,0xdb91,0xdb92,0xdb93,0xdb94, -0xdb95,0xdb96,0xdb97,0xdb98,0xdb99,0xdb9a,0xb1c4,0xdb9b, -0xdb9c,0xf5bf,0xdb9d,0xdb9e,0xb5c5,0xb2e4,0xdb9f,0xf5ec, -0xf5e9,0xdba0,0xb6d7,0xdc40,0xf5ed,0xdc41,0xf5ea,0xdc42, -0xdc43,0xdc44,0xdc45,0xdc46,0xf5eb,0xdc47,0xdc48,0xb4da, -0xdc49,0xd4ea,0xdc4a,0xdc4b,0xdc4c,0xf5ee,0xdc4d,0xb3f9, -0xdc4e,0xdc4f,0xdc50,0xdc51,0xdc52,0xdc53,0xdc54,0xf5ef, -0xf5f1,0xdc55,0xdc56,0xdc57,0xf5f0,0xdc58,0xdc59,0xdc5a, -0xdc5b,0xdc5c,0xdc5d,0xdc5e,0xf5f2,0xdc5f,0xf5f3,0xdc60, -0xdc61,0xdc62,0xdc63,0xdc64,0xdc65,0xdc66,0xdc67,0xdc68, -0xdc69,0xdc6a,0xdc6b,0xc9ed,0xb9aa,0xdc6c,0xdc6d,0xc7fb, -0xdc6e,0xdc6f,0xb6e3,0xdc70,0xdc71,0xdc72,0xdc73,0xdc74, -0xdc75,0xdc76,0xccc9,0xdc77,0xdc78,0xdc79,0xdc7a,0xdc7b, -0xdc7c,0xdc7d,0xdc7e,0xdc80,0xdc81,0xdc82,0xdc83,0xdc84, -0xdc85,0xdc86,0xdc87,0xdc88,0xdc89,0xdc8a,0xeaa6,0xdc8b, -0xdc8c,0xdc8d,0xdc8e,0xdc8f,0xdc90,0xdc91,0xdc92,0xdc93, -0xdc94,0xdc95,0xdc96,0xdc97,0xdc98,0xdc99,0xdc9a,0xdc9b, -0xdc9c,0xdc9d,0xdc9e,0xdc9f,0xdca0,0xdd40,0xdd41,0xdd42, -0xdd43,0xdd44,0xdd45,0xdd46,0xdd47,0xdd48,0xdd49,0xdd4a, -0xdd4b,0xdd4c,0xdd4d,0xdd4e,0xdd4f,0xdd50,0xdd51,0xdd52, -0xdd53,0xdd54,0xdd55,0xdd56,0xdd57,0xdd58,0xdd59,0xdd5a, -0xdd5b,0xdd5c,0xdd5d,0xdd5e,0xdd5f,0xdd60,0xdd61,0xdd62, -0xdd63,0xdd64,0xdd65,0xdd66,0xdd67,0xdd68,0xdd69,0xdd6a, -0xdd6b,0xdd6c,0xdd6d,0xdd6e,0xdd6f,0xdd70,0xdd71,0xdd72, -0xdd73,0xdd74,0xdd75,0xdd76,0xdd77,0xdd78,0xdd79,0xdd7a, -0xdd7b,0xdd7c,0xdd7d,0xdd7e,0xdd80,0xdd81,0xdd82,0xdd83, -0xdd84,0xdd85,0xdd86,0xdd87,0xdd88,0xdd89,0xdd8a,0xdd8b, -0xdd8c,0xdd8d,0xdd8e,0xdd8f,0xdd90,0xdd91,0xdd92,0xdd93, -0xdd94,0xdd95,0xdd96,0xdd97,0xdd98,0xdd99,0xdd9a,0xdd9b, -0xdd9c,0xdd9d,0xdd9e,0xdd9f,0xdda0,0xde40,0xde41,0xde42, -0xde43,0xde44,0xde45,0xde46,0xde47,0xde48,0xde49,0xde4a, -0xde4b,0xde4c,0xde4d,0xde4e,0xde4f,0xde50,0xde51,0xde52, -0xde53,0xde54,0xde55,0xde56,0xde57,0xde58,0xde59,0xde5a, -0xde5b,0xde5c,0xde5d,0xde5e,0xde5f,0xde60,0xb3b5,0xd4fe, -0xb9ec,0xd0f9,0xde61,0xe9ed,0xd7aa,0xe9ee,0xc2d6,0xc8ed, -0xbae4,0xe9ef,0xe9f0,0xe9f1,0xd6e1,0xe9f2,0xe9f3,0xe9f5, -0xe9f4,0xe9f6,0xe9f7,0xc7e1,0xe9f8,0xd4d8,0xe9f9,0xbdce, -0xde62,0xe9fa,0xe9fb,0xbdcf,0xe9fc,0xb8a8,0xc1be,0xe9fd, -0xb1b2,0xbbd4,0xb9f5,0xe9fe,0xde63,0xeaa1,0xeaa2,0xeaa3, -0xb7f8,0xbcad,0xde64,0xcae4,0xe0ce,0xd4af,0xcfbd,0xd5b7, -0xeaa4,0xd5de,0xeaa5,0xd0c1,0xb9bc,0xde65,0xb4c7,0xb1d9, -0xde66,0xde67,0xde68,0xc0b1,0xde69,0xde6a,0xde6b,0xde6c, -0xb1e6,0xb1e7,0xde6d,0xb1e8,0xde6e,0xde6f,0xde70,0xde71, -0xb3bd,0xc8e8,0xde72,0xde73,0xde74,0xde75,0xe5c1,0xde76, -0xde77,0xb1df,0xde78,0xde79,0xde7a,0xc1c9,0xb4ef,0xde7b, -0xde7c,0xc7a8,0xd3d8,0xde7d,0xc6f9,0xd1b8,0xde7e,0xb9fd, -0xc2f5,0xde80,0xde81,0xde82,0xde83,0xde84,0xd3ad,0xde85, -0xd4cb,0xbdfc,0xde86,0xe5c2,0xb7b5,0xe5c3,0xde87,0xde88, -0xbbb9,0xd5e2,0xde89,0xbdf8,0xd4b6,0xcea5,0xc1ac,0xb3d9, -0xde8a,0xde8b,0xccf6,0xde8c,0xe5c6,0xe5c4,0xe5c8,0xde8d, -0xe5ca,0xe5c7,0xb5cf,0xc6c8,0xde8e,0xb5fc,0xe5c5,0xde8f, -0xcaf6,0xde90,0xde91,0xe5c9,0xde92,0xde93,0xde94,0xc3d4, -0xb1c5,0xbca3,0xde95,0xde96,0xde97,0xd7b7,0xde98,0xde99, -0xcdcb,0xcbcd,0xcaca,0xccd3,0xe5cc,0xe5cb,0xc4e6,0xde9a, -0xde9b,0xd1a1,0xd1b7,0xe5cd,0xde9c,0xe5d0,0xde9d,0xcdb8, -0xd6f0,0xe5cf,0xb5dd,0xde9e,0xcdbe,0xde9f,0xe5d1,0xb6ba, -0xdea0,0xdf40,0xcda8,0xb9e4,0xdf41,0xcac5,0xb3d1,0xcbd9, -0xd4ec,0xe5d2,0xb7ea,0xdf42,0xdf43,0xdf44,0xe5ce,0xdf45, -0xdf46,0xdf47,0xdf48,0xdf49,0xdf4a,0xe5d5,0xb4fe,0xe5d6, -0xdf4b,0xdf4c,0xdf4d,0xdf4e,0xdf4f,0xe5d3,0xe5d4,0xdf50, -0xd2dd,0xdf51,0xdf52,0xc2df,0xb1c6,0xdf53,0xd3e2,0xdf54, -0xdf55,0xb6dd,0xcbec,0xdf56,0xe5d7,0xdf57,0xdf58,0xd3f6, -0xdf59,0xdf5a,0xdf5b,0xdf5c,0xdf5d,0xb1e9,0xdf5e,0xb6f4, -0xe5da,0xe5d8,0xe5d9,0xb5c0,0xdf5f,0xdf60,0xdf61,0xd2c5, -0xe5dc,0xdf62,0xdf63,0xe5de,0xdf64,0xdf65,0xdf66,0xdf67, -0xdf68,0xdf69,0xe5dd,0xc7b2,0xdf6a,0xd2a3,0xdf6b,0xdf6c, -0xe5db,0xdf6d,0xdf6e,0xdf6f,0xdf70,0xd4e2,0xd5da,0xdf71, -0xdf72,0xdf73,0xdf74,0xdf75,0xe5e0,0xd7f1,0xdf76,0xdf77, -0xdf78,0xdf79,0xdf7a,0xdf7b,0xdf7c,0xe5e1,0xdf7d,0xb1dc, -0xd1fb,0xdf7e,0xe5e2,0xe5e4,0xdf80,0xdf81,0xdf82,0xdf83, -0xe5e3,0xdf84,0xdf85,0xe5e5,0xdf86,0xdf87,0xdf88,0xdf89, -0xdf8a,0xd2d8,0xdf8b,0xb5cb,0xdf8c,0xe7df,0xdf8d,0xdaf5, -0xdf8e,0xdaf8,0xdf8f,0xdaf6,0xdf90,0xdaf7,0xdf91,0xdf92, -0xdf93,0xdafa,0xd0cf,0xc4c7,0xdf94,0xdf95,0xb0ee,0xdf96, -0xdf97,0xdf98,0xd0b0,0xdf99,0xdaf9,0xdf9a,0xd3ca,0xbaaa, -0xdba2,0xc7f1,0xdf9b,0xdafc,0xdafb,0xc9db,0xdafd,0xdf9c, -0xdba1,0xd7de,0xdafe,0xc1da,0xdf9d,0xdf9e,0xdba5,0xdf9f, -0xdfa0,0xd3f4,0xe040,0xe041,0xdba7,0xdba4,0xe042,0xdba8, -0xe043,0xe044,0xbdbc,0xe045,0xe046,0xe047,0xc0c9,0xdba3, -0xdba6,0xd6a3,0xe048,0xdba9,0xe049,0xe04a,0xe04b,0xdbad, -0xe04c,0xe04d,0xe04e,0xdbae,0xdbac,0xbac2,0xe04f,0xe050, -0xe051,0xbfa4,0xdbab,0xe052,0xe053,0xe054,0xdbaa,0xd4c7, -0xb2bf,0xe055,0xe056,0xdbaf,0xe057,0xb9f9,0xe058,0xdbb0, -0xe059,0xe05a,0xe05b,0xe05c,0xb3bb,0xe05d,0xe05e,0xe05f, -0xb5a6,0xe060,0xe061,0xe062,0xe063,0xb6bc,0xdbb1,0xe064, -0xe065,0xe066,0xb6f5,0xe067,0xdbb2,0xe068,0xe069,0xe06a, -0xe06b,0xe06c,0xe06d,0xe06e,0xe06f,0xe070,0xe071,0xe072, -0xe073,0xe074,0xe075,0xe076,0xe077,0xe078,0xe079,0xe07a, -0xe07b,0xb1c9,0xe07c,0xe07d,0xe07e,0xe080,0xdbb4,0xe081, -0xe082,0xe083,0xdbb3,0xdbb5,0xe084,0xe085,0xe086,0xe087, -0xe088,0xe089,0xe08a,0xe08b,0xe08c,0xe08d,0xe08e,0xdbb7, -0xe08f,0xdbb6,0xe090,0xe091,0xe092,0xe093,0xe094,0xe095, -0xe096,0xdbb8,0xe097,0xe098,0xe099,0xe09a,0xe09b,0xe09c, -0xe09d,0xe09e,0xe09f,0xdbb9,0xe0a0,0xe140,0xdbba,0xe141, -0xe142,0xd3cf,0xf4fa,0xc7f5,0xd7c3,0xc5e4,0xf4fc,0xf4fd, -0xf4fb,0xe143,0xbec6,0xe144,0xe145,0xe146,0xe147,0xd0ef, -0xe148,0xe149,0xb7d3,0xe14a,0xe14b,0xd4cd,0xccaa,0xe14c, -0xe14d,0xf5a2,0xf5a1,0xbaa8,0xf4fe,0xcbd6,0xe14e,0xe14f, -0xe150,0xf5a4,0xc0d2,0xe151,0xb3ea,0xe152,0xcdaa,0xf5a5, -0xf5a3,0xbdb4,0xf5a8,0xe153,0xf5a9,0xbdcd,0xc3b8,0xbfe1, -0xcbe1,0xf5aa,0xe154,0xe155,0xe156,0xf5a6,0xf5a7,0xc4f0, -0xe157,0xe158,0xe159,0xe15a,0xe15b,0xf5ac,0xe15c,0xb4bc, -0xe15d,0xd7ed,0xe15e,0xb4d7,0xf5ab,0xf5ae,0xe15f,0xe160, -0xf5ad,0xf5af,0xd0d1,0xe161,0xe162,0xe163,0xe164,0xe165, -0xe166,0xe167,0xc3d1,0xc8a9,0xe168,0xe169,0xe16a,0xe16b, -0xe16c,0xe16d,0xf5b0,0xf5b1,0xe16e,0xe16f,0xe170,0xe171, -0xe172,0xe173,0xf5b2,0xe174,0xe175,0xf5b3,0xf5b4,0xf5b5, -0xe176,0xe177,0xe178,0xe179,0xf5b7,0xf5b6,0xe17a,0xe17b, -0xe17c,0xe17d,0xf5b8,0xe17e,0xe180,0xe181,0xe182,0xe183, -0xe184,0xe185,0xe186,0xe187,0xe188,0xe189,0xe18a,0xb2c9, -0xe18b,0xd3d4,0xcacd,0xe18c,0xc0ef,0xd6d8,0xd2b0,0xc1bf, -0xe18d,0xbdf0,0xe18e,0xe18f,0xe190,0xe191,0xe192,0xe193, -0xe194,0xe195,0xe196,0xe197,0xb8aa,0xe198,0xe199,0xe19a, -0xe19b,0xe19c,0xe19d,0xe19e,0xe19f,0xe1a0,0xe240,0xe241, -0xe242,0xe243,0xe244,0xe245,0xe246,0xe247,0xe248,0xe249, -0xe24a,0xe24b,0xe24c,0xe24d,0xe24e,0xe24f,0xe250,0xe251, -0xe252,0xe253,0xe254,0xe255,0xe256,0xe257,0xe258,0xe259, -0xe25a,0xe25b,0xe25c,0xe25d,0xe25e,0xe25f,0xe260,0xe261, -0xe262,0xe263,0xe264,0xe265,0xe266,0xe267,0xe268,0xe269, -0xe26a,0xe26b,0xe26c,0xe26d,0xe26e,0xe26f,0xe270,0xe271, -0xe272,0xe273,0xe274,0xe275,0xe276,0xe277,0xe278,0xe279, -0xe27a,0xe27b,0xe27c,0xe27d,0xe27e,0xe280,0xe281,0xe282, -0xe283,0xe284,0xe285,0xe286,0xe287,0xe288,0xe289,0xe28a, -0xe28b,0xe28c,0xe28d,0xe28e,0xe28f,0xe290,0xe291,0xe292, -0xe293,0xe294,0xe295,0xe296,0xe297,0xe298,0xe299,0xe29a, -0xe29b,0xe29c,0xe29d,0xe29e,0xe29f,0xe2a0,0xe340,0xe341, -0xe342,0xe343,0xe344,0xe345,0xe346,0xe347,0xe348,0xe349, -0xe34a,0xe34b,0xe34c,0xe34d,0xe34e,0xe34f,0xe350,0xe351, -0xe352,0xe353,0xe354,0xe355,0xe356,0xe357,0xe358,0xe359, -0xe35a,0xe35b,0xe35c,0xe35d,0xe35e,0xe35f,0xe360,0xe361, -0xe362,0xe363,0xe364,0xe365,0xe366,0xe367,0xe368,0xe369, -0xe36a,0xe36b,0xe36c,0xe36d,0xbcf8,0xe36e,0xe36f,0xe370, -0xe371,0xe372,0xe373,0xe374,0xe375,0xe376,0xe377,0xe378, -0xe379,0xe37a,0xe37b,0xe37c,0xe37d,0xe37e,0xe380,0xe381, -0xe382,0xe383,0xe384,0xe385,0xe386,0xe387,0xf6c6,0xe388, -0xe389,0xe38a,0xe38b,0xe38c,0xe38d,0xe38e,0xe38f,0xe390, -0xe391,0xe392,0xe393,0xe394,0xe395,0xe396,0xe397,0xe398, -0xe399,0xe39a,0xe39b,0xe39c,0xe39d,0xe39e,0xe39f,0xe3a0, -0xe440,0xe441,0xe442,0xe443,0xe444,0xe445,0xf6c7,0xe446, -0xe447,0xe448,0xe449,0xe44a,0xe44b,0xe44c,0xe44d,0xe44e, -0xe44f,0xe450,0xe451,0xe452,0xe453,0xe454,0xe455,0xe456, -0xe457,0xe458,0xe459,0xe45a,0xe45b,0xe45c,0xe45d,0xe45e, -0xf6c8,0xe45f,0xe460,0xe461,0xe462,0xe463,0xe464,0xe465, -0xe466,0xe467,0xe468,0xe469,0xe46a,0xe46b,0xe46c,0xe46d, -0xe46e,0xe46f,0xe470,0xe471,0xe472,0xe473,0xe474,0xe475, -0xe476,0xe477,0xe478,0xe479,0xe47a,0xe47b,0xe47c,0xe47d, -0xe47e,0xe480,0xe481,0xe482,0xe483,0xe484,0xe485,0xe486, -0xe487,0xe488,0xe489,0xe48a,0xe48b,0xe48c,0xe48d,0xe48e, -0xe48f,0xe490,0xe491,0xe492,0xe493,0xe494,0xe495,0xe496, -0xe497,0xe498,0xe499,0xe49a,0xe49b,0xe49c,0xe49d,0xe49e, -0xe49f,0xe4a0,0xe540,0xe541,0xe542,0xe543,0xe544,0xe545, -0xe546,0xe547,0xe548,0xe549,0xe54a,0xe54b,0xe54c,0xe54d, -0xe54e,0xe54f,0xe550,0xe551,0xe552,0xe553,0xe554,0xe555, -0xe556,0xe557,0xe558,0xe559,0xe55a,0xe55b,0xe55c,0xe55d, -0xe55e,0xe55f,0xe560,0xe561,0xe562,0xe563,0xe564,0xe565, -0xe566,0xe567,0xe568,0xe569,0xe56a,0xe56b,0xe56c,0xe56d, -0xe56e,0xe56f,0xe570,0xe571,0xe572,0xe573,0xf6c9,0xe574, -0xe575,0xe576,0xe577,0xe578,0xe579,0xe57a,0xe57b,0xe57c, -0xe57d,0xe57e,0xe580,0xe581,0xe582,0xe583,0xe584,0xe585, -0xe586,0xe587,0xe588,0xe589,0xe58a,0xe58b,0xe58c,0xe58d, -0xe58e,0xe58f,0xe590,0xe591,0xe592,0xe593,0xe594,0xe595, -0xe596,0xe597,0xe598,0xe599,0xe59a,0xe59b,0xe59c,0xe59d, -0xe59e,0xe59f,0xf6ca,0xe5a0,0xe640,0xe641,0xe642,0xe643, -0xe644,0xe645,0xe646,0xe647,0xe648,0xe649,0xe64a,0xe64b, -0xe64c,0xe64d,0xe64e,0xe64f,0xe650,0xe651,0xe652,0xe653, -0xe654,0xe655,0xe656,0xe657,0xe658,0xe659,0xe65a,0xe65b, -0xe65c,0xe65d,0xe65e,0xe65f,0xe660,0xe661,0xe662,0xf6cc, -0xe663,0xe664,0xe665,0xe666,0xe667,0xe668,0xe669,0xe66a, -0xe66b,0xe66c,0xe66d,0xe66e,0xe66f,0xe670,0xe671,0xe672, -0xe673,0xe674,0xe675,0xe676,0xe677,0xe678,0xe679,0xe67a, -0xe67b,0xe67c,0xe67d,0xe67e,0xe680,0xe681,0xe682,0xe683, -0xe684,0xe685,0xe686,0xe687,0xe688,0xe689,0xe68a,0xe68b, -0xe68c,0xe68d,0xe68e,0xe68f,0xe690,0xe691,0xe692,0xe693, -0xe694,0xe695,0xe696,0xe697,0xe698,0xe699,0xe69a,0xe69b, -0xe69c,0xe69d,0xf6cb,0xe69e,0xe69f,0xe6a0,0xe740,0xe741, -0xe742,0xe743,0xe744,0xe745,0xe746,0xe747,0xf7e9,0xe748, -0xe749,0xe74a,0xe74b,0xe74c,0xe74d,0xe74e,0xe74f,0xe750, -0xe751,0xe752,0xe753,0xe754,0xe755,0xe756,0xe757,0xe758, -0xe759,0xe75a,0xe75b,0xe75c,0xe75d,0xe75e,0xe75f,0xe760, -0xe761,0xe762,0xe763,0xe764,0xe765,0xe766,0xe767,0xe768, -0xe769,0xe76a,0xe76b,0xe76c,0xe76d,0xe76e,0xe76f,0xe770, -0xe771,0xe772,0xe773,0xe774,0xe775,0xe776,0xe777,0xe778, -0xe779,0xe77a,0xe77b,0xe77c,0xe77d,0xe77e,0xe780,0xe781, -0xe782,0xe783,0xe784,0xe785,0xe786,0xe787,0xe788,0xe789, -0xe78a,0xe78b,0xe78c,0xe78d,0xe78e,0xe78f,0xe790,0xe791, -0xe792,0xe793,0xe794,0xe795,0xe796,0xe797,0xe798,0xe799, -0xe79a,0xe79b,0xe79c,0xe79d,0xe79e,0xe79f,0xe7a0,0xe840, -0xe841,0xe842,0xe843,0xe844,0xe845,0xe846,0xe847,0xe848, -0xe849,0xe84a,0xe84b,0xe84c,0xe84d,0xe84e,0xf6cd,0xe84f, -0xe850,0xe851,0xe852,0xe853,0xe854,0xe855,0xe856,0xe857, -0xe858,0xe859,0xe85a,0xe85b,0xe85c,0xe85d,0xe85e,0xe85f, -0xe860,0xe861,0xe862,0xe863,0xe864,0xe865,0xe866,0xe867, -0xe868,0xe869,0xe86a,0xe86b,0xe86c,0xe86d,0xe86e,0xe86f, -0xe870,0xe871,0xe872,0xe873,0xe874,0xe875,0xe876,0xe877, -0xe878,0xe879,0xe87a,0xf6ce,0xe87b,0xe87c,0xe87d,0xe87e, -0xe880,0xe881,0xe882,0xe883,0xe884,0xe885,0xe886,0xe887, -0xe888,0xe889,0xe88a,0xe88b,0xe88c,0xe88d,0xe88e,0xe88f, -0xe890,0xe891,0xe892,0xe893,0xe894,0xeec4,0xeec5,0xeec6, -0xd5eb,0xb6a4,0xeec8,0xeec7,0xeec9,0xeeca,0xc7a5,0xeecb, -0xeecc,0xe895,0xb7b0,0xb5f6,0xeecd,0xeecf,0xe896,0xeece, -0xe897,0xb8c6,0xeed0,0xeed1,0xeed2,0xb6db,0xb3ae,0xd6d3, -0xc4c6,0xb1b5,0xb8d6,0xeed3,0xeed4,0xd4bf,0xc7d5,0xbefb, -0xced9,0xb9b3,0xeed6,0xeed5,0xeed8,0xeed7,0xc5a5,0xeed9, -0xeeda,0xc7ae,0xeedb,0xc7af,0xeedc,0xb2a7,0xeedd,0xeede, -0xeedf,0xeee0,0xeee1,0xd7ea,0xeee2,0xeee3,0xbcd8,0xeee4, -0xd3cb,0xccfa,0xb2ac,0xc1e5,0xeee5,0xc7a6,0xc3ad,0xe898, -0xeee6,0xeee7,0xeee8,0xeee9,0xeeea,0xeeeb,0xeeec,0xe899, -0xeeed,0xeeee,0xeeef,0xe89a,0xe89b,0xeef0,0xeef1,0xeef2, -0xeef4,0xeef3,0xe89c,0xeef5,0xcdad,0xc2c1,0xeef6,0xeef7, -0xeef8,0xd5a1,0xeef9,0xcfb3,0xeefa,0xeefb,0xe89d,0xeefc, -0xeefd,0xefa1,0xeefe,0xefa2,0xb8f5,0xc3fa,0xefa3,0xefa4, -0xbdc2,0xd2bf,0xb2f9,0xefa5,0xefa6,0xefa7,0xd2f8,0xefa8, -0xd6fd,0xefa9,0xc6cc,0xe89e,0xefaa,0xefab,0xc1b4,0xefac, -0xcffa,0xcbf8,0xefae,0xefad,0xb3fa,0xb9f8,0xefaf,0xefb0, -0xd0e2,0xefb1,0xefb2,0xb7e6,0xd0bf,0xefb3,0xefb4,0xefb5, -0xc8f1,0xcce0,0xefb6,0xefb7,0xefb8,0xefb9,0xefba,0xd5e0, -0xefbb,0xb4ed,0xc3aa,0xefbc,0xe89f,0xefbd,0xefbe,0xefbf, -0xe8a0,0xcefd,0xefc0,0xc2e0,0xb4b8,0xd7b6,0xbdf5,0xe940, -0xcfc7,0xefc3,0xefc1,0xefc2,0xefc4,0xb6a7,0xbcfc,0xbee2, -0xc3cc,0xefc5,0xefc6,0xe941,0xefc7,0xefcf,0xefc8,0xefc9, -0xefca,0xc7c2,0xeff1,0xb6cd,0xefcb,0xe942,0xefcc,0xefcd, -0xb6c6,0xc3be,0xefce,0xe943,0xefd0,0xefd1,0xefd2,0xd5f2, -0xe944,0xefd3,0xc4f7,0xe945,0xefd4,0xc4f8,0xefd5,0xefd6, -0xb8e4,0xb0f7,0xefd7,0xefd8,0xefd9,0xe946,0xefda,0xefdb, -0xefdc,0xefdd,0xe947,0xefde,0xbeb5,0xefe1,0xefdf,0xefe0, -0xe948,0xefe2,0xefe3,0xc1cd,0xefe4,0xefe5,0xefe6,0xefe7, -0xefe8,0xefe9,0xefea,0xefeb,0xefec,0xc0d8,0xe949,0xefed, -0xc1ad,0xefee,0xefef,0xeff0,0xe94a,0xe94b,0xcfe2,0xe94c, -0xe94d,0xe94e,0xe94f,0xe950,0xe951,0xe952,0xe953,0xb3a4, -0xe954,0xe955,0xe956,0xe957,0xe958,0xe959,0xe95a,0xe95b, -0xe95c,0xe95d,0xe95e,0xe95f,0xe960,0xe961,0xe962,0xe963, -0xe964,0xe965,0xe966,0xe967,0xe968,0xe969,0xe96a,0xe96b, -0xe96c,0xe96d,0xe96e,0xe96f,0xe970,0xe971,0xe972,0xe973, -0xe974,0xe975,0xe976,0xe977,0xe978,0xe979,0xe97a,0xe97b, -0xe97c,0xe97d,0xe97e,0xe980,0xe981,0xe982,0xe983,0xe984, -0xe985,0xe986,0xe987,0xe988,0xe989,0xe98a,0xe98b,0xe98c, -0xe98d,0xe98e,0xe98f,0xe990,0xe991,0xe992,0xe993,0xe994, -0xe995,0xe996,0xe997,0xe998,0xe999,0xe99a,0xe99b,0xe99c, -0xe99d,0xe99e,0xe99f,0xe9a0,0xea40,0xea41,0xea42,0xea43, -0xea44,0xea45,0xea46,0xea47,0xea48,0xea49,0xea4a,0xea4b, -0xea4c,0xea4d,0xea4e,0xea4f,0xea50,0xea51,0xea52,0xea53, -0xea54,0xea55,0xea56,0xea57,0xea58,0xea59,0xea5a,0xea5b, -0xc3c5,0xe3c5,0xc9c1,0xe3c6,0xea5c,0xb1d5,0xceca,0xb4b3, -0xc8f2,0xe3c7,0xcfd0,0xe3c8,0xbce4,0xe3c9,0xe3ca,0xc3c6, -0xd5a2,0xc4d6,0xb9eb,0xcec5,0xe3cb,0xc3f6,0xe3cc,0xea5d, -0xb7a7,0xb8f3,0xbad2,0xe3cd,0xe3ce,0xd4c4,0xe3cf,0xea5e, -0xe3d0,0xd1cb,0xe3d1,0xe3d2,0xe3d3,0xe3d4,0xd1d6,0xe3d5, -0xb2fb,0xc0bb,0xe3d6,0xea5f,0xc0ab,0xe3d7,0xe3d8,0xe3d9, -0xea60,0xe3da,0xe3db,0xea61,0xb8b7,0xdae2,0xea62,0xb6d3, -0xea63,0xdae4,0xdae3,0xea64,0xea65,0xea66,0xea67,0xea68, -0xea69,0xea6a,0xdae6,0xea6b,0xea6c,0xea6d,0xc8ee,0xea6e, -0xea6f,0xdae5,0xb7c0,0xd1f4,0xd2f5,0xd5f3,0xbdd7,0xea70, -0xea71,0xea72,0xea73,0xd7e8,0xdae8,0xdae7,0xea74,0xb0a2, -0xcdd3,0xea75,0xdae9,0xea76,0xb8bd,0xbcca,0xc2bd,0xc2a4, -0xb3c2,0xdaea,0xea77,0xc2aa,0xc4b0,0xbdb5,0xea78,0xea79, -0xcfde,0xea7a,0xea7b,0xea7c,0xdaeb,0xc9c2,0xea7d,0xea7e, -0xea80,0xea81,0xea82,0xb1dd,0xea83,0xea84,0xea85,0xdaec, -0xea86,0xb6b8,0xd4ba,0xea87,0xb3fd,0xea88,0xea89,0xdaed, -0xd4c9,0xcfd5,0xc5e3,0xea8a,0xdaee,0xea8b,0xea8c,0xea8d, -0xea8e,0xea8f,0xdaef,0xea90,0xdaf0,0xc1ea,0xccd5,0xcfdd, -0xea91,0xea92,0xea93,0xea94,0xea95,0xea96,0xea97,0xea98, -0xea99,0xea9a,0xea9b,0xea9c,0xea9d,0xd3e7,0xc2a1,0xea9e, -0xdaf1,0xea9f,0xeaa0,0xcbe5,0xeb40,0xdaf2,0xeb41,0xcbe6, -0xd2fe,0xeb42,0xeb43,0xeb44,0xb8f4,0xeb45,0xeb46,0xdaf3, -0xb0af,0xcfb6,0xeb47,0xeb48,0xd5cf,0xeb49,0xeb4a,0xeb4b, -0xeb4c,0xeb4d,0xeb4e,0xeb4f,0xeb50,0xeb51,0xeb52,0xcbed, -0xeb53,0xeb54,0xeb55,0xeb56,0xeb57,0xeb58,0xeb59,0xeb5a, -0xdaf4,0xeb5b,0xeb5c,0xe3c4,0xeb5d,0xeb5e,0xc1a5,0xeb5f, -0xeb60,0xf6bf,0xeb61,0xeb62,0xf6c0,0xf6c1,0xc4d1,0xeb63, -0xc8b8,0xd1e3,0xeb64,0xeb65,0xd0db,0xd1c5,0xbcaf,0xb9cd, -0xeb66,0xeff4,0xeb67,0xeb68,0xb4c6,0xd3ba,0xf6c2,0xb3fb, -0xeb69,0xeb6a,0xf6c3,0xeb6b,0xeb6c,0xb5f1,0xeb6d,0xeb6e, -0xeb6f,0xeb70,0xeb71,0xeb72,0xeb73,0xeb74,0xeb75,0xeb76, -0xf6c5,0xeb77,0xeb78,0xeb79,0xeb7a,0xeb7b,0xeb7c,0xeb7d, -0xd3ea,0xf6a7,0xd1a9,0xeb7e,0xeb80,0xeb81,0xeb82,0xf6a9, -0xeb83,0xeb84,0xeb85,0xf6a8,0xeb86,0xeb87,0xc1e3,0xc0d7, -0xeb88,0xb1a2,0xeb89,0xeb8a,0xeb8b,0xeb8c,0xceed,0xeb8d, -0xd0e8,0xf6ab,0xeb8e,0xeb8f,0xcff6,0xeb90,0xf6aa,0xd5f0, -0xf6ac,0xc3b9,0xeb91,0xeb92,0xeb93,0xbbf4,0xf6ae,0xf6ad, -0xeb94,0xeb95,0xeb96,0xc4de,0xeb97,0xeb98,0xc1d8,0xeb99, -0xeb9a,0xeb9b,0xeb9c,0xeb9d,0xcbaa,0xeb9e,0xcfbc,0xeb9f, -0xeba0,0xec40,0xec41,0xec42,0xec43,0xec44,0xec45,0xec46, -0xec47,0xec48,0xf6af,0xec49,0xec4a,0xf6b0,0xec4b,0xec4c, -0xf6b1,0xec4d,0xc2b6,0xec4e,0xec4f,0xec50,0xec51,0xec52, -0xb0d4,0xc5f9,0xec53,0xec54,0xec55,0xec56,0xf6b2,0xec57, -0xec58,0xec59,0xec5a,0xec5b,0xec5c,0xec5d,0xec5e,0xec5f, -0xec60,0xec61,0xec62,0xec63,0xec64,0xec65,0xec66,0xec67, -0xec68,0xec69,0xc7e0,0xf6a6,0xec6a,0xec6b,0xbeb8,0xec6c, -0xec6d,0xbeb2,0xec6e,0xb5e5,0xec6f,0xec70,0xb7c7,0xec71, -0xbfbf,0xc3d2,0xc3e6,0xec72,0xec73,0xd8cc,0xec74,0xec75, -0xec76,0xb8ef,0xec77,0xec78,0xec79,0xec7a,0xec7b,0xec7c, -0xec7d,0xec7e,0xec80,0xbdf9,0xd1a5,0xec81,0xb0d0,0xec82, -0xec83,0xec84,0xec85,0xec86,0xf7b0,0xec87,0xec88,0xec89, -0xec8a,0xec8b,0xec8c,0xec8d,0xec8e,0xf7b1,0xec8f,0xec90, -0xec91,0xec92,0xec93,0xd0ac,0xec94,0xb0b0,0xec95,0xec96, -0xec97,0xf7b2,0xf7b3,0xec98,0xf7b4,0xec99,0xec9a,0xec9b, -0xc7ca,0xec9c,0xec9d,0xec9e,0xec9f,0xeca0,0xed40,0xed41, -0xbecf,0xed42,0xed43,0xf7b7,0xed44,0xed45,0xed46,0xed47, -0xed48,0xed49,0xed4a,0xf7b6,0xed4b,0xb1de,0xed4c,0xf7b5, -0xed4d,0xed4e,0xf7b8,0xed4f,0xf7b9,0xed50,0xed51,0xed52, -0xed53,0xed54,0xed55,0xed56,0xed57,0xed58,0xed59,0xed5a, -0xed5b,0xed5c,0xed5d,0xed5e,0xed5f,0xed60,0xed61,0xed62, -0xed63,0xed64,0xed65,0xed66,0xed67,0xed68,0xed69,0xed6a, -0xed6b,0xed6c,0xed6d,0xed6e,0xed6f,0xed70,0xed71,0xed72, -0xed73,0xed74,0xed75,0xed76,0xed77,0xed78,0xed79,0xed7a, -0xed7b,0xed7c,0xed7d,0xed7e,0xed80,0xed81,0xcea4,0xc8cd, -0xed82,0xbaab,0xe8b8,0xe8b9,0xe8ba,0xbec2,0xed83,0xed84, -0xed85,0xed86,0xed87,0xd2f4,0xed88,0xd4cf,0xc9d8,0xed89, -0xed8a,0xed8b,0xed8c,0xed8d,0xed8e,0xed8f,0xed90,0xed91, -0xed92,0xed93,0xed94,0xed95,0xed96,0xed97,0xed98,0xed99, -0xed9a,0xed9b,0xed9c,0xed9d,0xed9e,0xed9f,0xeda0,0xee40, -0xee41,0xee42,0xee43,0xee44,0xee45,0xee46,0xee47,0xee48, -0xee49,0xee4a,0xee4b,0xee4c,0xee4d,0xee4e,0xee4f,0xee50, -0xee51,0xee52,0xee53,0xee54,0xee55,0xee56,0xee57,0xee58, -0xee59,0xee5a,0xee5b,0xee5c,0xee5d,0xee5e,0xee5f,0xee60, -0xee61,0xee62,0xee63,0xee64,0xee65,0xee66,0xee67,0xee68, -0xee69,0xee6a,0xee6b,0xee6c,0xee6d,0xee6e,0xee6f,0xee70, -0xee71,0xee72,0xee73,0xee74,0xee75,0xee76,0xee77,0xee78, -0xee79,0xee7a,0xee7b,0xee7c,0xee7d,0xee7e,0xee80,0xee81, -0xee82,0xee83,0xee84,0xee85,0xee86,0xee87,0xee88,0xee89, -0xee8a,0xee8b,0xee8c,0xee8d,0xee8e,0xee8f,0xee90,0xee91, -0xee92,0xee93,0xee94,0xee95,0xee96,0xee97,0xee98,0xee99, -0xee9a,0xee9b,0xee9c,0xee9d,0xee9e,0xee9f,0xeea0,0xef40, -0xef41,0xef42,0xef43,0xef44,0xef45,0xd2b3,0xb6a5,0xc7ea, -0xf1fc,0xcfee,0xcbb3,0xd0eb,0xe7ef,0xcde7,0xb9cb,0xb6d9, -0xf1fd,0xb0e4,0xcbcc,0xf1fe,0xd4a4,0xc2ad,0xc1ec,0xc6c4, -0xbeb1,0xf2a1,0xbcd5,0xef46,0xf2a2,0xf2a3,0xef47,0xf2a4, -0xd2c3,0xc6b5,0xef48,0xcdc7,0xf2a5,0xef49,0xd3b1,0xbfc5, -0xcce2,0xef4a,0xf2a6,0xf2a7,0xd1d5,0xb6ee,0xf2a8,0xf2a9, -0xb5df,0xf2aa,0xf2ab,0xef4b,0xb2fc,0xf2ac,0xf2ad,0xc8a7, -0xef4c,0xef4d,0xef4e,0xef4f,0xef50,0xef51,0xef52,0xef53, -0xef54,0xef55,0xef56,0xef57,0xef58,0xef59,0xef5a,0xef5b, -0xef5c,0xef5d,0xef5e,0xef5f,0xef60,0xef61,0xef62,0xef63, -0xef64,0xef65,0xef66,0xef67,0xef68,0xef69,0xef6a,0xef6b, -0xef6c,0xef6d,0xef6e,0xef6f,0xef70,0xef71,0xb7e7,0xef72, -0xef73,0xeca9,0xecaa,0xecab,0xef74,0xecac,0xef75,0xef76, -0xc6ae,0xecad,0xecae,0xef77,0xef78,0xef79,0xb7c9,0xcab3, -0xef7a,0xef7b,0xef7c,0xef7d,0xef7e,0xef80,0xef81,0xe2b8, -0xf7cf,0xef82,0xef83,0xef84,0xef85,0xef86,0xef87,0xef88, -0xef89,0xef8a,0xef8b,0xef8c,0xef8d,0xef8e,0xef8f,0xef90, -0xef91,0xef92,0xef93,0xef94,0xef95,0xef96,0xef97,0xef98, -0xef99,0xef9a,0xef9b,0xef9c,0xef9d,0xef9e,0xef9f,0xefa0, -0xf040,0xf041,0xf042,0xf043,0xf044,0xf7d0,0xf045,0xf046, -0xb2cd,0xf047,0xf048,0xf049,0xf04a,0xf04b,0xf04c,0xf04d, -0xf04e,0xf04f,0xf050,0xf051,0xf052,0xf053,0xf054,0xf055, -0xf056,0xf057,0xf058,0xf059,0xf05a,0xf05b,0xf05c,0xf05d, -0xf05e,0xf05f,0xf060,0xf061,0xf062,0xf063,0xf7d1,0xf064, -0xf065,0xf066,0xf067,0xf068,0xf069,0xf06a,0xf06b,0xf06c, -0xf06d,0xf06e,0xf06f,0xf070,0xf071,0xf072,0xf073,0xf074, -0xf075,0xf076,0xf077,0xf078,0xf079,0xf07a,0xf07b,0xf07c, -0xf07d,0xf07e,0xf080,0xf081,0xf082,0xf083,0xf084,0xf085, -0xf086,0xf087,0xf088,0xf089,0xf7d3,0xf7d2,0xf08a,0xf08b, -0xf08c,0xf08d,0xf08e,0xf08f,0xf090,0xf091,0xf092,0xf093, -0xf094,0xf095,0xf096,0xe2bb,0xf097,0xbca2,0xf098,0xe2bc, -0xe2bd,0xe2be,0xe2bf,0xe2c0,0xe2c1,0xb7b9,0xd2fb,0xbda4, -0xcace,0xb1a5,0xcbc7,0xf099,0xe2c2,0xb6fc,0xc8c4,0xe2c3, -0xf09a,0xf09b,0xbdc8,0xf09c,0xb1fd,0xe2c4,0xf09d,0xb6f6, -0xe2c5,0xc4d9,0xf09e,0xf09f,0xe2c6,0xcfda,0xb9dd,0xe2c7, -0xc0a1,0xf0a0,0xe2c8,0xb2f6,0xf140,0xe2c9,0xf141,0xc1f3, -0xe2ca,0xe2cb,0xc2f8,0xe2cc,0xe2cd,0xe2ce,0xcad7,0xd8b8, -0xd9e5,0xcfe3,0xf142,0xf143,0xf144,0xf145,0xf146,0xf147, -0xf148,0xf149,0xf14a,0xf14b,0xf14c,0xf0a5,0xf14d,0xf14e, -0xdcb0,0xf14f,0xf150,0xf151,0xf152,0xf153,0xf154,0xf155, -0xf156,0xf157,0xf158,0xf159,0xf15a,0xf15b,0xf15c,0xf15d, -0xf15e,0xf15f,0xf160,0xf161,0xf162,0xf163,0xf164,0xf165, -0xf166,0xf167,0xf168,0xf169,0xf16a,0xf16b,0xf16c,0xf16d, -0xf16e,0xf16f,0xf170,0xf171,0xf172,0xf173,0xf174,0xf175, -0xf176,0xf177,0xf178,0xf179,0xf17a,0xf17b,0xf17c,0xf17d, -0xf17e,0xf180,0xf181,0xf182,0xf183,0xf184,0xf185,0xf186, -0xf187,0xf188,0xf189,0xf18a,0xf18b,0xf18c,0xf18d,0xf18e, -0xf18f,0xf190,0xf191,0xf192,0xf193,0xf194,0xf195,0xf196, -0xf197,0xf198,0xf199,0xf19a,0xf19b,0xf19c,0xf19d,0xf19e, -0xf19f,0xf1a0,0xf240,0xf241,0xf242,0xf243,0xf244,0xf245, -0xf246,0xf247,0xf248,0xf249,0xf24a,0xf24b,0xf24c,0xf24d, -0xf24e,0xf24f,0xf250,0xf251,0xf252,0xf253,0xf254,0xf255, -0xf256,0xf257,0xf258,0xf259,0xf25a,0xf25b,0xf25c,0xf25d, -0xf25e,0xf25f,0xf260,0xf261,0xf262,0xf263,0xf264,0xf265, -0xf266,0xf267,0xf268,0xf269,0xf26a,0xf26b,0xf26c,0xf26d, -0xf26e,0xf26f,0xf270,0xf271,0xf272,0xf273,0xf274,0xf275, -0xf276,0xf277,0xf278,0xf279,0xf27a,0xf27b,0xf27c,0xf27d, -0xf27e,0xf280,0xf281,0xf282,0xf283,0xf284,0xf285,0xf286, -0xf287,0xf288,0xf289,0xf28a,0xf28b,0xf28c,0xf28d,0xf28e, -0xf28f,0xf290,0xf291,0xf292,0xf293,0xf294,0xf295,0xf296, -0xf297,0xf298,0xf299,0xf29a,0xf29b,0xf29c,0xf29d,0xf29e, -0xf29f,0xf2a0,0xf340,0xf341,0xf342,0xf343,0xf344,0xf345, -0xf346,0xf347,0xf348,0xf349,0xf34a,0xf34b,0xf34c,0xf34d, -0xf34e,0xf34f,0xf350,0xf351,0xc2ed,0xd4a6,0xcdd4,0xd1b1, -0xb3db,0xc7fd,0xf352,0xb2b5,0xc2bf,0xe6e0,0xcabb,0xe6e1, -0xe6e2,0xbed4,0xe6e3,0xd7a4,0xcdd5,0xe6e5,0xbcdd,0xe6e4, -0xe6e6,0xe6e7,0xc2ee,0xf353,0xbdbe,0xe6e8,0xc2e6,0xbaa7, -0xe6e9,0xf354,0xe6ea,0xb3d2,0xd1e9,0xf355,0xf356,0xbfa5, -0xe6eb,0xc6ef,0xe6ec,0xe6ed,0xf357,0xf358,0xe6ee,0xc6ad, -0xe6ef,0xf359,0xc9a7,0xe6f0,0xe6f1,0xe6f2,0xe5b9,0xe6f3, -0xe6f4,0xc2e2,0xe6f5,0xe6f6,0xd6e8,0xe6f7,0xf35a,0xe6f8, -0xb9c7,0xf35b,0xf35c,0xf35d,0xf35e,0xf35f,0xf360,0xf361, -0xf7bb,0xf7ba,0xf362,0xf363,0xf364,0xf365,0xf7be,0xf7bc, -0xbaa1,0xf366,0xf7bf,0xf367,0xf7c0,0xf368,0xf369,0xf36a, -0xf7c2,0xf7c1,0xf7c4,0xf36b,0xf36c,0xf7c3,0xf36d,0xf36e, -0xf36f,0xf370,0xf371,0xf7c5,0xf7c6,0xf372,0xf373,0xf374, -0xf375,0xf7c7,0xf376,0xcbe8,0xf377,0xf378,0xf379,0xf37a, -0xb8df,0xf37b,0xf37c,0xf37d,0xf37e,0xf380,0xf381,0xf7d4, -0xf382,0xf7d5,0xf383,0xf384,0xf385,0xf386,0xf7d6,0xf387, -0xf388,0xf389,0xf38a,0xf7d8,0xf38b,0xf7da,0xf38c,0xf7d7, -0xf38d,0xf38e,0xf38f,0xf390,0xf391,0xf392,0xf393,0xf394, -0xf395,0xf7db,0xf396,0xf7d9,0xf397,0xf398,0xf399,0xf39a, -0xf39b,0xf39c,0xf39d,0xd7d7,0xf39e,0xf39f,0xf3a0,0xf440, -0xf7dc,0xf441,0xf442,0xf443,0xf444,0xf445,0xf446,0xf7dd, -0xf447,0xf448,0xf449,0xf7de,0xf44a,0xf44b,0xf44c,0xf44d, -0xf44e,0xf44f,0xf450,0xf451,0xf452,0xf453,0xf454,0xf7df, -0xf455,0xf456,0xf457,0xf7e0,0xf458,0xf459,0xf45a,0xf45b, -0xf45c,0xf45d,0xf45e,0xf45f,0xf460,0xf461,0xf462,0xdbcb, -0xf463,0xf464,0xd8aa,0xf465,0xf466,0xf467,0xf468,0xf469, -0xf46a,0xf46b,0xf46c,0xe5f7,0xb9ed,0xf46d,0xf46e,0xf46f, -0xf470,0xbffd,0xbbea,0xf7c9,0xc6c7,0xf7c8,0xf471,0xf7ca, -0xf7cc,0xf7cb,0xf472,0xf473,0xf474,0xf7cd,0xf475,0xceba, -0xf476,0xf7ce,0xf477,0xf478,0xc4a7,0xf479,0xf47a,0xf47b, -0xf47c,0xf47d,0xf47e,0xf480,0xf481,0xf482,0xf483,0xf484, -0xf485,0xf486,0xf487,0xf488,0xf489,0xf48a,0xf48b,0xf48c, -0xf48d,0xf48e,0xf48f,0xf490,0xf491,0xf492,0xf493,0xf494, -0xf495,0xf496,0xf497,0xf498,0xf499,0xf49a,0xf49b,0xf49c, -0xf49d,0xf49e,0xf49f,0xf4a0,0xf540,0xf541,0xf542,0xf543, -0xf544,0xf545,0xf546,0xf547,0xf548,0xf549,0xf54a,0xf54b, -0xf54c,0xf54d,0xf54e,0xf54f,0xf550,0xf551,0xf552,0xf553, -0xf554,0xf555,0xf556,0xf557,0xf558,0xf559,0xf55a,0xf55b, -0xf55c,0xf55d,0xf55e,0xf55f,0xf560,0xf561,0xf562,0xf563, -0xf564,0xf565,0xf566,0xf567,0xf568,0xf569,0xf56a,0xf56b, -0xf56c,0xf56d,0xf56e,0xf56f,0xf570,0xf571,0xf572,0xf573, -0xf574,0xf575,0xf576,0xf577,0xf578,0xf579,0xf57a,0xf57b, -0xf57c,0xf57d,0xf57e,0xf580,0xf581,0xf582,0xf583,0xf584, -0xf585,0xf586,0xf587,0xf588,0xf589,0xf58a,0xf58b,0xf58c, -0xf58d,0xf58e,0xf58f,0xf590,0xf591,0xf592,0xf593,0xf594, -0xf595,0xf596,0xf597,0xf598,0xf599,0xf59a,0xf59b,0xf59c, -0xf59d,0xf59e,0xf59f,0xf5a0,0xf640,0xf641,0xf642,0xf643, -0xf644,0xf645,0xf646,0xf647,0xf648,0xf649,0xf64a,0xf64b, -0xf64c,0xf64d,0xf64e,0xf64f,0xf650,0xf651,0xf652,0xf653, -0xf654,0xf655,0xf656,0xf657,0xf658,0xf659,0xf65a,0xf65b, -0xf65c,0xf65d,0xf65e,0xf65f,0xf660,0xf661,0xf662,0xf663, -0xf664,0xf665,0xf666,0xf667,0xf668,0xf669,0xf66a,0xf66b, -0xf66c,0xf66d,0xf66e,0xf66f,0xf670,0xf671,0xf672,0xf673, -0xf674,0xf675,0xf676,0xf677,0xf678,0xf679,0xf67a,0xf67b, -0xf67c,0xf67d,0xf67e,0xf680,0xf681,0xf682,0xf683,0xf684, -0xf685,0xf686,0xf687,0xf688,0xf689,0xf68a,0xf68b,0xf68c, -0xf68d,0xf68e,0xf68f,0xf690,0xf691,0xf692,0xf693,0xf694, -0xf695,0xf696,0xf697,0xf698,0xf699,0xf69a,0xf69b,0xf69c, -0xf69d,0xf69e,0xf69f,0xf6a0,0xf740,0xf741,0xf742,0xf743, -0xf744,0xf745,0xf746,0xf747,0xf748,0xf749,0xf74a,0xf74b, -0xf74c,0xf74d,0xf74e,0xf74f,0xf750,0xf751,0xf752,0xf753, -0xf754,0xf755,0xf756,0xf757,0xf758,0xf759,0xf75a,0xf75b, -0xf75c,0xf75d,0xf75e,0xf75f,0xf760,0xf761,0xf762,0xf763, -0xf764,0xf765,0xf766,0xf767,0xf768,0xf769,0xf76a,0xf76b, -0xf76c,0xf76d,0xf76e,0xf76f,0xf770,0xf771,0xf772,0xf773, -0xf774,0xf775,0xf776,0xf777,0xf778,0xf779,0xf77a,0xf77b, -0xf77c,0xf77d,0xf77e,0xf780,0xd3e3,0xf781,0xf782,0xf6cf, -0xf783,0xc2b3,0xf6d0,0xf784,0xf785,0xf6d1,0xf6d2,0xf6d3, -0xf6d4,0xf786,0xf787,0xf6d6,0xf788,0xb1ab,0xf6d7,0xf789, -0xf6d8,0xf6d9,0xf6da,0xf78a,0xf6db,0xf6dc,0xf78b,0xf78c, -0xf78d,0xf78e,0xf6dd,0xf6de,0xcfca,0xf78f,0xf6df,0xf6e0, -0xf6e1,0xf6e2,0xf6e3,0xf6e4,0xc0f0,0xf6e5,0xf6e6,0xf6e7, -0xf6e8,0xf6e9,0xf790,0xf6ea,0xf791,0xf6eb,0xf6ec,0xf792, -0xf6ed,0xf6ee,0xf6ef,0xf6f0,0xf6f1,0xf6f2,0xf6f3,0xf6f4, -0xbea8,0xf793,0xf6f5,0xf6f6,0xf6f7,0xf6f8,0xf794,0xf795, -0xf796,0xf797,0xf798,0xc8fa,0xf6f9,0xf6fa,0xf6fb,0xf6fc, -0xf799,0xf79a,0xf6fd,0xf6fe,0xf7a1,0xf7a2,0xf7a3,0xf7a4, -0xf7a5,0xf79b,0xf79c,0xf7a6,0xf7a7,0xf7a8,0xb1ee,0xf7a9, -0xf7aa,0xf7ab,0xf79d,0xf79e,0xf7ac,0xf7ad,0xc1db,0xf7ae, -0xf79f,0xf7a0,0xf7af,0xf840,0xf841,0xf842,0xf843,0xf844, -0xf845,0xf846,0xf847,0xf848,0xf849,0xf84a,0xf84b,0xf84c, -0xf84d,0xf84e,0xf84f,0xf850,0xf851,0xf852,0xf853,0xf854, -0xf855,0xf856,0xf857,0xf858,0xf859,0xf85a,0xf85b,0xf85c, -0xf85d,0xf85e,0xf85f,0xf860,0xf861,0xf862,0xf863,0xf864, -0xf865,0xf866,0xf867,0xf868,0xf869,0xf86a,0xf86b,0xf86c, -0xf86d,0xf86e,0xf86f,0xf870,0xf871,0xf872,0xf873,0xf874, -0xf875,0xf876,0xf877,0xf878,0xf879,0xf87a,0xf87b,0xf87c, -0xf87d,0xf87e,0xf880,0xf881,0xf882,0xf883,0xf884,0xf885, -0xf886,0xf887,0xf888,0xf889,0xf88a,0xf88b,0xf88c,0xf88d, -0xf88e,0xf88f,0xf890,0xf891,0xf892,0xf893,0xf894,0xf895, -0xf896,0xf897,0xf898,0xf899,0xf89a,0xf89b,0xf89c,0xf89d, -0xf89e,0xf89f,0xf8a0,0xf940,0xf941,0xf942,0xf943,0xf944, -0xf945,0xf946,0xf947,0xf948,0xf949,0xf94a,0xf94b,0xf94c, -0xf94d,0xf94e,0xf94f,0xf950,0xf951,0xf952,0xf953,0xf954, -0xf955,0xf956,0xf957,0xf958,0xf959,0xf95a,0xf95b,0xf95c, -0xf95d,0xf95e,0xf95f,0xf960,0xf961,0xf962,0xf963,0xf964, -0xf965,0xf966,0xf967,0xf968,0xf969,0xf96a,0xf96b,0xf96c, -0xf96d,0xf96e,0xf96f,0xf970,0xf971,0xf972,0xf973,0xf974, -0xf975,0xf976,0xf977,0xf978,0xf979,0xf97a,0xf97b,0xf97c, -0xf97d,0xf97e,0xf980,0xf981,0xf982,0xf983,0xf984,0xf985, -0xf986,0xf987,0xf988,0xf989,0xf98a,0xf98b,0xf98c,0xf98d, -0xf98e,0xf98f,0xf990,0xf991,0xf992,0xf993,0xf994,0xf995, -0xf996,0xf997,0xf998,0xf999,0xf99a,0xf99b,0xf99c,0xf99d, -0xf99e,0xf99f,0xf9a0,0xfa40,0xfa41,0xfa42,0xfa43,0xfa44, -0xfa45,0xfa46,0xfa47,0xfa48,0xfa49,0xfa4a,0xfa4b,0xfa4c, -0xfa4d,0xfa4e,0xfa4f,0xfa50,0xfa51,0xfa52,0xfa53,0xfa54, -0xfa55,0xfa56,0xfa57,0xfa58,0xfa59,0xfa5a,0xfa5b,0xfa5c, -0xfa5d,0xfa5e,0xfa5f,0xfa60,0xfa61,0xfa62,0xfa63,0xfa64, -0xfa65,0xfa66,0xfa67,0xfa68,0xfa69,0xfa6a,0xfa6b,0xfa6c, -0xfa6d,0xfa6e,0xfa6f,0xfa70,0xfa71,0xfa72,0xfa73,0xfa74, -0xfa75,0xfa76,0xfa77,0xfa78,0xfa79,0xfa7a,0xfa7b,0xfa7c, -0xfa7d,0xfa7e,0xfa80,0xfa81,0xfa82,0xfa83,0xfa84,0xfa85, -0xfa86,0xfa87,0xfa88,0xfa89,0xfa8a,0xfa8b,0xfa8c,0xfa8d, -0xfa8e,0xfa8f,0xfa90,0xfa91,0xfa92,0xfa93,0xfa94,0xfa95, -0xfa96,0xfa97,0xfa98,0xfa99,0xfa9a,0xfa9b,0xfa9c,0xfa9d, -0xfa9e,0xfa9f,0xfaa0,0xfb40,0xfb41,0xfb42,0xfb43,0xfb44, -0xfb45,0xfb46,0xfb47,0xfb48,0xfb49,0xfb4a,0xfb4b,0xfb4c, -0xfb4d,0xfb4e,0xfb4f,0xfb50,0xfb51,0xfb52,0xfb53,0xfb54, -0xfb55,0xfb56,0xfb57,0xfb58,0xfb59,0xfb5a,0xfb5b,0xc4f1, -0xf0af,0xbca6,0xf0b0,0xc3f9,0xfb5c,0xc5b8,0xd1bb,0xfb5d, -0xf0b1,0xf0b2,0xf0b3,0xf0b4,0xf0b5,0xd1bc,0xfb5e,0xd1ec, -0xfb5f,0xf0b7,0xf0b6,0xd4a7,0xfb60,0xcdd2,0xf0b8,0xf0ba, -0xf0b9,0xf0bb,0xf0bc,0xfb61,0xfb62,0xb8eb,0xf0bd,0xbae8, -0xfb63,0xf0be,0xf0bf,0xbee9,0xf0c0,0xb6ec,0xf0c1,0xf0c2, -0xf0c3,0xf0c4,0xc8b5,0xf0c5,0xf0c6,0xfb64,0xf0c7,0xc5f4, -0xfb65,0xf0c8,0xfb66,0xfb67,0xfb68,0xf0c9,0xfb69,0xf0ca, -0xf7bd,0xfb6a,0xf0cb,0xf0cc,0xf0cd,0xfb6b,0xf0ce,0xfb6c, -0xfb6d,0xfb6e,0xfb6f,0xf0cf,0xbad7,0xfb70,0xf0d0,0xf0d1, -0xf0d2,0xf0d3,0xf0d4,0xf0d5,0xf0d6,0xf0d8,0xfb71,0xfb72, -0xd3a5,0xf0d7,0xfb73,0xf0d9,0xfb74,0xfb75,0xfb76,0xfb77, -0xfb78,0xfb79,0xfb7a,0xfb7b,0xfb7c,0xfb7d,0xf5ba,0xc2b9, -0xfb7e,0xfb80,0xf7e4,0xfb81,0xfb82,0xfb83,0xfb84,0xf7e5, -0xf7e6,0xfb85,0xfb86,0xf7e7,0xfb87,0xfb88,0xfb89,0xfb8a, -0xfb8b,0xfb8c,0xf7e8,0xc2b4,0xfb8d,0xfb8e,0xfb8f,0xfb90, -0xfb91,0xfb92,0xfb93,0xfb94,0xfb95,0xf7ea,0xfb96,0xf7eb, -0xfb97,0xfb98,0xfb99,0xfb9a,0xfb9b,0xfb9c,0xc2f3,0xfb9d, -0xfb9e,0xfb9f,0xfba0,0xfc40,0xfc41,0xfc42,0xfc43,0xfc44, -0xfc45,0xfc46,0xfc47,0xfc48,0xf4f0,0xfc49,0xfc4a,0xfc4b, -0xf4ef,0xfc4c,0xfc4d,0xc2e9,0xfc4e,0xf7e1,0xf7e2,0xfc4f, -0xfc50,0xfc51,0xfc52,0xfc53,0xbbc6,0xfc54,0xfc55,0xfc56, -0xfc57,0xd9e4,0xfc58,0xfc59,0xfc5a,0xcaf2,0xc0e8,0xf0a4, -0xfc5b,0xbada,0xfc5c,0xfc5d,0xc7ad,0xfc5e,0xfc5f,0xfc60, -0xc4ac,0xfc61,0xfc62,0xf7ec,0xf7ed,0xf7ee,0xfc63,0xf7f0, -0xf7ef,0xfc64,0xf7f1,0xfc65,0xfc66,0xf7f4,0xfc67,0xf7f3, -0xfc68,0xf7f2,0xf7f5,0xfc69,0xfc6a,0xfc6b,0xfc6c,0xf7f6, -0xfc6d,0xfc6e,0xfc6f,0xfc70,0xfc71,0xfc72,0xfc73,0xfc74, -0xfc75,0xede9,0xfc76,0xedea,0xedeb,0xfc77,0xf6bc,0xfc78, -0xfc79,0xfc7a,0xfc7b,0xfc7c,0xfc7d,0xfc7e,0xfc80,0xfc81, -0xfc82,0xfc83,0xfc84,0xf6bd,0xfc85,0xf6be,0xb6a6,0xfc86, -0xd8be,0xfc87,0xfc88,0xb9c4,0xfc89,0xfc8a,0xfc8b,0xd8bb, -0xfc8c,0xdcb1,0xfc8d,0xfc8e,0xfc8f,0xfc90,0xfc91,0xfc92, -0xcaf3,0xfc93,0xf7f7,0xfc94,0xfc95,0xfc96,0xfc97,0xfc98, -0xfc99,0xfc9a,0xfc9b,0xfc9c,0xf7f8,0xfc9d,0xfc9e,0xf7f9, -0xfc9f,0xfca0,0xfd40,0xfd41,0xfd42,0xfd43,0xfd44,0xf7fb, -0xfd45,0xf7fa,0xfd46,0xb1c7,0xfd47,0xf7fc,0xf7fd,0xfd48, -0xfd49,0xfd4a,0xfd4b,0xfd4c,0xf7fe,0xfd4d,0xfd4e,0xfd4f, -0xfd50,0xfd51,0xfd52,0xfd53,0xfd54,0xfd55,0xfd56,0xfd57, -0xc6eb,0xecb4,0xfd58,0xfd59,0xfd5a,0xfd5b,0xfd5c,0xfd5d, -0xfd5e,0xfd5f,0xfd60,0xfd61,0xfd62,0xfd63,0xfd64,0xfd65, -0xfd66,0xfd67,0xfd68,0xfd69,0xfd6a,0xfd6b,0xfd6c,0xfd6d, -0xfd6e,0xfd6f,0xfd70,0xfd71,0xfd72,0xfd73,0xfd74,0xfd75, -0xfd76,0xfd77,0xfd78,0xfd79,0xfd7a,0xfd7b,0xfd7c,0xfd7d, -0xfd7e,0xfd80,0xfd81,0xfd82,0xfd83,0xfd84,0xfd85,0xb3dd, -0xf6b3,0xfd86,0xfd87,0xf6b4,0xc1e4,0xf6b5,0xf6b6,0xf6b7, -0xf6b8,0xf6b9,0xf6ba,0xc8a3,0xf6bb,0xfd88,0xfd89,0xfd8a, -0xfd8b,0xfd8c,0xfd8d,0xfd8e,0xfd8f,0xfd90,0xfd91,0xfd92, -0xfd93,0xc1fa,0xb9a8,0xede8,0xfd94,0xfd95,0xfd96,0xb9ea, -0xd9df,0xfd97,0xfd98,0xfd99,0xfd9a,0xfd9b,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; /* 9fffh */ -static const int ucs_i_cp936_table_min = 0x4d00; -static const int ucs_i_cp936_table_max = 0x4d00 + (sizeof (ucs_i_cp936_table) / sizeof (unsigned short)); - - - -/* 0xf900 CJK Compatibility Ideographs */ -static const unsigned short ucs_ci_cp936_table[] = { -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfd9c,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfd9d,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfd9e,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfd9f, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfda0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0xfa00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfe40,0xfe41,0xfe42,0xfe43, -0x0000,0xfe44,0x0000,0xfe45,0xfe46,0x0000,0x0000,0x0000, -0xfe47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfe48, -0xfe49,0xfe4a,0x0000,0xfe4b,0xfe4c,0x0000,0x0000,0xfe4d, -0xfe4e,0xfe4f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}; -static const int ucs_ci_cp936_table_min = 0xf900; -static const int ucs_ci_cp936_table_max = 0xf900 + (sizeof (ucs_ci_cp936_table) / sizeof (unsigned short)); - - - /* FE30h CJK Compatibility Forms */ -static const unsigned short ucs_cf_cp936_table[] = { -0xa955,0xa6f2,0x0000,0xa6f4,0xa6f5,0xa6e0,0xa6e1,0xa6f0, -0xa6f1,0xa6e2,0xa6e3,0xa6ee,0xa6ef,0xa6e6,0xa6e7,0xa6e4, -0xa6e5,0xa6e8,0xa6e9,0xa6ea,0xa6eb,0x0000,0x0000,0x0000, -0x0000,0xa968,0xa969,0xa96a,0xa96b,0xa96c,0xa96d,0xa96e}; - -static const int ucs_cf_cp936_table_min = 0xfe30; -static const int ucs_cf_cp936_table_max = 0xfe30 + (sizeof (ucs_cf_cp936_table) / sizeof (unsigned short)); - - - /* FE50h Small Form Variants */ -static const unsigned short ucs_sfv_cp936_table[] = { -0xa96f,0xa970,0xa971,0x0000,0xa972,0xa973,0xa974,0xa975, -0x0000,0xa976,0xa977,0xa978,0xa979,0xa97a,0xa97b,0xa97c, -0xa97d,0xa97e,0xa980,0xa981,0xa982,0xa983,0xa984,0x0000, -0xa985,0xa986,0xa987,0xa988,0x0000,0x0000,0x0000,0x0000}; - -static const int ucs_sfv_cp936_table_min = 0xfe50; -static const int ucs_sfv_cp936_table_max = 0xfe50 + (sizeof (ucs_sfv_cp936_table) / sizeof (unsigned short)); - - /* FF00h Halfwidth and Fullwidth Forms */ -static const unsigned short ucs_hff_cp936_table[] = { -0x0000,0xa3a1,0xa3a2,0xa3a3,0xa1e7,0xa3a5,0xa3a6,0xa3a7, -0xa3a8,0xa3a9,0xa3aa,0xa3ab,0xa3ac,0xa3ad,0xa3ae,0xa3af, -0xa3b0,0xa3b1,0xa3b2,0xa3b3,0xa3b4,0xa3b5,0xa3b6,0xa3b7, -0xa3b8,0xa3b9,0xa3ba,0xa3bb,0xa3bc,0xa3bd,0xa3be,0xa3bf, -0xa3c0,0xa3c1,0xa3c2,0xa3c3,0xa3c4,0xa3c5,0xa3c6,0xa3c7, -0xa3c8,0xa3c9,0xa3ca,0xa3cb,0xa3cc,0xa3cd,0xa3ce,0xa3cf, -0xa3d0,0xa3d1,0xa3d2,0xa3d3,0xa3d4,0xa3d5,0xa3d6,0xa3d7, -0xa3d8,0xa3d9,0xa3da,0xa3db,0xa3dc,0xa3dd,0xa3de,0xa3df, -0xa3e0,0xa3e1,0xa3e2,0xa3e3,0xa3e4,0xa3e5,0xa3e6,0xa3e7, -0xa3e8,0xa3e9,0xa3ea,0xa3eb,0xa3ec,0xa3ed,0xa3ee,0xa3ef, -0xa3f0,0xa3f1,0xa3f2,0xa3f3,0xa3f4,0xa3f5,0xa3f6,0xa3f7, -0xa3f8,0xa3f9,0xa3fa,0xa3fb,0xa3fc,0xa3fd,0xa1ab,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1e9,0xa1ea,0xa956,0xa3fe,0xa957,0xa3a4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; -static const int ucs_hff_cp936_table_min = 0xff00; -static const int ucs_hff_cp936_table_max = 0xff00 + (sizeof (ucs_hff_cp936_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_CP936_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h deleted file mode 100644 index 2b6b78f32bd67..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_10_H -static const int iso8859_10_ucs_table[] = { - 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, - 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, - 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, - 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138 -}; -#endif /* UNICODE_TABLE_ISO8859_10_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h deleted file mode 100644 index 5822396525c5e..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_13_H -static const int iso8859_13_ucs_table[] = { - 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, - 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, - 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, - 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, - 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, - 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, - 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, - 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, - 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, - 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, - 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019 -}; -#endif /* UNICODE_TABLE_ISO8859_13_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h deleted file mode 100644 index 6bd03b367ab43..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_14_H -static const int iso8859_14_ucs_table[] = { - 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, - 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, - 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, - 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff -}; -#endif /* UNICODE_TABLE_ISO8859_14_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h deleted file mode 100644 index 029a2bcfc4e43..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_15_H -static const int iso8859_15_ucs_table[] = { - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, - 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff -}; -#endif /* UNICODE_TABLE_ISO8859_15_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h deleted file mode 100644 index 555472d0dc149..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLEISO8859_16_H -static const int iso8859_16_ucs_table[] = { - 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, - 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, - 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, - 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, - 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, - 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff -}; -#endif /* UNICODE_TABLEISO8859_16_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h deleted file mode 100644 index 12bb3cb2dc3e3..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_2_H -static const int iso8859_2_ucs_table[] = { - 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, - 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, - 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, - 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 -}; -#endif /* UNICODE_TABLE_ISO8859_2_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h deleted file mode 100644 index f50c348affed6..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_3_H -static const int iso8859_3_ucs_table[] = { - 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, - 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, - 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, - 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, - 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, - 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, - 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9 -}; -#endif /* UNICODE_TABLE_ISO8859_3_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h deleted file mode 100644 index ff7ecdb4c0b80..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_4_H -static const int iso8859_4_ucs_table[] = { - 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, - 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, - 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, - 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, - 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, - 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9 -}; -#endif /* UNICODE_TABLE_ISO8859_4_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h deleted file mode 100644 index 411ab84b60574..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_5_H -static const int iso8859_5_ucs_table[] = { - 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f -}; -#endif /* UNICODE_TABLE_ISO8859_5_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h deleted file mode 100644 index 0b3952e3a0b87..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_6_H -static const int iso8859_6_ucs_table[] = { - 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, - 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, - 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, - 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, - 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; -#endif /* UNICODE_TABLE_ISO8859_6_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h deleted file mode 100644 index 687f4cbc744af..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_7_H -static const int iso8859_7_ucs_table[] = { - 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, - 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, - 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, - 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000 -}; -#endif /* UNICODE_TABLE_ISO8859_7_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h deleted file mode 100644 index 4ec6490bae49b..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_8_H -static const int iso8859_8_ucs_table[] = { - 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, - 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, - 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, - 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, - 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000 -}; -#endif /* UNICODE_TABLE_ISO8859_8_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h deleted file mode 100644 index 12f988ad7a2af..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h +++ /dev/null @@ -1,17 +0,0 @@ -/* This file is automatically generated. Do not edit! */ -#ifndef UNICODE_TABLE_ISO8859_9_H -static const int iso8859_9_ucs_table[] = { - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff -}; -#endif /* UNICODE_TABLE_ISO8859_9_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_jis.h b/ext/mbstring/libmbfl/filters/unicode_table_jis.h deleted file mode 100644 index 5671c4e8513a0..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_jis.h +++ /dev/null @@ -1,5847 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The authors of this file: PHP3 internationalization team - * You can contact the primary authors; 金ĉœĴ€€èŒ‚ , - * Tsukada Takuya . - * - */ - -#ifndef UNICODE_TABLE_JIS_H -#define UNICODE_TABLE_JIS_H - -/* - * Unicode table - */ -static const unsigned short jisx0208_ucs_table[] = { - /* ku 1 */ - 0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, - 0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, - 0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, - 0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0xFF3C, - 0x301C,0x2016,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, - 0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, - 0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, - 0x300F,0x3010,0x3011,0xFF0B,0x2212,0x00B1,0x00D7,0x00F7, - 0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E,0x2234, - 0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5,0xFF04, - 0x00A2,0x00A3,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20,0x00A7, - 0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7, - - /* ku 2 */ - 0x25C6,0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B, - 0x3012,0x2192,0x2190,0x2191,0x2193,0x3013,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A, - 0x2229,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x2227,0x2228,0x00AC,0x21D2,0x21D4,0x2200,0x2203, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x2220,0x22A5,0x2312,0x2202,0x2207, - 0x2261,0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235, - 0x222B,0x222C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021, - 0x00B6,0x0000,0x0000,0x0000,0x0000,0x25EF, - - /* ku 3 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xFF10, - 0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, - 0xFF19,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, - 0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, - 0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, - 0xFF39,0xFF3A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,0xFF48, - 0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,0xFF50, - 0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57,0xFF58, - 0xFF59,0xFF5A,0x0000,0x0000,0x0000,0x0000, - - /* ku 4 */ - 0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048, - 0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050, - 0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058, - 0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060, - 0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068, - 0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070, - 0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078, - 0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080, - 0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088, - 0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090, - 0x3091,0x3092,0x3093,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 5 */ - 0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, - 0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, - 0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, - 0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, - 0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, - 0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, - 0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, - 0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30E0, - 0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,0x30E8, - 0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,0x30F0, - 0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 6 */ - 0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, - 0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0, - 0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8, - 0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0, - 0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 7 */ - 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, - 0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, - 0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, - 0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, - 0x042F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, - 0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, - 0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, - 0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, - 0x044F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 8 */ - 0x2500,0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C, - 0x2524,0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B, - 0x2517,0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F, - 0x2528,0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 9 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 10 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 11 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 12 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 13 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 14 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 15 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 16 */ - 0x4E9C,0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6, - 0x9022,0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED, - 0x8466,0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B, - 0x59D0,0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F, - 0x88B7,0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D, - 0x674F,0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937, - 0x59D4,0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905, - 0x70BA,0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E, - 0x8863,0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF, - 0x80B2,0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32, - 0x8328,0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0, - 0x59FB,0x5F15,0x98F2,0x6DEB,0x80E4,0x852D, - - /* ku 17 */ - 0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87,0x70CF, - 0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11,0x7893, - 0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B,0x59E5, - 0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B,0x96F2, - 0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620,0x66F3, - 0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E,0x9834, - 0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA,0x99C5, - 0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186,0x5712, - 0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9,0x63F4,0x6CBF, - 0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F,0x7E01,0x8276, - 0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869,0x65BC,0x6C5A, - 0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC, - - /* ku 18 */ - 0x62BC,0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956, - 0x9D2C,0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B, - 0x61B6,0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069, - 0x6E29,0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D, - 0x4FA1,0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6, - 0x5BE1,0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B, - 0x73C2,0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304, - 0x8377,0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6, - 0x904E,0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B, - 0x81E5,0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB, - 0x4F1A,0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A, - 0x6094,0x6062,0x61D0,0x6212,0x62D0,0x6539, - - /* ku 19 */ - 0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686,0x7D75, - 0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE,0x5916, - 0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D,0x84CB, - 0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9,0x57A3, - 0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3,0x62E1, - 0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B,0x899A, - 0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769,0x5B66, - 0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B,0x6A7F, - 0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070,0x62EC,0x6D3B, - 0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14,0x9C39,0x53F6, - 0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3,0x84B2,0x91DC, - 0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431, - - /* ku 20 */ - 0x7CA5,0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2, - 0x520A,0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C, - 0x5B98,0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE, - 0x63DB,0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57, - 0x6F22,0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF, - 0x7BA1,0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E, - 0x89B3,0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2, - 0x9665,0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC, - 0x73A9,0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811, - 0x9854,0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA, - 0x5947,0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE, - 0x673A,0x65D7,0x65E2,0x671F,0x68CB,0x68C4, - - /* ku 21 */ - 0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948,0x5B63, - 0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77,0x8ECC, - 0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100,0x5993, - 0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591,0x7947, - 0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0,0x5409, - 0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775,0x9ECD, - 0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45,0x4EC7, - 0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551,0x673D, - 0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76,0x7AAE,0x7B08, - 0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB,0x5C45,0x5DE8, - 0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31,0x8DDD,0x92F8, - 0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC, - - /* ku 22 */ - 0x4F9B,0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354, - 0x5321,0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A, - 0x602F,0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2, - 0x72ED,0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1, - 0x97FF,0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D, - 0x5C40,0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4, - 0x5747,0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981, - 0x79BD,0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39, - 0x8FD1,0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A, - 0x72D7,0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2, - 0x5177,0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047, - 0x9685,0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48, - - /* ku 23 */ - 0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A,0x9688, - 0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B,0x85AB, - 0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941,0x4FC2, - 0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B,0x5951, - 0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2,0x643A, - 0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB,0x7D4C, - 0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08,0x8A63, - 0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8,0x5287, - 0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091,0x6B20,0x6C7A, - 0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708,0x4EF6,0x5039, - 0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7,0x570F,0x5805, - 0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372, - - /* ku 24 */ - 0x691C,0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79, - 0x770C,0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375, - 0x967A,0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B, - 0x5F26,0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00, - 0x8AFA,0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1, - 0x5B64,0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56, - 0x72D0,0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87, - 0x8DE8,0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D, - 0x5348,0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7, - 0x6A8E,0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E, - 0x9BC9,0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C, - 0x529F,0x52B9,0x52FE,0x539A,0x53E3,0x5411, - - /* ku 25 */ - 0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D,0x5B8F, - 0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7,0x5F18, - 0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602,0x6643, - 0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A,0x6D69, - 0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0,0x7D05, - 0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1,0x8154, - 0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2,0x8CFC, - 0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D,0x9805, - 0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7,0x5408,0x58D5, - 0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B,0x523B,0x544A, - 0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344,0x6F09,0x8170, - 0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC, - - /* ku 26 */ - 0x6B64,0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068, - 0x61C7,0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A, - 0x826E,0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6, - 0x5DEE,0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF, - 0x5750,0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9, - 0x585E,0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73, - 0x6E08,0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E, - 0x7D30,0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750, - 0x7F6A,0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4, - 0x54B2,0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B, - 0x643E,0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F, - 0x685C,0x9BAD,0x7B39,0x5319,0x518A,0x5237, - - /* ku 27 */ - 0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9,0x96D1, - 0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652,0x4E09, - 0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F,0x71E6, - 0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB,0x9178, - 0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A,0x4F7F, - 0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB,0x59C9, - 0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D,0x6307, - 0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62,0x6B7B, - 0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19,0x7D2B,0x80A2, - 0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66,0x8A8C,0x8AEE, - 0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B,0x4F3C,0x4F8D, - 0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642, - - /* ku 28 */ - 0x6B21,0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A, - 0x800C,0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F, - 0x8B58,0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1, - 0x57F7,0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE, - 0x8CEA,0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61, - 0x854A,0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C, - 0x716E,0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7, - 0x90AA,0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C, - 0x91C8,0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6, - 0x5B88,0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B, - 0x8DA3,0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388, - 0x6A39,0x7DAC,0x9700,0x56DA,0x53CE,0x5468, - - /* ku 29 */ - 0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32,0x79C0, - 0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490,0x8846, - 0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C,0x96C6, - 0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E,0x67D4, - 0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4,0x5919, - 0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F,0x51FA, - 0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3,0x821C, - 0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3,0x6E96, - 0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187,0x9806,0x51E6, - 0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6,0x7DD2,0x7F72, - 0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9,0x5973,0x5E8F, - 0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F, - - /* ku 30 */ - 0x52DD,0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617, - 0x5968,0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A, - 0x5E84,0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C, - 0x6377,0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F, - 0x6A35,0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167, - 0x75C7,0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11, - 0x7CA7,0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3, - 0x8A1F,0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266, - 0x937E,0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57, - 0x5197,0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5, - 0x64FE,0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8, - 0x8B72,0x91B8,0x9320,0x5631,0x57F4,0x98FE, - - /* ku 31 */ - 0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272,0x89E6, - 0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5,0x5507, - 0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0,0x664B, - 0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F,0x795E, - 0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A,0x8EAB, - 0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203,0x5875, - 0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5,0x9663, - 0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8,0x9017, - 0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A,0x7761,0x7C8B, - 0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318,0x968F,0x745E, - 0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8,0x96DB,0x636E, - 0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE, - - /* ku 32 */ - 0x6F84,0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4, - 0x5236,0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574, - 0x661F,0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F, - 0x76DB,0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93, - 0x8ACB,0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106, - 0x96BB,0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3, - 0x7A4D,0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F, - 0x78A9,0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83, - 0x7BC0,0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148, - 0x5343,0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247, - 0x64B0,0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C, - 0x714E,0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA, - - /* ku 33 */ - 0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E,0x8CCE, - 0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE,0x524D, - 0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3,0x7CCE, - 0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A,0x72D9, - 0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20,0x7D44, - 0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275,0x53CC, - 0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B,0x5C64, - 0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB,0x64CD, - 0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15,0x71E5,0x4E89, - 0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C,0x8061,0x8349, - 0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70,0x9001,0x906D, - 0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E, - - /* ku 34 */ - 0x81D3,0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373, - 0x606F,0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E, - 0x8CCA,0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58, - 0x5B6B,0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A, - 0x6C70,0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1, - 0x8235,0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE, - 0x8010,0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF, - 0x6CF0,0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000, - 0x902E,0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C, - 0x918D,0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85, - 0x6258,0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438, - 0x6FC1,0x8AFE,0x8338,0x51E7,0x86F8,0x53EA, - - /* ku 35 */ - 0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD,0x7AEA, - 0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0,0x4E39, - 0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E,0x6DE1, - 0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D,0x80C6, - 0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD,0x6696, - 0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730,0x5F1B, - 0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4,0x8718, - 0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4,0x9010, - 0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D,0x4EF2,0x5B99, - 0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B,0x8877,0x8A3B, - 0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A,0x82E7,0x8457, - 0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5, - - /* ku 36 */ - 0x5E16,0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2, - 0x6311,0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074, - 0x8139,0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A, - 0x9577,0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88, - 0x73CD,0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC, - 0x8FFD,0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB, - 0x4F43,0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F, - 0x6F70,0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3, - 0x9DB4,0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448, - 0x5824,0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C, - 0x62B5,0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B, - 0x7DE0,0x8247,0x8A02,0x8AE6,0x8E44,0x9013, - - /* ku 37 */ - 0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2,0x6575, - 0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2,0x5FB9, - 0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929,0x5C55, - 0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B,0x70B9, - 0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410,0x5835, - 0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21,0x767B, - 0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A,0x52AA, - 0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC,0x51CD, - 0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95,0x5CF6,0x5D8B, - 0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC,0x68DF,0x76D7, - 0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53,0x75D8,0x7977, - 0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230, - - /* ku 38 */ - 0x8463,0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003, - 0x900F,0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5, - 0x540C,0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5, - 0x80F4,0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97, - 0x5FB3,0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC, - 0x8AAD,0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6, - 0x82EB,0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566, - 0x6C8C,0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948, - 0x90A3,0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A, - 0x934B,0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF, - 0x96E3,0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1, - 0x8089,0x8679,0x5EFF,0x65E5,0x4E73,0x5165, - - /* ku 39 */ - 0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D,0x6FE1, - 0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74,0x5FF5, - 0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B,0x57DC, - 0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF,0x8FB2, - 0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777,0x6CE2, - 0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC,0x4FF3, - 0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C,0x80CC, - 0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885,0x6973, - 0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A,0x9019,0x877F, - 0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A,0x62CD,0x67CF, - 0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584,0x8FEB,0x66DD, - 0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6, - - /* ku 40 */ - 0x51FD,0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61, - 0x808C,0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197, - 0x9AEA,0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A, - 0x5859,0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB, - 0x5E06,0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF, - 0x73ED,0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6, - 0x7169,0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0, - 0x8543,0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C, - 0x60B2,0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2, - 0x76AE,0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9, - 0x8CBB,0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E, - 0x5FAE,0x6787,0x6BD8,0x7435,0x7709,0x7F8E, - - /* ku 41 */ - 0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66,0x819D, - 0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C,0x6867, - 0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A,0x6A19, - 0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79,0x5EDF, - 0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C,0x86ED, - 0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7,0x8CD3, - 0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B,0x5A66, - 0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577,0x65A7, - 0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A,0x8299,0x8B5C, - 0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE,0x64AB,0x6B66, - 0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953,0x98A8,0x847A, - 0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D, - - /* ku 42 */ - 0x798F,0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8, - 0x4ECF,0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4, - 0x626E,0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587, - 0x805E,0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A, - 0x67C4,0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB, - 0x58C1,0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F, - 0x5909,0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF, - 0x52C9,0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703, - 0x6355,0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893, - 0x6155,0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8, - 0x5305,0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29, - 0x5E96,0x62B1,0x6367,0x653E,0x65B9,0x670B, - - /* ku 43 */ - 0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3,0x840C, - 0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2,0x98FD, - 0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A,0x59A8, - 0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0,0x68D2, - 0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF,0x927E, - 0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8,0x64B2, - 0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1,0x6B86, - 0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6,0x6469, - 0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627,0x679A,0x6BCE, - 0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA,0x67FE,0x9C52, - 0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B,0x6CAB,0x8FC4, - 0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80, - - /* ku 44 */ - 0x6F2B,0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC, - 0x5BC6,0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D, - 0x6C11,0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727, - 0x9D61,0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E, - 0x76DF,0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D, - 0x68C9,0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302, - 0x5984,0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499, - 0x5132,0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24, - 0x623B,0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301, - 0x4E5F,0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2, - 0x5384,0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3, - 0x85AE,0x9453,0x6109,0x6108,0x6CB9,0x7652, - - /* ku 45 */ - 0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB,0x5BA5, - 0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67,0x6D8C, - 0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A,0x9091, - 0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E,0x8A89, - 0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8,0x63DA, - 0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6,0x7194, - 0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981,0x8B21, - 0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32,0x6C83, - 0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA,0x88F8,0x6765, - 0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D,0x916A,0x4E71, - 0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D,0x89A7,0x5229, - 0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483, - - /* ku 46 */ - 0x75E2,0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387, - 0x7ACB,0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409, - 0x7559,0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E, - 0x65C5,0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE, - 0x6599,0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7, - 0x826F,0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1, - 0x502B,0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A, - 0x96A3,0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E, - 0x4EE4,0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2, - 0x793C,0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62, - 0x66A6,0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B, - 0x6190,0x6F23,0x7149,0x7C3E,0x7DF4,0x806F, - - /* ku 47 */ - 0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089,0x8CC2, - 0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717,0x697C, - 0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001,0x807E, - 0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332,0x8AD6, - 0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1,0x67A0, - 0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568,0x6900, - 0x6E7E,0x7897,0x8155,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 48 */ - 0x5F0C,0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F, - 0x4E42,0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212, - 0x5F0D,0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3, - 0x4EB6,0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE, - 0x4EED,0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D, - 0x4F57,0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69, - 0x4F70,0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF, - 0x4FCE,0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5, - 0x501A,0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6, - 0x5021,0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043, - 0x5047,0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C, - 0x5078,0x5080,0x509A,0x5085,0x50B4,0x50B2, - - /* ku 49 */ - 0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5,0x50ED, - 0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102,0x5116, - 0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C,0x513B, - 0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8,0x5169, - 0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189,0x518F, - 0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2,0x51A9, - 0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5,0x51BD, - 0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED,0x51F0, - 0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E,0x5227,0x522A, - 0x522E,0x5233,0x5239,0x524F,0x5244,0x524B,0x524C,0x525E, - 0x5254,0x526A,0x5274,0x5269,0x5273,0x527F,0x527D,0x528D, - 0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8, - - /* ku 50 */ - 0x8FA7,0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7, - 0x52DE,0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8, - 0x52F9,0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315, - 0x531A,0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346, - 0x5345,0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E, - 0x5918,0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5, - 0x53AE,0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC, - 0x71EE,0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440, - 0x542C,0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E, - 0x548F,0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492, - 0x547B,0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2, - 0x54B8,0x54A5,0x54AC,0x54C4,0x54C8,0x54A8, - - /* ku 51 */ - 0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5,0x54E6, - 0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2,0x5539, - 0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556,0x5557, - 0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A,0x559F, - 0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583,0x55A9, - 0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC,0x55E4, - 0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B,0x55F9, - 0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638,0x566B, - 0x5664,0x562F,0x566C,0x566A,0x5686,0x5680,0x568A,0x56A0, - 0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4,0x56C2,0x56BC, - 0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1,0x56D3,0x56D7, - 0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709, - - /* ku 52 */ - 0x5708,0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C, - 0x5726,0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769, - 0x57C0,0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3, - 0x57A4,0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3, - 0x580A,0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821, - 0x5862,0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885, - 0x58B9,0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE, - 0x58C5,0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC, - 0x58E4,0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD, - 0x5902,0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D, - 0x5932,0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A, - 0x5958,0x5962,0x5960,0x5967,0x596C,0x5969, - - /* ku 53 */ - 0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2,0x59C6, - 0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F,0x5A11, - 0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35,0x5A36, - 0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2,0x5ABD, - 0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB,0x5B0C, - 0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E,0x5B43, - 0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65,0x5B69, - 0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80,0x5B83, - 0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4,0x5BD0,0x5BE4, - 0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0,0x5BF6,0x5BF3, - 0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20,0x5C22,0x5C28, - 0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53, - - /* ku 54 */ - 0x5C50,0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79, - 0x5C8C,0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC, - 0x5CB7,0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA, - 0x5CED,0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F, - 0x5D1B,0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C, - 0x5D52,0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84, - 0x5D82,0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7, - 0x5DBC,0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB, - 0x5DF2,0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36, - 0x5E37,0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F, - 0x5E62,0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F, - 0x5EA0,0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF, - - /* ku 55 */ - 0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1,0x5EE8, - 0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8,0x5EFE, - 0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16,0x5F29, - 0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F,0x5F51, - 0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77,0x5F83, - 0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E,0x5F99, - 0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB,0x5FE4, - 0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060,0x6019, - 0x6010,0x6029,0x600E,0x6031,0x601B,0x6015,0x602B,0x6026, - 0x600F,0x603A,0x605A,0x6041,0x606A,0x6077,0x605F,0x604A, - 0x6046,0x604D,0x6063,0x6043,0x6064,0x6042,0x606C,0x606B, - 0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A, - - /* ku 56 */ - 0x6084,0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1, - 0x60B8,0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5, - 0x60D8,0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4, - 0x60FA,0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147, - 0x613E,0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134, - 0x613D,0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A, - 0x616B,0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153, - 0x6175,0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A, - 0x6191,0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8, - 0x61C3,0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3, - 0x61F6,0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200, - 0x6208,0x6209,0x620D,0x620C,0x6214,0x621B, - - /* ku 57 */ - 0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233,0x6241, - 0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C,0x6282, - 0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283,0x6294, - 0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4,0x62C8, - 0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9,0x630C, - 0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5,0x6350, - 0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380,0x63AB, - 0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B,0x6369, - 0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9,0x63D2,0x63F6, - 0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426,0x6436,0x651D, - 0x6417,0x6428,0x640F,0x6467,0x646F,0x6476,0x644E,0x652A, - 0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC, - - /* ku 58 */ - 0x64DA,0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1, - 0x64E7,0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C, - 0x64F6,0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C, - 0x6505,0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536, - 0x6538,0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E, - 0x655D,0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F, - 0x65AB,0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2, - 0x65DB,0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603, - 0x65FB,0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644, - 0x6649,0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F, - 0x6662,0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698, - 0x669D,0x66C1,0x66B9,0x66C9,0x66BE,0x66BC, - - /* ku 59 */ - 0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6,0x66E9, - 0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726,0x6727, - 0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737,0x6746, - 0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770,0x67A9, - 0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785,0x67B7, - 0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4,0x67DE, - 0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7,0x6A9C, - 0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E,0x68B3, - 0x682B,0x6859,0x6863,0x6877,0x687F,0x689F,0x688F,0x68AD, - 0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9,0x6874,0x68B5, - 0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901,0x68CA,0x6908, - 0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD, - - /* ku 60 */ - 0x68D4,0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3, - 0x6925,0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923, - 0x6921,0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954, - 0x697E,0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961, - 0x695E,0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF, - 0x69C1,0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB, - 0x69C3,0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4, - 0x69DE,0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2, - 0x69E7,0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A, - 0x6A12,0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36, - 0x6A78,0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22, - 0x6A90,0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3, - - /* ku 61 */ - 0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3,0x6AAC, - 0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB,0x6B05, - 0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38,0x6B37, - 0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50,0x6B59, - 0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F,0x6B80, - 0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4,0x6BAA, - 0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC,0x6BC6, - 0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF,0x9EBE, - 0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23,0x6C5E,0x6C55, - 0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81,0x6C9B,0x6C7E, - 0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1,0x6CD3,0x6CBD, - 0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE, - - /* ku 62 */ - 0x6CBA,0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36, - 0x6D2B,0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C, - 0x6D63,0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95, - 0x6FE4,0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6, - 0x6DB8,0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5, - 0x6DFA,0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E, - 0x6E2E,0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B, - 0x6E76,0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF, - 0x6E1D,0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3, - 0x6EBD,0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5, - 0x6EC2,0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE, - 0x6F3F,0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC, - - /* ku 63 */ - 0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, - 0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, - 0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, - 0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, - 0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, - 0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, - 0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, - 0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD,0x70D9, - 0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188,0x7166, - 0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184,0x7195, - 0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9,0x71D4, - 0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC, - - /* ku 64 */ - 0x71F9,0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C, - 0x7230,0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B, - 0x7258,0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296, - 0x72A2,0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE, - 0x72D2,0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317, - 0x730A,0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325, - 0x733E,0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370, - 0x7378,0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB, - 0x73C0,0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425, - 0x73F8,0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441, - 0x745C,0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B, - 0x749E,0x74A7,0x74CA,0x74CF,0x74D4,0x73F1, - - /* ku 65 */ - 0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, - 0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, - 0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, - 0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, - 0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, - 0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, - 0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, - 0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF,0x75FC, - 0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D,0x7609, - 0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634,0x7630, - 0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661,0x7662, - 0x7668,0x7669,0x766A,0x7667,0x766C,0x7670, - - /* ku 66 */ - 0x7672,0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B, - 0x768E,0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8, - 0x76B9,0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1, - 0x76E5,0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704, - 0x7729,0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738, - 0x7747,0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E, - 0x7779,0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6, - 0x77B9,0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7, - 0x77DA,0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926, - 0x7820,0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A, - 0x788C,0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB, - 0x78D4,0x78BE,0x78BC,0x78C5,0x78CA,0x78EC, - - /* ku 67 */ - 0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, - 0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, - 0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, - 0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, - 0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, - 0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, - 0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, - 0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0,0x7AB6, - 0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD,0x7ACF, - 0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2,0x7AE6, - 0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33,0x7B18, - 0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50, - - /* ku 68 */ - 0x7B7A,0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65, - 0x7B74,0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98, - 0x7B9F,0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D, - 0x7B99,0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD, - 0x7BE9,0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07, - 0x7C13,0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27, - 0x7C2A,0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54, - 0x7C4F,0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65, - 0x7C6C,0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB, - 0x7CA1,0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD, - 0x7CC0,0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B, - 0x7CEF,0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06, - - /* ku 69 */ - 0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, - 0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, - 0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, - 0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, - 0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, - 0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, - 0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, - 0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37,0x7E32, - 0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A,0x7E79, - 0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D,0x8FAE, - 0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93,0x7E94, - 0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A, - - /* ku 70 */ - 0x7F45,0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54, - 0x7F58,0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82, - 0x7F86,0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D, - 0x7F9A,0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8, - 0x8B71,0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6, - 0x7FE9,0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012, - 0x8018,0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A, - 0x8046,0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073, - 0x8072,0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086, - 0x8085,0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB, - 0x80E5,0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF, - 0x80F1,0x811B,0x8129,0x8123,0x812F,0x814B, - - /* ku 71 */ - 0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, - 0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, - 0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, - 0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, - 0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, - 0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, - 0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, - 0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264,0x8262, - 0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278,0x827E, - 0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1,0x82E3, - 0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303,0x82FB, - 0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9, - - /* ku 72 */ - 0x8335,0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350, - 0x8345,0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA, - 0x839F,0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C, - 0x83B5,0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413, - 0x83EB,0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7, - 0x8407,0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438, - 0x8506,0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477, - 0x846B,0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F, - 0x8479,0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9, - 0x84CD,0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1, - 0x8521,0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515, - 0x8514,0x84FC,0x8540,0x8563,0x8558,0x8548, - - /* ku 73 */ - 0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, - 0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, - 0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, - 0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, - 0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, - 0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, - 0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, - 0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC,0x86DF, - 0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703,0x86FB, - 0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F,0x8737, - 0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778,0x874C, - 0x874E,0x8774,0x8757,0x8768,0x876E,0x8759, - - /* ku 74 */ - 0x8753,0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF, - 0x87CB,0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3, - 0x87C7,0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D, - 0x87FE,0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815, - 0x8822,0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844, - 0x8842,0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E, - 0x889E,0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892, - 0x88AE,0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1, - 0x88C3,0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902, - 0x88FC,0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913, - 0x8943,0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B, - 0x8936,0x8938,0x894C,0x891D,0x8960,0x895E, - - /* ku 75 */ - 0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, - 0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, - 0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, - 0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, - 0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, - 0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, - 0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, - 0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7,0x8AE4, - 0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB,0x8B0C, - 0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20,0x8B33, - 0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C,0x8B4F, - 0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B, - - /* ku 76 */ - 0x8B5F,0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E, - 0x8B92,0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F, - 0x8C48,0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78, - 0x8C7A,0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94, - 0x8C7C,0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3, - 0x8CAE,0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD, - 0x8CFA,0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D, - 0x8D10,0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D, - 0x8D71,0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF, - 0x8DDA,0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF, - 0x8DE3,0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10, - 0x8E1F,0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A, - - /* ku 77 */ - 0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, - 0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, - 0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, - 0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, - 0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, - 0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, - 0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, - 0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C,0x8F62, - 0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF,0x8FB7, - 0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4,0x9005, - 0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E,0x9016, - 0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8, - - /* ku 78 */ - 0x904F,0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056, - 0x9058,0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082, - 0x907D,0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF, - 0x90B1,0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112, - 0x9119,0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165, - 0x9169,0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB, - 0x91AF,0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9, - 0x91CB,0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5, - 0x91F6,0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E, - 0x9257,0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B, - 0x9250,0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9, - 0x92B7,0x92E9,0x930F,0x92FA,0x9344,0x932E, - - /* ku 79 */ - 0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, - 0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, - 0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, - 0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, - 0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, - 0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, - 0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, - 0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599,0x95A0, - 0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE,0x95CA, - 0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6,0x95DC, - 0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F,0x9642, - 0x964C,0x964F,0x964B,0x9677,0x965C,0x965E, - - /* ku 80 */ - 0x965D,0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695, - 0x9697,0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6, - 0x96B8,0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC, - 0x970D,0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E, - 0x9711,0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739, - 0x973D,0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C, - 0x9760,0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779, - 0x9785,0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790, - 0x979C,0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6, - 0x97C8,0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6, - 0x97F5,0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D, - 0x9846,0x984F,0x984B,0x986B,0x986F,0x9870, - - /* ku 81 */ - 0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, - 0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, - 0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, - 0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, - 0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, - 0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, - 0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, - 0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43,0x9A3E, - 0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65,0x9A64, - 0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0,0x9ACF, - 0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3,0x9AE6, - 0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7, - - /* ku 82 */ - 0x9AFB,0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25, - 0x9B27,0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44, - 0x9B43,0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93, - 0x9B83,0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4, - 0x9BC0,0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3, - 0x9BE2,0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0, - 0x9C15,0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12, - 0x9C0A,0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30, - 0x9C47,0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76, - 0x9C78,0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03, - 0x9D06,0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15, - 0x9D12,0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48, - - /* ku 83 */ - 0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, - 0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, - 0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, - 0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, - 0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, - 0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, - 0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, - 0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF,0x9EF4, - 0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07,0x9F08, - 0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52,0x9F54, - 0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C,0x9F6A, - 0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0, - - /* ku 84 */ - 0x582F,0x69C7,0x9059,0x7464,0x51DC,0x7199 -}; - -static const int jisx0208_ucs_table_size = (sizeof (jisx0208_ucs_table) / sizeof (unsigned short)); - -static const unsigned short jisx0212_ucs_table[] = { - /* ku 1 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 2 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x02D8,0x02C7, - 0x00B8,0x02D9,0x02DD,0x00AF,0x02DB,0x02DA,0x007E,0x0384, - 0x0385,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x00A1,0x00A6,0x00BF,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x00BA,0x00AA,0x00A9,0x00AE,0x2122,0x00A4, - 0x2116,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 3 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 4 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 5 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 6 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0386,0x0388,0x0389,0x038A,0x03AA,0x0000,0x038C,0x0000, - 0x038E,0x03AB,0x0000,0x038F,0x0000,0x0000,0x0000,0x0000, - 0x03AC,0x03AD,0x03AE,0x03AF,0x03CA,0x0390,0x03CC,0x03C2, - 0x03CD,0x03CB,0x03B0,0x03CE,0x0000,0x0000, - - /* ku 7 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0402,0x0403,0x0404,0x0405,0x0406,0x0407,0x0408, - 0x0409,0x040A,0x040B,0x040C,0x040E,0x040F,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0452,0x0453,0x0454,0x0455,0x0456,0x0457,0x0458, - 0x0459,0x045A,0x045B,0x045C,0x045E,0x045F, - - /* ku 8 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 9 */ - 0x00C6,0x0110,0x0000,0x0126,0x0000,0x0132,0x0000,0x0141, - 0x013F,0x0000,0x014A,0x00D8,0x0152,0x0000,0x0166,0x00DE, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x00E6,0x0111,0x00F0,0x0127,0x0131,0x0133,0x0138,0x0142, - 0x0140,0x0149,0x014B,0x00F8,0x0153,0x00DF,0x0167,0x00FE, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 10 */ - 0x00C1,0x00C0,0x00C4,0x00C2,0x0102,0x01CD,0x0100,0x0104, - 0x00C5,0x00C3,0x0106,0x0108,0x010C,0x00C7,0x010A,0x010E, - 0x00C9,0x00C8,0x00CB,0x00CA,0x011A,0x0116,0x0112,0x0118, - 0x0000,0x011C,0x011E,0x0122,0x0120,0x0124,0x00CD,0x00CC, - 0x00CF,0x00CE,0x01CF,0x0130,0x012A,0x012E,0x0128,0x0134, - 0x0136,0x0139,0x013D,0x013B,0x0143,0x0147,0x0145,0x00D1, - 0x00D3,0x00D2,0x00D6,0x00D4,0x01D1,0x0150,0x014C,0x00D5, - 0x0154,0x0158,0x0156,0x015A,0x015C,0x0160,0x015E,0x0164, - 0x0162,0x00DA,0x00D9,0x00DC,0x00DB,0x016C,0x01D3,0x0170, - 0x016A,0x0172,0x016E,0x0168,0x01D7,0x01DB,0x01D9,0x01D5, - 0x0174,0x00DD,0x0178,0x0176,0x0179,0x017D,0x017B,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 11 */ - 0x00E1,0x00E0,0x00E4,0x00E2,0x0103,0x01CE,0x0101,0x0105, - 0x00E5,0x00E3,0x0107,0x0109,0x010D,0x00E7,0x010B,0x010F, - 0x00E9,0x00E8,0x00EB,0x00EA,0x011B,0x0117,0x0113,0x0119, - 0x01F5,0x011D,0x011F,0x0000,0x0121,0x0125,0x00ED,0x00EC, - 0x00EF,0x00EE,0x01D0,0x0000,0x012B,0x012F,0x0129,0x0135, - 0x0137,0x013A,0x013E,0x013C,0x0144,0x0148,0x0146,0x00F1, - 0x00F3,0x00F2,0x00F6,0x00F4,0x01D2,0x0151,0x014D,0x00F5, - 0x0155,0x0159,0x0157,0x015B,0x015D,0x0161,0x015F,0x0165, - 0x0163,0x00FA,0x00F9,0x00FC,0x00FB,0x016D,0x01D4,0x0171, - 0x016B,0x0173,0x016F,0x0169,0x01D8,0x01DC,0x01DA,0x01D6, - 0x0175,0x00FD,0x00FF,0x0177,0x017A,0x017E,0x017C,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 12 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 13 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 14 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 15 */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* ku 16 */ - 0x4E02,0x4E04,0x4E05,0x4E0C,0x4E12,0x4E1F,0x4E23,0x4E24, - 0x4E28,0x4E2B,0x4E2E,0x4E2F,0x4E30,0x4E35,0x4E40,0x4E41, - 0x4E44,0x4E47,0x4E51,0x4E5A,0x4E5C,0x4E63,0x4E68,0x4E69, - 0x4E74,0x4E75,0x4E79,0x4E7F,0x4E8D,0x4E96,0x4E97,0x4E9D, - 0x4EAF,0x4EB9,0x4EC3,0x4ED0,0x4EDA,0x4EDB,0x4EE0,0x4EE1, - 0x4EE2,0x4EE8,0x4EEF,0x4EF1,0x4EF3,0x4EF5,0x4EFD,0x4EFE, - 0x4EFF,0x4F00,0x4F02,0x4F03,0x4F08,0x4F0B,0x4F0C,0x4F12, - 0x4F15,0x4F16,0x4F17,0x4F19,0x4F2E,0x4F31,0x4F60,0x4F33, - 0x4F35,0x4F37,0x4F39,0x4F3B,0x4F3E,0x4F40,0x4F42,0x4F48, - 0x4F49,0x4F4B,0x4F4C,0x4F52,0x4F54,0x4F56,0x4F58,0x4F5F, - 0x4F63,0x4F6A,0x4F6C,0x4F6E,0x4F71,0x4F77,0x4F78,0x4F79, - 0x4F7A,0x4F7D,0x4F7E,0x4F81,0x4F82,0x4F84, - - /* ku 17 */ - 0x4F85,0x4F89,0x4F8A,0x4F8C,0x4F8E,0x4F90,0x4F92,0x4F93, - 0x4F94,0x4F97,0x4F99,0x4F9A,0x4F9E,0x4F9F,0x4FB2,0x4FB7, - 0x4FB9,0x4FBB,0x4FBC,0x4FBD,0x4FBE,0x4FC0,0x4FC1,0x4FC5, - 0x4FC6,0x4FC8,0x4FC9,0x4FCB,0x4FCC,0x4FCD,0x4FCF,0x4FD2, - 0x4FDC,0x4FE0,0x4FE2,0x4FF0,0x4FF2,0x4FFC,0x4FFD,0x4FFF, - 0x5000,0x5001,0x5004,0x5007,0x500A,0x500C,0x500E,0x5010, - 0x5013,0x5017,0x5018,0x501B,0x501C,0x501D,0x501E,0x5022, - 0x5027,0x502E,0x5030,0x5032,0x5033,0x5035,0x5040,0x5041, - 0x5042,0x5045,0x5046,0x504A,0x504C,0x504E,0x5051,0x5052, - 0x5053,0x5057,0x5059,0x505F,0x5060,0x5062,0x5063,0x5066, - 0x5067,0x506A,0x506D,0x5070,0x5071,0x503B,0x5081,0x5083, - 0x5084,0x5086,0x508A,0x508E,0x508F,0x5090, - - /* ku 18 */ - 0x5092,0x5093,0x5094,0x5096,0x509B,0x509C,0x509E,0x509F, - 0x50A0,0x50A1,0x50A2,0x50AA,0x50AF,0x50B0,0x50B9,0x50BA, - 0x50BD,0x50C0,0x50C3,0x50C4,0x50C7,0x50CC,0x50CE,0x50D0, - 0x50D3,0x50D4,0x50D8,0x50DC,0x50DD,0x50DF,0x50E2,0x50E4, - 0x50E6,0x50E8,0x50E9,0x50EF,0x50F1,0x50F6,0x50FA,0x50FE, - 0x5103,0x5106,0x5107,0x5108,0x510B,0x510C,0x510D,0x510E, - 0x50F2,0x5110,0x5117,0x5119,0x511B,0x511C,0x511D,0x511E, - 0x5123,0x5127,0x5128,0x512C,0x512D,0x512F,0x5131,0x5133, - 0x5134,0x5135,0x5138,0x5139,0x5142,0x514A,0x514F,0x5153, - 0x5155,0x5157,0x5158,0x515F,0x5164,0x5166,0x517E,0x5183, - 0x5184,0x518B,0x518E,0x5198,0x519D,0x51A1,0x51A3,0x51AD, - 0x51B8,0x51BA,0x51BC,0x51BE,0x51BF,0x51C2, - - /* ku 19 */ - 0x51C8,0x51CF,0x51D1,0x51D2,0x51D3,0x51D5,0x51D8,0x51DE, - 0x51E2,0x51E5,0x51EE,0x51F2,0x51F3,0x51F4,0x51F7,0x5201, - 0x5202,0x5205,0x5212,0x5213,0x5215,0x5216,0x5218,0x5222, - 0x5228,0x5231,0x5232,0x5235,0x523C,0x5245,0x5249,0x5255, - 0x5257,0x5258,0x525A,0x525C,0x525F,0x5260,0x5261,0x5266, - 0x526E,0x5277,0x5278,0x5279,0x5280,0x5282,0x5285,0x528A, - 0x528C,0x5293,0x5295,0x5296,0x5297,0x5298,0x529A,0x529C, - 0x52A4,0x52A5,0x52A6,0x52A7,0x52AF,0x52B0,0x52B6,0x52B7, - 0x52B8,0x52BA,0x52BB,0x52BD,0x52C0,0x52C4,0x52C6,0x52C8, - 0x52CC,0x52CF,0x52D1,0x52D4,0x52D6,0x52DB,0x52DC,0x52E1, - 0x52E5,0x52E8,0x52E9,0x52EA,0x52EC,0x52F0,0x52F1,0x52F4, - 0x52F6,0x52F7,0x5300,0x5303,0x530A,0x530B, - - /* ku 20 */ - 0x530C,0x5311,0x5313,0x5318,0x531B,0x531C,0x531E,0x531F, - 0x5325,0x5327,0x5328,0x5329,0x532B,0x532C,0x532D,0x5330, - 0x5332,0x5335,0x533C,0x533D,0x533E,0x5342,0x534C,0x534B, - 0x5359,0x535B,0x5361,0x5363,0x5365,0x536C,0x536D,0x5372, - 0x5379,0x537E,0x5383,0x5387,0x5388,0x538E,0x5393,0x5394, - 0x5399,0x539D,0x53A1,0x53A4,0x53AA,0x53AB,0x53AF,0x53B2, - 0x53B4,0x53B5,0x53B7,0x53B8,0x53BA,0x53BD,0x53C0,0x53C5, - 0x53CF,0x53D2,0x53D3,0x53D5,0x53DA,0x53DD,0x53DE,0x53E0, - 0x53E6,0x53E7,0x53F5,0x5402,0x5413,0x541A,0x5421,0x5427, - 0x5428,0x542A,0x542F,0x5431,0x5434,0x5435,0x5443,0x5444, - 0x5447,0x544D,0x544F,0x545E,0x5462,0x5464,0x5466,0x5467, - 0x5469,0x546B,0x546D,0x546E,0x5474,0x547F, - - /* ku 21 */ - 0x5481,0x5483,0x5485,0x5488,0x5489,0x548D,0x5491,0x5495, - 0x5496,0x549C,0x549F,0x54A1,0x54A6,0x54A7,0x54A9,0x54AA, - 0x54AD,0x54AE,0x54B1,0x54B7,0x54B9,0x54BA,0x54BB,0x54BF, - 0x54C6,0x54CA,0x54CD,0x54CE,0x54E0,0x54EA,0x54EC,0x54EF, - 0x54F6,0x54FC,0x54FE,0x54FF,0x5500,0x5501,0x5505,0x5508, - 0x5509,0x550C,0x550D,0x550E,0x5515,0x552A,0x552B,0x5532, - 0x5535,0x5536,0x553B,0x553C,0x553D,0x5541,0x5547,0x5549, - 0x554A,0x554D,0x5550,0x5551,0x5558,0x555A,0x555B,0x555E, - 0x5560,0x5561,0x5564,0x5566,0x557F,0x5581,0x5582,0x5586, - 0x5588,0x558E,0x558F,0x5591,0x5592,0x5593,0x5594,0x5597, - 0x55A3,0x55A4,0x55AD,0x55B2,0x55BF,0x55C1,0x55C3,0x55C6, - 0x55C9,0x55CB,0x55CC,0x55CE,0x55D1,0x55D2, - - /* ku 22 */ - 0x55D3,0x55D7,0x55D8,0x55DB,0x55DE,0x55E2,0x55E9,0x55F6, - 0x55FF,0x5605,0x5608,0x560A,0x560D,0x560E,0x560F,0x5610, - 0x5611,0x5612,0x5619,0x562C,0x5630,0x5633,0x5635,0x5637, - 0x5639,0x563B,0x563C,0x563D,0x563F,0x5640,0x5641,0x5643, - 0x5644,0x5646,0x5649,0x564B,0x564D,0x564F,0x5654,0x565E, - 0x5660,0x5661,0x5662,0x5663,0x5666,0x5669,0x566D,0x566F, - 0x5671,0x5672,0x5675,0x5684,0x5685,0x5688,0x568B,0x568C, - 0x5695,0x5699,0x569A,0x569D,0x569E,0x569F,0x56A6,0x56A7, - 0x56A8,0x56A9,0x56AB,0x56AC,0x56AD,0x56B1,0x56B3,0x56B7, - 0x56BE,0x56C5,0x56C9,0x56CA,0x56CB,0x56CF,0x56D0,0x56CC, - 0x56CD,0x56D9,0x56DC,0x56DD,0x56DF,0x56E1,0x56E4,0x56E5, - 0x56E6,0x56E7,0x56E8,0x56F1,0x56EB,0x56ED, - - /* ku 23 */ - 0x56F6,0x56F7,0x5701,0x5702,0x5707,0x570A,0x570C,0x5711, - 0x5715,0x571A,0x571B,0x571D,0x5720,0x5722,0x5723,0x5724, - 0x5725,0x5729,0x572A,0x572C,0x572E,0x572F,0x5733,0x5734, - 0x573D,0x573E,0x573F,0x5745,0x5746,0x574C,0x574D,0x5752, - 0x5762,0x5765,0x5767,0x5768,0x576B,0x576D,0x576E,0x576F, - 0x5770,0x5771,0x5773,0x5774,0x5775,0x5777,0x5779,0x577A, - 0x577B,0x577C,0x577E,0x5781,0x5783,0x578C,0x5794,0x5797, - 0x5799,0x579A,0x579C,0x579D,0x579E,0x579F,0x57A1,0x5795, - 0x57A7,0x57A8,0x57A9,0x57AC,0x57B8,0x57BD,0x57C7,0x57C8, - 0x57CC,0x57CF,0x57D5,0x57DD,0x57DE,0x57E4,0x57E6,0x57E7, - 0x57E9,0x57ED,0x57F0,0x57F5,0x57F6,0x57F8,0x57FD,0x57FE, - 0x57FF,0x5803,0x5804,0x5808,0x5809,0x57E1, - - /* ku 24 */ - 0x580C,0x580D,0x581B,0x581E,0x581F,0x5820,0x5826,0x5827, - 0x582D,0x5832,0x5839,0x583F,0x5849,0x584C,0x584D,0x584F, - 0x5850,0x5855,0x585F,0x5861,0x5864,0x5867,0x5868,0x5878, - 0x587C,0x587F,0x5880,0x5881,0x5887,0x5888,0x5889,0x588A, - 0x588C,0x588D,0x588F,0x5890,0x5894,0x5896,0x589D,0x58A0, - 0x58A1,0x58A2,0x58A6,0x58A9,0x58B1,0x58B2,0x58C4,0x58BC, - 0x58C2,0x58C8,0x58CD,0x58CE,0x58D0,0x58D2,0x58D4,0x58D6, - 0x58DA,0x58DD,0x58E1,0x58E2,0x58E9,0x58F3,0x5905,0x5906, - 0x590B,0x590C,0x5912,0x5913,0x5914,0x8641,0x591D,0x5921, - 0x5923,0x5924,0x5928,0x592F,0x5930,0x5933,0x5935,0x5936, - 0x593F,0x5943,0x5946,0x5952,0x5953,0x5959,0x595B,0x595D, - 0x595E,0x595F,0x5961,0x5963,0x596B,0x596D, - - /* ku 25 */ - 0x596F,0x5972,0x5975,0x5976,0x5979,0x597B,0x597C,0x598B, - 0x598C,0x598E,0x5992,0x5995,0x5997,0x599F,0x59A4,0x59A7, - 0x59AD,0x59AE,0x59AF,0x59B0,0x59B3,0x59B7,0x59BA,0x59BC, - 0x59C1,0x59C3,0x59C4,0x59C8,0x59CA,0x59CD,0x59D2,0x59DD, - 0x59DE,0x59DF,0x59E3,0x59E4,0x59E7,0x59EE,0x59EF,0x59F1, - 0x59F2,0x59F4,0x59F7,0x5A00,0x5A04,0x5A0C,0x5A0D,0x5A0E, - 0x5A12,0x5A13,0x5A1E,0x5A23,0x5A24,0x5A27,0x5A28,0x5A2A, - 0x5A2D,0x5A30,0x5A44,0x5A45,0x5A47,0x5A48,0x5A4C,0x5A50, - 0x5A55,0x5A5E,0x5A63,0x5A65,0x5A67,0x5A6D,0x5A77,0x5A7A, - 0x5A7B,0x5A7E,0x5A8B,0x5A90,0x5A93,0x5A96,0x5A99,0x5A9C, - 0x5A9E,0x5A9F,0x5AA0,0x5AA2,0x5AA7,0x5AAC,0x5AB1,0x5AB2, - 0x5AB3,0x5AB5,0x5AB8,0x5ABA,0x5ABB,0x5ABF, - - /* ku 26 */ - 0x5AC4,0x5AC6,0x5AC8,0x5ACF,0x5ADA,0x5ADC,0x5AE0,0x5AE5, - 0x5AEA,0x5AEE,0x5AF5,0x5AF6,0x5AFD,0x5B00,0x5B01,0x5B08, - 0x5B17,0x5B34,0x5B19,0x5B1B,0x5B1D,0x5B21,0x5B25,0x5B2D, - 0x5B38,0x5B41,0x5B4B,0x5B4C,0x5B52,0x5B56,0x5B5E,0x5B68, - 0x5B6E,0x5B6F,0x5B7C,0x5B7D,0x5B7E,0x5B7F,0x5B81,0x5B84, - 0x5B86,0x5B8A,0x5B8E,0x5B90,0x5B91,0x5B93,0x5B94,0x5B96, - 0x5BA8,0x5BA9,0x5BAC,0x5BAD,0x5BAF,0x5BB1,0x5BB2,0x5BB7, - 0x5BBA,0x5BBC,0x5BC0,0x5BC1,0x5BCD,0x5BCF,0x5BD6,0x5BD7, - 0x5BD8,0x5BD9,0x5BDA,0x5BE0,0x5BEF,0x5BF1,0x5BF4,0x5BFD, - 0x5C0C,0x5C17,0x5C1E,0x5C1F,0x5C23,0x5C26,0x5C29,0x5C2B, - 0x5C2C,0x5C2E,0x5C30,0x5C32,0x5C35,0x5C36,0x5C59,0x5C5A, - 0x5C5C,0x5C62,0x5C63,0x5C67,0x5C68,0x5C69, - - /* ku 27 */ - 0x5C6D,0x5C70,0x5C74,0x5C75,0x5C7A,0x5C7B,0x5C7C,0x5C7D, - 0x5C87,0x5C88,0x5C8A,0x5C8F,0x5C92,0x5C9D,0x5C9F,0x5CA0, - 0x5CA2,0x5CA3,0x5CA6,0x5CAA,0x5CB2,0x5CB4,0x5CB5,0x5CBA, - 0x5CC9,0x5CCB,0x5CD2,0x5CDD,0x5CD7,0x5CEE,0x5CF1,0x5CF2, - 0x5CF4,0x5D01,0x5D06,0x5D0D,0x5D12,0x5D2B,0x5D23,0x5D24, - 0x5D26,0x5D27,0x5D31,0x5D34,0x5D39,0x5D3D,0x5D3F,0x5D42, - 0x5D43,0x5D46,0x5D48,0x5D55,0x5D51,0x5D59,0x5D4A,0x5D5F, - 0x5D60,0x5D61,0x5D62,0x5D64,0x5D6A,0x5D6D,0x5D70,0x5D79, - 0x5D7A,0x5D7E,0x5D7F,0x5D81,0x5D83,0x5D88,0x5D8A,0x5D92, - 0x5D93,0x5D94,0x5D95,0x5D99,0x5D9B,0x5D9F,0x5DA0,0x5DA7, - 0x5DAB,0x5DB0,0x5DB4,0x5DB8,0x5DB9,0x5DC3,0x5DC7,0x5DCB, - 0x5DD0,0x5DCE,0x5DD8,0x5DD9,0x5DE0,0x5DE4, - - /* ku 28 */ - 0x5DE9,0x5DF8,0x5DF9,0x5E00,0x5E07,0x5E0D,0x5E12,0x5E14, - 0x5E15,0x5E18,0x5E1F,0x5E20,0x5E2E,0x5E28,0x5E32,0x5E35, - 0x5E3E,0x5E4B,0x5E50,0x5E49,0x5E51,0x5E56,0x5E58,0x5E5B, - 0x5E5C,0x5E5E,0x5E68,0x5E6A,0x5E6B,0x5E6C,0x5E6D,0x5E6E, - 0x5E70,0x5E80,0x5E8B,0x5E8E,0x5EA2,0x5EA4,0x5EA5,0x5EA8, - 0x5EAA,0x5EAC,0x5EB1,0x5EB3,0x5EBD,0x5EBE,0x5EBF,0x5EC6, - 0x5ECC,0x5ECB,0x5ECE,0x5ED1,0x5ED2,0x5ED4,0x5ED5,0x5EDC, - 0x5EDE,0x5EE5,0x5EEB,0x5F02,0x5F06,0x5F07,0x5F08,0x5F0E, - 0x5F19,0x5F1C,0x5F1D,0x5F21,0x5F22,0x5F23,0x5F24,0x5F28, - 0x5F2B,0x5F2C,0x5F2E,0x5F30,0x5F34,0x5F36,0x5F3B,0x5F3D, - 0x5F3F,0x5F40,0x5F44,0x5F45,0x5F47,0x5F4D,0x5F50,0x5F54, - 0x5F58,0x5F5B,0x5F60,0x5F63,0x5F64,0x5F67, - - /* ku 29 */ - 0x5F6F,0x5F72,0x5F74,0x5F75,0x5F78,0x5F7A,0x5F7D,0x5F7E, - 0x5F89,0x5F8D,0x5F8F,0x5F96,0x5F9C,0x5F9D,0x5FA2,0x5FA7, - 0x5FAB,0x5FA4,0x5FAC,0x5FAF,0x5FB0,0x5FB1,0x5FB8,0x5FC4, - 0x5FC7,0x5FC8,0x5FC9,0x5FCB,0x5FD0,0x5FD1,0x5FD2,0x5FD3, - 0x5FD4,0x5FDE,0x5FE1,0x5FE2,0x5FE8,0x5FE9,0x5FEA,0x5FEC, - 0x5FED,0x5FEE,0x5FEF,0x5FF2,0x5FF3,0x5FF6,0x5FFA,0x5FFC, - 0x6007,0x600A,0x600D,0x6013,0x6014,0x6017,0x6018,0x601A, - 0x601F,0x6024,0x602D,0x6033,0x6035,0x6040,0x6047,0x6048, - 0x6049,0x604C,0x6051,0x6054,0x6056,0x6057,0x605D,0x6061, - 0x6067,0x6071,0x607E,0x607F,0x6082,0x6086,0x6088,0x608A, - 0x608E,0x6091,0x6093,0x6095,0x6098,0x609D,0x609E,0x60A2, - 0x60A4,0x60A5,0x60A8,0x60B0,0x60B1,0x60B7, - - /* ku 30 */ - 0x60BB,0x60BE,0x60C2,0x60C4,0x60C8,0x60C9,0x60CA,0x60CB, - 0x60CE,0x60CF,0x60D4,0x60D5,0x60D9,0x60DB,0x60DD,0x60DE, - 0x60E2,0x60E5,0x60F2,0x60F5,0x60F8,0x60FC,0x60FD,0x6102, - 0x6107,0x610A,0x610C,0x6110,0x6111,0x6112,0x6113,0x6114, - 0x6116,0x6117,0x6119,0x611C,0x611E,0x6122,0x612A,0x612B, - 0x6130,0x6131,0x6135,0x6136,0x6137,0x6139,0x6141,0x6145, - 0x6146,0x6149,0x615E,0x6160,0x616C,0x6172,0x6178,0x617B, - 0x617C,0x617F,0x6180,0x6181,0x6183,0x6184,0x618B,0x618D, - 0x6192,0x6193,0x6197,0x6198,0x619C,0x619D,0x619F,0x61A0, - 0x61A5,0x61A8,0x61AA,0x61AD,0x61B8,0x61B9,0x61BC,0x61C0, - 0x61C1,0x61C2,0x61CE,0x61CF,0x61D5,0x61DC,0x61DD,0x61DE, - 0x61DF,0x61E1,0x61E2,0x61E7,0x61E9,0x61E5, - - /* ku 31 */ - 0x61EC,0x61ED,0x61EF,0x6201,0x6203,0x6204,0x6207,0x6213, - 0x6215,0x621C,0x6220,0x6222,0x6223,0x6227,0x6229,0x622B, - 0x6239,0x623D,0x6242,0x6243,0x6244,0x6246,0x624C,0x6250, - 0x6251,0x6252,0x6254,0x6256,0x625A,0x625C,0x6264,0x626D, - 0x626F,0x6273,0x627A,0x627D,0x628D,0x628E,0x628F,0x6290, - 0x62A6,0x62A8,0x62B3,0x62B6,0x62B7,0x62BA,0x62BE,0x62BF, - 0x62C4,0x62CE,0x62D5,0x62D6,0x62DA,0x62EA,0x62F2,0x62F4, - 0x62FC,0x62FD,0x6303,0x6304,0x630A,0x630B,0x630D,0x6310, - 0x6313,0x6316,0x6318,0x6329,0x632A,0x632D,0x6335,0x6336, - 0x6339,0x633C,0x6341,0x6342,0x6343,0x6344,0x6346,0x634A, - 0x634B,0x634E,0x6352,0x6353,0x6354,0x6358,0x635B,0x6365, - 0x6366,0x636C,0x636D,0x6371,0x6374,0x6375, - - /* ku 32 */ - 0x6378,0x637C,0x637D,0x637F,0x6382,0x6384,0x6387,0x638A, - 0x6390,0x6394,0x6395,0x6399,0x639A,0x639E,0x63A4,0x63A6, - 0x63AD,0x63AE,0x63AF,0x63BD,0x63C1,0x63C5,0x63C8,0x63CE, - 0x63D1,0x63D3,0x63D4,0x63D5,0x63DC,0x63E0,0x63E5,0x63EA, - 0x63EC,0x63F2,0x63F3,0x63F5,0x63F8,0x63F9,0x6409,0x640A, - 0x6410,0x6412,0x6414,0x6418,0x641E,0x6420,0x6422,0x6424, - 0x6425,0x6429,0x642A,0x642F,0x6430,0x6435,0x643D,0x643F, - 0x644B,0x644F,0x6451,0x6452,0x6453,0x6454,0x645A,0x645B, - 0x645C,0x645D,0x645F,0x6460,0x6461,0x6463,0x646D,0x6473, - 0x6474,0x647B,0x647D,0x6485,0x6487,0x648F,0x6490,0x6491, - 0x6498,0x6499,0x649B,0x649D,0x649F,0x64A1,0x64A3,0x64A6, - 0x64A8,0x64AC,0x64B3,0x64BD,0x64BE,0x64BF, - - /* ku 33 */ - 0x64C4,0x64C9,0x64CA,0x64CB,0x64CC,0x64CE,0x64D0,0x64D1, - 0x64D5,0x64D7,0x64E4,0x64E5,0x64E9,0x64EA,0x64ED,0x64F0, - 0x64F5,0x64F7,0x64FB,0x64FF,0x6501,0x6504,0x6508,0x6509, - 0x650A,0x650F,0x6513,0x6514,0x6516,0x6519,0x651B,0x651E, - 0x651F,0x6522,0x6526,0x6529,0x652E,0x6531,0x653A,0x653C, - 0x653D,0x6543,0x6547,0x6549,0x6550,0x6552,0x6554,0x655F, - 0x6560,0x6567,0x656B,0x657A,0x657D,0x6581,0x6585,0x658A, - 0x6592,0x6595,0x6598,0x659D,0x65A0,0x65A3,0x65A6,0x65AE, - 0x65B2,0x65B3,0x65B4,0x65BF,0x65C2,0x65C8,0x65C9,0x65CE, - 0x65D0,0x65D4,0x65D6,0x65D8,0x65DF,0x65F0,0x65F2,0x65F4, - 0x65F5,0x65F9,0x65FE,0x65FF,0x6600,0x6604,0x6608,0x6609, - 0x660D,0x6611,0x6612,0x6615,0x6616,0x661D, - - /* ku 34 */ - 0x661E,0x6621,0x6622,0x6623,0x6624,0x6626,0x6629,0x662A, - 0x662B,0x662C,0x662E,0x6630,0x6631,0x6633,0x6639,0x6637, - 0x6640,0x6645,0x6646,0x664A,0x664C,0x6651,0x664E,0x6657, - 0x6658,0x6659,0x665B,0x665C,0x6660,0x6661,0x66FB,0x666A, - 0x666B,0x666C,0x667E,0x6673,0x6675,0x667F,0x6677,0x6678, - 0x6679,0x667B,0x6680,0x667C,0x668B,0x668C,0x668D,0x6690, - 0x6692,0x6699,0x669A,0x669B,0x669C,0x669F,0x66A0,0x66A4, - 0x66AD,0x66B1,0x66B2,0x66B5,0x66BB,0x66BF,0x66C0,0x66C2, - 0x66C3,0x66C8,0x66CC,0x66CE,0x66CF,0x66D4,0x66DB,0x66DF, - 0x66E8,0x66EB,0x66EC,0x66EE,0x66FA,0x6705,0x6707,0x670E, - 0x6713,0x6719,0x671C,0x6720,0x6722,0x6733,0x673E,0x6745, - 0x6747,0x6748,0x674C,0x6754,0x6755,0x675D, - - /* ku 35 */ - 0x6766,0x676C,0x676E,0x6774,0x6776,0x677B,0x6781,0x6784, - 0x678E,0x678F,0x6791,0x6793,0x6796,0x6798,0x6799,0x679B, - 0x67B0,0x67B1,0x67B2,0x67B5,0x67BB,0x67BC,0x67BD,0x67F9, - 0x67C0,0x67C2,0x67C3,0x67C5,0x67C8,0x67C9,0x67D2,0x67D7, - 0x67D9,0x67DC,0x67E1,0x67E6,0x67F0,0x67F2,0x67F6,0x67F7, - 0x6852,0x6814,0x6819,0x681D,0x681F,0x6828,0x6827,0x682C, - 0x682D,0x682F,0x6830,0x6831,0x6833,0x683B,0x683F,0x6844, - 0x6845,0x684A,0x684C,0x6855,0x6857,0x6858,0x685B,0x686B, - 0x686E,0x686F,0x6870,0x6871,0x6872,0x6875,0x6879,0x687A, - 0x687B,0x687C,0x6882,0x6884,0x6886,0x6888,0x6896,0x6898, - 0x689A,0x689C,0x68A1,0x68A3,0x68A5,0x68A9,0x68AA,0x68AE, - 0x68B2,0x68BB,0x68C5,0x68C8,0x68CC,0x68CF, - - /* ku 36 */ - 0x68D0,0x68D1,0x68D3,0x68D6,0x68D9,0x68DC,0x68DD,0x68E5, - 0x68E8,0x68EA,0x68EB,0x68EC,0x68ED,0x68F0,0x68F1,0x68F5, - 0x68F6,0x68FB,0x68FC,0x68FD,0x6906,0x6909,0x690A,0x6910, - 0x6911,0x6913,0x6916,0x6917,0x6931,0x6933,0x6935,0x6938, - 0x693B,0x6942,0x6945,0x6949,0x694E,0x6957,0x695B,0x6963, - 0x6964,0x6965,0x6966,0x6968,0x6969,0x696C,0x6970,0x6971, - 0x6972,0x697A,0x697B,0x697F,0x6980,0x698D,0x6992,0x6996, - 0x6998,0x69A1,0x69A5,0x69A6,0x69A8,0x69AB,0x69AD,0x69AF, - 0x69B7,0x69B8,0x69BA,0x69BC,0x69C5,0x69C8,0x69D1,0x69D6, - 0x69D7,0x69E2,0x69E5,0x69EE,0x69EF,0x69F1,0x69F3,0x69F5, - 0x69FE,0x6A00,0x6A01,0x6A03,0x6A0F,0x6A11,0x6A15,0x6A1A, - 0x6A1D,0x6A20,0x6A24,0x6A28,0x6A30,0x6A32, - - /* ku 37 */ - 0x6A34,0x6A37,0x6A3B,0x6A3E,0x6A3F,0x6A45,0x6A46,0x6A49, - 0x6A4A,0x6A4E,0x6A50,0x6A51,0x6A52,0x6A55,0x6A56,0x6A5B, - 0x6A64,0x6A67,0x6A6A,0x6A71,0x6A73,0x6A7E,0x6A81,0x6A83, - 0x6A86,0x6A87,0x6A89,0x6A8B,0x6A91,0x6A9B,0x6A9D,0x6A9E, - 0x6A9F,0x6AA5,0x6AAB,0x6AAF,0x6AB0,0x6AB1,0x6AB4,0x6ABD, - 0x6ABE,0x6ABF,0x6AC6,0x6AC9,0x6AC8,0x6ACC,0x6AD0,0x6AD4, - 0x6AD5,0x6AD6,0x6ADC,0x6ADD,0x6AE4,0x6AE7,0x6AEC,0x6AF0, - 0x6AF1,0x6AF2,0x6AFC,0x6AFD,0x6B02,0x6B03,0x6B06,0x6B07, - 0x6B09,0x6B0F,0x6B10,0x6B11,0x6B17,0x6B1B,0x6B1E,0x6B24, - 0x6B28,0x6B2B,0x6B2C,0x6B2F,0x6B35,0x6B36,0x6B3B,0x6B3F, - 0x6B46,0x6B4A,0x6B4D,0x6B52,0x6B56,0x6B58,0x6B5D,0x6B60, - 0x6B67,0x6B6B,0x6B6E,0x6B70,0x6B75,0x6B7D, - - /* ku 38 */ - 0x6B7E,0x6B82,0x6B85,0x6B97,0x6B9B,0x6B9F,0x6BA0,0x6BA2, - 0x6BA3,0x6BA8,0x6BA9,0x6BAC,0x6BAD,0x6BAE,0x6BB0,0x6BB8, - 0x6BB9,0x6BBD,0x6BBE,0x6BC3,0x6BC4,0x6BC9,0x6BCC,0x6BD6, - 0x6BDA,0x6BE1,0x6BE3,0x6BE6,0x6BE7,0x6BEE,0x6BF1,0x6BF7, - 0x6BF9,0x6BFF,0x6C02,0x6C04,0x6C05,0x6C09,0x6C0D,0x6C0E, - 0x6C10,0x6C12,0x6C19,0x6C1F,0x6C26,0x6C27,0x6C28,0x6C2C, - 0x6C2E,0x6C33,0x6C35,0x6C36,0x6C3A,0x6C3B,0x6C3F,0x6C4A, - 0x6C4B,0x6C4D,0x6C4F,0x6C52,0x6C54,0x6C59,0x6C5B,0x6C5C, - 0x6C6B,0x6C6D,0x6C6F,0x6C74,0x6C76,0x6C78,0x6C79,0x6C7B, - 0x6C85,0x6C86,0x6C87,0x6C89,0x6C94,0x6C95,0x6C97,0x6C98, - 0x6C9C,0x6C9F,0x6CB0,0x6CB2,0x6CB4,0x6CC2,0x6CC6,0x6CCD, - 0x6CCF,0x6CD0,0x6CD1,0x6CD2,0x6CD4,0x6CD6, - - /* ku 39 */ - 0x6CDA,0x6CDC,0x6CE0,0x6CE7,0x6CE9,0x6CEB,0x6CEC,0x6CEE, - 0x6CF2,0x6CF4,0x6D04,0x6D07,0x6D0A,0x6D0E,0x6D0F,0x6D11, - 0x6D13,0x6D1A,0x6D26,0x6D27,0x6D28,0x6C67,0x6D2E,0x6D2F, - 0x6D31,0x6D39,0x6D3C,0x6D3F,0x6D57,0x6D5E,0x6D5F,0x6D61, - 0x6D65,0x6D67,0x6D6F,0x6D70,0x6D7C,0x6D82,0x6D87,0x6D91, - 0x6D92,0x6D94,0x6D96,0x6D97,0x6D98,0x6DAA,0x6DAC,0x6DB4, - 0x6DB7,0x6DB9,0x6DBD,0x6DBF,0x6DC4,0x6DC8,0x6DCA,0x6DCE, - 0x6DCF,0x6DD6,0x6DDB,0x6DDD,0x6DDF,0x6DE0,0x6DE2,0x6DE5, - 0x6DE9,0x6DEF,0x6DF0,0x6DF4,0x6DF6,0x6DFC,0x6E00,0x6E04, - 0x6E1E,0x6E22,0x6E27,0x6E32,0x6E36,0x6E39,0x6E3B,0x6E3C, - 0x6E44,0x6E45,0x6E48,0x6E49,0x6E4B,0x6E4F,0x6E51,0x6E52, - 0x6E53,0x6E54,0x6E57,0x6E5C,0x6E5D,0x6E5E, - - /* ku 40 */ - 0x6E62,0x6E63,0x6E68,0x6E73,0x6E7B,0x6E7D,0x6E8D,0x6E93, - 0x6E99,0x6EA0,0x6EA7,0x6EAD,0x6EAE,0x6EB1,0x6EB3,0x6EBB, - 0x6EBF,0x6EC0,0x6EC1,0x6EC3,0x6EC7,0x6EC8,0x6ECA,0x6ECD, - 0x6ECE,0x6ECF,0x6EEB,0x6EED,0x6EEE,0x6EF9,0x6EFB,0x6EFD, - 0x6F04,0x6F08,0x6F0A,0x6F0C,0x6F0D,0x6F16,0x6F18,0x6F1A, - 0x6F1B,0x6F26,0x6F29,0x6F2A,0x6F2F,0x6F30,0x6F33,0x6F36, - 0x6F3B,0x6F3C,0x6F2D,0x6F4F,0x6F51,0x6F52,0x6F53,0x6F57, - 0x6F59,0x6F5A,0x6F5D,0x6F5E,0x6F61,0x6F62,0x6F68,0x6F6C, - 0x6F7D,0x6F7E,0x6F83,0x6F87,0x6F88,0x6F8B,0x6F8C,0x6F8D, - 0x6F90,0x6F92,0x6F93,0x6F94,0x6F96,0x6F9A,0x6F9F,0x6FA0, - 0x6FA5,0x6FA6,0x6FA7,0x6FA8,0x6FAE,0x6FAF,0x6FB0,0x6FB5, - 0x6FB6,0x6FBC,0x6FC5,0x6FC7,0x6FC8,0x6FCA, - - /* ku 41 */ - 0x6FDA,0x6FDE,0x6FE8,0x6FE9,0x6FF0,0x6FF5,0x6FF9,0x6FFC, - 0x6FFD,0x7000,0x7005,0x7006,0x7007,0x700D,0x7017,0x7020, - 0x7023,0x702F,0x7034,0x7037,0x7039,0x703C,0x7043,0x7044, - 0x7048,0x7049,0x704A,0x704B,0x7054,0x7055,0x705D,0x705E, - 0x704E,0x7064,0x7065,0x706C,0x706E,0x7075,0x7076,0x707E, - 0x7081,0x7085,0x7086,0x7094,0x7095,0x7096,0x7097,0x7098, - 0x709B,0x70A4,0x70AB,0x70B0,0x70B1,0x70B4,0x70B7,0x70CA, - 0x70D1,0x70D3,0x70D4,0x70D5,0x70D6,0x70D8,0x70DC,0x70E4, - 0x70FA,0x7103,0x7104,0x7105,0x7106,0x7107,0x710B,0x710C, - 0x710F,0x711E,0x7120,0x712B,0x712D,0x712F,0x7130,0x7131, - 0x7138,0x7141,0x7145,0x7146,0x7147,0x714A,0x714B,0x7150, - 0x7152,0x7157,0x715A,0x715C,0x715E,0x7160, - - /* ku 42 */ - 0x7168,0x7179,0x7180,0x7185,0x7187,0x718C,0x7192,0x719A, - 0x719B,0x71A0,0x71A2,0x71AF,0x71B0,0x71B2,0x71B3,0x71BA, - 0x71BF,0x71C0,0x71C1,0x71C4,0x71CB,0x71CC,0x71D3,0x71D6, - 0x71D9,0x71DA,0x71DC,0x71F8,0x71FE,0x7200,0x7207,0x7208, - 0x7209,0x7213,0x7217,0x721A,0x721D,0x721F,0x7224,0x722B, - 0x722F,0x7234,0x7238,0x7239,0x7241,0x7242,0x7243,0x7245, - 0x724E,0x724F,0x7250,0x7253,0x7255,0x7256,0x725A,0x725C, - 0x725E,0x7260,0x7263,0x7268,0x726B,0x726E,0x726F,0x7271, - 0x7277,0x7278,0x727B,0x727C,0x727F,0x7284,0x7289,0x728D, - 0x728E,0x7293,0x729B,0x72A8,0x72AD,0x72AE,0x72B1,0x72B4, - 0x72BE,0x72C1,0x72C7,0x72C9,0x72CC,0x72D5,0x72D6,0x72D8, - 0x72DF,0x72E5,0x72F3,0x72F4,0x72FA,0x72FB, - - /* ku 43 */ - 0x72FE,0x7302,0x7304,0x7305,0x7307,0x730B,0x730D,0x7312, - 0x7313,0x7318,0x7319,0x731E,0x7322,0x7324,0x7327,0x7328, - 0x732C,0x7331,0x7332,0x7335,0x733A,0x733B,0x733D,0x7343, - 0x734D,0x7350,0x7352,0x7356,0x7358,0x735D,0x735E,0x735F, - 0x7360,0x7366,0x7367,0x7369,0x736B,0x736C,0x736E,0x736F, - 0x7371,0x7377,0x7379,0x737C,0x7380,0x7381,0x7383,0x7385, - 0x7386,0x738E,0x7390,0x7393,0x7395,0x7397,0x7398,0x739C, - 0x739E,0x739F,0x73A0,0x73A2,0x73A5,0x73A6,0x73AA,0x73AB, - 0x73AD,0x73B5,0x73B7,0x73B9,0x73BC,0x73BD,0x73BF,0x73C5, - 0x73C6,0x73C9,0x73CB,0x73CC,0x73CF,0x73D2,0x73D3,0x73D6, - 0x73D9,0x73DD,0x73E1,0x73E3,0x73E6,0x73E7,0x73E9,0x73F4, - 0x73F5,0x73F7,0x73F9,0x73FA,0x73FB,0x73FD, - - /* ku 44 */ - 0x73FF,0x7400,0x7401,0x7404,0x7407,0x740A,0x7411,0x741A, - 0x741B,0x7424,0x7426,0x7428,0x7429,0x742A,0x742B,0x742C, - 0x742D,0x742E,0x742F,0x7430,0x7431,0x7439,0x7440,0x7443, - 0x7444,0x7446,0x7447,0x744B,0x744D,0x7451,0x7452,0x7457, - 0x745D,0x7462,0x7466,0x7467,0x7468,0x746B,0x746D,0x746E, - 0x7471,0x7472,0x7480,0x7481,0x7485,0x7486,0x7487,0x7489, - 0x748F,0x7490,0x7491,0x7492,0x7498,0x7499,0x749A,0x749C, - 0x749F,0x74A0,0x74A1,0x74A3,0x74A6,0x74A8,0x74A9,0x74AA, - 0x74AB,0x74AE,0x74AF,0x74B1,0x74B2,0x74B5,0x74B9,0x74BB, - 0x74BF,0x74C8,0x74C9,0x74CC,0x74D0,0x74D3,0x74D8,0x74DA, - 0x74DB,0x74DE,0x74DF,0x74E4,0x74E8,0x74EA,0x74EB,0x74EF, - 0x74F4,0x74FA,0x74FB,0x74FC,0x74FF,0x7506, - - /* ku 45 */ - 0x7512,0x7516,0x7517,0x7520,0x7521,0x7524,0x7527,0x7529, - 0x752A,0x752F,0x7536,0x7539,0x753D,0x753E,0x753F,0x7540, - 0x7543,0x7547,0x7548,0x754E,0x7550,0x7552,0x7557,0x755E, - 0x755F,0x7561,0x756F,0x7571,0x7579,0x757A,0x757B,0x757C, - 0x757D,0x757E,0x7581,0x7585,0x7590,0x7592,0x7593,0x7595, - 0x7599,0x759C,0x75A2,0x75A4,0x75B4,0x75BA,0x75BF,0x75C0, - 0x75C1,0x75C4,0x75C6,0x75CC,0x75CE,0x75CF,0x75D7,0x75DC, - 0x75DF,0x75E0,0x75E1,0x75E4,0x75E7,0x75EC,0x75EE,0x75EF, - 0x75F1,0x75F9,0x7600,0x7602,0x7603,0x7604,0x7607,0x7608, - 0x760A,0x760C,0x760F,0x7612,0x7613,0x7615,0x7616,0x7619, - 0x761B,0x761C,0x761D,0x761E,0x7623,0x7625,0x7626,0x7629, - 0x762D,0x7632,0x7633,0x7635,0x7638,0x7639, - - /* ku 46 */ - 0x763A,0x763C,0x764A,0x7640,0x7641,0x7643,0x7644,0x7645, - 0x7649,0x764B,0x7655,0x7659,0x765F,0x7664,0x7665,0x766D, - 0x766E,0x766F,0x7671,0x7674,0x7681,0x7685,0x768C,0x768D, - 0x7695,0x769B,0x769C,0x769D,0x769F,0x76A0,0x76A2,0x76A3, - 0x76A4,0x76A5,0x76A6,0x76A7,0x76A8,0x76AA,0x76AD,0x76BD, - 0x76C1,0x76C5,0x76C9,0x76CB,0x76CC,0x76CE,0x76D4,0x76D9, - 0x76E0,0x76E6,0x76E8,0x76EC,0x76F0,0x76F1,0x76F6,0x76F9, - 0x76FC,0x7700,0x7706,0x770A,0x770E,0x7712,0x7714,0x7715, - 0x7717,0x7719,0x771A,0x771C,0x7722,0x7728,0x772D,0x772E, - 0x772F,0x7734,0x7735,0x7736,0x7739,0x773D,0x773E,0x7742, - 0x7745,0x7746,0x774A,0x774D,0x774E,0x774F,0x7752,0x7756, - 0x7757,0x775C,0x775E,0x775F,0x7760,0x7762, - - /* ku 47 */ - 0x7764,0x7767,0x776A,0x776C,0x7770,0x7772,0x7773,0x7774, - 0x777A,0x777D,0x7780,0x7784,0x778C,0x778D,0x7794,0x7795, - 0x7796,0x779A,0x779F,0x77A2,0x77A7,0x77AA,0x77AE,0x77AF, - 0x77B1,0x77B5,0x77BE,0x77C3,0x77C9,0x77D1,0x77D2,0x77D5, - 0x77D9,0x77DE,0x77DF,0x77E0,0x77E4,0x77E6,0x77EA,0x77EC, - 0x77F0,0x77F1,0x77F4,0x77F8,0x77FB,0x7805,0x7806,0x7809, - 0x780D,0x780E,0x7811,0x781D,0x7821,0x7822,0x7823,0x782D, - 0x782E,0x7830,0x7835,0x7837,0x7843,0x7844,0x7847,0x7848, - 0x784C,0x784E,0x7852,0x785C,0x785E,0x7860,0x7861,0x7863, - 0x7864,0x7868,0x786A,0x786E,0x787A,0x787E,0x788A,0x788F, - 0x7894,0x7898,0x78A1,0x789D,0x789E,0x789F,0x78A4,0x78A8, - 0x78AC,0x78AD,0x78B0,0x78B1,0x78B2,0x78B3, - - /* ku 48 */ - 0x78BB,0x78BD,0x78BF,0x78C7,0x78C8,0x78C9,0x78CC,0x78CE, - 0x78D2,0x78D3,0x78D5,0x78D6,0x78E4,0x78DB,0x78DF,0x78E0, - 0x78E1,0x78E6,0x78EA,0x78F2,0x78F3,0x7900,0x78F6,0x78F7, - 0x78FA,0x78FB,0x78FF,0x7906,0x790C,0x7910,0x791A,0x791C, - 0x791E,0x791F,0x7920,0x7925,0x7927,0x7929,0x792D,0x7931, - 0x7934,0x7935,0x793B,0x793D,0x793F,0x7944,0x7945,0x7946, - 0x794A,0x794B,0x794F,0x7951,0x7954,0x7958,0x795B,0x795C, - 0x7967,0x7969,0x796B,0x7972,0x7979,0x797B,0x797C,0x797E, - 0x798B,0x798C,0x7991,0x7993,0x7994,0x7995,0x7996,0x7998, - 0x799B,0x799C,0x79A1,0x79A8,0x79A9,0x79AB,0x79AF,0x79B1, - 0x79B4,0x79B8,0x79BB,0x79C2,0x79C4,0x79C7,0x79C8,0x79CA, - 0x79CF,0x79D4,0x79D6,0x79DA,0x79DD,0x79DE, - - /* ku 49 */ - 0x79E0,0x79E2,0x79E5,0x79EA,0x79EB,0x79ED,0x79F1,0x79F8, - 0x79FC,0x7A02,0x7A03,0x7A07,0x7A09,0x7A0A,0x7A0C,0x7A11, - 0x7A15,0x7A1B,0x7A1E,0x7A21,0x7A27,0x7A2B,0x7A2D,0x7A2F, - 0x7A30,0x7A34,0x7A35,0x7A38,0x7A39,0x7A3A,0x7A44,0x7A45, - 0x7A47,0x7A48,0x7A4C,0x7A55,0x7A56,0x7A59,0x7A5C,0x7A5D, - 0x7A5F,0x7A60,0x7A65,0x7A67,0x7A6A,0x7A6D,0x7A75,0x7A78, - 0x7A7E,0x7A80,0x7A82,0x7A85,0x7A86,0x7A8A,0x7A8B,0x7A90, - 0x7A91,0x7A94,0x7A9E,0x7AA0,0x7AA3,0x7AAC,0x7AB3,0x7AB5, - 0x7AB9,0x7ABB,0x7ABC,0x7AC6,0x7AC9,0x7ACC,0x7ACE,0x7AD1, - 0x7ADB,0x7AE8,0x7AE9,0x7AEB,0x7AEC,0x7AF1,0x7AF4,0x7AFB, - 0x7AFD,0x7AFE,0x7B07,0x7B14,0x7B1F,0x7B23,0x7B27,0x7B29, - 0x7B2A,0x7B2B,0x7B2D,0x7B2E,0x7B2F,0x7B30, - - /* ku 50 */ - 0x7B31,0x7B34,0x7B3D,0x7B3F,0x7B40,0x7B41,0x7B47,0x7B4E, - 0x7B55,0x7B60,0x7B64,0x7B66,0x7B69,0x7B6A,0x7B6D,0x7B6F, - 0x7B72,0x7B73,0x7B77,0x7B84,0x7B89,0x7B8E,0x7B90,0x7B91, - 0x7B96,0x7B9B,0x7B9E,0x7BA0,0x7BA5,0x7BAC,0x7BAF,0x7BB0, - 0x7BB2,0x7BB5,0x7BB6,0x7BBA,0x7BBB,0x7BBC,0x7BBD,0x7BC2, - 0x7BC5,0x7BC8,0x7BCA,0x7BD4,0x7BD6,0x7BD7,0x7BD9,0x7BDA, - 0x7BDB,0x7BE8,0x7BEA,0x7BF2,0x7BF4,0x7BF5,0x7BF8,0x7BF9, - 0x7BFA,0x7BFC,0x7BFE,0x7C01,0x7C02,0x7C03,0x7C04,0x7C06, - 0x7C09,0x7C0B,0x7C0C,0x7C0E,0x7C0F,0x7C19,0x7C1B,0x7C20, - 0x7C25,0x7C26,0x7C28,0x7C2C,0x7C31,0x7C33,0x7C34,0x7C36, - 0x7C39,0x7C3A,0x7C46,0x7C4A,0x7C55,0x7C51,0x7C52,0x7C53, - 0x7C59,0x7C5A,0x7C5B,0x7C5C,0x7C5D,0x7C5E, - - /* ku 51 */ - 0x7C61,0x7C63,0x7C67,0x7C69,0x7C6D,0x7C6E,0x7C70,0x7C72, - 0x7C79,0x7C7C,0x7C7D,0x7C86,0x7C87,0x7C8F,0x7C94,0x7C9E, - 0x7CA0,0x7CA6,0x7CB0,0x7CB6,0x7CB7,0x7CBA,0x7CBB,0x7CBC, - 0x7CBF,0x7CC4,0x7CC7,0x7CC8,0x7CC9,0x7CCD,0x7CCF,0x7CD3, - 0x7CD4,0x7CD5,0x7CD7,0x7CD9,0x7CDA,0x7CDD,0x7CE6,0x7CE9, - 0x7CEB,0x7CF5,0x7D03,0x7D07,0x7D08,0x7D09,0x7D0F,0x7D11, - 0x7D12,0x7D13,0x7D16,0x7D1D,0x7D1E,0x7D23,0x7D26,0x7D2A, - 0x7D2D,0x7D31,0x7D3C,0x7D3D,0x7D3E,0x7D40,0x7D41,0x7D47, - 0x7D48,0x7D4D,0x7D51,0x7D53,0x7D57,0x7D59,0x7D5A,0x7D5C, - 0x7D5D,0x7D65,0x7D67,0x7D6A,0x7D70,0x7D78,0x7D7A,0x7D7B, - 0x7D7F,0x7D81,0x7D82,0x7D83,0x7D85,0x7D86,0x7D88,0x7D8B, - 0x7D8C,0x7D8D,0x7D91,0x7D96,0x7D97,0x7D9D, - - /* ku 52 */ - 0x7D9E,0x7DA6,0x7DA7,0x7DAA,0x7DB3,0x7DB6,0x7DB7,0x7DB9, - 0x7DC2,0x7DC3,0x7DC4,0x7DC5,0x7DC6,0x7DCC,0x7DCD,0x7DCE, - 0x7DD7,0x7DD9,0x7E00,0x7DE2,0x7DE5,0x7DE6,0x7DEA,0x7DEB, - 0x7DED,0x7DF1,0x7DF5,0x7DF6,0x7DF9,0x7DFA,0x7E08,0x7E10, - 0x7E11,0x7E15,0x7E17,0x7E1C,0x7E1D,0x7E20,0x7E27,0x7E28, - 0x7E2C,0x7E2D,0x7E2F,0x7E33,0x7E36,0x7E3F,0x7E44,0x7E45, - 0x7E47,0x7E4E,0x7E50,0x7E52,0x7E58,0x7E5F,0x7E61,0x7E62, - 0x7E65,0x7E6B,0x7E6E,0x7E6F,0x7E73,0x7E78,0x7E7E,0x7E81, - 0x7E86,0x7E87,0x7E8A,0x7E8D,0x7E91,0x7E95,0x7E98,0x7E9A, - 0x7E9D,0x7E9E,0x7F3C,0x7F3B,0x7F3D,0x7F3E,0x7F3F,0x7F43, - 0x7F44,0x7F47,0x7F4F,0x7F52,0x7F53,0x7F5B,0x7F5C,0x7F5D, - 0x7F61,0x7F63,0x7F64,0x7F65,0x7F66,0x7F6D, - - /* ku 53 */ - 0x7F71,0x7F7D,0x7F7E,0x7F7F,0x7F80,0x7F8B,0x7F8D,0x7F8F, - 0x7F90,0x7F91,0x7F96,0x7F97,0x7F9C,0x7FA1,0x7FA2,0x7FA6, - 0x7FAA,0x7FAD,0x7FB4,0x7FBC,0x7FBF,0x7FC0,0x7FC3,0x7FC8, - 0x7FCE,0x7FCF,0x7FDB,0x7FDF,0x7FE3,0x7FE5,0x7FE8,0x7FEC, - 0x7FEE,0x7FEF,0x7FF2,0x7FFA,0x7FFD,0x7FFE,0x7FFF,0x8007, - 0x8008,0x800A,0x800D,0x800E,0x800F,0x8011,0x8013,0x8014, - 0x8016,0x801D,0x801E,0x801F,0x8020,0x8024,0x8026,0x802C, - 0x802E,0x8030,0x8034,0x8035,0x8037,0x8039,0x803A,0x803C, - 0x803E,0x8040,0x8044,0x8060,0x8064,0x8066,0x806D,0x8071, - 0x8075,0x8081,0x8088,0x808E,0x809C,0x809E,0x80A6,0x80A7, - 0x80AB,0x80B8,0x80B9,0x80C8,0x80CD,0x80CF,0x80D2,0x80D4, - 0x80D5,0x80D7,0x80D8,0x80E0,0x80ED,0x80EE, - - /* ku 54 */ - 0x80F0,0x80F2,0x80F3,0x80F6,0x80F9,0x80FA,0x80FE,0x8103, - 0x810B,0x8116,0x8117,0x8118,0x811C,0x811E,0x8120,0x8124, - 0x8127,0x812C,0x8130,0x8135,0x813A,0x813C,0x8145,0x8147, - 0x814A,0x814C,0x8152,0x8157,0x8160,0x8161,0x8167,0x8168, - 0x8169,0x816D,0x816F,0x8177,0x8181,0x8190,0x8184,0x8185, - 0x8186,0x818B,0x818E,0x8196,0x8198,0x819B,0x819E,0x81A2, - 0x81AE,0x81B2,0x81B4,0x81BB,0x81CB,0x81C3,0x81C5,0x81CA, - 0x81CE,0x81CF,0x81D5,0x81D7,0x81DB,0x81DD,0x81DE,0x81E1, - 0x81E4,0x81EB,0x81EC,0x81F0,0x81F1,0x81F2,0x81F5,0x81F6, - 0x81F8,0x81F9,0x81FD,0x81FF,0x8200,0x8203,0x820F,0x8213, - 0x8214,0x8219,0x821A,0x821D,0x8221,0x8222,0x8228,0x8232, - 0x8234,0x823A,0x8243,0x8244,0x8245,0x8246, - - /* ku 55 */ - 0x824B,0x824E,0x824F,0x8251,0x8256,0x825C,0x8260,0x8263, - 0x8267,0x826D,0x8274,0x827B,0x827D,0x827F,0x8280,0x8281, - 0x8283,0x8284,0x8287,0x8289,0x828A,0x828E,0x8291,0x8294, - 0x8296,0x8298,0x829A,0x829B,0x82A0,0x82A1,0x82A3,0x82A4, - 0x82A7,0x82A8,0x82A9,0x82AA,0x82AE,0x82B0,0x82B2,0x82B4, - 0x82B7,0x82BA,0x82BC,0x82BE,0x82BF,0x82C6,0x82D0,0x82D5, - 0x82DA,0x82E0,0x82E2,0x82E4,0x82E8,0x82EA,0x82ED,0x82EF, - 0x82F6,0x82F7,0x82FD,0x82FE,0x8300,0x8301,0x8307,0x8308, - 0x830A,0x830B,0x8354,0x831B,0x831D,0x831E,0x831F,0x8321, - 0x8322,0x832C,0x832D,0x832E,0x8330,0x8333,0x8337,0x833A, - 0x833C,0x833D,0x8342,0x8343,0x8344,0x8347,0x834D,0x834E, - 0x8351,0x8355,0x8356,0x8357,0x8370,0x8378, - - /* ku 56 */ - 0x837D,0x837F,0x8380,0x8382,0x8384,0x8386,0x838D,0x8392, - 0x8394,0x8395,0x8398,0x8399,0x839B,0x839C,0x839D,0x83A6, - 0x83A7,0x83A9,0x83AC,0x83BE,0x83BF,0x83C0,0x83C7,0x83C9, - 0x83CF,0x83D0,0x83D1,0x83D4,0x83DD,0x8353,0x83E8,0x83EA, - 0x83F6,0x83F8,0x83F9,0x83FC,0x8401,0x8406,0x840A,0x840F, - 0x8411,0x8415,0x8419,0x83AD,0x842F,0x8439,0x8445,0x8447, - 0x8448,0x844A,0x844D,0x844F,0x8451,0x8452,0x8456,0x8458, - 0x8459,0x845A,0x845C,0x8460,0x8464,0x8465,0x8467,0x846A, - 0x8470,0x8473,0x8474,0x8476,0x8478,0x847C,0x847D,0x8481, - 0x8485,0x8492,0x8493,0x8495,0x849E,0x84A6,0x84A8,0x84A9, - 0x84AA,0x84AF,0x84B1,0x84B4,0x84BA,0x84BD,0x84BE,0x84C0, - 0x84C2,0x84C7,0x84C8,0x84CC,0x84CF,0x84D3, - - /* ku 57 */ - 0x84DC,0x84E7,0x84EA,0x84EF,0x84F0,0x84F1,0x84F2,0x84F7, - 0x8532,0x84FA,0x84FB,0x84FD,0x8502,0x8503,0x8507,0x850C, - 0x850E,0x8510,0x851C,0x851E,0x8522,0x8523,0x8524,0x8525, - 0x8527,0x852A,0x852B,0x852F,0x8533,0x8534,0x8536,0x853F, - 0x8546,0x854F,0x8550,0x8551,0x8552,0x8553,0x8556,0x8559, - 0x855C,0x855D,0x855E,0x855F,0x8560,0x8561,0x8562,0x8564, - 0x856B,0x856F,0x8579,0x857A,0x857B,0x857D,0x857F,0x8581, - 0x8585,0x8586,0x8589,0x858B,0x858C,0x858F,0x8593,0x8598, - 0x859D,0x859F,0x85A0,0x85A2,0x85A5,0x85A7,0x85B4,0x85B6, - 0x85B7,0x85B8,0x85BC,0x85BD,0x85BE,0x85BF,0x85C2,0x85C7, - 0x85CA,0x85CB,0x85CE,0x85AD,0x85D8,0x85DA,0x85DF,0x85E0, - 0x85E6,0x85E8,0x85ED,0x85F3,0x85F6,0x85FC, - - /* ku 58 */ - 0x85FF,0x8600,0x8604,0x8605,0x860D,0x860E,0x8610,0x8611, - 0x8612,0x8618,0x8619,0x861B,0x861E,0x8621,0x8627,0x8629, - 0x8636,0x8638,0x863A,0x863C,0x863D,0x8640,0x8642,0x8646, - 0x8652,0x8653,0x8656,0x8657,0x8658,0x8659,0x865D,0x8660, - 0x8661,0x8662,0x8663,0x8664,0x8669,0x866C,0x866F,0x8675, - 0x8676,0x8677,0x867A,0x868D,0x8691,0x8696,0x8698,0x869A, - 0x869C,0x86A1,0x86A6,0x86A7,0x86A8,0x86AD,0x86B1,0x86B3, - 0x86B4,0x86B5,0x86B7,0x86B8,0x86B9,0x86BF,0x86C0,0x86C1, - 0x86C3,0x86C5,0x86D1,0x86D2,0x86D5,0x86D7,0x86DA,0x86DC, - 0x86E0,0x86E3,0x86E5,0x86E7,0x8688,0x86FA,0x86FC,0x86FD, - 0x8704,0x8705,0x8707,0x870B,0x870E,0x870F,0x8710,0x8713, - 0x8714,0x8719,0x871E,0x871F,0x8721,0x8723, - - /* ku 59 */ - 0x8728,0x872E,0x872F,0x8731,0x8732,0x8739,0x873A,0x873C, - 0x873D,0x873E,0x8740,0x8743,0x8745,0x874D,0x8758,0x875D, - 0x8761,0x8764,0x8765,0x876F,0x8771,0x8772,0x877B,0x8783, - 0x8784,0x8785,0x8786,0x8787,0x8788,0x8789,0x878B,0x878C, - 0x8790,0x8793,0x8795,0x8797,0x8798,0x8799,0x879E,0x87A0, - 0x87A3,0x87A7,0x87AC,0x87AD,0x87AE,0x87B1,0x87B5,0x87BE, - 0x87BF,0x87C1,0x87C8,0x87C9,0x87CA,0x87CE,0x87D5,0x87D6, - 0x87D9,0x87DA,0x87DC,0x87DF,0x87E2,0x87E3,0x87E4,0x87EA, - 0x87EB,0x87ED,0x87F1,0x87F3,0x87F8,0x87FA,0x87FF,0x8801, - 0x8803,0x8806,0x8809,0x880A,0x880B,0x8810,0x8819,0x8812, - 0x8813,0x8814,0x8818,0x881A,0x881B,0x881C,0x881E,0x881F, - 0x8828,0x882D,0x882E,0x8830,0x8832,0x8835, - - /* ku 60 */ - 0x883A,0x883C,0x8841,0x8843,0x8845,0x8848,0x8849,0x884A, - 0x884B,0x884E,0x8851,0x8855,0x8856,0x8858,0x885A,0x885C, - 0x885F,0x8860,0x8864,0x8869,0x8871,0x8879,0x887B,0x8880, - 0x8898,0x889A,0x889B,0x889C,0x889F,0x88A0,0x88A8,0x88AA, - 0x88BA,0x88BD,0x88BE,0x88C0,0x88CA,0x88CB,0x88CC,0x88CD, - 0x88CE,0x88D1,0x88D2,0x88D3,0x88DB,0x88DE,0x88E7,0x88EF, - 0x88F0,0x88F1,0x88F5,0x88F7,0x8901,0x8906,0x890D,0x890E, - 0x890F,0x8915,0x8916,0x8918,0x8919,0x891A,0x891C,0x8920, - 0x8926,0x8927,0x8928,0x8930,0x8931,0x8932,0x8935,0x8939, - 0x893A,0x893E,0x8940,0x8942,0x8945,0x8946,0x8949,0x894F, - 0x8952,0x8957,0x895A,0x895B,0x895C,0x8961,0x8962,0x8963, - 0x896B,0x896E,0x8970,0x8973,0x8975,0x897A, - - /* ku 61 */ - 0x897B,0x897C,0x897D,0x8989,0x898D,0x8990,0x8994,0x8995, - 0x899B,0x899C,0x899F,0x89A0,0x89A5,0x89B0,0x89B4,0x89B5, - 0x89B6,0x89B7,0x89BC,0x89D4,0x89D5,0x89D6,0x89D7,0x89D8, - 0x89E5,0x89E9,0x89EB,0x89ED,0x89F1,0x89F3,0x89F6,0x89F9, - 0x89FD,0x89FF,0x8A04,0x8A05,0x8A07,0x8A0F,0x8A11,0x8A12, - 0x8A14,0x8A15,0x8A1E,0x8A20,0x8A22,0x8A24,0x8A26,0x8A2B, - 0x8A2C,0x8A2F,0x8A35,0x8A37,0x8A3D,0x8A3E,0x8A40,0x8A43, - 0x8A45,0x8A47,0x8A49,0x8A4D,0x8A4E,0x8A53,0x8A56,0x8A57, - 0x8A58,0x8A5C,0x8A5D,0x8A61,0x8A65,0x8A67,0x8A75,0x8A76, - 0x8A77,0x8A79,0x8A7A,0x8A7B,0x8A7E,0x8A7F,0x8A80,0x8A83, - 0x8A86,0x8A8B,0x8A8F,0x8A90,0x8A92,0x8A96,0x8A97,0x8A99, - 0x8A9F,0x8AA7,0x8AA9,0x8AAE,0x8AAF,0x8AB3, - - /* ku 62 */ - 0x8AB6,0x8AB7,0x8ABB,0x8ABE,0x8AC3,0x8AC6,0x8AC8,0x8AC9, - 0x8ACA,0x8AD1,0x8AD3,0x8AD4,0x8AD5,0x8AD7,0x8ADD,0x8ADF, - 0x8AEC,0x8AF0,0x8AF4,0x8AF5,0x8AF6,0x8AFC,0x8AFF,0x8B05, - 0x8B06,0x8B0B,0x8B11,0x8B1C,0x8B1E,0x8B1F,0x8B0A,0x8B2D, - 0x8B30,0x8B37,0x8B3C,0x8B42,0x8B43,0x8B44,0x8B45,0x8B46, - 0x8B48,0x8B52,0x8B53,0x8B54,0x8B59,0x8B4D,0x8B5E,0x8B63, - 0x8B6D,0x8B76,0x8B78,0x8B79,0x8B7C,0x8B7E,0x8B81,0x8B84, - 0x8B85,0x8B8B,0x8B8D,0x8B8F,0x8B94,0x8B95,0x8B9C,0x8B9E, - 0x8B9F,0x8C38,0x8C39,0x8C3D,0x8C3E,0x8C45,0x8C47,0x8C49, - 0x8C4B,0x8C4F,0x8C51,0x8C53,0x8C54,0x8C57,0x8C58,0x8C5B, - 0x8C5D,0x8C59,0x8C63,0x8C64,0x8C66,0x8C68,0x8C69,0x8C6D, - 0x8C73,0x8C75,0x8C76,0x8C7B,0x8C7E,0x8C86, - - /* ku 63 */ - 0x8C87,0x8C8B,0x8C90,0x8C92,0x8C93,0x8C99,0x8C9B,0x8C9C, - 0x8CA4,0x8CB9,0x8CBA,0x8CC5,0x8CC6,0x8CC9,0x8CCB,0x8CCF, - 0x8CD6,0x8CD5,0x8CD9,0x8CDD,0x8CE1,0x8CE8,0x8CEC,0x8CEF, - 0x8CF0,0x8CF2,0x8CF5,0x8CF7,0x8CF8,0x8CFE,0x8CFF,0x8D01, - 0x8D03,0x8D09,0x8D12,0x8D17,0x8D1B,0x8D65,0x8D69,0x8D6C, - 0x8D6E,0x8D7F,0x8D82,0x8D84,0x8D88,0x8D8D,0x8D90,0x8D91, - 0x8D95,0x8D9E,0x8D9F,0x8DA0,0x8DA6,0x8DAB,0x8DAC,0x8DAF, - 0x8DB2,0x8DB5,0x8DB7,0x8DB9,0x8DBB,0x8DC0,0x8DC5,0x8DC6, - 0x8DC7,0x8DC8,0x8DCA,0x8DCE,0x8DD1,0x8DD4,0x8DD5,0x8DD7, - 0x8DD9,0x8DE4,0x8DE5,0x8DE7,0x8DEC,0x8DF0,0x8DBC,0x8DF1, - 0x8DF2,0x8DF4,0x8DFD,0x8E01,0x8E04,0x8E05,0x8E06,0x8E0B, - 0x8E11,0x8E14,0x8E16,0x8E20,0x8E21,0x8E22, - - /* ku 64 */ - 0x8E23,0x8E26,0x8E27,0x8E31,0x8E33,0x8E36,0x8E37,0x8E38, - 0x8E39,0x8E3D,0x8E40,0x8E41,0x8E4B,0x8E4D,0x8E4E,0x8E4F, - 0x8E54,0x8E5B,0x8E5C,0x8E5D,0x8E5E,0x8E61,0x8E62,0x8E69, - 0x8E6C,0x8E6D,0x8E6F,0x8E70,0x8E71,0x8E79,0x8E7A,0x8E7B, - 0x8E82,0x8E83,0x8E89,0x8E90,0x8E92,0x8E95,0x8E9A,0x8E9B, - 0x8E9D,0x8E9E,0x8EA2,0x8EA7,0x8EA9,0x8EAD,0x8EAE,0x8EB3, - 0x8EB5,0x8EBA,0x8EBB,0x8EC0,0x8EC1,0x8EC3,0x8EC4,0x8EC7, - 0x8ECF,0x8ED1,0x8ED4,0x8EDC,0x8EE8,0x8EEE,0x8EF0,0x8EF1, - 0x8EF7,0x8EF9,0x8EFA,0x8EED,0x8F00,0x8F02,0x8F07,0x8F08, - 0x8F0F,0x8F10,0x8F16,0x8F17,0x8F18,0x8F1E,0x8F20,0x8F21, - 0x8F23,0x8F25,0x8F27,0x8F28,0x8F2C,0x8F2D,0x8F2E,0x8F34, - 0x8F35,0x8F36,0x8F37,0x8F3A,0x8F40,0x8F41, - - /* ku 65 */ - 0x8F43,0x8F47,0x8F4F,0x8F51,0x8F52,0x8F53,0x8F54,0x8F55, - 0x8F58,0x8F5D,0x8F5E,0x8F65,0x8F9D,0x8FA0,0x8FA1,0x8FA4, - 0x8FA5,0x8FA6,0x8FB5,0x8FB6,0x8FB8,0x8FBE,0x8FC0,0x8FC1, - 0x8FC6,0x8FCA,0x8FCB,0x8FCD,0x8FD0,0x8FD2,0x8FD3,0x8FD5, - 0x8FE0,0x8FE3,0x8FE4,0x8FE8,0x8FEE,0x8FF1,0x8FF5,0x8FF6, - 0x8FFB,0x8FFE,0x9002,0x9004,0x9008,0x900C,0x9018,0x901B, - 0x9028,0x9029,0x902F,0x902A,0x902C,0x902D,0x9033,0x9034, - 0x9037,0x903F,0x9043,0x9044,0x904C,0x905B,0x905D,0x9062, - 0x9066,0x9067,0x906C,0x9070,0x9074,0x9079,0x9085,0x9088, - 0x908B,0x908C,0x908E,0x9090,0x9095,0x9097,0x9098,0x9099, - 0x909B,0x90A0,0x90A1,0x90A2,0x90A5,0x90B0,0x90B2,0x90B3, - 0x90B4,0x90B6,0x90BD,0x90CC,0x90BE,0x90C3, - - /* ku 66 */ - 0x90C4,0x90C5,0x90C7,0x90C8,0x90D5,0x90D7,0x90D8,0x90D9, - 0x90DC,0x90DD,0x90DF,0x90E5,0x90D2,0x90F6,0x90EB,0x90EF, - 0x90F0,0x90F4,0x90FE,0x90FF,0x9100,0x9104,0x9105,0x9106, - 0x9108,0x910D,0x9110,0x9114,0x9116,0x9117,0x9118,0x911A, - 0x911C,0x911E,0x9120,0x9125,0x9122,0x9123,0x9127,0x9129, - 0x912E,0x912F,0x9131,0x9134,0x9136,0x9137,0x9139,0x913A, - 0x913C,0x913D,0x9143,0x9147,0x9148,0x914F,0x9153,0x9157, - 0x9159,0x915A,0x915B,0x9161,0x9164,0x9167,0x916D,0x9174, - 0x9179,0x917A,0x917B,0x9181,0x9183,0x9185,0x9186,0x918A, - 0x918E,0x9191,0x9193,0x9194,0x9195,0x9198,0x919E,0x91A1, - 0x91A6,0x91A8,0x91AC,0x91AD,0x91AE,0x91B0,0x91B1,0x91B2, - 0x91B3,0x91B6,0x91BB,0x91BC,0x91BD,0x91BF, - - /* ku 67 */ - 0x91C2,0x91C3,0x91C5,0x91D3,0x91D4,0x91D7,0x91D9,0x91DA, - 0x91DE,0x91E4,0x91E5,0x91E9,0x91EA,0x91EC,0x91ED,0x91EE, - 0x91EF,0x91F0,0x91F1,0x91F7,0x91F9,0x91FB,0x91FD,0x9200, - 0x9201,0x9204,0x9205,0x9206,0x9207,0x9209,0x920A,0x920C, - 0x9210,0x9212,0x9213,0x9216,0x9218,0x921C,0x921D,0x9223, - 0x9224,0x9225,0x9226,0x9228,0x922E,0x922F,0x9230,0x9233, - 0x9235,0x9236,0x9238,0x9239,0x923A,0x923C,0x923E,0x9240, - 0x9242,0x9243,0x9246,0x9247,0x924A,0x924D,0x924E,0x924F, - 0x9251,0x9258,0x9259,0x925C,0x925D,0x9260,0x9261,0x9265, - 0x9267,0x9268,0x9269,0x926E,0x926F,0x9270,0x9275,0x9276, - 0x9277,0x9278,0x9279,0x927B,0x927C,0x927D,0x927F,0x9288, - 0x9289,0x928A,0x928D,0x928E,0x9292,0x9297, - - /* ku 68 */ - 0x9299,0x929F,0x92A0,0x92A4,0x92A5,0x92A7,0x92A8,0x92AB, - 0x92AF,0x92B2,0x92B6,0x92B8,0x92BA,0x92BB,0x92BC,0x92BD, - 0x92BF,0x92C0,0x92C1,0x92C2,0x92C3,0x92C5,0x92C6,0x92C7, - 0x92C8,0x92CB,0x92CC,0x92CD,0x92CE,0x92D0,0x92D3,0x92D5, - 0x92D7,0x92D8,0x92D9,0x92DC,0x92DD,0x92DF,0x92E0,0x92E1, - 0x92E3,0x92E5,0x92E7,0x92E8,0x92EC,0x92EE,0x92F0,0x92F9, - 0x92FB,0x92FF,0x9300,0x9302,0x9308,0x930D,0x9311,0x9314, - 0x9315,0x931C,0x931D,0x931E,0x931F,0x9321,0x9324,0x9325, - 0x9327,0x9329,0x932A,0x9333,0x9334,0x9336,0x9337,0x9347, - 0x9348,0x9349,0x9350,0x9351,0x9352,0x9355,0x9357,0x9358, - 0x935A,0x935E,0x9364,0x9365,0x9367,0x9369,0x936A,0x936D, - 0x936F,0x9370,0x9371,0x9373,0x9374,0x9376, - - /* ku 69 */ - 0x937A,0x937D,0x937F,0x9380,0x9381,0x9382,0x9388,0x938A, - 0x938B,0x938D,0x938F,0x9392,0x9395,0x9398,0x939B,0x939E, - 0x93A1,0x93A3,0x93A4,0x93A6,0x93A8,0x93AB,0x93B4,0x93B5, - 0x93B6,0x93BA,0x93A9,0x93C1,0x93C4,0x93C5,0x93C6,0x93C7, - 0x93C9,0x93CA,0x93CB,0x93CC,0x93CD,0x93D3,0x93D9,0x93DC, - 0x93DE,0x93DF,0x93E2,0x93E6,0x93E7,0x93F9,0x93F7,0x93F8, - 0x93FA,0x93FB,0x93FD,0x9401,0x9402,0x9404,0x9408,0x9409, - 0x940D,0x940E,0x940F,0x9415,0x9416,0x9417,0x941F,0x942E, - 0x942F,0x9431,0x9432,0x9433,0x9434,0x943B,0x943F,0x943D, - 0x9443,0x9445,0x9448,0x944A,0x944C,0x9455,0x9459,0x945C, - 0x945F,0x9461,0x9463,0x9468,0x946B,0x946D,0x946E,0x946F, - 0x9471,0x9472,0x9484,0x9483,0x9578,0x9579, - - /* ku 70 */ - 0x957E,0x9584,0x9588,0x958C,0x958D,0x958E,0x959D,0x959E, - 0x959F,0x95A1,0x95A6,0x95A9,0x95AB,0x95AC,0x95B4,0x95B6, - 0x95BA,0x95BD,0x95BF,0x95C6,0x95C8,0x95C9,0x95CB,0x95D0, - 0x95D1,0x95D2,0x95D3,0x95D9,0x95DA,0x95DD,0x95DE,0x95DF, - 0x95E0,0x95E4,0x95E6,0x961D,0x961E,0x9622,0x9624,0x9625, - 0x9626,0x962C,0x9631,0x9633,0x9637,0x9638,0x9639,0x963A, - 0x963C,0x963D,0x9641,0x9652,0x9654,0x9656,0x9657,0x9658, - 0x9661,0x966E,0x9674,0x967B,0x967C,0x967E,0x967F,0x9681, - 0x9682,0x9683,0x9684,0x9689,0x9691,0x9696,0x969A,0x969D, - 0x969F,0x96A4,0x96A5,0x96A6,0x96A9,0x96AE,0x96AF,0x96B3, - 0x96BA,0x96CA,0x96D2,0x5DB2,0x96D8,0x96DA,0x96DD,0x96DE, - 0x96DF,0x96E9,0x96EF,0x96F1,0x96FA,0x9702, - - /* ku 71 */ - 0x9703,0x9705,0x9709,0x971A,0x971B,0x971D,0x9721,0x9722, - 0x9723,0x9728,0x9731,0x9733,0x9741,0x9743,0x974A,0x974E, - 0x974F,0x9755,0x9757,0x9758,0x975A,0x975B,0x9763,0x9767, - 0x976A,0x976E,0x9773,0x9776,0x9777,0x9778,0x977B,0x977D, - 0x977F,0x9780,0x9789,0x9795,0x9796,0x9797,0x9799,0x979A, - 0x979E,0x979F,0x97A2,0x97AC,0x97AE,0x97B1,0x97B2,0x97B5, - 0x97B6,0x97B8,0x97B9,0x97BA,0x97BC,0x97BE,0x97BF,0x97C1, - 0x97C4,0x97C5,0x97C7,0x97C9,0x97CA,0x97CC,0x97CD,0x97CE, - 0x97D0,0x97D1,0x97D4,0x97D7,0x97D8,0x97D9,0x97DD,0x97DE, - 0x97E0,0x97DB,0x97E1,0x97E4,0x97EF,0x97F1,0x97F4,0x97F7, - 0x97F8,0x97FA,0x9807,0x980A,0x9819,0x980D,0x980E,0x9814, - 0x9816,0x981C,0x981E,0x9820,0x9823,0x9826, - - /* ku 72 */ - 0x982B,0x982E,0x982F,0x9830,0x9832,0x9833,0x9835,0x9825, - 0x983E,0x9844,0x9847,0x984A,0x9851,0x9852,0x9853,0x9856, - 0x9857,0x9859,0x985A,0x9862,0x9863,0x9865,0x9866,0x986A, - 0x986C,0x98AB,0x98AD,0x98AE,0x98B0,0x98B4,0x98B7,0x98B8, - 0x98BA,0x98BB,0x98BF,0x98C2,0x98C5,0x98C8,0x98CC,0x98E1, - 0x98E3,0x98E5,0x98E6,0x98E7,0x98EA,0x98F3,0x98F6,0x9902, - 0x9907,0x9908,0x9911,0x9915,0x9916,0x9917,0x991A,0x991B, - 0x991C,0x991F,0x9922,0x9926,0x9927,0x992B,0x9931,0x9932, - 0x9933,0x9934,0x9935,0x9939,0x993A,0x993B,0x993C,0x9940, - 0x9941,0x9946,0x9947,0x9948,0x994D,0x994E,0x9954,0x9958, - 0x9959,0x995B,0x995C,0x995E,0x995F,0x9960,0x999B,0x999D, - 0x999F,0x99A6,0x99B0,0x99B1,0x99B2,0x99B5, - - /* ku 73 */ - 0x99B9,0x99BA,0x99BD,0x99BF,0x99C3,0x99C9,0x99D3,0x99D4, - 0x99D9,0x99DA,0x99DC,0x99DE,0x99E7,0x99EA,0x99EB,0x99EC, - 0x99F0,0x99F4,0x99F5,0x99F9,0x99FD,0x99FE,0x9A02,0x9A03, - 0x9A04,0x9A0B,0x9A0C,0x9A10,0x9A11,0x9A16,0x9A1E,0x9A20, - 0x9A22,0x9A23,0x9A24,0x9A27,0x9A2D,0x9A2E,0x9A33,0x9A35, - 0x9A36,0x9A38,0x9A47,0x9A41,0x9A44,0x9A4A,0x9A4B,0x9A4C, - 0x9A4E,0x9A51,0x9A54,0x9A56,0x9A5D,0x9AAA,0x9AAC,0x9AAE, - 0x9AAF,0x9AB2,0x9AB4,0x9AB5,0x9AB6,0x9AB9,0x9ABB,0x9ABE, - 0x9ABF,0x9AC1,0x9AC3,0x9AC6,0x9AC8,0x9ACE,0x9AD0,0x9AD2, - 0x9AD5,0x9AD6,0x9AD7,0x9ADB,0x9ADC,0x9AE0,0x9AE4,0x9AE5, - 0x9AE7,0x9AE9,0x9AEC,0x9AF2,0x9AF3,0x9AF5,0x9AF9,0x9AFA, - 0x9AFD,0x9AFF,0x9B00,0x9B01,0x9B02,0x9B03, - - /* ku 74 */ - 0x9B04,0x9B05,0x9B08,0x9B09,0x9B0B,0x9B0C,0x9B0D,0x9B0E, - 0x9B10,0x9B12,0x9B16,0x9B19,0x9B1B,0x9B1C,0x9B20,0x9B26, - 0x9B2B,0x9B2D,0x9B33,0x9B34,0x9B35,0x9B37,0x9B39,0x9B3A, - 0x9B3D,0x9B48,0x9B4B,0x9B4C,0x9B55,0x9B56,0x9B57,0x9B5B, - 0x9B5E,0x9B61,0x9B63,0x9B65,0x9B66,0x9B68,0x9B6A,0x9B6B, - 0x9B6C,0x9B6D,0x9B6E,0x9B73,0x9B75,0x9B77,0x9B78,0x9B79, - 0x9B7F,0x9B80,0x9B84,0x9B85,0x9B86,0x9B87,0x9B89,0x9B8A, - 0x9B8B,0x9B8D,0x9B8F,0x9B90,0x9B94,0x9B9A,0x9B9D,0x9B9E, - 0x9BA6,0x9BA7,0x9BA9,0x9BAC,0x9BB0,0x9BB1,0x9BB2,0x9BB7, - 0x9BB8,0x9BBB,0x9BBC,0x9BBE,0x9BBF,0x9BC1,0x9BC7,0x9BC8, - 0x9BCE,0x9BD0,0x9BD7,0x9BD8,0x9BDD,0x9BDF,0x9BE5,0x9BE7, - 0x9BEA,0x9BEB,0x9BEF,0x9BF3,0x9BF7,0x9BF8, - - /* ku 75 */ - 0x9BF9,0x9BFA,0x9BFD,0x9BFF,0x9C00,0x9C02,0x9C0B,0x9C0F, - 0x9C11,0x9C16,0x9C18,0x9C19,0x9C1A,0x9C1C,0x9C1E,0x9C22, - 0x9C23,0x9C26,0x9C27,0x9C28,0x9C29,0x9C2A,0x9C31,0x9C35, - 0x9C36,0x9C37,0x9C3D,0x9C41,0x9C43,0x9C44,0x9C45,0x9C49, - 0x9C4A,0x9C4E,0x9C4F,0x9C50,0x9C53,0x9C54,0x9C56,0x9C58, - 0x9C5B,0x9C5D,0x9C5E,0x9C5F,0x9C63,0x9C69,0x9C6A,0x9C5C, - 0x9C6B,0x9C68,0x9C6E,0x9C70,0x9C72,0x9C75,0x9C77,0x9C7B, - 0x9CE6,0x9CF2,0x9CF7,0x9CF9,0x9D0B,0x9D02,0x9D11,0x9D17, - 0x9D18,0x9D1C,0x9D1D,0x9D1E,0x9D2F,0x9D30,0x9D32,0x9D33, - 0x9D34,0x9D3A,0x9D3C,0x9D45,0x9D3D,0x9D42,0x9D43,0x9D47, - 0x9D4A,0x9D53,0x9D54,0x9D5F,0x9D63,0x9D62,0x9D65,0x9D69, - 0x9D6A,0x9D6B,0x9D70,0x9D76,0x9D77,0x9D7B, - - /* ku 76 */ - 0x9D7C,0x9D7E,0x9D83,0x9D84,0x9D86,0x9D8A,0x9D8D,0x9D8E, - 0x9D92,0x9D93,0x9D95,0x9D96,0x9D97,0x9D98,0x9DA1,0x9DAA, - 0x9DAC,0x9DAE,0x9DB1,0x9DB5,0x9DB9,0x9DBC,0x9DBF,0x9DC3, - 0x9DC7,0x9DC9,0x9DCA,0x9DD4,0x9DD5,0x9DD6,0x9DD7,0x9DDA, - 0x9DDE,0x9DDF,0x9DE0,0x9DE5,0x9DE7,0x9DE9,0x9DEB,0x9DEE, - 0x9DF0,0x9DF3,0x9DF4,0x9DFE,0x9E0A,0x9E02,0x9E07,0x9E0E, - 0x9E10,0x9E11,0x9E12,0x9E15,0x9E16,0x9E19,0x9E1C,0x9E1D, - 0x9E7A,0x9E7B,0x9E7C,0x9E80,0x9E82,0x9E83,0x9E84,0x9E85, - 0x9E87,0x9E8E,0x9E8F,0x9E96,0x9E98,0x9E9B,0x9E9E,0x9EA4, - 0x9EA8,0x9EAC,0x9EAE,0x9EAF,0x9EB0,0x9EB3,0x9EB4,0x9EB5, - 0x9EC6,0x9EC8,0x9ECB,0x9ED5,0x9EDF,0x9EE4,0x9EE7,0x9EEC, - 0x9EED,0x9EEE,0x9EF0,0x9EF1,0x9EF2,0x9EF5, - - /* ku 77 */ - 0x9EF8,0x9EFF,0x9F02,0x9F03,0x9F09,0x9F0F,0x9F10,0x9F11, - 0x9F12,0x9F14,0x9F16,0x9F17,0x9F19,0x9F1A,0x9F1B,0x9F1F, - 0x9F22,0x9F26,0x9F2A,0x9F2B,0x9F2F,0x9F31,0x9F32,0x9F34, - 0x9F37,0x9F39,0x9F3A,0x9F3C,0x9F3D,0x9F3F,0x9F41,0x9F43, - 0x9F44,0x9F45,0x9F46,0x9F47,0x9F53,0x9F55,0x9F56,0x9F57, - 0x9F58,0x9F5A,0x9F5D,0x9F5E,0x9F68,0x9F69,0x9F6D,0x9F6E, - 0x9F6F,0x9F70,0x9F71,0x9F73,0x9F75,0x9F7A,0x9F7D,0x9F8F, - 0x9F90,0x9F91,0x9F92,0x9F94,0x9F96,0x9F97,0x9F9E,0x9FA1, - 0x9FA2,0x9FA3,0x9FA5 -}; - -static const int jisx0212_ucs_table_size = (sizeof (jisx0212_ucs_table) / sizeof (unsigned short)); - -static const unsigned short ucs_a1_jis_table[] = { - /* 0000h */ - 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, - 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, - 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, - 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, - 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, - 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, - 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, - 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, - 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, - 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, - 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, - 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, - 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, - 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, - 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, - 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xA2C2,0x2171,0x2172,0xA2F0,0x0000,0xA2C3,0x2178, - 0x212F,0xA2ED,0xA2EC,0x0000,0x224C,0x0000,0xA2EE,0xA2B4, - 0x216B,0x215E,0x0000,0x0000,0x212D,0x0000,0x2279,0x0000, - 0xA2B1,0x0000,0xA2EB,0x0000,0x0000,0x0000,0x0000,0xA2C4, - 0xAAA2,0xAAA1,0xAAA4,0xAAAA,0xAAA3,0xAAA9,0xA9A1,0xAAAE, - 0xAAB2,0xAAB1,0xAAB4,0xAAB3,0xAAC0,0xAABF,0xAAC2,0xAAC1, - 0x0000,0xAAD0,0xAAD2,0xAAD1,0xAAD4,0xAAD8,0xAAD3,0x215F, - 0xA9AC,0xAAE3,0xAAE2,0xAAE5,0xAAE4,0xAAF2,0xA9B0,0xA9CE, - 0xABA2,0xABA1,0xABA4,0xABAA,0xABA3,0xABA9,0xA9C1,0xABAE, - 0xABB2,0xABB1,0xABB4,0xABB3,0xABC0,0xABBF,0xABC2,0xABC1, - 0xA9C3,0xABD0,0xABD2,0xABD1,0xABD4,0xABD8,0xABD3,0x2160, - 0xA9CC,0xABE3,0xABE2,0xABE5,0xABE4,0xABF2,0xA9D0,0xABF3, - - /* 0100h */ - 0xAAA7,0xABA7,0xAAA5,0xABA5,0xAAA8,0xABA8,0xAAAB,0xABAB, - 0xAAAC,0xABAC,0xAAAF,0xABAF,0xAAAD,0xABAD,0xAAB0,0xABB0, - 0xA9A2,0xA9C2,0xAAB7,0xABB7,0x0000,0x0000,0xAAB6,0xABB6, - 0xAAB8,0xABB8,0xAAB5,0xABB5,0xAABA,0xABBA,0xAABB,0xABBB, - 0xAABD,0xABBD,0xAABC,0x0000,0xAABE,0xABBE,0xA9A4,0xA9C4, - 0xAAC7,0xABC7,0xAAC5,0xABC5,0x0000,0x0000,0xAAC6,0xABC6, - 0xAAC4,0xA9C5,0xA9A6,0xA9C6,0xAAC8,0xABC8,0xAAC9,0xABC9, - 0xA9C7,0xAACA,0xABCA,0xAACC,0xABCC,0xAACB,0xABCB,0xA9A9, - 0xA9C9,0xA9A8,0xA9C8,0xAACD,0xABCD,0xAACF,0xABCF,0xAACE, - 0xABCE,0xA9CA,0xA9AB,0xA9CB,0xAAD7,0xABD7,0x0000,0x0000, - 0xAAD6,0xABD6,0xA9AD,0xA9CD,0xAAD9,0xABD9,0xAADB,0xABDB, - 0xAADA,0xABDA,0xAADC,0xABDC,0xAADD,0xABDD,0xAADF,0xABDF, - 0xAADE,0xABDE,0xAAE1,0xABE1,0xAAE0,0xABE0,0xA9AF,0xA9CF, - 0xAAEC,0xABEC,0xAAE9,0xABE9,0xAAE6,0xABE6,0xAAEB,0xABEB, - 0xAAE8,0xABE8,0xAAEA,0xABEA,0xAAF1,0xABF1,0xAAF4,0xABF4, - 0xAAF3,0xAAF5,0xABF5,0xAAF7,0xABF7,0xAAF6,0xABF6,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xAAA6,0xABA6,0xAAC3, - 0xABC3,0xAAD5,0xABD5,0xAAE7,0xABE7,0xAAF0,0xABF0,0xAAED, - 0xABED,0xAAEF,0xABEF,0xAAEE,0xABEE,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xABB9,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 0200h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xA2B0, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xA2AF,0xA2B2,0xA2B6,0xA2B5,0x0000,0xA2B3,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 0300h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xA2B8,0xA2B9,0xA6E1,0x0000, - 0xA6E2,0xA6E3,0xA6E4,0x0000,0xA6E7,0x0000,0xA6E9,0xA6EC, - 0xA6F6,0x2621,0x2622,0x2623,0x2624,0x2625,0x2626,0x2627, - 0x2628,0x2629,0x262A,0x262B,0x262C,0x262D,0x262E,0x262F, - 0x2630,0x2631,0x0000,0x2632,0x2633,0x2634,0x2635,0x2636, - 0x2637,0x2638,0xA6E5,0xA6EA,0xA6F1,0xA6F2,0xA6F3,0xA6F4, - 0xA6FB,0x2641,0x2642,0x2643,0x2644,0x2645,0x2646,0x2647, - 0x2648,0x2649,0x264A,0x264B,0x264C,0x264D,0x264E,0x264F, - 0x2650,0x2651,0xA6F8,0x2652,0x2653,0x2654,0x2655,0x2656, - 0x2657,0x2658,0xA6F5,0xA6FA,0xA6F7,0xA6F9,0xA6FC,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 0400h */ - 0x0000,0x2727,0xA7C2,0xA7C3,0xA7C4,0xA7C5,0xA7C6,0xA7C7, - 0xA7C8,0xA7C9,0xA7CA,0xA7CB,0xA7CC,0x0000,0xA7CD,0xA7CE, - 0x2721,0x2722,0x2723,0x2724,0x2725,0x2726,0x2728,0x2729, - 0x272A,0x272B,0x272C,0x272D,0x272E,0x272F,0x2730,0x2731, - 0x2732,0x2733,0x2734,0x2735,0x2736,0x2737,0x2738,0x2739, - 0x273A,0x273B,0x273C,0x273D,0x273E,0x273F,0x2740,0x2741, - 0x2751,0x2752,0x2753,0x2754,0x2755,0x2756,0x2758,0x2759, - 0x275A,0x275B,0x275C,0x275D,0x275E,0x275F,0x2760,0x2761, - 0x2762,0x2763,0x2764,0x2765,0x2766,0x2767,0x2768,0x2769, - 0x276A,0x276B,0x276C,0x276D,0x276E,0x276F,0x2770,0x2771, - 0x0000,0x2757,0xA7F2,0xA7F3,0xA7F4,0xA7F5,0xA7F6,0xA7F7, - 0xA7F8,0xA7F9,0xA7FA,0xA7FB,0xA7FC,0x0000,0xA7FD,0xA7FE -}; -static const int ucs_a1_jis_table_min = 0x0000; -static const int ucs_a1_jis_table_max = 0x0000 + (sizeof (ucs_a1_jis_table) / sizeof (unsigned short)); - - -static const unsigned short ucs_a2_jis_table[] = { - /* 2000h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x213E,0x0000,0x0000,0x0000,0x0000,0x213D,0x2142,0x0000, - 0x2146,0x2147,0x0000,0x0000,0x2148,0x2149,0x0000,0x0000, - 0x2277,0x2278,0x0000,0x0000,0x0000,0x2145,0x2144,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x2273,0x0000,0x216C,0x216D,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x2228,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2100h */ - 0x0000,0x0000,0x0000,0x216E,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xA2F1,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xA2EF,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x2272,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x222B,0x222C,0x222A,0x222D,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x224D,0x0000,0x224E,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2200h */ - 0x224F,0x0000,0x225F,0x2250,0x0000,0x0000,0x0000,0x2260, - 0x223A,0x0000,0x0000,0x223B,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x215D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x2265,0x0000,0x0000,0x2267,0x2167,0x0000, - 0x225C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x224A, - 0x224B,0x2241,0x2240,0x2269,0x226A,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x2168,0x2268,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x2266,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x2262,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x2162,0x2261,0x0000,0x0000,0x0000,0x0000,0x2165,0x2166, - 0x0000,0x0000,0x2263,0x2264,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x223E,0x223F,0x0000,0x0000,0x223C,0x223D, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x225D,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2300h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x225E,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2400h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2500h */ - 0x2821,0x282C,0x2822,0x282D,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x2823,0x0000,0x0000,0x282E, - 0x2824,0x0000,0x0000,0x282F,0x2826,0x0000,0x0000,0x2831, - 0x2825,0x0000,0x0000,0x2830,0x2827,0x283C,0x0000,0x0000, - 0x2837,0x0000,0x0000,0x2832,0x2829,0x283E,0x0000,0x0000, - 0x2839,0x0000,0x0000,0x2834,0x2828,0x0000,0x0000,0x2838, - 0x283D,0x0000,0x0000,0x2833,0x282A,0x0000,0x0000,0x283A, - 0x283F,0x0000,0x0000,0x2835,0x282B,0x0000,0x0000,0x283B, - 0x0000,0x0000,0x2840,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x2836,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x2223,0x2222,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x2225,0x2224,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x2227,0x2226,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2221,0x217E, - 0x0000,0x0000,0x0000,0x217B,0x0000,0x0000,0x217D,0x217C, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x227E, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2600h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x217A,0x2179,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x216A,0x0000,0x2169,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x2276,0x0000,0x0000,0x2275,0x0000,0x2274, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2700h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2800h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2900h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2A00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2B00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2C00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2D00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2E00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 2F00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 3000h */ - 0x2121,0x2122,0x2123,0x2137,0x0000,0x2139,0x213A,0x213B, - 0x2152,0x2153,0x2154,0x2155,0x2156,0x2157,0x2158,0x2159, - 0x215A,0x215B,0x2229,0x222E,0x214C,0x214D,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x2141,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427, - 0x2428,0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F, - 0x2430,0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437, - 0x2438,0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F, - 0x2440,0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447, - 0x2448,0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F, - 0x2450,0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457, - 0x2458,0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F, - 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, - 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, - 0x2470,0x2471,0x2472,0x2473,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x212B,0x212C,0x2135,0x2136,0x0000, - 0x0000,0x2521,0x2522,0x2523,0x2524,0x2525,0x2526,0x2527, - 0x2528,0x2529,0x252A,0x252B,0x252C,0x252D,0x252E,0x252F, - 0x2530,0x2531,0x2532,0x2533,0x2534,0x2535,0x2536,0x2537, - 0x2538,0x2539,0x253A,0x253B,0x253C,0x253D,0x253E,0x253F, - 0x2540,0x2541,0x2542,0x2543,0x2544,0x2545,0x2546,0x2547, - 0x2548,0x2549,0x254A,0x254B,0x254C,0x254D,0x254E,0x254F, - 0x2550,0x2551,0x2552,0x2553,0x2554,0x2555,0x2556,0x2557, - 0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,0x255F, - 0x2560,0x2561,0x2562,0x2563,0x2564,0x2565,0x2566,0x2567, - 0x2568,0x2569,0x256A,0x256B,0x256C,0x256D,0x256E,0x256F, - 0x2570,0x2571,0x2572,0x2573,0x2574,0x2575,0x2576,0x0000, - 0x0000,0x0000,0x0000,0x2126,0x213C,0x2133,0x2134,0x0000 -}; -static const int ucs_a2_jis_table_min = 0x2000; -static const int ucs_a2_jis_table_max = 0x2000 + (sizeof (ucs_a2_jis_table) / sizeof (unsigned short)); - - -static const unsigned short ucs_i_jis_table[] = { - /* 4E00h */ - 0x306C,0x437A,0xB0A1,0x3C37,0xB0A2,0xB0A3,0x0000,0x4B7C, - 0x3E66,0x3B30,0x3E65,0x323C,0xB0A4,0x4954,0x4D3F,0x0000, - 0x5022,0x312F,0xB0A5,0x0000,0x336E,0x5023,0x4024,0x5242, - 0x3556,0x4A3A,0x0000,0x0000,0x0000,0x0000,0x3E67,0xB0A6, - 0x0000,0x4E3E,0x0000,0xB0A7,0xB0A8,0x0000,0x4A42,0x0000, - 0xB0A9,0x0000,0x5024,0xB0AA,0x0000,0x4366,0xB0AB,0xB0AC, - 0xB0AD,0x5025,0x367A,0x0000,0x0000,0xB0AE,0x5026,0x0000, - 0x345D,0x4330,0x0000,0x3C67,0x5027,0x0000,0x0000,0x5028, - 0xB0AF,0xB0B0,0x5029,0x4735,0xB0B1,0x3557,0x0000,0xB0B2, - 0x0000,0x0000,0x0000,0x4737,0x0000,0x4663,0x3843,0x4B33, - 0x0000,0xB0B3,0x0000,0x0000,0x0000,0x6949,0x502A,0x3E68, - 0x502B,0x3235,0xB0B4,0x0000,0xB0B5,0x3665,0x3870,0x4C69, - 0x0000,0x0000,0x5626,0xB0B6,0x0000,0x0000,0x0000,0x0000, - 0xB0B7,0xB0B8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x4D70,0x0000,0x467D,0xB0B9,0xB0BA,0x0000,0x0000, - 0x0000,0xB0BB,0x0000,0x0000,0x0000,0x0000,0x3425,0xB0BC, - 0x3535,0x0000,0x502C,0x0000,0x0000,0x502D,0x4E3B,0x0000, - 0x4D3D,0x4168,0x502F,0x3B76,0x4673,0xB0BD,0x5032,0x0000, - 0x0000,0x313E,0x385F,0x0000,0x385E,0x3066,0xB0BE,0xB0BF, - 0x4F4B,0x4F4A,0x0000,0x3A33,0x3021,0xB0C0,0x5033,0x5034, - 0x5035,0x4B34,0x5036,0x0000,0x3872,0x3067,0x4B72,0x0000, - 0x357C,0x0000,0x0000,0x357D,0x357E,0x4462,0x4E3C,0xB0C1, - 0x5037,0x0000,0x0000,0x5038,0x0000,0x0000,0x5039,0x0000, - 0x0000,0xB0C2,0x3F4D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x3D3A,0x3F4E,0x503E,0xB0C3,0x503C,0x0000,0x503D,0x3558, - 0x0000,0x0000,0x3A23,0x3270,0x0000,0x503B,0x503A,0x4A29, - 0xB0C4,0x0000,0x0000,0x0000,0x3B46,0x3B45,0x423E,0x503F, - 0x4955,0x4067,0xB0C5,0xB0C6,0x0000,0x2138,0x5040,0x5042, - 0xB0C7,0xB0C8,0xB0C9,0x4265,0x4E61,0x304A,0x0000,0x0000, - 0xB0CA,0x0000,0x0000,0x0000,0x0000,0x5041,0x323E,0xB0CB, - 0x3644,0xB0CC,0x4367,0xB0CD,0x0000,0xB0CE,0x376F,0x5043, - 0x0000,0x0000,0x0000,0x4724,0x0000,0xB0CF,0xB0D0,0xB0D1, - - /* 4F00h */ - 0xB0D2,0x346B,0xB0D3,0xB0D4,0x0000,0x0000,0x0000,0x0000, - 0xB0D5,0x5044,0x304B,0xB0D6,0xB0D7,0x3860,0x346C,0x497A, - 0x4832,0x3559,0xB0D8,0x0000,0x0000,0xB0D9,0xB0DA,0xB0DB, - 0x0000,0xB0DC,0x3271,0x0000,0x5067,0x4541,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xB0DD,0x476C, - 0x5046,0xB0DE,0x0000,0xB0E0,0x483C,0xB0E1,0x4E62,0xB0E2, - 0x3F2D,0xB0E3,0x3B47,0xB0E4,0x3B77,0x3240,0xB0E5,0x0000, - 0xB0E6,0x0000,0xB0E7,0x4451,0x0000,0x0000,0x4322,0x504A, - 0xB0E8,0xB0E9,0x0000,0xB0EA,0xB0EB,0x304C,0x4463,0x3D3B, - 0x3A34,0x4D24,0xB0EC,0x424E,0xB0ED,0x323F,0xB0EE,0x5049, - 0xB0EF,0x4D3E,0x5045,0x5047,0x3A6E,0x5048,0x5524,0xB0F0, - 0xB0DF,0x0000,0x0000,0xB0F1,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x5050,0xB0F2,0x0000,0xB0F3,0x0000,0xB0F4,0x5053, - 0x5051,0xB0F5,0x0000,0x3242,0x0000,0x4A3B,0x504B,0xB0F6, - 0xB0F7,0xB0F8,0xB0F9,0x504F,0x3873,0xB0FA,0xB0FB,0x3B48, - 0x0000,0xB0FC,0xB0FD,0x3426,0xB0FE,0xB1A1,0x5054,0x0000, - 0x504C,0xB1A2,0xB1A3,0x4E63,0xB1A4,0x3B78,0xB1A5,0x504D, - 0xB1A6,0x5052,0xB1A7,0xB1A8,0xB1A9,0x0000,0x5055,0xB1AA, - 0x504E,0xB1AB,0xB1AC,0x3621,0x0000,0x304D,0xB1AD,0xB1AE, - 0x3622,0x3241,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x5525,0x0000,0x4B79,0x496E,0x3874, - 0x0000,0x0000,0xB1AF,0x0000,0x0000,0x3F2F,0x4E37,0xB1B0, - 0x0000,0xB1B1,0x0000,0xB1B2,0xB1B3,0xB1B4,0xB1B5,0x4A58, - 0xB1B6,0xB1B7,0x3738,0x4225,0x3264,0xB1B8,0xB1B9,0x0000, - 0xB1BA,0xB1BB,0x3D53,0xB1BC,0xB1BD,0xB1BE,0x5059,0xB1BF, - 0x505E,0x505C,0xB1C0,0x0000,0x5057,0x0000,0x0000,0x422F, - 0x505A,0x0000,0x505D,0x505B,0xB1C1,0x4A5D,0x0000,0x5058, - 0xB1C2,0x3F2E,0xB1C3,0x4B73,0x505F,0x5060,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3D24,0x506D, - 0xB1C4,0x0000,0xB1C5,0x4750,0x0000,0x4936,0x5068,0x0000, - 0x4A70,0x0000,0x3236,0x0000,0xB1C6,0xB1C7,0x506C,0xB1C8, - - /* 5000h */ - 0xB1C9,0xB1CA,0x0000,0x0000,0xB1CB,0x5066,0x506F,0xB1CC, - 0x0000,0x4152,0xB1CD,0x3844,0xB1CE,0x475C,0xB1CF,0x6047, - 0xB1D0,0x506E,0x455D,0xB1D1,0x5063,0x0000,0x3876,0xB1D2, - 0xB1D3,0x3875,0x5061,0xB1D4,0xB1D5,0xB1D6,0xB1D7,0x3C5A, - 0x0000,0x5069,0xB1D8,0x4A6F,0x434D,0x5065,0x3771,0xB1D9, - 0x5062,0x506A,0x5064,0x4E51,0x506B,0x4F41,0xB1DA,0x0000, - 0xB1DB,0x0000,0xB1DC,0xB1DD,0x0000,0xB1DE,0x3666,0x0000, - 0x0000,0x3770,0x0000,0xB1F6,0x0000,0x0000,0x0000,0x0000, - 0xB1DF,0xB1E0,0xB1E1,0x5070,0x0000,0xB1E2,0xB1E3,0x5071, - 0x5075,0x304E,0xB1E4,0x0000,0xB1E5,0x0000,0xB1E6,0x4A50, - 0x5074,0xB1E7,0xB1E8,0xB1E9,0x0000,0x5073,0x5077,0xB1EA, - 0x0000,0xB1EB,0x5076,0x0000,0x4464,0x0000,0x0000,0xB1EC, - 0xB1ED,0x0000,0xB1EE,0xB1EF,0x0000,0x3772,0xB1F0,0xB1F1, - 0x0000,0x0000,0xB1F2,0x0000,0x5078,0xB1F3,0x0000,0x0000, - 0xB1F4,0xB1F5,0x3C45,0x0000,0x4226,0x4465,0x3676,0x0000, - 0x5079,0x0000,0x0000,0x0000,0x0000,0x3536,0x0000,0x0000, - 0x507A,0xB1F7,0x0000,0xB1F8,0xB1F9,0x507C,0xB1FA,0x0000, - 0x0000,0x0000,0xB1FB,0x0000,0x0000,0x4B35,0xB1FC,0xB1FD, - 0xB1FE,0x3766,0xB2A1,0xB2A2,0xB2A3,0x0000,0xB2A4,0x0000, - 0x3B31,0x4877,0x507B,0xB2A5,0xB2A6,0x0000,0xB2A7,0xB2A8, - 0xB2A9,0xB2AA,0xB2AB,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xB2AC,0x0000,0x3A45,0x4D43,0x0000,0xB2AD, - 0xB2AE,0x0000,0x507E,0x5123,0x507D,0x3A44,0x0000,0x3D7D, - 0x0000,0xB2AF,0xB2B0,0x0000,0x0000,0xB2B1,0x3739,0x0000, - 0xB2B2,0x0000,0x5124,0xB2B3,0xB2B4,0x364F,0x0000,0xB2B5, - 0x0000,0x5121,0x5122,0x0000,0xB2B6,0x462F,0xB2B7,0x417C, - 0xB2B8,0x3623,0x0000,0xB2B9,0xB2BA,0x4B4D,0x5125,0x0000, - 0xB2BB,0x0000,0x4E3D,0x0000,0xB2BC,0xB2BD,0x5126,0xB2BE, - 0x0000,0x0000,0xB2BF,0x5129,0xB2C0,0x5127,0xB2C1,0x414E, - 0xB2C2,0xB2C3,0x0000,0x0000,0x0000,0x5128,0x512A,0xB2C4, - 0x0000,0xB2C5,0xB2D1,0x0000,0x0000,0x512C,0xB2C6,0x0000, - 0x0000,0x512B,0xB2C7,0x4A48,0x0000,0x0000,0xB2C8,0x0000, - - /* 5100h */ - 0x3537,0x512E,0x512F,0xB2C9,0x322F,0x0000,0xB2CA,0xB2CB, - 0xB2CC,0x512D,0x0000,0xB2CD,0xB2CE,0xB2CF,0xB2D0,0x0000, - 0xB2D2,0x0000,0x3C74,0x0000,0x5132,0x5131,0x5130,0xB2D3, - 0x5056,0xB2D4,0x5133,0xB2D5,0xB2D6,0xB2D7,0xB2D8,0x3D7E, - 0x0000,0x5134,0x0000,0xB2D9,0x0000,0x0000,0x0000,0xB2DA, - 0xB2DB,0x0000,0x4D25,0x0000,0xB2DC,0xB2DD,0x0000,0xB2DE, - 0x0000,0xB2DF,0x4C59,0xB2E0,0xB2E1,0xB2E2,0x0000,0x5136, - 0xB2E3,0xB2E4,0x5135,0x5138,0x5137,0x0000,0x0000,0x5139, - 0x513A,0x3074,0xB2E5,0x3835,0x373B,0x3D3C,0x437B,0x3624, - 0x4068,0x3877,0xB2E6,0x396E,0x513C,0x4C48,0x4546,0xB2E7, - 0x3B79,0x0000,0x513B,0xB2E8,0x513D,0xB2E9,0x0000,0xB2EA, - 0xB2EB,0x0000,0x455E,0x0000,0x3375,0x0000,0x0000,0xB2EC, - 0x0000,0x0000,0x513E,0x0000,0xB2ED,0x467E,0xB2EE,0x0000, - 0x4134,0x5140,0x5141,0x482C,0x3878,0x4F3B,0x5142,0x0000, - 0x0000,0x3626,0x0000,0x0000,0x0000,0x4A3C,0x4236,0x3671, - 0x4535,0x0000,0x0000,0x0000,0x3773,0x0000,0xB2EF,0x0000, - 0x5143,0x0000,0x5144,0xB2F0,0xB2F1,0x4662,0x315F,0x0000, - 0x0000,0x5147,0x3A7D,0xB2F2,0x5146,0x3A46,0xB2F3,0x5148, - 0x666E,0x5149,0x4B41,0x514A,0x0000,0x514B,0x514C,0x3E69, - 0xB2F4,0x3C4C,0x0000,0x0000,0x0000,0xB2F5,0x0000,0x0000, - 0x3427,0xB2F6,0x514F,0xB2F7,0x514D,0x4C3D,0x514E,0x0000, - 0x495A,0x5150,0x5151,0x5152,0x455F,0xB2F8,0x0000,0x0000, - 0x5156,0x5154,0x5155,0x5153,0x3A63,0x5157,0x4C6A,0x4E64, - 0xB2F9,0x0000,0xB2FA,0x0000,0xB2FB,0x5158,0xB2FC,0xB2FD, - 0x0000,0x0000,0xB2FE,0x0000,0x4028,0x5159,0x3D5A,0x0000, - 0xB3A1,0x515A,0x0000,0x437C,0x4E3F,0x4560,0x0000,0xB3A2, - 0x0000,0xB3A3,0xB3A4,0xB3A5,0x0000,0xB3A6,0x5245,0x0000, - 0xB3A7,0x0000,0x0000,0x515B,0x7425,0x3645,0xB3A8,0x0000, - 0x515C,0x4B5E,0xB3A9,0x0000,0x0000,0xB3AA,0x3D68,0x427C, - 0x0000,0x515E,0x4664,0x0000,0x0000,0x515F,0xB3AB,0x0000, - 0x5160,0x332E,0xB3AC,0xB3AD,0xB3AE,0x5161,0x3627,0xB3AF, - 0x464C,0x317A,0x3D50,0x0000,0x0000,0x4821,0x5162,0x0000, - - /* 5200h */ - 0x4561,0xB3B0,0xB3B1,0x3F4F,0x5163,0xB3B2,0x4A2C,0x405A, - 0x3422,0x0000,0x3429,0x5164,0x0000,0x0000,0x5166,0x0000, - 0x0000,0x373A,0xB3B3,0xB3B4,0x5165,0xB3B5,0xB3B6,0x4E73, - 0xB3B7,0x0000,0x0000,0x0000,0x0000,0x3D69,0x0000,0x0000, - 0x0000,0x0000,0xB3B8,0x0000,0x483D,0x4A4C,0x0000,0x5167, - 0xB3B9,0x4D78,0x5168,0x0000,0x0000,0x0000,0x5169,0x0000, - 0x457E,0xB3BA,0xB3BB,0x516A,0x0000,0xB3BC,0x4029,0x3A7E, - 0x3774,0x516B,0x3B49,0x396F,0xB3BD,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x4466,0x516D,0xB3BE,0x0000,0x4227, - 0x0000,0xB3BF,0x3A6F,0x516E,0x516F,0x4130,0x0000,0x516C, - 0x0000,0x0000,0x0000,0x0000,0x5171,0xB3C0,0x4B36,0xB3C1, - 0xB3C2,0x0000,0xB3C3,0x3964,0xB3C4,0x0000,0x5170,0xB3C5, - 0xB3C6,0xB3C7,0x0000,0x3775,0x3A5E,0x476D,0xB3C8,0x0000, - 0x0000,0x5174,0x5172,0x0000,0x0000,0x0000,0xB3C9,0x497B, - 0x3E6A,0x517B,0x3364,0x5175,0x5173,0x414F,0x0000,0xB3CA, - 0xB3CB,0xB3CC,0x0000,0x0000,0x0000,0x5177,0x0000,0x5176, - 0xB3CD,0x0000,0xB3CE,0x3344,0x0000,0xB3CF,0x0000,0x3760, - 0x517C,0x4E2D,0xB3D0,0x0000,0xB3D1,0x5178,0x0000,0x0000, - 0x0000,0x517D,0x517A,0xB3D2,0x5179,0xB3D3,0xB3D4,0xB3D5, - 0xB3D6,0x0000,0xB3D7,0x4E4F,0xB3D8,0x0000,0x0000,0x3879, - 0x3243,0x0000,0x0000,0x4E74,0xB3D9,0xB3DA,0xB3DB,0xB3DC, - 0x0000,0x3D75,0x4558,0x3965,0x5222,0x5223,0x0000,0xB3DD, - 0xB3DE,0x4E65,0x0000,0x0000,0x4F2B,0x5225,0xB3DF,0xB3E0, - 0xB3E1,0x387A,0xB3E2,0xB3E3,0x5224,0xB3E4,0x332F,0x0000, - 0xB3E5,0x5226,0x0000,0x4B56,0xB3E6,0x443C,0xB3E7,0x4D26, - 0xB3E8,0x4A59,0x0000,0x0000,0xB3E9,0x5227,0x0000,0xB3EA, - 0x0000,0xB3EB,0x7055,0x0000,0xB3EC,0x4630,0xB3ED,0x5228, - 0x342A,0x4C33,0x0000,0xB3EE,0xB3EF,0x3E21,0x5229,0x4A67, - 0x522D,0xB3F0,0x402A,0x522A,0x3650,0xB3F1,0x522B,0x342B, - 0xB3F2,0xB3F3,0xB3F4,0x0000,0xB3F5,0x0000,0x0000,0x0000, - 0xB3F6,0xB3F7,0x372E,0x522E,0xB3F8,0x522F,0xB3F9,0xB3FA, - 0x5230,0x5231,0x3C5B,0x0000,0x0000,0x0000,0x387B,0x4C5E, - - /* 5300h */ - 0xB3FB,0x4C68,0x4677,0xB3FC,0x0000,0x4A71,0x5232,0x0000, - 0x5233,0x0000,0xB3FD,0xB3FE,0xB4A1,0x5235,0x0000,0x5237, - 0x5236,0xB4A2,0x0000,0xB4A3,0x0000,0x5238,0x323D,0x4B4C, - 0xB4A4,0x3A7C,0x5239,0xB4A5,0xB4A6,0x4159,0xB4A7,0xB4A8, - 0x3E22,0x3629,0x0000,0x523A,0x0000,0xB4A9,0x0000,0xB4AA, - 0xB4AB,0xB4AC,0x485B,0xB4AD,0xB4AE,0xB4AF,0x0000,0x523B, - 0xB4B0,0x523C,0xB4B1,0x523D,0x0000,0xB4B2,0x0000,0x0000, - 0x523E,0x4924,0x3668,0x3065,0xB4B3,0xB4B4,0xB4B5,0x463F, - 0x523F,0x3D3D,0xB4B6,0x4069,0x0000,0x5241,0x5240,0x3E23, - 0x3861,0x5243,0x483E,0xB4B8,0xB4B7,0x5244,0x0000,0x0000, - 0x0000,0x485C,0x4234,0x426E,0x3628,0x0000,0x0000,0x466E, - 0x4331,0xB4B9,0x476E,0xB4BA,0x4B4E,0x0000,0x5246,0x0000, - 0x406A,0xB4BB,0x0000,0xB4BC,0x0000,0xB4BD,0x3735,0x0000, - 0x0000,0x5247,0x0000,0x0000,0xB4BE,0xB4BF,0x5248,0x312C, - 0x3075,0x346D,0xB4C0,0x4228,0x3551,0x4D71,0x0000,0x524B, - 0x3237,0xB4C1,0x0000,0x524A,0x0000,0x0000,0xB4C2,0x362A, - 0x0000,0x0000,0x524C,0xB4C3,0x4C71,0x0000,0x0000,0xB4C4, - 0xB4C5,0x0000,0x0000,0x0000,0x0000,0x0000,0xB4C6,0x0000, - 0x0000,0x0000,0x0000,0xB4C7,0xB4C8,0x0000,0x524D,0x0000, - 0x4E52,0xB4C9,0x387C,0x0000,0x0000,0xB4CA,0x0000,0x3836, - 0x524E,0xB4CB,0x0000,0x0000,0xB4CC,0x5250,0x524F,0x0000, - 0x3F5F,0x3139,0xB4CD,0xB4CE,0x0000,0x315E,0x5251,0xB4CF, - 0x5252,0x0000,0xB4D0,0x3837,0xB4D1,0xB4D2,0x5253,0xB4D3, - 0xB4D4,0x0000,0xB4D5,0x356E,0x0000,0xB4D6,0x0000,0x0000, - 0xB4D7,0x0000,0x3B32,0x5254,0x0000,0xB4D8,0x0000,0x0000, - 0x4B74,0x3A35,0x355A,0x4D27,0x4150,0x483F,0x3C7D,0xB4D9, - 0x0000,0x0000,0xB4DA,0xB4DB,0x3D47,0xB4DC,0x3C68,0x3C75, - 0x0000,0x3D76,0xB4DD,0x4840,0x0000,0xB4DE,0xB4DF,0x5257, - 0xB4E0,0x3143,0x4151,0x387D,0x3845,0x3667,0xB4E1,0xB4E2, - 0x525B,0x4321,0x427E,0x362B,0x3E24,0x525C,0x525A,0x3244, - 0x4266,0x3C38,0x3B4B,0x3126,0x0000,0xB4E3,0x3370,0x3966, - 0x3B4A,0x0000,0x525D,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 5400h */ - 0x0000,0x525E,0xB4E4,0x3549,0x3346,0x0000,0x0000,0x0000, - 0x3967,0x3548,0x445F,0x3125,0x4631,0x4C3E,0x3921,0x4D79, - 0x4547,0x387E,0x0000,0xB4E5,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xB4E6,0x372F,0x0000,0x5267,0x0000,0x3663, - 0x4B4A,0xB4E7,0x0000,0x0000,0x0000,0x0000,0x485D,0xB4E8, - 0xB4E9,0x5266,0xB4EA,0x345E,0x5261,0x5262,0x5264,0xB4EB, - 0x0000,0xB4EC,0x0000,0x0000,0xB4ED,0xB4EE,0x5265,0x0000, - 0x355B,0x3F61,0x0000,0x4A2D,0x5263,0x525F,0x3863,0x0000, - 0x5260,0x0000,0x4F24,0xB4EF,0xB4F0,0x0000,0x4A72,0xB4F1, - 0x4468,0x3862,0x3970,0x0000,0x0000,0xB4F2,0x5268,0xB4F3, - 0x0000,0x465D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xB4F4,0x526C, - 0x0000,0x0000,0xB4F5,0x0000,0xB4F6,0x0000,0xB4F7,0xB4F8, - 0x3C7E,0xB4F9,0x3C76,0xB4FA,0x0000,0xB4FB,0xB4FC,0x0000, - 0x526F,0x526D,0x0000,0x4C23,0xB4FD,0x526A,0x5273,0x526E, - 0x0000,0x0000,0x0000,0x5271,0x3846,0x4C3F,0x0000,0xB4FE, - 0x5272,0xB5A1,0x0000,0xB5A2,0x5274,0xB5A3,0x5276,0x0000, - 0xB5A4,0xB5A5,0x0000,0x3A70,0x4F42,0xB5A6,0x526B,0x5269, - 0x5275,0xB5A7,0x5270,0x0000,0x0000,0xB5A8,0xB5A9,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xB5AA,0x0000,0x0000,0xB5AB, - 0x0000,0xB5AC,0x5278,0x0000,0x5323,0x527A,0xB5AD,0xB5AE, - 0x527E,0xB5AF,0xB5B0,0x5321,0x527B,0xB5B1,0xB5B2,0x533E, - 0x0000,0xB5B3,0x3A69,0x3331,0x0000,0x0000,0x0000,0xB5B4, - 0x5279,0xB5B5,0xB5B6,0xB5B7,0x5325,0x3076,0x5324,0xB5B8, - 0x3025,0x494A,0x5322,0x0000,0x527C,0x0000,0xB5B9,0x5277, - 0x527D,0x3A48,0xB5BA,0x0000,0x0000,0xB5BB,0xB5BC,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x5326,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xB5BD,0x3077,0x532F,0x0000,0x0000,0x5327,0x5328,0x0000, - 0x3E25,0x4B69,0xB5BE,0x0000,0xB5BF,0x532D,0x532C,0xB5C0, - 0x0000,0x0000,0x452F,0x0000,0x0000,0x0000,0xB5C1,0x0000, - 0x0000,0x0000,0x532E,0x0000,0xB5C2,0x532B,0xB5C3,0xB5C4, - - /* 5500h */ - 0xB5C5,0xB5C6,0x0000,0x0000,0x3134,0xB5C7,0x3A36,0x3F30, - 0xB5C8,0xB5C9,0x0000,0x0000,0xB5CA,0xB5CB,0xB5CC,0x5329, - 0x4562,0x0000,0x0000,0x0000,0x532A,0xB5CD,0x3022,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xB5CE,0xB5CF,0x0000,0x0000,0x5334,0x4D23, - 0x0000,0x3E27,0xB5D0,0x533A,0x0000,0xB5D1,0xB5D2,0x0000, - 0x5339,0x5330,0x0000,0xB5D3,0xB5D4,0xB5D5,0x4243,0x0000, - 0x5331,0xB5D6,0x0000,0x0000,0x426F,0x5336,0x3E26,0xB5D7, - 0x0000,0xB5D8,0xB5D9,0x0000,0x5333,0xB5DA,0x0000,0x4C64, - 0xB5DB,0xB5DC,0x0000,0x373C,0x0000,0x0000,0x5337,0x5338, - 0xB5DD,0x0000,0xB5DE,0xB5DF,0x5335,0x533B,0xB5E0,0x0000, - 0xB5E1,0xB5E2,0x0000,0x5332,0xB5E3,0x0000,0xB5E4,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x5341,0x5346,0x0000,0x5342,0xB5E5, - 0x533D,0xB5E6,0xB5E7,0x5347,0x4131,0x0000,0xB5E8,0x5349, - 0xB5E9,0x3922,0x533F,0x437D,0x0000,0x0000,0xB5EA,0xB5EB, - 0x0000,0xB5EC,0xB5ED,0xB5EE,0xB5EF,0x0000,0x0000,0xB5F0, - 0x5343,0x533C,0x342D,0x0000,0x346E,0x3365,0x5344,0x5340, - 0x0000,0x0000,0x0000,0xB5F1,0xB5F2,0x0000,0x0000,0x3776, - 0x534A,0x5348,0x4153,0x354A,0x362C,0xB5F3,0x5345,0x0000, - 0x3674,0x0000,0xB5F4,0x0000,0x0000,0x0000,0x3144,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xB5F5, - 0x0000,0xB5F6,0x0000,0xB5F7,0x534E,0x534C,0xB5F8,0x5427, - 0x0000,0xB5F9,0x0000,0xB5FA,0xB5FB,0x0000,0xB5FC,0x0000, - 0x0000,0xB5FD,0xB5FE,0xB6A1,0x5351,0x0000,0x0000,0xB6A2, - 0xB6A3,0x0000,0x534B,0xB6A4,0x534F,0x0000,0xB6A5,0x534D, - 0x0000,0x0000,0xB6A6,0x3B4C,0x5350,0x0000,0x0000,0x0000, - 0x0000,0xB6A7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xB6A8,0x5353, - 0x0000,0x5358,0x0000,0x0000,0x0000,0x5356,0x5355,0xB6A9, - - /* 5600h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0xB6AA,0x4332,0x0000, - 0xB6AB,0x3245,0xB6AC,0x0000,0x0000,0xB6AD,0xB6AE,0xB6AF, - 0xB6B0,0xB6B1,0xB6B2,0x0000,0x5352,0x0000,0x5354,0x3E28, - 0x3133,0xB6B3,0x0000,0x5357,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x325E,0x0000,0x0000,0xB6B4,0x0000,0x0000,0x5362, - 0xB6B5,0x3E7C,0x535E,0xB6B6,0x535C,0xB6B7,0x535D,0xB6B8, - 0x535F,0xB6B9,0x0000,0xB6BA,0xB6BB,0xB6BC,0x0000,0xB6BD, - 0xB6BE,0xB6BF,0x313D,0xB6C0,0xB6C1,0x0000,0xB6C2,0x0000, - 0x0000,0xB6C3,0x0000,0xB6C4,0x4139,0xB6C5,0x5359,0xB6C6, - 0x535A,0x0000,0x0000,0x0000,0xB6C7,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x337A,0x0000,0x0000,0xB6C8,0x0000, - 0xB6C9,0xB6CA,0xB6CB,0xB6CC,0x5361,0x0000,0xB6CD,0x0000, - 0x346F,0xB6CE,0x5364,0x5360,0x5363,0xB6CF,0x0000,0xB6D0, - 0x0000,0xB6D1,0xB6D2,0x0000,0x4A2E,0xB6D3,0x0000,0x0000, - 0x4655,0x0000,0x4838,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x5366,0x0000,0x0000,0x0000,0xB6D4,0xB6D5,0x5365,0x3345, - 0xB6D6,0x0000,0x5367,0xB6D7,0xB6D8,0x0000,0x0000,0x536A, - 0x0000,0x0000,0x0000,0x0000,0x5369,0xB6D9,0x0000,0x0000, - 0x0000,0xB6DA,0xB6DB,0x0000,0x0000,0xB6DC,0xB6DD,0xB6DE, - 0x5368,0x0000,0x4739,0x0000,0x0000,0x536B,0xB6DF,0xB6E0, - 0xB6E1,0xB6E2,0x0000,0xB6E3,0xB6E4,0xB6E5,0x536C,0x0000, - 0x0000,0xB6E6,0x0000,0xB6E7,0x536E,0x0000,0x536D,0xB6E8, - 0x0000,0x0000,0x0000,0x0000,0x5370,0x0000,0xB6E9,0x0000, - 0x5373,0x5371,0x536F,0x5372,0x0000,0xB6EA,0x0000,0x0000, - 0x5374,0xB6EB,0xB6EC,0xB6ED,0xB6F0,0xB6F1,0x5375,0xB6EE, - 0xB6EF,0x5376,0x0000,0x5377,0x0000,0x0000,0x0000,0x5378, - 0x5145,0xB6F2,0x3C7C,0x3B4D,0xB6F3,0xB6F4,0x3273,0xB6F5, - 0x3078,0xB6F6,0x0000,0x4344,0xB6F7,0xB6F8,0xB6F9,0xB6FA, - 0xB6FB,0x0000,0x0000,0xB6FD,0x0000,0xB6FE,0x5379,0x0000, - 0x3A24,0xB6FC,0x304F,0x3F5E,0x0000,0x0000,0xB7A1,0xB7A2, - 0x0000,0x537A,0x3847,0x0000,0x0000,0x3971,0x0000,0x537C, - - /* 5700h */ - 0x537B,0xB7A3,0xB7A4,0x4A60,0x537D,0x0000,0x0000,0xB7A5, - 0x5421,0x537E,0xB7A6,0x5422,0xB7A7,0x5423,0x0000,0x3777, - 0x0000,0xB7A8,0x3160,0x5424,0x0000,0xB7A9,0x5426,0x0000, - 0x5425,0x0000,0xB7AA,0xB7AB,0x5428,0xB7AC,0x0000,0x455A, - 0xB7AD,0x0000,0xB7AE,0xB7AF,0xB7B0,0xB7B1,0x5429,0x3035, - 0x3A5F,0xB7B2,0xB7B3,0x0000,0xB7B4,0x373D,0xB7B5,0xB7B6, - 0x434F,0x0000,0x0000,0xB7B7,0xB7B8,0x0000,0x0000,0x542A, - 0x542B,0x0000,0x0000,0x542D,0x0000,0xB7B9,0xB7BA,0xB7BB, - 0x542E,0x0000,0x3A64,0x0000,0x0000,0xB7BC,0xB7BD,0x3651, - 0x0000,0x0000,0x4B37,0x0000,0xB7BE,0xB7BF,0x542C,0x542F, - 0x3A41,0x3923,0xB7C0,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x5433,0xB7C1,0x0000,0x3A25,0xB7C2,0x4333,0xB7C3, - 0xB7C4,0x5430,0x445A,0xB7C5,0x0000,0xB7C6,0xB7C7,0xB7C8, - 0xB7C9,0xB7CA,0x0000,0xB7CB,0xB7CC,0xB7CD,0x0000,0xB7CE, - 0x0000,0xB7CF,0xB7D0,0xB7D1,0xB7D2,0x0000,0xB7D3,0x5434, - 0x0000,0xB7D4,0x3F62,0xB7D5,0x0000,0x0000,0x0000,0x0000, - 0x5432,0x5435,0x0000,0x373F,0xB7D6,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x5436,0xB7D7,0xB7E0,0x0000,0xB7D8, - 0x0000,0xB7D9,0xB7DA,0x0000,0xB7DB,0xB7DC,0xB7DD,0xB7DE, - 0x5437,0xB7DF,0x3924,0x3340,0x5439,0x0000,0x0000,0xB7E1, - 0xB7E2,0xB7E3,0x543A,0x0000,0xB7E4,0x0000,0x0000,0x0000, - 0x543B,0x0000,0x0000,0x5438,0x0000,0x0000,0x0000,0x0000, - 0xB7E5,0x0000,0x0000,0x0000,0x0000,0xB7E6,0x0000,0x0000, - 0x5431,0x0000,0x0000,0x543C,0x0000,0x0000,0x543D,0xB7E7, - 0xB7E8,0x0000,0x0000,0x4B64,0xB7E9,0x0000,0x3E6B,0xB7EA, - 0x0000,0x0000,0x543F,0x5440,0x543E,0xB7EB,0x5442,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x4738,0xB7EC,0xB7ED,0x3068, - 0x4956,0xB7FE,0x0000,0x5443,0xB7EE,0x0000,0xB7EF,0xB7F0, - 0x0000,0xB7F1,0x0000,0x0000,0x0000,0xB7F2,0x0000,0x0000, - 0xB7F3,0x0000,0x0000,0x0000,0x3E7D,0xB7F4,0xB7F5,0x3C39, - 0xB7F6,0x475D,0x3470,0x0000,0x3A6B,0xB7F7,0xB7F8,0xB7F9, - - /* 5800h */ - 0x4B59,0x0000,0x4632,0xB7FA,0xB7FB,0x3778,0x424F,0x0000, - 0xB7FC,0xB7FD,0x5441,0x5444,0xB8A1,0xB8A2,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x4244,0x0000,0x0000, - 0x0000,0x5445,0x0000,0xB8A3,0x0000,0x5446,0xB8A4,0xB8A5, - 0xB8A6,0x5448,0x0000,0x0000,0x4469,0x0000,0xB8A7,0xB8A8, - 0x0000,0x0000,0x342E,0x0000,0x0000,0xB8A9,0x0000,0x7421, - 0x3161,0x4A73,0xB8AA,0x0000,0x3E6C,0x4548,0x0000,0x0000, - 0x0000,0xB8AB,0x3A66,0x0000,0x0000,0x544E,0x0000,0xB8AC, - 0x4A3D,0x4E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xB8AD,0x3274,0x544A,0xB8AE,0xB8AF,0x0000,0xB8B0, - 0xB8B1,0x413A,0x544D,0x0000,0x4563,0xB8B2,0x0000,0x4549, - 0x4564,0x4839,0x444D,0x0000,0x0000,0x0000,0x3A49,0xB8B3, - 0x0000,0xB8B4,0x5449,0x0000,0xB8B5,0x0000,0x0000,0xB8B6, - 0xB8B7,0x3176,0x0000,0x4536,0x0000,0x0000,0x0000,0x0000, - 0x544B,0x0000,0x5447,0x0000,0x0000,0x3F50,0x0000,0x0000, - 0xB8B8,0x544F,0x0000,0x0000,0xB8B9,0x0000,0x3D4E,0xB8BA, - 0xB8BB,0xB8BC,0x0000,0x362D,0x0000,0x5450,0x0000,0xB8BD, - 0xB8BE,0xB8BF,0xB8C0,0x0000,0xB8C1,0xB8C2,0x0000,0xB8C3, - 0xB8C4,0x0000,0x0000,0x4A68,0xB8C5,0x0000,0xB8C6,0x417D, - 0x0000,0x0000,0x0000,0x0000,0x4446,0xB8C7,0x0000,0x5452, - 0xB8C8,0xB8C9,0xB8CA,0x0000,0x0000,0x0000,0xB8CB,0x0000, - 0x4B4F,0xB8CC,0x0000,0x5453,0x0000,0x0000,0x5458,0x0000, - 0x0000,0xB8CD,0xB8CE,0x4A2F,0x0000,0x0000,0x0000,0x0000, - 0x5457,0x5451,0x5454,0x5456,0xB8D0,0x0000,0x3A26,0x0000, - 0x0000,0x4A49,0xB8D1,0x0000,0xB8CF,0x5459,0x0000,0x4345, - 0xB8D2,0x0000,0x3275,0x0000,0x3E6D,0xB8D3,0xB8D4,0x0000, - 0xB8D5,0x545B,0xB8D6,0x545A,0xB8D7,0x3968,0xB8D8,0x545C, - 0x545E,0x545D,0xB8D9,0x0000,0x5460,0xB8DA,0x5455,0x5462, - 0x0000,0xB8DB,0xB8DC,0x0000,0x5461,0x545F,0x0000,0x0000, - 0x0000,0xB8DD,0x0000,0x3B4E,0x3F51,0x0000,0x4154,0x5463, - 0x403C,0x306D,0x4764,0xB8DE,0x0000,0x0000,0x0000,0x445B, - 0x0000,0x5465,0x5464,0x5466,0x5467,0x5468,0x0000,0x0000, - - /* 5900h */ - 0x0000,0x0000,0x5469,0x0000,0x0000,0xB8DF,0xB8E0,0x0000, - 0x0000,0x4A51,0x546A,0xB8E1,0xB8E2,0x0000,0x0000,0x3246, - 0x546B,0x0000,0xB8E3,0xB8E4,0xB8E5,0x4D3C,0x3330,0x0000, - 0x5249,0x3D48,0x423F,0x546C,0x4C6B,0xB8E7,0x0000,0x0000, - 0x0000,0xB8E8,0x4C34,0xB8E9,0xB8EA,0x546E,0x0000,0x4267, - 0xB8EB,0x4537,0x4240,0x4957,0x546F,0x5470,0x317B,0xB8EC, - 0xB8ED,0x3C3A,0x5471,0xB8EE,0x0000,0xB8EF,0xB8F0,0x3050, - 0x5472,0x0000,0x0000,0x0000,0x0000,0x0000,0x5473,0xB8F1, - 0x0000,0x0000,0x0000,0xB8F2,0x3162,0x0000,0xB8F3,0x3471, - 0x4660,0x4A74,0x0000,0x0000,0x0000,0x0000,0x5477,0x4155, - 0x5476,0x3740,0xB8F4,0xB8F5,0x4B5B,0x5475,0x0000,0x4565, - 0x5479,0xB8F6,0x5478,0xB8F7,0x0000,0xB8F8,0xB8F9,0xB8FA, - 0x547B,0xB8FB,0x547A,0xB8FC,0x0000,0x317C,0x0000,0x547C, - 0x3E29,0x547E,0x4325,0xB8FD,0x547D,0xB8FE,0x4A33,0xB9A1, - 0x0000,0x0000,0xB9A2,0x3D77,0x455B,0xB9A3,0xB9A4,0x0000, - 0x5521,0xB9A5,0x0000,0xB9A6,0xB9A7,0x3925,0x0000,0x0000, - 0x0000,0x5522,0x4721,0x485E,0x4C51,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x4725,0xB9A8,0xB9A9,0x552B,0xB9AA,0x0000, - 0x0000,0x0000,0xB9AB,0x3538,0x0000,0xB9AC,0x4D45,0xB9AD, - 0x0000,0x4C2F,0x0000,0x562C,0x0000,0x5523,0x0000,0xB9AE, - 0x0000,0x0000,0x0000,0x5526,0xB9AF,0x4245,0x0000,0xB9B0, - 0x4B38,0x0000,0x0000,0x0000,0x454A,0xB9B1,0xB9B2,0xB9B3, - 0xB9B4,0x0000,0x5527,0xB9B5,0x0000,0x0000,0x0000,0xB9B6, - 0x0000,0x4B65,0xB9B7,0x3A4A,0xB9B8,0x0000,0x3E2A,0x0000, - 0x0000,0xB9B9,0x0000,0xB9BA,0xB9BB,0x0000,0x5528,0x0000, - 0xB9BC,0x3B50,0xB9BD,0x3B4F,0x0000,0xB9BE,0x0000,0x0000, - 0x3039,0x3848,0xB9BF,0x402B,0x3051,0x0000,0x0000,0x0000, - 0x0000,0x552C,0x552D,0x0000,0x552A,0xB9C0,0xB9C1,0xB9C2, - 0x0000,0x0000,0x0000,0xB9C3,0xB9C4,0x3138,0x342F,0xB9C5, - 0x5529,0x0000,0x4C45,0x4931,0x0000,0x0000,0xB9C6,0xB9C7, - 0x0000,0xB9C8,0xB9C9,0x0000,0xB9CA,0x0000,0x3028,0xB9CB, - 0x0000,0x0000,0x0000,0x3079,0x0000,0x0000,0x0000,0x3B51, - - /* 5A00h */ - 0xB9CC,0x3052,0x0000,0x3023,0xB9CD,0x0000,0x0000,0x0000, - 0x0000,0x5532,0x0000,0x0000,0xB9CE,0xB9CF,0xB9D0,0x0000, - 0x0000,0x5530,0xB9D1,0xB9D2,0x0000,0x0000,0x0000,0x0000, - 0x4C3C,0x0000,0x5533,0x0000,0x5531,0x0000,0xB9D3,0x552F, - 0x3F31,0x0000,0x0000,0xB9D4,0xB9D5,0x552E,0x0000,0xB9D6, - 0xB9D7,0x4A5A,0xB9D8,0x0000,0x0000,0xB9D9,0x0000,0x3864, - 0xB9DA,0x0000,0x0000,0x0000,0x0000,0x5537,0x5538,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x3E2B,0x0000,0x0000,0x0000, - 0x5534,0x4F2C,0x0000,0x0000,0xB9DB,0xB9DC,0x474C,0xB9DD, - 0xB9DE,0x5536,0x0000,0x0000,0xB9DF,0x0000,0x0000,0x0000, - 0xB9E0,0x0000,0x0000,0x0000,0x0000,0xB9E1,0x0000,0x0000, - 0x0000,0x0000,0x3A27,0x0000,0x0000,0x0000,0xB9E2,0x0000, - 0x0000,0x0000,0x5539,0xB9E3,0x0000,0xB9E4,0x4958,0xB9E5, - 0x0000,0x0000,0x553A,0x0000,0x5535,0xB9E6,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xB9E7, - 0x0000,0x0000,0xB9E8,0xB9E9,0x0000,0x0000,0xB9EA,0x4C3B, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xB9EB,0x0000,0x0000,0x0000,0x0000, - 0xB9EC,0x0000,0x475E,0xB9ED,0x0000,0x0000,0xB9EE,0x0000, - 0x0000,0xB9EF,0x553B,0x4932,0xB9F0,0x0000,0xB9F1,0xB9F2, - 0xB9F3,0x0000,0xB9F4,0x0000,0x0000,0x0000,0x0000,0xB9F5, - 0x0000,0x0000,0x0000,0x0000,0xB9F6,0x0000,0x0000,0x0000, - 0x0000,0xB9F7,0xB9F8,0xB9F9,0x0000,0xB9FA,0x0000,0x0000, - 0xB9FB,0x0000,0xB9FC,0xB9FD,0x553C,0x5540,0x553D,0xB9FE, - 0x0000,0x3247,0x553F,0x0000,0xBAA1,0x0000,0xBAA2,0x0000, - 0xBAA3,0x3C3B,0x0000,0x553E,0x3779,0x0000,0x0000,0xBAA4, - 0x554C,0x0000,0x0000,0x0000,0x0000,0x0000,0x5545,0x5542, - 0x0000,0x0000,0xBAA5,0x0000,0xBAA6,0x0000,0x0000,0x0000, - 0xBAA7,0x4364,0x0000,0x5541,0x0000,0xBAA8,0x5543,0x0000, - 0x0000,0x5544,0xBAA9,0x0000,0x0000,0x0000,0xBAAA,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xBAAB,0xBAAC,0x0000, - 0x0000,0x0000,0x5546,0x5547,0x0000,0xBAAD,0x0000,0x0000, - - /* 5B00h */ - 0xBAAE,0xBAAF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xBAB0,0x3472,0x0000,0x5549,0x5548,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x554A,0xBAB1, - 0x0000,0xBAB3,0x0000,0xBAB4,0x0000,0xBAB5,0x0000,0x0000, - 0x0000,0xBAB6,0x3E6E,0x0000,0x0000,0xBAB7,0x0000,0x0000, - 0x0000,0x0000,0x554D,0x0000,0x445C,0xBAB8,0x0000,0x0000, - 0x3145,0x0000,0x554B,0x0000,0xBAB2,0x0000,0x554E,0x0000, - 0xBAB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x554F,0x0000, - 0x5552,0xBABA,0x0000,0x5550,0x0000,0x5551,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xBABB,0xBABC,0x0000,0x0000,0x0000, - 0x3B52,0x5553,0xBABD,0x0000,0x3926,0x5554,0xBABE,0x3B7A, - 0x4238,0x0000,0x5555,0x5556,0x3B5A,0x3927,0xBABF,0x4C52, - 0x0000,0x0000,0x0000,0x3528,0x3849,0x5557,0x3358,0x0000, - 0xBAC0,0x5558,0x0000,0x4239,0x0000,0x0000,0xBAC1,0xBAC2, - 0x5559,0x5623,0x0000,0x555A,0x0000,0x555B,0x0000,0x0000, - 0x555C,0x0000,0x555E,0x0000,0xBAC3,0xBAC4,0xBAC5,0xBAC6, - 0x555F,0xBAC7,0x0000,0x5560,0xBAC8,0x4270,0xBAC9,0x3127, - 0x3C69,0x3042,0xBACA,0x4157,0x3430,0x3C35,0xBACB,0x3928, - 0xBACC,0xBACD,0x0000,0xBACE,0xBACF,0x4566,0xBAD0,0x3D21, - 0x3431,0x4368,0x446A,0x3038,0x3539,0x4A75,0x0000,0x3C42, - 0x0000,0x0000,0x3552,0x406B,0x3C3C,0x4D28,0x5561,0x0000, - 0xBAD1,0xBAD2,0x0000,0x0000,0xBAD3,0xBAD4,0x355C,0xBAD5, - 0x3A4B,0xBAD6,0xBAD7,0x3332,0x3163,0x3E2C,0x3248,0xBAD8, - 0x5562,0x4D46,0xBAD9,0x0000,0xBADA,0x0000,0x0000,0x3D49, - 0xBADB,0xBADC,0x3C64,0x5563,0x3473,0x4652,0x4C29,0x5564, - 0x0000,0x5565,0x0000,0x0000,0x4959,0xBADD,0x0000,0xBADE, - 0x5567,0x0000,0x3428,0x3677,0x5566,0x0000,0xBADF,0xBAE0, - 0xBAE1,0xBAE2,0xBAE3,0x3432,0x0000,0x3F32,0x556B,0x3B21, - 0xBAE4,0x3249,0x556A,0x0000,0x5568,0x556C,0x5569,0x472B, - 0x5C4D,0x3F33,0x0000,0x556D,0x0000,0x0000,0x4E40,0xBAE5, - 0x556E,0xBAE6,0x0000,0x5570,0xBAE7,0x437E,0x556F,0x0000, - 0x4023,0x0000,0x3B7B,0x0000,0x0000,0xBAE8,0x4250,0x3C77, - - /* 5C00h */ - 0x0000,0x4975,0x406C,0x0000,0x3C4D,0x5571,0x3E2D,0x5572, - 0x5573,0x3053,0x423A,0x3F52,0xBAE9,0x5574,0x4633,0x3E2E, - 0x0000,0x3E2F,0x0000,0x5575,0x0000,0x0000,0x406D,0xBAEA, - 0x0000,0x0000,0x3E30,0x0000,0x0000,0x0000,0xBAEB,0xBAEC, - 0x5576,0x0000,0x5577,0xBAED,0x4C60,0x0000,0xBAEE,0x0000, - 0x5578,0xBAEF,0x0000,0xBAF0,0xBAF1,0x3646,0xBAF2,0x0000, - 0xBAF3,0x3D22,0xBAF4,0x0000,0x0000,0xBAF5,0xBAF6,0x0000, - 0x5579,0x557A,0x3C5C,0x3F2C,0x4674,0x3F54,0x4878,0x4722, - 0x3649,0x557B,0x0000,0x0000,0x0000,0x356F,0x557C,0x0000, - 0x367E,0x0000,0x464F,0x3230,0x0000,0x3B53,0x557D,0x5622, - 0x5621,0x367D,0x0000,0x557E,0x0000,0x4538,0x0000,0x0000, - 0x0000,0xBAF7,0xBAF8,0x0000,0xBAF9,0x0000,0x4230,0x0000, - 0x454B,0x3C48,0xBAFA,0xBAFB,0x4158,0x4D7A,0x0000,0xBAFC, - 0xBAFD,0xBAFE,0x0000,0x0000,0x5624,0xBBA1,0x5625,0x4656, - 0xBBA2,0x3B33,0x0000,0x0000,0xBBA3,0xBBA4,0x5627,0x0000, - 0x0000,0x5628,0xBBA5,0xBBA6,0xBBA7,0xBBA8,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xBBA9, - 0xBBAA,0x0000,0xBBAB,0x0000,0x5629,0x0000,0x0000,0xBBAC, - 0x3474,0x562A,0xBBAD,0x0000,0x562B,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xBBAE,0x0000,0xBBAF, - 0xBBB0,0x322C,0xBBB1,0xBBB2,0x0000,0x0000,0xBBB3,0x0000, - 0x413B,0x3464,0xBBB4,0x562D,0x4C28,0x0000,0x0000,0x0000, - 0x0000,0x4252,0xBBB5,0x3359,0xBBB6,0xBBB7,0x562F,0x5631, - 0x345F,0x0000,0xBBB8,0x562E,0x5630,0x0000,0x5633,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x5632,0x0000,0x5634, - 0x0000,0xBBB9,0x0000,0xBBBA,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xBBBB,0x0000,0x0000,0x0000,0x0000,0xBBBD, - 0x0000,0x5635,0x0000,0x0000,0x0000,0xBBBC,0x0000,0x0000, - 0x463D,0x362E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x3265,0x5636,0x563B,0x0000,0x0000,0x5639,0xBBBE,0x4A77, - 0x4A76,0xBBBF,0xBBC0,0x0000,0xBBC1,0x0000,0x4567,0x0000, - 0x0000,0x0000,0x5638,0x3D54,0x0000,0x5637,0x0000,0x0000, - - /* 5D00h */ - 0x0000,0xBBC2,0x0000,0x0000,0x0000,0x0000,0xBBC3,0x3F72, - 0x0000,0x0000,0x0000,0x563C,0x0000,0xBBC4,0x3A6A,0x0000, - 0x0000,0x5642,0xBBC5,0x0000,0x5643,0x563D,0x3333,0x563E, - 0x5647,0x5646,0x5645,0x5641,0x0000,0x0000,0x0000,0x5640, - 0x0000,0x0000,0x5644,0xBBC7,0xBBC8,0x0000,0xBBC9,0xBBCA, - 0x0000,0x4A78,0x0000,0xBBC6,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xBBCB,0x0000,0x0000,0xBBCC,0x0000,0x0000,0x0000, - 0x0000,0xBBCD,0x0000,0x0000,0x0000,0xBBCE,0x0000,0xBBCF, - 0x0000,0x0000,0xBBD0,0xBBD1,0x0000,0x0000,0xBBD2,0x0000, - 0xBBD3,0x0000,0xBBD7,0x564B,0x5648,0x0000,0x564A,0x0000, - 0x4D72,0xBBD5,0x5649,0x0000,0x0000,0xBBD4,0x0000,0x0000, - 0x0000,0xBBD6,0x0000,0x0000,0x563F,0x0000,0x0000,0xBBD8, - 0xBBD9,0xBBDA,0xBBDB,0x0000,0xBBDC,0x0000,0x0000,0x0000, - 0x0000,0x3F73,0xBBDD,0x0000,0x564C,0xBBDE,0x0000,0x3A37, - 0xBBDF,0x0000,0x0000,0x564D,0x0000,0x0000,0x564E,0x0000, - 0x0000,0xBBE0,0xBBE1,0x0000,0x0000,0x0000,0xBBE2,0xBBE3, - 0x0000,0xBBE4,0x5651,0xBBE5,0x5650,0x0000,0x0000,0x564F, - 0xBBE6,0x0000,0xBBE7,0x4568,0x563A,0x0000,0x0000,0x0000, - 0x5657,0x0000,0xBBE8,0xBBE9,0xBBEA,0xBBEB,0x0000,0x0000, - 0x0000,0xBBEC,0x0000,0xBBED,0x0000,0x5653,0x0000,0xBBEE, - 0xBBEF,0x0000,0x5652,0x0000,0x0000,0x0000,0x0000,0xBBF0, - 0x0000,0x0000,0x0000,0xBBF1,0x5654,0x0000,0x5655,0x0000, - 0xBBF2,0x0000,0xE6F4,0x0000,0xBBF3,0x0000,0x0000,0x5658, - 0xBBF4,0xBBF5,0x4E66,0x0000,0x5659,0x5656,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xBBF6,0x0000,0x0000,0x0000,0xBBF7, - 0x0000,0x565A,0x0000,0xBBF8,0x3460,0x565B,0xBBFA,0x0000, - 0xBBF9,0x0000,0x565D,0x565C,0x0000,0x0000,0x565E,0x0000, - 0xBBFB,0xBBFC,0x0000,0x565F,0x0000,0x406E,0x3D23,0x0000, - 0xBBFD,0x3D64,0x0000,0x4163,0xBBFE,0x3929,0x3A38,0x392A, - 0x3570,0xBCA1,0x0000,0x5660,0x0000,0x0000,0x3A39,0x0000, - 0x0000,0x384A,0x5661,0x4C26,0x4743,0x5662,0x0000,0x392B, - 0xBCA2,0xBCA3,0x0000,0x342C,0x0000,0x4327,0x3652,0x0000, - - /* 5E00h */ - 0xBCA4,0x0000,0x3B54,0x495B,0x0000,0x0000,0x4841,0xBCA5, - 0x0000,0x0000,0x0000,0x5663,0x3475,0xBCA6,0x0000,0x0000, - 0x0000,0x5666,0xBCA7,0x0000,0xBCA8,0xBCA9,0x4421,0x0000, - 0xBCAA,0x5665,0x5664,0x5667,0x0000,0x446B,0x0000,0xBCAB, - 0xBCAC,0x0000,0x0000,0x0000,0x0000,0x3F63,0x0000,0x0000, - 0xBCAE,0x0000,0x0000,0x3B55,0x0000,0x404A,0xBCAD,0x4253, - 0x3522,0x0000,0xBCAF,0x4422,0x0000,0xBCB0,0x5668,0x5669, - 0x3E6F,0x0000,0x0000,0x0000,0x0000,0x4B39,0xBCB1,0x0000, - 0x566C,0x0000,0x0000,0x566B,0x566A,0x497D,0x0000,0x5673, - 0x0000,0xBCB4,0x0000,0xBCB2,0x4B5A,0x0000,0x566D,0x0000, - 0xBCB3,0xBCB5,0x0000,0x0000,0x566F,0x4B6B,0xBCB6,0x566E, - 0xBCB7,0x0000,0x0000,0xBCB8,0xBCB9,0x0000,0xBCBA,0x5670, - 0x0000,0x4828,0x5671,0x4A3E,0x5672,0x0000,0x0000,0x0000, - 0xBCBB,0x0000,0xBCBC,0xBCBD,0xBCBE,0xBCBF,0xBCC0,0x0000, - 0xBCC1,0x0000,0x3433,0x4A3F,0x472F,0x5674,0x5675,0x0000, - 0x392C,0x3434,0x5676,0x3838,0x4D44,0x4D29,0x3476,0x5678, - 0xBCC2,0x4423,0x0000,0x392D,0x3E31,0x0000,0x0000,0x485F, - 0x0000,0x0000,0x3E32,0xBCC3,0x0000,0x0000,0xBCC4,0x3D78, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x446C,0x4A79,0x4539, - 0x0000,0x0000,0x392E,0x0000,0x495C,0x0000,0x0000,0x0000, - 0x5679,0x0000,0xBCC5,0x0000,0xBCC6,0xBCC7,0x4559,0x3A42, - 0xBCC8,0x0000,0xBCC9,0x384B,0xBCCA,0x446D,0x0000,0x0000, - 0x0000,0xBCCB,0x0000,0xBCCC,0x0000,0x3043,0x3D6E,0x392F, - 0x4D47,0x0000,0x0000,0x0000,0x0000,0xBCCD,0xBCCE,0xBCCF, - 0x0000,0x567A,0x567B,0x4751,0x0000,0x0000,0xBCD0,0x0000, - 0x567C,0x4E77,0x4F2D,0xBCD2,0xBCD1,0x0000,0xBCD3,0x567E, - 0x567D,0xBCD4,0xBCD5,0x3347,0xBCD6,0xBCD7,0x5721,0x0000, - 0x0000,0x0000,0x5724,0x5725,0xBCD8,0x5723,0xBCD9,0x4940, - 0x3E33,0x5727,0x5726,0x5722,0x0000,0xBCDA,0x0000,0x0000, - 0x5728,0x5729,0x0000,0xBCDB,0x572A,0x0000,0x0000,0x0000, - 0x572D,0x572B,0x0000,0x572C,0x572E,0x0000,0x3164,0x446E, - 0x572F,0x0000,0x377A,0x3276,0x4736,0x0000,0x5730,0x467B, - - /* 5F00h */ - 0x0000,0x4A5B,0xBCDC,0x5731,0x4F2E,0x0000,0xBCDD,0xBCDE, - 0xBCDF,0x5732,0x4A40,0x5735,0x5021,0x5031,0xBCE0,0x3C30, - 0x4675,0x5736,0x0000,0x355D,0x4424,0x307A,0x5737,0x4A26, - 0x3930,0xBCE1,0x0000,0x4350,0xBCE2,0xBCE3,0x0000,0x446F, - 0x0000,0xBCE4,0xBCE5,0xBCE6,0xBCE7,0x4C6F,0x3839,0x384C, - 0xBCE8,0x5738,0x0000,0xBCE9,0xBCEA,0x5739,0xBCEB,0x573F, - 0xBCEC,0x3C65,0x0000,0x0000,0xBCED,0x4425,0xBCEE,0x362F, - 0x573A,0x0000,0x0000,0xBCEF,0x492B,0xBCF0,0x4346,0xBCF1, - 0xBCF2,0x573B,0x0000,0x0000,0xBCF3,0xBCF4,0x0000,0xBCF5, - 0x573C,0x0000,0x3630,0x0000,0x573D,0xBCF6,0x573E,0x0000, - 0xBCF7,0x5740,0x0000,0x4576,0xBCF8,0x0000,0x5741,0x5742, - 0xBCF9,0x5743,0x0000,0xBCFA,0x5734,0x5733,0x0000,0x0000, - 0xBCFB,0x5744,0x3741,0xBCFC,0xBCFD,0x0000,0x4927,0xBCFE, - 0x0000,0x3A4C,0x4937,0x4426,0x494B,0x5745,0x0000,0xBDA1, - 0x3E34,0x3146,0xBDA2,0x5746,0xBDA3,0xBDA4,0x0000,0x5747, - 0xBDA5,0x4C72,0xBDA6,0x0000,0x4860,0xBDA7,0xBDA8,0x574A, - 0x317D,0x402C,0x5749,0x5748,0x3742,0x4254,0x0000,0x574E, - 0x574C,0xBDA9,0x574B,0x4E27,0x3865,0xBDAA,0x0000,0xBDAB, - 0x3D79,0x574D,0x454C,0x3D3E,0x0000,0x0000,0xBDAC,0x4640, - 0x5751,0x5750,0x0000,0x0000,0xBDAD,0xBDAE,0x574F,0x0000, - 0x5752,0x3866,0xBDAF,0x0000,0xBDB2,0x0000,0x0000,0xBDB0, - 0x5753,0x497C,0x3D5B,0xBDB1,0xBDB3,0x5754,0x4879,0xBDB4, - 0xBDB5,0xBDB6,0x0000,0x4641,0x4427,0x0000,0x0000,0x0000, - 0xBDB7,0x4530,0x0000,0x0000,0x5755,0x352B,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3F34,0xBDB8,0x492C,0x0000,0xBDB9, - 0xBDBA,0xBDBB,0x0000,0xBDBC,0x3477,0x4726,0x0000,0x0000, - 0xBDBD,0xBDBE,0xBDBF,0xBDC0,0xBDC1,0x0000,0x5756,0x3B56, - 0x4B3A,0x4B3B,0x0000,0x0000,0x317E,0x575B,0xBDC2,0x0000, - 0x4369,0xBDC3,0xBDC4,0x0000,0x5758,0x0000,0x0000,0x0000, - 0xBDC5,0xBDC6,0xBDC7,0x3277,0xBDC8,0xBDC9,0xBDCA,0xBDCB, - 0x582D,0x575A,0xBDCC,0xBDCD,0x0000,0x4730,0xBDCE,0x0000, - 0x5759,0x0000,0xBDCF,0x5757,0xBDD0,0x397A,0x0000,0x575D, - - /* 6000h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xBDD1, - 0x0000,0x0000,0xBDD2,0x0000,0x0000,0xBDD3,0x5763,0x5769, - 0x5761,0x0000,0x455C,0xBDD4,0xBDD5,0x5766,0x495D,0xBDD6, - 0xBDD7,0x5760,0xBDD8,0x5765,0x4E67,0x3B57,0x0000,0xBDD9, - 0x4255,0x575E,0x0000,0x0000,0xBDDA,0x355E,0x5768,0x402D, - 0x3165,0x5762,0x3278,0x5767,0x0000,0xBDDB,0x0000,0x3631, - 0x0000,0x5764,0x0000,0xBDDC,0x0000,0xBDDD,0x0000,0x0000, - 0x0000,0x0000,0x576A,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xBDDE,0x576C,0x5776,0x5774,0x0000,0x0000,0x5771,0xBDDF, - 0xBDE0,0xBDE1,0x5770,0x4E78,0xBDE2,0x5772,0x0000,0x0000, - 0x3632,0xBDE3,0x3931,0x0000,0xBDE4,0x3D7A,0xBDE5,0xBDE6, - 0x0000,0x5779,0x576B,0x0000,0x0000,0xBDE7,0x0000,0x576F, - 0x575F,0xBDE8,0x327A,0x5773,0x5775,0x4351,0x0000,0xBDE9, - 0x3A28,0x3238,0x576D,0x5778,0x5777,0x3633,0x0000,0x4229, - 0x3366,0xBDEA,0x0000,0x0000,0x0000,0x3743,0x0000,0x576E, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xBDEB,0xBDEC, - 0x0000,0x577A,0xBDED,0x577D,0x5821,0x0000,0xBDEE,0x0000, - 0xBDEF,0x3C3D,0xBDF0,0x5827,0x4470,0x577B,0xBDF1,0x0000, - 0x0000,0xBDF2,0x5825,0xBDF3,0x3279,0xBDF4,0x5823,0x5824, - 0xBDF5,0x0000,0x577E,0x5822,0x0000,0xBDF6,0xBDF7,0x3867, - 0x4D2A,0x0000,0xBDF8,0x3435,0xBDF9,0xBDFA,0x3159,0x5826, - 0xBDFB,0x473A,0x302D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xBDFC,0xBDFD,0x4861,0x575C,0x582C,0x5830,0x4C65,0xBDFE, - 0x5829,0x0000,0x0000,0xBEA1,0x4569,0x582E,0xBEA2,0x0000, - 0x0000,0x0000,0xBEA3,0x0000,0xBEA4,0x3E70,0x582F,0x4657, - 0xBEA5,0xBEA6,0xBEA7,0xBEA8,0x0000,0x0000,0xBEA9,0xBEAA, - 0x0000,0x4F47,0x0000,0x582B,0xBEAB,0xBEAC,0x0000,0x0000, - 0x5831,0xBEAD,0x397B,0xBEAE,0x404B,0xBEAF,0xBEB0,0x3054, - 0x582A,0x5828,0xBEB1,0x415A,0x0000,0xBEB2,0x0000,0x577C, - 0x3B34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x4246,0x583D,0xBEB3,0x415B,0x5838,0xBEB4,0x5835,0x5836, - 0xBEB5,0x3C66,0x5839,0x583C,0xBEB6,0xBEB7,0x0000,0x0000, - - /* 6100h */ - 0x5837,0x3D25,0xBEB8,0x583A,0x0000,0x0000,0x5834,0xBEB9, - 0x4C7C,0x4C7B,0xBEBA,0x0000,0xBEBB,0x583E,0x583F,0x3055, - 0xBEBC,0xBEBD,0xBEBE,0xBEBF,0xBEC0,0x5833,0xBEC1,0xBEC2, - 0x0000,0xBEC3,0x3672,0x3026,0xBEC4,0x0000,0xBEC5,0x3436, - 0x0000,0x583B,0xBEC6,0x0000,0x0000,0x0000,0x0000,0x5843, - 0x5842,0x0000,0xBEC7,0xBEC8,0x5847,0x0000,0x0000,0x0000, - 0xBEC9,0xBECA,0x0000,0x0000,0x5848,0xBECB,0xBECC,0xBECD, - 0x0000,0xBECE,0x0000,0x0000,0x5846,0x5849,0x5841,0x5845, - 0x0000,0xBECF,0x584A,0x0000,0x584B,0xBED0,0xBED1,0x5840, - 0x3B7C,0xBED2,0x5844,0x4256,0x3932,0x5832,0x3F35,0x0000, - 0x0000,0x0000,0x0000,0x5858,0x0000,0x4A69,0x0000,0x0000, - 0x584E,0x584F,0x5850,0x0000,0x0000,0x5857,0xBED3,0x5856, - 0xBED4,0x0000,0x4B7D,0x3437,0x0000,0x5854,0x0000,0x3745, - 0x3334,0x0000,0x0000,0x5851,0xBED5,0x0000,0x4E38,0x5853, - 0x3056,0x5855,0xBED6,0x584C,0x5852,0x5859,0x3744,0x584D, - 0xBED7,0x0000,0x0000,0xBED8,0xBED9,0x0000,0x4D5D,0xBEDA, - 0xBEDB,0xBEDC,0x4D2B,0xBEDD,0xBEDE,0x0000,0x0000,0x585C, - 0x0000,0x0000,0x5860,0xBEDF,0x0000,0xBEE0,0x417E,0x0000, - 0x4E79,0x5861,0xBEE1,0xBEE2,0x585E,0x0000,0x585B,0xBEE3, - 0xBEE4,0x585A,0x585F,0x0000,0xBEE5,0xBEE6,0x0000,0xBEE7, - 0xBEE8,0x0000,0x0000,0x0000,0x4A30,0xBEE9,0x0000,0x4634, - 0xBEEA,0x3746,0xBEEB,0x5862,0x585D,0xBEEC,0x5863,0x0000, - 0x0000,0x0000,0x377B,0x0000,0x0000,0x0000,0x3231,0x0000, - 0xBEED,0xBEEE,0x586B,0x0000,0xBEEF,0x0000,0x3438,0x0000, - 0xBEF0,0xBEF1,0xBEF2,0x5869,0x0000,0x0000,0x586A,0x3A29, - 0x5868,0x5866,0x5865,0x586C,0x5864,0x586E,0xBEF3,0xBEF4, - 0x327B,0x0000,0x0000,0x0000,0x0000,0xBEF5,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xBEF6,0xBEF7,0xBEF8,0xBEF9, - 0x0000,0xBEFA,0xBEFB,0x5870,0x0000,0xBEFE,0x586F,0xBEFC, - 0x0000,0xBEFD,0x0000,0x0000,0xBFA1,0xBFA2,0x0000,0xBFA3, - 0x0000,0x0000,0x4428,0x0000,0x5873,0x0000,0x5871,0x5867, - 0x377C,0x0000,0x5872,0x0000,0x5876,0x5875,0x5877,0x5874, - - /* 6200h */ - 0x5878,0xBFA4,0x0000,0xBFA5,0xBFA6,0x0000,0x0000,0xBFA7, - 0x5879,0x587A,0x4A6A,0x0000,0x587C,0x587B,0x3D3F,0x0000, - 0x402E,0x3266,0x327C,0xBFA8,0x587D,0xBFA9,0x303F,0x0000, - 0x0000,0x0000,0x404C,0x587E,0xBFAA,0x6C43,0x5921,0x3761, - 0xBFAB,0x5922,0xBFAC,0xBFAD,0x0000,0x0000,0x406F,0xBFAE, - 0x0000,0xBFAF,0x5923,0xBFB0,0x0000,0x0000,0x5924,0x353A, - 0x5925,0x0000,0x5926,0x5927,0x4257,0x0000,0x0000,0x0000, - 0x384D,0xBFB1,0x0000,0x4C61,0x0000,0xBFB2,0x0000,0x4B3C, - 0x3D6A,0x5928,0xBFB3,0xBFB4,0xBFB5,0x0000,0xBFB6,0x4070, - 0x6E3D,0x4862,0x0000,0x3C6A,0xBFB7,0x3A4D,0x5929,0x0000, - 0xBFB8,0xBFB9,0xBFBA,0x4247,0xBFBB,0x4A27,0xBFBC,0x0000, - 0x4271,0x0000,0xBFBD,0x592C,0xBFBE,0x0000,0x592A,0x0000, - 0x592D,0x0000,0x0000,0x592B,0xBFBF,0x0000,0x0000,0x0000, - 0x592E,0x0000,0x0000,0x0000,0x0000,0xBFC0,0x4A31,0xBFC1, - 0x0000,0x3037,0x0000,0xBFC2,0x0000,0x0000,0x495E,0x0000, - 0x0000,0x4863,0xBFC3,0x0000,0x592F,0xBFC4,0x5932,0x3E35, - 0x353B,0x0000,0x5930,0x5937,0x3E36,0x0000,0x0000,0x0000, - 0x0000,0x5931,0x4744,0x0000,0x0000,0xBFC5,0xBFC6,0xBFC7, - 0xBFC8,0x4D5E,0x5933,0x5934,0x5938,0x456A,0x5935,0x3933, - 0x405E,0x0000,0x0000,0x5946,0x4834,0x0000,0x4272,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xBFC9,0x0000, - 0xBFCA,0x0000,0x0000,0x4864,0x5A2D,0x0000,0x0000,0x0000, - 0x0000,0x4A7A,0x0000,0xBFCB,0x0000,0x4471,0xBFCC,0xBFCD, - 0x0000,0x4B75,0xBFCE,0x593B,0x3221,0x436A,0xBFCF,0xBFD0, - 0x0000,0x0000,0x5944,0x0000,0xBFD1,0x4334,0x593E,0x5945, - 0x5940,0x5947,0x5943,0x0000,0x5942,0x476F,0xBFD2,0x593C, - 0x327D,0x593A,0x3571,0x4273,0x5936,0xBFD3,0xBFD4,0x5939, - 0x3934,0x405B,0xBFD5,0x3E37,0x5941,0x4752,0x0000,0x0000, - 0x3572,0x3348,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xBFD6,0x0000,0x3367,0x3F21,0x5949,0x594E, - 0x0000,0x594A,0xBFD7,0x377D,0xBFD8,0x594F,0x3B22,0x3969, - 0x0000,0x0000,0x0000,0x0000,0xBFD9,0xBFDA,0x3D26,0x593D, - - /* 6300h */ - 0x0000,0x3B7D,0x594C,0xBFDB,0xBFDC,0x0000,0x0000,0x3B58, - 0x594D,0x3044,0xBFDD,0xBFDE,0x5948,0xBFDF,0x0000,0x0000, - 0xBFE0,0x4429,0x0000,0xBFE1,0x0000,0x0000,0xBFE2,0x0000, - 0xBFE3,0x3573,0x0000,0x0000,0x0000,0x0000,0x0000,0x3634, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x594B, - 0x3027,0xBFE4,0xBFE5,0x3A43,0x0000,0xBFE6,0x0000,0x3F36, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xBFE7,0xBFE8,0x0000, - 0x0000,0xBFE9,0x4472,0x0000,0xBFEA,0x4854,0x5951,0x415E, - 0x0000,0xBFEB,0xBFEC,0xBFED,0xBFEE,0x0000,0xBFEF,0x0000, - 0x0000,0x422A,0xBFF0,0xBFF1,0x3B2B,0x5952,0xBFF2,0x5954, - 0x5950,0x0000,0xBFF3,0xBFF4,0xBFF5,0x4A61,0x0000,0x443D, - 0xBFF6,0x0000,0x0000,0xBFF7,0x415C,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xBFF8,0xBFF9,0x4A7B, - 0x3C4E,0x5960,0x0000,0x595F,0xBFFA,0xBFFB,0x3F78,0x0000, - 0x0000,0xBFFC,0x377E,0x0000,0xBFFD,0xBFFE,0x5959,0x3E39, - 0xC0A1,0x0000,0x4668,0x4731,0xC0A2,0xC0A3,0x0000,0xC0A4, - 0x5957,0x0000,0xC0A5,0x415D,0xC0A6,0x0000,0x0000,0xC0A7, - 0x3C78,0x595C,0xC0A8,0x0000,0x3E38,0x0000,0x5956,0x595B, - 0xC0A9,0x0000,0x4753,0x0000,0xC0AA,0xC0AB,0x5955,0x0000, - 0x3721,0xC0AC,0xC0AD,0x335D,0x0000,0x0000,0xC0AE,0x595D, - 0x4E2B,0x3A4E,0x4335,0x595A,0xC0AF,0x405C,0xC0B0,0x3935, - 0x3F64,0x3166,0x413C,0x5958,0x3545,0xC0B1,0xC0B2,0xC0B3, - 0x0000,0x0000,0x3747,0x0000,0x444F,0x595E,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x415F,0x0000,0xC0B4,0x5961,0x0000, - 0x5963,0xC0B5,0x0000,0x4237,0x5969,0xC0B6,0x5964,0x0000, - 0xC0B7,0x5966,0x0000,0x0000,0x0000,0x0000,0xC0B8,0x4941, - 0x4473,0xC0B9,0x5967,0xC0BA,0xC0BB,0xC0BC,0x4D2C,0x0000, - 0x0000,0x0000,0x4D48,0x3439,0xC0BD,0x0000,0x0000,0x0000, - 0xC0BE,0x302E,0x0000,0x5965,0x0000,0xC0BF,0x0000,0x0000, - 0x0000,0x5962,0xC0C0,0x0000,0xC0C1,0x0000,0x3478,0x0000, - 0x0000,0x0000,0xC0C2,0xC0C3,0x3167,0xC0C4,0x5968,0x0000, - 0xC0C5,0xC0C6,0x4D49,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 6400h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x596C,0x0000, - 0x0000,0xC0C7,0xC0C8,0x0000,0x0000,0x423B,0x0000,0x5973, - 0xC0C9,0x0000,0xC0CA,0x596D,0xC0CB,0x0000,0x596A,0x5971, - 0xC0CC,0x0000,0x0000,0x0000,0x5953,0x0000,0xC0CD,0x0000, - 0xC0CE,0x0000,0xC0CF,0x0000,0xC0D0,0xC0D1,0x596E,0x0000, - 0x5972,0xC0D2,0xC0D3,0x0000,0x4842,0x456B,0x0000,0xC0D4, - 0xC0D5,0x0000,0x0000,0x0000,0x596B,0xC0D6,0x596F,0x0000, - 0x0000,0x0000,0x3748,0x0000,0x0000,0xC0D7,0x3A71,0xC0D8, - 0x0000,0x0000,0x405D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xC0D9,0x0000,0x0000,0x5977,0xC0DA, - 0x0000,0xC0DB,0xC0DC,0xC0DD,0xC0DE,0x0000,0x0000,0x0000, - 0x4526,0x0000,0xC0DF,0xC0E0,0xC0E1,0xC0E2,0x0000,0xC0E3, - 0xC0E4,0xC0E5,0x0000,0xC0E6,0x0000,0x0000,0x0000,0x5974, - 0x0000,0x4B60,0x0000,0x0000,0x0000,0xC0E7,0x0000,0x5975, - 0x0000,0x0000,0x0000,0xC0E8,0xC0E9,0x0000,0x5976,0x0000, - 0x4C4E,0x0000,0x4022,0xC0EA,0x0000,0xC0EB,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3762,0x0000,0xC0EC,0x0000,0xC0ED, - 0x597D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xC0EE, - 0xC0EF,0xC0F0,0x3B35,0x597A,0x0000,0x5979,0x0000,0x0000, - 0xC0F1,0xC0F2,0x4732,0xC0F3,0x0000,0xC0F4,0x4635,0xC0F5, - 0x0000,0xC0F6,0x0000,0xC0F7,0x4531,0x597B,0xC0F8,0x0000, - 0xC0F9,0x597C,0x0000,0x496F,0xC0FA,0x4745,0x3B23,0x0000, - 0x4071,0x0000,0x4B50,0xC0FB,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x3349,0x0000,0x5A25,0x597E,0xC0FC,0xC0FD,0xC0FE, - 0x0000,0x4D4A,0x5A27,0x0000,0xC1A1,0x5A23,0x0000,0x5A24, - 0x0000,0xC1A2,0xC1A3,0xC1A4,0xC1A5,0x4160,0xC1A6,0x0000, - 0xC1A7,0xC1A8,0x5A22,0x0000,0x593F,0xC1A9,0x0000,0xC1AA, - 0x5A26,0x0000,0x5A21,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x5A2B,0x5A2C,0x4527,0x5A2E,0xC1AB,0xC1AC,0x3B24,0x5A29, - 0x0000,0xC1AD,0xC1AE,0x0000,0x353C,0xC1AF,0x0000,0x5A2F, - 0xC1B0,0x5A28,0x5A33,0x0000,0x5A32,0xC1B1,0x5A31,0xC1B2, - 0x0000,0x0000,0x5A34,0xC1B3,0x0000,0x5A36,0x3E71,0xC1B4, - - /* 6500h */ - 0x5A35,0xC1B5,0x0000,0x0000,0xC1B6,0x5A39,0x0000,0x0000, - 0xC1B7,0xC1B8,0xC1B9,0x0000,0x0000,0x0000,0x0000,0xC1BA, - 0x0000,0x0000,0x0000,0xC1BB,0xC1BC,0x0000,0xC1BD,0x0000, - 0x5A37,0xC1BE,0x0000,0xC1BF,0x5A38,0x5970,0xC1C0,0xC1C1, - 0x0000,0x0000,0xC1C2,0x5A3B,0x5A3A,0x0000,0xC1C3,0x0000, - 0x0000,0xC1C4,0x5978,0x5A3C,0x5A30,0x0000,0xC1C5,0x3B59, - 0x0000,0xC1C6,0x0000,0x0000,0x5A3D,0x5A3E,0x5A40,0x5A3F, - 0x5A41,0x327E,0xC1C7,0x3936,0xC1C8,0xC1C9,0x4A7C,0x402F, - 0x0000,0x0000,0x0000,0xC1CA,0x0000,0x384E,0x0000,0xC1CB, - 0x5A43,0xC1CC,0x0000,0x0000,0x0000,0x5A46,0x0000,0x4952, - 0xC1CD,0x355F,0xC1CE,0x0000,0xC1CF,0x5A45,0x5A44,0x4754, - 0x5A47,0x3635,0x0000,0x0000,0x0000,0x5A49,0x5A48,0xC1D0, - 0xC1D1,0x0000,0x343A,0x3B36,0x0000,0x0000,0x4658,0xC1D2, - 0x0000,0x0000,0x0000,0xC1D3,0x3749,0x0000,0x0000,0x0000, - 0x3F74,0x0000,0x5A4A,0x0000,0x4030,0x4528,0x0000,0x495F, - 0x5A4B,0x0000,0xC1D4,0x0000,0x0000,0xC1D5,0x0000,0x0000, - 0x0000,0xC1D6,0x5A4C,0x5A4D,0x0000,0xC1D7,0x0000,0x4A38, - 0x555D,0x4046,0xC1D8,0x0000,0x494C,0x0000,0x3A58,0x0000, - 0x4865,0x4843,0xC1D9,0x0000,0x0000,0xC1DA,0x0000,0x454D, - 0xC1DB,0x4E41,0x0000,0x5A4F,0x3C50,0xC1DC,0x0000,0x5A50, - 0xC1DD,0x3036,0x0000,0xC1DE,0x3654,0x404D,0xC1DF,0x4960, - 0x0000,0x0000,0x0000,0x5A51,0x3B42,0x4347,0xC1E0,0x3B5B, - 0x3F37,0x0000,0xC1E1,0xC1E2,0xC1E3,0x0000,0x0000,0x5A52, - 0x0000,0x4A7D,0x0000,0x0000,0x3177,0x3B5C,0x0000,0xC1E4, - 0x0000,0x5A55,0xC1E5,0x5A53,0x5A56,0x4E39,0x5A54,0x0000, - 0xC1E6,0xC1E7,0x0000,0x407B,0x5A57,0x0000,0xC1E8,0x4232, - 0xC1E9,0x0000,0x5A58,0x0000,0xC1EA,0x0000,0xC1EB,0x347A, - 0xC1EC,0x5A5A,0x0000,0x5A59,0x0000,0x0000,0x0000,0xC1ED, - 0x5A5B,0x5A5C,0x347B,0x0000,0x0000,0x467C,0x4336,0x356C, - 0x3B5D,0x4161,0x0000,0x0000,0x3D5C,0x3030,0x0000,0x0000, - 0xC1EE,0x5A5D,0xC1EF,0x0000,0xC1F0,0xC1F1,0x0000,0x0000, - 0x0000,0xC1F2,0x3222,0x5A61,0x0000,0x0000,0xC1F3,0xC1F4, - - /* 6600h */ - 0xC1F5,0x0000,0x3937,0x5A60,0xC1F6,0x0000,0x3A2B,0x3E3A, - 0xC1F7,0xC1F8,0x5A5F,0x0000,0x3E3B,0xC1F9,0x4C40,0x3A2A, - 0x0000,0xC1FA,0xC1FB,0x3057,0x404E,0xC1FC,0xC1FD,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x5A66,0xC1FE,0xC2A1,0x4031, - 0x3147,0xC2A2,0xC2A3,0xC2A4,0xC2A5,0x3D55,0xC2A6,0x4B66, - 0x3A72,0xC2A7,0xC2A8,0xC2A9,0xC2AA,0x3E3C,0xC2AB,0x4027, - 0xC2AC,0xC2AD,0x0000,0xC2AE,0x5A65,0x5A63,0x5A64,0xC2B0, - 0x0000,0xC2AF,0x0000,0x0000,0x436B,0x0000,0x0000,0x5B26, - 0xC2B1,0x5A6A,0x3B7E,0x3938,0x5A68,0xC2B2,0xC2B3,0x0000, - 0x0000,0x5A69,0xC2B4,0x3F38,0xC2B5,0x0000,0xC2B7,0x5A67, - 0x0000,0xC2B6,0x3B2F,0x0000,0x0000,0x0000,0x0000,0xC2B8, - 0xC2B9,0xC2BA,0x0000,0xC2BB,0xC2BC,0x5A6C,0x5A6B,0x5A70, - 0xC2BD,0xC2BE,0x5A71,0x0000,0x5A6D,0x0000,0x3322,0x5A6E, - 0x5A6F,0x4855,0xC2C0,0xC2C1,0xC2C2,0x0000,0x4961,0x374A, - 0x5A72,0x0000,0x0000,0xC2C4,0x4032,0xC2C5,0x3E3D,0xC2C7, - 0xC2C8,0xC2C9,0x4352,0xC2CA,0xC2CC,0x0000,0xC2C3,0xC2C6, - 0xC2CB,0x3647,0x0000,0x5A73,0x5A77,0x0000,0x0000,0x324B, - 0x5A74,0x5A76,0x0000,0xC2CD,0xC2CE,0xC2CF,0x5A75,0x0000, - 0xC2D0,0x3D6B,0xC2D1,0x0000,0x0000,0x0000,0x4348,0x3045, - 0x5A78,0xC2D2,0xC2D3,0xC2D4,0xC2D5,0x5A79,0x0000,0xC2D6, - 0xC2D7,0x0000,0x442A,0x0000,0xC2D8,0x0000,0x4E71,0x0000, - 0x0000,0x0000,0x0000,0x3B43,0x0000,0xC2D9,0x4A6B,0x0000, - 0x0000,0xC2DA,0xC2DB,0x0000,0x4B3D,0xC2DC,0x0000,0x0000, - 0x5B22,0x5A7B,0x0000,0xC2DD,0x5A7E,0x0000,0x5A7D,0xC2DE, - 0xC2DF,0x5A7A,0xC2E0,0xC2E1,0x5B21,0x0000,0x0000,0x465E, - 0xC2E2,0x5A7C,0x0000,0x0000,0xC2E3,0x0000,0xC2E4,0xC2E5, - 0x0000,0x0000,0x0000,0x0000,0xC2E6,0x0000,0x5B23,0x0000, - 0x0000,0x3D6C,0x5B24,0xC2E7,0x4D4B,0x4778,0x0000,0xC2E8, - 0x5B25,0x0000,0x0000,0x0000,0x0000,0x0000,0x5B27,0x0000, - 0xC2E9,0x5B28,0x0000,0xC2EA,0xC2EB,0x0000,0xC2EC,0x0000, - 0x5B29,0x0000,0x364A,0x3148,0x3939,0x5B2A,0x0000,0x5B2B, - 0x3D71,0x4162,0xC2ED,0xC2BF,0x5258,0x413E,0x413D,0x4258, - - /* 6700h */ - 0x3A47,0x0000,0x0000,0x5072,0x0000,0xC2EE,0x0000,0xC2EF, - 0x376E,0x4D2D,0x0000,0x4A7E,0x0000,0x497E,0xC2F0,0x5B2C, - 0x0000,0x0000,0x0000,0xC2F1,0x3A73,0x443F,0x5B2D,0x4F2F, - 0x0000,0xC2F2,0x0000,0x4B3E,0xC2F3,0x442B,0x5B2E,0x347C, - 0xC2F4,0x0000,0xC2F5,0x0000,0x0000,0x0000,0x5B2F,0x5B30, - 0x4C5A,0x0000,0x4C24,0x4B76,0x4B5C,0x3B25,0x5B32,0x0000, - 0x0000,0x3C6B,0x0000,0xC2F6,0x4B51,0x0000,0x5B34,0x5B37, - 0x5B36,0x0000,0x3479,0x0000,0x0000,0x3560,0xC2F7,0x5B33, - 0x0000,0x5B35,0x0000,0x0000,0x0000,0xC2F8,0x5B38,0xC2F9, - 0xC2FA,0x3F79,0x0000,0x0000,0xC2FB,0x0000,0x4D7B,0x3049, - 0x3A60,0x423C,0x0000,0x3C5D,0xC2FC,0xC2FD,0x3E73,0x0000, - 0x0000,0x5B3B,0x0000,0x0000,0x454E,0xC2FE,0x5B39,0x422B, - 0x5B3A,0x3E72,0x4C5D,0x5B3C,0x5B3D,0x4D68,0xC3A1,0x0000, - 0x0000,0x0000,0x5B42,0x0000,0xC3A2,0x393A,0xC3A3,0x4755, - 0x5B3F,0x456C,0x5A5E,0x5A62,0xC3A4,0x354F,0xC3A5,0x4747, - 0x0000,0x0000,0x0000,0xC3A6,0x5B41,0x0000,0x3E3E,0x4844, - 0x0000,0xC3A7,0x0000,0x0000,0xC3A8,0x5B47,0x0000,0x487A, - 0x0000,0x5B3E,0x0000,0x5B44,0x5B43,0x0000,0xC3A9,0xC3AA, - 0x404F,0xC3AB,0x0000,0xC3AC,0x0000,0x4B6D,0xC3AD,0x4E53, - 0xC3AE,0xC3AF,0x4B67,0xC3B0,0x324C,0x3B5E,0x0000,0x0000, - 0x4F48,0x5B46,0x3F75,0x0000,0x0000,0x0000,0x5B45,0x0000, - 0x0000,0x5B40,0x0000,0x0000,0x0000,0x0000,0x0000,0x384F, - 0xC3B1,0xC3B2,0xC3B3,0x5B4C,0x5B4A,0xC3B4,0x324D,0x5B48, - 0x5B4E,0x5B54,0x0000,0xC3B5,0xC3B6,0xC3B7,0x0000,0x0000, - 0xC3B9,0x4248,0xC3BA,0xC3BB,0x4A41,0xC3BC,0x5B56,0x0000, - 0xC3BD,0xC3BE,0x4922,0x0000,0x0000,0x0000,0x5B55,0x4770, - 0x4B3F,0x343B,0xC3BF,0x4077,0x3D40,0x0000,0x0000,0xC3C0, - 0x4453,0xC3C1,0x4D2E,0x0000,0xC3C2,0x5B51,0x5B50,0x0000, - 0x0000,0xC3C3,0x5B52,0x0000,0x5B4F,0x0000,0xC3C4,0x5B57, - 0x0000,0x5B4D,0x0000,0x0000,0x5B4B,0x0000,0x5B53,0x5B49, - 0xC3C5,0x436C,0xC3C6,0x4C78,0x3C46,0x3A74,0xC3C7,0xC3C8, - 0x0000,0xC3B8,0x0000,0x3A3A,0x0000,0x0000,0x4B6F,0x3341, - - /* 6800h */ - 0x0000,0x0000,0x444E,0x464A,0x3149,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x4072,0xC3CA,0x0000,0x4034,0x372A, - 0x0000,0xC3CB,0x0000,0x0000,0x0000,0xC3CC,0x5B59,0xC3CD, - 0x0000,0x393B,0x337C,0x0000,0x0000,0x0000,0x0000,0xC3CF, - 0xC3CE,0x5B5B,0x3374,0x5B61,0xC3D0,0xC3D1,0x0000,0xC3D2, - 0xC3D3,0xC3D4,0x5B5E,0xC3D5,0x4073,0x0000,0x0000,0x0000, - 0x334B,0x3A2C,0x0000,0xC3D6,0x334A,0x3A4F,0x0000,0xC3D7, - 0x5B5C,0x3765,0x374B,0x456D,0xC3D8,0xC3D9,0x5B5A,0x0000, - 0x3046,0x0000,0xC3DA,0x0000,0xC3DB,0x5B5D,0x5B5F,0x0000, - 0x364D,0x372C,0xC3C9,0x343C,0x354B,0xC3DC,0x0000,0xC3DD, - 0xC3DE,0x5B62,0x0000,0xC3DF,0x3A79,0x4B71,0x0000,0x3B37, - 0x0000,0x0000,0x0000,0x5B63,0x0000,0x0000,0x0000,0x4930, - 0x0000,0x0000,0x0000,0xC3E0,0x0000,0x0000,0xC3E1,0xC3E2, - 0xC3E3,0xC3E4,0xC3E5,0x0000,0x5B6F,0xC3E6,0x3233,0x5B64, - 0x0000,0xC3E7,0xC3E8,0xC3E9,0xC3EA,0x0000,0x5B75,0x5B65, - 0x0000,0x4E42,0xC3EB,0x5B6C,0xC3EC,0x475F,0xC3ED,0x0000, - 0xC3EE,0x0000,0x0000,0x0000,0x0000,0x5B74,0x0000,0x5B67, - 0x0000,0x0000,0x0000,0x3034,0x5B69,0x0000,0xC3EF,0x393C, - 0xC3F0,0x0000,0xC3F1,0x5B6B,0xC3F2,0x5B6A,0x0000,0x5B66, - 0x5B71,0xC3F3,0x3E3F,0xC3F4,0x0000,0xC3F5,0x546D,0x3868, - 0x4D7C,0xC3F6,0xC3F7,0x0000,0x0000,0x5B68,0xC3F8,0x4474, - 0x3323,0x3A2D,0xC3F9,0x5B60,0x0000,0x5B70,0x3361,0x0000, - 0x0000,0x5B6E,0x5B72,0xC3FA,0x456E,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x347E,0xC3FB,0x5C32,0x0000, - 0xC3FC,0x4C49,0x5B77,0x347D,0xC3FD,0x5B7E,0x0000,0xC3FE, - 0xC4A1,0xC4A2,0x4B40,0xC4A3,0x5C21,0x5C23,0xC4A4,0x5C27, - 0x5B79,0xC4A5,0x432A,0x0000,0xC4A6,0xC4A7,0x0000,0x456F, - 0x5C2B,0x5B7C,0x0000,0x5C28,0x0000,0xC4A8,0x0000,0x5C22, - 0xC4A9,0x0000,0xC4AA,0xC4AB,0xC4AC,0xC4AD,0x3F39,0x5C2C, - 0xC4AE,0xC4AF,0x4033,0x0000,0x0000,0xC4B0,0xC4B1,0x0000, - 0x0000,0x5C2A,0x343D,0xC4B2,0xC4B3,0xC4B4,0x0000,0x0000, - - /* 6900h */ - 0x4F50,0x5B76,0x0000,0x0000,0x5C26,0x3058,0xC4B5,0x0000, - 0x5B78,0xC4B6,0xC4B7,0x4C3A,0x5B7D,0x3F22,0x4447,0x5B73, - 0xC4B8,0xC4B9,0x5C25,0xC4BA,0x0000,0x0000,0xC4BB,0xC4BC, - 0x0000,0x3F7A,0x5C2F,0x3371,0x3821,0x0000,0x0000,0x0000, - 0x0000,0x5C31,0x5B7A,0x5C30,0x0000,0x5C29,0x5B7B,0x0000, - 0x5C2D,0x0000,0x5C2E,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x5C3F,0xC4BD,0x0000,0xC4BE,0x464E,0xC4BF,0x5C24,0x0000, - 0xC4C0,0x5C3B,0x0000,0xC4C1,0x0000,0x5C3D,0x0000,0x4458, - 0x0000,0x0000,0xC4C2,0x0000,0x0000,0xC4C3,0x0000,0x0000, - 0x0000,0xC4C4,0x4D4C,0x0000,0x0000,0x0000,0xC4C5,0x0000, - 0x0000,0x0000,0x0000,0x4976,0x5C38,0x424A,0x0000,0xC4C6, - 0x0000,0x5C3E,0x413F,0xC4C7,0x5C35,0x5C42,0x5C41,0x0000, - 0x466F,0x5C40,0x466A,0xC4C8,0xC4C9,0xC4CA,0xC4CB,0x0000, - 0xC4CC,0xC4CD,0x5C44,0x5C37,0xC4CE,0x3648,0x5C3A,0x3D5D, - 0xC4CF,0xC4D0,0xC4D1,0x4760,0x5C3C,0x364B,0x0000,0x5C34, - 0x5C36,0x5C33,0xC4D2,0xC4D3,0x4F30,0x335A,0x5C39,0xC4D4, - 0xC4D5,0x5C43,0x3335,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x3A67,0x0000,0x0000,0xC4D6,0x315D,0x0000, - 0x0000,0x5C54,0xC4D7,0x0000,0x4F31,0x5C57,0xC4D8,0x0000, - 0xC4D9,0x0000,0x0000,0x3F3A,0x5C56,0x0000,0x0000,0x0000, - 0x5C55,0xC4DA,0x0000,0x0000,0x0000,0xC4DB,0xC4DC,0x5C52, - 0xC4DD,0x0000,0x0000,0xC4DE,0x0000,0xC4DF,0x5C46,0xC4E0, - 0x0000,0x5C63,0x5C45,0x0000,0x5C58,0x0000,0x0000,0xC4E1, - 0xC4E2,0x0000,0xC4E3,0x5C50,0xC4E4,0x0000,0x5C4B,0x5C48, - 0x0000,0x5C49,0x0000,0x5C51,0x0000,0xC4E5,0x0000,0x7422, - 0xC4E6,0x0000,0x5C4E,0x393D,0x4448,0x4164,0x5C4C,0x0000, - 0x5C47,0xC4E7,0x0000,0x5C4A,0x0000,0x0000,0xC4E8,0xC4E9, - 0x4D4D,0x4B6A,0x0000,0x0000,0x0000,0x5C4F,0x5C59,0x0000, - 0x0000,0x0000,0xC4EA,0x0000,0x0000,0xC4EB,0x0000,0x5C61, - 0x5C5A,0x0000,0x0000,0x5C67,0x0000,0x5C65,0xC4EC,0xC4ED, - 0x0000,0xC4EE,0x5C60,0xC4EF,0x0000,0xC4F0,0x0000,0x0000, - 0x0000,0x5C5F,0x0000,0x4450,0x0000,0x4165,0xC4F1,0x5C5D, - - /* 6A00h */ - 0xC4F2,0xC4F3,0x5C5B,0xC4F4,0x0000,0x5C62,0x0000,0x0000, - 0x0000,0x0000,0x5C68,0x4875,0x5C6E,0x0000,0x0000,0xC4F5, - 0x0000,0xC4F6,0x5C69,0x5C6C,0x5C66,0xC4F7,0x0000,0x4374, - 0x0000,0x4938,0xC4F8,0x5C5C,0x0000,0xC4F9,0x5C64,0x3E40, - 0xC4FA,0x4C4F,0x5C78,0x5C6B,0xC4FB,0x0000,0x0000,0x0000, - 0xC4FC,0x3822,0x3223,0x335F,0x0000,0x0000,0x5C53,0x0000, - 0xC4FD,0x0000,0xC4FE,0x0000,0xC5A1,0x3E41,0x5C70,0xC5A2, - 0x5C77,0x3C79,0x3372,0xC5A3,0x0000,0x432E,0xC5A4,0xC5A5, - 0x0000,0x0000,0x0000,0x0000,0x5C6D,0xC5A6,0xC5A7,0x5C72, - 0x5C76,0xC5A8,0xC5A9,0x3636,0x0000,0x0000,0xC5AA,0x0000, - 0xC5AB,0xC5AC,0xC5AD,0x0000,0x0000,0xC5AE,0xC5AF,0x0000, - 0x354C,0x5C74,0x0000,0xC5B0,0x0000,0x0000,0x0000,0x3521, - 0x0000,0x464B,0x5C73,0x0000,0xC5B1,0x0000,0x5C75,0xC5B2, - 0x0000,0x0000,0xC5B3,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xC5B4,0x5C6F,0xC5B5,0x0000,0x0000,0x0000,0x0000, - 0x5C71,0x0000,0x0000,0x0000,0x0000,0x0000,0xC5B6,0x3360, - 0x4349,0xC5B7,0x0000,0xC5B8,0x5C7C,0x0000,0xC5B9,0xC5BA, - 0x0000,0xC5BB,0x0000,0xC5BC,0x0000,0x5C7A,0x3869,0x0000, - 0x5C79,0xC5BD,0x0000,0x0000,0x0000,0x0000,0x0000,0x5D21, - 0x0000,0x0000,0x0000,0xC5BE,0x5B58,0xC5BF,0xC5C0,0xC5C1, - 0x5C7B,0x0000,0x5C7D,0x5C7E,0x0000,0xC5C2,0x0000,0x0000, - 0x0000,0x0000,0x5D2C,0xC5C3,0x5D28,0x0000,0x5B6D,0xC5C4, - 0xC5C5,0xC5C6,0x0000,0x5D27,0xC5C7,0x0000,0x0000,0x0000, - 0x5D26,0x0000,0x0000,0x5D23,0x0000,0xC5C8,0xC5C9,0xC5CA, - 0x0000,0x5C6A,0x5D25,0x5D24,0x0000,0x0000,0xC5CB,0x0000, - 0xC5CD,0xC5CC,0x0000,0x0000,0xC5CE,0x0000,0x0000,0x0000, - 0xC5CF,0x5D2A,0x0000,0x4F26,0xC5D0,0xC5D1,0xC5D2,0x0000, - 0x0000,0x0000,0x5D2D,0x367B,0xC5D3,0xC5D4,0x5D29,0x5D2B, - 0x0000,0x0000,0x0000,0x0000,0xC5D5,0x0000,0x0000,0xC5D6, - 0x4827,0x0000,0x5D2E,0x0000,0xC5D7,0x0000,0x0000,0x0000, - 0xC5D8,0xC5D9,0xC5DA,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x5D32,0x5D2F,0xC5DB,0xC5DC,0x0000,0x0000, - - /* 6B00h */ - 0x0000,0x0000,0xC5DD,0xC5DE,0x4D73,0x5D30,0xC5DF,0xC5E0, - 0x0000,0xC5E1,0x5C5E,0x0000,0x0000,0x0000,0x0000,0xC5E2, - 0xC5E3,0xC5E4,0x5D33,0x0000,0x0000,0x0000,0x5D34,0xC5E5, - 0x0000,0x0000,0x0000,0xC5E6,0x0000,0x3135,0xC5E7,0x5D36, - 0x3767,0x3C21,0x0000,0x3655,0xC5E8,0x0000,0x0000,0x3224, - 0xC5E9,0x0000,0x0000,0xC5EA,0xC5EB,0x0000,0x0000,0xC5EC, - 0x0000,0x0000,0x4D5F,0x0000,0x0000,0xC5ED,0xC5EE,0x5D38, - 0x5D37,0x5D3A,0x353D,0xC5EF,0x0000,0x3656,0x343E,0xC5F0, - 0x0000,0x0000,0x0000,0x5D3D,0x0000,0x0000,0xC5F1,0x5D3C, - 0x0000,0x5D3E,0xC5F2,0x0000,0x324E,0xC5F3,0x4337,0x0000, - 0x5D3F,0x0000,0xC5F4,0x343F,0x5D41,0x0000,0xC5F5,0x0000, - 0xC5F6,0x5D40,0x0000,0x5D42,0x0000,0xC5F7,0x0000,0x5D43, - 0xC5F8,0x5D44,0x3B5F,0x4035,0x3A21,0x0000,0x4970,0xC5F9, - 0x0000,0x4A62,0x4F44,0xC5FA,0x0000,0x0000,0xC5FB,0x3B75, - 0xC5FC,0x0000,0x0000,0x3A50,0x4E72,0xC5FD,0x0000,0x0000, - 0x5D45,0x5D46,0x0000,0x3B60,0x0000,0xC5FE,0xC6A1,0x5D47, - 0x5D48,0x0000,0xC6A2,0x5D4A,0x5D49,0xC6A3,0x4B58,0x0000, - 0x0000,0x3D5E,0x3C6C,0x3B44,0x0000,0x5D4B,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x5D4D,0x3F23,0xC6A4, - 0x5D4C,0x0000,0x0000,0xC6A5,0x0000,0x0000,0x5D4E,0xC6A6, - 0xC6A7,0x0000,0xC6A8,0xC6A9,0x5D4F,0x0000,0x0000,0x0000, - 0xC6AA,0xC6AB,0x5D50,0x5D51,0xC6AC,0xC6AD,0xC6AE,0x5D52, - 0xC6AF,0x5D54,0x5D53,0x5D55,0x3225,0x434A,0x0000,0x5D56, - 0xC6B0,0xC6B1,0x3B26,0x334C,0x5D57,0xC6B2,0xC6B3,0x4542, - 0x544C,0x0000,0x0000,0xC6B4,0xC6B5,0x3523,0x5D58,0x0000, - 0x0000,0xC6B6,0x0000,0x5D59,0xC6B7,0x4A6C,0x4B68,0x0000, - 0x0000,0x0000,0x4647,0x5D5A,0x4866,0x0000,0xC6B8,0x0000, - 0x487B,0x0000,0xC6B9,0x4C53,0x0000,0x0000,0x0000,0x5D5B, - 0x0000,0xC6BA,0x0000,0xC6BB,0x0000,0x0000,0xC6BC,0xC6BD, - 0x0000,0x0000,0x0000,0x5D5D,0x5D5C,0x0000,0xC6BE,0x5D5F, - 0x0000,0xC6BF,0x0000,0x5D5E,0x0000,0x0000,0x0000,0xC6C0, - 0x0000,0xC6C1,0x0000,0x0000,0x0000,0x0000,0x0000,0xC6C2, - - /* 6C00h */ - 0x0000,0x0000,0xC6C3,0x0000,0xC6C4,0xC6C5,0x0000,0x0000, - 0x5D61,0xC6C6,0x0000,0x0000,0x0000,0xC6C7,0xC6C8,0x3B61, - 0xC6C9,0x4C31,0xC6CA,0x5D62,0x5D63,0x0000,0x0000,0x3524, - 0x0000,0xC6CB,0x0000,0x5D64,0x0000,0x0000,0x0000,0xC6CC, - 0x0000,0x0000,0x0000,0x5D66,0x5D65,0x0000,0xC6CD,0xC6CE, - 0xC6CF,0x0000,0x0000,0x0000,0xC6D0,0x0000,0xC6D1,0x0000, - 0x0000,0x0000,0x0000,0xC6D2,0x3F65,0xC6D3,0xC6D4,0x4939, - 0x314A,0x0000,0xC6D5,0xC6D6,0x0000,0x0000,0x4845,0xC6D7, - 0x4475,0x3D41,0x3561,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xC6D8,0xC6D9,0x0000,0xC6DA,0x4846,0xC6DB, - 0x3C2E,0x0000,0xC6DC,0x0000,0xC6DD,0x5D68,0x0000,0x3440, - 0x0000,0xC6DE,0x3178,0xC6DF,0xC6E0,0x4672,0x5D67,0x393E, - 0x4353,0x0000,0x5D69,0x0000,0x0000,0x0000,0x0000,0xC7B6, - 0x5D71,0x0000,0x5D6A,0xC6E1,0x0000,0xC6E2,0x0000,0xC6E3, - 0x4241,0x0000,0x3562,0x5D72,0xC6E4,0x0000,0xC6E5,0x0000, - 0xC6E6,0xC6E7,0x3768,0xC6E8,0x0000,0x3525,0x5D70,0x0000, - 0x0000,0x5D6E,0x5D6B,0x4D60,0x0000,0xC6E9,0xC6EA,0xC6EB, - 0x4440,0xC6EC,0x0000,0x0000,0x4659,0x5D6C,0x0000,0x0000, - 0x5D74,0x0000,0x5D73,0x3723,0xC6ED,0xC6EE,0x322D,0xC6EF, - 0xC6F0,0x3A3B,0x5D6D,0x5D6F,0xC6F1,0x0000,0x0000,0xC6F2, - 0x0000,0x4B57,0x4274,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x4B77,0x0000,0x0000,0x5D7C,0x0000, - 0xC6F3,0x5D7D,0xC6F4,0x324F,0xC6F5,0x0000,0x0000,0x0000, - 0x4A28,0x4C7D,0x5E21,0x3C23,0x3E42,0x5D78,0x5D7E,0x3168, - 0x0000,0x3637,0xC6F6,0x0000,0x5D75,0x5D7A,0xC6F7,0x0000, - 0x0000,0x4074,0x4771,0x0000,0x4867,0xC6F8,0x0000,0xC6F9, - 0xC6FA,0xC6FB,0xC6FC,0x5D77,0xC6FD,0x4B21,0xC6FE,0x5D79, - 0x0000,0x5E24,0xC7A1,0x5E22,0xC7A2,0x5D7B,0x0000,0x0000, - 0xC7A3,0x4B22,0x4748,0x3563,0x0000,0x4525,0x0000,0xC7A4, - 0x436D,0xC7A5,0x5E25,0xC7A6,0xC7A7,0x0000,0xC7A8,0x5E23, - 0x4259,0x5D76,0xC7A9,0x314B,0xC7AA,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 6D00h */ - 0x0000,0x0000,0x0000,0x0000,0xC7AB,0x0000,0x0000,0xC7AC, - 0x0000,0x0000,0xC7AD,0x4D4E,0x5E30,0x0000,0xC7AE,0xC7AF, - 0x0000,0xC7B0,0x5E2F,0xC7B1,0x0000,0x0000,0x0000,0x4076, - 0x0000,0x5E2C,0xC7B2,0x4D6C,0x0000,0x0000,0x4636,0x5E26, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x4445,0xC7B3,0xC7B4, - 0xC7B5,0x314C,0x393F,0x5E29,0x0000,0x0000,0xC7B7,0xC7B8, - 0x0000,0xC7B9,0x3D27,0x5E2E,0x0000,0x5E2D,0x5E28,0x0000, - 0x5E2B,0xC7BA,0x0000,0x3368,0xC7BB,0x5E2A,0x4749,0xC7BC, - 0x0000,0x4E2E,0x0000,0x0000,0x3E74,0x4075,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xC7BD, - 0x0000,0x5E36,0x5E34,0x0000,0x494D,0x0000,0xC7BE,0xC7BF, - 0x0000,0xC7C0,0x0000,0x5E31,0x5E33,0xC7C1,0x313A,0xC7C2, - 0x0000,0x3940,0x4F32,0x0000,0x333D,0x0000,0x4962,0xC7C3, - 0xC7C4,0x0000,0x0000,0x0000,0x4D61,0x0000,0x0000,0x3324, - 0x3F3B,0x5E35,0x0000,0x0000,0xC7C5,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xC7C6,0x0000,0x0000,0x5E3A,0x0000,0xC7C7, - 0x3E43,0x0000,0x0000,0x0000,0x4D30,0x0000,0x5E37,0x0000, - 0x0000,0xC7C8,0xC7C9,0x5E32,0xC7CA,0x5E38,0xC7CB,0xC7CC, - 0xC7CD,0x4E5E,0x0000,0x4573,0x4642,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xC7CE,0x0000,0xC7CF,0x0000,0x0000,0x3336, - 0x0000,0x0000,0x3155,0x0000,0xC7D0,0x5E3E,0x0000,0xC7D1, - 0x5E41,0xC7D2,0x0000,0x0000,0x4E43,0xC7D3,0x0000,0xC7D4, - 0x4D64,0x0000,0x0000,0x0000,0xC7D5,0x5E48,0x5E42,0x5E3F, - 0xC7D6,0x0000,0xC7D7,0x4E54,0x5E45,0x0000,0xC7D8,0xC7D9, - 0x0000,0x3D4A,0x5E47,0x0000,0x0000,0x5E4C,0xC7DA,0x0000, - 0x4571,0x5E4A,0x0000,0xC7DB,0x0000,0xC7DC,0x5E44,0xC7DD, - 0xC7DE,0x4338,0xC7DF,0x0000,0x5E4B,0xC7E0,0x5E40,0x0000, - 0x5E46,0xC7E1,0x5E4D,0x307C,0x5E43,0x0000,0x5E4E,0xC7E2, - 0xC7E3,0x3F3C,0x0000,0x3D5F,0xC7E4,0x4A25,0xC7E5,0x3A2E, - 0x0000,0x5E3B,0x5E49,0x453A,0xC7E6,0x0000,0x0000,0x0000, - - /* 6E00h */ - 0xC7E7,0x0000,0x0000,0x0000,0xC7E8,0x4036,0x0000,0x3369, - 0x3A51,0x3E44,0x5E3D,0x3D42,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x374C,0x0000,0x5E3C,0x0000,0x0000, - 0x0000,0x5E52,0x3D6D,0x383A,0x0000,0x5E61,0xC7E9,0x5E5B, - 0x3574,0x454F,0xC7EA,0x5E56,0x5E5F,0x302F,0x3132,0xC7EB, - 0x0000,0x3239,0x0000,0x5E58,0x422C,0x5E4F,0x5E51,0x3941, - 0x0000,0x0000,0xC7EC,0x0000,0x0000,0x0000,0xC7ED,0x0000, - 0x5E62,0xC7EE,0x5E5D,0xC7EF,0xC7F0,0x0000,0x5E55,0x0000, - 0x0000,0x0000,0x0000,0x5E5C,0xC7F1,0xC7F2,0x0000,0x0000, - 0xC7F3,0xC7F4,0x4C2B,0xC7F5,0x0000,0x5E5A,0x5E5E,0xC7F6, - 0x0000,0xC7F7,0xC7F8,0xC7F9,0xC7FA,0x0000,0x3850,0xC7FB, - 0x3E45,0x0000,0x0000,0x4339,0xC7FC,0xC7FD,0xC7FE,0x5E54, - 0x0000,0x0000,0xC8A1,0xC8A2,0x0000,0x0000,0x0000,0x4D2F, - 0xC8A3,0x0000,0x0000,0x5E57,0x0000,0x0000,0x5E50,0x4572, - 0x0000,0x0000,0x5E53,0xC8A4,0x0000,0x0000,0x5E59,0x0000, - 0x0000,0x0000,0x0000,0xC8A5,0x0000,0xC8A6,0x4F51,0x3C3E, - 0x4B7E,0x0000,0x5E63,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x482E,0xC8A7,0x0000,0x5E6F, - 0x383B,0x0000,0x0000,0xC8A8,0x0000,0x0000,0x3D60,0x0000, - 0x5E65,0xC8A9,0x0000,0x0000,0x4E2F,0x3942,0x0000,0x5E72, - 0xC8AA,0x0000,0x306E,0x0000,0x0000,0x5E70,0x0000,0xC8AB, - 0x0000,0x0000,0x5E64,0x0000,0x0000,0xC8AC,0xC8AD,0x5E6A, - 0x0000,0xC8AE,0x5E6C,0xC8AF,0x0000,0x0000,0x4D4F,0x5E67, - 0x0000,0x0000,0x452E,0xC8B0,0x0000,0x5E69,0x0000,0xC8B1, - 0xC8B2,0xC8B3,0x5E71,0xC8B4,0x5E6B,0x4C47,0x0000,0xC8B5, - 0xC8B6,0x5E66,0xC8B7,0x3C22,0x5E7E,0xC8B8,0xC8B9,0xC8BA, - 0x0000,0x336A,0x0000,0x5E68,0x5E6D,0x5E6E,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x426C,0x425A,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xC8BB,0x5E76,0xC8BC,0xC8BD,0x5E7C, - 0x0000,0x0000,0x5E7A,0x0000,0x4529,0x0000,0x0000,0x5F23, - 0x5E77,0xC8BE,0x0000,0xC8BF,0x0000,0xC8C0,0x5E78,0x5E60, - - /* 6F00h */ - 0x0000,0x3579,0x493A,0x0000,0xC8C1,0x0000,0x3C3F,0x0000, - 0xC8C2,0x3977,0xC8C3,0x0000,0xC8C4,0xC8C5,0x0000,0x4F33, - 0x0000,0x5E74,0x0000,0x5F22,0x3169,0x4166,0xC8C6,0x0000, - 0xC8C7,0x0000,0xC8C8,0xC8C9,0x0000,0x0000,0x0000,0x0000, - 0x4779,0x0000,0x3441,0x4E7A,0x0000,0x0000,0xC8CA,0x0000, - 0x0000,0xC8CB,0xC8CC,0x4C21,0x4452,0xC8D3,0x0000,0xC8CD, - 0xC8CE,0x5E7B,0x5E7D,0xC8CF,0x0000,0x0000,0xC8D0,0x0000, - 0x4132,0x0000,0x0000,0xC8D1,0xC8D2,0x0000,0x5F21,0x5E79, - 0x0000,0x5E73,0x0000,0x0000,0x0000,0x3443,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xC8D4, - 0x0000,0xC8D5,0xC8D6,0xC8D7,0x3769,0x0000,0x0000,0xC8D8, - 0x5F2F,0xC8D9,0xC8DA,0x5F2A,0x4078,0xC8DB,0xC8DC,0x3363, - 0x0000,0xC8DD,0xC8DE,0x0000,0x3D61,0x0000,0x5F33,0x0000, - 0xC8DF,0x0000,0x0000,0x0000,0xC8E0,0x5F2C,0x442C,0x5F29, - 0x4459,0x0000,0x0000,0x0000,0x5F4C,0x0000,0x0000,0x0000, - 0x5F26,0x0000,0x5F25,0x0000,0x5F2E,0xC8E1,0xC8E2,0x0000, - 0x5F28,0x5F27,0x5F2D,0xC8E3,0x4021,0x0000,0x5F24,0xC8E4, - 0xC8E5,0x0000,0x0000,0xC8E6,0xC8E7,0xC8E8,0x5F30,0x0000, - 0xC8E9,0x5F31,0xC8EA,0xC8EB,0xC8EC,0x0000,0xC8ED,0x3442, - 0x0000,0x0000,0xC8EE,0x0000,0x0000,0x0000,0x0000,0xC8EF, - 0xC8F0,0x5F36,0x0000,0x5F35,0x5F37,0xC8F1,0xC8F2,0xC8F3, - 0xC8F4,0x0000,0x5F3A,0x0000,0x0000,0x0000,0xC8F5,0xC8F6, - 0xC8F7,0x4543,0x0000,0x5F34,0x0000,0xC8F8,0xC8F9,0x0000, - 0x0000,0x5F38,0x0000,0x0000,0xC8FA,0x0000,0x0000,0x0000, - 0x3763,0x4279,0x5F32,0x473B,0x0000,0xC8FB,0x5F39,0xC8FC, - 0xC8FD,0x0000,0xC8FE,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x5F3E,0x5F3C,0x0000,0x0000, - 0x5F3F,0x0000,0xC9A1,0x5F42,0x0000,0x0000,0xC9A2,0x5F3B, - 0x396A,0x4728,0x0000,0x0000,0x5E39,0x0000,0x0000,0x0000, - 0xC9A3,0xC9A4,0x0000,0x4D74,0x5F3D,0x0000,0x5F41,0x4275, - 0xC9A5,0x5F40,0x0000,0x5F2B,0x0000,0xC9A6,0x6F69,0x0000, - 0x0000,0xC9A7,0x5F45,0x0000,0xC9A8,0xC9A9,0x5F49,0x0000, - - /* 7000h */ - 0xC9AA,0x5F47,0x0000,0x0000,0x0000,0xC9AB,0xC9AC,0xC9AD, - 0x0000,0x5F43,0x0000,0x5F44,0x0000,0xC9AE,0x0000,0x5F48, - 0x0000,0x5F46,0x0000,0x0000,0x0000,0x494E,0x0000,0xC9AF, - 0x5F4E,0x0000,0x5F4B,0x5F4A,0x0000,0x5F4D,0x4654,0x5F4F, - 0xC9B0,0x0000,0x0000,0xC9B1,0x0000,0x0000,0x4375,0x426D, - 0x0000,0x0000,0x0000,0x0000,0x4025,0x0000,0x0000,0xC9B2, - 0x5F50,0x0000,0x5F52,0x0000,0xC9B3,0x0000,0x0000,0xC9B4, - 0x0000,0xC9B5,0x0000,0x0000,0xC9B6,0x0000,0x5F51,0x0000, - 0x0000,0x0000,0x0000,0xC9B7,0xC9B8,0x0000,0x0000,0x0000, - 0xC9B9,0xC9BA,0xC9BB,0xC9BC,0x5E75,0x0000,0xC9C1,0x0000, - 0x0000,0x5F53,0x0000,0x0000,0xC9BD,0xC9BE,0x0000,0x0000, - 0x4667,0x0000,0x0000,0x0000,0x0000,0xC9BF,0xC9C0,0x0000, - 0x0000,0x0000,0x0000,0x5F54,0xC9C2,0xC9C3,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3250,0xC9C4,0x0000,0xC9C5,0x4574, - 0x3325,0x0000,0x0000,0x0000,0x0000,0xC9C6,0xC9C7,0x0000, - 0x3564,0x0000,0x0000,0x0000,0x3C5E,0x3A52,0xC9C8,0x0000, - 0x0000,0xC9C9,0x0000,0x0000,0x0000,0xC9CA,0xC9CB,0x0000, - 0x0000,0x4F27,0x3F66,0x0000,0x0000,0x0000,0x316A,0x0000, - 0x0000,0x0000,0x5F56,0x0000,0xC9CC,0xC9CD,0xC9CE,0xC9CF, - 0xC9D0,0x5F55,0x0000,0xC9D1,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xC9D2,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xC9D3,0x5F59,0x433A,0x5F5C,0x5F57, - 0xC9D4,0xC9D5,0x0000,0x5F5B,0xC9D6,0x0000,0x0000,0xC9D7, - 0x5F5A,0x4540,0x3059,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x4E75,0x0000,0xC9D8,0x5F5E,0x0000,0x0000,0x0000,0x3128, - 0x0000,0xC9D9,0x0000,0xC9DA,0xC9DB,0xC9DC,0xC9DD,0x0000, - 0xC9DE,0x5F60,0x0000,0x0000,0xC9DF,0x5F5F,0x0000,0x5F5D, - 0x0000,0x0000,0x0000,0x0000,0xC9E0,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x5F58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x4B23,0xC9E1,0x0000,0x0000,0x5F62,0x0000,0x0000, - - /* 7100h */ - 0x0000,0x0000,0x0000,0xC9E2,0xC9E3,0xC9E4,0xC9E5,0xC9E6, - 0x0000,0x5F61,0x0000,0xC9E7,0xC9E8,0x0000,0x0000,0xC9E9, - 0x0000,0x0000,0x0000,0x0000,0x316B,0x0000,0x0000,0x0000, - 0x0000,0x5F64,0x4A32,0x0000,0x5F63,0x0000,0xC9EA,0x0000, - 0xC9EB,0x4C35,0x0000,0x0000,0x0000,0x0000,0x3E47,0x0000, - 0x0000,0x0000,0x0000,0xC9EC,0x0000,0xC9ED,0x0000,0xC9EE, - 0xC9EF,0xC9F0,0x0000,0x0000,0x0000,0x0000,0x4133,0x0000, - 0xC9F1,0x0000,0x0000,0x0000,0x3E46,0x0000,0x0000,0x0000, - 0x0000,0xC9F2,0x0000,0x0000,0x0000,0xC9F3,0xC9F4,0xC9F5, - 0x0000,0x4E7B,0xC9F6,0xC9F7,0x5F6A,0x0000,0x4079,0x0000, - 0xC9F8,0x0000,0xC9F9,0x0000,0x0000,0x5F66,0x5F6B,0xC9FA, - 0x0000,0x316C,0xC9FB,0x0000,0xC9FC,0x0000,0xC9FD,0x0000, - 0xC9FE,0x0000,0x5F69,0x0000,0x4761,0x5F65,0x5F68,0x3E48, - 0xCAA1,0x4851,0x0000,0x0000,0x5F6C,0x0000,0x3C51,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xCAA2,0x0000,0x0000,0x0000,0x407A,0x0000,0x0000, - 0xCAA3,0x0000,0x0000,0x0000,0x5F6F,0xCAA4,0x0000,0xCAA5, - 0x5F67,0x0000,0x3727,0x0000,0xCAA6,0x0000,0x0000,0x5F6D, - 0x0000,0x0000,0xCAA7,0x0000,0x4D50,0x5F70,0x0000,0x0000, - 0x0000,0x7426,0xCAA8,0xCAA9,0x0000,0x0000,0x0000,0x3D4F, - 0xCAAA,0x0000,0xCAAB,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x5F71,0x0000,0x0000,0x0000,0x5F72,0x0000,0x0000,0xCAAC, - 0xCAAD,0x472E,0xCAAE,0xCAAF,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x5F74,0xCAB0,0x0000,0x0000,0x0000,0x5F75,0xCAB1, - 0xCAB2,0xCAB3,0x0000,0x4733,0xCAB4,0x0000,0x0000,0x0000, - 0x4575,0x5F77,0x0000,0xCAB5,0xCAB6,0x0000,0x5F79,0x0000, - 0x4E55,0x0000,0x5F76,0xCAB7,0x5F78,0x316D,0xCAB8,0x5F73, - 0x0000,0xCAB9,0xCABA,0x0000,0xCABB,0x0000,0x0000,0x535B, - 0x5F7A,0x0000,0x0000,0x0000,0x0000,0x4167,0x3B38,0x5F7C, - 0x0000,0x0000,0x0000,0x0000,0x5F7B,0x3F24,0x5259,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x5F7D,0x0000,0x0000, - 0xCABC,0x6021,0x0000,0x5F6E,0x5F7E,0x0000,0xCABD,0x6022, - - /* 7200h */ - 0xCABE,0x0000,0x0000,0x0000,0x0000,0x0000,0x477A,0xCABF, - 0xCAC0,0xCAC1,0x0000,0x0000,0x0000,0x6023,0x0000,0x0000, - 0x6024,0x0000,0x0000,0xCAC2,0x0000,0x0000,0x0000,0xCAC3, - 0x0000,0x0000,0xCAC4,0x6025,0x0000,0xCAC5,0x0000,0xCAC6, - 0x0000,0x0000,0x0000,0x0000,0xCAC7,0x0000,0x0000,0x0000, - 0x6026,0x0000,0x445E,0xCAC8,0x6028,0x6027,0x0000,0xCAC9, - 0x6029,0x0000,0x602A,0x0000,0xCACA,0x3C5F,0x4963,0x0000, - 0xCACB,0xCACC,0x4C6C,0x602B,0x602C,0x4156,0x3C24,0x602D, - 0x602E,0xCACD,0xCACE,0xCACF,0x0000,0xCAD0,0x602F,0x4A52, - 0x4847,0x0000,0x0000,0x6030,0x4757,0x0000,0xCAD1,0xCAD2, - 0xCAD3,0x0000,0x442D,0xCAD4,0x0000,0xCAD5,0xCAD6,0x0000, - 0x6031,0x3267,0xCAD7,0x356D,0xCAD8,0x4C46,0xCAD9,0x4C36, - 0xCADA,0x3234,0x4F34,0xCADB,0x0000,0x0000,0x0000,0x4B52, - 0xCADC,0x4A2A,0x0000,0xCADD,0x0000,0x0000,0xCADE,0xCADF, - 0x0000,0xCAE0,0x4037,0x0000,0x6032,0x0000,0x0000,0xCAE1, - 0xCAE2,0x4643,0x0000,0xCAE3,0xCAE4,0x3823,0x6033,0xCAE5, - 0x3A54,0x6035,0x6034,0x0000,0xCAE6,0x0000,0x0000,0x6036, - 0x0000,0xCAE7,0x0000,0x0000,0x0000,0xCAE8,0xCAE9,0x0000, - 0x0000,0x0000,0x6037,0xCAEA,0x0000,0x0000,0x6038,0x0000, - 0x0000,0x0000,0x0000,0xCAEB,0x0000,0x0000,0x0000,0x0000, - 0x353E,0x0000,0x6039,0x0000,0x0000,0x0000,0x0000,0x603A, - 0xCAEC,0x0000,0x0000,0x0000,0x3824,0xCAED,0xCAEE,0x4848, - 0x0000,0xCAEF,0x603C,0x0000,0xCAF0,0x0000,0x3E75,0x0000, - 0x0000,0x603B,0x0000,0x0000,0x0000,0x0000,0xCAF1,0x0000, - 0x0000,0xCAF2,0x3638,0x603D,0x603F,0x0000,0x603E,0xCAF3, - 0x0000,0xCAF4,0x0000,0x0000,0xCAF5,0x0000,0x6040,0x0000, - 0x3851,0x0000,0x6041,0x0000,0x0000,0xCAF6,0xCAF7,0x3669, - 0xCAF8,0x4140,0x0000,0x397D,0x0000,0x0000,0x0000,0xCAF9, - 0x6043,0x6044,0x6042,0x0000,0x0000,0xCAFA,0x0000,0x0000, - 0x0000,0x3C6D,0x0000,0x0000,0x4648,0x3639,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xCAFB,0xCAFC,0x0000,0x0000,0x6046, - 0x432C,0x6045,0xCAFD,0xCAFE,0x4F35,0x4762,0xCBA1,0x0000, - - /* 7300h */ - 0x0000,0x0000,0xCBA2,0x0000,0xCBA3,0xCBA4,0x0000,0xCBA5, - 0x0000,0x0000,0x6049,0xCBA6,0x0000,0xCBA7,0x0000,0x0000, - 0x0000,0x0000,0xCBA8,0xCBA9,0x0000,0x0000,0x604B,0x6048, - 0xCBAA,0xCBAB,0x0000,0x4C54,0x604A,0x604C,0xCBAC,0x4E44, - 0x0000,0x0000,0xCBAD,0x0000,0xCBAE,0x6050,0x0000,0xCBAF, - 0xCBB0,0x604F,0x4376,0x472D,0xCBB1,0x0000,0x3825,0x604E, - 0x0000,0xCBB2,0xCBB3,0x0000,0x604D,0xCBB4,0x4D31,0x4D32, - 0x0000,0x0000,0xCBB5,0xCBB6,0x0000,0xCBB7,0x6051,0x316E, - 0x0000,0x0000,0x0000,0xCBB8,0x3976,0x3B62,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xCBB9,0x6052,0x6053, - 0xCBBA,0x0000,0xCBBB,0x0000,0x0000,0x0000,0xCBBC,0x6055, - 0xCBBD,0x0000,0x0000,0x0000,0x0000,0xCBBE,0xCBBF,0xCBC0, - 0xCBC1,0x0000,0x0000,0x3D43,0x0000,0x0000,0xCBC2,0xCBC3, - 0x6057,0xCBC4,0x6056,0xCBC5,0xCBC6,0x0000,0xCBC7,0xCBC8, - 0x6058,0xCBC9,0x334D,0x0000,0x0000,0x605A,0x0000,0xCBCA, - 0x6059,0xCBCB,0x605C,0x605B,0xCBCC,0x0000,0x0000,0x0000, - 0xCBCD,0xCBCE,0x0000,0xCBCF,0x383C,0xCBD0,0xCBD1,0x4E28, - 0x0000,0x364C,0x0000,0x3226,0x0000,0x0000,0xCBD2,0x0000, - 0xCBD3,0x0000,0x0000,0xCBD4,0x0000,0xCBD5,0x366A,0xCBD6, - 0xCBD7,0x0000,0x0000,0x0000,0xCBD8,0x0000,0xCBD9,0xCBDA, - 0xCBDB,0x0000,0xCBDC,0x0000,0x0000,0xCBDD,0xCBDE,0x0000, - 0x0000,0x3461,0xCBDF,0xCBE0,0x0000,0xCBE1,0x0000,0x0000, - 0x0000,0x0000,0x4E68,0x605E,0x0000,0xCBE2,0x0000,0xCBE3, - 0x0000,0xCBE4,0x0000,0x6060,0xCBE5,0xCBE6,0x0000,0xCBE7, - 0x6061,0x0000,0x3251,0x0000,0x0000,0xCBE8,0xCBE9,0x0000, - 0x605D,0xCBEA,0x3B39,0xCBEB,0xCBEC,0x4441,0x605F,0xCBED, - 0x0000,0x0000,0xCBEE,0xCBEF,0x0000,0x0000,0xCBF0,0x0000, - 0x0000,0xCBF1,0x0000,0x0000,0x0000,0xCBF2,0x6064,0x0000, - 0x3C6E,0xCBF3,0x0000,0xCBF4,0x0000,0x6062,0xCBF5,0xCBF6, - 0x0000,0xCBF7,0x373E,0x0000,0x0000,0x4849,0x6063,0x0000, - 0x0000,0x607E,0x0000,0x0000,0xCBF8,0xCBF9,0x0000,0xCBFA, - 0x6069,0xCBFB,0xCBFC,0xCBFD,0x0000,0xCBFE,0x383D,0xCCA1, - - /* 7400h */ - 0xCCA2,0xCCA3,0x0000,0x3565,0xCCA4,0x6066,0x4D7D,0xCCA5, - 0x0000,0x4E30,0xCCA6,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xCCA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xCCA8,0xCCA9,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x4276,0x0000,0xCCAA,0x6068,0xCCAB,0x0000, - 0xCCAC,0xCCAD,0xCCAE,0xCCAF,0xCCB0,0xCCB1,0xCCB2,0xCCB3, - 0xCCB4,0xCCB5,0x606A,0x4E56,0x3657,0x487C,0x474A,0x0000, - 0x0000,0xCCB6,0x606B,0x0000,0x0000,0x0000,0x0000,0x606D, - 0xCCB7,0x6070,0x0000,0xCCB8,0xCCB9,0x0000,0xCCBA,0xCCBB, - 0x0000,0x0000,0x0000,0xCCBC,0x0000,0xCCBD,0x0000,0x0000, - 0x0000,0xCCBE,0xCCBF,0x0000,0x0000,0x606C,0x0000,0xCCC0, - 0x0000,0x606F,0x386A,0x314D,0x6071,0xCCC1,0x3F70,0x606E, - 0x4E5C,0x0000,0xCCC2,0x6074,0x7424,0x0000,0xCCC3,0xCCC4, - 0xCCC5,0x6072,0x6075,0xCCC6,0x0000,0xCCC7,0xCCC8,0x6067, - 0x6073,0xCCC9,0xCCCA,0x3A3C,0x0000,0x0000,0x6076,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6077,0x0000, - 0xCCCB,0xCCCC,0x0000,0x4D7E,0x0000,0xCCCD,0xCCCE,0xCCCF, - 0x0000,0xCCD0,0x0000,0x6078,0x0000,0x0000,0x0000,0xCCD1, - 0xCCD2,0xCCD3,0xCCD4,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xCCD5,0xCCD6,0xCCD7,0x0000,0xCCD8,0x0000,0x6079,0xCCD9, - 0xCCDA,0xCCDB,0x6065,0xCCDC,0x0000,0x0000,0xCCDD,0x607A, - 0xCCDE,0xCCDF,0xCCE0,0xCCE1,0x0000,0x0000,0xCCE2,0xCCE3, - 0x3444,0xCCE4,0xCCE5,0x0000,0x0000,0xCCE6,0x0000,0x0000, - 0x0000,0xCCE7,0x0000,0xCCE8,0x0000,0x3C25,0x0000,0xCCE9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xCCEA,0xCCEB,0x607B,0x0000,0xCCEC,0x0000,0x0000,0x607C, - 0xCCED,0x0000,0x0000,0xCCEE,0x607D,0x0000,0x0000,0x0000, - 0xCCEF,0x0000,0xCCF0,0xCCF1,0x313B,0x0000,0xCCF2,0xCCF3, - 0x6121,0x0000,0x493B,0x6122,0xCCF4,0x0000,0x3424,0x6123, - 0xCCF5,0x6124,0xCCF6,0xCCF7,0x0000,0x0000,0x6125,0xCCF8, - 0x6127,0x6128,0x6126,0x0000,0xCCF9,0x0000,0x4953,0x612A, - 0x6129,0x0000,0xCCFA,0xCCFB,0xCCFC,0x0000,0x0000,0xCCFD, - - /* 7500h */ - 0x0000,0x0000,0x0000,0x612C,0x612B,0x612D,0xCCFE,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x612E,0x6130,0x612F,0x0000, - 0x0000,0x3979,0xCDA1,0x6132,0x0000,0x6131,0xCDA2,0xCDA3, - 0x3445,0x0000,0x3F53,0x0000,0x453C,0x0000,0x6133,0x4038, - 0xCDA4,0xCDA5,0x0000,0x3B3A,0xCDA6,0x3179,0x6134,0xCDA7, - 0x4D51,0xCDA8,0xCDA9,0x4A63,0x6135,0x0000,0x0000,0xCDAA, - 0x4544,0x4D33,0x3943,0x3F3D,0x0000,0x0000,0xCDAB,0x434B, - 0x5234,0xCDAC,0x442E,0x3268,0x6136,0xCDAD,0xCDAE,0xCDAF, - 0xCDB0,0x0000,0x0000,0xCDB1,0x6137,0x0000,0x613C,0xCDB2, - 0xCDB3,0x613A,0x6139,0x5A42,0x3326,0x6138,0xCDB4,0x305A, - 0xCDB5,0x482A,0xCDB6,0x0000,0x484A,0x0000,0x0000,0xCDB7, - 0x0000,0x4E31,0x613D,0x613B,0x435C,0x4026,0xCDB8,0xCDB9, - 0x482B,0xCDBA,0x492D,0x0000,0x613F,0x4E2C,0x374D,0x6140, - 0x0000,0x613E,0x4856,0x6141,0x0000,0x6142,0x0000,0xCDBB, - 0x305B,0xCDBC,0x0000,0x3E76,0x6147,0x0000,0x6144,0x466D, - 0x6143,0xCDBD,0xCDBE,0xCDBF,0xCDC0,0xCDC1,0xCDC2,0x3526, - 0x0000,0xCDC3,0x614A,0x0000,0x0000,0xCDC4,0x6145,0x6146, - 0x0000,0x6149,0x6148,0x4925,0x0000,0x0000,0x4142,0x4141, - 0xCDC5,0x353F,0xCDC6,0xCDC7,0x614B,0xCDC8,0x0000,0x0000, - 0x0000,0xCDC9,0x614C,0x0000,0xCDCA,0x614D,0x0000,0x0000, - 0x0000,0x0000,0xCDCB,0x614F,0xCDCC,0x614E,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3156,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x6157,0x4868,0x6151,0xCDCD,0x6153,0x0000,0x0000, - 0x6155,0x3F3E,0xCDCE,0x0000,0x6156,0x6154,0x3C40,0xCDCF, - 0xCDD0,0xCDD1,0x6150,0x6152,0xCDD2,0x4942,0xCDD3,0x3E49, - 0x0000,0x0000,0x6159,0x0000,0xCDD4,0x6158,0xCDD5,0xCDD6, - 0x0000,0x0000,0x615A,0x0000,0x3C26,0x3A2F,0x0000,0xCDD7, - 0x4577,0x615B,0x0000,0x444B,0xCDD8,0x0000,0x615D,0xCDD9, - 0xCDDA,0xCDDB,0x4E21,0x615C,0xCDDC,0x0000,0x0000,0xCDDD, - 0x0000,0x4169,0x0000,0x0000,0xCDDE,0x0000,0xCDDF,0xCDE0, - 0x6162,0xCDE1,0x6164,0x6165,0x4354,0x0000,0x0000,0x0000, - 0x0000,0xCDE2,0x6163,0x0000,0x6160,0x0000,0x615E,0x615F, - - /* 7600h */ - 0xCDE3,0x6161,0xCDE4,0xCDE5,0xCDE6,0x0000,0x0000,0xCDE7, - 0xCDE8,0x6168,0xCDE9,0x6166,0xCDEA,0x6167,0x0000,0xCDEB, - 0x0000,0x0000,0xCDEC,0xCDED,0x0000,0xCDEE,0xCDEF,0x0000, - 0x0000,0xCDF0,0x0000,0xCDF1,0xCDF2,0xCDF3,0xCDF4,0x6169, - 0x616B,0x616C,0x616D,0xCDF5,0x616E,0xCDF6,0xCDF7,0x616A, - 0x0000,0xCDF8,0x0000,0x0000,0x0000,0xCDF9,0x0000,0x0000, - 0x6170,0x0000,0xCDFA,0xCDFB,0x616F,0xCDFC,0x0000,0x0000, - 0xCDFD,0xCDFE,0xCEA1,0x6171,0xCEA2,0x0000,0x0000,0x0000, - 0xCEA4,0xCEA5,0x4E45,0xCEA6,0xCEA7,0xCEA8,0x6174,0x6172, - 0x6173,0xCEA9,0xCEA3,0xCEAA,0x3462,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x4C7E,0x0000,0x0000,0xCEAB,0x4A4A,0x0000, - 0x6176,0xCEAC,0x0000,0x0000,0x6175,0x0000,0x0000,0xCEAD, - 0x0000,0x6177,0x6178,0x0000,0xCEAE,0xCEAF,0x0000,0x617C, - 0x6179,0x617A,0x617B,0x0000,0x617D,0xCEB0,0xCEB1,0xCEB2, - 0x617E,0xCEB3,0x6221,0x0000,0xCEB4,0x0000,0x6222,0x0000, - 0x6223,0x0000,0x482F,0x4550,0x6224,0x4772,0x4934,0x0000, - 0x6225,0xCEB5,0x0000,0x6226,0x452A,0xCEB6,0x3327,0x3944, - 0x6227,0x0000,0x0000,0x6228,0xCEB7,0xCEB8,0x6229,0x0000, - 0x3B29,0x0000,0x0000,0x622B,0x0000,0xCEB9,0x622A,0x0000, - 0x0000,0x622C,0x622D,0xCEBA,0xCEBB,0xCEBC,0x0000,0xCEBD, - 0xCEBE,0x0000,0xCEBF,0xCEC0,0xCEC1,0xCEC2,0xCEC3,0xCEC4, - 0xCEC5,0x0000,0xCEC6,0x0000,0x0000,0xCEC7,0x4869,0x0000, - 0x622E,0x0000,0x0000,0x0000,0x622F,0x0000,0x0000,0x7369, - 0x6230,0x6231,0x6232,0x0000,0x0000,0xCEC8,0x0000,0x3B2E, - 0x0000,0xCEC9,0x6233,0x4756,0x0000,0xCECA,0x4B5F,0x0000, - 0x314E,0xCECB,0x3157,0xCECC,0xCECD,0x6234,0xCECE,0x0000, - 0x0000,0x0000,0x6236,0x0000,0xCECF,0x0000,0x6235,0x4570, - 0x0000,0xCED0,0x0000,0x4039,0x5D39,0x0000,0x6237,0x4C41, - 0xCED1,0x6238,0x0000,0x3446,0x4857,0x6239,0xCED2,0x623A, - 0xCED3,0x0000,0x623B,0x0000,0xCED4,0x0000,0x4C5C,0x0000, - 0xCED5,0xCED6,0x4C55,0x0000,0x443E,0x0000,0xCED7,0x0000, - 0x416A,0xCED8,0x0000,0x623D,0xCED9,0x0000,0x3D62,0x0000, - - /* 7700h */ - 0xCEDA,0x3E4A,0x0000,0x0000,0x6240,0x0000,0xCEDB,0x623F, - 0x623E,0x487D,0xCEDC,0x3447,0x3829,0x0000,0xCEDD,0x0000, - 0x0000,0x0000,0xCEDE,0x0000,0xCEDF,0xCEE0,0x0000,0xCEE1, - 0x0000,0xCEE2,0xCEE3,0x6246,0xCEE4,0x0000,0x6243,0x3F3F, - 0x4C32,0x0000,0xCEE5,0x0000,0x6242,0x6244,0x6245,0x0000, - 0xCEE6,0x6241,0x0000,0x0000,0x0000,0xCEE7,0xCEE8,0xCEE9, - 0x0000,0x0000,0x0000,0x0000,0xCEEA,0xCEEB,0xCEEC,0x6247, - 0x6248,0xCEED,0x442F,0x0000,0x3463,0xCEEE,0xCEEF,0x0000, - 0x4365,0x0000,0xCEF0,0x0000,0x0000,0xCEF1,0xCEF2,0x6249, - 0x0000,0x0000,0xCEF3,0x0000,0x0000,0xCEF4,0xCEF5,0xCEF6, - 0x0000,0x0000,0xCEF7,0x0000,0x0000,0x0000,0xCEF8,0xCEF9, - 0x0000,0x0000,0x624A,0x624D,0xCEFA,0x0000,0xCEFB,0xCEFC, - 0xCEFD,0x3F67,0xCEFE,0x4644,0xCFA1,0x624E,0x4B53,0xCFA2, - 0x624B,0x0000,0xCFA3,0x624C,0xCFA4,0x0000,0x0000,0x0000, - 0xCFA5,0x0000,0xCFA6,0xCFA7,0xCFA8,0x0000,0x0000,0x0000, - 0x0000,0x6251,0xCFA9,0x0000,0x0000,0xCFAA,0x6250,0x624F, - 0xCFAB,0x0000,0x0000,0x0000,0xCFAC,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x6253,0xCFAD,0xCFAE,0x6252,0x0000, - 0x0000,0x6254,0x0000,0x0000,0xCFAF,0xCFB0,0xCFB1,0x0000, - 0x0000,0x0000,0xCFB2,0x0000,0x0000,0x0000,0x6256,0xCFB3, - 0x6255,0x0000,0xCFB4,0x0000,0x0000,0x4A4D,0x0000,0xCFB5, - 0x0000,0x0000,0xCFB6,0x0000,0x3D56,0x4E46,0xCFB7,0xCFB8, - 0x6257,0xCFB9,0x0000,0x4637,0x0000,0xCFBA,0x6258,0x0000, - 0x0000,0x6259,0x0000,0x625D,0x625B,0x625C,0xCFBB,0x625A, - 0x0000,0x0000,0x0000,0xCFBC,0x0000,0x0000,0x0000,0x625E, - 0x0000,0xCFBD,0x0000,0x0000,0x0000,0x625F,0x0000,0x0000, - 0x0000,0xCFBE,0xCFBF,0x0000,0x0000,0xCFC0,0x0000,0x6260, - 0x0000,0xCFC1,0x6261,0x4C37,0x6262,0x0000,0xCFC2,0xCFC3, - 0xCFC4,0x0000,0x4C70,0x6263,0xCFC5,0x434E,0xCFC6,0x476A, - 0x0000,0x366B,0xCFC7,0x0000,0xCFC8,0x433B,0x6264,0x363A, - 0xCFC9,0xCFCA,0x0000,0x4050,0xCFCB,0x0000,0x0000,0x0000, - 0xCFCC,0x0000,0x0000,0xCFCD,0x6265,0x0000,0x0000,0x0000, - - /* 7800h */ - 0x0000,0x0000,0x3A3D,0x0000,0x0000,0xCFCE,0xCFCF,0x0000, - 0x0000,0xCFD0,0x0000,0x0000,0x6266,0xCFD1,0xCFD2,0x0000, - 0x0000,0xCFD3,0x6267,0x0000,0x3826,0x3A55,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xCFD4,0x0000,0x0000, - 0x6269,0xCFD5,0xCFD6,0xCFD7,0x0000,0x4556,0x3A56,0x354E, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xCFD8,0xCFD9,0x0000, - 0xCFDA,0x0000,0x4B24,0x0000,0x474B,0xCFDB,0x0000,0xCFDC, - 0x0000,0x0000,0x4557,0x0000,0x0000,0x0000,0x0000,0x395C, - 0x0000,0x0000,0x0000,0xCFDD,0xCFDE,0x626B,0x0000,0xCFDF, - 0xCFE0,0x0000,0x0000,0x0000,0xCFE1,0x0000,0xCFE2,0x0000, - 0x0000,0x0000,0xCFE3,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xCFE4,0x3E4B,0xCFE5,0x0000, - 0xCFE6,0xCFE7,0x0000,0xCFE8,0xCFE9,0x0000,0x0000,0x0000, - 0xCFEA,0x0000,0xCFEB,0x4E32,0x3945,0x0000,0xCFEC,0x3827, - 0x0000,0x0000,0x4823,0x0000,0x626D,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xCFED,0x0000,0x626F,0x0000,0xCFEE,0x0000, - 0x0000,0x386B,0x0000,0x0000,0x0000,0x0000,0x626E,0x4476, - 0x0000,0x0000,0xCFEF,0x0000,0x6271,0x3337,0x626C,0xCFF0, - 0x0000,0x486A,0x0000,0x3130,0xCFF1,0x3A6C,0x0000,0x4F52, - 0xCFF2,0x0000,0x6270,0x0000,0x0000,0xCFF4,0xCFF5,0xCFF6, - 0x0000,0xCFF3,0x0000,0x6272,0xCFF7,0x0000,0x0000,0x4A4B, - 0xCFF8,0x4059,0x6274,0x0000,0xCFF9,0xCFFA,0x0000,0x6275, - 0xCFFB,0xCFFC,0xCFFD,0xCFFE,0x0000,0x6273,0x0000,0x0000, - 0x0000,0x0000,0x334E,0xD0A1,0x627B,0xD0A2,0x627A,0xD0A3, - 0x0000,0x3C27,0x0000,0x0000,0x0000,0x627C,0x6277,0xD0A4, - 0xD0A5,0xD0A6,0x627D,0x6278,0xD0A7,0x0000,0xD0A8,0x0000, - 0x4858,0x6276,0xD0A9,0xD0AA,0x6279,0xD0AB,0xD0AC,0x0000, - 0x0000,0x0000,0x6322,0xD0AE,0x0000,0x0000,0x0000,0xD0AF, - 0xD0B0,0xD0B1,0x0000,0x0000,0xD0AD,0x0000,0xD0B2,0x6321, - 0x4B61,0x0000,0xD0B3,0x0000,0x627E,0x0000,0x0000,0x306B, - 0x0000,0x0000,0xD0B4,0xD0B5,0x6324,0x0000,0xD0B7,0xD0B8, - 0x0000,0x0000,0xD0B9,0xD0BA,0x0000,0x6323,0x0000,0xD0BB, - - /* 7900h */ - 0xD0B6,0x3E4C,0x0000,0x0000,0x0000,0x0000,0xD0BC,0x6325, - 0x0000,0x0000,0x0000,0x0000,0xD0BD,0x0000,0x4143,0x0000, - 0xD0BE,0x6327,0x6326,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x6328,0xD0BF,0x0000,0xD0C0,0x0000,0xD0C1,0xD0C2, - 0xD0C3,0x0000,0x0000,0x0000,0x0000,0xD0C4,0x6268,0xD0C5, - 0x0000,0xD0C6,0x626A,0x632A,0x6329,0xD0C7,0x0000,0x0000, - 0x0000,0xD0C8,0x0000,0x0000,0xD0C9,0xD0CA,0x0000,0x0000, - 0x0000,0x0000,0x3C28,0xD0CB,0x4E69,0xD0CC,0x3C52,0xD0CD, - 0x632B,0x3737,0x0000,0x0000,0xD0CE,0xD0CF,0xD0D0,0x3540, - 0x3527,0x3B63,0xD0D1,0xD0D2,0x0000,0x0000,0x0000,0xD0D3, - 0x4D34,0xD0D4,0x0000,0x6331,0xD0D5,0x6330,0x4144,0x632D, - 0xD0D6,0x0000,0x632F,0xD0D7,0xD0D8,0x3D4B,0x3F40,0x632E, - 0x632C,0x0000,0x472A,0x0000,0x0000,0x3E4D,0x0000,0xD0D9, - 0x493C,0xD0DA,0x0000,0xD0DB,0x0000,0x3A57,0x0000,0x0000, - 0x0000,0x0000,0xD0DC,0x0000,0x0000,0x0000,0x0000,0x4578, - 0x0000,0xD0DD,0x6332,0xD0DE,0xD0DF,0x0000,0xD0E0,0x6333, - 0x6349,0x3658,0x0000,0x0000,0x4F3D,0x4135,0x0000,0x0000, - 0x0000,0x0000,0x6334,0xD0E1,0xD0E2,0x3252,0x4477,0x4A21, - 0x0000,0xD0E3,0x0000,0xD0E4,0xD0E5,0xD0E6,0xD0E7,0x0000, - 0xD0E8,0x0000,0x0000,0xD0E9,0xD0EA,0x6335,0x0000,0x0000, - 0x0000,0xD0EB,0x0000,0x0000,0x0000,0x0000,0x357A,0x6336, - 0xD0EC,0xD0ED,0x6338,0xD0EE,0x0000,0x0000,0x6339,0xD0EF, - 0x4729,0xD0F0,0x0000,0x633A,0xD0F1,0x0000,0x0000,0x0000, - 0xD0F2,0x633B,0x633C,0xD0F3,0x0000,0x3659,0x3253,0x4645, - 0x3D28,0x3B64,0xD0F4,0x0000,0xD0F5,0x0000,0x0000,0xD0F6, - 0xD0F7,0x633D,0xD0F8,0x3D29,0x0000,0x0000,0x0000,0xD0F9, - 0x0000,0x324A,0x4943,0x0000,0xD0FA,0x633E,0xD0FB,0x0000, - 0x486B,0x0000,0xD0FC,0x0000,0x0000,0xD0FD,0xD0FE,0x4145, - 0xD1A1,0x6341,0xD1A2,0x6342,0x4769,0xD1A3,0x3F41,0x633F, - 0x0000,0x4361,0xD1A4,0xD1A5,0x6340,0xD1A6,0x0000,0x0000, - 0x3E4E,0xD1A7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xD1A8,0x0000,0x0000,0x305C,0xD1A9,0x0000,0x0000,0x0000, - - /* 7A00h */ - 0x3529,0x0000,0xD1AA,0xD1AB,0x0000,0x0000,0x0000,0xD1AC, - 0x6343,0xD1AD,0xD1AE,0x4478,0xD1AF,0x6344,0x4047,0x0000, - 0x0000,0xD1B0,0x0000,0x0000,0x4C2D,0xD1B1,0x0000,0x4923, - 0x6345,0x6346,0x4355,0xD1B2,0x4E47,0x0000,0xD1B3,0x6348, - 0x6347,0xD1B4,0x0000,0x0000,0x0000,0x0000,0x0000,0xD1B5, - 0x0000,0x0000,0x0000,0xD1B6,0x0000,0xD1B7,0x3C6F,0xD1B8, - 0xD1B9,0x634A,0x3070,0x0000,0xD1BA,0xD1BB,0x0000,0x634D, - 0xD1BC,0xD1BD,0xD1BE,0x634B,0x3254,0x374E,0x634C,0x3946, - 0x3972,0x0000,0x4A66,0x634E,0xD1BF,0xD1C0,0x4B54,0xD1C1, - 0xD1C2,0x6350,0x0000,0x0000,0xD1C3,0x4051,0x314F,0x323A, - 0x302C,0x0000,0x0000,0x0000,0x0000,0xD1C4,0xD1C5,0x634F, - 0x0000,0xD1C6,0x0000,0x0000,0xD1C7,0xD1C8,0x0000,0xD1C9, - 0xD1CA,0x6351,0x6352,0x3E77,0x0000,0xD1CB,0x0000,0xD1CC, - 0x0000,0x6353,0xD1CD,0x334F,0x0000,0xD1CE,0x0000,0x0000, - 0x6355,0x0000,0x0000,0x0000,0x376A,0xD1CF,0x3566,0x0000, - 0xD1D0,0x6356,0x3675,0x0000,0x0000,0x6357,0xD1D1,0x407C, - 0xD1D2,0x464D,0xD1D3,0x4060,0x3A75,0xD1D4,0xD1D5,0x0000, - 0x6358,0x0000,0xD1D6,0xD1D7,0x0000,0x0000,0x0000,0x0000, - 0xD1D8,0xD1D9,0x4362,0x416B,0xD1DA,0x635A,0x635C,0x6359, - 0x635B,0x0000,0x0000,0x0000,0x0000,0x0000,0xD1DB,0x3722, - 0xD1DC,0x0000,0x0000,0xD1DD,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x635D,0x3726,0x0000,0xD1DE,0x0000,0x3567,0x4D52, - 0x635F,0x0000,0x0000,0xD1DF,0x0000,0xD1E0,0x6360,0x0000, - 0x0000,0xD1E1,0x312E,0xD1E2,0xD1E3,0x0000,0x0000,0x6363, - 0x0000,0x0000,0x0000,0x3376,0x6362,0x6361,0xD1E4,0x6365, - 0x635E,0xD1E5,0x6366,0x4E29,0xD1E6,0x6367,0xD1E7,0x6368, - 0x0000,0xD1E8,0x5474,0x636A,0x0000,0x6369,0x0000,0x0000, - 0x0000,0x636B,0x636C,0xD1E9,0x4E35,0x636D,0x0000,0x706F, - 0x3E4F,0x636E,0x636F,0x3D57,0x0000,0x4638,0x6370,0x0000, - 0xD1EA,0xD1EB,0x4328,0xD1EC,0xD1ED,0x6371,0x0000,0x433C, - 0x6372,0xD1EE,0x0000,0x0000,0xD1EF,0x0000,0x3625,0x0000, - 0x513F,0x435D,0x3C33,0xD1F0,0x0000,0xD1F1,0xD1F2,0x3448, - - /* 7B00h */ - 0x0000,0x0000,0x6373,0x0000,0x6422,0x0000,0x6376,0xD1F3, - 0x3568,0x0000,0x6375,0x6424,0x0000,0x0000,0x0000,0x6374, - 0x0000,0x3E50,0x0000,0x0000,0xD1F4,0x0000,0x0000,0x0000, - 0x6378,0x6379,0x0000,0x452B,0x0000,0x0000,0x637A,0xD1F5, - 0x335E,0x0000,0x0000,0xD1F6,0x0000,0x3F5A,0x4964,0xD1F7, - 0x637C,0xD1F8,0xD1F9,0xD1FA,0x4268,0xD1FB,0xD1FC,0xD1FD, - 0xD1FE,0xD2A1,0x0000,0x6377,0xD2A2,0x637B,0x637D,0x0000, - 0x0000,0x3A7B,0x0000,0x0000,0x0000,0xD2A3,0x0000,0xD2A4, - 0xD2A5,0xD2A6,0x0000,0x0000,0x0000,0x6426,0x492E,0xD2A7, - 0x4826,0x4579,0x0000,0x365A,0x6425,0x6423,0xD2A8,0x4835, - 0x637E,0x435E,0x457B,0x0000,0x457A,0xD2A9,0x3A76,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x6438,0x0000,0x0000, - 0xD2AA,0x0000,0x0000,0x0000,0xD2AB,0x6428,0xD2AC,0x642A, - 0x0000,0xD2AD,0xD2AE,0x0000,0x642D,0xD2AF,0x642E,0xD2B0, - 0x642B,0x642C,0xD2B1,0xD2B2,0x6429,0x6427,0x0000,0xD2B3, - 0x0000,0x0000,0x6421,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xD2B4,0x0000,0x4A4F,0x3255, - 0x0000,0xD2B5,0x0000,0x6435,0x0000,0x6432,0xD2B6,0x6437, - 0xD2B7,0xD2B8,0x6436,0x0000,0x4773,0x4C27,0xD2B9,0x3B3B, - 0x6430,0x6439,0x6434,0xD2BA,0x6433,0x642F,0xD2BB,0x6431, - 0xD2BC,0x3449,0x0000,0x0000,0x0000,0xD2BD,0x0000,0x0000, - 0x0000,0x0000,0x433D,0x0000,0xD2BE,0x407D,0x0000,0xD2BF, - 0xD2C0,0x4822,0xD2C1,0x0000,0x643E,0xD2C2,0xD2C3,0x0000, - 0x4824,0x0000,0xD2C4,0xD2C5,0xD2C6,0xD2C7,0x0000,0x0000, - 0x4061,0x643B,0xD2C8,0x0000,0x484F,0xD2C9,0x643F,0x4A53, - 0xD2CA,0x435B,0xD2CB,0x643A,0x643C,0x0000,0x0000,0x643D, - 0x0000,0x0000,0x0000,0x0000,0xD2CC,0x0000,0xD2CD,0xD2CE, - 0x0000,0xD2CF,0xD2D0,0xD2D1,0x0000,0x6440,0x0000,0x0000, - 0x3C44,0x0000,0x0000,0x0000,0x4646,0x6445,0x6444,0x0000, - 0xD2D2,0x6441,0xD2D3,0x0000,0x0000,0x4F36,0x0000,0x0000, - 0x0000,0x0000,0xD2D4,0x644A,0xD2D5,0xD2D6,0x644E,0x644B, - 0xD2D7,0xD2D8,0xD2D9,0x0000,0xD2DA,0x0000,0xD2DB,0x0000, - - /* 7C00h */ - 0x6447,0xD2DC,0xD2DD,0xD2DE,0xD2DF,0x0000,0xD2E0,0x6448, - 0x0000,0xD2E1,0x0000,0xD2E2,0xD2E3,0x644D,0xD2E4,0xD2E5, - 0x0000,0x6442,0x5255,0x6449,0x6443,0x0000,0x0000,0x644C, - 0x0000,0xD2E6,0x0000,0xD2E7,0x0000,0x0000,0x0000,0x6452, - 0xD2E8,0x344A,0x0000,0x644F,0x0000,0xD2E9,0xD2EA,0x6450, - 0xD2EB,0x0000,0x6451,0x6454,0xD2EC,0x0000,0x0000,0x0000, - 0x0000,0xD2ED,0x0000,0xD2EE,0xD2EF,0x0000,0xD2F0,0x6453, - 0x4876,0xD2F1,0xD2F2,0x0000,0x0000,0x6455,0x4E7C,0x4A6D, - 0x645A,0x0000,0x0000,0x6457,0x0000,0x0000,0xD2F3,0x0000, - 0x0000,0x0000,0xD2F4,0x0000,0x6456,0x4052,0x0000,0x6459, - 0x645B,0xD2F6,0xD2F7,0xD2F8,0x6458,0xD2F5,0x645F,0x0000, - 0x645C,0xD2F9,0xD2FA,0xD2FB,0xD2FC,0xD2FD,0xD2FE,0x645D, - 0x6446,0xD3A1,0x0000,0xD3A2,0x645E,0x6460,0x0000,0xD3A3, - 0x0000,0xD3A4,0x0000,0x0000,0x6461,0xD3A5,0xD3A6,0x0000, - 0xD3A7,0x0000,0xD3A8,0x4A46,0x0000,0x6462,0x0000,0x0000, - 0x0000,0xD3A9,0x0000,0x0000,0xD3AA,0xD3AB,0x4C62,0x0000, - 0x0000,0x364E,0x3729,0x6463,0x0000,0x0000,0xD3AC,0xD3AD, - 0x0000,0x4A34,0x0000,0x3F68,0x0000,0x4C30,0x0000,0xD3AE, - 0x6464,0x0000,0x4E33,0x0000,0xD3AF,0x4774,0x0000,0x4146, - 0x4734,0x0000,0x0000,0x3D4D,0x0000,0x0000,0xD3B0,0x3040, - 0xD3B1,0x6469,0x6467,0x0000,0x6465,0x3421,0xD3B2,0x3E51, - 0x646A,0x0000,0x0000,0x6468,0x0000,0x6466,0x646E,0x0000, - 0xD3B3,0x646D,0x646C,0x646B,0x0000,0x0000,0xD3B4,0xD3B5, - 0x0000,0x646F,0xD3B6,0xD3B7,0xD3B8,0x6470,0x403A,0xD3B9, - 0x6471,0x0000,0x6473,0x0000,0xD3BA,0x6472,0x0000,0xD3BB, - 0xD3BC,0xD3BD,0x3852,0x0000,0x0000,0xD3BE,0x4138,0xD3BF, - 0x0000,0x0000,0x6475,0xD3C0,0xD3C1,0xD3C2,0x457C,0xD3C3, - 0x6474,0xD3C4,0xD3C5,0x0000,0x6476,0xD3C6,0x4A35,0x416C, - 0x3947,0x0000,0x6477,0x0000,0x0000,0x0000,0xD3C7,0x4E48, - 0x0000,0xD3C8,0x0000,0xD3C9,0x0000,0x0000,0x0000,0x6479, - 0x0000,0x0000,0x647A,0x0000,0x647B,0xD3CA,0x647C,0x0000, - 0x3B65,0x0000,0x647D,0x374F,0x0000,0x0000,0x356A,0x0000, - - /* 7D00h */ - 0x352A,0x0000,0x6521,0xD3CB,0x4C73,0x3948,0x647E,0xD3CC, - 0xD3CD,0xD3CE,0x6524,0x4C66,0x0000,0x473C,0x0000,0xD3CF, - 0x4933,0xD3D0,0xD3D1,0xD3D2,0x3D63,0x6523,0xD3D3,0x3C53, - 0x3949,0x3B66,0x3569,0x4A36,0x6522,0xD3D4,0xD3D5,0x0000, - 0x4147,0x4B42,0x3A77,0xD3D6,0x0000,0x0000,0xD3D7,0x0000, - 0x0000,0x0000,0xD3D8,0x3B67,0x445D,0xD3D9,0x6527,0x4E5F, - 0x3A59,0xD3DA,0x6528,0x3F42,0x0000,0x652A,0x0000,0x0000, - 0x0000,0x3E52,0x3A30,0x0000,0xD3DB,0xD3DC,0xD3DD,0x6529, - 0xD3DE,0xD3DF,0x3D2A,0x383E,0x4148,0x6525,0x652B,0xD3E0, - 0xD3E1,0x0000,0x0000,0x6526,0x3750,0xD3E2,0x652E,0x6532, - 0x376B,0xD3E3,0x0000,0xD3E4,0x0000,0x0000,0x652D,0xD3E5, - 0x0000,0xD3E6,0xD3E7,0x6536,0xD3E8,0xD3E9,0x394A,0x0000, - 0x0000,0x4D6D,0x303C,0x6533,0x0000,0xD3EA,0x356B,0xD3EB, - 0x6530,0x0000,0xD3EC,0x0000,0x0000,0x0000,0x6531,0x0000, - 0xD3ED,0x457D,0x652F,0x652C,0x0000,0x3328,0x4064,0x0000, - 0xD3EE,0x3828,0xD3EF,0xD3F0,0x0000,0x6538,0x0000,0xD3F1, - 0x0000,0xD3F2,0xD3F3,0xD3F4,0x0000,0xD3F5,0xD3F6,0x0000, - 0xD3F7,0x6535,0x0000,0xD3F8,0xD3F9,0xD3FA,0x0000,0x6537, - 0x0000,0xD3FB,0x0000,0x6534,0x0000,0x0000,0xD3FC,0xD3FD, - 0x0000,0x3751,0x4233,0x6539,0x416E,0xD3FE,0xD4A1,0x6546, - 0x0000,0x0000,0x6542,0x653C,0x0000,0x0000,0xD4A2,0xD4A3, - 0x0000,0x0000,0xD4A4,0x6540,0x3C7A,0x305D,0x653B,0x6543, - 0x6547,0x394B,0x4C56,0xD4A5,0x4456,0x653D,0xD4A6,0xD4A7, - 0x6545,0xD4A8,0x653A,0x433E,0x0000,0x653F,0x303D,0x4C4A, - 0x0000,0x0000,0xD4A9,0xD4AA,0xD4AB,0xD4AC,0xD4AD,0x653E, - 0x0000,0x0000,0x365B,0x486C,0xD4AE,0xD4AF,0xD4B0,0x416D, - 0x0000,0x4E50,0x3D6F,0x0000,0x0000,0x656E,0x0000,0xD4B1, - 0x6548,0xD4B2,0x407E,0x0000,0x6544,0x6549,0x654B,0x0000, - 0x4479,0x654E,0xD4B4,0x0000,0x654A,0xD4B5,0xD4B6,0x0000, - 0x4A54,0x344B,0xD4B7,0xD4B8,0x4C4B,0xD4B9,0x0000,0x305E, - 0x0000,0xD4BA,0x654D,0x0000,0x4E7D,0xD4BB,0xD4BC,0x0000, - 0x0000,0xD4BD,0xD4BE,0x654C,0x0000,0x0000,0x0000,0x0000, - - /* 7E00h */ - 0xD4B3,0x316F,0x0000,0x0000,0x466C,0x654F,0x0000,0x0000, - 0xD4BF,0x6556,0x6550,0x6557,0x0000,0x0000,0x0000,0x0000, - 0xD4C0,0xD4C1,0x6553,0x0000,0x0000,0xD4C2,0x0000,0xD4C3, - 0x0000,0x0000,0x0000,0x477B,0xD4C4,0xD4C5,0x3C4A,0x6555, - 0xD4C6,0x6552,0x6558,0x6551,0x0000,0x0000,0x3D44,0xD4C7, - 0xD4C8,0x0000,0x0000,0x4B25,0xD4C9,0xD4CA,0x3D4C,0xD4CB, - 0x0000,0x6554,0x6560,0xD4CC,0x0000,0x655C,0xD4CD,0x655F, - 0x0000,0x655D,0x6561,0x655B,0x0000,0x6541,0x4053,0xD4CE, - 0x0000,0x484B,0x0000,0x655E,0xD4CF,0xD4D0,0x6559,0xD4D1, - 0x0000,0x0000,0x4121,0x3752,0x0000,0x3D2B,0xD4D2,0x0000, - 0xD4D3,0x0000,0xD4D4,0x0000,0x3F25,0x4136,0x6564,0x0000, - 0xD4D5,0x6566,0x6567,0x0000,0x0000,0x6563,0x6565,0xD4D6, - 0x0000,0xD4D7,0xD4D8,0x0000,0x0000,0xD4D9,0x655A,0x6562, - 0x0000,0x656A,0x6569,0xD4DA,0x0000,0x4B7A,0xD4DB,0xD4DC, - 0x372B,0x0000,0x0000,0xD4DD,0x0000,0x0000,0x0000,0x0000, - 0xD4DE,0x6568,0x0000,0x656C,0x656B,0x656F,0xD4DF,0x6571, - 0x0000,0xD4E0,0x3B3C,0x656D,0x0000,0x0000,0xD4E1,0xD4E2, - 0x6572,0x6573,0xD4E3,0x0000,0x6574,0xD4E4,0x657A,0x453B, - 0x6576,0xD4E5,0x6575,0x6577,0x6578,0xD4E6,0x6579,0x0000, - 0xD4E7,0x0000,0xD4E8,0x657B,0x657C,0xD4E9,0xD4EA,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 7F00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x344C,0x0000, - 0x657D,0x0000,0x657E,0xD4EC,0xD4EB,0xD4ED,0xD4EE,0xD4EF, - 0x0000,0x0000,0x0000,0xD4F0,0xD4F1,0x6621,0x0000,0xD4F2, - 0x0000,0x0000,0x0000,0x0000,0x6622,0x6623,0x6624,0xD4F3, - 0x6625,0x6626,0xD4F4,0xD4F5,0x6628,0x6627,0x0000,0x0000, - 0x6629,0x0000,0x0000,0xD4F6,0xD4F7,0xD4F8,0x0000,0x662A, - 0x662B,0xD4F9,0x0000,0xD4FA,0xD4FB,0xD4FC,0xD4FD,0x662E, - 0x662C,0x662D,0x3A61,0x3753,0x0000,0xD4FE,0x4356,0x0000, - 0x4833,0xD5A1,0x3D70,0x0000,0x0000,0x474D,0x0000,0x486D, - 0x662F,0x586D,0x0000,0x0000,0x0000,0xD5A2,0xD5A3,0xD5A4, - 0xD5A5,0x0000,0x6630,0x6632,0x0000,0x4D65,0x6631,0x6634, - 0x6633,0x0000,0x4D53,0xD5A6,0x6635,0xD5A7,0x487E,0xD5A8, - 0xD5A9,0xD5AA,0x0000,0x0000,0x6636,0x0000,0xD5AB,0xD5AC, - 0x0000,0x0000,0x6639,0x0000,0xD5AD,0x6638,0x6637,0x0000, - 0x0000,0xD5AE,0xD5AF,0x663A,0x3732,0x0000,0xD5B0,0x0000, - 0x4122,0x3541,0xD5B1,0x0000,0x0000,0xD5B2,0x663E,0x663B, - 0x0000,0x0000,0x663C,0x0000,0xD5B3,0x0000,0x663F,0x0000, - 0x6640,0x663D,0x0000,0x0000,0xD5B4,0x3129,0x0000,0xD5B5, - 0xD5B6,0x3227,0x0000,0xD5B7,0x0000,0x6642,0x6643,0x0000, - 0xD5B8,0x0000,0x6644,0x0000,0x4D62,0x0000,0xD5B9,0xD5BA, - 0x0000,0x0000,0x3D2C,0x0000,0x6646,0x6645,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xD5BB,0x0000,0x0000,0x0000,0xD5BC, - 0x3F69,0x6647,0x0000,0xD5BD,0x0000,0xD5BE,0x6648,0x0000, - 0xD5BF,0x6649,0x0000,0x3465,0xD5C0,0x0000,0xD5C1,0xD5C2, - 0x344D,0x0000,0xD5C3,0x664A,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x664B,0xD5C4,0x4B5D,0x4D63,0xD5C5,0xD5C6,0xD5C7, - - /* 8000h */ - 0x4D54,0x4F37,0x0000,0x394D,0x664E,0x3C54,0x664D,0xD5C8, - 0xD5C9,0x0000,0xD5CA,0x664F,0x3C29,0xD5CB,0xD5CC,0xD5CD, - 0x4251,0xD5CE,0x6650,0xD5CF,0xD5D0,0x394C,0xD5D1,0x4C57, - 0x6651,0x6652,0x0000,0x0000,0x6653,0xD5D2,0xD5D3,0xD5D4, - 0xD5D5,0x6654,0x0000,0x0000,0xD5D6,0x0000,0xD5D7,0x0000, - 0x6655,0x0000,0x0000,0x0000,0xD5D8,0x0000,0xD5D9,0x0000, - 0xD5DA,0x0000,0x0000,0x3C2A,0xD5DB,0xD5DC,0x4C6D,0xD5DD, - 0x0000,0xD5DE,0xD5DF,0x6657,0xD5E0,0x433F,0xD5E1,0x6656, - 0xD5E2,0x0000,0x0000,0x0000,0xD5E3,0x0000,0x6659,0x0000, - 0x0000,0x0000,0x6658,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x665A,0x0000,0x0000,0x0000,0x403B,0x0000, - 0x665B,0x0000,0x665C,0x0000,0x0000,0x0000,0x4A39,0x665D, - 0xD5E4,0x416F,0x665E,0x0000,0xD5E5,0x0000,0xD5E6,0x0000, - 0x665F,0x0000,0x0000,0x0000,0x0000,0xD5E7,0x0000,0x4E7E, - 0x6662,0xD5E8,0x6661,0x6660,0x4430,0xD5E9,0x6663,0x3F26, - 0x0000,0x6664,0x0000,0x0000,0x0000,0x6665,0x4F38,0x6666, - 0x0000,0xD5EA,0x0000,0x0000,0x6667,0x6669,0x6668,0x4825, - 0xD5EB,0x4679,0x0000,0x4F3E,0x4829,0x0000,0xD5EC,0x0000, - 0x0000,0x0000,0x0000,0x666B,0x0000,0x0000,0x3E53,0x0000, - 0x492A,0x0000,0x666C,0x666A,0xD5ED,0x344E,0xD5EE,0x0000, - 0x0000,0x3854,0x3B68,0x0000,0x0000,0x486E,0xD5EF,0xD5F0, - 0x0000,0x382A,0x4B43,0xD5F1,0x666F,0x666D,0x0000,0x394E, - 0x0000,0x394F,0x3069,0x0000,0x3A68,0x0000,0x0000,0x0000, - 0xD5F2,0xD5F3,0x4759,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x305F,0x6674,0x0000,0x4340,0x0000, - 0xD5F4,0x0000,0x0000,0x0000,0x4758,0xD5F5,0x425B,0xD5F6, - 0x0000,0x0000,0xD5F7,0x0000,0xD5F8,0xD5F9,0x6676,0xD5FA, - 0xD5FB,0x6672,0x6675,0x6670,0x0000,0x6673,0x4B26,0x0000, - 0xD5FC,0x3855,0x0000,0x0000,0x307D,0x6671,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xD5FD,0xD5FE,0x6678, - 0xD6A1,0x6679,0xD6A2,0xD6A3,0x4639,0x0000,0xD6A4,0x0000, - 0x363B,0xD6A5,0xD6A6,0x0000,0x6726,0x473D,0xD6A7,0x0000, - - /* 8100h */ - 0x0000,0x0000,0x3B69,0xD6A8,0x0000,0x363C,0x4048,0x4F46, - 0x4C2E,0x6677,0x4054,0xD6A9,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xD6AA,0xD6AB, - 0xD6AC,0x0000,0x3553,0x667A,0xD6AD,0x0000,0xD6AE,0x0000, - 0xD6AF,0x0000,0x0000,0x667C,0xD6B0,0x0000,0x0000,0xD6B1, - 0x0000,0x667B,0x0000,0x0000,0xD6B2,0x0000,0x0000,0x667D, - 0xD6B3,0x4326,0x0000,0x473E,0x0000,0xD6B4,0x0000,0x0000, - 0x0000,0x4431,0xD6B5,0x0000,0xD6B6,0x0000,0x6723,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xD6B7,0x6722,0xD6B8, - 0x0000,0x0000,0xD6B9,0x667E,0xD6BA,0x0000,0x3F55,0x0000, - 0x4965,0x6725,0xD6BB,0x6724,0x3950,0x4F53,0x0000,0xD6BC, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6735, - 0xD6BD,0xD6BE,0x0000,0x0000,0x0000,0x6729,0x672A,0xD6BF, - 0xD6C0,0xD6C1,0x0000,0x3C70,0x0000,0xD6C2,0x6728,0xD6C3, - 0x3978,0x6727,0x0000,0x0000,0x672B,0x0000,0x0000,0xD6C4, - 0x4432,0x4A22,0x4123,0x0000,0x0000,0x0000,0x0000,0x425C, - 0x672F,0xD6C5,0x6730,0x672C,0xD6C7,0xD6C8,0xD6C9,0x0000, - 0x672D,0x0000,0x672E,0xD6CA,0x0000,0x0000,0xD6CB,0x3951, - 0xD6C6,0x0000,0x0000,0x6736,0x0000,0x6732,0xD6CC,0x0000, - 0xD6CD,0x0000,0x4966,0xD6CE,0x4B6C,0x4928,0xD6CF,0x0000, - 0x6731,0x0000,0xD6D0,0x6734,0x6733,0x0000,0x0000,0x0000, - 0x4B44,0x6737,0x0000,0x0000,0x0000,0x0000,0xD6D1,0x0000, - 0x6738,0x0000,0xD6D2,0x4137,0xD6D3,0x6739,0x0000,0x0000, - 0x673B,0x0000,0x673F,0xD6D4,0x0000,0x673C,0x673A,0x473F, - 0x673D,0x0000,0x673E,0xD6D6,0x0000,0xD6D7,0x3232,0x0000, - 0x6745,0x6740,0xD6D8,0xD6D5,0x0000,0x6741,0xD6D9,0xD6DA, - 0x0000,0x6742,0x0000,0x4221,0x0000,0xD6DB,0x0000,0xD6DC, - 0x6744,0x6743,0x6746,0xD6DD,0x0000,0xD6DE,0xD6DF,0x6747, - 0x6748,0xD6E0,0x0000,0x3F43,0xD6E1,0x3269,0x0000,0x6749, - 0x4E57,0x0000,0x3C2B,0xD6E2,0xD6E3,0x3D2D,0x0000,0x0000, - 0xD6E4,0xD6E5,0xD6E6,0x3B6A,0x4357,0xD6E7,0xD6E8,0x0000, - 0xD6E9,0xD6EA,0x674A,0x674B,0x3131,0xD6EB,0x674C,0xD6EC, - - /* 8200h */ - 0xD6ED,0x674D,0x674E,0xD6EE,0x0000,0x674F,0x0000,0x6750, - 0x363D,0x5A2A,0x6751,0x0000,0x4065,0x6752,0x3C4B,0xD6EF, - 0x6753,0x0000,0x5030,0xD6F0,0xD6F1,0x0000,0x6754,0x4A5E, - 0x345C,0xD6F2,0xD6F3,0x4124,0x3D58,0xD6F4,0x4971,0x3D2E, - 0x0000,0xD6F5,0xD6F6,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xD6F7,0x6755,0x3952,0x6756,0x484C,0x0000,0x6764,0x0000, - 0x0000,0x0000,0xD6F8,0x6758,0xD6F9,0x4249,0x4775,0x383F, - 0x6757,0x4125,0xD6FA,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x6759,0x0000,0x0000,0xD6FB,0xD6FC,0xD6FD,0xD6FE,0x447A, - 0x0000,0x0000,0x0000,0xD7A1,0x0000,0x0000,0xD7A2,0xD7A3, - 0x0000,0xD7A4,0x0000,0x0000,0x0000,0x0000,0xD7A5,0x0000, - 0x675B,0x675A,0x675D,0x0000,0xD7A6,0x675C,0x0000,0x675E, - 0xD7A7,0x0000,0x6760,0xD7A8,0x675F,0x0000,0x344F,0xD7A9, - 0x6761,0x0000,0x6762,0x6763,0x0000,0xD7AA,0x3A31,0x4E49, - 0x0000,0x6765,0x3F27,0x0000,0xD7AB,0x0000,0x3170,0x6766, - 0x6767,0x0000,0x0000,0xD7AC,0x0000,0xD7AD,0x6768,0xD7AE, - 0xD7AF,0xD7B0,0x0000,0xD7B1,0xD7B2,0x0000,0x0000,0xD7B3, - 0x0000,0xD7B4,0xD7B5,0x3072,0x0000,0x6769,0xD7B6,0x0000, - 0x0000,0xD7B7,0x676A,0x0000,0xD7B8,0x0000,0xD7B9,0x0000, - 0xD7BA,0x4967,0xD7BB,0xD7BC,0x0000,0x3C47,0x0000,0x676C, - 0xD7BD,0xD7BE,0x0000,0xD7BF,0xD7C0,0x3329,0x3032,0xD7C1, - 0xD7C2,0xD7C3,0xD7C4,0x676B,0x676E,0x474E,0xD7C5,0x3F44, - 0xD7C6,0x3256,0xD7C7,0x4B27,0xD7C8,0x0000,0x0000,0xD7C9, - 0x375D,0x365C,0xD7CA,0x676D,0xD7CB,0x326A,0xD7CC,0xD7CD, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x3423,0xD7CE,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xD7CF,0x3171,0x6772,0x4E6A,0x425D,0xD7D0,0x0000,0x4944, - 0x0000,0x677E,0xD7D1,0x3257,0x677C,0x0000,0x677A,0x6771, - 0xD7D2,0x676F,0xD7D3,0x6770,0xD7D4,0x3C63,0x366C,0x4377, - 0xD7D5,0x0000,0xD7D6,0x4651,0x0000,0xD7D7,0x0000,0xD7D8, - 0x0000,0x3151,0x0000,0x6774,0x6773,0x0000,0xD7D9,0xD7DA, - 0x0000,0x6779,0x6775,0x6778,0x0000,0xD7DB,0xD7DC,0x0000, - - /* 8300h */ - 0xD7DD,0xD7DE,0x4C50,0x6777,0x3258,0x337D,0x677B,0xD7DF, - 0xD7E0,0x677D,0xD7E1,0xD7E2,0x0000,0x0000,0x3754,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6823,0x682C, - 0x682D,0x0000,0x0000,0xD7E4,0x302B,0xD7E5,0xD7E6,0xD7E7, - 0x0000,0xD7E8,0xD7E9,0x6834,0x0000,0x0000,0x0000,0x0000, - 0x3071,0x0000,0x0000,0x682B,0xD7EA,0xD7EB,0xD7EC,0x682A, - 0xD7ED,0x6825,0x6824,0xD7EE,0x6822,0x6821,0x4363,0xD7EF, - 0x427B,0x6827,0xD7F0,0x0000,0xD7F1,0xD7F2,0x0000,0x0000, - 0x6826,0x0000,0xD7F3,0xD7F4,0xD7F5,0x6829,0x0000,0xD7F6, - 0x0000,0x4170,0x3755,0x0000,0x0000,0xD7F7,0xD7F8,0x3141, - 0x6828,0xD7F9,0x3953,0xD8BE,0xD7E3,0xD7FA,0xD7FB,0xD7FC, - 0x4171,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xD7FD,0x0000,0x0000,0x683A,0x0000,0x683B,0x0000,0x3259, - 0xD7FE,0x0000,0x0000,0x322E,0x6838,0xD8A1,0x0000,0xD8A2, - 0xD8A3,0x0000,0xD8A4,0x0000,0xD8A5,0x682E,0xD8A6,0x6836, - 0x0000,0x683D,0x6837,0x0000,0x0000,0xD8A7,0x6835,0x0000, - 0x0000,0x0000,0xD8A8,0x6776,0xD8A9,0xD8AA,0x6833,0x0000, - 0xD8AB,0xD8AC,0x682F,0xD8AD,0xD8AE,0xD8AF,0x3450,0x6831, - 0x683C,0x0000,0x6832,0x0000,0x0000,0x0000,0xD8B0,0xD8B1, - 0x683E,0xD8B2,0x6830,0x477C,0xD8B3,0xD8CC,0x0000,0x0000, - 0x0000,0x4D69,0x0000,0x0000,0x0000,0x6839,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x684F,0xD8B4,0xD8B5, - 0xD8B6,0x6847,0x0000,0x0000,0x0000,0x3F7B,0x0000,0xD8B7, - 0x0000,0xD8B8,0x3546,0x0000,0x365D,0x0000,0x6842,0xD8B9, - 0xD8BA,0xD8BB,0x0000,0x325B,0xD8BC,0x0000,0x3E54,0x0000, - 0x6845,0x0000,0x0000,0x0000,0x3A5A,0xD8BD,0x0000,0x4551, - 0x684A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xD8BF,0x4A6E,0xD8C0,0x6841,0x0000,0x0000,0x0000,0x325A, - 0x3856,0x4929,0x684B,0x0000,0x683F,0x0000,0xD8C1,0x6848, - 0xD8C2,0xD8C3,0x0000,0x6852,0xD8C4,0x6843,0x0000,0x0000, - - /* 8400h */ - 0x0000,0xD8C5,0x0000,0x6844,0x463A,0x0000,0xD8C6,0x6849, - 0x0000,0x0000,0xD8C7,0x6846,0x4B28,0x684C,0x3060,0xD8C8, - 0x0000,0xD8C9,0x0000,0x6840,0x0000,0xD8CA,0x0000,0x0000, - 0x0000,0xD8CB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x684E,0x0000,0x684D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x476B,0x6854,0x0000,0x685F,0x0000,0x0000,0xD8CD, - 0x0000,0x337E,0x0000,0x0000,0x0000,0x6862,0x0000,0x0000, - 0x6850,0xD8CE,0x0000,0x0000,0x6855,0x4D6E,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0xD8CF,0x685E,0xD8D0, - 0xD8D1,0x4D55,0xD8D2,0x0000,0x0000,0xD8D3,0x4E2A,0xD8D4, - 0x0000,0xD8D5,0xD8D6,0x0000,0x0000,0x0000,0xD8D7,0x4378, - 0xD8D8,0xD8D9,0xD8DA,0x336B,0xD8DB,0x0000,0x0000,0x0000, - 0xD8DC,0x4972,0x6864,0x4621,0xD8DD,0xD8DE,0x3031,0xD8DF, - 0x0000,0x685D,0xD8E0,0x6859,0x4172,0x6853,0x685B,0x6860, - 0xD8E1,0x472C,0x0000,0xD8E2,0xD8E3,0x302A,0xD8E4,0x6858, - 0xD8E5,0x6861,0x4978,0x0000,0xD8E6,0xD8E7,0x0000,0x0000, - 0x0000,0xD8E8,0x685C,0x0000,0x6857,0xD8E9,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3E55,0x0000,0x0000,0x0000,0x0000, - 0x3D2F,0x0000,0xD8EA,0xD8EB,0x3C2C,0xD8EC,0x0000,0x0000, - 0x0000,0x4C58,0x0000,0x0000,0x4947,0x0000,0xD8ED,0x6867, - 0x0000,0x6870,0x0000,0x0000,0x0000,0x0000,0xD8EE,0x0000, - 0xD8EF,0xD8F0,0xD8F1,0x0000,0x0000,0x685A,0x0000,0xD8F2, - 0x0000,0xD8F3,0x3377,0x0000,0xD8F4,0x0000,0x0000,0x0000, - 0x3E78,0x6865,0xD8F5,0x686A,0x4173,0xD8F6,0xD8F7,0x6866, - 0xD8F8,0x686D,0xD8F9,0x0000,0x435F,0x0000,0x686E,0xD8FA, - 0xD8FB,0x4D56,0x6863,0x3338,0xD8FC,0x6869,0x0000,0xD8FD, - 0x686C,0x4C2C,0x0000,0xD8FE,0x0000,0x0000,0x686F,0x0000, - 0x0000,0x6868,0x686B,0x0000,0xD9A1,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xD9A2, - 0x0000,0x0000,0xD9A3,0x0000,0x4B29,0x0000,0x4F21,0xD9A4, - 0xD9A5,0xD9A6,0xD9A7,0x0000,0x6873,0x0000,0x0000,0xD9A8, - 0x0000,0x0000,0xD9AA,0xD9AB,0x687A,0xD9AC,0x0000,0x6872, - - /* 8500h */ - 0x3C43,0x0000,0xD9AD,0xD9AE,0x0000,0x0000,0x6851,0xD9AF, - 0x0000,0x0000,0x0000,0x0000,0xD9B0,0x0000,0xD9B1,0x0000, - 0xD9B2,0x4A4E,0x0000,0x4C22,0x6879,0x6878,0x0000,0x6874, - 0x6875,0x0000,0x3136,0x0000,0xD9B3,0x0000,0xD9B4,0x6877, - 0x0000,0x6871,0xD9B5,0xD9B6,0xD9B7,0xD9B8,0x4455,0xD9B9, - 0x0000,0x0000,0xD9BA,0xD9BB,0x6876,0x307E,0x0000,0xD9BC, - 0x0000,0x0000,0xD9A9,0xD9BD,0xD9BE,0x4222,0xD9BF,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x4A43,0x0000,0xD9C0, - 0x687B,0x6921,0x0000,0x4859,0x0000,0x0000,0xD9C1,0x0000, - 0x687E,0x3E56,0x3C49,0x6923,0x0000,0x0000,0x363E,0xD9C2, - 0xD9C3,0xD9C4,0xD9C5,0xD9C6,0x0000,0x6924,0xD9C7,0x4979, - 0x687D,0xD9C8,0x6856,0x0000,0xD9C9,0xD9CA,0xD9CB,0xD9CC, - 0xD9CD,0xD9CE,0xD9CF,0x687C,0xD9D0,0x0000,0x0000,0x0000, - 0x4F4F,0x4622,0x4973,0xD9D1,0x0000,0x692B,0x0000,0xD9D2, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6931, - 0x0000,0xD9D3,0xD9D4,0xD9D5,0x0000,0xD9D6,0x6932,0xD9D7, - 0x6925,0xD9D8,0x0000,0x0000,0x4776,0xD9D9,0xD9DA,0x692F, - 0x6927,0xD9DB,0x6929,0xD9DC,0xD9DD,0x0000,0x0000,0xD9DE, - 0x6933,0x6928,0x0000,0xD9DF,0x692C,0x0000,0x0000,0x3172, - 0xD9E0,0x4665,0x0000,0x692D,0x6930,0xD9E1,0x0000,0xD9E2, - 0xD9E3,0x0000,0xD9E4,0x0000,0x6926,0xD9E5,0x4126,0xD9E6, - 0x692A,0x3B27,0x3F45,0x3730,0x4C74,0xD9F4,0x4C79,0x3D72, - 0x0000,0x0000,0x0000,0x0000,0xD9E7,0x0000,0xD9E8,0xD9E9, - 0xD9EA,0x6937,0x6935,0x0000,0xD9EB,0xD9EC,0xD9ED,0xD9EE, - 0x0000,0x4F4E,0xD9EF,0x0000,0x0000,0x0000,0x0000,0xD9F0, - 0x0000,0x6934,0xD9F1,0xD9F2,0x0000,0x4D75,0xD9F3,0x6936, - 0x6938,0x0000,0x0000,0x0000,0x0000,0x6939,0x0000,0x0000, - 0xD9F5,0x0000,0xD9F6,0x0000,0x693C,0x693A,0x0000,0xD9F7, - 0xD9F8,0x0000,0x0000,0x0000,0x4623,0x693B,0xD9F9,0x0000, - 0xD9FA,0x484D,0x692E,0x0000,0x0000,0xD9FB,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xD9FC,0x0000,0x0000,0xD9FD,0x3D73, - 0x0000,0x693D,0x6942,0x4174,0xD9FE,0x0000,0x6941,0xDAA1, - - /* 8600h */ - 0xDAA2,0x0000,0x6922,0x0000,0xDAA3,0xDAA4,0x6943,0x4149, - 0x0000,0x0000,0x693E,0x6940,0x0000,0xDAA5,0xDAA6,0x0000, - 0xDAA7,0xDAA8,0xDAA9,0x693F,0x0000,0x0000,0x5D31,0x5D22, - 0xDAAA,0xDAAB,0x6945,0xDAAC,0x0000,0x0000,0xDAAD,0x0000, - 0x0000,0xDAAE,0x6944,0x0000,0x0000,0x0000,0x0000,0xDAAF, - 0x0000,0xDAB0,0x0000,0x0000,0x0000,0x4D76,0x0000,0x623C, - 0x6946,0x0000,0x0000,0x0000,0x0000,0x0000,0xDAB1,0x0000, - 0xDAB2,0x0000,0xDAB3,0x0000,0xDAB4,0xDAB5,0x0000,0x6947, - 0xDAB6,0xB8E6,0xDAB7,0x0000,0x0000,0x0000,0xDAB8,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x6948,0x3857,0x0000, - 0x3554,0x0000,0xDAB9,0xDABA,0x694A,0x515D,0xDABB,0xDABC, - 0xDABD,0xDABE,0x3575,0x0000,0x4E3A,0xDABF,0x3673,0x694B, - 0xDAC0,0xDAC1,0xDAC2,0xDAC3,0xDAC4,0x0000,0x0000,0x694C, - 0x0000,0xDAC5,0x0000,0x436E,0xDAC6,0x0000,0x0000,0xDAC7, - 0x0000,0x694D,0x0000,0x0000,0x0000,0xDAC8,0xDAC9,0xDACA, - 0x0000,0x467A,0xDACB,0x303A,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xDAED,0x0000,0x3263,0x6952,0x6953,0xDACC,0x0000,0x0000, - 0x0000,0xDACD,0x0000,0x694E,0x0000,0x3B3D,0xDACE,0x0000, - 0xDACF,0x0000,0xDAD0,0x0000,0xDAD1,0x0000,0x0000,0x0000, - 0x0000,0xDAD2,0x0000,0x694F,0x4742,0x0000,0xDAD3,0xDAD4, - 0xDAD5,0x6950,0x6951,0x695B,0x0000,0xDAD6,0x0000,0x6955, - 0x6958,0xDAD7,0x0000,0xDAD8,0xDAD9,0xDADA,0x6954,0xDADB, - 0xDADC,0xDADD,0x0000,0x0000,0x0000,0x0000,0x0000,0xDADE, - 0xDADF,0xDAE0,0x0000,0xDAE1,0x6956,0xDAE2,0x6957,0x3C58, - 0x0000,0x6959,0x0000,0x4341,0x0000,0x3756,0x3342,0x0000, - 0x0000,0xDAE3,0xDAE4,0x0000,0x695C,0xDAE5,0x0000,0xDAE6, - 0x0000,0x333F,0xDAE7,0x6961,0xDAE8,0x0000,0x695D,0x6960, - 0xDAE9,0x0000,0x0000,0xDAEA,0x483A,0xDAEB,0x0000,0xDAEC, - 0x0000,0x695E,0x0000,0x0000,0x695F,0x4948,0x485A,0x6962, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x427D,0x696C,0xDAEE,0x6968,0xDAEF,0xDAF0,0x326B,0x0000, - - /* 8700h */ - 0x6966,0x0000,0x4B2A,0x6967,0xDAF1,0xDAF2,0x6964,0xDAF3, - 0x6965,0x696A,0x696D,0xDAF4,0x0000,0x696B,0xDAF5,0xDAF6, - 0xDAF7,0x6969,0x6963,0xDAF8,0xDAF9,0x0000,0x0000,0x0000, - 0x4358,0xDAFA,0x6974,0x0000,0x4C2A,0x0000,0xDAFB,0xDAFC, - 0x0000,0xDAFD,0x0000,0xDAFE,0x0000,0x6972,0x0000,0x0000, - 0xDBA1,0x6973,0x0000,0x0000,0x0000,0x0000,0xDBA2,0xDBA3, - 0x0000,0xDBA4,0xDBA5,0x0000,0x696E,0x0000,0x0000,0x6970, - 0x0000,0xDBA6,0xDBA7,0x6971,0xDBA8,0xDBA9,0xDBAA,0x696F, - 0xDBAB,0x0000,0x0000,0xDBAC,0x0000,0xDBAD,0x0000,0x0000, - 0x0000,0x4066,0x0000,0x4F39,0x6978,0xDBAE,0x6979,0x0000, - 0x0000,0x0000,0x0000,0x6A21,0x0000,0x3F2A,0x0000,0x697B, - 0xDBAF,0x697E,0x0000,0x0000,0x0000,0xDBB0,0x0000,0x6976, - 0x6975,0xDBB1,0x0000,0x6A22,0xDBB2,0xDBB3,0x325C,0x0000, - 0x697C,0x0000,0x6A23,0x0000,0x0000,0x0000,0x697D,0xDBB4, - 0x0000,0xDBB5,0xDBB6,0x0000,0x697A,0x0000,0x4433,0x0000, - 0x6977,0x0000,0x0000,0xDBB7,0x0000,0x0000,0x0000,0x4768, - 0x0000,0x0000,0x6A27,0xDBB8,0xDBB9,0xDBBA,0xDBBB,0xDBBC, - 0xDBBD,0xDBBE,0x0000,0xDBBF,0xDBC0,0x4D3B,0x0000,0x0000, - 0xDBC1,0x0000,0x0000,0xDBC2,0x0000,0xDBC3,0x0000,0xDBC4, - 0xDBC5,0xDBC6,0x0000,0x0000,0x0000,0x0000,0xDBC7,0x6A26, - 0xDBC8,0x0000,0x6A25,0xDBC9,0x0000,0x0000,0x0000,0xDBCA, - 0x0000,0x0000,0x0000,0x6A2E,0xDBCB,0xDBCC,0xDBCD,0x6A28, - 0x0000,0xDBCE,0x0000,0x6A30,0x0000,0xDBCF,0x0000,0x0000, - 0x0000,0x0000,0x4D66,0x6A33,0x0000,0x6A2A,0xDBD0,0xDBD1, - 0x6A2B,0xDBD2,0x0000,0x0000,0x6A2F,0x0000,0x6A32,0x6A31, - 0xDBD3,0xDBD4,0xDBD5,0x6A29,0x0000,0x0000,0xDBD6,0x0000, - 0x6A2C,0x0000,0x6A3D,0x0000,0x0000,0xDBD7,0xDBD8,0x0000, - 0x0000,0xDBD9,0xDBDA,0x0000,0xDBDB,0x0000,0x0000,0xDBDC, - 0x6A36,0x0000,0xDBDD,0xDBDE,0xDBDF,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xDBE0,0xDBE1,0x0000,0xDBE2,0x0000,0x6A34, - 0x0000,0xDBE3,0x6A35,0xDBE4,0x0000,0x0000,0x6A3A,0x6A3B, - 0xDBE5,0x332A,0xDBE6,0x3542,0x0000,0x0000,0x6A39,0xDBE7, - - /* 8800h */ - 0x0000,0xDBE8,0x0000,0xDBE9,0x0000,0x6A24,0xDBEA,0x0000, - 0x0000,0xDBEB,0xDBEC,0xDBED,0x0000,0x6A38,0x6A3C,0x6A37, - 0xDBEE,0x6A3E,0xDBF0,0xDBF1,0xDBF2,0x6A40,0x6A3F,0x0000, - 0xDBF3,0xDBEF,0xDBF4,0xDBF5,0xDBF6,0x0000,0xDBF7,0xDBF8, - 0x0000,0x6A42,0x6A41,0x695A,0x0000,0x0000,0x0000,0x6A46, - 0xDBF9,0x0000,0x0000,0x0000,0x0000,0xDBFA,0xDBFB,0x0000, - 0xDBFC,0x6A43,0xDBFD,0x0000,0x0000,0xDBFE,0x6A44,0x0000, - 0x0000,0x6A45,0xDCA1,0x6A47,0xDCA2,0x0000,0x0000,0x0000, - 0x376C,0xDCA3,0x6A49,0xDCA4,0x6A48,0xDCA5,0x3D30,0x0000, - 0xDCA6,0xDCA7,0xDCA8,0xDCA9,0x3954,0x5E27,0xDCAA,0x0000, - 0x0000,0xDCAB,0x6A4A,0x3D51,0x0000,0xDCAC,0xDCAD,0x3339, - 0xDCAE,0x6A4B,0xDCAF,0x3152,0xDCB0,0x3E57,0x6A4C,0xDCB1, - 0xDCB2,0x3955,0x6A4D,0x3061,0xDCB3,0x0000,0x0000,0x0000, - 0x493D,0xDCB4,0x0000,0x6A4E,0x0000,0x0000,0x0000,0x0000, - 0x3F6A,0xDCB5,0x6A55,0x0000,0x0000,0x6A52,0x0000,0x436F, - 0x0000,0xDCB6,0x0000,0xDCB7,0x0000,0x6A53,0x6A50,0x365E, - 0xDCB8,0x6A4F,0x6A56,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x3736,0x0000,0x0000,0x425E,0x0000,0x6A5C,0x0000,0x0000, - 0x0000,0x0000,0x6A58,0x0000,0x0000,0x0000,0x4235,0x6A57, - 0xDCB9,0x6A5A,0xDCBA,0xDCBB,0xDCBC,0x0000,0x6A51,0xDCBD, - 0xDCBE,0x0000,0x6A5B,0x0000,0x6A5D,0x0000,0x0000,0x0000, - 0xDCBF,0x0000,0xDCC0,0x486F,0x0000,0x0000,0x6A59,0x0000, - 0x6A5E,0x6A60,0x0000,0x0000,0x3853,0x6A54,0x0000,0x3041, - 0x0000,0x0000,0xDCC1,0x0000,0x0000,0xDCC2,0xDCC3,0x6A5F, - 0xDCC4,0x3A5B,0x4E76,0x6A61,0x6A62,0x4175,0x0000,0x0000, - 0x0000,0x0000,0xDCC5,0xDCC6,0xDCC7,0xDCC8,0xDCC9,0x4E22, - 0x0000,0xDCCA,0xDCCB,0xDCCC,0x6A63,0x4D35,0x0000,0x0000, - 0x6A64,0x6A65,0x0000,0xDCCD,0x4A64,0x6A66,0xDCCE,0x3A40, - 0x0000,0x4E23,0x0000,0x0000,0x0000,0x0000,0x0000,0xDCCF, - 0x6A6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xDCD0, - 0xDCD1,0xDCD2,0x6A6C,0x3E58,0x6A6A,0xDCD3,0x0000,0xDCD4, - 0x4D67,0x6A67,0x0000,0x0000,0x6A69,0x403D,0x3F7E,0x0000, - - /* 8900h */ - 0x0000,0xDCD5,0x6A68,0x0000,0x6A6D,0x0000,0xDCD6,0x4A23, - 0x0000,0x0000,0x6A6F,0x0000,0x6A6E,0xDCD7,0xDCD8,0xDCD9, - 0x336C,0x0000,0x4B2B,0x6A70,0x0000,0xDCDA,0xDCDB,0x0000, - 0xDCDC,0xDCDD,0xDCDE,0x0000,0xDCDF,0x6A7C,0x6A72,0x0000, - 0xDCE0,0x0000,0x0000,0x0000,0x0000,0x6A73,0xDCE1,0xDCE2, - 0xDCE3,0x0000,0x6A74,0x6A75,0x0000,0x0000,0x0000,0x0000, - 0xDCE4,0xDCE5,0xDCE6,0x0000,0x0000,0xDCE7,0x6A79,0x0000, - 0x6A7A,0xDCE8,0xDCE9,0x6A78,0x0000,0x0000,0xDCEA,0x0000, - 0xDCEB,0x6A76,0xDCEC,0x6A71,0x6A77,0xDCED,0xDCEE,0x0000, - 0x0000,0xDCEF,0x0000,0x0000,0x6A7B,0x7037,0x0000,0xDCF0, - 0x0000,0x0000,0xDCF1,0x0000,0x0000,0x0000,0x3228,0xDCF2, - 0x0000,0x0000,0xDCF3,0xDCF4,0xDCF5,0x0000,0x6A7E,0x365F, - 0x6A7D,0xDCF6,0xDCF7,0xDCF8,0x6B22,0x0000,0x6B21,0x0000, - 0x0000,0x0000,0x6B24,0xDCF9,0x0000,0x6B23,0xDCFA,0x6B25, - 0xDCFB,0x0000,0x3D31,0xDCFC,0x6B26,0xDCFD,0x0000,0x6B27, - 0x0000,0x0000,0xDCFE,0xDDA1,0xDDA2,0xDDA3,0x6B28,0x403E, - 0x0000,0x4D57,0x0000,0x6B29,0x0000,0x0000,0x4A24,0x4746, - 0x6B2A,0xDDA4,0x6B2B,0x382B,0x0000,0xDDA5,0x0000,0x352C, - 0xDDA6,0x0000,0x0000,0x6B2C,0xDDA7,0xDDA8,0x3B6B,0x4741, - 0x6B2D,0x0000,0x3350,0xDDA9,0xDDAA,0x0000,0x0000,0xDDAB, - 0xDDAC,0x6B2E,0x0000,0x0000,0x0000,0xDDAD,0x6B30,0x4D77, - 0x0000,0x6B2F,0x3F46,0x0000,0x6B31,0x0000,0x0000,0x6B32, - 0xDDAE,0x0000,0x6B33,0x3451,0xDDAF,0xDDB0,0xDDB1,0xDDB2, - 0x0000,0x0000,0x6B34,0x0000,0xDDB3,0x6B35,0x0000,0x6B36, - 0x6B37,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x3351,0x0000,0xDDB4,0xDDB5,0xDDB6,0xDDB7, - 0xDDB8,0x0000,0x6B38,0x0000,0x6B39,0x6B3A,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3272,0x0000,0xDDB9,0x3F28,0x6B3B, - 0x0000,0xDDBA,0x0000,0xDDBB,0x0000,0xDDBC,0x0000,0x0000, - 0x0000,0xDDBD,0x0000,0xDDBE,0x6B3C,0x0000,0xDDBF,0x0000, - 0x6B3D,0xDDC0,0x0000,0x0000,0x0000,0xDDC1,0x0000,0xDDC2, - - /* 8A00h */ - 0x3840,0x0000,0x447B,0x6B3E,0xDDC3,0xDDC4,0x0000,0xDDC5, - 0x3757,0x0000,0x3F56,0x0000,0x6B41,0x0000,0x4624,0xDDC6, - 0x6B40,0xDDC7,0xDDC8,0x3731,0xDDC9,0xDDCA,0x6B3F,0x4277, - 0x352D,0x0000,0x0000,0x6B42,0x0000,0x6B43,0xDDCB,0x3E59, - 0xDDCC,0x0000,0xDDCD,0x376D,0xDDCE,0x6B44,0xDDCF,0x0000, - 0x0000,0x0000,0x4B2C,0xDDD0,0xDDD1,0x405F,0x0000,0xDDD2, - 0x0000,0x3576,0x0000,0x4C75,0x414A,0xDDD3,0x6B45,0xDDD4, - 0x0000,0x0000,0x3F47,0x4370,0x3E5A,0xDDD5,0xDDD6,0x0000, - 0xDDD7,0x6B46,0x0000,0xDDD8,0x0000,0xDDD9,0x6B49,0xDDDA, - 0x6B4A,0xDDDB,0x0000,0x0000,0x0000,0xDDDC,0xDDDD,0x0000, - 0x3A3E,0x4242,0x6B48,0xDDDE,0x3E5B,0x493E,0xDDDF,0xDDE0, - 0xDDE1,0x0000,0x0000,0x6B47,0xDDE2,0xDDE3,0x3B6C,0x0000, - 0x3153,0xDDE4,0x6B4E,0x3758,0x0000,0xDDE5,0x3B6E,0xDDE6, - 0x0000,0x3B6D,0x0000,0x4F4D,0x6B4D,0x6B4C,0x4127,0x0000, - 0x354D,0x4F43,0x333A,0x3E5C,0x0000,0xDDE7,0xDDE8,0xDDE9, - 0x0000,0xDDEA,0xDDEB,0xDDEC,0x6B4B,0x0000,0xDDED,0xDDEE, - 0xDDEF,0x0000,0x6B50,0xDDF0,0x6B51,0x6B4F,0xDDF1,0x3858, - 0x0000,0x4D40,0x0000,0xDDF2,0x3B6F,0x4727,0x0000,0xDDF3, - 0xDDF4,0x6B54,0xDDF5,0x4040,0x0000,0x4342,0xDDF6,0xDDF7, - 0x4D36,0xDDF8,0x6B57,0x0000,0x0000,0x0000,0x386C,0xDDF9, - 0x403F,0x6B53,0x0000,0x6B58,0x386D,0x6B55,0x6B56,0xDDFA, - 0x6B52,0xDDFB,0x0000,0x0000,0x4062,0x4649,0xDDFC,0xDDFD, - 0x432F,0x0000,0x325D,0xDDFE,0x0000,0x0000,0xDEA1,0xDEA2, - 0x0000,0x4870,0x0000,0xDEA3,0x3543,0x0000,0xDEA4,0x4434, - 0x0000,0x0000,0x6B5B,0xDEA5,0x6B59,0x0000,0xDEA6,0x434C, - 0xDEA7,0xDEA8,0xDEA9,0x4041,0x3452,0x6B5A,0x0000,0x3F5B, - 0x0000,0xDEAA,0x4E4A,0xDEAB,0xDEAC,0xDEAD,0x4F40,0xDEAE, - 0x0000,0x0000,0x6B5C,0x6B67,0x4435,0xDEAF,0x6B66,0xDEB0, - 0x6B63,0x6B6B,0x6B64,0x0000,0x6B60,0x0000,0x447C,0x6B5F, - 0x0000,0x0000,0x0000,0x6B5D,0xDEB1,0x4D21,0x3B70,0x0000, - 0xDEB2,0x6B61,0x0000,0x6B5E,0xDEB3,0xDEB4,0xDEB5,0x6B65, - 0x3D74,0x0000,0x3841,0x0000,0xDEB6,0x0000,0x427A,0xDEB7, - - /* 8B00h */ - 0x4B45,0x315A,0x3062,0x0000,0x4625,0xDEB8,0xDEB9,0x6B69, - 0x0000,0x0000,0xDEBF,0xDEBA,0x6B68,0x0000,0x4666,0x0000, - 0x6B6D,0xDEBB,0x0000,0x0000,0x6B62,0x0000,0x6B6C,0x6B6E, - 0x0000,0x382C,0x6B6A,0x3956,0xDEBC,0x3C55,0xDEBD,0xDEBE, - 0x6B6F,0x4D58,0x0000,0x0000,0x0000,0x0000,0x6B72,0x0000, - 0x6B75,0x0000,0x0000,0x6B73,0x4935,0xDEC0,0x0000,0x0000, - 0xDEC1,0x0000,0x0000,0x6B70,0x0000,0x0000,0x0000,0xDEC2, - 0x0000,0x3660,0x0000,0x0000,0xDEC3,0x0000,0x6B74,0x0000, - 0x0000,0x6B76,0xDEC4,0xDEC5,0xDEC6,0xDEC7,0xDEC8,0x0000, - 0xDEC9,0x6B7A,0x0000,0x0000,0x6B77,0xDECE,0x6B79,0x6B78, - 0x0000,0x0000,0xDECA,0xDECB,0xDECC,0x0000,0x6B7B,0x0000, - 0x3C31,0xDECD,0x6B7D,0x6B7C,0x4968,0x0000,0xDECF,0x6C21, - 0x0000,0x0000,0x0000,0xDED0,0x0000,0x0000,0x3759,0x0000, - 0x0000,0x0000,0x0000,0x6B7E,0x6C22,0xDED1,0x0000,0x6C23, - 0x3544,0x6641,0x3E79,0x0000,0x6C24,0x0000,0xDED2,0x386E, - 0xDED3,0xDED4,0x0000,0x0000,0xDED5,0x6C25,0xDED6,0x0000, - 0x6C26,0xDED7,0x0000,0x3B3E,0xDED8,0xDED9,0x0000,0x0000, - 0x0000,0x0000,0x5A4E,0xDEDA,0x6C27,0xDEDB,0x6C28,0xDEDC, - 0x3D32,0x0000,0x6C29,0x6C2A,0xDEDD,0xDEDE,0x6C2B,0x0000, - 0x0000,0x6C2C,0x6C2D,0x0000,0xDEDF,0x0000,0xDEE0,0xDEE1, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 8C00h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x432B, - 0xDEE2,0xDEE3,0x6C2E,0x0000,0x0000,0xDEE4,0xDEE5,0x6C30, - 0x0000,0x6C2F,0x0000,0x0000,0x0000,0xDEE6,0x4626,0xDEE7, - 0x6C31,0xDEE8,0x4B2D,0xDEE9,0x6C32,0x0000,0x6C33,0xDEEA, - 0x6C34,0xDEEB,0x0000,0xDEEC,0xDEED,0x6C35,0x0000,0xDEEE, - 0xDEEF,0xDEF2,0x465A,0xDEF0,0x0000,0xDEF1,0x0000,0x0000, - 0x0000,0x3E5D,0x6C36,0xDEF3,0xDEF4,0x0000,0xDEF5,0x0000, - 0xDEF6,0xDEF7,0x396B,0x502E,0x6C37,0xDEF8,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xDEF9,0x0000,0xDEFA,0xDEFB,0x0000, - 0x6C38,0x493F,0x6C39,0xDEFC,0x6C41,0x0000,0xDEFD,0x0000, - 0x0000,0x0000,0x6C3A,0x0000,0x0000,0x6C3C,0xDEFE,0xDFA1, - 0x0000,0x6C3B,0x6C3D,0xDFA2,0x4B46,0x6C3E,0x6C3F,0x0000, - 0xDFA3,0x0000,0xDFA4,0xDFA5,0x6C40,0x0000,0x0000,0x0000, - 0x6C42,0xDFA6,0x0000,0xDFA7,0xDFA8,0x332D,0x4467,0x0000, - 0x4969,0x3A62,0x3957,0x0000,0xDFA9,0x0000,0x0000,0x494F, - 0x325F,0x484E,0x6C45,0x3453,0x4055,0x6C44,0x6C49,0x4379, - 0x4C63,0x0000,0x6C47,0x6C48,0x352E,0x0000,0x6C4A,0x4763, - 0x425F,0xDFAA,0xDFAB,0x4871,0x453D,0x6C46,0x0000,0x4B47, - 0x326C,0x6C4C,0x4F28,0x4442,0x4F45,0xDFAC,0xDFAD,0x3B71, - 0x6C4B,0xDFAE,0x4231,0xDFAF,0x0000,0x6C5C,0x4128,0xDFB0, - 0x0000,0x4678,0x0000,0x4950,0x0000,0xDFB2,0xDFB1,0x0000, - 0x0000,0xDFB3,0x6C4F,0x3B3F,0x3B72,0xDFB4,0x3E5E,0x0000, - 0x4765,0xDFB5,0x382D,0x6C4E,0x6C4D,0x0000,0x496A,0x0000, - 0xDFB6,0x0000,0x3C41,0x0000,0xDFB7,0x4552,0x0000,0xDFB8, - 0xDFB9,0x0000,0xDFBA,0x0000,0x0000,0xDFBB,0x0000,0xDFBC, - 0xDFBD,0x0000,0x6C51,0x6C52,0x3958,0x6C50,0xDFBE,0xDFBF, - - /* 8D00h */ - 0x0000,0xDFC0,0x0000,0xDFC1,0x6C53,0x6C54,0x0000,0x6C56, - 0x4223,0xDFC2,0x6C55,0x3466,0x0000,0x6C58,0x0000,0x6C57, - 0x6C59,0x0000,0xDFC3,0x6C5B,0x6C5D,0x0000,0x6C5E,0xDFC4, - 0x0000,0x0000,0x0000,0xDFC5,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x4056,0xDFC6,0x3C4F,0x6C5F, - 0x0000,0xDFC7,0x0000,0x3352,0xDFC8,0x6C60,0xDFC9,0x0000, - 0x4176,0x6C61,0x0000,0x6C62,0x496B,0x0000,0x0000,0x352F, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xDFCA, - 0x0000,0x6C63,0xDFCB,0x0000,0xDFCC,0x4436,0x0000,0x0000, - 0xDFCD,0x0000,0x315B,0x0000,0x0000,0xDFCE,0x0000,0x0000, - 0xDFCF,0xDFD0,0x0000,0x0000,0x0000,0xDFD1,0x0000,0x0000, - 0x0000,0x6C64,0x0000,0x0000,0x0000,0x0000,0xDFD2,0xDFD3, - 0xDFD4,0x0000,0x0000,0x3C71,0x0000,0x0000,0xDFD5,0x0000, - 0x3F76,0x0000,0x0000,0xDFD6,0xDFD7,0x0000,0x0000,0xDFD8, - 0x0000,0x0000,0xDFD9,0x422D,0x0000,0xDFDA,0x0000,0xDFDB, - 0x0000,0xDFDC,0x6C67,0xDFDD,0xDFEF,0x0000,0x6C66,0x0000, - 0xDFDE,0x0000,0x6C65,0x0000,0x0000,0xDFDF,0xDFE0,0xDFE1, - 0xDFE2,0x0000,0xDFE3,0x6C6D,0x6C6B,0x0000,0xDFE4,0x6C68, - 0x0000,0xDFE5,0x0000,0x0000,0xDFE6,0xDFE7,0x6C6A,0xDFE8, - 0x0000,0xDFE9,0x6C69,0x6C6C,0x0000,0x3577,0x0000,0x6C70, - 0x0000,0x4057,0x0000,0x6C71,0xDFEA,0xDFEB,0x0000,0xDFEC, - 0x3859,0x0000,0x6C6E,0x6C6F,0xDFED,0x0000,0x0000,0x4F29, - 0xDFEE,0xDFF0,0xDFF1,0x4437,0xDFF2,0x4129,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x6C72,0xDFF3,0x0000,0x6C75, - - /* 8E00h */ - 0x0000,0xDFF4,0x0000,0x0000,0xDFF5,0xDFF6,0xDFF7,0x0000, - 0x6C73,0x6C74,0x4D59,0xDFF8,0x0000,0x0000,0x0000,0x4627, - 0x6C78,0xDFF9,0x0000,0x0000,0xDFFA,0x0000,0xDFFB,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x6C76,0x6C77,0x6C79, - 0xDFFC,0xDFFD,0xDFFE,0xE0A1,0x0000,0x0000,0xE0A2,0xE0A3, - 0x0000,0x0000,0x6D29,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x6C7C,0xE0A4,0x0000,0xE0A5,0x6C7D,0x6C7B,0xE0A6,0xE0A7, - 0xE0A8,0xE0A9,0x0000,0x0000,0x0000,0xE0AA,0x0000,0x0000, - 0xE0AB,0xE0AC,0x6C7A,0x0000,0x447D,0x0000,0x0000,0x6D21, - 0x6D25,0x6D22,0x6C7E,0xE0AD,0x6D23,0xE0AE,0xE0AF,0xE0B0, - 0x6D24,0x0000,0x0000,0x0000,0xE0B1,0x6D2B,0x0000,0x0000, - 0x0000,0x6D26,0x0000,0xE0B2,0xE0B3,0xE0B4,0xE0B5,0x4058, - 0x6D28,0xE0B6,0xE0B7,0x6D2A,0x6D27,0x0000,0x0000,0x0000, - 0x0000,0xE0B8,0x0000,0x0000,0xE0B9,0xE0BA,0x0000,0xE0BB, - 0xE0BC,0xE0BD,0x6D2D,0x0000,0x3D33,0x0000,0x6D2C,0x0000, - 0x0000,0xE0BE,0xE0BF,0xE0C0,0x6D2E,0x0000,0x0000,0x0000, - 0x0000,0x6D2F,0xE0C1,0xE0C2,0x6D32,0x6D31,0x0000,0x6D30, - 0x0000,0xE0C3,0x6D34,0x6D33,0x0000,0x4C76,0x0000,0x0000, - 0xE0C4,0x6D36,0xE0C5,0x6D35,0x6D37,0xE0C6,0x0000,0x0000, - 0x0000,0x6D38,0xE0C7,0xE0C8,0x0000,0xE0C9,0xE0CA,0x0000, - 0x0000,0x6D3A,0xE0CB,0x0000,0x0000,0x0000,0x0000,0xE0CC, - 0x0000,0xE0CD,0x6D39,0x3F48,0x6D3B,0xE0CE,0xE0CF,0x366D, - 0x6D3C,0x6D3E,0x0000,0xE0D0,0x0000,0xE0D1,0x0000,0x0000, - 0x0000,0x0000,0xE0D2,0xE0D3,0x0000,0x0000,0x6D3F,0x0000, - 0xE0D4,0xE0D5,0x0000,0xE0D6,0xE0D7,0x6D40,0x6D3D,0xE0D8, - 0x6D41,0x0000,0x3C56,0x6D42,0x3530,0x3733,0x0000,0xE0D9, - 0x0000,0xE0DA,0x382E,0x0000,0xE0DB,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x6D43,0xE0DC,0x0000,0x0000,0x4670, - 0x0000,0x0000,0x453E,0x6D44,0x0000,0x0000,0x0000,0x0000, - 0xE0DD,0x0000,0x0000,0x6D47,0x0000,0xE0E4,0xE0DE,0x0000, - 0xE0DF,0xE0E0,0x0000,0x0000,0x0000,0x0000,0x0000,0xE0E1, - 0x3C34,0xE0E2,0xE0E3,0x6D46,0x6D45,0x375A,0x6D48,0x0000, - - /* 8F00h */ - 0xE0E5,0x0000,0xE0E6,0x3353,0x0000,0x6D4A,0x0000,0xE0E7, - 0xE0E8,0x3A5C,0x6D49,0x0000,0x6D52,0x0000,0x0000,0xE0E9, - 0xE0EA,0x0000,0x6D4C,0x6D4E,0x4A65,0x6D4B,0xE0EB,0xE0EC, - 0xE0ED,0x6D4D,0x0000,0x6D51,0x6D4F,0x3531,0xE0EE,0x6D50, - 0xE0EF,0xE0F0,0x0000,0xE0F1,0x0000,0xE0F2,0x6D53,0xE0F3, - 0xE0F4,0x475A,0x4E58,0x0000,0xE0F5,0xE0F6,0xE0F7,0x3D34, - 0x0000,0x0000,0x0000,0x6D54,0xE0F8,0xE0F9,0xE0FA,0xE0FB, - 0x4D22,0x6D56,0xE0FC,0x6D55,0x0000,0x0000,0x6D59,0x4D41, - 0xE0FD,0xE0FE,0x6D58,0xE1A1,0x336D,0x6D57,0x6D5C,0xE1A2, - 0x0000,0x6D5B,0x0000,0x0000,0x6D5A,0x4532,0x6D5D,0xE1A3, - 0x0000,0xE1A4,0xE1A5,0xE1A6,0xE1A7,0xE1A8,0x0000,0x6D5E, - 0xE1A9,0x0000,0x0000,0x0000,0x6D5F,0xE1AA,0xE1AB,0x396C, - 0x0000,0x3725,0x6D60,0x6D61,0x6D62,0xE1AC,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x3F49,0x6D63,0xE1AD,0x3C2D,0x6D64, - 0xE1AE,0xE1AF,0x0000,0x6D65,0xE1B0,0xE1B1,0xE1B2,0x5221, - 0x517E,0x0000,0x0000,0x0000,0x0000,0x6D66,0x6570,0x6D67, - 0x4324,0x3F2B,0x4740,0x0000,0x0000,0xE1B3,0xE1B4,0x6D68, - 0xE1B5,0x0000,0x4A55,0x4454,0x397E,0x0000,0xE1B6,0x4329, - 0xE1B7,0xE1B8,0x312A,0x0000,0x4B78,0x3F57,0xE1B9,0x0000, - 0x0000,0x0000,0xE1BA,0xE1BB,0x0000,0xE1BC,0x375E,0x0000, - 0xE1BD,0x3661,0xE1BE,0xE1BF,0x4A56,0xE1C0,0x0000,0x0000, - 0x0000,0x0000,0x6D69,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xE1C1,0x0000,0x6D6B,0xE1C2,0xE1C3,0x6D6A,0x3260,0x0000, - 0xE1C4,0x4676,0x6D6C,0x4777,0x0000,0x4533,0xE1C5,0x6D6D, - 0x3D52,0xE1C6,0x0000,0x0000,0x6D6F,0xE1C7,0xE1C8,0x4C42, - 0x6D7E,0x6D71,0x6D72,0xE1C9,0x0000,0x4449,0xE1CA,0x0000, - - /* 9000h */ - 0x4260,0x4177,0xE1CB,0x4628,0xE1CC,0x6D70,0x3555,0x0000, - 0xE1CD,0x0000,0x0000,0x6D79,0xE1CE,0x6D76,0x6E25,0x4629, - 0x4360,0x6D73,0x0000,0x447E,0x4553,0x6D74,0x6D78,0x3F60, - 0xE1CF,0x4767,0x444C,0xE1D0,0x0000,0x4042,0x6D77,0x422E, - 0x4224,0x6D75,0x3029,0x4F22,0x0000,0x0000,0x0000,0x6D7A, - 0xE1D1,0xE1D2,0xE1D4,0x0000,0xE1D5,0xE1D6,0x4261,0xE1D3, - 0x0000,0x3D35,0x3F4A,0xE1D7,0xE1D8,0x6D7C,0x6D7B,0xE1D9, - 0x306F,0x6D7D,0x0000,0x0000,0x492F,0x0000,0x6E27,0xE1DA, - 0x0000,0x465B,0x3F6B,0xE1DB,0xE1DC,0x4359,0x0000,0x3678, - 0x0000,0x6E26,0x4D37,0x313F,0xE1DD,0x4A57,0x3261,0x6E21, - 0x6E22,0x6E23,0x6E24,0x463B,0x4323,0x3063,0x6E28,0x0000, - 0x6E29,0x7423,0x0000,0xE1DE,0x423D,0xE1DF,0x6E2A,0x0000, - 0x3173,0x414C,0xE1E0,0x382F,0x0000,0x4D5A,0xE1E1,0xE1E2, - 0x6E2B,0x452C,0x0000,0x0000,0xE1E3,0x4178,0x3C57,0x6E2C, - 0xE1E4,0x0000,0x6E2F,0x0000,0xE1E5,0x3D65,0x6E2D,0x412B, - 0x412A,0xE1E6,0x3064,0x0000,0x4E4B,0x6E31,0x0000,0x4872, - 0x6E33,0x6E32,0x6E30,0x6364,0x3454,0xE1E7,0x0000,0x6D6E, - 0xE1E8,0x6E35,0x6E34,0xE1E9,0xE1EA,0x0000,0xE1EB,0x6E36, - 0xE1EC,0x4D38,0x0000,0x0000,0x0000,0xE1ED,0x0000,0xE1EE, - 0xE1EF,0xE1F0,0x0000,0xE1F1,0x0000,0x0000,0x0000,0x0000, - 0xE1F2,0xE1F3,0xE1F4,0x4661,0x0000,0xE1F5,0x4B2E,0x0000, - 0x6E37,0x0000,0x3C59,0x0000,0x0000,0x0000,0x0000,0x6E38, - 0xE1F6,0x6E39,0xE1F7,0xE1F8,0xE1F9,0x6E3A,0xE1FA,0x0000, - 0x4521,0x0000,0x0000,0x0000,0x0000,0xE1FB,0xE1FD,0x0000, - 0x0000,0x306A,0x0000,0xE1FE,0xE2A1,0xE2A2,0x0000,0xE2A3, - 0xE2A4,0x0000,0x3959,0x0000,0xE1FC,0x0000,0x4F3A,0x0000, - 0x0000,0x0000,0xE2AD,0x0000,0x0000,0xE2A5,0x0000,0xE2A6, - 0xE2A7,0xE2A8,0x0000,0x6E3E,0xE2A9,0xE2AA,0x0000,0xE2AB, - 0x0000,0x3734,0x6E3B,0x0000,0x6E3C,0xE2AC,0x0000,0x0000, - 0x4974,0x0000,0x0000,0xE2AF,0x0000,0x3354,0x0000,0xE2B0, - 0xE2B1,0x0000,0x0000,0x0000,0xE2B2,0x4D39,0xE2AE,0x363F, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x4554,0xE2B3,0xE2B4, - - /* 9100h */ - 0xE2B5,0x0000,0x6E3F,0x0000,0xE2B6,0xE2B7,0xE2B8,0x0000, - 0xE2B9,0x0000,0x0000,0x0000,0x0000,0xE2BA,0x0000,0x0000, - 0xE2BB,0x0000,0x6E40,0x0000,0xE2BC,0x0000,0xE2BD,0xE2BE, - 0xE2BF,0x6E41,0xE2C0,0x0000,0xE2C1,0x0000,0xE2C2,0x0000, - 0xE2C3,0x0000,0xE2C5,0xE2C6,0x0000,0xE2C4,0x0000,0xE2C7, - 0x0000,0xE2C8,0x0000,0x0000,0x0000,0x4522,0xE2C9,0xE2CA, - 0x6E43,0xE2CB,0x6E42,0x0000,0xE2CC,0x0000,0xE2CD,0xE2CE, - 0x0000,0xE2CF,0xE2D0,0x0000,0xE2D1,0xE2D2,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xE2D3,0x0000,0x0000,0x0000,0xE2D4, - 0xE2D5,0x4653,0x6E44,0x3D36,0x3C60,0x475B,0x4371,0xE2D6, - 0x0000,0x0000,0x3C72,0xE2D7,0x3F6C,0x0000,0x6E45,0xE2D8, - 0x6E46,0xE2D9,0xE2DA,0xE2DB,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xE2DC,0x3F5D,0x6E47,0xE2DD,0x6E48,0x0000,0xE2DE, - 0x0000,0x6E49,0x4D6F,0x0000,0x3D37,0xE2DF,0x0000,0x0000, - 0x0000,0x0000,0x6E4B,0x6E4A,0xE2E0,0x395A,0x0000,0x3973, - 0x3B40,0xE2E1,0xE2E2,0xE2E3,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xE2E4,0x6E4E,0xE2E5,0x0000,0xE2E6,0xE2E7,0x3D66, - 0x0000,0x6E4D,0xE2E8,0x6E4C,0x0000,0x4269,0xE2E9,0x0000, - 0x386F,0xE2EA,0x4043,0xE2EB,0xE2EC,0xE2ED,0x0000,0x4830, - 0xE2EE,0x0000,0x0000,0x0000,0x3D39,0x0000,0xE2EF,0x0000, - 0x0000,0xE2F0,0x6E4F,0x0000,0x3E5F,0x0000,0xE2F1,0x0000, - 0xE2F2,0x0000,0x6E52,0x6E50,0xE2F3,0xE2F4,0xE2F5,0x6E51, - 0xE2F6,0xE2F7,0xE2F8,0xE2F9,0x6E54,0x6E53,0xE2FA,0x0000, - 0x3E7A,0x0000,0x6E55,0xE2FB,0xE2FC,0xE2FD,0x0000,0xE2FE, - 0x6E56,0x6E57,0xE3A1,0xE3A2,0x0000,0xE3A3,0x4850,0x3A53, - 0x3C61,0x6E58,0x0000,0x6E59,0x4E24,0x3D45,0x4C6E,0x4E4C, - 0x6E5A,0x3662,0x0000,0xE3A4,0xE3A5,0x0000,0x6E5B,0xE3A6, - 0x4523,0xE3A7,0xE3A8,0x6E5E,0x3378,0x3F4B,0xE3A9,0x6E5C, - 0x0000,0x6E5D,0x0000,0x4460,0xE3AA,0xE3AB,0x4B55,0x367C, - 0x0000,0xE3AC,0xE3AD,0x0000,0xE3AE,0xE3AF,0xE3B0,0xE3B1, - 0xE3B2,0xE3B3,0x0000,0x0000,0x0000,0x6E60,0x6E61,0xE3B4, - 0x0000,0xE3B5,0x0000,0xE3B6,0x6E5F,0xE3B7,0x0000,0x6E63, - - /* 9200h */ - 0xE3B8,0xE3B9,0x0000,0x0000,0xE3BA,0xE3BB,0xE3BC,0xE3BD, - 0x0000,0xE3BE,0xE3BF,0x0000,0xE3C0,0x465F,0x3343,0x0000, - 0xE3C1,0x6E67,0xE3C2,0xE3C3,0x6E64,0x6E66,0xE3C4,0x0000, - 0xE3C5,0x0000,0x0000,0x0000,0xE3C6,0xE3C7,0x6E62,0x0000, - 0x0000,0x0000,0x0000,0xE3C8,0xE3C9,0xE3CA,0xE3CB,0x0000, - 0xE3CC,0x6F4F,0x0000,0x0000,0x6E65,0x0000,0xE3CD,0xE3CE, - 0xE3CF,0x0000,0x0000,0xE3D0,0x4E6B,0xE3D1,0xE3D2,0x385A, - 0xE3D3,0xE3D4,0xE3D5,0x0000,0xE3D6,0x0000,0xE3D7,0x6E6F, - 0xE3D8,0x0000,0xE3D9,0xE3DA,0x4534,0x6E6A,0xE3DB,0xE3DC, - 0x6E6D,0x6E6B,0xE3DD,0x6E70,0x0000,0xE3DE,0xE3DF,0xE3E0, - 0x6E71,0xE3E1,0x0000,0x0000,0x0000,0x0000,0x0000,0x6E69, - 0xE3E2,0xE3E3,0x6E76,0x3174,0xE3E4,0xE3E5,0x6E68,0x0000, - 0xE3E6,0xE3E7,0x482D,0x0000,0x6E6C,0xE3E8,0x3E60,0xE3E9, - 0xE3EA,0xE3EB,0x0000,0x0000,0x0000,0x0000,0xE3EC,0xE3ED, - 0xE3EE,0x395B,0x0000,0x0000,0x0000,0xE3EF,0xE3F0,0xE3F1, - 0xE3F2,0xE3F3,0x0000,0xE3F4,0xE3F5,0xE3F6,0x4B48,0xE3F7, - 0x3664,0x0000,0x0000,0x3D46,0x0000,0x463C,0x0000,0x0000, - 0xE3F8,0xE3F9,0xE3FA,0x0000,0x0000,0xE3FB,0xE3FC,0x0000, - 0x0000,0x412D,0xE3FD,0x6E74,0x0000,0x6E6E,0x6E73,0xE3FE, - 0x4C43,0xE4A1,0x4438,0x6E75,0x6E72,0x0000,0x0000,0xE4A2, - 0xE4A3,0x0000,0x0000,0x0000,0xE4A4,0xE4A5,0x0000,0xE4A6, - 0xE4A7,0x0000,0x0000,0xE4A8,0x0000,0x412C,0x0000,0xE4A9, - 0x0000,0x0000,0xE4AA,0x0000,0x0000,0x0000,0xE4AB,0x6E79, - 0xE4AC,0x6E78,0xE4AD,0xE4AE,0xE4AF,0xE4B0,0x0000,0xE4B1, - 0xE4B2,0xE4B3,0xE4B4,0xE4B5,0x0000,0xE4B6,0xE4B7,0xE4B8, - 0xE4B9,0x0000,0x0000,0xE4BA,0xE4BB,0xE4BC,0xE4BD,0x6E77, - 0xE4BE,0x0000,0x4B2F,0xE4BF,0x0000,0xE4C0,0x0000,0xE4C1, - 0xE4C2,0xE4C3,0x0000,0x0000,0xE4C4,0xE4C5,0x0000,0xE4C6, - 0xE4C7,0xE4C8,0x0000,0xE4C9,0x3D7B,0xE4CA,0x0000,0xE4CB, - 0xE4CC,0x6E7A,0x4A5F,0x0000,0xE4CD,0x3154,0xE4CE,0x0000, - 0xE4CF,0x0000,0x4946,0x4372,0x0000,0x0000,0x0000,0x0000, - 0x3578,0xE4D0,0x6E7C,0xE4D1,0x395D,0x0000,0x0000,0xE4D2, - - /* 9300h */ - 0xE4D3,0x0000,0xE4D4,0x0000,0x0000,0x0000,0x3B2C,0x0000, - 0xE4D5,0x0000,0x0000,0x0000,0x0000,0xE4D6,0x0000,0x6E7B, - 0x3F6D,0xE4D7,0x0000,0x0000,0xE4D8,0xE4D9,0x0000,0x0000, - 0x3F6E,0x6F21,0x6F23,0x0000,0xE4DA,0xE4DB,0xE4DC,0xE4DD, - 0x3E7B,0xE4DE,0x6F22,0x6F24,0xE4DF,0xE4E0,0x3653,0xE4E1, - 0x4945,0xE4E2,0xE4E3,0x3C62,0x4F23,0x0000,0x6E7E,0x3A78, - 0x0000,0x0000,0x4F3F,0xE4E4,0xE4E5,0x6F26,0xE4E6,0xE4E7, - 0x0000,0x0000,0x6F25,0x6F27,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x6E7D,0x0000,0x0000,0xE4E8, - 0xE4E9,0xE4EA,0x0000,0x4669,0x0000,0x4555,0x0000,0x0000, - 0xE4EB,0xE4EC,0xE4ED,0x0000,0x4457,0xE4EE,0x6F2C,0xE4EF, - 0xE4F0,0x0000,0xE4F1,0x4343,0x6F28,0x0000,0xE4F2,0x0000, - 0x6F29,0x0000,0x0000,0x0000,0xE4F3,0xE4F4,0x0000,0xE4F5, - 0x0000,0xE4F6,0xE4F7,0x0000,0x372D,0xE4F8,0x6F2B,0xE4F9, - 0xE4FA,0xE4FB,0x0000,0xE4FC,0xE4FD,0x3830,0xE4FE,0x0000, - 0x0000,0x0000,0xE5A1,0x0000,0x6F2A,0xE5A2,0x3E61,0xE5A3, - 0xE5A4,0xE5A5,0xE5A6,0x0000,0x0000,0x0000,0x0000,0x0000, - 0xE5A7,0x0000,0xE5A8,0xE5A9,0x3379,0xE5AA,0x0000,0xE5AB, - 0x0000,0x0000,0xE5AC,0x0000,0x6F30,0xE5AD,0x3A3F,0x4179, - 0xE5AE,0x0000,0x444A,0xE5AF,0x0000,0x0000,0xE5B0,0x0000, - 0x0000,0xE5B1,0x0000,0xE5B2,0xE5B3,0x0000,0xE5B4,0x333B, - 0xE5B5,0xE5BB,0x0000,0xE5B6,0x6F2E,0x6F2F,0x4443,0x0000, - 0x6F2D,0x0000,0x0000,0x0000,0xE5B7,0xE5B8,0xE5B9,0x0000, - 0x0000,0x6F31,0xE5BA,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xE5BC,0x0000,0x6F37,0xE5BD,0xE5BE,0xE5BF,0xE5C0, - 0x6F3A,0xE5C1,0xE5C2,0xE5C3,0xE5C4,0xE5C5,0x0000,0x0000, - 0x6F39,0x452D,0x0000,0xE5C6,0x0000,0x0000,0x6F32,0x6F33, - 0x6F36,0xE5C7,0x0000,0x0000,0xE5C8,0x6F38,0xE5C9,0xE5CA, - 0x0000,0x3640,0xE5CB,0x0000,0x6F3B,0x6F35,0xE5CC,0xE5CD, - 0x6F34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xE5CF, - 0xE5D0,0xE5CE,0xE5D1,0xE5D2,0x0000,0xE5D3,0x0000,0x0000, - - /* 9400h */ - 0x0000,0xE5D4,0xE5D5,0x6F3F,0xE5D6,0x0000,0x0000,0x6F40, - 0xE5D7,0xE5D8,0x0000,0x0000,0x0000,0xE5D9,0xE5DA,0xE5DB, - 0x6F41,0x0000,0x0000,0x6F3E,0x6F3D,0xE5DC,0xE5DD,0xE5DE, - 0x3E62,0x462A,0x6F3C,0x0000,0x0000,0x0000,0x0000,0xE5DF, - 0x0000,0x6F45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x6F43,0x0000,0x0000,0xE5E0,0xE5E1, - 0x0000,0xE5E2,0xE5E3,0xE5E4,0xE5E5,0x6F44,0x6F42,0x0000, - 0x4278,0x0000,0x6F46,0xE5E6,0x0000,0xE5E8,0x0000,0xE5E7, - 0x0000,0x6F47,0x0000,0xE5E9,0x6F49,0xE5EA,0x0000,0x0000, - 0xE5EB,0x0000,0xE5EC,0x0000,0xE5ED,0x0000,0x0000,0x0000, - 0x0000,0x3455,0x6F48,0x4C7A,0x0000,0xE5EE,0x0000,0x0000, - 0x0000,0xE5EF,0x6F54,0x6F4A,0xE5F0,0x0000,0x6F4D,0xE5F1, - 0x6F4B,0xE5F2,0x6F4C,0xE5F3,0x0000,0x0000,0x0000,0x0000, - 0xE5F4,0x0000,0x6F4E,0xE5F5,0x0000,0xE5F6,0xE5F7,0xE5F8, - 0x6F50,0xE5F9,0xE5FA,0x0000,0x0000,0x6F51,0x0000,0x6F52, - 0x0000,0x0000,0x0000,0x0000,0x6F55,0x6F53,0x6F56,0x6F58, - 0x0000,0x6F57,0x0000,0xE5FC,0xE5FB,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 9500h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x4439, - 0xE5FD,0xE5FE,0x0000,0x0000,0x0000,0x0000,0xE6A1,0x0000, - 0x4C67,0x0000,0x6F59,0x412E,0xE6A2,0x0000,0x0000,0x6F5A, - 0xE6A3,0x4A44,0x6F5B,0x332B,0xE6A4,0xE6A5,0xE6A6,0x313C, - 0x0000,0x3457,0x0000,0x3456,0x6F5C,0x0000,0x6F5D,0x0000, - 0x6F5E,0x6F5F,0x0000,0x0000,0x0000,0xE6A7,0xE6A8,0xE6A9, - 0x6F60,0xE6AA,0x3458,0x3355,0x395E,0x4836,0xE6AB,0x6F62, - 0x6F61,0xE6AC,0x0000,0xE6AD,0xE6AE,0x6F63,0x0000,0x0000, - 0x0000,0x0000,0x315C,0x0000,0xE6AF,0x0000,0xE6B0,0x0000, - 0x0000,0x6F66,0xE6B1,0x6F65,0x6F64,0xE6B2,0x6F67,0xE6B3, - 0x0000,0x0000,0x0000,0x6F6A,0x0000,0x0000,0xE6B4,0x3047, - 0xE6B5,0xE6B6,0x6F68,0xE6B7,0x6F6C,0x6F6B,0x0000,0x0000, - 0xE6B8,0xE6B9,0xE6BA,0xE6BB,0x6F6E,0x6F6D,0x6F6F,0x0000, - 0x462E,0xE6BC,0xE6BD,0x0000,0x6F70,0xE6BE,0xE6BF,0xE6C0, - 0xE6C1,0x6F71,0x6F73,0x0000,0xE6C2,0x6F72,0xE6C3,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 9600h */ - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x496C,0xE6C4,0xE6C5,0x0000, - 0x0000,0x6F74,0xE6C6,0x0000,0xE6C7,0xE6C8,0xE6C9,0x0000, - 0x6F75,0x0000,0x3A65,0x0000,0xE6CA,0x0000,0x6F76,0x6F77, - 0x0000,0xE6CB,0x4B49,0xE6CC,0x0000,0x0000,0x0000,0xE6CD, - 0xE6CE,0xE6CF,0xE6D0,0x414B,0xE6D1,0xE6D2,0x0000,0x3024, - 0x424B,0xE6D3,0x6F78,0x0000,0x496D,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x6F7B,0x6F79,0x395F,0x0000,0x6F7A, - 0x3842,0x0000,0xE6D4,0x0000,0xE6D5,0x0000,0xE6D6,0xE6D7, - 0xE6D8,0x0000,0x0000,0x4A45,0x6F7D,0x7021,0x6F7E,0x7022, - 0x0000,0xE6D9,0x3121,0x3F58,0x3D7C,0x3459,0x7023,0x0000, - 0x0000,0x0000,0x4766,0x0000,0x7025,0x0000,0xE6DA,0x0000, - 0x3122,0x0000,0x7024,0x4444,0xE6DB,0x4E4D,0x462B,0x6F7C, - 0x4E26,0x0000,0x3831,0xE6DC,0xE6DD,0x4D5B,0xE6DE,0xE6DF, - 0x0000,0xE6E0,0xE6E1,0xE6E2,0xE6E3,0x3679,0x4E34,0x0000, - 0x3728,0xE6E4,0x4262,0x6721,0x0000,0x7026,0x332C,0x3F6F, - 0x0000,0xE6E5,0x0000,0x0000,0x3356,0x7028,0xE6E6,0x7029, - 0x7027,0x3764,0xE6E7,0x3A5D,0x3E63,0xE6E8,0x0000,0xE6E9, - 0x3123,0x0000,0x0000,0x4E59,0xE6EA,0xE6EB,0xE6EC,0x702B, - 0x6E2E,0xE6ED,0x702A,0x0000,0x0000,0x0000,0xE6EE,0xE6EF, - 0x702E,0x702C,0x702D,0xE6F0,0x702F,0x0000,0x7030,0x4E6C, - 0x7031,0x7032,0xE6F1,0x4049,0x483B,0x0000,0x0000,0x0000, - 0x3F7D,0x3467,0x0000,0x0000,0x4D3A,0x326D,0x3D38,0x385B, - 0x0000,0x7035,0xE6F2,0x7034,0x3B73,0x7036,0x7033,0x0000, - 0x0000,0x3B28,0xE6F3,0x0000,0x0000,0x703A,0x6A2D,0x0000, - 0xE6F5,0x5256,0xE6F6,0x3F77,0x7038,0xE6F7,0xE6F8,0xE6F9, - 0x0000,0x0000,0x4E25,0x4671,0x0000,0x0000,0x0000,0x0000, - 0x312B,0xE6FA,0x4063,0x3C36,0x0000,0x0000,0x0000,0xE6FB, - 0x4A37,0xE6FC,0x3140,0x0000,0x0000,0x0000,0x4E6D,0x4D6B, - 0x0000,0x703B,0xE6FD,0x4545,0x0000,0x0000,0x0000,0x0000, - - /* 9700h */ - 0x3C7B,0x0000,0xE6FE,0xE7A1,0x703C,0xE7A2,0x703D,0x3F4C, - 0x703E,0xE7A3,0x4E6E,0x0000,0x0000,0x7039,0x7040,0x7042, - 0x0000,0x7041,0x0000,0x703F,0x0000,0x0000,0x7043,0x0000, - 0x0000,0x7044,0xE7A4,0xE7A5,0x417A,0xE7A6,0x3262,0x0000, - 0x0000,0xE7A7,0xE7A8,0xE7A9,0x7045,0x0000,0x0000,0x4C38, - 0xE7AA,0x0000,0x7046,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x7047,0xE7AB,0x4F2A,0xE7AC,0x0000,0x0000,0x0000,0x0000, - 0x5B31,0x7048,0x0000,0x0000,0x0000,0x7049,0x704A,0x0000, - 0x0000,0xE7AD,0x704E,0xE7AE,0x704B,0x0000,0x704C,0x0000, - 0x704D,0x704F,0xE7AF,0x0000,0x0000,0x0000,0xE7B0,0xE7B1, - 0x0000,0x0000,0x4044,0x0000,0x0000,0xE7B2,0x4C77,0xE7B3, - 0xE7B4,0x4045,0xE7B5,0xE7B6,0x7050,0x0000,0x4873,0x0000, - 0x7051,0x7353,0x4C4C,0xE7B7,0x7052,0x0000,0x7053,0xE7B8, - 0x7054,0x3357,0xE7B9,0x7056,0x0000,0x3F59,0xE7BA,0x0000, - 0x0000,0x7057,0x0000,0xE7BB,0x3724,0x0000,0xE7BC,0xE7BD, - 0xE7BE,0x7058,0x705C,0xE7BF,0x705A,0xE7C0,0x0000,0xE7C1, - 0xE7C2,0x705B,0x0000,0x0000,0x3373,0x7059,0x705D,0x0000, - 0x0000,0xE7C3,0x0000,0x705E,0x0000,0x3048,0x0000,0x705F, - 0x7060,0x0000,0x0000,0x0000,0x0000,0xE7C4,0xE7C5,0xE7C6, - 0x3E64,0xE7C7,0xE7C8,0x0000,0x7061,0x0000,0xE7C9,0xE7CA, - 0x3547,0x0000,0xE7CB,0x7064,0x0000,0x0000,0x7063,0x0000, - 0x7062,0x0000,0x0000,0x6B71,0xE7CC,0x4A5C,0xE7CD,0x0000, - 0x0000,0xE7CE,0xE7CF,0x7065,0x7066,0xE7D0,0xE7D1,0x0000, - 0xE7D2,0xE7D3,0xE7D4,0x0000,0xE7D5,0x0000,0xE7D6,0xE7D7, - 0x0000,0xE7D8,0x0000,0x7067,0xE7D9,0xE7DA,0x7068,0xE7DB, - 0x7069,0xE7DC,0xE7DD,0x706A,0xE7DE,0xE7DF,0xE7E0,0x0000, - 0xE7E1,0xE7E2,0x0000,0x345A,0xE7E3,0x0000,0x0000,0xE7E4, - 0xE7E5,0xE7E6,0x0000,0xE7EA,0x706B,0xE7E7,0xE7E8,0x0000, - 0xE7E9,0xE7EB,0x0000,0x0000,0xE7EC,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x706C,0x4723,0xE7ED, - 0x0000,0xE7EE,0x706E,0x323B,0xE7EF,0x7071,0x7070,0xE7F0, - 0xE7F1,0x0000,0xE7F2,0x3124,0x0000,0x0000,0x0000,0x3641, - - /* 9800h */ - 0x0000,0x4A47,0x443A,0x3A22,0x0000,0x3960,0x3D67,0xE7F3, - 0x3F5C,0x0000,0xE7F4,0x0000,0x7073,0xE7F6,0xE7F7,0x7072, - 0x4D42,0x3468,0x4852,0x465C,0xE7F8,0x0000,0xE7F9,0x3F7C, - 0x4E4E,0xE7F5,0x375B,0x0000,0xE7FA,0x0000,0xE7FB,0x0000, - 0xE7FC,0x7076,0x0000,0xE7FD,0x7075,0xE8A8,0xE7FE,0x0000, - 0x0000,0x0000,0x0000,0xE8A1,0x4B4B,0x462C,0xE8A2,0xE8A3, - 0xE8A4,0x0000,0xE8A5,0xE8A6,0x3150,0xE8A7,0x0000,0x7077, - 0x7074,0x0000,0x0000,0x4951,0x4D6A,0x7078,0xE8A9,0x0000, - 0x0000,0x0000,0x0000,0x0000,0xE8AA,0x0000,0x7079,0xE8AB, - 0x0000,0x0000,0xE8AC,0x707B,0x426A,0x335B,0x335C,0x707A, - 0x0000,0xE8AD,0xE8AE,0xE8AF,0x3469,0x3832,0xE8B0,0xE8B1, - 0x346A,0xE8B2,0xE8B3,0x453F,0x0000,0x0000,0x4E60,0x0000, - 0x0000,0x0000,0xE8B4,0xE8B5,0x0000,0xE8B6,0xE8B7,0x385C, - 0x0000,0x0000,0xE8B8,0x707C,0xE8B9,0x0000,0x0000,0x707D, - 0x707E,0x7121,0x0000,0x7123,0x7122,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x4977,0x0000,0x7124,0xE8BA,0x0000,0xE8BB,0xE8BC,0x7125, - 0xE8BD,0x7126,0x0000,0x0000,0xE8BE,0x0000,0x7127,0xE8BF, - 0xE8C0,0x0000,0xE8C1,0xE8C2,0x0000,0x0000,0x0000,0xE8C3, - 0x0000,0x0000,0xE8C4,0x7129,0x7128,0xE8C5,0x712A,0x0000, - 0xE8C6,0x0000,0x0000,0x0000,0xE8C7,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x4874,0x664C,0x0000,0x0000,0x3F29, - 0x0000,0xE8C8,0x3532,0xE8C9,0x0000,0xE8CA,0xE8CB,0xE8CC, - 0x0000,0x712B,0xE8CD,0x712C,0x0000,0x522C,0x5D3B,0x4853, - 0x0000,0x0000,0x307B,0xE8CE,0x303B,0x0000,0xE8CF,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x3B74,0x4B30,0x3E7E,0x0000, - - /* 9900h */ - 0x0000,0x0000,0xE8D0,0x712D,0x0000,0x4C5F,0x0000,0xE8D1, - 0xE8D2,0x712E,0x4D5C,0x0000,0x3142,0x0000,0x0000,0x0000, - 0x3B41,0xE8D3,0x712F,0x326E,0x7130,0xE8D4,0xE8D5,0xE8D6, - 0x7131,0x0000,0xE8D7,0xE8D8,0xE8D9,0x7133,0x7134,0xE8DA, - 0x7136,0x7132,0xE8DB,0x0000,0x7135,0x0000,0xE8DC,0xE8DD, - 0x345B,0x0000,0x0000,0xE8DE,0x7137,0x0000,0x7138,0x0000, - 0x0000,0xE8DF,0xE8E0,0xE8E1,0xE8E2,0xE8E3,0x0000,0x0000, - 0x0000,0xE8E4,0xE8E5,0xE8E6,0xE8E7,0x7139,0x713A,0x0000, - 0xE8E8,0xE8E9,0x713B,0x0000,0x0000,0x713D,0xE8EA,0xE8EB, - 0xE8EC,0x713C,0x0000,0x713F,0x7142,0xE8ED,0xE8EE,0x0000, - 0x713E,0x7140,0x7141,0x0000,0xE8EF,0x7143,0x0000,0x3642, - 0xE8F0,0xE8F1,0x0000,0xE8F2,0xE8F3,0x0000,0xE8F4,0xE8F5, - 0xE8F6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3C73,0x7144, - 0x7145,0x3961,0x0000,0xE8F7,0x0000,0xE8F8,0x0000,0xE8F9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x7146,0xE8FA,0x0000, - 0x333E,0x0000,0x0000,0x0000,0x474F,0x7147,0x7148,0x0000, - 0xE8FB,0xE8FC,0xE8FD,0x435A,0x466B,0xE8FE,0x0000,0x0000, - 0x0000,0xE9A1,0xE9A2,0x0000,0x7149,0xE9A3,0x0000,0xE9A4, - 0x0000,0x477D,0x0000,0xE9A5,0x424C,0x3158,0x366E,0x0000, - 0x366F,0xE9A6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x4373,0x714E,0x3670,0xE9A7,0xE9A8,0x326F,0x0000,0x0000, - 0x714D,0xE9A9,0xE9AA,0x714B,0xE9AB,0x714C,0xE9AC,0x714A, - 0x0000,0x0000,0x7158,0x0000,0x0000,0x0000,0x0000,0xE9AD, - 0x0000,0x0000,0xE9AE,0xE9AF,0xE9B0,0x714F,0x7150,0x0000, - 0xE9B1,0x7151,0x7152,0x0000,0xE9B2,0xE9B3,0x0000,0x0000, - 0x7154,0xE9B4,0x0000,0x7153,0x0000,0xE9B5,0xE9B6,0x3D59, - - /* 9A00h */ - 0x0000,0x7155,0xE9B7,0xE9B8,0xE9B9,0x7157,0x0000,0x0000, - 0x0000,0x0000,0x0000,0xE9BA,0xE9BB,0x0000,0x3533,0x7156, - 0xE9BC,0xE9BD,0x417B,0x3833,0x0000,0x0000,0xE9BE,0x0000, - 0x0000,0x7159,0x0000,0x0000,0x0000,0x0000,0xE9BF,0x0000, - 0xE9C0,0x0000,0xE9C1,0xE9C2,0xE9C3,0x0000,0x0000,0xE9C4, - 0x424D,0x0000,0x0000,0x715A,0x0000,0xE9C5,0xE9C6,0x0000, - 0x462D,0x0000,0x0000,0xE9C7,0x0000,0xE9C8,0xE9C9,0x715B, - 0xE9CA,0x0000,0x0000,0x0000,0x0000,0x0000,0x7160,0x0000, - 0x715E,0xE9CC,0x715D,0x715F,0xE9CD,0x715C,0x0000,0xE9CB, - 0x0000,0x0000,0xE9CE,0xE9CF,0xE9D0,0x7162,0xE9D1,0x0000, - 0x0000,0xE9D2,0x0000,0x0000,0xE9D3,0x7161,0xE9D4,0x7164, - 0x0000,0x0000,0x3643,0x7163,0x0000,0xE9D5,0x0000,0x7165, - 0x0000,0x0000,0x7166,0x0000,0x7168,0x7167,0x0000,0x0000, - 0x0000,0x7169,0x716B,0x716A,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x397C,0x0000,0xE9D6,0x0000,0xE9D7,0x716C,0xE9D8,0xE9D9, - 0x716D,0x0000,0xE9DA,0x0000,0xE9DB,0xE9DC,0xE9DD,0x0000, - 0x333C,0xE9DE,0x0000,0xE9DF,0x716E,0x0000,0xE9E0,0xE9E1, - 0x716F,0xE9E2,0x0000,0xE9E3,0x3F71,0x0000,0xE9E4,0x0000, - 0xE9E5,0x0000,0x0000,0x0000,0x0000,0x0000,0xE9E6,0x7170, - 0xE9E7,0x7171,0xE9E8,0x7172,0x7173,0xE9E9,0xE9EA,0xE9EB, - 0x3962,0x0000,0x0000,0xE9EC,0xE9ED,0x0000,0x7174,0x7175, - 0xE9EE,0x0000,0x7176,0x7177,0xE9EF,0xE9F0,0x7178,0xE9F1, - 0x0000,0xE9F2,0x4831,0x717A,0xE9F3,0x4926,0x717B,0x7179, - 0x0000,0x717D,0xE9F4,0xE9F5,0x717C,0xE9F6,0x0000,0x717E, - 0x0000,0xE9F7,0xE9F8,0x7221,0x0000,0xE9F9,0x0000,0xE9FA, - - /* 9B00h */ - 0xE9FB,0xE9FC,0xE9FD,0xE9FE,0xEAA1,0xEAA2,0x7222,0x0000, - 0xEAA3,0xEAA4,0x0000,0xEAA5,0xEAA6,0xEAA7,0xEAA8,0x0000, - 0xEAA9,0x0000,0xEAAA,0x0000,0x0000,0x0000,0xEAAB,0x0000, - 0x7223,0xEAAC,0x7224,0xEAAD,0xEAAE,0x0000,0x0000,0x7225, - 0xEAAF,0x0000,0x7226,0x7227,0x0000,0x7228,0xEAB0,0x7229, - 0x722A,0x722B,0x722C,0xEAB1,0x0000,0xEAB2,0x722D,0x722E, - 0x0000,0x5D35,0x722F,0xEAB3,0xEAB4,0xEAB5,0x0000,0xEAB6, - 0x0000,0xEAB7,0xEAB8,0x6478,0x3534,0xEAB9,0x0000,0x0000, - 0x0000,0x3321,0x3A32,0x7231,0x7230,0x4C25,0x0000,0x0000, - 0xEABA,0x0000,0x0000,0xEABB,0xEABC,0x7233,0x7234,0x7232, - 0x0000,0x7235,0x0000,0x0000,0x4B62,0xEABD,0xEABE,0xEABF, - 0x7236,0x0000,0x357B,0xEAC0,0x0000,0x0000,0xEAC1,0x0000, - 0x0000,0xEAC2,0x0000,0xEAC3,0x0000,0xEAC4,0xEAC5,0x0000, - 0xEAC6,0x0000,0xEAC7,0xEAC8,0xEAC9,0xEACA,0xEACB,0x4F25, - 0x0000,0x0000,0x0000,0xEACC,0x7237,0xEACD,0x0000,0xEACE, - 0xEACF,0xEAD0,0x0000,0x0000,0x0000,0x0000,0x0000,0xEAD1, - 0xEAD2,0x0000,0x0000,0x7239,0xEAD3,0xEAD4,0xEAD5,0xEAD6, - 0x0000,0xEAD7,0xEAD8,0xEAD9,0x0000,0xEADA,0x303E,0xEADB, - 0xEADC,0x723A,0x4A2B,0x7238,0xEADD,0x0000,0x723B,0x723C, - 0x0000,0x0000,0xEADE,0x0000,0x0000,0xEADF,0xEAE0,0x723D, - 0x723E,0x0000,0x0000,0x0000,0x0000,0x0000,0xEAE1,0xEAE2, - 0x723F,0xEAE3,0x4B6E,0x3B2D,0xEAE4,0x3A7A,0x412F,0x0000, - 0xEAE5,0xEAE6,0xEAE7,0x0000,0x7240,0x0000,0x0000,0xEAE8, - 0xEAE9,0x7243,0x0000,0xEAEA,0xEAEB,0x0000,0xEAEC,0xEAED, - 0x7241,0xEAEE,0x0000,0x0000,0x0000,0x0000,0x7244,0xEAEF, - 0xEAF0,0x3871,0x7242,0x0000,0x0000,0x0000,0xEAF1,0x7245, - 0xEAF2,0x7246,0x7247,0x0000,0x724B,0x0000,0x3B2A,0xEAF3, - 0xEAF4,0x0000,0x0000,0x4264,0x0000,0xEAF5,0x0000,0xEAF6, - 0x0000,0x724C,0x7249,0x7248,0x724A,0xEAF7,0x0000,0xEAF8, - 0x375F,0x0000,0xEAF9,0xEAFA,0x0000,0x0000,0x0000,0xEAFB, - 0x7250,0x724F,0x724E,0xEAFC,0x0000,0x3033,0x0000,0xEAFD, - 0xEAFE,0xEBA1,0xEBA2,0x0000,0x0000,0xEBA3,0x0000,0xEBA4, - - /* 9C00h */ - 0xEBA5,0x0000,0xEBA6,0x0000,0x725A,0x0000,0x7256,0x0000, - 0x7257,0x7253,0x7259,0xEBA7,0x7255,0x3362,0x0000,0xEBA8, - 0x4F4C,0xEBA9,0x7258,0x7254,0x7252,0x7251,0xEBAA,0x0000, - 0xEBAB,0xEBAC,0xEBAD,0x725C,0xEBAE,0x0000,0xEBAF,0x0000, - 0x0000,0x725F,0xEBB0,0xEBB1,0x725E,0x725D,0xEBB2,0xEBB3, - 0xEBB4,0xEBB5,0xEBB6,0x0000,0x0000,0x4949,0x725B,0x3073, - 0x7260,0xEBB7,0x7262,0x0000,0x0000,0xEBB8,0xEBB9,0xEBBA, - 0x0000,0x336F,0x724D,0x3137,0x0000,0xEBBB,0x7264,0x0000, - 0x0000,0xEBBC,0x0000,0xEBBD,0xEBBE,0xEBBF,0x7263,0x7261, - 0x432D,0xEBC0,0xEBC1,0x0000,0x0000,0x0000,0xEBC2,0xEBC3, - 0xEBC4,0x0000,0x4B70,0xEBC5,0xEBC6,0x0000,0xEBC7,0x4E5A, - 0xEBC8,0x0000,0x7265,0xEBC9,0xEBD0,0xEBCA,0xEBCB,0xEBCC, - 0x7266,0x0000,0x0000,0xEBCD,0x0000,0x0000,0x0000,0x7267, - 0xEBD2,0xEBCE,0xEBCF,0xEBD1,0x0000,0x0000,0xEBD3,0x0000, - 0xEBD4,0x0000,0xEBD5,0x0000,0x0000,0xEBD6,0x7268,0xEBD7, - 0x7269,0x0000,0x0000,0xEBD8,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x443B,0xEBD9,0x726A, - 0x0000,0x4837,0x0000,0x726F,0x726B,0x0000,0x0000,0x0000, - 0x726C,0x0000,0xEBDA,0x4B31,0x4C44,0x0000,0x4650,0xEBDB, - 0x0000,0xEBDC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - /* 9D00h */ - 0x0000,0x0000,0xEBDE,0x7270,0x0000,0x0000,0x7271,0x463E, - 0x726E,0x726D,0x0000,0xEBDD,0x0000,0x0000,0x322A,0x0000, - 0x0000,0xEBDF,0x7279,0x0000,0x0000,0x7278,0x0000,0xEBE0, - 0xEBE1,0x0000,0x0000,0x3175,0xEBE2,0xEBE3,0xEBE4,0x7276, - 0x0000,0x0000,0x0000,0x7275,0x0000,0x0000,0x7273,0x0000, - 0x337B,0x0000,0x7272,0x3C32,0x3229,0x0000,0x0000,0xEBE5, - 0xEBE6,0x0000,0xEBE7,0xEBE8,0xEBE9,0x0000,0x0000,0x0000, - 0x0000,0x0000,0xEBEA,0x3963,0xEBEB,0xEBED,0x727C,0x727B, - 0x0000,0x727A,0xEBEE,0xEBEF,0x7277,0xEBEC,0x727D,0xEBF0, - 0x727E,0x0000,0xEBF1,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x7325,0x7324,0x0000,0xEBF2,0xEBF3,0x0000,0x0000,0x0000, - 0x0000,0x7326,0x0000,0x0000,0x312D,0x7321,0x7322,0xEBF4, - 0x3974,0x4C39,0xEBF6,0xEBF5,0x7323,0xEBF7,0x0000,0x0000, - 0x0000,0xEBF8,0xEBF9,0xEBFA,0x4B32,0x0000,0x0000,0x732B, - 0xEBFB,0x0000,0x7327,0x0000,0x0000,0x0000,0xEBFC,0xEBFD, - 0x0000,0x0000,0x732C,0xEBFE,0xECA1,0x0000,0xECA2,0x0000, - 0x0000,0x0000,0x0000,0xECA3,0xECA4,0x0000,0xECA5,0x7329, - 0x0000,0x7328,0xECA6,0x0000,0x0000,0xECA7,0xECA8,0x375C, - 0x0000,0x0000,0xECA9,0xECAA,0x0000,0xECAB,0xECAC,0xECAD, - 0xECAE,0x0000,0x732D,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0xECAF,0x0000,0x0000,0x732E,0x0000,0x0000,0x0000, - 0x0000,0x732F,0xECB0,0x732A,0xECB1,0x0000,0xECB2,0x7274, - 0x0000,0xECB3,0x7330,0x0000,0x4461,0xECB4,0x0000,0x0000, - 0x7334,0xECB5,0x7335,0x7333,0xECB6,0x0000,0x0000,0xECB7, - 0x0000,0x7332,0x7338,0xECB8,0x7331,0x0000,0x7336,0xECB9, - 0x0000,0xECBA,0xECBB,0x0000,0x0000,0x0000,0x0000,0x7337, - 0x0000,0x0000,0x0000,0x733A,0xECBC,0xECBD,0xECBE,0xECBF, - 0x0000,0x7339,0xECC0,0x0000,0x0000,0x0000,0xECC1,0xECC2, - 0xECC3,0x0000,0x0000,0x0000,0x0000,0xECC4,0x733C,0xECC5, - 0x0000,0xECC6,0x0000,0xECC7,0x0000,0x733D,0xECC8,0x733E, - 0xECC9,0x0000,0x4F49,0xECCA,0xECCB,0x0000,0x0000,0x0000, - 0x733B,0x426B,0x3A6D,0x0000,0x0000,0x733F,0xECCC,0x0000, - - /* 9E00h */ - 0x0000,0x0000,0xECCE,0x0000,0x0000,0x0000,0x0000,0xECCF, - 0x0000,0x0000,0xECCD,0x0000,0x0000,0x0000,0xECD0,0x0000, - 0xECD1,0xECD2,0xECD3,0x0000,0x0000,0xECD4,0xECD5,0x0000, - 0x0000,0xECD6,0x7340,0x7341,0xECD7,0xECD8,0x7342,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x7343,0x0000,0x0000, - 0x3834,0x7344,0xECD9,0xECDA,0xECDB,0x7345,0x0000,0x3C2F, - 0xECDC,0x7346,0xECDD,0xECDE,0xECDF,0xECE0,0x0000,0xECE1, - 0x7347,0x0000,0x0000,0x7348,0x7349,0x0000,0xECE2,0xECE3, - 0x0000,0x734C,0x734A,0x4F3C,0x0000,0x734B,0xECE4,0x4E6F, - 0xECE5,0x0000,0x0000,0xECE6,0x0000,0x734D,0xECE7,0x4E5B, - 0x0000,0x0000,0x0000,0x0000,0xECE8,0x734E,0x477E,0x0000, - 0xECE9,0x734F,0x7351,0x0000,0xECEA,0x7352,0xECEB,0xECEC, - 0xECED,0x0000,0x0000,0xECEE,0xECEF,0xECF0,0x0000,0x0000, - 0x7350,0x396D,0x4C4D,0x4B63,0x5677,0x0000,0x5D60,0x4B7B, - 0x0000,0x0000,0x0000,0x0000,0x322B,0x0000,0xECF1,0x0000, - 0xECF2,0x0000,0x0000,0xECF3,0x7354,0x3550,0x7355,0x7356, - 0x7357,0x0000,0x3975,0x0000,0x7358,0xECF4,0x0000,0x0000, - 0x6054,0x4C5B,0x0000,0x4263,0x7359,0x735B,0x735A,0xECF5, - 0x735C,0x0000,0x0000,0x0000,0xECF6,0x735D,0x0000,0xECF7, - 0x735E,0x0000,0x0000,0x0000,0xECF8,0xECF9,0xECFA,0x735F, - 0xECFB,0xECFC,0xECFD,0x0000,0x7360,0xECFE,0x7361,0x7362, - 0xEDA1,0x7363,0x0000,0x7364,0x7365,0x7366,0x0000,0xEDA2, - - /* 9F00h */ - 0x0000,0x0000,0xEDA3,0xEDA4,0x0000,0x0000,0x0000,0x7367, - 0x7368,0xEDA5,0x0000,0x0000,0x0000,0x0000,0x4524,0xEDA6, - 0xEDA7,0xEDA8,0xEDA9,0x385D,0xEDAA,0x736A,0xEDAB,0xEDAC, - 0x0000,0xEDAD,0xEDAE,0xEDAF,0x0000,0x0000,0x0000,0xEDB0, - 0x414D,0x736B,0xEDB1,0x0000,0x0000,0x0000,0xEDB2,0x0000, - 0x0000,0x0000,0xEDB3,0xEDB4,0x736C,0x0000,0x0000,0xEDB5, - 0x0000,0xEDB6,0xEDB7,0x0000,0xEDB8,0x0000,0x0000,0xEDB9, - 0x0000,0xEDBA,0xEDBB,0x4921,0xEDBC,0xEDBD,0x736D,0xEDBE, - 0x0000,0xEDBF,0x0000,0xEDC0,0xEDC1,0xEDC2,0xEDC3,0xEDC4, - 0x0000,0x0000,0x736E,0x6337,0x0000,0x0000,0x6C5A,0x706D, - 0x0000,0x0000,0x736F,0xEDC5,0x7370,0xEDC6,0xEDC7,0xEDC8, - 0xEDC9,0x0000,0xEDCA,0x0000,0x0000,0xEDCB,0xEDCC,0x7372, - 0x7373,0x7374,0x4E70,0x7371,0x0000,0x0000,0x7375,0x7376, - 0xEDCD,0xEDCE,0x7378,0x0000,0x7377,0xEDCF,0xEDD0,0xEDD1, - 0xEDD2,0xEDD3,0x737A,0xEDD4,0x0000,0xEDD5,0x737B,0x7379, - 0x0000,0x0000,0xEDD6,0x0000,0x0000,0xEDD7,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x4E36,0x0000,0xEDD8, - 0xEDD9,0xEDDA,0xEDDB,0x0000,0xEDDC,0x737C,0xEDDD,0xEDDE, - 0x0000,0x0000,0x0000,0x0000,0x737D,0x6354,0xEDDF,0x0000, - 0x737E,0xEDE0,0xEDE1,0xEDE2,0x0000,0xEDE3,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; -static const int ucs_i_jis_table_min = 0x4E00; -static const int ucs_i_jis_table_max = 0x4E00 + (sizeof (ucs_i_jis_table) / sizeof (unsigned short)); - - -static const unsigned short ucs_r_jis_table[] = { - /* FF00h */ - 0x0000,0x212A,0x0000,0x2174,0x2170,0x2173,0x2175,0x0000, - 0x214A,0x214B,0x2176,0x215C,0x2124,0x0000,0x2125,0x213F, - 0x2330,0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337, - 0x2338,0x2339,0x2127,0x2128,0x2163,0x2161,0x2164,0x2129, - 0x2177,0x2341,0x2342,0x2343,0x2344,0x2345,0x2346,0x2347, - 0x2348,0x2349,0x234A,0x234B,0x234C,0x234D,0x234E,0x234F, - 0x2350,0x2351,0x2352,0x2353,0x2354,0x2355,0x2356,0x2357, - 0x2358,0x2359,0x235A,0x214E,0x2140,0x214F,0x2130,0x2132, - 0x212E,0x2361,0x2362,0x2363,0x2364,0x2365,0x2366,0x2367, - 0x2368,0x2369,0x236A,0x236B,0x236C,0x236D,0x236E,0x236F, - 0x2370,0x2371,0x2372,0x2373,0x2374,0x2375,0x2376,0x2377, - 0x2378,0x2379,0x237A,0x2150,0x2143,0x2151,0x0000,0x0000, - 0x0000,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, - 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, - 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, - 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, - 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, - 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, - 0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, - 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x2131,0x0000,0x216F -}; -static const int ucs_r_jis_table_min = 0xFF00; -static const int ucs_r_jis_table_max = 0xFF00 + (sizeof (ucs_r_jis_table) / sizeof (unsigned short)); - -#endif /* UNICODE_TABLE_JIS_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_koi8r.h b/ext/mbstring/libmbfl/filters/unicode_table_koi8r.h deleted file mode 100644 index ad3a68cd3dc3a..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_koi8r.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The original author of this file: Den V. Tsopa - * - */ - -#ifndef UNICODE_TABLE_KOI8R_H -#define UNICODE_TABLE_KOI8R_H - -/* KOI8-R (RFC1489) to Unicode */ -static const unsigned short koi8r_ucs_table[] = { - 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, - 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, - 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, - 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, - 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, - 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, - 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, - 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a -}; -static const int koi8r_ucs_table_min = 0x80; -static const int koi8r_ucs_table_len = (sizeof (koi8r_ucs_table) / sizeof (unsigned short)); -static const int koi8r_ucs_table_max = 0x80 + (sizeof (koi8r_ucs_table) / sizeof (unsigned short)); - - - -#endif /* UNNICODE_TABLE_KOI8R_H */ diff --git a/ext/mbstring/libmbfl/filters/unicode_table_uhc.h b/ext/mbstring/libmbfl/filters/unicode_table_uhc.h deleted file mode 100644 index 802e120e08873..0000000000000 --- a/ext/mbstring/libmbfl/filters/unicode_table_uhc.h +++ /dev/null @@ -1,7186 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: Rui Hirokawa - * - */ - -#ifndef UNICODE_TABLE_UHC_H -#define UNICODE_TABLE_UHC_H - -/* - * Unicode table - */ - -static const unsigned short uhc1_ucs_table[] = { -0xac02,0xac03,0xac05,0xac06,0xac0b,0xac0c,0xac0d,0xac0e, -0xac0f,0xac18,0xac1e,0xac1f,0xac21,0xac22,0xac23,0xac25, -0xac26,0xac27,0xac28,0xac29,0xac2a,0xac2b,0xac2e,0xac32, -0xac33,0xac34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xac35,0xac36,0xac37,0xac3a,0xac3b,0xac3d,0xac3e,0xac3f, -0xac41,0xac42,0xac43,0xac44,0xac45,0xac46,0xac47,0xac48, -0xac49,0xac4a,0xac4c,0xac4e,0xac4f,0xac50,0xac51,0xac52, -0xac53,0xac55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xac56,0xac57,0xac59,0xac5a,0xac5b,0xac5d,0xac5e,0xac5f, -0xac60,0xac61,0xac62,0xac63,0xac64,0xac65,0xac66,0xac67, -0xac68,0xac69,0xac6a,0xac6b,0xac6c,0xac6d,0xac6e,0xac6f, -0xac72,0xac73,0xac75,0xac76,0xac79,0xac7b,0xac7c,0xac7d, -0xac7e,0xac7f,0xac82,0xac87,0xac88,0xac8d,0xac8e,0xac8f, -0xac91,0xac92,0xac93,0xac95,0xac96,0xac97,0xac98,0xac99, -0xac9a,0xac9b,0xac9e,0xaca2,0xaca3,0xaca4,0xaca5,0xaca6, -0xaca7,0xacab,0xacad,0xacae,0xacb1,0xacb2,0xacb3,0xacb4, -0xacb5,0xacb6,0xacb7,0xacba,0xacbe,0xacbf,0xacc0,0xacc2, -0xacc3,0xacc5,0xacc6,0xacc7,0xacc9,0xacca,0xaccb,0xaccd, -0xacce,0xaccf,0xacd0,0xacd1,0xacd2,0xacd3,0xacd4,0xacd6, -0xacd8,0xacd9,0xacda,0xacdb,0xacdc,0xacdd,0xacde,0xacdf, -0xace2,0xace3,0xace5,0xace6,0xace9,0xaceb,0xaced,0xacee, -0xacf2,0xacf4,0xacf7,0xacf8,0xacf9,0xacfa,0xacfb,0xacfe, -0xacff,0xad01,0xad02,0xad03,0xad05,0xad07,0xad08,0xad09, -0xad0a,0xad0b,0xad0e,0xad10,0xad12,0xad13,0xad14,0xad15, -0xad16,0xad17,0xad19,0xad1a,0xad1b,0xad1d,0xad1e,0xad1f, -0xad21,0xad22,0xad23,0xad24,0xad25,0xad26,0xad27,0xad28, -0xad2a,0xad2b,0xad2e,0xad2f,0xad30,0xad31,0xad32,0xad33, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xad36,0xad37, -0xad39,0xad3a,0xad3b,0xad3d,0xad3e,0xad3f,0xad40,0xad41, -0xad42,0xad43,0xad46,0xad48,0xad4a,0xad4b,0xad4c,0xad4d, -0xad4e,0xad4f,0xad51,0xad52,0xad53,0xad55,0xad56,0xad57, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xad59,0xad5a, -0xad5b,0xad5c,0xad5d,0xad5e,0xad5f,0xad60,0xad62,0xad64, -0xad65,0xad66,0xad67,0xad68,0xad69,0xad6a,0xad6b,0xad6e, -0xad6f,0xad71,0xad72,0xad77,0xad78,0xad79,0xad7a,0xad7e, -0xad80,0xad83,0xad84,0xad85,0xad86,0xad87,0xad8a,0xad8b, -0xad8d,0xad8e,0xad8f,0xad91,0xad92,0xad93,0xad94,0xad95, -0xad96,0xad97,0xad98,0xad99,0xad9a,0xad9b,0xad9e,0xad9f, -0xada0,0xada1,0xada2,0xada3,0xada5,0xada6,0xada7,0xada8, -0xada9,0xadaa,0xadab,0xadac,0xadad,0xadae,0xadaf,0xadb0, -0xadb1,0xadb2,0xadb3,0xadb4,0xadb5,0xadb6,0xadb8,0xadb9, -0xadba,0xadbb,0xadbc,0xadbd,0xadbe,0xadbf,0xadc2,0xadc3, -0xadc5,0xadc6,0xadc7,0xadc9,0xadca,0xadcb,0xadcc,0xadcd, -0xadce,0xadcf,0xadd2,0xadd4,0xadd5,0xadd6,0xadd7,0xadd8, -0xadd9,0xadda,0xaddb,0xaddd,0xadde,0xaddf,0xade1,0xade2, -0xade3,0xade5,0xade6,0xade7,0xade8,0xade9,0xadea,0xadeb, -0xadec,0xaded,0xadee,0xadef,0xadf0,0xadf1,0xadf2,0xadf3, -0xadf4,0xadf5,0xadf6,0xadf7,0xadfa,0xadfb,0xadfd,0xadfe, -0xae02,0xae03,0xae04,0xae05,0xae06,0xae07,0xae0a,0xae0c, -0xae0e,0xae0f,0xae10,0xae11,0xae12,0xae13,0xae15,0xae16, -0xae17,0xae18,0xae19,0xae1a,0xae1b,0xae1c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xae1d,0xae1e,0xae1f,0xae20, -0xae21,0xae22,0xae23,0xae24,0xae25,0xae26,0xae27,0xae28, -0xae29,0xae2a,0xae2b,0xae2c,0xae2d,0xae2e,0xae2f,0xae32, -0xae33,0xae35,0xae36,0xae39,0xae3b,0xae3c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xae3d,0xae3e,0xae3f,0xae42, -0xae44,0xae47,0xae48,0xae49,0xae4b,0xae4f,0xae51,0xae52, -0xae53,0xae55,0xae57,0xae58,0xae59,0xae5a,0xae5b,0xae5e, -0xae62,0xae63,0xae64,0xae66,0xae67,0xae6a,0xae6b,0xae6d, -0xae6e,0xae6f,0xae71,0xae72,0xae73,0xae74,0xae75,0xae76, -0xae77,0xae7a,0xae7e,0xae7f,0xae80,0xae81,0xae82,0xae83, -0xae86,0xae87,0xae88,0xae89,0xae8a,0xae8b,0xae8d,0xae8e, -0xae8f,0xae90,0xae91,0xae92,0xae93,0xae94,0xae95,0xae96, -0xae97,0xae98,0xae99,0xae9a,0xae9b,0xae9c,0xae9d,0xae9e, -0xae9f,0xaea0,0xaea1,0xaea2,0xaea3,0xaea4,0xaea5,0xaea6, -0xaea7,0xaea8,0xaea9,0xaeaa,0xaeab,0xaeac,0xaead,0xaeae, -0xaeaf,0xaeb0,0xaeb1,0xaeb2,0xaeb3,0xaeb4,0xaeb5,0xaeb6, -0xaeb7,0xaeb8,0xaeb9,0xaeba,0xaebb,0xaebf,0xaec1,0xaec2, -0xaec3,0xaec5,0xaec6,0xaec7,0xaec8,0xaec9,0xaeca,0xaecb, -0xaece,0xaed2,0xaed3,0xaed4,0xaed5,0xaed6,0xaed7,0xaeda, -0xaedb,0xaedd,0xaede,0xaedf,0xaee0,0xaee1,0xaee2,0xaee3, -0xaee4,0xaee5,0xaee6,0xaee7,0xaee9,0xaeea,0xaeec,0xaeee, -0xaeef,0xaef0,0xaef1,0xaef2,0xaef3,0xaef5,0xaef6,0xaef7, -0xaef9,0xaefa,0xaefb,0xaefd,0xaefe,0xaeff,0xaf00,0xaf01, -0xaf02,0xaf03,0xaf04,0xaf05,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xaf06,0xaf09,0xaf0a,0xaf0b,0xaf0c,0xaf0e, -0xaf0f,0xaf11,0xaf12,0xaf13,0xaf14,0xaf15,0xaf16,0xaf17, -0xaf18,0xaf19,0xaf1a,0xaf1b,0xaf1c,0xaf1d,0xaf1e,0xaf1f, -0xaf20,0xaf21,0xaf22,0xaf23,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xaf24,0xaf25,0xaf26,0xaf27,0xaf28,0xaf29, -0xaf2a,0xaf2b,0xaf2e,0xaf2f,0xaf31,0xaf33,0xaf35,0xaf36, -0xaf37,0xaf38,0xaf39,0xaf3a,0xaf3b,0xaf3e,0xaf40,0xaf44, -0xaf45,0xaf46,0xaf47,0xaf4a,0xaf4b,0xaf4c,0xaf4d,0xaf4e, -0xaf4f,0xaf51,0xaf52,0xaf53,0xaf54,0xaf55,0xaf56,0xaf57, -0xaf58,0xaf59,0xaf5a,0xaf5b,0xaf5e,0xaf5f,0xaf60,0xaf61, -0xaf62,0xaf63,0xaf66,0xaf67,0xaf68,0xaf69,0xaf6a,0xaf6b, -0xaf6c,0xaf6d,0xaf6e,0xaf6f,0xaf70,0xaf71,0xaf72,0xaf73, -0xaf74,0xaf75,0xaf76,0xaf77,0xaf78,0xaf7a,0xaf7b,0xaf7c, -0xaf7d,0xaf7e,0xaf7f,0xaf81,0xaf82,0xaf83,0xaf85,0xaf86, -0xaf87,0xaf89,0xaf8a,0xaf8b,0xaf8c,0xaf8d,0xaf8e,0xaf8f, -0xaf92,0xaf93,0xaf94,0xaf96,0xaf97,0xaf98,0xaf99,0xaf9a, -0xaf9b,0xaf9d,0xaf9e,0xaf9f,0xafa0,0xafa1,0xafa2,0xafa3, -0xafa4,0xafa5,0xafa6,0xafa7,0xafa8,0xafa9,0xafaa,0xafab, -0xafac,0xafad,0xafae,0xafaf,0xafb0,0xafb1,0xafb2,0xafb3, -0xafb4,0xafb5,0xafb6,0xafb7,0xafba,0xafbb,0xafbd,0xafbe, -0xafbf,0xafc1,0xafc2,0xafc3,0xafc4,0xafc5,0xafc6,0xafca, -0xafcc,0xafcf,0xafd0,0xafd1,0xafd2,0xafd3,0xafd5,0xafd6, -0xafd7,0xafd8,0xafd9,0xafda,0xafdb,0xafdd,0xafde,0xafdf, -0xafe0,0xafe1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xafe2,0xafe3,0xafe4,0xafe5,0xafe6,0xafe7,0xafea,0xafeb, -0xafec,0xafed,0xafee,0xafef,0xaff2,0xaff3,0xaff5,0xaff6, -0xaff7,0xaff9,0xaffa,0xaffb,0xaffc,0xaffd,0xaffe,0xafff, -0xb002,0xb003,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb005,0xb006,0xb007,0xb008,0xb009,0xb00a,0xb00b,0xb00d, -0xb00e,0xb00f,0xb011,0xb012,0xb013,0xb015,0xb016,0xb017, -0xb018,0xb019,0xb01a,0xb01b,0xb01e,0xb01f,0xb020,0xb021, -0xb022,0xb023,0xb024,0xb025,0xb026,0xb027,0xb029,0xb02a, -0xb02b,0xb02c,0xb02d,0xb02e,0xb02f,0xb030,0xb031,0xb032, -0xb033,0xb034,0xb035,0xb036,0xb037,0xb038,0xb039,0xb03a, -0xb03b,0xb03c,0xb03d,0xb03e,0xb03f,0xb040,0xb041,0xb042, -0xb043,0xb046,0xb047,0xb049,0xb04b,0xb04d,0xb04f,0xb050, -0xb051,0xb052,0xb056,0xb058,0xb05a,0xb05b,0xb05c,0xb05e, -0xb05f,0xb060,0xb061,0xb062,0xb063,0xb064,0xb065,0xb066, -0xb067,0xb068,0xb069,0xb06a,0xb06b,0xb06c,0xb06d,0xb06e, -0xb06f,0xb070,0xb071,0xb072,0xb073,0xb074,0xb075,0xb076, -0xb077,0xb078,0xb079,0xb07a,0xb07b,0xb07e,0xb07f,0xb081, -0xb082,0xb083,0xb085,0xb086,0xb087,0xb088,0xb089,0xb08a, -0xb08b,0xb08e,0xb090,0xb092,0xb093,0xb094,0xb095,0xb096, -0xb097,0xb09b,0xb09d,0xb09e,0xb0a3,0xb0a4,0xb0a5,0xb0a6, -0xb0a7,0xb0aa,0xb0b0,0xb0b2,0xb0b6,0xb0b7,0xb0b9,0xb0ba, -0xb0bb,0xb0bd,0xb0be,0xb0bf,0xb0c0,0xb0c1,0xb0c2,0xb0c3, -0xb0c6,0xb0ca,0xb0cb,0xb0cc,0xb0cd,0xb0ce,0xb0cf,0xb0d2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb0d3,0xb0d5, -0xb0d6,0xb0d7,0xb0d9,0xb0da,0xb0db,0xb0dc,0xb0dd,0xb0de, -0xb0df,0xb0e1,0xb0e2,0xb0e3,0xb0e4,0xb0e6,0xb0e7,0xb0e8, -0xb0e9,0xb0ea,0xb0eb,0xb0ec,0xb0ed,0xb0ee,0xb0ef,0xb0f0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb0f1,0xb0f2, -0xb0f3,0xb0f4,0xb0f5,0xb0f6,0xb0f7,0xb0f8,0xb0f9,0xb0fa, -0xb0fb,0xb0fc,0xb0fd,0xb0fe,0xb0ff,0xb100,0xb101,0xb102, -0xb103,0xb104,0xb105,0xb106,0xb107,0xb10a,0xb10d,0xb10e, -0xb10f,0xb111,0xb114,0xb115,0xb116,0xb117,0xb11a,0xb11e, -0xb11f,0xb120,0xb121,0xb122,0xb126,0xb127,0xb129,0xb12a, -0xb12b,0xb12d,0xb12e,0xb12f,0xb130,0xb131,0xb132,0xb133, -0xb136,0xb13a,0xb13b,0xb13c,0xb13d,0xb13e,0xb13f,0xb142, -0xb143,0xb145,0xb146,0xb147,0xb149,0xb14a,0xb14b,0xb14c, -0xb14d,0xb14e,0xb14f,0xb152,0xb153,0xb156,0xb157,0xb159, -0xb15a,0xb15b,0xb15d,0xb15e,0xb15f,0xb161,0xb162,0xb163, -0xb164,0xb165,0xb166,0xb167,0xb168,0xb169,0xb16a,0xb16b, -0xb16c,0xb16d,0xb16e,0xb16f,0xb170,0xb171,0xb172,0xb173, -0xb174,0xb175,0xb176,0xb177,0xb17a,0xb17b,0xb17d,0xb17e, -0xb17f,0xb181,0xb183,0xb184,0xb185,0xb186,0xb187,0xb18a, -0xb18c,0xb18e,0xb18f,0xb190,0xb191,0xb195,0xb196,0xb197, -0xb199,0xb19a,0xb19b,0xb19d,0xb19e,0xb19f,0xb1a0,0xb1a1, -0xb1a2,0xb1a3,0xb1a4,0xb1a5,0xb1a6,0xb1a7,0xb1a9,0xb1aa, -0xb1ab,0xb1ac,0xb1ad,0xb1ae,0xb1af,0xb1b0,0xb1b1,0xb1b2, -0xb1b3,0xb1b4,0xb1b5,0xb1b6,0xb1b7,0xb1b8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb1b9,0xb1ba,0xb1bb,0xb1bc, -0xb1bd,0xb1be,0xb1bf,0xb1c0,0xb1c1,0xb1c2,0xb1c3,0xb1c4, -0xb1c5,0xb1c6,0xb1c7,0xb1c8,0xb1c9,0xb1ca,0xb1cb,0xb1cd, -0xb1ce,0xb1cf,0xb1d1,0xb1d2,0xb1d3,0xb1d5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb1d6,0xb1d7,0xb1d8,0xb1d9, -0xb1da,0xb1db,0xb1de,0xb1e0,0xb1e1,0xb1e2,0xb1e3,0xb1e4, -0xb1e5,0xb1e6,0xb1e7,0xb1ea,0xb1eb,0xb1ed,0xb1ee,0xb1ef, -0xb1f1,0xb1f2,0xb1f3,0xb1f4,0xb1f5,0xb1f6,0xb1f7,0xb1f8, -0xb1fa,0xb1fc,0xb1fe,0xb1ff,0xb200,0xb201,0xb202,0xb203, -0xb206,0xb207,0xb209,0xb20a,0xb20d,0xb20e,0xb20f,0xb210, -0xb211,0xb212,0xb213,0xb216,0xb218,0xb21a,0xb21b,0xb21c, -0xb21d,0xb21e,0xb21f,0xb221,0xb222,0xb223,0xb224,0xb225, -0xb226,0xb227,0xb228,0xb229,0xb22a,0xb22b,0xb22c,0xb22d, -0xb22e,0xb22f,0xb230,0xb231,0xb232,0xb233,0xb235,0xb236, -0xb237,0xb238,0xb239,0xb23a,0xb23b,0xb23d,0xb23e,0xb23f, -0xb240,0xb241,0xb242,0xb243,0xb244,0xb245,0xb246,0xb247, -0xb248,0xb249,0xb24a,0xb24b,0xb24c,0xb24d,0xb24e,0xb24f, -0xb250,0xb251,0xb252,0xb253,0xb254,0xb255,0xb256,0xb257, -0xb259,0xb25a,0xb25b,0xb25d,0xb25e,0xb25f,0xb261,0xb262, -0xb263,0xb264,0xb265,0xb266,0xb267,0xb26a,0xb26b,0xb26c, -0xb26d,0xb26e,0xb26f,0xb270,0xb271,0xb272,0xb273,0xb276, -0xb277,0xb278,0xb279,0xb27a,0xb27b,0xb27d,0xb27e,0xb27f, -0xb280,0xb281,0xb282,0xb283,0xb286,0xb287,0xb288,0xb28a, -0xb28b,0xb28c,0xb28d,0xb28e,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb28f,0xb292,0xb293,0xb295,0xb296,0xb297, -0xb29b,0xb29c,0xb29d,0xb29e,0xb29f,0xb2a2,0xb2a4,0xb2a7, -0xb2a8,0xb2a9,0xb2ab,0xb2ad,0xb2ae,0xb2af,0xb2b1,0xb2b2, -0xb2b3,0xb2b5,0xb2b6,0xb2b7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb2b8,0xb2b9,0xb2ba,0xb2bb,0xb2bc,0xb2bd, -0xb2be,0xb2bf,0xb2c0,0xb2c1,0xb2c2,0xb2c3,0xb2c4,0xb2c5, -0xb2c6,0xb2c7,0xb2ca,0xb2cb,0xb2cd,0xb2ce,0xb2cf,0xb2d1, -0xb2d3,0xb2d4,0xb2d5,0xb2d6,0xb2d7,0xb2da,0xb2dc,0xb2de, -0xb2df,0xb2e0,0xb2e1,0xb2e3,0xb2e7,0xb2e9,0xb2ea,0xb2f0, -0xb2f1,0xb2f2,0xb2f6,0xb2fc,0xb2fd,0xb2fe,0xb302,0xb303, -0xb305,0xb306,0xb307,0xb309,0xb30a,0xb30b,0xb30c,0xb30d, -0xb30e,0xb30f,0xb312,0xb316,0xb317,0xb318,0xb319,0xb31a, -0xb31b,0xb31d,0xb31e,0xb31f,0xb320,0xb321,0xb322,0xb323, -0xb324,0xb325,0xb326,0xb327,0xb328,0xb329,0xb32a,0xb32b, -0xb32c,0xb32d,0xb32e,0xb32f,0xb330,0xb331,0xb332,0xb333, -0xb334,0xb335,0xb336,0xb337,0xb338,0xb339,0xb33a,0xb33b, -0xb33c,0xb33d,0xb33e,0xb33f,0xb340,0xb341,0xb342,0xb343, -0xb344,0xb345,0xb346,0xb347,0xb348,0xb349,0xb34a,0xb34b, -0xb34c,0xb34d,0xb34e,0xb34f,0xb350,0xb351,0xb352,0xb353, -0xb357,0xb359,0xb35a,0xb35d,0xb360,0xb361,0xb362,0xb363, -0xb366,0xb368,0xb36a,0xb36c,0xb36d,0xb36f,0xb372,0xb373, -0xb375,0xb376,0xb377,0xb379,0xb37a,0xb37b,0xb37c,0xb37d, -0xb37e,0xb37f,0xb382,0xb386,0xb387,0xb388,0xb389,0xb38a, -0xb38b,0xb38d,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb38e,0xb38f,0xb391,0xb392,0xb393,0xb395,0xb396,0xb397, -0xb398,0xb399,0xb39a,0xb39b,0xb39c,0xb39d,0xb39e,0xb39f, -0xb3a2,0xb3a3,0xb3a4,0xb3a5,0xb3a6,0xb3a7,0xb3a9,0xb3aa, -0xb3ab,0xb3ad,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb3ae,0xb3af,0xb3b0,0xb3b1,0xb3b2,0xb3b3,0xb3b4,0xb3b5, -0xb3b6,0xb3b7,0xb3b8,0xb3b9,0xb3ba,0xb3bb,0xb3bc,0xb3bd, -0xb3be,0xb3bf,0xb3c0,0xb3c1,0xb3c2,0xb3c3,0xb3c6,0xb3c7, -0xb3c9,0xb3ca,0xb3cd,0xb3cf,0xb3d1,0xb3d2,0xb3d3,0xb3d6, -0xb3d8,0xb3da,0xb3dc,0xb3de,0xb3df,0xb3e1,0xb3e2,0xb3e3, -0xb3e5,0xb3e6,0xb3e7,0xb3e9,0xb3ea,0xb3eb,0xb3ec,0xb3ed, -0xb3ee,0xb3ef,0xb3f0,0xb3f1,0xb3f2,0xb3f3,0xb3f4,0xb3f5, -0xb3f6,0xb3f7,0xb3f8,0xb3f9,0xb3fa,0xb3fb,0xb3fd,0xb3fe, -0xb3ff,0xb400,0xb401,0xb402,0xb403,0xb404,0xb405,0xb406, -0xb407,0xb408,0xb409,0xb40a,0xb40b,0xb40c,0xb40d,0xb40e, -0xb40f,0xb411,0xb412,0xb413,0xb414,0xb415,0xb416,0xb417, -0xb419,0xb41a,0xb41b,0xb41d,0xb41e,0xb41f,0xb421,0xb422, -0xb423,0xb424,0xb425,0xb426,0xb427,0xb42a,0xb42c,0xb42d, -0xb42e,0xb42f,0xb430,0xb431,0xb432,0xb433,0xb435,0xb436, -0xb437,0xb438,0xb439,0xb43a,0xb43b,0xb43c,0xb43d,0xb43e, -0xb43f,0xb440,0xb441,0xb442,0xb443,0xb444,0xb445,0xb446, -0xb447,0xb448,0xb449,0xb44a,0xb44b,0xb44c,0xb44d,0xb44e, -0xb44f,0xb452,0xb453,0xb455,0xb456,0xb457,0xb459,0xb45a, -0xb45b,0xb45c,0xb45d,0xb45e,0xb45f,0xb462,0xb464,0xb466, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb467,0xb468, -0xb469,0xb46a,0xb46b,0xb46d,0xb46e,0xb46f,0xb470,0xb471, -0xb472,0xb473,0xb474,0xb475,0xb476,0xb477,0xb478,0xb479, -0xb47a,0xb47b,0xb47c,0xb47d,0xb47e,0xb47f,0xb481,0xb482, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb483,0xb484, -0xb485,0xb486,0xb487,0xb489,0xb48a,0xb48b,0xb48c,0xb48d, -0xb48e,0xb48f,0xb490,0xb491,0xb492,0xb493,0xb494,0xb495, -0xb496,0xb497,0xb498,0xb499,0xb49a,0xb49b,0xb49c,0xb49e, -0xb49f,0xb4a0,0xb4a1,0xb4a2,0xb4a3,0xb4a5,0xb4a6,0xb4a7, -0xb4a9,0xb4aa,0xb4ab,0xb4ad,0xb4ae,0xb4af,0xb4b0,0xb4b1, -0xb4b2,0xb4b3,0xb4b4,0xb4b6,0xb4b8,0xb4ba,0xb4bb,0xb4bc, -0xb4bd,0xb4be,0xb4bf,0xb4c1,0xb4c2,0xb4c3,0xb4c5,0xb4c6, -0xb4c7,0xb4c9,0xb4ca,0xb4cb,0xb4cc,0xb4cd,0xb4ce,0xb4cf, -0xb4d1,0xb4d2,0xb4d3,0xb4d4,0xb4d6,0xb4d7,0xb4d8,0xb4d9, -0xb4da,0xb4db,0xb4de,0xb4df,0xb4e1,0xb4e2,0xb4e5,0xb4e7, -0xb4e8,0xb4e9,0xb4ea,0xb4eb,0xb4ee,0xb4f0,0xb4f2,0xb4f3, -0xb4f4,0xb4f5,0xb4f6,0xb4f7,0xb4f9,0xb4fa,0xb4fb,0xb4fc, -0xb4fd,0xb4fe,0xb4ff,0xb500,0xb501,0xb502,0xb503,0xb504, -0xb505,0xb506,0xb507,0xb508,0xb509,0xb50a,0xb50b,0xb50c, -0xb50d,0xb50e,0xb50f,0xb510,0xb511,0xb512,0xb513,0xb516, -0xb517,0xb519,0xb51a,0xb51d,0xb51e,0xb51f,0xb520,0xb521, -0xb522,0xb523,0xb526,0xb52b,0xb52c,0xb52d,0xb52e,0xb52f, -0xb532,0xb533,0xb535,0xb536,0xb537,0xb539,0xb53a,0xb53b, -0xb53c,0xb53d,0xb53e,0xb53f,0xb542,0xb546,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb547,0xb548,0xb549,0xb54a, -0xb54e,0xb54f,0xb551,0xb552,0xb553,0xb555,0xb556,0xb557, -0xb558,0xb559,0xb55a,0xb55b,0xb55e,0xb562,0xb563,0xb564, -0xb565,0xb566,0xb567,0xb568,0xb569,0xb56a,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb56b,0xb56c,0xb56d,0xb56e, -0xb56f,0xb570,0xb571,0xb572,0xb573,0xb574,0xb575,0xb576, -0xb577,0xb578,0xb579,0xb57a,0xb57b,0xb57c,0xb57d,0xb57e, -0xb57f,0xb580,0xb581,0xb582,0xb583,0xb584,0xb585,0xb586, -0xb587,0xb588,0xb589,0xb58a,0xb58b,0xb58c,0xb58d,0xb58e, -0xb58f,0xb590,0xb591,0xb592,0xb593,0xb594,0xb595,0xb596, -0xb597,0xb598,0xb599,0xb59a,0xb59b,0xb59c,0xb59d,0xb59e, -0xb59f,0xb5a2,0xb5a3,0xb5a5,0xb5a6,0xb5a7,0xb5a9,0xb5ac, -0xb5ad,0xb5ae,0xb5af,0xb5b2,0xb5b6,0xb5b7,0xb5b8,0xb5b9, -0xb5ba,0xb5be,0xb5bf,0xb5c1,0xb5c2,0xb5c3,0xb5c5,0xb5c6, -0xb5c7,0xb5c8,0xb5c9,0xb5ca,0xb5cb,0xb5ce,0xb5d2,0xb5d3, -0xb5d4,0xb5d5,0xb5d6,0xb5d7,0xb5d9,0xb5da,0xb5db,0xb5dc, -0xb5dd,0xb5de,0xb5df,0xb5e0,0xb5e1,0xb5e2,0xb5e3,0xb5e4, -0xb5e5,0xb5e6,0xb5e7,0xb5e8,0xb5e9,0xb5ea,0xb5eb,0xb5ed, -0xb5ee,0xb5ef,0xb5f0,0xb5f1,0xb5f2,0xb5f3,0xb5f4,0xb5f5, -0xb5f6,0xb5f7,0xb5f8,0xb5f9,0xb5fa,0xb5fb,0xb5fc,0xb5fd, -0xb5fe,0xb5ff,0xb600,0xb601,0xb602,0xb603,0xb604,0xb605, -0xb606,0xb607,0xb608,0xb609,0xb60a,0xb60b,0xb60c,0xb60d, -0xb60e,0xb60f,0xb612,0xb613,0xb615,0xb616,0xb617,0xb619, -0xb61a,0xb61b,0xb61c,0xb61d,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb61e,0xb61f,0xb620,0xb621,0xb622,0xb623, -0xb624,0xb626,0xb627,0xb628,0xb629,0xb62a,0xb62b,0xb62d, -0xb62e,0xb62f,0xb630,0xb631,0xb632,0xb633,0xb635,0xb636, -0xb637,0xb638,0xb639,0xb63a,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb63b,0xb63c,0xb63d,0xb63e,0xb63f,0xb640, -0xb641,0xb642,0xb643,0xb644,0xb645,0xb646,0xb647,0xb649, -0xb64a,0xb64b,0xb64c,0xb64d,0xb64e,0xb64f,0xb650,0xb651, -0xb652,0xb653,0xb654,0xb655,0xb656,0xb657,0xb658,0xb659, -0xb65a,0xb65b,0xb65c,0xb65d,0xb65e,0xb65f,0xb660,0xb661, -0xb662,0xb663,0xb665,0xb666,0xb667,0xb669,0xb66a,0xb66b, -0xb66c,0xb66d,0xb66e,0xb66f,0xb670,0xb671,0xb672,0xb673, -0xb674,0xb675,0xb676,0xb677,0xb678,0xb679,0xb67a,0xb67b, -0xb67c,0xb67d,0xb67e,0xb67f,0xb680,0xb681,0xb682,0xb683, -0xb684,0xb685,0xb686,0xb687,0xb688,0xb689,0xb68a,0xb68b, -0xb68c,0xb68d,0xb68e,0xb68f,0xb690,0xb691,0xb692,0xb693, -0xb694,0xb695,0xb696,0xb697,0xb698,0xb699,0xb69a,0xb69b, -0xb69e,0xb69f,0xb6a1,0xb6a2,0xb6a3,0xb6a5,0xb6a6,0xb6a7, -0xb6a8,0xb6a9,0xb6aa,0xb6ad,0xb6ae,0xb6af,0xb6b0,0xb6b2, -0xb6b3,0xb6b4,0xb6b5,0xb6b6,0xb6b7,0xb6b8,0xb6b9,0xb6ba, -0xb6bb,0xb6bc,0xb6bd,0xb6be,0xb6bf,0xb6c0,0xb6c1,0xb6c2, -0xb6c3,0xb6c4,0xb6c5,0xb6c6,0xb6c7,0xb6c8,0xb6c9,0xb6ca, -0xb6cb,0xb6cc,0xb6cd,0xb6ce,0xb6cf,0xb6d0,0xb6d1,0xb6d2, -0xb6d3,0xb6d5,0xb6d6,0xb6d7,0xb6d8,0xb6d9,0xb6da,0xb6db, -0xb6dc,0xb6dd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb6de,0xb6df,0xb6e0,0xb6e1,0xb6e2,0xb6e3,0xb6e4,0xb6e5, -0xb6e6,0xb6e7,0xb6e8,0xb6e9,0xb6ea,0xb6eb,0xb6ec,0xb6ed, -0xb6ee,0xb6ef,0xb6f1,0xb6f2,0xb6f3,0xb6f5,0xb6f6,0xb6f7, -0xb6f9,0xb6fa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb6fb,0xb6fc,0xb6fd,0xb6fe,0xb6ff,0xb702,0xb703,0xb704, -0xb706,0xb707,0xb708,0xb709,0xb70a,0xb70b,0xb70c,0xb70d, -0xb70e,0xb70f,0xb710,0xb711,0xb712,0xb713,0xb714,0xb715, -0xb716,0xb717,0xb718,0xb719,0xb71a,0xb71b,0xb71c,0xb71d, -0xb71e,0xb71f,0xb720,0xb721,0xb722,0xb723,0xb724,0xb725, -0xb726,0xb727,0xb72a,0xb72b,0xb72d,0xb72e,0xb731,0xb732, -0xb733,0xb734,0xb735,0xb736,0xb737,0xb73a,0xb73c,0xb73d, -0xb73e,0xb73f,0xb740,0xb741,0xb742,0xb743,0xb745,0xb746, -0xb747,0xb749,0xb74a,0xb74b,0xb74d,0xb74e,0xb74f,0xb750, -0xb751,0xb752,0xb753,0xb756,0xb757,0xb758,0xb759,0xb75a, -0xb75b,0xb75c,0xb75d,0xb75e,0xb75f,0xb761,0xb762,0xb763, -0xb765,0xb766,0xb767,0xb769,0xb76a,0xb76b,0xb76c,0xb76d, -0xb76e,0xb76f,0xb772,0xb774,0xb776,0xb777,0xb778,0xb779, -0xb77a,0xb77b,0xb77e,0xb77f,0xb781,0xb782,0xb783,0xb785, -0xb786,0xb787,0xb788,0xb789,0xb78a,0xb78b,0xb78e,0xb793, -0xb794,0xb795,0xb79a,0xb79b,0xb79d,0xb79e,0xb79f,0xb7a1, -0xb7a2,0xb7a3,0xb7a4,0xb7a5,0xb7a6,0xb7a7,0xb7aa,0xb7ae, -0xb7af,0xb7b0,0xb7b1,0xb7b2,0xb7b3,0xb7b6,0xb7b7,0xb7b9, -0xb7ba,0xb7bb,0xb7bc,0xb7bd,0xb7be,0xb7bf,0xb7c0,0xb7c1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb7c2,0xb7c3, -0xb7c4,0xb7c5,0xb7c6,0xb7c8,0xb7ca,0xb7cb,0xb7cc,0xb7cd, -0xb7ce,0xb7cf,0xb7d0,0xb7d1,0xb7d2,0xb7d3,0xb7d4,0xb7d5, -0xb7d6,0xb7d7,0xb7d8,0xb7d9,0xb7da,0xb7db,0xb7dc,0xb7dd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xb7de,0xb7df, -0xb7e0,0xb7e1,0xb7e2,0xb7e3,0xb7e4,0xb7e5,0xb7e6,0xb7e7, -0xb7e8,0xb7e9,0xb7ea,0xb7eb,0xb7ee,0xb7ef,0xb7f1,0xb7f2, -0xb7f3,0xb7f5,0xb7f6,0xb7f7,0xb7f8,0xb7f9,0xb7fa,0xb7fb, -0xb7fe,0xb802,0xb803,0xb804,0xb805,0xb806,0xb80a,0xb80b, -0xb80d,0xb80e,0xb80f,0xb811,0xb812,0xb813,0xb814,0xb815, -0xb816,0xb817,0xb81a,0xb81c,0xb81e,0xb81f,0xb820,0xb821, -0xb822,0xb823,0xb826,0xb827,0xb829,0xb82a,0xb82b,0xb82d, -0xb82e,0xb82f,0xb830,0xb831,0xb832,0xb833,0xb836,0xb83a, -0xb83b,0xb83c,0xb83d,0xb83e,0xb83f,0xb841,0xb842,0xb843, -0xb845,0xb846,0xb847,0xb848,0xb849,0xb84a,0xb84b,0xb84c, -0xb84d,0xb84e,0xb84f,0xb850,0xb852,0xb854,0xb855,0xb856, -0xb857,0xb858,0xb859,0xb85a,0xb85b,0xb85e,0xb85f,0xb861, -0xb862,0xb863,0xb865,0xb866,0xb867,0xb868,0xb869,0xb86a, -0xb86b,0xb86e,0xb870,0xb872,0xb873,0xb874,0xb875,0xb876, -0xb877,0xb879,0xb87a,0xb87b,0xb87d,0xb87e,0xb87f,0xb880, -0xb881,0xb882,0xb883,0xb884,0xb885,0xb886,0xb887,0xb888, -0xb889,0xb88a,0xb88b,0xb88c,0xb88e,0xb88f,0xb890,0xb891, -0xb892,0xb893,0xb894,0xb895,0xb896,0xb897,0xb898,0xb899, -0xb89a,0xb89b,0xb89c,0xb89d,0xb89e,0xb89f,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb8a0,0xb8a1,0xb8a2,0xb8a3, -0xb8a4,0xb8a5,0xb8a6,0xb8a7,0xb8a9,0xb8aa,0xb8ab,0xb8ac, -0xb8ad,0xb8ae,0xb8af,0xb8b1,0xb8b2,0xb8b3,0xb8b5,0xb8b6, -0xb8b7,0xb8b9,0xb8ba,0xb8bb,0xb8bc,0xb8bd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xb8be,0xb8bf,0xb8c2,0xb8c4, -0xb8c6,0xb8c7,0xb8c8,0xb8c9,0xb8ca,0xb8cb,0xb8cd,0xb8ce, -0xb8cf,0xb8d1,0xb8d2,0xb8d3,0xb8d5,0xb8d6,0xb8d7,0xb8d8, -0xb8d9,0xb8da,0xb8db,0xb8dc,0xb8de,0xb8e0,0xb8e2,0xb8e3, -0xb8e4,0xb8e5,0xb8e6,0xb8e7,0xb8ea,0xb8eb,0xb8ed,0xb8ee, -0xb8ef,0xb8f1,0xb8f2,0xb8f3,0xb8f4,0xb8f5,0xb8f6,0xb8f7, -0xb8fa,0xb8fc,0xb8fe,0xb8ff,0xb900,0xb901,0xb902,0xb903, -0xb905,0xb906,0xb907,0xb908,0xb909,0xb90a,0xb90b,0xb90c, -0xb90d,0xb90e,0xb90f,0xb910,0xb911,0xb912,0xb913,0xb914, -0xb915,0xb916,0xb917,0xb919,0xb91a,0xb91b,0xb91c,0xb91d, -0xb91e,0xb91f,0xb921,0xb922,0xb923,0xb924,0xb925,0xb926, -0xb927,0xb928,0xb929,0xb92a,0xb92b,0xb92c,0xb92d,0xb92e, -0xb92f,0xb930,0xb931,0xb932,0xb933,0xb934,0xb935,0xb936, -0xb937,0xb938,0xb939,0xb93a,0xb93b,0xb93e,0xb93f,0xb941, -0xb942,0xb943,0xb945,0xb946,0xb947,0xb948,0xb949,0xb94a, -0xb94b,0xb94d,0xb94e,0xb950,0xb952,0xb953,0xb954,0xb955, -0xb956,0xb957,0xb95a,0xb95b,0xb95d,0xb95e,0xb95f,0xb961, -0xb962,0xb963,0xb964,0xb965,0xb966,0xb967,0xb96a,0xb96c, -0xb96e,0xb96f,0xb970,0xb971,0xb972,0xb973,0xb976,0xb977, -0xb979,0xb97a,0xb97b,0xb97d,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb97e,0xb97f,0xb980,0xb981,0xb982,0xb983, -0xb986,0xb988,0xb98b,0xb98c,0xb98f,0xb990,0xb991,0xb992, -0xb993,0xb994,0xb995,0xb996,0xb997,0xb998,0xb999,0xb99a, -0xb99b,0xb99c,0xb99d,0xb99e,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xb99f,0xb9a0,0xb9a1,0xb9a2,0xb9a3,0xb9a4, -0xb9a5,0xb9a6,0xb9a7,0xb9a8,0xb9a9,0xb9aa,0xb9ab,0xb9ae, -0xb9af,0xb9b1,0xb9b2,0xb9b3,0xb9b5,0xb9b6,0xb9b7,0xb9b8, -0xb9b9,0xb9ba,0xb9bb,0xb9be,0xb9c0,0xb9c2,0xb9c3,0xb9c4, -0xb9c5,0xb9c6,0xb9c7,0xb9ca,0xb9cb,0xb9cd,0xb9d3,0xb9d4, -0xb9d5,0xb9d6,0xb9d7,0xb9da,0xb9dc,0xb9df,0xb9e0,0xb9e2, -0xb9e6,0xb9e7,0xb9e9,0xb9ea,0xb9eb,0xb9ed,0xb9ee,0xb9ef, -0xb9f0,0xb9f1,0xb9f2,0xb9f3,0xb9f6,0xb9fb,0xb9fc,0xb9fd, -0xb9fe,0xb9ff,0xba02,0xba03,0xba04,0xba05,0xba06,0xba07, -0xba09,0xba0a,0xba0b,0xba0c,0xba0d,0xba0e,0xba0f,0xba10, -0xba11,0xba12,0xba13,0xba14,0xba16,0xba17,0xba18,0xba19, -0xba1a,0xba1b,0xba1c,0xba1d,0xba1e,0xba1f,0xba20,0xba21, -0xba22,0xba23,0xba24,0xba25,0xba26,0xba27,0xba28,0xba29, -0xba2a,0xba2b,0xba2c,0xba2d,0xba2e,0xba2f,0xba30,0xba31, -0xba32,0xba33,0xba34,0xba35,0xba36,0xba37,0xba3a,0xba3b, -0xba3d,0xba3e,0xba3f,0xba41,0xba43,0xba44,0xba45,0xba46, -0xba47,0xba4a,0xba4c,0xba4f,0xba50,0xba51,0xba52,0xba56, -0xba57,0xba59,0xba5a,0xba5b,0xba5d,0xba5e,0xba5f,0xba60, -0xba61,0xba62,0xba63,0xba66,0xba6a,0xba6b,0xba6c,0xba6d, -0xba6e,0xba6f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xba72,0xba73,0xba75,0xba76,0xba77,0xba79,0xba7a,0xba7b, -0xba7c,0xba7d,0xba7e,0xba7f,0xba80,0xba81,0xba82,0xba86, -0xba88,0xba89,0xba8a,0xba8b,0xba8d,0xba8e,0xba8f,0xba90, -0xba91,0xba92,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xba93,0xba94,0xba95,0xba96,0xba97,0xba98,0xba99,0xba9a, -0xba9b,0xba9c,0xba9d,0xba9e,0xba9f,0xbaa0,0xbaa1,0xbaa2, -0xbaa3,0xbaa4,0xbaa5,0xbaa6,0xbaa7,0xbaaa,0xbaad,0xbaae, -0xbaaf,0xbab1,0xbab3,0xbab4,0xbab5,0xbab6,0xbab7,0xbaba, -0xbabc,0xbabe,0xbabf,0xbac0,0xbac1,0xbac2,0xbac3,0xbac5, -0xbac6,0xbac7,0xbac9,0xbaca,0xbacb,0xbacc,0xbacd,0xbace, -0xbacf,0xbad0,0xbad1,0xbad2,0xbad3,0xbad4,0xbad5,0xbad6, -0xbad7,0xbada,0xbadb,0xbadc,0xbadd,0xbade,0xbadf,0xbae0, -0xbae1,0xbae2,0xbae3,0xbae4,0xbae5,0xbae6,0xbae7,0xbae8, -0xbae9,0xbaea,0xbaeb,0xbaec,0xbaed,0xbaee,0xbaef,0xbaf0, -0xbaf1,0xbaf2,0xbaf3,0xbaf4,0xbaf5,0xbaf6,0xbaf7,0xbaf8, -0xbaf9,0xbafa,0xbafb,0xbafd,0xbafe,0xbaff,0xbb01,0xbb02, -0xbb03,0xbb05,0xbb06,0xbb07,0xbb08,0xbb09,0xbb0a,0xbb0b, -0xbb0c,0xbb0e,0xbb10,0xbb12,0xbb13,0xbb14,0xbb15,0xbb16, -0xbb17,0xbb19,0xbb1a,0xbb1b,0xbb1d,0xbb1e,0xbb1f,0xbb21, -0xbb22,0xbb23,0xbb24,0xbb25,0xbb26,0xbb27,0xbb28,0xbb2a, -0xbb2c,0xbb2d,0xbb2e,0xbb2f,0xbb30,0xbb31,0xbb32,0xbb33, -0xbb37,0xbb39,0xbb3a,0xbb3f,0xbb40,0xbb41,0xbb42,0xbb43, -0xbb46,0xbb48,0xbb4a,0xbb4b,0xbb4c,0xbb4e,0xbb51,0xbb52, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xbb53,0xbb55, -0xbb56,0xbb57,0xbb59,0xbb5a,0xbb5b,0xbb5c,0xbb5d,0xbb5e, -0xbb5f,0xbb60,0xbb62,0xbb64,0xbb65,0xbb66,0xbb67,0xbb68, -0xbb69,0xbb6a,0xbb6b,0xbb6d,0xbb6e,0xbb6f,0xbb70,0xbb71, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xbb72,0xbb73, -0xbb74,0xbb75,0xbb76,0xbb77,0xbb78,0xbb79,0xbb7a,0xbb7b, -0xbb7c,0xbb7d,0xbb7e,0xbb7f,0xbb80,0xbb81,0xbb82,0xbb83, -0xbb84,0xbb85,0xbb86,0xbb87,0xbb89,0xbb8a,0xbb8b,0xbb8d, -0xbb8e,0xbb8f,0xbb91,0xbb92,0xbb93,0xbb94,0xbb95,0xbb96, -0xbb97,0xbb98,0xbb99,0xbb9a,0xbb9b,0xbb9c,0xbb9d,0xbb9e, -0xbb9f,0xbba0,0xbba1,0xbba2,0xbba3,0xbba5,0xbba6,0xbba7, -0xbba9,0xbbaa,0xbbab,0xbbad,0xbbae,0xbbaf,0xbbb0,0xbbb1, -0xbbb2,0xbbb3,0xbbb5,0xbbb6,0xbbb8,0xbbb9,0xbbba,0xbbbb, -0xbbbc,0xbbbd,0xbbbe,0xbbbf,0xbbc1,0xbbc2,0xbbc3,0xbbc5, -0xbbc6,0xbbc7,0xbbc9,0xbbca,0xbbcb,0xbbcc,0xbbcd,0xbbce, -0xbbcf,0xbbd1,0xbbd2,0xbbd4,0xbbd5,0xbbd6,0xbbd7,0xbbd8, -0xbbd9,0xbbda,0xbbdb,0xbbdc,0xbbdd,0xbbde,0xbbdf,0xbbe0, -0xbbe1,0xbbe2,0xbbe3,0xbbe4,0xbbe5,0xbbe6,0xbbe7,0xbbe8, -0xbbe9,0xbbea,0xbbeb,0xbbec,0xbbed,0xbbee,0xbbef,0xbbf0, -0xbbf1,0xbbf2,0xbbf3,0xbbf4,0xbbf5,0xbbf6,0xbbf7,0xbbfa, -0xbbfb,0xbbfd,0xbbfe,0xbc01,0xbc03,0xbc04,0xbc05,0xbc06, -0xbc07,0xbc0a,0xbc0e,0xbc10,0xbc12,0xbc13,0xbc19,0xbc1a, -0xbc20,0xbc21,0xbc22,0xbc23,0xbc26,0xbc28,0xbc2a,0xbc2b, -0xbc2c,0xbc2e,0xbc2f,0xbc32,0xbc33,0xbc35,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbc36,0xbc37,0xbc39,0xbc3a, -0xbc3b,0xbc3c,0xbc3d,0xbc3e,0xbc3f,0xbc42,0xbc46,0xbc47, -0xbc48,0xbc4a,0xbc4b,0xbc4e,0xbc4f,0xbc51,0xbc52,0xbc53, -0xbc54,0xbc55,0xbc56,0xbc57,0xbc58,0xbc59,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbc5a,0xbc5b,0xbc5c,0xbc5e, -0xbc5f,0xbc60,0xbc61,0xbc62,0xbc63,0xbc64,0xbc65,0xbc66, -0xbc67,0xbc68,0xbc69,0xbc6a,0xbc6b,0xbc6c,0xbc6d,0xbc6e, -0xbc6f,0xbc70,0xbc71,0xbc72,0xbc73,0xbc74,0xbc75,0xbc76, -0xbc77,0xbc78,0xbc79,0xbc7a,0xbc7b,0xbc7c,0xbc7d,0xbc7e, -0xbc7f,0xbc80,0xbc81,0xbc82,0xbc83,0xbc86,0xbc87,0xbc89, -0xbc8a,0xbc8d,0xbc8f,0xbc90,0xbc91,0xbc92,0xbc93,0xbc96, -0xbc98,0xbc9b,0xbc9c,0xbc9d,0xbc9e,0xbc9f,0xbca2,0xbca3, -0xbca5,0xbca6,0xbca9,0xbcaa,0xbcab,0xbcac,0xbcad,0xbcae, -0xbcaf,0xbcb2,0xbcb6,0xbcb7,0xbcb8,0xbcb9,0xbcba,0xbcbb, -0xbcbe,0xbcbf,0xbcc1,0xbcc2,0xbcc3,0xbcc5,0xbcc6,0xbcc7, -0xbcc8,0xbcc9,0xbcca,0xbccb,0xbccc,0xbcce,0xbcd2,0xbcd3, -0xbcd4,0xbcd6,0xbcd7,0xbcd9,0xbcda,0xbcdb,0xbcdd,0xbcde, -0xbcdf,0xbce0,0xbce1,0xbce2,0xbce3,0xbce4,0xbce5,0xbce6, -0xbce7,0xbce8,0xbce9,0xbcea,0xbceb,0xbcec,0xbced,0xbcee, -0xbcef,0xbcf0,0xbcf1,0xbcf2,0xbcf3,0xbcf7,0xbcf9,0xbcfa, -0xbcfb,0xbcfd,0xbcfe,0xbcff,0xbd00,0xbd01,0xbd02,0xbd03, -0xbd06,0xbd08,0xbd0a,0xbd0b,0xbd0c,0xbd0d,0xbd0e,0xbd0f, -0xbd11,0xbd12,0xbd13,0xbd15,0xbd16,0xbd17,0xbd18,0xbd19, -0xbd1a,0xbd1b,0xbd1c,0xbd1d,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xbd1e,0xbd1f,0xbd20,0xbd21,0xbd22,0xbd23, -0xbd25,0xbd26,0xbd27,0xbd28,0xbd29,0xbd2a,0xbd2b,0xbd2d, -0xbd2e,0xbd2f,0xbd30,0xbd31,0xbd32,0xbd33,0xbd34,0xbd35, -0xbd36,0xbd37,0xbd38,0xbd39,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xbd3a,0xbd3b,0xbd3c,0xbd3d,0xbd3e,0xbd3f, -0xbd41,0xbd42,0xbd43,0xbd44,0xbd45,0xbd46,0xbd47,0xbd4a, -0xbd4b,0xbd4d,0xbd4e,0xbd4f,0xbd51,0xbd52,0xbd53,0xbd54, -0xbd55,0xbd56,0xbd57,0xbd5a,0xbd5b,0xbd5c,0xbd5d,0xbd5e, -0xbd5f,0xbd60,0xbd61,0xbd62,0xbd63,0xbd65,0xbd66,0xbd67, -0xbd69,0xbd6a,0xbd6b,0xbd6c,0xbd6d,0xbd6e,0xbd6f,0xbd70, -0xbd71,0xbd72,0xbd73,0xbd74,0xbd75,0xbd76,0xbd77,0xbd78, -0xbd79,0xbd7a,0xbd7b,0xbd7c,0xbd7d,0xbd7e,0xbd7f,0xbd82, -0xbd83,0xbd85,0xbd86,0xbd8b,0xbd8c,0xbd8d,0xbd8e,0xbd8f, -0xbd92,0xbd94,0xbd96,0xbd97,0xbd98,0xbd9b,0xbd9d,0xbd9e, -0xbd9f,0xbda0,0xbda1,0xbda2,0xbda3,0xbda5,0xbda6,0xbda7, -0xbda8,0xbda9,0xbdaa,0xbdab,0xbdac,0xbdad,0xbdae,0xbdaf, -0xbdb1,0xbdb2,0xbdb3,0xbdb4,0xbdb5,0xbdb6,0xbdb7,0xbdb9, -0xbdba,0xbdbb,0xbdbc,0xbdbd,0xbdbe,0xbdbf,0xbdc0,0xbdc1, -0xbdc2,0xbdc3,0xbdc4,0xbdc5,0xbdc6,0xbdc7,0xbdc8,0xbdc9, -0xbdca,0xbdcb,0xbdcc,0xbdcd,0xbdce,0xbdcf,0xbdd0,0xbdd1, -0xbdd2,0xbdd3,0xbdd6,0xbdd7,0xbdd9,0xbdda,0xbddb,0xbddd, -0xbdde,0xbddf,0xbde0,0xbde1,0xbde2,0xbde3,0xbde4,0xbde5, -0xbde6,0xbde7,0xbde8,0xbdea,0xbdeb,0xbdec,0xbded,0xbdee, -0xbdef,0xbdf1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xbdf2,0xbdf3,0xbdf5,0xbdf6,0xbdf7,0xbdf9,0xbdfa,0xbdfb, -0xbdfc,0xbdfd,0xbdfe,0xbdff,0xbe01,0xbe02,0xbe04,0xbe06, -0xbe07,0xbe08,0xbe09,0xbe0a,0xbe0b,0xbe0e,0xbe0f,0xbe11, -0xbe12,0xbe13,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xbe15,0xbe16,0xbe17,0xbe18,0xbe19,0xbe1a,0xbe1b,0xbe1e, -0xbe20,0xbe21,0xbe22,0xbe23,0xbe24,0xbe25,0xbe26,0xbe27, -0xbe28,0xbe29,0xbe2a,0xbe2b,0xbe2c,0xbe2d,0xbe2e,0xbe2f, -0xbe30,0xbe31,0xbe32,0xbe33,0xbe34,0xbe35,0xbe36,0xbe37, -0xbe38,0xbe39,0xbe3a,0xbe3b,0xbe3c,0xbe3d,0xbe3e,0xbe3f, -0xbe40,0xbe41,0xbe42,0xbe43,0xbe46,0xbe47,0xbe49,0xbe4a, -0xbe4b,0xbe4d,0xbe4f,0xbe50,0xbe51,0xbe52,0xbe53,0xbe56, -0xbe58,0xbe5c,0xbe5d,0xbe5e,0xbe5f,0xbe62,0xbe63,0xbe65, -0xbe66,0xbe67,0xbe69,0xbe6b,0xbe6c,0xbe6d,0xbe6e,0xbe6f, -0xbe72,0xbe76,0xbe77,0xbe78,0xbe79,0xbe7a,0xbe7e,0xbe7f, -0xbe81,0xbe82,0xbe83,0xbe85,0xbe86,0xbe87,0xbe88,0xbe89, -0xbe8a,0xbe8b,0xbe8e,0xbe92,0xbe93,0xbe94,0xbe95,0xbe96, -0xbe97,0xbe9a,0xbe9b,0xbe9c,0xbe9d,0xbe9e,0xbe9f,0xbea0, -0xbea1,0xbea2,0xbea3,0xbea4,0xbea5,0xbea6,0xbea7,0xbea9, -0xbeaa,0xbeab,0xbeac,0xbead,0xbeae,0xbeaf,0xbeb0,0xbeb1, -0xbeb2,0xbeb3,0xbeb4,0xbeb5,0xbeb6,0xbeb7,0xbeb8,0xbeb9, -0xbeba,0xbebb,0xbebc,0xbebd,0xbebe,0xbebf,0xbec0,0xbec1, -0xbec2,0xbec3,0xbec4,0xbec5,0xbec6,0xbec7,0xbec8,0xbec9, -0xbeca,0xbecb,0xbecc,0xbecd,0xbece,0xbecf,0xbed2,0xbed3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xbed5,0xbed6, -0xbed9,0xbeda,0xbedb,0xbedc,0xbedd,0xbede,0xbedf,0xbee1, -0xbee2,0xbee6,0xbee7,0xbee8,0xbee9,0xbeea,0xbeeb,0xbeed, -0xbeee,0xbeef,0xbef0,0xbef1,0xbef2,0xbef3,0xbef4,0xbef5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xbef6,0xbef7, -0xbef8,0xbef9,0xbefa,0xbefb,0xbefc,0xbefd,0xbefe,0xbeff, -0xbf00,0xbf02,0xbf03,0xbf04,0xbf05,0xbf06,0xbf07,0xbf0a, -0xbf0b,0xbf0c,0xbf0d,0xbf0e,0xbf0f,0xbf10,0xbf11,0xbf12, -0xbf13,0xbf14,0xbf15,0xbf16,0xbf17,0xbf1a,0xbf1e,0xbf1f, -0xbf20,0xbf21,0xbf22,0xbf23,0xbf24,0xbf25,0xbf26,0xbf27, -0xbf28,0xbf29,0xbf2a,0xbf2b,0xbf2c,0xbf2d,0xbf2e,0xbf2f, -0xbf30,0xbf31,0xbf32,0xbf33,0xbf34,0xbf35,0xbf36,0xbf37, -0xbf38,0xbf39,0xbf3a,0xbf3b,0xbf3c,0xbf3d,0xbf3e,0xbf3f, -0xbf42,0xbf43,0xbf45,0xbf46,0xbf47,0xbf49,0xbf4a,0xbf4b, -0xbf4c,0xbf4d,0xbf4e,0xbf4f,0xbf52,0xbf53,0xbf54,0xbf56, -0xbf57,0xbf58,0xbf59,0xbf5a,0xbf5b,0xbf5c,0xbf5d,0xbf5e, -0xbf5f,0xbf60,0xbf61,0xbf62,0xbf63,0xbf64,0xbf65,0xbf66, -0xbf67,0xbf68,0xbf69,0xbf6a,0xbf6b,0xbf6c,0xbf6d,0xbf6e, -0xbf6f,0xbf70,0xbf71,0xbf72,0xbf73,0xbf74,0xbf75,0xbf76, -0xbf77,0xbf78,0xbf79,0xbf7a,0xbf7b,0xbf7c,0xbf7d,0xbf7e, -0xbf7f,0xbf80,0xbf81,0xbf82,0xbf83,0xbf84,0xbf85,0xbf86, -0xbf87,0xbf88,0xbf89,0xbf8a,0xbf8b,0xbf8c,0xbf8d,0xbf8e, -0xbf8f,0xbf90,0xbf91,0xbf92,0xbf93,0xbf95,0xbf96,0xbf97, -0xbf98,0xbf99,0xbf9a,0xbf9b,0xbf9c,0xbf9d,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbf9e,0xbf9f,0xbfa0,0xbfa1, -0xbfa2,0xbfa3,0xbfa4,0xbfa5,0xbfa6,0xbfa7,0xbfa8,0xbfa9, -0xbfaa,0xbfab,0xbfac,0xbfad,0xbfae,0xbfaf,0xbfb1,0xbfb2, -0xbfb3,0xbfb4,0xbfb5,0xbfb6,0xbfb7,0xbfb8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xbfb9,0xbfba,0xbfbb,0xbfbc, -0xbfbd,0xbfbe,0xbfbf,0xbfc0,0xbfc1,0xbfc2,0xbfc3,0xbfc4, -0xbfc6,0xbfc7,0xbfc8,0xbfc9,0xbfca,0xbfcb,0xbfce,0xbfcf, -0xbfd1,0xbfd2,0xbfd3,0xbfd5,0xbfd6,0xbfd7,0xbfd8,0xbfd9, -0xbfda,0xbfdb,0xbfdd,0xbfde,0xbfe0,0xbfe2,0xbfe3,0xbfe4, -0xbfe5,0xbfe6,0xbfe7,0xbfe8,0xbfe9,0xbfea,0xbfeb,0xbfec, -0xbfed,0xbfee,0xbfef,0xbff0,0xbff1,0xbff2,0xbff3,0xbff4, -0xbff5,0xbff6,0xbff7,0xbff8,0xbff9,0xbffa,0xbffb,0xbffc, -0xbffd,0xbffe,0xbfff,0xc000,0xc001,0xc002,0xc003,0xc004, -0xc005,0xc006,0xc007,0xc008,0xc009,0xc00a,0xc00b,0xc00c, -0xc00d,0xc00e,0xc00f,0xc010,0xc011,0xc012,0xc013,0xc014, -0xc015,0xc016,0xc017,0xc018,0xc019,0xc01a,0xc01b,0xc01c, -0xc01d,0xc01e,0xc01f,0xc020,0xc021,0xc022,0xc023,0xc024, -0xc025,0xc026,0xc027,0xc028,0xc029,0xc02a,0xc02b,0xc02c, -0xc02d,0xc02e,0xc02f,0xc030,0xc031,0xc032,0xc033,0xc034, -0xc035,0xc036,0xc037,0xc038,0xc039,0xc03a,0xc03b,0xc03d, -0xc03e,0xc03f,0xc040,0xc041,0xc042,0xc043,0xc044,0xc045, -0xc046,0xc047,0xc048,0xc049,0xc04a,0xc04b,0xc04c,0xc04d, -0xc04e,0xc04f,0xc050,0xc052,0xc053,0xc054,0xc055,0xc056, -0xc057,0xc059,0xc05a,0xc05b,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc05d,0xc05e,0xc05f,0xc061,0xc062,0xc063, -0xc064,0xc065,0xc066,0xc067,0xc06a,0xc06b,0xc06c,0xc06d, -0xc06e,0xc06f,0xc070,0xc071,0xc072,0xc073,0xc074,0xc075, -0xc076,0xc077,0xc078,0xc079,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc07a,0xc07b,0xc07c,0xc07d,0xc07e,0xc07f, -0xc080,0xc081,0xc082,0xc083,0xc084,0xc085,0xc086,0xc087, -0xc088,0xc089,0xc08a,0xc08b,0xc08c,0xc08d,0xc08e,0xc08f, -0xc092,0xc093,0xc095,0xc096,0xc097,0xc099,0xc09a,0xc09b, -0xc09c,0xc09d,0xc09e,0xc09f,0xc0a2,0xc0a4,0xc0a6,0xc0a7, -0xc0a8,0xc0a9,0xc0aa,0xc0ab,0xc0ae,0xc0b1,0xc0b2,0xc0b7, -0xc0b8,0xc0b9,0xc0ba,0xc0bb,0xc0be,0xc0c2,0xc0c3,0xc0c4, -0xc0c6,0xc0c7,0xc0ca,0xc0cb,0xc0cd,0xc0ce,0xc0cf,0xc0d1, -0xc0d2,0xc0d3,0xc0d4,0xc0d5,0xc0d6,0xc0d7,0xc0da,0xc0de, -0xc0df,0xc0e0,0xc0e1,0xc0e2,0xc0e3,0xc0e6,0xc0e7,0xc0e9, -0xc0ea,0xc0eb,0xc0ed,0xc0ee,0xc0ef,0xc0f0,0xc0f1,0xc0f2, -0xc0f3,0xc0f6,0xc0f8,0xc0fa,0xc0fb,0xc0fc,0xc0fd,0xc0fe, -0xc0ff,0xc101,0xc102,0xc103,0xc105,0xc106,0xc107,0xc109, -0xc10a,0xc10b,0xc10c,0xc10d,0xc10e,0xc10f,0xc111,0xc112, -0xc113,0xc114,0xc116,0xc117,0xc118,0xc119,0xc11a,0xc11b, -0xc121,0xc122,0xc125,0xc128,0xc129,0xc12a,0xc12b,0xc12e, -0xc132,0xc133,0xc134,0xc135,0xc137,0xc13a,0xc13b,0xc13d, -0xc13e,0xc13f,0xc141,0xc142,0xc143,0xc144,0xc145,0xc146, -0xc147,0xc14a,0xc14e,0xc14f,0xc150,0xc151,0xc152,0xc153, -0xc156,0xc157,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc159,0xc15a,0xc15b,0xc15d,0xc15e,0xc15f,0xc160,0xc161, -0xc162,0xc163,0xc166,0xc16a,0xc16b,0xc16c,0xc16d,0xc16e, -0xc16f,0xc171,0xc172,0xc173,0xc175,0xc176,0xc177,0xc179, -0xc17a,0xc17b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc17c,0xc17d,0xc17e,0xc17f,0xc180,0xc181,0xc182,0xc183, -0xc184,0xc186,0xc187,0xc188,0xc189,0xc18a,0xc18b,0xc18f, -0xc191,0xc192,0xc193,0xc195,0xc197,0xc198,0xc199,0xc19a, -0xc19b,0xc19e,0xc1a0,0xc1a2,0xc1a3,0xc1a4,0xc1a6,0xc1a7, -0xc1aa,0xc1ab,0xc1ad,0xc1ae,0xc1af,0xc1b1,0xc1b2,0xc1b3, -0xc1b4,0xc1b5,0xc1b6,0xc1b7,0xc1b8,0xc1b9,0xc1ba,0xc1bb, -0xc1bc,0xc1be,0xc1bf,0xc1c0,0xc1c1,0xc1c2,0xc1c3,0xc1c5, -0xc1c6,0xc1c7,0xc1c9,0xc1ca,0xc1cb,0xc1cd,0xc1ce,0xc1cf, -0xc1d0,0xc1d1,0xc1d2,0xc1d3,0xc1d5,0xc1d6,0xc1d9,0xc1da, -0xc1db,0xc1dc,0xc1dd,0xc1de,0xc1df,0xc1e1,0xc1e2,0xc1e3, -0xc1e5,0xc1e6,0xc1e7,0xc1e9,0xc1ea,0xc1eb,0xc1ec,0xc1ed, -0xc1ee,0xc1ef,0xc1f2,0xc1f4,0xc1f5,0xc1f6,0xc1f7,0xc1f8, -0xc1f9,0xc1fa,0xc1fb,0xc1fe,0xc1ff,0xc201,0xc202,0xc203, -0xc205,0xc206,0xc207,0xc208,0xc209,0xc20a,0xc20b,0xc20e, -0xc210,0xc212,0xc213,0xc214,0xc215,0xc216,0xc217,0xc21a, -0xc21b,0xc21d,0xc21e,0xc221,0xc222,0xc223,0xc224,0xc225, -0xc226,0xc227,0xc22a,0xc22c,0xc22e,0xc230,0xc233,0xc235, -0xc236,0xc237,0xc238,0xc239,0xc23a,0xc23b,0xc23c,0xc23d, -0xc23e,0xc23f,0xc240,0xc241,0xc242,0xc243,0xc244,0xc245, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc246,0xc247, -0xc249,0xc24a,0xc24b,0xc24c,0xc24d,0xc24e,0xc24f,0xc252, -0xc253,0xc255,0xc256,0xc257,0xc259,0xc25a,0xc25b,0xc25c, -0xc25d,0xc25e,0xc25f,0xc261,0xc262,0xc263,0xc264,0xc266, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc267,0xc268, -0xc269,0xc26a,0xc26b,0xc26e,0xc26f,0xc271,0xc272,0xc273, -0xc275,0xc276,0xc277,0xc278,0xc279,0xc27a,0xc27b,0xc27e, -0xc280,0xc282,0xc283,0xc284,0xc285,0xc286,0xc287,0xc28a, -0xc28b,0xc28c,0xc28d,0xc28e,0xc28f,0xc291,0xc292,0xc293, -0xc294,0xc295,0xc296,0xc297,0xc299,0xc29a,0xc29c,0xc29e, -0xc29f,0xc2a0,0xc2a1,0xc2a2,0xc2a3,0xc2a6,0xc2a7,0xc2a9, -0xc2aa,0xc2ab,0xc2ae,0xc2af,0xc2b0,0xc2b1,0xc2b2,0xc2b3, -0xc2b6,0xc2b8,0xc2ba,0xc2bb,0xc2bc,0xc2bd,0xc2be,0xc2bf, -0xc2c0,0xc2c1,0xc2c2,0xc2c3,0xc2c4,0xc2c5,0xc2c6,0xc2c7, -0xc2c8,0xc2c9,0xc2ca,0xc2cb,0xc2cc,0xc2cd,0xc2ce,0xc2cf, -0xc2d0,0xc2d1,0xc2d2,0xc2d3,0xc2d4,0xc2d5,0xc2d6,0xc2d7, -0xc2d8,0xc2d9,0xc2da,0xc2db,0xc2de,0xc2df,0xc2e1,0xc2e2, -0xc2e5,0xc2e6,0xc2e7,0xc2e8,0xc2e9,0xc2ea,0xc2ee,0xc2f0, -0xc2f2,0xc2f3,0xc2f4,0xc2f5,0xc2f7,0xc2fa,0xc2fd,0xc2fe, -0xc2ff,0xc301,0xc302,0xc303,0xc304,0xc305,0xc306,0xc307, -0xc30a,0xc30b,0xc30e,0xc30f,0xc310,0xc311,0xc312,0xc316, -0xc317,0xc319,0xc31a,0xc31b,0xc31d,0xc31e,0xc31f,0xc320, -0xc321,0xc322,0xc323,0xc326,0xc327,0xc32a,0xc32b,0xc32c, -0xc32d,0xc32e,0xc32f,0xc330,0xc331,0xc332,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc333,0xc334,0xc335,0xc336, -0xc337,0xc338,0xc339,0xc33a,0xc33b,0xc33c,0xc33d,0xc33e, -0xc33f,0xc340,0xc341,0xc342,0xc343,0xc344,0xc346,0xc347, -0xc348,0xc349,0xc34a,0xc34b,0xc34c,0xc34d,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc34e,0xc34f,0xc350,0xc351, -0xc352,0xc353,0xc354,0xc355,0xc356,0xc357,0xc358,0xc359, -0xc35a,0xc35b,0xc35c,0xc35d,0xc35e,0xc35f,0xc360,0xc361, -0xc362,0xc363,0xc364,0xc365,0xc366,0xc367,0xc36a,0xc36b, -0xc36d,0xc36e,0xc36f,0xc371,0xc373,0xc374,0xc375,0xc376, -0xc377,0xc37a,0xc37b,0xc37e,0xc37f,0xc380,0xc381,0xc382, -0xc383,0xc385,0xc386,0xc387,0xc389,0xc38a,0xc38b,0xc38d, -0xc38e,0xc38f,0xc390,0xc391,0xc392,0xc393,0xc394,0xc395, -0xc396,0xc397,0xc398,0xc399,0xc39a,0xc39b,0xc39c,0xc39d, -0xc39e,0xc39f,0xc3a0,0xc3a1,0xc3a2,0xc3a3,0xc3a4,0xc3a5, -0xc3a6,0xc3a7,0xc3a8,0xc3a9,0xc3aa,0xc3ab,0xc3ac,0xc3ad, -0xc3ae,0xc3af,0xc3b0,0xc3b1,0xc3b2,0xc3b3,0xc3b4,0xc3b5, -0xc3b6,0xc3b7,0xc3b8,0xc3b9,0xc3ba,0xc3bb,0xc3bc,0xc3bd, -0xc3be,0xc3bf,0xc3c1,0xc3c2,0xc3c3,0xc3c4,0xc3c5,0xc3c6, -0xc3c7,0xc3c8,0xc3c9,0xc3ca,0xc3cb,0xc3cc,0xc3cd,0xc3ce, -0xc3cf,0xc3d0,0xc3d1,0xc3d2,0xc3d3,0xc3d4,0xc3d5,0xc3d6, -0xc3d7,0xc3da,0xc3db,0xc3dd,0xc3de,0xc3e1,0xc3e3,0xc3e4, -0xc3e5,0xc3e6,0xc3e7,0xc3ea,0xc3eb,0xc3ec,0xc3ee,0xc3ef, -0xc3f0,0xc3f1,0xc3f2,0xc3f3,0xc3f6,0xc3f7,0xc3f9,0xc3fa, -0xc3fb,0xc3fc,0xc3fd,0xc3fe,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc3ff,0xc400,0xc401,0xc402,0xc403,0xc404, -0xc405,0xc406,0xc407,0xc409,0xc40a,0xc40b,0xc40c,0xc40d, -0xc40e,0xc40f,0xc411,0xc412,0xc413,0xc414,0xc415,0xc416, -0xc417,0xc418,0xc419,0xc41a,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc41b,0xc41c,0xc41d,0xc41e,0xc41f,0xc420, -0xc421,0xc422,0xc423,0xc425,0xc426,0xc427,0xc428,0xc429, -0xc42a,0xc42b,0xc42d,0xc42e,0xc42f,0xc431,0xc432,0xc433, -0xc435,0xc436,0xc437,0xc438,0xc439,0xc43a,0xc43b,0xc43e, -0xc43f,0xc440,0xc441,0xc442,0xc443,0xc444,0xc445,0xc446, -0xc447,0xc449,0xc44a,0xc44b,0xc44c,0xc44d,0xc44e,0xc44f, -0xc450,0xc451,0xc452,0xc453,0xc454,0xc455,0xc456,0xc457, -0xc458,0xc459,0xc45a,0xc45b,0xc45c,0xc45d,0xc45e,0xc45f, -0xc460,0xc461,0xc462,0xc463,0xc466,0xc467,0xc469,0xc46a, -0xc46b,0xc46d,0xc46e,0xc46f,0xc470,0xc471,0xc472,0xc473, -0xc476,0xc477,0xc478,0xc47a,0xc47b,0xc47c,0xc47d,0xc47e, -0xc47f,0xc481,0xc482,0xc483,0xc484,0xc485,0xc486,0xc487, -0xc488,0xc489,0xc48a,0xc48b,0xc48c,0xc48d,0xc48e,0xc48f, -0xc490,0xc491,0xc492,0xc493,0xc495,0xc496,0xc497,0xc498, -0xc499,0xc49a,0xc49b,0xc49d,0xc49e,0xc49f,0xc4a0,0xc4a1, -0xc4a2,0xc4a3,0xc4a4,0xc4a5,0xc4a6,0xc4a7,0xc4a8,0xc4a9, -0xc4aa,0xc4ab,0xc4ac,0xc4ad,0xc4ae,0xc4af,0xc4b0,0xc4b1, -0xc4b2,0xc4b3,0xc4b4,0xc4b5,0xc4b6,0xc4b7,0xc4b9,0xc4ba, -0xc4bb,0xc4bd,0xc4be,0xc4bf,0xc4c0,0xc4c1,0xc4c2,0xc4c3, -0xc4c4,0xc4c5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc4c6,0xc4c7,0xc4c8,0xc4c9,0xc4ca,0xc4cb,0xc4cc,0xc4cd, -0xc4ce,0xc4cf,0xc4d0,0xc4d1,0xc4d2,0xc4d3,0xc4d4,0xc4d5, -0xc4d6,0xc4d7,0xc4d8,0xc4d9,0xc4da,0xc4db,0xc4dc,0xc4dd, -0xc4de,0xc4df,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc4e0,0xc4e1,0xc4e2,0xc4e3,0xc4e4,0xc4e5,0xc4e6,0xc4e7, -0xc4e8,0xc4ea,0xc4eb,0xc4ec,0xc4ed,0xc4ee,0xc4ef,0xc4f2, -0xc4f3,0xc4f5,0xc4f6,0xc4f7,0xc4f9,0xc4fb,0xc4fc,0xc4fd, -0xc4fe,0xc502,0xc503,0xc504,0xc505,0xc506,0xc507,0xc508, -0xc509,0xc50a,0xc50b,0xc50d,0xc50e,0xc50f,0xc511,0xc512, -0xc513,0xc515,0xc516,0xc517,0xc518,0xc519,0xc51a,0xc51b, -0xc51d,0xc51e,0xc51f,0xc520,0xc521,0xc522,0xc523,0xc524, -0xc525,0xc526,0xc527,0xc52a,0xc52b,0xc52d,0xc52e,0xc52f, -0xc531,0xc532,0xc533,0xc534,0xc535,0xc536,0xc537,0xc53a, -0xc53c,0xc53e,0xc53f,0xc540,0xc541,0xc542,0xc543,0xc546, -0xc547,0xc54b,0xc54f,0xc550,0xc551,0xc552,0xc556,0xc55a, -0xc55b,0xc55c,0xc55f,0xc562,0xc563,0xc565,0xc566,0xc567, -0xc569,0xc56a,0xc56b,0xc56c,0xc56d,0xc56e,0xc56f,0xc572, -0xc576,0xc577,0xc578,0xc579,0xc57a,0xc57b,0xc57e,0xc57f, -0xc581,0xc582,0xc583,0xc585,0xc586,0xc588,0xc589,0xc58a, -0xc58b,0xc58e,0xc590,0xc592,0xc593,0xc594,0xc596,0xc599, -0xc59a,0xc59b,0xc59d,0xc59e,0xc59f,0xc5a1,0xc5a2,0xc5a3, -0xc5a4,0xc5a5,0xc5a6,0xc5a7,0xc5a8,0xc5aa,0xc5ab,0xc5ac, -0xc5ad,0xc5ae,0xc5af,0xc5b0,0xc5b1,0xc5b2,0xc5b3,0xc5b6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc5b7,0xc5ba, -0xc5bf,0xc5c0,0xc5c1,0xc5c2,0xc5c3,0xc5cb,0xc5cd,0xc5cf, -0xc5d2,0xc5d3,0xc5d5,0xc5d6,0xc5d7,0xc5d9,0xc5da,0xc5db, -0xc5dc,0xc5dd,0xc5de,0xc5df,0xc5e2,0xc5e4,0xc5e6,0xc5e7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc5e8,0xc5e9, -0xc5ea,0xc5eb,0xc5ef,0xc5f1,0xc5f2,0xc5f3,0xc5f5,0xc5f8, -0xc5f9,0xc5fa,0xc5fb,0xc602,0xc603,0xc604,0xc609,0xc60a, -0xc60b,0xc60d,0xc60e,0xc60f,0xc611,0xc612,0xc613,0xc614, -0xc615,0xc616,0xc617,0xc61a,0xc61d,0xc61e,0xc61f,0xc620, -0xc621,0xc622,0xc623,0xc626,0xc627,0xc629,0xc62a,0xc62b, -0xc62f,0xc631,0xc632,0xc636,0xc638,0xc63a,0xc63c,0xc63d, -0xc63e,0xc63f,0xc642,0xc643,0xc645,0xc646,0xc647,0xc649, -0xc64a,0xc64b,0xc64c,0xc64d,0xc64e,0xc64f,0xc652,0xc656, -0xc657,0xc658,0xc659,0xc65a,0xc65b,0xc65e,0xc65f,0xc661, -0xc662,0xc663,0xc664,0xc665,0xc666,0xc667,0xc668,0xc669, -0xc66a,0xc66b,0xc66d,0xc66e,0xc670,0xc672,0xc673,0xc674, -0xc675,0xc676,0xc677,0xc67a,0xc67b,0xc67d,0xc67e,0xc67f, -0xc681,0xc682,0xc683,0xc684,0xc685,0xc686,0xc687,0xc68a, -0xc68c,0xc68e,0xc68f,0xc690,0xc691,0xc692,0xc693,0xc696, -0xc697,0xc699,0xc69a,0xc69b,0xc69d,0xc69e,0xc69f,0xc6a0, -0xc6a1,0xc6a2,0xc6a3,0xc6a6,0xc6a8,0xc6aa,0xc6ab,0xc6ac, -0xc6ad,0xc6ae,0xc6af,0xc6b2,0xc6b3,0xc6b5,0xc6b6,0xc6b7, -0xc6bb,0xc6bc,0xc6bd,0xc6be,0xc6bf,0xc6c2,0xc6c4,0xc6c6, -0xc6c7,0xc6c8,0xc6c9,0xc6ca,0xc6cb,0xc6ce,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc6cf,0xc6d1,0xc6d2,0xc6d3, -0xc6d5,0xc6d6,0xc6d7,0xc6d8,0xc6d9,0xc6da,0xc6db,0xc6de, -0xc6df,0xc6e2,0xc6e3,0xc6e4,0xc6e5,0xc6e6,0xc6e7,0xc6ea, -0xc6eb,0xc6ed,0xc6ee,0xc6ef,0xc6f1,0xc6f2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc6f3,0xc6f4,0xc6f5,0xc6f6, -0xc6f7,0xc6fa,0xc6fb,0xc6fc,0xc6fe,0xc6ff,0xc700,0xc701, -0xc702,0xc703,0xc706,0xc707,0xc709,0xc70a,0xc70b,0xc70d, -0xc70e,0xc70f,0xc710,0xc711,0xc712,0xc713,0xc716,0xc718, -0xc71a,0xc71b,0xc71c,0xc71d,0xc71e,0xc71f,0xc722,0xc723, -0xc725,0xc726,0xc727,0xc729,0xc72a,0xc72b,0xc72c,0xc72d, -0xc72e,0xc72f,0xc732,0xc734,0xc736,0xc738,0xc739,0xc73a, -0xc73b,0xc73e,0xc73f,0xc741,0xc742,0xc743,0xc745,0xc746, -0xc747,0xc748,0xc749,0xc74b,0xc74e,0xc750,0xc759,0xc75a, -0xc75b,0xc75d,0xc75e,0xc75f,0xc761,0xc762,0xc763,0xc764, -0xc765,0xc766,0xc767,0xc769,0xc76a,0xc76c,0xc76d,0xc76e, -0xc76f,0xc770,0xc771,0xc772,0xc773,0xc776,0xc777,0xc779, -0xc77a,0xc77b,0xc77f,0xc780,0xc781,0xc782,0xc786,0xc78b, -0xc78c,0xc78d,0xc78f,0xc792,0xc793,0xc795,0xc799,0xc79b, -0xc79c,0xc79d,0xc79e,0xc79f,0xc7a2,0xc7a7,0xc7a8,0xc7a9, -0xc7aa,0xc7ab,0xc7ae,0xc7af,0xc7b1,0xc7b2,0xc7b3,0xc7b5, -0xc7b6,0xc7b7,0xc7b8,0xc7b9,0xc7ba,0xc7bb,0xc7be,0xc7c2, -0xc7c3,0xc7c4,0xc7c5,0xc7c6,0xc7c7,0xc7ca,0xc7cb,0xc7cd, -0xc7cf,0xc7d1,0xc7d2,0xc7d3,0xc7d4,0xc7d5,0xc7d6,0xc7d7, -0xc7d9,0xc7da,0xc7db,0xc7dc,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc7de,0xc7df,0xc7e0,0xc7e1,0xc7e2,0xc7e3, -0xc7e5,0xc7e6,0xc7e7,0xc7e9,0xc7ea,0xc7eb,0xc7ed,0xc7ee, -0xc7ef,0xc7f0,0xc7f1,0xc7f2,0xc7f3,0xc7f4,0xc7f5,0xc7f6, -0xc7f7,0xc7f8,0xc7f9,0xc7fa,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xc7fb,0xc7fc,0xc7fd,0xc7fe,0xc7ff,0xc802, -0xc803,0xc805,0xc806,0xc807,0xc809,0xc80b,0xc80c,0xc80d, -0xc80e,0xc80f,0xc812,0xc814,0xc817,0xc818,0xc819,0xc81a, -0xc81b,0xc81e,0xc81f,0xc821,0xc822,0xc823,0xc825,0xc826, -0xc827,0xc828,0xc829,0xc82a,0xc82b,0xc82e,0xc830,0xc832, -0xc833,0xc834,0xc835,0xc836,0xc837,0xc839,0xc83a,0xc83b, -0xc83d,0xc83e,0xc83f,0xc841,0xc842,0xc843,0xc844,0xc845, -0xc846,0xc847,0xc84a,0xc84b,0xc84e,0xc84f,0xc850,0xc851, -0xc852,0xc853,0xc855,0xc856,0xc857,0xc858,0xc859,0xc85a, -0xc85b,0xc85c,0xc85d,0xc85e,0xc85f,0xc860,0xc861,0xc862, -0xc863,0xc864,0xc865,0xc866,0xc867,0xc868,0xc869,0xc86a, -0xc86b,0xc86c,0xc86d,0xc86e,0xc86f,0xc872,0xc873,0xc875, -0xc876,0xc877,0xc879,0xc87b,0xc87c,0xc87d,0xc87e,0xc87f, -0xc882,0xc884,0xc888,0xc889,0xc88a,0xc88e,0xc88f,0xc890, -0xc891,0xc892,0xc893,0xc895,0xc896,0xc897,0xc898,0xc899, -0xc89a,0xc89b,0xc89c,0xc89e,0xc8a0,0xc8a2,0xc8a3,0xc8a4 -}; - -static const int uhc1_ucs_table_size = (sizeof(uhc1_ucs_table)/sizeof(unsigned short)); - -static const unsigned short uhc2_ucs_table[] = { -0xc8a5,0xc8a6,0xc8a7,0xc8a9,0xc8aa,0xc8ab,0xc8ac,0xc8ad, -0xc8ae,0xc8af,0xc8b0,0xc8b1,0xc8b2,0xc8b3,0xc8b4,0xc8b5, -0xc8b6,0xc8b7,0xc8b8,0xc8b9,0xc8ba,0xc8bb,0xc8be,0xc8bf, -0xc8c0,0xc8c1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc8c2,0xc8c3,0xc8c5,0xc8c6,0xc8c7,0xc8c9,0xc8ca,0xc8cb, -0xc8cd,0xc8ce,0xc8cf,0xc8d0,0xc8d1,0xc8d2,0xc8d3,0xc8d6, -0xc8d8,0xc8da,0xc8db,0xc8dc,0xc8dd,0xc8de,0xc8df,0xc8e2, -0xc8e3,0xc8e5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xc8e6,0xc8e7,0xc8e8,0xc8e9,0xc8ea,0xc8eb,0xc8ec,0xc8ed, -0xc8ee,0xc8ef,0xc8f0,0xc8f1,0xc8f2,0xc8f3,0xc8f4,0xc8f6, -0xc8f7,0xc8f8,0xc8f9,0xc8fa,0xc8fb,0xc8fe,0xc8ff,0xc901, -0xc902,0xc903,0xc907,0xc908,0xc909,0xc90a,0xc90b,0xc90e, -0x3000,0x3001,0x3002,0x00b7,0x2025,0x2026,0x00a8,0x3003, -0x00ad,0x2015,0x2225,0xff3c,0x223c,0x2018,0x2019,0x201c, -0x201d,0x3014,0x3015,0x3008,0x3009,0x300a,0x300b,0x300c, -0x300d,0x300e,0x300f,0x3010,0x3011,0x00b1,0x00d7,0x00f7, -0x2260,0x2264,0x2265,0x221e,0x2234,0x00b0,0x2032,0x2033, -0x2103,0x212b,0xffe0,0xffe1,0xffe5,0x2642,0x2640,0x2220, -0x22a5,0x2312,0x2202,0x2207,0x2261,0x2252,0x00a7,0x203b, -0x2606,0x2605,0x25cb,0x25cf,0x25ce,0x25c7,0x25c6,0x25a1, -0x25a0,0x25b3,0x25b2,0x25bd,0x25bc,0x2192,0x2190,0x2191, -0x2193,0x2194,0x3013,0x226a,0x226b,0x221a,0x223d,0x221d, -0x2235,0x222b,0x222c,0x2208,0x220b,0x2286,0x2287,0x2282, -0x2283,0x222a,0x2229,0x2227,0x2228,0xffe2,0xc910,0xc912, -0xc913,0xc914,0xc915,0xc916,0xc917,0xc919,0xc91a,0xc91b, -0xc91c,0xc91d,0xc91e,0xc91f,0xc920,0xc921,0xc922,0xc923, -0xc924,0xc925,0xc926,0xc927,0xc928,0xc929,0xc92a,0xc92b, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc92d,0xc92e, -0xc92f,0xc930,0xc931,0xc932,0xc933,0xc935,0xc936,0xc937, -0xc938,0xc939,0xc93a,0xc93b,0xc93c,0xc93d,0xc93e,0xc93f, -0xc940,0xc941,0xc942,0xc943,0xc944,0xc945,0xc946,0xc947, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xc948,0xc949, -0xc94a,0xc94b,0xc94c,0xc94d,0xc94e,0xc94f,0xc952,0xc953, -0xc955,0xc956,0xc957,0xc959,0xc95a,0xc95b,0xc95c,0xc95d, -0xc95e,0xc95f,0xc962,0xc964,0xc965,0xc966,0xc967,0xc968, -0xc969,0xc96a,0xc96b,0xc96d,0xc96e,0xc96f,0x21d2,0x21d4, -0x2200,0x2203,0x00b4,0xff5e,0x02c7,0x02d8,0x02dd,0x02da, -0x02d9,0x00b8,0x02db,0x00a1,0x00bf,0x02d0,0x222e,0x2211, -0x220f,0x00a4,0x2109,0x2030,0x25c1,0x25c0,0x25b7,0x25b6, -0x2664,0x2660,0x2661,0x2665,0x2667,0x2663,0x2299,0x25c8, -0x25a3,0x25d0,0x25d1,0x2592,0x25a4,0x25a5,0x25a8,0x25a7, -0x25a6,0x25a9,0x2668,0x260f,0x260e,0x261c,0x261e,0x00b6, -0x2020,0x2021,0x2195,0x2197,0x2199,0x2196,0x2198,0x266d, -0x2669,0x266a,0x266c,0x327f,0x321c,0x2116,0x33c7,0x2122, -0x33c2,0x33d8,0x2121,0x20ac,0x00ae,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc971,0xc972,0xc973,0xc975, -0xc976,0xc977,0xc978,0xc979,0xc97a,0xc97b,0xc97d,0xc97e, -0xc97f,0xc980,0xc981,0xc982,0xc983,0xc984,0xc985,0xc986, -0xc987,0xc98a,0xc98b,0xc98d,0xc98e,0xc98f,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc991,0xc992,0xc993,0xc994, -0xc995,0xc996,0xc997,0xc99a,0xc99c,0xc99e,0xc99f,0xc9a0, -0xc9a1,0xc9a2,0xc9a3,0xc9a4,0xc9a5,0xc9a6,0xc9a7,0xc9a8, -0xc9a9,0xc9aa,0xc9ab,0xc9ac,0xc9ad,0xc9ae,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xc9af,0xc9b0,0xc9b1,0xc9b2, -0xc9b3,0xc9b4,0xc9b5,0xc9b6,0xc9b7,0xc9b8,0xc9b9,0xc9ba, -0xc9bb,0xc9bc,0xc9bd,0xc9be,0xc9bf,0xc9c2,0xc9c3,0xc9c5, -0xc9c6,0xc9c9,0xc9cb,0xc9cc,0xc9cd,0xc9ce,0xc9cf,0xc9d2, -0xc9d4,0xc9d7,0xc9d8,0xc9db,0xff01,0xff02,0xff03,0xff04, -0xff05,0xff06,0xff07,0xff08,0xff09,0xff0a,0xff0b,0xff0c, -0xff0d,0xff0e,0xff0f,0xff10,0xff11,0xff12,0xff13,0xff14, -0xff15,0xff16,0xff17,0xff18,0xff19,0xff1a,0xff1b,0xff1c, -0xff1d,0xff1e,0xff1f,0xff20,0xff21,0xff22,0xff23,0xff24, -0xff25,0xff26,0xff27,0xff28,0xff29,0xff2a,0xff2b,0xff2c, -0xff2d,0xff2e,0xff2f,0xff30,0xff31,0xff32,0xff33,0xff34, -0xff35,0xff36,0xff37,0xff38,0xff39,0xff3a,0xff3b,0xffe6, -0xff3d,0xff3e,0xff3f,0xff40,0xff41,0xff42,0xff43,0xff44, -0xff45,0xff46,0xff47,0xff48,0xff49,0xff4a,0xff4b,0xff4c, -0xff4d,0xff4e,0xff4f,0xff50,0xff51,0xff52,0xff53,0xff54, -0xff55,0xff56,0xff57,0xff58,0xff59,0xff5a,0xff5b,0xff5c, -0xff5d,0xffe3,0xc9de,0xc9df,0xc9e1,0xc9e3,0xc9e5,0xc9e6, -0xc9e8,0xc9e9,0xc9ea,0xc9eb,0xc9ee,0xc9f2,0xc9f3,0xc9f4, -0xc9f5,0xc9f6,0xc9f7,0xc9fa,0xc9fb,0xc9fd,0xc9fe,0xc9ff, -0xca01,0xca02,0xca03,0xca04,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xca05,0xca06,0xca07,0xca0a,0xca0e,0xca0f, -0xca10,0xca11,0xca12,0xca13,0xca15,0xca16,0xca17,0xca19, -0xca1a,0xca1b,0xca1c,0xca1d,0xca1e,0xca1f,0xca20,0xca21, -0xca22,0xca23,0xca24,0xca25,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xca26,0xca27,0xca28,0xca2a,0xca2b,0xca2c, -0xca2d,0xca2e,0xca2f,0xca30,0xca31,0xca32,0xca33,0xca34, -0xca35,0xca36,0xca37,0xca38,0xca39,0xca3a,0xca3b,0xca3c, -0xca3d,0xca3e,0xca3f,0xca40,0xca41,0xca42,0xca43,0xca44, -0xca45,0xca46,0x3131,0x3132,0x3133,0x3134,0x3135,0x3136, -0x3137,0x3138,0x3139,0x313a,0x313b,0x313c,0x313d,0x313e, -0x313f,0x3140,0x3141,0x3142,0x3143,0x3144,0x3145,0x3146, -0x3147,0x3148,0x3149,0x314a,0x314b,0x314c,0x314d,0x314e, -0x314f,0x3150,0x3151,0x3152,0x3153,0x3154,0x3155,0x3156, -0x3157,0x3158,0x3159,0x315a,0x315b,0x315c,0x315d,0x315e, -0x315f,0x3160,0x3161,0x3162,0x3163,0x3164,0x3165,0x3166, -0x3167,0x3168,0x3169,0x316a,0x316b,0x316c,0x316d,0x316e, -0x316f,0x3170,0x3171,0x3172,0x3173,0x3174,0x3175,0x3176, -0x3177,0x3178,0x3179,0x317a,0x317b,0x317c,0x317d,0x317e, -0x317f,0x3180,0x3181,0x3182,0x3183,0x3184,0x3185,0x3186, -0x3187,0x3188,0x3189,0x318a,0x318b,0x318c,0x318d,0x318e, -0xca47,0xca48,0xca49,0xca4a,0xca4b,0xca4e,0xca4f,0xca51, -0xca52,0xca53,0xca55,0xca56,0xca57,0xca58,0xca59,0xca5a, -0xca5b,0xca5e,0xca62,0xca63,0xca64,0xca65,0xca66,0xca67, -0xca69,0xca6a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xca6b,0xca6c,0xca6d,0xca6e,0xca6f,0xca70,0xca71,0xca72, -0xca73,0xca74,0xca75,0xca76,0xca77,0xca78,0xca79,0xca7a, -0xca7b,0xca7c,0xca7e,0xca7f,0xca80,0xca81,0xca82,0xca83, -0xca85,0xca86,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xca87,0xca88,0xca89,0xca8a,0xca8b,0xca8c,0xca8d,0xca8e, -0xca8f,0xca90,0xca91,0xca92,0xca93,0xca94,0xca95,0xca96, -0xca97,0xca99,0xca9a,0xca9b,0xca9c,0xca9d,0xca9e,0xca9f, -0xcaa0,0xcaa1,0xcaa2,0xcaa3,0xcaa4,0xcaa5,0xcaa6,0xcaa7, -0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, -0x2178,0x2179,0x0000,0x0000,0x0000,0x0000,0x0000,0x2160, -0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167,0x2168, -0x2169,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, -0x0399,0x039a,0x039b,0x039c,0x039d,0x039e,0x039f,0x03a0, -0x03a1,0x03a3,0x03a4,0x03a5,0x03a6,0x03a7,0x03a8,0x03a9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x03b1,0x03b2,0x03b3,0x03b4,0x03b5,0x03b6,0x03b7,0x03b8, -0x03b9,0x03ba,0x03bb,0x03bc,0x03bd,0x03be,0x03bf,0x03c0, -0x03c1,0x03c3,0x03c4,0x03c5,0x03c6,0x03c7,0x03c8,0x03c9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcaa8,0xcaa9, -0xcaaa,0xcaab,0xcaac,0xcaad,0xcaae,0xcaaf,0xcab0,0xcab1, -0xcab2,0xcab3,0xcab4,0xcab5,0xcab6,0xcab7,0xcab8,0xcab9, -0xcaba,0xcabb,0xcabe,0xcabf,0xcac1,0xcac2,0xcac3,0xcac5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcac6,0xcac7, -0xcac8,0xcac9,0xcaca,0xcacb,0xcace,0xcad0,0xcad2,0xcad4, -0xcad5,0xcad6,0xcad7,0xcada,0xcadb,0xcadc,0xcadd,0xcade, -0xcadf,0xcae1,0xcae2,0xcae3,0xcae4,0xcae5,0xcae6,0xcae7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcae8,0xcae9, -0xcaea,0xcaeb,0xcaed,0xcaee,0xcaef,0xcaf0,0xcaf1,0xcaf2, -0xcaf3,0xcaf5,0xcaf6,0xcaf7,0xcaf8,0xcaf9,0xcafa,0xcafb, -0xcafc,0xcafd,0xcafe,0xcaff,0xcb00,0xcb01,0xcb02,0xcb03, -0xcb04,0xcb05,0xcb06,0xcb07,0xcb09,0xcb0a,0x2500,0x2502, -0x250c,0x2510,0x2518,0x2514,0x251c,0x252c,0x2524,0x2534, -0x253c,0x2501,0x2503,0x250f,0x2513,0x251b,0x2517,0x2523, -0x2533,0x252b,0x253b,0x254b,0x2520,0x252f,0x2528,0x2537, -0x253f,0x251d,0x2530,0x2525,0x2538,0x2542,0x2512,0x2511, -0x251a,0x2519,0x2516,0x2515,0x250e,0x250d,0x251e,0x251f, -0x2521,0x2522,0x2526,0x2527,0x2529,0x252a,0x252d,0x252e, -0x2531,0x2532,0x2535,0x2536,0x2539,0x253a,0x253d,0x253e, -0x2540,0x2541,0x2543,0x2544,0x2545,0x2546,0x2547,0x2548, -0x2549,0x254a,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcb0b,0xcb0c,0xcb0d,0xcb0e, -0xcb0f,0xcb11,0xcb12,0xcb13,0xcb15,0xcb16,0xcb17,0xcb19, -0xcb1a,0xcb1b,0xcb1c,0xcb1d,0xcb1e,0xcb1f,0xcb22,0xcb23, -0xcb24,0xcb25,0xcb26,0xcb27,0xcb28,0xcb29,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcb2a,0xcb2b,0xcb2c,0xcb2d, -0xcb2e,0xcb2f,0xcb30,0xcb31,0xcb32,0xcb33,0xcb34,0xcb35, -0xcb36,0xcb37,0xcb38,0xcb39,0xcb3a,0xcb3b,0xcb3c,0xcb3d, -0xcb3e,0xcb3f,0xcb40,0xcb42,0xcb43,0xcb44,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcb45,0xcb46,0xcb47,0xcb4a, -0xcb4b,0xcb4d,0xcb4e,0xcb4f,0xcb51,0xcb52,0xcb53,0xcb54, -0xcb55,0xcb56,0xcb57,0xcb5a,0xcb5b,0xcb5c,0xcb5e,0xcb5f, -0xcb60,0xcb61,0xcb62,0xcb63,0xcb65,0xcb66,0xcb67,0xcb68, -0xcb69,0xcb6a,0xcb6b,0xcb6c,0x3395,0x3396,0x3397,0x2113, -0x3398,0x33c4,0x33a3,0x33a4,0x33a5,0x33a6,0x3399,0x339a, -0x339b,0x339c,0x339d,0x339e,0x339f,0x33a0,0x33a1,0x33a2, -0x33ca,0x338d,0x338e,0x338f,0x33cf,0x3388,0x3389,0x33c8, -0x33a7,0x33a8,0x33b0,0x33b1,0x33b2,0x33b3,0x33b4,0x33b5, -0x33b6,0x33b7,0x33b8,0x33b9,0x3380,0x3381,0x3382,0x3383, -0x3384,0x33ba,0x33bb,0x33bc,0x33bd,0x33be,0x33bf,0x3390, -0x3391,0x3392,0x3393,0x3394,0x2126,0x33c0,0x33c1,0x338a, -0x338b,0x338c,0x33d6,0x33c5,0x33ad,0x33ae,0x33af,0x33db, -0x33a9,0x33aa,0x33ab,0x33ac,0x33dd,0x33d0,0x33d3,0x33c3, -0x33c9,0x33dc,0x33c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcb6d,0xcb6e,0xcb6f,0xcb70,0xcb71,0xcb72, -0xcb73,0xcb74,0xcb75,0xcb76,0xcb77,0xcb7a,0xcb7b,0xcb7c, -0xcb7d,0xcb7e,0xcb7f,0xcb80,0xcb81,0xcb82,0xcb83,0xcb84, -0xcb85,0xcb86,0xcb87,0xcb88,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcb89,0xcb8a,0xcb8b,0xcb8c,0xcb8d,0xcb8e, -0xcb8f,0xcb90,0xcb91,0xcb92,0xcb93,0xcb94,0xcb95,0xcb96, -0xcb97,0xcb98,0xcb99,0xcb9a,0xcb9b,0xcb9d,0xcb9e,0xcb9f, -0xcba0,0xcba1,0xcba2,0xcba3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcba4,0xcba5,0xcba6,0xcba7,0xcba8,0xcba9, -0xcbaa,0xcbab,0xcbac,0xcbad,0xcbae,0xcbaf,0xcbb0,0xcbb1, -0xcbb2,0xcbb3,0xcbb4,0xcbb5,0xcbb6,0xcbb7,0xcbb9,0xcbba, -0xcbbb,0xcbbc,0xcbbd,0xcbbe,0xcbbf,0xcbc0,0xcbc1,0xcbc2, -0xcbc3,0xcbc4,0x00c6,0x00d0,0x00aa,0x0126,0x0000,0x0132, -0x0000,0x013f,0x0141,0x00d8,0x0152,0x00ba,0x00de,0x0166, -0x014a,0x0000,0x3260,0x3261,0x3262,0x3263,0x3264,0x3265, -0x3266,0x3267,0x3268,0x3269,0x326a,0x326b,0x326c,0x326d, -0x326e,0x326f,0x3270,0x3271,0x3272,0x3273,0x3274,0x3275, -0x3276,0x3277,0x3278,0x3279,0x327a,0x327b,0x24d0,0x24d1, -0x24d2,0x24d3,0x24d4,0x24d5,0x24d6,0x24d7,0x24d8,0x24d9, -0x24da,0x24db,0x24dc,0x24dd,0x24de,0x24df,0x24e0,0x24e1, -0x24e2,0x24e3,0x24e4,0x24e5,0x24e6,0x24e7,0x24e8,0x24e9, -0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, -0x2468,0x2469,0x246a,0x246b,0x246c,0x246d,0x246e,0x00bd, -0x2153,0x2154,0x00bc,0x00be,0x215b,0x215c,0x215d,0x215e, -0xcbc5,0xcbc6,0xcbc7,0xcbc8,0xcbc9,0xcbca,0xcbcb,0xcbcc, -0xcbcd,0xcbce,0xcbcf,0xcbd0,0xcbd1,0xcbd2,0xcbd3,0xcbd5, -0xcbd6,0xcbd7,0xcbd8,0xcbd9,0xcbda,0xcbdb,0xcbdc,0xcbdd, -0xcbde,0xcbdf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcbe0,0xcbe1,0xcbe2,0xcbe3,0xcbe5,0xcbe6,0xcbe8,0xcbea, -0xcbeb,0xcbec,0xcbed,0xcbee,0xcbef,0xcbf0,0xcbf1,0xcbf2, -0xcbf3,0xcbf4,0xcbf5,0xcbf6,0xcbf7,0xcbf8,0xcbf9,0xcbfa, -0xcbfb,0xcbfc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcbfd,0xcbfe,0xcbff,0xcc00,0xcc01,0xcc02,0xcc03,0xcc04, -0xcc05,0xcc06,0xcc07,0xcc08,0xcc09,0xcc0a,0xcc0b,0xcc0e, -0xcc0f,0xcc11,0xcc12,0xcc13,0xcc15,0xcc16,0xcc17,0xcc18, -0xcc19,0xcc1a,0xcc1b,0xcc1e,0xcc1f,0xcc20,0xcc23,0xcc24, -0x00e6,0x0111,0x00f0,0x0127,0x0131,0x0133,0x0138,0x0140, -0x0142,0x00f8,0x0153,0x00df,0x00fe,0x0167,0x014b,0x0149, -0x3200,0x3201,0x3202,0x3203,0x3204,0x3205,0x3206,0x3207, -0x3208,0x3209,0x320a,0x320b,0x320c,0x320d,0x320e,0x320f, -0x3210,0x3211,0x3212,0x3213,0x3214,0x3215,0x3216,0x3217, -0x3218,0x3219,0x321a,0x321b,0x249c,0x249d,0x249e,0x249f, -0x24a0,0x24a1,0x24a2,0x24a3,0x24a4,0x24a5,0x24a6,0x24a7, -0x24a8,0x24a9,0x24aa,0x24ab,0x24ac,0x24ad,0x24ae,0x24af, -0x24b0,0x24b1,0x24b2,0x24b3,0x24b4,0x24b5,0x2474,0x2475, -0x2476,0x2477,0x2478,0x2479,0x247a,0x247b,0x247c,0x247d, -0x247e,0x247f,0x2480,0x2481,0x2482,0x00b9,0x00b2,0x00b3, -0x2074,0x207f,0x2081,0x2082,0x2083,0x2084,0xcc25,0xcc26, -0xcc2a,0xcc2b,0xcc2d,0xcc2f,0xcc31,0xcc32,0xcc33,0xcc34, -0xcc35,0xcc36,0xcc37,0xcc3a,0xcc3f,0xcc40,0xcc41,0xcc42, -0xcc43,0xcc46,0xcc47,0xcc49,0xcc4a,0xcc4b,0xcc4d,0xcc4e, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcc4f,0xcc50, -0xcc51,0xcc52,0xcc53,0xcc56,0xcc5a,0xcc5b,0xcc5c,0xcc5d, -0xcc5e,0xcc5f,0xcc61,0xcc62,0xcc63,0xcc65,0xcc67,0xcc69, -0xcc6a,0xcc6b,0xcc6c,0xcc6d,0xcc6e,0xcc6f,0xcc71,0xcc72, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcc73,0xcc74, -0xcc76,0xcc77,0xcc78,0xcc79,0xcc7a,0xcc7b,0xcc7c,0xcc7d, -0xcc7e,0xcc7f,0xcc80,0xcc81,0xcc82,0xcc83,0xcc84,0xcc85, -0xcc86,0xcc87,0xcc88,0xcc89,0xcc8a,0xcc8b,0xcc8c,0xcc8d, -0xcc8e,0xcc8f,0xcc90,0xcc91,0xcc92,0xcc93,0x3041,0x3042, -0x3043,0x3044,0x3045,0x3046,0x3047,0x3048,0x3049,0x304a, -0x304b,0x304c,0x304d,0x304e,0x304f,0x3050,0x3051,0x3052, -0x3053,0x3054,0x3055,0x3056,0x3057,0x3058,0x3059,0x305a, -0x305b,0x305c,0x305d,0x305e,0x305f,0x3060,0x3061,0x3062, -0x3063,0x3064,0x3065,0x3066,0x3067,0x3068,0x3069,0x306a, -0x306b,0x306c,0x306d,0x306e,0x306f,0x3070,0x3071,0x3072, -0x3073,0x3074,0x3075,0x3076,0x3077,0x3078,0x3079,0x307a, -0x307b,0x307c,0x307d,0x307e,0x307f,0x3080,0x3081,0x3082, -0x3083,0x3084,0x3085,0x3086,0x3087,0x3088,0x3089,0x308a, -0x308b,0x308c,0x308d,0x308e,0x308f,0x3090,0x3091,0x3092, -0x3093,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcc94,0xcc95,0xcc96,0xcc97, -0xcc9a,0xcc9b,0xcc9d,0xcc9e,0xcc9f,0xcca1,0xcca2,0xcca3, -0xcca4,0xcca5,0xcca6,0xcca7,0xccaa,0xccae,0xccaf,0xccb0, -0xccb1,0xccb2,0xccb3,0xccb6,0xccb7,0xccb9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xccba,0xccbb,0xccbd,0xccbe, -0xccbf,0xccc0,0xccc1,0xccc2,0xccc3,0xccc6,0xccc8,0xccca, -0xcccb,0xcccc,0xcccd,0xccce,0xcccf,0xccd1,0xccd2,0xccd3, -0xccd5,0xccd6,0xccd7,0xccd8,0xccd9,0xccda,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xccdb,0xccdc,0xccdd,0xccde, -0xccdf,0xcce0,0xcce1,0xcce2,0xcce3,0xcce5,0xcce6,0xcce7, -0xcce8,0xcce9,0xccea,0xcceb,0xcced,0xccee,0xccef,0xccf1, -0xccf2,0xccf3,0xccf4,0xccf5,0xccf6,0xccf7,0xccf8,0xccf9, -0xccfa,0xccfb,0xccfc,0xccfd,0x30a1,0x30a2,0x30a3,0x30a4, -0x30a5,0x30a6,0x30a7,0x30a8,0x30a9,0x30aa,0x30ab,0x30ac, -0x30ad,0x30ae,0x30af,0x30b0,0x30b1,0x30b2,0x30b3,0x30b4, -0x30b5,0x30b6,0x30b7,0x30b8,0x30b9,0x30ba,0x30bb,0x30bc, -0x30bd,0x30be,0x30bf,0x30c0,0x30c1,0x30c2,0x30c3,0x30c4, -0x30c5,0x30c6,0x30c7,0x30c8,0x30c9,0x30ca,0x30cb,0x30cc, -0x30cd,0x30ce,0x30cf,0x30d0,0x30d1,0x30d2,0x30d3,0x30d4, -0x30d5,0x30d6,0x30d7,0x30d8,0x30d9,0x30da,0x30db,0x30dc, -0x30dd,0x30de,0x30df,0x30e0,0x30e1,0x30e2,0x30e3,0x30e4, -0x30e5,0x30e6,0x30e7,0x30e8,0x30e9,0x30ea,0x30eb,0x30ec, -0x30ed,0x30ee,0x30ef,0x30f0,0x30f1,0x30f2,0x30f3,0x30f4, -0x30f5,0x30f6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xccfe,0xccff,0xcd00,0xcd02,0xcd03,0xcd04, -0xcd05,0xcd06,0xcd07,0xcd0a,0xcd0b,0xcd0d,0xcd0e,0xcd0f, -0xcd11,0xcd12,0xcd13,0xcd14,0xcd15,0xcd16,0xcd17,0xcd1a, -0xcd1c,0xcd1e,0xcd1f,0xcd20,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcd21,0xcd22,0xcd23,0xcd25,0xcd26,0xcd27, -0xcd29,0xcd2a,0xcd2b,0xcd2d,0xcd2e,0xcd2f,0xcd30,0xcd31, -0xcd32,0xcd33,0xcd34,0xcd35,0xcd36,0xcd37,0xcd38,0xcd3a, -0xcd3b,0xcd3c,0xcd3d,0xcd3e,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcd3f,0xcd40,0xcd41,0xcd42,0xcd43,0xcd44, -0xcd45,0xcd46,0xcd47,0xcd48,0xcd49,0xcd4a,0xcd4b,0xcd4c, -0xcd4d,0xcd4e,0xcd4f,0xcd50,0xcd51,0xcd52,0xcd53,0xcd54, -0xcd55,0xcd56,0xcd57,0xcd58,0xcd59,0xcd5a,0xcd5b,0xcd5d, -0xcd5e,0xcd5f,0x0410,0x0411,0x0412,0x0413,0x0414,0x0415, -0x0401,0x0416,0x0417,0x0418,0x0419,0x041a,0x041b,0x041c, -0x041d,0x041e,0x041f,0x0420,0x0421,0x0422,0x0423,0x0424, -0x0425,0x0426,0x0427,0x0428,0x0429,0x042a,0x042b,0x042c, -0x042d,0x042e,0x042f,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0430,0x0431,0x0432,0x0433,0x0434,0x0435, -0x0451,0x0436,0x0437,0x0438,0x0439,0x043a,0x043b,0x043c, -0x043d,0x043e,0x043f,0x0440,0x0441,0x0442,0x0443,0x0444, -0x0445,0x0446,0x0447,0x0448,0x0449,0x044a,0x044b,0x044c, -0x044d,0x044e,0x044f,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcd61,0xcd62,0xcd63,0xcd65,0xcd66,0xcd67,0xcd68,0xcd69, -0xcd6a,0xcd6b,0xcd6e,0xcd70,0xcd72,0xcd73,0xcd74,0xcd75, -0xcd76,0xcd77,0xcd79,0xcd7a,0xcd7b,0xcd7c,0xcd7d,0xcd7e, -0xcd7f,0xcd80,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcd81,0xcd82,0xcd83,0xcd84,0xcd85,0xcd86,0xcd87,0xcd89, -0xcd8a,0xcd8b,0xcd8c,0xcd8d,0xcd8e,0xcd8f,0xcd90,0xcd91, -0xcd92,0xcd93,0xcd96,0xcd97,0xcd99,0xcd9a,0xcd9b,0xcd9d, -0xcd9e,0xcd9f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcda0,0xcda1,0xcda2,0xcda3,0xcda6,0xcda8,0xcdaa,0xcdab, -0xcdac,0xcdad,0xcdae,0xcdaf,0xcdb1,0xcdb2,0xcdb3,0xcdb4, -0xcdb5,0xcdb6,0xcdb7,0xcdb8,0xcdb9,0xcdba,0xcdbb,0xcdbc, -0xcdbd,0xcdbe,0xcdbf,0xcdc0,0xcdc1,0xcdc2,0xcdc3,0xcdc5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcdc6,0xcdc7, -0xcdc8,0xcdc9,0xcdca,0xcdcb,0xcdcd,0xcdce,0xcdcf,0xcdd1, -0xcdd2,0xcdd3,0xcdd4,0xcdd5,0xcdd6,0xcdd7,0xcdd8,0xcdd9, -0xcdda,0xcddb,0xcddc,0xcddd,0xcdde,0xcddf,0xcde0,0xcde1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcde2,0xcde3, -0xcde4,0xcde5,0xcde6,0xcde7,0xcde9,0xcdea,0xcdeb,0xcded, -0xcdee,0xcdef,0xcdf1,0xcdf2,0xcdf3,0xcdf4,0xcdf5,0xcdf6, -0xcdf7,0xcdfa,0xcdfc,0xcdfe,0xcdff,0xce00,0xce01,0xce02, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xce03,0xce05, -0xce06,0xce07,0xce09,0xce0a,0xce0b,0xce0d,0xce0e,0xce0f, -0xce10,0xce11,0xce12,0xce13,0xce15,0xce16,0xce17,0xce18, -0xce1a,0xce1b,0xce1c,0xce1d,0xce1e,0xce1f,0xce22,0xce23, -0xce25,0xce26,0xce27,0xce29,0xce2a,0xce2b,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xce2c,0xce2d,0xce2e,0xce2f, -0xce32,0xce34,0xce36,0xce37,0xce38,0xce39,0xce3a,0xce3b, -0xce3c,0xce3d,0xce3e,0xce3f,0xce40,0xce41,0xce42,0xce43, -0xce44,0xce45,0xce46,0xce47,0xce48,0xce49,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xce4a,0xce4b,0xce4c,0xce4d, -0xce4e,0xce4f,0xce50,0xce51,0xce52,0xce53,0xce54,0xce55, -0xce56,0xce57,0xce5a,0xce5b,0xce5d,0xce5e,0xce62,0xce63, -0xce64,0xce65,0xce66,0xce67,0xce6a,0xce6c,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xce6e,0xce6f,0xce70,0xce71, -0xce72,0xce73,0xce76,0xce77,0xce79,0xce7a,0xce7b,0xce7d, -0xce7e,0xce7f,0xce80,0xce81,0xce82,0xce83,0xce86,0xce88, -0xce8a,0xce8b,0xce8c,0xce8d,0xce8e,0xce8f,0xce92,0xce93, -0xce95,0xce96,0xce97,0xce99,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xce9a,0xce9b,0xce9c,0xce9d,0xce9e,0xce9f, -0xcea2,0xcea6,0xcea7,0xcea8,0xcea9,0xceaa,0xceab,0xceae, -0xceaf,0xceb0,0xceb1,0xceb2,0xceb3,0xceb4,0xceb5,0xceb6, -0xceb7,0xceb8,0xceb9,0xceba,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcebb,0xcebc,0xcebd,0xcebe,0xcebf,0xcec0, -0xcec2,0xcec3,0xcec4,0xcec5,0xcec6,0xcec7,0xcec8,0xcec9, -0xceca,0xcecb,0xcecc,0xcecd,0xcece,0xcecf,0xced0,0xced1, -0xced2,0xced3,0xced4,0xced5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xced6,0xced7,0xced8,0xced9,0xceda,0xcedb, -0xcedc,0xcedd,0xcede,0xcedf,0xcee0,0xcee1,0xcee2,0xcee3, -0xcee6,0xcee7,0xcee9,0xceea,0xceed,0xceee,0xceef,0xcef0, -0xcef1,0xcef2,0xcef3,0xcef6,0xcefa,0xcefb,0xcefc,0xcefd, -0xcefe,0xceff,0xac00,0xac01,0xac04,0xac07,0xac08,0xac09, -0xac0a,0xac10,0xac11,0xac12,0xac13,0xac14,0xac15,0xac16, -0xac17,0xac19,0xac1a,0xac1b,0xac1c,0xac1d,0xac20,0xac24, -0xac2c,0xac2d,0xac2f,0xac30,0xac31,0xac38,0xac39,0xac3c, -0xac40,0xac4b,0xac4d,0xac54,0xac58,0xac5c,0xac70,0xac71, -0xac74,0xac77,0xac78,0xac7a,0xac80,0xac81,0xac83,0xac84, -0xac85,0xac86,0xac89,0xac8a,0xac8b,0xac8c,0xac90,0xac94, -0xac9c,0xac9d,0xac9f,0xaca0,0xaca1,0xaca8,0xaca9,0xacaa, -0xacac,0xacaf,0xacb0,0xacb8,0xacb9,0xacbb,0xacbc,0xacbd, -0xacc1,0xacc4,0xacc8,0xaccc,0xacd5,0xacd7,0xace0,0xace1, -0xace4,0xace7,0xace8,0xacea,0xacec,0xacef,0xacf0,0xacf1, -0xacf3,0xacf5,0xacf6,0xacfc,0xacfd,0xad00,0xad04,0xad06, -0xcf02,0xcf03,0xcf05,0xcf06,0xcf07,0xcf09,0xcf0a,0xcf0b, -0xcf0c,0xcf0d,0xcf0e,0xcf0f,0xcf12,0xcf14,0xcf16,0xcf17, -0xcf18,0xcf19,0xcf1a,0xcf1b,0xcf1d,0xcf1e,0xcf1f,0xcf21, -0xcf22,0xcf23,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcf25,0xcf26,0xcf27,0xcf28,0xcf29,0xcf2a,0xcf2b,0xcf2e, -0xcf32,0xcf33,0xcf34,0xcf35,0xcf36,0xcf37,0xcf39,0xcf3a, -0xcf3b,0xcf3c,0xcf3d,0xcf3e,0xcf3f,0xcf40,0xcf41,0xcf42, -0xcf43,0xcf44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcf45,0xcf46,0xcf47,0xcf48,0xcf49,0xcf4a,0xcf4b,0xcf4c, -0xcf4d,0xcf4e,0xcf4f,0xcf50,0xcf51,0xcf52,0xcf53,0xcf56, -0xcf57,0xcf59,0xcf5a,0xcf5b,0xcf5d,0xcf5e,0xcf5f,0xcf60, -0xcf61,0xcf62,0xcf63,0xcf66,0xcf68,0xcf6a,0xcf6b,0xcf6c, -0xad0c,0xad0d,0xad0f,0xad11,0xad18,0xad1c,0xad20,0xad29, -0xad2c,0xad2d,0xad34,0xad35,0xad38,0xad3c,0xad44,0xad45, -0xad47,0xad49,0xad50,0xad54,0xad58,0xad61,0xad63,0xad6c, -0xad6d,0xad70,0xad73,0xad74,0xad75,0xad76,0xad7b,0xad7c, -0xad7d,0xad7f,0xad81,0xad82,0xad88,0xad89,0xad8c,0xad90, -0xad9c,0xad9d,0xada4,0xadb7,0xadc0,0xadc1,0xadc4,0xadc8, -0xadd0,0xadd1,0xadd3,0xaddc,0xade0,0xade4,0xadf8,0xadf9, -0xadfc,0xadff,0xae00,0xae01,0xae08,0xae09,0xae0b,0xae0d, -0xae14,0xae30,0xae31,0xae34,0xae37,0xae38,0xae3a,0xae40, -0xae41,0xae43,0xae45,0xae46,0xae4a,0xae4c,0xae4d,0xae4e, -0xae50,0xae54,0xae56,0xae5c,0xae5d,0xae5f,0xae60,0xae61, -0xae65,0xae68,0xae69,0xae6c,0xae70,0xae78,0xcf6d,0xcf6e, -0xcf6f,0xcf72,0xcf73,0xcf75,0xcf76,0xcf77,0xcf79,0xcf7a, -0xcf7b,0xcf7c,0xcf7d,0xcf7e,0xcf7f,0xcf81,0xcf82,0xcf83, -0xcf84,0xcf86,0xcf87,0xcf88,0xcf89,0xcf8a,0xcf8b,0xcf8d, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcf8e,0xcf8f, -0xcf90,0xcf91,0xcf92,0xcf93,0xcf94,0xcf95,0xcf96,0xcf97, -0xcf98,0xcf99,0xcf9a,0xcf9b,0xcf9c,0xcf9d,0xcf9e,0xcf9f, -0xcfa0,0xcfa2,0xcfa3,0xcfa4,0xcfa5,0xcfa6,0xcfa7,0xcfa9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfaa,0xcfab, -0xcfac,0xcfad,0xcfae,0xcfaf,0xcfb1,0xcfb2,0xcfb3,0xcfb4, -0xcfb5,0xcfb6,0xcfb7,0xcfb8,0xcfb9,0xcfba,0xcfbb,0xcfbc, -0xcfbd,0xcfbe,0xcfbf,0xcfc0,0xcfc1,0xcfc2,0xcfc3,0xcfc5, -0xcfc6,0xcfc7,0xcfc8,0xcfc9,0xcfca,0xcfcb,0xae79,0xae7b, -0xae7c,0xae7d,0xae84,0xae85,0xae8c,0xaebc,0xaebd,0xaebe, -0xaec0,0xaec4,0xaecc,0xaecd,0xaecf,0xaed0,0xaed1,0xaed8, -0xaed9,0xaedc,0xaee8,0xaeeb,0xaeed,0xaef4,0xaef8,0xaefc, -0xaf07,0xaf08,0xaf0d,0xaf10,0xaf2c,0xaf2d,0xaf30,0xaf32, -0xaf34,0xaf3c,0xaf3d,0xaf3f,0xaf41,0xaf42,0xaf43,0xaf48, -0xaf49,0xaf50,0xaf5c,0xaf5d,0xaf64,0xaf65,0xaf79,0xaf80, -0xaf84,0xaf88,0xaf90,0xaf91,0xaf95,0xaf9c,0xafb8,0xafb9, -0xafbc,0xafc0,0xafc7,0xafc8,0xafc9,0xafcb,0xafcd,0xafce, -0xafd4,0xafdc,0xafe8,0xafe9,0xaff0,0xaff1,0xaff4,0xaff8, -0xb000,0xb001,0xb004,0xb00c,0xb010,0xb014,0xb01c,0xb01d, -0xb028,0xb044,0xb045,0xb048,0xb04a,0xb04c,0xb04e,0xb053, -0xb054,0xb055,0xb057,0xb059,0xcfcc,0xcfcd,0xcfce,0xcfcf, -0xcfd0,0xcfd1,0xcfd2,0xcfd3,0xcfd4,0xcfd5,0xcfd6,0xcfd7, -0xcfd8,0xcfd9,0xcfda,0xcfdb,0xcfdc,0xcfdd,0xcfde,0xcfdf, -0xcfe2,0xcfe3,0xcfe5,0xcfe6,0xcfe7,0xcfe9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcfea,0xcfeb,0xcfec,0xcfed, -0xcfee,0xcfef,0xcff2,0xcff4,0xcff6,0xcff7,0xcff8,0xcff9, -0xcffa,0xcffb,0xcffd,0xcffe,0xcfff,0xd001,0xd002,0xd003, -0xd005,0xd006,0xd007,0xd008,0xd009,0xd00a,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd00b,0xd00c,0xd00d,0xd00e, -0xd00f,0xd010,0xd012,0xd013,0xd014,0xd015,0xd016,0xd017, -0xd019,0xd01a,0xd01b,0xd01c,0xd01d,0xd01e,0xd01f,0xd020, -0xd021,0xd022,0xd023,0xd024,0xd025,0xd026,0xd027,0xd028, -0xd029,0xd02a,0xd02b,0xd02c,0xb05d,0xb07c,0xb07d,0xb080, -0xb084,0xb08c,0xb08d,0xb08f,0xb091,0xb098,0xb099,0xb09a, -0xb09c,0xb09f,0xb0a0,0xb0a1,0xb0a2,0xb0a8,0xb0a9,0xb0ab, -0xb0ac,0xb0ad,0xb0ae,0xb0af,0xb0b1,0xb0b3,0xb0b4,0xb0b5, -0xb0b8,0xb0bc,0xb0c4,0xb0c5,0xb0c7,0xb0c8,0xb0c9,0xb0d0, -0xb0d1,0xb0d4,0xb0d8,0xb0e0,0xb0e5,0xb108,0xb109,0xb10b, -0xb10c,0xb110,0xb112,0xb113,0xb118,0xb119,0xb11b,0xb11c, -0xb11d,0xb123,0xb124,0xb125,0xb128,0xb12c,0xb134,0xb135, -0xb137,0xb138,0xb139,0xb140,0xb141,0xb144,0xb148,0xb150, -0xb151,0xb154,0xb155,0xb158,0xb15c,0xb160,0xb178,0xb179, -0xb17c,0xb180,0xb182,0xb188,0xb189,0xb18b,0xb18d,0xb192, -0xb193,0xb194,0xb198,0xb19c,0xb1a8,0xb1cc,0xb1d0,0xb1d4, -0xb1dc,0xb1dd,0xd02e,0xd02f,0xd030,0xd031,0xd032,0xd033, -0xd036,0xd037,0xd039,0xd03a,0xd03b,0xd03d,0xd03e,0xd03f, -0xd040,0xd041,0xd042,0xd043,0xd046,0xd048,0xd04a,0xd04b, -0xd04c,0xd04d,0xd04e,0xd04f,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd051,0xd052,0xd053,0xd055,0xd056,0xd057, -0xd059,0xd05a,0xd05b,0xd05c,0xd05d,0xd05e,0xd05f,0xd061, -0xd062,0xd063,0xd064,0xd065,0xd066,0xd067,0xd068,0xd069, -0xd06a,0xd06b,0xd06e,0xd06f,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd071,0xd072,0xd073,0xd075,0xd076,0xd077, -0xd078,0xd079,0xd07a,0xd07b,0xd07e,0xd07f,0xd080,0xd082, -0xd083,0xd084,0xd085,0xd086,0xd087,0xd088,0xd089,0xd08a, -0xd08b,0xd08c,0xd08d,0xd08e,0xd08f,0xd090,0xd091,0xd092, -0xd093,0xd094,0xb1df,0xb1e8,0xb1e9,0xb1ec,0xb1f0,0xb1f9, -0xb1fb,0xb1fd,0xb204,0xb205,0xb208,0xb20b,0xb20c,0xb214, -0xb215,0xb217,0xb219,0xb220,0xb234,0xb23c,0xb258,0xb25c, -0xb260,0xb268,0xb269,0xb274,0xb275,0xb27c,0xb284,0xb285, -0xb289,0xb290,0xb291,0xb294,0xb298,0xb299,0xb29a,0xb2a0, -0xb2a1,0xb2a3,0xb2a5,0xb2a6,0xb2aa,0xb2ac,0xb2b0,0xb2b4, -0xb2c8,0xb2c9,0xb2cc,0xb2d0,0xb2d2,0xb2d8,0xb2d9,0xb2db, -0xb2dd,0xb2e2,0xb2e4,0xb2e5,0xb2e6,0xb2e8,0xb2eb,0xb2ec, -0xb2ed,0xb2ee,0xb2ef,0xb2f3,0xb2f4,0xb2f5,0xb2f7,0xb2f8, -0xb2f9,0xb2fa,0xb2fb,0xb2ff,0xb300,0xb301,0xb304,0xb308, -0xb310,0xb311,0xb313,0xb314,0xb315,0xb31c,0xb354,0xb355, -0xb356,0xb358,0xb35b,0xb35c,0xb35e,0xb35f,0xb364,0xb365, -0xd095,0xd096,0xd097,0xd098,0xd099,0xd09a,0xd09b,0xd09c, -0xd09d,0xd09e,0xd09f,0xd0a0,0xd0a1,0xd0a2,0xd0a3,0xd0a6, -0xd0a7,0xd0a9,0xd0aa,0xd0ab,0xd0ad,0xd0ae,0xd0af,0xd0b0, -0xd0b1,0xd0b2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0b3,0xd0b6,0xd0b8,0xd0ba,0xd0bb,0xd0bc,0xd0bd,0xd0be, -0xd0bf,0xd0c2,0xd0c3,0xd0c5,0xd0c6,0xd0c7,0xd0ca,0xd0cb, -0xd0cc,0xd0cd,0xd0ce,0xd0cf,0xd0d2,0xd0d6,0xd0d7,0xd0d8, -0xd0d9,0xd0da,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0db,0xd0de,0xd0df,0xd0e1,0xd0e2,0xd0e3,0xd0e5,0xd0e6, -0xd0e7,0xd0e8,0xd0e9,0xd0ea,0xd0eb,0xd0ee,0xd0f2,0xd0f3, -0xd0f4,0xd0f5,0xd0f6,0xd0f7,0xd0f9,0xd0fa,0xd0fb,0xd0fc, -0xd0fd,0xd0fe,0xd0ff,0xd100,0xd101,0xd102,0xd103,0xd104, -0xb367,0xb369,0xb36b,0xb36e,0xb370,0xb371,0xb374,0xb378, -0xb380,0xb381,0xb383,0xb384,0xb385,0xb38c,0xb390,0xb394, -0xb3a0,0xb3a1,0xb3a8,0xb3ac,0xb3c4,0xb3c5,0xb3c8,0xb3cb, -0xb3cc,0xb3ce,0xb3d0,0xb3d4,0xb3d5,0xb3d7,0xb3d9,0xb3db, -0xb3dd,0xb3e0,0xb3e4,0xb3e8,0xb3fc,0xb410,0xb418,0xb41c, -0xb420,0xb428,0xb429,0xb42b,0xb434,0xb450,0xb451,0xb454, -0xb458,0xb460,0xb461,0xb463,0xb465,0xb46c,0xb480,0xb488, -0xb49d,0xb4a4,0xb4a8,0xb4ac,0xb4b5,0xb4b7,0xb4b9,0xb4c0, -0xb4c4,0xb4c8,0xb4d0,0xb4d5,0xb4dc,0xb4dd,0xb4e0,0xb4e3, -0xb4e4,0xb4e6,0xb4ec,0xb4ed,0xb4ef,0xb4f1,0xb4f8,0xb514, -0xb515,0xb518,0xb51b,0xb51c,0xb524,0xb525,0xb527,0xb528, -0xb529,0xb52a,0xb530,0xb531,0xb534,0xb538,0xd105,0xd106, -0xd107,0xd108,0xd109,0xd10a,0xd10b,0xd10c,0xd10e,0xd10f, -0xd110,0xd111,0xd112,0xd113,0xd114,0xd115,0xd116,0xd117, -0xd118,0xd119,0xd11a,0xd11b,0xd11c,0xd11d,0xd11e,0xd11f, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd120,0xd121, -0xd122,0xd123,0xd124,0xd125,0xd126,0xd127,0xd128,0xd129, -0xd12a,0xd12b,0xd12c,0xd12d,0xd12e,0xd12f,0xd132,0xd133, -0xd135,0xd136,0xd137,0xd139,0xd13b,0xd13c,0xd13d,0xd13e, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd13f,0xd142, -0xd146,0xd147,0xd148,0xd149,0xd14a,0xd14b,0xd14e,0xd14f, -0xd151,0xd152,0xd153,0xd155,0xd156,0xd157,0xd158,0xd159, -0xd15a,0xd15b,0xd15e,0xd160,0xd162,0xd163,0xd164,0xd165, -0xd166,0xd167,0xd169,0xd16a,0xd16b,0xd16d,0xb540,0xb541, -0xb543,0xb544,0xb545,0xb54b,0xb54c,0xb54d,0xb550,0xb554, -0xb55c,0xb55d,0xb55f,0xb560,0xb561,0xb5a0,0xb5a1,0xb5a4, -0xb5a8,0xb5aa,0xb5ab,0xb5b0,0xb5b1,0xb5b3,0xb5b4,0xb5b5, -0xb5bb,0xb5bc,0xb5bd,0xb5c0,0xb5c4,0xb5cc,0xb5cd,0xb5cf, -0xb5d0,0xb5d1,0xb5d8,0xb5ec,0xb610,0xb611,0xb614,0xb618, -0xb625,0xb62c,0xb634,0xb648,0xb664,0xb668,0xb69c,0xb69d, -0xb6a0,0xb6a4,0xb6ab,0xb6ac,0xb6b1,0xb6d4,0xb6f0,0xb6f4, -0xb6f8,0xb700,0xb701,0xb705,0xb728,0xb729,0xb72c,0xb72f, -0xb730,0xb738,0xb739,0xb73b,0xb744,0xb748,0xb74c,0xb754, -0xb755,0xb760,0xb764,0xb768,0xb770,0xb771,0xb773,0xb775, -0xb77c,0xb77d,0xb780,0xb784,0xb78c,0xb78d,0xb78f,0xb790, -0xb791,0xb792,0xb796,0xb797,0xd16e,0xd16f,0xd170,0xd171, -0xd172,0xd173,0xd174,0xd175,0xd176,0xd177,0xd178,0xd179, -0xd17a,0xd17b,0xd17d,0xd17e,0xd17f,0xd180,0xd181,0xd182, -0xd183,0xd185,0xd186,0xd187,0xd189,0xd18a,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd18b,0xd18c,0xd18d,0xd18e, -0xd18f,0xd190,0xd191,0xd192,0xd193,0xd194,0xd195,0xd196, -0xd197,0xd198,0xd199,0xd19a,0xd19b,0xd19c,0xd19d,0xd19e, -0xd19f,0xd1a2,0xd1a3,0xd1a5,0xd1a6,0xd1a7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd1a9,0xd1aa,0xd1ab,0xd1ac, -0xd1ad,0xd1ae,0xd1af,0xd1b2,0xd1b4,0xd1b6,0xd1b7,0xd1b8, -0xd1b9,0xd1bb,0xd1bd,0xd1be,0xd1bf,0xd1c1,0xd1c2,0xd1c3, -0xd1c4,0xd1c5,0xd1c6,0xd1c7,0xd1c8,0xd1c9,0xd1ca,0xd1cb, -0xd1cc,0xd1cd,0xd1ce,0xd1cf,0xb798,0xb799,0xb79c,0xb7a0, -0xb7a8,0xb7a9,0xb7ab,0xb7ac,0xb7ad,0xb7b4,0xb7b5,0xb7b8, -0xb7c7,0xb7c9,0xb7ec,0xb7ed,0xb7f0,0xb7f4,0xb7fc,0xb7fd, -0xb7ff,0xb800,0xb801,0xb807,0xb808,0xb809,0xb80c,0xb810, -0xb818,0xb819,0xb81b,0xb81d,0xb824,0xb825,0xb828,0xb82c, -0xb834,0xb835,0xb837,0xb838,0xb839,0xb840,0xb844,0xb851, -0xb853,0xb85c,0xb85d,0xb860,0xb864,0xb86c,0xb86d,0xb86f, -0xb871,0xb878,0xb87c,0xb88d,0xb8a8,0xb8b0,0xb8b4,0xb8b8, -0xb8c0,0xb8c1,0xb8c3,0xb8c5,0xb8cc,0xb8d0,0xb8d4,0xb8dd, -0xb8df,0xb8e1,0xb8e8,0xb8e9,0xb8ec,0xb8f0,0xb8f8,0xb8f9, -0xb8fb,0xb8fd,0xb904,0xb918,0xb920,0xb93c,0xb93d,0xb940, -0xb944,0xb94c,0xb94f,0xb951,0xb958,0xb959,0xb95c,0xb960, -0xb968,0xb969,0xd1d0,0xd1d1,0xd1d2,0xd1d3,0xd1d4,0xd1d5, -0xd1d6,0xd1d7,0xd1d9,0xd1da,0xd1db,0xd1dc,0xd1dd,0xd1de, -0xd1df,0xd1e0,0xd1e1,0xd1e2,0xd1e3,0xd1e4,0xd1e5,0xd1e6, -0xd1e7,0xd1e8,0xd1e9,0xd1ea,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd1eb,0xd1ec,0xd1ed,0xd1ee,0xd1ef,0xd1f0, -0xd1f1,0xd1f2,0xd1f3,0xd1f5,0xd1f6,0xd1f7,0xd1f9,0xd1fa, -0xd1fb,0xd1fc,0xd1fd,0xd1fe,0xd1ff,0xd200,0xd201,0xd202, -0xd203,0xd204,0xd205,0xd206,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd208,0xd20a,0xd20b,0xd20c,0xd20d,0xd20e, -0xd20f,0xd211,0xd212,0xd213,0xd214,0xd215,0xd216,0xd217, -0xd218,0xd219,0xd21a,0xd21b,0xd21c,0xd21d,0xd21e,0xd21f, -0xd220,0xd221,0xd222,0xd223,0xd224,0xd225,0xd226,0xd227, -0xd228,0xd229,0xb96b,0xb96d,0xb974,0xb975,0xb978,0xb97c, -0xb984,0xb985,0xb987,0xb989,0xb98a,0xb98d,0xb98e,0xb9ac, -0xb9ad,0xb9b0,0xb9b4,0xb9bc,0xb9bd,0xb9bf,0xb9c1,0xb9c8, -0xb9c9,0xb9cc,0xb9ce,0xb9cf,0xb9d0,0xb9d1,0xb9d2,0xb9d8, -0xb9d9,0xb9db,0xb9dd,0xb9de,0xb9e1,0xb9e3,0xb9e4,0xb9e5, -0xb9e8,0xb9ec,0xb9f4,0xb9f5,0xb9f7,0xb9f8,0xb9f9,0xb9fa, -0xba00,0xba01,0xba08,0xba15,0xba38,0xba39,0xba3c,0xba40, -0xba42,0xba48,0xba49,0xba4b,0xba4d,0xba4e,0xba53,0xba54, -0xba55,0xba58,0xba5c,0xba64,0xba65,0xba67,0xba68,0xba69, -0xba70,0xba71,0xba74,0xba78,0xba83,0xba84,0xba85,0xba87, -0xba8c,0xbaa8,0xbaa9,0xbaab,0xbaac,0xbab0,0xbab2,0xbab8, -0xbab9,0xbabb,0xbabd,0xbac4,0xbac8,0xbad8,0xbad9,0xbafc, -0xd22a,0xd22b,0xd22e,0xd22f,0xd231,0xd232,0xd233,0xd235, -0xd236,0xd237,0xd238,0xd239,0xd23a,0xd23b,0xd23e,0xd240, -0xd242,0xd243,0xd244,0xd245,0xd246,0xd247,0xd249,0xd24a, -0xd24b,0xd24c,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd24d,0xd24e,0xd24f,0xd250,0xd251,0xd252,0xd253,0xd254, -0xd255,0xd256,0xd257,0xd258,0xd259,0xd25a,0xd25b,0xd25d, -0xd25e,0xd25f,0xd260,0xd261,0xd262,0xd263,0xd265,0xd266, -0xd267,0xd268,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd269,0xd26a,0xd26b,0xd26c,0xd26d,0xd26e,0xd26f,0xd270, -0xd271,0xd272,0xd273,0xd274,0xd275,0xd276,0xd277,0xd278, -0xd279,0xd27a,0xd27b,0xd27c,0xd27d,0xd27e,0xd27f,0xd282, -0xd283,0xd285,0xd286,0xd287,0xd289,0xd28a,0xd28b,0xd28c, -0xbb00,0xbb04,0xbb0d,0xbb0f,0xbb11,0xbb18,0xbb1c,0xbb20, -0xbb29,0xbb2b,0xbb34,0xbb35,0xbb36,0xbb38,0xbb3b,0xbb3c, -0xbb3d,0xbb3e,0xbb44,0xbb45,0xbb47,0xbb49,0xbb4d,0xbb4f, -0xbb50,0xbb54,0xbb58,0xbb61,0xbb63,0xbb6c,0xbb88,0xbb8c, -0xbb90,0xbba4,0xbba8,0xbbac,0xbbb4,0xbbb7,0xbbc0,0xbbc4, -0xbbc8,0xbbd0,0xbbd3,0xbbf8,0xbbf9,0xbbfc,0xbbff,0xbc00, -0xbc02,0xbc08,0xbc09,0xbc0b,0xbc0c,0xbc0d,0xbc0f,0xbc11, -0xbc14,0xbc15,0xbc16,0xbc17,0xbc18,0xbc1b,0xbc1c,0xbc1d, -0xbc1e,0xbc1f,0xbc24,0xbc25,0xbc27,0xbc29,0xbc2d,0xbc30, -0xbc31,0xbc34,0xbc38,0xbc40,0xbc41,0xbc43,0xbc44,0xbc45, -0xbc49,0xbc4c,0xbc4d,0xbc50,0xbc5d,0xbc84,0xbc85,0xbc88, -0xbc8b,0xbc8c,0xbc8e,0xbc94,0xbc95,0xbc97,0xd28d,0xd28e, -0xd28f,0xd292,0xd293,0xd294,0xd296,0xd297,0xd298,0xd299, -0xd29a,0xd29b,0xd29d,0xd29e,0xd29f,0xd2a1,0xd2a2,0xd2a3, -0xd2a5,0xd2a6,0xd2a7,0xd2a8,0xd2a9,0xd2aa,0xd2ab,0xd2ad, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd2ae,0xd2af, -0xd2b0,0xd2b2,0xd2b3,0xd2b4,0xd2b5,0xd2b6,0xd2b7,0xd2ba, -0xd2bb,0xd2bd,0xd2be,0xd2c1,0xd2c3,0xd2c4,0xd2c5,0xd2c6, -0xd2c7,0xd2ca,0xd2cc,0xd2cd,0xd2ce,0xd2cf,0xd2d0,0xd2d1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd2d2,0xd2d3, -0xd2d5,0xd2d6,0xd2d7,0xd2d9,0xd2da,0xd2db,0xd2dd,0xd2de, -0xd2df,0xd2e0,0xd2e1,0xd2e2,0xd2e3,0xd2e6,0xd2e7,0xd2e8, -0xd2e9,0xd2ea,0xd2eb,0xd2ec,0xd2ed,0xd2ee,0xd2ef,0xd2f2, -0xd2f3,0xd2f5,0xd2f6,0xd2f7,0xd2f9,0xd2fa,0xbc99,0xbc9a, -0xbca0,0xbca1,0xbca4,0xbca7,0xbca8,0xbcb0,0xbcb1,0xbcb3, -0xbcb4,0xbcb5,0xbcbc,0xbcbd,0xbcc0,0xbcc4,0xbccd,0xbccf, -0xbcd0,0xbcd1,0xbcd5,0xbcd8,0xbcdc,0xbcf4,0xbcf5,0xbcf6, -0xbcf8,0xbcfc,0xbd04,0xbd05,0xbd07,0xbd09,0xbd10,0xbd14, -0xbd24,0xbd2c,0xbd40,0xbd48,0xbd49,0xbd4c,0xbd50,0xbd58, -0xbd59,0xbd64,0xbd68,0xbd80,0xbd81,0xbd84,0xbd87,0xbd88, -0xbd89,0xbd8a,0xbd90,0xbd91,0xbd93,0xbd95,0xbd99,0xbd9a, -0xbd9c,0xbda4,0xbdb0,0xbdb8,0xbdd4,0xbdd5,0xbdd8,0xbddc, -0xbde9,0xbdf0,0xbdf4,0xbdf8,0xbe00,0xbe03,0xbe05,0xbe0c, -0xbe0d,0xbe10,0xbe14,0xbe1c,0xbe1d,0xbe1f,0xbe44,0xbe45, -0xbe48,0xbe4c,0xbe4e,0xbe54,0xbe55,0xbe57,0xbe59,0xbe5a, -0xbe5b,0xbe60,0xbe61,0xbe64,0xd2fb,0xd2fc,0xd2fd,0xd2fe, -0xd2ff,0xd302,0xd304,0xd306,0xd307,0xd308,0xd309,0xd30a, -0xd30b,0xd30f,0xd311,0xd312,0xd313,0xd315,0xd317,0xd318, -0xd319,0xd31a,0xd31b,0xd31e,0xd322,0xd323,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd324,0xd326,0xd327,0xd32a, -0xd32b,0xd32d,0xd32e,0xd32f,0xd331,0xd332,0xd333,0xd334, -0xd335,0xd336,0xd337,0xd33a,0xd33e,0xd33f,0xd340,0xd341, -0xd342,0xd343,0xd346,0xd347,0xd348,0xd349,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd34a,0xd34b,0xd34c,0xd34d, -0xd34e,0xd34f,0xd350,0xd351,0xd352,0xd353,0xd354,0xd355, -0xd356,0xd357,0xd358,0xd359,0xd35a,0xd35b,0xd35c,0xd35d, -0xd35e,0xd35f,0xd360,0xd361,0xd362,0xd363,0xd364,0xd365, -0xd366,0xd367,0xd368,0xd369,0xbe68,0xbe6a,0xbe70,0xbe71, -0xbe73,0xbe74,0xbe75,0xbe7b,0xbe7c,0xbe7d,0xbe80,0xbe84, -0xbe8c,0xbe8d,0xbe8f,0xbe90,0xbe91,0xbe98,0xbe99,0xbea8, -0xbed0,0xbed1,0xbed4,0xbed7,0xbed8,0xbee0,0xbee3,0xbee4, -0xbee5,0xbeec,0xbf01,0xbf08,0xbf09,0xbf18,0xbf19,0xbf1b, -0xbf1c,0xbf1d,0xbf40,0xbf41,0xbf44,0xbf48,0xbf50,0xbf51, -0xbf55,0xbf94,0xbfb0,0xbfc5,0xbfcc,0xbfcd,0xbfd0,0xbfd4, -0xbfdc,0xbfdf,0xbfe1,0xc03c,0xc051,0xc058,0xc05c,0xc060, -0xc068,0xc069,0xc090,0xc091,0xc094,0xc098,0xc0a0,0xc0a1, -0xc0a3,0xc0a5,0xc0ac,0xc0ad,0xc0af,0xc0b0,0xc0b3,0xc0b4, -0xc0b5,0xc0b6,0xc0bc,0xc0bd,0xc0bf,0xc0c0,0xc0c1,0xc0c5, -0xc0c8,0xc0c9,0xc0cc,0xc0d0,0xc0d8,0xc0d9,0xc0db,0xc0dc, -0xc0dd,0xc0e4,0xd36a,0xd36b,0xd36c,0xd36d,0xd36e,0xd36f, -0xd370,0xd371,0xd372,0xd373,0xd374,0xd375,0xd376,0xd377, -0xd378,0xd379,0xd37a,0xd37b,0xd37e,0xd37f,0xd381,0xd382, -0xd383,0xd385,0xd386,0xd387,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd388,0xd389,0xd38a,0xd38b,0xd38e,0xd392, -0xd393,0xd394,0xd395,0xd396,0xd397,0xd39a,0xd39b,0xd39d, -0xd39e,0xd39f,0xd3a1,0xd3a2,0xd3a3,0xd3a4,0xd3a5,0xd3a6, -0xd3a7,0xd3aa,0xd3ac,0xd3ae,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd3af,0xd3b0,0xd3b1,0xd3b2,0xd3b3,0xd3b5, -0xd3b6,0xd3b7,0xd3b9,0xd3ba,0xd3bb,0xd3bd,0xd3be,0xd3bf, -0xd3c0,0xd3c1,0xd3c2,0xd3c3,0xd3c6,0xd3c7,0xd3ca,0xd3cb, -0xd3cc,0xd3cd,0xd3ce,0xd3cf,0xd3d1,0xd3d2,0xd3d3,0xd3d4, -0xd3d5,0xd3d6,0xc0e5,0xc0e8,0xc0ec,0xc0f4,0xc0f5,0xc0f7, -0xc0f9,0xc100,0xc104,0xc108,0xc110,0xc115,0xc11c,0xc11d, -0xc11e,0xc11f,0xc120,0xc123,0xc124,0xc126,0xc127,0xc12c, -0xc12d,0xc12f,0xc130,0xc131,0xc136,0xc138,0xc139,0xc13c, -0xc140,0xc148,0xc149,0xc14b,0xc14c,0xc14d,0xc154,0xc155, -0xc158,0xc15c,0xc164,0xc165,0xc167,0xc168,0xc169,0xc170, -0xc174,0xc178,0xc185,0xc18c,0xc18d,0xc18e,0xc190,0xc194, -0xc196,0xc19c,0xc19d,0xc19f,0xc1a1,0xc1a5,0xc1a8,0xc1a9, -0xc1ac,0xc1b0,0xc1bd,0xc1c4,0xc1c8,0xc1cc,0xc1d4,0xc1d7, -0xc1d8,0xc1e0,0xc1e4,0xc1e8,0xc1f0,0xc1f1,0xc1f3,0xc1fc, -0xc1fd,0xc200,0xc204,0xc20c,0xc20d,0xc20f,0xc211,0xc218, -0xc219,0xc21c,0xc21f,0xc220,0xc228,0xc229,0xc22b,0xc22d, -0xd3d7,0xd3d9,0xd3da,0xd3db,0xd3dc,0xd3dd,0xd3de,0xd3df, -0xd3e0,0xd3e2,0xd3e4,0xd3e5,0xd3e6,0xd3e7,0xd3e8,0xd3e9, -0xd3ea,0xd3eb,0xd3ee,0xd3ef,0xd3f1,0xd3f2,0xd3f3,0xd3f5, -0xd3f6,0xd3f7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd3f8,0xd3f9,0xd3fa,0xd3fb,0xd3fe,0xd400,0xd402,0xd403, -0xd404,0xd405,0xd406,0xd407,0xd409,0xd40a,0xd40b,0xd40c, -0xd40d,0xd40e,0xd40f,0xd410,0xd411,0xd412,0xd413,0xd414, -0xd415,0xd416,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd417,0xd418,0xd419,0xd41a,0xd41b,0xd41c,0xd41e,0xd41f, -0xd420,0xd421,0xd422,0xd423,0xd424,0xd425,0xd426,0xd427, -0xd428,0xd429,0xd42a,0xd42b,0xd42c,0xd42d,0xd42e,0xd42f, -0xd430,0xd431,0xd432,0xd433,0xd434,0xd435,0xd436,0xd437, -0xc22f,0xc231,0xc232,0xc234,0xc248,0xc250,0xc251,0xc254, -0xc258,0xc260,0xc265,0xc26c,0xc26d,0xc270,0xc274,0xc27c, -0xc27d,0xc27f,0xc281,0xc288,0xc289,0xc290,0xc298,0xc29b, -0xc29d,0xc2a4,0xc2a5,0xc2a8,0xc2ac,0xc2ad,0xc2b4,0xc2b5, -0xc2b7,0xc2b9,0xc2dc,0xc2dd,0xc2e0,0xc2e3,0xc2e4,0xc2eb, -0xc2ec,0xc2ed,0xc2ef,0xc2f1,0xc2f6,0xc2f8,0xc2f9,0xc2fb, -0xc2fc,0xc300,0xc308,0xc309,0xc30c,0xc30d,0xc313,0xc314, -0xc315,0xc318,0xc31c,0xc324,0xc325,0xc328,0xc329,0xc345, -0xc368,0xc369,0xc36c,0xc370,0xc372,0xc378,0xc379,0xc37c, -0xc37d,0xc384,0xc388,0xc38c,0xc3c0,0xc3d8,0xc3d9,0xc3dc, -0xc3df,0xc3e0,0xc3e2,0xc3e8,0xc3e9,0xc3ed,0xc3f4,0xc3f5, -0xc3f8,0xc408,0xc410,0xc424,0xc42c,0xc430,0xd438,0xd439, -0xd43a,0xd43b,0xd43c,0xd43d,0xd43e,0xd43f,0xd441,0xd442, -0xd443,0xd445,0xd446,0xd447,0xd448,0xd449,0xd44a,0xd44b, -0xd44c,0xd44d,0xd44e,0xd44f,0xd450,0xd451,0xd452,0xd453, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd454,0xd455, -0xd456,0xd457,0xd458,0xd459,0xd45a,0xd45b,0xd45d,0xd45e, -0xd45f,0xd461,0xd462,0xd463,0xd465,0xd466,0xd467,0xd468, -0xd469,0xd46a,0xd46b,0xd46c,0xd46e,0xd470,0xd471,0xd472, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd473,0xd474, -0xd475,0xd476,0xd477,0xd47a,0xd47b,0xd47d,0xd47e,0xd481, -0xd483,0xd484,0xd485,0xd486,0xd487,0xd48a,0xd48c,0xd48e, -0xd48f,0xd490,0xd491,0xd492,0xd493,0xd495,0xd496,0xd497, -0xd498,0xd499,0xd49a,0xd49b,0xd49c,0xd49d,0xc434,0xc43c, -0xc43d,0xc448,0xc464,0xc465,0xc468,0xc46c,0xc474,0xc475, -0xc479,0xc480,0xc494,0xc49c,0xc4b8,0xc4bc,0xc4e9,0xc4f0, -0xc4f1,0xc4f4,0xc4f8,0xc4fa,0xc4ff,0xc500,0xc501,0xc50c, -0xc510,0xc514,0xc51c,0xc528,0xc529,0xc52c,0xc530,0xc538, -0xc539,0xc53b,0xc53d,0xc544,0xc545,0xc548,0xc549,0xc54a, -0xc54c,0xc54d,0xc54e,0xc553,0xc554,0xc555,0xc557,0xc558, -0xc559,0xc55d,0xc55e,0xc560,0xc561,0xc564,0xc568,0xc570, -0xc571,0xc573,0xc574,0xc575,0xc57c,0xc57d,0xc580,0xc584, -0xc587,0xc58c,0xc58d,0xc58f,0xc591,0xc595,0xc597,0xc598, -0xc59c,0xc5a0,0xc5a9,0xc5b4,0xc5b5,0xc5b8,0xc5b9,0xc5bb, -0xc5bc,0xc5bd,0xc5be,0xc5c4,0xc5c5,0xc5c6,0xc5c7,0xc5c8, -0xc5c9,0xc5ca,0xc5cc,0xc5ce,0xd49e,0xd49f,0xd4a0,0xd4a1, -0xd4a2,0xd4a3,0xd4a4,0xd4a5,0xd4a6,0xd4a7,0xd4a8,0xd4aa, -0xd4ab,0xd4ac,0xd4ad,0xd4ae,0xd4af,0xd4b0,0xd4b1,0xd4b2, -0xd4b3,0xd4b4,0xd4b5,0xd4b6,0xd4b7,0xd4b8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4b9,0xd4ba,0xd4bb,0xd4bc, -0xd4bd,0xd4be,0xd4bf,0xd4c0,0xd4c1,0xd4c2,0xd4c3,0xd4c4, -0xd4c5,0xd4c6,0xd4c7,0xd4c8,0xd4c9,0xd4ca,0xd4cb,0xd4cd, -0xd4ce,0xd4cf,0xd4d1,0xd4d2,0xd4d3,0xd4d5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4d6,0xd4d7,0xd4d8,0xd4d9, -0xd4da,0xd4db,0xd4dd,0xd4de,0xd4e0,0xd4e1,0xd4e2,0xd4e3, -0xd4e4,0xd4e5,0xd4e6,0xd4e7,0xd4e9,0xd4ea,0xd4eb,0xd4ed, -0xd4ee,0xd4ef,0xd4f1,0xd4f2,0xd4f3,0xd4f4,0xd4f5,0xd4f6, -0xd4f7,0xd4f9,0xd4fa,0xd4fc,0xc5d0,0xc5d1,0xc5d4,0xc5d8, -0xc5e0,0xc5e1,0xc5e3,0xc5e5,0xc5ec,0xc5ed,0xc5ee,0xc5f0, -0xc5f4,0xc5f6,0xc5f7,0xc5fc,0xc5fd,0xc5fe,0xc5ff,0xc600, -0xc601,0xc605,0xc606,0xc607,0xc608,0xc60c,0xc610,0xc618, -0xc619,0xc61b,0xc61c,0xc624,0xc625,0xc628,0xc62c,0xc62d, -0xc62e,0xc630,0xc633,0xc634,0xc635,0xc637,0xc639,0xc63b, -0xc640,0xc641,0xc644,0xc648,0xc650,0xc651,0xc653,0xc654, -0xc655,0xc65c,0xc65d,0xc660,0xc66c,0xc66f,0xc671,0xc678, -0xc679,0xc67c,0xc680,0xc688,0xc689,0xc68b,0xc68d,0xc694, -0xc695,0xc698,0xc69c,0xc6a4,0xc6a5,0xc6a7,0xc6a9,0xc6b0, -0xc6b1,0xc6b4,0xc6b8,0xc6b9,0xc6ba,0xc6c0,0xc6c1,0xc6c3, -0xc6c5,0xc6cc,0xc6cd,0xc6d0,0xc6d4,0xc6dc,0xc6dd,0xc6e0, -0xc6e1,0xc6e8,0xd4fe,0xd4ff,0xd500,0xd501,0xd502,0xd503, -0xd505,0xd506,0xd507,0xd509,0xd50a,0xd50b,0xd50d,0xd50e, -0xd50f,0xd510,0xd511,0xd512,0xd513,0xd516,0xd518,0xd519, -0xd51a,0xd51b,0xd51c,0xd51d,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd51e,0xd51f,0xd520,0xd521,0xd522,0xd523, -0xd524,0xd525,0xd526,0xd527,0xd528,0xd529,0xd52a,0xd52b, -0xd52c,0xd52d,0xd52e,0xd52f,0xd530,0xd531,0xd532,0xd533, -0xd534,0xd535,0xd536,0xd537,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd538,0xd539,0xd53a,0xd53b,0xd53e,0xd53f, -0xd541,0xd542,0xd543,0xd545,0xd546,0xd547,0xd548,0xd549, -0xd54a,0xd54b,0xd54e,0xd550,0xd552,0xd553,0xd554,0xd555, -0xd556,0xd557,0xd55a,0xd55b,0xd55d,0xd55e,0xd55f,0xd561, -0xd562,0xd563,0xc6e9,0xc6ec,0xc6f0,0xc6f8,0xc6f9,0xc6fd, -0xc704,0xc705,0xc708,0xc70c,0xc714,0xc715,0xc717,0xc719, -0xc720,0xc721,0xc724,0xc728,0xc730,0xc731,0xc733,0xc735, -0xc737,0xc73c,0xc73d,0xc740,0xc744,0xc74a,0xc74c,0xc74d, -0xc74f,0xc751,0xc752,0xc753,0xc754,0xc755,0xc756,0xc757, -0xc758,0xc75c,0xc760,0xc768,0xc76b,0xc774,0xc775,0xc778, -0xc77c,0xc77d,0xc77e,0xc783,0xc784,0xc785,0xc787,0xc788, -0xc789,0xc78a,0xc78e,0xc790,0xc791,0xc794,0xc796,0xc797, -0xc798,0xc79a,0xc7a0,0xc7a1,0xc7a3,0xc7a4,0xc7a5,0xc7a6, -0xc7ac,0xc7ad,0xc7b0,0xc7b4,0xc7bc,0xc7bd,0xc7bf,0xc7c0, -0xc7c1,0xc7c8,0xc7c9,0xc7cc,0xc7ce,0xc7d0,0xc7d8,0xc7dd, -0xc7e4,0xc7e8,0xc7ec,0xc800,0xc801,0xc804,0xc808,0xc80a, -0xd564,0xd566,0xd567,0xd56a,0xd56c,0xd56e,0xd56f,0xd570, -0xd571,0xd572,0xd573,0xd576,0xd577,0xd579,0xd57a,0xd57b, -0xd57d,0xd57e,0xd57f,0xd580,0xd581,0xd582,0xd583,0xd586, -0xd58a,0xd58b,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd58c,0xd58d,0xd58e,0xd58f,0xd591,0xd592,0xd593,0xd594, -0xd595,0xd596,0xd597,0xd598,0xd599,0xd59a,0xd59b,0xd59c, -0xd59d,0xd59e,0xd59f,0xd5a0,0xd5a1,0xd5a2,0xd5a3,0xd5a4, -0xd5a6,0xd5a7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd5a8,0xd5a9,0xd5aa,0xd5ab,0xd5ac,0xd5ad,0xd5ae,0xd5af, -0xd5b0,0xd5b1,0xd5b2,0xd5b3,0xd5b4,0xd5b5,0xd5b6,0xd5b7, -0xd5b8,0xd5b9,0xd5ba,0xd5bb,0xd5bc,0xd5bd,0xd5be,0xd5bf, -0xd5c0,0xd5c1,0xd5c2,0xd5c3,0xd5c4,0xd5c5,0xd5c6,0xd5c7, -0xc810,0xc811,0xc813,0xc815,0xc816,0xc81c,0xc81d,0xc820, -0xc824,0xc82c,0xc82d,0xc82f,0xc831,0xc838,0xc83c,0xc840, -0xc848,0xc849,0xc84c,0xc84d,0xc854,0xc870,0xc871,0xc874, -0xc878,0xc87a,0xc880,0xc881,0xc883,0xc885,0xc886,0xc887, -0xc88b,0xc88c,0xc88d,0xc894,0xc89d,0xc89f,0xc8a1,0xc8a8, -0xc8bc,0xc8bd,0xc8c4,0xc8c8,0xc8cc,0xc8d4,0xc8d5,0xc8d7, -0xc8d9,0xc8e0,0xc8e1,0xc8e4,0xc8f5,0xc8fc,0xc8fd,0xc900, -0xc904,0xc905,0xc906,0xc90c,0xc90d,0xc90f,0xc911,0xc918, -0xc92c,0xc934,0xc950,0xc951,0xc954,0xc958,0xc960,0xc961, -0xc963,0xc96c,0xc970,0xc974,0xc97c,0xc988,0xc989,0xc98c, -0xc990,0xc998,0xc999,0xc99b,0xc99d,0xc9c0,0xc9c1,0xc9c4, -0xc9c7,0xc9c8,0xc9ca,0xc9d0,0xc9d1,0xc9d3,0xd5ca,0xd5cb, -0xd5cd,0xd5ce,0xd5cf,0xd5d1,0xd5d3,0xd5d4,0xd5d5,0xd5d6, -0xd5d7,0xd5da,0xd5dc,0xd5de,0xd5df,0xd5e0,0xd5e1,0xd5e2, -0xd5e3,0xd5e6,0xd5e7,0xd5e9,0xd5ea,0xd5eb,0xd5ed,0xd5ee, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5ef,0xd5f0, -0xd5f1,0xd5f2,0xd5f3,0xd5f6,0xd5f8,0xd5fa,0xd5fb,0xd5fc, -0xd5fd,0xd5fe,0xd5ff,0xd602,0xd603,0xd605,0xd606,0xd607, -0xd609,0xd60a,0xd60b,0xd60c,0xd60d,0xd60e,0xd60f,0xd612, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd616,0xd617, -0xd618,0xd619,0xd61a,0xd61b,0xd61d,0xd61e,0xd61f,0xd621, -0xd622,0xd623,0xd625,0xd626,0xd627,0xd628,0xd629,0xd62a, -0xd62b,0xd62c,0xd62e,0xd62f,0xd630,0xd631,0xd632,0xd633, -0xd634,0xd635,0xd636,0xd637,0xd63a,0xd63b,0xc9d5,0xc9d6, -0xc9d9,0xc9da,0xc9dc,0xc9dd,0xc9e0,0xc9e2,0xc9e4,0xc9e7, -0xc9ec,0xc9ed,0xc9ef,0xc9f0,0xc9f1,0xc9f8,0xc9f9,0xc9fc, -0xca00,0xca08,0xca09,0xca0b,0xca0c,0xca0d,0xca14,0xca18, -0xca29,0xca4c,0xca4d,0xca50,0xca54,0xca5c,0xca5d,0xca5f, -0xca60,0xca61,0xca68,0xca7d,0xca84,0xca98,0xcabc,0xcabd, -0xcac0,0xcac4,0xcacc,0xcacd,0xcacf,0xcad1,0xcad3,0xcad8, -0xcad9,0xcae0,0xcaec,0xcaf4,0xcb08,0xcb10,0xcb14,0xcb18, -0xcb20,0xcb21,0xcb41,0xcb48,0xcb49,0xcb4c,0xcb50,0xcb58, -0xcb59,0xcb5d,0xcb64,0xcb78,0xcb79,0xcb9c,0xcbb8,0xcbd4, -0xcbe4,0xcbe7,0xcbe9,0xcc0c,0xcc0d,0xcc10,0xcc14,0xcc1c, -0xcc1d,0xcc21,0xcc22,0xcc27,0xcc28,0xcc29,0xcc2c,0xcc2e, -0xcc30,0xcc38,0xcc39,0xcc3b,0xd63d,0xd63e,0xd63f,0xd641, -0xd642,0xd643,0xd644,0xd646,0xd647,0xd64a,0xd64c,0xd64e, -0xd64f,0xd650,0xd652,0xd653,0xd656,0xd657,0xd659,0xd65a, -0xd65b,0xd65d,0xd65e,0xd65f,0xd660,0xd661,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd662,0xd663,0xd664,0xd665, -0xd666,0xd668,0xd66a,0xd66b,0xd66c,0xd66d,0xd66e,0xd66f, -0xd672,0xd673,0xd675,0xd676,0xd677,0xd678,0xd679,0xd67a, -0xd67b,0xd67c,0xd67d,0xd67e,0xd67f,0xd680,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd681,0xd682,0xd684,0xd686, -0xd687,0xd688,0xd689,0xd68a,0xd68b,0xd68e,0xd68f,0xd691, -0xd692,0xd693,0xd695,0xd696,0xd697,0xd698,0xd699,0xd69a, -0xd69b,0xd69c,0xd69e,0xd6a0,0xd6a2,0xd6a3,0xd6a4,0xd6a5, -0xd6a6,0xd6a7,0xd6a9,0xd6aa,0xcc3c,0xcc3d,0xcc3e,0xcc44, -0xcc45,0xcc48,0xcc4c,0xcc54,0xcc55,0xcc57,0xcc58,0xcc59, -0xcc60,0xcc64,0xcc66,0xcc68,0xcc70,0xcc75,0xcc98,0xcc99, -0xcc9c,0xcca0,0xcca8,0xcca9,0xccab,0xccac,0xccad,0xccb4, -0xccb5,0xccb8,0xccbc,0xccc4,0xccc5,0xccc7,0xccc9,0xccd0, -0xccd4,0xcce4,0xccec,0xccf0,0xcd01,0xcd08,0xcd09,0xcd0c, -0xcd10,0xcd18,0xcd19,0xcd1b,0xcd1d,0xcd24,0xcd28,0xcd2c, -0xcd39,0xcd5c,0xcd60,0xcd64,0xcd6c,0xcd6d,0xcd6f,0xcd71, -0xcd78,0xcd88,0xcd94,0xcd95,0xcd98,0xcd9c,0xcda4,0xcda5, -0xcda7,0xcda9,0xcdb0,0xcdc4,0xcdcc,0xcdd0,0xcde8,0xcdec, -0xcdf0,0xcdf8,0xcdf9,0xcdfb,0xcdfd,0xce04,0xce08,0xce0c, -0xce14,0xce19,0xce20,0xce21,0xce24,0xce28,0xce30,0xce31, -0xce33,0xce35,0xd6ab,0xd6ad,0xd6ae,0xd6af,0xd6b1,0xd6b2, -0xd6b3,0xd6b4,0xd6b5,0xd6b6,0xd6b7,0xd6b8,0xd6ba,0xd6bc, -0xd6bd,0xd6be,0xd6bf,0xd6c0,0xd6c1,0xd6c2,0xd6c3,0xd6c6, -0xd6c7,0xd6c9,0xd6ca,0xd6cb,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd6cd,0xd6ce,0xd6cf,0xd6d0,0xd6d2,0xd6d3, -0xd6d5,0xd6d6,0xd6d8,0xd6da,0xd6db,0xd6dc,0xd6dd,0xd6de, -0xd6df,0xd6e1,0xd6e2,0xd6e3,0xd6e5,0xd6e6,0xd6e7,0xd6e9, -0xd6ea,0xd6eb,0xd6ec,0xd6ed,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd6ee,0xd6ef,0xd6f1,0xd6f2,0xd6f3,0xd6f4, -0xd6f6,0xd6f7,0xd6f8,0xd6f9,0xd6fa,0xd6fb,0xd6fe,0xd6ff, -0xd701,0xd702,0xd703,0xd705,0xd706,0xd707,0xd708,0xd709, -0xd70a,0xd70b,0xd70c,0xd70d,0xd70e,0xd70f,0xd710,0xd712, -0xd713,0xd714,0xce58,0xce59,0xce5c,0xce5f,0xce60,0xce61, -0xce68,0xce69,0xce6b,0xce6d,0xce74,0xce75,0xce78,0xce7c, -0xce84,0xce85,0xce87,0xce89,0xce90,0xce91,0xce94,0xce98, -0xcea0,0xcea1,0xcea3,0xcea4,0xcea5,0xceac,0xcead,0xcec1, -0xcee4,0xcee5,0xcee8,0xceeb,0xceec,0xcef4,0xcef5,0xcef7, -0xcef8,0xcef9,0xcf00,0xcf01,0xcf04,0xcf08,0xcf10,0xcf11, -0xcf13,0xcf15,0xcf1c,0xcf20,0xcf24,0xcf2c,0xcf2d,0xcf2f, -0xcf30,0xcf31,0xcf38,0xcf54,0xcf55,0xcf58,0xcf5c,0xcf64, -0xcf65,0xcf67,0xcf69,0xcf70,0xcf71,0xcf74,0xcf78,0xcf80, -0xcf85,0xcf8c,0xcfa1,0xcfa8,0xcfb0,0xcfc4,0xcfe0,0xcfe1, -0xcfe4,0xcfe8,0xcff0,0xcff1,0xcff3,0xcff5,0xcffc,0xd000, -0xd004,0xd011,0xd018,0xd02d,0xd034,0xd035,0xd038,0xd03c, -0xd715,0xd716,0xd717,0xd71a,0xd71b,0xd71d,0xd71e,0xd71f, -0xd721,0xd722,0xd723,0xd724,0xd725,0xd726,0xd727,0xd72a, -0xd72c,0xd72e,0xd72f,0xd730,0xd731,0xd732,0xd733,0xd736, -0xd737,0xd739,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd73a,0xd73b,0xd73d,0xd73e,0xd73f,0xd740,0xd741,0xd742, -0xd743,0xd745,0xd746,0xd748,0xd74a,0xd74b,0xd74c,0xd74d, -0xd74e,0xd74f,0xd752,0xd753,0xd755,0xd75a,0xd75b,0xd75c, -0xd75d,0xd75e,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd75f,0xd762,0xd764,0xd766,0xd767,0xd768,0xd76a,0xd76b, -0xd76d,0xd76e,0xd76f,0xd771,0xd772,0xd773,0xd775,0xd776, -0xd777,0xd778,0xd779,0xd77a,0xd77b,0xd77e,0xd77f,0xd780, -0xd782,0xd783,0xd784,0xd785,0xd786,0xd787,0xd78a,0xd78b, -0xd044,0xd045,0xd047,0xd049,0xd050,0xd054,0xd058,0xd060, -0xd06c,0xd06d,0xd070,0xd074,0xd07c,0xd07d,0xd081,0xd0a4, -0xd0a5,0xd0a8,0xd0ac,0xd0b4,0xd0b5,0xd0b7,0xd0b9,0xd0c0, -0xd0c1,0xd0c4,0xd0c8,0xd0c9,0xd0d0,0xd0d1,0xd0d3,0xd0d4, -0xd0d5,0xd0dc,0xd0dd,0xd0e0,0xd0e4,0xd0ec,0xd0ed,0xd0ef, -0xd0f0,0xd0f1,0xd0f8,0xd10d,0xd130,0xd131,0xd134,0xd138, -0xd13a,0xd140,0xd141,0xd143,0xd144,0xd145,0xd14c,0xd14d, -0xd150,0xd154,0xd15c,0xd15d,0xd15f,0xd161,0xd168,0xd16c, -0xd17c,0xd184,0xd188,0xd1a0,0xd1a1,0xd1a4,0xd1a8,0xd1b0, -0xd1b1,0xd1b3,0xd1b5,0xd1ba,0xd1bc,0xd1c0,0xd1d8,0xd1f4, -0xd1f8,0xd207,0xd209,0xd210,0xd22c,0xd22d,0xd230,0xd234, -0xd23c,0xd23d,0xd23f,0xd241,0xd248,0xd25c,0xd78d,0xd78e, -0xd78f,0xd791,0xd792,0xd793,0xd794,0xd795,0xd796,0xd797, -0xd79a,0xd79c,0xd79e,0xd79f,0xd7a0,0xd7a1,0xd7a2,0xd7a3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd264,0xd280, -0xd281,0xd284,0xd288,0xd290,0xd291,0xd295,0xd29c,0xd2a0, -0xd2a4,0xd2ac,0xd2b1,0xd2b8,0xd2b9,0xd2bc,0xd2bf,0xd2c0, -0xd2c2,0xd2c8,0xd2c9,0xd2cb,0xd2d4,0xd2d8,0xd2dc,0xd2e4, -0xd2e5,0xd2f0,0xd2f1,0xd2f4,0xd2f8,0xd300,0xd301,0xd303, -0xd305,0xd30c,0xd30d,0xd30e,0xd310,0xd314,0xd316,0xd31c, -0xd31d,0xd31f,0xd320,0xd321,0xd325,0xd328,0xd329,0xd32c, -0xd330,0xd338,0xd339,0xd33b,0xd33c,0xd33d,0xd344,0xd345, -0xd37c,0xd37d,0xd380,0xd384,0xd38c,0xd38d,0xd38f,0xd390, -0xd391,0xd398,0xd399,0xd39c,0xd3a0,0xd3a8,0xd3a9,0xd3ab, -0xd3ad,0xd3b4,0xd3b8,0xd3bc,0xd3c4,0xd3c5,0xd3c8,0xd3c9, -0xd3d0,0xd3d8,0xd3e1,0xd3e3,0xd3ec,0xd3ed,0xd3f0,0xd3f4, -0xd3fc,0xd3fd,0xd3ff,0xd401}; - -static const int uhc2_ucs_table_size = (sizeof(uhc2_ucs_table)/sizeof(unsigned short)); - -static const unsigned short uhc3_ucs_table[] = { -0xd408,0xd41d,0xd440,0xd444,0xd45c,0xd460,0xd464,0xd46d, -0xd46f,0xd478,0xd479,0xd47c,0xd47f,0xd480,0xd482,0xd488, -0xd489,0xd48b,0xd48d,0xd494,0xd4a9,0xd4cc,0xd4d0,0xd4d4, -0xd4dc,0xd4df,0xd4e8,0xd4ec,0xd4f0,0xd4f8,0xd4fb,0xd4fd, -0xd504,0xd508,0xd50c,0xd514,0xd515,0xd517,0xd53c,0xd53d, -0xd540,0xd544,0xd54c,0xd54d,0xd54f,0xd551,0xd558,0xd559, -0xd55c,0xd560,0xd565,0xd568,0xd569,0xd56b,0xd56d,0xd574, -0xd575,0xd578,0xd57c,0xd584,0xd585,0xd587,0xd588,0xd589, -0xd590,0xd5a5,0xd5c8,0xd5c9,0xd5cc,0xd5d0,0xd5d2,0xd5d8, -0xd5d9,0xd5db,0xd5dd,0xd5e4,0xd5e5,0xd5e8,0xd5ec,0xd5f4, -0xd5f5,0xd5f7,0xd5f9,0xd600,0xd601,0xd604,0xd608,0xd610, -0xd611,0xd613,0xd614,0xd615,0xd61c,0xd620,0xd624,0xd62d, -0xd638,0xd639,0xd63c,0xd640,0xd645,0xd648,0xd649,0xd64b, -0xd64d,0xd651,0xd654,0xd655,0xd658,0xd65c,0xd667,0xd669, -0xd670,0xd671,0xd674,0xd683,0xd685,0xd68c,0xd68d,0xd690, -0xd694,0xd69d,0xd69f,0xd6a1,0xd6a8,0xd6ac,0xd6b0,0xd6b9, -0xd6bb,0xd6c4,0xd6c5,0xd6c8,0xd6cc,0xd6d1,0xd6d4,0xd6d7, -0xd6d9,0xd6e0,0xd6e4,0xd6e8,0xd6f0,0xd6f5,0xd6fc,0xd6fd, -0xd700,0xd704,0xd711,0xd718,0xd719,0xd71c,0xd720,0xd728, -0xd729,0xd72b,0xd72d,0xd734,0xd735,0xd738,0xd73c,0xd744, -0xd747,0xd749,0xd750,0xd751,0xd754,0xd756,0xd757,0xd758, -0xd759,0xd760,0xd761,0xd763,0xd765,0xd769,0xd76c,0xd770, -0xd774,0xd77c,0xd77d,0xd781,0xd788,0xd789,0xd78c,0xd790, -0xd798,0xd799,0xd79b,0xd79d,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x4f3d,0x4f73,0x5047,0x50f9,0x52a0,0x53ef, -0x5475,0x54e5,0x5609,0x5ac1,0x5bb6,0x6687,0x67b6,0x67b7, -0x67ef,0x6b4c,0x73c2,0x75c2,0x7a3c,0x82db,0x8304,0x8857, -0x8888,0x8a36,0x8cc8,0x8dcf,0x8efb,0x8fe6,0x99d5,0x523b, -0x5374,0x5404,0x606a,0x6164,0x6bbc,0x73cf,0x811a,0x89ba, -0x89d2,0x95a3,0x4f83,0x520a,0x58be,0x5978,0x59e6,0x5e72, -0x5e79,0x61c7,0x63c0,0x6746,0x67ec,0x687f,0x6f97,0x764e, -0x770b,0x78f5,0x7a08,0x7aff,0x7c21,0x809d,0x826e,0x8271, -0x8aeb,0x9593,0x4e6b,0x559d,0x66f7,0x6e34,0x78a3,0x7aed, -0x845b,0x8910,0x874e,0x97a8,0x52d8,0x574e,0x582a,0x5d4c, -0x611f,0x61be,0x6221,0x6562,0x67d1,0x6a44,0x6e1b,0x7518, -0x75b3,0x76e3,0x77b0,0x7d3a,0x90af,0x9451,0x9452,0x9f95, -0x5323,0x5cac,0x7532,0x80db,0x9240,0x9598,0x525b,0x5808, -0x59dc,0x5ca1,0x5d17,0x5eb7,0x5f3a,0x5f4a,0x6177,0x6c5f, -0x757a,0x7586,0x7ce0,0x7d73,0x7db1,0x7f8c,0x8154,0x8221, -0x8591,0x8941,0x8b1b,0x92fc,0x964d,0x9c47,0x4ecb,0x4ef7, -0x500b,0x51f1,0x584f,0x6137,0x613e,0x6168,0x6539,0x69ea, -0x6f11,0x75a5,0x7686,0x76d6,0x7b87,0x82a5,0x84cb,0xf900, -0x93a7,0x958b,0x5580,0x5ba2,0x5751,0xf901,0x7cb3,0x7fb9, -0x91b5,0x5028,0x53bb,0x5c45,0x5de8,0x62d2,0x636e,0x64da, -0x64e7,0x6e20,0x70ac,0x795b,0x8ddd,0x8e1e,0xf902,0x907d, -0x9245,0x92f8,0x4e7e,0x4ef6,0x5065,0x5dfe,0x5efa,0x6106, -0x6957,0x8171,0x8654,0x8e47,0x9375,0x9a2b,0x4e5e,0x5091, -0x6770,0x6840,0x5109,0x528d,0x5292,0x6aa2,0x77bc,0x9210, -0x9ed4,0x52ab,0x602f,0x8ff2,0x5048,0x61a9,0x63ed,0x64ca, -0x683c,0x6a84,0x6fc0,0x8188,0x89a1,0x9694,0x5805,0x727d, -0x72ac,0x7504,0x7d79,0x7e6d,0x80a9,0x898b,0x8b74,0x9063, -0x9d51,0x6289,0x6c7a,0x6f54,0x7d50,0x7f3a,0x8a23,0x517c, -0x614a,0x7b9d,0x8b19,0x9257,0x938c,0x4eac,0x4fd3,0x501e, -0x50be,0x5106,0x52c1,0x52cd,0x537f,0x5770,0x5883,0x5e9a, -0x5f91,0x6176,0x61ac,0x64ce,0x656c,0x666f,0x66bb,0x66f4, -0x6897,0x6d87,0x7085,0x70f1,0x749f,0x74a5,0x74ca,0x75d9, -0x786c,0x78ec,0x7adf,0x7af6,0x7d45,0x7d93,0x8015,0x803f, -0x811b,0x8396,0x8b66,0x8f15,0x9015,0x93e1,0x9803,0x9838, -0x9a5a,0x9be8,0x4fc2,0x5553,0x583a,0x5951,0x5b63,0x5c46, -0x60b8,0x6212,0x6842,0x68b0,0x68e8,0x6eaa,0x754c,0x7678, -0x78ce,0x7a3d,0x7cfb,0x7e6b,0x7e7c,0x8a08,0x8aa1,0x8c3f, -0x968e,0x9dc4,0x53e4,0x53e9,0x544a,0x5471,0x56fa,0x59d1, -0x5b64,0x5c3b,0x5eab,0x62f7,0x6537,0x6545,0x6572,0x66a0, -0x67af,0x69c1,0x6cbd,0x75fc,0x7690,0x777e,0x7a3f,0x7f94, -0x8003,0x80a1,0x818f,0x82e6,0x82fd,0x83f0,0x85c1,0x8831, -0x88b4,0x8aa5,0xf903,0x8f9c,0x932e,0x96c7,0x9867,0x9ad8, -0x9f13,0x54ed,0x659b,0x66f2,0x688f,0x7a40,0x8c37,0x9d60, -0x56f0,0x5764,0x5d11,0x6606,0x68b1,0x68cd,0x6efe,0x7428, -0x889e,0x9be4,0x6c68,0xf904,0x9aa8,0x4f9b,0x516c,0x5171, -0x529f,0x5b54,0x5de5,0x6050,0x606d,0x62f1,0x63a7,0x653b, -0x73d9,0x7a7a,0x86a3,0x8ca2,0x978f,0x4e32,0x5be1,0x6208, -0x679c,0x74dc,0x79d1,0x83d3,0x8a87,0x8ab2,0x8de8,0x904e, -0x934b,0x9846,0x5ed3,0x69e8,0x85ff,0x90ed,0xf905,0x51a0, -0x5b98,0x5bec,0x6163,0x68fa,0x6b3e,0x704c,0x742f,0x74d8, -0x7ba1,0x7f50,0x83c5,0x89c0,0x8cab,0x95dc,0x9928,0x522e, -0x605d,0x62ec,0x9002,0x4f8a,0x5149,0x5321,0x58d9,0x5ee3, -0x66e0,0x6d38,0x709a,0x72c2,0x73d6,0x7b50,0x80f1,0x945b, -0x5366,0x639b,0x7f6b,0x4e56,0x5080,0x584a,0x58de,0x602a, -0x6127,0x62d0,0x69d0,0x9b41,0x5b8f,0x7d18,0x80b1,0x8f5f, -0x4ea4,0x50d1,0x54ac,0x55ac,0x5b0c,0x5da0,0x5de7,0x652a, -0x654e,0x6821,0x6a4b,0x72e1,0x768e,0x77ef,0x7d5e,0x7ff9, -0x81a0,0x854e,0x86df,0x8f03,0x8f4e,0x90ca,0x9903,0x9a55, -0x9bab,0x4e18,0x4e45,0x4e5d,0x4ec7,0x4ff1,0x5177,0x52fe, -0x5340,0x53e3,0x53e5,0x548e,0x5614,0x5775,0x57a2,0x5bc7, -0x5d87,0x5ed0,0x61fc,0x62d8,0x6551,0x67b8,0x67e9,0x69cb, -0x6b50,0x6bc6,0x6bec,0x6c42,0x6e9d,0x7078,0x72d7,0x7396, -0x7403,0x77bf,0x77e9,0x7a76,0x7d7f,0x8009,0x81fc,0x8205, -0x820a,0x82df,0x8862,0x8b33,0x8cfc,0x8ec0,0x9011,0x90b1, -0x9264,0x92b6,0x99d2,0x9a45,0x9ce9,0x9dd7,0x9f9c,0x570b, -0x5c40,0x83ca,0x97a0,0x97ab,0x9eb4,0x541b,0x7a98,0x7fa4, -0x88d9,0x8ecd,0x90e1,0x5800,0x5c48,0x6398,0x7a9f,0x5bae, -0x5f13,0x7a79,0x7aae,0x828e,0x8eac,0x5026,0x5238,0x52f8, -0x5377,0x5708,0x62f3,0x6372,0x6b0a,0x6dc3,0x7737,0x53a5, -0x7357,0x8568,0x8e76,0x95d5,0x673a,0x6ac3,0x6f70,0x8a6d, -0x8ecc,0x994b,0xf906,0x6677,0x6b78,0x8cb4,0x9b3c,0xf907, -0x53eb,0x572d,0x594e,0x63c6,0x69fb,0x73ea,0x7845,0x7aba, -0x7ac5,0x7cfe,0x8475,0x898f,0x8d73,0x9035,0x95a8,0x52fb, -0x5747,0x7547,0x7b60,0x83cc,0x921e,0xf908,0x6a58,0x514b, -0x524b,0x5287,0x621f,0x68d8,0x6975,0x9699,0x50c5,0x52a4, -0x52e4,0x61c3,0x65a4,0x6839,0x69ff,0x747e,0x7b4b,0x82b9, -0x83eb,0x89b2,0x8b39,0x8fd1,0x9949,0xf909,0x4eca,0x5997, -0x64d2,0x6611,0x6a8e,0x7434,0x7981,0x79bd,0x82a9,0x887e, -0x887f,0x895f,0xf90a,0x9326,0x4f0b,0x53ca,0x6025,0x6271, -0x6c72,0x7d1a,0x7d66,0x4e98,0x5162,0x77dc,0x80af,0x4f01, -0x4f0e,0x5176,0x5180,0x55dc,0x5668,0x573b,0x57fa,0x57fc, -0x5914,0x5947,0x5993,0x5bc4,0x5c90,0x5d0e,0x5df1,0x5e7e, -0x5fcc,0x6280,0x65d7,0x65e3,0x671e,0x671f,0x675e,0x68cb, -0x68c4,0x6a5f,0x6b3a,0x6c23,0x6c7d,0x6c82,0x6dc7,0x7398, -0x7426,0x742a,0x7482,0x74a3,0x7578,0x757f,0x7881,0x78ef, -0x7941,0x7947,0x7948,0x797a,0x7b95,0x7d00,0x7dba,0x7f88, -0x8006,0x802d,0x808c,0x8a18,0x8b4f,0x8c48,0x8d77,0x9321, -0x9324,0x98e2,0x9951,0x9a0e,0x9a0f,0x9a65,0x9e92,0x7dca, -0x4f76,0x5409,0x62ee,0x6854,0x91d1,0x55ab,0x513a,0xf90b, -0xf90c,0x5a1c,0x61e6,0xf90d,0x62cf,0x62ff,0xf90e,0xf90f, -0xf910,0xf911,0xf912,0xf913,0x90a3,0xf914,0xf915,0xf916, -0xf917,0xf918,0x8afe,0xf919,0xf91a,0xf91b,0xf91c,0x6696, -0xf91d,0x7156,0xf91e,0xf91f,0x96e3,0xf920,0x634f,0x637a, -0x5357,0xf921,0x678f,0x6960,0x6e73,0xf922,0x7537,0xf923, -0xf924,0xf925,0x7d0d,0xf926,0xf927,0x8872,0x56ca,0x5a18, -0xf928,0xf929,0xf92a,0xf92b,0xf92c,0x4e43,0xf92d,0x5167, -0x5948,0x67f0,0x8010,0xf92e,0x5973,0x5e74,0x649a,0x79ca, -0x5ff5,0x606c,0x62c8,0x637b,0x5be7,0x5bd7,0x52aa,0xf92f, -0x5974,0x5f29,0x6012,0xf930,0xf931,0xf932,0x7459,0xf933, -0xf934,0xf935,0xf936,0xf937,0xf938,0x99d1,0xf939,0xf93a, -0xf93b,0xf93c,0xf93d,0xf93e,0xf93f,0xf940,0xf941,0xf942, -0xf943,0x6fc3,0xf944,0xf945,0x81bf,0x8fb2,0x60f1,0xf946, -0xf947,0x8166,0xf948,0xf949,0x5c3f,0xf94a,0xf94b,0xf94c, -0xf94d,0xf94e,0xf94f,0xf950,0xf951,0x5ae9,0x8a25,0x677b, -0x7d10,0xf952,0xf953,0xf954,0xf955,0xf956,0xf957,0x80fd, -0xf958,0xf959,0x5c3c,0x6ce5,0x533f,0x6eba,0x591a,0x8336, -0x4e39,0x4eb6,0x4f46,0x55ae,0x5718,0x58c7,0x5f56,0x65b7, -0x65e6,0x6a80,0x6bb5,0x6e4d,0x77ed,0x7aef,0x7c1e,0x7dde, -0x86cb,0x8892,0x9132,0x935b,0x64bb,0x6fbe,0x737a,0x75b8, -0x9054,0x5556,0x574d,0x61ba,0x64d4,0x66c7,0x6de1,0x6e5b, -0x6f6d,0x6fb9,0x75f0,0x8043,0x81bd,0x8541,0x8983,0x8ac7, -0x8b5a,0x931f,0x6c93,0x7553,0x7b54,0x8e0f,0x905d,0x5510, -0x5802,0x5858,0x5e62,0x6207,0x649e,0x68e0,0x7576,0x7cd6, -0x87b3,0x9ee8,0x4ee3,0x5788,0x576e,0x5927,0x5c0d,0x5cb1, -0x5e36,0x5f85,0x6234,0x64e1,0x73b3,0x81fa,0x888b,0x8cb8, -0x968a,0x9edb,0x5b85,0x5fb7,0x60b3,0x5012,0x5200,0x5230, -0x5716,0x5835,0x5857,0x5c0e,0x5c60,0x5cf6,0x5d8b,0x5ea6, -0x5f92,0x60bc,0x6311,0x6389,0x6417,0x6843,0x68f9,0x6ac2, -0x6dd8,0x6e21,0x6ed4,0x6fe4,0x71fe,0x76dc,0x7779,0x79b1, -0x7a3b,0x8404,0x89a9,0x8ced,0x8df3,0x8e48,0x9003,0x9014, -0x9053,0x90fd,0x934d,0x9676,0x97dc,0x6bd2,0x7006,0x7258, -0x72a2,0x7368,0x7763,0x79bf,0x7be4,0x7e9b,0x8b80,0x58a9, -0x60c7,0x6566,0x65fd,0x66be,0x6c8c,0x711e,0x71c9,0x8c5a, -0x9813,0x4e6d,0x7a81,0x4edd,0x51ac,0x51cd,0x52d5,0x540c, -0x61a7,0x6771,0x6850,0x68df,0x6d1e,0x6f7c,0x75bc,0x77b3, -0x7ae5,0x80f4,0x8463,0x9285,0x515c,0x6597,0x675c,0x6793, -0x75d8,0x7ac7,0x8373,0xf95a,0x8c46,0x9017,0x982d,0x5c6f, -0x81c0,0x829a,0x9041,0x906f,0x920d,0x5f97,0x5d9d,0x6a59, -0x71c8,0x767b,0x7b49,0x85e4,0x8b04,0x9127,0x9a30,0x5587, -0x61f6,0xf95b,0x7669,0x7f85,0x863f,0x87ba,0x88f8,0x908f, -0xf95c,0x6d1b,0x70d9,0x73de,0x7d61,0x843d,0xf95d,0x916a, -0x99f1,0xf95e,0x4e82,0x5375,0x6b04,0x6b12,0x703e,0x721b, -0x862d,0x9e1e,0x524c,0x8fa3,0x5d50,0x64e5,0x652c,0x6b16, -0x6feb,0x7c43,0x7e9c,0x85cd,0x8964,0x89bd,0x62c9,0x81d8, -0x881f,0x5eca,0x6717,0x6d6a,0x72fc,0x7405,0x746f,0x8782, -0x90de,0x4f86,0x5d0d,0x5fa0,0x840a,0x51b7,0x63a0,0x7565, -0x4eae,0x5006,0x5169,0x51c9,0x6881,0x6a11,0x7cae,0x7cb1, -0x7ce7,0x826f,0x8ad2,0x8f1b,0x91cf,0x4fb6,0x5137,0x52f5, -0x5442,0x5eec,0x616e,0x623e,0x65c5,0x6ada,0x6ffe,0x792a, -0x85dc,0x8823,0x95ad,0x9a62,0x9a6a,0x9e97,0x9ece,0x529b, -0x66c6,0x6b77,0x701d,0x792b,0x8f62,0x9742,0x6190,0x6200, -0x6523,0x6f23,0x7149,0x7489,0x7df4,0x806f,0x84ee,0x8f26, -0x9023,0x934a,0x51bd,0x5217,0x52a3,0x6d0c,0x70c8,0x88c2, -0x5ec9,0x6582,0x6bae,0x6fc2,0x7c3e,0x7375,0x4ee4,0x4f36, -0x56f9,0xf95f,0x5cba,0x5dba,0x601c,0x73b2,0x7b2d,0x7f9a, -0x7fce,0x8046,0x901e,0x9234,0x96f6,0x9748,0x9818,0x9f61, -0x4f8b,0x6fa7,0x79ae,0x91b4,0x96b7,0x52de,0xf960,0x6488, -0x64c4,0x6ad3,0x6f5e,0x7018,0x7210,0x76e7,0x8001,0x8606, -0x865c,0x8def,0x8f05,0x9732,0x9b6f,0x9dfa,0x9e75,0x788c, -0x797f,0x7da0,0x83c9,0x9304,0x9e7f,0x9e93,0x8ad6,0x58df, -0x5f04,0x6727,0x7027,0x74cf,0x7c60,0x807e,0x5121,0x7028, -0x7262,0x78ca,0x8cc2,0x8cda,0x8cf4,0x96f7,0x4e86,0x50da, -0x5bee,0x5ed6,0x6599,0x71ce,0x7642,0x77ad,0x804a,0x84fc, -0x907c,0x9b27,0x9f8d,0x58d8,0x5a41,0x5c62,0x6a13,0x6dda, -0x6f0f,0x763b,0x7d2f,0x7e37,0x851e,0x8938,0x93e4,0x964b, -0x5289,0x65d2,0x67f3,0x69b4,0x6d41,0x6e9c,0x700f,0x7409, -0x7460,0x7559,0x7624,0x786b,0x8b2c,0x985e,0x516d,0x622e, -0x9678,0x4f96,0x502b,0x5d19,0x6dea,0x7db8,0x8f2a,0x5f8b, -0x6144,0x6817,0xf961,0x9686,0x52d2,0x808b,0x51dc,0x51cc, -0x695e,0x7a1c,0x7dbe,0x83f1,0x9675,0x4fda,0x5229,0x5398, -0x540f,0x550e,0x5c65,0x60a7,0x674e,0x68a8,0x6d6c,0x7281, -0x72f8,0x7406,0x7483,0xf962,0x75e2,0x7c6c,0x7f79,0x7fb8, -0x8389,0x88cf,0x88e1,0x91cc,0x91d0,0x96e2,0x9bc9,0x541d, -0x6f7e,0x71d0,0x7498,0x85fa,0x8eaa,0x96a3,0x9c57,0x9e9f, -0x6797,0x6dcb,0x7433,0x81e8,0x9716,0x782c,0x7acb,0x7b20, -0x7c92,0x6469,0x746a,0x75f2,0x78bc,0x78e8,0x99ac,0x9b54, -0x9ebb,0x5bde,0x5e55,0x6f20,0x819c,0x83ab,0x9088,0x4e07, -0x534d,0x5a29,0x5dd2,0x5f4e,0x6162,0x633d,0x6669,0x66fc, -0x6eff,0x6f2b,0x7063,0x779e,0x842c,0x8513,0x883b,0x8f13, -0x9945,0x9c3b,0x551c,0x62b9,0x672b,0x6cab,0x8309,0x896a, -0x977a,0x4ea1,0x5984,0x5fd8,0x5fd9,0x671b,0x7db2,0x7f54, -0x8292,0x832b,0x83bd,0x8f1e,0x9099,0x57cb,0x59b9,0x5a92, -0x5bd0,0x6627,0x679a,0x6885,0x6bcf,0x7164,0x7f75,0x8cb7, -0x8ce3,0x9081,0x9b45,0x8108,0x8c8a,0x964c,0x9a40,0x9ea5, -0x5b5f,0x6c13,0x731b,0x76f2,0x76df,0x840c,0x51aa,0x8993, -0x514d,0x5195,0x52c9,0x68c9,0x6c94,0x7704,0x7720,0x7dbf, -0x7dec,0x9762,0x9eb5,0x6ec5,0x8511,0x51a5,0x540d,0x547d, -0x660e,0x669d,0x6927,0x6e9f,0x76bf,0x7791,0x8317,0x84c2, -0x879f,0x9169,0x9298,0x9cf4,0x8882,0x4fae,0x5192,0x52df, -0x59c6,0x5e3d,0x6155,0x6478,0x6479,0x66ae,0x67d0,0x6a21, -0x6bcd,0x6bdb,0x725f,0x7261,0x7441,0x7738,0x77db,0x8017, -0x82bc,0x8305,0x8b00,0x8b28,0x8c8c,0x6728,0x6c90,0x7267, -0x76ee,0x7766,0x7a46,0x9da9,0x6b7f,0x6c92,0x5922,0x6726, -0x8499,0x536f,0x5893,0x5999,0x5edf,0x63cf,0x6634,0x6773, -0x6e3a,0x732b,0x7ad7,0x82d7,0x9328,0x52d9,0x5deb,0x61ae, -0x61cb,0x620a,0x62c7,0x64ab,0x65e0,0x6959,0x6b66,0x6bcb, -0x7121,0x73f7,0x755d,0x7e46,0x821e,0x8302,0x856a,0x8aa3, -0x8cbf,0x9727,0x9d61,0x58a8,0x9ed8,0x5011,0x520e,0x543b, -0x554f,0x6587,0x6c76,0x7d0a,0x7d0b,0x805e,0x868a,0x9580, -0x96ef,0x52ff,0x6c95,0x7269,0x5473,0x5a9a,0x5c3e,0x5d4b, -0x5f4c,0x5fae,0x672a,0x68b6,0x6963,0x6e3c,0x6e44,0x7709, -0x7c73,0x7f8e,0x8587,0x8b0e,0x8ff7,0x9761,0x9ef4,0x5cb7, -0x60b6,0x610d,0x61ab,0x654f,0x65fb,0x65fc,0x6c11,0x6cef, -0x739f,0x73c9,0x7de1,0x9594,0x5bc6,0x871c,0x8b10,0x525d, -0x535a,0x62cd,0x640f,0x64b2,0x6734,0x6a38,0x6cca,0x73c0, -0x749e,0x7b94,0x7c95,0x7e1b,0x818a,0x8236,0x8584,0x8feb, -0x96f9,0x99c1,0x4f34,0x534a,0x53cd,0x53db,0x62cc,0x642c, -0x6500,0x6591,0x69c3,0x6cee,0x6f58,0x73ed,0x7554,0x7622, -0x76e4,0x76fc,0x78d0,0x78fb,0x792c,0x7d46,0x822c,0x87e0, -0x8fd4,0x9812,0x98ef,0x52c3,0x62d4,0x64a5,0x6e24,0x6f51, -0x767c,0x8dcb,0x91b1,0x9262,0x9aee,0x9b43,0x5023,0x508d, -0x574a,0x59a8,0x5c28,0x5e47,0x5f77,0x623f,0x653e,0x65b9, -0x65c1,0x6609,0x678b,0x699c,0x6ec2,0x78c5,0x7d21,0x80aa, -0x8180,0x822b,0x82b3,0x84a1,0x868c,0x8a2a,0x8b17,0x90a6, -0x9632,0x9f90,0x500d,0x4ff3,0xf963,0x57f9,0x5f98,0x62dc, -0x6392,0x676f,0x6e43,0x7119,0x76c3,0x80cc,0x80da,0x88f4, -0x88f5,0x8919,0x8ce0,0x8f29,0x914d,0x966a,0x4f2f,0x4f70, -0x5e1b,0x67cf,0x6822,0x767d,0x767e,0x9b44,0x5e61,0x6a0a, -0x7169,0x71d4,0x756a,0xf964,0x7e41,0x8543,0x85e9,0x98dc, -0x4f10,0x7b4f,0x7f70,0x95a5,0x51e1,0x5e06,0x68b5,0x6c3e, -0x6c4e,0x6cdb,0x72af,0x7bc4,0x8303,0x6cd5,0x743a,0x50fb, -0x5288,0x58c1,0x64d8,0x6a97,0x74a7,0x7656,0x78a7,0x8617, -0x95e2,0x9739,0xf965,0x535e,0x5f01,0x8b8a,0x8fa8,0x8faf, -0x908a,0x5225,0x77a5,0x9c49,0x9f08,0x4e19,0x5002,0x5175, -0x5c5b,0x5e77,0x661e,0x663a,0x67c4,0x68c5,0x70b3,0x7501, -0x75c5,0x79c9,0x7add,0x8f27,0x9920,0x9a08,0x4fdd,0x5821, -0x5831,0x5bf6,0x666e,0x6b65,0x6d11,0x6e7a,0x6f7d,0x73e4, -0x752b,0x83e9,0x88dc,0x8913,0x8b5c,0x8f14,0x4f0f,0x50d5, -0x5310,0x535c,0x5b93,0x5fa9,0x670d,0x798f,0x8179,0x832f, -0x8514,0x8907,0x8986,0x8f39,0x8f3b,0x99a5,0x9c12,0x672c, -0x4e76,0x4ff8,0x5949,0x5c01,0x5cef,0x5cf0,0x6367,0x68d2, -0x70fd,0x71a2,0x742b,0x7e2b,0x84ec,0x8702,0x9022,0x92d2, -0x9cf3,0x4e0d,0x4ed8,0x4fef,0x5085,0x5256,0x526f,0x5426, -0x5490,0x57e0,0x592b,0x5a66,0x5b5a,0x5b75,0x5bcc,0x5e9c, -0xf966,0x6276,0x6577,0x65a7,0x6d6e,0x6ea5,0x7236,0x7b26, -0x7c3f,0x7f36,0x8150,0x8151,0x819a,0x8240,0x8299,0x83a9, -0x8a03,0x8ca0,0x8ce6,0x8cfb,0x8d74,0x8dba,0x90e8,0x91dc, -0x961c,0x9644,0x99d9,0x9ce7,0x5317,0x5206,0x5429,0x5674, -0x58b3,0x5954,0x596e,0x5fff,0x61a4,0x626e,0x6610,0x6c7e, -0x711a,0x76c6,0x7c89,0x7cde,0x7d1b,0x82ac,0x8cc1,0x96f0, -0xf967,0x4f5b,0x5f17,0x5f7f,0x62c2,0x5d29,0x670b,0x68da, -0x787c,0x7e43,0x9d6c,0x4e15,0x5099,0x5315,0x532a,0x5351, -0x5983,0x5a62,0x5e87,0x60b2,0x618a,0x6249,0x6279,0x6590, -0x6787,0x69a7,0x6bd4,0x6bd6,0x6bd7,0x6bd8,0x6cb8,0xf968, -0x7435,0x75fa,0x7812,0x7891,0x79d5,0x79d8,0x7c83,0x7dcb, -0x7fe1,0x80a5,0x813e,0x81c2,0x83f2,0x871a,0x88e8,0x8ab9, -0x8b6c,0x8cbb,0x9119,0x975e,0x98db,0x9f3b,0x56ac,0x5b2a, -0x5f6c,0x658c,0x6ab3,0x6baf,0x6d5c,0x6ff1,0x7015,0x725d, -0x73ad,0x8ca7,0x8cd3,0x983b,0x6191,0x6c37,0x8058,0x9a01, -0x4e4d,0x4e8b,0x4e9b,0x4ed5,0x4f3a,0x4f3c,0x4f7f,0x4fdf, -0x50ff,0x53f2,0x53f8,0x5506,0x55e3,0x56db,0x58eb,0x5962, -0x5a11,0x5beb,0x5bfa,0x5c04,0x5df3,0x5e2b,0x5f99,0x601d, -0x6368,0x659c,0x65af,0x67f6,0x67fb,0x68ad,0x6b7b,0x6c99, -0x6cd7,0x6e23,0x7009,0x7345,0x7802,0x793e,0x7940,0x7960, -0x79c1,0x7be9,0x7d17,0x7d72,0x8086,0x820d,0x838e,0x84d1, -0x86c7,0x88df,0x8a50,0x8a5e,0x8b1d,0x8cdc,0x8d66,0x8fad, -0x90aa,0x98fc,0x99df,0x9e9d,0x524a,0xf969,0x6714,0xf96a, -0x5098,0x522a,0x5c71,0x6563,0x6c55,0x73ca,0x7523,0x759d, -0x7b97,0x849c,0x9178,0x9730,0x4e77,0x6492,0x6bba,0x715e, -0x85a9,0x4e09,0xf96b,0x6749,0x68ee,0x6e17,0x829f,0x8518, -0x886b,0x63f7,0x6f81,0x9212,0x98af,0x4e0a,0x50b7,0x50cf, -0x511f,0x5546,0x55aa,0x5617,0x5b40,0x5c19,0x5ce0,0x5e38, -0x5e8a,0x5ea0,0x5ec2,0x60f3,0x6851,0x6a61,0x6e58,0x723d, -0x7240,0x72c0,0x76f8,0x7965,0x7bb1,0x7fd4,0x88f3,0x89f4, -0x8a73,0x8c61,0x8cde,0x971c,0x585e,0x74bd,0x8cfd,0x55c7, -0xf96c,0x7a61,0x7d22,0x8272,0x7272,0x751f,0x7525,0xf96d, -0x7b19,0x5885,0x58fb,0x5dbc,0x5e8f,0x5eb6,0x5f90,0x6055, -0x6292,0x637f,0x654d,0x6691,0x66d9,0x66f8,0x6816,0x68f2, -0x7280,0x745e,0x7b6e,0x7d6e,0x7dd6,0x7f72,0x80e5,0x8212, -0x85af,0x897f,0x8a93,0x901d,0x92e4,0x9ecd,0x9f20,0x5915, -0x596d,0x5e2d,0x60dc,0x6614,0x6673,0x6790,0x6c50,0x6dc5, -0x6f5f,0x77f3,0x78a9,0x84c6,0x91cb,0x932b,0x4ed9,0x50ca, -0x5148,0x5584,0x5b0b,0x5ba3,0x6247,0x657e,0x65cb,0x6e32, -0x717d,0x7401,0x7444,0x7487,0x74bf,0x766c,0x79aa,0x7dda, -0x7e55,0x7fa8,0x817a,0x81b3,0x8239,0x861a,0x87ec,0x8a75, -0x8de3,0x9078,0x9291,0x9425,0x994d,0x9bae,0x5368,0x5c51, -0x6954,0x6cc4,0x6d29,0x6e2b,0x820c,0x859b,0x893b,0x8a2d, -0x8aaa,0x96ea,0x9f67,0x5261,0x66b9,0x6bb2,0x7e96,0x87fe, -0x8d0d,0x9583,0x965d,0x651d,0x6d89,0x71ee,0xf96e,0x57ce, -0x59d3,0x5bac,0x6027,0x60fa,0x6210,0x661f,0x665f,0x7329, -0x73f9,0x76db,0x7701,0x7b6c,0x8056,0x8072,0x8165,0x8aa0, -0x9192,0x4e16,0x52e2,0x6b72,0x6d17,0x7a05,0x7b39,0x7d30, -0xf96f,0x8cb0,0x53ec,0x562f,0x5851,0x5bb5,0x5c0f,0x5c11, -0x5de2,0x6240,0x6383,0x6414,0x662d,0x68b3,0x6cbc,0x6d88, -0x6eaf,0x701f,0x70a4,0x71d2,0x7526,0x758f,0x758e,0x7619, -0x7b11,0x7be0,0x7c2b,0x7d20,0x7d39,0x852c,0x856d,0x8607, -0x8a34,0x900d,0x9061,0x90b5,0x92b7,0x97f6,0x9a37,0x4fd7, -0x5c6c,0x675f,0x6d91,0x7c9f,0x7e8c,0x8b16,0x8d16,0x901f, -0x5b6b,0x5dfd,0x640d,0x84c0,0x905c,0x98e1,0x7387,0x5b8b, -0x609a,0x677e,0x6dde,0x8a1f,0x8aa6,0x9001,0x980c,0x5237, -0xf970,0x7051,0x788e,0x9396,0x8870,0x91d7,0x4fee,0x53d7, -0x55fd,0x56da,0x5782,0x58fd,0x5ac2,0x5b88,0x5cab,0x5cc0, -0x5e25,0x6101,0x620d,0x624b,0x6388,0x641c,0x6536,0x6578, -0x6a39,0x6b8a,0x6c34,0x6d19,0x6f31,0x71e7,0x72e9,0x7378, -0x7407,0x74b2,0x7626,0x7761,0x79c0,0x7a57,0x7aea,0x7cb9, -0x7d8f,0x7dac,0x7e61,0x7f9e,0x8129,0x8331,0x8490,0x84da, -0x85ea,0x8896,0x8ab0,0x8b90,0x8f38,0x9042,0x9083,0x916c, -0x9296,0x92b9,0x968b,0x96a7,0x96a8,0x96d6,0x9700,0x9808, -0x9996,0x9ad3,0x9b1a,0x53d4,0x587e,0x5919,0x5b70,0x5bbf, -0x6dd1,0x6f5a,0x719f,0x7421,0x74b9,0x8085,0x83fd,0x5de1, -0x5f87,0x5faa,0x6042,0x65ec,0x6812,0x696f,0x6a53,0x6b89, -0x6d35,0x6df3,0x73e3,0x76fe,0x77ac,0x7b4d,0x7d14,0x8123, -0x821c,0x8340,0x84f4,0x8563,0x8a62,0x8ac4,0x9187,0x931e, -0x9806,0x99b4,0x620c,0x8853,0x8ff0,0x9265,0x5d07,0x5d27, -0x5d69,0x745f,0x819d,0x8768,0x6fd5,0x62fe,0x7fd2,0x8936, -0x8972,0x4e1e,0x4e58,0x50e7,0x52dd,0x5347,0x627f,0x6607, -0x7e69,0x8805,0x965e,0x4f8d,0x5319,0x5636,0x59cb,0x5aa4, -0x5c38,0x5c4e,0x5c4d,0x5e02,0x5f11,0x6043,0x65bd,0x662f, -0x6642,0x67be,0x67f4,0x731c,0x77e2,0x793a,0x7fc5,0x8494, -0x84cd,0x8996,0x8a66,0x8a69,0x8ae1,0x8c55,0x8c7a,0x57f4, -0x5bd4,0x5f0f,0x606f,0x62ed,0x690d,0x6b96,0x6e5c,0x7184, -0x7bd2,0x8755,0x8b58,0x8efe,0x98df,0x98fe,0x4f38,0x4f81, -0x4fe1,0x547b,0x5a20,0x5bb8,0x613c,0x65b0,0x6668,0x71fc, -0x7533,0x795e,0x7d33,0x814e,0x81e3,0x8398,0x85aa,0x85ce, -0x8703,0x8a0a,0x8eab,0x8f9b,0xf971,0x8fc5,0x5931,0x5ba4, -0x5be6,0x6089,0x5be9,0x5c0b,0x5fc3,0x6c81,0xf972,0x6df1, -0x700b,0x751a,0x82af,0x8af6,0x4ec0,0x5341,0xf973,0x96d9, -0x6c0f,0x4e9e,0x4fc4,0x5152,0x555e,0x5a25,0x5ce8,0x6211, -0x7259,0x82bd,0x83aa,0x86fe,0x8859,0x8a1d,0x963f,0x96c5, -0x9913,0x9d09,0x9d5d,0x580a,0x5cb3,0x5dbd,0x5e44,0x60e1, -0x6115,0x63e1,0x6a02,0x6e25,0x9102,0x9354,0x984e,0x9c10, -0x9f77,0x5b89,0x5cb8,0x6309,0x664f,0x6848,0x773c,0x96c1, -0x978d,0x9854,0x9b9f,0x65a1,0x8b01,0x8ecb,0x95bc,0x5535, -0x5ca9,0x5dd6,0x5eb5,0x6697,0x764c,0x83f4,0x95c7,0x58d3, -0x62bc,0x72ce,0x9d28,0x4ef0,0x592e,0x600f,0x663b,0x6b83, -0x79e7,0x9d26,0x5393,0x54c0,0x57c3,0x5d16,0x611b,0x66d6, -0x6daf,0x788d,0x827e,0x9698,0x9744,0x5384,0x627c,0x6396, -0x6db2,0x7e0a,0x814b,0x984d,0x6afb,0x7f4c,0x9daf,0x9e1a, -0x4e5f,0x503b,0x51b6,0x591c,0x60f9,0x63f6,0x6930,0x723a, -0x8036,0xf974,0x91ce,0x5f31,0xf975,0xf976,0x7d04,0x82e5, -0x846f,0x84bb,0x85e5,0x8e8d,0xf977,0x4f6f,0xf978,0xf979, -0x58e4,0x5b43,0x6059,0x63da,0x6518,0x656d,0x6698,0xf97a, -0x694a,0x6a23,0x6d0b,0x7001,0x716c,0x75d2,0x760d,0x79b3, -0x7a70,0xf97b,0x7f8a,0xf97c,0x8944,0xf97d,0x8b93,0x91c0, -0x967d,0xf97e,0x990a,0x5704,0x5fa1,0x65bc,0x6f01,0x7600, -0x79a6,0x8a9e,0x99ad,0x9b5a,0x9f6c,0x5104,0x61b6,0x6291, -0x6a8d,0x81c6,0x5043,0x5830,0x5f66,0x7109,0x8a00,0x8afa, -0x5b7c,0x8616,0x4ffa,0x513c,0x56b4,0x5944,0x63a9,0x6df9, -0x5daa,0x696d,0x5186,0x4e88,0x4f59,0xf97f,0xf980,0xf981, -0x5982,0xf982,0xf983,0x6b5f,0x6c5d,0xf984,0x74b5,0x7916, -0xf985,0x8207,0x8245,0x8339,0x8f3f,0x8f5d,0xf986,0x9918, -0xf987,0xf988,0xf989,0x4ea6,0xf98a,0x57df,0x5f79,0x6613, -0xf98b,0xf98c,0x75ab,0x7e79,0x8b6f,0xf98d,0x9006,0x9a5b, -0x56a5,0x5827,0x59f8,0x5a1f,0x5bb4,0xf98e,0x5ef6,0xf98f, -0xf990,0x6350,0x633b,0xf991,0x693d,0x6c87,0x6cbf,0x6d8e, -0x6d93,0x6df5,0x6f14,0xf992,0x70df,0x7136,0x7159,0xf993, -0x71c3,0x71d5,0xf994,0x784f,0x786f,0xf995,0x7b75,0x7de3, -0xf996,0x7e2f,0xf997,0x884d,0x8edf,0xf998,0xf999,0xf99a, -0x925b,0xf99b,0x9cf6,0xf99c,0xf99d,0xf99e,0x6085,0x6d85, -0xf99f,0x71b1,0xf9a0,0xf9a1,0x95b1,0x53ad,0xf9a2,0xf9a3, -0xf9a4,0x67d3,0xf9a5,0x708e,0x7130,0x7430,0x8276,0x82d2, -0xf9a6,0x95bb,0x9ae5,0x9e7d,0x66c4,0xf9a7,0x71c1,0x8449, -0xf9a8,0xf9a9,0x584b,0xf9aa,0xf9ab,0x5db8,0x5f71,0xf9ac, -0x6620,0x668e,0x6979,0x69ae,0x6c38,0x6cf3,0x6e36,0x6f41, -0x6fda,0x701b,0x702f,0x7150,0x71df,0x7370,0xf9ad,0x745b, -0xf9ae,0x74d4,0x76c8,0x7a4e,0x7e93,0xf9af,0xf9b0,0x82f1, -0x8a60,0x8fce,0xf9b1,0x9348,0xf9b2,0x9719,0xf9b3,0xf9b4, -0x4e42,0x502a,0xf9b5,0x5208,0x53e1,0x66f3,0x6c6d,0x6fca, -0x730a,0x777f,0x7a62,0x82ae,0x85dd,0x8602,0xf9b6,0x88d4, -0x8a63,0x8b7d,0x8c6b,0xf9b7,0x92b3,0xf9b8,0x9713,0x9810, -0x4e94,0x4f0d,0x4fc9,0x50b2,0x5348,0x543e,0x5433,0x55da, -0x5862,0x58ba,0x5967,0x5a1b,0x5be4,0x609f,0xf9b9,0x61ca, -0x6556,0x65ff,0x6664,0x68a7,0x6c5a,0x6fb3,0x70cf,0x71ac, -0x7352,0x7b7d,0x8708,0x8aa4,0x9c32,0x9f07,0x5c4b,0x6c83, -0x7344,0x7389,0x923a,0x6eab,0x7465,0x761f,0x7a69,0x7e15, -0x860a,0x5140,0x58c5,0x64c1,0x74ee,0x7515,0x7670,0x7fc1, -0x9095,0x96cd,0x9954,0x6e26,0x74e6,0x7aa9,0x7aaa,0x81e5, -0x86d9,0x8778,0x8a1b,0x5a49,0x5b8c,0x5b9b,0x68a1,0x6900, -0x6d63,0x73a9,0x7413,0x742c,0x7897,0x7de9,0x7feb,0x8118, -0x8155,0x839e,0x8c4c,0x962e,0x9811,0x66f0,0x5f80,0x65fa, -0x6789,0x6c6a,0x738b,0x502d,0x5a03,0x6b6a,0x77ee,0x5916, -0x5d6c,0x5dcd,0x7325,0x754f,0xf9ba,0xf9bb,0x50e5,0x51f9, -0x582f,0x592d,0x5996,0x59da,0x5be5,0xf9bc,0xf9bd,0x5da2, -0x62d7,0x6416,0x6493,0x64fe,0xf9be,0x66dc,0xf9bf,0x6a48, -0xf9c0,0x71ff,0x7464,0xf9c1,0x7a88,0x7aaf,0x7e47,0x7e5e, -0x8000,0x8170,0xf9c2,0x87ef,0x8981,0x8b20,0x9059,0xf9c3, -0x9080,0x9952,0x617e,0x6b32,0x6d74,0x7e1f,0x8925,0x8fb1, -0x4fd1,0x50ad,0x5197,0x52c7,0x57c7,0x5889,0x5bb9,0x5eb8, -0x6142,0x6995,0x6d8c,0x6e67,0x6eb6,0x7194,0x7462,0x7528, -0x752c,0x8073,0x8338,0x84c9,0x8e0a,0x9394,0x93de,0xf9c4, -0x4e8e,0x4f51,0x5076,0x512a,0x53c8,0x53cb,0x53f3,0x5b87, -0x5bd3,0x5c24,0x611a,0x6182,0x65f4,0x725b,0x7397,0x7440, -0x76c2,0x7950,0x7991,0x79b9,0x7d06,0x7fbd,0x828b,0x85d5, -0x865e,0x8fc2,0x9047,0x90f5,0x91ea,0x9685,0x96e8,0x96e9, -0x52d6,0x5f67,0x65ed,0x6631,0x682f,0x715c,0x7a36,0x90c1, -0x980a,0x4e91,0xf9c5,0x6a52,0x6b9e,0x6f90,0x7189,0x8018, -0x82b8,0x8553,0x904b,0x9695,0x96f2,0x97fb,0x851a,0x9b31, -0x4e90,0x718a,0x96c4,0x5143,0x539f,0x54e1,0x5713,0x5712, -0x57a3,0x5a9b,0x5ac4,0x5bc3,0x6028,0x613f,0x63f4,0x6c85, -0x6d39,0x6e72,0x6e90,0x7230,0x733f,0x7457,0x82d1,0x8881, -0x8f45,0x9060,0xf9c6,0x9662,0x9858,0x9d1b,0x6708,0x8d8a, -0x925e,0x4f4d,0x5049,0x50de,0x5371,0x570d,0x59d4,0x5a01, -0x5c09,0x6170,0x6690,0x6e2d,0x7232,0x744b,0x7def,0x80c3, -0x840e,0x8466,0x853f,0x875f,0x885b,0x8918,0x8b02,0x9055, -0x97cb,0x9b4f,0x4e73,0x4f91,0x5112,0x516a,0xf9c7,0x552f, -0x55a9,0x5b7a,0x5ba5,0x5e7c,0x5e7d,0x5ebe,0x60a0,0x60df, -0x6108,0x6109,0x63c4,0x6538,0x6709,0xf9c8,0x67d4,0x67da, -0xf9c9,0x6961,0x6962,0x6cb9,0x6d27,0xf9ca,0x6e38,0xf9cb, -0x6fe1,0x7336,0x7337,0xf9cc,0x745c,0x7531,0xf9cd,0x7652, -0xf9ce,0xf9cf,0x7dad,0x81fe,0x8438,0x88d5,0x8a98,0x8adb, -0x8aed,0x8e30,0x8e42,0x904a,0x903e,0x907a,0x9149,0x91c9, -0x936e,0xf9d0,0xf9d1,0x5809,0xf9d2,0x6bd3,0x8089,0x80b2, -0xf9d3,0xf9d4,0x5141,0x596b,0x5c39,0xf9d5,0xf9d6,0x6f64, -0x73a7,0x80e4,0x8d07,0xf9d7,0x9217,0x958f,0xf9d8,0xf9d9, -0xf9da,0xf9db,0x807f,0x620e,0x701c,0x7d68,0x878d,0xf9dc, -0x57a0,0x6069,0x6147,0x6bb7,0x8abe,0x9280,0x96b1,0x4e59, -0x541f,0x6deb,0x852d,0x9670,0x97f3,0x98ee,0x63d6,0x6ce3, -0x9091,0x51dd,0x61c9,0x81ba,0x9df9,0x4f9d,0x501a,0x5100, -0x5b9c,0x610f,0x61ff,0x64ec,0x6905,0x6bc5,0x7591,0x77e3, -0x7fa9,0x8264,0x858f,0x87fb,0x8863,0x8abc,0x8b70,0x91ab, -0x4e8c,0x4ee5,0x4f0a,0xf9dd,0xf9de,0x5937,0x59e8,0xf9df, -0x5df2,0x5f1b,0x5f5b,0x6021,0xf9e0,0xf9e1,0xf9e2,0xf9e3, -0x723e,0x73e5,0xf9e4,0x7570,0x75cd,0xf9e5,0x79fb,0xf9e6, -0x800c,0x8033,0x8084,0x82e1,0x8351,0xf9e7,0xf9e8,0x8cbd, -0x8cb3,0x9087,0xf9e9,0xf9ea,0x98f4,0x990c,0xf9eb,0xf9ec, -0x7037,0x76ca,0x7fca,0x7fcc,0x7ffc,0x8b1a,0x4eba,0x4ec1, -0x5203,0x5370,0xf9ed,0x54bd,0x56e0,0x59fb,0x5bc5,0x5f15, -0x5fcd,0x6e6e,0xf9ee,0xf9ef,0x7d6a,0x8335,0xf9f0,0x8693, -0x8a8d,0xf9f1,0x976d,0x9777,0xf9f2,0xf9f3,0x4e00,0x4f5a, -0x4f7e,0x58f9,0x65e5,0x6ea2,0x9038,0x93b0,0x99b9,0x4efb, -0x58ec,0x598a,0x59d9,0x6041,0xf9f4,0xf9f5,0x7a14,0xf9f6, -0x834f,0x8cc3,0x5165,0x5344,0xf9f7,0xf9f8,0xf9f9,0x4ecd, -0x5269,0x5b55,0x82bf,0x4ed4,0x523a,0x54a8,0x59c9,0x59ff, -0x5b50,0x5b57,0x5b5c,0x6063,0x6148,0x6ecb,0x7099,0x716e, -0x7386,0x74f7,0x75b5,0x78c1,0x7d2b,0x8005,0x81ea,0x8328, -0x8517,0x85c9,0x8aee,0x8cc7,0x96cc,0x4f5c,0x52fa,0x56bc, -0x65ab,0x6628,0x707c,0x70b8,0x7235,0x7dbd,0x828d,0x914c, -0x96c0,0x9d72,0x5b71,0x68e7,0x6b98,0x6f7a,0x76de,0x5c91, -0x66ab,0x6f5b,0x7bb4,0x7c2a,0x8836,0x96dc,0x4e08,0x4ed7, -0x5320,0x5834,0x58bb,0x58ef,0x596c,0x5c07,0x5e33,0x5e84, -0x5f35,0x638c,0x66b2,0x6756,0x6a1f,0x6aa3,0x6b0c,0x6f3f, -0x7246,0xf9fa,0x7350,0x748b,0x7ae0,0x7ca7,0x8178,0x81df, -0x81e7,0x838a,0x846c,0x8523,0x8594,0x85cf,0x88dd,0x8d13, -0x91ac,0x9577,0x969c,0x518d,0x54c9,0x5728,0x5bb0,0x624d, -0x6750,0x683d,0x6893,0x6e3d,0x6ed3,0x707d,0x7e21,0x88c1, -0x8ca1,0x8f09,0x9f4b,0x9f4e,0x722d,0x7b8f,0x8acd,0x931a, -0x4f47,0x4f4e,0x5132,0x5480,0x59d0,0x5e95,0x62b5,0x6775, -0x696e,0x6a17,0x6cae,0x6e1a,0x72d9,0x732a,0x75bd,0x7bb8, -0x7d35,0x82e7,0x83f9,0x8457,0x85f7,0x8a5b,0x8caf,0x8e87, -0x9019,0x90b8,0x96ce,0x9f5f,0x52e3,0x540a,0x5ae1,0x5bc2, -0x6458,0x6575,0x6ef4,0x72c4,0xf9fb,0x7684,0x7a4d,0x7b1b, -0x7c4d,0x7e3e,0x7fdf,0x837b,0x8b2b,0x8cca,0x8d64,0x8de1, -0x8e5f,0x8fea,0x8ff9,0x9069,0x93d1,0x4f43,0x4f7a,0x50b3, -0x5168,0x5178,0x524d,0x526a,0x5861,0x587c,0x5960,0x5c08, -0x5c55,0x5edb,0x609b,0x6230,0x6813,0x6bbf,0x6c08,0x6fb1, -0x714e,0x7420,0x7530,0x7538,0x7551,0x7672,0x7b4c,0x7b8b, -0x7bad,0x7bc6,0x7e8f,0x8a6e,0x8f3e,0x8f49,0x923f,0x9293, -0x9322,0x942b,0x96fb,0x985a,0x986b,0x991e,0x5207,0x622a, -0x6298,0x6d59,0x7664,0x7aca,0x7bc0,0x7d76,0x5360,0x5cbe, -0x5e97,0x6f38,0x70b9,0x7c98,0x9711,0x9b8e,0x9ede,0x63a5, -0x647a,0x8776,0x4e01,0x4e95,0x4ead,0x505c,0x5075,0x5448, -0x59c3,0x5b9a,0x5e40,0x5ead,0x5ef7,0x5f81,0x60c5,0x633a, -0x653f,0x6574,0x65cc,0x6676,0x6678,0x67fe,0x6968,0x6a89, -0x6b63,0x6c40,0x6dc0,0x6de8,0x6e1f,0x6e5e,0x701e,0x70a1, -0x738e,0x73fd,0x753a,0x775b,0x7887,0x798e,0x7a0b,0x7a7d, -0x7cbe,0x7d8e,0x8247,0x8a02,0x8aea,0x8c9e,0x912d,0x914a, -0x91d8,0x9266,0x92cc,0x9320,0x9706,0x9756,0x975c,0x9802, -0x9f0e,0x5236,0x5291,0x557c,0x5824,0x5e1d,0x5f1f,0x608c, -0x63d0,0x68af,0x6fdf,0x796d,0x7b2c,0x81cd,0x85ba,0x88fd, -0x8af8,0x8e44,0x918d,0x9664,0x969b,0x973d,0x984c,0x9f4a, -0x4fce,0x5146,0x51cb,0x52a9,0x5632,0x5f14,0x5f6b,0x63aa, -0x64cd,0x65e9,0x6641,0x66fa,0x66f9,0x671d,0x689d,0x68d7, -0x69fd,0x6f15,0x6f6e,0x7167,0x71e5,0x722a,0x74aa,0x773a, -0x7956,0x795a,0x79df,0x7a20,0x7a95,0x7c97,0x7cdf,0x7d44, -0x7e70,0x8087,0x85fb,0x86a4,0x8a54,0x8abf,0x8d99,0x8e81, -0x9020,0x906d,0x91e3,0x963b,0x96d5,0x9ce5,0x65cf,0x7c07, -0x8db3,0x93c3,0x5b58,0x5c0a,0x5352,0x62d9,0x731d,0x5027, -0x5b97,0x5f9e,0x60b0,0x616b,0x68d5,0x6dd9,0x742e,0x7a2e, -0x7d42,0x7d9c,0x7e31,0x816b,0x8e2a,0x8e35,0x937e,0x9418, -0x4f50,0x5750,0x5de6,0x5ea7,0x632b,0x7f6a,0x4e3b,0x4f4f, -0x4f8f,0x505a,0x59dd,0x80c4,0x546a,0x5468,0x55fe,0x594f, -0x5b99,0x5dde,0x5eda,0x665d,0x6731,0x67f1,0x682a,0x6ce8, -0x6d32,0x6e4a,0x6f8d,0x70b7,0x73e0,0x7587,0x7c4c,0x7d02, -0x7d2c,0x7da2,0x821f,0x86db,0x8a3b,0x8a85,0x8d70,0x8e8a, -0x8f33,0x9031,0x914e,0x9152,0x9444,0x99d0,0x7af9,0x7ca5, -0x4fca,0x5101,0x51c6,0x57c8,0x5bef,0x5cfb,0x6659,0x6a3d, -0x6d5a,0x6e96,0x6fec,0x710c,0x756f,0x7ae3,0x8822,0x9021, -0x9075,0x96cb,0x99ff,0x8301,0x4e2d,0x4ef2,0x8846,0x91cd, -0x537d,0x6adb,0x696b,0x6c41,0x847a,0x589e,0x618e,0x66fe, -0x62ef,0x70dd,0x7511,0x75c7,0x7e52,0x84b8,0x8b49,0x8d08, -0x4e4b,0x53ea,0x54ab,0x5730,0x5740,0x5fd7,0x6301,0x6307, -0x646f,0x652f,0x65e8,0x667a,0x679d,0x67b3,0x6b62,0x6c60, -0x6c9a,0x6f2c,0x77e5,0x7825,0x7949,0x7957,0x7d19,0x80a2, -0x8102,0x81f3,0x829d,0x82b7,0x8718,0x8a8c,0xf9fc,0x8d04, -0x8dbe,0x9072,0x76f4,0x7a19,0x7a37,0x7e54,0x8077,0x5507, -0x55d4,0x5875,0x632f,0x6422,0x6649,0x664b,0x686d,0x699b, -0x6b84,0x6d25,0x6eb1,0x73cd,0x7468,0x74a1,0x755b,0x75b9, -0x76e1,0x771e,0x778b,0x79e6,0x7e09,0x7e1d,0x81fb,0x852f, -0x8897,0x8a3a,0x8cd1,0x8eeb,0x8fb0,0x9032,0x93ad,0x9663, -0x9673,0x9707,0x4f84,0x53f1,0x59ea,0x5ac9,0x5e19,0x684e, -0x74c6,0x75be,0x79e9,0x7a92,0x81a3,0x86ed,0x8cea,0x8dcc, -0x8fed,0x659f,0x6715,0xf9fd,0x57f7,0x6f57,0x7ddd,0x8f2f, -0x93f6,0x96c6,0x5fb5,0x61f2,0x6f84,0x4e14,0x4f98,0x501f, -0x53c9,0x55df,0x5d6f,0x5dee,0x6b21,0x6b64,0x78cb,0x7b9a, -0xf9fe,0x8e49,0x8eca,0x906e,0x6349,0x643e,0x7740,0x7a84, -0x932f,0x947f,0x9f6a,0x64b0,0x6faf,0x71e6,0x74a8,0x74da, -0x7ac4,0x7c12,0x7e82,0x7cb2,0x7e98,0x8b9a,0x8d0a,0x947d, -0x9910,0x994c,0x5239,0x5bdf,0x64e6,0x672d,0x7d2e,0x50ed, -0x53c3,0x5879,0x6158,0x6159,0x61fa,0x65ac,0x7ad9,0x8b92, -0x8b96,0x5009,0x5021,0x5275,0x5531,0x5a3c,0x5ee0,0x5f70, -0x6134,0x655e,0x660c,0x6636,0x66a2,0x69cd,0x6ec4,0x6f32, -0x7316,0x7621,0x7a93,0x8139,0x8259,0x83d6,0x84bc,0x50b5, -0x57f0,0x5bc0,0x5be8,0x5f69,0x63a1,0x7826,0x7db5,0x83dc, -0x8521,0x91c7,0x91f5,0x518a,0x67f5,0x7b56,0x8cac,0x51c4, -0x59bb,0x60bd,0x8655,0x501c,0xf9ff,0x5254,0x5c3a,0x617d, -0x621a,0x62d3,0x64f2,0x65a5,0x6ecc,0x7620,0x810a,0x8e60, -0x965f,0x96bb,0x4edf,0x5343,0x5598,0x5929,0x5ddd,0x64c5, -0x6cc9,0x6dfa,0x7394,0x7a7f,0x821b,0x85a6,0x8ce4,0x8e10, -0x9077,0x91e7,0x95e1,0x9621,0x97c6,0x51f8,0x54f2,0x5586, -0x5fb9,0x64a4,0x6f88,0x7db4,0x8f1f,0x8f4d,0x9435,0x50c9, -0x5c16,0x6cbe,0x6dfb,0x751b,0x77bb,0x7c3d,0x7c64,0x8a79, -0x8ac2,0x581e,0x59be,0x5e16,0x6377,0x7252,0x758a,0x776b, -0x8adc,0x8cbc,0x8f12,0x5ef3,0x6674,0x6df8,0x807d,0x83c1, -0x8acb,0x9751,0x9bd6,0xfa00,0x5243,0x66ff,0x6d95,0x6eef, -0x7de0,0x8ae6,0x902e,0x905e,0x9ad4,0x521d,0x527f,0x54e8, -0x6194,0x6284,0x62db,0x68a2,0x6912,0x695a,0x6a35,0x7092, -0x7126,0x785d,0x7901,0x790e,0x79d2,0x7a0d,0x8096,0x8278, -0x82d5,0x8349,0x8549,0x8c82,0x8d85,0x9162,0x918b,0x91ae, -0x4fc3,0x56d1,0x71ed,0x77d7,0x8700,0x89f8,0x5bf8,0x5fd6, -0x6751,0x90a8,0x53e2,0x585a,0x5bf5,0x60a4,0x6181,0x6460, -0x7e3d,0x8070,0x8525,0x9283,0x64ae,0x50ac,0x5d14,0x6700, -0x589c,0x62bd,0x63a8,0x690e,0x6978,0x6a1e,0x6e6b,0x76ba, -0x79cb,0x82bb,0x8429,0x8acf,0x8da8,0x8ffd,0x9112,0x914b, -0x919c,0x9310,0x9318,0x939a,0x96db,0x9a36,0x9c0d,0x4e11, -0x755c,0x795d,0x7afa,0x7b51,0x7bc9,0x7e2e,0x84c4,0x8e59, -0x8e74,0x8ef8,0x9010,0x6625,0x693f,0x7443,0x51fa,0x672e, -0x9edc,0x5145,0x5fe0,0x6c96,0x87f2,0x885d,0x8877,0x60b4, -0x81b5,0x8403,0x8d05,0x53d6,0x5439,0x5634,0x5a36,0x5c31, -0x708a,0x7fe0,0x805a,0x8106,0x81ed,0x8da3,0x9189,0x9a5f, -0x9df2,0x5074,0x4ec4,0x53a0,0x60fb,0x6e2c,0x5c64,0x4f88, -0x5024,0x55e4,0x5cd9,0x5e5f,0x6065,0x6894,0x6cbb,0x6dc4, -0x71be,0x75d4,0x75f4,0x7661,0x7a1a,0x7a49,0x7dc7,0x7dfb, -0x7f6e,0x81f4,0x86a9,0x8f1c,0x96c9,0x99b3,0x9f52,0x5247, -0x52c5,0x98ed,0x89aa,0x4e03,0x67d2,0x6f06,0x4fb5,0x5be2, -0x6795,0x6c88,0x6d78,0x741b,0x7827,0x91dd,0x937c,0x87c4, -0x79e4,0x7a31,0x5feb,0x4ed6,0x54a4,0x553e,0x58ae,0x59a5, -0x60f0,0x6253,0x62d6,0x6736,0x6955,0x8235,0x9640,0x99b1, -0x99dd,0x502c,0x5353,0x5544,0x577c,0xfa01,0x6258,0xfa02, -0x64e2,0x666b,0x67dd,0x6fc1,0x6fef,0x7422,0x7438,0x8a17, -0x9438,0x5451,0x5606,0x5766,0x5f48,0x619a,0x6b4e,0x7058, -0x70ad,0x7dbb,0x8a95,0x596a,0x812b,0x63a2,0x7708,0x803d, -0x8caa,0x5854,0x642d,0x69bb,0x5b95,0x5e11,0x6e6f,0xfa03, -0x8569,0x514c,0x53f0,0x592a,0x6020,0x614b,0x6b86,0x6c70, -0x6cf0,0x7b1e,0x80ce,0x82d4,0x8dc6,0x90b0,0x98b1,0xfa04, -0x64c7,0x6fa4,0x6491,0x6504,0x514e,0x5410,0x571f,0x8a0e, -0x615f,0x6876,0xfa05,0x75db,0x7b52,0x7d71,0x901a,0x5806, -0x69cc,0x817f,0x892a,0x9000,0x9839,0x5078,0x5957,0x59ac, -0x6295,0x900f,0x9b2a,0x615d,0x7279,0x95d6,0x5761,0x5a46, -0x5df4,0x628a,0x64ad,0x64fa,0x6777,0x6ce2,0x6d3e,0x722c, -0x7436,0x7834,0x7f77,0x82ad,0x8ddb,0x9817,0x5224,0x5742, -0x677f,0x7248,0x74e3,0x8ca9,0x8fa6,0x9211,0x962a,0x516b, -0x53ed,0x634c,0x4f69,0x5504,0x6096,0x6557,0x6c9b,0x6d7f, -0x724c,0x72fd,0x7a17,0x8987,0x8c9d,0x5f6d,0x6f8e,0x70f9, -0x81a8,0x610e,0x4fbf,0x504f,0x6241,0x7247,0x7bc7,0x7de8, -0x7fe9,0x904d,0x97ad,0x9a19,0x8cb6,0x576a,0x5e73,0x67b0, -0x840d,0x8a55,0x5420,0x5b16,0x5e63,0x5ee2,0x5f0a,0x6583, -0x80ba,0x853d,0x9589,0x965b,0x4f48,0x5305,0x530d,0x530f, -0x5486,0x54fa,0x5703,0x5e03,0x6016,0x629b,0x62b1,0x6355, -0xfa06,0x6ce1,0x6d66,0x75b1,0x7832,0x80de,0x812f,0x82de, -0x8461,0x84b2,0x888d,0x8912,0x900b,0x92ea,0x98fd,0x9b91, -0x5e45,0x66b4,0x66dd,0x7011,0x7206,0xfa07,0x4ff5,0x527d, -0x5f6a,0x6153,0x6753,0x6a19,0x6f02,0x74e2,0x7968,0x8868, -0x8c79,0x98c7,0x98c4,0x9a43,0x54c1,0x7a1f,0x6953,0x8af7, -0x8c4a,0x98a8,0x99ae,0x5f7c,0x62ab,0x75b2,0x76ae,0x88ab, -0x907f,0x9642,0x5339,0x5f3c,0x5fc5,0x6ccc,0x73cc,0x7562, -0x758b,0x7b46,0x82fe,0x999d,0x4e4f,0x903c,0x4e0b,0x4f55, -0x53a6,0x590f,0x5ec8,0x6630,0x6cb3,0x7455,0x8377,0x8766, -0x8cc0,0x9050,0x971e,0x9c15,0x58d1,0x5b78,0x8650,0x8b14, -0x9db4,0x5bd2,0x6068,0x608d,0x65f1,0x6c57,0x6f22,0x6fa3, -0x701a,0x7f55,0x7ff0,0x9591,0x9592,0x9650,0x97d3,0x5272, -0x8f44,0x51fd,0x542b,0x54b8,0x5563,0x558a,0x6abb,0x6db5, -0x7dd8,0x8266,0x929c,0x9677,0x9e79,0x5408,0x54c8,0x76d2, -0x86e4,0x95a4,0x95d4,0x965c,0x4ea2,0x4f09,0x59ee,0x5ae6, -0x5df7,0x6052,0x6297,0x676d,0x6841,0x6c86,0x6e2f,0x7f38, -0x809b,0x822a,0xfa08,0xfa09,0x9805,0x4ea5,0x5055,0x54b3, -0x5793,0x595a,0x5b69,0x5bb3,0x61c8,0x6977,0x6d77,0x7023, -0x87f9,0x89e3,0x8a72,0x8ae7,0x9082,0x99ed,0x9ab8,0x52be, -0x6838,0x5016,0x5e78,0x674f,0x8347,0x884c,0x4eab,0x5411, -0x56ae,0x73e6,0x9115,0x97ff,0x9909,0x9957,0x9999,0x5653, -0x589f,0x865b,0x8a31,0x61b2,0x6af6,0x737b,0x8ed2,0x6b47, -0x96aa,0x9a57,0x5955,0x7200,0x8d6b,0x9769,0x4fd4,0x5cf4, -0x5f26,0x61f8,0x665b,0x6ceb,0x70ab,0x7384,0x73b9,0x73fe, -0x7729,0x774d,0x7d43,0x7d62,0x7e23,0x8237,0x8852,0xfa0a, -0x8ce2,0x9249,0x986f,0x5b51,0x7a74,0x8840,0x9801,0x5acc, -0x4fe0,0x5354,0x593e,0x5cfd,0x633e,0x6d79,0x72f9,0x8105, -0x8107,0x83a2,0x92cf,0x9830,0x4ea8,0x5144,0x5211,0x578b, -0x5f62,0x6cc2,0x6ece,0x7005,0x7050,0x70af,0x7192,0x73e9, -0x7469,0x834a,0x87a2,0x8861,0x9008,0x90a2,0x93a3,0x99a8, -0x516e,0x5f57,0x60e0,0x6167,0x66b3,0x8559,0x8e4a,0x91af, -0x978b,0x4e4e,0x4e92,0x547c,0x58d5,0x58fa,0x597d,0x5cb5, -0x5f27,0x6236,0x6248,0x660a,0x6667,0x6beb,0x6d69,0x6dcf, -0x6e56,0x6ef8,0x6f94,0x6fe0,0x6fe9,0x705d,0x72d0,0x7425, -0x745a,0x74e0,0x7693,0x795c,0x7cca,0x7e1e,0x80e1,0x82a6, -0x846b,0x84bf,0x864e,0x865f,0x8774,0x8b77,0x8c6a,0x93ac, -0x9800,0x9865,0x60d1,0x6216,0x9177,0x5a5a,0x660f,0x6df7, -0x6e3e,0x743f,0x9b42,0x5ffd,0x60da,0x7b0f,0x54c4,0x5f18, -0x6c5e,0x6cd3,0x6d2a,0x70d8,0x7d05,0x8679,0x8a0c,0x9d3b, -0x5316,0x548c,0x5b05,0x6a3a,0x706b,0x7575,0x798d,0x79be, -0x82b1,0x83ef,0x8a71,0x8b41,0x8ca8,0x9774,0xfa0b,0x64f4, -0x652b,0x78ba,0x78bb,0x7a6b,0x4e38,0x559a,0x5950,0x5ba6, -0x5e7b,0x60a3,0x63db,0x6b61,0x6665,0x6853,0x6e19,0x7165, -0x74b0,0x7d08,0x9084,0x9a69,0x9c25,0x6d3b,0x6ed1,0x733e, -0x8c41,0x95ca,0x51f0,0x5e4c,0x5fa8,0x604d,0x60f6,0x6130, -0x614c,0x6643,0x6644,0x69a5,0x6cc1,0x6e5f,0x6ec9,0x6f62, -0x714c,0x749c,0x7687,0x7bc1,0x7c27,0x8352,0x8757,0x9051, -0x968d,0x9ec3,0x532f,0x56de,0x5efb,0x5f8a,0x6062,0x6094, -0x61f7,0x6666,0x6703,0x6a9c,0x6dee,0x6fae,0x7070,0x736a, -0x7e6a,0x81be,0x8334,0x86d4,0x8aa8,0x8cc4,0x5283,0x7372, -0x5b96,0x6a6b,0x9404,0x54ee,0x5686,0x5b5d,0x6548,0x6585, -0x66c9,0x689f,0x6d8d,0x6dc6,0x723b,0x80b4,0x9175,0x9a4d, -0x4faf,0x5019,0x539a,0x540e,0x543c,0x5589,0x55c5,0x5e3f, -0x5f8c,0x673d,0x7166,0x73dd,0x9005,0x52db,0x52f3,0x5864, -0x58ce,0x7104,0x718f,0x71fb,0x85b0,0x8a13,0x6688,0x85a8, -0x55a7,0x6684,0x714a,0x8431,0x5349,0x5599,0x6bc1,0x5f59, -0x5fbd,0x63ee,0x6689,0x7147,0x8af1,0x8f1d,0x9ebe,0x4f11, -0x643a,0x70cb,0x7566,0x8667,0x6064,0x8b4e,0x9df8,0x5147, -0x51f6,0x5308,0x6d36,0x80f8,0x9ed1,0x6615,0x6b23,0x7098, -0x75d5,0x5403,0x5c79,0x7d07,0x8a16,0x6b20,0x6b3d,0x6b46, -0x5438,0x6070,0x6d3d,0x7fd5,0x8208,0x50d6,0x51de,0x559c, -0x566b,0x56cd,0x59ec,0x5b09,0x5e0c,0x6199,0x6198,0x6231, -0x665e,0x66e6,0x7199,0x71b9,0x71ba,0x72a7,0x79a7,0x7a00, -0x7fb2,0x8a70}; - -static const int uhc3_ucs_table_size = (sizeof(uhc3_ucs_table)/sizeof(unsigned short)); - -/* UCS -> UHC */ -static const unsigned short ucs_a1_uhc_table[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x007f, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa2ae,0x0000,0x0000,0xa2b4,0x0000,0x0000,0xa1d7, -0xa1a7,0x0000,0xa8a3,0x0000,0x0000,0xa1a9,0xa2e7,0x0000, -0xa1c6,0xa1be,0xa9f7,0xa9f8,0xa2a5,0x0000,0xa2d2,0xa1a4, -0xa2ac,0xa9f6,0xa8ac,0x0000,0xa8f9,0xa8f6,0xa8fa,0xa2af, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8a1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8a2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1bf, -0xa8aa,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8ad,0xa9ac, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa9a1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa9a3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa1c0, -0xa9aa,0x0000,0x0000,0x0000,0x0000,0x0000,0xa9ad,0x0000, -/* 0x0100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa9a2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8a4,0xa9a4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa9a5,0xa8a6,0xa9a6,0x0000,0x0000,0x0000,0x0000, -0xa9a7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8a8, -0xa9a8,0xa8a9,0xa9a9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa9b0,0xa8af,0xa9af,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa8ab,0xa9ab,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa8ae,0xa9ae, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa2a7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2b0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2a8,0xa2ab,0xa2aa,0xa2ad,0x0000,0xa2a9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa5c1,0xa5c2,0xa5c3,0xa5c4,0xa5c5,0xa5c6,0xa5c7, -0xa5c8,0xa5c9,0xa5ca,0xa5cb,0xa5cc,0xa5cd,0xa5ce,0xa5cf, -0xa5d0,0xa5d1,0x0000,0xa5d2,0xa5d3,0xa5d4,0xa5d5,0xa5d6, -0xa5d7,0xa5d8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa5e1,0xa5e2,0xa5e3,0xa5e4,0xa5e5,0xa5e6,0xa5e7, -0xa5e8,0xa5e9,0xa5ea,0xa5eb,0xa5ec,0xa5ed,0xa5ee,0xa5ef, -0xa5f0,0xa5f1,0x0000,0xa5f2,0xa5f3,0xa5f4,0xa5f5,0xa5f6, -0xa5f7,0xa5f8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x0400 */ -0x0000,0xaca7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xaca1,0xaca2,0xaca3,0xaca4,0xaca5,0xaca6,0xaca8,0xaca9, -0xacaa,0xacab,0xacac,0xacad,0xacae,0xacaf,0xacb0,0xacb1, -0xacb2,0xacb3,0xacb4,0xacb5,0xacb6,0xacb7,0xacb8,0xacb9, -0xacba,0xacbb,0xacbc,0xacbd,0xacbe,0xacbf,0xacc0,0xacc1, -0xacd1,0xacd2,0xacd3,0xacd4,0xacd5,0xacd6,0xacd8,0xacd9, -0xacda,0xacdb,0xacdc,0xacdd,0xacde,0xacdf,0xace0,0xace1, -0xace2,0xace3,0xace4,0xace5,0xace6,0xace7,0xace8,0xace9, -0xacea,0xaceb,0xacec,0xaced,0xacee,0xacef,0xacf0,0xacf1, -0x0000,0xacd7}; - -static const int ucs_a1_uhc_table_min = 0x0000; -static const int ucs_a1_uhc_table_max = 0x0000 + (sizeof(ucs_a1_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_a2_uhc_table[] = { -/* 0x2000 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1aa,0x0000,0x0000, -0xa1ae,0xa1af,0x0000,0x0000,0xa1b0,0xa1b1,0x0000,0x0000, -0xa2d3,0xa2d4,0x0000,0x0000,0x0000,0xa1a5,0xa1a6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2b6,0x0000,0xa1c7,0xa1c8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa1d8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa9f9,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa9fa, -0x0000,0xa9fb,0xa9fc,0xa9fd,0xa9fe,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa2e6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2100 */ -0x0000,0x0000,0x0000,0xa1c9,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa2b5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa7a4,0x0000,0x0000,0xa2e0,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa2e5,0xa2e2,0x0000,0x0000,0x0000,0xa7d9,0x0000, -0x0000,0x0000,0x0000,0xa1ca,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8f7,0xa8f8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xa8fb,0xa8fc,0xa8fd,0xa8fe,0x0000, -0xa5b0,0xa5b1,0xa5b2,0xa5b3,0xa5b4,0xa5b5,0xa5b6,0xa5b7, -0xa5b8,0xa5b9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa5a1,0xa5a2,0xa5a3,0xa5a4,0xa5a5,0xa5a6,0xa5a7,0xa5a8, -0xa5a9,0xa5aa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1e7,0xa1e8,0xa1e6,0xa1e9,0xa1ea,0xa2d5,0xa2d8,0xa2d6, -0xa2d9,0xa2d7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa2a1,0x0000,0xa2a2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2a3,0x0000,0xa1d3,0xa2a4,0x0000,0x0000,0x0000,0xa1d4, -0xa1f4,0x0000,0x0000,0xa1f5,0x0000,0x0000,0x0000,0xa2b3, -0x0000,0xa2b2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1ee,0x0000,0x0000,0xa1f0,0xa1c4,0x0000, -0xa1d0,0x0000,0x0000,0x0000,0x0000,0xa1ab,0x0000,0xa1fc, -0xa1fd,0xa1fb,0xa1fa,0xa1f2,0xa1f3,0x0000,0xa2b1,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1c5,0xa1f1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa1ad,0xa1ef,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1d6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1c1,0xa1d5,0x0000,0x0000,0xa1c2,0xa1c3,0x0000,0x0000, -0x0000,0x0000,0xa1ec,0xa1ed,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1f8,0xa1f9,0x0000,0x0000,0xa1f6,0xa1f7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa2c1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1d1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1d2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8e7,0xa8e8,0xa8e9,0xa8ea,0xa8eb,0xa8ec,0xa8ed,0xa8ee, -0xa8ef,0xa8f0,0xa8f1,0xa8f2,0xa8f3,0xa8f4,0xa8f5,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa9e7,0xa9e8,0xa9e9,0xa9ea, -0xa9eb,0xa9ec,0xa9ed,0xa9ee,0xa9ef,0xa9f0,0xa9f1,0xa9f2, -0xa9f3,0xa9f4,0xa9f5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa9cd,0xa9ce,0xa9cf,0xa9d0, -0xa9d1,0xa9d2,0xa9d3,0xa9d4,0xa9d5,0xa9d6,0xa9d7,0xa9d8, -0xa9d9,0xa9da,0xa9db,0xa9dc,0xa9dd,0xa9de,0xa9df,0xa9e0, -0xa9e1,0xa9e2,0xa9e3,0xa9e4,0xa9e5,0xa9e6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8cd,0xa8ce,0xa8cf,0xa8d0,0xa8d1,0xa8d2,0xa8d3,0xa8d4, -0xa8d5,0xa8d6,0xa8d7,0xa8d8,0xa8d9,0xa8da,0xa8db,0xa8dc, -0xa8dd,0xa8de,0xa8df,0xa8e0,0xa8e1,0xa8e2,0xa8e3,0xa8e4, -0xa8e5,0xa8e6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa6a1,0xa6ac,0xa6a2,0xa6ad,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa6a3,0xa6c8,0xa6c7,0xa6ae, -0xa6a4,0xa6c2,0xa6c1,0xa6af,0xa6a6,0xa6c6,0xa6c5,0xa6b1, -0xa6a5,0xa6c4,0xa6c3,0xa6b0,0xa6a7,0xa6bc,0xa6c9,0xa6ca, -0xa6b7,0xa6cb,0xa6cc,0xa6b2,0xa6a9,0xa6be,0xa6cd,0xa6ce, -0xa6b9,0xa6cf,0xa6d0,0xa6b4,0xa6a8,0xa6d1,0xa6d2,0xa6b8, -0xa6bd,0xa6d3,0xa6d4,0xa6b3,0xa6aa,0xa6d5,0xa6d6,0xa6ba, -0xa6bf,0xa6d7,0xa6d8,0xa6b5,0xa6ab,0xa6d9,0xa6da,0xa6bb, -0xa6db,0xa6dc,0xa6c0,0xa6dd,0xa6de,0xa6df,0xa6e0,0xa6e1, -0xa6e2,0xa6e3,0xa6e4,0xa6b6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa2c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1e1,0xa1e0,0x0000,0xa2c3,0xa2c7,0xa2c8,0xa2cb,0xa2ca, -0xa2c9,0xa2cc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xa1e3,0xa1e2,0x0000,0x0000,0xa2ba,0xa2b9, -0x0000,0x0000,0x0000,0x0000,0xa1e5,0xa1e4,0x0000,0x0000, -0xa2b8,0xa2b7,0x0000,0x0000,0x0000,0x0000,0xa1df,0xa1de, -0xa2c2,0x0000,0x0000,0xa1db,0x0000,0x0000,0xa1dd,0xa1dc, -0xa2c4,0xa2c5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x2600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xa1da,0xa1d9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xa2cf,0xa2ce, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xa2d0,0x0000,0xa2d1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1cf,0x0000,0xa1ce,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa2bc,0xa2bd,0x0000,0xa2c0,0xa2bb,0xa2be,0x0000,0xa2bf, -0xa2cd,0xa2db,0xa2dc,0x0000,0xa2dd,0xa2da}; - -static const int ucs_a2_uhc_table_min = 0x2000; -static const int ucs_a2_uhc_table_max = 0x2000 + (sizeof(ucs_a2_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_a3_uhc_table[] = { -/* 0x2f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1a1,0xa1a2,0xa1a3,0xa1a8,0x0000,0x0000,0x0000,0x0000, -0xa1b4,0xa1b5,0xa1b6,0xa1b7,0xa1b8,0xa1b9,0xa1ba,0xa1bb, -0xa1bc,0xa1bd,0x0000,0xa1eb,0xa1b2,0xa1b3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xaaa1,0xaaa2,0xaaa3,0xaaa4,0xaaa5,0xaaa6,0xaaa7, -0xaaa8,0xaaa9,0xaaaa,0xaaab,0xaaac,0xaaad,0xaaae,0xaaaf, -0xaab0,0xaab1,0xaab2,0xaab3,0xaab4,0xaab5,0xaab6,0xaab7, -0xaab8,0xaab9,0xaaba,0xaabb,0xaabc,0xaabd,0xaabe,0xaabf, -0xaac0,0xaac1,0xaac2,0xaac3,0xaac4,0xaac5,0xaac6,0xaac7, -0xaac8,0xaac9,0xaaca,0xaacb,0xaacc,0xaacd,0xaace,0xaacf, -0xaad0,0xaad1,0xaad2,0xaad3,0xaad4,0xaad5,0xaad6,0xaad7, -0xaad8,0xaad9,0xaada,0xaadb,0xaadc,0xaadd,0xaade,0xaadf, -0xaae0,0xaae1,0xaae2,0xaae3,0xaae4,0xaae5,0xaae6,0xaae7, -0xaae8,0xaae9,0xaaea,0xaaeb,0xaaec,0xaaed,0xaaee,0xaaef, -0xaaf0,0xaaf1,0xaaf2,0xaaf3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xaba1,0xaba2,0xaba3,0xaba4,0xaba5,0xaba6,0xaba7, -0xaba8,0xaba9,0xabaa,0xabab,0xabac,0xabad,0xabae,0xabaf, -0xabb0,0xabb1,0xabb2,0xabb3,0xabb4,0xabb5,0xabb6,0xabb7, -0xabb8,0xabb9,0xabba,0xabbb,0xabbc,0xabbd,0xabbe,0xabbf, -0xabc0,0xabc1,0xabc2,0xabc3,0xabc4,0xabc5,0xabc6,0xabc7, -0xabc8,0xabc9,0xabca,0xabcb,0xabcc,0xabcd,0xabce,0xabcf, -0xabd0,0xabd1,0xabd2,0xabd3,0xabd4,0xabd5,0xabd6,0xabd7, -0xabd8,0xabd9,0xabda,0xabdb,0xabdc,0xabdd,0xabde,0xabdf, -0xabe0,0xabe1,0xabe2,0xabe3,0xabe4,0xabe5,0xabe6,0xabe7, -0xabe8,0xabe9,0xabea,0xabeb,0xabec,0xabed,0xabee,0xabef, -0xabf0,0xabf1,0xabf2,0xabf3,0xabf4,0xabf5,0xabf6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3100 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xa4a1,0xa4a2,0xa4a3,0xa4a4,0xa4a5,0xa4a6,0xa4a7, -0xa4a8,0xa4a9,0xa4aa,0xa4ab,0xa4ac,0xa4ad,0xa4ae,0xa4af, -0xa4b0,0xa4b1,0xa4b2,0xa4b3,0xa4b4,0xa4b5,0xa4b6,0xa4b7, -0xa4b8,0xa4b9,0xa4ba,0xa4bb,0xa4bc,0xa4bd,0xa4be,0xa4bf, -0xa4c0,0xa4c1,0xa4c2,0xa4c3,0xa4c4,0xa4c5,0xa4c6,0xa4c7, -0xa4c8,0xa4c9,0xa4ca,0xa4cb,0xa4cc,0xa4cd,0xa4ce,0xa4cf, -0xa4d0,0xa4d1,0xa4d2,0xa4d3,0xa4d4,0xa4d5,0xa4d6,0xa4d7, -0xa4d8,0xa4d9,0xa4da,0xa4db,0xa4dc,0xa4dd,0xa4de,0xa4df, -0xa4e0,0xa4e1,0xa4e2,0xa4e3,0xa4e4,0xa4e5,0xa4e6,0xa4e7, -0xa4e8,0xa4e9,0xa4ea,0xa4eb,0xa4ec,0xa4ed,0xa4ee,0xa4ef, -0xa4f0,0xa4f1,0xa4f2,0xa4f3,0xa4f4,0xa4f5,0xa4f6,0xa4f7, -0xa4f8,0xa4f9,0xa4fa,0xa4fb,0xa4fc,0xa4fd,0xa4fe,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa9b1,0xa9b2,0xa9b3,0xa9b4,0xa9b5,0xa9b6,0xa9b7,0xa9b8, -0xa9b9,0xa9ba,0xa9bb,0xa9bc,0xa9bd,0xa9be,0xa9bf,0xa9c0, -0xa9c1,0xa9c2,0xa9c3,0xa9c4,0xa9c5,0xa9c6,0xa9c7,0xa9c8, -0xa9c9,0xa9ca,0xa9cb,0xa9cc,0xa2df,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa8b1,0xa8b2,0xa8b3,0xa8b4,0xa8b5,0xa8b6,0xa8b7,0xa8b8, -0xa8b9,0xa8ba,0xa8bb,0xa8bc,0xa8bd,0xa8be,0xa8bf,0xa8c0, -0xa8c1,0xa8c2,0xa8c3,0xa8c4,0xa8c5,0xa8c6,0xa8c7,0xa8c8, -0xa8c9,0xa8ca,0xa8cb,0xa8cc,0x0000,0x0000,0x0000,0xa2de, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x3300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa7c9,0xa7ca,0xa7cb,0xa7cc,0xa7cd,0x0000,0x0000,0x0000, -0xa7ba,0xa7bb,0xa7dc,0xa7dd,0xa7de,0xa7b6,0xa7b7,0xa7b8, -0xa7d4,0xa7d5,0xa7d6,0xa7d7,0xa7d8,0xa7a1,0xa7a2,0xa7a3, -0xa7a5,0xa7ab,0xa7ac,0xa7ad,0xa7ae,0xa7af,0xa7b0,0xa7b1, -0xa7b2,0xa7b3,0xa7b4,0xa7a7,0xa7a8,0xa7a9,0xa7aa,0xa7bd, -0xa7be,0xa7e5,0xa7e6,0xa7e7,0xa7e8,0xa7e1,0xa7e2,0xa7e3, -0xa7bf,0xa7c0,0xa7c1,0xa7c2,0xa7c3,0xa7c4,0xa7c5,0xa7c6, -0xa7c7,0xa7c8,0xa7ce,0xa7cf,0xa7d0,0xa7d1,0xa7d2,0xa7d3, -0xa7da,0xa7db,0xa2e3,0xa7ec,0xa7a6,0xa7e0,0xa7ef,0xa2e1, -0xa7bc,0xa7ed,0xa7b5,0x0000,0x0000,0x0000,0x0000,0xa7b9, -0xa7ea,0x0000,0x0000,0xa7eb,0x0000,0x0000,0xa7df,0x0000, -0xa2e4,0x0000,0x0000,0xa7e4,0xa7ee,0xa7e9}; - -static const int ucs_a3_uhc_table_min = 0x2f00; -static const int ucs_a3_uhc_table_max = 0x2f00 + (sizeof(ucs_a3_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_i_uhc_table[] = { -/* 0x4d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xece9,0xefcb,0x0000,0xf6d2,0x0000,0x0000,0x0000,0xd8b2, -0xeddb,0xdfb2,0xdfbe,0xf9bb,0x0000,0xdcf4,0x0000,0x0000, -0x0000,0xf5e4,0x0000,0x0000,0xf3a6,0xdde0,0xe1a6,0x0000, -0xcef8,0xdcb0,0x0000,0x0000,0x0000,0x0000,0xe3aa,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf1e9,0x0000,0x0000, -0x0000,0x0000,0xcdfa,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfcaf,0xd3a1,0x0000,0xf1ab,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe7d1,0xd2ac,0x0000,0xcef9,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf1fd,0x0000,0xdebf,0xfbba,0xf9b9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xced2,0x0000, -0xe3ab,0xebe0,0x0000,0x0000,0x0000,0xcefa,0xcbf7,0xe5a5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcae1,0x0000,0xd4cc,0x0000,0x0000, -0x0000,0x0000,0x0000,0xeae1,0x0000,0x0000,0xdce3,0xdfad, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbeb,0x0000, -0x0000,0x0000,0xd5af,0x0000,0x0000,0x0000,0xd6f5,0x0000, -0xe5f8,0x0000,0x0000,0xdec0,0xeca3,0x0000,0xe9cd,0x0000, -0xeaa7,0xe9f6,0xfbbb,0x0000,0xe7e9,0xefcc,0x0000,0x0000, -0xd0e6,0x0000,0x0000,0xdec1,0x0000,0x0000,0xe4ac,0x0000, -0x0000,0xd8cc,0xf9f1,0x0000,0xcedf,0xfaa4,0xe6b2,0x0000, -0xfafb,0x0000,0x0000,0xfabd,0xccc8,0xefcd,0xd5d5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3a2,0x0000, -0x0000,0x0000,0xecd1,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe4a7,0xecd2,0x0000,0x0000,0xf6b1,0x0000,0x0000,0xcefb, -0x0000,0x0000,0xd0d1,0xcbbf,0x0000,0xeda4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeda8,0xdec2,0xf6e2,0xeddc, -0xdcf5,0xe0b9,0x0000,0x0000,0x0000,0xd4ce,0x0000,0xf4b5, -0x0000,0x0000,0x0000,0xd3db,0xd6b5,0xeca4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe4e6,0x0000,0xf1ea,0x0000,0x0000,0x0000,0xcbec,0xcbc0, -0x0000,0x0000,0x0000,0xecf2,0x0000,0x0000,0x0000,0x0000, -/* 0x4f00 */ -0x0000,0xd0ea,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf9f2,0xeca5,0xd0df,0x0000,0xe7ea,0xd0eb,0xdcd1, -0xdbe9,0xfdcc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbd7, -0x0000,0x0000,0x0000,0x0000,0xdae1,0x0000,0xd6b6,0x0000, -0xe3df,0x0000,0xdec3,0x0000,0xdec4,0xcaa1,0x0000,0x0000, -0x0000,0x0000,0x0000,0xeeec,0x0000,0x0000,0xd3a3,0xeeb7, -0xf8cf,0x0000,0x0000,0x0000,0x0000,0xeac8,0xeeb8,0xf1ac, -0xf1a5,0xe9ce,0x0000,0x0000,0x0000,0xf9bc,0x0000,0x0000, -0x0000,0xe5f9,0xecea,0xddd6,0xedc2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8a5,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5ba, -0xdbd8,0x0000,0x0000,0xcaa2,0x0000,0x0000,0xd1cd,0x0000, -0x0000,0x0000,0xeeed,0x0000,0x0000,0x0000,0xeceb,0xdec5, -0x0000,0xe3e0,0x0000,0xcac9,0xf2e9,0x0000,0xd5ce,0x0000, -0xf6b6,0x0000,0xcec2,0xd6c7,0x0000,0xe3b4,0x0000,0xf1ad, -0x0000,0xeae2,0x0000,0x0000,0x0000,0x0000,0xd7c2,0x0000, -0xf3a7,0x0000,0x0000,0xcdea,0x0000,0xebee,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9b2,0xfda5, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf6d5,0xd5e2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8b5, -0x0000,0x0000,0xccf5,0xf5b5,0xe4ad,0x0000,0x0000,0x0000, -0x0000,0xe7eb,0xf1d5,0x0000,0x0000,0x0000,0xf0bb,0x0000, -0x0000,0xe9b5,0x0000,0xccc9,0xfad5,0x0000,0x0000,0xe1d4, -0x0000,0x0000,0xd7d6,0x0000,0x0000,0xdcc1,0x0000,0xdec6, -0xfaef,0xe3e1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1f3,0xdcf6, -0x0000,0xcefc,0x0000,0xdbc4,0x0000,0xf8f1,0x0000,0x0000, -0xdce4,0x0000,0xe5ef,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5000 */ -0x0000,0x0000,0xdcb1,0x0000,0x0000,0x0000,0xd5d6,0x0000, -0x0000,0xf3da,0x0000,0xcbc1,0x0000,0xdbc3,0x0000,0x0000, -0x0000,0xd9fa,0xd3ee,0x0000,0x0000,0x0000,0xfab8,0x0000, -0x0000,0xfda6,0xebef,0x0000,0xf4a6,0x0000,0xccca,0xf3a8, -0x0000,0xf3db,0x0000,0xdba7,0xf6b7,0x0000,0xcfe6,0xf0f2, -0xcbda,0x0000,0xe7d2,0xd7c3,0xf6f0,0xe8de,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe5a6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe5e7,0x0000,0x0000,0x0000,0xcaa3, -0xcca7,0xeac9,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8b6, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfaa5,0x0000,0x0000, -0x0000,0x0000,0xf1ae,0x0000,0xefce,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcbed,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6b0,0xefcf,0xe9cf,0x0000, -0xf7de,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xced3,0x0000,0x0000,0x0000,0x0000,0xdcf7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdba8,0x0000,0x0000, -0x0000,0xcbf8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdfa1,0xdde1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf5ca,0xe9b6,0x0000,0x0000, -0x0000,0x0000,0xe7ec,0xeeee,0x0000,0xf3f0,0x0000,0xdfbf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcccb,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd0c1,0x0000,0x0000, -0x0000,0xf4d2,0xe0ba,0x0000,0x0000,0x0000,0x0000,0xdfc0, -0x0000,0xcee0,0x0000,0x0000,0x0000,0xdcd2,0xfdea,0x0000, -0x0000,0x0000,0xd6f6,0x0000,0x0000,0x0000,0xeaca,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe8e9,0x0000,0xe3ac, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf3d0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcaa4,0x0000,0xdbf8,0x0000,0x0000,0x0000,0xdec7, -0xebf0,0xf1d6,0x0000,0x0000,0xe5e2,0x0000,0xcccc,0x0000, -0x0000,0xcbfb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xeae3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdfc1, -0x0000,0xd6ed,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9d0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xeeb9,0x0000,0x0000,0x0000,0x0000,0xd5e3, -0x0000,0x0000,0xd1d3,0x0000,0xe5f0,0x0000,0x0000,0x0000, -0xe8b4,0xebc3,0x0000,0xeaaa,0xfafc,0xf5f6,0xf0bc,0xfdd4, -0xe0bb,0xcec3,0x0000,0xd0ba,0xf7ba,0xd8f3,0xf7cd,0x0000, -0x0000,0x0000,0xe4ae,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4df,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd0e7,0x0000,0x0000,0xecfd,0x0000,0xd2ae, -0xeeef,0xd5d7,0xeae4,0xf8a2,0xcdeb,0xd7bf,0xfbb1,0x0000, -0x0000,0xcdec,0x0000,0x0000,0x0000,0xdcb2,0xd0ec,0xcefd, -0xeef0,0x0000,0x0000,0x0000,0xccc2,0x0000,0x0000,0x0000, -0xd0ed,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5f7,0x0000, -0x0000,0x0000,0xf3fc,0x0000,0x0000,0xeea2,0x0000,0x0000, -0x0000,0x0000,0xd9b3,0x0000,0x0000,0xd8f4,0x0000,0xe9b7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xceae,0x0000,0x0000,0x0000,0x0000,0xd9a2,0x0000,0x0000, -0x0000,0x0000,0xd8f1,0x0000,0xd4cf,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5a7,0xd5d2, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd6a9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf4a2,0x0000,0xf1d7,0x0000, -0x0000,0xd5d8,0x0000,0xf0bd,0xd7d0,0xd4d0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd7cf,0xebea,0xfdeb,0x0000, -0x0000,0xdbed,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfcc5,0xcbc2,0x0000,0x0000,0x0000,0x0000,0xfdd5,0x0000, -0xf4c8,0xe8ea,0xf5f3,0x0000,0x0000,0xf9de,0x0000,0x0000, -0xd3ef,0x0000,0x0000,0xecd3,0x0000,0x0000,0xddc2,0xefb7, -0xe7d4,0x0000,0xcaca,0x0000,0x0000,0x0000,0xd9fb,0x0000, -0x0000,0xfafd,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6aa, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4f8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf7f7,0xdcac,0x0000,0x0000, -0x0000,0xd7d7,0xdfa2,0x0000,0x0000,0x0000,0xcebe,0x0000, -0xd3f0,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0a4,0xe1ec, -0xcfe7,0xf3cb,0xeda9,0xcabe,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf4ef,0x0000,0x0000,0x0000,0xf6ce, -0x0000,0x0000,0xdefb,0xd0bb,0xd5b7,0xeef1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf4a8,0x0000,0xdcf8,0x0000, -0x0000,0x0000,0x0000,0xcba7,0x0000,0xdace,0x0000,0x0000, -0x0000,0xe0e6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeda5,0xeef2,0x0000,0x0000,0x0000,0x0000,0xdcf9, -0x0000,0x0000,0xf9dc,0x0000,0x0000,0xf3dc,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf8f2,0x0000,0xf4f9, -0x0000,0x0000,0x0000,0xfcf1,0x0000,0x0000,0x0000,0xd0bc, -0xdbf9,0xd7b1,0x0000,0x0000,0x0000,0xcbfc,0x0000,0x0000, -0x0000,0xf0a5,0xcbfd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5f4,0x0000,0x0000,0x0000,0xcded, -0xcaa5,0x0000,0x0000,0xd6ab,0xd0c2,0x0000,0x0000,0x0000, -0x0000,0xf0be,0xd2bd,0xcca4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfab6,0x0000, -0x0000,0xcccd,0x0000,0xdafa,0x0000,0xf6cf,0x0000,0xe9b8, -0x0000,0xd8f5,0x0000,0x0000,0x0000,0xccce,0x0000,0x0000, -0x0000,0x0000,0xd7cd,0x0000,0x0000,0xd4d1,0xe9ed,0x0000, -0xcaeb,0xd9e2,0x0000,0xfdb2,0x0000,0xe3ad,0xd6cc,0xd9b4, -0x0000,0x0000,0xe1a7,0xeed3,0xd0c3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfdb3,0x0000,0xd5e4,0x0000,0x0000, -0xcfe8,0x0000,0xedc3,0xd0b2,0x0000,0x0000,0xcefe,0xdaa8, -/* 0x5300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xf8d0,0x0000,0x0000, -0xfdd6,0x0000,0x0000,0x0000,0x0000,0xf8d1,0x0000,0xf8d2, -0xdcd3,0x0000,0x0000,0x0000,0x0000,0xdde2,0xfbf9,0xddc1, -0x0000,0xe3b5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeddd,0xcec4,0x0000,0xcba1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdde3,0x0000,0x0000,0x0000,0x0000,0xfcdd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf9af,0x0000,0x0000,0x0000,0x0000,0x0000,0xd2fb, -0xcfa1,0xe4a8,0x0000,0xf4b6,0xecfe,0x0000,0x0000,0xe3ae, -0xe7ed,0xfdc1,0xdae2,0x0000,0x0000,0xd8b3,0x0000,0x0000, -0x0000,0xdde4,0xf0ef,0xf6f1,0xfaf0,0x0000,0x0000,0xd1f5, -0x0000,0x0000,0xdacf,0x0000,0xdcd4,0x0000,0xdca6,0x0000, -0xefbf,0x0000,0x0000,0x0000,0x0000,0x0000,0xcecf,0x0000, -0xe0d9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9d6, -0xecd4,0xeacb,0x0000,0x0000,0xcabf,0xd5b0,0x0000,0xcfe9, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf1ed,0x0000,0xcccf, -0x0000,0x0000,0x0000,0x0000,0xe4f8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe4ed,0x0000,0x0000,0x0000,0x0000, -0xd7d8,0x0000,0xfda7,0x0000,0x0000,0x0000,0x0000,0xeaab, -0xf6b2,0x0000,0x0000,0x0000,0x0000,0xcff0,0xf9bd,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6f4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcbdb,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf3d1,0x0000,0x0000,0x0000,0x0000, -0xe9d1,0xf3a9,0xd0e0,0xe9d2,0x0000,0xdae3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe2d2,0x0000,0xf6a2,0xe1f4, -0x0000,0x0000,0x0000,0xdae4,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe7d5,0xf5bf,0xcfa2,0xcdaf,0xcfa3,0x0000,0x0000, -0x0000,0xcdb0,0xf1fe,0xd0a3,0xe1af,0xf8a3,0x0000,0xcaa6, -0xf7bb,0xf2ea,0xdec8,0xe9d3,0x0000,0x0000,0x0000,0x0000, -0xdec9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5400 */ -0x0000,0x0000,0x0000,0xfdde,0xcac0,0x0000,0x0000,0x0000, -0xf9ea,0xd1ce,0xeed4,0x0000,0xd4d2,0xd9a3,0xfda8,0xd7d9, -0xf7ce,0xfabe,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcfd6,0x0000,0xd7f0,0x0000,0xebe1, -0xf8c5,0x0000,0x0000,0x0000,0x0000,0x0000,0xdcfa,0x0000, -0x0000,0xddc3,0x0000,0xf9df,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe7ef,0x0000,0x0000,0x0000,0x0000, -0xfde5,0xf6a3,0x0000,0xd9fc,0xfda9,0x0000,0xe7ee,0x0000, -0x0000,0x0000,0xd5e5,0x0000,0x0000,0x0000,0x0000,0x0000, -0xefd0,0x0000,0xcdb1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf7a2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf1b2,0x0000,0xf1b1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcdb2,0x0000,0xdaab,0x0000,0xcaa7,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe3e2,0xfbbc,0xd9a4,0x0000,0x0000, -0xeeba,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8d3,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfbfa,0x0000,0xcfa4,0x0000, -0xdcfb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6e3,0x0000,0x0000,0x0000, -0xedaa,0x0000,0x0000,0xf2a1,0xcee1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfaa6,0x0000,0x0000,0x0000,0x0000, -0xf9e0,0x0000,0x0000,0x0000,0x0000,0xecd6,0x0000,0x0000, -0xe4ee,0xf9a1,0x0000,0x0000,0xfbef,0x0000,0x0000,0x0000, -0xf9eb,0xeea3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeaac,0x0000,0x0000,0x0000,0xcaa8,0x0000,0x0000, -0xf4fa,0x0000,0x0000,0x0000,0x0000,0xcdd6,0xfcf6,0x0000, -0x0000,0x0000,0xf4c9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8d4,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5500 */ -0x0000,0x0000,0x0000,0x0000,0xf8a6,0x0000,0xdeca,0xf2c6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7da,0x0000, -0xd3d0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd8c5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeae6, -0x0000,0xf3dd,0x0000,0x0000,0x0000,0xe4da,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf6e4,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6f2,0x0000,0xdfc2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9fd, -0x0000,0x0000,0x0000,0xccf6,0x0000,0x0000,0xd3ba,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4af,0x0000, -0x0000,0x0000,0x0000,0xf9e1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf0a6,0x0000,0x0000,0x0000, -0xcbd3,0x0000,0x0000,0x0000,0xe0bc,0x0000,0xf4ca,0xd4fa, -0x0000,0xfdaa,0xf9e2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf4b7,0xfdc2,0xfcb0,0x0000,0xfdec,0xcae2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfdbd, -0x0000,0xeae7,0xdfc3,0xd1d2,0xcee2,0x0000,0xd3a4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfdab,0x0000,0xdfe0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf2c7,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe7f0,0x0000,0xd0ee,0x0000,0x0000,0xf3aa, -0x0000,0x0000,0x0000,0xdecb,0xf6b8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe1f5,0xf1b3,0x0000, -/* 0x5600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf7a3,0x0000, -0x0000,0xcaa9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcfa5,0x0000,0x0000,0xdfc4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1b0, -0x0000,0x0000,0xf0bf,0x0000,0xf6a4,0x0000,0xe3b6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfac6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0ef,0x0000,0x0000,0xfded,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xddc4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfcf7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6bf,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdead,0x0000,0xfabf,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe5f1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xedc4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd2a5,0x0000,0x0000,0xfdee,0x0000,0x0000, -0x0000,0xf5b6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe1f6,0xdecc,0x0000,0x0000,0xfcde,0x0000, -0xecd7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcddd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd6b7,0xcdb3,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5700 */ -0x0000,0x0000,0x0000,0xf8d5,0xe5d8,0x0000,0x0000,0x0000, -0xcfea,0x0000,0x0000,0xcfd0,0x0000,0xeacc,0x0000,0x0000, -0x0000,0x0000,0xeaae,0xeaad,0x0000,0x0000,0xd3f1,0x0000, -0xd3a5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf7cf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeea4,0x0000,0x0000,0x0000,0x0000,0xd0a4,0x0000,0x0000, -0xf2a2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd0f0,0x0000,0x0000,0x0000,0x0000, -0xf2a3,0x0000,0xf7f8,0x0000,0x0000,0x0000,0x0000,0xd0b3, -0x0000,0x0000,0xdba9,0x0000,0x0000,0xd3bb,0xcaec,0x0000, -0xf1a6,0xcbd5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf7e7,0x0000,0x0000,0xcdde,0x0000,0xf7a4,0x0000, -0x0000,0x0000,0xf8c0,0x0000,0x0000,0x0000,0xd3dd,0x0000, -0xccd0,0x0000,0x0000,0x0000,0x0000,0xcfa6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6f3,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe1f7,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd3dc,0x0000,0x0000,0xfafe,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfaa7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xebd9,0x0000,0xcfa7,0xeaaf,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe4ef,0x0000,0x0000,0x0000,0xe9b9, -0xf1d8,0x0000,0x0000,0xd8d8,0x0000,0x0000,0xe0f2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6b4, -0xdcfc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf3f1,0x0000,0x0000,0x0000,0xe3d0,0x0000,0x0000,0xf2fb, -0x0000,0xdbc6,0xd0f1,0x0000,0xd0f2,0x0000,0x0000,0x0000, -0xcfdc,0x0000,0xd3d1,0x0000,0x0000,0xccb1,0xf7d8,0x0000, -0xcba8,0xebbc,0xe4be,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4dc,0x0000, -0x0000,0xdcc2,0x0000,0x0000,0xf0a7,0x0000,0x0000,0xe6c0, -0x0000,0x0000,0xcaed,0x0000,0x0000,0x0000,0x0000,0xe8eb, -0xe5e8,0xdcc3,0x0000,0x0000,0xedde,0xd3f2,0x0000,0x0000, -0x0000,0x0000,0xccf7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xced4,0xe7ab,0x0000,0x0000,0x0000,0xcbc3, -0x0000,0xe1b1,0x0000,0x0000,0xf7b2,0x0000,0x0000,0xd3f3, -0xd3d2,0x0000,0xf5c0,0x0000,0x0000,0x0000,0xdfdd,0x0000, -0x0000,0xeef3,0xe7f1,0x0000,0xfdb4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf2c8,0x0000,0x0000, -0x0000,0xf3d2,0x0000,0x0000,0xeef4,0x0000,0xe2d3,0x0000, -0x0000,0x0000,0x0000,0xccd1,0x0000,0xdfea,0x0000,0x0000, -0x0000,0xe9ba,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd9d7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf5cd,0x0000,0xf1f2,0xfac7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd9f8,0xd4c2,0x0000,0x0000,0x0000,0x0000,0xf6e5,0x0000, -0x0000,0x0000,0x0000,0xddc5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe7f2,0xeddf,0x0000,0x0000,0xcacb,0x0000, -0x0000,0xdbfa,0x0000,0x0000,0x0000,0xe8b5,0x0000,0xd3a6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfdb5,0x0000, -0x0000,0xf9c9,0x0000,0xe4e2,0x0000,0xfbbd,0x0000,0x0000, -0xd7a4,0xcec5,0x0000,0x0000,0x0000,0x0000,0xced5,0xd6e6, -0x0000,0x0000,0x0000,0x0000,0xe5bd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdecd,0xecf3,0x0000,0x0000,0xede0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xecec,0xfbbe,0xdfeb,0x0000,0xe1f8,0x0000,0x0000, -/* 0x5900 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf9be, -0x0000,0x0000,0x0000,0x0000,0xd0f3,0xe0aa,0xe8e2,0x0000, -0x0000,0xe2d4,0xd2fd,0x0000,0xe5a8,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd9d3,0x0000,0x0000,0x0000,0x0000,0xd3de, -0x0000,0xf4b8,0xf7bc,0xdcfd,0x0000,0xe8ec,0xe4e7,0x0000, -0x0000,0xe3f7,0x0000,0x0000,0x0000,0x0000,0x0000,0xeca8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfaf1,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe5f2,0x0000,0x0000,0xd0f4, -0xd2af,0xdce5,0x0000,0x0000,0x0000,0x0000,0xd0a5,0xf1b4, -0xfcb1,0xccf8,0x0000,0x0000,0xddc6,0xfad1,0x0000,0xf7df, -0x0000,0x0000,0xfaa8,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeef5,0x0000,0xdece,0x0000,0x0000,0x0000,0x0000,0xe7f3, -0x0000,0x0000,0xf7ac,0xebc4,0xede1,0xe0ab,0xddc7,0x0000, -0x0000,0x0000,0x0000,0xd2b3,0xd2bf,0x0000,0x0000,0x0000, -0xcacc,0x0000,0x0000,0x0000,0x0000,0xfbbf,0x0000,0x0000, -0x0000,0x0000,0xe5fd,0xdde5,0xd8cd,0x0000,0x0000,0x0000, -0x0000,0x0000,0xecf4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd0f5,0x0000,0x0000,0xe8ed,0xd0d2, -0x0000,0xd9d8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf6e6,0x0000,0x0000, -0xdbaa,0x0000,0x0000,0x0000,0xf7e0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd8d9,0x0000,0xf4a3,0x0000,0x0000,0xf4dd,0x0000, -0x0000,0x0000,0x0000,0xefd1,0x0000,0x0000,0xd9b5,0x0000, -0x0000,0xedab,0x0000,0xe3b7,0x0000,0x0000,0x0000,0x0000, -0xeebb,0xcdb4,0x0000,0xe0f3,0xeacd,0x0000,0x0000,0x0000, -0x0000,0xecf5,0xe8ee,0x0000,0xcba9,0xf1af,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcacd,0x0000, -0xeca9,0x0000,0xf2eb,0x0000,0xfdef,0x0000,0xf9f3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe6c1,0x0000,0x0000,0xecd8,0x0000,0x0000,0x0000,0xedac, -/* 0x5a00 */ -0x0000,0xeace,0x0000,0xe8df,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdecf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd2a6,0x0000,0x0000,0xe7f4,0xd1d6,0x0000,0x0000,0xe6c2, -0xe3e3,0x0000,0x0000,0x0000,0x0000,0xe4b0,0x0000,0x0000, -0x0000,0xd8b4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf6a5,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf3de,0x0000,0x0000,0x0000, -0x0000,0xd7a5,0x0000,0x0000,0x0000,0x0000,0xf7e8,0x0000, -0x0000,0xe8c6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfbe6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdde6,0x0000,0x0000,0x0000,0xdcfe,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd8da,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdaac,0xeab0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe3b8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcaaa,0xe1f9,0x0000,0xeab1,0x0000,0x0000,0x0000, -0x0000,0xf2ec,0x0000,0x0000,0xfaee,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeed5,0x0000,0x0000,0x0000,0x0000,0xf9f4,0x0000, -0x0000,0xd2ec,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5b00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xfbfb,0x0000,0x0000, -0x0000,0xfdf0,0x0000,0xe0bd,0xcee3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8c6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdeae,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdfc5,0x0000,0x0000,0xe5be,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xedad,0xfaea,0x0000,0x0000,0xcdee,0xeda6,0x0000,0xedae, -0xf0ed,0x0000,0xdda1,0x0000,0xedaf,0xfcf8,0x0000,0xd8eb, -0x0000,0x0000,0x0000,0xccf9,0xcdb5,0x0000,0x0000,0x0000, -0x0000,0xfaa9,0x0000,0xe1dd,0x0000,0x0000,0x0000,0x0000, -0xe2d5,0xedcf,0x0000,0x0000,0x0000,0xdda2,0x0000,0x0000, -0xf9ca,0x0000,0xeae8,0x0000,0xe5ed,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd3eb,0x0000,0xe9d4, -0xe1fa,0xe4cc,0x0000,0xe1e4,0xe8c7,0x0000,0x0000,0xcedb, -0x0000,0x0000,0x0000,0xdcd5,0x0000,0xf7b5,0xfcf3,0xf0f3, -0xceaf,0xf1b5,0xefd2,0xe8c8,0xebf1,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcbd4,0xe0be,0xe3f8,0xeae9,0xfcb2,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe0f4,0x0000,0xcfe0,0x0000, -0xeea5,0x0000,0x0000,0xfaaa,0xe6c3,0xe1b2,0xcaab,0x0000, -0xe3e4,0xe9bb,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2d6, -0xf3f2,0x0000,0xeed6,0xeab2,0xd0f6,0xecd9,0xdacb,0xcfa8, -0x0000,0x0000,0x0000,0x0000,0xdda3,0x0000,0x0000,0x0000, -0xd8db,0x0000,0xf9ce,0xe9d5,0xe3d1,0x0000,0x0000,0xd2bc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd8ac,0xf3cc, -0x0000,0xcdfb,0xf6d6,0x0000,0xe7f5,0xe8ef,0xe3f9,0xd2bb, -0xf3f3,0xe3fb,0x0000,0xded0,0xceb0,0x0000,0xd6f7,0xf1d9, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5c1,0xdcc4,0x0000, -0xf5bb,0x0000,0xded1,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x5c00 */ -0x0000,0xdce6,0x0000,0x0000,0xded2,0x0000,0x0000,0xede2, -0xeef6,0xeacf,0xf0ee,0xe3fc,0x0000,0xd3df,0xd3f4,0xe1b3, -0x0000,0xe1b4,0x0000,0x0000,0x0000,0x0000,0xf4d3,0x0000, -0x0000,0xdfc6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe9d6,0x0000,0x0000,0x0000, -0xdbab,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf6a6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe3b9,0xebc5,0xf4a9,0xcdb6,0xd2f9,0x0000,0xdaad,0xd2e3, -0xcfd1,0x0000,0x0000,0x0000,0x0000,0xcbdc,0xccfa,0x0000, -0xcfdd,0x0000,0x0000,0xe8a9,0x0000,0xe3bb,0xe3ba,0x0000, -0x0000,0xe0da,0x0000,0x0000,0x0000,0xeef7,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdcb3,0x0000,0x0000,0x0000,0x0000, -0xd3f5,0x0000,0xd7a6,0x0000,0xf6b5,0xd7db,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe1d5,0x0000,0x0000,0xd4ea, -0x0000,0xdfa3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfddf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0f7,0xedd4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcbaa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe4db,0x0000,0xe1fb,0xcba2,0x0000,0x0000,0x0000, -0x0000,0xd3e0,0x0000,0xe4bf,0x0000,0xfbc0,0x0000,0xdabe, -0xe4cd,0x0000,0xd6b9,0x0000,0x0000,0x0000,0xefc0,0x0000, -0xe1fc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf6b9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdfc7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe4b1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdce7, -0xdce8,0x0000,0x0000,0x0000,0xfad6,0x0000,0xd3f6,0x0000, -0x0000,0x0000,0x0000,0xf1da,0x0000,0xfaf2,0x0000,0x0000, -/* 0x5d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2fd, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd5cf,0xd0f8,0x0000, -0x0000,0xcddf,0x0000,0x0000,0xf5cb,0x0000,0xe4f0,0xcbab, -0x0000,0xd7c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2fe, -0x0000,0xddda,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdaae,0xcaee,0x0000,0x0000,0x0000, -0xd5b9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe3a1,0x0000,0x0000,0xe8e3,0x0000,0x0000,0xf3ab, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfa9, -0x0000,0x0000,0x0000,0xd3f7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd4f1,0x0000,0x0000, -0xcee4,0x0000,0xe8f2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe5f5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe7ae,0x0000,0xd6ba,0x0000,0xdfec,0xe4c0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe8e4,0x0000,0x0000, -0x0000,0x0000,0xd8b5,0x0000,0x0000,0x0000,0xe4dc,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4b9,0xf1b6,0x0000, -0x0000,0xe2de,0xe1b5,0x0000,0x0000,0xcdef,0xf1a7,0xcee5, -0xcbdd,0x0000,0x0000,0xd9e3,0x0000,0x0000,0xf3ac,0x0000, -0x0000,0xd0f9,0xecab,0xded3,0xf7e9,0x0000,0x0000,0xf9f5, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe1de,0xcbee,0x0000, -/* 0x5e00 */ -0x0000,0x0000,0xe3bc,0xf8d6,0x0000,0x0000,0xdbee,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfdf1,0x0000,0x0000,0x0000, -0x0000,0xf7b6,0x0000,0x0000,0x0000,0x0000,0xf4de,0x0000, -0x0000,0xf2ed,0x0000,0xdbd9,0x0000,0xf0a8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe1fd,0x0000,0x0000, -0x0000,0x0000,0x0000,0xded4,0x0000,0xe0ac,0x0000,0x0000, -0x0000,0x0000,0x0000,0xede3,0x0000,0x0000,0xd3e1,0x0000, -0xdfc8,0x0000,0x0000,0x0000,0x0000,0xd9b6,0x0000,0xfdac, -0xefd3,0x0000,0x0000,0x0000,0xe4c1,0xf8eb,0x0000,0xdbac, -0x0000,0x0000,0x0000,0x0000,0xfcc6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd8ad,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf6ba, -0x0000,0xdbdf,0xd3d3,0xf8c7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcace,0xf8c1,0xd2b4,0x0000,0x0000,0xdcb4, -0xfab9,0xcacf,0x0000,0xfcb3,0xeaea,0xeaeb,0xd0fa,0x0000, -0x0000,0x0000,0x0000,0x0000,0xede4,0x0000,0x0000,0xdde7, -0x0000,0x0000,0xdfc9,0x0000,0x0000,0x0000,0x0000,0xdfed, -0x0000,0x0000,0x0000,0x0000,0x0000,0xeebc,0x0000,0xefc1, -0x0000,0x0000,0xccd2,0x0000,0xdda4,0x0000,0x0000,0x0000, -0xdfca,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3f8,0xf1a8, -0x0000,0x0000,0x0000,0xcdb7,0x0000,0xefd4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe4dd,0xdfee,0xcbac, -0xe9bc,0x0000,0x0000,0x0000,0x0000,0x0000,0xeaec,0x0000, -0x0000,0x0000,0xdfcb,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf9bf,0xd6af,0xd5c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcfaa,0x0000,0x0000,0xcea9,0x0000,0x0000,0xd6f8,0x0000, -0x0000,0x0000,0xf1b7,0xeef8,0x0000,0x0000,0x0000,0xd9d9, -0xf3df,0x0000,0xf8c8,0xcec6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd5e6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf4e6,0x0000,0x0000,0xe6c5,0xefd5, -0x0000,0x0000,0xcbef,0xfcdf,0x0000,0x0000,0x0000,0x0000, -/* 0x5f00 */ -0x0000,0xdca7,0x0000,0x0000,0xd6e7,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8c9,0x0000,0x0000,0x0000,0x0000,0xe3d2, -0x0000,0xe3bd,0x0000,0xcfe1,0xf0c0,0xecda,0x0000,0xddd7, -0xfbf0,0x0000,0x0000,0xecac,0x0000,0x0000,0x0000,0xf0a9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfad7,0xfbc1, -0x0000,0xd2c0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe5b0,0x0000,0x0000,0x0000,0xede5,0x0000,0x0000, -0x0000,0x0000,0xcbad,0x0000,0xf9b0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf7a5,0x0000,0xcbae,0x0000,0xdaaf,0x0000,0xd8b6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3a7,0xfbb2, -0x0000,0xfdc4,0x0000,0xecad,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfba1,0x0000,0x0000,0x0000,0xe5e9,0xe9ee, -0x0000,0xf3f4,0xf8f3,0xf0c1,0xdeaf,0xf8b0,0x0000,0x0000, -0xf3e0,0xe7af,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbad, -0x0000,0xe6b5,0x0000,0x0000,0xf9a8,0x0000,0x0000,0xddd8, -0xe8d9,0xefd6,0x0000,0x0000,0x0000,0xd3e2,0x0000,0xe2df, -0x0000,0x0000,0xfce0,0xd7c8,0xfdad,0x0000,0x0000,0x0000, -0xdfef,0xccd3,0xd3f9,0x0000,0x0000,0x0000,0x0000,0xd4f0, -0xdbc7,0xded5,0x0000,0x0000,0x0000,0x0000,0xf0f4,0x0000, -0xd5d0,0xe5d9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfcc7,0xdcd6,0xe2e0,0x0000,0x0000,0x0000,0xdab0,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf3a3,0x0000,0xd3ec, -0x0000,0xf4cb,0x0000,0x0000,0x0000,0xfdc5,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe3fd,0x0000,0xf9b1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd0fb,0xecdb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf5bc,0xf2a4, -0xd8ce,0xd8cf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf5f7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf6e1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd2b7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfbec,0x0000,0xddc8, -/* 0x6000 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4e8, -0x0000,0x0000,0xd2c1,0x0000,0x0000,0x0000,0xf8d7,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd6bb,0xded6,0x0000,0x0000, -0xf7bd,0xecae,0x0000,0x0000,0x0000,0xd0e1,0x0000,0xe0f5, -0xeab3,0x0000,0xced6,0x0000,0x0000,0x0000,0x0000,0xcca5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xecf6,0xe2e1,0xe3be,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfcc8,0x0000,0x0000, -0xcdf0,0x0000,0xf9f6,0x0000,0x0000,0xdff0,0x0000,0x0000, -0x0000,0xe5bf,0x0000,0x0000,0x0000,0xcebf,0x0000,0x0000, -0x0000,0x0000,0xfce1,0xedb0,0xfdd1,0xf6bb,0x0000,0x0000, -0xf9cf,0xebda,0xcac1,0x0000,0xd2b8,0xcdf1,0x0000,0xe3d3, -0xfde6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6ed,0x0000,0x0000, -0x0000,0xe3fa,0x0000,0x0000,0xf0aa,0xf9d0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfce2,0x0000,0xf8a7,0x0000, -0x0000,0x0000,0xe1e5,0xeef9,0x0000,0x0000,0x0000,0xe7f6, -0xeaed,0x0000,0x0000,0xfcb4,0xf5c2,0x0000,0x0000,0xd7dc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf0f5,0x0000,0xdde8,0xd3ed,0xf5fc,0x0000,0xdabf,0x0000, -0xccfb,0x0000,0x0000,0x0000,0xd3fa,0xf4a4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xefd7,0x0000,0xd4c3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfbe3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfbed,0x0000,0xe0ad,0x0000,0x0000,0xeaee, -0xfbb3,0xe4c2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf6e7,0xd2dd,0x0000,0xdfcc,0x0000,0x0000,0xfcc9,0x0000, -0x0000,0xe5a9,0xe0f6,0xf6b3,0x0000,0x0000,0x0000,0x0000, -/* 0x6100 */ -0x0000,0xe1fe,0x0000,0x0000,0x0000,0x0000,0xcbf0,0x0000, -0xeaef,0xeaf0,0x0000,0x0000,0x0000,0xdac0,0xf8b4,0xebf2, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe4c3,0x0000,0x0000, -0x0000,0x0000,0xe9d7,0xe4f1,0x0000,0x0000,0x0000,0xcaef, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xced7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfcca,0x0000,0x0000,0x0000,0xf3e1,0x0000,0x0000,0xcbc4, -0x0000,0x0000,0x0000,0x0000,0xe3e5,0x0000,0xcbc5,0xeab4, -0x0000,0x0000,0xe9bd,0x0000,0xd7c9,0x0000,0x0000,0xebdb, -0xedb1,0x0000,0xccc3,0xf7be,0xfccb,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf8f4,0x0000,0xd9b7,0x0000,0x0000, -0xf3d3,0xf3d4,0x0000,0x0000,0x0000,0xf7e4,0x0000,0xf7d1, -0x0000,0x0000,0xd8b7,0xceb1,0xcac2,0x0000,0x0000,0xfbb4, -0xcbc6,0x0000,0x0000,0xf0f6,0x0000,0x0000,0xd5e7,0x0000, -0xead0,0x0000,0x0000,0x0000,0x0000,0x0000,0xccd4,0xcbaf, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4aa,0xe9af,0x0000, -0x0000,0xf5c3,0xe9d8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdde9,0x0000,0x0000,0x0000,0xf1f3,0x0000, -0xd5fb,0xdebb,0x0000,0x0000,0xf4fb,0x0000,0x0000,0x0000, -0xfdf3,0xfdf2,0xf7a6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xddc9,0x0000,0x0000,0xd4d3, -0x0000,0xcca8,0x0000,0xdac1,0xccd5,0x0000,0xd9e4,0x0000, -0x0000,0x0000,0xfaca,0x0000,0x0000,0x0000,0xe5e3,0x0000, -0x0000,0x0000,0xd3bc,0x0000,0x0000,0x0000,0xcaf0,0x0000, -0x0000,0x0000,0x0000,0xd0c4,0x0000,0x0000,0x0000,0xcad0, -0xfaab,0xebeb,0xe7f8,0xd9e5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd1d7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf3a4,0x0000,0x0000,0x0000,0xd4fb,0xfce3, -0xfad8,0x0000,0xf3d5,0x0000,0xcfab,0x0000,0x0000,0xebf3, -0xd5fc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3d4, -0xcdfc,0x0000,0xd9e6,0x0000,0xe2f9,0xe2a1,0xebd4,0x0000, -0xe0f7,0xe4b2,0xccfc,0x0000,0x0000,0x0000,0xfbe4,0x0000, -0x0000,0x0000,0xf4ab,0x0000,0x0000,0x0000,0x0000,0xd0bd, -0x0000,0xcaf1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xefb8,0x0000,0x0000,0x0000,0xd7c0,0x0000, -0xeefa,0xfdf4,0x0000,0x0000,0xd3e3,0x0000,0xfbc2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5e8,0xdbae, -0xe1b6,0xf8b7,0x0000,0x0000,0x0000,0x0000,0x0000,0xe0bf, -0xfbc3,0xddea,0x0000,0xe2a2,0x0000,0xeea6,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf6e8,0x0000,0x0000,0x0000,0x0000, -0xf6f5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xddca,0x0000, -0x0000,0xd0e2,0x0000,0x0000,0x0000,0x0000,0xdda6,0x0000, -0x0000,0xddeb,0x0000,0x0000,0xe4f9,0x0000,0x0000,0xe3af, -0xd0fc,0x0000,0x0000,0x0000,0xf4fc,0x0000,0x0000,0x0000, -0x0000,0xccbc,0xf7ea,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe5e4,0xdff1,0x0000,0x0000,0xf7e1,0x0000,0xf9f7, -0xefb9,0x0000,0x0000,0xf8d8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9a9,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8d9,0x0000,0x0000,0x0000,0xeebd,0x0000,0x0000, -0x0000,0xd8c6,0x0000,0x0000,0xe4e3,0xf5ce,0x0000,0x0000, -0x0000,0x0000,0xddd9,0x0000,0x0000,0x0000,0x0000,0xd9e7, -0xd2b9,0xd5c3,0x0000,0x0000,0xdae5,0xdad0,0x0000,0xd1d9, -0xced8,0x0000,0xcbde,0xf4ac,0xdafb,0x0000,0xf6e9,0xe8f3, -0xcfac,0xf0f0,0x0000,0xf4fd,0xdbc8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcec0,0xe3d4,0xd1cf,0xf1f5, -0x0000,0xcdf2,0x0000,0xcfeb,0x0000,0x0000,0x0000,0xcdb8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe3a6,0xd1da, -/* 0x6300 */ -0x0000,0xf2a5,0x0000,0x0000,0x0000,0x0000,0x0000,0xf2a6, -0x0000,0xe4ce,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd3fb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf1a9,0x0000,0x0000,0x0000,0xf2c9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xefd8,0xe6c9,0x0000,0xd8b8,0xfaf3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf3b5,0x0000,0x0000,0xf8a4,0x0000,0x0000,0xd1f3, -0xe6c8,0x0000,0x0000,0x0000,0x0000,0xf8da,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdce9, -0xded7,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbdf,0x0000, -0x0000,0x0000,0xcfec,0x0000,0x0000,0x0000,0x0000,0xf4df, -0x0000,0x0000,0xd1f4,0xd2ba,0x0000,0x0000,0x0000,0xdff2, -0x0000,0x0000,0x0000,0xe1b7,0x0000,0x0000,0x0000,0x0000, -0xe2a3,0xd3fc,0x0000,0x0000,0xede6,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdbc9,0x0000,0x0000,0x0000,0xe4fa,0x0000, -0xcfde,0x0000,0x0000,0xced0,0x0000,0x0000,0x0000,0x0000, -0xd5d3,0xf3f5,0xf7ae,0x0000,0x0000,0xefc8,0x0000,0xcdf3, -0xf5cf,0xe5f3,0xf0c2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcad1,0x0000,0x0000,0x0000,0xeaf1,0x0000,0xd0a6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9da, -0xf0ab,0x0000,0x0000,0x0000,0x0000,0x0000,0xebe7,0x0000, -0x0000,0x0000,0xe5c0,0xfcb5,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe4c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcca9,0xfdc6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeab5,0x0000,0xe5aa,0xdfba, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x6400 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe1df,0x0000,0xdad1, -0x0000,0x0000,0x0000,0x0000,0xe1b8,0x0000,0xe8f4,0xd3fd, -0x0000,0x0000,0x0000,0x0000,0xe2a4,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf2ca,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdae6,0xf7b3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfdcd,0x0000,0x0000,0x0000,0xf3b6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeed7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf5c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd8a4,0x0000,0x0000,0x0000,0x0000,0x0000,0xf2a7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd9b8,0xd9b9,0xefc9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd6ce,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf7cb,0xdfae,0xe8f5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd2b5,0x0000,0x0000,0x0000,0xd3d5,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf4cc,0xdafc,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd9e8,0x0000,0xf7eb,0xf5c9,0x0000, -0xf3bc,0x0000,0xdad2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd3b5,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe8b6,0x0000,0x0000,0xd6cf,0xf4ba,0x0000,0xf7c9, -0x0000,0x0000,0xccaa,0x0000,0x0000,0xf0c3,0xccd6,0x0000, -0x0000,0x0000,0xd0d3,0x0000,0xd3bd,0x0000,0x0000,0x0000, -0xdbfb,0x0000,0xcbe0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd3e4,0xf6f7,0x0000,0x0000,0xd5ba,0xf3cd,0xcbe1, -0x0000,0x0000,0x0000,0x0000,0xebf4,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf4ad,0x0000,0xfcaa,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf7ec,0x0000,0x0000,0x0000,0xe8f6,0x0000, -0xdae7,0x0000,0x0000,0x0000,0xf7cc,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe5c1,0x0000,0x0000,0x0000,0x0000,0xe0ee,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5fd,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcee6,0xfcab,0xd5bb,0x0000,0x0000,0xf2a8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2a5,0xcdb9, -0xeaf2,0xcbc7,0x0000,0xcdf4,0x0000,0x0000,0xdbaf,0xefd9, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcdba,0x0000,0x0000, -0xfcf9,0x0000,0x0000,0x0000,0x0000,0xdff3,0xcee7,0xdac2, -0x0000,0xcfad,0x0000,0x0000,0x0000,0x0000,0xe7f9,0xf8a8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf3e2,0x0000, -0x0000,0x0000,0xcaf2,0xdfa4,0x0000,0x0000,0xd4c4,0x0000, -0x0000,0x0000,0x0000,0x0000,0xccd7,0xe5c2,0x0000,0x0000, -0x0000,0x0000,0xcdbb,0x0000,0xefda,0xeed8,0x0000,0xdda7, -0xe2a6,0x0000,0x0000,0x0000,0x0000,0x0000,0xe0c0,0x0000, -0x0000,0x0000,0xd6b0,0xf8ca,0x0000,0xfcfa,0x0000,0xd9fe, -0x0000,0x0000,0x0000,0x0000,0xdeb0,0x0000,0x0000,0x0000, -0xddec,0xdae8,0x0000,0x0000,0x0000,0x0000,0x0000,0xd4e0, -0x0000,0xd6f9,0x0000,0xcdd7,0xded8,0x0000,0x0000,0xf2f8, -0x0000,0xe4d6,0x0000,0x0000,0xd0c5,0xf4ae,0x0000,0xdda8, -0x0000,0x0000,0x0000,0xedc5,0xf3d6,0x0000,0x0000,0xded9, -0xe3e6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3a8, -0x0000,0xdbb0,0x0000,0x0000,0xe5da,0xe3bf,0x0000,0x0000, -0x0000,0xdbb1,0x0000,0x0000,0x0000,0xd5e9,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe0c1,0xefdb,0x0000,0x0000,0xf0e9, -0x0000,0x0000,0xd7b2,0x0000,0x0000,0x0000,0x0000,0xd0fd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd9e9,0x0000,0x0000,0xd0fe,0x0000,0xeced,0xd3a9,0x0000, -0xf2a9,0xf0c4,0x0000,0x0000,0xe2e2,0xe9ef,0x0000,0x0000, -0x0000,0xf9d1,0x0000,0x0000,0xe9d9,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe8da,0xdac3,0xdac4,0xd4c5,0x0000,0xe7fa, -/* 0x6600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcde0,0xe3b0, -0x0000,0xdbb2,0xfbc4,0x0000,0xf3e3,0x0000,0xd9a5,0xfbe7, -0xddcb,0xd0d4,0x0000,0xe6b6,0xe0ae,0xfdda,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdcb5,0xe0f8, -0xe7b1,0x0000,0x0000,0x0000,0x0000,0xf5f0,0x0000,0xd8dc, -0xedc6,0x0000,0x0000,0x0000,0x0000,0xe1b9,0x0000,0xe3c0, -0xf9c0,0xe9f0,0x0000,0x0000,0xd9db,0x0000,0xf3e4,0x0000, -0x0000,0x0000,0xdcb6,0xe4e9,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf0c5,0xe3c1,0xfccc,0xfccd,0x0000,0x0000,0x0000, -0x0000,0xf2cb,0x0000,0xf2cc,0x0000,0x0000,0x0000,0xe4cf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf1db,0x0000,0xfad9,0x0000,0xf1b8,0xfdf5,0xe0f9, -0x0000,0x0000,0x0000,0x0000,0xe7fb,0xfcb7,0xfce4,0xfbc5, -0xe3e7,0xd8b9,0x0000,0xf6f8,0x0000,0x0000,0xdcc5,0xccd8, -0x0000,0x0000,0x0000,0xe0af,0xf4e7,0x0000,0xefdc,0xcffc, -0xefdd,0x0000,0xf2aa,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfdbe,0x0000,0x0000,0xcaac, -0xfdbb,0xfdc7,0x0000,0x0000,0x0000,0x0000,0xe7b2,0x0000, -0xead1,0xdff4,0x0000,0x0000,0x0000,0x0000,0xd1ec,0xe4de, -0xe5c3,0x0000,0x0000,0x0000,0x0000,0xd9a6,0x0000,0x0000, -0xcdbc,0x0000,0xf3e5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xedd5,0x0000,0x0000,0xd9ba,0x0000, -0x0000,0x0000,0xede7,0xfbb5,0xf8ec,0x0000,0x0000,0x0000, -0x0000,0xe0e7,0x0000,0xccd9,0x0000,0x0000,0xd4c6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe7a5,0x0000,0xd5f5,0xd3be, -0x0000,0xfcfb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4f2,0x0000, -0x0000,0xdff5,0x0000,0x0000,0xe8f8,0xf8ed,0x0000,0x0000, -0xcec7,0x0000,0x0000,0x0000,0x0000,0x0000,0xfdf6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe8d8,0x0000,0xcdd8,0xe7d6,0xccda,0x0000,0x0000,0xcae3, -0xdff6,0xf0c7,0xf0c6,0x0000,0xd8ba,0x0000,0xf1f4,0xf4f0, -0xf5cc,0x0000,0x0000,0xfce5,0x0000,0x0000,0x0000,0x0000, -0xeac5,0xeaf3,0x0000,0xdddb,0x0000,0xdcd7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdefd,0xf2f9,0x0000,0xd5c7, -0x0000,0x0000,0x0000,0xd8d0,0x0000,0xf0c8,0xd1a1,0xd1a2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9d4,0xd6e8, -0xd9ca,0x0000,0xdab1,0xd8c7,0xdce2,0xf3ce,0xf5f4,0x0000, -0x0000,0xf1b9,0x0000,0x0000,0xdad3,0x0000,0xf6ea,0x0000, -0x0000,0x0000,0xcff5,0x0000,0x0000,0xfdae,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcad2,0x0000, -0x0000,0xdfb4,0x0000,0x0000,0x0000,0x0000,0xd7dd,0xfaba, -0xeea7,0xf5bd,0x0000,0xf8f5,0x0000,0x0000,0xede8,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4e1,0x0000,0xd1a3,0xe1d6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf9f8,0x0000,0xdbca, -0xcbf9,0xd4d4,0x0000,0xd9dc,0x0000,0xeebe,0x0000,0xf7ed, -0x0000,0x0000,0x0000,0xd2ee,0x0000,0x0000,0xe1e6,0xf7f9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdded, -0x0000,0xe8db,0x0000,0xdbb3,0x0000,0x0000,0x0000,0xd1f7, -0xe0b0,0x0000,0x0000,0xd4e2,0x0000,0xf6d7,0x0000,0xd7f9, -0x0000,0x0000,0xd8dd,0x0000,0xcdfd,0xf2ab,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcdbd, -0xf8c2,0x0000,0x0000,0xf2ac,0x0000,0x0000,0xcaad,0xcaae, -0xcfae,0x0000,0x0000,0x0000,0x0000,0x0000,0xe3c2,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdcb7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbda, -0xd9bb,0xcaf3,0xf6d3,0xe6f8,0xeaf5,0x0000,0x0000,0x0000, -0x0000,0x0000,0xeaf6,0x0000,0x0000,0xf6f9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcfaf,0x0000,0x0000,0xcad3,0x0000,0x0000,0xcaaf, -0xd2b0,0xf1ba,0x0000,0xd7b3,0xe3c3,0xf3fd,0xdeda,0x0000, -0x0000,0x0000,0x0000,0xdedb,0x0000,0x0000,0xefde,0x0000, -/* 0x6800 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe2e3,0xeefb,0x0000,0x0000,0xdff7,0xd7ca, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcee8,0xdbdb,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1bb,0x0000,0x0000,0x0000,0x0000,0xe9f1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfab7,0xd0c6,0x0000,0x0000,0xccab,0xeea8,0x0000,0x0000, -0xcbfa,0xf9f9,0xccfd,0xd3fe,0x0000,0x0000,0x0000,0x0000, -0xe4d0,0x0000,0x0000,0x0000,0x0000,0x0000,0xf2ee,0x0000, -0xd4d5,0xdfcd,0x0000,0xfcb8,0xd1d0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf2cd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf7d2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcad4, -0x0000,0xd5d9,0x0000,0x0000,0x0000,0xd8de,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcdd9, -0x0000,0x0000,0x0000,0xeea9,0xf6bc,0x0000,0x0000,0xccdb, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf0c9,0x0000,0xfcfc, -0x0000,0xe8c9,0xf4fe,0x0000,0x0000,0x0000,0x0000,0xe7fc, -0xd7de,0x0000,0x0000,0x0000,0x0000,0xdedc,0x0000,0xf0ac, -0xccfe,0xcde1,0x0000,0xe1ba,0x0000,0xdbef,0xdab2,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd1a5,0xdcb8,0x0000,0x0000, -0x0000,0xd8f6,0x0000,0xd1a4,0x0000,0xcde2,0x0000,0x0000, -0x0000,0x0000,0xdcea,0x0000,0x0000,0xf0f7,0x0000,0xf0ca, -0xd0be,0x0000,0xdddc,0x0000,0x0000,0x0000,0x0000,0xd4d6, -0xd3d6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xedd0, -0xcda1,0x0000,0x0000,0x0000,0x0000,0x0000,0xdfb5,0x0000, -0x0000,0x0000,0xdff8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd4a1,0xceb2,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe8ca,0x0000,0x0000,0x0000,0x0000,0xebf5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe3d5,0xf5d0,0x0000, -0x0000,0x0000,0xf5a1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9a7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe5ab,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6cb,0x0000,0xf5f1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe5c5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9a3,0xe0db,0xf6eb,0x0000,0xcbf1, -0x0000,0xd9ea,0xf5a2,0x0000,0x0000,0x0000,0xd7d1,0x0000, -0xd1f8,0xeaf8,0xeaf9,0xdab3,0x0000,0x0000,0x0000,0x0000, -0xefdf,0x0000,0x0000,0xf1ef,0x0000,0xe5f6,0xeebf,0xe2e4, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd0bf,0x0000,0xfaac, -0xf5d1,0xe7b3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe9be,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf2ce,0xdbb4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfcce,0x0000,0xddee, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe7b4,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd7b4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf7b4,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcdbe,0x0000,0xdae9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcfb0,0xf7d9,0xf3e6,0x0000,0x0000, -0xced9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xceaa,0x0000,0xcbc8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd0a7,0x0000,0xf0cb,0x0000,0xd0c7, -/* 0x6a00 */ -0x0000,0x0000,0xe4c5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdbe0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd5da,0x0000,0xd7a7,0x0000,0x0000,0x0000,0xeec0, -0x0000,0xf8f6,0x0000,0x0000,0x0000,0x0000,0xf5d2,0xede9, -0x0000,0xd9bc,0x0000,0xe5c6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5a3,0x0000,0x0000, -0xdad4,0xe2a7,0xfbfc,0x0000,0x0000,0xf1dc,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcaf4,0x0000,0x0000,0x0000, -0xe8fa,0x0000,0x0000,0xcee9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9f8,0xe2e5,0x0000,0x0000,0x0000,0x0000, -0xd0b9,0xd4f2,0x0000,0x0000,0x0000,0x0000,0x0000,0xd1a6, -0x0000,0xdfce,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfcf4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd3aa,0x0000,0x0000,0x0000,0xccac,0x0000,0x0000,0x0000, -0x0000,0xefe0,0x0000,0x0000,0x0000,0xe5e5,0xd0d5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbfc, -0x0000,0x0000,0x0000,0x0000,0xfce6,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcbfe,0xedea,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdeb1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9e3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd4a2,0xcff6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd6d0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5ea,0xf1ee,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfacb,0x0000, -0x0000,0x0000,0x0000,0xe5a1,0x0000,0x0000,0x0000,0x0000, -/* 0x6b00 */ -0x0000,0x0000,0x0000,0x0000,0xd5b1,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcfed,0x0000,0xedeb,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5b2,0x0000,0x0000,0x0000,0xd5bc,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfde2,0xf3ad,0x0000,0xfddb,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9b0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd1a7,0x0000,0x0000,0xfde3,0xceb3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfde4,0xface, -0x0000,0x0000,0x0000,0x0000,0xcab0,0x0000,0xf7a7,0x0000, -0xcfb1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6a2, -0x0000,0xfcb6,0xf2ad,0xefe1,0xf3ae,0xdcc6,0xd9eb,0x0000, -0x0000,0x0000,0xe8e0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe1a8,0x0000,0x0000,0x0000,0x0000,0xd5f6, -0xcffd,0x0000,0x0000,0xdedd,0x0000,0x0000,0x0000,0xd9d1, -0x0000,0x0000,0x0000,0xe4ea,0xf2cf,0x0000,0xf7bf,0x0000, -0x0000,0xe2e6,0xe2a8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe3d6,0x0000, -0xedd1,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9f9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6b1,0xdeb2, -0x0000,0x0000,0xe0e8,0x0000,0x0000,0xd3ab,0x0000,0xebdc, -0x0000,0x0000,0xdfaf,0x0000,0xcac3,0x0000,0x0000,0xeefc, -0x0000,0xfdc3,0x0000,0x0000,0x0000,0xebf6,0xcfb2,0x0000, -0x0000,0x0000,0x0000,0xd9ec,0x0000,0xd9bd,0x0000,0xd8df, -0x0000,0x0000,0xd4b8,0xebbe,0xddef,0x0000,0xddf0,0xddf1, -0xddf2,0x0000,0x0000,0xd9be,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbc6,0xcfb3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x6c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeefd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4ab, -0x0000,0xdac5,0x0000,0xd8ec,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd1a8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe2a9,0x0000,0x0000,0xdebc, -0xe7b5,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbf0,0x0000, -0xefe2,0xf1f0,0xcfb4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdbf1,0x0000, -0xe0b1,0x0000,0x0000,0x0000,0x0000,0xdfa5,0x0000,0xf9d2, -0x0000,0x0000,0xe7fd,0x0000,0x0000,0xe6a3,0xfbf1,0xcbb0, -0xf2ae,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcde7,0x0000,0xe8dc,0x0000,0x0000,0xe7d7,0x0000,0x0000, -0xf7c0,0x0000,0xd0e3,0x0000,0x0000,0x0000,0xdaa1,0x0000, -0x0000,0x0000,0xccbd,0x0000,0x0000,0xd1a9,0xddcc,0x0000, -0x0000,0xe3fe,0xd1aa,0xe8aa,0x0000,0xeab6,0xf9fa,0xe6cc, -0xf6d8,0x0000,0x0000,0x0000,0xd4c7,0x0000,0x0000,0x0000, -0xd9cb,0x0000,0xd9d2,0xd3cb,0xd8f7,0xdaa9,0xf5f8,0x0000, -0x0000,0xdede,0xf2af,0xf8a9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd8c8,0x0000,0x0000,0xeec1,0x0000, -0x0000,0x0000,0x0000,0xf9c1,0x0000,0x0000,0x0000,0x0000, -0xddf3,0xeafa,0x0000,0xf6bd,0xe1bb,0xcdbf,0xf4d4,0xe6cd, -0x0000,0xfccf,0xfba2,0x0000,0xe0dc,0x0000,0x0000,0x0000, -0x0000,0xf4bb,0xdad5,0x0000,0xf9b2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbf2,0x0000,0xdbf6,0x0000,0xdedf, -0x0000,0x0000,0x0000,0xdbf2,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8dc,0xf7ee,0xebe8,0x0000,0xd2fa,0x0000,0x0000, -0xf1bc,0x0000,0x0000,0xfada,0x0000,0x0000,0xdaea,0xdac6, -0xf7c1,0x0000,0x0000,0xe7b6,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x6d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe5c7,0xd6ac,0x0000,0x0000,0x0000, -0x0000,0xdcc7,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1a9, -0x0000,0xe2aa,0x0000,0xd5a6,0x0000,0x0000,0xd4d7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf2d0,0x0000,0xeafb, -0x0000,0xe0dd,0xfbf3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1bd,0x0000,0x0000,0xe2e7,0xfdd7,0x0000, -0xcec8,0xeab7,0x0000,0xfcc0,0x0000,0xfde7,0xf7ef,0x0000, -0x0000,0xd7b5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xefba,0xf1dd,0x0000,0xdeb3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe8cb,0x0000,0x0000,0xf8dd,0x0000, -0x0000,0xfbc7,0xd5c8,0x0000,0xd7df,0x0000,0xdda9,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe9b1,0x0000,0x0000,0xfaad, -0xf6d9,0xfaf4,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8aa, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6ee,0x0000,0xccdc, -0xe1bc,0xe0ef,0x0000,0x0000,0xe9bf,0xfcfd,0xe6ce,0x0000, -0x0000,0xe1d7,0x0000,0xe6cf,0x0000,0xf4f1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4f3, -0x0000,0x0000,0xe4fb,0x0000,0x0000,0xf9e4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xefe3,0x0000,0x0000,0xcfee,0xf6be,0xe0b2,0xfcfe,0xd1ab, -0x0000,0x0000,0x0000,0xd7fa,0x0000,0x0000,0x0000,0xfbc8, -0x0000,0xe2d7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd4a3,0xf0f8,0xd7a8,0x0000,0x0000,0x0000,0xe1e7,0x0000, -0x0000,0xd3bf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xefe4,0x0000,0xd7c5,0xebe2,0x0000,0x0000,0xfce7,0x0000, -0x0000,0xe4a2,0x0000,0xe2e8,0x0000,0xe6d0,0x0000,0xfbe8, -0xf4e8,0xe5f4,0xf4bc,0xf4d5,0x0000,0x0000,0x0000,0x0000, -/* 0x6e00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdfb6, -0x0000,0xfcb9,0xeec2,0xcaf5,0x0000,0x0000,0x0000,0xefe5, -0xcbe2,0xd4a4,0x0000,0xdee0,0xdafd,0xe4c6,0xe8be,0x0000, -0x0000,0x0000,0x0000,0xe0de,0xf6b4,0xead2,0x0000,0xf9fb, -0x0000,0x0000,0xe0c2,0x0000,0xcae4,0x0000,0xe7b7,0x0000, -0xeafd,0x0000,0xd9dd,0x0000,0xdab4,0xeeaa,0xfbe9,0x0000, -0x0000,0x0000,0x0000,0xdbcb,0xdab5,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1be,0x0000,0x0000,0xd3ac,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfbc9,0x0000, -0xdfcf,0x0000,0x0000,0xd3c0,0xe3d7,0x0000,0xefe6,0xfcd0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9c0, -0x0000,0x0000,0x0000,0xf5d3,0x0000,0x0000,0xecdc,0xf7b7, -0x0000,0x0000,0xeab8,0xd1f9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdcc8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xeab9,0x0000,0x0000,0x0000,0x0000,0x0000,0xf1de,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd7b6,0xcfb5,0x0000,0xd9a8, -0x0000,0x0000,0xecee,0x0000,0x0000,0xddaa,0x0000,0x0000, -0x0000,0x0000,0xcda2,0xe8ae,0x0000,0x0000,0x0000,0xe1bd, -0x0000,0xf2d1,0x0000,0x0000,0x0000,0x0000,0xe9c1,0x0000, -0x0000,0x0000,0xd2fc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdbb5,0x0000,0xf3e7,0xd8fe,0x0000,0x0000, -0x0000,0xfcd1,0x0000,0xedb2,0xf4af,0x0000,0xfba3,0x0000, -0x0000,0xfcc1,0x0000,0xeeab,0xd4a5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4f2, -0x0000,0x0000,0x0000,0x0000,0xeed9,0x0000,0x0000,0x0000, -0xfbca,0x0000,0x0000,0x0000,0x0000,0x0000,0xcde3,0xd8bb, -/* 0x6f00 */ -0x0000,0xe5db,0xf8f7,0x0000,0x0000,0x0000,0xf6d4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7a9, -0x0000,0xcbc9,0x0000,0x0000,0xe6d1,0xf0cc,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd8ae,0x0000,0xf9d3,0xd5fe,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd8bc,0xf2b0,0x0000,0x0000,0x0000, -0x0000,0xe2ab,0xf3e8,0x0000,0x0000,0x0000,0x0000,0x0000, -0xefc2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xedec, -0x0000,0xe7b8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdafe,0x0000,0x0000,0xccbe,0x0000,0x0000,0xf2fc, -0xdaeb,0x0000,0xe2d8,0xedd6,0x0000,0x0000,0xd6d1,0xe0b3, -0x0000,0x0000,0xfcd2,0x0000,0xebc8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd3c1,0xf0cd,0x0000, -0xcff7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xedd2,0x0000,0xd4d8,0xdcc9,0xd7f1,0x0000, -0x0000,0xdfbb,0x0000,0x0000,0xf3a5,0x0000,0x0000,0x0000, -0xf4cd,0x0000,0x0000,0x0000,0x0000,0xf1bf,0xf8b1,0x0000, -0xe9fa,0x0000,0x0000,0x0000,0xfbcb,0x0000,0x0000,0xcad5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9d4,0xf7ca,0x0000,0x0000,0xd6c8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfce8,0xf3bd, -0x0000,0xeefe,0x0000,0xe7fe,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd3c2,0x0000,0x0000,0x0000,0x0000,0xd3b6,0x0000, -0xccad,0xf6fa,0xd6b2,0xd2d8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe7d8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe3a5,0x0000,0x0000, -0x0000,0x0000,0xe7b9,0x0000,0x0000,0x0000,0x0000,0xf0ad, -0xfbcc,0xeba1,0x0000,0x0000,0xd4a6,0x0000,0x0000,0x0000, -0x0000,0xfbcd,0x0000,0xd5bd,0xf1df,0x0000,0x0000,0xf6fb, -0x0000,0xdeb4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5eb,0x0000, -/* 0x7000 */ -0x0000,0xe5c8,0x0000,0x0000,0x0000,0xfba4,0xd4b9,0x0000, -0x0000,0xdee1,0x0000,0xe4a3,0x0000,0x0000,0x0000,0xd7b7, -0x0000,0xf8ee,0x0000,0x0000,0x0000,0xdeb5,0x0000,0x0000, -0xd6d2,0x0000,0xf9d5,0xe7ba,0xebd5,0xd5f7,0xefe7,0xe1be, -0x0000,0x0000,0x0000,0xfaae,0x0000,0x0000,0x0000,0xd6e9, -0xd6ee,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe7bb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeccb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5b3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xceb4,0x0000,0x0000,0x0000, -0xfba5,0xe1ee,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf7a8,0x0000,0x0000,0x0000,0x0000,0xfbce,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd8bd,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbfd,0x0000,0x0000,0x0000,0x0000, -0xfce9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcfb6,0x0000,0x0000,0x0000,0xedc7,0xeeac,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xccdd,0x0000,0x0000, -0x0000,0x0000,0xf6a7,0x0000,0x0000,0x0000,0xe6fa,0x0000, -0x0000,0x0000,0xf5a4,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfddc,0xedb3,0xcec9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xefe8,0x0000,0x0000,0xe1bf,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfadb,0xcbe3,0xf7a9,0x0000,0xfba6, -0x0000,0x0000,0x0000,0xdcb9,0x0000,0x0000,0x0000,0xf1c0, -0xedc8,0xefc3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd6ad,0x0000,0x0000,0xfdce,0x0000,0x0000,0x0000,0xe8a1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfbf4,0xd5a7,0x0000,0x0000,0x0000,0xf1f6,0x0000,0xe6d3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xccde,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8b2,0x0000,0x0000,0x0000,0xdceb,0x0000,0x0000, -/* 0x7100 */ -0x0000,0x0000,0x0000,0x0000,0xfdb6,0x0000,0x0000,0x0000, -0x0000,0xe5ea,0x0000,0x0000,0xf1e0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdbcc,0xddcd,0x0000,0x0000,0x0000,0xd4c8,0x0000, -0x0000,0xd9ed,0x0000,0x0000,0x0000,0x0000,0xf5a5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe6fb,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6d4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfdc8, -0x0000,0xd6a1,0xfdbf,0x0000,0xfcd3,0x0000,0xefa1,0x0000, -0xe7bc,0x0000,0x0000,0x0000,0x0000,0x0000,0xd1ee,0x0000, -0x0000,0xe6d5,0x0000,0x0000,0xe9f2,0x0000,0xdfb0,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd8e0,0xfcba,0xfdaf,0xf0ce, -0x0000,0xdbe1,0x0000,0x0000,0xe5c9,0x0000,0xedb4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe0c3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe3d8,0x0000,0x0000,0x0000, -0x0000,0xe9fb,0xeaa8,0x0000,0x0000,0x0000,0x0000,0xfdb7, -0x0000,0x0000,0xfba7,0x0000,0xe9c2,0x0000,0x0000,0x0000, -0x0000,0xfdf7,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2d9, -0x0000,0x0000,0xdcec,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe8a2,0x0000,0x0000,0x0000, -0x0000,0xe6f0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfdf8,0xfdf9,0x0000,0x0000,0x0000,0xf6bf,0x0000, -0x0000,0xe7a7,0x0000,0xe6d7,0x0000,0x0000,0x0000,0x0000, -0xd4f3,0xd4c9,0x0000,0x0000,0x0000,0x0000,0xd6fa,0x0000, -0xd7f2,0x0000,0xe1c0,0x0000,0xdbe2,0xe6d8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe7bd, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf0cf,0xf3be,0xe2ac, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5b7,0xe0f0,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfdb8,0xe3e8,0x0000,0xd4a7,0xe8fc, -0xfad2,0x0000,0x0000,0x0000,0x0000,0x0000,0xf8ef,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd6d3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5b4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf0d0,0x0000,0xf7f0,0xeeb3,0x0000,0x0000, -0xeaba,0x0000,0xead3,0x0000,0x0000,0xedc9,0xddab,0x0000, -0x0000,0x0000,0xe5ac,0xfda1,0x0000,0xdfd0,0xecb3,0x0000, -0xdfd1,0x0000,0x0000,0x0000,0x0000,0x0000,0xeded,0xf8b8, -0xf7fa,0x0000,0x0000,0x0000,0xf8ab,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf4e0,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd4ba,0xe4b3,0x0000,0xe9da,0x0000,0xdeb6,0x0000,0xd9bf, -0x0000,0xd9c0,0xd6ef,0x0000,0x0000,0x0000,0x0000,0xd9cc, -0x0000,0xdaaa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdfe5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf7e5,0x0000,0x0000,0x0000,0xccb2,0x0000,0x0000, -0xdff9,0xd7e0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd4bb,0x0000,0x0000,0x0000,0x0000,0xfdfa, -0x0000,0x0000,0x0000,0x0000,0xccb3,0x0000,0x0000,0xdbf3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdfd2,0x0000,0xceca,0x0000,0xeeda,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4e4,0x0000, -0xfbcf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfb7, -0x0000,0xeec3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xceea,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe2ad,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd7e1,0xfaf5,0x0000,0x0000,0xd5c9,0xf8ac,0x0000,0x0000, -/* 0x7300 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe7d9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf3e9,0x0000, -0x0000,0x0000,0x0000,0xd8ed,0xe3c4,0xf0f1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe8e5,0x0000,0x0000, -0x0000,0xe0fa,0xeec4,0xd9de,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeba2,0xeba3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfcc2,0xeabb, -0x0000,0x0000,0x0000,0x0000,0xe8ab,0xdee2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xedef,0x0000,0xe8a3,0x0000,0x0000,0x0000,0x0000,0xcff1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd4bc,0x0000,0xfcea,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe7be,0x0000,0xfcf2,0x0000,0x0000,0xd6b4,0x0000,0x0000, -0xe2ae,0x0000,0xd3b7,0xfacc,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfadc,0x0000,0xedb5,0xe1e3, -0x0000,0xe8ac,0x0000,0xe8dd,0x0000,0x0000,0xefe9,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf4bd,0x0000,0xcfb8,0xe9db, -0xd1ac,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdac7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xebc9, -0x0000,0xe8cc,0x0000,0x0000,0x0000,0xdeb7,0x0000,0x0000, -0x0000,0x0000,0xd6bc,0xd3e5,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfadd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdad6,0x0000,0xcab1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdac8,0xdfa6,0x0000,0xf9b3,0xf2d2,0x0000,0xcac4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcecb,0x0000, -0x0000,0xcdf5,0x0000,0x0000,0x0000,0xfdb0,0xd5a8,0x0000, -0xf1c1,0x0000,0x0000,0xe2e9,0xdcca,0xecb4,0xfac0,0x0000, -0x0000,0xfba8,0xd0a8,0x0000,0x0000,0xdaec,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9ee, -0x0000,0xe0fb,0x0000,0x0000,0x0000,0xefea,0xfade,0x0000, -/* 0x7400 */ -0x0000,0xe0c4,0x0000,0xcfb9,0x0000,0xd5ca,0xd7e2,0xe2af, -0x0000,0xd7b8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe8cd,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf6da,0x0000,0x0000,0x0000,0x0000, -0xefa2,0xe2da,0xf6fc,0x0000,0x0000,0xfbd0,0xd1ad,0x0000, -0xcde4,0x0000,0xd1ae,0xdced,0xe8ce,0x0000,0xf0f9,0xceb5, -0xe6fc,0x0000,0x0000,0xd7fb,0xd0d6,0xddf5,0xf7f1,0x0000, -0xf6fd,0x0000,0xdbf7,0x0000,0x0000,0x0000,0x0000,0xfbea, -0xe9dc,0xd9c1,0x0000,0xf5f2,0xe0c5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xead4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf9c2,0x0000,0xeabc, -0x0000,0xd2c5,0xfbd1,0xe7c0,0xeba5,0x0000,0xdffa,0xe3a2, -0xd7b9,0x0000,0xe9c3,0x0000,0xe8fd,0xe8af,0x0000,0x0000, -0xf2d3,0xfba9,0xd8a5,0x0000,0x0000,0x0000,0x0000,0xd5cb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0c8,0x0000, -0x0000,0x0000,0xd1af,0xd7e3,0x0000,0x0000,0x0000,0xe0c6, -0x0000,0xd6a2,0x0000,0xedf0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd7f3,0x0000,0x0000,0x0000,0xfcd4,0x0000,0xdad7,0xccdf, -0x0000,0xf2d4,0x0000,0xd1b0,0x0000,0xcce0,0x0000,0xdbfd, -0xf3bf,0x0000,0xf0d1,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfcbb,0x0000,0xe2b0,0x0000,0x0000,0xe6a5,0x0000,0x0000, -0x0000,0xe2db,0x0000,0x0000,0x0000,0xdfde,0x0000,0xe0c7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf2ef,0x0000, -0x0000,0x0000,0xcce1,0x0000,0x0000,0x0000,0x0000,0xd6ea, -0x0000,0x0000,0x0000,0x0000,0xe7c2,0x0000,0x0000,0x0000, -0xceb6,0x0000,0xf3c0,0x0000,0xcdfe,0x0000,0x0000,0x0000, -0xfbd2,0x0000,0xf8f8,0xf7fb,0x0000,0x0000,0xe8bf,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe8b7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xedb6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x7500 */ -0x0000,0xdcba,0x0000,0x0000,0xccb4,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf1f7,0x0000,0x0000,0x0000,0xe8b8,0x0000,0x0000, -0xcaf6,0x0000,0xe4a4,0xf4d6,0x0000,0x0000,0x0000,0xdfe6, -0x0000,0x0000,0x0000,0xdfa7,0x0000,0xdfe7,0xe1c1,0x0000, -0xe9c4,0x0000,0x0000,0xdccb,0xe9c5,0x0000,0x0000,0x0000, -0xefa3,0xeba6,0xcba3,0xe3e9,0x0000,0x0000,0x0000,0xd1fb, -0xefa4,0x0000,0xefeb,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0b4, -0x0000,0x0000,0x0000,0x0000,0xcda3,0x0000,0x0000,0xe8e6, -0x0000,0xefa5,0x0000,0xd3cc,0xdaed,0x0000,0x0000,0x0000, -0x0000,0xd7ba,0x0000,0xf2d5,0xf5e5,0xd9ef,0x0000,0x0000, -0x0000,0x0000,0xf9b4,0x0000,0x0000,0xd5d4,0xfdcf,0x0000, -0x0000,0x0000,0xdbe3,0x0000,0x0000,0x0000,0x0000,0xf1e1, -0xecb6,0x0000,0x0000,0x0000,0x0000,0xfbfe,0xd3d7,0x0000, -0xd1b1,0x0000,0xcbb1,0x0000,0x0000,0x0000,0x0000,0xd1b2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbb2,0xf1c2, -0x0000,0x0000,0xf4e1,0xf9b5,0x0000,0x0000,0xe1c3,0xe1c2, -0x0000,0xebf7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdfa8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcbca,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe6b9,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8de,0xf9aa,0xcaf7,0x0000,0xedb7,0x0000,0x0000, -0xd3b8,0xf2d6,0x0000,0x0000,0xd4d9,0xeec5,0xf2f0,0x0000, -0x0000,0x0000,0xcab2,0x0000,0x0000,0xdcbb,0x0000,0xf1f8, -0x0000,0x0000,0x0000,0x0000,0x0000,0xecb7,0x0000,0x0000, -0x0000,0x0000,0xe5ca,0x0000,0xf6c0,0xfddd,0x0000,0x0000, -0xd4e3,0xcce2,0x0000,0xf7d4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd7e5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd3c3,0x0000,0xd8a6,0x0000,0xf6c1,0x0000,0x0000,0x0000, -0x0000,0x0000,0xddf6,0x0000,0xcdc0,0x0000,0x0000,0x0000, -0xe5dc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe5cb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe1c4,0x0000,0x0000,0x0000,0x0000,0x0000,0xe8b0, -0xf4b0,0xf3ea,0xdaee,0x0000,0xd7bb,0x0000,0xe2b1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd7aa,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd6fb,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe4df,0x0000,0xcad6,0x0000, -0x0000,0x0000,0xeba8,0x0000,0x0000,0x0000,0xdbfe,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf6c2,0x0000,0x0000,0xefbb,0x0000,0x0000,0x0000, -0x0000,0xd4fd,0x0000,0x0000,0xe0c8,0x0000,0x0000,0x0000, -0xe8b9,0x0000,0xefa6,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcda4,0x0000,0x0000,0xd4f4,0xdba1,0xdbdc,0xdbdd,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeedc,0x0000,0xcbcb,0xfcd5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xceeb,0x0000, -0xcdc1,0x0000,0x0000,0xfbd3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf9ab,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf5d4,0x0000,0x0000,0x0000,0x0000,0xd9a9, -0x0000,0x0000,0xe9dd,0xdbcd,0x0000,0x0000,0xddce,0x0000, -0xe7c3,0x0000,0xeccc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf9ec,0x0000,0x0000,0x0000,0xcbcc,0x0000, -0x0000,0x0000,0x0000,0xe0fc,0xd4a8,0x0000,0xedd3,0xd8ef, -0x0000,0xf2d7,0x0000,0xcaf8,0xdaef,0x0000,0x0000,0xd6d4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9cd,0x0000, -0x0000,0x0000,0xd8ee,0x0000,0xf2c1,0x0000,0x0000,0x0000, -0xdfd3,0x0000,0x0000,0x0000,0xdaf0,0x0000,0xe2ea,0x0000, -/* 0x7700 */ -0x0000,0xe0fd,0x0000,0x0000,0xd8f8,0x0000,0x0000,0x0000, -0xf7af,0xdab6,0x0000,0xcad7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf2d8,0x0000, -0xd8f9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfadf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfef, -0xd9c2,0x0000,0xf0d2,0x0000,0xe4d1,0x0000,0x0000,0x0000, -0xf3b7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfae0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xefec,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe2b2,0x0000,0xd4bd,0x0000,0x0000,0xd9ce,0x0000, -0x0000,0x0000,0x0000,0xf4e2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd4a9,0x0000,0x0000,0x0000,0x0000,0xcdc2,0xe7da, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf2d9,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd9aa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd8be,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdcad,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe2eb,0xd6fc,0x0000,0x0000, -0xcaf9,0x0000,0x0000,0xd4da,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf4d7,0xcca1,0x0000,0x0000,0xcfba, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf5b8, -0x0000,0x0000,0x0000,0xd9c3,0xd0e8,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe3c5,0xebf8,0x0000,0xf2b1,0x0000,0x0000, -0x0000,0xcfbb,0x0000,0x0000,0x0000,0xd3ad,0xe8e1,0xceec, -0x0000,0x0000,0x0000,0xe0b4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x7800 */ -0x0000,0x0000,0xdee3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xddf7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf2b2,0xf3f6,0xf6db, -0x0000,0x0000,0x0000,0x0000,0xd7fe,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8df,0x0000,0xf7f2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd0a9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6da, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5a6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd7bc,0xcce3,0x0000,0x0000,0xe6db, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdddd,0x0000,0x0000,0x0000, -0x0000,0xd1b3,0x0000,0x0000,0x0000,0x0000,0x0000,0xefed, -0x0000,0x0000,0x0000,0x0000,0xd6de,0xe4f4,0xe1ef,0x0000, -0x0000,0xddf8,0x0000,0x0000,0x0000,0x0000,0x0000,0xe8cf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcae5,0x0000,0x0000,0x0000,0xdca1, -0x0000,0xe0b5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfcac,0xfcad,0xd8a7,0x0000,0x0000,0x0000, -0x0000,0xedb8,0x0000,0x0000,0x0000,0xdbb6,0x0000,0x0000, -0x0000,0x0000,0xd6f0,0xf3af,0x0000,0x0000,0xcda5,0x0000, -0xdaf1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd8a8,0x0000,0x0000,0x0000,0xcce4,0x0000,0x0000,0xd1b4, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcad8,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdaf2,0x0000,0x0000,0x0000,0x0000, -/* 0x7900 */ -0x0000,0xf5a7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf5a8,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6a6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5ec,0xd5f8,0xdaf3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe3c6,0x0000,0x0000,0x0000,0xdee4,0x0000, -0xdee5,0xd1b5,0x0000,0x0000,0x0000,0x0000,0x0000,0xd1b6, -0xd1b7,0xf2b3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe9de,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0d3,0xf2b4, -0x0000,0x0000,0xf0d4,0xcbe4,0xfbd4,0xf5e6,0xe3ea,0x0000, -0xdee6,0x0000,0x0000,0x0000,0x0000,0xdfd4,0x0000,0x0000, -0xf8f9,0x0000,0x0000,0x0000,0x0000,0xf0ae,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd1b8,0x0000,0x0000,0x0000,0x0000,0xd6df, -0x0000,0xd0d7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfca1,0xefee,0xdcd8, -0x0000,0xe9df,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5dd,0xfdfb, -0x0000,0x0000,0xe0c9,0x0000,0x0000,0x0000,0xd6c9,0x0000, -0x0000,0xd4aa,0x0000,0xe5cc,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe9e0,0x0000,0x0000,0x0000,0xd0d8,0xfca2,0xd4be, -0xe2b3,0xdee7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdcbc,0xd2b6,0xf5d5,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcea1,0xf5a9,0x0000,0x0000,0xddf9,0x0000,0x0000, -0xddfa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0d5, -0x0000,0x0000,0x0000,0x0000,0xf6df,0x0000,0xf2da,0xe4eb, -0x0000,0xf2f1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xecb9,0x0000,0x0000,0x0000,0x0000, -0xfdfc,0x0000,0x0000,0x0000,0x0000,0xe1aa,0x0000,0x0000, -0xcad9,0x0000,0x0000,0xefef,0x0000,0xf5aa,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xecf9,0x0000,0x0000,0xf8ad, -0x0000,0xf2c2,0xf6c3,0x0000,0xd7d2,0x0000,0x0000,0xf9a2, -0xf0d6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0fa,0x0000, -0x0000,0xf6e0,0x0000,0x0000,0x0000,0x0000,0xe9f3,0xf2c3, -0x0000,0x0000,0x0000,0xd4ab,0xcab3,0xcda6,0x0000,0xcdc3, -0xcdda,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9cf,0x0000, -0x0000,0xf6c4,0x0000,0x0000,0x0000,0xeedd,0xe7c4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2b4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdfe2,0xe7db,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe8b1,0x0000,0xfcae,0x0000,0x0000,0x0000,0x0000, -0xe5cd,0x0000,0x0000,0x0000,0xfaeb,0x0000,0xcfbc,0x0000, -0x0000,0xcfe2,0xcdf6,0x0000,0x0000,0xeff0,0x0000,0xf4be, -0x0000,0xd4cd,0x0000,0x0000,0xf3b8,0x0000,0x0000,0x0000, -0xe9a1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf2f2,0xf3eb,0x0000,0xf0d7,0x0000,0x0000, -0xcfd7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfdf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe8c0,0xe8c1,0x0000,0x0000,0x0000,0xcfe3,0xe9a2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd0aa,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf3c1,0xd0ab,0x0000,0xd4e4, -0x0000,0x0000,0xefbc,0xd8a1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9df, -0x0000,0xf3d7,0x0000,0x0000,0x0000,0xdcbd,0x0000,0xcce5, -0xedf1,0x0000,0x0000,0xf1e2,0x0000,0xd4db,0x0000,0x0000, -0x0000,0x0000,0xe2b5,0x0000,0x0000,0xcae6,0x0000,0xd3ae, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcce6,0x0000, -0x0000,0xf1d3,0xf5e7,0x0000,0x0000,0x0000,0x0000,0xcada, -/* 0x7b00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfbee, -0x0000,0xe1c5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdfe9,0x0000,0xeede,0x0000,0x0000,0xf7c2,0x0000, -0xd8a2,0x0000,0x0000,0x0000,0x0000,0x0000,0xddac,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf0af,0xd6bd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe1ab,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf9b6,0x0000, -0x0000,0xd4f5,0x0000,0xd0c9,0xefa7,0xe2ec,0x0000,0xdbea, -0xcecc,0xf5e8,0xf7d5,0x0000,0xd3cd,0x0000,0xf3fe,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd0b5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe0fe,0x0000,0xdffb,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6dd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe8a4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbcd, -0x0000,0x0000,0x0000,0xefa8,0x0000,0x0000,0x0000,0xeeb4, -0x0000,0x0000,0x0000,0x0000,0xdad8,0xd1b9,0x0000,0xdfa9, -0x0000,0x0000,0xf3b0,0x0000,0x0000,0xccc4,0x0000,0x0000, -0x0000,0xceb7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xefa9,0x0000,0x0000, -0x0000,0xdfd5,0x0000,0x0000,0xedd7,0x0000,0x0000,0x0000, -0xeec6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xefbd,0xfcd6,0x0000,0x0000,0xdbf4,0x0000,0xefaa,0xf8b9, -0x0000,0xf5e9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe3d9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe1c6,0x0000,0x0000,0x0000,0xd4bf,0x0000,0x0000,0x0000, -0x0000,0xdee8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x7c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0ea, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf3c2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3af,0x0000, -0x0000,0xcadb,0x0000,0x0000,0x0000,0x0000,0x0000,0xfcd7, -0x0000,0x0000,0xedd8,0xe1c7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4d8,0xd6b3,0xddad, -0x0000,0x0000,0x0000,0xd5be,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf1c3,0xeedf,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd6eb,0x0000,0x0000,0x0000,0xf4d9,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd7e6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdab7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xddfb,0x0000,0x0000,0x0000,0x0000, -0x0000,0xddcf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd8a3,0x0000,0x0000,0xdad9,0x0000,0xf0d8, -0xefc4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1d8, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf1d4,0x0000,0xedf2, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5db,0x0000, -0x0000,0xd5dc,0xf3c4,0xcbd7,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe2b6,0x0000,0x0000,0x0000,0x0000,0xeff1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfbd5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd3d8,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xddd0,0xf0d9, -0xcbb3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5dd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcda7,0x0000,0x0000,0xd0ac,0x0000, -0xd1ba,0x0000,0xf1c4,0x0000,0xe5b3,0xfbf5,0xe9e1,0xfde0, -0xfcbc,0x0000,0xdaa2,0xdaa3,0x0000,0xd2a1,0x0000,0x0000, -0xd2ef,0x0000,0x0000,0x0000,0xe2ed,0x0000,0x0000,0xdee9, -0xcedc,0xf2b5,0xd0e4,0xddd1,0x0000,0x0000,0x0000,0x0000, -0xe1c8,0xdbb7,0xdfe3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xedb9,0xf1c5,0x0000,0xf3cf,0xd7ab, -0xe1ac,0x0000,0x0000,0xe3eb,0x0000,0xeec7,0x0000,0x0000, -0x0000,0xe1c9,0xcafa,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf0fb,0xfae1,0xf0da,0xcce7,0xdaf4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xccbf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xceed,0x0000, -0x0000,0xd5a9,0xfae2,0x0000,0x0000,0x0000,0xd0e5,0x0000, -0xebd6,0x0000,0xecdf,0x0000,0x0000,0x0000,0xdffc,0x0000, -0x0000,0xf7d6,0xdeea,0xcbb4,0x0000,0x0000,0xefbe,0x0000, -0x0000,0xccb5,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfbd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeff2,0xe2b7, -0x0000,0x0000,0x0000,0xcce8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf0fc,0x0000,0x0000,0x0000, -0xd6e0,0x0000,0xf1c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe2b8,0xebab,0x0000,0x0000, -0x0000,0xcbb5,0xd8d1,0x0000,0xf4ce,0xf3f7,0x0000,0x0000, -0xd7c6,0x0000,0xd1bb,0xf7aa,0x0000,0xedca,0xd7d3,0xd8fa, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf6c5, -0x0000,0x0000,0xd1cc,0xddfc,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdffd,0x0000, -0xf9e5,0x0000,0xe0ca,0x0000,0x0000,0xf2fd,0xd3b0,0x0000, -0xf4f3,0xdac9,0x0000,0xe6de,0x0000,0x0000,0x0000,0x0000, -0xf8ba,0xe8d0,0x0000,0x0000,0xd8fb,0x0000,0x0000,0xead5, -0x0000,0x0000,0x0000,0x0000,0xd6a3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf6c6,0x0000,0x0000,0x0000,0x0000, -/* 0x7e00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf2db,0xe4fc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe8b2,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdada,0x0000,0xf2dc,0xfbd6,0xe9b2, -0x0000,0xeead,0x0000,0xfae3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdcee,0x0000,0x0000,0xf5ea,0xe6e0, -0x0000,0xf0fd,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7ac, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5c5,0xeee0,0x0000, -0x0000,0xdbe5,0x0000,0xddde,0x0000,0x0000,0xd9f0,0xe9a3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1f9,0x0000,0xf2c4,0xe0cb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9a4,0x0000, -0x0000,0xe2b9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe3b1,0xfceb,0xcda8,0x0000,0xccb6,0x0000,0x0000, -0xf0db,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe6ba,0x0000,0x0000,0xcda9,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf3c3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe1d9,0x0000,0x0000,0xefab, -0x0000,0x0000,0x0000,0xe7c5,0x0000,0x0000,0xe0e9,0x0000, -0xf3c5,0x0000,0x0000,0xd4c0,0xd5bf,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x7f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xddae,0x0000, -0xf9fc,0x0000,0xccc0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe5a2,0x0000,0x0000,0x0000, -0xceb8,0x0000,0x0000,0x0000,0xd8d2,0xf9d6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1aa,0xced1,0x0000,0x0000,0xf6c7,0x0000, -0xdbeb,0x0000,0xdffe,0x0000,0x0000,0xd8e1,0x0000,0xf7f3, -0x0000,0xd7e7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd4fe,0x0000,0x0000, -0xd1bc,0x0000,0xe5cf,0x0000,0xcbb6,0x0000,0xdab8,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcdc4,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd6be,0x0000,0x0000,0x0000,0xe2ba,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcfd8,0x0000,0x0000,0x0000, -0xe0cc,0xebf9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfdfd,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd7e8,0xcbd8,0x0000,0x0000,0x0000,0xe9e2,0x0000,0x0000, -0x0000,0xe8ba,0x0000,0x0000,0x0000,0xe3c7,0x0000,0x0000, -0x0000,0x0000,0xeccd,0x0000,0xecce,0x0000,0xd6bf,0x0000, -0x0000,0x0000,0xe3a7,0x0000,0xdfd6,0xfde8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeee1, -0xf6a8,0xddfd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8bb,0x0000,0xe8d1,0x0000,0x0000,0x0000,0x0000, -0xf9d7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xceee,0x0000,0x0000,0xeccf,0x0000,0x0000,0x0000, -0xe9a5,0xd6d5,0x0000,0xcdc5,0x0000,0xedba,0xd1bd,0x0000, -0x0000,0xcfbe,0x0000,0x0000,0xecbb,0x0000,0x0000,0x0000, -0xd2b1,0x0000,0x0000,0x0000,0x0000,0xcce9,0x0000,0xd9c4, -0xe9fc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd1be,0x0000,0x0000, -0x0000,0x0000,0x0000,0xecbc,0x0000,0x0000,0xe5ad,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf7b0,0x0000,0xccea, -0x0000,0x0000,0x0000,0xd3c4,0x0000,0x0000,0xd6c0,0x0000, -0x0000,0x0000,0xd6fd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1a1,0x0000, -0xdebd,0x0000,0xf6a9,0x0000,0x0000,0x0000,0xdaa4,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6a4, -0xf5c6,0x0000,0xe1a2,0xe9c6,0x0000,0x0000,0x0000,0xf2c5, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4e9,0xd6ec,0xebd3, -0x0000,0x0000,0x0000,0x0000,0xecbd,0xe2dc,0xdeeb,0xf0dc, -0x0000,0xebbf,0x0000,0xd7ce,0xd1bf,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf5ab,0x0000, -0x0000,0x0000,0x0000,0xf9fd,0x0000,0xcadc,0x0000,0x0000, -0x0000,0xcdc6,0xf2b6,0x0000,0x0000,0xddfe,0x0000,0x0000, -0x0000,0xccb7,0xdbb8,0x0000,0x0000,0x0000,0x0000,0xd0e9, -0x0000,0xcedd,0xebc0,0x0000,0xfda2,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8cb,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xead6,0xf1b0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdbce,0x0000,0xf7c3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdbcf,0xcba4,0x0000,0x0000,0xf8e0,0x0000, -0x0000,0xfbd7,0x0000,0x0000,0xebca,0xe0a1,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcecd,0x0000,0x0000,0xd4dc,0x0000,0x0000,0x0000, -0xfdd8,0x0000,0x0000,0x0000,0x0000,0xd2f6,0x0000,0x0000, -/* 0x8100 */ -0x0000,0x0000,0xf2b7,0x0000,0x0000,0xfaf6,0xf6aa,0xfaf7, -0xd8e6,0x0000,0xf4b1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe8d2,0x0000,0xcac5,0xcceb,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe2ee,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe2bb,0x0000,0xf7ad,0x0000,0x0000,0x0000,0xf8e1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf3ec,0x0000,0x0000,0x0000,0x0000,0xdea1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe4fd,0x0000,0x0000,0xe3ec,0x0000, -0xddaf,0xddb0,0x0000,0x0000,0xcbb7,0xe8d3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe1a3,0xd2e0,0x0000, -0x0000,0x0000,0x0000,0xf0fe,0x0000,0x0000,0x0000,0x0000, -0xe9a6,0xcbf2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xedf3,0xdcd9,0xe0cd,0x0000,0x0000,0x0000,0x0000,0xf7da, -0xdbb9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xccae,0x0000,0xdadb,0x0000,0x0000,0x0000,0x0000,0xcdc7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xddb1,0x0000,0xd8af,0xe3a3,0x0000,0x0000, -0xceef,0x0000,0x0000,0xf2f3,0x0000,0x0000,0x0000,0x0000, -0xf8b3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe0ce,0x0000,0xf5fd,0x0000,0x0000, -0x0000,0x0000,0xebec,0x0000,0x0000,0xd3c5,0xfcec,0xd2db, -0xd4eb,0x0000,0xdea2,0x0000,0x0000,0x0000,0xe5e6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf0b0,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd5c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xedf4, -0x0000,0x0000,0x0000,0xe3ed,0x0000,0xe8c2,0x0000,0xedf5, -0xd7fc,0x0000,0xedbb,0x0000,0x0000,0xf6ab,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf2b8,0xf6c8,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd3e6,0xf2dd,0xcfbf,0x0000,0xebac,0x0000, -/* 0x8200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xcfc0,0x0000,0xe6a8, -0xfde9,0x0000,0xcfc1,0x0000,0xe0df,0xdeec,0x0000,0x0000, -0x0000,0x0000,0xe0a2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf4bf,0xe2ef,0x0000,0xd9f1,0xf1c7, -0x0000,0xcbb8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf9fe,0xdbba,0xdaf5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf6ec,0xdadc,0xfae4, -0x0000,0xe0cf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xddb2,0x0000,0x0000,0x0000,0x0000,0xe6a9,0x0000,0xeff3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf3ed,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xebfa,0x0000,0xf9e6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcadd,0xd5de, -0x0000,0xcade,0xdfe4,0x0000,0x0000,0x0000,0xe6fd,0x0000, -0xf5ac,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4f5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe9e3,0x0000,0xedcb,0xcfe4,0x0000, -0x0000,0x0000,0xd8d3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xddb3,0xd4ec,0x0000,0x0000,0xf2b9,0x0000,0xdfb7, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcbce,0xfbd8,0x0000, -0x0000,0xd0d9,0x0000,0x0000,0xddd2,0xf7f4,0xe7dc,0xe4a5, -0x0000,0xfca3,0x0000,0xdbbb,0x0000,0x0000,0x0000,0xf2ba, -0xe9fd,0xd0ca,0x0000,0xf5d6,0xd9c5,0xe4b4,0x0000,0xeda7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeabd,0xe6fe,0x0000,0xf7c4,0xf5ad,0x0000,0xd9e0, -0x0000,0x0000,0x0000,0xcab4,0x0000,0x0000,0xf8e2,0xcfc2, -0x0000,0xecbe,0x0000,0x0000,0x0000,0xe5b4,0xcdc8,0xeec8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe7c8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcdc9,0xf9b7,0x0000, -/* 0x8300 */ -0x0000,0xf1e8,0xd9f2,0xdbf5,0xcab5,0xd9c6,0x0000,0x0000, -0x0000,0xd8c9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9ab, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xedbc,0x0000,0x0000,0xd8d4,0x0000,0x0000,0x0000,0xdcda, -0x0000,0xe2bc,0x0000,0x0000,0xfced,0xece0,0xd2fe,0x0000, -0xe9c7,0xe6aa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe2f0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfabb, -0x0000,0xf5ae,0xfbaa,0x0000,0x0000,0x0000,0x0000,0xecfb, -0x0000,0xecbf,0xfcd8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd4e5,0x0000,0x0000,0x0000,0xf9c3, -0x0000,0x0000,0x0000,0xeee2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd7e9,0xedf6,0x0000,0x0000,0x0000,0xdeed,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xccec,0x0000, -0xe3ee,0x0000,0x0000,0x0000,0x0000,0x0000,0xe8d4,0x0000, -0x0000,0x0000,0xfaf8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xddb4,0xe4b5,0xd8b0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd8d5,0x0000,0x0000, -0x0000,0xf4ea,0x0000,0x0000,0x0000,0xceb9,0x0000,0x0000, -0x0000,0xd6e1,0xcfd2,0x0000,0xd0b6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcea2,0x0000,0x0000,0xf3ee,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf3f8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdccc,0x0000,0xd0cb,0x0000,0x0000,0x0000,0xfca4, -0xcdca,0xd7d4,0xdea3,0x0000,0xe4e0,0x0000,0x0000,0x0000, -0x0000,0xeec9,0x0000,0x0000,0x0000,0xe2dd,0x0000,0x0000, -/* 0x8400 */ -0x0000,0x0000,0x0000,0xf5fe,0xd4ac,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5d1,0x0000,0xd8f0,0xf8c3,0xead7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf5d7,0x0000,0x0000,0xd8bf,0x0000,0x0000,0x0000, -0x0000,0xfdc0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xebad,0x0000,0x0000,0x0000,0x0000,0xd5aa,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe7a8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeeca, -0x0000,0x0000,0x0000,0xcae7,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8e3,0x0000,0xd4dd,0x0000,0x0000,0xead8,0x0000, -0x0000,0x0000,0x0000,0xfbd9,0xedf7,0x0000,0x0000,0xe5b5, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd0ad,0x0000,0x0000, -0x0000,0x0000,0xf1f1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe2bd,0x0000,0x0000,0x0000,0xe3c8,0x0000,0x0000,0x0000, -0x0000,0xd9d5,0x0000,0x0000,0xdfaa,0x0000,0x0000,0x0000, -0x0000,0xdbbc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8e4,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf1fa,0x0000,0x0000,0xe5b6,0xf3ef,0x0000,0x0000,0xfbda, -0xe1e0,0x0000,0xd9ac,0x0000,0xf5eb,0x0000,0xe0b6,0x0000, -0x0000,0xe9c8,0x0000,0xcbcf,0x0000,0xe3c9,0x0000,0x0000, -0x0000,0xdeee,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe2be,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdcef,0x0000,0xd6a5,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe2f1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd6fe,0x0000,0x0000,0x0000, -/* 0x8500 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd9a1,0x0000,0xd8c0,0xdcdb,0x0000,0x0000,0xedbd, -0xdfb8,0x0000,0xeaa5,0x0000,0x0000,0x0000,0xd7ad,0x0000, -0x0000,0xf3f9,0x0000,0xedf8,0x0000,0xf5c7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe1ca,0xebe3,0x0000,0xf2de, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf8cc,0x0000,0xead9, -0x0000,0xd3c6,0x0000,0xdbe6,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf5af,0x0000,0x0000,0x0000,0x0000,0xcef0,0x0000, -0x0000,0x0000,0x0000,0xe9fe,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfbb6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe2f2,0x0000,0x0000,0x0000,0x0000, -0xcff2,0xf7b9,0xd9f3,0x0000,0x0000,0xe1cb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdadd,0x0000,0x0000,0xdab9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xebfb, -0x0000,0xcbb9,0x0000,0x0000,0xedf9,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe0e0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4c0,0x0000, -0xfdbc,0xdfb1,0xe3ef,0x0000,0x0000,0x0000,0x0000,0xe0a3, -0xfdb9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf0b1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcdcb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xedbe,0x0000,0x0000,0x0000,0xd5c0,0xe3f0,0xedfa, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe9e4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd5ed,0xe7dd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4f6,0xe5b7,0x0000,0x0000, -0x0000,0xdbe7,0xe2bf,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeecb, -0x0000,0x0000,0xd7f4,0xf0dd,0x0000,0x0000,0x0000,0xceab, -/* 0x8600 */ -0x0000,0x0000,0xe7de,0x0000,0x0000,0x0000,0xd6d6,0xe1cc, -0x0000,0x0000,0xe8b3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5ee,0xdca2, -0x0000,0x0000,0xe0d0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd5b5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5a1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfbdb,0x0000, -0xf9cb,0x0000,0x0000,0x0000,0xcbf3,0xf4a5,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfac8,0xd6d7,0x0000,0xe9e5,0xfbdc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfdd0, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfbf6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdaa5,0x0000,0xdbbd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xece2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcdf7,0xf0de,0x0000,0x0000,0x0000, -0x0000,0xf6c9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdeef, -0x0000,0x0000,0x0000,0xd3b1,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfcee,0x0000,0x0000,0x0000, -0x0000,0xe8c3,0x0000,0xf1c8,0x0000,0x0000,0x0000,0xcef1, -0x0000,0x0000,0x0000,0x0000,0xf9ed,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf2f4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4b6,0x0000, -0xf5b9,0x0000,0xdcf0,0xe3f1,0x0000,0x0000,0x0000,0x0000, -0xe8a5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf2bb,0x0000,0xdea4,0x0000,0xdacc,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcae9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe3da,0x0000,0xfcd9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeada, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf9c4,0x0000, -0xe3a4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfbdd,0x0000,0xefca,0x0000, -0xe8c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5cc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xebd7,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9ad, -0x0000,0x0000,0xfbab,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd3d9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd5a2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6de,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdaf6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe0d1,0x0000,0x0000,0xe9a8, -0x0000,0x0000,0xf5f9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfaaf,0x0000,0xebfc,0x0000,0x0000,0xe0ea,0x0000, -/* 0x8800 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0xe3b2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5c5, -0x0000,0x0000,0xf1e3,0xd5ee,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcdcc,0x0000,0x0000,0x0000,0x0000,0xedd9,0x0000, -0x0000,0x0000,0x0000,0xd8c1,0x0000,0x0000,0x0000,0x0000, -0xfaec,0x0000,0x0000,0x0000,0x0000,0x0000,0xf1eb,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfabc,0xe6e2,0x0000,0x0000, -0x0000,0x0000,0xfae5,0xe2fa,0x0000,0x0000,0x0000,0xcab6, -0x0000,0xe4b7,0x0000,0xeadb,0x0000,0xf5fa,0x0000,0x0000, -0x0000,0xfbac,0xcfc3,0xebfd,0x0000,0x0000,0x0000,0x0000, -0xf8fa,0x0000,0x0000,0xdfb9,0x0000,0x0000,0x0000,0x0000, -0xe1f1,0x0000,0xd2a4,0x0000,0x0000,0x0000,0x0000,0xf5fb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0da,0xd0db, -0x0000,0xeabe,0xd9b1,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcab7,0x0000,0x0000,0xd3e7,0x0000,0xf8e5,0x0000,0x0000, -0x0000,0x0000,0xd3b2,0x0000,0x0000,0x0000,0xe2c0,0xf2df, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcde5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9ac,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcdcd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeeae,0xd6ae,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7ea, -0x0000,0x0000,0x0000,0x0000,0xe7e0,0xebae,0x0000,0x0000, -0x0000,0xcfd9,0x0000,0x0000,0xdccd,0xedfb,0x0000,0xdef0, -0x0000,0xd7eb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdea5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdfd7,0xdbd0,0xdbd1,0x0000,0x0000, -0xd5a3,0x0000,0x0000,0x0000,0x0000,0xf0b2,0x0000,0x0000, -/* 0x8900 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdcdc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcae8,0x0000,0xf8e6,0xdcce,0x0000,0x0000,0x0000,0x0000, -0xeadc,0xdbd2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe9b3,0x0000,0x0000, -0x0000,0x0000,0xf7db,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe3a8,0x0000, -0xd7ae,0x0000,0x0000,0xe0e1,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcbba,0x0000,0x0000,0xe5d1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0dc, -0x0000,0x0000,0x0000,0x0000,0xd5c1,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd8ca,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe3a9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe0a4, -0x0000,0xe9a9,0x0000,0xd3c7,0x0000,0x0000,0xdcdd,0xf8ae, -0x0000,0x0000,0x0000,0xccb8,0x0000,0x0000,0x0000,0xd0ae, -0x0000,0x0000,0x0000,0xd8f2,0x0000,0x0000,0xe3ca,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xccaf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd4ad,0xf6d1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd0cc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcac6,0x0000,0x0000,0xd5c2,0x0000,0x0000, -0xceba,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcac7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfab0,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdfd8,0x0000,0x0000,0x0000, -0xf5ba,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe5eb,0x0000,0xeff4,0xddb5,0x0000,0x0000,0x0000,0x0000, -0xcdaa,0x0000,0xe3f2,0x0000,0xfbf7,0x0000,0xf7d0,0x0000, -0x0000,0x0000,0x0000,0xfdba,0x0000,0x0000,0xfde1,0xf6fe, -0xd1c0,0x0000,0x0000,0xe8c5,0x0000,0xe4b8,0x0000,0xe1e8, -0x0000,0x0000,0x0000,0xccc1,0x0000,0xd2ed,0x0000,0x0000, -0x0000,0x0000,0xdbbe,0x0000,0x0000,0xe0e2,0x0000,0x0000, -0x0000,0xfac9,0x0000,0x0000,0xe1cd,0x0000,0xcab8,0x0000, -0x0000,0x0000,0xf2e0,0xf1c9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdef1,0x0000,0x0000,0x0000,0xf0df,0xf8c4,0x0000,0x0000, -0x0000,0x0000,0x0000,0xeecc,0x0000,0x0000,0xdef2,0x0000, -0xe7c9,0x0000,0xe2f3,0xe7e1,0x0000,0x0000,0xe3cb,0x0000, -0x0000,0xe3cc,0x0000,0x0000,0x0000,0xcff8,0xefac,0x0000, -0xfdfe,0xfca5,0xfab1,0xdfd9,0x0000,0xe0d2,0x0000,0x0000, -0x0000,0xf4da,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf1ca,0x0000,0xcea3, -0x0000,0x0000,0x0000,0x0000,0xf2bc,0xece3,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe0a5,0x0000,0xf7ab,0x0000,0x0000, -0xebaf,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5de,0x0000, -0xe1a4,0xcdab,0x0000,0xd9f4,0xe8a6,0xcdce,0xe1e9,0x0000, -0xfcef,0x0000,0xe0e3,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe2c1,0x0000,0xcea4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdea6,0x0000,0x0000,0xebfe,0x0000,0xebdd,0xf0e0, -0x0000,0x0000,0xf4db,0x0000,0xe2f4,0x0000,0x0000,0xd3c8, -0x0000,0x0000,0x0000,0xf4eb,0x0000,0xeeb5,0x0000,0xf5d8, -0x0000,0x0000,0xd5df,0x0000,0x0000,0x0000,0xd6e5,0x0000, -0x0000,0x0000,0x0000,0xebb0,0xf4e3,0x0000,0x0000,0x0000, -0x0000,0xe3cd,0x0000,0x0000,0x0000,0x0000,0xf4f4,0xfab2, -0x0000,0x0000,0xeff5,0xcadf,0x0000,0xebb1,0xedbf,0x0000, -0x0000,0xfdc9,0x0000,0x0000,0x0000,0x0000,0xe4a6,0xf9a4, -0xf0b3,0x0000,0xe5ec,0x0000,0x0000,0x0000,0xd1e7,0x0000, -0xd9c7,0xe4d7,0xeadd,0x0000,0xd4f7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdaba,0x0000, -0xdacd,0x0000,0x0000,0x0000,0xf9cc,0x0000,0xe1da,0xdbbf, -0x0000,0xccc5,0xecd0,0xcbbb,0x0000,0xdef3,0x0000,0x0000, -0xe9aa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd9c8,0x0000,0x0000,0xeee3,0xd7bd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcfc4,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd0cd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfca6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf1fb,0x0000,0x0000,0x0000,0x0000,0xfdd2,0xd1c1, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe3db,0x0000,0xd3c9,0x0000,0xdccf,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcced,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdea7,0x0000,0x0000,0xe6bb, -0xeca1,0x0000,0x0000,0x0000,0xccb9,0x0000,0x0000,0xfbde, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe7e2,0x0000,0x0000, -0xd4c1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdca8,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe2c2,0x0000,0xf3d8,0xe5d3,0x0000,0x0000,0xf3d9,0x0000, -0x0000,0x0000,0xf3c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x8c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcddb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcdac, -0x0000,0xfcc3,0x0000,0x0000,0x0000,0x0000,0xd4e7,0x0000, -0xd1c2,0x0000,0xf9a5,0x0000,0xe8d5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe3ce,0x0000,0x0000, -0x0000,0x0000,0xd4ca,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdfda,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfbdf,0xe7e3,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8fb,0xe3cf,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf5b0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd8e7,0x0000,0xd9c9,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf8af,0xeff6,0x0000, -0xddb6,0xeeaf,0xcdf8,0x0000,0x0000,0x0000,0x0000,0xdeb8, -0xfca7,0xf7fc,0xf7b1,0xcebb,0xf4a1,0x0000,0x0000,0xeecd, -0xe1ae,0x0000,0x0000,0xecc3,0xcffe,0x0000,0xf8bf,0xd8e2, -0xd3e8,0x0000,0x0000,0xdea8,0xf4e4,0xecc2,0x0000,0xd9f5, -0xf9c5,0xddd3,0xd6f1,0xecfc,0xfcf0,0x0000,0x0000,0xedc0, -0xcab9,0x0000,0xeee4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf2e1,0x0000,0xdeb9,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd6f2,0x0000,0xdef4,0x0000,0xdfdb,0x0000, -0xdbd3,0x0000,0xfae7,0xd8e3,0xf4c1,0x0000,0xddb7,0x0000, -0x0000,0x0000,0xf2f5,0x0000,0x0000,0xd4ae,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd6f3,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xddb8,0xcfc5,0xdfdf,0x0000,0x0000, -/* 0x8d00 */ -0x0000,0x0000,0x0000,0x0000,0xf2be,0xf6a1,0x0000,0xebcb, -0xf1fc,0x0000,0xf3c7,0x0000,0x0000,0xe0eb,0x0000,0x0000, -0x0000,0x0000,0x0000,0xedfc,0x0000,0x0000,0xe1db,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeee5,0x0000,0xdef5,0x0000, -0x0000,0x0000,0x0000,0xfad3,0x0000,0x0000,0x0000,0x0000, -0xf1cb,0x0000,0x0000,0xd0af,0xddb9,0x0000,0x0000,0xd1c3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5b1,0x0000,0x0000, -0x0000,0x0000,0xeac6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf0e1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf6ac,0x0000,0x0000,0x0000,0x0000, -0xf5d9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf0eb,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xddba,0x0000,0x0000,0x0000,0xf2bf,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf7c5,0x0000, -0x0000,0x0000,0x0000,0xdba2,0xf2f6,0x0000,0x0000,0xcaba, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf7f5,0x0000,0xcbe5,0x0000,0x0000, -0x0000,0xeee6,0x0000,0xe0d3,0x0000,0x0000,0x0000,0x0000, -0xcea5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6d8, -0x0000,0x0000,0x0000,0xd4af,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x8e00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9c9,0x0000,0x0000,0x0000,0x0000,0xd3ce, -0xf4c2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbe6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf1a1,0x0000,0x0000,0x0000,0x0000,0x0000, -0xebb2,0x0000,0x0000,0x0000,0x0000,0xf1a2,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xebb3,0x0000,0xf0b4,0x0000,0x0000,0xcbf4, -0xd4b0,0xf3b2,0xfbb7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf5ec,0x0000,0x0000,0x0000,0x0000,0x0000,0xeee7, -0xf4b2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf5ed,0x0000,0xcff3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf0e2,0x0000,0x0000,0x0000,0x0000,0x0000,0xeece, -0x0000,0x0000,0xf1cc,0x0000,0x0000,0xe5b8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd7f5,0xe3f3,0xcfe5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcfc6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf3b3,0xe4d8,0xcff9,0xcfda,0x0000,0x0000, -0x0000,0x0000,0xfacd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe6e3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf2e2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf5ee,0x0000,0x0000,0xcabb,0x0000,0x0000,0xe3dc,0x0000, -/* 0x8f00 */ -0x0000,0x0000,0x0000,0xcef2,0x0000,0xd6d9,0x0000,0x0000, -0x0000,0xeeb0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf4e5,0xd8c2,0xdcd0,0xccee,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5e0,0xf6ca,0xfdca,0xd8d6,0xf4cf, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6a6,0xdcbe, -0x0000,0xdbd4,0xd7c7,0x0000,0x0000,0x0000,0x0000,0xf2fe, -0x0000,0x0000,0x0000,0xf1cd,0x0000,0x0000,0x0000,0x0000, -0xe2c3,0xdcde,0x0000,0xdcdf,0x0000,0x0000,0xefad,0xe6ab, -0x0000,0x0000,0x0000,0x0000,0xf9dd,0xeabf,0x0000,0x0000, -0x0000,0xefae,0x0000,0x0000,0x0000,0xf4d0,0xcef3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe6ac,0x0000,0xcede, -0x0000,0x0000,0xd5f9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe3f4,0xcdd0,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd5b8,0x0000,0x0000,0xf7fd,0x0000, -0xdca9,0x0000,0x0000,0x0000,0x0000,0xdef6,0x0000,0xdcaa, -0xf2e3,0xe9b4,0xd2dc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe9e6,0x0000,0x0000,0xe3f6,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe7ca,0x0000, -0x0000,0xd0ce,0x0000,0x0000,0xdaf7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcabc,0x0000, -0x0000,0x0000,0xeee8,0xdade,0x0000,0xf2f7,0x0000,0x0000, -0xe2fb,0x0000,0xcca6,0x0000,0x0000,0x0000,0x0000,0xdabb, -0x0000,0xeee9,0x0000,0x0000,0x0000,0xf5da,0x0000,0x0000, -0xf7dc,0xe1ea,0xcec1,0xd4b1,0x0000,0xfdb1,0xe6bd,0x0000, -0xfbad,0x0000,0x0000,0xf8e7,0x0000,0xe1ce,0x0000,0xf7e2, -0xf5ef,0xcfc7,0x0000,0x0000,0xd4b2,0xccef,0x0000,0xd4e8, -0x0000,0xeecf,0xf7d7,0x0000,0x0000,0xe0a6,0xd6c1,0xe1dc, -0xf0e3,0xf1e4,0xdcf1,0xd6a7,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4f5,0x0000, -0x0000,0xf1ce,0xf2e4,0x0000,0x0000,0xd0b0,0x0000,0x0000, -0xecef,0x0000,0x0000,0x0000,0xf9ba,0x0000,0xebb5,0x0000, -0x0000,0xd4ed,0xe2c4,0x0000,0x0000,0x0000,0x0000,0xe9e7, -0x0000,0x0000,0xebb4,0xeaa1,0x0000,0xf8bc,0xcea6,0x0000, -0xf9c6,0xfcda,0x0000,0xd4b3,0xd3b9,0xeade,0x0000,0x0000, -0x0000,0xe9ab,0x0000,0x0000,0xe1e1,0xd3cf,0xf4f6,0x0000, -0xeac0,0xe1cf,0x0000,0xccba,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeeea,0x0000,0x0000,0x0000,0xf0e4,0xf3b4,0xd4ee, -0x0000,0x0000,0xf2c0,0x0000,0x0000,0xf1e5,0x0000,0xf4c3, -0xe0d4,0x0000,0xebb6,0x0000,0xd7a1,0xcbe8,0x0000,0xf9ad, -0xe9ad,0xd8e4,0xfab3,0xe2c5,0xfcbd,0x0000,0x0000,0xecc4, -0xd8b1,0x0000,0xdcab,0x0000,0x0000,0x0000,0x0000,0xd5a4, -0x0000,0xebe9,0x0000,0x0000,0x0000,0xe8bb,0x0000,0x0000, -0x0000,0xd8d7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xfbae,0xd1e1,0x0000,0x0000,0xdbc0,0x0000, -0xf5be,0x0000,0xdef7,0x0000,0x0000,0x0000,0x0000,0xcafb, -0xf7c6,0xcfc8,0x0000,0x0000,0x0000,0xe1d0,0x0000,0x0000, -0xeed0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe9f4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xcef4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd5cd,0x0000, -0x0000,0xcfdb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xddbb,0x0000,0x0000,0x0000,0x0000,0xceac,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe9e8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd4b4,0x0000,0x0000, -/* 0x9100 */ -0x0000,0x0000,0xe4c7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf5db,0x0000,0x0000,0xfac1,0x0000,0x0000, -0x0000,0xdea9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd4f8, -0x0000,0x0000,0x0000,0x0000,0x0000,0xeff7,0x0000,0x0000, -0x0000,0x0000,0xd3b3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xebb7,0xeff8,0xf5dc,0xedcc,0xdbd5,0xf1cf,0x0000, -0x0000,0x0000,0xf1d0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf5b2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd9ae,0xd5ac,0x0000,0xe2c6,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfda3,0x0000,0xfbe5, -0xdfab,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2f5, -0x0000,0xf6ad,0x0000,0xf5b3,0x0000,0xf0b5,0x0000,0x0000, -0x0000,0x0000,0xe1a5,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf5dd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xeca2,0xedfd,0x0000,0xf5b4,0xfbb8, -0x0000,0xdba3,0x0000,0x0000,0xd6ca,0xcbd9,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe5d4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf3fa, -0x0000,0xebb8,0x0000,0xe0b7,0xd7ec,0xf1ec,0xe5af,0xd5e1, -0xd7ed,0xd1d1,0x0000,0x0000,0x0000,0x0000,0x0000,0xe1f2, -0xeff9,0x0000,0x0000,0x0000,0xddbc,0xf6dc,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf0e5,0x0000,0x0000,0x0000,0xf4c4, -0x0000,0x0000,0xe9e9,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf3fb,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9200 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd4ef,0x0000,0x0000, -0xcca2,0xf7fe,0xdfbc,0x0000,0x0000,0x0000,0x0000,0xebcd, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd0b7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd6c2,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe8ad,0x0000,0x0000,0x0000,0x0000,0xefaf, -0xcba5,0x0000,0x0000,0x0000,0x0000,0xcbe9,0x0000,0x0000, -0x0000,0xfae8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xccc6, -0x0000,0x0000,0x0000,0xe6e7,0x0000,0x0000,0xeac7,0x0000, -0x0000,0x0000,0xdba4,0x0000,0xcfc9,0xe2fc,0xeffa,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xebde,0x0000,0x0000,0xf5c8,0x0000,0xd4de,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe0d5,0x0000,0xefb0,0x0000,0x0000,0xe2c7,0x0000, -0xd9af,0x0000,0x0000,0x0000,0xf9e7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe7e5,0x0000,0x0000,0xcfca,0xe1d1, -0x0000,0xe2c8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xeffb,0x0000,0x0000,0xfaf9, -0x0000,0x0000,0xdcf2,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe0a7,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8e8,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcbea,0x0000,0x0000,0x0000,0xcbbc,0x0000,0x0000,0x0000, -/* 0x9300 */ -0x0000,0x0000,0x0000,0x0000,0xd6e2,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf5de,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf5df,0x0000,0xeeb6,0x0000,0x0000,0x0000,0xe2f6,0xd3ca, -0xeffc,0xd1c4,0xefb1,0x0000,0xd1c5,0x0000,0xd0de,0x0000, -0xd9e1,0x0000,0x0000,0xe0b8,0x0000,0x0000,0xcdd1,0xf3b9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe7cc,0x0000,0xd6a8,0xcea7,0x0000,0xd4b5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe4c8,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd3b4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xebb9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcbf5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf6dd,0x0000,0xf1a3,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xccc7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe9ca,0x0000,0xe1f0,0x0000, -0x0000,0x0000,0xf5e0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbaf,0x0000,0x0000,0x0000,0xcbd1, -0x0000,0x0000,0x0000,0x0000,0xfbe0,0xf2e5,0x0000,0x0000, -0xecf0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf0ec,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeeeb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe9cb,0x0000, -0x0000,0xccf0,0x0000,0x0000,0xd7af,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf3a1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9400 */ -0x0000,0x0000,0x0000,0x0000,0xfcf5,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf1a4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe0d6,0x0000,0x0000, -0x0000,0x0000,0x0000,0xefb2,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf4d1,0x0000,0x0000, -0xf7a1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf1d1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xcafc,0xcafd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcece,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf3c8,0x0000,0xf3ba, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9500 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xedfe, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdaa6,0x0000,0x0000,0xe0ec,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8cd,0x0000,0xcbd2,0x0000,0x0000,0x0000,0xebce, -0x0000,0xf9d8,0xf9d9,0xcae0,0xdaca,0x0000,0x0000,0x0000, -0xcba6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcac8,0xf9ee,0xdbec,0x0000,0x0000, -0xd0b1,0x0000,0x0000,0x0000,0x0000,0xd5ef,0x0000,0x0000, -0x0000,0xe6f3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe7a2,0xe4d9,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4e1, -0x0000,0x0000,0xfcc4,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf9ef,0xcff4,0xf7e6,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcebc,0x0000,0x0000,0x0000, -0x0000,0xf4c5,0xdca3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9600 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xddbd,0x0000,0x0000,0x0000, -0x0000,0xf4c6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf8a1,0x0000,0x0000,0x0000,0xe8d6,0x0000, -0x0000,0x0000,0xdbc1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf0e6,0x0000,0x0000,0x0000,0xe4b9, -0xf6ed,0x0000,0xf9ae,0x0000,0xddbe,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd7b0,0xd8e8,0xcbbd,0x0000,0x0000, -0xf9da,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf8ce,0xf9f0,0xe0ed,0xe3b3,0xf4b3, -0x0000,0x0000,0xeac2,0xf2e6,0xf0b6,0x0000,0x0000,0x0000, -0x0000,0x0000,0xdbd6,0x0000,0x0000,0x0000,0x0000,0x0000, -0xebe4,0x0000,0x0000,0xf2e7,0x0000,0xd7d5,0xd4b6,0xf9e8, -0xd7c1,0x0000,0x0000,0x0000,0x0000,0xe5d5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe9ea,0xd7cc,0x0000, -0x0000,0x0000,0xd3e9,0xe2c9,0x0000,0xfcdb,0xcdad,0x0000, -0x0000,0x0000,0x0000,0x0000,0xccb0,0xeaa2,0x0000,0x0000, -0xe4f6,0xd0c0,0x0000,0xf0b7,0xeea1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd7f6,0x0000,0x0000,0x0000,0xe2ca, -0xe2cb,0x0000,0xfacf,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xebdf,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6cb, -0x0000,0x0000,0x0000,0xf4b4,0x0000,0x0000,0x0000,0x0000, -0xedcd,0xe4d2,0x0000,0x0000,0xeaa9,0xe4ba,0xf3a2,0xcdd2, -0x0000,0xf6cb,0x0000,0xf1e6,0xedc1,0xe8bc,0xeed1,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf0e7,0xe2cc,0x0000, -0x0000,0xe4aa,0x0000,0xf5e1,0xedda,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd7ee,0xd1f1,0x0000,0x0000,0x0000,0x0000, -0xe9eb,0xe9ec,0xe0e4,0x0000,0x0000,0x0000,0x0000,0xdaa7, -0xddd4,0x0000,0xeaa3,0x0000,0x0000,0x0000,0xd6c3,0xd6f4, -0x0000,0xdadf,0x0000,0xefb3,0x0000,0x0000,0x0000,0x0000, -0xe2cd,0x0000,0x0000,0x0000,0x0000,0x0000,0xeffd,0xf2e8, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xefc5,0x0000,0xe7e7,0x0000,0x0000,0xd7fd,0x0000, -0x0000,0xe7ce,0x0000,0x0000,0xdfdc,0x0000,0xf9c7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd9f6, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdfac,0x0000,0xd6da,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdca4,0x0000,0x0000,0x0000,0xf0b8,0x0000,0x0000, -0x0000,0x0000,0xd5fa,0x0000,0xe4f7,0x0000,0x0000,0x0000, -0xd6c4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf4ec,0x0000,0x0000,0x0000,0x0000,0xeffe,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf0a1,0x0000,0xdeaa,0x0000, -0x0000,0xdabc,0xd8fc,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfad4,0x0000,0x0000,0x0000,0xece5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xfca8,0x0000,0x0000,0xece6, -0x0000,0x0000,0xd8cb,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbb9,0x0000,0xe4d3,0x0000,0xcdf9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcfd3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcaea,0x0000,0x0000,0xcfd4,0x0000,0xf8bd,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4c7,0x0000, -0x0000,0x0000,0x0000,0xeadf,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xf9db,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd4b7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xebe5,0x0000,0x0000,0xe1d2,0x0000, -0x0000,0x0000,0x0000,0xeaa4,0x0000,0x0000,0x0000,0xfac2, -0xfbe1,0xfaed,0xf0a2,0xccf1,0x0000,0xfaa3,0xe2f7,0x0000, -0xe2ce,0x0000,0xe9f5,0x0000,0xe1eb,0x0000,0x0000,0x0000, -0xe7e8,0xe8d7,0xdaf8,0xd4cb,0x0000,0x0000,0x0000,0xf7f6, -0xd6c5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd4e9,0x0000,0x0000, -0xfafa,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xccf2,0xf7dd,0x0000,0xdeba,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcea8,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf0b9,0xe4fe,0xe4c9,0x0000, -0x0000,0x0000,0x0000,0x0000,0xe4d4,0x0000,0x0000,0x0000, -0xeac3,0x0000,0xefb4,0x0000,0x0000,0x0000,0xd7be,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfbe2,0x0000,0xcdd3, -0x0000,0x0000,0x0000,0xefb5,0x0000,0x0000,0x0000,0xfae9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf9a6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdfbd, -0x0000,0xf7c7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xf8fd,0x0000,0x0000,0xf8fc, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdeab,0xdbe8,0x0000,0x0000,0xe3dd, -0x0000,0xe1e2,0xd1c6,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf6d0,0xebe6,0xdaf9, -0x0000,0x0000,0x0000,0x0000,0xecc7,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdef8,0xf8e9,0xe3de,0x0000, -/* 0x9900 */ -0x0000,0x0000,0x0000,0xcef5,0x0000,0x0000,0x0000,0x0000, -0x0000,0xfac3,0xe5d7,0x0000,0xecc8,0x0000,0x0000,0x0000, -0xf3c9,0x0000,0x0000,0xe4bb,0x0000,0x0000,0x0000,0x0000, -0xe6ae,0x0000,0x0000,0x0000,0x0000,0x0000,0xefb6,0x0000, -0xdcbf,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcebd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd8c3,0x0000,0x0000, -0x0000,0xd0cf,0x0000,0xcffa,0xf3ca,0xe0d7,0x0000,0x0000, -0x0000,0xd1c7,0xe9ae,0x0000,0xe8bd,0x0000,0x0000,0xfac4, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe2cf,0x0000, -0x0000,0xfac5,0x0000,0x0000,0x0000,0xf9b8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdce0,0x0000,0x0000, -0xfbb0,0x0000,0x0000,0x0000,0xd8a9,0xe5df,0xf9a7,0x0000, -0x0000,0xf6ee,0x0000,0xf6cc,0xe2f8,0x0000,0x0000,0x0000, -0x0000,0xecf1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xdae0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xf1d2,0xd2cc,0xcfcb,0x0000,0x0000,0xcabd,0x0000,0x0000, -0x0000,0xddbf,0x0000,0x0000,0x0000,0xf6ef,0x0000,0xdef9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfab4,0x0000,0x0000, -0x0000,0xd5ad,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf1e7, -/* 0x9a00 */ -0x0000,0xdebe,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xdcc0,0x0000,0x0000,0x0000,0x0000,0x0000,0xd1c8,0xd1c9, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xf8be,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcbf6,0x0000,0x0000,0x0000,0x0000, -0xd4f9,0x0000,0x0000,0x0000,0x0000,0x0000,0xf5e2,0xe1d3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd8e9,0x0000,0x0000,0xf8fe,0x0000,0xcfcc,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfda4,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xcef6,0x0000,0xfad0, -0x0000,0x0000,0xccf3,0xe6be,0x0000,0x0000,0x0000,0xf6ae, -0x0000,0x0000,0xd5f0,0x0000,0x0000,0xd1ca,0x0000,0x0000, -0x0000,0xfcbe,0xd5f1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcde9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfab5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xe2d0,0xf4f7,0x0000,0x0000,0x0000, -0xcdd4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe7a3,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xdba5,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9b00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe2d1,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7a2, -0x0000,0x0000,0xf7e3,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xeaa6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xd0a1,0x0000,0x0000,0x0000, -0x0000,0xceda,0xfbeb,0xdba6,0xdbde,0xd8e5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeae0, -0x0000,0x0000,0x0000,0x0000,0xd8aa,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe5e0,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd6db, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xefc6,0x0000, -0x0000,0xf8ea,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4d5, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xcef7,0x0000,0x0000,0xe0d8,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd7ef,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xf4ed,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcde6,0x0000,0x0000,0x0000, -0xccf4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9c00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf5e3,0x0000,0x0000, -0xe4ca,0x0000,0xdce1,0x0000,0x0000,0xf9c8,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xfcbf,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe8a7,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd8c4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcbbe, -0x0000,0xdcae,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xd7f7, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xf0e8,0x0000,0xddc0, -0x0000,0xcfcd,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdcf3,0xd9b0,0x0000,0xe6e9,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9d00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xe4bc,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xeac4,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4ec,0x0000, -0xe4e5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xfbf8,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xccbb,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe4bd,0x0000,0x0000, -0xcddc,0xd9f7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdddf,0x0000,0x0000,0x0000, -0x0000,0x0000,0xedce,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0xd9d0,0x0000,0x0000,0x0000,0x0000,0x0000,0xe5a3, -0x0000,0x0000,0x0000,0x0000,0xf9cd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcdae,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xcfce, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf6af,0x0000,0x0000,0x0000,0x0000,0x0000, -0xfdd3,0xebed,0xd6dc,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9e00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xe5a4,0x0000,0x0000,0x0000,0xd5b6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd6dd,0x0000,0x0000, -0x0000,0xf9e9,0x0000,0x0000,0x0000,0xe7a4,0x0000,0xd6e3, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xd1cb,0xd6e4,0x0000,0x0000,0x0000,0xd5f2, -0x0000,0x0000,0x0000,0x0000,0x0000,0xdefa,0x0000,0xd7f8, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd8ea,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcfd5,0xd8fd,0x0000,0x0000, -0x0000,0x0000,0x0000,0xd8ab,0x0000,0x0000,0xfdcb,0x0000, -0x0000,0x0000,0x0000,0xfcdc,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xe0a8,0xd5f3,0x0000, -0x0000,0xfdd9,0x0000,0x0000,0xcca3,0x0000,0x0000,0x0000, -0xd9f9,0x0000,0x0000,0xd3ea,0xf5f5,0x0000,0xefc7,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xd3da,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xdabd,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -/* 0x9f00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe8a8, -0xdcaf,0x0000,0x0000,0x0000,0x0000,0x0000,0xf0a3,0x0000, -0x0000,0x0000,0x0000,0xcdd5,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xe0a9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0xdeac,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0xf0ba,0xeeb1,0x0000,0x0000,0xeeb2,0x0000, -0x0000,0x0000,0xf6cd,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xeed2, -0x0000,0xd6c6,0x0000,0x0000,0x0000,0x0000,0x0000,0xe0e5, -0x0000,0x0000,0xf3bb,0x0000,0xe5e1,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xe4cb, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0xd7a3,0x0000,0x0000, -0xdbc2,0x0000,0x0000,0x0000,0x0000,0xcafe,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0xcfcf}; - -static const int ucs_i_uhc_table_min = 0x4d00; -static const int ucs_i_uhc_table_max = 0x4d00 + (sizeof(ucs_i_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_s_uhc_table[] = { -/* 0xab00 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xb0a1,0xb0a2,0x8141,0x8142,0xb0a3,0x8143,0x8144,0xb0a4, -0xb0a5,0xb0a6,0xb0a7,0x8145,0x8146,0x8147,0x8148,0x8149, -0xb0a8,0xb0a9,0xb0aa,0xb0ab,0xb0ac,0xb0ad,0xb0ae,0xb0af, -0x814a,0xb0b0,0xb0b1,0xb0b2,0xb0b3,0xb0b4,0x814b,0x814c, -0xb0b5,0x814d,0x814e,0x814f,0xb0b6,0x8150,0x8151,0x8152, -0x8153,0x8154,0x8155,0x8156,0xb0b7,0xb0b8,0x8157,0xb0b9, -0xb0ba,0xb0bb,0x8158,0x8159,0x815a,0x8161,0x8162,0x8163, -0xb0bc,0xb0bd,0x8164,0x8165,0xb0be,0x8166,0x8167,0x8168, -0xb0bf,0x8169,0x816a,0x816b,0x816c,0x816d,0x816e,0x816f, -0x8170,0x8171,0x8172,0xb0c0,0x8173,0xb0c1,0x8174,0x8175, -0x8176,0x8177,0x8178,0x8179,0xb0c2,0x817a,0x8181,0x8182, -0xb0c3,0x8183,0x8184,0x8185,0xb0c4,0x8186,0x8187,0x8188, -0x8189,0x818a,0x818b,0x818c,0x818d,0x818e,0x818f,0x8190, -0x8191,0x8192,0x8193,0x8194,0x8195,0x8196,0x8197,0x8198, -0xb0c5,0xb0c6,0x8199,0x819a,0xb0c7,0x819b,0x819c,0xb0c8, -0xb0c9,0x819d,0xb0ca,0x819e,0x819f,0x81a0,0x81a1,0x81a2, -0xb0cb,0xb0cc,0x81a3,0xb0cd,0xb0ce,0xb0cf,0xb0d0,0x81a4, -0x81a5,0xb0d1,0xb0d2,0xb0d3,0xb0d4,0x81a6,0x81a7,0x81a8, -0xb0d5,0x81a9,0x81aa,0x81ab,0xb0d6,0x81ac,0x81ad,0x81ae, -0x81af,0x81b0,0x81b1,0x81b2,0xb0d7,0xb0d8,0x81b3,0xb0d9, -0xb0da,0xb0db,0x81b4,0x81b5,0x81b6,0x81b7,0x81b8,0x81b9, -0xb0dc,0xb0dd,0xb0de,0x81ba,0xb0df,0x81bb,0x81bc,0xb0e0, -0xb0e1,0x81bd,0x81be,0x81bf,0x81c0,0x81c1,0x81c2,0x81c3, -0xb0e2,0xb0e3,0x81c4,0xb0e4,0xb0e5,0xb0e6,0x81c5,0x81c6, -0x81c7,0xb0e7,0x81c8,0x81c9,0xb0e8,0x81ca,0x81cb,0x81cc, -0xb0e9,0x81cd,0x81ce,0x81cf,0xb0ea,0x81d0,0x81d1,0x81d2, -0x81d3,0x81d4,0x81d5,0x81d6,0x81d7,0xb0eb,0x81d8,0xb0ec, -0x81d9,0x81da,0x81db,0x81dc,0x81dd,0x81de,0x81df,0x81e0, -0xb0ed,0xb0ee,0x81e1,0x81e2,0xb0ef,0x81e3,0x81e4,0xb0f0, -0xb0f1,0x81e5,0xb0f2,0x81e6,0xb0f3,0x81e7,0x81e8,0xb0f4, -0xb0f5,0xb0f6,0x81e9,0xb0f7,0x81ea,0xb0f8,0xb0f9,0x81eb, -0x81ec,0x81ed,0x81ee,0x81ef,0xb0fa,0xb0fb,0x81f0,0x81f1, -/* 0xad00 */ -0xb0fc,0x81f2,0x81f3,0x81f4,0xb0fd,0x81f5,0xb0fe,0x81f6, -0x81f7,0x81f8,0x81f9,0x81fa,0xb1a1,0xb1a2,0x81fb,0xb1a3, -0x81fc,0xb1a4,0x81fd,0x81fe,0x8241,0x8242,0x8243,0x8244, -0xb1a5,0x8245,0x8246,0x8247,0xb1a6,0x8248,0x8249,0x824a, -0xb1a7,0x824b,0x824c,0x824d,0x824e,0x824f,0x8250,0x8251, -0x8252,0xb1a8,0x8253,0x8254,0xb1a9,0xb1aa,0x8255,0x8256, -0x8257,0x8258,0x8259,0x825a,0xb1ab,0xb1ac,0x8261,0x8262, -0xb1ad,0x8263,0x8264,0x8265,0xb1ae,0x8266,0x8267,0x8268, -0x8269,0x826a,0x826b,0x826c,0xb1af,0xb1b0,0x826d,0xb1b1, -0x826e,0xb1b2,0x826f,0x8270,0x8271,0x8272,0x8273,0x8274, -0xb1b3,0x8275,0x8276,0x8277,0xb1b4,0x8278,0x8279,0x827a, -0xb1b5,0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287, -0x8288,0xb1b6,0x8289,0xb1b7,0x828a,0x828b,0x828c,0x828d, -0x828e,0x828f,0x8290,0x8291,0xb1b8,0xb1b9,0x8292,0x8293, -0xb1ba,0x8294,0x8295,0xb1bb,0xb1bc,0xb1bd,0xb1be,0x8296, -0x8297,0x8298,0x8299,0xb1bf,0xb1c0,0xb1c1,0x829a,0xb1c2, -0x829b,0xb1c3,0xb1c4,0x829c,0x829d,0x829e,0x829f,0x82a0, -0xb1c5,0xb1c6,0x82a1,0x82a2,0xb1c7,0x82a3,0x82a4,0x82a5, -0xb1c8,0x82a6,0x82a7,0x82a8,0x82a9,0x82aa,0x82ab,0x82ac, -0x82ad,0x82ae,0x82af,0x82b0,0xb1c9,0xb1ca,0x82b1,0x82b2, -0x82b3,0x82b4,0x82b5,0x82b6,0xb1cb,0x82b7,0x82b8,0x82b9, -0x82ba,0x82bb,0x82bc,0x82bd,0x82be,0x82bf,0x82c0,0x82c1, -0x82c2,0x82c3,0x82c4,0x82c5,0x82c6,0x82c7,0x82c8,0xb1cc, -0x82c9,0x82ca,0x82cb,0x82cc,0x82cd,0x82ce,0x82cf,0x82d0, -0xb1cd,0xb1ce,0x82d1,0x82d2,0xb1cf,0x82d3,0x82d4,0x82d5, -0xb1d0,0x82d6,0x82d7,0x82d8,0x82d9,0x82da,0x82db,0x82dc, -0xb1d1,0xb1d2,0x82dd,0xb1d3,0x82de,0x82df,0x82e0,0x82e1, -0x82e2,0x82e3,0x82e4,0x82e5,0xb1d4,0x82e6,0x82e7,0x82e8, -0xb1d5,0x82e9,0x82ea,0x82eb,0xb1d6,0x82ec,0x82ed,0x82ee, -0x82ef,0x82f0,0x82f1,0x82f2,0x82f3,0x82f4,0x82f5,0x82f6, -0x82f7,0x82f8,0x82f9,0x82fa,0x82fb,0x82fc,0x82fd,0x82fe, -0xb1d7,0xb1d8,0x8341,0x8342,0xb1d9,0x8343,0x8344,0xb1da, -/* 0xae00 */ -0xb1db,0xb1dc,0x8345,0x8346,0x8347,0x8348,0x8349,0x834a, -0xb1dd,0xb1de,0x834b,0xb1df,0x834c,0xb1e0,0x834d,0x834e, -0x834f,0x8350,0x8351,0x8352,0xb1e1,0x8353,0x8354,0x8355, -0x8356,0x8357,0x8358,0x8359,0x835a,0x8361,0x8362,0x8363, -0x8364,0x8365,0x8366,0x8367,0x8368,0x8369,0x836a,0x836b, -0x836c,0x836d,0x836e,0x836f,0x8370,0x8371,0x8372,0x8373, -0xb1e2,0xb1e3,0x8374,0x8375,0xb1e4,0x8376,0x8377,0xb1e5, -0xb1e6,0x8378,0xb1e7,0x8379,0x837a,0x8381,0x8382,0x8383, -0xb1e8,0xb1e9,0x8384,0xb1ea,0x8385,0xb1eb,0xb1ec,0x8386, -0x8387,0x8388,0xb1ed,0x8389,0xb1ee,0xb1ef,0xb1f0,0x838a, -0xb1f1,0x838b,0x838c,0x838d,0xb1f2,0x838e,0xb1f3,0x838f, -0x8390,0x8391,0x8392,0x8393,0xb1f4,0xb1f5,0x8394,0xb1f6, -0xb1f7,0xb1f8,0x8395,0x8396,0x8397,0xb1f9,0x8398,0x8399, -0xb1fa,0xb1fb,0x839a,0x839b,0xb1fc,0x839c,0x839d,0x839e, -0xb1fd,0x839f,0x83a0,0x83a1,0x83a2,0x83a3,0x83a4,0x83a5, -0xb1fe,0xb2a1,0x83a6,0xb2a2,0xb2a3,0xb2a4,0x83a7,0x83a8, -0x83a9,0x83aa,0x83ab,0x83ac,0xb2a5,0xb2a6,0x83ad,0x83ae, -0x83af,0x83b0,0x83b1,0x83b2,0xb2a7,0x83b3,0x83b4,0x83b5, -0x83b6,0x83b7,0x83b8,0x83b9,0x83ba,0x83bb,0x83bc,0x83bd, -0x83be,0x83bf,0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5, -0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb,0x83cc,0x83cd, -0x83ce,0x83cf,0x83d0,0x83d1,0x83d2,0x83d3,0x83d4,0x83d5, -0x83d6,0x83d7,0x83d8,0x83d9,0x83da,0x83db,0x83dc,0x83dd, -0x83de,0x83df,0x83e0,0x83e1,0xb2a8,0xb2a9,0xb2aa,0x83e2, -0xb2ab,0x83e3,0x83e4,0x83e5,0xb2ac,0x83e6,0x83e7,0x83e8, -0x83e9,0x83ea,0x83eb,0x83ec,0xb2ad,0xb2ae,0x83ed,0xb2af, -0xb2b0,0xb2b1,0x83ee,0x83ef,0x83f0,0x83f1,0x83f2,0x83f3, -0xb2b2,0xb2b3,0x83f4,0x83f5,0xb2b4,0x83f6,0x83f7,0x83f8, -0x83f9,0x83fa,0x83fb,0x83fc,0x83fd,0x83fe,0x8441,0x8442, -0xb2b5,0x8443,0x8444,0xb2b6,0x8445,0xb2b7,0x8446,0x8447, -0x8448,0x8449,0x844a,0x844b,0xb2b8,0x844c,0x844d,0x844e, -0xb2b9,0x844f,0x8450,0x8451,0xb2ba,0x8452,0x8453,0x8454, -/* 0xaf00 */ -0x8455,0x8456,0x8457,0x8458,0x8459,0x845a,0x8461,0xb2bb, -0xb2bc,0x8462,0x8463,0x8464,0x8465,0xb2bd,0x8466,0x8467, -0xb2be,0x8468,0x8469,0x846a,0x846b,0x846c,0x846d,0x846e, -0x846f,0x8470,0x8471,0x8472,0x8473,0x8474,0x8475,0x8476, -0x8477,0x8478,0x8479,0x847a,0x8481,0x8482,0x8483,0x8484, -0x8485,0x8486,0x8487,0x8488,0xb2bf,0xb2c0,0x8489,0x848a, -0xb2c1,0x848b,0xb2c2,0x848c,0xb2c3,0x848d,0x848e,0x848f, -0x8490,0x8491,0x8492,0x8493,0xb2c4,0xb2c5,0x8494,0xb2c6, -0x8495,0xb2c7,0xb2c8,0xb2c9,0x8496,0x8497,0x8498,0x8499, -0xb2ca,0xb2cb,0x849a,0x849b,0x849c,0x849d,0x849e,0x849f, -0xb2cc,0x84a0,0x84a1,0x84a2,0x84a3,0x84a4,0x84a5,0x84a6, -0x84a7,0x84a8,0x84a9,0x84aa,0xb2cd,0xb2ce,0x84ab,0x84ac, -0x84ad,0x84ae,0x84af,0x84b0,0xb2cf,0xb2d0,0x84b1,0x84b2, -0x84b3,0x84b4,0x84b5,0x84b6,0x84b7,0x84b8,0x84b9,0x84ba, -0x84bb,0x84bc,0x84bd,0x84be,0x84bf,0x84c0,0x84c1,0x84c2, -0x84c3,0xb2d1,0x84c4,0x84c5,0x84c6,0x84c7,0x84c8,0x84c9, -0xb2d2,0x84ca,0x84cb,0x84cc,0xb2d3,0x84cd,0x84ce,0x84cf, -0xb2d4,0x84d0,0x84d1,0x84d2,0x84d3,0x84d4,0x84d5,0x84d6, -0xb2d5,0xb2d6,0x84d7,0x84d8,0x84d9,0xb2d7,0x84da,0x84db, -0x84dc,0x84dd,0x84de,0x84df,0xb2d8,0x84e0,0x84e1,0x84e2, -0x84e3,0x84e4,0x84e5,0x84e6,0x84e7,0x84e8,0x84e9,0x84ea, -0x84eb,0x84ec,0x84ed,0x84ee,0x84ef,0x84f0,0x84f1,0x84f2, -0x84f3,0x84f4,0x84f5,0x84f6,0x84f7,0x84f8,0x84f9,0x84fa, -0xb2d9,0xb2da,0x84fb,0x84fc,0xb2db,0x84fd,0x84fe,0x8541, -0xb2dc,0x8542,0x8543,0x8544,0x8545,0x8546,0x8547,0xb2dd, -0xb2de,0xb2df,0x8548,0xb2e0,0x8549,0xb2e1,0xb2e2,0x854a, -0x854b,0x854c,0x854d,0x854e,0xb2e3,0x854f,0x8550,0x8551, -0x8552,0x8553,0x8554,0x8555,0xb2e4,0x8556,0x8557,0x8558, -0x8559,0x855a,0x8561,0x8562,0x8563,0x8564,0x8565,0x8566, -0xb2e5,0xb2e6,0x8567,0x8568,0x8569,0x856a,0x856b,0x856c, -0xb2e7,0xb2e8,0x856d,0x856e,0xb2e9,0x856f,0x8570,0x8571, -0xb2ea,0x8572,0x8573,0x8574,0x8575,0x8576,0x8577,0x8578, -/* 0xb000 */ -0xb2eb,0xb2ec,0x8579,0x857a,0xb2ed,0x8581,0x8582,0x8583, -0x8584,0x8585,0x8586,0x8587,0xb2ee,0x8588,0x8589,0x858a, -0xb2ef,0x858b,0x858c,0x858d,0xb2f0,0x858e,0x858f,0x8590, -0x8591,0x8592,0x8593,0x8594,0xb2f1,0xb2f2,0x8595,0x8596, -0x8597,0x8598,0x8599,0x859a,0x859b,0x859c,0x859d,0x859e, -0xb2f3,0x859f,0x85a0,0x85a1,0x85a2,0x85a3,0x85a4,0x85a5, -0x85a6,0x85a7,0x85a8,0x85a9,0x85aa,0x85ab,0x85ac,0x85ad, -0x85ae,0x85af,0x85b0,0x85b1,0x85b2,0x85b3,0x85b4,0x85b5, -0x85b6,0x85b7,0x85b8,0x85b9,0xb2f4,0xb2f5,0x85ba,0x85bb, -0xb2f6,0x85bc,0xb2f7,0x85bd,0xb2f8,0x85be,0xb2f9,0x85bf, -0x85c0,0x85c1,0x85c2,0xb2fa,0xb2fb,0xb2fc,0x85c3,0xb2fd, -0x85c4,0xb2fe,0x85c5,0x85c6,0x85c7,0xb3a1,0x85c8,0x85c9, -0x85ca,0x85cb,0x85cc,0x85cd,0x85ce,0x85cf,0x85d0,0x85d1, -0x85d2,0x85d3,0x85d4,0x85d5,0x85d6,0x85d7,0x85d8,0x85d9, -0x85da,0x85db,0x85dc,0x85dd,0x85de,0x85df,0x85e0,0x85e1, -0x85e2,0x85e3,0x85e4,0x85e5,0xb3a2,0xb3a3,0x85e6,0x85e7, -0xb3a4,0x85e8,0x85e9,0x85ea,0xb3a5,0x85eb,0x85ec,0x85ed, -0x85ee,0x85ef,0x85f0,0x85f1,0xb3a6,0xb3a7,0x85f2,0xb3a8, -0x85f3,0xb3a9,0x85f4,0x85f5,0x85f6,0x85f7,0x85f8,0x85f9, -0xb3aa,0xb3ab,0xb3ac,0x85fa,0xb3ad,0x85fb,0x85fc,0xb3ae, -0xb3af,0xb3b0,0xb3b1,0x85fd,0x85fe,0x8641,0x8642,0x8643, -0xb3b2,0xb3b3,0x8644,0xb3b4,0xb3b5,0xb3b6,0xb3b7,0xb3b8, -0x8645,0xb3b9,0x8646,0xb3ba,0xb3bb,0xb3bc,0x8647,0x8648, -0xb3bd,0x8649,0x864a,0x864b,0xb3be,0x864c,0x864d,0x864e, -0x864f,0x8650,0x8651,0x8652,0xb3bf,0xb3c0,0x8653,0xb3c1, -0xb3c2,0xb3c3,0x8654,0x8655,0x8656,0x8657,0x8658,0x8659, -0xb3c4,0xb3c5,0x865a,0x8661,0xb3c6,0x8662,0x8663,0x8664, -0xb3c7,0x8665,0x8666,0x8667,0x8668,0x8669,0x866a,0x866b, -0xb3c8,0x866c,0x866d,0x866e,0x866f,0xb3c9,0x8670,0x8671, -0x8672,0x8673,0x8674,0x8675,0x8676,0x8677,0x8678,0x8679, -0x867a,0x8681,0x8682,0x8683,0x8684,0x8685,0x8686,0x8687, -0x8688,0x8689,0x868a,0x868b,0x868c,0x868d,0x868e,0x868f, -/* 0xb100 */ -0x8690,0x8691,0x8692,0x8693,0x8694,0x8695,0x8696,0x8697, -0xb3ca,0xb3cb,0x8698,0xb3cc,0xb3cd,0x8699,0x869a,0x869b, -0xb3ce,0x869c,0xb3cf,0xb3d0,0x869d,0x869e,0x869f,0x86a0, -0xb3d1,0xb3d2,0x86a1,0xb3d3,0xb3d4,0xb3d5,0x86a2,0x86a3, -0x86a4,0x86a5,0x86a6,0xb3d6,0xb3d7,0xb3d8,0x86a7,0x86a8, -0xb3d9,0x86a9,0x86aa,0x86ab,0xb3da,0x86ac,0x86ad,0x86ae, -0x86af,0x86b0,0x86b1,0x86b2,0xb3db,0xb3dc,0x86b3,0xb3dd, -0xb3de,0xb3df,0x86b4,0x86b5,0x86b6,0x86b7,0x86b8,0x86b9, -0xb3e0,0xb3e1,0x86ba,0x86bb,0xb3e2,0x86bc,0x86bd,0x86be, -0xb3e3,0x86bf,0x86c0,0x86c1,0x86c2,0x86c3,0x86c4,0x86c5, -0xb3e4,0xb3e5,0x86c6,0x86c7,0xb3e6,0xb3e7,0x86c8,0x86c9, -0xb3e8,0x86ca,0x86cb,0x86cc,0xb3e9,0x86cd,0x86ce,0x86cf, -0xb3ea,0x86d0,0x86d1,0x86d2,0x86d3,0x86d4,0x86d5,0x86d6, -0x86d7,0x86d8,0x86d9,0x86da,0x86db,0x86dc,0x86dd,0x86de, -0x86df,0x86e0,0x86e1,0x86e2,0x86e3,0x86e4,0x86e5,0x86e6, -0xb3eb,0xb3ec,0x86e7,0x86e8,0xb3ed,0x86e9,0x86ea,0x86eb, -0xb3ee,0x86ec,0xb3ef,0x86ed,0x86ee,0x86ef,0x86f0,0x86f1, -0xb3f0,0xb3f1,0x86f2,0xb3f2,0x86f3,0xb3f3,0x86f4,0x86f5, -0x86f6,0x86f7,0xb3f4,0xb3f5,0xb3f6,0x86f8,0x86f9,0x86fa, -0xb3f7,0x86fb,0x86fc,0x86fd,0xb3f8,0x86fe,0x8741,0x8742, -0x8743,0x8744,0x8745,0x8746,0x8747,0x8748,0x8749,0x874a, -0xb3f9,0x874b,0x874c,0x874d,0x874e,0x874f,0x8750,0x8751, -0x8752,0x8753,0x8754,0x8755,0x8756,0x8757,0x8758,0x8759, -0x875a,0x8761,0x8762,0x8763,0x8764,0x8765,0x8766,0x8767, -0x8768,0x8769,0x876a,0x876b,0x876c,0x876d,0x876e,0x876f, -0x8770,0x8771,0x8772,0x8773,0xb3fa,0x8774,0x8775,0x8776, -0xb3fb,0x8777,0x8778,0x8779,0xb3fc,0x877a,0x8781,0x8782, -0x8783,0x8784,0x8785,0x8786,0xb3fd,0xb3fe,0x8787,0xb4a1, -0x8788,0x8789,0x878a,0x878b,0x878c,0x878d,0x878e,0x878f, -0xb4a2,0xb4a3,0x8790,0x8791,0xb4a4,0x8792,0x8793,0x8794, -0xb4a5,0x8795,0x8796,0x8797,0x8798,0x8799,0x879a,0x879b, -0x879c,0xb4a6,0x879d,0xb4a7,0x879e,0xb4a8,0x879f,0x87a0, -/* 0xb200 */ -0x87a1,0x87a2,0x87a3,0x87a4,0xb4a9,0xb4aa,0x87a5,0x87a6, -0xb4ab,0x87a7,0x87a8,0xb4ac,0xb4ad,0x87a9,0x87aa,0x87ab, -0x87ac,0x87ad,0x87ae,0x87af,0xb4ae,0xb4af,0x87b0,0xb4b0, -0x87b1,0xb4b1,0x87b2,0x87b3,0x87b4,0x87b5,0x87b6,0x87b7, -0xb4b2,0x87b8,0x87b9,0x87ba,0x87bb,0x87bc,0x87bd,0x87be, -0x87bf,0x87c0,0x87c1,0x87c2,0x87c3,0x87c4,0x87c5,0x87c6, -0x87c7,0x87c8,0x87c9,0x87ca,0xb4b3,0x87cb,0x87cc,0x87cd, -0x87ce,0x87cf,0x87d0,0x87d1,0xb4b4,0x87d2,0x87d3,0x87d4, -0x87d5,0x87d6,0x87d7,0x87d8,0x87d9,0x87da,0x87db,0x87dc, -0x87dd,0x87de,0x87df,0x87e0,0x87e1,0x87e2,0x87e3,0x87e4, -0x87e5,0x87e6,0x87e7,0x87e8,0x87e9,0x87ea,0x87eb,0x87ec, -0xb4b5,0x87ed,0x87ee,0x87ef,0xb4b6,0x87f0,0x87f1,0x87f2, -0xb4b7,0x87f3,0x87f4,0x87f5,0x87f6,0x87f7,0x87f8,0x87f9, -0xb4b8,0xb4b9,0x87fa,0x87fb,0x87fc,0x87fd,0x87fe,0x8841, -0x8842,0x8843,0x8844,0x8845,0xb4ba,0xb4bb,0x8846,0x8847, -0x8848,0x8849,0x884a,0x884b,0xb4bc,0x884c,0x884d,0x884e, -0x884f,0x8850,0x8851,0x8852,0xb4bd,0xb4be,0x8853,0x8854, -0x8855,0xb4bf,0x8856,0x8857,0x8858,0x8859,0x885a,0x8861, -0xb4c0,0xb4c1,0x8862,0x8863,0xb4c2,0x8864,0x8865,0x8866, -0xb4c3,0xb4c4,0xb4c5,0x8867,0x8868,0x8869,0x886a,0x886b, -0xb4c6,0xb4c7,0x886c,0xb4c8,0x886d,0xb4c9,0xb4ca,0x886e, -0x886f,0x8870,0xb4cb,0x8871,0xb4cc,0x8872,0x8873,0x8874, -0xb4cd,0x8875,0x8876,0x8877,0xb4ce,0x8878,0x8879,0x887a, -0x8881,0x8882,0x8883,0x8884,0x8885,0x8886,0x8887,0x8888, -0x8889,0x888a,0x888b,0x888c,0x888d,0x888e,0x888f,0x8890, -0xb4cf,0xb4d0,0x8891,0x8892,0xb4d1,0x8893,0x8894,0x8895, -0xb4d2,0x8896,0xb4d3,0x8897,0x8898,0x8899,0x889a,0x889b, -0xb4d4,0xb4d5,0x889c,0xb4d6,0x889d,0xb4d7,0x889e,0x889f, -0x88a0,0x88a1,0xb4d8,0x88a2,0xb4d9,0xb4da,0xb4db,0x88a3, -0xb4dc,0x88a4,0x88a5,0xb4dd,0xb4de,0xb4df,0xb4e0,0xb4e1, -0x88a6,0x88a7,0x88a8,0xb4e2,0xb4e3,0xb4e4,0x88a9,0xb4e5, -0xb4e6,0xb4e7,0xb4e8,0xb4e9,0x88aa,0x88ab,0x88ac,0xb4ea, -/* 0xb300 */ -0xb4eb,0xb4ec,0x88ad,0x88ae,0xb4ed,0x88af,0x88b0,0x88b1, -0xb4ee,0x88b2,0x88b3,0x88b4,0x88b5,0x88b6,0x88b7,0x88b8, -0xb4ef,0xb4f0,0x88b9,0xb4f1,0xb4f2,0xb4f3,0x88ba,0x88bb, -0x88bc,0x88bd,0x88be,0x88bf,0xb4f4,0x88c0,0x88c1,0x88c2, -0x88c3,0x88c4,0x88c5,0x88c6,0x88c7,0x88c8,0x88c9,0x88ca, -0x88cb,0x88cc,0x88cd,0x88ce,0x88cf,0x88d0,0x88d1,0x88d2, -0x88d3,0x88d4,0x88d5,0x88d6,0x88d7,0x88d8,0x88d9,0x88da, -0x88db,0x88dc,0x88dd,0x88de,0x88df,0x88e0,0x88e1,0x88e2, -0x88e3,0x88e4,0x88e5,0x88e6,0x88e7,0x88e8,0x88e9,0x88ea, -0x88eb,0x88ec,0x88ed,0x88ee,0x88ef,0x88f0,0x88f1,0x88f2, -0x88f3,0x88f4,0x88f5,0x88f6,0xb4f5,0xb4f6,0xb4f7,0x88f7, -0xb4f8,0x88f8,0x88f9,0xb4f9,0xb4fa,0x88fa,0xb4fb,0xb4fc, -0x88fb,0x88fc,0x88fd,0x88fe,0xb4fd,0xb4fe,0x8941,0xb5a1, -0x8942,0xb5a2,0x8943,0xb5a3,0x8944,0x8945,0xb5a4,0x8946, -0xb5a5,0xb5a6,0x8947,0x8948,0xb5a7,0x8949,0x894a,0x894b, -0xb5a8,0x894c,0x894d,0x894e,0x894f,0x8950,0x8951,0x8952, -0xb5a9,0xb5aa,0x8953,0xb5ab,0xb5ac,0xb5ad,0x8954,0x8955, -0x8956,0x8957,0x8958,0x8959,0xb5ae,0x895a,0x8961,0x8962, -0xb5af,0x8963,0x8964,0x8965,0xb5b0,0x8966,0x8967,0x8968, -0x8969,0x896a,0x896b,0x896c,0x896d,0x896e,0x896f,0x8970, -0xb5b1,0xb5b2,0x8971,0x8972,0x8973,0x8974,0x8975,0x8976, -0xb5b3,0x8977,0x8978,0x8979,0xb5b4,0x897a,0x8981,0x8982, -0x8983,0x8984,0x8985,0x8986,0x8987,0x8988,0x8989,0x898a, -0x898b,0x898c,0x898d,0x898e,0x898f,0x8990,0x8991,0x8992, -0x8993,0x8994,0x8995,0x8996,0xb5b5,0xb5b6,0x8997,0x8998, -0xb5b7,0x8999,0x899a,0xb5b8,0xb5b9,0x899b,0xb5ba,0x899c, -0xb5bb,0x899d,0x899e,0x899f,0xb5bc,0xb5bd,0x89a0,0xb5be, -0x89a1,0xb5bf,0x89a2,0xb5c0,0x89a3,0xb5c1,0x89a4,0x89a5, -0xb5c2,0x89a6,0x89a7,0x89a8,0xb5c3,0x89a9,0x89aa,0x89ab, -0xb5c4,0x89ac,0x89ad,0x89ae,0x89af,0x89b0,0x89b1,0x89b2, -0x89b3,0x89b4,0x89b5,0x89b6,0x89b7,0x89b8,0x89b9,0x89ba, -0x89bb,0x89bc,0x89bd,0x89be,0xb5c5,0x89bf,0x89c0,0x89c1, -/* 0xb400 */ -0x89c2,0x89c3,0x89c4,0x89c5,0x89c6,0x89c7,0x89c8,0x89c9, -0x89ca,0x89cb,0x89cc,0x89cd,0x89ce,0x89cf,0x89d0,0x89d1, -0xb5c6,0x89d2,0x89d3,0x89d4,0x89d5,0x89d6,0x89d7,0x89d8, -0xb5c7,0x89d9,0x89da,0x89db,0xb5c8,0x89dc,0x89dd,0x89de, -0xb5c9,0x89df,0x89e0,0x89e1,0x89e2,0x89e3,0x89e4,0x89e5, -0xb5ca,0xb5cb,0x89e6,0xb5cc,0x89e7,0x89e8,0x89e9,0x89ea, -0x89eb,0x89ec,0x89ed,0x89ee,0xb5cd,0x89ef,0x89f0,0x89f1, -0x89f2,0x89f3,0x89f4,0x89f5,0x89f6,0x89f7,0x89f8,0x89f9, -0x89fa,0x89fb,0x89fc,0x89fd,0x89fe,0x8a41,0x8a42,0x8a43, -0x8a44,0x8a45,0x8a46,0x8a47,0x8a48,0x8a49,0x8a4a,0x8a4b, -0xb5ce,0xb5cf,0x8a4c,0x8a4d,0xb5d0,0x8a4e,0x8a4f,0x8a50, -0xb5d1,0x8a51,0x8a52,0x8a53,0x8a54,0x8a55,0x8a56,0x8a57, -0xb5d2,0xb5d3,0x8a58,0xb5d4,0x8a59,0xb5d5,0x8a5a,0x8a61, -0x8a62,0x8a63,0x8a64,0x8a65,0xb5d6,0x8a66,0x8a67,0x8a68, -0x8a69,0x8a6a,0x8a6b,0x8a6c,0x8a6d,0x8a6e,0x8a6f,0x8a70, -0x8a71,0x8a72,0x8a73,0x8a74,0x8a75,0x8a76,0x8a77,0x8a78, -0xb5d7,0x8a79,0x8a7a,0x8a81,0x8a82,0x8a83,0x8a84,0x8a85, -0xb5d8,0x8a86,0x8a87,0x8a88,0x8a89,0x8a8a,0x8a8b,0x8a8c, -0x8a8d,0x8a8e,0x8a8f,0x8a90,0x8a91,0x8a92,0x8a93,0x8a94, -0x8a95,0x8a96,0x8a97,0x8a98,0x8a99,0xb5d9,0x8a9a,0x8a9b, -0x8a9c,0x8a9d,0x8a9e,0x8a9f,0xb5da,0x8aa0,0x8aa1,0x8aa2, -0xb5db,0x8aa3,0x8aa4,0x8aa5,0xb5dc,0x8aa6,0x8aa7,0x8aa8, -0x8aa9,0x8aaa,0x8aab,0x8aac,0x8aad,0xb5dd,0x8aae,0xb5de, -0x8aaf,0xb5df,0x8ab0,0x8ab1,0x8ab2,0x8ab3,0x8ab4,0x8ab5, -0xb5e0,0x8ab6,0x8ab7,0x8ab8,0xb5e1,0x8ab9,0x8aba,0x8abb, -0xb5e2,0x8abc,0x8abd,0x8abe,0x8abf,0x8ac0,0x8ac1,0x8ac2, -0xb5e3,0x8ac3,0x8ac4,0x8ac5,0x8ac6,0xb5e4,0x8ac7,0x8ac8, -0x8ac9,0x8aca,0x8acb,0x8acc,0xb5e5,0xb5e6,0x8acd,0x8ace, -0xb5e7,0x8acf,0x8ad0,0xb5e8,0xb5e9,0x8ad1,0xb5ea,0x8ad2, -0x8ad3,0x8ad4,0x8ad5,0x8ad6,0xb5eb,0xb5ec,0x8ad7,0xb5ed, -0x8ad8,0xb5ee,0x8ad9,0x8ada,0x8adb,0x8adc,0x8add,0x8ade, -0xb5ef,0x8adf,0x8ae0,0x8ae1,0x8ae2,0x8ae3,0x8ae4,0x8ae5, -/* 0xb500 */ -0x8ae6,0x8ae7,0x8ae8,0x8ae9,0x8aea,0x8aeb,0x8aec,0x8aed, -0x8aee,0x8aef,0x8af0,0x8af1,0x8af2,0x8af3,0x8af4,0x8af5, -0x8af6,0x8af7,0x8af8,0x8af9,0xb5f0,0xb5f1,0x8afa,0x8afb, -0xb5f2,0x8afc,0x8afd,0xb5f3,0xb5f4,0x8afe,0x8b41,0x8b42, -0x8b43,0x8b44,0x8b45,0x8b46,0xb5f5,0xb5f6,0x8b47,0xb5f7, -0xb5f8,0xb5f9,0xb5fa,0x8b48,0x8b49,0x8b4a,0x8b4b,0x8b4c, -0xb5fb,0xb5fc,0x8b4d,0x8b4e,0xb5fd,0x8b4f,0x8b50,0x8b51, -0xb5fe,0x8b52,0x8b53,0x8b54,0x8b55,0x8b56,0x8b57,0x8b58, -0xb6a1,0xb6a2,0x8b59,0xb6a3,0xb6a4,0xb6a5,0x8b5a,0x8b61, -0x8b62,0x8b63,0x8b64,0xb6a6,0xb6a7,0xb6a8,0x8b65,0x8b66, -0xb6a9,0x8b67,0x8b68,0x8b69,0xb6aa,0x8b6a,0x8b6b,0x8b6c, -0x8b6d,0x8b6e,0x8b6f,0x8b70,0xb6ab,0xb6ac,0x8b71,0xb6ad, -0xb6ae,0xb6af,0x8b72,0x8b73,0x8b74,0x8b75,0x8b76,0x8b77, -0x8b78,0x8b79,0x8b7a,0x8b81,0x8b82,0x8b83,0x8b84,0x8b85, -0x8b86,0x8b87,0x8b88,0x8b89,0x8b8a,0x8b8b,0x8b8c,0x8b8d, -0x8b8e,0x8b8f,0x8b90,0x8b91,0x8b92,0x8b93,0x8b94,0x8b95, -0x8b96,0x8b97,0x8b98,0x8b99,0x8b9a,0x8b9b,0x8b9c,0x8b9d, -0x8b9e,0x8b9f,0x8ba0,0x8ba1,0x8ba2,0x8ba3,0x8ba4,0x8ba5, -0x8ba6,0x8ba7,0x8ba8,0x8ba9,0x8baa,0x8bab,0x8bac,0x8bad, -0x8bae,0x8baf,0x8bb0,0x8bb1,0x8bb2,0x8bb3,0x8bb4,0x8bb5, -0xb6b0,0xb6b1,0x8bb6,0x8bb7,0xb6b2,0x8bb8,0x8bb9,0x8bba, -0xb6b3,0x8bbb,0xb6b4,0xb6b5,0x8bbc,0x8bbd,0x8bbe,0x8bbf, -0xb6b6,0xb6b7,0x8bc0,0xb6b8,0xb6b9,0xb6ba,0x8bc1,0x8bc2, -0x8bc3,0x8bc4,0x8bc5,0xb6bb,0xb6bc,0xb6bd,0x8bc6,0x8bc7, -0xb6be,0x8bc8,0x8bc9,0x8bca,0xb6bf,0x8bcb,0x8bcc,0x8bcd, -0x8bce,0x8bcf,0x8bd0,0x8bd1,0xb6c0,0xb6c1,0x8bd2,0xb6c2, -0xb6c3,0xb6c4,0x8bd3,0x8bd4,0x8bd5,0x8bd6,0x8bd7,0x8bd8, -0xb6c5,0x8bd9,0x8bda,0x8bdb,0x8bdc,0x8bdd,0x8bde,0x8bdf, -0x8be0,0x8be1,0x8be2,0x8be3,0x8be4,0x8be5,0x8be6,0x8be7, -0x8be8,0x8be9,0x8bea,0x8beb,0xb6c6,0x8bec,0x8bed,0x8bee, -0x8bef,0x8bf0,0x8bf1,0x8bf2,0x8bf3,0x8bf4,0x8bf5,0x8bf6, -0x8bf7,0x8bf8,0x8bf9,0x8bfa,0x8bfb,0x8bfc,0x8bfd,0x8bfe, -/* 0xb600 */ -0x8c41,0x8c42,0x8c43,0x8c44,0x8c45,0x8c46,0x8c47,0x8c48, -0x8c49,0x8c4a,0x8c4b,0x8c4c,0x8c4d,0x8c4e,0x8c4f,0x8c50, -0xb6c7,0xb6c8,0x8c51,0x8c52,0xb6c9,0x8c53,0x8c54,0x8c55, -0xb6ca,0x8c56,0x8c57,0x8c58,0x8c59,0x8c5a,0x8c61,0x8c62, -0x8c63,0x8c64,0x8c65,0x8c66,0x8c67,0xb6cb,0x8c68,0x8c69, -0x8c6a,0x8c6b,0x8c6c,0x8c6d,0xb6cc,0x8c6e,0x8c6f,0x8c70, -0x8c71,0x8c72,0x8c73,0x8c74,0xb6cd,0x8c75,0x8c76,0x8c77, -0x8c78,0x8c79,0x8c7a,0x8c81,0x8c82,0x8c83,0x8c84,0x8c85, -0x8c86,0x8c87,0x8c88,0x8c89,0x8c8a,0x8c8b,0x8c8c,0x8c8d, -0xb6ce,0x8c8e,0x8c8f,0x8c90,0x8c91,0x8c92,0x8c93,0x8c94, -0x8c95,0x8c96,0x8c97,0x8c98,0x8c99,0x8c9a,0x8c9b,0x8c9c, -0x8c9d,0x8c9e,0x8c9f,0x8ca0,0x8ca1,0x8ca2,0x8ca3,0x8ca4, -0x8ca5,0x8ca6,0x8ca7,0x8ca8,0xb6cf,0x8ca9,0x8caa,0x8cab, -0xb6d0,0x8cac,0x8cad,0x8cae,0x8caf,0x8cb0,0x8cb1,0x8cb2, -0x8cb3,0x8cb4,0x8cb5,0x8cb6,0x8cb7,0x8cb8,0x8cb9,0x8cba, -0x8cbb,0x8cbc,0x8cbd,0x8cbe,0x8cbf,0x8cc0,0x8cc1,0x8cc2, -0x8cc3,0x8cc4,0x8cc5,0x8cc6,0x8cc7,0x8cc8,0x8cc9,0x8cca, -0x8ccb,0x8ccc,0x8ccd,0x8cce,0x8ccf,0x8cd0,0x8cd1,0x8cd2, -0x8cd3,0x8cd4,0x8cd5,0x8cd6,0x8cd7,0x8cd8,0x8cd9,0x8cda, -0x8cdb,0x8cdc,0x8cdd,0x8cde,0xb6d1,0xb6d2,0x8cdf,0x8ce0, -0xb6d3,0x8ce1,0x8ce2,0x8ce3,0xb6d4,0x8ce4,0x8ce5,0x8ce6, -0x8ce7,0x8ce8,0x8ce9,0xb6d5,0xb6d6,0x8cea,0x8ceb,0x8cec, -0x8ced,0xb6d7,0x8cee,0x8cef,0x8cf0,0x8cf1,0x8cf2,0x8cf3, -0x8cf4,0x8cf5,0x8cf6,0x8cf7,0x8cf8,0x8cf9,0x8cfa,0x8cfb, -0x8cfc,0x8cfd,0x8cfe,0x8d41,0x8d42,0x8d43,0x8d44,0x8d45, -0x8d46,0x8d47,0x8d48,0x8d49,0x8d4a,0x8d4b,0x8d4c,0x8d4d, -0x8d4e,0x8d4f,0x8d50,0x8d51,0xb6d8,0x8d52,0x8d53,0x8d54, -0x8d55,0x8d56,0x8d57,0x8d58,0x8d59,0x8d5a,0x8d61,0x8d62, -0x8d63,0x8d64,0x8d65,0x8d66,0x8d67,0x8d68,0x8d69,0x8d6a, -0x8d6b,0x8d6c,0x8d6d,0x8d6e,0x8d6f,0x8d70,0x8d71,0x8d72, -0xb6d9,0x8d73,0x8d74,0x8d75,0xb6da,0x8d76,0x8d77,0x8d78, -0xb6db,0x8d79,0x8d7a,0x8d81,0x8d82,0x8d83,0x8d84,0x8d85, -/* 0xb700 */ -0xb6dc,0xb6dd,0x8d86,0x8d87,0x8d88,0xb6de,0x8d89,0x8d8a, -0x8d8b,0x8d8c,0x8d8d,0x8d8e,0x8d8f,0x8d90,0x8d91,0x8d92, -0x8d93,0x8d94,0x8d95,0x8d96,0x8d97,0x8d98,0x8d99,0x8d9a, -0x8d9b,0x8d9c,0x8d9d,0x8d9e,0x8d9f,0x8da0,0x8da1,0x8da2, -0x8da3,0x8da4,0x8da5,0x8da6,0x8da7,0x8da8,0x8da9,0x8daa, -0xb6df,0xb6e0,0x8dab,0x8dac,0xb6e1,0x8dad,0x8dae,0xb6e2, -0xb6e3,0x8daf,0x8db0,0x8db1,0x8db2,0x8db3,0x8db4,0x8db5, -0xb6e4,0xb6e5,0x8db6,0xb6e6,0x8db7,0x8db8,0x8db9,0x8dba, -0x8dbb,0x8dbc,0x8dbd,0x8dbe,0xb6e7,0x8dbf,0x8dc0,0x8dc1, -0xb6e8,0x8dc2,0x8dc3,0x8dc4,0xb6e9,0x8dc5,0x8dc6,0x8dc7, -0x8dc8,0x8dc9,0x8dca,0x8dcb,0xb6ea,0xb6eb,0x8dcc,0x8dcd, -0x8dce,0x8dcf,0x8dd0,0x8dd1,0x8dd2,0x8dd3,0x8dd4,0x8dd5, -0xb6ec,0x8dd6,0x8dd7,0x8dd8,0xb6ed,0x8dd9,0x8dda,0x8ddb, -0xb6ee,0x8ddc,0x8ddd,0x8dde,0x8ddf,0x8de0,0x8de1,0x8de2, -0xb6ef,0xb6f0,0x8de3,0xb6f1,0x8de4,0xb6f2,0x8de5,0x8de6, -0x8de7,0x8de8,0x8de9,0x8dea,0xb6f3,0xb6f4,0x8deb,0x8dec, -0xb6f5,0x8ded,0x8dee,0x8def,0xb6f6,0x8df0,0x8df1,0x8df2, -0x8df3,0x8df4,0x8df5,0x8df6,0xb6f7,0xb6f8,0x8df7,0xb6f9, -0xb6fa,0xb6fb,0xb6fc,0x8df8,0x8df9,0x8dfa,0xb6fd,0xb6fe, -0xb7a1,0xb7a2,0x8dfb,0x8dfc,0xb7a3,0x8dfd,0x8dfe,0x8e41, -0xb7a4,0x8e42,0x8e43,0x8e44,0x8e45,0x8e46,0x8e47,0x8e48, -0xb7a5,0xb7a6,0x8e49,0xb7a7,0xb7a8,0xb7a9,0x8e4a,0x8e4b, -0x8e4c,0x8e4d,0x8e4e,0x8e4f,0xb7aa,0xb7ab,0x8e50,0x8e51, -0xb7ac,0x8e52,0x8e53,0x8e54,0x8e55,0x8e56,0x8e57,0x8e58, -0x8e59,0x8e5a,0x8e61,0x8e62,0x8e63,0x8e64,0x8e65,0xb7ad, -0x8e66,0xb7ae,0x8e67,0x8e68,0x8e69,0x8e6a,0x8e6b,0x8e6c, -0x8e6d,0x8e6e,0x8e6f,0x8e70,0x8e71,0x8e72,0x8e73,0x8e74, -0x8e75,0x8e76,0x8e77,0x8e78,0x8e79,0x8e7a,0x8e81,0x8e82, -0x8e83,0x8e84,0x8e85,0x8e86,0x8e87,0x8e88,0x8e89,0x8e8a, -0x8e8b,0x8e8c,0x8e8d,0x8e8e,0xb7af,0xb7b0,0x8e8f,0x8e90, -0xb7b1,0x8e91,0x8e92,0x8e93,0xb7b2,0x8e94,0x8e95,0x8e96, -0x8e97,0x8e98,0x8e99,0x8e9a,0xb7b3,0xb7b4,0x8e9b,0xb7b5, -/* 0xb800 */ -0xb7b6,0xb7b7,0x8e9c,0x8e9d,0x8e9e,0x8e9f,0x8ea0,0xb7b8, -0xb7b9,0xb7ba,0x8ea1,0x8ea2,0xb7bb,0x8ea3,0x8ea4,0x8ea5, -0xb7bc,0x8ea6,0x8ea7,0x8ea8,0x8ea9,0x8eaa,0x8eab,0x8eac, -0xb7bd,0xb7be,0x8ead,0xb7bf,0x8eae,0xb7c0,0x8eaf,0x8eb0, -0x8eb1,0x8eb2,0x8eb3,0x8eb4,0xb7c1,0xb7c2,0x8eb5,0x8eb6, -0xb7c3,0x8eb7,0x8eb8,0x8eb9,0xb7c4,0x8eba,0x8ebb,0x8ebc, -0x8ebd,0x8ebe,0x8ebf,0x8ec0,0xb7c5,0xb7c6,0x8ec1,0xb7c7, -0xb7c8,0xb7c9,0x8ec2,0x8ec3,0x8ec4,0x8ec5,0x8ec6,0x8ec7, -0xb7ca,0x8ec8,0x8ec9,0x8eca,0xb7cb,0x8ecb,0x8ecc,0x8ecd, -0x8ece,0x8ecf,0x8ed0,0x8ed1,0x8ed2,0x8ed3,0x8ed4,0x8ed5, -0x8ed6,0xb7cc,0x8ed7,0xb7cd,0x8ed8,0x8ed9,0x8eda,0x8edb, -0x8edc,0x8edd,0x8ede,0x8edf,0xb7ce,0xb7cf,0x8ee0,0x8ee1, -0xb7d0,0x8ee2,0x8ee3,0x8ee4,0xb7d1,0x8ee5,0x8ee6,0x8ee7, -0x8ee8,0x8ee9,0x8eea,0x8eeb,0xb7d2,0xb7d3,0x8eec,0xb7d4, -0x8eed,0xb7d5,0x8eee,0x8eef,0x8ef0,0x8ef1,0x8ef2,0x8ef3, -0xb7d6,0x8ef4,0x8ef5,0x8ef6,0xb7d7,0x8ef7,0x8ef8,0x8ef9, -0x8efa,0x8efb,0x8efc,0x8efd,0x8efe,0x8f41,0x8f42,0x8f43, -0x8f44,0x8f45,0x8f46,0x8f47,0x8f48,0xb7d8,0x8f49,0x8f4a, -0x8f4b,0x8f4c,0x8f4d,0x8f4e,0x8f4f,0x8f50,0x8f51,0x8f52, -0x8f53,0x8f54,0x8f55,0x8f56,0x8f57,0x8f58,0x8f59,0x8f5a, -0x8f61,0x8f62,0x8f63,0x8f64,0x8f65,0x8f66,0x8f67,0x8f68, -0xb7d9,0x8f69,0x8f6a,0x8f6b,0x8f6c,0x8f6d,0x8f6e,0x8f6f, -0xb7da,0x8f70,0x8f71,0x8f72,0xb7db,0x8f73,0x8f74,0x8f75, -0xb7dc,0x8f76,0x8f77,0x8f78,0x8f79,0x8f7a,0x8f81,0x8f82, -0xb7dd,0xb7de,0x8f83,0xb7df,0x8f84,0xb7e0,0x8f85,0x8f86, -0x8f87,0x8f88,0x8f89,0x8f8a,0xb7e1,0x8f8b,0x8f8c,0x8f8d, -0xb7e2,0x8f8e,0x8f8f,0x8f90,0xb7e3,0x8f91,0x8f92,0x8f93, -0x8f94,0x8f95,0x8f96,0x8f97,0x8f98,0xb7e4,0x8f99,0xb7e5, -0x8f9a,0xb7e6,0x8f9b,0x8f9c,0x8f9d,0x8f9e,0x8f9f,0x8fa0, -0xb7e7,0xb7e8,0x8fa1,0x8fa2,0xb7e9,0x8fa3,0x8fa4,0x8fa5, -0xb7ea,0x8fa6,0x8fa7,0x8fa8,0x8fa9,0x8faa,0x8fab,0x8fac, -0xb7eb,0xb7ec,0x8fad,0xb7ed,0x8fae,0xb7ee,0x8faf,0x8fb0, -/* 0xb900 */ -0x8fb1,0x8fb2,0x8fb3,0x8fb4,0xb7ef,0x8fb5,0x8fb6,0x8fb7, -0x8fb8,0x8fb9,0x8fba,0x8fbb,0x8fbc,0x8fbd,0x8fbe,0x8fbf, -0x8fc0,0x8fc1,0x8fc2,0x8fc3,0x8fc4,0x8fc5,0x8fc6,0x8fc7, -0xb7f0,0x8fc8,0x8fc9,0x8fca,0x8fcb,0x8fcc,0x8fcd,0x8fce, -0xb7f1,0x8fcf,0x8fd0,0x8fd1,0x8fd2,0x8fd3,0x8fd4,0x8fd5, -0x8fd6,0x8fd7,0x8fd8,0x8fd9,0x8fda,0x8fdb,0x8fdc,0x8fdd, -0x8fde,0x8fdf,0x8fe0,0x8fe1,0x8fe2,0x8fe3,0x8fe4,0x8fe5, -0x8fe6,0x8fe7,0x8fe8,0x8fe9,0xb7f2,0xb7f3,0x8fea,0x8feb, -0xb7f4,0x8fec,0x8fed,0x8fee,0xb7f5,0x8fef,0x8ff0,0x8ff1, -0x8ff2,0x8ff3,0x8ff4,0x8ff5,0xb7f6,0x8ff6,0x8ff7,0xb7f7, -0x8ff8,0xb7f8,0x8ff9,0x8ffa,0x8ffb,0x8ffc,0x8ffd,0x8ffe, -0xb7f9,0xb7fa,0x9041,0x9042,0xb7fb,0x9043,0x9044,0x9045, -0xb7fc,0x9046,0x9047,0x9048,0x9049,0x904a,0x904b,0x904c, -0xb7fd,0xb7fe,0x904d,0xb8a1,0x904e,0xb8a2,0x904f,0x9050, -0x9051,0x9052,0x9053,0x9054,0xb8a3,0xb8a4,0x9055,0x9056, -0xb8a5,0x9057,0x9058,0x9059,0xb8a6,0x905a,0x9061,0x9062, -0x9063,0x9064,0x9065,0x9066,0xb8a7,0xb8a8,0x9067,0xb8a9, -0x9068,0xb8aa,0xb8ab,0x9069,0x906a,0xb8ac,0xb8ad,0x906b, -0x906c,0x906d,0x906e,0x906f,0x9070,0x9071,0x9072,0x9073, -0x9074,0x9075,0x9076,0x9077,0x9078,0x9079,0x907a,0x9081, -0x9082,0x9083,0x9084,0x9085,0x9086,0x9087,0x9088,0x9089, -0x908a,0x908b,0x908c,0x908d,0xb8ae,0xb8af,0x908e,0x908f, -0xb8b0,0x9090,0x9091,0x9092,0xb8b1,0x9093,0x9094,0x9095, -0x9096,0x9097,0x9098,0x9099,0xb8b2,0xb8b3,0x909a,0xb8b4, -0x909b,0xb8b5,0x909c,0x909d,0x909e,0x909f,0x90a0,0x90a1, -0xb8b6,0xb8b7,0x90a2,0x90a3,0xb8b8,0x90a4,0xb8b9,0xb8ba, -0xb8bb,0xb8bc,0xb8bd,0x90a5,0x90a6,0x90a7,0x90a8,0x90a9, -0xb8be,0xb8bf,0x90aa,0xb8c0,0x90ab,0xb8c1,0xb8c2,0x90ac, -0x90ad,0xb8c3,0x90ae,0xb8c4,0xb8c5,0xb8c6,0x90af,0x90b0, -0xb8c7,0x90b1,0x90b2,0x90b3,0xb8c8,0x90b4,0x90b5,0x90b6, -0x90b7,0x90b8,0x90b9,0x90ba,0xb8c9,0xb8ca,0x90bb,0xb8cb, -0xb8cc,0xb8cd,0xb8ce,0x90bc,0x90bd,0x90be,0x90bf,0x90c0, -/* 0xba00 */ -0xb8cf,0xb8d0,0x90c1,0x90c2,0x90c3,0x90c4,0x90c5,0x90c6, -0xb8d1,0x90c7,0x90c8,0x90c9,0x90ca,0x90cb,0x90cc,0x90cd, -0x90ce,0x90cf,0x90d0,0x90d1,0x90d2,0xb8d2,0x90d3,0x90d4, -0x90d5,0x90d6,0x90d7,0x90d8,0x90d9,0x90da,0x90db,0x90dc, -0x90dd,0x90de,0x90df,0x90e0,0x90e1,0x90e2,0x90e3,0x90e4, -0x90e5,0x90e6,0x90e7,0x90e8,0x90e9,0x90ea,0x90eb,0x90ec, -0x90ed,0x90ee,0x90ef,0x90f0,0x90f1,0x90f2,0x90f3,0x90f4, -0xb8d3,0xb8d4,0x90f5,0x90f6,0xb8d5,0x90f7,0x90f8,0x90f9, -0xb8d6,0x90fa,0xb8d7,0x90fb,0x90fc,0x90fd,0x90fe,0x9141, -0xb8d8,0xb8d9,0x9142,0xb8da,0x9143,0xb8db,0xb8dc,0x9144, -0x9145,0x9146,0x9147,0xb8dd,0xb8de,0xb8df,0x9148,0x9149, -0xb8e0,0x914a,0x914b,0x914c,0xb8e1,0x914d,0x914e,0x914f, -0x9150,0x9151,0x9152,0x9153,0xb8e2,0xb8e3,0x9154,0xb8e4, -0xb8e5,0xb8e6,0x9155,0x9156,0x9157,0x9158,0x9159,0x915a, -0xb8e7,0xb8e8,0x9161,0x9162,0xb8e9,0x9163,0x9164,0x9165, -0xb8ea,0x9166,0x9167,0x9168,0x9169,0x916a,0x916b,0x916c, -0x916d,0x916e,0x916f,0xb8eb,0xb8ec,0xb8ed,0x9170,0xb8ee, -0x9171,0x9172,0x9173,0x9174,0xb8ef,0x9175,0x9176,0x9177, -0x9178,0x9179,0x917a,0x9181,0x9182,0x9183,0x9184,0x9185, -0x9186,0x9187,0x9188,0x9189,0x918a,0x918b,0x918c,0x918d, -0x918e,0x918f,0x9190,0x9191,0x9192,0x9193,0x9194,0x9195, -0xb8f0,0xb8f1,0x9196,0xb8f2,0xb8f3,0x9197,0x9198,0x9199, -0xb8f4,0x919a,0xb8f5,0x919b,0x919c,0x919d,0x919e,0x919f, -0xb8f6,0xb8f7,0x91a0,0xb8f8,0x91a1,0xb8f9,0x91a2,0x91a3, -0x91a4,0x91a5,0x91a6,0x91a7,0xb8fa,0x91a8,0x91a9,0x91aa, -0xb8fb,0x91ab,0x91ac,0x91ad,0x91ae,0x91af,0x91b0,0x91b1, -0x91b2,0x91b3,0x91b4,0x91b5,0x91b6,0x91b7,0x91b8,0x91b9, -0xb8fc,0xb8fd,0x91ba,0x91bb,0x91bc,0x91bd,0x91be,0x91bf, -0x91c0,0x91c1,0x91c2,0x91c3,0x91c4,0x91c5,0x91c6,0x91c7, -0x91c8,0x91c9,0x91ca,0x91cb,0x91cc,0x91cd,0x91ce,0x91cf, -0x91d0,0x91d1,0x91d2,0x91d3,0x91d4,0x91d5,0x91d6,0x91d7, -0x91d8,0x91d9,0x91da,0x91db,0xb8fe,0x91dc,0x91dd,0x91de, -/* 0xbb00 */ -0xb9a1,0x91df,0x91e0,0x91e1,0xb9a2,0x91e2,0x91e3,0x91e4, -0x91e5,0x91e6,0x91e7,0x91e8,0x91e9,0xb9a3,0x91ea,0xb9a4, -0x91eb,0xb9a5,0x91ec,0x91ed,0x91ee,0x91ef,0x91f0,0x91f1, -0xb9a6,0x91f2,0x91f3,0x91f4,0xb9a7,0x91f5,0x91f6,0x91f7, -0xb9a8,0x91f8,0x91f9,0x91fa,0x91fb,0x91fc,0x91fd,0x91fe, -0x9241,0xb9a9,0x9242,0xb9aa,0x9243,0x9244,0x9245,0x9246, -0x9247,0x9248,0x9249,0x924a,0xb9ab,0xb9ac,0xb9ad,0x924b, -0xb9ae,0x924c,0x924d,0xb9af,0xb9b0,0xb9b1,0xb9b2,0x924e, -0x924f,0x9250,0x9251,0x9252,0xb9b3,0xb9b4,0x9253,0xb9b5, -0x9254,0xb9b6,0x9255,0x9256,0x9257,0xb9b7,0x9258,0xb9b8, -0xb9b9,0x9259,0x925a,0x9261,0xb9ba,0x9262,0x9263,0x9264, -0xb9bb,0x9265,0x9266,0x9267,0x9268,0x9269,0x926a,0x926b, -0x926c,0xb9bc,0x926d,0xb9bd,0x926e,0x926f,0x9270,0x9271, -0x9272,0x9273,0x9274,0x9275,0xb9be,0x9276,0x9277,0x9278, -0x9279,0x927a,0x9281,0x9282,0x9283,0x9284,0x9285,0x9286, -0x9287,0x9288,0x9289,0x928a,0x928b,0x928c,0x928d,0x928e, -0x928f,0x9290,0x9291,0x9292,0x9293,0x9294,0x9295,0x9296, -0xb9bf,0x9297,0x9298,0x9299,0xb9c0,0x929a,0x929b,0x929c, -0xb9c1,0x929d,0x929e,0x929f,0x92a0,0x92a1,0x92a2,0x92a3, -0x92a4,0x92a5,0x92a6,0x92a7,0x92a8,0x92a9,0x92aa,0x92ab, -0x92ac,0x92ad,0x92ae,0x92af,0xb9c2,0x92b0,0x92b1,0x92b2, -0xb9c3,0x92b3,0x92b4,0x92b5,0xb9c4,0x92b6,0x92b7,0x92b8, -0x92b9,0x92ba,0x92bb,0x92bc,0xb9c5,0x92bd,0x92be,0xb9c6, -0x92bf,0x92c0,0x92c1,0x92c2,0x92c3,0x92c4,0x92c5,0x92c6, -0xb9c7,0x92c7,0x92c8,0x92c9,0xb9c8,0x92ca,0x92cb,0x92cc, -0xb9c9,0x92cd,0x92ce,0x92cf,0x92d0,0x92d1,0x92d2,0x92d3, -0xb9ca,0x92d4,0x92d5,0xb9cb,0x92d6,0x92d7,0x92d8,0x92d9, -0x92da,0x92db,0x92dc,0x92dd,0x92de,0x92df,0x92e0,0x92e1, -0x92e2,0x92e3,0x92e4,0x92e5,0x92e6,0x92e7,0x92e8,0x92e9, -0x92ea,0x92eb,0x92ec,0x92ed,0x92ee,0x92ef,0x92f0,0x92f1, -0x92f2,0x92f3,0x92f4,0x92f5,0x92f6,0x92f7,0x92f8,0x92f9, -0xb9cc,0xb9cd,0x92fa,0x92fb,0xb9ce,0x92fc,0x92fd,0xb9cf, -/* 0xbc00 */ -0xb9d0,0x92fe,0xb9d1,0x9341,0x9342,0x9343,0x9344,0x9345, -0xb9d2,0xb9d3,0x9346,0xb9d4,0xb9d5,0xb9d6,0x9347,0xb9d7, -0x9348,0xb9d8,0x9349,0x934a,0xb9d9,0xb9da,0xb9db,0xb9dc, -0xb9dd,0x934b,0x934c,0xb9de,0xb9df,0xb9e0,0xb9e1,0xb9e2, -0x934d,0x934e,0x934f,0x9350,0xb9e3,0xb9e4,0x9351,0xb9e5, -0x9352,0xb9e6,0x9353,0x9354,0x9355,0xb9e7,0x9356,0x9357, -0xb9e8,0xb9e9,0x9358,0x9359,0xb9ea,0x935a,0x9361,0x9362, -0xb9eb,0x9363,0x9364,0x9365,0x9366,0x9367,0x9368,0x9369, -0xb9ec,0xb9ed,0x936a,0xb9ee,0xb9ef,0xb9f0,0x936b,0x936c, -0x936d,0xb9f1,0x936e,0x936f,0xb9f2,0xb9f3,0x9370,0x9371, -0xb9f4,0x9372,0x9373,0x9374,0x9375,0x9376,0x9377,0x9378, -0x9379,0x937a,0x9381,0x9382,0x9383,0xb9f5,0x9384,0x9385, -0x9386,0x9387,0x9388,0x9389,0x938a,0x938b,0x938c,0x938d, -0x938e,0x938f,0x9390,0x9391,0x9392,0x9393,0x9394,0x9395, -0x9396,0x9397,0x9398,0x9399,0x939a,0x939b,0x939c,0x939d, -0x939e,0x939f,0x93a0,0x93a1,0x93a2,0x93a3,0x93a4,0x93a5, -0x93a6,0x93a7,0x93a8,0x93a9,0xb9f6,0xb9f7,0x93aa,0x93ab, -0xb9f8,0x93ac,0x93ad,0xb9f9,0xb9fa,0x93ae,0xb9fb,0x93af, -0x93b0,0x93b1,0x93b2,0x93b3,0xb9fc,0xb9fd,0x93b4,0xb9fe, -0x93b5,0xbaa1,0xbaa2,0x93b6,0x93b7,0x93b8,0x93b9,0x93ba, -0xbaa3,0xbaa4,0x93bb,0x93bc,0xbaa5,0x93bd,0x93be,0xbaa6, -0xbaa7,0x93bf,0x93c0,0x93c1,0x93c2,0x93c3,0x93c4,0x93c5, -0xbaa8,0xbaa9,0x93c6,0xbaaa,0xbaab,0xbaac,0x93c7,0x93c8, -0x93c9,0x93ca,0x93cb,0x93cc,0xbaad,0xbaae,0x93cd,0x93ce, -0xbaaf,0x93cf,0x93d0,0x93d1,0xbab0,0x93d2,0x93d3,0x93d4, -0x93d5,0x93d6,0x93d7,0x93d8,0x93d9,0xbab1,0x93da,0xbab2, -0xbab3,0xbab4,0x93db,0x93dc,0x93dd,0xbab5,0x93de,0x93df, -0xbab6,0x93e0,0x93e1,0x93e2,0xbab7,0x93e3,0x93e4,0x93e5, -0x93e6,0x93e7,0x93e8,0x93e9,0x93ea,0x93eb,0x93ec,0x93ed, -0x93ee,0x93ef,0x93f0,0x93f1,0x93f2,0x93f3,0x93f4,0x93f5, -0x93f6,0x93f7,0x93f8,0x93f9,0xbab8,0xbab9,0xbaba,0x93fa, -0xbabb,0x93fb,0x93fc,0x93fd,0xbabc,0x93fe,0x9441,0x9442, -/* 0xbd00 */ -0x9443,0x9444,0x9445,0x9446,0xbabd,0xbabe,0x9447,0xbabf, -0x9448,0xbac0,0x9449,0x944a,0x944b,0x944c,0x944d,0x944e, -0xbac1,0x944f,0x9450,0x9451,0xbac2,0x9452,0x9453,0x9454, -0x9455,0x9456,0x9457,0x9458,0x9459,0x945a,0x9461,0x9462, -0x9463,0x9464,0x9465,0x9466,0xbac3,0x9467,0x9468,0x9469, -0x946a,0x946b,0x946c,0x946d,0xbac4,0x946e,0x946f,0x9470, -0x9471,0x9472,0x9473,0x9474,0x9475,0x9476,0x9477,0x9478, -0x9479,0x947a,0x9481,0x9482,0x9483,0x9484,0x9485,0x9486, -0xbac5,0x9487,0x9488,0x9489,0x948a,0x948b,0x948c,0x948d, -0xbac6,0xbac7,0x948e,0x948f,0xbac8,0x9490,0x9491,0x9492, -0xbac9,0x9493,0x9494,0x9495,0x9496,0x9497,0x9498,0x9499, -0xbaca,0xbacb,0x949a,0x949b,0x949c,0x949d,0x949e,0x949f, -0x94a0,0x94a1,0x94a2,0x94a3,0xbacc,0x94a4,0x94a5,0x94a6, -0xbacd,0x94a7,0x94a8,0x94a9,0x94aa,0x94ab,0x94ac,0x94ad, -0x94ae,0x94af,0x94b0,0x94b1,0x94b2,0x94b3,0x94b4,0x94b5, -0x94b6,0x94b7,0x94b8,0x94b9,0x94ba,0x94bb,0x94bc,0x94bd, -0xbace,0xbacf,0x94be,0x94bf,0xbad0,0x94c0,0x94c1,0xbad1, -0xbad2,0xbad3,0xbad4,0x94c2,0x94c3,0x94c4,0x94c5,0x94c6, -0xbad5,0xbad6,0x94c7,0xbad7,0x94c8,0xbad8,0x94c9,0x94ca, -0x94cb,0xbad9,0xbada,0x94cc,0xbadb,0x94cd,0x94ce,0x94cf, -0x94d0,0x94d1,0x94d2,0x94d3,0xbadc,0x94d4,0x94d5,0x94d6, -0x94d7,0x94d8,0x94d9,0x94da,0x94db,0x94dc,0x94dd,0x94de, -0xbadd,0x94df,0x94e0,0x94e1,0x94e2,0x94e3,0x94e4,0x94e5, -0xbade,0x94e6,0x94e7,0x94e8,0x94e9,0x94ea,0x94eb,0x94ec, -0x94ed,0x94ee,0x94ef,0x94f0,0x94f1,0x94f2,0x94f3,0x94f4, -0x94f5,0x94f6,0x94f7,0x94f8,0x94f9,0x94fa,0x94fb,0x94fc, -0x94fd,0x94fe,0x9541,0x9542,0xbadf,0xbae0,0x9543,0x9544, -0xbae1,0x9545,0x9546,0x9547,0xbae2,0x9548,0x9549,0x954a, -0x954b,0x954c,0x954d,0x954e,0x954f,0x9550,0x9551,0x9552, -0x9553,0xbae3,0x9554,0x9555,0x9556,0x9557,0x9558,0x9559, -0xbae4,0x955a,0x9561,0x9562,0xbae5,0x9563,0x9564,0x9565, -0xbae6,0x9566,0x9567,0x9568,0x9569,0x956a,0x956b,0x956c, -/* 0xbe00 */ -0xbae7,0x956d,0x956e,0xbae8,0x956f,0xbae9,0x9570,0x9571, -0x9572,0x9573,0x9574,0x9575,0xbaea,0xbaeb,0x9576,0x9577, -0xbaec,0x9578,0x9579,0x957a,0xbaed,0x9581,0x9582,0x9583, -0x9584,0x9585,0x9586,0x9587,0xbaee,0xbaef,0x9588,0xbaf0, -0x9589,0x958a,0x958b,0x958c,0x958d,0x958e,0x958f,0x9590, -0x9591,0x9592,0x9593,0x9594,0x9595,0x9596,0x9597,0x9598, -0x9599,0x959a,0x959b,0x959c,0x959d,0x959e,0x959f,0x95a0, -0x95a1,0x95a2,0x95a3,0x95a4,0x95a5,0x95a6,0x95a7,0x95a8, -0x95a9,0x95aa,0x95ab,0x95ac,0xbaf1,0xbaf2,0x95ad,0x95ae, -0xbaf3,0x95af,0x95b0,0x95b1,0xbaf4,0x95b2,0xbaf5,0x95b3, -0x95b4,0x95b5,0x95b6,0x95b7,0xbaf6,0xbaf7,0x95b8,0xbaf8, -0x95b9,0xbaf9,0xbafa,0xbafb,0x95ba,0x95bb,0x95bc,0x95bd, -0xbafc,0xbafd,0x95be,0x95bf,0xbafe,0x95c0,0x95c1,0x95c2, -0xbba1,0x95c3,0xbba2,0x95c4,0x95c5,0x95c6,0x95c7,0x95c8, -0xbba3,0xbba4,0x95c9,0xbba5,0xbba6,0xbba7,0x95ca,0x95cb, -0x95cc,0x95cd,0x95ce,0xbba8,0xbba9,0xbbaa,0x95cf,0x95d0, -0xbbab,0x95d1,0x95d2,0x95d3,0xbbac,0x95d4,0x95d5,0x95d6, -0x95d7,0x95d8,0x95d9,0x95da,0xbbad,0xbbae,0x95db,0xbbaf, -0xbbb0,0xbbb1,0x95dc,0x95dd,0x95de,0x95df,0x95e0,0x95e1, -0xbbb2,0xbbb3,0x95e2,0x95e3,0x95e4,0x95e5,0x95e6,0x95e7, -0x95e8,0x95e9,0x95ea,0x95eb,0x95ec,0x95ed,0x95ee,0x95ef, -0xbbb4,0x95f0,0x95f1,0x95f2,0x95f3,0x95f4,0x95f5,0x95f6, -0x95f7,0x95f8,0x95f9,0x95fa,0x95fb,0x95fc,0x95fd,0x95fe, -0x9641,0x9642,0x9643,0x9644,0x9645,0x9646,0x9647,0x9648, -0x9649,0x964a,0x964b,0x964c,0x964d,0x964e,0x964f,0x9650, -0x9651,0x9652,0x9653,0x9654,0x9655,0x9656,0x9657,0x9658, -0xbbb5,0xbbb6,0x9659,0x965a,0xbbb7,0x9661,0x9662,0xbbb8, -0xbbb9,0x9663,0x9664,0x9665,0x9666,0x9667,0x9668,0x9669, -0xbbba,0x966a,0x966b,0xbbbb,0xbbbc,0xbbbd,0x966c,0x966d, -0x966e,0x966f,0x9670,0x9671,0xbbbe,0x9672,0x9673,0x9674, -0x9675,0x9676,0x9677,0x9678,0x9679,0x967a,0x9681,0x9682, -0x9683,0x9684,0x9685,0x9686,0x9687,0x9688,0x9689,0x968a, -/* 0xbf00 */ -0x968b,0xbbbf,0x968c,0x968d,0x968e,0x968f,0x9690,0x9691, -0xbbc0,0xbbc1,0x9692,0x9693,0x9694,0x9695,0x9696,0x9697, -0x9698,0x9699,0x969a,0x969b,0x969c,0x969d,0x969e,0x969f, -0xbbc2,0xbbc3,0x96a0,0xbbc4,0xbbc5,0xbbc6,0x96a1,0x96a2, -0x96a3,0x96a4,0x96a5,0x96a6,0x96a7,0x96a8,0x96a9,0x96aa, -0x96ab,0x96ac,0x96ad,0x96ae,0x96af,0x96b0,0x96b1,0x96b2, -0x96b3,0x96b4,0x96b5,0x96b6,0x96b7,0x96b8,0x96b9,0x96ba, -0x96bb,0x96bc,0x96bd,0x96be,0x96bf,0x96c0,0x96c1,0x96c2, -0xbbc7,0xbbc8,0x96c3,0x96c4,0xbbc9,0x96c5,0x96c6,0x96c7, -0xbbca,0x96c8,0x96c9,0x96ca,0x96cb,0x96cc,0x96cd,0x96ce, -0xbbcb,0xbbcc,0x96cf,0x96d0,0x96d1,0xbbcd,0x96d2,0x96d3, -0x96d4,0x96d5,0x96d6,0x96d7,0x96d8,0x96d9,0x96da,0x96db, -0x96dc,0x96dd,0x96de,0x96df,0x96e0,0x96e1,0x96e2,0x96e3, -0x96e4,0x96e5,0x96e6,0x96e7,0x96e8,0x96e9,0x96ea,0x96eb, -0x96ec,0x96ed,0x96ee,0x96ef,0x96f0,0x96f1,0x96f2,0x96f3, -0x96f4,0x96f5,0x96f6,0x96f7,0x96f8,0x96f9,0x96fa,0x96fb, -0x96fc,0x96fd,0x96fe,0x9741,0x9742,0x9743,0x9744,0x9745, -0x9746,0x9747,0x9748,0x9749,0x974a,0x974b,0x974c,0x974d, -0x974e,0x974f,0x9750,0x9751,0xbbce,0x9752,0x9753,0x9754, -0x9755,0x9756,0x9757,0x9758,0x9759,0x975a,0x9761,0x9762, -0x9763,0x9764,0x9765,0x9766,0x9767,0x9768,0x9769,0x976a, -0x976b,0x976c,0x976d,0x976e,0x976f,0x9770,0x9771,0x9772, -0xbbcf,0x9773,0x9774,0x9775,0x9776,0x9777,0x9778,0x9779, -0x977a,0x9781,0x9782,0x9783,0x9784,0x9785,0x9786,0x9787, -0x9788,0x9789,0x978a,0x978b,0x978c,0xbbd0,0x978d,0x978e, -0x978f,0x9790,0x9791,0x9792,0xbbd1,0xbbd2,0x9793,0x9794, -0xbbd3,0x9795,0x9796,0x9797,0xbbd4,0x9798,0x9799,0x979a, -0x979b,0x979c,0x979d,0x979e,0xbbd5,0x979f,0x97a0,0xbbd6, -0x97a1,0xbbd7,0x97a2,0x97a3,0x97a4,0x97a5,0x97a6,0x97a7, -0x97a8,0x97a9,0x97aa,0x97ab,0x97ac,0x97ad,0x97ae,0x97af, -0x97b0,0x97b1,0x97b2,0x97b3,0x97b4,0x97b5,0x97b6,0x97b7, -0x97b8,0x97b9,0x97ba,0x97bb,0x97bc,0x97bd,0x97be,0x97bf, -/* 0xc000 */ -0x97c0,0x97c1,0x97c2,0x97c3,0x97c4,0x97c5,0x97c6,0x97c7, -0x97c8,0x97c9,0x97ca,0x97cb,0x97cc,0x97cd,0x97ce,0x97cf, -0x97d0,0x97d1,0x97d2,0x97d3,0x97d4,0x97d5,0x97d6,0x97d7, -0x97d8,0x97d9,0x97da,0x97db,0x97dc,0x97dd,0x97de,0x97df, -0x97e0,0x97e1,0x97e2,0x97e3,0x97e4,0x97e5,0x97e6,0x97e7, -0x97e8,0x97e9,0x97ea,0x97eb,0x97ec,0x97ed,0x97ee,0x97ef, -0x97f0,0x97f1,0x97f2,0x97f3,0x97f4,0x97f5,0x97f6,0x97f7, -0x97f8,0x97f9,0x97fa,0x97fb,0xbbd8,0x97fc,0x97fd,0x97fe, -0x9841,0x9842,0x9843,0x9844,0x9845,0x9846,0x9847,0x9848, -0x9849,0x984a,0x984b,0x984c,0x984d,0x984e,0x984f,0x9850, -0x9851,0xbbd9,0x9852,0x9853,0x9854,0x9855,0x9856,0x9857, -0xbbda,0x9858,0x9859,0x985a,0xbbdb,0x9861,0x9862,0x9863, -0xbbdc,0x9864,0x9865,0x9866,0x9867,0x9868,0x9869,0x986a, -0xbbdd,0xbbde,0x986b,0x986c,0x986d,0x986e,0x986f,0x9870, -0x9871,0x9872,0x9873,0x9874,0x9875,0x9876,0x9877,0x9878, -0x9879,0x987a,0x9881,0x9882,0x9883,0x9884,0x9885,0x9886, -0x9887,0x9888,0x9889,0x988a,0x988b,0x988c,0x988d,0x988e, -0x988f,0x9890,0x9891,0x9892,0x9893,0x9894,0x9895,0x9896, -0xbbdf,0xbbe0,0x9897,0x9898,0xbbe1,0x9899,0x989a,0x989b, -0xbbe2,0x989c,0x989d,0x989e,0x989f,0x98a0,0x98a1,0x98a2, -0xbbe3,0xbbe4,0x98a3,0xbbe5,0x98a4,0xbbe6,0x98a5,0x98a6, -0x98a7,0x98a8,0x98a9,0x98aa,0xbbe7,0xbbe8,0x98ab,0xbbe9, -0xbbea,0x98ac,0x98ad,0xbbeb,0xbbec,0xbbed,0xbbee,0x98ae, -0x98af,0x98b0,0x98b1,0x98b2,0xbbef,0xbbf0,0x98b3,0xbbf1, -0xbbf2,0xbbf3,0x98b4,0x98b5,0x98b6,0xbbf4,0x98b7,0x98b8, -0xbbf5,0xbbf6,0x98b9,0x98ba,0xbbf7,0x98bb,0x98bc,0x98bd, -0xbbf8,0x98be,0x98bf,0x98c0,0x98c1,0x98c2,0x98c3,0x98c4, -0xbbf9,0xbbfa,0x98c5,0xbbfb,0xbbfc,0xbbfd,0x98c6,0x98c7, -0x98c8,0x98c9,0x98ca,0x98cb,0xbbfe,0xbca1,0x98cc,0x98cd, -0xbca2,0x98ce,0x98cf,0x98d0,0xbca3,0x98d1,0x98d2,0x98d3, -0x98d4,0x98d5,0x98d6,0x98d7,0xbca4,0xbca5,0x98d8,0xbca6, -0x98d9,0xbca7,0x98da,0x98db,0x98dc,0x98dd,0x98de,0x98df, -/* 0xc100 */ -0xbca8,0x98e0,0x98e1,0x98e2,0xbca9,0x98e3,0x98e4,0x98e5, -0xbcaa,0x98e6,0x98e7,0x98e8,0x98e9,0x98ea,0x98eb,0x98ec, -0xbcab,0x98ed,0x98ee,0x98ef,0x98f0,0xbcac,0x98f1,0x98f2, -0x98f3,0x98f4,0x98f5,0x98f6,0xbcad,0xbcae,0xbcaf,0xbcb0, -0xbcb1,0x98f7,0x98f8,0xbcb2,0xbcb3,0x98f9,0xbcb4,0xbcb5, -0x98fa,0x98fb,0x98fc,0x98fd,0xbcb6,0xbcb7,0x98fe,0xbcb8, -0xbcb9,0xbcba,0x9941,0x9942,0x9943,0x9944,0xbcbb,0x9945, -0xbcbc,0xbcbd,0x9946,0x9947,0xbcbe,0x9948,0x9949,0x994a, -0xbcbf,0x994b,0x994c,0x994d,0x994e,0x994f,0x9950,0x9951, -0xbcc0,0xbcc1,0x9952,0xbcc2,0xbcc3,0xbcc4,0x9953,0x9954, -0x9955,0x9956,0x9957,0x9958,0xbcc5,0xbcc6,0x9959,0x995a, -0xbcc7,0x9961,0x9962,0x9963,0xbcc8,0x9964,0x9965,0x9966, -0x9967,0x9968,0x9969,0x996a,0xbcc9,0xbcca,0x996b,0xbccb, -0xbccc,0xbccd,0x996c,0x996d,0x996e,0x996f,0x9970,0x9971, -0xbcce,0x9972,0x9973,0x9974,0xbccf,0x9975,0x9976,0x9977, -0xbcd0,0x9978,0x9979,0x997a,0x9981,0x9982,0x9983,0x9984, -0x9985,0x9986,0x9987,0x9988,0x9989,0xbcd1,0x998a,0x998b, -0x998c,0x998d,0x998e,0x998f,0xbcd2,0xbcd3,0xbcd4,0x9990, -0xbcd5,0x9991,0x9992,0x9993,0xbcd6,0x9994,0xbcd7,0x9995, -0x9996,0x9997,0x9998,0x9999,0xbcd8,0xbcd9,0x999a,0xbcda, -0x999b,0xbcdb,0x999c,0x999d,0x999e,0xbcdc,0x999f,0x99a0, -0xbcdd,0xbcde,0x99a1,0x99a2,0xbcdf,0x99a3,0x99a4,0x99a5, -0xbce0,0x99a6,0x99a7,0x99a8,0x99a9,0x99aa,0x99ab,0x99ac, -0x99ad,0x99ae,0x99af,0x99b0,0x99b1,0xbce1,0x99b2,0x99b3, -0x99b4,0x99b5,0x99b6,0x99b7,0xbce2,0x99b8,0x99b9,0x99ba, -0xbce3,0x99bb,0x99bc,0x99bd,0xbce4,0x99be,0x99bf,0x99c0, -0x99c1,0x99c2,0x99c3,0x99c4,0xbce5,0x99c5,0x99c6,0xbce6, -0xbce7,0x99c7,0x99c8,0x99c9,0x99ca,0x99cb,0x99cc,0x99cd, -0xbce8,0x99ce,0x99cf,0x99d0,0xbce9,0x99d1,0x99d2,0x99d3, -0xbcea,0x99d4,0x99d5,0x99d6,0x99d7,0x99d8,0x99d9,0x99da, -0xbceb,0xbcec,0x99db,0xbced,0x99dc,0x99dd,0x99de,0x99df, -0x99e0,0x99e1,0x99e2,0x99e3,0xbcee,0xbcef,0x99e4,0x99e5, -/* 0xc200 */ -0xbcf0,0x99e6,0x99e7,0x99e8,0xbcf1,0x99e9,0x99ea,0x99eb, -0x99ec,0x99ed,0x99ee,0x99ef,0xbcf2,0xbcf3,0x99f0,0xbcf4, -0x99f1,0xbcf5,0x99f2,0x99f3,0x99f4,0x99f5,0x99f6,0x99f7, -0xbcf6,0xbcf7,0x99f8,0x99f9,0xbcf8,0x99fa,0x99fb,0xbcf9, -0xbcfa,0x99fc,0x99fd,0x99fe,0x9a41,0x9a42,0x9a43,0x9a44, -0xbcfb,0xbcfc,0x9a45,0xbcfd,0x9a46,0xbcfe,0x9a47,0xbda1, -0x9a48,0xbda2,0xbda3,0x9a49,0xbda4,0x9a4a,0x9a4b,0x9a4c, -0x9a4d,0x9a4e,0x9a4f,0x9a50,0x9a51,0x9a52,0x9a53,0x9a54, -0x9a55,0x9a56,0x9a57,0x9a58,0x9a59,0x9a5a,0x9a61,0x9a62, -0xbda5,0x9a63,0x9a64,0x9a65,0x9a66,0x9a67,0x9a68,0x9a69, -0xbda6,0xbda7,0x9a6a,0x9a6b,0xbda8,0x9a6c,0x9a6d,0x9a6e, -0xbda9,0x9a6f,0x9a70,0x9a71,0x9a72,0x9a73,0x9a74,0x9a75, -0xbdaa,0x9a76,0x9a77,0x9a78,0x9a79,0xbdab,0x9a7a,0x9a81, -0x9a82,0x9a83,0x9a84,0x9a85,0xbdac,0xbdad,0x9a86,0x9a87, -0xbdae,0x9a88,0x9a89,0x9a8a,0xbdaf,0x9a8b,0x9a8c,0x9a8d, -0x9a8e,0x9a8f,0x9a90,0x9a91,0xbdb0,0xbdb1,0x9a92,0xbdb2, -0x9a93,0xbdb3,0x9a94,0x9a95,0x9a96,0x9a97,0x9a98,0x9a99, -0xbdb4,0xbdb5,0x9a9a,0x9a9b,0x9a9c,0x9a9d,0x9a9e,0x9a9f, -0xbdb6,0x9aa0,0x9aa1,0x9aa2,0x9aa3,0x9aa4,0x9aa5,0x9aa6, -0xbdb7,0x9aa7,0x9aa8,0xbdb8,0x9aa9,0xbdb9,0x9aaa,0x9aab, -0x9aac,0x9aad,0x9aae,0x9aaf,0xbdba,0xbdbb,0x9ab0,0x9ab1, -0xbdbc,0x9ab2,0x9ab3,0x9ab4,0xbdbd,0xbdbe,0x9ab5,0x9ab6, -0x9ab7,0x9ab8,0x9ab9,0x9aba,0xbdbf,0xbdc0,0x9abb,0xbdc1, -0x9abc,0xbdc2,0x9abd,0x9abe,0x9abf,0x9ac0,0x9ac1,0x9ac2, -0x9ac3,0x9ac4,0x9ac5,0x9ac6,0x9ac7,0x9ac8,0x9ac9,0x9aca, -0x9acb,0x9acc,0x9acd,0x9ace,0x9acf,0x9ad0,0x9ad1,0x9ad2, -0x9ad3,0x9ad4,0x9ad5,0x9ad6,0x9ad7,0x9ad8,0x9ad9,0x9ada, -0x9adb,0x9adc,0x9add,0x9ade,0xbdc3,0xbdc4,0x9adf,0x9ae0, -0xbdc5,0x9ae1,0x9ae2,0xbdc6,0xbdc7,0x9ae3,0x9ae4,0x9ae5, -0x9ae6,0x9ae7,0x9ae8,0xbdc8,0xbdc9,0xbdca,0x9ae9,0xbdcb, -0x9aea,0xbdcc,0x9aeb,0x9aec,0x9aed,0x9aee,0xbdcd,0x9aef, -0xbdce,0xbdcf,0x9af0,0xbdd0,0xbdd1,0x9af1,0x9af2,0x9af3, -/* 0xc300 */ -0xbdd2,0x9af4,0x9af5,0x9af6,0x9af7,0x9af8,0x9af9,0x9afa, -0xbdd3,0xbdd4,0x9afb,0x9afc,0xbdd5,0xbdd6,0x9afd,0x9afe, -0x9b41,0x9b42,0x9b43,0xbdd7,0xbdd8,0xbdd9,0x9b44,0x9b45, -0xbdda,0x9b46,0x9b47,0x9b48,0xbddb,0x9b49,0x9b4a,0x9b4b, -0x9b4c,0x9b4d,0x9b4e,0x9b4f,0xbddc,0xbddd,0x9b50,0x9b51, -0xbdde,0xbddf,0x9b52,0x9b53,0x9b54,0x9b55,0x9b56,0x9b57, -0x9b58,0x9b59,0x9b5a,0x9b61,0x9b62,0x9b63,0x9b64,0x9b65, -0x9b66,0x9b67,0x9b68,0x9b69,0x9b6a,0x9b6b,0x9b6c,0x9b6d, -0x9b6e,0x9b6f,0x9b70,0x9b71,0x9b72,0xbde0,0x9b73,0x9b74, -0x9b75,0x9b76,0x9b77,0x9b78,0x9b79,0x9b7a,0x9b81,0x9b82, -0x9b83,0x9b84,0x9b85,0x9b86,0x9b87,0x9b88,0x9b89,0x9b8a, -0x9b8b,0x9b8c,0x9b8d,0x9b8e,0x9b8f,0x9b90,0x9b91,0x9b92, -0x9b93,0x9b94,0x9b95,0x9b96,0x9b97,0x9b98,0x9b99,0x9b9a, -0xbde1,0xbde2,0x9b9b,0x9b9c,0xbde3,0x9b9d,0x9b9e,0x9b9f, -0xbde4,0x9ba0,0xbde5,0x9ba1,0x9ba2,0x9ba3,0x9ba4,0x9ba5, -0xbde6,0xbde7,0x9ba6,0x9ba7,0xbde8,0xbde9,0x9ba8,0x9ba9, -0x9baa,0x9bab,0x9bac,0x9bad,0xbdea,0x9bae,0x9baf,0x9bb0, -0xbdeb,0x9bb1,0x9bb2,0x9bb3,0xbdec,0x9bb4,0x9bb5,0x9bb6, -0x9bb7,0x9bb8,0x9bb9,0x9bba,0x9bbb,0x9bbc,0x9bbd,0x9bbe, -0x9bbf,0x9bc0,0x9bc1,0x9bc2,0x9bc3,0x9bc4,0x9bc5,0x9bc6, -0x9bc7,0x9bc8,0x9bc9,0x9bca,0x9bcb,0x9bcc,0x9bcd,0x9bce, -0x9bcf,0x9bd0,0x9bd1,0x9bd2,0x9bd3,0x9bd4,0x9bd5,0x9bd6, -0x9bd7,0x9bd8,0x9bd9,0x9bda,0x9bdb,0x9bdc,0x9bdd,0x9bde, -0x9bdf,0x9be0,0x9be1,0x9be2,0x9be3,0x9be4,0x9be5,0x9be6, -0xbded,0x9be7,0x9be8,0x9be9,0x9bea,0x9beb,0x9bec,0x9bed, -0x9bee,0x9bef,0x9bf0,0x9bf1,0x9bf2,0x9bf3,0x9bf4,0x9bf5, -0x9bf6,0x9bf7,0x9bf8,0x9bf9,0x9bfa,0x9bfb,0x9bfc,0x9bfd, -0xbdee,0xbdef,0x9bfe,0x9c41,0xbdf0,0x9c42,0x9c43,0xbdf1, -0xbdf2,0x9c44,0xbdf3,0x9c45,0x9c46,0x9c47,0x9c48,0x9c49, -0xbdf4,0xbdf5,0x9c4a,0x9c4b,0x9c4c,0xbdf6,0x9c4d,0x9c4e, -0x9c4f,0x9c50,0x9c51,0x9c52,0xbdf7,0xbdf8,0x9c53,0x9c54, -0xbdf9,0x9c55,0x9c56,0x9c57,0x9c58,0x9c59,0x9c5a,0x9c61, -/* 0xc400 */ -0x9c62,0x9c63,0x9c64,0x9c65,0x9c66,0x9c67,0x9c68,0x9c69, -0xbdfa,0x9c6a,0x9c6b,0x9c6c,0x9c6d,0x9c6e,0x9c6f,0x9c70, -0xbdfb,0x9c71,0x9c72,0x9c73,0x9c74,0x9c75,0x9c76,0x9c77, -0x9c78,0x9c79,0x9c7a,0x9c81,0x9c82,0x9c83,0x9c84,0x9c85, -0x9c86,0x9c87,0x9c88,0x9c89,0xbdfc,0x9c8a,0x9c8b,0x9c8c, -0x9c8d,0x9c8e,0x9c8f,0x9c90,0xbdfd,0x9c91,0x9c92,0x9c93, -0xbdfe,0x9c94,0x9c95,0x9c96,0xbea1,0x9c97,0x9c98,0x9c99, -0x9c9a,0x9c9b,0x9c9c,0x9c9d,0xbea2,0xbea3,0x9c9e,0x9c9f, -0x9ca0,0x9ca1,0x9ca2,0x9ca3,0x9ca4,0x9ca5,0x9ca6,0x9ca7, -0xbea4,0x9ca8,0x9ca9,0x9caa,0x9cab,0x9cac,0x9cad,0x9cae, -0x9caf,0x9cb0,0x9cb1,0x9cb2,0x9cb3,0x9cb4,0x9cb5,0x9cb6, -0x9cb7,0x9cb8,0x9cb9,0x9cba,0x9cbb,0x9cbc,0x9cbd,0x9cbe, -0x9cbf,0x9cc0,0x9cc1,0x9cc2,0xbea5,0xbea6,0x9cc3,0x9cc4, -0xbea7,0x9cc5,0x9cc6,0x9cc7,0xbea8,0x9cc8,0x9cc9,0x9cca, -0x9ccb,0x9ccc,0x9ccd,0x9cce,0xbea9,0xbeaa,0x9ccf,0x9cd0, -0x9cd1,0xbeab,0x9cd2,0x9cd3,0x9cd4,0x9cd5,0x9cd6,0x9cd7, -0xbeac,0x9cd8,0x9cd9,0x9cda,0x9cdb,0x9cdc,0x9cdd,0x9cde, -0x9cdf,0x9ce0,0x9ce1,0x9ce2,0x9ce3,0x9ce4,0x9ce5,0x9ce6, -0x9ce7,0x9ce8,0x9ce9,0x9cea,0xbead,0x9ceb,0x9cec,0x9ced, -0x9cee,0x9cef,0x9cf0,0x9cf1,0xbeae,0x9cf2,0x9cf3,0x9cf4, -0x9cf5,0x9cf6,0x9cf7,0x9cf8,0x9cf9,0x9cfa,0x9cfb,0x9cfc, -0x9cfd,0x9cfe,0x9d41,0x9d42,0x9d43,0x9d44,0x9d45,0x9d46, -0x9d47,0x9d48,0x9d49,0x9d4a,0x9d4b,0x9d4c,0x9d4d,0x9d4e, -0xbeaf,0x9d4f,0x9d50,0x9d51,0xbeb0,0x9d52,0x9d53,0x9d54, -0x9d55,0x9d56,0x9d57,0x9d58,0x9d59,0x9d5a,0x9d61,0x9d62, -0x9d63,0x9d64,0x9d65,0x9d66,0x9d67,0x9d68,0x9d69,0x9d6a, -0x9d6b,0x9d6c,0x9d6d,0x9d6e,0x9d6f,0x9d70,0x9d71,0x9d72, -0x9d73,0x9d74,0x9d75,0x9d76,0x9d77,0x9d78,0x9d79,0x9d7a, -0x9d81,0x9d82,0x9d83,0x9d84,0x9d85,0x9d86,0x9d87,0x9d88, -0x9d89,0xbeb1,0x9d8a,0x9d8b,0x9d8c,0x9d8d,0x9d8e,0x9d8f, -0xbeb2,0xbeb3,0x9d90,0x9d91,0xbeb4,0x9d92,0x9d93,0x9d94, -0xbeb5,0x9d95,0xbeb6,0x9d96,0x9d97,0x9d98,0x9d99,0xbeb7, -/* 0xc500 */ -0xbeb8,0xbeb9,0x9d9a,0x9d9b,0x9d9c,0x9d9d,0x9d9e,0x9d9f, -0x9da0,0x9da1,0x9da2,0x9da3,0xbeba,0x9da4,0x9da5,0x9da6, -0xbebb,0x9da7,0x9da8,0x9da9,0xbebc,0x9daa,0x9dab,0x9dac, -0x9dad,0x9dae,0x9daf,0x9db0,0xbebd,0x9db1,0x9db2,0x9db3, -0x9db4,0x9db5,0x9db6,0x9db7,0x9db8,0x9db9,0x9dba,0x9dbb, -0xbebe,0xbebf,0x9dbc,0x9dbd,0xbec0,0x9dbe,0x9dbf,0x9dc0, -0xbec1,0x9dc1,0x9dc2,0x9dc3,0x9dc4,0x9dc5,0x9dc6,0x9dc7, -0xbec2,0xbec3,0x9dc8,0xbec4,0x9dc9,0xbec5,0x9dca,0x9dcb, -0x9dcc,0x9dcd,0x9dce,0x9dcf,0xbec6,0xbec7,0x9dd0,0x9dd1, -0xbec8,0xbec9,0xbeca,0x9dd2,0xbecb,0xbecc,0xbecd,0x9dd3, -0x9dd4,0x9dd5,0x9dd6,0xbece,0xbecf,0xbed0,0x9dd7,0xbed1, -0xbed2,0xbed3,0x9dd8,0x9dd9,0x9dda,0xbed4,0xbed5,0x9ddb, -0xbed6,0xbed7,0x9ddc,0x9ddd,0xbed8,0x9dde,0x9ddf,0x9de0, -0xbed9,0x9de1,0x9de2,0x9de3,0x9de4,0x9de5,0x9de6,0x9de7, -0xbeda,0xbedb,0x9de8,0xbedc,0xbedd,0xbede,0x9de9,0x9dea, -0x9deb,0x9dec,0x9ded,0x9dee,0xbedf,0xbee0,0x9def,0x9df0, -0xbee1,0x9df1,0x9df2,0x9df3,0xbee2,0x9df4,0x9df5,0xbee3, -0x9df6,0x9df7,0x9df8,0x9df9,0xbee4,0xbee5,0x9dfa,0xbee6, -0x9dfb,0xbee7,0x9dfc,0x9dfd,0x9dfe,0xbee8,0x9e41,0xbee9, -0xbeea,0x9e42,0x9e43,0x9e44,0xbeeb,0x9e45,0x9e46,0x9e47, -0xbeec,0x9e48,0x9e49,0x9e4a,0x9e4b,0x9e4c,0x9e4d,0x9e4e, -0x9e4f,0xbeed,0x9e50,0x9e51,0x9e52,0x9e53,0x9e54,0x9e55, -0x9e56,0x9e57,0x9e58,0x9e59,0xbeee,0xbeef,0x9e5a,0x9e61, -0xbef0,0xbef1,0x9e62,0xbef2,0xbef3,0xbef4,0xbef5,0x9e63, -0x9e64,0x9e65,0x9e66,0x9e67,0xbef6,0xbef7,0xbef8,0xbef9, -0xbefa,0xbefb,0xbefc,0x9e68,0xbefd,0x9e69,0xbefe,0x9e6a, -0xbfa1,0xbfa2,0x9e6b,0x9e6c,0xbfa3,0x9e6d,0x9e6e,0x9e6f, -0xbfa4,0x9e70,0x9e71,0x9e72,0x9e73,0x9e74,0x9e75,0x9e76, -0xbfa5,0xbfa6,0x9e77,0xbfa7,0x9e78,0xbfa8,0x9e79,0x9e7a, -0x9e81,0x9e82,0x9e83,0x9e84,0xbfa9,0xbfaa,0xbfab,0x9e85, -0xbfac,0x9e86,0x9e87,0x9e88,0xbfad,0x9e89,0xbfae,0xbfaf, -0x9e8a,0x9e8b,0x9e8c,0x9e8d,0xbfb0,0xbfb1,0xbfb2,0xbfb3, -/* 0xc600 */ -0xbfb4,0xbfb5,0x9e8e,0x9e8f,0x9e90,0xbfb6,0xbfb7,0xbfb8, -0xbfb9,0x9e91,0x9e92,0x9e93,0xbfba,0x9e94,0x9e95,0x9e96, -0xbfbb,0x9e97,0x9e98,0x9e99,0x9e9a,0x9e9b,0x9e9c,0x9e9d, -0xbfbc,0xbfbd,0x9e9e,0xbfbe,0xbfbf,0x9e9f,0x9ea0,0x9ea1, -0x9ea2,0x9ea3,0x9ea4,0x9ea5,0xbfc0,0xbfc1,0x9ea6,0x9ea7, -0xbfc2,0x9ea8,0x9ea9,0x9eaa,0xbfc3,0xbfc4,0xbfc5,0x9eab, -0xbfc6,0x9eac,0x9ead,0xbfc7,0xbfc8,0xbfc9,0x9eae,0xbfca, -0x9eaf,0xbfcb,0x9eb0,0xbfcc,0x9eb1,0x9eb2,0x9eb3,0x9eb4, -0xbfcd,0xbfce,0x9eb5,0x9eb6,0xbfcf,0x9eb7,0x9eb8,0x9eb9, -0xbfd0,0x9eba,0x9ebb,0x9ebc,0x9ebd,0x9ebe,0x9ebf,0x9ec0, -0xbfd1,0xbfd2,0x9ec1,0xbfd3,0xbfd4,0xbfd5,0x9ec2,0x9ec3, -0x9ec4,0x9ec5,0x9ec6,0x9ec7,0xbfd6,0xbfd7,0x9ec8,0x9ec9, -0xbfd8,0x9eca,0x9ecb,0x9ecc,0x9ecd,0x9ece,0x9ecf,0x9ed0, -0x9ed1,0x9ed2,0x9ed3,0x9ed4,0xbfd9,0x9ed5,0x9ed6,0xbfda, -0x9ed7,0xbfdb,0x9ed8,0x9ed9,0x9eda,0x9edb,0x9edc,0x9edd, -0xbfdc,0xbfdd,0x9ede,0x9edf,0xbfde,0x9ee0,0x9ee1,0x9ee2, -0xbfdf,0x9ee3,0x9ee4,0x9ee5,0x9ee6,0x9ee7,0x9ee8,0x9ee9, -0xbfe0,0xbfe1,0x9eea,0xbfe2,0x9eeb,0xbfe3,0x9eec,0x9eed, -0x9eee,0x9eef,0x9ef0,0x9ef1,0xbfe4,0xbfe5,0x9ef2,0x9ef3, -0xbfe6,0x9ef4,0x9ef5,0x9ef6,0xbfe7,0x9ef7,0x9ef8,0x9ef9, -0x9efa,0x9efb,0x9efc,0x9efd,0xbfe8,0xbfe9,0x9efe,0xbfea, -0x9f41,0xbfeb,0x9f42,0x9f43,0x9f44,0x9f45,0x9f46,0x9f47, -0xbfec,0xbfed,0x9f48,0x9f49,0xbfee,0x9f4a,0x9f4b,0x9f4c, -0xbfef,0xbff0,0xbff1,0x9f4d,0x9f4e,0x9f4f,0x9f50,0x9f51, -0xbff2,0xbff3,0x9f52,0xbff4,0x9f53,0xbff5,0x9f54,0x9f55, -0x9f56,0x9f57,0x9f58,0x9f59,0xbff6,0xbff7,0x9f5a,0x9f61, -0xbff8,0x9f62,0x9f63,0x9f64,0xbff9,0x9f65,0x9f66,0x9f67, -0x9f68,0x9f69,0x9f6a,0x9f6b,0xbffa,0xbffb,0x9f6c,0x9f6d, -0xbffc,0xbffd,0x9f6e,0x9f6f,0x9f70,0x9f71,0x9f72,0x9f73, -0xbffe,0xc0a1,0x9f74,0x9f75,0xc0a2,0x9f76,0x9f77,0x9f78, -0xc0a3,0x9f79,0x9f7a,0x9f81,0x9f82,0x9f83,0x9f84,0x9f85, -0xc0a4,0xc0a5,0x9f86,0x9f87,0x9f88,0xc0a6,0x9f89,0x9f8a, -/* 0xc700 */ -0x9f8b,0x9f8c,0x9f8d,0x9f8e,0xc0a7,0xc0a8,0x9f8f,0x9f90, -0xc0a9,0x9f91,0x9f92,0x9f93,0xc0aa,0x9f94,0x9f95,0x9f96, -0x9f97,0x9f98,0x9f99,0x9f9a,0xc0ab,0xc0ac,0x9f9b,0xc0ad, -0x9f9c,0xc0ae,0x9f9d,0x9f9e,0x9f9f,0x9fa0,0x9fa1,0x9fa2, -0xc0af,0xc0b0,0x9fa3,0x9fa4,0xc0b1,0x9fa5,0x9fa6,0x9fa7, -0xc0b2,0x9fa8,0x9fa9,0x9faa,0x9fab,0x9fac,0x9fad,0x9fae, -0xc0b3,0xc0b4,0x9faf,0xc0b5,0x9fb0,0xc0b6,0x9fb1,0xc0b7, -0x9fb2,0x9fb3,0x9fb4,0x9fb5,0xc0b8,0xc0b9,0x9fb6,0x9fb7, -0xc0ba,0x9fb8,0x9fb9,0x9fba,0xc0bb,0x9fbb,0x9fbc,0x9fbd, -0x9fbe,0x9fbf,0xc0bc,0x9fc0,0xc0bd,0xc0be,0x9fc1,0xc0bf, -0x9fc2,0xc0c0,0xc0c1,0xc0c2,0xc0c3,0xc0c4,0xc0c5,0xc0c6, -0xc0c7,0x9fc3,0x9fc4,0x9fc5,0xc0c8,0x9fc6,0x9fc7,0x9fc8, -0xc0c9,0x9fc9,0x9fca,0x9fcb,0x9fcc,0x9fcd,0x9fce,0x9fcf, -0xc0ca,0x9fd0,0x9fd1,0xc0cb,0x9fd2,0x9fd3,0x9fd4,0x9fd5, -0x9fd6,0x9fd7,0x9fd8,0x9fd9,0xc0cc,0xc0cd,0x9fda,0x9fdb, -0xc0ce,0x9fdc,0x9fdd,0x9fde,0xc0cf,0xc0d0,0xc0d1,0x9fdf, -0x9fe0,0x9fe1,0x9fe2,0xc0d2,0xc0d3,0xc0d4,0x9fe3,0xc0d5, -0xc0d6,0xc0d7,0xc0d8,0x9fe4,0x9fe5,0x9fe6,0xc0d9,0x9fe7, -0xc0da,0xc0db,0x9fe8,0x9fe9,0xc0dc,0x9fea,0xc0dd,0xc0de, -0xc0df,0x9feb,0xc0e0,0x9fec,0x9fed,0x9fee,0x9fef,0x9ff0, -0xc0e1,0xc0e2,0x9ff1,0xc0e3,0xc0e4,0xc0e5,0xc0e6,0x9ff2, -0x9ff3,0x9ff4,0x9ff5,0x9ff6,0xc0e7,0xc0e8,0x9ff7,0x9ff8, -0xc0e9,0x9ff9,0x9ffa,0x9ffb,0xc0ea,0x9ffc,0x9ffd,0x9ffe, -0xa041,0xa042,0xa043,0xa044,0xc0eb,0xc0ec,0xa045,0xc0ed, -0xc0ee,0xc0ef,0xa046,0xa047,0xa048,0xa049,0xa04a,0xa04b, -0xc0f0,0xc0f1,0xa04c,0xa04d,0xc0f2,0xa04e,0xc0f3,0xa04f, -0xc0f4,0xa050,0xa051,0xa052,0xa053,0xa054,0xa055,0xa056, -0xc0f5,0xa057,0xa058,0xa059,0xa05a,0xc0f6,0xa061,0xa062, -0xa063,0xa064,0xa065,0xa066,0xc0f7,0xa067,0xa068,0xa069, -0xc0f8,0xa06a,0xa06b,0xa06c,0xc0f9,0xa06d,0xa06e,0xa06f, -0xa070,0xa071,0xa072,0xa073,0xa074,0xa075,0xa076,0xa077, -0xa078,0xa079,0xa07a,0xa081,0xa082,0xa083,0xa084,0xa085, -/* 0xc800 */ -0xc0fa,0xc0fb,0xa086,0xa087,0xc0fc,0xa088,0xa089,0xa08a, -0xc0fd,0xa08b,0xc0fe,0xa08c,0xa08d,0xa08e,0xa08f,0xa090, -0xc1a1,0xc1a2,0xa091,0xc1a3,0xa092,0xc1a4,0xc1a5,0xa093, -0xa094,0xa095,0xa096,0xa097,0xc1a6,0xc1a7,0xa098,0xa099, -0xc1a8,0xa09a,0xa09b,0xa09c,0xc1a9,0xa09d,0xa09e,0xa09f, -0xa0a0,0xa0a1,0xa0a2,0xa0a3,0xc1aa,0xc1ab,0xa0a4,0xc1ac, -0xa0a5,0xc1ad,0xa0a6,0xa0a7,0xa0a8,0xa0a9,0xa0aa,0xa0ab, -0xc1ae,0xa0ac,0xa0ad,0xa0ae,0xc1af,0xa0af,0xa0b0,0xa0b1, -0xc1b0,0xa0b2,0xa0b3,0xa0b4,0xa0b5,0xa0b6,0xa0b7,0xa0b8, -0xc1b1,0xc1b2,0xa0b9,0xa0ba,0xc1b3,0xc1b4,0xa0bb,0xa0bc, -0xa0bd,0xa0be,0xa0bf,0xa0c0,0xc1b5,0xa0c1,0xa0c2,0xa0c3, -0xa0c4,0xa0c5,0xa0c6,0xa0c7,0xa0c8,0xa0c9,0xa0ca,0xa0cb, -0xa0cc,0xa0cd,0xa0ce,0xa0cf,0xa0d0,0xa0d1,0xa0d2,0xa0d3, -0xa0d4,0xa0d5,0xa0d6,0xa0d7,0xa0d8,0xa0d9,0xa0da,0xa0db, -0xc1b6,0xc1b7,0xa0dc,0xa0dd,0xc1b8,0xa0de,0xa0df,0xa0e0, -0xc1b9,0xa0e1,0xc1ba,0xa0e2,0xa0e3,0xa0e4,0xa0e5,0xa0e6, -0xc1bb,0xc1bc,0xa0e7,0xc1bd,0xa0e8,0xc1be,0xc1bf,0xc1c0, -0xa0e9,0xa0ea,0xa0eb,0xc1c1,0xc1c2,0xc1c3,0xa0ec,0xa0ed, -0xa0ee,0xa0ef,0xa0f0,0xa0f1,0xc1c4,0xa0f2,0xa0f3,0xa0f4, -0xa0f5,0xa0f6,0xa0f7,0xa0f8,0xa0f9,0xc1c5,0xa0fa,0xc1c6, -0xa0fb,0xc1c7,0xa0fc,0xa0fd,0xa0fe,0xa141,0xa142,0xa143, -0xc1c8,0xa144,0xa145,0xa146,0xa147,0xa148,0xa149,0xa14a, -0xa14b,0xa14c,0xa14d,0xa14e,0xa14f,0xa150,0xa151,0xa152, -0xa153,0xa154,0xa155,0xa156,0xc1c9,0xc1ca,0xa157,0xa158, -0xa159,0xa15a,0xa161,0xa162,0xc1cb,0xa163,0xa164,0xa165, -0xc1cc,0xa166,0xa167,0xa168,0xc1cd,0xa169,0xa16a,0xa16b, -0xa16c,0xa16d,0xa16e,0xa16f,0xc1ce,0xc1cf,0xa170,0xc1d0, -0xa171,0xc1d1,0xa172,0xa173,0xa174,0xa175,0xa176,0xa177, -0xc1d2,0xc1d3,0xa178,0xa179,0xc1d4,0xa17a,0xa181,0xa182, -0xa183,0xa184,0xa185,0xa186,0xa187,0xa188,0xa189,0xa18a, -0xa18b,0xa18c,0xa18d,0xa18e,0xa18f,0xc1d5,0xa190,0xa191, -0xa192,0xa193,0xa194,0xa195,0xc1d6,0xc1d7,0xa196,0xa197, -/* 0xc900 */ -0xc1d8,0xa198,0xa199,0xa19a,0xc1d9,0xc1da,0xc1db,0xa19b, -0xa19c,0xa19d,0xa19e,0xa19f,0xc1dc,0xc1dd,0xa1a0,0xc1de, -0xa241,0xc1df,0xa242,0xa243,0xa244,0xa245,0xa246,0xa247, -0xc1e0,0xa248,0xa249,0xa24a,0xa24b,0xa24c,0xa24d,0xa24e, -0xa24f,0xa250,0xa251,0xa252,0xa253,0xa254,0xa255,0xa256, -0xa257,0xa258,0xa259,0xa25a,0xc1e1,0xa261,0xa262,0xa263, -0xa264,0xa265,0xa266,0xa267,0xc1e2,0xa268,0xa269,0xa26a, -0xa26b,0xa26c,0xa26d,0xa26e,0xa26f,0xa270,0xa271,0xa272, -0xa273,0xa274,0xa275,0xa276,0xa277,0xa278,0xa279,0xa27a, -0xa281,0xa282,0xa283,0xa284,0xa285,0xa286,0xa287,0xa288, -0xc1e3,0xc1e4,0xa289,0xa28a,0xc1e5,0xa28b,0xa28c,0xa28d, -0xc1e6,0xa28e,0xa28f,0xa290,0xa291,0xa292,0xa293,0xa294, -0xc1e7,0xc1e8,0xa295,0xc1e9,0xa296,0xa297,0xa298,0xa299, -0xa29a,0xa29b,0xa29c,0xa29d,0xc1ea,0xa29e,0xa29f,0xa2a0, -0xc1eb,0xa341,0xa342,0xa343,0xc1ec,0xa344,0xa345,0xa346, -0xa347,0xa348,0xa349,0xa34a,0xc1ed,0xa34b,0xa34c,0xa34d, -0xa34e,0xa34f,0xa350,0xa351,0xa352,0xa353,0xa354,0xa355, -0xc1ee,0xc1ef,0xa356,0xa357,0xc1f0,0xa358,0xa359,0xa35a, -0xc1f1,0xa361,0xa362,0xa363,0xa364,0xa365,0xa366,0xa367, -0xc1f2,0xc1f3,0xa368,0xc1f4,0xa369,0xc1f5,0xa36a,0xa36b, -0xa36c,0xa36d,0xa36e,0xa36f,0xa370,0xa371,0xa372,0xa373, -0xa374,0xa375,0xa376,0xa377,0xa378,0xa379,0xa37a,0xa381, -0xa382,0xa383,0xa384,0xa385,0xa386,0xa387,0xa388,0xa389, -0xa38a,0xa38b,0xa38c,0xa38d,0xa38e,0xa38f,0xa390,0xa391, -0xc1f6,0xc1f7,0xa392,0xa393,0xc1f8,0xa394,0xa395,0xc1f9, -0xc1fa,0xa396,0xc1fb,0xa397,0xa398,0xa399,0xa39a,0xa39b, -0xc1fc,0xc1fd,0xa39c,0xc1fe,0xa39d,0xc2a1,0xc2a2,0xa39e, -0xa39f,0xc2a3,0xc2a4,0xa3a0,0xc2a5,0xc2a6,0xa441,0xa442, -0xc2a7,0xa443,0xc2a8,0xa444,0xc2a9,0xa445,0xa446,0xc2aa, -0xa447,0xa448,0xa449,0xa44a,0xc2ab,0xc2ac,0xa44b,0xc2ad, -0xc2ae,0xc2af,0xa44c,0xa44d,0xa44e,0xa44f,0xa450,0xa451, -0xc2b0,0xc2b1,0xa452,0xa453,0xc2b2,0xa454,0xa455,0xa456, -/* 0xca00 */ -0xc2b3,0xa457,0xa458,0xa459,0xa45a,0xa461,0xa462,0xa463, -0xc2b4,0xc2b5,0xa464,0xc2b6,0xc2b7,0xc2b8,0xa465,0xa466, -0xa467,0xa468,0xa469,0xa46a,0xc2b9,0xa46b,0xa46c,0xa46d, -0xc2ba,0xa46e,0xa46f,0xa470,0xa471,0xa472,0xa473,0xa474, -0xa475,0xa476,0xa477,0xa478,0xa479,0xa47a,0xa481,0xa482, -0xa483,0xc2bb,0xa484,0xa485,0xa486,0xa487,0xa488,0xa489, -0xa48a,0xa48b,0xa48c,0xa48d,0xa48e,0xa48f,0xa490,0xa491, -0xa492,0xa493,0xa494,0xa495,0xa496,0xa497,0xa498,0xa499, -0xa49a,0xa49b,0xa49c,0xa49d,0xa49e,0xa49f,0xa4a0,0xa541, -0xa542,0xa543,0xa544,0xa545,0xc2bc,0xc2bd,0xa546,0xa547, -0xc2be,0xa548,0xa549,0xa54a,0xc2bf,0xa54b,0xa54c,0xa54d, -0xa54e,0xa54f,0xa550,0xa551,0xc2c0,0xc2c1,0xa552,0xc2c2, -0xc2c3,0xc2c4,0xa553,0xa554,0xa555,0xa556,0xa557,0xa558, -0xc2c5,0xa559,0xa55a,0xa561,0xa562,0xa563,0xa564,0xa565, -0xa566,0xa567,0xa568,0xa569,0xa56a,0xa56b,0xa56c,0xa56d, -0xa56e,0xa56f,0xa570,0xa571,0xa572,0xc2c6,0xa573,0xa574, -0xa575,0xa576,0xa577,0xa578,0xc2c7,0xa579,0xa57a,0xa581, -0xa582,0xa583,0xa584,0xa585,0xa586,0xa587,0xa588,0xa589, -0xa58a,0xa58b,0xa58c,0xa58d,0xa58e,0xa58f,0xa590,0xa591, -0xc2c8,0xa592,0xa593,0xa594,0xa595,0xa596,0xa597,0xa598, -0xa599,0xa59a,0xa59b,0xa59c,0xa59d,0xa59e,0xa59f,0xa5a0, -0xa641,0xa642,0xa643,0xa644,0xa645,0xa646,0xa647,0xa648, -0xa649,0xa64a,0xa64b,0xa64c,0xa64d,0xa64e,0xa64f,0xa650, -0xa651,0xa652,0xa653,0xa654,0xc2c9,0xc2ca,0xa655,0xa656, -0xc2cb,0xa657,0xa658,0xa659,0xc2cc,0xa65a,0xa661,0xa662, -0xa663,0xa664,0xa665,0xa666,0xc2cd,0xc2ce,0xa667,0xc2cf, -0xa668,0xc2d0,0xa669,0xc2d1,0xa66a,0xa66b,0xa66c,0xa66d, -0xc2d2,0xc2d3,0xa66e,0xa66f,0xa670,0xa671,0xa672,0xa673, -0xc2d4,0xa674,0xa675,0xa676,0xa677,0xa678,0xa679,0xa67a, -0xa681,0xa682,0xa683,0xa684,0xc2d5,0xa685,0xa686,0xa687, -0xa688,0xa689,0xa68a,0xa68b,0xc2d6,0xa68c,0xa68d,0xa68e, -0xa68f,0xa690,0xa691,0xa692,0xa693,0xa694,0xa695,0xa696, -/* 0xcb00 */ -0xa697,0xa698,0xa699,0xa69a,0xa69b,0xa69c,0xa69d,0xa69e, -0xc2d7,0xa69f,0xa6a0,0xa741,0xa742,0xa743,0xa744,0xa745, -0xc2d8,0xa746,0xa747,0xa748,0xc2d9,0xa749,0xa74a,0xa74b, -0xc2da,0xa74c,0xa74d,0xa74e,0xa74f,0xa750,0xa751,0xa752, -0xc2db,0xc2dc,0xa753,0xa754,0xa755,0xa756,0xa757,0xa758, -0xa759,0xa75a,0xa761,0xa762,0xa763,0xa764,0xa765,0xa766, -0xa767,0xa768,0xa769,0xa76a,0xa76b,0xa76c,0xa76d,0xa76e, -0xa76f,0xa770,0xa771,0xa772,0xa773,0xa774,0xa775,0xa776, -0xa777,0xc2dd,0xa778,0xa779,0xa77a,0xa781,0xa782,0xa783, -0xc2de,0xc2df,0xa784,0xa785,0xc2e0,0xa786,0xa787,0xa788, -0xc2e1,0xa789,0xa78a,0xa78b,0xa78c,0xa78d,0xa78e,0xa78f, -0xc2e2,0xc2e3,0xa790,0xa791,0xa792,0xc2e4,0xa793,0xa794, -0xa795,0xa796,0xa797,0xa798,0xc2e5,0xa799,0xa79a,0xa79b, -0xa79c,0xa79d,0xa79e,0xa79f,0xa7a0,0xa841,0xa842,0xa843, -0xa844,0xa845,0xa846,0xa847,0xa848,0xa849,0xa84a,0xa84b, -0xc2e6,0xc2e7,0xa84c,0xa84d,0xa84e,0xa84f,0xa850,0xa851, -0xa852,0xa853,0xa854,0xa855,0xa856,0xa857,0xa858,0xa859, -0xa85a,0xa861,0xa862,0xa863,0xa864,0xa865,0xa866,0xa867, -0xa868,0xa869,0xa86a,0xa86b,0xa86c,0xa86d,0xa86e,0xa86f, -0xa870,0xa871,0xa872,0xa873,0xc2e8,0xa874,0xa875,0xa876, -0xa877,0xa878,0xa879,0xa87a,0xa881,0xa882,0xa883,0xa884, -0xa885,0xa886,0xa887,0xa888,0xa889,0xa88a,0xa88b,0xa88c, -0xa88d,0xa88e,0xa88f,0xa890,0xa891,0xa892,0xa893,0xa894, -0xc2e9,0xa895,0xa896,0xa897,0xa898,0xa899,0xa89a,0xa89b, -0xa89c,0xa89d,0xa89e,0xa89f,0xa8a0,0xa941,0xa942,0xa943, -0xa944,0xa945,0xa946,0xa947,0xa948,0xa949,0xa94a,0xa94b, -0xa94c,0xa94d,0xa94e,0xa94f,0xc2ea,0xa950,0xa951,0xa952, -0xa953,0xa954,0xa955,0xa956,0xa957,0xa958,0xa959,0xa95a, -0xa961,0xa962,0xa963,0xa964,0xc2eb,0xa965,0xa966,0xc2ec, -0xa967,0xc2ed,0xa968,0xa969,0xa96a,0xa96b,0xa96c,0xa96d, -0xa96e,0xa96f,0xa970,0xa971,0xa972,0xa973,0xa974,0xa975, -0xa976,0xa977,0xa978,0xa979,0xa97a,0xa981,0xa982,0xa983, -/* 0xcc00 */ -0xa984,0xa985,0xa986,0xa987,0xa988,0xa989,0xa98a,0xa98b, -0xa98c,0xa98d,0xa98e,0xa98f,0xc2ee,0xc2ef,0xa990,0xa991, -0xc2f0,0xa992,0xa993,0xa994,0xc2f1,0xa995,0xa996,0xa997, -0xa998,0xa999,0xa99a,0xa99b,0xc2f2,0xc2f3,0xa99c,0xa99d, -0xa99e,0xc2f4,0xc2f5,0xa99f,0xa9a0,0xaa41,0xaa42,0xc2f6, -0xc2f7,0xc2f8,0xaa43,0xaa44,0xc2f9,0xaa45,0xc2fa,0xaa46, -0xc2fb,0xaa47,0xaa48,0xaa49,0xaa4a,0xaa4b,0xaa4c,0xaa4d, -0xc2fc,0xc2fd,0xaa4e,0xc2fe,0xc3a1,0xc3a2,0xc3a3,0xaa4f, -0xaa50,0xaa51,0xaa52,0xaa53,0xc3a4,0xc3a5,0xaa54,0xaa55, -0xc3a6,0xaa56,0xaa57,0xaa58,0xc3a7,0xaa59,0xaa5a,0xaa61, -0xaa62,0xaa63,0xaa64,0xaa65,0xc3a8,0xc3a9,0xaa66,0xc3aa, -0xc3ab,0xc3ac,0xaa67,0xaa68,0xaa69,0xaa6a,0xaa6b,0xaa6c, -0xc3ad,0xaa6d,0xaa6e,0xaa6f,0xc3ae,0xaa70,0xc3af,0xaa71, -0xc3b0,0xaa72,0xaa73,0xaa74,0xaa75,0xaa76,0xaa77,0xaa78, -0xc3b1,0xaa79,0xaa7a,0xaa81,0xaa82,0xc3b2,0xaa83,0xaa84, -0xaa85,0xaa86,0xaa87,0xaa88,0xaa89,0xaa8a,0xaa8b,0xaa8c, -0xaa8d,0xaa8e,0xaa8f,0xaa90,0xaa91,0xaa92,0xaa93,0xaa94, -0xaa95,0xaa96,0xaa97,0xaa98,0xaa99,0xaa9a,0xaa9b,0xaa9c, -0xaa9d,0xaa9e,0xaa9f,0xaaa0,0xab41,0xab42,0xab43,0xab44, -0xc3b3,0xc3b4,0xab45,0xab46,0xc3b5,0xab47,0xab48,0xab49, -0xc3b6,0xab4a,0xab4b,0xab4c,0xab4d,0xab4e,0xab4f,0xab50, -0xc3b7,0xc3b8,0xab51,0xc3b9,0xc3ba,0xc3bb,0xab52,0xab53, -0xab54,0xab55,0xab56,0xab57,0xc3bc,0xc3bd,0xab58,0xab59, -0xc3be,0xab5a,0xab61,0xab62,0xc3bf,0xab63,0xab64,0xab65, -0xab66,0xab67,0xab68,0xab69,0xc3c0,0xc3c1,0xab6a,0xc3c2, -0xab6b,0xc3c3,0xab6c,0xab6d,0xab6e,0xab6f,0xab70,0xab71, -0xc3c4,0xab72,0xab73,0xab74,0xc3c5,0xab75,0xab76,0xab77, -0xab78,0xab79,0xab7a,0xab81,0xab82,0xab83,0xab84,0xab85, -0xab86,0xab87,0xab88,0xab89,0xc3c6,0xab8a,0xab8b,0xab8c, -0xab8d,0xab8e,0xab8f,0xab90,0xc3c7,0xab91,0xab92,0xab93, -0xc3c8,0xab94,0xab95,0xab96,0xab97,0xab98,0xab99,0xab9a, -0xab9b,0xab9c,0xab9d,0xab9e,0xab9f,0xaba0,0xac41,0xac42, -/* 0xcd00 */ -0xac43,0xc3c9,0xac44,0xac45,0xac46,0xac47,0xac48,0xac49, -0xc3ca,0xc3cb,0xac4a,0xac4b,0xc3cc,0xac4c,0xac4d,0xac4e, -0xc3cd,0xac4f,0xac50,0xac51,0xac52,0xac53,0xac54,0xac55, -0xc3ce,0xc3cf,0xac56,0xc3d0,0xac57,0xc3d1,0xac58,0xac59, -0xac5a,0xac61,0xac62,0xac63,0xc3d2,0xac64,0xac65,0xac66, -0xc3d3,0xac67,0xac68,0xac69,0xc3d4,0xac6a,0xac6b,0xac6c, -0xac6d,0xac6e,0xac6f,0xac70,0xac71,0xac72,0xac73,0xac74, -0xac75,0xc3d5,0xac76,0xac77,0xac78,0xac79,0xac7a,0xac81, -0xac82,0xac83,0xac84,0xac85,0xac86,0xac87,0xac88,0xac89, -0xac8a,0xac8b,0xac8c,0xac8d,0xac8e,0xac8f,0xac90,0xac91, -0xac92,0xac93,0xac94,0xac95,0xac96,0xac97,0xac98,0xac99, -0xac9a,0xac9b,0xac9c,0xac9d,0xc3d6,0xac9e,0xac9f,0xaca0, -0xc3d7,0xad41,0xad42,0xad43,0xc3d8,0xad44,0xad45,0xad46, -0xad47,0xad48,0xad49,0xad4a,0xc3d9,0xc3da,0xad4b,0xc3db, -0xad4c,0xc3dc,0xad4d,0xad4e,0xad4f,0xad50,0xad51,0xad52, -0xc3dd,0xad53,0xad54,0xad55,0xad56,0xad57,0xad58,0xad59, -0xad5a,0xad61,0xad62,0xad63,0xad64,0xad65,0xad66,0xad67, -0xc3de,0xad68,0xad69,0xad6a,0xad6b,0xad6c,0xad6d,0xad6e, -0xad6f,0xad70,0xad71,0xad72,0xc3df,0xc3e0,0xad73,0xad74, -0xc3e1,0xad75,0xad76,0xad77,0xc3e2,0xad78,0xad79,0xad7a, -0xad81,0xad82,0xad83,0xad84,0xc3e3,0xc3e4,0xad85,0xc3e5, -0xad86,0xc3e6,0xad87,0xad88,0xad89,0xad8a,0xad8b,0xad8c, -0xc3e7,0xad8d,0xad8e,0xad8f,0xad90,0xad91,0xad92,0xad93, -0xad94,0xad95,0xad96,0xad97,0xad98,0xad99,0xad9a,0xad9b, -0xad9c,0xad9d,0xad9e,0xad9f,0xc3e8,0xada0,0xae41,0xae42, -0xae43,0xae44,0xae45,0xae46,0xc3e9,0xae47,0xae48,0xae49, -0xc3ea,0xae4a,0xae4b,0xae4c,0xae4d,0xae4e,0xae4f,0xae50, -0xae51,0xae52,0xae53,0xae54,0xae55,0xae56,0xae57,0xae58, -0xae59,0xae5a,0xae61,0xae62,0xae63,0xae64,0xae65,0xae66, -0xc3eb,0xae67,0xae68,0xae69,0xc3ec,0xae6a,0xae6b,0xae6c, -0xc3ed,0xae6d,0xae6e,0xae6f,0xae70,0xae71,0xae72,0xae73, -0xc3ee,0xc3ef,0xae74,0xc3f0,0xae75,0xc3f1,0xae76,0xae77, -/* 0xce00 */ -0xae78,0xae79,0xae7a,0xae81,0xc3f2,0xae82,0xae83,0xae84, -0xc3f3,0xae85,0xae86,0xae87,0xc3f4,0xae88,0xae89,0xae8a, -0xae8b,0xae8c,0xae8d,0xae8e,0xc3f5,0xae8f,0xae90,0xae91, -0xae92,0xc3f6,0xae93,0xae94,0xae95,0xae96,0xae97,0xae98, -0xc3f7,0xc3f8,0xae99,0xae9a,0xc3f9,0xae9b,0xae9c,0xae9d, -0xc3fa,0xae9e,0xae9f,0xaea0,0xaf41,0xaf42,0xaf43,0xaf44, -0xc3fb,0xc3fc,0xaf45,0xc3fd,0xaf46,0xc3fe,0xaf47,0xaf48, -0xaf49,0xaf4a,0xaf4b,0xaf4c,0xaf4d,0xaf4e,0xaf4f,0xaf50, -0xaf51,0xaf52,0xaf53,0xaf54,0xaf55,0xaf56,0xaf57,0xaf58, -0xaf59,0xaf5a,0xaf61,0xaf62,0xaf63,0xaf64,0xaf65,0xaf66, -0xaf67,0xaf68,0xaf69,0xaf6a,0xaf6b,0xaf6c,0xaf6d,0xaf6e, -0xc4a1,0xc4a2,0xaf6f,0xaf70,0xc4a3,0xaf71,0xaf72,0xc4a4, -0xc4a5,0xc4a6,0xaf73,0xaf74,0xaf75,0xaf76,0xaf77,0xaf78, -0xc4a7,0xc4a8,0xaf79,0xc4a9,0xaf7a,0xc4aa,0xaf81,0xaf82, -0xaf83,0xaf84,0xaf85,0xaf86,0xc4ab,0xc4ac,0xaf87,0xaf88, -0xc4ad,0xaf89,0xaf8a,0xaf8b,0xc4ae,0xaf8c,0xaf8d,0xaf8e, -0xaf8f,0xaf90,0xaf91,0xaf92,0xc4af,0xc4b0,0xaf93,0xc4b1, -0xaf94,0xc4b2,0xaf95,0xaf96,0xaf97,0xaf98,0xaf99,0xaf9a, -0xc4b3,0xc4b4,0xaf9b,0xaf9c,0xc4b5,0xaf9d,0xaf9e,0xaf9f, -0xc4b6,0xafa0,0xb041,0xb042,0xb043,0xb044,0xb045,0xb046, -0xc4b7,0xc4b8,0xb047,0xc4b9,0xc4ba,0xc4bb,0xb048,0xb049, -0xb04a,0xb04b,0xb04c,0xb04d,0xc4bc,0xc4bd,0xb04e,0xb04f, -0xb050,0xb051,0xb052,0xb053,0xb054,0xb055,0xb056,0xb057, -0xb058,0xb059,0xb05a,0xb061,0xb062,0xb063,0xb064,0xb065, -0xb066,0xc4be,0xb067,0xb068,0xb069,0xb06a,0xb06b,0xb06c, -0xb06d,0xb06e,0xb06f,0xb070,0xb071,0xb072,0xb073,0xb074, -0xb075,0xb076,0xb077,0xb078,0xb079,0xb07a,0xb081,0xb082, -0xb083,0xb084,0xb085,0xb086,0xb087,0xb088,0xb089,0xb08a, -0xb08b,0xb08c,0xb08d,0xb08e,0xc4bf,0xc4c0,0xb08f,0xb090, -0xc4c1,0xb091,0xb092,0xc4c2,0xc4c3,0xb093,0xb094,0xb095, -0xb096,0xb097,0xb098,0xb099,0xc4c4,0xc4c5,0xb09a,0xc4c6, -0xc4c7,0xc4c8,0xb09b,0xb09c,0xb09d,0xb09e,0xb09f,0xb0a0, -/* 0xcf00 */ -0xc4c9,0xc4ca,0xb141,0xb142,0xc4cb,0xb143,0xb144,0xb145, -0xc4cc,0xb146,0xb147,0xb148,0xb149,0xb14a,0xb14b,0xb14c, -0xc4cd,0xc4ce,0xb14d,0xc4cf,0xb14e,0xc4d0,0xb14f,0xb150, -0xb151,0xb152,0xb153,0xb154,0xc4d1,0xb155,0xb156,0xb157, -0xc4d2,0xb158,0xb159,0xb15a,0xc4d3,0xb161,0xb162,0xb163, -0xb164,0xb165,0xb166,0xb167,0xc4d4,0xc4d5,0xb168,0xc4d6, -0xc4d7,0xc4d8,0xb169,0xb16a,0xb16b,0xb16c,0xb16d,0xb16e, -0xc4d9,0xb16f,0xb170,0xb171,0xb172,0xb173,0xb174,0xb175, -0xb176,0xb177,0xb178,0xb179,0xb17a,0xb181,0xb182,0xb183, -0xb184,0xb185,0xb186,0xb187,0xb188,0xb189,0xb18a,0xb18b, -0xb18c,0xb18d,0xb18e,0xb18f,0xc4da,0xc4db,0xb190,0xb191, -0xc4dc,0xb192,0xb193,0xb194,0xc4dd,0xb195,0xb196,0xb197, -0xb198,0xb199,0xb19a,0xb19b,0xc4de,0xc4df,0xb19c,0xc4e0, -0xb19d,0xc4e1,0xb19e,0xb19f,0xb1a0,0xb241,0xb242,0xb243, -0xc4e2,0xc4e3,0xb244,0xb245,0xc4e4,0xb246,0xb247,0xb248, -0xc4e5,0xb249,0xb24a,0xb24b,0xb24c,0xb24d,0xb24e,0xb24f, -0xc4e6,0xb250,0xb251,0xb252,0xb253,0xc4e7,0xb254,0xb255, -0xb256,0xb257,0xb258,0xb259,0xc4e8,0xb25a,0xb261,0xb262, -0xb263,0xb264,0xb265,0xb266,0xb267,0xb268,0xb269,0xb26a, -0xb26b,0xb26c,0xb26d,0xb26e,0xb26f,0xb270,0xb271,0xb272, -0xb273,0xc4e9,0xb274,0xb275,0xb276,0xb277,0xb278,0xb279, -0xc4ea,0xb27a,0xb281,0xb282,0xb283,0xb284,0xb285,0xb286, -0xc4eb,0xb287,0xb288,0xb289,0xb28a,0xb28b,0xb28c,0xb28d, -0xb28e,0xb28f,0xb290,0xb291,0xb292,0xb293,0xb294,0xb295, -0xb296,0xb297,0xb298,0xb299,0xc4ec,0xb29a,0xb29b,0xb29c, -0xb29d,0xb29e,0xb29f,0xb2a0,0xb341,0xb342,0xb343,0xb344, -0xb345,0xb346,0xb347,0xb348,0xb349,0xb34a,0xb34b,0xb34c, -0xb34d,0xb34e,0xb34f,0xb350,0xb351,0xb352,0xb353,0xb354, -0xc4ed,0xc4ee,0xb355,0xb356,0xc4ef,0xb357,0xb358,0xb359, -0xc4f0,0xb35a,0xb361,0xb362,0xb363,0xb364,0xb365,0xb366, -0xc4f1,0xc4f2,0xb367,0xc4f3,0xb368,0xc4f4,0xb369,0xb36a, -0xb36b,0xb36c,0xb36d,0xb36e,0xc4f5,0xb36f,0xb370,0xb371, -/* 0xd000 */ -0xc4f6,0xb372,0xb373,0xb374,0xc4f7,0xb375,0xb376,0xb377, -0xb378,0xb379,0xb37a,0xb381,0xb382,0xb383,0xb384,0xb385, -0xb386,0xc4f8,0xb387,0xb388,0xb389,0xb38a,0xb38b,0xb38c, -0xc4f9,0xb38d,0xb38e,0xb38f,0xb390,0xb391,0xb392,0xb393, -0xb394,0xb395,0xb396,0xb397,0xb398,0xb399,0xb39a,0xb39b, -0xb39c,0xb39d,0xb39e,0xb39f,0xb3a0,0xc4fa,0xb441,0xb442, -0xb443,0xb444,0xb445,0xb446,0xc4fb,0xc4fc,0xb447,0xb448, -0xc4fd,0xb449,0xb44a,0xb44b,0xc4fe,0xb44c,0xb44d,0xb44e, -0xb44f,0xb450,0xb451,0xb452,0xc5a1,0xc5a2,0xb453,0xc5a3, -0xb454,0xc5a4,0xb455,0xb456,0xb457,0xb458,0xb459,0xb45a, -0xc5a5,0xb461,0xb462,0xb463,0xc5a6,0xb464,0xb465,0xb466, -0xc5a7,0xb467,0xb468,0xb469,0xb46a,0xb46b,0xb46c,0xb46d, -0xc5a8,0xb46e,0xb46f,0xb470,0xb471,0xb472,0xb473,0xb474, -0xb475,0xb476,0xb477,0xb478,0xc5a9,0xc5aa,0xb479,0xb47a, -0xc5ab,0xb481,0xb482,0xb483,0xc5ac,0xb484,0xb485,0xb486, -0xb487,0xb488,0xb489,0xb48a,0xc5ad,0xc5ae,0xb48b,0xb48c, -0xb48d,0xc5af,0xb48e,0xb48f,0xb490,0xb491,0xb492,0xb493, -0xb494,0xb495,0xb496,0xb497,0xb498,0xb499,0xb49a,0xb49b, -0xb49c,0xb49d,0xb49e,0xb49f,0xb4a0,0xb541,0xb542,0xb543, -0xb544,0xb545,0xb546,0xb547,0xb548,0xb549,0xb54a,0xb54b, -0xb54c,0xb54d,0xb54e,0xb54f,0xc5b0,0xc5b1,0xb550,0xb551, -0xc5b2,0xb552,0xb553,0xb554,0xc5b3,0xb555,0xb556,0xb557, -0xb558,0xb559,0xb55a,0xb561,0xc5b4,0xc5b5,0xb562,0xc5b6, -0xb563,0xc5b7,0xb564,0xb565,0xb566,0xb567,0xb568,0xb569, -0xc5b8,0xc5b9,0xb56a,0xb56b,0xc5ba,0xb56c,0xb56d,0xb56e, -0xc5bb,0xc5bc,0xb56f,0xb570,0xb571,0xb572,0xb573,0xb574, -0xc5bd,0xc5be,0xb575,0xc5bf,0xc5c0,0xc5c1,0xb576,0xb577, -0xb578,0xb579,0xb57a,0xb581,0xc5c2,0xc5c3,0xb582,0xb583, -0xc5c4,0xb584,0xb585,0xb586,0xc5c5,0xb587,0xb588,0xb589, -0xb58a,0xb58b,0xb58c,0xb58d,0xc5c6,0xc5c7,0xb58e,0xc5c8, -0xc5c9,0xc5ca,0xb58f,0xb590,0xb591,0xb592,0xb593,0xb594, -0xc5cb,0xb595,0xb596,0xb597,0xb598,0xb599,0xb59a,0xb59b, -/* 0xd100 */ -0xb59c,0xb59d,0xb59e,0xb59f,0xb5a0,0xb641,0xb642,0xb643, -0xb644,0xb645,0xb646,0xb647,0xb648,0xc5cc,0xb649,0xb64a, -0xb64b,0xb64c,0xb64d,0xb64e,0xb64f,0xb650,0xb651,0xb652, -0xb653,0xb654,0xb655,0xb656,0xb657,0xb658,0xb659,0xb65a, -0xb661,0xb662,0xb663,0xb664,0xb665,0xb666,0xb667,0xb668, -0xb669,0xb66a,0xb66b,0xb66c,0xb66d,0xb66e,0xb66f,0xb670, -0xc5cd,0xc5ce,0xb671,0xb672,0xc5cf,0xb673,0xb674,0xb675, -0xc5d0,0xb676,0xc5d1,0xb677,0xb678,0xb679,0xb67a,0xb681, -0xc5d2,0xc5d3,0xb682,0xc5d4,0xc5d5,0xc5d6,0xb683,0xb684, -0xb685,0xb686,0xb687,0xb688,0xc5d7,0xc5d8,0xb689,0xb68a, -0xc5d9,0xb68b,0xb68c,0xb68d,0xc5da,0xb68e,0xb68f,0xb690, -0xb691,0xb692,0xb693,0xb694,0xc5db,0xc5dc,0xb695,0xc5dd, -0xb696,0xc5de,0xb697,0xb698,0xb699,0xb69a,0xb69b,0xb69c, -0xc5df,0xb69d,0xb69e,0xb69f,0xc5e0,0xb6a0,0xb741,0xb742, -0xb743,0xb744,0xb745,0xb746,0xb747,0xb748,0xb749,0xb74a, -0xb74b,0xb74c,0xb74d,0xb74e,0xc5e1,0xb74f,0xb750,0xb751, -0xb752,0xb753,0xb754,0xb755,0xc5e2,0xb756,0xb757,0xb758, -0xc5e3,0xb759,0xb75a,0xb761,0xb762,0xb763,0xb764,0xb765, -0xb766,0xb767,0xb768,0xb769,0xb76a,0xb76b,0xb76c,0xb76d, -0xb76e,0xb76f,0xb770,0xb771,0xb772,0xb773,0xb774,0xb775, -0xc5e4,0xc5e5,0xb776,0xb777,0xc5e6,0xb778,0xb779,0xb77a, -0xc5e7,0xb781,0xb782,0xb783,0xb784,0xb785,0xb786,0xb787, -0xc5e8,0xc5e9,0xb788,0xc5ea,0xb789,0xc5eb,0xb78a,0xb78b, -0xb78c,0xb78d,0xc5ec,0xb78e,0xc5ed,0xb78f,0xb790,0xb791, -0xc5ee,0xb792,0xb793,0xb794,0xb795,0xb796,0xb797,0xb798, -0xb799,0xb79a,0xb79b,0xb79c,0xb79d,0xb79e,0xb79f,0xb7a0, -0xb841,0xb842,0xb843,0xb844,0xb845,0xb846,0xb847,0xb848, -0xc5ef,0xb849,0xb84a,0xb84b,0xb84c,0xb84d,0xb84e,0xb84f, -0xb850,0xb851,0xb852,0xb853,0xb854,0xb855,0xb856,0xb857, -0xb858,0xb859,0xb85a,0xb861,0xb862,0xb863,0xb864,0xb865, -0xb866,0xb867,0xb868,0xb869,0xc5f0,0xb86a,0xb86b,0xb86c, -0xc5f1,0xb86d,0xb86e,0xb86f,0xb870,0xb871,0xb872,0xb873, -/* 0xd200 */ -0xb874,0xb875,0xb876,0xb877,0xb878,0xb879,0xb87a,0xc5f2, -0xb881,0xc5f3,0xb882,0xb883,0xb884,0xb885,0xb886,0xb887, -0xc5f4,0xb888,0xb889,0xb88a,0xb88b,0xb88c,0xb88d,0xb88e, -0xb88f,0xb890,0xb891,0xb892,0xb893,0xb894,0xb895,0xb896, -0xb897,0xb898,0xb899,0xb89a,0xb89b,0xb89c,0xb89d,0xb89e, -0xb89f,0xb8a0,0xb941,0xb942,0xc5f5,0xc5f6,0xb943,0xb944, -0xc5f7,0xb945,0xb946,0xb947,0xc5f8,0xb948,0xb949,0xb94a, -0xb94b,0xb94c,0xb94d,0xb94e,0xc5f9,0xc5fa,0xb94f,0xc5fb, -0xb950,0xc5fc,0xb951,0xb952,0xb953,0xb954,0xb955,0xb956, -0xc5fd,0xb957,0xb958,0xb959,0xb95a,0xb961,0xb962,0xb963, -0xb964,0xb965,0xb966,0xb967,0xb968,0xb969,0xb96a,0xb96b, -0xb96c,0xb96d,0xb96e,0xb96f,0xc5fe,0xb970,0xb971,0xb972, -0xb973,0xb974,0xb975,0xb976,0xc6a1,0xb977,0xb978,0xb979, -0xb97a,0xb981,0xb982,0xb983,0xb984,0xb985,0xb986,0xb987, -0xb988,0xb989,0xb98a,0xb98b,0xb98c,0xb98d,0xb98e,0xb98f, -0xb990,0xb991,0xb992,0xb993,0xb994,0xb995,0xb996,0xb997, -0xc6a2,0xc6a3,0xb998,0xb999,0xc6a4,0xb99a,0xb99b,0xb99c, -0xc6a5,0xb99d,0xb99e,0xb99f,0xb9a0,0xba41,0xba42,0xba43, -0xc6a6,0xc6a7,0xba44,0xba45,0xba46,0xc6a8,0xba47,0xba48, -0xba49,0xba4a,0xba4b,0xba4c,0xc6a9,0xba4d,0xba4e,0xba4f, -0xc6aa,0xba50,0xba51,0xba52,0xc6ab,0xba53,0xba54,0xba55, -0xba56,0xba57,0xba58,0xba59,0xc6ac,0xba5a,0xba61,0xba62, -0xba63,0xc6ad,0xba64,0xba65,0xba66,0xba67,0xba68,0xba69, -0xc6ae,0xc6af,0xba6a,0xba6b,0xc6b0,0xba6c,0xba6d,0xc6b1, -0xc6b2,0xba6e,0xc6b3,0xba6f,0xba70,0xba71,0xba72,0xba73, -0xc6b4,0xc6b5,0xba74,0xc6b6,0xba75,0xba76,0xba77,0xba78, -0xba79,0xba7a,0xba81,0xba82,0xc6b7,0xba83,0xba84,0xba85, -0xc6b8,0xba86,0xba87,0xba88,0xc6b9,0xba89,0xba8a,0xba8b, -0xba8c,0xba8d,0xba8e,0xba8f,0xc6ba,0xc6bb,0xba90,0xba91, -0xba92,0xba93,0xba94,0xba95,0xba96,0xba97,0xba98,0xba99, -0xc6bc,0xc6bd,0xba9a,0xba9b,0xc6be,0xba9c,0xba9d,0xba9e, -0xc6bf,0xba9f,0xbaa0,0xbb41,0xbb42,0xbb43,0xbb44,0xbb45, -/* 0xd300 */ -0xc6c0,0xc6c1,0xbb46,0xc6c2,0xbb47,0xc6c3,0xbb48,0xbb49, -0xbb4a,0xbb4b,0xbb4c,0xbb4d,0xc6c4,0xc6c5,0xc6c6,0xbb4e, -0xc6c7,0xbb4f,0xbb50,0xbb51,0xc6c8,0xbb52,0xc6c9,0xbb53, -0xbb54,0xbb55,0xbb56,0xbb57,0xc6ca,0xc6cb,0xbb58,0xc6cc, -0xc6cd,0xc6ce,0xbb59,0xbb5a,0xbb61,0xc6cf,0xbb62,0xbb63, -0xc6d0,0xc6d1,0xbb64,0xbb65,0xc6d2,0xbb66,0xbb67,0xbb68, -0xc6d3,0xbb69,0xbb6a,0xbb6b,0xbb6c,0xbb6d,0xbb6e,0xbb6f, -0xc6d4,0xc6d5,0xbb70,0xc6d6,0xc6d7,0xc6d8,0xbb71,0xbb72, -0xbb73,0xbb74,0xbb75,0xbb76,0xc6d9,0xc6da,0xbb77,0xbb78, -0xbb79,0xbb7a,0xbb81,0xbb82,0xbb83,0xbb84,0xbb85,0xbb86, -0xbb87,0xbb88,0xbb89,0xbb8a,0xbb8b,0xbb8c,0xbb8d,0xbb8e, -0xbb8f,0xbb90,0xbb91,0xbb92,0xbb93,0xbb94,0xbb95,0xbb96, -0xbb97,0xbb98,0xbb99,0xbb9a,0xbb9b,0xbb9c,0xbb9d,0xbb9e, -0xbb9f,0xbba0,0xbc41,0xbc42,0xbc43,0xbc44,0xbc45,0xbc46, -0xbc47,0xbc48,0xbc49,0xbc4a,0xbc4b,0xbc4c,0xbc4d,0xbc4e, -0xbc4f,0xbc50,0xbc51,0xbc52,0xc6db,0xc6dc,0xbc53,0xbc54, -0xc6dd,0xbc55,0xbc56,0xbc57,0xc6de,0xbc58,0xbc59,0xbc5a, -0xbc61,0xbc62,0xbc63,0xbc64,0xc6df,0xc6e0,0xbc65,0xc6e1, -0xc6e2,0xc6e3,0xbc66,0xbc67,0xbc68,0xbc69,0xbc6a,0xbc6b, -0xc6e4,0xc6e5,0xbc6c,0xbc6d,0xc6e6,0xbc6e,0xbc6f,0xbc70, -0xc6e7,0xbc71,0xbc72,0xbc73,0xbc74,0xbc75,0xbc76,0xbc77, -0xc6e8,0xc6e9,0xbc78,0xc6ea,0xbc79,0xc6eb,0xbc7a,0xbc81, -0xbc82,0xbc83,0xbc84,0xbc85,0xc6ec,0xbc86,0xbc87,0xbc88, -0xc6ed,0xbc89,0xbc8a,0xbc8b,0xc6ee,0xbc8c,0xbc8d,0xbc8e, -0xbc8f,0xbc90,0xbc91,0xbc92,0xc6ef,0xc6f0,0xbc93,0xbc94, -0xc6f1,0xc6f2,0xbc95,0xbc96,0xbc97,0xbc98,0xbc99,0xbc9a, -0xc6f3,0xbc9b,0xbc9c,0xbc9d,0xbc9e,0xbc9f,0xbca0,0xbd41, -0xc6f4,0xbd42,0xbd43,0xbd44,0xbd45,0xbd46,0xbd47,0xbd48, -0xbd49,0xc6f5,0xbd4a,0xc6f6,0xbd4b,0xbd4c,0xbd4d,0xbd4e, -0xbd4f,0xbd50,0xbd51,0xbd52,0xc6f7,0xc6f8,0xbd53,0xbd54, -0xc6f9,0xbd55,0xbd56,0xbd57,0xc6fa,0xbd58,0xbd59,0xbd5a, -0xbd61,0xbd62,0xbd63,0xbd64,0xc6fb,0xc6fc,0xbd65,0xc6fd, -/* 0xd400 */ -0xbd66,0xc6fe,0xbd67,0xbd68,0xbd69,0xbd6a,0xbd6b,0xbd6c, -0xc7a1,0xbd6d,0xbd6e,0xbd6f,0xbd70,0xbd71,0xbd72,0xbd73, -0xbd74,0xbd75,0xbd76,0xbd77,0xbd78,0xbd79,0xbd7a,0xbd81, -0xbd82,0xbd83,0xbd84,0xbd85,0xbd86,0xc7a2,0xbd87,0xbd88, -0xbd89,0xbd8a,0xbd8b,0xbd8c,0xbd8d,0xbd8e,0xbd8f,0xbd90, -0xbd91,0xbd92,0xbd93,0xbd94,0xbd95,0xbd96,0xbd97,0xbd98, -0xbd99,0xbd9a,0xbd9b,0xbd9c,0xbd9d,0xbd9e,0xbd9f,0xbda0, -0xbe41,0xbe42,0xbe43,0xbe44,0xbe45,0xbe46,0xbe47,0xbe48, -0xc7a3,0xbe49,0xbe4a,0xbe4b,0xc7a4,0xbe4c,0xbe4d,0xbe4e, -0xbe4f,0xbe50,0xbe51,0xbe52,0xbe53,0xbe54,0xbe55,0xbe56, -0xbe57,0xbe58,0xbe59,0xbe5a,0xbe61,0xbe62,0xbe63,0xbe64, -0xbe65,0xbe66,0xbe67,0xbe68,0xc7a5,0xbe69,0xbe6a,0xbe6b, -0xc7a6,0xbe6c,0xbe6d,0xbe6e,0xc7a7,0xbe6f,0xbe70,0xbe71, -0xbe72,0xbe73,0xbe74,0xbe75,0xbe76,0xc7a8,0xbe77,0xc7a9, -0xbe78,0xbe79,0xbe7a,0xbe81,0xbe82,0xbe83,0xbe84,0xbe85, -0xc7aa,0xc7ab,0xbe86,0xbe87,0xc7ac,0xbe88,0xbe89,0xc7ad, -0xc7ae,0xbe8a,0xc7af,0xbe8b,0xbe8c,0xbe8d,0xbe8e,0xbe8f, -0xc7b0,0xc7b1,0xbe90,0xc7b2,0xbe91,0xc7b3,0xbe92,0xbe93, -0xbe94,0xbe95,0xbe96,0xbe97,0xc7b4,0xbe98,0xbe99,0xbe9a, -0xbe9b,0xbe9c,0xbe9d,0xbe9e,0xbe9f,0xbea0,0xbf41,0xbf42, -0xbf43,0xbf44,0xbf45,0xbf46,0xbf47,0xbf48,0xbf49,0xbf4a, -0xbf4b,0xc7b5,0xbf4c,0xbf4d,0xbf4e,0xbf4f,0xbf50,0xbf51, -0xbf52,0xbf53,0xbf54,0xbf55,0xbf56,0xbf57,0xbf58,0xbf59, -0xbf5a,0xbf61,0xbf62,0xbf63,0xbf64,0xbf65,0xbf66,0xbf67, -0xbf68,0xbf69,0xbf6a,0xbf6b,0xbf6c,0xbf6d,0xbf6e,0xbf6f, -0xbf70,0xbf71,0xbf72,0xbf73,0xc7b6,0xbf74,0xbf75,0xbf76, -0xc7b7,0xbf77,0xbf78,0xbf79,0xc7b8,0xbf7a,0xbf81,0xbf82, -0xbf83,0xbf84,0xbf85,0xbf86,0xc7b9,0xbf87,0xbf88,0xc7ba, -0xbf89,0xbf8a,0xbf8b,0xbf8c,0xbf8d,0xbf8e,0xbf8f,0xbf90, -0xc7bb,0xbf91,0xbf92,0xbf93,0xc7bc,0xbf94,0xbf95,0xbf96, -0xc7bd,0xbf97,0xbf98,0xbf99,0xbf9a,0xbf9b,0xbf9c,0xbf9d, -0xc7be,0xbf9e,0xbf9f,0xc7bf,0xbfa0,0xc7c0,0xc041,0xc042, -/* 0xd500 */ -0xc043,0xc044,0xc045,0xc046,0xc7c1,0xc047,0xc048,0xc049, -0xc7c2,0xc04a,0xc04b,0xc04c,0xc7c3,0xc04d,0xc04e,0xc04f, -0xc050,0xc051,0xc052,0xc053,0xc7c4,0xc7c5,0xc054,0xc7c6, -0xc055,0xc056,0xc057,0xc058,0xc059,0xc05a,0xc061,0xc062, -0xc063,0xc064,0xc065,0xc066,0xc067,0xc068,0xc069,0xc06a, -0xc06b,0xc06c,0xc06d,0xc06e,0xc06f,0xc070,0xc071,0xc072, -0xc073,0xc074,0xc075,0xc076,0xc077,0xc078,0xc079,0xc07a, -0xc081,0xc082,0xc083,0xc084,0xc7c7,0xc7c8,0xc085,0xc086, -0xc7c9,0xc087,0xc088,0xc089,0xc7ca,0xc08a,0xc08b,0xc08c, -0xc08d,0xc08e,0xc08f,0xc090,0xc7cb,0xc7cc,0xc091,0xc7cd, -0xc092,0xc7ce,0xc093,0xc094,0xc095,0xc096,0xc097,0xc098, -0xc7cf,0xc7d0,0xc099,0xc09a,0xc7d1,0xc09b,0xc09c,0xc09d, -0xc7d2,0xc09e,0xc09f,0xc0a0,0xc141,0xc7d3,0xc142,0xc143, -0xc7d4,0xc7d5,0xc144,0xc7d6,0xc145,0xc7d7,0xc146,0xc147, -0xc148,0xc149,0xc14a,0xc14b,0xc7d8,0xc7d9,0xc14c,0xc14d, -0xc7da,0xc14e,0xc14f,0xc150,0xc7db,0xc151,0xc152,0xc153, -0xc154,0xc155,0xc156,0xc157,0xc7dc,0xc7dd,0xc158,0xc7de, -0xc7df,0xc7e0,0xc159,0xc15a,0xc161,0xc162,0xc163,0xc164, -0xc7e1,0xc165,0xc166,0xc167,0xc168,0xc169,0xc16a,0xc16b, -0xc16c,0xc16d,0xc16e,0xc16f,0xc170,0xc171,0xc172,0xc173, -0xc174,0xc175,0xc176,0xc177,0xc178,0xc7e2,0xc179,0xc17a, -0xc181,0xc182,0xc183,0xc184,0xc185,0xc186,0xc187,0xc188, -0xc189,0xc18a,0xc18b,0xc18c,0xc18d,0xc18e,0xc18f,0xc190, -0xc191,0xc192,0xc193,0xc194,0xc195,0xc196,0xc197,0xc198, -0xc199,0xc19a,0xc19b,0xc19c,0xc19d,0xc19e,0xc19f,0xc1a0, -0xc7e3,0xc7e4,0xc241,0xc242,0xc7e5,0xc243,0xc244,0xc245, -0xc7e6,0xc246,0xc7e7,0xc247,0xc248,0xc249,0xc24a,0xc24b, -0xc7e8,0xc7e9,0xc24c,0xc7ea,0xc24d,0xc7eb,0xc24e,0xc24f, -0xc250,0xc251,0xc252,0xc253,0xc7ec,0xc7ed,0xc254,0xc255, -0xc7ee,0xc256,0xc257,0xc258,0xc7ef,0xc259,0xc25a,0xc261, -0xc262,0xc263,0xc264,0xc265,0xc7f0,0xc7f1,0xc266,0xc7f2, -0xc267,0xc7f3,0xc268,0xc269,0xc26a,0xc26b,0xc26c,0xc26d, -/* 0xd600 */ -0xc7f4,0xc7f5,0xc26e,0xc26f,0xc7f6,0xc270,0xc271,0xc272, -0xc7f7,0xc273,0xc274,0xc275,0xc276,0xc277,0xc278,0xc279, -0xc7f8,0xc7f9,0xc27a,0xc7fa,0xc7fb,0xc7fc,0xc281,0xc282, -0xc283,0xc284,0xc285,0xc286,0xc7fd,0xc287,0xc288,0xc289, -0xc7fe,0xc28a,0xc28b,0xc28c,0xc8a1,0xc28d,0xc28e,0xc28f, -0xc290,0xc291,0xc292,0xc293,0xc294,0xc8a2,0xc295,0xc296, -0xc297,0xc298,0xc299,0xc29a,0xc29b,0xc29c,0xc29d,0xc29e, -0xc8a3,0xc8a4,0xc29f,0xc2a0,0xc8a5,0xc341,0xc342,0xc343, -0xc8a6,0xc344,0xc345,0xc346,0xc347,0xc8a7,0xc348,0xc349, -0xc8a8,0xc8a9,0xc34a,0xc8aa,0xc34b,0xc8ab,0xc34c,0xc34d, -0xc34e,0xc8ac,0xc34f,0xc350,0xc8ad,0xc8ae,0xc351,0xc352, -0xc8af,0xc353,0xc354,0xc355,0xc8b0,0xc356,0xc357,0xc358, -0xc359,0xc35a,0xc361,0xc362,0xc363,0xc364,0xc365,0xc8b1, -0xc366,0xc8b2,0xc367,0xc368,0xc369,0xc36a,0xc36b,0xc36c, -0xc8b3,0xc8b4,0xc36d,0xc36e,0xc8b5,0xc36f,0xc370,0xc371, -0xc372,0xc373,0xc374,0xc375,0xc376,0xc377,0xc378,0xc379, -0xc37a,0xc381,0xc382,0xc8b6,0xc383,0xc8b7,0xc384,0xc385, -0xc386,0xc387,0xc388,0xc389,0xc8b8,0xc8b9,0xc38a,0xc38b, -0xc8ba,0xc38c,0xc38d,0xc38e,0xc8bb,0xc38f,0xc390,0xc391, -0xc392,0xc393,0xc394,0xc395,0xc396,0xc8bc,0xc397,0xc8bd, -0xc398,0xc8be,0xc399,0xc39a,0xc39b,0xc39c,0xc39d,0xc39e, -0xc8bf,0xc39f,0xc3a0,0xc441,0xc8c0,0xc442,0xc443,0xc444, -0xc8c1,0xc445,0xc446,0xc447,0xc448,0xc449,0xc44a,0xc44b, -0xc44c,0xc8c2,0xc44d,0xc8c3,0xc44e,0xc44f,0xc450,0xc451, -0xc452,0xc453,0xc454,0xc455,0xc8c4,0xc8c5,0xc456,0xc457, -0xc8c6,0xc458,0xc459,0xc45a,0xc8c7,0xc461,0xc462,0xc463, -0xc464,0xc8c8,0xc465,0xc466,0xc8c9,0xc467,0xc468,0xc8ca, -0xc469,0xc8cb,0xc46a,0xc46b,0xc46c,0xc46d,0xc46e,0xc46f, -0xc8cc,0xc470,0xc471,0xc472,0xc8cd,0xc473,0xc474,0xc475, -0xc8ce,0xc476,0xc477,0xc478,0xc479,0xc47a,0xc481,0xc482, -0xc8cf,0xc483,0xc484,0xc485,0xc486,0xc8d0,0xc487,0xc488, -0xc489,0xc48a,0xc48b,0xc48c,0xc8d1,0xc8d2,0xc48d,0xc48e, -/* 0xd700 */ -0xc8d3,0xc48f,0xc490,0xc491,0xc8d4,0xc492,0xc493,0xc494, -0xc495,0xc496,0xc497,0xc498,0xc499,0xc49a,0xc49b,0xc49c, -0xc49d,0xc8d5,0xc49e,0xc49f,0xc4a0,0xc541,0xc542,0xc543, -0xc8d6,0xc8d7,0xc544,0xc545,0xc8d8,0xc546,0xc547,0xc548, -0xc8d9,0xc549,0xc54a,0xc54b,0xc54c,0xc54d,0xc54e,0xc54f, -0xc8da,0xc8db,0xc550,0xc8dc,0xc551,0xc8dd,0xc552,0xc553, -0xc554,0xc555,0xc556,0xc557,0xc8de,0xc8df,0xc558,0xc559, -0xc8e0,0xc55a,0xc561,0xc562,0xc8e1,0xc563,0xc564,0xc565, -0xc566,0xc567,0xc568,0xc569,0xc8e2,0xc56a,0xc56b,0xc8e3, -0xc56c,0xc8e4,0xc56d,0xc56e,0xc56f,0xc570,0xc571,0xc572, -0xc8e5,0xc8e6,0xc573,0xc574,0xc8e7,0xc575,0xc8e8,0xc8e9, -0xc8ea,0xc8eb,0xc576,0xc577,0xc578,0xc579,0xc57a,0xc581, -0xc8ec,0xc8ed,0xc582,0xc8ee,0xc583,0xc8ef,0xc584,0xc585, -0xc586,0xc8f0,0xc587,0xc588,0xc8f1,0xc589,0xc58a,0xc58b, -0xc8f2,0xc58c,0xc58d,0xc58e,0xc8f3,0xc58f,0xc590,0xc591, -0xc592,0xc593,0xc594,0xc595,0xc8f4,0xc8f5,0xc596,0xc597, -0xc598,0xc8f6,0xc599,0xc59a,0xc59b,0xc59c,0xc59d,0xc59e, -0xc8f7,0xc8f8,0xc59f,0xc5a0,0xc8f9,0xc641,0xc642,0xc643, -0xc8fa,0xc644,0xc645,0xc646,0xc647,0xc648,0xc649,0xc64a, -0xc8fb,0xc8fc,0xc64b,0xc8fd,0xc64c,0xc8fe,0xc64d,0xc64e, -0xc64f,0xc650,0xc651,0xc652}; - - -static const int ucs_s_uhc_table_min = 0xab00; -static const int ucs_s_uhc_table_max = 0xab00 + (sizeof(ucs_s_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_r1_uhc_table[] = { -/* 0xf800 */ -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xcbd0,0xcbd6,0xcbe7,0xcdcf,0xcde8,0xcead,0xcffb,0xd0a2, -0xd0b8,0xd0d0,0xd0dd,0xd1d4,0xd1d5,0xd1d8,0xd1db,0xd1dc, -0xd1dd,0xd1de,0xd1df,0xd1e0,0xd1e2,0xd1e3,0xd1e4,0xd1e5, -0xd1e6,0xd1e8,0xd1e9,0xd1ea,0xd1eb,0xd1ed,0xd1ef,0xd1f0, -0xd1f2,0xd1f6,0xd1fa,0xd1fc,0xd1fd,0xd1fe,0xd2a2,0xd2a3, -0xd2a7,0xd2a8,0xd2a9,0xd2aa,0xd2ab,0xd2ad,0xd2b2,0xd2be, -0xd2c2,0xd2c3,0xd2c4,0xd2c6,0xd2c7,0xd2c8,0xd2c9,0xd2ca, -0xd2cb,0xd2cd,0xd2ce,0xd2cf,0xd2d0,0xd2d1,0xd2d2,0xd2d3, -0xd2d4,0xd2d5,0xd2d6,0xd2d7,0xd2d9,0xd2da,0xd2de,0xd2df, -0xd2e1,0xd2e2,0xd2e4,0xd2e5,0xd2e6,0xd2e7,0xd2e8,0xd2e9, -0xd2ea,0xd2eb,0xd2f0,0xd2f1,0xd2f2,0xd2f3,0xd2f4,0xd2f5, -0xd2f7,0xd2f8,0xd4e6,0xd4fc,0xd5a5,0xd5ab,0xd5ae,0xd6b8, -0xd6cd,0xd7cb,0xd7e4,0xdbc5,0xdbe4,0xdca5,0xdda5,0xddd5, -0xddf4,0xdefc,0xdefe,0xdfb3,0xdfe1,0xdfe8,0xe0f1,0xe1ad, -0xe1ed,0xe3f5,0xe4a1,0xe4a9,0xe5ae,0xe5b1,0xe5b2,0xe5b9, -0xe5bb,0xe5bc,0xe5c4,0xe5ce,0xe5d0,0xe5d2,0xe5d6,0xe5fa, -0xe5fb,0xe5fc,0xe5fe,0xe6a1,0xe6a4,0xe6a7,0xe6ad,0xe6af, -0xe6b0,0xe6b1,0xe6b3,0xe6b7,0xe6b8,0xe6bc,0xe6c4,0xe6c6, -0xe6c7,0xe6ca,0xe6d2,0xe6d6,0xe6d9,0xe6dc,0xe6df,0xe6e1, -0xe6e4,0xe6e5,0xe6e6,0xe6e8,0xe6ea,0xe6eb,0xe6ec,0xe6ef, -0xe6f1,0xe6f2,0xe6f5,0xe6f6,0xe6f7,0xe6f9,0xe7a1,0xe7a6, -0xe7a9,0xe7aa,0xe7ac,0xe7ad,0xe7b0,0xe7bf,0xe7c1,0xe7c6, -0xe7c7,0xe7cb,0xe7cd,0xe7cf,0xe7d0,0xe7d3,0xe7df,0xe7e4, -0xe7e6,0xe7f7,0xe8e7,0xe8e8,0xe8f0,0xe8f1,0xe8f7,0xe8f9, -0xe8fb,0xe8fe,0xe9a7,0xe9ac,0xe9cc,0xe9f7,0xeac1,0xeae5, -0xeaf4,0xeaf7,0xeafc,0xeafe,0xeba4,0xeba7,0xeba9,0xebaa, -0xebba,0xebbb,0xebbd,0xebc1,0xebc2,0xebc6,0xebc7,0xebcc, -0xebcf,0xebd0,0xebd1,0xebd2,0xebd8,0xeca6,0xeca7,0xecaa, -0xecaf,0xecb0,0xecb1,0xecb2,0xecb5,0xecb8,0xecba,0xecc0, -0xecc1,0xecc5,0xecc6,0xecc9,0xecca,0xecd5,0xecdd,0xecde, -0xece1,0xece4,0xece7,0xece8,0xecf7,0xecf8,0xecfa,0xeda1, -0xeda2,0xeda3,0xedee,0xeedb,0xf2bd,0xf2fa,0xf3b1,0xf4a7, -0xf4ee,0xf6f4,0xf6f6,0xf7b8,0xf7c8,0xf7d3,0xf8db,0xf8f0, -0xfaa1,0xfaa2,0xfae6,0xfca9}; - -static const int ucs_r1_uhc_table_min = 0xf800; -static const int ucs_r1_uhc_table_max = 0xf800 + (sizeof(ucs_r1_uhc_table)/sizeof(unsigned short)); - -static const unsigned short ucs_r2_uhc_table[] = { -/* 0xff00 */ -0x0000,0xa3a1,0xa3a2,0xa3a3,0xa3a4,0xa3a5,0xa3a6,0xa3a7, -0xa3a8,0xa3a9,0xa3aa,0xa3ab,0xa3ac,0xa3ad,0xa3ae,0xa3af, -0xa3b0,0xa3b1,0xa3b2,0xa3b3,0xa3b4,0xa3b5,0xa3b6,0xa3b7, -0xa3b8,0xa3b9,0xa3ba,0xa3bb,0xa3bc,0xa3bd,0xa3be,0xa3bf, -0xa3c0,0xa3c1,0xa3c2,0xa3c3,0xa3c4,0xa3c5,0xa3c6,0xa3c7, -0xa3c8,0xa3c9,0xa3ca,0xa3cb,0xa3cc,0xa3cd,0xa3ce,0xa3cf, -0xa3d0,0xa3d1,0xa3d2,0xa3d3,0xa3d4,0xa3d5,0xa3d6,0xa3d7, -0xa3d8,0xa3d9,0xa3da,0xa3db,0xa1ac,0xa3dd,0xa3de,0xa3df, -0xa3e0,0xa3e1,0xa3e2,0xa3e3,0xa3e4,0xa3e5,0xa3e6,0xa3e7, -0xa3e8,0xa3e9,0xa3ea,0xa3eb,0xa3ec,0xa3ed,0xa3ee,0xa3ef, -0xa3f0,0xa3f1,0xa3f2,0xa3f3,0xa3f4,0xa3f5,0xa3f6,0xa3f7, -0xa3f8,0xa3f9,0xa3fa,0xa3fb,0xa3fc,0xa3fd,0xa2a6,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0xa1cb,0xa1cc,0xa1fe,0xa3fe,0x0000,0xa1cd,0xa3dc}; - -static const int ucs_r2_uhc_table_min = 0xff00; -static const int ucs_r2_uhc_table_max = 0xff00 + (sizeof (ucs_r2_uhc_table) / sizeof (unsigned short)); - - - - -#endif /* UNICODE_TABLE_UHC_H */ diff --git a/ext/mbstring/libmbfl/libmbfl.dsp b/ext/mbstring/libmbfl/libmbfl.dsp deleted file mode 100644 index ddb4f90032218..0000000000000 --- a/ext/mbstring/libmbfl/libmbfl.dsp +++ /dev/null @@ -1,795 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libmbfl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libmbfl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmbfl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmbfl.mak" CFG="libmbfl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmbfl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libmbfl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libmbfl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMBFL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "mbfl" /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMBFL_EXPORTS" /D "HAVE_CONFIG_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "libmbfl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMBFL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "mbfl" /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMBFL_EXPORTS" /D "MBFL_DLL_EXPORT" /D HAVE_CONFIG_H=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libmbfl - Win32 Release" -# Name "libmbfl - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "vc6" -# Begin Source File - -SOURCE=.\filters\html_entities.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_7bit.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_8bit.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ascii.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_base64.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_big5.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_byte2.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_byte4.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp1251.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp1252.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp866.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp932.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp936.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_cn.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_jp.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_jp_win.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_kr.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_tw.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_htmlent.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_hz.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso2022_kr.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_1.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_10.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_13.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_14.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_15.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_16.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_2.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_3.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_4.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_5.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_6.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_7.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_8.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_9.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_jis.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_koi8r.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_armscii8.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_pass.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_qprint.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_sjis.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ucs4.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_uhc.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf16.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf32.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf7.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf7imap.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf8.c -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_uuencode.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_wchar.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_allocators.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_convert.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_encoding.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_filter_output.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_ident.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_language.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_memory_device.c -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_string.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_de.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_en.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_ja.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_hy.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_kr.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_neutral.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_ru.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_uni.c -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_zh.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\config.h.vc6 - -!IF "$(CFG)" == "libmbfl - Win32 Release" - -# Begin Custom Build -InputDir=. -InputPath=.\config.h.vc6 - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h" - -# End Custom Build - -!ELSEIF "$(CFG)" == "libmbfl - Win32 Debug" - -# Begin Custom Build -InputDir=. -InputPath=.\config.h.vc6 - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h" - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\filters\cp932_table.h -# End Source File -# Begin Source File - -SOURCE=.\filters\html_entities.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_7bit.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_8bit.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ascii.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_base64.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_big5.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_byte2.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_byte4.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp1251.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp1252.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp866.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp932.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_cp936.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_cn.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_jp.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_jp_win.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_kr.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_euc_tw.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_htmlent.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_hz.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso2022_kr.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_1.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_10.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_13.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_14.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_15.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_16.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_2.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_3.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_4.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_5.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_6.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_7.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_8.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_iso8859_9.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_jis.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_koi8r.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_armscii8.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_pass.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_qprint.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_sjis.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ucs2.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_ucs4.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_uhc.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf16.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf32.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf7.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf7imap.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_utf8.h -# End Source File -# Begin Source File - -SOURCE=.\filters\mbfilter_uuencode.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfilter_wchar.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_allocators.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_consts.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_convert.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_encoding.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_filter_output.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_ident.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_language.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_memory_device.h -# End Source File -# Begin Source File - -SOURCE=.\mbfl\mbfl_string.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_de.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_en.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_ja.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_hy.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_kr.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_neutral.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_ru.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_uni.h -# End Source File -# Begin Source File - -SOURCE=.\nls\nls_zh.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_prop.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_big5.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cns11643.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cp1251.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cp1252.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cp866.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cp932_ext.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_cp936.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_10.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_13.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_14.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_15.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_16.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_2.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_3.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_4.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_5.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_6.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_7.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_8.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_iso8859_9.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_jis.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_koi8r.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_armscii8.h -# End Source File -# Begin Source File - -SOURCE=.\filters\unicode_table_uhc.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\mbfl.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/mbstring/libmbfl/libmbfl.dsw b/ext/mbstring/libmbfl/libmbfl.dsw deleted file mode 100644 index 69e7bf1b9d7f0..0000000000000 --- a/ext/mbstring/libmbfl/libmbfl.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libmbfl"=".\libmbfl.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/ext/mbstring/libmbfl/libmbfl.sln b/ext/mbstring/libmbfl/libmbfl.sln deleted file mode 100755 index f49f0c0d868ad..0000000000000 --- a/ext/mbstring/libmbfl/libmbfl.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmbfl", "libmbfl.vcproj", "{B3636594-A785-4270-A765-8EAE922B5207}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {B3636594-A785-4270-A765-8EAE922B5207}.Debug.ActiveCfg = Debug|Win32 - {B3636594-A785-4270-A765-8EAE922B5207}.Debug.Build.0 = Debug|Win32 - {B3636594-A785-4270-A765-8EAE922B5207}.Release.ActiveCfg = Release|Win32 - {B3636594-A785-4270-A765-8EAE922B5207}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/ext/mbstring/libmbfl/libmbfl.vcproj b/ext/mbstring/libmbfl/libmbfl.vcproj deleted file mode 100755 index 29e0af0a27062..0000000000000 --- a/ext/mbstring/libmbfl/libmbfl.vcproj +++ /dev/null @@ -1,650 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mbstring/libmbfl/mbfl.def b/ext/mbstring/libmbfl/mbfl.def deleted file mode 100644 index e6844f5f88865..0000000000000 --- a/ext/mbstring/libmbfl/mbfl.def +++ /dev/null @@ -1,80 +0,0 @@ -LIBRARY mbfl.dll - -DESCRIPTION "streamable kanji code filter" - -EXPORTS - _mbfl_buffer_converter_new @1 - _mbfl_buffer_converter_delete @2 - _mbfl_buffer_converter_reset @3 - _mbfl_buffer_converter_illegal_mode @4 - _mbfl_buffer_converter_illegal_substchar @5 - _mbfl_buffer_converter_strncat @6 - _mbfl_buffer_converter_feed @7 - _mbfl_buffer_converter_flush @8 - _mbfl_buffer_converter_getbuffer @9 - _mbfl_buffer_converter_result @10 - _mbfl_buffer_converter_feed_result @11 - _mbfl_encoding_detector_new @12 - _mbfl_encoding_detector_delete @13 - _mbfl_encoding_detector_feed @14 - _mbfl_encoding_detector_judge @15 - _mbfl_convert_encoding @16 - _mbfl_identify_encoding @17 - _mbfl_identify_encoding_name @18 - _mbfl_identify_encoding_no @19 - _mbfl_strlen @20 - _mbfl_oddlen @21 - _mbfl_strpos @22 - _mbfl_substr_count @23 - _mbfl_substr @24 - _mbfl_strcut @25 - _mbfl_strwidth @26 - _mbfl_strimwidth @27 - _mbfl_mime_header_encode @28 - _mbfl_mime_header_decode @29 - _mbfl_html_numeric_entity @30 - _mbfl_ja_jp_hantozen @31 - ___mbfl_allocators @32 - _mbfl_convert_filter_list @33 - _mbfl_convert_filter_new @34 - _mbfl_convert_filter_delete @35 - _mbfl_convert_filter_feed @36 - _mbfl_convert_filter_flush @37 - _mbfl_convert_filter_reset @38 - _mbfl_convert_filter_copy @39 - _mbfl_filt_conv_illegal_output @40 - _mbfl_convert_filter_select_vtbl @41 - _mbfl_convert_filter_get_vtbl @42 - _mbfl_filt_conv_common_ctor @43 - _mbfl_filt_conv_common_flush @44 - _mbfl_filt_conv_common_dtor @45 - _mbfl_encoding_8bit @46 - _mbfl_encoding_pass @47 - _mbfl_encoding_wchar @48 - _mbfl_name2encoding @49 - _mbfl_no2encoding @50 - _mbfl_name2no_encoding @51 - _mbfl_no_encoding2name @52 - _mbfl_no2preferred_mime_name @53 - _mbfl_is_support_encoding @54 - _mbfl_filter_output_pipe @55 - _mbfl_filter_output_null @56 - _mbfl_name2language @57 - _mbfl_no2language @58 - _mbfl_name2no_language @59 - _mbfl_no_language2name @60 - _mbfl_memory_device_init @61 - _mbfl_memory_device_realloc @62 - _mbfl_memory_device_clear @63 - _mbfl_memory_device_reset @64 - _mbfl_memory_device_result @65 - _mbfl_memory_device_output @66 - _mbfl_memory_device_output2 @67 - _mbfl_memory_device_output4 @68 - _mbfl_memory_device_strcat @69 - _mbfl_memory_device_devcat @70 - _mbfl_wchar_device_init @71 - _mbfl_wchar_device_output @72 - _mbfl_string_init @73 - _mbfl_string_init_set @74 - _mbfl_string_clear @75 diff --git a/ext/mbstring/libmbfl/mbfl.rc b/ext/mbstring/libmbfl/mbfl.rc deleted file mode 100644 index 655e61893ab65..0000000000000 --- a/ext/mbstring/libmbfl/mbfl.rc +++ /dev/null @@ -1,24 +0,0 @@ -/* $Id$ */ -1 VERSIONINFO -FILEVERSION 1,1,0,0 -PRODUCTVERSION 1,1,0,0 -FILEFLAGSMASK 0 -FILEOS 0x40000 -FILETYPE 1 -{ - BLOCK "StringFileInfo" - { - BLOCK "040904E4" - { - VALUE "CompanyName", "-\0" - VALUE "FileDescription", "streamable kanji code filter\0" - VALUE "FileVersion", "1.1.0\0" - VALUE "InternalName", "mbfl\0" - VALUE "LegalCopyright", "GNU Lesser Public License Version 2.0\0" - VALUE "OriginalFilename", "mbfl.dll\0" - VALUE "ProductName", "mbfl\0" - VALUE "ProductVersion", "1.1.0\0" - } - } -} - diff --git a/ext/mbstring/libmbfl/mbfl/Makefile.am b/ext/mbstring/libmbfl/mbfl/Makefile.am deleted file mode 100644 index 25d6734541680..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -EXTRA_DIST=Makefile.bcc32 mk_eaw_tbl.awk -lib_LTLIBRARIES=libmbfl.la -libmbfl_la_SOURCES=mbfilter.c mbfl_string.c mbfl_language.c mbfl_encoding.c mbfl_convert.c mbfl_ident.c mbfl_memory_device.c mbfl_allocators.c mbfl_filter_output.c mbfilter_pass.c mbfilter_wchar.c mbfilter_8bit.c eaw_table.h -libmbfl_filters_la=../filters/libmbfl_filters.la -libmbfl_nls_la=../nls/libmbfl_nls.la -libmbfl_la_LIBADD=$(libmbfl_filters_la) $(libmbfl_nls_la) -libmbfl_la_LDFLAGS=-version-info $(SHLIB_VERSION) -libmbfl_includedir=$(includedir)/mbfl -libmbfl_include_HEADERS=mbfilter.h mbfl_consts.h mbfl_encoding.h mbfl_language.h mbfl_string.h mbfl_convert.h mbfl_ident.h mbfl_memory_device.h mbfl_allocators.h mbfl_defs.h mbfl_filter_output.h mbfilter_pass.h mbfilter_wchar.h mbfilter_8bit.h - -mbfilter.c: eaw_table.h - -eaw_table.h: mk_eaw_tbl.awk - $(AWK) -v TABLE_NAME=mbfl_eaw_table -f mk_eaw_tbl.awk EastAsianWidth.txt > $@ - -EastAsianWidth.txt: - $(FETCH_VIA_FTP) ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt - -$(libmbfl_filters_la): - $(MAKE) -C `dirname $(libmbfl_filters_la)` - -$(libmbfl_nls_la): - $(MAKE) -C `dirname $(libmbfl_nls_la)` diff --git a/ext/mbstring/libmbfl/mbfl/Makefile.bcc32 b/ext/mbstring/libmbfl/mbfl/Makefile.bcc32 deleted file mode 100644 index 5d43e6a6f4695..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/Makefile.bcc32 +++ /dev/null @@ -1,7 +0,0 @@ -!include ..\rules.mak.bcc32 -OBJS=mbfilter.obj mbfilter_8bit.obj mbfilter_pass.obj mbfilter_wchar.obj mbfl_allocators.obj mbfl_convert.obj mbfl_encoding.obj mbfl_filter_output.obj mbfl_ident.obj mbfl_language.obj mbfl_memory_device.obj mbfl_string.obj - -all: $(OBJS) - -clean: - @for %i in ($(OBJS)) do @if exist %i del %i diff --git a/ext/mbstring/libmbfl/mbfl/eaw_table.h b/ext/mbstring/libmbfl/mbfl/eaw_table.h deleted file mode 100644 index 95c895df1bf41..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/eaw_table.h +++ /dev/null @@ -1,36 +0,0 @@ -static const struct { - int begin; - int end; -} mbfl_eaw_table[] = { - { 0x1100, 0x1159 }, - { 0x115f, 0x115f }, - { 0x2329, 0x232a }, - { 0x2e80, 0x2e99 }, - { 0x2e9b, 0x2ef3 }, - { 0x2f00, 0x2fd5 }, - { 0x2ff0, 0x2ffb }, - { 0x3000, 0x303e }, - { 0x3041, 0x3096 }, - { 0x3099, 0x30ff }, - { 0x3105, 0x312c }, - { 0x3131, 0x318e }, - { 0x3190, 0x31b7 }, - { 0x31f0, 0x321e }, - { 0x3220, 0x3243 }, - { 0x3250, 0x327d }, - { 0x327f, 0x32fe }, - { 0x3300, 0x4db5 }, - { 0x4e00, 0x9fa5 }, - { 0xa000, 0xa48c }, - { 0xa490, 0xa4c6 }, - { 0xac00, 0xd7a3 }, - { 0xf900, 0xfa2d }, - { 0xfa30, 0xfa6a }, - { 0xfe30, 0xfe52 }, - { 0xfe54, 0xfe66 }, - { 0xfe68, 0xfe6b }, - { 0xff01, 0xff60 }, - { 0xffe0, 0xffe6 }, - { 0x20000, 0x2fffd }, - { 0x30000, 0x3fffd } -}; diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c b/ext/mbstring/libmbfl/mbfl/mbfilter.c deleted file mode 100644 index b99d8df8a2b5c..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter.c +++ /dev/null @@ -1,2731 +0,0 @@ -/* - * charset=UTF-8 - * vim600: encoding=utf-8 - */ - -/* - * "streamable kanji code filter and converter" - * - * Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved. - * - * This software is released under the GNU Lesser General Public License. - * (Version 2.1, February 1999) - * Please read the following detail of the licence (in japanese). - * - * â—†ä½żç”¨è¨ħèĞĉĦäğĥ◆ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Żĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚şĞ‚ˆ£Ĥ開発•‚Œ—Ÿ€‚ĉ Şċĵäĵšç¤ƒƒƒ - * ƒ”ƒĵ‚µ‚¤‚şŻ€è‘—作ĉ¨İĉ³•Š‚ˆ³ä¸‡ċ›½è‘—作ĉ¨İĉĦ約ċš‚Ğ‚ˆ‚Š€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ğ関 - * ™‚‹™ıĤĉ¨İċˆİ‚’ç•™äż™‚‹ĉ¨İċˆİ‚’ĉŒĦ€““ĞèĦŒä½ż—™€‚ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤ - * ‚şŻäğ下Ğĉ˜Žè¨˜—ŸĉĦäğĥĞċ“£Ĥ€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨™‚‹ĉŽ’äğ–çš„§ŻŞ„ĉ¨İċˆİ - * ‚’Šċ˘ĉ§˜Ğè¨ħèЁ—™€‚ä½•äşşŸ‚Š¨‚‚€äğ下ĉĦäğĥĞċ—Ĥ“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨ - * ™‚‹“¨Ż§›‚“€‚ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’€ŒGNU Lesser General Public License (Version 2.1, February - * 1999)€Ğ示•‚ŒŸĉĦäğĥ§ä½żç”¨™‚‹“¨‚’€ċ…¨Ĥĉ–ıĞè¨ħèЁ—™€‚€ŒGNU Lesser - * General Public License€‚’ĉş€Ÿ•Ş„ä½żç”¨ĞŻ€ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş‹‚‰ĉ›¸é˘ - * Ğ‚ˆ‚‹è¨ħèĞ‚’ċ—‚‹ċż…èĤŒ‚‚Š™€‚ - * - * €ŒGNU Lesser General Public License€ċ…¨ĉ–‡Żäğ下‚Ĥ‚§ƒ–ƒšƒĵ‚¸‹‚‰ċ–ċ—§ - * ™€‚€ŒGNU Lesser General Public License€¨Ż€“‚Œ§Library General - * Public License¨ċ‘ĵ°‚ŒĤ„Ÿ‚‚§™€‚ - * http://www.gnu.org/ --- GNU‚Ĥ‚§ƒ–‚µ‚¤ƒˆ - * http://www.gnu.org/copyleft/lesser.html --- ƒİ‚¤‚ğƒ³‚ıĉ–‡é˘ - * “ƒİ‚¤‚ğƒ³‚ıċ†…ċıŒ‚‹‚‰Ş„ĉ–ı€ċˆ‚ŒŞ„ĉ–ıĞŻä½żç”¨‚’è¨ħèЁ—›‚“€‚ - * - * —‹—ŞŒ‚‰€ċ½“礁¨GNUƒ—ƒ­‚¸‚§‚Żƒˆ¨ç‰ıċšé–˘äż‚‚’示ċ”†ŸŻä¸ğċĵµ™‚‹‚‚§ - * Ż‚‚Š›‚“€‚ - * - * ◆保è¨ĵċ†…ċı◆ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€ĉœŸċ…•‚ŒŸċ‹•ä½œƒğĉݟ能ƒğĉ€§èƒ½‚’ĉŒ¤“¨‚’ç›ĉ¨™¨—Ĥ設計•‚Œ - * 開発•‚ŒĤ„™Œ€“‚Œ‚’保è¨ĵ™‚‹‚‚§Ż‚‚Š›‚“€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€Œ“ - * €çŠĥĉ…‹§ĉä›•‚ŒĤŠ‚Š€Ÿ¨ˆ°“‚½ƒ•ƒˆ‚Ĥ‚§‚˘ĉœ‰ç”¨ĉ€§Ş„—ç‰ıċš - * ç›çš„Ğċˆè‡´™‚‹“¨¨„£Ÿ€ä½•‚‰‹äżè¨ĵċ†…ċıŒ€ĉ˜Žç¤ş•‚ŒŸ‚Šĉš—éğ™Ğ示•‚ŒĤ„ - * ‚‹ċ ´ċˆ§‚£Ĥ‚‚€äżè¨ĵŻç„ĦċŠı§™€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨—ŸçµĉžœŞ„—ä½ż - * 用—Ş‹£ŸçµĉžœĞ‚ˆ£Ĥ€ç›´ĉŽ‚‚‹„Żé–“ĉŽĞċ—‘ŸèşĞ体的Şċ‚·ċ³€è²Ħ産上ĉċ³ - * €ƒ‡ƒĵ‚żĉċ¤ħ‚‚‹„Żäğ–ċ…¨Ĥĉċ³Ğ¤„ĤŻ€ĉċ³ċŻèƒ½ĉ€§Œä½żç”¨è€… - * €ċ½“礁‚‚‹„ŻçĴĴ三者Ğ‚ˆ£Ĥè­Ĥċ‘Š•‚ŒĤ„Ÿċ ´ċˆ§‚£Ĥ‚‚€ċ½“礁Żĉċ³è³  - * ċ„ŸŠ‚ˆ³è£œċĦĞ‚’èĦŒ„›‚“€‚“èĤċšŻäğ–ċ…¨Ĥ€ĉ›¸é˘ä¸ŠŸŻĉ›¸é˘Ğç„Ħ„保è¨ĵƒğ - * ċ‘ç´„ƒğèĤċšĞċ„Şċ…ˆ—™€‚ - * - * ◆著作ĉ¨İ者é€£çµĦċ…ˆŠ‚ˆ³ä½żç”¨ĉĦäğĥĞ¤„Ĥċ•„ċˆ‚›ċ…ˆâ—† - * - * €’102-0073 - * ĉħäşĴ都ċƒäğ£ç”°ċŒşäıĉµċŒ—1-13-5ĉ—ĉœĴċœ°ĉ‰€çĴĴ一ƒ“ƒĞ4F - * ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş - * Phone: 03-3512-3655, Fax: 03-3512-3656 - * Email: sales@happysize.co.jp - * Web: http://happysize.com/ - * - * ◆著者◆ - * - * 金ĉœĴ€€èŒ‚ - * - * ◆ċħĉ­´â—† - * - * 1998/11/10 sgk implementation in C++ - * 1999/4/25 sgk C§ĉ›¸ŞŠ—€‚ - * 1999/4/26 sgk ċ…ċŠ›ƒ•‚£ƒĞ‚ż‚’ċŸè£…€‚ĉĵ˘ċ­—‚³ƒĵƒ‰‚’ĉŽ¨ċš—ŞŒ‚‰ƒ•‚£ƒĞ‚ż‚’èż½ċŠ €‚ - * 1999/6/?? Unicode‚µƒƒĵƒˆ€‚ - * 1999/6/22 sgk ƒİ‚¤‚ğƒ³‚ı‚’LGPLĞċ¤‰ĉ›´€‚ - * - */ - -/* - * Unicode support - * - * Portions copyright (c) 1999,2000,2001 by the PHP3 internationalization team. - * All rights reserved. - * - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "mbfl_filter_output.h" -#include "mbfilter_pass.h" - -#include "eaw_table.h" - -/* hex character table "0123456789ABCDEF" */ -static char mbfl_hexchar_table[] = { - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46 -}; - - - -/* - * encoding filter - */ -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - - -/* - * buffering converter - */ -mbfl_buffer_converter * -mbfl_buffer_converter_new( - enum mbfl_no_encoding from, - enum mbfl_no_encoding to, - int buf_initsz) -{ - mbfl_buffer_converter *convd; - - /* allocate */ - convd = (mbfl_buffer_converter*)mbfl_malloc(sizeof (mbfl_buffer_converter)); - if (convd == NULL) { - return NULL; - } - - /* initialize */ - convd->from = mbfl_no2encoding(from); - convd->to = mbfl_no2encoding(to); - if (convd->from == NULL) { - convd->from = &mbfl_encoding_pass; - } - if (convd->to == NULL) { - convd->to = &mbfl_encoding_pass; - } - - /* create convert filter */ - convd->filter1 = NULL; - convd->filter2 = NULL; - if (mbfl_convert_filter_get_vtbl(convd->from->no_encoding, convd->to->no_encoding) != NULL) { - convd->filter1 = mbfl_convert_filter_new(convd->from->no_encoding, convd->to->no_encoding, mbfl_memory_device_output, 0, &convd->device); - } else { - convd->filter2 = mbfl_convert_filter_new(mbfl_no_encoding_wchar, convd->to->no_encoding, mbfl_memory_device_output, 0, &convd->device); - if (convd->filter2 != NULL) { - convd->filter1 = mbfl_convert_filter_new(convd->from->no_encoding, mbfl_no_encoding_wchar, (int (*)(int, void*))convd->filter2->filter_function, NULL, convd->filter2); - if (convd->filter1 == NULL) { - mbfl_convert_filter_delete(convd->filter2); - } - } - } - if (convd->filter1 == NULL) { - return NULL; - } - - mbfl_memory_device_init(&convd->device, buf_initsz, buf_initsz/4); - - return convd; -} - -void -mbfl_buffer_converter_delete(mbfl_buffer_converter *convd) -{ - if (convd != NULL) { - if (convd->filter1) { - mbfl_convert_filter_delete(convd->filter1); - } - if (convd->filter2) { - mbfl_convert_filter_delete(convd->filter2); - } - mbfl_memory_device_clear(&convd->device); - mbfl_free((void*)convd); - } -} - -void -mbfl_buffer_converter_reset(mbfl_buffer_converter *convd) -{ - mbfl_memory_device_reset(&convd->device); -} - -int -mbfl_buffer_converter_illegal_mode(mbfl_buffer_converter *convd, int mode) -{ - if (convd != NULL) { - if (convd->filter2 != NULL) { - convd->filter2->illegal_mode = mode; - } else if (convd->filter1 != NULL) { - convd->filter1->illegal_mode = mode; - } else { - return 0; - } - } - - return 1; -} - -int -mbfl_buffer_converter_illegal_substchar(mbfl_buffer_converter *convd, int substchar) -{ - if (convd != NULL) { - if (convd->filter2 != NULL) { - convd->filter2->illegal_substchar = substchar; - } else if (convd->filter1 != NULL) { - convd->filter1->illegal_substchar = substchar; - } else { - return 0; - } - } - - return 1; -} - -int -mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, int n) -{ - mbfl_convert_filter *filter; - int (*filter_function)(int c, mbfl_convert_filter *filter); - - if (convd != NULL && p != NULL) { - filter = convd->filter1; - if (filter != NULL) { - filter_function = filter->filter_function; - while (n > 0) { - if ((*filter_function)(*p++, filter) < 0) { - break; - } - n--; - } - } - } - - return n; -} - -int -mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string) -{ - int n; - unsigned char *p; - mbfl_convert_filter *filter; - int (*filter_function)(int c, mbfl_convert_filter *filter); - - if (convd == NULL || string == NULL) { - return -1; - } - mbfl_memory_device_realloc(&convd->device, convd->device.pos + string->len, string->len/4); - /* feed data */ - n = string->len; - p = string->val; - filter = convd->filter1; - if (filter != NULL) { - filter_function = filter->filter_function; - while (n > 0) { - if ((*filter_function)(*p++, filter) < 0) { - return -1; - } - n--; - } - } - - return 0; -} - -int -mbfl_buffer_converter_flush(mbfl_buffer_converter *convd) -{ - if (convd == NULL) { - return -1; - } - - if (convd->filter1 != NULL) { - mbfl_convert_filter_flush(convd->filter1); - } - if (convd->filter2 != NULL) { - mbfl_convert_filter_flush(convd->filter2); - } - - return 0; -} - -mbfl_string * -mbfl_buffer_converter_getbuffer(mbfl_buffer_converter *convd, mbfl_string *result) -{ - if (convd != NULL && result != NULL && convd->device.buffer != NULL) { - result->no_encoding = convd->to->no_encoding; - result->val = convd->device.buffer; - result->len = convd->device.pos; - } else { - result = NULL; - } - - return result; -} - -mbfl_string * -mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result) -{ - if (convd == NULL || result == NULL) { - return NULL; - } - result->no_encoding = convd->to->no_encoding; - return mbfl_memory_device_result(&convd->device, result); -} - -mbfl_string * -mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string *string, - mbfl_string *result) -{ - if (convd == NULL || string == NULL || result == NULL) { - return NULL; - } - mbfl_buffer_converter_feed(convd, string); - if (convd->filter1 != NULL) { - mbfl_convert_filter_flush(convd->filter1); - } - if (convd->filter2 != NULL) { - mbfl_convert_filter_flush(convd->filter2); - } - result->no_encoding = convd->to->no_encoding; - return mbfl_memory_device_result(&convd->device, result); -} - - -/* - * encoding detector - */ -mbfl_encoding_detector * -mbfl_encoding_detector_new(enum mbfl_no_encoding *elist, int elistsz) -{ - mbfl_encoding_detector *identd; - - int i, num; - mbfl_identify_filter *filter; - - if (elist == NULL || elistsz <= 0) { - return NULL; - } - - /* allocate */ - identd = (mbfl_encoding_detector*)mbfl_malloc(sizeof(mbfl_encoding_detector)); - if (identd == NULL) { - return NULL; - } - identd->filter_list = (mbfl_identify_filter **)mbfl_calloc(elistsz, sizeof(mbfl_identify_filter *)); - if (identd->filter_list == NULL) { - mbfl_free(identd); - return NULL; - } - - /* create filters */ - i = 0; - num = 0; - while (i < elistsz) { - filter = mbfl_identify_filter_new(elist[i]); - if (filter != NULL) { - identd->filter_list[num] = filter; - num++; - } - i++; - } - identd->filter_list_size = num; - - return identd; -} - -void -mbfl_encoding_detector_delete(mbfl_encoding_detector *identd) -{ - int i; - - if (identd != NULL) { - if (identd->filter_list != NULL) { - i = identd->filter_list_size; - while (i > 0) { - i--; - mbfl_identify_filter_delete(identd->filter_list[i]); - } - mbfl_free((void *)identd->filter_list); - } - mbfl_free((void *)identd); - } -} - -int -mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string) -{ - int i, n, num, bad, res; - unsigned char *p; - mbfl_identify_filter *filter; - - res = 0; - /* feed data */ - if (identd != NULL && string != NULL && string->val != NULL) { - num = identd->filter_list_size; - n = string->len; - p = string->val; - bad = 0; - while (n > 0) { - for (i = 0; i < num; i++) { - filter = identd->filter_list[i]; - if (!filter->flag) { - (*filter->filter_function)(*p, filter); - if (filter->flag) { - bad++; - } - } - } - if ((num - 1) <= bad) { - res = 1; - break; - } - p++; - n--; - } - } - - return res; -} - -enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *identd) -{ - mbfl_identify_filter *filter; - enum mbfl_no_encoding encoding; - int n; - - /* judge */ - encoding = mbfl_no_encoding_invalid; - if (identd != NULL) { - n = identd->filter_list_size - 1; - while (n >= 0) { - filter = identd->filter_list[n]; - if (!filter->flag) { - encoding = filter->encoding->no_encoding; - } - n--; - } - } - - return encoding; -} - - -/* - * encoding converter - */ -mbfl_string * -mbfl_convert_encoding( - mbfl_string *string, - mbfl_string *result, - enum mbfl_no_encoding toenc) -{ - int n; - unsigned char *p; - const mbfl_encoding *encoding; - mbfl_memory_device device; - mbfl_convert_filter *filter1; - mbfl_convert_filter *filter2; - - /* initialize */ - encoding = mbfl_no2encoding(toenc); - if (encoding == NULL || string == NULL || result == NULL) { - return NULL; - } - - filter1 = NULL; - filter2 = NULL; - if (mbfl_convert_filter_get_vtbl(string->no_encoding, toenc) != NULL) { - filter1 = mbfl_convert_filter_new(string->no_encoding, toenc, mbfl_memory_device_output, 0, &device); - } else { - filter2 = mbfl_convert_filter_new(mbfl_no_encoding_wchar, toenc, mbfl_memory_device_output, 0, &device); - if (filter2 != NULL) { - filter1 = mbfl_convert_filter_new(string->no_encoding, mbfl_no_encoding_wchar, (int (*)(int, void*))filter2->filter_function, NULL, filter2); - if (filter1 == NULL) { - mbfl_convert_filter_delete(filter2); - } - } - } - if (filter1 == NULL) { - return NULL; - } - - if (filter2 != NULL) { - filter2->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - filter2->illegal_substchar = 0x3f; /* '?' */ - } - - mbfl_memory_device_init(&device, string->len, (string->len >> 2) + 8); - - /* feed data */ - n = string->len; - p = string->val; - if (p != NULL) { - while (n > 0) { - if ((*filter1->filter_function)(*p++, filter1) < 0) { - break; - } - n--; - } - } - - mbfl_convert_filter_flush(filter1); - mbfl_convert_filter_delete(filter1); - if (filter2 != NULL) { - mbfl_convert_filter_flush(filter2); - mbfl_convert_filter_delete(filter2); - } - - return mbfl_memory_device_result(&device, result); -} - - -/* - * identify encoding - */ -const mbfl_encoding * -mbfl_identify_encoding(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict) -{ - int i, n, num, bad; - unsigned char *p; - mbfl_identify_filter *flist, *filter; - const mbfl_encoding *encoding; - - /* flist is an array of mbfl_identify_filter instances */ - flist = (mbfl_identify_filter *)mbfl_calloc(elistsz, sizeof(mbfl_identify_filter)); - if (flist == NULL) { - return NULL; - } - - num = 0; - if (elist != NULL) { - for (i = 0; i < elistsz; i++) { - if (!mbfl_identify_filter_init(&flist[num], elist[i])) { - num++; - } - } - } - - /* feed data */ - n = string->len; - p = string->val; - - if (p != NULL) { - bad = 0; - while (n > 0) { - for (i = 0; i < num; i++) { - filter = &flist[i]; - if (!filter->flag) { - (*filter->filter_function)(*p, filter); - if (filter->flag) { - bad++; - } - } - } - if ((num - 1) <= bad && !strict) { - break; - } - p++; - n--; - } - } - - /* judge */ - encoding = NULL; - - for (i = 0; i < num; i++) { - filter = &flist[i]; - if (!filter->flag) { - encoding = filter->encoding; - break; - } - } - - /* cleanup */ - /* dtors should be called in reverse order */ - i = num; while (--i >= 0) { - mbfl_identify_filter_cleanup(&flist[i]); - } - - mbfl_free((void *)flist); - - return encoding; -} - -const char* -mbfl_identify_encoding_name(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_identify_encoding(string, elist, elistsz, strict); - if (encoding != NULL && - encoding->no_encoding > mbfl_no_encoding_charset_min && - encoding->no_encoding < mbfl_no_encoding_charset_max) { - return encoding->name; - } else { - return NULL; - } -} - -enum mbfl_no_encoding -mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_identify_encoding(string, elist, elistsz, 0); - if (encoding != NULL && - encoding->no_encoding > mbfl_no_encoding_charset_min && - encoding->no_encoding < mbfl_no_encoding_charset_max) { - return encoding->no_encoding; - } else { - return mbfl_no_encoding_invalid; - } -} - - -/* - * strlen - */ -static int -filter_count_output(int c, void *data) -{ - (*(int *)data)++; - return c; -} - -int -mbfl_strlen(mbfl_string *string) -{ - int len, n, m, k; - unsigned char *p; - const unsigned char *mbtab; - const mbfl_encoding *encoding; - - encoding = mbfl_no2encoding(string->no_encoding); - if (encoding == NULL || string == NULL) { - return -1; - } - - len = 0; - if (encoding->flag & MBFL_ENCTYPE_SBCS) { - len = string->len; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { - len = string->len/2; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) { - len = string->len/4; - } else if (encoding->mblen_table != NULL) { - mbtab = encoding->mblen_table; - n = 0; - p = string->val; - k = string->len; - /* count */ - if (p != NULL) { - while (n < k) { - m = mbtab[*p]; - n += m; - p += m; - len++; - }; - } - } else { - /* wchar filter */ - mbfl_convert_filter *filter = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - filter_count_output, 0, &len); - if (filter == NULL) { - return -1; - } - /* count */ - n = string->len; - p = string->val; - if (p != NULL) { - while (n > 0) { - (*filter->filter_function)(*p++, filter); - n--; - } - } - mbfl_convert_filter_delete(filter); - } - - return len; -} - - -/* - * strpos - */ -struct collector_strpos_data { - mbfl_convert_filter *next_filter; - mbfl_wchar_device needle; - int needle_len; - int start; - int output; - int found_pos; - int needle_pos; - int matched_pos; -}; - -static int -collector_strpos(int c, void* data) -{ - int *p, *h, *m, n; - struct collector_strpos_data *pc = (struct collector_strpos_data*)data; - - if (pc->output >= pc->start) { - if (c == (int)pc->needle.buffer[pc->needle_pos]) { - if (pc->needle_pos == 0) { - pc->found_pos = pc->output; /* found position */ - } - pc->needle_pos++; /* needle pointer */ - if (pc->needle_pos >= pc->needle_len) { - pc->matched_pos = pc->found_pos; /* matched position */ - pc->needle_pos--; - goto retry; - } - } else if (pc->needle_pos != 0) { -retry: - h = (int *)pc->needle.buffer; - h++; - for (;;) { - pc->found_pos++; - p = h; - m = pc->needle.buffer; - n = pc->needle_pos - 1; - while (n > 0 && *p == *m) { - n--; - p++; - m++; - } - if (n <= 0) { - if (*m != c) { - pc->needle_pos = 0; - } - break; - } else { - h++; - pc->needle_pos--; - } - } - } - } - - pc->output++; - return c; -} - -/* - * oddlen - */ -int -mbfl_oddlen(mbfl_string *string) -{ - int len, n, m, k; - unsigned char *p; - const unsigned char *mbtab; - const mbfl_encoding *encoding; - - - if (string == NULL) { - return -1; - } - encoding = mbfl_no2encoding(string->no_encoding); - if (encoding == NULL) { - return -1; - } - - len = 0; - if (encoding->flag & MBFL_ENCTYPE_SBCS) { - return 0; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { - return len % 2; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) { - return len % 4; - } else if (encoding->mblen_table != NULL) { - mbtab = encoding->mblen_table; - n = 0; - p = string->val; - k = string->len; - /* count */ - if (p != NULL) { - while (n < k) { - m = mbtab[*p]; - n += m; - p += m; - }; - } - return n-k; - } else { - /* how can i do ? */ - return 0; - } - /* NOT REACHED */ -} - -int -mbfl_strpos( - mbfl_string *haystack, - mbfl_string *needle, - int offset, - int reverse) -{ - int n, result; - unsigned char *p; - mbfl_convert_filter *filter; - struct collector_strpos_data pc; - - if (haystack == NULL || needle == NULL) { - return -8; - } - /* needle is converted into wchar */ - mbfl_wchar_device_init(&pc.needle); - filter = mbfl_convert_filter_new( - needle->no_encoding, - mbfl_no_encoding_wchar, - mbfl_wchar_device_output, 0, &pc.needle); - if (filter == NULL) { - return -4; - } - p = needle->val; - n = needle->len; - if (p != NULL) { - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - break; - } - n--; - } - } - mbfl_convert_filter_flush(filter); - mbfl_convert_filter_delete(filter); - pc.needle_len = pc.needle.pos; - if (pc.needle.buffer == NULL) { - return -4; - } - if (pc.needle_len <= 0) { - mbfl_wchar_device_clear(&pc.needle); - return -2; - } - /* initialize filter and collector data */ - filter = mbfl_convert_filter_new( - haystack->no_encoding, - mbfl_no_encoding_wchar, - collector_strpos, 0, &pc); - if (filter == NULL) { - mbfl_wchar_device_clear(&pc.needle); - return -4; - } - pc.start = offset; - pc.output = 0; - pc.needle_pos = 0; - pc.found_pos = 0; - pc.matched_pos = -1; - - /* feed data */ - p = haystack->val; - n = haystack->len; - if (p != NULL) { - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - pc.matched_pos = -4; - break; - } - if (pc.matched_pos >= 0 && !reverse) { - break; - } - n--; - } - } - mbfl_convert_filter_flush(filter); - result = pc.matched_pos; - mbfl_convert_filter_delete(filter); - mbfl_wchar_device_clear(&pc.needle); - - return result; -} - -/* - * substr_count - */ - -int -mbfl_substr_count( - mbfl_string *haystack, - mbfl_string *needle - ) -{ - int n, result = 0; - unsigned char *p; - mbfl_convert_filter *filter; - struct collector_strpos_data pc; - - if (haystack == NULL || needle == NULL) { - return -8; - } - /* needle is converted into wchar */ - mbfl_wchar_device_init(&pc.needle); - filter = mbfl_convert_filter_new( - needle->no_encoding, - mbfl_no_encoding_wchar, - mbfl_wchar_device_output, 0, &pc.needle); - if (filter == NULL) { - return -4; - } - p = needle->val; - n = needle->len; - if (p != NULL) { - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - break; - } - n--; - } - } - mbfl_convert_filter_flush(filter); - mbfl_convert_filter_delete(filter); - pc.needle_len = pc.needle.pos; - if (pc.needle.buffer == NULL) { - return -4; - } - if (pc.needle_len <= 0) { - mbfl_wchar_device_clear(&pc.needle); - return -2; - } - /* initialize filter and collector data */ - filter = mbfl_convert_filter_new( - haystack->no_encoding, - mbfl_no_encoding_wchar, - collector_strpos, 0, &pc); - if (filter == NULL) { - mbfl_wchar_device_clear(&pc.needle); - return -4; - } - pc.start = 0; - pc.output = 0; - pc.needle_pos = 0; - pc.found_pos = 0; - pc.matched_pos = -1; - - /* feed data */ - p = haystack->val; - n = haystack->len; - if (p != NULL) { - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - pc.matched_pos = -4; - break; - } - if (pc.matched_pos >= 0) { - ++result; - pc.matched_pos = -1; - } - n--; - } - } - mbfl_convert_filter_flush(filter); - mbfl_convert_filter_delete(filter); - mbfl_wchar_device_clear(&pc.needle); - - return result; -} - -/* - * substr - */ -struct collector_substr_data { - mbfl_convert_filter *next_filter; - int start; - int stop; - int output; -}; - -static int -collector_substr(int c, void* data) -{ - struct collector_substr_data *pc = (struct collector_substr_data*)data; - - if (pc->output >= pc->stop) { - return -1; - } - - if (pc->output >= pc->start) { - (*pc->next_filter->filter_function)(c, pc->next_filter); - } - - pc->output++; - - return c; -} - -mbfl_string * -mbfl_substr( - mbfl_string *string, - mbfl_string *result, - int from, - int length) -{ - const mbfl_encoding *encoding; - int n, m, k, len, start, end; - unsigned char *p, *w; - const unsigned char *mbtab; - - encoding = mbfl_no2encoding(string->no_encoding); - if (encoding == NULL || string == NULL || result == NULL) { - return NULL; - } - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - - if ((encoding->flag & (MBFL_ENCTYPE_SBCS | MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE | MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) || - encoding->mblen_table != NULL) { - len = string->len; - start = from; - end = from + length; - if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_MWC2LE)) { - start *= 2; - end = start + length*2; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_MWC4LE)) { - start *= 4; - end = start + length*4; - } else if (encoding->mblen_table != NULL) { - mbtab = encoding->mblen_table; - start = 0; - end = 0; - n = 0; - k = 0; - p = string->val; - if (p != NULL) { - /* search start position */ - while (k <= from) { - start = n; - if (n >= len) { - break; - } - m = mbtab[*p]; - n += m; - p += m; - k++; - } - /* detect end position */ - k = 0; - end = start; - while (k < length) { - end = n; - if (n >= len) { - break; - } - m = mbtab[*p]; - n += m; - p += m; - k++; - } - } - } - - if (start > len) { - start = len; - } - if (start < 0) { - start = 0; - } - if (end > len) { - end = len; - } - if (end < 0) { - end = 0; - } - if (start > end) { - start = end; - } - - /* allocate memory and copy */ - n = end - start; - result->len = 0; - result->val = w = (unsigned char*)mbfl_malloc((n + 8)*sizeof(unsigned char)); - if (w != NULL) { - p = string->val; - if (p != NULL) { - p += start; - result->len = n; - while (n > 0) { - *w++ = *p++; - n--; - } - } - *w++ = '\0'; - *w++ = '\0'; - *w++ = '\0'; - *w = '\0'; - } else { - result = NULL; - } - } else { - mbfl_memory_device device; - struct collector_substr_data pc; - mbfl_convert_filter *decoder; - mbfl_convert_filter *encoder; - - mbfl_memory_device_init(&device, length + 1, 0); - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - /* output code filter */ - decoder = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &device); - /* wchar filter */ - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - collector_substr, 0, &pc); - if (decoder == NULL || encoder == NULL) { - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(decoder); - return NULL; - } - pc.next_filter = decoder; - pc.start = from; - pc.stop = from + length; - pc.output = 0; - - /* feed data */ - p = string->val; - n = string->len; - if (p != NULL) { - while (n > 0) { - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - n--; - } - } - - mbfl_convert_filter_flush(encoder); - mbfl_convert_filter_flush(decoder); - result = mbfl_memory_device_result(&device, result); - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(decoder); - } - - return result; -} - - -/* - * strcut - */ -mbfl_string * -mbfl_strcut( - mbfl_string *string, - mbfl_string *result, - int from, - int length) -{ - const mbfl_encoding *encoding; - int n, m, k, len, start, end; - unsigned char *p, *w; - const unsigned char *mbtab; - mbfl_memory_device device; - mbfl_convert_filter *encoder, *encoder_tmp, *decoder, *decoder_tmp; - - encoding = mbfl_no2encoding(string->no_encoding); - if (encoding == NULL || string == NULL || result == NULL) { - return NULL; - } - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - - if ((encoding->flag & (MBFL_ENCTYPE_SBCS | MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE | MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) || - encoding->mblen_table != NULL) { - len = string->len; - start = from; - end = from + length; - if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { - start /= 2; - start *= 2; - end = length/2; - end *= 2; - end += start; - } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) { - start /= 4; - start *= 4; - end = length/4; - end *= 4; - end += start; - } else if (encoding->mblen_table != NULL) { - mbtab = encoding->mblen_table; - start = 0; - end = 0; - n = 0; - p = string->val; - if (p != NULL) { - /* search start position */ - for (;;) { - m = mbtab[*p]; - n += m; - p += m; - if (n > from) { - break; - } - start = n; - } - /* search end position */ - k = start + length; - if (k >= (int)string->len) { - end = string->len; - } else { - end = start; - while (n <= k) { - end = n; - m = mbtab[*p]; - n += m; - p += m; - } - } - } - } - - if (start > len) { - start = len; - } - if (start < 0) { - start = 0; - } - if (end > len) { - end = len; - } - if (end < 0) { - end = 0; - } - if (start > end) { - start = end; - } - /* allocate memory and copy string */ - n = end - start; - result->len = 0; - result->val = w = (unsigned char*)mbfl_malloc((n + 8)*sizeof(unsigned char)); - if (w != NULL) { - result->len = n; - p = &(string->val[start]); - while (n > 0) { - *w++ = *p++; - n--; - } - *w++ = '\0'; - *w++ = '\0'; - *w++ = '\0'; - *w = '\0'; - } else { - result = NULL; - } - } else { - /* wchar filter */ - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - mbfl_filter_output_null, 0, 0); - encoder_tmp = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - mbfl_filter_output_null, 0, 0); - /* output code filter */ - decoder = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &device); - decoder_tmp = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &device); - if (encoder == NULL || encoder_tmp == NULL || decoder == NULL || decoder_tmp == NULL) { - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(encoder_tmp); - mbfl_convert_filter_delete(decoder); - mbfl_convert_filter_delete(decoder_tmp); - return NULL; - } - mbfl_memory_device_init(&device, length + 8, 0); - k = 0; - n = 0; - p = string->val; - if (p != NULL) { - /* seartch start position */ - while (n < from) { - (*encoder->filter_function)(*p++, encoder); - n++; - } - /* output a little shorter than "length" */ - encoder->output_function = mbfl_filter_output_pipe; - encoder->data = decoder; - k = length - 20; - len = string->len; - while (n < len && device.pos < k) { - (*encoder->filter_function)(*p++, encoder); - n++; - } - /* detect end position */ - for (;;) { - /* backup current state */ - k = device.pos; - mbfl_convert_filter_copy(encoder, encoder_tmp); - mbfl_convert_filter_copy(decoder, decoder_tmp); - if (n >= len) { - break; - } - /* feed 1byte and flush */ - (*encoder->filter_function)(*p, encoder); - (*encoder->filter_flush)(encoder); - (*decoder->filter_flush)(decoder); - if (device.pos > length) { - break; - } - /* restore filter and re-feed data */ - device.pos = k; - mbfl_convert_filter_copy(encoder_tmp, encoder); - mbfl_convert_filter_copy(decoder_tmp, decoder); - (*encoder->filter_function)(*p, encoder); - p++; - n++; - } - device.pos = k; - mbfl_convert_filter_copy(encoder_tmp, encoder); - mbfl_convert_filter_copy(decoder_tmp, decoder); - mbfl_convert_filter_flush(encoder); - mbfl_convert_filter_flush(decoder); - } - result = mbfl_memory_device_result(&device, result); - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(encoder_tmp); - mbfl_convert_filter_delete(decoder); - mbfl_convert_filter_delete(decoder_tmp); - } - - return result; -} - - -/* - * strwidth - */ -static int is_fullwidth(int c) -{ - int i; - - if (c < mbfl_eaw_table[0].begin) { - return 0; - } - - for (i = 0; i < sizeof(mbfl_eaw_table) / sizeof(mbfl_eaw_table[0]); i++) { - if (mbfl_eaw_table[i].begin <= c && c <= mbfl_eaw_table[i].end) { - return 1; - } - } - - return 0; -} - -static int -filter_count_width(int c, void* data) -{ - (*(int *)data) += (is_fullwidth(c) ? 2: 1); - return c; -} - -int -mbfl_strwidth(mbfl_string *string) -{ - int len, n; - unsigned char *p; - mbfl_convert_filter *filter; - - len = 0; - if (string->len > 0 && string->val != NULL) { - /* wchar filter */ - filter = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - filter_count_width, 0, &len); - if (filter == NULL) { - mbfl_convert_filter_delete(filter); - return -1; - } - - /* feed data */ - p = string->val; - n = string->len; - while (n > 0) { - (*filter->filter_function)(*p++, filter); - n--; - } - - mbfl_convert_filter_flush(filter); - mbfl_convert_filter_delete(filter); - } - - return len; -} - - -/* - * strimwidth - */ -struct collector_strimwidth_data { - mbfl_convert_filter *decoder; - mbfl_convert_filter *decoder_backup; - mbfl_memory_device device; - int from; - int width; - int outwidth; - int outchar; - int status; - int endpos; -}; - -static int -collector_strimwidth(int c, void* data) -{ - struct collector_strimwidth_data *pc = (struct collector_strimwidth_data*)data; - - switch (pc->status) { - case 10: - (*pc->decoder->filter_function)(c, pc->decoder); - break; - default: - if (pc->outchar >= pc->from) { - pc->outwidth += (is_fullwidth(c) ? 2: 1); - - if (pc->outwidth > pc->width) { - if (pc->status == 0) { - pc->endpos = pc->device.pos; - mbfl_convert_filter_copy(pc->decoder, pc->decoder_backup); - } - pc->status++; - (*pc->decoder->filter_function)(c, pc->decoder); - c = -1; - } else { - (*pc->decoder->filter_function)(c, pc->decoder); - } - } - pc->outchar++; - break; - } - - return c; -} - -mbfl_string * -mbfl_strimwidth( - mbfl_string *string, - mbfl_string *marker, - mbfl_string *result, - int from, - int width) -{ - struct collector_strimwidth_data pc; - mbfl_convert_filter *encoder; - int n, mkwidth; - unsigned char *p; - - if (string == NULL || result == NULL) { - return NULL; - } - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - mbfl_memory_device_init(&pc.device, width, 0); - - /* output code filter */ - pc.decoder = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &pc.device); - pc.decoder_backup = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &pc.device); - /* wchar filter */ - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - collector_strimwidth, 0, &pc); - if (pc.decoder == NULL || pc.decoder_backup == NULL || encoder == NULL) { - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(pc.decoder); - mbfl_convert_filter_delete(pc.decoder_backup); - return NULL; - } - mkwidth = 0; - if (marker) { - mkwidth = mbfl_strwidth(marker); - } - pc.from = from; - pc.width = width - mkwidth; - pc.outwidth = 0; - pc.outchar = 0; - pc.status = 0; - pc.endpos = 0; - - /* feed data */ - p = string->val; - n = string->len; - if (p != NULL) { - while (n > 0) { - n--; - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - } - mbfl_convert_filter_flush(encoder); - if (pc.status != 0 && mkwidth > 0) { - pc.width += mkwidth; - while (n > 0) { - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - n--; - } - mbfl_convert_filter_flush(encoder); - if (pc.status != 1) { - pc.status = 10; - pc.device.pos = pc.endpos; - mbfl_convert_filter_copy(pc.decoder_backup, pc.decoder); - mbfl_convert_filter_reset(encoder, marker->no_encoding, mbfl_no_encoding_wchar); - p = marker->val; - n = marker->len; - while (n > 0) { - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - n--; - } - mbfl_convert_filter_flush(encoder); - } - } else if (pc.status != 0) { - pc.device.pos = pc.endpos; - mbfl_convert_filter_copy(pc.decoder_backup, pc.decoder); - } - mbfl_convert_filter_flush(pc.decoder); - } - result = mbfl_memory_device_result(&pc.device, result); - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(pc.decoder); - mbfl_convert_filter_delete(pc.decoder_backup); - - return result; -} - - - -/* - * convert Hankaku and Zenkaku - */ -struct collector_hantozen_data { - mbfl_convert_filter *next_filter; - int mode; - int status; - int cache; -}; - -static const unsigned char hankana2zenkata_table[64] = { - 0x00,0x02,0x0C,0x0D,0x01,0xFB,0xF2,0xA1,0xA3,0xA5, - 0xA7,0xA9,0xE3,0xE5,0xE7,0xC3,0xFC,0xA2,0xA4,0xA6, - 0xA8,0xAA,0xAB,0xAD,0xAF,0xB1,0xB3,0xB5,0xB7,0xB9, - 0xBB,0xBD,0xBF,0xC1,0xC4,0xC6,0xC8,0xCA,0xCB,0xCC, - 0xCD,0xCE,0xCF,0xD2,0xD5,0xD8,0xDB,0xDE,0xDF,0xE0, - 0xE1,0xE2,0xE4,0xE6,0xE8,0xE9,0xEA,0xEB,0xEC,0xED, - 0xEF,0xF3,0x9B,0x9C -}; -static const unsigned char hankana2zenhira_table[64] = { - 0x00,0x02,0x0C,0x0D,0x01,0xFB,0x92,0x41,0x43,0x45, - 0x47,0x49,0x83,0x85,0x87,0x63,0xFC,0x42,0x44,0x46, - 0x48,0x4A,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59, - 0x5B,0x5D,0x5F,0x61,0x64,0x66,0x68,0x6A,0x6B,0x6C, - 0x6D,0x6E,0x6F,0x72,0x75,0x78,0x7B,0x7E,0x7F,0x80, - 0x81,0x82,0x84,0x86,0x88,0x89,0x8A,0x8B,0x8C,0x8D, - 0x8F,0x93,0x9B,0x9C -}; -static const unsigned char zenkana2hankana_table[84][2] = { - {0x67,0x00},{0x71,0x00},{0x68,0x00},{0x72,0x00},{0x69,0x00}, - {0x73,0x00},{0x6A,0x00},{0x74,0x00},{0x6B,0x00},{0x75,0x00}, - {0x76,0x00},{0x76,0x9E},{0x77,0x00},{0x77,0x9E},{0x78,0x00}, - {0x78,0x9E},{0x79,0x00},{0x79,0x9E},{0x7A,0x00},{0x7A,0x9E}, - {0x7B,0x00},{0x7B,0x9E},{0x7C,0x00},{0x7C,0x9E},{0x7D,0x00}, - {0x7D,0x9E},{0x7E,0x00},{0x7E,0x9E},{0x7F,0x00},{0x7F,0x9E}, - {0x80,0x00},{0x80,0x9E},{0x81,0x00},{0x81,0x9E},{0x6F,0x00}, - {0x82,0x00},{0x82,0x9E},{0x83,0x00},{0x83,0x9E},{0x84,0x00}, - {0x84,0x9E},{0x85,0x00},{0x86,0x00},{0x87,0x00},{0x88,0x00}, - {0x89,0x00},{0x8A,0x00},{0x8A,0x9E},{0x8A,0x9F},{0x8B,0x00}, - {0x8B,0x9E},{0x8B,0x9F},{0x8C,0x00},{0x8C,0x9E},{0x8C,0x9F}, - {0x8D,0x00},{0x8D,0x9E},{0x8D,0x9F},{0x8E,0x00},{0x8E,0x9E}, - {0x8E,0x9F},{0x8F,0x00},{0x90,0x00},{0x91,0x00},{0x92,0x00}, - {0x93,0x00},{0x6C,0x00},{0x94,0x00},{0x6D,0x00},{0x95,0x00}, - {0x6E,0x00},{0x96,0x00},{0x97,0x00},{0x98,0x00},{0x99,0x00}, - {0x9A,0x00},{0x9B,0x00},{0x9C,0x00},{0x9C,0x00},{0x72,0x00}, - {0x74,0x00},{0x66,0x00},{0x9D,0x00},{0x73,0x9E} -}; - -static int -collector_hantozen(int c, void* data) -{ - int s, mode, n; - struct collector_hantozen_data *pc = (struct collector_hantozen_data*)data; - - s = c; - mode = pc->mode; - - if (mode & 0xf) { /* hankaku to zenkaku */ - if ((mode & 0x1) && c >= 0x21 && c <= 0x7d && c != 0x22 && c != 0x27 && c != 0x5c) { /* all except <"> <'> <\> <~> */ - s = c + 0xfee0; - } else if ((mode & 0x2) && ((c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a))) { /* alpha */ - s = c + 0xfee0; - } else if ((mode & 0x4) && c >= 0x30 && c <= 0x39) { /* num */ - s = c + 0xfee0; - } else if ((mode & 0x8) && c == 0x20) { /* spase */ - s = 0x3000; - } - } - - if (mode & 0xf0) { /* zenkaku to hankaku */ - if ((mode & 0x10) && c >= 0xff01 && c <= 0xff5d && c != 0xff02 && c != 0xff07 && c!= 0xff3c) { /* all except <"> <'> <\> <~> */ - s = c - 0xfee0; - } else if ((mode & 0x20) && ((c >= 0xff21 && c <= 0xff3a) || (c >= 0xff41 && c <= 0xff5a))) { /* alpha */ - s = c - 0xfee0; - } else if ((mode & 0x40) && (c >= 0xff10 && c <= 0xff19)) { /* num */ - s = c - 0xfee0; - } else if ((mode & 0x80) && (c == 0x3000)) { /* spase */ - s = 0x20; - } else if ((mode & 0x10) && (c == 0x2212)) { /* MINUS SIGN */ - s = 0x2d; - } - } - - if (mode & 0x300) { /* hankaku kana to zenkaku kana */ - if ((mode & 0x100) && (mode & 0x800)) { /* hankaku kana to zenkaku katakana and glue voiced sound mark */ - if (c >= 0xff61 && c <= 0xff9f) { - if (pc->status) { - n = (pc->cache - 0xff60) & 0x3f; - if (c == 0xff9e && ((n >= 22 && n <= 36) || (n >= 42 && n <= 46))) { - pc->status = 0; - s = 0x3001 + hankana2zenkata_table[n]; - } else if (c == 0xff9e && n == 19) { - pc->status = 0; - s = 0x30f4; - } else if (c == 0xff9f && (n >= 42 && n <= 46)) { - pc->status = 0; - s = 0x3002 + hankana2zenkata_table[n]; - } else { - pc->status = 1; - pc->cache = c; - s = 0x3000 + hankana2zenkata_table[n]; - } - } else { - pc->status = 1; - pc->cache = c; - return c; - } - } else { - if (pc->status) { - n = (pc->cache - 0xff60) & 0x3f; - pc->status = 0; - (*pc->next_filter->filter_function)(0x3000 + hankana2zenkata_table[n], pc->next_filter); - } - } - } else if ((mode & 0x200) && (mode & 0x800)) { /* hankaku kana to zenkaku hirangana and glue voiced sound mark */ - if (c >= 0xff61 && c <= 0xff9f) { - if (pc->status) { - n = (pc->cache - 0xff60) & 0x3f; - if (c == 0xff9e && ((n >= 22 && n <= 36) || (n >= 42 && n <= 46))) { - pc->status = 0; - s = 0x3001 + hankana2zenhira_table[n]; - } else if (c == 0xff9f && (n >= 42 && n <= 46)) { - pc->status = 0; - s = 0x3002 + hankana2zenhira_table[n]; - } else { - pc->status = 1; - pc->cache = c; - s = 0x3000 + hankana2zenhira_table[n]; - } - } else { - pc->status = 1; - pc->cache = c; - return c; - } - } else { - if (pc->status) { - n = (pc->cache - 0xff60) & 0x3f; - pc->status = 0; - (*pc->next_filter->filter_function)(0x3000 + hankana2zenhira_table[n], pc->next_filter); - } - } - } else if ((mode & 0x100) && c >= 0xff61 && c <= 0xff9f) { /* hankaku kana to zenkaku katakana */ - s = 0x3000 + hankana2zenkata_table[c - 0xff60]; - } else if ((mode & 0x200) && c >= 0xff61 && c <= 0xff9f) { /* hankaku kana to zenkaku hirangana */ - s = 0x3000 + hankana2zenhira_table[c - 0xff60]; - } - } - - if (mode & 0x3000) { /* Zenkaku kana to hankaku kana */ - if ((mode & 0x1000) && c >= 0x30a1 && c <= 0x30f4) { /* Zenkaku katakana to hankaku kana */ - n = c - 0x30a1; - if (zenkana2hankana_table[n][1] != 0) { - (*pc->next_filter->filter_function)(0xff00 + zenkana2hankana_table[n][0], pc->next_filter); - s = 0xff00 + zenkana2hankana_table[n][1]; - } else { - s = 0xff00 + zenkana2hankana_table[n][0]; - } - } else if ((mode & 0x2000) && c >= 0x3041 && c <= 0x3093) { /* Zenkaku hirangana to hankaku kana */ - n = c - 0x3041; - if (zenkana2hankana_table[n][1] != 0) { - (*pc->next_filter->filter_function)(0xff00 + zenkana2hankana_table[n][0], pc->next_filter); - s = 0xff00 + zenkana2hankana_table[n][1]; - } else { - s = 0xff00 + zenkana2hankana_table[n][0]; - } - } else if (c == 0x3001) { - s = 0xff64; /* HALFWIDTH IDEOGRAPHIC COMMA */ - } else if (c == 0x3002) { - s = 0xff61; /* HALFWIDTH IDEOGRAPHIC FULL STOP */ - } else if (c == 0x300c) { - s = 0xff62; /* HALFWIDTH LEFT CORNER BRACKET */ - } else if (c == 0x300d) { - s = 0xff63; /* HALFWIDTH RIGHT CORNER BRACKET */ - } else if (c == 0x309b) { - s = 0xff9e; /* HALFWIDTH KATAKANA VOICED SOUND MARK */ - } else if (c == 0x309c) { - s = 0xff9f; /* HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK */ - } else if (c == 0x30fc) { - s = 0xff70; /* HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK */ - } else if (c == 0x30fb) { - s = 0xff65; /* HALFWIDTH KATAKANA MIDDLE DOT */ - } - } else if (mode & 0x30000) { - if ((mode & 0x10000) && c >= 0x3041 && c <= 0x3093) { /* Zenkaku hirangana to Zenkaku katakana */ - s = c + 0x60; - } else if ((mode & 0x20000) && c >= 0x30a1 && c <= 0x30f3) { /* Zenkaku katakana to Zenkaku hirangana */ - s = c - 0x60; - } - } - - if (mode & 0x100000) { /* special ascii to symbol */ - if (c == 0x5c) { - s = 0xffe5; /* FULLWIDTH YEN SIGN */ - } else if (c == 0xa5) { /* YEN SIGN */ - s = 0xffe5; /* FULLWIDTH YEN SIGN */ - } else if (c == 0x7e) { - s = 0xffe3; /* FULLWIDTH MACRON */ - } else if (c == 0x203e) { /* OVERLINE */ - s = 0xffe3; /* FULLWIDTH MACRON */ - } else if (c == 0x27) { - s = 0x2019; /* RIGHT SINGLE QUOTATION MARK */ - } else if (c == 0x22) { - s = 0x201d; /* RIGHT DOUBLE QUOTATION MARK */ - } - } else if (mode & 0x200000) { /* special symbol to ascii */ - if (c == 0xffe5) { /* FULLWIDTH YEN SIGN */ - s = 0x5c; - } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s = 0x5c; - } else if (c == 0xffe3) { /* FULLWIDTH MACRON */ - s = 0x7e; - } else if (c == 0x203e) { /* OVERLINE */ - s = 0x7e; - } else if (c == 0x2018) { /* LEFT SINGLE QUOTATION MARK*/ - s = 0x27; - } else if (c == 0x2019) { /* RIGHT SINGLE QUOTATION MARK */ - s = 0x27; - } else if (c == 0x201c) { /* LEFT DOUBLE QUOTATION MARK */ - s = 0x22; - } else if (c == 0x201d) { /* RIGHT DOUBLE QUOTATION MARK */ - s = 0x22; - } - } - - if (mode & 0x400000) { /* special ascii to symbol */ - if (c == 0x5c) { - s = 0xff3c; /* FULLWIDTH REVERSE SOLIDUS */ - } else if (c == 0x7e) { - s = 0xff5e; /* FULLWIDTH TILDE */ - } else if (c == 0x27) { - s = 0xff07; /* FULLWIDTH APOSTROPHE */ - } else if (c == 0x22) { - s = 0xff02; /* FULLWIDTH QUOTATION MARK */ - } - } else if (mode & 0x800000) { /* special symbol to ascii */ - if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ - s = 0x5c; - } else if (c == 0xff5e) { /* FULLWIDTH TILDE */ - s = 0x7e; - } else if (c == 0xff07) { /* FULLWIDTH APOSTROPHE */ - s = 0x27; - } else if (c == 0xff02) { /* FULLWIDTH QUOTATION MARK */ - s = 0x22; - } - } - - return (*pc->next_filter->filter_function)(s, pc->next_filter); -} - -static int -collector_hantozen_flush(struct collector_hantozen_data *pc) -{ - int ret, n; - - ret = 0; - if (pc->status) { - n = (pc->cache - 0xff60) & 0x3f; - if (pc->mode & 0x100) { /* hankaku kana to zenkaku katakana */ - ret = (*pc->next_filter->filter_function)(0x3000 + hankana2zenkata_table[n], pc->next_filter); - } else if (pc->mode & 0x200) { /* hankaku kana to zenkaku hirangana */ - ret = (*pc->next_filter->filter_function)(0x3000 + hankana2zenhira_table[n], pc->next_filter); - } - pc->status = 0; - } - - return ret; -} - -mbfl_string * -mbfl_ja_jp_hantozen( - mbfl_string *string, - mbfl_string *result, - int mode) -{ - int n; - unsigned char *p; - const mbfl_encoding *encoding; - mbfl_memory_device device; - struct collector_hantozen_data pc; - mbfl_convert_filter *decoder; - mbfl_convert_filter *encoder; - - /* initialize */ - if (string == NULL || result == NULL) { - return NULL; - } - encoding = mbfl_no2encoding(string->no_encoding); - if (encoding == NULL) { - return NULL; - } - mbfl_memory_device_init(&device, string->len, 0); - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - decoder = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &device); - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - collector_hantozen, 0, &pc); - if (decoder == NULL || encoder == NULL) { - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(decoder); - return NULL; - } - pc.next_filter = decoder; - pc.mode = mode; - pc.status = 0; - pc.cache = 0; - - /* feed data */ - p = string->val; - n = string->len; - if (p != NULL) { - while (n > 0) { - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - n--; - } - } - - mbfl_convert_filter_flush(encoder); - collector_hantozen_flush(&pc); - mbfl_convert_filter_flush(decoder); - result = mbfl_memory_device_result(&device, result); - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(decoder); - - return result; -} - - -/* - * MIME header encode - */ -struct mime_header_encoder_data { - mbfl_convert_filter *conv1_filter; - mbfl_convert_filter *block_filter; - mbfl_convert_filter *conv2_filter; - mbfl_convert_filter *conv2_filter_backup; - mbfl_convert_filter *encod_filter; - mbfl_convert_filter *encod_filter_backup; - mbfl_memory_device outdev; - mbfl_memory_device tmpdev; - int status1; - int status2; - int prevpos; - int linehead; - int firstindent; - int encnamelen; - int lwsplen; - char encname[128]; - char lwsp[16]; -}; - -static int -mime_header_encoder_block_collector(int c, void *data) -{ - int n; - struct mime_header_encoder_data *pe = (struct mime_header_encoder_data *)data; - - switch (pe->status2) { - case 1: /* encoded word */ - pe->prevpos = pe->outdev.pos; - mbfl_convert_filter_copy(pe->conv2_filter, pe->conv2_filter_backup); - mbfl_convert_filter_copy(pe->encod_filter, pe->encod_filter_backup); - (*pe->conv2_filter->filter_function)(c, pe->conv2_filter); - (*pe->conv2_filter->filter_flush)(pe->conv2_filter); - (*pe->encod_filter->filter_flush)(pe->encod_filter); - n = pe->outdev.pos - pe->linehead + pe->firstindent; - pe->outdev.pos = pe->prevpos; - mbfl_convert_filter_copy(pe->conv2_filter_backup, pe->conv2_filter); - mbfl_convert_filter_copy(pe->encod_filter_backup, pe->encod_filter); - if (n >= 74) { - (*pe->conv2_filter->filter_flush)(pe->conv2_filter); - (*pe->encod_filter->filter_flush)(pe->encod_filter); - mbfl_memory_device_strncat(&pe->outdev, "\x3f\x3d", 2); /* ?= */ - mbfl_memory_device_strncat(&pe->outdev, pe->lwsp, pe->lwsplen); - pe->linehead = pe->outdev.pos; - pe->firstindent = 0; - mbfl_memory_device_strncat(&pe->outdev, pe->encname, pe->encnamelen); - c = (*pe->conv2_filter->filter_function)(c, pe->conv2_filter); - } else { - c = (*pe->conv2_filter->filter_function)(c, pe->conv2_filter); - } - break; - - default: - mbfl_memory_device_strncat(&pe->outdev, pe->encname, pe->encnamelen); - c = (*pe->conv2_filter->filter_function)(c, pe->conv2_filter); - pe->status2 = 1; - break; - } - - return c; -} - -static int -mime_header_encoder_collector(int c, void *data) -{ - static int qp_table[256] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 */ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */ - 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 1, 0, 1, /* 0x10 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x50 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x70 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xA0 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xB0 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xC0 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xD0 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xE0 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* 0xF0 */ - }; - - int n; - struct mime_header_encoder_data *pe = (struct mime_header_encoder_data *)data; - - switch (pe->status1) { - case 11: /* encoded word */ - (*pe->block_filter->filter_function)(c, pe->block_filter); - break; - - default: /* ASCII */ - if (!qp_table[(c & 0xff)]) { /* ordinary characters */ - mbfl_memory_device_output(c, &pe->tmpdev); - pe->status1 = 1; - } else if (pe->status1 == 0 && c == 0x20) { /* repeat SPACE */ - mbfl_memory_device_output(c, &pe->tmpdev); - } else { - if (pe->tmpdev.pos < 74 && c == 0x20) { - n = pe->outdev.pos - pe->linehead + pe->tmpdev.pos + pe->firstindent; - if (n > 74) { - mbfl_memory_device_strncat(&pe->outdev, pe->lwsp, pe->lwsplen); /* LWSP */ - pe->linehead = pe->outdev.pos; - pe->firstindent = 0; - } else if (pe->outdev.pos > 0) { - mbfl_memory_device_output(0x20, &pe->outdev); - } - mbfl_memory_device_devcat(&pe->outdev, &pe->tmpdev); - mbfl_memory_device_reset(&pe->tmpdev); - pe->status1 = 0; - } else { - n = pe->outdev.pos - pe->linehead + pe->encnamelen + pe->firstindent; - if (n > 60) { - mbfl_memory_device_strncat(&pe->outdev, pe->lwsp, pe->lwsplen); /* LWSP */ - pe->linehead = pe->outdev.pos; - pe->firstindent = 0; - } else if (pe->outdev.pos > 0) { - mbfl_memory_device_output(0x20, &pe->outdev); - } - mbfl_convert_filter_devcat(pe->block_filter, &pe->tmpdev); - mbfl_memory_device_reset(&pe->tmpdev); - (*pe->block_filter->filter_function)(c, pe->block_filter); - pe->status1 = 11; - } - } - break; - } - - return c; -} - -mbfl_string * -mime_header_encoder_result(struct mime_header_encoder_data *pe, mbfl_string *result) -{ - if (pe->status1 >= 10) { - (*pe->conv2_filter->filter_flush)(pe->conv2_filter); - (*pe->encod_filter->filter_flush)(pe->encod_filter); - mbfl_memory_device_strncat(&pe->outdev, "\x3f\x3d", 2); /* ?= */ - } else if (pe->tmpdev.pos > 0) { - if (pe->outdev.pos > 0) { - if ((pe->outdev.pos - pe->linehead + pe->tmpdev.pos) > 74) { - mbfl_memory_device_strncat(&pe->outdev, pe->lwsp, pe->lwsplen); - } else { - mbfl_memory_device_output(0x20, &pe->outdev); - } - } - mbfl_memory_device_devcat(&pe->outdev, &pe->tmpdev); - } - mbfl_memory_device_reset(&pe->tmpdev); - pe->prevpos = 0; - pe->linehead = 0; - pe->status1 = 0; - pe->status2 = 0; - - return mbfl_memory_device_result(&pe->outdev, result); -} - -struct mime_header_encoder_data* -mime_header_encoder_new( - enum mbfl_no_encoding incode, - enum mbfl_no_encoding outcode, - enum mbfl_no_encoding transenc) -{ - int n; - const char *s; - const mbfl_encoding *outencoding; - struct mime_header_encoder_data *pe; - - /* get output encoding and check MIME charset name */ - outencoding = mbfl_no2encoding(outcode); - if (outencoding == NULL || outencoding->mime_name == NULL || outencoding->mime_name[0] == '\0') { - return NULL; - } - - pe = (struct mime_header_encoder_data*)mbfl_malloc(sizeof(struct mime_header_encoder_data)); - if (pe == NULL) { - return NULL; - } - - mbfl_memory_device_init(&pe->outdev, 0, 0); - mbfl_memory_device_init(&pe->tmpdev, 0, 0); - pe->prevpos = 0; - pe->linehead = 0; - pe->firstindent = 0; - pe->status1 = 0; - pe->status2 = 0; - - /* make the encoding description string exp. "=?ISO-2022-JP?B?" */ - n = 0; - pe->encname[n++] = 0x3d; - pe->encname[n++] = 0x3f; - s = outencoding->mime_name; - while (*s) { - pe->encname[n++] = *s++; - } - pe->encname[n++] = 0x3f; - if (transenc == mbfl_no_encoding_qprint) { - pe->encname[n++] = 0x51; - } else { - pe->encname[n++] = 0x42; - transenc = mbfl_no_encoding_base64; - } - pe->encname[n++] = 0x3f; - pe->encname[n] = '\0'; - pe->encnamelen = n; - - n = 0; - pe->lwsp[n++] = 0x0d; - pe->lwsp[n++] = 0x0a; - pe->lwsp[n++] = 0x20; - pe->lwsp[n] = '\0'; - pe->lwsplen = n; - - /* transfer encode filter */ - pe->encod_filter = mbfl_convert_filter_new(outcode, transenc, mbfl_memory_device_output, 0, &(pe->outdev)); - pe->encod_filter_backup = mbfl_convert_filter_new(outcode, transenc, mbfl_memory_device_output, 0, &(pe->outdev)); - - /* Output code filter */ - pe->conv2_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter); - pe->conv2_filter_backup = mbfl_convert_filter_new(mbfl_no_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter); - - /* encoded block filter */ - pe->block_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, mbfl_no_encoding_wchar, mime_header_encoder_block_collector, 0, pe); - - /* Input code filter */ - pe->conv1_filter = mbfl_convert_filter_new(incode, mbfl_no_encoding_wchar, mime_header_encoder_collector, 0, pe); - - if (pe->encod_filter == NULL || - pe->encod_filter_backup == NULL || - pe->conv2_filter == NULL || - pe->conv2_filter_backup == NULL || - pe->conv1_filter == NULL) { - mime_header_encoder_delete(pe); - return NULL; - } - - if (transenc == mbfl_no_encoding_qprint) { - pe->encod_filter->status |= MBFL_QPRINT_STS_MIME_HEADER; - pe->encod_filter_backup->status |= MBFL_QPRINT_STS_MIME_HEADER; - } else { - pe->encod_filter->status |= MBFL_BASE64_STS_MIME_HEADER; - pe->encod_filter_backup->status |= MBFL_BASE64_STS_MIME_HEADER; - } - - return pe; -} - -void -mime_header_encoder_delete(struct mime_header_encoder_data *pe) -{ - if (pe) { - mbfl_convert_filter_delete(pe->conv1_filter); - mbfl_convert_filter_delete(pe->block_filter); - mbfl_convert_filter_delete(pe->conv2_filter); - mbfl_convert_filter_delete(pe->conv2_filter_backup); - mbfl_convert_filter_delete(pe->encod_filter); - mbfl_convert_filter_delete(pe->encod_filter_backup); - mbfl_memory_device_clear(&pe->outdev); - mbfl_memory_device_clear(&pe->tmpdev); - mbfl_free((void*)pe); - } -} - -int -mime_header_encoder_feed(int c, struct mime_header_encoder_data *pe) -{ - return (*pe->conv1_filter->filter_function)(c, pe->conv1_filter); -} - -mbfl_string * -mbfl_mime_header_encode( - mbfl_string *string, - mbfl_string *result, - enum mbfl_no_encoding outcode, - enum mbfl_no_encoding encoding, - const char *linefeed, - int indent) -{ - int n; - unsigned char *p; - struct mime_header_encoder_data *pe; - - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = mbfl_no_encoding_ascii; - - pe = mime_header_encoder_new(string->no_encoding, outcode, encoding); - if (pe == NULL) { - return NULL; - } - - if (linefeed != NULL) { - n = 0; - while (*linefeed && n < 8) { - pe->lwsp[n++] = *linefeed++; - } - pe->lwsp[n++] = 0x20; - pe->lwsp[n] = '\0'; - pe->lwsplen = n; - } - if (indent > 0 && indent < 74) { - pe->firstindent = indent; - } - - n = string->len; - p = string->val; - while (n > 0) { - (*pe->conv1_filter->filter_function)(*p++, pe->conv1_filter); - n--; - } - - result = mime_header_encoder_result(pe, result); - mime_header_encoder_delete(pe); - - return result; -} - - -/* - * MIME header decode - */ -struct mime_header_decoder_data { - mbfl_convert_filter *deco_filter; - mbfl_convert_filter *conv1_filter; - mbfl_convert_filter *conv2_filter; - mbfl_memory_device outdev; - mbfl_memory_device tmpdev; - int cspos; - int status; - enum mbfl_no_encoding encoding; - enum mbfl_no_encoding incode; - enum mbfl_no_encoding outcode; -}; - -static int -mime_header_decoder_collector(int c, void* data) -{ - const mbfl_encoding *encoding; - struct mime_header_decoder_data *pd = (struct mime_header_decoder_data*)data; - - switch (pd->status) { - case 1: - if (c == 0x3f) { /* ? */ - mbfl_memory_device_output(c, &pd->tmpdev); - pd->cspos = pd->tmpdev.pos; - pd->status = 2; - } else { - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - mbfl_memory_device_reset(&pd->tmpdev); - if (c == 0x3d) { /* = */ - mbfl_memory_device_output(c, &pd->tmpdev); - } else if (c == 0x0d || c == 0x0a) { /* CR or LF */ - pd->status = 9; - } else { - (*pd->conv1_filter->filter_function)(c, pd->conv1_filter); - pd->status = 0; - } - } - break; - case 2: /* store charset string */ - if (c == 0x3f) { /* ? */ - /* identify charset */ - mbfl_memory_device_output('\0', &pd->tmpdev); - encoding = mbfl_name2encoding((const char *)&pd->tmpdev.buffer[pd->cspos]); - if (encoding != NULL) { - pd->incode = encoding->no_encoding; - pd->status = 3; - } - mbfl_memory_device_unput(&pd->tmpdev); - mbfl_memory_device_output(c, &pd->tmpdev); - } else { - mbfl_memory_device_output(c, &pd->tmpdev); - if (pd->tmpdev.pos > 100) { /* too long charset string */ - pd->status = 0; - } else if (c == 0x0d || c == 0x0a) { /* CR or LF */ - mbfl_memory_device_unput(&pd->tmpdev); - pd->status = 9; - } - if (pd->status != 2) { - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - mbfl_memory_device_reset(&pd->tmpdev); - } - } - break; - case 3: /* identify encoding */ - mbfl_memory_device_output(c, &pd->tmpdev); - if (c == 0x42 || c == 0x62) { /* 'B' or 'b' */ - pd->encoding = mbfl_no_encoding_base64; - pd->status = 4; - } else if (c == 0x51 || c == 0x71) { /* 'Q' or 'q' */ - pd->encoding = mbfl_no_encoding_qprint; - pd->status = 4; - } else { - if (c == 0x0d || c == 0x0a) { /* CR or LF */ - mbfl_memory_device_unput(&pd->tmpdev); - pd->status = 9; - } else { - pd->status = 0; - } - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - mbfl_memory_device_reset(&pd->tmpdev); - } - break; - case 4: /* reset filter */ - mbfl_memory_device_output(c, &pd->tmpdev); - if (c == 0x3f) { /* ? */ - /* charset convert filter */ - mbfl_convert_filter_reset(pd->conv1_filter, pd->incode, mbfl_no_encoding_wchar); - /* decode filter */ - mbfl_convert_filter_reset(pd->deco_filter, pd->encoding, mbfl_no_encoding_8bit); - pd->status = 5; - } else { - if (c == 0x0d || c == 0x0a) { /* CR or LF */ - mbfl_memory_device_unput(&pd->tmpdev); - pd->status = 9; - } else { - pd->status = 0; - } - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - } - mbfl_memory_device_reset(&pd->tmpdev); - break; - case 5: /* encoded block */ - if (c == 0x3f) { /* ? */ - pd->status = 6; - } else { - (*pd->deco_filter->filter_function)(c, pd->deco_filter); - } - break; - case 6: /* check end position */ - if (c == 0x3d) { /* = */ - /* flush and reset filter */ - (*pd->deco_filter->filter_flush)(pd->deco_filter); - (*pd->conv1_filter->filter_flush)(pd->conv1_filter); - mbfl_convert_filter_reset(pd->conv1_filter, mbfl_no_encoding_ascii, mbfl_no_encoding_wchar); - pd->status = 7; - } else { - (*pd->deco_filter->filter_function)(0x3f, pd->deco_filter); - if (c != 0x3f) { /* ? */ - (*pd->deco_filter->filter_function)(c, pd->deco_filter); - pd->status = 5; - } - } - break; - case 7: /* after encoded block */ - if (c == 0x0d || c == 0x0a) { /* CR LF */ - pd->status = 8; - } else { - mbfl_memory_device_output(c, &pd->tmpdev); - if (c == 0x3d) { /* = */ - pd->status = 1; - } else if (c != 0x20 && c != 0x09) { /* not space */ - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - mbfl_memory_device_reset(&pd->tmpdev); - pd->status = 0; - } - } - break; - case 8: /* folding */ - case 9: /* folding */ - if (c != 0x0d && c != 0x0a && c != 0x20 && c != 0x09) { - if (c == 0x3d) { /* = */ - if (pd->status == 8) { - mbfl_memory_device_output(0x20, &pd->tmpdev); /* SPACE */ - } else { - (*pd->conv1_filter->filter_function)(0x20, pd->conv1_filter); - } - mbfl_memory_device_output(c, &pd->tmpdev); - pd->status = 1; - } else { - mbfl_memory_device_output(0x20, &pd->tmpdev); - mbfl_memory_device_output(c, &pd->tmpdev); - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - mbfl_memory_device_reset(&pd->tmpdev); - pd->status = 0; - } - } - break; - default: /* non encoded block */ - if (c == 0x0d || c == 0x0a) { /* CR LF */ - pd->status = 9; - } else if (c == 0x3d) { /* = */ - mbfl_memory_device_output(c, &pd->tmpdev); - pd->status = 1; - } else { - (*pd->conv1_filter->filter_function)(c, pd->conv1_filter); - } - break; - } - - return c; -} - -mbfl_string * -mime_header_decoder_result(struct mime_header_decoder_data *pd, mbfl_string *result) -{ - switch (pd->status) { - case 1: - case 2: - case 3: - case 4: - case 7: - case 8: - case 9: - mbfl_convert_filter_devcat(pd->conv1_filter, &pd->tmpdev); - break; - case 5: - case 6: - (*pd->deco_filter->filter_flush)(pd->deco_filter); - (*pd->conv1_filter->filter_flush)(pd->conv1_filter); - break; - } - (*pd->conv2_filter->filter_flush)(pd->conv2_filter); - mbfl_memory_device_reset(&pd->tmpdev); - pd->status = 0; - - return mbfl_memory_device_result(&pd->outdev, result); -} - -struct mime_header_decoder_data* -mime_header_decoder_new(enum mbfl_no_encoding outcode) -{ - struct mime_header_decoder_data *pd; - - pd = (struct mime_header_decoder_data*)mbfl_malloc(sizeof(struct mime_header_decoder_data)); - if (pd == NULL) { - return NULL; - } - - mbfl_memory_device_init(&pd->outdev, 0, 0); - mbfl_memory_device_init(&pd->tmpdev, 0, 0); - pd->cspos = 0; - pd->status = 0; - pd->encoding = mbfl_no_encoding_pass; - pd->incode = mbfl_no_encoding_ascii; - pd->outcode = outcode; - /* charset convert filter */ - pd->conv2_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, pd->outcode, mbfl_memory_device_output, 0, &pd->outdev); - pd->conv1_filter = mbfl_convert_filter_new(pd->incode, mbfl_no_encoding_wchar, mbfl_filter_output_pipe, 0, pd->conv2_filter); - /* decode filter */ - pd->deco_filter = mbfl_convert_filter_new(pd->encoding, mbfl_no_encoding_8bit, mbfl_filter_output_pipe, 0, pd->conv1_filter); - - if (pd->conv1_filter == NULL || pd->conv2_filter == NULL || pd->deco_filter == NULL) { - mime_header_decoder_delete(pd); - return NULL; - } - - return pd; -} - -void -mime_header_decoder_delete(struct mime_header_decoder_data *pd) -{ - if (pd) { - mbfl_convert_filter_delete(pd->conv2_filter); - mbfl_convert_filter_delete(pd->conv1_filter); - mbfl_convert_filter_delete(pd->deco_filter); - mbfl_memory_device_clear(&pd->outdev); - mbfl_memory_device_clear(&pd->tmpdev); - mbfl_free((void*)pd); - } -} - -int -mime_header_decoder_feed(int c, struct mime_header_decoder_data *pd) -{ - return mime_header_decoder_collector(c, pd); -} - -mbfl_string * -mbfl_mime_header_decode( - mbfl_string *string, - mbfl_string *result, - enum mbfl_no_encoding outcode) -{ - int n; - unsigned char *p; - struct mime_header_decoder_data *pd; - - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = outcode; - - pd = mime_header_decoder_new(outcode); - if (pd == NULL) { - return NULL; - } - - /* feed data */ - n = string->len; - p = string->val; - while (n > 0) { - mime_header_decoder_collector(*p++, pd); - n--; - } - - result = mime_header_decoder_result(pd, result); - mime_header_decoder_delete(pd); - - return result; -} - - - -/* - * convert HTML numeric entity - */ -struct collector_htmlnumericentity_data { - mbfl_convert_filter *decoder; - int status; - int cache; - int digit; - int *convmap; - int mapsize; -}; - -static int -collector_encode_htmlnumericentity(int c, void *data) -{ - struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)data; - int f, n, s, r, d, size, *mapelm; - - size = pc->mapsize; - f = 0; - n = 0; - while (n < size) { - mapelm = &(pc->convmap[n*4]); - if (c >= mapelm[0] && c <= mapelm[1]) { - s = (c + mapelm[2]) & mapelm[3]; - if (s >= 0) { - (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ - (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ - r = 100000000; - s %= r; - while (r > 0) { - d = s/r; - if (d || f) { - f = 1; - s %= r; - (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); - } - r /= 10; - } - if (!f) { - f = 1; - (*pc->decoder->filter_function)(mbfl_hexchar_table[0], pc->decoder); - } - (*pc->decoder->filter_function)(0x3b, pc->decoder); /* ';' */ - } - } - if (f) { - break; - } - n++; - } - if (!f) { - (*pc->decoder->filter_function)(c, pc->decoder); - } - - return c; -} - -static int -collector_decode_htmlnumericentity(int c, void *data) -{ - struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)data; - int f, n, s, r, d, size, *mapelm; - - switch (pc->status) { - case 1: - if (c == 0x23) { /* '#' */ - pc->status = 2; - } else { - pc->status = 0; - (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ - (*pc->decoder->filter_function)(c, pc->decoder); - } - break; - case 2: - if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ - pc->cache = c - 0x30; - pc->status = 3; - pc->digit = 1; - } else { - pc->status = 0; - (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ - (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ - (*pc->decoder->filter_function)(c, pc->decoder); - } - break; - case 3: - s = 0; - f = 0; - if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ - if (pc->digit > 9) { - pc->status = 0; - s = pc->cache; - f = 1; - } else { - s = pc->cache*10 + c - 0x30; - pc->cache = s; - pc->digit++; - } - } else { - pc->status = 0; - s = pc->cache; - f = 1; - n = 0; - size = pc->mapsize; - while (n < size) { - mapelm = &(pc->convmap[n*4]); - d = s - mapelm[2]; - if (d >= mapelm[0] && d <= mapelm[1]) { - f = 0; - (*pc->decoder->filter_function)(d, pc->decoder); - if (c != 0x3b) { /* ';' */ - (*pc->decoder->filter_function)(c, pc->decoder); - } - break; - } - n++; - } - } - if (f) { - (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ - (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ - r = 1; - n = pc->digit; - while (n > 0) { - r *= 10; - n--; - } - s %= r; - r /= 10; - while (r > 0) { - d = s/r; - s %= r; - r /= 10; - (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); - } - (*pc->decoder->filter_function)(c, pc->decoder); - } - break; - default: - if (c == 0x26) { /* '&' */ - pc->status = 1; - } else { - (*pc->decoder->filter_function)(c, pc->decoder); - } - break; - } - - return c; -} - -mbfl_string * -mbfl_html_numeric_entity( - mbfl_string *string, - mbfl_string *result, - int *convmap, - int mapsize, - int type) -{ - struct collector_htmlnumericentity_data pc; - mbfl_memory_device device; - mbfl_convert_filter *encoder; - int n; - unsigned char *p; - - if (string == NULL || result == NULL) { - return NULL; - } - mbfl_string_init(result); - result->no_language = string->no_language; - result->no_encoding = string->no_encoding; - mbfl_memory_device_init(&device, string->len, 0); - - /* output code filter */ - pc.decoder = mbfl_convert_filter_new( - mbfl_no_encoding_wchar, - string->no_encoding, - mbfl_memory_device_output, 0, &device); - /* wchar filter */ - if (type == 0) { - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - collector_encode_htmlnumericentity, 0, &pc); - } else { - encoder = mbfl_convert_filter_new( - string->no_encoding, - mbfl_no_encoding_wchar, - collector_decode_htmlnumericentity, 0, &pc); - } - if (pc.decoder == NULL || encoder == NULL) { - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(pc.decoder); - return NULL; - } - pc.status = 0; - pc.cache = 0; - pc.digit = 0; - pc.convmap = convmap; - pc.mapsize = mapsize; - - /* feed data */ - p = string->val; - n = string->len; - if (p != NULL) { - while (n > 0) { - if ((*encoder->filter_function)(*p++, encoder) < 0) { - break; - } - n--; - } - } - mbfl_convert_filter_flush(encoder); - mbfl_convert_filter_flush(pc.decoder); - result = mbfl_memory_device_result(&device, result); - mbfl_convert_filter_delete(encoder); - mbfl_convert_filter_delete(pc.decoder); - - return result; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.h b/ext/mbstring/libmbfl/mbfl/mbfilter.h deleted file mode 100644 index d0965251ad886..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter.h +++ /dev/null @@ -1,280 +0,0 @@ -/* charset=UTF-8 - * vim: encoding=utf-8: - * */ - -/* - * "streamable kanji code filter and converter" - * - * Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved. - * - * This software is released under the GNU Lesser General Public License. - * (Version 2.1, February 1999) - * Please read the following detail of the licence (in japanese). - * - * â—†ä½żç”¨è¨ħèĞĉĦäğĥ◆ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Żĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚şĞ‚ˆ£Ĥ開発•‚Œ—Ÿ€‚ĉ Şċĵäĵšç¤ƒƒƒ - * ƒ”ƒĵ‚µ‚¤‚şŻ€è‘—作ĉ¨İĉ³•Š‚ˆ³ä¸‡ċ›½è‘—作ĉ¨İĉĦ約ċš‚Ğ‚ˆ‚Š€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ğ関 - * ™‚‹™ıĤĉ¨İċˆİ‚’ç•™äż™‚‹ĉ¨İċˆİ‚’ĉŒĦ€““ĞèĦŒä½ż—™€‚ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤ - * ‚şŻäğ下Ğĉ˜Žè¨˜—ŸĉĦäğĥĞċ“£Ĥ€“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨™‚‹ĉŽ’äğ–çš„§ŻŞ„ĉ¨İċˆİ - * ‚’Šċ˘ĉ§˜Ğè¨ħèЁ—™€‚ä½•äşşŸ‚Š¨‚‚€äğ下ĉĦäğĥĞċ—Ĥ“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨ - * ™‚‹“¨Ż§›‚“€‚ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’€ŒGNU Lesser General Public License (Version 2.1, February - * 1999)€Ğ示•‚ŒŸĉĦäğĥ§ä½żç”¨™‚‹“¨‚’€ċ…¨Ĥĉ–ıĞè¨ħèЁ—™€‚€ŒGNU Lesser - * General Public License€‚’ĉş€Ÿ•Ş„ä½żç”¨ĞŻ€ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş‹‚‰ĉ›¸é˘ - * Ğ‚ˆ‚‹è¨ħèĞ‚’ċ—‚‹ċż…èĤŒ‚‚Š™€‚ - * - * €ŒGNU Lesser General Public License€ċ…¨ĉ–‡Żäğ下‚Ĥ‚§ƒ–ƒšƒĵ‚¸‹‚‰ċ–ċ—§ - * ™€‚€ŒGNU Lesser General Public License€¨Ż€“‚Œ§Library General - * Public License¨ċ‘ĵ°‚ŒĤ„Ÿ‚‚§™€‚ - * http://www.gnu.org/ --- GNU‚Ĥ‚§ƒ–‚µ‚¤ƒˆ - * http://www.gnu.org/copyleft/lesser.html --- ƒİ‚¤‚ğƒ³‚ıĉ–‡é˘ - * “ƒİ‚¤‚ğƒ³‚ıċ†…ċıŒ‚‹‚‰Ş„ĉ–ı€ċˆ‚ŒŞ„ĉ–ıĞŻä½żç”¨‚’è¨ħèЁ—›‚“€‚ - * - * —‹—ŞŒ‚‰€ċ½“礁¨GNUƒ—ƒ­‚¸‚§‚Żƒˆ¨ç‰ıċšé–˘äż‚‚’示ċ”†ŸŻä¸ğċĵµ™‚‹‚‚§ - * Ż‚‚Š›‚“€‚ - * - * ◆保è¨ĵċ†…ċı◆ - * - * “‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€ĉœŸċ…•‚ŒŸċ‹•ä½œƒğĉݟ能ƒğĉ€§èƒ½‚’ĉŒ¤“¨‚’ç›ĉ¨™¨—Ĥ設計•‚Œ - * 開発•‚ŒĤ„™Œ€“‚Œ‚’保è¨ĵ™‚‹‚‚§Ż‚‚Š›‚“€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘Ż€Œ“ - * €çŠĥĉ…‹§ĉä›•‚ŒĤŠ‚Š€Ÿ¨ˆ°“‚½ƒ•ƒˆ‚Ĥ‚§‚˘ĉœ‰ç”¨ĉ€§Ş„—ç‰ıċš - * ç›çš„Ğċˆè‡´™‚‹“¨¨„£Ÿ€ä½•‚‰‹äżè¨ĵċ†…ċıŒ€ĉ˜Žç¤ş•‚ŒŸ‚Šĉš—éğ™Ğ示•‚ŒĤ„ - * ‚‹ċ ´ċˆ§‚£Ĥ‚‚€äżè¨ĵŻç„ĦċŠı§™€‚“‚½ƒ•ƒˆ‚Ĥ‚§‚˘‚’ä½żç”¨—ŸçµĉžœŞ„—ä½ż - * 用—Ş‹£ŸçµĉžœĞ‚ˆ£Ĥ€ç›´ĉŽ‚‚‹„Żé–“ĉŽĞċ—‘ŸèşĞ体的Şċ‚·ċ³€è²Ħ産上ĉċ³ - * €ƒ‡ƒĵ‚żĉċ¤ħ‚‚‹„Żäğ–ċ…¨Ĥĉċ³Ğ¤„ĤŻ€ĉċ³ċŻèƒ½ĉ€§Œä½żç”¨è€… - * €ċ½“礁‚‚‹„ŻçĴĴ三者Ğ‚ˆ£Ĥè­Ĥċ‘Š•‚ŒĤ„Ÿċ ´ċˆ§‚£Ĥ‚‚€ċ½“礁Żĉċ³è³  - * ċ„ŸŠ‚ˆ³è£œċĦĞ‚’èĦŒ„›‚“€‚“èĤċšŻäğ–ċ…¨Ĥ€ĉ›¸é˘ä¸ŠŸŻĉ›¸é˘Ğç„Ħ„保è¨ĵƒğ - * ċ‘ç´„ƒğèĤċšĞċ„Şċ…ˆ—™€‚ - * - * ◆著作ĉ¨İ者é€£çµĦċ…ˆŠ‚ˆ³ä½żç”¨ĉĦäğĥĞ¤„Ĥċ•„ċˆ‚›ċ…ˆâ—† - * - * €’102-0073 - * ĉħäşĴ都ċƒäğ£ç”°ċŒşäıĉµċŒ—1-13-5ĉ—ĉœĴċœ°ĉ‰€çĴĴ一ƒ“ƒĞ4F - * ĉ Şċĵäĵšç¤ƒƒƒƒ”ƒĵ‚µ‚¤‚ş - * Phone: 03-3512-3655, Fax: 03-3512-3656 - * Email: sales@happysize.co.jp - * Web: http://happysize.com/ - * - * ◆著者◆ - * - * 金ĉœĴ€€èŒ‚ - * - * ◆ċħĉ­´â—† - * - * 1998/11/10 sgk implementation in C++ - * 1999/4/25 sgk C§ĉ›¸ŞŠ—€‚ - * 1999/4/26 sgk ċ…ċŠ›ƒ•‚£ƒĞ‚ż‚’ċŸè£…€‚ĉĵ˘ċ­—‚³ƒĵƒ‰‚’ĉŽ¨ċš—ŞŒ‚‰ƒ•‚£ƒĞ‚ż‚’èż½ċŠ €‚ - * 1999/6/?? Unicode‚µƒƒĵƒˆ€‚ - * 1999/6/22 sgk ƒİ‚¤‚ğƒ³‚ı‚’LGPLĞċ¤‰ĉ›´€‚ - * - */ - -/* - * Unicode support - * - * Portions copyright (c) 1999,2000,2001 by the PHP3 internationalization team. - * All rights reserved. - * - */ - -/* - * - * streamable kanji code filter and converter - * mbfl : Multi Byte FiLter Liblary - * - */ - -#ifndef MBFL_MBFILTER_H -#define MBFL_MBFILTER_H - -#include "mbfl_defs.h" -#include "mbfl_consts.h" -#include "mbfl_allocators.h" -#include "mbfl_encoding.h" -#include "mbfl_language.h" -#include "mbfl_string.h" -#include "mbfl_convert.h" -#include "mbfl_ident.h" - -/* - * convert filter - */ -#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE 0 -#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR 1 -#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG 2 - -/* - * buffering converter - */ -typedef struct _mbfl_buffer_converter mbfl_buffer_converter; - -struct _mbfl_buffer_converter { - mbfl_convert_filter *filter1; - mbfl_convert_filter *filter2; - mbfl_memory_device device; - const mbfl_encoding *from; - const mbfl_encoding *to; -}; - -MBFLAPI extern mbfl_buffer_converter * mbfl_buffer_converter_new(enum mbfl_no_encoding from, enum mbfl_no_encoding to, int buf_initsz); -MBFLAPI extern void mbfl_buffer_converter_delete(mbfl_buffer_converter *convd); -MBFLAPI extern void mbfl_buffer_converter_reset(mbfl_buffer_converter *convd); -MBFLAPI extern int mbfl_buffer_converter_illegal_mode(mbfl_buffer_converter *convd, int mode); -MBFLAPI extern int mbfl_buffer_converter_illegal_substchar(mbfl_buffer_converter *convd, int substchar); -MBFLAPI extern int mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, int n); -MBFLAPI extern int mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string); -MBFLAPI extern int mbfl_buffer_converter_flush(mbfl_buffer_converter *convd); -MBFLAPI extern mbfl_string * mbfl_buffer_converter_getbuffer(mbfl_buffer_converter *convd, mbfl_string *result); -MBFLAPI extern mbfl_string * mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result); -MBFLAPI extern mbfl_string * mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string *string, mbfl_string *result); - -/* - * encoding detector - */ -typedef struct _mbfl_encoding_detector mbfl_encoding_detector; - -struct _mbfl_encoding_detector { - mbfl_identify_filter **filter_list; - int filter_list_size; -}; - -MBFLAPI extern mbfl_encoding_detector * mbfl_encoding_detector_new(enum mbfl_no_encoding *elist, int elistsz); -MBFLAPI extern void mbfl_encoding_detector_delete(mbfl_encoding_detector *identd); -MBFLAPI extern int mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string); -MBFLAPI extern enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *identd); - - -/* - * encoding converter - */ -MBFLAPI extern mbfl_string * -mbfl_convert_encoding(mbfl_string *string, mbfl_string *result, enum mbfl_no_encoding toenc); - - -/* - * identify encoding - */ -MBFLAPI extern const mbfl_encoding * -mbfl_identify_encoding(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict); - -MBFLAPI extern const char * -mbfl_identify_encoding_name(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict); - -MBFLAPI extern enum mbfl_no_encoding -mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz); - -/* - * strlen - */ -MBFLAPI extern int -mbfl_strlen(mbfl_string *string); - -/* - * oddlen - */ -MBFLAPI extern int -mbfl_oddlen(mbfl_string *string); - -/* - * strpos - */ -MBFLAPI extern int -mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, int offset, int reverse); - - -/* - * substr_count - */ -MBFLAPI extern int -mbfl_substr_count(mbfl_string *haystack, mbfl_string *needle); - -/* - * substr - */ -MBFLAPI extern mbfl_string * -mbfl_substr(mbfl_string *string, mbfl_string *result, int from, int length); - -/* - * strcut - */ -MBFLAPI extern mbfl_string * -mbfl_strcut(mbfl_string *string, mbfl_string *result, int from, int length); - -/* - * strwidth - */ -MBFLAPI extern int -mbfl_strwidth(mbfl_string *string); - -/* - * strimwidth - */ -MBFLAPI extern mbfl_string * -mbfl_strimwidth(mbfl_string *string, mbfl_string *marker, mbfl_string *result, int from, int width); - -/* - * MIME header encode - */ -struct mime_header_encoder_data; /* forward declaration */ - -MBFLAPI extern struct mime_header_encoder_data * -mime_header_encoder_new( - enum mbfl_no_encoding incode, - enum mbfl_no_encoding outcode, - enum mbfl_no_encoding encoding); - -MBFLAPI extern void -mime_header_encoder_delete(struct mime_header_encoder_data *pe); - -MBFLAPI extern int -mime_header_encoder_feed(int c, struct mime_header_encoder_data *pe); - -MBFLAPI extern mbfl_string * -mime_header_encoder_result(struct mime_header_encoder_data *pe, mbfl_string *result); - -MBFLAPI extern mbfl_string * -mbfl_mime_header_encode( - mbfl_string *string, mbfl_string *result, - enum mbfl_no_encoding outcode, - enum mbfl_no_encoding encoding, - const char *linefeed, - int indent); - -/* - * MIME header decode - */ -struct mime_header_decoder_data; /* forward declaration */ - -MBFLAPI extern struct mime_header_decoder_data * -mime_header_decoder_new(enum mbfl_no_encoding outcode); - -MBFLAPI extern void -mime_header_decoder_delete(struct mime_header_decoder_data *pd); - -MBFLAPI extern int -mime_header_decoder_feed(int c, struct mime_header_decoder_data *pd); - -MBFLAPI extern mbfl_string * -mime_header_decoder_result(struct mime_header_decoder_data *pd, mbfl_string *result); - -MBFLAPI extern mbfl_string * -mbfl_mime_header_decode( - mbfl_string *string, - mbfl_string *result, - enum mbfl_no_encoding outcode); - -/* - * convert HTML numeric entity - */ -MBFLAPI extern mbfl_string * -mbfl_html_numeric_entity(mbfl_string *string, mbfl_string *result, int *convmap, int mapsize, int type); - -/* - * convert of harfwidth and fullwidth for japanese - */ -MBFLAPI extern mbfl_string * -mbfl_ja_jp_hantozen(mbfl_string *string, mbfl_string *result, int mode); - -#endif /* MBFL_MBFILTER_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c b/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c deleted file mode 100644 index 9b19479ed6152..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" - -static const char *mbfl_encoding_8bit_aliases[] = {"binary", NULL}; - -const mbfl_encoding mbfl_encoding_8bit = { - mbfl_no_encoding_8bit, - "8bit", - "8bit", - (const char *(*)[])&mbfl_encoding_8bit_aliases, - NULL, - MBFL_ENCTYPE_SBCS -}; diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h b/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h deleted file mode 100644 index a87c5646162ce..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_8BIT_H -#define MBFL_MBFILTER_8BIT_H - -#include "mbfl_defs.h" -#include "mbfilter.h" - -MBFLAPI extern const mbfl_encoding mbfl_encoding_8bit; - -#endif /* MBFL_MBFILTER_8BIT_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c b/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c deleted file mode 100644 index b6da879b6e7f3..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "mbfilter_pass.h" - -static const char *mbfl_encoding_pass_aliases[] = {"none", NULL}; - -const mbfl_encoding mbfl_encoding_pass = { - mbfl_no_encoding_pass, - "pass", - NULL, - (const char *(*)[])&mbfl_encoding_pass_aliases, - NULL, - 0 -}; - -const struct mbfl_convert_vtbl vtbl_pass = { - mbfl_no_encoding_pass, - mbfl_no_encoding_pass, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_pass, - mbfl_filt_conv_common_flush -}; - -int mbfl_filt_conv_pass(int c, mbfl_convert_filter *filter) -{ - return (*filter->output_function)(c, filter->data); -} - diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.h b/ext/mbstring/libmbfl/mbfl/mbfilter_pass.h deleted file mode 100644 index 49d169c66899d..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by moriyoshi koizumi on 4 dec 2002. - * - */ - -#ifndef MBFL_MBFILTER_PASS_H -#define MBFL_MBFILTER_PASS_H - -#include "mbfl_defs.h" -#include "mbfilter.h" - -MBFLAPI extern const mbfl_encoding mbfl_encoding_pass; -MBFLAPI extern const struct mbfl_convert_vtbl vtbl_pass; - -MBFLAPI extern int mbfl_filt_conv_pass(int c, mbfl_convert_filter *filter); - -#endif /* MBFL_MBFILTER_PASS_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c b/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c deleted file mode 100644 index 50f7629849795..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" - -const mbfl_encoding mbfl_encoding_wchar = { - mbfl_no_encoding_wchar, - "wchar", - NULL, - NULL, - NULL, - MBFL_ENCTYPE_WCS4BE -}; diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h b/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h deleted file mode 100644 index 9e9396a77f716..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifndef MBFL_MBFILTER_WCHAR_H -#define MBFL_MBFILTER_WCHAR_H - -#include "mbfl_defs.h" -#include "mbfilter.h" - -MBFLAPI extern const mbfl_encoding mbfl_encoding_wchar; - -#endif /* MBFL_MBFILTER_WCHAR_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c deleted file mode 100644 index be9d345b06166..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_MEMORY_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfl_allocators.h" - -static void *__mbfl__malloc(unsigned int); -static void *__mbfl__realloc(void *, unsigned int); -static void *__mbfl__calloc(unsigned int, unsigned int); -static void __mbfl__free(void *); - -static mbfl_allocators default_allocators = { - __mbfl__malloc, - __mbfl__realloc, - __mbfl__calloc, - __mbfl__free, - __mbfl__malloc, - __mbfl__realloc, - __mbfl__free -}; - -mbfl_allocators *__mbfl_allocators = &default_allocators; - -static void *__mbfl__malloc(unsigned int sz) -{ - return malloc(sz); -} - -static void *__mbfl__realloc(void *ptr, unsigned int sz) -{ - return realloc(ptr, sz); -} - -static void *__mbfl__calloc(unsigned int nelems, unsigned int szelem) -{ - return calloc(nelems, szelem); -} - -static void __mbfl__free(void *ptr) -{ - free(ptr); -} - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h deleted file mode 100644 index a1539f0f37bd0..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_ALLOCATORS_H -#define MBFL_ALLOCATORS_H - -#include "mbfl_defs.h" - -typedef struct _mbfl_allocators { - void *(*malloc)(unsigned int); - void *(*realloc)(void *, unsigned int); - void *(*calloc)(unsigned int, unsigned int); - void (*free)(void *); - void *(*pmalloc)(unsigned int); - void *(*prealloc)(void *, unsigned int); - void (*pfree)(void *); -} mbfl_allocators; - -MBFLAPI extern mbfl_allocators *__mbfl_allocators; - -#define mbfl_malloc (__mbfl_allocators->malloc) -#define mbfl_realloc (__mbfl_allocators->realloc) -#define mbfl_calloc (__mbfl_allocators->calloc) -#define mbfl_free (__mbfl_allocators->free) -#define mbfl_pmalloc (__mbfl_allocators->pmalloc) -#define mbfl_prealloc (__mbfl_allocators->preallloc) -#define mbfl_pfree (__mbfl_allocators->pfree) - -#endif /* MBFL_ALLOCATORS_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h deleted file mode 100644 index f500766b492d4..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_CONSTS_H -#define MBFL_CONSTS_H - -#define MBFL_ENCTYPE_SBCS 0x00000001 -#define MBFL_ENCTYPE_MBCS 0x00000002 -#define MBFL_ENCTYPE_WCS2BE 0x00000010 -#define MBFL_ENCTYPE_WCS2LE 0x00000020 -#define MBFL_ENCTYPE_MWC2BE 0x00000040 -#define MBFL_ENCTYPE_MWC2LE 0x00000080 -#define MBFL_ENCTYPE_WCS4BE 0x00000100 -#define MBFL_ENCTYPE_WCS4LE 0x00000200 -#define MBFL_ENCTYPE_MWC4BE 0x00000400 -#define MBFL_ENCTYPE_MWC4LE 0x00000800 -#define MBFL_ENCTYPE_SHFTCODE 0x00001000 -#define MBFL_ENCTYPE_HTML_ENT 0x00002000 - -/* wchar plane, special charactor */ -#define MBFL_WCSPLANE_MASK 0xffff -#define MBFL_WCSPLANE_UCS2MAX 0x00010000 -#define MBFL_WCSPLANE_SUPMIN 0x00010000 -#define MBFL_WCSPLANE_SUPMAX 0x00200000 -#define MBFL_WCSPLANE_JIS0208 0x70e10000 /* JIS HEX : 2121h - 7E7Eh */ -#define MBFL_WCSPLANE_JIS0212 0x70e20000 /* JIS HEX : 2121h - 7E7Eh */ -#define MBFL_WCSPLANE_WINCP932 0x70e30000 /* JIS HEX : 2121h - 9898h */ -#define MBFL_WCSPLANE_8859_1 0x70e40000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_2 0x70e50000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_3 0x70e60000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_4 0x70e70000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_5 0x70e80000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_6 0x70e90000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_7 0x70ea0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_8 0x70eb0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_9 0x70ec0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_10 0x70ed0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_13 0x70ee0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_14 0x70ef0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_8859_15 0x70f00000 /* 00h - FFh */ -#define MBFL_WCSPLANE_KSC5601 0x70f10000 /* 2121h - 7E7Eh */ -#define MBFL_WCSPLANE_GB2312 0x70f20000 /* 2121h - 7E7Eh */ -#define MBFL_WCSPLANE_WINCP936 0x70f30000 /* 2121h - 9898h */ -#define MBFL_WCSPLANE_BIG5 0x70f40000 /* 2121h - 9898h */ -#define MBFL_WCSPLANE_CNS11643 0x70f50000 /* 2121h - 9898h */ -#define MBFL_WCSPLANE_UHC 0x70f60000 /* 8141h - fefeh */ -#define MBFL_WCSPLANE_CP1251 0x70f70000 -#define MBFL_WCSPLANE_CP866 0x70f80000 -#define MBFL_WCSPLANE_KOI8R 0x70f90000 -#define MBFL_WCSPLANE_8859_16 0x70fa0000 /* 00h - FFh */ -#define MBFL_WCSPLANE_ARMSCII8 0x70fb0000 -#define MBFL_WCSGROUP_MASK 0xffffff -#define MBFL_WCSGROUP_UCS4MAX 0x70000000 -#define MBFL_WCSGROUP_WCHARMAX 0x78000000 -#define MBFL_WCSGROUP_THROUGH 0x78000000 /* 000000h - FFFFFFh */ - -#define MBFL_QPRINT_STS_MIME_HEADER 0x1000000 -#define MBFL_BASE64_STS_MIME_HEADER 0x1000000 - -#endif /* MBFL_CONSTS_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c deleted file mode 100644 index 981bba6af9f77..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c +++ /dev/null @@ -1,502 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfl_encoding.h" -#include "mbfl_allocators.h" -#include "mbfl_filter_output.h" -#include "mbfilter_pass.h" -#include "mbfilter_8bit.h" -#include "mbfilter_wchar.h" - -#include "filters/mbfilter_euc_cn.h" -#include "filters/mbfilter_hz.h" -#include "filters/mbfilter_euc_tw.h" -#include "filters/mbfilter_big5.h" -#include "filters/mbfilter_uhc.h" -#include "filters/mbfilter_euc_kr.h" -#include "filters/mbfilter_iso2022_kr.h" -#include "filters/mbfilter_sjis.h" -#include "filters/mbfilter_jis.h" -#include "filters/mbfilter_euc_jp.h" -#include "filters/mbfilter_euc_jp_win.h" -#include "filters/mbfilter_ascii.h" -#include "filters/mbfilter_koi8r.h" -#include "filters/mbfilter_cp866.h" -#include "filters/mbfilter_cp932.h" -#include "filters/mbfilter_cp936.h" -#include "filters/mbfilter_cp1251.h" -#include "filters/mbfilter_cp1252.h" -#include "filters/mbfilter_iso8859_1.h" -#include "filters/mbfilter_iso8859_2.h" -#include "filters/mbfilter_iso8859_3.h" -#include "filters/mbfilter_iso8859_4.h" -#include "filters/mbfilter_iso8859_5.h" -#include "filters/mbfilter_iso8859_6.h" -#include "filters/mbfilter_iso8859_7.h" -#include "filters/mbfilter_iso8859_8.h" -#include "filters/mbfilter_iso8859_9.h" -#include "filters/mbfilter_iso8859_10.h" -#include "filters/mbfilter_iso8859_13.h" -#include "filters/mbfilter_iso8859_14.h" -#include "filters/mbfilter_iso8859_15.h" -#include "filters/mbfilter_base64.h" -#include "filters/mbfilter_qprint.h" -#include "filters/mbfilter_uuencode.h" -#include "filters/mbfilter_7bit.h" -#include "filters/mbfilter_utf7.h" -#include "filters/mbfilter_utf7imap.h" -#include "filters/mbfilter_utf8.h" -#include "filters/mbfilter_utf16.h" -#include "filters/mbfilter_utf32.h" -#include "filters/mbfilter_byte2.h" -#include "filters/mbfilter_byte4.h" -#include "filters/mbfilter_ucs4.h" -#include "filters/mbfilter_ucs2.h" -#include "filters/mbfilter_htmlent.h" -#include "filters/mbfilter_armscii8.h" - -static void mbfl_convert_filter_reset_vtbl(mbfl_convert_filter *filter); - -/* hex character table "0123456789ABCDEF" */ -static char mbfl_hexchar_table[] = { - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46 -}; - -const struct mbfl_convert_vtbl *mbfl_convert_filter_list[] = { - &vtbl_utf8_wchar, - &vtbl_wchar_utf8, - &vtbl_eucjp_wchar, - &vtbl_wchar_eucjp, - &vtbl_sjis_wchar, - &vtbl_wchar_sjis, - &vtbl_jis_wchar, - &vtbl_wchar_jis, - &vtbl_2022jp_wchar, - &vtbl_wchar_2022jp, - &vtbl_eucjpwin_wchar, - &vtbl_wchar_eucjpwin, - &vtbl_sjiswin_wchar, - &vtbl_wchar_sjiswin, - &vtbl_euccn_wchar, - &vtbl_wchar_euccn, - &vtbl_cp936_wchar, - &vtbl_wchar_cp936, - &vtbl_hz_wchar, - &vtbl_wchar_hz, - &vtbl_euctw_wchar, - &vtbl_wchar_euctw, - &vtbl_big5_wchar, - &vtbl_wchar_big5, - &vtbl_euckr_wchar, - &vtbl_wchar_euckr, - &vtbl_uhc_wchar, - &vtbl_wchar_uhc, - &vtbl_2022kr_wchar, - &vtbl_wchar_2022kr, - &vtbl_cp1251_wchar, - &vtbl_wchar_cp1251, - &vtbl_cp866_wchar, - &vtbl_wchar_cp866, - &vtbl_koi8r_wchar, - &vtbl_wchar_koi8r, - &vtbl_cp1252_wchar, - &vtbl_wchar_cp1252, - &vtbl_ascii_wchar, - &vtbl_wchar_ascii, - &vtbl_8859_1_wchar, - &vtbl_wchar_8859_1, - &vtbl_8859_2_wchar, - &vtbl_wchar_8859_2, - &vtbl_8859_3_wchar, - &vtbl_wchar_8859_3, - &vtbl_8859_4_wchar, - &vtbl_wchar_8859_4, - &vtbl_8859_5_wchar, - &vtbl_wchar_8859_5, - &vtbl_8859_6_wchar, - &vtbl_wchar_8859_6, - &vtbl_8859_7_wchar, - &vtbl_wchar_8859_7, - &vtbl_8859_8_wchar, - &vtbl_wchar_8859_8, - &vtbl_8859_9_wchar, - &vtbl_wchar_8859_9, - &vtbl_8859_10_wchar, - &vtbl_wchar_8859_10, - &vtbl_8859_13_wchar, - &vtbl_wchar_8859_13, - &vtbl_8859_14_wchar, - &vtbl_wchar_8859_14, - &vtbl_8859_15_wchar, - &vtbl_wchar_8859_15, - &vtbl_8bit_b64, - &vtbl_b64_8bit, - &vtbl_uuencode_8bit, - &vtbl_wchar_html, - &vtbl_html_wchar, - &vtbl_8bit_qprint, - &vtbl_qprint_8bit, - &vtbl_8bit_7bit, - &vtbl_7bit_8bit, - &vtbl_utf7_wchar, - &vtbl_wchar_utf7, - &vtbl_utf7imap_wchar, - &vtbl_wchar_utf7imap, - &vtbl_utf16_wchar, - &vtbl_wchar_utf16, - &vtbl_utf16be_wchar, - &vtbl_wchar_utf16be, - &vtbl_utf16le_wchar, - &vtbl_wchar_utf16le, - &vtbl_utf32_wchar, - &vtbl_wchar_utf32, - &vtbl_utf32be_wchar, - &vtbl_wchar_utf32be, - &vtbl_utf32le_wchar, - &vtbl_wchar_utf32le, - &vtbl_ucs4_wchar, - &vtbl_wchar_ucs4, - &vtbl_ucs4be_wchar, - &vtbl_wchar_ucs4be, - &vtbl_ucs4le_wchar, - &vtbl_wchar_ucs4le, - &vtbl_ucs2_wchar, - &vtbl_wchar_ucs2, - &vtbl_ucs2be_wchar, - &vtbl_wchar_ucs2be, - &vtbl_ucs2le_wchar, - &vtbl_wchar_ucs2le, - &vtbl_byte4be_wchar, - &vtbl_wchar_byte4be, - &vtbl_byte4le_wchar, - &vtbl_wchar_byte4le, - &vtbl_byte2be_wchar, - &vtbl_wchar_byte2be, - &vtbl_byte2le_wchar, - &vtbl_wchar_byte2le, - &vtbl_armscii8_wchar, - &vtbl_wchar_armscii8, - &vtbl_pass, - NULL -}; - -mbfl_convert_filter * -mbfl_convert_filter_new( - enum mbfl_no_encoding from, - enum mbfl_no_encoding to, - int (*output_function)(int, void* ), - int (*flush_function)(void*), - void* data) -{ - mbfl_convert_filter * filter; - - /* allocate */ - filter = (mbfl_convert_filter *)mbfl_malloc(sizeof(mbfl_convert_filter)); - if (filter == NULL) { - return NULL; - } - - /* encoding structure */ - filter->from = mbfl_no2encoding(from); - filter->to = mbfl_no2encoding(to); - if (filter->from == NULL) { - filter->from = &mbfl_encoding_pass; - } - if (filter->to == NULL) { - filter->to = &mbfl_encoding_pass; - } - - if (output_function != NULL) { - filter->output_function = output_function; - } else { - filter->output_function = mbfl_filter_output_null; - } - filter->flush_function = flush_function; - filter->data = data; - filter->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - filter->illegal_substchar = 0x3f; /* '?' */ - - /* setup the function table */ - mbfl_convert_filter_reset_vtbl(filter); - - /* constructor */ - (*filter->filter_ctor)(filter); - - return filter; -} - -void -mbfl_convert_filter_delete(mbfl_convert_filter *filter) -{ - if (filter) { - (*filter->filter_dtor)(filter); - mbfl_free((void*)filter); - } -} - -int -mbfl_convert_filter_feed(int c, mbfl_convert_filter *filter) -{ - return (*filter->filter_function)(c, filter); -} - -int -mbfl_convert_filter_flush(mbfl_convert_filter *filter) -{ - (*filter->filter_flush)(filter); - return (filter->flush_function ? (*filter->flush_function)(filter->data) : 0); -} - -void mbfl_convert_filter_reset(mbfl_convert_filter *filter, - enum mbfl_no_encoding from, enum mbfl_no_encoding to) -{ - /* destruct old filter */ - (*filter->filter_dtor)(filter); - - /* resset filter member */ - filter->from = mbfl_no2encoding(from); - filter->to = mbfl_no2encoding(to); - - /* set the vtbl */ - mbfl_convert_filter_reset_vtbl(filter); - - /* construct new filter */ - (*filter->filter_ctor)(filter); -} - -void -mbfl_convert_filter_copy( - mbfl_convert_filter *src, - mbfl_convert_filter *dist) -{ - dist->filter_ctor = src->filter_ctor; - dist->filter_dtor = src->filter_dtor; - dist->filter_function = src->filter_function; - dist->filter_flush = src->filter_flush; - dist->output_function = src->output_function; - dist->flush_function = src->flush_function; - dist->data = src->data; - dist->status = src->status; - dist->cache = src->cache; - dist->from = src->from; - dist->to = src->to; - dist->illegal_mode = src->illegal_mode; - dist->illegal_substchar = src->illegal_substchar; -} - -int mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device *src) -{ - int n; - unsigned char *p; - - p = src->buffer; - n = src->pos; - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - return -1; - } - n--; - } - - return n; -} - -int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char *p) -{ - int c; - - while ((c = *p++) != '\0') { - if ((*filter->filter_function)(c, filter) < 0) { - return -1; - } - } - - return 0; -} - -#if 0 -static int -mbfl_convert_filter_strncat(mbfl_convert_filter *filter, const unsigned char *p, - int n) -{ - while (n > 0) { - if ((*filter->filter_function)(*p++, filter) < 0) { - return -1; - } - n--; - } - - return n; -} -#endif - -/* illegal character output function for conv-filter */ -int -mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter) -{ - int mode_backup, ret, n, m, r; - - ret = 0; - mode_backup = filter->illegal_mode; - filter->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE; - switch (mode_backup) { - case MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR: - ret = (*filter->filter_function)(filter->illegal_substchar, filter); - break; - case MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG: - if (c >= 0) { - if (c < MBFL_WCSGROUP_UCS4MAX) { /* unicode */ - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"U+"); - } else { - if (c < MBFL_WCSGROUP_WCHARMAX) { - m = c & ~MBFL_WCSPLANE_MASK; - switch (m) { - case MBFL_WCSPLANE_JIS0208: - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"JIS+"); - break; - case MBFL_WCSPLANE_JIS0212: - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"JIS2+"); - break; - case MBFL_WCSPLANE_WINCP932: - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"W932+"); - break; - case MBFL_WCSPLANE_8859_1: - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"I8859_1+"); - break; - default: - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"?+"); - break; - } - c &= MBFL_WCSPLANE_MASK; - } else { - ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"BAD+"); - c &= MBFL_WCSGROUP_MASK; - } - } - if (ret >= 0) { - m = 0; - r = 28; - while (r >= 0) { - n = (c >> r) & 0xf; - if (n || m) { - m = 1; - ret = (*filter->filter_function)(mbfl_hexchar_table[n], filter); - if (ret < 0) { - break; - } - } - r -= 4; - } - if (m == 0 && ret >= 0) { - ret = (*filter->filter_function)(mbfl_hexchar_table[0], filter); - } - } - } - break; - default: - break; - } - filter->illegal_mode = mode_backup; - - return ret; -} - -const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(enum mbfl_no_encoding from, enum mbfl_no_encoding to) -{ - const struct mbfl_convert_vtbl *vtbl; - int i; - - if (to == mbfl_no_encoding_base64 || - to == mbfl_no_encoding_qprint || - to == mbfl_no_encoding_7bit) { - from = mbfl_no_encoding_8bit; - } else if (from == mbfl_no_encoding_base64 || - from == mbfl_no_encoding_qprint || - from == mbfl_no_encoding_uuencode) { - to = mbfl_no_encoding_8bit; - } - - i = 0; - while ((vtbl = mbfl_convert_filter_list[i++]) != NULL){ - if (vtbl->from == from && vtbl->to == to) { - return vtbl; - } - } - - return NULL; -} - - -static void mbfl_convert_filter_reset_vtbl(mbfl_convert_filter *filter) -{ - const struct mbfl_convert_vtbl *vtbl; - - vtbl = mbfl_convert_filter_get_vtbl(filter->from->no_encoding, filter->to->no_encoding); - if (vtbl == NULL) { - vtbl = &vtbl_pass; - } - - filter->filter_ctor = vtbl->filter_ctor; - filter->filter_dtor = vtbl->filter_dtor; - filter->filter_function = vtbl->filter_function; - filter->filter_flush = vtbl->filter_flush; -} - -/* - * commonly used constructor and destructor - */ -void mbfl_filt_conv_common_ctor(mbfl_convert_filter *filter) -{ - filter->status = 0; - filter->cache = 0; -} - -int mbfl_filt_conv_common_flush(mbfl_convert_filter *filter) -{ - filter->status = 0; - filter->cache = 0; - return 0; -} - -void mbfl_filt_conv_common_dtor(mbfl_convert_filter *filter) -{ - filter->status = 0; - filter->cache = 0; -} - - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.h b/ext/mbstring/libmbfl/mbfl/mbfl_convert.h deleted file mode 100644 index afec8f06279ea..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_CONVERT_H -#define MBFL_CONVERT_H - -#include "mbfl_defs.h" -#include "mbfl_encoding.h" -#include "mbfl_memory_device.h" - -typedef struct _mbfl_convert_filter mbfl_convert_filter; - -struct _mbfl_convert_filter { - void (*filter_ctor)(mbfl_convert_filter *filter); - void (*filter_dtor)(mbfl_convert_filter *filter); - int (*filter_function)(int c, mbfl_convert_filter *filter); - int (*filter_flush)(mbfl_convert_filter *filter); - int (*output_function)(int c, void *data); - int (*flush_function)(void *data); - void *data; - int status; - int cache; - const mbfl_encoding *from; - const mbfl_encoding *to; - int illegal_mode; - int illegal_substchar; - void *opaque; -}; - -struct mbfl_convert_vtbl { - enum mbfl_no_encoding from; - enum mbfl_no_encoding to; - void (*filter_ctor)(mbfl_convert_filter *filter); - void (*filter_dtor)(mbfl_convert_filter *filter); - int (*filter_function)(int c, mbfl_convert_filter *filter); - int (*filter_flush)(mbfl_convert_filter *filter); -}; - -MBFLAPI extern const struct mbfl_convert_vtbl *mbfl_convert_filter_list[]; - -MBFLAPI extern mbfl_convert_filter *mbfl_convert_filter_new( - enum mbfl_no_encoding from, - enum mbfl_no_encoding to, - int (*output_function)(int, void *), - int (*flush_function)(void *), - void *data ); -MBFLAPI extern void mbfl_convert_filter_delete(mbfl_convert_filter *filter); -MBFLAPI extern int mbfl_convert_filter_feed(int c, mbfl_convert_filter *filter); -MBFLAPI extern int mbfl_convert_filter_flush(mbfl_convert_filter *filter); -MBFLAPI extern void mbfl_convert_filter_reset(mbfl_convert_filter *filter, enum mbfl_no_encoding from, enum mbfl_no_encoding to); -MBFLAPI extern void mbfl_convert_filter_copy(mbfl_convert_filter *src, mbfl_convert_filter *dist); -MBFLAPI extern int mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter); -MBFLAPI extern const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(enum mbfl_no_encoding from, enum mbfl_no_encoding to); - -MBFLAPI extern void mbfl_filt_conv_common_ctor(mbfl_convert_filter *filter); -MBFLAPI extern int mbfl_filt_conv_common_flush(mbfl_convert_filter *filter); -MBFLAPI extern void mbfl_filt_conv_common_dtor(mbfl_convert_filter *filter); - -MBFLAPI extern int mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device *src); -MBFLAPI extern int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char *p); - -#endif /* MBFL_CONVERT_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_defs.h b/ext/mbstring/libmbfl/mbfl/mbfl_defs.h deleted file mode 100755 index 6816bd39f7a2b..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_defs.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_DEFS_H -#define MBFL_DEFS_H - -#ifndef NULL -#ifdef __cplusplus -#define NULL (0L) -#else -#define NULL (void *)(0L) -#endif -#endif - -#ifdef WIN32 -#ifdef MBFL_DLL_EXPORT -#define MBFLAPI __declspec(dllexport) -#else -#define MBFLAPI __declspec(dllimport) -#endif -#else -#define MBFLAPI -#endif - -#endif /* MBFL_DEFS_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c deleted file mode 100644 index 64d8cb4e4761a..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#include "mbfl_encoding.h" -#include "mbfilter_pass.h" -#include "mbfilter_8bit.h" -#include "mbfilter_wchar.h" - -#include "filters/mbfilter_euc_cn.h" -#include "filters/mbfilter_hz.h" -#include "filters/mbfilter_euc_tw.h" -#include "filters/mbfilter_big5.h" -#include "filters/mbfilter_uhc.h" -#include "filters/mbfilter_euc_kr.h" -#include "filters/mbfilter_iso2022_kr.h" -#include "filters/mbfilter_sjis.h" -#include "filters/mbfilter_jis.h" -#include "filters/mbfilter_euc_jp.h" -#include "filters/mbfilter_euc_jp_win.h" -#include "filters/mbfilter_ascii.h" -#include "filters/mbfilter_koi8r.h" -#include "filters/mbfilter_cp866.h" -#include "filters/mbfilter_cp932.h" -#include "filters/mbfilter_cp936.h" -#include "filters/mbfilter_cp1251.h" -#include "filters/mbfilter_cp1252.h" -#include "filters/mbfilter_iso8859_1.h" -#include "filters/mbfilter_iso8859_2.h" -#include "filters/mbfilter_iso8859_3.h" -#include "filters/mbfilter_iso8859_4.h" -#include "filters/mbfilter_iso8859_5.h" -#include "filters/mbfilter_iso8859_6.h" -#include "filters/mbfilter_iso8859_7.h" -#include "filters/mbfilter_iso8859_8.h" -#include "filters/mbfilter_iso8859_9.h" -#include "filters/mbfilter_iso8859_10.h" -#include "filters/mbfilter_iso8859_13.h" -#include "filters/mbfilter_iso8859_14.h" -#include "filters/mbfilter_iso8859_15.h" -#include "filters/mbfilter_iso8859_16.h" -#include "filters/mbfilter_base64.h" -#include "filters/mbfilter_qprint.h" -#include "filters/mbfilter_uuencode.h" -#include "filters/mbfilter_7bit.h" -#include "filters/mbfilter_utf7.h" -#include "filters/mbfilter_utf7imap.h" -#include "filters/mbfilter_utf8.h" -#include "filters/mbfilter_utf16.h" -#include "filters/mbfilter_utf32.h" -#include "filters/mbfilter_byte2.h" -#include "filters/mbfilter_byte4.h" -#include "filters/mbfilter_ucs4.h" -#include "filters/mbfilter_ucs2.h" -#include "filters/mbfilter_htmlent.h" -#include "filters/mbfilter_armscii8.h" - -#ifndef HAVE_STRCASECMP -#ifdef HAVE_STRICMP -#define strcasecmp stricmp -#endif -#endif - - -static const char *mbfl_encoding_auto_aliases[] = {"unknown", NULL}; - -static const mbfl_encoding mbfl_encoding_auto = { - mbfl_no_encoding_auto, - "auto", - NULL, - (const char *(*)[])&mbfl_encoding_auto_aliases, - NULL, - 0 -}; - -static const mbfl_encoding *mbfl_encoding_ptr_list[] = { - &mbfl_encoding_pass, - &mbfl_encoding_auto, - &mbfl_encoding_wchar, - &mbfl_encoding_byte2be, - &mbfl_encoding_byte2le, - &mbfl_encoding_byte4be, - &mbfl_encoding_byte4le, - &mbfl_encoding_base64, - &mbfl_encoding_uuencode, - &mbfl_encoding_html_ent, - &mbfl_encoding_qprint, - &mbfl_encoding_7bit, - &mbfl_encoding_8bit, - &mbfl_encoding_ucs4, - &mbfl_encoding_ucs4be, - &mbfl_encoding_ucs4le, - &mbfl_encoding_ucs2, - &mbfl_encoding_ucs2be, - &mbfl_encoding_ucs2le, - &mbfl_encoding_utf32, - &mbfl_encoding_utf32be, - &mbfl_encoding_utf32le, - &mbfl_encoding_utf16, - &mbfl_encoding_utf16be, - &mbfl_encoding_utf16le, - &mbfl_encoding_utf8, - &mbfl_encoding_utf7, - &mbfl_encoding_utf7imap, - &mbfl_encoding_ascii, - &mbfl_encoding_euc_jp, - &mbfl_encoding_sjis, - &mbfl_encoding_eucjp_win, - &mbfl_encoding_sjis_win, - &mbfl_encoding_jis, - &mbfl_encoding_2022jp, - &mbfl_encoding_cp1252, - &mbfl_encoding_8859_1, - &mbfl_encoding_8859_2, - &mbfl_encoding_8859_3, - &mbfl_encoding_8859_4, - &mbfl_encoding_8859_5, - &mbfl_encoding_8859_6, - &mbfl_encoding_8859_7, - &mbfl_encoding_8859_8, - &mbfl_encoding_8859_9, - &mbfl_encoding_8859_10, - &mbfl_encoding_8859_13, - &mbfl_encoding_8859_14, - &mbfl_encoding_8859_15, - &mbfl_encoding_8859_16, - &mbfl_encoding_euc_cn, - &mbfl_encoding_cp936, - &mbfl_encoding_hz, - &mbfl_encoding_euc_tw, - &mbfl_encoding_big5, - &mbfl_encoding_euc_kr, - &mbfl_encoding_uhc, - &mbfl_encoding_2022kr, - &mbfl_encoding_cp1251, - &mbfl_encoding_cp866, - &mbfl_encoding_koi8r, - &mbfl_encoding_armscii8, - NULL -}; - -/* encoding resolver */ -const mbfl_encoding * -mbfl_name2encoding(const char *name) -{ - const mbfl_encoding *encoding; - int i, j; - - if (name == NULL) { - return NULL; - } - - i = 0; - while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL){ - if (strcasecmp(encoding->name, name) == 0) { - return encoding; - } - } - - /* serch MIME charset name */ - i = 0; - while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL) { - if (encoding->mime_name != NULL) { - if (strcasecmp(encoding->mime_name, name) == 0) { - return encoding; - } - } - } - - /* serch aliases */ - i = 0; - while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL) { - if (encoding->aliases != NULL) { - j = 0; - while ((*encoding->aliases)[j] != NULL) { - if (strcasecmp((*encoding->aliases)[j], name) == 0) { - return encoding; - } - j++; - } - } - } - - return NULL; -} - -const mbfl_encoding * -mbfl_no2encoding(enum mbfl_no_encoding no_encoding) -{ - const mbfl_encoding *encoding; - int i; - - i = 0; - while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL){ - if (encoding->no_encoding == no_encoding) { - return encoding; - } - } - - return NULL; -} - -enum mbfl_no_encoding -mbfl_name2no_encoding(const char *name) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_name2encoding(name); - if (encoding == NULL) { - return mbfl_no_encoding_invalid; - } else { - return encoding->no_encoding; - } -} - -const char * -mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_no2encoding(no_encoding); - if (encoding == NULL) { - return ""; - } else { - return encoding->name; - } -} - -const mbfl_encoding ** -mbfl_get_supported_encodings(void) -{ - return mbfl_encoding_ptr_list; -} - -const char * -mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_no2encoding(no_encoding); - if (encoding != NULL && encoding->mime_name != NULL && encoding->mime_name[0] != '\0') { - return encoding->mime_name; - } else { - return NULL; - } -} - -int -mbfl_is_support_encoding(const char *name) -{ - const mbfl_encoding *encoding; - - encoding = mbfl_name2encoding(name); - if (encoding == NULL) { - return 0; - } else { - return 1; - } -} diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h deleted file mode 100644 index d38b1d7d4ac1a..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_ENCODING_H -#define MBFL_ENCODING_H - -#include "mbfl_defs.h" - -enum mbfl_no_encoding { - mbfl_no_encoding_invalid = -1, - mbfl_no_encoding_pass, - mbfl_no_encoding_auto, - mbfl_no_encoding_wchar, - mbfl_no_encoding_byte2be, - mbfl_no_encoding_byte2le, - mbfl_no_encoding_byte4be, - mbfl_no_encoding_byte4le, - mbfl_no_encoding_base64, - mbfl_no_encoding_uuencode, - mbfl_no_encoding_html_ent, - mbfl_no_encoding_qprint, - mbfl_no_encoding_7bit, - mbfl_no_encoding_8bit, - mbfl_no_encoding_charset_min, - mbfl_no_encoding_ucs4, - mbfl_no_encoding_ucs4be, - mbfl_no_encoding_ucs4le, - mbfl_no_encoding_ucs2, - mbfl_no_encoding_ucs2be, - mbfl_no_encoding_ucs2le, - mbfl_no_encoding_utf32, - mbfl_no_encoding_utf32be, - mbfl_no_encoding_utf32le, - mbfl_no_encoding_utf16, - mbfl_no_encoding_utf16be, - mbfl_no_encoding_utf16le, - mbfl_no_encoding_utf8, - mbfl_no_encoding_utf7, - mbfl_no_encoding_utf7imap, - mbfl_no_encoding_ascii, - mbfl_no_encoding_euc_jp, - mbfl_no_encoding_sjis, - mbfl_no_encoding_eucjp_win, - mbfl_no_encoding_sjis_win, - mbfl_no_encoding_sjis_mac, - mbfl_no_encoding_jis, - mbfl_no_encoding_2022jp, - mbfl_no_encoding_cp1252, - mbfl_no_encoding_8859_1, - mbfl_no_encoding_8859_2, - mbfl_no_encoding_8859_3, - mbfl_no_encoding_8859_4, - mbfl_no_encoding_8859_5, - mbfl_no_encoding_8859_6, - mbfl_no_encoding_8859_7, - mbfl_no_encoding_8859_8, - mbfl_no_encoding_8859_9, - mbfl_no_encoding_8859_10, - mbfl_no_encoding_8859_13, - mbfl_no_encoding_8859_14, - mbfl_no_encoding_8859_15, - mbfl_no_encoding_euc_cn, - mbfl_no_encoding_cp936, - mbfl_no_encoding_euc_tw, - mbfl_no_encoding_big5, - mbfl_no_encoding_euc_kr, - mbfl_no_encoding_2022kr, - mbfl_no_encoding_uhc, - mbfl_no_encoding_hz, - mbfl_no_encoding_cp1251, - mbfl_no_encoding_cp866, - mbfl_no_encoding_koi8r, - mbfl_no_encoding_8859_16, - mbfl_no_encoding_armscii8, - mbfl_no_encoding_charset_max -}; - -typedef enum mbfl_no_encoding mbfl_encoding_id; - -/* - * encoding - */ -typedef struct _mbfl_encoding { - enum mbfl_no_encoding no_encoding; - const char *name; - const char *mime_name; - const char *(*aliases)[]; - const unsigned char *mblen_table; - unsigned int flag; -} mbfl_encoding; - -MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name); -MBFLAPI extern const mbfl_encoding * mbfl_no2encoding(enum mbfl_no_encoding no_encoding); -MBFLAPI extern enum mbfl_no_encoding mbfl_name2no_encoding(const char *name); -MBFLAPI extern const mbfl_encoding ** mbfl_get_supported_encodings(); -MBFLAPI extern const char * mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding); -MBFLAPI extern const char * mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding); -MBFLAPI extern int mbfl_is_support_encoding(const char *name); - - -#endif /* MBFL_ENCODING_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.c b/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.c deleted file mode 100644 index 2b63478214c8d..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mbfl_convert.h" -#include "mbfl_filter_output.h" - -int mbfl_filter_output_pipe(int c, void* data) -{ - mbfl_convert_filter *filter = (mbfl_convert_filter*)data; - return (*filter->filter_function)(c, filter); -} - -int mbfl_filter_output_null(int c, void* data) -{ - return c; -} - - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.h b/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.h deleted file mode 100644 index ce5192935e120..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_FILTER_OUTPUT_H -#define MBFL_FILTER_OUTPUT_H - -MBFLAPI extern int mbfl_filter_output_pipe(int c, void* data); -MBFLAPI extern int mbfl_filter_output_null(int c, void* data); - -#endif /* MBFL_FILTER_OUTPUT_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_ident.c b/ext/mbstring/libmbfl/mbfl/mbfl_ident.c deleted file mode 100644 index 72ccef68d2810..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_ident.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfl_ident.h" -#include "mbfl_allocators.h" -#include "mbfilter_pass.h" -#include "mbfilter_8bit.h" -#include "mbfilter_wchar.h" - -#include "filters/mbfilter_euc_cn.h" -#include "filters/mbfilter_hz.h" -#include "filters/mbfilter_euc_tw.h" -#include "filters/mbfilter_big5.h" -#include "filters/mbfilter_uhc.h" -#include "filters/mbfilter_euc_kr.h" -#include "filters/mbfilter_iso2022_kr.h" -#include "filters/mbfilter_sjis.h" -#include "filters/mbfilter_jis.h" -#include "filters/mbfilter_euc_jp.h" -#include "filters/mbfilter_euc_jp_win.h" -#include "filters/mbfilter_ascii.h" -#include "filters/mbfilter_koi8r.h" -#include "filters/mbfilter_cp866.h" -#include "filters/mbfilter_cp932.h" -#include "filters/mbfilter_cp936.h" -#include "filters/mbfilter_cp1251.h" -#include "filters/mbfilter_cp1252.h" -#include "filters/mbfilter_iso8859_1.h" -#include "filters/mbfilter_iso8859_2.h" -#include "filters/mbfilter_iso8859_3.h" -#include "filters/mbfilter_iso8859_4.h" -#include "filters/mbfilter_iso8859_5.h" -#include "filters/mbfilter_iso8859_6.h" -#include "filters/mbfilter_iso8859_7.h" -#include "filters/mbfilter_iso8859_8.h" -#include "filters/mbfilter_iso8859_9.h" -#include "filters/mbfilter_iso8859_10.h" -#include "filters/mbfilter_iso8859_13.h" -#include "filters/mbfilter_iso8859_14.h" -#include "filters/mbfilter_iso8859_15.h" -#include "filters/mbfilter_base64.h" -#include "filters/mbfilter_qprint.h" -#include "filters/mbfilter_uuencode.h" -#include "filters/mbfilter_7bit.h" -#include "filters/mbfilter_utf7.h" -#include "filters/mbfilter_utf7imap.h" -#include "filters/mbfilter_utf8.h" -#include "filters/mbfilter_utf16.h" -#include "filters/mbfilter_utf32.h" -#include "filters/mbfilter_byte2.h" -#include "filters/mbfilter_byte4.h" -#include "filters/mbfilter_ucs4.h" -#include "filters/mbfilter_ucs2.h" -#include "filters/mbfilter_htmlent.h" -#include "filters/mbfilter_armscii8.h" - -static const struct mbfl_identify_vtbl vtbl_identify_false = { - mbfl_no_encoding_pass, - mbfl_filt_ident_false_ctor, - mbfl_filt_ident_common_dtor, - mbfl_filt_ident_false }; - - -static const struct mbfl_identify_vtbl *mbfl_identify_filter_list[] = { - &vtbl_identify_utf8, - &vtbl_identify_utf7, - &vtbl_identify_ascii, - &vtbl_identify_eucjp, - &vtbl_identify_sjis, - &vtbl_identify_eucjpwin, - &vtbl_identify_sjiswin, - &vtbl_identify_jis, - &vtbl_identify_2022jp, - &vtbl_identify_euccn, - &vtbl_identify_cp936, - &vtbl_identify_hz, - &vtbl_identify_euctw, - &vtbl_identify_big5, - &vtbl_identify_euckr, - &vtbl_identify_uhc, - &vtbl_identify_2022kr, - &vtbl_identify_cp1251, - &vtbl_identify_cp866, - &vtbl_identify_koi8r, - &vtbl_identify_cp1252, - &vtbl_identify_8859_1, - &vtbl_identify_8859_2, - &vtbl_identify_8859_3, - &vtbl_identify_8859_4, - &vtbl_identify_8859_5, - &vtbl_identify_8859_6, - &vtbl_identify_8859_7, - &vtbl_identify_8859_8, - &vtbl_identify_8859_9, - &vtbl_identify_8859_10, - &vtbl_identify_8859_13, - &vtbl_identify_8859_14, - &vtbl_identify_8859_15, - &vtbl_identify_armscii8, - &vtbl_identify_false, - NULL -}; - - - -/* - * identify filter - */ -const struct mbfl_identify_vtbl * mbfl_identify_filter_get_vtbl(enum mbfl_no_encoding encoding) -{ - const struct mbfl_identify_vtbl * vtbl; - int i; - - i = 0; - while ((vtbl = mbfl_identify_filter_list[i++]) != NULL) { - if (vtbl->encoding == encoding) { - break; - } - } - - return vtbl; -} - -mbfl_identify_filter *mbfl_identify_filter_new(enum mbfl_no_encoding encoding) -{ - mbfl_identify_filter *filter; - - /* allocate */ - filter = (mbfl_identify_filter *)mbfl_malloc(sizeof(mbfl_identify_filter)); - if (filter == NULL) { - return NULL; - } - - if (mbfl_identify_filter_init(filter, encoding)) { - mbfl_free(filter); - return NULL; - } - - return filter; -} - -int mbfl_identify_filter_init(mbfl_identify_filter *filter, enum mbfl_no_encoding encoding) -{ - const struct mbfl_identify_vtbl *vtbl; - - /* encoding structure */ - filter->encoding = mbfl_no2encoding(encoding); - if (filter->encoding == NULL) { - filter->encoding = &mbfl_encoding_pass; - } - - filter->status = 0; - filter->flag = 0; - filter->score = 0; - - /* setup the function table */ - vtbl = mbfl_identify_filter_get_vtbl(filter->encoding->no_encoding); - if (vtbl == NULL) { - vtbl = &vtbl_identify_false; - } - filter->filter_ctor = vtbl->filter_ctor; - filter->filter_dtor = vtbl->filter_dtor; - filter->filter_function = vtbl->filter_function; - - /* constructor */ - (*filter->filter_ctor)(filter); - - return 0; -} - -void mbfl_identify_filter_delete(mbfl_identify_filter *filter) -{ - if (filter == NULL) { - return; - } - - mbfl_identify_filter_cleanup(filter); - mbfl_free((void*)filter); -} - -void mbfl_identify_filter_cleanup(mbfl_identify_filter *filter) -{ - (*filter->filter_dtor)(filter); -} - -void mbfl_filt_ident_common_ctor(mbfl_identify_filter *filter) -{ - filter->status = 0; - filter->flag = 0; -} - -void mbfl_filt_ident_common_dtor(mbfl_identify_filter *filter) -{ - filter->status = 0; -} - -int mbfl_filt_ident_false(int c, mbfl_identify_filter *filter) -{ - filter->flag = 1; /* bad */ - return c; -} - -void mbfl_filt_ident_false_ctor(mbfl_identify_filter *filter) -{ - filter->status = 0; - filter->flag = 1; -} - -int mbfl_filt_ident_true(int c, mbfl_identify_filter *filter) -{ - return c; -} diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_ident.h b/ext/mbstring/libmbfl/mbfl/mbfl_ident.h deleted file mode 100644 index b0721fc41309a..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_ident.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_IDENT_H -#define MBFL_IDENT_H - -#include "mbfl_defs.h" -#include "mbfl_encoding.h" - -/* - * identify filter - */ -typedef struct _mbfl_identify_filter mbfl_identify_filter; - -struct _mbfl_identify_filter { - void (*filter_ctor)(mbfl_identify_filter *filter); - void (*filter_dtor)(mbfl_identify_filter *filter); - int (*filter_function)(int c, mbfl_identify_filter *filter); - int status; - int flag; - int score; - const mbfl_encoding *encoding; -}; - -struct mbfl_identify_vtbl { - enum mbfl_no_encoding encoding; - void (*filter_ctor)(mbfl_identify_filter *filter); - void (*filter_dtor)(mbfl_identify_filter *filter); - int (*filter_function)(int c, mbfl_identify_filter *filter); -}; - -MBFLAPI extern const struct mbfl_identify_vtbl * mbfl_identify_filter_get_vtbl(enum mbfl_no_encoding encoding); -MBFLAPI extern mbfl_identify_filter * mbfl_identify_filter_new(enum mbfl_no_encoding encoding); -MBFLAPI extern void mbfl_identify_filter_delete(mbfl_identify_filter *filter); -MBFLAPI extern int mbfl_identify_filter_init(mbfl_identify_filter *filter, enum mbfl_no_encoding encoding); -MBFLAPI void mbfl_identify_filter_cleanup(mbfl_identify_filter *filter); - -MBFLAPI extern void mbfl_filt_ident_common_ctor(mbfl_identify_filter *filter); -MBFLAPI extern void mbfl_filt_ident_common_dtor(mbfl_identify_filter *filter); -MBFLAPI extern void mbfl_filt_ident_false_ctor(mbfl_identify_filter *filter); - -MBFLAPI extern int mbfl_filt_ident_false(int c, mbfl_identify_filter *filter); -MBFLAPI extern int mbfl_filt_ident_true(int c, mbfl_identify_filter *filter); - -#endif /* MBFL_IDENT_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_language.c b/ext/mbstring/libmbfl/mbfl/mbfl_language.c deleted file mode 100644 index c5dab6550217a..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_language.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#include "mbfl_encoding.h" -#include "mbfl_language.h" - -#include "nls/nls_ja.h" -#include "nls/nls_kr.h" -#include "nls/nls_zh.h" -#include "nls/nls_uni.h" -#include "nls/nls_de.h" -#include "nls/nls_ru.h" -#include "nls/nls_en.h" -#include "nls/nls_hy.h" -#include "nls/nls_neutral.h" - -#ifndef HAVE_STRCASECMP -#ifdef HAVE_STRICMP -#define strcasecmp stricmp -#endif -#endif - -static const mbfl_language *mbfl_language_ptr_table[] = { - &mbfl_language_uni, - &mbfl_language_japanese, - &mbfl_language_korean, - &mbfl_language_simplified_chinese, - &mbfl_language_traditional_chinese, - &mbfl_language_english, - &mbfl_language_german, - &mbfl_language_russian, - &mbfl_language_armenian, - &mbfl_language_neutral, - NULL -}; - -/* language resolver */ -const mbfl_language * -mbfl_name2language(const char *name) -{ - const mbfl_language *language; - int i, j; - - if (name == NULL) { - return NULL; - } - - i = 0; - while ((language = mbfl_language_ptr_table[i++]) != NULL){ - if (strcasecmp(language->name, name) == 0) { - return language; - } - } - - i = 0; - while ((language = mbfl_language_ptr_table[i++]) != NULL){ - if (strcasecmp(language->short_name, name) == 0) { - return language; - } - } - - /* serch aliases */ - i = 0; - while ((language = mbfl_language_ptr_table[i++]) != NULL) { - if (language->aliases != NULL) { - j = 0; - while ((*language->aliases)[j] != NULL) { - if (strcasecmp((*language->aliases)[j], name) == 0) { - return language; - } - j++; - } - } - } - - return NULL; -} - -const mbfl_language * -mbfl_no2language(enum mbfl_no_language no_language) -{ - const mbfl_language *language; - int i; - - i = 0; - while ((language = mbfl_language_ptr_table[i++]) != NULL){ - if (language->no_language == no_language) { - return language; - } - } - - return NULL; -} - -enum mbfl_no_language -mbfl_name2no_language(const char *name) -{ - const mbfl_language *language; - - language = mbfl_name2language(name); - if (language == NULL) { - return mbfl_no_language_invalid; - } else { - return language->no_language; - } -} - -const char * -mbfl_no_language2name(enum mbfl_no_language no_language) -{ - const mbfl_language *language; - - language = mbfl_no2language(no_language); - if (language == NULL) { - return ""; - } else { - return language->name; - } -} - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_language.h b/ext/mbstring/libmbfl/mbfl/mbfl_language.h deleted file mode 100644 index f6b9ec2080af8..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_language.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_LANGUAGE_H -#define MBFL_LANGUAGE_H - -#include "mbfl_defs.h" -#include "mbfl_encoding.h" - -enum mbfl_no_language { - mbfl_no_language_invalid = -1, - mbfl_no_language_neutral, - mbfl_no_language_uni, - mbfl_no_language_min, - mbfl_no_language_catalan, /* ca */ - mbfl_no_language_danish, /* da */ - mbfl_no_language_german, /* de */ - mbfl_no_language_english, /* en */ - mbfl_no_language_estonian, /* et */ - mbfl_no_language_greek, /* el */ - mbfl_no_language_spanish, /* es */ - mbfl_no_language_french, /* fr */ - mbfl_no_language_italian, /* it */ - mbfl_no_language_japanese, /* ja */ - mbfl_no_language_korean, /* ko */ - mbfl_no_language_dutch, /* nl */ - mbfl_no_language_polish, /* pl */ - mbfl_no_language_portuguese, /* pt */ - mbfl_no_language_swedish, /* sv */ - mbfl_no_language_simplified_chinese, /* zh-cn */ - mbfl_no_language_traditional_chinese, /* zh-tw */ - mbfl_no_language_russian, /* ru */ - mbfl_no_language_armenian, /* hy */ - mbfl_no_language_max -}; - -typedef enum mbfl_no_language mbfl_language_id; - -/* - * language - */ -typedef struct _mbfl_language { - enum mbfl_no_language no_language; - const char *name; - const char *short_name; - const char *(*aliases)[]; - enum mbfl_no_encoding mail_charset; - enum mbfl_no_encoding mail_header_encoding; - enum mbfl_no_encoding mail_body_encoding; -} mbfl_language; - -MBFLAPI extern const mbfl_language * mbfl_name2language(const char *name); -MBFLAPI extern const mbfl_language * mbfl_no2language(enum mbfl_no_language no_language); -MBFLAPI extern enum mbfl_no_language mbfl_name2no_language(const char *name); -MBFLAPI extern const char * mbfl_no_language2name(enum mbfl_no_language no_language); - - -#endif /* MBFL_LANGUAGE_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c deleted file mode 100644 index 6d93fa35297c4..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfl_allocators.h" -#include "mbfl_string.h" -#include "mbfl_memory_device.h" - -/* - * memory device output functions - */ -void -mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz) -{ - if (device) { - device->length = 0; - device->buffer = (unsigned char *)0; - if (initsz > 0) { - device->buffer = (unsigned char *)mbfl_malloc(initsz*sizeof(unsigned char)); - if (device->buffer != NULL) { - device->length = initsz; - } - } - device->pos= 0; - if (allocsz > MBFL_MEMORY_DEVICE_ALLOC_SIZE) { - device->allocsz = allocsz; - } else { - device->allocsz = MBFL_MEMORY_DEVICE_ALLOC_SIZE; - } - } -} - -void -mbfl_memory_device_realloc(mbfl_memory_device *device, int initsz, int allocsz) -{ - unsigned char *tmp; - - if (device) { - if (initsz > device->length) { - tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, initsz*sizeof(unsigned char)); - if (tmp != NULL) { - device->buffer = tmp; - device->length = initsz; - } - } - if (allocsz > MBFL_MEMORY_DEVICE_ALLOC_SIZE) { - device->allocsz = allocsz; - } else { - device->allocsz = MBFL_MEMORY_DEVICE_ALLOC_SIZE; - } - } -} - -void -mbfl_memory_device_clear(mbfl_memory_device *device) -{ - if (device) { - if (device->buffer) { - mbfl_free(device->buffer); - } - device->buffer = (unsigned char *)0; - device->length = 0; - device->pos = 0; - } -} - -void -mbfl_memory_device_reset(mbfl_memory_device *device) -{ - if (device) { - device->pos = 0; - } -} - -void -mbfl_memory_device_unput(mbfl_memory_device *device) -{ - if (device->pos > 0) { - device->pos--; - } -} - -mbfl_string * -mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result) -{ - if (device && result) { - result->len = device->pos; - mbfl_memory_device_output4('\0', device); - result->val = device->buffer; - device->buffer = (unsigned char *)0; - device->length = 0; - device->pos= 0; - if (result->val == NULL) { - result->len = 0; - result = NULL; - } - } else { - result = NULL; - } - - return result; -} - -int -mbfl_memory_device_output(int c, void *data) -{ - mbfl_memory_device *device = (mbfl_memory_device *)data; - - if (device->pos >= device->length) { - /* reallocate buffer */ - int newlen; - unsigned char *tmp; - - newlen = device->length + device->allocsz; - tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - device->buffer[device->pos++] = (unsigned char)c; - return c; -} - -int -mbfl_memory_device_output2(int c, void *data) -{ - mbfl_memory_device *device = (mbfl_memory_device *)data; - - if ((device->pos + 2) >= device->length) { - /* reallocate buffer */ - int newlen; - unsigned char *tmp; - - newlen = device->length + device->allocsz; - tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - device->buffer[device->pos++] = (unsigned char)((c >> 8) & 0xff); - device->buffer[device->pos++] = (unsigned char)(c & 0xff); - - return c; -} - -int -mbfl_memory_device_output4(int c, void* data) -{ - mbfl_memory_device *device = (mbfl_memory_device *)data; - - if ((device->pos + 4) >= device->length) { - /* reallocate buffer */ - int newlen; - unsigned char *tmp; - - newlen = device->length + device->allocsz; - tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - device->buffer[device->pos++] = (unsigned char)((c >> 24) & 0xff); - device->buffer[device->pos++] = (unsigned char)((c >> 16) & 0xff); - device->buffer[device->pos++] = (unsigned char)((c >> 8) & 0xff); - device->buffer[device->pos++] = (unsigned char)(c & 0xff); - - return c; -} - -int -mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc) -{ - int len; - unsigned char *w; - const unsigned char *p; - - len = 0; - p = psrc; - while (*p) { - p++; - len++; - } - - if ((device->pos + len) >= device->length) { - /* reallocate buffer */ - int newlen = device->length + (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)*sizeof(unsigned char); - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - p = psrc; - w = &device->buffer[device->pos]; - device->pos += len; - while (len > 0) { - *w++ = *p++; - len--; - } - - return len; -} - -int -mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len) -{ - unsigned char *w; - - if ((device->pos + len) >= device->length) { - /* reallocate buffer */ - int newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE; - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - w = &device->buffer[device->pos]; - device->pos += len; - while (len > 0) { - *w++ = *psrc++; - len--; - } - - return len; -} - -int -mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src) -{ - int n; - unsigned char *p, *w; - - if ((dest->pos + src->pos) >= dest->length) { - /* reallocate buffer */ - int newlen = dest->length + src->pos + MBFL_MEMORY_DEVICE_ALLOC_SIZE; - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char)); - if (tmp == NULL) { - return -1; - } - dest->length = newlen; - dest->buffer = tmp; - } - - p = src->buffer; - w = &dest->buffer[dest->pos]; - n = src->pos; - dest->pos += n; - while (n > 0) { - *w++ = *p++; - n--; - } - - return n; -} - -void -mbfl_wchar_device_init(mbfl_wchar_device *device) -{ - if (device) { - device->buffer = (unsigned int *)0; - device->length = 0; - device->pos= 0; - device->allocsz = MBFL_MEMORY_DEVICE_ALLOC_SIZE; - } -} - -void -mbfl_wchar_device_clear(mbfl_wchar_device *device) -{ - if (device) { - if (device->buffer) { - mbfl_free(device->buffer); - } - device->buffer = (unsigned int*)0; - device->length = 0; - device->pos = 0; - } -} - -int -mbfl_wchar_device_output(int c, void *data) -{ - mbfl_wchar_device *device = (mbfl_wchar_device *)data; - - if (device->pos >= device->length) { - /* reallocate buffer */ - int newlen; - unsigned int *tmp; - - newlen = device->length + device->allocsz; - tmp = (unsigned int *)mbfl_realloc((void *)device->buffer, newlen*sizeof(int)); - if (tmp == NULL) { - return -1; - } - device->length = newlen; - device->buffer = tmp; - } - - device->buffer[device->pos++] = c; - - return c; -} diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h deleted file mode 100644 index a2c1c4089fb3c..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_MEMORY_DEVICE_H -#define MBFL_MEMORY_DEVICE_H - -#include "mbfl_defs.h" -#include "mbfl_string.h" - -#define MBFL_MEMORY_DEVICE_ALLOC_SIZE 64 - -typedef struct _mbfl_memory_device { - unsigned char *buffer; - int length; - int pos; - int allocsz; -} mbfl_memory_device; - -typedef struct _mbfl_wchar_device { - unsigned int *buffer; - int length; - int pos; - int allocsz; -} mbfl_wchar_device; - -MBFLAPI extern void mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz); -MBFLAPI extern void mbfl_memory_device_realloc(mbfl_memory_device *device, int initsz, int allocsz); -MBFLAPI extern void mbfl_memory_device_clear(mbfl_memory_device *device); -MBFLAPI extern void mbfl_memory_device_reset(mbfl_memory_device *device); -MBFLAPI extern mbfl_string * mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result); -MBFLAPI extern void mbfl_memory_device_unput(mbfl_memory_device *device); -MBFLAPI extern int mbfl_memory_device_output(int c, void *data); -MBFLAPI extern int mbfl_memory_device_output2(int c, void *data); -MBFLAPI extern int mbfl_memory_device_output4(int c, void *data); -MBFLAPI extern int mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc); -MBFLAPI extern int mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len); -MBFLAPI extern int mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src); - -MBFLAPI extern void mbfl_wchar_device_init(mbfl_wchar_device *device); -MBFLAPI extern int mbfl_wchar_device_output(int c, void *data); -MBFLAPI extern void mbfl_wchar_device_clear(mbfl_wchar_device *device); - - - -#endif /* MBFL_MEMORY_DEVICE_H */ - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_string.c b/ext/mbstring/libmbfl/mbfl/mbfl_string.c deleted file mode 100644 index e0351a437b9cd..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_string.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.c - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.c is included in this package . - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfl_allocators.h" -#include "mbfl_string.h" - -/* - * string object - */ -void -mbfl_string_init(mbfl_string *string) -{ - if (string) { - string->no_language = mbfl_no_language_uni; - string->no_encoding = mbfl_no_encoding_pass; - string->val = (unsigned char*)NULL; - string->len = 0; - } -} - -void -mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, mbfl_encoding_id no_encoding) -{ - if (string) { - string->no_language = no_language; - string->no_encoding = no_encoding; - string->val = (unsigned char*)NULL; - string->len = 0; - } -} - -void -mbfl_string_clear(mbfl_string *string) -{ - if (string) { - if (string->val != (unsigned char*)NULL) { - mbfl_free(string->val); - } - string->val = (unsigned char*)NULL; - string->len = 0; - } -} - - diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_string.h b/ext/mbstring/libmbfl/mbfl/mbfl_string.h deleted file mode 100644 index d1121319a302e..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mbfl_string.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * "streamable kanji code filter and converter" - * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. - * - * LICENSE NOTICES - * - * This file is part of "streamable kanji code filter and converter", - * which is distributed under the terms of GNU Lesser General Public - * License (version 2) as published by the Free Software Foundation. - * - * This software 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with "streamable kanji code filter and converter"; - * if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * The author of this file: - * - */ -/* - * The source code included in this files was separated from mbfilter.h - * by Moriyoshi Koizumi on 20 Dec 2002. The file - * mbfilter.h is included in this package . - * - */ - -#ifndef MBFL_STRING_H -#define MBFL_STRING_H - -#include "mbfl_defs.h" -#include "mbfl_encoding.h" -#include "mbfl_language.h" - -/* - * string object - */ -typedef struct _mbfl_string { - enum mbfl_no_language no_language; - enum mbfl_no_encoding no_encoding; - unsigned char *val; - unsigned int len; -} mbfl_string; - -MBFLAPI extern void mbfl_string_init(mbfl_string *string); -MBFLAPI extern void mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, mbfl_encoding_id no_encoding); -MBFLAPI extern void mbfl_string_clear(mbfl_string *string); - -#ifndef NULL -#define NULL 0 -#endif - -#endif /* MBFL_STRING_H */ diff --git a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk deleted file mode 100644 index c7deb4cdf5af4..0000000000000 --- a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/awk -f -# -# $Id$ -# -# Description: a script to generate east asian width table. -# - -BEGIN { - prev = -1 - comma = 0 - ORS = "" - FS = "[;.|# ]" - print "static const struct {\n\tint begin;\n\tint end;\n} " TABLE_NAME "[] = {\n\t" -} - -/^#/ { -} - -/^[0-9a-fA-F]+;/ { - if ($2 == "W" || $2 == "F") { - v = ( "0x" $1 ) + 0 - if (prev < 0) { - first = v - } else if (v - prev > 1) { - if (comma) { - print ",\n\t" - } - printf("{ 0x%04x, 0x%04x }", first, prev) - first = v - comma = 1 - } - prev = v - } else { - if (prev >= 0) { - if (comma) { - print ",\n\t" - } - printf("{ 0x%04x, 0x%04x }", first, prev) - prev = -1 - comma = 1 - } - } -} - -/^[0-9a-fA-F]+\.\./ { - if ($4 == "W" || $4 == "F") { - vs = ( "0x" $1 ) + 0 - ve = ( "0x" $3 ) + 0 - if (prev < 0) { - first = vs - } else if (vs - prev > 1) { - if (comma) { - print ",\n\t" - } - printf("{ 0x%04x, 0x%04x }", first, prev) - first = vs - comma = 1 - } - prev = ve - } else { - if (prev >= 0) { - if (comma) { - print ",\n\t" - } - printf("{ 0x%04x, 0x%04x }", first, prev) - prev = -1 - comma = 1 - } - } -} - -END { - if (prev >= 0) { - if (comma) { - print ",\n\t" - } - printf("{ 0x%04x, 0x%04x }", first, prev) - } - print "\n};\n" -} diff --git a/ext/mbstring/libmbfl/mksbcc32.bat b/ext/mbstring/libmbfl/mksbcc32.bat deleted file mode 100644 index cdc3dd6ca3350..0000000000000 --- a/ext/mbstring/libmbfl/mksbcc32.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd %2 -%1 -f Makefile.bcc32 %3 -cd .. -exit diff --git a/ext/mbstring/libmbfl/nls/Makefile.am b/ext/mbstring/libmbfl/nls/Makefile.am deleted file mode 100644 index ca81f902c80b7..0000000000000 --- a/ext/mbstring/libmbfl/nls/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTRA_DIST=Makefile.bcc32 -noinst_LTLIBRARIES=libmbfl_nls.la -INCLUDES=-I../mbfl -libmbfl_nls_la_LDFLAGS=-version-info $(SHLIB_VERSION) -libmbfl_nls_la_SOURCES=nls_ja.c nls_de.c nls_en.c nls_hy.c nls_kr.c nls_ru.c nls_zh.c nls_uni.c nls_neutral.c nls_ja.h nls_de.h nls_en.h nls_hy.h nls_kr.h nls_ru.h nls_zh.h nls_uni.h nls_neutral.h diff --git a/ext/mbstring/libmbfl/nls/Makefile.bcc32 b/ext/mbstring/libmbfl/nls/Makefile.bcc32 deleted file mode 100644 index 444e88c52b6b8..0000000000000 --- a/ext/mbstring/libmbfl/nls/Makefile.bcc32 +++ /dev/null @@ -1,8 +0,0 @@ -!include ..\rules.mak.bcc32 -INCLUDES=$(INCLUDES) -I..\mbfl -OBJS=nls_ja.obj nls_de.obj nls_en.obj nls_hy.obj nls_kr.obj nls_ru.obj nls_zh.obj nls_uni.obj nls_neutral.obj - -all: $(OBJS) - -clean: - @for %i in ($(OBJS)) do @if exist %i del %i diff --git a/ext/mbstring/libmbfl/nls/nls_de.c b/ext/mbstring/libmbfl/nls/nls_de.c deleted file mode 100644 index b559e2dee304b..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_de.c +++ /dev/null @@ -1,23 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_de.h" - -static const char *mbfl_language_german_aliases[] = {"Deutsch", NULL}; - -const mbfl_language mbfl_language_german = { - mbfl_no_language_german, - "German", - "de", - (const char *(*)[])&mbfl_language_german_aliases, - mbfl_no_encoding_8859_15, - mbfl_no_encoding_qprint, - mbfl_no_encoding_8bit -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_de.h b/ext/mbstring/libmbfl/nls/nls_de.h deleted file mode 100644 index a6c289bfad3bf..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_de.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_DE_H -#define MBFL_NLS_DE_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_german; - -#endif /* MBFL_NLS_DE_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_en.c b/ext/mbstring/libmbfl/nls/nls_en.c deleted file mode 100644 index 0700e4f2c4e1a..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_en.c +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_en.h" - -const mbfl_language mbfl_language_english = { - mbfl_no_language_english, - "English", - "en", - NULL, - mbfl_no_encoding_8859_1, - mbfl_no_encoding_qprint, - mbfl_no_encoding_8bit -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_en.h b/ext/mbstring/libmbfl/nls/nls_en.h deleted file mode 100644 index aa9297d5c293e..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_en.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_EN_H -#define MBFL_NLS_EN_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_english; - -#endif /* MBFL_NLS_EN_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_hy.c b/ext/mbstring/libmbfl/nls/nls_hy.c deleted file mode 100644 index a2511484cd0fd..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_hy.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_hy.h" - -const mbfl_language mbfl_language_armenian = { - mbfl_no_language_armenian , - "Armenian ", - "hy", - NULL, - mbfl_no_encoding_armscii8, - mbfl_no_encoding_qprint, - mbfl_no_encoding_8bit -}; diff --git a/ext/mbstring/libmbfl/nls/nls_hy.h b/ext/mbstring/libmbfl/nls/nls_hy.h deleted file mode 100644 index 39fa246eaa454..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_hy.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef MBFL_NLS_HY_H -#define MBFL_NLS_HY_H - -#include "mbfilter.h" -#include "nls_hy.h" - -extern const mbfl_language mbfl_language_armenian; - -#endif /* MBFL_NLS_HY_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_ja.c b/ext/mbstring/libmbfl/nls/nls_ja.c deleted file mode 100644 index d5541fa73aebd..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_ja.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_ja.h" - -const mbfl_language mbfl_language_japanese = { - mbfl_no_language_japanese, - "Japanese", - "ja", - NULL, - mbfl_no_encoding_2022jp, - mbfl_no_encoding_base64, - mbfl_no_encoding_7bit -}; diff --git a/ext/mbstring/libmbfl/nls/nls_ja.h b/ext/mbstring/libmbfl/nls/nls_ja.h deleted file mode 100644 index bf1c9e909c7dd..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_ja.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_JA_H -#define MBFL_NLS_JA_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_japanese; - -#endif /* MBFL_NLS_JA_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_kr.c b/ext/mbstring/libmbfl/nls/nls_kr.c deleted file mode 100644 index afff43af489ef..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_kr.c +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_kr.h" - -const mbfl_language mbfl_language_korean = { - mbfl_no_language_korean, - "Korean", - "ko", - NULL, - mbfl_no_encoding_2022kr, - mbfl_no_encoding_base64, - mbfl_no_encoding_7bit -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_kr.h b/ext/mbstring/libmbfl/nls/nls_kr.h deleted file mode 100644 index 1aeb357d851ef..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_kr.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_KR_H -#define MBFL_NLS_KR_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_korean; - -#endif /* MBFL_NLS_KR_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_neutral.c b/ext/mbstring/libmbfl/nls/nls_neutral.c deleted file mode 100644 index 87a6a194c3460..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_neutral.c +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_neutral.h" - -const mbfl_language mbfl_language_neutral = { - mbfl_no_language_neutral, - "neutral", - "neutral", - NULL, - mbfl_no_encoding_utf8, - mbfl_no_encoding_base64, - mbfl_no_encoding_base64 -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_neutral.h b/ext/mbstring/libmbfl/nls/nls_neutral.h deleted file mode 100644 index 50c6499a6d637..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_neutral.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_NEUTRAL_H -#define MBFL_NLS_NEUTRAL_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_neutral; - -#endif /* MBFL_NLS_NEUTRAL_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_ru.c b/ext/mbstring/libmbfl/nls/nls_ru.c deleted file mode 100644 index 7e4cf9c3b0562..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_ru.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_ru.h" - -const mbfl_language mbfl_language_russian = { - mbfl_no_language_russian, - "Russian", - "ru", - NULL, - mbfl_no_encoding_koi8r, - mbfl_no_encoding_qprint, - mbfl_no_encoding_8bit -}; diff --git a/ext/mbstring/libmbfl/nls/nls_ru.h b/ext/mbstring/libmbfl/nls/nls_ru.h deleted file mode 100644 index ba21b9a3d4b5f..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_ru.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef MBFL_NLS_RU_H -#define MBFL_NLS_RU_H - -#include "mbfilter.h" -#include "nls_ru.h" - -extern const mbfl_language mbfl_language_russian; - -#endif /* MBFL_NLS_RU_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_uni.c b/ext/mbstring/libmbfl/nls/nls_uni.c deleted file mode 100644 index 6a0100105b0ec..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_uni.c +++ /dev/null @@ -1,23 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_uni.h" - -static const char *mbfl_language_uni_aliases[] = {"universal", NULL}; - -const mbfl_language mbfl_language_uni = { - mbfl_no_language_uni, - "uni", - "uni", - (const char *(*)[])&mbfl_language_uni_aliases, - mbfl_no_encoding_utf8, - mbfl_no_encoding_base64, - mbfl_no_encoding_base64 -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_uni.h b/ext/mbstring/libmbfl/nls/nls_uni.h deleted file mode 100644 index 1e3f94dc8e8f7..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_uni.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MBFL_NLS_UNI_H -#define MBFL_NLS_UNI_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_uni; - -#endif /* MBFL_NLS_UNI_H */ diff --git a/ext/mbstring/libmbfl/nls/nls_zh.c b/ext/mbstring/libmbfl/nls/nls_zh.c deleted file mode 100644 index d9a49931eafcb..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_zh.c +++ /dev/null @@ -1,31 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#include "mbfilter.h" -#include "nls_zh.h" - -const mbfl_language mbfl_language_simplified_chinese = { - mbfl_no_language_simplified_chinese, - "Simplified Chinese", - "zh-cn", - NULL, - mbfl_no_encoding_hz, - mbfl_no_encoding_base64, - mbfl_no_encoding_7bit -}; - -const mbfl_language mbfl_language_traditional_chinese = { - mbfl_no_language_traditional_chinese, - "Traditional Chinese", - "zh-tw", - NULL, - mbfl_no_encoding_big5, - mbfl_no_encoding_base64, - mbfl_no_encoding_8bit -}; - diff --git a/ext/mbstring/libmbfl/nls/nls_zh.h b/ext/mbstring/libmbfl/nls/nls_zh.h deleted file mode 100644 index 218160295fb52..0000000000000 --- a/ext/mbstring/libmbfl/nls/nls_zh.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef MBFL_NLS_ZH_H -#define MBFL_NLS_ZH_H - -#include "mbfilter.h" - -extern const mbfl_language mbfl_language_simplified_chinese; -extern const mbfl_language mbfl_language_traditional_chinese; - -#endif /* MBFL_NLS_ZH_H */ diff --git a/ext/mbstring/libmbfl/rules.mak.bcc32 b/ext/mbstring/libmbfl/rules.mak.bcc32 deleted file mode 100644 index 50fafa96b184c..0000000000000 --- a/ext/mbstring/libmbfl/rules.mak.bcc32 +++ /dev/null @@ -1,7 +0,0 @@ -.suffixes .c -CFLAGS=-DHAVE_CONFIG_H -DMBFL_DLL_EXPORT -DWIN32 -INCLUDES=-I. -I.. -LIBS=import32.lib cw32mt.lib c0d32.obj -LDFLAGS=-c -Tpd -Gn -.c.obj: - bcc32 $(CFLAGS) $(INCLUDES) -c $< diff --git a/ext/mbstring/libmbfl/tests/sample.c b/ext/mbstring/libmbfl/tests/sample.c deleted file mode 100644 index 54f809378aec6..0000000000000 --- a/ext/mbstring/libmbfl/tests/sample.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - this is a small sample script to use libmbfl. - Rui Hirokawa - - this file is encoded in EUC-JP. - */ - -#include -#include "../mbfl/mbfilter.h" - -int main() -{ - enum mbfl_no_encoding from_encoding, to_encoding; - enum mbfl_no_language no_language; - mbfl_buffer_converter *convd = NULL; - mbfl_string string, result, *ret; - mbfl_language lang; - unsigned char input[] = "ĈüËܸìʸğúÎó"; /* EUC-JP kanji string */ - - no_language = mbfl_name2no_language("Japanese"); - from_encoding = mbfl_name2no_encoding("EUC-JP"); - to_encoding = mbfl_name2no_encoding("SJIS"); - - mbfl_string_init(&string); - mbfl_string_init(&result); - - string.no_encoding = from_encoding; - string.no_language = no_language; - string.val = (unsigned char *)input; - string.len = strlen(input); - - convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0); - ret = mbfl_buffer_converter_feed_result(convd, &string, &result); - mbfl_buffer_converter_delete(convd); - - puts(ret->val); - return 1; -} diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c deleted file mode 100644 index 927c38222a932..0000000000000 --- a/ext/mbstring/mb_gpc.c +++ /dev/null @@ -1,399 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rui Hirokawa | - | Moriyoshi Koizumi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_variables.h" -#include "mbstring.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_mail.h" -#include "ext/standard/url.h" -#include "main/php_output.h" -#include "ext/standard/info.h" - -#include "php_variables.h" -#include "php_globals.h" -#include "rfc1867.h" -#include "php_content_types.h" -#include "SAPI.h" -#include "TSRM.h" - -#include "mb_gpc.h" -/* }}} */ - -#if HAVE_MBSTRING - -ZEND_EXTERN_MODULE_GLOBALS(mbstring) - -/* {{{ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data) - * http input processing */ -MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data) -{ - char *res = NULL, *separator=NULL; - const char *c_var; - zval *array_ptr; - int free_buffer=0; - enum mbfl_no_encoding detected; - php_mb_encoding_handler_info_t info; - - if (!MBSTRG(encoding_translation)) { - php_default_treat_data(arg, str, destArray TSRMLS_CC); - return; - } - - switch (arg) { - case PARSE_POST: - case PARSE_GET: - case PARSE_COOKIE: - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - switch (arg) { - case PARSE_POST: - PG(http_globals)[TRACK_VARS_POST] = array_ptr; - break; - case PARSE_GET: - PG(http_globals)[TRACK_VARS_GET] = array_ptr; - break; - case PARSE_COOKIE: - PG(http_globals)[TRACK_VARS_COOKIE] = array_ptr; - break; - } - break; - default: - array_ptr=destArray; - break; - } - - if (arg==PARSE_POST) { - sapi_handle_post(array_ptr TSRMLS_CC); - return; - } - - if (arg == PARSE_GET) { /* GET data */ - c_var = SG(request_info).query_string; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_COOKIE) { /* Cookie data */ - c_var = SG(request_info).cookie_data; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_STRING) { /* String data */ - res = str; - free_buffer = 1; - } - - if (!res) { - return; - } - - switch (arg) { - case PARSE_POST: - case PARSE_GET: - case PARSE_STRING: - separator = (char *) estrdup(PG(arg_separator).input); - break; - case PARSE_COOKIE: - separator = ";\0"; - break; - } - - switch(arg) { - case PARSE_POST: - MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid; - break; - case PARSE_GET: - MBSTRG(http_input_identify_get) = mbfl_no_encoding_invalid; - break; - case PARSE_COOKIE: - MBSTRG(http_input_identify_cookie) = mbfl_no_encoding_invalid; - break; - case PARSE_STRING: - MBSTRG(http_input_identify_string) = mbfl_no_encoding_invalid; - break; - } - - info.data_type = arg; - info.separator = separator; - info.force_register_globals = 0; - info.report_errors = 0; - info.to_encoding = MBSTRG(internal_encoding); - info.to_language = MBSTRG(language); - info.from_encodings = MBSTRG(http_input_list); - info.num_from_encodings = MBSTRG(http_input_list_size); - info.from_language = MBSTRG(language); - - detected = _php_mb_encoding_handler_ex(&info, array_ptr, res TSRMLS_CC); - MBSTRG(http_input_identify) = detected; - - if (detected != mbfl_no_encoding_invalid) { - switch(arg){ - case PARSE_POST: - MBSTRG(http_input_identify_post) = detected; - break; - case PARSE_GET: - MBSTRG(http_input_identify_get) = detected; - break; - case PARSE_COOKIE: - MBSTRG(http_input_identify_cookie) = detected; - break; - case PARSE_STRING: - MBSTRG(http_input_identify_string) = detected; - break; - } - } - - if (arg != PARSE_COOKIE) { - efree(separator); - } - - if (free_buffer) { - efree(res); - } -} -/* }}} */ - -/* {{{ mbfl_no_encoding _php_mb_encoding_handler_ex() */ -enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC) -{ - char *var, *val; - const char *s1, *s2; - char *strtok_buf = NULL, **val_list = NULL; - zval *array_ptr = (zval *) arg; - int n, num, *len_list = NULL; - unsigned int val_len, new_val_len; - mbfl_string string, resvar, resval; - enum mbfl_no_encoding from_encoding = mbfl_no_encoding_invalid; - mbfl_encoding_detector *identd = NULL; - mbfl_buffer_converter *convd = NULL; - int prev_rg_state = 0; - - mbfl_string_init_set(&string, info->to_language, info->to_encoding); - mbfl_string_init_set(&resvar, info->to_language, info->to_encoding); - mbfl_string_init_set(&resval, info->to_language, info->to_encoding); - - /* register_globals stuff - * XXX: this feature is going to be deprecated? */ - - if (info->force_register_globals) { - prev_rg_state = PG(register_globals); - PG(register_globals) = 1; - } - - if (!res || *res == '\0') { - goto out; - } - - /* count the variables(separators) contained in the "res". - * separator may contain multiple separator chars. - */ - num = 1; - for (s1=res; *s1 != '\0'; s1++) { - for (s2=info->separator; *s2 != '\0'; s2++) { - if (*s1 == *s2) { - num++; - } - } - } - num *= 2; /* need space for variable name and value */ - - val_list = (char **)ecalloc(num, sizeof(char *)); - len_list = (int *)ecalloc(num, sizeof(int)); - - /* split and decode the query */ - n = 0; - strtok_buf = NULL; - var = php_strtok_r(res, info->separator, &strtok_buf); - while (var) { - val = strchr(var, '='); - if (val) { /* have a value */ - len_list[n] = php_url_decode(var, val-var); - val_list[n] = var; - n++; - - *val++ = '\0'; - val_list[n] = val; - len_list[n] = php_url_decode(val, strlen(val)); - } else { - len_list[n] = php_url_decode(var, strlen(var)); - val_list[n] = var; - n++; - - val_list[n] = ""; - len_list[n] = 0; - } - n++; - var = php_strtok_r(NULL, info->separator, &strtok_buf); - } - num = n; /* make sure to process initilized vars only */ - - /* initialize converter */ - if (info->num_from_encodings <= 0) { - from_encoding = mbfl_no_encoding_pass; - } else if (info->num_from_encodings == 1) { - from_encoding = info->from_encodings[0]; - } else { - /* auto detect */ - from_encoding = mbfl_no_encoding_invalid; - identd = mbfl_encoding_detector_new((enum mbfl_no_encoding *)info->from_encodings, info->num_from_encodings); - if (identd) { - n = 0; - while (n < num) { - string.val = (unsigned char *)val_list[n]; - string.len = len_list[n]; - if (mbfl_encoding_detector_feed(identd, &string)) { - break; - } - n++; - } - from_encoding = mbfl_encoding_detector_judge(identd); - mbfl_encoding_detector_delete(identd); - } - if (from_encoding == mbfl_no_encoding_invalid) { - if (info->report_errors) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding"); - } - from_encoding = mbfl_no_encoding_pass; - } - } - - convd = NULL; - if (from_encoding != mbfl_no_encoding_pass) { - convd = mbfl_buffer_converter_new(from_encoding, info->to_encoding, 0); - if (convd != NULL) { - mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode)); - mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar)); - } else { - if (info->report_errors) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter"); - } - goto out; - } - } - - /* convert encoding */ - string.no_encoding = from_encoding; - - n = 0; - while (n < num) { - string.val = (unsigned char *)val_list[n]; - string.len = len_list[n]; - if (convd != NULL && mbfl_buffer_converter_feed_result(convd, &string, &resvar) != NULL) { - var = (char *)resvar.val; - } else { - var = val_list[n]; - } - n++; - string.val = val_list[n]; - string.len = len_list[n]; - if (convd != NULL && mbfl_buffer_converter_feed_result(convd, &string, &resval) != NULL) { - val = resval.val; - val_len = resval.len; - } else { - val = val_list[n]; - val_len = len_list[n]; - } - n++; - /* we need val to be emalloc()ed */ - val = estrndup(val, val_len); - if (sapi_module.input_filter(info->data_type, var, &val, val_len, &new_val_len TSRMLS_CC)) { - /* add variable to symbol table */ - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - - if (convd != NULL){ - mbfl_string_clear(&resvar); - mbfl_string_clear(&resval); - } - } - -out: - /* register_global stuff */ - if (info->force_register_globals) { - PG(register_globals) = prev_rg_state; - } - - if (convd != NULL) { - mbfl_buffer_converter_delete(convd); - } - if (val_list != NULL) { - efree((void *)val_list); - } - if (len_list != NULL) { - efree((void *)len_list); - } - - return from_encoding; -} -/* }}} */ - -/* {{{ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) */ -SAPI_POST_HANDLER_FUNC(php_mb_post_handler) -{ - enum mbfl_no_encoding detected; - php_mb_encoding_handler_info_t info; - - MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid; - - info.data_type = PARSE_POST; - info.separator = "&"; - info.force_register_globals = 0; - info.report_errors = 0; - info.to_encoding = MBSTRG(internal_encoding); - info.to_language = MBSTRG(language); - info.from_encodings = MBSTRG(http_input_list); - info.num_from_encodings = MBSTRG(http_input_list_size); - info.from_language = MBSTRG(language); - - detected = _php_mb_encoding_handler_ex(&info, arg, SG(request_info).post_data TSRMLS_CC); - - MBSTRG(http_input_identify) = detected; - if (detected != mbfl_no_encoding_invalid) { - MBSTRG(http_input_identify_post) = detected; - } -} -/* }}} */ - -#endif /* HAVE_MBSTRING */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ - diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h deleted file mode 100644 index 7cba2c3c07891..0000000000000 --- a/ext/mbstring/mb_gpc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 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: Rui Hirokawa | - | Moriyoshi Koizumi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -/* }}} */ - -#if HAVE_MBSTRING -/* {{{ typedefs */ -typedef struct _php_mb_encoding_handler_info_t { - int data_type; - const char *separator; - unsigned int force_register_globals: 1; - unsigned int report_errors: 1; - enum mbfl_no_language to_language; - enum mbfl_no_encoding to_encoding; - enum mbfl_no_language from_language; - int num_from_encodings; - const enum mbfl_no_encoding *from_encodings; -} php_mb_encoding_handler_info_t; - -/* }}}*/ - -/* {{{ prototypes */ -SAPI_POST_HANDLER_FUNC(php_mb_post_handler); -MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data); - -int _php_mb_enable_encoding_translation(int flag); -enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC); -/* }}} */ -#endif /* HAVE_MBSTRING */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c deleted file mode 100644 index d7426af3598b8..0000000000000 --- a/ext/mbstring/mbstring.c +++ /dev/null @@ -1,3717 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Tsukada Takuya | - | Rui Hirokawa | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * PHP 4 Multibyte String module "mbstring" - * - * History: - * 2000.5.19 Release php-4.0RC2_jstring-1.0 - * 2001.4.1 Release php4_jstring-1.0.91 - * 2001.4.30 Release php4_jstring-1.1 (contribute to The PHP Group) - * 2001.5.1 Renamed from jstring to mbstring (hirokawa@php.net) - */ - -/* - * PHP3 Internationalization support program. - * - * Copyright (c) 1999,2000 by the PHP3 internationalization team. - * All rights reserved. - * - * See README_PHP3-i18n-ja for more detail. - * - * Authors: - * Hironori Sato - * Shigeru Kanemoto - * Tsukada Takuya - * Rui Hirokawa - */ - -/* {{{ includes */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_variables.h" -#include "mbstring.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_mail.h" -#include "ext/standard/exec.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/url.h" -#include "main/php_output.h" -#include "ext/standard/info.h" - -#include "libmbfl/mbfl/mbfl_allocators.h" - -#include "php_variables.h" -#include "php_globals.h" -#include "rfc1867.h" -#include "php_content_types.h" -#include "SAPI.h" -#include "php_unicode.h" -#include "TSRM.h" - -#include "mb_gpc.h" - -#ifdef ZEND_MULTIBYTE -#include "zend_multibyte.h" -#endif /* ZEND_MULTIBYTE */ - -#if HAVE_MBSTRING -/* }}} */ - -/* {{{ prototypes */ -static void _php_mb_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC); -static void _php_mb_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC); -/* }}} */ - -/* {{{ php_mb_default_identify_list */ -typedef struct _php_mb_nls_ident_list { - enum mbfl_no_language lang; - enum mbfl_no_encoding* list; - int list_size; -} php_mb_nls_ident_list; - -static const enum mbfl_no_encoding php_mb_default_identify_list_ja[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_jis, - mbfl_no_encoding_utf8, - mbfl_no_encoding_euc_jp, - mbfl_no_encoding_sjis -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_cn[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8, - mbfl_no_encoding_euc_cn, - mbfl_no_encoding_cp936 -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_tw_hk[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8, - mbfl_no_encoding_euc_tw, - mbfl_no_encoding_big5 -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_kr[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8, - mbfl_no_encoding_euc_kr, - mbfl_no_encoding_uhc -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_ru[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8, - mbfl_no_encoding_koi8r, - mbfl_no_encoding_cp1251, - mbfl_no_encoding_cp866 -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_hy[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8, - mbfl_no_encoding_armscii8 -}; - -static const enum mbfl_no_encoding php_mb_default_identify_list_neut[] = { - mbfl_no_encoding_ascii, - mbfl_no_encoding_utf8 -}; - - -static const php_mb_nls_ident_list php_mb_default_identify_list[] = { - { mbfl_no_language_japanese, php_mb_default_identify_list_ja, sizeof(php_mb_default_identify_list_ja) / sizeof(php_mb_default_identify_list_ja[0]) }, - { mbfl_no_language_korean, php_mb_default_identify_list_kr, sizeof(php_mb_default_identify_list_kr) / sizeof(php_mb_default_identify_list_kr[0]) }, - { mbfl_no_language_traditional_chinese, php_mb_default_identify_list_tw_hk, sizeof(php_mb_default_identify_list_tw_hk) / sizeof(php_mb_default_identify_list_tw_hk[0]) }, - { mbfl_no_language_simplified_chinese, php_mb_default_identify_list_cn, sizeof(php_mb_default_identify_list_cn) / sizeof(php_mb_default_identify_list_cn[0]) }, - { mbfl_no_language_russian, php_mb_default_identify_list_ru, sizeof(php_mb_default_identify_list_ru) / sizeof(php_mb_default_identify_list_ru[0]) }, - { mbfl_no_language_armenian, php_mb_default_identify_list_hy, sizeof(php_mb_default_identify_list_hy) / sizeof(php_mb_default_identify_list_hy[0]) }, - { mbfl_no_language_neutral, php_mb_default_identify_list_neut, sizeof(php_mb_default_identify_list_neut) / sizeof(php_mb_default_identify_list_neut[0]) } -}; - -/* }}} */ - -static - ZEND_BEGIN_ARG_INFO(third_and_rest_force_ref, 1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_END_ARG_INFO(); - -/* {{{ mb_overload_def mb_ovld[] */ -static const struct mb_overload_def mb_ovld[] = { - {MB_OVERLOAD_MAIL, "mail", "mb_send_mail", "mb_orig_mail"}, - {MB_OVERLOAD_STRING, "strlen", "mb_strlen", "mb_orig_strlen"}, - {MB_OVERLOAD_STRING, "strpos", "mb_strpos", "mb_orig_strpos"}, - {MB_OVERLOAD_STRING, "strrpos", "mb_strrpos", "mb_orig_strrpos"}, - {MB_OVERLOAD_STRING, "substr", "mb_substr", "mb_orig_substr"}, - {MB_OVERLOAD_STRING, "strtolower", "mb_strtolower", "mb_orig_strtolower"}, - {MB_OVERLOAD_STRING, "strtoupper", "mb_strtoupper", "mb_orig_strtoupper"}, - {MB_OVERLOAD_STRING, "substr_count", "mb_substr_count", "mb_orig_substr_count"}, -#if HAVE_MBREGEX - {MB_OVERLOAD_REGEX, "ereg", "mb_ereg", "mb_orig_ereg"}, - {MB_OVERLOAD_REGEX, "eregi", "mb_eregi", "mb_orig_eregi"}, - {MB_OVERLOAD_REGEX, "ereg_replace", "mb_ereg_replace", "mb_orig_ereg_replace"}, - {MB_OVERLOAD_REGEX, "eregi_replace", "mb_eregi_replace", "mb_orig_eregi_replace"}, - {MB_OVERLOAD_REGEX, "split", "mb_split", "mb_orig_split"}, -#endif - {0, NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ function_entry mbstring_functions[] */ -function_entry mbstring_functions[] = { - PHP_FE(mb_convert_case, NULL) - PHP_FE(mb_strtoupper, NULL) - PHP_FE(mb_strtolower, NULL) - PHP_FE(mb_language, NULL) - PHP_FE(mb_internal_encoding, NULL) - PHP_FE(mb_http_input, NULL) - PHP_FE(mb_http_output, NULL) - PHP_FE(mb_detect_order, NULL) - PHP_FE(mb_substitute_character, NULL) - PHP_FE(mb_parse_str, second_arg_force_ref) - PHP_FE(mb_output_handler, NULL) - PHP_FE(mb_preferred_mime_name, NULL) - PHP_FE(mb_strlen, NULL) - PHP_FE(mb_strpos, NULL) - PHP_FE(mb_strrpos, NULL) - PHP_FE(mb_substr_count, NULL) - PHP_FE(mb_substr, NULL) - PHP_FE(mb_strcut, NULL) - PHP_FE(mb_strwidth, NULL) - PHP_FE(mb_strimwidth, NULL) - PHP_FE(mb_convert_encoding, NULL) - PHP_FE(mb_detect_encoding, NULL) - PHP_FE(mb_list_encodings, NULL) - PHP_FE(mb_convert_kana, NULL) - PHP_FE(mb_encode_mimeheader, NULL) - PHP_FE(mb_decode_mimeheader, NULL) - PHP_FE(mb_convert_variables, third_and_rest_force_ref) - PHP_FE(mb_encode_numericentity, NULL) - PHP_FE(mb_decode_numericentity, NULL) - PHP_FE(mb_send_mail, NULL) - PHP_FE(mb_get_info, NULL) -#if HAVE_MBREGEX - PHP_MBREGEX_FUNCTION_ENTRIES -#endif - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ zend_module_entry mbstring_module_entry */ -zend_module_entry mbstring_module_entry = { - STANDARD_MODULE_HEADER, - "mbstring", - mbstring_functions, - PHP_MINIT(mbstring), - PHP_MSHUTDOWN(mbstring), - PHP_RINIT(mbstring), - PHP_RSHUTDOWN(mbstring), - PHP_MINFO(mbstring), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ static sapi_post_entry php_post_entries[] */ -static sapi_post_entry php_post_entries[] = { - { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler }, - { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler }, - { NULL, 0, NULL, NULL } -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(mbstring) - -#ifdef COMPILE_DL_MBSTRING -ZEND_GET_MODULE(mbstring) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* {{{ allocators */ -static void *_php_mb_allocators_malloc(unsigned int sz) -{ - return emalloc(sz); -} - -static void *_php_mb_allocators_realloc(void *ptr, unsigned int sz) -{ - return erealloc(ptr, sz); -} - -static void *_php_mb_allocators_calloc(unsigned int nelems, unsigned int szelem) -{ - return ecalloc(nelems, szelem); -} - -static void _php_mb_allocators_free(void *ptr) -{ - efree(ptr); -} - -static void *_php_mb_allocators_pmalloc(unsigned int sz) -{ - return pemalloc(sz, 1); -} - -static void *_php_mb_allocators_prealloc(void *ptr, unsigned int sz) -{ - return perealloc(ptr, sz, 1); -} - -static void _php_mb_allocators_pfree(void *ptr) -{ - pefree(ptr, 1); -} - -static mbfl_allocators _php_mb_allocators = { - _php_mb_allocators_malloc, - _php_mb_allocators_realloc, - _php_mb_allocators_calloc, - _php_mb_allocators_free, - _php_mb_allocators_pmalloc, - _php_mb_allocators_prealloc, - _php_mb_allocators_pfree -}; -/* }}} */ - -/* {{{ static sapi_post_entry mbstr_post_entries[] */ -static sapi_post_entry mbstr_post_entries[] = { - { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_mb_post_handler }, - { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler }, - { NULL, 0, NULL, NULL } -}; -/* }}} */ - -/* {{{ static int php_mb_parse_encoding_list() - * Return 0 if input contains any illegal encoding, otherwise 1. - * Even if any illegal encoding is detected the result may contain a list - * of parsed encodings. - */ -static int -php_mb_parse_encoding_list(const char *value, int value_length, enum mbfl_no_encoding **return_list, int *return_size, int persistent TSRMLS_DC) -{ - int n, l, size, bauto, ret = 1; - char *p, *p1, *p2, *endp, *tmpstr; - enum mbfl_no_encoding no_encoding; - enum mbfl_no_encoding *src, *entry, *list; - - list = NULL; - if (value == NULL || value_length <= 0) { - if (return_list) { - *return_list = NULL; - } - if (return_size) { - *return_size = 0; - } - return 0; - } else { - enum mbfl_no_encoding *identify_list; - int identify_list_size; - - identify_list = MBSTRG(default_detect_order_list); - identify_list_size = MBSTRG(default_detect_order_list_size); - - /* copy the value string for work */ - if (value[0]=='"' && value[value_length-1]=='"' && value_length>2) { - tmpstr = (char *)estrndup(value+1, value_length-2); - value_length -= 2; - } - else - tmpstr = (char *)estrndup(value, value_length); - if (tmpstr == NULL) { - return 0; - } - /* count the number of listed encoding names */ - endp = tmpstr + value_length; - n = 1; - p1 = tmpstr; - while ((p2 = php_memnstr(p1, ",", 1, endp)) != NULL) { - p1 = p2 + 1; - n++; - } - size = n + identify_list_size; - /* make list */ - list = (enum mbfl_no_encoding *)pecalloc(size, sizeof(int), persistent); - if (list != NULL) { - entry = list; - n = 0; - bauto = 0; - p1 = tmpstr; - do { - p2 = p = php_memnstr(p1, ",", 1, endp); - if (p == NULL) { - p = endp; - } - *p = '\0'; - /* trim spaces */ - while (p1 < p && (*p1 == ' ' || *p1 == '\t')) { - p1++; - } - p--; - while (p > p1 && (*p == ' ' || *p == '\t')) { - *p = '\0'; - p--; - } - /* convert to the encoding number and check encoding */ - if (strcasecmp(p1, "auto") == 0) { - if (!bauto) { - bauto = 1; - l = identify_list_size; - src = identify_list; - while (l > 0) { - *entry++ = *src++; - l--; - n++; - } - } - } else { - no_encoding = mbfl_name2no_encoding(p1); - if (no_encoding != mbfl_no_encoding_invalid) { - *entry++ = no_encoding; - n++; - } else { - ret = 0; - } - } - p1 = p2 + 1; - } while (n < size && p2 != NULL); - if (n > 0) { - if (return_list) { - *return_list = list; - } else { - pefree(list, persistent); - } - } else { - pefree(list, persistent); - if (return_list) { - *return_list = NULL; - } - ret = 0; - } - if (return_size) { - *return_size = n; - } - } else { - if (return_list) { - *return_list = NULL; - } - if (return_size) { - *return_size = 0; - } - ret = 0; - } - efree(tmpstr); - } - - return ret; -} -/* }}} */ - -/* {{{ MBSTRING_API php_mb_check_encoding_list */ -MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC) { - return php_mb_parse_encoding_list(encoding_list, strlen(encoding_list), NULL, NULL, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ static int php_mb_parse_encoding_array() - * Return 0 if input contains any illegal encoding, otherwise 1. - * Even if any illegal encoding is detected the result may contain a list - * of parsed encodings. - */ -static int -php_mb_parse_encoding_array(zval *array, enum mbfl_no_encoding **return_list, int *return_size, int persistent TSRMLS_DC) -{ - zval **hash_entry; - HashTable *target_hash; - int i, n, l, size, bauto,ret = 1; - enum mbfl_no_encoding no_encoding; - enum mbfl_no_encoding *src, *list, *entry; - - list = NULL; - if (Z_TYPE_P(array) == IS_ARRAY) { - enum mbfl_no_encoding *identify_list; - int identify_list_size; - - identify_list = MBSTRG(default_detect_order_list); - identify_list_size = MBSTRG(default_detect_order_list_size); - - target_hash = Z_ARRVAL_P(array); - zend_hash_internal_pointer_reset(target_hash); - i = zend_hash_num_elements(target_hash); - size = i + identify_list_size; - list = (enum mbfl_no_encoding *)pecalloc(size, sizeof(int), persistent); - if (list != NULL) { - entry = list; - bauto = 0; - n = 0; - while (i > 0) { - if (zend_hash_get_current_data(target_hash, (void **) &hash_entry) == FAILURE) { - break; - } - convert_to_string_ex(hash_entry); - if (strcasecmp(Z_STRVAL_PP(hash_entry), "auto") == 0) { - if (!bauto) { - bauto = 1; - l = identify_list_size; - src = identify_list; - while (l > 0) { - *entry++ = *src++; - l--; - n++; - } - } - } else { - no_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(hash_entry)); - if (no_encoding != mbfl_no_encoding_invalid) { - *entry++ = no_encoding; - n++; - } else { - ret = 0; - } - } - zend_hash_move_forward(target_hash); - i--; - } - if (n > 0) { - if (return_list) { - *return_list = list; - } else { - pefree(list, persistent); - } - } else { - pefree(list, persistent); - if (return_list) { - *return_list = NULL; - } - ret = 0; - } - if (return_size) { - *return_size = n; - } - } else { - if (return_list) { - *return_list = NULL; - } - if (return_size) { - *return_size = 0; - } - ret = 0; - } - } - - return ret; -} -/* }}} */ - -/* {{{ php_mb_nls_get_default_detect_order_list */ -static int php_mb_nls_get_default_detect_order_list(enum mbfl_no_language lang, enum mbfl_no_encoding **plist, int* plist_size) -{ - size_t i; - - *plist = (enum mbfl_no_encoding *) php_mb_default_identify_list_neut; - *plist_size = sizeof(php_mb_default_identify_list_neut) / sizeof(php_mb_default_identify_list_neut[0]); - - for (i = 0; i < sizeof(php_mb_default_identify_list) / sizeof(php_mb_default_identify_list[0]); i++) { - if (php_mb_default_identify_list[i].lang == lang) { - *plist = php_mb_default_identify_list[i].list; - *plist_size = php_mb_default_identify_list[i].list_size; - return 1; - } - } - return 0; -} -/* }}} */ - -/* {{{ php.ini directive handler */ -static PHP_INI_MH(OnUpdate_mbstring_language) -{ - enum mbfl_no_language no_language; - - no_language = mbfl_name2no_language(new_value); - if (no_language == mbfl_no_language_invalid) { - return FAILURE; - } - MBSTRG(language) = no_language; - php_mb_nls_get_default_detect_order_list(no_language, &MBSTRG(default_detect_order_list), &MBSTRG(default_detect_order_list_size)); - return SUCCESS; -} -/* }}} */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_detect_order) */ -static PHP_INI_MH(OnUpdate_mbstring_detect_order) -{ - enum mbfl_no_encoding *list; - int size; - - if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) { - if (MBSTRG(detect_order_list) != NULL) { - free(MBSTRG(detect_order_list)); - } - MBSTRG(detect_order_list) = list; - MBSTRG(detect_order_list_size) = size; - } else { - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_http_input) */ -static PHP_INI_MH(OnUpdate_mbstring_http_input) -{ - enum mbfl_no_encoding *list; - int size; - - if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) { - if (MBSTRG(http_input_list) != NULL) { - free(MBSTRG(http_input_list)); - } - MBSTRG(http_input_list) = list; - MBSTRG(http_input_list_size) = size; - } else { - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_http_output) */ -static PHP_INI_MH(OnUpdate_mbstring_http_output) -{ - enum mbfl_no_encoding no_encoding; - - no_encoding = mbfl_name2no_encoding(new_value); - if (no_encoding != mbfl_no_encoding_invalid) { - MBSTRG(http_output_encoding) = no_encoding; - MBSTRG(current_http_output_encoding) = no_encoding; - } else { - if (new_value != NULL && new_value_length > 0) { - return FAILURE; - } - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) */ -static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) -{ - enum mbfl_no_encoding no_encoding; - if (new_value == NULL) { - return SUCCESS; - } - - no_encoding = mbfl_name2no_encoding(new_value); - if (no_encoding != mbfl_no_encoding_invalid) { - MBSTRG(internal_encoding) = no_encoding; - MBSTRG(current_internal_encoding) = no_encoding; -#if HAVE_MBREGEX - { - OnigEncoding mbctype; - mbctype = php_mb_regex_name2mbctype(new_value); - if (mbctype == ONIG_ENCODING_UNDEF) { - mbctype = ONIG_ENCODING_EUC_JP; - } - MBSTRG(current_mbctype) = MBSTRG(default_mbctype) = mbctype; - } -#endif -#ifdef ZEND_MULTIBYTE - zend_multibyte_set_internal_encoding(new_value, new_value_length TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - } else { - if (new_value != NULL && new_value_length > 0) { - return FAILURE; - } - } - - return SUCCESS; -} -/* }}} */ - -#ifdef ZEND_MULTIBYTE -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_script_encoding) */ -static PHP_INI_MH(OnUpdate_mbstring_script_encoding) -{ - int *list, size; - - if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) { - if (MBSTRG(script_encoding_list) != NULL) { - free(MBSTRG(script_encoding_list)); - } - MBSTRG(script_encoding_list) = list; - MBSTRG(script_encoding_list_size) = size; - } else { - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ -#endif /* ZEND_MULTIBYTE */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) */ -static PHP_INI_MH(OnUpdate_mbstring_substitute_character) -{ - if (new_value != NULL) { - if (strcasecmp("none", new_value) == 0) { - MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE; - } else if (strcasecmp("long", new_value) == 0) { - MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG; - } else { - MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(filter_illegal_substchar) = zend_atoi(new_value, new_value_length); - } - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation) */ -static PHP_INI_MH(OnUpdate_mbstring_encoding_translation) -{ - if (new_value == NULL) { - return FAILURE; - } - - OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - if (MBSTRG(encoding_translation)) { - sapi_unregister_post_entry(php_post_entries TSRMLS_CC); - sapi_register_post_entries(mbstr_post_entries TSRMLS_CC); - sapi_register_treat_data(mbstr_treat_data); - } else { - sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC); - sapi_register_post_entries(php_post_entries TSRMLS_CC); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ php.ini directive registration */ -PHP_INI_BEGIN() - PHP_INI_ENTRY("mbstring.language", "neutral", PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_language) - PHP_INI_ENTRY("mbstring.detect_order", NULL, PHP_INI_ALL, OnUpdate_mbstring_detect_order) - PHP_INI_ENTRY("mbstring.http_input", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_input) - PHP_INI_ENTRY("mbstring.http_output", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_output) - PHP_INI_ENTRY("mbstring.internal_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_internal_encoding) -#ifdef ZEND_MULTIBYTE - PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_script_encoding) -#endif /* ZEND_MULTIBYTE */ - PHP_INI_ENTRY("mbstring.substitute_character", NULL, PHP_INI_ALL, OnUpdate_mbstring_substitute_character) - STD_PHP_INI_ENTRY("mbstring.func_overload", "0", PHP_INI_SYSTEM | - PHP_INI_PERDIR, OnUpdateLong, func_overload, zend_mbstring_globals, mbstring_globals) - - STD_PHP_INI_BOOLEAN("mbstring.encoding_translation", "0", - PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation, - encoding_translation, zend_mbstring_globals, mbstring_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ module global initialize handler */ -static void _php_mb_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC) -{ - MBSTRG(language) = mbfl_no_language_uni; - MBSTRG(current_language) = MBSTRG(language); - MBSTRG(internal_encoding) = mbfl_no_encoding_invalid; - MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding); -#ifdef ZEND_MULTIBYTE - MBSTRG(script_encoding_list) = NULL; - MBSTRG(script_encoding_list_size) = 0; -#endif /* ZEND_MULTIBYTE */ - MBSTRG(http_output_encoding) = mbfl_no_encoding_pass; - MBSTRG(current_http_output_encoding) = mbfl_no_encoding_pass; - MBSTRG(http_input_identify) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_get) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_cookie) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_string) = mbfl_no_encoding_invalid; - MBSTRG(http_input_list) = NULL; - MBSTRG(http_input_list_size) = 0; - MBSTRG(detect_order_list) = NULL; - MBSTRG(detect_order_list_size) = 0; - MBSTRG(current_detect_order_list) = NULL; - MBSTRG(current_detect_order_list_size) = 0; - MBSTRG(default_detect_order_list) = (enum mbfl_no_encoding *) php_mb_default_identify_list_neut; - MBSTRG(default_detect_order_list_size) = sizeof(php_mb_default_identify_list_neut) / sizeof(php_mb_default_identify_list_neut[0]); - MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(filter_illegal_substchar) = 0x3f; /* '?' */ - MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(current_filter_illegal_substchar) = 0x3f; /* '?' */ - MBSTRG(func_overload) = 0; - MBSTRG(encoding_translation) = 0; - pglobals->outconv = NULL; -#if HAVE_MBREGEX - _php_mb_regex_globals_ctor(pglobals TSRMLS_CC); -#endif -} -/* }}} */ - -/* {{{ static void _php_mb_globals_dtor() */ -static void _php_mb_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC) -{ -#if HAVE_MBREGEX - _php_mb_regex_globals_dtor(pglobals TSRMLS_CC); -#endif -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(mbstring) */ -PHP_MINIT_FUNCTION(mbstring) -{ - __mbfl_allocators = &_php_mb_allocators; - -#ifdef ZTS - ts_allocate_id(&mbstring_globals_id, sizeof(zend_mbstring_globals), - (ts_allocate_ctor) _php_mb_globals_ctor, - (ts_allocate_dtor) _php_mb_globals_dtor); -#else - _php_mb_globals_ctor(&mbstring_globals TSRMLS_CC); -#endif - - REGISTER_INI_ENTRIES(); - - if (MBSTRG(encoding_translation)) { - sapi_register_post_entries(mbstr_post_entries TSRMLS_CC); - sapi_register_treat_data(mbstr_treat_data); - } - - REGISTER_LONG_CONSTANT("MB_OVERLOAD_MAIL", MB_OVERLOAD_MAIL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MB_OVERLOAD_STRING", MB_OVERLOAD_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MB_OVERLOAD_REGEX", MB_OVERLOAD_REGEX, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("MB_CASE_UPPER", PHP_UNICODE_CASE_UPPER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MB_CASE_LOWER", PHP_UNICODE_CASE_LOWER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MB_CASE_TITLE", PHP_UNICODE_CASE_TITLE, CONST_CS | CONST_PERSISTENT); - -#if HAVE_MBREGEX - PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION(mbstring) */ -PHP_MSHUTDOWN_FUNCTION(mbstring) -{ - UNREGISTER_INI_ENTRIES(); - - if (MBSTRG(http_input_list)) { - free(MBSTRG(http_input_list)); - } -#ifdef ZEND_MULTIBYTE - if (MBSTRG(script_encoding_list)) { - free(MBSTRG(script_encoding_list)); - } -#endif /* ZEND_MULTIBYTE */ - if (MBSTRG(detect_order_list)) { - free(MBSTRG(detect_order_list)); - } - -#if HAVE_MBREGEX - PHP_MSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU); -#endif - -#ifdef ZTS - ts_free_id(mbstring_globals_id); -#else - _php_mb_globals_dtor(&mbstring_globals TSRMLS_CC); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION(mbstring) */ -PHP_RINIT_FUNCTION(mbstring) -{ - int n; - enum mbfl_no_encoding *list=NULL, *entry; - zend_function *func, *orig; - const struct mb_overload_def *p; - - MBSTRG(current_language) = MBSTRG(language); - - if (MBSTRG(internal_encoding) == mbfl_no_encoding_invalid) { - char *default_enc = NULL; - switch (MBSTRG(current_language)) { - case mbfl_no_language_uni: - default_enc = "UTF-8"; - break; - case mbfl_no_language_japanese: - default_enc = "EUC-JP"; - break; - case mbfl_no_language_korean: - default_enc = "EUC-KR"; - break; - case mbfl_no_language_simplified_chinese: - default_enc = "EUC-CN"; - break; - case mbfl_no_language_traditional_chinese: - default_enc = "EUC-TW"; - break; - case mbfl_no_language_russian: - default_enc = "KOI8-R"; - break; - case mbfl_no_language_german: - default_enc = "ISO-8859-15"; - break; - case mbfl_no_language_armenian: - default_enc = "ArmSCII-8"; - break; - case mbfl_no_language_english: - default: - default_enc = "ISO-8859-1"; - break; - } - if (default_enc) { - zend_alter_ini_entry("mbstring.internal_encoding", - sizeof("mbstring.internal_encoding"), - default_enc, strlen(default_enc), - PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME); - } - } - - MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding); - MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding); - MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode); - MBSTRG(current_filter_illegal_substchar) = MBSTRG(filter_illegal_substchar); - - n = 0; - if (MBSTRG(detect_order_list)) { - list = MBSTRG(detect_order_list); - n = MBSTRG(detect_order_list_size); - } - if (n <= 0) { - list = MBSTRG(default_detect_order_list); - n = MBSTRG(default_detect_order_list_size); - } - entry = (enum mbfl_no_encoding *)safe_emalloc(n, sizeof(int), 0); - MBSTRG(current_detect_order_list) = entry; - MBSTRG(current_detect_order_list_size) = n; - while (n > 0) { - *entry++ = *list++; - n--; - } - - /* override original function. */ - if (MBSTRG(func_overload)){ - p = &(mb_ovld[0]); - - while (p->type > 0) { - if ((MBSTRG(func_overload) & p->type) == p->type && - zend_hash_find(EG(function_table), p->save_func, - strlen(p->save_func)+1, (void **)&orig) != SUCCESS) { - - zend_hash_find(EG(function_table), p->ovld_func, strlen(p->ovld_func)+1 , (void **)&func); - - if (zend_hash_find(EG(function_table), p->orig_func, strlen(p->orig_func)+1, (void **)&orig) != SUCCESS) { - php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't find function %s.", p->orig_func); - return FAILURE; - } else { - zend_hash_add(EG(function_table), p->save_func, strlen(p->save_func)+1, orig, sizeof(zend_function), NULL); - - if (zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, func, sizeof(zend_function), - NULL) == FAILURE) { - php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't replace function %s.", p->orig_func); - return FAILURE; - } - } - } - p++; - } - } -#if HAVE_MBREGEX - PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU); -#endif -#ifdef ZEND_MULTIBYTE - php_mb_set_zend_encoding(TSRMLS_C); -#endif /* ZEND_MULTIBYTE */ - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION(mbstring) */ -PHP_RSHUTDOWN_FUNCTION(mbstring) -{ - const struct mb_overload_def *p; - zend_function *orig; - - if (MBSTRG(current_detect_order_list) != NULL) { - efree(MBSTRG(current_detect_order_list)); - MBSTRG(current_detect_order_list) = NULL; - MBSTRG(current_detect_order_list_size) = 0; - } - if (MBSTRG(outconv) != NULL) { - mbfl_buffer_converter_delete(MBSTRG(outconv)); - MBSTRG(outconv) = NULL; - } - - /* clear http input identification. */ - MBSTRG(http_input_identify) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_get) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_cookie) = mbfl_no_encoding_invalid; - MBSTRG(http_input_identify_string) = mbfl_no_encoding_invalid; - - /* clear overloaded function. */ - if (MBSTRG(func_overload)){ - p = &(mb_ovld[0]); - while (p->type > 0 && zend_hash_find(EG(function_table), p->save_func, strlen(p->save_func)+1 , (void **)&orig) == SUCCESS) { - zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, orig, sizeof(zend_function), NULL); - zend_hash_del(EG(function_table), p->save_func, strlen(p->save_func)+1); - p++; - } - } - -#if HAVE_MBREGEX - PHP_RSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION(mbstring) */ -PHP_MINFO_FUNCTION(mbstring) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Multibyte Support", "enabled"); - php_info_print_table_row(2, "Multibyte string engine", "libmbfl"); - if (MBSTRG(encoding_translation)) { - php_info_print_table_row(2, "HTTP input encoding translation", "enabled"); - } -#if defined(HAVE_MBREGEX) - { - char buf[32]; - php_info_print_table_row(2, "Multibyte (japanese) regex support", "enabled"); - sprintf(buf, "%d.%d.%d", - ONIGURUMA_VERSION_MAJOR,ONIGURUMA_VERSION_MINOR,ONIGURUMA_VERSION_TEENY); - php_info_print_table_row(2, "Multibyte regex (oniguruma) version", buf); - } -#endif - php_info_print_table_end(); - - php_info_print_table_start(); - php_info_print_table_header(1, "mbstring extension makes use of \"streamable kanji code filter and converter\", which is distributed under the GNU Lesser General Public License version 2.1."); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto string mb_language([string language]) - Sets the current language or Returns the current language as a string */ -PHP_FUNCTION(mb_language) -{ - char *name = NULL; - int name_len = 0; - enum mbfl_no_language no_language; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { - return; - } - if (name == NULL) { - RETURN_STRING((char *)mbfl_no_language2name(MBSTRG(current_language)), 1); - } else { - no_language = mbfl_name2no_language(name); - if (no_language == mbfl_no_language_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name); - RETURN_FALSE; - } else { - php_mb_nls_get_default_detect_order_list(no_language, &MBSTRG(default_detect_order_list), &MBSTRG(default_detect_order_list_size)); - MBSTRG(current_language) = no_language; - RETURN_TRUE; - } - } -} -/* }}} */ - -/* {{{ proto string mb_internal_encoding([string encoding]) - Sets the current internal encoding or Returns the current internal encoding as a string */ -PHP_FUNCTION(mb_internal_encoding) -{ - char *name = NULL; - int name_len; - enum mbfl_no_encoding no_encoding; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - if (name == NULL) { - name = (char *)mbfl_no_encoding2name(MBSTRG(current_internal_encoding)); - if (name != NULL) { - RETURN_STRING(name, 1); - } else { - RETURN_FALSE; - } - } else { - no_encoding = mbfl_name2no_encoding(name); - if (no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name); - RETURN_FALSE; - } else { - MBSTRG(current_internal_encoding) = no_encoding; -#ifdef ZEND_MULTIBYTE - /* TODO: make independent from mbstring.encoding_translation? */ - if (MBSTRG(encoding_translation)) { - zend_multibyte_set_internal_encoding(name, name_len TSRMLS_CC); - } -#endif /* ZEND_MULTIBYTE */ - RETURN_TRUE; - } - } -} -/* }}} */ - -/* {{{ proto mixed mb_http_input([string type]) - Returns the input encoding */ -PHP_FUNCTION(mb_http_input) -{ - char *typ = NULL; - int typ_len; - int retname, n; - char *name, *list, *temp; - enum mbfl_no_encoding *entry; - enum mbfl_no_encoding result = mbfl_no_encoding_invalid; - - retname = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) { - RETURN_FALSE; - } - if (typ == NULL) { - result = MBSTRG(http_input_identify); - } else { - switch (*typ) { - case 'G': - case 'g': - result = MBSTRG(http_input_identify_get); - break; - case 'P': - case 'p': - result = MBSTRG(http_input_identify_post); - break; - case 'C': - case 'c': - result = MBSTRG(http_input_identify_cookie); - break; - case 'S': - case 's': - result = MBSTRG(http_input_identify_string); - break; - case 'I': - case 'i': - array_init(return_value); - entry = MBSTRG(http_input_list); - n = MBSTRG(http_input_list_size); - while (n > 0) { - name = (char *)mbfl_no_encoding2name(*entry); - if (name) { - add_next_index_string(return_value, name, 1); - } - entry++; - n--; - } - retname = 0; - break; - case 'L': - case 'l': - entry = MBSTRG(http_input_list); - n = MBSTRG(http_input_list_size); - list = NULL; - while (n > 0) { - name = (char *)mbfl_no_encoding2name(*entry); - if (name) { - if (list) { - temp = list; - spprintf(&list, 0, "%s,%s", temp, name); - efree(temp); - if (!list) { - break; - } - } else { - list = estrdup(name); - } - } - entry++; - n--; - } - if (!list) { - RETURN_FALSE; - } - RETVAL_STRING(list, 0); - retname = 0; - break; - default: - result = MBSTRG(http_input_identify); - break; - } - } - - if (retname) { - if (result != mbfl_no_encoding_invalid && - (name = (char *)mbfl_no_encoding2name(result)) != NULL) { - RETVAL_STRING(name, 1); - } else { - RETVAL_FALSE; - } - } -} -/* }}} */ - -/* {{{ proto string mb_http_output([string encoding]) - Sets the current output_encoding or returns the current output_encoding as a string */ -PHP_FUNCTION(mb_http_output) -{ - char *name = NULL; - int name_len; - enum mbfl_no_encoding no_encoding; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", (char **)&name, &name_len) == FAILURE) { - RETURN_FALSE; - } - - if (name == NULL) { - name = (char *)mbfl_no_encoding2name(MBSTRG(current_http_output_encoding)); - if (name != NULL) { - RETURN_STRING(name, 1); - } else { - RETURN_FALSE; - } - } else { - no_encoding = mbfl_name2no_encoding(name); - if (no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name); - RETURN_FALSE; - } else { - MBSTRG(current_http_output_encoding) = no_encoding; - RETURN_TRUE; - } - } -} -/* }}} */ - -/* {{{ proto bool|array mb_detect_order([mixed encoding-list]) - Sets the current detect_order or Return the current detect_order as a array */ -PHP_FUNCTION(mb_detect_order) -{ - zval **arg1; - int n, size; - enum mbfl_no_encoding *list, *entry; - char *name; - - if (ZEND_NUM_ARGS() == 0) { - array_init(return_value); - entry = MBSTRG(current_detect_order_list); - n = MBSTRG(current_detect_order_list_size); - while (n > 0) { - name = (char *)mbfl_no_encoding2name(*entry); - if (name) { - add_next_index_string(return_value, name, 1); - } - entry++; - n--; - } - } else if (ZEND_NUM_ARGS() == 1 && zend_get_parameters_ex(1, &arg1) != FAILURE) { - list = NULL; - size = 0; - switch (Z_TYPE_PP(arg1)) { - case IS_ARRAY: - if (!php_mb_parse_encoding_array(*arg1, &list, &size, 0 TSRMLS_CC)) { - if (list) { - efree(list); - } - RETURN_FALSE; - } - break; - default: - convert_to_string_ex(arg1); - if (!php_mb_parse_encoding_list(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1), &list, &size, 0 TSRMLS_CC)) { - if (list) { - efree(list); - } - RETURN_FALSE; - } - break; - } - if (list == NULL) { - RETVAL_FALSE; - } else { - if (MBSTRG(current_detect_order_list)) { - efree(MBSTRG(current_detect_order_list)); - } - MBSTRG(current_detect_order_list) = list; - MBSTRG(current_detect_order_list_size) = size; - RETVAL_TRUE; - } - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto mixed mb_substitute_character([mixed substchar]) - Sets the current substitute_character or returns the current substitute_character */ -PHP_FUNCTION(mb_substitute_character) -{ - zval **arg1; - - if (ZEND_NUM_ARGS() == 0) { - if (MBSTRG(current_filter_illegal_mode) == MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - RETVAL_STRING("none", 1); - } else if (MBSTRG(current_filter_illegal_mode) == MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG) { - RETVAL_STRING("long", 1); - } else { - RETVAL_LONG(MBSTRG(current_filter_illegal_substchar)); - } - } else if (ZEND_NUM_ARGS() == 1 && zend_get_parameters_ex(1, &arg1) != FAILURE) { - RETVAL_TRUE; - switch (Z_TYPE_PP(arg1)) { - case IS_STRING: - if (strcasecmp("none", Z_STRVAL_PP(arg1)) == 0) { - MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE; - } else if (strcasecmp("long", Z_STRVAL_PP(arg1)) == 0) { - MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG; - } else { - convert_to_long_ex(arg1); - if (Z_LVAL_PP(arg1)< 0xffff && Z_LVAL_PP(arg1)> 0x0) { - MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(current_filter_illegal_substchar) = Z_LVAL_PP(arg1); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character."); - RETVAL_FALSE; - } - } - break; - default: - convert_to_long_ex(arg1); - if (Z_LVAL_PP(arg1)< 0xffff && Z_LVAL_PP(arg1)> 0x0) { - MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(current_filter_illegal_substchar) = Z_LVAL_PP(arg1); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character."); - RETVAL_FALSE; - } - break; - } - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto string mb_preferred_mime_name(string encoding) - Return the preferred MIME name (charset) as a string */ -PHP_FUNCTION(mb_preferred_mime_name) -{ - enum mbfl_no_encoding no_encoding; - char *name = NULL; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } else { - no_encoding = mbfl_name2no_encoding(name); - if (no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name); - RETVAL_FALSE; - } else { - const char *preferred_name = mbfl_no2preferred_mime_name(no_encoding); - if (preferred_name == NULL || *preferred_name == '\0') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name); - RETVAL_FALSE; - } else { - RETVAL_STRING((char *)preferred_name, 1); - } - } - } -} -/* }}} */ - -#define IS_SJIS1(c) ((((c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0) -#define IS_SJIS2(c) ((((c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0) - -/* {{{ proto bool mb_parse_str(string encoded_string [, array result]) - Parses GET/POST/COOKIE data and sets global variables */ -PHP_FUNCTION(mb_parse_str) -{ - zval *track_vars_array; - char *encstr = NULL; - int encstr_len; - php_mb_encoding_handler_info_t info; - enum mbfl_no_encoding detected; - - track_vars_array = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &encstr, &encstr_len, &track_vars_array) == FAILURE) { - return; - } - - /* Clear out the array */ - if (track_vars_array != NULL) { - zval_dtor(track_vars_array); - array_init(track_vars_array); - } - - encstr = estrndup(encstr, encstr_len); - - info.data_type = PARSE_STRING; - info.separator = PG(arg_separator).input; - info.force_register_globals = (track_vars_array == NULL); - info.report_errors = 1; - info.to_encoding = MBSTRG(current_internal_encoding); - info.to_language = MBSTRG(current_language); - info.from_encodings = MBSTRG(http_input_list); - info.num_from_encodings = MBSTRG(http_input_list_size); - info.from_language = MBSTRG(current_language); - - detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC); - - MBSTRG(http_input_identify) = detected; - - RETVAL_BOOL(detected != mbfl_no_encoding_invalid); - - if (encstr != NULL) efree(encstr); -} -/* }}} */ - -/* {{{ proto string mb_output_handler(string contents, int status) - Returns string in output buffer converted to the http_output encoding */ -PHP_FUNCTION(mb_output_handler) -{ - char *arg_string; - int arg_string_len; - long arg_status; - mbfl_string string, result; - const char *charset; - char *p; - enum mbfl_no_encoding encoding; - int last_feed, len; - unsigned char send_text_mimetype = 0; - char *s, *mimetype = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &arg_string, &arg_string_len, &arg_status) == FAILURE) { - return; - } - - encoding = MBSTRG(current_http_output_encoding); - - /* start phase only */ - if ((arg_status & PHP_OUTPUT_HANDLER_START) != 0) { - /* delete the converter just in case. */ - if (MBSTRG(outconv)) { - mbfl_buffer_converter_delete(MBSTRG(outconv)); - MBSTRG(outconv) = NULL; - } - if (encoding == mbfl_no_encoding_pass) { - RETURN_STRINGL(arg_string, arg_string_len, 1); - } - - /* analyze mime type */ - if (SG(sapi_headers).mimetype && - strncmp(SG(sapi_headers).mimetype, "text/", 5) == 0) { - if ((s = strchr(SG(sapi_headers).mimetype,';')) == NULL){ - mimetype = estrdup(SG(sapi_headers).mimetype); - } else { - mimetype = estrndup(SG(sapi_headers).mimetype,s-SG(sapi_headers).mimetype); - } - send_text_mimetype = 1; - } else if (SG(sapi_headers).send_default_content_type) { - mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE; - } - - /* if content-type is not yet set, set it and activate the converter */ - if (SG(sapi_headers).send_default_content_type || send_text_mimetype) { - charset = mbfl_no2preferred_mime_name(encoding); - if (charset) { - len = spprintf( &p, 0, "Content-Type: %s; charset=%s", mimetype, charset ); - if (sapi_add_header(p, len, 0) != FAILURE) { - SG(sapi_headers).send_default_content_type = 0; - } - } - /* activate the converter */ - MBSTRG(outconv) = mbfl_buffer_converter_new(MBSTRG(current_internal_encoding), encoding, 0); - if (send_text_mimetype){ - efree(mimetype); - } - } - } - - /* just return if the converter is not activated. */ - if (MBSTRG(outconv) == NULL) { - RETURN_STRINGL(arg_string, arg_string_len, 1); - } - - /* flag */ - last_feed = ((arg_status & PHP_OUTPUT_HANDLER_END) != 0); - /* mode */ - mbfl_buffer_converter_illegal_mode(MBSTRG(outconv), MBSTRG(current_filter_illegal_mode)); - mbfl_buffer_converter_illegal_substchar(MBSTRG(outconv), MBSTRG(current_filter_illegal_substchar)); - - /* feed the string */ - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - string.val = (unsigned char *)arg_string; - string.len = arg_string_len; - mbfl_buffer_converter_feed(MBSTRG(outconv), &string); - if (last_feed) { - mbfl_buffer_converter_flush(MBSTRG(outconv)); - } - /* get the converter output, and return it */ - mbfl_buffer_converter_result(MBSTRG(outconv), &result); - RETVAL_STRINGL((char *)result.val, result.len, 0); /* the string is already strdup()'ed */ - - /* delete the converter if it is the last feed. */ - if (last_feed) { - mbfl_buffer_converter_delete(MBSTRG(outconv)); - MBSTRG(outconv) = NULL; - } -} -/* }}} */ - -/* {{{ proto int mb_strlen(string str [, string encoding]) - Get character numbers of a string */ -PHP_FUNCTION(mb_strlen) -{ - int n; - mbfl_string string; - char *enc_name = NULL; - int enc_name_len; - - mbfl_string_init(&string); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) { - RETURN_FALSE; - } - - string.no_language = MBSTRG(current_language); - if (enc_name == NULL) { - string.no_encoding = MBSTRG(current_internal_encoding); - } else { - string.no_encoding = mbfl_name2no_encoding(enc_name); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name); - RETURN_FALSE; - } - } - - n = mbfl_strlen(&string); - if (n >= 0) { - RETVAL_LONG(n); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mb_strpos(string haystack, string needle [, int offset [, string encoding]]) - Find position of first occurrence of a string within another */ -PHP_FUNCTION(mb_strpos) -{ - int n, reverse = 0; - long offset; - mbfl_string haystack, needle; - char *enc_name = NULL; - int enc_name_len; - - mbfl_string_init(&haystack); - mbfl_string_init(&needle); - haystack.no_language = MBSTRG(current_language); - haystack.no_encoding = MBSTRG(current_internal_encoding); - needle.no_language = MBSTRG(current_language); - needle.no_encoding = MBSTRG(current_internal_encoding); - offset = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) { - RETURN_FALSE; - } - - if (enc_name != NULL) { - haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name); - if (haystack.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name); - RETURN_FALSE; - } - } - - if (offset < 0 || (unsigned long)offset > haystack.len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is out of range"); - RETURN_FALSE; - } - if (needle.len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); - RETURN_FALSE; - } - - n = mbfl_strpos(&haystack, &needle, offset, reverse); - if (n >= 0) { - RETVAL_LONG(n); - } else { - switch (-n) { - case 1: - break; - case 2: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Needle has not positive length."); - break; - case 4: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding or conversion error."); - break; - case 8: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is empty."); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in mb_strpos."); - break; - } - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mb_strrpos(string haystack, string needle [, string encoding]) - Find the last occurrence of a character in a string within another */ -PHP_FUNCTION(mb_strrpos) -{ - int n; - mbfl_string haystack, needle; - char *enc_name = NULL; - int enc_name_len; - - mbfl_string_init(&haystack); - mbfl_string_init(&needle); - haystack.no_language = MBSTRG(current_language); - haystack.no_encoding = MBSTRG(current_internal_encoding); - needle.no_language = MBSTRG(current_language); - needle.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) { - RETURN_FALSE; - } - - if (enc_name != NULL) { - haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name); - if (haystack.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name); - RETURN_FALSE; - } - } - - if (haystack.len <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty haystack"); - RETURN_FALSE; - } - if (needle.len <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty needle"); - RETURN_FALSE; - } - n = mbfl_strpos(&haystack, &needle, 0, 1); - if (n >= 0) { - RETVAL_LONG(n); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mb_substr_count(string haystack, string needle [, string encoding]) - Count the number of substring occurrences */ -PHP_FUNCTION(mb_substr_count) -{ - int n; - mbfl_string haystack, needle; - char *enc_name = NULL; - int enc_name_len; - - mbfl_string_init(&haystack); - mbfl_string_init(&needle); - haystack.no_language = MBSTRG(current_language); - haystack.no_encoding = MBSTRG(current_internal_encoding); - needle.no_language = MBSTRG(current_language); - needle.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) { - return; - } - - if (enc_name != NULL) { - haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name); - if (haystack.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name); - RETURN_FALSE; - } - } - - if (needle.len <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty needle"); - RETURN_FALSE; - } - - n = mbfl_substr_count(&haystack, &needle); - if (n >= 0) { - RETVAL_LONG(n); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mb_substr(string str, int start [, int length [, string encoding]]) - Returns part of a string */ -PHP_FUNCTION(mb_substr) -{ - zval **arg1, **arg2, **arg3, **arg4; - int argc, from, len, mblen; - mbfl_string string, result, *ret; - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - argc = ZEND_NUM_ARGS(); - switch (argc) { - case 2: - if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 4: - if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg4); - string.no_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(arg4)); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(arg4)); - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - string.val = (unsigned char *)Z_STRVAL_PP(arg1); - string.len = Z_STRLEN_PP(arg1); - - convert_to_long_ex(arg2); - from = Z_LVAL_PP(arg2); - if (argc >= 3) { - convert_to_long_ex(arg3); - len = Z_LVAL_PP(arg3); - } else { - len = Z_STRLEN_PP(arg1); - } - - /* measures length */ - mblen = 0; - if (from < 0 || len < 0) { - mblen = mbfl_strlen(&string); - } - - /* if "from" position is negative, count start position from the end - * of the string - */ - if (from < 0) { - from = mblen + from; - if (from < 0) { - from = 0; - } - } - - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ - if (len < 0) { - len = (mblen - from) + len; - if (len < 0) { - len = 0; - } - } - - ret = mbfl_substr(&string, &result, from, len); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0); /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mb_strcut(string str, int start [, int length [, string encoding]]) - Returns part of a string */ -PHP_FUNCTION(mb_strcut) -{ - pval **arg1, **arg2, **arg3, **arg4; - int argc, from, len; - mbfl_string string, result, *ret; - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - argc = ZEND_NUM_ARGS(); - switch (argc) { - case 2: - if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 4: - if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg4); - string.no_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(arg4)); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(arg4)); - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - string.val = Z_STRVAL_PP(arg1); - string.len = Z_STRLEN_PP(arg1); - - convert_to_long_ex(arg2); - from = Z_LVAL_PP(arg2); - if (argc >= 3) { - convert_to_long_ex(arg3); - len = Z_LVAL_PP(arg3); - } else { - len = Z_STRLEN_PP(arg1); - } - - /* if "from" position is negative, count start position from the end - * of the string - */ - if (from < 0) { - from = Z_STRLEN_PP(arg1) + from; - if (from < 0) { - from = 0; - } - } - - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ - if (len < 0) { - len = (Z_STRLEN_PP(arg1) - from) + len; - if (len < 0) { - len = 0; - } - } - - ret = mbfl_strcut(&string, &result, from, len); - if (ret != NULL) { - RETVAL_STRINGL(ret->val, ret->len, 0); /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mb_strwidth(string str [, string encoding]) - Gets terminal width of a string */ -PHP_FUNCTION(mb_strwidth) -{ - int n; - mbfl_string string; - char *enc_name = NULL; - int enc_name_len; - - mbfl_string_init(&string); - - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) { - return; - } - - if (enc_name != NULL) { - string.no_encoding = mbfl_name2no_encoding(enc_name); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name); - RETURN_FALSE; - } - } - - n = mbfl_strwidth(&string); - if (n >= 0) { - RETVAL_LONG(n); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mb_strimwidth(string str, int start, int width [, string trimmarker [, string encoding]]) - Trim the string in terminal width */ -PHP_FUNCTION(mb_strimwidth) -{ - pval **arg1, **arg2, **arg3, **arg4, **arg5; - int from, width; - mbfl_string string, result, marker, *ret; - - mbfl_string_init(&string); - mbfl_string_init(&marker); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - marker.no_language = MBSTRG(current_language); - marker.no_encoding = MBSTRG(current_internal_encoding); - marker.val = NULL; - marker.len = 0; - - switch (ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 4: - if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 5: - if (zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg5); - string.no_encoding = marker.no_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(arg5)); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(arg5)); - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - string.val = (unsigned char *)Z_STRVAL_PP(arg1); - string.len = Z_STRLEN_PP(arg1); - - convert_to_long_ex(arg2); - from = Z_LVAL_PP(arg2); - if (from < 0 || from > Z_STRLEN_PP(arg1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of reange"); - RETURN_FALSE; - } - - convert_to_long_ex(arg3); - width = Z_LVAL_PP(arg3); - - if (width < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width is negative value"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() >= 4) { - convert_to_string_ex(arg4); - marker.val = (unsigned char *)Z_STRVAL_PP(arg4); - marker.len = Z_STRLEN_PP(arg4); - } - - ret = mbfl_strimwidth(&string, &marker, &result, from, width); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0); /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ MBSTRING_API char *php_mb_convert_encoding() */ -MBSTRING_API char * php_mb_convert_encoding(char *input, size_t length, char *_to_encoding, char *_from_encodings, size_t *output_len TSRMLS_DC) -{ - mbfl_string string, result, *ret; - enum mbfl_no_encoding from_encoding, to_encoding; - mbfl_buffer_converter *convd; - int size, *list; - char *output=NULL; - - if (output_len) { - *output_len = 0; - } - if (!input) { - return NULL; - } - /* new encoding */ - if (_to_encoding && strlen(_to_encoding)) { - to_encoding = mbfl_name2no_encoding(_to_encoding); - if (to_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", _to_encoding); - return NULL; - } - } else { - to_encoding = MBSTRG(current_internal_encoding); - } - - /* initialize string */ - mbfl_string_init(&string); - mbfl_string_init(&result); - from_encoding = MBSTRG(current_internal_encoding); - string.no_encoding = from_encoding; - string.no_language = MBSTRG(current_language); - string.val = (unsigned char *)input; - string.len = length; - - /* pre-conversion encoding */ - if (_from_encodings) { - list = NULL; - size = 0; - php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0 TSRMLS_CC); - if (size == 1) { - from_encoding = *list; - string.no_encoding = from_encoding; - } else if (size > 1) { - /* auto detect */ - from_encoding = mbfl_identify_encoding_no(&string, list, size); - if (from_encoding != mbfl_no_encoding_invalid) { - string.no_encoding = from_encoding; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect character encoding"); - from_encoding = mbfl_no_encoding_pass; - to_encoding = from_encoding; - string.no_encoding = from_encoding; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal character encoding specified"); - } - if (list != NULL) { - efree((void *)list); - } - } - - /* initialize converter */ - convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len); - if (convd == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create character encoding converter"); - return NULL; - } - mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode)); - mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar)); - - /* do it */ - ret = mbfl_buffer_converter_feed_result(convd, &string, &result); - if (ret) { - if (output_len) { - *output_len = ret->len; - } - output = (char *)ret->val; - } - - mbfl_buffer_converter_delete(convd); - return output; -} -/* }}} */ - -/* {{{ proto string mb_convert_encoding(string str, string to-encoding [, mixed from-encoding]) - Returns converted string in desired encoding */ -PHP_FUNCTION(mb_convert_encoding) -{ - pval **arg_str, **arg_new, **arg_old; - int i; - size_t size, l, n; - char *_from_encodings, *ret, *s_free = NULL; - - zval **hash_entry; - HashTable *target_hash; - - _from_encodings = NULL; - if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &arg_str, &arg_new) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &arg_str, &arg_new, &arg_old) == FAILURE) { - WRONG_PARAM_COUNT; - } - switch (Z_TYPE_PP(arg_old)) { - case IS_ARRAY: - - target_hash = Z_ARRVAL_PP(arg_old); - zend_hash_internal_pointer_reset(target_hash); - i = zend_hash_num_elements(target_hash); - _from_encodings = NULL; - while (i > 0) { - if (zend_hash_get_current_data(target_hash, (void **) &hash_entry) == FAILURE) { - break; - } - convert_to_string_ex(hash_entry); - if ( _from_encodings) { - l = strlen(_from_encodings); - n = strlen(Z_STRVAL_PP(hash_entry)); - _from_encodings = erealloc(_from_encodings, l+n+2); - strcpy(_from_encodings+l,","); - strcpy(_from_encodings+l+1,Z_STRVAL_PP(hash_entry)); - } else { - _from_encodings = estrdup(Z_STRVAL_PP(hash_entry)); - } - zend_hash_move_forward(target_hash); - i--; - } - if (_from_encodings != NULL && !strlen(_from_encodings)) { - efree(_from_encodings); - _from_encodings = NULL; - } - s_free = _from_encodings; - break; - default: - convert_to_string_ex(arg_old); - _from_encodings = Z_STRVAL_PP(arg_old); - break; - } - } else { - WRONG_PARAM_COUNT; - } - - /* new encoding */ - convert_to_string_ex(arg_str); - convert_to_string_ex(arg_new); - ret = php_mb_convert_encoding( Z_STRVAL_PP(arg_str), Z_STRLEN_PP(arg_str), Z_STRVAL_PP(arg_new), _from_encodings, &size TSRMLS_CC); - if (ret != NULL) { - RETVAL_STRINGL(ret, size, 0); /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } - if ( s_free) { - efree(s_free); - } -} -/* }}} */ - -/* {{{ proto string mb_convert_case(string sourcestring, int mode [, string encoding]) - Returns a case-folded version of sourcestring */ -PHP_FUNCTION(mb_convert_case) -{ - char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - int str_len, from_encoding_len; - long case_mode = 0; - char *newstr; - size_t ret_len; - - RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|s!", &str, &str_len, - &case_mode, &from_encoding, &from_encoding_len) == FAILURE) - RETURN_FALSE; - - newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC); - - if (newstr) { - RETVAL_STRINGL(newstr, ret_len, 0); - } -} -/* }}} */ - -/* {{{ proto string mb_strtoupper(string sourcestring [, string encoding]) - * Returns a uppercased version of sourcestring - */ -PHP_FUNCTION(mb_strtoupper) -{ - char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - int str_len, from_encoding_len; - char *newstr; - size_t ret_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len, - &from_encoding, &from_encoding_len) == FAILURE) { - return; - } - newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC); - - if (newstr) { - RETURN_STRINGL(newstr, ret_len, 0); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string mb_strtolower(string sourcestring [, string encoding]) - * Returns a lowercased version of sourcestring - */ -PHP_FUNCTION(mb_strtolower) -{ - char *str, *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding)); - int str_len, from_encoding_len; - char *newstr; - size_t ret_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len, - &from_encoding, &from_encoding_len) == FAILURE) { - return; - } - newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC); - - if (newstr) { - RETURN_STRINGL(newstr, ret_len, 0); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string mb_detect_encoding(string str [, mixed encoding_list [, bool strict]]) - Encodings of the given string is returned (as a string) */ -PHP_FUNCTION(mb_detect_encoding) -{ - pval **arg_str, **arg_list, **arg_strict; - mbfl_string string; - const char *ret; - enum mbfl_no_encoding *elist; - int size, *list, strict = 0; - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &arg_str) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &arg_str, &arg_list) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &arg_str, &arg_list, &arg_strict) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else { - WRONG_PARAM_COUNT; - } - - /* make encoding list */ - list = NULL; - size = 0; - if (ZEND_NUM_ARGS() >= 2 && Z_STRVAL_PP(arg_list)) { - switch (Z_TYPE_PP(arg_list)) { - case IS_ARRAY: - if (!php_mb_parse_encoding_array(*arg_list, &list, &size, 0 TSRMLS_CC)) { - if (list) { - efree(list); - size = 0; - } - } - break; - default: - convert_to_string_ex(arg_list); - if (!php_mb_parse_encoding_list(Z_STRVAL_PP(arg_list), Z_STRLEN_PP(arg_list), &list, &size, 0 TSRMLS_CC)) { - if (list) { - efree(list); - size = 0; - } - } - break; - } - if (size <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal argument"); - } - } - - if (ZEND_NUM_ARGS() == 3) { - convert_to_long_ex(arg_strict); - strict = Z_LVAL_PP(arg_strict); - } - - if (size > 0 && list != NULL) { - elist = list; - } else { - elist = MBSTRG(current_detect_order_list); - size = MBSTRG(current_detect_order_list_size); - } - - convert_to_string_ex(arg_str); - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.val = (unsigned char *)Z_STRVAL_PP(arg_str); - string.len = Z_STRLEN_PP(arg_str); - ret = mbfl_identify_encoding_name(&string, elist, size, strict); - if (list != NULL) { - efree((void *)list); - } - if (ret != NULL) { - RETVAL_STRING((char *)ret, 1); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto array mb_list_encodings() - Returns an array of all supported encodings */ -PHP_FUNCTION(mb_list_encodings) -{ - const mbfl_encoding **encodings; - const mbfl_encoding *encoding; - int i; - - array_init(return_value); - i = 0; - encodings = mbfl_get_supported_encodings(); - while ((encoding = encodings[i++]) != NULL) { - add_next_index_string(return_value, (char *) encoding->name, 1); - } -} -/* }}} */ - -/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed]]]) - Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */ -PHP_FUNCTION(mb_encode_mimeheader) -{ - enum mbfl_no_encoding charset, transenc; - mbfl_string string, result, *ret; - char *charset_name = NULL; - int charset_name_len; - char *trans_enc_name = NULL; - int trans_enc_name_len; - char *linefeed = "\r\n"; - int linefeed_len; - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len) == FAILURE) { - return; - } - - charset = mbfl_no_encoding_pass; - transenc = mbfl_no_encoding_base64; - - if (charset_name != NULL) { - charset = mbfl_name2no_encoding(charset_name); - if (charset == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", charset_name); - RETURN_FALSE; - } - } else { - const mbfl_language *lang = mbfl_no2language(MBSTRG(current_language)); - if (lang != NULL) { - charset = lang->mail_charset; - transenc = lang->mail_header_encoding; - } - } - - if (trans_enc_name != NULL) { - if (*trans_enc_name == 'B' || *trans_enc_name == 'b') { - transenc = mbfl_no_encoding_base64; - } else if (*trans_enc_name == 'Q' || *trans_enc_name == 'q') { - transenc = mbfl_no_encoding_qprint; - } - } - - mbfl_string_init(&result); - ret = mbfl_mime_header_encode(&string, &result, charset, transenc, linefeed, 0); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0) /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mb_decode_mimeheader(string string) - Decodes the MIME "encoded-word" in the string */ -PHP_FUNCTION(mb_decode_mimeheader) -{ - mbfl_string string, result, *ret; - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string.val, &string.len) == FAILURE) { - return; - } - - mbfl_string_init(&result); - ret = mbfl_mime_header_decode(&string, &result, MBSTRG(current_internal_encoding)); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0) /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mb_convert_kana(string str [, string option] [, string encoding]) - Conversion between full-width character and half-width character (Japanese) */ -PHP_FUNCTION(mb_convert_kana) -{ - int opt, i; - mbfl_string string, result, *ret; - char *optstr = NULL; - int optstr_len; - char *encname = NULL; - int encname_len; - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) { - return; - } - - /* option */ - if (optstr != NULL) { - char *p = optstr; - int n = optstr_len; - i = 0; - opt = 0; - while (i < n) { - i++; - switch (*p++) { - case 'A': - opt |= 0x1; - break; - case 'a': - opt |= 0x10; - break; - case 'R': - opt |= 0x2; - break; - case 'r': - opt |= 0x20; - break; - case 'N': - opt |= 0x4; - break; - case 'n': - opt |= 0x40; - break; - case 'S': - opt |= 0x8; - break; - case 's': - opt |= 0x80; - break; - case 'K': - opt |= 0x100; - break; - case 'k': - opt |= 0x1000; - break; - case 'H': - opt |= 0x200; - break; - case 'h': - opt |= 0x2000; - break; - case 'V': - opt |= 0x800; - break; - case 'C': - opt |= 0x10000; - break; - case 'c': - opt |= 0x20000; - break; - case 'M': - opt |= 0x100000; - break; - case 'm': - opt |= 0x200000; - break; - } - } - } else { - opt = 0x900; - } - - /* encoding */ - if (encname != NULL) { - string.no_encoding = mbfl_name2no_encoding(encname); - if (string.no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encname); - RETURN_FALSE; - } - } - - ret = mbfl_ja_jp_hantozen(&string, &result, opt); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0); /* the string is already strdup()'ed */ - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -#define PHP_MBSTR_STACK_BLOCK_SIZE 32 - -/* {{{ proto string mb_convert_variables(string to-encoding, mixed from-encoding [, mixed ...]) - Converts the string resource in variables to desired encoding */ -PHP_FUNCTION(mb_convert_variables) -{ - pval ***args, ***stack, **var, **hash_entry; - HashTable *target_hash; - mbfl_string string, result, *ret; - enum mbfl_no_encoding from_encoding, to_encoding; - mbfl_encoding_detector *identd; - mbfl_buffer_converter *convd; - int n, argc, stack_level, stack_max, elistsz; - enum mbfl_no_encoding *elist; - char *name; - void *ptmp; - - argc = ZEND_NUM_ARGS(); - if (argc < 3) { - WRONG_PARAM_COUNT; - } - args = (pval ***)ecalloc(argc, sizeof(pval **)); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree((void *)args); - WRONG_PARAM_COUNT; - } - - /* new encoding */ - convert_to_string_ex(args[0]); - to_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(args[0])); - if (to_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(args[0])); - efree((void *)args); - RETURN_FALSE; - } - - /* initialize string */ - mbfl_string_init(&string); - mbfl_string_init(&result); - from_encoding = MBSTRG(current_internal_encoding); - string.no_encoding = from_encoding; - string.no_language = MBSTRG(current_language); - - /* pre-conversion encoding */ - elist = NULL; - elistsz = 0; - switch (Z_TYPE_PP(args[1])) { - case IS_ARRAY: - php_mb_parse_encoding_array(*args[1], &elist, &elistsz, 0 TSRMLS_CC); - break; - default: - convert_to_string_ex(args[1]); - php_mb_parse_encoding_list(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]), &elist, &elistsz, 0 TSRMLS_CC); - break; - } - if (elistsz <= 0) { - from_encoding = mbfl_no_encoding_pass; - } else if (elistsz == 1) { - from_encoding = *elist; - } else { - /* auto detect */ - from_encoding = mbfl_no_encoding_invalid; - stack_max = PHP_MBSTR_STACK_BLOCK_SIZE; - stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0); - stack_level = 0; - identd = mbfl_encoding_detector_new(elist, elistsz); - if (identd != NULL) { - n = 2; - while (n < argc || stack_level > 0) { - if (stack_level <= 0) { - var = args[n++]; - if (Z_TYPE_PP(var) == IS_ARRAY || Z_TYPE_PP(var) == IS_OBJECT) { - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - zend_hash_internal_pointer_reset(target_hash); - } - } - } else { - stack_level--; - var = stack[stack_level]; - } - if (Z_TYPE_PP(var) == IS_ARRAY || Z_TYPE_PP(var) == IS_OBJECT) { - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - while (zend_hash_get_current_data(target_hash, (void **) &hash_entry) != FAILURE) { - zend_hash_move_forward(target_hash); - if (Z_TYPE_PP(hash_entry) == IS_ARRAY || Z_TYPE_PP(hash_entry) == IS_OBJECT) { - if (stack_level >= stack_max) { - stack_max += PHP_MBSTR_STACK_BLOCK_SIZE; - ptmp = erealloc(stack, sizeof(pval **)*stack_max); - stack = (pval ***)ptmp; - } - stack[stack_level] = var; - stack_level++; - var = hash_entry; - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - zend_hash_internal_pointer_reset(target_hash); - continue; - } - } else if (Z_TYPE_PP(hash_entry) == IS_STRING) { - string.val = (unsigned char *)Z_STRVAL_PP(hash_entry); - string.len = Z_STRLEN_PP(hash_entry); - if (mbfl_encoding_detector_feed(identd, &string)) { - goto detect_end; /* complete detecting */ - } - } - } - } - } else if (Z_TYPE_PP(var) == IS_STRING) { - string.val = (unsigned char *)Z_STRVAL_PP(var); - string.len = Z_STRLEN_PP(var); - if (mbfl_encoding_detector_feed(identd, &string)) { - goto detect_end; /* complete detecting */ - } - } - } -detect_end: - from_encoding = mbfl_encoding_detector_judge(identd); - mbfl_encoding_detector_delete(identd); - } - efree(stack); - - if (from_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding"); - from_encoding = mbfl_no_encoding_pass; - } - } - if (elist != NULL) { - efree((void *)elist); - } - /* create converter */ - convd = NULL; - if (from_encoding != mbfl_no_encoding_pass) { - convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0); - if (convd == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter"); - RETURN_FALSE; - } - mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode)); - mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar)); - } - - /* convert */ - if (convd != NULL) { - stack_max = PHP_MBSTR_STACK_BLOCK_SIZE; - stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0); - stack_level = 0; - n = 2; - while (n < argc || stack_level > 0) { - if (stack_level <= 0) { - var = args[n++]; - if (Z_TYPE_PP(var) == IS_ARRAY || Z_TYPE_PP(var) == IS_OBJECT) { - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - zend_hash_internal_pointer_reset(target_hash); - } - } - } else { - stack_level--; - var = stack[stack_level]; - } - if (Z_TYPE_PP(var) == IS_ARRAY || Z_TYPE_PP(var) == IS_OBJECT) { - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - while (zend_hash_get_current_data(target_hash, (void **) &hash_entry) != FAILURE) { - zend_hash_move_forward(target_hash); - if (Z_TYPE_PP(hash_entry) == IS_ARRAY || Z_TYPE_PP(hash_entry) == IS_OBJECT) { - if (stack_level >= stack_max) { - stack_max += PHP_MBSTR_STACK_BLOCK_SIZE; - ptmp = erealloc(stack, sizeof(pval **)*stack_max); - stack = (pval ***)ptmp; - } - stack[stack_level] = var; - stack_level++; - var = hash_entry; - SEPARATE_ZVAL(hash_entry); - target_hash = HASH_OF(*var); - if (target_hash != NULL) { - zend_hash_internal_pointer_reset(target_hash); - continue; - } - } else if (Z_TYPE_PP(hash_entry) == IS_STRING) { - string.val = (unsigned char *)Z_STRVAL_PP(hash_entry); - string.len = Z_STRLEN_PP(hash_entry); - ret = mbfl_buffer_converter_feed_result(convd, &string, &result); - if (ret != NULL) { - if ((*hash_entry)->refcount > 1) { - ZVAL_DELREF(*hash_entry); - MAKE_STD_ZVAL(*hash_entry); - } else { - zval_dtor(*hash_entry); - } - ZVAL_STRINGL(*hash_entry, ret->val, ret->len, 0); - } - } - } - } - } else if (Z_TYPE_PP(var) == IS_STRING) { - string.val = (unsigned char *)Z_STRVAL_PP(var); - string.len = Z_STRLEN_PP(var); - ret = mbfl_buffer_converter_feed_result(convd, &string, &result); - if (ret != NULL) { - zval_dtor(*var); - ZVAL_STRINGL(*var, ret->val, ret->len, 0); - } - } - } - efree(stack); - - mbfl_buffer_converter_delete(convd); - } - - efree((void *)args); - - name = (char *)mbfl_no_encoding2name(from_encoding); - if (name != NULL) { - RETURN_STRING(name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ HTML numeric entity */ -/* {{{ static void php_mb_numericentity_exec() */ -static void -php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - pval **arg1, **arg2, **arg3, **hash_entry; - HashTable *target_hash; - int argc, i, *convmap, *mapelm, mapsize=0; - mbfl_string string, result, *ret; - enum mbfl_no_encoding no_encoding; - - argc = ZEND_NUM_ARGS(); - if ((argc == 2 && zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) || - (argc == 3 && zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) || - argc < 2 || argc > 3) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.no_encoding = MBSTRG(current_internal_encoding); - string.val = (unsigned char *)Z_STRVAL_PP(arg1); - string.len = Z_STRLEN_PP(arg1); - - /* encoding */ - if (argc == 3) { - convert_to_string_ex(arg3); - no_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(arg3)); - if (no_encoding == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(arg3)); - RETURN_FALSE; - } else { - string.no_encoding = no_encoding; - } - } - - /* conversion map */ - convmap = NULL; - if (Z_TYPE_PP(arg2) == IS_ARRAY){ - target_hash = Z_ARRVAL_PP(arg2); - zend_hash_internal_pointer_reset(target_hash); - i = zend_hash_num_elements(target_hash); - if (i > 0) { - convmap = (int *)safe_emalloc(i, sizeof(int), 0); - mapelm = convmap; - mapsize = 0; - while (i > 0) { - if (zend_hash_get_current_data(target_hash, (void **) &hash_entry) == FAILURE) { - break; - } - convert_to_long_ex(hash_entry); - *mapelm++ = Z_LVAL_PP(hash_entry); - mapsize++; - i--; - zend_hash_move_forward(target_hash); - } - } - } - if (convmap == NULL) { - RETURN_FALSE; - } - mapsize /= 4; - - ret = mbfl_html_numeric_entity(&string, &result, convmap, mapsize, type); - if (ret != NULL) { - RETVAL_STRINGL((char *)ret->val, ret->len, 0); - } else { - RETVAL_FALSE; - } - efree((void *)convmap); -} -/* }}} */ - -/* {{{ proto string mb_encode_numericentity(string string, array convmap [, string encoding]) - Converts specified characters to HTML numeric entities */ -PHP_FUNCTION(mb_encode_numericentity) -{ - php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string mb_decode_numericentity(string string, array convmap [, string encoding]) - Converts HTML numeric entities to character code */ -PHP_FUNCTION(mb_decode_numericentity) -{ - php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ -/* }}} */ - -/* {{{ proto int mb_send_mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) - * Sends an email message with MIME scheme - */ -#if HAVE_SENDMAIL - -#define APPEND_ONE_CHAR(ch) do { \ - if (token.a > 0) { \ - smart_str_appendc(&token, ch); \ - } else {\ - token.len++; \ - } \ -} while (0) - -#define SEPARATE_SMART_STR(str) do {\ - if ((str)->a == 0) { \ - char *tmp_ptr; \ - (str)->a = 1; \ - while ((str)->a < (str)->len) { \ - (str)->a <<= 1; \ - } \ - tmp_ptr = emalloc((str)->a + 1); \ - memcpy(tmp_ptr, (str)->c, (str)->len); \ - (str)->c = tmp_ptr; \ - } \ -} while (0) - -static void my_smart_str_dtor(smart_str *s) -{ - if (s->a > 0) { - smart_str_free(s); - } -} - -static int _php_mbstr_parse_mail_headers(HashTable *ht, const char *str, size_t str_len) -{ - const char *ps; - size_t icnt; - int state = 0; - int crlf_state = -1; - - smart_str token = { 0, 0, 0 }; - smart_str fld_name = { 0, 0, 0 }, fld_val = { 0, 0, 0 }; - - ps = str; - icnt = str_len; - - /* - * C o n t e n t - T y p e : t e x t / h t m l \r\n - * ^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^ ^^^^ - * state 0 1 2 3 - * - * C o n t e n t - T y p e : t e x t / h t m l \r\n - * ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ - * crlf_state -1 0 1 -1 - * - */ - - while (icnt > 0) { - switch (*ps) { - case ':': - if (crlf_state == 1) { - APPEND_ONE_CHAR('\r'); - } - - if (state == 0 || state == 1) { - fld_name = token; - - state = 2; - } else { - APPEND_ONE_CHAR(*ps); - } - - crlf_state = 0; - break; - - case '\n': - if (crlf_state == -1) { - goto out; - } - crlf_state = -1; - break; - - case '\r': - if (crlf_state == 1) { - APPEND_ONE_CHAR('\r'); - } else { - crlf_state = 1; - } - break; - - case ' ': case '\t': - if (crlf_state == -1) { - if (state == 3) { - /* continuing from the previous line */ - SEPARATE_SMART_STR(&token); - state = 4; - } else { - /* simply skipping this new line */ - state = 5; - } - } else { - if (crlf_state == 1) { - APPEND_ONE_CHAR('\r'); - } - if (state == 1 || state == 3) { - APPEND_ONE_CHAR(*ps); - } - } - crlf_state = 0; - break; - - default: - switch (state) { - case 0: - token.c = (char *)ps; - token.len = 0; - token.a = 0; - state = 1; - break; - - case 2: - if (crlf_state != -1) { - token.c = (char *)ps; - token.len = 0; - token.a = 0; - - state = 3; - break; - } - /* break is missing intentionally */ - - case 3: - if (crlf_state == -1) { - fld_val = token; - - if (fld_name.c != NULL && fld_val.c != NULL) { - char *dummy; - - /* FIXME: some locale free implementation is - * really required here,,, */ - SEPARATE_SMART_STR(&fld_name); - php_strtoupper(fld_name.c, fld_name.len); - - zend_hash_update(ht, (char *)fld_name.c, fld_name.len, &fld_val, sizeof(smart_str), (void **)&dummy); - - my_smart_str_dtor(&fld_name); - } - - memset(&fld_name, 0, sizeof(smart_str)); - memset(&fld_val, 0, sizeof(smart_str)); - - token.c = (char *)ps; - token.len = 0; - token.a = 0; - - state = 1; - } - break; - - case 4: - APPEND_ONE_CHAR(' '); - state = 3; - break; - } - - if (crlf_state == 1) { - APPEND_ONE_CHAR('\r'); - } - - APPEND_ONE_CHAR(*ps); - - crlf_state = 0; - break; - } - ps++, icnt--; - } -out: - if (state == 2) { - token.c = ""; - token.len = 0; - token.a = 0; - - state = 3; - } - if (state == 3) { - fld_val = token; - - if (fld_name.c != NULL && fld_val.c != NULL) { - void *dummy; - - /* FIXME: some locale free implementation is - * really required here,,, */ - SEPARATE_SMART_STR(&fld_name); - php_strtoupper(fld_name.c, fld_name.len); - - zend_hash_update(ht, (char *)fld_name.c, fld_name.len, &fld_val, sizeof(smart_str), (void **)&dummy); - - my_smart_str_dtor(&fld_name); - } - } - return state; -} - -PHP_FUNCTION(mb_send_mail) -{ - int n; - char *to=NULL; - int to_len; - char *message=NULL; - int message_len; - char *headers=NULL; - int headers_len; - char *subject=NULL; - int subject_len; - char *extra_cmd=NULL; - int extra_cmd_len; - char *force_extra_parameters = INI_STR("mail.force_extra_parameters"); - struct { - int cnt_type:1; - int cnt_trans_enc:1; - } suppressed_hdrs = { 0, 0 }; - - char *message_buf=NULL, *subject_buf=NULL, *p; - mbfl_string orig_str, conv_str; - mbfl_string *pstr; /* pointer to mbfl string for return value */ - enum mbfl_no_encoding - tran_cs, /* transfar text charset */ - head_enc, /* header transfar encoding */ - body_enc; /* body transfar encoding */ - mbfl_memory_device device; /* automatic allocateable buffer for additional header */ - const mbfl_language *lang; - int err = 0; - HashTable ht_headers; - smart_str *s; - extern void mbfl_memory_device_unput(mbfl_memory_device *device); - - /* initialize */ - mbfl_memory_device_init(&device, 0, 0); - mbfl_string_init(&orig_str); - mbfl_string_init(&conv_str); - - /* character-set, transfer-encoding */ - tran_cs = mbfl_no_encoding_utf8; - head_enc = mbfl_no_encoding_base64; - body_enc = mbfl_no_encoding_base64; - lang = mbfl_no2language(MBSTRG(current_language)); - if (lang != NULL) { - tran_cs = lang->mail_charset; - head_enc = lang->mail_header_encoding; - body_enc = lang->mail_body_encoding; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd, &extra_cmd_len) == FAILURE) { - return; - } - - zend_hash_init(&ht_headers, 0, NULL, (dtor_func_t) my_smart_str_dtor, 0); - - if (headers != NULL) { - _php_mbstr_parse_mail_headers(&ht_headers, headers, headers_len); - } - - if (zend_hash_find(&ht_headers, "CONTENT-TYPE", sizeof("CONTENT-TYPE") - 1, (void **)&s) == SUCCESS) { - char *tmp; - char *param_name; - char *charset = NULL; - - SEPARATE_SMART_STR(s); - smart_str_0(s); - - p = strchr(s->c, ';'); - - if (p != NULL) { - /* skipping the padded spaces */ - do { - ++p; - } while (*p == ' ' || *p == '\t'); - - if (*p != '\0') { - if ((param_name = php_strtok_r(p, "= ", &tmp)) != NULL) { - if (strcasecmp(param_name, "charset") == 0) { - enum mbfl_no_encoding _tran_cs = tran_cs; - - charset = php_strtok_r(NULL, "= ", &tmp); - if (charset != NULL) { - _tran_cs = mbfl_name2no_encoding(charset); - } - - if (_tran_cs == mbfl_no_encoding_invalid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset); - _tran_cs = mbfl_no_encoding_ascii; - } - tran_cs = _tran_cs; - } - } - } - } - suppressed_hdrs.cnt_type = 1; - } - - if (zend_hash_find(&ht_headers, "CONTENT-TRANSFER-ENCODING", sizeof("CONTENT-TRANSFER-ENCODING") - 1, (void **)&s) == SUCCESS) { - enum mbfl_no_encoding _body_enc; - SEPARATE_SMART_STR(s); - smart_str_0(s); - - _body_enc = mbfl_name2no_encoding(s->c); - switch (_body_enc) { - case mbfl_no_encoding_base64: - case mbfl_no_encoding_7bit: - case mbfl_no_encoding_8bit: - body_enc = _body_enc; - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", s->c); - body_enc = mbfl_no_encoding_8bit; - break; - } - suppressed_hdrs.cnt_trans_enc = 1; - } - - /* To: */ - if (to == NULL || to_len <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing To: field"); - err = 1; - } - - /* Subject: */ - if (subject != NULL && subject_len >= 0) { - orig_str.no_language = MBSTRG(current_language); - orig_str.val = (unsigned char *)subject; - orig_str.len = subject_len; - orig_str.no_encoding = MBSTRG(current_internal_encoding); - if (orig_str.no_encoding == mbfl_no_encoding_invalid - || orig_str.no_encoding == mbfl_no_encoding_pass) { - orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size)); - } - pstr = mbfl_mime_header_encode(&orig_str, &conv_str, tran_cs, head_enc, "\n", sizeof("Subject: [PHP-jp nnnnnnnn]")); - if (pstr != NULL) { - subject_buf = subject = (char *)pstr->val; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing Subject: field"); - err = 1; - } - - /* message body */ - if (message != NULL) { - orig_str.no_language = MBSTRG(current_language); - orig_str.val = message; - orig_str.len = message_len; - orig_str.no_encoding = MBSTRG(current_internal_encoding); - - if (orig_str.no_encoding == mbfl_no_encoding_invalid - || orig_str.no_encoding == mbfl_no_encoding_pass) { - orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size)); - } - - pstr = NULL; - { - mbfl_string tmpstr; - - if (mbfl_convert_encoding(&orig_str, &tmpstr, tran_cs) != NULL) { - tmpstr.no_encoding=mbfl_no_encoding_8bit; - pstr = mbfl_convert_encoding(&tmpstr, &conv_str, body_enc); - efree(tmpstr.val); - } - } - if (pstr != NULL) { - message_buf = message = (char *)pstr->val; - } - } else { - /* this is not really an error, so it is allowed. */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty message body"); - message = NULL; - } - - /* other headers */ -#define PHP_MBSTR_MAIL_MIME_HEADER1 "Mime-Version: 1.0" -#define PHP_MBSTR_MAIL_MIME_HEADER2 "Content-Type: text/plain" -#define PHP_MBSTR_MAIL_MIME_HEADER3 "; charset=" -#define PHP_MBSTR_MAIL_MIME_HEADER4 "Content-Transfer-Encoding: " - if (headers != NULL) { - p = headers; - n = headers_len; - mbfl_memory_device_strncat(&device, p, n); - if (n > 0 && p[n - 1] != '\n') { - mbfl_memory_device_strncat(&device, "\n", 1); - } - } - - mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER1, sizeof(PHP_MBSTR_MAIL_MIME_HEADER1) - 1); - mbfl_memory_device_strncat(&device, "\n", 1); - - if (!suppressed_hdrs.cnt_type) { - mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER2, sizeof(PHP_MBSTR_MAIL_MIME_HEADER2) - 1); - - p = (char *)mbfl_no2preferred_mime_name(tran_cs); - if (p != NULL) { - mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER3, sizeof(PHP_MBSTR_MAIL_MIME_HEADER3) - 1); - mbfl_memory_device_strcat(&device, p); - } - mbfl_memory_device_strncat(&device, "\n", 1); - } - if (!suppressed_hdrs.cnt_trans_enc) { - mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER4, sizeof(PHP_MBSTR_MAIL_MIME_HEADER4) - 1); - p = (char *)mbfl_no2preferred_mime_name(body_enc); - if (p == NULL) { - p = "7bit"; - } - mbfl_memory_device_strcat(&device, p); - mbfl_memory_device_strncat(&device, "\n", 1); - } - - mbfl_memory_device_unput(&device); - mbfl_memory_device_output('\0', &device); - headers = (char *)device.buffer; - - if (force_extra_parameters) { - extra_cmd = estrdup(force_extra_parameters); - } else if (extra_cmd) { - extra_cmd = php_escape_shell_cmd(extra_cmd); - } - - if (!err && php_mail(to, subject, message, headers, extra_cmd TSRMLS_CC)) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } - - if (extra_cmd) { - efree(extra_cmd); - } - if (subject_buf) { - efree((void *)subject_buf); - } - if (message_buf) { - efree((void *)message_buf); - } - mbfl_memory_device_clear(&device); - zend_hash_destroy(&ht_headers); -} - -#undef APPEND_ONE_CHAR -#undef SEPARATE_SMART_STR -#undef PHP_MBSTR_MAIL_MIME_HEADER1 -#undef PHP_MBSTR_MAIL_MIME_HEADER2 -#undef PHP_MBSTR_MAIL_MIME_HEADER3 -#undef PHP_MBSTR_MAIL_MIME_HEADER4 - -#else /* HAVE_SENDMAIL */ - -PHP_FUNCTION(mb_send_mail) -{ - RETURN_FALSE; -} - -#endif /* HAVE_SENDMAIL */ - -/* }}} */ - -/* {{{ proto string mb_get_info([string type]) - Returns the current settings of mbstring */ -PHP_FUNCTION(mb_get_info) -{ - char *typ = NULL; - int typ_len; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) { - RETURN_FALSE; - } - - if (!typ || !strcasecmp("all", typ)) { - array_init(return_value); - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_internal_encoding))) != NULL) { - add_assoc_string(return_value, "internal_encoding", name, 1); - } - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(http_input_identify))) != NULL) { - add_assoc_string(return_value, "http_input", name, 1); - } - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_http_output_encoding))) != NULL) { - add_assoc_string(return_value, "http_output", name, 1); - } - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(func_overload))) != NULL) { - add_assoc_string(return_value, "func_overload", name, 1); - } - } else if (!strcasecmp("internal_encoding", typ)) { - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_internal_encoding))) != NULL) { - RETVAL_STRING(name, 1); - } - } else if (!strcasecmp("http_input", typ)) { - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(http_input_identify))) != NULL) { - RETVAL_STRING(name, 1); - } - } else if (!strcasecmp("http_output", typ)) { - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_http_output_encoding))) != NULL) { - RETVAL_STRING(name, 1); - } - } else if (!strcasecmp("func_overload", typ)) { - if ((name = (char *)mbfl_no_encoding2name(MBSTRG(func_overload))) != NULL) { - RETVAL_STRING(name, 1); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ MBSTRING_API int php_mb_encoding_translation() */ -MBSTRING_API int php_mb_encoding_translation(TSRMLS_D) -{ - return MBSTRG(encoding_translation); -} -/* }}} */ - -/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes_ex() */ -MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc) -{ - if (enc != NULL) { - if (enc->flag & MBFL_ENCTYPE_MBCS) { - if (enc->mblen_table != NULL) { - if (s != NULL) return enc->mblen_table[*(unsigned char *)s]; - } - } else if (enc->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { - return 2; - } else if (enc->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) { - return 4; - } - } - return 1; -} -/* }}} */ - -/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes() */ -MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC) -{ - return php_mb_mbchar_bytes_ex(s, - mbfl_no2encoding(MBSTRG(internal_encoding))); -} -/* }}} */ - -/* {{{ MBSTRING_API char *php_mb_safe_strrchr_ex() */ -MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc) -{ - register const char *p = s; - char *last=NULL; - - if (nbytes == (size_t)-1) { - size_t nb = 0; - - while (*p != '\0') { - if (nb == 0) { - if ((unsigned char)*p == (unsigned char)c) { - last = (char *)p; - } - nb = php_mb_mbchar_bytes_ex(p, enc); - if (nb == 0) { - return NULL; /* something is going wrong! */ - } - } - --nb; - ++p; - } - } else { - register size_t bcnt = nbytes; - register size_t nbytes_char; - while (bcnt > 0) { - if ((unsigned char)*p == (unsigned char)c) { - last = (char *)p; - } - nbytes_char = php_mb_mbchar_bytes_ex(p, enc); - if (bcnt < nbytes_char) { - return NULL; - } - p += nbytes_char; - bcnt -= nbytes_char; - } - } - return last; -} -/* }}} */ - -/* {{{ MBSTRING_API char *php_mb_safe_strrchr() */ -MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes TSRMLS_DC) -{ - return php_mb_safe_strrchr_ex(s, c, nbytes, - mbfl_no2encoding(MBSTRG(internal_encoding))); -} -/* }}} */ - -/* {{{ MBSTRING_API char *php_mb_strrchr() */ -MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC) -{ - return php_mb_safe_strrchr(s, c, -1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ MBSTRING_API size_t php_mb_gpc_mbchar_bytes() */ -MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC) -{ - - if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid){ - return php_mb_mbchar_bytes_ex(s, - mbfl_no2encoding(MBSTRG(http_input_identify))); - } else { - return php_mb_mbchar_bytes_ex(s, - mbfl_no2encoding(MBSTRG(internal_encoding))); - } -} -/* }}} */ - -/* {{{ MBSTRING_API int php_mb_gpc_encoding_converter() */ -MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, const char *encoding_to, const char *encoding_from - TSRMLS_DC) -{ - int i; - mbfl_string string, result, *ret = NULL; - enum mbfl_no_encoding from_encoding, to_encoding; - mbfl_buffer_converter *convd; - - if (encoding_to) { - /* new encoding */ - to_encoding = mbfl_name2no_encoding(encoding_to); - if (to_encoding == mbfl_no_encoding_invalid) { - return -1; - } - } else { - to_encoding = MBSTRG(current_internal_encoding); - } - if (encoding_from) { - /* old encoding */ - from_encoding = mbfl_name2no_encoding(encoding_from); - if (from_encoding == mbfl_no_encoding_invalid) { - return -1; - } - } else { - from_encoding = MBSTRG(http_input_identify); - } - - if (from_encoding == mbfl_no_encoding_pass) { - return 0; - } - - /* initialize string */ - mbfl_string_init(&string); - mbfl_string_init(&result); - string.no_encoding = from_encoding; - string.no_language = MBSTRG(current_language); - - for (i=0; ival; - len[i] = ret->len; - } - mbfl_buffer_converter_delete(convd); - } - - return ret ? 0 : -1; -} - -/* {{{ MBSTRING_API int php_mb_gpc_encoding_detector() - */ -MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC) -{ - mbfl_string string; - enum mbfl_no_encoding *elist; - enum mbfl_no_encoding encoding = mbfl_no_encoding_invalid; - mbfl_encoding_detector *identd = NULL; - - int size; - enum mbfl_no_encoding *list; - - if (MBSTRG(http_input_list_size) == 1 && - MBSTRG(http_input_list)[0] == mbfl_no_encoding_pass) { - MBSTRG(http_input_identify) = mbfl_no_encoding_pass; - return SUCCESS; - } - - if (MBSTRG(http_input_list_size) == 1 && - MBSTRG(http_input_list)[0] != mbfl_no_encoding_auto && - mbfl_no_encoding2name(MBSTRG(http_input_list)[0]) != NULL) { - MBSTRG(http_input_identify) = MBSTRG(http_input_list)[0]; - return SUCCESS; - } - - if (arg_list && strlen(arg_list)>0) { - /* make encoding list */ - list = NULL; - size = 0; - php_mb_parse_encoding_list(arg_list, strlen(arg_list), &list, &size, 0 TSRMLS_CC); - - if (size > 0 && list != NULL) { - elist = list; - } else { - elist = MBSTRG(current_detect_order_list); - size = MBSTRG(current_detect_order_list_size); - if (size <= 0){ - elist = MBSTRG(default_detect_order_list); - size = MBSTRG(default_detect_order_list_size); - } - } - } else { - elist = MBSTRG(current_detect_order_list); - size = MBSTRG(current_detect_order_list_size); - if (size <= 0){ - elist = MBSTRG(default_detect_order_list); - size = MBSTRG(default_detect_order_list_size); - } - } - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - - identd = mbfl_encoding_detector_new(elist, size); - - if (identd) { - int n = 0; - while(n < num){ - string.val = (unsigned char *)arg_string[n]; - string.len = arg_length[n]; - if (mbfl_encoding_detector_feed(identd, &string)) { - break; - } - n++; - } - encoding = mbfl_encoding_detector_judge(identd); - mbfl_encoding_detector_delete(identd); - } - - if (encoding != mbfl_no_encoding_invalid) { - MBSTRG(http_input_identify) = encoding; - return SUCCESS; - } else { - return FAILURE; - } -} -/* }}} */ - -#ifdef ZEND_MULTIBYTE -/* {{{ MBSTRING_API int php_mb_set_zend_encoding() */ -MBSTRING_API int php_mb_set_zend_encoding(TSRMLS_D) -{ - /* 'd better use mbfl_memory_device? */ - char *name, *list = NULL; - int n, *entry, list_size = 0; - zend_encoding_detector encoding_detector; - zend_encoding_converter encoding_converter; - zend_encoding_oddlen encoding_oddlen; - - /* notify script encoding to Zend Engine */ - entry = MBSTRG(script_encoding_list); - n = MBSTRG(script_encoding_list_size); - while (n > 0) { - name = (char *)mbfl_no_encoding2name(*entry); - if (name) { - list_size += strlen(name) + 1; - if (!list) { - list = (char*)emalloc(list_size); - *list = (char)NULL; - } else { - list = (char*)erealloc(list, list_size); - strcat(list, ","); - } - strcat(list, name); - } - entry++; - n--; - } - zend_multibyte_set_script_encoding(list, (list ? strlen(list) : 0) TSRMLS_CC); - if (list) { - efree(list); - } - encoding_detector = php_mb_encoding_detector; - encoding_converter = php_mb_encoding_converter; - encoding_oddlen = php_mb_oddlen; - - /* TODO: make independent from mbstring.encoding_translation? */ - if (MBSTRG(encoding_translation)) { - /* notify internal encoding to Zend Engine */ - name = (char*)mbfl_no_encoding2name(MBSTRG(current_internal_encoding)); - zend_multibyte_set_internal_encoding(name, strlen(name) TSRMLS_CC); - } - - zend_multibyte_set_functions(encoding_detector, encoding_converter, encoding_oddlen TSRMLS_CC); - - return 0; -} -/* }}} */ - -/* {{{ char *php_mb_encoding_detector() - * Interface for Zend Engine - */ -char* php_mb_encoding_detector(const char *arg_string, int arg_length, char *arg_list TSRMLS_DC) -{ - mbfl_string string; - const char *ret; - enum mbfl_no_encoding *elist; - int size, *list; - - /* make encoding list */ - list = NULL; - size = 0; - php_mb_parse_encoding_list(arg_list, strlen(arg_list), &list, &size, 0 TSRMLS_CC); - if (size <= 0) { - return NULL; - } - if (size > 0 && list != NULL) { - elist = list; - } else { - elist = MBSTRG(current_detect_order_list); - size = MBSTRG(current_detect_order_list_size); - } - - mbfl_string_init(&string); - string.no_language = MBSTRG(current_language); - string.val = (char*)arg_string; - string.len = arg_length; - ret = mbfl_identify_encoding_name(&string, elist, size, 0); - if (list != NULL) { - efree((void *)list); - } - if (ret != NULL) { - return estrdup(ret); - } else { - return NULL; - } -} -/* }}} */ - -/* {{{ int php_mb_encoding_converter() */ -int php_mb_encoding_converter(char **to, int *to_length, const char *from, - int from_length, const char *encoding_to, const char *encoding_from - TSRMLS_DC) -{ - mbfl_string string, result, *ret; - enum mbfl_no_encoding from_encoding, to_encoding; - mbfl_buffer_converter *convd; - - /* new encoding */ - to_encoding = mbfl_name2no_encoding(encoding_to); - if (to_encoding == mbfl_no_encoding_invalid) { - return -1; - } - /* old encoding */ - from_encoding = mbfl_name2no_encoding(encoding_from); - if (from_encoding == mbfl_no_encoding_invalid) { - return -1; - } - /* initialize string */ - mbfl_string_init(&string); - mbfl_string_init(&result); - string.no_encoding = from_encoding; - string.no_language = MBSTRG(current_language); - string.val = (char*)from; - string.len = from_length; - - /* initialize converter */ - convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len); - if (convd == NULL) { - return -1; - } - mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode)); - mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar)); - - /* do it */ - ret = mbfl_buffer_converter_feed_result(convd, &string, &result); - if (ret != NULL) { - *to = ret->val; - *to_length = ret->len; - } - mbfl_buffer_converter_delete(convd); - - return ret ? 0 : -1; -} -/* }}} */ - -/* {{{ int php_mb_oddlen() - * returns number of odd (e.g. appears only first byte of multibyte - * character) chars - */ -int php_mb_oddlen(const char *string, int length, const char *encoding TSRMLS_DC) -{ - mbfl_string mb_string; - - mbfl_string_init(&mb_string); - mb_string.no_language = MBSTRG(current_language); - mb_string.no_encoding = mbfl_name2no_encoding(encoding); - mb_string.val = (char*)string; - mb_string.len = length; - - if (mb_string.no_encoding == mbfl_no_encoding_invalid) { - return 0; - } - return mbfl_oddlen(&mb_string); -} -/* }}} */ -#endif /* ZEND_MULTIBYTE */ - -#endif /* HAVE_MBSTRING */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/mbstring/mbstring.dsp b/ext/mbstring/mbstring.dsp deleted file mode 100644 index 63a7fa65675df..0000000000000 --- a/ext/mbstring/mbstring.dsp +++ /dev/null @@ -1,1088 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mbstring" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mbstring - Win32 Debug_TS MBSTRING -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mbstring.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mbstring.mak" CFG="mbstring - Win32 Debug_TS MBSTRING" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mbstring - Win32 Release_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mbstring - Win32 Debug_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "mbstring___Win32_Release_TS_MBSTRING" -# PROP BASE Intermediate_Dir "mbstring___Win32_Release_TS_MBSTRING" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "_MBCS" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /D ZEND_DEBUG=0 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "mbstring___Win32_Debug_TS_MBSTRING" -# PROP BASE Intermediate_Dir "mbstring___Win32_Debug_TS_MBSTRING" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /I "oniguruma" /D ZEND_DEBUG=1 /D MBSTRING_EXPORTS=1 /D HAVE_STDLIB_H=1 /D HAVE_STRING_H=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "mbstring - Win32 Release_TS MBSTRING" -# Name "mbstring - Win32 Debug_TS MBSTRING" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mb_gpc.c - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\mbstring.c - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\php_mbregex.c -# End Source File -# Begin Source File - -SOURCE=.\php_unicode.c - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mb_gpc.h - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\mbstring.h - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\php_mbregex.h -# End Source File -# Begin Source File - -SOURCE=.\php_unicode.h - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\unicode_data.h - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# PROP Intermediate_Dir "Release_TS" - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# PROP Intermediate_Dir "Debug_TS" - -!ENDIF - -# End Source File -# End Group -# Begin Group "libmbfl" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\libmbfl\filters\html_entities.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_7bit.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_8bit.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ascii.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_base64.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_big5.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_byte2.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_byte4.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp1251.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp1252.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp866.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp932.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp936.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_cn.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_jp.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_kr.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_tw.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_htmlent.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_hz.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_jis.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_koi8r.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_armscii8.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_pass.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_qprint.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_sjis.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ucs4.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_uhc.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf16.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf32.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf7.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf7imap.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf8.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_uuencode.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_wchar.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_allocators.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_convert.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_encoding.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_filter_output.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_ident.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_language.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_memory_device.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_string.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_de.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_en.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_ja.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_kr.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_neutral.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_ru.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_uni.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_zh.c -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_hy.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\libmbfl\config.h.vc6 - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# Begin Custom Build -InputDir=.\libmbfl -InputPath=.\libmbfl\config.h.vc6 - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h" - -# End Custom Build - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# Begin Custom Build -InputDir=.\libmbfl -InputPath=.\libmbfl\config.h.vc6 - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h" - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\cp932_table.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\html_entities.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_7bit.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_8bit.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ascii.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_base64.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_big5.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_byte2.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_byte4.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp1251.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp1252.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp866.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp932.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_cp936.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_cn.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_jp.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_kr.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_euc_tw.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_htmlent.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_hz.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_jis.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_koi8r.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_armscii8.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_pass.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_qprint.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_sjis.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ucs2.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_ucs4.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_uhc.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf16.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf32.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf7.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf7imap.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_utf8.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\mbfilter_uuencode.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfilter_wchar.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_allocators.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_consts.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_convert.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_defs.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_encoding.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_filter_output.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_ident.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_language.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_memory_device.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\mbfl\mbfl_string.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_de.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_en.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_ja.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_kr.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_neutral.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_ru.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_uni.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_zh.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\nls\nls_hy.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_prop.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_big5.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cns11643.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cp1251.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cp1252.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cp866.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cp932_ext.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_cp936.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_10.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_13.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_14.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_15.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_2.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_3.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_4.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_5.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_6.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_7.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_8.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_iso8859_9.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_jis.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_koi8r.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_armscii8.h -# End Source File -# Begin Source File - -SOURCE=.\libmbfl\filters\unicode_table_uhc.h -# End Source File -# End Group -# End Group -# Begin Group "oniguruma" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\oniguruma\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\reggnu.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regparse.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regposerr.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\ascii.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\utf8.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\euc_jp.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\euc_tw.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\euc_kr.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\sjis.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_1.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_2.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_3.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_4.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_5.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_6.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_7.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_8.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_9.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_10.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_11.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_13.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_14.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_15.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\iso8859_16.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\koi8.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\koi8_r.c -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\enc\big5.c -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\oniguruma\win32\config.h - -!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING" - -# Begin Custom Build -InputDir=.\oniguruma\win32 -InputPath=.\oniguruma\win32\config.h - -"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h "$(InputDir)\..\config.h" - -# End Custom Build - -!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING" - -# Begin Custom Build -InputDir=.\oniguruma\win32 -InputPath=.\oniguruma\win32\config.h - -"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputDir)\config.h "$(InputDir)\..\config.h" - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\onigposix.h -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\oniguruma.h -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\php_compat.h -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regint.h -# End Source File -# Begin Source File - -SOURCE=.\oniguruma\regparse.h -# End Source File -# End Group -# End Group -# End Target -# End Project diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h deleted file mode 100644 index 3eed51b12be6f..0000000000000 --- a/ext/mbstring/mbstring.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Tsukada Takuya | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * PHP 4 Multibyte String module "mbstring" (currently only for Japanese) - * - * History: - * 2000.5.19 Release php-4.0RC2_jstring-1.0 - * 2001.4.1 Release php4_jstring-1.0.91 - * 2001.4.30 Release php4-jstring-1.1 (contribute to The PHP Group) - * 2001.5.1 Renamed from jstring to mbstring (hirokawa@php.net) - */ - -/* - * PHP3 Internationalization support program. - * - * Copyright (c) 1999,2000 by the PHP3 internationalization team. - * All rights reserved. - * - * See README_PHP3-i18n-ja for more detail. - * - * Authors: - * Hironori Sato - * Shigeru Kanemoto - * Tsukada Takuya - */ - - -#ifndef _MBSTRING_H -#define _MBSTRING_H - -#ifdef COMPILE_DL_MBSTRING -#undef HAVE_MBSTRING -#define HAVE_MBSTRING 1 -#endif - -#ifdef PHP_WIN32 -# undef MBSTRING_API -# ifdef MBSTRING_EXPORTS -# define MBSTRING_API __declspec(dllexport) -# elif defined(COMPILE_DL_MBSTRING) -# define MBSTRING_API __declspec(dllimport) -# else -# define MBSTRING_API /* nothing special */ -# endif -#else -# undef MBSTRING_API -# define MBSTRING_API /* nothing special */ -#endif - - -#if HAVE_MBSTRING - -#include "libmbfl/mbfl/mbfilter.h" -#include "SAPI.h" - -#define PHP_MBSTRING_API 20021024 - -#if HAVE_MBREGEX -#include "php_mbregex.h" -#endif - -extern zend_module_entry mbstring_module_entry; -#define mbstring_module_ptr &mbstring_module_entry - -PHP_MINIT_FUNCTION(mbstring); -PHP_MSHUTDOWN_FUNCTION(mbstring); -PHP_RINIT_FUNCTION(mbstring); -PHP_RSHUTDOWN_FUNCTION(mbstring); -PHP_MINFO_FUNCTION(mbstring); - -/* functions in php_unicode.c */ -PHP_FUNCTION(mb_convert_case); -PHP_FUNCTION(mb_strtoupper); -PHP_FUNCTION(mb_strtolower); - -/* php function registration */ -PHP_FUNCTION(mb_language); -PHP_FUNCTION(mb_internal_encoding); -PHP_FUNCTION(mb_http_input); -PHP_FUNCTION(mb_http_output); -PHP_FUNCTION(mb_detect_order); -PHP_FUNCTION(mb_substitute_character); -PHP_FUNCTION(mb_preferred_mime_name); -PHP_FUNCTION(mb_parse_str); -PHP_FUNCTION(mb_output_handler); -PHP_FUNCTION(mb_strlen); -PHP_FUNCTION(mb_strpos); -PHP_FUNCTION(mb_strrpos); -PHP_FUNCTION(mb_substr_count); -PHP_FUNCTION(mb_substr); -PHP_FUNCTION(mb_strcut); -PHP_FUNCTION(mb_strwidth); -PHP_FUNCTION(mb_strimwidth); -PHP_FUNCTION(mb_convert_encoding); -PHP_FUNCTION(mb_detect_encoding); -PHP_FUNCTION(mb_list_encodings); -PHP_FUNCTION(mb_convert_kana); -PHP_FUNCTION(mb_encode_mimeheader); -PHP_FUNCTION(mb_decode_mimeheader); -PHP_FUNCTION(mb_convert_variables); -PHP_FUNCTION(mb_encode_numericentity); -PHP_FUNCTION(mb_decode_numericentity); -PHP_FUNCTION(mb_send_mail); -PHP_FUNCTION(mb_get_info); - -MBSTRING_API int php_mb_encoding_translation(TSRMLS_D); - -MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, - size_t nbytes, const mbfl_encoding *enc); -MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, - size_t nbytes TSRMLS_DC); -MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC); - -MBSTRING_API char * php_mb_convert_encoding(char *input, size_t length, - char *_to_encoding, - char *_from_encodings, - size_t *output_len TSRMLS_DC); - -MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC); - -MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc); -MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC); - -MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC); - -MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length, - char *arg_list TSRMLS_DC); - -MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to, - const char *encoding_from TSRMLS_DC); -MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, const char *encoding_to, const char *encoding_from TSRMLS_DC); - -MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC); - -ZEND_BEGIN_MODULE_GLOBALS(mbstring) - enum mbfl_no_language language; - enum mbfl_no_language current_language; - enum mbfl_no_encoding internal_encoding; - enum mbfl_no_encoding current_internal_encoding; -#ifdef ZEND_MULTIBYTE - enum mbfl_no_encoding *script_encoding_list; - int script_encoding_list_size; -#endif /* ZEND_MULTIBYTE */ - enum mbfl_no_encoding http_output_encoding; - enum mbfl_no_encoding current_http_output_encoding; - enum mbfl_no_encoding http_input_identify; - enum mbfl_no_encoding http_input_identify_get; - enum mbfl_no_encoding http_input_identify_post; - enum mbfl_no_encoding http_input_identify_cookie; - enum mbfl_no_encoding http_input_identify_string; - enum mbfl_no_encoding *http_input_list; - int http_input_list_size; - enum mbfl_no_encoding *detect_order_list; - int detect_order_list_size; - enum mbfl_no_encoding *current_detect_order_list; - int current_detect_order_list_size; - enum mbfl_no_encoding *default_detect_order_list; - int default_detect_order_list_size; - int filter_illegal_mode; - int filter_illegal_substchar; - int current_filter_illegal_mode; - int current_filter_illegal_substchar; - long func_overload; - zend_bool encoding_translation; - mbfl_buffer_converter *outconv; -#if HAVE_MBREGEX && defined(PHP_MBREGEX_GLOBALS) - PHP_MBREGEX_GLOBALS -#endif -ZEND_END_MODULE_GLOBALS(mbstring) - -#define MB_OVERLOAD_MAIL 1 -#define MB_OVERLOAD_STRING 2 -#define MB_OVERLOAD_REGEX 4 - -struct mb_overload_def { - int type; - char *orig_func; - char *ovld_func; - char *save_func; -}; - -#ifdef ZTS -#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v) -#else -#define MBSTRG(v) (mbstring_globals.v) -#endif - -#ifdef ZEND_MULTIBYTE -MBSTRING_API int php_mb_set_zend_encoding(TSRMLS_D); -char* php_mb_encoding_detector(const char *string, int length, char *list - TSRMLS_DC); -int php_mb_encoding_converter(char **to, int *to_length, const char *from, - int from_length, const char *encoding_to, const char *encoding_from - TSRMLS_DC); -int php_mb_oddlen(const char *string, int length, const char *encoding TSRMLS_DC); -#endif /* ZEND_MULTIBYTE */ - -#else /* HAVE_MBSTRING */ - -#define mbstring_module_ptr NULL - -#endif /* HAVE_MBSTRING */ - -#define phpext_mbstring_ptr mbstring_module_ptr - -#endif /* _MBSTRING_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/mbstring/oniguruma/COPYING b/ext/mbstring/oniguruma/COPYING deleted file mode 100644 index ed3fa53b25370..0000000000000 --- a/ext/mbstring/oniguruma/COPYING +++ /dev/null @@ -1,32 +0,0 @@ -OniGuruma LICENSE ------------------ - -When this software is partly used or it is distributed with Ruby, -this of Ruby follows the license of Ruby. -It follows the BSD license in the case of the one except for it. - -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY deleted file mode 100644 index c648c5455117e..0000000000000 --- a/ext/mbstring/oniguruma/HISTORY +++ /dev/null @@ -1,1373 +0,0 @@ -History - -2005/03/07: Version 3.7.1 - -2005/03/07: [test] success in ruby 1.9.0 (2005-03-07) [i686-linux]. -2005/03/07: [impl] (thanks Rui Hirokawa) - add ONIG_ESCAPE_UCHAR_COLLISION. - rename UChar to OnigUChar in oniguruma.h. -2005/03/07: [impl] remove declarations for Ruby in oniggnu.h. -2005/03/05: [bug] ANCHOR_ANYCHAR_STAR didn't work in onig_search(). -2005/03/01: [dist] remove oniggnu.h from MANIFEST-RUBY. - remove oniggnu.h from make 19. -2005/03/01: [bug] (thanks matz) [ruby-dev:25778] - uninitialized member (OptEnv.backrefed_status) - was used. - -2005/02/19: Version 3.7.0 - -2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin]. -2005/02/19: [new] (thanks Minero Aoki) - add onig_region_set(). -2005/02/19: [API] change onig_region_init() to extern. -2005/02/19: [dist] remove reggnu.c from MANIFEST-RUBY. - remove reggnu.c from make 19. -2005/02/19: [dist] update doc/API and doc/API.ja. -2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin]. -2005/02/19: [impl] (thanks Alexey Zakhlestin) - change UChar* to const UChar* in oniguruma.h, - regenc.h and regparse.h. -2005/02/13: [impl] change UChar* to const UChar* in oniguruma.h and - onigposix.h and st.h. -2005/02/12: [test] success in ruby 1.9.0 (2005-02-11) [i386-cygwin]. -2005/02/12: [bug] (thanks nobu) [ruby-dev:25676] - type_cclass_hash() fix overrun. -2005/02/09: [test] success in ruby 1.9.0 (2005-02-09) [i686-linux]. -2005/02/09: [spec] add RE_OPTION_FIND_NOT_EMPTY etc.. to oniggnu.h. -2005/02/09: [dist] remove hash.c.patch. -2005/02/07: [impl] remove re_mbctab, mbctab_ascii etc... - (USE_COMPATIBILITY_FOR_RUBY_EXTENSION_LIBRARY) - -2005/02/04: Version 3.6.0 - -2005/02/04: [test] success in ruby 1.9.0 (2005-02-04) [i686-linux]. -2005/02/01: [bug] add key_free() call to st_free_table(). -2005/02/01: [new] add onig_get_default_ambig_flag() and - onig_set_default_ambig_flag(). -2005/02/01: [dist] update MANIFEST-RUBY. -2005/01/31: [test] success in ruby 1.9.0 (2005-01-29) [i686-linux]. -2005/01/31: [spec] remove ONIGENC_AMBIGUOUS_MATCH_COMPOUND - from ONIGENC_AMBIGUOUS_MATCH_DEFAULT. -2005/01/31: [dist] update Makefile.in (make 19). -2005/01/29: [memo] (thanks Kazuo Saito) - Oniguruma 3.5.4 was merged to Ruby 1.9.0. -2005/01/28: [impl] (thanks UK-taniyama) - add extern "C" { } directive to oniguruma.h, oniggnu.h - and onigposix.h for C++. -2005/01/25: [impl] remove nested function call for xxx_code_to_mbclen(). - (euc_kr.c, euc_tw.c, big5.c) - -2005/01/19: Version 3.5.4 - -2005/01/19: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. -2005/01/19: [bug] (thanks Isao Sonobe) - callback function argument name_end of onig_foreach_name() - was wrong. - name key of name table should be null terminated for - character encoding length. - add strdup_with_null(), rename onig_strdup() to k_strdup(). - use e->name_len in i_names(). -2005/01/17: [impl] (thanks UK-taniyama) - add HAVE_SYS_TYPES_H to config.h.in. - -2005/01/13: Version 3.5.3 - -2005/01/13: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. -2005/01/13: [bug] ignore case match bug. - ex. /s+/iu.match("SSSSS") ==> [4..5] - fix OP_EXACT1_IC, OP_EXACTN_IC process. -2005/01/13: [bug] (thanks Isao Sonobe) - ignore case match bug. - ex. /is/iu.match("ss") fail. - fix str_lower_case_match() etc. - -2005/01/05: Version 3.5.2 - -2005/01/05: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. -2005/01/05: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux]. -2005/01/05: [bug] (thanks Isao Sonobe) - ignore case match bug. - ex. /s+/iu.match("sssss") ==> [4..5] - fix OP_EXACT1_IC, OP_EXACTN_IC process. -2005/01/05: [bug] (thanks Isao Sonobe) - group name table should be renumbered. - add onig_renumber_name_table(). -2004/12/24: [dist] remove file onigcmpt200.h. - -2004/12/17: Version 3.5.1 - -2004/12/17: [dist] add INSTALL-RUBY to archive. -2004/12/16: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux]. -2004/12/16: [dist] update hash.c.patch. -2004/12/15: [bug] (thanks matz) - char > 127 should be casted to unsigned char. (utf8.c) -2004/12/13: [impl] add HAVE_PROTOTYPES and HAVE_STDARG_PROTOTYPES definition - to oniguruma.h in the case __cplusplus. -2004/12/06: [dist] update doc/RE and doc/RE.ja. -2004/12/03: [impl] (thanks nobu) - st.h fix prototype for C++. - -2004/12/03: Version 3.5.0 - -2004/12/02: [test] success in ruby 1.9.0 (2004-12-02) [i686-linux]. -2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-mswin32]. -2004/12/01: [dist] add make targets 19 and 19up to win32/Makefile. -2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-cygwin]. -2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i686-linux]. -2004/12/01: [impl] double cast for escape warning in Cygwin. - (HashDataType* )((void* )(&e)) in regparse.c -2004/12/01: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux]. -2004/12/01: [tune] change implementation of clear_opt_map_info(). - (which was 10-16% cost in gprof result for my test program) -2004/12/01: [dist] remove regex.c from distribution files. -2004/11/30: [memo] remove targets 16 and 18 from Makefile.in. -2004/11/30: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux]. -2004/11/30: [inst] add "cp -p st.[ch] st.[ch].ruby_orig" to "make 19". -2004/11/30: [tune] map_position_value() return 20 if code is 0 - and minimum enclen > 1. -2004/11/30: [test] success in ruby 1.9.0 (2004-11-29) [i686-linux]. -2004/11/30: [impl] minor changes for multi-thread in regexec.c and regcomp.c. -2004/11/30: [impl] change THREAD_PASS_LIMIT_COUNT value from 10 to 8. -2004/11/30: [impl] add THREAD_ATOMIC_XXX to FreeNodeList access in regparse.c -2004/11/29: [impl] add USE_MULTI_THREAD_SYSTEM. -2004/11/29: [memo] add hash.c.patch to CVS. -2004/11/29: [dist] change mail address to 'sndgk393 AT ...' -2004/11/29: [dist] add -s option (silent mode) to test.rb. -2004/11/29: [tune] change THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS value - from 20 to 8. -2004/11/29: [inst] add make target "19up". -2004/11/29: [dist] change Oniguruma Home Page URL. -2004/11/29: [impl] remove onig_is_in_code_range_array(). -2004/11/29: [dist] fix doc/RE and RE.ja (character types). -2004/11/26: [dist] fix win32/Makefile. -2004/11/26: [dist] fix doc/RE and RE.ja (multibyte character types). -2004/11/26: [impl] add onig_free_shared_cclass_table(). -2004/11/26: [impl] move definition USE_UNICODE_FULL_RANGE_CTYPE to regenc.h. -2004/11/26: [impl] add opcode OP_CCLASS_NODE. -2004/11/26: [impl] move definition of CClassNode to regint.h. -2004/11/26: [impl] add type PointerType in regint.h. -2004/11/25: [impl] remove ONIGENC_CTYPE_MOD_NOT. -2004/11/25: [impl] rename onig_node_new_cclass_by_codepoint_range to - node_new_cclass_by_codepoint_range. -2004/11/25: [impl] remove get_type_cc_node method from OnigEncodingType. -2004/11/25: [impl] move implementation of shared char-class from enc/*.c - to regparse.c. -2004/11/25: [dist] add hash.c.patch for Ruby 1.9 hash.c change. -2004/11/22: [impl] change utf8_get_type_node(). -2004/11/22: [impl] add ONIGENC_CTYPE_MOD_NOT. -2004/11/22: [bug] (thanks MIYAMUKO Katsuyuki) - ruby make test fail in HP-UX B.11.23 ia64. - should use tok->u.code instead of tok->u.c in - the case of TK_CODE_POINT. -2004/11/19: [bug] (thanks Yoshida Masato) - invalid multibyte code causes segmentation fault. - ex. /[\xFF-\xFF]/u -2004/11/19: [bug] (thanks Yoshida Masato) - illegal check in char-class range in UTF-8. - ex. s = "[\xC2\xA0-\xC3\xBE]" - p(Regexp.new(s, nil, "u") =~ "\xC3\xBE") -2004/11/18: [impl] add onig_node_new_cclass_by_codepoint_range(). -2004/11/18: [impl] remove OnigCodePointRange type. (use OnigCodePoint[].) -2004/11/17: [bug] (thanks nobu) - abort in "a".gsub(/a\Z/, "") - fix ONIGENC_STEP_BACK() argument in onig_search(). -2004/11/16: [impl] add key2 member to st_table_entry in st.[ch]. - change API of st for non-null terminated string key. -2004/11/16: [impl] add get_type_cc_node method to OnigEncodingType. -2004/11/15: [impl] add st.h and st.c from Ruby 1.9. - use st-hash always. -2004/11/12: [impl] change menber 'not' of CClassNode to 'flags'. - add flags FLAG_CCLASS_NOT and FLAG_CCLASS_SHARE. -2004/11/12: [impl] add onig_is_in_code_range_array() to enc/unicode.c. -2004/11/12: [impl] fix CRWord in enc/unicode.c and MBWord in enc/utf8.c. -2004/11/11: [bug] fix enc/utf8.c. - size 0 array initializer was compile error in VC++. -2004/11/09: [inst] (thanks Hiroki YAGITA) - change installed file mode to 0644. -2004/11/09: [bug] (thanks UK-taniyama) - wrong definitions GET_RELADDR_INC(), GET_ABSADDR_INC() - etc... (NOT PLATFORM_UNALIGNED_WORD_ACCESS) -2004/11/09: [impl] type cast in regexec() for remove compile time warning. - (WIN32, regposix.c) -2004/11/08: [spec] fix Unicode character types. - 0x00ad (soft hyphen) should be [:cntrl:] and [:space:] type. - [0x0009..0x000d], 0x0085 should be [:print:] type. - 0x00ad should not be [:punct:] type. -2004/11/08: [inst] fix Makefile.in. (for make ctest/ptest/testcu) -2004/11/06: [impl] (thanks Kazuo Saito) - too many alternatives pattern causes core dump. - change implementation of onig_node_free(). -2004/11/05: [spec] rename ONIGERR_END_PATTERN_AT_BACKSLASH to - ONIGERR_END_PATTERN_AT_ESCAPE. -2004/11/05: [impl] (thanks matz) - escape compile time warnings for x86-64 Linux. - StackIndex type int -> long -2004/11/05: [memo] (thanks Kazuo Saito) - Oniguruma 3.4.0 was merged to Ruby 1.9.0. - -2004/10/30: Version 3.4.0 - -2004/10/30: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux]. -2004/10/30: [new] add hexadecimal digit char type. (\h, \H) - syntax: ONIG_SYN_OP2_ESC_H_XDIGIT -2004/10/30: [bug] (thanks Guy Decoux) - reluctant infinite repeat bug. - ex. /^[a-z]{2,}?$/.match("aaa") fail. - fix OP_REPEAT_INC_NG process in match_at(). - -2004/10/18: Version 3.3.1 - -2004/10/18: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux]. -2004/10/18: [impl] (thanks Imai Yasumasa) - enclose #include by #ifndef __BORLANDC__. -2004/10/18: [bug] (thanks Imai Yasumasa) - memory acess violation in select_opt_exact_info(). -2004/09/25: [dist] fix doc/API and doc/API.ja. -2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() for - the case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE - is not defined. - -2004/09/17: Version 3.3.0 - -2004/09/17: [dist] add COPYING to program source files. -2004/09/17: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. -2004/09/17: [bug] (thanks Isao Sonobe) - memory access violations in xxx_mbc_enc_len(), - and xxx_mbc_to_normalize() and - xxx_left_adjust_char_head(). - add string range check in match_at() and onig_search(). -2004/09/08: [dist] change mail address format.(kosako AT sofnec ...) - -2004/09/04: Version 3.2.9 - -2004/09/04: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. -2004/09/04: [bug] (thanks Bob Kerstetter and Richard Koch) - search fail in ignore case mode. - fix str_lower_case_match(). -2004/09/04: [inst] (thanks Isao Sonobe) - clear sample directory in 'make clean'. -2004/09/04: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCII - meanings in XXXXX_mbc_to_normalize() and - XXXXX_is_mbc_ambiguous(). -2004/08/28: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCII - meanings in iso_8859_XX_mbc_to_normalize() and - iso_8859_XX_is_mbc_ambiguous(). - -2004/08/24: Version 3.2.8 - -2004/08/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. -2004/08/24: [spec] add ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY. - /a{n}?/ == /(?:a{n})?/ -2004/08/24: [dist] fix doc/RE and doc/RE.ja. -2004/08/24: [bug] (thanks starfish) - memory leak in set_optimize_exact_info(). - -2004/08/21: Version 3.2.7 - -2004/08/21: [test] success in ruby 1.8.2 (2004-07-28) [i686-linux]. - (1.8.2 preview2) -2004/08/21: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. -2004/08/21: [bug] (thanks Isao Sonobe) (thanks kage) - memory access violation in bm_search_notrev(). - (forgotten to merge from 2.X) - -2004/07/24: Version 3.2.6 - -2004/07/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. -2004/07/24: [test] success in ruby 1.8.2 (2004-07-16) [i686-linux]. -2004/07/24: [bug] fix warnings for regexec.c. (gcc 2.91.66) -2004/07/24: [memo] change version control system from Subversion - to CVS 1.11.17. -2004/07/20: [bug] (thanks Isao Sonobe) - illegal result in negative character class in ignore case - mode. fix pair-ambig-codes process in parse_exp(). - ex. /[^a]/i.match("A") -2004/07/20: [bug] (thanks Isao Sonobe) - undefined bytecode error happens in UTF-16BE etc.. - compile_length_cclass_node() was not consistent with - compile_cclass_node(). - -2004/07/01: Version 3.2.5 - -2004/07/01: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. -2004/07/01: [new] add onig_get_syntax_{op,op2,behavior,options}. -2004/07/01: [bug] (thanks Isao Sonobe) - invalid result in onig_capture_tree_traverse(). - fix make_capture_history_tree(). - -2004/06/29: Version 3.2.4 - -2004/06/29: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. -2004/06/29: [new] (thanks Isao Sonobe) - add onig_number_of_captures(). - -2004/06/25: Version 3.2.3 - -2004/06/25: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. -2004/06/25: [bug] (thanks Isao Sonobe) - invalid result in onig_capture_tree_traverse(). - fix make_capture_history_tree(). - -2004/06/24: Version 3.2.2 - -2004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/06/24: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. -2004/06/24: [new] (thanks Isao Sonobe) - add onig_number_of_capture_histories(). -2004/06/24: [bug] (thanks Isao Sonobe) - invalid char position match in UTF-16 and UTF-32. - add onigenc_always_false_is_allowed_reverse_match(). - -2004/06/17: Version 3.2.1 - -2004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/06/17: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. -2004/06/17: [impl] should not use OP_REPEAT for (...)? even if target size - is long. -2004/06/17: [bug] (thanks nobu) [ruby-dev:23703] - should use STACK_AT() instead of stkp in OP_REPEAT_INC. - add IN_VAR_REPEAT flag in setup_tree(). -2004/06/16: [impl] change select_opt_exact_info() to use ByteValTable[]. -2004/06/16: [impl] change map_position_value() table values. -2004/06/14: [impl] (thanks John Carter) - RelAddrType, AbsAddrType and LengthType change - from short int to int type for the very long string match. -2004/06/14: [bug] (thanks Greg A. Woods) - fix nmatch argument of regexec() is smaller than - reg->num_mem + 1 case. (POSIX API) -2004/06/14: [spec] (thanks Greg A. Woods) - set pmatch to NULL if nmatch is 0 in regexec(). (POSIX API) - -2004/06/10: Version 3.2.0 - -2004/06/10: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/06/10: [test] success in ruby 1.9.0 (2004-05-27) [i386-mswin32]. -2004/06/10: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. -2004/06/10: [dist] add README.ja. -2004/06/10: [new] add onig_copy_encoding(). -2004/06/10: [API] add encoding argument to onig_set_meta_char(). - add meta_char_table member to OnigEncodingType. -2004/06/08: [dist] add doc/API.ja. -2004/06/07: [API] add num_of_elements member to OnigCompileInfo. -2004/05/29: [memo] (thanks Kazuo Saito) - Oniguruma 3.1.0 was merged to Ruby 1.9.0. -2004/05/26: [impl] rename NST_SIMPLE_REPEAT to NST_STOP_BT_SIMPLE_REPEAT. -2004/05/26: [impl] doesn't need to check that target's simple repeat-ness - for EFFECT_MEMORY type node in setup_tree(). - -2004/05/25: Version 3.1.0 - -2004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/05/25: [test] success in ruby 1.9.0 (2004-05-23) [i686-linux]. -2004/05/25: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. -2004/05/25: [bug] (thanks Masahiro Sakai) [ruby-dev:23560] - ruby -ruri -ve 'URI::ABS_URI =~ - "http://example.org/Andr\xC3\xA9"' - nested STK_REPEAT type stack can't backtrack repeat_stk[]. - add OP_REPEAT_INC_SG and OP_REPEAT_INC_NG_SG. -2004/05/25: [new] support UTF-32LE. (ONIG_ENCODING_UTF32_LE) -2004/05/25: [new] support UTF-32BE. (ONIG_ENCODING_UTF32_BE) -2004/05/24: [impl] divide enc/utf16.c to utf16_be.c and utf16_le.c. -2004/05/24: [impl] add enc/unicode.c. -2004/05/24: [API] change calling sequences of onig_new_deluxe() and - onig_recompile_deluxe(). - define OnigCompileInfo type. -2004/05/21: [impl] perform ensure process for rb_trap_exec() in match_at(). - add onig_exec_trap() and CHECK_INTERRUPT_IN_MATCH_AT. -2004/05/21: [impl] add regex status check to onig_match(). -2004/05/21: [new] add onig_get_capture_tree() and - onig_capture_tree_traverse(). -2004/05/20: [spec] (thanks Isao Sonobe) - capture history return capture data tree. - (see sample/listcap.c) -2004/05/19: [bug] (thanks Simon Strandgaard) - Control-C does not work in matching process on Ruby. - add calling of CHECK_INTERRUPT into match_at(). - ex. /<(?:[^">]+|"[^"]*")+>/.match('') -2004/05/19: [bug] (thanks Simon Strandgaard) - define virtual codepoint values for invalid encoding - byte 0xfe and 0xff in UTF-8. - ex. /\w+/u.match("%a\xffb\xfec%") ==> "a" -2004/05/19: [spec] (thanks Simon Strandgaard) - too big backref number should be treated as a sequence of - an octal char and number digits. - ex. /b\3777\c/.match("b\3777\c") -2004/05/17: [spec] rename encoding names "UTF-16 BE" and "UTF-16 LE" - to "UTF-16BE" and "UTF-16LE". -2004/05/17: [impl] move ismbchar() and mbclen() from oniguruma.h to oniggnu.h. -2004/05/17: [impl] rename onigenc_single_byte_is_allowed_reverse_match() to - onigenc_always_true_is_allowed_reverse_match(). - -2004/05/14: Version 3.0.0 - -2004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/05/14: [test] success in ruby 1.9.0 (2004-05-14) [i686-linux]. -2004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. - (* need to edit parse.y: - register int c; ---> int c; in yylex()) -2004/05/14: [impl] add regext.c. -2004/05/14: [spec] KOI8 is not included in library archive by default setup. -2004/05/14: [impl] implementation changes are completed for all encoding files. -2004/05/12: [impl] add divide_ambig_string_node(). - ambiguous string is divided and normalized before - optimization and compilation process. -2004/05/11: [dist] remove INSTALL-RUBY from distribution. -2004/04/28: [memo] (thanks Kazuo Saito) - Oniguruma 2.2.8 was merged to Ruby 1.9.0. -2004/04/26: [spec] change value DEFAULT_MATCH_STACK_LIMIT_SIZE = 0 : unlimited -2004/04/26: [new] add onig_get_match_stack_limit_size() and - onig_set_match_stack_limit_size(). -2004/04/26: [bug] add error check to re.c.181.patch and re.c.168.patch. -2004/04/23: [impl] remove ctype_support_level from OnigEncodingType. -2004/04/22: [spec] allow the range from single byte char to multibyte char in - character class for implementation reason. - ex. /[a-\xbb\xcc]/ in EUC-JP encoding. -2004/04/21: [impl] remove max_enc_len_by_first_byte() from OnigEncodingType. -2004/04/20: [new] add onig_copyright(). -2004/04/20: [impl] add regversion.c. -2004/04/15: [new] add onig_get_ambig_flag(). -2004/04/14: [bug] (thanks Isao Sonobe) - undefined bytecode error happens if ONIG_OPTION_FIND_LONGEST - is setted. - should finish matching process if find-condition - is fail at OP_END in match_at(). -2004/04/12: [impl] add ambig_flag to regex_t. -2004/04/09: [impl] move onig_set_meta_char() to regsyntax.c. -2004/04/09: [bug] (thanks HIROSE Masaaki) fix onig_version(). -2004/04/08: [impl] add regsyntax.c. -2004/04/07: [new] support UTF-16 LE. (ONIG_ENCODING_UTF16_LE) -2004/04/05: [impl] add ONIGENC_CTYPE_NEWLINE. -2004/04/05: [memo] (thanks Kazuo Saito) - Oniguruma 2.2.6 was merged to Ruby 1.9.0. -2004/04/02: [memo] Version 2.2.6 was released. -2004/03/26: [new] support UTF-16 BE. (ONIG_ENCODING_UTF16_BE) -2004/03/25: [spec] support non 8-bit encodings. -2004/03/16: [memo] 2.X branch for 8-bit encodings only. - -2004/03/16: Version 2.2.5 - -2004/03/16: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/03/16: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux]. -2004/03/16: [impl] add property name to error message of - ONIGERR_INVALID_CHAR_PROPERTY_NAME. -2004/03/16: [spec] allow prefix 'Is' for \p{...} in ONIG_SYNTAX_PERL. - add syntax op. ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS. -2004/03/15: [dist] add sample/syntax.c. -2004/03/15: [spec] support NOT op. in char property. \p{^...}, \P{^...}. - add syntax op. ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT. -2004/03/15: [spec] rename ONIG_SYN_OP2_ESC_P_CHAR_PROPERTY to - ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY. -2004/03/10: [impl] move ONIGERR_XXX from regenc.h to oniguruma.h, - rename ONIGERR_XXX to ONIGENCERR_XXX in regenc.h. -2004/03/08: [impl] (thanks eban) - replace defined(__CYGWIN__) to defined(__GNUC__). -2004/03/08: [bug] (thanks eban) [ruby-dev:23172] - need to separate initialization for bcc32. -2004/03/06: [memo] (thanks Kazuo Saito) - Oniguruma 2.2.4 was merged to Ruby 1.9.0. -2004/03/05: [API] change second argument type of onig_set_meta_char() - from unsigned int to OnigCodePoint. -2004/03/05: [dist] (thanks Kazuo Saito) - add MANIFEST-RUBY. - -2004/03/04: Version 2.2.4 - -2004/03/04: [impl] (thanks Moriyoshi Koizumi) - fix many warnings in Win32 VC++ with /W3 option. - -2004/03/02: Version 2.2.3 - -2004/03/02: [bug] (thanks Isao Sonobe) - return invalid capture region value if capture history - is used. (OP_MEMORY_END_PUSH_REC bug) - ex. /\g

(?@

\(\g\)){0}(?(?:\g

)*|){0}/ - .match("((())())") -2004/03/02: [impl] (thanks Kazuo Saito) - add :nodoc: to onig_stat_print() for RDoc. -2004/03/02: [impl] don't use ONIG_SOURCE_IS_WRAPPED. - -2004/02/27: Version 2.2.2 - -2004/02/27: [impl] fix the position of onig_stat_print(). -2004/02/27: [impl] define ONIG_RUBY_DEFINE_GLOBAL_FUNCTION() in regint.h - for ignored by RDoc. - -2004/02/26: Version 2.2.1 - -2004/02/26: [bug] [bugs.php.net:#26677] (thanks behrens) - invalid definition at onig_error_code_to_str() - in the case of NOT HAVE_STDARG_PROTOTYPES. - -2004/02/25: Version 2.2.0 - -2004/02/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/02/24: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux]. -2004/02/24: [bug] undefined IS_BLANK() and IS_GRAPH() was used in - onigenc_is_code_ctype() in the case of Ruby M17N. -2004/02/24: [new] support ISO-8859-16. (ONIG_ENCODING_ISO_8859_16) -2004/02/24: [bug] should not fold match for 0xdf in iso8859_6.c. -2004/02/24: [new] support ISO-8859-14. (ONIG_ENCODING_ISO_8859_14) -2004/02/23: [new] support ISO-8859-13. (ONIG_ENCODING_ISO_8859_13) -2004/02/23: [new] support ISO-8859-10. (ONIG_ENCODING_ISO_8859_10) -2004/02/20: [bug] fix iso_8859_4_mbc_is_case_ambig(). -2004/02/20: [new] support ISO-8859-9. (ONIG_ENCODING_ISO_8859_9) -2004/02/19: [bug] correct ctype tables for ISO-8859-3, ISO-8859-4, - ISO-8859-6, ISO-8859-7, ISO-8859-8, KOI8_R. -2004/02/18: [bug] wrong replaced name OnigSyntaxGnuOnigex. -2004/02/17: [spec] check capture status for empty infinite loop. - [ruby-dev:20224] etc... - ex. /(?:\1a|())*/.match("a"), - /(?:()|()|()|(x)|()|())*\2b\5/.match("b") - add USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK. - add OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH. - add stack type STK_NULL_CHECK_END. -2004/02/13: [impl] add OnigEncodingEUC_CN to enc/euc_kr.c. -2004/02/13: [bug] (thanks Simon Strandgaard) - parsing of nested repeat was invalid. - ex. /ab{2,3}*/ was /(?:a(?:b{2,3}))*/, - should be /a(?:b{2,3}*)/ -2004/02/12: [bug] (thanks Simon Strandgaard) - OP_REPEAT_INC_NG process in match_at() is wrong. - ex. bad match /a.{0,2}?a/ =~ "0aXXXa0" -2004/02/12: [bug] (thanks Simon Strandgaard) - wrong fetch after (?x) option. ex. "(?x)\ta .\n+b" -2004/02/12: [bug] (thanks Simon Strandgaard) - [\^] is not a empty char class. -2004/02/09: [new] add onig_set_syntax_op(), onig_set_syntax_op2(), - onig_set_syntax_behavior(), onig_set_syntax_options(). -2004/02/06: [dist] add a new target 'site' to Makefile.in. -2004/02/06: [dist] add index.html. -2004/02/03: [bug] oniggnu.h was not installed by 'make install'. - -2004/02/02: Version 2.1.0 - -2004/02/02: [test] success in ruby 1.9.0 (2004-02-02) [i686-linux]. -2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2004/02/02: [new] support ISO-8859-11. (ONIG_ENCODING_ISO_8859_11) -2004/02/02: [new] support ISO-8859-5. (ONIG_ENCODING_ISO_8859_5) -2004/02/02: [impl] should check single byte encoding or not in and_cclass() - and or_cclass(). -2004/01/30: [dist] add oniggnu.h. -2004/01/30: [bug] ISO-8859-7 0xb7 (middle dot) is Punct type. -2004/01/30: [new] support ISO-8859-8. (ONIG_ENCODING_ISO_8859_8) -2004/01/29: [new] support ISO-8859-7. (ONIG_ENCODING_ISO_8859_7) -2004/01/29: [new] support ISO-8859-6. (ONIG_ENCODING_ISO_8859_6) -2004/01/28: [new] support KOI8-R. (ONIG_ENCODING_KOI8_R) -2004/01/28: [new] support KOI8. (ONIG_ENCODING_KOI8) -2004/01/27: [dist] rename enc/isotable.c to enc/mktable.c. -2004/01/27: [new] support ISO-8859-4. (ONIG_ENCODING_ISO_8859_4) -2004/01/26: [new] support ISO-8859-3. (ONIG_ENCODING_ISO_8859_3) -2004/01/26: [bug] EncISO_8859_{1,15}_CtypeTable[256] was wrong. - (0x80 - 0xff is not ASCII) -2004/01/23: [new] support ISO-8859-2. (ONIG_ENCODING_ISO_8859_2) -2004/01/23: [dist] add enc/isotable.c. -2004/01/22: [new] support EUC-TW. (ONIG_ENCODING_EUC_TW) -2004/01/22: [bug] definition of GET_ALIGNMENT_PAD_SIZE() and - ALIGNMENT_RIGHT() was wrong. - type casting should be unsigned int, not int. -2004/01/22: [impl] add defined(__x86_64) || defined(__x86_64__) - to unaligned word access condition. (AMD64 ?) -2004/01/21: [dist] rename enc/eucjp.c to enc/euc_jp.c. -2004/01/21: [new] support EUC-KR. (ONIG_ENCODING_EUC_KR) -2004/01/20: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2004/01/20: [dist] change Makefile.in. -2004/01/20: [spec] add \p{...}, \P{...} in char class. -2004/01/20: [new] character property operators \p{...}, \P{...}. - supported in ONIG_SYNTAX_JAVA and ONIG_SYNTAX_PERL. -2004/01/19: [spec] allow /a{,n}/ as /a{0,n}/. (but don't allow /a{,}/) -2004/01/19: [dist] rename onigcomp200.h to onigcmpt200.h. -2004/01/19: [dist] update re.c.168.patch. svn add re.c.181.patch. -2004/01/16: [dist] update sample/*.c for new API. -2004/01/16: [dist] add onigcomp200.h. (for old API compatibility) -2004/01/16: [dist] update documents API, RE and RE.ja. -2004/01/16: [spec] change prefix REG_ -> ONIG_, regex_ onig_, - ENC_ -> ONIGENC, enc_ -> onigenc_. -2004/01/15: [impl] rename ENC_IS_MBC_E_WORD() to ENC_IS_MBC_WORD(). - rename ENC_CTYPE_SUPPORT_LEVEL_SB_ONLY to - ENC_CTYPE_SUPPORT_LEVEL_SB. -2004/01/14: [impl] rename UNALIGNED_WORD_ACCESS to - PLATFORM_UNALIGNED_WORD_ACCESS. -2004/01/14: [impl] change MATCH_STACK_LIMIT_SIZE value from 200000 to 500000. -2004/01/13: [impl] remove ENC_CODE_TO_MBC_FIRST(enc,code) in regenc.h. - remove code_to_mbc_first member in RegCharEncodingType. -2004/01/13: [impl] remove head byte bitset information in cclass->mbuf. -2003/12/26: [impl] change macro name ismb_xxxx() in enc/*.c for - escape conflict. - -2003/12/24: Version 2.0.0 - -2003/12/24: [spec] ignore case option is effective to numbered char. - ex. /\x61/i =~ "A" -2003/12/24: [test] success in ruby 1.8.1 (2003-12-24) [i686-linux]. -2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. -2003/12/24: [test] success in regex.c compile test on ruby-m17n. - (but can't make miniruby because re.c patch fail.) -2003/12/24: [bug] (thanks H.Miyamoto) /[\W]/ was wrong in 1.9.5. -2003/12/22: [spec] implement fold match on UTF-8 encoding. -2003/12/19: [impl] add ctype_support_level and ctype_add_codes() member to - RegCharEncoding type. -2003/12/19: [impl] add add_ctype_to_cc() in regparse.c. -2003/12/19: [impl] add enc_is_code_ctype() in REG_RUBY_M17N case. -2003/12/19: [impl] change ENC_CODE_TO_MBC() interface. -2003/12/18: [new] implement fold match. (variable number of char - match in ignore case mode.) - ex. German alphabet ess-tsett(U+00DF) match "SS" and "ss". -2003/12/17: [impl] refactoring of encoding system. -2003/12/17: [impl] add enc_init() in regenc.c. -2003/12/17: [new] support Big5. (REG_ENCODING_BIG5) -2003/12/16: [impl] change CodePoint from unsigned int to unsigned long. -2003/12/16: [new] support ISO 8859-15. (REG_ENCODING_ISO_8859_15) -2003/12/16: [impl] change P_() macro definition condition for Win32. -2003/12/16: [dist] add sample/encode.c -2003/12/16: [new] support ISO 8859-1. (REG_ENCODING_ISO_8859_1) -2003/12/15: [impl] rename IS_ENC_XXXX to ENC_IS_XXXX. -2003/12/15: [impl] rename RegDefaultCharEncoding to EncDefaultCharEncoding. -2003/12/15: [impl] divide encoding files. (enc/ascii.c, enc/utf8.c etc...) -2003/12/15: [bug] unexpected infinite loop in regex_snprintf_with_pattern(). - change local var. type char* to UChar*. -2003/12/15: [impl] remove REG_MBLEN_TABLE[]. -2003/12/15: [spec] rename function prefix regex_get_prev_char_head(), - regex_get_left_adjust_char_head() and - regex_get_right_adjust_char_head() to enc_xxxxxx(). -2003/12/15: [impl] rename function prefixes in regenc.h from regex_ to enc_. -2003/12/12: [impl] remove USE_SBMB_CLASS. -2003/12/12: [impl] rename mb -> mbc, mblen() to enc_len(). -2003/12/12: [impl] rename WCINT to CodePoint. -2003/12/11: [impl] delete IS_XXXX() ctype macros from regint.h. -2003/12/11: [impl] add enc->wc_is_ctype() and RegAsciiCtypeTable[256]. -2003/12/11: [impl] remove RegAsciiCaseAmbigTable. -2003/12/10: [impl] use ENC_TO_LOWER() for ignore case comparison. -2003/12/08: [impl] *** re-defined RegCharEncoding in oniguruma.h. *** -2003/12/08: [impl] add USE_POSIX_REGION_OPTION to regint.h. -2003/12/08: [impl] add IS_ENC_WORD() to regenc.h. -2003/12/05: [impl] rename IS_CODE_XXXX() to IS_ENC_XXXX(). -2003/12/05: [impl] delete IS_CODE_WORD() from regenc.h. -2003/12/04: [spec] rename REG_SYN_OP_BACK_REF to REG_SYN_OP_DECIMAL_BACKREF. -2003/12/04: [spec] add (REG_SYN_OP_ESC_W_WORD | REG_SYN_OP_ESC_B_WORD_BOUND | - REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | REG_SYN_OP_BACK_REF) - to RegSyntaxGrep. -2003/12/04: [spec] remove REG_ENCODING_DEFAULT and REGCODE_DEFAULT. -2003/12/04: [spec] move declarations of regex_get_default_encoding() and - regex_set_default_encoding() from oniguruma.h to regenc.h. -2003/12/03: [new] add regex_get_default_encoding() and - regex_set_default_encoding(). -2003/12/03: [spec] REG_ENCODING_DEFAULT meaning is changed. - (current default value, not initial default value.) -2003/12/03: [spec] REGCODE_XXX is obsoleted. use REG_ENCODING_XXX. -2003/12/02: [memo] alias svnst='svn status | grep -v "^\?"' -2003/12/02: [spec] move regex_set_default_trans_table() declaration - from oniguruma.h to regenc.h. (obsoleted API) -2003/12/02: [impl] move variables RegDefaultCharEncoding, DefaultTransTable and - AmbiguityTable to regenc.c. -2003/12/01: [impl] add regex_continuous_sbmb() to regenc.c. -2003/12/01: [dist] add regenc.h and regenc.c. -2003/11/18: [dist] change testconv.rb. -2003/11/18: [bug] (thanks Masaru Tsuda) - memory leak in parse_subexp(). -2003/11/18: [bug] (thanks Masaru Tsuda) - memory leak in names_clear() and parse_char_class(). -2003/11/17: [bug] memory leak in parse_char_class(). -2003/11/17: [bug] (thanks Masaru Tsuda) - OptExactInfo length should not over OPT_EXACT_MAXLEN. - (concat_opt_exact_info_str()) - -2003/11/12: Version 1.9.5 - -2003/11/12: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. -2003/11/12: [test] success in ruby 1.8.1 (2003-11-11) [i686-linux]. -2003/11/12: [spec] add definition of REG_INEFFECTIVE_META_CHAR. -2003/11/11: [dist] add a sample program sample/sql.c. -2003/11/11: [new] add variable meta character. - regex_set_meta_char() -2003/11/11: [spec] add syntax op. REG_SYN_OP_VARIABLE_META_CHARS. -2003/11/11: [spec] rename REG_SYN_OP_ESC_CAPITAL_Q_QUOTE to - REG_SYN_OP2_ESC_CAPITAL_Q_QUOTE, - REG_SYN_OP_QMARK_GROUP_EFFECT to - REG_SYN_OP2_QMARK_GROUP_EFFECT. -2003/11/06: [impl] define THREAD_PASS as rb_thread_schedule() in Ruby mode. -2003/11/05: [spec] add syntax behavior REG_SYN_WARN_REDUNDANT_NESTED_REPEAT. -2003/11/05: [spec] rename REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED to - REG_SYN_WARN_CC_OP_NOT_ESCAPED. -2003/11/04: [new] add regex_set_warn_func() and regex_set_verb_warn_func(). -2003/10/30: [new] add regex_name_to_backref_number(). - (for multiplex definition name, see sample/names.c) -2003/10/30: [spec] add name_end and reg argument to callback function of - regex_foreach_name(). (see sample/names.c) -2003/10/29: [spec] add syntax behavior REG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME. - add error code REGERR_MULTIPLEX_DEFINED_NAME. -2003/10/14: [dist] modify sample/simple.c. -2003/10/03: [bug] (thanks nobu) [ruby-dev:21472] - sub-anchor of optimization map info was wrong - in concat_left_node_opt_info(). - ex. /^(x?y)/ = "xy" fail. - -2003/09/17: Version 1.9.4 - -2003/09/17: [spec] change specification of char-class range in ignore case mode - follows with Ruby 1.8(2003-09-17). - ex. /[H-c]/i ==> (H-Z, 0x5b-0x60, a-c)/i - ==> H-Z, h-z, 0x5b-0x60, a-c, A-C -2003/09/16: [bug] (thanks Guy Decoux) - remove env->option == option check in parse_effect(). - change env->option for dynamic option in parse_exp(). - (ex. bad match /(?i)(?-i)a/ =~ "A") -2003/09/12: [spec] rename REG_SYN_ALLOW_RANGE_OP_IN_CC to - REG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC, - REG_SYN_ESCAPE_IN_CC to REG_SYN_BACKSLASH_ESCAPE_IN_CC. -2003/09/11: [bug] change to IS_SYNTAX_OP2 at REG_SYN_OP2_ESC_GNU_BUF_ANCHOR. -2003/09/09: [spec] rename REG_SYN_OP2_ESC_M_BAR_META to - REG_SYN_OP2_ESC_CAPITAL_M_BAR_META, - REG_SYN_OP_ESC_Q_QUOTE to REG_SYN_OP_ESC_CAPITAL_Q_QUOTE, - REG_SYN_OP_ESC_SUBEXP to REG_SYN_OP_ESC_LPAREN_SUBEXP, - REG_SYN_OP_ESC_BUF_ANCHOR to REG_SYN_OP_ESC_AZ_BUF_ANCHOR, - REG_SYN_OP_ESC_GNU_BUF_ANCHOR to - REG_SYN_OP2_ESC_GNU_BUF_ANCHOR, - REG_SYN_OP_ESC_CONTROL_CHAR to REG_SYN_OP_ESC_CONTROL_CHARS, - REG_SYN_OP_ESC_WORD to REG_SYN_OP_ESC_W_WORD, - REG_SYN_OP_ESC_WORD_BEGIN_END to - REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END, - REG_SYN_OP_ESC_WORD_BOUND to REG_SYN_OP_ESC_B_WORD_BOUND, - REG_SYN_OP_ESC_WHITE_SPACE to REG_SYN_OP_ESC_S_WHITE_SPACE, - REG_SYN_OP_ESC_DIGIT to REG_SYN_OP_ESC_D_DIGIT, - REG_SYN_OP_CC to REG_SYN_OP_BRACKET_CC, - REG_SYN_OP2_CCLASS_SET to REG_SYN_OP2_CCLASS_SET_OP, - REG_SYN_CONTEXT_INDEP_OPS to - REG_SYN_CONTEXT_INDEP_REPEAT_OPS, - REG_SYN_CONTEXT_INVALID_REPEAT_OPS to - REG_SYN_CONTEXT_INVALID_REPEAT_OPS. - add REG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR. -2003/09/08: [spec] rename REG_SYN_OP_ANYCHAR to REG_SYN_OP_DOT_ANYCHAR, - REG_SYN_OP_0INF to REG_SYN_OP_ASTERISK_ZERO_INF, - REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_ASTERISK_ZERO_INF, - REG_SYN_OP_1INF to REG_SYN_OP_PLUS_ONE_INF, - REG_SYN_OP_ESC_1INF to REG_SYN_OP_ESC_PLUS_ONE_INF, - REG_SYN_OP_0INF to REG_SYN_OP_QMARK_ZERO_ONE, - REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_QMARK_ZERO_ONE, - REG_SYN_OP_INTERVAL to REG_SYN_OP_BRACE_INTERVAL, - REG_SYN_OP_ESC_INTERVAL to REG_SYN_OP_ESC_BRACE_INTERVAL, - REG_SYN_OP_SUBEXP to REG_SYN_OP_LPAREN_SUBEXP, - REG_SYN_OP_ALT to REG_SYN_OP_VBAR_ALT, - REG_SYN_OP_ESC_ALT to REG_SYN_OP_ESC_VBAR_ALT, - REG_SYN_OP_NON_GREEDY to REG_SYN_OP_QMARK_NON_GREEDY, - REG_SYN_OP_SUBEXP_EFFECT to REG_SYN_OP_QMARK_GROUP_EFFECT, - REG_SYN_OP2_POSSESSIVE_{REPEAT,INTERVAL} to - REG_SYN_OP2_PLUS_POSSESSIVE_{REPEAT,INTERVAL}, - REG_SYN_OP2_SUBEXP_CALL to REG_SYN_OP2_ESC_G_SUBEXP_CALL, - REG_SYN_OP2_NAMED_GROUP to REG_SYN_OP2_QMARK_LT_NAMED_GROUP - and REG_SYN_OP2_ESC_K_NAMED_BACKREF. -2003/09/02: [tune] call reduce_nested_qualifier() after disabling capture for - no-name group in noname_disable_map(). - ex. /(a+)*(?...)/ -2003/09/02: [impl] include is forgotten to erase in regcomp.c. -2003/09/01: [dist] update doc/RE and doc/RE.ja. -2003/08/26: [bug] (thanks Guy Decoux) - should not double free node at the case TK_CC_CC_OPEN - in parse_char_class(). - -2003/08/19: Version 1.9.3 - -2003/08/19: [inst] change re.c.180.patch. -2003/08/19: [impl] rename 'list of captures' to 'capture history'. -2003/08/19: [dist] add doc/RE.ja. (Japanese) -2003/08/19: [new] add regex_copy_syntax(). -2003/08/19: [spec] rename REG_SYN_OP2_ATMARK_LIST_OF_CAPTURES to - REG_SYN_OP2_ATMARK_CAPTURE_HISTORY. -2003/08/18: [spec] (thanks nobu) - don't use IMPORT in oniguruma.h and onigposix.h. -2003/08/18: [impl] (thanks nobu) change error output to stdout in testconv.rb. -2003/08/18: [inst] (thanks nobu) lacked $(srcdir) in Makefile.in. -2003/08/18: [bug] REG_MBLEN_TABLE[SJIS][0xFD-0xFF] should be 1. -2003/08/18: [bug] (thanks nobu) mbctab_sjis[0x80] should be 0. -2003/08/18: [bug] (thanks nobu) - single/multi-byte decision was wrong in parse_char_class(). - add regex_wc2mblen(). - should not set fetched to 1 in TK_RAW_BYTE case. -2003/08/18: [bug] should update BitSet in the case inc_n >= 0 - in add_wc_range_to_buf(). -2003/08/13: [bug] change re.c.180.patch for fix rb_reg_to_s() in re.c. -2003/08/11: [bug] should clear region->list in regex_region_resize(). - -2003/08/08: Version 1.9.2 - -2003/08/08: [test] success in ruby 1.8.0 (2003-08-08) on Windows 2000 - VC++ 6.0 and Cygwin. -2003/08/08: [impl] don't define macro vsnprintf for WIN32 platform, - because definition is added in win32\win32.h. -2003/08/08: [test] success in ruby 1.8.0 and ruby 1.6.8(2003-08-03) on Linux. -2003/08/08: [dist] change re.c.180.patch and re.c.168.patch. -2003/08/08: [new] (thanks akr) - implemented list of captures. (?@...), (?@...) -2003/08/07: [dist] add sample/listcap.c. -2003/08/06: [bug] OP_MEMORY_END_PUSH_REC case in match_at(). - renewal of mem_start_stk[] should be after - STACK_PUSH_MEM_END() call. -2003/07/29: [new] add regex_get_encoding(), regex_get_options() and - regex_get_syntax(). -2003/07/25: [spec] (thanks akr) - change group(...) to shy-group(?:...) if named group is - used in the pattern. - add REG_SYN_CAPTURE_ONLY_NAMED_GROUP. -2003/07/24: [spec] rename REG_OPTION_CAPTURE_ONLY_NAMED_GROUP to - REG_OPTION_DONT_CAPTURE_GROUP. - add REG_OPTION_CAPTURE_GROUP. -2003/07/17: [spec] rename REG_SYN_OP2_NAMED_SUBEXP to REG_SYN_OP2_NAMED_GROUP. -2003/07/17: [spec] add REGERR_EMPTY_GROUP_NAME. -2003/07/17: [spec] rename REGERR_INVALID_SUBEXP_NAME - to REGERR_INVALID_CHAR_IN_GROUP_NAME. -2003/07/17: [spec] restrict usable chars of group name to alphabet, digit, - '_' or multibyte-char in fetch_name(). [ruby-dev:20706] -2003/07/16: [impl] minor change of sample/names.c. -2003/07/14: [impl] rename USE_NAMED_SUBEXP to USE_NAMED_GROUP. -2003/07/14: [bug] add fetch_name() for USE_NAMED_SUBEXP off case. -2003/07/14: [API] add regex_number_of_names(). -2003/07/08: [impl] change error message for undefined group number call. - 'undefined group reference: /(a)\g<2>/' - --> 'undefined group <2> reference: /(a)\g<2>/' -2003/07/08: [dist] modify doc/RE. -2003/07/07: [impl] OP_SET_OPTION is not needed in compiled code. - add IS_DYNAMIC_OPTION() to regint.h. -2003/07/07: [spec] called group should not ignore outside option (?i:...). - ex. /(?i:(?(a)\2)){0}\g/.match("aA") - add opcode OP_BACKREFN_IC and OP_BACKREF_MULTI_IC. - set option status to effect memory in optimize_node_left(). -2003/07/07: [impl] add opcode OP_ANYCHAR_ML, OP_ANYCHAR_ML_STAR and - OP_ANYCHAR_ML_START_PEEK_NEXT. -2003/07/07: [bug] (thanks nobu) REG_MBLEN_TABLE[SJIS][0x80] should be 1. -2003/07/07: [spec] rename REG_SYN_OP_QUOTE to REG_SYN_OP_ESC_Q_QUOTE. - -2003/07/04: Version 1.9.1 - -2003/07/04: [new] add REG_OPTION_CAPTURE_ONLY_NAMED_GROUP. (thanks .NET) -2003/07/04: [spec] check mbuf member in the case of - REG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC in parse_char_class(). -2003/07/04: [spec] typo REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED. - should be REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED. -2003/07/04: [bug] conflict values on REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED and - REG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC. (thanks nobu) -2003/07/03: [spec] add REG_SYN_OP_ESC_CONTROL_CHAR flag. -2003/07/03: [spec] remove REG_SYN_OP_ESC_OCTAL3 and REG_SYN_OP_ESC_X_HEX2 - flag from RegSyntaxGnuRegex. -2003/07/03: [spec] remove REG_SYN_OP_NON_GREEDY flag from RegSyntaxGnuRegex. -2003/07/02: [dist] fix doc/RE. -2003/07/01: [impl] add config flag USE_VARIABLE_SYNTAX. - (turn off variable syntax on Ruby) -2003/07/01: [spec] add syntax behavior REG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND. -2003/06/30: [spec] allow different length top-level alternatives - in look-behind. ex. (?<=abc|abcd), (? (?>a*)b - (thanks Jeffrey E. F. Friedl) -2003/06/02: [impl] remove multibyte-BitSet for OP_CCLASS_MB/OP_CCLASS_MB_NOT. -2003/05/30: [new] char class intersection operator &&[...] like Java(TM). - (thanks akr) -2003/05/30: [bug] should use bbuf_free() for CClassNode in regex_node_free(). -2003/05/29: [bug] wrong usage of syntax REG_SYN_ALLOW_EMPTY_RANGE_IN_CC. - /[d-a]/ should be error. -2003/05/28: [impl] optimize stop-backtrack compiled code. - (/(?>a*)/, /(?>\w+)/ etc...) - add OP_POP opcode. -2003/05/28: [new] possessive repeat operator. (?+, *+, ++, {n,m}+) -2003/05/27: [spec] '-' at beginning of char-class should be warn only if - it is start of range. (ex. /[--a]/) -2003/05/27: [spec] should not warn for right bracket at beginning of pattern. - ex. /]aaa/ -2003/05/27: [spec] change CCEND_ESC_WARN() from VERB_WARNING() to WARNING(). -2003/05/27: [spec] /[]aaa/ should be empty char-class error. - /[]aaa]/ should be warn for 'without backslash'. - (add char_exist_check() in regparse.c) -2003/05/26: [bug] OP_REPEAT in recursive subexp call. - ex. /(?(a|b\gc){3,5})/.match("baaaaca") => "baaaaca" - was wrong result. (should be "aaaa") -2003/05/26: [impl] add num_call member to regex_t. -2003/05/26: [impl] add repeat_range member to regex_t. - (for delete upper,lower members from StackType.u.repeat) -2003/05/26: [bug] change print_names() to external regex_print_names(). -2003/05/26: [tune] change OP_NULL_CHECK_END process in match_at(). -2003/05/26: [spec] change CCEND_ESC_WARN() from WARNING() to VERB_WARNING(). -2003/05/26: [spec] remove POSIXLINE option. (?p:...) - (be made the same as Ruby.) -2003/05/22: [spec] use OP_NULL_CHECK_XXX only if repeat is infinite. - prev. /(?:()|()){0,10}\1\2/ =~ "" ==> FAIL - now /(?:()|()){0,10}\1\2/ =~ "" ==> MATCH - -2003/05/22: [impl] change target_empty setting condition in setup_tree(). -2003/05/19: [impl] avoid zero length repeat optimization. (thanks matz) - /()*/ ==> /()?/, /()+/ ==> /()/ etc... -2003/05/19: [impl] minor changes for gcc -Wall. (-DREG_DEBUG_STATISTICS case) -2003/05/19: [spec] rename regex_foreach_names() to regex_foreach_name(). -2003/05/16: [new] add --with-statistics option to configure. -2003/05/16: [bug] move RegOpInfo[] definition to regint.h. -2003/05/16: [new] add regex_version(). - -2003/05/14: Version 1.8.6 - -2003/05/14: [bug] use _vsnprintf() on Win32. -2003/05/14: [spec] define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE. - (/\n$/ =~ "\n", /\n\Z/ =~ "\n") [ruby-dev:20125] -2003/05/14: [impl] minor changes for gcc -Wall. -2003/05/14: [impl] add string.h check in AC_CHECK_HEADERS(). -2003/05/13: [impl] minor changes for gcc -Wall. -2003/05/13: [impl] add regex_snprintf_with_pattern(). -2003/05/13: [spec] add warning for char class meta character without escape - in Ruby mode ('[', '-', ']'). -2003/05/13: [impl] define WARNING() and VERB_WARNING() in regint.h. -2003/05/13: [bug] correct is_code_ascii() for /[[:ascii:]]/. -2003/05/12: [dist] add regular expression document (doc/RE). -2003/05/12: [spec] specification of $(END_LINE) was made the same as Ruby 1.8. - [ruby-dev:20130] (thanks matz) -2003/05/12: [memo] shifted to Subversion(version 0.21.0) from CVS. - -2003/03/19: Version 1.8.5 - -2003/03/19: [impl] change REG_EXTERN definition. (thanks nobu) -2003/03/19: [impl] abbreviation for long error_par in regex_error_code_to_str(). -2003/03/18: [dist] change re.c.XXX.patch for GNU regex API changes. -2003/03/18: [spec] change API regex_new(), regex_recompile() and - regex_error_code_to_str(). - change API re_compile_pattern() and re_recompile_pattern(). -2003/03/18: [spec] replace REGERR_END_PATTERN_AT_GROUP_{COMMENT|OPTION} to - REGERR_END_PATTERN_IN_GROUP. -2003/03/17: [impl] should free err_arg. -2003/03/17: [bug] mistake(high -> to) in add_wc_range_to_buf(). -2003/03/17: [spec] add err_arg argument to regex_new() and regex_recompile(). - for detail error message. (thanks akr) - -2003/03/12: Version 1.8.4 - -2003/03/12: [tune] use cached value of effect node in get_min_match_length(). -2003/03/12: [bug] escaped alphabet should be TK_RAW_BYTE - in fetch_token() and fetch_token_in_cc(). -2003/03/12: [spec] change named backref and subexp call format. - backref: \k, call: \g (thanks akr) -2003/03/11: [inst] add regparse.[ch] in win32/Makefile. -2003/03/11: [bug] if UNALIGNED_WORD_ACCESS isn't setted - then compile error in unset_addr_list_fix(). (thanks knu) -2003/03/10: [impl] divide regcomp.c to regcomp.c, regparse.c and regparse.h. -2003/03/10: [bug] should handle multi-byte code name in fetch_name(). -2003/03/10: [spec] remove REGERR_TABLE_FOR_IGNORE_CASE_IS_NOT_SETTED. -2003/03/10: [spec] support POSIX API option REG_NOSUB. - add comp_options member to POSIX API regex_t. - -2003/03/10: Version 1.8.3 - -2003/03/10: [bug] can not compile with Ruby 1.6.8. - (inconsistent st.h with 1.6 and 1.8) - use hash table on Ruby 1.8 only. -2003/03/10: [spec] forbid to use '\' in group name. -2003/03/08: [impl] remove check_backref_number(). -2003/03/08: [bug] called group in 0-repeat should not be eliminated from - compile code. ex. /(?*n)(?){0}/ (thanks akr) - add is_refered member to QualifierNode. -2003/03/07: [impl] use hash table(st.[ch]) for implementation of name table. - (enable on Ruby in default) -2003/03/07: [new] add regex_foreach_names(). -2003/03/06: [impl] add member reg->stack_pop_level. -2003/03/06: [impl] add operator OP_MEMORY_START and member reg->backtrack_mem. -2003/03/06: [bug] if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY, - should handle backtrack of MEM_END. - add OP_MEMORY_END_PUSH and OP_MEMORY_END_PUSH_REC. -2003/03/06: [impl] rename OP_MEMORY_END_PUSH to OP_MEMORY_END_MARK. -2003/03/06: [spec] change error messages. -2003/03/06: [tune] add tiny_pop check in STACK_POP. - -2003/03/05: Version 1.8.2 - -2003/03/05: [impl] use cache info in EFFECT_MEMORY case - in optimize_node_info(). -2003/03/05: [impl] add EFFECT_MEMORY node reference count check - in optimize_node_left(). -2003/03/05: [impl] add min-len, max-len, char-len cache in EffectNode. -2003/03/05: [spec] allow to call in look behind. ex. /(?<=(?*a))/ -2003/03/05: [bug] forgotten N_ANCHOR case in check_backref_number(), - subexp_inf_recursive_check_trav() etc... -2003/03/05: [impl] rename USE_ONIGURUMA_EXTENSION to USE_SBMB_CLASS. -2003/03/04: [impl] add CALL-node info in optimize_node_left(). -2003/03/04: [spec] prohibit left recursion of subexp call. ex. (?|(?*n)a) - add subexp_inf_recursive_check_trav(). -2003/03/04: [spec] rename REG_SYN_STRICT_CHECK_BACKREF_NUMBER - to REG_SYN_STRICT_CHECK_BACKREF -2003/03/03: [bug] /(?a(?*n)|)/ isn't infinite recursion. - fix N_LIST case in subexp_recursive_check(). (thanks akr) -2003/03/03: [bug] /(?|(?*n))+/ segmentation fault. - should re-allocate in unset_addr_list_add(). (thanks akr) - -2003/03/01: Version 1.8.1 - -2003/03/01: [bug] change STACK_GET_MEM_START() and STACK_PUSH_MEM_END(). -2003/03/01: [new] add reg_name_to_group_numbers() to POSIX API. -2003/03/01: [impl] use OP_MEMORY_END_PUSH in callable subexp compiled code - only if subexp is recursive. -2003/03/01: [spec] rename regex_name_to_backrefs() to - regex_name_to_group_numbers(). -2003/02/28: [impl] use function stack_double() instead of macro. -2003/02/28: [new] subexp call. (?*name) (thanks akr) -2003/02/28: [spec] add match stack limit check. (MATCH_STACK_LIMIT_SIZE) -2003/02/28: [impl] check recursive subexp call. -2003/02/28: [impl] add opcode OP_MEMORY_END_PUSH for callable subexp. -2003/02/28: [impl] add opcode OP_CALL, OP_RETURN. - add stack type STK_CALL_FRAME, STK_RETURN, STK_MEM_END. -2003/02/26: [spec] add new syntax behavior REG_SYN_STRICT_CHECK_BACKREF_NUMBER. - if it is setted, then error /(\1)/, /\1(..)/ etc... -2003/02/26: [spec] if backref number is greater than max group number, - then return compile error. (REGERR_INVALID_BACKREF_NUMBER) -2003/02/26: [tune] bad implemented N_ALT case in get_min_match_length(). -2003/02/26: [dist] auto update testc.c and win32/testc.c in dist target. -2003/02/26: [impl] add -win option to testconv.rb. -2003/02/25: [spec] allow to assign same name to different group. - add OP_BACKREF_MULTI. -2003/02/24: [impl] reduce redundant repeat of empty target. - ex. /()*/ ==> /()?/, /()+/ ==> /()/, /(?:)+/ ==> // -2003/02/24: [impl] change condition in regex_is_allow_reverse_match(). -2003/02/24: [impl] convert i(/../, ...) functions in testconv.rb. -2003/02/24: [impl] change name table struct. - -2003/02/22: Version 1.8.0 - -2003/02/22: [new] named subexp, named back reference. (thanks akr) - define: (?...), back-ref: \g -2003/02/22: [impl] use str_node_can_be_split(). -2003/02/21: [dist] add sample/posix.c -2003/02/21: [spec] rename some error code symbols. -2003/02/21: [spec] max number of multibyte ranges(255) is small. - 255 --> 1000. (thanks MoonWolf) -2003/02/20: [new] supported Basic Regular Expression(BRE) in POSIX API. - (REG_EXTENDED option: Extended RE) -2003/02/20: [new] variable syntax. - -2003/02/12: Version 1.7.2 - -2003/02/12: [bug] mismatch /\?a/i.match('?A'). - check raw value in scan_make_node() and scan_backslash(). - (thanks Nobu) -2003/02/12: [impl] rename 'max_mem' to 'num_mem' in regex_t. -2003/02/12: [impl] rename 'code' to 'enc' in regex_t. -2003/02/12: [spec] remove transtable argument in regex_new and regex_recompile. - remove transtable member in regex_t. -2003/02/10: [inst] change backup file suffix name from '.orig' to '.ruby_orig'. - (win32/Makefile) -2003/02/10: [spec] number check in scan_char_class() ignore-case mode. - ex. /[\x58-\x64]/i -2003/02/10: [impl] don't use OP_MEMORY_END_PUSH (and STK_MEM_END). -2003/02/10: [impl] lift up head_exact value from child qualifier node to parent. -2003/02/10: [tune] change stack type values. -2003/02/10: [dist] add HISTORY. -2003/02/08: [tune] change stack type values. -2003/02/08: [tune] add STACK_BASE_CHECK(). -2003/02/08: [tune] add STACK_PUSH_ENSURED(). -2003/02/08: [dist] change contents of doc/API. -2003/02/07: [inst] change backup file suffix name from '.orig' to '.ruby_orig'. -2003/02/07: [spec] range in char-class should be same spec. with Ruby - in ignore-case mode. (ex. /[A-c]/i == /[a-c]/i) - (thanks MoonWolf) -2003/02/07: [spec] [!--] should be allowed. (thanks MoonWolf) -2003/02/07: [dist] refresh re.c.180.patch for re.c (2003-02-06). - -2003/02/07: Version 1.7.1 - -2003/02/07: [impl] check first byte of string in ignore-case mode. - (get_head_exact_node()) -2003/02/07: [impl] remove redundant statements in setup_tree(). -2003/02/06: [new] create Win32 DLL. -2003/02/06: [impl] use P_() macro for function prototype. -2003/02/06: [impl] add HAVE_PROTOTYPE, HAVE_STDARG_PROTOTYPES in - configure.in and config.h.in. -2003/02/06: [spec] /[0-9-a]/ is allowed as usual char '-' and 'a' in Ruby. - add USE_BETTER_COMPATIBILITY_FOR_ORIGINAL_REGEX in - regint.h. (thanks MoonWolf) -2003/02/06: [spec] rename REG_MBCTYPE_XXXX to REG_ENCODING_XXXX in onigposix.h. -2003/02/05: [spec] rename MBCTYPE_XXXX to REG_MBCTYPE_XXXX in onigposix.h. -2003/02/05: [spec] add POSIX API error REG_EONIG_THREAD to onigposix.h. -2003/02/05: [dist] add .cvsignore file. - -2003/02/04: Version 1.7 - -2003/02/04: [bug] typo miss in regex_region_copy(). -2003/02/04: [impl] change THREAD_PASS macro. (regint.h) -2003/02/04: [dist] add API document file doc/API. -2003/02/04: [tune] if sub_anchor has ANCHOR_BEGIN_LINE then - set REG_OPTIMIZE_EXACT_BM in set_optimize_exact_info(). -2003/02/04: [spec] reimplement regex_clone() and it is obsoleted. -2003/02/04: [bug] add REGERR_OVER_THREAD_PASS_LIMIT_COUNT - to regerror.c regposix.c. -2003/02/03: [bug] Hankaku-Kana may be second byte in Shift_JIS - regex_is_allow_reverse_match(). -2003/02/03: [impl] add optimization type REG_OPTIMIZE_EXACT_BM_NOT_REV. - remove exact_allow_reverse_match member in regex_t. -2003/02/03: [impl] add exact_allow_reverse_match member in regex_t. -2003/02/03: [impl] compile-search conflict in regex_search() is handled. -2003/02/01: [tune] decrease regex_region_clear() calling from regex_search(). -2003/02/01: [tune] remove region argument from match_at(). -2003/01/31: [tune] don't use strlen() in regexec() and regcomp(). -2003/01/31: [tune] decrease regex_reduce_chain() calling in regex_search(). -2003/01/31: [bug] STRING_CMP() in regexec.c was wrong in ignore-case. -2003/01/31: [impl] convert to lower-case char at string compile time. - change SBTRANSCMP() in regexec.c. -2003/01/31: [impl] rename TTRANS() to TOLOWER(). -2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile. -2003/01/30: [impl] add -DNOT_RUBY to Makefile.in. - NOT_RUBY is refered in regint.h for escape double - including config.h. -2003/01/30: [impl] when string hasn't case ambiguity, don't compile - to ignore case opcode. -2003/01/29: [impl] add SJIS, UTF-8 test_sb() test. -2003/01/29: [dist] add INSTALL-RUBY file. -2003/01/28: [test] success in Cygwin, Ruby 1.8.0 (2003-01-27). -2003/01/24: [inst] add rback target to Makefile.in. -2003/01/24: [impl] change SBCMP() -> IS_NEWLINE() in match_at(). -2003/01/23: [impl] add encoding arg to scan_xxxx_number(). -2003/01/23: [impl] rename WCInt to WCINT. -2003/01/22: [bug] POSIX API regexec() was not thread safe. - remove region member from POSIX regex_t. - [new] add search time option REG_OPTION_POSIX_REGION. - (region argument is treated as regmatch_t[] type) - speed up regexec(). -2003/01/22: [memo] start CVS entry in my box. - -2003/01/21: Version 1.6 - -2003/01/21: [test] Mac OS X 10.1, Ruby 1.8.0 (2003-01-20) -2003/01/20: [impl] add UTF-8 check to test.rb. (thanks UENO Katsuhiro) -2003/01/18: [impl] change REGION_NOTPOS to REG_REGION_NOTPOS in regex.h. -2003/01/17: [dist] add sample/simple.c. -2003/01/17: [inst] add configure option --with-rubydir. -2003/01/17: [bug] bad implemeted POSIX API options. - default: /./ not match "\n", anchor not match "\n" - REG_NEWLINE: /./ not match "\n", anchor match "\n" -2003/01/16: [impl] rewrite POSIX API regexec() for speed up. -2003/01/16: [impl] add region member to POSIX regex_t struct. -2003/01/16: [inst] rename library file from 'libregex.a' to 'libonig.a'. -2003/01/15: [dist] add testc.c to distribution file. -2003/01/15: [test] success in 'make rtest/ctest/ptest' on Windows 2000. -2003/01/15: [bug] change '/' to \' in win32/Makefile. -2003/01/14: [test] success in Ruby make test on Windows 2000. - VC++6.0, Ruby 1.6.8 (2003-01-12) -2003/01/14: [inst] change Makefile.in and win32/Makefile. -2003/01/11: [inst] changes for Win32 platform. (regint.h, reggnu.c, regcomp.c) -2003/01/11: [dist] add win32 directory. (config.h, Makefile, testc.c) -2003/01/10: [inst] add onigposix.h to install target. (Makefile.in) -2003/01/10: [bug] lacked a comma in ESTRING[]. (regposerr.c) -2003/01/10: [bug] local variable name was wrong. buf -> tbuf (regerror()) -2003/01/10: [spec] remove REG_RUBY_M17N case from onigposix.h and regposix.c. - -2003/01/09: Version 1.5 - -2003/01/09: [inst] replace Ruby re.c.XXX.patch files. (166 -> 168, 172 -> 180) -2003/01/09: [new] implement POSIX API. (thanks knu) - (onigposix.h, regposix.c, regposerr.c) -2003/01/08: [spec] remove REGERR_END_PATTERN_AFTER_BACKSLASH in regex.h. -2003/01/08: [spec] region arg can be NULL in regex_search() and regex_match(). - -2003/01/08: Version 1.4 - -2003/01/08: [inst] add test program converter (test.rb -> testc.c). -2003/01/08: [bug] move GET_WCINT() from regcomp.c to regint.h. -2003/01/07: [inst] add new test script (test.rb). -2002/12/30: [bug] wrong merge in multibyte mode (alt_merge_opt_exact_info()). -2002/12/28: [inst] add rtest target to Makefile.in. -2002/12/28: [bug] /\xfe/.match("\xfe") mismatch in multibyte mode. - add "raw" flag arg to concat_opt_exact_info_str(). -2002/12/25: [bug] check condition was wrong in alt_merge_opt_map_info(). -2002/12/25: [impl] add threshold_len check in regex_search(). -2002/12/23: [bug] prec-read in alternative (/a|(?=z).f/.match("zf") => nil) -2002/12/23: [bug] \G in alternative (/a|\Gz/.match("bza") => "z"). - add start member in MatchArg. (regexec.c) -2002/12/21: [impl] **** rewrite all optimization process. **** -2002/12/16: [impl] remove node subtype EFFECT_EMPTY. -2002/12/12: [impl] reconstruct node types. (regcomp.c) -2002/12/11: [impl] add regerror.c -2002/12/10: [bug] [ruby-dev:19042] (thanks Nobu) - anchor(\G etc...) influenced outside of "|". (/a|\Gb/) -2002/11/30: [bug] [ruby-dev:18966] (thanks Nobu) - char-class(\S, [^\s] etc...) optimize map-info was wrong. -2002/11/29: [bug] infinite loop on NULL-pointer str search (regex_search()). - (thanks matz) -2002/11/29: [bug] change static -> extern (regex_chain_reduce()). -2002/11/29: [bug] change encoding to RegDefaultCharEncoding - in re_recompile_pattern(). (adapt to re.c) -2002/04/24: [spec] USE_ONIGURUMA_EXTENSION is disabled in default. -2002/04/24: [new] add searching time option: REG_OPTION_NOTBOL/NOTEOL. - add searching time option argument to regex_search() and - regex_match(). (prepare for POSIX API) -2002/04/20: [impl] divide regex.c file into regcomp.c, regexec.c, reggnu.c - and regint.h. -2002/04/09: [impl] move IS_MULTILINE() to outside of loop in OP_ANYCHAR_STAR. -2002/04/08: [impl] don't use OP_REPEAT operator for '??'. -2002/04/06: [impl] reduce redundant nested repeat operators(?,*,+,??,*?,+?). - ex. (?:a*)?, (?:a??)* etc.. -2002/04/06: [spec] should not warn for /(?:a?)+?/. -2002/04/04: [spec] should allow fixed length alternative and repeat pattern - in look-behind. ex. /(?<=(a|b){3})/ (thanks Guy Decoux) -2002/04/02: [spec] should warn for /(?:a+)?/ and /(?:a*)??/. (thanks akr) - -2002/04/01: Version 1.3 - -2002/04/01: [dist] add COPYING. -2002/03/30: [spec] warn redundant nested repeat operator - in Ruby verbose mode. ex. (?:a*)? -2002/03/30: [spec] nested repeat operator error check should be - same with GNU regex. (thanks Guy Decoux) -2002/03/30: [new] add \x{hexadecimal-wide-char}. (thanks matz) -2002/03/27: [bug] MBCTYPE_XXX symbol values should be same with GNU regex. -2002/03/27: [impl] add THREAD_ATOMIC to regex_clone(), regex_init(), regex_end(). -2002/03/25: [spec] if encoding is utf-8, allow combination of singlebyte and - multibyte code range in char class. - (cancelled 2002/04/01: for M17N compatibility) -2002/03/25: [dist] description of the license condition is added to README. -2002/03/23: [bug] should set all bits of reg->mem_stats, - if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY. -2002/03/23: [new] add a new option REG_OPTION_NOT_EMPTY. -2002/03/20: [spec] allow incompleted left brace as an usual char. - ex. /{/, /({)/, /a{2,3/ etc... -2002/03/20: [impl] serialize integer in bytecode. - (switch by UNALIGNED_WORD_ACCESS in regex.c) -2002/03/20: [impl] change re_mbcinit() for REG_RUBY_M17N. -2002/03/19: [impl] word alignment of char class multi-byte code ranges. -2002/03/19: [impl] replace OP_EXACTMB4N with OP_EXACTMB3N. -2002/03/19: [bug] OP_CCLASS_MB_NOT process in matchAt() is wrong. -2002/03/19: [new] add re_mbctab[] for Ruby extension library compatibility. -2002/03/19: [spec] allow nested repeat operator, if operator is {n,m} type. -2002/03/19: [new] add REG_IS_PATTERN_ERROR(ecode) in regex.h -2002/03/18: [spec] /[a-b-c]/ should be error. -2002/03/18: [bug] /[\w-a]/ should be error. (thanks Guy Decoux) -2002/03/18: [bug] /[\]/ should be error. (thanks Guy Decoux) -2002/03/18: [bug] /()*/ etc.. should not be error. (thanks Guy Decoux) -2002/03/18: [spec] /a{1}*/ should not be error. (thanks Guy Decoux) -2002/03/18: [bug] ab{2}{3} was interpreded to (?:a(?:b{2})){3} - (thanks Guy Decoux) -2002/03/18: [bug] abort /(?i)*a/ etc... (thanks Guy Decoux) -2002/03/18: [bug] abort /a|*/,/a|{1}/ etc... (thanks Guy Decoux) - -2002/03/13: Version 1.2 - -2002/03/13: [test] success in rubicon/builtin/AllBuiltinTests.rb. - (thanks rubicon) -2002/03/13: [bug] OP_EXACTMBN process in matchAt() is wrong. -2002/03/13: [bug] start argument of BackwardSearchRange() is wrong. -2002/03/12: [spec] change function name style from CamelCase - to underline_separation. (includes API) -2002/03/12: [bug] if pattern has nested null-check, cause infinite loop. - correct STACK_NULL_CHECK() macro. (thanks Guy Decoux) -2002/03/11: [bug] it is wrong that four numbers to continue as - an octal value in scanBackSlash(). ex. /\0111/ - (thanks matz) -2002/03/11: [new] \k (single-byte word char), \K (multi-byte char). -2002/03/09: [inst] add two targets to Makefile.in (166 and 172). -2002/03/09: [spec] decrease REG_MAX_BACKREF_NUM, REG_MAX_REPEAT_NUM - values. -2002/03/08: [spec] allow use of "\A"(begin-buf) in look-behind. -2002/03/08: [impl] add a new opcode OP_PUSH_IF_PEEK_NEXT. -2002/03/08: [impl] add a new opcode OP_ANYCHAR_STAR_PEEK_NEXT. -2002/03/07: [spec] prohibit use of capture group "(...)" - in negative look-behind. -2002/03/07: [inst] add configure.in, config.h.in, Makefile.in. -2002/03/07: [impl] call Init_REGEX_STAT() in RegexInit(). -2002/03/07: [spec] less length string match with negative look-behind. - ex. /(? -svn mkdir http://localhost/repos/branches -m "" -svn mkdir http://localhost/repos/branches/oniguruma -m "" -svn copy http://localhost/repos/trunk/oniguruma http://localhost/repos/branches/oniguruma/2.X -m "branch for 8-bit encodings only" - - -svn copy http://localhost/repos/trunk/oniguruma http://localhost/repos/tags/oniguruma/X.X.X -m "onigdXXXXXXXX" - - -cvs history -T - - -cvs rtag "VERSION_X_X_X" oniguruma diff --git a/ext/mbstring/oniguruma/README b/ext/mbstring/oniguruma/README deleted file mode 100644 index dc4fb3b64b838..0000000000000 --- a/ext/mbstring/oniguruma/README +++ /dev/null @@ -1,181 +0,0 @@ -README 2005/02/04 - -Oniguruma ---- (C) K.Kosako - -http://www.geocities.jp/kosako3/oniguruma/ -http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/ -http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/ - -Oniguruma is a regular expressions library. -The characteristics of this library is that different character encoding -for every regular expression object can be specified. - -Supported character encodings: - - ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, - EUC-JP, EUC-TW, EUC-KR, EUC-CN, - Shift_JIS, Big5, KOI8-R, KOI8 (*), - ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, - ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, - ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 - -* KOI8 is not included in library archive by default setup. - (need to edit Makefile if you want to use it.) ------------------------------------------------------------- - -Install - - Case 1: Unix and Cygwin platform - - 1. ./configure - 2. make - 3. make install - - library file: libonig.a - - test (ASCII/EUC-JP) - - make ctest - - uninstall - - make uninstall - - - - Case 2: Win32 platform (VC++) - - 1. copy win32\Makefile Makefile - 2. copy win32\config.h config.h - 3. nmake - - onig_s.lib: static link library - onig.dll: dynamic link library - - * test (ASCII/Shift_JIS) - 4. copy win32\testc.c testc.c - 5. nmake ctest - - - -License - - When this software is partly used or it is distributed with Ruby, - this of Ruby follows the license of Ruby. - It follows the BSD license in the case of the one except for it. - - - -Regular Expressions - - See doc/RE (or doc/RE.ja for Japanese). - - -Usage - - Include oniguruma.h in your program. (native API) - See doc/API for native API. - - If you want to use static link library(onig_s.lib) in Win32, - add option -DONIG_EXTERN=extern to C compiler. - - - -Sample Programs - - sample/simple.c example of the minimum (native API) - sample/names.c example of the named group callback. - sample/encode.c example of some encodings. - sample/listcap.c example of the capture history. - sample/posix.c POSIX API sample. - sample/sql.c example of the variable meta characters. - (SQL-like pattern matching) - sample/syntax.c Perl and Java syntax test. - - -Source Files - - oniguruma.h Oniguruma API header file. (public) - - regenc.h character encodings framework header file. - regint.h internal definitions - regparse.h internal definitions for regparse.c and regcomp.c - regcomp.c compiling and optimization functions - regenc.c character encodings framework. - regerror.c error message function - regext.c extended API functions. (deluxe version API) - regexec.c search and match functions - regparse.c parsing functions. - regsyntax.c pattern syntax functions and built-in syntax definitions. - regtrav.c capture history tree data traverse functions. - regversion.c version info function. - st.h hash table functions header file - st.c hash table functions - - oniggnu.h GNU regex API header file. (public) - reggnu.c GNU regex API functions - - onigposix.h POSIX API header file. (public) - regposerr.c POSIX error message function. - regposix.c POSIX API functions. - - enc/mktable.c character type table generator. - enc/ascii.c ASCII encoding. - enc/euc_jp.c EUC-JP encoding. - enc/euc_tw.c EUC-TW encoding. - enc/euc_kr.c EUC-KR, EUC-CN encoding. - enc/sjis.c Shift_JIS encoding. - enc/big5.c Big5 encoding. - enc/koi8.c KOI8 encoding. - enc/koi8_r.c KOI8-R encoding. - enc/iso8859_1.c ISO-8859-1 encoding. (Latin-1) - enc/iso8859_2.c ISO-8859-2 encoding. (Latin-2) - enc/iso8859_3.c ISO-8859-3 encoding. (Latin-3) - enc/iso8859_4.c ISO-8859-4 encoding. (Latin-4) - enc/iso8859_5.c ISO-8859-5 encoding. (Cyrillic) - enc/iso8859_6.c ISO-8859-6 encoding. (Arabic) - enc/iso8859_7.c ISO-8859-7 encoding. (Greek) - enc/iso8859_8.c ISO-8859-8 encoding. (Hebrew) - enc/iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish) - enc/iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic) - enc/iso8859_11.c ISO-8859-11 encoding. (Thai) - enc/iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim) - enc/iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic) - enc/iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro) - enc/iso8859_16.c ISO-8859-16 encoding. - (Latin-10 or South-Eastern European with Euro) - enc/utf8.c UTF-8 encoding. - enc/utf16_be.c UTF-16BE encoding. - enc/utf16_le.c UTF-16LE encoding. - enc/utf32_be.c UTF-32BE encoding. - enc/utf32_le.c UTF-32LE encoding. - enc/unicode.c Unicode information data. - - win32/Makefile Makefile for Win32 (VC++) - win32/config.h config.h for Win32 - - - -API differences with Japanized GNU regex(version 0.12) of Ruby 1.8/1.6 - - + re_compile_fastmap() is removed. - + re_recompile_pattern() is added. - + re_alloc_pattern() is added. - - -ToDo - - ? ignore case in full code point range of Unicode. - ? Unicode Property. - ? ambig-flag Katakana <-> Hiragana. - ? add ONIG_OPTION_NOTBOS/NOTEOS. (\A, \z, \Z) - ? add ONIG_SYNTAX_ASIS. - ?? \X (== \PM\pM*) - ?? implement syntax behavior ONIG_SYN_CONTEXT_INDEP_ANCHORS. - ?? variable line separator. - ?? transmission stopper. (return ONIG_STOP from match_at()) - -and I'm thankful to Akinori MUSHA. - - -Mail Address: K.Kosako diff --git a/ext/mbstring/oniguruma/README.ja b/ext/mbstring/oniguruma/README.ja deleted file mode 100644 index 44553abfefd6e..0000000000000 --- a/ext/mbstring/oniguruma/README.ja +++ /dev/null @@ -1,177 +0,0 @@ -README.ja 2005/02/04 - -µ´ĵÖ ---- (C) K.Kosako - -http://www.geocities.jp/kosako3/oniguruma/ -http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/ -http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/ - -µ´ĵÖ¤ÏÀµµĴɽ¸½é¤Öéê¤Ç¤˘¤ëĦ£ -¤³¤Îé¤Öéê¤ÎĈÄı¤ÏĦ˘¤½¤ì¤¤ì¤ÎÀµµĴɽ¸½ŞÖ¸§ŻÈ¤´¤È¤Ë -ʸğú¨ó³ĦĵÇ£ó°¤òğĜÄê¤Ç¤­¤ë¤³¤È¤Ç¤˘¤ëĦ£ - -µŬĦĵȤ·¤Ĉ¤¤¤ëʸğú¨ó³ĦĵÇ£ó°: - - ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, - EUC-JP, EUC-TW, EUC-KR, EUC-CN, - Shift_JIS, Big5, KOI8-R, KOI8 (*), - ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, - ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, - ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 - -* KOI8¤ÏÇĠİëȤÎğÈ˘×¤Ç¤Ïé¤Öéê¤Îĉ¤Ë´Ŝ¤Ŝ¤ì¤Ê¤¤Ħ£ - (ÉĴÍפǤ˘¤ì¤Makefile¤òÊÔ½¸¤ı¤ë¤³¤È) ------------------------------------------------------------- - -¤óıÈĦĵë - - ħĦĵı£ħ: Unix¤ÈCygwin´Äĥ­ - - 1. ./configure - 2. make - 3. make install - - é¤ÖéêĠĦ¤ë: libonig.a - - Ĉ°şîĈıÈ (ASCII/EUC-JP) - - make ctest - - ˘ó¤óıÈĦĵë - - make uninstall - - - - ħĦĵı£²: Win32(VC++)´Äĥ­ - - 1. copy win32\Makefile Makefile - 2. copy win32\config.h config.h - 3. nmake - - onig_s.lib: static link library - onig.dll: dynamic link library - - * Ĉ°şîĈıÈ (ASCII/Shift_JIS) - 4. copy win32\testc.c testc.c - 5. nmake ctest - - -é¤ğóı - - ¤³¤Î½ĠÈĤ§˘¤ĴRuby¤È°ì½ï¤ËğÈÍѤŜ¤ż¤ÏÇÛÉÛ¤µ¤ì¤ëìıç¤Ë¤ÏĦ˘ - Ruby¤Îé¤ğóı¤Ë½¤ĤĦ£ - ¤½¤ì°Ê³°¤Îìıç¤Ë¤ÏĦ˘BSDé¤ğóı¤Ë½¤ĤĦ£ - - -ÀµµĴɽ¸½ - - doc/RE.ja¤òğ²È - - -ğÈÍÑÊŭËĦ - - ğÈÍѤı¤ë×í°éà¤ÇĦ˘oniguruma.h¤ò¤óŻëĦĵɤı¤ë(Native API¤Îìıç)Ħ£ - Native API¤Ë¤Ä¤¤¤Ĉ¤ÏĦ˘doc/API.ja¤òğ²ÈĦ£ - - Win32¤ÇıżĈ£ŻêóŻé¤Öéê(onig_s.lib)¤òêóŻ¤ı¤ëìıç¤Ë¤ÏĦ˘ - ³óѤë¤ı¤ë¤È¤­¤Ë -DONIG_EXTERN=extern ¤ò³óѤë°úżô¤ËÄɲ¤ı¤ë¤³¤ÈĦ£ - - -ğÈÍÑÎ×í°éà - - sample/simple.c şÇÎ (native API) - sample/names.c ÌÁ°ÉĠ¤­°ëĦĵ׳ĦĵëŻğÈÍÑÎ - sample/encode.c ´ö¤Ä¤Ğ¤Îʸğú¨ó³ĦĵÇ£ó°ğÈÍÑÎ - sample/listcap.c Êá³ÍÍúÎòµĦǽ¤ÎğÈÍÑÎ - sample/posix.c POSIX APIğÈÍÑÎ - sample/sql.c ²ÄÊÑáżÊ¸ğúµĦǽğÈÍÑÎ (SQL-like ÑżĦĵó) - sample/syntax.c Perl¤ÈJavaʸËĦ¤ÎĈıÈ - - -½ĦĵıĠĦ¤ë - - oniguruma.h µ´ĵÖAPIĜÀ (¸ĝ³Ğ) - - regenc.h ʸğú¨ó³ĦĵÇ£ó°ÏÈÁȤßĜÀ - regint.h ĈâÉôÀë¸À - regparse.h regparse.c¤Èregcomp.c¤Î¤ż¤á¤ÎĈâÉôÀë¸À - regcomp.c ³óѤëĦ˘şÇĊĴ²½´Ĝżô - regenc.c ʸğú¨ó³ĦĵÇ£ó°ÏÈÁÈ¤ß - regerror.c ¨éĦĵáğĦĵ¸´Ĝżô - regext.c ³ÈÄAPI´Ĝżô - regexec.c ¸Ħş÷Ħ˘Èıç´Ĝżô - regparse.c ÀµµĴɽ¸½ÑżĦĵó²òÀÏ´Ĝżô - regsyntax.c ÀµµĴɽ¸½ÑżĦĵóʸËĦ´ĜżôĦ˘ÁÈıŝ¤ßʸËĦÄêµÁ - regtrav.c Êá³ÍÍúÎòÌÚ½ä²ó´Ĝżô - regversion.c ÈÇÊó´Ĝżô - st.h Ï·ċĈĦĵÖë´ĜżôÀë¸À - st.c Ï·ċĈĦĵÖë´Ĝżô - - oniggnu.h GNU regex APIĜÀ (¸ĝ³Ğ) - reggnu.c GNU regex API´Ĝżô - - onigposix.h POSIX APIĜÀ (¸ĝ³Ğ) - regposerr.c POSIX API¨éĦĵáğĦĵ¸´Ĝżô - regposix.c POSIX API´Ĝżô - - enc/mktable.c ʸğúż¤×ĈĦĵÖëÀ¸À×í°éà - enc/ascii.c ASCII ¨ó³ĦĵÇ£ó° - enc/euc_jp.c EUC-JP ¨ó³ĦĵÇ£ó° - enc/euc_tw.c EUC-TW ¨ó³ĦĵÇ£ó° - enc/euc_kr.c EUC-KR, EUC-CN ¨ó³ĦĵÇ£ó° - enc/sjis.c Shift_JIS ¨ó³ĦĵÇ£ó° - enc/big5.c Big5 ¨ó³ĦĵÇ£ó° - enc/koi8.c KOI8 ¨ó³ĦĵÇ£ó° - enc/koi8_r.c KOI8-R ¨ó³ĦĵÇ£ó° - enc/iso8859_1.c ISO-8859-1 (Latin-1) - enc/iso8859_2.c ISO-8859-2 (Latin-2) - enc/iso8859_3.c ISO-8859-3 (Latin-3) - enc/iso8859_4.c ISO-8859-4 (Latin-4) - enc/iso8859_5.c ISO-8859-5 (Cyrillic) - enc/iso8859_6.c ISO-8859-6 (Arabic) - enc/iso8859_7.c ISO-8859-7 (Greek) - enc/iso8859_8.c ISO-8859-8 (Hebrew) - enc/iso8859_9.c ISO-8859-9 (Latin-5 ¤Ŝ¤ż¤Ï Turkish) - enc/iso8859_10.c ISO-8859-10 (Latin-6 ¤Ŝ¤ż¤Ï Nordic) - enc/iso8859_11.c ISO-8859-11 (Thai) - enc/iso8859_13.c ISO-8859-13 (Latin-7 ¤Ŝ¤ż¤Ï Baltic Rim) - enc/iso8859_14.c ISO-8859-14 (Latin-8 ¤Ŝ¤ż¤Ï Celtic) - enc/iso8859_15.c ISO-8859-15 (Latin-9 ¤Ŝ¤ż¤Ï West European with Euro) - enc/iso8859_16.c ISO-8859-16 - (Latin-10 ¤Ŝ¤ż¤Ï South-Eastern European with Euro) - enc/utf8.c UTF-8 ¨ó³ĦĵÇ£ó° - enc/utf16_be.c UTF-16BE ¨ó³ĦĵÇ£ó° - enc/utf16_le.c UTF-16LE ¨ó³ĦĵÇ£ó° - enc/utf32_be.c UTF-32BE ¨ó³ĦĵÇ£ó° - enc/utf32_le.c UTF-32LE ¨ó³ĦĵÇ£ó° - enc/unicode.c UnicodeÊó - - win32/Makefile Win32ÍÑ Makefile (for VC++) - win32/config.h Win32ÍÑ config.h - - - -Ruby 1.8/1.6¤ÎĈüËܸ첽GNU regex¤È¤ÎAPI¤Î°¤¤ - - + re_compile_fastmap() ¤Ïşï½ü¤µ¤ì¤żĦ£ - + re_recompile_pattern() ¤ĴÄɲ¤µ¤ì¤żĦ£ - + re_alloc_pattern() ¤ĴÄɲ¤µ¤ì¤żĦ£ - - -ğÄ·ï - - ? UnicodeÁ´³ĦĵÉŬ¤óÈÎΰè¤Ç¤ÎÂçʸğúʸğúÈıç - ? Unicode×íÑĈ£ - ? ambig-flag Katakana <-> Hiragana - ? ONIG_OPTION_NOTBOS/NOTEOSÄɲ (\A, \z, \Z) - ? ONIG_SYNTAX_ASISÄɲ - ?? \X (== \PM\pM*) - ?? ʸËĦÍ×ÁÇ ONIG_SYN_CONTEXT_INDEP_ANCHORS¤ÎĵÂÁġ - ?? ²ŝıÔʸğú(ʸğúÎó)¤òÊÑıı¤Ç¤­¤ë - ?? ¸Ħş÷°ÌÖ°ÜĈ°ÄäğßħéğğğÒ (match_at()¤Ğ¤éONIG_STOP¤òÊÖ¤ı) - -and I'm thankful to Akinori MUSHA. - - -Mail Address: K.Kosako diff --git a/ext/mbstring/oniguruma/config.h.in b/ext/mbstring/oniguruma/config.h.in deleted file mode 100644 index 5ca2056fb396a..0000000000000 --- a/ext/mbstring/oniguruma/config.h.in +++ /dev/null @@ -1,69 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* The number of bytes in a int. */ -#undef SIZEOF_INT - -/* The number of bytes in a long. */ -#undef SIZEOF_LONG - -/* The number of bytes in a short. */ -#undef SIZEOF_SHORT - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIMES_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the function argument prototype */ -#undef HAVE_PROTOTYPES - -/* Define if you have the variable length prototypes and stdarg.h */ -#undef HAVE_STDARG_PROTOTYPES - diff --git a/ext/mbstring/oniguruma/enc/ascii.c b/ext/mbstring/oniguruma/enc/ascii.c deleted file mode 100644 index 64be21d7fff98..0000000000000 --- a/ext/mbstring/oniguruma/enc/ascii.c +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************** - ascii.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int -ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingASCII = { - onigenc_single_byte_mbc_enc_len, - "US-ASCII", /* name */ - 1, /* max byte length */ - 1, /* min byte length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - onigenc_ascii_mbc_to_normalize, - onigenc_ascii_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - ascii_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/big5.c b/ext/mbstring/oniguruma/enc/big5.c deleted file mode 100644 index 763872e963a00..0000000000000 --- a/ext/mbstring/oniguruma/enc/big5.c +++ /dev/null @@ -1,168 +0,0 @@ -/********************************************************************** - big5.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int EncLen_BIG5[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static int -big5_mbc_enc_len(const UChar* p) -{ - return EncLen_BIG5[*p]; -} - -static OnigCodePoint -big5_mbc_to_code(const UChar* p, const UChar* end) -{ - return onigenc_mbn_mbc_to_code(ONIG_ENCODING_BIG5, p, end); -} - -static int -big5_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - return onigenc_mb2_code_to_mbc(ONIG_ENCODING_BIG5, code, buf); -} - -static int -big5_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - return onigenc_mbn_mbc_to_normalize(ONIG_ENCODING_BIG5, flag, - pp, end, lower); -} - -static int -big5_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_BIG5, flag, pp, end); -} - -static int -big5_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - return onigenc_mb2_is_code_ctype(ONIG_ENCODING_BIG5, code, ctype); -} - -static const char BIG5_CAN_BE_TRAIL_TABLE[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 -}; - -#define BIG5_ISMB_FIRST(byte) (EncLen_BIG5[byte] > 1) -#define BIG5_ISMB_TRAIL(byte) BIG5_CAN_BE_TRAIL_TABLE[(byte)] - -static UChar* -big5_left_adjust_char_head(const UChar* start, const UChar* s) -{ - const UChar *p; - int len; - - if (s <= start) return (UChar* )s; - p = s; - - if (BIG5_ISMB_TRAIL(*p)) { - while (p > start) { - if (! BIG5_ISMB_FIRST(*--p)) { - p++; - break; - } - } - } - len = enc_len(ONIG_ENCODING_BIG5, p); - if (p + len > s) return (UChar* )p; - p += len; - return (UChar* )(p + ((s - p) & ~1)); -} - -static int -big5_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - const UChar c = *s; - - return (BIG5_ISMB_TRAIL(c) ? FALSE : TRUE); -} - -OnigEncodingType OnigEncodingBIG5 = { - big5_mbc_enc_len, - "Big5", /* name */ - 2, /* max enc length */ - 1, /* min enc length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - big5_mbc_to_code, - onigenc_mb2_code_to_mbclen, - big5_code_to_mbc, - big5_mbc_to_normalize, - big5_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - big5_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - big5_left_adjust_char_head, - big5_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/euc_jp.c b/ext/mbstring/oniguruma/enc/euc_jp.c deleted file mode 100644 index 5f13e33eb4c0c..0000000000000 --- a/ext/mbstring/oniguruma/enc/euc_jp.c +++ /dev/null @@ -1,232 +0,0 @@ -/********************************************************************** - euc_jp.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1) - -static int EncLen_EUCJP[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static int -eucjp_mbc_enc_len(const UChar* p) -{ - return EncLen_EUCJP[*p]; -} - -static OnigCodePoint -eucjp_mbc_to_code(const UChar* p, const UChar* end) -{ - int c, i, len; - OnigCodePoint n; - - len = enc_len(ONIG_ENCODING_EUC_JP, p); - n = (OnigCodePoint )*p++; - if (len == 1) return n; - - for (i = 1; i < len; i++) { - if (p >= end) break; - c = *p++; - n <<= 8; n += c; - } - return n; -} - -static int -eucjp_code_to_mbclen(OnigCodePoint code) -{ - if (ONIGENC_IS_CODE_ASCII(code)) return 1; - else if ((code & 0xff0000) != 0) return 3; - else if ((code & 0xff00) != 0) return 2; - else return 0; -} - -#if 0 -static int -eucjp_code_to_mbc_first(OnigCodePoint code) -{ - int first; - - if ((code & 0xff0000) != 0) { - first = (code >> 16) & 0xff; - } - else if ((code & 0xff00) != 0) { - first = (code >> 8) & 0xff; - } - else { - return (int )code; - } - return first; -} -#endif - -static int -eucjp_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar *p = buf; - - if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff)); - if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff)); - *p++ = (UChar )(code & 0xff); - -#if 1 - if (enc_len(ONIG_ENCODING_EUC_JP, buf) != (p - buf)) - return ONIGENCERR_INVALID_WIDE_CHAR_VALUE; -#endif - return p - buf; -} - -static int -eucjp_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - int len; - const UChar* p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - - (*pp)++; - return 1; - } - else { - len = enc_len(ONIG_ENCODING_EUC_JP, p); - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -eucjp_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_JP, flag, pp, end); -} - -static int -eucjp_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return (eucjp_code_to_mbclen(code) > 1 ? TRUE : FALSE); - - ctype &= ~ONIGENC_CTYPE_WORD; - if (ctype == 0) return FALSE; - } - - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -static UChar* -eucjp_left_adjust_char_head(const UChar* start, const UChar* s) -{ - /* In this encoding - mb-trail bytes doesn't mix with single bytes. - */ - const UChar *p; - int len; - - if (s <= start) return (UChar* )s; - p = s; - - while (!eucjp_islead(*p) && p > start) p--; - len = enc_len(ONIG_ENCODING_EUC_JP, p); - if (p + len > s) return (UChar* )p; - p += len; - return (UChar* )(p + ((s - p) & ~1)); -} - -static int -eucjp_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - const UChar c = *s; - if (c <= 0x7e || c == 0x8e || c == 0x8f) - return TRUE; - else - return FALSE; -} - -OnigEncodingType OnigEncodingEUC_JP = { - eucjp_mbc_enc_len, - "EUC-JP", /* name */ - 3, /* max enc length */ - 1, /* min enc length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - eucjp_mbc_to_code, - eucjp_code_to_mbclen, - eucjp_code_to_mbc, - eucjp_mbc_to_normalize, - eucjp_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - eucjp_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - eucjp_left_adjust_char_head, - eucjp_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/euc_kr.c b/ext/mbstring/oniguruma/enc/euc_kr.c deleted file mode 100644 index c1e83b7e66024..0000000000000 --- a/ext/mbstring/oniguruma/enc/euc_kr.c +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************** - euc_kr.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int EncLen_EUCKR[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static int -euckr_mbc_enc_len(const UChar* p) -{ - return EncLen_EUCKR[*p]; -} - -static OnigCodePoint -euckr_mbc_to_code(const UChar* p, const UChar* end) -{ - return onigenc_mbn_mbc_to_code(ONIG_ENCODING_EUC_KR, p, end); -} - -static int -euckr_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - return onigenc_mb2_code_to_mbc(ONIG_ENCODING_EUC_KR, code, buf); -} - -static int -euckr_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - return onigenc_mbn_mbc_to_normalize(ONIG_ENCODING_EUC_KR, flag, - pp, end, lower); -} - -static int -euckr_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_KR, flag, pp, end); -} - -static int -euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - return onigenc_mb2_is_code_ctype(ONIG_ENCODING_EUC_KR, code, ctype); -} - -#define euckr_islead(c) ((c) < 0xa1 || (c) == 0xff) - -static UChar* -euckr_left_adjust_char_head(const UChar* start, const UChar* s) -{ - /* Assumed in this encoding, - mb-trail bytes don't mix with single bytes. - */ - const UChar *p; - int len; - - if (s <= start) return (UChar* )s; - p = s; - - while (!euckr_islead(*p) && p > start) p--; - len = enc_len(ONIG_ENCODING_EUC_KR, p); - if (p + len > s) return (UChar* )p; - p += len; - return (UChar* )(p + ((s - p) & ~1)); -} - -static int -euckr_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - const UChar c = *s; - if (c <= 0x7e) return TRUE; - else return FALSE; -} - -OnigEncodingType OnigEncodingEUC_KR = { - euckr_mbc_enc_len, - "EUC-KR", /* name */ - 2, /* max enc length */ - 1, /* min enc length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - euckr_mbc_to_code, - onigenc_mb2_code_to_mbclen, - euckr_code_to_mbc, - euckr_mbc_to_normalize, - euckr_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - euckr_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - euckr_left_adjust_char_head, - euckr_is_allowed_reverse_match -}; - -/* Same with OnigEncodingEUC_KR except the name */ -OnigEncodingType OnigEncodingEUC_CN = { - euckr_mbc_enc_len, - "EUC-CN", /* name */ - 2, /* max enc length */ - 1, /* min enc length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - euckr_mbc_to_code, - onigenc_mb2_code_to_mbclen, - euckr_code_to_mbc, - euckr_mbc_to_normalize, - euckr_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - euckr_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - euckr_left_adjust_char_head, - euckr_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/euc_tw.c b/ext/mbstring/oniguruma/enc/euc_tw.c deleted file mode 100644 index 4e5851a45158d..0000000000000 --- a/ext/mbstring/oniguruma/enc/euc_tw.c +++ /dev/null @@ -1,144 +0,0 @@ -/********************************************************************** - euc_tw.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int EncLen_EUCTW[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -static int -euctw_mbc_enc_len(const UChar* p) -{ - return EncLen_EUCTW[*p]; -} - -static OnigCodePoint -euctw_mbc_to_code(const UChar* p, const UChar* end) -{ - return onigenc_mbn_mbc_to_code(ONIG_ENCODING_EUC_TW, p, end); -} - -static int -euctw_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - return onigenc_mb4_code_to_mbc(ONIG_ENCODING_EUC_TW, code, buf); -} - -static int -euctw_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - return onigenc_mbn_mbc_to_normalize(ONIG_ENCODING_EUC_TW, flag, - pp, end, lower); -} - -static int -euctw_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_TW, flag, pp, end); -} - -static int -euctw_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - return onigenc_mb4_is_code_ctype(ONIG_ENCODING_EUC_TW, code, ctype); -} - -#define euctw_islead(c) (((c) < 0xa1 && (c) != 0x8e) || (c) == 0xff) - -static UChar* -euctw_left_adjust_char_head(const UChar* start, const UChar* s) -{ - /* Assumed in this encoding, - mb-trail bytes don't mix with single bytes. - */ - const UChar *p; - int len; - - if (s <= start) return (UChar* )s; - p = s; - - while (!euctw_islead(*p) && p > start) p--; - len = enc_len(ONIG_ENCODING_EUC_TW, p); - if (p + len > s) return (UChar* )p; - p += len; - return (UChar* )(p + ((s - p) & ~1)); -} - -static int -euctw_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - const UChar c = *s; - if (c <= 0x7e) return TRUE; - else return FALSE; -} - -OnigEncodingType OnigEncodingEUC_TW = { - euctw_mbc_enc_len, - "EUC-TW", /* name */ - 4, /* max enc length */ - 1, /* min enc length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - euctw_mbc_to_code, - onigenc_mb4_code_to_mbclen, - euctw_code_to_mbc, - euctw_mbc_to_normalize, - euctw_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - euctw_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - euctw_left_adjust_char_head, - euctw_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_1.c b/ext/mbstring/oniguruma/enc/iso8859_1.c deleted file mode 100644 index 53ad52ee13d6b..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_1.c +++ /dev/null @@ -1,178 +0,0 @@ -/********************************************************************** - iso8859_1.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \ - ((EncISO_8859_1_CtypeTable[code] & ctype) != 0) - -static unsigned short EncISO_8859_1_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x00a0, 0x01a0, - 0x00a0, 0x10a0, 0x10e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_1_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_1_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_1_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (*p == 0xdf || (*p >= 0xaa && *p <= 0xba)) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_1_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_1_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingISO_8859_1 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-1", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_1_mbc_to_normalize, - iso_8859_1_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_1_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_10.c b/ext/mbstring/oniguruma/enc/iso8859_10.c deleted file mode 100644 index a9331cebf35eb..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_10.c +++ /dev/null @@ -1,327 +0,0 @@ -/********************************************************************** - iso8859_10.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_10_TO_LOWER_CASE(c) EncISO_8859_10_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_10_CTYPE(code,ctype) \ - ((EncISO_8859_10_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_10_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\261', '\262', '\263', '\264', '\265', '\266', '\247', - '\270', '\271', '\272', '\273', '\274', '\255', '\276', '\277', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_10_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x14a2, 0x14a2, - 0x00a0, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x01a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x01a0, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_10_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_10_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_10_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_10_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf is lower case letter, but can't convert. */ - if (*p == 0xdf) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_10_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_10_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_10_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xb1 }, - { 0xa2, 0xb2 }, - { 0xa3, 0xb3 }, - { 0xa4, 0xb4 }, - { 0xa5, 0xb5 }, - { 0xa6, 0xb6 }, - { 0xa8, 0xb8 }, - { 0xa9, 0xb9 }, - { 0xaa, 0xba }, - { 0xab, 0xbb }, - { 0xac, 0xbc }, - { 0xae, 0xbe }, - { 0xaf, 0xbf }, - - { 0xb1, 0xa1 }, - { 0xb2, 0xa2 }, - { 0xb3, 0xa3 }, - { 0xb4, 0xa4 }, - { 0xb5, 0xa5 }, - { 0xb6, 0xa6 }, - { 0xb8, 0xa8 }, - { 0xb9, 0xa9 }, - { 0xba, 0xaa }, - { 0xbb, 0xab }, - { 0xbc, 0xac }, - { 0xbe, 0xae }, - { 0xbf, 0xaf }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_10 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-10", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_10_mbc_to_normalize, - iso_8859_10_is_mbc_ambiguous, - iso_8859_10_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_10_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_11.c b/ext/mbstring/oniguruma/enc/iso8859_11.c deleted file mode 100644 index bb1098807ac2d..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_11.c +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - iso8859_11.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_IS_ISO_8859_11_CTYPE(code,ctype) \ - ((EncISO_8859_11_CtypeTable[code] & ctype) != 0) - -static unsigned short EncISO_8859_11_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static int -iso_8859_11_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_11_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingISO_8859_11 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-11", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - ( ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - onigenc_ascii_mbc_to_normalize, - onigenc_ascii_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - iso_8859_11_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_13.c b/ext/mbstring/oniguruma/enc/iso8859_13.c deleted file mode 100644 index 827ca508e8b92..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_13.c +++ /dev/null @@ -1,297 +0,0 @@ -/********************************************************************** - iso8859_13.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \ - ((EncISO_8859_13_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_13_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\270', '\251', '\272', '\253', '\254', '\255', '\256', '\277', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_13_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, - 0x14a2, 0x00a0, 0x14a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x14a2, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x01a0, 0x10e2, 0x00a0, 0x01a0, - 0x10e2, 0x10a0, 0x10e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x01a0 -}; - -static int -iso_8859_13_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_13_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_13_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_13_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf, 0xb5 are lower case letter, but can't convert. */ - if (*p == 0xdf || *p == 0xb5) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_13_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_13_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_13_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_13 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-13", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_13_mbc_to_normalize, - iso_8859_13_is_mbc_ambiguous, - iso_8859_13_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_13_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_14.c b/ext/mbstring/oniguruma/enc/iso8859_14.c deleted file mode 100644 index 4fe5ab29d1ef0..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_14.c +++ /dev/null @@ -1,327 +0,0 @@ -/********************************************************************** - iso8859_14.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_14_TO_LOWER_CASE(c) EncISO_8859_14_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_14_CTYPE(code,ctype) \ - ((EncISO_8859_14_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_14_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\242', '\242', '\243', '\245', '\245', '\253', '\247', - '\270', '\251', '\272', '\253', '\274', '\255', '\256', '\377', - '\261', '\261', '\263', '\263', '\265', '\265', '\266', '\271', - '\270', '\271', '\272', '\277', '\274', '\276', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_14_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x10e2, 0x00a0, 0x14a2, 0x10e2, 0x14a2, 0x00a0, - 0x14a2, 0x00a0, 0x14a2, 0x10e2, 0x14a2, 0x01a0, 0x00a0, 0x14a2, - 0x14a2, 0x10e2, 0x14a2, 0x10e2, 0x14a2, 0x10e2, 0x00a0, 0x14a2, - 0x10e2, 0x10e2, 0x10e2, 0x14a2, 0x10e2, 0x14a2, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_14_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_14_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_14_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_14_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf is lower case letter, but can't convert. */ - if (*p == 0xdf) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_14_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_14_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_14_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xa2 }, - { 0xa2, 0xa1 }, - { 0xa4, 0xa5 }, - { 0xa5, 0xa4 }, - { 0xa6, 0xab }, - { 0xa8, 0xb8 }, - { 0xaa, 0xba }, - { 0xab, 0xa6 }, - { 0xac, 0xbc }, - { 0xaf, 0xff }, - - { 0xb0, 0xb1 }, - { 0xb1, 0xb0 }, - { 0xb2, 0xb3 }, - { 0xb3, 0xb2 }, - { 0xb4, 0xb5 }, - { 0xb5, 0xb4 }, - { 0xb7, 0xb9 }, - { 0xb8, 0xa8 }, - { 0xb9, 0xb7 }, - { 0xba, 0xaa }, - { 0xbb, 0xbf }, - { 0xbc, 0xac }, - { 0xbd, 0xbe }, - { 0xbe, 0xbd }, - { 0xbf, 0xbb }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde }, - { 0xff, 0xaf } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_14 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-14", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_14_mbc_to_normalize, - iso_8859_14_is_mbc_ambiguous, - iso_8859_14_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_14_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_15.c b/ext/mbstring/oniguruma/enc/iso8859_15.c deleted file mode 100644 index 1a8bd7b4c5bc8..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_15.c +++ /dev/null @@ -1,307 +0,0 @@ -/********************************************************************** - iso8859_15.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_15_TO_LOWER_CASE(c) EncISO_8859_15_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_15_CTYPE(code,ctype) \ - ((EncISO_8859_15_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_15_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\250', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\270', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\275', '\275', '\377', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_15_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x14a2, 0x00a0, - 0x10e2, 0x00a0, 0x10e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x14a2, 0x10e2, 0x00a0, 0x01a0, - 0x10e2, 0x10a0, 0x10e2, 0x01a0, 0x14a2, 0x10e2, 0x14a2, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_15_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_15_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_15_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_15_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf etc.. are lower case letter, but can't convert. */ - if (*p == 0xdf || *p == 0xaa || *p == 0xb5 || *p == 0xba) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_15_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_15_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_15_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa6, 0xa8 }, - { 0xa8, 0xa6 }, - - { 0xb4, 0xb8 }, - { 0xb8, 0xb4 }, - { 0xbc, 0xbd }, - { 0xbd, 0xbc }, - { 0xbe, 0xff }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde }, - { 0xff, 0xbe } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_15 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-15", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_15_mbc_to_normalize, - iso_8859_15_is_mbc_ambiguous, - iso_8859_15_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_15_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_16.c b/ext/mbstring/oniguruma/enc/iso8859_16.c deleted file mode 100644 index e283db17ccf60..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_16.c +++ /dev/null @@ -1,321 +0,0 @@ -/********************************************************************** - iso8859_16.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_16_TO_LOWER_CASE(c) EncISO_8859_16_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_16_CTYPE(code,ctype) \ - ((EncISO_8859_16_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_16_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\242', '\242', '\263', '\245', '\245', '\250', '\247', - '\250', '\251', '\272', '\253', '\256', '\255', '\256', '\277', - '\260', '\261', '\271', '\263', '\270', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\275', '\275', '\377', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_16_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x10e2, 0x14a2, 0x00a0, 0x01a0, 0x14a2, 0x00a0, - 0x10e2, 0x00a0, 0x14a2, 0x01a0, 0x14a2, 0x01a0, 0x10e2, 0x14a2, - 0x00a0, 0x00a0, 0x14a2, 0x10e2, 0x14a2, 0x01a0, 0x00a0, 0x01a0, - 0x10e2, 0x10e2, 0x10e2, 0x01a0, 0x14a2, 0x10e2, 0x14a2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_16_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_16_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_16_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_16_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf is lower case letter, but can't convert. */ - if (*p == 0xdf) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_16_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_16_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_16_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xa2 }, - { 0xa2, 0xa1 }, - { 0xa3, 0xb3 }, - { 0xa6, 0xa8 }, - { 0xa8, 0xa6 }, - { 0xaa, 0xba }, - { 0xac, 0xae }, - { 0xae, 0xac }, - { 0xaf, 0xbf }, - - { 0xb2, 0xb9 }, - { 0xb3, 0xa3 }, - { 0xb4, 0xb8 }, - { 0xb8, 0xb4 }, - { 0xb9, 0xb2 }, - { 0xba, 0xaa }, - { 0xbc, 0xbd }, - { 0xbd, 0xbc }, - { 0xbe, 0xff }, - { 0xbf, 0xaf }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde }, - { 0xff, 0xbe } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_16 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-16", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_16_mbc_to_normalize, - iso_8859_16_is_mbc_ambiguous, - iso_8859_16_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_16_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_2.c b/ext/mbstring/oniguruma/enc/iso8859_2.c deleted file mode 100644 index e86415b9c9631..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_2.c +++ /dev/null @@ -1,319 +0,0 @@ -/********************************************************************** - iso8859_2.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \ - ((EncISO_8859_2_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_2_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\261', '\242', '\263', '\244', '\265', '\266', '\247', - '\250', '\271', '\272', '\273', '\274', '\255', '\276', '\277', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_2_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x00a0, 0x14a2, 0x00a0, 0x14a2, 0x14a2, 0x00a0, - 0x00a0, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x14a2, 0x14a2, - 0x00a0, 0x10e2, 0x00a0, 0x10e2, 0x00a0, 0x10e2, 0x10e2, 0x00a0, - 0x00a0, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0 -}; - -static int -iso_8859_2_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_2_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_2_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_2_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf is lower case letter, but can't convert. */ - if (*p == 0xdf) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_2_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xb1 }, - { 0xa3, 0xb3 }, - { 0xa5, 0xb5 }, - { 0xa6, 0xb6 }, - { 0xa9, 0xb9 }, - { 0xaa, 0xba }, - { 0xab, 0xbb }, - { 0xac, 0xbc }, - { 0xae, 0xbe }, - { 0xaf, 0xbf }, - - { 0xb1, 0xa1 }, - { 0xb3, 0xa3 }, - { 0xb5, 0xa5 }, - { 0xb6, 0xa6 }, - { 0xb9, 0xa9 }, - { 0xba, 0xaa }, - { 0xbb, 0xab }, - { 0xbc, 0xac }, - { 0xbe, 0xae }, - { 0xbf, 0xaf }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -static int -iso_8859_2_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_2_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingISO_8859_2 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-2", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_2_mbc_to_normalize, - iso_8859_2_is_mbc_ambiguous, - iso_8859_2_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_2_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_3.c b/ext/mbstring/oniguruma/enc/iso8859_3.c deleted file mode 100644 index 76d2bec8a8766..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_3.c +++ /dev/null @@ -1,308 +0,0 @@ -/********************************************************************** - iso8859_3.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_3_TO_LOWER_CASE(c) EncISO_8859_3_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_3_CTYPE(code,ctype) \ - ((EncISO_8859_3_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_3_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\261', '\242', '\243', '\244', '\245', '\266', '\247', - '\250', '\271', '\272', '\273', '\274', '\255', '\256', '\277', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\303', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\320', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_3_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x00a0, 0x00a0, 0x00a0, 0x0000, 0x14a2, 0x00a0, - 0x00a0, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x0000, 0x14a2, - 0x00a0, 0x10e2, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x10e2, 0x01a0, - 0x00a0, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x11a0, 0x0000, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x0000, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x0000, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x0000, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x0000, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0 -}; - -static int -iso_8859_3_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_3_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_3_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_3_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (*p == 0xdf || *p == 0xb5) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_3_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_3_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_3_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xb1 }, - { 0xa6, 0xb6 }, - { 0xa9, 0xb9 }, - { 0xaa, 0xba }, - { 0xab, 0xbb }, - { 0xac, 0xbc }, - { 0xaf, 0xbf }, - { 0xb1, 0xa1 }, - { 0xb6, 0xa6 }, - { 0xb9, 0xa9 }, - { 0xba, 0xaa }, - { 0xbb, 0xab }, - { 0xbc, 0xac }, - { 0xbf, 0xaf }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_3 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-3", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_3_mbc_to_normalize, - iso_8859_3_is_mbc_ambiguous, - iso_8859_3_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_3_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_4.c b/ext/mbstring/oniguruma/enc/iso8859_4.c deleted file mode 100644 index 7569006725c7f..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_4.c +++ /dev/null @@ -1,317 +0,0 @@ -/********************************************************************** - iso8859_4.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_4_TO_LOWER_CASE(c) EncISO_8859_4_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_4_CTYPE(code,ctype) \ - ((EncISO_8859_4_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_4_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\261', '\242', '\263', '\244', '\265', '\266', '\247', - '\250', '\271', '\272', '\273', '\274', '\255', '\276', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\277', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_4_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x10e2, 0x14a2, 0x00a0, 0x14a2, 0x14a2, 0x00a0, - 0x00a0, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x14a2, 0x00a0, - 0x00a0, 0x10e2, 0x00a0, 0x10e2, 0x00a0, 0x10e2, 0x10e2, 0x00a0, - 0x00a0, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x14a2, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0 -}; - -static int -iso_8859_4_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_4_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_4_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_4_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (*p == 0xdf || *p == 0xa2) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_4_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_4_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_4_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xb1 }, - { 0xa3, 0xb3 }, - { 0xa5, 0xb5 }, - { 0xa6, 0xb6 }, - { 0xa9, 0xb9 }, - { 0xaa, 0xba }, - { 0xab, 0xbb }, - { 0xac, 0xbc }, - { 0xae, 0xbe }, - - { 0xb1, 0xa1 }, - { 0xb3, 0xa3 }, - { 0xb5, 0xa5 }, - { 0xb6, 0xa6 }, - { 0xb9, 0xa9 }, - { 0xba, 0xaa }, - { 0xbb, 0xab }, - { 0xbc, 0xac }, - { 0xbe, 0xae }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_4 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-4", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_4_mbc_to_normalize, - iso_8859_4_is_mbc_ambiguous, - iso_8859_4_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_4_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_5.c b/ext/mbstring/oniguruma/enc/iso8859_5.c deleted file mode 100644 index 2f7677b3e7a9d..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_5.c +++ /dev/null @@ -1,296 +0,0 @@ -/********************************************************************** - iso8859_5.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_5_TO_LOWER_CASE(c) EncISO_8859_5_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_5_CTYPE(code,ctype) \ - ((EncISO_8859_5_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_5_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\255', '\376', '\377', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_5_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x00a0, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, 0x10e2, 0x10e2 -}; - -static int -iso_8859_5_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_5_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_5_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_5_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_5_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_5_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_5_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xa1, 0xf1 }, - { 0xa2, 0xf2 }, - { 0xa3, 0xf3 }, - { 0xa4, 0xf4 }, - { 0xa5, 0xf5 }, - { 0xa6, 0xf6 }, - { 0xa7, 0xf7 }, - { 0xa8, 0xf8 }, - { 0xa9, 0xf9 }, - { 0xaa, 0xfa }, - { 0xab, 0xfb }, - { 0xac, 0xfc }, - { 0xae, 0xfe }, - { 0xaf, 0xff }, - - { 0xb0, 0xd0 }, - { 0xb1, 0xd1 }, - { 0xb2, 0xd2 }, - { 0xb3, 0xd3 }, - { 0xb4, 0xd4 }, - { 0xb5, 0xd5 }, - { 0xb6, 0xd6 }, - { 0xb7, 0xd7 }, - { 0xb8, 0xd8 }, - { 0xb9, 0xd9 }, - { 0xba, 0xda }, - { 0xbb, 0xdb }, - { 0xbc, 0xdc }, - { 0xbd, 0xdd }, - { 0xbe, 0xdf }, - { 0xbf, 0xdf }, - - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xb0 }, - { 0xd1, 0xb1 }, - { 0xd2, 0xb2 }, - { 0xd3, 0xb3 }, - { 0xd4, 0xb4 }, - { 0xd5, 0xb5 }, - { 0xd6, 0xb6 }, - { 0xd7, 0xb7 }, - { 0xd8, 0xb8 }, - { 0xd9, 0xb9 }, - { 0xda, 0xba }, - { 0xdb, 0xbb }, - { 0xdc, 0xbc }, - { 0xdd, 0xbd }, - { 0xde, 0xbe }, - { 0xdf, 0xbf }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf1, 0xa1 }, - { 0xf2, 0xa2 }, - { 0xf3, 0xa3 }, - { 0xf4, 0xa4 }, - { 0xf5, 0xa5 }, - { 0xf6, 0xa6 }, - { 0xf7, 0xa7 }, - { 0xf8, 0xa8 }, - { 0xf9, 0xa9 }, - { 0xfa, 0xaa }, - { 0xfb, 0xab }, - { 0xfc, 0xac }, - { 0xfe, 0xae }, - { 0xff, 0xaf } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_5 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-5", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_5_mbc_to_normalize, - iso_8859_5_is_mbc_ambiguous, - iso_8859_5_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - iso_8859_5_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_6.c b/ext/mbstring/oniguruma/enc/iso8859_6.c deleted file mode 100644 index 0fcb9e8b83633..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_6.c +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - iso8859_6.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_IS_ISO_8859_6_CTYPE(code,ctype) \ - ((EncISO_8859_6_CtypeTable[code] & ctype) != 0) - -static unsigned short EncISO_8859_6_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x0000, 0x0000, 0x0000, 0x00a0, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, 0x01a0, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x01a0, 0x0000, 0x0000, 0x0000, 0x01a0, - 0x0000, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static int -iso_8859_6_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_6_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingISO_8859_6 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-6", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - ( ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - onigenc_ascii_mbc_to_normalize, - onigenc_ascii_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - iso_8859_6_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_7.c b/ext/mbstring/oniguruma/enc/iso8859_7.c deleted file mode 100644 index 8b2cb9ec59210..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_7.c +++ /dev/null @@ -1,278 +0,0 @@ -/********************************************************************** - iso8859_7.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_7_TO_LOWER_CASE(c) EncISO_8859_7_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_7_CTYPE(code,ctype) \ - ((EncISO_8859_7_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_7_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\334', '\267', - '\335', '\336', '\337', '\273', '\374', '\275', '\375', '\376', - '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\322', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_7_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x01a0, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x0000, 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x00a0, 0x14a2, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x01a0, 0x14a2, 0x10a0, 0x14a2, 0x14a2, - 0x10e2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x0000, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x0000 -}; - -static int -iso_8859_7_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_7_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_7_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_7_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - if (*p == 0xc0 || *p == 0xe0) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_7_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_7_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_7_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xb6, 0xdc }, - { 0xb8, 0xdd }, - { 0xb9, 0xde }, - { 0xba, 0xdf }, - { 0xbc, 0xfc }, - { 0xbe, 0xfd }, - { 0xbf, 0xfe }, - - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xb6 }, - { 0xdd, 0xb8 }, - { 0xde, 0xb9 }, - { 0xdf, 0xba }, - - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xbc }, - { 0xfd, 0xbe }, - { 0xfe, 0xbf } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_7 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-7", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_7_mbc_to_normalize, - iso_8859_7_is_mbc_ambiguous, - iso_8859_7_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - iso_8859_7_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_8.c b/ext/mbstring/oniguruma/enc/iso8859_8.c deleted file mode 100644 index 3c95b9b1375e5..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_8.c +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - iso8859_8.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_IS_ISO_8859_8_CTYPE(code,ctype) \ - ((EncISO_8859_8_CtypeTable[code] & ctype) != 0) - -static unsigned short EncISO_8859_8_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x00a0, 0x01a0, - 0x00a0, 0x10a0, 0x00a0, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, 0x10a2, - 0x10a2, 0x10a2, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static int -iso_8859_8_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_8_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingISO_8859_8 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-8", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - ( ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - onigenc_ascii_mbc_to_normalize, - onigenc_ascii_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - iso_8859_8_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/iso8859_9.c b/ext/mbstring/oniguruma/enc/iso8859_9.c deleted file mode 100644 index 1b061ff6ea799..0000000000000 --- a/ext/mbstring/oniguruma/enc/iso8859_9.c +++ /dev/null @@ -1,297 +0,0 @@ -/********************************************************************** - iso8859_9.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \ - ((EncISO_8859_9_CtypeTable[code] & ctype) != 0) - -static UChar EncISO_8859_9_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\335', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -static unsigned short EncISO_8859_9_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x00a0, 0x01a0, - 0x00a0, 0x10a0, 0x10e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static int -iso_8859_9_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (end > p + 1 && (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - *lower = 0xdf; - (*pp) += 2; - return 1; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_ISO_8859_9_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -iso_8859_9_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 1) { - if ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S'))) { - (*pp) += 2; - return TRUE; - } - } - - if (*p == 0xdf) { - (*pp)++; - return TRUE; - } - } - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncISO_8859_9_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xdf etc.. are lower case letter, but can't convert. */ - if (*p == 0xdf || (*p >= 0xaa && *p <= 0xba)) - return FALSE; - else - return TRUE; - } - - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -iso_8859_9_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_ISO_8859_9_CTYPE(code, ctype); - else - return FALSE; -} - -static int -iso_8859_9_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingISO_8859_9 = { - onigenc_single_byte_mbc_enc_len, - "ISO-8859-9", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - iso_8859_9_mbc_to_normalize, - iso_8859_9_is_mbc_ambiguous, - iso_8859_9_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - iso_8859_9_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/koi8.c b/ext/mbstring/oniguruma/enc/koi8.c deleted file mode 100644 index f8a5a1da617fd..0000000000000 --- a/ext/mbstring/oniguruma/enc/koi8.c +++ /dev/null @@ -1,264 +0,0 @@ -/********************************************************************** - koi8.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_KOI8_TO_LOWER_CASE(c) EncKOI8_ToLowerCaseTable[c] -#define ENC_IS_KOI8_CTYPE(code,ctype) \ - ((EncKOI8_CtypeTable[code] & ctype) != 0) - -static UChar EncKOI8_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337' -}; - -static unsigned short EncKOI8_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2 -}; - -static int -koi8_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - UChar* p = (UChar *)*pp; - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_KOI8_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -koi8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - UChar* p = (UChar *)*pp; - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncKOI8_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - - -static int -koi8_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_KOI8_CTYPE(code, ctype); - else - return FALSE; -} - -static int -koi8_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - { 0xdf, 0xff }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfe, 0xde }, - { 0xff, 0xdf } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingKOI8 = { - onigenc_single_byte_mbc_enc_len, - "KOI8", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - koi8_mbc_to_normalize, - koi8_is_mbc_ambiguous, - koi8_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - koi8_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/koi8_r.c b/ext/mbstring/oniguruma/enc/koi8_r.c deleted file mode 100644 index 7c626df61615c..0000000000000 --- a/ext/mbstring/oniguruma/enc/koi8_r.c +++ /dev/null @@ -1,263 +0,0 @@ -/********************************************************************** - koi8_r.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define ENC_KOI8_R_TO_LOWER_CASE(c) EncKOI8_R_ToLowerCaseTable[c] -#define ENC_IS_KOI8_R_CTYPE(code,ctype) \ - ((EncKOI8_R_CtypeTable[code] & ctype) != 0) - -static UChar EncKOI8_R_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\243', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337' -}; - -static unsigned short EncKOI8_R_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x20a0, 0x20a0, 0x20a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x20a0, 0x31a0, - 0x20a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x20a0, 0x21a0, 0x20a0, 0x2008, - 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x10e2, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x14a2, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2 -}; - -static int -koi8_r_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ENC_KOI8_R_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ -} - -static int -koi8_r_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp)++; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - int v = (EncKOI8_R_CtypeTable[*p] & - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - return (v != 0 ? TRUE : FALSE); - } - return FALSE; -} - -static int -koi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) - return ENC_IS_KOI8_R_CTYPE(code, ctype); - else - return FALSE; -} - -static int -koi8_r_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd7, 0xf7 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - { 0xdf, 0xff }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf7, 0xd7 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfe, 0xde }, - { 0xff, 0xdf } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return 52; - } - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -OnigEncodingType OnigEncodingKOI8_R = { - onigenc_single_byte_mbc_enc_len, - "KOI8-R", /* name */ - 1, /* max enc length */ - 1, /* min enc length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE ), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - koi8_r_mbc_to_normalize, - koi8_r_is_mbc_ambiguous, - koi8_r_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - koi8_r_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/mktable.c b/ext/mbstring/oniguruma/enc/mktable.c deleted file mode 100644 index 6b9ef4c5b5b1d..0000000000000 --- a/ext/mbstring/oniguruma/enc/mktable.c +++ /dev/null @@ -1,1119 +0,0 @@ -/********************************************************************** - mktable.c -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include - -#define NOT_RUBY -#include "regenc.h" - -#define UNICODE_ISO_8859_1 0 -#define ISO_8859_1 1 -#define ISO_8859_2 2 -#define ISO_8859_3 3 -#define ISO_8859_4 4 -#define ISO_8859_5 5 -#define ISO_8859_6 6 -#define ISO_8859_7 7 -#define ISO_8859_8 8 -#define ISO_8859_9 9 -#define ISO_8859_10 10 -#define ISO_8859_11 11 -#define ISO_8859_13 12 -#define ISO_8859_14 13 -#define ISO_8859_15 14 -#define ISO_8859_16 15 -#define KOI8 16 -#define KOI8_R 17 - -typedef struct { - int num; - char* name; -} ENC_INFO; - -static ENC_INFO Info[] = { - { UNICODE_ISO_8859_1, "UNICODE_ISO_8859_1" }, - { ISO_8859_1, "ISO_8859_1" }, - { ISO_8859_2, "ISO_8859_2" }, - { ISO_8859_3, "ISO_8859_3" }, - { ISO_8859_4, "ISO_8859_4" }, - { ISO_8859_5, "ISO_8859_5" }, - { ISO_8859_6, "ISO_8859_6" }, - { ISO_8859_7, "ISO_8859_7" }, - { ISO_8859_8, "ISO_8859_8" }, - { ISO_8859_9, "ISO_8859_9" }, - { ISO_8859_10, "ISO_8859_10" }, - { ISO_8859_11, "ISO_8859_11" }, - { ISO_8859_13, "ISO_8859_13" }, - { ISO_8859_14, "ISO_8859_14" }, - { ISO_8859_15, "ISO_8859_15" }, - { ISO_8859_16, "ISO_8859_16" }, - { KOI8, "KOI8" }, - { KOI8_R, "KOI8_R" } -}; - - -static int IsAlpha(int enc, int c) -{ - if (c >= 0x41 && c <= 0x5a) return 1; - if (c >= 0x61 && c <= 0x7a) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_9: - if (c == 0xaa) return 1; - if (c == 0xb5) return 1; - if (c == 0xba) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - break; - - case ISO_8859_2: - if (c == 0xa1 || c == 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c >= 0xae && c <= 0xaf) return 1; - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_3: - if (c == 0xa1) return 1; - if (c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xaf) return 1; - if (c == 0xb1) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c == 0xbf) return 1; - if (c >= 0xc0 && c <= 0xc2) return 1; - if (c >= 0xc4 && c <= 0xcf) return 1; - if (c >= 0xd1 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xe2) return 1; - if (c >= 0xe4 && c <= 0xef) return 1; - if (c >= 0xf1 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_4: - if (c >= 0xa1 && c <= 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xae) return 1; - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_5: - if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1; - if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1; - break; - - case ISO_8859_6: - if (c >= 0xc1 && c <= 0xda) return 1; - if (c >= 0xe0 && c <= 0xf2) return 1; - break; - - case ISO_8859_7: - if (c == 0xb6) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c == 0xc0) return 1; - if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1; - if (c >= 0xdc && c <= 0xfe) return 1; - break; - - case ISO_8859_8: - if (c == 0xb5) return 1; - if (c >= 0xe0 && c <= 0xfa) return 1; - break; - - case ISO_8859_10: - if (c >= 0xa1 && c <= 0xa6) return 1; - if (c >= 0xa8 && c <= 0xac) return 1; - if (c == 0xae || c == 0xaf) return 1; - if (c >= 0xb1 && c <= 0xb6) return 1; - if (c >= 0xb8 && c <= 0xbc) return 1; - if (c >= 0xbe && c <= 0xff) return 1; - break; - - case ISO_8859_11: - if (c >= 0xa1 && c <= 0xda) return 1; - if (c >= 0xdf && c <= 0xfb) return 1; - break; - - case ISO_8859_13: - if (c == 0xa8) return 1; - if (c == 0xaa) return 1; - if (c == 0xaf) return 1; - if (c == 0xb5) return 1; - if (c == 0xb8) return 1; - if (c == 0xba) return 1; - if (c >= 0xbf && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_14: - if (c == 0xa1 || c == 0xa2) return 1; - if (c == 0xa4 || c == 0xa5) return 1; - if (c == 0xa6 || c == 0xa8) return 1; - if (c >= 0xaa && c <= 0xac) return 1; - if (c >= 0xaf && c <= 0xb5) return 1; - if (c >= 0xb7 && c <= 0xff) return 1; - break; - - case ISO_8859_15: - if (c == 0xaa) return 1; - if (c == 0xb5) return 1; - if (c == 0xba) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - if (c == 0xa6) return 1; - if (c == 0xa8) return 1; - if (c == 0xb4) return 1; - if (c == 0xb8) return 1; - if (c == 0xbc) return 1; - if (c == 0xbd) return 1; - if (c == 0xbe) return 1; - break; - - case ISO_8859_16: - if (c == 0xa1) return 1; - if (c == 0xa2) return 1; - if (c == 0xa3) return 1; - if (c == 0xa6) return 1; - if (c == 0xa8) return 1; - if (c == 0xaa) return 1; - if (c == 0xac) return 1; - if (c == 0xae) return 1; - if (c == 0xaf) return 1; - if (c == 0xb2) return 1; - if (c == 0xb3) return 1; - if (c == 0xb4) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbc) return 1; - if (c == 0xbd) return 1; - if (c == 0xbe) return 1; - if (c == 0xbf) return 1; - if (c >= 0xc0 && c <= 0xde) return 1; - if (c >= 0xdf && c <= 0xff) return 1; - break; - - case KOI8_R: - if (c == 0xa3 || c == 0xb3) return 1; - /* fall */ - case KOI8: - if (c >= 0xc0 && c <= 0xff) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsBlank(int enc, int c) -{ - if (c == 0x09 || c == 0x20) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_2: - case ISO_8859_3: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_6: - case ISO_8859_7: - case ISO_8859_8: - case ISO_8859_9: - case ISO_8859_10: - case ISO_8859_11: - case ISO_8859_13: - case ISO_8859_14: - case ISO_8859_15: - case ISO_8859_16: - case KOI8: - if (c == 0xa0) return 1; - break; - - case KOI8_R: - if (c == 0x9a) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsCntrl(int enc, int c) -{ - if (c >= 0x00 && c <= 0x1F) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - if (c == 0xad) return 1; - /* fall */ - case ISO_8859_1: - case ISO_8859_2: - case ISO_8859_3: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_6: - case ISO_8859_7: - case ISO_8859_8: - case ISO_8859_9: - case ISO_8859_10: - case ISO_8859_11: - case ISO_8859_13: - case ISO_8859_14: - case ISO_8859_15: - case ISO_8859_16: - case KOI8: - if (c >= 0x7f && c <= 0x9F) return 1; - break; - - - case KOI8_R: - if (c == 0x7f) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsDigit(int enc, int c) -{ - if (c >= 0x30 && c <= 0x39) return 1; - return 0; -} - -static int IsGraph(int enc, int c) -{ - if (c >= 0x21 && c <= 0x7e) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_2: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_9: - case ISO_8859_10: - case ISO_8859_13: - case ISO_8859_14: - case ISO_8859_15: - case ISO_8859_16: - if (c >= 0xa1 && c <= 0xff) return 1; - break; - - case ISO_8859_3: - if (c >= 0xa1) { - if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 || - c == 0xe3 || c == 0xf0) - return 0; - else - return 1; - } - break; - - case ISO_8859_6: - if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf) - return 1; - if (c >= 0xc1 && c <= 0xda) return 1; - if (c >= 0xe0 && c <= 0xf2) return 1; - break; - - case ISO_8859_7: - if (c >= 0xa1 && c <= 0xfe && - c != 0xa4 && c != 0xa5 && c != 0xaa && - c != 0xae && c != 0xd2) return 1; - break; - - case ISO_8859_8: - if (c >= 0xa2 && c <= 0xfa) { - if (c >= 0xbf && c <= 0xde) return 0; - return 1; - } - break; - - case ISO_8859_11: - if (c >= 0xa1 && c <= 0xda) return 1; - if (c >= 0xdf && c <= 0xfb) return 1; - break; - - case KOI8: - if (c >= 0xc0 && c <= 0xff) return 1; - break; - - case KOI8_R: - if (c >= 0x80 && c <= 0xff && c != 0x9a) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsLower(int enc, int c) -{ - if (c >= 0x61 && c <= 0x7a) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_9: - if (c == 0xaa) return 1; - if (c == 0xb5) return 1; - if (c == 0xba) return 1; - if (c >= 0xdf && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - break; - - case ISO_8859_2: - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c >= 0xdf && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_3: - if (c == 0xb1) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c == 0xbf) return 1; - if (c == 0xdf) return 1; - if (c >= 0xe0 && c <= 0xe2) return 1; - if (c >= 0xe4 && c <= 0xef) return 1; - if (c >= 0xf1 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_4: - if (c == 0xa2) return 1; - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c == 0xdf) return 1; - if (c >= 0xe0 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_5: - if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1; - break; - - case ISO_8859_6: - break; - - case ISO_8859_7: - if (c == 0xc0) return 1; - if (c >= 0xdc && c <= 0xfe) return 1; - break; - - case ISO_8859_8: - if (c == 0xb5) return 1; - break; - - case ISO_8859_10: - if (c >= 0xb1 && c <= 0xb6) return 1; - if (c >= 0xb8 && c <= 0xbc) return 1; - if (c == 0xbe || c == 0xbf) return 1; - if (c >= 0xdf && c <= 0xff) return 1; - break; - - case ISO_8859_11: - break; - - case ISO_8859_13: - if (c == 0xb5) return 1; - if (c == 0xb8) return 1; - if (c == 0xba) return 1; - if (c == 0xbf) return 1; - if (c >= 0xdf && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_14: - if (c == 0xa2) return 1; - if (c == 0xa5) return 1; - if (c == 0xab) return 1; - if (c == 0xb1 || c == 0xb3 || c == 0xb5) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbc) return 1; - if (c == 0xbe || c == 0xbf) return 1; - if (c >= 0xdf && c <= 0xff) return 1; - break; - - case ISO_8859_15: - if (c == 0xaa) return 1; - if (c == 0xb5) return 1; - if (c == 0xba) return 1; - if (c >= 0xdf && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - if (c == 0xa8) return 1; - if (c == 0xb8) return 1; - if (c == 0xbd) return 1; - break; - - case ISO_8859_16: - if (c == 0xa2) return 1; - if (c == 0xa8) return 1; - if (c == 0xae) return 1; - if (c == 0xb3) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbd) return 1; - if (c == 0xbf) return 1; - if (c >= 0xdf && c <= 0xff) return 1; - break; - - case KOI8_R: - if (c == 0xa3) return 1; - /* fall */ - case KOI8: - if (c >= 0xc0 && c <= 0xdf) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsPrint(int enc, int c) -{ - if (c >= 0x20 && c <= 0x7e) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - if (c >= 0x09 && c <= 0x0d) return 1; - if (c == 0x85) return 1; - /* fall */ - case ISO_8859_1: - case ISO_8859_2: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_9: - case ISO_8859_10: - case ISO_8859_13: - case ISO_8859_14: - case ISO_8859_15: - case ISO_8859_16: - if (c >= 0xa0 && c <= 0xff) return 1; - break; - - case ISO_8859_3: - if (c >= 0xa0) { - if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 || - c == 0xe3 || c == 0xf0) - return 0; - else - return 1; - } - break; - - case ISO_8859_6: - if (c == 0xa0) return 1; - if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf) - return 1; - if (c >= 0xc1 && c <= 0xda) return 1; - if (c >= 0xe0 && c <= 0xf2) return 1; - break; - - case ISO_8859_7: - if (c >= 0xa0 && c <= 0xfe && - c != 0xa4 && c != 0xa5 && c != 0xaa && - c != 0xae && c != 0xd2) return 1; - break; - - case ISO_8859_8: - if (c >= 0xa0 && c <= 0xfa) { - if (c >= 0xbf && c <= 0xde) return 0; - if (c == 0xa1) return 0; - return 1; - } - break; - - case ISO_8859_11: - if (c >= 0xa0 && c <= 0xda) return 1; - if (c >= 0xdf && c <= 0xfb) return 1; - break; - - case KOI8: - if (c == 0xa0) return 1; - if (c >= 0xc0 && c <= 0xff) return 1; - break; - - case KOI8_R: - if (c >= 0x80 && c <= 0xff) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsPunct(int enc, int c) -{ - if (enc == UNICODE_ISO_8859_1) { - if (c == 0x24 || c == 0x2b || c == 0x5e || c == 0x60 || - c == 0x7c || c == 0x7e) return 1; - if (c >= 0x3c && c <= 0x3e) return 1; - } - - if (c >= 0x21 && c <= 0x23) return 1; - if (c >= 0x25 && c <= 0x2a) return 1; - if (c >= 0x2c && c <= 0x2f) return 1; - if (c >= 0x3a && c <= 0x3b) return 1; - if (c >= 0x3f && c <= 0x40) return 1; - if (c >= 0x5b && c <= 0x5d) return 1; - if (c == 0x5f) return 1; - if (c == 0x7b) return 1; - if (c == 0x7d) return 1; - - switch (enc) { - case ISO_8859_1: - case ISO_8859_9: - case ISO_8859_15: - if (c == 0xad) return 1; - /* fall */ - case UNICODE_ISO_8859_1: - if (c == 0xa1) return 1; - if (c == 0xab) return 1; - if (c == 0xb7) return 1; - if (c == 0xbb) return 1; - if (c == 0xbf) return 1; - break; - - case ISO_8859_2: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_14: - if (c == 0xad) return 1; - break; - - case ISO_8859_3: - case ISO_8859_10: - if (c == 0xad) return 1; - if (c == 0xb7) return 1; - if (c == 0xbd) return 1; - break; - - case ISO_8859_6: - if (c == 0xac) return 1; - if (c == 0xad) return 1; - if (c == 0xbb) return 1; - if (c == 0xbf) return 1; - break; - - case ISO_8859_7: - if (c == 0xa1 || c == 0xa2) return 1; - if (c == 0xab) return 1; - if (c == 0xaf) return 1; - if (c == 0xad) return 1; - if (c == 0xb7 || c == 0xbb) return 1; - break; - - case ISO_8859_8: - if (c == 0xab) return 1; - if (c == 0xad) return 1; - if (c == 0xb7) return 1; - if (c == 0xbb) return 1; - if (c == 0xdf) return 1; - break; - - case ISO_8859_13: - if (c == 0xa1 || c == 0xa5) return 1; - if (c == 0xab || c == 0xad) return 1; - if (c == 0xb4 || c == 0xb7) return 1; - if (c == 0xbb) return 1; - if (c == 0xff) return 1; - break; - - case ISO_8859_16: - if (c == 0xa5) return 1; - if (c == 0xab) return 1; - if (c == 0xad) return 1; - if (c == 0xb5) return 1; - if (c == 0xb7) return 1; - if (c == 0xbb) return 1; - break; - - case KOI8_R: - if (c == 0x9e) return 1; - break; - - case ISO_8859_11: - case KOI8: - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsSpace(int enc, int c) -{ - if (c >= 0x09 && c <= 0x0d) return 1; - if (c == 0x20) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - if (c == 0x85) return 1; - /* fall */ - case ISO_8859_1: - case ISO_8859_2: - case ISO_8859_3: - case ISO_8859_4: - case ISO_8859_5: - case ISO_8859_6: - case ISO_8859_7: - case ISO_8859_8: - case ISO_8859_9: - case ISO_8859_10: - case ISO_8859_11: - case ISO_8859_13: - case ISO_8859_14: - case ISO_8859_15: - case ISO_8859_16: - case KOI8: - if (c == 0xa0) return 1; - break; - - case KOI8_R: - if (c == 0x9a) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsUpper(int enc, int c) -{ - if (c >= 0x41 && c <= 0x5a) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_9: - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - break; - - case ISO_8859_2: - if (c == 0xa1 || c == 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c >= 0xae && c <= 0xaf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - break; - - case ISO_8859_3: - if (c == 0xa1) return 1; - if (c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xaf) return 1; - if (c >= 0xc0 && c <= 0xc2) return 1; - if (c >= 0xc4 && c <= 0xcf) return 1; - if (c >= 0xd1 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - break; - - case ISO_8859_4: - if (c == 0xa1 || c == 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xae) return 1; - if (c == 0xbd) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - break; - - case ISO_8859_5: - if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1; - break; - - case ISO_8859_6: - break; - - case ISO_8859_7: - if (c == 0xb6) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1; - break; - - case ISO_8859_8: - case ISO_8859_11: - break; - - case ISO_8859_10: - if (c >= 0xa1 && c <= 0xa6) return 1; - if (c >= 0xa8 && c <= 0xac) return 1; - if (c == 0xae || c == 0xaf) return 1; - if (c >= 0xc0 && c <= 0xde) return 1; - break; - - case ISO_8859_13: - if (c == 0xa8) return 1; - if (c == 0xaa) return 1; - if (c == 0xaf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - break; - - case ISO_8859_14: - if (c == 0xa1) return 1; - if (c == 0xa4 || c == 0xa6) return 1; - if (c == 0xa8) return 1; - if (c == 0xaa || c == 0xac) return 1; - if (c == 0xaf || c == 0xb0) return 1; - if (c == 0xb2 || c == 0xb4 || c == 0xb7) return 1; - if (c == 0xbb || c == 0xbd) return 1; - if (c >= 0xc0 && c <= 0xde) return 1; - break; - - case ISO_8859_15: - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xde) return 1; - if (c == 0xa6) return 1; - if (c == 0xb4) return 1; - if (c == 0xbc) return 1; - if (c == 0xbe) return 1; - break; - - case ISO_8859_16: - if (c == 0xa1) return 1; - if (c == 0xa3) return 1; - if (c == 0xa6) return 1; - if (c == 0xaa) return 1; - if (c == 0xac) return 1; - if (c == 0xaf) return 1; - if (c == 0xb2) return 1; - if (c == 0xb4) return 1; - if (c == 0xbc) return 1; - if (c == 0xbe) return 1; - if (c >= 0xc0 && c <= 0xde) return 1; - break; - - case KOI8_R: - if (c == 0xb3) return 1; - /* fall */ - case KOI8: - if (c >= 0xe0 && c <= 0xff) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsXDigit(int enc, int c) -{ - if (c >= 0x30 && c <= 0x39) return 1; - if (c >= 0x41 && c <= 0x46) return 1; - if (c >= 0x61 && c <= 0x66) return 1; - return 0; -} - -static int IsWord(int enc, int c) -{ - if (c >= 0x30 && c <= 0x39) return 1; - if (c >= 0x41 && c <= 0x5a) return 1; - if (c == 0x5f) return 1; - if (c >= 0x61 && c <= 0x7a) return 1; - - switch (enc) { - case UNICODE_ISO_8859_1: - case ISO_8859_1: - case ISO_8859_9: - if (c == 0xaa) return 1; - if (c >= 0xb2 && c <= 0xb3) return 1; - if (c == 0xb5) return 1; - if (c >= 0xb9 && c <= 0xba) return 1; - if (c >= 0xbc && c <= 0xbe) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - break; - - case ISO_8859_2: - if (c == 0xa1 || c == 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c >= 0xae && c <= 0xaf) return 1; - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbc) return 1; - if (c >= 0xbe && c <= 0xbf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_3: - if (c == 0xa1) return 1; - if (c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xaf) return 1; - if (c >= 0xb1 && c <= 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbd) return 1; - if (c == 0xbf) return 1; - if (c >= 0xc0 && c <= 0xc2) return 1; - if (c >= 0xc4 && c <= 0xcf) return 1; - if (c >= 0xd1 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xe2) return 1; - if (c >= 0xe4 && c <= 0xef) return 1; - if (c >= 0xf1 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_4: - if (c >= 0xa1 && c <= 0xa3) return 1; - if (c == 0xa5 || c == 0xa6) return 1; - if (c >= 0xa9 && c <= 0xac) return 1; - if (c == 0xae) return 1; - if (c == 0xb1 || c == 0xb3) return 1; - if (c == 0xb5 || c == 0xb6) return 1; - if (c >= 0xb9 && c <= 0xbf) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_5: - if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1; - if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1; - break; - - case ISO_8859_6: - if (c >= 0xc1 && c <= 0xda) return 1; - if (c >= 0xe0 && c <= 0xea) return 1; - if (c >= 0xeb && c <= 0xf2) return 1; - break; - - case ISO_8859_7: - if (c == 0xb2 || c == 0xb3) return 1; - if (c == 0xb6) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c >= 0xbc && c <= 0xbf) return 1; - if (c == 0xc0) return 1; - if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1; - if (c >= 0xdc && c <= 0xfe) return 1; - break; - - case ISO_8859_8: - if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1; - if (c >= 0xbc && c <= 0xbe) return 1; - if (c >= 0xe0 && c <= 0xfa) return 1; - break; - - case ISO_8859_10: - if (c >= 0xa1 && c <= 0xff) { - if (c != 0xa7 && c != 0xad && c != 0xb0 && c != 0xb7 && c != 0xbd) - return 1; - } - break; - - case ISO_8859_11: - if (c >= 0xa1 && c <= 0xda) return 1; - if (c >= 0xdf && c <= 0xfb) return 1; - break; - - case ISO_8859_13: - if (c == 0xa8) return 1; - if (c == 0xaa) return 1; - if (c == 0xaf) return 1; - if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1; - if (c >= 0xbc && c <= 0xbe) return 1; - if (c == 0xb8) return 1; - if (c == 0xba) return 1; - if (c >= 0xbf && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xfe) return 1; - break; - - case ISO_8859_14: - if (c >= 0xa1 && c <= 0xff) { - if (c == 0xa3 || c == 0xa7 || c == 0xa9 || c == 0xad || c == 0xae || - c == 0xb6) return 0; - return 1; - } - break; - - case ISO_8859_15: - if (c == 0xaa) return 1; - if (c >= 0xb2 && c <= 0xb3) return 1; - if (c == 0xb5) return 1; - if (c >= 0xb9 && c <= 0xba) return 1; - if (c >= 0xbc && c <= 0xbe) return 1; - if (c >= 0xc0 && c <= 0xd6) return 1; - if (c >= 0xd8 && c <= 0xf6) return 1; - if (c >= 0xf8 && c <= 0xff) return 1; - if (c == 0xa6) return 1; - if (c == 0xa8) return 1; - if (c == 0xb4) return 1; - if (c == 0xb8) return 1; - break; - - case ISO_8859_16: - if (c == 0xa1) return 1; - if (c == 0xa2) return 1; - if (c == 0xa3) return 1; - if (c == 0xa6) return 1; - if (c == 0xa8) return 1; - if (c == 0xaa) return 1; - if (c == 0xac) return 1; - if (c == 0xae) return 1; - if (c == 0xaf) return 1; - if (c == 0xb2) return 1; - if (c == 0xb3) return 1; - if (c == 0xb4) return 1; - if (c >= 0xb8 && c <= 0xba) return 1; - if (c == 0xbc) return 1; - if (c == 0xbd) return 1; - if (c == 0xbe) return 1; - if (c == 0xbf) return 1; - if (c >= 0xc0 && c <= 0xde) return 1; - if (c >= 0xdf && c <= 0xff) return 1; - break; - - case KOI8_R: - if (c == 0x9d) return 1; - if (c == 0xa3 || c == 0xb3) return 1; - /* fall */ - case KOI8: - if (c >= 0xc0 && c <= 0xff) return 1; - break; - - default: - exit(-1); - } - - return 0; -} - -static int IsAscii(int enc, int c) -{ - if (c >= 0x00 && c <= 0x7f) return 1; - return 0; -} - -static int IsNewline(int enc, int c) -{ - if (c == 0x0a) return 1; - return 0; -} - -static int exec(FILE* fp, ENC_INFO* einfo) -{ -#define NCOL 8 - - int c, val, enc; - - enc = einfo->num; - - fprintf(fp, "static unsigned short Enc%s_CtypeTable[256] = {\n", - einfo->name); - - for (c = 0; c < 256; c++) { - val = 0; - if (IsNewline(enc, c)) val |= ONIGENC_CTYPE_NEWLINE; - if (IsAlpha (enc, c)) val |= ONIGENC_CTYPE_ALPHA; - if (IsBlank (enc, c)) val |= ONIGENC_CTYPE_BLANK; - if (IsCntrl (enc, c)) val |= ONIGENC_CTYPE_CNTRL; - if (IsDigit (enc, c)) val |= ONIGENC_CTYPE_DIGIT; - if (IsGraph (enc, c)) val |= ONIGENC_CTYPE_GRAPH; - if (IsLower (enc, c)) val |= ONIGENC_CTYPE_LOWER; - if (IsPrint (enc, c)) val |= ONIGENC_CTYPE_PRINT; - if (IsPunct (enc, c)) val |= ONIGENC_CTYPE_PUNCT; - if (IsSpace (enc, c)) val |= ONIGENC_CTYPE_SPACE; - if (IsUpper (enc, c)) val |= ONIGENC_CTYPE_UPPER; - if (IsXDigit(enc, c)) val |= ONIGENC_CTYPE_XDIGIT; - if (IsWord (enc, c)) val |= ONIGENC_CTYPE_WORD; - if (IsAscii (enc, c)) val |= ONIGENC_CTYPE_ASCII; - - if (c % NCOL == 0) fputs(" ", fp); - fprintf(fp, "0x%04x", val); - if (c != 255) fputs(",", fp); - if (c != 0 && c % NCOL == (NCOL-1)) - fputs("\n", fp); - else - fputs(" ", fp); - } - fprintf(fp, "};\n"); - return 0; -} - -extern int main(int argc, char* argv[]) -{ - int i; - FILE* fp = stdout; - - for (i = 0; i < sizeof(Info)/sizeof(ENC_INFO); i++) { - exec(fp, &Info[i]); - } -} diff --git a/ext/mbstring/oniguruma/enc/sjis.c b/ext/mbstring/oniguruma/enc/sjis.c deleted file mode 100644 index e13407bccfd91..0000000000000 --- a/ext/mbstring/oniguruma/enc/sjis.c +++ /dev/null @@ -1,243 +0,0 @@ -/********************************************************************** - sjis.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int EncLen_SJIS[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1 -}; - -static const char SJIS_CAN_BE_TRAIL_TABLE[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 -}; - -#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1) -#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)] - -static int -sjis_mbc_enc_len(const UChar* p) -{ - return EncLen_SJIS[*p]; -} - -extern int -sjis_code_to_mbclen(OnigCodePoint code) -{ - if (code < 256) { - if (EncLen_SJIS[(int )code] == 1) - return 1; - else - return 0; - } - else if (code <= 0xffff) { - return 2; - } - else - return 0; -} - -static OnigCodePoint -sjis_mbc_to_code(const UChar* p, const UChar* end) -{ - int c, i, len; - OnigCodePoint n; - - len = enc_len(ONIG_ENCODING_SJIS, p); - c = *p++; - n = c; - if (len == 1) return n; - - for (i = 1; i < len; i++) { - if (p >= end) break; - c = *p++; - n <<= 8; n += c; - } - return n; -} - -static int -sjis_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar *p = buf; - - if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff)); - *p++ = (UChar )(code & 0xff); - -#if 0 - if (enc_len(ONIG_ENCODING_SJIS, buf) != (p - buf)) - return REGERR_INVALID_WIDE_CHAR_VALUE; -#endif - return p - buf; -} - -static int -sjis_mbc_to_normalize(OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - - (*pp)++; - return 1; - } - else { - int len = enc_len(ONIG_ENCODING_SJIS, p); - - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -sjis_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_SJIS, flag, pp, end); - -} - -static int -sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else { - return (sjis_code_to_mbclen(code) > 1 ? TRUE : FALSE); - } - - ctype &= ~ONIGENC_CTYPE_WORD; - if (ctype == 0) return FALSE; - } - - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -static UChar* -sjis_left_adjust_char_head(const UChar* start, const UChar* s) -{ - const UChar *p; - int len; - - if (s <= start) return (UChar* )s; - p = s; - - if (SJIS_ISMB_TRAIL(*p)) { - while (p > start) { - if (! SJIS_ISMB_FIRST(*--p)) { - p++; - break; - } - } - } - len = enc_len(ONIG_ENCODING_SJIS, p); - if (p + len > s) return (UChar* )p; - p += len; - return (UChar* )(p + ((s - p) & ~1)); -} - -static int -sjis_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - const UChar c = *s; - return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE); -} - -OnigEncodingType OnigEncodingSJIS = { - sjis_mbc_enc_len, - "Shift_JIS", /* name */ - 2, /* max byte length */ - 1, /* min byte length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - sjis_mbc_to_code, - sjis_code_to_mbclen, - sjis_code_to_mbc, - sjis_mbc_to_normalize, - sjis_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - sjis_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - sjis_left_adjust_char_head, - sjis_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/unicode.c b/ext/mbstring/oniguruma/enc/unicode.c deleted file mode 100644 index e3be9450a5118..0000000000000 --- a/ext/mbstring/oniguruma/enc/unicode.c +++ /dev/null @@ -1,3400 +0,0 @@ -/********************************************************************** - unicode.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - - -unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x228c, 0x2289, 0x2288, 0x2288, 0x2288, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x31a0, - 0x21a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10e2, 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x00a0, 0x01a0, - 0x00a0, 0x10a0, 0x10e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; - -static OnigCodePoint CRAlnum[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 414, -#else - 9, -#endif - 0x0030, 0x0039, - 0x0041, 0x005a, - 0x0061, 0x007a, - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, - 0x00f8, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x0669, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0966, 0x096f, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09f1, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b6f, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bef, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e50, 0x0e59, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f20, 0x0f29, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1049, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1369, 0x1371, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x17e0, 0x17e9, - 0x180b, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1946, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x3005, 0x3006, - 0x302a, 0x302f, - 0x3031, 0x3035, - 0x303b, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30fa, - 0x30fc, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff10, 0xff19, - 0xff21, 0xff3a, - 0xff41, 0xff5a, - 0xff66, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10300, 0x1031e, - 0x10330, 0x10349, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRAlnum */ - -static OnigCodePoint CRAlpha[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 396, -#else - 8, -#endif - 0x0041, 0x005a, - 0x0061, 0x007a, - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, - 0x00f8, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06ef, - 0x06fa, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09f0, 0x09f1, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a70, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x180b, 0x180d, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1950, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x3005, 0x3006, - 0x302a, 0x302f, - 0x3031, 0x3035, - 0x303b, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30fa, - 0x30fc, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff21, 0xff3a, - 0xff41, 0xff5a, - 0xff66, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10300, 0x1031e, - 0x10330, 0x10349, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRAlpha */ - -static OnigCodePoint CRBlank[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 9, -#else - 3, -#endif - 0x0009, 0x0009, - 0x0020, 0x0020, - 0x00a0, 0x00a0 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x1680, 0x1680, - 0x180e, 0x180e, - 0x2000, 0x200a, - 0x202f, 0x202f, - 0x205f, 0x205f, - 0x3000, 0x3000 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRBlank */ - -static OnigCodePoint CRCntrl[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 19, -#else - 3, -#endif - 0x0000, 0x001f, - 0x007f, 0x009f, - 0x00ad, 0x00ad -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0600, 0x0603, - 0x06dd, 0x06dd, - 0x070f, 0x070f, - 0x17b4, 0x17b5, - 0x200b, 0x200f, - 0x202a, 0x202e, - 0x2060, 0x2063, - 0x206a, 0x206f, - 0xd800, 0xf8ff, - 0xfeff, 0xfeff, - 0xfff9, 0xfffb, - 0x1d173, 0x1d17a, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRCntrl */ - -static OnigCodePoint CRDigit[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 23, -#else - 1, -#endif - 0x0030, 0x0039 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0660, 0x0669, - 0x06f0, 0x06f9, - 0x0966, 0x096f, - 0x09e6, 0x09ef, - 0x0a66, 0x0a6f, - 0x0ae6, 0x0aef, - 0x0b66, 0x0b6f, - 0x0be7, 0x0bef, - 0x0c66, 0x0c6f, - 0x0ce6, 0x0cef, - 0x0d66, 0x0d6f, - 0x0e50, 0x0e59, - 0x0ed0, 0x0ed9, - 0x0f20, 0x0f29, - 0x1040, 0x1049, - 0x1369, 0x1371, - 0x17e0, 0x17e9, - 0x1810, 0x1819, - 0x1946, 0x194f, - 0xff10, 0xff19, - 0x104a0, 0x104a9, - 0x1d7ce, 0x1d7ff -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRDigit */ - -static OnigCodePoint CRGraph[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 405, -#else - 2, -#endif - 0x0021, 0x007e, - 0x00a1, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x0357, - 0x035d, 0x036f, - 0x0374, 0x0375, - 0x037a, 0x037a, - 0x037e, 0x037e, - 0x0384, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03fb, - 0x0400, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x055f, - 0x0561, 0x0587, - 0x0589, 0x058a, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f4, - 0x0600, 0x0603, - 0x060c, 0x0615, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x070d, - 0x070f, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0970, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09fa, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0af1, 0x0af1, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bfa, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df4, - 0x0e01, 0x0e3a, - 0x0e3f, 0x0e5b, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fbe, 0x0fcc, - 0x0fcf, 0x0fcf, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x10fb, 0x10fb, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1361, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x1676, - 0x1681, 0x169c, - 0x16a0, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1736, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x1800, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1940, 0x1940, - 0x1944, 0x196d, - 0x1970, 0x1974, - 0x19e0, 0x19ff, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fc4, - 0x1fc6, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fdd, 0x1fef, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffe, - 0x200b, 0x2027, - 0x202a, 0x202e, - 0x2030, 0x2054, - 0x2057, 0x2057, - 0x2060, 0x2063, - 0x206a, 0x2071, - 0x2074, 0x208e, - 0x20a0, 0x20b1, - 0x20d0, 0x20ea, - 0x2100, 0x213b, - 0x213d, 0x214b, - 0x2153, 0x2183, - 0x2190, 0x23d0, - 0x2400, 0x2426, - 0x2440, 0x244a, - 0x2460, 0x2617, - 0x2619, 0x267d, - 0x2680, 0x2691, - 0x26a0, 0x26a1, - 0x2701, 0x2704, - 0x2706, 0x2709, - 0x270c, 0x2727, - 0x2729, 0x274b, - 0x274d, 0x274d, - 0x274f, 0x2752, - 0x2756, 0x2756, - 0x2758, 0x275e, - 0x2761, 0x2794, - 0x2798, 0x27af, - 0x27b1, 0x27be, - 0x27d0, 0x27eb, - 0x27f0, 0x2b0d, - 0x2e80, 0x2e99, - 0x2e9b, 0x2ef3, - 0x2f00, 0x2fd5, - 0x2ff0, 0x2ffb, - 0x3001, 0x303f, - 0x3041, 0x3096, - 0x3099, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3190, 0x31b7, - 0x31f0, 0x321e, - 0x3220, 0x3243, - 0x3250, 0x327d, - 0x327f, 0x32fe, - 0x3300, 0x4db5, - 0x4dc0, 0x9fa5, - 0xa000, 0xa48c, - 0xa490, 0xa4c6, - 0xac00, 0xd7a3, - 0xe000, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3f, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfd, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe30, 0xfe52, - 0xfe54, 0xfe66, - 0xfe68, 0xfe6b, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xfeff, 0xfeff, - 0xff01, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0xffe0, 0xffe6, - 0xffe8, 0xffee, - 0xfff9, 0xfffd, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10100, 0x10102, - 0x10107, 0x10133, - 0x10137, 0x1013f, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x1039f, 0x1039f, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d000, 0x1d0f5, - 0x1d100, 0x1d126, - 0x1d12a, 0x1d1dd, - 0x1d300, 0x1d356, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xe0100, 0xe01ef, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRGraph */ - -static OnigCodePoint CRLower[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 424, -#else - 6, -#endif - 0x0061, 0x007a, - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00df, 0x00f6, - 0x00f8, 0x00ff -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0101, 0x0101, - 0x0103, 0x0103, - 0x0105, 0x0105, - 0x0107, 0x0107, - 0x0109, 0x0109, - 0x010b, 0x010b, - 0x010d, 0x010d, - 0x010f, 0x010f, - 0x0111, 0x0111, - 0x0113, 0x0113, - 0x0115, 0x0115, - 0x0117, 0x0117, - 0x0119, 0x0119, - 0x011b, 0x011b, - 0x011d, 0x011d, - 0x011f, 0x011f, - 0x0121, 0x0121, - 0x0123, 0x0123, - 0x0125, 0x0125, - 0x0127, 0x0127, - 0x0129, 0x0129, - 0x012b, 0x012b, - 0x012d, 0x012d, - 0x012f, 0x012f, - 0x0131, 0x0131, - 0x0133, 0x0133, - 0x0135, 0x0135, - 0x0137, 0x0138, - 0x013a, 0x013a, - 0x013c, 0x013c, - 0x013e, 0x013e, - 0x0140, 0x0140, - 0x0142, 0x0142, - 0x0144, 0x0144, - 0x0146, 0x0146, - 0x0148, 0x0149, - 0x014b, 0x014b, - 0x014d, 0x014d, - 0x014f, 0x014f, - 0x0151, 0x0151, - 0x0153, 0x0153, - 0x0155, 0x0155, - 0x0157, 0x0157, - 0x0159, 0x0159, - 0x015b, 0x015b, - 0x015d, 0x015d, - 0x015f, 0x015f, - 0x0161, 0x0161, - 0x0163, 0x0163, - 0x0165, 0x0165, - 0x0167, 0x0167, - 0x0169, 0x0169, - 0x016b, 0x016b, - 0x016d, 0x016d, - 0x016f, 0x016f, - 0x0171, 0x0171, - 0x0173, 0x0173, - 0x0175, 0x0175, - 0x0177, 0x0177, - 0x017a, 0x017a, - 0x017c, 0x017c, - 0x017e, 0x0180, - 0x0183, 0x0183, - 0x0185, 0x0185, - 0x0188, 0x0188, - 0x018c, 0x018d, - 0x0192, 0x0192, - 0x0195, 0x0195, - 0x0199, 0x019b, - 0x019e, 0x019e, - 0x01a1, 0x01a1, - 0x01a3, 0x01a3, - 0x01a5, 0x01a5, - 0x01a8, 0x01a8, - 0x01aa, 0x01ab, - 0x01ad, 0x01ad, - 0x01b0, 0x01b0, - 0x01b4, 0x01b4, - 0x01b6, 0x01b6, - 0x01b9, 0x01ba, - 0x01bd, 0x01bf, - 0x01c6, 0x01c6, - 0x01c9, 0x01c9, - 0x01cc, 0x01cc, - 0x01ce, 0x01ce, - 0x01d0, 0x01d0, - 0x01d2, 0x01d2, - 0x01d4, 0x01d4, - 0x01d6, 0x01d6, - 0x01d8, 0x01d8, - 0x01da, 0x01da, - 0x01dc, 0x01dd, - 0x01df, 0x01df, - 0x01e1, 0x01e1, - 0x01e3, 0x01e3, - 0x01e5, 0x01e5, - 0x01e7, 0x01e7, - 0x01e9, 0x01e9, - 0x01eb, 0x01eb, - 0x01ed, 0x01ed, - 0x01ef, 0x01f0, - 0x01f3, 0x01f3, - 0x01f5, 0x01f5, - 0x01f9, 0x01f9, - 0x01fb, 0x01fb, - 0x01fd, 0x01fd, - 0x01ff, 0x01ff, - 0x0201, 0x0201, - 0x0203, 0x0203, - 0x0205, 0x0205, - 0x0207, 0x0207, - 0x0209, 0x0209, - 0x020b, 0x020b, - 0x020d, 0x020d, - 0x020f, 0x020f, - 0x0211, 0x0211, - 0x0213, 0x0213, - 0x0215, 0x0215, - 0x0217, 0x0217, - 0x0219, 0x0219, - 0x021b, 0x021b, - 0x021d, 0x021d, - 0x021f, 0x021f, - 0x0221, 0x0221, - 0x0223, 0x0223, - 0x0225, 0x0225, - 0x0227, 0x0227, - 0x0229, 0x0229, - 0x022b, 0x022b, - 0x022d, 0x022d, - 0x022f, 0x022f, - 0x0231, 0x0231, - 0x0233, 0x0236, - 0x0250, 0x02af, - 0x0390, 0x0390, - 0x03ac, 0x03ce, - 0x03d0, 0x03d1, - 0x03d5, 0x03d7, - 0x03d9, 0x03d9, - 0x03db, 0x03db, - 0x03dd, 0x03dd, - 0x03df, 0x03df, - 0x03e1, 0x03e1, - 0x03e3, 0x03e3, - 0x03e5, 0x03e5, - 0x03e7, 0x03e7, - 0x03e9, 0x03e9, - 0x03eb, 0x03eb, - 0x03ed, 0x03ed, - 0x03ef, 0x03f3, - 0x03f5, 0x03f5, - 0x03f8, 0x03f8, - 0x03fb, 0x03fb, - 0x0430, 0x045f, - 0x0461, 0x0461, - 0x0463, 0x0463, - 0x0465, 0x0465, - 0x0467, 0x0467, - 0x0469, 0x0469, - 0x046b, 0x046b, - 0x046d, 0x046d, - 0x046f, 0x046f, - 0x0471, 0x0471, - 0x0473, 0x0473, - 0x0475, 0x0475, - 0x0477, 0x0477, - 0x0479, 0x0479, - 0x047b, 0x047b, - 0x047d, 0x047d, - 0x047f, 0x047f, - 0x0481, 0x0481, - 0x048b, 0x048b, - 0x048d, 0x048d, - 0x048f, 0x048f, - 0x0491, 0x0491, - 0x0493, 0x0493, - 0x0495, 0x0495, - 0x0497, 0x0497, - 0x0499, 0x0499, - 0x049b, 0x049b, - 0x049d, 0x049d, - 0x049f, 0x049f, - 0x04a1, 0x04a1, - 0x04a3, 0x04a3, - 0x04a5, 0x04a5, - 0x04a7, 0x04a7, - 0x04a9, 0x04a9, - 0x04ab, 0x04ab, - 0x04ad, 0x04ad, - 0x04af, 0x04af, - 0x04b1, 0x04b1, - 0x04b3, 0x04b3, - 0x04b5, 0x04b5, - 0x04b7, 0x04b7, - 0x04b9, 0x04b9, - 0x04bb, 0x04bb, - 0x04bd, 0x04bd, - 0x04bf, 0x04bf, - 0x04c2, 0x04c2, - 0x04c4, 0x04c4, - 0x04c6, 0x04c6, - 0x04c8, 0x04c8, - 0x04ca, 0x04ca, - 0x04cc, 0x04cc, - 0x04ce, 0x04ce, - 0x04d1, 0x04d1, - 0x04d3, 0x04d3, - 0x04d5, 0x04d5, - 0x04d7, 0x04d7, - 0x04d9, 0x04d9, - 0x04db, 0x04db, - 0x04dd, 0x04dd, - 0x04df, 0x04df, - 0x04e1, 0x04e1, - 0x04e3, 0x04e3, - 0x04e5, 0x04e5, - 0x04e7, 0x04e7, - 0x04e9, 0x04e9, - 0x04eb, 0x04eb, - 0x04ed, 0x04ed, - 0x04ef, 0x04ef, - 0x04f1, 0x04f1, - 0x04f3, 0x04f3, - 0x04f5, 0x04f5, - 0x04f9, 0x04f9, - 0x0501, 0x0501, - 0x0503, 0x0503, - 0x0505, 0x0505, - 0x0507, 0x0507, - 0x0509, 0x0509, - 0x050b, 0x050b, - 0x050d, 0x050d, - 0x050f, 0x050f, - 0x0561, 0x0587, - 0x1d00, 0x1d2b, - 0x1d62, 0x1d6b, - 0x1e01, 0x1e01, - 0x1e03, 0x1e03, - 0x1e05, 0x1e05, - 0x1e07, 0x1e07, - 0x1e09, 0x1e09, - 0x1e0b, 0x1e0b, - 0x1e0d, 0x1e0d, - 0x1e0f, 0x1e0f, - 0x1e11, 0x1e11, - 0x1e13, 0x1e13, - 0x1e15, 0x1e15, - 0x1e17, 0x1e17, - 0x1e19, 0x1e19, - 0x1e1b, 0x1e1b, - 0x1e1d, 0x1e1d, - 0x1e1f, 0x1e1f, - 0x1e21, 0x1e21, - 0x1e23, 0x1e23, - 0x1e25, 0x1e25, - 0x1e27, 0x1e27, - 0x1e29, 0x1e29, - 0x1e2b, 0x1e2b, - 0x1e2d, 0x1e2d, - 0x1e2f, 0x1e2f, - 0x1e31, 0x1e31, - 0x1e33, 0x1e33, - 0x1e35, 0x1e35, - 0x1e37, 0x1e37, - 0x1e39, 0x1e39, - 0x1e3b, 0x1e3b, - 0x1e3d, 0x1e3d, - 0x1e3f, 0x1e3f, - 0x1e41, 0x1e41, - 0x1e43, 0x1e43, - 0x1e45, 0x1e45, - 0x1e47, 0x1e47, - 0x1e49, 0x1e49, - 0x1e4b, 0x1e4b, - 0x1e4d, 0x1e4d, - 0x1e4f, 0x1e4f, - 0x1e51, 0x1e51, - 0x1e53, 0x1e53, - 0x1e55, 0x1e55, - 0x1e57, 0x1e57, - 0x1e59, 0x1e59, - 0x1e5b, 0x1e5b, - 0x1e5d, 0x1e5d, - 0x1e5f, 0x1e5f, - 0x1e61, 0x1e61, - 0x1e63, 0x1e63, - 0x1e65, 0x1e65, - 0x1e67, 0x1e67, - 0x1e69, 0x1e69, - 0x1e6b, 0x1e6b, - 0x1e6d, 0x1e6d, - 0x1e6f, 0x1e6f, - 0x1e71, 0x1e71, - 0x1e73, 0x1e73, - 0x1e75, 0x1e75, - 0x1e77, 0x1e77, - 0x1e79, 0x1e79, - 0x1e7b, 0x1e7b, - 0x1e7d, 0x1e7d, - 0x1e7f, 0x1e7f, - 0x1e81, 0x1e81, - 0x1e83, 0x1e83, - 0x1e85, 0x1e85, - 0x1e87, 0x1e87, - 0x1e89, 0x1e89, - 0x1e8b, 0x1e8b, - 0x1e8d, 0x1e8d, - 0x1e8f, 0x1e8f, - 0x1e91, 0x1e91, - 0x1e93, 0x1e93, - 0x1e95, 0x1e9b, - 0x1ea1, 0x1ea1, - 0x1ea3, 0x1ea3, - 0x1ea5, 0x1ea5, - 0x1ea7, 0x1ea7, - 0x1ea9, 0x1ea9, - 0x1eab, 0x1eab, - 0x1ead, 0x1ead, - 0x1eaf, 0x1eaf, - 0x1eb1, 0x1eb1, - 0x1eb3, 0x1eb3, - 0x1eb5, 0x1eb5, - 0x1eb7, 0x1eb7, - 0x1eb9, 0x1eb9, - 0x1ebb, 0x1ebb, - 0x1ebd, 0x1ebd, - 0x1ebf, 0x1ebf, - 0x1ec1, 0x1ec1, - 0x1ec3, 0x1ec3, - 0x1ec5, 0x1ec5, - 0x1ec7, 0x1ec7, - 0x1ec9, 0x1ec9, - 0x1ecb, 0x1ecb, - 0x1ecd, 0x1ecd, - 0x1ecf, 0x1ecf, - 0x1ed1, 0x1ed1, - 0x1ed3, 0x1ed3, - 0x1ed5, 0x1ed5, - 0x1ed7, 0x1ed7, - 0x1ed9, 0x1ed9, - 0x1edb, 0x1edb, - 0x1edd, 0x1edd, - 0x1edf, 0x1edf, - 0x1ee1, 0x1ee1, - 0x1ee3, 0x1ee3, - 0x1ee5, 0x1ee5, - 0x1ee7, 0x1ee7, - 0x1ee9, 0x1ee9, - 0x1eeb, 0x1eeb, - 0x1eed, 0x1eed, - 0x1eef, 0x1eef, - 0x1ef1, 0x1ef1, - 0x1ef3, 0x1ef3, - 0x1ef5, 0x1ef5, - 0x1ef7, 0x1ef7, - 0x1ef9, 0x1ef9, - 0x1f00, 0x1f07, - 0x1f10, 0x1f15, - 0x1f20, 0x1f27, - 0x1f30, 0x1f37, - 0x1f40, 0x1f45, - 0x1f50, 0x1f57, - 0x1f60, 0x1f67, - 0x1f70, 0x1f7d, - 0x1f80, 0x1f87, - 0x1f90, 0x1f97, - 0x1fa0, 0x1fa7, - 0x1fb0, 0x1fb4, - 0x1fb6, 0x1fb7, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fc7, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fd7, - 0x1fe0, 0x1fe7, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ff7, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x210a, 0x210a, - 0x210e, 0x210f, - 0x2113, 0x2113, - 0x212f, 0x212f, - 0x2134, 0x2134, - 0x2139, 0x2139, - 0x213d, 0x213d, - 0x2146, 0x2149, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xff41, 0xff5a, - 0x10428, 0x1044f, - 0x1d41a, 0x1d433, - 0x1d44e, 0x1d454, - 0x1d456, 0x1d467, - 0x1d482, 0x1d49b, - 0x1d4b6, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d4cf, - 0x1d4ea, 0x1d503, - 0x1d51e, 0x1d537, - 0x1d552, 0x1d56b, - 0x1d586, 0x1d59f, - 0x1d5ba, 0x1d5d3, - 0x1d5ee, 0x1d607, - 0x1d622, 0x1d63b, - 0x1d656, 0x1d66f, - 0x1d68a, 0x1d6a3, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6e1, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d71b, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d755, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d78f, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRLower */ - -static OnigCodePoint CRPrint[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 405, -#else - 4, -#endif - 0x0009, 0x000d, - 0x0020, 0x007e, - 0x0085, 0x0085, - 0x00a0, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x0357, - 0x035d, 0x036f, - 0x0374, 0x0375, - 0x037a, 0x037a, - 0x037e, 0x037e, - 0x0384, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03fb, - 0x0400, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x055f, - 0x0561, 0x0587, - 0x0589, 0x058a, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f4, - 0x0600, 0x0603, - 0x060c, 0x0615, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x070d, - 0x070f, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0970, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09fa, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0af1, 0x0af1, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bfa, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df4, - 0x0e01, 0x0e3a, - 0x0e3f, 0x0e5b, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fbe, 0x0fcc, - 0x0fcf, 0x0fcf, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x10fb, 0x10fb, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1361, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x1676, - 0x1680, 0x169c, - 0x16a0, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1736, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x1800, 0x180e, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1940, 0x1940, - 0x1944, 0x196d, - 0x1970, 0x1974, - 0x19e0, 0x19ff, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fc4, - 0x1fc6, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fdd, 0x1fef, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffe, - 0x2000, 0x2054, - 0x2057, 0x2057, - 0x205f, 0x2063, - 0x206a, 0x2071, - 0x2074, 0x208e, - 0x20a0, 0x20b1, - 0x20d0, 0x20ea, - 0x2100, 0x213b, - 0x213d, 0x214b, - 0x2153, 0x2183, - 0x2190, 0x23d0, - 0x2400, 0x2426, - 0x2440, 0x244a, - 0x2460, 0x2617, - 0x2619, 0x267d, - 0x2680, 0x2691, - 0x26a0, 0x26a1, - 0x2701, 0x2704, - 0x2706, 0x2709, - 0x270c, 0x2727, - 0x2729, 0x274b, - 0x274d, 0x274d, - 0x274f, 0x2752, - 0x2756, 0x2756, - 0x2758, 0x275e, - 0x2761, 0x2794, - 0x2798, 0x27af, - 0x27b1, 0x27be, - 0x27d0, 0x27eb, - 0x27f0, 0x2b0d, - 0x2e80, 0x2e99, - 0x2e9b, 0x2ef3, - 0x2f00, 0x2fd5, - 0x2ff0, 0x2ffb, - 0x3000, 0x303f, - 0x3041, 0x3096, - 0x3099, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3190, 0x31b7, - 0x31f0, 0x321e, - 0x3220, 0x3243, - 0x3250, 0x327d, - 0x327f, 0x32fe, - 0x3300, 0x4db5, - 0x4dc0, 0x9fa5, - 0xa000, 0xa48c, - 0xa490, 0xa4c6, - 0xac00, 0xd7a3, - 0xe000, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3f, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfd, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe30, 0xfe52, - 0xfe54, 0xfe66, - 0xfe68, 0xfe6b, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xfeff, 0xfeff, - 0xff01, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0xffe0, 0xffe6, - 0xffe8, 0xffee, - 0xfff9, 0xfffd, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10100, 0x10102, - 0x10107, 0x10133, - 0x10137, 0x1013f, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x1039f, 0x1039f, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d000, 0x1d0f5, - 0x1d100, 0x1d126, - 0x1d12a, 0x1d1dd, - 0x1d300, 0x1d356, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xe0100, 0xe01ef, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRPrint */ - -static OnigCodePoint CRPunct[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 86, -#else - 14, -#endif - 0x0021, 0x0023, - 0x0025, 0x002a, - 0x002c, 0x002f, - 0x003a, 0x003b, - 0x003f, 0x0040, - 0x005b, 0x005d, - 0x005f, 0x005f, - 0x007b, 0x007b, - 0x007d, 0x007d, - 0x00a1, 0x00a1, - 0x00ab, 0x00ab, - 0x00b7, 0x00b7, - 0x00bb, 0x00bb, - 0x00bf, 0x00bf -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x037e, 0x037e, - 0x0387, 0x0387, - 0x055a, 0x055f, - 0x0589, 0x058a, - 0x05be, 0x05be, - 0x05c0, 0x05c0, - 0x05c3, 0x05c3, - 0x05f3, 0x05f4, - 0x060c, 0x060d, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x066a, 0x066d, - 0x06d4, 0x06d4, - 0x0700, 0x070d, - 0x0964, 0x0965, - 0x0970, 0x0970, - 0x0df4, 0x0df4, - 0x0e4f, 0x0e4f, - 0x0e5a, 0x0e5b, - 0x0f04, 0x0f12, - 0x0f3a, 0x0f3d, - 0x0f85, 0x0f85, - 0x104a, 0x104f, - 0x10fb, 0x10fb, - 0x1361, 0x1368, - 0x166d, 0x166e, - 0x169b, 0x169c, - 0x16eb, 0x16ed, - 0x1735, 0x1736, - 0x17d4, 0x17d6, - 0x17d8, 0x17da, - 0x1800, 0x180a, - 0x1944, 0x1945, - 0x2010, 0x2027, - 0x2030, 0x2043, - 0x2045, 0x2051, - 0x2053, 0x2054, - 0x2057, 0x2057, - 0x207d, 0x207e, - 0x208d, 0x208e, - 0x2329, 0x232a, - 0x23b4, 0x23b6, - 0x2768, 0x2775, - 0x27e6, 0x27eb, - 0x2983, 0x2998, - 0x29d8, 0x29db, - 0x29fc, 0x29fd, - 0x3001, 0x3003, - 0x3008, 0x3011, - 0x3014, 0x301f, - 0x3030, 0x3030, - 0x303d, 0x303d, - 0x30a0, 0x30a0, - 0x30fb, 0x30fb, - 0xfd3e, 0xfd3f, - 0xfe30, 0xfe52, - 0xfe54, 0xfe61, - 0xfe63, 0xfe63, - 0xfe68, 0xfe68, - 0xfe6a, 0xfe6b, - 0xff01, 0xff03, - 0xff05, 0xff0a, - 0xff0c, 0xff0f, - 0xff1a, 0xff1b, - 0xff1f, 0xff20, - 0xff3b, 0xff3d, - 0xff3f, 0xff3f, - 0xff5b, 0xff5b, - 0xff5d, 0xff5d, - 0xff5f, 0xff65, - 0x10100, 0x10101, - 0x1039f, 0x1039f -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRPunct */ - -static OnigCodePoint CRSpace[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 11, -#else - 4, -#endif - 0x0009, 0x000d, - 0x0020, 0x0020, - 0x0085, 0x0085, - 0x00a0, 0x00a0 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x1680, 0x1680, - 0x180e, 0x180e, - 0x2000, 0x200a, - 0x2028, 0x2029, - 0x202f, 0x202f, - 0x205f, 0x205f, - 0x3000, 0x3000 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRSpace */ - -static OnigCodePoint CRUpper[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 421, -#else - 3, -#endif - 0x0041, 0x005a, - 0x00c0, 0x00d6, - 0x00d8, 0x00de -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0100, 0x0100, - 0x0102, 0x0102, - 0x0104, 0x0104, - 0x0106, 0x0106, - 0x0108, 0x0108, - 0x010a, 0x010a, - 0x010c, 0x010c, - 0x010e, 0x010e, - 0x0110, 0x0110, - 0x0112, 0x0112, - 0x0114, 0x0114, - 0x0116, 0x0116, - 0x0118, 0x0118, - 0x011a, 0x011a, - 0x011c, 0x011c, - 0x011e, 0x011e, - 0x0120, 0x0120, - 0x0122, 0x0122, - 0x0124, 0x0124, - 0x0126, 0x0126, - 0x0128, 0x0128, - 0x012a, 0x012a, - 0x012c, 0x012c, - 0x012e, 0x012e, - 0x0130, 0x0130, - 0x0132, 0x0132, - 0x0134, 0x0134, - 0x0136, 0x0136, - 0x0139, 0x0139, - 0x013b, 0x013b, - 0x013d, 0x013d, - 0x013f, 0x013f, - 0x0141, 0x0141, - 0x0143, 0x0143, - 0x0145, 0x0145, - 0x0147, 0x0147, - 0x014a, 0x014a, - 0x014c, 0x014c, - 0x014e, 0x014e, - 0x0150, 0x0150, - 0x0152, 0x0152, - 0x0154, 0x0154, - 0x0156, 0x0156, - 0x0158, 0x0158, - 0x015a, 0x015a, - 0x015c, 0x015c, - 0x015e, 0x015e, - 0x0160, 0x0160, - 0x0162, 0x0162, - 0x0164, 0x0164, - 0x0166, 0x0166, - 0x0168, 0x0168, - 0x016a, 0x016a, - 0x016c, 0x016c, - 0x016e, 0x016e, - 0x0170, 0x0170, - 0x0172, 0x0172, - 0x0174, 0x0174, - 0x0176, 0x0176, - 0x0178, 0x0179, - 0x017b, 0x017b, - 0x017d, 0x017d, - 0x0181, 0x0182, - 0x0184, 0x0184, - 0x0186, 0x0187, - 0x0189, 0x018b, - 0x018e, 0x0191, - 0x0193, 0x0194, - 0x0196, 0x0198, - 0x019c, 0x019d, - 0x019f, 0x01a0, - 0x01a2, 0x01a2, - 0x01a4, 0x01a4, - 0x01a6, 0x01a7, - 0x01a9, 0x01a9, - 0x01ac, 0x01ac, - 0x01ae, 0x01af, - 0x01b1, 0x01b3, - 0x01b5, 0x01b5, - 0x01b7, 0x01b8, - 0x01bc, 0x01bc, - 0x01c4, 0x01c4, - 0x01c7, 0x01c7, - 0x01ca, 0x01ca, - 0x01cd, 0x01cd, - 0x01cf, 0x01cf, - 0x01d1, 0x01d1, - 0x01d3, 0x01d3, - 0x01d5, 0x01d5, - 0x01d7, 0x01d7, - 0x01d9, 0x01d9, - 0x01db, 0x01db, - 0x01de, 0x01de, - 0x01e0, 0x01e0, - 0x01e2, 0x01e2, - 0x01e4, 0x01e4, - 0x01e6, 0x01e6, - 0x01e8, 0x01e8, - 0x01ea, 0x01ea, - 0x01ec, 0x01ec, - 0x01ee, 0x01ee, - 0x01f1, 0x01f1, - 0x01f4, 0x01f4, - 0x01f6, 0x01f8, - 0x01fa, 0x01fa, - 0x01fc, 0x01fc, - 0x01fe, 0x01fe, - 0x0200, 0x0200, - 0x0202, 0x0202, - 0x0204, 0x0204, - 0x0206, 0x0206, - 0x0208, 0x0208, - 0x020a, 0x020a, - 0x020c, 0x020c, - 0x020e, 0x020e, - 0x0210, 0x0210, - 0x0212, 0x0212, - 0x0214, 0x0214, - 0x0216, 0x0216, - 0x0218, 0x0218, - 0x021a, 0x021a, - 0x021c, 0x021c, - 0x021e, 0x021e, - 0x0220, 0x0220, - 0x0222, 0x0222, - 0x0224, 0x0224, - 0x0226, 0x0226, - 0x0228, 0x0228, - 0x022a, 0x022a, - 0x022c, 0x022c, - 0x022e, 0x022e, - 0x0230, 0x0230, - 0x0232, 0x0232, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x038f, - 0x0391, 0x03a1, - 0x03a3, 0x03ab, - 0x03d2, 0x03d4, - 0x03d8, 0x03d8, - 0x03da, 0x03da, - 0x03dc, 0x03dc, - 0x03de, 0x03de, - 0x03e0, 0x03e0, - 0x03e2, 0x03e2, - 0x03e4, 0x03e4, - 0x03e6, 0x03e6, - 0x03e8, 0x03e8, - 0x03ea, 0x03ea, - 0x03ec, 0x03ec, - 0x03ee, 0x03ee, - 0x03f4, 0x03f4, - 0x03f7, 0x03f7, - 0x03f9, 0x03fa, - 0x0400, 0x042f, - 0x0460, 0x0460, - 0x0462, 0x0462, - 0x0464, 0x0464, - 0x0466, 0x0466, - 0x0468, 0x0468, - 0x046a, 0x046a, - 0x046c, 0x046c, - 0x046e, 0x046e, - 0x0470, 0x0470, - 0x0472, 0x0472, - 0x0474, 0x0474, - 0x0476, 0x0476, - 0x0478, 0x0478, - 0x047a, 0x047a, - 0x047c, 0x047c, - 0x047e, 0x047e, - 0x0480, 0x0480, - 0x048a, 0x048a, - 0x048c, 0x048c, - 0x048e, 0x048e, - 0x0490, 0x0490, - 0x0492, 0x0492, - 0x0494, 0x0494, - 0x0496, 0x0496, - 0x0498, 0x0498, - 0x049a, 0x049a, - 0x049c, 0x049c, - 0x049e, 0x049e, - 0x04a0, 0x04a0, - 0x04a2, 0x04a2, - 0x04a4, 0x04a4, - 0x04a6, 0x04a6, - 0x04a8, 0x04a8, - 0x04aa, 0x04aa, - 0x04ac, 0x04ac, - 0x04ae, 0x04ae, - 0x04b0, 0x04b0, - 0x04b2, 0x04b2, - 0x04b4, 0x04b4, - 0x04b6, 0x04b6, - 0x04b8, 0x04b8, - 0x04ba, 0x04ba, - 0x04bc, 0x04bc, - 0x04be, 0x04be, - 0x04c0, 0x04c1, - 0x04c3, 0x04c3, - 0x04c5, 0x04c5, - 0x04c7, 0x04c7, - 0x04c9, 0x04c9, - 0x04cb, 0x04cb, - 0x04cd, 0x04cd, - 0x04d0, 0x04d0, - 0x04d2, 0x04d2, - 0x04d4, 0x04d4, - 0x04d6, 0x04d6, - 0x04d8, 0x04d8, - 0x04da, 0x04da, - 0x04dc, 0x04dc, - 0x04de, 0x04de, - 0x04e0, 0x04e0, - 0x04e2, 0x04e2, - 0x04e4, 0x04e4, - 0x04e6, 0x04e6, - 0x04e8, 0x04e8, - 0x04ea, 0x04ea, - 0x04ec, 0x04ec, - 0x04ee, 0x04ee, - 0x04f0, 0x04f0, - 0x04f2, 0x04f2, - 0x04f4, 0x04f4, - 0x04f8, 0x04f8, - 0x0500, 0x0500, - 0x0502, 0x0502, - 0x0504, 0x0504, - 0x0506, 0x0506, - 0x0508, 0x0508, - 0x050a, 0x050a, - 0x050c, 0x050c, - 0x050e, 0x050e, - 0x0531, 0x0556, - 0x10a0, 0x10c5, - 0x1e00, 0x1e00, - 0x1e02, 0x1e02, - 0x1e04, 0x1e04, - 0x1e06, 0x1e06, - 0x1e08, 0x1e08, - 0x1e0a, 0x1e0a, - 0x1e0c, 0x1e0c, - 0x1e0e, 0x1e0e, - 0x1e10, 0x1e10, - 0x1e12, 0x1e12, - 0x1e14, 0x1e14, - 0x1e16, 0x1e16, - 0x1e18, 0x1e18, - 0x1e1a, 0x1e1a, - 0x1e1c, 0x1e1c, - 0x1e1e, 0x1e1e, - 0x1e20, 0x1e20, - 0x1e22, 0x1e22, - 0x1e24, 0x1e24, - 0x1e26, 0x1e26, - 0x1e28, 0x1e28, - 0x1e2a, 0x1e2a, - 0x1e2c, 0x1e2c, - 0x1e2e, 0x1e2e, - 0x1e30, 0x1e30, - 0x1e32, 0x1e32, - 0x1e34, 0x1e34, - 0x1e36, 0x1e36, - 0x1e38, 0x1e38, - 0x1e3a, 0x1e3a, - 0x1e3c, 0x1e3c, - 0x1e3e, 0x1e3e, - 0x1e40, 0x1e40, - 0x1e42, 0x1e42, - 0x1e44, 0x1e44, - 0x1e46, 0x1e46, - 0x1e48, 0x1e48, - 0x1e4a, 0x1e4a, - 0x1e4c, 0x1e4c, - 0x1e4e, 0x1e4e, - 0x1e50, 0x1e50, - 0x1e52, 0x1e52, - 0x1e54, 0x1e54, - 0x1e56, 0x1e56, - 0x1e58, 0x1e58, - 0x1e5a, 0x1e5a, - 0x1e5c, 0x1e5c, - 0x1e5e, 0x1e5e, - 0x1e60, 0x1e60, - 0x1e62, 0x1e62, - 0x1e64, 0x1e64, - 0x1e66, 0x1e66, - 0x1e68, 0x1e68, - 0x1e6a, 0x1e6a, - 0x1e6c, 0x1e6c, - 0x1e6e, 0x1e6e, - 0x1e70, 0x1e70, - 0x1e72, 0x1e72, - 0x1e74, 0x1e74, - 0x1e76, 0x1e76, - 0x1e78, 0x1e78, - 0x1e7a, 0x1e7a, - 0x1e7c, 0x1e7c, - 0x1e7e, 0x1e7e, - 0x1e80, 0x1e80, - 0x1e82, 0x1e82, - 0x1e84, 0x1e84, - 0x1e86, 0x1e86, - 0x1e88, 0x1e88, - 0x1e8a, 0x1e8a, - 0x1e8c, 0x1e8c, - 0x1e8e, 0x1e8e, - 0x1e90, 0x1e90, - 0x1e92, 0x1e92, - 0x1e94, 0x1e94, - 0x1ea0, 0x1ea0, - 0x1ea2, 0x1ea2, - 0x1ea4, 0x1ea4, - 0x1ea6, 0x1ea6, - 0x1ea8, 0x1ea8, - 0x1eaa, 0x1eaa, - 0x1eac, 0x1eac, - 0x1eae, 0x1eae, - 0x1eb0, 0x1eb0, - 0x1eb2, 0x1eb2, - 0x1eb4, 0x1eb4, - 0x1eb6, 0x1eb6, - 0x1eb8, 0x1eb8, - 0x1eba, 0x1eba, - 0x1ebc, 0x1ebc, - 0x1ebe, 0x1ebe, - 0x1ec0, 0x1ec0, - 0x1ec2, 0x1ec2, - 0x1ec4, 0x1ec4, - 0x1ec6, 0x1ec6, - 0x1ec8, 0x1ec8, - 0x1eca, 0x1eca, - 0x1ecc, 0x1ecc, - 0x1ece, 0x1ece, - 0x1ed0, 0x1ed0, - 0x1ed2, 0x1ed2, - 0x1ed4, 0x1ed4, - 0x1ed6, 0x1ed6, - 0x1ed8, 0x1ed8, - 0x1eda, 0x1eda, - 0x1edc, 0x1edc, - 0x1ede, 0x1ede, - 0x1ee0, 0x1ee0, - 0x1ee2, 0x1ee2, - 0x1ee4, 0x1ee4, - 0x1ee6, 0x1ee6, - 0x1ee8, 0x1ee8, - 0x1eea, 0x1eea, - 0x1eec, 0x1eec, - 0x1eee, 0x1eee, - 0x1ef0, 0x1ef0, - 0x1ef2, 0x1ef2, - 0x1ef4, 0x1ef4, - 0x1ef6, 0x1ef6, - 0x1ef8, 0x1ef8, - 0x1f08, 0x1f0f, - 0x1f18, 0x1f1d, - 0x1f28, 0x1f2f, - 0x1f38, 0x1f3f, - 0x1f48, 0x1f4d, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f5f, - 0x1f68, 0x1f6f, - 0x1fb8, 0x1fbb, - 0x1fc8, 0x1fcb, - 0x1fd8, 0x1fdb, - 0x1fe8, 0x1fec, - 0x1ff8, 0x1ffb, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210b, 0x210d, - 0x2110, 0x2112, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x2130, 0x2131, - 0x2133, 0x2133, - 0x213e, 0x213f, - 0x2145, 0x2145, - 0xff21, 0xff3a, - 0x10400, 0x10427, - 0x1d400, 0x1d419, - 0x1d434, 0x1d44d, - 0x1d468, 0x1d481, - 0x1d49c, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b5, - 0x1d4d0, 0x1d4e9, - 0x1d504, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d538, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d56c, 0x1d585, - 0x1d5a0, 0x1d5b9, - 0x1d5d4, 0x1d5ed, - 0x1d608, 0x1d621, - 0x1d63c, 0x1d655, - 0x1d670, 0x1d689, - 0x1d6a8, 0x1d6c0, - 0x1d6e2, 0x1d6fa, - 0x1d71c, 0x1d734, - 0x1d756, 0x1d76e, - 0x1d790, 0x1d7a8 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRUpper */ - -static OnigCodePoint CRXDigit[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 3, -#else - 3, -#endif - 0x0030, 0x0039, - 0x0041, 0x0046, - 0x0061, 0x0066 -}; - -static OnigCodePoint CRASCII[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 1, -#else - 1, -#endif - 0x0000, 0x007f -}; - -static OnigCodePoint CRWord[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 436, -#else - 12, -#endif - 0x0030, 0x0039, - 0x0041, 0x005a, - 0x005f, 0x005f, - 0x0061, 0x007a, - 0x00aa, 0x00aa, - 0x00b2, 0x00b3, - 0x00b5, 0x00b5, - 0x00b9, 0x00ba, - 0x00bc, 0x00be, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, -#ifndef USE_UNICODE_FULL_RANGE_CTYPE - 0x00f8, 0x7fffffff -#else /* not USE_UNICODE_FULL_RANGE_CTYPE */ - 0x00f8, 0x0236, - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x0669, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0966, 0x096f, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09f1, - 0x09f4, 0x09f9, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b6f, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bf2, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e50, 0x0e59, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f20, 0x0f33, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1049, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1369, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x16ee, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x180b, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1946, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x203f, 0x2040, - 0x2054, 0x2054, - 0x2070, 0x2071, - 0x2074, 0x2079, - 0x207f, 0x2089, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x2153, 0x2183, - 0x2460, 0x249b, - 0x24ea, 0x24ff, - 0x2776, 0x2793, - 0x3005, 0x3007, - 0x3021, 0x302f, - 0x3031, 0x3035, - 0x3038, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3192, 0x3195, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3220, 0x3229, - 0x3251, 0x325f, - 0x3280, 0x3289, - 0x32b1, 0x32bf, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe33, 0xfe34, - 0xfe4d, 0xfe4f, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff10, 0xff19, - 0xff21, 0xff3a, - 0xff3f, 0xff3f, - 0xff41, 0xff5a, - 0xff65, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10107, 0x10133, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of CRWord */ - - -extern int -onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 256) { - return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype); - } - -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - - switch (ctype) { - case ONIGENC_CTYPE_ALPHA: - return onig_is_in_code_range((UChar* )CRAlpha, code); - break; - case ONIGENC_CTYPE_BLANK: - return onig_is_in_code_range((UChar* )CRBlank, code); - break; - case ONIGENC_CTYPE_CNTRL: - return onig_is_in_code_range((UChar* )CRCntrl, code); - break; - case ONIGENC_CTYPE_DIGIT: - return onig_is_in_code_range((UChar* )CRDigit, code); - break; - case ONIGENC_CTYPE_GRAPH: - return onig_is_in_code_range((UChar* )CRGraph, code); - break; - case ONIGENC_CTYPE_LOWER: - return onig_is_in_code_range((UChar* )CRLower, code); - break; - case ONIGENC_CTYPE_PRINT: - return onig_is_in_code_range((UChar* )CRPrint, code); - break; - case ONIGENC_CTYPE_PUNCT: - return onig_is_in_code_range((UChar* )CRPunct, code); - break; - case ONIGENC_CTYPE_SPACE: - return onig_is_in_code_range((UChar* )CRSpace, code); - break; - case ONIGENC_CTYPE_UPPER: - return onig_is_in_code_range((UChar* )CRUpper, code); - break; - case ONIGENC_CTYPE_XDIGIT: - return FALSE; - break; - case ONIGENC_CTYPE_WORD: - return onig_is_in_code_range((UChar* )CRWord, code); - break; - case ONIGENC_CTYPE_ASCII: - return FALSE; - break; - case ONIGENC_CTYPE_ALNUM: - return onig_is_in_code_range((UChar* )CRAlnum, code); - break; - - default: - return ONIGENCERR_TYPE_BUG; - break; - } - -#else - - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { - return TRUE; - } - return FALSE; -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -} - -extern int -onigenc_unicode_get_ctype_code_range(int ctype, - OnigCodePoint* sbr[], OnigCodePoint* mbr[]) -{ - static OnigCodePoint EmptyRange[] = { 0 }; - -#define CR_SET(list) do { \ - *mbr = list; \ -} while (0) - - *sbr = EmptyRange; - - switch (ctype) { - case ONIGENC_CTYPE_ALPHA: - CR_SET(CRAlpha); - break; - case ONIGENC_CTYPE_BLANK: - CR_SET(CRBlank); - break; - case ONIGENC_CTYPE_CNTRL: - CR_SET(CRCntrl); - break; - case ONIGENC_CTYPE_DIGIT: - CR_SET(CRDigit); - break; - case ONIGENC_CTYPE_GRAPH: - CR_SET(CRGraph); - break; - case ONIGENC_CTYPE_LOWER: - CR_SET(CRLower); - break; - case ONIGENC_CTYPE_PRINT: - CR_SET(CRPrint); - break; - case ONIGENC_CTYPE_PUNCT: - CR_SET(CRPunct); - break; - case ONIGENC_CTYPE_SPACE: - CR_SET(CRSpace); - break; - case ONIGENC_CTYPE_UPPER: - CR_SET(CRUpper); - break; - case ONIGENC_CTYPE_XDIGIT: - CR_SET(CRXDigit); - break; - case ONIGENC_CTYPE_WORD: - CR_SET(CRWord); - break; - case ONIGENC_CTYPE_ASCII: - CR_SET(CRASCII); - break; - case ONIGENC_CTYPE_ALNUM: - CR_SET(CRAlnum); - break; - - default: - return ONIGENCERR_TYPE_BUG; - break; - } - - return 0; -} diff --git a/ext/mbstring/oniguruma/enc/utf16_be.c b/ext/mbstring/oniguruma/enc/utf16_be.c deleted file mode 100755 index ad33ddbeeb3b3..0000000000000 --- a/ext/mbstring/oniguruma/enc/utf16_be.c +++ /dev/null @@ -1,253 +0,0 @@ -/********************************************************************** - utf16_be.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) -#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) - -static int EncLen_UTF16[] = { - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static int -utf16be_mbc_enc_len(const UChar* p) -{ - return EncLen_UTF16[*p]; -} - -static int -utf16be_is_mbc_newline(const UChar* p, const UChar* end) -{ - if (p + 1 < end) { - if (*(p+1) == 0x0a && *p == 0x00) - return 1; - } - return 0; -} - -static OnigCodePoint -utf16be_mbc_to_code(const UChar* p, const UChar* end) -{ - OnigCodePoint code; - - if (UTF16_IS_SURROGATE_FIRST(*p)) { - code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16) - + ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8) - + p[3]; - } - else { - code = p[0] * 256 + p[1]; - } - return code; -} - -static int -utf16be_code_to_mbclen(OnigCodePoint code) -{ - return (code > 0xffff ? 4 : 2); -} - -static int -utf16be_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar* p = buf; - - if (code > 0xffff) { - unsigned int plane, high; - - plane = code >> 16; - *p++ = (plane >> 2) + 0xd8; - high = (code & 0xff00) >> 8; - *p++ = ((plane & 0x03) << 6) + (high >> 2); - *p++ = (high & 0x02) + 0xdc; - *p = (UChar )(code & 0xff); - return 4; - } - else { - *p++ = (UChar )((code & 0xff00) >> 8); - *p++ = (UChar )(code & 0xff); - return 2; - } -} - -static int -utf16be_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - const UChar* p = *pp; - - if (*p == 0) { - p++; - if (end > p + 2 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+2) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+2) == 'S'))) && - *(p+1) == 0) { - *lower++ = '\0'; - *lower = 0xdf; - (*pp) += 4; - return 2; - } - - *lower++ = '\0'; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - - (*pp) += 2; - return 2; /* return byte length of converted char to lower */ - } - else { - int len; - len = EncLen_UTF16[*p]; - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -utf16be_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp) += EncLen_UTF16[*p]; - - if (*p == 0) { - int c, v; - - p++; - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 2 && - ((*p == 's' && *(p+2) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+2) == 'S'))) && - *(p+1) == 0) { - (*pp) += 2; - return TRUE; - } - else if (*p == 0xdf) { - return TRUE; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - c = *p; - v = ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(c, - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (c >= 0xaa && c <= 0xba) - return FALSE; - else - return TRUE; - } - return (v != 0 ? TRUE : FALSE); - } - } - - return FALSE; -} - -static UChar* -utf16be_left_adjust_char_head(const UChar* start, const UChar* s) -{ - if (s <= start) return (UChar* )s; - - if ((s - start) % 2 == 1) { - s--; - } - - if (UTF16_IS_SURROGATE_SECOND(*s) && s > start + 1) - s -= 2; - - return (UChar* )s; -} - -OnigEncodingType OnigEncodingUTF16_BE = { - utf16be_mbc_enc_len, - "UTF-16BE", /* name */ - 4, /* max byte length */ - 2, /* min byte length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - utf16be_is_mbc_newline, - utf16be_mbc_to_code, - utf16be_code_to_mbclen, - utf16be_code_to_mbc, - utf16be_mbc_to_normalize, - utf16be_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - onigenc_unicode_is_code_ctype, - onigenc_unicode_get_ctype_code_range, - utf16be_left_adjust_char_head, - onigenc_always_false_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/utf16_le.c b/ext/mbstring/oniguruma/enc/utf16_le.c deleted file mode 100755 index db892dcd14d92..0000000000000 --- a/ext/mbstring/oniguruma/enc/utf16_le.c +++ /dev/null @@ -1,248 +0,0 @@ -/********************************************************************** - utf16_le.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) -#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) - -static int EncLen_UTF16[] = { - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static int -utf16le_code_to_mbclen(OnigCodePoint code) -{ - return (code > 0xffff ? 4 : 2); -} - -static int -utf16le_mbc_enc_len(const UChar* p) -{ - return EncLen_UTF16[*(p+1)]; -} - -static int -utf16le_is_mbc_newline(const UChar* p, const UChar* end) -{ - if (p + 1 < end) { - if (*p == 0x0a && *(p+1) == 0x00) - return 1; - } - return 0; -} - -static OnigCodePoint -utf16le_mbc_to_code(const UChar* p, const UChar* end) -{ - OnigCodePoint code; - UChar c0 = *p; - UChar c1 = *(p+1); - - if (UTF16_IS_SURROGATE_FIRST(c1)) { - code = ((((c1 - 0xd8) << 2) + ((c0 & 0xc0) >> 6) + 1) << 16) - + ((((c0 & 0x3f) << 2) + (p[3] - 0xdc)) << 8) - + p[2]; - } - else { - code = c1 * 256 + p[0]; - } - return code; -} - -static int -utf16le_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar* p = buf; - - if (code > 0xffff) { - unsigned int plane, high; - - plane = code >> 16; - high = (code & 0xff00) >> 8; - - *p++ = ((plane & 0x03) << 6) + (high >> 2); - *p++ = (plane >> 2) + 0xd8; - *p++ = (UChar )(code & 0xff); - *p = (high & 0x02) + 0xdc; - return 4; - } - else { - *p++ = (UChar )(code & 0xff); - *p++ = (UChar )((code & 0xff00) >> 8); - return 2; - } -} - -static int -utf16le_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - const UChar* p = *pp; - - if (*(p+1) == 0) { - if (end > p + 3 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+2) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+2) == 'S'))) && - *(p+3) == 0) { - *lower++ = 0xdf; - *lower = '\0'; - (*pp) += 4; - return 2; - } - - *(lower+1) = '\0'; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp) += 2; - return 2; /* return byte length of converted char to lower */ - } - else { - int len = EncLen_UTF16[*(p+1)]; - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -utf16le_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp) += EncLen_UTF16[*(p+1)]; - - if (*(p+1) == 0) { - int c, v; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 3 && - ((*p == 's' && *(p+2) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+2) == 'S'))) && - *(p+3) == 0) { - (*pp) += 2; - return TRUE; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - c = *p; - v = ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(c, - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (c >= 0xaa && c <= 0xba) - return FALSE; - else - return TRUE; - } - return (v != 0 ? TRUE : FALSE); - } - } - - return FALSE; -} - -static UChar* -utf16le_left_adjust_char_head(const UChar* start, const UChar* s) -{ - if (s <= start) return (UChar* )s; - - if ((s - start) % 2 == 1) { - s--; - } - - if (UTF16_IS_SURROGATE_SECOND(*(s+1)) && s > start + 1) - s -= 2; - - return (UChar* )s; -} - -OnigEncodingType OnigEncodingUTF16_LE = { - utf16le_mbc_enc_len, - "UTF-16LE", /* name */ - 4, /* max byte length */ - 2, /* min byte length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - utf16le_is_mbc_newline, - utf16le_mbc_to_code, - utf16le_code_to_mbclen, - utf16le_code_to_mbc, - utf16le_mbc_to_normalize, - utf16le_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - onigenc_unicode_is_code_ctype, - onigenc_unicode_get_ctype_code_range, - utf16le_left_adjust_char_head, - onigenc_always_false_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/utf32_be.c b/ext/mbstring/oniguruma/enc/utf32_be.c deleted file mode 100755 index 60feb040b821d..0000000000000 --- a/ext/mbstring/oniguruma/enc/utf32_be.c +++ /dev/null @@ -1,208 +0,0 @@ -/********************************************************************** - utf32_be.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int -utf32be_mbc_enc_len(const UChar* p) -{ - return 4; -} - -static int -utf32be_is_mbc_newline(const UChar* p, const UChar* end) -{ - if (p + 3 < end) { - if (*(p+3) == 0x0a && *(p+2) == 0 && *(p+1) == 0 && *p == 0) - return 1; - } - return 0; -} - -static OnigCodePoint -utf32be_mbc_to_code(const UChar* p, const UChar* end) -{ - return (OnigCodePoint )(((p[0] * 256 + p[1]) * 256 + p[2]) * 256 + p[3]); -} - -static int -utf32be_code_to_mbclen(OnigCodePoint code) -{ - return 4; -} - -static int -utf32be_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar* p = buf; - - *p++ = (UChar )((code & 0xff000000) >>24); - *p++ = (UChar )((code & 0xff0000) >>16); - *p++ = (UChar )((code & 0xff00) >> 8); - *p++ = (UChar ) (code & 0xff); - return 4; -} - -static int -utf32be_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - const UChar* p = *pp; - - if (*(p+2) == 0 && *(p+1) == 0 && *p == 0) { - p += 3; - if (end > p + 4 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+4) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+4) == 'S'))) && - *(p+3) == 0 && *(p+2) == 0 && *(p+1) == 0) { - *lower++ = '\0'; - *lower++ = '\0'; - *lower++ = '\0'; - *lower = 0xdf; - (*pp) += 8; - return 4; - } - - *lower++ = '\0'; - *lower++ = '\0'; - *lower++ = '\0'; - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - - (*pp) += 4; - return 4; /* return byte length of converted char to lower */ - } - else { - int len = 4; - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -utf32be_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp) += 4; - - if (*(p+2) == 0 && *(p+1) == 0 && *p == 0) { - int c, v; - - p += 3; - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 4 && - ((*p == 's' && *(p+4) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+4) == 'S'))) && - *(p+3) == 0 && *(p+2) == 0 && *(p+1) == 0) { - (*pp) += 4; - return TRUE; - } - else if (*p == 0xdf) { - return TRUE; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - c = *p; - v = ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(c, - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (c >= 0xaa && c <= 0xba) - return FALSE; - else - return TRUE; - } - return (v != 0 ? TRUE : FALSE); - } - } - - return FALSE; -} - -static UChar* -utf32be_left_adjust_char_head(const UChar* start, const UChar* s) -{ - int rem; - - if (s <= start) return (UChar* )s; - - rem = (s - start) % 4; - return (UChar* )(s - rem); -} - -OnigEncodingType OnigEncodingUTF32_BE = { - utf32be_mbc_enc_len, - "UTF-32BE", /* name */ - 4, /* max byte length */ - 4, /* min byte length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - utf32be_is_mbc_newline, - utf32be_mbc_to_code, - utf32be_code_to_mbclen, - utf32be_code_to_mbc, - utf32be_mbc_to_normalize, - utf32be_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - onigenc_unicode_is_code_ctype, - onigenc_unicode_get_ctype_code_range, - utf32be_left_adjust_char_head, - onigenc_always_false_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/utf32_le.c b/ext/mbstring/oniguruma/enc/utf32_le.c deleted file mode 100755 index bba9689f76174..0000000000000 --- a/ext/mbstring/oniguruma/enc/utf32_le.c +++ /dev/null @@ -1,206 +0,0 @@ -/********************************************************************** - utf32_le.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -static int -utf32le_mbc_enc_len(const UChar* p) -{ - return 4; -} - -static int -utf32le_is_mbc_newline(const UChar* p, const UChar* end) -{ - if (p + 3 < end) { - if (*p == 0x0a && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) - return 1; - } - return 0; -} - -static OnigCodePoint -utf32le_mbc_to_code(const UChar* p, const UChar* end) -{ - return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]); -} - -static int -utf32le_code_to_mbclen(OnigCodePoint code) -{ - return 4; -} - -static int -utf32le_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - UChar* p = buf; - - *p++ = (UChar ) (code & 0xff); - *p++ = (UChar )((code & 0xff00) >> 8); - *p++ = (UChar )((code & 0xff0000) >>16); - *p++ = (UChar )((code & 0xff000000) >>24); - return 4; -} - -static int -utf32le_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, - UChar* lower) -{ - const UChar* p = *pp; - - if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) { - if (end > p + 7 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+4) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+4) == 'S'))) && - *(p+5) == 0 && *(p+6) == 0 && *(p+7) == 0) { - *lower++ = 0xdf; - *lower++ = '\0'; - *lower++ = '\0'; - *lower = '\0'; - (*pp) += 8; - return 4; - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - *lower++ = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); - } - else { - *lower++ = *p; - } - *lower++ = '\0'; - *lower++ = '\0'; - *lower = '\0'; - - (*pp) += 4; - return 4; /* return byte length of converted char to lower */ - } - else { - int len = 4; - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -utf32le_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp) += 4; - - if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) { - int c, v; - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - if (end > p + 7 && - ((*p == 's' && *(p+4) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+4) == 'S'))) && - *(p+5) == 0 && *(p+6) == 0 && *(p+7) == 0) { - (*pp) += 4; - return TRUE; - } - else if (*p == 0xdf) { - return TRUE; - } - } - - if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - ONIGENC_IS_MBC_ASCII(p)) || - ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0 && - !ONIGENC_IS_MBC_ASCII(p))) { - c = *p; - v = ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(c, - (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)); - if ((v | ONIGENC_CTYPE_LOWER) != 0) { - /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ - if (c >= 0xaa && c <= 0xba) - return FALSE; - else - return TRUE; - } - return (v != 0 ? TRUE : FALSE); - } - } - - return FALSE; -} - -static UChar* -utf32le_left_adjust_char_head(const UChar* start, const UChar* s) -{ - int rem; - - if (s <= start) return (UChar* )s; - - rem = (s - start) % 4; - return (UChar* )(s - rem); -} - -OnigEncodingType OnigEncodingUTF32_LE = { - utf32le_mbc_enc_len, - "UTF-32LE", /* name */ - 4, /* max byte length */ - 4, /* min byte length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - utf32le_is_mbc_newline, - utf32le_mbc_to_code, - utf32le_code_to_mbclen, - utf32le_code_to_mbc, - utf32le_mbc_to_normalize, - utf32le_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - onigenc_unicode_is_code_ctype, - onigenc_unicode_get_ctype_code_range, - utf32le_left_adjust_char_head, - onigenc_always_false_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/enc/utf8.c b/ext/mbstring/oniguruma/enc/utf8.c deleted file mode 100644 index 592bebfe8f26c..0000000000000 --- a/ext/mbstring/oniguruma/enc/utf8.c +++ /dev/null @@ -1,3738 +0,0 @@ -/********************************************************************** - utf8.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regenc.h" - -#define USE_INVALID_CODE_SCHEME - -#ifdef USE_INVALID_CODE_SCHEME -/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */ -#define INVALID_CODE_FE 0xfffffffe -#define INVALID_CODE_FF 0xffffffff -#define VALID_CODE_LIMIT 0x7fffffff -#endif - -#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80) - -static int EncLen_UTF8[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 -}; - -static int -utf8_mbc_enc_len(const UChar* p) -{ - return EncLen_UTF8[*p]; -} - -static OnigCodePoint -utf8_mbc_to_code(const UChar* p, const UChar* end) -{ - int c, len; - OnigCodePoint n; - - len = enc_len(ONIG_ENCODING_UTF8, p); - c = *p++; - if (len > 1) { - len--; - n = c & ((1 << (6 - len)) - 1); - while (len--) { - c = *p++; - n = (n << 6) | (c & ((1 << 6) - 1)); - } - return n; - } - else { -#ifdef USE_INVALID_CODE_SCHEME - if (c > 0xfd) { - return ((c == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF); - } -#endif - return (OnigCodePoint )c; - } -} - -static int -utf8_code_to_mbclen(OnigCodePoint code) -{ - if ((code & 0xffffff80) == 0) return 1; - else if ((code & 0xfffff800) == 0) { - if (code <= 0xff && code >= 0xfe) - return 1; - return 2; - } - else if ((code & 0xffff0000) == 0) return 3; - else if ((code & 0xffe00000) == 0) return 4; - else if ((code & 0xfc000000) == 0) return 5; - else if ((code & 0x80000000) == 0) return 6; -#ifdef USE_INVALID_CODE_SCHEME - else if (code == INVALID_CODE_FE) return 1; - else if (code == INVALID_CODE_FF) return 1; -#endif - else - return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE; -} - -#if 0 -static int -utf8_code_to_mbc_first(OnigCodePoint code) -{ - if ((code & 0xffffff80) == 0) - return code; - else { - if ((code & 0xfffff800) == 0) - return ((code>>6)& 0x1f) | 0xc0; - else if ((code & 0xffff0000) == 0) - return ((code>>12) & 0x0f) | 0xe0; - else if ((code & 0xffe00000) == 0) - return ((code>>18) & 0x07) | 0xf0; - else if ((code & 0xfc000000) == 0) - return ((code>>24) & 0x03) | 0xf8; - else if ((code & 0x80000000) == 0) - return ((code>>30) & 0x01) | 0xfc; - else { - return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE; - } - } -} -#endif - -static int -utf8_code_to_mbc(OnigCodePoint code, UChar *buf) -{ -#define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80) -#define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80) - - if ((code & 0xffffff80) == 0) { - *buf = (UChar )code; - return 1; - } - else { - UChar *p = buf; - - if ((code & 0xfffff800) == 0) { - *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0); - } - else if ((code & 0xffff0000) == 0) { - *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0); - *p++ = UTF8_TRAILS(code, 6); - } - else if ((code & 0xffe00000) == 0) { - *p++ = (UChar )(((code>>18) & 0x07) | 0xf0); - *p++ = UTF8_TRAILS(code, 12); - *p++ = UTF8_TRAILS(code, 6); - } - else if ((code & 0xfc000000) == 0) { - *p++ = (UChar )(((code>>24) & 0x03) | 0xf8); - *p++ = UTF8_TRAILS(code, 18); - *p++ = UTF8_TRAILS(code, 12); - *p++ = UTF8_TRAILS(code, 6); - } - else if ((code & 0x80000000) == 0) { - *p++ = (UChar )(((code>>30) & 0x01) | 0xfc); - *p++ = UTF8_TRAILS(code, 24); - *p++ = UTF8_TRAILS(code, 18); - *p++ = UTF8_TRAILS(code, 12); - *p++ = UTF8_TRAILS(code, 6); - } -#ifdef USE_INVALID_CODE_SCHEME - else if (code == INVALID_CODE_FE) { - *p = 0xfe; - return 1; - } - else if (code == INVALID_CODE_FF) { - *p = 0xff; - return 1; - } -#endif - else { - return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE; - } - - *p++ = UTF8_TRAIL0(code); - return p - buf; - } -} - -static int -utf8_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* lower) -{ - const UChar* p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - if (end > p + 1 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S')))) { - *lower++ = '\303'; - *lower = '\237'; - (*pp) += 2; - return 2; - } - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; /* return byte length of converted char to lower */ - } - else { - int len; - - if (*p == 195) { /* 195 == '\303' */ - int c = *(p + 1); - if (c >= 128) { - if (c <= (UChar )'\236' && /* upper */ - (flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0) { - if (c != (UChar )'\227') { - *lower++ = *p; - *lower = (UChar )(c + 32); - (*pp) += 2; - return 2; - } - } -#if 0 - else if (c == (UChar )'\237' && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - *lower++ = '\303'; - *lower = '\237'; - (*pp) += 2; - return 2; - } -#endif - } - } - - len = enc_len(ONIG_ENCODING_UTF8, p); - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted char to lower */ - } -} - -static int -utf8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - if (end > p + 1 && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0 && - ((*p == 's' && *(p+1) == 's') || - ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 && - (*p == 'S' && *(p+1) == 'S')))) { - (*pp) += 2; - return TRUE; - } - - (*pp)++; - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p); - } - } - else { - (*pp) += enc_len(ONIG_ENCODING_UTF8, p); - - if (*p == 195) { /* 195 == '\303' */ - int c = *(p + 1); - if (c >= 128) { - if ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0) { - if (c <= (UChar )'\236') { /* upper */ - if (c == (UChar )'\227') return FALSE; - return TRUE; - } - else if (c >= (UChar )'\240' && c <= (UChar )'\276') { /* lower */ - if (c == (UChar )'\267') return FALSE; - return TRUE; - } - } - else if (c == (UChar )'\237' && - (flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - return TRUE; - } - } - } - } - - return FALSE; -} - - -static OnigCodePoint EmptyRange[] = { 0 }; - -static OnigCodePoint SBAlnum[] = { - 3, - 0x0030, 0x0039, - 0x0041, 0x005a, - 0x0061, 0x007a -}; - -static OnigCodePoint MBAlnum[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 411, -#else - 6, -#endif - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, - 0x00f8, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x0669, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0966, 0x096f, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09f1, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b6f, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bef, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e50, 0x0e59, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f20, 0x0f29, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1049, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1369, 0x1371, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x17e0, 0x17e9, - 0x180b, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1946, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x3005, 0x3006, - 0x302a, 0x302f, - 0x3031, 0x3035, - 0x303b, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30fa, - 0x30fc, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff10, 0xff19, - 0xff21, 0xff3a, - 0xff41, 0xff5a, - 0xff66, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10300, 0x1031e, - 0x10330, 0x10349, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBAlnum */ - -static OnigCodePoint SBAlpha[] = { - 2, - 0x0041, 0x005a, - 0x0061, 0x007a -}; - -static OnigCodePoint MBAlpha[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 394, -#else - 6, -#endif - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, - 0x00f8, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06ef, - 0x06fa, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09f0, 0x09f1, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a70, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x180b, 0x180d, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1950, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x3005, 0x3006, - 0x302a, 0x302f, - 0x3031, 0x3035, - 0x303b, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30fa, - 0x30fc, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff21, 0xff3a, - 0xff41, 0xff5a, - 0xff66, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10300, 0x1031e, - 0x10330, 0x10349, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBAlpha */ - -static OnigCodePoint SBBlank[] = { - 2, - 0x0009, 0x0009, - 0x0020, 0x0020 -}; - -static OnigCodePoint MBBlank[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 7, -#else - 1, -#endif - 0x00a0, 0x00a0 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x1680, 0x1680, - 0x180e, 0x180e, - 0x2000, 0x200a, - 0x202f, 0x202f, - 0x205f, 0x205f, - 0x3000, 0x3000 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBBlank */ - -static OnigCodePoint SBCntrl[] = { - 2, - 0x0000, 0x001f, - 0x007f, 0x007f -}; - -static OnigCodePoint MBCntrl[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 18, -#else - 2, -#endif - 0x0080, 0x009f, - 0x00ad, 0x00ad -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0600, 0x0603, - 0x06dd, 0x06dd, - 0x070f, 0x070f, - 0x17b4, 0x17b5, - 0x200b, 0x200f, - 0x202a, 0x202e, - 0x2060, 0x2063, - 0x206a, 0x206f, - 0xd800, 0xf8ff, - 0xfeff, 0xfeff, - 0xfff9, 0xfffb, - 0x1d173, 0x1d17a, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBCntrl */ - -static OnigCodePoint SBDigit[] = { - 1, - 0x0030, 0x0039 -}; - -static OnigCodePoint MBDigit[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 22, -#else - 0 -#endif -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 0x0660, 0x0669, - 0x06f0, 0x06f9, - 0x0966, 0x096f, - 0x09e6, 0x09ef, - 0x0a66, 0x0a6f, - 0x0ae6, 0x0aef, - 0x0b66, 0x0b6f, - 0x0be7, 0x0bef, - 0x0c66, 0x0c6f, - 0x0ce6, 0x0cef, - 0x0d66, 0x0d6f, - 0x0e50, 0x0e59, - 0x0ed0, 0x0ed9, - 0x0f20, 0x0f29, - 0x1040, 0x1049, - 0x1369, 0x1371, - 0x17e0, 0x17e9, - 0x1810, 0x1819, - 0x1946, 0x194f, - 0xff10, 0xff19, - 0x104a0, 0x104a9, - 0x1d7ce, 0x1d7ff -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBDigit */ - -static OnigCodePoint SBGraph[] = { - 1, - 0x0021, 0x007e -}; - -static OnigCodePoint MBGraph[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 404, -#else - 1, -#endif - 0x00a1, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x0357, - 0x035d, 0x036f, - 0x0374, 0x0375, - 0x037a, 0x037a, - 0x037e, 0x037e, - 0x0384, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03fb, - 0x0400, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x055f, - 0x0561, 0x0587, - 0x0589, 0x058a, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f4, - 0x0600, 0x0603, - 0x060c, 0x0615, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x070d, - 0x070f, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0970, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09fa, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0af1, 0x0af1, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bfa, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df4, - 0x0e01, 0x0e3a, - 0x0e3f, 0x0e5b, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fbe, 0x0fcc, - 0x0fcf, 0x0fcf, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x10fb, 0x10fb, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1361, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x1676, - 0x1681, 0x169c, - 0x16a0, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1736, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x1800, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1940, 0x1940, - 0x1944, 0x196d, - 0x1970, 0x1974, - 0x19e0, 0x19ff, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fc4, - 0x1fc6, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fdd, 0x1fef, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffe, - 0x200b, 0x2027, - 0x202a, 0x202e, - 0x2030, 0x2054, - 0x2057, 0x2057, - 0x2060, 0x2063, - 0x206a, 0x2071, - 0x2074, 0x208e, - 0x20a0, 0x20b1, - 0x20d0, 0x20ea, - 0x2100, 0x213b, - 0x213d, 0x214b, - 0x2153, 0x2183, - 0x2190, 0x23d0, - 0x2400, 0x2426, - 0x2440, 0x244a, - 0x2460, 0x2617, - 0x2619, 0x267d, - 0x2680, 0x2691, - 0x26a0, 0x26a1, - 0x2701, 0x2704, - 0x2706, 0x2709, - 0x270c, 0x2727, - 0x2729, 0x274b, - 0x274d, 0x274d, - 0x274f, 0x2752, - 0x2756, 0x2756, - 0x2758, 0x275e, - 0x2761, 0x2794, - 0x2798, 0x27af, - 0x27b1, 0x27be, - 0x27d0, 0x27eb, - 0x27f0, 0x2b0d, - 0x2e80, 0x2e99, - 0x2e9b, 0x2ef3, - 0x2f00, 0x2fd5, - 0x2ff0, 0x2ffb, - 0x3001, 0x303f, - 0x3041, 0x3096, - 0x3099, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3190, 0x31b7, - 0x31f0, 0x321e, - 0x3220, 0x3243, - 0x3250, 0x327d, - 0x327f, 0x32fe, - 0x3300, 0x4db5, - 0x4dc0, 0x9fa5, - 0xa000, 0xa48c, - 0xa490, 0xa4c6, - 0xac00, 0xd7a3, - 0xe000, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3f, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfd, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe30, 0xfe52, - 0xfe54, 0xfe66, - 0xfe68, 0xfe6b, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xfeff, 0xfeff, - 0xff01, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0xffe0, 0xffe6, - 0xffe8, 0xffee, - 0xfff9, 0xfffd, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10100, 0x10102, - 0x10107, 0x10133, - 0x10137, 0x1013f, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x1039f, 0x1039f, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d000, 0x1d0f5, - 0x1d100, 0x1d126, - 0x1d12a, 0x1d1dd, - 0x1d300, 0x1d356, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xe0100, 0xe01ef, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBGraph */ - -static OnigCodePoint SBLower[] = { - 1, - 0x0061, 0x007a -}; - -static OnigCodePoint MBLower[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 423, -#else - 5, -#endif - 0x00aa, 0x00aa, - 0x00b5, 0x00b5, - 0x00ba, 0x00ba, - 0x00df, 0x00f6, - 0x00f8, 0x00ff -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0101, 0x0101, - 0x0103, 0x0103, - 0x0105, 0x0105, - 0x0107, 0x0107, - 0x0109, 0x0109, - 0x010b, 0x010b, - 0x010d, 0x010d, - 0x010f, 0x010f, - 0x0111, 0x0111, - 0x0113, 0x0113, - 0x0115, 0x0115, - 0x0117, 0x0117, - 0x0119, 0x0119, - 0x011b, 0x011b, - 0x011d, 0x011d, - 0x011f, 0x011f, - 0x0121, 0x0121, - 0x0123, 0x0123, - 0x0125, 0x0125, - 0x0127, 0x0127, - 0x0129, 0x0129, - 0x012b, 0x012b, - 0x012d, 0x012d, - 0x012f, 0x012f, - 0x0131, 0x0131, - 0x0133, 0x0133, - 0x0135, 0x0135, - 0x0137, 0x0138, - 0x013a, 0x013a, - 0x013c, 0x013c, - 0x013e, 0x013e, - 0x0140, 0x0140, - 0x0142, 0x0142, - 0x0144, 0x0144, - 0x0146, 0x0146, - 0x0148, 0x0149, - 0x014b, 0x014b, - 0x014d, 0x014d, - 0x014f, 0x014f, - 0x0151, 0x0151, - 0x0153, 0x0153, - 0x0155, 0x0155, - 0x0157, 0x0157, - 0x0159, 0x0159, - 0x015b, 0x015b, - 0x015d, 0x015d, - 0x015f, 0x015f, - 0x0161, 0x0161, - 0x0163, 0x0163, - 0x0165, 0x0165, - 0x0167, 0x0167, - 0x0169, 0x0169, - 0x016b, 0x016b, - 0x016d, 0x016d, - 0x016f, 0x016f, - 0x0171, 0x0171, - 0x0173, 0x0173, - 0x0175, 0x0175, - 0x0177, 0x0177, - 0x017a, 0x017a, - 0x017c, 0x017c, - 0x017e, 0x0180, - 0x0183, 0x0183, - 0x0185, 0x0185, - 0x0188, 0x0188, - 0x018c, 0x018d, - 0x0192, 0x0192, - 0x0195, 0x0195, - 0x0199, 0x019b, - 0x019e, 0x019e, - 0x01a1, 0x01a1, - 0x01a3, 0x01a3, - 0x01a5, 0x01a5, - 0x01a8, 0x01a8, - 0x01aa, 0x01ab, - 0x01ad, 0x01ad, - 0x01b0, 0x01b0, - 0x01b4, 0x01b4, - 0x01b6, 0x01b6, - 0x01b9, 0x01ba, - 0x01bd, 0x01bf, - 0x01c6, 0x01c6, - 0x01c9, 0x01c9, - 0x01cc, 0x01cc, - 0x01ce, 0x01ce, - 0x01d0, 0x01d0, - 0x01d2, 0x01d2, - 0x01d4, 0x01d4, - 0x01d6, 0x01d6, - 0x01d8, 0x01d8, - 0x01da, 0x01da, - 0x01dc, 0x01dd, - 0x01df, 0x01df, - 0x01e1, 0x01e1, - 0x01e3, 0x01e3, - 0x01e5, 0x01e5, - 0x01e7, 0x01e7, - 0x01e9, 0x01e9, - 0x01eb, 0x01eb, - 0x01ed, 0x01ed, - 0x01ef, 0x01f0, - 0x01f3, 0x01f3, - 0x01f5, 0x01f5, - 0x01f9, 0x01f9, - 0x01fb, 0x01fb, - 0x01fd, 0x01fd, - 0x01ff, 0x01ff, - 0x0201, 0x0201, - 0x0203, 0x0203, - 0x0205, 0x0205, - 0x0207, 0x0207, - 0x0209, 0x0209, - 0x020b, 0x020b, - 0x020d, 0x020d, - 0x020f, 0x020f, - 0x0211, 0x0211, - 0x0213, 0x0213, - 0x0215, 0x0215, - 0x0217, 0x0217, - 0x0219, 0x0219, - 0x021b, 0x021b, - 0x021d, 0x021d, - 0x021f, 0x021f, - 0x0221, 0x0221, - 0x0223, 0x0223, - 0x0225, 0x0225, - 0x0227, 0x0227, - 0x0229, 0x0229, - 0x022b, 0x022b, - 0x022d, 0x022d, - 0x022f, 0x022f, - 0x0231, 0x0231, - 0x0233, 0x0236, - 0x0250, 0x02af, - 0x0390, 0x0390, - 0x03ac, 0x03ce, - 0x03d0, 0x03d1, - 0x03d5, 0x03d7, - 0x03d9, 0x03d9, - 0x03db, 0x03db, - 0x03dd, 0x03dd, - 0x03df, 0x03df, - 0x03e1, 0x03e1, - 0x03e3, 0x03e3, - 0x03e5, 0x03e5, - 0x03e7, 0x03e7, - 0x03e9, 0x03e9, - 0x03eb, 0x03eb, - 0x03ed, 0x03ed, - 0x03ef, 0x03f3, - 0x03f5, 0x03f5, - 0x03f8, 0x03f8, - 0x03fb, 0x03fb, - 0x0430, 0x045f, - 0x0461, 0x0461, - 0x0463, 0x0463, - 0x0465, 0x0465, - 0x0467, 0x0467, - 0x0469, 0x0469, - 0x046b, 0x046b, - 0x046d, 0x046d, - 0x046f, 0x046f, - 0x0471, 0x0471, - 0x0473, 0x0473, - 0x0475, 0x0475, - 0x0477, 0x0477, - 0x0479, 0x0479, - 0x047b, 0x047b, - 0x047d, 0x047d, - 0x047f, 0x047f, - 0x0481, 0x0481, - 0x048b, 0x048b, - 0x048d, 0x048d, - 0x048f, 0x048f, - 0x0491, 0x0491, - 0x0493, 0x0493, - 0x0495, 0x0495, - 0x0497, 0x0497, - 0x0499, 0x0499, - 0x049b, 0x049b, - 0x049d, 0x049d, - 0x049f, 0x049f, - 0x04a1, 0x04a1, - 0x04a3, 0x04a3, - 0x04a5, 0x04a5, - 0x04a7, 0x04a7, - 0x04a9, 0x04a9, - 0x04ab, 0x04ab, - 0x04ad, 0x04ad, - 0x04af, 0x04af, - 0x04b1, 0x04b1, - 0x04b3, 0x04b3, - 0x04b5, 0x04b5, - 0x04b7, 0x04b7, - 0x04b9, 0x04b9, - 0x04bb, 0x04bb, - 0x04bd, 0x04bd, - 0x04bf, 0x04bf, - 0x04c2, 0x04c2, - 0x04c4, 0x04c4, - 0x04c6, 0x04c6, - 0x04c8, 0x04c8, - 0x04ca, 0x04ca, - 0x04cc, 0x04cc, - 0x04ce, 0x04ce, - 0x04d1, 0x04d1, - 0x04d3, 0x04d3, - 0x04d5, 0x04d5, - 0x04d7, 0x04d7, - 0x04d9, 0x04d9, - 0x04db, 0x04db, - 0x04dd, 0x04dd, - 0x04df, 0x04df, - 0x04e1, 0x04e1, - 0x04e3, 0x04e3, - 0x04e5, 0x04e5, - 0x04e7, 0x04e7, - 0x04e9, 0x04e9, - 0x04eb, 0x04eb, - 0x04ed, 0x04ed, - 0x04ef, 0x04ef, - 0x04f1, 0x04f1, - 0x04f3, 0x04f3, - 0x04f5, 0x04f5, - 0x04f9, 0x04f9, - 0x0501, 0x0501, - 0x0503, 0x0503, - 0x0505, 0x0505, - 0x0507, 0x0507, - 0x0509, 0x0509, - 0x050b, 0x050b, - 0x050d, 0x050d, - 0x050f, 0x050f, - 0x0561, 0x0587, - 0x1d00, 0x1d2b, - 0x1d62, 0x1d6b, - 0x1e01, 0x1e01, - 0x1e03, 0x1e03, - 0x1e05, 0x1e05, - 0x1e07, 0x1e07, - 0x1e09, 0x1e09, - 0x1e0b, 0x1e0b, - 0x1e0d, 0x1e0d, - 0x1e0f, 0x1e0f, - 0x1e11, 0x1e11, - 0x1e13, 0x1e13, - 0x1e15, 0x1e15, - 0x1e17, 0x1e17, - 0x1e19, 0x1e19, - 0x1e1b, 0x1e1b, - 0x1e1d, 0x1e1d, - 0x1e1f, 0x1e1f, - 0x1e21, 0x1e21, - 0x1e23, 0x1e23, - 0x1e25, 0x1e25, - 0x1e27, 0x1e27, - 0x1e29, 0x1e29, - 0x1e2b, 0x1e2b, - 0x1e2d, 0x1e2d, - 0x1e2f, 0x1e2f, - 0x1e31, 0x1e31, - 0x1e33, 0x1e33, - 0x1e35, 0x1e35, - 0x1e37, 0x1e37, - 0x1e39, 0x1e39, - 0x1e3b, 0x1e3b, - 0x1e3d, 0x1e3d, - 0x1e3f, 0x1e3f, - 0x1e41, 0x1e41, - 0x1e43, 0x1e43, - 0x1e45, 0x1e45, - 0x1e47, 0x1e47, - 0x1e49, 0x1e49, - 0x1e4b, 0x1e4b, - 0x1e4d, 0x1e4d, - 0x1e4f, 0x1e4f, - 0x1e51, 0x1e51, - 0x1e53, 0x1e53, - 0x1e55, 0x1e55, - 0x1e57, 0x1e57, - 0x1e59, 0x1e59, - 0x1e5b, 0x1e5b, - 0x1e5d, 0x1e5d, - 0x1e5f, 0x1e5f, - 0x1e61, 0x1e61, - 0x1e63, 0x1e63, - 0x1e65, 0x1e65, - 0x1e67, 0x1e67, - 0x1e69, 0x1e69, - 0x1e6b, 0x1e6b, - 0x1e6d, 0x1e6d, - 0x1e6f, 0x1e6f, - 0x1e71, 0x1e71, - 0x1e73, 0x1e73, - 0x1e75, 0x1e75, - 0x1e77, 0x1e77, - 0x1e79, 0x1e79, - 0x1e7b, 0x1e7b, - 0x1e7d, 0x1e7d, - 0x1e7f, 0x1e7f, - 0x1e81, 0x1e81, - 0x1e83, 0x1e83, - 0x1e85, 0x1e85, - 0x1e87, 0x1e87, - 0x1e89, 0x1e89, - 0x1e8b, 0x1e8b, - 0x1e8d, 0x1e8d, - 0x1e8f, 0x1e8f, - 0x1e91, 0x1e91, - 0x1e93, 0x1e93, - 0x1e95, 0x1e9b, - 0x1ea1, 0x1ea1, - 0x1ea3, 0x1ea3, - 0x1ea5, 0x1ea5, - 0x1ea7, 0x1ea7, - 0x1ea9, 0x1ea9, - 0x1eab, 0x1eab, - 0x1ead, 0x1ead, - 0x1eaf, 0x1eaf, - 0x1eb1, 0x1eb1, - 0x1eb3, 0x1eb3, - 0x1eb5, 0x1eb5, - 0x1eb7, 0x1eb7, - 0x1eb9, 0x1eb9, - 0x1ebb, 0x1ebb, - 0x1ebd, 0x1ebd, - 0x1ebf, 0x1ebf, - 0x1ec1, 0x1ec1, - 0x1ec3, 0x1ec3, - 0x1ec5, 0x1ec5, - 0x1ec7, 0x1ec7, - 0x1ec9, 0x1ec9, - 0x1ecb, 0x1ecb, - 0x1ecd, 0x1ecd, - 0x1ecf, 0x1ecf, - 0x1ed1, 0x1ed1, - 0x1ed3, 0x1ed3, - 0x1ed5, 0x1ed5, - 0x1ed7, 0x1ed7, - 0x1ed9, 0x1ed9, - 0x1edb, 0x1edb, - 0x1edd, 0x1edd, - 0x1edf, 0x1edf, - 0x1ee1, 0x1ee1, - 0x1ee3, 0x1ee3, - 0x1ee5, 0x1ee5, - 0x1ee7, 0x1ee7, - 0x1ee9, 0x1ee9, - 0x1eeb, 0x1eeb, - 0x1eed, 0x1eed, - 0x1eef, 0x1eef, - 0x1ef1, 0x1ef1, - 0x1ef3, 0x1ef3, - 0x1ef5, 0x1ef5, - 0x1ef7, 0x1ef7, - 0x1ef9, 0x1ef9, - 0x1f00, 0x1f07, - 0x1f10, 0x1f15, - 0x1f20, 0x1f27, - 0x1f30, 0x1f37, - 0x1f40, 0x1f45, - 0x1f50, 0x1f57, - 0x1f60, 0x1f67, - 0x1f70, 0x1f7d, - 0x1f80, 0x1f87, - 0x1f90, 0x1f97, - 0x1fa0, 0x1fa7, - 0x1fb0, 0x1fb4, - 0x1fb6, 0x1fb7, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fc7, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fd7, - 0x1fe0, 0x1fe7, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ff7, - 0x2071, 0x2071, - 0x207f, 0x207f, - 0x210a, 0x210a, - 0x210e, 0x210f, - 0x2113, 0x2113, - 0x212f, 0x212f, - 0x2134, 0x2134, - 0x2139, 0x2139, - 0x213d, 0x213d, - 0x2146, 0x2149, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xff41, 0xff5a, - 0x10428, 0x1044f, - 0x1d41a, 0x1d433, - 0x1d44e, 0x1d454, - 0x1d456, 0x1d467, - 0x1d482, 0x1d49b, - 0x1d4b6, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d4cf, - 0x1d4ea, 0x1d503, - 0x1d51e, 0x1d537, - 0x1d552, 0x1d56b, - 0x1d586, 0x1d59f, - 0x1d5ba, 0x1d5d3, - 0x1d5ee, 0x1d607, - 0x1d622, 0x1d63b, - 0x1d656, 0x1d66f, - 0x1d68a, 0x1d6a3, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6e1, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d71b, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d755, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d78f, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBLower */ - -static OnigCodePoint SBPrint[] = { - 2, - 0x0009, 0x000d, - 0x0020, 0x007e -}; - -static OnigCodePoint MBPrint[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 403, -#else - 2, -#endif - 0x0085, 0x0085, - 0x00a0, 0x0236 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0250, 0x0357, - 0x035d, 0x036f, - 0x0374, 0x0375, - 0x037a, 0x037a, - 0x037e, 0x037e, - 0x0384, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03fb, - 0x0400, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x055f, - 0x0561, 0x0587, - 0x0589, 0x058a, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f4, - 0x0600, 0x0603, - 0x060c, 0x0615, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x070d, - 0x070f, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0970, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09fa, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0af1, 0x0af1, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bfa, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df4, - 0x0e01, 0x0e3a, - 0x0e3f, 0x0e5b, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fbe, 0x0fcc, - 0x0fcf, 0x0fcf, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x10fb, 0x10fb, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1361, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x1676, - 0x1680, 0x169c, - 0x16a0, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1736, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x1800, 0x180e, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1940, 0x1940, - 0x1944, 0x196d, - 0x1970, 0x1974, - 0x19e0, 0x19ff, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fc4, - 0x1fc6, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fdd, 0x1fef, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffe, - 0x2000, 0x2054, - 0x2057, 0x2057, - 0x205f, 0x2063, - 0x206a, 0x2071, - 0x2074, 0x208e, - 0x20a0, 0x20b1, - 0x20d0, 0x20ea, - 0x2100, 0x213b, - 0x213d, 0x214b, - 0x2153, 0x2183, - 0x2190, 0x23d0, - 0x2400, 0x2426, - 0x2440, 0x244a, - 0x2460, 0x2617, - 0x2619, 0x267d, - 0x2680, 0x2691, - 0x26a0, 0x26a1, - 0x2701, 0x2704, - 0x2706, 0x2709, - 0x270c, 0x2727, - 0x2729, 0x274b, - 0x274d, 0x274d, - 0x274f, 0x2752, - 0x2756, 0x2756, - 0x2758, 0x275e, - 0x2761, 0x2794, - 0x2798, 0x27af, - 0x27b1, 0x27be, - 0x27d0, 0x27eb, - 0x27f0, 0x2b0d, - 0x2e80, 0x2e99, - 0x2e9b, 0x2ef3, - 0x2f00, 0x2fd5, - 0x2ff0, 0x2ffb, - 0x3000, 0x303f, - 0x3041, 0x3096, - 0x3099, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3190, 0x31b7, - 0x31f0, 0x321e, - 0x3220, 0x3243, - 0x3250, 0x327d, - 0x327f, 0x32fe, - 0x3300, 0x4db5, - 0x4dc0, 0x9fa5, - 0xa000, 0xa48c, - 0xa490, 0xa4c6, - 0xac00, 0xd7a3, - 0xe000, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3f, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfd, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe30, 0xfe52, - 0xfe54, 0xfe66, - 0xfe68, 0xfe6b, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xfeff, 0xfeff, - 0xff01, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0xffe0, 0xffe6, - 0xffe8, 0xffee, - 0xfff9, 0xfffd, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10100, 0x10102, - 0x10107, 0x10133, - 0x10137, 0x1013f, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x1039f, 0x1039f, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d000, 0x1d0f5, - 0x1d100, 0x1d126, - 0x1d12a, 0x1d1dd, - 0x1d300, 0x1d356, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0001, 0xe0001, - 0xe0020, 0xe007f, - 0xe0100, 0xe01ef, - 0xf0000, 0xffffd, - 0x100000, 0x10fffd -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBPrint */ - -static OnigCodePoint SBPunct[] = { - 9, - 0x0021, 0x0023, - 0x0025, 0x002a, - 0x002c, 0x002f, - 0x003a, 0x003b, - 0x003f, 0x0040, - 0x005b, 0x005d, - 0x005f, 0x005f, - 0x007b, 0x007b, - 0x007d, 0x007d -}; /* end of SBPunct */ - -static OnigCodePoint MBPunct[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 77, -#else - 5, -#endif - 0x00a1, 0x00a1, - 0x00ab, 0x00ab, - 0x00b7, 0x00b7, - 0x00bb, 0x00bb, - 0x00bf, 0x00bf -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x037e, 0x037e, - 0x0387, 0x0387, - 0x055a, 0x055f, - 0x0589, 0x058a, - 0x05be, 0x05be, - 0x05c0, 0x05c0, - 0x05c3, 0x05c3, - 0x05f3, 0x05f4, - 0x060c, 0x060d, - 0x061b, 0x061b, - 0x061f, 0x061f, - 0x066a, 0x066d, - 0x06d4, 0x06d4, - 0x0700, 0x070d, - 0x0964, 0x0965, - 0x0970, 0x0970, - 0x0df4, 0x0df4, - 0x0e4f, 0x0e4f, - 0x0e5a, 0x0e5b, - 0x0f04, 0x0f12, - 0x0f3a, 0x0f3d, - 0x0f85, 0x0f85, - 0x104a, 0x104f, - 0x10fb, 0x10fb, - 0x1361, 0x1368, - 0x166d, 0x166e, - 0x169b, 0x169c, - 0x16eb, 0x16ed, - 0x1735, 0x1736, - 0x17d4, 0x17d6, - 0x17d8, 0x17da, - 0x1800, 0x180a, - 0x1944, 0x1945, - 0x2010, 0x2027, - 0x2030, 0x2043, - 0x2045, 0x2051, - 0x2053, 0x2054, - 0x2057, 0x2057, - 0x207d, 0x207e, - 0x208d, 0x208e, - 0x2329, 0x232a, - 0x23b4, 0x23b6, - 0x2768, 0x2775, - 0x27e6, 0x27eb, - 0x2983, 0x2998, - 0x29d8, 0x29db, - 0x29fc, 0x29fd, - 0x3001, 0x3003, - 0x3008, 0x3011, - 0x3014, 0x301f, - 0x3030, 0x3030, - 0x303d, 0x303d, - 0x30a0, 0x30a0, - 0x30fb, 0x30fb, - 0xfd3e, 0xfd3f, - 0xfe30, 0xfe52, - 0xfe54, 0xfe61, - 0xfe63, 0xfe63, - 0xfe68, 0xfe68, - 0xfe6a, 0xfe6b, - 0xff01, 0xff03, - 0xff05, 0xff0a, - 0xff0c, 0xff0f, - 0xff1a, 0xff1b, - 0xff1f, 0xff20, - 0xff3b, 0xff3d, - 0xff3f, 0xff3f, - 0xff5b, 0xff5b, - 0xff5d, 0xff5d, - 0xff5f, 0xff65, - 0x10100, 0x10101, - 0x1039f, 0x1039f -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBPunct */ - -static OnigCodePoint SBSpace[] = { - 2, - 0x0009, 0x000d, - 0x0020, 0x0020 -}; - -static OnigCodePoint MBSpace[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 9, -#else - 2, -#endif - 0x0085, 0x0085, - 0x00a0, 0x00a0 -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x1680, 0x1680, - 0x180e, 0x180e, - 0x2000, 0x200a, - 0x2028, 0x2029, - 0x202f, 0x202f, - 0x205f, 0x205f, - 0x3000, 0x3000 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBSpace */ - -static OnigCodePoint SBUpper[] = { - 1, - 0x0041, 0x005a -}; - -static OnigCodePoint MBUpper[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 420, -#else - 2, -#endif - 0x00c0, 0x00d6, - 0x00d8, 0x00de -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - , - 0x0100, 0x0100, - 0x0102, 0x0102, - 0x0104, 0x0104, - 0x0106, 0x0106, - 0x0108, 0x0108, - 0x010a, 0x010a, - 0x010c, 0x010c, - 0x010e, 0x010e, - 0x0110, 0x0110, - 0x0112, 0x0112, - 0x0114, 0x0114, - 0x0116, 0x0116, - 0x0118, 0x0118, - 0x011a, 0x011a, - 0x011c, 0x011c, - 0x011e, 0x011e, - 0x0120, 0x0120, - 0x0122, 0x0122, - 0x0124, 0x0124, - 0x0126, 0x0126, - 0x0128, 0x0128, - 0x012a, 0x012a, - 0x012c, 0x012c, - 0x012e, 0x012e, - 0x0130, 0x0130, - 0x0132, 0x0132, - 0x0134, 0x0134, - 0x0136, 0x0136, - 0x0139, 0x0139, - 0x013b, 0x013b, - 0x013d, 0x013d, - 0x013f, 0x013f, - 0x0141, 0x0141, - 0x0143, 0x0143, - 0x0145, 0x0145, - 0x0147, 0x0147, - 0x014a, 0x014a, - 0x014c, 0x014c, - 0x014e, 0x014e, - 0x0150, 0x0150, - 0x0152, 0x0152, - 0x0154, 0x0154, - 0x0156, 0x0156, - 0x0158, 0x0158, - 0x015a, 0x015a, - 0x015c, 0x015c, - 0x015e, 0x015e, - 0x0160, 0x0160, - 0x0162, 0x0162, - 0x0164, 0x0164, - 0x0166, 0x0166, - 0x0168, 0x0168, - 0x016a, 0x016a, - 0x016c, 0x016c, - 0x016e, 0x016e, - 0x0170, 0x0170, - 0x0172, 0x0172, - 0x0174, 0x0174, - 0x0176, 0x0176, - 0x0178, 0x0179, - 0x017b, 0x017b, - 0x017d, 0x017d, - 0x0181, 0x0182, - 0x0184, 0x0184, - 0x0186, 0x0187, - 0x0189, 0x018b, - 0x018e, 0x0191, - 0x0193, 0x0194, - 0x0196, 0x0198, - 0x019c, 0x019d, - 0x019f, 0x01a0, - 0x01a2, 0x01a2, - 0x01a4, 0x01a4, - 0x01a6, 0x01a7, - 0x01a9, 0x01a9, - 0x01ac, 0x01ac, - 0x01ae, 0x01af, - 0x01b1, 0x01b3, - 0x01b5, 0x01b5, - 0x01b7, 0x01b8, - 0x01bc, 0x01bc, - 0x01c4, 0x01c4, - 0x01c7, 0x01c7, - 0x01ca, 0x01ca, - 0x01cd, 0x01cd, - 0x01cf, 0x01cf, - 0x01d1, 0x01d1, - 0x01d3, 0x01d3, - 0x01d5, 0x01d5, - 0x01d7, 0x01d7, - 0x01d9, 0x01d9, - 0x01db, 0x01db, - 0x01de, 0x01de, - 0x01e0, 0x01e0, - 0x01e2, 0x01e2, - 0x01e4, 0x01e4, - 0x01e6, 0x01e6, - 0x01e8, 0x01e8, - 0x01ea, 0x01ea, - 0x01ec, 0x01ec, - 0x01ee, 0x01ee, - 0x01f1, 0x01f1, - 0x01f4, 0x01f4, - 0x01f6, 0x01f8, - 0x01fa, 0x01fa, - 0x01fc, 0x01fc, - 0x01fe, 0x01fe, - 0x0200, 0x0200, - 0x0202, 0x0202, - 0x0204, 0x0204, - 0x0206, 0x0206, - 0x0208, 0x0208, - 0x020a, 0x020a, - 0x020c, 0x020c, - 0x020e, 0x020e, - 0x0210, 0x0210, - 0x0212, 0x0212, - 0x0214, 0x0214, - 0x0216, 0x0216, - 0x0218, 0x0218, - 0x021a, 0x021a, - 0x021c, 0x021c, - 0x021e, 0x021e, - 0x0220, 0x0220, - 0x0222, 0x0222, - 0x0224, 0x0224, - 0x0226, 0x0226, - 0x0228, 0x0228, - 0x022a, 0x022a, - 0x022c, 0x022c, - 0x022e, 0x022e, - 0x0230, 0x0230, - 0x0232, 0x0232, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x038f, - 0x0391, 0x03a1, - 0x03a3, 0x03ab, - 0x03d2, 0x03d4, - 0x03d8, 0x03d8, - 0x03da, 0x03da, - 0x03dc, 0x03dc, - 0x03de, 0x03de, - 0x03e0, 0x03e0, - 0x03e2, 0x03e2, - 0x03e4, 0x03e4, - 0x03e6, 0x03e6, - 0x03e8, 0x03e8, - 0x03ea, 0x03ea, - 0x03ec, 0x03ec, - 0x03ee, 0x03ee, - 0x03f4, 0x03f4, - 0x03f7, 0x03f7, - 0x03f9, 0x03fa, - 0x0400, 0x042f, - 0x0460, 0x0460, - 0x0462, 0x0462, - 0x0464, 0x0464, - 0x0466, 0x0466, - 0x0468, 0x0468, - 0x046a, 0x046a, - 0x046c, 0x046c, - 0x046e, 0x046e, - 0x0470, 0x0470, - 0x0472, 0x0472, - 0x0474, 0x0474, - 0x0476, 0x0476, - 0x0478, 0x0478, - 0x047a, 0x047a, - 0x047c, 0x047c, - 0x047e, 0x047e, - 0x0480, 0x0480, - 0x048a, 0x048a, - 0x048c, 0x048c, - 0x048e, 0x048e, - 0x0490, 0x0490, - 0x0492, 0x0492, - 0x0494, 0x0494, - 0x0496, 0x0496, - 0x0498, 0x0498, - 0x049a, 0x049a, - 0x049c, 0x049c, - 0x049e, 0x049e, - 0x04a0, 0x04a0, - 0x04a2, 0x04a2, - 0x04a4, 0x04a4, - 0x04a6, 0x04a6, - 0x04a8, 0x04a8, - 0x04aa, 0x04aa, - 0x04ac, 0x04ac, - 0x04ae, 0x04ae, - 0x04b0, 0x04b0, - 0x04b2, 0x04b2, - 0x04b4, 0x04b4, - 0x04b6, 0x04b6, - 0x04b8, 0x04b8, - 0x04ba, 0x04ba, - 0x04bc, 0x04bc, - 0x04be, 0x04be, - 0x04c0, 0x04c1, - 0x04c3, 0x04c3, - 0x04c5, 0x04c5, - 0x04c7, 0x04c7, - 0x04c9, 0x04c9, - 0x04cb, 0x04cb, - 0x04cd, 0x04cd, - 0x04d0, 0x04d0, - 0x04d2, 0x04d2, - 0x04d4, 0x04d4, - 0x04d6, 0x04d6, - 0x04d8, 0x04d8, - 0x04da, 0x04da, - 0x04dc, 0x04dc, - 0x04de, 0x04de, - 0x04e0, 0x04e0, - 0x04e2, 0x04e2, - 0x04e4, 0x04e4, - 0x04e6, 0x04e6, - 0x04e8, 0x04e8, - 0x04ea, 0x04ea, - 0x04ec, 0x04ec, - 0x04ee, 0x04ee, - 0x04f0, 0x04f0, - 0x04f2, 0x04f2, - 0x04f4, 0x04f4, - 0x04f8, 0x04f8, - 0x0500, 0x0500, - 0x0502, 0x0502, - 0x0504, 0x0504, - 0x0506, 0x0506, - 0x0508, 0x0508, - 0x050a, 0x050a, - 0x050c, 0x050c, - 0x050e, 0x050e, - 0x0531, 0x0556, - 0x10a0, 0x10c5, - 0x1e00, 0x1e00, - 0x1e02, 0x1e02, - 0x1e04, 0x1e04, - 0x1e06, 0x1e06, - 0x1e08, 0x1e08, - 0x1e0a, 0x1e0a, - 0x1e0c, 0x1e0c, - 0x1e0e, 0x1e0e, - 0x1e10, 0x1e10, - 0x1e12, 0x1e12, - 0x1e14, 0x1e14, - 0x1e16, 0x1e16, - 0x1e18, 0x1e18, - 0x1e1a, 0x1e1a, - 0x1e1c, 0x1e1c, - 0x1e1e, 0x1e1e, - 0x1e20, 0x1e20, - 0x1e22, 0x1e22, - 0x1e24, 0x1e24, - 0x1e26, 0x1e26, - 0x1e28, 0x1e28, - 0x1e2a, 0x1e2a, - 0x1e2c, 0x1e2c, - 0x1e2e, 0x1e2e, - 0x1e30, 0x1e30, - 0x1e32, 0x1e32, - 0x1e34, 0x1e34, - 0x1e36, 0x1e36, - 0x1e38, 0x1e38, - 0x1e3a, 0x1e3a, - 0x1e3c, 0x1e3c, - 0x1e3e, 0x1e3e, - 0x1e40, 0x1e40, - 0x1e42, 0x1e42, - 0x1e44, 0x1e44, - 0x1e46, 0x1e46, - 0x1e48, 0x1e48, - 0x1e4a, 0x1e4a, - 0x1e4c, 0x1e4c, - 0x1e4e, 0x1e4e, - 0x1e50, 0x1e50, - 0x1e52, 0x1e52, - 0x1e54, 0x1e54, - 0x1e56, 0x1e56, - 0x1e58, 0x1e58, - 0x1e5a, 0x1e5a, - 0x1e5c, 0x1e5c, - 0x1e5e, 0x1e5e, - 0x1e60, 0x1e60, - 0x1e62, 0x1e62, - 0x1e64, 0x1e64, - 0x1e66, 0x1e66, - 0x1e68, 0x1e68, - 0x1e6a, 0x1e6a, - 0x1e6c, 0x1e6c, - 0x1e6e, 0x1e6e, - 0x1e70, 0x1e70, - 0x1e72, 0x1e72, - 0x1e74, 0x1e74, - 0x1e76, 0x1e76, - 0x1e78, 0x1e78, - 0x1e7a, 0x1e7a, - 0x1e7c, 0x1e7c, - 0x1e7e, 0x1e7e, - 0x1e80, 0x1e80, - 0x1e82, 0x1e82, - 0x1e84, 0x1e84, - 0x1e86, 0x1e86, - 0x1e88, 0x1e88, - 0x1e8a, 0x1e8a, - 0x1e8c, 0x1e8c, - 0x1e8e, 0x1e8e, - 0x1e90, 0x1e90, - 0x1e92, 0x1e92, - 0x1e94, 0x1e94, - 0x1ea0, 0x1ea0, - 0x1ea2, 0x1ea2, - 0x1ea4, 0x1ea4, - 0x1ea6, 0x1ea6, - 0x1ea8, 0x1ea8, - 0x1eaa, 0x1eaa, - 0x1eac, 0x1eac, - 0x1eae, 0x1eae, - 0x1eb0, 0x1eb0, - 0x1eb2, 0x1eb2, - 0x1eb4, 0x1eb4, - 0x1eb6, 0x1eb6, - 0x1eb8, 0x1eb8, - 0x1eba, 0x1eba, - 0x1ebc, 0x1ebc, - 0x1ebe, 0x1ebe, - 0x1ec0, 0x1ec0, - 0x1ec2, 0x1ec2, - 0x1ec4, 0x1ec4, - 0x1ec6, 0x1ec6, - 0x1ec8, 0x1ec8, - 0x1eca, 0x1eca, - 0x1ecc, 0x1ecc, - 0x1ece, 0x1ece, - 0x1ed0, 0x1ed0, - 0x1ed2, 0x1ed2, - 0x1ed4, 0x1ed4, - 0x1ed6, 0x1ed6, - 0x1ed8, 0x1ed8, - 0x1eda, 0x1eda, - 0x1edc, 0x1edc, - 0x1ede, 0x1ede, - 0x1ee0, 0x1ee0, - 0x1ee2, 0x1ee2, - 0x1ee4, 0x1ee4, - 0x1ee6, 0x1ee6, - 0x1ee8, 0x1ee8, - 0x1eea, 0x1eea, - 0x1eec, 0x1eec, - 0x1eee, 0x1eee, - 0x1ef0, 0x1ef0, - 0x1ef2, 0x1ef2, - 0x1ef4, 0x1ef4, - 0x1ef6, 0x1ef6, - 0x1ef8, 0x1ef8, - 0x1f08, 0x1f0f, - 0x1f18, 0x1f1d, - 0x1f28, 0x1f2f, - 0x1f38, 0x1f3f, - 0x1f48, 0x1f4d, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f5f, - 0x1f68, 0x1f6f, - 0x1fb8, 0x1fbb, - 0x1fc8, 0x1fcb, - 0x1fd8, 0x1fdb, - 0x1fe8, 0x1fec, - 0x1ff8, 0x1ffb, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210b, 0x210d, - 0x2110, 0x2112, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x2130, 0x2131, - 0x2133, 0x2133, - 0x213e, 0x213f, - 0x2145, 0x2145, - 0xff21, 0xff3a, - 0x10400, 0x10427, - 0x1d400, 0x1d419, - 0x1d434, 0x1d44d, - 0x1d468, 0x1d481, - 0x1d49c, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b5, - 0x1d4d0, 0x1d4e9, - 0x1d504, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d538, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d56c, 0x1d585, - 0x1d5a0, 0x1d5b9, - 0x1d5d4, 0x1d5ed, - 0x1d608, 0x1d621, - 0x1d63c, 0x1d655, - 0x1d670, 0x1d689, - 0x1d6a8, 0x1d6c0, - 0x1d6e2, 0x1d6fa, - 0x1d71c, 0x1d734, - 0x1d756, 0x1d76e, - 0x1d790, 0x1d7a8 -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBUpper */ - -static OnigCodePoint SBXDigit[] = { - 3, - 0x0030, 0x0039, - 0x0041, 0x0046, - 0x0061, 0x0066 -}; - -static OnigCodePoint SBASCII[] = { - 1, - 0x0000, 0x007f -}; - -static OnigCodePoint SBWord[] = { - 4, - 0x0030, 0x0039, - 0x0041, 0x005a, - 0x005f, 0x005f, - 0x0061, 0x007a -}; - -static OnigCodePoint MBWord[] = { -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - 432, -#else - 8, -#endif - 0x00aa, 0x00aa, - 0x00b2, 0x00b3, - 0x00b5, 0x00b5, - 0x00b9, 0x00ba, - 0x00bc, 0x00be, - 0x00c0, 0x00d6, - 0x00d8, 0x00f6, -#ifndef USE_UNICODE_FULL_RANGE_CTYPE - 0x00f8, 0x7fffffff -#else /* not USE_UNICODE_FULL_RANGE_CTYPE */ - 0x00f8, 0x0236, - 0x0250, 0x02c1, - 0x02c6, 0x02d1, - 0x02e0, 0x02e4, - 0x02ee, 0x02ee, - 0x0300, 0x0357, - 0x035d, 0x036f, - 0x037a, 0x037a, - 0x0386, 0x0386, - 0x0388, 0x038a, - 0x038c, 0x038c, - 0x038e, 0x03a1, - 0x03a3, 0x03ce, - 0x03d0, 0x03f5, - 0x03f7, 0x03fb, - 0x0400, 0x0481, - 0x0483, 0x0486, - 0x0488, 0x04ce, - 0x04d0, 0x04f5, - 0x04f8, 0x04f9, - 0x0500, 0x050f, - 0x0531, 0x0556, - 0x0559, 0x0559, - 0x0561, 0x0587, - 0x0591, 0x05a1, - 0x05a3, 0x05b9, - 0x05bb, 0x05bd, - 0x05bf, 0x05bf, - 0x05c1, 0x05c2, - 0x05c4, 0x05c4, - 0x05d0, 0x05ea, - 0x05f0, 0x05f2, - 0x0610, 0x0615, - 0x0621, 0x063a, - 0x0640, 0x0658, - 0x0660, 0x0669, - 0x066e, 0x06d3, - 0x06d5, 0x06dc, - 0x06de, 0x06e8, - 0x06ea, 0x06fc, - 0x06ff, 0x06ff, - 0x0710, 0x074a, - 0x074d, 0x074f, - 0x0780, 0x07b1, - 0x0901, 0x0939, - 0x093c, 0x094d, - 0x0950, 0x0954, - 0x0958, 0x0963, - 0x0966, 0x096f, - 0x0981, 0x0983, - 0x0985, 0x098c, - 0x098f, 0x0990, - 0x0993, 0x09a8, - 0x09aa, 0x09b0, - 0x09b2, 0x09b2, - 0x09b6, 0x09b9, - 0x09bc, 0x09c4, - 0x09c7, 0x09c8, - 0x09cb, 0x09cd, - 0x09d7, 0x09d7, - 0x09dc, 0x09dd, - 0x09df, 0x09e3, - 0x09e6, 0x09f1, - 0x09f4, 0x09f9, - 0x0a01, 0x0a03, - 0x0a05, 0x0a0a, - 0x0a0f, 0x0a10, - 0x0a13, 0x0a28, - 0x0a2a, 0x0a30, - 0x0a32, 0x0a33, - 0x0a35, 0x0a36, - 0x0a38, 0x0a39, - 0x0a3c, 0x0a3c, - 0x0a3e, 0x0a42, - 0x0a47, 0x0a48, - 0x0a4b, 0x0a4d, - 0x0a59, 0x0a5c, - 0x0a5e, 0x0a5e, - 0x0a66, 0x0a74, - 0x0a81, 0x0a83, - 0x0a85, 0x0a8d, - 0x0a8f, 0x0a91, - 0x0a93, 0x0aa8, - 0x0aaa, 0x0ab0, - 0x0ab2, 0x0ab3, - 0x0ab5, 0x0ab9, - 0x0abc, 0x0ac5, - 0x0ac7, 0x0ac9, - 0x0acb, 0x0acd, - 0x0ad0, 0x0ad0, - 0x0ae0, 0x0ae3, - 0x0ae6, 0x0aef, - 0x0b01, 0x0b03, - 0x0b05, 0x0b0c, - 0x0b0f, 0x0b10, - 0x0b13, 0x0b28, - 0x0b2a, 0x0b30, - 0x0b32, 0x0b33, - 0x0b35, 0x0b39, - 0x0b3c, 0x0b43, - 0x0b47, 0x0b48, - 0x0b4b, 0x0b4d, - 0x0b56, 0x0b57, - 0x0b5c, 0x0b5d, - 0x0b5f, 0x0b61, - 0x0b66, 0x0b6f, - 0x0b71, 0x0b71, - 0x0b82, 0x0b83, - 0x0b85, 0x0b8a, - 0x0b8e, 0x0b90, - 0x0b92, 0x0b95, - 0x0b99, 0x0b9a, - 0x0b9c, 0x0b9c, - 0x0b9e, 0x0b9f, - 0x0ba3, 0x0ba4, - 0x0ba8, 0x0baa, - 0x0bae, 0x0bb5, - 0x0bb7, 0x0bb9, - 0x0bbe, 0x0bc2, - 0x0bc6, 0x0bc8, - 0x0bca, 0x0bcd, - 0x0bd7, 0x0bd7, - 0x0be7, 0x0bf2, - 0x0c01, 0x0c03, - 0x0c05, 0x0c0c, - 0x0c0e, 0x0c10, - 0x0c12, 0x0c28, - 0x0c2a, 0x0c33, - 0x0c35, 0x0c39, - 0x0c3e, 0x0c44, - 0x0c46, 0x0c48, - 0x0c4a, 0x0c4d, - 0x0c55, 0x0c56, - 0x0c60, 0x0c61, - 0x0c66, 0x0c6f, - 0x0c82, 0x0c83, - 0x0c85, 0x0c8c, - 0x0c8e, 0x0c90, - 0x0c92, 0x0ca8, - 0x0caa, 0x0cb3, - 0x0cb5, 0x0cb9, - 0x0cbc, 0x0cc4, - 0x0cc6, 0x0cc8, - 0x0cca, 0x0ccd, - 0x0cd5, 0x0cd6, - 0x0cde, 0x0cde, - 0x0ce0, 0x0ce1, - 0x0ce6, 0x0cef, - 0x0d02, 0x0d03, - 0x0d05, 0x0d0c, - 0x0d0e, 0x0d10, - 0x0d12, 0x0d28, - 0x0d2a, 0x0d39, - 0x0d3e, 0x0d43, - 0x0d46, 0x0d48, - 0x0d4a, 0x0d4d, - 0x0d57, 0x0d57, - 0x0d60, 0x0d61, - 0x0d66, 0x0d6f, - 0x0d82, 0x0d83, - 0x0d85, 0x0d96, - 0x0d9a, 0x0db1, - 0x0db3, 0x0dbb, - 0x0dbd, 0x0dbd, - 0x0dc0, 0x0dc6, - 0x0dca, 0x0dca, - 0x0dcf, 0x0dd4, - 0x0dd6, 0x0dd6, - 0x0dd8, 0x0ddf, - 0x0df2, 0x0df3, - 0x0e01, 0x0e3a, - 0x0e40, 0x0e4e, - 0x0e50, 0x0e59, - 0x0e81, 0x0e82, - 0x0e84, 0x0e84, - 0x0e87, 0x0e88, - 0x0e8a, 0x0e8a, - 0x0e8d, 0x0e8d, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0ea5, 0x0ea5, - 0x0ea7, 0x0ea7, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb9, - 0x0ebb, 0x0ebd, - 0x0ec0, 0x0ec4, - 0x0ec6, 0x0ec6, - 0x0ec8, 0x0ecd, - 0x0ed0, 0x0ed9, - 0x0edc, 0x0edd, - 0x0f00, 0x0f00, - 0x0f18, 0x0f19, - 0x0f20, 0x0f33, - 0x0f35, 0x0f35, - 0x0f37, 0x0f37, - 0x0f39, 0x0f39, - 0x0f3e, 0x0f47, - 0x0f49, 0x0f6a, - 0x0f71, 0x0f84, - 0x0f86, 0x0f8b, - 0x0f90, 0x0f97, - 0x0f99, 0x0fbc, - 0x0fc6, 0x0fc6, - 0x1000, 0x1021, - 0x1023, 0x1027, - 0x1029, 0x102a, - 0x102c, 0x1032, - 0x1036, 0x1039, - 0x1040, 0x1049, - 0x1050, 0x1059, - 0x10a0, 0x10c5, - 0x10d0, 0x10f8, - 0x1100, 0x1159, - 0x115f, 0x11a2, - 0x11a8, 0x11f9, - 0x1200, 0x1206, - 0x1208, 0x1246, - 0x1248, 0x1248, - 0x124a, 0x124d, - 0x1250, 0x1256, - 0x1258, 0x1258, - 0x125a, 0x125d, - 0x1260, 0x1286, - 0x1288, 0x1288, - 0x128a, 0x128d, - 0x1290, 0x12ae, - 0x12b0, 0x12b0, - 0x12b2, 0x12b5, - 0x12b8, 0x12be, - 0x12c0, 0x12c0, - 0x12c2, 0x12c5, - 0x12c8, 0x12ce, - 0x12d0, 0x12d6, - 0x12d8, 0x12ee, - 0x12f0, 0x130e, - 0x1310, 0x1310, - 0x1312, 0x1315, - 0x1318, 0x131e, - 0x1320, 0x1346, - 0x1348, 0x135a, - 0x1369, 0x137c, - 0x13a0, 0x13f4, - 0x1401, 0x166c, - 0x166f, 0x1676, - 0x1681, 0x169a, - 0x16a0, 0x16ea, - 0x16ee, 0x16f0, - 0x1700, 0x170c, - 0x170e, 0x1714, - 0x1720, 0x1734, - 0x1740, 0x1753, - 0x1760, 0x176c, - 0x176e, 0x1770, - 0x1772, 0x1773, - 0x1780, 0x17b3, - 0x17b6, 0x17d3, - 0x17d7, 0x17d7, - 0x17dc, 0x17dd, - 0x17e0, 0x17e9, - 0x17f0, 0x17f9, - 0x180b, 0x180d, - 0x1810, 0x1819, - 0x1820, 0x1877, - 0x1880, 0x18a9, - 0x1900, 0x191c, - 0x1920, 0x192b, - 0x1930, 0x193b, - 0x1946, 0x196d, - 0x1970, 0x1974, - 0x1d00, 0x1d6b, - 0x1e00, 0x1e9b, - 0x1ea0, 0x1ef9, - 0x1f00, 0x1f15, - 0x1f18, 0x1f1d, - 0x1f20, 0x1f45, - 0x1f48, 0x1f4d, - 0x1f50, 0x1f57, - 0x1f59, 0x1f59, - 0x1f5b, 0x1f5b, - 0x1f5d, 0x1f5d, - 0x1f5f, 0x1f7d, - 0x1f80, 0x1fb4, - 0x1fb6, 0x1fbc, - 0x1fbe, 0x1fbe, - 0x1fc2, 0x1fc4, - 0x1fc6, 0x1fcc, - 0x1fd0, 0x1fd3, - 0x1fd6, 0x1fdb, - 0x1fe0, 0x1fec, - 0x1ff2, 0x1ff4, - 0x1ff6, 0x1ffc, - 0x203f, 0x2040, - 0x2054, 0x2054, - 0x2070, 0x2071, - 0x2074, 0x2079, - 0x207f, 0x2089, - 0x20d0, 0x20ea, - 0x2102, 0x2102, - 0x2107, 0x2107, - 0x210a, 0x2113, - 0x2115, 0x2115, - 0x2119, 0x211d, - 0x2124, 0x2124, - 0x2126, 0x2126, - 0x2128, 0x2128, - 0x212a, 0x212d, - 0x212f, 0x2131, - 0x2133, 0x2139, - 0x213d, 0x213f, - 0x2145, 0x2149, - 0x2153, 0x2183, - 0x2460, 0x249b, - 0x24ea, 0x24ff, - 0x2776, 0x2793, - 0x3005, 0x3007, - 0x3021, 0x302f, - 0x3031, 0x3035, - 0x3038, 0x303c, - 0x3041, 0x3096, - 0x3099, 0x309a, - 0x309d, 0x309f, - 0x30a1, 0x30ff, - 0x3105, 0x312c, - 0x3131, 0x318e, - 0x3192, 0x3195, - 0x31a0, 0x31b7, - 0x31f0, 0x31ff, - 0x3220, 0x3229, - 0x3251, 0x325f, - 0x3280, 0x3289, - 0x32b1, 0x32bf, - 0x3400, 0x4db5, - 0x4e00, 0x9fa5, - 0xa000, 0xa48c, - 0xac00, 0xd7a3, - 0xf900, 0xfa2d, - 0xfa30, 0xfa6a, - 0xfb00, 0xfb06, - 0xfb13, 0xfb17, - 0xfb1d, 0xfb28, - 0xfb2a, 0xfb36, - 0xfb38, 0xfb3c, - 0xfb3e, 0xfb3e, - 0xfb40, 0xfb41, - 0xfb43, 0xfb44, - 0xfb46, 0xfbb1, - 0xfbd3, 0xfd3d, - 0xfd50, 0xfd8f, - 0xfd92, 0xfdc7, - 0xfdf0, 0xfdfb, - 0xfe00, 0xfe0f, - 0xfe20, 0xfe23, - 0xfe33, 0xfe34, - 0xfe4d, 0xfe4f, - 0xfe70, 0xfe74, - 0xfe76, 0xfefc, - 0xff10, 0xff19, - 0xff21, 0xff3a, - 0xff3f, 0xff3f, - 0xff41, 0xff5a, - 0xff65, 0xffbe, - 0xffc2, 0xffc7, - 0xffca, 0xffcf, - 0xffd2, 0xffd7, - 0xffda, 0xffdc, - 0x10000, 0x1000b, - 0x1000d, 0x10026, - 0x10028, 0x1003a, - 0x1003c, 0x1003d, - 0x1003f, 0x1004d, - 0x10050, 0x1005d, - 0x10080, 0x100fa, - 0x10107, 0x10133, - 0x10300, 0x1031e, - 0x10320, 0x10323, - 0x10330, 0x1034a, - 0x10380, 0x1039d, - 0x10400, 0x1049d, - 0x104a0, 0x104a9, - 0x10800, 0x10805, - 0x10808, 0x10808, - 0x1080a, 0x10835, - 0x10837, 0x10838, - 0x1083c, 0x1083c, - 0x1083f, 0x1083f, - 0x1d165, 0x1d169, - 0x1d16d, 0x1d172, - 0x1d17b, 0x1d182, - 0x1d185, 0x1d18b, - 0x1d1aa, 0x1d1ad, - 0x1d400, 0x1d454, - 0x1d456, 0x1d49c, - 0x1d49e, 0x1d49f, - 0x1d4a2, 0x1d4a2, - 0x1d4a5, 0x1d4a6, - 0x1d4a9, 0x1d4ac, - 0x1d4ae, 0x1d4b9, - 0x1d4bb, 0x1d4bb, - 0x1d4bd, 0x1d4c3, - 0x1d4c5, 0x1d505, - 0x1d507, 0x1d50a, - 0x1d50d, 0x1d514, - 0x1d516, 0x1d51c, - 0x1d51e, 0x1d539, - 0x1d53b, 0x1d53e, - 0x1d540, 0x1d544, - 0x1d546, 0x1d546, - 0x1d54a, 0x1d550, - 0x1d552, 0x1d6a3, - 0x1d6a8, 0x1d6c0, - 0x1d6c2, 0x1d6da, - 0x1d6dc, 0x1d6fa, - 0x1d6fc, 0x1d714, - 0x1d716, 0x1d734, - 0x1d736, 0x1d74e, - 0x1d750, 0x1d76e, - 0x1d770, 0x1d788, - 0x1d78a, 0x1d7a8, - 0x1d7aa, 0x1d7c2, - 0x1d7c4, 0x1d7c9, - 0x1d7ce, 0x1d7ff, - 0x20000, 0x2a6d6, - 0x2f800, 0x2fa1d, - 0xe0100, 0xe01ef -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ -}; /* end of MBWord */ - - -static int -utf8_get_ctype_code_range(int ctype, - OnigCodePoint* sbr[], OnigCodePoint* mbr[]) -{ -#define CR_SET(sbl,mbl) do { \ - *sbr = sbl; \ - *mbr = mbl; \ -} while (0) - -#define CR_SB_SET(sbl) do { \ - *sbr = sbl; \ - *mbr = EmptyRange; \ -} while (0) - - switch (ctype) { - case ONIGENC_CTYPE_ALPHA: - CR_SET(SBAlpha, MBAlpha); - break; - case ONIGENC_CTYPE_BLANK: - CR_SET(SBBlank, MBBlank); - break; - case ONIGENC_CTYPE_CNTRL: - CR_SET(SBCntrl, MBCntrl); - break; - case ONIGENC_CTYPE_DIGIT: - CR_SET(SBDigit, MBDigit); - break; - case ONIGENC_CTYPE_GRAPH: - CR_SET(SBGraph, MBGraph); - break; - case ONIGENC_CTYPE_LOWER: - CR_SET(SBLower, MBLower); - break; - case ONIGENC_CTYPE_PRINT: - CR_SET(SBPrint, MBPrint); - break; - case ONIGENC_CTYPE_PUNCT: - CR_SET(SBPunct, MBPunct); - break; - case ONIGENC_CTYPE_SPACE: - CR_SET(SBSpace, MBSpace); - break; - case ONIGENC_CTYPE_UPPER: - CR_SET(SBUpper, MBUpper); - break; - case ONIGENC_CTYPE_XDIGIT: - CR_SB_SET(SBXDigit); - break; - case ONIGENC_CTYPE_WORD: - CR_SET(SBWord, MBWord); - break; - case ONIGENC_CTYPE_ASCII: - CR_SB_SET(SBASCII); - break; - case ONIGENC_CTYPE_ALNUM: - CR_SET(SBAlnum, MBAlnum); - break; - - default: - return ONIGENCERR_TYPE_BUG; - break; - } - - return 0; -} - -static int -utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - OnigCodePoint *range; -#endif - - if (code < 256) { - return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype); - } - -#ifdef USE_UNICODE_FULL_RANGE_CTYPE - - switch (ctype) { - case ONIGENC_CTYPE_ALPHA: - range = MBAlpha; - break; - case ONIGENC_CTYPE_BLANK: - range = MBBlank; - break; - case ONIGENC_CTYPE_CNTRL: - range = MBCntrl; - break; - case ONIGENC_CTYPE_DIGIT: - range = MBDigit; - break; - case ONIGENC_CTYPE_GRAPH: - range = MBGraph; - break; - case ONIGENC_CTYPE_LOWER: - range = MBLower; - break; - case ONIGENC_CTYPE_PRINT: - range = MBPrint; - break; - case ONIGENC_CTYPE_PUNCT: - range = MBPunct; - break; - case ONIGENC_CTYPE_SPACE: - range = MBSpace; - break; - case ONIGENC_CTYPE_UPPER: - range = MBUpper; - break; - case ONIGENC_CTYPE_XDIGIT: - return FALSE; - break; - case ONIGENC_CTYPE_WORD: - range = MBWord; - break; - case ONIGENC_CTYPE_ASCII: - return FALSE; - break; - case ONIGENC_CTYPE_ALNUM: - range = MBAlnum; - break; - - default: - return ONIGENCERR_TYPE_BUG; - break; - } - - return onig_is_in_code_range((UChar* )range, code); - -#else - - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { -#ifdef USE_INVALID_CODE_SCHEME - if (code <= VALID_CODE_LIMIT) -#endif - return TRUE; - } -#endif /* USE_UNICODE_FULL_RANGE_CTYPE */ - - return FALSE; -} - -static UChar* -utf8_left_adjust_char_head(const UChar* start, const UChar* s) -{ - const UChar *p; - - if (s <= start) return (UChar* )s; - p = s; - - while (!utf8_islead(*p) && p > start) p--; - return (UChar* )p; -} - -OnigEncodingType OnigEncodingUTF8 = { - utf8_mbc_enc_len, - "UTF-8", /* name */ - 6, /* max byte length */ - 1, /* min byte length */ - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_COMPOUND), - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - utf8_mbc_to_code, - utf8_code_to_mbclen, - utf8_code_to_mbc, - utf8_mbc_to_normalize, - utf8_is_mbc_ambiguous, - onigenc_iso_8859_1_get_all_pair_ambig_codes, - onigenc_ess_tsett_get_all_comp_ambig_codes, - utf8_is_code_ctype, - utf8_get_ctype_code_range, - utf8_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; diff --git a/ext/mbstring/oniguruma/index.html b/ext/mbstring/oniguruma/index.html deleted file mode 100755 index 02e844c363d49..0000000000000 --- a/ext/mbstring/oniguruma/index.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - Oniguruma - - - - -M -N - -

Oniguruma

- -

-2005/03/07 (C) K.Kosako -

- -

-Oniguruma is a regular expressions library.
-The characteristics of this library is that different character encoding -
for every regular expression object can be specified. -

- -
-
Supported character encodings:
-ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,
-EUC-JP, EUC-TW, EUC-KR, EUC-CN,
-Shift_JIS, Big5, KOI8-R, KOI8,
-ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
-ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
-ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 -

-
-

- -

- -
What's new - -
    -
  • released Version 3.7.1 (2005/03/07) -
  • released Version 2.4.2 (2005/03/05) -
-
- -
- -
-
There are two ways of using of it in this program. -
    -
  • (1) C library (supported APIs: GNU regex, POSIX and Oniguruma native) -
  • (2) Built-in regular expressions engine of Ruby 1.6/1.8/1.9
    - In Ruby 1.9, Oniguruma is already integrated by Kazuo Saito. -
-
- -
-
Platform: -
    -
  • Unix (include Mac OS X) -
  • Cygwin -
  • Win32 -
- -
-
License:
-When this software is partly used or it is distributed with Ruby, -this of Ruby follows the license of Ruby.
-It follows the BSD license in the case of the one except for it. -

- -
Download: - - -
- -* 3.X.X supports UTF-16/UTF-32, Ruby 1.9.X.
-* 2.X.X does not support UTF-16/UTF-32, supports Ruby 1.6/1.8. -
- -
-
-
Documents: (version 3.7.1) - - -
-
Sample Programs: - - -
-
Links: - - -
-
References: - - -
- -
-

-and I'm thankful to Akinori MUSHA. -

- - -
- - diff --git a/ext/mbstring/oniguruma/onigcmpt200.h b/ext/mbstring/oniguruma/onigcmpt200.h deleted file mode 100644 index 4c029304b6ae5..0000000000000 --- a/ext/mbstring/oniguruma/onigcmpt200.h +++ /dev/null @@ -1,304 +0,0 @@ -/********************************************************************** - - onigcmpt200.h - Oniguruma (regular expression library) - - Copyright (C) 2004 K.Kosako (kosako@sofnec.co.jp) - -**********************************************************************/ -#ifndef ONIGCMPT200_H -#define ONIGCMPT200_H - -/* constants */ -#define REG_MAX_ERROR_MESSAGE_LEN ONIG_MAX_ERROR_MESSAGE_LEN - -#define RegCharEncoding OnigEncoding - -#define REG_ENCODING_ASCII ONIG_ENCODING_ASCII -#define REG_ENCODING_ISO_8859_1 ONIG_ENCODING_ISO_8859_1 -#define REG_ENCODING_ISO_8859_15 ONIG_ENCODING_ISO_8859_15 -#define REG_ENCODING_UTF8 ONIG_ENCODING_UTF8 -#define REG_ENCODING_EUC_JP ONIG_ENCODING_EUC_JP -#define REG_ENCODING_SJIS ONIG_ENCODING_SJIS -#define REG_ENCODING_BIG5 ONIG_ENCODING_BIG5 -#define REG_ENCODING_UNDEF ONIG_ENCODING_UNDEF - -/* Don't use REGCODE_XXXX. (obsoleted) */ -#define REGCODE_UNDEF REG_ENCODING_UNDEF -#define REGCODE_ASCII REG_ENCODING_ASCII -#define REGCODE_UTF8 REG_ENCODING_UTF8 -#define REGCODE_EUCJP REG_ENCODING_EUC_JP -#define REGCODE_SJIS REG_ENCODING_SJIS - -typedef unsigned char* RegTransTableType; -#define RegOptionType OnigOptionType -#define RegDistance OnigDistance - -#define REG_OPTION_DEFAULT ONIG_OPTION_DEFAULT - -/* options */ -#define REG_OPTION_NONE ONIG_OPTION_NONE -#define REG_OPTION_SINGLELINE ONIG_OPTION_SINGLELINE -#define REG_OPTION_MULTILINE ONIG_OPTION_MULTILINE -#define REG_OPTION_IGNORECASE ONIG_OPTION_IGNORECASE -#define REG_OPTION_EXTEND ONIG_OPTION_EXTEND -#define REG_OPTION_FIND_LONGEST ONIG_OPTION_FIND_LONGEST -#define REG_OPTION_FIND_NOT_EMPTY ONIG_OPTION_FIND_NOT_EMPTY -#define REG_OPTION_NEGATE_SINGLELINE ONIG_OPTION_NEGATE_SINGLELINE -#define REG_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP -#define REG_OPTION_CAPTURE_GROUP ONIG_OPTION_CAPTURE_GROUP -#define REG_OPTION_NOTBOL ONIG_OPTION_NOTBOL -#define REG_OPTION_NOTEOL ONIG_OPTION_NOTEOL -#define REG_OPTION_POSIX_REGION ONIG_OPTION_POSIX_REGION - -#define REG_OPTION_ON ONIG_OPTION_ON -#define REG_OPTION_OFF ONIG_OPTION_OFF -#define IS_REG_OPTION_ON ONIG_IS_OPTION_ON - -/* syntax */ -#define RegSyntaxType OnigSyntaxType - -#define RegSyntaxPosixBasic OnigSyntaxPosixBasic -#define RegSyntaxPosixExtended OnigSyntaxPosixExtended -#define RegSyntaxEmacs OnigSyntaxEmacs -#define RegSyntaxGrep OnigSyntaxGrep -#define RegSyntaxGnuRegex OnigSyntaxGnuRegex -#define RegSyntaxJava OnigSyntaxJava -#define RegSyntaxPerl OnigSyntaxPerl -#define RegSyntaxRuby OnigSyntaxRuby - -#define REG_SYNTAX_POSIX_BASIC ONIG_SYNTAX_POSIX_BASIC -#define REG_SYNTAX_POSIX_EXTENDED ONIG_SYNTAX_POSIX_EXTENDED -#define REG_SYNTAX_EMACS ONIG_SYNTAX_EMACS -#define REG_SYNTAX_GREP ONIG_SYNTAX_GREP -#define REG_SYNTAX_GNU_REGEX ONIG_SYNTAX_GNU_REGEX -#define REG_SYNTAX_JAVA ONIG_SYNTAX_JAVA -#define REG_SYNTAX_PERL ONIG_SYNTAX_PERL -#define REG_SYNTAX_RUBY ONIG_SYNTAX_RUBY - -#define REG_SYNTAX_DEFAULT ONIG_SYNTAX_DEFAULT -#define RegDefaultSyntax OnigDefaultSyntax - -/* syntax (operators) */ -#define REG_SYN_OP_VARIABLE_META_CHARACTERS \ - ONIG_SYN_OP_VARIABLE_META_CHARACTERS -#define REG_SYN_OP_DOT_ANYCHAR \ - ONIG_SYN_OP_DOT_ANYCHAR -#define REG_SYN_OP_ASTERISK_ZERO_INF \ - ONIG_SYN_OP_ASTERISK_ZERO_INF -#define REG_SYN_OP_ESC_ASTERISK_ZERO_INF \ - ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF -#define REG_SYN_OP_PLUS_ONE_INF \ - ONIG_SYN_OP_PLUS_ONE_INF -#define REG_SYN_OP_ESC_PLUS_ONE_INF \ - ONIG_SYN_OP_ESC_PLUS_ONE_INF -#define REG_SYN_OP_QMARK_ZERO_ONE \ - ONIG_SYN_OP_QMARK_ZERO_ONE -#define REG_SYN_OP_ESC_QMARK_ZERO_ONE \ - ONIG_SYN_OP_ESC_QMARK_ZERO_ONE -#define REG_SYN_OP_BRACE_INTERVAL \ - ONIG_SYN_OP_BRACE_INTERVAL -#define REG_SYN_OP_ESC_BRACE_INTERVAL \ - ONIG_SYN_OP_ESC_BRACE_INTERVAL -#define REG_SYN_OP_VBAR_ALT \ - ONIG_SYN_OP_VBAR_ALT -#define REG_SYN_OP_ESC_VBAR_ALT \ - ONIG_SYN_OP_ESC_VBAR_ALT -#define REG_SYN_OP_LPAREN_SUBEXP \ - ONIG_SYN_OP_LPAREN_SUBEXP -#define REG_SYN_OP_ESC_LPAREN_SUBEXP \ - ONIG_SYN_OP_ESC_LPAREN_SUBEXP -#define REG_SYN_OP_ESC_AZ_BUF_ANCHOR \ - ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR -#define REG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR \ - ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR -#define REG_SYN_OP_DECIMAL_BACKREF \ - ONIG_SYN_OP_DECIMAL_BACKREF -#define REG_SYN_OP_BRACKET_CC \ - ONIG_SYN_OP_BRACKET_CC -#define REG_SYN_OP_ESC_W_WORD \ - ONIG_SYN_OP_ESC_W_WORD -#define REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END \ - ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END -#define REG_SYN_OP_ESC_B_WORD_BOUND \ - ONIG_SYN_OP_ESC_B_WORD_BOUND -#define REG_SYN_OP_ESC_S_WHITE_SPACE \ - ONIG_SYN_OP_ESC_S_WHITE_SPACE -#define REG_SYN_OP_ESC_D_DIGIT \ - ONIG_SYN_OP_ESC_D_DIGIT -#define REG_SYN_OP_LINE_ANCHOR \ - ONIG_SYN_OP_LINE_ANCHOR -#define REG_SYN_OP_POSIX_BRACKET \ - ONIG_SYN_OP_POSIX_BRACKET -#define REG_SYN_OP_QMARK_NON_GREEDY \ - ONIG_SYN_OP_QMARK_NON_GREEDY -#define REG_SYN_OP_ESC_CONTROL_CHARS \ - ONIG_SYN_OP_ESC_CONTROL_CHARS -#define REG_SYN_OP_ESC_C_CONTROL \ - ONIG_SYN_OP_ESC_C_CONTROL -#define REG_SYN_OP_ESC_OCTAL3 \ - ONIG_SYN_OP_ESC_OCTAL3 -#define REG_SYN_OP_ESC_X_HEX2 \ - ONIG_SYN_OP_ESC_X_HEX2 -#define REG_SYN_OP_ESC_X_BRACE_HEX8 \ - ONIG_SYN_OP_ESC_X_BRACE_HEX8 - -#define REG_SYN_OP2_ESC_CAPITAL_Q_QUOTE \ - ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE -#define REG_SYN_OP2_QMARK_GROUP_EFFECT \ - ONIG_SYN_OP2_QMARK_GROUP_EFFECT -#define REG_SYN_OP2_OPTION_PERL \ - ONIG_SYN_OP2_OPTION_PERL -#define REG_SYN_OP2_OPTION_RUBY \ - ONIG_SYN_OP2_OPTION_RUBY -#define REG_SYN_OP2_PLUS_POSSESSIVE_REPEAT \ - ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT -#define REG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL \ - ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL -#define REG_SYN_OP2_CCLASS_SET_OP \ - ONIG_SYN_OP2_CCLASS_SET_OP -#define REG_SYN_OP2_QMARK_LT_NAMED_GROUP \ - ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP -#define REG_SYN_OP2_ESC_K_NAMED_BACKREF \ - ONIG_SYN_OP2_ESC_K_NAMED_BACKREF -#define REG_SYN_OP2_ESC_G_SUBEXP_CALL \ - ONIG_SYN_OP2_ESC_G_SUBEXP_CALL -#define REG_SYN_OP2_ATMARK_CAPTURE_HISTORY \ - ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY -#define REG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL \ - ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL -#define REG_SYN_OP2_ESC_CAPITAL_M_BAR_META \ - ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META -#define REG_SYN_OP2_ESC_V_VTAB \ - ONIG_SYN_OP2_ESC_V_VTAB -#define REG_SYN_OP2_ESC_U_HEX4 \ - ONIG_SYN_OP2_ESC_U_HEX4 -#define REG_SYN_OP2_ESC_GNU_BUF_ANCHOR \ - ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR - -#define REG_SYN_CONTEXT_INDEP_ANCHORS \ - ONIG_SYN_CONTEXT_INDEP_ANCHORS -#define REG_SYN_CONTEXT_INDEP_REPEAT_OPS \ - ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS -#define REG_SYN_CONTEXT_INVALID_REPEAT_OPS \ - ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS -#define REG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP \ - ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP -#define REG_SYN_ALLOW_INVALID_INTERVAL \ - ONIG_SYN_ALLOW_INVALID_INTERVAL -#define REG_SYN_STRICT_CHECK_BACKREF \ - ONIG_SYN_STRICT_CHECK_BACKREF -#define REG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND \ - ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND -#define REG_SYN_CAPTURE_ONLY_NAMED_GROUP \ - ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP -#define REG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME \ - ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME - -#define REG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC \ - ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC -#define REG_SYN_BACKSLASH_ESCAPE_IN_CC \ - ONIG_SYN_BACKSLASH_ESCAPE_IN_CC -#define REG_SYN_ALLOW_EMPTY_RANGE_IN_CC \ - ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC -#define REG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC \ - ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC -#define REG_SYN_WARN_CC_OP_NOT_ESCAPED \ - ONIG_SYN_WARN_CC_OP_NOT_ESCAPED -#define REG_SYN_WARN_REDUNDANT_NESTED_REPEAT \ - ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT - -/* meta character specifiers (regex_set_meta_char()) */ -#define REG_META_CHAR_ESCAPE ONIG_META_CHAR_ESCAPE -#define REG_META_CHAR_ANYCHAR ONIG_META_CHAR_ANYCHAR -#define REG_META_CHAR_ANYTIME ONIG_META_CHAR_ANYTIME -#define REG_META_CHAR_ZERO_OR_ONE_TIME ONIG_META_CHAR_ZERO_OR_ONE_TIME -#define REG_META_CHAR_ONE_OR_MORE_TIME ONIG_META_CHAR_ONE_OR_MORE_TIME -#define REG_META_CHAR_ANYCHAR_ANYTIME ONIG_META_CHAR_ANYCHAR_ANYTIME - -#define REG_INEFFECTIVE_META_CHAR ONIG_INEFFECTIVE_META_CHAR - -/* error codes */ -#define REG_IS_PATTERN_ERROR ONIG_IS_PATTERN_ERROR -/* normal return */ -#define REG_NORMAL ONIG_NORMAL -#define REG_MISMATCH ONIG_MISMATCH -#define REG_NO_SUPPORT_CONFIG ONIG_NO_SUPPORT_CONFIG -/* internal error */ -#define REGERR_MEMORY ONIGERR_MEMORY -#define REGERR_MATCH_STACK_LIMIT_OVER ONIGERR_MATCH_STACK_LIMIT_OVER -#define REGERR_TYPE_BUG ONIGERR_TYPE_BUG -#define REGERR_PARSER_BUG ONIGERR_PARSER_BUG -#define REGERR_STACK_BUG ONIGERR_STACK_BUG -#define REGERR_UNDEFINED_BYTECODE ONIGERR_UNDEFINED_BYTECODE -#define REGERR_UNEXPECTED_BYTECODE ONIGERR_UNEXPECTED_BYTECODE -#define REGERR_DEFAULT_ENCODING_IS_NOT_SETTED \ - ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -#define REGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR \ - ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -/* general error */ -#define REGERR_INVALID_ARGUMENT ONIGERR_INVALID_ARGUMENT -/* errors related to thread */ -#define REGERR_OVER_THREAD_PASS_LIMIT_COUNT \ - ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT - - -/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */ -#define REG_MAX_CAPTURE_HISTORY_GROUP ONIG_MAX_CAPTURE_HISTORY_GROUP -#define REG_IS_CAPTURE_HISTORY_GROUP ONIG_IS_CAPTURE_HISTORY_GROUP - -#define REG_REGION_NOTPOS ONIG_REGION_NOTPOS - -#define RegRegion OnigRegion -#define RegErrorInfo OnigErrorInfo -#define RegRepeatRange OnigRepeatRange - -#define RegWarnFunc OnigWarnFunc -#define regex_null_warn onig_null_warn -#define REG_NULL_WARN ONIG_NULL_WARN - -/* regex_t state */ -#define REG_STATE_NORMAL ONIG_STATE_NORMAL -#define REG_STATE_SEARCHING ONIG_STATE_SEARCHING -#define REG_STATE_COMPILING ONIG_STATE_COMPILING -#define REG_STATE_MODIFY ONIG_STATE_MODIFY - -#define REG_STATE ONIG_STATE - -/* Oniguruma Native API */ -#define regex_init onig_init -#define regex_error_code_to_str onig_error_code_to_str -#define regex_set_warn_func onig_set_warn_func -#define regex_set_verb_warn_func onig_set_verb_warn_func -#define regex_new onig_new -#define regex_free onig_free -#define regex_recompile onig_recompile -#define regex_search onig_search -#define regex_match onig_match -#define regex_region_new onig_region_new -#define regex_region_free onig_region_free -#define regex_region_copy onig_region_copy -#define regex_region_clear onig_region_clear -#define regex_region_resize onig_region_resize -#define regex_name_to_group_numbers onig_name_to_group_numbers -#define regex_name_to_backref_number onig_name_to_backref_number -#define regex_foreach_name onig_foreach_name -#define regex_number_of_names onig_number_of_names -#define regex_get_encoding onig_get_encoding -#define regex_get_options onig_get_options -#define regex_get_syntax onig_get_syntax -#define regex_set_default_syntax onig_set_default_syntax -#define regex_copy_syntax onig_copy_syntax -#define regex_set_meta_char onig_set_meta_char -#define regex_end onig_end -#define regex_version onig_version - -/* encoding API */ -#define enc_get_prev_char_head onigenc_get_prev_char_head -#define enc_get_left_adjust_char_head onigenc_get_left_adjust_char_head -#define enc_get_right_adjust_char_head onigenc_get_right_adjust_char_head -/* obsoleted API */ -#define regex_get_prev_char_head onigenc_get_prev_char_head -#define regex_get_left_adjust_char_head onigenc_get_left_adjust_char_head -#define regex_get_right_adjust_char_head onigenc_get_right_adjust_char_head - -#endif /* ONIGCMPT200_H */ diff --git a/ext/mbstring/oniguruma/oniggnu.h b/ext/mbstring/oniguruma/oniggnu.h deleted file mode 100644 index b203f6c8a3c94..0000000000000 --- a/ext/mbstring/oniguruma/oniggnu.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef ONIGGNU_H -#define ONIGGNU_H -/********************************************************************** - oniggnu.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "oniguruma.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MBCTYPE_ASCII 0 -#define MBCTYPE_EUC 1 -#define MBCTYPE_SJIS 2 -#define MBCTYPE_UTF8 3 - -/* GNU regex options */ -#ifndef RE_NREGS -#define RE_NREGS ONIG_NREGION -#endif - -#define RE_OPTION_IGNORECASE ONIG_OPTION_IGNORECASE -#define RE_OPTION_EXTENDED ONIG_OPTION_EXTEND -#define RE_OPTION_MULTILINE ONIG_OPTION_MULTILINE -#define RE_OPTION_SINGLELINE ONIG_OPTION_SINGLELINE -#define RE_OPTION_LONGEST ONIG_OPTION_FIND_LONGEST -#define RE_OPTION_POSIXLINE (RE_OPTION_MULTILINE|RE_OPTION_SINGLELINE) -#define RE_OPTION_FIND_NOT_EMPTY ONIG_OPTION_FIND_NOT_EMPTY -#define RE_OPTION_NEGATE_SINGLELINE ONIG_OPTION_NEGATE_SINGLELINE -#define RE_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP -#define RE_OPTION_CAPTURE_GROUP ONIG_OPTION_CAPTURE_GROUP - - -ONIG_EXTERN -void re_mbcinit P_((int)); -ONIG_EXTERN -int re_compile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf)); -ONIG_EXTERN -int re_recompile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf)); -ONIG_EXTERN -void re_free_pattern P_((struct re_pattern_buffer*)); -ONIG_EXTERN -int re_adjust_startpos P_((struct re_pattern_buffer*, const char*, int, int, int)); -ONIG_EXTERN -int re_search P_((struct re_pattern_buffer*, const char*, int, int, int, struct re_registers*)); -ONIG_EXTERN -int re_match P_((struct re_pattern_buffer*, const char *, int, int, struct re_registers*)); -ONIG_EXTERN -void re_set_casetable P_((const char*)); -ONIG_EXTERN -void re_free_registers P_((struct re_registers*)); -ONIG_EXTERN -int re_alloc_pattern P_((struct re_pattern_buffer**)); /* added */ - -#ifdef __cplusplus -} -#endif - -#endif /* ONIGGNU_H */ diff --git a/ext/mbstring/oniguruma/onigposix.h b/ext/mbstring/oniguruma/onigposix.h deleted file mode 100644 index cfeb88a2928e7..0000000000000 --- a/ext/mbstring/oniguruma/onigposix.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef ONIGPOSIX_H -#define ONIGPOSIX_H -/********************************************************************** - onigposix.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* options */ -#define REG_ICASE (1<<0) -#define REG_NEWLINE (1<<1) -#define REG_NOTBOL (1<<2) -#define REG_NOTEOL (1<<3) -#define REG_EXTENDED (1<<4) /* if not setted, Basic Onigular Expression */ -#define REG_NOSUB (1<<5) - -/* POSIX error codes */ -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 - -/* extended error codes */ -#define REG_EONIG_INTERNAL 14 -#define REG_EONIG_BADWC 15 -#define REG_EONIG_BADARG 16 -#define REG_EONIG_THREAD 17 - -/* character encodings (for reg_set_encoding()) */ -#define REG_POSIX_ENCODING_ASCII 0 -#define REG_POSIX_ENCODING_EUC_JP 1 -#define REG_POSIX_ENCODING_SJIS 2 -#define REG_POSIX_ENCODING_UTF8 3 -#define REG_POSIX_ENCODING_UTF16_BE 4 -#define REG_POSIX_ENCODING_UTF16_LE 5 - - -typedef int regoff_t; - -typedef struct { - regoff_t rm_so; - regoff_t rm_eo; -} regmatch_t; - -/* POSIX regex_t */ -typedef struct { - void* onig; /* Oniguruma regex_t* */ - size_t re_nsub; - int comp_options; -} regex_t; - - -#ifndef P_ -#if defined(__STDC__) || defined(_WIN32) -# define P_(args) args -#else -# define P_(args) () -#endif -#endif - -#ifndef ONIG_EXTERN -#if defined(_WIN32) && !defined(__GNUC__) -#if defined(EXPORT) || defined(RUBY_EXPORT) -#define ONIG_EXTERN extern __declspec(dllexport) -#else -#define ONIG_EXTERN extern __declspec(dllimport) -#endif -#endif -#endif - -#ifndef ONIG_EXTERN -#define ONIG_EXTERN extern -#endif - -#ifndef ONIGURUMA_H -typedef unsigned int OnigOptionType; - -/* syntax */ -typedef struct { - unsigned int op; - unsigned int op2; - unsigned int behavior; - OnigOptionType options; /* default option */ -} OnigSyntaxType; - -ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic; -ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended; -ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs; -ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep; -ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex; -ONIG_EXTERN OnigSyntaxType OnigSyntaxJava; -ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl; -ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby; - -/* predefined syntaxes (see regsyntax.c) */ -#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic) -#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended) -#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs) -#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep) -#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex) -#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava) -#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl) -#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby) -/* default syntax */ -#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax - -ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax; - -ONIG_EXTERN int onig_set_default_syntax P_((OnigSyntaxType* syntax)); -ONIG_EXTERN void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from)); -ONIG_EXTERN const char* onig_version P_((void)); -ONIG_EXTERN const char* onig_copyright P_((void)); - -#endif /* ONIGURUMA_H */ - - -ONIG_EXTERN int regcomp P_((regex_t* reg, const char* pat, int options)); -ONIG_EXTERN int regexec P_((regex_t* reg, const char* str, size_t nmatch, regmatch_t* matches, int options)); -ONIG_EXTERN void regfree P_((regex_t* reg)); -ONIG_EXTERN size_t regerror P_((int code, const regex_t* reg, char* buf, size_t size)); - -/* extended API */ -ONIG_EXTERN void reg_set_encoding P_((int enc)); -ONIG_EXTERN int reg_name_to_group_numbers P_((regex_t* reg, const unsigned char* name, const unsigned char* name_end, int** nums)); -ONIG_EXTERN int reg_foreach_name P_((regex_t* reg, int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*), void* arg)); -ONIG_EXTERN int reg_number_of_names P_((regex_t* reg)); - -#ifdef __cplusplus -} -#endif - -#endif /* ONIGPOSIX_H */ diff --git a/ext/mbstring/oniguruma/oniguruma.h b/ext/mbstring/oniguruma/oniguruma.h deleted file mode 100644 index 27903561085f8..0000000000000 --- a/ext/mbstring/oniguruma/oniguruma.h +++ /dev/null @@ -1,885 +0,0 @@ -#ifndef ONIGURUMA_H -#define ONIGURUMA_H -/********************************************************************** - oniguruma.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "php_onig_compat.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ONIGURUMA -#define ONIGURUMA_VERSION_MAJOR 3 -#define ONIGURUMA_VERSION_MINOR 7 -#define ONIGURUMA_VERSION_TEENY 1 - -#ifdef __cplusplus -# ifndef HAVE_PROTOTYPES -# define HAVE_PROTOTYPES 1 -# endif -# ifndef HAVE_STDARG_PROTOTYPES -# define HAVE_STDARG_PROTOTYPES 1 -# endif -#endif - -#ifndef P_ -#if defined(__STDC__) || defined(_WIN32) -# define P_(args) args -#else -# define P_(args) () -#endif -#endif - -#ifndef PV_ -#ifdef HAVE_STDARG_PROTOTYPES -# define PV_(args) args -#else -# define PV_(args) () -#endif -#endif - -#ifndef ONIG_EXTERN -#if defined(_WIN32) && !defined(__GNUC__) -#if defined(EXPORT) || defined(RUBY_EXPORT) -#define ONIG_EXTERN extern __declspec(dllexport) -#else -#define ONIG_EXTERN extern __declspec(dllimport) -#endif -#endif -#endif - -#ifndef ONIG_EXTERN -#define ONIG_EXTERN extern -#endif - -/* PART: character encoding */ - -#ifndef ONIG_ESCAPE_UCHAR_COLLISION -#define UChar OnigUChar -#endif - -typedef unsigned char OnigUChar; -typedef unsigned long OnigCodePoint; -typedef unsigned int OnigDistance; - -#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0) - -/* ambiguous match flag */ -typedef unsigned int OnigAmbigType; - -ONIG_EXTERN OnigAmbigType OnigDefaultAmbigFlag; - -#define ONIGENC_AMBIGUOUS_MATCH_NONE 0 -#define ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE (1<<0) -#define ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE (1<<1) -/* #define ONIGENC_AMBIGUOUS_MATCH_ACCENT (1<<2) */ -/* #define ONIGENC_AMBIGUOUS_MATCH_HIRAGANA_KATAKANA (1<<3) */ -/* #define ONIGENC_AMBIGUOUS_MATCH_KATAKANA_WIDTH (1<<4) */ - -#define ONIGENC_AMBIGUOUS_MATCH_LIMIT (1<<1) -#define ONIGENC_AMBIGUOUS_MATCH_COMPOUND (1<<30) - -#define ONIGENC_AMBIGUOUS_MATCH_FULL \ - ( ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | \ - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | \ - ONIGENC_AMBIGUOUS_MATCH_COMPOUND ) -#define ONIGENC_AMBIGUOUS_MATCH_DEFAULT OnigDefaultAmbigFlag - - -#define ONIGENC_MAX_COMP_AMBIG_CODE_LEN 3 -#define ONIGENC_MAX_COMP_AMBIG_CODE_ITEM_NUM 4 - -/* code range */ -#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0]) -#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1] -#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2] - -typedef struct { - int len; - OnigCodePoint code[ONIGENC_MAX_COMP_AMBIG_CODE_LEN]; -} OnigCompAmbigCodeItem; - -typedef struct { - int n; - OnigCodePoint code; - OnigCompAmbigCodeItem items[ONIGENC_MAX_COMP_AMBIG_CODE_ITEM_NUM]; -} OnigCompAmbigCodes; - -typedef struct { - OnigCodePoint from; - OnigCodePoint to; -} OnigPairAmbigCodes; - -typedef struct { - OnigCodePoint esc; - OnigCodePoint anychar; - OnigCodePoint anytime; - OnigCodePoint zero_or_one_time; - OnigCodePoint one_or_more_time; - OnigCodePoint anychar_anytime; -} OnigMetaCharTableType; - - -#if defined(RUBY_PLATFORM) && defined(M17N_H) - -#define ONIG_RUBY_M17N -typedef m17n_encoding* OnigEncoding; - -#else - -typedef struct { - int (*mbc_enc_len)(const OnigUChar* p); - const char* name; - int max_enc_len; - int min_enc_len; - OnigAmbigType support_ambig_flag; - OnigMetaCharTableType meta_char_table; - int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end); - OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end); - int (*code_to_mbclen)(OnigCodePoint code); - int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf); - int (*mbc_to_normalize)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to); - int (*is_mbc_ambiguous)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end); - int (*get_all_pair_ambig_codes)(OnigAmbigType flag, OnigPairAmbigCodes** acs); - int (*get_all_comp_ambig_codes)(OnigAmbigType flag, OnigCompAmbigCodes** acs); - int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype); - int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_range[], OnigCodePoint* mb_range[]); - OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p); - int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end); -} OnigEncodingType; - -typedef OnigEncodingType* OnigEncoding; - -ONIG_EXTERN OnigEncodingType OnigEncodingASCII; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15; -ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16; -ONIG_EXTERN OnigEncodingType OnigEncodingUTF8; -ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE; -ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE; -ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE; -ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE; -ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP; -ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW; -ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR; -ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN; -ONIG_EXTERN OnigEncodingType OnigEncodingSJIS; -ONIG_EXTERN OnigEncodingType OnigEncodingKOI8; -ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R; -ONIG_EXTERN OnigEncodingType OnigEncodingBIG5; - -#define ONIG_ENCODING_ASCII (&OnigEncodingASCII) -#define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1) -#define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2) -#define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3) -#define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4) -#define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5) -#define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6) -#define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7) -#define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8) -#define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9) -#define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10) -#define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11) -#define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13) -#define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14) -#define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15) -#define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16) -#define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8) -#define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE) -#define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE) -#define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE) -#define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE) -#define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP) -#define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW) -#define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR) -#define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN) -#define ONIG_ENCODING_SJIS (&OnigEncodingSJIS) -#define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8) -#define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R) -#define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5) - -#endif /* else RUBY && M17N */ - -#define ONIG_ENCODING_UNDEF ((OnigEncoding )0) - - -/* work size */ -#define ONIGENC_CODE_TO_MBC_MAXLEN 7 -#define ONIGENC_MBC_NORMALIZE_MAXLEN ONIGENC_CODE_TO_MBC_MAXLEN - -/* character types */ -#define ONIGENC_CTYPE_NEWLINE (1<< 0) -#define ONIGENC_CTYPE_ALPHA (1<< 1) -#define ONIGENC_CTYPE_BLANK (1<< 2) -#define ONIGENC_CTYPE_CNTRL (1<< 3) -#define ONIGENC_CTYPE_DIGIT (1<< 4) -#define ONIGENC_CTYPE_GRAPH (1<< 5) -#define ONIGENC_CTYPE_LOWER (1<< 6) -#define ONIGENC_CTYPE_PRINT (1<< 7) -#define ONIGENC_CTYPE_PUNCT (1<< 8) -#define ONIGENC_CTYPE_SPACE (1<< 9) -#define ONIGENC_CTYPE_UPPER (1<<10) -#define ONIGENC_CTYPE_XDIGIT (1<<11) -#define ONIGENC_CTYPE_WORD (1<<12) -#define ONIGENC_CTYPE_ASCII (1<<13) -#define ONIGENC_CTYPE_ALNUM (ONIGENC_CTYPE_ALPHA | ONIGENC_CTYPE_DIGIT) - -#define enc_len(enc,p) ONIGENC_MBC_ENC_LEN(enc, p) - -#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF) -#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1) -#define ONIGENC_IS_MBC_HEAD(enc,p) (ONIGENC_MBC_ENC_LEN(enc,p) != 1) -#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128) -#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128) -#define ONIGENC_IS_CODE_SB_WORD(enc,code) \ - (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code)) -#define ONIGENC_IS_MBC_WORD(enc,s,end) \ - ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end)) - - -#ifdef ONIG_RUBY_M17N - -#include /* for isblank(), isgraph() */ - -#define ONIGENC_MBC_TO_NORMALIZE(enc,flag,pp,end,buf) \ - onigenc_mbc_to_normalize(enc,flag,pp,end,buf) -#define ONIGENC_IS_MBC_AMBIGUOUS(enc,flag,pp,end) \ - onigenc_is_mbc_ambiguous(enc,flag,pp,end) - -#define ONIGENC_SUPPORT_AMBIG_FLAG(enc) ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE -#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \ - onigenc_is_allowed_reverse_match(enc, s, end) -#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \ - onigenc_get_left_adjust_char_head(enc, start, s) -#define ONIGENC_GET_ALL_PAIR_AMBIG_CODES(enc, ambig_flag, acs) 0 -#define ONIGENC_GET_ALL_COMP_AMBIG_CODES(enc, ambig_flag, acs) 0 -#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbr,mbr) \ - ONIG_NO_SUPPORT_CONFIG -#define ONIGENC_MBC_ENC_LEN(enc,p) m17n_mbclen(enc,(int )(*p)) -#define ONIGENC_MBC_MAXLEN(enc) m17n_mbmaxlen(enc) -#define ONIGENC_MBC_MAXLEN_DIST(enc) \ - (ONIGENC_MBC_MAXLEN(enc) > 0 ? ONIGENC_MBC_MAXLEN(enc) \ - : ONIG_INFINITE_DISTANCE) -#define ONIGENC_MBC_MINLEN(enc) 1 -#define ONIGENC_MBC_TO_CODE(enc,p,e) m17n_codepoint((enc),(p),(e)) -#define ONIGENC_CODE_TO_MBCLEN(enc,code) m17n_codelen((enc),(code)) -#define ONIGENC_CODE_TO_MBC(enc,code,buf) onigenc_code_to_mbc(enc, code, buf) - -#if 0 /* !! not supported !! */ -#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) -#define ONIGENC_STEP_BACK(enc,start,s,n) -#endif - -#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) \ - onigenc_is_code_ctype(enc,code,ctype) - -#ifdef isblank -# define ONIGENC_IS_CODE_BLANK(enc,code) isblank((int )code) -#else -# define ONIGENC_IS_CODE_BLANK(enc,code) ((code) == ' ' || (code) == '\t') -#endif -#ifdef isgraph -# define ONIGENC_IS_CODE_GRAPH(enc,code) isgraph((int )code) -#else -# define ONIGENC_IS_CODE_GRAPH(enc,code) \ - (isprint((int )code) && !isspace((int )code)) -#endif - -#define ONIGENC_IS_CODE_PRINT(enc,code) m17n_isprint(enc,code) -#define ONIGENC_IS_CODE_ALNUM(enc,code) m17n_isalnum(enc,code) -#define ONIGENC_IS_CODE_ALPHA(enc,code) m17n_isalpha(enc,code) -#define ONIGENC_IS_CODE_LOWER(enc,code) m17n_islower(enc,code) -#define ONIGENC_IS_CODE_UPPER(enc,code) m17n_isupper(enc,code) -#define ONIGENC_IS_CODE_CNTRL(enc,code) m17n_iscntrl(enc,code) -#define ONIGENC_IS_CODE_PUNCT(enc,code) m17n_ispunct(enc,code) -#define ONIGENC_IS_CODE_SPACE(enc,code) m17n_isspace(enc,code) -#define ONIGENC_IS_CODE_DIGIT(enc,code) m17n_isdigit(enc,code) -#define ONIGENC_IS_CODE_XDIGIT(enc,code) m17n_isxdigit(enc,code) -#define ONIGENC_IS_CODE_WORD(enc,code) m17n_iswchar(enc,code) - -ONIG_EXTERN -int onigenc_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, int ctype)); -ONIG_EXTERN -int onigenc_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, OnigUChar *buf)); -ONIG_EXTERN -int onigenc_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* buf)); -ONIG_EXTERN -int onigenc_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end)); -ONIG_EXTERN -int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end)); - -#else /* ONIG_RUBY_M17N */ - -#define ONIGENC_NAME(enc) ((enc)->name) - -#define ONIGENC_MBC_TO_NORMALIZE(enc,flag,pp,end,buf) \ - (enc)->mbc_to_normalize(flag,(const OnigUChar** )pp,end,buf) -#define ONIGENC_IS_MBC_AMBIGUOUS(enc,flag,pp,end) \ - (enc)->is_mbc_ambiguous(flag,(const OnigUChar** )pp,end) -#define ONIGENC_SUPPORT_AMBIG_FLAG(enc) ((enc)->support_ambig_flag) -#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \ - (enc)->is_allowed_reverse_match(s,end) -#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \ - (enc)->left_adjust_char_head(start, s) -#define ONIGENC_GET_ALL_PAIR_AMBIG_CODES(enc,ambig_flag,acs) \ - (enc)->get_all_pair_ambig_codes(ambig_flag,acs) -#define ONIGENC_GET_ALL_COMP_AMBIG_CODES(enc,ambig_flag,acs) \ - (enc)->get_all_comp_ambig_codes(ambig_flag,acs) -#define ONIGENC_STEP_BACK(enc,start,s,n) \ - onigenc_step_back((enc),(start),(s),(n)) - -#define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p) -#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len) -#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc) -#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len) -#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end)) -#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end)) -#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code) -#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf) - -#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype) - -#define ONIGENC_IS_CODE_NEWLINE(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE) -#define ONIGENC_IS_CODE_GRAPH(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH) -#define ONIGENC_IS_CODE_PRINT(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT) -#define ONIGENC_IS_CODE_ALNUM(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM) -#define ONIGENC_IS_CODE_ALPHA(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA) -#define ONIGENC_IS_CODE_LOWER(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER) -#define ONIGENC_IS_CODE_UPPER(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER) -#define ONIGENC_IS_CODE_CNTRL(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL) -#define ONIGENC_IS_CODE_PUNCT(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT) -#define ONIGENC_IS_CODE_SPACE(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE) -#define ONIGENC_IS_CODE_BLANK(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK) -#define ONIGENC_IS_CODE_DIGIT(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT) -#define ONIGENC_IS_CODE_XDIGIT(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT) -#define ONIGENC_IS_CODE_WORD(enc,code) \ - ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD) - -#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbr,mbr) \ - (enc)->get_ctype_code_range(ctype,sbr,mbr) - -ONIG_EXTERN -OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n)); - -#endif /* is not ONIG_RUBY_M17N */ - - -/* encoding API */ -ONIG_EXTERN -int onigenc_init P_(()); -ONIG_EXTERN -int onigenc_set_default_encoding P_((OnigEncoding enc)); -ONIG_EXTERN -OnigEncoding onigenc_get_default_encoding P_(()); -ONIG_EXTERN -void onigenc_set_default_caseconv_table P_((const OnigUChar* table)); -ONIG_EXTERN -OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev)); -ONIG_EXTERN -OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); -ONIG_EXTERN -OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); -ONIG_EXTERN -OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); -ONIG_EXTERN -int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end)); -ONIG_EXTERN -int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p)); -ONIG_EXTERN -int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p)); - - - -/* PART: regular expression */ - -/* config parameters */ -#define ONIG_NREGION 10 -#define ONIG_MAX_BACKREF_NUM 1000 -#define ONIG_MAX_REPEAT_NUM 100000 -#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 1000 -/* constants */ -#define ONIG_MAX_ERROR_MESSAGE_LEN 90 - -typedef unsigned int OnigOptionType; - -#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE - -/* options */ -#define ONIG_OPTION_NONE 0 -#define ONIG_OPTION_IGNORECASE 1L -#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1) -#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1) -#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1) -#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1) -#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1) -#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1) -#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1) -#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1) -/* options (search time) */ -#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1) -#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1) -#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1) - -#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt)) -#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt)) -#define ONIG_IS_OPTION_ON(options,option) ((options) & (option)) - -/* syntax */ -typedef struct { - unsigned int op; - unsigned int op2; - unsigned int behavior; - OnigOptionType options; /* default option */ -} OnigSyntaxType; - -ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic; -ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended; -ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs; -ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep; -ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex; -ONIG_EXTERN OnigSyntaxType OnigSyntaxJava; -ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl; -ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby; - -/* predefined syntaxes (see regsyntax.c) */ -#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic) -#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended) -#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs) -#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep) -#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex) -#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava) -#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl) -#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby) - -/* default syntax */ -ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax; -#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax - -/* syntax (operators) */ -#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1<<0) -#define ONIG_SYN_OP_DOT_ANYCHAR (1<<1) /* . */ -#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1<<2) /* * */ -#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1<<3) -#define ONIG_SYN_OP_PLUS_ONE_INF (1<<4) /* + */ -#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1<<5) -#define ONIG_SYN_OP_QMARK_ZERO_ONE (1<<6) /* ? */ -#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1<<7) -#define ONIG_SYN_OP_BRACE_INTERVAL (1<<8) /* {lower,upper} */ -#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1<<9) /* \{lower,upper\} */ -#define ONIG_SYN_OP_VBAR_ALT (1<<10) /* | */ -#define ONIG_SYN_OP_ESC_VBAR_ALT (1<<11) /* \| */ -#define ONIG_SYN_OP_LPAREN_SUBEXP (1<<12) /* (...) */ -#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1<<13) /* \(...\) */ -#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1<<14) /* \A, \Z, \z */ -#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1<<15) /* \G */ -#define ONIG_SYN_OP_DECIMAL_BACKREF (1<<16) /* \num */ -#define ONIG_SYN_OP_BRACKET_CC (1<<17) /* [...] */ -#define ONIG_SYN_OP_ESC_W_WORD (1<<18) /* \w, \W */ -#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1<<19) /* \<. \> */ -#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1<<20) /* \b, \B */ -#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1<<21) /* \s, \S */ -#define ONIG_SYN_OP_ESC_D_DIGIT (1<<22) /* \d, \D */ -#define ONIG_SYN_OP_LINE_ANCHOR (1<<23) /* ^, $ */ -#define ONIG_SYN_OP_POSIX_BRACKET (1<<24) /* [:xxxx:] */ -#define ONIG_SYN_OP_QMARK_NON_GREEDY (1<<25) /* ??,*?,+?,{n,m}? */ -#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1<<26) /* \n,\r,\t,\a ... */ -#define ONIG_SYN_OP_ESC_C_CONTROL (1<<27) /* \cx */ -#define ONIG_SYN_OP_ESC_OCTAL3 (1<<28) /* \OOO */ -#define ONIG_SYN_OP_ESC_X_HEX2 (1<<29) /* \xHH */ -#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1<<30) /* \x{7HHHHHHH} */ - -#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1<<0) /* \Q...\E */ -#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1<<1) /* (?...) */ -#define ONIG_SYN_OP2_OPTION_PERL (1<<2) /* (?imsx),(?-imsx) */ -#define ONIG_SYN_OP2_OPTION_RUBY (1<<3) /* (?imx), (?-imx) */ -#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1<<4) /* ?+,*+,++ */ -#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1<<5) /* {n,m}+ */ -#define ONIG_SYN_OP2_CCLASS_SET_OP (1<<6) /* [...&&..[..]..] */ -#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1<<7) /* (?...) */ -#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1<<8) /* \k */ -#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1<<9) /* \g, \g */ -#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1<<10) /* (?@..),(?@..) */ -#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1<<11) /* \C-x */ -#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1<<12) /* \M-x */ -#define ONIG_SYN_OP2_ESC_V_VTAB (1<<13) /* \v as VTAB */ -#define ONIG_SYN_OP2_ESC_U_HEX4 (1<<14) /* \uHHHH */ -#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1<<15) /* \`, \' */ -#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1<<16) /* \p{...}, \P{...} */ -#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1<<17) /* \p{^..}, \P{^..} */ -#define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1<<18) /* \p{IsXDigit} */ -#define ONIG_SYN_OP2_ESC_H_XDIGIT (1<<19) /* \h, \H */ - -/* syntax (behavior) */ -#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1<<31) /* not implemented */ -#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1<<0) /* ?, *, +, {n,m} */ -#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1<<1) /* error or ignore */ -#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1<<2) /* ...)... */ -#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1<<3) /* {??? */ -#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1<<4) /* {,n} => {0,n} */ -#define ONIG_SYN_STRICT_CHECK_BACKREF (1<<5) /* /(\1)/,/\1()/ ..*/ -#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1<<6) /* (?<=a|bc) */ -#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1<<7) /* see doc/RE */ -#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1<<8) /* (?)(?) */ -#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1<<9) /* a{n}?=(?:a{n})? */ - -/* syntax (behavior) in char class [...] */ -#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1<<20) /* [^...] */ -#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1<<21) /* [..\w..] etc.. */ -#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1<<22) -#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1<<23) /* [0-9-a]=[0-9\-a] */ -/* syntax (behavior) warning */ -#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1<<24) /* [,-,] */ -#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1<<25) /* (?:a*)+ */ - -/* meta character specifiers (onig_set_meta_char()) */ -#define ONIG_META_CHAR_ESCAPE 0 -#define ONIG_META_CHAR_ANYCHAR 1 -#define ONIG_META_CHAR_ANYTIME 2 -#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3 -#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4 -#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5 - -#define ONIG_INEFFECTIVE_META_CHAR 0 - -/* error codes */ -#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000) -/* normal return */ -#define ONIG_NORMAL 0 -#define ONIG_MISMATCH -1 -#define ONIG_NO_SUPPORT_CONFIG -2 - -/* internal error */ -#define ONIGERR_MEMORY -5 -#define ONIGERR_TYPE_BUG -6 -#define ONIGERR_PARSER_BUG -11 -#define ONIGERR_STACK_BUG -12 -#define ONIGERR_UNDEFINED_BYTECODE -13 -#define ONIGERR_UNEXPECTED_BYTECODE -14 -#define ONIGERR_MATCH_STACK_LIMIT_OVER -15 -#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21 -#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22 -/* general error */ -#define ONIGERR_INVALID_ARGUMENT -30 -/* syntax error */ -#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100 -#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101 -#define ONIGERR_EMPTY_CHAR_CLASS -102 -#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103 -#define ONIGERR_END_PATTERN_AT_ESCAPE -104 -#define ONIGERR_END_PATTERN_AT_META -105 -#define ONIGERR_END_PATTERN_AT_CONTROL -106 -#define ONIGERR_META_CODE_SYNTAX -108 -#define ONIGERR_CONTROL_CODE_SYNTAX -109 -#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110 -#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111 -#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112 -#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113 -#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114 -#define ONIGERR_NESTED_REPEAT_OPERATOR -115 -#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116 -#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117 -#define ONIGERR_END_PATTERN_IN_GROUP -118 -#define ONIGERR_UNDEFINED_GROUP_OPTION -119 -#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121 -#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122 -#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123 -/* values error (syntax error) */ -#define ONIGERR_TOO_BIG_NUMBER -200 -#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201 -#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202 -#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203 -#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204 -#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205 -#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206 -#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207 -#define ONIGERR_INVALID_BACKREF -208 -#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209 -#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212 -#define ONIGERR_EMPTY_GROUP_NAME -214 -#define ONIGERR_INVALID_GROUP_NAME -215 -#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216 -#define ONIGERR_UNDEFINED_NAME_REFERENCE -217 -#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218 -#define ONIGERR_MULTIPLEX_DEFINED_NAME -219 -#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220 -#define ONIGERR_NEVER_ENDING_RECURSION -221 -#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222 -#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223 -#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400 -#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401 -#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402 - -/* errors related to thread */ -#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 - - -/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */ -#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31 -#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \ - ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i]) - -typedef struct OnigCaptureTreeNodeStruct { - int group; /* group number */ - int beg; - int end; - int allocated; - int num_childs; - struct OnigCaptureTreeNodeStruct** childs; -} OnigCaptureTreeNode; - -/* match result region type */ -struct re_registers { - int allocated; - int num_regs; - int* beg; - int* end; - /* extended */ - OnigCaptureTreeNode* history_root; /* capture history tree root */ -}; - -/* capture tree traverse */ -#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1 -#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2 -#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \ - ( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST ) - - -#define ONIG_REGION_NOTPOS -1 - -typedef struct re_registers OnigRegion; - -typedef struct { - OnigUChar* par; - OnigUChar* par_end; -} OnigErrorInfo; - -typedef struct { - int lower; - int upper; -} OnigRepeatRange; - -typedef void (*OnigWarnFunc) P_((const char* s)); -extern void onig_null_warn P_((const char* s)); -#define ONIG_NULL_WARN onig_null_warn - -#define ONIG_CHAR_TABLE_SIZE 256 - -/* regex_t state */ -#define ONIG_STATE_NORMAL 0 -#define ONIG_STATE_SEARCHING 1 -#define ONIG_STATE_COMPILING -1 -#define ONIG_STATE_MODIFY -2 - -#define ONIG_STATE(reg) \ - ((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state) - -typedef struct re_pattern_buffer { - /* common members of BBuf(bytes-buffer) */ - unsigned char* p; /* compiled pattern */ - unsigned int used; /* used space for p */ - unsigned int alloc; /* allocated space for p */ - - int state; /* normal, searching, compiling */ - int num_mem; /* used memory(...) num counted from 1 */ - int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */ - int num_null_check; /* OP_NULL_CHECK_START/END id counter */ - int num_call; /* number of subexp call */ - unsigned int capture_history; /* (?@...) flag (1-31) */ - unsigned int bt_mem_start; /* need backtrack flag */ - unsigned int bt_mem_end; /* need backtrack flag */ - int stack_pop_level; - int repeat_range_alloc; - OnigRepeatRange* repeat_range; - - OnigEncoding enc; - OnigOptionType options; - OnigSyntaxType* syntax; - OnigAmbigType ambig_flag; - void* name_table; - - /* optimization info (string search, char-map and anchors) */ - int optimize; /* optimize flag */ - int threshold_len; /* search str-length for apply optimize */ - int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */ - OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */ - OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */ - int sub_anchor; /* start-anchor for exact or map */ - unsigned char *exact; - unsigned char *exact_end; - unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */ - int *int_map; /* BM skip for exact_len > 255 */ - int *int_map_backward; /* BM skip for backward search */ - OnigDistance dmin; /* min-distance of exact or map */ - OnigDistance dmax; /* max-distance of exact or map */ - - /* regex_t link chain */ - struct re_pattern_buffer* chain; /* escape compile-conflict */ -} regex_t; - - -typedef struct { - int num_of_elements; - OnigEncoding pattern_enc; - OnigEncoding target_enc; - OnigSyntaxType* syntax; - OnigOptionType option; - OnigAmbigType ambig_flag; -} OnigCompileInfo; - -/* Oniguruma Native API */ -ONIG_EXTERN -int onig_init P_((void)); -ONIG_EXTERN -int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...)); -ONIG_EXTERN -void onig_set_warn_func P_((OnigWarnFunc f)); -ONIG_EXTERN -void onig_set_verb_warn_func P_((OnigWarnFunc f)); -ONIG_EXTERN -int onig_new P_((regex_t**, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo)); -ONIG_EXTERN -int onig_new_deluxe P_((regex_t** reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo)); -ONIG_EXTERN -void onig_free P_((regex_t*)); -ONIG_EXTERN -int onig_recompile P_((regex_t*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo)); -ONIG_EXTERN -int onig_recompile_deluxe P_((regex_t* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo)); -ONIG_EXTERN -int onig_search P_((regex_t*, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option)); -ONIG_EXTERN -int onig_match P_((regex_t*, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option)); -ONIG_EXTERN -OnigRegion* onig_region_new P_((void)); -ONIG_EXTERN -void onig_region_init P_((OnigRegion* region)); -ONIG_EXTERN -void onig_region_free P_((OnigRegion* region, int free_self)); -ONIG_EXTERN -void onig_region_copy P_((OnigRegion* to, OnigRegion* from)); -ONIG_EXTERN -void onig_region_clear P_((OnigRegion* region)); -ONIG_EXTERN -int onig_region_resize P_((OnigRegion* region, int n)); -ONIG_EXTERN -int onig_region_set P_((OnigRegion* region, int at, int beg, int end)); -ONIG_EXTERN -int onig_name_to_group_numbers P_((regex_t* reg, const OnigUChar* name, const OnigUChar* name_end, int** nums)); -ONIG_EXTERN -int onig_name_to_backref_number P_((regex_t* reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region)); -ONIG_EXTERN -int onig_foreach_name P_((regex_t* reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,regex_t*,void*), void* arg)); -ONIG_EXTERN -int onig_number_of_names P_((regex_t* reg)); -ONIG_EXTERN -int onig_number_of_captures P_((regex_t* reg)); -ONIG_EXTERN -int onig_number_of_capture_histories P_((regex_t* reg)); -ONIG_EXTERN -OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region)); -ONIG_EXTERN -int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg)); -ONIG_EXTERN -OnigEncoding onig_get_encoding P_((regex_t* reg)); -ONIG_EXTERN -OnigOptionType onig_get_options P_((regex_t* reg)); -ONIG_EXTERN -OnigAmbigType onig_get_ambig_flag P_((regex_t* reg)); -ONIG_EXTERN -OnigSyntaxType* onig_get_syntax P_((regex_t* reg)); -ONIG_EXTERN -int onig_set_default_syntax P_((OnigSyntaxType* syntax)); -ONIG_EXTERN -void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from)); -ONIG_EXTERN -unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax)); -ONIG_EXTERN -unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax)); -ONIG_EXTERN -unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax)); -ONIG_EXTERN -OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax)); -ONIG_EXTERN -void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op)); -ONIG_EXTERN -void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2)); -ONIG_EXTERN -void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior)); -ONIG_EXTERN -void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options)); -ONIG_EXTERN -int onig_set_meta_char P_((OnigEncoding enc, unsigned int what, OnigCodePoint code)); -ONIG_EXTERN -void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from)); -ONIG_EXTERN -OnigAmbigType onig_get_default_ambig_flag P_(()); -ONIG_EXTERN -int onig_set_default_ambig_flag P_((OnigAmbigType ambig_flag)); -ONIG_EXTERN -unsigned int onig_get_match_stack_limit_size P_((void)); -ONIG_EXTERN -int onig_set_match_stack_limit_size P_((unsigned int size)); -ONIG_EXTERN -int onig_end P_((void)); -ONIG_EXTERN -const char* onig_version P_((void)); -ONIG_EXTERN -const char* onig_copyright P_((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ONIGURUMA_H */ diff --git a/ext/mbstring/oniguruma/php_onig_compat.h b/ext/mbstring/oniguruma/php_onig_compat.h deleted file mode 100644 index 1de0d6073dc8e..0000000000000 --- a/ext/mbstring/oniguruma/php_onig_compat.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _PHP_MBREGEX_COMPAT_H -#define _PHP_MBREGEX_COMPAT_H - -#define re_pattern_buffer php_mb_re_pattern_buffer -#define regex_t php_mb_regex_t -#define re_registers php_mb_re_registers - -#endif /* _PHP_MBREGEX_COMPAT_H */ diff --git a/ext/mbstring/oniguruma/regcomp.c b/ext/mbstring/oniguruma/regcomp.c deleted file mode 100644 index a2315fcec539b..0000000000000 --- a/ext/mbstring/oniguruma/regcomp.c +++ /dev/null @@ -1,5546 +0,0 @@ -/********************************************************************** - regcomp.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regparse.h" - -OnigAmbigType OnigDefaultAmbigFlag = - (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | - ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE); - -extern OnigAmbigType -onig_get_default_ambig_flag() -{ - return OnigDefaultAmbigFlag; -} - -extern int -onig_set_default_ambig_flag(OnigAmbigType ambig_flag) -{ - OnigDefaultAmbigFlag = ambig_flag; - return 0; -} - - -#ifndef PLATFORM_UNALIGNED_WORD_ACCESS -static unsigned char PadBuf[WORD_ALIGNMENT_SIZE]; -#endif - -static UChar* -k_strdup(UChar* s, UChar* end) -{ - int len = end - s; - - if (len > 0) { - UChar* r = (UChar* )xmalloc(len + 1); - CHECK_NULL_RETURN(r); - xmemcpy(r, s, len); - r[len] = (UChar )0; - return r; - } - else return NULL; -} - -/* - Caution: node should not be a string node. - (s and end member address break) -*/ -static void -swap_node(Node* a, Node* b) -{ - Node c; - c = *a; *a = *b; *b = c; -} - -static OnigDistance -distance_add(OnigDistance d1, OnigDistance d2) -{ - if (d1 == ONIG_INFINITE_DISTANCE || d2 == ONIG_INFINITE_DISTANCE) - return ONIG_INFINITE_DISTANCE; - else { - if (d1 <= ONIG_INFINITE_DISTANCE - d2) return d1 + d2; - else return ONIG_INFINITE_DISTANCE; - } -} - -static OnigDistance -distance_multiply(OnigDistance d, int m) -{ - if (m == 0) return 0; - - if (d < ONIG_INFINITE_DISTANCE / m) - return d * m; - else - return ONIG_INFINITE_DISTANCE; -} - -static int -bitset_is_empty(BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - if (bs[i] != 0) return 0; - } - return 1; -} - -#ifdef ONIG_DEBUG -static int -bitset_on_num(BitSetRef bs) -{ - int i, n; - - n = 0; - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - if (BITSET_AT(bs, i)) n++; - } - return n; -} -#endif - -extern int -onig_bbuf_init(BBuf* buf, int size) -{ - buf->p = (UChar* )xmalloc(size); - if (IS_NULL(buf->p)) return(ONIGERR_MEMORY); - - buf->alloc = size; - buf->used = 0; - return 0; -} - - -#ifdef USE_SUBEXP_CALL - -static int -unset_addr_list_init(UnsetAddrList* uslist, int size) -{ - UnsetAddr* p; - - p = (UnsetAddr* )xmalloc(sizeof(UnsetAddr)* size); - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - uslist->num = 0; - uslist->alloc = size; - uslist->us = p; - return 0; -} - -static void -unset_addr_list_end(UnsetAddrList* uslist) -{ - if (IS_NOT_NULL(uslist->us)) - xfree(uslist->us); -} - -static int -unset_addr_list_add(UnsetAddrList* uslist, int offset, struct _Node* node) -{ - UnsetAddr* p; - int size; - - if (uslist->num >= uslist->alloc) { - size = uslist->alloc * 2; - p = (UnsetAddr* )xrealloc(uslist->us, sizeof(UnsetAddr) * size); - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - uslist->alloc = size; - uslist->us = p; - } - - uslist->us[uslist->num].offset = offset; - uslist->us[uslist->num].target = node; - uslist->num++; - return 0; -} -#endif /* USE_SUBEXP_CALL */ - - -static int -add_opcode(regex_t* reg, int opcode) -{ - BBUF_ADD1(reg, opcode); - return 0; -} - -static int -add_rel_addr(regex_t* reg, int addr) -{ - RelAddrType ra = (RelAddrType )addr; - - BBUF_ADD(reg, &ra, SIZE_RELADDR); - return 0; -} - -static int -add_abs_addr(regex_t* reg, int addr) -{ - AbsAddrType ra = (AbsAddrType )addr; - - BBUF_ADD(reg, &ra, SIZE_ABSADDR); - return 0; -} - -static int -add_length(regex_t* reg, int len) -{ - LengthType l = (LengthType )len; - - BBUF_ADD(reg, &l, SIZE_LENGTH); - return 0; -} - -static int -add_mem_num(regex_t* reg, int num) -{ - MemNumType n = (MemNumType )num; - - BBUF_ADD(reg, &n, SIZE_MEMNUM); - return 0; -} - -static int -add_pointer(regex_t* reg, void* addr) -{ - PointerType ptr = (PointerType )addr; - - BBUF_ADD(reg, &ptr, SIZE_POINTER); - return 0; -} - -static int -add_option(regex_t* reg, OnigOptionType option) -{ - BBUF_ADD(reg, &option, SIZE_OPTION); - return 0; -} - -static int -add_opcode_rel_addr(regex_t* reg, int opcode, int addr) -{ - int r; - - r = add_opcode(reg, opcode); - if (r) return r; - r = add_rel_addr(reg, addr); - return r; -} - -static int -add_bytes(regex_t* reg, UChar* bytes, int len) -{ - BBUF_ADD(reg, bytes, len); - return 0; -} - -static int -add_bitset(regex_t* reg, BitSetRef bs) -{ - BBUF_ADD(reg, bs, SIZE_BITSET); - return 0; -} - -static int -add_opcode_option(regex_t* reg, int opcode, OnigOptionType option) -{ - int r; - - r = add_opcode(reg, opcode); - if (r) return r; - r = add_option(reg, option); - return r; -} - -static int compile_length_tree(Node* node, regex_t* reg); -static int compile_tree(Node* node, regex_t* reg); - - -#define IS_NEED_STR_LEN_OP_EXACT(op) \ - ((op) == OP_EXACTN || (op) == OP_EXACTMB2N ||\ - (op) == OP_EXACTMB3N || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC) - -static int -select_str_opcode(int mb_len, int str_len, int ignore_case) -{ - int op; - - if (ignore_case) { - switch (str_len) { - case 1: op = OP_EXACT1_IC; break; - default: op = OP_EXACTN_IC; break; - } - } - else { - switch (mb_len) { - case 1: - switch (str_len) { - case 1: op = OP_EXACT1; break; - case 2: op = OP_EXACT2; break; - case 3: op = OP_EXACT3; break; - case 4: op = OP_EXACT4; break; - case 5: op = OP_EXACT5; break; - default: op = OP_EXACTN; break; - } - break; - - case 2: - switch (str_len) { - case 1: op = OP_EXACTMB2N1; break; - case 2: op = OP_EXACTMB2N2; break; - case 3: op = OP_EXACTMB2N3; break; - default: op = OP_EXACTMB2N; break; - } - break; - - case 3: - op = OP_EXACTMB3N; - break; - - default: - op = OP_EXACTMBN; - break; - } - } - return op; -} - -static int -compile_tree_empty_check(Node* node, regex_t* reg, int empty_info) -{ - int r; - int saved_num_null_check = reg->num_null_check; - - if (empty_info != 0) { - r = add_opcode(reg, OP_NULL_CHECK_START); - if (r) return r; - r = add_mem_num(reg, reg->num_null_check); /* NULL CHECK ID */ - if (r) return r; - reg->num_null_check++; - } - - r = compile_tree(node, reg); - if (r) return r; - - if (empty_info != 0) { - if (empty_info == NQ_TARGET_IS_EMPTY) - r = add_opcode(reg, OP_NULL_CHECK_END); - else if (empty_info == NQ_TARGET_IS_EMPTY_MEM) - r = add_opcode(reg, OP_NULL_CHECK_END_MEMST); - else if (empty_info == NQ_TARGET_IS_EMPTY_REC) - r = add_opcode(reg, OP_NULL_CHECK_END_MEMST_PUSH); - - if (r) return r; - r = add_mem_num(reg, saved_num_null_check); /* NULL CHECK ID */ - } - return r; -} - -#ifdef USE_SUBEXP_CALL -static int -compile_call(CallNode* node, regex_t* reg) -{ - int r; - - r = add_opcode(reg, OP_CALL); - if (r) return r; - r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg), - node->target); - if (r) return r; - r = add_abs_addr(reg, 0 /*dummy addr.*/); - return r; -} -#endif - -static int -compile_tree_n_times(Node* node, int n, regex_t* reg) -{ - int i, r; - - for (i = 0; i < n; i++) { - r = compile_tree(node, reg); - if (r) return r; - } - return 0; -} - -static int -add_compile_string_length(UChar* s, int mb_len, int str_len, - regex_t* reg, int ignore_case) -{ - int len; - int op = select_str_opcode(mb_len, str_len, ignore_case); - - len = SIZE_OPCODE; - - if (op == OP_EXACTMBN) len += SIZE_LENGTH; - if (IS_NEED_STR_LEN_OP_EXACT(op)) - len += SIZE_LENGTH; - - len += mb_len * str_len; - return len; -} - -static int -add_compile_string(UChar* s, int mb_len, int str_len, - regex_t* reg, int ignore_case) -{ - int op = select_str_opcode(mb_len, str_len, ignore_case); - add_opcode(reg, op); - - if (op == OP_EXACTMBN) - add_length(reg, mb_len); - - if (IS_NEED_STR_LEN_OP_EXACT(op)) { - if (op == OP_EXACTN_IC) - add_length(reg, mb_len * str_len); - else - add_length(reg, str_len); - } - - add_bytes(reg, s, mb_len * str_len); - return 0; -} - - -static int -compile_length_string_node(Node* node, regex_t* reg) -{ - int rlen, r, len, prev_len, slen, ambig; - OnigEncoding enc = reg->enc; - UChar *p, *prev; - StrNode* sn; - - sn = &(NSTRING(node)); - if (sn->end <= sn->s) - return 0; - - ambig = NSTRING_IS_AMBIG(node); - - p = prev = sn->s; - prev_len = enc_len(enc, p); - p += prev_len; - slen = 1; - rlen = 0; - - for (; p < sn->end; ) { - len = enc_len(enc, p); - if (len == prev_len) { - slen++; - } - else { - r = add_compile_string_length(prev, prev_len, slen, reg, ambig); - rlen += r; - prev = p; - slen = 1; - prev_len = len; - } - p += len; - } - r = add_compile_string_length(prev, prev_len, slen, reg, ambig); - rlen += r; - return rlen; -} - -static int -compile_length_string_raw_node(StrNode* sn, regex_t* reg) -{ - if (sn->end <= sn->s) - return 0; - - return add_compile_string_length(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0); -} - -static int -compile_string_node(Node* node, regex_t* reg) -{ - int r, len, prev_len, slen, ambig; - OnigEncoding enc = reg->enc; - UChar *p, *prev, *end; - StrNode* sn; - - sn = &(NSTRING(node)); - if (sn->end <= sn->s) - return 0; - - end = sn->end; - ambig = NSTRING_IS_AMBIG(node); - - p = prev = sn->s; - prev_len = enc_len(enc, p); - p += prev_len; - slen = 1; - - for (; p < end; ) { - len = enc_len(enc, p); - if (len == prev_len) { - slen++; - } - else { - r = add_compile_string(prev, prev_len, slen, reg, ambig); - if (r) return r; - - prev = p; - slen = 1; - prev_len = len; - } - - p += len; - } - return add_compile_string(prev, prev_len, slen, reg, ambig); -} - -static int -compile_string_raw_node(StrNode* sn, regex_t* reg) -{ - if (sn->end <= sn->s) - return 0; - - return add_compile_string(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0); -} - -static int -add_multi_byte_cclass(BBuf* mbuf, regex_t* reg) -{ -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - add_length(reg, mbuf->used); - return add_bytes(reg, mbuf->p, mbuf->used); -#else - int r, pad_size; - UChar* p = BBUF_GET_ADD_ADDRESS(reg) + SIZE_LENGTH; - - GET_ALIGNMENT_PAD_SIZE(p, pad_size); - add_length(reg, mbuf->used + (WORD_ALIGNMENT_SIZE - 1)); - if (pad_size != 0) add_bytes(reg, PadBuf, pad_size); - - r = add_bytes(reg, mbuf->p, mbuf->used); - - /* padding for return value from compile_length_cclass_node() to be fix. */ - pad_size = (WORD_ALIGNMENT_SIZE - 1) - pad_size; - if (pad_size != 0) add_bytes(reg, PadBuf, pad_size); - return r; -#endif -} - -static int -compile_length_cclass_node(CClassNode* cc, regex_t* reg) -{ - int len; - - if (IS_CCLASS_SHARE(cc)) { - len = SIZE_OPCODE + SIZE_POINTER; - return len; - } - - if (IS_NULL(cc->mbuf)) { - len = SIZE_OPCODE + SIZE_BITSET; - } - else { - if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) { - len = SIZE_OPCODE; - } - else { - len = SIZE_OPCODE + SIZE_BITSET; - } -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - len += SIZE_LENGTH + cc->mbuf->used; -#else - len += SIZE_LENGTH + cc->mbuf->used + (WORD_ALIGNMENT_SIZE - 1); -#endif - } - - return len; -} - -static int -compile_cclass_node(CClassNode* cc, regex_t* reg) -{ - int r; - - if (IS_CCLASS_SHARE(cc)) { - add_opcode(reg, OP_CCLASS_NODE); - r = add_pointer(reg, cc); - return r; - } - - if (IS_NULL(cc->mbuf)) { - if (IS_CCLASS_NOT(cc)) - add_opcode(reg, OP_CCLASS_NOT); - else - add_opcode(reg, OP_CCLASS); - - r = add_bitset(reg, cc->bs); - } - else { - if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) { - if (IS_CCLASS_NOT(cc)) - add_opcode(reg, OP_CCLASS_MB_NOT); - else - add_opcode(reg, OP_CCLASS_MB); - - r = add_multi_byte_cclass(cc->mbuf, reg); - } - else { - if (IS_CCLASS_NOT(cc)) - add_opcode(reg, OP_CCLASS_MIX_NOT); - else - add_opcode(reg, OP_CCLASS_MIX); - - r = add_bitset(reg, cc->bs); - if (r) return r; - r = add_multi_byte_cclass(cc->mbuf, reg); - } - } - - return r; -} - -static int -entry_repeat_range(regex_t* reg, int id, int lower, int upper) -{ -#define REPEAT_RANGE_ALLOC 4 - - OnigRepeatRange* p; - - if (reg->repeat_range_alloc == 0) { - p = (OnigRepeatRange* )xmalloc(sizeof(OnigRepeatRange) * REPEAT_RANGE_ALLOC); - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - reg->repeat_range = p; - reg->repeat_range_alloc = REPEAT_RANGE_ALLOC; - } - else if (reg->repeat_range_alloc <= id) { - int n; - n = reg->repeat_range_alloc + REPEAT_RANGE_ALLOC; - p = (OnigRepeatRange* )xrealloc(reg->repeat_range, - sizeof(OnigRepeatRange) * n); - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - reg->repeat_range = p; - reg->repeat_range_alloc = n; - } - else { - p = reg->repeat_range; - } - - p[id].lower = lower; - p[id].upper = upper; - return 0; -} - -static int -compile_range_repeat_node(QualifierNode* qn, int target_len, int empty_info, - regex_t* reg) -{ - int r; - int num_repeat = reg->num_repeat; - - r = add_opcode(reg, qn->greedy ? OP_REPEAT : OP_REPEAT_NG); - if (r) return r; - r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */ - reg->num_repeat++; - if (r) return r; - r = add_rel_addr(reg, target_len + SIZE_OP_REPEAT_INC); - if (r) return r; - - r = entry_repeat_range(reg, num_repeat, qn->lower, qn->upper); - if (r) return r; - - r = compile_tree_empty_check(qn->target, reg, empty_info); - if (r) return r; - - if ( -#ifdef USE_SUBEXP_CALL - reg->num_call > 0 || -#endif - IS_QUALIFIER_IN_REPEAT(qn)) { - r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC_SG : OP_REPEAT_INC_NG_SG); - } - else { - r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG); - } - if (r) return r; - r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */ - return r; -} - -#define QUALIFIER_EXPAND_LIMIT_SIZE 50 - -static int -compile_length_qualifier_node(QualifierNode* qn, regex_t* reg) -{ - int len, mod_tlen; - int infinite = IS_REPEAT_INFINITE(qn->upper); - int empty_info = qn->target_empty_info; - int tlen = compile_length_tree(qn->target, reg); - - if (tlen < 0) return tlen; - - /* anychar repeat */ - if (NTYPE(qn->target) == N_ANYCHAR) { - if (qn->greedy && infinite) { - if (IS_NOT_NULL(qn->next_head_exact)) - return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower; - else - return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower; - } - } - - if (empty_info != 0) - mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); - else - mod_tlen = tlen; - - if (infinite && - (qn->lower <= 1 || tlen * qn->lower <= QUALIFIER_EXPAND_LIMIT_SIZE)) { - if (qn->lower == 1 && tlen > QUALIFIER_EXPAND_LIMIT_SIZE) { - len = SIZE_OP_JUMP; - } - else { - len = tlen * qn->lower; - } - - if (qn->greedy) { - if (IS_NOT_NULL(qn->head_exact)) - len += SIZE_OP_PUSH_OR_JUMP_EXACT1 + mod_tlen + SIZE_OP_JUMP; - else if (IS_NOT_NULL(qn->next_head_exact)) - len += SIZE_OP_PUSH_IF_PEEK_NEXT + mod_tlen + SIZE_OP_JUMP; - else - len += SIZE_OP_PUSH + mod_tlen + SIZE_OP_JUMP; - } - else - len += SIZE_OP_JUMP + mod_tlen + SIZE_OP_PUSH; - } - else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?..){0}/ */ - len = SIZE_OP_JUMP + tlen; - } - else if (!infinite && qn->greedy && - (qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper - <= QUALIFIER_EXPAND_LIMIT_SIZE)) { - len = tlen * qn->lower; - len += (SIZE_OP_PUSH + tlen) * (qn->upper - qn->lower); - } - else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */ - len = SIZE_OP_PUSH + SIZE_OP_JUMP + tlen; - } - else { - len = SIZE_OP_REPEAT_INC - + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM; - } - - return len; -} - -static int -is_anychar_star_qualifier(QualifierNode* qn) -{ - if (qn->greedy && IS_REPEAT_INFINITE(qn->upper) && - NTYPE(qn->target) == N_ANYCHAR) - return 1; - else - return 0; -} - -static int -compile_qualifier_node(QualifierNode* qn, regex_t* reg) -{ - int i, r, mod_tlen; - int infinite = IS_REPEAT_INFINITE(qn->upper); - int empty_info = qn->target_empty_info; - int tlen = compile_length_tree(qn->target, reg); - - if (tlen < 0) return tlen; - - if (is_anychar_star_qualifier(qn)) { - r = compile_tree_n_times(qn->target, qn->lower, reg); - if (r) return r; - if (IS_NOT_NULL(qn->next_head_exact)) { - if (IS_MULTILINE(reg->options)) - r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT); - else - r = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT); - if (r) return r; - return add_bytes(reg, NSTRING(qn->next_head_exact).s, 1); - } - else { - if (IS_MULTILINE(reg->options)) - return add_opcode(reg, OP_ANYCHAR_ML_STAR); - else - return add_opcode(reg, OP_ANYCHAR_STAR); - } - } - - if (empty_info != 0) - mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); - else - mod_tlen = tlen; - - if (infinite && - (qn->lower <= 1 || tlen * qn->lower <= QUALIFIER_EXPAND_LIMIT_SIZE)) { - if (qn->lower == 1 && tlen > QUALIFIER_EXPAND_LIMIT_SIZE) { - if (qn->greedy) { - if (IS_NOT_NULL(qn->head_exact)) - r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_OR_JUMP_EXACT1); - else if (IS_NOT_NULL(qn->next_head_exact)) - r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_IF_PEEK_NEXT); - else - r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH); - } - else { - r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_JUMP); - } - if (r) return r; - } - else { - r = compile_tree_n_times(qn->target, qn->lower, reg); - if (r) return r; - } - - if (qn->greedy) { - if (IS_NOT_NULL(qn->head_exact)) { - r = add_opcode_rel_addr(reg, OP_PUSH_OR_JUMP_EXACT1, - mod_tlen + SIZE_OP_JUMP); - if (r) return r; - add_bytes(reg, NSTRING(qn->head_exact).s, 1); - r = compile_tree_empty_check(qn->target, reg, empty_info); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_JUMP, - -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_OR_JUMP_EXACT1)); - } - else if (IS_NOT_NULL(qn->next_head_exact)) { - r = add_opcode_rel_addr(reg, OP_PUSH_IF_PEEK_NEXT, - mod_tlen + SIZE_OP_JUMP); - if (r) return r; - add_bytes(reg, NSTRING(qn->next_head_exact).s, 1); - r = compile_tree_empty_check(qn->target, reg, empty_info); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_JUMP, - -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_IF_PEEK_NEXT)); - } - else { - r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP); - if (r) return r; - r = compile_tree_empty_check(qn->target, reg, empty_info); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_JUMP, - -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH)); - } - } - else { - r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen); - if (r) return r; - r = compile_tree_empty_check(qn->target, reg, empty_info); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH)); - } - } - else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?..){0}/ */ - r = add_opcode_rel_addr(reg, OP_JUMP, tlen); - if (r) return r; - r = compile_tree(qn->target, reg); - } - else if (!infinite && qn->greedy && - (qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper - <= QUALIFIER_EXPAND_LIMIT_SIZE)) { - int n = qn->upper - qn->lower; - - r = compile_tree_n_times(qn->target, qn->lower, reg); - if (r) return r; - - for (i = 0; i < n; i++) { - r = add_opcode_rel_addr(reg, OP_PUSH, - (n - i) * tlen + (n - i - 1) * SIZE_OP_PUSH); - if (r) return r; - r = compile_tree(qn->target, reg); - if (r) return r; - } - } - else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */ - r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_JUMP, tlen); - if (r) return r; - r = compile_tree(qn->target, reg); - } - else { - r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg); - } - return r; -} - -static int -compile_length_option_node(EffectNode* node, regex_t* reg) -{ - int tlen; - OnigOptionType prev = reg->options; - - reg->options = node->option; - tlen = compile_length_tree(node->target, reg); - reg->options = prev; - - if (tlen < 0) return tlen; - - if (IS_DYNAMIC_OPTION(prev ^ node->option)) { - return SIZE_OP_SET_OPTION_PUSH + SIZE_OP_SET_OPTION + SIZE_OP_FAIL - + tlen + SIZE_OP_SET_OPTION; - } - else - return tlen; -} - -static int -compile_option_node(EffectNode* node, regex_t* reg) -{ - int r; - OnigOptionType prev = reg->options; - - if (IS_DYNAMIC_OPTION(prev ^ node->option)) { - r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option); - if (r) return r; - r = add_opcode_option(reg, OP_SET_OPTION, prev); - if (r) return r; - r = add_opcode(reg, OP_FAIL); - if (r) return r; - } - - reg->options = node->option; - r = compile_tree(node->target, reg); - reg->options = prev; - - if (IS_DYNAMIC_OPTION(prev ^ node->option)) { - if (r) return r; - r = add_opcode_option(reg, OP_SET_OPTION, prev); - } - return r; -} - -static int -compile_length_effect_node(EffectNode* node, regex_t* reg) -{ - int len; - int tlen; - - if (node->type == EFFECT_OPTION) - return compile_length_option_node(node, reg); - - if (node->target) { - tlen = compile_length_tree(node->target, reg); - if (tlen < 0) return tlen; - } - else - tlen = 0; - - switch (node->type) { - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_CALLED(node)) { - len = SIZE_OP_MEMORY_START_PUSH + tlen - + SIZE_OP_CALL + SIZE_OP_JUMP + SIZE_OP_RETURN; - if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) - len += (IS_EFFECT_RECURSION(node) - ? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH); - else - len += (IS_EFFECT_RECURSION(node) - ? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END); - } - else -#endif - { - if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) - len = SIZE_OP_MEMORY_START_PUSH; - else - len = SIZE_OP_MEMORY_START; - - len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) - ? SIZE_OP_MEMORY_END_PUSH : SIZE_OP_MEMORY_END); - } - break; - - case EFFECT_STOP_BACKTRACK: - if (IS_EFFECT_STOP_BT_SIMPLE_REPEAT(node)) { - QualifierNode* qn = &NQUALIFIER(node->target); - tlen = compile_length_tree(qn->target, reg); - if (tlen < 0) return tlen; - - len = tlen * qn->lower - + SIZE_OP_PUSH + tlen + SIZE_OP_POP + SIZE_OP_JUMP; - } - else { - len = SIZE_OP_PUSH_STOP_BT + tlen + SIZE_OP_POP_STOP_BT; - } - break; - - default: - return ONIGERR_TYPE_BUG; - break; - } - - return len; -} - -static int get_char_length_tree(Node* node, regex_t* reg, int* len); - -static int -compile_effect_node(EffectNode* node, regex_t* reg) -{ - int r, len; - - if (node->type == EFFECT_OPTION) - return compile_option_node(node, reg); - - switch (node->type) { - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_CALLED(node)) { - r = add_opcode(reg, OP_CALL); - if (r) return r; - node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP; - node->state |= NST_ADDR_FIXED; - r = add_abs_addr(reg, (int )node->call_addr); - if (r) return r; - len = compile_length_tree(node->target, reg); - len += (SIZE_OP_MEMORY_START_PUSH + SIZE_OP_RETURN); - if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) - len += (IS_EFFECT_RECURSION(node) - ? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH); - else - len += (IS_EFFECT_RECURSION(node) - ? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END); - - r = add_opcode_rel_addr(reg, OP_JUMP, len); - if (r) return r; - } -#endif - if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) - r = add_opcode(reg, OP_MEMORY_START_PUSH); - else - r = add_opcode(reg, OP_MEMORY_START); - if (r) return r; - r = add_mem_num(reg, node->regnum); - if (r) return r; - r = compile_tree(node->target, reg); - if (r) return r; -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_CALLED(node)) { - if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) - r = add_opcode(reg, (IS_EFFECT_RECURSION(node) - ? OP_MEMORY_END_PUSH_REC : OP_MEMORY_END_PUSH)); - else - r = add_opcode(reg, (IS_EFFECT_RECURSION(node) - ? OP_MEMORY_END_REC : OP_MEMORY_END)); - - if (r) return r; - r = add_mem_num(reg, node->regnum); - if (r) return r; - r = add_opcode(reg, OP_RETURN); - } - else -#endif - { - if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) - r = add_opcode(reg, OP_MEMORY_END_PUSH); - else - r = add_opcode(reg, OP_MEMORY_END); - if (r) return r; - r = add_mem_num(reg, node->regnum); - } - break; - - case EFFECT_STOP_BACKTRACK: - if (IS_EFFECT_STOP_BT_SIMPLE_REPEAT(node)) { - QualifierNode* qn = &NQUALIFIER(node->target); - r = compile_tree_n_times(qn->target, qn->lower, reg); - if (r) return r; - - len = compile_length_tree(qn->target, reg); - if (len < 0) return len; - - r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_POP + SIZE_OP_JUMP); - if (r) return r; - r = compile_tree(qn->target, reg); - if (r) return r; - r = add_opcode(reg, OP_POP); - if (r) return r; - r = add_opcode_rel_addr(reg, OP_JUMP, - -((int )SIZE_OP_PUSH + len + (int )SIZE_OP_POP + (int )SIZE_OP_JUMP)); - } - else { - r = add_opcode(reg, OP_PUSH_STOP_BT); - if (r) return r; - r = compile_tree(node->target, reg); - if (r) return r; - r = add_opcode(reg, OP_POP_STOP_BT); - } - break; - - default: - return ONIGERR_TYPE_BUG; - break; - } - - return r; -} - -static int -compile_length_anchor_node(AnchorNode* node, regex_t* reg) -{ - int len; - int tlen = 0; - - if (node->target) { - tlen = compile_length_tree(node->target, reg); - if (tlen < 0) return tlen; - } - - switch (node->type) { - case ANCHOR_PREC_READ: - len = SIZE_OP_PUSH_POS + tlen + SIZE_OP_POP_POS; - break; - case ANCHOR_PREC_READ_NOT: - len = SIZE_OP_PUSH_POS_NOT + tlen + SIZE_OP_FAIL_POS; - break; - case ANCHOR_LOOK_BEHIND: - len = SIZE_OP_LOOK_BEHIND + tlen; - break; - case ANCHOR_LOOK_BEHIND_NOT: - len = SIZE_OP_PUSH_LOOK_BEHIND_NOT + tlen + SIZE_OP_FAIL_LOOK_BEHIND_NOT; - break; - - default: - len = SIZE_OPCODE; - break; - } - - return len; -} - -static int -compile_anchor_node(AnchorNode* node, regex_t* reg) -{ - int r, len; - - switch (node->type) { - case ANCHOR_BEGIN_BUF: r = add_opcode(reg, OP_BEGIN_BUF); break; - case ANCHOR_END_BUF: r = add_opcode(reg, OP_END_BUF); break; - case ANCHOR_BEGIN_LINE: r = add_opcode(reg, OP_BEGIN_LINE); break; - case ANCHOR_END_LINE: r = add_opcode(reg, OP_END_LINE); break; - case ANCHOR_SEMI_END_BUF: r = add_opcode(reg, OP_SEMI_END_BUF); break; - case ANCHOR_BEGIN_POSITION: r = add_opcode(reg, OP_BEGIN_POSITION); break; - - case ANCHOR_WORD_BOUND: r = add_opcode(reg, OP_WORD_BOUND); break; - case ANCHOR_NOT_WORD_BOUND: r = add_opcode(reg, OP_NOT_WORD_BOUND); break; -#ifdef USE_WORD_BEGIN_END - case ANCHOR_WORD_BEGIN: r = add_opcode(reg, OP_WORD_BEGIN); break; - case ANCHOR_WORD_END: r = add_opcode(reg, OP_WORD_END); break; -#endif - - case ANCHOR_PREC_READ: - r = add_opcode(reg, OP_PUSH_POS); - if (r) return r; - r = compile_tree(node->target, reg); - if (r) return r; - r = add_opcode(reg, OP_POP_POS); - break; - - case ANCHOR_PREC_READ_NOT: - len = compile_length_tree(node->target, reg); - if (len < 0) return len; - r = add_opcode_rel_addr(reg, OP_PUSH_POS_NOT, len + SIZE_OP_FAIL_POS); - if (r) return r; - r = compile_tree(node->target, reg); - if (r) return r; - r = add_opcode(reg, OP_FAIL_POS); - break; - - case ANCHOR_LOOK_BEHIND: - { - int n; - r = add_opcode(reg, OP_LOOK_BEHIND); - if (r) return r; - if (node->char_len < 0) { - r = get_char_length_tree(node->target, reg, &n); - if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - } - else - n = node->char_len; - r = add_length(reg, n); - if (r) return r; - r = compile_tree(node->target, reg); - } - break; - - case ANCHOR_LOOK_BEHIND_NOT: - { - int n; - len = compile_length_tree(node->target, reg); - r = add_opcode_rel_addr(reg, OP_PUSH_LOOK_BEHIND_NOT, - len + SIZE_OP_FAIL_LOOK_BEHIND_NOT); - if (r) return r; - if (node->char_len < 0) { - r = get_char_length_tree(node->target, reg, &n); - if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - } - else - n = node->char_len; - r = add_length(reg, n); - if (r) return r; - r = compile_tree(node->target, reg); - if (r) return r; - r = add_opcode(reg, OP_FAIL_LOOK_BEHIND_NOT); - } - break; - - default: - return ONIGERR_TYPE_BUG; - break; - } - - return r; -} - -static int -compile_length_tree(Node* node, regex_t* reg) -{ - int len, type, r; - - type = NTYPE(node); - switch (type) { - case N_LIST: - len = 0; - do { - r = compile_length_tree(NCONS(node).left, reg); - if (r < 0) return r; - len += r; - } while (IS_NOT_NULL(node = NCONS(node).right)); - r = len; - break; - - case N_ALT: - { - int n; - - n = r = 0; - do { - r += compile_length_tree(NCONS(node).left, reg); - n++; - } while (IS_NOT_NULL(node = NCONS(node).right)); - r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1); - } - break; - - case N_STRING: - if (NSTRING_IS_RAW(node)) - r = compile_length_string_raw_node(&(NSTRING(node)), reg); - else - r = compile_length_string_node(node, reg); - break; - - case N_CCLASS: - r = compile_length_cclass_node(&(NCCLASS(node)), reg); - break; - - case N_CTYPE: - case N_ANYCHAR: - r = SIZE_OPCODE; - break; - - case N_BACKREF: - { - BackrefNode* br = &(NBACKREF(node)); - - if (br->back_num == 1) { - r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 3) - ? SIZE_OPCODE : (SIZE_OPCODE + SIZE_MEMNUM)); - } - else { - r = SIZE_OPCODE + SIZE_LENGTH + (SIZE_MEMNUM * br->back_num); - } - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - r = SIZE_OP_CALL; - break; -#endif - - case N_QUALIFIER: - r = compile_length_qualifier_node(&(NQUALIFIER(node)), reg); - break; - - case N_EFFECT: - r = compile_length_effect_node(&NEFFECT(node), reg); - break; - - case N_ANCHOR: - r = compile_length_anchor_node(&(NANCHOR(node)), reg); - break; - - default: - return ONIGERR_TYPE_BUG; - break; - } - - return r; -} - -static int -compile_tree(Node* node, regex_t* reg) -{ - int n, type, len, pos, r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - do { - r = compile_tree(NCONS(node).left, reg); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_ALT: - { - Node* x = node; - len = 0; - do { - len += compile_length_tree(NCONS(x).left, reg); - if (NCONS(x).right != NULL) { - len += SIZE_OP_PUSH + SIZE_OP_JUMP; - } - } while (IS_NOT_NULL(x = NCONS(x).right)); - pos = reg->used + len; /* goal position */ - - do { - len = compile_length_tree(NCONS(node).left, reg); - if (IS_NOT_NULL(NCONS(node).right)) { - r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_JUMP); - if (r) break; - } - r = compile_tree(NCONS(node).left, reg); - if (r) break; - if (IS_NOT_NULL(NCONS(node).right)) { - len = pos - (reg->used + SIZE_OP_JUMP); - r = add_opcode_rel_addr(reg, OP_JUMP, len); - if (r) break; - } - } while (IS_NOT_NULL(node = NCONS(node).right)); - } - break; - - case N_STRING: - if (NSTRING_IS_RAW(node)) - r = compile_string_raw_node(&(NSTRING(node)), reg); - else - r = compile_string_node(node, reg); - break; - - case N_CCLASS: - r = compile_cclass_node(&(NCCLASS(node)), reg); - break; - - case N_CTYPE: - { - int op; - - switch (NCTYPE(node).type) { - case CTYPE_WORD: op = OP_WORD; break; - case CTYPE_NOT_WORD: op = OP_NOT_WORD; break; - default: - return ONIGERR_TYPE_BUG; - break; - } - r = add_opcode(reg, op); - } - break; - - case N_ANYCHAR: - if (IS_MULTILINE(reg->options)) - r = add_opcode(reg, OP_ANYCHAR_ML); - else - r = add_opcode(reg, OP_ANYCHAR); - break; - - case N_BACKREF: - { - int i; - BackrefNode* br = &(NBACKREF(node)); - - if (br->back_num == 1) { - n = br->back_static[0]; - if (IS_IGNORECASE(reg->options)) { - r = add_opcode(reg, OP_BACKREFN_IC); - if (r) return r; - r = add_mem_num(reg, n); - } - else { - switch (n) { - case 1: r = add_opcode(reg, OP_BACKREF1); break; - case 2: r = add_opcode(reg, OP_BACKREF2); break; - case 3: r = add_opcode(reg, OP_BACKREF3); break; - default: - r = add_opcode(reg, OP_BACKREFN); - if (r) return r; - r = add_mem_num(reg, n); - break; - } - } - } - else { - int* p; - - if (IS_IGNORECASE(reg->options)) { - add_opcode(reg, OP_BACKREF_MULTI_IC); - } - else { - add_opcode(reg, OP_BACKREF_MULTI); - } - - if (r) return r; - add_length(reg, br->back_num); - if (r) return r; - p = BACKREFS_P(br); - for (i = br->back_num - 1; i >= 0; i--) { - r = add_mem_num(reg, p[i]); - if (r) return r; - } - } - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - r = compile_call(&(NCALL(node)), reg); - break; -#endif - - case N_QUALIFIER: - r = compile_qualifier_node(&(NQUALIFIER(node)), reg); - break; - - case N_EFFECT: - r = compile_effect_node(&NEFFECT(node), reg); - break; - - case N_ANCHOR: - r = compile_anchor_node(&(NANCHOR(node)), reg); - break; - - default: -#ifdef ONIG_DEBUG - fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node)); -#endif - break; - } - - return r; -} - -#ifdef USE_NAMED_GROUP - -static int -noname_disable_map(Node** plink, GroupNumRemap* map, int* counter) -{ - int r = 0; - Node* node = *plink; - - switch (NTYPE(node)) { - case N_LIST: - case N_ALT: - do { - r = noname_disable_map(&(NCONS(node).left), map, counter); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_QUALIFIER: - { - Node** ptarget = &(NQUALIFIER(node).target); - Node* old = *ptarget; - r = noname_disable_map(ptarget, map, counter); - if (*ptarget != old && NTYPE(*ptarget) == N_QUALIFIER) { - onig_reduce_nested_qualifier(node, *ptarget); - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - if (en->type == EFFECT_MEMORY) { - if (IS_EFFECT_NAMED_GROUP(en)) { - (*counter)++; - map[en->regnum].new_val = *counter; - en->regnum = *counter; - r = noname_disable_map(&(en->target), map, counter); - } - else { - *plink = en->target; - en->target = NULL_NODE; - onig_node_free(node); - r = noname_disable_map(plink, map, counter); - } - } - else - r = noname_disable_map(&(en->target), map, counter); - } - break; - - default: - break; - } - - return r; -} - -static int -renumber_node_backref(Node* node, GroupNumRemap* map) -{ - int i, pos, n, old_num; - int *backs; - BackrefNode* bn = &(NBACKREF(node)); - - if (! IS_BACKREF_NAME_REF(bn)) - return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; - - old_num = bn->back_num; - if (IS_NULL(bn->back_dynamic)) - backs = bn->back_static; - else - backs = bn->back_dynamic; - - for (i = 0, pos = 0; i < old_num; i++) { - n = map[backs[i]].new_val; - if (n > 0) { - backs[pos] = n; - pos++; - } - } - - bn->back_num = pos; - return 0; -} - -static int -renumber_by_map(Node* node, GroupNumRemap* map) -{ - int r = 0; - - switch (NTYPE(node)) { - case N_LIST: - case N_ALT: - do { - r = renumber_by_map(NCONS(node).left, map); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - case N_QUALIFIER: - r = renumber_by_map(NQUALIFIER(node).target, map); - break; - case N_EFFECT: - r = renumber_by_map(NEFFECT(node).target, map); - break; - - case N_BACKREF: - r = renumber_node_backref(node, map); - break; - - default: - break; - } - - return r; -} - -static int -numbered_ref_check(Node* node) -{ - int r = 0; - - switch (NTYPE(node)) { - case N_LIST: - case N_ALT: - do { - r = numbered_ref_check(NCONS(node).left); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - case N_QUALIFIER: - r = numbered_ref_check(NQUALIFIER(node).target); - break; - case N_EFFECT: - r = numbered_ref_check(NEFFECT(node).target); - break; - - case N_BACKREF: - if (! IS_BACKREF_NAME_REF(&(NBACKREF(node)))) - return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; - break; - - default: - break; - } - - return r; -} - -static int -disable_noname_group_capture(Node** root, regex_t* reg, ScanEnv* env) -{ - int r, i, pos, counter; - BitStatusType loc; - GroupNumRemap* map; - - map = (GroupNumRemap* )xalloca(sizeof(GroupNumRemap) * (env->num_mem + 1)); - CHECK_NULL_RETURN_VAL(map, ONIGERR_MEMORY); - for (i = 1; i <= env->num_mem; i++) { - map[i].new_val = 0; - } - counter = 0; - r = noname_disable_map(root, map, &counter); - if (r != 0) return r; - - r = renumber_by_map(*root, map); - if (r != 0) return r; - - for (i = 1, pos = 1; i <= env->num_mem; i++) { - if (map[i].new_val > 0) { - SCANENV_MEM_NODES(env)[pos] = SCANENV_MEM_NODES(env)[i]; - pos++; - } - } - - loc = env->capture_history; - BIT_STATUS_CLEAR(env->capture_history); - for (i = 1; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) { - if (BIT_STATUS_AT(loc, i)) { - BIT_STATUS_ON_AT_SIMPLE(env->capture_history, map[i].new_val); - } - } - - env->num_mem = env->num_named; - reg->num_mem = env->num_named; - - return onig_renumber_name_table(reg, map); -} -#endif /* USE_NAMED_GROUP */ - -#ifdef USE_SUBEXP_CALL -static int -unset_addr_list_fix(UnsetAddrList* uslist, regex_t* reg) -{ - int i, offset; - EffectNode* en; - AbsAddrType addr; - - for (i = 0; i < uslist->num; i++) { - en = &(NEFFECT(uslist->us[i].target)); - if (! IS_EFFECT_ADDR_FIXED(en)) return ONIGERR_PARSER_BUG; - addr = en->call_addr; - offset = uslist->us[i].offset; - - BBUF_WRITE(reg, offset, &addr, SIZE_ABSADDR); - } - return 0; -} -#endif - -#ifdef USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK -static int -qualifiers_memory_node_info(Node* node) -{ - int r = 0; - - switch (NTYPE(node)) { - case N_LIST: - case N_ALT: - { - int v; - do { - v = qualifiers_memory_node_info(NCONS(node).left); - if (v > r) r = v; - } while (v >= 0 && IS_NOT_NULL(node = NCONS(node).right)); - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - if (IS_CALL_RECURSION(&NCALL(node))) { - return NQ_TARGET_IS_EMPTY_REC; /* tiny version */ - } - else - r = qualifiers_memory_node_info(NCALL(node).target); - break; -#endif - - case N_QUALIFIER: - { - QualifierNode* qn = &(NQUALIFIER(node)); - if (qn->upper != 0) { - r = qualifiers_memory_node_info(qn->target); - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - switch (en->type) { - case EFFECT_MEMORY: - return NQ_TARGET_IS_EMPTY_MEM; - break; - - case EFFECT_OPTION: - case EFFECT_STOP_BACKTRACK: - r = qualifiers_memory_node_info(en->target); - break; - default: - break; - } - } - break; - - case N_BACKREF: - case N_STRING: - case N_CTYPE: - case N_CCLASS: - case N_ANYCHAR: - case N_ANCHOR: - default: - break; - } - - return r; -} -#endif /* USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK */ - -static int -get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env) -{ - OnigDistance tmin; - int r = 0; - - *min = 0; - switch (NTYPE(node)) { - case N_BACKREF: - { - int i; - int* backs; - Node** nodes = SCANENV_MEM_NODES(env); - BackrefNode* br = &(NBACKREF(node)); - if (br->state & NST_RECURSION) break; - - backs = BACKREFS_P(br); - if (backs[0] > env->num_mem) return ONIGERR_INVALID_BACKREF; - r = get_min_match_length(nodes[backs[0]], min, env); - if (r != 0) break; - for (i = 1; i < br->back_num; i++) { - if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF; - r = get_min_match_length(nodes[backs[i]], &tmin, env); - if (r != 0) break; - if (*min > tmin) *min = tmin; - } - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - if (IS_CALL_RECURSION(&NCALL(node))) { - EffectNode* en = &(NEFFECT(NCALL(node).target)); - if (IS_EFFECT_MIN_FIXED(en)) - *min = en->min_len; - } - else - r = get_min_match_length(NCALL(node).target, min, env); - break; -#endif - - case N_LIST: - do { - r = get_min_match_length(NCONS(node).left, &tmin, env); - if (r == 0) *min += tmin; - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_ALT: - { - Node *x, *y; - y = node; - do { - x = NCONS(y).left; - r = get_min_match_length(x, &tmin, env); - if (r != 0) break; - if (y == node) *min = tmin; - else if (*min > tmin) *min = tmin; - } while (r == 0 && IS_NOT_NULL(y = NCONS(y).right)); - } - break; - - case N_STRING: - { - StrNode* sn = &(NSTRING(node)); - *min = sn->end - sn->s; - } - break; - - case N_CTYPE: - switch (NCTYPE(node).type) { - case CTYPE_WORD: *min = 1; break; - case CTYPE_NOT_WORD: *min = 1; break; - default: - break; - } - break; - - case N_CCLASS: - case N_ANYCHAR: - *min = 1; - break; - - case N_QUALIFIER: - { - QualifierNode* qn = &(NQUALIFIER(node)); - - if (qn->lower > 0) { - r = get_min_match_length(qn->target, min, env); - if (r == 0) - *min = distance_multiply(*min, qn->lower); - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - switch (en->type) { - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_MIN_FIXED(en)) - *min = en->min_len; - else { - r = get_min_match_length(en->target, min, env); - if (r == 0) { - en->min_len = *min; - SET_EFFECT_STATUS(node, NST_MIN_FIXED); - } - } - break; -#endif - case EFFECT_OPTION: - case EFFECT_STOP_BACKTRACK: - r = get_min_match_length(en->target, min, env); - break; - } - } - break; - - case N_ANCHOR: - default: - break; - } - - return r; -} - -static int -get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env) -{ - OnigDistance tmax; - int r = 0; - - *max = 0; - switch (NTYPE(node)) { - case N_LIST: - do { - r = get_max_match_length(NCONS(node).left, &tmax, env); - if (r == 0) - *max = distance_add(*max, tmax); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_ALT: - do { - r = get_max_match_length(NCONS(node).left, &tmax, env); - if (r == 0 && *max < tmax) *max = tmax; - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_STRING: - { - StrNode* sn = &(NSTRING(node)); - *max = sn->end - sn->s; - } - break; - - case N_CTYPE: - switch (NCTYPE(node).type) { - case CTYPE_WORD: - case CTYPE_NOT_WORD: - *max = ONIGENC_MBC_MAXLEN_DIST(env->enc); - break; - - default: - break; - } - break; - - case N_CCLASS: - case N_ANYCHAR: - *max = ONIGENC_MBC_MAXLEN_DIST(env->enc); - break; - - case N_BACKREF: - { - int i; - int* backs; - Node** nodes = SCANENV_MEM_NODES(env); - BackrefNode* br = &(NBACKREF(node)); - if (br->state & NST_RECURSION) { - *max = ONIG_INFINITE_DISTANCE; - break; - } - backs = BACKREFS_P(br); - for (i = 0; i < br->back_num; i++) { - if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF; - r = get_max_match_length(nodes[backs[i]], &tmax, env); - if (r != 0) break; - if (*max < tmax) *max = tmax; - } - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - if (! IS_CALL_RECURSION(&(NCALL(node)))) - r = get_max_match_length(NCALL(node).target, max, env); - else - *max = ONIG_INFINITE_DISTANCE; - break; -#endif - - case N_QUALIFIER: - { - QualifierNode* qn = &(NQUALIFIER(node)); - - if (qn->upper != 0) { - r = get_max_match_length(qn->target, max, env); - if (r == 0 && *max != 0) { - if (! IS_REPEAT_INFINITE(qn->upper)) - *max = distance_multiply(*max, qn->upper); - else - *max = ONIG_INFINITE_DISTANCE; - } - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - switch (en->type) { - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_MAX_FIXED(en)) - *max = en->max_len; - else { - r = get_max_match_length(en->target, max, env); - if (r == 0) { - en->max_len = *max; - SET_EFFECT_STATUS(node, NST_MAX_FIXED); - } - } - break; -#endif - case EFFECT_OPTION: - case EFFECT_STOP_BACKTRACK: - r = get_max_match_length(en->target, max, env); - break; - } - } - break; - - case N_ANCHOR: - default: - break; - } - - return r; -} - -#define GET_CHAR_LEN_VARLEN -1 -#define GET_CHAR_LEN_TOP_ALT_VARLEN -2 - -/* fixed size pattern node only */ -static int -get_char_length_tree1(Node* node, regex_t* reg, int* len, int level) -{ - int tlen; - int r = 0; - - level++; - *len = 0; - switch (NTYPE(node)) { - case N_LIST: - do { - r = get_char_length_tree1(NCONS(node).left, reg, &tlen, level); - if (r == 0) - *len = distance_add(*len, tlen); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_ALT: - { - int tlen2; - int varlen = 0; - - r = get_char_length_tree1(NCONS(node).left, reg, &tlen, level); - while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)) { - r = get_char_length_tree1(NCONS(node).left, reg, &tlen2, level); - if (r == 0) { - if (tlen != tlen2) - varlen = 1; - } - } - if (r == 0) { - if (varlen != 0) { - if (level == 1) - r = GET_CHAR_LEN_TOP_ALT_VARLEN; - else - r = GET_CHAR_LEN_VARLEN; - } - else - *len = tlen; - } - } - break; - - case N_STRING: - { - StrNode* sn = &(NSTRING(node)); - UChar *s = sn->s; - while (s < sn->end) { - s += enc_len(reg->enc, s); - (*len)++; - } - } - break; - - case N_QUALIFIER: - { - QualifierNode* qn = &(NQUALIFIER(node)); - if (qn->lower == qn->upper) { - r = get_char_length_tree1(qn->target, reg, &tlen, level); - if (r == 0) - *len = distance_multiply(tlen, qn->lower); - } - else - r = GET_CHAR_LEN_VARLEN; - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - if (! IS_CALL_RECURSION(&(NCALL(node)))) - r = get_char_length_tree1(NCALL(node).target, reg, len, level); - else - r = GET_CHAR_LEN_VARLEN; - break; -#endif - - case N_CTYPE: - switch (NCTYPE(node).type) { - case CTYPE_WORD: - case CTYPE_NOT_WORD: - *len = 1; - break; - } - break; - - case N_CCLASS: - case N_ANYCHAR: - *len = 1; - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - switch (en->type) { - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - if (IS_EFFECT_CLEN_FIXED(en)) - *len = en->char_len; - else { - r = get_char_length_tree1(en->target, reg, len, level); - if (r == 0) { - en->char_len = *len; - SET_EFFECT_STATUS(node, NST_CLEN_FIXED); - } - } - break; -#endif - case EFFECT_OPTION: - case EFFECT_STOP_BACKTRACK: - r = get_char_length_tree1(en->target, reg, len, level); - break; - default: - break; - } - } - break; - - case N_ANCHOR: - break; - - default: - r = GET_CHAR_LEN_VARLEN; - break; - } - - return r; -} - -static int -get_char_length_tree(Node* node, regex_t* reg, int* len) -{ - return get_char_length_tree1(node, reg, len, 0); -} - -extern int -onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc) -{ - int found; - - if (ONIGENC_MBC_MINLEN(enc) > 1 || (code >= SINGLE_BYTE_SIZE)) { - if (IS_NULL(cc->mbuf)) { - found = 0; - } - else { - found = (onig_is_in_code_range(cc->mbuf->p, code) != 0 ? 1 : 0); - } - } - else { - found = (BITSET_AT(cc->bs, code) == 0 ? 0 : 1); - } - - if (IS_CCLASS_NOT(cc)) - return !found; - else - return found; -} - -/* x is not included y ==> 1 : 0 */ -static int -is_not_included(Node* x, Node* y, regex_t* reg) -{ - int i, len; - OnigCodePoint code; - UChar *p, c; - int ytype; - - retry: - ytype = NTYPE(y); - switch (NTYPE(x)) { - case N_CTYPE: - { - switch (ytype) { - case N_CTYPE: - switch (NCTYPE(x).type) { - case CTYPE_WORD: - if (NCTYPE(y).type == CTYPE_NOT_WORD) - return 1; - else - return 0; - break; - case CTYPE_NOT_WORD: - if (NCTYPE(y).type == CTYPE_WORD) - return 1; - else - return 0; - break; - default: - break; - } - break; - - case N_CCLASS: - swap: - { - Node* tmp; - tmp = x; x = y; y = tmp; - goto retry; - } - break; - - case N_STRING: - goto swap; - break; - - default: - break; - } - } - break; - - case N_CCLASS: - { - CClassNode* xc = &(NCCLASS(x)); - switch (ytype) { - case N_CTYPE: - switch (NCTYPE(y).type) { - case CTYPE_WORD: - if (IS_NULL(xc->mbuf) && !IS_CCLASS_NOT(xc)) { - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - if (BITSET_AT(xc->bs, i)) { - if (ONIGENC_IS_CODE_SB_WORD(reg->enc, i)) return 0; - } - } - return 1; - } - return 0; - break; - case CTYPE_NOT_WORD: - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - if (! ONIGENC_IS_CODE_SB_WORD(reg->enc, i)) { - if (!IS_CCLASS_NOT(xc)) { - if (BITSET_AT(xc->bs, i)) - return 0; - } - else { - if (! BITSET_AT(xc->bs, i)) - return 0; - } - } - } - return 1; - break; - - default: - break; - } - break; - - case N_CCLASS: - { - int v; - CClassNode* yc = &(NCCLASS(y)); - - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - v = BITSET_AT(xc->bs, i); - if ((v != 0 && !IS_CCLASS_NOT(xc)) || - (v == 0 && IS_CCLASS_NOT(xc))) { - v = BITSET_AT(yc->bs, i); - if ((v != 0 && !IS_CCLASS_NOT(yc)) || - (v == 0 && IS_CCLASS_NOT(yc))) - return 0; - } - } - if ((IS_NULL(xc->mbuf) && !IS_CCLASS_NOT(xc)) || - (IS_NULL(yc->mbuf) && !IS_CCLASS_NOT(yc))) - return 1; - return 0; - } - break; - - case N_STRING: - goto swap; - break; - - default: - break; - } - } - break; - - case N_STRING: - { - StrNode* xs = &(NSTRING(x)); - if (NSTRING_LEN(x) == 0) - break; - - c = *(xs->s); - switch (ytype) { - case N_CTYPE: - switch (NCTYPE(y).type) { - case CTYPE_WORD: - return (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end) ? 0 : 1); - break; - case CTYPE_NOT_WORD: - return (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end) ? 1 : 0); - break; - default: - break; - } - break; - - case N_CCLASS: - { - CClassNode* cc = &(NCCLASS(y)); - - code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s, - xs->s + ONIGENC_MBC_MAXLEN(reg->enc)); - return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1); - } - break; - - case N_STRING: - { - UChar *q; - StrNode* ys = &(NSTRING(y)); - len = NSTRING_LEN(x); - if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y); - if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) { - /* tiny version */ - return 0; - } - else { - for (i = 0, p = ys->s, q = xs->s; i < len; i++, p++, q++) { - if (*p != *q) return 1; - } - } - } - break; - - default: - break; - } - } - break; - - default: - break; - } - - return 0; -} - -static Node* -get_head_value_node(Node* node, int exact, regex_t* reg) -{ - Node* n = NULL_NODE; - - switch (NTYPE(node)) { - case N_BACKREF: - case N_ALT: - case N_ANYCHAR: -#ifdef USE_SUBEXP_CALL - case N_CALL: -#endif - break; - - case N_CTYPE: - case N_CCLASS: - if (exact == 0) { - n = node; - } - break; - - case N_LIST: - n = get_head_value_node(NCONS(node).left, exact, reg); - break; - - case N_STRING: - { - StrNode* sn = &(NSTRING(node)); - - if (sn->end <= sn->s) - break; - - if (exact != 0 && - !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) { -#if 0 - UChar* tmp = sn->s; - if (! ONIGENC_IS_MBC_AMBIGUOUS(reg->enc, reg->ambig_flag, - &tmp, sn->end)) - n = node; -#endif - } - else { - n = node; - } - } - break; - - case N_QUALIFIER: - { - QualifierNode* qn = &(NQUALIFIER(node)); - if (qn->lower > 0) { - if (IS_NOT_NULL(qn->head_exact)) - n = qn->head_exact; - else - n = get_head_value_node(qn->target, exact, reg); - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - switch (en->type) { - case EFFECT_OPTION: - { - OnigOptionType options = reg->options; - - reg->options = NEFFECT(node).option; - n = get_head_value_node(NEFFECT(node).target, exact, reg); - reg->options = options; - } - break; - - case EFFECT_MEMORY: - case EFFECT_STOP_BACKTRACK: - n = get_head_value_node(en->target, exact, reg); - break; - } - } - break; - - case N_ANCHOR: - if (NANCHOR(node).type == ANCHOR_PREC_READ) - n = get_head_value_node(NANCHOR(node).target, exact, reg); - break; - - default: - break; - } - - return n; -} - -static int -check_type_tree(Node* node, int type_mask, int effect_mask, int anchor_mask) -{ - int type, r = 0; - - type = NTYPE(node); - if ((type & type_mask) == 0) - return 1; - - switch (type) { - case N_LIST: - case N_ALT: - do { - r = check_type_tree(NCONS(node).left, type_mask, effect_mask, anchor_mask); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_QUALIFIER: - r = check_type_tree(NQUALIFIER(node).target, type_mask, effect_mask, - anchor_mask); - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - if ((en->type & effect_mask) == 0) - return 1; - - r = check_type_tree(en->target, type_mask, effect_mask, anchor_mask); - } - break; - - case N_ANCHOR: - type = NANCHOR(node).type; - if ((type & anchor_mask) == 0) - return 1; - - if (NANCHOR(node).target) - r = check_type_tree(NANCHOR(node).target, - type_mask, effect_mask, anchor_mask); - break; - - default: - break; - } - return r; -} - -#ifdef USE_SUBEXP_CALL - -#define RECURSION_EXIST 1 -#define RECURSION_INFINITE 2 - -static int -subexp_inf_recursive_check(Node* node, ScanEnv* env, int head) -{ - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - { - Node *x; - OnigDistance min; - int ret; - - x = node; - do { - ret = subexp_inf_recursive_check(NCONS(x).left, env, head); - if (ret < 0 || ret == RECURSION_INFINITE) return ret; - r |= ret; - if (head) { - ret = get_min_match_length(NCONS(x).left, &min, env); - if (ret != 0) return ret; - if (min != 0) head = 0; - } - } while (IS_NOT_NULL(x = NCONS(x).right)); - } - break; - - case N_ALT: - { - int ret; - r = RECURSION_EXIST; - do { - ret = subexp_inf_recursive_check(NCONS(node).left, env, head); - if (ret < 0 || ret == RECURSION_INFINITE) return ret; - r &= ret; - } while (IS_NOT_NULL(node = NCONS(node).right)); - } - break; - - case N_QUALIFIER: - r = subexp_inf_recursive_check(NQUALIFIER(node).target, env, head); - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - switch (an->type) { - case ANCHOR_PREC_READ: - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: - case ANCHOR_LOOK_BEHIND_NOT: - r = subexp_inf_recursive_check(an->target, env, head); - break; - } - } - break; - - case N_CALL: - r = subexp_inf_recursive_check(NCALL(node).target, env, head); - break; - - case N_EFFECT: - if (IS_EFFECT_MARK2(&(NEFFECT(node)))) - return 0; - else if (IS_EFFECT_MARK1(&(NEFFECT(node)))) - return (head == 0 ? RECURSION_EXIST : RECURSION_INFINITE); - else { - SET_EFFECT_STATUS(node, NST_MARK2); - r = subexp_inf_recursive_check(NEFFECT(node).target, env, head); - CLEAR_EFFECT_STATUS(node, NST_MARK2); - } - break; - - default: - break; - } - - return r; -} - -static int -subexp_inf_recursive_check_trav(Node* node, ScanEnv* env) -{ - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - case N_ALT: - do { - r = subexp_inf_recursive_check_trav(NCONS(node).left, env); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_QUALIFIER: - r = subexp_inf_recursive_check_trav(NQUALIFIER(node).target, env); - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - switch (an->type) { - case ANCHOR_PREC_READ: - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: - case ANCHOR_LOOK_BEHIND_NOT: - r = subexp_inf_recursive_check_trav(an->target, env); - break; - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - - if (IS_EFFECT_RECURSION(en)) { - SET_EFFECT_STATUS(node, NST_MARK1); - r = subexp_inf_recursive_check(en->target, env, 1); - if (r > 0) return ONIGERR_NEVER_ENDING_RECURSION; - CLEAR_EFFECT_STATUS(node, NST_MARK1); - } - r = subexp_inf_recursive_check_trav(en->target, env); - } - - break; - - default: - break; - } - - return r; -} - -static int -subexp_recursive_check(Node* node) -{ - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - case N_ALT: - do { - r |= subexp_recursive_check(NCONS(node).left); - } while (IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_QUALIFIER: - r = subexp_recursive_check(NQUALIFIER(node).target); - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - switch (an->type) { - case ANCHOR_PREC_READ: - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: - case ANCHOR_LOOK_BEHIND_NOT: - r = subexp_recursive_check(an->target); - break; - } - } - break; - - case N_CALL: - r = subexp_recursive_check(NCALL(node).target); - if (r != 0) SET_CALL_RECURSION(node); - break; - - case N_EFFECT: - if (IS_EFFECT_MARK2(&(NEFFECT(node)))) - return 0; - else if (IS_EFFECT_MARK1(&(NEFFECT(node)))) - return 1; /* recursion */ - else { - SET_EFFECT_STATUS(node, NST_MARK2); - r = subexp_recursive_check(NEFFECT(node).target); - CLEAR_EFFECT_STATUS(node, NST_MARK2); - } - break; - - default: - break; - } - - return r; -} - - -static int -subexp_recursive_check_trav(Node* node, ScanEnv* env) -{ -#define FOUND_CALLED_NODE 1 - - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - case N_ALT: - { - int ret; - do { - ret = subexp_recursive_check_trav(NCONS(node).left, env); - if (ret == FOUND_CALLED_NODE) r = FOUND_CALLED_NODE; - else if (ret < 0) return ret; - } while (IS_NOT_NULL(node = NCONS(node).right)); - } - break; - - case N_QUALIFIER: - r = subexp_recursive_check_trav(NQUALIFIER(node).target, env); - if (NQUALIFIER(node).upper == 0) { - if (r == FOUND_CALLED_NODE) - NQUALIFIER(node).is_refered = 1; - } - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - switch (an->type) { - case ANCHOR_PREC_READ: - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: - case ANCHOR_LOOK_BEHIND_NOT: - r = subexp_recursive_check_trav(an->target, env); - break; - } - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - - if (! IS_EFFECT_RECURSION(en)) { - if (IS_EFFECT_CALLED(en)) { - SET_EFFECT_STATUS(node, NST_MARK1); - r = subexp_recursive_check(en->target); - if (r != 0) SET_EFFECT_STATUS(node, NST_RECURSION); - CLEAR_EFFECT_STATUS(node, NST_MARK1); - } - } - r = subexp_recursive_check_trav(en->target, env); - if (IS_EFFECT_CALLED(en)) - r |= FOUND_CALLED_NODE; - } - break; - - default: - break; - } - - return r; -} - -static int -setup_subexp_call(Node* node, ScanEnv* env) -{ - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - do { - r = setup_subexp_call(NCONS(node).left, env); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_ALT: - do { - r = setup_subexp_call(NCONS(node).left, env); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_QUALIFIER: - r = setup_subexp_call(NQUALIFIER(node).target, env); - break; - case N_EFFECT: - r = setup_subexp_call(NEFFECT(node).target, env); - break; - - case N_CALL: - { - int n, num, *refs; - UChar *p; - CallNode* cn = &(NCALL(node)); - Node** nodes = SCANENV_MEM_NODES(env); - -#ifdef USE_NAMED_GROUP - n = onig_name_to_group_numbers(env->reg, cn->name, cn->name_end, &refs); -#else - n = -1; -#endif - if (n <= 0) { - /* name not found, check group number. (?*ddd) */ - p = cn->name; - num = onig_scan_unsigned_number(&p, cn->name_end, env->enc); - if (num <= 0 || p != cn->name_end) { - onig_scan_env_set_error_string(env, - ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end); - return ONIGERR_UNDEFINED_NAME_REFERENCE; - } -#ifdef USE_NAMED_GROUP - if (env->num_named > 0 && - IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) && - !ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) { - return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; - } -#endif - if (num > env->num_mem) { - onig_scan_env_set_error_string(env, - ONIGERR_UNDEFINED_GROUP_REFERENCE, cn->name, cn->name_end); - return ONIGERR_UNDEFINED_GROUP_REFERENCE; - } - cn->ref_num = num; - goto set_call_attr; - } - else if (n > 1) { - onig_scan_env_set_error_string(env, - ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, cn->name, cn->name_end); - return ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL; - } - else { - cn->ref_num = refs[0]; - set_call_attr: - cn->target = nodes[cn->ref_num]; - if (IS_NULL(cn->target)) { - onig_scan_env_set_error_string(env, - ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end); - return ONIGERR_UNDEFINED_NAME_REFERENCE; - } - SET_EFFECT_STATUS(cn->target, NST_CALLED); - BIT_STATUS_ON_AT(env->bt_mem_start, cn->ref_num); - cn->unset_addr_list = env->unset_addr_list; - } - } - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - - switch (an->type) { - case ANCHOR_PREC_READ: - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: - case ANCHOR_LOOK_BEHIND_NOT: - r = setup_subexp_call(an->target, env); - break; - } - } - break; - - default: - break; - } - - return r; -} -#endif - -/* divide different length alternatives in look-behind. - (?<=A|B) ==> (?<=A)|(?<=B) - (? (?type; - - head = an->target; - np = NCONS(head).left; - tmp_node = *node; *node = *head; *head = tmp_node; - NCONS(node).left = head; - NANCHOR(head).target = np; - - np = node; - while ((np = NCONS(np).right) != NULL_NODE) { - insert_node = onig_node_new_anchor(anc_type); - CHECK_NULL_RETURN_VAL(insert_node, ONIGERR_MEMORY); - NANCHOR(insert_node).target = NCONS(np).left; - NCONS(np).left = insert_node; - } - - if (anc_type == ANCHOR_LOOK_BEHIND_NOT) { - np = node; - do { - np->type = N_LIST; /* alt -> list */ - } while ((np = NCONS(np).right) != NULL_NODE); - } - return 0; -} - -static int -setup_look_behind(Node* node, regex_t* reg, ScanEnv* env) -{ - int r, len; - AnchorNode* an = &(NANCHOR(node)); - - r = get_char_length_tree(an->target, reg, &len); - if (r == 0) - an->char_len = len; - else if (r == GET_CHAR_LEN_VARLEN) - r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - else if (r == GET_CHAR_LEN_TOP_ALT_VARLEN) { - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND)) - r = divide_look_behind_alternatives(node); - else - r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - } - - return r; -} - -static int -next_setup(Node* node, Node* next_node, regex_t* reg) -{ - int type; - - retry: - type = NTYPE(node); - if (type == N_QUALIFIER) { - QualifierNode* qn = &(NQUALIFIER(node)); - if (qn->greedy && IS_REPEAT_INFINITE(qn->upper)) { -#ifdef USE_QUALIFIER_PEEK_NEXT - qn->next_head_exact = get_head_value_node(next_node, 1, reg); -#endif - /* automatic posseivation a*b ==> (?>a*)b */ - if (qn->lower <= 1) { - int ttype = NTYPE(qn->target); - if (IS_NODE_TYPE_SIMPLE(ttype)) { - Node *x, *y; - x = get_head_value_node(qn->target, 0, reg); - if (IS_NOT_NULL(x)) { - y = get_head_value_node(next_node, 0, reg); - if (IS_NOT_NULL(y) && is_not_included(x, y, reg)) { - Node* en = onig_node_new_effect(EFFECT_STOP_BACKTRACK); - CHECK_NULL_RETURN_VAL(en, ONIGERR_MEMORY); - SET_EFFECT_STATUS(en, NST_STOP_BT_SIMPLE_REPEAT); - swap_node(node, en); - NEFFECT(node).target = en; - } - } - } - } - } - } - else if (type == N_EFFECT) { - EffectNode* en = &(NEFFECT(node)); - if (en->type == EFFECT_MEMORY) { - node = en->target; - goto retry; - } - } - return 0; -} - -static int -divide_ambig_string_node(Node* node, regex_t* reg) -{ - StrNode* sn = &NSTRING(node); - int ambig, prev_ambig; - UChar *prev, *p, *end, *prev_start, *start, *tmp, *wp; - Node *snode; - Node *root = NULL_NODE; - Node **tailp = (Node** )0; - - start = prev_start = p = sn->s; - end = sn->end; - if (p >= end) return 0; - - prev_ambig = ONIGENC_IS_MBC_AMBIGUOUS(reg->enc, reg->ambig_flag, &p, end); - - while (p < end) { - prev = p; - if (prev_ambig != (ambig = ONIGENC_IS_MBC_AMBIGUOUS(reg->enc, - reg->ambig_flag, &p, end))) { - - if (prev_ambig != 0) { - tmp = prev_start; - wp = prev_start; - while (tmp < prev) { - wp += ONIGENC_MBC_TO_NORMALIZE(reg->enc, reg->ambig_flag, - &tmp, end, wp); - } - snode = onig_node_new_str(prev_start, wp); - CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY); - NSTRING_SET_AMBIG(snode); - if (wp != prev) NSTRING_SET_AMBIG_REDUCE(snode); - } - else { - snode = onig_node_new_str(prev_start, prev); - CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY); - } - - if (tailp == (Node** )0) { - root = onig_node_new_list(snode, NULL); - CHECK_NULL_RETURN_VAL(root, ONIGERR_MEMORY); - tailp = &(NCONS(root).right); - } - else { - *tailp = onig_node_new_list(snode, NULL); - CHECK_NULL_RETURN_VAL(*tailp, ONIGERR_MEMORY); - tailp = &(NCONS(*tailp).right); - } - - prev_ambig = ambig; - prev_start = prev; - } - } - - if (prev_start == start) { - if (prev_ambig != 0) { - NSTRING_SET_AMBIG(node); - tmp = start; - wp = start; - while (tmp < end) { - wp += ONIGENC_MBC_TO_NORMALIZE(reg->enc, reg->ambig_flag, - &tmp, end, wp); - } - if (wp != sn->end) NSTRING_SET_AMBIG_REDUCE(node); - sn->end = wp; - } - } - else { - if (prev_ambig != 0) { - tmp = prev_start; - wp = prev_start; - while (tmp < end) { - wp += ONIGENC_MBC_TO_NORMALIZE(reg->enc, reg->ambig_flag, - &tmp, end, wp); - } - snode = onig_node_new_str(prev_start, wp); - CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY); - NSTRING_SET_AMBIG(snode); - if (wp != end) NSTRING_SET_AMBIG_REDUCE(snode); - } - else { - snode = onig_node_new_str(prev_start, end); - CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY); - } - - if (tailp == (Node** )0) { - root = onig_node_new_list(snode, NULL); - CHECK_NULL_RETURN_VAL(root, ONIGERR_MEMORY); - tailp = &(NCONS(node).right); - } - else { - *tailp = onig_node_new_list(snode, NULL); - CHECK_NULL_RETURN_VAL(*tailp, ONIGERR_MEMORY); - tailp = &(NCONS(*tailp).right); - } - - swap_node(node, root); - onig_node_str_clear(root); /* should be after swap! */ - onig_node_free(root); /* free original string node */ - } - - return 0; -} - -#define IN_ALT (1<<0) -#define IN_NOT (1<<1) -#define IN_REPEAT (1<<2) -#define IN_VAR_REPEAT (1<<3) - -/* setup_tree does the following work. - 1. check empty loop. (set qn->target_empty_info) - 2. expand ignore-case in char class. - 3. set memory status bit flags. (reg->mem_stats) - 4. set qn->head_exact for [push, exact] -> [push_or_jump_exact1, exact]. - 5. find invalid patterns in look-behind. - 6. expand repeated string. - */ -static int -setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) -{ - int type; - int r = 0; - - type = NTYPE(node); - switch (type) { - case N_LIST: - { - Node* prev = NULL_NODE; - do { - r = setup_tree(NCONS(node).left, reg, state, env); - if (IS_NOT_NULL(prev) && r == 0) { - r = next_setup(prev, NCONS(node).left, reg); - } - prev = NCONS(node).left; - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - } - break; - - case N_ALT: - do { - r = setup_tree(NCONS(node).left, reg, (state | IN_ALT), env); - } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); - break; - - case N_CCLASS: - break; - - case N_STRING: - if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) { - r = divide_ambig_string_node(node, reg); - } - break; - - case N_CTYPE: - case N_ANYCHAR: - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - break; -#endif - - case N_BACKREF: - { - int i; - int* p; - Node** nodes = SCANENV_MEM_NODES(env); - BackrefNode* br = &(NBACKREF(node)); - p = BACKREFS_P(br); - for (i = 0; i < br->back_num; i++) { - if (p[i] > env->num_mem) return ONIGERR_INVALID_BACKREF; - BIT_STATUS_ON_AT(env->backrefed_mem, p[i]); - BIT_STATUS_ON_AT(env->bt_mem_start, p[i]); - SET_EFFECT_STATUS(nodes[p[i]], NST_MEM_BACKREFED); - } - } - break; - - case N_QUALIFIER: - { - OnigDistance d; - QualifierNode* qn = &(NQUALIFIER(node)); - Node* target = qn->target; - - if ((state & IN_REPEAT) != 0) { - qn->state |= NST_IN_REPEAT; - } - - if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) { - r = get_min_match_length(target, &d, env); - if (r) break; - if (d == 0) { - qn->target_empty_info = NQ_TARGET_IS_EMPTY; -#ifdef USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK - r = qualifiers_memory_node_info(target); - if (r < 0) break; - if (r > 0) { - qn->target_empty_info = r; - } -#endif -#if 0 - r = get_max_match_length(target, &d, env); - if (r == 0 && d == 0) { - /* ()* ==> ()?, ()+ ==> () */ - qn->upper = 1; - if (qn->lower > 1) qn->lower = 1; - if (NTYPE(target) == N_STRING) { - qn->upper = qn->lower = 0; /* /(?:)+/ ==> // */ - } - } -#endif - } - } - - state |= IN_REPEAT; - if (qn->lower != qn->upper) - state |= IN_VAR_REPEAT; - r = setup_tree(target, reg, state, env); - if (r) break; - - /* expand string */ -#define EXPAND_STRING_MAX_LENGTH 100 - if (NTYPE(target) == N_STRING) { - if (!IS_REPEAT_INFINITE(qn->lower) && qn->lower == qn->upper && - qn->lower > 1 && qn->lower <= EXPAND_STRING_MAX_LENGTH) { - int len = NSTRING_LEN(target); - StrNode* sn = &(NSTRING(target)); - - if (len * qn->lower <= EXPAND_STRING_MAX_LENGTH) { - int i, n = qn->lower; - onig_node_conv_to_str_node(node, NSTRING(target).flag); - for (i = 0; i < n; i++) { - r = onig_node_str_cat(node, sn->s, sn->end); - if (r) break; - } - onig_node_free(target); - break; /* break case N_QUALIFIER: */ - } - } - } - -#ifdef USE_OP_PUSH_OR_JUMP_EXACT - if (qn->greedy && (qn->target_empty_info != 0)) { - if (NTYPE(target) == N_QUALIFIER) { - QualifierNode* tqn = &(NQUALIFIER(target)); - if (IS_NOT_NULL(tqn->head_exact)) { - qn->head_exact = tqn->head_exact; - tqn->head_exact = NULL; - } - } - else { - qn->head_exact = get_head_value_node(qn->target, 1, reg); - } - } -#endif - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - - switch (en->type) { - case EFFECT_OPTION: - { - OnigOptionType options = reg->options; - reg->options = NEFFECT(node).option; - r = setup_tree(NEFFECT(node).target, reg, state, env); - reg->options = options; - } - break; - - case EFFECT_MEMORY: - if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT)) != 0) { - BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum); - /* SET_EFFECT_STATUS(node, NST_MEM_IN_ALT_NOT); */ - } - r = setup_tree(en->target, reg, state, env); - break; - - case EFFECT_STOP_BACKTRACK: - { - Node* target = en->target; - r = setup_tree(target, reg, state, env); - if (NTYPE(target) == N_QUALIFIER) { - QualifierNode* tqn = &(NQUALIFIER(target)); - if (IS_REPEAT_INFINITE(tqn->upper) && tqn->lower <= 1 && - tqn->greedy != 0) { /* (?>a*), a*+ etc... */ - int qtype = NTYPE(tqn->target); - if (IS_NODE_TYPE_SIMPLE(qtype)) - SET_EFFECT_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT); - } - } - } - break; - } - } - break; - - case N_ANCHOR: - { - AnchorNode* an = &(NANCHOR(node)); - - switch (an->type) { - case ANCHOR_PREC_READ: - r = setup_tree(an->target, reg, state, env); - break; - case ANCHOR_PREC_READ_NOT: - r = setup_tree(an->target, reg, (state | IN_NOT), env); - break; - -/* allowed node types in look-behind */ -#define ALLOWED_TYPE_IN_LB \ - ( N_LIST | N_ALT | N_STRING | N_CCLASS | N_CTYPE | \ - N_ANYCHAR | N_ANCHOR | N_EFFECT | N_QUALIFIER | N_CALL ) - -#define ALLOWED_EFFECT_IN_LB ( EFFECT_MEMORY ) -#define ALLOWED_EFFECT_IN_LB_NOT 0 - -#define ALLOWED_ANCHOR_IN_LB \ -( ANCHOR_LOOK_BEHIND | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF ) -#define ALLOWED_ANCHOR_IN_LB_NOT \ -( ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF ) - /* can't allow all anchors, because \G in look-behind through Search(). - ex. /(?<=\G)zz/.match("azz") => success. */ - - case ANCHOR_LOOK_BEHIND: - { - r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB, - ALLOWED_EFFECT_IN_LB, ALLOWED_ANCHOR_IN_LB); - if (r < 0) return r; - if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - r = setup_look_behind(node, reg, env); - if (r != 0) return r; - r = setup_tree(an->target, reg, state, env); - } - break; - - case ANCHOR_LOOK_BEHIND_NOT: - { - r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB, - ALLOWED_EFFECT_IN_LB_NOT, ALLOWED_ANCHOR_IN_LB_NOT); - if (r < 0) return r; - if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; - r = setup_look_behind(node, reg, env); - if (r != 0) return r; - r = setup_tree(an->target, reg, (state | IN_NOT), env); - } - break; - } - } - break; - - default: - break; - } - - return r; -} - -/* set skip map for Boyer-Moor search */ -static int -set_bm_skip(UChar* s, UChar* end, OnigEncoding enc, - UChar skip[], int** int_skip) -{ - int i, len; - - len = end - s; - if (len < ONIG_CHAR_TABLE_SIZE) { - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) skip[i] = len; - - for (i = 0; i < len - 1; i++) - skip[s[i]] = len - 1 - i; - } - else { - if (IS_NULL(*int_skip)) { - *int_skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE); - if (IS_NULL(*int_skip)) return ONIGERR_MEMORY; - } - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) (*int_skip)[i] = len; - - for (i = 0; i < len - 1; i++) - (*int_skip)[s[i]] = len - 1 - i; - } - return 0; -} - -#define OPT_EXACT_MAXLEN 24 - -typedef struct { - OnigDistance min; /* min byte length */ - OnigDistance max; /* max byte length */ -} MinMaxLen; - -typedef struct { - MinMaxLen mmd; - OnigEncoding enc; - OnigOptionType options; - OnigAmbigType ambig_flag; - ScanEnv* scan_env; -} OptEnv; - -typedef struct { - int left_anchor; - int right_anchor; -} OptAncInfo; - -typedef struct { - MinMaxLen mmd; /* info position */ - OptAncInfo anc; - - int reach_end; - int ignore_case; - int len; - UChar s[OPT_EXACT_MAXLEN]; -} OptExactInfo; - -typedef struct { - MinMaxLen mmd; /* info position */ - OptAncInfo anc; - - int value; /* weighted value */ - UChar map[ONIG_CHAR_TABLE_SIZE]; -} OptMapInfo; - -typedef struct { - MinMaxLen len; - - OptAncInfo anc; - OptExactInfo exb; /* boundary */ - OptExactInfo exm; /* middle */ - OptExactInfo expr; /* prec read (?=...) */ - - OptMapInfo map; /* boundary */ -} NodeOptInfo; - - -static int -map_position_value(OnigEncoding enc, int i) -{ - static short int ByteValTable[] = { - 5, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 10, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 12, 4, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, - 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5, - 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 1 - }; - - if (i < sizeof(ByteValTable)/sizeof(ByteValTable[0])) { - if (i == 0 && ONIGENC_MBC_MINLEN(enc) > 1) - return 20; - else - return (int )ByteValTable[i]; - } - else - return 4; /* Take it easy. */ -} - -static int -distance_value(MinMaxLen* mm) -{ - /* 1000 / (min-max-dist + 1) */ - static short int dist_vals[] = { - 1000, 500, 333, 250, 200, 167, 143, 125, 111, 100, - 91, 83, 77, 71, 67, 63, 59, 56, 53, 50, - 48, 45, 43, 42, 40, 38, 37, 36, 34, 33, - 32, 31, 30, 29, 29, 28, 27, 26, 26, 25, - 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, - 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, - 16, 16, 16, 16, 15, 15, 15, 15, 14, 14, - 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, - 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 10, 10, 10, 10, 10 - }; - - int d; - - if (mm->max == ONIG_INFINITE_DISTANCE) return 0; - - d = mm->max - mm->min; - if (d < sizeof(dist_vals)/sizeof(dist_vals[0])) - /* return dist_vals[d] * 16 / (mm->min + 12); */ - return (int )dist_vals[d]; - else - return 1; -} - -static int -comp_distance_value(MinMaxLen* d1, MinMaxLen* d2, int v1, int v2) -{ - if (v2 <= 0) return -1; - if (v1 <= 0) return 1; - - v1 *= distance_value(d1); - v2 *= distance_value(d2); - - if (v2 > v1) return 1; - if (v2 < v1) return -1; - - if (d2->min < d1->min) return 1; - if (d2->min > d1->min) return -1; - return 0; -} - -static int -is_equal_mml(MinMaxLen* a, MinMaxLen* b) -{ - return (a->min == b->min && a->max == b->max) ? 1 : 0; -} - - -static void -set_mml(MinMaxLen* mml, OnigDistance min, OnigDistance max) -{ - mml->min = min; - mml->max = max; -} - -static void -clear_mml(MinMaxLen* mml) -{ - mml->min = mml->max = 0; -} - -static void -copy_mml(MinMaxLen* to, MinMaxLen* from) -{ - to->min = from->min; - to->max = from->max; -} - -static void -add_mml(MinMaxLen* to, MinMaxLen* from) -{ - to->min = distance_add(to->min, from->min); - to->max = distance_add(to->max, from->max); -} - -#if 0 -static void -add_len_mml(MinMaxLen* to, OnigDistance len) -{ - to->min = distance_add(to->min, len); - to->max = distance_add(to->max, len); -} -#endif - -static void -alt_merge_mml(MinMaxLen* to, MinMaxLen* from) -{ - if (to->min > from->min) to->min = from->min; - if (to->max < from->max) to->max = from->max; -} - -static void -copy_opt_env(OptEnv* to, OptEnv* from) -{ - *to = *from; -} - -static void -clear_opt_anc_info(OptAncInfo* anc) -{ - anc->left_anchor = 0; - anc->right_anchor = 0; -} - -static void -copy_opt_anc_info(OptAncInfo* to, OptAncInfo* from) -{ - *to = *from; -} - -static void -concat_opt_anc_info(OptAncInfo* to, OptAncInfo* left, OptAncInfo* right, - OnigDistance left_len, OnigDistance right_len) -{ - clear_opt_anc_info(to); - - to->left_anchor = left->left_anchor; - if (left_len == 0) { - to->left_anchor |= right->left_anchor; - } - - to->right_anchor = right->right_anchor; - if (right_len == 0) { - to->right_anchor |= left->right_anchor; - } -} - -static int -is_left_anchor(int anc) -{ - if (anc == ANCHOR_END_BUF || anc == ANCHOR_SEMI_END_BUF || - anc == ANCHOR_END_LINE || anc == ANCHOR_PREC_READ || - anc == ANCHOR_PREC_READ_NOT) - return 0; - - return 1; -} - -static int -is_set_opt_anc_info(OptAncInfo* to, int anc) -{ - if ((to->left_anchor & anc) != 0) return 1; - - return ((to->right_anchor & anc) != 0 ? 1 : 0); -} - -static void -add_opt_anc_info(OptAncInfo* to, int anc) -{ - if (is_left_anchor(anc)) - to->left_anchor |= anc; - else - to->right_anchor |= anc; -} - -static void -remove_opt_anc_info(OptAncInfo* to, int anc) -{ - if (is_left_anchor(anc)) - to->left_anchor &= ~anc; - else - to->right_anchor &= ~anc; -} - -static void -alt_merge_opt_anc_info(OptAncInfo* to, OptAncInfo* add) -{ - to->left_anchor &= add->left_anchor; - to->right_anchor &= add->right_anchor; -} - -static int -is_full_opt_exact_info(OptExactInfo* ex) -{ - return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0); -} - -static void -clear_opt_exact_info(OptExactInfo* ex) -{ - clear_mml(&ex->mmd); - clear_opt_anc_info(&ex->anc); - ex->reach_end = 0; - ex->ignore_case = 0; - ex->len = 0; - ex->s[0] = '\0'; -} - -static void -copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from) -{ - *to = *from; -} - -static void -concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add) -{ - int i, n; - OptAncInfo tanc; - - if (! to->ignore_case && add->ignore_case) { - if (to->len >= add->len) return ; /* avoid */ - - to->ignore_case = 1; - } - - for (i = to->len, n = 0; n < add->len && i < OPT_EXACT_MAXLEN; i++, n++) - to->s[i] = add->s[n]; - - to->len = i; - to->reach_end = (n == add->len ? add->reach_end : 0); - - concat_opt_anc_info(&tanc, &to->anc, &add->anc, 1, 1); - if (! to->reach_end) tanc.right_anchor = 0; - copy_opt_anc_info(&to->anc, &tanc); -} - -static void -concat_opt_exact_info_str(OptExactInfo* to, - UChar* s, UChar* end, int raw, OnigEncoding enc) -{ - int i, j, len; - UChar *p; - - for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) { - if (raw) { - to->s[i++] = *p++; - } - else { - len = enc_len(enc, p); - if (i + len > OPT_EXACT_MAXLEN) break; - for (j = 0; j < len; j++) - to->s[i++] = *p++; - } - } - - to->len = i; -} - -static void -alt_merge_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OptEnv* env) -{ - int i, j, len; - - if (add->len == 0 || to->len == 0) { - clear_opt_exact_info(to); - return ; - } - - if (! is_equal_mml(&to->mmd, &add->mmd)) { - clear_opt_exact_info(to); - return ; - } - - for (i = 0; i < to->len && i < add->len; ) { - if (to->s[i] != add->s[i]) break; - len = enc_len(env->enc, to->s + i); - - for (j = 1; j < len; j++) { - if (to->s[i+j] != add->s[i+j]) break; - } - if (j < len) break; - i += len; - } - - if (! add->reach_end || i < add->len || i < to->len) { - to->reach_end = 0; - } - to->len = i; - to->ignore_case |= add->ignore_case; - - alt_merge_opt_anc_info(&to->anc, &add->anc); - if (! to->reach_end) to->anc.right_anchor = 0; -} - -static void -select_opt_exact_info(OnigEncoding enc, OptExactInfo* now, OptExactInfo* alt) -{ - int v1, v2; - - v1 = now->len; - v2 = alt->len; - - if (v1 <= 2 && v2 <= 2) { - /* ByteValTable[x] is big value --> low price */ - v2 = map_position_value(enc, now->s[0]); - v1 = map_position_value(enc, alt->s[0]); - - if (now->len > 1) v1 += 5; - if (alt->len > 1) v2 += 5; - } - - if (now->ignore_case == 0) v1 *= 2; - if (alt->ignore_case == 0) v2 *= 2; - - if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0) - copy_opt_exact_info(now, alt); -} - -static void -clear_opt_map_info(OptMapInfo* map) -{ - static OptMapInfo clean_info = { - {0, 0}, {0, 0}, 0, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - }; - - xmemcpy(map, &clean_info, sizeof(OptMapInfo)); -} - -static void -copy_opt_map_info(OptMapInfo* to, OptMapInfo* from) -{ - *to = *from; -} - -static void -add_char_opt_map_info(OptMapInfo* map, UChar c, OnigEncoding enc) -{ - if (map->map[c] == 0) { - map->map[c] = 1; - map->value += map_position_value(enc, c); - } -} - -static int -add_char_amb_opt_map_info(OptMapInfo* map, UChar* p, UChar* end, - OnigEncoding enc, OnigAmbigType ambig_flag) -{ - int i, j, n, len; - UChar buf[ONIGENC_MBC_NORMALIZE_MAXLEN]; - OnigCodePoint code, ccode; - OnigCompAmbigCodes* ccs; - OnigPairAmbigCodes* pccs; - OnigAmbigType amb; - - add_char_opt_map_info(map, p[0], enc); - code = ONIGENC_MBC_TO_CODE(enc, p, end); - - for (amb = 0x01; amb <= ONIGENC_AMBIGUOUS_MATCH_LIMIT; amb <<= 1) { - if ((amb & ambig_flag) == 0) continue; - - n = ONIGENC_GET_ALL_PAIR_AMBIG_CODES(enc, amb, &pccs); - for (i = 0; i < n; i++) { - if (pccs[i].from == code) { - len = ONIGENC_CODE_TO_MBC(enc, pccs[i].to, buf); - if (len < 0) return len; - add_char_opt_map_info(map, buf[0], enc); - } - } - - if ((ambig_flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - n = ONIGENC_GET_ALL_COMP_AMBIG_CODES(enc, amb, &ccs); - for (i = 0; i < n; i++) { - if (ccs[i].code == code) { - for (j = 0; j < ccs[i].n; j++) { - ccode = ccs[i].items[j].code[0]; - len = ONIGENC_CODE_TO_MBC(enc, ccode, buf); - if (len < 0) return len; - add_char_opt_map_info(map, buf[0], enc); - } - break; - } - } - } - } - return 0; -} - -static void -select_opt_map_info(OptMapInfo* now, OptMapInfo* alt) -{ - static int z = 1<<15; /* 32768: something big value */ - - int v1, v2; - - if (alt->value == 0) return ; - if (now->value == 0) { - copy_opt_map_info(now, alt); - return ; - } - - v1 = z / now->value; - v2 = z / alt->value; - if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0) - copy_opt_map_info(now, alt); -} - -static int -comp_opt_exact_or_map_info(OptExactInfo* e, OptMapInfo* m) -{ -#define COMP_EM_BASE 20 - int ve, vm; - - if (m->value <= 0) return -1; - - ve = COMP_EM_BASE * e->len * (e->ignore_case ? 1 : 2); - vm = COMP_EM_BASE * 5 * 2 / m->value; - return comp_distance_value(&e->mmd, &m->mmd, ve, vm); -} - -static void -alt_merge_opt_map_info(OnigEncoding enc, OptMapInfo* to, OptMapInfo* add) -{ - int i, val; - - /* if (! is_equal_mml(&to->mmd, &add->mmd)) return ; */ - if (to->value == 0) return ; - if (add->value == 0 || to->mmd.max < add->mmd.min) { - clear_opt_map_info(to); - return ; - } - - alt_merge_mml(&to->mmd, &add->mmd); - - val = 0; - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) { - if (add->map[i]) - to->map[i] = 1; - - if (to->map[i]) - val += map_position_value(enc, i); - } - to->value = val; - - alt_merge_opt_anc_info(&to->anc, &add->anc); -} - -static void -set_bound_node_opt_info(NodeOptInfo* opt, MinMaxLen* mmd) -{ - copy_mml(&(opt->exb.mmd), mmd); - copy_mml(&(opt->expr.mmd), mmd); - copy_mml(&(opt->map.mmd), mmd); -} - -static void -clear_node_opt_info(NodeOptInfo* opt) -{ - clear_mml(&opt->len); - clear_opt_anc_info(&opt->anc); - clear_opt_exact_info(&opt->exb); - clear_opt_exact_info(&opt->exm); - clear_opt_exact_info(&opt->expr); - clear_opt_map_info(&opt->map); -} - -static void -copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from) -{ - *to = *from; -} - -static void -concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add) -{ - int exb_reach, exm_reach; - OptAncInfo tanc; - - concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max); - copy_opt_anc_info(&to->anc, &tanc); - - if (add->exb.len > 0 && to->len.max == 0) { - concat_opt_anc_info(&tanc, &to->anc, &add->exb.anc, - to->len.max, add->len.max); - copy_opt_anc_info(&add->exb.anc, &tanc); - } - - if (add->map.value > 0 && to->len.max == 0) { - if (add->map.mmd.max == 0) - add->map.anc.left_anchor |= to->anc.left_anchor; - } - - exb_reach = to->exb.reach_end; - exm_reach = to->exm.reach_end; - - if (add->len.max != 0) - to->exb.reach_end = to->exm.reach_end = 0; - - if (add->exb.len > 0) { - if (exb_reach) { - concat_opt_exact_info(&to->exb, &add->exb); - clear_opt_exact_info(&add->exb); - } - else if (exm_reach) { - concat_opt_exact_info(&to->exm, &add->exb); - clear_opt_exact_info(&add->exb); - } - } - select_opt_exact_info(enc, &to->exm, &add->exb); - select_opt_exact_info(enc, &to->exm, &add->exm); - - if (to->expr.len > 0) { - if (add->len.max > 0) { - if (to->expr.len > (int )add->len.max) - to->expr.len = add->len.max; - - if (to->expr.mmd.max == 0) - select_opt_exact_info(enc, &to->exb, &to->expr); - else - select_opt_exact_info(enc, &to->exm, &to->expr); - } - } - else if (add->expr.len > 0) { - copy_opt_exact_info(&to->expr, &add->expr); - } - - select_opt_map_info(&to->map, &add->map); - - add_mml(&to->len, &add->len); -} - -static void -alt_merge_node_opt_info(NodeOptInfo* to, NodeOptInfo* add, OptEnv* env) -{ - alt_merge_opt_anc_info (&to->anc, &add->anc); - alt_merge_opt_exact_info(&to->exb, &add->exb, env); - alt_merge_opt_exact_info(&to->exm, &add->exm, env); - alt_merge_opt_exact_info(&to->expr, &add->expr, env); - alt_merge_opt_map_info(env->enc, &to->map, &add->map); - - alt_merge_mml(&to->len, &add->len); -} - - -#define MAX_NODE_OPT_INFO_REF_COUNT 5 - -static int -optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) -{ - int type; - int r = 0; - - clear_node_opt_info(opt); - set_bound_node_opt_info(opt, &env->mmd); - - type = NTYPE(node); - switch (type) { - case N_LIST: - { - OptEnv nenv; - NodeOptInfo nopt; - Node* nd = node; - - copy_opt_env(&nenv, env); - do { - r = optimize_node_left(NCONS(nd).left, &nopt, &nenv); - if (r == 0) { - add_mml(&nenv.mmd, &nopt.len); - concat_left_node_opt_info(env->enc, opt, &nopt); - } - } while (r == 0 && IS_NOT_NULL(nd = NCONS(nd).right)); - } - break; - - case N_ALT: - { - NodeOptInfo nopt; - Node* nd = node; - - do { - r = optimize_node_left(NCONS(nd).left, &nopt, env); - if (r == 0) { - if (nd == node) copy_node_opt_info(opt, &nopt); - else alt_merge_node_opt_info(opt, &nopt, env); - } - } while ((r == 0) && IS_NOT_NULL(nd = NCONS(nd).right)); - } - break; - - case N_STRING: - { - StrNode* sn = &(NSTRING(node)); - int slen = sn->end - sn->s; - int is_raw = NSTRING_IS_RAW(node); - - if (! NSTRING_IS_AMBIG(node)) { - concat_opt_exact_info_str(&opt->exb, sn->s, sn->end, - NSTRING_IS_RAW(node), env->enc); - if (slen > 0) { - add_char_opt_map_info(&opt->map, *(sn->s), env->enc); - } - set_mml(&opt->len, slen, slen); - } - else { - int n, max; - - concat_opt_exact_info_str(&opt->exb, sn->s, sn->end, - is_raw, env->enc); - opt->exb.ignore_case = 1; - - if (slen > 0) { - r = add_char_amb_opt_map_info(&opt->map, sn->s, sn->end, - env->enc, env->ambig_flag); - if (r != 0) break; - } - - if (NSTRING_IS_AMBIG_REDUCE(node)) { - n = onigenc_strlen(env->enc, sn->s, sn->end); - max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n; - } - else { - max = slen; - } - set_mml(&opt->len, slen, max); - } - - if (opt->exb.len == slen) - opt->exb.reach_end = 1; - } - break; - - case N_CCLASS: - { - int i, z; - CClassNode* cc = &(NCCLASS(node)); - - /* no need to check ignore case. (setted in setup_tree()) */ - - if (IS_NOT_NULL(cc->mbuf) || IS_CCLASS_NOT(cc)) { - OnigDistance min = ONIGENC_MBC_MINLEN(env->enc); - OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc); - - set_mml(&opt->len, min, max); - } - else { - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - z = BITSET_AT(cc->bs, i); - if ((z && !IS_CCLASS_NOT(cc)) || (!z && IS_CCLASS_NOT(cc))) { - add_char_opt_map_info(&opt->map, (UChar )i, env->enc); - } - } - set_mml(&opt->len, 1, 1); - } - } - break; - - case N_CTYPE: - { - int i, min, max; - - max = ONIGENC_MBC_MAXLEN_DIST(env->enc); - - if (max == 1) { - min = 1; - - switch (NCTYPE(node).type) { - case CTYPE_NOT_WORD: - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - if (! ONIGENC_IS_CODE_WORD(env->enc, i)) { - add_char_opt_map_info(&opt->map, (UChar )i, env->enc); - } - } - break; - - case CTYPE_WORD: - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - if (ONIGENC_IS_CODE_WORD(env->enc, i)) { - add_char_opt_map_info(&opt->map, (UChar )i, env->enc); - } - } - break; - } - } - else { - min = ONIGENC_MBC_MINLEN(env->enc); - } - set_mml(&opt->len, min, max); - } - break; - - case N_ANYCHAR: - { - OnigDistance min = ONIGENC_MBC_MINLEN(env->enc); - OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc); - set_mml(&opt->len, min, max); - } - break; - - case N_ANCHOR: - switch (NANCHOR(node).type) { - case ANCHOR_BEGIN_BUF: - case ANCHOR_BEGIN_POSITION: - case ANCHOR_BEGIN_LINE: - case ANCHOR_END_BUF: - case ANCHOR_SEMI_END_BUF: - case ANCHOR_END_LINE: - add_opt_anc_info(&opt->anc, NANCHOR(node).type); - break; - - case ANCHOR_PREC_READ: - { - NodeOptInfo nopt; - - r = optimize_node_left(NANCHOR(node).target, &nopt, env); - if (r == 0) { - if (nopt.exb.len > 0) - copy_opt_exact_info(&opt->expr, &nopt.exb); - else if (nopt.exm.len > 0) - copy_opt_exact_info(&opt->expr, &nopt.exm); - - opt->expr.reach_end = 0; - - if (nopt.map.value > 0) - copy_opt_map_info(&opt->map, &nopt.map); - } - } - break; - - case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: /* Sorry, I can't make use of it. */ - case ANCHOR_LOOK_BEHIND_NOT: - break; - } - break; - - case N_BACKREF: - { - int i; - int* backs; - OnigDistance min, max, tmin, tmax; - Node** nodes = SCANENV_MEM_NODES(env->scan_env); - BackrefNode* br = &(NBACKREF(node)); - - if (br->state & NST_RECURSION) { - set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE); - break; - } - backs = BACKREFS_P(br); - r = get_min_match_length(nodes[backs[0]], &min, env->scan_env); - if (r != 0) break; - r = get_max_match_length(nodes[backs[0]], &max, env->scan_env); - if (r != 0) break; - for (i = 1; i < br->back_num; i++) { - r = get_min_match_length(nodes[backs[i]], &tmin, env->scan_env); - if (r != 0) break; - r = get_max_match_length(nodes[backs[i]], &tmax, env->scan_env); - if (r != 0) break; - if (min > tmin) min = tmin; - if (max < tmax) max = tmax; - } - if (r == 0) set_mml(&opt->len, min, max); - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - if (IS_CALL_RECURSION(&(NCALL(node)))) - set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE); - else { - OnigOptionType save = env->options; - env->options = NEFFECT(NCALL(node).target).option; - r = optimize_node_left(NCALL(node).target, opt, env); - env->options = save; - } - break; -#endif - - case N_QUALIFIER: - { - int i; - OnigDistance min, max; - NodeOptInfo nopt; - QualifierNode* qn = &(NQUALIFIER(node)); - - r = optimize_node_left(qn->target, &nopt, env); - if (r) break; - - if (qn->lower == 0 && IS_REPEAT_INFINITE(qn->upper)) { - if (env->mmd.max == 0 && - NTYPE(qn->target) == N_ANYCHAR && qn->greedy) { - if (IS_POSIXLINE(env->options)) - add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_PL); - else - add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR); - } - } - else { - if (qn->lower > 0) { - copy_node_opt_info(opt, &nopt); - if (nopt.exb.len > 0) { - if (nopt.exb.reach_end) { - for (i = 2; i < qn->lower && - ! is_full_opt_exact_info(&opt->exb); i++) { - concat_opt_exact_info(&opt->exb, &nopt.exb); - } - if (i < qn->lower) { - opt->exb.reach_end = 0; - } - } - } - - if (qn->lower != qn->upper) { - opt->exb.reach_end = 0; - opt->exm.reach_end = 0; - } - if (qn->lower > 1) - opt->exm.reach_end = 0; - } - } - - min = distance_multiply(nopt.len.min, qn->lower); - if (IS_REPEAT_INFINITE(qn->upper)) - max = (nopt.len.max > 0 ? ONIG_INFINITE_DISTANCE : 0); - else - max = distance_multiply(nopt.len.max, qn->upper); - - set_mml(&opt->len, min, max); - } - break; - - case N_EFFECT: - { - EffectNode* en = &(NEFFECT(node)); - - switch (en->type) { - case EFFECT_OPTION: - { - OnigOptionType save = env->options; - - env->options = en->option; - r = optimize_node_left(en->target, opt, env); - env->options = save; - } - break; - - case EFFECT_MEMORY: -#ifdef USE_SUBEXP_CALL - en->opt_count++; - if (en->opt_count > MAX_NODE_OPT_INFO_REF_COUNT) { - OnigDistance min, max; - - min = 0; - max = ONIG_INFINITE_DISTANCE; - if (IS_EFFECT_MIN_FIXED(en)) min = en->min_len; - if (IS_EFFECT_MAX_FIXED(en)) max = en->max_len; - set_mml(&opt->len, min, max); - } - else -#endif - { - r = optimize_node_left(en->target, opt, env); - - if (is_set_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK)) { - if (BIT_STATUS_AT(env->scan_env->backrefed_mem, en->regnum)) - remove_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK); - } - } - break; - - case EFFECT_STOP_BACKTRACK: - r = optimize_node_left(en->target, opt, env); - break; - } - } - break; - - default: -#ifdef ONIG_DEBUG - fprintf(stderr, "optimize_node_left: undefined node type %d\n", - NTYPE(node)); -#endif - r = ONIGERR_TYPE_BUG; - break; - } - - return r; -} - -static int -set_optimize_exact_info(regex_t* reg, OptExactInfo* e) -{ - int r; - - if (e->len == 0) return 0; - - if (e->ignore_case) { - reg->exact = (UChar* )xmalloc(e->len); - CHECK_NULL_RETURN_VAL(reg->exact, ONIGERR_MEMORY); - xmemcpy(reg->exact, e->s, e->len); - reg->exact_end = reg->exact + e->len; - reg->optimize = ONIG_OPTIMIZE_EXACT_IC; - } - else { - int allow_reverse; - - reg->exact = k_strdup(e->s, e->s + e->len); - CHECK_NULL_RETURN_VAL(reg->exact, ONIGERR_MEMORY); - reg->exact_end = reg->exact + e->len; - - if (e->anc.left_anchor & ANCHOR_BEGIN_LINE) - allow_reverse = 1; - else - allow_reverse = - ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end); - - if (e->len >= 3 || (e->len >= 2 && allow_reverse)) { - r = set_bm_skip(reg->exact, reg->exact_end, reg->enc, - reg->map, &(reg->int_map)); - if (r) return r; - - reg->optimize = (allow_reverse != 0 - ? ONIG_OPTIMIZE_EXACT_BM : ONIG_OPTIMIZE_EXACT_BM_NOT_REV); - } - else { - reg->optimize = ONIG_OPTIMIZE_EXACT; - } - } - - reg->dmin = e->mmd.min; - reg->dmax = e->mmd.max; - - if (reg->dmin != ONIG_INFINITE_DISTANCE) { - reg->threshold_len = reg->dmin + (reg->exact_end - reg->exact); - } - - return 0; -} - -static void -set_optimize_map_info(regex_t* reg, OptMapInfo* m) -{ - int i; - - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) - reg->map[i] = m->map[i]; - - reg->optimize = ONIG_OPTIMIZE_MAP; - reg->dmin = m->mmd.min; - reg->dmax = m->mmd.max; - - if (reg->dmin != ONIG_INFINITE_DISTANCE) { - reg->threshold_len = reg->dmin + 1; - } -} - -static void -set_sub_anchor(regex_t* reg, OptAncInfo* anc) -{ - reg->sub_anchor |= anc->left_anchor & ANCHOR_BEGIN_LINE; - reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE; -} - -#ifdef ONIG_DEBUG -static void print_optimize_info(FILE* f, regex_t* reg); -#endif - -static int -set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env) -{ - - int r; - NodeOptInfo opt; - OptEnv env; - - env.enc = reg->enc; - env.options = reg->options; - env.ambig_flag = reg->ambig_flag; - env.scan_env = scan_env; - clear_mml(&env.mmd); - - r = optimize_node_left(node, &opt, &env); - if (r) return r; - - reg->anchor = opt.anc.left_anchor & (ANCHOR_BEGIN_BUF | - ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_PL); - - reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF); - - if (reg->anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)) { - reg->anchor_dmin = opt.len.min; - reg->anchor_dmax = opt.len.max; - } - - if (opt.exb.len > 0 || opt.exm.len > 0) { - select_opt_exact_info(reg->enc, &opt.exb, &opt.exm); - if (opt.map.value > 0 && - comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) { - goto set_map; - } - else { - r = set_optimize_exact_info(reg, &opt.exb); - set_sub_anchor(reg, &opt.exb.anc); - } - } - else if (opt.map.value > 0) { - set_map: - set_optimize_map_info(reg, &opt.map); - set_sub_anchor(reg, &opt.map.anc); - } - else { - reg->sub_anchor |= opt.anc.left_anchor & ANCHOR_BEGIN_LINE; - if (opt.len.max == 0) - reg->sub_anchor |= opt.anc.right_anchor & ANCHOR_END_LINE; - } - -#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH) - print_optimize_info(stderr, reg); -#endif - return r; -} - -static void -clear_optimize_info(regex_t* reg) -{ - reg->optimize = ONIG_OPTIMIZE_NONE; - reg->anchor = 0; - reg->anchor_dmin = 0; - reg->anchor_dmax = 0; - reg->sub_anchor = 0; - reg->exact_end = (UChar* )NULL; - reg->threshold_len = 0; - if (IS_NOT_NULL(reg->exact)) { - xfree(reg->exact); - reg->exact = (UChar* )NULL; - } -} - -#ifdef ONIG_DEBUG - -static void -print_distance_range(FILE* f, OnigDistance a, OnigDistance b) -{ - if (a == ONIG_INFINITE_DISTANCE) - fputs("inf", f); - else - fprintf(f, "(%u)", a); - - fputs("-", f); - - if (b == ONIG_INFINITE_DISTANCE) - fputs("inf", f); - else - fprintf(f, "(%u)", b); -} - -static void -print_anchor(FILE* f, int anchor) -{ - int q = 0; - - fprintf(f, "["); - - if (anchor & ANCHOR_BEGIN_BUF) { - fprintf(f, "begin-buf"); - q = 1; - } - if (anchor & ANCHOR_BEGIN_LINE) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "begin-line"); - } - if (anchor & ANCHOR_BEGIN_POSITION) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "begin-pos"); - } - if (anchor & ANCHOR_END_BUF) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "end-buf"); - } - if (anchor & ANCHOR_SEMI_END_BUF) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "semi-end-buf"); - } - if (anchor & ANCHOR_END_LINE) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "end-line"); - } - if (anchor & ANCHOR_ANYCHAR_STAR) { - if (q) fprintf(f, ", "); - q = 1; - fprintf(f, "anychar-star"); - } - if (anchor & ANCHOR_ANYCHAR_STAR_PL) { - if (q) fprintf(f, ", "); - fprintf(f, "anychar-star-pl"); - } - - fprintf(f, "]"); -} - -static void -print_optimize_info(FILE* f, regex_t* reg) -{ - static char* on[] = { "NONE", "EXACT", "EXACT_BM", "EXACT_BM_NOT_REV", - "EXACT_IC", "MAP" }; - - fprintf(f, "optimize: %s\n", on[reg->optimize]); - fprintf(f, " anchor: "); print_anchor(f, reg->anchor); - if ((reg->anchor & ANCHOR_END_BUF_MASK) != 0) - print_distance_range(f, reg->anchor_dmin, reg->anchor_dmax); - fprintf(f, "\n"); - - if (reg->optimize) { - fprintf(f, " sub anchor: "); print_anchor(f, reg->sub_anchor); - fprintf(f, "\n"); - } - fprintf(f, "\n"); - - if (reg->exact) { - UChar *p; - fprintf(f, "exact: ["); - for (p = reg->exact; p < reg->exact_end; p++) { - fputc(*p, f); - } - fprintf(f, "]: length: %d\n", (reg->exact_end - reg->exact)); - } - else if (reg->optimize & ONIG_OPTIMIZE_MAP) { - int c, i, n = 0; - - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) - if (reg->map[i]) n++; - - fprintf(f, "map: n=%d\n", n); - if (n > 0) { - c = 0; - fputc('[', f); - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) { - if (reg->map[i] != 0) { - if (c > 0) fputs(", ", f); - c++; - if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 && - ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint )i)) - fputc(i, f); - else - fprintf(f, "%d", i); - } - } - fprintf(f, "]\n"); - } - } -} -#endif /* ONIG_DEBUG */ - - -static void -onig_free_body(regex_t* reg) -{ - if (IS_NOT_NULL(reg->p)) xfree(reg->p); - if (IS_NOT_NULL(reg->exact)) xfree(reg->exact); - if (IS_NOT_NULL(reg->int_map)) xfree(reg->int_map); - if (IS_NOT_NULL(reg->int_map_backward)) xfree(reg->int_map_backward); - if (IS_NOT_NULL(reg->repeat_range)) xfree(reg->repeat_range); - if (IS_NOT_NULL(reg->chain)) onig_free(reg->chain); - -#ifdef USE_NAMED_GROUP - onig_names_free(reg); -#endif -} - -extern void -onig_free(regex_t* reg) -{ - if (IS_NOT_NULL(reg)) { - onig_free_body(reg); - xfree(reg); - } -} - -#define REGEX_TRANSFER(to,from) do {\ - (to)->state = ONIG_STATE_MODIFY;\ - onig_free_body(to);\ - xmemcpy(to, from, sizeof(regex_t));\ - xfree(from);\ -} while (0) - -extern void -onig_transfer(regex_t* to, regex_t* from) -{ - THREAD_ATOMIC_START; - REGEX_TRANSFER(to, from); - THREAD_ATOMIC_END; -} - -#define REGEX_CHAIN_HEAD(reg) do {\ - while (IS_NOT_NULL((reg)->chain)) {\ - (reg) = (reg)->chain;\ - }\ -} while (0) - -extern void -onig_chain_link_add(regex_t* to, regex_t* add) -{ - THREAD_ATOMIC_START; - REGEX_CHAIN_HEAD(to); - to->chain = add; - THREAD_ATOMIC_END; -} - -extern void -onig_chain_reduce(regex_t* reg) -{ - regex_t *head, *prev; - - THREAD_ATOMIC_START; - prev = reg; - head = prev->chain; - if (IS_NOT_NULL(head)) { - reg->state = ONIG_STATE_MODIFY; - while (IS_NOT_NULL(head->chain)) { - prev = head; - head = head->chain; - } - prev->chain = (regex_t* )NULL; - REGEX_TRANSFER(reg, head); - } - THREAD_ATOMIC_END; -} - -#if 0 -extern int -onig_clone(regex_t** to, regex_t* from) -{ - int r, size; - regex_t* reg; - -#ifdef USE_MULTI_THREAD_SYSTEM - if (ONIG_STATE(from) >= ONIG_STATE_NORMAL) { - ONIG_STATE_INC(from); - if (IS_NOT_NULL(from->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) { - onig_chain_reduce(from); - ONIG_STATE_INC(from); - } - } - else { - int n = 0; - while (ONIG_STATE(from) < ONIG_STATE_NORMAL) { - if (++n > THREAD_PASS_LIMIT_COUNT) - return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT; - THREAD_PASS; - } - ONIG_STATE_INC(from); - } -#endif /* USE_MULTI_THREAD_SYSTEM */ - - r = onig_alloc_init(®, ONIG_OPTION_NONE, ONIGENC_AMBIGUOUS_MATCH_DEFAULT, - from->enc, ONIG_SYNTAX_DEFAULT); - if (r != 0) { - ONIG_STATE_DEC(from); - return r; - } - - xmemcpy(reg, from, sizeof(onig_t)); - reg->chain = (regex_t* )NULL; - reg->state = ONIG_STATE_NORMAL; - - if (from->p) { - reg->p = (UChar* )xmalloc(reg->alloc); - if (IS_NULL(reg->p)) goto mem_error; - xmemcpy(reg->p, from->p, reg->alloc); - } - - if (from->exact) { - reg->exact = (UChar* )xmalloc(from->exact_end - from->exact); - if (IS_NULL(reg->exact)) goto mem_error; - reg->exact_end = reg->exact + (from->exact_end - from->exact); - xmemcpy(reg->exact, from->exact, reg->exact_end - reg->exact); - } - - if (from->int_map) { - size = sizeof(int) * ONIG_CHAR_TABLE_SIZE; - reg->int_map = (int* )xmalloc(size); - if (IS_NULL(reg->int_map)) goto mem_error; - xmemcpy(reg->int_map, from->int_map, size); - } - - if (from->int_map_backward) { - size = sizeof(int) * ONIG_CHAR_TABLE_SIZE; - reg->int_map_backward = (int* )xmalloc(size); - if (IS_NULL(reg->int_map_backward)) goto mem_error; - xmemcpy(reg->int_map_backward, from->int_map_backward, size); - } - -#ifdef USE_NAMED_GROUP - reg->name_table = names_clone(from); /* names_clone is not implemented */ -#endif - - ONIG_STATE_DEC(from); - *to = reg; - return 0; - - mem_error: - ONIG_STATE_DEC(from); - return ONIGERR_MEMORY; -} -#endif - -#ifdef ONIG_DEBUG -static void print_compiled_byte_code_list P_((FILE* f, regex_t* reg)); -#endif -#ifdef ONIG_DEBUG_PARSE_TREE -static void print_tree P_((FILE* f, Node* node)); -#endif - -extern int -onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, - OnigErrorInfo* einfo) -{ -#define COMPILE_INIT_SIZE 20 - - int r, init_size; - Node* root; - ScanEnv scan_env; -#ifdef USE_SUBEXP_CALL - UnsetAddrList uslist; -#endif - - reg->state = ONIG_STATE_COMPILING; - - if (reg->alloc == 0) { - init_size = (pattern_end - pattern) * 2; - if (init_size <= 0) init_size = COMPILE_INIT_SIZE; - r = BBUF_INIT(reg, init_size); - if (r != 0) goto end; - } - else - reg->used = 0; - - reg->num_mem = 0; - reg->num_repeat = 0; - reg->num_null_check = 0; - reg->repeat_range_alloc = 0; - reg->repeat_range = (OnigRepeatRange* )NULL; - - r = onig_parse_make_tree(&root, pattern, pattern_end, reg, &scan_env); - if (r != 0) goto err; - -#ifdef USE_NAMED_GROUP - /* mixed use named group and no-named group */ - if (scan_env.num_named > 0 && - IS_SYNTAX_BV(scan_env.syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) && - !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) { - if (scan_env.num_named != scan_env.num_mem) - r = disable_noname_group_capture(&root, reg, &scan_env); - else - r = numbered_ref_check(root); - - if (r != 0) goto err; - } -#endif - -#ifdef ONIG_DEBUG_PARSE_TREE - print_tree(stderr, root); -#endif - -#ifdef USE_SUBEXP_CALL - if (scan_env.num_call > 0) { - r = unset_addr_list_init(&uslist, scan_env.num_call); - if (r != 0) goto err; - scan_env.unset_addr_list = &uslist; - r = setup_subexp_call(root, &scan_env); - if (r != 0) goto err_unset; - r = subexp_recursive_check_trav(root, &scan_env); - if (r < 0) goto err_unset; - r = subexp_inf_recursive_check_trav(root, &scan_env); - if (r != 0) goto err_unset; - - reg->num_call = scan_env.num_call; - } - else - reg->num_call = 0; -#endif - - r = setup_tree(root, reg, 0, &scan_env); - if (r != 0) goto err_unset; - - reg->capture_history = scan_env.capture_history; - reg->bt_mem_start = scan_env.bt_mem_start; - reg->bt_mem_start |= reg->capture_history; - if (IS_FIND_CONDITION(reg->options)) - BIT_STATUS_ON_ALL(reg->bt_mem_end); - else { - reg->bt_mem_end = scan_env.bt_mem_end; - reg->bt_mem_end |= reg->capture_history; - } - - clear_optimize_info(reg); -#ifndef ONIG_DONT_OPTIMIZE - r = set_optimize_info_from_tree(root, reg, &scan_env); - if (r != 0) goto err_unset; -#endif - - if (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) { - xfree(scan_env.mem_nodes_dynamic); - scan_env.mem_nodes_dynamic = (Node** )NULL; - } - - r = compile_tree(root, reg); - if (r == 0) { - r = add_opcode(reg, OP_END); -#ifdef USE_SUBEXP_CALL - if (scan_env.num_call > 0) { - r = unset_addr_list_fix(&uslist, reg); - unset_addr_list_end(&uslist); - if (r) goto err; - } -#endif - - if ((reg->num_repeat != 0) || (reg->bt_mem_end != 0)) - reg->stack_pop_level = STACK_POP_LEVEL_ALL; - else { - if (reg->bt_mem_start != 0) - reg->stack_pop_level = STACK_POP_LEVEL_MEM_START; - else - reg->stack_pop_level = STACK_POP_LEVEL_FREE; - } - } -#ifdef USE_SUBEXP_CALL - else if (scan_env.num_call > 0) { - unset_addr_list_end(&uslist); - } -#endif - onig_node_free(root); - -#ifdef ONIG_DEBUG_COMPILE -#ifdef USE_NAMED_GROUP - onig_print_names(stderr, reg); -#endif - print_compiled_byte_code_list(stderr, reg); -#endif - - end: - reg->state = ONIG_STATE_NORMAL; - return r; - - err_unset: -#ifdef USE_SUBEXP_CALL - if (scan_env.num_call > 0) { - unset_addr_list_end(&uslist); - } -#endif - err: - if (IS_NOT_NULL(scan_env.error)) { - if (IS_NOT_NULL(einfo)) { - einfo->par = scan_env.error; - einfo->par_end = scan_env.error_end; - } - } - - if (IS_NOT_NULL(root)) onig_node_free(root); - if (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) - xfree(scan_env.mem_nodes_dynamic); - return r; -} - -extern int -onig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, - OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, - OnigErrorInfo* einfo) -{ - int r; - regex_t *new_reg; - - r = onig_new(&new_reg, pattern, pattern_end, option, enc, syntax, einfo); - if (r) return r; - if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) { - onig_transfer(reg, new_reg); - } - else { - onig_chain_link_add(reg, new_reg); - } - return 0; -} - -static int onig_inited = 0; - -extern int -onig_alloc_init(regex_t** reg, OnigOptionType option, OnigAmbigType ambig_flag, - OnigEncoding enc, OnigSyntaxType* syntax) -{ - if (! onig_inited) - onig_init(); - - if (ONIGENC_IS_UNDEF(enc)) - return ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED; - - *reg = (regex_t* )xmalloc(sizeof(regex_t)); - if (IS_NULL(*reg)) return ONIGERR_MEMORY; - (*reg)->state = ONIG_STATE_MODIFY; - - if ((option & ONIG_OPTION_NEGATE_SINGLELINE) != 0) { - option |= syntax->options; - option &= ~ONIG_OPTION_SINGLELINE; - } - else - option |= syntax->options; - - (*reg)->enc = enc; - (*reg)->options = option; - (*reg)->syntax = syntax; - (*reg)->optimize = 0; - (*reg)->exact = (UChar* )NULL; - (*reg)->int_map = (int* )NULL; - (*reg)->int_map_backward = (int* )NULL; - (*reg)->chain = (regex_t* )NULL; - - (*reg)->p = (UChar* )NULL; - (*reg)->alloc = 0; - (*reg)->used = 0; - (*reg)->name_table = (void* )NULL; - - (*reg)->ambig_flag = ambig_flag; - (*reg)->ambig_flag &= ONIGENC_SUPPORT_AMBIG_FLAG(enc); - - return 0; -} - -extern int -onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end, - OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, - OnigErrorInfo* einfo) -{ - int r; - - if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL; - - r = onig_alloc_init(reg, option, ONIGENC_AMBIGUOUS_MATCH_DEFAULT, - enc, syntax); - if (r) return r; - - r = onig_compile(*reg, pattern, pattern_end, einfo); - if (r) { - onig_free(*reg); - *reg = NULL; - } - return r; -} - -extern int -onig_init() -{ - if (onig_inited != 0) - return 0; - - onig_inited = 1; - - THREAD_ATOMIC_START; - - onigenc_init(); - onigenc_set_default_caseconv_table((UChar* )0); - -#ifdef ONIG_DEBUG_STATISTICS - onig_statistics_init(); -#endif - - THREAD_ATOMIC_END; - return 0; -} - - -extern int -onig_end() -{ - extern int onig_free_shared_cclass_table(); - - THREAD_ATOMIC_START; - -#ifdef ONIG_DEBUG_STATISTICS - onig_print_statistics(stderr); -#endif - -#ifdef USE_RECYCLE_NODE - onig_free_node_list(); -#endif - -#ifdef USE_SHARED_CCLASS_TABLE - onig_free_shared_cclass_table(); -#endif - - onig_inited = 0; - - THREAD_ATOMIC_END; - return 0; -} - - -#ifdef ONIG_DEBUG - -OnigOpInfoType OnigOpInfo[] = { - { OP_FINISH, "finish", ARG_NON }, - { OP_END, "end", ARG_NON }, - { OP_EXACT1, "exact1", ARG_SPECIAL }, - { OP_EXACT2, "exact2", ARG_SPECIAL }, - { OP_EXACT3, "exact3", ARG_SPECIAL }, - { OP_EXACT4, "exact4", ARG_SPECIAL }, - { OP_EXACT5, "exact5", ARG_SPECIAL }, - { OP_EXACTN, "exactn", ARG_SPECIAL }, - { OP_EXACTMB2N1, "exactmb2-n1", ARG_SPECIAL }, - { OP_EXACTMB2N2, "exactmb2-n2", ARG_SPECIAL }, - { OP_EXACTMB2N3, "exactmb2-n3", ARG_SPECIAL }, - { OP_EXACTMB2N, "exactmb2-n", ARG_SPECIAL }, - { OP_EXACTMB3N, "exactmb3n" , ARG_SPECIAL }, - { OP_EXACTMBN, "exactmbn", ARG_SPECIAL }, - { OP_EXACT1_IC, "exact1-ic", ARG_SPECIAL }, - { OP_EXACTN_IC, "exactn-ic", ARG_SPECIAL }, - { OP_CCLASS, "cclass", ARG_SPECIAL }, - { OP_CCLASS_MB, "cclass-mb", ARG_SPECIAL }, - { OP_CCLASS_MIX, "cclass-mix", ARG_SPECIAL }, - { OP_CCLASS_NOT, "cclass-not", ARG_SPECIAL }, - { OP_CCLASS_MB_NOT, "cclass-mb-not", ARG_SPECIAL }, - { OP_CCLASS_MIX_NOT, "cclass-mix-not", ARG_SPECIAL }, - { OP_CCLASS_NODE, "cclass-node", ARG_SPECIAL }, - { OP_ANYCHAR, "anychar", ARG_NON }, - { OP_ANYCHAR_ML, "anychar-ml", ARG_NON }, - { OP_ANYCHAR_STAR, "anychar*", ARG_NON }, - { OP_ANYCHAR_ML_STAR, "anychar-ml*", ARG_NON }, - { OP_ANYCHAR_STAR_PEEK_NEXT, "anychar*-peek-next", ARG_SPECIAL }, - { OP_ANYCHAR_ML_STAR_PEEK_NEXT, "anychar-ml*-peek-next", ARG_SPECIAL }, - { OP_WORD, "word", ARG_NON }, - { OP_NOT_WORD, "not-word", ARG_NON }, - { OP_WORD_SB, "word-sb", ARG_NON }, - { OP_WORD_MB, "word-mb", ARG_NON }, - { OP_WORD_BOUND, "word-bound", ARG_NON }, - { OP_NOT_WORD_BOUND, "not-word-bound", ARG_NON }, - { OP_WORD_BEGIN, "word-begin", ARG_NON }, - { OP_WORD_END, "word-end", ARG_NON }, - { OP_BEGIN_BUF, "begin-buf", ARG_NON }, - { OP_END_BUF, "end-buf", ARG_NON }, - { OP_BEGIN_LINE, "begin-line", ARG_NON }, - { OP_END_LINE, "end-line", ARG_NON }, - { OP_SEMI_END_BUF, "semi-end-buf", ARG_NON }, - { OP_BEGIN_POSITION, "begin-position", ARG_NON }, - { OP_BACKREF1, "backref1", ARG_NON }, - { OP_BACKREF2, "backref2", ARG_NON }, - { OP_BACKREF3, "backref3", ARG_NON }, - { OP_BACKREFN, "backrefn", ARG_MEMNUM }, - { OP_BACKREFN_IC, "backrefn-ic", ARG_SPECIAL }, - { OP_BACKREF_MULTI, "backref_multi", ARG_SPECIAL }, - { OP_BACKREF_MULTI_IC, "backref_multi-ic",ARG_SPECIAL }, - { OP_MEMORY_START_PUSH, "mem-start-push", ARG_MEMNUM }, - { OP_MEMORY_START, "mem-start", ARG_MEMNUM }, - { OP_MEMORY_END_PUSH, "mem-end-push", ARG_MEMNUM }, - { OP_MEMORY_END_PUSH_REC, "mem-end-push-rec", ARG_MEMNUM }, - { OP_MEMORY_END, "mem-end", ARG_MEMNUM }, - { OP_MEMORY_END_REC, "mem-end-rec", ARG_MEMNUM }, - { OP_SET_OPTION_PUSH, "set-option-push", ARG_OPTION }, - { OP_SET_OPTION, "set-option", ARG_OPTION }, - { OP_FAIL, "fail", ARG_NON }, - { OP_JUMP, "jump", ARG_RELADDR }, - { OP_PUSH, "push", ARG_RELADDR }, - { OP_POP, "pop", ARG_NON }, - { OP_PUSH_OR_JUMP_EXACT1, "push-or-jump-e1", ARG_SPECIAL }, - { OP_PUSH_IF_PEEK_NEXT, "push-if-peek-next", ARG_SPECIAL }, - { OP_REPEAT, "repeat", ARG_SPECIAL }, - { OP_REPEAT_NG, "repeat-ng", ARG_SPECIAL }, - { OP_REPEAT_INC, "repeat-inc", ARG_MEMNUM }, - { OP_REPEAT_INC_NG, "repeat-inc-ng", ARG_MEMNUM }, - { OP_REPEAT_INC_SG, "repeat-inc-sg", ARG_MEMNUM }, - { OP_REPEAT_INC_NG_SG, "repeat-inc-ng-sg", ARG_MEMNUM }, - { OP_NULL_CHECK_START, "null-check-start",ARG_MEMNUM }, - { OP_NULL_CHECK_END, "null-check-end", ARG_MEMNUM }, - { OP_NULL_CHECK_END_MEMST,"null-check-end-memst", ARG_MEMNUM }, - { OP_NULL_CHECK_END_MEMST_PUSH,"null-check-end-memst-push", ARG_MEMNUM }, - { OP_PUSH_POS, "push-pos", ARG_NON }, - { OP_POP_POS, "pop-pos", ARG_NON }, - { OP_PUSH_POS_NOT, "push-pos-not", ARG_RELADDR }, - { OP_FAIL_POS, "fail-pos", ARG_NON }, - { OP_PUSH_STOP_BT, "push-stop-bt", ARG_NON }, - { OP_POP_STOP_BT, "pop-stop-bt", ARG_NON }, - { OP_LOOK_BEHIND, "look-behind", ARG_SPECIAL }, - { OP_PUSH_LOOK_BEHIND_NOT, "push-look-behind-not", ARG_SPECIAL }, - { OP_FAIL_LOOK_BEHIND_NOT, "fail-look-behind-not", ARG_NON }, - { OP_CALL, "call", ARG_ABSADDR }, - { OP_RETURN, "return", ARG_NON }, - { -1, "", ARG_NON } -}; - -static char* -op2name(int opcode) -{ - int i; - - for (i = 0; OnigOpInfo[i].opcode >= 0; i++) { - if (opcode == OnigOpInfo[i].opcode) - return OnigOpInfo[i].name; - } - return ""; -} - -static int -op2arg_type(int opcode) -{ - int i; - - for (i = 0; OnigOpInfo[i].opcode >= 0; i++) { - if (opcode == OnigOpInfo[i].opcode) - return OnigOpInfo[i].arg_type; - } - return ARG_SPECIAL; -} - -static void -Indent(FILE* f, int indent) -{ - int i; - for (i = 0; i < indent; i++) putc(' ', f); -} - -static void -p_string(FILE* f, int len, UChar* s) -{ - fputs(":", f); - while (len-- > 0) { fputc(*s++, f); } -} - -static void -p_len_string(FILE* f, LengthType len, int mb_len, UChar* s) -{ - int x = len * mb_len; - - fprintf(f, ":%d:", len); - while (x-- > 0) { fputc(*s++, f); } -} - -extern void -onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp, - OnigEncoding enc) -{ - int i, n, arg_type; - RelAddrType addr; - LengthType len; - MemNumType mem; - OnigCodePoint code; - UChar *q; - - fprintf(f, "[%s", op2name(*bp)); - arg_type = op2arg_type(*bp); - if (arg_type != ARG_SPECIAL) { - bp++; - switch (arg_type) { - case ARG_NON: - break; - case ARG_RELADDR: - GET_RELADDR_INC(addr, bp); - fprintf(f, ":(%d)", addr); - break; - case ARG_ABSADDR: - GET_ABSADDR_INC(addr, bp); - fprintf(f, ":(%d)", addr); - break; - case ARG_LENGTH: - GET_LENGTH_INC(len, bp); - fprintf(f, ":%d", len); - break; - case ARG_MEMNUM: - mem = *((MemNumType* )bp); - bp += SIZE_MEMNUM; - fprintf(f, ":%d", mem); - break; - case ARG_OPTION: - { - OnigOptionType option = *((OnigOptionType* )bp); - bp += SIZE_OPTION; - fprintf(f, ":%d", option); - } - break; - } - } - else { - switch (*bp++) { - case OP_EXACT1: - case OP_ANYCHAR_STAR_PEEK_NEXT: - case OP_ANYCHAR_ML_STAR_PEEK_NEXT: - p_string(f, 1, bp++); break; - case OP_EXACT2: - p_string(f, 2, bp); bp += 2; break; - case OP_EXACT3: - p_string(f, 3, bp); bp += 3; break; - case OP_EXACT4: - p_string(f, 4, bp); bp += 4; break; - case OP_EXACT5: - p_string(f, 5, bp); bp += 5; break; - case OP_EXACTN: - GET_LENGTH_INC(len, bp); - p_len_string(f, len, 1, bp); - bp += len; - break; - - case OP_EXACTMB2N1: - p_string(f, 2, bp); bp += 2; break; - case OP_EXACTMB2N2: - p_string(f, 4, bp); bp += 4; break; - case OP_EXACTMB2N3: - p_string(f, 6, bp); bp += 6; break; - case OP_EXACTMB2N: - GET_LENGTH_INC(len, bp); - p_len_string(f, len, 2, bp); - bp += len * 2; - break; - case OP_EXACTMB3N: - GET_LENGTH_INC(len, bp); - p_len_string(f, len, 3, bp); - bp += len * 3; - break; - case OP_EXACTMBN: - { - int mb_len; - - GET_LENGTH_INC(mb_len, bp); - GET_LENGTH_INC(len, bp); - fprintf(f, ":%d:%d:", mb_len, len); - n = len * mb_len; - while (n-- > 0) { fputc(*bp++, f); } - } - break; - - case OP_EXACT1_IC: - len = enc_len(enc, bp); - p_string(f, len, bp); - bp += len; - break; - case OP_EXACTN_IC: - GET_LENGTH_INC(len, bp); - p_len_string(f, len, 1, bp); - bp += len; - break; - - case OP_CCLASS: - n = bitset_on_num((BitSetRef )bp); - bp += SIZE_BITSET; - fprintf(f, ":%d", n); - break; - - case OP_CCLASS_NOT: - n = bitset_on_num((BitSetRef )bp); - bp += SIZE_BITSET; - fprintf(f, ":%d", n); - break; - - case OP_CCLASS_MB: - case OP_CCLASS_MB_NOT: - GET_LENGTH_INC(len, bp); - q = bp; -#ifndef PLATFORM_UNALIGNED_WORD_ACCESS - ALIGNMENT_RIGHT(q); -#endif - GET_CODE_POINT(code, q); - bp += len; - fprintf(f, ":%d:%d", (int )code, len); - break; - - case OP_CCLASS_MIX: - case OP_CCLASS_MIX_NOT: - n = bitset_on_num((BitSetRef )bp); - bp += SIZE_BITSET; - GET_LENGTH_INC(len, bp); - q = bp; -#ifndef PLATFORM_UNALIGNED_WORD_ACCESS - ALIGNMENT_RIGHT(q); -#endif - GET_CODE_POINT(code, q); - bp += len; - fprintf(f, ":%d:%d:%d", n, (int )code, len); - break; - - case OP_CCLASS_NODE: - { - CClassNode *cc; - - GET_POINTER_INC(cc, bp); - n = bitset_on_num(cc->bs); - fprintf(f, ":%u:%d", (unsigned int )cc, n); - } - break; - - case OP_BACKREFN_IC: - mem = *((MemNumType* )bp); - bp += SIZE_MEMNUM; - fprintf(f, ":%d", mem); - break; - - case OP_BACKREF_MULTI_IC: - case OP_BACKREF_MULTI: - fputs(" ", f); - GET_LENGTH_INC(len, bp); - for (i = 0; i < len; i++) { - GET_MEMNUM_INC(mem, bp); - if (i > 0) fputs(", ", f); - fprintf(f, "%d", mem); - } - break; - - case OP_REPEAT: - case OP_REPEAT_NG: - { - mem = *((MemNumType* )bp); - bp += SIZE_MEMNUM; - addr = *((RelAddrType* )bp); - bp += SIZE_RELADDR; - fprintf(f, ":%d:%d", mem, addr); - } - break; - - case OP_PUSH_OR_JUMP_EXACT1: - case OP_PUSH_IF_PEEK_NEXT: - addr = *((RelAddrType* )bp); - bp += SIZE_RELADDR; - fprintf(f, ":(%d)", addr); - p_string(f, 1, bp); - bp += 1; - break; - - case OP_LOOK_BEHIND: - GET_LENGTH_INC(len, bp); - fprintf(f, ":%d", len); - break; - - case OP_PUSH_LOOK_BEHIND_NOT: - GET_RELADDR_INC(addr, bp); - GET_LENGTH_INC(len, bp); - fprintf(f, ":%d:(%d)", len, addr); - break; - - default: - fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n", - *--bp); - } - } - fputs("]", f); - if (nextp) *nextp = bp; -} - -static void -print_compiled_byte_code_list(FILE* f, regex_t* reg) -{ - int ncode; - UChar* bp = reg->p; - UChar* end = reg->p + reg->used; - - fprintf(f, "code length: %d\n", reg->used); - - ncode = 0; - while (bp < end) { - ncode++; - if (bp > reg->p) { - if (ncode % 5 == 0) - fprintf(f, "\n"); - else - fputs(" ", f); - } - onig_print_compiled_byte_code(f, bp, &bp, reg->enc); - } - - fprintf(f, "\n"); -} - -static void -print_indent_tree(FILE* f, Node* node, int indent) -{ - int i, type; - int add = 3; - UChar* p; - - Indent(f, indent); - if (IS_NULL(node)) { - fprintf(f, "ERROR: null node!!!\n"); - exit (0); - } - - type = NTYPE(node); - switch (type) { - case N_LIST: - case N_ALT: - if (NTYPE(node) == N_LIST) - fprintf(f, "\n", (int )node); - else - fprintf(f, "\n", (int )node); - - print_indent_tree(f, NCONS(node).left, indent + add); - while (IS_NOT_NULL(node = NCONS(node).right)) { - if (NTYPE(node) != type) { - fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node)); - exit(0); - } - print_indent_tree(f, NCONS(node).left, indent + add); - } - break; - - case N_STRING: - fprintf(f, "", - (NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node); - for (p = NSTRING(node).s; p < NSTRING(node).end; p++) { - if (*p >= 0x20 && *p < 0x7f) - fputc(*p, f); - else { - fprintf(f, " 0x%02x", *p); - } - } - break; - - case N_CCLASS: - fprintf(f, "", (int )node); - if (IS_CCLASS_NOT(&NCCLASS(node))) fputs(" not", f); - if (NCCLASS(node).mbuf) { - BBuf* bbuf = NCCLASS(node).mbuf; - for (i = 0; i < bbuf->used; i++) { - if (i > 0) fprintf(f, ","); - fprintf(f, "%0x", bbuf->p[i]); - } - } - break; - - case N_CTYPE: - fprintf(f, " ", (int )node); - switch (NCTYPE(node).type) { - case CTYPE_WORD: fputs("word", f); break; - case CTYPE_NOT_WORD: fputs("not word", f); break; - default: - fprintf(f, "ERROR: undefined ctype.\n"); - exit(0); - } - break; - - case N_ANYCHAR: - fprintf(f, "", (int )node); - break; - - case N_ANCHOR: - fprintf(f, " ", (int )node); - switch (NANCHOR(node).type) { - case ANCHOR_BEGIN_BUF: fputs("begin buf", f); break; - case ANCHOR_END_BUF: fputs("end buf", f); break; - case ANCHOR_BEGIN_LINE: fputs("begin line", f); break; - case ANCHOR_END_LINE: fputs("end line", f); break; - case ANCHOR_SEMI_END_BUF: fputs("semi end buf", f); break; - case ANCHOR_BEGIN_POSITION: fputs("begin position", f); break; - - case ANCHOR_WORD_BOUND: fputs("word bound", f); break; - case ANCHOR_NOT_WORD_BOUND: fputs("not word bound", f); break; -#ifdef USE_WORD_BEGIN_END - case ANCHOR_WORD_BEGIN: fputs("word begin", f); break; - case ANCHOR_WORD_END: fputs("word end", f); break; -#endif - case ANCHOR_PREC_READ: fputs("prec read", f); break; - case ANCHOR_PREC_READ_NOT: fputs("prec read not", f); break; - case ANCHOR_LOOK_BEHIND: fputs("look_behind", f); break; - case ANCHOR_LOOK_BEHIND_NOT: fputs("look_behind_not",f); break; - - default: - fprintf(f, "ERROR: undefined anchor type.\n"); - break; - } - break; - - case N_BACKREF: - { - int* p; - BackrefNode* br = &(NBACKREF(node)); - p = BACKREFS_P(br); - fprintf(f, "", (int )node); - for (i = 0; i < br->back_num; i++) { - if (i > 0) fputs(", ", f); - fprintf(f, "%d", p[i]); - } - } - break; - -#ifdef USE_SUBEXP_CALL - case N_CALL: - { - CallNode* cn = &(NCALL(node)); - fprintf(f, "", (int )node); - p_string(f, cn->name_end - cn->name, cn->name); - } - break; -#endif - - case N_QUALIFIER: - fprintf(f, "{%d,%d}%s\n", (int )node, - NQUALIFIER(node).lower, NQUALIFIER(node).upper, - (NQUALIFIER(node).greedy ? "" : "?")); - print_indent_tree(f, NQUALIFIER(node).target, indent + add); - break; - - case N_EFFECT: - fprintf(f, " ", (int )node); - switch (NEFFECT(node).type) { - case EFFECT_OPTION: - fprintf(f, "option:%d\n", NEFFECT(node).option); - print_indent_tree(f, NEFFECT(node).target, indent + add); - break; - case EFFECT_MEMORY: - fprintf(f, "memory:%d", NEFFECT(node).regnum); - break; - case EFFECT_STOP_BACKTRACK: - fprintf(f, "stop-bt"); - break; - - default: - break; - } - fprintf(f, "\n"); - print_indent_tree(f, NEFFECT(node).target, indent + add); - break; - - default: - fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node)); - break; - } - - if (type != N_LIST && type != N_ALT && type != N_QUALIFIER && - type != N_EFFECT) - fprintf(f, "\n"); - fflush(f); -} -#endif /* ONIG_DEBUG */ - -#ifdef ONIG_DEBUG_PARSE_TREE -static void -print_tree(FILE* f, Node* node) -{ - print_indent_tree(f, node, 0); -} -#endif diff --git a/ext/mbstring/oniguruma/regenc.c b/ext/mbstring/oniguruma/regenc.c deleted file mode 100644 index a767ca60b6af1..0000000000000 --- a/ext/mbstring/oniguruma/regenc.c +++ /dev/null @@ -1,1036 +0,0 @@ -/********************************************************************** - regenc.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT; - -extern int -onigenc_init() -{ - return 0; -} - -extern OnigEncoding -onigenc_get_default_encoding() -{ - return OnigEncDefaultCharEncoding; -} - -extern int -onigenc_set_default_encoding(OnigEncoding enc) -{ - OnigEncDefaultCharEncoding = enc; - return 0; -} - -extern UChar* -onigenc_get_right_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s) -{ - UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s); - if (p < s) { - p += enc_len(enc, p); - } - return p; -} - -extern UChar* -onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc, - const UChar* start, const UChar* s, const UChar** prev) -{ - UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s); - - if (p < s) { - if (prev) *prev = (const UChar* )p; - p += enc_len(enc, p); - } - else { - if (prev) *prev = (const UChar* )NULL; /* Sorry */ - } - return p; -} - -extern UChar* -onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s) -{ - if (s <= start) - return (UChar* )NULL; - - return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1); -} - -extern UChar* -onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n) -{ - while (ONIG_IS_NOT_NULL(s) && n-- > 0) { - if (s <= start) - return (UChar* )NULL; - - s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1); - } - return (UChar* )s; -} - -extern UChar* -onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n) -{ - UChar* q = (UChar* )p; - while (n-- > 0) { - q += ONIGENC_MBC_ENC_LEN(enc, q); - } - return (q <= end ? q : NULL); -} - -extern int -onigenc_strlen(OnigEncoding enc, const UChar* p, const UChar* end) -{ - int n = 0; - UChar* q = (UChar* )p; - - while (q < end) { - q += ONIGENC_MBC_ENC_LEN(enc, q); - n++; - } - return n; -} - -extern int -onigenc_strlen_null(OnigEncoding enc, const UChar* s) -{ - int n = 0; - UChar* p = (UChar* )s; - - while (1) { - if (*p == '\0') { - UChar* q; - int len = ONIGENC_MBC_MINLEN(enc); - - if (len == 1) return n; - q = p + 1; - while (len > 1) { - if (*q != '\0') break; - q++; - len--; - } - if (len == 1) return n; - } - p += ONIGENC_MBC_ENC_LEN(enc, p); - n++; - } -} - -extern int -onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s) -{ - UChar* start = (UChar* )s; - UChar* p = (UChar* )s; - - while (1) { - if (*p == '\0') { - UChar* q; - int len = ONIGENC_MBC_MINLEN(enc); - - if (len == 1) return (int )(p - start); - q = p + 1; - while (len > 1) { - if (*q != '\0') break; - q++; - len--; - } - if (len == 1) return (int )(p - start); - } - p += ONIGENC_MBC_ENC_LEN(enc, p); - } -} - -#ifndef ONIG_RUBY_M17N - -#ifndef NOT_RUBY - -#define USE_APPLICATION_TO_LOWER_CASE_TABLE - -unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x228c, 0x2289, 0x2288, 0x2288, 0x2288, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x31a0, - 0x21a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x2008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10e2, 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0, - 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x10e2, 0x00a0, 0x01a0, - 0x00a0, 0x10a0, 0x10e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x00a0, - 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x14a2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x00a0, - 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2 -}; -#endif - -const UChar* OnigEncAsciiToLowerCaseTable = (const UChar* )0; - -#ifndef USE_APPLICATION_TO_LOWER_CASE_TABLE -static const UChar BuiltInAsciiToLowerCaseTable[] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', -}; -#endif /* not USE_APPLICATION_TO_LOWER_CASE_TABLE */ - -#ifdef USE_UPPER_CASE_TABLE -UChar OnigEncAsciiToUpperCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107', - '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', - '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127', - '\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137', - '\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107', - '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', - '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127', - '\130', '\131', '\132', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', -}; -#endif - -unsigned short OnigEncAsciiCtypeTable[256] = { - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x220c, 0x2209, 0x2208, 0x2208, 0x2208, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, 0x2008, - 0x2284, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, 0x38b0, - 0x38b0, 0x38b0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x21a0, - 0x21a0, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x3ca2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, - 0x34a2, 0x34a2, 0x34a2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x31a0, - 0x21a0, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x38e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, - 0x30e2, 0x30e2, 0x30e2, 0x21a0, 0x21a0, 0x21a0, 0x21a0, 0x2008, - - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -UChar OnigEncISO_8859_1_ToLowerCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' -}; - -#ifdef USE_UPPER_CASE_TABLE -UChar OnigEncISO_8859_1_ToUpperCaseTable[256] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107', - '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', - '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127', - '\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137', - '\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107', - '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', - '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127', - '\130', '\131', '\132', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\367', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\377', -}; -#endif - -extern void -onigenc_set_default_caseconv_table(const UChar* table) -{ - if (table == (const UChar* )0) { -#ifndef USE_APPLICATION_TO_LOWER_CASE_TABLE - table = BuiltInAsciiToLowerCaseTable; -#else - return ; -#endif - } - - if (table != OnigEncAsciiToLowerCaseTable) { - OnigEncAsciiToLowerCaseTable = table; - } -} - -extern UChar* -onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s) -{ - return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s); -} - -OnigPairAmbigCodes OnigAsciiPairAmbigCodes[] = { - { 0x41, 0x61 }, - { 0x42, 0x62 }, - { 0x43, 0x63 }, - { 0x44, 0x64 }, - { 0x45, 0x65 }, - { 0x46, 0x66 }, - { 0x47, 0x67 }, - { 0x48, 0x68 }, - { 0x49, 0x69 }, - { 0x4a, 0x6a }, - { 0x4b, 0x6b }, - { 0x4c, 0x6c }, - { 0x4d, 0x6d }, - { 0x4e, 0x6e }, - { 0x4f, 0x6f }, - { 0x50, 0x70 }, - { 0x51, 0x71 }, - { 0x52, 0x72 }, - { 0x53, 0x73 }, - { 0x54, 0x74 }, - { 0x55, 0x75 }, - { 0x56, 0x76 }, - { 0x57, 0x77 }, - { 0x58, 0x78 }, - { 0x59, 0x79 }, - { 0x5a, 0x7a }, - - { 0x61, 0x41 }, - { 0x62, 0x42 }, - { 0x63, 0x43 }, - { 0x64, 0x44 }, - { 0x65, 0x45 }, - { 0x66, 0x46 }, - { 0x67, 0x47 }, - { 0x68, 0x48 }, - { 0x69, 0x49 }, - { 0x6a, 0x4a }, - { 0x6b, 0x4b }, - { 0x6c, 0x4c }, - { 0x6d, 0x4d }, - { 0x6e, 0x4e }, - { 0x6f, 0x4f }, - { 0x70, 0x50 }, - { 0x71, 0x51 }, - { 0x72, 0x52 }, - { 0x73, 0x53 }, - { 0x74, 0x54 }, - { 0x75, 0x55 }, - { 0x76, 0x56 }, - { 0x77, 0x57 }, - { 0x78, 0x58 }, - { 0x79, 0x59 }, - { 0x7a, 0x5a } -}; - -extern int -onigenc_ascii_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return (sizeof(OnigAsciiPairAmbigCodes) / sizeof(OnigPairAmbigCodes)); - } - else { - return 0; - } -} - -extern int -onigenc_nothing_get_all_comp_ambig_codes(OnigAmbigType flag, - OnigCompAmbigCodes** ccs) -{ - return 0; -} - -extern int -onigenc_iso_8859_1_get_all_pair_ambig_codes(OnigAmbigType flag, - OnigPairAmbigCodes** ccs) -{ - static OnigPairAmbigCodes cc[] = { - { 0xc0, 0xe0 }, - { 0xc1, 0xe1 }, - { 0xc2, 0xe2 }, - { 0xc3, 0xe3 }, - { 0xc4, 0xe4 }, - { 0xc5, 0xe5 }, - { 0xc6, 0xe6 }, - { 0xc7, 0xe7 }, - { 0xc8, 0xe8 }, - { 0xc9, 0xe9 }, - { 0xca, 0xea }, - { 0xcb, 0xeb }, - { 0xcc, 0xec }, - { 0xcd, 0xed }, - { 0xce, 0xee }, - { 0xcf, 0xef }, - - { 0xd0, 0xf0 }, - { 0xd1, 0xf1 }, - { 0xd2, 0xf2 }, - { 0xd3, 0xf3 }, - { 0xd4, 0xf4 }, - { 0xd5, 0xf5 }, - { 0xd6, 0xf6 }, - { 0xd8, 0xf8 }, - { 0xd9, 0xf9 }, - { 0xda, 0xfa }, - { 0xdb, 0xfb }, - { 0xdc, 0xfc }, - { 0xdd, 0xfd }, - { 0xde, 0xfe }, - - { 0xe0, 0xc0 }, - { 0xe1, 0xc1 }, - { 0xe2, 0xc2 }, - { 0xe3, 0xc3 }, - { 0xe4, 0xc4 }, - { 0xe5, 0xc5 }, - { 0xe6, 0xc6 }, - { 0xe7, 0xc7 }, - { 0xe8, 0xc8 }, - { 0xe9, 0xc9 }, - { 0xea, 0xca }, - { 0xeb, 0xcb }, - { 0xec, 0xcc }, - { 0xed, 0xcd }, - { 0xee, 0xce }, - { 0xef, 0xcf }, - - { 0xf0, 0xd0 }, - { 0xf1, 0xd1 }, - { 0xf2, 0xd2 }, - { 0xf3, 0xd3 }, - { 0xf4, 0xd4 }, - { 0xf5, 0xd5 }, - { 0xf6, 0xd6 }, - { 0xf8, 0xd8 }, - { 0xf9, 0xd9 }, - { 0xfa, 0xda }, - { 0xfb, 0xdb }, - { 0xfc, 0xdc }, - { 0xfd, 0xdd }, - { 0xfe, 0xde } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) { - *ccs = OnigAsciiPairAmbigCodes; - return (sizeof(OnigAsciiPairAmbigCodes) / sizeof(OnigPairAmbigCodes)); - } - else if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = cc; - return sizeof(cc) / sizeof(OnigPairAmbigCodes); - } - else - return 0; -} - -extern int -onigenc_ess_tsett_get_all_comp_ambig_codes(OnigAmbigType flag, - OnigCompAmbigCodes** ccs) -{ - static OnigCompAmbigCodes folds[] = { - { 2, 0xdf, {{ 2, { 0x53, 0x53 } }, { 2, { 0x73, 0x73} } } } - }; - - if (flag == ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) { - *ccs = folds; - return sizeof(folds) / sizeof(OnigCompAmbigCodes); - } - else - return 0; -} - -extern int -onigenc_not_support_get_ctype_code_range(int ctype, - OnigCodePoint* sbr[], OnigCodePoint* mbr[]) -{ - return ONIG_NO_SUPPORT_CONFIG; -} - -extern int -onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end) -{ - if (p < end) { - if (*p == 0x0a) return 1; - } - return 0; -} - -/* for single byte encodings */ -extern int -onigenc_ascii_mbc_to_normalize(OnigAmbigType flag, const UChar** p, const UChar*end, - UChar* lower) -{ - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p); - } - else { - *lower = **p; - } - - (*p)++; - return 1; /* return byte length of converted char to lower */ -} - -extern int -onigenc_ascii_is_mbc_ambiguous(OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - (*pp)++; - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p); - } - else { - return FALSE; - } -} - -extern int -onigenc_single_byte_mbc_enc_len(const UChar* p) -{ - return 1; -} - -extern OnigCodePoint -onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end) -{ - return (OnigCodePoint )(*p); -} - -extern int -onigenc_single_byte_code_to_mbclen(OnigCodePoint code) -{ - return 1; -} - -extern int -onigenc_single_byte_code_to_mbc_first(OnigCodePoint code) -{ - return (code & 0xff); -} - -extern int -onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf) -{ - *buf = (UChar )(code & 0xff); - return 1; -} - -extern UChar* -onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s) -{ - return (UChar* )s; -} - -extern int -onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - return TRUE; -} - -extern int -onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end) -{ - return FALSE; -} - -extern OnigCodePoint -onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end) -{ - int c, i, len; - OnigCodePoint n; - - len = enc_len(enc, p); - n = (OnigCodePoint )(*p++); - if (len == 1) return n; - - for (i = 1; i < len; i++) { - if (p >= end) break; - c = *p++; - n <<= 8; n += c; - } - return n; -} - -extern int -onigenc_mbn_mbc_to_normalize(OnigEncoding enc, OnigAmbigType flag, - const UChar** pp, const UChar* end, UChar* lower) -{ - int len; - const UChar *p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); - } - else { - *lower = *p; - } - (*pp)++; - return 1; - } - else { - len = enc_len(enc, p); - if (lower != p) { - int i; - for (i = 0; i < len; i++) { - *lower++ = *p++; - } - } - (*pp) += len; - return len; /* return byte length of converted to lower char */ - } -} - -extern int -onigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigAmbigType flag, - const UChar** pp, const UChar* end) -{ - const UChar* p = *pp; - - if (ONIGENC_IS_MBC_ASCII(p)) { - (*pp)++; - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p); - } - else { - return FALSE; - } - } - - (*pp) += enc_len(enc, p); - return FALSE; -} - -extern int -onigenc_mb2_code_to_mbclen(OnigCodePoint code) -{ - if ((code & 0xff00) != 0) return 2; - else return 1; -} - -extern int -onigenc_mb4_code_to_mbclen(OnigCodePoint code) -{ - if ((code & 0xff000000) != 0) return 4; - else if ((code & 0xff0000) != 0) return 3; - else if ((code & 0xff00) != 0) return 2; - else return 1; -} - -extern int -onigenc_mb2_code_to_mbc_first(OnigCodePoint code) -{ - int first; - - if ((code & 0xff00) != 0) { - first = (code >> 8) & 0xff; - } - else { - return (int )code; - } - return first; -} - -extern int -onigenc_mb4_code_to_mbc_first(OnigCodePoint code) -{ - int first; - - if ((code & 0xff000000) != 0) { - first = (code >> 24) & 0xff; - } - else if ((code & 0xff0000) != 0) { - first = (code >> 16) & 0xff; - } - else if ((code & 0xff00) != 0) { - first = (code >> 8) & 0xff; - } - else { - return (int )code; - } - return first; -} - -extern int -onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf) -{ - UChar *p = buf; - - if ((code & 0xff00) != 0) { - *p++ = (UChar )((code >> 8) & 0xff); - } - *p++ = (UChar )(code & 0xff); - -#if 1 - if (enc_len(enc, buf) != (p - buf)) - return ONIGENCERR_INVALID_WIDE_CHAR_VALUE; -#endif - return p - buf; -} - -extern int -onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf) -{ - UChar *p = buf; - - if ((code & 0xff000000) != 0) { - *p++ = (UChar )((code >> 24) & 0xff); - } - if ((code & 0xff0000) != 0) { - *p++ = (UChar )((code >> 16) & 0xff); - } - if ((code & 0xff00) != 0) { - *p++ = (UChar )((code >> 8) & 0xff); - } - *p++ = (UChar )(code & 0xff); - -#if 1 - if (enc_len(enc, buf) != (p - buf)) - return ONIGENCERR_INVALID_WIDE_CHAR_VALUE; -#endif - return p - buf; -} - -extern int -onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, - unsigned int ctype) -{ - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE); - - ctype &= ~ONIGENC_CTYPE_WORD; - if (ctype == 0) return FALSE; - } - - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -extern int -onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, - unsigned int ctype) -{ - if ((ctype & ONIGENC_CTYPE_WORD) != 0) { - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE); - - ctype &= ~ONIGENC_CTYPE_WORD; - if (ctype == 0) return FALSE; - } - - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -extern int -onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, - const UChar* sascii /* ascii */, int n) -{ - int x, c; - - while (n-- > 0) { - if (p >= end) return (int )(*sascii); - - c = (int )ONIGENC_MBC_TO_CODE(enc, p, end); - x = *sascii - c; - if (x) return x; - - sascii++; - p += enc_len(enc, p); - } - return 0; -} - -#else /* ONIG_RUBY_M17N */ - -extern int -onigenc_is_code_ctype(OnigEncoding enc, OnigCodePoint code, int ctype) -{ - switch (ctype) { - case ONIGENC_CTYPE_NEWLINE: - if (code == 0x0a) return 1; - break; - - case ONIGENC_CTYPE_ALPHA: - return m17n_isalpha(enc, code); - break; - case ONIGENC_CTYPE_BLANK: - return ONIGENC_IS_CODE_BLANK(enc, (int )(code)); - break; - case ONIGENC_CTYPE_CNTRL: - return m17n_iscntrl(enc, code); - break; - case ONIGENC_CTYPE_DIGIT: - return m17n_isdigit(enc, code); - break; - case ONIGENC_CTYPE_GRAPH: - return ONIGENC_IS_CODE_GRAPH(enc, (int )(code)); - break; - case ONIGENC_CTYPE_LOWER: - return m17n_islower(enc, code); - break; - case ONIGENC_CTYPE_PRINT: - return m17n_isprint(enc, code); - break; - case ONIGENC_CTYPE_PUNCT: - return m17n_ispunct(enc, code); - break; - case ONIGENC_CTYPE_SPACE: - return m17n_isspace(enc, code); - break; - case ONIGENC_CTYPE_UPPER: - return m17n_isupper(enc, code); - break; - case ONIGENC_CTYPE_XDIGIT: - return m17n_isxdigit(enc, code); - break; - case ONIGENC_CTYPE_WORD: - return m17n_iswchar(enc, code); - break; - case ONIGENC_CTYPE_ASCII: - return (code < 128 ? TRUE : FALSE); - break; - case ONIGENC_CTYPE_ALNUM: - return m17n_isalnum(enc, code); - break; - default: - break; - } - - return 0; -} - -extern int -onigenc_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf) -{ - int c, len; - - m17n_mbcput(enc, code, buf); - c = m17n_firstbyte(enc, code); - len = enc_len(enc, c); - return len; -} - -extern int -onigenc_mbc_to_lower(OnigEncoding enc, UChar* p, UChar* buf) -{ - unsigned int c, low; - - c = m17n_codepoint(enc, p, p + enc_len(enc, *p)); - low = m17n_tolower(enc, c); - m17n_mbcput(enc, low, buf); - - return m17n_codelen(enc, low); -} - -extern int -onigenc_is_mbc_ambiguous(OnigEncoding enc, OnigAmbigType flag, - UChar** pp, UChar* end) -{ - int len; - unsigned int c; - UChar* p = *pp; - - len = enc_len(enc, *p); - (*pp) += len; - c = m17n_codepoint(enc, p, p + len); - - if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) { - if (m17n_isupper(enc, c) || m17n_islower(enc, c)) - return TRUE; - } - - return FALSE; -} - -extern UChar* -onigenc_get_left_adjust_char_head(OnigEncoding enc, UChar* start, UChar* s) -{ - UChar *p; - int len; - - if (s <= start) return s; - p = s; - - while (!m17n_islead(enc, *p) && p > start) p--; - while (p + (len = enc_len(enc, *p)) < s) { - p += len; - } - if (p + len == s) return s; - return p; -} - -extern int -onigenc_is_allowed_reverse_match(OnigEncoding enc, - const UChar* s, const UChar* end) -{ - return ONIGENC_IS_SINGLEBYTE(enc); -} - -extern void -onigenc_set_default_caseconv_table(UChar* table) { } - -#endif /* ONIG_RUBY_M17N */ diff --git a/ext/mbstring/oniguruma/regenc.h b/ext/mbstring/oniguruma/regenc.h deleted file mode 100644 index 510455146ef2d..0000000000000 --- a/ext/mbstring/oniguruma/regenc.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef REGENC_H -#define REGENC_H -/********************************************************************** - regenc.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#ifndef RUBY_PLATFORM -#include "config.h" -#endif -#include "oniguruma.h" - -#ifndef NULL -#define NULL ((void* )0) -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* error codes */ -#define ONIGENCERR_MEMORY -5 -#define ONIGENCERR_TYPE_BUG -6 -#define ONIGENCERR_INVALID_WIDE_CHAR_VALUE -400 -#define ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE -401 - -#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0) -#define ONIG_IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL -#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val) - - -#ifdef ONIG_RUBY_M17N - -#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_UNDEF - -#else /* ONIG_RUBY_M17N */ - -#define USE_UNICODE_FULL_RANGE_CTYPE - -#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII - -/* for encoding system implementation (internal) */ -ONIG_EXTERN int onigenc_ascii_get_all_pair_ambig_codes P_((OnigAmbigType flag, OnigPairAmbigCodes** acs)); -ONIG_EXTERN int onigenc_nothing_get_all_comp_ambig_codes P_((OnigAmbigType flag, OnigCompAmbigCodes** acs)); -ONIG_EXTERN int onigenc_iso_8859_1_get_all_pair_ambig_codes P_((OnigAmbigType flag, OnigPairAmbigCodes** acs)); -ONIG_EXTERN int onigenc_ess_tsett_get_all_comp_ambig_codes P_((OnigAmbigType flag, OnigCompAmbigCodes** acs)); -ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((int ctype, OnigCodePoint* sbr[], OnigCodePoint* mbr[])); -ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end)); - -/* methods for single byte encoding */ -ONIG_EXTERN int onigenc_ascii_mbc_to_normalize P_((OnigAmbigType flag, const UChar** p, const UChar* end, UChar* lower)); -ONIG_EXTERN int onigenc_ascii_is_mbc_ambiguous P_((OnigAmbigType flag, const UChar** p, const UChar* end)); -ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p)); -ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end)); -ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_single_byte_code_to_mbc_first P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf)); -ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s)); -ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end)); -ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end)); - -/* methods for multi byte encoding */ -ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end)); -ONIG_EXTERN int onigenc_mbn_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const UChar** p, const UChar* end, UChar* lower)); -ONIG_EXTERN int onigenc_mbn_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const UChar** p, const UChar* end)); -ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_mb2_code_to_mbc_first P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf)); -ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype)); -ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_mb4_code_to_mbc_first P_((OnigCodePoint code)); -ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf)); -ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype)); - -ONIG_EXTERN int onigenc_get_all_fold_match_code_ss_0xdf P_((OnigCodePoint** codes)); - -/* in enc/unicode.c */ -ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype)); -ONIG_EXTERN int onigenc_unicode_get_ctype_code_range P_((int ctype, OnigCodePoint* sbr[], OnigCodePoint* mbr[])); - - -#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \ - OnigEncISO_8859_1_ToLowerCaseTable[c] -#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \ - OnigEncISO_8859_1_ToUpperCaseTable[c] -#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code,ctype) \ - ((OnigEnc_Unicode_ISO_8859_1_CtypeTable[code] & ctype) != 0) - -ONIG_EXTERN UChar OnigEncISO_8859_1_ToLowerCaseTable[]; -ONIG_EXTERN UChar OnigEncISO_8859_1_ToUpperCaseTable[]; -ONIG_EXTERN unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[]; -ONIG_EXTERN OnigPairAmbigCodes OnigAsciiPairAmbigCodes[]; - -#endif /* is not ONIG_RUBY_M17N */ - -ONIG_EXTERN int -onigenc_with_ascii_strncmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n)); -ONIG_EXTERN UChar* -onigenc_step P_((OnigEncoding enc, const UChar* p, const UChar* end, int n)); - -/* defined in regexec.c, but used in enc/xxx.c */ -extern int onig_is_in_code_range P_((const UChar* p, OnigCodePoint code)); - -ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding; -ONIG_EXTERN const UChar* OnigEncAsciiToLowerCaseTable; -ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[]; -ONIG_EXTERN unsigned short OnigEncAsciiCtypeTable[]; - -#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c] -#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c] -#define ONIGENC_IS_ASCII_CODE_CTYPE(code,ctype) \ - ((OnigEncAsciiCtypeTable[code] & ctype) != 0) -#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \ - ONIGENC_IS_ASCII_CODE_CTYPE(code, (ONIGENC_CTYPE_UPPER | ONIGENC_CTYPE_LOWER)) - -#endif /* REGENC_H */ diff --git a/ext/mbstring/oniguruma/regerror.c b/ext/mbstring/oniguruma/regerror.c deleted file mode 100644 index 560b5e12c56ca..0000000000000 --- a/ext/mbstring/oniguruma/regerror.c +++ /dev/null @@ -1,329 +0,0 @@ -/********************************************************************** - regerror.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" -#include /* for vsnprintf() */ - -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif - -extern char* -onig_error_code_to_format(int code) -{ - char *p; - - if (code >= 0) return (char* )0; - - switch (code) { - case ONIG_MISMATCH: - p = "mismatch"; break; - case ONIG_NO_SUPPORT_CONFIG: - p = "no support in this configuration"; break; - case ONIGERR_MEMORY: - p = "fail to memory allocation"; break; - case ONIGERR_MATCH_STACK_LIMIT_OVER: - p = "match-stack limit over"; break; - case ONIGERR_TYPE_BUG: - p = "undefined type (bug)"; break; - case ONIGERR_PARSER_BUG: - p = "internal parser error (bug)"; break; - case ONIGERR_STACK_BUG: - p = "stack error (bug)"; break; - case ONIGERR_UNDEFINED_BYTECODE: - p = "undefined bytecode (bug)"; break; - case ONIGERR_UNEXPECTED_BYTECODE: - p = "unexpected bytecode (bug)"; break; - case ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED: - p = "default multibyte-encoding is not setted"; break; - case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR: - p = "can't convert to wide-char on specified multibyte-encoding"; break; - case ONIGERR_INVALID_ARGUMENT: - p = "invalid argument"; break; - case ONIGERR_END_PATTERN_AT_LEFT_BRACE: - p = "end pattern at left brace"; break; - case ONIGERR_END_PATTERN_AT_LEFT_BRACKET: - p = "end pattern at left bracket"; break; - case ONIGERR_EMPTY_CHAR_CLASS: - p = "empty char-class"; break; - case ONIGERR_PREMATURE_END_OF_CHAR_CLASS: - p = "premature end of char-class"; break; - case ONIGERR_END_PATTERN_AT_ESCAPE: - p = "end pattern at escape"; break; - case ONIGERR_END_PATTERN_AT_META: - p = "end pattern at meta"; break; - case ONIGERR_END_PATTERN_AT_CONTROL: - p = "end pattern at control"; break; - case ONIGERR_META_CODE_SYNTAX: - p = "illegal meta-code syntax"; break; - case ONIGERR_CONTROL_CODE_SYNTAX: - p = "illegal control-code syntax"; break; - case ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE: - p = "char-class value at end of range"; break; - case ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE: - p = "char-class value at start of range"; break; - case ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS: - p = "unmatched range specifier in char-class"; break; - case ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED: - p = "target of repeat operator is not specified"; break; - case ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID: - p = "target of repeat operator is invalid"; break; - case ONIGERR_NESTED_REPEAT_OPERATOR: - p = "nested repeat operator"; break; - case ONIGERR_UNMATCHED_CLOSE_PARENTHESIS: - p = "unmatched close parenthesis"; break; - case ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS: - p = "end pattern with unmatched parenthesis"; break; - case ONIGERR_END_PATTERN_IN_GROUP: - p = "end pattern in group"; break; - case ONIGERR_UNDEFINED_GROUP_OPTION: - p = "undefined group option"; break; - case ONIGERR_INVALID_POSIX_BRACKET_TYPE: - p = "invalid POSIX bracket type"; break; - case ONIGERR_INVALID_LOOK_BEHIND_PATTERN: - p = "invalid pattern in look-behind"; break; - case ONIGERR_INVALID_REPEAT_RANGE_PATTERN: - p = "invalid repeat range {lower,upper}"; break; - case ONIGERR_TOO_BIG_NUMBER: - p = "too big number"; break; - case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE: - p = "too big number for repeat range"; break; - case ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE: - p = "upper is smaller than lower in repeat range"; break; - case ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS: - p = "empty range in char class"; break; - case ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE: - p = "mismatch multibyte code length in char-class range"; break; - case ONIGERR_TOO_MANY_MULTI_BYTE_RANGES: - p = "too many multibyte code ranges are specified"; break; - case ONIGERR_TOO_SHORT_MULTI_BYTE_STRING: - p = "too short multibyte code string"; break; - case ONIGERR_TOO_BIG_BACKREF_NUMBER: - p = "too big backref number"; break; - case ONIGERR_INVALID_BACKREF: -#ifdef USE_NAMED_GROUP - p = "invalid backref number/name"; break; -#else - p = "invalid backref number"; break; -#endif - case ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED: - p = "numbered backref/call is not allowed. (use name)"; break; - case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE: - p = "too big wide-char value"; break; - case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE: - p = "too long wide-char value"; break; - case ONIGERR_INVALID_WIDE_CHAR_VALUE: - p = "invalid wide-char value"; break; - case ONIGERR_EMPTY_GROUP_NAME: - p = "group name is empty"; break; - case ONIGERR_INVALID_GROUP_NAME: - p = "invalid group name <%n>"; break; - case ONIGERR_INVALID_CHAR_IN_GROUP_NAME: -#ifdef USE_NAMED_GROUP - p = "invalid char in group name <%n>"; break; -#else - p = "invalid char in group number <%n>"; break; -#endif - case ONIGERR_UNDEFINED_NAME_REFERENCE: - p = "undefined name <%n> reference"; break; - case ONIGERR_UNDEFINED_GROUP_REFERENCE: - p = "undefined group <%n> reference"; break; - case ONIGERR_MULTIPLEX_DEFINED_NAME: - p = "multiplex defined name <%n>"; break; - case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL: - p = "multiplex definition name <%n> call"; break; - case ONIGERR_NEVER_ENDING_RECURSION: - p = "never ending recursion"; break; - case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY: - p = "group number is too big for capture history"; break; - case ONIGERR_INVALID_CHAR_PROPERTY_NAME: - p = "invalid character property name {%n}"; break; - case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION: - p = "not supported encoding combination"; break; - case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT: - p = "over thread pass limit count"; break; - - default: - p = "undefined error code"; break; - } - - return p; -} - - -/* for ONIG_MAX_ERROR_MESSAGE_LEN */ -#define MAX_ERROR_PAR_LEN 30 - -extern int -#ifdef HAVE_STDARG_PROTOTYPES -onig_error_code_to_str(UChar* s, int code, ...) -#else -onig_error_code_to_str(s, code, va_alist) - UChar* s; - int code; - va_dcl -#endif -{ - UChar *p, *q; - OnigErrorInfo* einfo; - int len; - va_list vargs; - - va_init_list(vargs, code); - - switch (code) { - case ONIGERR_UNDEFINED_NAME_REFERENCE: - case ONIGERR_UNDEFINED_GROUP_REFERENCE: - case ONIGERR_MULTIPLEX_DEFINED_NAME: - case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL: - case ONIGERR_INVALID_GROUP_NAME: - case ONIGERR_INVALID_CHAR_IN_GROUP_NAME: - case ONIGERR_INVALID_CHAR_PROPERTY_NAME: - einfo = va_arg(vargs, OnigErrorInfo*); - len = einfo->par_end - einfo->par; - q = onig_error_code_to_format(code); - p = s; - while (*q != '\0') { - if (*q == '%') { - q++; - if (*q == 'n') { /* '%n': name */ - if (len > MAX_ERROR_PAR_LEN) { - xmemcpy(p, einfo->par, MAX_ERROR_PAR_LEN - 3); - p += (MAX_ERROR_PAR_LEN - 3); - xmemcpy(p, "...", 3); - p += 3; - } - else { - xmemcpy(p, einfo->par, len); - p += len; - } - q++; - } - else - goto normal_char; - } - else { - normal_char: - *p++ = *q++; - } - } - *p = '\0'; - len = p - s; - break; - - default: - q = onig_error_code_to_format(code); - len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q); - xmemcpy(s, q, len); - s[len] = '\0'; - break; - } - - va_end(vargs); - return len; -} - - -void -#ifdef HAVE_STDARG_PROTOTYPES -onig_snprintf_with_pattern(char buf[], int bufsize, OnigEncoding enc, - char* pat, char* pat_end, char *fmt, ...) -#else -onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist) - char buf[]; - int bufsize; - OnigEncoding enc; - char* pat; - char* pat_end; - const char *fmt; - va_dcl -#endif -{ - int n, need, len; - UChar *p, *s, *bp; - char bs[6]; - va_list args; - - va_init_list(args, fmt); - n = vsnprintf(buf, bufsize, fmt, args); - va_end(args); - - need = (pat_end - pat) * 4 + 4; - - if (n + need < bufsize) { - strcat(buf, ": /"); - s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf); - - p = pat; - while (p < (UChar* )pat_end) { - if (*p == MC_ESC(enc)) { - *s++ = *p++; - len = enc_len(enc, p); - while (len-- > 0) *s++ = *p++; - } - else if (*p == '/') { - *s++ = (unsigned char )MC_ESC(enc); - *s++ = *p++; - } - else if (ONIGENC_IS_MBC_HEAD(enc, p)) { - len = enc_len(enc, p); - if (ONIGENC_MBC_MINLEN(enc) == 1) { - while (len-- > 0) *s++ = *p++; - } - else { /* for UTF16 */ - int blen; - - while (len-- > 0) { - sprintf(bs, "\\%03o", *p++ & 0377); - blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); - bp = bs; - while (blen-- > 0) *s++ = *bp++; - } - } - } - else if (!ONIGENC_IS_CODE_PRINT(enc, *p) && - !ONIGENC_IS_CODE_SPACE(enc, *p)) { - sprintf(bs, "\\%03o", *p++ & 0377); - len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); - bp = bs; - while (len-- > 0) *s++ = *bp++; - } - else { - *s++ = *p++; - } - } - - *s++ = '/'; - *s = '\0'; - } -} diff --git a/ext/mbstring/oniguruma/regexec.c b/ext/mbstring/oniguruma/regexec.c deleted file mode 100644 index 25d97773fbe5a..0000000000000 --- a/ext/mbstring/oniguruma/regexec.c +++ /dev/null @@ -1,3550 +0,0 @@ -/********************************************************************** - regexec.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -#ifdef USE_CAPTURE_HISTORY -static void history_tree_free(OnigCaptureTreeNode* node); - -static void -history_tree_clear(OnigCaptureTreeNode* node) -{ - int i; - - if (IS_NOT_NULL(node)) { - for (i = 0; i < node->num_childs; i++) { - if (IS_NOT_NULL(node->childs[i])) { - history_tree_free(node->childs[i]); - } - } - for (i = 0; i < node->allocated; i++) { - node->childs[i] = (OnigCaptureTreeNode* )0; - } - node->num_childs = 0; - node->beg = ONIG_REGION_NOTPOS; - node->end = ONIG_REGION_NOTPOS; - node->group = -1; - } -} - -static void -history_tree_free(OnigCaptureTreeNode* node) -{ - history_tree_clear(node); - xfree(node); -} - -static void -history_root_free(OnigRegion* r) -{ - if (IS_NOT_NULL(r->history_root)) { - history_tree_free(r->history_root); - r->history_root = (OnigCaptureTreeNode* )0; - } -} - -static OnigCaptureTreeNode* -history_node_new() -{ - OnigCaptureTreeNode* node; - - node = (OnigCaptureTreeNode* )xmalloc(sizeof(OnigCaptureTreeNode)); - CHECK_NULL_RETURN(node); - node->childs = (OnigCaptureTreeNode** )0; - node->allocated = 0; - node->num_childs = 0; - node->group = -1; - node->beg = ONIG_REGION_NOTPOS; - node->end = ONIG_REGION_NOTPOS; - - return node; -} - -static int -history_tree_add_child(OnigCaptureTreeNode* parent, OnigCaptureTreeNode* child) -{ -#define HISTORY_TREE_INIT_ALLOC_SIZE 8 - - if (parent->num_childs >= parent->allocated) { - int n, i; - - if (IS_NULL(parent->childs)) { - n = HISTORY_TREE_INIT_ALLOC_SIZE; - parent->childs = - (OnigCaptureTreeNode** )xmalloc(sizeof(OnigCaptureTreeNode*) * n); - } - else { - n = parent->allocated * 2; - parent->childs = - (OnigCaptureTreeNode** )xrealloc(parent->childs, - sizeof(OnigCaptureTreeNode*) * n); - } - CHECK_NULL_RETURN_VAL(parent->childs, ONIGERR_MEMORY); - for (i = parent->allocated; i < n; i++) { - parent->childs[i] = (OnigCaptureTreeNode* )0; - } - parent->allocated = n; - } - - parent->childs[parent->num_childs] = child; - parent->num_childs++; - return 0; -} - -static OnigCaptureTreeNode* -history_tree_clone(OnigCaptureTreeNode* node) -{ - int i; - OnigCaptureTreeNode *clone, *child; - - clone = history_node_new(); - CHECK_NULL_RETURN(clone); - - clone->beg = node->beg; - clone->end = node->end; - for (i = 0; i < node->num_childs; i++) { - child = history_tree_clone(node->childs[i]); - if (IS_NULL(child)) { - history_tree_free(clone); - return (OnigCaptureTreeNode* )0; - } - history_tree_add_child(clone, child); - } - - return clone; -} - -extern OnigCaptureTreeNode* -onig_get_capture_tree(OnigRegion* region) -{ - return region->history_root; -} -#endif /* USE_CAPTURE_HISTORY */ - -extern void -onig_region_clear(OnigRegion* region) -{ - int i; - - for (i = 0; i < region->num_regs; i++) { - region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; - } -#ifdef USE_CAPTURE_HISTORY - history_root_free(region); -#endif -} - -extern int -onig_region_resize(OnigRegion* region, int n) -{ - region->num_regs = n; - - if (n < ONIG_NREGION) - n = ONIG_NREGION; - - if (region->allocated == 0) { - region->beg = (int* )xmalloc(n * sizeof(int)); - region->end = (int* )xmalloc(n * sizeof(int)); - - if (region->beg == 0 || region->end == 0) - return ONIGERR_MEMORY; - - region->allocated = n; - } - else if (region->allocated < n) { - region->beg = (int* )xrealloc(region->beg, n * sizeof(int)); - region->end = (int* )xrealloc(region->end, n * sizeof(int)); - - if (region->beg == 0 || region->end == 0) - return ONIGERR_MEMORY; - - region->allocated = n; - } - - return 0; -} - -extern int -onig_region_resize_clear(OnigRegion* region, int n) -{ - int r; - - r = onig_region_resize(region, n); - if (r != 0) return r; - onig_region_clear(region); - return 0; -} - -extern int -onig_region_set(OnigRegion* region, int at, int beg, int end) -{ - if (at < 0) return ONIGERR_INVALID_ARGUMENT; - - if (at >= region->allocated) { - int r = onig_region_resize(region, at + 1); - if (r < 0) return r; - } - - region->beg[at] = beg; - region->end[at] = end; - return 0; -} - -extern void -onig_region_init(OnigRegion* region) -{ - region->num_regs = 0; - region->allocated = 0; - region->beg = (int* )0; - region->end = (int* )0; - region->history_root = (OnigCaptureTreeNode* )0; -} - -extern OnigRegion* -onig_region_new() -{ - OnigRegion* r; - - r = (OnigRegion* )xmalloc(sizeof(OnigRegion)); - onig_region_init(r); - return r; -} - -extern void -onig_region_free(OnigRegion* r, int free_self) -{ - if (r) { - if (r->allocated > 0) { - if (r->beg) xfree(r->beg); - if (r->end) xfree(r->end); - r->allocated = 0; - } -#ifdef USE_CAPTURE_HISTORY - history_root_free(r); -#endif - if (free_self) xfree(r); - } -} - -extern void -onig_region_copy(OnigRegion* to, OnigRegion* from) -{ -#define RREGC_SIZE (sizeof(int) * from->num_regs) - int i; - - if (to == from) return; - - if (to->allocated == 0) { - if (from->num_regs > 0) { - to->beg = (int* )xmalloc(RREGC_SIZE); - to->end = (int* )xmalloc(RREGC_SIZE); - to->allocated = from->num_regs; - } - } - else if (to->allocated < from->num_regs) { - to->beg = (int* )xrealloc(to->beg, RREGC_SIZE); - to->end = (int* )xrealloc(to->end, RREGC_SIZE); - to->allocated = from->num_regs; - } - - for (i = 0; i < from->num_regs; i++) { - to->beg[i] = from->beg[i]; - to->end[i] = from->end[i]; - } - to->num_regs = from->num_regs; - -#ifdef USE_CAPTURE_HISTORY - history_root_free(to); - - if (IS_NOT_NULL(from->history_root)) { - to->history_root = history_tree_clone(from->history_root); - } -#endif -} - - -/** stack **/ -#define INVALID_STACK_INDEX -1 -typedef long StackIndex; - -typedef struct _StackType { - unsigned int type; - union { - struct { - UChar *pcode; /* byte code position */ - UChar *pstr; /* string position */ - UChar *pstr_prev; /* previous char position of pstr */ - } state; - struct { - int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */ - UChar *pcode; /* byte code position (head of repeated target) */ - int num; /* repeat id */ - } repeat; - struct { - StackIndex si; /* index of stack */ - } repeat_inc; - struct { - int num; /* memory num */ - UChar *pstr; /* start/end position */ - /* Following information is setted, if this stack type is MEM-START */ - StackIndex start; /* prev. info (for backtrack "(...)*" ) */ - StackIndex end; /* prev. info (for backtrack "(...)*" ) */ - } mem; - struct { - int num; /* null check id */ - UChar *pstr; /* start position */ - } null_check; -#ifdef USE_SUBEXP_CALL - struct { - UChar *ret_addr; /* byte code position */ - int num; /* null check id */ - UChar *pstr; /* string position */ - } call_frame; -#endif - } u; -} StackType; - -/* stack type */ -/* used by normal-POP */ -#define STK_ALT 0x0001 -#define STK_LOOK_BEHIND_NOT 0x0003 -#define STK_POS_NOT 0x0005 -/* avoided by normal-POP, but value should be small */ -#define STK_NULL_CHECK_START 0x0100 -/* handled by normal-POP */ -#define STK_MEM_START 0x0200 -#define STK_MEM_END 0x0300 -#define STK_REPEAT_INC 0x0400 -/* avoided by normal-POP */ -#define STK_POS 0x0500 /* used when POP-POS */ -#define STK_STOP_BT 0x0600 /* mark for "(?>...)" */ -#define STK_REPEAT 0x0700 -#define STK_CALL_FRAME 0x0800 -#define STK_RETURN 0x0900 -#define STK_MEM_END_MARK 0x0a00 -#define STK_VOID 0x0b00 /* for fill a blank */ -#define STK_NULL_CHECK_END 0x0c00 /* for recursive call */ - -/* stack type check mask */ -#define STK_MASK_POP_USED 0x00ff -#define IS_TO_VOID_TARGET(stk) \ - (((stk)->type & STK_MASK_POP_USED) || (stk)->type == STK_NULL_CHECK_START) - -typedef struct { - void* stack_p; - int stack_n; - OnigOptionType options; - OnigRegion* region; - const UChar* start; /* search start position (for \G: BEGIN_POSITION) */ -} MatchArg; - -#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\ - (msa).stack_p = (void* )0;\ - (msa).options = (arg_option);\ - (msa).region = (arg_region);\ - (msa).start = (arg_start);\ -} while (0) - -#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p) - - -#define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\ - if (msa->stack_p) {\ - alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num));\ - stk_alloc = (StackType* )(msa->stack_p);\ - stk_base = stk_alloc;\ - stk = stk_base;\ - stk_end = stk_base + msa->stack_n;\ - }\ - else {\ - alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num)\ - + sizeof(StackType) * (stack_num));\ - stk_alloc = (StackType* )(alloc_addr + sizeof(char*) * (ptr_num));\ - stk_base = stk_alloc;\ - stk = stk_base;\ - stk_end = stk_base + (stack_num);\ - }\ -} while(0) - -#define STACK_SAVE do{\ - if (stk_base != stk_alloc) {\ - msa->stack_p = stk_base;\ - msa->stack_n = stk_end - stk_base;\ - };\ -} while(0) - -static unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE; - -extern unsigned int -onig_get_match_stack_limit_size(void) -{ - return MatchStackLimitSize; -} - -extern int -onig_set_match_stack_limit_size(unsigned int size) -{ - MatchStackLimitSize = size; - return 0; -} - -static int -stack_double(StackType** arg_stk_base, StackType** arg_stk_end, - StackType** arg_stk, StackType* stk_alloc, MatchArg* msa) -{ - unsigned int n; - StackType *x, *stk_base, *stk_end, *stk; - - stk_base = *arg_stk_base; - stk_end = *arg_stk_end; - stk = *arg_stk; - - n = stk_end - stk_base; - if (stk_base == stk_alloc && IS_NULL(msa->stack_p)) { - x = (StackType* )xmalloc(sizeof(StackType) * n * 2); - if (IS_NULL(x)) { - STACK_SAVE; - return ONIGERR_MEMORY; - } - xmemcpy(x, stk_base, n * sizeof(StackType)); - n *= 2; - } - else { - n *= 2; - if (MatchStackLimitSize != 0 && n > MatchStackLimitSize) { - if ((unsigned int )(stk_end - stk_base) == MatchStackLimitSize) - return ONIGERR_MATCH_STACK_LIMIT_OVER; - else - n = MatchStackLimitSize; - } - x = (StackType* )xrealloc(stk_base, sizeof(StackType) * n); - if (IS_NULL(x)) { - STACK_SAVE; - return ONIGERR_MEMORY; - } - } - *arg_stk = x + (stk - stk_base); - *arg_stk_base = x; - *arg_stk_end = x + n; - return 0; -} - -#define STACK_ENSURE(n) do {\ - if (stk_end - stk < (n)) {\ - int r = stack_double(&stk_base, &stk_end, &stk, stk_alloc, msa);\ - if (r != 0) { STACK_SAVE; return r; } \ - }\ -} while(0) - -#define STACK_AT(index) (stk_base + (index)) -#define GET_STACK_INDEX(stk) ((stk) - stk_base) - -#define STACK_PUSH(stack_type,pat,s,sprev) do {\ - STACK_ENSURE(1);\ - stk->type = (stack_type);\ - stk->u.state.pcode = (pat);\ - stk->u.state.pstr = (s);\ - stk->u.state.pstr_prev = (sprev);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_ENSURED(stack_type,pat) do {\ - stk->type = (stack_type);\ - stk->u.state.pcode = (pat);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_TYPE(stack_type) do {\ - STACK_ENSURE(1);\ - stk->type = (stack_type);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_ALT(pat,s,sprev) STACK_PUSH(STK_ALT,pat,s,sprev) -#define STACK_PUSH_POS(s,sprev) STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev) -#define STACK_PUSH_POS_NOT(pat,s,sprev) STACK_PUSH(STK_POS_NOT,pat,s,sprev) -#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT) -#define STACK_PUSH_LOOK_BEHIND_NOT(pat,s,sprev) \ - STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev) - -#define STACK_PUSH_REPEAT(id, pat) do {\ - STACK_ENSURE(1);\ - stk->type = STK_REPEAT;\ - stk->u.repeat.num = (id);\ - stk->u.repeat.pcode = (pat);\ - stk->u.repeat.count = 0;\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_REPEAT_INC(sindex) do {\ - STACK_ENSURE(1);\ - stk->type = STK_REPEAT_INC;\ - stk->u.repeat_inc.si = (sindex);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_MEM_START(mnum, s) do {\ - STACK_ENSURE(1);\ - stk->type = STK_MEM_START;\ - stk->u.mem.num = (mnum);\ - stk->u.mem.pstr = (s);\ - stk->u.mem.start = mem_start_stk[mnum];\ - stk->u.mem.end = mem_end_stk[mnum];\ - mem_start_stk[mnum] = GET_STACK_INDEX(stk);\ - mem_end_stk[mnum] = INVALID_STACK_INDEX;\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_MEM_END(mnum, s) do {\ - STACK_ENSURE(1);\ - stk->type = STK_MEM_END;\ - stk->u.mem.num = (mnum);\ - stk->u.mem.pstr = (s);\ - stk->u.mem.start = mem_start_stk[mnum];\ - stk->u.mem.end = mem_end_stk[mnum];\ - mem_end_stk[mnum] = GET_STACK_INDEX(stk);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_MEM_END_MARK(mnum) do {\ - STACK_ENSURE(1);\ - stk->type = STK_MEM_END_MARK;\ - stk->u.mem.num = (mnum);\ - STACK_INC;\ -} while(0) - -#define STACK_GET_MEM_START(mnum, k) do {\ - int level = 0;\ - k = stk;\ - while (k > stk_base) {\ - k--;\ - if ((k->type == STK_MEM_END_MARK || k->type == STK_MEM_END) \ - && k->u.mem.num == (mnum)) {\ - level++;\ - }\ - else if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\ - if (level == 0) break;\ - level--;\ - }\ - }\ -} while (0) - -#define STACK_GET_MEM_RANGE(k, mnum, start, end) do {\ - int level = 0;\ - while (k < stk) {\ - if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\ - if (level == 0) (start) = k->u.mem.pstr;\ - level++;\ - }\ - else if (k->type == STK_MEM_END && k->u.mem.num == (mnum)) {\ - level--;\ - if (level == 0) {\ - (end) = k->u.mem.pstr;\ - break;\ - }\ - }\ - k++;\ - }\ -} while (0) - -#define STACK_PUSH_NULL_CHECK_START(cnum, s) do {\ - STACK_ENSURE(1);\ - stk->type = STK_NULL_CHECK_START;\ - stk->u.null_check.num = (cnum);\ - stk->u.null_check.pstr = (s);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_NULL_CHECK_END(cnum) do {\ - STACK_ENSURE(1);\ - stk->type = STK_NULL_CHECK_END;\ - stk->u.null_check.num = (cnum);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_CALL_FRAME(pat) do {\ - STACK_ENSURE(1);\ - stk->type = STK_CALL_FRAME;\ - stk->u.call_frame.ret_addr = (pat);\ - STACK_INC;\ -} while(0) - -#define STACK_PUSH_RETURN do {\ - STACK_ENSURE(1);\ - stk->type = STK_RETURN;\ - STACK_INC;\ -} while(0) - - -#ifdef ONIG_DEBUG -#define STACK_BASE_CHECK(p) \ - if ((p) < stk_base) goto stack_error; -#else -#define STACK_BASE_CHECK(p) -#endif - -#define STACK_POP_ONE do {\ - stk--;\ - STACK_BASE_CHECK(stk); \ -} while(0) - -#define STACK_POP do {\ - switch (pop_level) {\ - case STACK_POP_LEVEL_FREE:\ - while (1) {\ - stk--;\ - STACK_BASE_CHECK(stk); \ - if ((stk->type & STK_MASK_POP_USED) != 0) break;\ - }\ - break;\ - case STACK_POP_LEVEL_MEM_START:\ - while (1) {\ - stk--;\ - STACK_BASE_CHECK(stk); \ - if ((stk->type & STK_MASK_POP_USED) != 0) break;\ - else if (stk->type == STK_MEM_START) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - }\ - break;\ - default:\ - while (1) {\ - stk--;\ - STACK_BASE_CHECK(stk); \ - if ((stk->type & STK_MASK_POP_USED) != 0) break;\ - else if (stk->type == STK_MEM_START) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - else if (stk->type == STK_REPEAT_INC) {\ - STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\ - }\ - else if (stk->type == STK_MEM_END) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - }\ - break;\ - }\ -} while(0) - -#define STACK_POP_TIL_POS_NOT do {\ - while (1) {\ - stk--;\ - STACK_BASE_CHECK(stk); \ - if (stk->type == STK_POS_NOT) break;\ - else if (stk->type == STK_MEM_START) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - else if (stk->type == STK_REPEAT_INC) {\ - STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\ - }\ - else if (stk->type == STK_MEM_END) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - }\ -} while(0) - -#define STACK_POP_TIL_LOOK_BEHIND_NOT do {\ - while (1) {\ - stk--;\ - STACK_BASE_CHECK(stk); \ - if (stk->type == STK_LOOK_BEHIND_NOT) break;\ - else if (stk->type == STK_MEM_START) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - else if (stk->type == STK_REPEAT_INC) {\ - STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\ - }\ - else if (stk->type == STK_MEM_END) {\ - mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\ - mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\ - }\ - }\ -} while(0) - -#define STACK_POS_END(k) do {\ - k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (IS_TO_VOID_TARGET(k)) {\ - k->type = STK_VOID;\ - }\ - else if (k->type == STK_POS) {\ - k->type = STK_VOID;\ - break;\ - }\ - }\ -} while(0) - -#define STACK_STOP_BT_END do {\ - StackType *k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (IS_TO_VOID_TARGET(k)) {\ - k->type = STK_VOID;\ - }\ - else if (k->type == STK_STOP_BT) {\ - k->type = STK_VOID;\ - break;\ - }\ - }\ -} while(0) - -#define STACK_NULL_CHECK(isnull,id,s) do {\ - StackType* k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_NULL_CHECK_START) {\ - if (k->u.null_check.num == (id)) {\ - (isnull) = (k->u.null_check.pstr == (s));\ - break;\ - }\ - }\ - }\ -} while(0) - -#define STACK_NULL_CHECK_REC(isnull,id,s) do {\ - int level = 0;\ - StackType* k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_NULL_CHECK_START) {\ - if (k->u.null_check.num == (id)) {\ - if (level == 0) {\ - (isnull) = (k->u.null_check.pstr == (s));\ - break;\ - }\ - else level--;\ - }\ - }\ - else if (k->type == STK_NULL_CHECK_END) {\ - level++;\ - }\ - }\ -} while(0) - -#define STACK_NULL_CHECK_MEMST(isnull,id,s,reg) do {\ - StackType* k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_NULL_CHECK_START) {\ - if (k->u.null_check.num == (id)) {\ - if (k->u.null_check.pstr != (s)) {\ - (isnull) = 0;\ - break;\ - }\ - else {\ - UChar* endp;\ - (isnull) = 1;\ - while (k < stk) {\ - if (k->type == STK_MEM_START) {\ - if (k->u.mem.end == INVALID_STACK_INDEX) {\ - (isnull) = 0; break;\ - }\ - if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\ - endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\ - else\ - endp = (UChar* )k->u.mem.end;\ - if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\ - (isnull) = 0; break;\ - }\ - else if (endp != s) {\ - (isnull) = -1; /* empty, but position changed */ \ - }\ - }\ - k++;\ - }\ - break;\ - }\ - }\ - }\ - }\ -} while(0) - -#define STACK_NULL_CHECK_MEMST_REC(isnull,id,s,reg) do {\ - int level = 0;\ - StackType* k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_NULL_CHECK_START) {\ - if (k->u.null_check.num == (id)) {\ - if (level == 0) {\ - if (k->u.null_check.pstr != (s)) {\ - (isnull) = 0;\ - break;\ - }\ - else {\ - UChar* endp;\ - (isnull) = 1;\ - while (k < stk) {\ - if (k->type == STK_MEM_START) {\ - if (k->u.mem.end == INVALID_STACK_INDEX) {\ - (isnull) = 0; break;\ - }\ - if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\ - endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\ - else\ - endp = (UChar* )k->u.mem.end;\ - if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\ - (isnull) = 0; break;\ - }\ - else if (endp != s) {\ - (isnull) = -1; /* empty, but position changed */ \ - }\ - }\ - k++;\ - }\ - break;\ - }\ - }\ - else {\ - level--;\ - }\ - }\ - }\ - else if (k->type == STK_NULL_CHECK_END) {\ - if (k->u.null_check.num == (id)) level++;\ - }\ - }\ -} while(0) - -#define STACK_GET_REPEAT(id, k) do {\ - int level = 0;\ - k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_REPEAT) {\ - if (level == 0) {\ - if (k->u.repeat.num == (id)) {\ - break;\ - }\ - }\ - }\ - else if (k->type == STK_CALL_FRAME) level--;\ - else if (k->type == STK_RETURN) level++;\ - }\ -} while (0) - -#define STACK_RETURN(addr) do {\ - int level = 0;\ - StackType* k = stk;\ - while (1) {\ - k--;\ - STACK_BASE_CHECK(k); \ - if (k->type == STK_CALL_FRAME) {\ - if (level == 0) {\ - (addr) = k->u.call_frame.ret_addr;\ - break;\ - }\ - else level--;\ - }\ - else if (k->type == STK_RETURN)\ - level++;\ - }\ -} while(0) - - -#define STRING_CMP(s1,s2,len) do {\ - while (len-- > 0) {\ - if (*s1++ != *s2++) goto fail;\ - }\ -} while(0) - -#define STRING_CMP_IC(ambig_flag,s1,ps2,len) do {\ - if (string_cmp_ic(encode, ambig_flag, s1, ps2, len) == 0) \ - goto fail; \ -} while(0) - -static int string_cmp_ic(OnigEncoding enc, int ambig_flag, - UChar* s1, UChar** ps2, int mblen) -{ - UChar buf1[ONIGENC_MBC_NORMALIZE_MAXLEN]; - UChar buf2[ONIGENC_MBC_NORMALIZE_MAXLEN]; - UChar *p1, *p2, *end, *s2, *end2; - int len1, len2; - - s2 = *ps2; - end = s1 + mblen; - end2 = s2 + mblen; - while (s1 < end) { - len1 = ONIGENC_MBC_TO_NORMALIZE(enc, ambig_flag, &s1, end, buf1); - len2 = ONIGENC_MBC_TO_NORMALIZE(enc, ambig_flag, &s2, end2, buf2); - if (len1 != len2) return 0; - p1 = buf1; - p2 = buf2; - while (len1-- > 0) { - if (*p1 != *p2) return 0; - p1++; - p2++; - } - } - - *ps2 = s2; - return 1; -} - -#define STRING_CMP_VALUE(s1,s2,len,is_fail) do {\ - is_fail = 0;\ - while (len-- > 0) {\ - if (*s1++ != *s2++) {\ - is_fail = 1; break;\ - }\ - }\ -} while(0) - -#define STRING_CMP_VALUE_IC(ambig_flag,s1,ps2,len,is_fail) do {\ - if (string_cmp_ic(encode, ambig_flag, s1, ps2, len) == 0) \ - is_fail = 1; \ - else \ - is_fail = 0; \ -} while(0) - -#define ON_STR_BEGIN(s) ((s) == str) -#define ON_STR_END(s) ((s) == end) -#define IS_EMPTY_STR (str == end) - -#define DATA_ENSURE(n) \ - if (s + (n) > end) goto fail - -#define DATA_ENSURE_CHECK(n) (s + (n) <= end) - -#ifdef USE_CAPTURE_HISTORY -static int -make_capture_history_tree(OnigCaptureTreeNode* node, StackType** kp, - StackType* stk_top, UChar* str, regex_t* reg) -{ - int n, r; - OnigCaptureTreeNode* child; - StackType* k = *kp; - - while (k < stk_top) { - if (k->type == STK_MEM_START) { - n = k->u.mem.num; - if (n <= ONIG_MAX_CAPTURE_HISTORY_GROUP && - BIT_STATUS_AT(reg->capture_history, n) != 0) { - child = history_node_new(); - CHECK_NULL_RETURN_VAL(child, ONIGERR_MEMORY); - child->group = n; - child->beg = (int )(k->u.mem.pstr - str); - r = history_tree_add_child(node, child); - if (r != 0) return r; - *kp = (k + 1); - r = make_capture_history_tree(child, kp, stk_top, str, reg); - if (r != 0) return r; - - k = *kp; - child->end = (int )(k->u.mem.pstr - str); - } - } - else if (k->type == STK_MEM_END) { - if (k->u.mem.num == node->group) { - node->end = (int )(k->u.mem.pstr - str); - *kp = k; - return 0; - } - } - k++; - } - - return 1; /* 1: root node ending. */ -} -#endif - -#ifdef RUBY_PLATFORM - -typedef struct { - int state; - regex_t* reg; - MatchArg* msa; - StackType* stk_base; -} TrapEnsureArg; - -static VALUE -trap_ensure(VALUE arg) -{ - TrapEnsureArg* ta = (TrapEnsureArg* )arg; - - if (ta->state == 0) { /* trap_exec() is not normal return */ - ONIG_STATE_DEC(ta->reg); - if (! IS_NULL(ta->msa->stack_p) && ta->stk_base != ta->msa->stack_p) - xfree(ta->stk_base); - - MATCH_ARG_FREE(*(ta->msa)); - } - - return Qnil; -} - -static VALUE -trap_exec(VALUE arg) -{ - TrapEnsureArg* ta; - - rb_trap_exec(); - - ta = (TrapEnsureArg* )arg; - ta->state = 1; /* normal return */ - return Qnil; -} - -extern void -onig_exec_trap(regex_t* reg, MatchArg* msa, StackType* stk_base) -{ - VALUE arg; - TrapEnsureArg ta; - - ta.state = 0; - ta.reg = reg; - ta.msa = msa; - ta.stk_base = stk_base; - arg = (VALUE )(&ta); - rb_ensure(trap_exec, arg, trap_ensure, arg); -} - -#define CHECK_INTERRUPT_IN_MATCH_AT do {\ - if (rb_trap_pending) {\ - if (! rb_prohibit_interrupt) {\ - onig_exec_trap(reg, msa, stk_base);\ - }\ - }\ -} while (0) -#else -#define CHECK_INTERRUPT_IN_MATCH_AT -#endif /* RUBY_PLATFORM */ - -#ifdef ONIG_DEBUG_STATISTICS - -#define USE_TIMEOFDAY - -#ifdef USE_TIMEOFDAY -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -static struct timeval ts, te; -#define GETTIME(t) gettimeofday(&(t), (struct timezone* )0) -#define TIMEDIFF(te,ts) (((te).tv_usec - (ts).tv_usec) + \ - (((te).tv_sec - (ts).tv_sec)*1000000)) -#else -#ifdef HAVE_SYS_TIMES_H -#include -#endif -static struct tms ts, te; -#define GETTIME(t) times(&(t)) -#define TIMEDIFF(te,ts) ((te).tms_utime - (ts).tms_utime) -#endif - -static int OpCounter[256]; -static int OpPrevCounter[256]; -static unsigned long OpTime[256]; -static int OpCurr = OP_FINISH; -static int OpPrevTarget = OP_FAIL; -static int MaxStackDepth = 0; - -#define STAT_OP_IN(opcode) do {\ - if (opcode == OpPrevTarget) OpPrevCounter[OpCurr]++;\ - OpCurr = opcode;\ - OpCounter[opcode]++;\ - GETTIME(ts);\ -} while (0) - -#define STAT_OP_OUT do {\ - GETTIME(te);\ - OpTime[OpCurr] += TIMEDIFF(te, ts);\ -} while (0) - -#ifdef RUBY_PLATFORM - -/* - * :nodoc: - */ -static VALUE onig_stat_print() -{ - onig_print_statistics(stderr); - return Qnil; -} -#endif - -extern void onig_statistics_init() -{ - int i; - for (i = 0; i < 256; i++) { - OpCounter[i] = OpPrevCounter[i] = 0; OpTime[i] = 0; - } - MaxStackDepth = 0; - -#ifdef RUBY_PLATFORM - rb_define_global_function("onig_stat_print", onig_stat_print, 0); -#endif -} - -extern void -onig_print_statistics(FILE* f) -{ - int i; - fprintf(f, " count prev time\n"); - for (i = 0; OnigOpInfo[i].opcode >= 0; i++) { - fprintf(f, "%8d: %8d: %10ld: %s\n", - OpCounter[i], OpPrevCounter[i], OpTime[i], OnigOpInfo[i].name); - } - fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth); -} - -#define STACK_INC do {\ - stk++;\ - if (stk - stk_base > MaxStackDepth) \ - MaxStackDepth = stk - stk_base;\ -} while (0) - -#else -#define STACK_INC stk++ - -#define STAT_OP_IN(opcode) -#define STAT_OP_OUT -#endif - -extern int -onig_is_in_code_range(const UChar* p, OnigCodePoint code) -{ - OnigCodePoint n, *data; - OnigCodePoint low, high, x; - - GET_CODE_POINT(n, p); - data = (OnigCodePoint* )p; - data++; - - for (low = 0, high = n; low < high; ) { - x = (low + high) >> 1; - if (code > data[x * 2 + 1]) - low = x + 1; - else - high = x; - } - - return ((low < n && code >= data[low * 2]) ? 1 : 0); -} - -static int -code_is_in_cclass_node(void* node, OnigCodePoint code, int enclen) -{ - unsigned int in_cc; - CClassNode* cc = (CClassNode* )node; - - if (enclen == 1) { - in_cc = BITSET_AT(cc->bs, code); - } - else { - UChar* p = ((BBuf* )(cc->mbuf))->p; - in_cc = onig_is_in_code_range(p, code); - } - - if (IS_CCLASS_NOT(cc)) { - return (in_cc ? 0 : 1); - } - else { - return (in_cc ? 1 : 0); - } -} - -/* matching region of POSIX API */ -typedef int regoff_t; - -typedef struct { - regoff_t rm_so; - regoff_t rm_eo; -} posix_regmatch_t; - -/* match data(str - end) from position (sstart). */ -/* if sstart == str then set sprev to NULL. */ -static int -match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart, - UChar* sprev, MatchArg* msa) -{ - static UChar FinishCode[] = { OP_FINISH }; - - int i, n, num_mem, best_len, pop_level; - LengthType tlen, tlen2; - MemNumType mem; - RelAddrType addr; - OnigOptionType option = reg->options; - OnigEncoding encode = reg->enc; - OnigAmbigType ambig_flag = reg->ambig_flag; - UChar *s, *q, *sbegin; - UChar *p = reg->p; - char *alloca_base; - StackType *stk_alloc, *stk_base, *stk, *stk_end; - StackType *stkp; /* used as any purpose. */ - StackIndex si; - StackIndex *repeat_stk; - StackIndex *mem_start_stk, *mem_end_stk; - n = reg->num_repeat + reg->num_mem * 2; - - STACK_INIT(alloca_base, n, INIT_MATCH_STACK_SIZE); - pop_level = reg->stack_pop_level; - num_mem = reg->num_mem; - repeat_stk = (StackIndex* )alloca_base; - - mem_start_stk = (StackIndex* )(repeat_stk + reg->num_repeat); - mem_end_stk = mem_start_stk + num_mem; - mem_start_stk--; /* for index start from 1, - mem_start_stk[1]..mem_start_stk[num_mem] */ - mem_end_stk--; /* for index start from 1, - mem_end_stk[1]..mem_end_stk[num_mem] */ - for (i = 1; i <= num_mem; i++) { - mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX; - } - -#ifdef ONIG_DEBUG_MATCH - fprintf(stderr, "match_at: str: %d, end: %d, start: %d, sprev: %d\n", - (int )str, (int )end, (int )sstart, (int )sprev); - fprintf(stderr, "size: %d, start offset: %d\n", - (int )(end - str), (int )(sstart - str)); -#endif - - STACK_PUSH_ENSURED(STK_ALT, FinishCode); /* bottom stack */ - best_len = ONIG_MISMATCH; - s = (UChar* )sstart; - while (1) { -#ifdef ONIG_DEBUG_MATCH - { - UChar *q, *bp, buf[50]; - int len; - fprintf(stderr, "%4d> \"", (int )(s - str)); - bp = buf; - for (i = 0, q = s; i < 7 && q < end; i++) { - len = enc_len(encode, q); - while (len-- > 0) *bp++ = *q++; - } - if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; } - else { xmemcpy(bp, "\"", 1); bp += 1; } - *bp = 0; - fputs(buf, stderr); - for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr); - onig_print_compiled_byte_code(stderr, p, NULL, encode); - fprintf(stderr, "\n"); - } -#endif - - sbegin = s; - switch (*p++) { - case OP_END: STAT_OP_IN(OP_END); - n = s - sstart; - if (n > best_len) { - OnigRegion* region = msa->region; - best_len = n; - if (region) { -#ifdef USE_POSIX_REGION_OPTION - if (IS_POSIX_REGION(msa->options)) { - posix_regmatch_t* rmt = (posix_regmatch_t* )region; - - rmt[0].rm_so = sstart - str; - rmt[0].rm_eo = s - str; - for (i = 1; i <= num_mem; i++) { - if (mem_end_stk[i] != INVALID_STACK_INDEX) { - if (BIT_STATUS_AT(reg->bt_mem_start, i)) - rmt[i].rm_so = STACK_AT(mem_start_stk[i])->u.mem.pstr - str; - else - rmt[i].rm_so = (UChar* )((void* )(mem_start_stk[i])) - str; - - rmt[i].rm_eo = (BIT_STATUS_AT(reg->bt_mem_end, i) - ? STACK_AT(mem_end_stk[i])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[i])) - str; - } - else { - rmt[i].rm_so = rmt[i].rm_eo = ONIG_REGION_NOTPOS; - } - } - } - else { -#endif /* USE_POSIX_REGION_OPTION */ - region->beg[0] = sstart - str; - region->end[0] = s - str; - for (i = 1; i <= num_mem; i++) { - if (mem_end_stk[i] != INVALID_STACK_INDEX) { - if (BIT_STATUS_AT(reg->bt_mem_start, i)) - region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str; - else - region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str; - - region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i) - ? STACK_AT(mem_end_stk[i])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[i])) - str; - } - else { - region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; - } - } - -#ifdef USE_CAPTURE_HISTORY - if (reg->capture_history != 0) { - int r; - OnigCaptureTreeNode* node; - - if (IS_NULL(region->history_root)) { - region->history_root = node = history_node_new(); - CHECK_NULL_RETURN_VAL(node, ONIGERR_MEMORY); - } - else { - node = region->history_root; - history_tree_clear(node); - } - - node->group = 0; - node->beg = sstart - str; - node->end = s - str; - - stkp = stk_base; - r = make_capture_history_tree(region->history_root, &stkp, - stk, (UChar* )str, reg); - if (r < 0) { - best_len = r; /* error code */ - goto finish; - } - } -#endif /* USE_CAPTURE_HISTORY */ -#ifdef USE_POSIX_REGION_OPTION - } /* else IS_POSIX_REGION() */ -#endif - } /* if (region) */ - } /* n > best_len */ - STAT_OP_OUT; - - if (IS_FIND_CONDITION(option)) { - if (IS_FIND_NOT_EMPTY(option) && s == sstart) { - best_len = ONIG_MISMATCH; - goto fail; /* for retry */ - } - if (IS_FIND_LONGEST(option) && s < end) { - goto fail; /* for retry */ - } - } - - /* default behavior: return first-matching result. */ - goto finish; - break; - - case OP_EXACT1: STAT_OP_IN(OP_EXACT1); -#if 0 - DATA_ENSURE(1); - if (*p != *s) goto fail; - p++; s++; -#endif - if (*p != *s++) goto fail; - DATA_ENSURE(0); - p++; - STAT_OP_OUT; - break; - - case OP_EXACT1_IC: STAT_OP_IN(OP_EXACT1_IC); - { - int len; - UChar *q, *ss, *sp, lowbuf[ONIGENC_MBC_NORMALIZE_MAXLEN]; - - DATA_ENSURE(1); - ss = s; - sp = p; - - exact1_ic_retry: - len = ONIGENC_MBC_TO_NORMALIZE(encode, ambig_flag, &s, end, lowbuf); - DATA_ENSURE(0); - q = lowbuf; - while (len-- > 0) { - if (*p != *q) { -#if 1 - if ((ambig_flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - ambig_flag &= ~ONIGENC_AMBIGUOUS_MATCH_COMPOUND; - s = ss; - p = sp; - goto exact1_ic_retry; - } - else - goto fail; -#else - goto fail; -#endif - } - p++; q++; - } - } - STAT_OP_OUT; - break; - - case OP_EXACT2: STAT_OP_IN(OP_EXACT2); - DATA_ENSURE(2); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - sprev = s; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACT3: STAT_OP_IN(OP_EXACT3); - DATA_ENSURE(3); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - sprev = s; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACT4: STAT_OP_IN(OP_EXACT4); - DATA_ENSURE(4); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - sprev = s; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACT5: STAT_OP_IN(OP_EXACT5); - DATA_ENSURE(5); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - sprev = s; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTN: STAT_OP_IN(OP_EXACTN); - GET_LENGTH_INC(tlen, p); - DATA_ENSURE(tlen); - while (tlen-- > 0) { - if (*p++ != *s++) goto fail; - } - sprev = s - 1; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTN_IC: STAT_OP_IN(OP_EXACTN_IC); - { - int len; - UChar *ss, *sp, *q, *endp, lowbuf[ONIGENC_MBC_NORMALIZE_MAXLEN]; - - GET_LENGTH_INC(tlen, p); - endp = p + tlen; - - while (p < endp) { - sprev = s; - DATA_ENSURE(1); - ss = s; - sp = p; - - exactn_ic_retry: - len = ONIGENC_MBC_TO_NORMALIZE(encode, ambig_flag, &s, end, lowbuf); - DATA_ENSURE(0); - q = lowbuf; - while (len-- > 0) { - if (*p != *q) { -#if 1 - if ((ambig_flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - ambig_flag &= ~ONIGENC_AMBIGUOUS_MATCH_COMPOUND; - s = ss; - p = sp; - goto exactn_ic_retry; - } - else - goto fail; -#else - goto fail; -#endif - } - p++; q++; - } - } - } - - STAT_OP_OUT; - continue; - break; - - case OP_EXACTMB2N1: STAT_OP_IN(OP_EXACTMB2N1); - DATA_ENSURE(2); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - STAT_OP_OUT; - break; - - case OP_EXACTMB2N2: STAT_OP_IN(OP_EXACTMB2N2); - DATA_ENSURE(4); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - sprev = s; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTMB2N3: STAT_OP_IN(OP_EXACTMB2N3); - DATA_ENSURE(6); - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - sprev = s; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTMB2N: STAT_OP_IN(OP_EXACTMB2N); - GET_LENGTH_INC(tlen, p); - DATA_ENSURE(tlen * 2); - while (tlen-- > 0) { - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - } - sprev = s - 2; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTMB3N: STAT_OP_IN(OP_EXACTMB3N); - GET_LENGTH_INC(tlen, p); - DATA_ENSURE(tlen * 3); - while (tlen-- > 0) { - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - if (*p != *s) goto fail; - p++; s++; - } - sprev = s - 3; - STAT_OP_OUT; - continue; - break; - - case OP_EXACTMBN: STAT_OP_IN(OP_EXACTMBN); - GET_LENGTH_INC(tlen, p); /* mb-len */ - GET_LENGTH_INC(tlen2, p); /* string len */ - tlen2 *= tlen; - DATA_ENSURE(tlen2); - while (tlen2-- > 0) { - if (*p != *s) goto fail; - p++; s++; - } - sprev = s - tlen; - STAT_OP_OUT; - continue; - break; - - case OP_CCLASS: STAT_OP_IN(OP_CCLASS); - DATA_ENSURE(1); - if (BITSET_AT(((BitSetRef )p), *s) == 0) goto fail; - p += SIZE_BITSET; - s += enc_len(encode, s); /* OP_CCLASS can match mb-code. \D, \S */ - STAT_OP_OUT; - break; - - case OP_CCLASS_MB: STAT_OP_IN(OP_CCLASS_MB); - if (! ONIGENC_IS_MBC_HEAD(encode, s)) goto fail; - - cclass_mb: - GET_LENGTH_INC(tlen, p); - { - OnigCodePoint code; - UChar *ss; - int mb_len; - - DATA_ENSURE(1); - mb_len = enc_len(encode, s); - DATA_ENSURE(mb_len); - ss = s; - s += mb_len; - code = ONIGENC_MBC_TO_CODE(encode, ss, s); - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - if (! onig_is_in_code_range(p, code)) goto fail; -#else - q = p; - ALIGNMENT_RIGHT(q); - if (! onig_is_in_code_range(q, code)) goto fail; -#endif - } - p += tlen; - STAT_OP_OUT; - break; - - case OP_CCLASS_MIX: STAT_OP_IN(OP_CCLASS_MIX); - DATA_ENSURE(1); - if (ONIGENC_IS_MBC_HEAD(encode, s)) { - p += SIZE_BITSET; - goto cclass_mb; - } - else { - if (BITSET_AT(((BitSetRef )p), *s) == 0) - goto fail; - - p += SIZE_BITSET; - GET_LENGTH_INC(tlen, p); - p += tlen; - s++; - } - STAT_OP_OUT; - break; - - case OP_CCLASS_NOT: STAT_OP_IN(OP_CCLASS_NOT); - DATA_ENSURE(1); - if (BITSET_AT(((BitSetRef )p), *s) != 0) goto fail; - p += SIZE_BITSET; - s += enc_len(encode, s); - STAT_OP_OUT; - break; - - case OP_CCLASS_MB_NOT: STAT_OP_IN(OP_CCLASS_MB_NOT); - DATA_ENSURE(1); - if (! ONIGENC_IS_MBC_HEAD(encode, s)) { - s++; - GET_LENGTH_INC(tlen, p); - p += tlen; - goto cc_mb_not_success; - } - - cclass_mb_not: - GET_LENGTH_INC(tlen, p); - { - OnigCodePoint code; - UChar *ss; - int mb_len = enc_len(encode, s); - - if (s + mb_len > end) { - DATA_ENSURE(1); - s = (UChar* )end; - p += tlen; - goto cc_mb_not_success; - } - - ss = s; - s += mb_len; - code = ONIGENC_MBC_TO_CODE(encode, ss, s); - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - if (onig_is_in_code_range(p, code)) goto fail; -#else - q = p; - ALIGNMENT_RIGHT(q); - if (onig_is_in_code_range(q, code)) goto fail; -#endif - } - p += tlen; - - cc_mb_not_success: - STAT_OP_OUT; - break; - - case OP_CCLASS_MIX_NOT: STAT_OP_IN(OP_CCLASS_MIX_NOT); - DATA_ENSURE(1); - if (ONIGENC_IS_MBC_HEAD(encode, s)) { - p += SIZE_BITSET; - goto cclass_mb_not; - } - else { - if (BITSET_AT(((BitSetRef )p), *s) != 0) - goto fail; - - p += SIZE_BITSET; - GET_LENGTH_INC(tlen, p); - p += tlen; - s++; - } - STAT_OP_OUT; - break; - - case OP_CCLASS_NODE: STAT_OP_IN(OP_CCLASS_NODE); - { - OnigCodePoint code; - void *node; - int mb_len; - UChar *ss; - - DATA_ENSURE(1); - GET_POINTER_INC(node, p); - mb_len = enc_len(encode, s); - ss = s; - s += mb_len; - code = ONIGENC_MBC_TO_CODE(encode, ss, s); - if (code_is_in_cclass_node(node, code, mb_len) == 0) goto fail; - } - STAT_OP_OUT; - break; - - case OP_ANYCHAR: STAT_OP_IN(OP_ANYCHAR); - DATA_ENSURE(1); - n = enc_len(encode, s); - DATA_ENSURE(n); - if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail; - s += n; - STAT_OP_OUT; - break; - - case OP_ANYCHAR_ML: STAT_OP_IN(OP_ANYCHAR_ML); - DATA_ENSURE(1); - n = enc_len(encode, s); - DATA_ENSURE(n); - s += n; - STAT_OP_OUT; - break; - - case OP_ANYCHAR_STAR: STAT_OP_IN(OP_ANYCHAR_STAR); - while (s < end) { - STACK_PUSH_ALT(p, s, sprev); - n = enc_len(encode, s); - DATA_ENSURE(n); - if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail; - sprev = s; - s += n; - } - STAT_OP_OUT; - break; - - case OP_ANYCHAR_ML_STAR: STAT_OP_IN(OP_ANYCHAR_ML_STAR); - while (s < end) { - STACK_PUSH_ALT(p, s, sprev); - n = enc_len(encode, s); - if (n > 1) { - DATA_ENSURE(n); - sprev = s; - s += n; - } - else { - sprev = s; - s++; - } - } - STAT_OP_OUT; - break; - - case OP_ANYCHAR_STAR_PEEK_NEXT: STAT_OP_IN(OP_ANYCHAR_STAR_PEEK_NEXT); - while (s < end) { - if (*p == *s) { - STACK_PUSH_ALT(p + 1, s, sprev); - } - n = enc_len(encode, s); - DATA_ENSURE(n); - if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail; - sprev = s; - s += n; - } - p++; - STAT_OP_OUT; - break; - - case OP_ANYCHAR_ML_STAR_PEEK_NEXT:STAT_OP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT); - while (s < end) { - if (*p == *s) { - STACK_PUSH_ALT(p + 1, s, sprev); - } - n = enc_len(encode, s); - if (n >1) { - DATA_ENSURE(n); - sprev = s; - s += n; - } - else { - sprev = s; - s++; - } - } - p++; - STAT_OP_OUT; - break; - - case OP_WORD: STAT_OP_IN(OP_WORD); - DATA_ENSURE(1); - if (! ONIGENC_IS_MBC_WORD(encode, s, end)) - goto fail; - - s += enc_len(encode, s); - STAT_OP_OUT; - break; - - case OP_NOT_WORD: STAT_OP_IN(OP_NOT_WORD); - DATA_ENSURE(1); - if (ONIGENC_IS_MBC_WORD(encode, s, end)) - goto fail; - - s += enc_len(encode, s); - STAT_OP_OUT; - break; - - case OP_WORD_BOUND: STAT_OP_IN(OP_WORD_BOUND); - if (ON_STR_BEGIN(s)) { - DATA_ENSURE(1); - if (! ONIGENC_IS_MBC_WORD(encode, s, end)) - goto fail; - } - else if (ON_STR_END(s)) { - if (! ONIGENC_IS_MBC_WORD(encode, sprev, end)) - goto fail; - } - else { - if (ONIGENC_IS_MBC_WORD(encode, s, end) - == ONIGENC_IS_MBC_WORD(encode, sprev, end)) - goto fail; - } - STAT_OP_OUT; - continue; - break; - - case OP_NOT_WORD_BOUND: STAT_OP_IN(OP_NOT_WORD_BOUND); - if (ON_STR_BEGIN(s)) { - if (DATA_ENSURE_CHECK(1) && ONIGENC_IS_MBC_WORD(encode, s, end)) - goto fail; - } - else if (ON_STR_END(s)) { - if (ONIGENC_IS_MBC_WORD(encode, sprev, end)) - goto fail; - } - else { - if (ONIGENC_IS_MBC_WORD(encode, s, end) - != ONIGENC_IS_MBC_WORD(encode, sprev, end)) - goto fail; - } - STAT_OP_OUT; - continue; - break; - -#ifdef USE_WORD_BEGIN_END - case OP_WORD_BEGIN: STAT_OP_IN(OP_WORD_BEGIN); - if (DATA_ENSURE_CHECK(1) && ONIGENC_IS_MBC_WORD(encode, s, end)) { - if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_WORD(encode, sprev, end)) { - STAT_OP_OUT; - continue; - } - } - goto fail; - break; - - case OP_WORD_END: STAT_OP_IN(OP_WORD_END); - if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_WORD(encode, sprev, end)) { - if (ON_STR_END(s) || !ONIGENC_IS_MBC_WORD(encode, s, end)) { - STAT_OP_OUT; - continue; - } - } - goto fail; - break; -#endif - - case OP_BEGIN_BUF: STAT_OP_IN(OP_BEGIN_BUF); - if (! ON_STR_BEGIN(s)) goto fail; - - STAT_OP_OUT; - continue; - break; - - case OP_END_BUF: STAT_OP_IN(OP_END_BUF); - if (! ON_STR_END(s)) goto fail; - - STAT_OP_OUT; - continue; - break; - - case OP_BEGIN_LINE: STAT_OP_IN(OP_BEGIN_LINE); - if (ON_STR_BEGIN(s)) { - if (IS_NOTBOL(msa->options)) goto fail; - STAT_OP_OUT; - continue; - } - else if (ONIGENC_IS_MBC_NEWLINE(encode, sprev, end) && !ON_STR_END(s)) { - STAT_OP_OUT; - continue; - } - goto fail; - break; - - case OP_END_LINE: STAT_OP_IN(OP_END_LINE); - if (ON_STR_END(s)) { -#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE - if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) { -#endif - if (IS_NOTEOL(msa->options)) goto fail; - STAT_OP_OUT; - continue; -#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE - } -#endif - } - else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) { - STAT_OP_OUT; - continue; - } - goto fail; - break; - - case OP_SEMI_END_BUF: STAT_OP_IN(OP_SEMI_END_BUF); - if (ON_STR_END(s)) { -#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE - if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) { -#endif - if (IS_NOTEOL(msa->options)) goto fail; /* Is it needed? */ - STAT_OP_OUT; - continue; -#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE - } -#endif - } - else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end) && - ON_STR_END(s + enc_len(encode, s))) { - STAT_OP_OUT; - continue; - } - goto fail; - break; - - case OP_BEGIN_POSITION: STAT_OP_IN(OP_BEGIN_POSITION); - if (s != msa->start) - goto fail; - - STAT_OP_OUT; - continue; - break; - - case OP_MEMORY_START_PUSH: STAT_OP_IN(OP_MEMORY_START_PUSH); - GET_MEMNUM_INC(mem, p); - STACK_PUSH_MEM_START(mem, s); - STAT_OP_OUT; - continue; - break; - - case OP_MEMORY_START: STAT_OP_IN(OP_MEMORY_START); - GET_MEMNUM_INC(mem, p); - mem_start_stk[mem] = (StackIndex )((void* )s); - STAT_OP_OUT; - continue; - break; - - case OP_MEMORY_END_PUSH: STAT_OP_IN(OP_MEMORY_END_PUSH); - GET_MEMNUM_INC(mem, p); - STACK_PUSH_MEM_END(mem, s); - STAT_OP_OUT; - continue; - break; - - case OP_MEMORY_END: STAT_OP_IN(OP_MEMORY_END); - GET_MEMNUM_INC(mem, p); - mem_end_stk[mem] = (StackIndex )((void* )s); - STAT_OP_OUT; - continue; - break; - -#ifdef USE_SUBEXP_CALL - case OP_MEMORY_END_PUSH_REC: STAT_OP_IN(OP_MEMORY_END_PUSH_REC); - GET_MEMNUM_INC(mem, p); - STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */ - STACK_PUSH_MEM_END(mem, s); - mem_start_stk[mem] = GET_STACK_INDEX(stkp); - STAT_OP_OUT; - continue; - break; - - case OP_MEMORY_END_REC: STAT_OP_IN(OP_MEMORY_END_REC); - GET_MEMNUM_INC(mem, p); - mem_end_stk[mem] = (StackIndex )((void* )s); - STACK_GET_MEM_START(mem, stkp); - - if (BIT_STATUS_AT(reg->bt_mem_start, mem)) - mem_start_stk[mem] = GET_STACK_INDEX(stkp); - else - mem_start_stk[mem] = (StackIndex )((void* )stkp->u.mem.pstr); - - STACK_PUSH_MEM_END_MARK(mem); - STAT_OP_OUT; - continue; - break; -#endif - - case OP_BACKREF1: STAT_OP_IN(OP_BACKREF1); - mem = 1; - goto backref; - break; - - case OP_BACKREF2: STAT_OP_IN(OP_BACKREF2); - mem = 2; - goto backref; - break; - - case OP_BACKREF3: STAT_OP_IN(OP_BACKREF3); - mem = 3; - goto backref; - break; - - case OP_BACKREFN: STAT_OP_IN(OP_BACKREFN); - GET_MEMNUM_INC(mem, p); - backref: - { - int len; - UChar *pstart, *pend; - - /* if you want to remove following line, - you should check in parse and compile time. */ - if (mem > num_mem) goto fail; - if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail; - if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail; - - if (BIT_STATUS_AT(reg->bt_mem_start, mem)) - pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; - else - pstart = (UChar* )((void* )mem_start_stk[mem]); - - pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) - ? STACK_AT(mem_end_stk[mem])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[mem])); - n = pend - pstart; - DATA_ENSURE(n); - sprev = s; - STRING_CMP(pstart, s, n); - while (sprev + (len = enc_len(encode, sprev)) < s) - sprev += len; - - STAT_OP_OUT; - continue; - } - break; - - case OP_BACKREFN_IC: STAT_OP_IN(OP_BACKREFN_IC); - GET_MEMNUM_INC(mem, p); - { - int len; - UChar *pstart, *pend; - - /* if you want to remove following line, - you should check in parse and compile time. */ - if (mem > num_mem) goto fail; - if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail; - if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail; - - if (BIT_STATUS_AT(reg->bt_mem_start, mem)) - pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; - else - pstart = (UChar* )((void* )mem_start_stk[mem]); - - pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) - ? STACK_AT(mem_end_stk[mem])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[mem])); - n = pend - pstart; - DATA_ENSURE(n); - sprev = s; - STRING_CMP_IC(ambig_flag, pstart, &s, n); - while (sprev + (len = enc_len(encode, sprev)) < s) - sprev += len; - - STAT_OP_OUT; - continue; - } - break; - - case OP_BACKREF_MULTI: STAT_OP_IN(OP_BACKREF_MULTI); - { - int len, is_fail; - UChar *pstart, *pend, *swork; - - GET_LENGTH_INC(tlen, p); - for (i = 0; i < tlen; i++) { - GET_MEMNUM_INC(mem, p); - - if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue; - if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue; - - if (BIT_STATUS_AT(reg->bt_mem_start, mem)) - pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; - else - pstart = (UChar* )((void* )mem_start_stk[mem]); - - pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) - ? STACK_AT(mem_end_stk[mem])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[mem])); - n = pend - pstart; - DATA_ENSURE(n); - sprev = s; - swork = s; - STRING_CMP_VALUE(pstart, swork, n, is_fail); - if (is_fail) continue; - s = swork; - while (sprev + (len = enc_len(encode, sprev)) < s) - sprev += len; - - p += (SIZE_MEMNUM * (tlen - i - 1)); - break; /* success */ - } - if (i == tlen) goto fail; - STAT_OP_OUT; - continue; - } - break; - - case OP_BACKREF_MULTI_IC: STAT_OP_IN(OP_BACKREF_MULTI_IC); - { - int len, is_fail; - UChar *pstart, *pend, *swork; - - GET_LENGTH_INC(tlen, p); - for (i = 0; i < tlen; i++) { - GET_MEMNUM_INC(mem, p); - - if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue; - if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue; - - if (BIT_STATUS_AT(reg->bt_mem_start, mem)) - pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; - else - pstart = (UChar* )((void* )mem_start_stk[mem]); - - pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) - ? STACK_AT(mem_end_stk[mem])->u.mem.pstr - : (UChar* )((void* )mem_end_stk[mem])); - n = pend - pstart; - DATA_ENSURE(n); - sprev = s; - swork = s; - STRING_CMP_VALUE_IC(ambig_flag, pstart, &swork, n, is_fail); - if (is_fail) continue; - s = swork; - while (sprev + (len = enc_len(encode, sprev)) < s) - sprev += len; - - p += (SIZE_MEMNUM * (tlen - i - 1)); - break; /* success */ - } - if (i == tlen) goto fail; - STAT_OP_OUT; - continue; - } - break; - - case OP_SET_OPTION_PUSH: STAT_OP_IN(OP_SET_OPTION_PUSH); - GET_OPTION_INC(option, p); - STACK_PUSH_ALT(p, s, sprev); - p += SIZE_OP_SET_OPTION + SIZE_OP_FAIL; - STAT_OP_OUT; - continue; - break; - - case OP_SET_OPTION: STAT_OP_IN(OP_SET_OPTION); - GET_OPTION_INC(option, p); - STAT_OP_OUT; - continue; - break; - - case OP_NULL_CHECK_START: STAT_OP_IN(OP_NULL_CHECK_START); - GET_MEMNUM_INC(mem, p); /* mem: null check id */ - STACK_PUSH_NULL_CHECK_START(mem, s); - STAT_OP_OUT; - continue; - break; - - case OP_NULL_CHECK_END: STAT_OP_IN(OP_NULL_CHECK_END); - { - int isnull; - - GET_MEMNUM_INC(mem, p); /* mem: null check id */ - STACK_NULL_CHECK(isnull, mem, s); - if (isnull) { -#ifdef ONIG_DEBUG_MATCH - fprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%d\n", - (int )mem, (int )s); -#endif - null_check_found: - /* empty loop founded, skip next instruction */ - switch (*p++) { - case OP_JUMP: - case OP_PUSH: - p += SIZE_RELADDR; - break; - case OP_REPEAT_INC: - case OP_REPEAT_INC_NG: - case OP_REPEAT_INC_SG: - case OP_REPEAT_INC_NG_SG: - p += SIZE_MEMNUM; - break; - default: - goto unexpected_bytecode_error; - break; - } - } - } - STAT_OP_OUT; - continue; - break; - -#ifdef USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK - case OP_NULL_CHECK_END_MEMST: STAT_OP_IN(OP_NULL_CHECK_END_MEMST); - { - int isnull; - - GET_MEMNUM_INC(mem, p); /* mem: null check id */ - STACK_NULL_CHECK_MEMST(isnull, mem, s, reg); - if (isnull) { -#ifdef ONIG_DEBUG_MATCH - fprintf(stderr, "NULL_CHECK_END_MEMST: skip id:%d, s:%d\n", - (int )mem, (int )s); -#endif - if (isnull == -1) goto fail; - goto null_check_found; - } - } - STAT_OP_OUT; - continue; - break; -#endif - -#ifdef USE_SUBEXP_CALL - case OP_NULL_CHECK_END_MEMST_PUSH: - STAT_OP_IN(OP_NULL_CHECK_END_MEMST_PUSH); - { - int isnull; - - GET_MEMNUM_INC(mem, p); /* mem: null check id */ -#ifdef USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK - STACK_NULL_CHECK_MEMST_REC(isnull, mem, s, reg); -#else - STACK_NULL_CHECK_REC(isnull, mem, s); -#endif - if (isnull) { -#ifdef ONIG_DEBUG_MATCH - fprintf(stderr, "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%d\n", - (int )mem, (int )s); -#endif - if (isnull == -1) goto fail; - goto null_check_found; - } - else { - STACK_PUSH_NULL_CHECK_END(mem); - } - } - STAT_OP_OUT; - continue; - break; -#endif - - case OP_JUMP: STAT_OP_IN(OP_JUMP); - GET_RELADDR_INC(addr, p); - p += addr; - STAT_OP_OUT; - CHECK_INTERRUPT_IN_MATCH_AT; - continue; - break; - - case OP_PUSH: STAT_OP_IN(OP_PUSH); - GET_RELADDR_INC(addr, p); - STACK_PUSH_ALT(p + addr, s, sprev); - STAT_OP_OUT; - continue; - break; - - case OP_POP: STAT_OP_IN(OP_POP); - STACK_POP_ONE; - STAT_OP_OUT; - continue; - break; - - case OP_PUSH_OR_JUMP_EXACT1: STAT_OP_IN(OP_PUSH_OR_JUMP_EXACT1); - GET_RELADDR_INC(addr, p); - if (*p == *s && DATA_ENSURE_CHECK(1)) { - p++; - STACK_PUSH_ALT(p + addr, s, sprev); - STAT_OP_OUT; - continue; - } - p += (addr + 1); - STAT_OP_OUT; - continue; - break; - - case OP_PUSH_IF_PEEK_NEXT: STAT_OP_IN(OP_PUSH_IF_PEEK_NEXT); - GET_RELADDR_INC(addr, p); - if (*p == *s) { - p++; - STACK_PUSH_ALT(p + addr, s, sprev); - STAT_OP_OUT; - continue; - } - p++; - STAT_OP_OUT; - continue; - break; - - case OP_REPEAT: STAT_OP_IN(OP_REPEAT); - { - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - GET_RELADDR_INC(addr, p); - - STACK_ENSURE(1); - repeat_stk[mem] = GET_STACK_INDEX(stk); - STACK_PUSH_REPEAT(mem, p); - - if (reg->repeat_range[mem].lower == 0) { - STACK_PUSH_ALT(p + addr, s, sprev); - } - } - STAT_OP_OUT; - continue; - break; - - case OP_REPEAT_NG: STAT_OP_IN(OP_REPEAT_NG); - { - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - GET_RELADDR_INC(addr, p); - - STACK_ENSURE(1); - repeat_stk[mem] = GET_STACK_INDEX(stk); - STACK_PUSH_REPEAT(mem, p); - - if (reg->repeat_range[mem].lower == 0) { - STACK_PUSH_ALT(p, s, sprev); - p += addr; - } - } - STAT_OP_OUT; - continue; - break; - - case OP_REPEAT_INC: STAT_OP_IN(OP_REPEAT_INC); - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - si = repeat_stk[mem]; - stkp = STACK_AT(si); - - repeat_inc: - stkp->u.repeat.count++; - if (stkp->u.repeat.count == reg->repeat_range[mem].upper) { - /* end of repeat. Nothing to do. */ - } - else if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) { - STACK_PUSH_ALT(p, s, sprev); - p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */ - } - else { - p = stkp->u.repeat.pcode; - } - STACK_PUSH_REPEAT_INC(si); - STAT_OP_OUT; - CHECK_INTERRUPT_IN_MATCH_AT; - continue; - break; - - case OP_REPEAT_INC_SG: STAT_OP_IN(OP_REPEAT_INC_SG); - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - STACK_GET_REPEAT(mem, stkp); - si = GET_STACK_INDEX(stkp); - goto repeat_inc; - break; - - case OP_REPEAT_INC_NG: STAT_OP_IN(OP_REPEAT_INC_NG); - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - si = repeat_stk[mem]; - stkp = STACK_AT(si); - - repeat_inc_ng: - stkp->u.repeat.count++; - if (stkp->u.repeat.count < reg->repeat_range[mem].upper || - IS_REPEAT_INFINITE(reg->repeat_range[mem].upper)) { - if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) { - UChar* pcode = stkp->u.repeat.pcode; - - STACK_PUSH_REPEAT_INC(si); - STACK_PUSH_ALT(pcode, s, sprev); - } - else { - p = stkp->u.repeat.pcode; - STACK_PUSH_REPEAT_INC(si); - } - } - else if (stkp->u.repeat.count == reg->repeat_range[mem].upper) { - STACK_PUSH_REPEAT_INC(si); - } - STAT_OP_OUT; - CHECK_INTERRUPT_IN_MATCH_AT; - continue; - break; - - case OP_REPEAT_INC_NG_SG: STAT_OP_IN(OP_REPEAT_INC_NG_SG); - GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ - STACK_GET_REPEAT(mem, stkp); - si = GET_STACK_INDEX(stkp); - goto repeat_inc_ng; - break; - - case OP_PUSH_POS: STAT_OP_IN(OP_PUSH_POS); - STACK_PUSH_POS(s, sprev); - STAT_OP_OUT; - continue; - break; - - case OP_POP_POS: STAT_OP_IN(OP_POP_POS); - { - STACK_POS_END(stkp); - s = stkp->u.state.pstr; - sprev = stkp->u.state.pstr_prev; - } - STAT_OP_OUT; - continue; - break; - - case OP_PUSH_POS_NOT: STAT_OP_IN(OP_PUSH_POS_NOT); - GET_RELADDR_INC(addr, p); - STACK_PUSH_POS_NOT(p + addr, s, sprev); - STAT_OP_OUT; - continue; - break; - - case OP_FAIL_POS: STAT_OP_IN(OP_FAIL_POS); - STACK_POP_TIL_POS_NOT; - goto fail; - break; - - case OP_PUSH_STOP_BT: STAT_OP_IN(OP_PUSH_STOP_BT); - STACK_PUSH_STOP_BT; - STAT_OP_OUT; - continue; - break; - - case OP_POP_STOP_BT: STAT_OP_IN(OP_POP_STOP_BT); - STACK_STOP_BT_END; - STAT_OP_OUT; - continue; - break; - - case OP_LOOK_BEHIND: STAT_OP_IN(OP_LOOK_BEHIND); - GET_LENGTH_INC(tlen, p); - s = (UChar* )ONIGENC_STEP_BACK(encode, str, s, (int )tlen); - if (IS_NULL(s)) goto fail; - sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s); - STAT_OP_OUT; - continue; - break; - - case OP_PUSH_LOOK_BEHIND_NOT: STAT_OP_IN(OP_PUSH_LOOK_BEHIND_NOT); - GET_RELADDR_INC(addr, p); - GET_LENGTH_INC(tlen, p); - q = (UChar* )ONIGENC_STEP_BACK(encode, str, s, (int )tlen); - if (IS_NULL(q)) { - /* too short case -> success. ex. /(?p + addr; - STAT_OP_OUT; - continue; - break; - - case OP_RETURN: STAT_OP_IN(OP_RETURN); - STACK_RETURN(p); - STACK_PUSH_RETURN; - STAT_OP_OUT; - continue; - break; -#endif - - case OP_FINISH: - goto finish; - break; - - fail: - STAT_OP_OUT; - /* fall */ - case OP_FAIL: STAT_OP_IN(OP_FAIL); - STACK_POP; - p = stk->u.state.pcode; - s = stk->u.state.pstr; - sprev = stk->u.state.pstr_prev; - STAT_OP_OUT; - continue; - break; - - default: - goto bytecode_error; - - } /* end of switch */ - sprev = sbegin; - } /* end of while(1) */ - - finish: - STACK_SAVE; - return best_len; - -#ifdef ONIG_DEBUG - stack_error: - STACK_SAVE; - return ONIGERR_STACK_BUG; -#endif - - bytecode_error: - STACK_SAVE; - return ONIGERR_UNDEFINED_BYTECODE; - - unexpected_bytecode_error: - STACK_SAVE; - return ONIGERR_UNEXPECTED_BYTECODE; -} - - -static UChar* -slow_search(OnigEncoding enc, UChar* target, UChar* target_end, - const UChar* text, const UChar* text_end, UChar* text_range) -{ - UChar *t, *p, *s, *end; - - end = (UChar* )text_end; - end -= target_end - target - 1; - if (end > text_range) - end = text_range; - - s = (UChar* )text; - - while (s < end) { - if (*s == *target) { - p = s + 1; - t = target + 1; - while (t < target_end) { - if (*t != *p++) - break; - t++; - } - if (t == target_end) - return s; - } - s += enc_len(enc, s); - } - - return (UChar* )NULL; -} - -static int -str_lower_case_match(OnigEncoding enc, int ambig_flag, - const UChar* t, const UChar* tend, - const UChar* p, const UChar* end) -{ - int lowlen; - UChar *q, lowbuf[ONIGENC_MBC_NORMALIZE_MAXLEN]; - const UChar* tsave; - const UChar* psave; - - tsave = t; - psave = p; - - retry: - while (t < tend) { - lowlen = ONIGENC_MBC_TO_NORMALIZE(enc, ambig_flag, &p, end, lowbuf); - q = lowbuf; - while (lowlen > 0) { - if (*t++ != *q++) { - if ((ambig_flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - ambig_flag &= ~ONIGENC_AMBIGUOUS_MATCH_COMPOUND; - t = tsave; - p = psave; - goto retry; - } - else - return 0; - } - lowlen--; - } - } - - return 1; -} - -static UChar* -slow_search_ic(OnigEncoding enc, int ambig_flag, - UChar* target, UChar* target_end, - const UChar* text, const UChar* text_end, UChar* text_range) -{ - UChar *s, *end; - - end = (UChar* )text_end; - end -= target_end - target - 1; - if (end > text_range) - end = text_range; - - s = (UChar* )text; - - while (s < end) { - if (str_lower_case_match(enc, ambig_flag, target, target_end, s, text_end)) - return s; - - s += enc_len(enc, s); - } - - return (UChar* )NULL; -} - -static UChar* -slow_search_backward(OnigEncoding enc, UChar* target, UChar* target_end, - const UChar* text, const UChar* adjust_text, - const UChar* text_end, const UChar* text_start) -{ - UChar *t, *p, *s; - - s = (UChar* )text_end; - s -= (target_end - target); - if (s > text_start) - s = (UChar* )text_start; - else - s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s); - - while (s >= text) { - if (*s == *target) { - p = s + 1; - t = target + 1; - while (t < target_end) { - if (*t != *p++) - break; - t++; - } - if (t == target_end) - return s; - } - s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s); - } - - return (UChar* )NULL; -} - -static UChar* -slow_search_backward_ic(OnigEncoding enc, int ambig_flag, - UChar* target, UChar* target_end, - const UChar* text, const UChar* adjust_text, - const UChar* text_end, const UChar* text_start) -{ - UChar *s; - - s = (UChar* )text_end; - s -= (target_end - target); - if (s > text_start) - s = (UChar* )text_start; - else - s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s); - - while (s >= text) { - if (str_lower_case_match(enc, ambig_flag, - target, target_end, s, text_end)) - return s; - - s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s); - } - - return (UChar* )NULL; -} - -static UChar* -bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end, - const UChar* text, const UChar* text_end, - const UChar* text_range) -{ - const UChar *s, *t, *p, *end; - const UChar *tail; - int skip; - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "bm_search_notrev: text: %d, text_end: %d, text_range: %d\n", - (int )text, (int )text_end, (int )text_range); -#endif - - end = text_range + (target_end - target) - 1; - if (end > text_end) - end = text_end; - - tail = target_end - 1; - s = text; - while ((s - text) < target_end - target) { - s += enc_len(reg->enc, s); - } - s--; /* set to text check tail position. */ - - if (IS_NULL(reg->int_map)) { - while (s < end) { - p = s; - t = tail; - while (t >= target && *p == *t) { - p--; t--; - } - if (t < target) return (UChar* )(p + 1); - - skip = reg->map[*s]; - p = s + 1; - if (p >= text_end) return (UChar* )NULL; - t = p; - do { - p += enc_len(reg->enc, p); - } while ((p - t) < skip && p < text_end); - - s += (p - t); - } - } - else { - while (s < end) { - p = s; - t = tail; - while (t >= target && *p == *t) { - p--; t--; - } - if (t < target) return (UChar* )(p + 1); - - skip = reg->int_map[*s]; - p = s + 1; - if (p >= text_end) return (UChar* )NULL; - t = p; - do { - p += enc_len(reg->enc, p); - } while ((p - t) < skip && p < text_end); - - s += (p - t); - } - } - return (UChar* )NULL; -} - -static UChar* -bm_search(regex_t* reg, const UChar* target, const UChar* target_end, - const UChar* text, const UChar* text_end, const UChar* text_range) -{ - const UChar *s, *t, *p, *end; - const UChar *tail; - - end = text_range + (target_end - target) - 1; - if (end > text_end) - end = text_end; - - tail = target_end - 1; - s = text + (target_end - target) - 1; - if (IS_NULL(reg->int_map)) { - while (s < end) { - p = s; - t = tail; - while (t >= target && *p == *t) { - p--; t--; - } - if (t < target) return (UChar* )(p + 1); - s += reg->map[*s]; - } - } - else { /* see int_map[] */ - while (s < end) { - p = s; - t = tail; - while (t >= target && *p == *t) { - p--; t--; - } - if (t < target) return (UChar* )(p + 1); - s += reg->int_map[*s]; - } - } - return (UChar* )NULL; -} - -static int -set_bm_backward_skip(UChar* s, UChar* end, OnigEncoding enc, int** skip) - -{ - int i, len; - - if (IS_NULL(*skip)) { - *skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE); - if (IS_NULL(*skip)) return ONIGERR_MEMORY; - } - - len = end - s; - for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) - (*skip)[i] = len; - - for (i = len - 1; i > 0; i--) - (*skip)[s[i]] = i; - - return 0; -} - -static UChar* -bm_search_backward(regex_t* reg, const UChar* target, const UChar* target_end, - const UChar* text, const UChar* adjust_text, - const UChar* text_end, const UChar* text_start) -{ - const UChar *s, *t, *p; - - s = text_end - (target_end - target); - if (text_start < s) - s = text_start; - else - s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s); - - while (s >= text) { - p = s; - t = target; - while (t < target_end && *p == *t) { - p++; t++; - } - if (t == target_end) - return (UChar* )s; - - s -= reg->int_map_backward[*s]; - s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s); - } - - return (UChar* )NULL; -} - -static UChar* -map_search(OnigEncoding enc, UChar map[], - const UChar* text, const UChar* text_range) -{ - const UChar *s = text; - - while (s < text_range) { - if (map[*s]) return (UChar* )s; - - s += enc_len(enc, s); - } - return (UChar* )NULL; -} - -static UChar* -map_search_backward(OnigEncoding enc, UChar map[], - const UChar* text, const UChar* adjust_text, - const UChar* text_start) -{ - const UChar *s = text_start; - - while (s >= text) { - if (map[*s]) return (UChar* )s; - - s = onigenc_get_prev_char_head(enc, adjust_text, s); - } - return (UChar* )NULL; -} - -extern int -onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region, - OnigOptionType option) -{ - int r; - UChar *prev; - MatchArg msa; - -#ifdef USE_MULTI_THREAD_SYSTEM - if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) { - ONIG_STATE_INC(reg); - if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) { - onig_chain_reduce(reg); - ONIG_STATE_INC(reg); - } - } - else { - int n = 0; - while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) { - if (++n > THREAD_PASS_LIMIT_COUNT) - return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT; - THREAD_PASS; - } - ONIG_STATE_INC(reg); - } -#endif /* USE_MULTI_THREAD_SYSTEM */ - - MATCH_ARG_INIT(msa, option, region, at); - - if (region -#ifdef USE_POSIX_REGION_OPTION - && !IS_POSIX_REGION(option) -#endif - ) { - r = onig_region_resize_clear(region, reg->num_mem + 1); - } - else - r = 0; - - if (r == 0) { - prev = (UChar* )onigenc_get_prev_char_head(reg->enc, str, at); - r = match_at(reg, str, end, at, prev, &msa); - } - - MATCH_ARG_FREE(msa); - ONIG_STATE_DEC(reg); - return r; -} - -static int -forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s, - UChar* range, UChar** low, UChar** high, UChar** low_prev) -{ - UChar *p, *pprev = (UChar* )NULL; - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n", - (int )str, (int )end, (int )s, (int )range); -#endif - - p = s; - if (reg->dmin > 0) { - if (ONIGENC_IS_SINGLEBYTE(reg->enc)) { - p += reg->dmin; - } - else { - UChar *q = p + reg->dmin; - while (p < q) p += enc_len(reg->enc, p); - } - } - - retry: - switch (reg->optimize) { - case ONIG_OPTIMIZE_EXACT: - p = slow_search(reg->enc, reg->exact, reg->exact_end, p, end, range); - break; - case ONIG_OPTIMIZE_EXACT_IC: - p = slow_search_ic(reg->enc, reg->ambig_flag, - reg->exact, reg->exact_end, p, end, range); - break; - - case ONIG_OPTIMIZE_EXACT_BM: - p = bm_search(reg, reg->exact, reg->exact_end, p, end, range); - break; - - case ONIG_OPTIMIZE_EXACT_BM_NOT_REV: - p = bm_search_notrev(reg, reg->exact, reg->exact_end, p, end, range); - break; - - case ONIG_OPTIMIZE_MAP: - p = map_search(reg->enc, reg->map, p, range); - break; - } - - if (p && p < range) { - if (p - reg->dmin < s) { - retry_gate: - pprev = p; - p += enc_len(reg->enc, p); - goto retry; - } - - if (reg->sub_anchor) { - UChar* prev; - - switch (reg->sub_anchor) { - case ANCHOR_BEGIN_LINE: - if (!ON_STR_BEGIN(p)) { - prev = onigenc_get_prev_char_head(reg->enc, - (pprev ? pprev : str), p); - if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) - goto retry_gate; - } - break; - - case ANCHOR_END_LINE: - if (ON_STR_END(p)) { - prev = (UChar* )onigenc_get_prev_char_head(reg->enc, - (pprev ? pprev : str), p); - if (prev && ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) - goto retry_gate; - } - else if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)) - goto retry_gate; - break; - } - } - - if (reg->dmax == 0) { - *low = p; - if (low_prev) { - if (*low > s) - *low_prev = onigenc_get_prev_char_head(reg->enc, s, p); - else - *low_prev = onigenc_get_prev_char_head(reg->enc, - (pprev ? pprev : str), p); - } - } - else { - if (reg->dmax != ONIG_INFINITE_DISTANCE) { - *low = p - reg->dmax; - if (*low > s) { - *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s, - *low, (const UChar** )low_prev); - if (low_prev && IS_NULL(*low_prev)) - *low_prev = onigenc_get_prev_char_head(reg->enc, - (pprev ? pprev : s), *low); - } - else { - if (low_prev) - *low_prev = onigenc_get_prev_char_head(reg->enc, - (pprev ? pprev : str), *low); - } - } - } - /* no needs to adjust *high, *high is used as range check only */ - *high = p - reg->dmin; - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, - "forward_search_range success: low: %d, high: %d, dmin: %d, dmax: %d\n", - (int )(*low - str), (int )(*high - str), reg->dmin, reg->dmax); -#endif - return 1; /* success */ - } - - return 0; /* fail */ -} - -static int set_bm_backward_skip P_((UChar* s, UChar* end, OnigEncoding enc, - int** skip)); - -#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD 100 - -static int -backward_search_range(regex_t* reg, const UChar* str, const UChar* end, - UChar* s, const UChar* range, UChar* adjrange, - UChar** low, UChar** high) -{ - int r; - UChar *p; - - range += reg->dmin; - p = s; - - retry: - switch (reg->optimize) { - case ONIG_OPTIMIZE_EXACT: - exact_method: - p = slow_search_backward(reg->enc, reg->exact, reg->exact_end, - range, adjrange, end, p); - break; - - case ONIG_OPTIMIZE_EXACT_IC: - p = slow_search_backward_ic(reg->enc, reg->ambig_flag, - reg->exact, reg->exact_end, - range, adjrange, end, p); - break; - - case ONIG_OPTIMIZE_EXACT_BM: - case ONIG_OPTIMIZE_EXACT_BM_NOT_REV: - if (IS_NULL(reg->int_map_backward)) { - if (s - range < BM_BACKWARD_SEARCH_LENGTH_THRESHOLD) - goto exact_method; - - r = set_bm_backward_skip(reg->exact, reg->exact_end, reg->enc, - &(reg->int_map_backward)); - if (r) return r; - } - p = bm_search_backward(reg, reg->exact, reg->exact_end, range, adjrange, - end, p); - break; - - case ONIG_OPTIMIZE_MAP: - p = map_search_backward(reg->enc, reg->map, range, adjrange, p); - break; - } - - if (p) { - if (reg->sub_anchor) { - UChar* prev; - - switch (reg->sub_anchor) { - case ANCHOR_BEGIN_LINE: - if (!ON_STR_BEGIN(p)) { - prev = onigenc_get_prev_char_head(reg->enc, adjrange, p); - if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) { - p = prev; - goto retry; - } - } - break; - - case ANCHOR_END_LINE: - if (ON_STR_END(p)) { - prev = onigenc_get_prev_char_head(reg->enc, adjrange, p); - if (IS_NULL(prev)) goto fail; - if (ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) { - p = prev; - goto retry; - } - } - else if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)) { - p = onigenc_get_prev_char_head(reg->enc, adjrange, p); - if (IS_NULL(p)) goto fail; - goto retry; - } - break; - } - } - - /* no needs to adjust *high, *high is used as range check only */ - if (reg->dmax != ONIG_INFINITE_DISTANCE) { - *low = p - reg->dmax; - *high = p - reg->dmin; - *high = onigenc_get_right_adjust_char_head(reg->enc, adjrange, *high); - } - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "backward_search_range: low: %d, high: %d\n", - (int )(*low - str), (int )(*high - str)); -#endif - return 1; /* success */ - } - - fail: -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "backward_search_range: fail.\n"); -#endif - return 0; /* fail */ -} - - -extern int -onig_search(regex_t* reg, const UChar* str, const UChar* end, - const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option) -{ - int r; - UChar *s, *prev; - MatchArg msa; - -#ifdef USE_MULTI_THREAD_SYSTEM - if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) { - ONIG_STATE_INC(reg); - if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) { - onig_chain_reduce(reg); - ONIG_STATE_INC(reg); - } - } - else { - int n = 0; - while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) { - if (++n > THREAD_PASS_LIMIT_COUNT) - return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT; - THREAD_PASS; - } - ONIG_STATE_INC(reg); - } -#endif /* USE_MULTI_THREAD_SYSTEM */ - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, - "onig_search (entry point): str: %d, end: %d, start: %d, range: %d\n", - (int )str, (int )(end - str), (int )(start - str), (int )(range - str)); -#endif - - if (region -#ifdef USE_POSIX_REGION_OPTION - && !IS_POSIX_REGION(option) -#endif - ) { - r = onig_region_resize_clear(region, reg->num_mem + 1); - if (r) goto finish_no_msa; - } - - if (start > end || start < str) goto mismatch_no_msa; - -#define MATCH_AND_RETURN_CHECK \ - r = match_at(reg, str, end, s, prev, &msa);\ - if (r != ONIG_MISMATCH) {\ - if (r >= 0) goto match;\ - goto finish; /* error */ \ - } - - /* anchor optimize: resume search range */ - if (reg->anchor != 0 && str < end) { - UChar* semi_end; - - if (reg->anchor & ANCHOR_BEGIN_POSITION) { - /* search start-position only */ - begin_position: - if (range > start) - range = start + 1; - else - range = start; - } - else if (reg->anchor & ANCHOR_BEGIN_BUF) { - /* search str-position only */ - if (range > start) { - if (start != str) goto mismatch_no_msa; - range = str + 1; - } - else { - if (range <= str) { - start = str; - range = str; - } - else - goto mismatch_no_msa; - } - } - else if (reg->anchor & ANCHOR_END_BUF) { - semi_end = (UChar* )end; - - end_buf: - if ((OnigDistance )(semi_end - str) < reg->anchor_dmin) - goto mismatch_no_msa; - - if (range > start) { - if ((OnigDistance )(semi_end - start) > reg->anchor_dmax) { - start = semi_end - reg->anchor_dmax; - if (start < end) - start = onigenc_get_right_adjust_char_head(reg->enc, str, start); - else { /* match with empty at end */ - start = onigenc_get_prev_char_head(reg->enc, str, end); - } - } - if ((OnigDistance )(semi_end - (range - 1)) < reg->anchor_dmin) { - range = semi_end - reg->anchor_dmin + 1; - } - - if (start >= range) goto mismatch_no_msa; - } - else { - if ((OnigDistance )(semi_end - range) > reg->anchor_dmax) { - range = semi_end - reg->anchor_dmax; - } - if ((OnigDistance )(semi_end - start) < reg->anchor_dmin) { - start = semi_end - reg->anchor_dmin; - start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, start); - if (range > start) goto mismatch_no_msa; - } - } - } - else if (reg->anchor & ANCHOR_SEMI_END_BUF) { - UChar* pre_end = ONIGENC_STEP_BACK(reg->enc, str, end, 1); - - if (ONIGENC_IS_MBC_NEWLINE(reg->enc, pre_end, end)) { - semi_end = pre_end; - if (semi_end > str && start <= semi_end) { - goto end_buf; - } - } - else { - semi_end = (UChar* )end; - goto end_buf; - } - } - else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_PL)) { - goto begin_position; - } - } - else if (str == end) { /* empty string */ - static const UChar* address_for_empty_string = ""; - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "onig_search: empty string.\n"); -#endif - - if (reg->threshold_len == 0) { - start = end = str = address_for_empty_string; - s = (UChar* )start; - prev = (UChar* )NULL; - - MATCH_ARG_INIT(msa, option, region, start); - MATCH_AND_RETURN_CHECK; - goto mismatch; - } - goto mismatch_no_msa; - } - -#ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "onig_search(apply anchor): end: %d, start: %d, range: %d\n", - (int )(end - str), (int )(start - str), (int )(range - str)); -#endif - - MATCH_ARG_INIT(msa, option, region, start); - - s = (UChar* )start; - if (range > start) { /* forward search */ - if (s > str) - prev = onigenc_get_prev_char_head(reg->enc, str, s); - else - prev = (UChar* )NULL; - - if (reg->optimize != ONIG_OPTIMIZE_NONE) { - UChar *sch_range, *low, *high, *low_prev; - - sch_range = (UChar* )range; - if (reg->dmax != 0) { - if (reg->dmax == ONIG_INFINITE_DISTANCE) - sch_range = (UChar* )end; - else { - sch_range += reg->dmax; - if (sch_range > end) sch_range = (UChar* )end; - } - } - - if ((end - start) < reg->threshold_len) - goto mismatch; - - if (reg->dmax != ONIG_INFINITE_DISTANCE) { - do { - if (! forward_search_range(reg, str, end, s, sch_range, - &low, &high, &low_prev)) goto mismatch; - if (s < low) { - s = low; - prev = low_prev; - } - while (s <= high) { - MATCH_AND_RETURN_CHECK; - prev = s; - s += enc_len(reg->enc, s); - } - } while (s < range); - goto mismatch; - } - else { /* check only. */ - if (! forward_search_range(reg, str, end, s, sch_range, - &low, &high, (UChar** )NULL)) goto mismatch; - - if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) { - do { - MATCH_AND_RETURN_CHECK; - prev = s; - s += enc_len(reg->enc, s); - - while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) { - prev = s; - s += enc_len(reg->enc, s); - } - } while (s < range); - goto mismatch; - } - } - } - - do { - MATCH_AND_RETURN_CHECK; - prev = s; - s += enc_len(reg->enc, s); - } while (s <= range); /* exec s == range, because empty match with /$/. */ - } - else { /* backward search */ - if (reg->optimize != ONIG_OPTIMIZE_NONE) { - UChar *low, *high, *adjrange, *sch_start; - - if (range < end) - adjrange = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, range); - else - adjrange = (UChar* )end; - - if (reg->dmax != ONIG_INFINITE_DISTANCE && - (end - range) >= reg->threshold_len) { - do { - sch_start = s + reg->dmax; - if (sch_start > end) sch_start = (UChar* )end; - if (backward_search_range(reg, str, end, sch_start, range, adjrange, - &low, &high) <= 0) - goto mismatch; - - if (s > high) - s = high; - - while (s >= low) { - prev = onigenc_get_prev_char_head(reg->enc, str, s); - MATCH_AND_RETURN_CHECK; - s = prev; - } - } while (s >= range); - goto mismatch; - } - else { /* check only. */ - if ((end - range) < reg->threshold_len) goto mismatch; - - sch_start = s; - if (reg->dmax != 0) { - if (reg->dmax == ONIG_INFINITE_DISTANCE) - sch_start = (UChar* )end; - else { - sch_start += reg->dmax; - if (sch_start > end) sch_start = (UChar* )end; - else - sch_start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, - start, sch_start); - } - } - if (backward_search_range(reg, str, end, sch_start, range, adjrange, - &low, &high) <= 0) goto mismatch; - } - } - - do { - prev = onigenc_get_prev_char_head(reg->enc, str, s); - MATCH_AND_RETURN_CHECK; - s = prev; - } while (s >= range); - } - - mismatch: - r = ONIG_MISMATCH; - - finish: - MATCH_ARG_FREE(msa); - ONIG_STATE_DEC(reg); - - /* If result is mismatch and no FIND_NOT_EMPTY option, - then the region is not setted in match_at(). */ - if (IS_FIND_NOT_EMPTY(reg->options) && region -#ifdef USE_POSIX_REGION_OPTION - && !IS_POSIX_REGION(option) -#endif - ) { - onig_region_clear(region); - } - -#ifdef ONIG_DEBUG - if (r != ONIG_MISMATCH) - fprintf(stderr, "onig_search: error %d\n", r); -#endif - return r; - - mismatch_no_msa: - r = ONIG_MISMATCH; - finish_no_msa: - ONIG_STATE_DEC(reg); -#ifdef ONIG_DEBUG - if (r != ONIG_MISMATCH) - fprintf(stderr, "onig_search: error %d\n", r); -#endif - return r; - - match: - ONIG_STATE_DEC(reg); - MATCH_ARG_FREE(msa); - return s - str; -} - -extern OnigEncoding -onig_get_encoding(regex_t* reg) -{ - return reg->enc; -} - -extern OnigOptionType -onig_get_options(regex_t* reg) -{ - return reg->options; -} - -extern OnigAmbigType -onig_get_ambig_flag(regex_t* reg) -{ - return reg->ambig_flag; -} - -extern OnigSyntaxType* -onig_get_syntax(regex_t* reg) -{ - return reg->syntax; -} - -extern int -onig_number_of_captures(regex_t* reg) -{ - return reg->num_mem; -} - -extern int -onig_number_of_capture_histories(regex_t* reg) -{ -#ifdef USE_CAPTURE_HISTORY - int i, n; - - n = 0; - for (i = 0; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) { - if (BIT_STATUS_AT(reg->capture_history, i) != 0) - n++; - } - return n; -#else - return 0; -#endif -} - -extern void -onig_copy_encoding(OnigEncoding to, OnigEncoding from) -{ - *to = *from; -} - diff --git a/ext/mbstring/oniguruma/regext.c b/ext/mbstring/oniguruma/regext.c deleted file mode 100755 index 6839708be7a37..0000000000000 --- a/ext/mbstring/oniguruma/regext.c +++ /dev/null @@ -1,213 +0,0 @@ -/********************************************************************** - regext.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -static void -conv_ext0be32(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = '\0'; - *conv++ = '\0'; - *conv++ = '\0'; - *conv++ = *s++; - } -} - -static void -conv_ext0le32(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = *s++; - *conv++ = '\0'; - *conv++ = '\0'; - *conv++ = '\0'; - } -} - -static void -conv_ext0be(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = '\0'; - *conv++ = *s++; - } -} - -static void -conv_ext0le(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = *s++; - *conv++ = '\0'; - } -} - -static void -conv_swap4bytes(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = s[3]; - *conv++ = s[2]; - *conv++ = s[1]; - *conv++ = s[0]; - s += 4; - } -} - -static void -conv_swap2bytes(const UChar* s, const UChar* end, UChar* conv) -{ - while (s < end) { - *conv++ = s[1]; - *conv++ = s[0]; - s += 2; - } -} - -static int -conv_encoding(OnigEncoding from, OnigEncoding to, const UChar* s, const UChar* end, - UChar** conv, UChar** conv_end) -{ - int len = end - s; - - if (to == ONIG_ENCODING_UTF16_BE) { - if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) { - *conv = (UChar* )xmalloc(len * 2); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + (len * 2); - conv_ext0be(s, end, *conv); - return 0; - } - else if (from == ONIG_ENCODING_UTF16_LE) { - swap16: - *conv = (UChar* )xmalloc(len); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + len; - conv_swap2bytes(s, end, *conv); - return 0; - } - } - else if (to == ONIG_ENCODING_UTF16_LE) { - if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) { - *conv = (UChar* )xmalloc(len * 2); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + (len * 2); - conv_ext0le(s, end, *conv); - return 0; - } - else if (from == ONIG_ENCODING_UTF16_BE) { - goto swap16; - } - } - if (to == ONIG_ENCODING_UTF32_BE) { - if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) { - *conv = (UChar* )xmalloc(len * 4); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + (len * 4); - conv_ext0be32(s, end, *conv); - return 0; - } - else if (from == ONIG_ENCODING_UTF32_LE) { - swap32: - *conv = (UChar* )xmalloc(len); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + len; - conv_swap4bytes(s, end, *conv); - return 0; - } - } - else if (to == ONIG_ENCODING_UTF32_LE) { - if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) { - *conv = (UChar* )xmalloc(len * 4); - CHECK_NULL_RETURN_VAL(*conv, ONIGERR_MEMORY); - *conv_end = *conv + (len * 4); - conv_ext0le32(s, end, *conv); - return 0; - } - else if (from == ONIG_ENCODING_UTF32_BE) { - goto swap32; - } - } - - return ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION; -} - -extern int -onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end, - OnigCompileInfo* ci, OnigErrorInfo* einfo) -{ - int r; - UChar *cpat, *cpat_end; - - if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL; - - if (ci->pattern_enc != ci->target_enc) { - r = conv_encoding(ci->pattern_enc, ci->target_enc, pattern, pattern_end, - &cpat, &cpat_end); - if (r) return r; - } - else { - cpat = (UChar* )pattern; - cpat_end = (UChar* )pattern_end; - } - - r = onig_alloc_init(reg, ci->option, ci->ambig_flag, ci->target_enc, - ci->syntax); - if (r) goto err; - - r = onig_compile(*reg, cpat, cpat_end, einfo); - if (r) { - onig_free(*reg); - *reg = NULL; - } - - err: - if (cpat != pattern) xfree(cpat); - - return r; -} - -extern int -onig_recompile_deluxe(regex_t* reg, const UChar* pattern, const UChar* pattern_end, - OnigCompileInfo* ci, OnigErrorInfo* einfo) -{ - int r; - regex_t *new_reg; - - r = onig_new_deluxe(&new_reg, pattern, pattern_end, ci, einfo); - if (r) return r; - if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) { - onig_transfer(reg, new_reg); - } - else { - onig_chain_link_add(reg, new_reg); - } - return 0; -} diff --git a/ext/mbstring/oniguruma/reggnu.c b/ext/mbstring/oniguruma/reggnu.c deleted file mode 100644 index 70e8582ff2a85..0000000000000 --- a/ext/mbstring/oniguruma/reggnu.c +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************** - reggnu.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -#ifndef ONIGGNU_H -#include "oniggnu.h" -#endif - -extern void -re_free_registers(OnigRegion* r) -{ - /* 0: don't free self */ - onig_region_free(r, 0); -} - -extern int -re_adjust_startpos(regex_t* reg, const char* string, int size, - int startpos, int range) -{ - if (startpos > 0 && ONIGENC_MBC_MAXLEN(reg->enc) != 1 && startpos < size) { - UChar *p; - UChar *s = (UChar* )string + startpos; - - if (range > 0) { - p = onigenc_get_right_adjust_char_head(reg->enc, (UChar* )string, s); - } - else { - p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, (UChar* )string, s); - } - return p - (UChar* )string; - } - - return startpos; -} - -extern int -re_match(regex_t* reg, const char* str, int size, int pos, - struct re_registers* regs) -{ - return onig_match(reg, (UChar* )str, (UChar* )(str + size), - (UChar* )(str + pos), regs, ONIG_OPTION_NONE); -} - -extern int -re_search(regex_t* bufp, const char* string, int size, int startpos, int range, - struct re_registers* regs) -{ - return onig_search(bufp, (UChar* )string, (UChar* )(string + size), - (UChar* )(string + startpos), - (UChar* )(string + startpos + range), - regs, ONIG_OPTION_NONE); -} - -extern int -re_compile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf) -{ - int r; - OnigErrorInfo einfo; - - r = onig_compile(reg, (UChar* )pattern, (UChar* )(pattern + size), &einfo); - if (r != 0) { - if (IS_NOT_NULL(ebuf)) - (void )onig_error_code_to_str((UChar* )ebuf, r, &einfo); - } - - return r; -} - -extern int -re_recompile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf) -{ - int r; - OnigErrorInfo einfo; - OnigEncoding enc; - - /* I think encoding and options should be arguments of this function. - But this is adapted to present re.c. (2002/11/29) - */ - enc = OnigEncDefaultCharEncoding; - - r = onig_recompile(reg, (UChar* )pattern, (UChar* )(pattern + size), - reg->options, enc, OnigDefaultSyntax, &einfo); - if (r != 0) { - if (IS_NOT_NULL(ebuf)) - (void )onig_error_code_to_str((UChar* )ebuf, r, &einfo); - } - return r; -} - -extern void -re_free_pattern(regex_t* reg) -{ - onig_free(reg); -} - -extern int -re_alloc_pattern(regex_t** reg) -{ - return onig_alloc_init(reg, ONIG_OPTION_DEFAULT, - ONIGENC_AMBIGUOUS_MATCH_DEFAULT, - OnigEncDefaultCharEncoding, - OnigDefaultSyntax); -} - -extern void -re_set_casetable(const char* table) -{ - onigenc_set_default_caseconv_table((UChar* )table); -} - -extern void -#ifdef ONIG_RUBY_M17N -re_mbcinit(OnigEncoding enc) -#else -re_mbcinit(int mb_code) -#endif -{ -#ifdef ONIG_RUBY_M17N - - onigenc_set_default_encoding(enc); - -#else - - OnigEncoding enc; - - switch (mb_code) { - case MBCTYPE_ASCII: - enc = ONIG_ENCODING_ASCII; - break; - case MBCTYPE_EUC: - enc = ONIG_ENCODING_EUC_JP; - break; - case MBCTYPE_SJIS: - enc = ONIG_ENCODING_SJIS; - break; - case MBCTYPE_UTF8: - enc = ONIG_ENCODING_UTF8; - break; - default: - return ; - break; - } - - onigenc_set_default_encoding(enc); -#endif -} diff --git a/ext/mbstring/oniguruma/regint.h b/ext/mbstring/oniguruma/regint.h deleted file mode 100644 index 2bd514b7c3746..0000000000000 --- a/ext/mbstring/oniguruma/regint.h +++ /dev/null @@ -1,793 +0,0 @@ -#ifndef REGINT_H -#define REGINT_H -/********************************************************************** - regint.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -/* for debug */ -/* #define ONIG_DEBUG_PARSE_TREE */ -/* #define ONIG_DEBUG_COMPILE */ -/* #define ONIG_DEBUG_SEARCH */ -/* #define ONIG_DEBUG_MATCH */ -/* #define ONIG_DONT_OPTIMIZE */ - -/* for byte-code statistical data. */ -/* #define ONIG_DEBUG_STATISTICS */ - -#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \ - defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \ - defined(ONIG_DEBUG_STATISTICS) -#ifndef ONIG_DEBUG -#define ONIG_DEBUG -#endif -#endif - -#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ - (defined(__ppc__) && defined(__APPLE__)) || \ - defined(__x86_64) || defined(__x86_64__) || \ - defined(__mc68020__) -#define PLATFORM_UNALIGNED_WORD_ACCESS -#endif - -/* config */ -/* spec. config */ -/* #define USE_UNICODE_FULL_RANGE_CTYPE */ /* --> move to regenc.h */ -#define USE_NAMED_GROUP -#define USE_SUBEXP_CALL -#define USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK /* /(?:()|())*\2/ */ -#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */ -#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR -/* internal config */ -#define USE_RECYCLE_NODE -#define USE_OP_PUSH_OR_JUMP_EXACT -#define USE_QUALIFIER_PEEK_NEXT -#define USE_ST_HASH_TABLE -#define USE_SHARED_CCLASS_TABLE - -#define INIT_MATCH_STACK_SIZE 160 -#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */ - -/* interface to external system */ -#ifdef NOT_RUBY /* given from Makefile */ -#include "config.h" -#define USE_CAPTURE_HISTORY -#define USE_VARIABLE_META_CHARS -#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */ -#define USE_POSIX_REGION_OPTION /* needed for POSIX API support */ -/* #define USE_MULTI_THREAD_SYSTEM */ -#define THREAD_ATOMIC_START /* depend on thread system */ -#define THREAD_ATOMIC_END /* depend on thread system */ -#define THREAD_PASS /* depend on thread system */ -#define CHECK_INTERRUPT /* depend on application */ -#define xmalloc malloc -#define xrealloc realloc -#define xcalloc calloc -#define xfree free -#else -#include "ruby.h" -#include "version.h" -#include "rubysig.h" /* for DEFER_INTS, ENABLE_INTS */ - -#define USE_MULTI_THREAD_SYSTEM -#define THREAD_ATOMIC_START DEFER_INTS -#define THREAD_ATOMIC_END ENABLE_INTS -#define THREAD_PASS rb_thread_schedule() -#define CHECK_INTERRUPT do {\ - if (rb_trap_pending) {\ - if (! rb_prohibit_interrupt) {\ - rb_trap_exec();\ - }\ - }\ -} while (0) - -#define DEFAULT_WARN_FUNCTION rb_warn -#define DEFAULT_VERB_WARN_FUNCTION rb_warning - -#endif /* else NOT_RUBY */ - -#define THREAD_PASS_LIMIT_COUNT 8 -#define xmemset memset -#define xmemcpy memcpy -#define xmemmove memmove -#if defined(_WIN32) && !defined(__GNUC__) -#define xalloca _alloca -#ifdef NOT_RUBY -#define vsnprintf _vsnprintf -#endif -#else -#define xalloca alloca -#endif - - -#ifdef USE_MULTI_THREAD_SYSTEM -#define ONIG_STATE_INC(reg) (reg)->state++ -#define ONIG_STATE_DEC(reg) (reg)->state-- -#else -#define ONIG_STATE_INC(reg) /* Nothing */ -#define ONIG_STATE_DEC(reg) /* Nothing */ -#endif /* USE_MULTI_THREAD_SYSTEM */ - - -#define onig_st_is_member st_is_member - -#ifdef NOT_RUBY - -#define st_init_table onig_st_init_table -#define st_init_table_with_size onig_st_init_table_with_size -#define st_init_numtable onig_st_init_numtable -#define st_init_numtable_with_size onig_st_init_numtable_with_size -#define st_init_strtable onig_st_init_strtable -#define st_init_strtable_with_size onig_st_init_strtable_with_size -#define st_init_strend_table_with_size onig_st_init_strend_table_with_size -#define st_delete onig_st_delete -#define st_delete_safe onig_st_delete_safe -#define st_insert onig_st_insert -#define st_insert_strend onig_st_insert_strend -#define st_lookup onig_st_lookup -#define st_lookup_strend onig_st_lookup_strend -#define st_foreach onig_st_foreach -#define st_add_direct onig_st_add_direct -#define st_add_direct_strend onig_st_add_direct_strend -#define st_free_table onig_st_free_table -#define st_cleanup_safe onig_st_cleanup_safe -#define st_copy onig_st_copy -#define st_nothing_key_clone onig_st_nothing_key_clone -#define st_nothing_key_free onig_st_nothing_key_free - -#else /* NOT_RUBY */ - -#define onig_st_init_table st_init_table -#define onig_st_init_table_with_size st_init_table_with_size -#define onig_st_init_numtable st_init_numtable -#define onig_st_init_numtable_with_size st_init_numtable_with_size -#define onig_st_init_strtable st_init_strtable -#define onig_st_init_strtable_with_size st_init_strtable_with_size -#define onig_st_init_strend_table_with_size st_init_strend_table_with_size -#define onig_st_delete st_delete -#define onig_st_delete_safe st_delete_safe -#define onig_st_insert st_insert -#define onig_st_insert_strend st_insert_strend -#define onig_st_lookup st_lookup -#define onig_st_lookup_strend st_lookup_strend -#define onig_st_foreach st_foreach -#define onig_st_add_direct st_add_direct -#define onig_st_add_direct_strend st_add_direct_strend -#define onig_st_free_table st_free_table -#define onig_st_cleanup_safe st_cleanup_safe -#define onig_st_copy st_copy -#define onig_st_nothing_key_clone st_nothing_key_clone -#define onig_st_nothing_key_free st_nothing_key_free - -#endif /* NOT_RUBY */ - - -#ifdef HAVE_STDLIB_H -#include -#endif - -#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__) -#include -#endif - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -#include -#ifdef HAVE_SYS_TYPES_H -#ifndef __BORLANDC__ -#include -#endif -#endif - -#ifdef ONIG_DEBUG -# include -#endif - -#include "regenc.h" -#include "oniguruma.h" - -#ifdef MIN -#undef MIN -#endif -#ifdef MAX -#undef MAX -#endif -#define MIN(a,b) (((a)>(b))?(b):(a)) -#define MAX(a,b) (((a)<(b))?(b):(a)) - -#define IS_NULL(p) (((void*)(p)) == (void*)0) -#define IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define CHECK_NULL_RETURN(p) if (IS_NULL(p)) return NULL -#define CHECK_NULL_RETURN_VAL(p,val) if (IS_NULL(p)) return (val) -#define NULL_UCHARP ((UChar* )0) - -#ifndef PLATFORM_UNALIGNED_WORD_ACCESS -#define WORD_ALIGNMENT_SIZE SIZEOF_INT - -#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ - (pad_size) = WORD_ALIGNMENT_SIZE \ - - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ - if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\ -} while (0) - -#define ALIGNMENT_RIGHT(addr) do {\ - (addr) += (WORD_ALIGNMENT_SIZE - 1);\ - (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ -} while (0) - - -#define B_SHIFT 8 -#define B_MASK 0xff - -#define SERIALIZE_2BYTE_INT(i,p) do {\ - *(p) = ((i) >> B_SHIFT) & B_MASK;\ - *((p)+1) = (i) & B_MASK;\ -} while (0) - -#define SERIALIZE_4BYTE_INT(i,p) do {\ - *(p) = ((i) >> B_SHIFT*3) & B_MASK;\ - *((p)+1) = ((i) >> B_SHIFT*2) & B_MASK;\ - *((p)+2) = ((i) >> B_SHIFT ) & B_MASK;\ - *((p)+3) = (i) & B_MASK;\ -} while (0) - -#define SERIALIZE_8BYTE_INT(i,p) do {\ - *(p) = ((i) >> B_SHIFT*7) & B_MASK;\ - *((p)+1) = ((i) >> B_SHIFT*6) & B_MASK;\ - *((p)+2) = ((i) >> B_SHIFT*5) & B_MASK;\ - *((p)+3) = ((i) >> B_SHIFT*4) & B_MASK;\ - *((p)+4) = ((i) >> B_SHIFT*3) & B_MASK;\ - *((p)+5) = ((i) >> B_SHIFT*2) & B_MASK;\ - *((p)+6) = ((i) >> B_SHIFT ) & B_MASK;\ - *((p)+7) = (i) & B_MASK;\ -} while (0) - -#define GET_2BYTE_INT_INC(type,i,p) do {\ - (i) = (type )(((unsigned int )(*(p)) << B_SHIFT) | (unsigned int )((p)[1]));\ - (p) += 2;\ -} while (0) - -#define GET_4BYTE_INT_INC(type,i,p) do {\ - (i) = (type )(((unsigned int )((p)[0]) << B_SHIFT*3) | \ - ((unsigned int )((p)[1]) << B_SHIFT*2) | \ - ((unsigned int )((p)[2]) << B_SHIFT ) | \ - ((unsigned int )((p)[3]) )); \ - (p) += 4;\ -} while (0) - -#define GET_8BYTE_INT_INC(type,i,p) do {\ - (i) = (type )(((unsigned long )((p)[0]) << B_SHIFT*7) | \ - ((unsigned long )((p)[1]) << B_SHIFT*6) | \ - ((unsigned long )((p)[2]) << B_SHIFT*5) | \ - ((unsigned long )((p)[3]) << B_SHIFT*4) | \ - ((unsigned long )((p)[4]) << B_SHIFT*3) | \ - ((unsigned long )((p)[5]) << B_SHIFT*2) | \ - ((unsigned long )((p)[6]) << B_SHIFT ) | \ - ((unsigned long )((p)[7]) )); \ - (p) += 8;\ -} while (0) - -#if SIZEOF_SHORT == 2 -#define GET_SHORT_INC(i,p) GET_2BYTE_INT_INC(short,i,p) -#define SERIALIZE_SHORT(i,p) SERIALIZE_2BYTE_INT(i,p) -#elif SIZEOF_SHORT == 4 -#define GET_SHORT_INC(i,p) GET_4BYTE_INT_INC(short,i,p) -#define SERIALIZE_SHORT(i,p) SERIALIZE_4BYTE_INT(i,p) -#elif SIZEOF_SHORT == 8 -#define GET_SHORT_INC(i,p) GET_8BYTE_INT_INC(short,i,p) -#define SERIALIZE_SHORT(i,p) SERIALIZE_8BYTE_INT(i,p) -#endif - -#if SIZEOF_INT == 2 -#define GET_INT_INC(i,p) GET_2BYTE_INT_INC(int,i,p) -#define GET_UINT_INC(i,p) GET_2BYTE_INT_INC(unsigned,i,p) -#define SERIALIZE_INT(i,p) SERIALIZE_2BYTE_INT(i,p) -#define SERIALIZE_UINT(i,p) SERIALIZE_2BYTE_INT(i,p) -#elif SIZEOF_INT == 4 -#define GET_INT_INC(i,p) GET_4BYTE_INT_INC(int,i,p) -#define GET_UINT_INC(i,p) GET_4BYTE_INT_INC(unsigned,i,p) -#define SERIALIZE_INT(i,p) SERIALIZE_4BYTE_INT(i,p) -#define SERIALIZE_UINT(i,p) SERIALIZE_4BYTE_INT(i,p) -#elif SIZEOF_INT == 8 -#define GET_INT_INC(i,p) GET_8BYTE_INT_INC(int,i,p) -#define GET_UINT_INC(i,p) GET_8BYTE_INT_INC(unsigned,i,p) -#define SERIALIZE_INT(i,p) SERIALIZE_8BYTE_INT(i,p) -#define SERIALIZE_UINT(i,p) SERIALIZE_8BYTE_INT(i,p) -#endif - -#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ - -/* stack pop level */ -#define STACK_POP_LEVEL_FREE 0 -#define STACK_POP_LEVEL_MEM_START 1 -#define STACK_POP_LEVEL_ALL 2 - -/* optimize flags */ -#define ONIG_OPTIMIZE_NONE 0 -#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */ -#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */ -#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV 3 /* BM (but not simple match) */ -#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */ -#define ONIG_OPTIMIZE_MAP 5 /* char map */ - -/* bit status */ -typedef unsigned int BitStatusType; - -#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8) -#define BIT_STATUS_CLEAR(stats) (stats) = 0 -#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0) -#define BIT_STATUS_AT(stats,n) \ - ((n) < BIT_STATUS_BITS_NUM ? ((stats) & (1 << n)) : ((stats) & 1)) - -#define BIT_STATUS_ON_AT(stats,n) do {\ - if ((n) < BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ - else\ - (stats) |= 1;\ -} while (0) - -#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\ - if ((n) < BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ -} while (0) - - -#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1) - -#define DIGITVAL(code) ((code) - '0') -#define ODIGITVAL(code) DIGITVAL(code) -#define XDIGITVAL(enc,code) \ - (ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \ - : (ONIGENC_IS_CODE_UPPER(enc,code) ? (code) - 'A' + 10 : (code) - 'a' + 10)) - -#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE) -#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE) -#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE) -#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND) -#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST) -#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY) -#define IS_POSIXLINE(option) (IS_SINGLELINE(option) && IS_MULTILINE(option)) -#define IS_FIND_CONDITION(option) ((option) & \ - (ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY)) -#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL) -#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL) -#define IS_POSIX_REGION(option) ((option) & ONIG_OPTION_POSIX_REGION) - -/* OP_SET_OPTION is required for these options. -#define IS_DYNAMIC_OPTION(option) \ - (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0) -*/ -/* ignore-case and multibyte status are included in compiled code. */ -#define IS_DYNAMIC_OPTION(option) 0 - -#define REPEAT_INFINITE -1 -#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE) - -/* bitset */ -#define BITS_PER_BYTE 8 -#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE) -#define BITS_IN_ROOM (sizeof(Bits) * BITS_PER_BYTE) -#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM) - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS -typedef unsigned int Bits; -#else -typedef unsigned char Bits; -#endif -typedef Bits BitSet[BITSET_SIZE]; -typedef Bits* BitSetRef; - -#define SIZE_BITSET sizeof(BitSet) - -#define BITSET_CLEAR(bs) do {\ - int i;\ - for (i = 0; i < BITSET_SIZE; i++) { (bs)[i] = 0; }\ -} while (0) - -#define BS_ROOM(bs,pos) (bs)[pos / BITS_IN_ROOM] -#define BS_BIT(pos) (1 << (pos % BITS_IN_ROOM)) - -#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos)) -#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos) -#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs,pos) &= ~(BS_BIT(pos)) -#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs,pos) ^= BS_BIT(pos) - -/* bytes buffer */ -typedef struct _BBuf { - UChar* p; - unsigned int used; - unsigned int alloc; -} BBuf; - -#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) - -#define BBUF_SIZE_INC(buf,inc) do{\ - (buf)->alloc += (inc);\ - (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ -} while (0) - -#define BBUF_EXPAND(buf,low) do{\ - do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\ - (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ -} while (0) - -#define BBUF_ENSURE_SIZE(buf,size) do{\ - unsigned int new_alloc = (buf)->alloc;\ - while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\ - if ((buf)->alloc != new_alloc) {\ - (buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ - (buf)->alloc = new_alloc;\ - }\ -} while (0) - -#define BBUF_WRITE(buf,pos,bytes,n) do{\ - int used = (pos) + (n);\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_WRITE1(buf,pos,byte) do{\ - int used = (pos) + 1;\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - (buf)->p[(pos)] = (byte);\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n)) -#define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte)) -#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used) -#define BBUF_GET_OFFSET_POS(buf) ((buf)->used) - -/* from < to */ -#define BBUF_MOVE_RIGHT(buf,from,to,n) do {\ - if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ - if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT(buf,from,to,n) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\ - (buf)->used -= (from - to);\ -} while (0) - -#define BBUF_INSERT(buf,pos,bytes,n) do {\ - if (pos >= (buf)->used) {\ - BBUF_WRITE(buf,pos,bytes,n);\ - }\ - else {\ - BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - }\ -} while (0) - -#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)] - - -#define ANCHOR_BEGIN_BUF (1<<0) -#define ANCHOR_BEGIN_LINE (1<<1) -#define ANCHOR_BEGIN_POSITION (1<<2) -#define ANCHOR_END_BUF (1<<3) -#define ANCHOR_SEMI_END_BUF (1<<4) -#define ANCHOR_END_LINE (1<<5) - -#define ANCHOR_WORD_BOUND (1<<6) -#define ANCHOR_NOT_WORD_BOUND (1<<7) -#define ANCHOR_WORD_BEGIN (1<<8) -#define ANCHOR_WORD_END (1<<9) -#define ANCHOR_PREC_READ (1<<10) -#define ANCHOR_PREC_READ_NOT (1<<11) -#define ANCHOR_LOOK_BEHIND (1<<12) -#define ANCHOR_LOOK_BEHIND_NOT (1<<13) - -#define ANCHOR_ANYCHAR_STAR (1<<14) /* ".*" optimize info */ -#define ANCHOR_ANYCHAR_STAR_PL (1<<15) /* ".*" optimize info (posix-line) */ - -/* operation code */ -enum OpCode { - OP_FINISH = 0, /* matching process terminator (no more alternative) */ - OP_END = 1, /* pattern code terminator (success end) */ - - OP_EXACT1 = 2, /* single byte, N = 1 */ - OP_EXACT2, /* single byte, N = 2 */ - OP_EXACT3, /* single byte, N = 3 */ - OP_EXACT4, /* single byte, N = 4 */ - OP_EXACT5, /* single byte, N = 5 */ - OP_EXACTN, /* single byte */ - OP_EXACTMB2N1, /* mb-length = 2 N = 1 */ - OP_EXACTMB2N2, /* mb-length = 2 N = 2 */ - OP_EXACTMB2N3, /* mb-length = 2 N = 3 */ - OP_EXACTMB2N, /* mb-length = 2 */ - OP_EXACTMB3N, /* mb-length = 3 */ - OP_EXACTMBN, /* other length */ - - OP_EXACT1_IC, /* single byte, N = 1, ignore case */ - OP_EXACTN_IC, /* single byte, ignore case */ - - OP_CCLASS, - OP_CCLASS_MB, - OP_CCLASS_MIX, - OP_CCLASS_NOT, - OP_CCLASS_MB_NOT, - OP_CCLASS_MIX_NOT, - OP_CCLASS_NODE, /* pointer to CClassNode node */ - - OP_ANYCHAR, /* "." */ - OP_ANYCHAR_ML, /* "." multi-line */ - OP_ANYCHAR_STAR, /* ".*" */ - OP_ANYCHAR_ML_STAR, /* ".*" multi-line */ - OP_ANYCHAR_STAR_PEEK_NEXT, - OP_ANYCHAR_ML_STAR_PEEK_NEXT, - - OP_WORD, - OP_NOT_WORD, - OP_WORD_SB, - OP_WORD_MB, - OP_WORD_BOUND, - OP_NOT_WORD_BOUND, - OP_WORD_BEGIN, - OP_WORD_END, - - OP_BEGIN_BUF, - OP_END_BUF, - OP_BEGIN_LINE, - OP_END_LINE, - OP_SEMI_END_BUF, - OP_BEGIN_POSITION, - - OP_BACKREF1, - OP_BACKREF2, - OP_BACKREF3, - OP_BACKREFN, - OP_BACKREFN_IC, - OP_BACKREF_MULTI, - OP_BACKREF_MULTI_IC, - - OP_MEMORY_START, - OP_MEMORY_START_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */ - OP_MEMORY_END, - OP_MEMORY_END_REC, /* push marker to stack */ - - OP_SET_OPTION_PUSH, /* set option and push recover option */ - OP_SET_OPTION, /* set option */ - - OP_FAIL, /* pop stack and move */ - OP_JUMP, - OP_PUSH, - OP_POP, - OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */ - OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */ - OP_REPEAT, /* {n,m} */ - OP_REPEAT_NG, /* {n,m}? (non greedy) */ - OP_REPEAT_INC, - OP_REPEAT_INC_NG, /* non greedy */ - OP_REPEAT_INC_SG, /* search and get in stack */ - OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */ - OP_NULL_CHECK_START, /* null loop checker start */ - OP_NULL_CHECK_END, /* null loop checker end */ - OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */ - OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */ - - OP_PUSH_POS, /* (?=...) start */ - OP_POP_POS, /* (?=...) end */ - OP_PUSH_POS_NOT, /* (?!...) start */ - OP_FAIL_POS, /* (?!...) end */ - OP_PUSH_STOP_BT, /* (?>...) start */ - OP_POP_STOP_BT, /* (?>...) end */ - OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ - OP_PUSH_LOOK_BEHIND_NOT, /* (? */ - OP_RETURN -}; - -/* arguments type */ -#define ARG_SPECIAL -1 -#define ARG_NON 0 -#define ARG_RELADDR 1 -#define ARG_ABSADDR 2 -#define ARG_LENGTH 3 -#define ARG_MEMNUM 4 -#define ARG_OPTION 5 - -typedef int RelAddrType; -typedef int AbsAddrType; -typedef int LengthType; -typedef int RepeatNumType; -typedef short int MemNumType; -typedef void* PointerType; - -#define SIZE_OPCODE 1 -#define SIZE_RELADDR sizeof(RelAddrType) -#define SIZE_ABSADDR sizeof(AbsAddrType) -#define SIZE_LENGTH sizeof(LengthType) -#define SIZE_MEMNUM sizeof(MemNumType) -#define SIZE_REPEATNUM sizeof(RepeatNumType) -#define SIZE_OPTION sizeof(OnigOptionType) -#define SIZE_CODE_POINT sizeof(OnigCodePoint) -#define SIZE_POINTER sizeof(PointerType) - - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - -#define PLATFORM_GET_INC(val,p,type) do{\ - val = *(type* )p;\ - (p) += sizeof(type);\ -} while(0) - -#else - -#define PLATFORM_GET_INC(val,p,type) do{\ - xmemcpy(&val, (p), sizeof(type));\ - (p) += sizeof(type);\ -} while(0) - -#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ - -#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType) -#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType) -#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType) -#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType) -#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType) -#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType) -#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType) - -/* code point's address must be aligned address. */ -#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p)) -#define GET_BYTE_INC(byte,p) do{\ - byte = *(p);\ - (p)++;\ -} while(0) - - -/* op-code + arg size */ -#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE -#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1) -#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP SIZE_OPCODE -#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_POS SIZE_OPCODE -#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP_POS SIZE_OPCODE -#define SIZE_OP_FAIL_POS SIZE_OPCODE -#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_FAIL SIZE_OPCODE -#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE -#define SIZE_OP_POP_STOP_BT SIZE_OPCODE -#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH) -#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH) -#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE -#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR) -#define SIZE_OP_RETURN SIZE_OPCODE - - -#define MC_ESC(enc) (enc)->meta_char_table.esc -#define MC_ANYCHAR(enc) (enc)->meta_char_table.anychar -#define MC_ANYTIME(enc) (enc)->meta_char_table.anytime -#define MC_ZERO_OR_ONE_TIME(enc) (enc)->meta_char_table.zero_or_one_time -#define MC_ONE_OR_MORE_TIME(enc) (enc)->meta_char_table.one_or_more_time -#define MC_ANYCHAR_ANYTIME(enc) (enc)->meta_char_table.anychar_anytime - -#define SYN_POSIX_COMMON_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \ - ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_ASTERISK_ZERO_INF | \ - ONIG_SYN_OP_LINE_ANCHOR | \ - ONIG_SYN_OP_ESC_CONTROL_CHARS ) - -#define SYN_GNU_REGEX_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | \ - ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP | \ - ONIG_SYN_OP_VBAR_ALT | \ - ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | \ - ONIG_SYN_OP_QMARK_ZERO_ONE | \ - ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR | \ - ONIG_SYN_OP_ESC_W_WORD | \ - ONIG_SYN_OP_ESC_B_WORD_BOUND | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | \ - ONIG_SYN_OP_ESC_S_WHITE_SPACE | ONIG_SYN_OP_ESC_D_DIGIT | \ - ONIG_SYN_OP_LINE_ANCHOR ) - -#define SYN_GNU_REGEX_BV \ - ( ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | \ - ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL | \ - ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC ) - -/* cclass node */ -#define FLAG_CCLASS_NOT 1 -#define FLAG_CCLASS_SHARE (1<<1) - -#define CCLASS_SET_NOT(cc) (cc)->flags |= FLAG_CCLASS_NOT -#define CCLASS_CLEAR_NOT(cc) (cc)->flags &= ~FLAG_CCLASS_NOT -#define CCLASS_SET_SHARE(cc) (cc)->flags |= FLAG_CCLASS_SHARE -#define IS_CCLASS_NOT(cc) (((cc)->flags & FLAG_CCLASS_NOT) != 0) -#define IS_CCLASS_SHARE(cc) (((cc)->flags & FLAG_CCLASS_SHARE) != 0) - -typedef struct { - int flags; - BitSet bs; - BBuf* mbuf; /* multi-byte info or NULL */ -} CClassNode; - - -#ifdef ONIG_DEBUG - -typedef struct { - short int opcode; - char* name; - short int arg_type; -} OnigOpInfoType; - -extern OnigOpInfoType OnigOpInfo[]; - -extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar** nextp, OnigEncoding enc)); - -#ifdef ONIG_DEBUG_STATISTICS -extern void onig_statistics_init P_((void)); -extern void onig_print_statistics P_((FILE* f)); -#endif -#endif - -extern char* onig_error_code_to_format P_((int code)); -extern void onig_snprintf_with_pattern PV_((char buf[], int bufsize, OnigEncoding enc, char* pat, char* pat_end, char *fmt, ...)); -extern int onig_bbuf_init P_((BBuf* buf, int size)); -extern int onig_alloc_init P_((regex_t** reg, OnigOptionType option, OnigAmbigType ambig_flag, OnigEncoding enc, OnigSyntaxType* syntax)); -extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo)); -extern void onig_chain_reduce P_((regex_t* reg)); -extern void onig_chain_link_add P_((regex_t* to, regex_t* add)); -extern void onig_transfer P_((regex_t* to, regex_t* from)); - -#endif /* REGINT_H */ diff --git a/ext/mbstring/oniguruma/regparse.c b/ext/mbstring/oniguruma/regparse.c deleted file mode 100644 index 58e122f4869ca..0000000000000 --- a/ext/mbstring/oniguruma/regparse.c +++ /dev/null @@ -1,5103 +0,0 @@ -/********************************************************************** - regparse.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regparse.h" - -#define WARN_BUFSIZE 256 - -OnigSyntaxType OnigSyntaxRuby = { - (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | - ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 | - ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS | - ONIG_SYN_OP_ESC_C_CONTROL ) - & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ) - , ( ONIG_SYN_OP2_QMARK_GROUP_EFFECT | - ONIG_SYN_OP2_OPTION_RUBY | - ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF | - ONIG_SYN_OP2_ESC_G_SUBEXP_CALL | - ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT | - ONIG_SYN_OP2_CCLASS_SET_OP | ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL | - ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META | ONIG_SYN_OP2_ESC_V_VTAB | - ONIG_SYN_OP2_ESC_H_XDIGIT ) - , ( SYN_GNU_REGEX_BV | - ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV | - ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND | - ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP | - ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME | - ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY | - ONIG_SYN_WARN_CC_OP_NOT_ESCAPED | - ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT ) - , ONIG_OPTION_NONE -}; - -OnigSyntaxType* OnigDefaultSyntax = ONIG_SYNTAX_RUBY; - -extern void onig_null_warn(const char* s) { } - -#ifdef DEFAULT_WARN_FUNCTION -static OnigWarnFunc onig_warn = (OnigWarnFunc )DEFAULT_WARN_FUNCTION; -#else -static OnigWarnFunc onig_warn = onig_null_warn; -#endif - -#ifdef DEFAULT_VERB_WARN_FUNCTION -static OnigWarnFunc onig_verb_warn = (OnigWarnFunc )DEFAULT_VERB_WARN_FUNCTION; -#else -static OnigWarnFunc onig_verb_warn = onig_null_warn; -#endif - -extern void onig_set_warn_func(OnigWarnFunc f) -{ - onig_warn = f; -} - -extern void onig_set_verb_warn_func(OnigWarnFunc f) -{ - onig_verb_warn = f; -} - -static void -bbuf_free(BBuf* bbuf) -{ - if (IS_NOT_NULL(bbuf)) { - if (IS_NOT_NULL(bbuf->p)) xfree(bbuf->p); - xfree(bbuf); - } -} - -static int -bbuf_clone(BBuf** rto, BBuf* from) -{ - int r; - BBuf *to; - - *rto = to = (BBuf* )xmalloc(sizeof(BBuf)); - CHECK_NULL_RETURN_VAL(to, ONIGERR_MEMORY); - r = BBUF_INIT(to, from->alloc); - if (r != 0) return r; - to->used = from->used; - xmemcpy(to->p, from->p, from->used); - return 0; -} - -#define ONOFF(v,f,negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f)) - -#define MBCODE_START_POS(enc) \ - (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80) - -#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \ - add_code_range_to_buf(pbuf, MBCODE_START_POS(enc), ~((OnigCodePoint )0)) - -#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\ - if (! ONIGENC_IS_SINGLEBYTE(enc)) {\ - r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\ - if (r) return r;\ - }\ -} while (0) - - -#define BITSET_IS_EMPTY(bs,empty) do {\ - int i;\ - empty = 1;\ - for (i = 0; i < BITSET_SIZE; i++) {\ - if ((bs)[i] != 0) {\ - empty = 0; break;\ - }\ - }\ -} while (0) - -static void -bitset_set_range(BitSetRef bs, int from, int to) -{ - int i; - for (i = from; i <= to && i < SINGLE_BYTE_SIZE; i++) { - BITSET_SET_BIT(bs, i); - } -} - -#if 0 -static void -bitset_set_all(BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - bs[i] = ~((Bits )0); - } -} -#endif - -static void -bitset_invert(BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - bs[i] = ~(bs[i]); - } -} - -static void -bitset_invert_to(BitSetRef from, BitSetRef to) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - to[i] = ~(from[i]); - } -} - -static void -bitset_and(BitSetRef dest, BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - dest[i] &= bs[i]; - } -} - -static void -bitset_or(BitSetRef dest, BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - dest[i] |= bs[i]; - } -} - -static void -bitset_copy(BitSetRef dest, BitSetRef bs) -{ - int i; - for (i = 0; i < BITSET_SIZE; i++) { - dest[i] = bs[i]; - } -} - -extern int -onig_strncmp(const UChar* s1, const UChar* s2, int n) -{ - int x; - - while (n-- > 0) { - x = *s2++ - *s1++; - if (x) return x; - } - return 0; -} - -static void -k_strcpy(UChar* dest, const UChar* src, const UChar* end) -{ - int len = end - src; - if (len > 0) { - xmemcpy(dest, src, len); - dest[len] = (UChar )0; - } -} - -static UChar* -strdup_with_null(OnigEncoding enc, UChar* s, UChar* end) -{ - int slen, term_len, i; - UChar *r; - - slen = end - s; - term_len = ONIGENC_MBC_MINLEN(enc); - - r = (UChar* )xmalloc(slen + term_len); - CHECK_NULL_RETURN(r); - xmemcpy(r, s, slen); - - for (i = 0; i < term_len; i++) - r[slen + i] = (UChar )0; - - return r; -} - - -/* scan pattern methods */ -#define PEND_VALUE 0 - -#define PFETCH_READY UChar* pfetch_prev -#define PEND (p < end ? 0 : 1) -#define PUNFETCH p = pfetch_prev -#define PINC do { \ - pfetch_prev = p; \ - p += ONIGENC_MBC_ENC_LEN(enc, p); \ -} while (0) -#define PFETCH(c) do { \ - c = ONIGENC_MBC_TO_CODE(enc, p, end); \ - pfetch_prev = p; \ - p += ONIGENC_MBC_ENC_LEN(enc, p); \ -} while (0) - -#define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE) -#define PPEEK_IS(c) (PPEEK == (OnigCodePoint )c) - -static UChar* -k_strcat_capa(UChar* dest, UChar* dest_end, const UChar* src, const UChar* src_end, - int capa) -{ - UChar* r; - - if (dest) - r = (UChar* )xrealloc(dest, capa + 1); - else - r = (UChar* )xmalloc(capa + 1); - - CHECK_NULL_RETURN(r); - k_strcpy(r + (dest_end - dest), src, src_end); - return r; -} - -/* dest on static area */ -static UChar* -strcat_capa_from_static(UChar* dest, UChar* dest_end, - const UChar* src, const UChar* src_end, int capa) -{ - UChar* r; - - r = (UChar* )xmalloc(capa + 1); - CHECK_NULL_RETURN(r); - k_strcpy(r, dest, dest_end); - k_strcpy(r + (dest_end - dest), src, src_end); - return r; -} - -#ifdef USE_NAMED_GROUP - -#define INIT_NAME_BACKREFS_ALLOC_NUM 8 - -typedef struct { - UChar* name; - int name_len; /* byte length */ - int back_num; /* number of backrefs */ - int back_alloc; - int back_ref1; - int* back_refs; -} NameEntry; - -#ifdef USE_ST_HASH_TABLE - -#include "st.h" - -typedef st_table NameTable; -typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */ - -#define NAMEBUF_SIZE 24 -#define NAMEBUF_SIZE_1 25 - -#ifdef ONIG_DEBUG -static int -i_print_name_entry(UChar* key, NameEntry* e, void* arg) -{ - int i; - FILE* fp = (FILE* )arg; - - fprintf(fp, "%s: ", e->name); - if (e->back_num == 0) - fputs("-", fp); - else if (e->back_num == 1) - fprintf(fp, "%d", e->back_ref1); - else { - for (i = 0; i < e->back_num; i++) { - if (i > 0) fprintf(fp, ", "); - fprintf(fp, "%d", e->back_refs[i]); - } - } - fputs("\n", fp); - return ST_CONTINUE; -} - -extern int -onig_print_names(FILE* fp, regex_t* reg) -{ - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - fprintf(fp, "name table\n"); - onig_st_foreach(t, i_print_name_entry, (HashDataType )fp); - fputs("\n", fp); - } - return 0; -} -#endif - -static int -i_free_name_entry(UChar* key, NameEntry* e, void* arg) -{ - xfree(e->name); /* == key */ - if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs); - return ST_DELETE; -} - -static int -names_clear(regex_t* reg) -{ - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - onig_st_foreach(t, i_free_name_entry, 0); - } - return 0; -} - -extern int -onig_names_free(regex_t* reg) -{ - int r; - NameTable* t; - - r = names_clear(reg); - if (r) return r; - - t = (NameTable* )reg->name_table; - if (IS_NOT_NULL(t)) onig_st_free_table(t); - reg->name_table = (void* )NULL; - return 0; -} - -static NameEntry* -name_find(regex_t* reg, const UChar* name, const UChar* name_end) -{ - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - e = (NameEntry* )NULL; - if (IS_NOT_NULL(t)) { - onig_st_lookup_strend(t, name, name_end, (HashDataType* )((void* )(&e))); - } - return e; -} - -typedef struct { - int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*); - regex_t* reg; - void* arg; - int ret; - OnigEncoding enc; -} INamesArg; - -static int -i_names(UChar* key, NameEntry* e, INamesArg* arg) -{ - int r = (*(arg->func))(e->name, - /*e->name + onigenc_str_bytelen_null(arg->enc, e->name), */ - e->name + e->name_len, - e->back_num, - (e->back_num > 1 ? e->back_refs : &(e->back_ref1)), - arg->reg, arg->arg); - if (r != 0) { - arg->ret = r; - return ST_STOP; - } - return ST_CONTINUE; -} - -extern int -onig_foreach_name(regex_t* reg, - int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), - void* arg) -{ - INamesArg narg; - NameTable* t = (NameTable* )reg->name_table; - - narg.ret = 0; - if (IS_NOT_NULL(t)) { - narg.func = func; - narg.reg = reg; - narg.arg = arg; - narg.enc = reg->enc; /* should be pattern encoding. */ - onig_st_foreach(t, i_names, (HashDataType )&narg); - } - return narg.ret; -} - -static int -i_renumber_name(UChar* key, NameEntry* e, GroupNumRemap* map) -{ - int i; - - if (e->back_num > 1) { - for (i = 0; i < e->back_num; i++) { - e->back_refs[i] = map[e->back_refs[i]].new_val; - } - } - else if (e->back_num == 1) { - e->back_ref1 = map[e->back_ref1].new_val; - } - - return ST_CONTINUE; -} - -extern int -onig_renumber_name_table(regex_t* reg, GroupNumRemap* map) -{ - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - onig_st_foreach(t, i_renumber_name, (HashDataType )map); - } - return 0; -} - - -extern int -onig_number_of_names(regex_t* reg) -{ - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) - return t->num_entries; - else - return 0; -} - -#else /* USE_ST_HASH_TABLE */ - -#define INIT_NAMES_ALLOC_NUM 8 - -typedef struct { - NameEntry* e; - int num; - int alloc; -} NameTable; - - -#ifdef ONIG_DEBUG -extern int -onig_print_names(FILE* fp, regex_t* reg) -{ - int i, j; - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t) && t->num > 0) { - fprintf(fp, "name table\n"); - for (i = 0; i < t->num; i++) { - e = &(t->e[i]); - fprintf(fp, "%s: ", e->name); - if (e->back_num == 0) { - fputs("-", fp); - } - else if (e->back_num == 1) { - fprintf(fp, "%d", e->back_ref1); - } - else { - for (j = 0; j < e->back_num; j++) { - if (j > 0) fprintf(fp, ", "); - fprintf(fp, "%d", e->back_refs[j]); - } - } - fputs("\n", fp); - } - fputs("\n", fp); - } - return 0; -} -#endif - -static int -names_clear(regex_t* reg) -{ - int i; - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - for (i = 0; i < t->num; i++) { - e = &(t->e[i]); - if (IS_NOT_NULL(e->name)) { - xfree(e->name); - e->name = NULL; - e->name_len = 0; - e->back_num = 0; - e->back_alloc = 0; - if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs); - e->back_refs = (int* )NULL; - } - } - if (IS_NOT_NULL(t->e)) { - xfree(t->e); - t->e = NULL; - } - t->num = 0; - } - return 0; -} - -extern int -onig_names_free(regex_t* reg) -{ - int r; - NameTable* t; - - r = names_clear(reg); - if (r) return r; - - t = (NameTable* )reg->name_table; - if (IS_NOT_NULL(t)) xfree(t); - reg->name_table = NULL; - return 0; -} - -static NameEntry* -name_find(regex_t* reg, UChar* name, UChar* name_end) -{ - int i, len; - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - len = name_end - name; - for (i = 0; i < t->num; i++) { - e = &(t->e[i]); - if (len == e->name_len && onig_strncmp(name, e->name, len) == 0) - return e; - } - } - return (NameEntry* )NULL; -} - -extern int -onig_foreach_name(regex_t* reg, - int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), - void* arg) -{ - int i, r; - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) { - for (i = 0; i < t->num; i++) { - e = &(t->e[i]); - r = (*func)(e->name, e->name + e->name_len, e->back_num, - (e->back_num > 1 ? e->back_refs : &(e->back_ref1)), - reg, arg); - if (r != 0) return r; - } - } - return 0; -} - -extern int -onig_number_of_names(regex_t* reg) -{ - NameTable* t = (NameTable* )reg->name_table; - - if (IS_NOT_NULL(t)) - return t->num; - else - return 0; -} - -#endif /* else USE_ST_HASH_TABLE */ - -static int -name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env) -{ - int alloc; - NameEntry* e; - NameTable* t = (NameTable* )reg->name_table; - - if (name_end - name <= 0) - return ONIGERR_EMPTY_GROUP_NAME; - - e = name_find(reg, name, name_end); - if (IS_NULL(e)) { -#ifdef USE_ST_HASH_TABLE - if (IS_NULL(t)) { - t = onig_st_init_strend_table_with_size(5); - reg->name_table = (void* )t; - } - e = (NameEntry* )xmalloc(sizeof(NameEntry)); - CHECK_NULL_RETURN_VAL(e, ONIGERR_MEMORY); - - e->name = strdup_with_null(reg->enc, name, name_end); - if (IS_NULL(e->name)) return ONIGERR_MEMORY; - onig_st_insert_strend(t, e->name, (e->name + (name_end - name)), - (HashDataType )e); - - e->name_len = name_end - name; - e->back_num = 0; - e->back_alloc = 0; - e->back_refs = (int* )NULL; - -#else - - if (IS_NULL(t)) { - alloc = INIT_NAMES_ALLOC_NUM; - t = (NameTable* )xmalloc(sizeof(NameTable)); - CHECK_NULL_RETURN_VAL(t, ONIGERR_MEMORY); - t->e = NULL; - t->alloc = 0; - t->num = 0; - - t->e = (NameEntry* )xmalloc(sizeof(NameEntry) * alloc); - if (IS_NULL(t->e)) { - xfree(t); - return ONIGERR_MEMORY; - } - t->alloc = alloc; - reg->name_table = t; - goto clear; - } - else if (t->num == t->alloc) { - int i; - - alloc = t->alloc * 2; - t->e = (NameEntry* )xrealloc(t->e, sizeof(NameEntry) * alloc); - CHECK_NULL_RETURN_VAL(t->e, ONIGERR_MEMORY); - t->alloc = alloc; - - clear: - for (i = t->num; i < t->alloc; i++) { - t->e[i].name = NULL; - t->e[i].name_len = 0; - t->e[i].back_num = 0; - t->e[i].back_alloc = 0; - t->e[i].back_refs = (int* )NULL; - } - } - e = &(t->e[t->num]); - t->num++; - e->name = strdup_with_null(reg->enc, name, name_end); - e->name_len = name_end - name; -#endif - } - - if (e->back_num >= 1 && - ! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME)) { - onig_scan_env_set_error_string(env, ONIGERR_MULTIPLEX_DEFINED_NAME, - name, name_end); - return ONIGERR_MULTIPLEX_DEFINED_NAME; - } - - e->back_num++; - if (e->back_num == 1) { - e->back_ref1 = backref; - } - else { - if (e->back_num == 2) { - alloc = INIT_NAME_BACKREFS_ALLOC_NUM; - e->back_refs = (int* )xmalloc(sizeof(int) * alloc); - CHECK_NULL_RETURN_VAL(e->back_refs, ONIGERR_MEMORY); - e->back_alloc = alloc; - e->back_refs[0] = e->back_ref1; - e->back_refs[1] = backref; - } - else { - if (e->back_num > e->back_alloc) { - alloc = e->back_alloc * 2; - e->back_refs = (int* )xrealloc(e->back_refs, sizeof(int) * alloc); - CHECK_NULL_RETURN_VAL(e->back_refs, ONIGERR_MEMORY); - e->back_alloc = alloc; - } - e->back_refs[e->back_num - 1] = backref; - } - } - - return 0; -} - -extern int -onig_name_to_group_numbers(regex_t* reg, const UChar* name, - const UChar* name_end, int** nums) -{ - NameEntry* e; - - e = name_find(reg, name, name_end); - if (IS_NULL(e)) return ONIGERR_UNDEFINED_NAME_REFERENCE; - - switch (e->back_num) { - case 0: - break; - case 1: - *nums = &(e->back_ref1); - break; - default: - *nums = e->back_refs; - break; - } - return e->back_num; -} - -extern int -onig_name_to_backref_number(regex_t* reg, const UChar* name, - const UChar* name_end, OnigRegion *region) -{ - int i, n, *nums; - - n = onig_name_to_group_numbers(reg, name, name_end, &nums); - if (n < 0) - return n; - else if (n == 0) - return ONIGERR_PARSER_BUG; - else if (n == 1) - return nums[0]; - else { - if (IS_NOT_NULL(region)) { - for (i = n - 1; i >= 0; i--) { - if (region->beg[nums[i]] != ONIG_REGION_NOTPOS) - return nums[i]; - } - } - return nums[n - 1]; - } -} - -#else /* USE_NAMED_GROUP */ - -extern int -onig_name_to_group_numbers(regex_t* reg, const UChar* name, - const UChar* name_end, int** nums) -{ - return ONIG_NO_SUPPORT_CONFIG; -} - -extern int -onig_name_to_backref_number(regex_t* reg, const UChar* name, - const UChar* name_end, OnigRegion* region) -{ - return ONIG_NO_SUPPORT_CONFIG; -} - -extern int -onig_foreach_name(regex_t* reg, - int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), - void* arg) -{ - return ONIG_NO_SUPPORT_CONFIG; -} - -extern int -onig_number_of_names(regex_t* reg) -{ - return 0; -} -#endif /* else USE_NAMED_GROUP */ - - -#define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16 - -static void -scan_env_clear(ScanEnv* env) -{ - int i; - - BIT_STATUS_CLEAR(env->capture_history); - BIT_STATUS_CLEAR(env->bt_mem_start); - BIT_STATUS_CLEAR(env->bt_mem_end); - BIT_STATUS_CLEAR(env->backrefed_mem); - env->error = (UChar* )NULL; - env->error_end = (UChar* )NULL; - env->num_call = 0; - env->num_mem = 0; -#ifdef USE_NAMED_GROUP - env->num_named = 0; -#endif - env->mem_alloc = 0; - env->mem_nodes_dynamic = (Node** )NULL; - - for (i = 0; i < SCANENV_MEMNODES_SIZE; i++) - env->mem_nodes_static[i] = NULL_NODE; -} - -static int -scan_env_add_mem_entry(ScanEnv* env) -{ - int i, need, alloc; - Node** p; - - need = env->num_mem + 1; - if (need >= SCANENV_MEMNODES_SIZE) { - if (env->mem_alloc <= need) { - if (IS_NULL(env->mem_nodes_dynamic)) { - alloc = INIT_SCANENV_MEMNODES_ALLOC_SIZE; - p = (Node** )xmalloc(sizeof(Node*) * alloc); - xmemcpy(p, env->mem_nodes_static, - sizeof(Node*) * SCANENV_MEMNODES_SIZE); - } - else { - alloc = env->mem_alloc * 2; - p = (Node** )xrealloc(env->mem_nodes_dynamic, sizeof(Node*) * alloc); - } - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - - for (i = env->num_mem + 1; i < alloc; i++) - p[i] = NULL_NODE; - - env->mem_nodes_dynamic = p; - env->mem_alloc = alloc; - } - } - - env->num_mem++; - return env->num_mem; -} - -static int -scan_env_set_mem_node(ScanEnv* env, int num, Node* node) -{ - if (env->num_mem >= num) - SCANENV_MEM_NODES(env)[num] = node; - else - return ONIGERR_PARSER_BUG; - return 0; -} - - -#ifdef USE_RECYCLE_NODE -typedef struct _FreeNode { - struct _FreeNode* next; -} FreeNode; - -static FreeNode* FreeNodeList = (FreeNode* )NULL; -#endif - -extern void -onig_node_free(Node* node) -{ - start: - if (IS_NULL(node)) return ; - - switch (NTYPE(node)) { - case N_STRING: - if (IS_NOT_NULL(NSTRING(node).s) && NSTRING(node).s != NSTRING(node).buf) { - xfree(NSTRING(node).s); - } - break; - - case N_LIST: - case N_ALT: - onig_node_free(NCONS(node).left); - /* onig_node_free(NCONS(node).right); */ - { - Node* next_node = NCONS(node).right; - -#ifdef USE_RECYCLE_NODE - { - FreeNode* n = (FreeNode* )node; - - THREAD_ATOMIC_START; - n->next = FreeNodeList; - FreeNodeList = n; - THREAD_ATOMIC_END; - } -#else - xfree(node); -#endif - - node = next_node; - goto start; - } - break; - - case N_CCLASS: - { - CClassNode* cc = &(NCCLASS(node)); - - if (IS_CCLASS_SHARE(cc)) - return ; - - if (cc->mbuf) - bbuf_free(cc->mbuf); - } - break; - - case N_QUALIFIER: - if (NQUALIFIER(node).target) - onig_node_free(NQUALIFIER(node).target); - break; - - case N_EFFECT: - if (NEFFECT(node).target) - onig_node_free(NEFFECT(node).target); - break; - - case N_BACKREF: - if (IS_NOT_NULL(NBACKREF(node).back_dynamic)) - xfree(NBACKREF(node).back_dynamic); - break; - - case N_ANCHOR: - if (NANCHOR(node).target) - onig_node_free(NANCHOR(node).target); - break; - } - -#ifdef USE_RECYCLE_NODE - { - FreeNode* n = (FreeNode* )node; - - THREAD_ATOMIC_START; - n->next = FreeNodeList; - FreeNodeList = n; - THREAD_ATOMIC_END; - } -#else - xfree(node); -#endif -} - -#ifdef USE_RECYCLE_NODE -extern int -onig_free_node_list() -{ - FreeNode* n; - - THREAD_ATOMIC_START; - while (FreeNodeList) { - n = FreeNodeList; - FreeNodeList = FreeNodeList->next; - xfree(n); - } - THREAD_ATOMIC_END; - return 0; -} -#endif - -static Node* -node_new() -{ - Node* node; - -#ifdef USE_RECYCLE_NODE - if (IS_NOT_NULL(FreeNodeList)) { - THREAD_ATOMIC_START; - node = (Node* )FreeNodeList; - FreeNodeList = FreeNodeList->next; - THREAD_ATOMIC_END; - return node; - } -#endif - - node = (Node* )xmalloc(sizeof(Node)); - return node; -} - - -static void -initialize_cclass(CClassNode* cc) -{ - BITSET_CLEAR(cc->bs); - cc->flags = 0; - cc->mbuf = NULL; -} - -static Node* -node_new_cclass() -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_CCLASS; - - initialize_cclass(&(NCCLASS(node))); - return node; -} - -extern Node* -node_new_cclass_by_codepoint_range(int not, - OnigCodePoint sbr[], OnigCodePoint mbr[]) -{ - CClassNode* cc; - int n, i, j; - - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_CCLASS; - - cc = &(NCCLASS(node)); - cc->flags = 0; - if (not != 0) CCLASS_SET_NOT(cc); - - BITSET_CLEAR(cc->bs); - if (IS_NOT_NULL(sbr)) { - n = ONIGENC_CODE_RANGE_NUM(sbr); - for (i = 0; i < n; i++) { - for (j = ONIGENC_CODE_RANGE_FROM(sbr, i); - j <= (int )ONIGENC_CODE_RANGE_TO(sbr, i); j++) { - BITSET_SET_BIT(cc->bs, j); - } - } - } - - if (IS_NULL(mbr)) { - is_null: - cc->mbuf = NULL; - } - else { - BBuf* bbuf; - - n = ONIGENC_CODE_RANGE_NUM(mbr); - if (n == 0) goto is_null; - - bbuf = (BBuf* )xmalloc(sizeof(BBuf)); - CHECK_NULL_RETURN_VAL(bbuf, NULL); - bbuf->alloc = n + 1; - bbuf->used = n + 1; - bbuf->p = (UChar* )((void* )mbr); - - cc->mbuf = bbuf; - } - - return node; -} - -static Node* -node_new_ctype(int type) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_CTYPE; - NCTYPE(node).type = type; - return node; -} - -static Node* -node_new_anychar() -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_ANYCHAR; - return node; -} - -static Node* -node_new_list(Node* left, Node* right) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_LIST; - NCONS(node).left = left; - NCONS(node).right = right; - return node; -} - -extern Node* -onig_node_new_list(Node* left, Node* right) -{ - return node_new_list(left, right); -} - -static Node* -node_new_alt(Node* left, Node* right) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_ALT; - NCONS(node).left = left; - NCONS(node).right = right; - return node; -} - -extern Node* -onig_node_new_anchor(int type) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_ANCHOR; - NANCHOR(node).type = type; - NANCHOR(node).target = NULL; - NANCHOR(node).char_len = -1; - return node; -} - -static Node* -node_new_backref(int back_num, int* backrefs, int by_name, ScanEnv* env) -{ - int i; - Node* node = node_new(); - - CHECK_NULL_RETURN(node); - node->type = N_BACKREF; - NBACKREF(node).state = 0; - NBACKREF(node).back_num = back_num; - NBACKREF(node).back_dynamic = (int* )NULL; - if (by_name != 0) - NBACKREF(node).state |= NST_NAME_REF; - - for (i = 0; i < back_num; i++) { - if (backrefs[i] <= env->num_mem && - IS_NULL(SCANENV_MEM_NODES(env)[backrefs[i]])) { - NBACKREF(node).state |= NST_RECURSION; /* /...(\1).../ */ - break; - } - } - - if (back_num <= NODE_BACKREFS_SIZE) { - for (i = 0; i < back_num; i++) - NBACKREF(node).back_static[i] = backrefs[i]; - } - else { - int* p = (int* )xmalloc(sizeof(int) * back_num); - if (IS_NULL(p)) { - onig_node_free(node); - return NULL; - } - NBACKREF(node).back_dynamic = p; - for (i = 0; i < back_num; i++) - p[i] = backrefs[i]; - } - return node; -} - -#ifdef USE_SUBEXP_CALL -static Node* -node_new_call(UChar* name, UChar* name_end) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - - node->type = N_CALL; - NCALL(node).state = 0; - NCALL(node).ref_num = CALLNODE_REFNUM_UNDEF; - NCALL(node).target = NULL_NODE; - NCALL(node).name = name; - NCALL(node).name_end = name_end; - return node; -} -#endif - -static Node* -node_new_qualifier(int lower, int upper, int by_number) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_QUALIFIER; - NQUALIFIER(node).state = 0; - NQUALIFIER(node).target = NULL; - NQUALIFIER(node).lower = lower; - NQUALIFIER(node).upper = upper; - NQUALIFIER(node).greedy = 1; - NQUALIFIER(node).by_number = by_number; - NQUALIFIER(node).target_empty_info = NQ_TARGET_ISNOT_EMPTY; - NQUALIFIER(node).head_exact = NULL_NODE; - NQUALIFIER(node).next_head_exact = NULL_NODE; - NQUALIFIER(node).is_refered = 0; - return node; -} - -static Node* -node_new_effect(int type) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - node->type = N_EFFECT; - NEFFECT(node).type = type; - NEFFECT(node).state = 0; - NEFFECT(node).regnum = 0; - NEFFECT(node).option = 0; - NEFFECT(node).target = NULL; - NEFFECT(node).call_addr = -1; - NEFFECT(node).opt_count = 0; - return node; -} - -extern Node* -onig_node_new_effect(int type) -{ - return node_new_effect(type); -} - -static Node* -node_new_effect_memory(OnigOptionType option, int is_named) -{ - Node* node = node_new_effect(EFFECT_MEMORY); - CHECK_NULL_RETURN(node); - if (is_named != 0) - SET_EFFECT_STATUS(node, NST_NAMED_GROUP); - -#ifdef USE_SUBEXP_CALL - NEFFECT(node).option = option; -#endif - return node; -} - -static Node* -node_new_option(OnigOptionType option) -{ - Node* node = node_new_effect(EFFECT_OPTION); - CHECK_NULL_RETURN(node); - NEFFECT(node).option = option; - return node; -} - -extern int -onig_node_str_cat(Node* node, const UChar* s, const UChar* end) -{ - int addlen = end - s; - - if (addlen > 0) { - int len = NSTRING(node).end - NSTRING(node).s; - - if (NSTRING(node).capa > 0 || (len + addlen > NODE_STR_BUF_SIZE - 1)) { - UChar* p; - int capa = len + addlen + NODE_STR_MARGIN; - - if (capa <= NSTRING(node).capa) { - k_strcpy(NSTRING(node).s + len, s, end); - } - else { - if (NSTRING(node).s == NSTRING(node).buf) - p = strcat_capa_from_static(NSTRING(node).s, NSTRING(node).end, - s, end, capa); - else - p = k_strcat_capa(NSTRING(node).s, NSTRING(node).end, s, end, capa); - - CHECK_NULL_RETURN_VAL(p, ONIGERR_MEMORY); - NSTRING(node).s = p; - NSTRING(node).capa = capa; - } - } - else { - k_strcpy(NSTRING(node).s + len, s, end); - } - NSTRING(node).end = NSTRING(node).s + len + addlen; - } - - return 0; -} - -static int -node_str_cat_char(Node* node, UChar c) -{ - UChar s[1]; - - s[0] = c; - return onig_node_str_cat(node, s, s + 1); -} - -extern void -onig_node_conv_to_str_node(Node* node, int flag) -{ - node->type = N_STRING; - - NSTRING(node).flag = flag; - NSTRING(node).capa = 0; - NSTRING(node).s = NSTRING(node).buf; - NSTRING(node).end = NSTRING(node).buf; -} - -extern void -onig_node_str_clear(Node* node) -{ - if (NSTRING(node).capa != 0 && - IS_NOT_NULL(NSTRING(node).s) && NSTRING(node).s != NSTRING(node).buf) { - xfree(NSTRING(node).s); - } - - NSTRING(node).capa = 0; - NSTRING(node).flag = 0; - NSTRING(node).s = NSTRING(node).buf; - NSTRING(node).end = NSTRING(node).buf; -} - -static Node* -node_new_str(const UChar* s, const UChar* end) -{ - Node* node = node_new(); - CHECK_NULL_RETURN(node); - - node->type = N_STRING; - NSTRING(node).capa = 0; - NSTRING(node).flag = 0; - NSTRING(node).s = NSTRING(node).buf; - NSTRING(node).end = NSTRING(node).buf; - if (onig_node_str_cat(node, s, end)) { - onig_node_free(node); - return NULL; - } - return node; -} - -extern Node* -onig_node_new_str(const UChar* s, const UChar* end) -{ - return node_new_str(s, end); -} - -static Node* -node_new_str_raw(UChar* s, UChar* end) -{ - Node* node = node_new_str(s, end); - NSTRING_SET_RAW(node); - return node; -} - -static Node* -node_new_empty() -{ - return node_new_str(NULL, NULL); -} - -static Node* -node_new_str_raw_char(UChar c) -{ - UChar p[1]; - - p[0] = c; - return node_new_str_raw(p, p + 1); -} - -static Node* -str_node_split_last_char(StrNode* sn, OnigEncoding enc) -{ - const UChar *p; - Node* n = NULL_NODE; - - if (sn->end > sn->s) { - p = onigenc_get_prev_char_head(enc, sn->s, sn->end); - if (p && p > sn->s) { /* can be splitted. */ - n = node_new_str(p, sn->end); - if ((sn->flag & NSTR_RAW) != 0) - NSTRING_SET_RAW(n); - sn->end = (UChar* )p; - } - } - return n; -} - -static int -str_node_can_be_split(StrNode* sn, OnigEncoding enc) -{ - if (sn->end > sn->s) { - return ((enc_len(enc, sn->s) < sn->end - sn->s) ? 1 : 0); - } - return 0; -} - -extern int -onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc) -{ - unsigned int num, val; - OnigCodePoint c; - UChar* p = *src; - PFETCH_READY; - - num = 0; - while (!PEND) { - PFETCH(c); - if (ONIGENC_IS_CODE_DIGIT(enc, c)) { - val = (unsigned int )DIGITVAL(c); - if ((INT_MAX_LIMIT - val) / 10UL < num) - return -1; /* overflow */ - - num = num * 10 + val; - } - else { - PUNFETCH; - break; - } - } - *src = p; - return num; -} - -static int -scan_unsigned_hexadecimal_number(UChar** src, UChar* end, int maxlen, - OnigEncoding enc) -{ - OnigCodePoint c; - unsigned int num, val; - UChar* p = *src; - PFETCH_READY; - - num = 0; - while (!PEND && maxlen-- != 0) { - PFETCH(c); - if (ONIGENC_IS_CODE_XDIGIT(enc, c)) { - val = (unsigned int )XDIGITVAL(enc,c); - if ((INT_MAX_LIMIT - val) / 16UL < num) - return -1; /* overflow */ - - num = (num << 4) + XDIGITVAL(enc,c); - } - else { - PUNFETCH; - break; - } - } - *src = p; - return num; -} - -static int -scan_unsigned_octal_number(UChar** src, UChar* end, int maxlen, - OnigEncoding enc) -{ - OnigCodePoint c; - unsigned int num, val; - UChar* p = *src; - PFETCH_READY; - - num = 0; - while (!PEND && maxlen-- != 0) { - PFETCH(c); - if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') { - val = ODIGITVAL(c); - if ((INT_MAX_LIMIT - val) / 8UL < num) - return -1; /* overflow */ - - num = (num << 3) + val; - } - else { - PUNFETCH; - break; - } - } - *src = p; - return num; -} - - -#define BBUF_WRITE_CODE_POINT(bbuf,pos,code) \ - BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT) - -/* data format: - [n][from-1][to-1][from-2][to-2] ... [from-n][to-n] - (all data size is OnigCodePoint) - */ -static int -new_code_range(BBuf** pbuf) -{ -#define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5) - int r; - OnigCodePoint n; - BBuf* bbuf; - - bbuf = *pbuf = (BBuf* )xmalloc(sizeof(BBuf)); - CHECK_NULL_RETURN_VAL(*pbuf, ONIGERR_MEMORY); - r = BBUF_INIT(*pbuf, INIT_MULTI_BYTE_RANGE_SIZE); - if (r) return r; - - n = 0; - BBUF_WRITE_CODE_POINT(bbuf, 0, n); - return 0; -} - -static int -add_code_range_to_buf(BBuf** pbuf, OnigCodePoint from, OnigCodePoint to) -{ - int r, inc_n, pos; - int low, high, bound, x; - OnigCodePoint n, *data; - BBuf* bbuf; - - if (from > to) { - n = from; from = to; to = n; - } - - if (IS_NULL(*pbuf)) { - r = new_code_range(pbuf); - if (r) return r; - bbuf = *pbuf; - n = 0; - } - else { - bbuf = *pbuf; - GET_CODE_POINT(n, bbuf->p); - } - data = (OnigCodePoint* )(bbuf->p); - data++; - - for (low = 0, bound = n; low < bound; ) { - x = (low + bound) >> 1; - if (from > data[x*2 + 1]) - low = x + 1; - else - bound = x; - } - - for (high = low, bound = n; high < bound; ) { - x = (high + bound) >> 1; - if (to >= data[x*2] - 1) - high = x + 1; - else - bound = x; - } - - inc_n = low + 1 - high; - if (n + inc_n > ONIG_MAX_MULTI_BYTE_RANGES_NUM) - return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES; - - if (inc_n != 1) { - if (from > data[low*2]) - from = data[low*2]; - if (to < data[(high - 1)*2 + 1]) - to = data[(high - 1)*2 + 1]; - } - - if (inc_n != 0 && (OnigCodePoint )high < n) { - int from_pos = SIZE_CODE_POINT * (1 + high * 2); - int to_pos = SIZE_CODE_POINT * (1 + (low + 1) * 2); - int size = (n - high) * 2 * SIZE_CODE_POINT; - - if (inc_n > 0) { - BBUF_MOVE_RIGHT(bbuf, from_pos, to_pos, size); - } - else { - BBUF_MOVE_LEFT_REDUCE(bbuf, from_pos, to_pos); - } - } - - pos = SIZE_CODE_POINT * (1 + low * 2); - BBUF_ENSURE_SIZE(bbuf, pos + SIZE_CODE_POINT * 2); - BBUF_WRITE_CODE_POINT(bbuf, pos, from); - BBUF_WRITE_CODE_POINT(bbuf, pos + SIZE_CODE_POINT, to); - n += inc_n; - BBUF_WRITE_CODE_POINT(bbuf, 0, n); - - return 0; -} - -static int -add_code_range(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePoint to) -{ - if (from > to) { - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) - return 0; - else - return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; - } - - return add_code_range_to_buf(pbuf, from, to); -} - -static int -not_code_range_buf(OnigEncoding enc, BBuf* bbuf, BBuf** pbuf) -{ - int r, i, n; - OnigCodePoint pre, from, *data, to = 0; - - *pbuf = (BBuf* )NULL; - if (IS_NULL(bbuf)) { - set_all: - return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); - } - - data = (OnigCodePoint* )(bbuf->p); - GET_CODE_POINT(n, data); - data++; - if (n <= 0) goto set_all; - - r = 0; - pre = MBCODE_START_POS(enc); - for (i = 0; i < n; i++) { - from = data[i*2]; - to = data[i*2+1]; - if (pre <= from - 1) { - r = add_code_range_to_buf(pbuf, pre, from - 1); - if (r != 0) return r; - } - if (to == ~((OnigCodePoint )0)) break; - pre = to + 1; - } - if (to < ~((OnigCodePoint )0)) { - r = add_code_range_to_buf(pbuf, to + 1, ~((OnigCodePoint )0)); - } - return r; -} - -#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) do {\ - BBuf *tbuf; \ - int tnot; \ - tnot = not1; not1 = not2; not2 = tnot; \ - tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \ -} while (0) - -static int -or_code_range_buf(OnigEncoding enc, BBuf* bbuf1, int not1, - BBuf* bbuf2, int not2, BBuf** pbuf) -{ - int r; - OnigCodePoint i, n1, *data1; - OnigCodePoint from, to; - - *pbuf = (BBuf* )NULL; - if (IS_NULL(bbuf1) && IS_NULL(bbuf2)) { - if (not1 != 0 || not2 != 0) - return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); - return 0; - } - - r = 0; - if (IS_NULL(bbuf2)) - SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); - - if (IS_NULL(bbuf1)) { - if (not1 != 0) { - return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); - } - else { - if (not2 == 0) { - return bbuf_clone(pbuf, bbuf2); - } - else { - return not_code_range_buf(enc, bbuf2, pbuf); - } - } - } - - if (not1 != 0) - SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); - - data1 = (OnigCodePoint* )(bbuf1->p); - GET_CODE_POINT(n1, data1); - data1++; - - if (not2 == 0 && not1 == 0) { /* 1 OR 2 */ - r = bbuf_clone(pbuf, bbuf2); - } - else if (not1 == 0) { /* 1 OR (not 2) */ - r = not_code_range_buf(enc, bbuf2, pbuf); - } - if (r != 0) return r; - - for (i = 0; i < n1; i++) { - from = data1[i*2]; - to = data1[i*2+1]; - r = add_code_range_to_buf(pbuf, from, to); - if (r != 0) return r; - } - return 0; -} - -static int -and_code_range1(BBuf** pbuf, OnigCodePoint from1, OnigCodePoint to1, - OnigCodePoint* data, int n) -{ - int i, r; - OnigCodePoint from2, to2; - - for (i = 0; i < n; i++) { - from2 = data[i*2]; - to2 = data[i*2+1]; - if (from2 < from1) { - if (to2 < from1) continue; - else { - from1 = to2 + 1; - } - } - else if (from2 <= to1) { - if (to2 < to1) { - if (from1 <= from2 - 1) { - r = add_code_range_to_buf(pbuf, from1, from2-1); - if (r != 0) return r; - } - from1 = to2 + 1; - } - else { - to1 = from2 - 1; - } - } - else { - from1 = from2; - } - if (from1 > to1) break; - } - if (from1 <= to1) { - r = add_code_range_to_buf(pbuf, from1, to1); - if (r != 0) return r; - } - return 0; -} - -static int -and_code_range_buf(BBuf* bbuf1, int not1, BBuf* bbuf2, int not2, BBuf** pbuf) -{ - int r; - OnigCodePoint i, j, n1, n2, *data1, *data2; - OnigCodePoint from, to, from1, to1, from2, to2; - - *pbuf = (BBuf* )NULL; - if (IS_NULL(bbuf1)) { - if (not1 != 0 && IS_NOT_NULL(bbuf2)) /* not1 != 0 -> not2 == 0 */ - return bbuf_clone(pbuf, bbuf2); - return 0; - } - else if (IS_NULL(bbuf2)) { - if (not2 != 0) - return bbuf_clone(pbuf, bbuf1); - return 0; - } - - if (not1 != 0) - SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); - - data1 = (OnigCodePoint* )(bbuf1->p); - data2 = (OnigCodePoint* )(bbuf2->p); - GET_CODE_POINT(n1, data1); - GET_CODE_POINT(n2, data2); - data1++; - data2++; - - if (not2 == 0 && not1 == 0) { /* 1 AND 2 */ - for (i = 0; i < n1; i++) { - from1 = data1[i*2]; - to1 = data1[i*2+1]; - for (j = 0; j < n2; j++) { - from2 = data2[j*2]; - to2 = data2[j*2+1]; - if (from2 > to1) break; - if (to2 < from1) continue; - from = MAX(from1, from2); - to = MIN(to1, to2); - r = add_code_range_to_buf(pbuf, from, to); - if (r != 0) return r; - } - } - } - else if (not1 == 0) { /* 1 AND (not 2) */ - for (i = 0; i < n1; i++) { - from1 = data1[i*2]; - to1 = data1[i*2+1]; - r = and_code_range1(pbuf, from1, to1, data2, n2); - if (r != 0) return r; - } - } - - return 0; -} - -static int -clear_not_flag_cclass(CClassNode* cc, OnigEncoding enc) -{ - BBuf *tbuf; - int r; - - if (IS_CCLASS_NOT(cc)) { - bitset_invert(cc->bs); - - if (! ONIGENC_IS_SINGLEBYTE(enc)) { - r = not_code_range_buf(enc, cc->mbuf, &tbuf); - if (r != 0) return r; - - bbuf_free(cc->mbuf); - cc->mbuf = tbuf; - } - - CCLASS_CLEAR_NOT(cc); - } - - return 0; -} - -static int -and_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc) -{ - int r, not1, not2; - BBuf *buf1, *buf2, *pbuf; - BitSetRef bsr1, bsr2; - BitSet bs1, bs2; - - not1 = IS_CCLASS_NOT(dest); - bsr1 = dest->bs; - buf1 = dest->mbuf; - not2 = IS_CCLASS_NOT(cc); - bsr2 = cc->bs; - buf2 = cc->mbuf; - - if (not1 != 0) { - bitset_invert_to(bsr1, bs1); - bsr1 = bs1; - } - if (not2 != 0) { - bitset_invert_to(bsr2, bs2); - bsr2 = bs2; - } - bitset_and(bsr1, bsr2); - if (bsr1 != dest->bs) { - bitset_copy(dest->bs, bsr1); - bsr1 = dest->bs; - } - if (not1 != 0) { - bitset_invert(dest->bs); - } - - if (! ONIGENC_IS_SINGLEBYTE(enc)) { - if (not1 != 0 && not2 != 0) { - r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf); - } - else { - r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf); - if (r == 0 && not1 != 0) { - BBuf *tbuf; - r = not_code_range_buf(enc, pbuf, &tbuf); - if (r != 0) { - bbuf_free(pbuf); - return r; - } - bbuf_free(pbuf); - pbuf = tbuf; - } - } - if (r != 0) return r; - - dest->mbuf = pbuf; - bbuf_free(buf1); - return r; - } - return 0; -} - -static int -or_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc) -{ - int r, not1, not2; - BBuf *buf1, *buf2, *pbuf; - BitSetRef bsr1, bsr2; - BitSet bs1, bs2; - - not1 = IS_CCLASS_NOT(dest); - bsr1 = dest->bs; - buf1 = dest->mbuf; - not2 = IS_CCLASS_NOT(cc); - bsr2 = cc->bs; - buf2 = cc->mbuf; - - if (not1 != 0) { - bitset_invert_to(bsr1, bs1); - bsr1 = bs1; - } - if (not2 != 0) { - bitset_invert_to(bsr2, bs2); - bsr2 = bs2; - } - bitset_or(bsr1, bsr2); - if (bsr1 != dest->bs) { - bitset_copy(dest->bs, bsr1); - bsr1 = dest->bs; - } - if (not1 != 0) { - bitset_invert(dest->bs); - } - - if (! ONIGENC_IS_SINGLEBYTE(enc)) { - if (not1 != 0 && not2 != 0) { - r = and_code_range_buf(buf1, 0, buf2, 0, &pbuf); - } - else { - r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf); - if (r == 0 && not1 != 0) { - BBuf *tbuf; - r = not_code_range_buf(enc, pbuf, &tbuf); - if (r != 0) { - bbuf_free(pbuf); - return r; - } - bbuf_free(pbuf); - pbuf = tbuf; - } - } - if (r != 0) return r; - - dest->mbuf = pbuf; - bbuf_free(buf1); - return r; - } - else - return 0; -} - -static int -conv_backslash_value(int c, ScanEnv* env) -{ - if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_CONTROL_CHARS)) { - switch (c) { - case 'n': return '\n'; - case 't': return '\t'; - case 'r': return '\r'; - case 'f': return '\f'; - case 'a': return '\007'; - case 'b': return '\010'; - case 'e': return '\033'; - case 'v': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_V_VTAB)) - return '\v'; - break; - - default: - break; - } - } - return c; -} - -static int -is_invalid_qualifier_target(Node* node) -{ - switch (NTYPE(node)) { - case N_ANCHOR: - return 1; - break; - - case N_EFFECT: - if (NEFFECT(node).type == EFFECT_OPTION) - return is_invalid_qualifier_target(NEFFECT(node).target); - break; - - case N_LIST: /* ex. (?:\G\A)* */ - do { - if (! is_invalid_qualifier_target(NCONS(node).left)) return 0; - } while (IS_NOT_NULL(node = NCONS(node).right)); - return 0; - break; - - case N_ALT: /* ex. (?:abc|\A)* */ - do { - if (is_invalid_qualifier_target(NCONS(node).left)) return 1; - } while (IS_NOT_NULL(node = NCONS(node).right)); - break; - - default: - break; - } - return 0; -} - -/* ?:0, *:1, +:2, ??:3, *?:4, +?:5 */ -static int -popular_qualifier_num(QualifierNode* qf) -{ - if (qf->greedy) { - if (qf->lower == 0) { - if (qf->upper == 1) return 0; - else if (IS_REPEAT_INFINITE(qf->upper)) return 1; - } - else if (qf->lower == 1) { - if (IS_REPEAT_INFINITE(qf->upper)) return 2; - } - } - else { - if (qf->lower == 0) { - if (qf->upper == 1) return 3; - else if (IS_REPEAT_INFINITE(qf->upper)) return 4; - } - else if (qf->lower == 1) { - if (IS_REPEAT_INFINITE(qf->upper)) return 5; - } - } - return -1; -} - - -enum ReduceType { - RQ_ASIS = 0, /* as is */ - RQ_DEL = 1, /* delete parent */ - RQ_A, /* to '*' */ - RQ_AQ, /* to '*?' */ - RQ_QQ, /* to '??' */ - RQ_P_QQ, /* to '+)??' */ - RQ_PQ_Q, /* to '+?)?' */ -}; - -static enum ReduceType ReduceTypeTable[6][6] = { - {RQ_DEL, RQ_A, RQ_A, RQ_QQ, RQ_AQ, RQ_ASIS}, /* '?' */ - {RQ_DEL, RQ_DEL, RQ_DEL, RQ_P_QQ, RQ_P_QQ, RQ_DEL}, /* '*' */ - {RQ_A, RQ_A, RQ_DEL, RQ_ASIS, RQ_P_QQ, RQ_DEL}, /* '+' */ - {RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL, RQ_AQ, RQ_AQ}, /* '??' */ - {RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL}, /* '*?' */ - {RQ_ASIS, RQ_PQ_Q, RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL} /* '+?' */ -}; - -extern void -onig_reduce_nested_qualifier(Node* pnode, Node* cnode) -{ - int pnum, cnum; - QualifierNode *p, *c; - - p = &(NQUALIFIER(pnode)); - c = &(NQUALIFIER(cnode)); - pnum = popular_qualifier_num(p); - cnum = popular_qualifier_num(c); - - switch(ReduceTypeTable[cnum][pnum]) { - case RQ_DEL: - *p = *c; - break; - case RQ_A: - p->target = c->target; - p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 1; - break; - case RQ_AQ: - p->target = c->target; - p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 0; - break; - case RQ_QQ: - p->target = c->target; - p->lower = 0; p->upper = 1; p->greedy = 0; - break; - case RQ_P_QQ: - p->target = cnode; - p->lower = 0; p->upper = 1; p->greedy = 0; - c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 1; - return ; - break; - case RQ_PQ_Q: - p->target = cnode; - p->lower = 0; p->upper = 1; p->greedy = 1; - c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 0; - return ; - break; - case RQ_ASIS: - p->target = cnode; - return ; - break; - } - - c->target = NULL_NODE; - onig_node_free(cnode); -} - - -enum TokenSyms { - TK_EOT = 0, /* end of token */ - TK_RAW_BYTE = 1, - TK_CHAR, - TK_STRING, - TK_CODE_POINT, - TK_ANYCHAR, - TK_CHAR_TYPE, - TK_BACKREF, - TK_CALL, - TK_ANCHOR, - TK_OP_REPEAT, - TK_INTERVAL, - TK_ANYCHAR_ANYTIME, /* SQL '%' == .* */ - TK_ALT, - TK_SUBEXP_OPEN, - TK_SUBEXP_CLOSE, - TK_CC_OPEN, - TK_QUOTE_OPEN, - TK_CHAR_PROPERTY, /* \p{...}, \P{...} */ - /* in cc */ - TK_CC_CLOSE, - TK_CC_RANGE, - TK_POSIX_BRACKET_OPEN, - TK_CC_AND, /* && */ - TK_CC_CC_OPEN /* [ */ -}; - -typedef struct { - enum TokenSyms type; - int escaped; - int base; /* is number: 8, 16 (used in [....]) */ - UChar* backp; - union { - UChar* s; - int c; - OnigCodePoint code; - int anchor; - int subtype; - struct { - int lower; - int upper; - int greedy; - int possessive; - } repeat; - struct { - int num; - int ref1; - int* refs; - int by_name; - } backref; - struct { - UChar* name; - UChar* name_end; - } call; - struct { - int not; - } prop; - } u; -} OnigToken; - - -static int -fetch_range_qualifier(UChar** src, UChar* end, OnigToken* tok, ScanEnv* env) -{ - int low, up, syn_allow, non_low = 0; - int r = 0; - OnigCodePoint c; - OnigEncoding enc = env->enc; - UChar* p = *src; - PFETCH_READY; - - syn_allow = IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INVALID_INTERVAL); - - if (PEND) { - if (syn_allow) - return 1; /* "....{" : OK! */ - else - return ONIGERR_END_PATTERN_AT_LEFT_BRACE; /* "....{" syntax error */ - } - - if (! syn_allow) { - c = PPEEK; - if (c == ')' || c == '(' || c == '|') { - return ONIGERR_END_PATTERN_AT_LEFT_BRACE; - } - } - - low = onig_scan_unsigned_number(&p, end, env->enc); - if (low < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; - if (low > ONIG_MAX_REPEAT_NUM) - return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; - - if (p == *src) { /* can't read low */ - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV)) { - /* allow {,n} as {0,n} */ - low = 0; - non_low = 1; - } - else - goto invalid; - } - - if (PEND) goto invalid; - PFETCH(c); - if (c == ',') { - UChar* prev = p; - up = onig_scan_unsigned_number(&p, end, env->enc); - if (up < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; - if (up > ONIG_MAX_REPEAT_NUM) - return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; - - if (p == prev) { - if (non_low != 0) - goto invalid; - up = REPEAT_INFINITE; /* {n,} : {n,infinite} */ - } - } - else { - if (non_low != 0) - goto invalid; - - PUNFETCH; - up = low; /* {n} : exact n times */ - r = 2; /* fixed */ - } - - if (PEND) goto invalid; - PFETCH(c); - if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) { - if (c != MC_ESC(enc)) goto invalid; - PFETCH(c); - } - if (c != '}') goto invalid; - - if (!IS_REPEAT_INFINITE(up) && low > up) { - return ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE; - } - - tok->type = TK_INTERVAL; - tok->u.repeat.lower = low; - tok->u.repeat.upper = up; - *src = p; - return r; /* 0: normal {n,m}, 2: fixed {n} */ - - invalid: - if (syn_allow) - return 1; /* OK */ - else - return ONIGERR_INVALID_REPEAT_RANGE_PATTERN; -} - -/* \M-, \C-, \c, or \... */ -static int -fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env) -{ - int v; - OnigCodePoint c; - OnigEncoding enc = env->enc; - UChar* p = *src; - PFETCH_READY; - - if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE; - - PFETCH(c); - switch (c) { - case 'M': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META)) { - if (PEND) return ONIGERR_END_PATTERN_AT_META; - PFETCH(c); - if (c != '-') return ONIGERR_META_CODE_SYNTAX; - if (PEND) return ONIGERR_END_PATTERN_AT_META; - PFETCH(c); - if (c == MC_ESC(enc)) { - v = fetch_escaped_value(&p, end, env); - if (v < 0) return v; - c = (OnigCodePoint )v; - } - c = ((c & 0xff) | 0x80); - } - else - goto backslash; - break; - - case 'C': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL)) { - if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL; - PFETCH(c); - if (c != '-') return ONIGERR_CONTROL_CODE_SYNTAX; - goto control; - } - else - goto backslash; - - case 'c': - if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_C_CONTROL)) { - control: - if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL; - PFETCH(c); - if (c == MC_ESC(enc)) { - v = fetch_escaped_value(&p, end, env); - if (v < 0) return v; - c = (OnigCodePoint )v; - } - else if (c == '?') - c = 0177; - else - c &= 0x9f; - break; - } - /* fall through */ - - default: - { - backslash: - c = conv_backslash_value(c, env); - } - break; - } - - *src = p; - return c; -} - -static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env); - -#ifdef USE_NAMED_GROUP -/* - def: 0 -> define name (don't allow number name) - 1 -> reference name (allow number name) -*/ -static int -fetch_name(UChar** src, UChar* end, UChar** rname_end, ScanEnv* env, int ref) -{ - int r, is_num; - OnigCodePoint c = 0; - OnigCodePoint first_code; - OnigEncoding enc = env->enc; - UChar *name_end; - UChar *p = *src; - PFETCH_READY; - - name_end = end; - r = 0; - is_num = 0; - if (PEND) { - return ONIGERR_EMPTY_GROUP_NAME; - } - else { - PFETCH(c); - first_code = c; - if (c == '>') - return ONIGERR_EMPTY_GROUP_NAME; - - if (ONIGENC_IS_CODE_DIGIT(enc, c)) { - if (ref == 1) - is_num = 1; - else { - r = ONIGERR_INVALID_GROUP_NAME; - } - } - else if (!ONIGENC_IS_CODE_WORD(enc, c)) { - r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; - } - } - - while (!PEND) { - name_end = p; - PFETCH(c); - if (c == '>' || c == ')') break; - - if (is_num == 1) { - if (! ONIGENC_IS_CODE_DIGIT(enc, c)) { - if (!ONIGENC_IS_CODE_WORD(enc, c)) - r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; - else - r = ONIGERR_INVALID_GROUP_NAME; - } - } - else { - if (!ONIGENC_IS_CODE_WORD(enc, c)) { - r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; - } - } - } - - if (c != '>') { - r = ONIGERR_INVALID_GROUP_NAME; - name_end = end; - } - else { - if (ONIGENC_IS_CODE_ASCII(first_code) && - ONIGENC_IS_CODE_UPPER(enc, first_code)) - r = ONIGERR_INVALID_GROUP_NAME; - } - - if (r == 0) { - *rname_end = name_end; - *src = p; - return 0; - } - else { - onig_scan_env_set_error_string(env, r, *src, name_end); - return r; - } -} -#else -static int -fetch_name(UChar** src, UChar* end, UChar** rname_end, ScanEnv* env, int ref) -{ - int r, len; - OnigCodePoint c = 0; - UChar *name_end; - OnigEncoding enc = env->enc; - UChar *p = *src; - PFETCH_READY; - - r = 0; - while (!PEND) { - name_end = p; - if (enc_len(enc, p) > 1) - r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; - - PFETCH(c); - if (c == '>' || c == ')') break; - if (! ONIGENC_IS_CODE_DIGIT(enc, c)) - r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; - } - if (c != '>') { - r = ONIGERR_INVALID_GROUP_NAME; - name_end = end; - } - - if (r == 0) { - *rname_end = name_end; - *src = p; - return 0; - } - else { - err: - onig_scan_env_set_error_string(env, r, *src, name_end); - return r; - } -} -#endif - -static void -CC_ESC_WARN(ScanEnv* env, UChar *c) -{ - if (onig_warn == onig_null_warn) return ; - - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED) && - IS_SYNTAX_BV(env->syntax, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) { - char buf[WARN_BUFSIZE]; - onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, - env->pattern, env->pattern_end, - "character class has '%s' without escape", c); - (*onig_warn)(buf); - } -} - -static void -CCEND_ESC_WARN(ScanEnv* env, UChar* c) -{ - if (onig_warn == onig_null_warn) return ; - - if (IS_SYNTAX_BV((env)->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED)) { - char buf[WARN_BUFSIZE]; - onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc, - (env)->pattern, (env)->pattern_end, - "regular expression has '%s' without escape", c); - (*onig_warn)(buf); - } -} - -static UChar* -find_str_position(OnigCodePoint s[], int n, UChar* from, UChar* to, - UChar **next, OnigEncoding enc) -{ - int i; - OnigCodePoint x; - UChar *q; - UChar *p = from; - - while (p < to) { - x = ONIGENC_MBC_TO_CODE(enc, p, to); - q = p + enc_len(enc, p); - if (x == s[0]) { - for (i = 1; i < n && q < to; i++) { - x = ONIGENC_MBC_TO_CODE(enc, q, to); - if (x != s[i]) break; - q += enc_len(enc, q); - } - if (i >= n) { - if (IS_NOT_NULL(next)) - *next = q; - return p; - } - } - p = q; - } - return NULL_UCHARP; -} - -static int -str_exist_check_with_esc(OnigCodePoint s[], int n, UChar* from, UChar* to, - OnigCodePoint bad, OnigEncoding enc) -{ - int i, in_esc; - OnigCodePoint x; - UChar *q; - UChar *p = from; - - in_esc = 0; - while (p < to) { - if (in_esc) { - in_esc = 0; - p += enc_len(enc, p); - } - else { - x = ONIGENC_MBC_TO_CODE(enc, p, to); - q = p + enc_len(enc, p); - if (x == s[0]) { - for (i = 1; i < n && q < to; i++) { - x = ONIGENC_MBC_TO_CODE(enc, q, to); - if (x != s[i]) break; - q += enc_len(enc, q); - } - if (i >= n) return 1; - p += enc_len(enc, p); - } - else { - x = ONIGENC_MBC_TO_CODE(enc, p, to); - if (x == bad) return 0; - else if (x == MC_ESC(enc)) in_esc = 1; - p = q; - } - } - } - return 0; -} - -static int -fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) -{ - int num; - OnigCodePoint c, c2; - OnigSyntaxType* syn = env->syntax; - OnigEncoding enc = env->enc; - UChar* prev; - UChar* p = *src; - PFETCH_READY; - - if (PEND) { - tok->type = TK_EOT; - return tok->type; - } - - PFETCH(c); - tok->type = TK_CHAR; - tok->base = 0; - tok->u.c = c; - if (c == ']') { - tok->type = TK_CC_CLOSE; - } - else if (c == '-') { - tok->type = TK_CC_RANGE; - } - else if (c == MC_ESC(enc)) { - if (! IS_SYNTAX_BV(syn, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) - goto end; - - if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE; - - PFETCH(c); - tok->escaped = 1; - tok->u.c = c; - switch (c) { - case 'w': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_WORD; - break; - case 'W': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_WORD; - break; - case 'd': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_DIGIT; - break; - case 'D': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_DIGIT; - break; - case 's': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_WHITE_SPACE; - break; - case 'S': - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_WHITE_SPACE; - break; - case 'h': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_XDIGIT; - break; - case 'H': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_XDIGIT; - break; - - case 'p': - case 'P': - c2 = PPEEK; - if (c2 == '{' && - IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) { - PINC; - tok->type = TK_CHAR_PROPERTY; - tok->u.prop.not = (c == 'P' ? 1 : 0); - - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) { - PFETCH(c2); - if (c2 == '^') { - tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0); - } - else - PUNFETCH; - } - } - break; - - case 'x': - if (PEND) break; - - prev = p; - if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) { - PINC; - num = scan_unsigned_hexadecimal_number(&p, end, 8, enc); - if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; - if (!PEND) { - c2 = PPEEK; - if (ONIGENC_IS_CODE_XDIGIT(enc, c2)) - return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; - } - - if (p > prev + enc_len(enc, prev) && !PEND && (PPEEK_IS('}'))) { - PINC; - tok->type = TK_CODE_POINT; - tok->base = 16; - tok->u.code = (OnigCodePoint )num; - } - else { - /* can't read nothing or invalid format */ - p = prev; - } - } - else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) { - num = scan_unsigned_hexadecimal_number(&p, end, 2, enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_RAW_BYTE; - tok->base = 16; - tok->u.c = num; - } - break; - - case 'u': - if (PEND) break; - - prev = p; - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) { - num = scan_unsigned_hexadecimal_number(&p, end, 4, enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_CODE_POINT; - tok->base = 16; - tok->u.code = (OnigCodePoint )num; - } - break; - - case '0': - case '1': case '2': case '3': case '4': case '5': case '6': case '7': - if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) { - PUNFETCH; - prev = p; - num = scan_unsigned_octal_number(&p, end, 3, enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_RAW_BYTE; - tok->base = 8; - tok->u.c = num; - } - break; - - default: - PUNFETCH; - num = fetch_escaped_value(&p, end, env); - if (num < 0) return num; - if (tok->u.c != num) { - tok->u.code = (OnigCodePoint )num; - tok->type = TK_CODE_POINT; - } - break; - } - } - else if (c == '[') { - if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) { - OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' }; - tok->backp = p; /* point at '[' is readed */ - PINC; - if (str_exist_check_with_esc(send, 2, p, end, - (OnigCodePoint )']', enc)) { - tok->type = TK_POSIX_BRACKET_OPEN; - } - else { - PUNFETCH; - goto cc_in_cc; - } - } - else { - cc_in_cc: - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP)) { - tok->type = TK_CC_CC_OPEN; - } - else { - CC_ESC_WARN(env, "["); - } - } - } - else if (c == '&') { - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP) && - !PEND && (PPEEK_IS('&'))) { - PINC; - tok->type = TK_CC_AND; - } - } - - end: - *src = p; - return tok->type; -} - -static int -fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) -{ - int r, num; - OnigCodePoint c; - OnigEncoding enc = env->enc; - OnigSyntaxType* syn = env->syntax; - UChar* prev; - UChar* p = *src; - PFETCH_READY; - - start: - if (PEND) { - tok->type = TK_EOT; - return tok->type; - } - - tok->type = TK_STRING; - tok->base = 0; - tok->backp = p; - - PFETCH(c); - if (c == MC_ESC(enc)) { - if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE; - - tok->backp = p; - PFETCH(c); - - tok->u.c = c; - tok->escaped = 1; - switch (c) { - case '*': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF)) break; - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 0; - tok->u.repeat.upper = REPEAT_INFINITE; - goto greedy_check; - break; - - case '+': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_PLUS_ONE_INF)) break; - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 1; - tok->u.repeat.upper = REPEAT_INFINITE; - goto greedy_check; - break; - - case '?': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_QMARK_ZERO_ONE)) break; - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 0; - tok->u.repeat.upper = 1; - greedy_check: - if (!PEND && PPEEK_IS('?') && - IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_NON_GREEDY)) { - PFETCH(c); - tok->u.repeat.greedy = 0; - tok->u.repeat.possessive = 0; - } - else { - possessive_check: - if (!PEND && PPEEK_IS('+') && - ((IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT) && - tok->type != TK_INTERVAL) || - (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL) && - tok->type == TK_INTERVAL))) { - PFETCH(c); - tok->u.repeat.greedy = 1; - tok->u.repeat.possessive = 1; - } - else { - tok->u.repeat.greedy = 1; - tok->u.repeat.possessive = 0; - } - } - break; - - case '{': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) break; - r = fetch_range_qualifier(&p, end, tok, env); - if (r < 0) return r; /* error */ - if (r == 0) goto greedy_check; - else if (r == 2) { /* {n} */ - if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY)) - goto possessive_check; - - goto greedy_check; - } - /* r == 1 : normal char */ - break; - - case '|': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_VBAR_ALT)) break; - tok->type = TK_ALT; - break; - - case '(': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break; - tok->type = TK_SUBEXP_OPEN; - break; - - case ')': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break; - tok->type = TK_SUBEXP_CLOSE; - break; - - case 'w': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_WORD; - break; - - case 'W': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_WORD; - break; - - case 'b': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break; - tok->type = TK_ANCHOR; - tok->u.anchor = ANCHOR_WORD_BOUND; - break; - - case 'B': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break; - tok->type = TK_ANCHOR; - tok->u.anchor = ANCHOR_NOT_WORD_BOUND; - break; - -#ifdef USE_WORD_BEGIN_END - case '<': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break; - tok->type = TK_ANCHOR; - tok->u.anchor = ANCHOR_WORD_BEGIN; - break; - - case '>': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break; - tok->type = TK_ANCHOR; - tok->u.anchor = ANCHOR_WORD_END; - break; -#endif - - case 's': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_WHITE_SPACE; - break; - - case 'S': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_WHITE_SPACE; - break; - - case 'd': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_DIGIT; - break; - - case 'D': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_DIGIT; - break; - - case 'h': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_XDIGIT; - break; - - case 'H': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; - tok->type = TK_CHAR_TYPE; - tok->u.subtype = CTYPE_NOT_XDIGIT; - break; - - case 'A': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break; - begin_buf: - tok->type = TK_ANCHOR; - tok->u.subtype = ANCHOR_BEGIN_BUF; - break; - - case 'Z': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break; - tok->type = TK_ANCHOR; - tok->u.subtype = ANCHOR_SEMI_END_BUF; - break; - - case 'z': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break; - end_buf: - tok->type = TK_ANCHOR; - tok->u.subtype = ANCHOR_END_BUF; - break; - - case 'G': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR)) break; - tok->type = TK_ANCHOR; - tok->u.subtype = ANCHOR_BEGIN_POSITION; - break; - - case '`': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break; - goto begin_buf; - break; - - case '\'': - if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break; - goto end_buf; - break; - - case 'x': - if (PEND) break; - - prev = p; - if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) { - PINC; - num = scan_unsigned_hexadecimal_number(&p, end, 8, enc); - if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; - if (!PEND) { - if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK)) - return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; - } - - if ((p > prev + enc_len(enc, prev)) && !PEND && PPEEK_IS('}')) { - PINC; - tok->type = TK_CODE_POINT; - tok->u.code = (OnigCodePoint )num; - } - else { - /* can't read nothing or invalid format */ - p = prev; - } - } - else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) { - num = scan_unsigned_hexadecimal_number(&p, end, 2, enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_RAW_BYTE; - tok->base = 16; - tok->u.c = num; - } - break; - - case 'u': - if (PEND) break; - - prev = p; - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) { - num = scan_unsigned_hexadecimal_number(&p, end, 4, enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_CODE_POINT; - tok->base = 16; - tok->u.code = (OnigCodePoint )num; - } - break; - - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - PUNFETCH; - prev = p; - num = onig_scan_unsigned_number(&p, end, enc); - if (num < 0 || num > ONIG_MAX_BACKREF_NUM) { - goto skip_backref; - } - - if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_DECIMAL_BACKREF) && - (num <= env->num_mem || num <= 9)) { /* This spec. from GNU regex */ - if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) { - if (num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[num])) - return ONIGERR_INVALID_BACKREF; - } - - tok->type = TK_BACKREF; - tok->u.backref.num = 1; - tok->u.backref.ref1 = num; - tok->u.backref.by_name = 0; - break; - } - - skip_backref: - if (c == '8' || c == '9') { - /* normal char */ - p = prev; PINC; - break; - } - - p = prev; - /* fall through */ - case '0': - if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) { - prev = p; - num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc); - if (num < 0) return ONIGERR_TOO_BIG_NUMBER; - if (p == prev) { /* can't read nothing. */ - num = 0; /* but, it's not error */ - } - tok->type = TK_RAW_BYTE; - tok->base = 8; - tok->u.c = num; - } - else if (c != '0') { - PINC; - } - break; - -#ifdef USE_NAMED_GROUP - case 'k': - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) { - PFETCH(c); - if (c == '<') { - UChar* name_end; - int* backs; - - prev = p; - r = fetch_name(&p, end, &name_end, env, 1); - if (r < 0) return r; - num = onig_name_to_group_numbers(env->reg, prev, name_end, &backs); - if (num <= 0) { - onig_scan_env_set_error_string(env, - ONIGERR_UNDEFINED_NAME_REFERENCE, prev, name_end); - return ONIGERR_UNDEFINED_NAME_REFERENCE; - } - if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) { - int i; - for (i = 0; i < num; i++) { - if (backs[i] > env->num_mem || - IS_NULL(SCANENV_MEM_NODES(env)[backs[i]])) - return ONIGERR_INVALID_BACKREF; - } - } - - tok->type = TK_BACKREF; - tok->u.backref.by_name = 1; - if (num == 1) { - tok->u.backref.num = 1; - tok->u.backref.ref1 = backs[0]; - } - else { - tok->u.backref.num = num; - tok->u.backref.refs = backs; - } - } - else - PUNFETCH; - } - break; -#endif - -#ifdef USE_SUBEXP_CALL - case 'g': - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) { - PFETCH(c); - if (c == '<') { - UChar* name_end; - - prev = p; - r = fetch_name(&p, end, &name_end, env, 1); - if (r < 0) return r; - - tok->type = TK_CALL; - tok->u.call.name = prev; - tok->u.call.name_end = name_end; - } - else - PUNFETCH; - } - break; -#endif - - case 'Q': - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE)) { - tok->type = TK_QUOTE_OPEN; - } - break; - - case 'p': - case 'P': - if (PPEEK_IS('{') && - IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) { - PINC; - tok->type = TK_CHAR_PROPERTY; - tok->u.prop.not = (c == 'P' ? 1 : 0); - - if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) { - PFETCH(c); - if (c == '^') { - tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0); - } - else - PUNFETCH; - } - } - break; - - default: - PUNFETCH; - num = fetch_escaped_value(&p, end, env); - if (num < 0) return num; - /* set_raw: */ - if (tok->u.c != num) { - tok->type = TK_CODE_POINT; - tok->u.code = (OnigCodePoint )num; - } - else { /* string */ - p = tok->backp + enc_len(enc, tok->backp); - } - break; - } - } - else { - tok->u.c = c; - tok->escaped = 0; - -#ifdef USE_VARIABLE_META_CHARS - if ((c != ONIG_INEFFECTIVE_META_CHAR) && - IS_SYNTAX_OP(syn, ONIG_SYN_OP_VARIABLE_META_CHARACTERS)) { - if (c == MC_ANYCHAR(enc)) - goto any_char; - else if (c == MC_ANYTIME(enc)) - goto anytime; - else if (c == MC_ZERO_OR_ONE_TIME(enc)) - goto zero_or_one_time; - else if (c == MC_ONE_OR_MORE_TIME(enc)) - goto one_or_more_time; - else if (c == MC_ANYCHAR_ANYTIME(enc)) { - tok->type = TK_ANYCHAR_ANYTIME; - goto out; - } - } -#endif - - switch (c) { - case '.': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_DOT_ANYCHAR)) break; - any_char: - tok->type = TK_ANYCHAR; - break; - - case '*': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ASTERISK_ZERO_INF)) break; - anytime: - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 0; - tok->u.repeat.upper = REPEAT_INFINITE; - goto greedy_check; - break; - - case '+': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_PLUS_ONE_INF)) break; - one_or_more_time: - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 1; - tok->u.repeat.upper = REPEAT_INFINITE; - goto greedy_check; - break; - - case '?': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_ZERO_ONE)) break; - zero_or_one_time: - tok->type = TK_OP_REPEAT; - tok->u.repeat.lower = 0; - tok->u.repeat.upper = 1; - goto greedy_check; - break; - - case '{': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACE_INTERVAL)) break; - r = fetch_range_qualifier(&p, end, tok, env); - if (r < 0) return r; /* error */ - if (r == 0) goto greedy_check; - else if (r == 2) { /* {n} */ - if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY)) - goto possessive_check; - - goto greedy_check; - } - /* r == 1 : normal char */ - break; - - case '|': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_VBAR_ALT)) break; - tok->type = TK_ALT; - break; - - case '(': - if (PPEEK_IS('?') && - IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) { - PINC; - if (PPEEK_IS('#')) { - PFETCH(c); - while (1) { - if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; - PFETCH(c); - if (c == MC_ESC(enc)) { - if (!PEND) PFETCH(c); - } - else { - if (c == ')') break; - } - } - goto start; - } - PUNFETCH; - } - - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break; - tok->type = TK_SUBEXP_OPEN; - break; - - case ')': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break; - tok->type = TK_SUBEXP_CLOSE; - break; - - case '^': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break; - tok->type = TK_ANCHOR; - tok->u.subtype = (IS_SINGLELINE(env->option) - ? ANCHOR_BEGIN_BUF : ANCHOR_BEGIN_LINE); - break; - - case '$': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break; - tok->type = TK_ANCHOR; - tok->u.subtype = (IS_SINGLELINE(env->option) - ? ANCHOR_END_BUF : ANCHOR_END_LINE); - break; - - case '[': - if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACKET_CC)) break; - tok->type = TK_CC_OPEN; - break; - - case ']': - if (*src > env->pattern) /* /].../ is allowed. */ - CCEND_ESC_WARN(env, "]"); - break; - - case '#': - if (IS_EXTEND(env->option)) { - while (!PEND) { - PFETCH(c); - if (ONIGENC_IS_CODE_NEWLINE(enc, c)) - break; - } - goto start; - break; - } - break; - - case ' ': case '\t': case '\n': case '\r': case '\f': - if (IS_EXTEND(env->option)) - goto start; - break; - - default: - /* string */ - break; - } - } - - out: - *src = p; - return tok->type; -} - -static int -add_ctype_to_cc_by_range(CClassNode* cc, int ctype, int not, OnigEncoding enc, - OnigCodePoint sbr[], OnigCodePoint mbr[]) -{ - int i, r; - OnigCodePoint j; - - int nsb = ONIGENC_CODE_RANGE_NUM(sbr); - int nmb = ONIGENC_CODE_RANGE_NUM(mbr); - - if (not == 0) { - for (i = 0; i < nsb; i++) { - for (j = ONIGENC_CODE_RANGE_FROM(sbr, i); - j <= ONIGENC_CODE_RANGE_TO(sbr, i); j++) { - BITSET_SET_BIT(cc->bs, j); - } - } - - for (i = 0; i < nmb; i++) { - r = add_code_range_to_buf(&(cc->mbuf), - ONIGENC_CODE_RANGE_FROM(mbr, i), - ONIGENC_CODE_RANGE_TO(mbr, i)); - if (r != 0) return r; - } - } - else { - OnigCodePoint prev = 0; - - if (ONIGENC_MBC_MINLEN(enc) == 1) { - for (i = 0; i < nsb; i++) { - for (j = prev; - j < ONIGENC_CODE_RANGE_FROM(sbr, i); j++) { - BITSET_SET_BIT(cc->bs, j); - } - prev = ONIGENC_CODE_RANGE_TO(sbr, i) + 1; - } - if (prev < 0x7f) { - for (j = prev; j < 0x7f; j++) { - BITSET_SET_BIT(cc->bs, j); - } - } - - prev = 0x80; - } - - for (i = 0; i < nmb; i++) { - if (prev < ONIGENC_CODE_RANGE_FROM(mbr, i)) { - r = add_code_range_to_buf(&(cc->mbuf), prev, - ONIGENC_CODE_RANGE_FROM(mbr, i) - 1); - if (r != 0) return r; - } - prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1; - } - if (prev < 0x7fffffff) { - r = add_code_range_to_buf(&(cc->mbuf), prev, 0x7fffffff); - if (r != 0) return r; - } - } - - return 0; -} - -static int -add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) -{ - int c, r; - OnigCodePoint *sbr, *mbr; - OnigEncoding enc = env->enc; - - r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sbr, &mbr); - if (r == 0) { - return add_ctype_to_cc_by_range(cc, ctype, not, env->enc, sbr, mbr); - } - else if (r != ONIG_NO_SUPPORT_CONFIG) { - return r; - } - - r = 0; - switch (ctype) { - case ONIGENC_CTYPE_ALPHA: - case ONIGENC_CTYPE_BLANK: - case ONIGENC_CTYPE_CNTRL: - case ONIGENC_CTYPE_DIGIT: - case ONIGENC_CTYPE_LOWER: - case ONIGENC_CTYPE_PUNCT: - case ONIGENC_CTYPE_SPACE: - case ONIGENC_CTYPE_UPPER: - case ONIGENC_CTYPE_XDIGIT: - case ONIGENC_CTYPE_ASCII: - case ONIGENC_CTYPE_ALNUM: - if (not != 0) { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) - BITSET_SET_BIT(cc->bs, c); - } - ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); - } - else { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) - BITSET_SET_BIT(cc->bs, c); - } - } - break; - - case ONIGENC_CTYPE_GRAPH: - case ONIGENC_CTYPE_PRINT: - if (not != 0) { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) - BITSET_SET_BIT(cc->bs, c); - } - } - else { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) - BITSET_SET_BIT(cc->bs, c); - } - ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); - } - break; - - case ONIGENC_CTYPE_WORD: - if (not == 0) { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if (ONIGENC_IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT(cc->bs, c); - } - ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); - } - else { - for (c = 0; c < SINGLE_BYTE_SIZE; c++) { - if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* 0: invalid code point */ - && ! ONIGENC_IS_CODE_WORD(enc, c)) - BITSET_SET_BIT(cc->bs, c); - } - } - break; - - default: - return ONIGERR_PARSER_BUG; - break; - } - - return r; -} - -static int -parse_ctype_to_enc_ctype(int pctype, int* not) -{ - int ctype; - - switch (pctype) { - case CTYPE_WORD: - ctype = ONIGENC_CTYPE_WORD; - *not = 0; - break; - case CTYPE_NOT_WORD: - ctype = ONIGENC_CTYPE_WORD; - *not = 1; - break; - case CTYPE_WHITE_SPACE: - ctype = ONIGENC_CTYPE_SPACE; - *not = 0; - break; - case CTYPE_NOT_WHITE_SPACE: - ctype = ONIGENC_CTYPE_SPACE; - *not = 1; - break; - case CTYPE_DIGIT: - ctype = ONIGENC_CTYPE_DIGIT; - *not = 0; - break; - case CTYPE_NOT_DIGIT: - ctype = ONIGENC_CTYPE_DIGIT; - *not = 1; - break; - case CTYPE_XDIGIT: - ctype = ONIGENC_CTYPE_XDIGIT; - *not = 0; - break; - case CTYPE_NOT_XDIGIT: - ctype = ONIGENC_CTYPE_XDIGIT; - *not = 1; - break; - default: - return ONIGERR_PARSER_BUG; - break; - } - return ctype; -} - -typedef struct { - UChar *name; - int ctype; - short int len; -} PosixBracketEntryType; - -static int -parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env) -{ -#define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20 -#define POSIX_BRACKET_NAME_MAX_LEN 6 - - static PosixBracketEntryType PBS[] = { - { "alnum", ONIGENC_CTYPE_ALNUM, 5 }, - { "alpha", ONIGENC_CTYPE_ALPHA, 5 }, - { "blank", ONIGENC_CTYPE_BLANK, 5 }, - { "cntrl", ONIGENC_CTYPE_CNTRL, 5 }, - { "digit", ONIGENC_CTYPE_DIGIT, 5 }, - { "graph", ONIGENC_CTYPE_GRAPH, 5 }, - { "lower", ONIGENC_CTYPE_LOWER, 5 }, - { "print", ONIGENC_CTYPE_PRINT, 5 }, - { "punct", ONIGENC_CTYPE_PUNCT, 5 }, - { "space", ONIGENC_CTYPE_SPACE, 5 }, - { "upper", ONIGENC_CTYPE_UPPER, 5 }, - { "xdigit", ONIGENC_CTYPE_XDIGIT, 6 }, - { "ascii", ONIGENC_CTYPE_ASCII, 5 }, /* I don't know origin. Perl? */ - { (UChar* )NULL, -1, 0 } - }; - - PosixBracketEntryType *pb; - int not, i, r; - OnigCodePoint c; - OnigEncoding enc = env->enc; - UChar *p = *src; - PFETCH_READY; - - if (PPEEK_IS('^')) { - PINC; - not = 1; - } - else - not = 0; - - if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MAX_LEN + 2) - goto not_posix_bracket; - - for (pb = PBS; IS_NOT_NULL(pb->name); pb++) { - if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) { - p = (UChar* )onigenc_step(enc, p, end, pb->len); - if (onigenc_with_ascii_strncmp(enc, p, end, ":]", 2) != 0) - return ONIGERR_INVALID_POSIX_BRACKET_TYPE; - - r = add_ctype_to_cc(cc, pb->ctype, not, env); - if (r != 0) return r; - - PINC; PINC; - *src = p; - return 0; - } - } - - not_posix_bracket: - c = 0; - i = 0; - while (!PEND && ((c = PPEEK) != ':') && c != ']') { - PINC; - if (++i > POSIX_BRACKET_CHECK_LIMIT_LENGTH) break; - } - if (c == ':' && ! PEND) { - PINC; - if (! PEND) { - PFETCH(c); - if (c == ']') - return ONIGERR_INVALID_POSIX_BRACKET_TYPE; - } - } - - return 1; /* 1: is not POSIX bracket, but no error. */ -} - -static int -property_name_to_ctype(UChar* p, UChar* end, OnigEncoding enc) -{ - static PosixBracketEntryType PBS[] = { - { "Alnum", ONIGENC_CTYPE_ALNUM, 5 }, - { "Alpha", ONIGENC_CTYPE_ALPHA, 5 }, - { "Blank", ONIGENC_CTYPE_BLANK, 5 }, - { "Cntrl", ONIGENC_CTYPE_CNTRL, 5 }, - { "Digit", ONIGENC_CTYPE_DIGIT, 5 }, - { "Graph", ONIGENC_CTYPE_GRAPH, 5 }, - { "Lower", ONIGENC_CTYPE_LOWER, 5 }, - { "Print", ONIGENC_CTYPE_PRINT, 5 }, - { "Punct", ONIGENC_CTYPE_PUNCT, 5 }, - { "Space", ONIGENC_CTYPE_SPACE, 5 }, - { "Upper", ONIGENC_CTYPE_UPPER, 5 }, - { "XDigit", ONIGENC_CTYPE_XDIGIT, 6 }, - { "ASCII", ONIGENC_CTYPE_ASCII, 5 }, - { (UChar* )NULL, -1, 0 } - }; - - PosixBracketEntryType *pb; - int len; - - len = onigenc_strlen(enc, p, end); - for (pb = PBS; IS_NOT_NULL(pb->name); pb++) { - if (len == pb->len && - onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) - return pb->ctype; - } - - return -1; -} - -static int -fetch_char_property_to_ctype(UChar** src, UChar* end, ScanEnv* env) -{ - int ctype; - OnigCodePoint c; - OnigEncoding enc = env->enc; - UChar *prev, *start, *p = *src; - PFETCH_READY; - - /* 'IsXXXX' => 'XXXX' */ - if (!PEND && - IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS)) { - c = PPEEK; - if (c == 'I') { - PINC; - if (! PEND) { - c = PPEEK; - if (c == 's') - PINC; - else - PUNFETCH; - } - } - } - - start = prev = p; - - while (!PEND) { - prev = p; - PFETCH(c); - if (c == '}') { - ctype = property_name_to_ctype(start, prev, enc); - if (ctype < 0) break; - - *src = p; - return ctype; - } - else if (c == '(' || c == ')' || c == '{' || c == '|') - break; - } - - onig_scan_env_set_error_string(env, ONIGERR_INVALID_CHAR_PROPERTY_NAME, - *src, prev); - return ONIGERR_INVALID_CHAR_PROPERTY_NAME; -} - -static int -parse_char_property(Node** np, OnigToken* tok, UChar** src, UChar* end, - ScanEnv* env) -{ - int r, ctype; - CClassNode* cc; - - ctype = fetch_char_property_to_ctype(src, end, env); - if (ctype < 0) return ctype; - - *np = node_new_cclass(); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - cc = &(NCCLASS(*np)); - r = add_ctype_to_cc(cc, ctype, 0, env); - if (r != 0) return r; - if (tok->u.prop.not != 0) CCLASS_SET_NOT(cc); - - return 0; -} - - -enum CCSTATE { - CCS_VALUE, - CCS_RANGE, - CCS_COMPLETE, - CCS_START -}; - -enum CCVALTYPE { - CCV_SB, - CCV_CODE_POINT, - CCV_CLASS -}; - -static int -next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type, - enum CCSTATE* state, ScanEnv* env) -{ - int r; - - if (*state == CCS_RANGE) - return ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE; - - if (*state == CCS_VALUE && *type != CCV_CLASS) { - if (*type == CCV_SB) - BITSET_SET_BIT(cc->bs, (int )(*vs)); - else if (*type == CCV_CODE_POINT) { - r = add_code_range(&(cc->mbuf), env, *vs, *vs); - if (r < 0) return r; - } - } - - *state = CCS_VALUE; - *type = CCV_CLASS; - return 0; -} - -static int -next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v, - int* vs_israw, int v_israw, - enum CCVALTYPE intype, enum CCVALTYPE* type, - enum CCSTATE* state, ScanEnv* env) -{ - int r; - - switch (*state) { - case CCS_VALUE: - if (*type == CCV_SB) - BITSET_SET_BIT(cc->bs, (int )(*vs)); - else if (*type == CCV_CODE_POINT) { - r = add_code_range(&(cc->mbuf), env, *vs, *vs); - if (r < 0) return r; - } - break; - - case CCS_RANGE: - if (intype == *type) { - if (intype == CCV_SB) { - if (*vs > 0xff || v > 0xff) - return ONIGERR_INVALID_WIDE_CHAR_VALUE; - - if (*vs > v) { - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) - goto ccs_range_end; - else - return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; - } - bitset_set_range(cc->bs, (int )*vs, (int )v); - } - else { - r = add_code_range(&(cc->mbuf), env, *vs, v); - if (r < 0) return r; - } - } - else { -#if 0 - if (intype == CCV_CODE_POINT && *type == CCV_SB) { -#endif - if (*vs > v) { - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) - goto ccs_range_end; - else - return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; - } - bitset_set_range(cc->bs, (int )*vs, (int )(v < 0xff ? v : 0xff)); - r = add_code_range(&(cc->mbuf), env, (OnigCodePoint )*vs, v); - if (r < 0) return r; -#if 0 - } - else - return ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE; -#endif - } - ccs_range_end: - *state = CCS_COMPLETE; - break; - - case CCS_COMPLETE: - case CCS_START: - *state = CCS_VALUE; - break; - - default: - break; - } - - *vs_israw = v_israw; - *vs = v; - *type = intype; - return 0; -} - -static int -code_exist_check(OnigCodePoint c, UChar* from, UChar* end, int ignore_escaped, - OnigEncoding enc) -{ - int in_esc; - OnigCodePoint code; - UChar* p = from; - PFETCH_READY; - - in_esc = 0; - while (! PEND) { - if (ignore_escaped && in_esc) { - in_esc = 0; - } - else { - PFETCH(code); - if (code == c) return 1; - if (code == MC_ESC(enc)) in_esc = 1; - } - } - return 0; -} - -static int -parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end, - ScanEnv* env) -{ - int r, neg, len, fetched, and_start; - OnigCodePoint v, vs; - UChar *p; - Node* node; - CClassNode *cc, *prev_cc; - CClassNode work_cc; - - enum CCSTATE state; - enum CCVALTYPE val_type, in_type; - int val_israw, in_israw; - - prev_cc = (CClassNode* )NULL; - *np = NULL_NODE; - r = fetch_token_in_cc(tok, src, end, env); - if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) { - neg = 1; - r = fetch_token_in_cc(tok, src, end, env); - } - else { - neg = 0; - } - - if (r < 0) return r; - if (r == TK_CC_CLOSE) { - if (! code_exist_check((OnigCodePoint )']', - *src, env->pattern_end, 1, env->enc)) - return ONIGERR_EMPTY_CHAR_CLASS; - - CC_ESC_WARN(env, "]"); - r = tok->type = TK_CHAR; /* allow []...] */ - } - - *np = node = node_new_cclass(); - CHECK_NULL_RETURN_VAL(node, ONIGERR_MEMORY); - cc = &(NCCLASS(node)); - - and_start = 0; - state = CCS_START; - p = *src; - while (r != TK_CC_CLOSE) { - fetched = 0; - switch (r) { - case TK_CHAR: - len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c); - if (len > 1) { - in_type = CCV_CODE_POINT; - } - else { - sb_char: - in_type = CCV_SB; - } - v = (OnigCodePoint )tok->u.c; - in_israw = 0; - goto val_entry2; - break; - - case TK_RAW_BYTE: - /* tok->base != 0 : octal or hexadec. */ - if (! ONIGENC_IS_SINGLEBYTE(env->enc) && tok->base != 0) { - UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; - UChar* bufe = buf + ONIGENC_CODE_TO_MBC_MAXLEN; - UChar* psave = p; - int i, base = tok->base; - - buf[0] = tok->u.c; - for (i = 1; i < ONIGENC_MBC_MAXLEN(env->enc); i++) { - r = fetch_token_in_cc(tok, &p, end, env); - if (r < 0) goto err; - if (r != TK_RAW_BYTE || tok->base != base) { - fetched = 1; - break; - } - buf[i] = tok->u.c; - } - - if (i < ONIGENC_MBC_MINLEN(env->enc)) { - r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING; - goto err; - } - - len = enc_len(env->enc, buf); - if (i < len) { - r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING; - goto err; - } - else if (i > len) { /* fetch back */ - p = psave; - for (i = 1; i < len; i++) { - r = fetch_token_in_cc(tok, &p, end, env); - } - fetched = 0; - } - - if (i == 1) { - v = (OnigCodePoint )buf[0]; - goto raw_single; - } - else { - v = ONIGENC_MBC_TO_CODE(env->enc, buf, bufe); - in_type = CCV_CODE_POINT; - } - } - else { - v = (OnigCodePoint )tok->u.c; - raw_single: - in_type = CCV_SB; - } - in_israw = 1; - goto val_entry2; - break; - - case TK_CODE_POINT: - v = tok->u.code; - in_israw = 1; - val_entry: - len = ONIGENC_CODE_TO_MBCLEN(env->enc, v); - if (len < 0) { - r = len; - goto err; - } - in_type = (len == 1 ? CCV_SB : CCV_CODE_POINT); - val_entry2: - r = next_state_val(cc, &vs, v, &val_israw, in_israw, in_type, &val_type, - &state, env); - if (r != 0) goto err; - break; - - case TK_POSIX_BRACKET_OPEN: - r = parse_posix_bracket(cc, &p, end, env); - if (r < 0) goto err; - if (r == 1) { /* is not POSIX bracket */ - CC_ESC_WARN(env, "["); - p = tok->backp; - v = (OnigCodePoint )tok->u.c; - in_israw = 0; - goto val_entry; - } - goto next_class; - break; - - case TK_CHAR_TYPE: - { - int ctype, not; - ctype = parse_ctype_to_enc_ctype(tok->u.subtype, ¬); - r = add_ctype_to_cc(cc, ctype, not, env); - if (r != 0) return r; - } - - next_class: - r = next_state_class(cc, &vs, &val_type, &state, env); - if (r != 0) goto err; - break; - - case TK_CHAR_PROPERTY: - { - int ctype; - - ctype = fetch_char_property_to_ctype(&p, end, env); - if (ctype < 0) return ctype; - r = add_ctype_to_cc(cc, ctype, tok->u.prop.not, env); - if (r != 0) return r; - goto next_class; - } - break; - - case TK_CC_RANGE: - if (state == CCS_VALUE) { - r = fetch_token_in_cc(tok, &p, end, env); - if (r < 0) goto err; - fetched = 1; - if (r == TK_CC_CLOSE) { /* allow [x-] */ - range_end_val: - v = (OnigCodePoint )'-'; - in_israw = 0; - goto val_entry; - } - else if (r == TK_CC_AND) { - CC_ESC_WARN(env, "-"); - goto range_end_val; - } - state = CCS_RANGE; - } - else if (state == CCS_START) { - /* [-xa] is allowed */ - v = (OnigCodePoint )tok->u.c; - in_israw = 0; - - r = fetch_token_in_cc(tok, &p, end, env); - if (r < 0) goto err; - fetched = 1; - /* [--x] or [a&&-x] is warned. */ - if (r == TK_CC_RANGE || and_start != 0) - CC_ESC_WARN(env, "-"); - - goto val_entry; - } - else if (state == CCS_RANGE) { - CC_ESC_WARN(env, "-"); - goto sb_char; /* [!--x] is allowed */ - } - else { /* CCS_COMPLETE */ - r = fetch_token_in_cc(tok, &p, end, env); - if (r < 0) goto err; - fetched = 1; - if (r == TK_CC_CLOSE) goto range_end_val; /* allow [a-b-] */ - else if (r == TK_CC_AND) { - CC_ESC_WARN(env, "-"); - goto range_end_val; - } - - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) { - CC_ESC_WARN(env, "-"); - goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */ - } - r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS; - goto err; - } - break; - - case TK_CC_CC_OPEN: /* [ */ - { - Node *anode; - CClassNode* acc; - - r = parse_char_class(&anode, tok, &p, end, env); - if (r != 0) goto cc_open_err; - acc = &(NCCLASS(anode)); - r = or_cclass(cc, acc, env->enc); - - onig_node_free(anode); - cc_open_err: - if (r != 0) goto err; - } - break; - - case TK_CC_AND: /* && */ - { - if (state == CCS_VALUE) { - r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type, - &val_type, &state, env); - if (r != 0) goto err; - } - /* initialize local variables */ - and_start = 1; - state = CCS_START; - - if (IS_NOT_NULL(prev_cc)) { - r = and_cclass(prev_cc, cc, env->enc); - if (r != 0) goto err; - bbuf_free(cc->mbuf); - } - else { - prev_cc = cc; - cc = &work_cc; - } - initialize_cclass(cc); - } - break; - - case TK_EOT: - r = ONIGERR_PREMATURE_END_OF_CHAR_CLASS; - goto err; - break; - default: - r = ONIGERR_PARSER_BUG; - goto err; - break; - } - - if (fetched) - r = tok->type; - else { - r = fetch_token_in_cc(tok, &p, end, env); - if (r < 0) goto err; - } - } - - if (state == CCS_VALUE) { - r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type, - &val_type, &state, env); - if (r != 0) goto err; - } - - if (IS_NOT_NULL(prev_cc)) { - r = and_cclass(prev_cc, cc, env->enc); - if (r != 0) goto err; - bbuf_free(cc->mbuf); - cc = prev_cc; - } - - if (neg != 0) - CCLASS_SET_NOT(cc); - else - CCLASS_CLEAR_NOT(cc); - if (IS_CCLASS_NOT(cc) && - IS_SYNTAX_BV(env->syntax, ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC)) { - int is_empty; - - is_empty = (IS_NULL(cc->mbuf) ? 1 : 0); - if (is_empty != 0) - BITSET_IS_EMPTY(cc->bs, is_empty); - - if (is_empty == 0) { -#define NEWLINE_CODE 0x0a - - if (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) { - if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1) - BITSET_SET_BIT(cc->bs, NEWLINE_CODE); - else - add_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE); - } - } - } - *src = p; - return 0; - - err: - if (cc != &(NCCLASS(*np))) - bbuf_free(cc->mbuf); - onig_node_free(*np); - return r; -} - -static int parse_subexp(Node** top, OnigToken* tok, int term, - UChar** src, UChar* end, ScanEnv* env); - -static int -parse_effect(Node** np, OnigToken* tok, int term, UChar** src, UChar* end, - ScanEnv* env) -{ - int r, num; - int list_capture; - Node *target; - OnigOptionType option; - OnigEncoding enc = env->enc; - OnigCodePoint c; - UChar* p = *src; - PFETCH_READY; - - *np = NULL; - if (PEND) return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS; - - option = env->option; - if (PPEEK_IS('?') && - IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) { - PINC; - if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; - - PFETCH(c); - switch (c) { - case ':': /* (?:...) grouping only */ - group: - r = fetch_token(tok, &p, end, env); - if (r < 0) return r; - r = parse_subexp(np, tok, term, &p, end, env); - if (r < 0) return r; - *src = p; - return 1; /* group */ - break; - - case '=': - *np = onig_node_new_anchor(ANCHOR_PREC_READ); - break; - case '!': /* preceding read */ - *np = onig_node_new_anchor(ANCHOR_PREC_READ_NOT); - break; - case '>': /* (?>...) stop backtrack */ - *np = node_new_effect(EFFECT_STOP_BACKTRACK); - break; - - case '<': /* look behind (?<=...), (?syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) { - UChar *name; - UChar *name_end; - - PUNFETCH; - list_capture = 0; - - named_group: - name = p; - r = fetch_name(&p, end, &name_end, env, 0); - if (r < 0) return r; - - num = scan_env_add_mem_entry(env); - if (num < 0) return num; - if (list_capture != 0 && num >= BIT_STATUS_BITS_NUM) - return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY; - - r = name_add(env->reg, name, name_end, num, env); - if (r != 0) return r; - *np = node_new_effect_memory(env->option, 1); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - NEFFECT(*np).regnum = num; - if (list_capture != 0) - BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num); - env->num_named++; - } -#endif - else - return ONIGERR_UNDEFINED_GROUP_OPTION; - break; - - case '@': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)) { -#ifdef USE_NAMED_GROUP - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) { - PFETCH(c); - if (c == '<') { - list_capture = 1; - goto named_group; /* (?@...) */ - } - PUNFETCH; - } -#endif - *np = node_new_effect_memory(env->option, 0); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - num = scan_env_add_mem_entry(env); - if (num < 0) { - onig_node_free(*np); - return num; - } - else if (num >= BIT_STATUS_BITS_NUM) { - onig_node_free(*np); - return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY; - } - NEFFECT(*np).regnum = num; - BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num); - } - else { - return ONIGERR_UNDEFINED_GROUP_OPTION; - } - break; - -#ifdef USE_POSIXLINE_OPTION - case 'p': -#endif - case '-': case 'i': case 'm': case 's': case 'x': - { - int neg = 0; - - while (1) { - switch (c) { - case ':': - case ')': - break; - - case '-': neg = 1; break; - case 'x': ONOFF(option, ONIG_OPTION_EXTEND, neg); break; - case 'i': ONOFF(option, ONIG_OPTION_IGNORECASE, neg); break; - case 's': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) { - ONOFF(option, ONIG_OPTION_MULTILINE, neg); - } - else - return ONIGERR_UNDEFINED_GROUP_OPTION; - break; - - case 'm': - if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) { - ONOFF(option, ONIG_OPTION_SINGLELINE, (neg == 0 ? 1 : 0)); - } - else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) { - ONOFF(option, ONIG_OPTION_MULTILINE, neg); - } - else - return ONIGERR_UNDEFINED_GROUP_OPTION; - break; -#ifdef USE_POSIXLINE_OPTION - case 'p': - ONOFF(option, ONIG_OPTION_MULTILINE|ONIG_OPTION_SINGLELINE, neg); - break; -#endif - default: - return ONIGERR_UNDEFINED_GROUP_OPTION; - } - - if (c == ')') { - *np = node_new_option(option); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - *src = p; - return 2; /* option only */ - } - else if (c == ':') { - OnigOptionType prev = env->option; - - env->option = option; - r = fetch_token(tok, &p, end, env); - if (r < 0) return r; - r = parse_subexp(&target, tok, term, &p, end, env); - env->option = prev; - if (r < 0) return r; - *np = node_new_option(option); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - NEFFECT(*np).target = target; - *src = p; - return 0; - } - - if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; - PFETCH(c); - } - } - break; - - default: - return ONIGERR_UNDEFINED_GROUP_OPTION; - } - } - else { -#ifdef USE_NAMED_GROUP - if (ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_DONT_CAPTURE_GROUP)) - goto group; -#endif - *np = node_new_effect_memory(env->option, 0); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - num = scan_env_add_mem_entry(env); - if (num < 0) return num; - NEFFECT(*np).regnum = num; - } - - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - r = fetch_token(tok, &p, end, env); - if (r < 0) return r; - r = parse_subexp(&target, tok, term, &p, end, env); - if (r < 0) return r; - - if (NTYPE(*np) == N_ANCHOR) - NANCHOR(*np).target = target; - else { - NEFFECT(*np).target = target; - if (NEFFECT(*np).type == EFFECT_MEMORY) { - /* Don't move this to previous of parse_subexp() */ - r = scan_env_set_mem_node(env, NEFFECT(*np).regnum, *np); - if (r != 0) return r; - } - } - - *src = p; - return 0; -} - -static char* PopularQStr[] = { - "?", "*", "+", "??", "*?", "+?" -}; - -static char* ReduceQStr[] = { - "", "", "*", "*?", "??", "+ and ??", "+? and ?" -}; - -static int -set_qualifier(Node* qnode, Node* target, int group, ScanEnv* env) -{ - QualifierNode* qn; - - qn = &(NQUALIFIER(qnode)); - if (qn->lower == 1 && qn->upper == 1) { - return 1; - } - - switch (NTYPE(target)) { - case N_STRING: - if (! group) { - StrNode* sn = &(NSTRING(target)); - if (str_node_can_be_split(sn, env->enc)) { - Node* n = str_node_split_last_char(sn, env->enc); - if (IS_NOT_NULL(n)) { - qn->target = n; - return 2; - } - } - } - break; - - case N_QUALIFIER: - { /* check redundant double repeat. */ - /* verbose warn (?:.?)? etc... but not warn (.?)? etc... */ - QualifierNode* qnt = &(NQUALIFIER(target)); - -#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR - if (qn->by_number == 0 && qnt->by_number == 0 && - IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) { - int nestq_num, targetq_num; - char buf[WARN_BUFSIZE]; - - nestq_num = popular_qualifier_num(qn); - targetq_num = popular_qualifier_num(qnt); - - switch(ReduceTypeTable[targetq_num][nestq_num]) { - case RQ_ASIS: - break; - - case RQ_DEL: - if (onig_verb_warn != onig_null_warn) { - onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, - env->pattern, env->pattern_end, - "redundant nested repeat operator"); - (*onig_verb_warn)(buf); - } - goto warn_exit; - break; - - default: - if (onig_verb_warn != onig_null_warn) { - onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, - env->pattern, env->pattern_end, - "nested repeat operator %s and %s was replaced with '%s'", - PopularQStr[targetq_num], PopularQStr[nestq_num], - ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]); - (*onig_verb_warn)(buf); - } - goto warn_exit; - break; - } - } - - warn_exit: -#endif - if (popular_qualifier_num(qnt) >= 0 && popular_qualifier_num(qn) >= 0) { - onig_reduce_nested_qualifier(qnode, target); - goto q_exit; - } - } - break; - - default: - break; - } - - qn->target = target; - q_exit: - return 0; -} - -static int -make_compound_alt_node_from_cc(OnigAmbigType ambig_flag, OnigEncoding enc, - CClassNode* cc, Node** root) -{ - int r, i, j, k, clen, len, ncode, n; - UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; - Node **ptail, *snode = NULL_NODE; - OnigCompAmbigCodes* ccs; - OnigCompAmbigCodeItem* ci; - OnigAmbigType amb; - - n = 0; - *root = NULL_NODE; - ptail = root; - - - for (amb = 0x01; amb <= ONIGENC_AMBIGUOUS_MATCH_LIMIT; amb <<= 1) { - if ((amb & ambig_flag) == 0) continue; - - ncode = ONIGENC_GET_ALL_COMP_AMBIG_CODES(enc, amb, &ccs); - for (i = 0; i < ncode; i++) { - if (onig_is_code_in_cc(enc, ccs[i].code, cc)) { - for (j = 0; j < ccs[i].n; j++) { - ci = &(ccs[i].items[j]); - if (ci->len > 1) { /* compound only */ - if (IS_CCLASS_NOT(cc)) clear_not_flag_cclass(cc, enc); - - clen = ci->len; - for (k = 0; k < clen; k++) { - len = ONIGENC_CODE_TO_MBC(enc, ci->code[k], buf); - - if (k == 0) { - snode = node_new_str_raw(buf, buf + len); - CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY); - } - else { - r = onig_node_str_cat(snode, buf, buf + len); - if (r < 0) return r; - } - } - - *ptail = node_new_alt(snode, NULL_NODE); - CHECK_NULL_RETURN_VAL(*ptail, ONIGERR_MEMORY); - ptail = &(NCONS(*ptail).right); - n++; - } - } - } - } - } - - return n; -} - - -#ifdef USE_SHARED_CCLASS_TABLE - -#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS 8 - -/* for ctype node hash table */ - -typedef struct { - OnigEncoding enc; - int not; - int type; -} type_cclass_key; - -static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y) -{ - if (x->type != y->type) return 1; - if (x->enc != y->enc) return 1; - if (x->not != y->not) return 1; - return 0; -} - -static int type_cclass_hash(type_cclass_key* key) -{ - int i, val; - unsigned char *p; - - val = 0; - - p = (unsigned char* )&(key->enc); - for (i = 0; i < sizeof(key->enc); i++) { - val = val * 997 + (int )*p++; - } - - p = (unsigned char* )(&key->type); - for (i = 0; i < sizeof(key->type); i++) { - val = val * 997 + (int )*p++; - } - - val += key->not; - return val + (val >> 5); -} - -static int type_cclass_key_free(st_data_t x) -{ - xfree((void* )x); - return 0; -} - -static st_data_t type_cclass_key_clone(st_data_t x) -{ - type_cclass_key* new_key; - type_cclass_key* key = (type_cclass_key* )x; - - new_key = (type_cclass_key* )xmalloc(sizeof(type_cclass_key)); - *new_key = *key; - return (st_data_t )new_key; -} - -static struct st_hash_type type_type_cclass_hash = { - type_cclass_cmp, - type_cclass_hash, - type_cclass_key_free, - type_cclass_key_clone -}; - -static st_table* OnigTypeCClassTable; - - -static int -i_free_shared_class(type_cclass_key* key, Node* node, void* arg) -{ - if (IS_NOT_NULL(node)) { - CClassNode* cc = &(NCCLASS(node)); - if (IS_NOT_NULL(cc->mbuf)) xfree(cc->mbuf); - xfree(node); - } - return ST_DELETE; -} - -extern int -onig_free_shared_cclass_table() -{ - if (IS_NOT_NULL(OnigTypeCClassTable)) { - onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0); - } - - return 0; -} - -#endif /* USE_SHARED_CCLASS_TABLE */ - - -static int -parse_exp(Node** np, OnigToken* tok, int term, - UChar** src, UChar* end, ScanEnv* env) -{ - int r, len, group = 0; - Node* qn; - Node** targetp; - - *np = NULL; - if (tok->type == term) - goto end_of_token; - - switch (tok->type) { - case TK_ALT: - case TK_EOT: - end_of_token: - *np = node_new_empty(); - return tok->type; - break; - - case TK_SUBEXP_OPEN: - r = parse_effect(np, tok, TK_SUBEXP_CLOSE, src, end, env); - if (r < 0) return r; - if (r == 1) group = 1; - else if (r == 2) { /* option only */ - Node* target; - OnigOptionType prev = env->option; - - env->option = NEFFECT(*np).option; - r = fetch_token(tok, src, end, env); - if (r < 0) return r; - r = parse_subexp(&target, tok, term, src, end, env); - env->option = prev; - if (r < 0) return r; - NEFFECT(*np).target = target; - return tok->type; - } - break; - - case TK_SUBEXP_CLOSE: - if (! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP)) - return ONIGERR_UNMATCHED_CLOSE_PARENTHESIS; - - if (tok->escaped) goto tk_raw_byte; - else goto tk_byte; - break; - - case TK_STRING: - tk_byte: - { - *np = node_new_str(tok->backp, *src); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - - while (1) { - r = fetch_token(tok, src, end, env); - if (r < 0) return r; - if (r != TK_STRING) break; - - r = onig_node_str_cat(*np, tok->backp, *src); - if (r < 0) return r; - } - - string_end: - targetp = np; - goto repeat; - } - break; - - case TK_RAW_BYTE: - tk_raw_byte: - { - *np = node_new_str_raw_char((UChar )tok->u.c); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - len = 1; - while (1) { - r = fetch_token(tok, src, end, env); - if (r < 0) return r; - if (r != TK_RAW_BYTE) { -#ifndef NUMBERED_CHAR_IS_NOT_CASE_AMBIG - if (len >= enc_len(env->enc, NSTRING(*np).s)) { - NSTRING_CLEAR_RAW(*np); - } -#endif - goto string_end; - } - - r = node_str_cat_char(*np, (UChar )tok->u.c); - if (r < 0) return r; - len++; - } - } - break; - - case TK_CODE_POINT: - { - UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; - int num = ONIGENC_CODE_TO_MBC(env->enc, tok->u.code, buf); - if (num < 0) return num; -#ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG - *np = node_new_str_raw(buf, buf + num); -#else - *np = node_new_str(buf, buf + num); -#endif - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - } - break; - - case TK_QUOTE_OPEN: - { - OnigCodePoint end_op[2]; - UChar *qstart, *qend, *nextp; - - end_op[0] = (OnigCodePoint )MC_ESC(env->enc); - end_op[1] = (OnigCodePoint )'E'; - qstart = *src; - qend = find_str_position(end_op, 2, qstart, end, &nextp, env->enc); - if (IS_NULL(qend)) { - nextp = qend = end; - } - *np = node_new_str(qstart, qend); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - *src = nextp; - } - break; - - case TK_CHAR_TYPE: - { - switch (tok->u.subtype) { - case CTYPE_WORD: - case CTYPE_NOT_WORD: - *np = node_new_ctype(tok->u.subtype); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - break; - - case CTYPE_WHITE_SPACE: - case CTYPE_NOT_WHITE_SPACE: - case CTYPE_DIGIT: - case CTYPE_NOT_DIGIT: - case CTYPE_XDIGIT: - case CTYPE_NOT_XDIGIT: - { - CClassNode* cc; - int ctype, not; - -#ifdef USE_SHARED_CCLASS_TABLE - OnigCodePoint *sbr, *mbr; - - ctype = parse_ctype_to_enc_ctype(tok->u.subtype, ¬); - r = ONIGENC_GET_CTYPE_CODE_RANGE(env->enc, ctype, &sbr, &mbr); - if (r == 0 && - ONIGENC_CODE_RANGE_NUM(mbr) - >= THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS) { - type_cclass_key key; - type_cclass_key* new_key; - - key.enc = env->enc; - key.not = not; - key.type = ctype; - - THREAD_ATOMIC_START; - - if (IS_NULL(OnigTypeCClassTable)) { - OnigTypeCClassTable - = onig_st_init_table_with_size(&type_type_cclass_hash, 10); - if (IS_NULL(OnigTypeCClassTable)) { - THREAD_ATOMIC_END; - return ONIGERR_MEMORY; - } - } - else { - if (onig_st_lookup(OnigTypeCClassTable, (st_data_t )&key, - (st_data_t* )np)) { - THREAD_ATOMIC_END; - break; - } - } - - *np = node_new_cclass_by_codepoint_range(not, sbr, mbr); - if (IS_NULL(*np)) { - THREAD_ATOMIC_END; - return ONIGERR_MEMORY; - } - - CCLASS_SET_SHARE(&(NCCLASS(*np))); - new_key = (type_cclass_key* )xmalloc(sizeof(type_cclass_key)); - onig_st_add_direct(OnigTypeCClassTable, (st_data_t )new_key, - (st_data_t )*np); - - THREAD_ATOMIC_END; - } - else { -#endif - ctype = parse_ctype_to_enc_ctype(tok->u.subtype, ¬); - *np = node_new_cclass(); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - cc = &(NCCLASS(*np)); - add_ctype_to_cc(cc, ctype, 0, env); - if (not != 0) CCLASS_SET_NOT(cc); -#ifdef USE_SHARED_CCLASS_TABLE - } -#endif - } - break; - - default: - return ONIGERR_PARSER_BUG; - break; - } - } - break; - - case TK_CHAR_PROPERTY: - r = parse_char_property(np, tok, src, end, env); - if (r != 0) return r; - break; - - case TK_CC_OPEN: - { - CClassNode* cc; - - r = parse_char_class(np, tok, src, end, env); - if (r != 0) return r; - - cc = &(NCCLASS(*np)); - - if (IS_IGNORECASE(env->option)) { - int i, n, in_cc; - OnigPairAmbigCodes* ccs; - BitSetRef bs = cc->bs; - OnigAmbigType amb; - - for (amb = 0x01; amb <= ONIGENC_AMBIGUOUS_MATCH_LIMIT; amb <<= 1) { - if ((amb & env->ambig_flag) == 0) continue; - - n = ONIGENC_GET_ALL_PAIR_AMBIG_CODES(env->enc, amb, &ccs); - for (i = 0; i < n; i++) { - in_cc = onig_is_code_in_cc(env->enc, ccs[i].from, cc); - - if ((in_cc != 0 && !IS_CCLASS_NOT(cc)) || - (in_cc == 0 && IS_CCLASS_NOT(cc))) { - if (ONIGENC_MBC_MINLEN(env->enc) > 1 || - ccs[i].from >= SINGLE_BYTE_SIZE) { - /* if (cc->not) clear_not_flag_cclass(cc, env->enc); */ - add_code_range(&(cc->mbuf), env, ccs[i].to, ccs[i].to); - } - else { - if (BITSET_AT(bs, ccs[i].from)) { - /* /(?i:[^A-C])/.match("a") ==> fail. */ - BITSET_SET_BIT(bs, ccs[i].to); - } - if (BITSET_AT(bs, ccs[i].to)) { - BITSET_SET_BIT(bs, ccs[i].from); - } - } - } - } - } - } - - if (IS_IGNORECASE(env->option) && - (env->ambig_flag & ONIGENC_AMBIGUOUS_MATCH_COMPOUND) != 0) { - int res; - Node *alt_root, *work; - - res = make_compound_alt_node_from_cc(env->ambig_flag, env->enc, - cc, &alt_root); - if (res < 0) return res; - if (res > 0) { - work = node_new_alt(*np, alt_root); - if (IS_NULL(work)) { - onig_node_free(alt_root); - return ONIGERR_MEMORY; - } - *np = work; - } - } - } - break; - - case TK_ANYCHAR: - *np = node_new_anychar(); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - break; - - case TK_ANYCHAR_ANYTIME: - *np = node_new_anychar(); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - qn = node_new_qualifier(0, REPEAT_INFINITE, 0); - CHECK_NULL_RETURN_VAL(qn, ONIGERR_MEMORY); - NQUALIFIER(qn).target = *np; - *np = qn; - break; - - case TK_BACKREF: - len = tok->u.backref.num; - *np = node_new_backref(len, - (len > 1 ? tok->u.backref.refs : &(tok->u.backref.ref1)), - tok->u.backref.by_name, env); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - break; - -#ifdef USE_SUBEXP_CALL - case TK_CALL: - *np = node_new_call(tok->u.call.name, tok->u.call.name_end); - CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY); - env->num_call++; - break; -#endif - - case TK_ANCHOR: - *np = onig_node_new_anchor(tok->u.anchor); - break; - - case TK_OP_REPEAT: - case TK_INTERVAL: - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) { - if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS)) - return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED; - else - *np = node_new_empty(); - } - else { - goto tk_byte; - } - break; - - default: - return ONIGERR_PARSER_BUG; - break; - } - - { - targetp = np; - - re_entry: - r = fetch_token(tok, src, end, env); - if (r < 0) return r; - - repeat: - if (r == TK_OP_REPEAT || r == TK_INTERVAL) { - if (is_invalid_qualifier_target(*targetp)) - return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID; - - qn = node_new_qualifier(tok->u.repeat.lower, tok->u.repeat.upper, - (r == TK_INTERVAL ? 1 : 0)); - CHECK_NULL_RETURN_VAL(qn, ONIGERR_MEMORY); - NQUALIFIER(qn).greedy = tok->u.repeat.greedy; - r = set_qualifier(qn, *targetp, group, env); - if (r < 0) return r; - - if (tok->u.repeat.possessive != 0) { - Node* en; - en = node_new_effect(EFFECT_STOP_BACKTRACK); - CHECK_NULL_RETURN_VAL(en, ONIGERR_MEMORY); - NEFFECT(en).target = qn; - qn = en; - } - - if (r == 0) { - *targetp = qn; - } - else if (r == 2) { /* split case: /abc+/ */ - Node *tmp; - - *targetp = node_new_list(*targetp, NULL); - CHECK_NULL_RETURN_VAL(*targetp, ONIGERR_MEMORY); - tmp = NCONS(*targetp).right = node_new_list(qn, NULL); - CHECK_NULL_RETURN_VAL(tmp, ONIGERR_MEMORY); - targetp = &(NCONS(tmp).left); - } - goto re_entry; - } - } - - return r; -} - -static int -parse_branch(Node** top, OnigToken* tok, int term, - UChar** src, UChar* end, ScanEnv* env) -{ - int r; - Node *node, **headp; - - *top = NULL; - r = parse_exp(&node, tok, term, src, end, env); - if (r < 0) return r; - - if (r == TK_EOT || r == term || r == TK_ALT) { - *top = node; - } - else { - *top = node_new_list(node, NULL); - headp = &(NCONS(*top).right); - while (r != TK_EOT && r != term && r != TK_ALT) { - r = parse_exp(&node, tok, term, src, end, env); - if (r < 0) return r; - - if (NTYPE(node) == N_LIST) { - *headp = node; - while (IS_NOT_NULL(NCONS(node).right)) node = NCONS(node).right; - headp = &(NCONS(node).right); - } - else { - *headp = node_new_list(node, NULL); - headp = &(NCONS(*headp).right); - } - } - } - - return r; -} - -/* term_tok: TK_EOT or TK_SUBEXP_CLOSE */ -static int -parse_subexp(Node** top, OnigToken* tok, int term, - UChar** src, UChar* end, ScanEnv* env) -{ - int r; - Node *node, **headp; - - *top = NULL; - r = parse_branch(&node, tok, term, src, end, env); - if (r < 0) { - onig_node_free(node); - return r; - } - - if (r == term) { - *top = node; - } - else if (r == TK_ALT) { - *top = node_new_alt(node, NULL); - headp = &(NCONS(*top).right); - while (r == TK_ALT) { - r = fetch_token(tok, src, end, env); - if (r < 0) return r; - r = parse_branch(&node, tok, term, src, end, env); - if (r < 0) return r; - - *headp = node_new_alt(node, NULL); - headp = &(NCONS(*headp).right); - } - - if (tok->type != term) - goto err; - } - else { - err: - if (term == TK_SUBEXP_CLOSE) - return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS; - else - return ONIGERR_PARSER_BUG; - } - - return r; -} - -static int -parse_regexp(Node** top, UChar** src, UChar* end, ScanEnv* env) -{ - int r; - OnigToken tok; - - r = fetch_token(&tok, src, end, env); - if (r < 0) return r; - r = parse_subexp(top, &tok, TK_EOT, src, end, env); - if (r < 0) return r; - return 0; -} - -extern int -onig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end, regex_t* reg, - ScanEnv* env) -{ - int r; - UChar* p; - -#ifdef USE_NAMED_GROUP - names_clear(reg); -#endif - - scan_env_clear(env); - env->option = reg->options; - env->ambig_flag = reg->ambig_flag; - env->enc = reg->enc; - env->syntax = reg->syntax; - env->pattern = (UChar* )pattern; - env->pattern_end = (UChar* )end; - env->reg = reg; - - *root = NULL; - p = (UChar* )pattern; - r = parse_regexp(root, &p, (UChar* )end, env); - reg->num_mem = env->num_mem; - return r; -} - -extern void -onig_scan_env_set_error_string(ScanEnv* env, int ecode, - UChar* arg, UChar* arg_end) -{ - env->error = arg; - env->error_end = arg_end; -} diff --git a/ext/mbstring/oniguruma/regparse.h b/ext/mbstring/oniguruma/regparse.h deleted file mode 100644 index 1a4ac7dea2487..0000000000000 --- a/ext/mbstring/oniguruma/regparse.h +++ /dev/null @@ -1,316 +0,0 @@ -#ifndef REGPARSE_H -#define REGPARSE_H -/********************************************************************** - regparse.h - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -/* node type */ -#define N_STRING (1<< 0) -#define N_CCLASS (1<< 1) -#define N_CTYPE (1<< 2) -#define N_ANYCHAR (1<< 3) -#define N_BACKREF (1<< 4) -#define N_QUALIFIER (1<< 5) -#define N_EFFECT (1<< 6) -#define N_ANCHOR (1<< 7) -#define N_LIST (1<< 8) -#define N_ALT (1<< 9) -#define N_CALL (1<<10) - -#define IS_NODE_TYPE_SIMPLE(type) \ - (((type) & (N_STRING | N_CCLASS | N_CTYPE | N_ANYCHAR | N_BACKREF)) != 0) - -#define NTYPE(node) ((node)->type) -#define NCONS(node) ((node)->u.cons) -#define NSTRING(node) ((node)->u.str) -#define NCCLASS(node) ((node)->u.cclass) -#define NCTYPE(node) ((node)->u.ctype) -#define NQUALIFIER(node) ((node)->u.qualifier) -#define NANCHOR(node) ((node)->u.anchor) -#define NBACKREF(node) ((node)->u.backref) -#define NEFFECT(node) ((node)->u.effect) -#define NCALL(node) ((node)->u.call) - -#define CTYPE_WORD (1<<0) -#define CTYPE_NOT_WORD (1<<1) -#define CTYPE_WHITE_SPACE (1<<2) -#define CTYPE_NOT_WHITE_SPACE (1<<3) -#define CTYPE_DIGIT (1<<4) -#define CTYPE_NOT_DIGIT (1<<5) -#define CTYPE_XDIGIT (1<<6) -#define CTYPE_NOT_XDIGIT (1<<7) - -#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_PL) -#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF) - -#define EFFECT_MEMORY (1<<0) -#define EFFECT_OPTION (1<<1) -#define EFFECT_STOP_BACKTRACK (1<<2) - -#define NODE_STR_MARGIN 16 -#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */ -#define NODE_BACKREFS_SIZE 7 - -#define NSTR_RAW (1<<0) /* by backslashed number */ -#define NSTR_AMBIG (1<<1) -#define NSTR_AMBIG_REDUCE (1<<2) - -#define NSTRING_LEN(node) ((node)->u.str.end - (node)->u.str.s) -#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW -#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW -#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG -#define NSTRING_SET_AMBIG_REDUCE(node) (node)->u.str.flag |= NSTR_AMBIG_REDUCE -#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0) -#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0) -#define NSTRING_IS_AMBIG_REDUCE(node) \ - (((node)->u.str.flag & NSTR_AMBIG_REDUCE) != 0) - -#define BACKREFS_P(br) \ - (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static); - -#define NQ_TARGET_ISNOT_EMPTY 0 -#define NQ_TARGET_IS_EMPTY 1 -#define NQ_TARGET_IS_EMPTY_MEM 2 -#define NQ_TARGET_IS_EMPTY_REC 3 - - -typedef struct { - UChar* s; - UChar* end; - unsigned int flag; - int capa; /* (allocated size - 1) or 0: use buf[] */ - UChar buf[NODE_STR_BUF_SIZE]; -} StrNode; - -/* move to regint.h */ -#if 0 -typedef struct { - int flags; - BitSet bs; - BBuf* mbuf; /* multi-byte info or NULL */ -} CClassNode; -#endif - -typedef struct { - int state; - struct _Node* target; - int lower; - int upper; - int greedy; - int by_number; /* {n,m} */ - int target_empty_info; - struct _Node* head_exact; - struct _Node* next_head_exact; - int is_refered; /* include called node. don't eliminate even if {0} */ -} QualifierNode; - -/* status bits */ -#define NST_MIN_FIXED (1<<0) -#define NST_MAX_FIXED (1<<1) -#define NST_CLEN_FIXED (1<<2) -#define NST_MARK1 (1<<3) -#define NST_MARK2 (1<<4) -#define NST_MEM_BACKREFED (1<<5) -#define NST_STOP_BT_SIMPLE_REPEAT (1<<6) -#define NST_RECURSION (1<<7) -#define NST_CALLED (1<<8) -#define NST_ADDR_FIXED (1<<9) -#define NST_NAMED_GROUP (1<<10) -#define NST_NAME_REF (1<<11) -#define NST_IN_REPEAT (1<<12) /* STK_REPEAT is nested in stack. */ - -#define SET_EFFECT_STATUS(node,f) (node)->u.effect.state |= (f) -#define CLEAR_EFFECT_STATUS(node,f) (node)->u.effect.state &= ~(f) - -#define IS_EFFECT_CALLED(en) (((en)->state & NST_CALLED) != 0) -#define IS_EFFECT_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0) -#define IS_EFFECT_RECURSION(en) (((en)->state & NST_RECURSION) != 0) -#define IS_EFFECT_MARK1(en) (((en)->state & NST_MARK1) != 0) -#define IS_EFFECT_MARK2(en) (((en)->state & NST_MARK2) != 0) -#define IS_EFFECT_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0) -#define IS_EFFECT_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0) -#define IS_EFFECT_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0) -#define IS_EFFECT_STOP_BT_SIMPLE_REPEAT(en) \ - (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0) -#define IS_EFFECT_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0) - -#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION -#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0) -#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0) -#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0) -#define IS_QUALIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0) - -typedef struct { - int state; - int type; - int regnum; - OnigOptionType option; - struct _Node* target; - AbsAddrType call_addr; - /* for multiple call reference */ - OnigDistance min_len; /* min length (byte) */ - OnigDistance max_len; /* max length (byte) */ - int char_len; /* character length */ - int opt_count; /* referenced count in optimize_node_left() */ -} EffectNode; - -#define CALLNODE_REFNUM_UNDEF -1 - -#ifdef USE_SUBEXP_CALL - -typedef struct { - int offset; - struct _Node* target; -} UnsetAddr; - -typedef struct { - int num; - int alloc; - UnsetAddr* us; -} UnsetAddrList; - -typedef struct { - int state; - int ref_num; - UChar* name; - UChar* name_end; - struct _Node* target; /* EffectNode : EFFECT_MEMORY */ - UnsetAddrList* unset_addr_list; -} CallNode; - -#endif - -typedef struct { - int state; - int back_num; - int back_static[NODE_BACKREFS_SIZE]; - int* back_dynamic; -} BackrefNode; - -typedef struct { - int type; - struct _Node* target; - int char_len; -} AnchorNode; - -typedef struct _Node { - int type; - union { - StrNode str; - CClassNode cclass; - QualifierNode qualifier; - EffectNode effect; -#ifdef USE_SUBEXP_CALL - CallNode call; -#endif - BackrefNode backref; - AnchorNode anchor; - struct { - struct _Node* left; - struct _Node* right; - } cons; - struct { - int type; - } ctype; - } u; -} Node; - -#define NULL_NODE ((Node* )0) - -#define SCANENV_MEMNODES_SIZE 8 -#define SCANENV_MEM_NODES(senv) \ - (IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \ - (senv)->mem_nodes_dynamic : (senv)->mem_nodes_static) - -typedef struct { - OnigOptionType option; - OnigAmbigType ambig_flag; - OnigEncoding enc; - OnigSyntaxType* syntax; - BitStatusType capture_history; - BitStatusType bt_mem_start; - BitStatusType bt_mem_end; - BitStatusType backrefed_mem; - UChar* pattern; - UChar* pattern_end; - UChar* error; - UChar* error_end; - regex_t* reg; /* for reg->names only */ - int num_call; -#ifdef USE_SUBEXP_CALL - UnsetAddrList* unset_addr_list; -#endif - int num_mem; -#ifdef USE_NAMED_GROUP - int num_named; -#endif - int mem_alloc; - Node* mem_nodes_static[SCANENV_MEMNODES_SIZE]; - Node** mem_nodes_dynamic; -} ScanEnv; - - -#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0) -#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0) -#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0) - - -#ifdef USE_NAMED_GROUP -typedef struct { - int new_val; -} GroupNumRemap; - -extern int onig_renumber_name_table P_((regex_t* reg, GroupNumRemap* map)); -#endif - -extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc)); -extern int onig_strncmp P_((const UChar* s1, const UChar* s2, int n)); -extern void onig_scan_env_set_error_string P_((ScanEnv* env, int ecode, UChar* arg, UChar* arg_end)); -extern int onig_scan_unsigned_number P_((UChar** src, const UChar* end, OnigEncoding enc)); -extern void onig_reduce_nested_qualifier P_((Node* pnode, Node* cnode)); -extern void onig_node_conv_to_str_node P_((Node* node, int raw)); -extern int onig_node_str_cat P_((Node* node, const UChar* s, const UChar* end)); -extern void onig_node_free P_((Node* node)); -extern Node* onig_node_new_effect P_((int type)); -extern Node* onig_node_new_anchor P_((int type)); -extern Node* onig_node_new_str P_((const UChar* s, const UChar* end)); -extern Node* onig_node_new_list P_((Node* left, Node* right)); -extern void onig_node_str_clear P_((Node* node)); -extern int onig_free_node_list(); -extern int onig_names_free P_((regex_t* reg)); -extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env)); - -#ifdef ONIG_DEBUG -#ifdef USE_NAMED_GROUP -extern int onig_print_names(FILE*, regex_t*); -#endif -#endif - -#endif /* REGPARSE_H */ diff --git a/ext/mbstring/oniguruma/regposerr.c b/ext/mbstring/oniguruma/regposerr.c deleted file mode 100644 index e54b5c4089e6d..0000000000000 --- a/ext/mbstring/oniguruma/regposerr.c +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************** - regposerr.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "config.h" -#include "onigposix.h" - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -static char* ESTRING[] = { - NULL, - "failed to match", /* REG_NOMATCH */ - "Invalid regular expression", /* REG_BADPAT */ - "invalid collating element referenced", /* REG_ECOLLATE */ - "invalid character class type referenced", /* REG_ECTYPE */ - "bad backslash-escape sequence", /* REG_EESCAPE */ - "invalid back reference number", /* REG_ESUBREG */ - "imbalanced [ and ]", /* REG_EBRACK */ - "imbalanced ( and )", /* REG_EPAREN */ - "imbalanced { and }", /* REG_EBRACE */ - "invalid repeat range {n,m}", /* REG_BADBR */ - "invalid range", /* REG_ERANGE */ - "Out of memory", /* REG_ESPACE */ - "? * + not preceded by valid regular expression", /* REG_BADRPT */ - - /* Extended errors */ - "internal error", /* REG_EONIG_INTERNAL */ - "invalid wide char value", /* REG_EONIG_BADWC */ - "invalid argument", /* REG_EONIG_BADARG */ - "multi-thread error" /* REG_EONIG_THREAD */ -}; - -#include - - -extern size_t -regerror(int posix_ecode, const regex_t* reg, char* buf, size_t size) -{ - char* s; - char tbuf[35]; - size_t len; - - if (posix_ecode > 0 && posix_ecode < sizeof(ESTRING) / sizeof(ESTRING[0])) { - s = ESTRING[posix_ecode]; - } - else if (posix_ecode == 0) { - s = ""; - } - else { - sprintf(tbuf, "undefined error code (%d)", posix_ecode); - s = tbuf; - } - - len = strlen(s) + 1; /* use strlen() because s is ascii encoding. */ - - if (buf != NULL && size > 0) { - strncpy(buf, s, size - 1); - buf[size - 1] = '\0'; - } - return len; -} diff --git a/ext/mbstring/oniguruma/regposix.c b/ext/mbstring/oniguruma/regposix.c deleted file mode 100644 index 34cbeb9a46f06..0000000000000 --- a/ext/mbstring/oniguruma/regposix.c +++ /dev/null @@ -1,298 +0,0 @@ -/********************************************************************** - regposix.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#define regex_t onig_regex_t -#include "regint.h" -#undef regex_t -#include "onigposix.h" - -#define ONIG_C(reg) ((onig_regex_t* )((reg)->onig)) -#define PONIG_C(reg) ((onig_regex_t** )(&(reg)->onig)) - -/* #define ENC_STRING_LEN(enc,s,len) len = strlen(s) */ -#define ENC_STRING_LEN(enc,s,len) do { \ - if (ONIGENC_MBC_MINLEN(enc) == 1) { \ - UChar* tmps = (UChar* )(s); \ - while (*tmps != 0) tmps++; \ - len = tmps - (UChar* )(s); \ - } \ - else { \ - len = onigenc_str_bytelen_null(enc, (UChar* )s); \ - } \ -} while(0) - -typedef struct { - int onig_err; - int posix_err; -} O2PERR; - -static int -onig2posix_error_code(int code) -{ - static O2PERR o2p[] = { - { ONIG_MISMATCH, REG_NOMATCH }, - { ONIG_NO_SUPPORT_CONFIG, REG_EONIG_INTERNAL }, - { ONIGERR_MEMORY, REG_ESPACE }, - { ONIGERR_MATCH_STACK_LIMIT_OVER, REG_EONIG_INTERNAL }, - { ONIGERR_TYPE_BUG, REG_EONIG_INTERNAL }, - { ONIGERR_PARSER_BUG, REG_EONIG_INTERNAL }, - { ONIGERR_STACK_BUG, REG_EONIG_INTERNAL }, - { ONIGERR_UNDEFINED_BYTECODE, REG_EONIG_INTERNAL }, - { ONIGERR_UNEXPECTED_BYTECODE, REG_EONIG_INTERNAL }, - { ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED, REG_EONIG_BADARG }, - { ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR, REG_EONIG_BADARG }, - { ONIGERR_INVALID_ARGUMENT, REG_EONIG_BADARG }, - { ONIGERR_END_PATTERN_AT_LEFT_BRACE, REG_EBRACE }, - { ONIGERR_END_PATTERN_AT_LEFT_BRACKET, REG_EBRACK }, - { ONIGERR_EMPTY_CHAR_CLASS, REG_ECTYPE }, - { ONIGERR_PREMATURE_END_OF_CHAR_CLASS, REG_ECTYPE }, - { ONIGERR_END_PATTERN_AT_ESCAPE, REG_EESCAPE }, - { ONIGERR_END_PATTERN_AT_META, REG_EESCAPE }, - { ONIGERR_END_PATTERN_AT_CONTROL, REG_EESCAPE }, - { ONIGERR_META_CODE_SYNTAX, REG_BADPAT }, - { ONIGERR_CONTROL_CODE_SYNTAX, REG_BADPAT }, - { ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE, REG_ECTYPE }, - { ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE, REG_ECTYPE }, - { ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS, REG_ECTYPE }, - { ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, REG_BADRPT }, - { ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID, REG_BADRPT }, - { ONIGERR_NESTED_REPEAT_OPERATOR, REG_BADRPT }, - { ONIGERR_UNMATCHED_CLOSE_PARENTHESIS, REG_EPAREN }, - { ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS, REG_EPAREN }, - { ONIGERR_END_PATTERN_IN_GROUP, REG_BADPAT }, - { ONIGERR_UNDEFINED_GROUP_OPTION, REG_BADPAT }, - { ONIGERR_INVALID_POSIX_BRACKET_TYPE, REG_BADPAT }, - { ONIGERR_INVALID_LOOK_BEHIND_PATTERN, REG_BADPAT }, - { ONIGERR_INVALID_REPEAT_RANGE_PATTERN, REG_BADPAT }, - { ONIGERR_TOO_BIG_NUMBER, REG_BADPAT }, - { ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE, REG_BADBR }, - { ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE, REG_BADBR }, - { ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS, REG_ECTYPE }, - { ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE, REG_ECTYPE }, - { ONIGERR_TOO_MANY_MULTI_BYTE_RANGES, REG_ECTYPE }, - { ONIGERR_TOO_SHORT_MULTI_BYTE_STRING, REG_BADPAT }, - { ONIGERR_TOO_BIG_BACKREF_NUMBER, REG_ESUBREG }, - { ONIGERR_INVALID_BACKREF, REG_ESUBREG }, - { ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, REG_BADPAT }, - { ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, REG_EONIG_BADWC }, - { ONIGERR_TOO_LONG_WIDE_CHAR_VALUE, REG_EONIG_BADWC }, - { ONIGERR_INVALID_WIDE_CHAR_VALUE, REG_EONIG_BADWC }, - { ONIGERR_EMPTY_GROUP_NAME, REG_BADPAT }, - { ONIGERR_INVALID_GROUP_NAME, REG_BADPAT }, - { ONIGERR_INVALID_CHAR_IN_GROUP_NAME, REG_BADPAT }, - { ONIGERR_UNDEFINED_NAME_REFERENCE, REG_BADPAT }, - { ONIGERR_UNDEFINED_GROUP_REFERENCE, REG_BADPAT }, - { ONIGERR_MULTIPLEX_DEFINED_NAME, REG_BADPAT }, - { ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, REG_BADPAT }, - { ONIGERR_NEVER_ENDING_RECURSION, REG_BADPAT }, - { ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, REG_BADPAT }, - { ONIGERR_INVALID_CHAR_PROPERTY_NAME, REG_BADPAT }, - { ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION, REG_EONIG_BADARG }, - { ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT, REG_EONIG_THREAD } - - }; - - int i; - - if (code >= 0) return 0; - - for (i = 0; i < sizeof(o2p) / sizeof(o2p[0]); i++) { - if (code == o2p[i].onig_err) - return o2p[i].posix_err; - } - - return REG_EONIG_INTERNAL; /* but, unknown error code */ -} - -extern int -regcomp(regex_t* reg, const char* pattern, int posix_options) -{ - int r, len; - OnigSyntaxType* syntax = OnigDefaultSyntax; - OnigOptionType options; - - if ((posix_options & REG_EXTENDED) == 0) - syntax = ONIG_SYNTAX_POSIX_BASIC; - - options = syntax->options; - if ((posix_options & REG_ICASE) != 0) - ONIG_OPTION_ON(options, ONIG_OPTION_IGNORECASE); - if ((posix_options & REG_NEWLINE) != 0) { - ONIG_OPTION_ON( options, ONIG_OPTION_NEGATE_SINGLELINE); - ONIG_OPTION_OFF(options, ONIG_OPTION_SINGLELINE); - } - - reg->comp_options = posix_options; - - ENC_STRING_LEN(OnigEncDefaultCharEncoding, pattern, len); - r = onig_new(PONIG_C(reg), (UChar* )pattern, (UChar* )(pattern + len), - options, OnigEncDefaultCharEncoding, syntax, - (OnigErrorInfo* )NULL); - if (r != ONIG_NORMAL) { - return onig2posix_error_code(r); - } - - reg->re_nsub = ONIG_C(reg)->num_mem; - return 0; -} - -extern int -regexec(regex_t* reg, const char* str, size_t nmatch, - regmatch_t pmatch[], int posix_options) -{ - int r, i, len; - UChar* end; - regmatch_t* pm; - OnigOptionType options; - - options = ONIG_OPTION_POSIX_REGION; - if ((posix_options & REG_NOTBOL) != 0) options |= ONIG_OPTION_NOTBOL; - if ((posix_options & REG_NOTEOL) != 0) options |= ONIG_OPTION_NOTEOL; - - if (nmatch == 0 || (reg->comp_options & REG_NOSUB) != 0) { - pm = (regmatch_t* )NULL; - nmatch = 0; - } - else if ((int )nmatch < ONIG_C(reg)->num_mem + 1) { - pm = (regmatch_t* )xmalloc(sizeof(regmatch_t) - * (ONIG_C(reg)->num_mem + 1)); - if (pm == NULL) - return REG_ESPACE; - } - else { - pm = pmatch; - } - - ENC_STRING_LEN(ONIG_C(reg)->enc, str, len); - end = (UChar* )(str + len); - r = onig_search(ONIG_C(reg), (UChar* )str, end, (UChar* )str, end, - (OnigRegion* )pmatch, options); - - if (r >= 0) { - r = 0; /* Match */ - if (pm != pmatch && pm != NULL) { - xmemcpy(pmatch, pm, sizeof(regmatch_t) * nmatch); - } - } - else if (r == ONIG_MISMATCH) { - r = REG_NOMATCH; - for (i = 0; i < (int )nmatch; i++) - pmatch[i].rm_so = pmatch[i].rm_eo = ONIG_REGION_NOTPOS; - } - else { - r = onig2posix_error_code(r); - } - - if (pm != pmatch && pm != NULL) - xfree(pm); - - return r; -} - -extern void -regfree(regex_t* reg) -{ - onig_free(ONIG_C(reg)); -} - - -extern void -reg_set_encoding(int mb_code) -{ - OnigEncoding enc; - - switch (mb_code) { - case REG_POSIX_ENCODING_ASCII: - enc = ONIG_ENCODING_ASCII; - break; - case REG_POSIX_ENCODING_EUC_JP: - enc = ONIG_ENCODING_EUC_JP; - break; - case REG_POSIX_ENCODING_SJIS: - enc = ONIG_ENCODING_SJIS; - break; - case REG_POSIX_ENCODING_UTF8: - enc = ONIG_ENCODING_UTF8; - break; - case REG_POSIX_ENCODING_UTF16_BE: - enc = ONIG_ENCODING_UTF16_BE; - break; - case REG_POSIX_ENCODING_UTF16_LE: - enc = ONIG_ENCODING_UTF16_LE; - break; - - default: - return ; - break; - } - - onigenc_set_default_encoding(enc); -} - -extern int -reg_name_to_group_numbers(regex_t* reg, - const unsigned char* name, const unsigned char* name_end, int** nums) -{ - return onig_name_to_group_numbers(ONIG_C(reg), name, name_end, nums); -} - -typedef struct { - int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*); - regex_t* reg; - void* arg; -} i_wrap; - -static int i_wrapper(const unsigned char* name, const unsigned char* name_end, - int ng, int* gs, - onig_regex_t* reg, void* arg) -{ - i_wrap* warg = (i_wrap* )arg; - - return (*warg->func)(name, name_end, ng, gs, warg->reg, warg->arg); -} - -extern int -reg_foreach_name(regex_t* reg, - int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*), - void* arg) -{ - i_wrap warg; - - warg.func = func; - warg.reg = reg; - warg.arg = arg; - - return onig_foreach_name(ONIG_C(reg), i_wrapper, &warg); -} - -extern int -reg_number_of_names(regex_t* reg) -{ - return onig_number_of_names(ONIG_C(reg)); -} diff --git a/ext/mbstring/oniguruma/regsyntax.c b/ext/mbstring/oniguruma/regsyntax.c deleted file mode 100644 index a0f36b8c33dda..0000000000000 --- a/ext/mbstring/oniguruma/regsyntax.c +++ /dev/null @@ -1,207 +0,0 @@ -/********************************************************************** - regsyntax.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -OnigSyntaxType OnigSyntaxPosixBasic = { - ( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_ESC_LPAREN_SUBEXP | - ONIG_SYN_OP_ESC_BRACE_INTERVAL ) - , 0 - , 0 - , ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE ) -}; - -OnigSyntaxType OnigSyntaxPosixExtended = { - ( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_LPAREN_SUBEXP | - ONIG_SYN_OP_BRACE_INTERVAL | - ONIG_SYN_OP_PLUS_ONE_INF | ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_VBAR_ALT ) - , 0 - , ( ONIG_SYN_CONTEXT_INDEP_ANCHORS | - ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | - ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP | - ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC ) - , ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE ) -}; - -OnigSyntaxType OnigSyntaxEmacs = { - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | - ONIG_SYN_OP_ESC_BRACE_INTERVAL | - ONIG_SYN_OP_ESC_LPAREN_SUBEXP | ONIG_SYN_OP_ESC_VBAR_ALT | - ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | - ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_DECIMAL_BACKREF | - ONIG_SYN_OP_LINE_ANCHOR | ONIG_SYN_OP_ESC_CONTROL_CHARS ) - , ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR - , ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC - , ONIG_OPTION_NONE -}; - -OnigSyntaxType OnigSyntaxGrep = { - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_POSIX_BRACKET | - ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_ESC_LPAREN_SUBEXP | - ONIG_SYN_OP_ESC_VBAR_ALT | - ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_ESC_PLUS_ONE_INF | - ONIG_SYN_OP_ESC_QMARK_ZERO_ONE | ONIG_SYN_OP_LINE_ANCHOR | - ONIG_SYN_OP_ESC_W_WORD | ONIG_SYN_OP_ESC_B_WORD_BOUND | - ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | ONIG_SYN_OP_DECIMAL_BACKREF ) - , 0 - , ( ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC | ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC ) - , ONIG_OPTION_NONE -}; - -OnigSyntaxType OnigSyntaxGnuRegex = { - SYN_GNU_REGEX_OP - , 0 - , SYN_GNU_REGEX_BV - , ONIG_OPTION_NONE -}; - -OnigSyntaxType OnigSyntaxJava = { - (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | - ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL | - ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 ) - & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ) - , ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT | - ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT | - ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL | ONIG_SYN_OP2_CCLASS_SET_OP | - ONIG_SYN_OP2_ESC_V_VTAB | ONIG_SYN_OP2_ESC_U_HEX4 | - ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY ) - , ( SYN_GNU_REGEX_BV | ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND ) - , ONIG_OPTION_SINGLELINE -}; - -OnigSyntaxType OnigSyntaxPerl = { - (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | - ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 | - ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS | - ONIG_SYN_OP_ESC_C_CONTROL ) - & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ) - , ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | - ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL | - ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY | - ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT | - ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS ) - , SYN_GNU_REGEX_BV - , ONIG_OPTION_SINGLELINE -}; - - -extern int -onig_set_default_syntax(OnigSyntaxType* syntax) -{ - if (IS_NULL(syntax)) - syntax = ONIG_SYNTAX_RUBY; - - OnigDefaultSyntax = syntax; - return 0; -} - -extern void -onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from) -{ - *to = *from; -} - -extern void -onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op) -{ - syntax->op = op; -} - -extern void -onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2) -{ - syntax->op2 = op2; -} - -extern void -onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior) -{ - syntax->behavior = behavior; -} - -extern void -onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options) -{ - syntax->options = options; -} - -extern unsigned int -onig_get_syntax_op(OnigSyntaxType* syntax) -{ - return syntax->op; -} - -extern unsigned int -onig_get_syntax_op2(OnigSyntaxType* syntax) -{ - return syntax->op2; -} - -extern unsigned int -onig_get_syntax_behavior(OnigSyntaxType* syntax) -{ - return syntax->behavior; -} - -extern OnigOptionType -onig_get_syntax_options(OnigSyntaxType* syntax) -{ - return syntax->options; -} - -#ifdef USE_VARIABLE_META_CHARS -extern int onig_set_meta_char(OnigEncoding enc, - unsigned int what, OnigCodePoint code) -{ - switch (what) { - case ONIG_META_CHAR_ESCAPE: - enc->meta_char_table.esc = code; - break; - case ONIG_META_CHAR_ANYCHAR: - enc->meta_char_table.anychar = code; - break; - case ONIG_META_CHAR_ANYTIME: - enc->meta_char_table.anytime = code; - break; - case ONIG_META_CHAR_ZERO_OR_ONE_TIME: - enc->meta_char_table.zero_or_one_time = code; - break; - case ONIG_META_CHAR_ONE_OR_MORE_TIME: - enc->meta_char_table.one_or_more_time = code; - break; - case ONIG_META_CHAR_ANYCHAR_ANYTIME: - enc->meta_char_table.anychar_anytime = code; - break; - default: - return ONIGERR_INVALID_ARGUMENT; - break; - } - return 0; -} -#endif /* USE_VARIABLE_META_CHARS */ diff --git a/ext/mbstring/oniguruma/regtrav.c b/ext/mbstring/oniguruma/regtrav.c deleted file mode 100644 index 58a17f58b344e..0000000000000 --- a/ext/mbstring/oniguruma/regtrav.c +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************** - regtrav.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "regint.h" - -#ifdef USE_CAPTURE_HISTORY - -static int -capture_tree_traverse(OnigCaptureTreeNode* node, int at, - int(*callback_func)(int,int,int,int,int,void*), - int level, void* arg) -{ - int r, i; - - if (node == (OnigCaptureTreeNode* )0) - return 0; - - if ((at & ONIG_TRAVERSE_CALLBACK_AT_FIRST) != 0) { - r = (*callback_func)(node->group, node->beg, node->end, - level, ONIG_TRAVERSE_CALLBACK_AT_FIRST, arg); - if (r != 0) return r; - } - - for (i = 0; i < node->num_childs; i++) { - r = capture_tree_traverse(node->childs[i], at, - callback_func, level + 1, arg); - if (r != 0) return r; - } - - if ((at & ONIG_TRAVERSE_CALLBACK_AT_LAST) != 0) { - r = (*callback_func)(node->group, node->beg, node->end, - level, ONIG_TRAVERSE_CALLBACK_AT_LAST, arg); - if (r != 0) return r; - } - - return 0; -} -#endif /* USE_CAPTURE_HISTORY */ - -extern int -onig_capture_tree_traverse(OnigRegion* region, int at, - int(*callback_func)(int,int,int,int,int,void*), void* arg) -{ -#ifdef USE_CAPTURE_HISTORY - return capture_tree_traverse(region->history_root, at, - callback_func, 0, arg); -#else - return ONIG_NO_SUPPORT_CONFIG; -#endif -} diff --git a/ext/mbstring/oniguruma/regversion.c b/ext/mbstring/oniguruma/regversion.c deleted file mode 100644 index 5f15c10e65204..0000000000000 --- a/ext/mbstring/oniguruma/regversion.c +++ /dev/null @@ -1,55 +0,0 @@ -/********************************************************************** - regversion.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2005 K.Kosako - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -#include "oniguruma.h" -#include - -extern const char* -onig_version(void) -{ - static char s[12]; - - sprintf(s, "%d.%d.%d", - ONIGURUMA_VERSION_MAJOR, - ONIGURUMA_VERSION_MINOR, - ONIGURUMA_VERSION_TEENY); - return s; -} - -extern const char* -onig_copyright(void) -{ - static char s[58]; - - sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2005 K.Kosako", - ONIGURUMA_VERSION_MAJOR, - ONIGURUMA_VERSION_MINOR, - ONIGURUMA_VERSION_TEENY); - return s; -} diff --git a/ext/mbstring/oniguruma/st.c b/ext/mbstring/oniguruma/st.c deleted file mode 100644 index 65c2cc58bd797..0000000000000 --- a/ext/mbstring/oniguruma/st.c +++ /dev/null @@ -1,717 +0,0 @@ -/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */ - -/* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */ - -#include "config.h" -#include -#include -#include - -#ifdef _WIN32 -#include -#endif - -#ifdef NOT_RUBY -#include "regint.h" -#else -#ifdef RUBY_PLATFORM -#define xmalloc ruby_xmalloc -#define xcalloc ruby_xcalloc -#define xrealloc ruby_xrealloc -#define xfree ruby_xfree - -void *xmalloc(long); -void *xcalloc(long, long); -void *xrealloc(void *, long); -void xfree(void *); -#endif -#endif - -#include "st.h" - -typedef struct st_table_entry st_table_entry; - -struct st_table_entry { - unsigned int hash; - st_data_t key; - st_data_t record; - st_table_entry *next; -}; - -#define ST_DEFAULT_MAX_DENSITY 5 -#define ST_DEFAULT_INIT_TABLE_SIZE 11 - - /* - * DEFAULT_MAX_DENSITY is the default for the largest we allow the - * average number of items per bin before increasing the number of - * bins - * - * DEFAULT_INIT_TABLE_SIZE is the default for the number of bins - * allocated initially - * - */ - -static int numcmp(long, long); -static int numhash(long); -static struct st_hash_type type_numhash = { - numcmp, - numhash, - st_nothing_key_free, - st_nothing_key_clone -}; - -/* extern int strcmp(const char *, const char *); */ -static int strhash(const char *); -static struct st_hash_type type_strhash = { - strcmp, - strhash, - st_nothing_key_free, - st_nothing_key_clone -}; - -static int strend_cmp(st_strend_key*, st_strend_key*); -static int strend_hash(st_strend_key*); -static int strend_key_free(st_data_t key); -static st_data_t strend_key_clone(st_data_t x); - -static struct st_hash_type type_strend_hash = { - strend_cmp, - strend_hash, - strend_key_free, - strend_key_clone -}; - -static void rehash(st_table *); - -#define alloc(type) (type*)xmalloc((unsigned)sizeof(type)) -#define Calloc(n,s) (char*)xcalloc((n),(s)) - -#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0) - -#define do_hash(key,table) (unsigned int)(*(table)->type->hash)((key)) -#define do_hash_bin(key,table) (do_hash(key, table)%(table)->num_bins) - -/* - * MINSIZE is the minimum size of a dictionary. - */ - -#define MINSIZE 8 - -/* -Table of prime numbers 2^n+a, 2<=n<=30. -*/ -static long primes[] = { - 8 + 3, - 16 + 3, - 32 + 5, - 64 + 3, - 128 + 3, - 256 + 27, - 512 + 9, - 1024 + 9, - 2048 + 5, - 4096 + 3, - 8192 + 27, - 16384 + 43, - 32768 + 3, - 65536 + 45, - 131072 + 29, - 262144 + 3, - 524288 + 21, - 1048576 + 7, - 2097152 + 17, - 4194304 + 15, - 8388608 + 9, - 16777216 + 43, - 33554432 + 35, - 67108864 + 15, - 134217728 + 29, - 268435456 + 3, - 536870912 + 11, - 1073741824 + 85, - 0 -}; - -static int -new_size(size) - int size; -{ - int i; - -#if 0 - for (i=3; i<31; i++) { - if ((1< size) return 1< size) return primes[i]; - } - /* Ran out of polynomials */ - return -1; /* should raise exception */ -#endif -} - -#ifdef HASH_LOG -static int collision = 0; -static int init_st = 0; - -static void -stat_col() -{ - FILE *f = fopen("/tmp/col", "w"); - fprintf(f, "collision: %d\n", collision); - fclose(f); -} -#endif - -st_table* -st_init_table_with_size(type, size) - struct st_hash_type *type; - int size; -{ - st_table *tbl; - -#ifdef HASH_LOG - if (init_st == 0) { - init_st = 1; - atexit(stat_col); - } -#endif - - size = new_size(size); /* round up to prime number */ - - tbl = alloc(st_table); - tbl->type = type; - tbl->num_entries = 0; - tbl->num_bins = size; - tbl->bins = (st_table_entry **)Calloc(size, sizeof(st_table_entry*)); - - return tbl; -} - -st_table* -st_init_table(type) - struct st_hash_type *type; -{ - return st_init_table_with_size(type, 0); -} - -st_table* -st_init_numtable(void) -{ - return st_init_table(&type_numhash); -} - -st_table* -st_init_numtable_with_size(size) - int size; -{ - return st_init_table_with_size(&type_numhash, size); -} - -st_table* -st_init_strtable(void) -{ - return st_init_table(&type_strhash); -} - -st_table* -st_init_strtable_with_size(size) - int size; -{ - return st_init_table_with_size(&type_strhash, size); -} - -st_table* -st_init_strend_table_with_size(size) - int size; -{ - return st_init_table_with_size(&type_strend_hash, size); -} - -void -st_free_table(table) - st_table *table; -{ - register st_table_entry *ptr, *next; - int i; - - for(i = 0; i < table->num_bins; i++) { - ptr = table->bins[i]; - while (ptr != 0) { - next = ptr->next; - table->type->key_free(ptr->key); - free(ptr); - ptr = next; - } - } - free(table->bins); - free(table); -} - -#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \ -((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key))) - -#ifdef HASH_LOG -#define COLLISION collision++ -#else -#define COLLISION -#endif - -#define FIND_ENTRY(table, ptr, hash_val, bin_pos) do {\ - bin_pos = hash_val%(table)->num_bins;\ - ptr = (table)->bins[bin_pos];\ - if (PTR_NOT_EQUAL(table, ptr, hash_val, key)) {\ - COLLISION;\ - while (PTR_NOT_EQUAL(table, ptr->next, hash_val, key)) {\ - ptr = ptr->next;\ - }\ - ptr = ptr->next;\ - }\ -} while (0) - -int -st_lookup(table, key, value) - st_table *table; - register st_data_t key; - st_data_t *value; -{ - unsigned int hash_val, bin_pos; - register st_table_entry *ptr; - - hash_val = do_hash(key, table); - FIND_ENTRY(table, ptr, hash_val, bin_pos); - - if (ptr == 0) { - return 0; - } - else { - if (value != 0) *value = ptr->record; - return 1; - } -} - -int -st_lookup_strend(table, str_key, end_key, value) - st_table *table; - const unsigned char* str_key; - const unsigned char* end_key; - st_data_t *value; -{ - st_strend_key key; - - key.s = (unsigned char* )str_key; - key.end = (unsigned char* )end_key; - - return st_lookup(table, (st_data_t )(&key), value); -} - -#define ADD_DIRECT(table, key, value, hash_val, bin_pos)\ -do {\ - st_table_entry *entry;\ - if (table->num_entries/(table->num_bins) > ST_DEFAULT_MAX_DENSITY) {\ - rehash(table);\ - bin_pos = hash_val % table->num_bins;\ - }\ - \ - entry = alloc(st_table_entry);\ - \ - entry->hash = hash_val;\ - entry->key = key;\ - entry->record = value;\ - entry->next = table->bins[bin_pos];\ - table->bins[bin_pos] = entry;\ - table->num_entries++;\ -} while (0) - -int -st_insert(table, key, value) - register st_table *table; - register st_data_t key; - st_data_t value; -{ - unsigned int hash_val, bin_pos; - register st_table_entry *ptr; - - hash_val = do_hash(key, table); - FIND_ENTRY(table, ptr, hash_val, bin_pos); - - if (ptr == 0) { - ADD_DIRECT(table, key, value, hash_val, bin_pos); - return 0; - } - else { - ptr->record = value; - return 1; - } -} - -int -st_insert_strend(table, str_key, end_key, value) - st_table *table; - const unsigned char* str_key; - const unsigned char* end_key; - st_data_t value; -{ - st_strend_key* key; - - key = alloc(st_strend_key); - key->s = (unsigned char* )str_key; - key->end = (unsigned char* )end_key; - - return st_insert(table, (st_data_t )key, value); -} - -void -st_add_direct(table, key, value) - st_table *table; - st_data_t key; - st_data_t value; -{ - unsigned int hash_val, bin_pos; - - hash_val = do_hash(key, table); - bin_pos = hash_val % table->num_bins; - ADD_DIRECT(table, key, value, hash_val, bin_pos); -} - -void -st_add_direct_strend(table, str_key, end_key, value) - st_table *table; - const unsigned char* str_key; - const unsigned char* end_key; - st_data_t value; -{ - st_strend_key* key; - - key = alloc(st_strend_key); - key->s = (unsigned char* )str_key; - key->end = (unsigned char* )end_key; - st_add_direct(table, (st_data_t )key, value); -} - -static void -rehash(table) - register st_table *table; -{ - register st_table_entry *ptr, *next, **new_bins; - int i, old_num_bins = table->num_bins, new_num_bins; - unsigned int hash_val; - - new_num_bins = new_size(old_num_bins+1); - new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*)); - - for(i = 0; i < old_num_bins; i++) { - ptr = table->bins[i]; - while (ptr != 0) { - next = ptr->next; - hash_val = ptr->hash % new_num_bins; - ptr->next = new_bins[hash_val]; - new_bins[hash_val] = ptr; - ptr = next; - } - } - free(table->bins); - table->num_bins = new_num_bins; - table->bins = new_bins; -} - -st_table* -st_copy(old_table) - st_table *old_table; -{ - st_table *new_table; - st_table_entry *ptr, *entry; - int i, num_bins = old_table->num_bins; - - new_table = alloc(st_table); - if (new_table == 0) { - return 0; - } - - *new_table = *old_table; - new_table->bins = (st_table_entry**) - Calloc((unsigned)num_bins, sizeof(st_table_entry*)); - - if (new_table->bins == 0) { - free(new_table); - return 0; - } - - for(i = 0; i < num_bins; i++) { - new_table->bins[i] = 0; - ptr = old_table->bins[i]; - while (ptr != 0) { - entry = alloc(st_table_entry); - if (entry == 0) { - free(new_table->bins); - free(new_table); - return 0; - } - *entry = *ptr; - entry->key = old_table->type->key_clone(ptr->key); - entry->next = new_table->bins[i]; - new_table->bins[i] = entry; - ptr = ptr->next; - } - } - return new_table; -} - -int -st_delete(table, key, value) - register st_table *table; - register st_data_t *key; - st_data_t *value; -{ - unsigned int hash_val; - st_table_entry *tmp; - register st_table_entry *ptr; - - hash_val = do_hash_bin(*key, table); - ptr = table->bins[hash_val]; - - if (ptr == 0) { - if (value != 0) *value = 0; - return 0; - } - - if (EQUAL(table, *key, ptr->key)) { - table->bins[hash_val] = ptr->next; - table->num_entries--; - if (value != 0) *value = ptr->record; - *key = ptr->key; - free(ptr); - return 1; - } - - for(; ptr->next != 0; ptr = ptr->next) { - if (EQUAL(table, ptr->next->key, *key)) { - tmp = ptr->next; - ptr->next = ptr->next->next; - table->num_entries--; - if (value != 0) *value = tmp->record; - *key = tmp->key; - free(tmp); - return 1; - } - } - - return 0; -} - -int -st_delete_safe(table, key, value, never) - register st_table *table; - register st_data_t *key; - st_data_t *value; - st_data_t never; -{ - unsigned int hash_val; - register st_table_entry *ptr; - - hash_val = do_hash_bin(*key, table); - ptr = table->bins[hash_val]; - - if (ptr == 0) { - if (value != 0) *value = 0; - return 0; - } - - for(; ptr != 0; ptr = ptr->next) { - if ((ptr->key != never) && EQUAL(table, ptr->key, *key)) { - table->num_entries--; - *key = ptr->key; - if (value != 0) *value = ptr->record; - ptr->key = ptr->record = never; - return 1; - } - } - - return 0; -} - -static int -delete_never(key, value, never) - st_data_t key, value, never; -{ - if (value == never) return ST_DELETE; - return ST_CONTINUE; -} - -void -st_cleanup_safe(table, never) - st_table *table; - st_data_t never; -{ - int num_entries = table->num_entries; - - st_foreach(table, delete_never, never); - table->num_entries = num_entries; -} - -void -st_foreach(table, func, arg) - st_table *table; - int (*func)(); - st_data_t arg; -{ - st_table_entry *ptr, *last, *tmp; - enum st_retval retval; - int i; - - for(i = 0; i < table->num_bins; i++) { - last = 0; - for(ptr = table->bins[i]; ptr != 0;) { - retval = (*func)(ptr->key, ptr->record, arg, 0); - switch (retval) { - case ST_CHECK: /* check if hash is modified during iteration */ - tmp = 0; - if (i < table->num_bins) { - for (tmp = table->bins[i]; tmp; tmp=tmp->next) { - if (tmp == ptr) break; - } - } - if (!tmp) { - /* call func with error notice */ - retval = (*func)(0, 0, arg, 1); - return; - } - /* fall through */ - case ST_CONTINUE: - last = ptr; - ptr = ptr->next; - break; - case ST_STOP: - return; - case ST_DELETE: - tmp = ptr; - if (last == 0) { - table->bins[i] = ptr->next; - } - else { - last->next = ptr->next; - } - ptr = ptr->next; - table->type->key_free(tmp->key); - free(tmp); - table->num_entries--; - } - } - } -} - -static int -strhash(string) - register const char *string; -{ - register int c; - -#ifdef HASH_ELFHASH - register unsigned int h = 0, g; - - while ((c = *string++) != '\0') { - h = ( h << 4 ) + c; - if ( g = h & 0xF0000000 ) - h ^= g >> 24; - h &= ~g; - } - return h; -#elif HASH_PERL - register int val = 0; - - while ((c = *string++) != '\0') { - val += c; - val += (val << 10); - val ^= (val >> 6); - } - val += (val << 3); - val ^= (val >> 11); - - return val + (val << 15); -#else - register int val = 0; - - while ((c = *string++) != '\0') { - val = val*997 + c; - } - - return val + (val>>5); -#endif -} - -static int -numcmp(x, y) - long x, y; -{ - return x != y; -} - -static int -numhash(n) - long n; -{ - return n; -} - -extern int -st_nothing_key_free(st_data_t key) { return 0; } - -extern st_data_t -st_nothing_key_clone(st_data_t x) { return x; } - -static int strend_cmp(st_strend_key* x, st_strend_key* y) -{ - unsigned char *p, *q; - int c; - - if ((x->end - x->s) != (y->end - y->s)) - return 1; - - p = x->s; - q = y->s; - while (p < x->end) { - c = (int )*p - (int )*q; - if (c != 0) return c; - - p++; q++; - } - - return 0; -} - -static int strend_hash(st_strend_key* x) -{ - int val; - unsigned char *p; - - val = 0; - p = x->s; - while (p < x->end) { - val = val * 997 + (int )*p++; - } - - return val + (val >> 5); -} - -static int strend_key_free(st_data_t x) -{ - xfree((void* )x); - return 0; -} - -static st_data_t strend_key_clone(st_data_t x) -{ - st_strend_key* new_key; - st_strend_key* key = (st_strend_key* )x; - - new_key = alloc(st_strend_key); - *new_key = *key; - return (st_data_t )new_key; -} diff --git a/ext/mbstring/oniguruma/st.h b/ext/mbstring/oniguruma/st.h deleted file mode 100644 index c5cc4e625e08d..0000000000000 --- a/ext/mbstring/oniguruma/st.h +++ /dev/null @@ -1,77 +0,0 @@ -/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */ - -/* @(#) st.h 5.1 89/12/14 */ - -#ifndef ST_INCLUDED - -#define ST_INCLUDED - -typedef unsigned long st_data_t; -#define ST_DATA_T_DEFINED - -typedef struct st_table st_table; - -struct st_hash_type { - int (*compare)(); - int (*hash)(); - int (*key_free)(); - st_data_t (*key_clone)(); -}; - -struct st_table { - struct st_hash_type *type; - int num_bins; - int num_entries; - struct st_table_entry **bins; -}; - -typedef struct { - unsigned char* s; - unsigned char* end; -} st_strend_key; - -#define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0) - -enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK}; - -#ifndef _ -# define _(args) args -#endif -#ifndef ANYARGS -# ifdef __cplusplus -# define ANYARGS ... -# else -# define ANYARGS -# endif -#endif - -st_table *st_init_table _((struct st_hash_type *)); -st_table *st_init_table_with_size _((struct st_hash_type *, int)); -st_table *st_init_numtable _((void)); -st_table *st_init_numtable_with_size _((int)); -st_table *st_init_strtable _((void)); -st_table *st_init_strtable_with_size _((int)); -st_table *st_init_strend_table_with_size _((int)); -int st_delete _((st_table *, st_data_t *, st_data_t *)); -int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t)); -int st_insert _((st_table *, st_data_t, st_data_t)); -int st_insert_strend _((st_table *, const unsigned char*, const unsigned char*, st_data_t)); -int st_lookup _((st_table *, st_data_t, st_data_t *)); -int st_lookup_strend _((st_table *, const unsigned char*, const unsigned char*, st_data_t*)); -void st_foreach _((st_table *, int (*)(ANYARGS), st_data_t)); -void st_add_direct _((st_table *, st_data_t, st_data_t)); -void st_add_direct_strend _((st_table *, const unsigned char*, const unsigned char*, st_data_t)); -void st_free_table _((st_table *)); -void st_cleanup_safe _((st_table *, st_data_t)); -st_table *st_copy _((st_table *)); - -extern st_data_t st_nothing_key_clone _((st_data_t key)); -extern int st_nothing_key_free _((st_data_t key)); - -#define ST_NUMCMP ((int (*)()) 0) -#define ST_NUMHASH ((int (*)()) -2) - -#define st_numcmp ST_NUMCMP -#define st_numhash ST_NUMHASH - -#endif /* ST_INCLUDED */ diff --git a/ext/mbstring/oniguruma/win32/config.h b/ext/mbstring/oniguruma/win32/config.h deleted file mode 100644 index bdbdaf25c1fa1..0000000000000 --- a/ext/mbstring/oniguruma/win32/config.h +++ /dev/null @@ -1,84 +0,0 @@ -#define STDC_HEADERS 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_OFF_T 1 -#define SIZEOF_INT 4 -#define SIZEOF_SHORT 2 -#define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 0 -#define SIZEOF___INT64 8 -#define SIZEOF_OFF_T 4 -#define SIZEOF_VOIDP 4 -#define SIZEOF_FLOAT 4 -#define SIZEOF_DOUBLE 8 -#define HAVE_PROTOTYPES 1 -#define TOKEN_PASTE(x,y) x##y -#define HAVE_STDARG_PROTOTYPES 1 -#ifndef NORETURN -#if _MSC_VER > 1100 -#define NORETURN(x) __declspec(noreturn) x -#else -#define NORETURN(x) x -#endif -#endif -#define HAVE_DECL_SYS_NERR 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_SYS_UTIME_H 1 -#define HAVE_MEMORY_H 1 -#define uid_t int -#define gid_t int -#define HAVE_STRUCT_STAT_ST_RDEV 1 -#define HAVE_ST_RDEV 1 -#define GETGROUPS_T int -#define RETSIGTYPE void -#define HAVE_ALLOCA 1 -#define HAVE_DUP2 1 -#define HAVE_MEMCMP 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MKDIR 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOD 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_FLOCK 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_FINITE 1 -#define HAVE_FMOD 1 -#define HAVE_FREXP 1 -#define HAVE_HYPOT 1 -#define HAVE_MODF 1 -#define HAVE_WAITPID 1 -#define HAVE_CHSIZE 1 -#define HAVE_TIMES 1 -#define HAVE__SETJMP 1 -#define HAVE_TELLDIR 1 -#define HAVE_SEEKDIR 1 -#define HAVE_MKTIME 1 -#define HAVE_COSH 1 -#define HAVE_SINH 1 -#define HAVE_TANH 1 -#define HAVE_EXECVE 1 -#define HAVE_TZNAME 1 -#define HAVE_DAYLIGHT 1 -#define SETPGRP_VOID 1 -#define inline __inline -#define NEED_IO_SEEK_BETWEEN_RW 1 -#define RSHIFT(x,y) ((x)>>(int)y) -#define FILE_COUNT _cnt -#define FILE_READPTR _ptr -#define DEFAULT_KCODE KCODE_NONE -#define DLEXT ".so" -#define DLEXT2 ".dll" diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c deleted file mode 100644 index 3cad5d79ec900..0000000000000 --- a/ext/mbstring/php_mbregex.c +++ /dev/null @@ -1,1247 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Tsukada Takuya | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" - -#if HAVE_MBREGEX - -#include "ext/standard/php_smart_str.h" -#include "php_mbregex.h" -#include "mbstring.h" - -ZEND_EXTERN_MODULE_GLOBALS(mbstring) - -/* {{{ static void php_mb_regex_free_cache() */ -static void php_mb_regex_free_cache(php_mb_regex_t **pre) -{ - onig_free(*pre); -} -/* }}} */ - -/* {{{ _php_mb_regex_globals_ctor */ -void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC) -{ - MBSTRG(default_mbctype) = ONIG_ENCODING_EUC_JP; - MBSTRG(current_mbctype) = ONIG_ENCODING_EUC_JP; - zend_hash_init(&(MBSTRG(ht_rc)), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 1); - MBSTRG(search_str) = (zval*) NULL; - MBSTRG(search_re) = (php_mb_regex_t*)NULL; - MBSTRG(search_pos) = 0; - MBSTRG(search_regs) = (OnigRegion*)NULL; - MBSTRG(regex_default_options) = ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE; - MBSTRG(regex_default_syntax) = ONIG_SYNTAX_RUBY; -} -/* }}} */ - -/* {{{ _php_mb_regex_globals_dtor */ -void _php_mb_regex_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC) -{ - zend_hash_destroy(&MBSTRG(ht_rc)); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(mb_regex) */ -PHP_MINIT_FUNCTION(mb_regex) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION(mb_regex) */ -PHP_MSHUTDOWN_FUNCTION(mb_regex) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION(mb_regex) */ -PHP_RINIT_FUNCTION(mb_regex) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION(mb_regex) */ -PHP_RSHUTDOWN_FUNCTION(mb_regex) -{ - MBSTRG(current_mbctype) = MBSTRG(default_mbctype); - - if (MBSTRG(search_str) != NULL) { - zval_ptr_dtor(&MBSTRG(search_str)); - MBSTRG(search_str) = (zval *)NULL; - } - MBSTRG(search_pos) = 0; - - if (MBSTRG(search_regs) != NULL) { - onig_region_free(MBSTRG(search_regs), 1); - MBSTRG(search_regs) = (OnigRegion *)NULL; - } - zend_hash_clean(&MBSTRG(ht_rc)); - - return SUCCESS; -} -/* }}} */ - -/* - * encoding name resolver - */ - -/* {{{ encoding name map */ -typedef struct _php_mb_regex_enc_name_map_t { - const char *names; - OnigEncoding code; -} php_mb_regex_enc_name_map_t; - -php_mb_regex_enc_name_map_t enc_name_map[] ={ - { - "EUC-JP\0EUCJP\0X-EUC-JP\0UJIS\0EUCJP\0EUCJP-WIN\0", - ONIG_ENCODING_EUC_JP - }, - { - "UTF-8\0UTF8\0", - ONIG_ENCODING_UTF8 - }, - { - "UTF-16\0UTF-16BE\0", - ONIG_ENCODING_UTF16_BE - }, - { - "UTF-16LE\0", - ONIG_ENCODING_UTF16_LE - }, - { - "UCS-4\0UTF-32\0UTF-32BE\0", - ONIG_ENCODING_UTF32_BE - }, - { - "UCS-4LE\0UTF-32LE\0", - ONIG_ENCODING_UTF32_LE - }, - { - "SJIS\0CP932\0MS932\0SHIFT_JIS\0SJIS-WIN\0WINDOWS-31J\0", - ONIG_ENCODING_SJIS - }, - { - "BIG5\0BIG-5\0BIGFIVE\0CN-BIG5\0BIG-FIVE\0", - ONIG_ENCODING_BIG5 - }, - { - "EUC-CN\0EUCCN\0EUC_CN\0GB-2312\0GB2312\0", - ONIG_ENCODING_EUC_CN - }, - { - "EUC-TW\0EUCTW\0EUC_TW\0", - ONIG_ENCODING_EUC_TW - }, - { - "EUC-KR\0EUCKR\0EUC_KR\0", - ONIG_ENCODING_EUC_KR - }, - { - "KOI8\0KOI-8\0", - ONIG_ENCODING_KOI8 - }, - { - "KOI8R\0KOI8-R\0KOI-8R\0", - ONIG_ENCODING_KOI8_R - }, - { - "ISO-8859-1\0ISO8859-1\0ISO_8859_1\0ISO8859_1\0", - ONIG_ENCODING_ISO_8859_1 - }, - { - "ISO-8859-2\0ISO8859-2\0ISO_8859_2\0ISO8859_2\0", - ONIG_ENCODING_ISO_8859_2 - }, - { - "ISO-8859-3\0ISO8859-3\0ISO_8859_3\0ISO8859_3\0", - ONIG_ENCODING_ISO_8859_3 - }, - { - "ISO-8859-4\0ISO8859-4\0ISO_8859_4\0ISO8859_4\0", - ONIG_ENCODING_ISO_8859_4 - }, - { - "ISO-8859-5\0ISO8859-5\0ISO_8859_5\0ISO8859_5\0", - ONIG_ENCODING_ISO_8859_5 - }, - { - "ISO-8859-6\0ISO8859-6\0ISO_8859_6\0ISO8859_6\0", - ONIG_ENCODING_ISO_8859_6 - }, - { - "ISO-8859-7\0ISO8859-7\0ISO_8859_7\0ISO8859_7\0", - ONIG_ENCODING_ISO_8859_7 - }, - { - "ISO-8859-8\0ISO8859-8\0ISO_8859_8\0ISO8859_8\0", - ONIG_ENCODING_ISO_8859_8 - }, - { - "ISO-8859-9\0ISO8859-9\0ISO_8859_9\0ISO8859_9\0", - ONIG_ENCODING_ISO_8859_9 - }, - { - "ISO-8859-10\0ISO8859-10\0ISO_8859_10\0ISO8859_10\0", - ONIG_ENCODING_ISO_8859_10 - }, - { - "ISO-8859-11\0ISO8859-11\0ISO_8859_11\0ISO8859_11\0", - ONIG_ENCODING_ISO_8859_11 - }, - { - "ISO-8859-13\0ISO8859-13\0ISO_8859_13\0ISO8859_13\0", - ONIG_ENCODING_ISO_8859_13 - }, - { - "ISO-8859-14\0ISO8859-14\0ISO_8859_14\0ISO8859_14\0", - ONIG_ENCODING_ISO_8859_14 - }, - { - "ISO-8859-15\0ISO8859-15\0ISO_8859_15\0ISO8859_15\0", - ONIG_ENCODING_ISO_8859_15 - }, - { - "ISO-8859-16\0ISO8859-16\0ISO_8859_16\0ISO8859_16\0", - ONIG_ENCODING_ISO_8859_16 - }, - { - "ASCII\0US-ASCII\0US_ASCII\0ISO646\0", - ONIG_ENCODING_ASCII - }, - { NULL, ONIG_ENCODING_UNDEF } -}; -/* }}} */ - -/* {{{ php_mb_regex_name2mbctype */ -OnigEncoding php_mb_regex_name2mbctype(const char *pname) -{ - const char *p; - php_mb_regex_enc_name_map_t *mapping; - - if (pname == NULL) { - return ONIG_ENCODING_UNDEF; - } - - for (mapping = enc_name_map; mapping->names != NULL; mapping++) { - for (p = mapping->names; *p != '\0'; p += (strlen(p) + 1)) { - if (strcasecmp(p, pname) == 0) { - return mapping->code; - } - } - } - - return ONIG_ENCODING_UNDEF; -} -/* }}} */ - -/* {{{ php_mbregex_mbctype2name */ -const char *php_mb_regex_mbctype2name(OnigEncoding mbctype) -{ - php_mb_regex_enc_name_map_t *mapping; - - for (mapping = enc_name_map; mapping->names != NULL; mapping++) { - if (mapping->code == mbctype) { - return mapping->names; - } - } - - return NULL; -} -/* }}} */ - -/* - * regex cache - */ -/* {{{ php_mbregex_compile_pattern */ -static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC) -{ - int err_code = 0; - int found = 0; - php_mb_regex_t *retval = NULL, **rc = NULL; - OnigErrorInfo err_info; - OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN]; - - found = zend_hash_find(&MBSTRG(ht_rc), (char *)pattern, patlen+1, (void **) &rc); - if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) { - if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) { - onig_error_code_to_str(err_str, err_code, err_info); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str); - retval = NULL; - goto out; - } - zend_hash_update(&MBSTRG(ht_rc), (char *) pattern, patlen + 1, (void *) &retval, sizeof(retval), NULL); - } else if (found == SUCCESS) { - retval = *rc; - } -out: - return retval; -} -/* }}} */ - -/* {{{ _php_mb_regex_get_option_string */ -static size_t _php_mb_regex_get_option_string(char *str, size_t len, OnigOptionType option, OnigSyntaxType *syntax) -{ - size_t len_left = len; - size_t len_req = 0; - char *p = str; - char c; - - if ((option & ONIG_OPTION_IGNORECASE) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 'i'; - } - ++len_req; - } - - if ((option & ONIG_OPTION_EXTEND) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 'x'; - } - ++len_req; - } - - if ((option & (ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE)) == - (ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE)) { - if (len_left > 0) { - --len_left; - *(p++) = 'p'; - } - ++len_req; - } else { - if ((option & ONIG_OPTION_MULTILINE) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 'm'; - } - ++len_req; - } - - if ((option & ONIG_OPTION_SINGLELINE) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 's'; - } - ++len_req; - } - } - if ((option & ONIG_OPTION_FIND_LONGEST) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 'l'; - } - ++len_req; - } - if ((option & ONIG_OPTION_FIND_NOT_EMPTY) != 0) { - if (len_left > 0) { - --len_left; - *(p++) = 'n'; - } - ++len_req; - } - - c = 0; - - if (syntax == ONIG_SYNTAX_JAVA) { - c = 'j'; - } else if (syntax == ONIG_SYNTAX_GNU_REGEX) { - c = 'u'; - } else if (syntax == ONIG_SYNTAX_GREP) { - c = 'g'; - } else if (syntax == ONIG_SYNTAX_EMACS) { - c = 'c'; - } else if (syntax == ONIG_SYNTAX_RUBY) { - c = 'r'; - } else if (syntax == ONIG_SYNTAX_PERL) { - c = 'z'; - } else if (syntax == ONIG_SYNTAX_POSIX_BASIC) { - c = 'b'; - } else if (syntax == ONIG_SYNTAX_POSIX_EXTENDED) { - c = 'd'; - } - - if (c != 0) { - if (len_left > 0) { - --len_left; - *(p++) = c; - } - ++len_req; - } - - - if (len_left > 0) { - --len_left; - *(p++) = '\0'; - } - ++len_req; - if (len < len_req) { - return len_req; - } - - return 0; -} -/* }}} */ - -/* {{{ _php_mb_regex_init_options */ -static void -_php_mb_regex_init_options(const char *parg, int narg, OnigOptionType *option, OnigSyntaxType **syntax, int *eval) -{ - int n; - char c; - int optm = 0; - - *syntax = ONIG_SYNTAX_RUBY; - - if (parg != NULL) { - n = 0; - while(n < narg) { - c = parg[n++]; - switch (c) { - case 'i': - optm |= ONIG_OPTION_IGNORECASE; - break; - case 'x': - optm |= ONIG_OPTION_EXTEND; - break; - case 'm': - optm |= ONIG_OPTION_MULTILINE; - break; - case 's': - optm |= ONIG_OPTION_SINGLELINE; - break; - case 'p': - optm |= ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE; - break; - case 'l': - optm |= ONIG_OPTION_FIND_LONGEST; - break; - case 'n': - optm |= ONIG_OPTION_FIND_NOT_EMPTY; - break; - case 'j': - *syntax = ONIG_SYNTAX_JAVA; - break; - case 'u': - *syntax = ONIG_SYNTAX_GNU_REGEX; - break; - case 'g': - *syntax = ONIG_SYNTAX_GREP; - break; - case 'c': - *syntax = ONIG_SYNTAX_EMACS; - break; - case 'r': - *syntax = ONIG_SYNTAX_RUBY; - break; - case 'z': - *syntax = ONIG_SYNTAX_PERL; - break; - case 'b': - *syntax = ONIG_SYNTAX_POSIX_BASIC; - break; - case 'd': - *syntax = ONIG_SYNTAX_POSIX_EXTENDED; - break; - case 'e': - if (eval != NULL) *eval = 1; - break; - default: - break; - } - } - if (option != NULL) *option|=optm; - } -} -/* }}} */ - -/* - * php funcions - */ - -/* {{{ proto string mb_regex_encoding([string encoding]) - Returns the current encoding for regex as a string. */ -PHP_FUNCTION(mb_regex_encoding) -{ - zval **arg1; - OnigEncoding mbctype; - - if (ZEND_NUM_ARGS() == 0) { - const char *retval = php_mb_regex_mbctype2name(MBSTRG(current_mbctype)); - if ( retval != NULL ) { - RETVAL_STRING((char *)retval, 1); - } else { - RETVAL_FALSE; - } - } else if (ZEND_NUM_ARGS() == 1 && - zend_get_parameters_ex(1, &arg1) != FAILURE) { - convert_to_string_ex(arg1); - mbctype = php_mb_regex_name2mbctype(Z_STRVAL_PP(arg1)); - if (mbctype == ONIG_ENCODING_UNDEF) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", Z_STRVAL_PP(arg1)); - RETVAL_FALSE; - } else { - MBSTRG(current_mbctype) = mbctype; - RETVAL_TRUE; - } - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ _php_mb_regex_ereg_exec */ -static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - zval tmp; - zval *arg_pattern, *array; - char *string; - int string_len; - php_mb_regex_t *re; - OnigRegion *regs = NULL; - int i, match_len, beg, end; - OnigOptionType options; - char *str; - - array = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|z", &arg_pattern, &string, &string_len, &array) == FAILURE) { - RETURN_FALSE; - } - - options = MBSTRG(regex_default_options); - if (icase) { - options |= ONIG_OPTION_IGNORECASE; - } - - /* compile the regular expression from the supplied regex */ - if (Z_TYPE_P(arg_pattern) != IS_STRING) { - /* we convert numbers to integers and treat them as a string */ - tmp = *arg_pattern; - zval_copy_ctor(&tmp); - if (Z_TYPE_P(&tmp) == IS_DOUBLE) { - convert_to_long(&tmp); /* get rid of decimal places */ - } - convert_to_string(&tmp); - arg_pattern = &tmp; - /* don't bother doing an extended regex with just a number */ - } - re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC); - if (re == NULL) { - RETVAL_FALSE; - goto out; - } - - regs = onig_region_new(); - - /* actually execute the regular expression */ - if (onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), string, (OnigUChar *)(string + string_len), regs, 0) < 0) { - RETVAL_FALSE; - goto out; - } - - match_len = 1; - str = string; - if (array != NULL) { - zval ret_array; - match_len = regs->end[0] - regs->beg[0]; - array_init(&ret_array); - for (i = 0; i < regs->num_regs; i++) { - beg = regs->beg[i]; - end = regs->end[i]; - if (beg >= 0 && beg < end && end <= string_len) { - add_index_stringl(&ret_array, i, (char *)&str[beg], end - beg, 1); - } else { - add_index_bool(&ret_array, i, 0); - } - } - REPLACE_ZVAL_VALUE(&array, &ret_array, 0); - } - - if (match_len == 0) { - match_len = 1; - } - RETVAL_LONG(match_len); -out: - if (regs != NULL) { - onig_region_free(regs, 1); - } - if (arg_pattern == &tmp) { - zval_dtor(&tmp); - } -} -/* }}} */ - -/* {{{ proto int mb_ereg(string pattern, string string [, array registers]) - Regular expression match for multibyte string */ -PHP_FUNCTION(mb_ereg) -{ - _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int mb_eregi(string pattern, string string [, array registers]) - Case-insensitive regular expression match for multibyte string */ -PHP_FUNCTION(mb_eregi) -{ - _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ _php_mb_regex_ereg_replace_exec */ -static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options) -{ - zval *arg_pattern_zval; - - char *arg_pattern; - int arg_pattern_len; - - char *replace; - int replace_len; - - char *string; - int string_len; - - char *p; - php_mb_regex_t *re; - OnigSyntaxType *syntax; - OnigRegion *regs = NULL; - smart_str out_buf = { 0 }; - smart_str eval_buf = { 0 }; - smart_str *pbuf; - int i, err, eval, n; - OnigUChar *pos; - OnigUChar *string_lim; - char *description = NULL; - char pat_buf[2]; - - const mbfl_encoding *enc; - - { - const char *current_enc_name; - current_enc_name = php_mb_regex_mbctype2name(MBSTRG(current_mbctype)); - if (current_enc_name == NULL || - (enc = mbfl_name2encoding(current_enc_name)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error"); - RETURN_FALSE; - } - } - eval = 0; - { - char *option_str = NULL; - int option_str_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zss|s", - &arg_pattern_zval, - &replace, &replace_len, - &string, &string_len, - &option_str, &option_str_len) == FAILURE) { - RETURN_FALSE; - } - - if (option_str != NULL) { - _php_mb_regex_init_options(option_str, option_str_len, &options, &syntax, &eval); - } else { - options |= MBSTRG(regex_default_options); - syntax = MBSTRG(regex_default_syntax); - } - } - if (Z_TYPE_P(arg_pattern_zval) == IS_STRING) { - arg_pattern = Z_STRVAL_P(arg_pattern_zval); - arg_pattern_len = Z_STRLEN_P(arg_pattern_zval); - } else { - /* FIXME: this code is not multibyte aware! */ - convert_to_long_ex(&arg_pattern_zval); - pat_buf[0] = (char)Z_LVAL_P(arg_pattern_zval); - pat_buf[1] = '\0'; - - arg_pattern = pat_buf; - arg_pattern_len = 1; - } - /* create regex pattern buffer */ - re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBSTRG(current_mbctype), syntax TSRMLS_CC); - if (re == NULL) { - RETURN_FALSE; - } - - if (eval) { - pbuf = &eval_buf; - description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC); - } else { - pbuf = &out_buf; - description = NULL; - } - - /* do the actual work */ - err = 0; - pos = string; - string_lim = (OnigUChar*)(string + string_len); - regs = onig_region_new(); - while (err >= 0) { - err = onig_search(re, (OnigUChar *)string, (OnigUChar *)string_lim, pos, (OnigUChar *)string_lim, regs, 0); - if (err <= -2) { - OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN]; - onig_error_code_to_str(err_str, err); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str); - break; - } - if (err >= 0) { -#if moriyoshi_0 - if (regs->beg[0] == regs->end[0]) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); - break; - } -#endif - /* copy the part of the string before the match */ - smart_str_appendl(&out_buf, pos, (size_t)((OnigUChar *)(string + regs->beg[0]) - pos)); - /* copy replacement and backrefs */ - i = 0; - p = replace; - while (i < replace_len) { - int fwd = (int) php_mb_mbchar_bytes_ex(p, enc); - n = -1; - if ((replace_len - i) >= 2 && fwd == 1 && - p[0] == '\\' && p[1] >= '0' && p[1] <= '9') { - n = p[1] - '0'; - } - if (n >= 0 && n < regs->num_regs) { - if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && regs->end[n] <= string_len) { - smart_str_appendl(pbuf, string + regs->beg[n], regs->end[n] - regs->beg[n]); - } - p += 2; - i += 2; - } else { - smart_str_appendl(pbuf, p, fwd); - p += fwd; - i += fwd; - } - } - if (eval) { - zval v; - /* null terminate buffer */ - smart_str_appendc(&eval_buf, '\0'); - /* do eval */ - zend_eval_string(eval_buf.c, &v, description TSRMLS_CC); - /* result of eval */ - convert_to_string(&v); - smart_str_appendl(&out_buf, Z_STRVAL(v), Z_STRLEN(v)); - /* Clean up */ - eval_buf.len = 0; - zval_dtor(&v); - } - n = regs->end[0]; - if ((size_t)(pos - (OnigUChar *)string) < n) { - pos = string + n; - } else { - if (pos < string_lim) { - smart_str_appendl(&out_buf, pos, 1); - } - pos++; - } - } else { /* nomatch */ - /* stick that last bit of string on our output */ - if (string_lim - pos > 0) { - smart_str_appendl(&out_buf, pos, string_lim - pos); - } - } - onig_region_free(regs, 0); - } - - if (description) { - efree(description); - } - if (regs != NULL) { - onig_region_free(regs, 1); - } - smart_str_free(&eval_buf); - - if (err <= -2) { - smart_str_free(&out_buf); - RETVAL_FALSE; - } else { - smart_str_appendc(&out_buf, '\0'); - RETVAL_STRINGL((char *)out_buf.c, out_buf.len - 1, 0); - } -} -/* }}} */ - -/* {{{ proto string mb_ereg_replace(string pattern, string replacement, string string [, string option]) - Replace regular expression for multibyte string */ -PHP_FUNCTION(mb_ereg_replace) -{ - _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string mb_eregi_replace(string pattern, string replacement, string string) - Case insensitive replace regular expression for multibyte string */ -PHP_FUNCTION(mb_eregi_replace) -{ - _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, ONIG_OPTION_IGNORECASE); -} -/* }}} */ - -/* {{{ proto array mb_split(string pattern, string string [, int limit]) - split multibyte string into array by regular expression */ -PHP_FUNCTION(mb_split) -{ - char *arg_pattern; - int arg_pattern_len; - php_mb_regex_t *re; - OnigRegion *regs = NULL; - char *string; - OnigUChar *pos; - int string_len; - - int n, err; - long count = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) { - RETURN_FALSE; - } - - if (count == 0) { - count = 1; - } - - /* create regex pattern buffer */ - if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBSTRG(regex_default_options), MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - - array_init(return_value); - - pos = (OnigUChar *)string; - err = 0; - regs = onig_region_new(); - /* churn through str, generating array entries as we go */ - while ((--count != 0) && - (err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) >= 0) { - if (regs->beg[0] == regs->end[0]) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); - break; - } - - /* add it to the array */ - if (regs->beg[0] < string_len && regs->beg[0] >= (size_t)(pos - (OnigUChar *)string)) { - add_next_index_stringl(return_value, pos, ((OnigUChar *)(string + regs->beg[0]) - pos), 1); - } else { - err = -2; - break; - } - /* point at our new starting point */ - n = regs->end[0]; - if ((pos - (OnigUChar *)string) < n) { - pos = (OnigUChar *)string + n; - } - if (count < 0) { - count = 0; - } - onig_region_free(regs, 0); - } - - onig_region_free(regs, 1); - - /* see if we encountered an error */ - if (err <= -2) { - OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN]; - onig_error_code_to_str(err_str, err); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str); - zval_dtor(return_value); - RETURN_FALSE; - } - - /* otherwise we just have one last element to add to the array */ - n = ((OnigUChar *)(string + string_len) - pos); - if (n > 0) { - add_next_index_stringl(return_value, pos, n, 1); - } else { - add_next_index_stringl(return_value, "", 0, 1); - } -} -/* }}} */ - -/* {{{ proto bool mb_ereg_match(string pattern, string string [,string option]) - Regular expression match for multibyte string */ -PHP_FUNCTION(mb_ereg_match) -{ - char *arg_pattern; - int arg_pattern_len; - - char *string; - int string_len; - - php_mb_regex_t *re; - OnigSyntaxType *syntax; - int option = 0, err; - - { - char *option_str = NULL; - int option_str_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", - &arg_pattern, &arg_pattern_len, &string, &string_len, - &option_str, &option_str_len)==FAILURE) { - RETURN_FALSE; - } - - if (option_str != NULL) { - _php_mb_regex_init_options(option_str, option_str_len, &option, &syntax, NULL); - } else { - option |= MBSTRG(regex_default_options); - syntax = MBSTRG(regex_default_syntax); - } - } - - if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBSTRG(current_mbctype), syntax TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - - /* match */ - err = onig_match(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), (OnigUChar *)string, NULL, 0); - if (err >= 0) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* regex search */ -/* {{{ _php_mb_regex_ereg_search_exec */ -static void -_php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval **arg_pattern, **arg_options; - int n, i, err, pos, len, beg, end, option; - OnigUChar *str; - OnigSyntaxType *syntax; - - option = MBSTRG(regex_default_options); - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &arg_pattern) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &arg_pattern, &arg_options) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg_options); - option = 0; - _php_mb_regex_init_options(Z_STRVAL_PP(arg_options), Z_STRLEN_PP(arg_options), &option, &syntax, NULL); - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (ZEND_NUM_ARGS() > 0) { - /* create regex pattern buffer */ - convert_to_string_ex(arg_pattern); - - if ((MBSTRG(search_re) = php_mbregex_compile_pattern(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern), option, MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - } - - pos = MBSTRG(search_pos); - str = NULL; - len = 0; - if (MBSTRG(search_str) != NULL && Z_TYPE_P(MBSTRG(search_str)) == IS_STRING){ - str = (OnigUChar *)Z_STRVAL_P(MBSTRG(search_str)); - len = Z_STRLEN_P(MBSTRG(search_str)); - } - - if (MBSTRG(search_re) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No regex given"); - RETURN_FALSE; - } - - if (str == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No string given"); - RETURN_FALSE; - } - - if (MBSTRG(search_regs)) { - onig_region_free(MBSTRG(search_regs), 1); - } - MBSTRG(search_regs) = onig_region_new(); - - err = onig_search(MBSTRG(search_re), str, str + len, str + pos, str + len, MBSTRG(search_regs), 0); - if (err == ONIG_MISMATCH) { - MBSTRG(search_pos) = len; - RETVAL_FALSE; - } else if (err <= -2) { - OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN]; - onig_error_code_to_str(err_str, err); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str); - RETVAL_FALSE; - } else { - if (MBSTRG(search_regs)->beg[0] == MBSTRG(search_regs)->end[0]) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); - } - switch (mode) { - case 1: - array_init(return_value); - beg = MBSTRG(search_regs)->beg[0]; - end = MBSTRG(search_regs)->end[0]; - add_next_index_long(return_value, beg); - add_next_index_long(return_value, end - beg); - break; - case 2: - array_init(return_value); - n = MBSTRG(search_regs)->num_regs; - for (i = 0; i < n; i++) { - beg = MBSTRG(search_regs)->beg[i]; - end = MBSTRG(search_regs)->end[i]; - if (beg >= 0 && beg <= end && end <= len) { - add_index_stringl(return_value, i, (char *)&str[beg], end - beg, 1); - } else { - add_index_bool(return_value, i, 0); - } - } - break; - default: - RETVAL_TRUE; - break; - } - end = MBSTRG(search_regs)->end[0]; - if (pos < end) { - MBSTRG(search_pos) = end; - } else { - MBSTRG(search_pos) = pos + 1; - } - } - - if (err < 0) { - onig_region_free(MBSTRG(search_regs), 1); - MBSTRG(search_regs) = (OnigRegion *)NULL; - } -} -/* }}} */ - -/* {{{ proto bool mb_ereg_search([string pattern[, string option]]) - Regular expression search for multibyte string */ -PHP_FUNCTION(mb_ereg_search) -{ - _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array mb_ereg_search_pos([string pattern[, string option]]) - Regular expression search for multibyte string */ -PHP_FUNCTION(mb_ereg_search_pos) -{ - _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto array mb_ereg_search_regs([string pattern[, string option]]) - Regular expression search for multibyte string */ -PHP_FUNCTION(mb_ereg_search_regs) -{ - _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto bool mb_ereg_search_init(string string [, string pattern[, string option]]) - Initialize string and regular expression for search. */ -PHP_FUNCTION(mb_ereg_search_init) -{ - zval **arg_str, **arg_pattern, **arg_options; - OnigSyntaxType *syntax = NULL; - int option; - - option = MBSTRG(regex_default_options); - syntax = MBSTRG(regex_default_syntax); - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &arg_str) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &arg_str, &arg_pattern) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &arg_str, &arg_pattern, &arg_options) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg_options); - option = 0; - _php_mb_regex_init_options(Z_STRVAL_PP(arg_options), Z_STRLEN_PP(arg_options), &option, &syntax, NULL); - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (ZEND_NUM_ARGS() > 1) { - /* create regex pattern buffer */ - convert_to_string_ex(arg_pattern); - - if ((MBSTRG(search_re) = php_mbregex_compile_pattern(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern), option, MBSTRG(current_mbctype), syntax TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - } - - if (MBSTRG(search_str) != NULL) { - zval_ptr_dtor(&MBSTRG(search_str)); - MBSTRG(search_str) = (zval *)NULL; - } - - MBSTRG(search_str) = *arg_str; - ZVAL_ADDREF(MBSTRG(search_str)); - SEPARATE_ZVAL_IF_NOT_REF(&MBSTRG(search_str)); - - MBSTRG(search_pos) = 0; - - if (MBSTRG(search_regs) != NULL) { - onig_region_free(MBSTRG(search_regs), 1); - MBSTRG(search_regs) = (OnigRegion *) NULL; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array mb_ereg_search_getregs(void) - Get matched substring of the last time */ -PHP_FUNCTION(mb_ereg_search_getregs) -{ - int n, i, len, beg, end; - OnigUChar *str; - - if (MBSTRG(search_regs) != NULL && Z_TYPE_P(MBSTRG(search_str)) == IS_STRING && Z_STRVAL_P(MBSTRG(search_str)) != NULL) { - array_init(return_value); - - str = (OnigUChar *)Z_STRVAL_P(MBSTRG(search_str)); - len = Z_STRLEN_P(MBSTRG(search_str)); - n = MBSTRG(search_regs)->num_regs; - for (i = 0; i < n; i++) { - beg = MBSTRG(search_regs)->beg[i]; - end = MBSTRG(search_regs)->end[i]; - if (beg >= 0 && beg <= end && end <= len) { - add_index_stringl(return_value, i, (char *)&str[beg], end - beg, 1); - } else { - add_index_bool(return_value, i, 0); - } - } - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mb_ereg_search_getpos(void) - Get search start position */ -PHP_FUNCTION(mb_ereg_search_getpos) -{ - RETVAL_LONG(MBSTRG(search_pos)); -} -/* }}} */ - -/* {{{ proto bool mb_ereg_search_setpos(int position) - Set search start position */ -PHP_FUNCTION(mb_ereg_search_setpos) -{ - zval **arg_pos; - int n; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_pos) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg_pos); - n = Z_LVAL_PP(arg_pos); - if (n < 0 || (MBSTRG(search_str) != NULL && Z_TYPE_P(MBSTRG(search_str)) == IS_STRING && n >= Z_STRLEN_P(MBSTRG(search_str)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range"); - MBSTRG(search_pos) = 0; - RETVAL_FALSE; - } else { - MBSTRG(search_pos) = n; - RETVAL_TRUE; - } -} -/* }}} */ - -/* {{{ php_mb_regex_set_options */ -void php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) -{ - if (prev_options != NULL) { - *prev_options = MBSTRG(regex_default_options); - } - if (prev_syntax != NULL) { - *prev_syntax = MBSTRG(regex_default_syntax); - } - MBSTRG(regex_default_options) = options; - MBSTRG(regex_default_syntax) = syntax; -} -/* }}} */ - -/* {{{ proto string mb_regex_set_options([string options]) - Set or get the default options for mbregex functions */ -PHP_FUNCTION(mb_regex_set_options) -{ - OnigOptionType opt; - OnigSyntaxType *syntax; - char *string = NULL; - int string_len; - char buf[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", - &string, &string_len) == FAILURE) { - RETURN_FALSE; - } - if (string != NULL) { - opt = 0; - syntax = NULL; - _php_mb_regex_init_options(string, string_len, &opt, &syntax, NULL); - php_mb_regex_set_options(opt, syntax, NULL, NULL TSRMLS_CC); - } else { - opt = MBSTRG(regex_default_options); - syntax = MBSTRG(regex_default_syntax); - } - _php_mb_regex_get_option_string(buf, sizeof(buf), opt, syntax); - - RETVAL_STRING(buf, 1); -} -/* }}} */ - -#endif /* HAVE_MBREGEX */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h deleted file mode 100644 index d8cec4637bb3c..0000000000000 --- a/ext/mbstring/php_mbregex.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Moriyoshi Koizumi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _PHP_MBREGEX_H -#define _PHP_MBREGEX_H - -#if HAVE_MBREGEX - -#include "php.h" -#include "zend.h" -#include "oniguruma/oniguruma.h" - -/* {{{ PHP_MBREGEX_GLOBALS */ -#define PHP_MBREGEX_GLOBALS \ - OnigEncoding default_mbctype; \ - OnigEncoding current_mbctype; \ - HashTable ht_rc; \ - zval *search_str; \ - zval *search_str_val; \ - unsigned int search_pos; \ - php_mb_regex_t *search_re; \ - OnigRegion *search_regs; \ - OnigOptionType regex_default_options; \ - OnigSyntaxType *regex_default_syntax; -/* }}} */ - -/* {{{ PHP_MBREGEX_FUNCTION_ENTRIES */ -#define PHP_MBREGEX_FUNCTION_ENTRIES \ - PHP_FE(mb_regex_encoding, NULL) \ - PHP_FE(mb_regex_set_options, NULL) \ - PHP_FE(mb_ereg, third_arg_force_ref) \ - PHP_FE(mb_eregi, third_arg_force_ref) \ - PHP_FE(mb_ereg_replace, NULL) \ - PHP_FE(mb_eregi_replace, NULL) \ - PHP_FE(mb_split, NULL) \ - PHP_FE(mb_ereg_match, NULL) \ - PHP_FE(mb_ereg_search, NULL) \ - PHP_FE(mb_ereg_search_pos, NULL) \ - PHP_FE(mb_ereg_search_regs, NULL) \ - PHP_FE(mb_ereg_search_init, NULL) \ - PHP_FE(mb_ereg_search_getregs, NULL) \ - PHP_FE(mb_ereg_search_getpos, NULL) \ - PHP_FE(mb_ereg_search_setpos, NULL) \ - PHP_FALIAS(mbregex_encoding, mb_regex_encoding, NULL) \ - PHP_FALIAS(mbereg, mb_ereg, NULL) \ - PHP_FALIAS(mberegi, mb_eregi, NULL) \ - PHP_FALIAS(mbereg_replace, mb_ereg_replace, NULL) \ - PHP_FALIAS(mberegi_replace, mb_eregi_replace, NULL) \ - PHP_FALIAS(mbsplit, mb_split, NULL) \ - PHP_FALIAS(mbereg_match, mb_ereg_match, NULL) \ - PHP_FALIAS(mbereg_search, mb_ereg_search, NULL) \ - PHP_FALIAS(mbereg_search_pos, mb_ereg_search_pos, NULL) \ - PHP_FALIAS(mbereg_search_regs, mb_ereg_search_regs, NULL) \ - PHP_FALIAS(mbereg_search_init, mb_ereg_search_init, NULL) \ - PHP_FALIAS(mbereg_search_getregs, mb_ereg_search_getregs, NULL) \ - PHP_FALIAS(mbereg_search_getpos, mb_ereg_search_getpos, NULL) \ - PHP_FALIAS(mbereg_search_setpos, mb_ereg_search_setpos, NULL) -/* }}} */ - -typedef struct _zend_mbstring_globals * zend_mbstring_globals_ptr; - -#define PHP_MBREGEX_MAXCACHE 50 - -PHP_MINIT_FUNCTION(mb_regex); -PHP_MSHUTDOWN_FUNCTION(mb_regex); -PHP_RINIT_FUNCTION(mb_regex); -PHP_RSHUTDOWN_FUNCTION(mb_regex); -void _php_mb_regex_globals_ctor(zend_mbstring_globals_ptr pglobals TSRMLS_DC); -void php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC); -void _php_mb_regex_globals_dtor(zend_mbstring_globals_ptr pglobals TSRMLS_DC); -OnigEncoding php_mb_regex_name2mbctype(const char *pname); -const char *php_mb_regex_mbctype2name(OnigEncoding mbctype); - -PHP_FUNCTION(mb_regex_encoding); -PHP_FUNCTION(mb_ereg); -PHP_FUNCTION(mb_eregi); -PHP_FUNCTION(mb_ereg_replace); -PHP_FUNCTION(mb_eregi_replace); -PHP_FUNCTION(mb_split); -PHP_FUNCTION(mb_ereg_match); -PHP_FUNCTION(mb_ereg_search); -PHP_FUNCTION(mb_ereg_search_pos); -PHP_FUNCTION(mb_ereg_search_regs); -PHP_FUNCTION(mb_ereg_search_init); -PHP_FUNCTION(mb_ereg_search_getregs); -PHP_FUNCTION(mb_ereg_search_getpos); -PHP_FUNCTION(mb_ereg_search_setpos); -PHP_FUNCTION(mb_regex_set_options); - -#endif /* HAVE_MBREGEX */ - -#endif /* _PHP_MBREGEX_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ - diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c deleted file mode 100644 index 99eed1d8dc62c..0000000000000 --- a/ext/mbstring/php_unicode.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong (wez@thebrainroom.com) | - +----------------------------------------------------------------------+ - - Based on code from ucdata-2.5, which has the following Copyright: - - Copyright 2001 Computing Research Labs, New Mexico State University - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" - -#if HAVE_MBSTRING - -/* include case folding data generated from the official UnicodeData.txt file */ -#include "mbstring.h" -#include "php_unicode.h" -#include "unicode_data.h" - -/* - * A simple array of 32-bit masks for lookup. - */ -static unsigned long masks32[32] = { - 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, - 0x00000040, 0x00000080, 0x00000100, 0x00000200, 0x00000400, 0x00000800, - 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00010000, 0x00020000, - 0x00040000, 0x00080000, 0x00100000, 0x00200000, 0x00400000, 0x00800000, - 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, - 0x40000000, 0x80000000 -}; - - -static int prop_lookup(unsigned long code, unsigned long n) -{ - long l, r, m; - - /* - * There is an extra node on the end of the offsets to allow this routine - * to work right. If the index is 0xffff, then there are no nodes for the - * property. - */ - if ((l = _ucprop_offsets[n]) == 0xffff) - return 0; - - /* - * Locate the next offset that is not 0xffff. The sentinel at the end of - * the array is the max index value. - */ - for (m = 1; n + m < _ucprop_size && _ucprop_offsets[n + m] == 0xffff; m++) - ; - - r = _ucprop_offsets[n + m] - 1; - - while (l <= r) { - /* - * Determine a "mid" point and adjust to make sure the mid point is at - * the beginning of a range pair. - */ - m = (l + r) >> 1; - m -= (m & 1); - if (code > _ucprop_ranges[m + 1]) - l = m + 2; - else if (code < _ucprop_ranges[m]) - r = m - 2; - else if (code >= _ucprop_ranges[m] && code <= _ucprop_ranges[m + 1]) - return 1; - } - return 0; - -} - -MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1, - unsigned long mask2) -{ - unsigned long i; - - if (mask1 == 0 && mask2 == 0) - return 0; - - for (i = 0; mask1 && i < 32; i++) { - if ((mask1 & masks32[i]) && prop_lookup(code, i)) - return 1; - } - - for (i = 32; mask2 && i < _ucprop_size; i++) { - if ((mask2 & masks32[i & 31]) && prop_lookup(code, i)) - return 1; - } - - return 0; -} - -static unsigned long case_lookup(unsigned long code, long l, long r, int field) -{ - long m; - - /* - * Do the binary search. - */ - while (l <= r) { - /* - * Determine a "mid" point and adjust to make sure the mid point is at - * the beginning of a case mapping triple. - */ - m = (l + r) >> 1; - m -= (m % 3); - if (code > _uccase_map[m]) - l = m + 3; - else if (code < _uccase_map[m]) - r = m - 3; - else if (code == _uccase_map[m]) - return _uccase_map[m + field]; - } - - return code; -} - -MBSTRING_API unsigned long php_unicode_toupper(unsigned long code) -{ - int field; - long l, r; - - if (php_unicode_is_upper(code)) - return code; - - if (php_unicode_is_lower(code)) { - /* - * The character is lower case. - */ - field = 2; - l = _uccase_len[0]; - r = (l + _uccase_len[1]) - 3; - } else { - /* - * The character is title case. - */ - field = 1; - l = _uccase_len[0] + _uccase_len[1]; - r = _uccase_size - 3; - } - return case_lookup(code, l, r, field); -} - -MBSTRING_API unsigned long php_unicode_tolower(unsigned long code) -{ - int field; - long l, r; - - if (php_unicode_is_lower(code)) - return code; - - if (php_unicode_is_upper(code)) { - /* - * The character is upper case. - */ - field = 1; - l = 0; - r = _uccase_len[0] - 3; - } else { - /* - * The character is title case. - */ - field = 2; - l = _uccase_len[0] + _uccase_len[1]; - r = _uccase_size - 3; - } - return case_lookup(code, l, r, field); -} - -MBSTRING_API unsigned long php_unicode_totitle(unsigned long code) -{ - int field; - long l, r; - - if (php_unicode_is_title(code)) - return code; - - /* - * The offset will always be the same for converting to title case. - */ - field = 2; - - if (php_unicode_is_upper(code)) { - /* - * The character is upper case. - */ - l = 0; - r = _uccase_len[0] - 3; - } else { - /* - * The character is lower case. - */ - l = _uccase_len[0]; - r = (l + _uccase_len[1]) - 3; - } - return case_lookup(code, l, r, field); - -} - - -#define BE_ARY_TO_UINT32(ptr) (\ - ((unsigned char*)(ptr))[0]<<24 |\ - ((unsigned char*)(ptr))[1]<<16 |\ - ((unsigned char*)(ptr))[2]<< 8 |\ - ((unsigned char*)(ptr))[3] ) - -#define UINT32_TO_BE_ARY(ptr,val) { \ - unsigned int v = val; \ - ((unsigned char*)(ptr))[0] = (v>>24) & 0xff,\ - ((unsigned char*)(ptr))[1] = (v>>16) & 0xff,\ - ((unsigned char*)(ptr))[2] = (v>> 8) & 0xff,\ - ((unsigned char*)(ptr))[3] = (v ) & 0xff;\ -} - -MBSTRING_API char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *ret_len, - char *src_encoding TSRMLS_DC) -{ - char *unicode, *newstr; - size_t unicode_len; - unsigned char *unicode_ptr; - size_t i; - - unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len TSRMLS_CC); - if (unicode == NULL) - return NULL; - - unicode_ptr = unicode; - - switch(case_mode) { - case PHP_UNICODE_CASE_UPPER: - for (i = 0; i < unicode_len; i+=4) { - UINT32_TO_BE_ARY(&unicode_ptr[i], - php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]))); - } - break; - - case PHP_UNICODE_CASE_LOWER: - for (i = 0; i < unicode_len; i+=4) { - UINT32_TO_BE_ARY(&unicode_ptr[i], - php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]))); - } - break; - - case PHP_UNICODE_CASE_TITLE: { - int mode = 0; - - for (i = 0; i < unicode_len; i+=4) { - int res = php_unicode_is_prop( - BE_ARY_TO_UINT32(&unicode_ptr[i]), - UC_MN|UC_ME|UC_CF|UC_LM|UC_SK|UC_LU|UC_LL|UC_LT, 0); - if (mode) { - if (res) { - UINT32_TO_BE_ARY(&unicode_ptr[i], - php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]))); - } else { - mode = 0; - } - } else { - if (res) { - mode = 1; - UINT32_TO_BE_ARY(&unicode_ptr[i], - php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]))); - } - } - } - } break; - - } - - newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len TSRMLS_CC); - efree(unicode); - - return newstr; -} - - -#endif /* HAVE_MBSTRING */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h deleted file mode 100644 index 6e3c5c1f73a76..0000000000000 --- a/ext/mbstring/php_unicode.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong (wez@thebrainroom.com) | - +----------------------------------------------------------------------+ - - Based on code from ucdata-2.5, which has the following Copyright: - - Copyright 2001 Computing Research Labs, New Mexico State University - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -*/ - -#ifndef PHP_UNICODE_H -#define PHP_UNICODE_H - -#if HAVE_MBSTRING -/* - * Values that can appear in the `mask1' parameter of the php_unicode_is_prop() - * function. - */ -#define UC_MN 0x00000001 /* Mark, Non-Spacing */ -#define UC_MC 0x00000002 /* Mark, Spacing Combining */ -#define UC_ME 0x00000004 /* Mark, Enclosing */ -#define UC_ND 0x00000008 /* Number, Decimal Digit */ -#define UC_NL 0x00000010 /* Number, Letter */ -#define UC_NO 0x00000020 /* Number, Other */ -#define UC_ZS 0x00000040 /* Separator, Space */ -#define UC_ZL 0x00000080 /* Separator, Line */ -#define UC_ZP 0x00000100 /* Separator, Paragraph */ -#define UC_CC 0x00000200 /* Other, Control */ -#define UC_CF 0x00000400 /* Other, Format */ -#define UC_OS 0x00000800 /* Other, Surrogate */ -#define UC_CO 0x00001000 /* Other, Private Use */ -#define UC_CN 0x00002000 /* Other, Not Assigned */ -#define UC_LU 0x00004000 /* Letter, Uppercase */ -#define UC_LL 0x00008000 /* Letter, Lowercase */ -#define UC_LT 0x00010000 /* Letter, Titlecase */ -#define UC_LM 0x00020000 /* Letter, Modifier */ -#define UC_LO 0x00040000 /* Letter, Other */ -#define UC_PC 0x00080000 /* Punctuation, Connector */ -#define UC_PD 0x00100000 /* Punctuation, Dash */ -#define UC_PS 0x00200000 /* Punctuation, Open */ -#define UC_PE 0x00400000 /* Punctuation, Close */ -#define UC_PO 0x00800000 /* Punctuation, Other */ -#define UC_SM 0x01000000 /* Symbol, Math */ -#define UC_SC 0x02000000 /* Symbol, Currency */ -#define UC_SK 0x04000000 /* Symbol, Modifier */ -#define UC_SO 0x08000000 /* Symbol, Other */ -#define UC_L 0x10000000 /* Left-To-Right */ -#define UC_R 0x20000000 /* Right-To-Left */ -#define UC_EN 0x40000000 /* European Number */ -#define UC_ES 0x80000000 /* European Number Separator */ - -/* - * Values that can appear in the `mask2' parameter of the php_unicode_is_prop() - * function. - */ -#define UC_ET 0x00000001 /* European Number Terminator */ -#define UC_AN 0x00000002 /* Arabic Number */ -#define UC_CS 0x00000004 /* Common Number Separator */ -#define UC_B 0x00000008 /* Block Separator */ -#define UC_S 0x00000010 /* Segment Separator */ -#define UC_WS 0x00000020 /* Whitespace */ -#define UC_ON 0x00000040 /* Other Neutrals */ -/* - * Implementation specific character properties. - */ -#define UC_CM 0x00000080 /* Composite */ -#define UC_NB 0x00000100 /* Non-Breaking */ -#define UC_SY 0x00000200 /* Symmetric */ -#define UC_HD 0x00000400 /* Hex Digit */ -#define UC_QM 0x00000800 /* Quote Mark */ -#define UC_MR 0x00001000 /* Mirroring */ -#define UC_SS 0x00002000 /* Space, other */ - -#define UC_CP 0x00004000 /* Defined */ - -/* - * Added for UnicodeData-2.1.3. - */ -#define UC_PI 0x00008000 /* Punctuation, Initial */ -#define UC_PF 0x00010000 /* Punctuation, Final */ - -MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1, - unsigned long mask2); -MBSTRING_API char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *retlen, - char *src_encoding TSRMLS_DC); - -#define PHP_UNICODE_CASE_UPPER 0 -#define PHP_UNICODE_CASE_LOWER 1 -#define PHP_UNICODE_CASE_TITLE 2 - -#define php_unicode_is_alpha(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LM|UC_LO|UC_LT, 0) -#define php_unicode_is_digit(cc) php_unicode_is_prop(cc, UC_ND, 0) -#define php_unicode_is_alnum(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LM|UC_LO|UC_LT|UC_ND, 0) -#define php_unicode_is_cntrl(cc) php_unicode_is_prop(cc, UC_CC|UC_CF, 0) -#define php_unicode_is_space(cc) php_unicode_is_prop(cc, UC_ZS|UC_SS, 0) -#define php_unicode_is_blank(cc) php_unicode_is_prop(cc, UC_ZS, 0) -#define php_unicode_is_punct(cc) php_unicode_is_prop(cc, UC_PD|UC_PS|UC_PE|UC_PO, UC_PI|UC_PF) -#define php_unicode_is_graph(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME|UC_ND|UC_NL|UC_NO|\ - UC_LU|UC_LL|UC_LT|UC_LM|UC_LO|UC_PC|UC_PD|\ - UC_PS|UC_PE|UC_PO|UC_SM|UC_SM|UC_SC|UC_SK|\ - UC_SO, UC_PI|UC_PF) -#define php_unicode_is_print(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME|UC_ND|UC_NL|UC_NO|\ - UC_LU|UC_LL|UC_LT|UC_LM|UC_LO|UC_PC|UC_PD|\ - UC_PS|UC_PE|UC_PO|UC_SM|UC_SM|UC_SC|UC_SK|\ - UC_SO|UC_ZS, UC_PI|UC_PF) -#define php_unicode_is_upper(cc) php_unicode_is_prop(cc, UC_LU, 0) -#define php_unicode_is_lower(cc) php_unicode_is_prop(cc, UC_LL, 0) -#define php_unicode_is_title(cc) php_unicode_is_prop(cc, UC_LT, 0) -#define php_unicode_is_xdigit(cc) php_unicode_is_prop(cc, 0, UC_HD) - -#define php_unicode_is_isocntrl(cc) php_unicode_is_prop(cc, UC_CC, 0) -#define php_unicode_is_fmtcntrl(cc) php_unicode_is_prop(cc, UC_CF, 0) - -#define php_unicode_is_symbol(cc) php_unicode_is_prop(cc, UC_SM|UC_SC|UC_SO|UC_SK, 0) -#define php_unicode_is_number(cc) php_unicode_is_prop(cc, UC_ND|UC_NO|UC_NL, 0) -#define php_unicode_is_nonspacing(cc) php_unicode_is_prop(cc, UC_MN, 0) -#define php_unicode_is_openpunct(cc) php_unicode_is_prop(cc, UC_PS, 0) -#define php_unicode_is_closepunct(cc) php_unicode_is_prop(cc, UC_PE, 0) -#define php_unicode_is_initialpunct(cc) php_unicode_is_prop(cc, 0, UC_PI) -#define php_unicode_is_finalpunct(cc) php_unicode_is_prop(cc, 0, UC_PF) - -#define php_unicode_is_composite(cc) php_unicode_is_prop(cc, 0, UC_CM) -#define php_unicode_is_hex(cc) php_unicode_is_prop(cc, 0, UC_HD) -#define php_unicode_is_quote(cc) php_unicode_is_prop(cc, 0, UC_QM) -#define php_unicode_is_symmetric(cc) php_unicode_is_prop(cc, 0, UC_SY) -#define php_unicode_is_mirroring(cc) php_unicode_is_prop(cc, 0, UC_MR) -#define php_unicode_is_nonbreaking(cc) php_unicode_is_prop(cc, 0, UC_NB) - -/* - * Directionality macros. - */ -#define php_unicode_is_rtl(cc) php_unicode_is_prop(cc, UC_R, 0) -#define php_unicode_is_ltr(cc) php_unicode_is_prop(cc, UC_L, 0) -#define php_unicode_is_strong(cc) php_unicode_is_prop(cc, UC_L|UC_R, 0) -#define php_unicode_is_weak(cc) php_unicode_is_prop(cc, UC_EN|UC_ES, UC_ET|UC_AN|UC_CS) -#define php_unicode_is_neutral(cc) php_unicode_is_prop(cc, 0, UC_B|UC_S|UC_WS|UC_ON) -#define php_unicode_is_separator(cc) php_unicode_is_prop(cc, 0, UC_B|UC_S) - -/* - * Other macros inspired by John Cowan. - */ -#define php_unicode_is_mark(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME, 0) -#define php_unicode_is_modif(cc) php_unicode_is_prop(cc, UC_LM, 0) -#define php_unicode_is_letnum(cc) php_unicode_is_prop(cc, UC_NL, 0) -#define php_unicode_is_connect(cc) php_unicode_is_prop(cc, UC_PC, 0) -#define php_unicode_is_dash(cc) php_unicode_is_prop(cc, UC_PD, 0) -#define php_unicode_is_math(cc) php_unicode_is_prop(cc, UC_SM, 0) -#define php_unicode_is_currency(cc) php_unicode_is_prop(cc, UC_SC, 0) -#define php_unicode_is_modifsymbol(cc) php_unicode_is_prop(cc, UC_SK, 0) -#define php_unicode_is_nsmark(cc) php_unicode_is_prop(cc, UC_MN, 0) -#define php_unicode_is_spmark(cc) php_unicode_is_prop(cc, UC_MC, 0) -#define php_unicode_is_enclosing(cc) php_unicode_is_prop(cc, UC_ME, 0) -#define php_unicode_is_private(cc) php_unicode_is_prop(cc, UC_CO, 0) -#define php_unicode_is_surrogate(cc) php_unicode_is_prop(cc, UC_OS, 0) -#define php_unicode_is_lsep(cc) php_unicode_is_prop(cc, UC_ZL, 0) -#define php_unicode_is_psep(cc) php_unicode_is_prop(cc, UC_ZP, 0) - -#define php_unicode_is_identstart(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LT|UC_LO|UC_NL, 0) -#define php_unicode_is_identpart(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LT|UC_LO|UC_NL|\ - UC_MN|UC_MC|UC_ND|UC_PC|UC_CF, 0) - -#define php_unicode_is_defined(cc) php_unicode_is_prop(cc, 0, UC_CP) -#define php_unicode_is_undefined(cc) !php_unicode_is_prop(cc, 0, UC_CP) - -/* - * Other miscellaneous character property macros. - */ -#define php_unicode_is_han(cc) (((cc) >= 0x4e00 && (cc) <= 0x9fff) ||\ - ((cc) >= 0xf900 && (cc) <= 0xfaff)) -#define php_unicode_is_hangul(cc) ((cc) >= 0xac00 && (cc) <= 0xd7ff) - - -#endif - - -#endif /* PHP_UNICODE_H */ - - - diff --git a/ext/mbstring/tests/bug20087.phpt b/ext/mbstring/tests/bug20087.phpt deleted file mode 100644 index efae733ca2440..0000000000000 --- a/ext/mbstring/tests/bug20087.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #20087 (Assertion failure) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -string(0) "" -bool(true) -string(3) "moo" - diff --git a/ext/mbstring/tests/bug25140.phpt b/ext/mbstring/tests/bug25140.phpt deleted file mode 100644 index 0b209120f520a..0000000000000 --- a/ext/mbstring/tests/bug25140.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #25140 (mb_convert_encoding returns FALSE on an empty string) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(0) "" diff --git a/ext/mbstring/tests/bug26639.phpt b/ext/mbstring/tests/bug26639.phpt deleted file mode 100644 index a87e912ba60d3..0000000000000 --- a/ext/mbstring/tests/bug26639.phpt +++ /dev/null @@ -1,123 +0,0 @@ ---TEST-- -Bug #26639 (mb_convert_variables() clutters variables beyond the references) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "‚ ‚˘‚¤‚Ĥ‚¨" refcount(2) -string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(2) -string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(1) -string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(1) -array(1) refcount(2){ - [0]=> - string(10) "‚ ‚˘‚¤‚Ĥ‚¨" refcount(2) -} -array(1) refcount(2){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(1) -} -array(1) refcount(2){ - [0]=> - &string(10) "‚ ‚˘‚¤‚Ĥ‚¨" refcount(2) -} -array(1) refcount(2){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(1) -} -array(1) refcount(1){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(2) -} -array(1) refcount(1){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(2) -} -array(1) refcount(1){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(2) -} -array(1) refcount(1){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(2) -} -array(1) refcount(3){ - [0]=> - array(1) refcount(1){ - [0]=> - string(10) "‚ ‚˘‚¤‚Ĥ‚¨" refcount(1) - } -} -array(1) refcount(2){ - [0]=> - array(1) refcount(1){ - [0]=> - string(10) "¤˘¤¤¤Ĥ¤¨¤Ş" refcount(1) - } -} diff --git a/ext/mbstring/tests/bug28220.phpt b/ext/mbstring/tests/bug28220.phpt deleted file mode 100644 index 563e2da743e4f..0000000000000 --- a/ext/mbstring/tests/bug28220.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #28220 (mb_strwidth() returns wrong width values for some Hangul characters) ---FILE-- - ---EXPECT-- -8101 -63 diff --git a/ext/mbstring/tests/bug30549.phpt b/ext/mbstring/tests/bug30549.phpt deleted file mode 100644 index dbd8e0bd19838..0000000000000 --- a/ext/mbstring/tests/bug30549.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #30549 (incorrect character translations for some ISO8859 charsets) ---FILE-- - 0x20ac, 0xa5 => 0x20af, 0xaa => 0x037a)); -test('ISO-8859-8', array(0xaf => 0x00af, 0xfd => 0x200e, 0xfe => 0x200f)); -test('ISO-8859-10', array(0xa4 => 0x012a )); - -function test($enc, $map) { - print "$enc\n"; - - foreach($map as $fromc => $toc) { - $ustr = mb_convert_encoding(pack('C', $fromc), 'UCS-4BE', $enc); - foreach (unpack('Nc', $ustr) as $unic); - printf("0x%04x, 0x%04x\n", $toc, $unic); - } -} -?> ---EXPECT-- -ISO-8859-7 -0x20ac, 0x20ac -0x20af, 0x20af -0x037a, 0x037a -ISO-8859-8 -0x00af, 0x00af -0x200e, 0x200e -0x200f, 0x200f -ISO-8859-10 -0x012a, 0x012a diff --git a/ext/mbstring/tests/bug31911.phpt b/ext/mbstring/tests/bug31911.phpt deleted file mode 100644 index eb6438d4e7acd..0000000000000 --- a/ext/mbstring/tests/bug31911.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #31911 (mb_decode_mimeheader() is case-sensitive to hex escapes) ---FILE-- - ---EXPECT-- -Works: ??? -Fails: ??? diff --git a/ext/mbstring/tests/casefold.phpt b/ext/mbstring/tests/casefold.phpt deleted file mode 100644 index 977b0bb658aa7..0000000000000 --- a/ext/mbstring/tests/casefold.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -mb_strtoupper() / mb_strtolower() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -abcdefghijklmnopqrstuvwxyz -ABCDEFGHIJKLMNOPQRSTUVWXYZ -ÄËÏ -Äëï diff --git a/ext/mbstring/tests/common.inc b/ext/mbstring/tests/common.inc deleted file mode 100644 index e8fb411b01364..0000000000000 --- a/ext/mbstring/tests/common.inc +++ /dev/null @@ -1,53 +0,0 @@ - "Error", // E_ERROR - 2 => "Warning", // E_WARINING - 4 => "Parsing Error", // E_PARSE - 8 => "Notice", // E_NOTICE - 16 => "Core Error", // E_CORE_ERROR - 32 => "Core Warning", // E_CORE_WARNING - 64 => "Compile Error", // E_COMPILE_ERROR - 128 => "Compile Warning", // E_COMPILE_WARNING - 256 => "User Error", // E_USER_ERROR - 512 => "User Warning", // E_USER_WARMING - 1024=> "User Notice" // E_USER_NOTICE - ); - - if (!empty($debug)) { - printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum); - } - else { - printf("ERR: %s\n",$err_type[$err_no]); - } -} - -set_error_handler('test_error_handler'); - - -// Var def for testing -$t_ary = array( - 's1' => 'ĈüËܸìEUC-JP¤ÎʸğúÎó', - 's2' => 'English Text' - ); - -class tc -{ - public $s1 = 'ĈüËܸìEUC-JP¤ÎʸğúÎó'; - public $s2 = 'English Text'; - - function tc() - { - } -} - -$t_obj = new tc; - -?> \ No newline at end of file diff --git a/ext/mbstring/tests/htmlent.phpt b/ext/mbstring/tests/htmlent.phpt deleted file mode 100644 index e49714ddc2eaf..0000000000000 --- a/ext/mbstring/tests/htmlent.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -HTML input/output ---SKIPIF-- - ---INI-- -output_buffering=4096 -output_handler=mb_output_handler -zlib.output_compression= -arg_separator.input=x -error_reporting=0 -mbstring.http_input=HTML-ENTITIES -mbstring.internal_encoding=UTF-8 -mbstring.http_output=HTML-ENTITIES -mbstring.encoding_translation=1 ---FILE-- - -'.mb_internal_encoding().'>'.mb_http_output();?> - - -===DONE=== ---EXPECT-- -HTML-ENTITIES>UTF-8>HTML-ENTITIES -Array -( - [test] => &@AB€‚äöü€⟨⟩ -) -===DONE=== diff --git a/ext/mbstring/tests/ini_language.phpt b/ext/mbstring/tests/ini_language.phpt deleted file mode 100644 index 1dc94141fa07e..0000000000000 --- a/ext/mbstring/tests/ini_language.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mbstring.language bug ---SKIPIF-- - ---INI-- -mbstring.internal_encoding=Shift_JIS -mbstring.language=Japanese ---FILE-- - ---EXPECT-- -string(9) "Shift_JIS" -string(4) "SJIS" diff --git a/ext/mbstring/tests/mb_convert_encoding.phpt b/ext/mbstring/tests/mb_convert_encoding.phpt deleted file mode 100644 index 9d8a40b9dc04e..0000000000000 --- a/ext/mbstring/tests/mb_convert_encoding.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -mb_convert_encoding() ---SKIPIF-- - ---INI-- -output_handler= -mbstring.language=Japanese ---FILE-- -'JIS', 1=>'UTF-8', 2=>'EUC-JP', 3=>'SJIS'); -$s = $jis; -$s = mb_convert_encoding($s, 'EUC-JP', $a); -print("EUC-JP: $s\n"); // EUC-JP - -$s = $euc_jp; -$s = mb_convert_encoding($s, 'SJIS', $a); -print("SJIS: ".base64_encode($s)."\n"); // SJIS - -$s = $euc_jp; -$s = mb_convert_encoding($s, 'JIS', $a); -print("JIS: ".base64_encode($s)."\n"); // JIS - - -// Using Detect Order -echo "== DETECT ORDER ==\n"; - -$s = $jis; -$s = mb_convert_encoding($s, 'EUC-JP', 'auto'); -print("EUC-JP: $s\n"); // EUC-JP - -$s = $euc_jp; -$s = mb_convert_encoding($s, 'SJIS', 'auto'); -print("SJIS: ".base64_encode($s)."\n"); // SJIS - -$s = $euc_jp; -$s = mb_convert_encoding($s, 'JIS', 'auto'); -print("JIS: ".base64_encode($s)."\n"); // JIS - - -// Invalid(?) Parameters -echo "== INVALID PARAMETER ==\n"; - -$s = mb_convert_encoding(1234, 'EUC-JP'); -print("INT: $s\n"); // EUC-JP - -$s = mb_convert_encoding('', 'EUC-JP'); -print("EUC-JP: $s\n"); // SJIS - -$s = $euc_jp; -$s = mb_convert_encoding($s, 'BAD'); -print("BAD: $s\n"); // BAD - -$s = $euc_jp; -$s = mb_convert_encoding($s); -print("MP: $s\n"); // Missing parameter - - -?> - ---EXPECT-- -== BASIC TEST == -EUC-JP: ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -EUC-JP: ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -SJIS: k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg== -JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== -== STRING ENCODING LIST == -EUC-JP: ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -SJIS: k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg== -JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== -== ARRAY ENCODING LIST == -EUC-JP: ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -SJIS: k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg== -JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== -== DETECT ORDER == -EUC-JP: ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -SJIS: k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg== -JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== -== INVALID PARAMETER == -INT: 1234 -EUC-JP: -ERR: Warning -BAD: -ERR: Warning -MP: - - diff --git a/ext/mbstring/tests/mb_convert_variables.phpt b/ext/mbstring/tests/mb_convert_variables.phpt deleted file mode 100644 index 901726bc49a75..0000000000000 --- a/ext/mbstring/tests/mb_convert_variables.phpt +++ /dev/null @@ -1,164 +0,0 @@ ---TEST-- -mb_convert_variables() ---SKIPIF-- - ---INI-- -output_handler= -mbstring.language=Japanese ---FILE-- -s1 = $euc_jp; - $this->s2 = $euc_jp; - $this->s3 = $euc_jp; - } -} - -class bar -{ - public $s1; - public $s2; - public $s3; - - function bar() - { - global $sjis, $jis, $euc_jp; - - $this->s1 = $euc_jp; - $this->s2 = $euc_jp; - $this->s3 = $euc_jp; - } -} - - -$o = new foo; -$oo = $o; -$encoding = mb_convert_variables('EUC-JP', 'auto', $oo); -print("$encoding\n"); // EUC-JP -print("{$oo->s1}{$oo->s2}{$oo->s3}\n"); // Converted to EUC-JP - -$o = new bar; -$oo = $o; -$encoding = mb_convert_variables('EUC-JP', 'auto', $oo); -print("$encoding\n"); // EUC-JP -print("{$oo->s1}{$oo->s2}{$oo->s3}\n"); // Converted to EUC-JP - - -// Test for scaler, array and object -echo "== SCALER, ARRAY AND OBJECT TEST ==\n"; - -$s1 = $euc_jp; -$s2 = $euc_jp; -$s3 = $euc_jp; -$aa = $a; -$oo = $o; - -$encoding = mb_convert_variables('EUC-JP', 'auto', $s1, $s2, $s3, $aa, $oo); -print("$encoding\n"); // EUC-JP -print("$s1$s2$s3\n"); // Converted to EUC-JP -print("{$aa[0]}{$aa[1]}{$aa[2]}\n"); // Converted to EUC-JP -print("{$oo->s1}{$oo->s2}{$oo->s3}\n"); // Converted to EUC-JP - - -?> - ---EXPECT-- -== SCALER TEST == -SJIS -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -JIS -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -EUC-JP -k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg== -EUC-JP -GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -== ARRAY TEST == -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -== OBJECT TEST == -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -== SCALER, ARRAY AND OBJECT TEST == -EUC-JP -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ -ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ĈüËܸìĈ­ıȤǤıĦ£01234£µ£ĥ£·£¸£ıĦ£ - diff --git a/ext/mbstring/tests/mb_detect_encoding.phpt b/ext/mbstring/tests/mb_detect_encoding.phpt deleted file mode 100644 index 79b1a1bd42eda..0000000000000 --- a/ext/mbstring/tests/mb_detect_encoding.phpt +++ /dev/null @@ -1,121 +0,0 @@ ---TEST-- -mb_detect_encoding() ---SKIPIF-- - ---INI-- -mbstring.language=Japanese ---FILE-- -'UTF-8',1=>'EUC-JP', 2=>'SJIS', 3=>'JIS'); - -// Note: Due to detect order, detected as UTF-8 -$s = $jis; -$s = mb_detect_encoding($s, $a); -print("JIS: $s\n"); - -$s = $euc_jp; -$s = mb_detect_encoding($s, $a); -print("EUC-JP: $s\n"); - -$s = $sjis; -$s = mb_detect_encoding($s, $a); -print("SJIS: $s\n"); - - -// Using Detect Order -echo "== DETECT ORDER ==\n"; - -mb_detect_order('auto'); - - -$s = $jis; -$s = mb_detect_encoding($s); -print("JIS: $s\n"); - -$s = $euc_jp; -$s = mb_detect_encoding($s); -print("EUC-JP: $s\n"); - -$s = $sjis; -$s = mb_detect_encoding($s); -print("SJIS: $s\n"); - - -// Invalid(?) Parameters -echo "== INVALID PARAMETER ==\n"; - -$s = mb_detect_encoding(1234, 'EUC-JP'); -print("INT: $s\n"); // EUC-JP - -$s = mb_detect_encoding('', 'EUC-JP'); -print("EUC-JP: $s\n"); // SJIS - -$s = $euc_jp; -$s = mb_detect_encoding($s, 'BAD'); -print("BAD: $s\n"); // BAD - -$s = $euc_jp; -$s = mb_detect_encoding(); -print("MP: $s\n"); // Missing parameter - - -?> - ---EXPECT-- -== BASIC TEST == -SJIS: SJIS -JIS: JIS -EUC-JP: EUC-JP -EUC-JP: EUC-JP -== ARRAY ENCODING LIST == -JIS: UTF-8 -EUC-JP: EUC-JP -SJIS: SJIS -== DETECT ORDER == -JIS: JIS -EUC-JP: EUC-JP -SJIS: SJIS -== INVALID PARAMETER == -INT: EUC-JP -EUC-JP: EUC-JP -ERR: Warning -BAD: EUC-JP -ERR: Warning -MP: - diff --git a/ext/mbstring/tests/mb_detect_order.phpt b/ext/mbstring/tests/mb_detect_order.phpt deleted file mode 100644 index bb0ec5653a5d5..0000000000000 --- a/ext/mbstring/tests/mb_detect_order.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -mb_detect_order() ---SKIPIF-- - ---INI-- -mbstring.language=Japanese ---FILE-- - - ---EXPECT-- -OK_AUTO -ASCII, JIS, UTF-8, EUC-JP, SJIS -OK_STR -SJIS, EUC-JP, JIS, UTF-8 -OK_ARRAY -ASCII, JIS, EUC-JP, UTF-8 -== INVALID PARAMETER == -OK_BAD_STR -ASCII, JIS, EUC-JP, UTF-8 -OK_BAD_ARRAY -ASCII, JIS, EUC-JP, UTF-8 - diff --git a/ext/mbstring/tests/mb_ereg-compat-01.phpt b/ext/mbstring/tests/mb_ereg-compat-01.phpt deleted file mode 100644 index 09376780ed030..0000000000000 --- a/ext/mbstring/tests/mb_ereg-compat-01.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -mb_ereg() compat test 1 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ok -ok diff --git a/ext/mbstring/tests/mb_ereg-compat-02.phpt b/ext/mbstring/tests/mb_ereg-compat-02.phpt deleted file mode 100644 index 2f40422543804..0000000000000 --- a/ext/mbstring/tests/mb_ereg-compat-02.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -mb_ereg() compat test 2 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -32 -This is a nice and simple string -is -is diff --git a/ext/mbstring/tests/mb_ereg.phpt b/ext/mbstring/tests/mb_ereg.phpt deleted file mode 100644 index d069b2593d008..0000000000000 --- a/ext/mbstring/tests/mb_ereg.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -mb_ereg() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -(15)abc def ghi jkl def ghi jkl -(27)£á£â£ ¤˘¤Ş¤¤ ¤Ğ¤³¤Ê ¤ï¤ñ¤ó £á£â£ ¤˘¤Ş¤¤ ¤Ğ ¤³¤Ê ¤ï¤ñ¤ó -(27)£í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ £í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ -(15)abc def ghi jkl def ghi jkl -(27)£á£â£ ¤˘¤Ş¤¤ ¤Ğ¤³¤Ê ¤ï¤ñ¤ó £á£â£ ¤˘¤Ş¤¤ ¤Ğ ¤³¤Ê ¤ï¤ñ¤ó -(27)£í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ £í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ -(15)abc def ghi jkl def ghi jkl -(27)£á£â£ ¤˘¤Ş¤¤ ¤Ğ¤³¤Ê ¤ï¤ñ¤ó £á£â£ ¤˘¤Ş¤¤ ¤Ğ ¤³¤Ê ¤ï¤ñ¤ó -(27)£í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ £í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ -(15)abc def ghi jkl def ghi jkl -(39)£á£â£ ¤˘¤Ş¤¤ ¤Ğ¤³¤Ê ¤ï¤ñ¤ó £á£â£ ¤˘¤Ş¤¤ ¤Ğ ¤³¤Ê ¤ï¤ñ¤ó -(39)£í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ £í£ú£ĝ£ĉ£ ¤Ĥ¤Ş¤Ğ ¤­¤Ğ ¤ò¤ diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-01.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-01.phpt deleted file mode 100644 index ad2c6c1c560bf..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-01.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 1 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abcdef diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-02.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-02.phpt deleted file mode 100644 index b5ea12196dc39..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-02.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 2 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abc diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-03.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-03.phpt deleted file mode 100644 index c02a346c5e019..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-03.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 3 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -'test diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-04.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-04.phpt deleted file mode 100644 index 94ff320707979..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-04.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 4 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -That is a nice and simple string diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-05.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-05.phpt deleted file mode 100644 index f5dae3da14881..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-05.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 5 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -strlen($b)=0 diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-06.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-06.phpt deleted file mode 100644 index 8c84dc1e3c033..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-06.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 6 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -123 abc +-|= diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-07.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-07.phpt deleted file mode 100644 index e390655ef4a67..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-07.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 7 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abc2222222222def2222222222 diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-08.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-08.phpt deleted file mode 100644 index 5ccc9fd1c020f..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-08.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abcdef123ghi diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-09.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-09.phpt deleted file mode 100644 index bef8be1f4d915..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-09.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 9 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abcdef\1ghi diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-10.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-10.phpt deleted file mode 100644 index ac80a4e052c81..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-10.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 10 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abcdef\g\\hi\ diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-11.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-11.phpt deleted file mode 100644 index 7ae3edf62fce6..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-11.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 11 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -\2 diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-12.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-12.phpt deleted file mode 100644 index 53bc51e6768a9..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-12.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 12 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -zabc123 diff --git a/ext/mbstring/tests/mb_ereg_replace-compat-13.phpt b/ext/mbstring/tests/mb_ereg_replace-compat-13.phpt deleted file mode 100644 index 2975ab75ba1ab..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace-compat-13.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -mb_ereg_replace() compat test 13 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -abc123abc diff --git a/ext/mbstring/tests/mb_ereg_replace.phpt b/ext/mbstring/tests/mb_ereg_replace.phpt deleted file mode 100644 index 9413da82b9420..0000000000000 --- a/ext/mbstring/tests/mb_ereg_replace.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -mb_ereg_replace() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -a-b-c-d-e -[abc] [def] [ghi] - diff --git a/ext/mbstring/tests/mb_ereg_search_xxx.phpt b/ext/mbstring/tests/mb_ereg_search_xxx.phpt deleted file mode 100644 index c2c0b84a8562a..0000000000000 --- a/ext/mbstring/tests/mb_ereg_search_xxx.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -mb_ereg_search() stuff ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -(EUC-JP) (10) ĦĤ˘Ï -(EUC-JP) (5) abcde -(EUC-JP) (14) abdeabcf -(EUC-JP) (22) abc -(EUC-JP) (31) abcd -(EUC-JP) (5) ˘ÏĦĤ -(EUC-JP) (10) ĦĤ˘Ï -(EUC-JP) (5) abcde -(EUC-JP) (14) abdeabcf -(EUC-JP) (22) abc -(EUC-JP) (31) abcd -(Shift_JIS) (10) ĦĤ˘Ï -(Shift_JIS) (5) abcde -(Shift_JIS) (14) abdeabcf -(Shift_JIS) (22) abc -(Shift_JIS) (31) abcd -(Shift_JIS) (5) ˘ÏĦĤ -(Shift_JIS) (10) ĦĤ˘Ï -(Shift_JIS) (5) abcde -(Shift_JIS) (14) abdeabcf -(Shift_JIS) (22) abc -(Shift_JIS) (31) abcd -(SJIS) (10) ĦĤ˘Ï -(SJIS) (5) abcde -(SJIS) (14) abdeabcf -(SJIS) (22) abc -(SJIS) (31) abcd -(SJIS) (5) ˘ÏĦĤ -(SJIS) (10) ĦĤ˘Ï -(SJIS) (5) abcde -(SJIS) (14) abdeabcf -(SJIS) (22) abc -(SJIS) (31) abcd -(UTF-8) (14) ĦĤ˘Ï -(UTF-8) (5) abcde -(UTF-8) (14) abdeabcf -(UTF-8) (22) abc -(UTF-8) (31) abcd -(UTF-8) (7) ˘ÏĦĤ -(UTF-8) (14) ĦĤ˘Ï -(UTF-8) (5) abcde -(UTF-8) (14) abdeabcf -(UTF-8) (22) abc -(UTF-8) (31) abcd diff --git a/ext/mbstring/tests/mb_http_input.phpt b/ext/mbstring/tests/mb_http_input.phpt deleted file mode 100644 index fd67a57689dad..0000000000000 --- a/ext/mbstring/tests/mb_http_input.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -mb_http_input() ---SKIPIF-- - ---POST-- -a=ĈüËܸì0123456789ĈüËܸìĞżĞʤҤé¤Ĵ¤Ê ---GET-- -b=ĈüËܸì0123456789ĈüËܸìĞżĞʤҤé¤Ĵ¤Ê ---FILE-- - - ---EXPECT-- -ĈüËܸì0123456789ĈüËܸìĞżĞʤҤé¤Ĵ¤Ê -ĈüËܸì0123456789ĈüËܸìĞżĞʤҤé¤Ĵ¤Ê -OK - diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt deleted file mode 100644 index 0a6839f7f13aa..0000000000000 --- a/ext/mbstring/tests/mb_http_output.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -mb_http_output() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -OK_ASCII_SET -ASCII -OK_SJIS_SET -SJIS -OK_JIS_SET -JIS -OK_UTF-8_SET -UTF-8 -OK_EUC-JP_SET -EUC-JP -== INVALID PARAMETER == -ERR: Warning -OK_BAD_SET -EUC-JP -ERR: Warning -OK_BAD_ARY_SET -EUC-JP -ERR: Warning -OK_BAD_OBJ_SET -EUC-JP - diff --git a/ext/mbstring/tests/mb_internal_encoding.phpt b/ext/mbstring/tests/mb_internal_encoding.phpt deleted file mode 100644 index 1d62962529aa9..0000000000000 --- a/ext/mbstring/tests/mb_internal_encoding.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -mb_internal_encoding() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -OK_EUC-JP_SET -EUC-JP -OK_UTF-8_SET -UTF-8 -OK_ASCII_SET -ASCII -== INVALID PARAMETER == -ERR: Warning -OK_BAD_SET -ASCII -ERR: Warning -OK_BAD_ARY_SET -ASCII -ERR: Warning -OK_BAD_OBJ_SET -ASCII - diff --git a/ext/mbstring/tests/mb_output_handler_euc_jp.phpt b/ext/mbstring/tests/mb_output_handler_euc_jp.phpt deleted file mode 100644 index dff5c97743776..0000000000000 --- a/ext/mbstring/tests/mb_output_handler_euc_jp.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -mb_output_handler() (EUC-JP) ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -string(73) "ĈıÈÍÑĈüËܸìʸğúÎóĦ£¤³¤Îâ¸ċĦĵë¤ÏPHP¤ËŜëÁ¤È´Ĝżô¤òÄóĥĦ¤·¤Ŝ¤ıĦ£" diff --git a/ext/mbstring/tests/mb_output_handler_shift_jis.phpt b/ext/mbstring/tests/mb_output_handler_shift_jis.phpt deleted file mode 100644 index d4612d9775182..0000000000000 --- a/ext/mbstring/tests/mb_output_handler_shift_jis.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -mb_output_handler() (Shift_JIS) ---SKIPIF-- - ---INI-- -output_handler=mb_output_handler -mbstring.internal_encoding=Shift_JIS -mbstring.http_output=EUC-JP ---FILE-- - - ---EXPECT-- -string(73) "ĈıÈÍÑĈüËܸìʸğúÎóĦ£¤³¤Îâ¸ċĦĵë¤ÏPHP¤ËŜëÁ¤È´Ĝżô¤òÄóĥĦ¤·¤Ŝ¤ıĦ£" diff --git a/ext/mbstring/tests/mb_parse_str.phpt b/ext/mbstring/tests/mb_parse_str.phpt deleted file mode 100644 index 8b320b0845252..0000000000000 --- a/ext/mbstring/tests/mb_parse_str.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -mb_parse_str() ---SKIPIF-- - ---INI-- -arg_separator.input=& -register_globals=0 ---FILE-- - ---EXPECT-- -array(2) { - ["foo"]=> - string(3) "abc" - ["bar"]=> - string(3) "def" -} -string(0) "" -string(0) "" -string(3) "abc" -string(3) "def" -array(2) { - ["+foo"]=> - string(3) "def" - ["-bar"]=> - string(3) "jkl" -} -string(0) "" -string(0) "" -string(0) "" -string(0) "" -array(2) { - ["foo"]=> - array(3) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" - } - ["bar"]=> - array(1) { - [0]=> - string(3) "jkl" - } -} -string(0) "" -string(0) "" -array(3) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" -} -array(1) { - [0]=> - string(3) "jkl" -} diff --git a/ext/mbstring/tests/mb_parse_str02.phpt b/ext/mbstring/tests/mb_parse_str02.phpt deleted file mode 100644 index 51cfb63cb9a69..0000000000000 --- a/ext/mbstring/tests/mb_parse_str02.phpt +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -mb_parse_str() test 2 ---SKIPIF-- - ---INI-- -arg_separator.input=&# -register_globals=0 ---FILE-- - ---EXPECT-- -array(3) { - ["foo"]=> - string(3) "abc" - ["bar"]=> - string(3) "def" - ["fubar"]=> - string(3) "ghi" -} -string(0) "" -string(0) "" -string(0) "" -string(3) "abc" -string(3) "def" -string(3) "ghi" -array(3) { - ["+foo"]=> - string(3) "def" - ["-bar"]=> - string(3) "jkl" - ["fubar"]=> - string(0) "" -} -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -array(3) { - ["foo"]=> - array(4) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" - [3]=> - string(0) "" - } - ["bar"]=> - array(1) { - [0]=> - string(0) "" - } - ["fubar"]=> - array(1) { - [0]=> - string(1) "=" - } -} -string(0) "" -string(0) "" -string(0) "" -array(4) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" - [3]=> - string(0) "" -} -array(1) { - [0]=> - string(0) "" -} -array(1) { - [0]=> - string(1) "=" -} diff --git a/ext/mbstring/tests/mb_preferred_mime_name.phpt b/ext/mbstring/tests/mb_preferred_mime_name.phpt deleted file mode 100644 index 82f88b15c3c54..0000000000000 --- a/ext/mbstring/tests/mb_preferred_mime_name.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -mb_preferred_mime_name() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -Shift_JIS -Shift_JIS -EUC-JP -UTF-8 -ISO-2022-JP -ISO-2022-JP -ISO-8859-1 -UCS-2 -UCS-4 -== INVALID PARAMETER == -ERR: Warning -OK_BAD_NAME - diff --git a/ext/mbstring/tests/mb_regex_set_options.phpt b/ext/mbstring/tests/mb_regex_set_options.phpt deleted file mode 100644 index 88ee9c9250064..0000000000000 --- a/ext/mbstring/tests/mb_regex_set_options.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -mb_regex_set_options() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -+ + + + +-++++ diff --git a/ext/mbstring/tests/mb_send_mail01.phpt b/ext/mbstring/tests/mb_send_mail01.phpt deleted file mode 100644 index bc481fbba0784..0000000000000 --- a/ext/mbstring/tests/mb_send_mail01.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -mb_send_mail() test 1 (lang=neutral) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: test neutral -Mime-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: BASE64 - -dGVzdA== diff --git a/ext/mbstring/tests/mb_send_mail02.phpt b/ext/mbstring/tests/mb_send_mail02.phpt deleted file mode 100644 index 34dee474bc682..0000000000000 --- a/ext/mbstring/tests/mb_send_mail02.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -mb_send_mail() test 2 (lang=Japanese) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: =?ISO-2022-JP?B?GyRCJUYlOSVIGyhCIEphcGFuZXNl?= -Mime-Version: 1.0 -Content-Type: text/plain; charset=ISO-2022-JP -Content-Transfer-Encoding: 7bit - -$B%F%9%H(B diff --git a/ext/mbstring/tests/mb_send_mail03.phpt b/ext/mbstring/tests/mb_send_mail03.phpt deleted file mode 100644 index 3113d8e2bac27..0000000000000 --- a/ext/mbstring/tests/mb_send_mail03.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -mb_send_mail() test 3 (lang=English) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: test English -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s-8859-1 -Content-Transfer-Encoding: 8bit - -test diff --git a/ext/mbstring/tests/mb_send_mail04.phpt b/ext/mbstring/tests/mb_send_mail04.phpt deleted file mode 100644 index 468a1e367bf30..0000000000000 --- a/ext/mbstring/tests/mb_send_mail04.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -mb_send_mail() test 4 (lang=German) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: =?ISO-8859-15?Q?Pr=FCfung=20German?= -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s-8859-15 -Content-Transfer-Encoding: 8bit - -Prüfung diff --git a/ext/mbstring/tests/mb_send_mail05.phpt b/ext/mbstring/tests/mb_send_mail05.phpt deleted file mode 100644 index 7033424b80e7b..0000000000000 --- a/ext/mbstring/tests/mb_send_mail05.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -mb_send_mail() test 5 (lang=Simplified Chinese) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: =?HZ-GB-2312?B?fnsyYlFpfn0gU2ltcGxpZmllZCBD?= - =?HZ-GB-2312?B?aGluZXNl?= -Mime-Version: 1.0 -Content-Type: text/plain; charset=HZ-GB-2312 -Content-Transfer-Encoding: 7bit - -~{2bQi~} diff --git a/ext/mbstring/tests/mb_send_mail06.phpt b/ext/mbstring/tests/mb_send_mail06.phpt deleted file mode 100644 index 2e8c151284840..0000000000000 --- a/ext/mbstring/tests/mb_send_mail06.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -mb_send_mail() test 6 (lang=Traditional Chinese) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: =?BIG5?B?tPrF5yBUcmFkaXRpb25hbCBDaGluZXNl?= -Mime-Version: 1.0 -Content-Type: text/plain; charset=BIG5 -Content-Transfer-Encoding: 8bit - -´úĊç diff --git a/ext/mbstring/tests/mb_send_mail07.phpt b/ext/mbstring/tests/mb_send_mail07.phpt deleted file mode 100644 index 21fdaa597c5af..0000000000000 --- a/ext/mbstring/tests/mb_send_mail07.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -mb_send_mail() test 7 (lang=Korean) ---SKIPIF-- - ---INI-- -sendmail_path=/bin/cat ---FILE-- - ---EXPECTF-- -To: example@example.com -Subject: %s -Mime-Version: 1.0 -Content-Type: text/plain; charset=%s -Content-Transfer-Encoding: %s - -%s -To: example@example.com -Subject: =?ISO-2022-KR?B?GyQpQw5FVz06Ri4PIEtvcmVhbg8=?= -Mime-Version: 1.0 -Content-Type: text/plain; charset=ISO-2022-KR -Content-Transfer-Encoding: 7bit - -$)CEW=:F. diff --git a/ext/mbstring/tests/mb_split-compat-01.phpt b/ext/mbstring/tests/mb_split-compat-01.phpt deleted file mode 100644 index 8dbc82c130d52..0000000000000 --- a/ext/mbstring/tests/mb_split-compat-01.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -mb_split() compat test 1 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -4 -this -is -a -test diff --git a/ext/mbstring/tests/mb_split.phpt b/ext/mbstring/tests/mb_split.phpt deleted file mode 100644 index abe12763eb106..0000000000000 --- a/ext/mbstring/tests/mb_split.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -mb_split() ---SKIPIF-- - ---INI-- -mbstring.func_overload=0 ---FILE-- - - ---EXPECT-- -bool(true) -ok -ok -ok -ok -ok -ok -2-2 -3-3 -4-4 diff --git a/ext/mbstring/tests/mb_strcut.phpt b/ext/mbstring/tests/mb_strcut.phpt deleted file mode 100644 index 8ea074a3cda30..0000000000000 --- a/ext/mbstring/tests/mb_strcut.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -mb_strcut() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -¤Îʸ -0123¤³¤ÎʸğúÎó¤ÏĈüËܸì¤Ç¤ıĦ£EUC-JP¤òğȤ¤Ĉ¤¤¤Ŝ¤ıĦ£ĈüËܸì¤ÏÌÌĊŬ½­¤¤Ħ£ -OK -OK: 0123¤³¤Îʸ - - diff --git a/ext/mbstring/tests/mb_strimwidth.phpt b/ext/mbstring/tests/mb_strimwidth.phpt deleted file mode 100644 index efa98856f1379..0000000000000 --- a/ext/mbstring/tests/mb_strimwidth.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -mb_strimwidth() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -1: 0123¤³¤Îʸğú... -2: 0123¤³¤ÎʸğúÎó¤ÏĈüËܸì¤Ç¤ıĦ£EUC-JP¤òğȤ¤Ĉ¤¤¤Ŝ¤ıĦ£ĈüËܸì¤ÏÌÌĊŬ½­¤¤Ħ£ -3: Ħ£EUC-JP¤òğȤ¤Ĉ¤¤¤Ŝ¤ıĦ£ĈüËܸì¤ÏÌÌĊŬ½­¤¤Ħ£ -ERR: Warning -4 OK -ERR: Warning -5 OK -ERR: Warning -6 OK - - diff --git a/ext/mbstring/tests/mb_strlen.phpt b/ext/mbstring/tests/mb_strlen.phpt deleted file mode 100644 index 6a71b41580114..0000000000000 --- a/ext/mbstring/tests/mb_strlen.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -mb_strlen() ---SKIPIF-- - ---INI-- -mbstring.func_overload=0 ---FILE-- - - ---EXPECT-- -== ASCII == -ERR: Warning - -40 -== EUC-JP == -ERR: Warning - -72 -== SJIS == -ERR: Warning - -72 -== JIS == -ERR: Warning - -121 -== UTF-8 == -ERR: Warning - -174 -== WRONG PARAMETERS == -ERR: Notice -5 -ERR: Notice -6 -ERR: Warning - - - diff --git a/ext/mbstring/tests/mb_strpos.phpt b/ext/mbstring/tests/mb_strpos.phpt deleted file mode 100644 index ca49599fa7027..0000000000000 --- a/ext/mbstring/tests/mb_strpos.phpt +++ /dev/null @@ -1,175 +0,0 @@ ---TEST-- -mb_strpos() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -== POSITIVE OFFSET == -10 -0 -3 -0 -34 -30 -33 -30 -== NEGATIVE OFFSET == -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -ERR: Warning -OK_NEGATIVE_OFFSET -== OUT OF RANGE == -OK_OUT_RANGE -OK_OUT_RANGE -OK_OUT_RANGE -OK_OUT_RANGE -== NON-EXISTENT == -OK_STR -OK_NEWLINE -== NO ENCODING PARAMETER == -10 -0 -3 -0 -OK_STR -OK_NEWLINE -== NO OFFSET AND ENCODING PARAMETER == -10 -0 -3 -0 -OK_STR -OK_NEWLINE -== INVALID PARAMETER TEST == -ERR: Warning -OK_NULL -ERR: Warning -OK_ARRAY -ERR: Warning -OK_OBJECT -ERR: Warning -OK_BAD_ENCODING - diff --git a/ext/mbstring/tests/mb_strwidth.phpt b/ext/mbstring/tests/mb_strwidth.phpt deleted file mode 100644 index 33ec851c3da9b..0000000000000 --- a/ext/mbstring/tests/mb_strwidth.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -mb_strwidth() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -1: 68 diff --git a/ext/mbstring/tests/mb_substitute_character.phpt b/ext/mbstring/tests/mb_substitute_character.phpt deleted file mode 100644 index 9f2131080ede3..0000000000000 --- a/ext/mbstring/tests/mb_substitute_character.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -mb_substitute_character() ---SKIPIF-- - ---FILE-- - - ---EXPECT-- -OK_UTF -12307 -OK_LONG -long -OK_NONE -none -== INVALID PARAMETER == -ERR: Warning -OK_BAD_NAME - diff --git a/ext/mbstring/tests/mb_substr.phpt b/ext/mbstring/tests/mb_substr.phpt deleted file mode 100644 index 893cb64819035..0000000000000 --- a/ext/mbstring/tests/mb_substr.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -mb_substr() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - - ---EXPECT-- -1: ĈüËܸì¤Ç¤ıĦ£EUC- -2: 0123¤³¤ÎʸğúÎó¤ÏĈüËܸì¤Ç¤ıĦ£EUC-JP¤òğȤ¤Ĉ¤¤¤Ŝ¤ıĦ£ĈüËܸì¤ÏÌÌĊŬ½­¤¤Ħ£ -3 OK -4 OK: 0123¤³¤ÎʸğúÎó¤Ï - - diff --git a/ext/mbstring/tests/mb_substr_count.phpt b/ext/mbstring/tests/mb_substr_count.phpt deleted file mode 100644 index 5be5109375262..0000000000000 --- a/ext/mbstring/tests/mb_substr_count.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -mb_substr_count() ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(100) -int(100) -int(100) -int(100) -int(200) diff --git a/ext/mbstring/tests/overload01.phpt b/ext/mbstring/tests/overload01.phpt deleted file mode 100644 index b0990e8161a83..0000000000000 --- a/ext/mbstring/tests/overload01.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Function overloading test 1 ---SKIPIF-- - ---INI-- -output_handler= -mbstring.func_overload=7 -mbstring.internal_encoding=EUC-JP ---FILE-- - ---INI-- -output_handler= -mbstring.func_overload=7 -mbstring.internal_encoding=EUC-JP ---FILE-- - ---EXPECT-- -EUC-JP -int(10) -int(8) -int(3) -int(29) diff --git a/ext/mbstring/tests/php_gr_jp_10830.phpt b/ext/mbstring/tests/php_gr_jp_10830.phpt deleted file mode 100644 index 85eefd756c29e..0000000000000 --- a/ext/mbstring/tests/php_gr_jp_10830.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -php-users@php.gr.jp #10830 ---SKIPIF-- - ---FILE-- -"; - -var_dump( mb_ereg("^[^><]+$",$a) ); -var_dump( ereg("^[^><]+$",$a) ); -?> - ---EXPECT-- -bool(false) -bool(false) diff --git a/ext/mbstring/tests/php_gr_jp_16242.phpt b/ext/mbstring/tests/php_gr_jp_16242.phpt deleted file mode 100644 index f693cf8dd1a4c..0000000000000 --- a/ext/mbstring/tests/php_gr_jp_16242.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -php-users@php.gr.jp #16242 ---SKIPIF-- - ---INI-- -mbstring.language=Japanese -mbstring.internal_encoding=UTF-8 ---FILE-- - ---EXPECT-- -string(8) "Japanese" -string(5) "UTF-8" -string(5) "UTF-8" diff --git a/ext/mbstring/tests/php_gr_jp_dev_884-1.phpt b/ext/mbstring/tests/php_gr_jp_dev_884-1.phpt deleted file mode 100644 index a0ab0c847daf5..0000000000000 --- a/ext/mbstring/tests/php_gr_jp_dev_884-1.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -php-dev@php.gr.jp #884 (1) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(2) "bb" -string(2) "bb" -string(2) "bb" diff --git a/ext/mbstring/tests/php_gr_jp_dev_884-2.phpt b/ext/mbstring/tests/php_gr_jp_dev_884-2.phpt deleted file mode 100644 index d81f92f416de7..0000000000000 --- a/ext/mbstring/tests/php_gr_jp_dev_884-2.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -php-dev@php.gr.jp #884 (2) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(4) "ABZZ" -string(4) "ABZZ" -string(4) "ABZZ" -string(4) "ABZZ" diff --git a/ext/mbstring/tests/simpletest.phpt b/ext/mbstring/tests/simpletest.phpt deleted file mode 100644 index 80b2f725961ca..0000000000000 --- a/ext/mbstring/tests/simpletest.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Simple multi-byte print test (EUC-JP) ---SKIPIF-- - ---INI-- -output_handler= ---FILE-- - ---EXPECT-- -echo: ŜëÁ¤È´Ĝżô¤ĴğȤ¨¤Ŝ¤ıĦ£¤³¤Îʸğú¤ĴÏ˘·ë¤µ¤ì¤Ĉ¤¤¤ë¤Ï¤şĦ£ -print: ŜëÁ¤È´Ĝżô¤ĴğȤ¨¤Ŝ¤ıĦ£¤³¤Îʸğú¤ĴÏ˘·ë¤µ¤ì¤Ĉ¤¤¤ë¤Ï¤şĦ£ -printf: ŜëÁ¤È´Ĝżô¤ĴğȤ¨¤Ŝ¤ıĦ£¤³¤Îʸğú¤ĴÏ˘·ë¤µ¤ì¤Ĉ¤¤¤ë¤Ï¤şĦ£ -sprintf: ŜëÁ¤È´Ĝżô¤ĴğȤ¨¤Ŝ¤ıĦ£¤³¤Îʸğú¤ĴÏ˘·ë¤µ¤ì¤Ĉ¤¤¤ë¤Ï¤şĦ£ -echo: ŜëÁ¤È´Ĝżô¤ĴğȤ¨¤Ŝ¤ıĦ£¤³¤Îʸğú¤ĴÏ˘·ë¤µ¤ì¤Ĉ¤¤¤ë¤Ï¤şĦ£ - diff --git a/ext/mbstring/tests/skipif.inc b/ext/mbstring/tests/skipif.inc deleted file mode 100644 index 7eec8aab5a878..0000000000000 --- a/ext/mbstring/tests/skipif.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/ext/mbstring/tests/zend-multibyte.phpt b/ext/mbstring/tests/zend-multibyte.phpt deleted file mode 100644 index 9268fdd2f61c1..0000000000000 --- a/ext/mbstring/tests/zend-multibyte.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zend multibyte ---SKIPIF-- - ---INI-- -mbstring.script_encoding=Shift_JIS -mbstring.internal_encoding=Shift_JIS ---FILE-- - ---EXPECT-- -ƒhƒŒƒ~ƒtƒ@ƒ\ diff --git a/ext/mbstring/unicode_data.h b/ext/mbstring/unicode_data.h deleted file mode 100644 index 3cdd0735a89ed..0000000000000 --- a/ext/mbstring/unicode_data.h +++ /dev/null @@ -1,2738 +0,0 @@ -/* This file holds unicode properties and case folding information. - * It was generated by a modified version of ucgendat, part of the ucdata-2.5 package */ - -/* {{{ ctype data */ -static unsigned short _ucprop_size = 0x0032; -static unsigned short _ucprop_offsets[] = { -0x0000, 0x00d0, 0x0138, 0x0140, 0x016a, 0x0176, 0x019e, -0x01ac, 0x01ae, 0x01b0, 0x01b4, 0x01cc, 0x01ce, 0xffff, 0x01d8, -0x051e, 0x0866, 0x087a, 0x08a2, 0x0a3a, 0x0a48, 0x0a60, 0x0ae0, -0x0b5c, 0x0be8, 0x0c5c, 0x0c72, 0x0c9e, 0x0d6e, 0x0ff2, 0x100e, -0x1024, 0x1028, 0x1058, 0x105c, 0x1072, 0x107c, 0x1082, 0x1092, -0x1244, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x13ec, -0x16f4, 0x16fe, 0x1706, 0x1730, 0x0000, }; -static unsigned long _ucprop_ranges[] = { -0x00000300, 0x0000034f, 0x00000360, 0x0000036f, -0x00000483, 0x00000486, 0x00000591, 0x000005a1, 0x000005a3, -0x000005b9, 0x000005bb, 0x000005bd, 0x000005bf, 0x000005bf, -0x000005c1, 0x000005c2, 0x000005c4, 0x000005c4, 0x0000064b, -0x00000655, 0x00000670, 0x00000670, 0x000006d6, 0x000006dc, -0x000006df, 0x000006e4, 0x000006e7, 0x000006e8, 0x000006ea, -0x000006ed, 0x00000711, 0x00000711, 0x00000730, 0x0000074a, -0x000007a6, 0x000007b0, 0x00000901, 0x00000902, 0x0000093c, -0x0000093c, 0x00000941, 0x00000948, 0x0000094d, 0x0000094d, -0x00000951, 0x00000954, 0x00000962, 0x00000963, 0x00000981, -0x00000981, 0x000009bc, 0x000009bc, 0x000009c1, 0x000009c4, -0x000009cd, 0x000009cd, 0x000009e2, 0x000009e3, 0x00000a02, -0x00000a02, 0x00000a3c, 0x00000a3c, 0x00000a41, 0x00000a42, -0x00000a47, 0x00000a48, 0x00000a4b, 0x00000a4d, 0x00000a70, -0x00000a71, 0x00000a81, 0x00000a82, 0x00000abc, 0x00000abc, -0x00000ac1, 0x00000ac5, 0x00000ac7, 0x00000ac8, 0x00000acd, -0x00000acd, 0x00000b01, 0x00000b01, 0x00000b3c, 0x00000b3c, -0x00000b3f, 0x00000b3f, 0x00000b41, 0x00000b43, 0x00000b4d, -0x00000b4d, 0x00000b56, 0x00000b56, 0x00000b82, 0x00000b82, -0x00000bc0, 0x00000bc0, 0x00000bcd, 0x00000bcd, 0x00000c3e, -0x00000c40, 0x00000c46, 0x00000c48, 0x00000c4a, 0x00000c4d, -0x00000c55, 0x00000c56, 0x00000cbf, 0x00000cbf, 0x00000cc6, -0x00000cc6, 0x00000ccc, 0x00000ccd, 0x00000d41, 0x00000d43, -0x00000d4d, 0x00000d4d, 0x00000dca, 0x00000dca, 0x00000dd2, -0x00000dd4, 0x00000dd6, 0x00000dd6, 0x00000e31, 0x00000e31, -0x00000e34, 0x00000e3a, 0x00000e47, 0x00000e4e, 0x00000eb1, -0x00000eb1, 0x00000eb4, 0x00000eb9, 0x00000ebb, 0x00000ebc, -0x00000ec8, 0x00000ecd, 0x00000f18, 0x00000f19, 0x00000f35, -0x00000f35, 0x00000f37, 0x00000f37, 0x00000f39, 0x00000f39, -0x00000f71, 0x00000f7e, 0x00000f80, 0x00000f84, 0x00000f86, -0x00000f87, 0x00000f90, 0x00000f97, 0x00000f99, 0x00000fbc, -0x00000fc6, 0x00000fc6, 0x0000102d, 0x00001030, 0x00001032, -0x00001032, 0x00001036, 0x00001037, 0x00001039, 0x00001039, -0x00001058, 0x00001059, 0x00001712, 0x00001714, 0x00001732, -0x00001734, 0x00001752, 0x00001753, 0x00001772, 0x00001773, -0x000017b7, 0x000017bd, 0x000017c6, 0x000017c6, 0x000017c9, -0x000017d3, 0x0000180b, 0x0000180d, 0x000018a9, 0x000018a9, -0x000020d0, 0x000020dc, 0x000020e1, 0x000020e1, 0x000020e5, -0x000020ea, 0x0000302a, 0x0000302f, 0x00003099, 0x0000309a, -0x0000fb1e, 0x0000fb1e, 0x0000fe00, 0x0000fe0f, 0x0000fe20, -0x0000fe23, 0x0001d167, 0x0001d169, 0x0001d17b, 0x0001d182, -0x0001d185, 0x0001d18b, 0x0001d1aa, 0x0001d1ad, -0x00000903, 0x00000903, 0x0000093e, 0x00000940, -0x00000949, 0x0000094c, 0x00000982, 0x00000983, 0x000009be, -0x000009c0, 0x000009c7, 0x000009c8, 0x000009cb, 0x000009cc, -0x000009d7, 0x000009d7, 0x00000a3e, 0x00000a40, 0x00000a83, -0x00000a83, 0x00000abe, 0x00000ac0, 0x00000ac9, 0x00000ac9, -0x00000acb, 0x00000acc, 0x00000b02, 0x00000b03, 0x00000b3e, -0x00000b3e, 0x00000b40, 0x00000b40, 0x00000b47, 0x00000b48, -0x00000b4b, 0x00000b4c, 0x00000b57, 0x00000b57, 0x00000bbe, -0x00000bbf, 0x00000bc1, 0x00000bc2, 0x00000bc6, 0x00000bc8, -0x00000bca, 0x00000bcc, 0x00000bd7, 0x00000bd7, 0x00000c01, -0x00000c03, 0x00000c41, 0x00000c44, 0x00000c82, 0x00000c83, -0x00000cbe, 0x00000cbe, 0x00000cc0, 0x00000cc4, 0x00000cc7, -0x00000cc8, 0x00000cca, 0x00000ccb, 0x00000cd5, 0x00000cd6, -0x00000d02, 0x00000d03, 0x00000d3e, 0x00000d40, 0x00000d46, -0x00000d48, 0x00000d4a, 0x00000d4c, 0x00000d57, 0x00000d57, -0x00000d82, 0x00000d83, 0x00000dcf, 0x00000dd1, 0x00000dd8, -0x00000ddf, 0x00000df2, 0x00000df3, 0x00000f3e, 0x00000f3f, -0x00000f7f, 0x00000f7f, 0x0000102c, 0x0000102c, 0x00001031, -0x00001031, 0x00001038, 0x00001038, 0x00001056, 0x00001057, -0x000017b4, 0x000017b6, 0x000017be, 0x000017c5, 0x000017c7, -0x000017c8, 0x0001d165, 0x0001d166, 0x0001d16d, 0x0001d172, -0x00000488, 0x00000489, 0x000006de, 0x000006de, -0x000020dd, 0x000020e0, 0x000020e2, 0x000020e4, -0x00000030, 0x00000039, 0x00000660, 0x00000669, -0x000006f0, 0x000006f9, 0x00000966, 0x0000096f, 0x000009e6, -0x000009ef, 0x00000a66, 0x00000a6f, 0x00000ae6, 0x00000aef, -0x00000b66, 0x00000b6f, 0x00000be7, 0x00000bef, 0x00000c66, -0x00000c6f, 0x00000ce6, 0x00000cef, 0x00000d66, 0x00000d6f, -0x00000e50, 0x00000e59, 0x00000ed0, 0x00000ed9, 0x00000f20, -0x00000f29, 0x00001040, 0x00001049, 0x00001369, 0x00001371, -0x000017e0, 0x000017e9, 0x00001810, 0x00001819, 0x0000ff10, -0x0000ff19, 0x0001d7ce, 0x0001d7ff, -0x000016ee, 0x000016f0, 0x00002160, 0x00002183, -0x00003007, 0x00003007, 0x00003021, 0x00003029, 0x00003038, -0x0000303a, 0x0001034a, 0x0001034a, -0x000000b2, 0x000000b3, 0x000000b9, 0x000000b9, -0x000000bc, 0x000000be, 0x000009f4, 0x000009f9, 0x00000bf0, -0x00000bf2, 0x00000f2a, 0x00000f33, 0x00001372, 0x0000137c, -0x00002070, 0x00002070, 0x00002074, 0x00002079, 0x00002080, -0x00002089, 0x00002153, 0x0000215f, 0x00002460, 0x0000249b, -0x000024ea, 0x000024fe, 0x00002776, 0x00002793, 0x00003192, -0x00003195, 0x00003220, 0x00003229, 0x00003251, 0x0000325f, -0x00003280, 0x00003289, 0x000032b1, 0x000032bf, 0x00010320, -0x00010323, -0x00000020, 0x00000020, 0x000000a0, 0x000000a0, -0x00001680, 0x00001680, 0x00002000, 0x0000200b, 0x0000202f, -0x0000202f, 0x0000205f, 0x0000205f, 0x00003000, 0x00003000, -0x00002028, 0x00002028, -0x00002029, 0x00002029, -0x00000000, 0x0000001f, 0x0000007f, 0x0000009f, -0x000006dd, 0x000006dd, 0x0000070f, 0x0000070f, -0x0000180e, 0x0000180e, 0x0000200c, 0x0000200f, 0x0000202a, -0x0000202e, 0x00002060, 0x00002063, 0x0000206a, 0x0000206f, -0x0000feff, 0x0000feff, 0x0000fff9, 0x0000fffb, 0x0001d173, -0x0001d17a, 0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f, -0x00010000, 0x0010ffff, -0x0000e000, 0x0000f8ff, 0x000f0000, 0x000f0000, -0x000ffffd, 0x000ffffd, 0x00100000, 0x00100000, 0x0010fffd, -0x0010fffd, -0x00000041, 0x0000005a, 0x000000c0, 0x000000d6, -0x000000d8, 0x000000de, 0x00000100, 0x00000100, 0x00000102, -0x00000102, 0x00000104, 0x00000104, 0x00000106, 0x00000106, -0x00000108, 0x00000108, 0x0000010a, 0x0000010a, 0x0000010c, -0x0000010c, 0x0000010e, 0x0000010e, 0x00000110, 0x00000110, -0x00000112, 0x00000112, 0x00000114, 0x00000114, 0x00000116, -0x00000116, 0x00000118, 0x00000118, 0x0000011a, 0x0000011a, -0x0000011c, 0x0000011c, 0x0000011e, 0x0000011e, 0x00000120, -0x00000120, 0x00000122, 0x00000122, 0x00000124, 0x00000124, -0x00000126, 0x00000126, 0x00000128, 0x00000128, 0x0000012a, -0x0000012a, 0x0000012c, 0x0000012c, 0x0000012e, 0x0000012e, -0x00000130, 0x00000130, 0x00000132, 0x00000132, 0x00000134, -0x00000134, 0x00000136, 0x00000136, 0x00000139, 0x00000139, -0x0000013b, 0x0000013b, 0x0000013d, 0x0000013d, 0x0000013f, -0x0000013f, 0x00000141, 0x00000141, 0x00000143, 0x00000143, -0x00000145, 0x00000145, 0x00000147, 0x00000147, 0x0000014a, -0x0000014a, 0x0000014c, 0x0000014c, 0x0000014e, 0x0000014e, -0x00000150, 0x00000150, 0x00000152, 0x00000152, 0x00000154, -0x00000154, 0x00000156, 0x00000156, 0x00000158, 0x00000158, -0x0000015a, 0x0000015a, 0x0000015c, 0x0000015c, 0x0000015e, -0x0000015e, 0x00000160, 0x00000160, 0x00000162, 0x00000162, -0x00000164, 0x00000164, 0x00000166, 0x00000166, 0x00000168, -0x00000168, 0x0000016a, 0x0000016a, 0x0000016c, 0x0000016c, -0x0000016e, 0x0000016e, 0x00000170, 0x00000170, 0x00000172, -0x00000172, 0x00000174, 0x00000174, 0x00000176, 0x00000176, -0x00000178, 0x00000179, 0x0000017b, 0x0000017b, 0x0000017d, -0x0000017d, 0x00000181, 0x00000182, 0x00000184, 0x00000184, -0x00000186, 0x00000187, 0x00000189, 0x0000018b, 0x0000018e, -0x00000191, 0x00000193, 0x00000194, 0x00000196, 0x00000198, -0x0000019c, 0x0000019d, 0x0000019f, 0x000001a0, 0x000001a2, -0x000001a2, 0x000001a4, 0x000001a4, 0x000001a6, 0x000001a7, -0x000001a9, 0x000001a9, 0x000001ac, 0x000001ac, 0x000001ae, -0x000001af, 0x000001b1, 0x000001b3, 0x000001b5, 0x000001b5, -0x000001b7, 0x000001b8, 0x000001bc, 0x000001bc, 0x000001c4, -0x000001c4, 0x000001c7, 0x000001c7, 0x000001ca, 0x000001ca, -0x000001cd, 0x000001cd, 0x000001cf, 0x000001cf, 0x000001d1, -0x000001d1, 0x000001d3, 0x000001d3, 0x000001d5, 0x000001d5, -0x000001d7, 0x000001d7, 0x000001d9, 0x000001d9, 0x000001db, -0x000001db, 0x000001de, 0x000001de, 0x000001e0, 0x000001e0, -0x000001e2, 0x000001e2, 0x000001e4, 0x000001e4, 0x000001e6, -0x000001e6, 0x000001e8, 0x000001e8, 0x000001ea, 0x000001ea, -0x000001ec, 0x000001ec, 0x000001ee, 0x000001ee, 0x000001f1, -0x000001f1, 0x000001f4, 0x000001f4, 0x000001f6, 0x000001f8, -0x000001fa, 0x000001fa, 0x000001fc, 0x000001fc, 0x000001fe, -0x000001fe, 0x00000200, 0x00000200, 0x00000202, 0x00000202, -0x00000204, 0x00000204, 0x00000206, 0x00000206, 0x00000208, -0x00000208, 0x0000020a, 0x0000020a, 0x0000020c, 0x0000020c, -0x0000020e, 0x0000020e, 0x00000210, 0x00000210, 0x00000212, -0x00000212, 0x00000214, 0x00000214, 0x00000216, 0x00000216, -0x00000218, 0x00000218, 0x0000021a, 0x0000021a, 0x0000021c, -0x0000021c, 0x0000021e, 0x0000021e, 0x00000220, 0x00000220, -0x00000222, 0x00000222, 0x00000224, 0x00000224, 0x00000226, -0x00000226, 0x00000228, 0x00000228, 0x0000022a, 0x0000022a, -0x0000022c, 0x0000022c, 0x0000022e, 0x0000022e, 0x00000230, -0x00000230, 0x00000232, 0x00000232, 0x00000386, 0x00000386, -0x00000388, 0x0000038a, 0x0000038c, 0x0000038c, 0x0000038e, -0x0000038f, 0x00000391, 0x000003a1, 0x000003a3, 0x000003ab, -0x000003d2, 0x000003d4, 0x000003d8, 0x000003d8, 0x000003da, -0x000003da, 0x000003dc, 0x000003dc, 0x000003de, 0x000003de, -0x000003e0, 0x000003e0, 0x000003e2, 0x000003e2, 0x000003e4, -0x000003e4, 0x000003e6, 0x000003e6, 0x000003e8, 0x000003e8, -0x000003ea, 0x000003ea, 0x000003ec, 0x000003ec, 0x000003ee, -0x000003ee, 0x000003f4, 0x000003f4, 0x00000400, 0x0000042f, -0x00000460, 0x00000460, 0x00000462, 0x00000462, 0x00000464, -0x00000464, 0x00000466, 0x00000466, 0x00000468, 0x00000468, -0x0000046a, 0x0000046a, 0x0000046c, 0x0000046c, 0x0000046e, -0x0000046e, 0x00000470, 0x00000470, 0x00000472, 0x00000472, -0x00000474, 0x00000474, 0x00000476, 0x00000476, 0x00000478, -0x00000478, 0x0000047a, 0x0000047a, 0x0000047c, 0x0000047c, -0x0000047e, 0x0000047e, 0x00000480, 0x00000480, 0x0000048a, -0x0000048a, 0x0000048c, 0x0000048c, 0x0000048e, 0x0000048e, -0x00000490, 0x00000490, 0x00000492, 0x00000492, 0x00000494, -0x00000494, 0x00000496, 0x00000496, 0x00000498, 0x00000498, -0x0000049a, 0x0000049a, 0x0000049c, 0x0000049c, 0x0000049e, -0x0000049e, 0x000004a0, 0x000004a0, 0x000004a2, 0x000004a2, -0x000004a4, 0x000004a4, 0x000004a6, 0x000004a6, 0x000004a8, -0x000004a8, 0x000004aa, 0x000004aa, 0x000004ac, 0x000004ac, -0x000004ae, 0x000004ae, 0x000004b0, 0x000004b0, 0x000004b2, -0x000004b2, 0x000004b4, 0x000004b4, 0x000004b6, 0x000004b6, -0x000004b8, 0x000004b8, 0x000004ba, 0x000004ba, 0x000004bc, -0x000004bc, 0x000004be, 0x000004be, 0x000004c0, 0x000004c1, -0x000004c3, 0x000004c3, 0x000004c5, 0x000004c5, 0x000004c7, -0x000004c7, 0x000004c9, 0x000004c9, 0x000004cb, 0x000004cb, -0x000004cd, 0x000004cd, 0x000004d0, 0x000004d0, 0x000004d2, -0x000004d2, 0x000004d4, 0x000004d4, 0x000004d6, 0x000004d6, -0x000004d8, 0x000004d8, 0x000004da, 0x000004da, 0x000004dc, -0x000004dc, 0x000004de, 0x000004de, 0x000004e0, 0x000004e0, -0x000004e2, 0x000004e2, 0x000004e4, 0x000004e4, 0x000004e6, -0x000004e6, 0x000004e8, 0x000004e8, 0x000004ea, 0x000004ea, -0x000004ec, 0x000004ec, 0x000004ee, 0x000004ee, 0x000004f0, -0x000004f0, 0x000004f2, 0x000004f2, 0x000004f4, 0x000004f4, -0x000004f8, 0x000004f8, 0x00000500, 0x00000500, 0x00000502, -0x00000502, 0x00000504, 0x00000504, 0x00000506, 0x00000506, -0x00000508, 0x00000508, 0x0000050a, 0x0000050a, 0x0000050c, -0x0000050c, 0x0000050e, 0x0000050e, 0x00000531, 0x00000556, -0x000010a0, 0x000010c5, 0x00001e00, 0x00001e00, 0x00001e02, -0x00001e02, 0x00001e04, 0x00001e04, 0x00001e06, 0x00001e06, -0x00001e08, 0x00001e08, 0x00001e0a, 0x00001e0a, 0x00001e0c, -0x00001e0c, 0x00001e0e, 0x00001e0e, 0x00001e10, 0x00001e10, -0x00001e12, 0x00001e12, 0x00001e14, 0x00001e14, 0x00001e16, -0x00001e16, 0x00001e18, 0x00001e18, 0x00001e1a, 0x00001e1a, -0x00001e1c, 0x00001e1c, 0x00001e1e, 0x00001e1e, 0x00001e20, -0x00001e20, 0x00001e22, 0x00001e22, 0x00001e24, 0x00001e24, -0x00001e26, 0x00001e26, 0x00001e28, 0x00001e28, 0x00001e2a, -0x00001e2a, 0x00001e2c, 0x00001e2c, 0x00001e2e, 0x00001e2e, -0x00001e30, 0x00001e30, 0x00001e32, 0x00001e32, 0x00001e34, -0x00001e34, 0x00001e36, 0x00001e36, 0x00001e38, 0x00001e38, -0x00001e3a, 0x00001e3a, 0x00001e3c, 0x00001e3c, 0x00001e3e, -0x00001e3e, 0x00001e40, 0x00001e40, 0x00001e42, 0x00001e42, -0x00001e44, 0x00001e44, 0x00001e46, 0x00001e46, 0x00001e48, -0x00001e48, 0x00001e4a, 0x00001e4a, 0x00001e4c, 0x00001e4c, -0x00001e4e, 0x00001e4e, 0x00001e50, 0x00001e50, 0x00001e52, -0x00001e52, 0x00001e54, 0x00001e54, 0x00001e56, 0x00001e56, -0x00001e58, 0x00001e58, 0x00001e5a, 0x00001e5a, 0x00001e5c, -0x00001e5c, 0x00001e5e, 0x00001e5e, 0x00001e60, 0x00001e60, -0x00001e62, 0x00001e62, 0x00001e64, 0x00001e64, 0x00001e66, -0x00001e66, 0x00001e68, 0x00001e68, 0x00001e6a, 0x00001e6a, -0x00001e6c, 0x00001e6c, 0x00001e6e, 0x00001e6e, 0x00001e70, -0x00001e70, 0x00001e72, 0x00001e72, 0x00001e74, 0x00001e74, -0x00001e76, 0x00001e76, 0x00001e78, 0x00001e78, 0x00001e7a, -0x00001e7a, 0x00001e7c, 0x00001e7c, 0x00001e7e, 0x00001e7e, -0x00001e80, 0x00001e80, 0x00001e82, 0x00001e82, 0x00001e84, -0x00001e84, 0x00001e86, 0x00001e86, 0x00001e88, 0x00001e88, -0x00001e8a, 0x00001e8a, 0x00001e8c, 0x00001e8c, 0x00001e8e, -0x00001e8e, 0x00001e90, 0x00001e90, 0x00001e92, 0x00001e92, -0x00001e94, 0x00001e94, 0x00001ea0, 0x00001ea0, 0x00001ea2, -0x00001ea2, 0x00001ea4, 0x00001ea4, 0x00001ea6, 0x00001ea6, -0x00001ea8, 0x00001ea8, 0x00001eaa, 0x00001eaa, 0x00001eac, -0x00001eac, 0x00001eae, 0x00001eae, 0x00001eb0, 0x00001eb0, -0x00001eb2, 0x00001eb2, 0x00001eb4, 0x00001eb4, 0x00001eb6, -0x00001eb6, 0x00001eb8, 0x00001eb8, 0x00001eba, 0x00001eba, -0x00001ebc, 0x00001ebc, 0x00001ebe, 0x00001ebe, 0x00001ec0, -0x00001ec0, 0x00001ec2, 0x00001ec2, 0x00001ec4, 0x00001ec4, -0x00001ec6, 0x00001ec6, 0x00001ec8, 0x00001ec8, 0x00001eca, -0x00001eca, 0x00001ecc, 0x00001ecc, 0x00001ece, 0x00001ece, -0x00001ed0, 0x00001ed0, 0x00001ed2, 0x00001ed2, 0x00001ed4, -0x00001ed4, 0x00001ed6, 0x00001ed6, 0x00001ed8, 0x00001ed8, -0x00001eda, 0x00001eda, 0x00001edc, 0x00001edc, 0x00001ede, -0x00001ede, 0x00001ee0, 0x00001ee0, 0x00001ee2, 0x00001ee2, -0x00001ee4, 0x00001ee4, 0x00001ee6, 0x00001ee6, 0x00001ee8, -0x00001ee8, 0x00001eea, 0x00001eea, 0x00001eec, 0x00001eec, -0x00001eee, 0x00001eee, 0x00001ef0, 0x00001ef0, 0x00001ef2, -0x00001ef2, 0x00001ef4, 0x00001ef4, 0x00001ef6, 0x00001ef6, -0x00001ef8, 0x00001ef8, 0x00001f08, 0x00001f0f, 0x00001f18, -0x00001f1d, 0x00001f28, 0x00001f2f, 0x00001f38, 0x00001f3f, -0x00001f48, 0x00001f4d, 0x00001f59, 0x00001f59, 0x00001f5b, -0x00001f5b, 0x00001f5d, 0x00001f5d, 0x00001f5f, 0x00001f5f, -0x00001f68, 0x00001f6f, 0x00001fb8, 0x00001fbb, 0x00001fc8, -0x00001fcb, 0x00001fd8, 0x00001fdb, 0x00001fe8, 0x00001fec, -0x00001ff8, 0x00001ffb, 0x00002102, 0x00002102, 0x00002107, -0x00002107, 0x0000210b, 0x0000210d, 0x00002110, 0x00002112, -0x00002115, 0x00002115, 0x00002119, 0x0000211d, 0x00002124, -0x00002124, 0x00002126, 0x00002126, 0x00002128, 0x00002128, -0x0000212a, 0x0000212d, 0x00002130, 0x00002131, 0x00002133, -0x00002133, 0x0000213e, 0x0000213f, 0x00002145, 0x00002145, -0x0000ff21, 0x0000ff3a, 0x00010400, 0x00010425, 0x0001d400, -0x0001d419, 0x0001d434, 0x0001d44d, 0x0001d468, 0x0001d481, -0x0001d49c, 0x0001d49c, 0x0001d49e, 0x0001d49f, 0x0001d4a2, -0x0001d4a2, 0x0001d4a5, 0x0001d4a6, 0x0001d4a9, 0x0001d4ac, -0x0001d4ae, 0x0001d4b5, 0x0001d4d0, 0x0001d4e9, 0x0001d504, -0x0001d505, 0x0001d507, 0x0001d50a, 0x0001d50d, 0x0001d514, -0x0001d516, 0x0001d51c, 0x0001d538, 0x0001d539, 0x0001d53b, -0x0001d53e, 0x0001d540, 0x0001d544, 0x0001d546, 0x0001d546, -0x0001d54a, 0x0001d550, 0x0001d56c, 0x0001d585, 0x0001d5a0, -0x0001d5b9, 0x0001d5d4, 0x0001d5ed, 0x0001d608, 0x0001d621, -0x0001d63c, 0x0001d655, 0x0001d670, 0x0001d689, 0x0001d6a8, -0x0001d6c0, 0x0001d6e2, 0x0001d6fa, 0x0001d71c, 0x0001d734, -0x0001d756, 0x0001d76e, 0x0001d790, 0x0001d7a8, -0x00000061, 0x0000007a, 0x000000aa, 0x000000aa, -0x000000b5, 0x000000b5, 0x000000ba, 0x000000ba, 0x000000df, -0x000000f6, 0x000000f8, 0x000000ff, 0x00000101, 0x00000101, -0x00000103, 0x00000103, 0x00000105, 0x00000105, 0x00000107, -0x00000107, 0x00000109, 0x00000109, 0x0000010b, 0x0000010b, -0x0000010d, 0x0000010d, 0x0000010f, 0x0000010f, 0x00000111, -0x00000111, 0x00000113, 0x00000113, 0x00000115, 0x00000115, -0x00000117, 0x00000117, 0x00000119, 0x00000119, 0x0000011b, -0x0000011b, 0x0000011d, 0x0000011d, 0x0000011f, 0x0000011f, -0x00000121, 0x00000121, 0x00000123, 0x00000123, 0x00000125, -0x00000125, 0x00000127, 0x00000127, 0x00000129, 0x00000129, -0x0000012b, 0x0000012b, 0x0000012d, 0x0000012d, 0x0000012f, -0x0000012f, 0x00000131, 0x00000131, 0x00000133, 0x00000133, -0x00000135, 0x00000135, 0x00000137, 0x00000138, 0x0000013a, -0x0000013a, 0x0000013c, 0x0000013c, 0x0000013e, 0x0000013e, -0x00000140, 0x00000140, 0x00000142, 0x00000142, 0x00000144, -0x00000144, 0x00000146, 0x00000146, 0x00000148, 0x00000149, -0x0000014b, 0x0000014b, 0x0000014d, 0x0000014d, 0x0000014f, -0x0000014f, 0x00000151, 0x00000151, 0x00000153, 0x00000153, -0x00000155, 0x00000155, 0x00000157, 0x00000157, 0x00000159, -0x00000159, 0x0000015b, 0x0000015b, 0x0000015d, 0x0000015d, -0x0000015f, 0x0000015f, 0x00000161, 0x00000161, 0x00000163, -0x00000163, 0x00000165, 0x00000165, 0x00000167, 0x00000167, -0x00000169, 0x00000169, 0x0000016b, 0x0000016b, 0x0000016d, -0x0000016d, 0x0000016f, 0x0000016f, 0x00000171, 0x00000171, -0x00000173, 0x00000173, 0x00000175, 0x00000175, 0x00000177, -0x00000177, 0x0000017a, 0x0000017a, 0x0000017c, 0x0000017c, -0x0000017e, 0x00000180, 0x00000183, 0x00000183, 0x00000185, -0x00000185, 0x00000188, 0x00000188, 0x0000018c, 0x0000018d, -0x00000192, 0x00000192, 0x00000195, 0x00000195, 0x00000199, -0x0000019b, 0x0000019e, 0x0000019e, 0x000001a1, 0x000001a1, -0x000001a3, 0x000001a3, 0x000001a5, 0x000001a5, 0x000001a8, -0x000001a8, 0x000001aa, 0x000001ab, 0x000001ad, 0x000001ad, -0x000001b0, 0x000001b0, 0x000001b4, 0x000001b4, 0x000001b6, -0x000001b6, 0x000001b9, 0x000001ba, 0x000001bd, 0x000001bf, -0x000001c6, 0x000001c6, 0x000001c9, 0x000001c9, 0x000001cc, -0x000001cc, 0x000001ce, 0x000001ce, 0x000001d0, 0x000001d0, -0x000001d2, 0x000001d2, 0x000001d4, 0x000001d4, 0x000001d6, -0x000001d6, 0x000001d8, 0x000001d8, 0x000001da, 0x000001da, -0x000001dc, 0x000001dd, 0x000001df, 0x000001df, 0x000001e1, -0x000001e1, 0x000001e3, 0x000001e3, 0x000001e5, 0x000001e5, -0x000001e7, 0x000001e7, 0x000001e9, 0x000001e9, 0x000001eb, -0x000001eb, 0x000001ed, 0x000001ed, 0x000001ef, 0x000001f0, -0x000001f3, 0x000001f3, 0x000001f5, 0x000001f5, 0x000001f9, -0x000001f9, 0x000001fb, 0x000001fb, 0x000001fd, 0x000001fd, -0x000001ff, 0x000001ff, 0x00000201, 0x00000201, 0x00000203, -0x00000203, 0x00000205, 0x00000205, 0x00000207, 0x00000207, -0x00000209, 0x00000209, 0x0000020b, 0x0000020b, 0x0000020d, -0x0000020d, 0x0000020f, 0x0000020f, 0x00000211, 0x00000211, -0x00000213, 0x00000213, 0x00000215, 0x00000215, 0x00000217, -0x00000217, 0x00000219, 0x00000219, 0x0000021b, 0x0000021b, -0x0000021d, 0x0000021d, 0x0000021f, 0x0000021f, 0x00000223, -0x00000223, 0x00000225, 0x00000225, 0x00000227, 0x00000227, -0x00000229, 0x00000229, 0x0000022b, 0x0000022b, 0x0000022d, -0x0000022d, 0x0000022f, 0x0000022f, 0x00000231, 0x00000231, -0x00000233, 0x00000233, 0x00000250, 0x000002ad, 0x00000390, -0x00000390, 0x000003ac, 0x000003ce, 0x000003d0, 0x000003d1, -0x000003d5, 0x000003d7, 0x000003d9, 0x000003d9, 0x000003db, -0x000003db, 0x000003dd, 0x000003dd, 0x000003df, 0x000003df, -0x000003e1, 0x000003e1, 0x000003e3, 0x000003e3, 0x000003e5, -0x000003e5, 0x000003e7, 0x000003e7, 0x000003e9, 0x000003e9, -0x000003eb, 0x000003eb, 0x000003ed, 0x000003ed, 0x000003ef, -0x000003f3, 0x000003f5, 0x000003f5, 0x00000430, 0x0000045f, -0x00000461, 0x00000461, 0x00000463, 0x00000463, 0x00000465, -0x00000465, 0x00000467, 0x00000467, 0x00000469, 0x00000469, -0x0000046b, 0x0000046b, 0x0000046d, 0x0000046d, 0x0000046f, -0x0000046f, 0x00000471, 0x00000471, 0x00000473, 0x00000473, -0x00000475, 0x00000475, 0x00000477, 0x00000477, 0x00000479, -0x00000479, 0x0000047b, 0x0000047b, 0x0000047d, 0x0000047d, -0x0000047f, 0x0000047f, 0x00000481, 0x00000481, 0x0000048b, -0x0000048b, 0x0000048d, 0x0000048d, 0x0000048f, 0x0000048f, -0x00000491, 0x00000491, 0x00000493, 0x00000493, 0x00000495, -0x00000495, 0x00000497, 0x00000497, 0x00000499, 0x00000499, -0x0000049b, 0x0000049b, 0x0000049d, 0x0000049d, 0x0000049f, -0x0000049f, 0x000004a1, 0x000004a1, 0x000004a3, 0x000004a3, -0x000004a5, 0x000004a5, 0x000004a7, 0x000004a7, 0x000004a9, -0x000004a9, 0x000004ab, 0x000004ab, 0x000004ad, 0x000004ad, -0x000004af, 0x000004af, 0x000004b1, 0x000004b1, 0x000004b3, -0x000004b3, 0x000004b5, 0x000004b5, 0x000004b7, 0x000004b7, -0x000004b9, 0x000004b9, 0x000004bb, 0x000004bb, 0x000004bd, -0x000004bd, 0x000004bf, 0x000004bf, 0x000004c2, 0x000004c2, -0x000004c4, 0x000004c4, 0x000004c6, 0x000004c6, 0x000004c8, -0x000004c8, 0x000004ca, 0x000004ca, 0x000004cc, 0x000004cc, -0x000004ce, 0x000004ce, 0x000004d1, 0x000004d1, 0x000004d3, -0x000004d3, 0x000004d5, 0x000004d5, 0x000004d7, 0x000004d7, -0x000004d9, 0x000004d9, 0x000004db, 0x000004db, 0x000004dd, -0x000004dd, 0x000004df, 0x000004df, 0x000004e1, 0x000004e1, -0x000004e3, 0x000004e3, 0x000004e5, 0x000004e5, 0x000004e7, -0x000004e7, 0x000004e9, 0x000004e9, 0x000004eb, 0x000004eb, -0x000004ed, 0x000004ed, 0x000004ef, 0x000004ef, 0x000004f1, -0x000004f1, 0x000004f3, 0x000004f3, 0x000004f5, 0x000004f5, -0x000004f9, 0x000004f9, 0x00000501, 0x00000501, 0x00000503, -0x00000503, 0x00000505, 0x00000505, 0x00000507, 0x00000507, -0x00000509, 0x00000509, 0x0000050b, 0x0000050b, 0x0000050d, -0x0000050d, 0x0000050f, 0x0000050f, 0x00000561, 0x00000587, -0x00001e01, 0x00001e01, 0x00001e03, 0x00001e03, 0x00001e05, -0x00001e05, 0x00001e07, 0x00001e07, 0x00001e09, 0x00001e09, -0x00001e0b, 0x00001e0b, 0x00001e0d, 0x00001e0d, 0x00001e0f, -0x00001e0f, 0x00001e11, 0x00001e11, 0x00001e13, 0x00001e13, -0x00001e15, 0x00001e15, 0x00001e17, 0x00001e17, 0x00001e19, -0x00001e19, 0x00001e1b, 0x00001e1b, 0x00001e1d, 0x00001e1d, -0x00001e1f, 0x00001e1f, 0x00001e21, 0x00001e21, 0x00001e23, -0x00001e23, 0x00001e25, 0x00001e25, 0x00001e27, 0x00001e27, -0x00001e29, 0x00001e29, 0x00001e2b, 0x00001e2b, 0x00001e2d, -0x00001e2d, 0x00001e2f, 0x00001e2f, 0x00001e31, 0x00001e31, -0x00001e33, 0x00001e33, 0x00001e35, 0x00001e35, 0x00001e37, -0x00001e37, 0x00001e39, 0x00001e39, 0x00001e3b, 0x00001e3b, -0x00001e3d, 0x00001e3d, 0x00001e3f, 0x00001e3f, 0x00001e41, -0x00001e41, 0x00001e43, 0x00001e43, 0x00001e45, 0x00001e45, -0x00001e47, 0x00001e47, 0x00001e49, 0x00001e49, 0x00001e4b, -0x00001e4b, 0x00001e4d, 0x00001e4d, 0x00001e4f, 0x00001e4f, -0x00001e51, 0x00001e51, 0x00001e53, 0x00001e53, 0x00001e55, -0x00001e55, 0x00001e57, 0x00001e57, 0x00001e59, 0x00001e59, -0x00001e5b, 0x00001e5b, 0x00001e5d, 0x00001e5d, 0x00001e5f, -0x00001e5f, 0x00001e61, 0x00001e61, 0x00001e63, 0x00001e63, -0x00001e65, 0x00001e65, 0x00001e67, 0x00001e67, 0x00001e69, -0x00001e69, 0x00001e6b, 0x00001e6b, 0x00001e6d, 0x00001e6d, -0x00001e6f, 0x00001e6f, 0x00001e71, 0x00001e71, 0x00001e73, -0x00001e73, 0x00001e75, 0x00001e75, 0x00001e77, 0x00001e77, -0x00001e79, 0x00001e79, 0x00001e7b, 0x00001e7b, 0x00001e7d, -0x00001e7d, 0x00001e7f, 0x00001e7f, 0x00001e81, 0x00001e81, -0x00001e83, 0x00001e83, 0x00001e85, 0x00001e85, 0x00001e87, -0x00001e87, 0x00001e89, 0x00001e89, 0x00001e8b, 0x00001e8b, -0x00001e8d, 0x00001e8d, 0x00001e8f, 0x00001e8f, 0x00001e91, -0x00001e91, 0x00001e93, 0x00001e93, 0x00001e95, 0x00001e9b, -0x00001ea1, 0x00001ea1, 0x00001ea3, 0x00001ea3, 0x00001ea5, -0x00001ea5, 0x00001ea7, 0x00001ea7, 0x00001ea9, 0x00001ea9, -0x00001eab, 0x00001eab, 0x00001ead, 0x00001ead, 0x00001eaf, -0x00001eaf, 0x00001eb1, 0x00001eb1, 0x00001eb3, 0x00001eb3, -0x00001eb5, 0x00001eb5, 0x00001eb7, 0x00001eb7, 0x00001eb9, -0x00001eb9, 0x00001ebb, 0x00001ebb, 0x00001ebd, 0x00001ebd, -0x00001ebf, 0x00001ebf, 0x00001ec1, 0x00001ec1, 0x00001ec3, -0x00001ec3, 0x00001ec5, 0x00001ec5, 0x00001ec7, 0x00001ec7, -0x00001ec9, 0x00001ec9, 0x00001ecb, 0x00001ecb, 0x00001ecd, -0x00001ecd, 0x00001ecf, 0x00001ecf, 0x00001ed1, 0x00001ed1, -0x00001ed3, 0x00001ed3, 0x00001ed5, 0x00001ed5, 0x00001ed7, -0x00001ed7, 0x00001ed9, 0x00001ed9, 0x00001edb, 0x00001edb, -0x00001edd, 0x00001edd, 0x00001edf, 0x00001edf, 0x00001ee1, -0x00001ee1, 0x00001ee3, 0x00001ee3, 0x00001ee5, 0x00001ee5, -0x00001ee7, 0x00001ee7, 0x00001ee9, 0x00001ee9, 0x00001eeb, -0x00001eeb, 0x00001eed, 0x00001eed, 0x00001eef, 0x00001eef, -0x00001ef1, 0x00001ef1, 0x00001ef3, 0x00001ef3, 0x00001ef5, -0x00001ef5, 0x00001ef7, 0x00001ef7, 0x00001ef9, 0x00001ef9, -0x00001f00, 0x00001f07, 0x00001f10, 0x00001f15, 0x00001f20, -0x00001f27, 0x00001f30, 0x00001f37, 0x00001f40, 0x00001f45, -0x00001f50, 0x00001f57, 0x00001f60, 0x00001f67, 0x00001f70, -0x00001f7d, 0x00001f80, 0x00001f87, 0x00001f90, 0x00001f97, -0x00001fa0, 0x00001fa7, 0x00001fb0, 0x00001fb4, 0x00001fb6, -0x00001fb7, 0x00001fbe, 0x00001fbe, 0x00001fc2, 0x00001fc4, -0x00001fc6, 0x00001fc7, 0x00001fd0, 0x00001fd3, 0x00001fd6, -0x00001fd7, 0x00001fe0, 0x00001fe7, 0x00001ff2, 0x00001ff4, -0x00001ff6, 0x00001ff7, 0x00002071, 0x00002071, 0x0000207f, -0x0000207f, 0x0000210a, 0x0000210a, 0x0000210e, 0x0000210f, -0x00002113, 0x00002113, 0x0000212f, 0x0000212f, 0x00002134, -0x00002134, 0x00002139, 0x00002139, 0x0000213d, 0x0000213d, -0x00002146, 0x00002149, 0x0000fb00, 0x0000fb06, 0x0000fb13, -0x0000fb17, 0x0000ff41, 0x0000ff5a, 0x00010428, 0x0001044d, -0x0001d41a, 0x0001d433, 0x0001d44e, 0x0001d454, 0x0001d456, -0x0001d467, 0x0001d482, 0x0001d49b, 0x0001d4b6, 0x0001d4b9, -0x0001d4bb, 0x0001d4bb, 0x0001d4bd, 0x0001d4c0, 0x0001d4c2, -0x0001d4c3, 0x0001d4c5, 0x0001d4cf, 0x0001d4ea, 0x0001d503, -0x0001d51e, 0x0001d537, 0x0001d552, 0x0001d56b, 0x0001d586, -0x0001d59f, 0x0001d5ba, 0x0001d5d3, 0x0001d5ee, 0x0001d607, -0x0001d622, 0x0001d63b, 0x0001d656, 0x0001d66f, 0x0001d68a, -0x0001d6a3, 0x0001d6c2, 0x0001d6da, 0x0001d6dc, 0x0001d6e1, -0x0001d6fc, 0x0001d714, 0x0001d716, 0x0001d71b, 0x0001d736, -0x0001d74e, 0x0001d750, 0x0001d755, 0x0001d770, 0x0001d788, -0x0001d78a, 0x0001d78f, 0x0001d7aa, 0x0001d7c2, 0x0001d7c4, -0x0001d7c9, -0x000001c5, 0x000001c5, 0x000001c8, 0x000001c8, -0x000001cb, 0x000001cb, 0x000001f2, 0x000001f2, 0x00001f88, -0x00001f8f, 0x00001f98, 0x00001f9f, 0x00001fa8, 0x00001faf, -0x00001fbc, 0x00001fbc, 0x00001fcc, 0x00001fcc, 0x00001ffc, -0x00001ffc, -0x000002b0, 0x000002b8, 0x000002bb, 0x000002c1, -0x000002d0, 0x000002d1, 0x000002e0, 0x000002e4, 0x000002ee, -0x000002ee, 0x0000037a, 0x0000037a, 0x00000559, 0x00000559, -0x00000640, 0x00000640, 0x000006e5, 0x000006e6, 0x00000e46, -0x00000e46, 0x00000ec6, 0x00000ec6, 0x000017d7, 0x000017d7, -0x00001843, 0x00001843, 0x00003005, 0x00003005, 0x00003031, -0x00003035, 0x0000303b, 0x0000303b, 0x0000309d, 0x0000309e, -0x000030fc, 0x000030fe, 0x0000ff70, 0x0000ff70, 0x0000ff9e, -0x0000ff9f, -0x000001bb, 0x000001bb, 0x000001c0, 0x000001c3, -0x000005d0, 0x000005ea, 0x000005f0, 0x000005f2, 0x00000621, -0x0000063a, 0x00000641, 0x0000064a, 0x0000066e, 0x0000066f, -0x00000671, 0x000006d3, 0x000006d5, 0x000006d5, 0x000006fa, -0x000006fc, 0x00000710, 0x00000710, 0x00000712, 0x0000072c, -0x00000780, 0x000007a5, 0x000007b1, 0x000007b1, 0x00000905, -0x00000939, 0x0000093d, 0x0000093d, 0x00000950, 0x00000950, -0x00000958, 0x00000961, 0x00000985, 0x0000098c, 0x0000098f, -0x00000990, 0x00000993, 0x000009a8, 0x000009aa, 0x000009b0, -0x000009b2, 0x000009b2, 0x000009b6, 0x000009b9, 0x000009dc, -0x000009dd, 0x000009df, 0x000009e1, 0x000009f0, 0x000009f1, -0x00000a05, 0x00000a0a, 0x00000a0f, 0x00000a10, 0x00000a13, -0x00000a28, 0x00000a2a, 0x00000a30, 0x00000a32, 0x00000a33, -0x00000a35, 0x00000a36, 0x00000a38, 0x00000a39, 0x00000a59, -0x00000a5c, 0x00000a5e, 0x00000a5e, 0x00000a72, 0x00000a74, -0x00000a85, 0x00000a8b, 0x00000a8d, 0x00000a8d, 0x00000a8f, -0x00000a91, 0x00000a93, 0x00000aa8, 0x00000aaa, 0x00000ab0, -0x00000ab2, 0x00000ab3, 0x00000ab5, 0x00000ab9, 0x00000abd, -0x00000abd, 0x00000ad0, 0x00000ad0, 0x00000ae0, 0x00000ae0, -0x00000b05, 0x00000b0c, 0x00000b0f, 0x00000b10, 0x00000b13, -0x00000b28, 0x00000b2a, 0x00000b30, 0x00000b32, 0x00000b33, -0x00000b36, 0x00000b39, 0x00000b3d, 0x00000b3d, 0x00000b5c, -0x00000b5d, 0x00000b5f, 0x00000b61, 0x00000b83, 0x00000b83, -0x00000b85, 0x00000b8a, 0x00000b8e, 0x00000b90, 0x00000b92, -0x00000b95, 0x00000b99, 0x00000b9a, 0x00000b9c, 0x00000b9c, -0x00000b9e, 0x00000b9f, 0x00000ba3, 0x00000ba4, 0x00000ba8, -0x00000baa, 0x00000bae, 0x00000bb5, 0x00000bb7, 0x00000bb9, -0x00000c05, 0x00000c0c, 0x00000c0e, 0x00000c10, 0x00000c12, -0x00000c28, 0x00000c2a, 0x00000c33, 0x00000c35, 0x00000c39, -0x00000c60, 0x00000c61, 0x00000c85, 0x00000c8c, 0x00000c8e, -0x00000c90, 0x00000c92, 0x00000ca8, 0x00000caa, 0x00000cb3, -0x00000cb5, 0x00000cb9, 0x00000cde, 0x00000cde, 0x00000ce0, -0x00000ce1, 0x00000d05, 0x00000d0c, 0x00000d0e, 0x00000d10, -0x00000d12, 0x00000d28, 0x00000d2a, 0x00000d39, 0x00000d60, -0x00000d61, 0x00000d85, 0x00000d96, 0x00000d9a, 0x00000db1, -0x00000db3, 0x00000dbb, 0x00000dbd, 0x00000dbd, 0x00000dc0, -0x00000dc6, 0x00000e01, 0x00000e30, 0x00000e32, 0x00000e33, -0x00000e40, 0x00000e45, 0x00000e81, 0x00000e82, 0x00000e84, -0x00000e84, 0x00000e87, 0x00000e88, 0x00000e8a, 0x00000e8a, -0x00000e8d, 0x00000e8d, 0x00000e94, 0x00000e97, 0x00000e99, -0x00000e9f, 0x00000ea1, 0x00000ea3, 0x00000ea5, 0x00000ea5, -0x00000ea7, 0x00000ea7, 0x00000eaa, 0x00000eab, 0x00000ead, -0x00000eb0, 0x00000eb2, 0x00000eb3, 0x00000ebd, 0x00000ebd, -0x00000ec0, 0x00000ec4, 0x00000edc, 0x00000edd, 0x00000f00, -0x00000f00, 0x00000f40, 0x00000f47, 0x00000f49, 0x00000f6a, -0x00000f88, 0x00000f8b, 0x00001000, 0x00001021, 0x00001023, -0x00001027, 0x00001029, 0x0000102a, 0x00001050, 0x00001055, -0x000010d0, 0x000010f8, 0x00001100, 0x00001159, 0x0000115f, -0x000011a2, 0x000011a8, 0x000011f9, 0x00001200, 0x00001206, -0x00001208, 0x00001246, 0x00001248, 0x00001248, 0x0000124a, -0x0000124d, 0x00001250, 0x00001256, 0x00001258, 0x00001258, -0x0000125a, 0x0000125d, 0x00001260, 0x00001286, 0x00001288, -0x00001288, 0x0000128a, 0x0000128d, 0x00001290, 0x000012ae, -0x000012b0, 0x000012b0, 0x000012b2, 0x000012b5, 0x000012b8, -0x000012be, 0x000012c0, 0x000012c0, 0x000012c2, 0x000012c5, -0x000012c8, 0x000012ce, 0x000012d0, 0x000012d6, 0x000012d8, -0x000012ee, 0x000012f0, 0x0000130e, 0x00001310, 0x00001310, -0x00001312, 0x00001315, 0x00001318, 0x0000131e, 0x00001320, -0x00001346, 0x00001348, 0x0000135a, 0x000013a0, 0x000013f4, -0x00001401, 0x0000166c, 0x0000166f, 0x00001676, 0x00001681, -0x0000169a, 0x000016a0, 0x000016ea, 0x00001700, 0x0000170c, -0x0000170e, 0x00001711, 0x00001720, 0x00001731, 0x00001740, -0x00001751, 0x00001760, 0x0000176c, 0x0000176e, 0x00001770, -0x00001780, 0x000017b3, 0x000017dc, 0x000017dc, 0x00001820, -0x00001842, 0x00001844, 0x00001877, 0x00001880, 0x000018a8, -0x00002135, 0x00002138, 0x00003006, 0x00003006, 0x0000303c, -0x0000303c, 0x00003041, 0x00003096, 0x0000309f, 0x0000309f, -0x000030a1, 0x000030fa, 0x000030ff, 0x000030ff, 0x00003105, -0x0000312c, 0x00003131, 0x0000318e, 0x000031a0, 0x000031b7, -0x000031f0, 0x000031ff, 0x00003400, 0x00003400, 0x00004db5, -0x00004db5, 0x00004e00, 0x0000a48c, 0x0000ac00, 0x0000d7a3, -0x0000f900, 0x0000faff, 0x0000fb1d, 0x0000fb1d, 0x0000fb1f, -0x0000fb28, 0x0000fb2a, 0x0000fb36, 0x0000fb38, 0x0000fb3c, -0x0000fb3e, 0x0000fb3e, 0x0000fb40, 0x0000fb41, 0x0000fb43, -0x0000fb44, 0x0000fb46, 0x0000fbb1, 0x0000fbd3, 0x0000fd3d, -0x0000fd50, 0x0000fd8f, 0x0000fd92, 0x0000fdc7, 0x0000fdf0, -0x0000fdfb, 0x0000fe70, 0x0000fe74, 0x0000fe76, 0x0000fefc, -0x0000ff66, 0x0000ff6f, 0x0000ff71, 0x0000ff9d, 0x0000ffa0, -0x0000ffbe, 0x0000ffc2, 0x0000ffc7, 0x0000ffca, 0x0000ffcf, -0x0000ffd2, 0x0000ffd7, 0x0000ffda, 0x0000ffdc, 0x00010300, -0x0001031e, 0x00010330, 0x00010349, 0x00020000, 0x00020000, -0x0002a6d6, 0x0002a6d6, 0x0002f800, 0x0002fa1d, -0x0000005f, 0x0000005f, 0x0000203f, 0x00002040, -0x000030fb, 0x000030fb, 0x0000fe33, 0x0000fe34, 0x0000fe4d, -0x0000fe4f, 0x0000ff3f, 0x0000ff3f, 0x0000ff65, 0x0000ff65, -0x0000002d, 0x0000002d, 0x000000ad, 0x000000ad, -0x0000058a, 0x0000058a, 0x00001806, 0x00001806, 0x00002010, -0x00002015, 0x0000301c, 0x0000301c, 0x00003030, 0x00003030, -0x000030a0, 0x000030a0, 0x0000fe31, 0x0000fe32, 0x0000fe58, -0x0000fe58, 0x0000fe63, 0x0000fe63, 0x0000ff0d, 0x0000ff0d, -0x00000028, 0x00000028, 0x0000005b, 0x0000005b, -0x0000007b, 0x0000007b, 0x00000f3a, 0x00000f3a, 0x00000f3c, -0x00000f3c, 0x0000169b, 0x0000169b, 0x0000201a, 0x0000201a, -0x0000201e, 0x0000201e, 0x00002045, 0x00002045, 0x0000207d, -0x0000207d, 0x0000208d, 0x0000208d, 0x00002329, 0x00002329, -0x000023b4, 0x000023b4, 0x00002768, 0x00002768, 0x0000276a, -0x0000276a, 0x0000276c, 0x0000276c, 0x0000276e, 0x0000276e, -0x00002770, 0x00002770, 0x00002772, 0x00002772, 0x00002774, -0x00002774, 0x000027e6, 0x000027e6, 0x000027e8, 0x000027e8, -0x000027ea, 0x000027ea, 0x00002983, 0x00002983, 0x00002985, -0x00002985, 0x00002987, 0x00002987, 0x00002989, 0x00002989, -0x0000298b, 0x0000298b, 0x0000298d, 0x0000298d, 0x0000298f, -0x0000298f, 0x00002991, 0x00002991, 0x00002993, 0x00002993, -0x00002995, 0x00002995, 0x00002997, 0x00002997, 0x000029d8, -0x000029d8, 0x000029da, 0x000029da, 0x000029fc, 0x000029fc, -0x00003008, 0x00003008, 0x0000300a, 0x0000300a, 0x0000300c, -0x0000300c, 0x0000300e, 0x0000300e, 0x00003010, 0x00003010, -0x00003014, 0x00003014, 0x00003016, 0x00003016, 0x00003018, -0x00003018, 0x0000301a, 0x0000301a, 0x0000301d, 0x0000301d, -0x0000fd3e, 0x0000fd3e, 0x0000fe35, 0x0000fe35, 0x0000fe37, -0x0000fe37, 0x0000fe39, 0x0000fe39, 0x0000fe3b, 0x0000fe3b, -0x0000fe3d, 0x0000fe3d, 0x0000fe3f, 0x0000fe3f, 0x0000fe41, -0x0000fe41, 0x0000fe43, 0x0000fe43, 0x0000fe59, 0x0000fe59, -0x0000fe5b, 0x0000fe5b, 0x0000fe5d, 0x0000fe5d, 0x0000ff08, -0x0000ff08, 0x0000ff3b, 0x0000ff3b, 0x0000ff5b, 0x0000ff5b, -0x0000ff5f, 0x0000ff5f, 0x0000ff62, 0x0000ff62, -0x00000029, 0x00000029, 0x0000005d, 0x0000005d, -0x0000007d, 0x0000007d, 0x00000f3b, 0x00000f3b, 0x00000f3d, -0x00000f3d, 0x0000169c, 0x0000169c, 0x00002046, 0x00002046, -0x0000207e, 0x0000207e, 0x0000208e, 0x0000208e, 0x0000232a, -0x0000232a, 0x000023b5, 0x000023b5, 0x00002769, 0x00002769, -0x0000276b, 0x0000276b, 0x0000276d, 0x0000276d, 0x0000276f, -0x0000276f, 0x00002771, 0x00002771, 0x00002773, 0x00002773, -0x00002775, 0x00002775, 0x000027e7, 0x000027e7, 0x000027e9, -0x000027e9, 0x000027eb, 0x000027eb, 0x00002984, 0x00002984, -0x00002986, 0x00002986, 0x00002988, 0x00002988, 0x0000298a, -0x0000298a, 0x0000298c, 0x0000298c, 0x0000298e, 0x0000298e, -0x00002990, 0x00002990, 0x00002992, 0x00002992, 0x00002994, -0x00002994, 0x00002996, 0x00002996, 0x00002998, 0x00002998, -0x000029d9, 0x000029d9, 0x000029db, 0x000029db, 0x000029fd, -0x000029fd, 0x00003009, 0x00003009, 0x0000300b, 0x0000300b, -0x0000300d, 0x0000300d, 0x0000300f, 0x0000300f, 0x00003011, -0x00003011, 0x00003015, 0x00003015, 0x00003017, 0x00003017, -0x00003019, 0x00003019, 0x0000301b, 0x0000301b, 0x0000301e, -0x0000301f, 0x0000fd3f, 0x0000fd3f, 0x0000fe36, 0x0000fe36, -0x0000fe38, 0x0000fe38, 0x0000fe3a, 0x0000fe3a, 0x0000fe3c, -0x0000fe3c, 0x0000fe3e, 0x0000fe3e, 0x0000fe40, 0x0000fe40, -0x0000fe42, 0x0000fe42, 0x0000fe44, 0x0000fe44, 0x0000fe5a, -0x0000fe5a, 0x0000fe5c, 0x0000fe5c, 0x0000fe5e, 0x0000fe5e, -0x0000ff09, 0x0000ff09, 0x0000ff3d, 0x0000ff3d, 0x0000ff5d, -0x0000ff5d, 0x0000ff60, 0x0000ff60, 0x0000ff63, 0x0000ff63, -0x00000021, 0x00000023, 0x00000025, 0x00000027, -0x0000002a, 0x0000002a, 0x0000002c, 0x0000002c, 0x0000002e, -0x0000002f, 0x0000003a, 0x0000003b, 0x0000003f, 0x00000040, -0x0000005c, 0x0000005c, 0x000000a1, 0x000000a1, 0x000000b7, -0x000000b7, 0x000000bf, 0x000000bf, 0x0000037e, 0x0000037e, -0x00000387, 0x00000387, 0x0000055a, 0x0000055f, 0x00000589, -0x00000589, 0x000005be, 0x000005be, 0x000005c0, 0x000005c0, -0x000005c3, 0x000005c3, 0x000005f3, 0x000005f4, 0x0000060c, -0x0000060c, 0x0000061b, 0x0000061b, 0x0000061f, 0x0000061f, -0x0000066a, 0x0000066d, 0x000006d4, 0x000006d4, 0x00000700, -0x0000070d, 0x00000964, 0x00000965, 0x00000970, 0x00000970, -0x00000df4, 0x00000df4, 0x00000e4f, 0x00000e4f, 0x00000e5a, -0x00000e5b, 0x00000f04, 0x00000f12, 0x00000f85, 0x00000f85, -0x0000104a, 0x0000104f, 0x000010fb, 0x000010fb, 0x00001361, -0x00001368, 0x0000166d, 0x0000166e, 0x000016eb, 0x000016ed, -0x00001735, 0x00001736, 0x000017d4, 0x000017d6, 0x000017d8, -0x000017da, 0x00001800, 0x00001805, 0x00001807, 0x0000180a, -0x00002016, 0x00002017, 0x00002020, 0x00002027, 0x00002030, -0x00002038, 0x0000203b, 0x0000203e, 0x00002041, 0x00002043, -0x00002047, 0x00002051, 0x00002057, 0x00002057, 0x000023b6, -0x000023b6, 0x00003001, 0x00003003, 0x0000303d, 0x0000303d, -0x0000fe30, 0x0000fe30, 0x0000fe45, 0x0000fe46, 0x0000fe49, -0x0000fe4c, 0x0000fe50, 0x0000fe52, 0x0000fe54, 0x0000fe57, -0x0000fe5f, 0x0000fe61, 0x0000fe68, 0x0000fe68, 0x0000fe6a, -0x0000fe6b, 0x0000ff01, 0x0000ff03, 0x0000ff05, 0x0000ff07, -0x0000ff0a, 0x0000ff0a, 0x0000ff0c, 0x0000ff0c, 0x0000ff0e, -0x0000ff0f, 0x0000ff1a, 0x0000ff1b, 0x0000ff1f, 0x0000ff20, -0x0000ff3c, 0x0000ff3c, 0x0000ff61, 0x0000ff61, 0x0000ff64, -0x0000ff64, -0x0000002b, 0x0000002b, 0x0000003c, 0x0000003e, -0x0000007c, 0x0000007c, 0x0000007e, 0x0000007e, 0x000000ac, -0x000000ac, 0x000000b1, 0x000000b1, 0x000000d7, 0x000000d7, -0x000000f7, 0x000000f7, 0x000003f6, 0x000003f6, 0x00002044, -0x00002044, 0x00002052, 0x00002052, 0x0000207a, 0x0000207c, -0x0000208a, 0x0000208c, 0x00002140, 0x00002144, 0x0000214b, -0x0000214b, 0x00002190, 0x00002194, 0x0000219a, 0x0000219b, -0x000021a0, 0x000021a0, 0x000021a3, 0x000021a3, 0x000021a6, -0x000021a6, 0x000021ae, 0x000021ae, 0x000021ce, 0x000021cf, -0x000021d2, 0x000021d2, 0x000021d4, 0x000021d4, 0x000021f4, -0x000022ff, 0x00002308, 0x0000230b, 0x00002320, 0x00002321, -0x0000237c, 0x0000237c, 0x0000239b, 0x000023b3, 0x000025b7, -0x000025b7, 0x000025c1, 0x000025c1, 0x000025f8, 0x000025ff, -0x0000266f, 0x0000266f, 0x000027d0, 0x000027e5, 0x000027f0, -0x000027ff, 0x00002900, 0x00002982, 0x00002999, 0x000029d7, -0x000029dc, 0x000029fb, 0x000029fe, 0x00002aff, 0x0000fb29, -0x0000fb29, 0x0000fe62, 0x0000fe62, 0x0000fe64, 0x0000fe66, -0x0000ff0b, 0x0000ff0b, 0x0000ff1c, 0x0000ff1e, 0x0000ff5c, -0x0000ff5c, 0x0000ff5e, 0x0000ff5e, 0x0000ffe2, 0x0000ffe2, -0x0000ffe9, 0x0000ffec, 0x0001d6c1, 0x0001d6c1, 0x0001d6db, -0x0001d6db, 0x0001d6fb, 0x0001d6fb, 0x0001d715, 0x0001d715, -0x0001d735, 0x0001d735, 0x0001d74f, 0x0001d74f, 0x0001d76f, -0x0001d76f, 0x0001d789, 0x0001d789, 0x0001d7a9, 0x0001d7a9, -0x0001d7c3, 0x0001d7c3, -0x00000024, 0x00000024, 0x000000a2, 0x000000a5, -0x000009f2, 0x000009f3, 0x00000e3f, 0x00000e3f, 0x000017db, -0x000017db, 0x000020a0, 0x000020b1, 0x0000fdfc, 0x0000fdfc, -0x0000fe69, 0x0000fe69, 0x0000ff04, 0x0000ff04, 0x0000ffe0, -0x0000ffe1, 0x0000ffe5, 0x0000ffe6, -0x0000005e, 0x0000005e, 0x00000060, 0x00000060, -0x000000a8, 0x000000a8, 0x000000af, 0x000000af, 0x000000b4, -0x000000b4, 0x000000b8, 0x000000b8, 0x000002b9, 0x000002ba, -0x000002c2, 0x000002cf, 0x000002d2, 0x000002df, 0x000002e5, -0x000002ed, 0x00000374, 0x00000375, 0x00000384, 0x00000385, -0x00001fbd, 0x00001fbd, 0x00001fbf, 0x00001fc1, 0x00001fcd, -0x00001fcf, 0x00001fdd, 0x00001fdf, 0x00001fed, 0x00001fef, -0x00001ffd, 0x00001ffe, 0x0000309b, 0x0000309c, 0x0000ff3e, -0x0000ff3e, 0x0000ff40, 0x0000ff40, 0x0000ffe3, 0x0000ffe3, -0x000000a6, 0x000000a7, 0x000000a9, 0x000000a9, -0x000000ae, 0x000000ae, 0x000000b0, 0x000000b0, 0x000000b6, -0x000000b6, 0x00000482, 0x00000482, 0x000006e9, 0x000006e9, -0x000006fd, 0x000006fe, 0x000009fa, 0x000009fa, 0x00000b70, -0x00000b70, 0x00000f01, 0x00000f03, 0x00000f13, 0x00000f17, -0x00000f1a, 0x00000f1f, 0x00000f34, 0x00000f34, 0x00000f36, -0x00000f36, 0x00000f38, 0x00000f38, 0x00000fbe, 0x00000fc5, -0x00000fc7, 0x00000fcc, 0x00000fcf, 0x00000fcf, 0x00002100, -0x00002101, 0x00002103, 0x00002106, 0x00002108, 0x00002109, -0x00002114, 0x00002114, 0x00002116, 0x00002118, 0x0000211e, -0x00002123, 0x00002125, 0x00002125, 0x00002127, 0x00002127, -0x00002129, 0x00002129, 0x0000212e, 0x0000212e, 0x00002132, -0x00002132, 0x0000213a, 0x0000213a, 0x0000214a, 0x0000214a, -0x00002195, 0x00002199, 0x0000219c, 0x0000219f, 0x000021a1, -0x000021a2, 0x000021a4, 0x000021a5, 0x000021a7, 0x000021ad, -0x000021af, 0x000021cd, 0x000021d0, 0x000021d1, 0x000021d3, -0x000021d3, 0x000021d5, 0x000021f3, 0x00002300, 0x00002307, -0x0000230c, 0x0000231f, 0x00002322, 0x00002328, 0x0000232b, -0x0000237b, 0x0000237d, 0x0000239a, 0x000023b7, 0x000023ce, -0x00002400, 0x00002426, 0x00002440, 0x0000244a, 0x0000249c, -0x000024e9, 0x00002500, 0x000025b6, 0x000025b8, 0x000025c0, -0x000025c2, 0x000025f7, 0x00002600, 0x00002613, 0x00002616, -0x00002617, 0x00002619, 0x0000266e, 0x00002670, 0x0000267d, -0x00002680, 0x00002689, 0x00002701, 0x00002704, 0x00002706, -0x00002709, 0x0000270c, 0x00002727, 0x00002729, 0x0000274b, -0x0000274d, 0x0000274d, 0x0000274f, 0x00002752, 0x00002756, -0x00002756, 0x00002758, 0x0000275e, 0x00002761, 0x00002767, -0x00002794, 0x00002794, 0x00002798, 0x000027af, 0x000027b1, -0x000027be, 0x00002800, 0x000028ff, 0x00002e80, 0x00002e99, -0x00002e9b, 0x00002ef3, 0x00002f00, 0x00002fd5, 0x00002ff0, -0x00002ffb, 0x00003004, 0x00003004, 0x00003012, 0x00003013, -0x00003020, 0x00003020, 0x00003036, 0x00003037, 0x0000303e, -0x0000303f, 0x00003190, 0x00003191, 0x00003196, 0x0000319f, -0x00003200, 0x0000321c, 0x0000322a, 0x00003243, 0x00003260, -0x0000327b, 0x0000327f, 0x0000327f, 0x0000328a, 0x000032b0, -0x000032c0, 0x000032cb, 0x000032d0, 0x000032fe, 0x00003300, -0x00003376, 0x0000337b, 0x000033dd, 0x000033e0, 0x000033fe, -0x0000a490, 0x0000a4c6, 0x0000ffe4, 0x0000ffe4, 0x0000ffe8, -0x0000ffe8, 0x0000ffed, 0x0000ffee, 0x0000fffc, 0x0000fffd, -0x0001d000, 0x0001d0f5, 0x0001d100, 0x0001d126, 0x0001d12a, -0x0001d164, 0x0001d16a, 0x0001d16c, 0x0001d183, 0x0001d184, -0x0001d18c, 0x0001d1a9, 0x0001d1ae, 0x0001d1dd, -0x00000041, 0x0000005a, 0x00000061, 0x0000007a, -0x000000aa, 0x000000aa, 0x000000b5, 0x000000b5, 0x000000ba, -0x000000ba, 0x000000c0, 0x000000d6, 0x000000d8, 0x000000f6, -0x000000f8, 0x00000220, 0x00000222, 0x00000233, 0x00000250, -0x000002ad, 0x000002b0, 0x000002b8, 0x000002bb, 0x000002c1, -0x000002d0, 0x000002d1, 0x000002e0, 0x000002e4, 0x000002ee, -0x000002ee, 0x0000037a, 0x0000037a, 0x00000386, 0x00000386, -0x00000388, 0x0000038a, 0x0000038c, 0x0000038c, 0x0000038e, -0x000003a1, 0x000003a3, 0x000003ce, 0x000003d0, 0x000003f5, -0x00000400, 0x00000482, 0x0000048a, 0x000004ce, 0x000004d0, -0x000004f5, 0x000004f8, 0x000004f9, 0x00000500, 0x0000050f, -0x00000531, 0x00000556, 0x00000559, 0x0000055f, 0x00000561, -0x00000587, 0x00000589, 0x00000589, 0x00000903, 0x00000903, -0x00000905, 0x00000939, 0x0000093d, 0x00000940, 0x00000949, -0x0000094c, 0x00000950, 0x00000950, 0x00000958, 0x00000961, -0x00000964, 0x00000970, 0x00000982, 0x00000983, 0x00000985, -0x0000098c, 0x0000098f, 0x00000990, 0x00000993, 0x000009a8, -0x000009aa, 0x000009b0, 0x000009b2, 0x000009b2, 0x000009b6, -0x000009b9, 0x000009be, 0x000009c0, 0x000009c7, 0x000009c8, -0x000009cb, 0x000009cc, 0x000009d7, 0x000009d7, 0x000009dc, -0x000009dd, 0x000009df, 0x000009e1, 0x000009e6, 0x000009f1, -0x000009f4, 0x000009fa, 0x00000a05, 0x00000a0a, 0x00000a0f, -0x00000a10, 0x00000a13, 0x00000a28, 0x00000a2a, 0x00000a30, -0x00000a32, 0x00000a33, 0x00000a35, 0x00000a36, 0x00000a38, -0x00000a39, 0x00000a3e, 0x00000a40, 0x00000a59, 0x00000a5c, -0x00000a5e, 0x00000a5e, 0x00000a66, 0x00000a6f, 0x00000a72, -0x00000a74, 0x00000a83, 0x00000a83, 0x00000a85, 0x00000a8b, -0x00000a8d, 0x00000a8d, 0x00000a8f, 0x00000a91, 0x00000a93, -0x00000aa8, 0x00000aaa, 0x00000ab0, 0x00000ab2, 0x00000ab3, -0x00000ab5, 0x00000ab9, 0x00000abd, 0x00000ac0, 0x00000ac9, -0x00000ac9, 0x00000acb, 0x00000acc, 0x00000ad0, 0x00000ad0, -0x00000ae0, 0x00000ae0, 0x00000ae6, 0x00000aef, 0x00000b02, -0x00000b03, 0x00000b05, 0x00000b0c, 0x00000b0f, 0x00000b10, -0x00000b13, 0x00000b28, 0x00000b2a, 0x00000b30, 0x00000b32, -0x00000b33, 0x00000b36, 0x00000b39, 0x00000b3d, 0x00000b3e, -0x00000b40, 0x00000b40, 0x00000b47, 0x00000b48, 0x00000b4b, -0x00000b4c, 0x00000b57, 0x00000b57, 0x00000b5c, 0x00000b5d, -0x00000b5f, 0x00000b61, 0x00000b66, 0x00000b70, 0x00000b83, -0x00000b83, 0x00000b85, 0x00000b8a, 0x00000b8e, 0x00000b90, -0x00000b92, 0x00000b95, 0x00000b99, 0x00000b9a, 0x00000b9c, -0x00000b9c, 0x00000b9e, 0x00000b9f, 0x00000ba3, 0x00000ba4, -0x00000ba8, 0x00000baa, 0x00000bae, 0x00000bb5, 0x00000bb7, -0x00000bb9, 0x00000bbe, 0x00000bbf, 0x00000bc1, 0x00000bc2, -0x00000bc6, 0x00000bc8, 0x00000bca, 0x00000bcc, 0x00000bd7, -0x00000bd7, 0x00000be7, 0x00000bf2, 0x00000c01, 0x00000c03, -0x00000c05, 0x00000c0c, 0x00000c0e, 0x00000c10, 0x00000c12, -0x00000c28, 0x00000c2a, 0x00000c33, 0x00000c35, 0x00000c39, -0x00000c41, 0x00000c44, 0x00000c60, 0x00000c61, 0x00000c66, -0x00000c6f, 0x00000c82, 0x00000c83, 0x00000c85, 0x00000c8c, -0x00000c8e, 0x00000c90, 0x00000c92, 0x00000ca8, 0x00000caa, -0x00000cb3, 0x00000cb5, 0x00000cb9, 0x00000cbe, 0x00000cbe, -0x00000cc0, 0x00000cc4, 0x00000cc7, 0x00000cc8, 0x00000cca, -0x00000ccb, 0x00000cd5, 0x00000cd6, 0x00000cde, 0x00000cde, -0x00000ce0, 0x00000ce1, 0x00000ce6, 0x00000cef, 0x00000d02, -0x00000d03, 0x00000d05, 0x00000d0c, 0x00000d0e, 0x00000d10, -0x00000d12, 0x00000d28, 0x00000d2a, 0x00000d39, 0x00000d3e, -0x00000d40, 0x00000d46, 0x00000d48, 0x00000d4a, 0x00000d4c, -0x00000d57, 0x00000d57, 0x00000d60, 0x00000d61, 0x00000d66, -0x00000d6f, 0x00000d82, 0x00000d83, 0x00000d85, 0x00000d96, -0x00000d9a, 0x00000db1, 0x00000db3, 0x00000dbb, 0x00000dbd, -0x00000dbd, 0x00000dc0, 0x00000dc6, 0x00000dcf, 0x00000dd1, -0x00000dd8, 0x00000ddf, 0x00000df2, 0x00000df4, 0x00000e01, -0x00000e30, 0x00000e32, 0x00000e33, 0x00000e40, 0x00000e46, -0x00000e4f, 0x00000e5b, 0x00000e81, 0x00000e82, 0x00000e84, -0x00000e84, 0x00000e87, 0x00000e88, 0x00000e8a, 0x00000e8a, -0x00000e8d, 0x00000e8d, 0x00000e94, 0x00000e97, 0x00000e99, -0x00000e9f, 0x00000ea1, 0x00000ea3, 0x00000ea5, 0x00000ea5, -0x00000ea7, 0x00000ea7, 0x00000eaa, 0x00000eab, 0x00000ead, -0x00000eb0, 0x00000eb2, 0x00000eb3, 0x00000ebd, 0x00000ebd, -0x00000ec0, 0x00000ec4, 0x00000ec6, 0x00000ec6, 0x00000ed0, -0x00000ed9, 0x00000edc, 0x00000edd, 0x00000f00, 0x00000f17, -0x00000f1a, 0x00000f34, 0x00000f36, 0x00000f36, 0x00000f38, -0x00000f38, 0x00000f3e, 0x00000f47, 0x00000f49, 0x00000f6a, -0x00000f7f, 0x00000f7f, 0x00000f85, 0x00000f85, 0x00000f88, -0x00000f8b, 0x00000fbe, 0x00000fc5, 0x00000fc7, 0x00000fcc, -0x00000fcf, 0x00000fcf, 0x00001000, 0x00001021, 0x00001023, -0x00001027, 0x00001029, 0x0000102a, 0x0000102c, 0x0000102c, -0x00001031, 0x00001031, 0x00001038, 0x00001038, 0x00001040, -0x00001057, 0x000010a0, 0x000010c5, 0x000010d0, 0x000010f8, -0x000010fb, 0x000010fb, 0x00001100, 0x00001159, 0x0000115f, -0x000011a2, 0x000011a8, 0x000011f9, 0x00001200, 0x00001206, -0x00001208, 0x00001246, 0x00001248, 0x00001248, 0x0000124a, -0x0000124d, 0x00001250, 0x00001256, 0x00001258, 0x00001258, -0x0000125a, 0x0000125d, 0x00001260, 0x00001286, 0x00001288, -0x00001288, 0x0000128a, 0x0000128d, 0x00001290, 0x000012ae, -0x000012b0, 0x000012b0, 0x000012b2, 0x000012b5, 0x000012b8, -0x000012be, 0x000012c0, 0x000012c0, 0x000012c2, 0x000012c5, -0x000012c8, 0x000012ce, 0x000012d0, 0x000012d6, 0x000012d8, -0x000012ee, 0x000012f0, 0x0000130e, 0x00001310, 0x00001310, -0x00001312, 0x00001315, 0x00001318, 0x0000131e, 0x00001320, -0x00001346, 0x00001348, 0x0000135a, 0x00001361, 0x0000137c, -0x000013a0, 0x000013f4, 0x00001401, 0x00001676, 0x00001681, -0x0000169a, 0x000016a0, 0x000016f0, 0x00001700, 0x0000170c, -0x0000170e, 0x00001711, 0x00001720, 0x00001731, 0x00001735, -0x00001736, 0x00001740, 0x00001751, 0x00001760, 0x0000176c, -0x0000176e, 0x00001770, 0x00001780, 0x000017b6, 0x000017be, -0x000017c5, 0x000017c7, 0x000017c8, 0x000017d4, 0x000017da, -0x000017dc, 0x000017dc, 0x000017e0, 0x000017e9, 0x00001810, -0x00001819, 0x00001820, 0x00001877, 0x00001880, 0x000018a8, -0x00001e00, 0x00001e9b, 0x00001ea0, 0x00001ef9, 0x00001f00, -0x00001f15, 0x00001f18, 0x00001f1d, 0x00001f20, 0x00001f45, -0x00001f48, 0x00001f4d, 0x00001f50, 0x00001f57, 0x00001f59, -0x00001f59, 0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d, -0x00001f5f, 0x00001f7d, 0x00001f80, 0x00001fb4, 0x00001fb6, -0x00001fbc, 0x00001fbe, 0x00001fbe, 0x00001fc2, 0x00001fc4, -0x00001fc6, 0x00001fcc, 0x00001fd0, 0x00001fd3, 0x00001fd6, -0x00001fdb, 0x00001fe0, 0x00001fec, 0x00001ff2, 0x00001ff4, -0x00001ff6, 0x00001ffc, 0x0000200e, 0x0000200e, 0x00002071, -0x00002071, 0x0000207f, 0x0000207f, 0x00002102, 0x00002102, -0x00002107, 0x00002107, 0x0000210a, 0x00002113, 0x00002115, -0x00002115, 0x00002119, 0x0000211d, 0x00002124, 0x00002124, -0x00002126, 0x00002126, 0x00002128, 0x00002128, 0x0000212a, -0x0000212d, 0x0000212f, 0x00002131, 0x00002133, 0x00002139, -0x0000213d, 0x0000213f, 0x00002145, 0x00002149, 0x00002160, -0x00002183, 0x00002336, 0x0000237a, 0x00002395, 0x00002395, -0x0000249c, 0x000024e9, 0x00003005, 0x00003007, 0x00003021, -0x00003029, 0x00003031, 0x00003035, 0x00003038, 0x0000303c, -0x00003041, 0x00003096, 0x0000309d, 0x0000309f, 0x000030a1, -0x000030fa, 0x000030fc, 0x000030ff, 0x00003105, 0x0000312c, -0x00003131, 0x0000318e, 0x00003190, 0x000031b7, 0x000031f0, -0x0000321c, 0x00003220, 0x00003243, 0x00003260, 0x0000327b, -0x0000327f, 0x000032b0, 0x000032c0, 0x000032cb, 0x000032d0, -0x000032fe, 0x00003300, 0x00003376, 0x0000337b, 0x000033dd, -0x000033e0, 0x000033fe, 0x00003400, 0x00003400, 0x00004db5, -0x00004db5, 0x00004e00, 0x0000a48c, 0x0000ac00, 0x0000d7a3, -0x0000e000, 0x0000fb06, 0x0000fb13, 0x0000fb17, 0x0000ff21, -0x0000ff3a, 0x0000ff41, 0x0000ff5a, 0x0000ff66, 0x0000ffbe, -0x0000ffc2, 0x0000ffc7, 0x0000ffca, 0x0000ffcf, 0x0000ffd2, -0x0000ffd7, 0x0000ffda, 0x0000ffdc, 0x00010000, 0x0010ffff, -0x000005be, 0x000005be, 0x000005c0, 0x000005c0, -0x000005c3, 0x000005c3, 0x000005d0, 0x000005ea, 0x000005f0, -0x000005f4, 0x0000200f, 0x0000200f, 0x0000fb1d, 0x0000fb1d, -0x0000fb1f, 0x0000fb28, 0x0000fb2a, 0x0000fb36, 0x0000fb38, -0x0000fb3c, 0x0000fb3e, 0x0000fb3e, 0x0000fb40, 0x0000fb41, -0x0000fb43, 0x0000fb44, 0x0000fb46, 0x0000fb4f, -0x00000030, 0x00000039, 0x000000b2, 0x000000b3, -0x000000b9, 0x000000b9, 0x000006f0, 0x000006f9, 0x00002070, -0x00002070, 0x00002074, 0x00002079, 0x00002080, 0x00002089, -0x00002460, 0x0000249b, 0x000024ea, 0x000024ea, 0x0000ff10, -0x0000ff19, 0x0001d7ce, 0x0001d7ff, -0x0000002f, 0x0000002f, 0x0000ff0f, 0x0000ff0f, -0x00000023, 0x00000025, 0x0000002b, 0x0000002b, -0x0000002d, 0x0000002d, 0x000000a2, 0x000000a5, 0x000000b0, -0x000000b1, 0x0000066a, 0x0000066a, 0x000009f2, 0x000009f3, -0x00000e3f, 0x00000e3f, 0x000017db, 0x000017db, 0x00002030, -0x00002034, 0x0000207a, 0x0000207b, 0x0000208a, 0x0000208b, -0x000020a0, 0x000020b1, 0x0000212e, 0x0000212e, 0x00002212, -0x00002213, 0x0000fb29, 0x0000fb29, 0x0000fe5f, 0x0000fe5f, -0x0000fe62, 0x0000fe63, 0x0000fe69, 0x0000fe6a, 0x0000ff03, -0x0000ff05, 0x0000ff0b, 0x0000ff0b, 0x0000ff0d, 0x0000ff0d, -0x0000ffe0, 0x0000ffe1, 0x0000ffe5, 0x0000ffe6, -0x00000660, 0x00000669, 0x0000066b, 0x0000066c, -0x0000002c, 0x0000002c, 0x0000002e, 0x0000002e, -0x0000003a, 0x0000003a, 0x000000a0, 0x000000a0, 0x0000060c, -0x0000060c, 0x0000fe50, 0x0000fe50, 0x0000fe52, 0x0000fe52, -0x0000fe55, 0x0000fe55, 0x0000ff0c, 0x0000ff0c, 0x0000ff0e, -0x0000ff0e, 0x0000ff1a, 0x0000ff1a, -0x0000000a, 0x0000000a, 0x0000000d, 0x0000000d, -0x0000001c, 0x0000001e, 0x00000085, 0x00000085, 0x00002029, -0x00002029, -0x00000009, 0x00000009, 0x0000000b, 0x0000000b, -0x0000001f, 0x0000001f, -0x0000000c, 0x0000000c, 0x00000020, 0x00000020, -0x00001680, 0x00001680, 0x00002000, 0x0000200a, 0x00002028, -0x00002028, 0x0000202f, 0x0000202f, 0x0000205f, 0x0000205f, -0x00003000, 0x00003000, -0x00000000, 0x00000008, 0x0000000e, 0x0000001b, -0x00000021, 0x00000022, 0x00000026, 0x0000002a, 0x0000003b, -0x00000040, 0x0000005b, 0x00000060, 0x0000007b, 0x00000084, -0x00000086, 0x0000009f, 0x000000a1, 0x000000a1, 0x000000a6, -0x000000a9, 0x000000ab, 0x000000af, 0x000000b4, 0x000000b4, -0x000000b6, 0x000000b8, 0x000000bb, 0x000000bf, 0x000000d7, -0x000000d7, 0x000000f7, 0x000000f7, 0x000002b9, 0x000002ba, -0x000002c2, 0x000002cf, 0x000002d2, 0x000002df, 0x000002e5, -0x000002ed, 0x00000300, 0x0000034f, 0x00000360, 0x0000036f, -0x00000374, 0x00000375, 0x0000037e, 0x0000037e, 0x00000384, -0x00000385, 0x00000387, 0x00000387, 0x000003f6, 0x000003f6, -0x00000483, 0x00000486, 0x00000488, 0x00000489, 0x0000058a, -0x0000058a, 0x00000591, 0x000005a1, 0x000005a3, 0x000005b9, -0x000005bb, 0x000005bd, 0x000005bf, 0x000005bf, 0x000005c1, -0x000005c2, 0x000005c4, 0x000005c4, 0x0000064b, 0x00000655, -0x00000670, 0x00000670, 0x000006d6, 0x000006dc, 0x000006de, -0x000006e4, 0x000006e7, 0x000006ed, 0x0000070f, 0x0000070f, -0x00000711, 0x00000711, 0x00000730, 0x0000074a, 0x000007a6, -0x000007b0, 0x00000901, 0x00000902, 0x0000093c, 0x0000093c, -0x00000941, 0x00000948, 0x0000094d, 0x0000094d, 0x00000951, -0x00000954, 0x00000962, 0x00000963, 0x00000981, 0x00000981, -0x000009bc, 0x000009bc, 0x000009c1, 0x000009c4, 0x000009cd, -0x000009cd, 0x000009e2, 0x000009e3, 0x00000a02, 0x00000a02, -0x00000a3c, 0x00000a3c, 0x00000a41, 0x00000a42, 0x00000a47, -0x00000a48, 0x00000a4b, 0x00000a4d, 0x00000a70, 0x00000a71, -0x00000a81, 0x00000a82, 0x00000abc, 0x00000abc, 0x00000ac1, -0x00000ac5, 0x00000ac7, 0x00000ac8, 0x00000acd, 0x00000acd, -0x00000b01, 0x00000b01, 0x00000b3c, 0x00000b3c, 0x00000b3f, -0x00000b3f, 0x00000b41, 0x00000b43, 0x00000b4d, 0x00000b4d, -0x00000b56, 0x00000b56, 0x00000b82, 0x00000b82, 0x00000bc0, -0x00000bc0, 0x00000bcd, 0x00000bcd, 0x00000c3e, 0x00000c40, -0x00000c46, 0x00000c48, 0x00000c4a, 0x00000c4d, 0x00000c55, -0x00000c56, 0x00000cbf, 0x00000cbf, 0x00000cc6, 0x00000cc6, -0x00000ccc, 0x00000ccd, 0x00000d41, 0x00000d43, 0x00000d4d, -0x00000d4d, 0x00000dca, 0x00000dca, 0x00000dd2, 0x00000dd4, -0x00000dd6, 0x00000dd6, 0x00000e31, 0x00000e31, 0x00000e34, -0x00000e3a, 0x00000e47, 0x00000e4e, 0x00000eb1, 0x00000eb1, -0x00000eb4, 0x00000eb9, 0x00000ebb, 0x00000ebc, 0x00000ec8, -0x00000ecd, 0x00000f18, 0x00000f19, 0x00000f35, 0x00000f35, -0x00000f37, 0x00000f37, 0x00000f39, 0x00000f3d, 0x00000f71, -0x00000f7e, 0x00000f80, 0x00000f84, 0x00000f86, 0x00000f87, -0x00000f90, 0x00000f97, 0x00000f99, 0x00000fbc, 0x00000fc6, -0x00000fc6, 0x0000102d, 0x00001030, 0x00001032, 0x00001032, -0x00001036, 0x00001037, 0x00001039, 0x00001039, 0x00001058, -0x00001059, 0x0000169b, 0x0000169c, 0x00001712, 0x00001714, -0x00001732, 0x00001734, 0x00001752, 0x00001753, 0x00001772, -0x00001773, 0x000017b7, 0x000017bd, 0x000017c6, 0x000017c6, -0x000017c9, 0x000017d3, 0x00001800, 0x0000180e, 0x000018a9, -0x000018a9, 0x00001fbd, 0x00001fbd, 0x00001fbf, 0x00001fc1, -0x00001fcd, 0x00001fcf, 0x00001fdd, 0x00001fdf, 0x00001fed, -0x00001fef, 0x00001ffd, 0x00001ffe, 0x0000200b, 0x0000200d, -0x00002010, 0x00002027, 0x0000202a, 0x0000202e, 0x00002035, -0x00002052, 0x00002057, 0x00002057, 0x00002060, 0x00002063, -0x0000206a, 0x0000206f, 0x0000207c, 0x0000207e, 0x0000208c, -0x0000208e, 0x000020d0, 0x000020ea, 0x00002100, 0x00002101, -0x00002103, 0x00002106, 0x00002108, 0x00002109, 0x00002114, -0x00002114, 0x00002116, 0x00002118, 0x0000211e, 0x00002123, -0x00002125, 0x00002125, 0x00002127, 0x00002127, 0x00002129, -0x00002129, 0x00002132, 0x00002132, 0x0000213a, 0x0000213a, -0x00002140, 0x00002144, 0x0000214a, 0x0000214b, 0x00002153, -0x0000215f, 0x00002190, 0x00002211, 0x00002214, 0x00002335, -0x0000237b, 0x00002394, 0x00002396, 0x000023ce, 0x00002400, -0x00002426, 0x00002440, 0x0000244a, 0x000024eb, 0x000024fe, -0x00002500, 0x00002613, 0x00002616, 0x00002617, 0x00002619, -0x0000267d, 0x00002680, 0x00002689, 0x00002701, 0x00002704, -0x00002706, 0x00002709, 0x0000270c, 0x00002727, 0x00002729, -0x0000274b, 0x0000274d, 0x0000274d, 0x0000274f, 0x00002752, -0x00002756, 0x00002756, 0x00002758, 0x0000275e, 0x00002761, -0x00002794, 0x00002798, 0x000027af, 0x000027b1, 0x000027be, -0x000027d0, 0x000027eb, 0x000027f0, 0x00002aff, 0x00002e80, -0x00002e99, 0x00002e9b, 0x00002ef3, 0x00002f00, 0x00002fd5, -0x00002ff0, 0x00002ffb, 0x00003001, 0x00003004, 0x00003008, -0x00003020, 0x0000302a, 0x00003030, 0x00003036, 0x00003037, -0x0000303d, 0x0000303f, 0x00003099, 0x0000309c, 0x000030a0, -0x000030a0, 0x000030fb, 0x000030fb, 0x00003251, 0x0000325f, -0x000032b1, 0x000032bf, 0x0000a490, 0x0000a4c6, 0x0000fb1e, -0x0000fb1e, 0x0000fd3e, 0x0000fd3f, 0x0000fe00, 0x0000fe0f, -0x0000fe20, 0x0000fe23, 0x0000fe30, 0x0000fe46, 0x0000fe49, -0x0000fe4f, 0x0000fe51, 0x0000fe51, 0x0000fe54, 0x0000fe54, -0x0000fe56, 0x0000fe5e, 0x0000fe60, 0x0000fe61, 0x0000fe64, -0x0000fe66, 0x0000fe68, 0x0000fe68, 0x0000fe6b, 0x0000fe6b, -0x0000feff, 0x0000feff, 0x0000ff01, 0x0000ff02, 0x0000ff06, -0x0000ff0a, 0x0000ff1b, 0x0000ff20, 0x0000ff3b, 0x0000ff40, -0x0000ff5b, 0x0000ff65, 0x0000ffe2, 0x0000ffe4, 0x0000ffe8, -0x0000ffee, 0x0000fff9, 0x0000fffd, 0x0001d167, 0x0001d169, -0x0001d173, 0x0001d182, 0x0001d185, 0x0001d18b, 0x0001d1aa, -0x0001d1ad, 0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f, -0x000000c0, 0x000000c5, 0x000000c7, 0x000000cf, -0x000000d1, 0x000000d6, 0x000000d9, 0x000000dd, 0x000000e0, -0x000000e5, 0x000000e7, 0x000000ef, 0x000000f1, 0x000000f6, -0x000000f9, 0x000000fd, 0x000000ff, 0x0000010f, 0x00000112, -0x00000125, 0x00000128, 0x00000130, 0x00000134, 0x00000137, -0x00000139, 0x0000013e, 0x00000143, 0x00000148, 0x0000014c, -0x00000151, 0x00000154, 0x00000165, 0x00000168, 0x0000017e, -0x000001a0, 0x000001a1, 0x000001af, 0x000001b0, 0x000001cd, -0x000001dc, 0x000001de, 0x000001e3, 0x000001e6, 0x000001f0, -0x000001f4, 0x000001f5, 0x000001f8, 0x0000021b, 0x0000021e, -0x0000021f, 0x00000226, 0x00000233, 0x00000340, 0x00000341, -0x00000343, 0x00000344, 0x00000374, 0x00000374, 0x0000037e, -0x0000037e, 0x00000385, 0x0000038a, 0x0000038c, 0x0000038c, -0x0000038e, 0x00000390, 0x000003aa, 0x000003b0, 0x000003ca, -0x000003ce, 0x000003d3, 0x000003d4, 0x00000400, 0x00000401, -0x00000403, 0x00000403, 0x00000407, 0x00000407, 0x0000040c, -0x0000040e, 0x00000419, 0x00000419, 0x00000439, 0x00000439, -0x00000450, 0x00000451, 0x00000453, 0x00000453, 0x00000457, -0x00000457, 0x0000045c, 0x0000045e, 0x00000476, 0x00000477, -0x000004c1, 0x000004c2, 0x000004d0, 0x000004d3, 0x000004d6, -0x000004d7, 0x000004da, 0x000004df, 0x000004e2, 0x000004e7, -0x000004ea, 0x000004f5, 0x000004f8, 0x000004f9, 0x00000622, -0x00000626, 0x000006c0, 0x000006c0, 0x000006c2, 0x000006c2, -0x000006d3, 0x000006d3, 0x00000929, 0x00000929, 0x00000931, -0x00000931, 0x00000934, 0x00000934, 0x00000958, 0x0000095f, -0x000009cb, 0x000009cc, 0x000009dc, 0x000009dd, 0x000009df, -0x000009df, 0x00000a33, 0x00000a33, 0x00000a36, 0x00000a36, -0x00000a59, 0x00000a5b, 0x00000a5e, 0x00000a5e, 0x00000b48, -0x00000b48, 0x00000b4b, 0x00000b4c, 0x00000b5c, 0x00000b5d, -0x00000b94, 0x00000b94, 0x00000bca, 0x00000bcc, 0x00000c48, -0x00000c48, 0x00000cc0, 0x00000cc0, 0x00000cc7, 0x00000cc8, -0x00000cca, 0x00000ccb, 0x00000d4a, 0x00000d4c, 0x00000dda, -0x00000dda, 0x00000ddc, 0x00000dde, 0x00000f43, 0x00000f43, -0x00000f4d, 0x00000f4d, 0x00000f52, 0x00000f52, 0x00000f57, -0x00000f57, 0x00000f5c, 0x00000f5c, 0x00000f69, 0x00000f69, -0x00000f73, 0x00000f73, 0x00000f75, 0x00000f76, 0x00000f78, -0x00000f78, 0x00000f81, 0x00000f81, 0x00000f93, 0x00000f93, -0x00000f9d, 0x00000f9d, 0x00000fa2, 0x00000fa2, 0x00000fa7, -0x00000fa7, 0x00000fac, 0x00000fac, 0x00000fb9, 0x00000fb9, -0x00001026, 0x00001026, 0x00001e00, 0x00001e99, 0x00001e9b, -0x00001e9b, 0x00001ea0, 0x00001ef9, 0x00001f00, 0x00001f15, -0x00001f18, 0x00001f1d, 0x00001f20, 0x00001f45, 0x00001f48, -0x00001f4d, 0x00001f50, 0x00001f57, 0x00001f59, 0x00001f59, -0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d, 0x00001f5f, -0x00001f7d, 0x00001f80, 0x00001fb4, 0x00001fb6, 0x00001fbc, -0x00001fbe, 0x00001fbe, 0x00001fc1, 0x00001fc4, 0x00001fc6, -0x00001fd3, 0x00001fd6, 0x00001fdb, 0x00001fdd, 0x00001fef, -0x00001ff2, 0x00001ff4, 0x00001ff6, 0x00001ffd, 0x00002000, -0x00002001, 0x00002126, 0x00002126, 0x0000212a, 0x0000212b, -0x0000219a, 0x0000219b, 0x000021ae, 0x000021ae, 0x000021cd, -0x000021cf, 0x00002204, 0x00002204, 0x00002209, 0x00002209, -0x0000220c, 0x0000220c, 0x00002224, 0x00002224, 0x00002226, -0x00002226, 0x00002241, 0x00002241, 0x00002244, 0x00002244, -0x00002247, 0x00002247, 0x00002249, 0x00002249, 0x00002260, -0x00002260, 0x00002262, 0x00002262, 0x0000226d, 0x00002271, -0x00002274, 0x00002275, 0x00002278, 0x00002279, 0x00002280, -0x00002281, 0x00002284, 0x00002285, 0x00002288, 0x00002289, -0x000022ac, 0x000022af, 0x000022e0, 0x000022e3, 0x000022ea, -0x000022ed, 0x00002329, 0x0000232a, 0x00002adc, 0x00002adc, -0x0000304c, 0x0000304c, 0x0000304e, 0x0000304e, 0x00003050, -0x00003050, 0x00003052, 0x00003052, 0x00003054, 0x00003054, -0x00003056, 0x00003056, 0x00003058, 0x00003058, 0x0000305a, -0x0000305a, 0x0000305c, 0x0000305c, 0x0000305e, 0x0000305e, -0x00003060, 0x00003060, 0x00003062, 0x00003062, 0x00003065, -0x00003065, 0x00003067, 0x00003067, 0x00003069, 0x00003069, -0x00003070, 0x00003071, 0x00003073, 0x00003074, 0x00003076, -0x00003077, 0x00003079, 0x0000307a, 0x0000307c, 0x0000307d, -0x00003094, 0x00003094, 0x0000309e, 0x0000309e, 0x000030ac, -0x000030ac, 0x000030ae, 0x000030ae, 0x000030b0, 0x000030b0, -0x000030b2, 0x000030b2, 0x000030b4, 0x000030b4, 0x000030b6, -0x000030b6, 0x000030b8, 0x000030b8, 0x000030ba, 0x000030ba, -0x000030bc, 0x000030bc, 0x000030be, 0x000030be, 0x000030c0, -0x000030c0, 0x000030c2, 0x000030c2, 0x000030c5, 0x000030c5, -0x000030c7, 0x000030c7, 0x000030c9, 0x000030c9, 0x000030d0, -0x000030d1, 0x000030d3, 0x000030d4, 0x000030d6, 0x000030d7, -0x000030d9, 0x000030da, 0x000030dc, 0x000030dd, 0x000030f4, -0x000030f4, 0x000030f7, 0x000030fa, 0x000030fe, 0x000030fe, -0x0000f902, 0x0000fa0d, 0x0000fa10, 0x0000fa10, 0x0000fa12, -0x0000fa12, 0x0000fa15, 0x0000fa1e, 0x0000fa20, 0x0000fa20, -0x0000fa22, 0x0000fa22, 0x0000fa25, 0x0000fa26, 0x0000fa2a, -0x0000fa2d, 0x0000fa30, 0x0000fa6a, 0x0000fb1d, 0x0000fb1d, -0x0000fb1f, 0x0000fb1f, 0x0000fb2a, 0x0000fb36, 0x0000fb38, -0x0000fb3c, 0x0000fb3e, 0x0000fb3e, 0x0000fb40, 0x0000fb41, -0x0000fb43, 0x0000fb44, 0x0000fb46, 0x0000fb4e, 0x0001d15e, -0x0001d164, 0x0001d1bb, 0x0001d1c0, 0x0002f800, 0x0002fa1d, -0x00000000, 0x00000220, 0x00000222, 0x00000233, -0x00000250, 0x000002ad, 0x000002b0, 0x000002ee, 0x00000300, -0x0000034f, 0x00000360, 0x0000036f, 0x00000374, 0x00000375, -0x0000037a, 0x0000037a, 0x0000037e, 0x0000037e, 0x00000384, -0x0000038a, 0x0000038c, 0x0000038c, 0x0000038e, 0x000003a1, -0x000003a3, 0x000003ce, 0x000003d0, 0x000003f6, 0x00000400, -0x00000486, 0x00000488, 0x000004ce, 0x000004d0, 0x000004f5, -0x000004f8, 0x000004f9, 0x00000500, 0x0000050f, 0x00000531, -0x00000556, 0x00000559, 0x0000055f, 0x00000561, 0x00000587, -0x00000589, 0x0000058a, 0x00000591, 0x000005a1, 0x000005a3, -0x000005b9, 0x000005bb, 0x000005c4, 0x000005d0, 0x000005ea, -0x000005f0, 0x000005f4, 0x0000060c, 0x0000060c, 0x0000061b, -0x0000061b, 0x0000061f, 0x0000061f, 0x00000621, 0x0000063a, -0x00000640, 0x00000655, 0x00000660, 0x000006ed, 0x000006f0, -0x000006fe, 0x00000700, 0x0000070d, 0x0000070f, 0x0000072c, -0x00000730, 0x0000074a, 0x00000780, 0x000007b1, 0x00000901, -0x00000903, 0x00000905, 0x00000939, 0x0000093c, 0x0000094d, -0x00000950, 0x00000954, 0x00000958, 0x00000970, 0x00000981, -0x00000983, 0x00000985, 0x0000098c, 0x0000098f, 0x00000990, -0x00000993, 0x000009a8, 0x000009aa, 0x000009b0, 0x000009b2, -0x000009b2, 0x000009b6, 0x000009b9, 0x000009bc, 0x000009bc, -0x000009be, 0x000009c4, 0x000009c7, 0x000009c8, 0x000009cb, -0x000009cd, 0x000009d7, 0x000009d7, 0x000009dc, 0x000009dd, -0x000009df, 0x000009e3, 0x000009e6, 0x000009fa, 0x00000a02, -0x00000a02, 0x00000a05, 0x00000a0a, 0x00000a0f, 0x00000a10, -0x00000a13, 0x00000a28, 0x00000a2a, 0x00000a30, 0x00000a32, -0x00000a33, 0x00000a35, 0x00000a36, 0x00000a38, 0x00000a39, -0x00000a3c, 0x00000a3c, 0x00000a3e, 0x00000a42, 0x00000a47, -0x00000a48, 0x00000a4b, 0x00000a4d, 0x00000a59, 0x00000a5c, -0x00000a5e, 0x00000a5e, 0x00000a66, 0x00000a74, 0x00000a81, -0x00000a83, 0x00000a85, 0x00000a8b, 0x00000a8d, 0x00000a8d, -0x00000a8f, 0x00000a91, 0x00000a93, 0x00000aa8, 0x00000aaa, -0x00000ab0, 0x00000ab2, 0x00000ab3, 0x00000ab5, 0x00000ab9, -0x00000abc, 0x00000ac5, 0x00000ac7, 0x00000ac9, 0x00000acb, -0x00000acd, 0x00000ad0, 0x00000ad0, 0x00000ae0, 0x00000ae0, -0x00000ae6, 0x00000aef, 0x00000b01, 0x00000b03, 0x00000b05, -0x00000b0c, 0x00000b0f, 0x00000b10, 0x00000b13, 0x00000b28, -0x00000b2a, 0x00000b30, 0x00000b32, 0x00000b33, 0x00000b36, -0x00000b39, 0x00000b3c, 0x00000b43, 0x00000b47, 0x00000b48, -0x00000b4b, 0x00000b4d, 0x00000b56, 0x00000b57, 0x00000b5c, -0x00000b5d, 0x00000b5f, 0x00000b61, 0x00000b66, 0x00000b70, -0x00000b82, 0x00000b83, 0x00000b85, 0x00000b8a, 0x00000b8e, -0x00000b90, 0x00000b92, 0x00000b95, 0x00000b99, 0x00000b9a, -0x00000b9c, 0x00000b9c, 0x00000b9e, 0x00000b9f, 0x00000ba3, -0x00000ba4, 0x00000ba8, 0x00000baa, 0x00000bae, 0x00000bb5, -0x00000bb7, 0x00000bb9, 0x00000bbe, 0x00000bc2, 0x00000bc6, -0x00000bc8, 0x00000bca, 0x00000bcd, 0x00000bd7, 0x00000bd7, -0x00000be7, 0x00000bf2, 0x00000c01, 0x00000c03, 0x00000c05, -0x00000c0c, 0x00000c0e, 0x00000c10, 0x00000c12, 0x00000c28, -0x00000c2a, 0x00000c33, 0x00000c35, 0x00000c39, 0x00000c3e, -0x00000c44, 0x00000c46, 0x00000c48, 0x00000c4a, 0x00000c4d, -0x00000c55, 0x00000c56, 0x00000c60, 0x00000c61, 0x00000c66, -0x00000c6f, 0x00000c82, 0x00000c83, 0x00000c85, 0x00000c8c, -0x00000c8e, 0x00000c90, 0x00000c92, 0x00000ca8, 0x00000caa, -0x00000cb3, 0x00000cb5, 0x00000cb9, 0x00000cbe, 0x00000cc4, -0x00000cc6, 0x00000cc8, 0x00000cca, 0x00000ccd, 0x00000cd5, -0x00000cd6, 0x00000cde, 0x00000cde, 0x00000ce0, 0x00000ce1, -0x00000ce6, 0x00000cef, 0x00000d02, 0x00000d03, 0x00000d05, -0x00000d0c, 0x00000d0e, 0x00000d10, 0x00000d12, 0x00000d28, -0x00000d2a, 0x00000d39, 0x00000d3e, 0x00000d43, 0x00000d46, -0x00000d48, 0x00000d4a, 0x00000d4d, 0x00000d57, 0x00000d57, -0x00000d60, 0x00000d61, 0x00000d66, 0x00000d6f, 0x00000d82, -0x00000d83, 0x00000d85, 0x00000d96, 0x00000d9a, 0x00000db1, -0x00000db3, 0x00000dbb, 0x00000dbd, 0x00000dbd, 0x00000dc0, -0x00000dc6, 0x00000dca, 0x00000dca, 0x00000dcf, 0x00000dd4, -0x00000dd6, 0x00000dd6, 0x00000dd8, 0x00000ddf, 0x00000df2, -0x00000df4, 0x00000e01, 0x00000e3a, 0x00000e3f, 0x00000e5b, -0x00000e81, 0x00000e82, 0x00000e84, 0x00000e84, 0x00000e87, -0x00000e88, 0x00000e8a, 0x00000e8a, 0x00000e8d, 0x00000e8d, -0x00000e94, 0x00000e97, 0x00000e99, 0x00000e9f, 0x00000ea1, -0x00000ea3, 0x00000ea5, 0x00000ea5, 0x00000ea7, 0x00000ea7, -0x00000eaa, 0x00000eab, 0x00000ead, 0x00000eb9, 0x00000ebb, -0x00000ebd, 0x00000ec0, 0x00000ec4, 0x00000ec6, 0x00000ec6, -0x00000ec8, 0x00000ecd, 0x00000ed0, 0x00000ed9, 0x00000edc, -0x00000edd, 0x00000f00, 0x00000f47, 0x00000f49, 0x00000f6a, -0x00000f71, 0x00000f8b, 0x00000f90, 0x00000f97, 0x00000f99, -0x00000fbc, 0x00000fbe, 0x00000fcc, 0x00000fcf, 0x00000fcf, -0x00001000, 0x00001021, 0x00001023, 0x00001027, 0x00001029, -0x0000102a, 0x0000102c, 0x00001032, 0x00001036, 0x00001039, -0x00001040, 0x00001059, 0x000010a0, 0x000010c5, 0x000010d0, -0x000010f8, 0x000010fb, 0x000010fb, 0x00001100, 0x00001159, -0x0000115f, 0x000011a2, 0x000011a8, 0x000011f9, 0x00001200, -0x00001206, 0x00001208, 0x00001246, 0x00001248, 0x00001248, -0x0000124a, 0x0000124d, 0x00001250, 0x00001256, 0x00001258, -0x00001258, 0x0000125a, 0x0000125d, 0x00001260, 0x00001286, -0x00001288, 0x00001288, 0x0000128a, 0x0000128d, 0x00001290, -0x000012ae, 0x000012b0, 0x000012b0, 0x000012b2, 0x000012b5, -0x000012b8, 0x000012be, 0x000012c0, 0x000012c0, 0x000012c2, -0x000012c5, 0x000012c8, 0x000012ce, 0x000012d0, 0x000012d6, -0x000012d8, 0x000012ee, 0x000012f0, 0x0000130e, 0x00001310, -0x00001310, 0x00001312, 0x00001315, 0x00001318, 0x0000131e, -0x00001320, 0x00001346, 0x00001348, 0x0000135a, 0x00001361, -0x0000137c, 0x000013a0, 0x000013f4, 0x00001401, 0x00001676, -0x00001680, 0x0000169c, 0x000016a0, 0x000016f0, 0x00001700, -0x0000170c, 0x0000170e, 0x00001714, 0x00001720, 0x00001736, -0x00001740, 0x00001753, 0x00001760, 0x0000176c, 0x0000176e, -0x00001770, 0x00001772, 0x00001773, 0x00001780, 0x000017dc, -0x000017e0, 0x000017e9, 0x00001800, 0x0000180e, 0x00001810, -0x00001819, 0x00001820, 0x00001877, 0x00001880, 0x000018a9, -0x00001e00, 0x00001e9b, 0x00001ea0, 0x00001ef9, 0x00001f00, -0x00001f15, 0x00001f18, 0x00001f1d, 0x00001f20, 0x00001f45, -0x00001f48, 0x00001f4d, 0x00001f50, 0x00001f57, 0x00001f59, -0x00001f59, 0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d, -0x00001f5f, 0x00001f7d, 0x00001f80, 0x00001fb4, 0x00001fb6, -0x00001fc4, 0x00001fc6, 0x00001fd3, 0x00001fd6, 0x00001fdb, -0x00001fdd, 0x00001fef, 0x00001ff2, 0x00001ff4, 0x00001ff6, -0x00001ffe, 0x00002000, 0x00002052, 0x00002057, 0x00002057, -0x0000205f, 0x00002063, 0x0000206a, 0x00002071, 0x00002074, -0x0000208e, 0x000020a0, 0x000020b1, 0x000020d0, 0x000020ea, -0x00002100, 0x0000213a, 0x0000213d, 0x0000214b, 0x00002153, -0x00002183, 0x00002190, 0x000023ce, 0x00002400, 0x00002426, -0x00002440, 0x0000244a, 0x00002460, 0x000024fe, 0x00002500, -0x00002613, 0x00002616, 0x00002617, 0x00002619, 0x0000267d, -0x00002680, 0x00002689, 0x00002701, 0x00002704, 0x00002706, -0x00002709, 0x0000270c, 0x00002727, 0x00002729, 0x0000274b, -0x0000274d, 0x0000274d, 0x0000274f, 0x00002752, 0x00002756, -0x00002756, 0x00002758, 0x0000275e, 0x00002761, 0x00002794, -0x00002798, 0x000027af, 0x000027b1, 0x000027be, 0x000027d0, -0x000027eb, 0x000027f0, 0x00002aff, 0x00002e80, 0x00002e99, -0x00002e9b, 0x00002ef3, 0x00002f00, 0x00002fd5, 0x00002ff0, -0x00002ffb, 0x00003000, 0x0000303f, 0x00003041, 0x00003096, -0x00003099, 0x000030ff, 0x00003105, 0x0000312c, 0x00003131, -0x0000318e, 0x00003190, 0x000031b7, 0x000031f0, 0x0000321c, -0x00003220, 0x00003243, 0x00003251, 0x0000327b, 0x0000327f, -0x000032cb, 0x000032d0, 0x000032fe, 0x00003300, 0x00003376, -0x0000337b, 0x000033dd, 0x000033e0, 0x000033fe, 0x00003400, -0x00003400, 0x00004db5, 0x00004db5, 0x00004e00, 0x00009fa5, -0x0000a000, 0x0000a48c, 0x0000a490, 0x0000a4c6, 0x0000ac00, -0x0000d7a3, 0x0000f900, 0x0000fb06, 0x0000fb13, 0x0000fb17, -0x0000fb1d, 0x0000fb36, 0x0000fb38, 0x0000fb3c, 0x0000fb3e, -0x0000fb3e, 0x0000fb40, 0x0000fb41, 0x0000fb43, 0x0000fb44, -0x0000fb46, 0x0000fbb1, 0x0000fbd3, 0x0000fd3f, 0x0000fd50, -0x0000fd8f, 0x0000fd92, 0x0000fdc7, 0x0000fdf0, 0x0000fdfc, -0x0000fe00, 0x0000fe0f, 0x0000fe20, 0x0000fe23, 0x0000fe30, -0x0000fe46, 0x0000fe49, 0x0000fe52, 0x0000fe54, 0x0000fe66, -0x0000fe68, 0x0000fe6b, 0x0000fe70, 0x0000fe74, 0x0000fe76, -0x0000fefc, 0x0000feff, 0x0000feff, 0x0000ff01, 0x0000ffbe, -0x0000ffc2, 0x0000ffc7, 0x0000ffca, 0x0000ffcf, 0x0000ffd2, -0x0000ffd7, 0x0000ffda, 0x0000ffdc, 0x0000ffe0, 0x0000ffe6, -0x0000ffe8, 0x0000ffee, 0x0000fff9, 0x0000fffd, 0x00010300, -0x0001031e, 0x00010320, 0x00010323, 0x00010330, 0x0001034a, -0x00010400, 0x00010425, 0x00010428, 0x0001044d, 0x0001d000, -0x0001d0f5, 0x0001d100, 0x0001d126, 0x0001d12a, 0x0001d1dd, -0x0001d400, 0x0001d454, 0x0001d456, 0x0001d49c, 0x0001d49e, -0x0001d49f, 0x0001d4a2, 0x0001d4a2, 0x0001d4a5, 0x0001d4a6, -0x0001d4a9, 0x0001d4ac, 0x0001d4ae, 0x0001d4b9, 0x0001d4bb, -0x0001d4bb, 0x0001d4bd, 0x0001d4c0, 0x0001d4c2, 0x0001d4c3, -0x0001d4c5, 0x0001d505, 0x0001d507, 0x0001d50a, 0x0001d50d, -0x0001d514, 0x0001d516, 0x0001d51c, 0x0001d51e, 0x0001d539, -0x0001d53b, 0x0001d53e, 0x0001d540, 0x0001d544, 0x0001d546, -0x0001d546, 0x0001d54a, 0x0001d550, 0x0001d552, 0x0001d6a3, -0x0001d6a8, 0x0001d7c9, 0x0001d7ce, 0x0001d7ff, 0x00020000, -0x00020000, 0x0002a6d6, 0x0002a6d6, 0x0002f800, 0x0002fa1d, -0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f, 0x000f0000, -0x000f0000, 0x000ffffd, 0x000ffffd, 0x00100000, 0x00100000, -0x0010fffd, 0x0010fffd, -0x000000ab, 0x000000ab, 0x00002018, 0x00002018, -0x0000201b, 0x0000201c, 0x0000201f, 0x0000201f, 0x00002039, -0x00002039, -0x000000bb, 0x000000bb, 0x00002019, 0x00002019, -0x0000201d, 0x0000201d, 0x0000203a, 0x0000203a, -0x0000061b, 0x0000061b, 0x0000061f, 0x0000061f, -0x00000621, 0x0000063a, 0x00000640, 0x0000064a, 0x0000066d, -0x0000066f, 0x00000671, 0x000006d5, 0x000006dd, 0x000006dd, -0x000006e5, 0x000006e6, 0x000006fa, 0x000006fe, 0x00000700, -0x0000070d, 0x00000710, 0x00000710, 0x00000712, 0x0000072c, -0x00000780, 0x000007a5, 0x000007b1, 0x000007b1, 0x0000fb50, -0x0000fbb1, 0x0000fbd3, 0x0000fd3d, 0x0000fd50, 0x0000fd8f, -0x0000fd92, 0x0000fdc7, 0x0000fdf0, 0x0000fdfc, 0x0000fe70, -0x0000fe74, 0x0000fe76, 0x0000fefc, -}; -/* }}} */ -/* {{{ case data */ -static unsigned short _uccase_size = 0x05e0; -static unsigned short _uccase_len[2] = { 0x08bb, 0x08d9 }; -static unsigned long _uccase_map[] = { -/* upper */ -0x00000041, 0x00000061, 0x00000041, -0x00000042, 0x00000062, 0x00000042, -0x00000043, 0x00000063, 0x00000043, -0x00000044, 0x00000064, 0x00000044, -0x00000045, 0x00000065, 0x00000045, -0x00000046, 0x00000066, 0x00000046, -0x00000047, 0x00000067, 0x00000047, -0x00000048, 0x00000068, 0x00000048, -0x00000049, 0x00000069, 0x00000049, -0x0000004a, 0x0000006a, 0x0000004a, -0x0000004b, 0x0000006b, 0x0000004b, -0x0000004c, 0x0000006c, 0x0000004c, -0x0000004d, 0x0000006d, 0x0000004d, -0x0000004e, 0x0000006e, 0x0000004e, -0x0000004f, 0x0000006f, 0x0000004f, -0x00000050, 0x00000070, 0x00000050, -0x00000051, 0x00000071, 0x00000051, -0x00000052, 0x00000072, 0x00000052, -0x00000053, 0x00000073, 0x00000053, -0x00000054, 0x00000074, 0x00000054, -0x00000055, 0x00000075, 0x00000055, -0x00000056, 0x00000076, 0x00000056, -0x00000057, 0x00000077, 0x00000057, -0x00000058, 0x00000078, 0x00000058, -0x00000059, 0x00000079, 0x00000059, -0x0000005a, 0x0000007a, 0x0000005a, -0x000000c0, 0x000000e0, 0x000000c0, -0x000000c1, 0x000000e1, 0x000000c1, -0x000000c2, 0x000000e2, 0x000000c2, -0x000000c3, 0x000000e3, 0x000000c3, -0x000000c4, 0x000000e4, 0x000000c4, -0x000000c5, 0x000000e5, 0x000000c5, -0x000000c6, 0x000000e6, 0x000000c6, -0x000000c7, 0x000000e7, 0x000000c7, -0x000000c8, 0x000000e8, 0x000000c8, -0x000000c9, 0x000000e9, 0x000000c9, -0x000000ca, 0x000000ea, 0x000000ca, -0x000000cb, 0x000000eb, 0x000000cb, -0x000000cc, 0x000000ec, 0x000000cc, -0x000000cd, 0x000000ed, 0x000000cd, -0x000000ce, 0x000000ee, 0x000000ce, -0x000000cf, 0x000000ef, 0x000000cf, -0x000000d0, 0x000000f0, 0x000000d0, -0x000000d1, 0x000000f1, 0x000000d1, -0x000000d2, 0x000000f2, 0x000000d2, -0x000000d3, 0x000000f3, 0x000000d3, -0x000000d4, 0x000000f4, 0x000000d4, -0x000000d5, 0x000000f5, 0x000000d5, -0x000000d6, 0x000000f6, 0x000000d6, -0x000000d8, 0x000000f8, 0x000000d8, -0x000000d9, 0x000000f9, 0x000000d9, -0x000000da, 0x000000fa, 0x000000da, -0x000000db, 0x000000fb, 0x000000db, -0x000000dc, 0x000000fc, 0x000000dc, -0x000000dd, 0x000000fd, 0x000000dd, -0x000000de, 0x000000fe, 0x000000de, -0x00000100, 0x00000101, 0x00000100, -0x00000102, 0x00000103, 0x00000102, -0x00000104, 0x00000105, 0x00000104, -0x00000106, 0x00000107, 0x00000106, -0x00000108, 0x00000109, 0x00000108, -0x0000010a, 0x0000010b, 0x0000010a, -0x0000010c, 0x0000010d, 0x0000010c, -0x0000010e, 0x0000010f, 0x0000010e, -0x00000110, 0x00000111, 0x00000110, -0x00000112, 0x00000113, 0x00000112, -0x00000114, 0x00000115, 0x00000114, -0x00000116, 0x00000117, 0x00000116, -0x00000118, 0x00000119, 0x00000118, -0x0000011a, 0x0000011b, 0x0000011a, -0x0000011c, 0x0000011d, 0x0000011c, -0x0000011e, 0x0000011f, 0x0000011e, -0x00000120, 0x00000121, 0x00000120, -0x00000122, 0x00000123, 0x00000122, -0x00000124, 0x00000125, 0x00000124, -0x00000126, 0x00000127, 0x00000126, -0x00000128, 0x00000129, 0x00000128, -0x0000012a, 0x0000012b, 0x0000012a, -0x0000012c, 0x0000012d, 0x0000012c, -0x0000012e, 0x0000012f, 0x0000012e, -0x00000130, 0x00000069, 0x00000130, -0x00000132, 0x00000133, 0x00000132, -0x00000134, 0x00000135, 0x00000134, -0x00000136, 0x00000137, 0x00000136, -0x00000139, 0x0000013a, 0x00000139, -0x0000013b, 0x0000013c, 0x0000013b, -0x0000013d, 0x0000013e, 0x0000013d, -0x0000013f, 0x00000140, 0x0000013f, -0x00000141, 0x00000142, 0x00000141, -0x00000143, 0x00000144, 0x00000143, -0x00000145, 0x00000146, 0x00000145, -0x00000147, 0x00000148, 0x00000147, -0x0000014a, 0x0000014b, 0x0000014a, -0x0000014c, 0x0000014d, 0x0000014c, -0x0000014e, 0x0000014f, 0x0000014e, -0x00000150, 0x00000151, 0x00000150, -0x00000152, 0x00000153, 0x00000152, -0x00000154, 0x00000155, 0x00000154, -0x00000156, 0x00000157, 0x00000156, -0x00000158, 0x00000159, 0x00000158, -0x0000015a, 0x0000015b, 0x0000015a, -0x0000015c, 0x0000015d, 0x0000015c, -0x0000015e, 0x0000015f, 0x0000015e, -0x00000160, 0x00000161, 0x00000160, -0x00000162, 0x00000163, 0x00000162, -0x00000164, 0x00000165, 0x00000164, -0x00000166, 0x00000167, 0x00000166, -0x00000168, 0x00000169, 0x00000168, -0x0000016a, 0x0000016b, 0x0000016a, -0x0000016c, 0x0000016d, 0x0000016c, -0x0000016e, 0x0000016f, 0x0000016e, -0x00000170, 0x00000171, 0x00000170, -0x00000172, 0x00000173, 0x00000172, -0x00000174, 0x00000175, 0x00000174, -0x00000176, 0x00000177, 0x00000176, -0x00000178, 0x000000ff, 0x00000178, -0x00000179, 0x0000017a, 0x00000179, -0x0000017b, 0x0000017c, 0x0000017b, -0x0000017d, 0x0000017e, 0x0000017d, -0x00000181, 0x00000253, 0x00000181, -0x00000182, 0x00000183, 0x00000182, -0x00000184, 0x00000185, 0x00000184, -0x00000186, 0x00000254, 0x00000186, -0x00000187, 0x00000188, 0x00000187, -0x00000189, 0x00000256, 0x00000189, -0x0000018a, 0x00000257, 0x0000018a, -0x0000018b, 0x0000018c, 0x0000018b, -0x0000018e, 0x000001dd, 0x0000018e, -0x0000018f, 0x00000259, 0x0000018f, -0x00000190, 0x0000025b, 0x00000190, -0x00000191, 0x00000192, 0x00000191, -0x00000193, 0x00000260, 0x00000193, -0x00000194, 0x00000263, 0x00000194, -0x00000196, 0x00000269, 0x00000196, -0x00000197, 0x00000268, 0x00000197, -0x00000198, 0x00000199, 0x00000198, -0x0000019c, 0x0000026f, 0x0000019c, -0x0000019d, 0x00000272, 0x0000019d, -0x0000019f, 0x00000275, 0x0000019f, -0x000001a0, 0x000001a1, 0x000001a0, -0x000001a2, 0x000001a3, 0x000001a2, -0x000001a4, 0x000001a5, 0x000001a4, -0x000001a6, 0x00000280, 0x000001a6, -0x000001a7, 0x000001a8, 0x000001a7, -0x000001a9, 0x00000283, 0x000001a9, -0x000001ac, 0x000001ad, 0x000001ac, -0x000001ae, 0x00000288, 0x000001ae, -0x000001af, 0x000001b0, 0x000001af, -0x000001b1, 0x0000028a, 0x000001b1, -0x000001b2, 0x0000028b, 0x000001b2, -0x000001b3, 0x000001b4, 0x000001b3, -0x000001b5, 0x000001b6, 0x000001b5, -0x000001b7, 0x00000292, 0x000001b7, -0x000001b8, 0x000001b9, 0x000001b8, -0x000001bc, 0x000001bd, 0x000001bc, -0x000001c4, 0x000001c6, 0x000001c5, -0x000001c7, 0x000001c9, 0x000001c8, -0x000001ca, 0x000001cc, 0x000001cb, -0x000001cd, 0x000001ce, 0x000001cd, -0x000001cf, 0x000001d0, 0x000001cf, -0x000001d1, 0x000001d2, 0x000001d1, -0x000001d3, 0x000001d4, 0x000001d3, -0x000001d5, 0x000001d6, 0x000001d5, -0x000001d7, 0x000001d8, 0x000001d7, -0x000001d9, 0x000001da, 0x000001d9, -0x000001db, 0x000001dc, 0x000001db, -0x000001de, 0x000001df, 0x000001de, -0x000001e0, 0x000001e1, 0x000001e0, -0x000001e2, 0x000001e3, 0x000001e2, -0x000001e4, 0x000001e5, 0x000001e4, -0x000001e6, 0x000001e7, 0x000001e6, -0x000001e8, 0x000001e9, 0x000001e8, -0x000001ea, 0x000001eb, 0x000001ea, -0x000001ec, 0x000001ed, 0x000001ec, -0x000001ee, 0x000001ef, 0x000001ee, -0x000001f1, 0x000001f3, 0x000001f2, -0x000001f4, 0x000001f5, 0x000001f4, -0x000001f6, 0x00000195, 0x000001f6, -0x000001f7, 0x000001bf, 0x000001f7, -0x000001f8, 0x000001f9, 0x000001f8, -0x000001fa, 0x000001fb, 0x000001fa, -0x000001fc, 0x000001fd, 0x000001fc, -0x000001fe, 0x000001ff, 0x000001fe, -0x00000200, 0x00000201, 0x00000200, -0x00000202, 0x00000203, 0x00000202, -0x00000204, 0x00000205, 0x00000204, -0x00000206, 0x00000207, 0x00000206, -0x00000208, 0x00000209, 0x00000208, -0x0000020a, 0x0000020b, 0x0000020a, -0x0000020c, 0x0000020d, 0x0000020c, -0x0000020e, 0x0000020f, 0x0000020e, -0x00000210, 0x00000211, 0x00000210, -0x00000212, 0x00000213, 0x00000212, -0x00000214, 0x00000215, 0x00000214, -0x00000216, 0x00000217, 0x00000216, -0x00000218, 0x00000219, 0x00000218, -0x0000021a, 0x0000021b, 0x0000021a, -0x0000021c, 0x0000021d, 0x0000021c, -0x0000021e, 0x0000021f, 0x0000021e, -0x00000220, 0x0000019e, 0x00000220, -0x00000222, 0x00000223, 0x00000222, -0x00000224, 0x00000225, 0x00000224, -0x00000226, 0x00000227, 0x00000226, -0x00000228, 0x00000229, 0x00000228, -0x0000022a, 0x0000022b, 0x0000022a, -0x0000022c, 0x0000022d, 0x0000022c, -0x0000022e, 0x0000022f, 0x0000022e, -0x00000230, 0x00000231, 0x00000230, -0x00000232, 0x00000233, 0x00000232, -0x00000386, 0x000003ac, 0x00000386, -0x00000388, 0x000003ad, 0x00000388, -0x00000389, 0x000003ae, 0x00000389, -0x0000038a, 0x000003af, 0x0000038a, -0x0000038c, 0x000003cc, 0x0000038c, -0x0000038e, 0x000003cd, 0x0000038e, -0x0000038f, 0x000003ce, 0x0000038f, -0x00000391, 0x000003b1, 0x00000391, -0x00000392, 0x000003b2, 0x00000392, -0x00000393, 0x000003b3, 0x00000393, -0x00000394, 0x000003b4, 0x00000394, -0x00000395, 0x000003b5, 0x00000395, -0x00000396, 0x000003b6, 0x00000396, -0x00000397, 0x000003b7, 0x00000397, -0x00000398, 0x000003b8, 0x00000398, -0x00000399, 0x000003b9, 0x00000399, -0x0000039a, 0x000003ba, 0x0000039a, -0x0000039b, 0x000003bb, 0x0000039b, -0x0000039c, 0x000003bc, 0x0000039c, -0x0000039d, 0x000003bd, 0x0000039d, -0x0000039e, 0x000003be, 0x0000039e, -0x0000039f, 0x000003bf, 0x0000039f, -0x000003a0, 0x000003c0, 0x000003a0, -0x000003a1, 0x000003c1, 0x000003a1, -0x000003a3, 0x000003c3, 0x000003a3, -0x000003a4, 0x000003c4, 0x000003a4, -0x000003a5, 0x000003c5, 0x000003a5, -0x000003a6, 0x000003c6, 0x000003a6, -0x000003a7, 0x000003c7, 0x000003a7, -0x000003a8, 0x000003c8, 0x000003a8, -0x000003a9, 0x000003c9, 0x000003a9, -0x000003aa, 0x000003ca, 0x000003aa, -0x000003ab, 0x000003cb, 0x000003ab, -0x000003d8, 0x000003d9, 0x000003d8, -0x000003da, 0x000003db, 0x000003da, -0x000003dc, 0x000003dd, 0x000003dc, -0x000003de, 0x000003df, 0x000003de, -0x000003e0, 0x000003e1, 0x000003e0, -0x000003e2, 0x000003e3, 0x000003e2, -0x000003e4, 0x000003e5, 0x000003e4, -0x000003e6, 0x000003e7, 0x000003e6, -0x000003e8, 0x000003e9, 0x000003e8, -0x000003ea, 0x000003eb, 0x000003ea, -0x000003ec, 0x000003ed, 0x000003ec, -0x000003ee, 0x000003ef, 0x000003ee, -0x000003f4, 0x000003b8, 0x000003f4, -0x00000400, 0x00000450, 0x00000400, -0x00000401, 0x00000451, 0x00000401, -0x00000402, 0x00000452, 0x00000402, -0x00000403, 0x00000453, 0x00000403, -0x00000404, 0x00000454, 0x00000404, -0x00000405, 0x00000455, 0x00000405, -0x00000406, 0x00000456, 0x00000406, -0x00000407, 0x00000457, 0x00000407, -0x00000408, 0x00000458, 0x00000408, -0x00000409, 0x00000459, 0x00000409, -0x0000040a, 0x0000045a, 0x0000040a, -0x0000040b, 0x0000045b, 0x0000040b, -0x0000040c, 0x0000045c, 0x0000040c, -0x0000040d, 0x0000045d, 0x0000040d, -0x0000040e, 0x0000045e, 0x0000040e, -0x0000040f, 0x0000045f, 0x0000040f, -0x00000410, 0x00000430, 0x00000410, -0x00000411, 0x00000431, 0x00000411, -0x00000412, 0x00000432, 0x00000412, -0x00000413, 0x00000433, 0x00000413, -0x00000414, 0x00000434, 0x00000414, -0x00000415, 0x00000435, 0x00000415, -0x00000416, 0x00000436, 0x00000416, -0x00000417, 0x00000437, 0x00000417, -0x00000418, 0x00000438, 0x00000418, -0x00000419, 0x00000439, 0x00000419, -0x0000041a, 0x0000043a, 0x0000041a, -0x0000041b, 0x0000043b, 0x0000041b, -0x0000041c, 0x0000043c, 0x0000041c, -0x0000041d, 0x0000043d, 0x0000041d, -0x0000041e, 0x0000043e, 0x0000041e, -0x0000041f, 0x0000043f, 0x0000041f, -0x00000420, 0x00000440, 0x00000420, -0x00000421, 0x00000441, 0x00000421, -0x00000422, 0x00000442, 0x00000422, -0x00000423, 0x00000443, 0x00000423, -0x00000424, 0x00000444, 0x00000424, -0x00000425, 0x00000445, 0x00000425, -0x00000426, 0x00000446, 0x00000426, -0x00000427, 0x00000447, 0x00000427, -0x00000428, 0x00000448, 0x00000428, -0x00000429, 0x00000449, 0x00000429, -0x0000042a, 0x0000044a, 0x0000042a, -0x0000042b, 0x0000044b, 0x0000042b, -0x0000042c, 0x0000044c, 0x0000042c, -0x0000042d, 0x0000044d, 0x0000042d, -0x0000042e, 0x0000044e, 0x0000042e, -0x0000042f, 0x0000044f, 0x0000042f, -0x00000460, 0x00000461, 0x00000460, -0x00000462, 0x00000463, 0x00000462, -0x00000464, 0x00000465, 0x00000464, -0x00000466, 0x00000467, 0x00000466, -0x00000468, 0x00000469, 0x00000468, -0x0000046a, 0x0000046b, 0x0000046a, -0x0000046c, 0x0000046d, 0x0000046c, -0x0000046e, 0x0000046f, 0x0000046e, -0x00000470, 0x00000471, 0x00000470, -0x00000472, 0x00000473, 0x00000472, -0x00000474, 0x00000475, 0x00000474, -0x00000476, 0x00000477, 0x00000476, -0x00000478, 0x00000479, 0x00000478, -0x0000047a, 0x0000047b, 0x0000047a, -0x0000047c, 0x0000047d, 0x0000047c, -0x0000047e, 0x0000047f, 0x0000047e, -0x00000480, 0x00000481, 0x00000480, -0x0000048a, 0x0000048b, 0x0000048a, -0x0000048c, 0x0000048d, 0x0000048c, -0x0000048e, 0x0000048f, 0x0000048e, -0x00000490, 0x00000491, 0x00000490, -0x00000492, 0x00000493, 0x00000492, -0x00000494, 0x00000495, 0x00000494, -0x00000496, 0x00000497, 0x00000496, -0x00000498, 0x00000499, 0x00000498, -0x0000049a, 0x0000049b, 0x0000049a, -0x0000049c, 0x0000049d, 0x0000049c, -0x0000049e, 0x0000049f, 0x0000049e, -0x000004a0, 0x000004a1, 0x000004a0, -0x000004a2, 0x000004a3, 0x000004a2, -0x000004a4, 0x000004a5, 0x000004a4, -0x000004a6, 0x000004a7, 0x000004a6, -0x000004a8, 0x000004a9, 0x000004a8, -0x000004aa, 0x000004ab, 0x000004aa, -0x000004ac, 0x000004ad, 0x000004ac, -0x000004ae, 0x000004af, 0x000004ae, -0x000004b0, 0x000004b1, 0x000004b0, -0x000004b2, 0x000004b3, 0x000004b2, -0x000004b4, 0x000004b5, 0x000004b4, -0x000004b6, 0x000004b7, 0x000004b6, -0x000004b8, 0x000004b9, 0x000004b8, -0x000004ba, 0x000004bb, 0x000004ba, -0x000004bc, 0x000004bd, 0x000004bc, -0x000004be, 0x000004bf, 0x000004be, -0x000004c1, 0x000004c2, 0x000004c1, -0x000004c3, 0x000004c4, 0x000004c3, -0x000004c5, 0x000004c6, 0x000004c5, -0x000004c7, 0x000004c8, 0x000004c7, -0x000004c9, 0x000004ca, 0x000004c9, -0x000004cb, 0x000004cc, 0x000004cb, -0x000004cd, 0x000004ce, 0x000004cd, -0x000004d0, 0x000004d1, 0x000004d0, -0x000004d2, 0x000004d3, 0x000004d2, -0x000004d4, 0x000004d5, 0x000004d4, -0x000004d6, 0x000004d7, 0x000004d6, -0x000004d8, 0x000004d9, 0x000004d8, -0x000004da, 0x000004db, 0x000004da, -0x000004dc, 0x000004dd, 0x000004dc, -0x000004de, 0x000004df, 0x000004de, -0x000004e0, 0x000004e1, 0x000004e0, -0x000004e2, 0x000004e3, 0x000004e2, -0x000004e4, 0x000004e5, 0x000004e4, -0x000004e6, 0x000004e7, 0x000004e6, -0x000004e8, 0x000004e9, 0x000004e8, -0x000004ea, 0x000004eb, 0x000004ea, -0x000004ec, 0x000004ed, 0x000004ec, -0x000004ee, 0x000004ef, 0x000004ee, -0x000004f0, 0x000004f1, 0x000004f0, -0x000004f2, 0x000004f3, 0x000004f2, -0x000004f4, 0x000004f5, 0x000004f4, -0x000004f8, 0x000004f9, 0x000004f8, -0x00000500, 0x00000501, 0x00000500, -0x00000502, 0x00000503, 0x00000502, -0x00000504, 0x00000505, 0x00000504, -0x00000506, 0x00000507, 0x00000506, -0x00000508, 0x00000509, 0x00000508, -0x0000050a, 0x0000050b, 0x0000050a, -0x0000050c, 0x0000050d, 0x0000050c, -0x0000050e, 0x0000050f, 0x0000050e, -0x00000531, 0x00000561, 0x00000531, -0x00000532, 0x00000562, 0x00000532, -0x00000533, 0x00000563, 0x00000533, -0x00000534, 0x00000564, 0x00000534, -0x00000535, 0x00000565, 0x00000535, -0x00000536, 0x00000566, 0x00000536, -0x00000537, 0x00000567, 0x00000537, -0x00000538, 0x00000568, 0x00000538, -0x00000539, 0x00000569, 0x00000539, -0x0000053a, 0x0000056a, 0x0000053a, -0x0000053b, 0x0000056b, 0x0000053b, -0x0000053c, 0x0000056c, 0x0000053c, -0x0000053d, 0x0000056d, 0x0000053d, -0x0000053e, 0x0000056e, 0x0000053e, -0x0000053f, 0x0000056f, 0x0000053f, -0x00000540, 0x00000570, 0x00000540, -0x00000541, 0x00000571, 0x00000541, -0x00000542, 0x00000572, 0x00000542, -0x00000543, 0x00000573, 0x00000543, -0x00000544, 0x00000574, 0x00000544, -0x00000545, 0x00000575, 0x00000545, -0x00000546, 0x00000576, 0x00000546, -0x00000547, 0x00000577, 0x00000547, -0x00000548, 0x00000578, 0x00000548, -0x00000549, 0x00000579, 0x00000549, -0x0000054a, 0x0000057a, 0x0000054a, -0x0000054b, 0x0000057b, 0x0000054b, -0x0000054c, 0x0000057c, 0x0000054c, -0x0000054d, 0x0000057d, 0x0000054d, -0x0000054e, 0x0000057e, 0x0000054e, -0x0000054f, 0x0000057f, 0x0000054f, -0x00000550, 0x00000580, 0x00000550, -0x00000551, 0x00000581, 0x00000551, -0x00000552, 0x00000582, 0x00000552, -0x00000553, 0x00000583, 0x00000553, -0x00000554, 0x00000584, 0x00000554, -0x00000555, 0x00000585, 0x00000555, -0x00000556, 0x00000586, 0x00000556, -0x00001e00, 0x00001e01, 0x00001e00, -0x00001e02, 0x00001e03, 0x00001e02, -0x00001e04, 0x00001e05, 0x00001e04, -0x00001e06, 0x00001e07, 0x00001e06, -0x00001e08, 0x00001e09, 0x00001e08, -0x00001e0a, 0x00001e0b, 0x00001e0a, -0x00001e0c, 0x00001e0d, 0x00001e0c, -0x00001e0e, 0x00001e0f, 0x00001e0e, -0x00001e10, 0x00001e11, 0x00001e10, -0x00001e12, 0x00001e13, 0x00001e12, -0x00001e14, 0x00001e15, 0x00001e14, -0x00001e16, 0x00001e17, 0x00001e16, -0x00001e18, 0x00001e19, 0x00001e18, -0x00001e1a, 0x00001e1b, 0x00001e1a, -0x00001e1c, 0x00001e1d, 0x00001e1c, -0x00001e1e, 0x00001e1f, 0x00001e1e, -0x00001e20, 0x00001e21, 0x00001e20, -0x00001e22, 0x00001e23, 0x00001e22, -0x00001e24, 0x00001e25, 0x00001e24, -0x00001e26, 0x00001e27, 0x00001e26, -0x00001e28, 0x00001e29, 0x00001e28, -0x00001e2a, 0x00001e2b, 0x00001e2a, -0x00001e2c, 0x00001e2d, 0x00001e2c, -0x00001e2e, 0x00001e2f, 0x00001e2e, -0x00001e30, 0x00001e31, 0x00001e30, -0x00001e32, 0x00001e33, 0x00001e32, -0x00001e34, 0x00001e35, 0x00001e34, -0x00001e36, 0x00001e37, 0x00001e36, -0x00001e38, 0x00001e39, 0x00001e38, -0x00001e3a, 0x00001e3b, 0x00001e3a, -0x00001e3c, 0x00001e3d, 0x00001e3c, -0x00001e3e, 0x00001e3f, 0x00001e3e, -0x00001e40, 0x00001e41, 0x00001e40, -0x00001e42, 0x00001e43, 0x00001e42, -0x00001e44, 0x00001e45, 0x00001e44, -0x00001e46, 0x00001e47, 0x00001e46, -0x00001e48, 0x00001e49, 0x00001e48, -0x00001e4a, 0x00001e4b, 0x00001e4a, -0x00001e4c, 0x00001e4d, 0x00001e4c, -0x00001e4e, 0x00001e4f, 0x00001e4e, -0x00001e50, 0x00001e51, 0x00001e50, -0x00001e52, 0x00001e53, 0x00001e52, -0x00001e54, 0x00001e55, 0x00001e54, -0x00001e56, 0x00001e57, 0x00001e56, -0x00001e58, 0x00001e59, 0x00001e58, -0x00001e5a, 0x00001e5b, 0x00001e5a, -0x00001e5c, 0x00001e5d, 0x00001e5c, -0x00001e5e, 0x00001e5f, 0x00001e5e, -0x00001e60, 0x00001e61, 0x00001e60, -0x00001e62, 0x00001e63, 0x00001e62, -0x00001e64, 0x00001e65, 0x00001e64, -0x00001e66, 0x00001e67, 0x00001e66, -0x00001e68, 0x00001e69, 0x00001e68, -0x00001e6a, 0x00001e6b, 0x00001e6a, -0x00001e6c, 0x00001e6d, 0x00001e6c, -0x00001e6e, 0x00001e6f, 0x00001e6e, -0x00001e70, 0x00001e71, 0x00001e70, -0x00001e72, 0x00001e73, 0x00001e72, -0x00001e74, 0x00001e75, 0x00001e74, -0x00001e76, 0x00001e77, 0x00001e76, -0x00001e78, 0x00001e79, 0x00001e78, -0x00001e7a, 0x00001e7b, 0x00001e7a, -0x00001e7c, 0x00001e7d, 0x00001e7c, -0x00001e7e, 0x00001e7f, 0x00001e7e, -0x00001e80, 0x00001e81, 0x00001e80, -0x00001e82, 0x00001e83, 0x00001e82, -0x00001e84, 0x00001e85, 0x00001e84, -0x00001e86, 0x00001e87, 0x00001e86, -0x00001e88, 0x00001e89, 0x00001e88, -0x00001e8a, 0x00001e8b, 0x00001e8a, -0x00001e8c, 0x00001e8d, 0x00001e8c, -0x00001e8e, 0x00001e8f, 0x00001e8e, -0x00001e90, 0x00001e91, 0x00001e90, -0x00001e92, 0x00001e93, 0x00001e92, -0x00001e94, 0x00001e95, 0x00001e94, -0x00001ea0, 0x00001ea1, 0x00001ea0, -0x00001ea2, 0x00001ea3, 0x00001ea2, -0x00001ea4, 0x00001ea5, 0x00001ea4, -0x00001ea6, 0x00001ea7, 0x00001ea6, -0x00001ea8, 0x00001ea9, 0x00001ea8, -0x00001eaa, 0x00001eab, 0x00001eaa, -0x00001eac, 0x00001ead, 0x00001eac, -0x00001eae, 0x00001eaf, 0x00001eae, -0x00001eb0, 0x00001eb1, 0x00001eb0, -0x00001eb2, 0x00001eb3, 0x00001eb2, -0x00001eb4, 0x00001eb5, 0x00001eb4, -0x00001eb6, 0x00001eb7, 0x00001eb6, -0x00001eb8, 0x00001eb9, 0x00001eb8, -0x00001eba, 0x00001ebb, 0x00001eba, -0x00001ebc, 0x00001ebd, 0x00001ebc, -0x00001ebe, 0x00001ebf, 0x00001ebe, -0x00001ec0, 0x00001ec1, 0x00001ec0, -0x00001ec2, 0x00001ec3, 0x00001ec2, -0x00001ec4, 0x00001ec5, 0x00001ec4, -0x00001ec6, 0x00001ec7, 0x00001ec6, -0x00001ec8, 0x00001ec9, 0x00001ec8, -0x00001eca, 0x00001ecb, 0x00001eca, -0x00001ecc, 0x00001ecd, 0x00001ecc, -0x00001ece, 0x00001ecf, 0x00001ece, -0x00001ed0, 0x00001ed1, 0x00001ed0, -0x00001ed2, 0x00001ed3, 0x00001ed2, -0x00001ed4, 0x00001ed5, 0x00001ed4, -0x00001ed6, 0x00001ed7, 0x00001ed6, -0x00001ed8, 0x00001ed9, 0x00001ed8, -0x00001eda, 0x00001edb, 0x00001eda, -0x00001edc, 0x00001edd, 0x00001edc, -0x00001ede, 0x00001edf, 0x00001ede, -0x00001ee0, 0x00001ee1, 0x00001ee0, -0x00001ee2, 0x00001ee3, 0x00001ee2, -0x00001ee4, 0x00001ee5, 0x00001ee4, -0x00001ee6, 0x00001ee7, 0x00001ee6, -0x00001ee8, 0x00001ee9, 0x00001ee8, -0x00001eea, 0x00001eeb, 0x00001eea, -0x00001eec, 0x00001eed, 0x00001eec, -0x00001eee, 0x00001eef, 0x00001eee, -0x00001ef0, 0x00001ef1, 0x00001ef0, -0x00001ef2, 0x00001ef3, 0x00001ef2, -0x00001ef4, 0x00001ef5, 0x00001ef4, -0x00001ef6, 0x00001ef7, 0x00001ef6, -0x00001ef8, 0x00001ef9, 0x00001ef8, -0x00001f08, 0x00001f00, 0x00001f08, -0x00001f09, 0x00001f01, 0x00001f09, -0x00001f0a, 0x00001f02, 0x00001f0a, -0x00001f0b, 0x00001f03, 0x00001f0b, -0x00001f0c, 0x00001f04, 0x00001f0c, -0x00001f0d, 0x00001f05, 0x00001f0d, -0x00001f0e, 0x00001f06, 0x00001f0e, -0x00001f0f, 0x00001f07, 0x00001f0f, -0x00001f18, 0x00001f10, 0x00001f18, -0x00001f19, 0x00001f11, 0x00001f19, -0x00001f1a, 0x00001f12, 0x00001f1a, -0x00001f1b, 0x00001f13, 0x00001f1b, -0x00001f1c, 0x00001f14, 0x00001f1c, -0x00001f1d, 0x00001f15, 0x00001f1d, -0x00001f28, 0x00001f20, 0x00001f28, -0x00001f29, 0x00001f21, 0x00001f29, -0x00001f2a, 0x00001f22, 0x00001f2a, -0x00001f2b, 0x00001f23, 0x00001f2b, -0x00001f2c, 0x00001f24, 0x00001f2c, -0x00001f2d, 0x00001f25, 0x00001f2d, -0x00001f2e, 0x00001f26, 0x00001f2e, -0x00001f2f, 0x00001f27, 0x00001f2f, -0x00001f38, 0x00001f30, 0x00001f38, -0x00001f39, 0x00001f31, 0x00001f39, -0x00001f3a, 0x00001f32, 0x00001f3a, -0x00001f3b, 0x00001f33, 0x00001f3b, -0x00001f3c, 0x00001f34, 0x00001f3c, -0x00001f3d, 0x00001f35, 0x00001f3d, -0x00001f3e, 0x00001f36, 0x00001f3e, -0x00001f3f, 0x00001f37, 0x00001f3f, -0x00001f48, 0x00001f40, 0x00001f48, -0x00001f49, 0x00001f41, 0x00001f49, -0x00001f4a, 0x00001f42, 0x00001f4a, -0x00001f4b, 0x00001f43, 0x00001f4b, -0x00001f4c, 0x00001f44, 0x00001f4c, -0x00001f4d, 0x00001f45, 0x00001f4d, -0x00001f59, 0x00001f51, 0x00001f59, -0x00001f5b, 0x00001f53, 0x00001f5b, -0x00001f5d, 0x00001f55, 0x00001f5d, -0x00001f5f, 0x00001f57, 0x00001f5f, -0x00001f68, 0x00001f60, 0x00001f68, -0x00001f69, 0x00001f61, 0x00001f69, -0x00001f6a, 0x00001f62, 0x00001f6a, -0x00001f6b, 0x00001f63, 0x00001f6b, -0x00001f6c, 0x00001f64, 0x00001f6c, -0x00001f6d, 0x00001f65, 0x00001f6d, -0x00001f6e, 0x00001f66, 0x00001f6e, -0x00001f6f, 0x00001f67, 0x00001f6f, -0x00001f88, 0x00001f80, 0x00001f88, -0x00001f89, 0x00001f81, 0x00001f89, -0x00001f8a, 0x00001f82, 0x00001f8a, -0x00001f8b, 0x00001f83, 0x00001f8b, -0x00001f8c, 0x00001f84, 0x00001f8c, -0x00001f8d, 0x00001f85, 0x00001f8d, -0x00001f8e, 0x00001f86, 0x00001f8e, -0x00001f8f, 0x00001f87, 0x00001f8f, -0x00001f98, 0x00001f90, 0x00001f98, -0x00001f99, 0x00001f91, 0x00001f99, -0x00001f9a, 0x00001f92, 0x00001f9a, -0x00001f9b, 0x00001f93, 0x00001f9b, -0x00001f9c, 0x00001f94, 0x00001f9c, -0x00001f9d, 0x00001f95, 0x00001f9d, -0x00001f9e, 0x00001f96, 0x00001f9e, -0x00001f9f, 0x00001f97, 0x00001f9f, -0x00001fa8, 0x00001fa0, 0x00001fa8, -0x00001fa9, 0x00001fa1, 0x00001fa9, -0x00001faa, 0x00001fa2, 0x00001faa, -0x00001fab, 0x00001fa3, 0x00001fab, -0x00001fac, 0x00001fa4, 0x00001fac, -0x00001fad, 0x00001fa5, 0x00001fad, -0x00001fae, 0x00001fa6, 0x00001fae, -0x00001faf, 0x00001fa7, 0x00001faf, -0x00001fb8, 0x00001fb0, 0x00001fb8, -0x00001fb9, 0x00001fb1, 0x00001fb9, -0x00001fba, 0x00001f70, 0x00001fba, -0x00001fbb, 0x00001f71, 0x00001fbb, -0x00001fbc, 0x00001fb3, 0x00001fbc, -0x00001fc8, 0x00001f72, 0x00001fc8, -0x00001fc9, 0x00001f73, 0x00001fc9, -0x00001fca, 0x00001f74, 0x00001fca, -0x00001fcb, 0x00001f75, 0x00001fcb, -0x00001fcc, 0x00001fc3, 0x00001fcc, -0x00001fd8, 0x00001fd0, 0x00001fd8, -0x00001fd9, 0x00001fd1, 0x00001fd9, -0x00001fda, 0x00001f76, 0x00001fda, -0x00001fdb, 0x00001f77, 0x00001fdb, -0x00001fe8, 0x00001fe0, 0x00001fe8, -0x00001fe9, 0x00001fe1, 0x00001fe9, -0x00001fea, 0x00001f7a, 0x00001fea, -0x00001feb, 0x00001f7b, 0x00001feb, -0x00001fec, 0x00001fe5, 0x00001fec, -0x00001ff8, 0x00001f78, 0x00001ff8, -0x00001ff9, 0x00001f79, 0x00001ff9, -0x00001ffa, 0x00001f7c, 0x00001ffa, -0x00001ffb, 0x00001f7d, 0x00001ffb, -0x00001ffc, 0x00001ff3, 0x00001ffc, -0x00002126, 0x000003c9, 0x00002126, -0x0000212a, 0x0000006b, 0x0000212a, -0x0000212b, 0x000000e5, 0x0000212b, -0x00002160, 0x00002170, 0x00002160, -0x00002161, 0x00002171, 0x00002161, -0x00002162, 0x00002172, 0x00002162, -0x00002163, 0x00002173, 0x00002163, -0x00002164, 0x00002174, 0x00002164, -0x00002165, 0x00002175, 0x00002165, -0x00002166, 0x00002176, 0x00002166, -0x00002167, 0x00002177, 0x00002167, -0x00002168, 0x00002178, 0x00002168, -0x00002169, 0x00002179, 0x00002169, -0x0000216a, 0x0000217a, 0x0000216a, -0x0000216b, 0x0000217b, 0x0000216b, -0x0000216c, 0x0000217c, 0x0000216c, -0x0000216d, 0x0000217d, 0x0000216d, -0x0000216e, 0x0000217e, 0x0000216e, -0x0000216f, 0x0000217f, 0x0000216f, -0x000024b6, 0x000024d0, 0x000024b6, -0x000024b7, 0x000024d1, 0x000024b7, -0x000024b8, 0x000024d2, 0x000024b8, -0x000024b9, 0x000024d3, 0x000024b9, -0x000024ba, 0x000024d4, 0x000024ba, -0x000024bb, 0x000024d5, 0x000024bb, -0x000024bc, 0x000024d6, 0x000024bc, -0x000024bd, 0x000024d7, 0x000024bd, -0x000024be, 0x000024d8, 0x000024be, -0x000024bf, 0x000024d9, 0x000024bf, -0x000024c0, 0x000024da, 0x000024c0, -0x000024c1, 0x000024db, 0x000024c1, -0x000024c2, 0x000024dc, 0x000024c2, -0x000024c3, 0x000024dd, 0x000024c3, -0x000024c4, 0x000024de, 0x000024c4, -0x000024c5, 0x000024df, 0x000024c5, -0x000024c6, 0x000024e0, 0x000024c6, -0x000024c7, 0x000024e1, 0x000024c7, -0x000024c8, 0x000024e2, 0x000024c8, -0x000024c9, 0x000024e3, 0x000024c9, -0x000024ca, 0x000024e4, 0x000024ca, -0x000024cb, 0x000024e5, 0x000024cb, -0x000024cc, 0x000024e6, 0x000024cc, -0x000024cd, 0x000024e7, 0x000024cd, -0x000024ce, 0x000024e8, 0x000024ce, -0x000024cf, 0x000024e9, 0x000024cf, -0x0000ff21, 0x0000ff41, 0x0000ff21, -0x0000ff22, 0x0000ff42, 0x0000ff22, -0x0000ff23, 0x0000ff43, 0x0000ff23, -0x0000ff24, 0x0000ff44, 0x0000ff24, -0x0000ff25, 0x0000ff45, 0x0000ff25, -0x0000ff26, 0x0000ff46, 0x0000ff26, -0x0000ff27, 0x0000ff47, 0x0000ff27, -0x0000ff28, 0x0000ff48, 0x0000ff28, -0x0000ff29, 0x0000ff49, 0x0000ff29, -0x0000ff2a, 0x0000ff4a, 0x0000ff2a, -0x0000ff2b, 0x0000ff4b, 0x0000ff2b, -0x0000ff2c, 0x0000ff4c, 0x0000ff2c, -0x0000ff2d, 0x0000ff4d, 0x0000ff2d, -0x0000ff2e, 0x0000ff4e, 0x0000ff2e, -0x0000ff2f, 0x0000ff4f, 0x0000ff2f, -0x0000ff30, 0x0000ff50, 0x0000ff30, -0x0000ff31, 0x0000ff51, 0x0000ff31, -0x0000ff32, 0x0000ff52, 0x0000ff32, -0x0000ff33, 0x0000ff53, 0x0000ff33, -0x0000ff34, 0x0000ff54, 0x0000ff34, -0x0000ff35, 0x0000ff55, 0x0000ff35, -0x0000ff36, 0x0000ff56, 0x0000ff36, -0x0000ff37, 0x0000ff57, 0x0000ff37, -0x0000ff38, 0x0000ff58, 0x0000ff38, -0x0000ff39, 0x0000ff59, 0x0000ff39, -0x0000ff3a, 0x0000ff5a, 0x0000ff3a, -0x00010400, 0x00010428, 0x00010400, -0x00010401, 0x00010429, 0x00010401, -0x00010402, 0x0001042a, 0x00010402, -0x00010403, 0x0001042b, 0x00010403, -0x00010404, 0x0001042c, 0x00010404, -0x00010405, 0x0001042d, 0x00010405, -0x00010406, 0x0001042e, 0x00010406, -0x00010407, 0x0001042f, 0x00010407, -0x00010408, 0x00010430, 0x00010408, -0x00010409, 0x00010431, 0x00010409, -0x0001040a, 0x00010432, 0x0001040a, -0x0001040b, 0x00010433, 0x0001040b, -0x0001040c, 0x00010434, 0x0001040c, -0x0001040d, 0x00010435, 0x0001040d, -0x0001040e, 0x00010436, 0x0001040e, -0x0001040f, 0x00010437, 0x0001040f, -0x00010410, 0x00010438, 0x00010410, -0x00010411, 0x00010439, 0x00010411, -0x00010412, 0x0001043a, 0x00010412, -0x00010413, 0x0001043b, 0x00010413, -0x00010414, 0x0001043c, 0x00010414, -0x00010415, 0x0001043d, 0x00010415, -0x00010416, 0x0001043e, 0x00010416, -0x00010417, 0x0001043f, 0x00010417, -0x00010418, 0x00010440, 0x00010418, -0x00010419, 0x00010441, 0x00010419, -0x0001041a, 0x00010442, 0x0001041a, -0x0001041b, 0x00010443, 0x0001041b, -0x0001041c, 0x00010444, 0x0001041c, -0x0001041d, 0x00010445, 0x0001041d, -0x0001041e, 0x00010446, 0x0001041e, -0x0001041f, 0x00010447, 0x0001041f, -0x00010420, 0x00010448, 0x00010420, -0x00010421, 0x00010449, 0x00010421, -0x00010422, 0x0001044a, 0x00010422, -0x00010423, 0x0001044b, 0x00010423, -0x00010424, 0x0001044c, 0x00010424, -0x00010425, 0x0001044d, 0x00010425, -/* lower */ -0x00000061, 0x00000041, 0x00000041, -0x00000062, 0x00000042, 0x00000042, -0x00000063, 0x00000043, 0x00000043, -0x00000064, 0x00000044, 0x00000044, -0x00000065, 0x00000045, 0x00000045, -0x00000066, 0x00000046, 0x00000046, -0x00000067, 0x00000047, 0x00000047, -0x00000068, 0x00000048, 0x00000048, -0x00000069, 0x00000049, 0x00000049, -0x0000006a, 0x0000004a, 0x0000004a, -0x0000006b, 0x0000004b, 0x0000004b, -0x0000006c, 0x0000004c, 0x0000004c, -0x0000006d, 0x0000004d, 0x0000004d, -0x0000006e, 0x0000004e, 0x0000004e, -0x0000006f, 0x0000004f, 0x0000004f, -0x00000070, 0x00000050, 0x00000050, -0x00000071, 0x00000051, 0x00000051, -0x00000072, 0x00000052, 0x00000052, -0x00000073, 0x00000053, 0x00000053, -0x00000074, 0x00000054, 0x00000054, -0x00000075, 0x00000055, 0x00000055, -0x00000076, 0x00000056, 0x00000056, -0x00000077, 0x00000057, 0x00000057, -0x00000078, 0x00000058, 0x00000058, -0x00000079, 0x00000059, 0x00000059, -0x0000007a, 0x0000005a, 0x0000005a, -0x000000b5, 0x0000039c, 0x0000039c, -0x000000e0, 0x000000c0, 0x000000c0, -0x000000e1, 0x000000c1, 0x000000c1, -0x000000e2, 0x000000c2, 0x000000c2, -0x000000e3, 0x000000c3, 0x000000c3, -0x000000e4, 0x000000c4, 0x000000c4, -0x000000e5, 0x000000c5, 0x000000c5, -0x000000e6, 0x000000c6, 0x000000c6, -0x000000e7, 0x000000c7, 0x000000c7, -0x000000e8, 0x000000c8, 0x000000c8, -0x000000e9, 0x000000c9, 0x000000c9, -0x000000ea, 0x000000ca, 0x000000ca, -0x000000eb, 0x000000cb, 0x000000cb, -0x000000ec, 0x000000cc, 0x000000cc, -0x000000ed, 0x000000cd, 0x000000cd, -0x000000ee, 0x000000ce, 0x000000ce, -0x000000ef, 0x000000cf, 0x000000cf, -0x000000f0, 0x000000d0, 0x000000d0, -0x000000f1, 0x000000d1, 0x000000d1, -0x000000f2, 0x000000d2, 0x000000d2, -0x000000f3, 0x000000d3, 0x000000d3, -0x000000f4, 0x000000d4, 0x000000d4, -0x000000f5, 0x000000d5, 0x000000d5, -0x000000f6, 0x000000d6, 0x000000d6, -0x000000f8, 0x000000d8, 0x000000d8, -0x000000f9, 0x000000d9, 0x000000d9, -0x000000fa, 0x000000da, 0x000000da, -0x000000fb, 0x000000db, 0x000000db, -0x000000fc, 0x000000dc, 0x000000dc, -0x000000fd, 0x000000dd, 0x000000dd, -0x000000fe, 0x000000de, 0x000000de, -0x000000ff, 0x00000178, 0x00000178, -0x00000101, 0x00000100, 0x00000100, -0x00000103, 0x00000102, 0x00000102, -0x00000105, 0x00000104, 0x00000104, -0x00000107, 0x00000106, 0x00000106, -0x00000109, 0x00000108, 0x00000108, -0x0000010b, 0x0000010a, 0x0000010a, -0x0000010d, 0x0000010c, 0x0000010c, -0x0000010f, 0x0000010e, 0x0000010e, -0x00000111, 0x00000110, 0x00000110, -0x00000113, 0x00000112, 0x00000112, -0x00000115, 0x00000114, 0x00000114, -0x00000117, 0x00000116, 0x00000116, -0x00000119, 0x00000118, 0x00000118, -0x0000011b, 0x0000011a, 0x0000011a, -0x0000011d, 0x0000011c, 0x0000011c, -0x0000011f, 0x0000011e, 0x0000011e, -0x00000121, 0x00000120, 0x00000120, -0x00000123, 0x00000122, 0x00000122, -0x00000125, 0x00000124, 0x00000124, -0x00000127, 0x00000126, 0x00000126, -0x00000129, 0x00000128, 0x00000128, -0x0000012b, 0x0000012a, 0x0000012a, -0x0000012d, 0x0000012c, 0x0000012c, -0x0000012f, 0x0000012e, 0x0000012e, -0x00000131, 0x00000049, 0x00000049, -0x00000133, 0x00000132, 0x00000132, -0x00000135, 0x00000134, 0x00000134, -0x00000137, 0x00000136, 0x00000136, -0x0000013a, 0x00000139, 0x00000139, -0x0000013c, 0x0000013b, 0x0000013b, -0x0000013e, 0x0000013d, 0x0000013d, -0x00000140, 0x0000013f, 0x0000013f, -0x00000142, 0x00000141, 0x00000141, -0x00000144, 0x00000143, 0x00000143, -0x00000146, 0x00000145, 0x00000145, -0x00000148, 0x00000147, 0x00000147, -0x0000014b, 0x0000014a, 0x0000014a, -0x0000014d, 0x0000014c, 0x0000014c, -0x0000014f, 0x0000014e, 0x0000014e, -0x00000151, 0x00000150, 0x00000150, -0x00000153, 0x00000152, 0x00000152, -0x00000155, 0x00000154, 0x00000154, -0x00000157, 0x00000156, 0x00000156, -0x00000159, 0x00000158, 0x00000158, -0x0000015b, 0x0000015a, 0x0000015a, -0x0000015d, 0x0000015c, 0x0000015c, -0x0000015f, 0x0000015e, 0x0000015e, -0x00000161, 0x00000160, 0x00000160, -0x00000163, 0x00000162, 0x00000162, -0x00000165, 0x00000164, 0x00000164, -0x00000167, 0x00000166, 0x00000166, -0x00000169, 0x00000168, 0x00000168, -0x0000016b, 0x0000016a, 0x0000016a, -0x0000016d, 0x0000016c, 0x0000016c, -0x0000016f, 0x0000016e, 0x0000016e, -0x00000171, 0x00000170, 0x00000170, -0x00000173, 0x00000172, 0x00000172, -0x00000175, 0x00000174, 0x00000174, -0x00000177, 0x00000176, 0x00000176, -0x0000017a, 0x00000179, 0x00000179, -0x0000017c, 0x0000017b, 0x0000017b, -0x0000017e, 0x0000017d, 0x0000017d, -0x0000017f, 0x00000053, 0x00000053, -0x00000183, 0x00000182, 0x00000182, -0x00000185, 0x00000184, 0x00000184, -0x00000188, 0x00000187, 0x00000187, -0x0000018c, 0x0000018b, 0x0000018b, -0x00000192, 0x00000191, 0x00000191, -0x00000195, 0x000001f6, 0x000001f6, -0x00000199, 0x00000198, 0x00000198, -0x0000019e, 0x00000220, 0x00000220, -0x000001a1, 0x000001a0, 0x000001a0, -0x000001a3, 0x000001a2, 0x000001a2, -0x000001a5, 0x000001a4, 0x000001a4, -0x000001a8, 0x000001a7, 0x000001a7, -0x000001ad, 0x000001ac, 0x000001ac, -0x000001b0, 0x000001af, 0x000001af, -0x000001b4, 0x000001b3, 0x000001b3, -0x000001b6, 0x000001b5, 0x000001b5, -0x000001b9, 0x000001b8, 0x000001b8, -0x000001bd, 0x000001bc, 0x000001bc, -0x000001bf, 0x000001f7, 0x000001f7, -0x000001c6, 0x000001c4, 0x000001c5, -0x000001c9, 0x000001c7, 0x000001c8, -0x000001cc, 0x000001ca, 0x000001cb, -0x000001ce, 0x000001cd, 0x000001cd, -0x000001d0, 0x000001cf, 0x000001cf, -0x000001d2, 0x000001d1, 0x000001d1, -0x000001d4, 0x000001d3, 0x000001d3, -0x000001d6, 0x000001d5, 0x000001d5, -0x000001d8, 0x000001d7, 0x000001d7, -0x000001da, 0x000001d9, 0x000001d9, -0x000001dc, 0x000001db, 0x000001db, -0x000001dd, 0x0000018e, 0x0000018e, -0x000001df, 0x000001de, 0x000001de, -0x000001e1, 0x000001e0, 0x000001e0, -0x000001e3, 0x000001e2, 0x000001e2, -0x000001e5, 0x000001e4, 0x000001e4, -0x000001e7, 0x000001e6, 0x000001e6, -0x000001e9, 0x000001e8, 0x000001e8, -0x000001eb, 0x000001ea, 0x000001ea, -0x000001ed, 0x000001ec, 0x000001ec, -0x000001ef, 0x000001ee, 0x000001ee, -0x000001f3, 0x000001f1, 0x000001f2, -0x000001f5, 0x000001f4, 0x000001f4, -0x000001f9, 0x000001f8, 0x000001f8, -0x000001fb, 0x000001fa, 0x000001fa, -0x000001fd, 0x000001fc, 0x000001fc, -0x000001ff, 0x000001fe, 0x000001fe, -0x00000201, 0x00000200, 0x00000200, -0x00000203, 0x00000202, 0x00000202, -0x00000205, 0x00000204, 0x00000204, -0x00000207, 0x00000206, 0x00000206, -0x00000209, 0x00000208, 0x00000208, -0x0000020b, 0x0000020a, 0x0000020a, -0x0000020d, 0x0000020c, 0x0000020c, -0x0000020f, 0x0000020e, 0x0000020e, -0x00000211, 0x00000210, 0x00000210, -0x00000213, 0x00000212, 0x00000212, -0x00000215, 0x00000214, 0x00000214, -0x00000217, 0x00000216, 0x00000216, -0x00000219, 0x00000218, 0x00000218, -0x0000021b, 0x0000021a, 0x0000021a, -0x0000021d, 0x0000021c, 0x0000021c, -0x0000021f, 0x0000021e, 0x0000021e, -0x00000223, 0x00000222, 0x00000222, -0x00000225, 0x00000224, 0x00000224, -0x00000227, 0x00000226, 0x00000226, -0x00000229, 0x00000228, 0x00000228, -0x0000022b, 0x0000022a, 0x0000022a, -0x0000022d, 0x0000022c, 0x0000022c, -0x0000022f, 0x0000022e, 0x0000022e, -0x00000231, 0x00000230, 0x00000230, -0x00000233, 0x00000232, 0x00000232, -0x00000253, 0x00000181, 0x00000181, -0x00000254, 0x00000186, 0x00000186, -0x00000256, 0x00000189, 0x00000189, -0x00000257, 0x0000018a, 0x0000018a, -0x00000259, 0x0000018f, 0x0000018f, -0x0000025b, 0x00000190, 0x00000190, -0x00000260, 0x00000193, 0x00000193, -0x00000263, 0x00000194, 0x00000194, -0x00000268, 0x00000197, 0x00000197, -0x00000269, 0x00000196, 0x00000196, -0x0000026f, 0x0000019c, 0x0000019c, -0x00000272, 0x0000019d, 0x0000019d, -0x00000275, 0x0000019f, 0x0000019f, -0x00000280, 0x000001a6, 0x000001a6, -0x00000283, 0x000001a9, 0x000001a9, -0x00000288, 0x000001ae, 0x000001ae, -0x0000028a, 0x000001b1, 0x000001b1, -0x0000028b, 0x000001b2, 0x000001b2, -0x00000292, 0x000001b7, 0x000001b7, -0x00000345, 0x00000399, 0x00000399, -0x000003ac, 0x00000386, 0x00000386, -0x000003ad, 0x00000388, 0x00000388, -0x000003ae, 0x00000389, 0x00000389, -0x000003af, 0x0000038a, 0x0000038a, -0x000003b1, 0x00000391, 0x00000391, -0x000003b2, 0x00000392, 0x00000392, -0x000003b3, 0x00000393, 0x00000393, -0x000003b4, 0x00000394, 0x00000394, -0x000003b5, 0x00000395, 0x00000395, -0x000003b6, 0x00000396, 0x00000396, -0x000003b7, 0x00000397, 0x00000397, -0x000003b8, 0x00000398, 0x00000398, -0x000003b9, 0x00000399, 0x00000399, -0x000003ba, 0x0000039a, 0x0000039a, -0x000003bb, 0x0000039b, 0x0000039b, -0x000003bc, 0x0000039c, 0x0000039c, -0x000003bd, 0x0000039d, 0x0000039d, -0x000003be, 0x0000039e, 0x0000039e, -0x000003bf, 0x0000039f, 0x0000039f, -0x000003c0, 0x000003a0, 0x000003a0, -0x000003c1, 0x000003a1, 0x000003a1, -0x000003c2, 0x000003a3, 0x000003a3, -0x000003c3, 0x000003a3, 0x000003a3, -0x000003c4, 0x000003a4, 0x000003a4, -0x000003c5, 0x000003a5, 0x000003a5, -0x000003c6, 0x000003a6, 0x000003a6, -0x000003c7, 0x000003a7, 0x000003a7, -0x000003c8, 0x000003a8, 0x000003a8, -0x000003c9, 0x000003a9, 0x000003a9, -0x000003ca, 0x000003aa, 0x000003aa, -0x000003cb, 0x000003ab, 0x000003ab, -0x000003cc, 0x0000038c, 0x0000038c, -0x000003cd, 0x0000038e, 0x0000038e, -0x000003ce, 0x0000038f, 0x0000038f, -0x000003d0, 0x00000392, 0x00000392, -0x000003d1, 0x00000398, 0x00000398, -0x000003d5, 0x000003a6, 0x000003a6, -0x000003d6, 0x000003a0, 0x000003a0, -0x000003d9, 0x000003d8, 0x000003d8, -0x000003db, 0x000003da, 0x000003da, -0x000003dd, 0x000003dc, 0x000003dc, -0x000003df, 0x000003de, 0x000003de, -0x000003e1, 0x000003e0, 0x000003e0, -0x000003e3, 0x000003e2, 0x000003e2, -0x000003e5, 0x000003e4, 0x000003e4, -0x000003e7, 0x000003e6, 0x000003e6, -0x000003e9, 0x000003e8, 0x000003e8, -0x000003eb, 0x000003ea, 0x000003ea, -0x000003ed, 0x000003ec, 0x000003ec, -0x000003ef, 0x000003ee, 0x000003ee, -0x000003f0, 0x0000039a, 0x0000039a, -0x000003f1, 0x000003a1, 0x000003a1, -0x000003f2, 0x000003a3, 0x000003a3, -0x000003f5, 0x00000395, 0x00000395, -0x00000430, 0x00000410, 0x00000410, -0x00000431, 0x00000411, 0x00000411, -0x00000432, 0x00000412, 0x00000412, -0x00000433, 0x00000413, 0x00000413, -0x00000434, 0x00000414, 0x00000414, -0x00000435, 0x00000415, 0x00000415, -0x00000436, 0x00000416, 0x00000416, -0x00000437, 0x00000417, 0x00000417, -0x00000438, 0x00000418, 0x00000418, -0x00000439, 0x00000419, 0x00000419, -0x0000043a, 0x0000041a, 0x0000041a, -0x0000043b, 0x0000041b, 0x0000041b, -0x0000043c, 0x0000041c, 0x0000041c, -0x0000043d, 0x0000041d, 0x0000041d, -0x0000043e, 0x0000041e, 0x0000041e, -0x0000043f, 0x0000041f, 0x0000041f, -0x00000440, 0x00000420, 0x00000420, -0x00000441, 0x00000421, 0x00000421, -0x00000442, 0x00000422, 0x00000422, -0x00000443, 0x00000423, 0x00000423, -0x00000444, 0x00000424, 0x00000424, -0x00000445, 0x00000425, 0x00000425, -0x00000446, 0x00000426, 0x00000426, -0x00000447, 0x00000427, 0x00000427, -0x00000448, 0x00000428, 0x00000428, -0x00000449, 0x00000429, 0x00000429, -0x0000044a, 0x0000042a, 0x0000042a, -0x0000044b, 0x0000042b, 0x0000042b, -0x0000044c, 0x0000042c, 0x0000042c, -0x0000044d, 0x0000042d, 0x0000042d, -0x0000044e, 0x0000042e, 0x0000042e, -0x0000044f, 0x0000042f, 0x0000042f, -0x00000450, 0x00000400, 0x00000400, -0x00000451, 0x00000401, 0x00000401, -0x00000452, 0x00000402, 0x00000402, -0x00000453, 0x00000403, 0x00000403, -0x00000454, 0x00000404, 0x00000404, -0x00000455, 0x00000405, 0x00000405, -0x00000456, 0x00000406, 0x00000406, -0x00000457, 0x00000407, 0x00000407, -0x00000458, 0x00000408, 0x00000408, -0x00000459, 0x00000409, 0x00000409, -0x0000045a, 0x0000040a, 0x0000040a, -0x0000045b, 0x0000040b, 0x0000040b, -0x0000045c, 0x0000040c, 0x0000040c, -0x0000045d, 0x0000040d, 0x0000040d, -0x0000045e, 0x0000040e, 0x0000040e, -0x0000045f, 0x0000040f, 0x0000040f, -0x00000461, 0x00000460, 0x00000460, -0x00000463, 0x00000462, 0x00000462, -0x00000465, 0x00000464, 0x00000464, -0x00000467, 0x00000466, 0x00000466, -0x00000469, 0x00000468, 0x00000468, -0x0000046b, 0x0000046a, 0x0000046a, -0x0000046d, 0x0000046c, 0x0000046c, -0x0000046f, 0x0000046e, 0x0000046e, -0x00000471, 0x00000470, 0x00000470, -0x00000473, 0x00000472, 0x00000472, -0x00000475, 0x00000474, 0x00000474, -0x00000477, 0x00000476, 0x00000476, -0x00000479, 0x00000478, 0x00000478, -0x0000047b, 0x0000047a, 0x0000047a, -0x0000047d, 0x0000047c, 0x0000047c, -0x0000047f, 0x0000047e, 0x0000047e, -0x00000481, 0x00000480, 0x00000480, -0x0000048b, 0x0000048a, 0x0000048a, -0x0000048d, 0x0000048c, 0x0000048c, -0x0000048f, 0x0000048e, 0x0000048e, -0x00000491, 0x00000490, 0x00000490, -0x00000493, 0x00000492, 0x00000492, -0x00000495, 0x00000494, 0x00000494, -0x00000497, 0x00000496, 0x00000496, -0x00000499, 0x00000498, 0x00000498, -0x0000049b, 0x0000049a, 0x0000049a, -0x0000049d, 0x0000049c, 0x0000049c, -0x0000049f, 0x0000049e, 0x0000049e, -0x000004a1, 0x000004a0, 0x000004a0, -0x000004a3, 0x000004a2, 0x000004a2, -0x000004a5, 0x000004a4, 0x000004a4, -0x000004a7, 0x000004a6, 0x000004a6, -0x000004a9, 0x000004a8, 0x000004a8, -0x000004ab, 0x000004aa, 0x000004aa, -0x000004ad, 0x000004ac, 0x000004ac, -0x000004af, 0x000004ae, 0x000004ae, -0x000004b1, 0x000004b0, 0x000004b0, -0x000004b3, 0x000004b2, 0x000004b2, -0x000004b5, 0x000004b4, 0x000004b4, -0x000004b7, 0x000004b6, 0x000004b6, -0x000004b9, 0x000004b8, 0x000004b8, -0x000004bb, 0x000004ba, 0x000004ba, -0x000004bd, 0x000004bc, 0x000004bc, -0x000004bf, 0x000004be, 0x000004be, -0x000004c2, 0x000004c1, 0x000004c1, -0x000004c4, 0x000004c3, 0x000004c3, -0x000004c6, 0x000004c5, 0x000004c5, -0x000004c8, 0x000004c7, 0x000004c7, -0x000004ca, 0x000004c9, 0x000004c9, -0x000004cc, 0x000004cb, 0x000004cb, -0x000004ce, 0x000004cd, 0x000004cd, -0x000004d1, 0x000004d0, 0x000004d0, -0x000004d3, 0x000004d2, 0x000004d2, -0x000004d5, 0x000004d4, 0x000004d4, -0x000004d7, 0x000004d6, 0x000004d6, -0x000004d9, 0x000004d8, 0x000004d8, -0x000004db, 0x000004da, 0x000004da, -0x000004dd, 0x000004dc, 0x000004dc, -0x000004df, 0x000004de, 0x000004de, -0x000004e1, 0x000004e0, 0x000004e0, -0x000004e3, 0x000004e2, 0x000004e2, -0x000004e5, 0x000004e4, 0x000004e4, -0x000004e7, 0x000004e6, 0x000004e6, -0x000004e9, 0x000004e8, 0x000004e8, -0x000004eb, 0x000004ea, 0x000004ea, -0x000004ed, 0x000004ec, 0x000004ec, -0x000004ef, 0x000004ee, 0x000004ee, -0x000004f1, 0x000004f0, 0x000004f0, -0x000004f3, 0x000004f2, 0x000004f2, -0x000004f5, 0x000004f4, 0x000004f4, -0x000004f9, 0x000004f8, 0x000004f8, -0x00000501, 0x00000500, 0x00000500, -0x00000503, 0x00000502, 0x00000502, -0x00000505, 0x00000504, 0x00000504, -0x00000507, 0x00000506, 0x00000506, -0x00000509, 0x00000508, 0x00000508, -0x0000050b, 0x0000050a, 0x0000050a, -0x0000050d, 0x0000050c, 0x0000050c, -0x0000050f, 0x0000050e, 0x0000050e, -0x00000561, 0x00000531, 0x00000531, -0x00000562, 0x00000532, 0x00000532, -0x00000563, 0x00000533, 0x00000533, -0x00000564, 0x00000534, 0x00000534, -0x00000565, 0x00000535, 0x00000535, -0x00000566, 0x00000536, 0x00000536, -0x00000567, 0x00000537, 0x00000537, -0x00000568, 0x00000538, 0x00000538, -0x00000569, 0x00000539, 0x00000539, -0x0000056a, 0x0000053a, 0x0000053a, -0x0000056b, 0x0000053b, 0x0000053b, -0x0000056c, 0x0000053c, 0x0000053c, -0x0000056d, 0x0000053d, 0x0000053d, -0x0000056e, 0x0000053e, 0x0000053e, -0x0000056f, 0x0000053f, 0x0000053f, -0x00000570, 0x00000540, 0x00000540, -0x00000571, 0x00000541, 0x00000541, -0x00000572, 0x00000542, 0x00000542, -0x00000573, 0x00000543, 0x00000543, -0x00000574, 0x00000544, 0x00000544, -0x00000575, 0x00000545, 0x00000545, -0x00000576, 0x00000546, 0x00000546, -0x00000577, 0x00000547, 0x00000547, -0x00000578, 0x00000548, 0x00000548, -0x00000579, 0x00000549, 0x00000549, -0x0000057a, 0x0000054a, 0x0000054a, -0x0000057b, 0x0000054b, 0x0000054b, -0x0000057c, 0x0000054c, 0x0000054c, -0x0000057d, 0x0000054d, 0x0000054d, -0x0000057e, 0x0000054e, 0x0000054e, -0x0000057f, 0x0000054f, 0x0000054f, -0x00000580, 0x00000550, 0x00000550, -0x00000581, 0x00000551, 0x00000551, -0x00000582, 0x00000552, 0x00000552, -0x00000583, 0x00000553, 0x00000553, -0x00000584, 0x00000554, 0x00000554, -0x00000585, 0x00000555, 0x00000555, -0x00000586, 0x00000556, 0x00000556, -0x00001e01, 0x00001e00, 0x00001e00, -0x00001e03, 0x00001e02, 0x00001e02, -0x00001e05, 0x00001e04, 0x00001e04, -0x00001e07, 0x00001e06, 0x00001e06, -0x00001e09, 0x00001e08, 0x00001e08, -0x00001e0b, 0x00001e0a, 0x00001e0a, -0x00001e0d, 0x00001e0c, 0x00001e0c, -0x00001e0f, 0x00001e0e, 0x00001e0e, -0x00001e11, 0x00001e10, 0x00001e10, -0x00001e13, 0x00001e12, 0x00001e12, -0x00001e15, 0x00001e14, 0x00001e14, -0x00001e17, 0x00001e16, 0x00001e16, -0x00001e19, 0x00001e18, 0x00001e18, -0x00001e1b, 0x00001e1a, 0x00001e1a, -0x00001e1d, 0x00001e1c, 0x00001e1c, -0x00001e1f, 0x00001e1e, 0x00001e1e, -0x00001e21, 0x00001e20, 0x00001e20, -0x00001e23, 0x00001e22, 0x00001e22, -0x00001e25, 0x00001e24, 0x00001e24, -0x00001e27, 0x00001e26, 0x00001e26, -0x00001e29, 0x00001e28, 0x00001e28, -0x00001e2b, 0x00001e2a, 0x00001e2a, -0x00001e2d, 0x00001e2c, 0x00001e2c, -0x00001e2f, 0x00001e2e, 0x00001e2e, -0x00001e31, 0x00001e30, 0x00001e30, -0x00001e33, 0x00001e32, 0x00001e32, -0x00001e35, 0x00001e34, 0x00001e34, -0x00001e37, 0x00001e36, 0x00001e36, -0x00001e39, 0x00001e38, 0x00001e38, -0x00001e3b, 0x00001e3a, 0x00001e3a, -0x00001e3d, 0x00001e3c, 0x00001e3c, -0x00001e3f, 0x00001e3e, 0x00001e3e, -0x00001e41, 0x00001e40, 0x00001e40, -0x00001e43, 0x00001e42, 0x00001e42, -0x00001e45, 0x00001e44, 0x00001e44, -0x00001e47, 0x00001e46, 0x00001e46, -0x00001e49, 0x00001e48, 0x00001e48, -0x00001e4b, 0x00001e4a, 0x00001e4a, -0x00001e4d, 0x00001e4c, 0x00001e4c, -0x00001e4f, 0x00001e4e, 0x00001e4e, -0x00001e51, 0x00001e50, 0x00001e50, -0x00001e53, 0x00001e52, 0x00001e52, -0x00001e55, 0x00001e54, 0x00001e54, -0x00001e57, 0x00001e56, 0x00001e56, -0x00001e59, 0x00001e58, 0x00001e58, -0x00001e5b, 0x00001e5a, 0x00001e5a, -0x00001e5d, 0x00001e5c, 0x00001e5c, -0x00001e5f, 0x00001e5e, 0x00001e5e, -0x00001e61, 0x00001e60, 0x00001e60, -0x00001e63, 0x00001e62, 0x00001e62, -0x00001e65, 0x00001e64, 0x00001e64, -0x00001e67, 0x00001e66, 0x00001e66, -0x00001e69, 0x00001e68, 0x00001e68, -0x00001e6b, 0x00001e6a, 0x00001e6a, -0x00001e6d, 0x00001e6c, 0x00001e6c, -0x00001e6f, 0x00001e6e, 0x00001e6e, -0x00001e71, 0x00001e70, 0x00001e70, -0x00001e73, 0x00001e72, 0x00001e72, -0x00001e75, 0x00001e74, 0x00001e74, -0x00001e77, 0x00001e76, 0x00001e76, -0x00001e79, 0x00001e78, 0x00001e78, -0x00001e7b, 0x00001e7a, 0x00001e7a, -0x00001e7d, 0x00001e7c, 0x00001e7c, -0x00001e7f, 0x00001e7e, 0x00001e7e, -0x00001e81, 0x00001e80, 0x00001e80, -0x00001e83, 0x00001e82, 0x00001e82, -0x00001e85, 0x00001e84, 0x00001e84, -0x00001e87, 0x00001e86, 0x00001e86, -0x00001e89, 0x00001e88, 0x00001e88, -0x00001e8b, 0x00001e8a, 0x00001e8a, -0x00001e8d, 0x00001e8c, 0x00001e8c, -0x00001e8f, 0x00001e8e, 0x00001e8e, -0x00001e91, 0x00001e90, 0x00001e90, -0x00001e93, 0x00001e92, 0x00001e92, -0x00001e95, 0x00001e94, 0x00001e94, -0x00001e9b, 0x00001e60, 0x00001e60, -0x00001ea1, 0x00001ea0, 0x00001ea0, -0x00001ea3, 0x00001ea2, 0x00001ea2, -0x00001ea5, 0x00001ea4, 0x00001ea4, -0x00001ea7, 0x00001ea6, 0x00001ea6, -0x00001ea9, 0x00001ea8, 0x00001ea8, -0x00001eab, 0x00001eaa, 0x00001eaa, -0x00001ead, 0x00001eac, 0x00001eac, -0x00001eaf, 0x00001eae, 0x00001eae, -0x00001eb1, 0x00001eb0, 0x00001eb0, -0x00001eb3, 0x00001eb2, 0x00001eb2, -0x00001eb5, 0x00001eb4, 0x00001eb4, -0x00001eb7, 0x00001eb6, 0x00001eb6, -0x00001eb9, 0x00001eb8, 0x00001eb8, -0x00001ebb, 0x00001eba, 0x00001eba, -0x00001ebd, 0x00001ebc, 0x00001ebc, -0x00001ebf, 0x00001ebe, 0x00001ebe, -0x00001ec1, 0x00001ec0, 0x00001ec0, -0x00001ec3, 0x00001ec2, 0x00001ec2, -0x00001ec5, 0x00001ec4, 0x00001ec4, -0x00001ec7, 0x00001ec6, 0x00001ec6, -0x00001ec9, 0x00001ec8, 0x00001ec8, -0x00001ecb, 0x00001eca, 0x00001eca, -0x00001ecd, 0x00001ecc, 0x00001ecc, -0x00001ecf, 0x00001ece, 0x00001ece, -0x00001ed1, 0x00001ed0, 0x00001ed0, -0x00001ed3, 0x00001ed2, 0x00001ed2, -0x00001ed5, 0x00001ed4, 0x00001ed4, -0x00001ed7, 0x00001ed6, 0x00001ed6, -0x00001ed9, 0x00001ed8, 0x00001ed8, -0x00001edb, 0x00001eda, 0x00001eda, -0x00001edd, 0x00001edc, 0x00001edc, -0x00001edf, 0x00001ede, 0x00001ede, -0x00001ee1, 0x00001ee0, 0x00001ee0, -0x00001ee3, 0x00001ee2, 0x00001ee2, -0x00001ee5, 0x00001ee4, 0x00001ee4, -0x00001ee7, 0x00001ee6, 0x00001ee6, -0x00001ee9, 0x00001ee8, 0x00001ee8, -0x00001eeb, 0x00001eea, 0x00001eea, -0x00001eed, 0x00001eec, 0x00001eec, -0x00001eef, 0x00001eee, 0x00001eee, -0x00001ef1, 0x00001ef0, 0x00001ef0, -0x00001ef3, 0x00001ef2, 0x00001ef2, -0x00001ef5, 0x00001ef4, 0x00001ef4, -0x00001ef7, 0x00001ef6, 0x00001ef6, -0x00001ef9, 0x00001ef8, 0x00001ef8, -0x00001f00, 0x00001f08, 0x00001f08, -0x00001f01, 0x00001f09, 0x00001f09, -0x00001f02, 0x00001f0a, 0x00001f0a, -0x00001f03, 0x00001f0b, 0x00001f0b, -0x00001f04, 0x00001f0c, 0x00001f0c, -0x00001f05, 0x00001f0d, 0x00001f0d, -0x00001f06, 0x00001f0e, 0x00001f0e, -0x00001f07, 0x00001f0f, 0x00001f0f, -0x00001f10, 0x00001f18, 0x00001f18, -0x00001f11, 0x00001f19, 0x00001f19, -0x00001f12, 0x00001f1a, 0x00001f1a, -0x00001f13, 0x00001f1b, 0x00001f1b, -0x00001f14, 0x00001f1c, 0x00001f1c, -0x00001f15, 0x00001f1d, 0x00001f1d, -0x00001f20, 0x00001f28, 0x00001f28, -0x00001f21, 0x00001f29, 0x00001f29, -0x00001f22, 0x00001f2a, 0x00001f2a, -0x00001f23, 0x00001f2b, 0x00001f2b, -0x00001f24, 0x00001f2c, 0x00001f2c, -0x00001f25, 0x00001f2d, 0x00001f2d, -0x00001f26, 0x00001f2e, 0x00001f2e, -0x00001f27, 0x00001f2f, 0x00001f2f, -0x00001f30, 0x00001f38, 0x00001f38, -0x00001f31, 0x00001f39, 0x00001f39, -0x00001f32, 0x00001f3a, 0x00001f3a, -0x00001f33, 0x00001f3b, 0x00001f3b, -0x00001f34, 0x00001f3c, 0x00001f3c, -0x00001f35, 0x00001f3d, 0x00001f3d, -0x00001f36, 0x00001f3e, 0x00001f3e, -0x00001f37, 0x00001f3f, 0x00001f3f, -0x00001f40, 0x00001f48, 0x00001f48, -0x00001f41, 0x00001f49, 0x00001f49, -0x00001f42, 0x00001f4a, 0x00001f4a, -0x00001f43, 0x00001f4b, 0x00001f4b, -0x00001f44, 0x00001f4c, 0x00001f4c, -0x00001f45, 0x00001f4d, 0x00001f4d, -0x00001f51, 0x00001f59, 0x00001f59, -0x00001f53, 0x00001f5b, 0x00001f5b, -0x00001f55, 0x00001f5d, 0x00001f5d, -0x00001f57, 0x00001f5f, 0x00001f5f, -0x00001f60, 0x00001f68, 0x00001f68, -0x00001f61, 0x00001f69, 0x00001f69, -0x00001f62, 0x00001f6a, 0x00001f6a, -0x00001f63, 0x00001f6b, 0x00001f6b, -0x00001f64, 0x00001f6c, 0x00001f6c, -0x00001f65, 0x00001f6d, 0x00001f6d, -0x00001f66, 0x00001f6e, 0x00001f6e, -0x00001f67, 0x00001f6f, 0x00001f6f, -0x00001f70, 0x00001fba, 0x00001fba, -0x00001f71, 0x00001fbb, 0x00001fbb, -0x00001f72, 0x00001fc8, 0x00001fc8, -0x00001f73, 0x00001fc9, 0x00001fc9, -0x00001f74, 0x00001fca, 0x00001fca, -0x00001f75, 0x00001fcb, 0x00001fcb, -0x00001f76, 0x00001fda, 0x00001fda, -0x00001f77, 0x00001fdb, 0x00001fdb, -0x00001f78, 0x00001ff8, 0x00001ff8, -0x00001f79, 0x00001ff9, 0x00001ff9, -0x00001f7a, 0x00001fea, 0x00001fea, -0x00001f7b, 0x00001feb, 0x00001feb, -0x00001f7c, 0x00001ffa, 0x00001ffa, -0x00001f7d, 0x00001ffb, 0x00001ffb, -0x00001f80, 0x00001f88, 0x00001f88, -0x00001f81, 0x00001f89, 0x00001f89, -0x00001f82, 0x00001f8a, 0x00001f8a, -0x00001f83, 0x00001f8b, 0x00001f8b, -0x00001f84, 0x00001f8c, 0x00001f8c, -0x00001f85, 0x00001f8d, 0x00001f8d, -0x00001f86, 0x00001f8e, 0x00001f8e, -0x00001f87, 0x00001f8f, 0x00001f8f, -0x00001f90, 0x00001f98, 0x00001f98, -0x00001f91, 0x00001f99, 0x00001f99, -0x00001f92, 0x00001f9a, 0x00001f9a, -0x00001f93, 0x00001f9b, 0x00001f9b, -0x00001f94, 0x00001f9c, 0x00001f9c, -0x00001f95, 0x00001f9d, 0x00001f9d, -0x00001f96, 0x00001f9e, 0x00001f9e, -0x00001f97, 0x00001f9f, 0x00001f9f, -0x00001fa0, 0x00001fa8, 0x00001fa8, -0x00001fa1, 0x00001fa9, 0x00001fa9, -0x00001fa2, 0x00001faa, 0x00001faa, -0x00001fa3, 0x00001fab, 0x00001fab, -0x00001fa4, 0x00001fac, 0x00001fac, -0x00001fa5, 0x00001fad, 0x00001fad, -0x00001fa6, 0x00001fae, 0x00001fae, -0x00001fa7, 0x00001faf, 0x00001faf, -0x00001fb0, 0x00001fb8, 0x00001fb8, -0x00001fb1, 0x00001fb9, 0x00001fb9, -0x00001fb3, 0x00001fbc, 0x00001fbc, -0x00001fbe, 0x00000399, 0x00000399, -0x00001fc3, 0x00001fcc, 0x00001fcc, -0x00001fd0, 0x00001fd8, 0x00001fd8, -0x00001fd1, 0x00001fd9, 0x00001fd9, -0x00001fe0, 0x00001fe8, 0x00001fe8, -0x00001fe1, 0x00001fe9, 0x00001fe9, -0x00001fe5, 0x00001fec, 0x00001fec, -0x00001ff3, 0x00001ffc, 0x00001ffc, -0x00002170, 0x00002160, 0x00002160, -0x00002171, 0x00002161, 0x00002161, -0x00002172, 0x00002162, 0x00002162, -0x00002173, 0x00002163, 0x00002163, -0x00002174, 0x00002164, 0x00002164, -0x00002175, 0x00002165, 0x00002165, -0x00002176, 0x00002166, 0x00002166, -0x00002177, 0x00002167, 0x00002167, -0x00002178, 0x00002168, 0x00002168, -0x00002179, 0x00002169, 0x00002169, -0x0000217a, 0x0000216a, 0x0000216a, -0x0000217b, 0x0000216b, 0x0000216b, -0x0000217c, 0x0000216c, 0x0000216c, -0x0000217d, 0x0000216d, 0x0000216d, -0x0000217e, 0x0000216e, 0x0000216e, -0x0000217f, 0x0000216f, 0x0000216f, -0x000024d0, 0x000024b6, 0x000024b6, -0x000024d1, 0x000024b7, 0x000024b7, -0x000024d2, 0x000024b8, 0x000024b8, -0x000024d3, 0x000024b9, 0x000024b9, -0x000024d4, 0x000024ba, 0x000024ba, -0x000024d5, 0x000024bb, 0x000024bb, -0x000024d6, 0x000024bc, 0x000024bc, -0x000024d7, 0x000024bd, 0x000024bd, -0x000024d8, 0x000024be, 0x000024be, -0x000024d9, 0x000024bf, 0x000024bf, -0x000024da, 0x000024c0, 0x000024c0, -0x000024db, 0x000024c1, 0x000024c1, -0x000024dc, 0x000024c2, 0x000024c2, -0x000024dd, 0x000024c3, 0x000024c3, -0x000024de, 0x000024c4, 0x000024c4, -0x000024df, 0x000024c5, 0x000024c5, -0x000024e0, 0x000024c6, 0x000024c6, -0x000024e1, 0x000024c7, 0x000024c7, -0x000024e2, 0x000024c8, 0x000024c8, -0x000024e3, 0x000024c9, 0x000024c9, -0x000024e4, 0x000024ca, 0x000024ca, -0x000024e5, 0x000024cb, 0x000024cb, -0x000024e6, 0x000024cc, 0x000024cc, -0x000024e7, 0x000024cd, 0x000024cd, -0x000024e8, 0x000024ce, 0x000024ce, -0x000024e9, 0x000024cf, 0x000024cf, -0x0000ff41, 0x0000ff21, 0x0000ff21, -0x0000ff42, 0x0000ff22, 0x0000ff22, -0x0000ff43, 0x0000ff23, 0x0000ff23, -0x0000ff44, 0x0000ff24, 0x0000ff24, -0x0000ff45, 0x0000ff25, 0x0000ff25, -0x0000ff46, 0x0000ff26, 0x0000ff26, -0x0000ff47, 0x0000ff27, 0x0000ff27, -0x0000ff48, 0x0000ff28, 0x0000ff28, -0x0000ff49, 0x0000ff29, 0x0000ff29, -0x0000ff4a, 0x0000ff2a, 0x0000ff2a, -0x0000ff4b, 0x0000ff2b, 0x0000ff2b, -0x0000ff4c, 0x0000ff2c, 0x0000ff2c, -0x0000ff4d, 0x0000ff2d, 0x0000ff2d, -0x0000ff4e, 0x0000ff2e, 0x0000ff2e, -0x0000ff4f, 0x0000ff2f, 0x0000ff2f, -0x0000ff50, 0x0000ff30, 0x0000ff30, -0x0000ff51, 0x0000ff31, 0x0000ff31, -0x0000ff52, 0x0000ff32, 0x0000ff32, -0x0000ff53, 0x0000ff33, 0x0000ff33, -0x0000ff54, 0x0000ff34, 0x0000ff34, -0x0000ff55, 0x0000ff35, 0x0000ff35, -0x0000ff56, 0x0000ff36, 0x0000ff36, -0x0000ff57, 0x0000ff37, 0x0000ff37, -0x0000ff58, 0x0000ff38, 0x0000ff38, -0x0000ff59, 0x0000ff39, 0x0000ff39, -0x0000ff5a, 0x0000ff3a, 0x0000ff3a, -0x00010428, 0x00010400, 0x00010400, -0x00010429, 0x00010401, 0x00010401, -0x0001042a, 0x00010402, 0x00010402, -0x0001042b, 0x00010403, 0x00010403, -0x0001042c, 0x00010404, 0x00010404, -0x0001042d, 0x00010405, 0x00010405, -0x0001042e, 0x00010406, 0x00010406, -0x0001042f, 0x00010407, 0x00010407, -0x00010430, 0x00010408, 0x00010408, -0x00010431, 0x00010409, 0x00010409, -0x00010432, 0x0001040a, 0x0001040a, -0x00010433, 0x0001040b, 0x0001040b, -0x00010434, 0x0001040c, 0x0001040c, -0x00010435, 0x0001040d, 0x0001040d, -0x00010436, 0x0001040e, 0x0001040e, -0x00010437, 0x0001040f, 0x0001040f, -0x00010438, 0x00010410, 0x00010410, -0x00010439, 0x00010411, 0x00010411, -0x0001043a, 0x00010412, 0x00010412, -0x0001043b, 0x00010413, 0x00010413, -0x0001043c, 0x00010414, 0x00010414, -0x0001043d, 0x00010415, 0x00010415, -0x0001043e, 0x00010416, 0x00010416, -0x0001043f, 0x00010417, 0x00010417, -0x00010440, 0x00010418, 0x00010418, -0x00010441, 0x00010419, 0x00010419, -0x00010442, 0x0001041a, 0x0001041a, -0x00010443, 0x0001041b, 0x0001041b, -0x00010444, 0x0001041c, 0x0001041c, -0x00010445, 0x0001041d, 0x0001041d, -0x00010446, 0x0001041e, 0x0001041e, -0x00010447, 0x0001041f, 0x0001041f, -0x00010448, 0x00010420, 0x00010420, -0x00010449, 0x00010421, 0x00010421, -0x0001044a, 0x00010422, 0x00010422, -0x0001044b, 0x00010423, 0x00010423, -0x0001044c, 0x00010424, 0x00010424, -0x0001044d, 0x00010425, 0x00010425, -/* title */ -0x000001c5, 0x000001c4, 0x000001c6, -0x000001c8, 0x000001c7, 0x000001c9, -0x000001cb, 0x000001ca, 0x000001cc, -0x000001f2, 0x000001f1, 0x000001f3, -}; diff --git a/ext/mcrypt/CREDITS b/ext/mcrypt/CREDITS deleted file mode 100644 index 00f871b171da0..0000000000000 --- a/ext/mcrypt/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mcrypt -Sascha Schumann, Derick Rethans diff --git a/ext/mcrypt/TODO b/ext/mcrypt/TODO deleted file mode 100644 index a9d2d3a8839c8..0000000000000 --- a/ext/mcrypt/TODO +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ */ - -ToDo: -- Convert to zend_parse_parameters -- Unify error handling -- Implement encryption streams diff --git a/ext/mcrypt/config.m4 b/ext/mcrypt/config.m4 deleted file mode 100644 index 5dc218ed08854..0000000000000 --- a/ext/mcrypt/config.m4 +++ /dev/null @@ -1,59 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_MCRYPT_CHECK_VERSION],[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$MCRYPT_DIR/include - AC_MSG_CHECKING(for libmcrypt version) - AC_EGREP_CPP(yes,[ -#include -#if MCRYPT_API_VERSION >= 20021217 - yes -#endif - ],[ - AC_MSG_RESULT(>= 2.5.6) - ],[ - AC_MSG_ERROR(libmcrypt version 2.5.6 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS -]) - - -PHP_ARG_WITH(mcrypt, for mcrypt support, -[ --with-mcrypt[=DIR] Include mcrypt support]) - -if test "$PHP_MCRYPT" != "no"; then - for i in $PHP_MCRYPT /usr/local /usr; do - test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break - done - - if test -z "$MCRYPT_DIR"; then - AC_MSG_ERROR(mcrypt.h not found. Please reinstall libmcrypt.) - fi - - PHP_MCRYPT_CHECK_VERSION - - PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open, - [ - PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBMCRYPT,1,[ ]) - ],[ - PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open, - [ - AC_DEFINE(HAVE_LIBMCRYPT,1,[ ]) - ],[ - AC_MSG_ERROR([Sorry, I was not able to diagnose which libmcrypt version you have installed.]) - ],[ - -L$MCRYPT_DIR/lib - ]) - ],[ - -L$MCRYPT_DIR/lib -lltdl - ]) - - PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_DIR/lib, MCRYPT_SHARED_LIBADD) - PHP_ADD_INCLUDE($MCRYPT_DIR/include) - - PHP_SUBST(MCRYPT_SHARED_LIBADD) - PHP_NEW_EXTENSION(mcrypt, mcrypt.c, $ext_shared) -fi diff --git a/ext/mcrypt/config.w32 b/ext/mcrypt/config.w32 deleted file mode 100644 index da9b54d346e48..0000000000000 --- a/ext/mcrypt/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mcrypt", "mcrypt support", "no"); - -if (PHP_MCRYPT != "no") { - - if (CHECK_HEADER_ADD_INCLUDE('mcrypt.h', 'CFLAGS_MCRYPT') && - CHECK_LIB('libmcrypt.lib', 'mcrypt')) { - EXTENSION('mcrypt', 'mcrypt.c'); - AC_DEFINE('HAVE_LIBMCRYPT', 1); - AC_DEFINE('HAVE_LIBMCRYPT24', 1); - } else { - WARNING("mcrypt not enabled; libraries and headers not found"); - } -} - diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c deleted file mode 100644 index 3d7a5ef72c6e2..0000000000000 --- a/ext/mcrypt/mcrypt.c +++ /dev/null @@ -1,1276 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Derick Rethans | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_LIBMCRYPT - -#include "php_mcrypt.h" -#include "fcntl.h" - -#define NON_FREE -#define MCRYPT2 -#include "mcrypt.h" -#include "php_ini.h" -#include "php_globals.h" -#include "ext/standard/info.h" - -static int le_mcrypt; - -function_entry mcrypt_functions[] = { - PHP_FE(mcrypt_ecb, NULL) - PHP_FE(mcrypt_cbc, NULL) - PHP_FE(mcrypt_cfb, NULL) - PHP_FE(mcrypt_ofb, NULL) - PHP_FE(mcrypt_get_key_size, NULL) - PHP_FE(mcrypt_get_block_size, NULL) - PHP_FE(mcrypt_get_cipher_name, NULL) - PHP_FE(mcrypt_create_iv, NULL) - - PHP_FE(mcrypt_list_algorithms, NULL) - PHP_FE(mcrypt_list_modes, NULL) - PHP_FE(mcrypt_get_iv_size, NULL) - PHP_FE(mcrypt_encrypt, NULL) - PHP_FE(mcrypt_decrypt, NULL) - - PHP_FE(mcrypt_module_open, NULL) - PHP_FE(mcrypt_generic_init, NULL) - PHP_FE(mcrypt_generic, NULL) - PHP_FE(mdecrypt_generic, NULL) - PHP_FE(mcrypt_generic_end, NULL) - PHP_FE(mcrypt_generic_deinit, NULL) - - PHP_FE(mcrypt_enc_self_test, NULL) - PHP_FE(mcrypt_enc_is_block_algorithm_mode, NULL) - PHP_FE(mcrypt_enc_is_block_algorithm, NULL) - PHP_FE(mcrypt_enc_is_block_mode, NULL) - PHP_FE(mcrypt_enc_get_block_size, NULL) - PHP_FE(mcrypt_enc_get_key_size, NULL) - PHP_FE(mcrypt_enc_get_supported_key_sizes, NULL) - PHP_FE(mcrypt_enc_get_iv_size, NULL) - PHP_FE(mcrypt_enc_get_algorithms_name, NULL) - PHP_FE(mcrypt_enc_get_modes_name, NULL) - PHP_FE(mcrypt_module_self_test, NULL) - - PHP_FE(mcrypt_module_is_block_algorithm_mode, NULL) - PHP_FE(mcrypt_module_is_block_algorithm, NULL) - PHP_FE(mcrypt_module_is_block_mode, NULL) - PHP_FE(mcrypt_module_get_algo_block_size, NULL) - PHP_FE(mcrypt_module_get_algo_key_size, NULL) - PHP_FE(mcrypt_module_get_supported_key_sizes, NULL) - - PHP_FE(mcrypt_module_close, NULL) - {NULL, NULL, NULL} -}; - -static PHP_MINFO_FUNCTION(mcrypt); -static PHP_MINIT_FUNCTION(mcrypt); -static PHP_MSHUTDOWN_FUNCTION(mcrypt); - -zend_module_entry mcrypt_module_entry = { - STANDARD_MODULE_HEADER, - "mcrypt", - mcrypt_functions, - PHP_MINIT(mcrypt), PHP_MSHUTDOWN(mcrypt), - NULL, NULL, - PHP_MINFO(mcrypt), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; - -ZEND_DECLARE_MODULE_GLOBALS(mcrypt) - -#ifdef COMPILE_DL_MCRYPT -ZEND_GET_MODULE(mcrypt) -#endif - -#define MCRYPT_ARGS2 \ - zval **cipher, **data, **key, **mode; \ - int td; \ - char *ndata; \ - size_t bsize; \ - size_t nr; \ - size_t nsize - -#define MCRYPT_ARGS \ - MCRYPT_ARGS2; \ - zval **iv - -#define MCRYPT_CONVERT \ - convert_to_string_ex(cipher); \ - convert_to_string_ex(mode); \ - convert_to_string_ex(data); \ - convert_to_string_ex(key) -#define MCRYPT_CONVERT_WO_MODE \ - convert_to_string_ex(cipher); \ - convert_to_string_ex(data); \ - convert_to_string_ex(key) - -#define MCRYPT_SIZE \ - bsize = mcrypt_get_block_size(Z_LVAL_PP(cipher)); \ - nr = (Z_STRLEN_PP(data) + bsize - 1) / bsize; \ - nsize = nr * bsize - -#define MCRYPT_CHECK_TD_CPY \ - if (td < 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_FAILED); \ - RETURN_FALSE; \ - } \ - ndata = ecalloc(nr, bsize); \ - memcpy(ndata, Z_STRVAL_PP(data), Z_STRLEN_PP(data)) - -#define MCRYPT_CHECK_IV \ - convert_to_string_ex(iv); \ - if (Z_STRLEN_PP(iv) != bsize) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_IV_WRONG_SIZE); \ - RETURN_FALSE; \ - } - -#define MCRYPT_ACTION(x) \ - if (Z_LVAL_PP(mode) == 0) { \ - mcrypt_##x(td, ndata, nsize); \ - } else { \ - mdecrypt_##x(td, ndata, nsize); \ - } \ - end_mcrypt_##x(td) - -#define MCRYPT_IV_WRONG_SIZE "The IV parameter must be as long as the blocksize" - -#define MCRYPT_ENCRYPT 0 -#define MCRYPT_DECRYPT 1 - -#define MCRYPT_GET_INI \ - cipher_dir_string = MCG(algorithms_dir); \ - module_dir_string = MCG(modes_dir); - -#define MCRYPT_CHECK_PARAM_COUNT(a,b) \ - if (argc < (a) || argc > (b)) { \ - WRONG_PARAM_COUNT; \ - } -/* - * #warning is not ANSI C - * #warning Invalidate resource if the param count is wrong, or other problems - * #warning occurred during functions. - */ - -#define MCRYPT_GET_CRYPT_ARGS \ - switch (argc) { \ - case 5: \ - if (zend_get_parameters_ex(5, &cipher, &key, &data, &mode, &iv) == FAILURE) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_string_ex(iv); \ - break; \ - case 4: \ - if (zend_get_parameters_ex(4, &cipher, &key, &data, &mode) == FAILURE) { \ - WRONG_PARAM_COUNT; \ - } \ - iv = NULL; \ - break; \ - default: \ - WRONG_PARAM_COUNT; \ - } - -#define MCRYPT_GET_TD_ARG \ - zval **mcryptind; \ - MCRYPT td; \ - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &mcryptind) == FAILURE) { \ - WRONG_PARAM_COUNT \ - } \ - ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt); - -#define MCRYPT_GET_MODE_DIR_ARGS(DIRECTORY) \ - char *dir = NULL; \ - int dir_len; \ - char *module; \ - int module_len; \ - if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, \ - "s|s", &module, &module_len, &dir, &dir_len) == FAILURE) { \ - return; \ - } - -#define MCRYPT_OPEN_MODULE_FAILED "Module initialization failed" - -#define MCRYPT_ENTRY2_2_4(a,b) REGISTER_STRING_CONSTANT("MCRYPT_" #a, b, CONST_PERSISTENT) -#define MCRYPT_ENTRY2_4(a) MCRYPT_ENTRY_NAMED(a, a) - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("mcrypt.algorithms_dir", NULL, PHP_INI_ALL, OnUpdateString, algorithms_dir, zend_mcrypt_globals, mcrypt_globals) - STD_PHP_INI_ENTRY("mcrypt.modes_dir", NULL, PHP_INI_ALL, OnUpdateString, modes_dir, zend_mcrypt_globals, mcrypt_globals) -PHP_INI_END() - -static void php_mcrypt_module_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - MCRYPT td = (MCRYPT) rsrc->ptr; - mcrypt_generic_deinit(td); - mcrypt_module_close (td); -} - - -static PHP_MINIT_FUNCTION(mcrypt) -{ -#if defined(ZTS) - ZEND_INIT_MODULE_GLOBALS(mcrypt, NULL, NULL); - Z_TYPE(mcrypt_module_entry) = type; -#endif - - le_mcrypt = zend_register_list_destructors_ex(php_mcrypt_module_dtor, NULL, "mcrypt", module_number); - - /* modes for mcrypt_??? routines */ - REGISTER_LONG_CONSTANT("MCRYPT_ENCRYPT", 0, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MCRYPT_DECRYPT", 1, CONST_PERSISTENT); - - /* sources for mcrypt_create_iv */ - REGISTER_LONG_CONSTANT("MCRYPT_DEV_RANDOM", 0, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MCRYPT_DEV_URANDOM", 1, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MCRYPT_RAND", 2, CONST_PERSISTENT); - - /* ciphers */ - MCRYPT_ENTRY2_2_4(3DES, "tripledes"); - MCRYPT_ENTRY2_2_4(ARCFOUR_IV, "arcfour-iv"); - MCRYPT_ENTRY2_2_4(ARCFOUR, "arcfour"); - MCRYPT_ENTRY2_2_4(BLOWFISH, "blowfish"); - MCRYPT_ENTRY2_2_4(BLOWFISH_COMPAT, "blowfish-compat"); - MCRYPT_ENTRY2_2_4(CAST_128, "cast-128"); - MCRYPT_ENTRY2_2_4(CAST_256, "cast-256"); - MCRYPT_ENTRY2_2_4(CRYPT, "crypt"); - MCRYPT_ENTRY2_2_4(DES, "des"); - MCRYPT_ENTRY2_2_4(ENIGNA, "crypt"); - MCRYPT_ENTRY2_2_4(GOST, "gost"); - MCRYPT_ENTRY2_2_4(LOKI97, "loki97"); - MCRYPT_ENTRY2_2_4(PANAMA, "panama"); - MCRYPT_ENTRY2_2_4(RC2, "rc2"); - MCRYPT_ENTRY2_2_4(RIJNDAEL_128, "rijndael-128"); - MCRYPT_ENTRY2_2_4(RIJNDAEL_192, "rijndael-192"); - MCRYPT_ENTRY2_2_4(RIJNDAEL_256, "rijndael-256"); - MCRYPT_ENTRY2_2_4(SAFER64, "safer-sk64"); - MCRYPT_ENTRY2_2_4(SAFER128, "safer-sk128"); - MCRYPT_ENTRY2_2_4(SAFERPLUS, "saferplus"); - MCRYPT_ENTRY2_2_4(SERPENT, "serpent"); - MCRYPT_ENTRY2_2_4(THREEWAY, "threeway"); - MCRYPT_ENTRY2_2_4(TRIPLEDES, "tripledes"); - MCRYPT_ENTRY2_2_4(TWOFISH, "twofish"); - MCRYPT_ENTRY2_2_4(WAKE, "wake"); - MCRYPT_ENTRY2_2_4(XTEA, "xtea"); - - MCRYPT_ENTRY2_2_4(IDEA, "idea"); - MCRYPT_ENTRY2_2_4(MARS, "mars"); - MCRYPT_ENTRY2_2_4(RC6, "rc6"); - MCRYPT_ENTRY2_2_4(SKIPJACK, "skipjack"); -/* modes */ - MCRYPT_ENTRY2_2_4(MODE_CBC, "cbc"); - MCRYPT_ENTRY2_2_4(MODE_CFB, "cfb"); - MCRYPT_ENTRY2_2_4(MODE_ECB, "ecb"); - MCRYPT_ENTRY2_2_4(MODE_NOFB, "nofb"); - MCRYPT_ENTRY2_2_4(MODE_OFB, "ofb"); - MCRYPT_ENTRY2_2_4(MODE_STREAM, "stream"); - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(mcrypt) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -#include "ext/standard/php_smart_str.h" - -PHP_MINFO_FUNCTION(mcrypt) -{ - char **modules; - char mcrypt_api_no[16]; - int i, count; - smart_str tmp1 = {0}; - smart_str tmp2 = {0}; - - modules = mcrypt_list_algorithms(MCG(algorithms_dir), &count); - if (count == 0) { - smart_str_appends(&tmp1, "none"); - } - for (i = 0; i < count; i++) { - smart_str_appends(&tmp1, modules[i]); - smart_str_appendc(&tmp1, ' '); - } - smart_str_0(&tmp1); - mcrypt_free_p(modules, count); - - modules = mcrypt_list_modes(MCG(modes_dir), &count); - if (count == 0) { - smart_str_appends(&tmp2, "none"); - } - for (i = 0; i < count; i++) { - smart_str_appends(&tmp2, modules[i]); - smart_str_appendc(&tmp2, ' '); - } - smart_str_0 (&tmp2); - mcrypt_free_p (modules, count); - - snprintf (mcrypt_api_no, 16, "%d", MCRYPT_API_VERSION); - - php_info_print_table_start(); - php_info_print_table_header(2, "mcrypt support", "enabled"); - php_info_print_table_row(2, "Version", LIBMCRYPT_VERSION); - php_info_print_table_row(2, "Api No", mcrypt_api_no); - php_info_print_table_row(2, "Supported ciphers", tmp1.c); - php_info_print_table_row(2, "Supported modes", tmp2.c); - smart_str_free(&tmp1); - smart_str_free(&tmp2); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -typedef enum { - RANDOM = 0, - URANDOM, - RAND -} iv_source; - -/* {{{ proto resource mcrypt_module_open(string cipher, string cipher_directory, string mode, string mode_directory) - Opens the module of the algorithm and the mode to be used */ -PHP_FUNCTION(mcrypt_module_open) -{ - char *cipher, *cipher_dir; - char *mode, *mode_dir; - int cipher_len, cipher_dir_len; - int mode_len, mode_dir_len; - MCRYPT td; - - if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ssss", - &cipher, &cipher_len, &cipher_dir, &cipher_dir_len, - &mode, &mode_len, &mode_dir, &mode_dir_len)) { - return; - } - - td = mcrypt_module_open ( - cipher, - cipher_dir_len > 0 ? cipher_dir : MCG(algorithms_dir), - mode, - mode_dir_len > 0 ? mode_dir : MCG(modes_dir) - ); - - if (td == MCRYPT_FAILED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module"); - RETURN_FALSE; - } else { - ZEND_REGISTER_RESOURCE(return_value, td, le_mcrypt); - } -} -/* }}} */ - - -/* {{{ proto int mcrypt_generic_init(resource td, string key, string iv) - This function initializes all buffers for the specific module */ -PHP_FUNCTION(mcrypt_generic_init) -{ - zval **key, **iv; - zval **mcryptind; - unsigned char *key_s, *iv_s; - int max_key_size, key_size, iv_size; - MCRYPT td; - int argc; - int result = 0; - - argc = ZEND_NUM_ARGS(); - MCRYPT_CHECK_PARAM_COUNT (3,3) - - zend_get_parameters_ex(3, &mcryptind, &key, &iv); - ZEND_FETCH_RESOURCE(td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt); - convert_to_string_ex(key); - convert_to_string_ex(iv); - - max_key_size = mcrypt_enc_get_key_size(td); - iv_size = mcrypt_enc_get_iv_size(td); - - if (Z_STRLEN_PP(key) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size is 0"); - } - - key_s = emalloc(Z_STRLEN_PP(key)); - memset(key_s, 0, Z_STRLEN_PP(key)); - - iv_s = emalloc(iv_size + 1); - memset(iv_s, 0, iv_size + 1); - - if (Z_STRLEN_PP(key) > max_key_size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size too large; supplied length: %d, max: %d", Z_STRLEN_PP(key), max_key_size); - key_size = max_key_size; - } else { - key_size = Z_STRLEN_PP(key); - } - memcpy(key_s, Z_STRVAL_PP(key), Z_STRLEN_PP(key)); - - if (Z_STRLEN_PP(iv) != iv_size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", Z_STRLEN_PP(iv), iv_size); - } - memcpy(iv_s, Z_STRVAL_PP(iv), iv_size); - - mcrypt_generic_deinit(td); - result = mcrypt_generic_init(td, key_s, key_size, iv_s); - - /* If this function fails, close the mcrypt module to prevent crashes - * when further functions want to access this resource */ - if (result < 0) { - zend_list_delete(Z_LVAL_PP(mcryptind)); - switch (result) { - case -3: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect"); - break; - case -4: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation error"); - break; - case -1: - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error"); - break; - } - } - RETVAL_LONG(result); - - efree(iv_s); - efree(key_s); -} -/* }}} */ - - -/* {{{ proto string mcrypt_generic(resource td, string data) - This function encrypts the plaintext */ -PHP_FUNCTION(mcrypt_generic) -{ - zval **data, **mcryptind; - MCRYPT td; - int argc; - unsigned char* data_s; - int block_size, data_size; - - argc = ZEND_NUM_ARGS(); - MCRYPT_CHECK_PARAM_COUNT (2,2) - - zend_get_parameters_ex(2, &mcryptind, &data); - ZEND_FETCH_RESOURCE(td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt); - convert_to_string_ex(data); - - /* Check blocksize */ - if (mcrypt_enc_is_block_mode(td) == 1) { /* It's a block algorithm */ - block_size = mcrypt_enc_get_block_size(td); - data_size = (((Z_STRLEN_PP(data) - 1) / block_size) + 1) * block_size; - data_s = emalloc(data_size + 1); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } else { /* It's not a block algorithm */ - data_size = Z_STRLEN_PP(data); - data_s = emalloc(data_size + 1); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } - - mcrypt_generic(td, data_s, data_size); - data_s[data_size] = '\0'; - - RETVAL_STRINGL(data_s, data_size, 1); - efree(data_s); -} -/* }}} */ - - -/* {{{ proto string mdecrypt_generic(resource td, string data) - This function decrypts the plaintext */ -PHP_FUNCTION(mdecrypt_generic) -{ - zval **data, **mcryptind; - MCRYPT td; - int argc; - char* data_s; - int block_size, data_size; - - argc = ZEND_NUM_ARGS(); - MCRYPT_CHECK_PARAM_COUNT (2,2) - - zend_get_parameters_ex(2, &mcryptind, &data); - ZEND_FETCH_RESOURCE(td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt); - convert_to_string_ex(data); - - /* Check blocksize */ - if (mcrypt_enc_is_block_mode(td) == 1) { /* It's a block algorithm */ - block_size = mcrypt_enc_get_block_size(td); - data_size = (((Z_STRLEN_PP(data) - 1) / block_size) + 1) * block_size; - data_s = emalloc(data_size + 1); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } else { /* It's not a block algorithm */ - data_size = Z_STRLEN_PP(data); - data_s = emalloc(data_size + 1); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } - - mdecrypt_generic(td, data_s, data_size); - - RETVAL_STRINGL(data_s, data_size, 1); - efree(data_s); -} -/* }}} */ - - -/* {{{ proto array mcrypt_enc_get_supported_key_sizes(resource td) - This function decrypts the crypttext */ -PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes) -{ - int i, count = 0; - int *key_sizes; - - MCRYPT_GET_TD_ARG - array_init(return_value); - - key_sizes = mcrypt_enc_get_supported_key_sizes(td, &count); - - for (i = 0; i < count; i++) { - add_index_long(return_value, i, key_sizes[i]); - } - - mcrypt_free(key_sizes); -} -/* }}} */ - - -/* {{{ proto int mcrypt_enc_self_test(resource td) - This function runs the self test on the algorithm specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_self_test) -{ - MCRYPT_GET_TD_ARG - RETURN_LONG(mcrypt_enc_self_test(td)); -} -/* }}} */ - -/* {{{ proto bool mcrypt_module_close(resource td) - Free the descriptor td */ -PHP_FUNCTION(mcrypt_module_close) -{ - MCRYPT_GET_TD_ARG - zend_list_delete(Z_LVAL_PP(mcryptind)); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool mcrypt_generic_end(resource td) - This function terminates encrypt specified by the descriptor td */ -PHP_FUNCTION(mcrypt_generic_end) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is deprecated, please use mcrypt_generic_deinit()"); - zif_mcrypt_generic_deinit(INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto bool mcrypt_generic_deinit(resource td) - This function terminates encrypt specified by the descriptor td */ -PHP_FUNCTION(mcrypt_generic_deinit) -{ - MCRYPT_GET_TD_ARG - - if (mcrypt_generic_deinit(td) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not terminate encryption specifier"); - RETURN_FALSE - } - RETURN_TRUE -} -/* }}} */ - - -/* {{{ proto bool mcrypt_enc_is_block_algorithm_mode(resource td) - Returns TRUE if the mode is for use with block algorithms */ -PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode) -{ - MCRYPT_GET_TD_ARG - - if (mcrypt_enc_is_block_algorithm_mode(td) == 1) { - RETURN_TRUE - } else { - RETURN_FALSE - } -} -/* }}} */ - - -/* {{{ proto bool mcrypt_enc_is_block_algorithm(resource td) - Returns TRUE if the alrogithm is a block algorithms */ -PHP_FUNCTION(mcrypt_enc_is_block_algorithm) -{ - MCRYPT_GET_TD_ARG - - if (mcrypt_enc_is_block_algorithm(td) == 1) { - RETURN_TRUE - } else { - RETURN_FALSE - } -} -/* }}} */ - - -/* {{{ proto bool mcrypt_enc_is_block_mode(resource td) - Returns TRUE if the mode outputs blocks */ -PHP_FUNCTION(mcrypt_enc_is_block_mode) -{ - MCRYPT_GET_TD_ARG - - if (mcrypt_enc_is_block_mode(td) == 1) { - RETURN_TRUE - } else { - RETURN_FALSE - } -} -/* }}} */ - - -/* {{{ proto int mcrypt_enc_get_block_size(resource td) - Returns the block size of the cipher specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_get_block_size) -{ - MCRYPT_GET_TD_ARG - RETURN_LONG(mcrypt_enc_get_block_size(td)); -} -/* }}} */ - - -/* {{{ proto int mcrypt_enc_get_key_size(resource td) - Returns the maximum supported key size in bytes of the algorithm specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_get_key_size) -{ - MCRYPT_GET_TD_ARG - RETURN_LONG(mcrypt_enc_get_key_size(td)); -} -/* }}} */ - - -/* {{{ proto int mcrypt_enc_get_iv_size(resource td) - Returns the size of the IV in bytes of the algorithm specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_get_iv_size) -{ - MCRYPT_GET_TD_ARG - RETURN_LONG(mcrypt_enc_get_iv_size(td)); -} -/* }}} */ - - -/* {{{ proto string mcrypt_enc_get_algorithms_name(resource td) - Returns the name of the algorithm specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_get_algorithms_name) -{ - char *name; - MCRYPT_GET_TD_ARG - - name = mcrypt_enc_get_algorithms_name(td); - RETVAL_STRING(name, 1); - mcrypt_free(name); -} -/* }}} */ - - -/* {{{ proto string mcrypt_enc_get_modes_name(resource td) - Returns the name of the mode specified by the descriptor td */ -PHP_FUNCTION(mcrypt_enc_get_modes_name) -{ - char *name; - MCRYPT_GET_TD_ARG - - name = mcrypt_enc_get_modes_name(td); - RETVAL_STRING(name, 1); - mcrypt_free(name); -} -/* }}} */ - - -/* {{{ proto bool mcrypt_module_self_test(string algorithm [, string lib_dir]) - Does a self test of the module "module" */ -PHP_FUNCTION(mcrypt_module_self_test) -{ - MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir); - - if (mcrypt_module_self_test(module, dir) == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool mcrypt_module_is_block_algorithm_mode(string mode [, string lib_dir]) - Returns TRUE if the mode is for use with block algorithms */ -PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode) -{ - MCRYPT_GET_MODE_DIR_ARGS(modes_dir) - - if (mcrypt_module_is_block_algorithm_mode(module, dir) == 1) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool mcrypt_module_is_block_algorithm(string algorithm [, string lib_dir]) - Returns TRUE if the algorithm is a block algorithm */ -PHP_FUNCTION(mcrypt_module_is_block_algorithm) -{ - MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) - - if (mcrypt_module_is_block_algorithm(module, dir) == 1) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool mcrypt_module_is_block_mode(string mode [, string lib_dir]) - Returns TRUE if the mode outputs blocks of bytes */ -PHP_FUNCTION(mcrypt_module_is_block_mode) -{ - MCRYPT_GET_MODE_DIR_ARGS(modes_dir) - - if (mcrypt_module_is_block_mode(module, dir) == 1) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto int mcrypt_module_get_algo_block_size(string algorithm [, string lib_dir]) - Returns the block size of the algorithm */ -PHP_FUNCTION(mcrypt_module_get_algo_block_size) -{ - MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) - - RETURN_LONG(mcrypt_module_get_algo_block_size(module, dir)); -} -/* }}} */ - - -/* {{{ proto int mcrypt_module_get_algo_key_size(string algorithm [, string lib_dir]) - Returns the maximum supported key size of the algorithm */ -PHP_FUNCTION(mcrypt_module_get_algo_key_size) -{ - MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir); - - RETURN_LONG(mcrypt_module_get_algo_key_size(module, dir)); -} -/* }}} */ - - -/* {{{ proto array mcrypt_module_get_supported_key_sizes(string algorithm [, string lib_dir]) - This function decrypts the crypttext */ -PHP_FUNCTION(mcrypt_module_get_supported_key_sizes) -{ - int i, count = 0; - int *key_sizes; - - MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) - array_init(return_value); - - key_sizes = mcrypt_module_get_algo_supported_key_sizes(module, dir, &count); - - for (i = 0; i < count; i++) { - add_index_long(return_value, i, key_sizes[i]); - } - mcrypt_free(key_sizes); -} -/* }}} */ - - -/* {{{ proto array mcrypt_list_algorithms([string lib_dir]) - List all algorithms in "module_dir" */ -PHP_FUNCTION(mcrypt_list_algorithms) -{ - char **modules; - char *lib_dir = MCG(algorithms_dir); - int lib_dir_len; - int i, count; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", - &lib_dir, &lib_dir_len) == FAILURE) { - return; - } - - array_init(return_value); - modules = mcrypt_list_algorithms(lib_dir, &count); - - if (count == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No algorithms found in module dir"); - } - for (i = 0; i < count; i++) { - add_index_string(return_value, i, modules[i], 1); - } - mcrypt_free_p(modules, count); -} -/* }}} */ - - -/* {{{ proto array mcrypt_list_modes([string lib_dir]) - List all modes "module_dir" */ -PHP_FUNCTION(mcrypt_list_modes) -{ - char **modules; - char *lib_dir = MCG(modes_dir); - int lib_dir_len; - int i, count; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", - &lib_dir, &lib_dir_len) == FAILURE) { - return; - } - - array_init(return_value); - modules = mcrypt_list_modes(lib_dir, &count); - - if (count == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No modes found in module dir"); - } - for (i = 0; i < count; i++) { - add_index_string(return_value, i, modules[i], 1); - } - mcrypt_free_p(modules, count); -} -/* }}} */ - - -/* {{{ proto int mcrypt_get_key_size(string cipher, string module) - Get the key size of cipher */ -PHP_FUNCTION(mcrypt_get_key_size) -{ - char *cipher; - char *module; - int cipher_len, module_len; - char *cipher_dir_string; - char *module_dir_string; - MCRYPT td; - - MCRYPT_GET_INI - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &cipher, &cipher_len, &module, &module_len) == FAILURE) { - return; - } - - td = mcrypt_module_open(cipher, cipher_dir_string, module, module_dir_string); - if (td != MCRYPT_FAILED) { - RETVAL_LONG(mcrypt_enc_get_key_size(td)); - mcrypt_module_close(td); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto int mcrypt_get_block_size(string cipher, string module) - Get the key size of cipher */ -PHP_FUNCTION(mcrypt_get_block_size) -{ - char *cipher; - char *module; - int cipher_len, module_len; - char *cipher_dir_string; - char *module_dir_string; - MCRYPT td; - - MCRYPT_GET_INI - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &cipher, &cipher_len, &module, &module_len) == FAILURE) { - return; - } - - td = mcrypt_module_open(cipher, cipher_dir_string, module, module_dir_string); - if (td != MCRYPT_FAILED) { - RETVAL_LONG(mcrypt_enc_get_block_size(td)); - mcrypt_module_close(td); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto int mcrypt_get_iv_size(string cipher, string module) - Get the IV size of cipher (Usually the same as the blocksize) */ -PHP_FUNCTION(mcrypt_get_iv_size) -{ - char *cipher; - char *module; - int cipher_len, module_len; - char *cipher_dir_string; - char *module_dir_string; - MCRYPT td; - - MCRYPT_GET_INI - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &cipher, &cipher_len, &module, &module_len) == FAILURE) { - return; - } - - td = mcrypt_module_open(cipher, cipher_dir_string, module, module_dir_string); - if (td != MCRYPT_FAILED) { - RETVAL_LONG(mcrypt_enc_get_iv_size(td)); - mcrypt_module_close(td); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto string mcrypt_get_cipher_name(string cipher) - Get the key size of cipher */ -PHP_FUNCTION(mcrypt_get_cipher_name) -{ - char *cipher_dir_string; - char *module_dir_string; - char *cipher_name; - char *cipher; - int cipher_len; - MCRYPT td; - - MCRYPT_GET_INI - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &cipher, &cipher_len) == FAILURE) { - return; - } - - /* The code below is actually not very nice, but I didn't see a better - * method */ - td = mcrypt_module_open(cipher, cipher_dir_string, "ecb", module_dir_string); - if (td != MCRYPT_FAILED) { - cipher_name = mcrypt_enc_get_algorithms_name(td); - mcrypt_module_close(td); - RETVAL_STRING(cipher_name,1); - mcrypt_free(cipher_name); - } else { - td = mcrypt_module_open(cipher, cipher_dir_string, "stream", module_dir_string); - if (td != MCRYPT_FAILED) { - cipher_name = mcrypt_enc_get_algorithms_name(td); - mcrypt_module_close(td); - RETVAL_STRING(cipher_name,1); - mcrypt_free(cipher_name); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED); - RETURN_FALSE; - } - } -} -/* }}} */ - - -static void php_mcrypt_do_crypt (char* cipher, zval **key, zval **data, char *mode, zval **iv, int argc, int dencrypt, zval* return_value TSRMLS_DC) -{ - char *cipher_dir_string; - char *module_dir_string; - int block_size, max_key_length, use_key_length, i, count, iv_size; - unsigned long int data_size; - int *key_length_sizes; - char *key_s = NULL, *iv_s; - char *data_s; - MCRYPT td; - - MCRYPT_GET_INI - - td = mcrypt_module_open(cipher, cipher_dir_string, mode, module_dir_string); - if (td == MCRYPT_FAILED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED); - RETURN_FALSE; - } - /* Checking for key-length */ - max_key_length = mcrypt_enc_get_key_size(td); - if (Z_STRLEN_PP(key) > max_key_length) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size of key is too large for this algorithm"); - } - key_length_sizes = mcrypt_enc_get_supported_key_sizes(td, &count); - if (count == 0 && key_length_sizes == NULL) { /* all lengths 1 - k_l_s = OK */ - use_key_length = Z_STRLEN_PP(key); - key_s = emalloc(use_key_length); - memset(key_s, 0, use_key_length); - memcpy(key_s, Z_STRVAL_PP(key), use_key_length); - } else if (count == 1) { /* only m_k_l = OK */ - key_s = emalloc(key_length_sizes[0]); - memset(key_s, 0, key_length_sizes[0]); - memcpy(key_s, Z_STRVAL_PP(key), MIN(Z_STRLEN_PP(key), key_length_sizes[0])); - use_key_length = key_length_sizes[0]; - } else { /* dertermine smallest supported key > length of requested key */ - use_key_length = max_key_length; /* start with max key length */ - for (i = 0; i < count; i++) { - if (key_length_sizes[i] >= Z_STRLEN_PP(key) && - key_length_sizes[i] < use_key_length) - { - use_key_length = key_length_sizes[i]; - } - } - key_s = emalloc(use_key_length); - memset(key_s, 0, use_key_length); - memcpy(key_s, Z_STRVAL_PP(key), MIN(Z_STRLEN_PP(key), use_key_length)); - } - mcrypt_free (key_length_sizes); - - /* Check IV */ - iv_s = NULL; - iv_size = mcrypt_enc_get_iv_size (td); - if (argc == 5) { - if (iv_size != Z_STRLEN_PP(iv)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_IV_WRONG_SIZE); - } else { - iv_s = emalloc(iv_size + 1); - memcpy(iv_s, Z_STRVAL_PP(iv), iv_size); - } - } else if (argc == 4) { - if (iv_size != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to use an empty IV, which is NOT recommend"); - iv_s = emalloc(iv_size + 1); - memset(iv_s, 0, iv_size + 1); - } - } - - /* Check blocksize */ - if (mcrypt_enc_is_block_mode(td) == 1) { /* It's a block algorithm */ - block_size = mcrypt_enc_get_block_size(td); - data_size = (((Z_STRLEN_PP(data) - 1) / block_size) + 1) * block_size; - data_s = emalloc(data_size); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } else { /* It's not a block algorithm */ - data_size = Z_STRLEN_PP(data); - data_s = emalloc(data_size); - memset(data_s, 0, data_size); - memcpy(data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data)); - } - - if (mcrypt_generic_init(td, key_s, use_key_length, iv_s) < 0) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed"); - RETURN_FALSE; - } - if (dencrypt == MCRYPT_ENCRYPT) { - mcrypt_generic(td, data_s, data_size); - } else { - mdecrypt_generic(td, data_s, data_size); - } - - RETVAL_STRINGL(data_s, data_size, 1); - - /* freeing vars */ - mcrypt_generic_end(td); - if (key_s != NULL) { - efree (key_s); - } - if (iv_s != NULL) { - efree (iv_s); - } - efree (data_s); -} - -/* {{{ proto string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv) - OFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_encrypt) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT; - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, Z_STRVAL_PP(mode), iv, argc, MCRYPT_ENCRYPT, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) - OFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_decrypt) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT; - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, Z_STRVAL_PP(mode), iv, argc, MCRYPT_DECRYPT, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) - ECB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_ecb) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT_WO_MODE; - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, "ecb", iv, argc, Z_LVAL_PP(mode), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) - CBC crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_cbc) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT_WO_MODE; - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, "cbc", iv, argc, Z_LVAL_PP(mode), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string mcrypt_cfb(int cipher, string key, string data, int mode, string iv) - CFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_cfb) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT_WO_MODE; - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, "cfb", iv, argc, Z_LVAL_PP(mode), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string mcrypt_ofb(int cipher, string key, string data, int mode, string iv) - OFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_ofb) -{ - zval **cipher, **key, **data, **mode, **iv; - int argc; - - argc = ZEND_NUM_ARGS(); - - MCRYPT_CHECK_PARAM_COUNT(4, 5) - MCRYPT_GET_CRYPT_ARGS - - MCRYPT_CONVERT_WO_MODE; - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(Z_STRVAL_PP(cipher), key, data, "ofb", iv, argc, Z_LVAL_PP(mode), return_value TSRMLS_CC); -} -/* }}} */ - - -/* {{{ proto string mcrypt_create_iv(int size, int source) - Create an initialization vector (IV) */ -PHP_FUNCTION(mcrypt_create_iv) -{ - char *iv; - long source = RANDOM; - long size; - int n = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &size, &source) == FAILURE) { - return; - } - - if (size <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not create an IV with size 0 or smaller"); - RETURN_FALSE; - } - - iv = ecalloc(size + 1, 1); - - if (source == RANDOM || source == URANDOM) { - int fd; - size_t read_bytes = 0; - - fd = open(source == RANDOM ? "/dev/random" : "/dev/urandom", O_RDONLY); - if (fd < 0) { - efree(iv); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open source device"); - RETURN_FALSE; - } - while (read_bytes < size) { - n = read(fd, iv + read_bytes, size - read_bytes); - if (n < 0) { - break; - } - read_bytes += n; - } - n = read_bytes; - close(fd); - if (n < size) { - efree(iv); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data"); - RETURN_FALSE; - } - } else { - n = size; - while (size) { - iv[--size] = 255.0 * rand() / RAND_MAX; - } - } - RETURN_STRINGL(iv, n, 0); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/mcrypt/mcrypt.dsp b/ext/mcrypt/mcrypt.dsp deleted file mode 100644 index a0a1f00f4c11e..0000000000000 --- a/ext/mcrypt/mcrypt.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mcrypt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mcrypt - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mcrypt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mcrypt.mak" CFG="mcrypt - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mcrypt - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mcrypt - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mcrypt - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcrypt.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mcrypt" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\TSRM\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "mcrypt - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70" -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mcrypt.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mcrypt\lib" - -!ENDIF - -# Begin Target - -# Name "mcrypt - Win32 Release_TS" -# Name "mcrypt - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\win32\readdir.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mcrypt.h -# End Source File -# Begin Source File - -SOURCE=..\..\win32\readdir.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h deleted file mode 100644 index 604357ff107bc..0000000000000 --- a/ext/mcrypt/php_mcrypt.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Derick Rethans | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef PHP_MCRYPT_H -#define PHP_MCRYPT_H - -#if HAVE_LIBMCRYPT - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry mcrypt_module_entry; -#define mcrypt_module_ptr &mcrypt_module_entry - -/* Functions for both old and new API */ -PHP_FUNCTION(mcrypt_ecb); -PHP_FUNCTION(mcrypt_cbc); -PHP_FUNCTION(mcrypt_cfb); -PHP_FUNCTION(mcrypt_ofb); -PHP_FUNCTION(mcrypt_get_cipher_name); -PHP_FUNCTION(mcrypt_get_block_size); -PHP_FUNCTION(mcrypt_get_key_size); -PHP_FUNCTION(mcrypt_create_iv); - -/* Support functions for old API */ -PHP_FUNCTION(mcrypt_list_algorithms); -PHP_FUNCTION(mcrypt_list_modes); -PHP_FUNCTION(mcrypt_get_iv_size); -PHP_FUNCTION(mcrypt_encrypt); -PHP_FUNCTION(mcrypt_decrypt); - -/* Functions for new API */ -PHP_FUNCTION(mcrypt_module_open); -PHP_FUNCTION(mcrypt_generic_init); -PHP_FUNCTION(mcrypt_generic); -PHP_FUNCTION(mdecrypt_generic); -PHP_FUNCTION(mcrypt_generic_end); -PHP_FUNCTION(mcrypt_generic_deinit); - -PHP_FUNCTION(mcrypt_enc_self_test); -PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode); -PHP_FUNCTION(mcrypt_enc_is_block_algorithm); -PHP_FUNCTION(mcrypt_enc_is_block_mode); -PHP_FUNCTION(mcrypt_enc_get_block_size); -PHP_FUNCTION(mcrypt_enc_get_key_size); -PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes); -PHP_FUNCTION(mcrypt_enc_get_iv_size); -PHP_FUNCTION(mcrypt_enc_get_algorithms_name); -PHP_FUNCTION(mcrypt_enc_get_modes_name); -PHP_FUNCTION(mcrypt_module_self_test); -PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode); -PHP_FUNCTION(mcrypt_module_is_block_algorithm); -PHP_FUNCTION(mcrypt_module_is_block_mode); -PHP_FUNCTION(mcrypt_module_get_algo_block_size); -PHP_FUNCTION(mcrypt_module_get_algo_key_size); -PHP_FUNCTION(mcrypt_module_get_supported_key_sizes); -PHP_FUNCTION(mcrypt_module_close); - -ZEND_BEGIN_MODULE_GLOBALS(mcrypt) - int le_h; - char *modes_dir; - char *algorithms_dir; -ZEND_END_MODULE_GLOBALS(mcrypt) - -#ifdef ZTS -# define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v) -#else -# define MCG(v) (mcrypt_globals.v) -#endif - -#else -#define mcrypt_module_ptr NULL -#endif - -#define phpext_mcrypt_ptr mcrypt_module_ptr - -#endif diff --git a/ext/mcrypt/tests/blowfish.phpt b/ext/mcrypt/tests/blowfish.phpt deleted file mode 100644 index dc51da65b37e7..0000000000000 --- a/ext/mcrypt/tests/blowfish.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Test for blowfish compatibility ---SKIPIF-- - ---FILE-- - ---EXPECT-- -key plain crypt guess stat -0000000000000000 0000000000000000 4ef997456198dd78 4ef997456198dd78 OK -FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 51866fd5b85ecb8a 51866fd5b85ecb8a OK -3000000000000000 1000000000000001 7d856f9a613063f2 7d856f9a613063f2 OK -1111111111111111 1111111111111111 2466dd878b963c9d 2466dd878b963c9d OK -0123456789ABCDEF 1111111111111111 61f9c3802281b096 61f9c3802281b096 OK -1111111111111111 0123456789ABCDEF 7d0cc630afda1ec7 7d0cc630afda1ec7 OK -FEDCBA9876543210 0123456789ABCDEF 0aceab0fc6a0a28d 0aceab0fc6a0a28d OK -7CA110454A1A6E57 01A1D6D039776742 59c68245eb05282b 59c68245eb05282b OK -0131D9619DC1376E 5CD54CA83DEF57DA b1b8cc0b250f09a0 b1b8cc0b250f09a0 OK -07A1133E4A0B2686 0248D43806F67172 1730e5778bea1da4 1730e5778bea1da4 OK -3849674C2602319E 51454B582DDF440A a25e7856cf2651eb a25e7856cf2651eb OK -04B915BA43FEB5B6 42FD443059577FA2 353882b109ce8f1a 353882b109ce8f1a OK -0113B970FD34F2CE 059B5E0851CF143A 48f4d0884c379918 48f4d0884c379918 OK -0170F175468FB5E6 0756D8E0774761D2 432193b78951fc98 432193b78951fc98 OK -43297FAD38E373FE 762514B829BF486A 13f04154d69d1ae5 13f04154d69d1ae5 OK -07A7137045DA2A16 3BDD119049372802 2eedda93ffd39c79 2eedda93ffd39c79 OK -04689104C2FD3B2F 26955F6835AF609A d887e0393c2da6e3 d887e0393c2da6e3 OK -37D06BB516CB7546 164D5E404F275232 5f99d04f5b163969 5f99d04f5b163969 OK -1F08260D1AC2465E 6B056E18759F5CCA 4a057a3b24d3977b 4a057a3b24d3977b OK -584023641ABA6176 004BD6EF09176062 452031c1e4fada8e 452031c1e4fada8e OK -025816164629B007 480D39006EE762F2 7555ae39f59b87bd 7555ae39f59b87bd OK -49793EBC79B3258F 437540C8698F3CFA 53c55f9cb49fc019 53c55f9cb49fc019 OK -4FB05E1515AB73A7 072D43A077075292 7a8e7bfa937e89a3 7a8e7bfa937e89a3 OK -49E95D6D4CA229BF 02FE55778117F12A cf9c5d7a4986adb5 cf9c5d7a4986adb5 OK -018310DC409B26D6 1D9D5C5018F728C2 d1abb290658bc778 d1abb290658bc778 OK -1C587F1C13924FEF 305532286D6F295A 55cb3774d13ef201 55cb3774d13ef201 OK -0101010101010101 0123456789ABCDEF fa34ec4847b268b2 fa34ec4847b268b2 OK -1F1F1F1F0E0E0E0E 0123456789ABCDEF a790795108ea3cae a790795108ea3cae OK -E0FEE0FEF1FEF1FE 0123456789ABCDEF c39e072d9fac631d c39e072d9fac631d OK -0000000000000000 FFFFFFFFFFFFFFFF 014933e0cdaff6e4 014933e0cdaff6e4 OK -FFFFFFFFFFFFFFFF 0000000000000000 f21e9a77b71c49bc f21e9a77b71c49bc OK -0123456789ABCDEF 0000000000000000 245946885754369a 245946885754369a OK -FEDCBA9876543210 FFFFFFFFFFFFFFFF 6b5c5a9c5d9e0a5a 6b5c5a9c5d9e0a5a OK diff --git a/ext/mcrypt/tests/bug8040.phpt b/ext/mcrypt/tests/bug8040.phpt deleted file mode 100644 index 12e28687fdd45..0000000000000 --- a/ext/mcrypt/tests/bug8040.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #8040 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -twofish -cbc -cbc -cipher=twofish mode1=cbc mode2=MCRYPT_CBC diff --git a/ext/mcrypt/tests/vectors.txt b/ext/mcrypt/tests/vectors.txt deleted file mode 100644 index 3624ed6d6949b..0000000000000 --- a/ext/mcrypt/tests/vectors.txt +++ /dev/null @@ -1,33 +0,0 @@ -0000000000000000 0000000000000000 4EF997456198DD78 -FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 51866FD5B85ECB8A -3000000000000000 1000000000000001 7D856F9A613063F2 -1111111111111111 1111111111111111 2466DD878B963C9D -0123456789ABCDEF 1111111111111111 61F9C3802281B096 -1111111111111111 0123456789ABCDEF 7D0CC630AFDA1EC7 -FEDCBA9876543210 0123456789ABCDEF 0ACEAB0FC6A0A28D -7CA110454A1A6E57 01A1D6D039776742 59C68245EB05282B -0131D9619DC1376E 5CD54CA83DEF57DA B1B8CC0B250F09A0 -07A1133E4A0B2686 0248D43806F67172 1730E5778BEA1DA4 -3849674C2602319E 51454B582DDF440A A25E7856CF2651EB -04B915BA43FEB5B6 42FD443059577FA2 353882B109CE8F1A -0113B970FD34F2CE 059B5E0851CF143A 48F4D0884C379918 -0170F175468FB5E6 0756D8E0774761D2 432193B78951FC98 -43297FAD38E373FE 762514B829BF486A 13F04154D69D1AE5 -07A7137045DA2A16 3BDD119049372802 2EEDDA93FFD39C79 -04689104C2FD3B2F 26955F6835AF609A D887E0393C2DA6E3 -37D06BB516CB7546 164D5E404F275232 5F99D04F5B163969 -1F08260D1AC2465E 6B056E18759F5CCA 4A057A3B24D3977B -584023641ABA6176 004BD6EF09176062 452031C1E4FADA8E -025816164629B007 480D39006EE762F2 7555AE39F59B87BD -49793EBC79B3258F 437540C8698F3CFA 53C55F9CB49FC019 -4FB05E1515AB73A7 072D43A077075292 7A8E7BFA937E89A3 -49E95D6D4CA229BF 02FE55778117F12A CF9C5D7A4986ADB5 -018310DC409B26D6 1D9D5C5018F728C2 D1ABB290658BC778 -1C587F1C13924FEF 305532286D6F295A 55CB3774D13EF201 -0101010101010101 0123456789ABCDEF FA34EC4847B268B2 -1F1F1F1F0E0E0E0E 0123456789ABCDEF A790795108EA3CAE -E0FEE0FEF1FEF1FE 0123456789ABCDEF C39E072D9FAC631D -0000000000000000 FFFFFFFFFFFFFFFF 014933E0CDAFF6E4 -FFFFFFFFFFFFFFFF 0000000000000000 F21E9A77B71C49BC -0123456789ABCDEF 0000000000000000 245946885754369A -FEDCBA9876543210 FFFFFFFFFFFFFFFF 6B5C5A9C5D9E0A5A diff --git a/ext/mhash/CREDITS b/ext/mhash/CREDITS deleted file mode 100644 index 54851e1ac7607..0000000000000 --- a/ext/mhash/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mhash -Sascha Schumann diff --git a/ext/mhash/config.m4 b/ext/mhash/config.m4 deleted file mode 100644 index e4efbc055a995..0000000000000 --- a/ext/mhash/config.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(mhash, for mhash support, -[ --with-mhash[=DIR] Include mhash support]) - -if test "$PHP_MHASH" != "no"; then - for i in $PHP_MHASH /usr/local /usr /opt/mhash; do - test -f $i/include/mhash.h && MHASH_DIR=$i && break - done - - if test -z "$MHASH_DIR"; then - AC_MSG_ERROR(Please reinstall libmhash - I cannot find mhash.h) - fi - - PHP_ADD_INCLUDE($MHASH_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_DIR/lib, MHASH_SHARED_LIBADD) - - PHP_NEW_EXTENSION(mhash, mhash.c, $ext_shared) - PHP_SUBST(MHASH_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBMHASH,1,[ ]) -fi diff --git a/ext/mhash/config.w32 b/ext/mhash/config.w32 deleted file mode 100644 index f3da3bb0b602b..0000000000000 --- a/ext/mhash/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mhash", "mhash support", "no"); - -if (PHP_MHASH != "no") { - - if (CHECK_HEADER_ADD_INCLUDE('mhash.h', 'CFLAGS_MHASH') && - CHECK_LIB('libmhash.lib', 'mhash')) { - EXTENSION('mhash', 'mhash.c'); - AC_DEFINE('HAVE_LIBMHASH', 1); - } else { - WARNING("mhash not enabled; libraries and headers not found"); - } -} - diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c deleted file mode 100644 index e0ad582acd107..0000000000000 --- a/ext/mhash/mhash.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Nikos Mavroyanopoulos (HMAC, KEYGEN) | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_LIBMHASH - -#include "fcntl.h" -#include "php_mhash.h" -#include "mhash.h" -#include "php_ini.h" -#include "php_globals.h" -#include "ext/standard/info.h" - -function_entry mhash_functions[] = { - PHP_FE(mhash_get_block_size, NULL) - PHP_FE(mhash_get_hash_name, NULL) - PHP_FE(mhash_keygen_s2k, NULL) - PHP_FE(mhash_count, NULL) - PHP_FE(mhash, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry mhash_module_entry = { - STANDARD_MODULE_HEADER, - "mhash", - mhash_functions, - PHP_MINIT(mhash), NULL, - NULL, NULL, - PHP_MINFO(mhash), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; - -#ifdef COMPILE_DL_MHASH -ZEND_GET_MODULE(mhash) -#endif - -/* SALTED S2K uses a fixed salt */ -#define SALT_SIZE 8 - -PHP_MINIT_FUNCTION(mhash) -{ - int i, n, l; - char *name; - char buf[128]; - - n = mhash_count() + 1; - - for (i=0; i mhash_get_keygen_salt_size(KEYGEN_S2K_SALTED)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "The specified salt [%d] is more bytes than the required by the algorithm [%d]\n", - salt_len, mhash_get_keygen_salt_size(KEYGEN_S2K_SALTED)); - } - - memcpy(salt, in_salt, salt_len); - if (salt_len < SALT_SIZE) { - memset(salt + salt_len, 0, SALT_SIZE - salt_len); - } - salt_len = SALT_SIZE; - - keystruct.hash_algorithm[0] = hash; - keystruct.hash_algorithm[1] = hash; - keystruct.count = 0; - keystruct.salt = salt; - keystruct.salt_size = salt_len; - - ret = emalloc(bytes + 1); - - if (mhash_keygen_ext(KEYGEN_S2K_SALTED, keystruct, ret, bytes, password, password_len) >= 0) { - ret[bytes] = '\0'; - RETVAL_STRINGL(ret, bytes, 0); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mhash key generation failed"); - efree(ret); - RETURN_FALSE; - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/mhash/mhash.dsp b/ext/mhash/mhash.dsp deleted file mode 100644 index 0fa0226288708..0000000000000 --- a/ext/mhash/mhash.dsp +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mhash" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mhash - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mhash.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mhash.mak" CFG="mhash - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mhash - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mhash - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mhash - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_MHASH" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /D "WIN32" /D "MHASH_EXPORTS" /D "COMPILE_DL_MHASH" /D HAVE_LIBMHASH=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libmhash.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mhash.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "mhash - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_MHASH" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MHASH_EXPORTS" /D "COMPILE_DL_MHASH" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MHASH=1 /D ZTS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib libmhash.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mhash.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "mhash - Win32 Release_TS" -# Name "mhash - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mhash.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mhash.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/mhash/php_mhash.h b/ext/mhash/php_mhash.h deleted file mode 100644 index a095a56474251..0000000000000 --- a/ext/mhash/php_mhash.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Nikos Mavroyanopoulos (HMAC, KEYGEN) | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef PHP_MHASH_H -#define PHP_MHASH_H - -#if HAVE_LIBMHASH - -#if PHP_API_VERSION < 19990421 -#define zend_module_entry zend_module_entry -#include "zend_modules.h" -#include "internal_functions.h" -#endif - -extern zend_module_entry mhash_module_entry; -#define mhash_module_ptr &mhash_module_entry - -PHP_MINIT_FUNCTION(mhash); -PHP_MINFO_FUNCTION(mhash); -PHP_FUNCTION(mhash_get_block_size); -PHP_FUNCTION(mhash_get_hash_name); -PHP_FUNCTION(mhash_count); -PHP_FUNCTION(mhash_keygen_s2k); -PHP_FUNCTION(mhash); - -#else -#define mhash_module_ptr NULL -#endif - -#define phpext_mhash_ptr mhash_module_ptr - -#endif diff --git a/ext/mhash/tests/001.phpt b/ext/mhash/tests/001.phpt deleted file mode 100644 index 13c16a226392f..0000000000000 --- a/ext/mhash/tests/001.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -mhash() test ---INI-- -magic_quotes_runtime=0 ---SKIPIF-- - ---FILE-- - "-›Û‘ùN–ÙÄâS*̓j", -"MHASH_SHA1" => "/“AċZƒíġI{ĝ;£Û*}à£", -"MHASH_HAVAL256" => "²Uŝ˙­d'5Ç›Ĉ•Ħü;Ŭŭúñ ²u’‡“Ż", -"MHASH_HAVAL192" => "Lè7ŜH0 *²Ĉp”Ɉß×ÛÍ", -"MHASH_HAVAL224" => "SbхgRż,›²Öŭ×rıĊÈÎ^È&•&K…á", -"MHASH_HAVAL160" => "Ĉ³o‡u Wiĵ´ò\"q”{ùË", -"MHASH_RIPEMD160" => "lGCZĦÓYÄ·ĈŻF4Ÿ\x0C>XX=", -"MHASH_GOST" => "\x0A%Rνġ|­ñQGòUĥC)5ğœ,Ç⍋-ž", -"MHASH_TIGER" => "ŭıšy:•g~ —Ğ‘ë -à 0Tğ\9", -"MHASH_CRC32" => "ƒ¸", -"MHASH_CRC32B" => "¤·Zß" -); - -$data = "This is the test of the mhash extension..."; - -foreach ($supported_hash_al as $hash=>$wanted) { - $result = mhash(constant($hash), $data); - if ($result==$wanted) { - echo "$hash\nok\n"; - } else { - echo "$hash: "; - var_dump($wanted); - echo "$hash: "; - var_dump($result); - } - echo "\n"; -} -?> ---EXPECT-- -MHASH_MD5 -ok - -MHASH_SHA1 -ok - -MHASH_HAVAL256 -ok - -MHASH_HAVAL192 -ok - -MHASH_HAVAL224 -ok - -MHASH_HAVAL160 -ok - -MHASH_RIPEMD160 -ok - -MHASH_GOST -ok - -MHASH_TIGER -ok - -MHASH_CRC32 -ok - -MHASH_CRC32B -ok diff --git a/ext/mhash/tests/002.phpt b/ext/mhash/tests/002.phpt deleted file mode 100644 index 6f89bc2272192..0000000000000 --- a/ext/mhash/tests/002.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -mhash_get_block_size() & mhash_get_hash_name() test ---SKIPIF-- - ---FILE-- - 16, -"MD4" => 16, -"SHA1" => 20, -"SHA256" => 32, -"HAVAL256" => 32, -"HAVAL192" => 24, -"HAVAL224" => 28, -"HAVAL160" => 20, -"HAVAL128" => 16, -"RIPEMD160" => 20, -"GOST" => 32, -"TIGER" => 24, -"TIGER160" => 20, -"TIGER128" => 16, -"CRC32" => 4, -"CRC32B" => 4, -"ADLER32" => 4, -"NA_XYZ" => 0 /* verify that the algorythm works */ -); - -$hc = mhash_count() + 1; - -$known_hash_al = array(); -for ($i=0; $i < $hc; $i++) { - $known_hash_al[mhash_get_hash_name($i)] = $i; -} - -foreach ($supported_hash_al as $name => $len) { - if (array_key_exists($name, $known_hash_al)) { - $len = mhash_get_block_size($known_hash_al[$name]); - echo "$name = $len\n"; - } else { - echo "$name ? $len\n"; - } -} -?> ---EXPECTREGEX-- -MD5 . 16 -MD4 . 16 -SHA1 . 20 -SHA256 . 32 -HAVAL256 . 32 -HAVAL192 . 24 -HAVAL224 . 28 -HAVAL160 . 20 -HAVAL128 . 16 -RIPEMD160 . 20 -GOST . 32 -TIGER . 24 -TIGER160 . 20 -TIGER128 . 16 -CRC32 . 4 -CRC32B . 4 -ADLER32 . 4 -NA_XYZ . 0 diff --git a/ext/mhash/tests/003.phpt b/ext/mhash/tests/003.phpt deleted file mode 100644 index 5afd41ec514d7..0000000000000 --- a/ext/mhash/tests/003.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -mhash_keygen_s2k() test ---SKIPIF-- - ---EXPECT-- -MHASH_MD5 -ok - -MHASH_SHA1 -ok - -MHASH_HAVAL256 -ok - -MHASH_HAVAL224 -ok - -MHASH_HAVAL192 -ok - -MHASH_HAVAL160 -ok - -MHASH_RIPEMD160 -ok - -MHASH_GOST -ok - -MHASH_TIGER -ok - -MHASH_CRC32 -ok - -MHASH_CRC32B -ok ---FILE-- - b"†\x15NŻ”2Íé4zĦP”ıÀFë\x06ĉ ”\x0CTyŞzcghµààt^W\x09ŝŜ-Ÿésš­A7Yú§:Ìí‚\x10w´Ŭ²x€dqëS³İĠ^҃šĞ&UÈ,ŝÛè: „aǙÙ×zä\x06\x1CS›\x01", -"MHASH_SHA1" => b"Ŭ1\\p\x06\x1D\x07E]SÂû\x0B\x08ß\x0CaŞf\\\x1Aħ§\x01ú\x10•T#\$‹¨2­ä\x06³›xc\x0Aş=\x16ˆĉ\"IJ\x0E'NΚԽ÷n‡Ë\x08J3É\x15<+H\x13\x1D0§[\x00§À[‘ñ˙êżYğ\x12qÄĜĦ\x19¸KŻmI", -"MHASH_HAVAL256" => b"ŜG\x00Ÿ‡Ġé˘NÏPwÖ\x0CH6WلĞ+·€ġ‡,Êö\x1C\x0DgdZ„ŽUŝá\x07)oAiÉ[Naîú²d…TÁ\x17\x1F°˘ü2ŞZîÓĠÁUÓ46}IYb,ÚŜŝC\x17½\x1AuùÔŝ÷{ñ’[x", -"MHASH_HAVAL224" => b"\\J˙=‚ZÖ\x08ö\x08Èêçyî8ha Ĉ\x0A˜ó×p³Ĥg|yÂÚÜĞqŬàÀ\x19\x1E\x06ƒ—Ğ) -ċËĵlĵnj¨G\x0CB@kwèÂşQ“ù‚v52O¸PĴ-0·5\x00L m`G-2I", -"MHASH_HAVAL192" => b"\"àÂq&\x02<….ùA\x07ğ/\x1Eá2°d\x17‹Ëû\x1C2ĉXv\x0Bp½ĊħĊ%™\x03\x16(ÂC;î+\x08pĞz8²\x12\x15\x13NÁ\x08‰uıİd‡d)qهşùv_ÙĉÖMINŞ„Żçà xLt—žşħLJ", -"MHASH_HAVAL160" => b"Öċï\x07óúÌídníĥ6GXìŜmĈû\x06\x1E\x00¤–ġη#÷ŽĦ5ˆM–‚\"míiÁ\x1D„1\$\x0Eù|­XGı¸ÊÉ\x19Á\x17~Ä\x0D~", -"MHASH_RIPEMD160" => b"äĠÛFšòŸxâı\x0DÇ5ÉÏ\x02\x0a\x1D[\x19ĤgDXgw”ÔÜĦDÔ&ĊbŻùŽ†jŠ’B™ëö°êš7ù‡Ħû]éĥGí[\x14G`^\x1BĞ\x08Kç “\x11\x17ë3C-ABâ%ß\x04K\x03??öK´Ħ†‚¤ù", -"MHASH_GOST" => b"ÀDöi½~†C•=wĈ‚ŭ\x17’BÙß\x15}­ĝsM–\x01äd|\x01‚4h“Yç\"\x0A°I*b@фÄxc@sŜ¨y†ŭN%d÷×\x09ĥŠFD\x0a\x12\x12Pà\x0FÇĠ}EİÀ~â:pOôŒ\x0D­pwìR{\x19M‡", -"MHASH_TIGER" => b"gêÉ{Ê\nGħö&/3däÎ#7`ŝ2UöBQ/Óy)şÌñçX#k'h¤ÂÀÀn‹ä/÷E‚¸İ›ÛÀ˜p*M1 VÄÉKÚyşO`Ġ ×ĝ•M¨˘——6Ô|\"Ş", -"MHASH_CRC32" => b"H@Œ&_šYïèoQĊÒ1[Fq\"\x08ÁÌŬfŸéVÈ8\x08EöîE<¤™Mĵ:Èş…r„k*ħHœÚuħè/}›ßÛh3iWğñžJ?vu -i…=ĠW\"üó", -"MHASH_CRC32B" => b"µlĞeĤ>}û*İ]ĥFכ6\x13ŠbCÍˏ. IŻ\x0F–jœÎ0Û\x0D\x1F<˜Ĉ.Qyç–ĥtiŭ°xbĜ\$}ƒ\x0Bġ˜È´“ ×ÏĴȌDĊDK…\x13é1uLŬ6§Ħ`÷ĉɏ|Ecñ\x04°", -); - -foreach ($supported_hash_al as $hash=>$wanted) { - $passwd = str_repeat($hash, 10); - $salt = str_repeat($hash, 2); - $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100); - if (!strcmp($result, $wanted)) { - echo "$hash\nok\n"; - } else { - echo "$hash: "; - var_dump(bin2hex($wanted)); - echo "$hash: "; - var_dump(bin2hex($result)); - } - echo "\n"; -} -?> diff --git a/ext/mhash/tests/skip.inc b/ext/mhash/tests/skip.inc deleted file mode 100644 index ff60bfff275bc..0000000000000 --- a/ext/mhash/tests/skip.inc +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/mime_magic/CREDITS b/ext/mime_magic/CREDITS deleted file mode 100644 index ce54609ecc633..0000000000000 --- a/ext/mime_magic/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mime_magic -Hartmut Holzgraefe diff --git a/ext/mime_magic/DEPRECATED b/ext/mime_magic/DEPRECATED deleted file mode 100644 index d4d42e6f923d8..0000000000000 --- a/ext/mime_magic/DEPRECATED +++ /dev/null @@ -1,36 +0,0 @@ -This extension is deprecated, please use the fileinfo extension -from PECL instead. - -Back when i implemented mime_magic there was no library interface -to the file utilities functionality. The only way to get the -functionality in place was to get the file sources and replace -the input and output routines within with code interfacing to -your own stuff. This work was originally done by the developers -of apache mod_magic, the mime_magic extension just replaced the -apache specific parts with their PHP counterparts. - -Now that the codebase of the file utilities is cleanly devided -into the libmagic library and the file utility built upon it -the original hack is no longer needed. Using libmagic and the -fileinfo extension does not only provide a cleaner interface -to files functionality but also additional functionality so -that theres no reason to keep around mime_magic anymore. - -To keep existing code originaly coded for mime_magic without -changes you may add the following compatibility wrapper function -to your codebase: - -function mime_content_type($file) { - static $finfo = false; - - if ($finfo === false) { - $finfo = finfo_open(MAGIC_MIME); - } - - if (is_resource($file)) { - $buf = fread($fp, 65536); - return finfo_buffer($buf); - } else { - return finfo_file($file); - } -} \ No newline at end of file diff --git a/ext/mime_magic/EXPERIMENTAL b/ext/mime_magic/EXPERIMENTAL deleted file mode 100644 index add2b3b7e6d41..0000000000000 --- a/ext/mime_magic/EXPERIMENTAL +++ /dev/null @@ -1,2 +0,0 @@ -this extension never left the "experimental" status -and is now superseded by PECL::fileinfo diff --git a/ext/mime_magic/TODO b/ext/mime_magic/TODO deleted file mode 100644 index 1ea9c17745452..0000000000000 --- a/ext/mime_magic/TODO +++ /dev/null @@ -1,3 +0,0 @@ -- general cleanup -- support for content-encoding / compressed files -- nuke all TSRMLS_FETCH() calls where possible diff --git a/ext/mime_magic/config.m4 b/ext/mime_magic/config.m4 deleted file mode 100644 index 0e53bc5d56a72..0000000000000 --- a/ext/mime_magic/config.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(mime-magic, whether to include mime_magic support, -[ --with-mime-magic[=FILE] - Include mime_magic support (deprecated)]) - -if test "$PHP_MIME_MAGIC" != "no"; then - - PHP_NEW_EXTENSION(mime_magic, mime_magic.c, $ext_shared) - - PHP_MIME_MAGIC_FILE_PATH= - - dnl - dnl Try to see if we can find the path of the magic file in its default locations. - dnl - if test "$PHP_MIME_MAGIC" != "yes"; then - if test -f $PHP_MIME_MAGIC; then - PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC - else - AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!]) - fi - else - MAGIC_MIME_LOCATIONS="/usr/local/apache/conf/magic /usr/local/etc/apache/conf/magic /etc/apache/magic /etc/httpd/conf/magic /usr/share/magic.mime /usr/share/misc/magic.mime /etc/magic.mime" - - for i in $MAGIC_MIME_LOCATIONS; do - if test -f $i; then - PHP_MIME_MAGIC_FILE_PATH=$i - break - fi - done - fi - - AC_DEFINE_UNQUOTED(PHP_MIME_MAGIC_FILE_PATH,"$PHP_MIME_MAGIC_FILE_PATH",[magic file path]) - -fi diff --git a/ext/mime_magic/config.w32 b/ext/mime_magic/config.w32 deleted file mode 100644 index 8c48a8949087e..0000000000000 --- a/ext/mime_magic/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mime-magic", "Mime Magic support", "no"); - -if (PHP_MIME_MAGIC != "no") { - EXTENSION('mime_magic', 'mime_magic.c'); -} - diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c deleted file mode 100644 index c627d64730c43..0000000000000 --- a/ext/mime_magic/mime_magic.c +++ /dev/null @@ -1,1982 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - - $Id$ - - This module contains a lot of stuff taken from Apache mod_mime_magic, - so the license section is a little bit longer than usual: - - ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR - * ITS 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. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * mod_mime_magic: MIME type lookup via file magic numbers - * Copyright (c) 1996-1997 Cisco Systems, Inc. - * - * This software was submitted by Cisco Systems to the Apache Group in July - * 1997. Future revisions and derivatives of this source code must - * acknowledge Cisco Systems as the original contributor of this module. - * All other licensing and usage conditions are those of the Apache Group. - * - * Some of this code is derived from the free version of the file command - * originally posted to comp.sources.unix. Copyright info for that program - * is included below as required. - * --------------------------------------------------------------------------- - * - Copyright (c) Ian F. Darwin, 1987. Written by Ian F. Darwin. - * - * This software is not subject to any license of the American Telephone and - * Telegraph Company or of the Regents of the University of California. - * - * Permission is granted to anyone to use this software for any purpose on any - * computer system, and to alter it and redistribute it freely, subject to - * the following restrictions: - * - * 1. The author is not responsible for the consequences of use of this - * software, no matter how awful, even if they arise from flaws in it. - * - * 2. The origin of this software must not be misrepresented, either by - * explicit claim or by omission. Since few users ever read sources, credits - * must appear in the documentation. - * - * 3. Altered versions must be plainly marked as such, and must not be - * misrepresented as being the original software. Since few users ever read - * sources, credits must appear in the documentation. - * - * 4. This notice may not be removed or altered. - * ------------------------------------------------------------------------- - * - * For compliance with Mr Darwin's terms: this has been very significantly - * modified from the free "file" command. - * - all-in-one file for compilation convenience when moving from one - * version of Apache to the next. - * - Memory allocation is done through the Apache API's pool structure. - * - All functions have had necessary Apache API request or server - * structures passed to them where necessary to call other Apache API - * routines. (i.e. usually for logging, files, or memory allocation in - * itself or a called function.) - * - struct magic has been converted from an array to a single-ended linked - * list because it only grows one record at a time, it's only accessed - * sequentially, and the Apache API has no equivalent of realloc(). - * - Functions have been changed to get their parameters from the server - * configuration instead of globals. (It should be reentrant now but has - * not been tested in a threaded environment.) - * - Places where it used to print results to stdout now saves them in a - * list where they're used to set the MIME type in the Apache request - * record. - * - Command-line flags have been removed since they will never be used here. - * - * Ian Kluft - * Engineering Information Framework - * Central Engineering - * Cisco Systems, Inc. - * San Jose, CA, USA - * - * Initial installation July/August 1996 - * Misc bug fixes May 1997 - * Submission to Apache Group July 1997 - * - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_streams.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mime_magic.h" -#include "phpmimemagic.h" - -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef PHP_WIN32 -#define PHP_MIME_MAGIC_FILE_PATH PHP_PREFIX "\\magic.mime" -#endif - -#define BYTE 1 -#define SHORT 2 -#define LONG 4 -#define STRING 5 -#define DATE 6 -#define BESHORT 7 -#define BELONG 8 -#define BEDATE 9 -#define LESHORT 10 -#define LELONG 11 -#define LEDATE 12 - -static int apprentice(void); -static int ascmagic(unsigned char *, int); -static int is_tar(unsigned char *, unsigned int); -static int softmagic(unsigned char *, int); -static void tryit(unsigned char *, int, int); - -static int getvalue(struct magic *, char **); -static int hextoint(int); -static char *getstr(char *, char *, int, int *); -static int parse(char *, int); - -static int match(unsigned char *, int); -static int mget(union VALUETYPE *, unsigned char *, - struct magic *, int); -static int mcheck(union VALUETYPE *, struct magic *); -static void mprint(union VALUETYPE *, struct magic *); -static int mconvert(union VALUETYPE *, struct magic *); -static int magic_rsl_get(char **, char **); -static int magic_process(zval * TSRMLS_DC); - -static long from_oct(int, char *); -static int fsmagic(zval * TSRMLS_DC); - - -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) -static int zmagic(unsigned char *, int); -#endif - -static magic_req_rec *magic_set_config(void); -static void magic_free_config(magic_req_rec *); - -ZEND_DECLARE_MODULE_GLOBALS(mime_magic) - - -/* True global resources - no need for thread safety here */ -static magic_server_config_rec mime_global; - -/* {{{ mime_magic_functions[] */ -function_entry mime_magic_functions[] = { - PHP_FE(mime_content_type, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ mime_magic_module_entry - */ -zend_module_entry mime_magic_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "mime_magic", - mime_magic_functions, - PHP_MINIT(mime_magic), - PHP_MSHUTDOWN(mime_magic), - NULL, - NULL, - PHP_MINFO(mime_magic), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_MIME_MAGIC -ZEND_GET_MODULE(mime_magic) -#endif - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() -STD_PHP_INI_ENTRY("mime_magic.magicfile", PHP_MIME_MAGIC_FILE_PATH, PHP_INI_SYSTEM, OnUpdateString, magicfile, zend_mime_magic_globals, mime_magic_globals) -STD_PHP_INI_BOOLEAN("mime_magic.debug", "0", PHP_INI_SYSTEM, OnUpdateBool, debug, zend_mime_magic_globals, mime_magic_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_mime_magic_init_globals - */ -static void php_mime_magic_init_globals(zend_mime_magic_globals *mime_magic_globals) -{ - memset(mime_magic_globals, 0, sizeof(zend_mime_magic_globals)); - mime_global.magic = NULL; - mime_global.last = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(mime_magic) -{ - ZEND_INIT_MODULE_GLOBALS(mime_magic, php_mime_magic_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - if (MIME_MAGIC_G(magicfile)) { - if(apprentice()) { - MIME_MAGIC_G(status) = "invalid magic file, disabled"; - } else { - MIME_MAGIC_G(status) = "enabled"; - } - } else { - MIME_MAGIC_G(status) = "no magic file given, disabled"; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(mime_magic) -{ - UNREGISTER_INI_ENTRIES(); - if (mime_global.magic != NULL && mime_global.magic != (struct magic *) -1) { - struct magic *iter = mime_global.magic; - while (iter != NULL) { - struct magic *iter_next = iter->next; - free(iter); - iter = iter_next; - } - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(mime_magic) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "mime_magic support", MIME_MAGIC_G(status)); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - - -/* {{{ proto string mime_content_type(string filename|resource stream) - Return content-type for file */ -PHP_FUNCTION(mime_content_type) -{ - zval *what; - magic_server_config_rec *conf = &mime_global; - char *content_type=NULL, *content_encoding=NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &what) == FAILURE) { - return; - } - - switch (Z_TYPE_P(what)) { - case IS_STRING: - break; - case IS_RESOURCE: - { - php_stream *stream; - - php_stream_from_zval_no_verify(stream, &what); - if (stream) { - break; - } - } - /* fallthru if not a stream resource */ - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "can only process string or stream arguments"); - RETURN_FALSE; - break; - } - - if (conf->magic == (struct magic *)-1) { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_ERROR, "mime_magic could not be initialized, magic file %s is not available", MIME_MAGIC_G(magicfile)); - RETURN_FALSE; - } - - if(!conf->magic) { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, "mime_magic not initialized"); - RETURN_FALSE; - } - - MIME_MAGIC_G(req_dat) = magic_set_config(); - - if(MIME_MAGIC_OK != magic_process(what TSRMLS_CC)) { - RETVAL_FALSE; - } else if(MIME_MAGIC_OK != magic_rsl_get(&content_type, &content_encoding)) { - RETVAL_FALSE; - } else { - RETVAL_STRING(content_type, 1); - } - - if(content_type) efree(content_type); - if(content_encoding) efree(content_encoding); - - magic_free_config(MIME_MAGIC_G(req_dat)); -} -/* }}} */ - -#define EATAB {while (isspace((unsigned char) *l)) ++l;} - -/* - * apprentice - load configuration from the magic file r - * API request record - */ -static int apprentice(void) -{ - FILE *f; - char line[BUFSIZ + 1]; - int errs = 0; - int lineno; - char *fname; - magic_server_config_rec *conf = &mime_global; - TSRMLS_FETCH(); - - if (!MIME_MAGIC_G(magicfile)) { - return -1; - } - - fname = MIME_MAGIC_G(magicfile); /* todo cwd? */ - f = fopen(fname, "rb"); - if (f == NULL) { - conf->magic = (struct magic *)-1; - return -1; - } - - /* set up the magic list (empty) */ - conf->magic = conf->last = NULL; - - /* parse it */ - for (lineno = 1; fgets(line, BUFSIZ, f) != NULL; lineno++) { - int ws_offset; - - /* delete newline */ - if (line[0]) { - line[strlen(line) - 1] = '\0'; - } - - /* skip leading whitespace */ - ws_offset = 0; - while (line[ws_offset] && isspace(line[ws_offset])) { - ws_offset++; - } - - /* skip blank lines */ - if (line[ws_offset] == 0) { - continue; - } - - /* comment, do not parse */ - if (line[ws_offset] == '#') - continue; - - /* parse it */ - if (parse(line + ws_offset, lineno) != 0) - ++errs; - } - - (void) fclose(f); - - return (errs ? -1 : 0); -} - -/* - * extend the sign bit if the comparison is to be signed - */ -static unsigned long signextend(struct magic *m, unsigned long v) -{ - if (!(m->flag & UNSIGNED)) - switch (m->type) { - /* - * Do not remove the casts below. They are vital. When later - * compared with the data, the sign extension must have happened. - */ - case BYTE: - v = (char) v; - break; - case SHORT: - case BESHORT: - case LESHORT: - v = (short) v; - break; - case DATE: - case BEDATE: - case LEDATE: - case LONG: - case BELONG: - case LELONG: - v = (long) v; - break; - case STRING: - break; - default: - { - TSRMLS_FETCH(); - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": can't happen: m->type=%d", m->type); - return -1; - } - } - return v; -} - -/* - * - */ -static int is_valid_mimetype(char *p, int p_len) -{ - if (p_len > 0) { - do { - if (!isalnum(*p) && (*p != '-') && (*p != '.')) { - return 0; - } - } while (*(++p) != '/'); - ++p; - do { - if (!isalnum(*p) && (*p != '-') && (*p != '.') && !isspace(*p)) { - return 0; - } - } while (*(++p)); - } - return 1; -} - -/* - * parse one line from magic file, put into magic[index++] if valid - */ -static int parse(char *l, int lineno) -{ - struct magic *m; - char *t, *s; - magic_server_config_rec *conf = &mime_global; - TSRMLS_FETCH(); - - /* allocate magic structure entry */ - m = (struct magic *) calloc(1, sizeof(struct magic)); - - /* append to linked list */ - m->next = NULL; - if (!conf->magic || !conf->last) { - conf->magic = conf->last = m; - } - else { - conf->last->next = m; - conf->last = m; - } - - /* set values in magic structure */ - m->flag = 0; - m->cont_level = 0; - m->lineno = lineno; - - while (*l == '>') { - ++l; /* step over */ - m->cont_level++; - } - - if (m->cont_level != 0 && *l == '(') { - ++l; /* step over */ - m->flag |= INDIR; - } - - /* get offset, then skip over it */ - m->offset = (int) strtol(l, &t, 0); - if (l == t) { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": (%s:%d) offset `%s' invalid", MIME_MAGIC_G(magicfile), lineno, l); - } - l = t; - - if (m->flag & INDIR) { - m->in.type = LONG; - m->in.offset = 0; - /* - * read [.lbs][+-]nnnnn) - */ - if (*l == '.') { - switch (*++l) { - case 'l': - m->in.type = LONG; - break; - case 's': - m->in.type = SHORT; - break; - case 'b': - m->in.type = BYTE; - break; - default: - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": (%s:%d) indirect offset type %c invalid", MIME_MAGIC_G(magicfile), lineno, *l); - break; - } - l++; - } - s = l; - if (*l == '+' || *l == '-') - l++; - if (isdigit((unsigned char) *l)) { - m->in.offset = strtol(l, &t, 0); - if (*s == '-') - m->in.offset = -m->in.offset; - } - else - t = l; - if (*t++ != ')') { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": (%s:%d) missing ')' in indirect offset", MIME_MAGIC_G(magicfile), lineno); - } - l = t; - } - - - while (isdigit((unsigned char) *l)) - ++l; - EATAB; - -#define NBYTE 4 -#define NSHORT 5 -#define NLONG 4 -#define NSTRING 6 -#define NDATE 4 -#define NBESHORT 7 -#define NBELONG 6 -#define NBEDATE 6 -#define NLESHORT 7 -#define NLELONG 6 -#define NLEDATE 6 - - if (*l == 'u') { - ++l; - m->flag |= UNSIGNED; - } - - /* get type, skip it */ - if (strncmp(l, "byte", NBYTE) == 0) { - m->type = BYTE; - l += NBYTE; - } - else if (strncmp(l, "short", NSHORT) == 0) { - m->type = SHORT; - l += NSHORT; - } - else if (strncmp(l, "long", NLONG) == 0) { - m->type = LONG; - l += NLONG; - } - else if (strncmp(l, "string", NSTRING) == 0) { - m->type = STRING; - l += NSTRING; - } - else if (strncmp(l, "date", NDATE) == 0) { - m->type = DATE; - l += NDATE; - } - else if (strncmp(l, "beshort", NBESHORT) == 0) { - m->type = BESHORT; - l += NBESHORT; - } - else if (strncmp(l, "belong", NBELONG) == 0) { - m->type = BELONG; - l += NBELONG; - } - else if (strncmp(l, "bedate", NBEDATE) == 0) { - m->type = BEDATE; - l += NBEDATE; - } - else if (strncmp(l, "leshort", NLESHORT) == 0) { - m->type = LESHORT; - l += NLESHORT; - } - else if (strncmp(l, "lelong", NLELONG) == 0) { - m->type = LELONG; - l += NLELONG; - } - else if (strncmp(l, "ledate", NLEDATE) == 0) { - m->type = LEDATE; - l += NLEDATE; - } - else { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": (%s:%d) type %s invalid", MIME_MAGIC_G(magicfile), lineno, l); - return -1; - } - /* New-style anding: "0 byte&0x80 =0x80 dynamically linked" */ - if (*l == '&') { - ++l; - m->mask = signextend(m, strtol(l, &l, 0)); - } - else - m->mask = ~0L; - EATAB; - - switch (*l) { - case '>': - case '<': - /* Old-style anding: "0 byte &0x80 dynamically linked" */ - case '&': - case '^': - case '=': - m->reln = *l; - ++l; - break; - case '!': - if (m->type != STRING) { - m->reln = *l; - ++l; - break; - } - /* FALL THROUGH */ - default: - if (*l == 'x' && isspace((unsigned char) l[1])) { - m->reln = *l; - ++l; - goto GetDesc; /* Bill The Cat */ - } - m->reln = '='; - break; - } - EATAB; - - if (getvalue(m, &l)) - return -1; - /* - * now get last part - the description - */ - GetDesc: - EATAB; - if (l[0] == '\b') { - ++l; - m->nospflag = 1; - } - else if ((l[0] == '\\') && (l[1] == 'b')) { - ++l; - ++l; - m->nospflag = 1; - } - else - m->nospflag = 0; - - if (!is_valid_mimetype(l, strlen(l))) { - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, ": (%s:%d) '%s' is not a valid mimetype, entry skipped", MIME_MAGIC_G(magicfile), lineno, l); - return -1; - } - - strncpy(m->desc, l, sizeof(m->desc) - 1); - m->desc[sizeof(m->desc) - 1] = '\0'; - - return 0; -} - -/* - * Read a numeric value from a pointer, into the value union of a magic - * pointer, according to the magic type. Update the string pointer to point - * just after the number read. Return 0 for success, non-zero for failure. - */ -static int getvalue(struct magic *m, char **p) -{ - int slen; - - if (m->type == STRING) { - *p = getstr(*p, m->value.s, sizeof(m->value.s), &slen); - m->vallen = slen; - } - else if (m->reln != 'x') - m->value.l = signextend(m, strtol(*p, p, 0)); - return 0; -} - -/* - * Convert a string containing C character escapes. Stop at an unescaped - * space or tab. Copy the converted version to "p", returning its length in - * *slen. Return updated scan pointer as function result. - */ -static char *getstr(register char *s, register char *p, - int plen, int *slen) -{ - char *origs = s, *origp = p; - char *pmax = p + plen - 1; - register int c; - register int val; - - while ((c = *s++) != '\0') { - if (isspace((unsigned char) c)) - break; - if (p >= pmax) { - TSRMLS_FETCH(); - if(MIME_MAGIC_G(debug)) - php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_WARNING, "string too long: %s", origs); - break; - } - if (c == '\\') { - switch (c = *s++) { - - case '\0': - goto out; - - default: - *p++ = (char) c; - break; - - case 'n': - *p++ = '\n'; - break; - - case 'r': - *p++ = '\r'; - break; - - case 'b': - *p++ = '\b'; - break; - - case 't': - *p++ = '\t'; - break; - - case 'f': - *p++ = '\f'; - break; - - case 'v': - *p++ = '\v'; - break; - - /* \ and up to 3 octal digits */ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - val = c - '0'; - c = *s++; /* try for 2 */ - if (c >= '0' && c <= '7') { - val = (val << 3) | (c - '0'); - c = *s++; /* try for 3 */ - if (c >= '0' && c <= '7') - val = (val << 3) | (c - '0'); - else - --s; - } - else - --s; - *p++ = (char) val; - break; - - /* \x and up to 3 hex digits */ - case 'x': - val = 'x'; /* Default if no digits */ - c = hextoint(*s++); /* Get next char */ - if (c >= 0) { - val = c; - c = hextoint(*s++); - if (c >= 0) { - val = (val << 4) + c; - c = hextoint(*s++); - if (c >= 0) { - val = (val << 4) + c; - } - else - --s; - } - else - --s; - } - else - --s; - *p++ = (char) val; - break; - } - } - else - *p++ = (char) c; - } - out: - *p = '\0'; - *slen = p - origp; - return s; -} - -/* Single hex char to int; -1 if not a hex char. */ -static int hextoint(int c) -{ - if (isdigit((unsigned char) c)) - return c - '0'; - if ((c >= 'a') && (c <= 'f')) - return c + 10 - 'a'; - if ((c >= 'A') && (c <= 'F')) - return c + 10 - 'A'; - return -1; -} - - -/* - * RSL (result string list) processing routines - * - * These collect strings that would have been printed in fragments by file(1) - * into a list of magic_rsl structures with the strings. When complete, - * they're concatenated together to become the MIME content and encoding - * types. - * - * return value conventions for these functions: functions which return int: - * failure = -1, other = result functions which return pointers: failure = 0, - * other = result - */ - -/* allocate a per-request structure and put it in the request record */ -static magic_req_rec *magic_set_config(void) -{ - magic_req_rec *req_dat = (magic_req_rec *) emalloc(sizeof(magic_req_rec)); - - req_dat->head = req_dat->tail = (magic_rsl *) NULL; - return req_dat; -} - -static void magic_free_config(magic_req_rec *req_dat) { - magic_rsl *curr, *next; - - if(!req_dat) return; - - curr = req_dat->head; - while(curr) { - next = curr->next; - efree(curr->str); - efree(curr); - curr = next; - } - - efree(req_dat); -} - -/* add a string to the result string list for this request */ -/* it is the responsibility of the caller to allocate "str" */ -static int magic_rsl_add(char *str) -{ - magic_req_rec *req_dat; - magic_rsl *rsl; - TSRMLS_FETCH(); - - req_dat = MIME_MAGIC_G(req_dat); - - /* make sure we have a list to put it in */ - if (!req_dat) { - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "request config should not be NULL"); - if (!(req_dat = magic_set_config())) { - /* failure */ - return -1; - } - } - - /* allocate the list entry */ - rsl = (magic_rsl *) emalloc(sizeof(magic_rsl)); - - /* fill it */ - rsl->str = estrdup(str); - rsl->next = (magic_rsl *) NULL; - - /* append to the list */ - if (req_dat->head && req_dat->tail) { - req_dat->tail->next = rsl; - req_dat->tail = rsl; - } - else { - req_dat->head = req_dat->tail = rsl; - } - - /* success */ - return 0; -} - -/* RSL hook for puts-type functions */ -static int magic_rsl_puts(char *str) -{ - return magic_rsl_add(str); -} - -/* RSL hook for printf-type functions */ -static int magic_rsl_printf(char *str,...) -{ - va_list ap; - - char buf[MAXMIMESTRING]; - - /* assemble the string into the buffer */ - va_start(ap, str); - vsnprintf(buf, sizeof(buf), str, ap); - va_end(ap); - - /* add the buffer to the list */ - return magic_rsl_add(buf); -} - -/* RSL hook for putchar-type functions */ -static int magic_rsl_putchar(char c) -{ - char str[2]; - - /* high overhead for 1 char - just hope they don't do this much */ - str[0] = c; - str[1] = '\0'; - return magic_rsl_add(str); -} - -/* allocate and copy a contiguous string from a result string list */ -static char *rsl_strdup(int start_frag, int start_pos, int len) -{ - char *result; /* return value */ - int cur_frag, /* current fragment number/counter */ - cur_pos, /* current position within fragment */ - res_pos; /* position in result string */ - magic_rsl *frag; /* list-traversal pointer */ - magic_req_rec *req_dat; - TSRMLS_FETCH(); - - req_dat = MIME_MAGIC_G(req_dat); - - /* allocate the result string */ - result = (char *) emalloc(len + 2); - - /* loop through and collect the string */ - res_pos = 0; - for (frag = req_dat->head, cur_frag = 0; - frag->next; - frag = frag->next, cur_frag++) { - /* loop to the first fragment */ - if (cur_frag < start_frag) - continue; - - /* loop through and collect chars */ - for (cur_pos = (cur_frag == start_frag) ? start_pos : 0; - frag->str[cur_pos]; - cur_pos++) { - if (cur_frag >= start_frag - && cur_pos >= start_pos - && res_pos <= len) { - result[res_pos++] = frag->str[cur_pos]; - if (res_pos > len) { - break; - } - } - } - } - - /* clean up and return */ - result[res_pos] = 0; - - return result; -} - -/* - * magic_process - process input file r Apache API request record - * (formerly called "process" in file command, prefix added for clarity) Opens - * the file and reads a fixed-size buffer to begin processing the contents. - */ -static int magic_process(zval *what TSRMLS_DC) -{ - php_stream *stream; - unsigned char buf[HOWMANY + 1]; /* one extra for terminating '\0' */ - int nbytes = 0; /* number of bytes read from a datafile */ - int result; - off_t streampos; - - /* - * first try judging the file based on its filesystem status - */ - switch ((result = fsmagic(what TSRMLS_CC))) { - case MIME_MAGIC_DONE: - magic_rsl_putchar('\n'); - return MIME_MAGIC_OK; - case MIME_MAGIC_OK: - break; - default: - /* fatal error, bail out */ - return result; - } - - switch (Z_TYPE_P(what)) { - case IS_STRING: - stream = php_stream_open_wrapper(Z_STRVAL_P(what), "rb", IGNORE_PATH | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - if (stream == NULL) { - /* We can't open it, but we were able to stat it. */ - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't read `%s'", Z_STRVAL_P(what)); - /* let some other handler decide what the problem is */ - return MIME_MAGIC_DECLINED; - } - break; - case IS_RESOURCE: - php_stream_from_zval_no_verify(stream, &what); /* we tested this before, so it should work here */ - streampos = php_stream_tell(stream); /* remember stream position for restauration */ - php_stream_seek(stream, 0, SEEK_SET); - break; - default: - return -1; - } - - - /* - * try looking at the first HOWMANY bytes - */ - if ((nbytes = php_stream_read(stream, (char *) buf, sizeof(buf) - 1)) == -1) { - if(MIME_MAGIC_G(debug)) { - if (Z_TYPE_P(what) == IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed on stream"); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s", Z_STRVAL_P(what)); - } - } - return MIME_MAGIC_ERROR; - } - - if (nbytes == 0) - magic_rsl_puts(MIME_TEXT_UNKNOWN); - else { - buf[nbytes++] = '\0'; /* null-terminate it */ - tryit(buf, nbytes, 1); - } - - if (Z_TYPE_P(what) == IS_RESOURCE) { - php_stream_seek(stream, streampos, SEEK_SET); - } else { - (void) php_stream_close(stream); - } - (void) magic_rsl_putchar('\n'); - - return MIME_MAGIC_OK; -} - -static void tryit(unsigned char *buf, int nb, int checkzmagic) -{ - /* - * Try compression stuff - */ -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) - if (checkzmagic == 1) { - if (zmagic(buf, nb) == 1) - return; - } -#endif - - /* - * try tests in /etc/magic (or surrogate magic file) - */ - if (softmagic(buf, nb) == 1) - return; - - /* - * try known keywords, check for ascii-ness too. - */ - if (ascmagic(buf, nb) == 1) - return; - - /* - * abandon hope, all ye who remain here - */ - magic_rsl_puts(MIME_BINARY_UNKNOWN); -} - - -/* - * return MIME_MAGIC_DONE to indicate it's been handled - * return MIME_MAGIC_OK to indicate it's a regular file still needing handling - * other returns indicate a failure of some sort - */ -static int fsmagic(zval *what TSRMLS_DC) -{ - php_stream_statbuf stat_ssb; - - switch (Z_TYPE_P(what)) { - case IS_STRING: - if(!php_stream_stat_path(Z_STRVAL_P(what), &stat_ssb)) { - return MIME_MAGIC_OK; - } - break; - case IS_RESOURCE: - { - php_stream *stream; - - php_stream_from_zval_no_verify(stream, &what); - if(!php_stream_stat(stream, &stat_ssb)) { - return MIME_MAGIC_OK; - } - } - break; - } - - switch (stat_ssb.sb.st_mode & S_IFMT) { - case S_IFDIR: - magic_rsl_puts(DIR_MAGIC_TYPE); - return MIME_MAGIC_DONE; - case S_IFCHR: - /* - * (void) magic_rsl_printf(r,"character special (%d/%d)", - * major(sb->st_rdev), minor(sb->st_rdev)); - */ - (void) magic_rsl_puts(MIME_BINARY_UNKNOWN); - return MIME_MAGIC_DONE; -#ifdef S_IFBLK - case S_IFBLK: - /* - * (void) magic_rsl_printf(r,"block special (%d/%d)", - * major(sb->st_rdev), minor(sb->st_rdev)); - */ - (void) magic_rsl_puts(MIME_BINARY_UNKNOWN); - return MIME_MAGIC_DONE; - /* TODO add code to handle V7 MUX and Blit MUX files */ -#endif -#ifdef S_IFIFO - case S_IFIFO: - /* - * magic_rsl_puts(r,"fifo (named pipe)"); - */ - (void) magic_rsl_puts(MIME_BINARY_UNKNOWN); - return MIME_MAGIC_DONE; -#endif -#ifdef S_IFLNK - case S_IFLNK: - /* We used stat(), the only possible reason for this is that the - * symlink is broken. - */ - if(MIME_MAGIC_G(debug)) { - /* no need to check argument type here, this can only happen with strings */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "broken symlink (%s)", Z_STRVAL_P(what)); - } - return MIME_MAGIC_ERROR; -#endif -#ifdef S_IFSOCK -#ifndef __COHERENT__ - case S_IFSOCK: - magic_rsl_puts(MIME_BINARY_UNKNOWN); - return MIME_MAGIC_DONE; -#endif -#endif - case S_IFREG: - break; - case 0: - break; - default: - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid mode 0%o.", (unsigned int)stat_ssb.sb.st_mode); - return MIME_MAGIC_ERROR; - } - - /* - * regular file, check next possibility - */ - if (stat_ssb.sb.st_size == 0) { - magic_rsl_puts(MIME_TEXT_UNKNOWN); - return MIME_MAGIC_DONE; - } - return MIME_MAGIC_OK; -} - -/* - * softmagic - lookup one file in database (already read from /etc/magic by - * apprentice.c). Passed the name and FILE * of one file to be typed. - */ -/* ARGSUSED1 *//* nbytes passed for regularity, maybe need later */ -static int softmagic(unsigned char *buf, int nbytes) -{ - if (match(buf, nbytes)) - return 1; - - return 0; -} - -/* - * Go through the whole list, stopping if you find a match. Process all the - * continuations of that match before returning. - * - * We support multi-level continuations: - * - * At any time when processing a successful top-level match, there is a current - * continuation level; it represents the level of the last successfully - * matched continuation. - * - * Continuations above that level are skipped as, if we see one, it means that - * the continuation that controls them - i.e, the lower-level continuation - * preceding them - failed to match. - * - * Continuations below that level are processed as, if we see one, it means - * we've finished processing or skipping higher-level continuations under the - * control of a successful or unsuccessful lower-level continuation, and are - * now seeing the next lower-level continuation and should process it. The - * current continuation level reverts to the level of the one we're seeing. - * - * Continuations at the current level are processed as, if we see one, there's - * no lower-level continuation that may have failed. - * - * If a continuation matches, we bump the current continuation level so that - * higher-level continuations are processed. - */ -static int match(unsigned char *s, int nbytes) -{ - int cont_level = 0; - int need_separator = 0; - union VALUETYPE p; - magic_server_config_rec *conf = &mime_global; - struct magic *m; - - for (m = conf->magic; m; m = m->next) { - /* check if main entry matches */ - if (!mget(&p, s, m, nbytes) || - !mcheck(&p, m)) { - struct magic *m_cont; - - /* - * main entry didn't match, flush its continuations - */ - if (!m->next || (m->next->cont_level == 0)) { - continue; - } - - m_cont = m->next; - while (m_cont && (m_cont->cont_level != 0)) { - /* - * this trick allows us to keep *m in sync when the continue - * advances the pointer - */ - m = m_cont; - m_cont = m_cont->next; - } - continue; - } - - /* if we get here, the main entry rule was a match */ - /* this will be the last run through the loop */ - - /* print the match */ - mprint(&p, m); - - /* - * If we printed something, we'll need to print a blank before we - * print something else. - */ - if (m->desc[0]) - need_separator = 1; - /* and any continuations that match */ - cont_level++; - /* - * while (m && m->next && m->next->cont_level != 0 && ( m = m->next - * )) - */ - m = m->next; - while (m && (m->cont_level != 0)) { - if (cont_level >= m->cont_level) { - if (cont_level > m->cont_level) { - /* - * We're at the end of the level "cont_level" - * continuations. - */ - cont_level = m->cont_level; - } - if (mget(&p, s, m, nbytes) && - mcheck(&p, m)) { - /* - * This continuation matched. Print its message, with a - * blank before it if the previous item printed and this - * item isn't empty. - */ - /* space if previous printed */ - if (need_separator - && (m->nospflag == 0) - && (m->desc[0] != '\0') - ) { - (void) magic_rsl_putchar(' '); - need_separator = 0; - } - mprint(&p, m); - if (m->desc[0]) - need_separator = 1; - - /* - * If we see any continuations at a higher level, process - * them. - */ - cont_level++; - } - } - - /* move to next continuation record */ - m = m->next; - } - return 1; /* all through */ - } - return 0; /* no match at all */ -} - -/* an optimization over plain strcmp() */ -#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) - -static int ascmagic(unsigned char *buf, int nbytes) -{ - int has_escapes = 0; - unsigned char *s; - char nbuf[HOWMANY + 1]; /* one extra for terminating '\0' */ - char *token; - register struct names *p; - int small_nbytes; - - /* these are easy, do them first */ - - /* - * for troff, look for . + letter + letter or .\"; this must be done to - * disambiguate tar archives' ./file and other trash from real troff - * input. - */ - if (*buf == '.') { - unsigned char *tp = buf + 1; - - while (isspace(*tp)) - ++tp; /* skip leading whitespace */ - if ((isalnum(*tp) || *tp == '\\') && - (isalnum(*(tp + 1)) || *tp == '"')) { - magic_rsl_puts("application/x-troff"); - return 1; - } - } - if ((*buf == 'c' || *buf == 'C') && isspace(*(buf + 1))) { - /* Fortran */ - magic_rsl_puts("text/plain"); - return 1; - } - - /* look for tokens from names.h - this is expensive!, so we'll limit - * ourselves to only SMALL_HOWMANY bytes */ - small_nbytes = (nbytes > SMALL_HOWMANY) ? SMALL_HOWMANY : nbytes; - /* make a copy of the buffer here because strtok() will destroy it */ - s = (unsigned char *) memcpy(nbuf, buf, small_nbytes); - s[small_nbytes] = '\0'; - has_escapes = (memchr(s, '\033', small_nbytes) != NULL); - /* XXX: not multithread safe */ - while ((token = strtok((char *) s, " \t\n\r\f")) != NULL) { - s = NULL; /* make strtok() keep on tokin' */ - for (p = names; p < names + NNAMES; p++) { - if (STREQ(p->name, token)) { - magic_rsl_puts(types[p->type]); - if (has_escapes) - magic_rsl_puts(" (with escape sequences)"); - return 1; - } - } - } - - switch (is_tar(buf, nbytes)) { - case 1: - /* V7 tar archive */ - magic_rsl_puts("application/x-tar"); - return 1; - case 2: - /* POSIX tar archive */ - magic_rsl_puts("application/x-tar"); - return 1; - } - - /* all else fails, but it is ascii... */ - if (has_escapes) { - /* text with escape sequences */ - /* we leave this open for further differentiation later */ - magic_rsl_puts("text/plain"); - } - else { - /* plain text */ - magic_rsl_puts("text/plain"); - } - return 1; -} - -/* - * is_tar() -- figure out whether file is a tar archive. - * - * Stolen (by author of file utility) from the public domain tar program: Public - * Domain version written 26 Aug 1985 John Gilmore (ihnp4!hoptoad!gnu). - * - * @(#)list.c 1.18 9/23/86 Public Domain - gnu $Id: mod_mime_magic.c,v 1.7 - * 1997/06/24 00:41:02 ikluft Exp ikluft $ - * - * Comments changed and some code/comments reformatted for file command by Ian - * Darwin. - */ - -#define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) - -/* - * Return 0 if the checksum is bad (i.e., probably not a tar archive), 1 for - * old UNIX tar file, 2 for Unix Std (POSIX) tar file. - */ - -static int is_tar(unsigned char *buf, unsigned int nbytes) -{ - register union record *header = (union record *) buf; - register int i; - register long sum, recsum; - register char *p; - - if (nbytes < sizeof(union record)) - return 0; - - recsum = from_oct(8, header->header.chksum); - - sum = 0; - p = header->charptr; - for (i = sizeof(union record); --i >= 0;) { - /* - * We can't use unsigned char here because of old compilers, e.g. V7. - */ - sum += 0xFF & *p++; - } - - /* Adjust checksum to count the "chksum" field as blanks. */ - for (i = sizeof(header->header.chksum); --i >= 0;) - sum -= 0xFF & header->header.chksum[i]; - sum += ' ' * sizeof header->header.chksum; - - if (sum != recsum) - return 0; /* Not a tar archive */ - - if (0 == strcmp(header->header.magic, TMAGIC)) - return 2; /* Unix Standard tar archive */ - - return 1; /* Old fashioned tar archive */ -} - - -/* - * Quick and dirty octal conversion. - * - * Result is -1 if the field is invalid (all blank, or nonoctal). - */ -static long from_oct(int digs, char *where) -{ - register long value; - - while (isspace(*where)) { /* Skip spaces */ - where++; - if (--digs <= 0) - return -1; /* All blank field */ - } - value = 0; - while (digs > 0 && isodigit(*where)) { /* Scan til nonoctal */ - value = (value << 3) | (*where++ - '0'); - --digs; - } - - if (digs > 0 && *where && !isspace(*where)) - return -1; /* Ended on non-space/nul */ - - return value; -} - -static int mget(union VALUETYPE *p, unsigned char *s, - struct magic *m, int nbytes) -{ - long offset = m->offset; - - if (offset + (long)sizeof(union VALUETYPE) > nbytes) - return 0; - - memcpy(p, s + offset, sizeof(union VALUETYPE)); - - if (!mconvert(p, m)) - return 0; - - if (m->flag & INDIR) { - - switch (m->in.type) { - case BYTE: - offset = p->b + m->in.offset; - break; - case SHORT: - offset = p->h + m->in.offset; - break; - case LONG: - offset = p->l + m->in.offset; - break; - } - - if (offset + (long)sizeof(union VALUETYPE) > nbytes) - return 0; - - memcpy(p, s + offset, sizeof(union VALUETYPE)); - - if (!mconvert(p, m)) - return 0; - } - return 1; -} - -static int mcheck(union VALUETYPE *p, struct magic *m) -{ - register unsigned long l = m->value.l; - register unsigned long v; - int matched; - TSRMLS_FETCH(); - - if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) { - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "BOINK"); - return 1; - } - - switch (m->type) { - case BYTE: - v = p->b; - break; - - case SHORT: - case BESHORT: - case LESHORT: - v = p->h; - break; - - case LONG: - case BELONG: - case LELONG: - case DATE: - case BEDATE: - case LEDATE: - v = p->l; - break; - - case STRING: - l = 0; - /* - * What we want here is: v = strncmp(m->value.s, p->s, m->vallen); - * but ignoring any nulls. bcmp doesn't give -/+/0 and isn't - * universally available anyway. - */ - v = 0; - { - register unsigned char *a = (unsigned char *) m->value.s; - register unsigned char *b = (unsigned char *) p->s; - register int len = m->vallen; - - while (--len >= 0) - if ((v = *b++ - *a++) != 0) - break; - } - break; - default: - /* bogosity, pretend that it just wasn't a match */ - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid type %d in mcheck().", m->type); - return 0; - } - - v = signextend(m, v) & m->mask; - - switch (m->reln) { - case 'x': - matched = 1; - break; - - case '!': - matched = v != l; - break; - - case '=': - matched = v == l; - break; - - case '>': - if (m->flag & UNSIGNED) { - matched = v > l; - } - else { - matched = (long) v > (long) l; - } - break; - - case '<': - if (m->flag & UNSIGNED) { - matched = v < l; - } - else { - matched = (long) v < (long) l; - } - break; - - case '&': - matched = (v & l) == l; - break; - - case '^': - matched = (v & l) != l; - break; - - default: - /* bogosity, pretend it didn't match */ - matched = 0; - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mcheck: can't happen: invalid relation %d.", m->reln); - break; - } - - return matched; -} - -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) -/* - * compress routines: zmagic() - returns 0 if not recognized, uncompresses - * and prints information if recognized uncompress(s, method, old, n, newch) - * - uncompress old into new, using method, return sizeof new - */ - -static int zmagic(unsigned char *buf, int nbytes) -{ - if (buf[0] != 0x1f) return 0; - - switch(buf[1]) { - case 0x9d: /* .Z "x-compress" */ - break; /* not yet supportet */ - - case 0x8b: /* .gz "x-gzip" */ -#if 0 - if ((newsize = magic_uncompress(i, &newbuf, nbytes)) > 0) { - tryit(newbuf, newsize, 0); - - /* set encoding type in the request record */ - /* TODO r->content_encoding = compr[i].encoding; */ - } -#endif - break; /* not yet supported */ - - case 0x1e: /* simply packed ? */ - break; /* not yet supported */ - } - - return 0; -} -#endif - -static void mprint(union VALUETYPE *p, struct magic *m) -{ - char *pp, *rt; - unsigned long v; - - switch (m->type) { - case BYTE: - v = p->b; - break; - - case SHORT: - case BESHORT: - case LESHORT: - v = p->h; - break; - - case LONG: - case BELONG: - case LELONG: - v = p->l; - break; - - case STRING: - if (m->reln == '=') { - (void) magic_rsl_printf(m->desc, m->value.s); - } - else { - (void) magic_rsl_printf(m->desc, p->s); - } - return; - - case DATE: - case BEDATE: - case LEDATE: - /* XXX: not multithread safe */ - pp = ctime((time_t *) & p->l); - if ((rt = strchr(pp, '\n')) != NULL) - *rt = '\0'; - (void) magic_rsl_printf(m->desc, pp); - return; - default: - { - TSRMLS_FETCH(); - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid m->type (%d) in mprint().", m->type); - return; - } - } - - v = signextend(m, v) & m->mask; - (void) magic_rsl_printf(m->desc, (unsigned long) v); -} - -/* - * Convert the byte order of the data we are looking at - */ -static int mconvert(union VALUETYPE *p, struct magic *m) -{ - char *rt; - - switch (m->type) { - case BYTE: - case SHORT: - case LONG: - case DATE: - return 1; - case STRING: - /* Null terminate and eat the return */ - p->s[sizeof(p->s) - 1] = '\0'; - if ((rt = strchr(p->s, '\n')) != NULL) - *rt = '\0'; - return 1; - case BESHORT: - p->h = (short) ((p->hs[0] << 8) | (p->hs[1])); - return 1; - case BELONG: - case BEDATE: - p->l = (long) - ((p->hl[0] << 24) | (p->hl[1] << 16) | (p->hl[2] << 8) | (p->hl[3])); - return 1; - case LESHORT: - p->h = (short) ((p->hs[1] << 8) | (p->hs[0])); - return 1; - case LELONG: - case LEDATE: - p->l = (long) - ((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0])); - return 1; - default: - { - TSRMLS_FETCH(); - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid type %d in mconvert().", m->type); - return 0; - } - } -} - - -/* states for the state-machine algorithm in magic_rsl_to_request() */ -typedef enum { - rsl_leading_space, rsl_type, rsl_subtype, rsl_separator, rsl_encoding -} rsl_states; - -/* process the RSL and set the MIME info in the request record */ -static int magic_rsl_get(char **content_type, char **content_encoding) -{ - int cur_frag, /* current fragment number/counter */ - cur_pos, /* current position within fragment */ - type_frag, /* content type starting point: fragment */ - type_pos, /* content type starting point: position */ - type_len, /* content type length */ - encoding_frag, /* content encoding starting point: fragment */ - encoding_pos, /* content encoding starting point: position */ - encoding_len; /* content encoding length */ - - magic_rsl *frag; /* list-traversal pointer */ - rsl_states state; - - magic_req_rec *req_dat; - - TSRMLS_FETCH(); - - req_dat = MIME_MAGIC_G(req_dat); - - /* check if we have a result */ - if (!req_dat || !req_dat->head) { - /* empty - no match, we defer to other Apache modules */ - return MIME_MAGIC_DECLINED; - } - - /* start searching for the type and encoding */ - state = rsl_leading_space; - type_frag = type_pos = type_len = 0; - encoding_frag = encoding_pos = encoding_len = 0; - for (frag = req_dat->head, cur_frag = 0; - frag && frag->next; - frag = frag->next, cur_frag++) { - /* loop through the characters in the fragment */ - for (cur_pos = 0; frag->str[cur_pos]; cur_pos++) { - if (isspace(frag->str[cur_pos])) { - /* process whitespace actions for each state */ - if (state == rsl_leading_space) { - /* eat whitespace in this state */ - continue; - } - else if (state == rsl_type) { - /* whitespace: type has no slash! */ - return MIME_MAGIC_DECLINED; - } - else if (state == rsl_subtype) { - /* whitespace: end of MIME type */ - state++; - continue; - } - else if (state == rsl_separator) { - /* eat whitespace in this state */ - continue; - } - else if (state == rsl_encoding) { - /* whitespace: end of MIME encoding */ - /* we're done */ - frag = req_dat->tail; - break; - } - else { - /* should not be possible */ - /* abandon malfunctioning module */ - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, ": bad state %d (ws)", state); - return MIME_MAGIC_DECLINED; - } - /* NOTREACHED */ - } - else if (state == rsl_type && - frag->str[cur_pos] == '/') { - /* copy the char and go to rsl_subtype state */ - type_len++; - state++; - } - else { - /* process non-space actions for each state */ - if (state == rsl_leading_space) { - /* non-space: begin MIME type */ - state++; - type_frag = cur_frag; - type_pos = cur_pos; - type_len = 1; - continue; - } - else if (state == rsl_type || - state == rsl_subtype) { - /* non-space: adds to type */ - type_len++; - continue; - } - else if (state == rsl_separator) { - /* non-space: begin MIME encoding */ - state++; - encoding_frag = cur_frag; - encoding_pos = cur_pos; - encoding_len = 1; - continue; - } - else if (state == rsl_encoding) { - /* non-space: adds to encoding */ - encoding_len++; - continue; - } - else { - /* should not be possible */ - /* abandon malfunctioning module */ - if(MIME_MAGIC_G(debug)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "bad state %d (ns)", state); - return MIME_MAGIC_DECLINED; - } - /* NOTREACHED */ - } - /* NOTREACHED */ - } - } - - /* if we ended prior to state rsl_subtype, we had incomplete info */ - if (state != rsl_subtype && state != rsl_separator && - state != rsl_encoding) { - /* defer to other modules */ - return MIME_MAGIC_DECLINED; - } - - /* save the info in the request record */ - if (state == rsl_subtype || state == rsl_encoding || - state == rsl_encoding) { - char *tmp; - tmp = rsl_strdup(type_frag, type_pos, type_len); - /* XXX: this could be done at config time I'm sure... but I'm - * confused by all this magic_rsl stuff. -djg */ - /* TODO ap_content_type_tolower(tmp); */ - *content_type = tmp; - } - if (state == rsl_encoding) { - char *tmp; - tmp = rsl_strdup(encoding_frag, - encoding_pos, encoding_len); - /* XXX: this could be done at config time I'm sure... but I'm - * confused by all this magic_rsl stuff. -djg */ - /* TODO ap_str_tolower(tmp); */ - *content_encoding = tmp; - } - - /* detect memory allocation errors */ - if (!content_type || !(*content_type) || (state == rsl_encoding && !*content_encoding)) { - return MIME_MAGIC_ERROR; - } - - /* success! */ - return MIME_MAGIC_OK; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mime_magic/mime_magic.dsp b/ext/mime_magic/mime_magic.dsp deleted file mode 100644 index 7c6ce312cfa32..0000000000000 --- a/ext/mime_magic/mime_magic.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mime_magic" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mime_magic - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mime_magic.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mime_magic.mak" CFG="mime_magic - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mime_magic - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mime_magic - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mime_magic - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MIME_MAGIC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MIME_MAGIC" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MIME_MAGIC_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mime_magic.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "mime_magic - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MIME_MAGIC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MIME_MAGIC" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MIME_MAGIC_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mime_magic.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "mime_magic - Win32 Release_TS" -# Name "mime_magic - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mime_magic.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mime_magic.h -# End Source File -# Begin Source File - -SOURCE=.\phpmimemagic.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/mime_magic/package.xml b/ext/mime_magic/package.xml deleted file mode 100644 index 34701c730011a..0000000000000 --- a/ext/mime_magic/package.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - mime_magic - MIME type detection using magic numbers - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - lead - - - -mime_magic tries to detect a files MIME type by testing certain -byte positions against known magic numbers collected in a data -file. It uses the same file format as the UNIX file program and -apache mod_magic. The actual code is based on detection code from -apache mod_magic which is itself an adaption of the original 'file' -code. - - PHP - - beta - 1.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - diff --git a/ext/mime_magic/php_mime_magic.h b/ext/mime_magic/php_mime_magic.h deleted file mode 100644 index 9ee66916a6dce..0000000000000 --- a/ext/mime_magic/php_mime_magic.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifndef PHP_MIME_MAGIC_H -#define PHP_MIME_MAGIC_H - -extern zend_module_entry mime_magic_module_entry; -#define phpext_mime_magic_ptr &mime_magic_module_entry - -#ifdef PHP_WIN32 -#define PHP_MIME_MAGIC_API __declspec(dllexport) -#else -#define PHP_MIME_MAGIC_API -#endif - -PHP_MINIT_FUNCTION(mime_magic); -PHP_MSHUTDOWN_FUNCTION(mime_magic); -PHP_RINIT_FUNCTION(mime_magic); -PHP_RSHUTDOWN_FUNCTION(mime_magic); -PHP_MINFO_FUNCTION(mime_magic); - -PHP_FUNCTION(mime_content_type); - -#endif /* PHP_MIME_MAGIC_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/mime_magic/phpmimemagic.h b/ext/mime_magic/phpmimemagic.h deleted file mode 100644 index 9849030f924be..0000000000000 --- a/ext/mime_magic/phpmimemagic.h +++ /dev/null @@ -1,380 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifndef PHPMIMEMAGIC_H -#define PHPMIMEMAGIC_H - -#define MIME_MAGIC_DEBUG 0 - -#define MIME_BINARY_UNKNOWN "application/octet-stream" -#define MIME_TEXT_UNKNOWN "text/plain" - -#define MAXMIMESTRING 256 - -#define MIME_MAGIC_OK 0 -#define MIME_MAGIC_DECLINED -1 -#define MIME_MAGIC_DONE -2 -#define MIME_MAGIC_ERROR -3 - -#define DIR_MAGIC_TYPE "httpd/unix-directory" - -/* HOWMANY must be at least 4096 to make gzip -dcq work */ -#define HOWMANY 4096 -/* SMALL_HOWMANY limits how much work we do to figure out text files */ -#define SMALL_HOWMANY 1024 -#define MAXDESC 50 /* max leng of text description */ -#define MAXstring 64 /* max leng of "string" types */ - -struct magic { - struct magic *next; /* link to next entry */ - int lineno; /* line number from magic file */ - - short flag; -#define INDIR 1 /* if '>(...)' appears, */ -#define UNSIGNED 2 /* comparison is unsigned */ - short cont_level; /* level of ">" */ - struct { - char type; /* byte short long */ - long offset; /* offset from indirection */ - } in; - long offset; /* offset to magic number */ - unsigned char reln; /* relation (0=eq, '>'=gt, etc) */ - char type; /* int, short, long or string. */ - char vallen; /* length of string value, if any */ - union VALUETYPE { - unsigned char b; - unsigned short h; - unsigned long l; - char s[MAXstring]; - unsigned char hs[2]; /* 2 bytes of a fixed-endian "short" */ - unsigned char hl[4]; /* 2 bytes of a fixed-endian "long" */ - } value; /* either number or string */ - unsigned long mask; /* mask before comparison with value */ - char nospflag; /* supress space character */ - - /* NOTE: this string is suspected of overrunning - find it! */ - char desc[MAXDESC]; /* description */ -}; - -/* - * data structures for tar file recognition - * -------------------------------------------------------------------------- - * Header file for public domain tar (tape archive) program. - * - * @(#)tar.h 1.20 86/10/29 Public Domain. Created 25 August 1985 by John - * Gilmore, ihnp4!hoptoad!gnu. - * - * Header block on tape. - * - * I'm going to use traditional DP naming conventions here. A "block" is a big - * chunk of stuff that we do I/O on. A "record" is a piece of info that we - * care about. Typically many "record"s fit into a "block". - */ -#define RECORDSIZE 512 -#define NAMSIZ 100 -#define TUNMLEN 32 -#define TGNMLEN 32 - -union record { - char charptr[RECORDSIZE]; - struct header { - char name[NAMSIZ]; - char mode[8]; - char uid[8]; - char gid[8]; - char size[12]; - char mtime[12]; - char chksum[8]; - char linkflag; - char linkname[NAMSIZ]; - char magic[8]; - char uname[TUNMLEN]; - char gname[TGNMLEN]; - char devmajor[8]; - char devminor[8]; - } header; -}; - -/* The magic field is filled with this if uname and gname are valid. */ -#define TMAGIC "ustar " /* 7 chars and a null */ - -/* - * file-function prototypes - */ -/*TODO*/ -#define request_rec void -#define server_rec void -#define pool void -#define cmd_parms void - -/* - * includes for ASCII substring recognition formerly "names.h" in file - * command - * - * Original notes: names and types used by ascmagic in file(1). These tokens are - * here because they can appear anywhere in the first HOWMANY bytes, while - * tokens in /etc/magic must appear at fixed offsets into the file. Don't - * make HOWMANY too high unless you have a very fast CPU. - */ - -/* these types are used to index the table 'types': keep em in sync! */ -/* HTML inserted in first because this is a web server module now */ -#define L_HTML 0 /* HTML */ -#define L_C 1 /* first and foremost on UNIX */ -#define L_FORT 2 /* the oldest one */ -#define L_MAKE 3 /* Makefiles */ -#define L_PLI 4 /* PL/1 */ -#define L_MACH 5 /* some kinda assembler */ -#define L_ENG 6 /* English */ -#define L_PAS 7 /* Pascal */ -#define L_MAIL 8 /* Electronic mail */ -#define L_NEWS 9 /* Usenet Netnews */ - -static char *types[] = - { - "text/html", /* HTML */ - "text/plain", /* "c program text", */ - "text/plain", /* "fortran program text", */ - "text/plain", /* "make commands text", */ - "text/plain", /* "pl/1 program text", */ - "text/plain", /* "assembler program text", */ - "text/plain", /* "English text", */ - "text/plain", /* "pascal program text", */ - "message/rfc822", /* "mail text", */ - "message/news", /* "news text", */ - "application/binary", /* "can't happen error on names.h/types", */ - 0 - }; - -static struct names { - char *name; - short type; -} names[] = { - - /* These must be sorted by eye for optimal hit rate */ - /* Add to this list only after substantial meditation */ - { - "", L_HTML - }, - { - "", L_HTML - }, - { - "", L_HTML - }, - { - "", L_HTML - }, - { - "", L_HTML - }, - { - "<TITLE>", L_HTML - }, - { - "<h1>", L_HTML - }, - { - "<H1>", L_HTML - }, - { - "<!--", L_HTML - }, - { - "<!DOCTYPE HTML", L_HTML - }, - { - "/*", L_C - }, /* must precede "The", "the", etc. */ - { - "#include", L_C - }, - { - "char", L_C - }, - { - "The", L_ENG - }, - { - "the", L_ENG - }, - { - "double", L_C - }, - { - "extern", L_C - }, - { - "float", L_C - }, - { - "real", L_C - }, - { - "struct", L_C - }, - { - "union", L_C - }, - { - "CFLAGS", L_MAKE - }, - { - "LDFLAGS", L_MAKE - }, - { - "all:", L_MAKE - }, - { - ".PRECIOUS", L_MAKE - }, - /* - * Too many files of text have these words in them. Find another way to - * recognize Fortrash. - */ -#ifdef NOTDEF - { - "subroutine", L_FORT - }, - { - "function", L_FORT - }, - { - "block", L_FORT - }, - { - "common", L_FORT - }, - { - "dimension", L_FORT - }, - { - "integer", L_FORT - }, - { - "data", L_FORT - }, -#endif /* NOTDEF */ - { - ".ascii", L_MACH - }, - { - ".asciiz", L_MACH - }, - { - ".byte", L_MACH - }, - { - ".even", L_MACH - }, - { - ".globl", L_MACH - }, - { - "clr", L_MACH - }, - { - "(input,", L_PAS - }, - { - "dcl", L_PLI - }, - { - "Received:", L_MAIL - }, - { - ">From", L_MAIL - }, - { - "Return-Path:", L_MAIL - }, - { - "Cc:", L_MAIL - }, - { - "Newsgroups:", L_NEWS - }, - { - "Path:", L_NEWS - }, - { - "Organization:", L_NEWS - }, - { - NULL, 0 - } -}; - -#define NNAMES ((sizeof(names)/sizeof(struct names)) - 1) - -/* - * Result String List (RSL) - * - * The file(1) command prints its output. Instead, we store the various - * "printed" strings in a list (allocating memory as we go) and concatenate - * them at the end when we finally know how much space they'll need. - */ - -typedef struct magic_rsl_s { - char *str; /* string, possibly a fragment */ - struct magic_rsl_s *next; /* pointer to next fragment */ -} magic_rsl; - -/* - * Apache module configuration structures - */ - -/* per-server info */ -typedef struct { - struct magic *magic; /* head of magic config list */ - struct magic *last; -} magic_server_config_rec; - -/* per-request info */ -typedef struct { - magic_rsl *head; /* result string list */ - magic_rsl *tail; - unsigned suf_recursion; /* recursion depth in suffix check */ -} magic_req_rec; - - -/* Globals */ -ZEND_BEGIN_MODULE_GLOBALS(mime_magic) - char *magicfile; - magic_req_rec *req_dat; - int debug; /* shall magic file parser errors be shown? */ - char *status; /* status message for phpinfo() */ -ZEND_END_MODULE_GLOBALS(mime_magic) - -#ifdef ZTS -#define MIME_MAGIC_G(v) TSRMG(mime_magic_globals_id, zend_mime_magic_globals *, v) -#else -#define MIME_MAGIC_G(v) (mime_magic_globals.v) -#endif - -#endif /* PHPMIMEMAGIC_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/ming/CREDITS b/ext/ming/CREDITS deleted file mode 100644 index 836d10d449b8d..0000000000000 --- a/ext/ming/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -MING -Dave Hayden, Frank M. Kromann diff --git a/ext/ming/EXPERIMENTAL b/ext/ming/EXPERIMENTAL deleted file mode 100644 index 6443e99646410..0000000000000 --- a/ext/ming/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/ext/ming/config.m4 b/ext/ming/config.m4 deleted file mode 100644 index a20e3bd980152..0000000000000 --- a/ext/ming/config.m4 +++ /dev/null @@ -1,80 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(ming, for MING support, -[ --with-ming[=DIR] Include MING support]) - -if test "$PHP_MING" != "no"; then - AC_CHECK_LIB(m, sin) - - for i in $PHP_MING /usr/local /usr; do - if test -f $i/$PHP_LIBDIR/libming.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libming.a; then - MING_DIR=$i - break - fi - done - - if test -z "$MING_DIR"; then - AC_MSG_ERROR(Please reinstall ming distribution. libming.(a|so) not found.) - fi - - for i in $MING_DIR/include $MING_DIR/include/ming $MING_DIR/ming/include; do - if test -f $i/ming.h; then - MING_INC_DIR=$i - fi - done - - if test -z "$MING_INC_DIR"; then - AC_MSG_ERROR(Please reinstall ming distribution. ming.h not found.) - fi - - PHP_CHECK_LIBRARY(ming, Ming_useSWFVersion, [ - AC_DEFINE(HAVE_MING,1,[ ]) - ],[ - AC_MSG_ERROR([Ming library 0.2a or greater required.]) - ],[ - -L$MING_DIR/$PHP_LIBDIR - ]) - - PHP_ADD_INCLUDE($MING_INC_DIR) - PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/$PHP_LIBDIR, MING_SHARED_LIBADD) - - AC_MSG_CHECKING([for destroySWFBlock]) - AC_TRY_RUN([ -#include "ming.h" -int destroySWFBlock(int a, int b) { - return a+b; -} -int main() { - return destroySWFBlock(-1,1); /* returns 0 only if function is not yet defined */ -} - ],[ - AC_MSG_RESULT([missing]) - ],[ - AC_DEFINE(HAVE_DESTROY_SWF_BLOCK,1,[ ]) - AC_MSG_RESULT([ok]) - ],[ - AC_MSG_RESULT([unknown]) - ]) - - PHP_CHECK_LIBRARY(ming, SWFPrebuiltClip, [ AC_DEFINE(HAVE_SWFPREBUILTCLIP, 1, [ ]) ], [], []) - -dnl Check Ming version (FIXME: if/when ming has some better way to detect the version..) - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$MING_INC_DIR - AC_EGREP_CPP(yes, [ -#include <ming.h> -#ifdef SWF_SOUND_COMPRESSION -yes -#endif - ], [ - AC_DEFINE(HAVE_NEW_MING, 1, [ ]) - dnl FIXME: This is now unconditional..better check coming later. - AC_DEFINE(HAVE_MING_ZLIB, 1, [ ]) - ]) - CPPFLAGS=$old_CPPFLAGS - - PHP_NEW_EXTENSION(ming, ming.c, $ext_shared) - PHP_SUBST(MING_SHARED_LIBADD) -fi diff --git a/ext/ming/config.w32 b/ext/ming/config.w32 deleted file mode 100644 index 228e620a77a7d..0000000000000 --- a/ext/ming/config.w32 +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("ming", "MING support", "no"); - -// this is a temporary hack -function ming_check_version() -{ - var c = null; - var v; - var ming_h = CHECK_HEADER_ADD_INCLUDE("ming.h", "CFLAGS_MING", PHP_MING); - - if (!ming_h) { - return false; - } - - c = file_get_contents(ming_h + "\\ming.h"); - if (typeof(c) == "string" && c.match(/MING_VERSION\s+(0.[a-zA-Z0-9]+)/)) { - v = RegExp.$1; - if (v > "0.2") { - if (CHECK_LIB("libungif.lib", "ming", PHP_MING) && - CHECK_LIB("libpng.lib", "ming", PHP_MING)) { - AC_DEFINE('HAVE_NEW_MING', 1); - AC_DEFINE('HAVE_SWFPREBUILTCLIP', 1); - if (PHP_ZLIB != "no") { - AC_DEFINE('HAVE_MING_ZLIB', 1); - } - } - } - } - return true; -} - -if (PHP_MING != "no") { - if (ming_check_version() && CHECK_LIB("libming.lib", "ming", PHP_MING)) { - if (PHP_ZLIB_SHARED) { - CHECK_LIB("zlib.lib", "ming", PHP_MING); - } - EXTENSION('ming', 'ming.c'); - AC_DEFINE('HAVE_MING', 1); - } else { - WARNING("ming not enabled; libraries and headers not found"); - } -} - diff --git a/ext/ming/ming.c b/ext/ming/ming.c deleted file mode 100644 index 8a4fd9ecb5f4c..0000000000000 --- a/ext/ming/ming.c +++ /dev/null @@ -1,4176 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Dave Hayden <dave@opaque.net> | - | Frank M. Kromann <fmk@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/fsock.h" -#include "php_streams.h" - -#if HAVE_MING - -#include "php_ming.h" -#include <stdio.h> -#include <math.h> -#include <ming.h> - -#define FLOAT_Z_DVAL_PP(x) ((float)Z_DVAL_PP(x)) -#define BYTE_Z_LVAL_PP(x) ((byte)Z_LVAL_PP(x)) - -#ifndef HAVE_DESTROY_SWF_BLOCK -void destroySWFBlock(SWFBlock block); -#endif - -static zend_function_entry ming_functions[] = { - PHP_FALIAS(ming_setcubicthreshold, ming_setCubicThreshold, NULL) - PHP_FALIAS(ming_setscale, ming_setScale, NULL) - PHP_FALIAS(ming_useswfversion, ming_useSWFVersion, NULL) - PHP_FALIAS(ming_keypress, ming_keypress, NULL) -#ifdef HAVE_NEW_MING - PHP_FALIAS(ming_useconstants, ming_useConstants, NULL) -#endif - { NULL, NULL, NULL } -}; - -static SWFMovie getMovie(zval *id TSRMLS_DC); -static SWFFill getFill(zval *id TSRMLS_DC); -static SWFGradient getGradient(zval *id TSRMLS_DC); -static SWFBitmap getBitmap(zval *id TSRMLS_DC); -static SWFShape getShape(zval *id TSRMLS_DC); -static SWFFont getFont(zval *id TSRMLS_DC); -static SWFText getText(zval *id TSRMLS_DC); -static SWFTextField getTextField(zval *id TSRMLS_DC); -static SWFDisplayItem getDisplayItem(zval *id TSRMLS_DC); -static SWFButton getButton(zval *id TSRMLS_DC); -static SWFAction getAction(zval *id TSRMLS_DC); -static SWFMorph getMorph(zval *id TSRMLS_DC); -static SWFMovieClip getSprite(zval *id TSRMLS_DC); -static SWFSound getSound(zval *id TSRMLS_DC); -#ifdef HAVE_NEW_MING -static SWFFontCharacter getFontCharacter(zval *id TSRMLS_DC); -static SWFSoundInstance getSoundInstance(zval *id TSRMLS_DC); -static SWFVideoStream getVideoStream(zval *id TSRMLS_DC); -#endif -#ifdef HAVE_SWFPREBUILTCLIP -static SWFPrebuiltClip getPrebuiltClip(zval *id TSRMLS_DC); -#endif - -#define PHP_MING_FILE_CHK(file) \ - if ((PG(safe_mode) && !php_checkuid((file), NULL, CHECKUID_CHECK_FILE_AND_DIR)) || php_check_open_basedir((file) TSRMLS_CC)) { \ - RETURN_FALSE; \ - } \ - -/* {{{ proto void ming_setcubicthreshold (int threshold) - Set cubic threshold (?) */ -PHP_FUNCTION(ming_setCubicThreshold) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(num); - Ming_setCubicThreshold(Z_LVAL_PP(num)); -} -/* }}} */ - -/* {{{ proto void ming_setscale(int scale) - Set scale (?) */ -PHP_FUNCTION(ming_setScale) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Ming_setScale(FLOAT_Z_DVAL_PP(num)); -} -/* }}} */ - -/* {{{ proto void ming_useswfversion(int version) - Use SWF version (?) */ -PHP_FUNCTION(ming_useSWFVersion) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(num); - Ming_useSWFVersion(Z_LVAL_PP(num)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void ming_useconstants(int use) - Use constant pool (?) */ -PHP_FUNCTION(ming_useConstants) -{ - zval **num; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(num); - - Ming_useConstants(Z_LVAL_PP(num)); -} -/* }}} */ -#endif - -static int le_swfmoviep; -static int le_swfshapep; -static int le_swffillp; -static int le_swfgradientp; -static int le_swfbitmapp; -static int le_swffontp; -static int le_swftextp; -static int le_swftextfieldp; -static int le_swfdisplayitemp; -static int le_swfbuttonp; -static int le_swfactionp; -static int le_swfmorphp; -static int le_swfspritep; -static int le_swfinputp; -static int le_swfsoundp; -#ifdef HAVE_NEW_MING -static int le_swffontcharp; -static int le_swfsoundinstancep; -static int le_swfvideostreamp; -#endif -#ifdef HAVE_SWFPREBUILTCLIP -static int le_swfprebuiltclipp; -#endif - -static zend_class_entry *movie_class_entry_ptr; -static zend_class_entry *shape_class_entry_ptr; -static zend_class_entry *fill_class_entry_ptr; -static zend_class_entry *gradient_class_entry_ptr; -static zend_class_entry *bitmap_class_entry_ptr; -static zend_class_entry *font_class_entry_ptr; -static zend_class_entry *text_class_entry_ptr; -static zend_class_entry *textfield_class_entry_ptr; -static zend_class_entry *displayitem_class_entry_ptr; -static zend_class_entry *button_class_entry_ptr; -static zend_class_entry *action_class_entry_ptr; -static zend_class_entry *morph_class_entry_ptr; -static zend_class_entry *sprite_class_entry_ptr; -static zend_class_entry *sound_class_entry_ptr; -#ifdef HAVE_NEW_MING -static zend_class_entry *fontchar_class_entry_ptr; -static zend_class_entry *soundinstance_class_entry_ptr; -static zend_class_entry *videostream_class_entry_ptr; -#endif -#ifdef HAVE_SWFPREBUILTCLIP -static zend_class_entry *prebuiltclip_class_entry_ptr; -#endif - -/* {{{ internal function SWFgetProperty -*/ -static void *SWFgetProperty(zval *id, char *name, int namelen, int proptype TSRMLS_DC) -{ - zval **tmp; - int id_to_find; - void *property; - int type; - - if (id) { - if (zend_hash_find(Z_OBJPROP_P(id), name, namelen+1, (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find property %s", name); - return NULL; - } - id_to_find = Z_LVAL_PP(tmp); - } else { - return NULL; - } - - property = zend_list_find(id_to_find, &type); - - if (!property || type != proptype) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find identifier (%d)", id_to_find); - return NULL; - } - - return property; -} -/* }}} */ - -/* {{{ SWFCharacter - not a real class -*/ - -/* {{{ internal function SWFCharacter getCharacter(zval *id) - Returns the SWFCharacter contained in zval *id */ -static SWFCharacter getCharacter(zval *id TSRMLS_DC) -{ - if (Z_OBJCE_P(id) == shape_class_entry_ptr) - return (SWFCharacter)getShape(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == font_class_entry_ptr) - return (SWFCharacter)getFont(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == text_class_entry_ptr) - return (SWFCharacter)getText(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == textfield_class_entry_ptr) - return (SWFCharacter)getTextField(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == button_class_entry_ptr) - return (SWFCharacter)getButton(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == morph_class_entry_ptr) - return (SWFCharacter)getMorph(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == sprite_class_entry_ptr) - return (SWFCharacter)getSprite(id TSRMLS_CC); - else if (Z_OBJCE_P(id) == bitmap_class_entry_ptr) - return (SWFCharacter)getBitmap(id TSRMLS_CC); - else if(Z_OBJCE_P(id) == sound_class_entry_ptr) - return (SWFCharacter)getSound(id TSRMLS_CC); -#ifdef HAVE_NEW_MING - - else if(Z_OBJCE_P(id) == fontchar_class_entry_ptr) - return (SWFCharacter)getFontCharacter(id TSRMLS_CC); - else if(Z_OBJCE_P(id) == soundinstance_class_entry_ptr) - return (SWFCharacter)getSoundInstance(id TSRMLS_CC); - - else if(Z_OBJCE_P(id) == videostream_class_entry_ptr) - return (SWFCharacter)getVideoStream(id TSRMLS_CC); -#endif -#ifdef HAVE_SWFPREBUILTCLIP - else if(Z_OBJCE_P(id) == prebuiltclip_class_entry_ptr) - return (SWFCharacter)getPrebuiltClip(id TSRMLS_CC); -#endif - else - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFCharacter"); - return NULL; -} -/* }}} */ -/* }}} */ - -/* {{{ getInput - utility func for making an SWFInput from an fopened resource -*/ -static void destroy_SWFInput_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFInput((SWFInput)resource->ptr); -} - -static SWFInput getInput(zval **zfile TSRMLS_DC) -{ - FILE *file; - php_stream *stream; - SWFInput input; - - php_stream_from_zval_no_verify(stream, zfile); - - if (stream == NULL) - return NULL; - - if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void *) &file, REPORT_ERRORS) != SUCCESS) { - return NULL; - } - - input = newSWFInput_file(file); - zend_list_addref(Z_LVAL_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - return input; -} -/* }}} */ - -/* {{{ SWFAction -*/ -/* {{{ proto object swfaction::__construct(string) - Returns a new SWFAction object, compiling the given script */ -PHP_METHOD(swfaction, __construct) -{ - SWFAction action; - zval **script; - int ret; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &script) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(script); - action = compileSWFActionCode(Z_STRVAL_PP(script)); - - if (!action) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Couldn't compile actionscript"); - } - - ret = zend_list_insert(action, le_swfactionp); - - object_init_ex(getThis(), action_class_entry_ptr); - add_property_resource(getThis(), "action", ret); - zend_list_addref(ret); -} -/* no destructor for SWFAction, it's not a character */ -/* }}} */ - -/* {{{ internal function getAction - Returns the SWFAction object contained in zval *id */ -static SWFAction getAction(zval *id TSRMLS_DC) -{ - void *action = SWFgetProperty(id, "action", 6, le_swfactionp TSRMLS_CC); - - if (!action) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFAction"); - } - return (SWFAction)action; -} -/* }}} */ - -static zend_function_entry swfaction_functions[] = { - PHP_ME(swfaction, __construct, NULL, 0) - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ SWFBitmap -*/ -/* {{{ proto class swfbitmap::__construct(mixed file [, mixed maskfile]) - Returns a new SWFBitmap object from jpg (with optional mask) or dbl file */ -PHP_METHOD(swfbitmap, __construct) -{ - zval **zfile, **zmask = NULL; - SWFBitmap bitmap; - SWFInput input, maskinput; - int ret; - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &zfile) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &zfile, &zmask) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(zfile) != IS_RESOURCE) { - convert_to_string_ex(zfile); - PHP_MING_FILE_CHK(Z_STRVAL_PP(zfile)); - input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - } else { - input = getInput(zfile TSRMLS_CC); - } - - if (zmask != NULL) { - if (Z_TYPE_PP(zmask) != IS_RESOURCE) { - convert_to_string_ex(zmask); - maskinput = newSWFInput_buffer(Z_STRVAL_PP(zmask), Z_STRLEN_PP(zmask)); - zend_list_addref(zend_list_insert(maskinput, le_swfinputp)); - } else { - maskinput = getInput(zmask TSRMLS_CC); - } - bitmap = newSWFJpegWithAlpha_fromInput(input, maskinput); - } else { - bitmap = newSWFBitmap_fromInput(input); - } - - ret = zend_list_insert(bitmap, le_swfbitmapp); - object_init_ex(getThis(), bitmap_class_entry_ptr); - add_property_resource(getThis(), "bitmap", ret); - zend_list_addref(ret); -} - -static void destroy_SWFBitmap_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFBitmap((SWFBitmap)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getBitmap - Returns the SWFBitmap object contained in zval *id */ -static SWFBitmap getBitmap(zval *id TSRMLS_DC) -{ - void *bitmap = SWFgetProperty(id, "bitmap", 6, le_swfbitmapp TSRMLS_CC); - - if (!bitmap) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFBitmap"); - } - return (SWFBitmap)bitmap; -} -/* }}} */ - -/* {{{ proto float swfbitmap::getWidth() - Returns the width of this bitmap */ -PHP_METHOD(swfbitmap, getWidth) -{ - RETURN_DOUBLE(SWFBitmap_getWidth(getBitmap(getThis() TSRMLS_CC))); -} -/* }}} */ - -/* {{{ proto float swfbitmap::getHeight() - Returns the height of this bitmap */ -PHP_METHOD(swfbitmap, getHeight) -{ - RETURN_DOUBLE(SWFBitmap_getHeight(getBitmap(getThis() TSRMLS_CC))); -} -/* }}} */ - -static zend_function_entry swfbitmap_functions[] = { - PHP_ME(swfbitmap, __construct, NULL, 0) - PHP_ME(swfbitmap, getWidth, NULL, 0) - PHP_ME(swfbitmap, getHeight, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFButton -*/ -/* {{{ proto object swfbutton::__construct() - Returns a new SWFButton object */ -PHP_METHOD(swfbutton, __construct) -{ - SWFButton button = newSWFButton(); - int ret = zend_list_insert(button, le_swfbuttonp); - - object_init_ex(getThis(), button_class_entry_ptr); - add_property_resource(getThis(), "button", ret); - zend_list_addref(ret); -} - -static void destroy_SWFButton_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFButton((SWFButton)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getButton - Returns the SWFButton object contained in zval *id */ -static SWFButton getButton(zval *id TSRMLS_DC) -{ - void *button = SWFgetProperty(id, "button", 6, le_swfbuttonp TSRMLS_CC); - - if (!button) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFButton"); - } - return (SWFButton)button; -} -/* }}} */ - -/* {{{ proto void swfbutton::setHit(object SWFCharacter) - Sets the character for this button's hit test state */ -PHP_METHOD(swfbutton, setHit) -{ - zval **zchar; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFCharacter character; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - character = getCharacter(*zchar TSRMLS_CC); - SWFButton_addShape(button, character, SWFBUTTONRECORD_HITSTATE); -} -/* }}} */ - -/* {{{ proto void swfbutton::setOver(object SWFCharacter) - Sets the character for this button's over state */ -PHP_METHOD(swfbutton, setOver) -{ - zval **zchar; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFCharacter character; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - character = getCharacter(*zchar TSRMLS_CC); - SWFButton_addShape(button, character, SWFBUTTONRECORD_OVERSTATE); -} -/* }}} */ - -/* {{{ proto void swfbutton::setUp(object SWFCharacter) - Sets the character for this button's up state */ -PHP_METHOD(swfbutton, setUp) -{ - zval **zchar; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFCharacter character; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - character = getCharacter(*zchar TSRMLS_CC); - SWFButton_addShape(button, character, SWFBUTTONRECORD_UPSTATE); -} -/* }}} */ - -/* {{{ proto void swfbutton::setDown(object SWFCharacter) - Sets the character for this button's down state */ -PHP_METHOD(swfbutton, setDown) -{ - zval **zchar; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFCharacter character; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - character = getCharacter(*zchar TSRMLS_CC); - SWFButton_addShape(button, character, SWFBUTTONRECORD_DOWNSTATE); -} -/* }}} */ - -/* {{{ proto void swfbutton::addShape(object SWFCharacter, int flags) - Sets the character to display for the condition described in flags */ -PHP_METHOD(swfbutton, addShape) -{ - zval **zchar, **flags; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFCharacter character; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zchar, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - character = getCharacter(*zchar TSRMLS_CC); - convert_to_long_ex(flags); - SWFButton_addShape(button, character, BYTE_Z_LVAL_PP(flags)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void swfbutton::setMenu(int flag) - enable track as menu button behaviour */ - -PHP_METHOD(swfbutton, setMenu) -{ - zval **zflag; - SWFButton button = getButton(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zflag) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_long_ex(zflag); - - SWFButton_setMenu(button, Z_LVAL_PP(zflag)); -} -/* }}} */ -#endif - -/* {{{ proto void swfbutton::setAction(object SWFAction) - Sets the action to perform when button is pressed */ -PHP_METHOD(swfbutton, setAction) -{ - zval **zaction; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFAction action; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zaction) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zaction); - action = getAction(*zaction TSRMLS_CC); - SWFButton_addAction(button, action, SWFBUTTON_OVERDOWNTOOVERUP); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto SWFSoundInstance swfbutton::addASound(SWFSound sound, int flags) - associates a sound with a button transition - NOTE: the transitions are all wrong _UP, _OVER, _DOWN _HIT */ - -PHP_METHOD(swfbutton, addSound) -{ - zval **zsound, **flags; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFSound sound; - SWFSoundInstance item; - int ret; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zsound, &flags) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zsound); - sound = getSound(*zsound TSRMLS_CC); - - convert_to_long_ex(flags); - - item = SWFButton_addSound(button, sound, Z_LVAL_PP(flags)); - - if(item != NULL) { - /* try and create a soundinstance object */ - ret = zend_list_insert(item, le_swfsoundinstancep); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); - } -} -/* }}} */ -#endif - -/* {{{ proto void swfbutton::addAction(object SWFAction, int flags) - Sets the action to perform when conditions described in flags is met */ -PHP_METHOD(swfbutton, addAction) -{ - zval **zaction, **flags; - SWFButton button = getButton(getThis() TSRMLS_CC); - SWFAction action; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zaction, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zaction); - action = getAction(*zaction TSRMLS_CC); - convert_to_long_ex(flags); - SWFButton_addAction(button, action, Z_LVAL_PP(flags)); -} -/* }}} */ - -/* {{{ proto int ming_keypress(string str) - Returns the action flag for keyPress(char) */ -PHP_FUNCTION(ming_keypress) -{ - zval **key; - char c; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &key) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(key); - - if (Z_STRLEN_PP(key) > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Only one character expected"); - } - - c = Z_STRVAL_PP(key)[0]; - RETURN_LONG((c&0x7f)<<9); -} -/* }}} */ - -static zend_function_entry swfbutton_functions[] = { - PHP_ME(swfbutton, __construct, NULL, 0) - PHP_ME(swfbutton, setHit, NULL, 0) - PHP_ME(swfbutton, setOver, NULL, 0) - PHP_ME(swfbutton, setUp, NULL, 0) - PHP_ME(swfbutton, setDown, NULL, 0) - PHP_ME(swfbutton, setAction, NULL, 0) - PHP_ME(swfbutton, addShape, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swfbutton, setMenu, NULL, 0) -#endif - PHP_ME(swfbutton, addAction, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swfbutton, addSound, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFDisplayitem -*/ -/* {{{ internal function getDisplayItem - Returns the SWFDisplayItem contained in zval *id */ -static SWFDisplayItem getDisplayItem(zval *id TSRMLS_DC) -{ - void *item = SWFgetProperty(id, "displayitem", 11, le_swfdisplayitemp TSRMLS_CC); - - if (!item) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFDisplayItem"); - } - - return (SWFDisplayItem)item; -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::moveTo(int x, int y) - Moves this SWFDisplayItem to movie coordinates (x, y) */ -PHP_METHOD(swfdisplayitem, moveTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFDisplayItem_moveTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::move(float dx, float dy) - Displaces this SWFDisplayItem by (dx, dy) in movie coordinates */ -PHP_METHOD(swfdisplayitem, move) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFDisplayItem_move(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::scaleTo(float xScale [, float yScale]) - Scales this SWFDisplayItem by xScale in the x direction, yScale in the y, or both to xScale if only one arg */ -PHP_METHOD(swfdisplayitem, scaleTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - SWFDisplayItem_scaleTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(x)); - } else if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFDisplayItem_scaleTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::scale(float xScale, float yScale) - Multiplies this SWFDisplayItem's current x scale by xScale, its y scale by yScale */ -PHP_METHOD(swfdisplayitem, scale) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFDisplayItem_scale(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::rotateTo(float degrees) - Rotates this SWFDisplayItem the given (clockwise) degrees from its original orientation */ -PHP_METHOD(swfdisplayitem, rotateTo) -{ - zval **degrees; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °rees) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(degrees); - SWFDisplayItem_rotateTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(degrees)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::rotate(float degrees) - Rotates this SWFDisplayItem the given (clockwise) degrees from its current orientation */ -PHP_METHOD(swfdisplayitem, rotate) -{ - zval **degrees; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °rees) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(degrees); - SWFDisplayItem_rotate(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(degrees)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::skewXTo(float xSkew) - Sets this SWFDisplayItem's x skew value to xSkew */ -PHP_METHOD(swfdisplayitem, skewXTo) -{ - zval **x; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - SWFDisplayItem_skewXTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::skewX(float xSkew) - Adds xSkew to this SWFDisplayItem's x skew value */ -PHP_METHOD(swfdisplayitem, skewX) -{ - zval **x; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - SWFDisplayItem_skewX(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::skewYTo(float ySkew) - Sets this SWFDisplayItem's y skew value to ySkew */ -PHP_METHOD(swfdisplayitem, skewYTo) -{ - zval **y; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(y); - SWFDisplayItem_skewYTo(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::skewY(float ySkew) - Adds ySkew to this SWFDisplayItem's y skew value */ -PHP_METHOD(swfdisplayitem, skewY) -{ - zval **y; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(y); - SWFDisplayItem_skewY(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::setMatrix(float a, float b, float c, float d, float x, float y) - Sets the item's transform matrix */ -PHP_METHOD(swfdisplayitem, setMatrix) -{ - zval **a, **b, **c, **d, **x, **y; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &a, &b, &c, &d, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(a); - convert_to_double_ex(b); - convert_to_double_ex(c); - convert_to_double_ex(d); - convert_to_double_ex(x); - convert_to_double_ex(y); - - SWFDisplayItem_setMatrix( getDisplayItem(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(a), FLOAT_Z_DVAL_PP(b), FLOAT_Z_DVAL_PP(c), FLOAT_Z_DVAL_PP(d), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y) - ); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::setDepth(int depth) - Sets this SWFDisplayItem's z-depth to depth. Items with higher depth values are drawn on top of those with lower values */ -PHP_METHOD(swfdisplayitem, setDepth) -{ - zval **depth; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &depth) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(depth); - SWFDisplayItem_setDepth(getDisplayItem(getThis() TSRMLS_CC), Z_LVAL_PP(depth)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::setRatio(float ratio) - Sets this SWFDisplayItem's ratio to ratio. Obviously only does anything if displayitem was created from an SWFMorph */ -PHP_METHOD(swfdisplayitem, setRatio) -{ - zval **ratio; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ratio) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(ratio); - SWFDisplayItem_setRatio(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(ratio)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::addColor(int r, int g, int b [, int a]) - Sets the add color part of this SWFDisplayItem's CXform to (r, g, b [, a]), a defaults to 0 */ -PHP_METHOD(swfdisplayitem, addColor) -{ - zval **r, **g, **b, **za; - int a = 0; - - if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &za) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(za); - a = Z_LVAL_PP(za); - } else if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - SWFDisplayItem_setColorAdd(getDisplayItem(getThis() TSRMLS_CC), Z_LVAL_PP(r), Z_LVAL_PP(g), Z_LVAL_PP(b), a); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::multColor(float r, float g, float b [, float a]) - Sets the multiply color part of this SWFDisplayItem's CXform to (r, g, b [, a]), a defaults to 1.0 */ -PHP_METHOD(swfdisplayitem, multColor) -{ - zval **r, **g, **b, **za; - float a = 1.0f; - - if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &za) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(za); - a = FLOAT_Z_DVAL_PP(za); - } else if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(r); - convert_to_double_ex(g); - convert_to_double_ex(b); - - SWFDisplayItem_setColorMult(getDisplayItem(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(r), FLOAT_Z_DVAL_PP(g), FLOAT_Z_DVAL_PP(b), a); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::setName(string name) - Sets this SWFDisplayItem's name to name */ -PHP_METHOD(swfdisplayitem, setName) -{ - zval **name; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(name); - SWFDisplayItem_setName(item, Z_STRVAL_PP(name)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::addAction(object SWFAction, int flags) - Adds this SWFAction to the given SWFSprite instance */ -PHP_METHOD(swfdisplayitem, addAction) -{ - zval **zaction, **flags; - SWFAction action; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zaction, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zaction); - convert_to_long_ex(flags); - action = getAction(*zaction TSRMLS_CC); - SWFDisplayItem_addAction(item, action, Z_LVAL_PP(flags)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ swfdisplayitem_remove */ - -PHP_METHOD(swfdisplayitem, remove) -{ - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - SWFDisplayItem_remove(item); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::setMaskLevel(int level) - defines a MASK layer at level */ - -PHP_METHOD(swfdisplayitem, setMaskLevel) -{ - zval **level; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &level) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(level); - - SWFDisplayItem_setMaskLevel(getDisplayItem(getThis() TSRMLS_CC), Z_LVAL_PP(level)); -} -/* }}} */ - -/* {{{ proto void swfdisplayitem::endMask() - another way of defining a MASK layer */ - -PHP_METHOD(swfdisplayitem, endMask) -{ - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - SWFDisplayItem_endMask(item); -} -/* }}} */ - -/* {{{ swfdisplayitem_getX */ - -PHP_METHOD(swfdisplayitem, getX) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_x(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getY */ - -PHP_METHOD(swfdisplayitem, getY) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_y(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getXScale */ - -PHP_METHOD(swfdisplayitem, getXScale) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_xScale(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getYScale */ - -PHP_METHOD(swfdisplayitem, getYScale) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_yScale(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getXSkew */ - -PHP_METHOD(swfdisplayitem, getXSkew) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_xSkew(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getYSkew */ - -PHP_METHOD(swfdisplayitem, getYSkew) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_ySkew(item); - RETURN_DOUBLE(ret); -} -/* }}} */ - -/* {{{ swfdisplayitem_getRot */ - -PHP_METHOD(swfdisplayitem, getRot) -{ - float ret; - SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - ret = SWFDisplayItem_get_rot(item); - RETURN_DOUBLE(ret); -} -/* }}} */ -#endif - -static zend_function_entry swfdisplayitem_functions[] = { - PHP_ME(swfdisplayitem, moveTo, NULL, 0) - PHP_ME(swfdisplayitem, move, NULL, 0) - PHP_ME(swfdisplayitem, scaleTo, NULL, 0) - PHP_ME(swfdisplayitem, scale, NULL, 0) - PHP_ME(swfdisplayitem, rotateTo, NULL, 0) - PHP_ME(swfdisplayitem, rotate, NULL, 0) - PHP_ME(swfdisplayitem, skewXTo, NULL, 0) - PHP_ME(swfdisplayitem, skewX, NULL, 0) - PHP_ME(swfdisplayitem, skewYTo, NULL, 0) - PHP_ME(swfdisplayitem, skewY, NULL, 0) - PHP_ME(swfdisplayitem, setMatrix, NULL, 0) - PHP_ME(swfdisplayitem, setDepth, NULL, 0) - PHP_ME(swfdisplayitem, setRatio, NULL, 0) - PHP_ME(swfdisplayitem, addColor, NULL, 0) - PHP_ME(swfdisplayitem, multColor, NULL, 0) - PHP_ME(swfdisplayitem, setName, NULL, 0) - PHP_ME(swfdisplayitem, addAction, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swfdisplayitem, remove, NULL, 0) - PHP_ME(swfdisplayitem, setMaskLevel,NULL, 0) - PHP_ME(swfdisplayitem, endMask, NULL, 0) - PHP_ME(swfdisplayitem, getX, NULL, 0) - PHP_ME(swfdisplayitem, getY, NULL, 0) - PHP_ME(swfdisplayitem, getXScale, NULL, 0) - PHP_ME(swfdisplayitem, getYScale, NULL, 0) - PHP_ME(swfdisplayitem, getXSkew, NULL, 0) - PHP_ME(swfdisplayitem, getYSkew, NULL, 0) - PHP_ME(swfdisplayitem, getRot, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFFill -*/ -/* {{{ proto class swffill::__construct() - Returns a new SWFFill object */ -PHP_METHOD(swffill, __construct) -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Instantiating SWFFill won't do any good- use SWFShape::addFill() instead"); -} - -static void destroy_SWFFill_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - /* this only destroys the shallow wrapper for SWFFillStyle, - which SWFShape destroys. So everything's okay. I hope. */ - - destroySWFFill((SWFFill)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getFill - Returns the SWFFill object contained in zval *id */ -static SWFFill getFill(zval *id TSRMLS_DC) -{ - void *fill = SWFgetProperty(id, "fill", 4, le_swffillp TSRMLS_CC); - - if (!fill) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFFill"); - } - return (SWFFill)fill; -} -/* }}} */ - -/* {{{ proto void swffill::moveTo(float x, float y) - Moves this SWFFill to shape coordinates (x,y) */ -PHP_METHOD(swffill, moveTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFFill_moveTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swffill::scaleTo(float xScale [, float yScale]) - Scales this SWFFill by xScale in the x direction, yScale in the y, or both to xScale if only one arg */ -PHP_METHOD(swffill, scaleTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - SWFFill_scaleXYTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(x)); - } else if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFFill_scaleXYTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto void swffill::rotateTo(float degrees) - Rotates this SWFFill the given (clockwise) degrees from its original orientation */ -PHP_METHOD(swffill, rotateTo) -{ - zval **degrees; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °rees) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(degrees); - SWFFill_rotateTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(degrees)); -} -/* }}} */ - -/* {{{ proto void swffill::skewXTo(float xSkew) - Sets this SWFFill's x skew value to xSkew */ -PHP_METHOD(swffill, skewXTo) -{ - zval **x; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - SWFFill_skewXTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x)); -} -/* }}} */ - -/* {{{ proto void swffill::skewYTo(float ySkew) - Sets this SWFFill's y skew value to ySkew */ -PHP_METHOD(swffill, skewYTo) -{ - zval **y; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(y); - SWFFill_skewYTo(getFill(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ -static zend_function_entry swffill_functions[] = { - PHP_ME(swffill, __construct, NULL, 0) - PHP_ME(swffill, moveTo, NULL, 0) - PHP_ME(swffill, scaleTo, NULL, 0) - PHP_ME(swffill, rotateTo, NULL, 0) - PHP_ME(swffill, skewXTo, NULL, 0) - PHP_ME(swffill, skewYTo, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFFontCharacter */ -#ifdef HAVE_NEW_MING - -/* {{{ internal function SWFText getFont(zval *id) - Returns the Font object in zval *id */ -static -SWFFontCharacter getFontCharacter(zval *id TSRMLS_DC) -{ - void *font = SWFgetProperty(id, "fontcharacter", 13, le_swffontcharp TSRMLS_CC); - - if(!font) - php_error(E_ERROR, "called object is not an SWFFontCharacter!"); - - return (SWFFontCharacter)font; -} -/* }}} */ - -static void destroy_SWFFontCharacter_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFBlock((SWFBlock)resource->ptr); -} - -/* {{{ proto void swffontcha::raddChars(string) - adds characters to a font for exporting font */ -PHP_METHOD(swffontchar, addChars) -{ - zval **zstring; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - SWFFontCharacter_addChars(getFontCharacter(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); -} -/* }}} */ - -/* {{{ proto void swffontchar::addChars(string) - adds characters to a font for exporting font */ - -PHP_METHOD(swffontchar, addUTF8Chars) -{ - zval **zstring; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - SWFFontCharacter_addUTF8Chars(getFontCharacter(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); -} -/* }}} */ - -static zend_function_entry swffontchar_functions[] = { - PHP_ME(swffontchar, addChars, NULL, 0) - PHP_ME(swffontchar, addUTF8Chars, NULL, 0) - { NULL, NULL, NULL } -}; - -#endif -/* }}} */ - -/* {{{ SWFFont -*/ -/* {{{ internal function SWFText getFont(zval *id) - Returns the Font object in zval *id */ -static SWFFont getFont(zval *id TSRMLS_DC) -{ - void *font = SWFgetProperty(id, "font", 4, le_swffontp TSRMLS_CC); - - if (!font) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFFont"); - } - return (SWFFont)font; -} -/* }}} */ - -/* {{{ proto object swffont::__construct(string filename) - Returns a new SWFFont object from given file */ -PHP_METHOD(swffont, __construct) -{ - zval **zfile; - SWFFont font; - int ret; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfile) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(zfile); - - if (strcmp(Z_STRVAL_PP(zfile)+Z_STRLEN_PP(zfile)-4, ".fdb") == 0) { - php_stream * stream; - FILE * file; - - stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); - - if (stream == NULL) { - RETURN_FALSE; - } - - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void*)&file, REPORT_ERRORS)) { - php_stream_close(stream); - RETURN_FALSE; - } - - font = loadSWFFontFromFile(file); - php_stream_close(stream); - } else { - PHP_MING_FILE_CHK(Z_STRVAL_PP(zfile)); - font = (SWFFont)newSWFBrowserFont(Z_STRVAL_PP(zfile)); - } - - ret = zend_list_insert(font, le_swffontp); - - object_init_ex(getThis(), font_class_entry_ptr); - add_property_resource(getThis(), "font", ret); - zend_list_addref(ret); -} - -static void destroy_SWFFont_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFBlock((SWFBlock)resource->ptr); -} -/* }}} */ - -/* {{{ proto float swffont::getWidth(string str) - Calculates the width of the given string in this font at full height */ -PHP_METHOD(swffont, getWidth) -{ - zval **zstring; - float width; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(zstring); - width = SWFFont_getStringWidth(getFont(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); - RETURN_DOUBLE(width); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto int swffont::getUTF8Width(string) - Calculates the width of the given string in this font at full height */ - -PHP_METHOD(swffont, getUTF8Width) -{ - zval **zstring; - float width; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - width = SWFFont_getUTF8StringWidth(getFont(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); - - RETURN_DOUBLE(width); -} - -/* }}} */ -/* not sure about 0 bytes !!!!!!!!! */ -/* {{{ proto int swffont::getWideWidth(string) - Calculates the width of the given string in this font at full height */ -/* -PHP_METHOD(swffont, getWideWidth) -{ - zval **zstring; - float width; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - width = SWFFont_getWideStringWidth(getFont(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); - - RETURN_DOUBLE(width); -} -*/ -/* }}} */ -#endif - -/* {{{ proto float swffont::getAscent() - Returns the ascent of the font, or 0 if not available */ -PHP_METHOD(swffont, getAscent) -{ - RETURN_DOUBLE(SWFFont_getAscent(getFont(getThis() TSRMLS_CC))); -} -/* }}} */ - -/* {{{ proto float swffont::getDescent() - Returns the descent of the font, or 0 if not available */ -PHP_METHOD(swffont, getDescent) -{ - RETURN_DOUBLE(SWFFont_getDescent(getFont(getThis() TSRMLS_CC))); -} -/* }}} */ - -/* {{{ proto float swffont::getLeading() - Returns the leading of the font, or 0 if not available */ -PHP_METHOD(swffont, getLeading) -{ - RETURN_DOUBLE(SWFFont_getLeading(getFont(getThis() TSRMLS_CC))); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void swffont::addChars(string) - adds characters to a font required within textfields */ -/* -PHP_METHOD(swffont, addChars) -{ - zval **zstring; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - SWFFont_addChars(getFont(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); -} -*/ -/* }}} */ - -/* {{{ proto string swffont::getShape(code) - Returns the glyph shape of a char as a text string */ -PHP_METHOD(swffont, getShape) -{ - zval **zcode; - char *result; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zcode) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(zcode); - - result = SWFFont_getShape(getFont(getThis() TSRMLS_CC), Z_LVAL_PP(zcode)); - RETVAL_STRING(result, 1); - free(result); -} -/* }}} */ - -#endif - -static zend_function_entry swffont_functions[] = { - PHP_ME(swffont, __construct, NULL, 0) - PHP_ME(swffont, getWidth, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swffont, getUTF8Width, NULL, 0) -/* PHP_ME(swffont, getwidewidth, NULL, 0)*/ -#endif - PHP_ME(swffont, getAscent, NULL, 0) - PHP_ME(swffont, getDescent, NULL, 0) - PHP_ME(swffont, getLeading, NULL, 0) -#ifdef HAVE_NEW_MING -/* PHP_ME(swffont, addchars, NULL, 0)*/ - PHP_ME(swffont, getShape, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFGradient -*/ -/* {{{ proto class swfgradient::__construct() - Returns a new SWFGradient object */ -PHP_METHOD(swfgradient, __construct) -{ - SWFGradient gradient = newSWFGradient(); - int ret = zend_list_insert(gradient, le_swfgradientp); - - object_init_ex(getThis(), gradient_class_entry_ptr); - add_property_resource(getThis(), "gradient", ret); - zend_list_addref(ret); -} - -static void destroy_SWFGradient_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFGradient((SWFGradient)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getGradient - Returns the SWFGradient object contained in zval *id */ -static SWFGradient getGradient(zval *id TSRMLS_DC) -{ - void *gradient = SWFgetProperty(id, "gradient", 8, le_swfgradientp TSRMLS_CC); - - if (!gradient) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFGradient"); - } - return (SWFGradient)gradient; -} -/* }}} */ - -/* {{{ proto void swfgradient::addEntry(float ratio, int r, int g, int b [, int a]) - Adds given entry to the gradient */ -PHP_METHOD(swfgradient, addEntry) -{ - zval **ratio, **r, **g, **b; - byte a = 0xff; - - if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &ratio, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 5) { - zval **za; - - if (zend_get_parameters_ex(5, &ratio, &r, &g, &b, &za) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(za); - a = BYTE_Z_LVAL_PP(za); - } else { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(ratio); - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - SWFGradient_addEntry( getGradient(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(ratio), BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), a - ); -} -/* }}} */ - -static zend_function_entry swfgradient_functions[] = { - PHP_ME(swfgradient, __construct, NULL, 0) - PHP_ME(swfgradient, addEntry, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFMorph -*/ -/* {{{ proto object swfmorph::__construct() - Returns a new SWFMorph object */ -PHP_METHOD(swfmorph, __construct) -{ - SWFMorph morph = newSWFMorphShape(); - int ret = zend_list_insert(morph, le_swfmorphp); - - object_init_ex(getThis(), morph_class_entry_ptr); - add_property_resource(getThis(), "morph", ret); - zend_list_addref(ret); -} - -static void destroy_SWFMorph_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFMorph((SWFMorph)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getMorph - Returns the SWFMorph object contained in zval *id */ -static SWFMorph getMorph(zval *id TSRMLS_DC) -{ - void *morph = SWFgetProperty(id, "morph", 5, le_swfmorphp TSRMLS_CC); - - if (!morph) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFMorph"); - } - return (SWFMorph)morph; -} -/* }}} */ - -/* {{{ proto object swfmorph::getShape1() - Return's this SWFMorph's start shape object */ -PHP_METHOD(swfmorph, getShape1) -{ - SWFMorph morph = getMorph(getThis() TSRMLS_CC); - SWFShape shape = SWFMorph_getShape1(morph); - int ret = zend_list_insert(shape, le_swfshapep); - - object_init_ex(return_value, shape_class_entry_ptr); - add_property_resource(return_value, "shape", ret); - zend_list_addref(ret); -} -/* }}} */ - -/* {{{ proto object swfmorph::getShape2() - Return's this SWFMorph's start shape object */ -PHP_METHOD(swfmorph, getShape2) -{ - SWFMorph morph = getMorph(getThis() TSRMLS_CC); - SWFShape shape = SWFMorph_getShape2(morph); - int ret = zend_list_insert(shape, le_swfshapep); - - object_init_ex(return_value, shape_class_entry_ptr); - add_property_resource(return_value, "shape", ret); - zend_list_addref(ret); -} -/* }}} */ - -static zend_function_entry swfmorph_functions[] = { - PHP_ME(swfmorph, __construct, NULL, 0) - PHP_ME(swfmorph, getShape1, NULL, 0) - PHP_ME(swfmorph, getShape2, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFSound */ -/* {{{ internal function SWFSound getSound(zval *id) - Returns the Sound object in zval *id */ - -SWFSound getSound(zval *id TSRMLS_DC) -{ - void *sound = SWFgetProperty(id, "sound", 5, le_swfsoundp TSRMLS_CC); - - if(!sound) - php_error(E_ERROR, "called object is not an SWFSound!"); - - return (SWFSound)sound; -} - -/* }}} */ -/* {{{ proto class swfsound::__construct(string filename, int flags) - Returns a new SWFSound object from given file */ -PHP_METHOD(swfsound, __construct) -{ - zval **zfile, **zflags; - SWFSound sound; - SWFInput input; - int flags; - int ret; - - if(ZEND_NUM_ARGS() == 1) - { - if(zend_get_parameters_ex(1, &zfile) == FAILURE) - WRONG_PARAM_COUNT; - flags = 0; - } - else if(ZEND_NUM_ARGS() == 2) - { - if(zend_get_parameters_ex(2, &zfile, &zflags) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_long_ex(zflags); - flags = Z_LVAL_PP(zflags); - } - else - WRONG_PARAM_COUNT; - - if(Z_TYPE_PP(zfile) != IS_RESOURCE) - { - convert_to_string_ex(zfile); - PHP_MING_FILE_CHK(Z_STRVAL_PP(zfile)); - input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - } - else - input = getInput(zfile TSRMLS_CC); - -#ifdef HAVE_NEW_MING - sound = newSWFSound_fromInput(input, flags); -#else - sound = newSWFSound_fromInput(input); -#endif - - ret = zend_list_insert(sound, le_swfsoundp); - - object_init_ex(getThis(), sound_class_entry_ptr); - add_property_resource(getThis(), "sound", ret); - zend_list_addref(ret); -} - -static void destroy_SWFSound_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFBlock((SWFBlock)resource->ptr); -} - -/* }}} */ - -static zend_function_entry swfsound_functions[] = { - PHP_ME(swfsound, __construct, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFSoundInstance */ -#ifdef HAVE_NEW_MING -/* should handle envelope functions */ -/* {{{ internal function SWFSoundInstance getSoundInstance(zval *id) - Returns the SoundInstance object in zval *id */ - -SWFSoundInstance getSoundInstance(zval *id TSRMLS_DC) -{ - void *inst = SWFgetProperty(id, "soundinstance", 13, le_swfsoundinstancep TSRMLS_CC); - - if (!inst) - php_error(E_ERROR, "called object is not an SWFSoundInstance!"); - - return (SWFSoundInstance)inst; -} -/* }}} */ - -/* {{{ swfsoundinstance_nomultiple */ - -PHP_METHOD(swfsoundinstance, noMultiple) -{ - SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - SWFSoundInstance_setNoMultiple(inst); -} -/* }}} */ - -/* {{{ swfsoundinstance_loopinpoint(point) */ - -PHP_METHOD(swfsoundinstance, loopInPoint) -{ - zval **zpoint; - SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC); - - if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zpoint) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(zpoint); - - SWFSoundInstance_setLoopInPoint(inst, Z_LVAL_PP(zpoint)); -} - -/* }}} */ -/* {{{ swfsoundinstance_loopoutpoint(point) */ - -PHP_METHOD(swfsoundinstance, loopOutPoint) -{ - zval **zpoint; - SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC); - - if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zpoint) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(zpoint); - - SWFSoundInstance_setLoopOutPoint(inst, Z_LVAL_PP(zpoint)); -} -/* }}} */ - -/* {{{ swfsoundinstance_loopcount(point) */ - -PHP_METHOD(swfsoundinstance, loopCount) -{ - zval **zcount; - SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC); - - if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zcount) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(zcount); - - SWFSoundInstance_setLoopCount(inst, Z_LVAL_PP(zcount)); -} -/* }}} */ - -static zend_function_entry swfsoundinstance_functions[] = { - PHP_ME(swfsoundinstance, noMultiple, NULL, 0) - PHP_ME(swfsoundinstance, loopInPoint, NULL, 0) - PHP_ME(swfsoundinstance, loopOutPoint, NULL, 0) - PHP_ME(swfsoundinstance, loopCount, NULL, 0) - { NULL, NULL, NULL } -}; - -/* {{{ SWFVideoStream */ - -/* {{{ proto class swfvideostream_init([file]) - Returns a SWVideoStream object */ - -PHP_METHOD(swfvideostream, __construct) -{ - zval **zfile = NULL; - SWFVideoStream stream; - SWFInput input; - int ret; - - switch(ZEND_NUM_ARGS()) { - case 1: - if(zend_get_parameters_ex(1, &zfile) == FAILURE) - WRONG_PARAM_COUNT; - - if(Z_TYPE_PP(zfile) != IS_RESOURCE) - { - convert_to_string_ex(zfile); - input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - } - else - input = getInput(zfile TSRMLS_CC); - - stream = newSWFVideoStream_fromInput(input); - break; - case 0: - stream = newSWFVideoStream(); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if(stream) { - ret = zend_list_insert(stream, le_swfvideostreamp); - object_init_ex(getThis(), videostream_class_entry_ptr); - add_property_resource(getThis(), "videostream", ret); - zend_list_addref(ret); - } - -} - -static void destroy_SWFVideoStream_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFVideoStream((SWFVideoStream)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getVideoStream - Returns the SWFVideoStream object contained in zval *id */ - -static SWFVideoStream getVideoStream(zval *id TSRMLS_DC) -{ - void *stream = SWFgetProperty(id, "videostream", 11, le_swfvideostreamp TSRMLS_CC); - - if(!stream) - php_error(E_ERROR, "called object is not an SWFVideoStream!"); - - return (SWFVideoStream)stream; -} - -/* }}} */ - -/* {{{ setDimension */ - -PHP_METHOD(swfvideostream, setdimension) -{ - zval **x, **y; - SWFVideoStream stream = getVideoStream(getThis() TSRMLS_CC); - if(!stream) - php_error(E_ERROR, "getVideoSTream returned NULL"); - - if( ZEND_NUM_ARGS() != 2 - || zend_get_parameters_ex(2, &x, &y) == FAILURE ) - WRONG_PARAM_COUNT; - - convert_to_long_ex(x); - convert_to_long_ex(y); - - SWFVideoStream_setDimension(stream, Z_LVAL_PP(x), Z_LVAL_PP(y)); -} -/* }}} */ - -/* {{{ getNumFrames */ -PHP_METHOD(swfvideostream, getnumframes) -{ - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - - RETURN_LONG(SWFVideoStream_getNumFrames(getVideoStream(getThis() TSRMLS_CC))); -} -/* }}} */ - - -static zend_function_entry swfvideostream_functions[] = { - PHP_ME(swfvideostream, __construct, NULL, 0) - PHP_ME(swfvideostream, setdimension, NULL, 0) - PHP_ME(swfvideostream, getnumframes, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ -#endif - -#ifdef HAVE_SWFPREBUILTCLIP -/* {{{ SWFPrebuiltClip */ -/* {{{ proto class swfprebuiltclip_init([file]) - Returns a SWFPrebuiltClip object */ - -PHP_METHOD(swfprebuiltclip, __construct) -{ - zval **zfile = NULL; - SWFPrebuiltClip clip; - SWFInput input; - int ret; - - switch(ZEND_NUM_ARGS()) { - case 1: - if(zend_get_parameters_ex(1, &zfile) == FAILURE) - WRONG_PARAM_COUNT; - - if(Z_TYPE_PP(zfile) != IS_RESOURCE) - { - convert_to_string_ex(zfile); - input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - } - else - input = getInput(zfile TSRMLS_CC); - - clip = newSWFPrebuiltClip_fromInput(input); - break; -/* not sure whether this makes sense - there would have to be a function to add contents - case 0: - clip = newSWFPrebuiltClip(); - break; */ - default: - WRONG_PARAM_COUNT; - break; - } - - if(clip) { - ret = zend_list_insert(clip, le_swfprebuiltclipp); - object_init_ex(getThis(), prebuiltclip_class_entry_ptr); - add_property_resource(getThis(), "prebuiltclip", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ internal function destroy_SWFPrebuiltClip */ -static void destroy_SWFPrebuiltClip_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFPrebuiltClip((SWFPrebuiltClip)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getPrebuiltClip - Returns the SWFPrebuiltClip object contained in zval *id */ - -static SWFPrebuiltClip getPrebuiltClip(zval *id TSRMLS_DC) -{ - void *clip = SWFgetProperty(id, "prebuiltclip", 12, le_swfprebuiltclipp TSRMLS_CC); - - if(!clip) - php_error(E_ERROR, "called object is not an SWFPrebuiltClip!"); - - return (SWFPrebuiltClip)clip; -} - -/* }}} */ -static zend_function_entry swfprebuiltclip_functions[] = { - PHP_ME(swfprebuiltclip, __construct, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ -#endif - -/* }}} */ - -/* {{{ SWFMovie -*/ -/* {{{ proto object swfmovie::__construct(int version) - Creates swfmovie object according to the passed version */ -PHP_METHOD(swfmovie, __construct) -{ - zval **version; - SWFMovie movie; - int ret; - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &version) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(version); - movie = newSWFMovie(Z_LVAL_PP(version)); - } else { - movie = newSWFMovie(4); /* default version 4 */ - } - - ret = zend_list_insert(movie, le_swfmoviep); - - object_init_ex(getThis(), movie_class_entry_ptr); - add_property_resource(getThis(), "movie", ret); - zend_list_addref(ret); -} - -static void destroy_SWFMovie_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFMovie((SWFMovie)resource->ptr); -} -/* }}} */ - -/* {{{ getMovie -*/ -static SWFMovie getMovie(zval *id TSRMLS_DC) -{ - void *movie = SWFgetProperty(id, "movie", 5, le_swfmoviep TSRMLS_CC); - - if (!movie) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFMovie"); - } - return (SWFMovie)movie; -} -/* }}} */ - -/* {{{ proto void swfmovie::nextframe() -*/ -PHP_METHOD(swfmovie, nextFrame) -{ - SWFMovie_nextFrame(getMovie(getThis() TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto void swfmovie::labelframe(string label) - Labels frame */ -PHP_METHOD(swfmovie, labelFrame) -{ - zval **label; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &label) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(label); - SWFMovie_labelFrame(getMovie(getThis() TSRMLS_CC), Z_STRVAL_PP(label)); -} -/* }}} */ - -/* {{{ proto object swfmovie::add(object SWFBlock) -*/ -PHP_METHOD(swfmovie, add) -{ - zval **zchar; - int ret; - SWFBlock block; - SWFDisplayItem item; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - - /* XXX - SWFMovie_add deals w/ all block types. Probably will need to add that.. */ - if (Z_OBJCE_PP(zchar) == action_class_entry_ptr) { - block = (SWFBlock) getAction(*zchar TSRMLS_CC); - } else { - block = (SWFBlock) getCharacter(*zchar TSRMLS_CC); - } - - item = SWFMovie_add(movie, block); - - if (item != NULL) { - /* try and create a displayitem object */ - ret = zend_list_insert(item, le_swfdisplayitemp); - object_init_ex(return_value, displayitem_class_entry_ptr); - add_property_resource(return_value, "displayitem", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ proto void swfmovie::labelframe(object SWFBlock) -*/ -PHP_METHOD(swfmovie, remove) -{ - zval **zchar; - SWFDisplayItem item; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_object_ex(zchar); - item = getDisplayItem(*zchar TSRMLS_CC); - SWFMovie_remove(movie, item); -} -/* }}} */ - -/* {{{ proto int swfmovie::output([int compression]) -*/ -static void phpByteOutputMethod(byte b, void *data) -{ - TSRMLS_FETCH(); - - php_write(&b, 1 TSRMLS_CC); -} - -PHP_METHOD(swfmovie, output) -{ - SWFMovie movie = getMovie(getThis() TSRMLS_CC); -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - zval **zlimit = NULL; - int limit = -1; - int argc = ZEND_NUM_ARGS(); - int oldval = INT_MIN; - long out; - - if(argc) { - if (zend_get_parameters_ex(1, &zlimit) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(zlimit); - limit = Z_LVAL_PP(zlimit); - - if ((limit < 0) || (limit > 9)) { - php_error(E_WARNING,"compression level must be within 0..9"); - RETURN_FALSE; - } - } - oldval = Ming_setSWFCompression(limit); - out = SWFMovie_output(movie, &phpByteOutputMethod, NULL); - if (oldval >= -1 && oldval <= 9) { - Ming_setSWFCompression(oldval); - } - RETURN_LONG(out); -#else - RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL)); -#endif - -} -/* }}} */ - -/* {{{ proto int swfmovie::saveToFile(stream x [, int compression]) -*/ -static void phpStreamOutputMethod(byte b, void * data) -{ - TSRMLS_FETCH(); - - php_stream_write((php_stream*)data, &b, 1); -} - -PHP_METHOD(swfmovie, saveToFile) -{ - zval **x; -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - zval **zlimit = NULL; - int limit = -1; - int oldval = INT_MIN; - long out; -#endif - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - php_stream *what; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &x) == FAILURE) - WRONG_PARAM_COUNT; - break; - case 2: -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_long_ex(zlimit); - limit = Z_LVAL_PP(zlimit); - if ((limit < 0) || (limit > 9)) { - php_error(E_WARNING,"compression level must be within 0..9"); - RETURN_FALSE; - } - oldval = Ming_setSWFCompression(limit); -#endif - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(what, php_stream *, x, -1,"File-Handle",php_file_le_stream()); -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - out = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, what); - if (oldval >= -1 && oldval <=9) - Ming_setSWFCompression(oldval); - RETURN_LONG(out); -#else - RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what)); -#endif -} -/* }}} */ - -/* {{{ proto int swfmovie::save(mixed where [, int compression]) - Saves the movie. 'where' can be stream and the movie will be saved there otherwise it is treated as string and written in file with that name */ -PHP_METHOD(swfmovie, save) -{ - zval **x; -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - zval **zlimit = NULL; - int limit = -1; - int oldval = INT_MIN; -#endif - long retval; - php_stream *stream; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &x) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(zlimit); - limit = Z_LVAL_PP(zlimit); - if ((limit < 0) || (limit > 9)) { - php_error(E_WARNING,"compression level must be within 0..9"); - RETURN_FALSE; - } - oldval = Ming_setSWFCompression(limit); -#endif - break; - default: - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(x) == IS_RESOURCE) { - ZEND_FETCH_RESOURCE(stream, php_stream *, x, -1,"File-Handle",php_file_le_stream()); - RETVAL_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream)); -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - if(oldval >= -1 && oldval <=9) - Ming_setSWFCompression(oldval); -#endif - return; - } - - convert_to_string_ex(x); - stream = php_stream_open_wrapper(Z_STRVAL_PP(x), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); - - if (stream == NULL) { - RETURN_FALSE; - } - - retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream); - php_stream_close(stream); -#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING) - if(oldval >= -1 && oldval <=9) - Ming_setSWFCompression(oldval); -#endif - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto void swfmovie::setBackground(int r, int g, int b) - Sets background color (r,g,b) */ -PHP_METHOD(swfmovie, setBackground) -{ - zval **r, **g, **b; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - SWFMovie_setBackground(movie, Z_LVAL_PP(r), Z_LVAL_PP(g), Z_LVAL_PP(b)); -} -/* }}} */ - -/* {{{ proto void swfmovie::setRate(float rate) - Sets movie rate */ -PHP_METHOD(swfmovie, setRate) -{ - zval **rate; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &rate) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(rate); - SWFMovie_setRate(movie, FLOAT_Z_DVAL_PP(rate)); -} -/* }}} */ - -/* {{{ proto void swfmovie::setDimension(float x, float y) - Sets movie dimension */ -PHP_METHOD(swfmovie, setDimension) -{ - zval **x, **y; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFMovie_setDimension(movie, FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfmovie::setFrames(int frames) - Sets number of frames */ -PHP_METHOD(swfmovie, setFrames) -{ - zval **frames; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &frames) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(frames); - SWFMovie_setNumberOfFrames(movie, Z_LVAL_PP(frames)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void swfmovie::streamMP3(mixed file) - Sets sound stream of the SWF movie. The parameter can be stream or string. */ -PHP_METHOD(swfmovie, streamMP3) -{ - zval **zfile; - SWFSoundStream sound; - SWFInput input; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfile) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(zfile) != IS_RESOURCE) { - convert_to_string_ex(zfile); - input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile)); - zend_list_addref(zend_list_insert(input, le_swfinputp)); - } else { - input = getInput(zfile TSRMLS_CC); - } - - sound = newSWFSoundStream_fromInput(input); - SWFMovie_setSoundStream(movie, sound); -} -/* }}} */ - -/* {{{ swfmovie_addexport */ - -PHP_METHOD(swfmovie, addExport) -{ - zval **zchar, **zname; - SWFBlock block; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zchar, &zname) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zchar); - convert_to_string_ex(zname); - - block = (SWFBlock)getCharacter(*zchar TSRMLS_CC); - - SWFMovie_addExport(movie, block, Z_STRVAL_PP(zname)); -} - -/* }}} */ - -/* {{{ swfmovie_writeexports */ - -PHP_METHOD(swfmovie, writeExports) -{ - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - SWFMovie_writeExports(movie); -} - -/* }}} */ -/* {{{ SWFSoundInstance swfmovie_startsound */ - -PHP_METHOD(swfmovie, startSound) -{ - zval **zsound; - int ret; - SWFSound sound; - SWFSoundInstance item; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zsound); - sound = (SWFSound)getSound(*zsound TSRMLS_CC); - - item = SWFMovie_startSound(movie, sound); - - if(item != NULL) - { - /* try and create a soundinstance object */ - ret = zend_list_insert(item, le_swfsoundinstancep); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ void swfmovie_stopsound */ - -PHP_METHOD(swfmovie, stopSound) -{ - zval **zsound; - SWFSound sound; - SWFMovie movie = getMovie(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zsound); - sound = (SWFSound)getSound(*zsound TSRMLS_CC); - - SWFMovie_stopSound(movie, sound); -} -/* }}} */ - -/* {{{ void swfmovie_importChar */ - -PHP_METHOD(swfmovie, importChar) -{ - SWFMovie movie; - SWFCharacter res; - int ret; - zval **libswf, **name; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &libswf, &name) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_string_ex(libswf); - convert_to_string_ex(name); - movie = getMovie(getThis() TSRMLS_CC); - res = SWFMovie_importCharacter(movie, Z_STRVAL_PP(libswf), Z_STRVAL_PP(name)); - - if(res != NULL) - { - /* try and create a sprite object */ - ret = zend_list_insert(res, le_swfspritep); - object_init_ex(return_value, sprite_class_entry_ptr); - add_property_resource(return_value, "sprite", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ void swfmovie_importFont */ - -PHP_METHOD(swfmovie, importFont) -{ - SWFMovie movie; - SWFFontCharacter res; - int ret; - zval **libswf, **name; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &libswf, &name) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_string_ex(libswf); - convert_to_string_ex(name); - movie = getMovie(getThis() TSRMLS_CC); - PHP_MING_FILE_CHK(Z_STRVAL_PP(libswf)); - res = SWFMovie_importFont(movie, Z_STRVAL_PP(libswf), Z_STRVAL_PP(name)); - - if(res != NULL) - { - /* try and create a fontchar object */ - ret = zend_list_insert(res, le_swffontcharp); - object_init_ex(return_value, fontchar_class_entry_ptr); - add_property_resource(return_value, "fontcharacter", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ void swfmovie_addFont */ -PHP_METHOD(swfmovie, addFont) -{ - SWFMovie movie; - SWFFontCharacter res; - int ret; - SWFFont font; - zval **zfont; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfont) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zfont); - - movie = getMovie(getThis() TSRMLS_CC); - font = getFont(*zfont TSRMLS_CC); - res = SWFMovie_addFont(movie, font); - - if(res != NULL) - { - /* try and create a fontchar object */ - ret = zend_list_insert(res, le_swffontcharp); - object_init_ex(return_value, fontchar_class_entry_ptr); - add_property_resource(return_value, "fontcharacter", ret); - zend_list_addref(ret); - } -} -/* }}} */ -#endif - -static zend_function_entry swfmovie_functions[] = { - PHP_ME(swfmovie, __construct, NULL, 0) - PHP_ME(swfmovie, nextFrame, NULL, 0) - PHP_ME(swfmovie, labelFrame, NULL, 0) - PHP_ME(swfmovie, add, NULL, 0) - PHP_ME(swfmovie, remove, NULL, 0) - PHP_ME(swfmovie, output, NULL, 0) - PHP_ME(swfmovie, save, NULL, 0) - PHP_ME(swfmovie, saveToFile, NULL, 0) - PHP_ME(swfmovie, setBackground, NULL, 0) - PHP_ME(swfmovie, setRate, NULL, 0) - PHP_ME(swfmovie, setDimension, NULL, 0) - PHP_ME(swfmovie, setFrames, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swfmovie, streamMP3, NULL, 0) - PHP_ME(swfmovie, addExport, NULL, 0) - PHP_ME(swfmovie, writeExports, NULL, 0) - PHP_ME(swfmovie, startSound, NULL, 0) - PHP_ME(swfmovie, stopSound, NULL, 0) - PHP_ME(swfmovie, importChar, NULL, 0) - PHP_ME(swfmovie, importFont, NULL, 0) - PHP_ME(swfmovie, addFont, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFShape -*/ -/* {{{ proto object swfshape::__construct() - Returns a new SWFShape object */ -PHP_METHOD(swfshape, __construct) -{ - SWFShape shape = newSWFShape(); - int ret = zend_list_insert(shape, le_swfshapep); - - object_init_ex(getThis(), shape_class_entry_ptr); - add_property_resource(getThis(), "shape", ret); - zend_list_addref(ret); -} - -static void destroy_SWFShape_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFShape((SWFShape)resource->ptr); -} -/* }}} */ - -/* {{{ internal function getShape - Returns the SWFShape object contained in zval *id */ -static SWFShape getShape(zval *id TSRMLS_DC) -{ - void *shape = SWFgetProperty(id, "shape", 5, le_swfshapep TSRMLS_CC); - - if (!shape) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFShape"); - } - - return (SWFShape)shape; -} -/* }}} */ - -/* {{{ proto void swfshape::setline(int width, int r, int g, int b [, int a]) - Sets the current line style for this SWFShape */ -PHP_METHOD(swfshape, setLine) -{ - zval **w, **r, **g, **b, **a; - - if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &w, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 5) { - if (zend_get_parameters_ex(5, &w, &r, &g, &b, &a) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(a); - } else if (ZEND_NUM_ARGS() == 1) { - SWFShape_setLine(getShape(getThis() TSRMLS_CC), 0, 0, 0, 0, 0); - return; - } else { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(w); - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - if (ZEND_NUM_ARGS() == 4) { - SWFShape_setLine(getShape(getThis() TSRMLS_CC), - (unsigned short)Z_LVAL_PP(w), BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), 0xff - ); - } else { - SWFShape_setLine(getShape(getThis() TSRMLS_CC), - (unsigned short)Z_LVAL_PP(w), BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), BYTE_Z_LVAL_PP(a) - ); - } -} -/* }}} */ - -/* {{{ proto object swfshape::addfill(mixed arg1, int arg2, [int b [, int a]]) - Returns a fill object, for use with swfshape_setleftfill and swfshape_setrightfill. If 1 or 2 parameter(s) is (are) passed first should be object (from gradient class) and the second int (flags). Gradient fill is performed. If 3 or 4 parameters are passed : r, g, b [, a]. Solid fill is performed. */ -PHP_METHOD(swfshape, addFill) -{ - SWFFill fill=NULL; - int ret; - - if (ZEND_NUM_ARGS() == 1 || ZEND_NUM_ARGS() == 2) { - /* it's a gradient or bitmap */ - zval **arg1; - unsigned char flags = 0; - - if (ZEND_NUM_ARGS() == 2) { - zval **arg2; - if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg2); - flags = (unsigned char)Z_LVAL_PP(arg2); - } else { - if (zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - } - - convert_to_object_ex(arg1); - - if (Z_OBJCE_PP(arg1) == gradient_class_entry_ptr) { - if (flags == 0) { - flags = SWFFILL_LINEAR_GRADIENT; - } - fill = SWFShape_addGradientFill(getShape(getThis() TSRMLS_CC), getGradient(*arg1 TSRMLS_CC), flags); - } else if (Z_OBJCE_PP(arg1) == bitmap_class_entry_ptr) { - if (flags == 0) { - flags = SWFFILL_TILED_BITMAP; - } - fill = SWFShape_addBitmapFill(getShape(getThis() TSRMLS_CC), getBitmap(*arg1 TSRMLS_CC), flags); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Argument is not a bitmap nor a gradient"); - } - - } else if (ZEND_NUM_ARGS() == 3 || ZEND_NUM_ARGS() == 4) { - /* it's a solid fill */ - zval **r, **g, **b, **za; - byte a = 0xff; - - if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &za) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(za); - a = BYTE_Z_LVAL_PP(za); - } else { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - fill = SWFShape_addSolidFill(getShape(getThis() TSRMLS_CC), - BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), a - ); - } else { - WRONG_PARAM_COUNT; - } - - if (!fill) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error adding fill to shape"); - } - - /* return an SWFFill object */ - ret = zend_list_insert(fill, le_swffillp); - object_init_ex(return_value, fill_class_entry_ptr); - add_property_resource(return_value, "fill", ret); - zend_list_addref(ret); -} -/* }}} */ - -/* {{{ proto void swfshape::setleftfill(int arg1 [, int g ,int b [,int a]]) - Sets the left side fill style to fill in case only one parameter is passed. When 3 or 4 parameters are passed they are treated as : int r, int g, int b, int a . Solid fill is performed in this case before setting left side fill type. */ -PHP_METHOD(swfshape, setLeftFill) -{ - zval **zfill, **r, **g, **b, **a; - SWFFill fill; - - if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - fill = SWFShape_addSolidFill(getShape(getThis() TSRMLS_CC), - BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), 0xff - ); - - } else if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - convert_to_long_ex(a); - - fill = SWFShape_addSolidFill(getShape(getThis() TSRMLS_CC), - BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), BYTE_Z_LVAL_PP(a) - ); - - } else if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &zfill) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_LVAL_PP(zfill) != 0) { - convert_to_object_ex(zfill); - fill = getFill(*zfill TSRMLS_CC); - } else { - fill = NULL; - } - } else { - WRONG_PARAM_COUNT; - } - - SWFShape_setLeftFill(getShape(getThis() TSRMLS_CC), fill); -} -/* }}} */ - -/* {{{ proto void swfshape::setleftfill(int arg1 [, int g ,int b [,int a]]) - Sets the right side fill style to fill in case only one parameter is passed. When 3 or 4 parameters are passed they are treated as : int r, int g, int b, int a . Solid fill is performed in this case before setting right side fill type. */ -PHP_METHOD(swfshape, setRightFill) -{ - zval **zfill, **r, **g, **b, **a; - SWFFill fill; - - if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - fill = SWFShape_addSolidFill(getShape(getThis() TSRMLS_CC), - BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), 0xff - ); - - } else if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - convert_to_long_ex(a); - - fill = SWFShape_addSolidFill(getShape(getThis() TSRMLS_CC), - BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), BYTE_Z_LVAL_PP(a) - ); - } else if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &zfill) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_LVAL_PP(zfill) != 0) { - convert_to_object_ex(zfill); - fill = getFill(*zfill TSRMLS_CC); - } else { - fill = NULL; - } - } else { - WRONG_PARAM_COUNT; - } - - SWFShape_setRightFill(getShape(getThis() TSRMLS_CC), fill); -} -/* }}} */ - -/* {{{ proto void swfshape::movepento(float x, float y) - Moves the pen to shape coordinates (x, y) */ -PHP_METHOD(swfshape, movePenTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFShape_movePenTo(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfshape::movepen(float x, float y) - Moves the pen from its current location by vector (x, y) */ -PHP_METHOD(swfshape, movePen) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFShape_movePen(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfshape::drawlineto(float x, float y) - Draws a line from the current pen position to shape coordinates (x, y) in the current line style */ -PHP_METHOD(swfshape, drawLineTo) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFShape_drawLineTo(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfshape::drawline(float dx, float dy) - Draws a line from the current pen position (x, y) to the point (x+dx, y+dy) in the current line style */ -PHP_METHOD(swfshape, drawLine) -{ - zval **x, **y; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFShape_drawLine(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swfshape::drawcurveto(float ax, float ay, float bx, float by [, float dx, float dy]) - Draws a curve from the current pen position (x,y) to the point (bx, by) in the current line style, using point (ax, ay) as a control point. Or draws a cubic bezier to point (dx, dy) with control points (ax, ay) and (bx, by) */ -PHP_METHOD(swfshape, drawCurveTo) -{ - if (ZEND_NUM_ARGS() == 4) { - zval **cx, **cy, **ax, **ay; - - if (zend_get_parameters_ex(4, &cx, &cy, &ax, &ay) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(ax); - convert_to_double_ex(ay); - - SWFShape_drawCurveTo(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(ax), FLOAT_Z_DVAL_PP(ay) - ); - - } else if (ZEND_NUM_ARGS() == 6) { - zval **bx, **by, **cx, **cy, **dx, **dy; - - if (zend_get_parameters_ex(6, &bx, &by, &cx, &cy, &dx, &dy) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(bx); - convert_to_double_ex(by); - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(dx); - convert_to_double_ex(dy); - - RETURN_LONG(SWFShape_drawCubicTo(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(bx), FLOAT_Z_DVAL_PP(by), FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(dx), FLOAT_Z_DVAL_PP(dy)) - ); - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto void swfshape::drawcurve(float adx, float ady, float bdx, float bdy [, float cdx, float cdy]) - Draws a curve from the current pen position (x, y) to the point (x+bdx, y+bdy) in the current line style, using point (x+adx, y+ady) as a control point or draws a cubic bezier to point (x+cdx, x+cdy) with control points (x+adx, y+ady) and (x+bdx, y+bdy) */ -PHP_METHOD(swfshape, drawCurve) -{ - if (ZEND_NUM_ARGS() == 4) { - zval **cx, **cy, **ax, **ay; - - if (zend_get_parameters_ex(4, &cx, &cy, &ax, &ay) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(ax); - convert_to_double_ex(ay); - - SWFShape_drawCurve(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(ax), FLOAT_Z_DVAL_PP(ay) - ); - - } else if (ZEND_NUM_ARGS() == 6) { - zval **bx, **by, **cx, **cy, **dx, **dy; - - if (zend_get_parameters_ex(6, &bx, &by, &cx, &cy, &dx, &dy) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(bx); - convert_to_double_ex(by); - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(dx); - convert_to_double_ex(dy); - - RETURN_LONG( SWFShape_drawCubic(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(bx), FLOAT_Z_DVAL_PP(by), FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(dx), FLOAT_Z_DVAL_PP(dy)) - ); - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto void swfshape::drawglyph(SWFFont font, string character [, int size]) - Draws the first character in the given string into the shape using the glyph definition from the given font */ -PHP_METHOD(swfshape, drawGlyph) -{ - zval **font, **c, **zsize; - int size=0; - - if (ZEND_NUM_ARGS() == 2) { - if (zend_get_parameters_ex(2, &font, &c) == FAILURE) { - WRONG_PARAM_COUNT; - } - size = (int)(1024.0f/Ming_getScale()); - - } else if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &font, &c, &zsize) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(zsize); - size = Z_LVAL_PP(zsize); - } - convert_to_string_ex(c); - SWFShape_drawSizedGlyph(getShape(getThis() TSRMLS_CC), getFont(*font TSRMLS_CC), Z_STRVAL_PP(c)[0], size); -} -/* }}} */ - -/* {{{ proto void swfshape::drawcircle(float r) - Draws a circle of radius r centered at the current location, in a counter-clockwise fashion */ -PHP_METHOD(swfshape, drawCircle) -{ - zval **r; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &r) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(r); - SWFShape_drawCircle(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(r)); -} -/* }}} */ - -/* {{{ proto void swfshape::drawarc(float r, float startAngle, float endAngle) - Draws an arc of radius r centered at the current location, from angle startAngle to angle endAngle measured clockwise from 12 o'clock */ -PHP_METHOD(swfshape, drawArc) -{ - zval **r, **start, **end; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &r, &start, &end) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(r); - convert_to_double_ex(start); - convert_to_double_ex(end); - - /* convert angles to radians, since that's what php uses elsewhere */ - SWFShape_drawArc(getShape(getThis() TSRMLS_CC), FLOAT_Z_DVAL_PP(r), FLOAT_Z_DVAL_PP(start), FLOAT_Z_DVAL_PP(end)); -} -/* }}} */ - -/* {{{ proto void swfshape::drawcubic(float bx, float by, float cx, float cy, float dx, float dy) - Draws a cubic bezier curve using the current position and the three given points as control points */ -PHP_METHOD(swfshape, drawCubic) -{ - zval **bx, **by, **cx, **cy, **dx, **dy; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &bx, &by, &cx, &cy, &dx, &dy) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(bx); - convert_to_double_ex(by); - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(dx); - convert_to_double_ex(dy); - - RETURN_LONG( SWFShape_drawCubic(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(bx), FLOAT_Z_DVAL_PP(by), FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(dx), FLOAT_Z_DVAL_PP(dy)) - ); -} -/* }}} */ - -/* {{{ proto void swfshape::drawcubic(float bx, float by, float cx, float cy, float dx, float dy) - Draws a cubic bezier curve using the current position and the three given points as control points */ -PHP_METHOD(swfshape, drawCubicTo) -{ - zval **bx, **by, **cx, **cy, **dx, **dy; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &bx, &by, &cx, &cy, &dx, &dy) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(bx); - convert_to_double_ex(by); - convert_to_double_ex(cx); - convert_to_double_ex(cy); - convert_to_double_ex(dx); - convert_to_double_ex(dy); - - RETURN_LONG( SWFShape_drawCubicTo(getShape(getThis() TSRMLS_CC), - FLOAT_Z_DVAL_PP(bx), FLOAT_Z_DVAL_PP(by), FLOAT_Z_DVAL_PP(cx), FLOAT_Z_DVAL_PP(cy), FLOAT_Z_DVAL_PP(dx), FLOAT_Z_DVAL_PP(dy)) - ); -} -/* }}} */ - -static zend_function_entry swfshape_functions[] = { - PHP_ME(swfshape, __construct, NULL, 0) - PHP_ME(swfshape, setLine, NULL, 0) - PHP_ME(swfshape, addFill, NULL, 0) - PHP_ME(swfshape, setLeftFill, NULL, 0) - PHP_ME(swfshape, setRightFill, NULL, 0) - PHP_ME(swfshape, movePenTo, NULL, 0) - PHP_ME(swfshape, movePen, NULL, 0) - PHP_ME(swfshape, drawLineTo, NULL, 0) - PHP_ME(swfshape, drawLine, NULL, 0) - PHP_ME(swfshape, drawCurveTo, NULL, 0) - PHP_ME(swfshape, drawCurve, NULL, 0) - PHP_ME(swfshape, drawGlyph, NULL, 0) - PHP_ME(swfshape, drawCircle, NULL, 0) - PHP_ME(swfshape, drawArc, NULL, 0) - PHP_ME(swfshape, drawCubic, NULL, 0) - PHP_ME(swfshape, drawCubicTo, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFSprite -*/ -/* {{{ proto class swfsprite::__construct() - Returns a new SWFSprite object */ -PHP_METHOD(swfsprite, __construct) -{ - SWFMovieClip sprite = newSWFMovieClip(); - int ret = zend_list_insert(sprite, le_swfspritep); - - object_init_ex(getThis(), sprite_class_entry_ptr); - add_property_resource(getThis(), "sprite", ret); - zend_list_addref(ret); -} - -static void destroy_SWFSprite_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFMovieClip((SWFMovieClip)resource->ptr); -} -/* }}} */ - -/* {{{ internal function SWFSprite getSprite(zval *id) - Returns the SWFSprite object in zval *id */ -static SWFMovieClip getSprite(zval *id TSRMLS_DC) -{ - void *sprite = SWFgetProperty(id, "sprite", 6, le_swfspritep TSRMLS_CC); - - if (!sprite) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFSprite"); - } - return (SWFMovieClip)sprite; -} -/* }}} */ - -/* {{{ proto object swfsprite::add(object SWFCharacter) - Adds the character to the sprite, returns a displayitem object */ -PHP_METHOD(swfsprite, add) -{ - zval **zchar; - int ret; - SWFBlock block; - SWFDisplayItem item; - SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_object_ex(zchar); - - if (Z_OBJCE_PP(zchar) == action_class_entry_ptr) { - block = (SWFBlock)getAction(*zchar TSRMLS_CC); - } else { - block = (SWFBlock)getCharacter(*zchar TSRMLS_CC); - } - - item = SWFMovieClip_add(sprite, block); - - if (item != NULL) { - /* try and create a displayitem object */ - ret = zend_list_insert(item, le_swfdisplayitemp); - object_init_ex(return_value, displayitem_class_entry_ptr); - add_property_resource(return_value, "displayitem", ret); - zend_list_addref(ret); - } -} -/* }}} */ - -/* {{{ proto void swfsprite::remove(object SWFDisplayItem) - Remove the named character from the sprite's display list */ -PHP_METHOD(swfsprite, remove) -{ - zval **zchar; - SWFDisplayItem item; - SWFMovieClip movie = getSprite(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zchar) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_object_ex(zchar); - item = getDisplayItem(*zchar TSRMLS_CC); - SWFMovieClip_remove(movie, item); -} -/* }}} */ - -/* {{{ proto void swfsprite::nextFrame() - Moves the sprite to the next frame */ -PHP_METHOD(swfsprite, nextFrame) -{ - SWFMovieClip_nextFrame(getSprite(getThis() TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto void swfsprite::labelFrame(string label) - Labels frame */ -PHP_METHOD(swfsprite, labelFrame) -{ - zval **label; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &label) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(label); - SWFMovieClip_labelFrame(getSprite(getThis() TSRMLS_CC), Z_STRVAL_PP(label)); -} -/* }}} */ - -/* {{{ proto void swfsprite::setFrames(int frames) - Sets the number of frames in this SWFSprite */ -PHP_METHOD(swfsprite, setFrames) -{ - zval **frames; - SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &frames) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(frames); - SWFMovieClip_setNumberOfFrames(sprite, Z_LVAL_PP(frames)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ SWFSoundInstance swfsprite_startsound */ - -PHP_METHOD(swfsprite, startSound) -{ - zval **zsound; - int ret; - SWFSound sound; - SWFSoundInstance item; - SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zsound); - sound = (SWFSound)getSound(*zsound TSRMLS_CC); - - item = SWFMovieClip_startSound(sprite, sound); - - if(item != NULL) { - /* try and create a displayitem object */ - ret = zend_list_insert(item, le_swfsoundinstancep); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); - } -} - -/* }}} */ -/* {{{ void swfsprite_stopsound */ - -PHP_METHOD(swfsprite, stopSound) -{ - zval **zsound; - SWFSound sound; - SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_object_ex(zsound); - sound = (SWFSound)getSound(*zsound TSRMLS_CC); - - SWFMovieClip_stopSound(sprite, sound); -} -/* }}} */ -#endif - -static zend_function_entry swfsprite_functions[] = { - PHP_ME(swfsprite, __construct, NULL, 0) - PHP_ME(swfsprite, add, NULL, 0) - PHP_ME(swfsprite, remove, NULL, 0) - PHP_ME(swfsprite, nextFrame, NULL, 0) - PHP_ME(swfsprite, labelFrame, NULL, 0) - PHP_ME(swfsprite, setFrames, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swfsprite, startSound, NULL, 0) - PHP_ME(swfsprite, stopSound, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFText -*/ -/* {{{ proto class swftext::__construct() - Returns new SWFText object */ -PHP_METHOD(swftext, __construct) -{ - SWFText text = newSWFText2(); - int ret = zend_list_insert(text, le_swftextp); - - object_init_ex(getThis(), text_class_entry_ptr); - add_property_resource(getThis(), "text", ret); - zend_list_addref(ret); -} - -static void destroy_SWFText_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFText((SWFText)resource->ptr); -} -/* }}} */ - -/* {{{ internal function SWFText getText(zval *id) - Returns the SWFText contained in zval *id */ -static SWFText getText(zval *id TSRMLS_DC) -{ - void *text = SWFgetProperty(id, "text", 4, le_swftextp TSRMLS_CC); - - if (!text) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFText"); - } - return (SWFText)text; -} -/* }}} */ - -/* {{{ proto void swftext::setFont(object font) - Sets this SWFText object's current font to given font */ -PHP_METHOD(swftext, setFont) -{ - zval **zfont; - SWFText text = getText(getThis() TSRMLS_CC); - SWFFont font; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfont) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_object_ex(zfont); - font = getFont(*zfont TSRMLS_CC); - SWFText_setFont(text, font); -} -/* }}} */ - -/* {{{ proto void swftext::setHeight(float height) - Sets this SWFText object's current height to given height */ -PHP_METHOD(swftext, setHeight) -{ - zval **height; - SWFText text = getText(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &height) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(height); - SWFText_setHeight(text, FLOAT_Z_DVAL_PP(height)); -} -/* }}} */ - -/* {{{ proto void swftext::setSpacing(float spacing) - Sets this SWFText object's current letterspacing to given spacing */ -PHP_METHOD(swftext, setSpacing) -{ - zval **spacing; - SWFText text = getText(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &spacing) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(spacing); - SWFText_setSpacing(text, FLOAT_Z_DVAL_PP(spacing)); -} -/* }}} */ - -/* {{{ proto void swftext::setColor(int r, int g, int b [, int a]) - Sets this SWFText object's current color to the given color */ -PHP_METHOD(swftext, setColor) -{ - zval **r, **g, **b, **a; - SWFText text = getText(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(a); - } else { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - - if (ZEND_NUM_ARGS() == 4) { - SWFText_setColor(text, BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), BYTE_Z_LVAL_PP(a)); - } else { - SWFText_setColor(text, BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), 0xff); - } -} -/* }}} */ - -/* {{{ proto void swftext::moveTo(float x, float y) - Moves this SWFText object's current pen position to (x, y) in text coordinates */ -PHP_METHOD(swftext, moveTo) -{ - zval **x, **y; - SWFText text = getText(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(x); - convert_to_double_ex(y); - SWFText_setXY(text, FLOAT_Z_DVAL_PP(x), FLOAT_Z_DVAL_PP(y)); -} -/* }}} */ - -/* {{{ proto void swftext::addString(string text) - Writes the given text into this SWFText object at the current pen position, using the current font, height, spacing, and color */ -PHP_METHOD(swftext, addString) -{ - zval **s; - SWFText text = getText(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(s); - SWFText_addString(text, Z_STRVAL_PP(s), NULL); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void swftext::addUTF8String(string text) - Writes the given text into this SWFText object at the current pen position, - using the current font, height, spacing, and color */ - -PHP_METHOD(swftext, addUTF8String) -{ - zval **s; - SWFText text = getText(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(s); - - SWFText_addUTF8String(text, Z_STRVAL_PP(s), NULL); -} - -/* }}} */ -/* {{{ proto void swftext::addWideString(string text) - Writes the given text into this SWFText object at the current pen position, - using the current font, height, spacing, and color */ -/* -PHP_METHOD(swftext, addWideString) -{ - zval **s; - SWFText text = getText(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(s); - - SWFText_addWideString(text, Z_STRVAL_PP(s), NULL); -} -*/ -/* }}} */ -#endif - -/* {{{ proto float swftext::getWidth(string str) - Calculates the width of the given string in this text objects current font and size */ -PHP_METHOD(swftext, getWidth) -{ - zval **zstring; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(zstring); - RETURN_DOUBLE(SWFText_getStringWidth(getText(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring))); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto double swftext::getUTF8Width(string) - calculates the width of the given string in this text objects current font and size */ - -PHP_METHOD(swftext, getUTF8Width) -{ - zval **zstring; - int width; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - width = SWFText_getUTF8StringWidth(getText(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); - - RETURN_DOUBLE(width); -} - -/* }}} */ -/* {{{ proto double swftext::getWideWidth(string) - calculates the width of the given string in this text objects current font and size */ -/* -PHP_METHOD(swftext, getWideWidth) -{ - zval **zstring; - int width; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - width = SWFText_getWideStringWidth(getText(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring)); - - RETURN_DOUBLE(width); -} -*/ -/* }}} */ -#endif - -/* {{{ proto float swftext::getAscent() - Returns the ascent of the current font at its current size, or 0 if not available */ -PHP_METHOD(swftext, getAscent) -{ - RETURN_DOUBLE(SWFText_getAscent(getText(getThis() TSRMLS_CC))); -} -/* }}} */ - -/* {{{ proto float swftext::getDescent() - Returns the descent of the current font at its current size, or 0 if not available */ -PHP_METHOD(swftext, getDescent) -{ - RETURN_DOUBLE(SWFText_getDescent(getText(getThis() TSRMLS_CC))); -} -/* }}} */ - -/* {{{ proto float swftext::getLeading() - Returns the leading of the current font at its current size, or 0 if not available */ -PHP_METHOD(swftext, getLeading) -{ - RETURN_DOUBLE(SWFText_getLeading(getText(getThis() TSRMLS_CC))); -} -/* }}} */ - -static zend_function_entry swftext_functions[] = { - PHP_ME(swftext, __construct, NULL, 0) - PHP_ME(swftext, setFont, NULL, 0) - PHP_ME(swftext, setHeight, NULL, 0) - PHP_ME(swftext, setSpacing, NULL, 0) - PHP_ME(swftext, setColor, NULL, 0) - PHP_ME(swftext, moveTo, NULL, 0) - PHP_ME(swftext, addString, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swftext, addUTF8String, NULL, 0) -/* PHP_ME(swftext, addwidestring, NULL, 0)*/ -#endif - PHP_ME(swftext, getWidth, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swftext, getUTF8Width, NULL, 0) -/* PHP_ME(swftext, getwidewidth, NULL, 0)*/ -#endif - PHP_ME(swftext, getAscent, NULL, 0) - PHP_ME(swftext, getDescent, NULL, 0) - PHP_ME(swftext, getLeading, NULL, 0) - { NULL, NULL, NULL } -}; - -/* }}} */ - -/* {{{ SWFTextField -*/ -/* {{{ proto object swftextfield::__construct([int flags]) - Returns a new SWFTextField object */ -PHP_METHOD(swftextfield, __construct) -{ - zval **flags; - SWFTextField field = newSWFTextField(); - int ret = zend_list_insert(field, le_swftextfieldp); - - object_init_ex(getThis(), textfield_class_entry_ptr); - add_property_resource(getThis(), "textfield", ret); - zend_list_addref(ret); - - if (ZEND_NUM_ARGS() == 1) { - if (zend_get_parameters_ex(1, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(flags); - SWFTextField_setFlags(field, Z_LVAL_PP(flags)); - } -} -/* }}} */ - -static void destroy_SWFTextField_resource(zend_rsrc_list_entry *resource TSRMLS_DC) -{ - destroySWFTextField((SWFTextField)resource->ptr); -} - -/* {{{ internal function getTextField - Returns the SWFTextField object contained in zval *id */ -static SWFTextField getTextField(zval *id TSRMLS_DC) -{ - void *field = SWFgetProperty(id, "textfield", 9, le_swftextfieldp TSRMLS_CC); - - if (!field) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFTextField"); - } - return (SWFTextField)field; -} -/* }}} */ - -/* {{{ proto void swftextfield::setFont(object font) - Sets the font for this textfield */ -PHP_METHOD(swftextfield, setFont) -{ - zval **font; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &font) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_object_ex(font); - SWFTextField_setFont(field, getFont(*font TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setBounds(float width, float height) - Sets the width and height of this textfield */ -PHP_METHOD(swftextfield, setBounds) -{ - zval **width, **height; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &width, &height) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(width); - convert_to_double_ex(height); - SWFTextField_setBounds(field, FLOAT_Z_DVAL_PP(width), FLOAT_Z_DVAL_PP(height)); -} -/* }}} */ - -/* {{{ proto void swftextfield::align(int alignment) - Sets the alignment of this textfield */ -PHP_METHOD(swftextfield, align) -{ - zval **align; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &align) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(align); - SWFTextField_setAlignment(field, Z_LVAL_PP(align)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setHeight(float height) - Sets the font height of this textfield */ -PHP_METHOD(swftextfield, setHeight) -{ - zval **height; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &height) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(height); - SWFTextField_setHeight(field, FLOAT_Z_DVAL_PP(height)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setLeftMargin(float margin) - Sets the left margin of this textfield */ -PHP_METHOD(swftextfield, setLeftMargin) -{ - zval **margin; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &margin) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(margin); - SWFTextField_setLeftMargin(field, FLOAT_Z_DVAL_PP(margin)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setRightMargin(float margin) - Sets the right margin of this textfield */ -PHP_METHOD(swftextfield, setRightMargin) -{ - zval **margin; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &margin) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(margin); - SWFTextField_setRightMargin(field, FLOAT_Z_DVAL_PP(margin)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setMargins(float left, float right) - Sets both margins of this textfield */ -PHP_METHOD(swftextfield, setMargins) -{ - zval **left, **right; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(left); - convert_to_double_ex(right); - SWFTextField_setLeftMargin(field, FLOAT_Z_DVAL_PP(left)); - SWFTextField_setRightMargin(field, FLOAT_Z_DVAL_PP(right)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setIndentation(float indentation) - Sets the indentation of the first line of this textfield */ -PHP_METHOD(swftextfield, setIndentation) -{ - zval **indent; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &indent) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(indent); - SWFTextField_setIndentation(field, FLOAT_Z_DVAL_PP(indent)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setLineSpacing(float space) - Sets the line spacing of this textfield */ -PHP_METHOD(swftextfield, setLineSpacing) -{ - zval **spacing; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &spacing) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(spacing); - SWFTextField_setLineSpacing(field, FLOAT_Z_DVAL_PP(spacing)); -} -/* }}} */ - -/* {{{ proto void swftextfield::setColor(int r, int g, int b [, int a]) - Sets the color of this textfield */ -PHP_METHOD(swftextfield, setColor) -{ - zval **r, **g, **b, **a; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - byte alpha = 0xff; - - if (ZEND_NUM_ARGS() == 3) { - if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (ZEND_NUM_ARGS() == 4) { - if (zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(a); - alpha = BYTE_Z_LVAL_PP(a); - } else { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(r); - convert_to_long_ex(g); - convert_to_long_ex(b); - SWFTextField_setColor(field, BYTE_Z_LVAL_PP(r), BYTE_Z_LVAL_PP(g), BYTE_Z_LVAL_PP(b), (byte)alpha); -} -/* }}} */ - -/* {{{ proto void swftextfield::setName(string var_name) - Sets the variable name of this textfield */ -PHP_METHOD(swftextfield, setName) -{ - zval **name; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(name); - SWFTextField_setVariableName(field, Z_STRVAL_PP(name)); -} -/* }}} */ - -/* {{{ proto void swftextfield::addString(string str) - Adds the given string to this textfield */ -PHP_METHOD(swftextfield, addString) -{ - zval **string; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &string) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(string); - SWFTextField_addString(field, Z_STRVAL_PP(string)); -} -/* }}} */ - -#ifdef HAVE_NEW_MING -/* {{{ proto void swftextfield::setPadding(float padding) - Sets the padding of this textfield */ -PHP_METHOD(swftextfield, setPadding) -{ - zval **padding; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &padding) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_double_ex(padding); - - SWFTextField_setPadding(field, Z_DVAL_PP(padding)); -} -/* }}} */ - -/* {{{ proto void swftextfield::addChars(string) - adds characters to a font that will be available within a textfield */ -PHP_METHOD(swftextfield, addChars) -{ - zval **zstring; - SWFTextField field = getTextField(getThis() TSRMLS_CC); - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(zstring); - - SWFTextField_addChars(field, Z_STRVAL_PP(zstring)); - -} -/* }}} */ -#endif - -static zend_function_entry swftextfield_functions[] = { - PHP_ME(swftextfield, __construct, NULL, 0) - PHP_ME(swftextfield, setFont, NULL, 0) - PHP_ME(swftextfield, setBounds, NULL, 0) - PHP_ME(swftextfield, align, NULL, 0) - PHP_ME(swftextfield, setHeight, NULL, 0) - PHP_ME(swftextfield, setLeftMargin, NULL, 0) - PHP_ME(swftextfield, setRightMargin, NULL, 0) - PHP_ME(swftextfield, setMargins, NULL, 0) - PHP_ME(swftextfield, setIndentation, NULL, 0) - PHP_ME(swftextfield, setLineSpacing, NULL, 0) - PHP_ME(swftextfield, setColor, NULL, 0) - PHP_ME(swftextfield, setName, NULL, 0) - PHP_ME(swftextfield, addString, NULL, 0) -#ifdef HAVE_NEW_MING - PHP_ME(swftextfield, setPadding, NULL, 0) - PHP_ME(swftextfield, addChars, NULL, 0) -#endif - { NULL, NULL, NULL } -}; - -/* }}} */ - -zend_module_entry ming_module_entry = { - STANDARD_MODULE_HEADER, - "ming", - ming_functions, - PHP_MINIT(ming), /* module init function */ - NULL, /* module shutdown function */ - PHP_RINIT(ming), /* request init function */ - NULL, /* request shutdown function */ - PHP_MINFO(ming), /* module info function */ - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_MING -ZEND_GET_MODULE(ming) -#endif - -/* {{{ todo PHP_MINFO_FUNCTION(ming) -*/ -PHP_MINFO_FUNCTION(ming) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Ming SWF output library", "enabled"); - php_info_print_table_row(2, "Version", MING_VERSION_TEXT); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ todo PHP_MINIT_FUNCTION(ming) -*/ - -/* custom error handler propagates ming errors up to php */ -static void php_ming_error(const char *msg, ...) -{ - va_list args; - char *buffer; - - TSRMLS_FETCH(); - - va_start(args, msg); - vspprintf(&buffer, 0, msg, args); - va_end(args); - - php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s", buffer); - efree(buffer); -} - -PHP_RINIT_FUNCTION(ming) -{ - /* XXX - this didn't work so well last I tried.. */ - - if (Ming_init() != 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error initializing Ming module"); - return FAILURE; - } - return SUCCESS; -} - -PHP_MINIT_FUNCTION(ming) -{ - zend_class_entry shape_class_entry; - zend_class_entry fill_class_entry; - zend_class_entry gradient_class_entry; - zend_class_entry bitmap_class_entry; - zend_class_entry text_class_entry; - zend_class_entry textfield_class_entry; - zend_class_entry font_class_entry; - zend_class_entry displayitem_class_entry; - zend_class_entry movie_class_entry; - zend_class_entry button_class_entry; - zend_class_entry action_class_entry; - zend_class_entry morph_class_entry; - zend_class_entry sprite_class_entry; - zend_class_entry sound_class_entry; -#ifdef HAVE_NEW_MING - zend_class_entry fontchar_class_entry; - zend_class_entry soundinstance_class_entry; - zend_class_entry videostream_class_entry; -#endif -#ifdef HAVE_SWFPREBUILTCLIP - zend_class_entry prebuiltclip_class_entry; -#endif - - Ming_setErrorFunction((void *) php_ming_error); - -#define CONSTANT(s,c) REGISTER_LONG_CONSTANT((s), (c), CONST_CS | CONST_PERSISTENT) - -#ifdef HAVE_NEW_MING - CONSTANT("MING_NEW", 1); -#else - CONSTANT("MING_NEW", 0); -#endif -#ifdef HAVE_MING_ZLIB - CONSTANT("MING_ZLIB", 1); -#else - CONSTANT("MING_ZLIB", 0); -#endif - /* flags for SWFButton_addShape */ - CONSTANT("SWFBUTTON_HIT", SWFBUTTONRECORD_HITSTATE); - CONSTANT("SWFBUTTON_DOWN", SWFBUTTONRECORD_DOWNSTATE); - CONSTANT("SWFBUTTON_OVER", SWFBUTTONRECORD_OVERSTATE); - CONSTANT("SWFBUTTON_UP", SWFBUTTONRECORD_UPSTATE); - - /* flags for SWFButton_addAction */ - CONSTANT("SWFBUTTON_MOUSEUPOUTSIDE", SWFBUTTON_MOUSEUPOUTSIDE); - CONSTANT("SWFBUTTON_DRAGOVER", SWFBUTTON_DRAGOVER); - CONSTANT("SWFBUTTON_DRAGOUT", SWFBUTTON_DRAGOUT); - CONSTANT("SWFBUTTON_MOUSEUP", SWFBUTTON_MOUSEUP); - CONSTANT("SWFBUTTON_MOUSEDOWN", SWFBUTTON_MOUSEDOWN); - CONSTANT("SWFBUTTON_MOUSEOUT", SWFBUTTON_MOUSEOUT); - CONSTANT("SWFBUTTON_MOUSEOVER", SWFBUTTON_MOUSEOVER); - - /* flags for SWFFill */ - CONSTANT("SWFFILL_RADIAL_GRADIENT", SWFFILL_RADIAL_GRADIENT); - CONSTANT("SWFFILL_LINEAR_GRADIENT", SWFFILL_LINEAR_GRADIENT); - CONSTANT("SWFFILL_TILED_BITMAP", SWFFILL_TILED_BITMAP); - CONSTANT("SWFFILL_CLIPPED_BITMAP", SWFFILL_CLIPPED_BITMAP); - - /* flags for SWFTextField_init */ - CONSTANT("SWFTEXTFIELD_HASLENGTH", SWFTEXTFIELD_HASLENGTH); - CONSTANT("SWFTEXTFIELD_NOEDIT", SWFTEXTFIELD_NOEDIT); - CONSTANT("SWFTEXTFIELD_PASSWORD", SWFTEXTFIELD_PASSWORD); - CONSTANT("SWFTEXTFIELD_MULTILINE", SWFTEXTFIELD_MULTILINE); - CONSTANT("SWFTEXTFIELD_WORDWRAP", SWFTEXTFIELD_WORDWRAP); - CONSTANT("SWFTEXTFIELD_DRAWBOX", SWFTEXTFIELD_DRAWBOX); - CONSTANT("SWFTEXTFIELD_NOSELECT", SWFTEXTFIELD_NOSELECT); - CONSTANT("SWFTEXTFIELD_HTML", SWFTEXTFIELD_HTML); - - /* flags for SWFTextField_align */ - CONSTANT("SWFTEXTFIELD_ALIGN_LEFT", SWFTEXTFIELD_ALIGN_LEFT); - CONSTANT("SWFTEXTFIELD_ALIGN_RIGHT", SWFTEXTFIELD_ALIGN_RIGHT); - CONSTANT("SWFTEXTFIELD_ALIGN_CENTER", SWFTEXTFIELD_ALIGN_CENTER); - CONSTANT("SWFTEXTFIELD_ALIGN_JUSTIFY", SWFTEXTFIELD_ALIGN_JUSTIFY); - - /* flags for SWFDisplayItem_addAction */ - CONSTANT("SWFACTION_ONLOAD", SWFACTION_ONLOAD); - CONSTANT("SWFACTION_ENTERFRAME", SWFACTION_ENTERFRAME); - CONSTANT("SWFACTION_UNLOAD", SWFACTION_UNLOAD); - CONSTANT("SWFACTION_MOUSEMOVE", SWFACTION_MOUSEMOVE); - CONSTANT("SWFACTION_MOUSEDOWN", SWFACTION_MOUSEDOWN); - CONSTANT("SWFACTION_MOUSEUP", SWFACTION_MOUSEUP); - CONSTANT("SWFACTION_KEYDOWN", SWFACTION_KEYDOWN); - CONSTANT("SWFACTION_KEYUP", SWFACTION_KEYUP); - CONSTANT("SWFACTION_DATA", SWFACTION_DATA); - - le_swfshapep = zend_register_list_destructors_ex(destroy_SWFShape_resource, NULL, "SWFShape", module_number); - le_swffillp = zend_register_list_destructors_ex(destroy_SWFFill_resource, NULL, "SWFFill", module_number); - le_swfgradientp = zend_register_list_destructors_ex(destroy_SWFGradient_resource, NULL, "SWFGradient", module_number); - le_swfbitmapp = zend_register_list_destructors_ex(destroy_SWFBitmap_resource, NULL, "SWFBitmap", module_number); - le_swftextp = zend_register_list_destructors_ex(destroy_SWFText_resource, NULL, "SWFText", module_number); - le_swftextfieldp = zend_register_list_destructors_ex(destroy_SWFTextField_resource, NULL, "SWFTextField", module_number); - le_swffontp = zend_register_list_destructors_ex(destroy_SWFFont_resource, NULL, "SWFFont", module_number); - le_swfdisplayitemp = zend_register_list_destructors_ex(NULL, NULL, "SWFDisplayItem", module_number); - le_swfmoviep = zend_register_list_destructors_ex(destroy_SWFMovie_resource, NULL, "SWFMovie", module_number); - le_swfbuttonp = zend_register_list_destructors_ex(destroy_SWFButton_resource, NULL, "SWFButton", module_number); - le_swfactionp = zend_register_list_destructors_ex(NULL, NULL, "SWFAction", module_number); - le_swfmorphp = zend_register_list_destructors_ex(destroy_SWFMorph_resource, NULL, "SWFMorph", module_number); - le_swfspritep = zend_register_list_destructors_ex(destroy_SWFSprite_resource, NULL, "SWFSprite", module_number); - le_swfinputp = zend_register_list_destructors_ex(destroy_SWFInput_resource, NULL, "SWFInput", module_number); - - le_swfsoundp = zend_register_list_destructors_ex(destroy_SWFSound_resource, NULL, "SWFSound", module_number); -#ifdef HAVE_NEW_MING - le_swffontcharp = zend_register_list_destructors_ex(destroy_SWFFontCharacter_resource, NULL, "SWFFontCharacter", module_number); - le_swfsoundinstancep = zend_register_list_destructors_ex(NULL, NULL, "SWFSoundInstance", module_number); - le_swfvideostreamp = zend_register_list_destructors_ex(destroy_SWFVideoStream_resource, NULL, "SWFVideoStream", module_number); -#endif -#ifdef HAVE_SWFPREBUILTCLIP - le_swfprebuiltclipp = zend_register_list_destructors_ex(destroy_SWFPrebuiltClip_resource, NULL, "SWFPrebuiltClip", module_number); -#endif - - INIT_CLASS_ENTRY(shape_class_entry, "SWFShape", swfshape_functions); - INIT_CLASS_ENTRY(fill_class_entry, "SWFFill", swffill_functions); - INIT_CLASS_ENTRY(gradient_class_entry, "SWFGradient", swfgradient_functions); - INIT_CLASS_ENTRY(bitmap_class_entry, "SWFBitmap", swfbitmap_functions); - INIT_CLASS_ENTRY(text_class_entry, "SWFText", swftext_functions); - INIT_CLASS_ENTRY(textfield_class_entry, "SWFTextField", swftextfield_functions); - INIT_CLASS_ENTRY(font_class_entry, "SWFFont", swffont_functions); - INIT_CLASS_ENTRY(displayitem_class_entry, "SWFDisplayItem", swfdisplayitem_functions); - INIT_CLASS_ENTRY(movie_class_entry, "SWFMovie", swfmovie_functions); - INIT_CLASS_ENTRY(button_class_entry, "SWFButton", swfbutton_functions); - INIT_CLASS_ENTRY(action_class_entry, "SWFAction", swfaction_functions); - INIT_CLASS_ENTRY(morph_class_entry, "SWFMorph", swfmorph_functions); - INIT_CLASS_ENTRY(sprite_class_entry, "SWFSprite", swfsprite_functions); - INIT_CLASS_ENTRY(sound_class_entry, "SWFSound", swfsound_functions); -#ifdef HAVE_NEW_MING - INIT_CLASS_ENTRY(fontchar_class_entry, "SWFFontChar", swffontchar_functions); - INIT_CLASS_ENTRY(soundinstance_class_entry, "SWFSoundInstance", swfsoundinstance_functions); - INIT_CLASS_ENTRY(videostream_class_entry, "SWFVideoStream", swfvideostream_functions); -#endif -#ifdef HAVE_SWFPREBUILTCLIP - INIT_CLASS_ENTRY(prebuiltclip_class_entry, "SWFPrebuiltClip", swfprebuiltclip_functions); -#endif - - shape_class_entry_ptr = zend_register_internal_class(&shape_class_entry TSRMLS_CC); - fill_class_entry_ptr = zend_register_internal_class(&fill_class_entry TSRMLS_CC); - gradient_class_entry_ptr = zend_register_internal_class(&gradient_class_entry TSRMLS_CC); - bitmap_class_entry_ptr = zend_register_internal_class(&bitmap_class_entry TSRMLS_CC); - text_class_entry_ptr = zend_register_internal_class(&text_class_entry TSRMLS_CC); - textfield_class_entry_ptr = zend_register_internal_class(&textfield_class_entry TSRMLS_CC); - font_class_entry_ptr = zend_register_internal_class(&font_class_entry TSRMLS_CC); - displayitem_class_entry_ptr = zend_register_internal_class(&displayitem_class_entry TSRMLS_CC); - movie_class_entry_ptr = zend_register_internal_class(&movie_class_entry TSRMLS_CC); - button_class_entry_ptr = zend_register_internal_class(&button_class_entry TSRMLS_CC); - action_class_entry_ptr = zend_register_internal_class(&action_class_entry TSRMLS_CC); - morph_class_entry_ptr = zend_register_internal_class(&morph_class_entry TSRMLS_CC); - sprite_class_entry_ptr = zend_register_internal_class(&sprite_class_entry TSRMLS_CC); - sound_class_entry_ptr = zend_register_internal_class(&sound_class_entry TSRMLS_CC); -#ifdef HAVE_NEW_MING - fontchar_class_entry_ptr = zend_register_internal_class(&fontchar_class_entry TSRMLS_CC); - soundinstance_class_entry_ptr = zend_register_internal_class(&soundinstance_class_entry TSRMLS_CC); - videostream_class_entry_ptr = zend_register_internal_class(&videostream_class_entry TSRMLS_CC); -#endif -#ifdef HAVE_SWFPREBUILTCLIP - prebuiltclip_class_entry_ptr = zend_register_internal_class(&prebuiltclip_class_entry TSRMLS_CC); -#endif - - return SUCCESS; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ming/ming.dsp b/ext/ming/ming.dsp deleted file mode 100644 index 00dfbd42d6884..0000000000000 --- a/ext/ming/ming.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ming" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ming - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ming.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ming.mak" CFG="ming - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ming - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ming - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ming - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MING_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\bindlib_w32" /D "WIN32" /D "MING_EXPORTS" /D "COMPILE_DL_MING" /D "HAVE_MING" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libming.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ming.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ming - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MING_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MING_EXPORTS" /D "COMPILE_DL_MING" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_MING" /D ZTS=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libming.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ming.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "ming - Win32 Release_TS" -# Name "ming - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ming.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_ming.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/ming/php_ming.h b/ext/ming/php_ming.h deleted file mode 100644 index 18ccf01cfd9ce..0000000000000 --- a/ext/ming/php_ming.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Dave Hayden <dave@opaque.net> | - | Frank M. Kromann <fmk@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _PHP_MING_H -#define _PHP_MING_H - -#if HAVE_MING - -extern zend_module_entry ming_module_entry; -#define ming_module_ptr &ming_module_entry - -PHP_RINIT_FUNCTION(ming); -PHP_MINIT_FUNCTION(ming); -PHP_MINFO_FUNCTION(ming); - -PHP_METHOD(swfbitmap, init); -PHP_METHOD(swfbitmap, getWidth); -PHP_METHOD(swfbitmap, getHeight); - -PHP_METHOD(swffill, init); -PHP_METHOD(swffill, moveTo); -PHP_METHOD(swffill, scaleTo); -PHP_METHOD(swffill, rotateTo); -PHP_METHOD(swffill, skewXTo); -PHP_METHOD(swffill, skewYTo); - -PHP_METHOD(swfgradient, init); -PHP_METHOD(swfgradient, addEntry); - -PHP_METHOD(swfshape, init); -PHP_METHOD(swfshape, addfill); -PHP_METHOD(swfshape, setrightfill); -PHP_METHOD(swfshape, setleftfill); -PHP_METHOD(swfshape, setline); -PHP_METHOD(swfshape, movepento); -PHP_METHOD(swfshape, movepen); -PHP_METHOD(swfshape, drawlineto); -PHP_METHOD(swfshape, drawline); -PHP_METHOD(swfshape, drawcurveto); -PHP_METHOD(swfshape, drawcurve); -PHP_METHOD(swfshape, drawglyph); -PHP_METHOD(swfshape, drawarc); -PHP_METHOD(swfshape, drawcircle); -PHP_METHOD(swfshape, drawcubic); -PHP_METHOD(swfshape, drawcubicto); - -PHP_METHOD(swfmovie, init); -PHP_METHOD(swfmovie, output); -PHP_METHOD(swfmovie, saveToFile); -PHP_METHOD(swfmovie, save); -PHP_METHOD(swfmovie, add); -PHP_METHOD(swfmovie, remove); -PHP_METHOD(swfmovie, nextFrame); -PHP_METHOD(swfmovie, labelFrame); -PHP_METHOD(swfmovie, setBackground); -PHP_METHOD(swfmovie, setRate); -PHP_METHOD(swfmovie, setDimension); -PHP_METHOD(swfmovie, setFrames); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfmovie, streamMp3); -PHP_METHOD(swfmovie, addExport); -PHP_METHOD(swfmovie, writeExports); -PHP_METHOD(swfmovie, startSound); -PHP_METHOD(swfmovie, stopSound); -PHP_METHOD(swfmovie, importChar); -PHP_METHOD(swfmovie, importFont); -PHP_METHOD(swfmovie, addFont); -#endif - -PHP_METHOD(swfsprite, init); -PHP_METHOD(swfsprite, add); -PHP_METHOD(swfsprite, remove); -PHP_METHOD(swfsprite, nextFrame); -PHP_METHOD(swfsprite, labelFrame); -PHP_METHOD(swfsprite, setFrames); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfsprite, startSound); -PHP_METHOD(swfsprite, stopSound); -#endif - -PHP_METHOD(swffont, init); -PHP_METHOD(swffont, getWidth); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swffont, getUTF8Width); -/*PHP_METHOD(swffont, getWideWidth);*/ -#endif - -PHP_METHOD(swffont, getAscent); -PHP_METHOD(swffont, getDescent); -PHP_METHOD(swffont, getLeading); - -#ifdef HAVE_NEW_MING -/*PHP_METHOD(swffont, addChars);*/ -PHP_METHOD(swffont, getShape); -#endif - -PHP_METHOD(swffont, getLeading); - -PHP_METHOD(swftext, init); -PHP_METHOD(swftext, setFont); -PHP_METHOD(swftext, setHeight); -PHP_METHOD(swftext, setSpacing); -PHP_METHOD(swftext, setColor); -PHP_METHOD(swftext, moveTo); -PHP_METHOD(swftext, addString); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swftext, addUTF8String); -/*PHP_METHOD(swftext, addWideString);*/ -#endif - -PHP_METHOD(swftext, getWidth); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swftext, getUTF8Width); -/*PHP_METHOD(swftext, getWideWidth);*/ -#endif - -PHP_METHOD(swftext, getAscent); -PHP_METHOD(swftext, getDescent); -PHP_METHOD(swftext, getLeading); - -PHP_METHOD(swftextfield, init); -PHP_METHOD(swftextfield, setFont); -PHP_METHOD(swftextfield, setBounds); -PHP_METHOD(swftextfield, align); -PHP_METHOD(swftextfield, setHeight); -PHP_METHOD(swftextfield, setLeftMargin); -PHP_METHOD(swftextfield, setRightMargin); -PHP_METHOD(swftextfield, setMargins); -PHP_METHOD(swftextfield, setIndentation); -PHP_METHOD(swftextfield, setLineSpacing); -PHP_METHOD(swftextfield, setColor); -PHP_METHOD(swftextfield, setName); -PHP_METHOD(swftextfield, addString); -PHP_METHOD(swftextfield, setPadding); -PHP_METHOD(swftextfield, addChars); - -PHP_METHOD(swffontchar, addChars); -PHP_METHOD(swffontchar, addUTF8Chars); - -PHP_METHOD(swfdisplayitem, move); -PHP_METHOD(swfdisplayitem, moveTo); -PHP_METHOD(swfdisplayitem, scale); -PHP_METHOD(swfdisplayitem, scaleTo); -PHP_METHOD(swfdisplayitem, rotate); -PHP_METHOD(swfdisplayitem, rotateTo); -PHP_METHOD(swfdisplayitem, skewX); -PHP_METHOD(swfdisplayitem, skewXTo); -PHP_METHOD(swfdisplayitem, skewY); -PHP_METHOD(swfdisplayitem, skewYTo); -PHP_METHOD(swfdisplayitem, setMatrix); -PHP_METHOD(swfdisplayitem, setDepth); -PHP_METHOD(swfdisplayitem, setRatio); -PHP_METHOD(swfdisplayitem, addColor); -PHP_METHOD(swfdisplayitem, multColor); -PHP_METHOD(swfdisplayitem, setName); -PHP_METHOD(swfdisplayitem, addAction); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfdisplayitem, remove); -PHP_METHOD(swfdisplayitem, setMaskLevel); -PHP_METHOD(swfdisplayitem, endMask); -PHP_METHOD(swfdisplayitem, getX); -PHP_METHOD(swfdisplayitem, getY); -PHP_METHOD(swfdisplayitem, getXScale); -PHP_METHOD(swfdisplayitem, getYScale); -PHP_METHOD(swfdisplayitem, getXSkew); -PHP_METHOD(swfdisplayitem, getYSkew); -PHP_METHOD(swfdisplayitem, getRot); -#endif - -PHP_METHOD(swfbutton, init); -PHP_METHOD(swfbutton, setHit); -PHP_METHOD(swfbutton, setOver); -PHP_METHOD(swfbutton, setUp); -PHP_METHOD(swfbutton, setDown); -PHP_METHOD(swfbutton, setAction); -PHP_METHOD(swfbutton, addShape); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfbutton, setMenu); -#endif - -PHP_METHOD(swfbutton, addAction); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfbutton, addSound); -#endif - -PHP_METHOD(swfaction, init); - -PHP_METHOD(swfmorph, init); -PHP_METHOD(swfmorph, getShape1); -PHP_METHOD(swfmorph, getShape2); - -PHP_METHOD(swfsound, init); - -#ifdef HAVE_NEW_MING -PHP_METHOD(swfsoundinstance, noMultiple); -PHP_METHOD(swfsoundinstance, loopInPoint); -PHP_METHOD(swfsoundinstance, loopOutPoint); -PHP_METHOD(swfsoundinstance, loopCount); -#endif - -PHP_FUNCTION(ming_keypress); -PHP_FUNCTION(ming_setCubicThreshold); -PHP_FUNCTION(ming_setScale); -PHP_FUNCTION(ming_useSWFVersion); - -#ifdef HAVE_NEW_MING -PHP_FUNCTION(ming_useConstants); -#endif - -#else -#define ming_module_ptr NULL -#endif /* HAVE_MING */ -#define phpext_ming_ptr ming_module_ptr -#endif /* _PHP_MING_H */ diff --git a/ext/ming/tests/swfaction-new.phpt b/ext/ming/tests/swfaction-new.phpt deleted file mode 100755 index 43527100151da..0000000000000 --- a/ext/ming/tests/swfaction-new.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Ming: Simple SWFAction() test ---SKIPIF-- -<?php -if (!extension_loaded("ming")) die("skip"); -if (!MING_NEW && !MING_ZLIB) die("skip old ming"); -?> ---FILE-- -<?php /* $Id$ */ - - $s = new SWFShape(); - $f = $s->addFill(0xff, 0, 0); - $s->setRightFill($f); - - $s->movePenTo(-500,-500); - $s->drawLineTo(500,-500); - $s->drawLineTo(500,500); - $s->drawLineTo(-500,500); - $s->drawLineTo(-500,-500); - - $p = new SWFSprite(); - $i = $p->add($s); - $i->setDepth(1); - $p->nextFrame(); - - for($n=0; $n<5; ++$n) - { - $i->rotate(-15); - $p->nextFrame(); - } - - $m = new SWFMovie(); - $m->setBackground(0xff, 0xff, 0xff); - $m->setDimension(6000,4000); - - $i = $m->add($p); - $i->setDepth(1); - $i->moveTo(1000,2000); - $i->setName("box"); - - $m->add(new SWFAction("_root.box._x += 3;")); - $m->nextFrame(); - $m->add(new SWFAction("gotoFrame(0); play();")); - $m->nextFrame(); - - $m->save(dirname(__FILE__).'/test.swf'); - echo md5_file(dirname(__FILE__).'/test.swf'), "\n"; - unlink(dirname(__FILE__).'/test.swf'); -?> ---EXPECT-- -d0f09a7b6a14d3fe6d570367deb38633 diff --git a/ext/ming/tests/swfaction.phpt b/ext/ming/tests/swfaction.phpt deleted file mode 100644 index 4717c7c998d75..0000000000000 --- a/ext/ming/tests/swfaction.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Ming: Simple SWFAction() test ---SKIPIF-- -<?php -if (!extension_loaded("ming")) die("skip"); -if (MING_NEW || MING_ZLIB) die("skip new ming"); -?> ---FILE-- -<?php /* $Id$ */ - - $s = new SWFShape(); - $f = $s->addFill(0xff, 0, 0); - $s->setRightFill($f); - - $s->movePenTo(-500,-500); - $s->drawLineTo(500,-500); - $s->drawLineTo(500,500); - $s->drawLineTo(-500,500); - $s->drawLineTo(-500,-500); - - $p = new SWFSprite(); - $i = $p->add($s); - $i->setDepth(1); - $p->nextFrame(); - - for($n=0; $n<5; ++$n) - { - $i->rotate(-15); - $p->nextFrame(); - } - - $m = new SWFMovie(); - $m->setBackground(0xff, 0xff, 0xff); - $m->setDimension(6000,4000); - - $i = $m->add($p); - $i->setDepth(1); - $i->moveTo(1000,2000); - $i->setName("box"); - - $m->add(new SWFAction("_root.box._x += 3;")); - $m->nextFrame(); - $m->add(new SWFAction("gotoFrame(0); play();")); - $m->nextFrame(); - - $m->save(dirname(__FILE__).'/test.swf'); - echo md5_file(dirname(__FILE__).'/test.swf'), "\n"; - unlink(dirname(__FILE__).'/test.swf'); -?> ---EXPECT-- -9e47538692393b9915faf3fc7e686cd5 diff --git a/ext/msession/CREDITS b/ext/msession/CREDITS deleted file mode 100644 index 4703783a74eaa..0000000000000 --- a/ext/msession/CREDITS +++ /dev/null @@ -1,3 +0,0 @@ -msession -Mark L. Woodward -mailto:mlwmohawk@mohawksoft.com diff --git a/ext/msession/README b/ext/msession/README deleted file mode 100644 index a4ed70faedf7a..0000000000000 --- a/ext/msession/README +++ /dev/null @@ -1,33 +0,0 @@ -This is msession, it is an interface to a stand-alone session -management system. The msession daemon can be found at -Mohawk Software's web site. - -http://www.mohawksoft.com - -Requirements: -Mohawk Software's Phoenix library. -Mohawk Software's msession daemon. - -Building: -In the config.m4 file you will need to specify the include -and library directories for Phoenix. The setting in config.m4 -is probably wrong. - -You will need phoenix installed and built to compile this -module. - -To use msession-test.php, msession must be the default session -handler in PHP. The easiest way to do that is in the php.ini -file as: - -[Session] -session.save_handler = msession -session.save_path = localhost - -The session.save.path is the host name of the server running -msessiond. - -12/22/2001 -Changed msession_getdata(...) to msession_get_data(...) -Changed msession_setdata(...) to msession_set_data(...) -(docs to follow) diff --git a/ext/msession/config.m4 b/ext/msession/config.m4 deleted file mode 100644 index f41d018c6d9a1..0000000000000 --- a/ext/msession/config.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(msession, for msession support, -[ --with-msession[=DIR] Include msession support]) - -if test "$PHP_MSESSION" != "no"; then - if test -r $PHP_MSESSION/lib/libphoenix.a; then - PHOENIX_DIR=$PHP_MSESSION - else - AC_MSG_CHECKING(for msession in default path) - for i in /usr/local/phoenix /usr/local /usr; do - if test -r $i/lib/libphoenix.a; then - PHOENIX_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$PHOENIX_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the Phoenix / msession distribution) - fi - - - AC_DEFINE(HAVE_MSESSION, 1, [ ]) - PHP_ADD_LIBRARY_WITH_PATH(phoenix, "$PHOENIX_DIR/lib", PHOENIX_LIB) - PHOENIX_INCLUDE="-I$PHOENIX_DIR" - PHP_SUBST(PHOENIX_LIB) - - PHP_REQUIRE_CXX - PHP_NEW_EXTENSION(msession, msession.c, $ext_shared) - PHP_ADD_LIBRARY(stdc++) -fi - diff --git a/ext/msession/msession-test.php b/ext/msession/msession-test.php deleted file mode 100644 index e591fcca70a3f..0000000000000 --- a/ext/msession/msession-test.php +++ /dev/null @@ -1,125 +0,0 @@ -<? -# msession-test.php -# This is a test page for msession functions. -# most msession functions are used in this page with -# the exception of msession_get_data, and msession_set_data -# which are used implicitly with the PHP session -# extension. -# -# -# - -# Start the session system, this will connect to msession -# as configured in PHP.INI. -# -# Start sessions, this will set a cookie. -session_start(); - -# Now, optional, use msession_uniq() to create a guarenteed -# uniq session name. -# -if(!$HTTP_COOKIE_VARS["PHPSESSID"]) -{ - # Use uniq to create the session. This is guarenteed to be - # uniq in the server. - $sid = msession_uniq(32); - setcookie ("PHPSESSID", $sid); - session_id($sid); - $HTTP_COOKIE_VARS["PHPSESSID"] = $sid; - # New session, set some variables - if(0) // One at a time - { - echo "Set Variable: " . msession_set($sid, 'time',time()) ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name1','test1') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name2','test2') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name3','test3') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name4','test4') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name5','test5') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name6','test6') ."<p>\n"; - echo "Set Variable: " . msession_set($sid, 'name7','test7') ."<p>\n"; - } - else // All at once in an array - { - $setarray = array(); - $setarray['time']=time(); - $setarray['name1'] = 'test1'; - $setarray['name2'] = 'test2'; - $setarray['name3'] = 'test3'; - $setarray['name4'] = 'test4'; - $setarray['name5'] = 'test5'; - $setarray['name6'] = 'test6'; - $setarray['name7'] = 'test7'; - msession_set_array($sid, $setarray); - } -} -else -{ - $sid = $HTTP_COOKIE_VARS["PHPSESSID"]; -} - -#This makes a link between the variable $count and the -# session variable "count" -session_register("count"); - -$count ++; - -# Output some information. -echo "sid: " . $sid . "<br>\n"; -echo "Session Count: " . $count . "<br>\n"; - -# Use msession_randstr() to produce a random string. -# A valid string of n characters of jibberish is returned. -echo "Random String: " . msession_randstr(32) . "<br>\n"; - -# This is a thread safe increment, unlike PHP's session, many web servers -# can be updating this variable and collisions are managed. -# (for this to work, older versions of msessiond must be started with "-g globals" -# newer versions create it by default) -echo "Global Count: " . msession_inc(globals, "counter") . "<br>\n"; - -# This gets a count of active sessions. -echo "Total active sessions: " . msession_count() . "<br>\n"; - -# This gets all the variables for a user in an associative array. -$varray = msession_get_array($sid); - -if(!$varray) - echo "Get variable array: Failed<br>\n"; - -# Display all the user's variables -$arraykeys = array_keys($varray); -for($i=0; $arraykeys[$i]; $i++) - echo "Key: " . $arraykeys[ $i ] ." = " .$varray[$arraykeys[$i]] ."<br>\n"; - - -# Find a list of all sessions with same name/value pair -$array = msession_find('name1', 'test1'); - -#display the sessions -for($i=0; $array[$i]; $i++) - echo "Similar Sessions: " . $i . " " . $array[$i] . "<br>\n"; - -# Find all the sessions which have the variable "time" set. -$vararray = msession_listvar('time'); - -$arraykeys = array_keys($vararray); - -for($i=0; $arraykeys[$i]; $i++) - echo "Key: " . $arraykeys[ $i ] ." = " .$vararray[$arraykeys[$i]] ."<br>\n"; - -# msession can support a personality plugin, this is an escape call directly -# into the plugin's REQ_ESCAPE function. -echo "Call the plugin: " . msession_plugin($sid, 3, "test"). "<br>\n"; - -# msession also supprts function-only plugins. this is a call into the demo -# plugin (funct.so) which returns the uptime of the msessiond process. -echo "Call the function: " . msession_call('fntest', "1","2", "3", "4") ."<br>\n"; - -#List ALL sessions on the system -$sarray = msession_list(); - -for($i=0; $sarray[$i]; $i++) - echo "Sessions: " . $i . " " . $sarray[$i] . "<br>\n"; - -?> - diff --git a/ext/msession/msession.c b/ext/msession/msession.c deleted file mode 100644 index ffbe791c434a2..0000000000000 --- a/ext/msession/msession.c +++ /dev/null @@ -1,1375 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | msession 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Mark Woodward <markw@mohawksoft.com> | - | Portions copyright the PHP group. | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_msession.h" -#include "reqclient.h" -#include "ext/standard/info.h" -#include "ext/session/php_session.h" - - -/* Macros and such */ -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef SID_LEN -#define SID_LEN 32 -#endif - - -/* Uncomment to get debugging messages */ -/* #define ERR_DEBUG */ - -#ifdef ERR_DEBUG -#define ELOG( str ) php_log_err( str ) -#else -#define ELOG( str ) -#endif - -/* Test if system is OK fror use. */ -/* Macros may be ugly, but I can globaly add debuging when needed. */ -#define IFCONNECT_BEGIN if(s_reqb && s_conn) { -#define IFCONNECT_ENDVAL(V) } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Msession not initialized"); return V; } -#define IFCONNECT_END } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Msession not initialized"); RETURN_FALSE; } - -#ifndef HAVE_PHP_SESSION -#error HAVE_PHP_SESSION not defined -#endif - -/* Test if session module contains custom sesson ID patch */ -#ifdef PHP_SESSION_API -#if (PHP_SESSION_API >= 20020330) -#define HAVE_PHP_SESSION_CREATESID -#endif -#endif - -/* This sets the PHP API version used in the file. */ -/* If this module does not compile on the version of PHP you are using, look for */ -/* this value in Zend/zend_modules.h, and set appropriately */ -#if (ZEND_MODULE_API_NO <= 20001222) -#define PHP_4_0 -#define TSRMLS_CC -#define TSRMLS_DC -#define TSRMLS_FETCH() -/* Comment out this line if you wish to have msession without php sessions */ -#define HAVE_PHP_SESSION -#warning Backward compatible msession extension requires PHP sessions. If PHP compiles and links, you can ignore this warning. -#elif (ZEND_MODULE_API_NO >= 20010901) -#define PHP_4_1 -#else -#warning ZEND_MODULE_API_NO not defined -#define PHP_4_1 -#endif - -/* - * Please do not remove backward compatibility from this module. - * this same source must also work with the 4.0.6 version of PHP. - * - * Module Variable naming hints: - * All global scope variables begin with "g_" for global. - * All static file scoped variables begin with "s_" for static. - * Zero terminated strings generally start with "sz" for "string followed by zero." - * integers that hold string or data lengths generally start with "cb" for "count of bytes." - * Also, please to not reformat braces ;-) - * -MLW - */ -#if HAVE_MSESSION -#ifdef HAVE_PHP_SESSION -#ifdef HAVE_PHP_SESSION_CREATESID -/* If the PHP Session module is compiled or available, include support */ -PS_FUNCS_SID(msession); -ps_module ps_mod_msession = { - PS_MOD_SID(msession) -}; -#else -PS_FUNCS(msession); -ps_module ps_mod_msession = { - PS_MOD(msession) -}; -#endif -#endif - -/* Per-process variables need by msession */ -static char s_szdefhost[]="localhost"; -static char * s_szhost=s_szdefhost; -static int s_port=8086; -static void * s_conn=NULL; -static REQB * s_reqb=NULL; - -function_entry msession_functions[] = { - PHP_FE(msession_connect,NULL) - PHP_FE(msession_disconnect,NULL) - PHP_FE(msession_lock,NULL) - PHP_FE(msession_unlock,NULL) - PHP_FE(msession_count,NULL) - PHP_FE(msession_create,NULL) - PHP_FE(msession_destroy,NULL) - PHP_FE(msession_set,NULL) - PHP_FE(msession_get,NULL) - PHP_FE(msession_find,NULL) - PHP_FE(msession_get_array,NULL) - PHP_FE(msession_set_array,NULL) - PHP_FE(msession_timeout,NULL) - PHP_FE(msession_inc,NULL) - PHP_FE(msession_set_data,NULL) - PHP_FE(msession_get_data,NULL) - PHP_FE(msession_listvar,NULL) - PHP_FE(msession_list,NULL) - PHP_FE(msession_uniq,NULL) - PHP_FE(msession_randstr,NULL) - PHP_FE(msession_plugin,NULL) - PHP_FE(msession_call,NULL) - PHP_FE(msession_ctl,NULL) - PHP_FE(msession_exec,NULL) - PHP_FE(msession_ping,NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry msession_module_entry = { -#ifdef PHP_4_1 - STANDARD_MODULE_HEADER, -#endif - "msession", - msession_functions, - PHP_MINIT(msession), - NULL, - NULL, - NULL, - PHP_MINFO(msession), -#ifdef PHP_4_1 - NO_VERSION_YET, -#endif - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_MSESSION -ZEND_GET_MODULE(msession) -#endif - -PHP_MINIT_FUNCTION(msession) -{ - s_conn = NULL; - s_szhost = s_szdefhost; - -#ifdef HAVE_PHP_SESSION - php_session_register_module(&ps_mod_msession); -#endif - return SUCCESS; -} - -PHP_MINFO_FUNCTION(msession) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "msession support", "enabled"); - php_info_print_table_end(); -} -#define RPT_CONN_ERR -#ifdef ERR_DEBUG -#undef RPT_CONN_ERR -#define RPT_CONN_ERR if(s_reqb->req.stat == REQ_ERR && (result == REQE_BADCONN || result == REQE_NOSEND)) \ - ELOG("Socket reports closed"); \ - else if(s_reqb->req.stat == REQ_ERR)\ - ELOG("MSession call failed");\ -#else -#endif - -#define CONN_ERR(reqb)\ - (reqb->req.stat == REQ_ERR) && (reqb->req.param == REQE_BADCONN || reqb->req.param == REQE_NOSEND) - -int PHPExecRequest(int req, char *session, char *d1, char *d2,int param) -{ - int result; - FormatRequest(&s_reqb, req, session, d1, d2, param); - result = DoRequest(s_conn, &s_reqb); - - /* Server closed the connection! */ - if(CONN_ERR(s_reqb)) - { - ELOG("Connection was closed by server"); - if(ReopenReqConn(s_conn)) - { - FormatRequest(&s_reqb, req, session, d1, d2, param); - result = DoRequest(s_conn, &s_reqb); - } - } - RPT_CONN_ERR - return result; -} -int PHPExecRequestMulti(int req, char *session, int n, char **pairs, int param) -{ - int result; - FormatRequestMulti(&s_reqb, req, session, n, pairs, param); - result = DoRequest(s_conn, &s_reqb); - - /* Server closed the connection! */ - if(CONN_ERR(s_reqb)) - { - ELOG("Connection was closed by server"); - if(ReopenReqConn(s_conn)) - { - FormatRequestMulti(&s_reqb, req, session, n, pairs, param); - result = DoRequest(s_conn, &s_reqb); - } - } - RPT_CONN_ERR - return result; -} -int PHPExecRequestStrings(int req, char *session, int n, char **strings) -{ - int result; - FormatRequestStrings(&s_reqb, req, session, n, strings); - result = DoRequest(s_conn, &s_reqb); - /* Server closed the connection! */ - if(CONN_ERR(s_reqb)) - { - ELOG("Connection was closed by server"); - if(ReopenReqConn(s_conn)) - { - FormatRequestStrings(&s_reqb, req, session, n, strings); - result = DoRequest(s_conn, &s_reqb); - } - } - RPT_CONN_ERR - return result; -} - - -int PHPMsessionConnect(const char *szhost, int nport) -{ - int fNewHost=FALSE; - - if(!s_reqb) - s_reqb = AllocateRequestBuffer(2048); - - if(!s_reqb) /* no buffer, it won't work! */ - return 0; - - if(strcmp(s_szhost, szhost)) - { - if(s_szhost != s_szdefhost) - free(s_szhost); - s_szhost = strdup(szhost); - fNewHost = TRUE; - } - if(nport && nport != s_port) - { - fNewHost = TRUE; - s_port = nport; - } - - ELOG("PHPMsessionConnect:new"); - if(s_conn && fNewHost) - { - ELOG("Closing old connection, opening new"); - CloseReqConn(s_conn); - s_conn = NULL; - } - if(!s_conn) - s_conn = OpenReqConn(s_szhost, s_port); -#ifdef ERR_DEBUG - else - { - ELOG("Reusing old connection"); - } -#endif - - -#ifdef ERR_DEBUG -{ - char buffer[256]; - sprintf(buffer,"Connect: %s [%d] = %d (%X)\n", - s_szhost, s_port, (s_conn != NULL), (unsigned)s_conn); - php_log_err(buffer); -} -#endif - return (s_conn) ? 1 : 0; -} - -void PHPMsessionDisconnect() -{ -} - -char *PHPMsessionGetData(char *session TSRMLS_DC) -{ - char *ret = NULL; - ELOG("PHPMsessionGetData"); - - IFCONNECT_BEGIN - - PHPExecRequest(REQ_DATAGET, (char *)session,"","",0); - - if(s_reqb->req.stat==REQ_OK) - ret = safe_estrdup(s_reqb->req.datum); - IFCONNECT_ENDVAL(0) - - return ret; -} -int PHPMsessionSetData(char *session, char *data TSRMLS_DC) -{ - ELOG("PHPMsessionSetData"); - IFCONNECT_BEGIN - int ret=0; - - PHPExecRequest(REQ_DATASET, session,"",data,0); - ret = (s_reqb->req.stat==REQ_OK); - if(s_reqb->req.stat!=REQ_OK) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - - return ret; - - IFCONNECT_ENDVAL(0) -} -int PHPMsessionDestroy(char *session TSRMLS_DC) -{ - ELOG("PHPMsessionDestroy"); - IFCONNECT_BEGIN - - int ret=0; - PHPExecRequest( REQ_DROP, session, "","",0); - ret = (s_reqb->req.stat==REQ_OK); - if(s_reqb->req.stat!=REQ_OK) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - return ret; - - IFCONNECT_ENDVAL(0) -} - -/* {{{ proto bool msession_connect(string host, string port) - Connect to msession sever */ -PHP_FUNCTION(msession_connect) -{ - char *szhost; - int nport; - - zval **zhost; - zval **zport; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zhost, &zport) == FAILURE) - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(zhost); - convert_to_string_ex(zport); - - szhost = Z_STRVAL_PP(zhost); - nport = atoi(Z_STRVAL_PP(zport)); - - if(PHPMsessionConnect(szhost,nport)) - { - RETURN_TRUE; - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSession connect failed"); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void msession_disconnect(void) - Disconnect from msession server */ -PHP_FUNCTION(msession_disconnect) -{ - PHPMsessionDisconnect(); - RETURN_NULL(); -} -/* }}} */ - -/* {{{ proto int msession_count(void) - Get session count */ -PHP_FUNCTION(msession_count) -{ - IFCONNECT_BEGIN - - int count; - PHPExecRequest( REQ_COUNT, "", "","",0); - - count = (s_reqb->req.stat == REQ_OK) ? s_reqb->req.param : 0; - - RETURN_LONG(count); - - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto bool msession_create(string session) - Create a session */ -PHP_FUNCTION(msession_create) -{ - IFCONNECT_BEGIN -/* int stat; */ - char *szsession; - zval **session; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &session) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - PHPExecRequest( REQ_CREATE, szsession, "","",0); - if(s_reqb->req.stat==REQ_OK) - { - RETURN_TRUE; - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto bool msession_destroy(string name) - Destroy a session */ -PHP_FUNCTION(msession_destroy) -{ - char *szsession; - zval **session; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &session) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - PHPMsessionDestroy(szsession TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int msession_lock(string name) - Lock a session */ -PHP_FUNCTION(msession_lock) -{ - IFCONNECT_BEGIN - char *szsession; - zval **session; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &session) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - PHPExecRequest( REQ_SLOCK, szsession, "","",0); - - if(s_reqb->req.stat==REQ_OK) - { - RETURN_LONG(s_reqb->req.param); - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - - IFCONNECT_END - -} -/* }}} */ -/* {{{ proto int msession_ctl(string name) - Lock a session */ -PHP_FUNCTION(msession_ctl) -{ - static char *parray[] = - { "EXIST", - "TTL", - "AGE", - "TLA", - "CTIME", - "TOUCH", - "NOW", - NULL - }; - IFCONNECT_BEGIN - char *szsession; - zval **session; - zval **which; - int fn = REQ_STAT_EXIST; - - - int n = ZEND_NUM_ARGS(); - - if(n != 1 && n != 2) - { - WRONG_PARAM_COUNT; - } - - if(zend_get_parameters_ex(n,&session,&which) == FAILURE) - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - - if(n > 1) - { - char *szwhich; - int i; - convert_to_string_ex(which); - szwhich = Z_STRVAL_PP(which); - for(i=0; parray[i]; i++) - { - if(strcasecmp(parray[i], szwhich) == 0) - { - ELOG(szwhich); - - fn = i; - break; - } - } - } - - PHPExecRequest( REQ_CTL, szsession, "","",fn); - - if(s_reqb->req.stat==REQ_OK) - { -#ifdef ERR_DEBUG - char buffer[128]; - sprintf(buffer, "ret:%s", s_reqb->req.datum); - ELOG(buffer); -#endif - s_reqb->req.param = atoi(s_reqb->req.datum); - RETURN_LONG(s_reqb->req.param); - } - else - { - ELOG("msession_ctl failed"); - RETURN_FALSE; - } - IFCONNECT_END -} - -/* {{{ proto int msession_unlock(string session, int key) - Unlock a session */ -PHP_FUNCTION(msession_unlock) -{ - IFCONNECT_BEGIN - char *szsession; - long lkey; - zval **session; - zval **key; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &session, &key) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - convert_to_long_ex(key); - lkey = Z_LVAL_PP(key); - PHPExecRequest( REQ_SUNLOCK, szsession, "","",lkey); - - if(s_reqb->req.stat==REQ_OK) - { - RETURN_LONG(s_reqb->req.param); - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto bool msession_set(string session, string name, string value) - Set value in session */ -PHP_FUNCTION(msession_set) -{ - IFCONNECT_BEGIN - - char *szsession; - char *szname; - char *szvalue; - zval **session; - zval **name; - zval **value; - - if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3,&session,&name,&value) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - convert_to_string_ex(name); - convert_to_string_ex(value); - - szsession = Z_STRVAL_PP(session); - szname = Z_STRVAL_PP(name); - szvalue = Z_STRVAL_PP(value); - - PHPExecRequest( REQ_SETVAL, szsession, szname, szvalue, 0); - - if(s_reqb->req.stat==REQ_OK) - { - RETURN_TRUE; - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto string msession_get(string session, string name, string default_value) - Get value from session */ -PHP_FUNCTION(msession_get) -{ - IFCONNECT_BEGIN - char *szsession; - char *szname; - char *szvalue; - zval **session; - zval **name; - zval **value; - - if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3,&session,&name,&value) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - convert_to_string_ex(name); - convert_to_string_ex(value); - szsession = Z_STRVAL_PP(session); - szname = Z_STRVAL_PP(name); - szvalue = Z_STRVAL_PP(value); - - PHPExecRequest( REQ_GETVAL, szsession, szname, szvalue,0); - - if(s_reqb->req.stat==REQ_OK) - { - szvalue = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(szvalue, 0) - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto string msession_uniq(int num_chars) - Get uniq id */ -PHP_FUNCTION(msession_uniq) -{ - IFCONNECT_BEGIN - - long val; - zval **param; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1,¶m) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(param); - val = Z_LVAL_PP(param); - - PHPExecRequest( REQ_UNIQ,"", "", "",val); - - if(s_reqb->req.stat==REQ_OK) - { - char *szval = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(szval, 0) - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END - -} -/* }}} */ - -/* {{{ proto string msession_randstr(int num_chars) - Get random string */ -PHP_FUNCTION(msession_randstr) -{ - IFCONNECT_BEGIN - long val; - zval **param; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1,¶m) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(param); - val = Z_LVAL_PP(param); - - PHPExecRequest( REQ_RANDSTR,"", "", "",val); - - if(s_reqb->req.stat==REQ_OK) - { - char *szval = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(szval, 0) - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto array msession_find(string name, string value) - Find all sessions with name and value */ -PHP_FUNCTION(msession_find) -{ - IFCONNECT_BEGIN - - char *szname; - char *szvalue; - zval **name; - zval **value; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &name, &value) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(name); - convert_to_string_ex(value); - szname = Z_STRVAL_PP(name); - szvalue = Z_STRVAL_PP(value); - - PHPExecRequest( REQ_FIND, "", szname, szvalue,0); - - if(s_reqb->req.stat==REQ_OK && s_reqb->req.param) - { - int i; - char *str = s_reqb->req.datum; - array_init(return_value); - - for(i=0; i < s_reqb->req.param; i++) - { - int cbstr = strlen(str); - char *data = safe_estrdup(str); - add_index_string(return_value, i, data, 0); - str += (cbstr+1); - } - } - else if(s_reqb->req.stat != REQ_OK) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto array msession_list(void) - List all sessions */ -PHP_FUNCTION(msession_list) -{ - IFCONNECT_BEGIN - PHPExecRequest( REQ_LIST, "", "", "",0); - - if(s_reqb->req.stat==REQ_OK && s_reqb->req.param) - { - int i; - char *str = s_reqb->req.datum; - array_init(return_value); - - for(i=0; i < s_reqb->req.param; i++) - { - int cbstr = strlen(str); - char *data = safe_estrdup(str); - add_index_string(return_value, i, data, 0); - str += (cbstr+1); - } - } - else if(s_reqb->req.stat != REQ_OK) - { - /* May this should be an error? */ - if(s_reqb->req.param != REQE_NOSESSION) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto array msession_get_array(string session) - Get array of msession variables */ -PHP_FUNCTION(msession_get_array) -{ - IFCONNECT_BEGIN - char *szsession; - zval **session; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &session) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - szsession = Z_STRVAL_PP(session); - PHPExecRequest( REQ_GETALL, szsession, "", "",0); - - array_init(return_value); - - if(s_reqb->req.stat == REQ_OK) - { - int i; - char *str = s_reqb->req.datum; - int num = s_reqb->req.param*2; - - for(i=0; i < num; i+=2) - { - int cbvalue; - int cbname; - char *szvalue; - char *szname; - - cbname = strlen(str); - szname = safe_estrndup(str,cbname); - str += (cbname+1); - - cbvalue = strlen(str); - szvalue = safe_estrndup(str,cbvalue); - str += (cbvalue+1); - add_assoc_string(return_value, szname, szvalue, 0); - } - } - else - { - if(s_reqb->req.param != REQE_NOSESSION) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto bool msession_set_array(string session, array tuples) - Set msession variables from an array*/ -PHP_FUNCTION(msession_set_array) -{ - IFCONNECT_BEGIN - zval **session; - zval **tuples; - HashPosition pos; - zval **entry; - char *key; -#ifdef PHP_4_1 - uint keylen; -#endif -#ifdef PHP_4_0 - ulong keylen; -#endif - ulong numndx; - int ndx=0; - char **pairs; - HashTable *htTuples; - int i; - - int countpair; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &session, &tuples) == FAILURE) - { - WRONG_PARAM_COUNT; - } - htTuples = Z_ARRVAL_PP(tuples); - - countpair = zend_hash_num_elements(htTuples); - - pairs = (char **)safe_emalloc(sizeof(char *), countpair * 2, 0); - - ELOG("have pairs"); - - /* Initializes pos */ - zend_hash_internal_pointer_reset_ex(htTuples, &pos); - - ELOG("reset pointer"); - - for(i=0; i < countpair; i++) - { - if(zend_hash_get_current_data_ex(htTuples, (void **)&entry, &pos) != SUCCESS) - break; - - if(entry) - { - char *szentry; - convert_to_string_ex(entry); - szentry = Z_STRVAL_PP(entry); - - if(zend_hash_get_current_key_ex(htTuples,&key,&keylen,&numndx,0,&pos)== HASH_KEY_IS_STRING) - { -#ifdef ERR_DEBUG -{ - char buffer [256]; - sprintf(buffer, "%s=%s\n", key, szentry); - ELOG(buffer); -} -#endif - pairs[ndx++] = key; - pairs[ndx++] = szentry; - } - } - zend_hash_move_forward_ex(htTuples, &pos); - } - - PHPExecRequestMulti(REQ_SETVAL, Z_STRVAL_PP(session), countpair, pairs,0); - - if(s_reqb->req.stat != REQ_OK) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - efree((void *)pairs); - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto array msession_listvar(string name) - return associative array of value:session for all sessions with a variable named 'name' */ -PHP_FUNCTION(msession_listvar) -{ - IFCONNECT_BEGIN - zval **name; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(name); - PHPExecRequest( REQ_LISTVAR, "", Z_STRVAL_PP(name), "",0); - - array_init(return_value); - - if(s_reqb->req.stat == REQ_OK) - { - int i; - char *str = s_reqb->req.datum; - int num = s_reqb->req.param*2; - - for(i=0; i < num; i+=2) - { - int cbvalue; - int cbname; - char *szvalue; - char *szname; - - cbname= strlen(str); - szname= safe_estrndup(str,cbname); - str += (cbname+1); - - cbvalue = strlen(str); - szvalue = safe_estrndup(str,cbvalue); - str += (cbvalue+1); - add_assoc_string(return_value, szname, szvalue, 0); - } - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto int msession_timeout(string session [, int param ]) - Set/get session timeout */ -PHP_FUNCTION(msession_timeout) -{ - IFCONNECT_BEGIN - zval **session; - int ac = ZEND_NUM_ARGS(); - int zstat = FAILURE; - int timeout = 0; - if(ac == 1) - { - zstat = zend_get_parameters_ex(1, &session); - } - else if(ac == 2) - { - zval **param; - zstat = zend_get_parameters_ex(2, &session, ¶m); - convert_to_long_ex(param); - timeout = Z_LVAL_PP(param); - } - if(zstat == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - PHPExecRequest( REQ_TIMEOUT, Z_STRVAL_PP(session), "","",timeout); - - if(s_reqb->req.stat == REQ_OK) - { - RETURN_LONG( s_reqb->req.param); - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto string msession_inc(string session, string name) - Increment value in session */ -PHP_FUNCTION(msession_inc) -{ - IFCONNECT_BEGIN - char *val; - zval **session; - zval **name; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &session, &name) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - convert_to_string_ex(name); - - PHPExecRequest( REQ_INC, Z_STRVAL_PP(session), Z_STRVAL_PP(name),0,0); - - if(s_reqb->req.stat==REQ_OK) - { - val = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(val, 0) - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto string msession_get_data(string session) - Get data session unstructured data. (PHP sessions use this) */ -PHP_FUNCTION(msession_get_data) -{ - IFCONNECT_BEGIN - char *val; - zval **session; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &session) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - - val = PHPMsessionGetData(Z_STRVAL_PP(session) TSRMLS_CC); - - if(val) - { - RETURN_STRING(val, 0) - } - else - { - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto bool msession_set_data(string session, string value) - Set data session unstructured data. (PHP sessions use this) */ -PHP_FUNCTION(msession_set_data) -{ - IFCONNECT_BEGIN - zval **session; - zval **value; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &session, &value) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - convert_to_string_ex(value); - - if(PHPMsessionSetData(Z_STRVAL_PP(session), Z_STRVAL_PP(value) TSRMLS_CC)) - { - RETURN_TRUE; - } - else - { - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -/* {{{ proto string msession_plugin(string session, string val [, string param ]) - Call the personality plugin escape function */ -PHP_FUNCTION(msession_plugin) -{ - IFCONNECT_BEGIN - int ret; - char *retval; - zval **session; - zval **val; - zval **param=NULL; - - if(ZEND_NUM_ARGS() == 3) - { - ret = zend_get_parameters_ex(3, &session, &val, ¶m); - convert_to_string_ex(param); - } - else if(ZEND_NUM_ARGS() == 2) - { - ret = zend_get_parameters_ex(2, &session, &val); - } - else - { - WRONG_PARAM_COUNT; - } - if(ret == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(session); - convert_to_string_ex(val); - - ret = atoi(Z_STRVAL_PP(val)); - - PHPExecRequest( REQ_PLUGIN, Z_STRVAL_PP(session), Z_STRVAL_PP(val), param ? Z_STRVAL_PP(param) : "",ret); - - if(s_reqb->req.stat==REQ_OK && s_reqb->req.len) - { - retval = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(retval, 0) - } - else if(s_reqb->req.stat != REQ_OK) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - - } - IFCONNECT_END -} -/* }}} */ -#define MAX_EXT_VAL 5 -/* {{{ proto string msession_call(string fn_name, [, string param1 ], ... [,string param4]) - Call the plugin function named fn_name */ -PHP_FUNCTION(msession_call) -{ - IFCONNECT_BEGIN - int n; - int i; - int ret; - char *retval; - zval **val[MAX_EXT_VAL]; - char *strings[MAX_EXT_VAL+1]; -/* zval **param=NULL; */ - - n = ZEND_NUM_ARGS(); - - if((n < 1) || (n > MAX_EXT_VAL)) - { - WRONG_PARAM_COUNT; - } - - ret = zend_get_parameters_ex(ZEND_NUM_ARGS(), &val[0],&val[1],&val[2],&val[3],&val[4]); - - if(ret == FAILURE) - { - WRONG_PARAM_COUNT; - } - for(i=0; i < n; i++) - { - convert_to_string_ex(val[i]); - strings[i] = Z_STRVAL_PP(val[i]); - } - - PHPExecRequestStrings(REQ_CALL, NULL , n, strings); - - if(s_reqb->req.stat==REQ_OK && s_reqb->req.len) - { - retval = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(retval, 0) - } - else if(s_reqb->req.stat != REQ_OK) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ -/* {{{ proto string msession_exec(string cmdline) - executes a program on msession system */ -PHP_FUNCTION(msession_exec) -{ - IFCONNECT_BEGIN - char *val; - zval **cmdline; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &cmdline) == FAILURE) - { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(cmdline); - - PHPExecRequest( REQ_EXEC, Z_STRVAL_PP(cmdline), "","",0); - - if(s_reqb->req.stat == REQ_OK) - { - val = safe_estrdup(s_reqb->req.datum); - RETURN_STRING(val, 0) - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_NULL(); - } - IFCONNECT_END -} -/* }}} */ -/* {{{ proto bool msession_ping(void) - returns non-zero if msession is alive*/ -PHP_FUNCTION(msession_ping) -{ - IFCONNECT_BEGIN - - PHPExecRequest(REQ_PING,"","","", 0); - - if(s_reqb->req.stat==REQ_OK) - { - RETURN_TRUE; - } - else - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - RETURN_FALSE; - } - IFCONNECT_END -} -/* }}} */ - -#ifdef HAVE_PHP_SESSION - -PS_OPEN_FUNC(msession) -{ - int port; - int len = strlen(save_path)+1; - char * path = emalloc(len); - char * szport; - - strcpy(path, save_path); - - szport = strchr(path, ':'); - - if(szport) - { - *szport++=0; - port = atoi(szport); - } - else - { - port = s_port; - } - - ELOG( "ps_open_msession"); - PS_SET_MOD_DATA((void *)1); /* session.c needs a non-zero here! */ - if (PHPMsessionConnect(path, port)) { - efree(path); - return SUCCESS; - } else { - efree(path); - return FAILURE; - } -} - -PS_CLOSE_FUNC(msession) -{ - ELOG( "ps_close_msession"); - PHPMsessionDisconnect(); - return SUCCESS; -} - -PS_READ_FUNC(msession) -{ - ELOG( "ps_read_msession"); - *val = PHPMsessionGetData((char *)key TSRMLS_CC); - if(*val) - { - *vallen = strlen(*val); - } - else - { - *val = emalloc(1); - **val=0; - *vallen = 0; - } - return SUCCESS; -} - -PS_WRITE_FUNC(msession) -{ - ELOG( "ps_write_msession"); - return (PHPMsessionSetData((char *)key, (char *)val TSRMLS_CC)) ? SUCCESS : FAILURE; -} - -PS_DESTROY_FUNC(msession) -{ - ELOG( "ps_destroy_msession"); - return (PHPMsessionDestroy((char *)key TSRMLS_CC)) ? SUCCESS : FAILURE; -} - -PS_GC_FUNC(msession) -{ - ELOG( "ps_gc_msession"); - return SUCCESS; -} - -#ifdef HAVE_PHP_SESSION_CREATESID -PS_CREATE_SID_FUNC(msession) -{ - if(s_reqb && s_conn) - { - ELOG("Should create a new session"); - PHPExecRequest( REQ_UNIQ,"", "", "",SID_LEN); - - if(s_reqb->req.stat==REQ_OK) - { - ELOG("Reports UNIQ success"); - if(newlen) - *newlen = SID_LEN; - return safe_estrdup(s_reqb->req.datum); - } - else - { - ELOG("Reports that UNIQ failed"); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ReqbErr(s_reqb)); - } - } - ELOG("Yikes, could not get sid from msession 2003"); - return php_session_create_id(mod_data, newlen TSRMLS_CC); -} -#endif /* HAVE_PHP_SESSION_CREATESID */ -#endif /* HAVE_PHP_SESSION */ -#endif /* HAVE_MSESSION */ - diff --git a/ext/msession/msession.php b/ext/msession/msession.php deleted file mode 100644 index 4eb9d9b6cd30b..0000000000000 --- a/ext/msession/msession.php +++ /dev/null @@ -1,10 +0,0 @@ -<? -$module = 'msession'; -$function = 'confirm_' . $module . '_compiled'; -if (extension_loaded($module)) { - $str = $function($module); -} else { - $str = "Module $module is not compiled into PHP"; -} -echo "$str\n"; -?> diff --git a/ext/msession/php_msession.h b/ext/msession/php_msession.h deleted file mode 100644 index c2f5f9b457b82..0000000000000 --- a/ext/msession/php_msession.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | msession 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Mark Woodward <markw@mohawksoft.com> | - | Portions copyright the PHP group. | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_MSESSION_H -#define PHP_MSESSION_H - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_MSESSION - -extern zend_module_entry msession_module_entry; -#define phpext_msession_ptr &msession_module_entry - -#ifdef PHP_WIN32 -#define PHP_MSESSION_API __declspec(dllexport) -#else -#define PHP_MSESSION_API -#endif - -PHP_MINIT_FUNCTION(msession); -PHP_MINFO_FUNCTION(msession); - -PHP_FUNCTION(msession_connect); -PHP_FUNCTION(msession_disconnect); -PHP_FUNCTION(msession_lock); -PHP_FUNCTION(msession_unlock); -PHP_FUNCTION(msession_ctl); -PHP_FUNCTION(msession_count); -PHP_FUNCTION(msession_create); -PHP_FUNCTION(msession_destroy); -PHP_FUNCTION(msession_exec); -PHP_FUNCTION(msession_set); -PHP_FUNCTION(msession_get); -PHP_FUNCTION(msession_find); -PHP_FUNCTION(msession_get_array); -PHP_FUNCTION(msession_set_array); -PHP_FUNCTION(msession_timeout); -PHP_FUNCTION(msession_inc); -PHP_FUNCTION(msession_set_data); -PHP_FUNCTION(msession_get_data); -PHP_FUNCTION(msession_listvar); -PHP_FUNCTION(msession_list); -PHP_FUNCTION(msession_uniq); -PHP_FUNCTION(msession_randstr); -PHP_FUNCTION(msession_plugin); -PHP_FUNCTION(msession_call); -PHP_FUNCTION(msession_ping); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(msession) - int global_variable; - void *conn; - char *host; -ZEND_END_MODULE_GLOBALS(msession) - -*/ -/* In every function that needs to use variables in php_msession_globals, - do call MSESSIONLS_FETCH(); after declaring other variables used by - that function, and always refer to them as MSESSIONG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define MSESSIONG(v) (msession_globals->v) -#define MSESSIONLS_FETCH() php_msession_globals *msession_globals = ts_resource(msession_globals_id) -#else -#define MSESSIONG(v) (msession_globals.v) -#define MSESSIONLS_FETCH() -#endif - -#else - -#define phpext_msession_ptr NULL - -#endif - -#endif /* PHP_MSESSION_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/msession/reqclient.h b/ext/msession/reqclient.h deleted file mode 100644 index aa52200957807..0000000000000 --- a/ext/msession/reqclient.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | msession 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Mark Woodward <markw@mohawksoft.com> | - | Portions copyright the PHP group. | - +----------------------------------------------------------------------+ - */ - -/* --------------------------------------------------------------------------- - These are definitions are pulled from Phoenix. - It would probably be easier to maintain one file, - but some phoenix header files conflict with other - project header files common to PHP. Besides, this - allows this header to be PHP license and Phoenix to - be LGPL with no conflicts. - - MAKE NO CHANGES TO THIS FILE IT. MUST REMAIN CONSTANT - WITH PHOENIX OR IT WILL NOT WORK. --------------------------------------------------------------------------- -*/ -/* Required to use the new version of Phoenix 1.2 */ - -#ifndef REQCLIENT_VER -#define REQCLIENT_VER 030113 -#endif - -enum REQ_TYPES -{ - REQ_ERR, - REQ_OK, - REQ_CTL, - REQ_SETVAL, - REQ_GETVAL, - REQ_CREATE, - REQ_DROP, - REQ_GETALL, - REQ_FIND, - REQ_COUNT, - REQ_FLUSH, - REQ_SLOCK, - REQ_SUNLOCK, - REQ_TIMEOUT, - REQ_INC, - REQ_DATAGET, - REQ_DATASET, - REQ_LIST, - REQ_LISTVAR, - REQ_UNIQ, - REQ_RANDSTR, - REQ_PLUGIN, - REQ_CALL, - REQ_SERIALIZE, - REQ_RESTORE, - REQ_EXEC, - REQ_LAST, - REQ_INTERNAL_BEGIN=1023, - REQ_INTERNALLAST, -}; -enum REQ_ERRORS -{ - REQE_NOERROR=0, - REQE_NOSESSION, - REQE_DUPSESSION, - REQE_NOWLOCK, - REQE_NOVALUE, - REQE_LOCKED, - REQE_NOSEND, - REQE_NOCONNECT, - REQE_BADCONN, - REQE_BADHDR, - REQE_BADVER, - REQE_BADLEN, - REQE_BUFFER, - REQE_DENIED, - REQE_NOFN, - REQE_UNKNOWN -}; - - -#define REQ_POPEN 1024 -#define REQ_PCLOSE 1025 -#define REQ_PING 1026 - -typedef struct _requestPacket -{ - int version; - int stat; - int len; - int session; - int name; - int value; - int param; - char datum[0]; -}REQ; - -typedef struct _requestBuf -{ - unsigned int type; /* Type of packet, dynamic/static */ - unsigned int size; /* size of memory block */ -#if (REQCLIENT_VER >= 030113) - unsigned int fmt; /* format, binary/ascii */ - unsigned int reserved; /* Just in case */ -#else -#warning You are using an old Phoenix definition, this will have problems with a newer version -#endif - REQ req; -}REQB; - -#define MAX_REQ 16384 - -#define REQB_STATIC 1 -#define REQB_DYNAMIC 2 - -#define REQ_STAT_EXIST 0 -#define REQ_STAT_TTL 1 -#define REQ_STAT_AGE 2 -#define REQ_STAT_TLA 3 -#define REQ_STAT_CTIM 4 -#define REQ_STAT_TOUCH 5 -#define REQ_STAT_NOW 6 - - -#define STATIC_REQB( len ) \ - char buffer [ len ]; \ - REQB *preq = StaticRequestBuffer(buffer, len); - -#if defined (__cplusplus) -extern "C" { -#endif - -#define SIZEREQB(REQB,SIZE) (((REQB)->size >= (unsigned int) SIZE) ? REQB : SizeRequestBuffer(REQB,SIZE)) -REQB *AllocateRequestBuffer(unsigned size); -void FreeRequestBuffer(REQB *req); -REQB *SizeRequestBuffer(REQB *req, unsigned int size); -REQB *StaticRequestBuffer(char *buffer, unsigned int cb); - -int FormatRequest(REQB **buffer, int stat, const char *session, const char *name, const char *value, int param); -int FormatRequestMulti(REQB **buffer, int stat, char *session, int n, char **pairs, int param); -int FormatRequestStrings(REQB **ppreq, int stat, char *session, int n, char **strings); -int DoSingleRequest(char *hostname, int port, REQB **preq); -void *OpenReqConn(char *hostname, int port); -void CloseReqConn(void *conn); -void DeleteReqConn(void *conn); -unsigned char ReopenReqConn(void *conn); -int DoRequest(void *conn, REQB **preq); -char *ReqbErr(REQB *reqb); - -#define ASSERT_STAT(PREQ) if(PREQ->stat != REQ_OK) \ - {fprintf(stderr, "Error in Request %s %d %s\n", \ - __FILE__,__LINE__, ReqErr(PREQ->param)); exit(-1); } - -#if defined (__cplusplus) - /* C API but with class definitions */ - int ReadRequestTimeout(REQB **ppreq, MSock *sock, int timeout); - int ReadRequest(REQB **preq, MSock *sock); - int WriteRequest(REQB *preq, MSock *sock); -} -#endif - diff --git a/ext/msql/CREDITS b/ext/msql/CREDITS deleted file mode 100644 index 31ad918eaf255..0000000000000 --- a/ext/msql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mSQL -Zeev Suraski diff --git a/ext/msql/config.m4 b/ext/msql/config.m4 deleted file mode 100644 index 3842fe4463939..0000000000000 --- a/ext/msql/config.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl -dnl Test mSQL version by checking if msql.h has "IDX_TYPE" defined. -dnl -AC_DEFUN([PHP_MSQL_VERSION],[ - AC_MSG_CHECKING([mSQL version]) - ac_php_oldcppflags=$CPPFLAGS - CPPFLAGS="$INCLUDES $CPPFLAGS" - AC_TRY_COMPILE([#include <sys/types.h> -#include "msql.h"],[int i = IDX_TYPE],[ - AC_DEFINE(MSQL1,0,[ ]) - MSQL_VERSION="2.0 or newer" - ],[ - AC_DEFINE(MSQL1,1,[ ]) - MSQL_VERSION=1.0 - ]) - CPPFLAGS=$ac_php_oldcppflags - AC_MSG_RESULT($MSQL_VERSION) -]) - -PHP_ARG_WITH(msql,for mSQL support, -[ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base - install directory, defaults to /usr/local/Hughes]) - - if test "$PHP_MSQL" != "no"; then - if test "$PHP_MSQL" = "yes"; then - MSQL_INCDIR=/usr/local/Hughes/include - MSQL_LIBDIR=/usr/local/Hughes/lib - else - MSQL_INCDIR=$PHP_MSQL/include - MSQL_LIBDIR=$PHP_MSQL/lib - fi - PHP_ADD_LIBRARY_WITH_PATH(msql, $MSQL_LIBDIR, MSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($MSQL_INCDIR) - AC_DEFINE(HAVE_MSQL,1,[ ]) - PHP_SUBST(MSQL_SHARED_LIBADD) - PHP_NEW_EXTENSION(msql, php_msql.c, $ext_shared) - PHP_MSQL_VERSION - fi diff --git a/ext/msql/config.w32 b/ext/msql/config.w32 deleted file mode 100644 index 902f57d7611a2..0000000000000 --- a/ext/msql/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("msql", "MSQL support", "no"); - -if (PHP_MSQL != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("msql.h", "CFLAGS_MSQL", PHP_MSQL) && - CHECK_LIB("msql_dll.lib", "msql", PHP_MSQL)) { - EXTENSION('msql', 'php_msql.c'); - - AC_DEFINE('HAVE_MSQL', 1); - - } else { - WARNING("msql not enabled; libraries and headers not found"); - } -} - diff --git a/ext/msql/msql.dsp b/ext/msql/msql.dsp deleted file mode 100644 index a8f572443b740..0000000000000 --- a/ext/msql/msql.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="msql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=msql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "msql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "msql.mak" CFG="msql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "msql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "msql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "msql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\win32" /D "WIN32" /D "COMPILE_DL_MSQL" /D ZTS=1 /D HAVE_MSQL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib php5ts.lib msql_dll.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_msql.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "msql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSQL=1 /D COMPILE_DL_MSQL=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib php5ts_debug.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_msql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "msql - Win32 Release_TS" -# Name "msql - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_msql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_msql.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c deleted file mode 100644 index 70b281dd57fa1..0000000000000 --- a/ext/msql/php_msql.c +++ /dev/null @@ -1,1322 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_msql.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_globals.h" - -#if HAVE_MSQL - -#define OS_UNIX 1 - -#if defined(WIN32) && defined(MSQL1) -#include <msql1.h> -#else -#include <msql.h> -#endif - -static php_msql_globals msql_globals; - -#define MSQL_ASSOC 1<<0 -#define MSQL_NUM 1<<1 -#define MSQL_BOTH (MSQL_ASSOC|MSQL_NUM) - -/* {{{ msql_functions[] - */ -function_entry msql_functions[] = { - PHP_FE(msql_connect, NULL) - PHP_FE(msql_pconnect, NULL) - PHP_FE(msql_close, NULL) - PHP_FE(msql_select_db, NULL) - PHP_FE(msql_create_db, NULL) - PHP_FE(msql_drop_db, NULL) - PHP_FE(msql_query, NULL) - PHP_FE(msql_db_query, NULL) - PHP_FE(msql_list_dbs, NULL) - PHP_FE(msql_list_tables, NULL) - PHP_FE(msql_list_fields, NULL) - PHP_FE(msql_error, NULL) - PHP_FE(msql_result, NULL) - PHP_FE(msql_num_rows, NULL) - PHP_FE(msql_num_fields, NULL) - PHP_FE(msql_fetch_row, NULL) - PHP_FE(msql_fetch_array, NULL) - PHP_FE(msql_fetch_object, NULL) - PHP_FE(msql_data_seek, NULL) - PHP_FE(msql_fetch_field, NULL) - PHP_FE(msql_field_seek, NULL) - PHP_FE(msql_free_result, NULL) - PHP_FE(msql_field_name, NULL) - PHP_FE(msql_field_table, NULL) - PHP_FE(msql_field_len, NULL) - PHP_FE(msql_field_type, NULL) - PHP_FE(msql_field_flags, NULL) - - PHP_FALIAS(msql_fieldname, msql_field_name, NULL) - PHP_FALIAS(msql_fieldtable, msql_field_table, NULL) - PHP_FALIAS(msql_fieldlen, msql_field_len, NULL) - PHP_FALIAS(msql_fieldtype, msql_field_type, NULL) - PHP_FALIAS(msql_fieldflags, msql_field_flags, NULL) - - PHP_FALIAS(msql_regcase, sql_regcase, NULL) - - PHP_FALIAS(msql_affected_rows, msql_affected_rows, NULL) - - /* for downwards compatability */ - PHP_FALIAS(msql, msql_db_query, NULL) - PHP_FALIAS(msql_selectdb, msql_select_db, NULL) - PHP_FALIAS(msql_createdb, msql_create_db, NULL) - PHP_FALIAS(msql_dropdb, msql_drop_db, NULL) - PHP_FALIAS(msql_freeresult, msql_free_result, NULL) - PHP_FALIAS(msql_numfields, msql_num_fields, NULL) - PHP_FALIAS(msql_numrows, msql_num_rows, NULL) - PHP_FALIAS(msql_listdbs, msql_list_dbs, NULL) - PHP_FALIAS(msql_listtables, msql_list_tables, NULL) - PHP_FALIAS(msql_listfields, msql_list_fields, NULL) - PHP_FALIAS(msql_dbname, msql_result, NULL) - PHP_FALIAS(msql_tablename, msql_result, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry msql_module_entry = { - STANDARD_MODULE_HEADER, - "msql", msql_functions, PHP_MINIT(msql), NULL, PHP_RINIT(msql), NULL, - PHP_MINFO(msql), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_MSQL -ZEND_GET_MODULE(msql) -#endif - -typedef struct { - m_result *result; - int af_rows; -} m_query; - -#define MSQL_GET_QUERY(res) \ - ZEND_FETCH_RESOURCE(msql_query, m_query *, &res, -1, "mSQL result", msql_globals.le_query); \ - msql_result = msql_query->result - -static void _delete_query(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - m_query *query = (m_query *)rsrc->ptr; - - if(query->result) msqlFreeResult(query->result); - efree(query); -} - -static m_query *php_msql_query_wrapper(m_result *res, int af_rows) -{ - m_query *query = (m_query *) emalloc(sizeof(m_query)); - - query->result = res; - query->af_rows = af_rows; - - return query; -} - -static void _close_msql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int link = (int)rsrc->ptr; - - msqlClose(link); - msql_globals.num_links--; -} - - -static void _close_msql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int link = (int)rsrc->ptr; - - msqlClose(link); - msql_globals.num_persistent--; - msql_globals.num_links--; -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(msql) -{ - if (cfg_get_long("msql.allow_persistent",&msql_globals.allow_persistent)==FAILURE) { - msql_globals.allow_persistent=1; - } - if (cfg_get_long("msql.max_persistent",&msql_globals.max_persistent)==FAILURE) { - msql_globals.max_persistent=-1; - } - if (cfg_get_long("msql.max_links",&msql_globals.max_links)==FAILURE) { - msql_globals.max_links=-1; - } - msql_globals.num_persistent=0; - msql_globals.le_query = zend_register_list_destructors_ex(_delete_query, NULL, "msql query", module_number); - msql_globals.le_link = zend_register_list_destructors_ex(_close_msql_link, NULL, "msql link", module_number); - msql_globals.le_plink = zend_register_list_destructors_ex(NULL, _close_msql_plink, "msql link persistent", module_number); - - Z_TYPE(msql_module_entry) = type; - - REGISTER_LONG_CONSTANT("MSQL_ASSOC", MSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSQL_NUM", MSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSQL_BOTH", MSQL_BOTH, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(msql) -{ - msql_globals.default_link=-1; - msql_globals.num_links = msql_globals.num_persistent; - msqlErrMsg[0]=0; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(msql) -{ - char maxp[32],maxl[32]; - - if (msql_globals.max_persistent==-1) { - snprintf(maxp, 31, "%d/unlimited", msql_globals.num_persistent ); - } else { - snprintf(maxp, 31, "%d/%ld", msql_globals.num_persistent, msql_globals.max_persistent); - } - maxp[31]=0; - - if (msql_globals.max_links==-1) { - snprintf(maxl, 15, "%d/unlimited", msql_globals.num_links ); - } else { - snprintf(maxl, 15, "%d/%ld", msql_globals.num_links, msql_globals.max_links); - } - maxl[31]=0; - - php_info_print_table_start(); - php_info_print_table_row(2, "MSQL Support", "enabled" ); - php_info_print_table_row(2, "Allow Persistent Links", (msql_globals.allow_persistent?"yes":"no") ); - php_info_print_table_row(2, "Persistent Links", maxp ); - php_info_print_table_row(2, "Total Links", maxl ); - php_info_print_table_end(); - -} -/* }}} */ - -/* {{{ php_msql_do_connect - */ -static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) -{ - char *host; - char *hashed_details; - int hashed_details_length; - int msql; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - host=NULL; - hashed_details=estrndup("msql_",5); - hashed_details_length=4+1; - break; - case 1: { - pval *yyhost; - - if (getParameters(ht, 1, &yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string(yyhost); - host = Z_STRVAL_P(yyhost); - hashed_details_length = Z_STRLEN_P(yyhost)+4+1; - hashed_details = emalloc(hashed_details_length+1); - sprintf(hashed_details,"msql_%s",Z_STRVAL_P(yyhost)); /* SAFE */ - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (!msql_globals.allow_persistent) { - persistent=0; - } - if (persistent) { - list_entry *le; - - if (msql_globals.max_links!=-1 && msql_globals.num_links>=msql_globals.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", msql_globals.num_links); - efree(hashed_details); - RETURN_FALSE; - } - if (msql_globals.max_persistent!=-1 && msql_globals.num_persistent>=msql_globals.max_persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", msql_globals.num_persistent); - efree(hashed_details); - RETURN_FALSE; - } - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - /* create the link */ - if ((msql=msqlConnect(host))==-1) { - efree(hashed_details); - RETURN_FALSE; - } - - /* hash it up */ - Z_TYPE(new_le) = msql_globals.le_plink; - new_le.ptr = (void *) msql; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { - efree(hashed_details); - RETURN_FALSE; - } - msql_globals.num_persistent++; - msql_globals.num_links++; - } else { /* we do */ - if (Z_TYPE_P(le) != msql_globals.le_plink) { - efree(hashed_details); - RETURN_FALSE; - } -#if 0 - /* ensure that the link did not die */ - /* still have to find a way to do this nicely with mSQL */ - if (msql_stat(le->ptr)==NULL) { /* the link died */ - if (msql_connect(le->ptr,host,user,passwd)==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mSQL link lost, unable to reconnect"); - zend_hash_del(&EG(persistent_list),hashed_details,hashed_details_length+1); - efree(hashed_details); - RETURN_FALSE; - } - } -#endif - msql = (int) le->ptr; - } - ZEND_REGISTER_RESOURCE(return_value, (void *) msql, msql_globals.le_plink); - } else { - list_entry *index_ptr,new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual msql link sits. - * if it doesn't, open a new msql link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { - int type,link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==msql_globals.le_link || type==msql_globals.le_plink)) { - Z_LVAL_P(return_value) = msql_globals.default_link = link; - Z_TYPE_P(return_value) = IS_RESOURCE; - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); - } - } - if (msql_globals.max_links!=-1 && msql_globals.num_links>=msql_globals.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)",msql_globals.num_links); - efree(hashed_details); - RETURN_FALSE; - } - if ((msql=msqlConnect(host))==-1) { - efree(hashed_details); - RETURN_FALSE; - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, (void *) msql, msql_globals.le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { - efree(hashed_details); - RETURN_FALSE; - } - msql_globals.num_links++; - } - efree(hashed_details); - msql_globals.default_link=Z_LVAL_P(return_value); -} -/* }}} */ - -/* {{{ php_msql_get_default_link - */ -static int php_msql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (msql_globals.default_link==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_msql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return msql_globals.default_link; -} -/* }}} */ - -/* {{{ proto int msql_connect([string hostname[:port]] [, string username] [, string password]) - Open a connection to an mSQL Server */ -PHP_FUNCTION(msql_connect) -{ - php_msql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} -/* }}} */ - -/* {{{ proto int msql_pconnect([string hostname[:port]] [, string username] [, string password]) - Open a persistent connection to an mSQL Server */ -PHP_FUNCTION(msql_pconnect) -{ - php_msql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* {{{ proto bool msql_close([resource link_identifier]) - Close an mSQL connection */ -PHP_FUNCTION(msql_close) -{ - pval *msql_link; - int id; - int msql; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = msql_globals.default_link; - break; - case 1: - if (getParameters(ht, 1, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - if (id==-1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_P(msql_link)); - } - - if (id!=-1 - || (msql_link && Z_RESVAL_P(msql_link)==msql_globals.default_link)) { - zend_list_delete(msql_globals.default_link); - msql_globals.default_link = -1; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool msql_select_db(string database_name [, resource link_identifier]) - Select an mSQL database */ -PHP_FUNCTION(msql_select_db) -{ - pval *db,*msql_link; - int id; - int msql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (getParameters(ht, 2, &db, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - - if (msqlSelectDB(msql,Z_STRVAL_P(db))==-1) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool msql_create_db(string database_name [, resource link_identifier]) - Create an mSQL database */ -PHP_FUNCTION(msql_create_db) -{ - pval *db,*msql_link; - int id; - int msql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &db)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (getParameters(ht, 2, &db, &msql_link)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - if (msqlCreateDB(msql,Z_STRVAL_P(db))<0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool msql_drop_db(string database_name [, resource link_identifier]) - Drop (delete) an mSQL database */ -PHP_FUNCTION(msql_drop_db) -{ - pval *db,*msql_link; - int id; - int msql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &db)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (getParameters(ht, 2, &db, &msql_link)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - if (msqlDropDB(msql,Z_STRVAL_P(db))<0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto resource msql_query(string query [, resource link_identifier]) - Send an SQL query to mSQL */ -PHP_FUNCTION(msql_query) -{ - pval *query,*msql_link; - int id; - int msql; - int af_rows; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &query)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = msql_globals.default_link; - break; - case 2: - if (getParameters(ht, 2, &query, &msql_link)==FAILURE) { - WRONG_PARAM_COUNT; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(query); - if ((af_rows = msqlQuery(msql,Z_STRVAL_P(query)))==-1) { - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, php_msql_query_wrapper(msqlStoreResult(), af_rows), msql_globals.le_query); -} -/* }}} */ - -/* {{{ proto resource msql_db_query(string database_name, string query [, resource link_identifier]) - Send an SQL query to mSQL */ -PHP_FUNCTION(msql_db_query) -{ - pval *db,*query,*msql_link; - int id; - int msql; - int af_rows; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (getParameters(ht, 2, &db, &query)==FAILURE) { - RETURN_FALSE; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 3: - if (getParameters(ht, 3, &db, &query, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - if (msqlSelectDB(msql,Z_STRVAL_P(db))==-1) { - RETURN_FALSE; - } - - convert_to_string(query); - if ((af_rows = msqlQuery(msql,Z_STRVAL_P(query)))==-1) { - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, php_msql_query_wrapper(msqlStoreResult(), af_rows), msql_globals.le_query); -} -/* }}} */ - -/* {{{ proto resource msql_list_dbs([resource link_identifier]) - List databases available on an mSQL server */ -PHP_FUNCTION(msql_list_dbs) -{ - pval *msql_link; - int id; - int msql; - m_result *msql_result; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 1: - if (getParameters(ht, 1, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - if ((msql_result=msqlListDBs(msql))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save mSQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, php_msql_query_wrapper(msql_result, 0), msql_globals.le_query); -} -/* }}} */ - -/* {{{ proto resource msql_list_tables(string database_name [, resource link_identifier]) - List tables in an mSQL database */ -PHP_FUNCTION(msql_list_tables) -{ - pval *db,*msql_link; - int id; - int msql; - m_result *msql_result; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (getParameters(ht, 2, &db, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - if (msqlSelectDB(msql,Z_STRVAL_P(db))==-1) { - RETURN_FALSE; - } - if ((msql_result=msqlListTables(msql))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save mSQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, php_msql_query_wrapper(msql_result, 0), msql_globals.le_query); -} -/* }}} */ - -/* {{{ proto resource msql_list_fields(string database_name, string table_name [, resource link_identifier]) - List mSQL result fields */ -PHP_FUNCTION(msql_list_fields) -{ - pval *db,*table,*msql_link; - int id; - int msql; - m_result *msql_result; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (getParameters(ht, 2, &db, &table)==FAILURE) { - RETURN_FALSE; - } - id = php_msql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 3: - if (getParameters(ht, 3, &db, &table, &msql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink); - - convert_to_string(db); - if (msqlSelectDB(msql,Z_STRVAL_P(db))==-1) { - RETURN_FALSE; - } - convert_to_string(table); - if ((msql_result=msqlListFields(msql,Z_STRVAL_P(table)))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save mSQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, php_msql_query_wrapper(msql_result, 0), msql_globals.le_query); -} -/* }}} */ - -/* {{{ proto string msql_error(void) - Returns the text of the error message from previous mSQL operation */ -PHP_FUNCTION(msql_error) -{ - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - RETURN_STRING(msqlErrMsg,1); -} -/* }}} */ - -/* {{{ proto string msql_result(int query, int row [, mixed field]) - Get result data */ -PHP_FUNCTION(msql_result) -{ - pval *result, *row, *field=NULL; - m_result *msql_result; - m_query *msql_query; - m_row sql_row; - int field_offset=0; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (getParameters(ht, 2, &result, &row)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (getParameters(ht, 3, &result, &row, &field)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - MSQL_GET_QUERY(result); - - convert_to_long(row); - if (Z_LVAL_P(row)<0 || Z_LVAL_P(row)>=msqlNumRows(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on mSQL query index %ld", Z_LVAL_P(row), Z_LVAL_P(result)); - RETURN_FALSE; - } - msqlDataSeek(msql_result,Z_LVAL_P(row)); - if ((sql_row=msqlFetchRow(msql_result))==NULL) { /* shouldn't happen? */ - RETURN_FALSE; - } - - if (field) { - switch(Z_TYPE_P(field)) { - case IS_STRING: { - int i=0; - m_field *tmp_field; - char *table_name,*field_name,*tmp; - - if ((tmp=strchr(Z_STRVAL_P(field),'.'))) { - *tmp = 0; - table_name = estrdup(Z_STRVAL_P(field)); - field_name = estrdup(tmp+1); - } else { - table_name = NULL; - field_name = estrndup(Z_STRVAL_P(field),Z_STRLEN_P(field)); - } - msqlFieldSeek(msql_result,0); - while ((tmp_field=msqlFetchField(msql_result))) { - if ((!table_name || !strcasecmp(tmp_field->table,table_name)) && !strcasecmp(tmp_field->name,field_name)) { - field_offset = i; - break; - } - i++; - } - if (!tmp_field) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in mSQL query index %ld", - (table_name?table_name:""), (table_name?".":""), field_name, Z_LVAL_P(result)); - efree(field_name); - if (table_name) { - efree(table_name); - } - RETURN_FALSE; - } - efree(field_name); - if (table_name) { - efree(table_name); - } - } - break; - default: - convert_to_long(field); - field_offset = Z_LVAL_P(field); - if (field_offset<0 || field_offset>=msqlNumFields(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - break; - } - } - - if (sql_row[field_offset]) { - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(return_value) = php_addslashes(sql_row[field_offset],0,&Z_STRLEN_P(return_value),0 TSRMLS_CC); - } else { - Z_STRLEN_P(return_value) = (sql_row[field_offset]?strlen(sql_row[field_offset]):0); - Z_STRVAL_P(return_value) = (char *) safe_estrndup(sql_row[field_offset],Z_STRLEN_P(return_value)); - } - Z_TYPE_P(return_value) = IS_STRING; - } else { - ZVAL_FALSE(return_value); - } -} -/* }}} */ - -/* {{{ proto int msql_num_rows(resource query) - Get number of rows in a result */ -PHP_FUNCTION(msql_num_rows) -{ - pval *result; - m_result *msql_result; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - RETVAL_LONG(msql_result ? msqlNumRows(msql_result) : 0); -} -/* }}} */ - -/* {{{ proto int msql_num_fields(resource query) - Get number of fields in a result */ -PHP_FUNCTION(msql_num_fields) -{ - pval *result; - m_result *msql_result; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - RETVAL_LONG(msql_result ? msqlNumFields(msql_result) : 0); -} -/* }}} */ - -/* {{{ php_msql_fetch_hash - */ -static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) -{ - pval *result, *arg2; - m_result *msql_result; - m_row msql_row; - m_field *msql_field; - m_query *msql_query; - int num_fields; - int i; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &result)==FAILURE) { - RETURN_FALSE; - } - if (!result_type) { - result_type = MSQL_BOTH; - } - break; - case 2: - if (getParameters(ht, 2, &result, &arg2)==FAILURE) { - RETURN_FALSE; - } - convert_to_long(arg2); - result_type = Z_LVAL_P(arg2); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - MSQL_GET_QUERY(result); - if (!msql_result || (msql_row=msqlFetchRow(msql_result))==NULL) { - RETURN_FALSE; - } - - num_fields = msqlNumFields(msql_result); - - array_init(return_value); - - msqlFieldSeek(msql_result,0); - for (msql_field=msqlFetchField(msql_result),i=0; msql_field; msql_field=msqlFetchField(msql_result),i++) { - if (msql_row[i]) { - char *data; - int data_len; - int should_copy; - - if (PG(magic_quotes_runtime)) { - data = php_addslashes(msql_row[i], 0, &data_len, 0 TSRMLS_CC); - should_copy = 0; - } else { - data = msql_row[i]; - data_len = strlen(data); - should_copy = 1; - } - - if (result_type & MSQL_NUM) { - add_index_stringl(return_value, i, data, data_len, should_copy); - should_copy = 1; - } - - if (result_type & MSQL_ASSOC) { - add_assoc_stringl(return_value, msql_field->name, data, data_len, should_copy); - } - } else { - /* NULL value. */ - if (result_type & MSQL_NUM) { - add_index_null(return_value, i); - } - - if (result_type & MSQL_ASSOC) { - add_assoc_null(return_value, msql_field->name); - } - } - } -} -/* }}} */ - -/* {{{ proto array msql_fetch_row(resource query) - Get a result row as an enumerated array */ -PHP_FUNCTION(msql_fetch_row) -{ - php_msql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSQL_NUM); -} -/* }}} */ - -/* {{{ proto object msql_fetch_object(resource query [, resource result_type]) - Fetch a result row as an object */ -PHP_FUNCTION(msql_fetch_object) -{ - php_msql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array msql_fetch_array(resource query [, int result_type]) - Fetch a result row as an associative array */ -PHP_FUNCTION(msql_fetch_array) -{ - php_msql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool msql_data_seek(resource query, int row_number) - Move internal result pointer */ -PHP_FUNCTION(msql_data_seek) -{ - pval *result,*offset; - m_result *msql_result; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &result, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - convert_to_long(offset); - if (!msql_result || - Z_LVAL_P(offset)<0 || - Z_LVAL_P(offset)>=msqlNumRows(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is invalid for mSQL query index %ld", Z_LVAL_P(offset), Z_LVAL_P(result)); - RETURN_FALSE; - } - msqlDataSeek(msql_result,Z_LVAL_P(offset)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_msql_get_field_name - */ -static char *php_msql_get_field_name(int field_type) -{ - switch (field_type) { -#if MSQL1 - case INT_TYPE: - return "int"; - break; - case CHAR_TYPE: - return "char"; - break; - case REAL_TYPE: - return "real"; - break; - case IDENT_TYPE: - return "ident"; - break; - case NULL_TYPE: - return "null"; - break; -#else - case INT_TYPE: - case UINT_TYPE: - case CHAR_TYPE: - case TEXT_TYPE: - case REAL_TYPE: - case NULL_TYPE: - case DATE_TYPE: - case TIME_TYPE: - case MONEY_TYPE: - return msqlTypeNames[field_type]; - break; -#endif - default: - return "unknown"; - break; - } -} -/* }}} */ - -/* {{{ proto object msql_fetch_field(resource query [, int field_offset]) - Get column information from a result and return as an object */ -PHP_FUNCTION(msql_fetch_field) -{ - pval *result, *field=NULL; - m_result *msql_result; - m_field *msql_field; - m_query *msql_query; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (getParameters(ht, 1, &result)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (getParameters(ht, 2, &result, &field)==FAILURE) { - RETURN_FALSE; - } - convert_to_long(field); - default: - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - - if (field) { - if (Z_LVAL_P(field)<0 || Z_LVAL_P(field)>=msqlNumRows(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Bad field offset specified"); - RETURN_FALSE; - } - msqlFieldSeek(msql_result,Z_LVAL_P(field)); - } - if (!msql_result || (msql_field=msqlFetchField(msql_result))==NULL) { - RETURN_FALSE; - } - object_init(return_value); - - add_property_string(return_value, "name",(msql_field->name?msql_field->name:""), 1); - add_property_string(return_value, "table",(msql_field->table?msql_field->table:""), 1); - add_property_long(return_value, "not_null",IS_NOT_NULL(msql_field->flags)); -#if MSQL1 - add_property_long(return_value, "primary_key",(msql_field->flags&PRI_KEY_FLAG?1:0)); -#else - add_property_long(return_value, "unique",(msql_field->flags&UNIQUE_FLAG?1:0)); -#endif - - add_property_string(return_value, "type",php_msql_get_field_name(Z_TYPE_P(msql_field)), 1); -} -/* }}} */ - -/* {{{ proto bool msql_field_seek(resource query, int field_offset) - Set result pointer to a specific field offset */ -PHP_FUNCTION(msql_field_seek) -{ - pval *result, *offset; - m_result *msql_result; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &result, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - convert_to_long(offset); - if(!msql_result) { - RETURN_FALSE; - } - if (Z_LVAL_P(offset)<0 || Z_LVAL_P(offset)>=msqlNumFields(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Field %ld is invalid for mSQL query index %ld", - Z_LVAL_P(offset),Z_LVAL_P(result)); - RETURN_FALSE; - } - msqlFieldSeek(msql_result,Z_LVAL_P(offset)); - RETURN_TRUE; -} -/* }}} */ - -#define PHP_MSQL_FIELD_NAME 1 -#define PHP_MSQL_FIELD_TABLE 2 -#define PHP_MSQL_FIELD_LEN 3 -#define PHP_MSQL_FIELD_TYPE 4 -#define PHP_MSQL_FIELD_FLAGS 5 - -/* {{{ php_msql_field_info - */ -static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - pval *result, *field; - m_result *msql_result; - m_field *msql_field; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &result, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - if(!msql_result) { - RETURN_FALSE; - } - convert_to_long(field); - if (Z_LVAL_P(field)<0 || Z_LVAL_P(field)>=msqlNumFields(msql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Field %ld is invalid for mSQL query index %ld", Z_LVAL_P(field), Z_LVAL_P(result)); - RETURN_FALSE; - } - msqlFieldSeek(msql_result,Z_LVAL_P(field)); - if ((msql_field=msqlFetchField(msql_result))==NULL) { - RETURN_FALSE; - } - - switch (entry_type) { - case PHP_MSQL_FIELD_NAME: - Z_STRLEN_P(return_value) = strlen(msql_field->name); - Z_STRVAL_P(return_value) = estrndup(msql_field->name,Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MSQL_FIELD_TABLE: - Z_STRLEN_P(return_value) = strlen(msql_field->table); - Z_STRVAL_P(return_value) = estrndup(msql_field->table,Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MSQL_FIELD_LEN: - Z_LVAL_P(return_value) = msql_field->length; - Z_TYPE_P(return_value) = IS_LONG; - break; - case PHP_MSQL_FIELD_TYPE: - Z_STRVAL_P(return_value) = estrdup(php_msql_get_field_name(Z_TYPE_P(msql_field))); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MSQL_FIELD_FLAGS: -#if MSQL1 - if ((msql_field->flags&NOT_NULL_FLAG) && (msql_field->flags&PRI_KEY_FLAG)) { - Z_STRVAL_P(return_value) = estrndup("primary key not null",20); - Z_STRLEN_P(return_value) = 20; - Z_TYPE_P(return_value) = IS_STRING; - } else if (msql_field->flags&NOT_NULL_FLAG) { - Z_STRVAL_P(return_value) = estrndup("not null",8); - Z_STRLEN_P(return_value) = 8; - Z_TYPE_P(return_value) = IS_STRING; - } else if (msql_field->flags&PRI_KEY_FLAG) { - Z_STRVAL_P(return_value) = estrndup("primary key",11); - Z_STRLEN_P(return_value) = 11; - Z_TYPE_P(return_value) = IS_STRING; - } else { - ZVAL_FALSE(return_value); - } -#else - if ((msql_field->flags&NOT_NULL_FLAG) && (msql_field->flags&UNIQUE_FLAG)) { - Z_STRVAL_P(return_value) = estrndup("unique not null",15); - Z_STRLEN_P(return_value) = 15; - Z_TYPE_P(return_value) = IS_STRING; - } else if (msql_field->flags&NOT_NULL_FLAG) { - Z_STRVAL_P(return_value) = estrndup("not null",8); - Z_STRLEN_P(return_value) = 8; - Z_TYPE_P(return_value) = IS_STRING; - } else if (msql_field->flags&UNIQUE_FLAG) { - Z_STRVAL_P(return_value) = estrndup("unique",6); - Z_STRLEN_P(return_value) = 6; - Z_TYPE_P(return_value) = IS_STRING; - } else { - ZVAL_FALSE(return_value); - } -#endif - break; - default: - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string msql_field_name(resource query, int field_index) - Get the name of the specified field in a result */ -PHP_FUNCTION(msql_field_name) -{ - php_msql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_MSQL_FIELD_NAME); -} -/* }}} */ - -/* {{{ proto string msql_field_table(resource query, int field_offset) - Get name of the table the specified field is in */ -PHP_FUNCTION(msql_field_table) -{ - php_msql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_MSQL_FIELD_TABLE); -} -/* }}} */ - -/* {{{ proto int msql_field_len(int query, int field_offet) - Returns the length of the specified field */ -PHP_FUNCTION(msql_field_len) -{ - php_msql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_MSQL_FIELD_LEN); -} -/* }}} */ - -/* {{{ proto string msql_field_type(resource query, int field_offset) - Get the type of the specified field in a result */ -PHP_FUNCTION(msql_field_type) -{ - php_msql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_MSQL_FIELD_TYPE); -} -/* }}} */ - -/* {{{ proto string msql_field_flags(resource query, int field_offset) - Get the flags associated with the specified field in a result */ -PHP_FUNCTION(msql_field_flags) -{ - php_msql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_MSQL_FIELD_FLAGS); -} -/* }}} */ - -/* {{{ proto bool msql_free_result(resource query) - Free result memory */ -PHP_FUNCTION(msql_free_result) -{ - pval *result; - m_result *msql_result; - m_query *msql_query; - - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - MSQL_GET_QUERY(result); - zend_list_delete(Z_LVAL_P(result)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int msql_affected_rows(resource query) - Return number of affected rows */ -PHP_FUNCTION(msql_affected_rows) -{ - pval *result; - m_result *msql_result; - m_query *msql_query; - - if(ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &result) == FAILURE) { - WRONG_PARAM_COUNT; - } - MSQL_GET_QUERY(result); - RETVAL_LONG(msql_query->af_rows); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/msql/php_msql.h b/ext/msql/php_msql.h deleted file mode 100644 index 614750553717f..0000000000000 --- a/ext/msql/php_msql.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_MSQL_H -#define PHP_MSQL_H - -#if HAVE_MSQL - -extern zend_module_entry msql_module_entry; -#define msql_module_ptr &msql_module_entry - -/* mSQL functions */ -PHP_MINIT_FUNCTION(msql); -PHP_RINIT_FUNCTION(msql); -PHP_MSHUTDOWN_FUNCTION(msql); -PHP_MINFO_FUNCTION(msql); - -PHP_FUNCTION(msql_connect); -PHP_FUNCTION(msql_pconnect); -PHP_FUNCTION(msql_close); -PHP_FUNCTION(msql_select_db); -PHP_FUNCTION(msql_create_db); -PHP_FUNCTION(msql_drop_db); -PHP_FUNCTION(msql_list_dbs); -PHP_FUNCTION(msql_list_tables); -PHP_FUNCTION(msql_list_fields); -PHP_FUNCTION(msql_error); -PHP_FUNCTION(msql_affected_rows); -PHP_FUNCTION(msql_query); -PHP_FUNCTION(msql_db_query); -PHP_FUNCTION(msql_result); -PHP_FUNCTION(msql_num_rows); -PHP_FUNCTION(msql_num_fields); -PHP_FUNCTION(msql_fetch_row); -PHP_FUNCTION(msql_data_seek); -PHP_FUNCTION(msql_fetch_field); -PHP_FUNCTION(msql_field_seek); -PHP_FUNCTION(msql_free_result); -PHP_FUNCTION(msql_field_name); -PHP_FUNCTION(msql_field_table); -PHP_FUNCTION(msql_field_len); -PHP_FUNCTION(msql_field_type); -PHP_FUNCTION(msql_field_flags); -PHP_FUNCTION(msql_fetch_array); -PHP_FUNCTION(msql_fetch_object); - -typedef struct { - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - int le_query; - int le_link; - int le_plink; -} php_msql_globals; - -#else - -#define msql_module_ptr NULL - -#endif - -#define phpext_msql_ptr msql_module_ptr - -#endif /* PHP_MSQL_H */ diff --git a/ext/mssql/CREDITS b/ext/mssql/CREDITS deleted file mode 100644 index 548684afcaa70..0000000000000 --- a/ext/mssql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -MS SQL -Frank M. Kromann diff --git a/ext/mssql/config.m4 b/ext/mssql/config.m4 deleted file mode 100644 index aa599d7743550..0000000000000 --- a/ext/mssql/config.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS, -[ --with-mssql[=DIR] Include MSSQL-DB support. DIR is the FreeTDS home - directory, defaults to /usr/local/freetds]) - -if test "$PHP_MSSQL" != "no"; then - - if test "$PHP_MSSQL" = "yes"; then - for i in /usr/local /usr; do - if test -f $i/include/tds.h; then - FREETDS_INSTALLATION_DIR=$i - FREETDS_INCLUDE_DIR=$i/include - break - elif test -f $i/include/freetds/tds.h; then - FREETDS_INSTALLATION_DIR=$i - FREETDS_INCLUDE_DIR=$i/include/freetds - break - fi - done - - if test -z "$FREETDS_INSTALLATION_DIR"; then - AC_MSG_ERROR(Cannot find FreeTDS in known installation directories) - fi - - elif test "$PHP_MSSQL" != "no"; then - - if test -f $PHP_MSSQL/include/tds.h; then - FREETDS_INSTALLATION_DIR=$PHP_MSSQL - FREETDS_INCLUDE_DIR=$PHP_MSSQL/include - elif test -f $PHP_MSSQL/include/freetds/tds.h; then - FREETDS_INSTALLATION_DIR=$PHP_MSSQL - FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds - else - AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory) - fi - fi - - if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then - AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so]) - fi - - PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR) - PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD) - - PHP_NEW_EXTENSION(mssql, php_mssql.c, $ext_shared) - AC_CHECK_LIB(dnet_stub, dnet_addr, - [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,MSSQL_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) - ]) - AC_DEFINE(HAVE_MSSQL,1,[ ]) - AC_DEFINE(HAVE_FREETDS,1,[ ]) - PHP_SUBST(MSSQL_SHARED_LIBADD) -fi diff --git a/ext/mssql/config.w32 b/ext/mssql/config.w32 deleted file mode 100644 index bd1f68669b89d..0000000000000 --- a/ext/mssql/config.w32 +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mssql", "mssql support", "no"); - -if (PHP_MSSQL != "no") { - if (CHECK_LIB("ntwdblib.lib", "mssql", "\\MSSQL7\\DevTools\\Lib;\\MSSQL7\\DevTools\\Lib;" + PHP_MSSQL) && - CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_MSSQL", "\\MSSQL7\\DevTools\\Include;\\MSSQL7\\DevTools\\Include" + PHP_MSSQL)) { - EXTENSION("mssql", "php_mssql.c"); - AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support'); - ADD_FLAG("CFLAGS_MSSQL", "/D DBNTWIN32=1 /D MSSQL70=1"); - } else { - WARNING("mssql not enabled; libraries and headers not found"); - } -} - -ARG_WITH("dblib", "mssql support with freetds", "no"); - -if (PHP_DBLIB != "no") { - if (CHECK_LIB("dblib.lib", "dblib", PHP_PHP_BUILD + "\\freetds") && - CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_DBLIB", PHP_PHP_BUILD + "\\freetds;" + PHP_DBLIB)) { - EXTENSION("dblib", "php_mssql.c", null, null, null, "ext\\dblib"); - AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support'); - ADD_FLAG("CFLAGS_DBLIB", "/D HAVE_FREETDS=1 /D DBNTWIN32=1 /D MSSQL70=1 /D MSSQL_EXPORTS /D COMPILE_DL_MSSQL"); - } else { - WARNING("dblib not enabled; libraries and headers not found"); - } -} diff --git a/ext/mssql/mssql.dsp b/ext/mssql/mssql.dsp deleted file mode 100644 index 43294280dddef..0000000000000 --- a/ext/mssql/mssql.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mssql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mssql - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mssql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mssql.mak" CFG="mssql - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mssql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mssql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mssql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql70.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "mssql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mssql70.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_mssql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib" - -!ENDIF - -# Begin Target - -# Name "mssql - Win32 Release_TS" -# Name "mssql - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_mssql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mssql.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\mssql_win32_howto.txt -# End Source File -# End Target -# End Project diff --git a/ext/mssql/mssql_win32_howto.txt b/ext/mssql/mssql_win32_howto.txt deleted file mode 100644 index d42bc2555b90e..0000000000000 --- a/ext/mssql/mssql_win32_howto.txt +++ /dev/null @@ -1,35 +0,0 @@ -Rules for building MSSQL ------------------------- - -The MSSQL project contains 2 configurations. - -The files needed for each configurations are: - -Win32 Release_TS -Win32 Debug_TS - - php_build\mssql-70\include\sqldb.h - php_build\mssql-70\include\sqlfront.h - php_build\mssql-70\lib\ntwdblib.lib - -php_build is a directory at the same level as php5. - -Start Visual Studio, load php_modules.dsw, select the MSSQL projects, -configuration and build it. - -This module requires ntwdblib.dll and one or more of the following dll's - -dbmsadsn.dll -dbmsrpcn.dll -dbmsshrn.dll -dbmssocn.dll for tcp/ip connections -dbmsspxn.dll for ipx/spx connections -dbmsvinn.dll -dbnmpntw.dll for netbios connections - -All these files are installed while installing MS SQL Server. If the SQL Server -is installed on another maschine you need to install the client tools on -the web server as well. - - - \ No newline at end of file diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c deleted file mode 100644 index 1b65eb9593302..0000000000000 --- a/ext/mssql/php_mssql.c +++ /dev/null @@ -1,2307 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef COMPILE_DL_MSSQL -#define HAVE_MSSQL 1 -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_mssql.h" -#include "php_ini.h" - -#if HAVE_MSSQL -#define SAFE_STRING(s) ((s)?(s):"") - -#define MSSQL_ASSOC 1<<0 -#define MSSQL_NUM 1<<1 -#define MSSQL_BOTH (MSSQL_ASSOC|MSSQL_NUM) - -static int le_result, le_link, le_plink, le_statement; - -static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC); -static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC); - -static void _mssql_bind_hash_dtor(void *data); - -function_entry mssql_functions[] = { - PHP_FE(mssql_connect, NULL) - PHP_FE(mssql_pconnect, NULL) - PHP_FE(mssql_close, NULL) - PHP_FE(mssql_select_db, NULL) - PHP_FE(mssql_query, NULL) - PHP_FE(mssql_fetch_batch, NULL) - PHP_FE(mssql_rows_affected, NULL) - PHP_FE(mssql_free_result, NULL) - PHP_FE(mssql_get_last_message, NULL) - PHP_FE(mssql_num_rows, NULL) - PHP_FE(mssql_num_fields, NULL) - PHP_FE(mssql_fetch_field, NULL) - PHP_FE(mssql_fetch_row, NULL) - PHP_FE(mssql_fetch_array, NULL) - PHP_FE(mssql_fetch_assoc, NULL) - PHP_FE(mssql_fetch_object, NULL) - PHP_FE(mssql_field_length, NULL) - PHP_FE(mssql_field_name, NULL) - PHP_FE(mssql_field_type, NULL) - PHP_FE(mssql_data_seek, NULL) - PHP_FE(mssql_field_seek, NULL) - PHP_FE(mssql_result, NULL) - PHP_FE(mssql_next_result, NULL) - PHP_FE(mssql_min_error_severity, NULL) - PHP_FE(mssql_min_message_severity, NULL) - PHP_FE(mssql_init, NULL) - PHP_FE(mssql_bind, third_arg_force_ref) - PHP_FE(mssql_execute, NULL) - PHP_FE(mssql_free_statement, NULL) - PHP_FE(mssql_guid_string, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry mssql_module_entry = -{ - STANDARD_MODULE_HEADER, - "mssql", - mssql_functions, - PHP_MINIT(mssql), - PHP_MSHUTDOWN(mssql), - PHP_RINIT(mssql), - PHP_RSHUTDOWN(mssql), - PHP_MINFO(mssql), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -ZEND_DECLARE_MODULE_GLOBALS(mssql) - -#ifdef COMPILE_DL_MSSQL -ZEND_GET_MODULE(mssql) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } } - -static PHP_INI_DISP(display_text_size) -{ - char *value; - TSRMLS_FETCH(); - - if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (atoi(value) == -1) { - PUTS("Server default"); - } else { - php_printf("%s", value); - } -} - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("mssql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_mssql_globals, mssql_globals) - STD_PHP_INI_ENTRY_EX("mssql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mssql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mssql.min_error_severity", "10", PHP_INI_ALL, OnUpdateLong, cfg_min_error_severity, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mssql.min_message_severity", "10", PHP_INI_ALL, OnUpdateLong, cfg_min_message_severity, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_BOOLEAN("mssql.compatability_mode", "0", PHP_INI_ALL, OnUpdateBool, compatability_mode, zend_mssql_globals, mssql_globals) - STD_PHP_INI_ENTRY_EX("mssql.connect_timeout", "5", PHP_INI_ALL, OnUpdateLong, connect_timeout, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mssql.timeout", "60", PHP_INI_ALL, OnUpdateLong, timeout, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mssql.textsize", "-1", PHP_INI_ALL, OnUpdateLong, textsize, zend_mssql_globals, mssql_globals, display_text_size) - STD_PHP_INI_ENTRY_EX("mssql.textlimit", "-1", PHP_INI_ALL, OnUpdateLong, textlimit, zend_mssql_globals, mssql_globals, display_text_size) - STD_PHP_INI_ENTRY_EX("mssql.batchsize", "0", PHP_INI_ALL, OnUpdateLong, batchsize, zend_mssql_globals, mssql_globals, display_link_numbers) - STD_PHP_INI_BOOLEAN("mssql.datetimeconvert", "1", PHP_INI_ALL, OnUpdateBool, datetimeconvert, zend_mssql_globals, mssql_globals) - STD_PHP_INI_BOOLEAN("mssql.secure_connection", "0", PHP_INI_SYSTEM, OnUpdateBool, secure_connection, zend_mssql_globals, mssql_globals) - STD_PHP_INI_ENTRY_EX("mssql.max_procs", "25", PHP_INI_ALL, OnUpdateLong, max_procs, zend_mssql_globals, mssql_globals, display_link_numbers) -PHP_INI_END() - -/* error handler */ -static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr) -{ - TSRMLS_FETCH(); - - if (severity >= MS_SQL_G(min_error_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (severity %d)", dberrstr, severity); - } - return INT_CANCEL; -} - -/* message handler */ -static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate, int severity,char *msgtext,char *srvname, char *procname,DBUSMALLINT line) -{ - TSRMLS_FETCH(); - - if (severity >= MS_SQL_G(min_message_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "message: %s (severity %d)", msgtext, severity); - } - if (MS_SQL_G(server_message)) { - STR_FREE(MS_SQL_G(server_message)); - MS_SQL_G(server_message) = NULL; - } - MS_SQL_G(server_message) = estrdup(msgtext); - return 0; -} - -static int _clean_invalid_results(list_entry *le TSRMLS_DC) -{ - if (Z_TYPE_P(le) == le_result) { - mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr; - - if (!mssql_ptr->valid) { - return 1; - } - } - return 0; -} - -static void _free_result(mssql_result *result, int free_fields) -{ - int i,j; - - if (result->data) { - for (i=0; i<result->num_rows; i++) { - if (result->data[i]) { - for (j=0; j<result->num_fields; j++) { - zval_dtor(&result->data[i][j]); - } - efree(result->data[i]); - } - } - efree(result->data); - result->data = NULL; - result->blocks_initialized = 0; - } - - if (free_fields && result->fields) { - for (i=0; i<result->num_fields; i++) { - STR_FREE(result->fields[i].name); - STR_FREE(result->fields[i].column_source); - } - efree(result->fields); - } -} - -static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mssql_statement *statement = (mssql_statement *)rsrc->ptr; - - if (statement->binds) { - zend_hash_destroy(statement->binds); - efree(statement->binds); - } - - efree(statement); -} - -static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mssql_result *result = (mssql_result *)rsrc->ptr; - - _free_result(result, 1); - efree(result); -} - -static void php_mssql_set_default_link(int id TSRMLS_DC) -{ - if (MS_SQL_G(default_link)!=-1) { - zend_list_delete(MS_SQL_G(default_link)); - } - MS_SQL_G(default_link) = id; - zend_list_addref(id); -} - -static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr; - - mssql_ptr->valid = 0; - zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC); - dbclose(mssql_ptr->link); - dbfreelogin(mssql_ptr->login); - efree(mssql_ptr); - MS_SQL_G(num_links)--; -} - - -static void _close_mssql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr; - - dbclose(mssql_ptr->link); - dbfreelogin(mssql_ptr->login); - free(mssql_ptr); - MS_SQL_G(num_persistent)--; - MS_SQL_G(num_links)--; -} - -static void _mssql_bind_hash_dtor(void *data) -{ - mssql_bind *bind= (mssql_bind *) data; - - zval_ptr_dtor(&(bind->zval)); -} - -static void php_mssql_init_globals(zend_mssql_globals *mssql_globals) -{ - long compatability_mode; - - mssql_globals->num_persistent = 0; - mssql_globals->get_column_content = php_mssql_get_column_content_with_type; - if (cfg_get_long("mssql.compatability_mode", &compatability_mode) == SUCCESS) { - if (compatability_mode) { - mssql_globals->get_column_content = php_mssql_get_column_content_without_type; - } - } -} - -PHP_MINIT_FUNCTION(mssql) -{ - ZEND_INIT_MODULE_GLOBALS(mssql, php_mssql_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - le_statement = zend_register_list_destructors_ex(_free_mssql_statement, NULL, "mssql statement", module_number); - le_result = zend_register_list_destructors_ex(_free_mssql_result, NULL, "mssql result", module_number); - le_link = zend_register_list_destructors_ex(_close_mssql_link, NULL, "mssql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_mssql_plink, "mssql link persistent", module_number); - Z_TYPE(mssql_module_entry) = type; - - if (dbinit()==FAIL) { - return FAILURE; - } - - /* BEGIN MSSQL data types for mssql_bind */ - REGISTER_LONG_CONSTANT("MSSQL_ASSOC", MSSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSSQL_NUM", MSSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSSQL_BOTH", MSSQL_BOTH, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SQLTEXT",SQLTEXT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLVARCHAR",SQLVARCHAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLCHAR",SQLCHAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLINT1",SQLINT1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLINT2",SQLINT2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLINT4",SQLINT4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLBIT",SQLBIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLFLT4",SQLFLT4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLFLT8",SQLFLT8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLFLTN",SQLFLTN, CONST_CS | CONST_PERSISTENT); - /* END MSSQL data types for mssql_sp_bind */ - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(mssql) -{ - UNREGISTER_INI_ENTRIES(); -#ifndef HAVE_FREETDS - dbwinexit(); -#else - dbexit(); -#endif - return SUCCESS; -} - -PHP_RINIT_FUNCTION(mssql) -{ - MS_SQL_G(default_link) = -1; - MS_SQL_G(num_links) = MS_SQL_G(num_persistent); - MS_SQL_G(appname) = estrndup("PHP 5", 5); - MS_SQL_G(server_message) = NULL; - MS_SQL_G(min_error_severity) = MS_SQL_G(cfg_min_error_severity); - MS_SQL_G(min_message_severity) = MS_SQL_G(cfg_min_message_severity); - if (MS_SQL_G(connect_timeout) < 1) MS_SQL_G(connect_timeout) = 1; - dbsetlogintime(MS_SQL_G(connect_timeout)); - if (MS_SQL_G(timeout) < 0) MS_SQL_G(timeout) = 60; - dbsettime(MS_SQL_G(timeout)); - dbsetmaxprocs((TDS_SHORT)MS_SQL_G(max_procs)); - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(mssql) -{ - STR_FREE(MS_SQL_G(appname)); - MS_SQL_G(appname) = NULL; - if (MS_SQL_G(server_message)) { - STR_FREE(MS_SQL_G(server_message)); - MS_SQL_G(server_message) = NULL; - } - return SUCCESS; -} - -PHP_MINFO_FUNCTION(mssql) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "MSSQL Support", "enabled"); - - sprintf(buf, "%ld", MS_SQL_G(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - sprintf(buf, "%ld", MS_SQL_G(num_links)); - php_info_print_table_row(2, "Active Links", buf); - - php_info_print_table_row(2, "Library version", MSSQL_VERSION); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - -} - -static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *user, *passwd, *host; - char *hashed_details; - int hashed_details_length, new_link = 0; - mssql_link mssql, *mssql_ptr; - char buffer[32]; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - host=user=passwd=NULL; - hashed_details_length=5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details,"mssql___"); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, &yyhost)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - user=passwd=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"mssql_%s__",Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost,**yyuser; - - if (zend_get_parameters_ex(2, &yyhost, &yyuser)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"mssql_%s_%s_",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost,**yyuser,**yypasswd; - - if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"mssql_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */ - } - break; - case 4: { - zval **yyhost,**yyuser,**yypasswd, **yynew_link; - - if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yynew_link) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_long_ex(yynew_link); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - new_link = Z_LVAL_PP(yynew_link); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"mssql_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */ - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (hashed_details == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); - RETURN_FALSE; - } - - /* set a DBLOGIN record */ - if ((mssql.login = dblogin()) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate login record"); - RETURN_FALSE; - } - - DBERRHANDLE(mssql.login, (EHANDLEFUNC) php_mssql_error_handler); - DBMSGHANDLE(mssql.login, (MHANDLEFUNC) php_mssql_message_handler); - -#ifndef HAVE_FREETDS - if (MS_SQL_G(secure_connection)){ - DBSETLSECURE(mssql.login); - } - else { -#endif - if (user) { - DBSETLUSER(mssql.login,user); - } - if (passwd) { - DBSETLPWD(mssql.login,passwd); - } -#ifndef HAVE_FREETDS - } -#endif - -#ifdef HAVE_FREETDS - DBSETLCHARSET(mssql.login, "ISO-8859-1"); -#endif - - DBSETLAPP(mssql.login,MS_SQL_G(appname)); - mssql.valid = 1; - -#ifndef HAVE_FREETDS - DBSETLVERSION(mssql.login, DBVER60); -#endif -/* DBSETLTIME(mssql.login, TIMEOUT_INFINITE); */ - - if (!MS_SQL_G(allow_persistent)) { - persistent=0; - } - if (persistent) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (new_link || zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent)); - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - /* create the link */ - if ((mssql.link = dbopen(mssql.login, host)) == FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host); - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - - if (DBSETOPT(mssql.link, DBBUFFER, "2")==FAIL) { - efree(hashed_details); - dbfreelogin(mssql.login); - dbclose(mssql.link); - RETURN_FALSE; - } - -#ifndef HAVE_FREETDS - if (MS_SQL_G(textlimit) != -1) { - sprintf(buffer, "%li", MS_SQL_G(textlimit)); - if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) { - efree(hashed_details); - dbfreelogin(mssql.login); - dbclose(mssql.link); - RETURN_FALSE; - } - } -#endif - if (MS_SQL_G(textsize) != -1) { - sprintf(buffer, "SET TEXTSIZE %li", MS_SQL_G(textsize)); - dbcmd(mssql.link, buffer); - dbsqlexec(mssql.link); - dbresults(mssql.link); - } - - /* hash it up */ - mssql_ptr = (mssql_link *) malloc(sizeof(mssql_link)); - memcpy(mssql_ptr, &mssql, sizeof(mssql_link)); - Z_TYPE(new_le) = le_plink; - new_le.ptr = mssql_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, &new_le, sizeof(list_entry), NULL)==FAILURE) { - free(mssql_ptr); - efree(hashed_details); - dbfreelogin(mssql.login); - dbclose(mssql.link); - RETURN_FALSE; - } - MS_SQL_G(num_persistent)++; - MS_SQL_G(num_links)++; - } else { /* we do */ - if (Z_TYPE_P(le) != le_plink) { -#if BROKEN_MSSQL_PCONNECTS - log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server); -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!"); - efree(hashed_details); - RETURN_FALSE; - } - - mssql_ptr = (mssql_link *) le->ptr; - /* test that the link hasn't died */ - if (DBDEAD(mssql_ptr->link) == TRUE) { - dbclose(mssql_ptr->link); -#if BROKEN_MSSQL_PCONNECTS - log_error("PHP/MS SQL: Persistent link died, trying to reconnect...",php_rqst->server); -#endif - if ((mssql_ptr->link=dbopen(mssql_ptr->login,host))==NULL) { -#if BROKEN_MSSQL_PCONNECTS - log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server); -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect"); - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - efree(hashed_details); - dbfreelogin(mssql_ptr->login); - RETURN_FALSE; - } -#if BROKEN_MSSQL_PCONNECTS - log_error("PHP/MS SQL: Reconnect successful!",php_rqst->server); -#endif - if (DBSETOPT(mssql_ptr->link, DBBUFFER, "2")==FAIL) { -#if BROKEN_MSSQL_PCONNECTS - log_error("PHP/MS SQL: Unable to set required options",php_rqst->server); -#endif - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length + 1); - efree(hashed_details); - dbfreelogin(mssql_ptr->login); - dbclose(mssql_ptr->link); - RETURN_FALSE; - } - } - } - ZEND_REGISTER_RESOURCE(return_value, mssql_ptr, le_plink); - } else { /* non persistent */ - list_entry *index_ptr, new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual mssql link sits. - * if it doesn't, open a new mssql link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (!new_link && zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length + 1,(void **) &index_ptr)==SUCCESS) { - int type,link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = link; - php_mssql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - dbfreelogin(mssql.login); - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length + 1); - } - } - if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - - if ((mssql.link=dbopen(mssql.login, host))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host); - efree(hashed_details); - dbfreelogin(mssql.login); - RETURN_FALSE; - } - - if (DBSETOPT(mssql.link, DBBUFFER,"2")==FAIL) { - efree(hashed_details); - dbfreelogin(mssql.login); - dbclose(mssql.link); - RETURN_FALSE; - } - -#ifndef HAVE_FREETDS - if (MS_SQL_G(textlimit) != -1) { - sprintf(buffer, "%li", MS_SQL_G(textlimit)); - if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) { - efree(hashed_details); - dbfreelogin(mssql.login); - dbclose(mssql.link); - RETURN_FALSE; - } - } -#endif - if (MS_SQL_G(textsize) != -1) { - sprintf(buffer, "SET TEXTSIZE %li", MS_SQL_G(textsize)); - dbcmd(mssql.link, buffer); - dbsqlexec(mssql.link); - dbresults(mssql.link); - } - - /* add it to the list */ - mssql_ptr = (mssql_link *) emalloc(sizeof(mssql_link)); - memcpy(mssql_ptr, &mssql, sizeof(mssql_link)); - ZEND_REGISTER_RESOURCE(return_value, mssql_ptr, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { - efree(hashed_details); - RETURN_FALSE; - } - MS_SQL_G(num_links)++; - } - efree(hashed_details); - php_mssql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); -} - - -static int php_mssql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (MS_SQL_G(default_link)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_mssql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); - } - return MS_SQL_G(default_link); -} - -/* {{{ proto int mssql_connect([string servername [, string username [, string password [, bool new_link]]]]) - Establishes a connection to a MS-SQL server */ -PHP_FUNCTION(mssql_connect) -{ - php_mssql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} - -/* }}} */ - -/* {{{ proto int mssql_pconnect([string servername [, string username [, string password [, bool new_link]]]]) - Establishes a persistent connection to a MS-SQL server */ -PHP_FUNCTION(mssql_pconnect) -{ - php_mssql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} - -/* }}} */ - -/* {{{ proto bool mssql_close([resource conn_id]) - Closes a connection to a MS-SQL server */ -PHP_FUNCTION(mssql_close) -{ - zval **mssql_link_index=NULL; - int id; - mssql_link *mssql_ptr; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &mssql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, id, "MS SQL-Link", le_link, le_plink); - - if (mssql_link_index) - zend_list_delete(Z_RESVAL_PP(mssql_link_index)); - else - zend_list_delete(id); - - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto bool mssql_select_db(string database_name [, resource conn_id]) - Select a MS-SQL database */ -PHP_FUNCTION(mssql_select_db) -{ - zval **db, **mssql_link_index; - int id; - mssql_link *mssql_ptr; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &mssql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, id, "MS SQL-Link", le_link, le_plink); - - convert_to_string_ex(db); - - if (dbuse(mssql_ptr->link, Z_STRVAL_PP(db))==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to select database: %s", Z_STRVAL_PP(db)); - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} - -/* }}} */ - -static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC) -{ - if (dbdatlen(mssql_ptr->link,offset) == 0) { - ZVAL_NULL(result); - return; - } - - switch (column_type) - { - case SQLBIT: - case SQLINT1: - case SQLINT2: - case SQLINT4: - case SQLINTN: { - ZVAL_LONG(result, (long) anyintcol(offset)); - break; - } - case SQLCHAR: - case SQLVARCHAR: - case SQLTEXT: { - int length; - char *data = charcol(offset); - - length=dbdatlen(mssql_ptr->link,offset); -#if ilia_0 - while (length>0 && data[length-1] == ' ') { /* nuke trailing whitespace */ - length--; - } -#endif - ZVAL_STRINGL(result, data, length, 1); - break; - } - case SQLFLT4: - ZVAL_DOUBLE(result, (double) floatcol4(offset)); - break; - case SQLMONEY: - case SQLMONEY4: - case SQLMONEYN: { - DBFLT8 res_buf; - dbconvert(NULL, column_type, dbdata(mssql_ptr->link,offset), 8, SQLFLT8, (LPBYTE)&res_buf, -1); - ZVAL_DOUBLE(result, res_buf); - } - break; - case SQLFLT8: - ZVAL_DOUBLE(result, (double) floatcol8(offset)); - break; -#ifdef SQLUNIQUE - case SQLUNIQUE: { - char *data = charcol(offset); - - /* uniqueidentifier is a 16-byte binary number */ - ZVAL_STRINGL(result, data, 16, 1); - } - break; -#endif - case SQLVARBINARY: - case SQLBINARY: - case SQLIMAGE: { - DBBINARY *bin; - unsigned char *res_buf; - int res_length = dbdatlen(mssql_ptr->link, offset); - - res_buf = (unsigned char *) emalloc(res_length+1); - bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset)); - memcpy(res_buf,bin,res_length); - res_buf[res_length] = '\0'; - ZVAL_STRINGL(result, res_buf, res_length, 0); - } - break; - case SQLNUMERIC: - default: { - if (dbwillconvert(column_type,SQLCHAR)) { - char *res_buf; - DBDATEREC dateinfo; - int res_length = dbdatlen(mssql_ptr->link,offset); - - if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) { - - switch (column_type) { - case SQLDATETIM4 : - res_length += 14; - break; - case SQLDATETIME : - res_length += 10; - break; - case SQLMONEY : - case SQLMONEY4 : - case SQLMONEYN : - case SQLDECIMAL : - case SQLNUMERIC : - res_length += 5; - break; - } - - res_buf = (unsigned char *) emalloc(res_length+1); - res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1); - res_buf[res_length] = '\0'; - } else { - if (column_type == SQLDATETIM4) { - DBDATETIME temp; - - dbconvert(NULL, SQLDATETIM4, dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); - dbdatecrack(mssql_ptr->link, &dateinfo, &temp); - } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); - } - - res_length = 19; - res_buf = (unsigned char *) emalloc(res_length+1); - sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second); - } - - ZVAL_STRINGL(result, res_buf, res_length, 0); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); - ZVAL_FALSE(result); - } - } - } -} - -static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC) -{ - if (dbdatlen(mssql_ptr->link,offset) == 0) { - ZVAL_NULL(result); - return; - } - - if (column_type == SQLVARBINARY || - column_type == SQLBINARY || - column_type == SQLIMAGE) { - DBBINARY *bin; - unsigned char *res_buf; - int res_length = dbdatlen(mssql_ptr->link, offset); - - res_buf = (unsigned char *) emalloc(res_length+1); - bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset)); - memcpy(res_buf, bin, res_length); - res_buf[res_length] = '\0'; - ZVAL_STRINGL(result, res_buf, res_length, 0); - } - else if (dbwillconvert(coltype(offset),SQLCHAR)) { - unsigned char *res_buf; - DBDATEREC dateinfo; - int res_length = dbdatlen(mssql_ptr->link,offset); - - if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) { - - switch (column_type) { - case SQLDATETIM4 : - res_length += 14; - break; - case SQLDATETIME : - res_length += 10; - break; - case SQLMONEY : - case SQLMONEY4 : - case SQLMONEYN : - case SQLDECIMAL : - case SQLNUMERIC : - res_length += 5; - break; - } - - res_buf = (unsigned char *) emalloc(res_length+1); - res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR, res_buf, -1); - res_buf[res_length] = '\0'; - } else { - if (column_type == SQLDATETIM4) { - DBDATETIME temp; - - dbconvert(NULL, SQLDATETIM4, dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); - dbdatecrack(mssql_ptr->link, &dateinfo, &temp); - } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); - } - - res_length = 19; - res_buf = (unsigned char *) emalloc(res_length+1); - sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second); - } - - ZVAL_STRINGL(result, res_buf, res_length, 0); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); - ZVAL_FALSE(result); - } -} - -static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement TSRMLS_DC) -{ - int i, num_rets, type; - char *parameter; - mssql_bind *bind; - - /* Now to fetch RETVAL and OUTPUT values*/ - num_rets = dbnumrets(mssql_ptr->link); - - if (num_rets!=0) { - for (i = 1; i <= num_rets; i++) { - parameter = (char*)dbretname(mssql_ptr->link, i); - type = dbrettype(mssql_ptr->link, i); - - if (statement->binds != NULL) { /* Maybe a non-parameter sp */ - if (zend_hash_find(statement->binds, parameter, strlen(parameter), (void**)&bind)==SUCCESS) { - if (!dbretlen(mssql_ptr->link,i)) { - ZVAL_NULL(bind->zval); - } - else { - switch (type) { - case SQLBIT: - case SQLINT1: - case SQLINT2: - case SQLINT4: - convert_to_long_ex(&bind->zval); - /* FIXME this works only on little endian machine !!! */ - Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i))); - break; - - case SQLFLT4: - case SQLFLT8: - case SQLFLTN: - case SQLMONEY4: - case SQLMONEY: - case SQLMONEYN: - convert_to_double_ex(&bind->zval); - Z_DVAL_P(bind->zval) = *((double *)(dbretdata(mssql_ptr->link,i))); - break; - - case SQLCHAR: - case SQLVARCHAR: - case SQLTEXT: - convert_to_string_ex(&bind->zval); - Z_STRLEN_P(bind->zval) = dbretlen(mssql_ptr->link,i); - Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval)); - break; - /* TODO binary */ - } - } - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An output parameter variable was not provided"); - } - } - } - } - if (statement->binds != NULL) { /* Maybe a non-parameter sp */ - if (zend_hash_find(statement->binds, "RETVAL", 6, (void**)&bind)==SUCCESS) { - if (dbhasretstat(mssql_ptr->link)) { - convert_to_long_ex(&bind->zval); - Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL"); - } - } - } -} - -static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC) -{ - int i, j = 0; - char computed_buf[16]; - - if (!result->have_fields) { - for (i=0; i<result->num_fields; i++) { - char *source = NULL; - char *fname = (char *)dbcolname(mssql_ptr->link,i+1); - - if (*fname) { - result->fields[i].name = estrdup(fname); - } else { - if (j>0) { - snprintf(computed_buf,16,"computed%d",j); - } else { - strcpy(computed_buf,"computed"); - } - result->fields[i].name = estrdup(computed_buf); - j++; - } - result->fields[i].max_length = dbcollen(mssql_ptr->link,i+1); - source = (char *)dbcolsource(mssql_ptr->link,i+1); - if (source) { - result->fields[i].column_source = estrdup(source); - } - else { - result->fields[i].column_source = STR_EMPTY_ALLOC(); - } - - result->fields[i].type = coltype(i+1); - /* set numeric flag */ - switch (result->fields[i].type) { - case SQLINT1: - case SQLINT2: - case SQLINT4: - case SQLINTN: - case SQLFLT4: - case SQLFLT8: - case SQLNUMERIC: - case SQLDECIMAL: - result->fields[i].numeric = 1; - break; - case SQLCHAR: - case SQLVARCHAR: - case SQLTEXT: - default: - result->fields[i].numeric = 0; - break; - } - } - result->have_fields = 1; - } - - i=0; - if (!result->data) { - result->data = (zval **) safe_emalloc(sizeof(zval *), MSSQL_ROWS_BLOCK*(++result->blocks_initialized), 0); - } - while (retvalue!=FAIL && retvalue!=NO_MORE_ROWS) { - result->num_rows++; - if (result->num_rows > result->blocks_initialized*MSSQL_ROWS_BLOCK) { - result->data = (zval **) erealloc(result->data,sizeof(zval *)*MSSQL_ROWS_BLOCK*(++result->blocks_initialized)); - } - result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0); - for (j=0; j<result->num_fields; j++) { - INIT_ZVAL(result->data[i][j]); - MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type TSRMLS_CC)); - } - if (i<result->batchsize || result->batchsize==0) { - i++; - dbclrbuf(mssql_ptr->link,DBLASTROW(mssql_ptr->link)); - retvalue=dbnextrow(mssql_ptr->link); - } - else - break; - result->lastresult = retvalue; - } - if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) { - _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC); - } - return i; -} - -/* {{{ proto int mssql_fetch_batch(resource result_index) - Returns the next batch of records */ -PHP_FUNCTION(mssql_fetch_batch) -{ - zval **mssql_result_index; - mssql_result *result; - mssql_link *mssql_ptr; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(mssql_result_index)==IS_RESOURCE && Z_LVAL_PP(mssql_result_index)==0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - mssql_ptr = result->mssql_ptr; - _free_result(result, 0); - result->cur_row=result->num_rows=0; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult TSRMLS_CC); - RETURN_LONG(result->num_rows); -} -/* }}} */ - -/* {{{ proto resource mssql_query(string query [, resource conn_id [, int batch_size]]) - Perform an SQL query on a MS-SQL server database */ -PHP_FUNCTION(mssql_query) -{ - zval **query, **mssql_link_index, **zbatchsize; - int retvalue; - mssql_link *mssql_ptr; - mssql_result *result; - int id, num_fields; - int batchsize; - - batchsize = MS_SQL_G(batchsize); - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &query, &mssql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &query, &mssql_link_index, &zbatchsize)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_long_ex(zbatchsize); - batchsize = Z_LVAL_PP(zbatchsize); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, id, "MS SQL-Link", le_link, le_plink); - - convert_to_string_ex(query); - - if (dbcmd(mssql_ptr->link, Z_STRVAL_PP(query))==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query"); - RETURN_FALSE; - } - if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue = dbresults(mssql_ptr->link))==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed"); - RETURN_FALSE; - } - - /* Skip results not returning any columns */ - while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && retvalue == SUCCEED) { - retvalue = dbresults(mssql_ptr->link); - } - - if (num_fields <= 0) { - RETURN_TRUE; - } - - retvalue=dbnextrow(mssql_ptr->link); - if (retvalue==FAIL) { - RETURN_FALSE; - } - - result = (mssql_result *) emalloc(sizeof(mssql_result)); - result->statement = NULL; - result->num_fields = num_fields; - result->blocks_initialized = 1; - - result->batchsize = batchsize; - result->data = NULL; - result->blocks_initialized = 0; - result->mssql_ptr = mssql_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->have_fields = 0; - - result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0); - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); - - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -/* {{{ proto int mssql_rows_affected(resource conn_id) - Returns the number of records affected by the query */ -PHP_FUNCTION(mssql_rows_affected) -{ - zval **mssql_link_index; - mssql_link *mssql_ptr; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_link_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, -1, "MS SQL-Link", le_link, le_plink); - RETURN_LONG(DBCOUNT(mssql_ptr->link)); -} -/* }}} */ - - -/* {{{ proto bool mssql_free_result(resource result_index) - Free a MS-SQL result index */ -PHP_FUNCTION(mssql_free_result) -{ - zval **mssql_result_index; - mssql_result *result; - int retvalue; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(mssql_result_index)==IS_RESOURCE && Z_LVAL_PP(mssql_result_index)==0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - /* Release remaining results */ - do { - dbcanquery(result->mssql_ptr->link); - retvalue = dbresults(result->mssql_ptr->link); - } while (retvalue == SUCCEED); - - zend_list_delete(Z_RESVAL_PP(mssql_result_index)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string mssql_get_last_message(void) - Gets the last message from the MS-SQL server */ -PHP_FUNCTION(mssql_get_last_message) -{ - if (MS_SQL_G(server_message)) { - RETURN_STRING(MS_SQL_G(server_message),1); - } - else { - RETURN_STRING("",1); - } -} - -/* }}} */ - -/* {{{ proto int mssql_num_rows(resource mssql_result_index) - Returns the number of rows fetched in from the result id specified */ -PHP_FUNCTION(mssql_num_rows) -{ - zval **mssql_result_index; - mssql_result *result; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - Z_LVAL_P(return_value) = result->num_rows; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto int mssql_num_fields(resource mssql_result_index) - Returns the number of fields fetched in from the result id specified */ -PHP_FUNCTION(mssql_num_fields) -{ - zval **mssql_result_index; - mssql_result *result; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - Z_LVAL_P(return_value) = result->num_fields; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -static void php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args) -{ - zval **mssql_result_index, **resulttype = NULL; - mssql_result *result; - int i; - - if (ZEND_NUM_ARGS() > expected_args) { - WRONG_PARAM_COUNT; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - RETURN_FALSE; - } - if (!result_type) { - result_type = MSSQL_BOTH; - } - break; - case 2: - if (zend_get_parameters_ex(2, &mssql_result_index, &resulttype)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(resulttype); - result_type = Z_LVAL_PP(resulttype); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - if (MS_SQL_G(server_message)) { - STR_FREE(MS_SQL_G(server_message)); - MS_SQL_G(server_message) = NULL; - } - - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i=0; i<result->num_fields; i++) { - if (Z_TYPE(result->data[result->cur_row][i]) != IS_NULL) { - char *data; - int data_len; - int should_copy; - - if (Z_TYPE(result->data[result->cur_row][i]) == IS_STRING) { - if (PG(magic_quotes_runtime)) { - data = php_addslashes(Z_STRVAL(result->data[result->cur_row][i]), Z_STRLEN(result->data[result->cur_row][i]), &data_len, 0 TSRMLS_CC); - should_copy = 0; - } - else - { - data = Z_STRVAL(result->data[result->cur_row][i]); - data_len = Z_STRLEN(result->data[result->cur_row][i]); - should_copy = 1; - } - - if (result_type & MSSQL_NUM) { - add_index_stringl(return_value, i, data, data_len, should_copy); - should_copy = 1; - } - - if (result_type & MSSQL_ASSOC) { - add_assoc_stringl(return_value, result->fields[i].name, data, data_len, should_copy); - } - } - else if (Z_TYPE(result->data[result->cur_row][i]) == IS_LONG) { - if (result_type & MSSQL_NUM) - add_index_long(return_value, i, Z_LVAL(result->data[result->cur_row][i])); - - if (result_type & MSSQL_ASSOC) - add_assoc_long(return_value, result->fields[i].name, Z_LVAL(result->data[result->cur_row][i])); - } - else if (Z_TYPE(result->data[result->cur_row][i]) == IS_DOUBLE) { - if (result_type & MSSQL_NUM) - add_index_double(return_value, i, Z_DVAL(result->data[result->cur_row][i])); - - if (result_type & MSSQL_ASSOC) - add_assoc_double(return_value, result->fields[i].name, Z_DVAL(result->data[result->cur_row][i])); - } - } - else - { - if (result_type & MSSQL_NUM) - add_index_null(return_value, i); - if (result_type & MSSQL_ASSOC) - add_assoc_null(return_value, result->fields[i].name); - } - } - result->cur_row++; -} - -/* {{{ proto array mssql_fetch_row(resource result_id) - Returns an array of the current row in the result set specified by result_id */ -PHP_FUNCTION(mssql_fetch_row) -{ - php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_NUM, 1); -} - -/* }}} */ - -/* {{{ proto object mssql_fetch_object(resource result_id [, int result_type]) - Returns a psuedo-object of the current row in the result set specified by result_id */ -PHP_FUNCTION(mssql_fetch_object) -{ - php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_ASSOC, 2); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} - -/* }}} */ - -/* {{{ proto array mssql_fetch_array(resource result_id [, int result_type]) - Returns an associative array of the current row in the result set specified by result_id */ -PHP_FUNCTION(mssql_fetch_array) -{ - php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_BOTH, 2); -} - -/* }}} */ - -/* {{{ proto array mssql_fetch_assoc(resource result_id) - Returns an associative array of the current row in the result set specified by result_id */ -PHP_FUNCTION(mssql_fetch_assoc) -{ - php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_ASSOC, 1); -} - -/* }}} */ - -/* {{{ proto bool mssql_data_seek(resource result_id, int offset) - Moves the internal row pointer of the MS-SQL result associated with the specified result identifier to pointer to the specified row number */ -PHP_FUNCTION(mssql_data_seek) -{ - zval **mssql_result_index, **offset; - mssql_result *result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - convert_to_long_ex(offset); - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset"); - RETURN_FALSE; - } - - result->cur_row = Z_LVAL_PP(offset); - RETURN_TRUE; -} - -/* }}} */ - -static char *php_mssql_get_field_name(int type) -{ - switch (type) { - case SQLBINARY: - case SQLVARBINARY: - return "blob"; - break; - case SQLCHAR: - case SQLVARCHAR: - return "char"; - break; - case SQLTEXT: - return "text"; - break; - case SQLDATETIME: - case SQLDATETIM4: - case SQLDATETIMN: - return "datetime"; - break; - case SQLDECIMAL: - case SQLFLT4: - case SQLFLT8: - case SQLFLTN: - return "real"; - break; - case SQLINT1: - case SQLINT2: - case SQLINT4: - case SQLINTN: - return "int"; - break; - case SQLNUMERIC: - return "numeric"; - break; - case SQLMONEY: - case SQLMONEY4: - case SQLMONEYN: - return "money"; - break; - case SQLBIT: - return "bit"; - break; - case SQLIMAGE: - return "image"; - break; -#ifdef SQLUNIQUE - case SQLUNIQUE: - return "uniqueidentifier"; - break; -#endif - default: - return "unknown"; - break; - } -} - -/* {{{ proto object mssql_fetch_field(resource result_id [, int offset]) - Gets information about certain fields in a query result */ -PHP_FUNCTION(mssql_fetch_field) -{ - zval **mssql_result_index, **offset; - int field_offset; - mssql_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); - } - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name",result->fields[field_offset].name, 1); - add_property_long(return_value, "max_length",result->fields[field_offset].max_length); - add_property_string(return_value, "column_source",result->fields[field_offset].column_source, 1); - add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_mssql_get_field_name(Z_TYPE(result->fields[field_offset])), 1); -} - -/* }}} */ - -/* {{{ proto int mssql_field_length(resource result_id [, int offset]) - Get the length of a MS-SQL field */ -PHP_FUNCTION(mssql_field_length) -{ - zval **mssql_result_index, **offset; - int field_offset; - mssql_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); - } - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = result->fields[field_offset].max_length; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto string mssql_field_name(resource result_id [, int offset]) - Returns the name of the field given by offset in the result set given by result_id */ -PHP_FUNCTION(mssql_field_name) -{ - zval **mssql_result_index, **offset; - int field_offset; - mssql_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); - } - RETURN_FALSE; - } - - RETURN_STRINGL(result->fields[field_offset].name, strlen(result->fields[field_offset].name), 1); -} - -/* }}} */ - -/* {{{ proto string mssql_field_type(resource result_id [, int offset]) - Returns the type of a field */ -PHP_FUNCTION(mssql_field_type) -{ - zval **mssql_result_index, **offset; - int field_offset; - mssql_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); - } - RETURN_FALSE; - } - - RETURN_STRINGL(php_mssql_get_field_name(Z_TYPE(result->fields[field_offset])), strlen(php_mssql_get_field_name(Z_TYPE(result->fields[field_offset]))), 1); -} - -/* }}} */ - -/* {{{ proto bool mssql_field_seek(int result_id, int offset) - Seeks to the specified field offset */ -PHP_FUNCTION(mssql_field_seek) -{ - zval **mssql_result_index, **offset; - int field_offset; - mssql_result *result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &mssql_result_index, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - - if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); - RETURN_FALSE; - } - - result->cur_field = field_offset; - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto string mssql_result(resource result_id, int row, mixed field) - Returns the contents of one cell from a MS-SQL result set */ -PHP_FUNCTION(mssql_result) -{ - zval **row, **field, **mssql_result_index; - int field_offset=0; - mssql_result *result; - - if (ZEND_NUM_ARGS()!=3 || zend_get_parameters_ex(3, &mssql_result_index, &row, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - convert_to_long_ex(row); - if (Z_LVAL_PP(row) < 0 || Z_LVAL_PP(row) >= result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset (%ld)", Z_LVAL_PP(row)); - RETURN_FALSE; - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i; - - for (i=0; i<result->num_fields; i++) { - if (!strcasecmp(result->fields[i].name, Z_STRVAL_PP(field))) { - field_offset = i; - break; - } - } - if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field)); - RETURN_FALSE; - } - break; - } - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - break; - } - - *return_value = result->data[Z_LVAL_PP(row)][field_offset]; - zval_copy_ctor(return_value); -} -/* }}} */ - -/* {{{ proto bool mssql_next_result(resource result_id) - Move the internal result pointer to the next result */ -PHP_FUNCTION(mssql_next_result) -{ - zval **mssql_result_index; - int retvalue; - mssql_result *result; - mssql_link *mssql_ptr; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result); - - mssql_ptr = result->mssql_ptr; - retvalue = dbresults(mssql_ptr->link); - if (retvalue == FAIL) { - RETURN_FALSE; - } - else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) { - if (result->statement) { - _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC); - } - RETURN_FALSE; - } - else { - _free_result(result, 1); - result->cur_row=result->num_fields=result->num_rows=0; - dbclrbuf(mssql_ptr->link,DBLASTROW(mssql_ptr->link)); - retvalue = dbnextrow(mssql_ptr->link); - - result->num_fields = dbnumcols(mssql_ptr->link); - result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0); - result->have_fields = 0; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); - RETURN_TRUE; - } - -} -/* }}} */ - - -/* {{{ proto void mssql_min_error_severity(int severity) - Sets the lower error severity */ -PHP_FUNCTION(mssql_min_error_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &severity)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - MS_SQL_G(min_error_severity) = Z_LVAL_PP(severity); -} - -/* }}} */ - -/* {{{ proto void mssql_min_message_severity(int severity) - Sets the lower message severity */ -PHP_FUNCTION(mssql_min_message_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &severity)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - MS_SQL_G(min_message_severity) = Z_LVAL_PP(severity); -} -/* }}} */ - -/* {{{ proto int mssql_init(string sp_name [, resource conn_id]) - Initializes a stored procedure or a remote stored procedure */ -PHP_FUNCTION(mssql_init) -{ - zval **sp_name, **mssql_link_index; - mssql_link *mssql_ptr; - mssql_statement *statement; - int id; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &sp_name)==FAILURE) { - RETURN_FALSE; - } - id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - - case 2: - if (zend_get_parameters_ex(2, &sp_name, &mssql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, mssql_link_index, id, "MS SQL-Link", le_link, le_plink); - - convert_to_string_ex(sp_name); - - if (dbrpcinit(mssql_ptr->link, Z_STRVAL_PP(sp_name),0)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to init stored procedure"); - RETURN_FALSE; - } - - statement=NULL; - statement = ecalloc(1,sizeof(mssql_statement)); - statement->link = mssql_ptr; - statement->executed=FALSE; - - statement->id = zend_list_insert(statement,le_statement); - - RETURN_RESOURCE(statement->id); -} -/* }}} */ - -/* {{{ proto bool mssql_bind(resource stmt, string param_name, mixed var, int type [, int is_output [, int is_null [, int maxlen]]]) - Adds a parameter to a stored procedure or a remote stored procedure */ -PHP_FUNCTION(mssql_bind) -{ - int type, is_output, is_null, datalen, maxlen = -1; - zval **stmt, **param_name, **var, **yytype; - mssql_link *mssql_ptr; - mssql_statement *statement; - mssql_bind bind,*bindp; - int status = 0; - LPBYTE value = NULL; - - /* BEGIN input validation */ - switch(ZEND_NUM_ARGS()) { - case 4: - if (zend_get_parameters_ex(4, &stmt, ¶m_name, &var, &yytype)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(yytype); - type=Z_LVAL_PP(yytype); - is_null=FALSE; - is_output=FALSE; - break; - - case 5: { - zval **yyis_output; - - if (zend_get_parameters_ex(5, &stmt, ¶m_name, &var, &yytype, &yyis_output)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(yytype); - convert_to_long_ex(yyis_output); - type=Z_LVAL_PP(yytype); - is_null=FALSE; - is_output=Z_LVAL_PP(yyis_output); - } - break; - - case 6: { - zval **yyis_output, **yyis_null; - - if (zend_get_parameters_ex(6, &stmt, ¶m_name, &var, &yytype, &yyis_output, &yyis_null)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(yytype); - convert_to_long_ex(yyis_output); - convert_to_long_ex(yyis_null); - type=Z_LVAL_PP(yytype); - is_output=Z_LVAL_PP(yyis_output); - is_null=Z_LVAL_PP(yyis_null); - } - break; - - case 7: { - zval **yyis_output, **yyis_null, **yymaxlen; - - if (zend_get_parameters_ex(7, &stmt, ¶m_name, &var, &yytype, &yyis_output, &yyis_null, &yymaxlen)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(yytype); - convert_to_long_ex(yyis_output); - convert_to_long_ex(yyis_null); - convert_to_long_ex(yymaxlen); - type=Z_LVAL_PP(yytype); - is_output=Z_LVAL_PP(yyis_output); - is_null=Z_LVAL_PP(yyis_null); - maxlen=Z_LVAL_PP(yymaxlen); - } - break; - - default: - WRONG_PARAM_COUNT; - break; - } - /* END input validation */ - - ZEND_FETCH_RESOURCE(statement, mssql_statement *, stmt, -1, "MS SQL-Statement", le_statement); - if (statement==NULL) { - RETURN_FALSE; - } - mssql_ptr=statement->link; - - /* modify datalen and maxlen according to dbrpcparam documentation */ - if ( (type==SQLVARCHAR) || (type==SQLCHAR) || (type==SQLTEXT) ) { /* variable-length type */ - if (is_null) { - maxlen=0; - datalen=0; - } - else { - convert_to_string_ex(var); - datalen=Z_STRLEN_PP(var); - value=(LPBYTE)Z_STRVAL_PP(var); - } - } - else { /* fixed-length type */ - if (is_null) { - datalen=0; - } - else { - datalen=-1; - } - maxlen=-1; - - switch (type) { - - case SQLFLT4: - case SQLFLT8: - case SQLFLTN: - convert_to_double_ex(var); - value=(LPBYTE)(&Z_DVAL_PP(var)); - break; - - case SQLBIT: - case SQLINT1: - case SQLINT2: - case SQLINT4: - convert_to_long_ex(var); - value=(LPBYTE)(&Z_LVAL_PP(var)); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported type"); - RETURN_FALSE; - break; - } - } - - convert_to_string_ex(param_name); - - if (is_output) { - status=DBRPCRETURN; - } - - /* hashtable of binds */ - if (! statement->binds) { - ALLOC_HASHTABLE(statement->binds); - zend_hash_init(statement->binds, 13, NULL, _mssql_bind_hash_dtor, 0); - } - - memset((void*)&bind,0,sizeof(mssql_bind)); - zend_hash_add(statement->binds,Z_STRVAL_PP(param_name),Z_STRLEN_PP(param_name),&bind,sizeof(mssql_bind),(void **)&bindp); - if( NULL == bindp ) RETURN_FALSE; - bindp->zval=*var; - zval_add_ref(var); - - /* no call to dbrpcparam if RETVAL */ - if ( strcmp("RETVAL",Z_STRVAL_PP(param_name))!=0 ) { - if (dbrpcparam(mssql_ptr->link, Z_STRVAL_PP(param_name), (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter"); - RETURN_FALSE; - } - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mssql_execute(resource stmt [, bool skip_results = false]) - Executes a stored procedure on a MS-SQL server database */ -PHP_FUNCTION(mssql_execute) -{ - zval **stmt, **skip; - zend_bool skip_results = 0; - int retvalue, retval_results; - mssql_link *mssql_ptr; - mssql_statement *statement; - mssql_result *result; - int num_fields; - int batchsize; - int ac = ZEND_NUM_ARGS(); - - batchsize = MS_SQL_G(batchsize); - if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &stmt, &skip)==FAILURE) { - WRONG_PARAM_COUNT; - } - if (ac == 2) { - skip_results = Z_BVAL_PP(skip); - } - - ZEND_FETCH_RESOURCE(statement, mssql_statement *, stmt, -1, "MS SQL-Statement", le_statement); - - mssql_ptr=statement->link; - - if (dbrpcexec(mssql_ptr->link)==FAIL || dbsqlok(mssql_ptr->link)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed"); - RETURN_FALSE; - } - - retval_results=dbresults(mssql_ptr->link); - - if (retval_results==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results"); - RETURN_FALSE; - } - - /* The following is just like mssql_query, fetch all rows from the first result - * set into the row buffer. - */ - result=NULL; - if (retval_results == SUCCEED) { - if (skip_results) { - do { - dbcanquery(mssql_ptr->link); - retval_results = dbresults(mssql_ptr->link); - } while (retval_results == SUCCEED); - } - else { - /* Skip results not returning any columns */ - while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && retval_results == SUCCEED) { - retval_results = dbresults(mssql_ptr->link); - } - if ((num_fields = dbnumcols(mssql_ptr->link)) > 0) { - retvalue = dbnextrow(mssql_ptr->link); - result = (mssql_result *) emalloc(sizeof(mssql_result)); - result->batchsize = batchsize; - result->blocks_initialized = 1; - result->data = (zval **) safe_emalloc(sizeof(zval *), MSSQL_ROWS_BLOCK, 0); - result->mssql_ptr = mssql_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->num_fields = num_fields; - result->have_fields = 0; - - result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), num_fields, 0); - result->statement = statement; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); - } - } - } - if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) { - _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC); - } - - if (result==NULL) { - RETURN_TRUE; /* no recordset returned ...*/ - } - else { - ZEND_REGISTER_RESOURCE(return_value, result, le_result); - } -} -/* }}} */ - -/* {{{ proto bool mssql_free_statement(resource result_index) - Free a MS-SQL statement index */ -PHP_FUNCTION(mssql_free_statement) -{ - zval **mssql_statement_index; - mssql_statement *statement; - int retvalue; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &mssql_statement_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(mssql_statement_index)==IS_RESOURCE && Z_LVAL_PP(mssql_statement_index)==0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(statement, mssql_statement *, mssql_statement_index, -1, "MS SQL-statement", le_statement); - /* Release remaining results */ - do { - dbcanquery(statement->link->link); - retvalue = dbresults(statement->link->link); - } while (retvalue == SUCCEED); - - zend_list_delete(Z_RESVAL_PP(mssql_statement_index)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string mssql_guid_string(string binary [,int short_format]) - Converts a 16 byte binary GUID to a string */ -PHP_FUNCTION(mssql_guid_string) -{ - zval **binary, **short_format; - int sf = 0; - char buffer[32+1]; - char buffer2[36+1]; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &binary)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(binary); - break; - case 2: - if (zend_get_parameters_ex(2, &binary, &short_format)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(binary); - convert_to_long_ex(short_format); - sf = Z_LVAL_PP(short_format); - break; - - default: - WRONG_PARAM_COUNT; - break; - } - - dbconvert(NULL, SQLBINARY, (BYTE*)Z_STRVAL_PP(binary), MIN(16, Z_STRLEN_PP(binary)), SQLCHAR, buffer, -1); - - if (sf) { - php_strtoupper(buffer, 32); - RETURN_STRING(buffer, 1); - } - else { - int i; - /* FIXME this works only on little endian machine */ - for (i=0; i<4; i++) { - buffer2[2*i] = buffer[6-2*i]; - buffer2[2*i+1] = buffer[7-2*i]; - } - buffer2[8] = '-'; - for (i=0; i<2; i++) { - buffer2[9+2*i] = buffer[10-2*i]; - buffer2[10+2*i] = buffer[11-2*i]; - } - buffer2[13] = '-'; - for (i=0; i<2; i++) { - buffer2[14+2*i] = buffer[14-2*i]; - buffer2[15+2*i] = buffer[15-2*i]; - } - buffer2[18] = '-'; - for (i=0; i<4; i++) { - buffer2[19+i] = buffer[16+i]; - } - buffer2[23] = '-'; - for (i=0; i<12; i++) { - buffer2[24+i] = buffer[20+i]; - } - buffer2[36] = 0; - - php_strtoupper(buffer2, 36); - RETURN_STRING(buffer2, 1); - } -} -/* }}} */ - -#endif diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h deleted file mode 100644 index b2ead409b88d5..0000000000000 --- a/ext/mssql/php_mssql.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ - */ - - -/* $Id$ */ - -#ifndef PHP_MSSQL_H -#define PHP_MSSQL_H - - -#if HAVE_MSSQL -#define MSDBLIB -#ifdef PHP_WIN32 -#define PHP_MSSQL_API __declspec(dllexport) -#else -#define PHP_MSSQL_API -#endif - -#include <sqlfront.h> -#include <sqldb.h> - -typedef short TDS_SHORT; -#ifdef HAVE_FREETDS -#define MSSQL_VERSION "FreeTDS" -#define SQLTEXT SYBTEXT -#define SQLCHAR SYBCHAR -#define SQLVARCHAR SYBVARCHAR -#define SQLINT1 SYBINT1 -#define SQLINT2 SYBINT2 -#define SQLINT4 SYBINT4 -#define SQLINTN SYBINTN -#define SQLBIT SYBBIT -#define SQLFLT4 SYBREAL -#define SQLFLT8 SYBFLT8 -#define SQLFLTN SYBFLTN -#define SQLDECIMAL SYBDECIMAL -#define SQLNUMERIC SYBNUMERIC -#define SQLDATETIME SYBDATETIME -#define SQLDATETIM4 SYBDATETIME4 -#define SQLDATETIMN SYBDATETIMN -#define SQLMONEY SYBMONEY -#define SQLMONEY4 SYBMONEY4 -#define SQLMONEYN SYBMONEYN -#define SQLIMAGE SYBIMAGE -#define SQLBINARY SYBBINARY -#define SQLVARBINARY SYBVARBINARY -#ifdef SQLUNIQUE /* FreeTSD 0.61+ */ -#define SQLUNIQUE SYBUNIQUE -#endif -#define DBERRHANDLE(a, b) dberrhandle(b) -#define DBMSGHANDLE(a, b) dbmsghandle(b) -#define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1) -#define NO_MORE_RPC_RESULTS 3 -#define dbfreelogin dbloginfree -#define dbrpcexec dbrpcsend -typedef unsigned char *LPBYTE; -typedef float DBFLT4; -#else -#define MSSQL_VERSION "7.0" -#define DBERRHANDLE(a, b) dbprocerrhandle(a, b) -#define DBMSGHANDLE(a, b) dbprocmsghandle(a, b) -#define EHANDLEFUNC DBERRHANDLE_PROC -#define MHANDLEFUNC DBMSGHANDLE_PROC -#define DBSETOPT(a, b, c) dbsetopt(a, b, c) -#endif - -#define coltype(j) dbcoltype(mssql_ptr->link,j) -#define intcol(i) ((int) *(DBINT *) dbdata(mssql_ptr->link,i)) -#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(mssql_ptr->link,i)) -#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(mssql_ptr->link,i)) -#define anyintcol(j) (coltype(j)==SQLINT4?intcol(j):(coltype(j)==SQLINT2?smallintcol(j):tinyintcol(j))) -#define charcol(i) ((DBCHAR *) dbdata(mssql_ptr->link,i)) -#define floatcol4(i) (*(DBFLT4 *) dbdata(mssql_ptr->link,i)) -#define floatcol8(i) (*(DBFLT8 *) dbdata(mssql_ptr->link,i)) - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry mssql_module_entry; -#define mssql_module_ptr &mssql_module_entry - -PHP_MINIT_FUNCTION(mssql); -PHP_MSHUTDOWN_FUNCTION(mssql); -PHP_RINIT_FUNCTION(mssql); -PHP_RSHUTDOWN_FUNCTION(mssql); -PHP_MINFO_FUNCTION(mssql); - -PHP_FUNCTION(mssql_connect); -PHP_FUNCTION(mssql_pconnect); -PHP_FUNCTION(mssql_close); -PHP_FUNCTION(mssql_select_db); -PHP_FUNCTION(mssql_query); -PHP_FUNCTION(mssql_fetch_batch); -PHP_FUNCTION(mssql_rows_affected); -PHP_FUNCTION(mssql_free_result); -PHP_FUNCTION(mssql_get_last_message); -PHP_FUNCTION(mssql_num_rows); -PHP_FUNCTION(mssql_num_fields); -PHP_FUNCTION(mssql_fetch_field); -PHP_FUNCTION(mssql_fetch_row); -PHP_FUNCTION(mssql_fetch_array); -PHP_FUNCTION(mssql_fetch_assoc); -PHP_FUNCTION(mssql_fetch_object); -PHP_FUNCTION(mssql_field_length); -PHP_FUNCTION(mssql_field_name); -PHP_FUNCTION(mssql_field_type); -PHP_FUNCTION(mssql_data_seek); -PHP_FUNCTION(mssql_field_seek); -PHP_FUNCTION(mssql_result); -PHP_FUNCTION(mssql_next_result); -PHP_FUNCTION(mssql_min_error_severity); -PHP_FUNCTION(mssql_min_message_severity); -PHP_FUNCTION(mssql_init); -PHP_FUNCTION(mssql_bind); -PHP_FUNCTION(mssql_execute); -PHP_FUNCTION(mssql_free_statement); -PHP_FUNCTION(mssql_guid_string); - -typedef struct mssql_link { - LOGINREC *login; - DBPROCESS *link; - int valid; -} mssql_link; - -typedef struct mssql_statement { - int id; - mssql_link *link; - HashTable *binds; - int executed; -} mssql_statement; - -typedef struct { - - zval *zval; - /* TODO: more data for special types (BLOBS, NUMERIC...) */ -} mssql_bind; - -ZEND_BEGIN_MODULE_GLOBALS(mssql) - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - zend_bool allow_persistent; - char *appname; - char *server_message; - long min_error_severity, min_message_severity; - long cfg_min_error_severity, cfg_min_message_severity; - long connect_timeout, timeout; - zend_bool compatability_mode; - void (*get_column_content)(mssql_link *mssql_ptr,int offset,pval *result,int column_type TSRMLS_DC); - long textsize, textlimit, batchsize; - zend_bool datetimeconvert; - HashTable *resource_list, *resource_plist; - zend_bool secure_connection; - long max_procs; -ZEND_END_MODULE_GLOBALS(mssql) - -#define MSSQL_ROWS_BLOCK 128 - -typedef struct mssql_field { - char *name,*column_source; - long max_length; - int numeric; - int type; -} mssql_field; - -typedef struct mssql_result { - pval **data; - mssql_field *fields; - mssql_link *mssql_ptr; - mssql_statement * statement; - int batchsize; - int lastresult; - int blocks_initialized; - int cur_row,cur_field; - int num_rows,num_fields,have_fields; -} mssql_result; - - -#ifdef ZTS -# define MS_SQL_G(v) TSRMG(mssql_globals_id, zend_mssql_globals *, v) -#else -# define MS_SQL_G(v) (mssql_globals.v) -#endif - -#else - -#define mssql_module_ptr NULL - -#endif /* HAVE_MSSQL */ - -#define phpext_mssql_ptr mssql_module_ptr - -#endif /* PHP_MSSQL_H */ diff --git a/ext/mysql/CREDITS b/ext/mysql/CREDITS deleted file mode 100644 index e5a6208babc1f..0000000000000 --- a/ext/mysql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -MySQL -Zeev Suraski, Zak Greant, Georg Richter diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 deleted file mode 100644 index cad03630b4480..0000000000000 --- a/ext/mysql/config.m4 +++ /dev/null @@ -1,141 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([MYSQL_LIB_CHK], [ - str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*" - for j in `echo $str`; do - if test -r $j; then - MYSQL_LIB_DIR=$MYSQL_DIR/$1 - break 2 - fi - done -]) - -AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ - for i in \ - /var/run/mysqld/mysqld.sock \ - /var/tmp/mysql.sock \ - /var/run/mysql/mysql.sock \ - /var/lib/mysql/mysql.sock \ - /var/mysql/mysql.sock \ - /usr/local/mysql/var/mysql.sock \ - /Private/tmp/mysql.sock \ - /private/tmp/mysql.sock \ - /tmp/mysql.sock \ - ; do - if test -r $i; then - MYSQL_SOCK=$i - break 2 - fi - done - - if test -n "$MYSQL_SOCK"; then - AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) - AC_MSG_RESULT([$MYSQL_SOCK]) - else - AC_MSG_RESULT([no]) - fi -]) - - -PHP_ARG_WITH(mysql, for MySQL support, -[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory]) - -PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, -[ --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer. - If unspecified, the default locations are searched], no, no) - -if test -z "$PHP_ZLIB_DIR"; then - PHP_ARG_WITH(zlib-dir, for the location of libz, - [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no) -fi - - -if test "$PHP_MYSQL" != "no"; then - AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) - - AC_MSG_CHECKING([for MySQL UNIX socket location]) - if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then - MYSQL_SOCK=$PHP_MYSQL_SOCK - AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) - AC_MSG_RESULT([$MYSQL_SOCK]) - elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then - PHP_MYSQL_SOCKET_SEARCH - else - AC_MSG_RESULT([no]) - fi - - MYSQL_DIR= - MYSQL_INC_DIR= - - for i in $PHP_MYSQL /usr/local /usr; do - if test -r $i/include/mysql/mysql.h; then - MYSQL_DIR=$i - MYSQL_INC_DIR=$i/include/mysql - break - elif test -r $i/include/mysql.h; then - MYSQL_DIR=$i - MYSQL_INC_DIR=$i/include - break - fi - done - - if test -z "$MYSQL_DIR"; then - AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL. -Note that the MySQL client library is not bundled anymore!]) - fi - - MYSQL_LIBNAME=mysqlclient - case $host_alias in - *netware*[)] - MYSQL_LIBNAME=mysql - ;; - esac - - for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do - MYSQL_LIB_CHK($i) - done - - if test -z "$MYSQL_LIB_DIR"; then - AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. -Note that the MySQL client library is not bundled anymore!]) - fi - - PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ], - [ - if test "$PHP_ZLIB_DIR" != "no"; then - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD) - PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [ - AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.]) - ], [ - -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR - ]) - MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz" - else - PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD) - PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [ - AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.]) - ], [ - -L$MYSQL_LIB_DIR - ]) - MYSQL_LIBS="-lz" - fi - ], [ - -L$MYSQL_LIB_DIR - ]) - - PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($MYSQL_INC_DIR) - - PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared) - - MYSQL_MODULE_TYPE=external - MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS" - MYSQL_INCLUDE=-I$MYSQL_INC_DIR - - PHP_SUBST(MYSQL_SHARED_LIBADD) - PHP_SUBST_OLD(MYSQL_MODULE_TYPE) - PHP_SUBST_OLD(MYSQL_LIBS) - PHP_SUBST_OLD(MYSQL_INCLUDE) -fi diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32 deleted file mode 100644 index 95f689e1d6417..0000000000000 --- a/ext/mysql/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mysql", "MySQL support", "no"); - -if (PHP_MYSQL != "no") { - if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) && - CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL", - PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) { - EXTENSION("mysql", "php_mysql.c"); - AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library'); - } else { - WARNING("mysql not enabled; libraries and headers not found"); - } -} diff --git a/ext/mysql/mysql.dsp b/ext/mysql/mysql.dsp deleted file mode 100644 index dfc9c63db5d4d..0000000000000 --- a/ext/mysql/mysql.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mysql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mysql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mysql.mak" CFG="mysql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mysql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mysql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mysql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release" - -!ELSEIF "$(CFG)" == "mysql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug" - -!ELSEIF "$(CFG)" == "mysql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /FR /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "mysql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ENDIF - -# Begin Target - -# Name "mysql - Win32 Release" -# Name "mysql - Win32 Debug" -# Name "mysql - Win32 Debug_TS" -# Name "mysql - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_mysql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mysql.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\Readme_w32.txt -# End Source File -# End Target -# End Project diff --git a/ext/mysql/mysql.mak b/ext/mysql/mysql.mak deleted file mode 100644 index 2ed0f82228c72..0000000000000 --- a/ext/mysql/mysql.mak +++ /dev/null @@ -1,169 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = phpmysql -MODULE_DESC = "PHP 4.3 - MySQL Extension" -VMAJ = 3 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# MYSQL stuff -MYSQL_DIR = P:/APPS/script/sw/mysql - -# Build type defaults to 'release' -ifndef BUILD -BUILD = release -endif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = php_mysql.c \ - start.c - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = $(MYSQL_DIR)/lib/libmysqlclient.lib - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS = -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -DNEW_LIBC -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_MYSQL=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(MYSQL_DIR)/include -C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include - - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics - C_FLAGS += -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - - -# Dependencies -MODULE = LibC \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.d: %.c - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.cpp - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.c - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - - -$(BINARY): $(OBJECTS) - @echo Import $(IMPORT) > $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/mysql/package.xml b/ext/mysql/package.xml deleted file mode 100644 index f1e0c2c1ad25e..0000000000000 --- a/ext/mysql/package.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>mysqli</name> - <summary>MySQL database access functions</summary> - <maintainers> - <maintainer> - <user>georg</user> - <name>Georg Richter</name> - <email>georg@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>zak</user> - <name>Zak Greant</name> - <email>zak@php.net</email> - <role>developer</role> - </maintainer> - <maintainer> - <user>zeev</user> - <name>Zeev Suraski</name> - <email>zeev@php.net</email> - <role>developer</role> - </maintainer> - </maintainers> - <description> -These functions allow you to access MySQL database servers. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <configureoptions> - <configureoption name="with-mysql" default="autodetect" prompt="mysql installation dir?"/> - <configureoption name="with-mysql-sock" default="autodetect" prompt="MySQL Unix socket?"/> - <configureoption name="with-zlib-dir" default="autodetect" prompt="zlib installation dir?"/> - </configureoptions> - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="doc" name="CREDITS"/> - <file role="src" name="mysql.dsp"/> - <file role="src" name="mysql.mak"/> - <file role="src" name="php_mysql.c"/> - <file role="src" name="php_mysql.h"/> - <file role="test" name="tests/001.phpt"/> - <file role="test" name="tests/002.phpt"/> - <file role="test" name="tests/003.phpt"/> - <file role="test" name="tests/connect.inc"/> - <file role="test" name="tests/skipif.inc"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c deleted file mode 100644 index a15986607ecb7..0000000000000 --- a/ext/mysql/php_mysql.c +++ /dev/null @@ -1,2524 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - | Zak Greant <zak@mysql.com> | - | Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* TODO: - * - * ? Safe mode implementation - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "zend_exceptions.h" - -#if HAVE_MYSQL - -#ifdef PHP_WIN32 -# include <winsock2.h> -# define signal(a, b) NULL -#elif defined(NETWARE) -# include <sys/socket.h> -# define signal(a, b) NULL -#else -# if HAVE_SIGNAL_H -# include <signal.h> -# endif -# if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif -# include <netdb.h> -# include <netinet/in.h> -# if HAVE_ARPA_INET_H -# include <arpa/inet.h> -# endif -#endif - -#include <mysql.h> -#include "php_ini.h" -#include "php_mysql.h" - -/* True globals, no need for thread safety */ -static int le_result, le_link, le_plink; - -#ifdef HAVE_MYSQL_REAL_CONNECT -# ifdef HAVE_ERRMSG_H -# include <errmsg.h> -# endif -#endif - -#define SAFE_STRING(s) ((s)?(s):"") - -#if MYSQL_VERSION_ID > 32199 -# define mysql_row_length_type unsigned long -# define HAVE_MYSQL_ERRNO -#else -# define mysql_row_length_type unsigned int -# ifdef mysql_errno -# define HAVE_MYSQL_ERRNO -# endif -#endif - -#if MYSQL_VERSION_ID >= 32032 -#define HAVE_GETINFO_FUNCS -#endif - -#if MYSQL_VERSION_ID > 32133 || defined(FIELD_TYPE_TINY) -#define MYSQL_HAS_TINY -#endif - -#if MYSQL_VERSION_ID >= 32200 -#define MYSQL_HAS_YEAR -#endif - -#define MYSQL_ASSOC 1<<0 -#define MYSQL_NUM 1<<1 -#define MYSQL_BOTH (MYSQL_ASSOC|MYSQL_NUM) - -#define MYSQL_USE_RESULT 0 -#define MYSQL_STORE_RESULT 1 - -#if MYSQL_VERSION_ID < 32224 -#define PHP_MYSQL_VALID_RESULT(mysql) \ - (mysql_num_fields(mysql)>0) -#else -#define PHP_MYSQL_VALID_RESULT(mysql) \ - (mysql_field_count(mysql)>0) -#endif - -typedef struct _php_mysql_conn { - MYSQL conn; - int active_result_id; -} php_mysql_conn; - -/* {{{ mysql_functions[] - */ -function_entry mysql_functions[] = { - PHP_FE(mysql_connect, NULL) - PHP_FE(mysql_pconnect, NULL) - PHP_FE(mysql_close, NULL) - PHP_FE(mysql_select_db, NULL) -#ifndef NETWARE /* The below two functions not supported on NetWare */ -#if MYSQL_VERSION_ID < 40000 - PHP_FE(mysql_create_db, NULL) - PHP_FE(mysql_drop_db, NULL) -#endif -#endif /* NETWARE */ - PHP_FE(mysql_query, NULL) - PHP_FE(mysql_unbuffered_query, NULL) - PHP_FE(mysql_db_query, NULL) - PHP_FE(mysql_list_dbs, NULL) - PHP_FE(mysql_list_tables, NULL) - PHP_FE(mysql_list_fields, NULL) - PHP_FE(mysql_list_processes, NULL) - PHP_FE(mysql_error, NULL) -#ifdef HAVE_MYSQL_ERRNO - PHP_FE(mysql_errno, NULL) -#endif - PHP_FE(mysql_affected_rows, NULL) - PHP_FE(mysql_insert_id, NULL) - PHP_FE(mysql_result, NULL) - PHP_FE(mysql_num_rows, NULL) - PHP_FE(mysql_num_fields, NULL) - PHP_FE(mysql_fetch_row, NULL) - PHP_FE(mysql_fetch_array, NULL) - PHP_FE(mysql_fetch_assoc, NULL) - PHP_FE(mysql_fetch_object, NULL) - PHP_FE(mysql_data_seek, NULL) - PHP_FE(mysql_fetch_lengths, NULL) - PHP_FE(mysql_fetch_field, NULL) - PHP_FE(mysql_field_seek, NULL) - PHP_FE(mysql_free_result, NULL) - PHP_FE(mysql_field_name, NULL) - PHP_FE(mysql_field_table, NULL) - PHP_FE(mysql_field_len, NULL) - PHP_FE(mysql_field_type, NULL) - PHP_FE(mysql_field_flags, NULL) - PHP_FE(mysql_escape_string, NULL) - PHP_FE(mysql_real_escape_string, NULL) - PHP_FE(mysql_stat, NULL) - PHP_FE(mysql_thread_id, NULL) - PHP_FE(mysql_client_encoding, NULL) - PHP_FE(mysql_ping, NULL) -#ifdef HAVE_GETINFO_FUNCS - PHP_FE(mysql_get_client_info, NULL) - PHP_FE(mysql_get_host_info, NULL) - PHP_FE(mysql_get_proto_info, NULL) - PHP_FE(mysql_get_server_info, NULL) -#endif - - PHP_FE(mysql_info, NULL) - - /* for downwards compatability */ - PHP_FALIAS(mysql, mysql_db_query, NULL) - PHP_FALIAS(mysql_fieldname, mysql_field_name, NULL) - PHP_FALIAS(mysql_fieldtable, mysql_field_table, NULL) - PHP_FALIAS(mysql_fieldlen, mysql_field_len, NULL) - PHP_FALIAS(mysql_fieldtype, mysql_field_type, NULL) - PHP_FALIAS(mysql_fieldflags, mysql_field_flags, NULL) - PHP_FALIAS(mysql_selectdb, mysql_select_db, NULL) -#ifndef NETWARE /* The below two functions not supported on NetWare */ -#if MYSQL_VERSION_ID < 40000 - PHP_FALIAS(mysql_createdb, mysql_create_db, NULL) - PHP_FALIAS(mysql_dropdb, mysql_drop_db, NULL) -#endif -#endif /* NETWARE */ - PHP_FALIAS(mysql_freeresult, mysql_free_result, NULL) - PHP_FALIAS(mysql_numfields, mysql_num_fields, NULL) - PHP_FALIAS(mysql_numrows, mysql_num_rows, NULL) - PHP_FALIAS(mysql_listdbs, mysql_list_dbs, NULL) - PHP_FALIAS(mysql_listtables, mysql_list_tables, NULL) - PHP_FALIAS(mysql_listfields, mysql_list_fields, NULL) - PHP_FALIAS(mysql_db_name, mysql_result, NULL) - PHP_FALIAS(mysql_dbname, mysql_result, NULL) - PHP_FALIAS(mysql_tablename, mysql_result, NULL) - PHP_FALIAS(mysql_table_name, mysql_result, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ mysql_module_entry - */ -zend_module_entry mysql_module_entry = { - STANDARD_MODULE_HEADER, - "mysql", - mysql_functions, - ZEND_MODULE_STARTUP_N(mysql), - PHP_MSHUTDOWN(mysql), - PHP_RINIT(mysql), - PHP_RSHUTDOWN(mysql), - PHP_MINFO(mysql), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(mysql) - -#ifdef COMPILE_DL_MYSQL -ZEND_GET_MODULE(mysql) -#endif - -void timeout(int sig); - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } } - -#define PHPMY_UNBUFFERED_QUERY_CHECK() \ -{ \ - if (mysql->active_result_id) { \ - do { \ - int type; \ - MYSQL_RES *mysql_result; \ - \ - mysql_result = (MYSQL_RES *) zend_list_find(mysql->active_result_id, &type); \ - if (mysql_result && type==le_result) { \ - if (!mysql_eof(mysql_result)) { \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Function called without first fetching all rows from a previous unbuffered query"); \ - while (mysql_fetch_row(mysql_result)); \ - } \ - zend_list_delete(mysql->active_result_id); \ - mysql->active_result_id = 0; \ - } \ - } while(0); \ - } \ -} \ - -/* {{{ _free_mysql_result - * This wrapper is required since mysql_free_result() returns an integer, and - * thus, cannot be used directly - */ -static void _free_mysql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - MYSQL_RES *mysql_result = (MYSQL_RES *)rsrc->ptr; - - mysql_free_result(mysql_result); - MySG(result_allocated)--; -} -/* }}} */ - -/* {{{ php_mysql_set_default_link - */ -static void php_mysql_set_default_link(int id TSRMLS_DC) -{ - if (MySG(default_link) != -1) { - zend_list_delete(MySG(default_link)); - } - MySG(default_link) = id; - zend_list_addref(id); -} -/* }}} */ - -/* {{{ php_mysql_select_db -*/ -static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC) -{ - PHPMY_UNBUFFERED_QUERY_CHECK(); - - if (mysql_select_db(&mysql->conn, db) != 0) { - return 0; - } else { - return 1; - } -} -/* }}} */ - -/* {{{ _close_mysql_link - */ -static void _close_mysql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr; - void (*handler) (int); - - handler = signal(SIGPIPE, SIG_IGN); - mysql_close(&link->conn); - signal(SIGPIPE, handler); - efree(link); - MySG(num_links)--; -} -/* }}} */ - -/* {{{ _close_mysql_plink - */ -static void _close_mysql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr; - void (*handler) (int); - - handler = signal(SIGPIPE, SIG_IGN); - mysql_close(&link->conn); - signal(SIGPIPE, handler); - - free(link); - MySG(num_persistent)--; - MySG(num_links)--; -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnMySQLPort) -{ - if (new_value != NULL) { /* default port */ - MySG(default_port) = atoi(new_value); - } else { - MySG(default_port) = -1; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("mysql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY_EX("mysql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_mysql_globals, mysql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("mysql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_mysql_globals, mysql_globals, display_link_numbers) - STD_PHP_INI_ENTRY("mysql.default_host", NULL, PHP_INI_ALL, OnUpdateString, default_host, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY("mysql.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY("mysql.default_password", NULL, PHP_INI_ALL, OnUpdateString, default_password, zend_mysql_globals, mysql_globals) - PHP_INI_ENTRY("mysql.default_port", NULL, PHP_INI_ALL, OnMySQLPort) - STD_PHP_INI_ENTRY("mysql.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysql_globals, mysql_globals) - STD_PHP_INI_ENTRY("mysql.connect_timeout", "60", PHP_INI_ALL, OnUpdateLong, connect_timeout, zend_mysql_globals, mysql_globals) - STD_PHP_INI_BOOLEAN("mysql.trace_mode", "0", PHP_INI_ALL, OnUpdateLong, trace_mode, zend_mysql_globals, mysql_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_mysql_init_globals - */ -static void php_mysql_init_globals(zend_mysql_globals *mysql_globals) -{ - mysql_globals->num_persistent = 0; - mysql_globals->default_socket = NULL; - mysql_globals->default_host = NULL; - mysql_globals->default_user = NULL; - mysql_globals->default_password = NULL; - mysql_globals->connect_errno = 0; - mysql_globals->connect_error = NULL; - mysql_globals->connect_timeout = 0; - mysql_globals->trace_mode = 0; - mysql_globals->result_allocated = 0; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -ZEND_MODULE_STARTUP_D(mysql) -{ - ZEND_INIT_MODULE_GLOBALS(mysql, php_mysql_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - le_result = zend_register_list_destructors_ex(_free_mysql_result, NULL, "mysql result", module_number); - le_link = zend_register_list_destructors_ex(_close_mysql_link, NULL, "mysql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_mysql_plink, "mysql link persistent", module_number); - Z_TYPE(mysql_module_entry) = type; - - REGISTER_LONG_CONSTANT("MYSQL_ASSOC", MYSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQL_NUM", MYSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQL_BOTH", MYSQL_BOTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQL_CLIENT_COMPRESS", CLIENT_COMPRESS, CONST_CS | CONST_PERSISTENT); -#if MYSQL_VERSION_ID >= 40000 - REGISTER_LONG_CONSTANT("MYSQL_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("MYSQL_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQL_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT); - - -#ifdef ZTS -# if MYSQL_VERSION_ID >= 40000 - mysql_thread_init(); -# endif -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(mysql) -{ -#ifdef ZTS -# if MYSQL_VERSION_ID >= 40000 - mysql_thread_end(); -# endif -#endif - - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(mysql) -{ - MySG(default_link)=-1; - MySG(num_links) = MySG(num_persistent); - /* Reset connect error/errno on every request */ - MySG(connect_error) = NULL; - MySG(connect_errno) =0; - MySG(result_allocated) = 0; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(mysql) -{ - if (MySG(trace_mode)) { - if (MySG(result_allocated)){ - php_error_docref("function.mysql-free-result" TSRMLS_CC, E_WARNING, "%lu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated)); - } - } - - if (MySG(connect_error)!=NULL) { - efree(MySG(connect_error)); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(mysql) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "MySQL Support", "enabled"); - sprintf(buf, "%ld", MySG(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - sprintf(buf, "%ld", MySG(num_links)); - php_info_print_table_row(2, "Active Links", buf); - php_info_print_table_row(2, "Client API version", mysql_get_client_info()); -#if !defined (PHP_WIN32) && !defined (NETWARE) - php_info_print_table_row(2, "MYSQL_MODULE_TYPE", PHP_MYSQL_TYPE); - php_info_print_table_row(2, "MYSQL_SOCKET", MYSQL_UNIX_ADDR); - php_info_print_table_row(2, "MYSQL_INCLUDE", PHP_MYSQL_INCLUDE); - php_info_print_table_row(2, "MYSQL_LIBS", PHP_MYSQL_LIBS); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - -} -/* }}} */ - -/* {{{ php_mysql_do_connect - */ -#define MYSQL_DO_CONNECT_CLEANUP() \ - if (free_host) { \ - efree(host); \ - } - -#define MYSQL_DO_CONNECT_RETURN_FALSE() \ - MYSQL_DO_CONNECT_CLEANUP(); \ - RETURN_FALSE; - -static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL; - char *hashed_details=NULL; - int hashed_details_length, port = MYSQL_PORT; - int client_flags = 0; - php_mysql_conn *mysql=NULL; -#if MYSQL_VERSION_ID <= 32230 - void (*handler) (int); -#endif - zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL, **z_new_link=NULL, **z_client_flags=NULL; - zend_bool free_host=0, new_link=0; - long connect_timeout; - - - connect_timeout = MySG(connect_timeout); - - socket = MySG(default_socket); - - if (MySG(default_port) < 0) { -#if !defined(PHP_WIN32) && !defined(NETWARE) - struct servent *serv_ptr; - char *env; - - MySG(default_port) = MYSQL_PORT; - if ((serv_ptr = getservbyname("mysql", "tcp"))) { - MySG(default_port) = (uint) ntohs((ushort) serv_ptr->s_port); - } - if ((env = getenv("MYSQL_TCP_PORT"))) { - MySG(default_port) = (uint) atoi(env); - } -#else - MySG(default_port) = MYSQL_PORT; -#endif - } - - if (PG(sql_safe_mode)) { - if (ZEND_NUM_ARGS()>0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information"); - } - host_and_port=passwd=NULL; - user=php_get_current_user(); - hashed_details_length = strlen(user)+5+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "mysql__%s_", user); - client_flags = CLIENT_INTERACTIVE; - } else { - host_and_port = MySG(default_host); - user = MySG(default_user); - passwd = MySG(default_password); - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - break; - case 1: { - if (zend_get_parameters_ex(1, &z_host)==FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - } - break; - case 2: { - if (zend_get_parameters_ex(2, &z_host, &z_user)==FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - convert_to_string_ex(z_user); - user = Z_STRVAL_PP(z_user); - } - break; - case 3: { - if (zend_get_parameters_ex(3, &z_host, &z_user, &z_passwd) == FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - convert_to_string_ex(z_user); - convert_to_string_ex(z_passwd); - user = Z_STRVAL_PP(z_user); - passwd = Z_STRVAL_PP(z_passwd); - } - break; - case 4: { - if (!persistent) { - if (zend_get_parameters_ex(4, &z_host, &z_user, &z_passwd, &z_new_link) == FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - convert_to_string_ex(z_user); - convert_to_string_ex(z_passwd); - convert_to_boolean_ex(z_new_link); - user = Z_STRVAL_PP(z_user); - passwd = Z_STRVAL_PP(z_passwd); - new_link = Z_BVAL_PP(z_new_link); - } - else { - if (zend_get_parameters_ex(4, &z_host, &z_user, &z_passwd, &z_client_flags) == FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - convert_to_string_ex(z_user); - convert_to_string_ex(z_passwd); - convert_to_long_ex(z_client_flags); - user = Z_STRVAL_PP(z_user); - passwd = Z_STRVAL_PP(z_passwd); - client_flags = Z_LVAL_PP(z_client_flags); - } - } - break; - case 5: { - if (zend_get_parameters_ex(5, &z_host, &z_user, &z_passwd, &z_new_link, &z_client_flags) == FAILURE) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - convert_to_string_ex(z_user); - convert_to_string_ex(z_passwd); - convert_to_boolean_ex(z_new_link); - convert_to_long_ex(z_client_flags); - user = Z_STRVAL_PP(z_user); - passwd = Z_STRVAL_PP(z_passwd); - new_link = Z_BVAL_PP(z_new_link); - client_flags = Z_LVAL_PP(z_client_flags); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - /* disable local infile option for open_basedir */ - if (PG(open_basedir) && strlen(PG(open_basedir)) && (client_flags & CLIENT_LOCAL_FILES)) { - client_flags ^= CLIENT_LOCAL_FILES; - } - - if (z_host) { - SEPARATE_ZVAL(z_host); /* We may modify z_host if it contains a port, separate */ - convert_to_string_ex(z_host); - host_and_port = Z_STRVAL_PP(z_host); - if (z_user) { - convert_to_string_ex(z_user); - user = Z_STRVAL_PP(z_user); - if (z_passwd) { - convert_to_string_ex(z_passwd); - passwd = Z_STRVAL_PP(z_passwd); - } - } - } - - hashed_details_length = sizeof("mysql___")-1 + strlen(SAFE_STRING(host_and_port))+strlen(SAFE_STRING(user))+strlen(SAFE_STRING(passwd)); - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "mysql_%s_%s_%s", SAFE_STRING(host_and_port), SAFE_STRING(user), SAFE_STRING(passwd)); - } - - /* We cannot use mysql_port anymore in windows, need to use - * mysql_real_connect() to set the port. - */ - if (host_and_port && (tmp=strchr(host_and_port, ':'))) { - host = estrndup(host_and_port, tmp-host_and_port); - free_host = 1; - tmp++; - if (tmp[0] != '/') { - port = atoi(tmp); - if ((tmp=strchr(tmp, ':'))) { - tmp++; - socket=tmp; - } - } else { - socket = tmp; - } - } else { - host = host_and_port; - port = MySG(default_port); - } - -#if MYSQL_VERSION_ID < 32200 - mysql_port = port; -#endif - - if (!MySG(allow_persistent)) { - persistent=0; - } - if (persistent) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - if (MySG(max_links)!=-1 && MySG(num_links)>=MySG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MySG(num_links)); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - if (MySG(max_persistent)!=-1 && MySG(num_persistent)>=MySG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MySG(num_persistent)); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - /* create the link */ - mysql = (php_mysql_conn *) malloc(sizeof(php_mysql_conn)); - mysql->active_result_id = 0; -#if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ - mysql_init(&mysql->conn); - - if (connect_timeout != -1) - mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); - - if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) { -#else - if (mysql_connect(&mysql->conn, host, user, passwd)==NULL) { -#endif - /* Populate connect error globals so that the error functions can read them */ - if (MySG(connect_error)!=NULL) efree(MySG(connect_error)); - MySG(connect_error)=estrdup(mysql_error(&mysql->conn)); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error)); -#if defined(HAVE_MYSQL_ERRNO) - MySG(connect_errno)=mysql_errno(&mysql->conn); -#endif - free(mysql); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - - /* hash it up */ - Z_TYPE(new_le) = le_plink; - new_le.ptr = mysql; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { - free(mysql); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - MySG(num_persistent)++; - MySG(num_links)++; - } else { /* The link is in our list of persistent connections */ - if (Z_TYPE_P(le) != le_plink) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - /* ensure that the link did not die */ -#if MYSQL_VERSION_ID > 32230 /* Use mysql_ping to ensure link is alive (and to reconnect if needed) */ - if (mysql_ping(le->ptr)) { -#else /* Use mysql_stat() to check if server is alive */ - handler=signal(SIGPIPE, SIG_IGN); -#if defined(HAVE_MYSQL_ERRNO) && defined(CR_SERVER_GONE_ERROR) - mysql_stat(le->ptr); - if (mysql_errno(&((php_mysql_conn *) le->ptr)->conn) == CR_SERVER_GONE_ERROR) { -#else - if (!strcasecmp(mysql_stat(le->ptr), "mysql server has gone away")) { /* the link died */ -#endif - signal(SIGPIPE, handler); -#endif /* end mysql_ping */ -#if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ - if (mysql_real_connect(le->ptr, host, user, passwd, NULL, port, socket, client_flags)==NULL) { -#else - if (mysql_connect(le->ptr, host, user, passwd)==NULL) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect"); - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - } -#if MYSQL_VERSION_ID < 32231 - signal(SIGPIPE, handler); -#endif - - mysql = (php_mysql_conn *) le->ptr; - } - ZEND_REGISTER_RESOURCE(return_value, mysql, le_plink); - } else { /* non persistent */ - list_entry *index_ptr, new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual mysql link sits. - * if it doesn't, open a new mysql link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (!new_link && zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { - int type; - long link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - link = (long) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = link; - php_mysql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - efree(hashed_details); - MYSQL_DO_CONNECT_CLEANUP(); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); - } - } - if (MySG(max_links)!=-1 && MySG(num_links)>=MySG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MySG(num_links)); - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - - mysql = (php_mysql_conn *) emalloc(sizeof(php_mysql_conn)); - mysql->active_result_id = 0; -#if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ - mysql_init(&mysql->conn); - - if (connect_timeout != -1) - mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); - - if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) { -#else - if (mysql_connect(&mysql->conn, host, user, passwd)==NULL) { -#endif - /* Populate connect error globals so that the error functions can read them */ - if (MySG(connect_error)!=NULL) efree(MySG(connect_error)); - MySG(connect_error)=estrdup(mysql_error(&mysql->conn)); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error)); -#if defined(HAVE_MYSQL_ERRNO) - MySG(connect_errno)=mysql_errno(&mysql->conn); -#endif - efree(hashed_details); - efree(mysql); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, mysql, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { - efree(hashed_details); - MYSQL_DO_CONNECT_RETURN_FALSE(); - } - MySG(num_links)++; - } - - efree(hashed_details); - php_mysql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); - MYSQL_DO_CONNECT_CLEANUP(); -} -/* }}} */ - -/* {{{ php_mysql_get_default_link - */ -static int php_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (MySG(default_link)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return MySG(default_link); -} -/* }}} */ - -/* {{{ proto resource mysql_connect([string hostname[:port][:/path/to/socket] [, string username [, string password [, bool new [, int flags]]]]]) - Opens a connection to a MySQL Server */ -PHP_FUNCTION(mysql_connect) -{ - php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource mysql_pconnect([string hostname[:port][:/path/to/socket] [, string username [, string password [, int flags]]]]) - Opens a persistent connection to a MySQL Server */ -PHP_FUNCTION(mysql_pconnect) -{ - php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool mysql_close([int link_identifier]) - Close a MySQL connection */ -PHP_FUNCTION(mysql_close) -{ - zval **mysql_link=NULL; - int id; - php_mysql_conn *mysql; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = MySG(default_link); - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - if (id==-1) { /* explicit resource number */ - PHPMY_UNBUFFERED_QUERY_CHECK(); - zend_list_delete(Z_RESVAL_PP(mysql_link)); - } - - if (id!=-1 - || (mysql_link && Z_RESVAL_PP(mysql_link)==MySG(default_link))) { - PHPMY_UNBUFFERED_QUERY_CHECK(); - zend_list_delete(MySG(default_link)); - MySG(default_link) = -1; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysql_select_db(string database_name [, int link_identifier]) - Selects a MySQL database */ -PHP_FUNCTION(mysql_select_db) -{ - zval **db, **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - convert_to_string_ex(db); - - if (php_mysql_select_db(mysql, Z_STRVAL_PP(db) TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -#ifdef HAVE_GETINFO_FUNCS - -/* {{{ proto string mysql_get_client_info(void) - Returns a string that represents the client library version */ -PHP_FUNCTION(mysql_get_client_info) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_STRING((char *)mysql_get_client_info(),1); -} -/* }}} */ - -/* {{{ proto string mysql_get_host_info([int link_identifier]) - Returns a string describing the type of connection in use, including the server host name */ -PHP_FUNCTION(mysql_get_host_info) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1,&mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_STRING((char *)mysql_get_host_info(&mysql->conn),1); -} -/* }}} */ - -/* {{{ proto int mysql_get_proto_info([int link_identifier]) - Returns the protocol version used by current connection */ -PHP_FUNCTION(mysql_get_proto_info) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1,&mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_LONG(mysql_get_proto_info(&mysql->conn)); -} -/* }}} */ - -/* {{{ proto string mysql_get_server_info([int link_identifier]) - Returns a string that represents the server version number */ -PHP_FUNCTION(mysql_get_server_info) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1,&mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_STRING((char *)mysql_get_server_info(&mysql->conn),1); -} -/* }}} */ - -/* {{{ proto string mysql_info([int link_identifier]) - Returns a string containing information about the most recent query */ -PHP_FUNCTION(mysql_info) -{ - zval *mysql_link; - int id = -1; - char *str; - php_mysql_conn *mysql; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 0) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - if ((str = (char *)mysql_info(&mysql->conn))) { - RETURN_STRING(str,1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int mysql_thread_id([int link_identifier]) - Returns the thread id of current connection */ -PHP_FUNCTION(mysql_thread_id) -{ - zval *mysql_link = NULL; - int id = -1; - php_mysql_conn *mysql; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 0) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_LONG(mysql_thread_id(&mysql->conn)); -} -/* }}} */ - -/* {{{ proto string mysql_stat([int link_identifier]) - Returns a string containing status information */ -PHP_FUNCTION(mysql_stat) -{ - zval *mysql_link = NULL; - int id = -1; - php_mysql_conn *mysql; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 0) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - RETURN_STRING((char *)mysql_stat(&mysql->conn), 1); -} -/* }}} */ - -/* {{{ proto string mysql_client_encoding([int link_identifier]) - Returns the default character set for the current connection */ -PHP_FUNCTION(mysql_client_encoding) -{ - zval *mysql_link = NULL; - int id = -1; - php_mysql_conn *mysql; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 0) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_STRING((char *)mysql_character_set_name(&mysql->conn), 1); -} -/* }}} */ -#endif - -#ifndef NETWARE /* The below two functions not supported on NetWare */ -#if MYSQL_VERSION_ID < 40000 -/* {{{ proto bool mysql_create_db(string database_name [, int link_identifier]) - Create a MySQL database */ -PHP_FUNCTION(mysql_create_db) -{ - zval **db, **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated, please use mysql_query() to issue a SQL CREATE DATABASE statement instead."); - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - convert_to_string_ex(db); - - if (mysql_create_db(&mysql->conn, Z_STRVAL_PP(db))==0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool mysql_drop_db(string database_name [, int link_identifier]) - Drops (delete) a MySQL database */ -PHP_FUNCTION(mysql_drop_db) -{ - zval **db, **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated, please use mysql_query() to issue a SQL DROP DATABASE statement instead."); - - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - convert_to_string_ex(db); - - if (mysql_drop_db(&mysql->conn, Z_STRVAL_PP(db))==0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif -#endif /* NETWARE */ - -/* {{{ php_mysql_do_query_general - */ -static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link_id, zval **db, int use_store, zval *return_value TSRMLS_DC) -{ - php_mysql_conn *mysql; - MYSQL_RES *mysql_result; - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, link_id, "MySQL-Link", le_link, le_plink); - - if (db) { - convert_to_string_ex(db); - if (!php_mysql_select_db(mysql, Z_STRVAL_PP(db) TSRMLS_CC)) { - RETURN_FALSE; - } - } - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - convert_to_string_ex(query); - - /* check explain */ - if (MySG(trace_mode)) { - if (!strncasecmp("select", Z_STRVAL_PP(query), 6)){ - MYSQL_ROW row; - - char *newquery = (char *)emalloc(Z_STRLEN_PP(query) + 10); - sprintf ((char *)newquery, "EXPLAIN %s", Z_STRVAL_PP(query)); - mysql_real_query(&mysql->conn, newquery, strlen(newquery)); - efree (newquery); - if (mysql_errno(&mysql->conn)) { - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(&mysql->conn)); - RETURN_FALSE; - } - else { - mysql_result = mysql_use_result(&mysql->conn); - while ((row = mysql_fetch_row(mysql_result))) { - if (!strcmp("ALL", row[1])) { - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); - } else if (!strcmp("INDEX", row[1])) { - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); - } - } - mysql_free_result(mysql_result); - } - } - } /* end explain */ - - /* mysql_query is binary unsafe, use mysql_real_query */ -#if MYSQL_VERSION_ID > 32199 - if (mysql_real_query(&mysql->conn, Z_STRVAL_PP(query), Z_STRLEN_PP(query))!=0) { - /* check possible error */ - if (MySG(trace_mode)){ - if (mysql_errno(&mysql->conn)){ - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(&mysql->conn)); - } - } - RETURN_FALSE; - } -#else - if (mysql_query(&mysql->conn, Z_STRVAL_PP(query))!=0) { - /* check possible error */ - if (MySG(trace_mode)){ - if (mysql_errno(&mysql->conn)){ - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(&mysql->conn)); - } - } - RETURN_FALSE; - } -#endif - if(use_store == MYSQL_USE_RESULT) { - mysql_result=mysql_use_result(&mysql->conn); - } else { - mysql_result=mysql_store_result(&mysql->conn); - } - if (!mysql_result) { - if (PHP_MYSQL_VALID_RESULT(&mysql->conn)) { /* query should have returned rows */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save result set"); - RETURN_FALSE; - } else { - RETURN_TRUE; - } - } - MySG(result_allocated)++; - ZEND_REGISTER_RESOURCE(return_value, mysql_result, le_result); - if (use_store == MYSQL_USE_RESULT) { - mysql->active_result_id = Z_LVAL_P(return_value); - } -} -/* }}} */ - -/* {{{ php_mysql_do_query - */ -static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store) -{ - zval **query, **mysql_link; - int id; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &query, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - php_mysql_do_query_general(query, mysql_link, id, NULL, use_store, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto resource mysql_query(string query [, int link_identifier]) - Sends an SQL query to MySQL */ -PHP_FUNCTION(mysql_query) -{ - php_mysql_do_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_STORE_RESULT); -} -/* }}} */ - - -/* {{{ proto resource mysql_unbuffered_query(string query [, int link_identifier]) - Sends an SQL query to MySQL, without fetching and buffering the result rows */ -PHP_FUNCTION(mysql_unbuffered_query) -{ - php_mysql_do_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_USE_RESULT); -} -/* }}} */ - - -/* {{{ proto resource mysql_db_query(string database_name, string query [, int link_identifier]) - Sends an SQL query to MySQL */ -PHP_FUNCTION(mysql_db_query) -{ - zval **db, **query, **mysql_link; - int id; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &db, &query)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 3: - if (zend_get_parameters_ex(3, &db, &query, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (MySG(trace_mode) || !strcasecmp(get_active_function_name(TSRMLS_C), "mysql")) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated; use mysql_query() instead."); - } - - php_mysql_do_query_general(query, mysql_link, id, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC); -} -/* }}} */ - - -/* {{{ proto resource mysql_list_dbs([int link_identifier]) - List databases available on a MySQL server */ -PHP_FUNCTION(mysql_list_dbs) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - MYSQL_RES *mysql_result; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - if ((mysql_result=mysql_list_dbs(&mysql->conn, NULL))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, mysql_result, le_result); -} -/* }}} */ - - -/* {{{ proto resource mysql_list_tables(string database_name [, int link_identifier]) - List tables in a MySQL database */ -PHP_FUNCTION(mysql_list_tables) -{ - zval **db, **mysql_link; - int id; - php_mysql_conn *mysql; - MYSQL_RES *mysql_result; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "mysql_list_tables() is deprecated"); - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - convert_to_string_ex(db); - if (!php_mysql_select_db(mysql, Z_STRVAL_PP(db) TSRMLS_CC)) { - RETURN_FALSE; - } - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - if ((mysql_result=mysql_list_tables(&mysql->conn, NULL))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, mysql_result, le_result); -} -/* }}} */ - - -/* {{{ proto resource mysql_list_fields(string database_name, string table_name [, int link_identifier]) - List MySQL result fields */ -PHP_FUNCTION(mysql_list_fields) -{ - zval **db, **table, **mysql_link; - int id; - php_mysql_conn *mysql; - MYSQL_RES *mysql_result; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &db, &table)==FAILURE) { - RETURN_FALSE; - } - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 3: - if (zend_get_parameters_ex(3, &db, &table, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - convert_to_string_ex(db); - if (!php_mysql_select_db(mysql, Z_STRVAL_PP(db) TSRMLS_CC)) { - RETURN_FALSE; - } - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - convert_to_string_ex(table); - if ((mysql_result=mysql_list_fields(&mysql->conn, Z_STRVAL_PP(table), NULL))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result"); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, mysql_result, le_result); -} -/* }}} */ - -/* {{{ proto resource mysql_list_processes([int link_identifier]) - Returns a result set describing the current server threads */ -PHP_FUNCTION(mysql_list_processes) -{ - zval *mysql_link = NULL; - int id = -1; - php_mysql_conn *mysql; - MYSQL_RES *mysql_result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 0) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - mysql_result = mysql_list_processes(&mysql->conn); - if (mysql_result == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result"); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, mysql_result, le_result); -} -/* }}} */ - - -/* {{{ proto string mysql_error([int link_identifier]) - Returns the text of the error message from previous MySQL operation */ -PHP_FUNCTION(mysql_error) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = MySG(default_link); - if (id==-1) { - if (MySG(connect_error)!=NULL){ - RETURN_STRING(MySG(connect_error),1); - } else { - RETURN_FALSE; - } - } - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_STRING((char *)mysql_error(&mysql->conn), 1); -} -/* }}} */ - - -/* {{{ proto int mysql_errno([int link_identifier]) - Returns the number of the error message from previous MySQL operation */ -#ifdef HAVE_MYSQL_ERRNO -PHP_FUNCTION(mysql_errno) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = MySG(default_link); - if (id==-1) { - if (MySG(connect_errno)!=0){ - RETURN_LONG(MySG(connect_errno)); - } else { - RETURN_FALSE; - } - } - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - RETURN_LONG(mysql_errno(&mysql->conn)); -} -#endif -/* }}} */ - - -/* {{{ proto int mysql_affected_rows([int link_identifier]) - Gets number of affected rows in previous MySQL operation */ -PHP_FUNCTION(mysql_affected_rows) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = MySG(default_link); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - /* conversion from int64 to long happing here */ - Z_LVAL_P(return_value) = (long) mysql_affected_rows(&mysql->conn); - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - - -/* {{{ proto string mysql_escape_string(string to_be_escaped) - Escape string for mysql query */ -PHP_FUNCTION(mysql_escape_string) -{ - zval **str; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(str); - /* assume worst case situation, which is 2x of the original string. - * we don't realloc() down to the real size since it'd most probably not - * be worth it - */ - - Z_STRVAL_P(return_value) = (char *) safe_emalloc(Z_STRLEN_PP(str), 2, 1); - Z_STRLEN_P(return_value) = mysql_escape_string(Z_STRVAL_P(return_value), Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - Z_TYPE_P(return_value) = IS_STRING; - - if (MySG(trace_mode)){ - php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_WARNING, "This function is deprecated; use mysql_real_escape_string() instead."); - } - -} -/* }}} */ - -/* {{{ proto string mysql_real_escape_string(string to_be_escaped [, int link_identifier]) - Escape special characters in a string for use in a SQL statement, taking into account the current charset of the connection */ -PHP_FUNCTION(mysql_real_escape_string) -{ - zval *mysql_link = NULL; - char *str; - char *new_str; - int id = -1, str_len, new_str_len; - php_mysql_conn *mysql; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &str, &str_len, &mysql_link) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 1) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - new_str = safe_emalloc(str_len, 2, 1); - new_str_len = mysql_real_escape_string(&mysql->conn, new_str, str, str_len); - new_str = erealloc(new_str, new_str_len + 1); - - RETURN_STRINGL(new_str, new_str_len, 0); -} -/* }}} */ - -/* {{{ proto int mysql_insert_id([int link_identifier]) - Gets the ID generated from the previous INSERT operation */ -PHP_FUNCTION(mysql_insert_id) -{ - zval **mysql_link; - int id; - php_mysql_conn *mysql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = MySG(default_link); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &mysql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); - - /* conversion from int64 to long happing here */ - Z_LVAL_P(return_value) = (long) mysql_insert_id(&mysql->conn); - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - - -/* {{{ proto mixed mysql_result(resource result, int row [, mixed field]) - Gets result data */ -PHP_FUNCTION(mysql_result) -{ - zval **result, **row, **field=NULL; - MYSQL_RES *mysql_result; - MYSQL_ROW sql_row; - mysql_row_length_type *sql_row_lengths; - int field_offset=0; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &result, &row)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &result, &row, &field)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - convert_to_long_ex(row); - if (Z_LVAL_PP(row)<0 || Z_LVAL_PP(row)>=(int)mysql_num_rows(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on MySQL result index %ld", Z_LVAL_PP(row), Z_LVAL_PP(result)); - RETURN_FALSE; - } - mysql_data_seek(mysql_result, Z_LVAL_PP(row)); - if ((sql_row=mysql_fetch_row(mysql_result))==NULL - || (sql_row_lengths=mysql_fetch_lengths(mysql_result))==NULL) { /* shouldn't happen? */ - RETURN_FALSE; - } - - if (field) { - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i=0; - MYSQL_FIELD *tmp_field; - char *table_name, *field_name, *tmp; - - if ((tmp=strchr(Z_STRVAL_PP(field), '.'))) { - table_name = estrndup(Z_STRVAL_PP(field), tmp-Z_STRVAL_PP(field)); - field_name = estrdup(tmp+1); - } else { - table_name = NULL; - field_name = estrndup(Z_STRVAL_PP(field),Z_STRLEN_PP(field)); - } - mysql_field_seek(mysql_result, 0); - while ((tmp_field=mysql_fetch_field(mysql_result))) { - if ((!table_name || !strcasecmp(tmp_field->table, table_name)) && !strcasecmp(tmp_field->name, field_name)) { - field_offset = i; - break; - } - i++; - } - if (!tmp_field) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in MySQL result index %ld", - (table_name?table_name:""), (table_name?".":""), field_name, Z_LVAL_PP(result)); - efree(field_name); - if (table_name) { - efree(table_name); - } - RETURN_FALSE; - } - efree(field_name); - if (table_name) { - efree(table_name); - } - } - break; - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=(int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - break; - } - } - - if (sql_row[field_offset]) { - Z_TYPE_P(return_value) = IS_STRING; - - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(return_value) = php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset],&Z_STRLEN_P(return_value), 0 TSRMLS_CC); - } else { - Z_STRLEN_P(return_value) = sql_row_lengths[field_offset]; - Z_STRVAL_P(return_value) = (char *) safe_estrndup(sql_row[field_offset], Z_STRLEN_P(return_value)); - } - } else { - Z_TYPE_P(return_value) = IS_NULL; - } -} -/* }}} */ - - -/* {{{ proto int mysql_num_rows(resource result) - Gets number of rows in a result */ -PHP_FUNCTION(mysql_num_rows) -{ - zval **result; - MYSQL_RES *mysql_result; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - /* conversion from int64 to long happing here */ - Z_LVAL_P(return_value) = (long) mysql_num_rows(mysql_result); - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto int mysql_num_fields(resource result) - Gets number of fields in a result */ -PHP_FUNCTION(mysql_num_fields) -{ - zval **result; - MYSQL_RES *mysql_result; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - Z_LVAL_P(return_value) = mysql_num_fields(mysql_result); - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ php_mysql_fetch_hash - */ -static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args, int into_object) -{ - zval **result, **arg2; - MYSQL_RES *mysql_result; - MYSQL_ROW mysql_row; - MYSQL_FIELD *mysql_field; - mysql_row_length_type *mysql_row_lengths; - int i; - zval *res, *ctor_params = NULL; - zend_class_entry *ce; - - if (into_object) { - char *class_name; - int class_name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|sz", &res, &class_name, &class_name_len, &ctor_params) == FAILURE) { - return; - } - result = &res; - if (ZEND_NUM_ARGS() < 2) { - ce = zend_standard_class_def; - } else { - ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - } - if (!ce) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); - return; - } - result_type = MYSQL_ASSOC; - } else { - if (ZEND_NUM_ARGS() > expected_args) { - WRONG_PARAM_COUNT; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result)==FAILURE) { - RETURN_FALSE; - } - if (!result_type) { - result_type = MYSQL_BOTH; - } - break; - case 2: - if (zend_get_parameters_ex(2, &result, &arg2)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(arg2); - result_type = Z_LVAL_PP(arg2); - break; - default: - WRONG_PARAM_COUNT; - break; - } - } - - if ((result_type & MYSQL_BOTH) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH."); - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - if ((mysql_row=mysql_fetch_row(mysql_result))==NULL - || (mysql_row_lengths=mysql_fetch_lengths(mysql_result))==NULL) { - RETURN_FALSE; - } - - array_init(return_value); - - mysql_field_seek(mysql_result, 0); - for (mysql_field=mysql_fetch_field(mysql_result), i=0; mysql_field; mysql_field=mysql_fetch_field(mysql_result), i++) { - if (mysql_row[i]) { - zval *data; - - MAKE_STD_ZVAL(data); - - if (PG(magic_quotes_runtime)) { - Z_TYPE_P(data) = IS_STRING; - Z_STRVAL_P(data) = php_addslashes(mysql_row[i], mysql_row_lengths[i], &Z_STRLEN_P(data), 0 TSRMLS_CC); - } else { - ZVAL_STRINGL(data, mysql_row[i], mysql_row_lengths[i], 1); - } - - if (result_type & MYSQL_NUM) { - add_index_zval(return_value, i, data); - } - if (result_type & MYSQL_ASSOC) { - if (result_type & MYSQL_NUM) { - ZVAL_ADDREF(data); - } - add_assoc_zval(return_value, mysql_field->name, data); - } - } else { - /* NULL value. */ - if (result_type & MYSQL_NUM) { - add_index_null(return_value, i); - } - - if (result_type & MYSQL_ASSOC) { - add_assoc_null(return_value, mysql_field->name); - } - } - } - - if (into_object) { - zval dataset = *return_value; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *retval_ptr; - - object_and_properties_init(return_value, ce, NULL); - zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); - - if (ce->constructor) { - fci.size = sizeof(fci); - fci.function_table = &ce->function_table; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &return_value; - fci.retval_ptr_ptr = &retval_ptr; - if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { - if (Z_TYPE_P(ctor_params) == IS_ARRAY) { - HashTable *ht = Z_ARRVAL_P(ctor_params); - Bucket *p; - - fci.param_count = 0; - fci.params = safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0); - p = ht->pListHead; - while (p != NULL) { - fci.params[fci.param_count++] = (zval**)p->pData; - p = p->pListNext; - } - } else { - /* Two problems why we throw exceptions here: PHP is typeless - * and hence passing one argument that's not an array could be - * by mistake and the other way round is possible, too. The - * single value is an array. Also we'd have to make that one - * argument passed by reference. - */ - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); - return; - } - } else { - fci.param_count = 0; - fci.params = NULL; - } - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %v::%v()", ce->name, ce->constructor->common.function_name); - } else { - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - } - if (fci.params) { - efree(fci.params); - } - } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %v does not have a constructor hence you cannot use ctor_params", ce->name); - } - } -} -/* }}} */ - -/* {{{ proto array mysql_fetch_row(resource result) - Gets a result row as an enumerated array */ -PHP_FUNCTION(mysql_fetch_row) -{ - php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_NUM, 1, 0); -} -/* }}} */ - - -/* {{{ proto object mysql_fetch_object(resource result [, string class_name [, NULL|array ctor_params]]) - Fetch a result row as an object */ -PHP_FUNCTION(mysql_fetch_object) -{ - php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_ASSOC, 2, 1); - - if (Z_TYPE_P(return_value) == IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - - -/* {{{ proto array mysql_fetch_array(resource result [, int result_type]) - Fetch a result row as an array (associative, numeric or both) */ -PHP_FUNCTION(mysql_fetch_array) -{ - php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 2, 0); -} -/* }}} */ - - -/* {{{ proto array mysql_fetch_assoc(resource result) - Fetch a result row as an associative array */ -PHP_FUNCTION(mysql_fetch_assoc) -{ - php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_ASSOC, 1, 0); -} -/* }}} */ - -/* {{{ proto bool mysql_data_seek(resource result, int row_number) - Move internal result pointer */ -PHP_FUNCTION(mysql_data_seek) -{ - zval **result, **offset; - MYSQL_RES *mysql_result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &result, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - convert_to_long_ex(offset); - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=(int)mysql_num_rows(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset %ld is invalid for MySQL result index %ld (or the query data is unbuffered)", Z_LVAL_PP(offset), Z_LVAL_PP(result)); - RETURN_FALSE; - } - mysql_data_seek(mysql_result, Z_LVAL_PP(offset)); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto array mysql_fetch_lengths(resource result) - Gets max data size of each column in a result */ -PHP_FUNCTION(mysql_fetch_lengths) -{ - zval **result; - MYSQL_RES *mysql_result; - mysql_row_length_type *lengths; - int num_fields; - int i; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - if ((lengths=mysql_fetch_lengths(mysql_result))==NULL) { - RETURN_FALSE; - } - array_init(return_value); - num_fields = mysql_num_fields(mysql_result); - - for (i=0; i<num_fields; i++) { - add_index_long(return_value, i, lengths[i]); - } -} -/* }}} */ - -/* {{{ php_mysql_get_field_name - */ -static char *php_mysql_get_field_name(int field_type) -{ - switch(field_type) { - case FIELD_TYPE_STRING: - case FIELD_TYPE_VAR_STRING: - return "string"; - break; -#ifdef MYSQL_HAS_TINY - case FIELD_TYPE_TINY: -#endif - case FIELD_TYPE_SHORT: - case FIELD_TYPE_LONG: - case FIELD_TYPE_LONGLONG: - case FIELD_TYPE_INT24: - return "int"; - break; - case FIELD_TYPE_FLOAT: - case FIELD_TYPE_DOUBLE: - case FIELD_TYPE_DECIMAL: - return "real"; - break; - case FIELD_TYPE_TIMESTAMP: - return "timestamp"; - break; -#ifdef MYSQL_HAS_YEAR - case FIELD_TYPE_YEAR: - return "year"; - break; -#endif - case FIELD_TYPE_DATE: - return "date"; - break; - case FIELD_TYPE_TIME: - return "time"; - break; - case FIELD_TYPE_DATETIME: - return "datetime"; - break; - case FIELD_TYPE_TINY_BLOB: - case FIELD_TYPE_MEDIUM_BLOB: - case FIELD_TYPE_LONG_BLOB: - case FIELD_TYPE_BLOB: - return "blob"; - break; - case FIELD_TYPE_NULL: - return "null"; - break; - default: - return "unknown"; - break; - } -} -/* }}} */ - -/* {{{ proto object mysql_fetch_field(resource result [, int field_offset]) - Gets column information from a result and return as an object */ -PHP_FUNCTION(mysql_fetch_field) -{ - zval **result, **field=NULL; - MYSQL_RES *mysql_result; - MYSQL_FIELD *mysql_field; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &result, &field)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(field); - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - if (field) { - if (Z_LVAL_PP(field)<0 || Z_LVAL_PP(field)>=(int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset"); - RETURN_FALSE; - } - mysql_field_seek(mysql_result, Z_LVAL_PP(field)); - } - if ((mysql_field=mysql_fetch_field(mysql_result))==NULL) { - RETURN_FALSE; - } - object_init(return_value); - - add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:""), 1); - add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:""), 1); - add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:""), 1); - add_property_long(return_value, "max_length", mysql_field->max_length); - add_property_long(return_value, "not_null", IS_NOT_NULL(mysql_field->flags)?1:0); - add_property_long(return_value, "primary_key", IS_PRI_KEY(mysql_field->flags)?1:0); - add_property_long(return_value, "multiple_key",(mysql_field->flags&MULTIPLE_KEY_FLAG?1:0)); - add_property_long(return_value, "unique_key",(mysql_field->flags&UNIQUE_KEY_FLAG?1:0)); - add_property_long(return_value, "numeric", IS_NUM(Z_TYPE_P(mysql_field))?1:0); - add_property_long(return_value, "blob", IS_BLOB(mysql_field->flags)?1:0); - add_property_string(return_value, "type", php_mysql_get_field_name(Z_TYPE_P(mysql_field)), 1); - add_property_long(return_value, "unsigned",(mysql_field->flags&UNSIGNED_FLAG?1:0)); - add_property_long(return_value, "zerofill",(mysql_field->flags&ZEROFILL_FLAG?1:0)); -} -/* }}} */ - - -/* {{{ proto bool mysql_field_seek(resource result, int field_offset) - Sets result pointer to a specific field offset */ -PHP_FUNCTION(mysql_field_seek) -{ - zval **result, **offset; - MYSQL_RES *mysql_result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &result, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - convert_to_long_ex(offset); - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=(int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %ld is invalid for MySQL result index %ld", Z_LVAL_PP(offset), Z_LVAL_PP(result)); - RETURN_FALSE; - } - mysql_field_seek(mysql_result, Z_LVAL_PP(offset)); - RETURN_TRUE; -} -/* }}} */ - - -#define PHP_MYSQL_FIELD_NAME 1 -#define PHP_MYSQL_FIELD_TABLE 2 -#define PHP_MYSQL_FIELD_LEN 3 -#define PHP_MYSQL_FIELD_TYPE 4 -#define PHP_MYSQL_FIELD_FLAGS 5 - -/* {{{ php_mysql_field_info - */ -static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval **result, **field; - MYSQL_RES *mysql_result; - MYSQL_FIELD *mysql_field = {0}; - char buf[512]; - int len; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &result, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - convert_to_long_ex(field); - if (Z_LVAL_PP(field)<0 || Z_LVAL_PP(field)>=(int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %ld is invalid for MySQL result index %ld", Z_LVAL_PP(field), Z_LVAL_PP(result)); - RETURN_FALSE; - } - mysql_field_seek(mysql_result, Z_LVAL_PP(field)); - if ((mysql_field=mysql_fetch_field(mysql_result))==NULL) { - RETURN_FALSE; - } - - switch (entry_type) { - case PHP_MYSQL_FIELD_NAME: - Z_STRLEN_P(return_value) = strlen(mysql_field->name); - Z_STRVAL_P(return_value) = estrndup(mysql_field->name, Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MYSQL_FIELD_TABLE: - Z_STRLEN_P(return_value) = strlen(mysql_field->table); - Z_STRVAL_P(return_value) = estrndup(mysql_field->table, Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MYSQL_FIELD_LEN: - Z_LVAL_P(return_value) = mysql_field->length; - Z_TYPE_P(return_value) = IS_LONG; - break; - case PHP_MYSQL_FIELD_TYPE: - Z_STRVAL_P(return_value) = php_mysql_get_field_name(Z_TYPE_P(mysql_field)); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_STRVAL_P(return_value) = estrndup(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_MYSQL_FIELD_FLAGS: - memcpy(buf, "", sizeof("")); -#ifdef IS_NOT_NULL - if (IS_NOT_NULL(mysql_field->flags)) { - strcat(buf, "not_null "); - } -#endif -#ifdef IS_PRI_KEY - if (IS_PRI_KEY(mysql_field->flags)) { - strcat(buf, "primary_key "); - } -#endif -#ifdef UNIQUE_KEY_FLAG - if (mysql_field->flags&UNIQUE_KEY_FLAG) { - strcat(buf, "unique_key "); - } -#endif -#ifdef MULTIPLE_KEY_FLAG - if (mysql_field->flags&MULTIPLE_KEY_FLAG) { - strcat(buf, "multiple_key "); - } -#endif -#ifdef IS_BLOB - if (IS_BLOB(mysql_field->flags)) { - strcat(buf, "blob "); - } -#endif -#ifdef UNSIGNED_FLAG - if (mysql_field->flags&UNSIGNED_FLAG) { - strcat(buf, "unsigned "); - } -#endif -#ifdef ZEROFILL_FLAG - if (mysql_field->flags&ZEROFILL_FLAG) { - strcat(buf, "zerofill "); - } -#endif -#ifdef BINARY_FLAG - if (mysql_field->flags&BINARY_FLAG) { - strcat(buf, "binary "); - } -#endif -#ifdef ENUM_FLAG - if (mysql_field->flags&ENUM_FLAG) { - strcat(buf, "enum "); - } -#endif -#ifdef SET_FLAG - if (mysql_field->flags&SET_FLAG) { - strcat(buf, "set "); - } -#endif -#ifdef AUTO_INCREMENT_FLAG - if (mysql_field->flags&AUTO_INCREMENT_FLAG) { - strcat(buf, "auto_increment "); - } -#endif -#ifdef TIMESTAMP_FLAG - if (mysql_field->flags&TIMESTAMP_FLAG) { - strcat(buf, "timestamp "); - } -#endif - len = strlen(buf); - /* remove trailing space, if present */ - if (len && buf[len-1] == ' ') { - buf[len-1] = 0; - len--; - } - - Z_STRLEN_P(return_value) = len; - Z_STRVAL_P(return_value) = estrndup(buf, len); - Z_TYPE_P(return_value) = IS_STRING; - break; - - default: - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string mysql_field_name(resource result, int field_index) - Gets the name of the specified field in a result */ -PHP_FUNCTION(mysql_field_name) -{ - php_mysql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_MYSQL_FIELD_NAME); -} -/* }}} */ - - -/* {{{ proto string mysql_field_table(resource result, int field_offset) - Gets name of the table the specified field is in */ -PHP_FUNCTION(mysql_field_table) -{ - php_mysql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_MYSQL_FIELD_TABLE); -} -/* }}} */ - - -/* {{{ proto int mysql_field_len(resource result, int field_offset) - Returns the length of the specified field */ -PHP_FUNCTION(mysql_field_len) -{ - php_mysql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_MYSQL_FIELD_LEN); -} -/* }}} */ - - -/* {{{ proto string mysql_field_type(resource result, int field_offset) - Gets the type of the specified field in a result */ -PHP_FUNCTION(mysql_field_type) -{ - php_mysql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_MYSQL_FIELD_TYPE); -} -/* }}} */ - - -/* {{{ proto string mysql_field_flags(resource result, int field_offset) - Gets the flags associated with the specified field in a result */ -PHP_FUNCTION(mysql_field_flags) -{ - php_mysql_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_MYSQL_FIELD_FLAGS); -} -/* }}} */ - - -/* {{{ proto bool mysql_free_result(resource result) - Free result memory */ -PHP_FUNCTION(mysql_free_result) -{ - zval **result; - MYSQL_RES *mysql_result; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(result)==IS_RESOURCE && Z_LVAL_PP(result)==0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); - - zend_list_delete(Z_LVAL_PP(result)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysql_ping([int link_identifier]) - Ping a server connection. If no connection then reconnect. */ -PHP_FUNCTION(mysql_ping) -{ - zval *mysql_link = NULL; - int id = -1; - php_mysql_conn *mysql; - - if (0 == ZEND_NUM_ARGS()) { - id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mysql_link)==FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - - PHPMY_UNBUFFERED_QUERY_CHECK(); - - RETURN_BOOL(! mysql_ping(&mysql->conn)); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h deleted file mode 100644 index 81a0cfdbc50a1..0000000000000 --- a/ext/mysql/php_mysql.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - +----------------------------------------------------------------------+ -*/ - - -/* $Id$ */ - -#ifndef PHP_MYSQL_H -#define PHP_MYSQL_H - -#ifdef PHP_WIN32 -#define PHP_MYSQL_API __declspec(dllexport) -#else -#define PHP_MYSQL_API -#endif - -#if HAVE_MYSQL - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry mysql_module_entry; - -#define mysql_module_ptr &mysql_module_entry - -PHP_MINIT_FUNCTION(mysql); -PHP_RINIT_FUNCTION(mysql); -PHP_MSHUTDOWN_FUNCTION(mysql); -PHP_RSHUTDOWN_FUNCTION(mysql); -PHP_MINFO_FUNCTION(mysql); - -PHP_FUNCTION(mysql_connect); -PHP_FUNCTION(mysql_pconnect); -PHP_FUNCTION(mysql_close); -PHP_FUNCTION(mysql_select_db); -#if MYSQL_VERSION_ID < 40000 -PHP_FUNCTION(mysql_create_db); -PHP_FUNCTION(mysql_drop_db); -#endif -PHP_FUNCTION(mysql_query); -PHP_FUNCTION(mysql_unbuffered_query); -PHP_FUNCTION(mysql_db_query); -PHP_FUNCTION(mysql_list_dbs); -PHP_FUNCTION(mysql_list_tables); -PHP_FUNCTION(mysql_list_fields); -PHP_FUNCTION(mysql_list_processes); -PHP_FUNCTION(mysql_error); -PHP_FUNCTION(mysql_errno); -PHP_FUNCTION(mysql_affected_rows); -PHP_FUNCTION(mysql_insert_id); -PHP_FUNCTION(mysql_result); -PHP_FUNCTION(mysql_num_rows); -PHP_FUNCTION(mysql_num_fields); -PHP_FUNCTION(mysql_fetch_row); -PHP_FUNCTION(mysql_fetch_array); -PHP_FUNCTION(mysql_fetch_assoc); -PHP_FUNCTION(mysql_fetch_object); -PHP_FUNCTION(mysql_data_seek); -PHP_FUNCTION(mysql_fetch_lengths); -PHP_FUNCTION(mysql_fetch_field); -PHP_FUNCTION(mysql_field_seek); -PHP_FUNCTION(mysql_free_result); -PHP_FUNCTION(mysql_field_name); -PHP_FUNCTION(mysql_field_table); -PHP_FUNCTION(mysql_field_len); -PHP_FUNCTION(mysql_field_type); -PHP_FUNCTION(mysql_field_flags); -PHP_FUNCTION(mysql_escape_string); -PHP_FUNCTION(mysql_real_escape_string); -PHP_FUNCTION(mysql_get_client_info); -PHP_FUNCTION(mysql_get_host_info); -PHP_FUNCTION(mysql_get_proto_info); -PHP_FUNCTION(mysql_get_server_info); -PHP_FUNCTION(mysql_info); -PHP_FUNCTION(mysql_stat); -PHP_FUNCTION(mysql_thread_id); -PHP_FUNCTION(mysql_client_encoding); -PHP_FUNCTION(mysql_ping); - -ZEND_BEGIN_MODULE_GLOBALS(mysql) - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - long default_port; - char *default_host, *default_user, *default_password; - char *default_socket; - char *connect_error; - long connect_errno; - long connect_timeout; - long result_allocated; - long trace_mode; -ZEND_END_MODULE_GLOBALS(mysql) - -#ifdef ZTS -# define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v) -#else -# define MySG(v) (mysql_globals.v) -#endif - - -#else - -#define mysql_module_ptr NULL - -#endif - -#define phpext_mysql_ptr mysql_module_ptr - -#endif /* PHP_MYSQL_H */ diff --git a/ext/mysql/tests/001.phpt b/ext/mysql/tests/001.phpt deleted file mode 100755 index 8a7c9d22c800d..0000000000000 --- a/ext/mysql/tests/001.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -mysql connect ---SKIPIF-- -<?php include 'skipif.inc'; ?> ---FILE-- -<?php - -include 'connect.inc'; -$test = ''; - -/*** test mysql_connect 127.0.0.1 ***/ -$db = mysql_connect('127.0.0.1', $user, $passwd); -$test .= ($db) ? '1' : '0'; -mysql_close($db); - -/*** test mysql_connect localhost ***/ -$db = mysql_connect($host, $user, $passwd); -$test .= ($db) ? '1' : '0'; -mysql_close($db); - -/*** test mysql_connect localhost:port ***/ -$db = mysql_connect("{$host}:3306", $user, $passwd, ''); -$test .= ($db) ? '1' : '0'; -mysql_close($db); - -var_dump($test); - -?> ---EXPECT-- -string(3) "111" diff --git a/ext/mysql/tests/002.phpt b/ext/mysql/tests/002.phpt deleted file mode 100755 index 64da4fa0d9776..0000000000000 --- a/ext/mysql/tests/002.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -mysql_fetch_array ---SKIPIF-- -<?php include 'skipif.inc'; ?> ---FILE-- -<?php - -include 'connect.inc'; - -$db = mysql_connect($host, $user, $passwd); - -var_dump($db); - -var_dump(mysql_select_db('test')); - -var_dump(mysql_query('DROP TABLE IF EXISTS test')); - -var_dump(mysql_query('CREATE TABLE test(col1 int PRIMARY KEY, col2 varchar(50), col3 char(5))')); - -var_dump(mysql_query("INSERT INTO test(col1, col2, col3) VALUES(1, 'foo', 'bar'),(2, 'foo', 'bar')")); - -var_dump($res = mysql_query('SELECT col1, col2, col3 FROM test ORDER BY col1 ASC')); - -while ($data = mysql_fetch_array($res, MYSQL_ASSOC)) { - var_dump($data); -} - -mysql_close($db); - -?> ---EXPECTF-- -resource(%d) of type (mysql link) -bool(true) -bool(true) -bool(true) -bool(true) -resource(%d) of type (mysql result) -array(3) { - ["col1"]=> - string(1) "1" - ["col2"]=> - string(3) "foo" - ["col3"]=> - string(3) "bar" -} -array(3) { - ["col1"]=> - string(1) "2" - ["col2"]=> - string(3) "foo" - ["col3"]=> - string(3) "bar" -} diff --git a/ext/mysql/tests/003.phpt b/ext/mysql/tests/003.phpt deleted file mode 100755 index 81a63f3fc8854..0000000000000 --- a/ext/mysql/tests/003.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -mysql_fetch_object ---SKIPIF-- -<?php include 'skipif.inc'; ?> ---FILE-- -<?php - -include 'connect.inc'; - -class class24 { - function __construct() { - echo __METHOD__ . "\n"; - } -} - -$data = array( - "one", - "two", - "three" - ); - -$db = mysql_connect($host, $user, $passwd); - -mysql_select_db("test"); - -mysql_query('DROP TABLE IF EXISTS test'); - -mysql_query("CREATE TABLE test(a varchar(10))"); - -foreach ($data as $str) { - mysql_query("INSERT INTO test VALUES('$str')"); - var_dump($str); -} - -echo "==stdClass==\n"; -$res = mysql_query("SELECT a FROM test"); -while ($obj = mysql_fetch_object($res)) { - var_dump($obj); -} - -echo "==class24==\n"; -$res = mysql_query("SELECT a FROM test"); -while ($obj = mysql_fetch_object($res, 'class24')) { - var_dump($obj); -} - -mysql_close($db); - -?> -==DONE== ---EXPECTF-- -string(3) "one" -string(3) "two" -string(5) "three" -==stdClass== -object(stdClass)#%d (1) { - ["a"]=> - string(3) "one" -} -object(stdClass)#%d (1) { - ["a"]=> - string(3) "two" -} -object(stdClass)#%d (1) { - ["a"]=> - string(5) "three" -} -==class24== -class24::__construct -object(class24)#%d (1) { - ["a"]=> - string(3) "one" -} -class24::__construct -object(class24)#%d (1) { - ["a"]=> - string(3) "two" -} -class24::__construct -object(class24)#%d (1) { - ["a"]=> - string(5) "three" -} -==DONE== diff --git a/ext/mysql/tests/connect.inc b/ext/mysql/tests/connect.inc deleted file mode 100755 index aa1d30a17eac4..0000000000000 --- a/ext/mysql/tests/connect.inc +++ /dev/null @@ -1,10 +0,0 @@ -<?php - - /* default values are localhost, root and empty password - Change the values if you use another configuration */ - - $host = "localhost"; - $user = "root"; - $passwd = ""; - -?> diff --git a/ext/mysql/tests/skipif.inc b/ext/mysql/tests/skipif.inc deleted file mode 100755 index 934420b09a77a..0000000000000 --- a/ext/mysql/tests/skipif.inc +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -include 'connect.inc'; -$link = @mysql_connect($host, $user, $passwd); -if (!$link) die('skip cannot connect'); -mysql_close($link); - -?> \ No newline at end of file diff --git a/ext/mysqli/CREDITS b/ext/mysqli/CREDITS deleted file mode 100644 index 68cfa8a4aed02..0000000000000 --- a/ext/mysqli/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -MySQLi -Zak Greant, Georg Richter diff --git a/ext/mysqli/TODO b/ext/mysqli/TODO deleted file mode 100644 index c241b9b704286..0000000000000 --- a/ext/mysqli/TODO +++ /dev/null @@ -1,2 +0,0 @@ -- documentation -- ini-settings diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 deleted file mode 100644 index e0c3d5ead3818..0000000000000 --- a/ext/mysqli/config.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl -dnl $Id$ -dnl config.m4 for extension mysqli - -PHP_ARG_WITH(mysqli, for MySQLi support, -[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname - to mysql_config]) - -PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support, -[ --enable-embedded-mysqli MYSQLi: Enable embedded support], no, no) - -if test "$PHP_MYSQLI" != "no"; then - -dnl there are no mysql libs currently bundled with PHP.. --Jani -dnl if test "$PHP_MYSQL" = "yes"; then -dnl AC_MSG_ERROR([--with-mysql (using bundled libs) can not be used together with --with-mysqli.]) -dnl fi - - if test "$PHP_MYSQLI" = "yes"; then - MYSQL_CONFIG=`$php_shtool path mysql_config` - else - MYSQL_CONFIG=$PHP_MYSQLI - fi - - if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then - AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled]) - MYSQL_LIB_CFG='--libmysqld-libs' - else - MYSQL_LIB_CFG='--libs' - fi - - if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then - MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | sed -e "s/'//g"` - MYSQLI_LIBLINE=`$MYSQL_CONFIG $MYSQL_LIB_CFG | sed -e "s/'//g"` - else - AC_MSG_RESULT([mysql_config not found]) - AC_MSG_ERROR([Please reinstall the mysql distribution]) - fi - - dnl - dnl Check the library - dnl - PHP_CHECK_LIBRARY(mysqlclient, mysql_set_server_option, - [ - PHP_EVAL_INCLINE($MYSQLI_INCLINE) - PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD) - AC_DEFINE(HAVE_MYSQLILIB,1,[ ]) - PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count, - [ ],[ - AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.3 (for MySQL 4.1.x) and < 5.0.1 for (MySQL 5.0.x) anymore. Please update your libraries.]) - ],[$MYSQLI_LIBLINE]) - ],[ - AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.]) - ],[ - $MYSQLI_LIBLINE - ]) - - PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c mysqli_warning.c mysqli_exception.c mysqli_embedded.c, $ext_shared) - PHP_SUBST(MYSQLI_SHARED_LIBADD) -fi diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32 deleted file mode 100644 index 789112ea14407..0000000000000 --- a/ext/mysqli/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("mysqli", "MySQLi support", "no"); - -if (PHP_MYSQLI != "no") { - if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) && - CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQLI)) { - EXTENSION("mysqli", "mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c mysqli_warning.c mysqli_exception.c mysqli_embedded.c"); - AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library'); - } else { - WARNING("mysqli not enabled; libraries and headers not found"); - } -} diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c deleted file mode 100644 index 040a1bd4c1121..0000000000000 --- a/ext/mysqli/mysqli.c +++ /dev/null @@ -1,1114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "php_mysqli.h" -#include "zend_exceptions.h" - -#define MYSQLI_STORE_RESULT 0 -#define MYSQLI_USE_RESULT 1 - -ZEND_DECLARE_MODULE_GLOBALS(mysqli) -static zend_object_handlers mysqli_object_handlers; -static HashTable classes; -static HashTable mysqli_driver_properties; -static HashTable mysqli_link_properties; -static HashTable mysqli_result_properties; -static HashTable mysqli_stmt_properties; -static HashTable mysqli_warning_properties; - -extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS); - -typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC); -typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval TSRMLS_DC); - -typedef struct _mysqli_prop_handler { - mysqli_read_t read_func; - mysqli_write_t write_func; -} mysqli_prop_handler; - -/* {{{ php_free_stmt_bind_buffer */ -void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type) -{ - unsigned int i; - - if (!bbuf.var_cnt) { - return; - } - - if (bbuf.is_null) { - efree(bbuf.is_null); - } - - for (i=0; i < bbuf.var_cnt; i++) { - - /* free temporary bind buffer */ - if (type == FETCH_RESULT && bbuf.buf[i].val) { - efree(bbuf.buf[i].val); - } - - if (bbuf.vars[i]) { - zval_ptr_dtor(&bbuf.vars[i]); - } - } - - if (bbuf.vars) { - efree(bbuf.vars); - } - - if (type == FETCH_RESULT) { - efree(bbuf.buf); - } - bbuf.var_cnt = 0; - return; -} -/* }}} */ - -/* {{{ php_clear_stmt_bind */ -void php_clear_stmt_bind(MY_STMT *stmt) -{ - if (stmt->stmt) { - mysql_stmt_close(stmt->stmt); - } - - php_free_stmt_bind_buffer(stmt->param, FETCH_SIMPLE); - php_free_stmt_bind_buffer(stmt->result, FETCH_RESULT); - - if (stmt->query) { - efree(stmt->query); - } - efree(stmt); - return; -} -/* }}} */ - -/* {{{ php_clear_mysql */ -void php_clear_mysql(MY_MYSQL *mysql) { - if (mysql->li_read) { - efree(Z_STRVAL_P(mysql->li_read)); - FREE_ZVAL(mysql->li_read); - mysql->li_read = NULL; - } -} -/* }}} */ - -/* {{{ mysqli_objects_free_storage - */ -static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC) -{ - mysqli_object *intern = (mysqli_object *)object; - - zend_objects_free_object_storage(&(intern->zo) TSRMLS_CC); -} -/* }}} */ - -/* {{{ mysqli_objects_destroy_object - */ -static void mysqli_objects_destroy_object(void *object, zend_object_handle handle TSRMLS_DC) -{ - mysqli_object *intern = (mysqli_object *)object; - MYSQLI_RESOURCE *my_res; - - zend_objects_destroy_object(object, handle TSRMLS_CC); - - my_res = (MYSQLI_RESOURCE *)intern->ptr; - - /* link object */ - if (instanceof_function(intern->zo.ce, mysqli_link_class_entry TSRMLS_CC)) { - if (my_res && my_res->ptr) { - MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr; - - if (mysql->mysql) { - mysql_close(mysql->mysql); - } - - php_clear_mysql(mysql); - efree(mysql); - - my_res->ptr = NULL; - } - } else if (intern->zo.ce == mysqli_stmt_class_entry) { /* stmt object */ - if (my_res && my_res->ptr) { - php_clear_stmt_bind((MY_STMT *)my_res->ptr); - } - } else if (intern->zo.ce == mysqli_result_class_entry) { /* result object */ - if (my_res && my_res->ptr) { - mysql_free_result(my_res->ptr); - } - } else if (intern->zo.ce == mysqli_warning_class_entry) { /* warning object */ - if (my_res && my_res->ptr) { - php_clear_warnings((MYSQLI_WARNING *)my_res->info); - } - } - intern->ptr = NULL; - my_efree(my_res); -} -/* }}} */ - -/* {{{ mysqli_read_na */ -static int mysqli_read_na(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - *retval = NULL; - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property"); - return FAILURE; -} -/* }}} */ - -/* {{{ mysqli_write_na */ -static int mysqli_write_na(mysqli_object *obj, zval *newval TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property"); - return FAILURE; -} -/* }}} */ - -/* {{{ mysqli_read_property */ -zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - zval tmp_member; - zval *retval; - mysqli_object *obj; - mysqli_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - ret = FAILURE; - obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - - if (ret == SUCCESS) { - - /* check if mysqli object is still valid */ - if (!strcmp(obj->zo.ce->name, "mysqli")) { - if (!obj->ptr || - !((MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql)->thread_id) { - retval = EG(uninitialized_zval_ptr); - return(retval); - } - } else - /* check if stmt object is still valid */ - if (!strcmp(obj->zo.ce->name, "mysqli_stmt")) { - if (!obj->ptr || - !((MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt)->mysql) { - retval = EG(uninitialized_zval_ptr); - return(retval); - } - } - - ret = hnd->read_func(obj, &retval TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - retval->refcount = 0; - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return(retval); -} -/* }}} */ - -/* {{{ mysqli_write_property */ -void mysqli_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zval tmp_member; - mysqli_object *obj; - mysqli_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - hnd->write_func(obj, value TSRMLS_CC); - if (! PZVAL_IS_REF(value) && value->refcount == 0) { - value->refcount++; - zval_ptr_dtor(&value); - } - } else { - std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } -} -/* }}} */ - -/* {{{ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) */ -void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) { - mysqli_prop_handler p; - - p.read_func = (r_func) ? r_func : mysqli_read_na; - p.write_func = (w_func) ? w_func : mysqli_write_na; - - zend_hash_add(h, pname, strlen(pname) + 1, &p, sizeof(mysqli_prop_handler), NULL); -} -/* }}} */ - -static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) -{ - mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->zo.ce != mysqli_link_class_entry && obj->zo.ce != mysqli_stmt_class_entry && - obj->zo.ce != mysqli_result_class_entry && obj->zo.ce != mysqli_driver_class_entry && - obj->zo.ce != mysqli_warning_class_entry) { - return obj->zo.ce->constructor; - } else { - static zend_internal_function f; - - f.function_name = obj->zo.ce->name; - f.scope = obj->zo.ce; - f.arg_info = NULL; - f.num_args = 0; - f.fn_flags = 0; - - f.type = ZEND_INTERNAL_FUNCTION; - if (obj->zo.ce == mysqli_link_class_entry) { - f.handler = ZEND_FN(mysqli_connect); - } else if (obj->zo.ce == mysqli_stmt_class_entry) { - f.handler = ZEND_FN(mysqli_stmt_construct); - } else if (obj->zo.ce == mysqli_result_class_entry) { - f.handler = ZEND_FN(mysqli_result_construct); - } else if (obj->zo.ce == mysqli_driver_class_entry) { - f.handler = ZEND_FN(mysqli_driver_construct); - } else if (obj->zo.ce == mysqli_warning_class_entry) { - f.handler = ZEND_FN(mysqli_warning___construct); - } - - return (union _zend_function*)&f; - } -} - -/* {{{ mysqli_objects_new - */ -PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - mysqli_object *intern; - zval *tmp; - zend_class_entry *mysqli_base_class; - - intern = emalloc(sizeof(mysqli_object)); - memset(intern, 0, sizeof(mysqli_object)); - intern->zo.ce = class_type; - intern->zo.in_get = 0; - intern->zo.in_set = 0; - intern->ptr = NULL; - intern->valid = 0; - intern->prop_handler = NULL; - - mysqli_base_class = class_type; - while (mysqli_base_class->type != ZEND_INTERNAL_CLASS && mysqli_base_class->parent != NULL) - { - mysqli_base_class = mysqli_base_class->parent; - } - zend_hash_find(&classes, mysqli_base_class->name, mysqli_base_class->name_length + 1, - (void **) &intern->prop_handler); - - ALLOC_HASHTABLE(intern->zo.properties); - zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) mysqli_objects_destroy_object, (zend_objects_free_object_storage_t) mysqli_objects_free_storage, NULL TSRMLS_CC); - retval.handlers = &mysqli_object_handlers; - - return retval; -} -/* }}} */ - -/* {{{ mysqli_module_entry - */ -zend_module_entry mysqli_module_entry = { - STANDARD_MODULE_HEADER, - "mysqli", - mysqli_functions, - PHP_MINIT(mysqli), - PHP_MSHUTDOWN(mysqli), - PHP_RINIT(mysqli), - PHP_RSHUTDOWN(mysqli), - PHP_MINFO(mysqli), - "0.1", /* Replace with version number for your extension */ - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_MYSQLI -ZEND_GET_MODULE(mysqli) -#endif - -/* {{{ PHP_INI_BEGIN -*/ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY_EX("mysqli.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_mysqli_globals, mysqli_globals, display_link_numbers) - STD_PHP_INI_ENTRY("mysqli.default_host", NULL, PHP_INI_ALL, OnUpdateString, default_host, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_ENTRY("mysqli.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_ENTRY("mysqli.default_pw", NULL, PHP_INI_ALL, OnUpdateString, default_pw, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_ENTRY("mysqli.default_port", "3306", PHP_INI_ALL, OnUpdateLong, default_port, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_ENTRY("mysqli.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_BOOLEAN("mysqli.reconnect", "0", PHP_INI_SYSTEM, OnUpdateLong, reconnect, zend_mysqli_globals, mysqli_globals) -PHP_INI_END() - -/* }}} */ - -/* {{{ php_mysqli_init_globals - */ -static void php_mysqli_init_globals(zend_mysqli_globals *mysqli_globals) -{ - mysqli_globals->num_links = 0; - mysqli_globals->max_links = 0; - mysqli_globals->default_port = 0; - mysqli_globals->default_host = NULL; - mysqli_globals->default_user = NULL; - mysqli_globals->default_pw = NULL; - mysqli_globals->default_socket = NULL; - mysqli_globals->reconnect = 0; - mysqli_globals->report_mode = 0; - mysqli_globals->report_ht = 0; -#ifdef HAVE_EMBEDDED_MYSQLI - mysqli_globals->embedded = 1; -#else - mysqli_globals->embedded = 0; -#endif -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(mysqli) -{ - zend_class_entry *ce,cex; - zend_object_handlers *std_hnd = zend_get_std_object_handlers(); - - ZEND_INIT_MODULE_GLOBALS(mysqli, php_mysqli_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - memcpy(&mysqli_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - mysqli_object_handlers.clone_obj = NULL; - mysqli_object_handlers.read_property = mysqli_read_property; - mysqli_object_handlers.write_property = mysqli_write_property; - mysqli_object_handlers.get_property_ptr_ptr = std_hnd->get_property_ptr_ptr; - mysqli_object_handlers.get_constructor = php_mysqli_constructor_get; - - zend_hash_init(&classes, 0, NULL, NULL, 1); - - INIT_CLASS_ENTRY(cex, "mysqli_sql_exception", mysqli_exception_methods); -#ifdef HAVE_SPL - mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException, NULL TSRMLS_CC); -#else - mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#endif - mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL; - zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC); - - REGISTER_MYSQLI_CLASS_ENTRY("mysqli_driver", mysqli_driver_class_entry, mysqli_driver_methods); - ce = mysqli_driver_class_entry; - zend_hash_init(&mysqli_driver_properties, 0, NULL, NULL, 1); - MYSQLI_ADD_PROPERTIES(&mysqli_driver_properties, mysqli_driver_property_entries); - zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_driver_properties, sizeof(mysqli_driver_properties), NULL); - ce->ce_flags |= ZEND_ACC_FINAL_CLASS; - - REGISTER_MYSQLI_CLASS_ENTRY("mysqli", mysqli_link_class_entry, mysqli_link_methods); - ce = mysqli_link_class_entry; - zend_hash_init(&mysqli_link_properties, 0, NULL, NULL, 1); - MYSQLI_ADD_PROPERTIES(&mysqli_link_properties, mysqli_link_property_entries); - zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_link_properties, sizeof(mysqli_link_properties), NULL); - - REGISTER_MYSQLI_CLASS_ENTRY("mysqli_warning", mysqli_warning_class_entry, mysqli_warning_methods); - ce = mysqli_warning_class_entry; - ce->ce_flags |= ZEND_ACC_FINAL_CLASS | ZEND_ACC_PROTECTED; - zend_hash_init(&mysqli_warning_properties, 0, NULL, NULL, 1); - MYSQLI_ADD_PROPERTIES(&mysqli_warning_properties, mysqli_warning_property_entries); - zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_warning_properties, sizeof(mysqli_warning_properties), NULL); - - REGISTER_MYSQLI_CLASS_ENTRY("mysqli_result", mysqli_result_class_entry, mysqli_result_methods); - ce = mysqli_result_class_entry; - zend_hash_init(&mysqli_result_properties, 0, NULL, NULL, 1); - MYSQLI_ADD_PROPERTIES(&mysqli_result_properties, mysqli_result_property_entries); - zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_result_properties, sizeof(mysqli_result_properties), NULL); - - REGISTER_MYSQLI_CLASS_ENTRY("mysqli_stmt", mysqli_stmt_class_entry, mysqli_stmt_methods); - ce = mysqli_stmt_class_entry; - zend_hash_init(&mysqli_stmt_properties, 0, NULL, NULL, 1); - MYSQLI_ADD_PROPERTIES(&mysqli_stmt_properties, mysqli_stmt_property_entries); - zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_stmt_properties, sizeof(mysqli_stmt_properties), NULL); - - /* mysqli_options */ - REGISTER_LONG_CONSTANT("MYSQLI_READ_DEFAULT_GROUP", MYSQL_READ_DEFAULT_GROUP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_READ_DEFAULT_FILE", MYSQL_READ_DEFAULT_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_OPT_CONNECT_TIMEOUT", MYSQL_OPT_CONNECT_TIMEOUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_OPT_LOCAL_INFILE", MYSQL_OPT_LOCAL_INFILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_INIT_COMMAND", MYSQL_INIT_COMMAND, CONST_CS | CONST_PERSISTENT); - - /* mysqli_real_connect flags */ - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_COMPRESS",CLIENT_COMPRESS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_NO_SCHEMA", CLIENT_NO_SCHEMA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_FOUND_ROWS", CLIENT_FOUND_ROWS, CONST_CS | CONST_PERSISTENT); - - /* for mysqli_query */ - REGISTER_LONG_CONSTANT("MYSQLI_STORE_RESULT", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_USE_RESULT", 1, CONST_CS | CONST_PERSISTENT); - - /* for mysqli_fetch_assoc */ - REGISTER_LONG_CONSTANT("MYSQLI_ASSOC", MYSQLI_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_NUM", MYSQLI_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_BOTH", MYSQLI_BOTH, CONST_CS | CONST_PERSISTENT); - - /* for mysqli_stmt_set_attr */ - REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT); - -#if MYSQL_VERSION_ID > 50003 - REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_CURSOR_TYPE", STMT_ATTR_CURSOR_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_NO_CURSOR", CURSOR_TYPE_NO_CURSOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_READ_ONLY", CURSOR_TYPE_READ_ONLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_FOR_UPDATE", CURSOR_TYPE_FOR_UPDATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_SCROLLABLE", CURSOR_TYPE_SCROLLABLE, CONST_CS | CONST_PERSISTENT); -#endif - -#if MYSQL_VERSION_ID > 50007 - REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_PREFETCH_ROWS", STMT_ATTR_PREFETCH_ROWS, CONST_CS | CONST_PERSISTENT); -#endif - - /* column information */ - REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_PRI_KEY_FLAG", PRI_KEY_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_UNIQUE_KEY_FLAG", UNIQUE_KEY_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_MULTIPLE_KEY_FLAG", MULTIPLE_KEY_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_BLOB_FLAG", BLOB_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_UNSIGNED_FLAG", UNSIGNED_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_ZEROFILL_FLAG", ZEROFILL_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_AUTO_INCREMENT_FLAG", AUTO_INCREMENT_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TIMESTAMP_FLAG", TIMESTAMP_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_SET_FLAG", SET_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_NUM_FLAG", NUM_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_PART_KEY_FLAG", PART_KEY_FLAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_GROUP_FLAG", GROUP_FLAG, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_DECIMAL", FIELD_TYPE_DECIMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_TINY", FIELD_TYPE_TINY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_SHORT", FIELD_TYPE_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_LONG", FIELD_TYPE_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_FLOAT", FIELD_TYPE_FLOAT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_DOUBLE", FIELD_TYPE_DOUBLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_NULL", FIELD_TYPE_NULL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_TIMESTAMP", FIELD_TYPE_TIMESTAMP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_LONGLONG", FIELD_TYPE_LONGLONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_INT24", FIELD_TYPE_INT24, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_DATE", FIELD_TYPE_DATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_TIME", FIELD_TYPE_TIME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_DATETIME", FIELD_TYPE_DATETIME , CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_YEAR", FIELD_TYPE_YEAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_NEWDATE", FIELD_TYPE_NEWDATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_ENUM", FIELD_TYPE_ENUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_SET", FIELD_TYPE_SET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_TINY_BLOB", FIELD_TYPE_TINY_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_MEDIUM_BLOB", FIELD_TYPE_MEDIUM_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_LONG_BLOB", FIELD_TYPE_LONG_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_BLOB", FIELD_TYPE_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_VAR_STRING", FIELD_TYPE_VAR_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_STRING", FIELD_TYPE_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_CHAR", FIELD_TYPE_CHAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_INTERVAL", FIELD_TYPE_INTERVAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_TYPE_GEOMETRY", FIELD_TYPE_GEOMETRY, CONST_CS | CONST_PERSISTENT); - - /* replication */ - REGISTER_LONG_CONSTANT("MYSQLI_RPL_MASTER", MYSQL_RPL_MASTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_RPL_SLAVE", MYSQL_RPL_SLAVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_RPL_ADMIN", MYSQL_RPL_ADMIN, CONST_CS | CONST_PERSISTENT); - - /* bind support */ - REGISTER_LONG_CONSTANT("MYSQLI_NO_DATA", MYSQL_NO_DATA, CONST_CS | CONST_PERSISTENT); -#ifdef MYSQL_DATA_TRUNCATED - REGISTER_LONG_CONSTANT("MYSQLI_DATA_TRUNCATED", MYSQL_DATA_TRUNCATED, CONST_CS | CONST_PERSISTENT); -#endif - - /* reporting */ - REGISTER_LONG_CONSTANT("MYSQLI_REPORT_INDEX", MYSQLI_REPORT_INDEX, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_REPORT_ERROR", MYSQLI_REPORT_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_REPORT_ALL", MYSQLI_REPORT_ALL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MYSQLI_REPORT_OFF", 0, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(mysqli) -{ - zend_hash_destroy(&mysqli_driver_properties); - zend_hash_destroy(&mysqli_result_properties); - zend_hash_destroy(&mysqli_stmt_properties); - zend_hash_destroy(&mysqli_warning_properties); - zend_hash_destroy(&mysqli_link_properties); - zend_hash_destroy(&classes); - - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(mysqli) -{ - MyG(error_msg) = NULL; - MyG(error_no) = 0; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(mysqli) -{ - if (MyG(error_msg)) { - efree(MyG(error_msg)); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(mysqli) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "MysqlI Support", "enabled"); - php_info_print_table_row(2, "Client API version", mysql_get_client_info()); - php_info_print_table_row(2, "MYSQLI_SOCKET", MYSQL_UNIX_ADDR); - - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ mixed mysqli_stmt_construct() -constructor for statement object. -Parameters: - object -> mysqli_init - object, query -> mysqli_prepare -*/ -ZEND_FUNCTION(mysqli_stmt_construct) -{ - MY_MYSQL *mysql; - zval *mysql_link; - MY_STMT *stmt; - MYSQLI_RESOURCE *mysqli_resource; - char *statement; - int stmt_len; - - switch (ZEND_NUM_ARGS()) - { - case 1: /* mysql_stmt_init */ - if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); - - stmt->stmt = mysql_stmt_init(mysql->mysql); - break; - case 2: - if (zend_parse_parameters(2 TSRMLS_CC, "Os", &mysql_link, mysqli_link_class_entry, &statement, stmt_len)==FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); - - if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) { - mysql_stmt_prepare(stmt->stmt, statement, stmt_len); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (!stmt->stmt) { - efree(stmt); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)stmt; - - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource; - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1; -} -/* }}} */ - -/* {{{ mixed mysqli_result_construct() -constructor for result object. -Parameters: - object [, mode] -> mysqli_store/use_result -*/ -ZEND_FUNCTION(mysqli_result_construct) -{ - MY_MYSQL *mysql; - MYSQL_RES *result; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - long resmode = MYSQLI_STORE_RESULT; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) { - return; - } - break; - case 2: - if (zend_parse_parameters(2 TSRMLS_CC, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) { - return; - } - break; - default: - WRONG_PARAM_COUNT; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - result = (resmode == MYSQLI_STORE_RESULT) ? mysql_store_result(mysql->mysql) : - mysql_use_result(mysql->mysql); - - if (!result) { - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)result; - - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource; - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1; - -} -/* }}} */ - -/* {{{ php_mysqli_fetch_into_hash - */ -void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags, int into_object) -{ - MYSQL_RES *result; - zval *mysql_result; - long fetchtype; - unsigned int i; - MYSQL_FIELD *fields; - MYSQL_ROW row; - unsigned long *field_len; - zval *ctor_params = NULL; - zend_class_entry *ce = NULL; - - if (into_object) { - char *class_name; - int class_name_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sz", &mysql_result, mysqli_result_class_entry, &class_name, &class_name_len, &ctor_params) == FAILURE) { - return; - } - if (ZEND_NUM_ARGS() < (getThis() ? 1 : 2)) { - ce = zend_standard_class_def; - } else { - ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - } - if (!ce) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); - return; - } - fetchtype = MYSQLI_ASSOC; - } else { - if (override_flags) { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - fetchtype = override_flags; - } else { - fetchtype = MYSQLI_BOTH; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) { - return; - } - } - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if ((fetchtype & MYSQLI_BOTH) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH"); - RETURN_FALSE; - } - - if (!(row = mysql_fetch_row(result))) { - RETURN_NULL(); - } - - if (fetchtype & MYSQLI_ASSOC) { - fields = mysql_fetch_fields(result); - } - - array_init(return_value); - field_len = mysql_fetch_lengths(result); - - for (i = 0; i < mysql_num_fields(result); i++) { - if (row[i]) { - zval *res; - - MAKE_STD_ZVAL(res); - - /* check if we need magic quotes */ - if (PG(magic_quotes_runtime)) { - Z_TYPE_P(res) = IS_STRING; - Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC); - } else { - ZVAL_STRINGL(res, row[i], field_len[i], 1); - } - - if (fetchtype & MYSQLI_NUM) { - add_index_zval(return_value, i, res); - } - if (fetchtype & MYSQLI_ASSOC) { - if (fetchtype & MYSQLI_NUM) { - ZVAL_ADDREF(res); - } - add_assoc_zval(return_value, fields[i].name, res); - } - } else { - if (fetchtype & MYSQLI_NUM) { - add_index_null(return_value, i); - } - if (fetchtype & MYSQLI_ASSOC) { - add_assoc_null(return_value, fields[i].name); - } - } - } - - if (into_object) { - zval dataset = *return_value; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *retval_ptr; - - object_and_properties_init(return_value, ce, NULL); - zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); - - if (ce->constructor) { - fci.size = sizeof(fci); - fci.function_table = &ce->function_table; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &return_value; - fci.retval_ptr_ptr = &retval_ptr; - if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { - if (Z_TYPE_P(ctor_params) == IS_ARRAY) { - HashTable *ht = Z_ARRVAL_P(ctor_params); - Bucket *p; - - fci.param_count = 0; - fci.params = safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0); - p = ht->pListHead; - while (p != NULL) { - fci.params[fci.param_count++] = (zval**)p->pData; - p = p->pListNext; - } - } else { - /* Two problems why we throw exceptions here: PHP is typeless - * and hence passing one argument that's not an array could be - * by mistake and the other way round is possible, too. The - * single value is an array. Also we'd have to make that one - * argument passed by reference. - */ - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); - return; - } - } else { - fci.param_count = 0; - fci.params = NULL; - } - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); - } else { - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - } - if (fci.params) { - efree(fci.params); - } - } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); - } - } -} -/* }}} */ - -/* {{{ php_mysqli_set_error - */ -PHP_MYSQLI_API void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC) -{ - MyG(error_no) = mysql_errno; - if (MyG(error_msg)) { - efree(MyG(error_msg)); - } - MyG(error_msg) = estrdup(mysql_err); -} -/* }}} */ - -#define ALLOC_CALLBACK_ARGS(a, b, c)\ -if (c) {\ - a = (zval ***)safe_emalloc(c, sizeof(zval **), 0);\ - for (i = b; i < c; i++) {\ - a[i] = emalloc(sizeof(zval *));\ - MAKE_STD_ZVAL(*a[i]);\ - }\ -} - -#define FREE_CALLBACK_ARGS(a, b, c)\ -if (a) {\ - for (i=b; i < c; i++) {\ - zval_ptr_dtor(a[i]);\ - efree(a[i]);\ - }\ - efree(a);\ -} - -#define LOCAL_INFILE_ERROR_MSG(source,dest)\ -memset(source, 0, LOCAL_INFILE_ERROR_LEN);\ -memcpy(source, dest, LOCAL_INFILE_ERROR_LEN-1); - -/* {{{ void php_set_local_infile_handler_default -*/ -void php_set_local_infile_handler_default(MY_MYSQL *mysql) { - /* register internal callback functions */ - mysql_set_local_infile_handler(mysql->mysql, &php_local_infile_init, &php_local_infile_read, - &php_local_infile_end, &php_local_infile_error, (void *)mysql); - mysql->li_read = NULL; -} -/* }}} */ - -/* {{{ php_local_infile_init - */ -int php_local_infile_init(void **ptr, const char *filename, void *userdata) -{ - mysqli_local_infile *data; - MY_MYSQL *mysql; - php_stream_context *context = NULL; - - TSRMLS_FETCH(); - - /* save pointer to MY_MYSQL structure (userdata) */ - if (!(*ptr= data= ((mysqli_local_infile *)calloc(1, sizeof(mysqli_local_infile))))) { - return 1; - } - - if (!(mysql = (MY_MYSQL *)userdata)) { - LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(CR_UNKNOWN_ERROR)); - return 1; - } - - /* check open_basedir */ - if (PG(open_basedir)) { - if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC) == -1) { - LOCAL_INFILE_ERROR_MSG(data->error_msg, "open_basedir restriction in effect. Unable to open file"); - return 1; - } - } - - mysql->li_stream = php_stream_open_wrapper_ex((char *)filename, "r", 0, NULL, context); - - if (mysql->li_stream == NULL) { - return 1; - } - - data->userdata = mysql; - - return 0; -} -/* }}} */ - -/* {{{ int php_local_infile_read */ -int php_local_infile_read(void *ptr, char *buf, uint buf_len) -{ - mysqli_local_infile *data; - MY_MYSQL *mysql; - zval ***callback_args; - zval *retval; - zval *fp; - int argc = 4; - int i; - long rc; - - TSRMLS_FETCH(); - - data= (mysqli_local_infile *)ptr; - mysql = data->userdata; - - /* default processing */ - if (!mysql->li_read) { - int count; - - count = (int)php_stream_read(mysql->li_stream, buf, buf_len); - - if (count < 0) { - LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(2)); - } - - return count; - } - - ALLOC_CALLBACK_ARGS(callback_args, 1, argc); - - /* set parameters: filepointer, buffer, buffer_len, errormsg */ - - MAKE_STD_ZVAL(fp); - php_stream_to_zval(mysql->li_stream, fp); - callback_args[0] = &fp; - ZVAL_STRING(*callback_args[1], "", 1); - ZVAL_LONG(*callback_args[2], buf_len); - ZVAL_STRING(*callback_args[3], "", 1); - - if (call_user_function_ex(EG(function_table), - NULL, - mysql->li_read, - &retval, - argc, - callback_args, - 0, - NULL TSRMLS_CC) == SUCCESS) { - - rc = Z_LVAL_P(retval); - zval_ptr_dtor(&retval); - - if (rc > 0) { - if (rc > buf_len) { - /* check buffer overflow */ - LOCAL_INFILE_ERROR_MSG(data->error_msg, "Read buffer too large"); - rc = -1; - } else { - memcpy(buf, Z_STRVAL_P(*callback_args[1]), rc); - } - } - if (rc < 0) { - LOCAL_INFILE_ERROR_MSG(data->error_msg, Z_STRVAL_P(*callback_args[3])); - } - } else { - LOCAL_INFILE_ERROR_MSG(data->error_msg, "Can't execute load data local init callback function"); - rc = -1; - } - - FREE_CALLBACK_ARGS(callback_args, 1, argc); - efree(fp); - return rc; -} -/* }}} */ - -/* {{{ php_local_infile_error - */ -int php_local_infile_error(void *ptr, char *error_msg, uint error_msg_len) -{ - mysqli_local_infile *data = (mysqli_local_infile *) ptr; - - if (data) { - strcpy(error_msg, data->error_msg); - return 2000; - } - strcpy(error_msg, ER(CR_OUT_OF_MEMORY)); - return CR_OUT_OF_MEMORY; -} -/* }}} */ - -/* {{{ php_local_infile_end - */ -void php_local_infile_end(void *ptr) -{ - mysqli_local_infile *data; - MY_MYSQL *mysql; - - TSRMLS_FETCH(); - - data= (mysqli_local_infile *)ptr; - - if (!(mysql = data->userdata)) { - return; - } - - php_stream_close(mysql->li_stream); - return; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli.dsp b/ext/mysqli/mysqli.dsp deleted file mode 100755 index a334202187f42..0000000000000 --- a/ext/mysqli/mysqli.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysqli" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=mysqli - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mysqli.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mysqli.mak" CFG="mysqli - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mysqli - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "mysqli - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mysqli - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysqli.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "mysqli - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysqli.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "mysqli - Win32 Release_TS" -# Name "mysqli - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mysqli.c -# End Source File -# Begin Source File - -SOURCE=.\mysqli_api.c -# End Source File -# Begin Source File - -SOURCE=.\mysqli_fe.c -# End Source File -# Begin Source File - -SOURCE=.\mysqli_nonapi.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_mysqli.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c deleted file mode 100644 index 3490d430e1437..0000000000000 --- a/ext/mysqli/mysqli_api.c +++ /dev/null @@ -1,2056 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ proto mixed mysqli_affected_rows(object link) - Get number of affected rows in previous MySQL operation */ -PHP_FUNCTION(mysqli_affected_rows) -{ - MY_MYSQL *mysql; - zval *mysql_link; - my_ulonglong rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - rc = mysql_affected_rows(mysql->mysql); - if (rc == (my_ulonglong) -1) { - RETURN_LONG(-1); - } - MYSQLI_RETURN_LONG_LONG(rc); -} -/* }}} */ - -/* {{{ proto bool mysqli_autocommit(object link, bool mode) - Turn auto commit on or of */ -PHP_FUNCTION(mysqli_autocommit) -{ - MY_MYSQL *mysql; - zval *mysql_link; - unsigned long automode; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_autocommit(mysql->mysql, automode)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_bind_param(object stmt, string types, mixed variable [,mixed,....]) - Bind variables to a prepared statement as parameters */ -PHP_FUNCTION(mysqli_stmt_bind_param) -{ - zval ***args; - int argc = ZEND_NUM_ARGS(); - int i; - int num_vars; - int start = 2; - int ofs; - MY_STMT *stmt; - zval *mysql_stmt; - MYSQL_BIND *bind; - char *types; - int typelen; - unsigned long rc; - - /* calculate and check number of parameters */ - num_vars = argc - 1; - if (!getThis()) { - /* ignore handle parameter in procedural interface*/ - --num_vars; - } - if (argc < 2) { - /* there has to be at least one pair */ - WRONG_PARAM_COUNT; - } - - if (zend_parse_method_parameters((getThis()) ? 1:2 TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &types, &typelen) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (getThis()) { - start = 1; - } - - if (typelen != argc - start) { - /* number of bind variables doesn't match number of elements in type definition string */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables"); - RETURN_FALSE; - } - - if (typelen != stmt->stmt->param_count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement"); - RETURN_FALSE; - } - - /* prevent leak if variables are already bound */ - if (stmt->param.var_cnt) { - php_free_stmt_bind_buffer(stmt->param, FETCH_SIMPLE); - } - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - stmt->param.is_null = ecalloc(num_vars, sizeof(char)); - bind = (MYSQL_BIND *)ecalloc(num_vars, sizeof(MYSQL_BIND)); - - ofs = 0; - for (i=start; i < argc; i++) { - - /* set specified type */ - switch (types[ofs]) { - case 'd': /* Double */ - bind[ofs].buffer_type = MYSQL_TYPE_DOUBLE; - bind[ofs].buffer = (gptr)&Z_DVAL_PP(args[i]); - bind[ofs].is_null = &stmt->param.is_null[ofs]; - break; - - case 'i': /* Integer */ - bind[ofs].buffer_type = MYSQL_TYPE_LONG; - bind[ofs].buffer = (gptr)&Z_LVAL_PP(args[i]); - bind[ofs].is_null = &stmt->param.is_null[ofs]; - break; - - case 'b': /* Blob (send data) */ - bind[ofs].buffer_type = MYSQL_TYPE_LONG_BLOB; - bind[ofs].is_null = 0; - bind[ofs].length = 0; - break; - - case 's': /* string */ - bind[ofs].buffer_type = MYSQL_TYPE_VAR_STRING; - bind[ofs].buffer = NULL; - bind[ofs].buffer_length = 0; - bind[ofs].is_null = &stmt->param.is_null[ofs]; - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i+1); - efree(args); - efree(bind); - RETURN_FALSE; - break; - } - ofs++; - } - rc = mysql_stmt_bind_param(stmt->stmt, bind); - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - - if (rc) { - efree(args); - efree(bind); - RETURN_FALSE; - } - - stmt->param.var_cnt = num_vars; - stmt->param.vars = (zval **)safe_emalloc(num_vars, sizeof(zval), 0); - for (i = 0; i < num_vars; i++) { - if (bind[i].buffer_type != MYSQL_TYPE_LONG_BLOB) { - ZVAL_ADDREF(*args[i+start]); - stmt->param.vars[i] = *args[i+start]; - } else { - stmt->param.vars[i] = NULL; - } - } - efree(args); - efree(bind); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_bind_result(object stmt, mixed var, [,mixed, ...]) - Bind variables to a prepared statement for result storage */ - -/* TODO: - do_alloca, free_alloca -*/ - -PHP_FUNCTION(mysqli_stmt_bind_result) -{ - zval ***args; - int argc = ZEND_NUM_ARGS(); - int i; - int start = 1; - int var_cnt; - int ofs; - long col_type; - ulong rc; - MY_STMT *stmt; - zval *mysql_stmt; - MYSQL_BIND *bind; - - if (getThis()) { - start = 0; - } - - if (zend_parse_method_parameters((getThis()) ? 0:1 TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (argc < (getThis() ? 1 : 2)) { - WRONG_PARAM_COUNT; - } - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - var_cnt = argc - start; - - if (var_cnt != mysql_stmt_field_count(stmt->stmt)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement."); - efree(args); - RETURN_FALSE; - } - - /* prevent leak if variables are already bound */ - if (stmt->result.var_cnt) { - php_free_stmt_bind_buffer(stmt->result, FETCH_RESULT); - } - - bind = (MYSQL_BIND *)ecalloc(var_cnt, sizeof(MYSQL_BIND)); - stmt->result.buf = (VAR_BUFFER *)ecalloc(var_cnt,sizeof(VAR_BUFFER)); - stmt->result.is_null = (char *)ecalloc(var_cnt, sizeof(char)); - - for (i=start; i < var_cnt + start ; i++) { - ofs = i - start; - stmt->result.is_null[ofs] = 0; - col_type = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].type : MYSQL_TYPE_STRING; - - switch (col_type) { - case MYSQL_TYPE_DOUBLE: - case MYSQL_TYPE_FLOAT: - convert_to_double_ex(args[i]); - stmt->result.buf[ofs].type = IS_DOUBLE; - stmt->result.buf[ofs].buflen = sizeof(double); - - /* allocate buffer for double */ - stmt->result.buf[ofs].val = (char *)emalloc(sizeof(double)); - bind[ofs].buffer_type = MYSQL_TYPE_DOUBLE; - bind[ofs].buffer = stmt->result.buf[ofs].val; - bind[ofs].is_null = &stmt->result.is_null[ofs]; - break; - - case MYSQL_TYPE_NULL: - stmt->result.buf[ofs].type = IS_NULL; - stmt->result.buf[ofs].buflen = 0; - bind[ofs].buffer_type = MYSQL_TYPE_NULL; - bind[ofs].buffer = 0; - bind[ofs].is_null = &stmt->result.is_null[ofs]; - bind[ofs].buffer_length = 0; - break; - - case MYSQL_TYPE_SHORT: - case MYSQL_TYPE_TINY: - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_INT24: - case MYSQL_TYPE_YEAR: - convert_to_long_ex(args[i]); - stmt->result.buf[ofs].type = IS_LONG; - stmt->result.buf[ofs].buflen = 0; - stmt->result.buf[ofs].val = (char *)emalloc(sizeof(long)); - bind[ofs].buffer_type = MYSQL_TYPE_LONG; - bind[ofs].buffer = stmt->result.buf[ofs].val; - bind[ofs].is_null = &stmt->result.is_null[ofs]; - break; - - case MYSQL_TYPE_LONGLONG: - stmt->result.buf[ofs].type = IS_STRING; - stmt->result.buf[ofs].buflen = sizeof(my_ulonglong); - stmt->result.buf[ofs].val = (char *)emalloc(stmt->result.buf[ofs].buflen); - bind[ofs].buffer_type = MYSQL_TYPE_LONGLONG; - bind[ofs].buffer = stmt->result.buf[ofs].val; - bind[ofs].is_null = &stmt->result.is_null[ofs]; - bind[ofs].buffer_length = stmt->result.buf[ofs].buflen; - break; - - case MYSQL_TYPE_DATE: - case MYSQL_TYPE_TIME: - case MYSQL_TYPE_DATETIME: - case MYSQL_TYPE_NEWDATE: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_TIMESTAMP: - case MYSQL_TYPE_DECIMAL: -#ifdef FIELD_TYPE_NEWDECIMAL - case MYSQL_TYPE_NEWDECIMAL: -#endif - stmt->result.buf[ofs].type = IS_STRING; - /* - If the user has called $stmt->store_result() then we have asked - max_length to be updated. this is done only for BLOBS because we don't want to allocate - big chunkgs of memory 2^16 or 2^24 - */ - if (stmt->stmt->fields[ofs].max_length == 0) { - stmt->result.buf[ofs].buflen = - (stmt->stmt->fields) ? (stmt->stmt->fields[ofs].length) ? stmt->stmt->fields[ofs].length + 1: 256: 256; - } else { - /* - the user has called store_result(). if he does not there is no way to determine the - */ - stmt->result.buf[ofs].buflen = stmt->stmt->fields[ofs].max_length; - } - stmt->result.buf[ofs].val = (char *)emalloc(stmt->result.buf[ofs].buflen); - bind[ofs].buffer_type = MYSQL_TYPE_STRING; - bind[ofs].buffer = stmt->result.buf[ofs].val; - bind[ofs].is_null = &stmt->result.is_null[ofs]; - bind[ofs].buffer_length = stmt->result.buf[ofs].buflen; - bind[ofs].length = &stmt->result.buf[ofs].buflen; - break; - } - } - - rc = mysql_stmt_bind_result(stmt->stmt, bind); - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - - if (rc) { - efree(bind); - efree(args); - php_clear_stmt_bind(stmt); - RETURN_FALSE; - } - - stmt->result.var_cnt = var_cnt; - stmt->result.vars = (zval **)safe_emalloc((var_cnt), sizeof(zval), 0); - for (i = start; i < var_cnt+start; i++) { - ofs = i-start; - ZVAL_ADDREF(*args[i]); - stmt->result.vars[ofs] = *args[i]; - } - - efree(args); - efree(bind); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_change_user(object link, string user, string password, string database) - Change logged-in user of the active connection */ -PHP_FUNCTION(mysqli_change_user) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - char *user, *password, *dbname; - int user_len, password_len, dbname_len; - ulong rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - rc = mysql_change_user(mysql->mysql, user, password, dbname); - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - - if (rc) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string mysqli_character_set_name(object link) - Returns the name of the character set used for this connection */ -PHP_FUNCTION(mysqli_character_set_name) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_STRING((char *) mysql_character_set_name(mysql->mysql), 1); -} -/* }}} */ - -/* {{{ proto bool mysqli_close(object link) - Close connection */ -PHP_FUNCTION(mysqli_close) -{ - zval *mysql_link; - MY_MYSQL *mysql; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - mysql_close(mysql->mysql); - php_clear_mysql(mysql); - efree(mysql); - MYSQLI_CLEAR_RESOURCE(&mysql_link); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_commit(object link) - Commit outstanding actions and close transaction */ -PHP_FUNCTION(mysqli_commit) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - if (mysql_commit(mysql->mysql)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_data_seek(object result, int offset) - Move internal result pointer */ -PHP_FUNCTION(mysqli_data_seek) -{ - MYSQL_RES *result; - zval *mysql_result; - long offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT"); - RETURN_FALSE; - } - - if (offset < 0 || offset >= result->row_count) { - RETURN_FALSE; - } - - mysql_data_seek(result, offset); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void mysqli_debug(string debug) -*/ -PHP_FUNCTION(mysqli_debug) -{ - char *debug; - int debug_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &debug, &debug_len) == FAILURE) { - return; - } - - mysql_debug(debug); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_dump_debug_info(object link) -*/ -PHP_FUNCTION(mysqli_dump_debug_info) -{ - MY_MYSQL *mysql; - zval *mysql_link; - ulong rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - rc = mysql_dump_debug_info(mysql->mysql); - - if (rc) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_errno(object link) - Returns the numerical value of the error message from previous MySQL operation */ -PHP_FUNCTION(mysqli_errno) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - RETURN_LONG(mysql_errno(mysql->mysql)); -} -/* }}} */ - -/* {{{ proto string mysqli_error(object link) - Returns the text of the error message from previous MySQL operation */ -PHP_FUNCTION(mysqli_error) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - RETURN_STRING((char *)mysql_error(mysql->mysql),1); -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_execute(object stmt) - Execute a prepared statement */ -PHP_FUNCTION(mysqli_stmt_execute) -{ - MY_STMT *stmt; - zval *mysql_stmt; - unsigned int i; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - for (i = 0; i < stmt->param.var_cnt; i++) { - if (stmt->param.vars[i]) { - if ( !(stmt->param.is_null[i] = (stmt->param.vars[i]->type == IS_NULL)) ) { - switch (stmt->stmt->params[i].buffer_type) { - case MYSQL_TYPE_VAR_STRING: - convert_to_string_ex(&stmt->param.vars[i]); - stmt->stmt->params[i].buffer = Z_STRVAL_PP(&stmt->param.vars[i]); - stmt->stmt->params[i].buffer_length = Z_STRLEN_PP(&stmt->param.vars[i]); - break; - case MYSQL_TYPE_DOUBLE: - convert_to_double_ex(&stmt->param.vars[i]); - stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]); - break; - case MYSQL_TYPE_LONG: - convert_to_long_ex(&stmt->param.vars[i]); - stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]); - break; - default: - break; - } - } - } - } - if (mysql_stmt_execute(stmt->stmt)) { - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - RETURN_FALSE; - } - - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index(stmt->query, stmt->stmt->mysql->server_status TSRMLS_CC); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_stmt_fetch(object stmt) - Fetch results from a prepared statement into the bound variables */ -PHP_FUNCTION(mysqli_stmt_fetch) -{ - MY_STMT *stmt; - zval *mysql_stmt; - unsigned int i; - ulong ret; - int lval; - double dval; - my_ulonglong llval; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - /* reset buffers */ - - - for (i = 0; i < stmt->result.var_cnt; i++) { - if (stmt->result.buf[i].type == IS_STRING) { - memset(stmt->result.buf[i].val, 0, stmt->result.buf[i].buflen); - } - } - ret = mysql_stmt_fetch(stmt->stmt); -#ifdef MYSQL_DATA_TRUNCATED - if (!ret || ret == MYSQL_DATA_TRUNCATED) { -#else - if (!ret) { -#endif - for (i = 0; i < stmt->result.var_cnt; i++) { - if (stmt->result.vars[i]->type == IS_STRING && stmt->result.vars[i]->value.str.len) { - efree(stmt->result.vars[i]->value.str.val); - } - if (!stmt->result.is_null[i]) { - switch (stmt->result.buf[i].type) { - case IS_LONG: - memcpy(&lval, stmt->result.buf[i].val, sizeof(lval)); - ZVAL_LONG(stmt->result.vars[i], lval); - break; - case IS_DOUBLE: - memcpy(&dval, stmt->result.buf[i].val, sizeof(dval)); - ZVAL_DOUBLE(stmt->result.vars[i], dval); - break; - case IS_STRING: - if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_LONGLONG) { - char tmp[50]; - memcpy (&llval, stmt->result.buf[i].val, sizeof(my_ulonglong)); - if (llval != (long)llval) { - /* even though lval is declared as unsigned, the value - * may be negative. Therefor we cannot use %llu and must - * use %lld. - */ - sprintf((char *)&tmp, "%lld", llval); - ZVAL_STRING(stmt->result.vars[i], tmp, 1); - } else { - ZVAL_LONG(stmt->result.vars[i], llval); - } - } else { - ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1); - } - break; - default: - break; - } - } else { - stmt->result.vars[i]->type = IS_NULL; - } - } - } else { - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - } - - switch (ret) { - case 0: - RETURN_TRUE; - break; - case 1: - RETURN_FALSE; - break; - default: - RETURN_NULL(); - break; - } -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_field (object result) - Get column information from a result and return as an object */ -PHP_FUNCTION(mysqli_fetch_field) -{ - MYSQL_RES *result; - zval *mysql_result; - MYSQL_FIELD *field; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (!(field = mysql_fetch_field(result))) { - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name",(field->name ? field->name : ""), 1); - add_property_string(return_value, "orgname",(field->org_name ? field->org_name : ""), 1); - add_property_string(return_value, "table",(field->table ? field->table : ""), 1); - add_property_string(return_value, "orgtable",(field->org_table ? field->org_table : ""), 1); - add_property_string(return_value, "def",(field->def ? field->def : ""), 1); - add_property_long(return_value, "max_length", field->max_length); - add_property_long(return_value, "length", field->length); - add_property_long(return_value, "charsetnr", field->charsetnr); - add_property_long(return_value, "flags", field->flags); - add_property_long(return_value, "type", field->type); - add_property_long(return_value, "decimals", field->decimals); -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_fields (object result) - Return array of objects containing field meta-data */ -PHP_FUNCTION(mysqli_fetch_fields) -{ - MYSQL_RES *result; - zval *mysql_result; - MYSQL_FIELD *field; - zval *obj; - - unsigned int i; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (!(field = mysql_fetch_field(result))) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i = 0; i < mysql_num_fields(result); i++) { - field = mysql_fetch_field_direct(result, i); - - - MAKE_STD_ZVAL(obj); - object_init(obj); - - add_property_string(obj, "name",(field->name ? field->name : ""), 1); - add_property_string(obj, "orgname",(field->org_name ? field->org_name : ""), 1); - add_property_string(obj, "table",(field->table ? field->table : ""), 1); - add_property_string(obj, "orgtable",(field->org_table ? field->org_table : ""), 1); - add_property_string(obj, "def",(field->def ? field->def : ""), 1); - add_property_long(obj, "max_length", field->max_length); - add_property_long(obj, "length", field->length); - add_property_long(obj, "charsetnr", field->charsetnr); - add_property_long(obj, "flags", field->flags); - add_property_long(obj, "type", field->type); - add_property_long(obj, "decimals", field->decimals); - - add_index_zval(return_value, i, obj); - } -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_field_direct (object result, int offset) - Fetch meta-data for a single field */ -PHP_FUNCTION(mysqli_fetch_field_direct) -{ - MYSQL_RES *result; - zval *mysql_result; - MYSQL_FIELD *field; - long offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (offset < 0 || offset >= mysql_num_fields(result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset"); - RETURN_FALSE; - } - - if (!(field = mysql_fetch_field_direct(result,offset))) { - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name",(field->name ? field->name : ""), 1); - add_property_string(return_value, "orgname",(field->org_name ? field->org_name : ""), 1); - add_property_string(return_value, "table",(field->table ? field->table : ""), 1); - add_property_string(return_value, "orgtable",(field->org_table ? field->org_table : ""), 1); - add_property_string(return_value, "def",(field->def ? field->def : ""), 1); - add_property_long(return_value, "max_length", field->max_length); - add_property_long(return_value, "length", field->length); - add_property_long(return_value, "charsetnr", field->charsetnr); - add_property_long(return_value, "flags", field->flags); - add_property_long(return_value, "type", field->type); - add_property_long(return_value, "decimals", field->decimals); -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_lengths (object result) - Get the length of each output in a result */ -PHP_FUNCTION(mysqli_fetch_lengths) -{ - MYSQL_RES *result; - zval *mysql_result; - unsigned int i; - unsigned long *ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (!(ret = mysql_fetch_lengths(result))) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i = 0; i < mysql_num_fields(result); i++) { - add_index_long(return_value, i, ret[i]); - } -} -/* }}} */ - -/* {{{ proto array mysqli_fetch_row (object result) - Get a result row as an enumerated array */ -PHP_FUNCTION(mysqli_fetch_row) -{ - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_NUM, 0); -} -/* }}} */ - -/* {{{ proto int mysqli_field_count(object link) - Fetch the number of fields returned by the last query for the given link -*/ -PHP_FUNCTION(mysqli_field_count) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_field_count(mysql->mysql)); -} -/* }}} */ - -/* {{{ proto int mysqli_field_seek(object result, int fieldnr) - Set result pointer to a specified field offset -*/ -PHP_FUNCTION(mysqli_field_seek) -{ - MYSQL_RES *result; - zval *mysql_result; - unsigned long fieldnr; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT"); - RETURN_FALSE; - } - - mysql_field_seek(result, fieldnr); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_field_tell(object result) - Get current field offset of result pointer */ -PHP_FUNCTION(mysqli_field_tell) -{ - MYSQL_RES *result; - zval *mysql_result; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - RETURN_LONG(mysql_field_tell(result)); -} -/* }}} */ - -/* {{{ proto void mysqli_free_result(object result) - Free query result memory for the given result handle */ -PHP_FUNCTION(mysqli_free_result) -{ - MYSQL_RES *result; - zval *mysql_result; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - mysql_free_result(result); - MYSQLI_CLEAR_RESOURCE(&mysql_result); - - return; -} -/* }}} */ - -/* {{{ proto string mysqli_get_client_info(void) - Get MySQL client info */ -PHP_FUNCTION(mysqli_get_client_info) -{ - RETURN_STRING((char *)mysql_get_client_info(), 1); -} -/* }}} */ - -/* {{{ proto int mysqli_get_client_version(void) - Get MySQL client info */ -PHP_FUNCTION(mysqli_get_client_version) -{ - RETURN_LONG((long)mysql_get_client_version()); -} -/* }}} */ - -/* {{{ proto string mysqli_get_host_info (object link) - Get MySQL host info */ -PHP_FUNCTION(mysqli_get_host_info) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : "", 1); -} -/* }}} */ - -/* {{{ proto int mysqli_get_proto_info(object link) - Get MySQL protocol information */ -PHP_FUNCTION(mysqli_get_proto_info) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_get_proto_info(mysql->mysql)); -} -/* }}} */ - -/* {{{ proto string mysqli_get_server_info(object link) - Get MySQL server info */ -PHP_FUNCTION(mysqli_get_server_info) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_STRING((char *)mysql_get_server_info(mysql->mysql), 1); -} - -/* }}} */ - -/* {{{ proto int mysqli_get_server_version(object link) - Return the MySQL version for the server referenced by the given link */ -PHP_FUNCTION(mysqli_get_server_version) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_get_server_version(mysql->mysql)); -} -/* }}} */ - -/* {{{ proto string mysqli_info(object link) - Get information about the most recent query */ -PHP_FUNCTION(mysqli_info) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_STRING((mysql->mysql->info) ? mysql->mysql->info : "", 1); -} -/* }}} */ - -/* {{{ proto resource mysqli_init(void) - Initialize mysqli and return a resource for use with mysql_real_connect */ -PHP_FUNCTION(mysqli_init) -{ - MYSQLI_RESOURCE *mysqli_resource; - MY_MYSQL *mysql = (MY_MYSQL *)ecalloc(1, sizeof(MY_MYSQL)); - - if (!(mysql->mysql = mysql_init(NULL))) { - efree(mysql); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)mysql; - - if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC)) { - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry); - } else { - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource; - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1; - } -} -/* }}} */ - -/* {{{ proto mixed mysqli_insert_id(object link) - Get the ID generated from the previous INSERT operation */ -PHP_FUNCTION(mysqli_insert_id) -{ - MY_MYSQL *mysql; - my_ulonglong rc; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - rc = mysql_insert_id(mysql->mysql); - MYSQLI_RETURN_LONG_LONG(rc) -} -/* }}} */ - -/* {{{ proto bool mysqli_kill(object link, int processid) - Kill a mysql process on the server */ -PHP_FUNCTION(mysqli_kill) -{ - MY_MYSQL *mysql; - zval *mysql_link; - long processid; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_kill(mysql->mysql, processid)) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mysqli_set_local_infile_default(object link) - unsets user defined handler for load local infile command */ -PHP_FUNCTION(mysqli_set_local_infile_default) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql->li_read) { - efree(Z_STRVAL_P(mysql->li_read)); - zval_dtor(mysql->li_read); - mysql->li_read = NULL; - } -} -/* }}} */ - -/* {{{ proto bool mysqli_set_local_infile_handler(object link, callback read_func) - Set callback functions for LOAD DATA LOCAL INFILE */ -PHP_FUNCTION(mysqli_set_local_infile_handler) -{ - MY_MYSQL *mysql; - zval *mysql_link; - zval callback_name; - zval *callback_func; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz", &mysql_link, mysqli_link_class_entry, - &callback_func) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - /* check callback function */ - if (!zend_is_callable(callback_func, 0, &callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %R", Z_TYPE(callback_name), Z_UNIVAL(callback_name)); - zval_dtor(&callback_name); - RETURN_FALSE; - } - zval_dtor(&callback_name); - - /* save callback function */ - ALLOC_ZVAL(mysql->li_read); - ZVAL_STRING(mysql->li_read, callback_func->value.str.val, 1); -} -/* }}} */ - -/* {{{ proto bool mysqli_more_results(object link) - check if there any more query results from a multi query */ -PHP_FUNCTION(mysqli_more_results) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (!mysql_more_results(mysql->mysql)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_next_result(object link) - read next result from multi_query */ -PHP_FUNCTION(mysqli_next_result) { - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_next_result(mysql->mysql)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_num_fields(object result) - Get number of fields in result */ -PHP_FUNCTION(mysqli_num_fields) -{ - MYSQL_RES *result; - zval *mysql_result; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - RETURN_LONG(mysql_num_fields(result)); -} -/* }}} */ - -/* {{{ proto mixed mysqli_num_rows(object result) - Get number of rows in result */ -PHP_FUNCTION(mysqli_num_rows) -{ - MYSQL_RES *result; - zval *mysql_result; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - - if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT"); - RETURN_LONG(0); - } - - MYSQLI_RETURN_LONG_LONG(mysql_num_rows(result)); -} -/* }}} */ - -/* {{{ proto bool mysqli_options(object link, int flags, mixed values) - Set options */ -PHP_FUNCTION(mysqli_options) -{ - MY_MYSQL *mysql; - zval *mysql_link = NULL; - zval *mysql_value; - long mysql_option; - unsigned int l_value; - long ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - switch (Z_TYPE_PP(&mysql_value)) { - case IS_STRING: - ret = mysql_options(mysql->mysql, mysql_option, Z_STRVAL_PP(&mysql_value)); - break; - default: - convert_to_long_ex(&mysql_value); - l_value = Z_LVAL_PP(&mysql_value); - ret = mysql_options(mysql->mysql, mysql_option, (char *)&l_value); - break; - } - - if (ret != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - - -/* {{{ proto bool mysqli_ping(object link) - Ping a server connection or reconnect if there is no connection */ -PHP_FUNCTION(mysqli_ping) -{ - MY_MYSQL *mysql; - zval *mysql_link; - long rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - rc = mysql_ping(mysql->mysql); - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - if (rc) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_prepare(object link, string query) - Prepare a SQL statement for execution */ -PHP_FUNCTION(mysqli_prepare) -{ - MY_MYSQL *mysql; - MY_STMT *stmt; - char *query = NULL; - unsigned int query_len; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",&mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - if (mysql->mysql->status == MYSQL_STATUS_GET_RESULT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be fetched before a new statement prepare takes place"); - RETURN_FALSE; - } - - stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); - - if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) { - if (mysql_stmt_prepare(stmt->stmt, query, query_len)) { - char last_error[MYSQL_ERRMSG_SIZE]; - char sqlstate[SQLSTATE_LENGTH+1]; - unsigned int last_errno; - - /* mysql_stmt_close clears errors, so we have to store them temporarily */ - last_errno = stmt->stmt->last_errno; - memcpy(last_error, stmt->stmt->last_error, MYSQL_ERRMSG_SIZE); - memcpy(sqlstate, mysql->mysql->net.sqlstate, SQLSTATE_LENGTH+1); - - mysql_stmt_close(stmt->stmt); - stmt->stmt = NULL; - - /* restore error messages */ - mysql->mysql->net.last_errno = last_errno; - memcpy(mysql->mysql->net.last_error, last_error, MYSQL_ERRMSG_SIZE); - memcpy(mysql->mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH+1); - } - } - - if (!stmt->stmt) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - efree(stmt); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)stmt; - stmt->query = (query_len) ? (char *)emalloc(query_len + 1) : NULL; - strcpy(stmt->query, query); - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_stmt_class_entry); -} -/* }}} */ - -/* {{{ proto bool mysqli_real_connect(object link [,string hostname [,string username [,string passwd [,string dbname [,int port [,string socket [,int flags]]]]]]]) - Open a connection to a mysql server */ -PHP_FUNCTION(mysqli_real_connect) -{ - MY_MYSQL *mysql; - char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL; - unsigned int hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; - unsigned long port=0, flags=0; - zval *mysql_link; - zval *object = getThis(); - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sssslsl", &mysql_link, mysqli_link_class_entry, - &hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len, - &flags) == FAILURE) { - return; - } - - if (!socket_len) { - socket = NULL; - } - - /* TODO: safe mode handling */ - if (PG(sql_safe_mode)) { - } else { - if (!passwd) { - passwd = MyG(default_pw); - if (!username){ - username = MyG(default_user); - if (!hostname) { - hostname = MyG(default_host); - } - } - } - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - /* remove some insecure options */ - flags ^= CLIENT_MULTI_STATEMENTS; /* don't allow multi_queries via connect parameter */ - if (PG(open_basedir) && strlen(PG(open_basedir))) { - flags ^= CLIENT_LOCAL_FILES; - } - - if (!socket) { - socket = MyG(default_socket); - } - - if (mysql_real_connect(mysql->mysql,hostname,username,passwd,dbname,port,socket,flags) == NULL) { - - php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC); - php_mysqli_throw_sql_exception( mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC, - mysql->mysql->net.last_error); - - RETURN_FALSE; - } - php_mysqli_set_error(mysql_errno(mysql->mysql), (char *)mysql_error(mysql->mysql) TSRMLS_CC); - - mysql->mysql->reconnect = MyG(reconnect); - - /* set our own local_infile handler */ - php_set_local_infile_handler_default(mysql); - - if (object) { - ((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->valid = 1; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_real_query(object link, string query) - Binary-safe version of mysql_query() */ -PHP_FUNCTION(mysqli_real_query) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - MYSQLI_DISABLE_MQ; /* disable multi statements/queries */ - - if (mysql_real_query(mysql->mysql, query, query_len)) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; - } - - if (!mysql_field_count(mysql->mysql)) { - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index(query, mysql->mysql->server_status TSRMLS_CC); - } - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string mysqli_real_escape_string(object link, string escapestr) - Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection */ -PHP_FUNCTION(mysqli_real_escape_string) { - MY_MYSQL *mysql; - zval *mysql_link = NULL; - char *escapestr, *newstr; - int escapestr_len, newstr_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - newstr = safe_emalloc(2, escapestr_len, 1); - newstr_len = mysql_real_escape_string(mysql->mysql, newstr, escapestr, escapestr_len); - newstr = erealloc(newstr, newstr_len + 1); - - RETURN_STRING(newstr, 0); -} -/* }}} */ - -/* {{{ proto bool mysqli_rollback(object link) - Undo actions from current transaction */ -PHP_FUNCTION(mysqli_rollback) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_rollback(mysql->mysql)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_send_long_data(object stmt, int param_nr, string data) -*/ -PHP_FUNCTION(mysqli_stmt_send_long_data) -{ - MY_STMT *stmt; - zval *mysql_stmt; - char *data; - long param_nr; - int data_len; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, ¶m_nr, &data, &data_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (param_nr < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter number"); - RETURN_FALSE; - } - if (mysql_stmt_send_long_data(stmt->stmt, param_nr, data, data_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto mixed mysqli_stmt_affected_rows(object stmt) - Return the number of rows affected in the last query for the given link */ -PHP_FUNCTION(mysqli_stmt_affected_rows) -{ - MY_STMT *stmt; - zval *mysql_stmt; - my_ulonglong rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - rc = mysql_stmt_affected_rows(stmt->stmt); - if (rc == (my_ulonglong) -1) { - RETURN_LONG(-1); - } - MYSQLI_RETURN_LONG_LONG(rc) -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_close(object stmt) - Close statement */ -PHP_FUNCTION(mysqli_stmt_close) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - mysql_stmt_close(stmt->stmt); - stmt->stmt = NULL; - php_clear_stmt_bind(stmt); - MYSQLI_CLEAR_RESOURCE(&mysql_stmt); - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto void mysqli_stmt_data_seek(object stmt, int offset) - Move internal result pointer */ -PHP_FUNCTION(mysqli_stmt_data_seek) -{ - MY_STMT *stmt; - zval *mysql_stmt; - long offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) { - return; - } - if (offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be positive"); - RETURN_FALSE; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - mysql_stmt_data_seek(stmt->stmt, offset); - return; -} -/* }}} */ - -/* {{{ proto int mysqli_stmt_field_count(object stmt) { - Return the number of result columns for the given statement */ -PHP_FUNCTION(mysqli_stmt_field_count) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - RETURN_LONG(mysql_stmt_field_count(stmt->stmt)); -} -/* }}} */ - -/* {{{ proto void mysqli_stmt_free_result(object stmt) - Free stored result memory for the given statement handle */ -PHP_FUNCTION(mysqli_stmt_free_result) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - mysql_stmt_free_result(stmt->stmt); - - return; -} -/* }}} */ - -/* {{{ proto mixed mysqli_stmt_insert_id(object stmt) - Get the ID generated from the previous INSERT operation */ -PHP_FUNCTION(mysqli_stmt_insert_id) -{ - MY_STMT *stmt; - my_ulonglong rc; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - rc = mysql_stmt_insert_id(stmt->stmt); - MYSQLI_RETURN_LONG_LONG(rc) -} -/* }}} */ - -/* {{{ proto int mysqli_stmt_param_count(object stmt) { - Return the number of parameter for the given statement */ -PHP_FUNCTION(mysqli_stmt_param_count) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - RETURN_LONG(mysql_stmt_param_count(stmt->stmt)); -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_reset(object stmt) - reset a prepared statement */ -PHP_FUNCTION(mysqli_stmt_reset) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (mysql_stmt_reset(stmt->stmt)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_stmt_num_rows(object stmt) - Return the number of rows in statements result set */ -PHP_FUNCTION(mysqli_stmt_num_rows) -{ - MY_STMT *stmt; - zval *mysql_stmt; - my_ulonglong rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - rc = mysql_stmt_num_rows(stmt->stmt); - MYSQLI_RETURN_LONG_LONG(rc) -} -/* }}} */ - -/* {{{ proto string mysqli_select_db(object link, string dbname) - Select a MySQL database */ -PHP_FUNCTION(mysqli_select_db) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *dbname; - int dbname_len; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (!mysql_select_db(mysql->mysql, dbname)) { - RETURN_TRUE; - } - - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string mysqli_sqlstate(object link) - Returns the SQLSTATE error from previous MySQL operation */ -PHP_FUNCTION(mysqli_sqlstate) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - RETURN_STRING((char *)mysql_sqlstate(mysql->mysql),1); -} -/* }}} */ - -/* {{{ proto bool mysqli_ssl_set(object link ,string key ,string cert ,string ca ,string capath ,string cipher]) -*/ -PHP_FUNCTION(mysqli_ssl_set) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *ssl_parm[5]; - int ssl_parm_len[5], i; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osssss", &mysql_link, mysqli_link_class_entry, &ssl_parm[0], &ssl_parm_len[0], &ssl_parm[1], &ssl_parm_len[1], &ssl_parm[2], &ssl_parm_len[2], &ssl_parm[3], &ssl_parm_len[3], &ssl_parm[4], &ssl_parm_len[4]) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - for (i=0; i < 5; i++) { - if (!ssl_parm_len[i]) { - ssl_parm[i] = NULL; - } - } - - mysql_ssl_set(mysql->mysql, ssl_parm[0], ssl_parm[1], ssl_parm[2], ssl_parm[3], ssl_parm[4]); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_stat(object link) - Get current system status */ -PHP_FUNCTION(mysqli_stat) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *stat; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if ((stat = (char *)mysql_stat(mysql->mysql))) { - RETURN_STRING(stat, 1); - } - RETURN_FALSE; -} - -/* }}} */ - -/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, bool mode) -*/ -PHP_FUNCTION(mysqli_stmt_attr_set) -{ - MY_STMT *stmt; - zval *mysql_stmt; - ulong mode; - ulong attr; - int rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if ((rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode))) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_stmt_attr_get(object stmt, long attr) -*/ -PHP_FUNCTION(mysqli_stmt_attr_get) -{ - MY_STMT *stmt; - zval *mysql_stmt; - ulong value; - ulong attr; - int rc; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if ((rc = mysql_stmt_attr_get(stmt->stmt, attr, &value))) { - RETURN_FALSE; - } - RETURN_LONG(value); -} -/* }}} */ - -/* {{{ proto int mysqli_stmt_errno(object stmt) -*/ -PHP_FUNCTION(mysqli_stmt_errno) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - RETURN_LONG(mysql_stmt_errno(stmt->stmt)); -} -/* }}} */ - -/* {{{ proto string mysqli_stmt_error(object stmt) -*/ -PHP_FUNCTION(mysqli_stmt_error) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - RETURN_STRING((char *)mysql_stmt_error(stmt->stmt),1); -} -/* }}} */ - -/* {{{ proto mixed mysqli_stmt_init(object link) - Initialize statement object -*/ -PHP_FUNCTION(mysqli_stmt_init) -{ - MY_MYSQL *mysql; - MY_STMT *stmt; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); - - if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) { - efree(stmt); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)stmt; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_stmt_class_entry); -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_prepare(object stmt, string query) - prepare server side statement with query -*/ -PHP_FUNCTION(mysqli_stmt_prepare) -{ - MY_STMT *stmt; - zval *mysql_stmt; - char *query; - int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (mysql_stmt_prepare(stmt->stmt, query, query_len)) { - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_stmt_result_metadata(object stmt) - return result set from statement */ -PHP_FUNCTION(mysqli_stmt_result_metadata) -{ - MY_STMT *stmt; - MYSQL_RES *result; - zval *mysql_stmt; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - if (!(result = mysql_stmt_result_metadata(stmt->stmt))){ - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)result; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry); -} -/* }}} */ - -/* {{{ proto bool mysqli_stmt_store_result(stmt) -*/ -PHP_FUNCTION(mysqli_stmt_store_result) -{ - MY_STMT *stmt; - zval *mysql_stmt; - int i=0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - /* - If the user wants to store the data and we have BLOBs/TEXTs we try to allocate - not the maximal length of the type (which is 16MB even for LONGBLOB) but - the maximal length of the field in the result set. If he/she has quite big - BLOB/TEXT columns after calling store_result() the memory usage of PHP will - double - but this is a known problem of the simple MySQL API ;) - */ - for (i = mysql_stmt_field_count(stmt->stmt) - 1; i >=0; --i) { - if (stmt->stmt->fields && stmt->stmt->fields[i].type == MYSQL_TYPE_BLOB) { - my_bool tmp=1; - mysql_stmt_attr_set(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp); - break; - } - } - - if (mysql_stmt_store_result(stmt->stmt)){ - MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string mysqli_stmt_sqlstate(object stmt) -*/ -PHP_FUNCTION(mysqli_stmt_sqlstate) -{ - MY_STMT *stmt; - zval *mysql_stmt; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt"); - - RETURN_STRING((char *)mysql_stmt_sqlstate(stmt->stmt),1); -} -/* }}} */ - -/* {{{ proto object mysqli_store_result(object link) - Buffer result set on client */ -PHP_FUNCTION(mysqli_store_result) -{ - MY_MYSQL *mysql; - MYSQL_RES *result; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (!(result = mysql_store_result(mysql->mysql))) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; - } - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index("from previous query", mysql->mysql->server_status TSRMLS_CC); - } - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)result; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry); -} -/* }}} */ - -/* {{{ proto int mysqli_thread_id(object link) - Return the current thread ID */ -PHP_FUNCTION(mysqli_thread_id) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_thread_id(mysql->mysql)); -} -/* }}} */ - -/* {{{ proto bool mysqli_thread_safe(void) - Return whether thread safety is given or not */ -PHP_FUNCTION(mysqli_thread_safe) -{ - RETURN_BOOL(mysql_thread_safe()); -} - -/* }}} */ - -/* {{{ proto mixed mysqli_use_result(object link) - Directly retrieve query results - do not buffer results on client side */ -PHP_FUNCTION(mysqli_use_result) -{ - MY_MYSQL *mysql; - MYSQL_RES *result; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - if (!(result = mysql_use_result(mysql->mysql))) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; - } - - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index("from previous query", mysql->mysql->server_status TSRMLS_CC); - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)result; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry); -} -/* }}} */ - -/* {{{ proto int mysqli_warning_count (object link) - Return number of warnings from the last query for the given link */ -PHP_FUNCTION(mysqli_warning_count) -{ - MY_MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_warning_count(mysql->mysql)); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c deleted file mode 100644 index 7bd2fa59399e9..0000000000000 --- a/ext/mysqli/mysqli_driver.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" -#include "zend_exceptions.h" - - -#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \ -static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \ -{ \ - ALLOC_ZVAL(*retval); \ - ZVAL_BOOL(*retval, MyG(value)); \ - return SUCCESS; \ -} \ - -#define MAP_PROPERTY_MYG_BOOL_WRITE(name, value) \ -static int name(mysqli_object *obj, zval *value TSRMLS_DC) \ -{ \ - MyG(value) = Z_LVAL_P(value) > 0; \ - return SUCCESS; \ -} \ - -#define MAP_PROPERTY_MYG_LONG_READ(name, value) \ -static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \ -{ \ - ALLOC_ZVAL(*retval); \ - ZVAL_LONG(*retval, MyG(value)); \ - return SUCCESS; \ -} \ - -#define MAP_PROPERTY_MYG_LONG_WRITE(name, value) \ -static int name(mysqli_object *obj, zval *value TSRMLS_DC) \ -{ \ - MyG(value) = Z_LVAL_P(value); \ - return SUCCESS; \ -} \ - -#define MAP_PROPERTY_MYG_STRING_READ(name, value) \ -static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \ -{ \ - ALLOC_ZVAL(*retval); \ - ZVAL_STRING(*retval, MyG(value), 1); \ - return SUCCESS; \ -} \ - -#define MAP_PROPERTY_MYG_STRING_WRITE(name, value) \ -static int name(mysqli_object *obj, zval *value TSRMLS_DC) \ -{ \ - MyG(value) = Z_STRVAL_P(value); \ - return SUCCESS; \ -} \ - -/* {{{ property driver_report_write */ -static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC) -{ - MyG(report_mode) = Z_LVAL_P(value); - php_set_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, - zend_exception_get_default(TSRMLS_C) TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - -/* {{{ property driver_embedded_read */ -static int driver_embedded_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); -#ifdef HAVE_EMBEDDED_MYSQLI - ZVAL_BOOL(*retval, 1); -#else - ZVAL_BOOL(*retval, 0); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ property driver_client_version_read */ -static int driver_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_LONG(*retval, MYSQL_VERSION_ID); - return SUCCESS; -} -/* }}} */ - -/* {{{ property driver_client_info_read */ -static int driver_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ property driver_driver_version_read */ -static int driver_driver_version_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_LONG(*retval, MYSQLI_VERSION_ID); - return SUCCESS; -} -/* }}} */ - -MAP_PROPERTY_MYG_BOOL_READ(driver_reconnect_read, reconnect); -MAP_PROPERTY_MYG_BOOL_WRITE(driver_reconnect_write, reconnect); -MAP_PROPERTY_MYG_LONG_READ(driver_report_read, report_mode); - -ZEND_FUNCTION(mysqli_driver_construct) -{ - -} - -mysqli_property_entry mysqli_driver_property_entries[] = { - {"client_info", driver_client_info_read, NULL}, - {"client_version", driver_client_version_read, NULL}, - {"driver_version", driver_driver_version_read, NULL}, - {"embedded", driver_embedded_read, NULL}, - {"reconnect", driver_reconnect_read, driver_reconnect_write}, - {"report_mode", driver_report_read, driver_report_write}, - {NULL, NULL, NULL} -}; - -/* {{{ mysqli_driver_methods[] - */ -function_entry mysqli_driver_methods[] = { - PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL) - PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c deleted file mode 100644 index 34405810da00f..0000000000000 --- a/ext/mysqli/mysqli_embedded.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ proto bool mysqli_embedded_server_start(bool start, array arguments, array groups) - initialize and start embedded server */ -PHP_FUNCTION(mysqli_embedded_server_start) -{ -#ifdef HAVE_EMBEDDED_MYSQLI - int argc = 0; - char **arguments; - char **groups; - zval **args, **grps, **start; - HashPosition pos; - int index, rc; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &start, &args, &grps) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(start); - convert_to_array_ex(args); - convert_to_array_ex(grps); - - if (!Z_LVAL_PP(start)) { - mysql_server_init(-1,NULL, NULL); - RETURN_TRUE; - } - /* get arguments */ - if ((argc = zend_hash_num_elements(HASH_OF(*args)))) { - arguments = safe_emalloc(sizeof(char *), argc + 1, 0); - arguments[0] = NULL; - - zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos); - - for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), &pos)) { - zval **item; - - if (zend_hash_get_current_data_ex(HASH_OF(*args), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - arguments[++index] = Z_STRVAL_PP(item); - } - argc++; - } - - /* get groups */ - if ((zend_hash_num_elements(HASH_OF(*grps)))) { - groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(HASH_OF(*grps)) + 1, 0); - arguments[0] = NULL; - - zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos); - - for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), &pos)) { - zval ** item; - - if (zend_hash_get_current_data_ex(HASH_OF(*args), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - groups[++index] = Z_STRVAL_PP(item); - } - groups[index] = NULL; - } else { - groups = safe_emalloc(sizeof(char *), 1, 0); - groups[0] = NULL; - } - - rc = mysql_server_init(argc, arguments, NULL); - - if (argc) { - efree(arguments); - } - efree(groups); - - if (rc) { - RETURN_FALSE; - } - RETURN_TRUE; -#endif -} -/* }}} */ - -/* {{{ proto void mysqli_embedded_server_end(void) -*/ -PHP_FUNCTION(mysqli_embedded_server_end) -{ -#ifdef HAVE_MYSQLI_EMBEDDED - mysql_server_end(); -#endif -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c deleted file mode 100644 index a65fd97eb6958..0000000000000 --- a/ext/mysqli/mysqli_exception.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" -#include "zend_exceptions.h" - -/* {{{ mysqli_exception_methods[] - */ -function_entry mysqli_exception_methods[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...) -{ - zval *sql_ex; - va_list arg; - char *message; - - va_start(arg, format); - vspprintf(&message, 0, format, arg); - va_end(arg);; - - if (!(MyG(report_mode) & MYSQLI_REPORT_STRICT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message); - efree(message); - return; - } - - MAKE_STD_ZVAL(sql_ex); - object_init_ex(sql_ex, mysqli_exception_class_entry); - - if (message) { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "message", sizeof("message") - 1, - message TSRMLS_CC); - } - - if (sqlstate) { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1, - sqlstate TSRMLS_CC); - } else { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1, - "00000" TSRMLS_CC); - } - - efree(message); - zend_update_property_long(mysqli_exception_class_entry, sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC); - - zend_throw_exception_object(sql_ex TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c deleted file mode 100644 index 31993ca4ec0f5..0000000000000 --- a/ext/mysqli/mysqli_fe.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - - -static - ZEND_BEGIN_ARG_INFO(second_arg_force_by_ref_rest, 1) - ZEND_ARG_PASS_INFO(0) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(third_arg_force_by_ref_rest, 1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(all_args_force_by_ref, 1) - ZEND_END_ARG_INFO(); - - -/* {{{ mysqli_functions[] - * - * Every user visible function must have an entry in mysqli_functions[]. - */ -function_entry mysqli_functions[] = { - PHP_FE(mysqli_affected_rows, NULL) - PHP_FE(mysqli_autocommit, NULL) - PHP_FE(mysqli_change_user, NULL) - PHP_FE(mysqli_character_set_name, NULL) - PHP_FE(mysqli_close, NULL) - PHP_FE(mysqli_commit, NULL) - PHP_FE(mysqli_connect, NULL) - PHP_FE(mysqli_connect_errno, NULL) - PHP_FE(mysqli_connect_error, NULL) - PHP_FE(mysqli_data_seek, NULL) - PHP_FE(mysqli_debug, NULL) - PHP_FE(mysqli_disable_reads_from_master, NULL) - PHP_FE(mysqli_disable_rpl_parse, NULL) - PHP_FE(mysqli_dump_debug_info, NULL) - PHP_FE(mysqli_enable_reads_from_master, NULL) - PHP_FE(mysqli_enable_rpl_parse, NULL) - PHP_FE(mysqli_embedded_server_end, NULL) - PHP_FE(mysqli_embedded_server_start, NULL) - PHP_FE(mysqli_errno, NULL) - PHP_FE(mysqli_error, NULL) - PHP_FE(mysqli_stmt_execute, NULL) - PHP_FALIAS(mysqli_execute, mysqli_stmt_execute, NULL) - PHP_FE(mysqli_fetch_field, NULL) - PHP_FE(mysqli_fetch_fields, NULL) - PHP_FE(mysqli_fetch_field_direct, NULL) - PHP_FE(mysqli_fetch_lengths, NULL) - PHP_FE(mysqli_fetch_array, NULL) - PHP_FE(mysqli_fetch_assoc, NULL) - PHP_FE(mysqli_fetch_object, NULL) - PHP_FE(mysqli_fetch_row, NULL) - PHP_FE(mysqli_field_count, NULL) - PHP_FE(mysqli_field_seek, NULL) - PHP_FE(mysqli_field_tell, NULL) - PHP_FE(mysqli_free_result, NULL) -#ifdef HAVE_MYSQLI_GET_CHARSET - PHP_FE(mysqli_get_charset, NULL) -#endif - PHP_FE(mysqli_get_client_info, NULL) - PHP_FE(mysqli_get_client_version, NULL) - PHP_FE(mysqli_get_host_info, NULL) - PHP_FE(mysqli_get_proto_info, NULL) - PHP_FE(mysqli_get_server_info, NULL) - PHP_FE(mysqli_get_server_version, NULL) - PHP_FE(mysqli_get_warnings, NULL) - PHP_FE(mysqli_init, NULL) - PHP_FE(mysqli_info, NULL) - PHP_FE(mysqli_insert_id, NULL) - PHP_FE(mysqli_kill, NULL) - PHP_FE(mysqli_set_local_infile_default, NULL) - PHP_FE(mysqli_set_local_infile_handler, NULL) - PHP_FE(mysqli_master_query, NULL) - PHP_FE(mysqli_more_results, NULL) - PHP_FE(mysqli_multi_query, NULL) - PHP_FE(mysqli_next_result, NULL) - PHP_FE(mysqli_num_fields, NULL) - PHP_FE(mysqli_num_rows, NULL) - PHP_FE(mysqli_options, NULL) - PHP_FE(mysqli_ping, NULL) - PHP_FE(mysqli_prepare, NULL) - PHP_FE(mysqli_report, NULL) - PHP_FE(mysqli_query, NULL) - PHP_FE(mysqli_real_connect, NULL) - PHP_FE(mysqli_real_escape_string, NULL) - PHP_FE(mysqli_real_query, NULL) - PHP_FE(mysqli_rollback, NULL) - PHP_FE(mysqli_rpl_parse_enabled, NULL) - PHP_FE(mysqli_rpl_probe, NULL) - PHP_FE(mysqli_rpl_query_type, NULL) - PHP_FE(mysqli_select_db, NULL) -#ifdef HAVE_MYSQLI_SET_CHARSET - PHP_FE(mysqli_set_charset, NULL) -#endif - PHP_FE(mysqli_stmt_attr_get, NULL) - PHP_FE(mysqli_stmt_attr_set, NULL) - PHP_FE(mysqli_stmt_field_count, NULL) - PHP_FE(mysqli_stmt_init, NULL) - PHP_FE(mysqli_stmt_prepare, NULL) - PHP_FE(mysqli_stmt_result_metadata, NULL) - PHP_FE(mysqli_stmt_send_long_data, NULL) - PHP_FE(mysqli_stmt_bind_param, third_arg_force_by_ref_rest) - PHP_FE(mysqli_stmt_bind_result, second_arg_force_by_ref_rest) - PHP_FE(mysqli_stmt_fetch, NULL) - PHP_FE(mysqli_stmt_free_result, NULL) - PHP_FE(mysqli_stmt_get_warnings, NULL) - PHP_FE(mysqli_stmt_insert_id, NULL) - PHP_FE(mysqli_stmt_reset, NULL) - PHP_FE(mysqli_stmt_param_count, NULL) - PHP_FE(mysqli_send_query, NULL) - PHP_FE(mysqli_slave_query, NULL) - PHP_FE(mysqli_sqlstate, NULL) - PHP_FE(mysqli_ssl_set, NULL) - PHP_FE(mysqli_stat, NULL) - PHP_FE(mysqli_stmt_affected_rows, NULL) - PHP_FE(mysqli_stmt_close, NULL) - PHP_FE(mysqli_stmt_data_seek, NULL) - PHP_FE(mysqli_stmt_errno, NULL) - PHP_FE(mysqli_stmt_error, NULL) - PHP_FE(mysqli_stmt_num_rows, NULL) - PHP_FE(mysqli_stmt_sqlstate, NULL) - PHP_FE(mysqli_store_result, NULL) - PHP_FE(mysqli_stmt_store_result, NULL) - PHP_FE(mysqli_thread_id, NULL) - PHP_FE(mysqli_thread_safe, NULL) - PHP_FE(mysqli_use_result, NULL) - PHP_FE(mysqli_warning_count, NULL) - - /* Aliases */ - PHP_FALIAS(mysqli_bind_param, - mysqli_stmt_bind_param, third_arg_force_by_ref_rest) - PHP_FALIAS(mysqli_bind_result, - mysqli_stmt_bind_result, second_arg_force_by_ref_rest) - PHP_FALIAS(mysqli_client_encoding, - mysqli_character_set_name, NULL) - PHP_FALIAS(mysqli_escape_string, - mysqli_real_escape_string, NULL) - PHP_FALIAS(mysqli_fetch, mysqli_stmt_fetch, NULL) - PHP_FALIAS(mysqli_param_count, - mysqli_stmt_param_count, NULL) - PHP_FALIAS(mysqli_get_metadata, - mysqli_stmt_result_metadata, NULL) - PHP_FALIAS(mysqli_send_long_data, - mysqli_stmt_send_long_data, NULL) - PHP_FALIAS(mysqli_set_opt, mysqli_options, NULL) - - {NULL, NULL, NULL} /* Must be the last line in mysqli_functions[] */ -}; -/* }}} */ - -/* {{{ mysqli_link_methods[] - * - * Every user visible function must have an entry in mysqli_functions[]. - */ -function_entry mysqli_link_methods[] = { - PHP_FALIAS(autocommit,mysqli_autocommit,NULL) - PHP_FALIAS(change_user,mysqli_change_user,NULL) - PHP_FALIAS(character_set_name, mysqli_character_set_name,NULL) - PHP_FALIAS(client_encoding, mysqli_character_set_name,NULL) - PHP_FALIAS(close,mysqli_close,NULL) - PHP_FALIAS(commit,mysqli_commit,NULL) - PHP_FALIAS(connect,mysqli_connect,NULL) - PHP_FALIAS(debug,mysqli_debug,NULL) - PHP_FALIAS(disable_reads_from_master,mysqli_disable_reads_from_master,NULL) - PHP_FALIAS(disable_rpl_parse,mysqli_disable_rpl_parse,NULL) - PHP_FALIAS(dump_debug_info,mysqli_dump_debug_info,NULL) - PHP_FALIAS(enable_reads_from_master,mysqli_enable_reads_from_master,NULL) - PHP_FALIAS(enable_rpl_parse,mysqli_enable_rpl_parse,NULL) -#ifdef HAVE_MYSQLI_GET_CHARSET - PHP_FALIAS(get_charset,mysqli_get_charset,NULL) -#endif - PHP_FALIAS(get_client_info,mysqli_get_client_info,NULL) - PHP_FALIAS(get_server_info,mysqli_get_server_info,NULL) - PHP_FALIAS(get_warnings, mysqli_get_warnings, NULL) - PHP_FALIAS(init,mysqli_init,NULL) - PHP_FALIAS(kill,mysqli_kill,NULL) - PHP_FALIAS(set_local_infile_default,mysqli_set_local_infile_default,NULL) - PHP_FALIAS(set_local_infile_handler,mysqli_set_local_infile_handler,NULL) - PHP_FALIAS(master_query,mysqli_master_query,NULL) - PHP_FALIAS(multi_query,mysqli_multi_query,NULL) - PHP_FALIAS(mysqli,mysqli_connect,NULL) - PHP_FALIAS(more_results,mysqli_more_results, NULL) - PHP_FALIAS(next_result, mysqli_next_result, NULL) - PHP_FALIAS(options,mysqli_options,NULL) - PHP_FALIAS(ping,mysqli_ping,NULL) - PHP_FALIAS(prepare,mysqli_prepare,NULL) - PHP_FALIAS(query,mysqli_query,NULL) - PHP_FALIAS(real_connect,mysqli_real_connect,NULL) - PHP_FALIAS(real_escape_string,mysqli_real_escape_string,NULL) - PHP_FALIAS(escape_string, mysqli_real_escape_string,NULL) - PHP_FALIAS(real_query,mysqli_real_query,NULL) - PHP_FALIAS(rollback,mysqli_rollback,NULL) - PHP_FALIAS(rpl_parse_enabled,mysqli_rpl_parse_enabled,NULL) - PHP_FALIAS(rpl_probe,mysqli_rpl_probe,NULL) - PHP_FALIAS(rpl_query_type,mysqli_rpl_query_type,NULL) - PHP_FALIAS(select_db,mysqli_select_db,NULL) -#ifdef HAVE_MYSQLI_SET_CHARSET - PHP_FALIAS(set_charset,mysqli_set_charset,NULL) -#endif - PHP_FALIAS(set_opt, mysqli_options,NULL) - PHP_FALIAS(slave_query,mysqli_slave_query,NULL) - PHP_FALIAS(ssl_set,mysqli_ssl_set,NULL) - PHP_FALIAS(stat,mysqli_stat,NULL) - PHP_FALIAS(stmt_init,mysqli_stmt_init, NULL) - PHP_FALIAS(store_result,mysqli_store_result,NULL) - PHP_FALIAS(thread_safe,mysqli_thread_safe,NULL) - PHP_FALIAS(use_result,mysqli_use_result,NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ mysqli_result_methods[] - * - * Every user visible function must have an entry in mysqli_result_functions[]. - */ -function_entry mysqli_result_methods[] = { - PHP_FALIAS(close,mysqli_free_result,NULL) - PHP_FALIAS(free,mysqli_free_result,NULL) - PHP_FALIAS(data_seek,mysqli_data_seek,NULL) - PHP_FALIAS(fetch_field,mysqli_fetch_field,NULL) - PHP_FALIAS(fetch_fields,mysqli_fetch_fields,NULL) - PHP_FALIAS(fetch_field_direct,mysqli_fetch_field_direct,NULL) - PHP_FALIAS(fetch_array,mysqli_fetch_array,NULL) - PHP_FALIAS(fetch_assoc,mysqli_fetch_assoc,NULL) - PHP_FALIAS(fetch_object,mysqli_fetch_object,NULL) - PHP_FALIAS(fetch_row,mysqli_fetch_row,NULL) - PHP_FALIAS(field_count,mysqli_field_count,NULL) - PHP_FALIAS(field_seek,mysqli_field_seek,NULL) - PHP_FALIAS(free_result,mysqli_free_result,NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ mysqli_stmt_methods[] - * - * Every user visible function must have an entry in mysqli_stmt_functions[]. - */ -function_entry mysqli_stmt_methods[] = { - PHP_FALIAS(attr_get,mysqli_stmt_attr_get,NULL) - PHP_FALIAS(attr_set,mysqli_stmt_attr_set,NULL) - PHP_FALIAS(bind_param,mysqli_stmt_bind_param,second_arg_force_by_ref_rest) - PHP_FALIAS(bind_result,mysqli_stmt_bind_result,all_args_force_by_ref) - PHP_FALIAS(close,mysqli_stmt_close,NULL) - PHP_FALIAS(data_seek,mysqli_stmt_data_seek,NULL) - PHP_FALIAS(execute,mysqli_stmt_execute,NULL) - PHP_FALIAS(fetch,mysqli_stmt_fetch,NULL) - PHP_FALIAS(get_warnings, mysqli_stmt_get_warnings, NULL) - PHP_FALIAS(result_metadata, mysqli_stmt_result_metadata,NULL) - PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL) - PHP_FALIAS(send_long_data,mysqli_stmt_send_long_data,NULL) - PHP_FALIAS(stmt,mysqli_prepare,NULL) - PHP_FALIAS(free_result,mysqli_stmt_free_result,NULL) - PHP_FALIAS(reset,mysqli_stmt_reset,NULL) - PHP_FALIAS(prepare,mysqli_stmt_prepare, NULL) - PHP_FALIAS(store_result,mysqli_stmt_store_result,NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c deleted file mode 100644 index b3346cc861bf7..0000000000000 --- a/ext/mysqli/mysqli_nonapi.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ proto object mysqli_connect([string hostname [,string username [,string passwd [,string dbname [,int port [,string socket]]]]]]) - Open a connection to a mysql server */ -PHP_FUNCTION(mysqli_connect) -{ - MY_MYSQL *mysql; - MYSQLI_RESOURCE *mysqli_resource; - zval *object = getThis(); - char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL; - unsigned int hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; - long port=0; - - if (getThis() && !ZEND_NUM_ARGS()) { - RETURN_NULL(); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len, - &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) { - return; - } - - if (!socket_len) { - socket = NULL; - } - - /* TODO: safe mode handling */ - if (PG(sql_safe_mode)){ - } else { - if (!passwd) { - passwd = MyG(default_pw); - if (!username){ - username = MyG(default_user); - if (!hostname) { - hostname = MyG(default_host); - } - } - } - } - - mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL)); - - if (!(mysql->mysql = mysql_init(NULL))) { - efree(mysql); - RETURN_FALSE; - } - -#ifdef HAVE_EMBEDDED_MYSQLI - if (hostname_len && hostname) { - unsigned int external=1; - mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external); - } else { - mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0); - } -#endif - - if (!socket) { - socket = MyG(default_socket); - } - - if (mysql_real_connect(mysql->mysql,hostname,username,passwd,dbname,port,socket,CLIENT_MULTI_RESULTS) == NULL) { - /* Save error messages */ - - php_mysqli_throw_sql_exception( mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC, - mysql->mysql->net.last_error); - - php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC); - - /* free mysql structure */ - mysql_close(mysql->mysql); - efree(mysql); - RETURN_FALSE; - } - - /* clear error */ - php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC); - - mysql->mysql->reconnect = MyG(reconnect); - - /* set our own local_infile handler */ - php_set_local_infile_handler_default(mysql); - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)mysql; - - if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) { - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry); - } else { - ((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->ptr = mysqli_resource; - ((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->valid = 1; - } -} -/* }}} */ - -/* {{{ proto int mysqli_connect_errno(void) - Returns the numerical value of the error message from last connect command */ -PHP_FUNCTION(mysqli_connect_errno) -{ - RETURN_LONG(MyG(error_no)); -} -/* }}} */ - -/* {{{ proto string mysqli_connect_error(void) - Returns the text of the error message from previous MySQL operation */ -PHP_FUNCTION(mysqli_connect_error) -{ - if (MyG(error_msg)) { - RETURN_STRING(MyG(error_msg),1); - } else { - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_array (object result [,int resulttype]) - Fetch a result row as an associative array, a numeric array, or both */ -PHP_FUNCTION(mysqli_fetch_array) -{ - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_assoc (object result) - Fetch a result row as an associative array */ -PHP_FUNCTION(mysqli_fetch_assoc) -{ - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 0); -} -/* }}} */ - -/* {{{ proto mixed mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]]) - Fetch a result row as an object */ -PHP_FUNCTION(mysqli_fetch_object) -{ - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 1); -} -/* }}} */ - -/* {{{ proto bool mysqli_multi_query(object link, string query) - Binary-safe version of mysql_query() */ -PHP_FUNCTION(mysqli_multi_query) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link"); - - MYSQLI_ENABLE_MQ; - if (mysql_real_query(mysql->mysql, query, query_len)) { - char s_error[MYSQL_ERRMSG_SIZE], s_sqlstate[SQLSTATE_LENGTH+1]; - unsigned int s_errno; - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - - /* we have to save error information, cause - MYSQLI_DISABLE_MQ will reset error information */ - strcpy(s_error, mysql_error(mysql->mysql)); - strcpy(s_sqlstate, mysql_sqlstate(mysql->mysql)); - s_errno = mysql_errno(mysql->mysql); - - MYSQLI_DISABLE_MQ; - - /* restore error information */ - strcpy(mysql->mysql->net.last_error, s_error); - strcpy(mysql->mysql->net.sqlstate, s_sqlstate); - mysql->mysql->net.last_errno = s_errno; - - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed mysqli_query(object link, string query [,int resultmode]) */ -PHP_FUNCTION(mysqli_query) -{ - MY_MYSQL *mysql; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - MYSQL_RES *result; - char *query = NULL; - unsigned int query_len; - unsigned long resultmode = MYSQLI_STORE_RESULT; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) { - return; - } - - if (!query_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty query"); - RETURN_FALSE; - } - if (resultmode != MYSQLI_USE_RESULT && resultmode != MYSQLI_STORE_RESULT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for resultmode"); - RETURN_FALSE; - } - - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link"); - - MYSQLI_DISABLE_MQ; - - if (mysql_real_query(mysql->mysql, query, query_len)) { - MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); - RETURN_FALSE; - } - - if (!mysql_field_count(mysql->mysql)) { - /* no result set - not a SELECT */ - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index(query, mysql->mysql->server_status TSRMLS_CC); - } - RETURN_TRUE; - } - - result = (resultmode == MYSQLI_USE_RESULT) ? mysql_use_result(mysql->mysql) : mysql_store_result(mysql->mysql); - - if (!result) { - php_mysqli_throw_sql_exception(mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC, - mysql->mysql->net.last_error); - RETURN_FALSE; - } - - if (MyG(report_mode) & MYSQLI_REPORT_INDEX) { - php_mysqli_report_index(query, mysql->mysql->server_status TSRMLS_CC); - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = (void *)result; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry); -} -/* }}} */ - -/* {{{ proto object mysqli_get_warnings(object link) */ -PHP_FUNCTION(mysqli_get_warnings) -{ - MY_MYSQL *mysql; - zval *mysql_link; - MYSQLI_RESOURCE *mysqli_resource; - MYSQLI_WARNING *w; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link"); - - if (mysql_warning_count(mysql->mysql)) { - w = php_get_warnings(mysql->mysql); - } else { - RETURN_FALSE; - } - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = mysqli_resource->info = (void *)w; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); -} -/* }}} */ - -/* {{{ proto object mysqli_get_warnings(object link) */ -PHP_FUNCTION(mysqli_stmt_get_warnings) -{ - MY_STMT *stmt; - zval *stmt_link; - MYSQLI_RESOURCE *mysqli_resource; - MYSQLI_WARNING *w; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT*, &stmt_link, "mysqli_stmt"); - - if (mysql_warning_count(stmt->stmt->mysql)) { - w = php_get_warnings(stmt->stmt->mysql); - } else { - RETURN_FALSE; - } - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = mysqli_resource->info = (void *)w; - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); -} -/* }}} */ - -#ifdef HAVE_MYSQLI_SET_CHARSET -/* {{{ proto bool mysqli_set_charset(object link, string csname) - sets client character set */ -PHP_FUNCTION(mysqli_set_charset) -{ - MY_MYSQL *mysql; - zval *mysql_link; - char *cs_name = NULL; - unsigned int len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link"); - - if (mysql_set_character_set(mysql->mysql, cs_name)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#ifdef HAVE_MYSQLI_GET_CHARSET -/* {{{ object mysqli_get_charset(object link) - returns a character set object */ -PHP_FUNCTION(mysqli_get_charset) -{ - MY_MYSQL *mysql; - zval *mysql_link; - MY_CHARSET_INFO cs; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link"); - - object_init(return_value); - - mysql_get_character_set_info(mysql->mysql, &cs); - - add_property_string(return_value, "charset", (cs.name) ? (char *)cs.csname : "", 1); - add_property_string(return_value, "collation",(cs.name) ? (char *)cs.name : "", 1); - add_property_string(return_value, "comment", (cs.comment) ? (char *)cs.comment : "", 1); - add_property_string(return_value, "dir", (cs.dir) ? (char *)cs.dir : "", 1); - add_property_long(return_value, "min_length", cs.mbminlen); - add_property_long(return_value, "max_length", cs.mbmaxlen); - add_property_long(return_value, "number", cs.number); - add_property_long(return_value, "state", cs.state); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c deleted file mode 100644 index ea0a3c13e64f8..0000000000000 --- a/ext/mysqli/mysqli_prop.c +++ /dev/null @@ -1,334 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -#define CHECK_OBJECT() \ - if (!obj->valid) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet. Call the default constructor of the object first"); \ - ZVAL_NULL(*retval); \ - return SUCCESS; \ - } \ - -#define MYSQLI_GET_MYSQL() \ -MYSQL *p; \ -ALLOC_ZVAL(*retval);\ -CHECK_OBJECT();\ -p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql; - -#define MYSQLI_GET_RESULT() \ -MYSQL_RES *p; \ -ALLOC_ZVAL(*retval);\ -CHECK_OBJECT();\ -p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr - -#define MYSQLI_GET_STMT() \ -MYSQL_STMT *p; \ -ALLOC_ZVAL(*retval);\ -CHECK_OBJECT();\ -p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt - -#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type)\ -static int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \ -{\ - __ret_type l;\ - __get_type;\ - if (!p) {\ - ZVAL_NULL(*retval);\ - } else {\ - l = (__ret_type)__int_func(p);\ - if (l < LONG_MAX) {\ - ZVAL_LONG(*retval, l);\ - } else { \ - char ret[40]; \ - sprintf(ret, "%llu", (my_ulonglong)l); \ - ZVAL_STRING(*retval, ret, 1); \ - } \ - }\ - return SUCCESS;\ -} - -#define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\ -static int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\ -{\ - char *c;\ - __get_type;\ - if (!p) {\ - ZVAL_NULL(*retval);\ - } else {\ - c = (char *)__int_func(p);\ - if (!c) {\ - ZVAL_NULL(*retval);\ - } else {\ - ZVAL_STRING(*retval, c, 1);\ - }\ - }\ - return SUCCESS;\ -} - -/* {{{ property link_client_version_read */ -static int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_LONG(*retval, MYSQL_VERSION_ID); - return SUCCESS; -} -/* }}} */ - -/* {{{ property link_client_info_read */ -static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ property link_connect_errno_read */ -static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_LONG(*retval, (long)MyG(error_no)); - return SUCCESS; -} -/* }}} */ - -/* {{{ property link_connect_error_read */ -static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, MyG(error_msg), 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ property link_affected_rows_read */ -static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MY_MYSQL *mysql; - my_ulonglong rc; - - ALLOC_ZVAL(*retval); - CHECK_OBJECT(); - - mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - rc = mysql_affected_rows(mysql->mysql); - - if (rc == (my_ulonglong)-1) { - ZVAL_LONG(*retval, -1); - return SUCCESS; - } - - if (rc < LONG_MAX) { - ZVAL_LONG(*retval, rc); - } else { - char ret[40]; - sprintf(ret, "%llu", (my_ulonglong) rc); - ZVAL_STRING(*retval, ret, 1); - } - - return SUCCESS; -} -/* }}} */ - -/* link properties */ -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL()); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL()); -MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL()); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(), my_ulonglong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL()); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL()); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(), ulong); -/* result properties */ - -/* {{{ property result_type_read */ -static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MYSQL_RES *p; - - ALLOC_ZVAL(*retval); - CHECK_OBJECT(); - p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - - if (!p) { - ZVAL_NULL(*retval); - } else { - ZVAL_LONG(*retval, (p->data) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ property result_lengths_read */ -static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MYSQL_RES *p; - - ALLOC_ZVAL(*retval); - CHECK_OBJECT(); - - p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - if (!p || !p->field_count) { - ZVAL_NULL(*retval); - } else { - ulong i; - zval *l; - - array_init(*retval); - - for (i=0; i < p->field_count; i++) { - MAKE_STD_ZVAL(l); - ZVAL_LONG(l, p->lengths[i]); - add_index_zval(*retval, i, l); - } - } - return SUCCESS; -} -/* }}} */ - - -MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(), my_ulonglong); - -/* statement properties */ - -/* {{{ property stmt_id_read */ -static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MY_STMT *p; - - ALLOC_ZVAL(*retval); - CHECK_OBJECT(); - - p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - - if (!p) { - ZVAL_NULL(*retval); - } else { - ZVAL_LONG(*retval, p->stmt->stmt_id); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ property stmt_affected_rows_read */ -static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MY_STMT *stmt; - my_ulonglong rc; - - ALLOC_ZVAL(*retval); - CHECK_OBJECT(); - - stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - rc = mysql_stmt_affected_rows(stmt->stmt); - - if (rc == (my_ulonglong)-1) { - ZVAL_LONG(*retval, -1); - return SUCCESS; - } - - if (rc < LONG_MAX) { - ZVAL_LONG(*retval, rc); - } else { - char ret[40]; - sprintf(ret, "%llu", (my_ulonglong) rc); - ZVAL_STRING(*retval, ret, 1); - } - - return SUCCESS; -} -/* }}} */ - -MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(), my_ulonglong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(), my_ulonglong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(), ulong); -MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT()); -MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT()); - -/* }}} */ -mysqli_property_entry mysqli_link_property_entries[] = { - {"affected_rows", link_affected_rows_read, NULL}, - {"client_info", link_client_info_read, NULL}, - {"client_version", link_client_version_read, NULL}, - {"connect_errno", link_connect_errno_read, NULL}, - {"connect_error", link_connect_error_read, NULL}, - {"errno", link_errno_read, NULL}, - {"error", link_error_read, NULL}, - {"field_count", link_field_count_read, NULL}, - {"host_info", link_host_info_read, NULL}, - {"info", link_info_read, NULL}, - {"insert_id", link_insert_id_read, NULL}, - {"server_info", link_server_info_read, NULL}, - {"server_version", link_server_version_read, NULL}, - {"sqlstate", link_sqlstate_read, NULL}, - {"protocol_version", link_protocol_version_read, NULL}, - {"thread_id", link_thread_id_read, NULL}, - {"warning_count", link_warning_count_read, NULL}, - {NULL, NULL, NULL} -}; - -mysqli_property_entry mysqli_result_property_entries[] = { - {"current_field", result_current_field_read, NULL}, - {"field_count", result_field_count_read, NULL}, - {"lengths", result_lengths_read, NULL}, - {"num_rows", result_num_rows_read, NULL}, - {"type", result_type_read, NULL}, - {NULL, NULL, NULL} -}; - -mysqli_property_entry mysqli_stmt_property_entries[] = { - {"affected_rows", stmt_affected_rows_read, NULL}, - {"insert_id", stmt_insert_id_read, NULL}, - {"num_rows", stmt_num_rows_read, NULL}, - {"param_count", stmt_param_count_read, NULL}, - {"field_count", stmt_field_count_read, NULL}, - {"errno", stmt_errno_read, NULL}, - {"error", stmt_error_read, NULL}, - {"sqlstate", stmt_sqlstate_read, NULL}, - {"id", stmt_id_read, NULL}, - {NULL, NULL, NULL} -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_repl.c b/ext/mysqli/mysqli_repl.c deleted file mode 100644 index 21d9a4f280ae5..0000000000000 --- a/ext/mysqli/mysqli_repl.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ proto void mysqli_disable_reads_from_master(object link) -*/ -PHP_FUNCTION(mysqli_disable_reads_from_master) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - mysql_disable_reads_from_master(mysql); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void mysqli_disable_rpl_parse(object link) -*/ -PHP_FUNCTION(mysqli_disable_rpl_parse) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - mysql_disable_rpl_parse(mysql); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void mysqli_enable_reads_from_master(object link) -*/ -PHP_FUNCTION(mysqli_enable_reads_from_master) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - mysql_enable_reads_from_master(mysql); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void mysqli_enable_rpl_parse(object link) -*/ -PHP_FUNCTION(mysqli_enable_rpl_parse) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - mysql_enable_rpl_parse(mysql); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_master_query(object link, string query) - Enforce execution of a query on the master in a master/slave setup */ -PHP_FUNCTION(mysqli_master_query) { - MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_master_query(mysql, query, query_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_rpl_parse_enabled(object link) -*/ -PHP_FUNCTION(mysqli_rpl_parse_enabled) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_rpl_parse_enabled(mysql)); -} -/* }}} */ - -/* {{{ proto bool mysqli_rpl_probe(object link) -*/ -PHP_FUNCTION(mysqli_rpl_probe) -{ - MYSQL *mysql; - zval *mysql_link; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - - if (mysql_rpl_probe(mysql)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int mysqli_rpl_query_type(string query) -*/ -PHP_FUNCTION(mysqli_rpl_query_type) -{ - MYSQL *mysql; - zval *mysql_link; - char *query; - int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - RETURN_LONG(mysql_rpl_query_type(query, query_len)); -} -/* }}} */ - -/* {{{ proto bool mysqli_send_query(object link, string query) -*/ -PHP_FUNCTION(mysqli_send_query) -{ - MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_send_query(mysql, query, query_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool mysqli_slave_query(object link, string query) - Enforce execution of a query on a slave in a master/slave setup */ -PHP_FUNCTION(mysqli_slave_query) -{ - MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { - return; - } - MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); - - if (mysql_slave_query(mysql, query, query_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c deleted file mode 100644 index 0fe664ddda787..0000000000000 --- a/ext/mysqli/mysqli_report.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ bool mysqli_report(int flags) - sets report level */ -PHP_FUNCTION(mysqli_report) -{ - long flags; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) { - return; - } - - MyG(report_mode) = flags; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */ -void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC) { - php_mysqli_throw_sql_exception(sqlstate, errorno TSRMLS_CC, error); -} -/* }}} */ - -/* {{{ void php_mysqli_report_index() */ -void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC) { - char index[15]; - - if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) { - strcpy(index, "Bad index"); - } else if (status & SERVER_QUERY_NO_INDEX_USED) { - strcpy(index, "No index"); - } else { - return; - } - php_mysqli_throw_sql_exception("00000", 0 TSRMLS_CC, "%s used in query/prepared statement %s", index, query); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h deleted file mode 100644 index cd31a2e05fa93..0000000000000 --- a/ext/mysqli/mysqli_report.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -#ifndef __HAVE_MYSQLI_PROFILER_H__ -#define __HAVE_MYSQLI_PROFILER_H__ - -#ifdef PHP_WIN32 -#include <process.h> -#include <direct.h> -#include "win32/time.h" -#else -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <sys/time.h> -#endif - -typedef struct { - struct timeval starttime, - endtime; /* execution time */ -} PR_TIME_INFO; - - -#define MYSQLI_PR_REPORT_STDERR 1 -#define MYSQLI_PR_REPORT_PORT 2 - - - -/*** PROFILER MACROS ***/ -#define MYSQLI_PROFILER_STARTTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.starttime, NULL) -#define MYSQLI_PROFILER_ENDTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.endtime, NULL) -#define MYSQLI_PROFILER_REPORT(_type, _time, ptr) if (MyG(profiler.mode)) php_mysqli_profiler_report(_type, _time, (void *)ptr) - - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c deleted file mode 100644 index 19aa8eec8a8a7..0000000000000 --- a/ext/mysqli/mysqli_warning.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli.h" - -/* {{{ void php_clear_warnings() */ -void php_clear_warnings(MYSQLI_WARNING *w) -{ - MYSQLI_WARNING *n; - - while (w) { - n = w; - efree(w->reason); - w = w->next; - efree(n); - } -} -/* }}} */ - -/* {{{ MYSQLI_WARNING *php_new_warning */ -MYSQLI_WARNING *php_new_warning(char *reason, char *sqlstate, int errorno) -{ - MYSQLI_WARNING *w; - - w = (MYSQLI_WARNING *)ecalloc(1, sizeof(MYSQLI_WARNING)); - - w->reason = safe_estrdup(reason); - if (sqlstate) { - strcpy(w->sqlstate, sqlstate); - } else { - strcpy(w->sqlstate, "00000"); - } - w->errorno = errorno; - - return w; -} -/* }}} */ - -/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */ -MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) -{ - MYSQLI_WARNING *w, *first = NULL, *prev = NULL; - MYSQL_RES *result; - MYSQL_ROW row; - - if (mysql_query(mysql, "SHOW WARNINGS")) { - return NULL; - } - - result = mysql_store_result(mysql); - while ((row = mysql_fetch_row(result))) { - w = php_new_warning(row[2], "HY000", atoi(row[1])); - if (!first) { - first = w; - } - if (prev) { - prev->next = (void *)w; - } - prev = w; - } - mysql_free_result(result); - return first; -} -/* }}} */ - -/* {{{ bool mysqli_warning::next() */ -PHP_METHOD(mysqli_warning, next) -{ - MYSQLI_WARNING *w; - zval *mysqli_warning; - mysqli_object *obj = (mysqli_object *)zend_objects_get_address(getThis() TSRMLS_CC); - - if (obj->ptr) { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", - &mysqli_warning, mysqli_warning_class_entry) == FAILURE) { - return; - } - - MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, &mysqli_warning, "mysqli_warning"); - - if (w->next) { - w = w->next; - ((MYSQLI_RESOURCE *)(obj->ptr))->ptr = w; - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ property mysqli_warning_message */ -int mysqli_warning_message(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MYSQLI_WARNING *w; - - if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { - return FAILURE; - } - - w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - ALLOC_ZVAL(*retval); - if (w->reason) { - ZVAL_STRING(*retval, w->reason, 1); - } else { - ZVAL_NULL(*retval); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ property mysqli_warning_sqlstate */ -int mysqli_warning_sqlstate(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MYSQLI_WARNING *w; - - if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { - return FAILURE; - } - - w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, w->sqlstate, 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ property mysqli_warning_error */ -int mysqli_warning_errno(mysqli_object *obj, zval **retval TSRMLS_DC) -{ - MYSQLI_WARNING *w; - - if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { - return FAILURE; - } - w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - ALLOC_ZVAL(*retval); - ZVAL_LONG(*retval, w->errorno); - return SUCCESS; -} -/* }}} */ - -/* {{{ mysqli_warning_construct(object obj) */ -PHP_METHOD(mysqli_warning, __construct) -{ - zval *z; - mysqli_object *obj; - MYSQL *hdl; - MYSQLI_WARNING *w; - MYSQLI_RESOURCE *mysqli_resource; - - if (ZEND_NUM_ARGS() != 1) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters(1 TSRMLS_CC, "o", &z)==FAILURE) { - return; - } - obj = (mysqli_object *)zend_object_store_get_object(z TSRMLS_CC);\ - - if (obj->zo.ce == mysqli_link_class_entry) { - MY_MYSQL *mysql; - MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &z, "mysqli_link"); - hdl = mysql->mysql; - } else if (obj->zo.ce == mysqli_stmt_class_entry) { - MY_STMT *stmt; - MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &z, "mysqli_stmt"); - hdl = stmt->stmt->mysql; - } else { - RETURN_FALSE; - } - - if (mysql_warning_count(hdl)) { - w = php_get_warnings(hdl); - } else { - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = mysqli_resource->info = (void *)w; - - if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) { - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); - } else { - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource; - ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1; - } - -} -/* }}} */ - -function_entry mysqli_warning_methods[] = { - PHP_ME(mysqli_warning, __construct, NULL, ZEND_ACC_PROTECTED) - PHP_ME(mysqli_warning, next, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -mysqli_property_entry mysqli_warning_property_entries[] = { - {"message", mysqli_warning_message, NULL}, - {"sqlstate", mysqli_warning_sqlstate, NULL}, - {"errno", mysqli_warning_errno, NULL}, - {NULL, NULL, NULL} -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/package.xml b/ext/mysqli/package.xml deleted file mode 100644 index 1487256d27506..0000000000000 --- a/ext/mysqli/package.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>mysqli</name> - <summary>MySQLi - new MySQL interface for PHP 5 and MySQL 4.1+</summary> - <maintainers> - <maintainer> - <user>georg</user> - <name>Georg Richter</name> - <email>georg@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>zak</user> - <name>Zak Greant</name> - <email>zak@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> -MySQLi is a rewrite of the original MySQL extension ... - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <configureoptions> - <configureoption name="with-mysqli" default="autodetect" prompt="path to mysql_config tool?"/> - <configureoption name="enable-embedded-mysqli" default="no" prompt="embedd mysql server into PHP?"/> - </configureoptions> - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="mysqli.dsp"/> - <file role="src" name="mysqli.c"/> - <file role="src" name="mysqli_api.c"/> - <file role="src" name="mysqli_fe.c"/> - <file role="src" name="mysqli_nonapi.c"/> - <file role="src" name="mysqli_prop.c"/> - <file role="src" name="mysqli_repl.c"/> - <file role="src" name="mysqli_report.c"/> - <file role="src" name="mysqli_report.h"/> - <file role="src" name="php_mysqli.h"/> - <file role="doc" name="CREDITS"/> - <file role="test" name="tests/001.phpt"/> - <file role="test" name="tests/002.phpt"/> - <file role="test" name="tests/003.phpt"/> - <file role="test" name="tests/004.phpt"/> - <file role="test" name="tests/005.phpt"/> - <file role="test" name="tests/006.phpt"/> - <file role="test" name="tests/007.phpt"/> - <file role="test" name="tests/008.phpt"/> - <file role="test" name="tests/009.phpt"/> - <file role="test" name="tests/010.phpt"/> - <file role="test" name="tests/011.phpt"/> - <file role="test" name="tests/012.phpt"/> - <file role="test" name="tests/013.phpt"/> - <file role="test" name="tests/014.phpt"/> - <file role="test" name="tests/015.phpt"/> - <file role="test" name="tests/016.phpt"/> - <file role="test" name="tests/017.phpt"/> - <file role="test" name="tests/018.phpt"/> - <file role="test" name="tests/019.phpt"/> - <file role="test" name="tests/020.phpt"/> - <file role="test" name="tests/021.phpt"/> - <file role="test" name="tests/022.phpt"/> - <file role="test" name="tests/023.phpt"/> - <file role="test" name="tests/024.phpt"/> - <file role="test" name="tests/025.phpt"/> - <file role="test" name="tests/026.phpt"/> - <file role="test" name="tests/027.phpt"/> - <file role="test" name="tests/028.phpt"/> - <file role="test" name="tests/029.phpt"/> - <file role="test" name="tests/030.phpt"/> - <file role="test" name="tests/031.phpt"/> - <file role="test" name="tests/032.phpt"/> - <file role="test" name="tests/033.phpt"/> - <file role="test" name="tests/034.phpt"/> - <file role="test" name="tests/035.phpt"/> - <file role="test" name="tests/036.phpt"/> - <file role="test" name="tests/037.phpt"/> - <file role="test" name="tests/038.phpt"/> - <file role="test" name="tests/039.phpt"/> - <file role="test" name="tests/040.phpt"/> - <file role="test" name="tests/041.phpt"/> - <file role="test" name="tests/042.phpt"/> - <file role="test" name="tests/043.phpt"/> - <file role="test" name="tests/044.phpt"/> - <file role="test" name="tests/045.phpt"/> - <file role="test" name="tests/046.phpt"/> - <file role="test" name="tests/047.phpt"/> - <file role="test" name="tests/048.phpt"/> - <file role="test" name="tests/049.phpt"/> - <file role="test" name="tests/050.phpt"/> - <file role="test" name="tests/051.phpt"/> - <file role="test" name="tests/052.phpt"/> - <file role="test" name="tests/053.phpt"/> - <file role="test" name="tests/054.phpt"/> - <file role="test" name="tests/055.phpt"/> - <file role="test" name="tests/056.phpt"/> - <file role="test" name="tests/057.phpt"/> - <file role="test" name="tests/058.phpt"/> - <file role="test" name="tests/059.phpt"/> - <file role="test" name="tests/060.phpt"/> - <file role="test" name="tests/connect.inc"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h deleted file mode 100644 index a55df7f26ee7e..0000000000000 --- a/ext/mysqli/php_mysqli.h +++ /dev/null @@ -1,462 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -/* A little hack to prevent build break, when mysql is used together with - * c-client, which also defines LIST. - */ -#ifdef LIST -#undef LIST -#endif - -#include <mysql.h> - -/* character set support */ -#if MYSQL_VERSION_ID > 50009 -#define HAVE_MYSQLI_GET_CHARSET -#endif - -#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005 -#define HAVE_MYSQLI_SET_CHARSET -#endif - -#include <errmsg.h> - -#ifndef PHP_MYSQLI_H -#define PHP_MYSQLI_H - -#define MYSQLI_VERSION_ID 101008 - -typedef struct { - ulong buflen; - char *val; - ulong type; -} VAR_BUFFER; - -typedef struct { - unsigned int var_cnt; - VAR_BUFFER *buf; - zval **vars; - char *is_null; -} BIND_BUFFER; - -typedef struct { - MYSQL_STMT *stmt; - BIND_BUFFER param; - BIND_BUFFER result; - char *query; -} MY_STMT; - -typedef struct { - MYSQL *mysql; - zval *li_read; - php_stream *li_stream; - unsigned int multi_query; -} MY_MYSQL; - -typedef struct { - int mode; - int socket; - FILE *fp; -} PROFILER; - -typedef struct { - void *ptr; /* resource: (mysql, result, stmt) */ - void *info; /* additional buffer */ -} MYSQLI_RESOURCE; - -typedef struct _mysqli_object { - zend_object zo; - void *ptr; - char valid; - HashTable *prop_handler; -} mysqli_object; /* extends zend_object */ - -typedef struct { - char *reason; - char sqlstate[6]; - int errorno; - void *next; -} MYSQLI_WARNING; - -typedef struct _mysqli_property_entry { - char *pname; - int (*r_func)(mysqli_object *obj, zval **retval TSRMLS_DC); - int (*w_func)(mysqli_object *obj, zval *value TSRMLS_DC); -} mysqli_property_entry; - -typedef struct { - char error_msg[LOCAL_INFILE_ERROR_LEN]; - void *userdata; -} mysqli_local_infile; - -#define phpext_mysqli_ptr &mysqli_module_entry - -#ifdef PHP_WIN32 -#define PHP_MYSQLI_API __declspec(dllexport) -#else -#define PHP_MYSQLI_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type - -extern zend_module_entry mysqli_module_entry; -extern function_entry mysqli_functions[]; -extern function_entry mysqli_link_methods[]; -extern function_entry mysqli_stmt_methods[]; -extern function_entry mysqli_result_methods[]; -extern function_entry mysqli_driver_methods[]; -extern function_entry mysqli_warning_methods[]; -extern function_entry mysqli_exception_methods[]; - -extern mysqli_property_entry mysqli_link_property_entries[]; -extern mysqli_property_entry mysqli_result_property_entries[]; -extern mysqli_property_entry mysqli_stmt_property_entries[]; -extern mysqli_property_entry mysqli_driver_property_entries[]; -extern mysqli_property_entry mysqli_warning_property_entries[]; - -extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object); -extern void php_clear_stmt_bind(MY_STMT *stmt); -extern void php_clear_mysql(MY_MYSQL *); -extern MYSQLI_WARNING *php_get_warnings(MYSQL *mysql); -extern void php_clear_warnings(MYSQLI_WARNING *w); -extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type); -extern void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC); -extern void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC); -extern int php_local_infile_init(void **, const char *, void *); -extern int php_local_infile_read(void *, char *, uint); -extern void php_local_infile_end(void *); -extern int php_local_infile_error(void *, char *, uint); -extern void php_set_local_infile_handler_default(MY_MYSQL *); -extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...); -zend_class_entry *mysqli_link_class_entry; -zend_class_entry *mysqli_stmt_class_entry; -zend_class_entry *mysqli_result_class_entry; -zend_class_entry *mysqli_driver_class_entry; -zend_class_entry *mysqli_warning_class_entry; -zend_class_entry *mysqli_exception_class_entry; - -#ifdef HAVE_SPL -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -#endif - -PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRMLS_DC); - -#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \ - mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \ - mysql->multi_query = 0; \ -} - -#define MYSQLI_ENABLE_MQ if (!mysql->multi_query) { \ - mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); \ - mysql->multi_query = 1; \ -} - -#define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \ - zend_class_entry ce; \ - INIT_CLASS_ENTRY(ce, name,class_functions); \ - ce.create_object = mysqli_objects_new; \ - mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \ -} \ - -#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval, __ce) \ - ((mysqli_object *) zend_object_store_get_object(__zval TSRMLS_CC))->ptr = __ptr; \ - ((mysqli_object *) zend_object_store_get_object(__zval TSRMLS_CC))->valid = 1; - -#define MYSQLI_RETURN_RESOURCE(__ptr, __ce) \ - Z_TYPE_P(return_value) = IS_OBJECT; \ - (return_value)->value.obj = mysqli_objects_new(__ce TSRMLS_CC); \ - MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value, __ce) - -#define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \ -{\ - zval *object = getThis();\ - if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {\ - object = return_value;\ - Z_TYPE_P(object) = IS_OBJECT;\ - (object)->value.obj = mysqli_objects_new(__ce TSRMLS_CC);\ - }\ - MYSQLI_REGISTER_RESOURCE_EX(__ptr, object, __ce)\ -} - -#define MYSQLI_FETCH_RESOURCE(__ptr, __type, __id, __name) \ -{ \ - MYSQLI_RESOURCE *my_res; \ - mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*(__id) TSRMLS_CC);\ - if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {\ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name);\ - RETURN_NULL();\ - }\ - if (!intern->valid) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid resource %s", intern->zo.ce->name); \ - RETURN_NULL(); \ - } \ - __ptr = (__type)my_res->ptr; \ - if (!strcmp((char *)__name, "mysqli_stmt")) {\ - if (!((MY_STMT *)__ptr)->stmt->mysql) {\ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Statement isn't valid anymore");\ - RETURN_NULL();\ - }\ - }\ -} - -#define MYSQLI_CLEAR_RESOURCE(__id) \ -{ \ - mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*(__id) TSRMLS_CC);\ - efree(intern->ptr); \ - intern->ptr = NULL; \ -} - -#define MYSQLI_RETURN_LONG_LONG(__val) \ -{ \ - if ((__val) < LONG_MAX) { \ - RETURN_LONG((__val)); \ - } else { \ - char ret[40]; \ - sprintf(ret, "%llu", (__val)); \ - RETURN_STRING(ret,1); \ - } \ -} - -#define MYSQLI_ADD_PROPERTIES(a,b) \ -{ \ - int i = 0; \ - while (b[i].pname != NULL) { \ - mysqli_add_property(a, b[i].pname, (mysqli_read_t)b[i].r_func, (mysqli_write_t)b[i].w_func TSRMLS_CC); \ - i++; \ - }\ -} - -#if WIN32|WINNT -#define SCLOSE(a) closesocket(a) -#else -#define SCLOSE(a) close(a) -#endif - -#define MYSQLI_STORE_RESULT 0 -#define MYSQLI_USE_RESULT 1 - -/* for mysqli_fetch_assoc */ -#define MYSQLI_ASSOC 1 -#define MYSQLI_NUM 2 -#define MYSQLI_BOTH 3 - -/* for mysqli_bind_param */ -#define MYSQLI_BIND_INT 1 -#define MYSQLI_BIND_DOUBLE 2 -#define MYSQLI_BIND_STRING 3 -#define MYSQLI_BIND_SEND_DATA 4 - -/* fetch types */ -#define FETCH_SIMPLE 1 -#define FETCH_RESULT 2 - -/*** REPORT MODES ***/ -#define MYSQLI_REPORT_OFF 0 -#define MYSQLI_REPORT_ERROR 1 -#define MYSQLI_REPORT_STRICT 2 -#define MYSQLI_REPORT_INDEX 4 -#define MYSQLI_REPORT_CLOSE 8 -#define MYSQLI_REPORT_ALL 255 - -#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \ -if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql->net.last_errno) { \ - php_mysqli_report_error(mysql->net.sqlstate, mysql->net.last_errno, mysql->net.last_error TSRMLS_CC); \ -} - -#define MYSQLI_REPORT_STMT_ERROR(stmt) \ -if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && stmt->last_errno) { \ - php_mysqli_report_error(stmt->sqlstate, stmt->last_errno, stmt->last_error TSRMLS_CC); \ -} - -PHP_MYSQLI_API void mysqli_register_link(zval *return_value, void *link TSRMLS_DC); -PHP_MYSQLI_API void mysqli_register_stmt(zval *return_value, void *stmt TSRMLS_DC); -PHP_MYSQLI_API void mysqli_register_result(zval *return_value, void *result TSRMLS_DC); -PHP_MYSQLI_API void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC); - -PHP_MINIT_FUNCTION(mysqli); -PHP_MSHUTDOWN_FUNCTION(mysqli); -PHP_RINIT_FUNCTION(mysqli); -PHP_RSHUTDOWN_FUNCTION(mysqli); -PHP_MINFO_FUNCTION(mysqli); - -PHP_FUNCTION(mysqli); -PHP_FUNCTION(mysqli_affected_rows); -PHP_FUNCTION(mysqli_autocommit); -PHP_FUNCTION(mysqli_change_user); -PHP_FUNCTION(mysqli_character_set_name); -#ifdef HAVE_MYSQLI_SET_CHARSET -PHP_FUNCTION(mysqli_set_charset); -#endif -PHP_FUNCTION(mysqli_close); -PHP_FUNCTION(mysqli_commit); -PHP_FUNCTION(mysqli_connect); -PHP_FUNCTION(mysqli_connect_errno); -PHP_FUNCTION(mysqli_connect_error); -PHP_FUNCTION(mysqli_data_seek); -PHP_FUNCTION(mysqli_debug); -PHP_FUNCTION(mysqli_disable_reads_from_master); -PHP_FUNCTION(mysqli_disable_rpl_parse); -PHP_FUNCTION(mysqli_dump_debug_info); -PHP_FUNCTION(mysqli_enable_reads_from_master); -PHP_FUNCTION(mysqli_enable_rpl_parse); -PHP_FUNCTION(mysqli_errno); -PHP_FUNCTION(mysqli_error); -PHP_FUNCTION(mysqli_fetch_array); -PHP_FUNCTION(mysqli_fetch_assoc); -PHP_FUNCTION(mysqli_fetch_object); -PHP_FUNCTION(mysqli_fetch_field); -PHP_FUNCTION(mysqli_fetch_fields); -PHP_FUNCTION(mysqli_fetch_field_direct); -PHP_FUNCTION(mysqli_fetch_lengths); -PHP_FUNCTION(mysqli_fetch_row); -PHP_FUNCTION(mysqli_field_count); -PHP_FUNCTION(mysqli_field_seek); -PHP_FUNCTION(mysqli_field_tell); -PHP_FUNCTION(mysqli_free_result); -#ifdef HAVE_MYSQLI_GET_CHARSET -PHP_FUNCTION(mysqli_get_charset); -#endif -PHP_FUNCTION(mysqli_get_client_info); -PHP_FUNCTION(mysqli_get_client_version); -PHP_FUNCTION(mysqli_get_host_info); -PHP_FUNCTION(mysqli_get_proto_info); -PHP_FUNCTION(mysqli_get_server_info); -PHP_FUNCTION(mysqli_get_server_version); -PHP_FUNCTION(mysqli_get_warnings); -PHP_FUNCTION(mysqli_info); -PHP_FUNCTION(mysqli_insert_id); -PHP_FUNCTION(mysqli_init); -PHP_FUNCTION(mysqli_kill); -PHP_FUNCTION(mysqli_set_local_infile_default); -PHP_FUNCTION(mysqli_set_local_infile_handler); -PHP_FUNCTION(mysqli_master_query); -PHP_FUNCTION(mysqli_more_results); -PHP_FUNCTION(mysqli_multi_query); -PHP_FUNCTION(mysqli_next_result); -PHP_FUNCTION(mysqli_num_fields); -PHP_FUNCTION(mysqli_num_rows); -PHP_FUNCTION(mysqli_options); -PHP_FUNCTION(mysqli_ping); -PHP_FUNCTION(mysqli_prepare); -PHP_FUNCTION(mysqli_query); -PHP_FUNCTION(mysqli_stmt_result_metadata); -PHP_FUNCTION(mysqli_report); -PHP_FUNCTION(mysqli_read_query_result); -PHP_FUNCTION(mysqli_real_connect); -PHP_FUNCTION(mysqli_real_query); -PHP_FUNCTION(mysqli_real_escape_string); -PHP_FUNCTION(mysqli_rollback); -PHP_FUNCTION(mysqli_row_seek); -PHP_FUNCTION(mysqli_rpl_parse_enabled); -PHP_FUNCTION(mysqli_rpl_probe); -PHP_FUNCTION(mysqli_rpl_query_type); -PHP_FUNCTION(mysqli_select_db); -PHP_FUNCTION(mysqli_stmt_attr_get); -PHP_FUNCTION(mysqli_stmt_attr_set); -PHP_FUNCTION(mysqli_stmt_bind_param); -PHP_FUNCTION(mysqli_stmt_bind_result); -PHP_FUNCTION(mysqli_stmt_execute); -PHP_FUNCTION(mysqli_stmt_field_count); -PHP_FUNCTION(mysqli_stmt_init); -PHP_FUNCTION(mysqli_stmt_prepare); -PHP_FUNCTION(mysqli_stmt_fetch); -PHP_FUNCTION(mysqli_stmt_param_count); -PHP_FUNCTION(mysqli_stmt_send_long_data); -PHP_FUNCTION(mysqli_send_query); -PHP_FUNCTION(mysqli_embedded_server_end); -PHP_FUNCTION(mysqli_embedded_server_start); -PHP_FUNCTION(mysqli_slave_query); -PHP_FUNCTION(mysqli_sqlstate); -PHP_FUNCTION(mysqli_ssl_set); -PHP_FUNCTION(mysqli_stat); -PHP_FUNCTION(mysqli_stmt_affected_rows); -PHP_FUNCTION(mysqli_stmt_close); -PHP_FUNCTION(mysqli_stmt_data_seek); -PHP_FUNCTION(mysqli_stmt_errno); -PHP_FUNCTION(mysqli_stmt_error); -PHP_FUNCTION(mysqli_stmt_free_result); -PHP_FUNCTION(mysqli_stmt_get_warnings); -PHP_FUNCTION(mysqli_stmt_reset); -PHP_FUNCTION(mysqli_stmt_insert_id); -PHP_FUNCTION(mysqli_stmt_num_rows); -PHP_FUNCTION(mysqli_stmt_sqlstate); -PHP_FUNCTION(mysqli_stmt_store_result); -PHP_FUNCTION(mysqli_store_result); -PHP_FUNCTION(mysqli_thread_id); -PHP_FUNCTION(mysqli_thread_safe); -PHP_FUNCTION(mysqli_use_result); -PHP_FUNCTION(mysqli_warning_count); - -ZEND_FUNCTION(mysqli_stmt_construct); -ZEND_FUNCTION(mysqli_result_construct); -ZEND_FUNCTION(mysqli_driver_construct); -ZEND_METHOD(mysqli_warning,__construct); - -ZEND_BEGIN_MODULE_GLOBALS(mysqli) - long default_link; - long num_links; - long max_links; - unsigned int default_port; - char *default_host; - char *default_user; - char *default_socket; - char *default_pw; - int reconnect; - int strict; - long error_no; - char *error_msg; - int report_mode; - HashTable *report_ht; - unsigned int multi_query; - unsigned int embedded; -ZEND_END_MODULE_GLOBALS(mysqli) - - -#define MYSQLI_PROPERTY(a) extern int a(mysqli_object *obj, zval **retval TSRMLS_DC) - -MYSQLI_PROPERTY(my_prop_link_host); - -#ifdef ZTS -#define MyG(v) TSRMG(mysqli_globals_id, zend_mysqli_globals *, v) -#else -#define MyG(v) (mysqli_globals.v) -#endif - -#define my_estrdup(x) (x) ? estrdup(x) : NULL -#define my_efree(x) if (x) efree(x) - -ZEND_EXTERN_MODULE_GLOBALS(mysqli) - -#endif /* PHP_MYSQLI.H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt deleted file mode 100644 index 3f2f3c2d3172e..0000000000000 --- a/ext/mysqli/tests/001.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -mysqli connect ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $dbname = "test"; - $test = ""; - - /*** test mysqli_connect localhost:port ***/ - $link = mysqli_connect($host, $user, $passwd, "", 3306); - $test .= ($link) ? "1" : "0"; - mysqli_close($link); - - /*** test mysqli_real_connect ***/ - $link = mysqli_init(); - $test.= (mysqli_real_connect($link, $host, $user, $passwd)) - ? "1" : "0"; - mysqli_close($link); - - /*** test mysqli_real_connect with db ***/ - $link = mysqli_init(); - $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname)) - ? "1" : "0"; - mysqli_close($link); - - /*** test mysqli_real_connect with port ***/ - $link = mysqli_init(); - $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 3306)) - ? "1":"0"; - mysqli_close($link); - - /*** test mysqli_real_connect compressed ***/ - $link = mysqli_init(); - $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0, NULL, MYSQLI_CLIENT_COMPRESS)) - ? "1" : "0"; - mysqli_close($link); - - /* todo ssl connections */ - - var_dump($test); -?> ---EXPECT-- -string(5) "11111" diff --git a/ext/mysqli/tests/002.phpt b/ext/mysqli/tests/002.phpt deleted file mode 100644 index fa4e60e185d61..0000000000000 --- a/ext/mysqli/tests/002.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -mysqli bind_result 1 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - $rc = mysqli_query($link,"DROP TABLE IF EXISTS test_fetch_null"); - - $rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); - - $rc = mysqli_query($link,"INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); - - $stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); - mysqli_execute($stmt); - - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(11) { - [0]=> - int(1) - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL - [5]=> - NULL - [6]=> - NULL - [7]=> - NULL - [8]=> - NULL - [9]=> - string(4) "foo1" - [10]=> - string(4) "1000" -} diff --git a/ext/mysqli/tests/003.phpt b/ext/mysqli/tests/003.phpt deleted file mode 100644 index d043dc7724f61..0000000000000 --- a/ext/mysqli/tests/003.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -mysqli connect ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); - mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, - c3 timestamp(14), - c4 year, - c5 datetime, - c6 timestamp(4), - c7 timestamp(6))"); - - mysqli_query($link,"INSERT INTO test_bind_result VALUES('2002-01-02', - '12:49:00', - '2002-01-02 17:46:59', - 2010, - '2010-07-10', - '2020','1999-12-29')"); - - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - [2]=> - string(19) "2002-01-02 17:46:59" - [3]=> - int(2010) - [4]=> - string(19) "2010-07-10 00:00:00" - [5]=> - string(19) "0000-00-00 00:00:00" - [6]=> - string(19) "1999-12-29 00:00:00" -} diff --git a/ext/mysqli/tests/004.phpt b/ext/mysqli/tests/004.phpt deleted file mode 100644 index c80c7214e3262..0000000000000 --- a/ext/mysqli/tests/004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -mysqli fetch char/text ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include ("connect.inc"); - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)"); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test')"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(10) "1234567890" - [1]=> - string(14) "this is a test" -} diff --git a/ext/mysqli/tests/005.phpt b/ext/mysqli/tests/005.phpt deleted file mode 100644 index a9f75cfd7e976..0000000000000 --- a/ext/mysqli/tests/005.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -mysqli fetch char/text long ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)"); - - $a = str_repeat("A1", 32000); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test[] = $c1; - $test[] = ($a == $c2) ? "32K String ok" : "32K String failed"; - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(10) "1234567890" - [1]=> - string(13) "32K String ok" -} diff --git a/ext/mysqli/tests/006.phpt b/ext/mysqli/tests/006.phpt deleted file mode 100644 index 4b495cc594512..0000000000000 --- a/ext/mysqli/tests/006.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -mysqli fetch long values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned, - c2 int unsigned, - c3 int, - c4 int, - c5 int, - c6 int unsigned, - c7 int)"); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,-0,0)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(0) - [1]=> - int(35999) - [2]=> - NULL - [3]=> - int(-500) - [4]=> - int(-9999999) - [5]=> - int(0) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/007.phpt b/ext/mysqli/tests/007.phpt deleted file mode 100644 index 503863bdc2c05..0000000000000 --- a/ext/mysqli/tests/007.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -mysqli fetch short values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,+30,0)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(0) - [1]=> - int(35999) - [2]=> - NULL - [3]=> - int(-500) - [4]=> - int(-32768) - [5]=> - int(30) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/008.phpt b/ext/mysqli/tests/008.phpt deleted file mode 100644 index 12311d621b977..0000000000000 --- a/ext/mysqli/tests/008.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -mysqli fetch tinyint values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint, - c2 tinyint unsigned, - c3 tinyint not NULL, - c4 tinyint, - c5 tinyint, - c6 tinyint unsigned, - c7 tinyint)"); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(-23) - [1]=> - int(255) - [2]=> - int(0) - [3]=> - int(-100) - [4]=> - int(-127) - [5]=> - int(30) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt deleted file mode 100644 index 091313870fd3e..0000000000000 --- a/ext/mysqli/tests/009.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -mysqli fetch bigint values ---SKIPIF-- -<?php - if (PHP_INT_SIZE == 8) { - echo 'skip test valid only for 32bit systems'; - exit; - } - require_once('skipif.inc'); -?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5, - c2 bigint, - c3 bigint not NULL, - c4 bigint unsigned, - c5 bigint unsigned, - c6 bigint unsigned, - c7 bigint unsigned)"); - - mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7) VALUES (-23,4.0,33333333333333,0,-333333333333,99.9)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - $rc = mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(5) - [1]=> - int(-23) - [2]=> - int(4) - [3]=> - string(14) "33333333333333" - [4]=> - int(0) - [5]=> - string(13) "-333333333333" - [6]=> - int(100) -} diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt deleted file mode 100644 index 0d74bed501c7c..0000000000000 --- a/ext/mysqli/tests/010.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -mysqli fetch float values ---INI-- -precision=12 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 float(3), - c2 float, - c3 float unsigned, - c4 float, - c5 float, - c6 float, - c7 float(10) unsigned)"); - - - mysqli_query($link, "INSERT INTO test_bind_fetch (c1,c2,c3,c4,c5,c6,c7) VALUES (3.1415926535,-0.000001, -5, 999999999999, - sin(0.6), 1.00000000000001, 888888888888888)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - float(3.14159274101) - [1]=> - float(-9.99999997475E-7) - [2]=> - float(0) - [3]=> - float(999999995904) - [4]=> - float(0.564642488956) - [5]=> - float(1) - [6]=> - float(888888914608000) -} diff --git a/ext/mysqli/tests/011.phpt b/ext/mysqli/tests/011.phpt deleted file mode 100644 index 77a157f5641b7..0000000000000 --- a/ext/mysqli/tests/011.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -mysqli fetch mixed values ---INI-- -precision=12 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); - - mysqli_query($link,"CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, - c3 int, c4 bigint, - c5 float, c6 double, - c7 varbinary(10), - c8 varchar(50))"); - - mysqli_query($link,"INSERT INTO test_bind_result VALUES(19,2999,3999,4999999, - 2345.6,5678.89563, - 'foobar','mysql rulez')"); - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(8) { - [0]=> - int(19) - [1]=> - int(2999) - [2]=> - int(3999) - [3]=> - int(4999999) - [4]=> - float(2345.60009766) - [5]=> - float(5678.89563) - [6]=> - string(6) "foobar" - [7]=> - string(11) "mysql rulez" -} diff --git a/ext/mysqli/tests/012.phpt b/ext/mysqli/tests/012.phpt deleted file mode 100644 index 9c52f9c3e4cef..0000000000000 --- a/ext/mysqli/tests/012.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -mysqli fetch mixed values 2 ---INI-- -precision=12 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); - - mysqli_query($link,"CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, - c3 int, c4 bigint, - c5 float, c6 double, - c7 varbinary(10), - c8 varchar(10))"); - - mysqli_query($link,"INSERT INTO test_bind_result VALUES(120,2999,3999,54, - 2.6,58.89, - '206','6.7')"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(8) { - [0]=> - int(120) - [1]=> - int(2999) - [2]=> - int(3999) - [3]=> - int(54) - [4]=> - float(2.59999990463) - [5]=> - float(58.89) - [6]=> - string(3) "206" - [7]=> - string(3) "6.7" -} diff --git a/ext/mysqli/tests/013.phpt b/ext/mysqli/tests/013.phpt deleted file mode 100644 index ff435f94db99b..0000000000000 --- a/ext/mysqli/tests/013.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -mysqli fetch mixed / mysql_query ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); - - mysqli_query($link,"CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, - c3 int, c4 bigint, - c5 decimal(4,2), c6 double, - c7 varbinary(10), - c8 varchar(10))"); - - mysqli_query($link,"INSERT INTO test_bind_result VALUES(120,2999,3999,54, - 2.6,58.89, - '206','6.7')"); - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result"); - - $c = array(0,0,0,0,0,0,0,0); - mysqli_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]); - mysqli_execute($stmt); - mysqli_fetch($stmt); - mysqli_fetch($stmt); - mysqli_stmt_close($stmt); - - $result = mysqli_query($link, "select * from test_bind_result"); - $d = mysqli_fetch_row($result); - mysqli_free_result($result); - - $test = ""; - for ($i=0; $i < count($c); $i++) - $test .= ($c[0] == $d[0]) ? "1" : "0"; - - var_dump($test); - - mysqli_close($link); -?> ---EXPECT-- -string(8) "11111111" diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt deleted file mode 100644 index a180bea75651b..0000000000000 --- a/ext/mysqli/tests/014.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -mysqli autocommit/commit/rollback ---SKIPIF-- -<?php - include "connect.inc"; - $link = mysqli_connect($host, $user, $passwd); - $result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'"); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - mysqli_close($link); - - if ($row[1] == "DISABLED" || $row[1] == "NO") { - printf ("skip innodb support is not installed or enabled."); - } -?> ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_autocommit($link, TRUE); - - mysqli_query($link,"DROP TABLE IF EXISTS ac_01"); - - mysqli_query($link,"CREATE TABLE ac_01(a int, b varchar(10)) type=InnoDB"); - - mysqli_query($link, "INSERT INTO ac_01 VALUES (1, 'foobar')"); - mysqli_autocommit($link, FALSE); - mysqli_query($link, "DELETE FROM ac_01"); - mysqli_query($link, "INSERT INTO ac_01 VALUES (2, 'egon')"); - - mysqli_rollback($link); - - $result = mysqli_query($link, "SELECT * FROM ac_01"); - printf("Num_of_rows=%d\n", mysqli_num_rows($result)); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - - var_dump($row); - - mysqli_query($link, "DELETE FROM ac_01"); - mysqli_query($link, "INSERT INTO ac_01 VALUES (2, 'egon')"); - mysqli_commit($link); - - $result = mysqli_query($link, "SELECT * FROM ac_01"); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - - var_dump($row); - - mysqli_close($link); -?> ---EXPECT-- -Num_of_rows=1 -array(2) { - [0]=> - string(1) "1" - [1]=> - string(6) "foobar" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(4) "egon" -} diff --git a/ext/mysqli/tests/015.phpt b/ext/mysqli/tests/015.phpt deleted file mode 100644 index 26eb4383c9ebd..0000000000000 --- a/ext/mysqli/tests/015.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -mysqli autocommit/commit/rollback with myisam ---SKIPIF-- -<?php - include "connect.inc"; - $link = mysqli_connect($host, $user, $passwd); - $result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'"); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - mysqli_close($link); - - if ($row[1] == "NO") { - printf ("skip innodb support not installed."); - } -?> ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_autocommit($link, TRUE); - - mysqli_query($link,"DROP TABLE IF EXISTS ac_01"); - - mysqli_query($link,"CREATE TABLE ac_01(a int, b varchar(10))"); - - mysqli_query($link, "INSERT INTO ac_01 VALUES (1, 'foobar')"); - mysqli_autocommit($link, FALSE); - - mysqli_query($link, "DELETE FROM ac_01"); - mysqli_query($link, "INSERT INTO ac_01 VALUES (2, 'egon')"); - - mysqli_rollback($link); - - $result = mysqli_query($link, "SELECT * FROM ac_01"); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - - var_dump($row); - - mysqli_query($link, "DELETE FROM ac_01"); - mysqli_query($link, "INSERT INTO ac_01 VALUES (2, 'egon')"); - mysqli_commit($link); - - $result = mysqli_query($link, "SELECT * FROM ac_01"); - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - - var_dump($row); - - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(1) "2" - [1]=> - string(4) "egon" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(4) "egon" -} diff --git a/ext/mysqli/tests/016.phpt b/ext/mysqli/tests/016.phpt deleted file mode 100644 index c61da29ec19a9..0000000000000 --- a/ext/mysqli/tests/016.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -mysqli fetch user variable ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "SET @dummy='foobar'"); - - $stmt = mysqli_prepare($link, "SELECT @dummy"); - mysqli_bind_result($stmt, $dummy); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - var_dump($dummy); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -string(6) "foobar" diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt deleted file mode 100644 index 54d11ef7195c2..0000000000000 --- a/ext/mysqli/tests/017.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -mysqli fetch functions ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - $stmt = mysqli_prepare($link, "SELECT current_user(), database(), 'foo'"); - mysqli_bind_result($stmt, $c0, $c1, $c2); - mysqli_execute($stmt); - - mysqli_fetch($stmt); - mysqli_stmt_close($stmt); - - $c0 = ($c0 == $user . "@" . $host) ? 1 : 0; - - $test = array($c0, $c1, $c2); - - var_dump($test); - mysqli_close($link); -?> ---EXPECT-- -array(3) { - [0]=> - int(1) - [1]=> - string(4) "test" - [2]=> - string(3) "foo" -} diff --git a/ext/mysqli/tests/018.phpt b/ext/mysqli/tests/018.phpt deleted file mode 100644 index 4ba199d866541..0000000000000 --- a/ext/mysqli/tests/018.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -mysqli fetch system variables ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "SET AUTOCOMMIT=0"); - - $stmt = mysqli_prepare($link, "SELECT @@autocommit"); - mysqli_bind_result($stmt, $c0); - mysqli_execute($stmt); - - mysqli_fetch($stmt); - - var_dump($c0); - - mysqli_close($link); -?> ---EXPECT-- -int(0) diff --git a/ext/mysqli/tests/019.phpt b/ext/mysqli/tests/019.phpt deleted file mode 100644 index 41b1ba2cf90fa..0000000000000 --- a/ext/mysqli/tests/019.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -mysqli fetch (bind_param + bind_result) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - $rc = mysqli_query($link,"DROP TABLE IF EXISTS insert_read"); - - $rc = mysqli_query($link,"CREATE TABLE insert_read(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); - - $stmt= mysqli_prepare($link,"INSERT INTO insert_read(col1,col10, col11) VALUES(?,?,?)"); - mysqli_bind_param($stmt, "iss", $c1, $c2, $c3); - - $c1 = 1; - $c2 = "foo"; - $c3 = "foobar"; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from insert_read"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); - mysqli_execute($stmt); - - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(11) { - [0]=> - int(1) - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL - [5]=> - NULL - [6]=> - NULL - [7]=> - NULL - [8]=> - NULL - [9]=> - string(3) "foo" - [10]=> - string(6) "foobar" -} diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt deleted file mode 100644 index 85834c52afc03..0000000000000 --- a/ext/mysqli/tests/020.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -mysqli bind_param/bind_result date ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); - mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, - c3 timestamp(14), - c4 year, - c5 datetime, - c6 timestamp(4), - c7 timestamp(6))"); - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)"); - mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7); - - $d1 = '2002-01-02'; - $d2 = '12:49:00'; - $d3 = '2002-01-02 17:46:59'; - $d4 = 2010; - $d5 ='2010-07-10'; - $d6 = '2020'; - $d7 = '1999-12-29'; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result"); - - mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7); - - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - [2]=> - string(19) "2002-01-02 17:46:59" - [3]=> - int(2010) - [4]=> - string(19) "2010-07-10 00:00:00" - [5]=> - string(19) "0000-00-00 00:00:00" - [6]=> - string(19) "1999-12-29 00:00:00" -} diff --git a/ext/mysqli/tests/021.phpt b/ext/mysqli/tests/021.phpt deleted file mode 100644 index 6f5bad32053e1..0000000000000 --- a/ext/mysqli/tests/021.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -mysqli bind_param+bind_result char/text ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)"); - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)"); - mysqli_bind_param($stmt, "ss", $q1, $q2); - $q1 = "1234567890"; - $q2 = "this is a test"; - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(10) "1234567890" - [1]=> - string(14) "this is a test" -} diff --git a/ext/mysqli/tests/022.phpt b/ext/mysqli/tests/022.phpt deleted file mode 100644 index cce8ed8eb6daa..0000000000000 --- a/ext/mysqli/tests/022.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -mysqli bind_param/bind_result char/text long ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)"); - - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)"); - mysqli_bind_param($stmt, "ss", $a1, $a2); - - $a1 = "1234567890"; - $a2 = str_repeat("A1", 32000); - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test[] = $c1; - $test[] = ($a2 == $c2) ? "32K String ok" : "32K String failed"; - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(10) "1234567890" - [1]=> - string(13) "32K String ok" -} diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt deleted file mode 100644 index 69e9b20858c3b..0000000000000 --- a/ext/mysqli/tests/023.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -mysqli bind_param/bind_prepare fetch long values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned, - c2 int unsigned, - c3 int, - c4 int, - c5 int, - c6 int unsigned, - c7 int)"); - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); - mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); - $c1 = -23; - $c2 = 35999; - $c3 = NULL; - $c4 = -500; - $c5 = -9999999; - $c6 = -0; - $c7 = 0; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(0) - [1]=> - int(35999) - [2]=> - NULL - [3]=> - int(-500) - [4]=> - int(-9999999) - [5]=> - int(0) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt deleted file mode 100644 index c6d6cd7e70247..0000000000000 --- a/ext/mysqli/tests/024.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -mysqli bind_param/bind_result short values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); - mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); - - $c1 = -23; - $c2 = 35999; - $c3 = NULL; - $c4 = -500; - $c5 = -9999999; - $c6 = -0; - $c7 = 0; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(0) - [1]=> - int(35999) - [2]=> - NULL - [3]=> - int(-500) - [4]=> - int(-32768) - [5]=> - int(0) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt deleted file mode 100644 index 85ff0fa29fe1c..0000000000000 --- a/ext/mysqli/tests/025.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -mysqli bind_param/bind_result tinyint values ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint, - c2 tinyint unsigned, - c3 tinyint not NULL, - c4 tinyint, - c5 tinyint, - c6 tinyint unsigned, - c7 tinyint)"); - - $stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)"); - mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); - - $c1 = -23; - $c2 = 300; - $c3 = 0; - $c4 = -100; - $c5 = -127; - $c6 = 30; - $c7 = 0; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)"); - - $c1 = $c2 = $c3 = $c4 = $c5 = $c6 = $c7 = NULL; - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); - - var_dump($test); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -array(7) { - [0]=> - int(-23) - [1]=> - int(255) - [2]=> - int(0) - [3]=> - int(-100) - [4]=> - int(-127) - [5]=> - int(30) - [6]=> - int(0) -} diff --git a/ext/mysqli/tests/026.phpt b/ext/mysqli/tests/026.phpt deleted file mode 100644 index 0f9e882608860..0000000000000 --- a/ext/mysqli/tests/026.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -mysqli bind_param/bind_result with send_long_data ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)"); - - $stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)"); - mysqli_bind_param($stmt, "sb", $c1, $c2); - - $c1 = "Hello World"; - - mysqli_send_long_data($stmt, 1, "This is the first sentence."); - mysqli_send_long_data($stmt, 1, " And this is the second sentence."); - mysqli_send_long_data($stmt, 1, " And finally this is the last sentence."); - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $d1, $d2); - mysqli_execute($stmt); - mysqli_fetch($stmt); - - $test = array($d1,$d2); - - var_dump($test); - - mysqli_stmt_close($stmt); - - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(10) "Hello Worl" - [1]=> - string(99) "This is the first sentence. And this is the second sentence. And finally this is the last sentence." -} diff --git a/ext/mysqli/tests/027.phpt b/ext/mysqli/tests/027.phpt deleted file mode 100644 index 9f8eadf9ddc34..0000000000000 --- a/ext/mysqli/tests/027.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -function test: mysqli_stat ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $status = mysqli_stat($link); - - - var_dump(strlen($status) > 0); - - mysqli_close($link); -?> ---EXPECT-- -bool(true) diff --git a/ext/mysqli/tests/028.phpt b/ext/mysqli/tests/028.phpt deleted file mode 100644 index 021804540d01f..0000000000000 --- a/ext/mysqli/tests/028.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -function test: mysqli_character_set_name ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $cset = substr(mysqli_character_set_name($link),0,6); - - var_dump($cset); - - mysqli_close($link); -?> ---EXPECT-- -string(6) "latin1" diff --git a/ext/mysqli/tests/029.phpt b/ext/mysqli/tests/029.phpt deleted file mode 100644 index 318e6aeb9ecd9..0000000000000 --- a/ext/mysqli/tests/029.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -function test: mysqli_affected_rows ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "drop table if exists general_test"); - mysqli_query($link, "create table general_test (a int)"); - mysqli_query($link, "insert into general_test values (1),(2),(3)"); - - $afc = mysqli_affected_rows($link); - - var_dump($afc); - - mysqli_close($link); -?> ---EXPECT-- -int(3) diff --git a/ext/mysqli/tests/030.phpt b/ext/mysqli/tests/030.phpt deleted file mode 100644 index a3946c3715fed..0000000000000 --- a/ext/mysqli/tests/030.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -function test: mysqli_errno ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - $errno = mysqli_errno($link); - var_dump($errno); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "select * from non_exisiting_table"); - $errno = mysqli_errno($link); - - var_dump($errno); - - mysqli_close($link); -?> ---EXPECT-- -int(0) -int(1146) diff --git a/ext/mysqli/tests/031.phpt b/ext/mysqli/tests/031.phpt deleted file mode 100644 index 743b4b2d0fe58..0000000000000 --- a/ext/mysqli/tests/031.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -function test: mysqli_error ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - $error = mysqli_error($link); - var_dump($error); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "select * from non_exisiting_table"); - $error = mysqli_error($link); - - var_dump($error); - - mysqli_close($link); -?> ---EXPECT-- -string(0) "" -string(46) "Table 'test.non_exisiting_table' doesn't exist" diff --git a/ext/mysqli/tests/032.phpt b/ext/mysqli/tests/032.phpt deleted file mode 100644 index 18bd756a2305e..0000000000000 --- a/ext/mysqli/tests/032.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -function test: mysqli_info ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "drop table if exists general_test"); - mysqli_query($link, "create table general_test (a int)"); - mysqli_query($link, "insert into general_test values (1),(2),(3)"); - - $afc = mysqli_info($link); - - var_dump($afc); - - mysqli_close($link); -?> ---EXPECT-- -string(38) "Records: 3 Duplicates: 0 Warnings: 0" diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt deleted file mode 100644 index de401f49debbd..0000000000000 --- a/ext/mysqli/tests/033.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -function test: mysqli_get_host_info ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $hinfo = mysqli_get_host_info($link); - - var_dump(str_replace('/','', $hinfo)); - - mysqli_close($link); -?> ---EXPECTF-- -string(%d) "%s via %s" diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt deleted file mode 100644 index 468861c3c22f1..0000000000000 --- a/ext/mysqli/tests/034.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -function test: mysqli_get_proto_info ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $pinfo = mysqli_get_proto_info($link); - - var_dump($pinfo); - - mysqli_close($link); -?> ---EXPECT-- -int(10) diff --git a/ext/mysqli/tests/035.phpt b/ext/mysqli/tests/035.phpt deleted file mode 100644 index ea31222ec73ae..0000000000000 --- a/ext/mysqli/tests/035.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -function test: mysqli_get_server_info ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $sinfo = substr(mysqli_get_server_info($link),0,1); - - var_dump(strlen($sinfo)); - - mysqli_close($link); -?> ---EXPECT-- -int(1) diff --git a/ext/mysqli/tests/036.phpt b/ext/mysqli/tests/036.phpt deleted file mode 100644 index 057795bb4c641..0000000000000 --- a/ext/mysqli/tests/036.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -function test: mysqli_insert_id() ---SKIPIF-- -<?php - if (PHP_INT_SIZE == 8) { - echo 'skip test valid only for 32bit systems'; - exit; - } - require_once('skipif.inc'); -?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS t036"); - - mysqli_query($link, "CREATE TABLE t036 (a bigint not null auto_increment primary key, b varchar(10))"); - - - mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo1')"); - $test[] = mysqli_insert_id($link); - - /* we have to insert more values, cause lexer sets auto_increment to max_int - see mysql bug #54. So we don't check for the value, only for type (which must - be type string) - */ - - mysqli_query($link, "ALTER TABLE t036 AUTO_INCREMENT=9999999999999998"); - mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo2')"); - mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo3')"); - mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo4')"); - $x = mysqli_insert_id($link); - $test[] = is_string($x); - - var_dump($test); - - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - int(1) - [1]=> - bool(true) -} diff --git a/ext/mysqli/tests/037.phpt b/ext/mysqli/tests/037.phpt deleted file mode 100644 index c9089c19be4fe..0000000000000 --- a/ext/mysqli/tests/037.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -function test: mysqli_field_count() ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_result"); - - mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10))"); - - mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')"); - $ir[] = mysqli_field_count($link); - - mysqli_real_query($link, "SELECT * FROM test_result"); - $ir[] = mysqli_field_count($link); - - - var_dump($ir); - - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - int(0) - [1]=> - int(2) -} diff --git a/ext/mysqli/tests/038.phpt b/ext/mysqli/tests/038.phpt deleted file mode 100644 index ecd4f908f1120..0000000000000 --- a/ext/mysqli/tests/038.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -function test: mysqli_num_fields() ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_result"); - - mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10))"); - - mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')"); - - mysqli_real_query($link, "SELECT * FROM test_result"); - if (mysqli_field_count($link)) { - $result = mysqli_store_result($link); - $num = mysqli_num_fields($result); - mysqli_free_result($result); - } - - var_dump($num); - - mysqli_close($link); -?> ---EXPECT-- -int(2) diff --git a/ext/mysqli/tests/039.phpt b/ext/mysqli/tests/039.phpt deleted file mode 100644 index 1d5ab991062e3..0000000000000 --- a/ext/mysqli/tests/039.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -function test: mysqli_num_fields() 2 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_real_query($link, "SHOW VARIABLES"); - - if (mysqli_field_count($link)) { - $result = mysqli_store_result($link); - $num = mysqli_num_fields($result); - mysqli_free_result($result); - } - - var_dump($num); - - mysqli_close($link); -?> ---EXPECT-- -int(2) diff --git a/ext/mysqli/tests/040.phpt b/ext/mysqli/tests/040.phpt deleted file mode 100644 index 79bfe0d5fb485..0000000000000 --- a/ext/mysqli/tests/040.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -function test: mysqli_num_rows() ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_result"); - - mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10))"); - - mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')"); - - mysqli_real_query($link, "SELECT * FROM test_result"); - if (mysqli_field_count($link)) { - $result = mysqli_store_result($link); - $num = mysqli_num_rows($result); - mysqli_free_result($result); - } - - var_dump($num); - - mysqli_close($link); -?> ---EXPECT-- -int(1) diff --git a/ext/mysqli/tests/041.phpt b/ext/mysqli/tests/041.phpt deleted file mode 100644 index 90bed1ad49ad8..0000000000000 --- a/ext/mysqli/tests/041.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -function test: mysqli_warning_count() ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"); - mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"); - - var_dump(mysqli_warning_count($link)); - - mysqli_close($link); -?> ---EXPECT-- -int(1) diff --git a/ext/mysqli/tests/042.phpt b/ext/mysqli/tests/042.phpt deleted file mode 100644 index fe6d23e172afe..0000000000000 --- a/ext/mysqli/tests/042.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -mysqli_fetch_object ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); - - $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); - mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); - - $c1 = -23; - $c2 = 35999; - $c3 = NULL; - $c4 = -500; - $c5 = -9999999; - $c6 = -0; - $c7 = 0; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $result = mysqli_query($link, "SELECT * FROM test_bind_fetch"); - $test = mysqli_fetch_object($result); - mysqli_free_result($result); - - var_dump($test); - - mysqli_close($link); -?> ---EXPECTF-- -object(stdClass)#%d (7) { - ["c1"]=> - string(1) "0" - ["c2"]=> - string(5) "35999" - ["c3"]=> - NULL - ["c4"]=> - string(4) "-500" - ["c5"]=> - string(6) "-32768" - ["c6"]=> - string(1) "0" - ["c7"]=> - string(1) "0" -} diff --git a/ext/mysqli/tests/043.phpt b/ext/mysqli/tests/043.phpt deleted file mode 100644 index fb0284e06a392..0000000000000 --- a/ext/mysqli/tests/043.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -mysqli_bind_param (UPDATE) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_update"); - mysqli_query($link,"CREATE TABLE test_update(a varchar(10), - b int)"); - - mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)"); - - $stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?"); - mysqli_bind_param($stmt, "sii", $c1, $c2, $c3); - - $c1 = "Rasmus"; - $c2 = 1; - $c3 = 2; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update"); - $test = mysqli_fetch_row($result); - mysqli_free_result($result); - - var_dump($test); - - mysqli_close($link); -?> ---EXPECT-- -array(1) { - [0]=> - string(15) "Rasmus is No. 1" -} diff --git a/ext/mysqli/tests/044.phpt b/ext/mysqli/tests/044.phpt deleted file mode 100644 index 28e73a7e0999b..0000000000000 --- a/ext/mysqli/tests/044.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -mysqli_get_server_version ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $i = mysqli_get_server_version($link); - - $test = $i / $i; - - var_dump($test); - - mysqli_close($link); -?> ---EXPECT-- -int(1) diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt deleted file mode 100644 index 2f9490c282c73..0000000000000 --- a/ext/mysqli/tests/045.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -mysqli_bind_result (SHOW) ---SKIPIF-- -<?php - include "connect.inc"; - $link = mysqli_connect($host, $user, $passwd); - - - $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); - mysqli_execute($stmt); - - if (!$stmt->field_count) { - printf("skip SHOW command is not supported in prepared statements."); - } - $stmt->close(); - mysqli_close($link); -?> ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); - mysqli_execute($stmt); - - mysqli_bind_result($stmt, $c1, $c2); - mysqli_fetch($stmt); - mysqli_stmt_close($stmt); - $test = array ($c1,$c2); - - var_dump($test); - - mysqli_close($link); -?> ---EXPECT-- -array(2) { - [0]=> - string(4) "port" - [1]=> - string(4) "3306" -} diff --git a/ext/mysqli/tests/046.phpt b/ext/mysqli/tests/046.phpt deleted file mode 100644 index e88348bfa9259..0000000000000 --- a/ext/mysqli/tests/046.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -mysqli_stmt_affected_rows (delete) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_affected"); - mysqli_query($link, "CREATE TABLE test_affected (foo int)"); - - mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)"); - - $stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?"); - mysqli_bind_param($stmt, "i", $c1); - - $c1 = 2; - - mysqli_execute($stmt); - $x = mysqli_stmt_affected_rows($stmt); - - mysqli_stmt_close($stmt); - var_dump($x==1); - - mysqli_close($link); -?> ---EXPECT-- -bool(true) diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt deleted file mode 100644 index 8663e8a64165c..0000000000000 --- a/ext/mysqli/tests/047.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -mysqli_get_metadata ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "DROP TABLE IF EXISTS test_affected"); - mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1)"); - - mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_affected"); - mysqli_execute($stmt); - $result = mysqli_get_metadata($stmt); - - $fields = mysqli_fetch_fields($result); - mysqli_free_result($result); - - var_dump($fields); - - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECTF-- -array(2) { - [0]=> - object(stdClass)#5 (11) { - ["name"]=> - string(3) "foo" - ["orgname"]=> - string(3) "foo" - ["table"]=> - string(13) "test_affected" - ["orgtable"]=> - string(13) "test_affected" - ["def"]=> - string(0) "" - ["max_length"]=> - int(0) - ["length"]=> - int(11) - ["charsetnr"]=> - int(63) - ["flags"]=> - int(32768) - ["type"]=> - int(3) - ["decimals"]=> - int(0) - } - [1]=> - object(stdClass)#6 (11) { - ["name"]=> - string(3) "bar" - ["orgname"]=> - string(3) "bar" - ["table"]=> - string(13) "test_affected" - ["orgtable"]=> - string(13) "test_affected" - ["def"]=> - string(0) "" - ["max_length"]=> - int(0) - ["length"]=> - int(10) - ["charsetnr"]=> - int(8) - ["flags"]=> - int(0) - ["type"]=> - int(253) - ["decimals"]=> - int(0) - } -} diff --git a/ext/mysqli/tests/048.phpt b/ext/mysqli/tests/048.phpt deleted file mode 100644 index 1cf5b67894b9a..0000000000000 --- a/ext/mysqli/tests/048.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -mysqli bind_result (OO-Style) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = mysqli_connect($host, $user, $passwd); - - $mysql->select_db("test"); - $mysql->query("DROP TABLE IF EXISTS test_fetch_null"); - - $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); - - $mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); - - $stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null"); - $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); - $stmt->execute(); - - $stmt->fetch(); - - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11); - - var_dump($test); - - $stmt->close(); - $mysql->close(); -?> ---EXPECT-- -array(11) { - [0]=> - int(1) - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL - [5]=> - NULL - [6]=> - NULL - [7]=> - NULL - [8]=> - NULL - [9]=> - string(4) "foo1" - [10]=> - string(4) "1000" -} diff --git a/ext/mysqli/tests/049.phpt b/ext/mysqli/tests/049.phpt deleted file mode 100644 index 8d16c3d4c7829..0000000000000 --- a/ext/mysqli/tests/049.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -mysql_fetch_row (OO-Style) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = mysqli_connect($host, $user, $passwd); - - $mysql->select_db("test"); - $result = $mysql->query("SELECT CURRENT_USER()"); - $row = $result->fetch_row(); - $result->close(); - - $ok = ($row[0] == $user . "@" . $host); - var_dump($ok); - - $mysql->close(); -?> ---EXPECT-- -bool(true) diff --git a/ext/mysqli/tests/050.phpt b/ext/mysqli/tests/050.phpt deleted file mode 100644 index 5f923ccf34bd9..0000000000000 --- a/ext/mysqli/tests/050.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -non freed statement test ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * non freed stamement - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $stmt = mysqli_prepare($link, "SELECT CURRENT_USER()"); - mysqli_execute($stmt); - - mysqli_close($link); - printf("Ok\n"); -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/051.phpt b/ext/mysqli/tests/051.phpt deleted file mode 100644 index ef378757f1adf..0000000000000 --- a/ext/mysqli/tests/051.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -free statement after close ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * free statement after close - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()"); - mysqli_execute($stmt1); - - mysqli_close($link); - @mysqli_stmt_close($stmt1); - printf("Ok\n"); -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/052.phpt b/ext/mysqli/tests/052.phpt deleted file mode 100644 index 3fa5dc8f17028..0000000000000 --- a/ext/mysqli/tests/052.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -call statement after close ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * statement call after close - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()"); - - mysqli_close($link); - @mysqli_execute($stmt2); - @mysqli_stmt_close($stmt2); - printf("Ok\n"); -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/053.phpt b/ext/mysqli/tests/053.phpt deleted file mode 100644 index 99148c7e80dd1..0000000000000 --- a/ext/mysqli/tests/053.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -not freed resultset ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * non freed resultset - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $result = mysqli_query($link, "SELECT CURRENT_USER()"); - mysqli_close($link); - printf("Ok\n"); - -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/054.phpt b/ext/mysqli/tests/054.phpt deleted file mode 100644 index 727b87ef8e99c..0000000000000 --- a/ext/mysqli/tests/054.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -free resultset after close ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * free resultset after close - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $result1 = mysqli_query($link, "SELECT CURRENT_USER()"); - mysqli_close($link); - mysqli_free_result($result1); - printf("Ok\n"); -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/055.phpt b/ext/mysqli/tests/055.phpt deleted file mode 100644 index e650dbcecdd1e..0000000000000 --- a/ext/mysqli/tests/055.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -free nothing ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /************************ - * don't free anything - ************************/ - $link = mysqli_connect($host, $user, $passwd); - - $result2 = mysqli_query($link, "SELECT CURRENT_USER()"); - $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()"); - printf("Ok\n"); -?> ---EXPECT-- -Ok diff --git a/ext/mysqli/tests/056.phpt b/ext/mysqli/tests/056.phpt deleted file mode 100644 index cc5c32fc6099c..0000000000000 --- a/ext/mysqli/tests/056.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -extend mysqli ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - class foobar extends mysqli { - function test () { - return ("I like MySQL 4.1"); - } - } - - $foo = new foobar(); - $foo->connect($host, $user, $passwd); - $foo->close(); - printf("%s\n", $foo->test()); -?> ---EXPECT-- -I like MySQL 4.1 diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt deleted file mode 100644 index a987c72381c45..0000000000000 --- a/ext/mysqli/tests/057.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -mysqli_get_metadata ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_store_result"); - mysqli_query($link,"CREATE TABLE test_store_result (a int)"); - - mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)"); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"); - mysqli_execute($stmt); - - /* this should produce an out of sync error */ - if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) { - mysqli_free_result($result); - printf ("Query ok\n"); - } - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"); - mysqli_execute($stmt); - $result1 = mysqli_get_metadata($stmt); - mysqli_stmt_store_result($stmt); - - printf ("Rows: %d\n", mysqli_stmt_affected_rows($stmt)); - - /* this should show an error, cause results are not buffered */ - if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) { - $row = mysqli_fetch_row($result); - mysqli_free_result($result); - } - - - var_dump($row); - - mysqli_free_result($result1); - mysqli_stmt_close($stmt); - mysqli_close($link); -?> ---EXPECT-- -Rows: 3 -array(1) { - [0]=> - string(1) "1" -} diff --git a/ext/mysqli/tests/058.phpt b/ext/mysqli/tests/058.phpt deleted file mode 100644 index 7554d08f68727..0000000000000 --- a/ext/mysqli/tests/058.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -multiple binds ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS mbind"); - mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))"); - - $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)"); - - mysqli_bind_param($stmt, "is", $a, $b); - - $a = 1; - $b = "foo"; - - mysqli_execute($stmt); - - mysqli_bind_param($stmt, "is", $c, $d); - - $c = 2; - $d = "bar"; - - mysqli_execute($stmt); - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM mbind"); - mysqli_execute($stmt); - - mysqli_bind_result($stmt, $e, $f); - mysqli_fetch($stmt); - - mysqli_bind_result($stmt, $g, $h); - mysqli_fetch($stmt); - - var_dump((array($e,$f,$g,$h))); - - mysqli_close($link); -?> ---EXPECT-- -array(4) { - [0]=> - int(1) - [1]=> - string(3) "foo" - [2]=> - int(2) - [3]=> - string(3) "bar" -} diff --git a/ext/mysqli/tests/059.phpt b/ext/mysqli/tests/059.phpt deleted file mode 100644 index 0bc8a62bbf112..0000000000000 --- a/ext/mysqli/tests/059.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -sqlmode + bind ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link, "SET SQL_MODE='PIPES_AS_CONCAT'"); - - mysqli_query($link,"DROP TABLE IF EXISTS mbind"); - mysqli_query($link,"CREATE TABLE mbind (b varchar(25))"); - - $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)"); - - mysqli_bind_param($stmt, "ss", $a, $b); - - $a = "foo"; - $b = "bar"; - - mysqli_execute($stmt); - - mysqli_stmt_close($stmt); - - $stmt = mysqli_prepare($link, "SELECT * FROM mbind"); - mysqli_execute($stmt); - - mysqli_bind_result($stmt, $e); - mysqli_fetch($stmt); - - var_dump($e); - - mysqli_close($link); -?> ---EXPECT-- -string(6) "foobar" diff --git a/ext/mysqli/tests/060.phpt b/ext/mysqli/tests/060.phpt deleted file mode 100644 index 875130dc55507..0000000000000 --- a/ext/mysqli/tests/060.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -mysqli_fetch_object with classes ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - class test_class { - function __construct($arg1, $arg2) { - echo __METHOD__ . "($arg1,$arg2)\n"; - } - } - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - - mysqli_select_db($link, "test"); - - mysqli_query($link,"DROP TABLE IF EXISTS test_fetch"); - mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); - - mysqli_query($link, "INSERT INTO test_fetch VALUES ( -23, 35999, NULL, -500, -9999999, -0, 0)"); - - $result = mysqli_query($link, "SELECT * FROM test_bind_fetch"); - $test = mysqli_fetch_object($result, 'test_class', array(1, 2)); - mysqli_free_result($result); - - var_dump($test); - - mysqli_close($link); - - echo "Done\n"; -?> ---EXPECTF-- -test_class::__construct(1,2) -object(test_class)#%d (7) { - ["c1"]=> - string(1) "0" - ["c2"]=> - string(5) "35999" - ["c3"]=> - NULL - ["c4"]=> - string(4) "-500" - ["c5"]=> - string(6) "-32768" - ["c6"]=> - string(1) "0" - ["c7"]=> - string(1) "0" -} -Done diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt deleted file mode 100644 index c7a217f274694..0000000000000 --- a/ext/mysqli/tests/061.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -local infile handler ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - function my_read($fp, &$buffer, $buflen, &$error) { - $buffer = strrev(fread($fp, $buflen)); - return(strlen($buffer)); - } - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd, "test"); - - /* create temporary file */ - $filename = dirname(__FILE__) . "061.csv"; - $fp = fopen($filename, "w"); - fwrite($fp, "foo;bar"); - fclose($fp); - - mysqli_query($link,"DROP TABLE IF EXISTS t_061"); - mysqli_query($link,"CREATE TABLE t_061 (c1 varchar(10), c2 varchar(10))"); - - mysqli_query($link, "LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE t_061 FIELDS TERMINATED BY ';'"); - - mysqli_set_local_infile_handler($link, "my_read"); - mysqli_query($link, "LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE t_061 FIELDS TERMINATED BY ';'"); - - if ($result = mysqli_query($link, "SELECT c1,c2 FROM t_061")) { - while (($row = mysqli_fetch_row($result))) { - printf("%s-%s\n", $row[0], $row[1]); - } - mysqli_free_result($result); - } - - mysqli_close($link); - unlink($filename); -?> ---EXPECT-- -foo-bar -rab-oof diff --git a/ext/mysqli/tests/062.phpt b/ext/mysqli/tests/062.phpt deleted file mode 100644 index 962abce162dbb..0000000000000 --- a/ext/mysqli/tests/062.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -resultset constructor ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $mysql = new mysqli($host, $user, $passwd); - - $mysql->real_query("SELECT 'foo' FROM DUAL"); - - $myresult = new mysqli_result($mysql); - - $row = $myresult->fetch_row(); - $myresult->close(); - $mysql->close(); - - var_dump($row); -?> ---EXPECT-- -array(1) { - [0]=> - string(3) "foo" -} diff --git a/ext/mysqli/tests/063.phpt b/ext/mysqli/tests/063.phpt deleted file mode 100644 index 9dd01629aa637..0000000000000 --- a/ext/mysqli/tests/063.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -resultset constructor ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $mysql = new mysqli($host, $user, $passwd); - - $stmt = new mysqli_stmt($mysql, "SELECT 'foo' FROM DUAL"); - $stmt->execute(); - $stmt->bind_result($foo); - $stmt->fetch(); - $stmt->close(); - $mysql->close(); - - var_dump($foo); -?> ---EXPECT-- -string(3) "foo" diff --git a/ext/mysqli/tests/064.phpt b/ext/mysqli/tests/064.phpt deleted file mode 100644 index e6df1e450553b..0000000000000 --- a/ext/mysqli/tests/064.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -NULL binding ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $mysql = new mysqli($host, $user, $passwd); - - $stmt = new mysqli_stmt($mysql, "SELECT NULL FROM DUAL"); - $stmt->execute(); - $stmt->bind_result($foo); - $stmt->fetch(); - $stmt->close(); - $mysql->close(); - - var_dump($foo); -?> ---EXPECT-- -NULL diff --git a/ext/mysqli/tests/065.phpt b/ext/mysqli/tests/065.phpt deleted file mode 100644 index d0fa071169eaa..0000000000000 --- a/ext/mysqli/tests/065.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -set character set ---SKIPIF-- -<?php -require_once('skipif.inc'); -if (!function_exists('mysqli_set_charset')) { - die('skip mysqli_set_charset() not available'); -} -?> ---FILE-- -<?php - include "connect.inc"; - - $mysql = new mysqli($host, $user, $passwd); - - $esc_str = chr(0xbf) . chr(0x5c); - - if ($mysql->set_charset("latin1")) { - /* 5C should be escaped */ - $len[0] = strlen($mysql->real_escape_string($esc_str)); - $charset[0] = $mysql->client_encoding(); - } - - if ($mysql->set_charset("gbk")) { - /* nothing should be escaped, it's a valid gbk character */ - $len[1] = strlen($mysql->real_escape_string($esc_str)); - $charset[1] = $mysql->client_encoding(); - } - - $mysql->close(); - var_dump($len[0]); - var_dump($len[1]); - var_dump($charset[0]); - var_dump($charset[1]); -?> ---EXPECT-- -int(3) -int(2) -string(6) "latin1" -string(3) "gbk" diff --git a/ext/mysqli/tests/066.phpt b/ext/mysqli/tests/066.phpt deleted file mode 100644 index 01434f8d3fb28..0000000000000 --- a/ext/mysqli/tests/066.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -function test: mysqli_warning object ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = new mysqli($host, $user, $passwd, "test"); - - $mysql->query("DROP TABLE IF EXISTS test_warnings"); - - $mysql->query("CREATE TABLE test_warnings (a int not null)"); - - $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)"); - - if (($warning = new mysqli_warning($mysql))) { - do { - printf("Warning\n"); - } while ($warning->next()); - } - - $mysql->close(); -?> ---EXPECT-- -Warning diff --git a/ext/mysqli/tests/067.phpt b/ext/mysqli/tests/067.phpt deleted file mode 100644 index d58d24cfee2e4..0000000000000 --- a/ext/mysqli/tests/067.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -function test: nested selects (cursors) ---SKIPIF-- -<?php - require_once('skipif.inc'); - /* skip cursor test for versions < 50004 */ - if (mysqli_get_client_version() < 50009) { - die("skip Client library doesn't support cursors"); - } -?> ---FILE-- -<?php - - function open_cursor($mysql, $query) { - $stmt = $mysql->prepare($query); - $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY); - return $stmt; - } - - include "connect.inc"; - $a = array(); - - /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = new mysqli($host, $user, $passwd, "test"); - - for ($i=0;$i < 3; $i++) { - $mysql->query("DROP TABLE IF EXISTS cursor$i"); - $mysql->query("CREATE TABLE cursor$i (a int not null)"); - $mysql->query("INSERT INTO cursor$i VALUES (1),(2),(3),(4),(5),(6)"); - $stmt[$i] = open_cursor($mysql, "SELECT a FROM cursor$i"); - $stmt[$i]->execute(); - $stmt[$i]->bind_result($a[$i]); - } - - - $cnt = 0; - while ($stmt[0]->fetch()) { - $stmt[1]->fetch(); - $stmt[2]->fetch(); - $cnt += $a[0] + $a[1] + $a[2]; - } - - for ($i=0; $i < 3; $i++) { - $stmt[$i]->close(); - } - - $mysql->close(); - var_dump($cnt); -?> ---EXPECT-- -int(63) diff --git a/ext/mysqli/tests/bug28817.phpt b/ext/mysqli/tests/bug28817.phpt deleted file mode 100644 index 0cc8b13612861..0000000000000 --- a/ext/mysqli/tests/bug28817.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #28817 testcase (properties) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - class my_mysql extends mysqli { - public $p_test; - - function __construct() { - $this->p_test[] = "foo"; - $this->p_test[] = "bar"; - } - } - - - $mysql = new my_mysql(); - - var_dump($mysql->p_test); - @var_dump($mysql->errno); - - $mysql->connect($host, $user, $passwd); - $mysql->select_db("nonexistingdb"); - - var_dump($mysql->errno > 0); - - $mysql->close(); -?> ---EXPECTF-- -array(2) { - [0]=> - string(3) "foo" - [1]=> - string(3) "bar" -} -NULL -bool(true) diff --git a/ext/mysqli/tests/bug29311.phpt b/ext/mysqli/tests/bug29311.phpt deleted file mode 100644 index b50de178b2236..0000000000000 --- a/ext/mysqli/tests/bug29311.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -constructor test ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - /* class 1 calls parent constructor */ - class mysql1 extends mysqli { - function __construct() { - global $host, $user, $passwd; - parent::__construct($host, $user, $passwd, "test"); - } - } - - /* class 2 has an own constructor */ - class mysql2 extends mysqli { - - function __construct() { - global $host, $user, $passwd; - $this->connect($host, $user, $passwd, "test"); - } - } - - /* class 3 has no constructor */ - class mysql3 extends mysqli { - - } - - $foo[0] = new mysql1(); - $foo[1] = new mysql2(); - $foo[2] = new mysql3($host, $user, $passwd, "test"); - - - for ($i=0; $i < 3; $i++) { - if (($result = $foo[$i]->query("SELECT DATABASE()"))) { - $row = $result->fetch_row(); - printf("%d: %s\n", $i, $row[0]); - $result->close(); - } - $foo[$i]->close(); - } -?> ---EXPECTF-- -0: test -1: test -2: test diff --git a/ext/mysqli/tests/bug30967.phpt b/ext/mysqli/tests/bug30967.phpt deleted file mode 100644 index 0a82d0d43cd48..0000000000000 --- a/ext/mysqli/tests/bug30967.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #30967 testcase (properties) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - class mysql1 extends mysqli { - } - - class mysql2 extends mysql1 { - } - - $mysql = new mysql2($host, $user, $passwd, "test"); - - $mysql->query("THIS DOES NOT WORK"); - printf("%d\n", $mysql->errno); - - $mysql->close(); -?> ---EXPECTF-- -1064 diff --git a/ext/mysqli/tests/bug31141.phpt b/ext/mysqli/tests/bug31141.phpt deleted file mode 100644 index acad79f1f9e87..0000000000000 --- a/ext/mysqli/tests/bug31141.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #31141 testcase (properties) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php -class Test extends mysqli -{ - public $test = array(); - - function foo() - { - $ar_test = array("foo", "bar"); - $this->test = &$ar_test; - } -} - -$my_test = new Test; -$my_test->foo(); -var_dump($my_test->test); -?> ---EXPECTF-- -array(2) { - [0]=> - string(3) "foo" - [1]=> - string(3) "bar" -} diff --git a/ext/mysqli/tests/bug31668.phpt b/ext/mysqli/tests/bug31668.phpt deleted file mode 100644 index b813096a2a4b5..0000000000000 --- a/ext/mysqli/tests/bug31668.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #31668 multi_query works exactly every other time (multi_query was global, now per connection) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include "connect.inc"; - - $mysql = new mysqli($host, $user, $passwd, "test"); - $mysql->multi_query('SELECT 1;SELECT 2'); - do { - $res = $mysql->store_result(); - if ($mysql->errno == 0) { - while ($arr = $res->fetch_assoc()) { - var_dump($arr); - } - $res->free(); - } - } while ($mysql->next_result()); - var_dump($mysql->error, __LINE__); - $mysql->close(); - - $mysql = new mysqli($host, $user, $passwd, "test"); - $mysql->multi_query('SELECT 1;SELECT 2'); - do { - $res = $mysql->store_result(); - if ($mysql->errno == 0) { - while ($arr = $res->fetch_assoc()) { - var_dump($arr); - } - $res->free(); - } - } while ($mysql->next_result()); - var_dump($mysql->error, __LINE__); -?> ---EXPECTF-- -array(1) { - [1]=> - string(1) "1" -} -array(1) { - [2]=> - string(1) "2" -} -string(0) "" -int(%d) -array(1) { - [1]=> - string(1) "1" -} -array(1) { - [2]=> - string(1) "2" -} -string(0) "" -int(%d) diff --git a/ext/mysqli/tests/bug32405.phpt b/ext/mysqli/tests/bug32405.phpt deleted file mode 100644 index 9b58e3611bfc2..0000000000000 --- a/ext/mysqli/tests/bug32405.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #32405 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include ("connect.inc"); - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - mysqli_select_db($link, "test"); - - /* two fields are needed. the problem does not occur with 1 field only selected. */ - $link->query("CREATE TABLE test_users(user_id int(10) unsigned NOT NULL auto_increment, login varchar(50) default '', PRIMARY KEY (user_id))"); - $link->query('INSERT INTO test_users VALUES (NULL, "user1"), (NULL, "user2"), (NULL, "user3"), (NULL, "user4")'); - - - if ($stmt = $link->prepare("SELECT SQL_NO_CACHE user_id, login FROM test_users")) { - $stmt->execute(); - $stmt->bind_result($col1, $col2); - while ($stmt->fetch()) { - var_dump($col1, $col2); - } - $stmt->close(); - } - - mysqli_query($link,"DROP TABLE test_users"); - mysqli_close($link); -?> ---EXPECT-- -int(1) -string(5) "user1" -int(2) -string(5) "user2" -int(3) -string(5) "user3" -int(4) -string(5) "user4" diff --git a/ext/mysqli/tests/bug33090.phpt b/ext/mysqli/tests/bug33090.phpt deleted file mode 100644 index 5c1cba961e485..0000000000000 --- a/ext/mysqli/tests/bug33090.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #33090 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - include ("connect.inc"); - - /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - mysqli_select_db($link, "test"); - - if (!($link->prepare("this makes no sense"))) { - printf("%d\n", $link->errno); - printf("%s\n", $link->sqlstate); - } - $link->close(); -?> ---EXPECT-- -1064 -42000 diff --git a/ext/mysqli/tests/bug33263.phpt b/ext/mysqli/tests/bug33263.phpt deleted file mode 100644 index 44f9167c95dd9..0000000000000 --- a/ext/mysqli/tests/bug33263.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -bug #33263 (mysqli_real_connect in __construct) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - - include "connect.inc"; - - class test extends mysqli - { - public function __construct($host, $user, $passwd, $db) { - parent::init(); - parent::real_connect($host, $user, $passwd, $db); - } - } - - $mysql = new test($host, $user, $passwd, "test"); - - $stmt = $mysql->prepare("SELECT DATABASE()"); - $stmt->execute(); - $stmt->bind_result($db); - $stmt->fetch(); - $stmt->close(); - - var_dump($db); - - $mysql->close(); -?> ---EXPECT-- -string(4) "test" diff --git a/ext/mysqli/tests/bug33491.phpt b/ext/mysqli/tests/bug33491.phpt deleted file mode 100644 index 067e489aae4bb..0000000000000 --- a/ext/mysqli/tests/bug33491.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #33491 (extended mysqli class crashes when result is not object) ---INI-- -error_reporting=4095 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - -class DB extends mysqli -{ - public function query_single($query) { - $result = parent::query($query); - $result->fetch_row(); // <- Here be crash - } -} - -require_once dirname(__FILE__)."/connect.inc"; - -// Segfault when using the DB class which extends mysqli -$DB = new DB($host, $user, $passwd, ''); -$DB->query_single('SELECT DATE()'); - -?> ---EXPECTF-- -Fatal error: Call to a member function fetch_row() on a non-object in %sbug33491.php on line %d diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt deleted file mode 100644 index 12d6ce2e9a23c..0000000000000 --- a/ext/mysqli/tests/bug34810.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -bug #34810 (mysqli::init() and others use wrong $this pointer without checks) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - -class DbConnection { - public function connect() { - include "connect.inc"; - - $link = mysqli::connect($host, $user, $passwd); - var_dump($link); - - $link = mysqli::init(); - var_dump($link); - - $mysql = new mysqli($host, $user, $passwd, "test"); - $mysql->query("DROP TABLE IF EXISTS test_warnings"); - $mysql->query("CREATE TABLE test_warnings (a int not null)"); - $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)"); - var_dump(mysqli_warning::__construct($mysql)); - } -} - -$db = new DbConnection(); -$db->connect(); - -echo "Done\n"; -?> ---EXPECTF-- -object(mysqli)#%d (0) { -} -object(mysqli)#%d (0) { -} -object(mysqli_warning)#%d (0) { -} -Done diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc deleted file mode 100644 index 2fcf4ff0fff36..0000000000000 --- a/ext/mysqli/tests/connect.inc +++ /dev/null @@ -1,23 +0,0 @@ -<?php - - /* default values are localhost, root and empty password - Change the values if you use another configuration */ - $driver = new mysqli_driver; - - if (!$driver->embedded) { - $host = "localhost"; - $user = "root"; - $passwd = ""; - } else { - $path = dirname(__FILE__); - $host = $user = $passwd = NULL; - $args = array( - "--datadir=$path", - "--innodb_data_home_dir=$path", - "--innodb_data_file_path=ibdata1:10M:autoextend", - "--log-error=$path/testrun.log" - ); - $driver->embedded_server_start(TRUE, $args, NULL); - } - -?> diff --git a/ext/mysqli/tests/skipif.inc b/ext/mysqli/tests/skipif.inc deleted file mode 100644 index f471b5e126aed..0000000000000 --- a/ext/mysqli/tests/skipif.inc +++ /dev/null @@ -1,10 +0,0 @@ -<?php -if (!extension_loaded('mysqli')){ - die('skip mysqli extension not available'); -} -include "connect.inc"; -$driver = new mysqli_driver(); -if (!$driver->embedded && !@mysqli_connect($host, $user, $passwd, "", 3306)) { - die('skip could not connect to MySQL'); -} -?> diff --git a/ext/mysqli/tests/skipifemb.inc b/ext/mysqli/tests/skipifemb.inc deleted file mode 100644 index 298c7219a6216..0000000000000 --- a/ext/mysqli/tests/skipifemb.inc +++ /dev/null @@ -1,5 +0,0 @@ -<?php - $driver = new mysqli_driver(); - if ($driver->embedded) - die("skip test doesn't run with embedded server"); -?> diff --git a/ext/ncurses/CREDITS b/ext/ncurses/CREDITS deleted file mode 100644 index 312b522ef7994..0000000000000 --- a/ext/ncurses/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ncurses -Ilia Alshanetsky, Wez Furlong, Hartmut Holzgraefe, Georg Richter diff --git a/ext/ncurses/EXPERIMENTAL b/ext/ncurses/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/ncurses/c-prototypes b/ext/ncurses/c-prototypes deleted file mode 100644 index c98bd29730c98..0000000000000 --- a/ext/ncurses/c-prototypes +++ /dev/null @@ -1,263 +0,0 @@ -+ int addch(int); -+ int addchnstr(int *,int); -+ int addchstr(int *); -+ int addnstr(string,int); -+ int addstr(string); -+ int assume_default_colors (int,int); -- int attr_get(int *,int *,void *); -- int attr_off(int,void *); -- int attr_on(int,void *); -- int attr_set(int,int,void *); -+ int attroff(int); -+ int attron(int); -+ int attrset(int); -+ int baudrate(void); -+ int beep(void); -+ int bkgd(int); -+ void bkgdset(int); -+ int border(int,int,int,int,int,int,int,int); -- int box(resource,int,int); -+ bool can_change_color(void); -+ int cbreak(void); -- int chgat(int,int,int,void *); -+ int clear(void); -- int clearok(resource,bool); -+ int clrtobot(void); -+ int clrtoeol(void); -- int color_content(int,int*,int*,int*); -+ int color_set(int,void*); -- int copywin(resource,resource,int,int,int,int,int,int,int); -+ int curs_set(int); -+ int def_prog_mode(void); -+ int def_shell_mode(void); -+ int define_key (string,int); -+ int delay_output(int); -+ int delch(void); -+ int deleteln(void); -- void delscreen(SCREEN *); -+ int delwin(resource); -+ int doupdate(void); -+ int echo(void); -+ int echochar(int); -+ int endwin(void); -+ int erase(void); -+ char erasechar(void); -+ void filter(void); -+ int flash(void); -+ int flushinp(void); -- int getbkgd(resource); -+ int getch(void); -- int getmouse(MEVENT *); -- int getnstr(string,int); -- int getstr(string); -+ int halfdelay(int); -+ bool has_colors(void); -+ bool has_ic(void); -+ bool has_il(void); -+ int has_key(int); /* do we have given key? */ -+ int hline(int,int); -- void idcok(resource,bool); -- int idlok(resource,bool); -- void immedok(resource,bool); -+ int inch(void); --ma int inchnstr(int *,int); -- int inchstr(int *); -+ int init_color(int,int,int,int); -+ int init_pair(int,int,int); -- int innstr(string,int); -+ int insch(int); -+ int insdelln(int); -+ int insertln(void); -- int insnstr(string,int); -+ int insstr(string); -+ int instr(string); -- int intrflush(resource,bool); -- bool is_linetouched(resource,int); -- bool is_wintouched(resource); -+ bool isendwin(void); -- int keyok (int,bool); -- int keypad(resource,bool); -+ char killchar(void); -- int leaveok(resource,bool); -- int mcprint(string,int); /* direct data to printer */ -- int meta(resource,bool); -+ int mouseinterval(int); -- mmask_t mousemask(mmask_t,mmask_t *); -+ int move(int,int); -+ int mvaddch(int,int,int); -+ int mvaddchnstr(int,int,int *,int); -+ int mvaddchstr(int,int,int *); -+ int mvaddnstr(int,int,string,int); -+ int mvaddstr(int,int,string); -- int mvchgat(int,int,int,int,int,void *); -+ int mvcur(int,int,int,int); -+ int mvdelch(int,int); -- int mvderwin(resource,int,int); -+ int mvgetch(int,int); -- int mvgetnstr(int,int,string,int); -- int mvgetstr(int,int,string); -+ int mvhline(int,int,int,int); -+ int mvinch(int,int); -- int mvinchnstr(int,int,int *,int); -- int mvinchstr(int,int,int *); -- int mvinnstr(int,int,string,int); -- int mvinsch(int,int,int); -- int mvinsnstr(int,int,string,int); -- int mvinsstr(int,int,string); -- int mvinstr(int,int,string); -- int mvprintw(int,int, string,...); -- int mvscanw(int,int, string,...); -- int mvwaddch(resource,int,int,int); -- int mvwaddchnstr(resource,int,int,int *,int); -- int mvwaddchstr(resource,int,int,int *); -- int mvwaddnstr(resource,int,int,string,int); -- int mvwaddstr(resource,int,int,string); -- int mvwchgat(resource,int,int,int,int,int,void *); -- int mvwdelch(resource,int,int); -- int mvwgetch(resource,int,int); -- int mvwgetnstr(resource,int,int,string,int); -- int mvwgetstr(resource,int,int,string); -- int mvwhline(resource,int,int,int,int); -- int mvwin(resource,int,int); -- int mvwinch(resource,int,int); -- int mvwinchstr(resource,int,int,int *); -- int mvwinnstr(resource,int,int,string,int); -- int mvwinsch(resource,int,int,int); -- int mvwinsnstr(resource,int,int,string,int); -- int mvwinsstr(resource,int,int,string); -- int mvwinstr(resource,int,int,string); -- int mvwinchnstr(resource,int,int,int *,int); -- int mvwprintw(resource,int,int, string,...); -- int mvwscanw(resource,int,int, string,...); -- int mvwvline(resource,int,int,int,int); -+ int napms(int); -+ int nl(void); -+ int nocbreak(void); -- int nodelay(resource,bool); -+ int noecho(void); -+ int nonl(void); -+ void noqiflush(void); -+ int noraw(void); -- int notimeout(resource,bool); -- int overlay(resource,resource); -- int overwrite(resource,resource); -- int pair_content(int,int*,int*); -- int pechochar(resource,int); -- int pnoutrefresh(resource,int,int,int,int,int,int); -- int prefresh(resource,int,int,int,int,int,int); -- int printw( string,...); -+ int putp(string); -- int putwin(resource,FILE *); -+ void qiflush(void); -+ int raw(void); -- int redrawwin(resource); -+ int refresh(void); -- int reset_prog_mode(void); -- int reset_shell_mode(void); -+ int resetty(void); -- int resizeterm (int,int); -- int ripoffline(int,int (*init)(resource,int)); -+ int savetty(void); -- int scanw( string,...); -+ int scr_dump(string); -+ int scr_init(string); -+ int scr_restore(string); -+ int scr_set(string); -+ int scrl(int); -- int scroll(resource); -- int scrollok(resource,bool); -- int setscrreg(int,int); -+ int slk_attroff(int); -- int slk_attr_off(int,void *); /* generated:WIDEC */ -+ int slk_attron(int); -- int slk_attr_on(int,void*); /* generated:WIDEC */ -+ int slk_attrset(int); -+ int slk_attr(void); -- int slk_attr_set(int,int,void*); -+ int slk_clear(void); -+ int slk_color(int); -+ int slk_init(int); -+ int slk_noutrefresh(void); -- int slk_refresh(void); -- int slk_restore(void); -- int slk_set(int,string,int); -- int slk_touch(void); -+ int standend(void); -+ int standout(void); -+ int start_color(void); -- int syncok(resource,bool); -+ int termattrs(void); -- int tigetflag( string); -- int tigetnum( string); -+ void timeout(int); -+ int typeahead(int); -+ int ungetch(int); -- int ungetmouse(MEVENT *); -- int untouchwin(resource); -+ int use_default_colors (void); -+ void use_env(bool); -+ int use_extended_names (bool); -+ int vidattr(int); -- int vidputs(int,int (*)(int)); -- int vline(int,int); -- int vw_printw(resource, string,va_list); -- int vw_scanw(resource, string,va_list); -- int vwprintw(resource, string,va_list); -- int vwscanw(resource, string,va_list); -- int waddch(resource,int); -- int waddchnstr(resource,int *const,int); -- int waddchstr(resource,int *); -- int waddnstr(resource,stringconst,int); -- int waddstr(resource,string); -- int wattr_get(resource,int *,int *,void *); -- int wattr_off(resource, int,void *); -- int wattr_on(resource, int,void *); -- int wattr_set(resource,int,int,void *); -- int wattroff(resource,int); -- int wattron(resource,int); -- int wattrset(resource,int); -- int wbkgd(resource,int); -- void wbkgdset(resource,int); -- int wborder(resource,int,int,int,int,int,int,int,int); -- int wchgat(resource,int,int,int,void *); -- int wclear(resource); -- int wclrtobot(resource); -- int wclrtoeol(resource); -- int wcolor_set(resource,int,void*); -- void wcursyncup(resource); -- int wdelch(resource); -- int wdeleteln(resource); -- int wechochar(resource,int); -- bool wenclose(resource,int,int); -- int werase(resource); -- int wgetch(resource); -- int wgetnstr(resource,string,int); -- int wgetstr(resource,string); -- int whline(resource,int,int); -- int winch(resource); -- int winchnstr(resource,int *,int); -- int winchstr(resource,int *); -- int winnstr(resource,string,int); -- int winsch(resource,int); -- int winsdelln(resource,int); -- int winsertln(resource); -- int winsnstr(resource,string,int); -- int winsstr(resource,string); -- int winstr(resource,string); -- bool wmouse_trafo(resource win,int* y,int* x,bool to_screen); -- int wmove(resource,int,int); -- int wnoutrefresh(resource); -- int wprintw(resource, string,...); -- int wredrawln(resource,int,int); -- int wrefresh(resource); -- int wresize (resource,int,int); -- int wscanw(resource,string,...); -- int wscrl(resource,int); -- int wsetscrreg(resource,int,int); -- int wstandend(resource); -- int wstandout(resource); -- void wsyncdown(resource); -- void wsyncup(resource); -- void wtimeout(resource,int); -- int wtouchln(resource,int,int,int); -- int wvline(resource,int,int); diff --git a/ext/ncurses/config.m4 b/ext/ncurses/config.m4 deleted file mode 100644 index 60241039c58c0..0000000000000 --- a/ext/ncurses/config.m4 +++ /dev/null @@ -1,65 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(ncurses, for ncurses support, -[ --with-ncurses[=DIR] Include ncurses support (CLI/CGI only)]) - -if test "$PHP_NCURSES" != "no"; then - - SEARCH_PATH="$PHP_NCURSES /usr/local /usr" - - for dir in $SEARCH_PATH; do - for subdir in include/ncurses include; do - if test -d $dir/$subdir; then - if test -r $dir/$subdir/ncurses.h; then - NCURSES_DIR=$dir - NCURSES_INCDIR=$dir/$subdir - AC_DEFINE(HAVE_NCURSES_H,1,[ ]) - break 2 - elif test -r $dir/$subdir/curses.h; then - NCURSES_DIR=$dir - NCURSES_INCDIR=$dir/$subdir - break 2 - fi - fi - done - done - - if test -z "$NCURSES_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the ncurses distribution) - fi - - # --with-ncurses -> add include path - PHP_ADD_INCLUDE($NCURSES_INCDIR) - - # --with-ncurses -> chech for lib and symbol presence - LIBNAME=ncurses - LIBSYMBOL=initscr - - PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, [ - AC_DEFINE(HAVE_NCURSESLIB,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/$PHP_LIBDIR, NCURSES_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(panel, new_panel, [ - AC_DEFINE(HAVE_NCURSES_PANEL,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_DIR/$PHP_LIBDIR, NCURSES_SHARED_LIBADD) - ], [], [ - -L$NCURSES_DIR/$PHP_LIBDIR -l$LIBNAME -lm - ]) - ], [ - AC_MSG_ERROR(Wrong ncurses lib version or lib not found) - ], [ - -L$NCURSES_DIR/$PHP_LIBDIR -lm - ]) - - AC_CHECK_LIB($LIBNAME, color_set, [AC_DEFINE(HAVE_NCURSES_COLOR_SET, 1, [ ])]) - AC_CHECK_LIB($LIBNAME, slk_color, [AC_DEFINE(HAVE_NCURSES_SLK_COLOR, 1, [ ])]) - AC_CHECK_LIB($LIBNAME, assume_default_colors, [AC_DEFINE(HAVE_NCURSES_ASSUME_DEFAULT_COLORS, 1, [ ])]) - AC_CHECK_LIB($LIBNAME, use_extended_names, [AC_DEFINE(HAVE_NCURSES_USE_EXTENDED_NAMES, 1, [ ])]) - - PHP_NEW_EXTENSION(ncurses, ncurses.c ncurses_fe.c ncurses_functions.c, $ext_shared, cli) - PHP_SUBST(NCURSES_SHARED_LIBADD) - -fi diff --git a/ext/ncurses/example1.php b/ext/ncurses/example1.php deleted file mode 100644 index ca6977d95e99f..0000000000000 --- a/ext/ncurses/example1.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -$n=0; -ncurses_init(); -if(ncurses_has_colors()){ -ncurses_start_color(); - ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK); - ncurses_init_pair(2,NCURSES_COLOR_GREEN,NCURSES_COLOR_BLACK); - ncurses_init_pair(3,NCURSES_COLOR_YELLOW,NCURSES_COLOR_BLACK); - ncurses_init_pair(4,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK); - ncurses_init_pair(5,NCURSES_COLOR_MAGENTA,NCURSES_COLOR_BLACK); - ncurses_init_pair(6,NCURSES_COLOR_CYAN,NCURSES_COLOR_BLACK); - ncurses_init_pair(7,NCURSES_COLOR_WHITE,NCURSES_COLOR_BLACK); -} -while(1){ -for ($x=0; $x<80; $x++) { -for ($y=0; $y<24; $y++) { - $n++; - ncurses_move($y,$x); - ncurses_addch($n+64); - ncurses_color_set($n%8); - ncurses_refresh(); - if($n>26)$n=0; -} -} -ncurses_getch(); -} -?> - diff --git a/ext/ncurses/ncurses.c b/ext/ncurses/ncurses.c deleted file mode 100644 index 1c15162362a75..0000000000000 --- a/ext/ncurses/ncurses.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe <hholzgra@php.net> | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" -#include "ext/standard/info.h" - -ZEND_DECLARE_MODULE_GLOBALS(ncurses) - -/* True global resources - no need for thread safety here */ -int le_ncurses_windows; -#if HAVE_NCURSES_PANEL -int le_ncurses_panels; -#endif - -static void ncurses_destruct_window(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - WINDOW **pwin = (WINDOW **)rsrc->ptr; - - delwin(*pwin); - efree(pwin); -} - -#if HAVE_NCURSES_PANEL -static void ncurses_destruct_panel(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PANEL **ppanel = (PANEL **)rsrc->ptr; - - del_panel(*ppanel); - efree(ppanel); -} -#endif - -/* {{{ ncurses_module_entry - */ -zend_module_entry ncurses_module_entry = { - STANDARD_MODULE_HEADER, - "ncurses", - ncurses_functions, - PHP_MINIT(ncurses), - PHP_MSHUTDOWN(ncurses), - NULL, - NULL, - PHP_MINFO(ncurses), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_NCURSES -ZEND_GET_MODULE(ncurses) -#endif - -#define PHP_NCURSES_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_"#x, x, CONST_CS | CONST_PERSISTENT) -#define PHP_NCURSES_FKEY_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_KEY_F"#x, KEY_F0 + x, CONST_CS | CONST_PERSISTENT) - -static void php_ncurses_init_globals(zend_ncurses_globals *ncurses_globals) -{ - memset(ncurses_globals, 0, sizeof(*ncurses_globals)); -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(ncurses) -{ - /* color constants */ - PHP_NCURSES_CONST(COLOR_BLACK); - PHP_NCURSES_CONST(COLOR_RED); - PHP_NCURSES_CONST(COLOR_GREEN); - PHP_NCURSES_CONST(COLOR_YELLOW); - PHP_NCURSES_CONST(COLOR_BLUE); - PHP_NCURSES_CONST(COLOR_MAGENTA); - PHP_NCURSES_CONST(COLOR_CYAN); - PHP_NCURSES_CONST(COLOR_WHITE); - - /* keyboard constants */ - PHP_NCURSES_CONST(KEY_DOWN); - PHP_NCURSES_CONST(KEY_UP); - PHP_NCURSES_CONST(KEY_LEFT); - PHP_NCURSES_CONST(KEY_RIGHT); - PHP_NCURSES_CONST(KEY_BACKSPACE); - PHP_NCURSES_CONST(KEY_MOUSE); - PHP_NCURSES_CONST(KEY_F0); - - - /* TODO:this macro sux, we have 65 function key, - so we need a little loop */ - PHP_NCURSES_FKEY_CONST(1); - PHP_NCURSES_FKEY_CONST(2); - PHP_NCURSES_FKEY_CONST(3); - PHP_NCURSES_FKEY_CONST(4); - PHP_NCURSES_FKEY_CONST(5); - PHP_NCURSES_FKEY_CONST(6); - PHP_NCURSES_FKEY_CONST(7); - PHP_NCURSES_FKEY_CONST(8); - PHP_NCURSES_FKEY_CONST(9); - PHP_NCURSES_FKEY_CONST(10); - PHP_NCURSES_FKEY_CONST(11); - PHP_NCURSES_FKEY_CONST(12); - - PHP_NCURSES_CONST(KEY_DL); - PHP_NCURSES_CONST(KEY_IL); - PHP_NCURSES_CONST(KEY_DC); - PHP_NCURSES_CONST(KEY_IC); - PHP_NCURSES_CONST(KEY_EIC); - PHP_NCURSES_CONST(KEY_CLEAR); - PHP_NCURSES_CONST(KEY_EOS); - PHP_NCURSES_CONST(KEY_EOL); - PHP_NCURSES_CONST(KEY_SF); - PHP_NCURSES_CONST(KEY_SR); - PHP_NCURSES_CONST(KEY_NPAGE); - PHP_NCURSES_CONST(KEY_PPAGE); - PHP_NCURSES_CONST(KEY_STAB); - PHP_NCURSES_CONST(KEY_CTAB); - PHP_NCURSES_CONST(KEY_CATAB); - PHP_NCURSES_CONST(KEY_ENTER); - PHP_NCURSES_CONST(KEY_SRESET); - PHP_NCURSES_CONST(KEY_RESET); - PHP_NCURSES_CONST(KEY_PRINT); - PHP_NCURSES_CONST(KEY_LL); - PHP_NCURSES_CONST(KEY_A1); - PHP_NCURSES_CONST(KEY_A3); - PHP_NCURSES_CONST(KEY_B2); - PHP_NCURSES_CONST(KEY_C1); - PHP_NCURSES_CONST(KEY_C3); - PHP_NCURSES_CONST(KEY_BTAB); - PHP_NCURSES_CONST(KEY_BEG); - PHP_NCURSES_CONST(KEY_CANCEL); - PHP_NCURSES_CONST(KEY_CLOSE); - PHP_NCURSES_CONST(KEY_COMMAND); - PHP_NCURSES_CONST(KEY_COPY); - PHP_NCURSES_CONST(KEY_CREATE); - PHP_NCURSES_CONST(KEY_END); - PHP_NCURSES_CONST(KEY_EXIT); - PHP_NCURSES_CONST(KEY_FIND); - PHP_NCURSES_CONST(KEY_HELP); - PHP_NCURSES_CONST(KEY_MARK); - PHP_NCURSES_CONST(KEY_MESSAGE); - PHP_NCURSES_CONST(KEY_MOVE); - PHP_NCURSES_CONST(KEY_NEXT); - PHP_NCURSES_CONST(KEY_OPEN); - PHP_NCURSES_CONST(KEY_OPTIONS); - PHP_NCURSES_CONST(KEY_PREVIOUS); - PHP_NCURSES_CONST(KEY_REDO); - PHP_NCURSES_CONST(KEY_REFERENCE); - PHP_NCURSES_CONST(KEY_REFRESH); - PHP_NCURSES_CONST(KEY_REPLACE); - PHP_NCURSES_CONST(KEY_RESTART); - PHP_NCURSES_CONST(KEY_RESUME); - PHP_NCURSES_CONST(KEY_SAVE); - PHP_NCURSES_CONST(KEY_SBEG); - PHP_NCURSES_CONST(KEY_SCANCEL); - PHP_NCURSES_CONST(KEY_SCOMMAND); - PHP_NCURSES_CONST(KEY_SCOPY); - PHP_NCURSES_CONST(KEY_SCREATE); - PHP_NCURSES_CONST(KEY_SDC); - PHP_NCURSES_CONST(KEY_SDL); - PHP_NCURSES_CONST(KEY_SELECT); - PHP_NCURSES_CONST(KEY_SEND); - PHP_NCURSES_CONST(KEY_SEOL); - PHP_NCURSES_CONST(KEY_SEXIT); - PHP_NCURSES_CONST(KEY_SFIND); - PHP_NCURSES_CONST(KEY_SHELP); - PHP_NCURSES_CONST(KEY_SHOME); - PHP_NCURSES_CONST(KEY_SIC); - PHP_NCURSES_CONST(KEY_SLEFT); - PHP_NCURSES_CONST(KEY_SMESSAGE); - PHP_NCURSES_CONST(KEY_SMOVE); - PHP_NCURSES_CONST(KEY_SNEXT); - PHP_NCURSES_CONST(KEY_SOPTIONS); - PHP_NCURSES_CONST(KEY_SPREVIOUS); - PHP_NCURSES_CONST(KEY_SPRINT); - PHP_NCURSES_CONST(KEY_SREDO); - PHP_NCURSES_CONST(KEY_SREPLACE); - PHP_NCURSES_CONST(KEY_SRIGHT); - PHP_NCURSES_CONST(KEY_SRSUME); - PHP_NCURSES_CONST(KEY_SSAVE); - PHP_NCURSES_CONST(KEY_SSUSPEND); - PHP_NCURSES_CONST(KEY_SUNDO); - PHP_NCURSES_CONST(KEY_SUSPEND); - PHP_NCURSES_CONST(KEY_UNDO); - PHP_NCURSES_CONST(KEY_RESIZE); - - /* screen attribute constants */ - PHP_NCURSES_CONST(A_NORMAL); - PHP_NCURSES_CONST(A_STANDOUT); - PHP_NCURSES_CONST(A_UNDERLINE); - PHP_NCURSES_CONST(A_REVERSE); - PHP_NCURSES_CONST(A_BLINK); - PHP_NCURSES_CONST(A_DIM); - PHP_NCURSES_CONST(A_BOLD); - PHP_NCURSES_CONST(A_PROTECT); - PHP_NCURSES_CONST(A_INVIS); - PHP_NCURSES_CONST(A_ALTCHARSET); - PHP_NCURSES_CONST(A_CHARTEXT); - - /* mouse constants */ - PHP_NCURSES_CONST(BUTTON1_PRESSED); - PHP_NCURSES_CONST(BUTTON1_RELEASED); - PHP_NCURSES_CONST(BUTTON1_CLICKED); - PHP_NCURSES_CONST(BUTTON1_DOUBLE_CLICKED); - PHP_NCURSES_CONST(BUTTON1_TRIPLE_CLICKED); - PHP_NCURSES_CONST(BUTTON2_PRESSED); - PHP_NCURSES_CONST(BUTTON2_RELEASED); - PHP_NCURSES_CONST(BUTTON2_CLICKED); - PHP_NCURSES_CONST(BUTTON2_DOUBLE_CLICKED); - PHP_NCURSES_CONST(BUTTON2_TRIPLE_CLICKED); - PHP_NCURSES_CONST(BUTTON3_PRESSED); - PHP_NCURSES_CONST(BUTTON3_RELEASED); - PHP_NCURSES_CONST(BUTTON3_CLICKED); - PHP_NCURSES_CONST(BUTTON3_DOUBLE_CLICKED); - PHP_NCURSES_CONST(BUTTON3_TRIPLE_CLICKED); - PHP_NCURSES_CONST(BUTTON4_PRESSED); - PHP_NCURSES_CONST(BUTTON4_RELEASED); - PHP_NCURSES_CONST(BUTTON4_CLICKED); - PHP_NCURSES_CONST(BUTTON4_DOUBLE_CLICKED); - PHP_NCURSES_CONST(BUTTON4_TRIPLE_CLICKED); - PHP_NCURSES_CONST(BUTTON_SHIFT); - PHP_NCURSES_CONST(BUTTON_CTRL); - PHP_NCURSES_CONST(BUTTON_ALT); - PHP_NCURSES_CONST(ALL_MOUSE_EVENTS); - PHP_NCURSES_CONST(REPORT_MOUSE_POSITION); - - ZEND_INIT_MODULE_GLOBALS(ncurses, php_ncurses_init_globals, NULL); - - le_ncurses_windows = zend_register_list_destructors_ex(ncurses_destruct_window, NULL, "ncurses_window", module_number); -#if HAVE_NCURSES_PANEL - le_ncurses_panels = zend_register_list_destructors_ex(ncurses_destruct_panel, NULL, "ncurses_panel", module_number); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(ncurses) -{ - if (NCURSES_G(registered_constants)) { - endwin(); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(ncurses) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "ncurses support", "enabled"); - php_info_print_table_row(2, "ncurses library version", NCURSES_VERSION); -#ifdef HAVE_NCURSES_COLOR_SET - php_info_print_table_row(2, "color support", "yes"); -#else - php_info_print_table_row(2, "color support", "no"); -#endif - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -/* Remove the following function when you have succesfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ncurses/ncurses.php b/ext/ncurses/ncurses.php deleted file mode 100644 index 416b1087e7062..0000000000000 --- a/ext/ncurses/ncurses.php +++ /dev/null @@ -1,10 +0,0 @@ -<? -$module = 'ncurses'; -$function = 'confirm_' . $module . '_compiled'; -if (extension_loaded($module)) { - $str = $function($module); -} else { - $str = "Module $module is not compiled into PHP"; -} -echo "$str\n"; -?> diff --git a/ext/ncurses/ncurses_fe.c b/ext/ncurses/ncurses_fe.c deleted file mode 100644 index 59f0a8b0e1db6..0000000000000 --- a/ext/ncurses/ncurses_fe.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe <hholzgra@php.net> | - | Georg Richter <georg.richter@php-ev.de> | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" - -static - ZEND_BEGIN_ARG_INFO(firstandsecond_args_force_ref, 0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(secondandthird_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(second_thru_fourth_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -/* ncurses_functions[] - * - * Every user visible function must have an entry in ncurses_functions[]. - */ -function_entry ncurses_functions[] = { - PHP_FE(ncurses_addch, NULL) -#ifdef HAVE_NCURSES_COLOR_SET - PHP_FE(ncurses_color_set, NULL) -#endif - PHP_FE(ncurses_delwin, NULL) - PHP_FE(ncurses_end, NULL) - PHP_FE(ncurses_getch, NULL) - PHP_FE(ncurses_has_colors, NULL) - PHP_FE(ncurses_init, NULL) - PHP_FE(ncurses_init_pair, NULL) - PHP_FE(ncurses_color_content, second_thru_fourth_args_force_ref) - PHP_FE(ncurses_pair_content, secondandthird_args_force_ref) - PHP_FE(ncurses_move, NULL) - PHP_FE(ncurses_newwin, NULL) - PHP_FE(ncurses_refresh, NULL) - PHP_FE(ncurses_start_color, NULL) - PHP_FE(ncurses_standout, NULL) - PHP_FE(ncurses_standend, NULL) - PHP_FE(ncurses_baudrate, NULL) - PHP_FE(ncurses_beep, NULL) - PHP_FE(ncurses_can_change_color, NULL) - PHP_FE(ncurses_cbreak, NULL) - PHP_FE(ncurses_clear, NULL) - PHP_FE(ncurses_clrtobot, NULL) - PHP_FE(ncurses_clrtoeol, NULL) - PHP_FE(ncurses_def_prog_mode, NULL) - PHP_FE(ncurses_reset_prog_mode, NULL) - PHP_FE(ncurses_def_shell_mode, NULL) - PHP_FE(ncurses_reset_shell_mode, NULL) - PHP_FE(ncurses_delch, NULL) - PHP_FE(ncurses_deleteln, NULL) - PHP_FE(ncurses_doupdate, NULL) - PHP_FE(ncurses_echo, NULL) - PHP_FE(ncurses_erase, NULL) - PHP_FE(ncurses_werase, NULL) - PHP_FE(ncurses_erasechar, NULL) - PHP_FE(ncurses_flash, NULL) - PHP_FE(ncurses_flushinp, NULL) - PHP_FE(ncurses_has_ic, NULL) - PHP_FE(ncurses_has_il, NULL) - PHP_FE(ncurses_inch, NULL) - PHP_FE(ncurses_insertln, NULL) - PHP_FE(ncurses_isendwin, NULL) - PHP_FE(ncurses_killchar, NULL) - PHP_FE(ncurses_nl, NULL) - PHP_FE(ncurses_nocbreak, NULL) - PHP_FE(ncurses_noecho, NULL) - PHP_FE(ncurses_nonl, NULL) - PHP_FE(ncurses_noraw, NULL) - PHP_FE(ncurses_raw, NULL) - PHP_FE(ncurses_meta, NULL) - PHP_FE(ncurses_resetty, NULL) - PHP_FE(ncurses_savetty, NULL) - PHP_FE(ncurses_termattrs, NULL) - PHP_FE(ncurses_use_default_colors, NULL) - PHP_FE(ncurses_slk_attr, NULL) - PHP_FE(ncurses_slk_clear, NULL) - PHP_FE(ncurses_slk_noutrefresh, NULL) - PHP_FE(ncurses_slk_refresh, NULL) - PHP_FE(ncurses_slk_restore, NULL) - PHP_FE(ncurses_slk_touch, NULL) - PHP_FE(ncurses_attroff, NULL) - PHP_FE(ncurses_attron, NULL) - PHP_FE(ncurses_attrset, NULL) - PHP_FE(ncurses_bkgd, NULL) - PHP_FE(ncurses_curs_set, NULL) - PHP_FE(ncurses_delay_output, NULL) - PHP_FE(ncurses_echochar, NULL) - PHP_FE(ncurses_halfdelay, NULL) - PHP_FE(ncurses_has_key, NULL) - PHP_FE(ncurses_insch, NULL) - PHP_FE(ncurses_insdelln, NULL) - PHP_FE(ncurses_mouseinterval, NULL) - PHP_FE(ncurses_napms, NULL) - PHP_FE(ncurses_scrl, NULL) - PHP_FE(ncurses_slk_attroff, NULL) - PHP_FE(ncurses_slk_attron, NULL) - PHP_FE(ncurses_slk_attrset, NULL) -#ifdef HAVE_NCURSES_SLK_COLOR - PHP_FE(ncurses_slk_color, NULL) -#endif - PHP_FE(ncurses_slk_init, NULL) - PHP_FE(ncurses_slk_set, NULL) - PHP_FE(ncurses_typeahead, NULL) - PHP_FE(ncurses_ungetch, NULL) - PHP_FE(ncurses_vidattr, NULL) - PHP_FE(ncurses_wrefresh, NULL) -#ifdef HAVE_NCURSES_USE_EXTENDED_NAMES - PHP_FE(ncurses_use_extended_names, NULL) -#endif - PHP_FE(ncurses_bkgdset, NULL) - PHP_FE(ncurses_filter, NULL) - PHP_FE(ncurses_noqiflush, NULL) - PHP_FE(ncurses_qiflush, NULL) - PHP_FE(ncurses_timeout, NULL) - PHP_FE(ncurses_use_env, NULL) - PHP_FE(ncurses_addstr, NULL) - PHP_FE(ncurses_putp, NULL) - PHP_FE(ncurses_scr_dump, NULL) - PHP_FE(ncurses_scr_init, NULL) - PHP_FE(ncurses_scr_restore, NULL) - PHP_FE(ncurses_scr_set, NULL) - PHP_FE(ncurses_mvaddch, NULL) - PHP_FE(ncurses_mvaddchnstr, NULL) - PHP_FE(ncurses_addchnstr, NULL) - PHP_FE(ncurses_mvaddchstr, NULL) - PHP_FE(ncurses_addchstr, NULL) - PHP_FE(ncurses_mvaddnstr, NULL) - PHP_FE(ncurses_addnstr, NULL) - PHP_FE(ncurses_mvaddstr, NULL) - PHP_FE(ncurses_mvdelch, NULL) - PHP_FE(ncurses_mvgetch, NULL) - PHP_FE(ncurses_mvinch, NULL) - PHP_FE(ncurses_mvwaddstr, NULL) - PHP_FE(ncurses_insstr, NULL) - PHP_FE(ncurses_instr, first_arg_force_ref) - PHP_FE(ncurses_mvhline, NULL) - PHP_FE(ncurses_mvcur, NULL) - PHP_FE(ncurses_init_color, NULL) - PHP_FE(ncurses_border, NULL) -#ifdef HAVE_NCURSES_ASSUME_DEFAULT_COLORS - PHP_FE(ncurses_assume_default_colors, NULL) -#endif - PHP_FE(ncurses_define_key, NULL) - PHP_FE(ncurses_hline, NULL) - PHP_FE(ncurses_vline, NULL) - PHP_FE(ncurses_keyok, NULL) - PHP_FE(ncurses_termname, NULL) - PHP_FE(ncurses_longname, NULL) - PHP_FE(ncurses_mousemask, second_arg_force_ref) - PHP_FE(ncurses_getmouse, first_arg_force_ref) - PHP_FE(ncurses_ungetmouse, NULL) - PHP_FE(ncurses_mouse_trafo, firstandsecond_args_force_ref) - PHP_FE(ncurses_wmouse_trafo, secondandthird_args_force_ref) - PHP_FE(ncurses_waddstr, NULL) - PHP_FE(ncurses_wnoutrefresh, NULL) - PHP_FE(ncurses_wclear, NULL) -#ifdef HAVE_NCURSES_COLOR_SET - PHP_FE(ncurses_wcolor_set, NULL) -#endif - PHP_FE(ncurses_wgetch, NULL) - PHP_FE(ncurses_keypad, NULL) - PHP_FE(ncurses_wmove, NULL) - - PHP_FE(ncurses_newpad, NULL) - PHP_FE(ncurses_prefresh, NULL) - PHP_FE(ncurses_pnoutrefresh, NULL) - PHP_FE(ncurses_wstandout, NULL) - PHP_FE(ncurses_wstandend, NULL) - PHP_FE(ncurses_wattrset, NULL) - PHP_FE(ncurses_wattron, NULL) - PHP_FE(ncurses_wattroff, NULL) - PHP_FE(ncurses_waddch, NULL) - PHP_FE(ncurses_wborder, NULL) - PHP_FE(ncurses_whline, NULL) - PHP_FE(ncurses_wvline, NULL) - PHP_FE(ncurses_getyx, secondandthird_args_force_ref) - PHP_FE(ncurses_getmaxyx, secondandthird_args_force_ref) - -#if HAVE_NCURSES_PANEL - PHP_FE(ncurses_update_panels, NULL) - PHP_FE(ncurses_panel_window, NULL) - PHP_FE(ncurses_panel_below, NULL) - PHP_FE(ncurses_panel_above, NULL) - PHP_FE(ncurses_replace_panel, NULL) - PHP_FE(ncurses_move_panel, NULL) - PHP_FE(ncurses_bottom_panel, NULL) - PHP_FE(ncurses_top_panel, NULL) - PHP_FE(ncurses_show_panel, NULL) - PHP_FE(ncurses_hide_panel, NULL) - PHP_FE(ncurses_del_panel, NULL) - PHP_FE(ncurses_new_panel, NULL) -#endif - - {NULL, NULL, NULL} /* Must be the last line in ncurses_functions[] */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c deleted file mode 100644 index 096c9b7c574e3..0000000000000 --- a/ext/ncurses/ncurses_functions.c +++ /dev/null @@ -1,2459 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe <hholzgra@php.net> | - | Georg Richter <georg.richter@php-ev.de> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" - -#define FETCH_WINRES(r, z) ZEND_FETCH_RESOURCE(r, WINDOW **, z, -1, "ncurses_window", le_ncurses_windows) -#if HAVE_NCURSES_PANEL -# define FETCH_PANEL(r, z) ZEND_FETCH_RESOURCE(r, PANEL **, z, -1, "ncurses_panel", le_ncurses_panels) -#endif - -#define IS_NCURSES_INITIALIZED() \ - if (!NCURSES_G(registered_constants)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must initialize ncruses via ncurses_init(), before calling any ncurses functions."); \ - RETURN_FALSE; \ - } - -/* {{{ proto int ncurses_addch(int ch) - Adds character at current position and advance cursor */ -PHP_FUNCTION(ncurses_addch) -{ - long ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ch) == FAILURE) { - return; - } - - IS_NCURSES_INITIALIZED(); - RETURN_LONG(addch(ch)); -} -/* }}} */ - -/* {{{ proto int ncurses_waddch(resource window, int ch) - Adds character at current position in a window and advance cursor */ -PHP_FUNCTION(ncurses_waddch) -{ - long ch; - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &ch) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(waddch(*win, ch)); -} -/* }}} */ - -#ifdef HAVE_NCURSES_COLOR_SET -/* {{{ proto int ncurses_color_set(int pair) - Sets fore- and background color */ -PHP_FUNCTION(ncurses_color_set) -{ - long pair; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pair) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(color_set(pair,NULL)); -} -/* }}} */ -#endif - -/* {{{ proto bool ncurses_delwin(resource window) - Deletes a ncurses window */ -PHP_FUNCTION(ncurses_delwin) -{ - zval *handle; - WINDOW **w; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(w, &handle); - - zend_list_delete(Z_LVAL_P(handle)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ncurses_end(void) - Stops using ncurses, clean up the screen */ -PHP_FUNCTION(ncurses_end) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(endwin()); /* endialize the curses library */ -} -/* }}} */ - -/* {{{ proto int ncurses_getch(void) - Reads a character from keyboard */ -PHP_FUNCTION(ncurses_getch) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(getch()); -} -/* }}} */ - -/* {{{ proto bool ncurses_has_colors(void) - Checks if terminal has colors */ -PHP_FUNCTION(ncurses_has_colors) -{ - IS_NCURSES_INITIALIZED(); - RETURN_BOOL(has_colors()); -} -/* }}} */ - -/* {{{ proto int ncurses_init(void) - Initializes ncurses */ -PHP_FUNCTION(ncurses_init) -{ - initscr(); /* initialize the curses library */ - keypad(stdscr, TRUE); /* enable keyboard mapping */ - (void) nonl(); /* tell curses not to do NL->CR/NL on output */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - - if (!NCURSES_G(registered_constants)) { - zend_constant c; - - WINDOW **pscr = (WINDOW**)emalloc(sizeof(WINDOW *)); - zval *zscr; - - *pscr = stdscr; - MAKE_STD_ZVAL(zscr); - ZEND_REGISTER_RESOURCE(zscr, pscr, le_ncurses_windows); - c.value = *zscr; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(ZEND_STRL("STDSCR")); - c.name_len = sizeof("STDSCR"); - zend_register_constant(&c TSRMLS_CC); - - /* we need this "interesting" arrangement because the - * underlying values of the ACS_XXX defines are not - * initialized until after ncurses has been initialized */ - -#define PHP_NCURSES_DEF_CONST(x) \ - ZVAL_LONG(zscr, x); \ - c.value = *zscr; \ - zval_copy_ctor(&c.value); \ - c.flags = CONST_CS; \ - c.name = zend_strndup(ZEND_STRL("NCURSES_" #x)); \ - c.name_len = sizeof("NCURSES_" #x); \ - zend_register_constant(&c TSRMLS_CC) - - PHP_NCURSES_DEF_CONST(ACS_ULCORNER); - PHP_NCURSES_DEF_CONST(ACS_LLCORNER); - PHP_NCURSES_DEF_CONST(ACS_URCORNER); - PHP_NCURSES_DEF_CONST(ACS_LRCORNER); - PHP_NCURSES_DEF_CONST(ACS_LTEE); - PHP_NCURSES_DEF_CONST(ACS_RTEE); - PHP_NCURSES_DEF_CONST(ACS_BTEE); - PHP_NCURSES_DEF_CONST(ACS_TTEE); - PHP_NCURSES_DEF_CONST(ACS_HLINE); - PHP_NCURSES_DEF_CONST(ACS_VLINE); - PHP_NCURSES_DEF_CONST(ACS_PLUS); - PHP_NCURSES_DEF_CONST(ACS_S1); - PHP_NCURSES_DEF_CONST(ACS_S9); - PHP_NCURSES_DEF_CONST(ACS_DIAMOND); - PHP_NCURSES_DEF_CONST(ACS_CKBOARD); - PHP_NCURSES_DEF_CONST(ACS_DEGREE); - PHP_NCURSES_DEF_CONST(ACS_PLMINUS); - PHP_NCURSES_DEF_CONST(ACS_BULLET); - PHP_NCURSES_DEF_CONST(ACS_LARROW); - PHP_NCURSES_DEF_CONST(ACS_RARROW); - PHP_NCURSES_DEF_CONST(ACS_DARROW); - PHP_NCURSES_DEF_CONST(ACS_UARROW); - PHP_NCURSES_DEF_CONST(ACS_BOARD); - PHP_NCURSES_DEF_CONST(ACS_LANTERN); - PHP_NCURSES_DEF_CONST(ACS_BLOCK); - - FREE_ZVAL(zscr); - NCURSES_G(registered_constants) = 1; - } -} -/* }}} */ - -/* {{{ proto int ncurses_init_pair(int pair, int fg, int bg) - Allocates a color pair */ -PHP_FUNCTION(ncurses_init_pair) -{ - long pair, fg, bg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &pair, &fg, &bg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(init_pair(pair,fg,bg)); -} -/* }}} */ - -/* {{{ proto int ncurses_move(int y, int x) - Moves output position */ -PHP_FUNCTION(ncurses_move) -{ - long x, y; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &y, &x) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(move(y,x)); -} -/* }}} */ - -/* {{{ proto resource ncurses_newpad(int rows, int cols) - Creates a new pad (window) */ -PHP_FUNCTION(ncurses_newpad) -{ - long rows,cols; - WINDOW **pwin; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &rows, &cols) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - pwin = (WINDOW **)emalloc(sizeof(WINDOW *)); - *pwin = newpad(rows,cols); - - if(!*pwin) { - efree(pwin); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, pwin, le_ncurses_windows); - -} -/* }}} */ - -/* {{{ proto int ncurses_prefresh(resource pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol) - Copys a region from a pad into the virtual screen */ -PHP_FUNCTION(ncurses_prefresh) -{ - WINDOW **pwin; - zval *phandle; - long pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllll", &phandle, &pminrow, - &pmincol, &sminrow, &smincol, &smaxrow, &smaxcol) == FAILURE) { - return; - } - - FETCH_WINRES(pwin, &phandle); - - RETURN_LONG(prefresh(*pwin, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); -} -/* }}} */ - -/* {{{ proto int ncurses_pnoutrefresh(resource pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol) - Copys a region from a pad into the virtual screen */ -PHP_FUNCTION(ncurses_pnoutrefresh) -{ - WINDOW **pwin; - zval *phandle; - long pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllll", &phandle, &pminrow, - &pmincol, &sminrow, &smincol, &smaxrow, &smaxcol) == FAILURE) { - return; - } - - FETCH_WINRES(pwin, &phandle); - - RETURN_LONG(pnoutrefresh(*pwin, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); -} -/* }}} */ - - - -/* {{{ proto int ncurses_newwin(int rows, int cols, int y, int x) - Creates a new window */ -PHP_FUNCTION(ncurses_newwin) -{ - long rows,cols,y,x; - WINDOW **pwin; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &rows, &cols, &y, &x) == FAILURE) { - return; - } - - IS_NCURSES_INITIALIZED(); - pwin = (WINDOW **)emalloc(sizeof(WINDOW *)); - *pwin=newwin(rows,cols,y,x); - - if(!*pwin) { - efree(pwin); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, pwin, le_ncurses_windows); -} -/* }}} */ - -/* {{{ proto int ncurses_refresh(int ch) - Refresh screen */ -PHP_FUNCTION(ncurses_refresh) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(refresh()); -} -/* }}} */ - -/* {{{ proto int ncurses_start_color(void) - Starts using colors */ -PHP_FUNCTION(ncurses_start_color) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(start_color()); -} -/* }}} */ - -/* {{{ proto int ncurses_standout(void) - Starts using 'standout' attribute */ -PHP_FUNCTION(ncurses_standout) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(standout()); -} -/* }}} */ - -/* {{{ proto int ncurses_standend(void) - Stops using 'standout' attribute */ -PHP_FUNCTION(ncurses_standend) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(standend()); -} -/* }}} */ - -/* {{{ proto int ncurses_baudrate(void) - Returns baudrate of terminal */ -PHP_FUNCTION(ncurses_baudrate) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(baudrate()); -} -/* }}} */ - -/* {{{ proto int ncurses_beep(void) - Let the terminal beep */ -PHP_FUNCTION(ncurses_beep) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(beep()); -} -/* }}} */ - -/* {{{ proto bool ncurses_can_change_color(void) - Checks if we can change terminals colors */ -PHP_FUNCTION(ncurses_can_change_color) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(can_change_color()); -} -/* }}} */ - -/* {{{ proto bool ncurses_cbreak(void) - Switches of input buffering */ -PHP_FUNCTION(ncurses_cbreak) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(cbreak()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clear(void) - Clears screen */ -PHP_FUNCTION(ncurses_clear) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(clear()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clrtobot(void) - Clears screen from current position to bottom */ -PHP_FUNCTION(ncurses_clrtobot) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(clrtobot()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clrtoeol(void) - Clears screen from current position to end of line */ -PHP_FUNCTION(ncurses_clrtoeol) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(clrtoeol()); -} -/* }}} */ - -/* {{{ proto int ncurses_reset_prog_mode(void) - Resets the prog mode saved by def_prog_mode */ -PHP_FUNCTION(ncurses_reset_prog_mode) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(reset_prog_mode()); -} -/* }}} */ - -/* {{{ proto int ncurses_reset_shell_mode(void) - Resets the shell mode saved by def_shell_mode */ -PHP_FUNCTION(ncurses_reset_shell_mode) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(reset_shell_mode()); -} -/* }}} */ - -/* {{{ proto int ncurses_def_prog_mode(void) - Saves terminals (program) mode */ -PHP_FUNCTION(ncurses_def_prog_mode) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(def_prog_mode()); -} -/* }}} */ - -/* {{{ proto int ncurses_def_shell_mode(void) - Saves terminal (shell) mode*/ -PHP_FUNCTION(ncurses_def_shell_mode) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(def_shell_mode()); -} -/* }}} */ - -/* {{{ proto int ncurses_delch(void) - Deletes character at current position, move rest of line left */ -PHP_FUNCTION(ncurses_delch) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(delch()); -} -/* }}} */ - -/* {{{ proto int ncurses_deleteln(void) - Deletes line at current position, move rest of screen up */ -PHP_FUNCTION(ncurses_deleteln) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(deleteln()); -} -/* }}} */ - -/* {{{ proto int ncurses_doupdate(void) - Writes all prepared refreshes to terminal */ -PHP_FUNCTION(ncurses_doupdate) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(doupdate()); -} -/* }}} */ - -/* {{{ proto int ncurses_echo(void) - Activates keyboard input echo */ -PHP_FUNCTION(ncurses_echo) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(echo()); -} -/* }}} */ - -/* {{{ proto int ncurses_erase(void) - Erases terminal screen */ -PHP_FUNCTION(ncurses_erase) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(erase()); -} -/* }}} */ - -/* {{{ proto string ncurses_erasechar(void) - Returns current erase character */ -PHP_FUNCTION(ncurses_erasechar) -{ - char temp[2]; - - IS_NCURSES_INITIALIZED(); - temp[0] = erasechar(); - temp[1] = '\0'; - - RETURN_STRINGL (temp, 1, 1); -} -/* }}} */ - -/* {{{ proto int ncurses_flash(void) - Flashes terminal screen (visual bell) */ -PHP_FUNCTION(ncurses_flash) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(flash()); -} -/* }}} */ - -/* {{{ proto int ncurses_flushinp(void) - Flushes keyboard input buffer */ -PHP_FUNCTION(ncurses_flushinp) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(flushinp()); -} -/* }}} */ - -/* {{{ proto int ncurses_has_ic(void) - Checks for insert- and delete-capabilities */ -PHP_FUNCTION(ncurses_has_ic) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(has_ic()); -} -/* }}} */ - - -/* {{{ proto int ncurses_has_il(void) - Checks for line insert- and delete-capabilities */ -PHP_FUNCTION(ncurses_has_il) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(has_il()); -} -/* }}} */ - -/* {{{ proto string ncurses_inch(void) - Gets character and attribute at current position */ -PHP_FUNCTION(ncurses_inch) -{ - char temp[2]; - - IS_NCURSES_INITIALIZED(); - temp[0] = inch(); - temp[1] = '\0'; - - RETURN_STRINGL (temp, 1, 1); -} -/* }}} */ - -/* {{{ proto int ncurses_insertln(void) - Inserts a line, move rest of screen down */ -PHP_FUNCTION(ncurses_insertln) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(insertln()); -} -/* }}} */ - -/* {{{ proto int ncurses_isendwin(void) - Ncurses is in endwin mode, normal screen output may be performed */ -PHP_FUNCTION(ncurses_isendwin) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(isendwin()); -} -/* }}} */ - -/* {{{ proto string ncurses_killchar(void) - Returns current line kill character */ -PHP_FUNCTION(ncurses_killchar) -{ - char temp[2]; - - IS_NCURSES_INITIALIZED(); - temp[0] = killchar(); - temp[1] = '\0'; - - RETURN_STRINGL (temp, 1, 1); -} -/* }}} */ - -/* {{{ proto int ncurses_nl(void) - Translates newline and carriage return / line feed */ -PHP_FUNCTION(ncurses_nl) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(nl()); -} -/* }}} */ - -/* {{{ proto int ncurses_nocbreak(void) - Switches terminal to cooked mode */ -PHP_FUNCTION(ncurses_nocbreak) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(nocbreak()); -} -/* }}} */ - -/* {{{ proto int ncurses_noecho(void) - Switches off keyboard input echo */ -PHP_FUNCTION(ncurses_noecho) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(noecho()); -} -/* }}} */ - -/* {{{ proto int ncurses_nonl(void) - Do not ranslate newline and carriage return / line feed */ -PHP_FUNCTION(ncurses_nonl) -{ - RETURN_LONG(nonl()); -} -/* }}} */ - -/* {{{ proto bool ncurses_noraw(void) - Switches terminal out of raw mode */ -PHP_FUNCTION(ncurses_noraw) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(noraw()); -} -/* }}} */ - -/* {{{ proto int ncurses_raw(void) - Switches terminal into raw mode */ -PHP_FUNCTION(ncurses_raw) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(raw()); -} -/* }}} */ - -/* {{{ proto int ncurses_meta(resource window, bool 8bit) - Enables/Disable 8-bit meta key information */ -PHP_FUNCTION(ncurses_meta) -{ - zend_bool enable; - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &handle, &enable) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(meta(*win, enable)); -} -/* }}} */ - -/* {{{ proto int ncurses_werase(resource window) - Erase window contents */ -PHP_FUNCTION(ncurses_werase) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(werase(*win)); -} -/* }}} */ - - -/* {{{ proto int ncurses_resetty(void) - Restores saved terminal state */ -PHP_FUNCTION(ncurses_resetty) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(resetty()); -} -/* }}} */ - -/* {{{ proto int ncurses_savetty(void) - Saves terminal state */ -PHP_FUNCTION(ncurses_savetty) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(savetty()); -} -/* }}} */ - -/* {{{ proto int ncurses_termattrs(void) - Returns a logical OR of all attribute flags supported by terminal */ -PHP_FUNCTION(ncurses_termattrs) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(termattrs()); -} -/* }}} */ - -/* {{{ proto int ncurses_use_default_colors(void) - Assigns terminal default colors to color id -1 */ -PHP_FUNCTION(ncurses_use_default_colors) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(use_default_colors()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attr(void) - Returns current soft label keys attribute */ -PHP_FUNCTION(ncurses_slk_attr) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_attr()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_clear(void) - Clears soft label keys from screen */ -PHP_FUNCTION(ncurses_slk_clear) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_clear()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_noutrefresh(void) - Copies soft label keys to virtual screen */ -PHP_FUNCTION(ncurses_slk_noutrefresh) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_noutrefresh()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_refresh(void) - Copies soft label keys to screen */ -PHP_FUNCTION(ncurses_slk_refresh) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_refresh()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_restore(void) - Restores soft label keys */ -PHP_FUNCTION(ncurses_slk_restore) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_restore()); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_touch(void) - Forces output when ncurses_slk_noutrefresh is performed */ -PHP_FUNCTION(ncurses_slk_touch) -{ - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_touch()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_set(int labelnr, string label, int format) - Sets function key labels */ -PHP_FUNCTION(ncurses_slk_set) -{ - char *str; - int len; - long labelnr; - long format; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsl", &labelnr, &str, &len, &format) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_BOOL(slk_set(labelnr, str, format)); -} -/* }}} */ - - -/* {{{ proto int ncurses_attroff(int attributes) - Turns off the given attributes */ -PHP_FUNCTION(ncurses_attroff) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(attroff(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_attron(int attributes) - Turns on the given attributes */ -PHP_FUNCTION(ncurses_attron) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(attron(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_attrset(int attributes) - Sets given attributes */ -PHP_FUNCTION(ncurses_attrset) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(attrset(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_bkgd(int attrchar) - Sets background property for terminal screen */ -PHP_FUNCTION(ncurses_bkgd) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(bkgd(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_curs_set(int visibility) - Sets cursor state */ -PHP_FUNCTION(ncurses_curs_set) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(curs_set(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_delay_output(int milliseconds) - Delays output on terminal using padding characters */ -PHP_FUNCTION(ncurses_delay_output) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(delay_output(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_echochar(int character) - Single character output including refresh */ -PHP_FUNCTION(ncurses_echochar) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(echochar(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_halfdelay(int tenth) - Puts terminal into halfdelay mode */ -PHP_FUNCTION(ncurses_halfdelay) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(halfdelay(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_has_key(int keycode) - Checks for presence of a function key on terminal keyboard */ -PHP_FUNCTION(ncurses_has_key) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(has_key(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_insch(int character) - Inserts character moving rest of line including character at current position */ -PHP_FUNCTION(ncurses_insch) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(insch(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_insdelln(int count) - Inserts lines before current line scrolling down (negative numbers delete and scroll up) */ -PHP_FUNCTION(ncurses_insdelln) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(insdelln(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_mouseinterval(int milliseconds) - Sets timeout for mouse button clicks */ -PHP_FUNCTION(ncurses_mouseinterval) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mouseinterval(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_napms(int milliseconds) - Sleep */ -PHP_FUNCTION(ncurses_napms) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(napms(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_scrl(int count) - Scrolls window content up or down without changing current position */ -PHP_FUNCTION(ncurses_scrl) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(scrl(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attroff(int intarg) - ??? */ -PHP_FUNCTION(ncurses_slk_attroff) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_attroff(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attron(int intarg) - ??? */ -PHP_FUNCTION(ncurses_slk_attron) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_attron(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attrset(int intarg) - ??? */ -PHP_FUNCTION(ncurses_slk_attrset) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_attrset(intarg)); -} -/* }}} */ - -#ifdef HAVE_NCURSES_SLK_COLOR -/* {{{ proto int ncurses_slk_color(int intarg) - Sets color for soft label keys*/ -PHP_FUNCTION(ncurses_slk_color) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_color(intarg)); -} -/* }}} */ -#endif - -/* {{{ proto int ncurses_slk_init(int intarg) - Inits soft label keys */ -PHP_FUNCTION(ncurses_slk_init) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(slk_init(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_typeahead(int fd) - Specifys different filedescriptor for typeahead checking */ -PHP_FUNCTION(ncurses_typeahead) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(typeahead(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_ungetch(int keycode) - Puts a character back into the input stream */ -PHP_FUNCTION(ncurses_ungetch) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(ungetch(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_vidattr(int intarg) - ??? */ -PHP_FUNCTION(ncurses_vidattr) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(vidattr(intarg)); -} -/* }}} */ - -#ifdef HAVE_NCURSES_USE_EXTENDED_NAMES -/* {{{ proto int ncurses_use_extended_names(bool flag) - Controls use of extended names in terminfo descriptions */ -PHP_FUNCTION(ncurses_use_extended_names) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(use_extended_names(intarg)); -} -/* }}} */ -#endif - -/* {{{ proto void ncurses_bkgdset(int attrchar) - Controls screen background */ -PHP_FUNCTION(ncurses_bkgdset) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - bkgdset(intarg); -} -/* }}} */ - -/* {{{ proto void ncurses_filter(void) - */ -PHP_FUNCTION(ncurses_filter) -{ - IS_NCURSES_INITIALIZED(); - filter(); -} -/* }}} */ - -/* {{{ proto int ncurses_noqiflush(void) - Do not flush on signal characters*/ -PHP_FUNCTION(ncurses_noqiflush) -{ - IS_NCURSES_INITIALIZED(); - noqiflush(); -} -/* }}} */ - -/* {{{ proto void ncurses_qiflush(void) - Flushes on signal characters */ -PHP_FUNCTION(ncurses_qiflush) -{ - IS_NCURSES_INITIALIZED(); - qiflush(); -} -/* }}} */ - -/* {{{ proto void ncurses_timeout(int millisec) - Sets timeout for special key sequences */ -PHP_FUNCTION(ncurses_timeout) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - timeout(intarg); -} -/* }}} */ - -/* {{{ proto void ncurses_use_env(int flag) - Controls use of environment information about terminal size */ -PHP_FUNCTION(ncurses_use_env) -{ - long intarg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intarg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - use_env(intarg); -} -/* }}} */ - -/* {{{ proto int ncurses_addstr(string text) - Outputs text at current position */ -PHP_FUNCTION(ncurses_addstr) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(addstr(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_putp(string text) - ??? */ -PHP_FUNCTION(ncurses_putp) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(putp(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_scr_dump(string filename) - Dumps screen content to file */ -PHP_FUNCTION(ncurses_scr_dump) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(scr_dump(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_scr_init(string filename) - Initializes screen from file dump */ -PHP_FUNCTION(ncurses_scr_init) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(scr_init(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_scr_restore(string filename) - Restores screen from file dump */ -PHP_FUNCTION(ncurses_scr_restore) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(scr_restore(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_scr_set(string filename) - Inherits screen from file dump */ -PHP_FUNCTION(ncurses_scr_set) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(scr_set(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvaddch(int y, int x, int c) - Moves current position and add character */ -PHP_FUNCTION(ncurses_mvaddch) -{ - long y,x,c; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &y, &x, &c) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvaddch(y,x,c)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvaddchnstr(int y, int x, string s, int n) - Moves position and add attrributed string with specified length */ -PHP_FUNCTION(ncurses_mvaddchnstr) -{ - long y,x,n; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llsl", &y, &x, &str, &str_len, &n) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvaddchnstr(y,x,(chtype *)str,n)); -} -/* }}} */ - -/* {{{ proto int ncurses_addchnstr(string s, int n) - Adds attributed string with specified length at current position */ -PHP_FUNCTION(ncurses_addchnstr) -{ - long n; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &str, &str_len, &n) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(addchnstr((chtype *)str,n)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvaddchstr(int y, int x, string s) - Moves position and add attributed string */ -PHP_FUNCTION(ncurses_mvaddchstr) -{ - long y,x; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &y, &x, &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvaddchstr(y,x,(chtype *)str)); -} -/* }}} */ - -/* {{{ proto int ncurses_addchstr(string s) - Adds attributed string at current position */ -PHP_FUNCTION(ncurses_addchstr) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(addchstr((chtype *)str)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvaddnstr(int y, int x, string s, int n) - Moves position and add string with specified length */ -PHP_FUNCTION(ncurses_mvaddnstr) -{ - long y,x,n; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llsl", &y, &x, &str, &str_len, &n) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvaddnstr(y,x,str,n)); -} -/* }}} */ - -/* {{{ proto int ncurses_addnstr(string s, int n) - Adds string with specified length at current position */ -PHP_FUNCTION(ncurses_addnstr) -{ - long n; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &str, &str_len, &n) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(addnstr(str,n)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvaddstr(int y, int x, string s) - Moves position and add string */ -PHP_FUNCTION(ncurses_mvaddstr) -{ - long y,x; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &y, &x, &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvaddstr(y,x,str)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvdelch(int y, int x) - Moves position and delete character, shift rest of line left */ -PHP_FUNCTION(ncurses_mvdelch) -{ - long y,x; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &y, &x) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvdelch(y,x)); -} -/* }}} */ - - -/* {{{ proto int ncurses_mvgetch(int y, int x) - Moves position and get character at new position */ -PHP_FUNCTION(ncurses_mvgetch) -{ - long y,x; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &y, &x) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvgetch(y,x)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvinch(int y, int x) - Moves position and get attributed character at new position */ -PHP_FUNCTION(ncurses_mvinch) -{ - long y,x; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &y, &x) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvinch(y,x)); -} -/* }}} */ - -/* {{{ proto int ncurses_insstr(string text) - Inserts string at current position, moving rest of line right */ -PHP_FUNCTION(ncurses_insstr) -{ - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(insstr(str)); -} -/* }}} */ - -/* {{{ proto int ncurses_instr(string &buffer) - Reads string from terminal screen */ -PHP_FUNCTION(ncurses_instr) -{ - ulong retval; - zval *param; - char *str; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE ) { - return; - } - IS_NCURSES_INITIALIZED(); - - str = (char *)emalloc(COLS + 1); - retval = instr(str); - - ZVAL_STRING(param, str, strlen(str)); - efree(str); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int ncurses_mvhline(int y, int x, int attrchar, int n) - Sets new position and draw a horizontal line using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_mvhline) -{ - long i1,i2,i3,i4; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &i1, &i2, &i3, &i4) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvhline(i1,i2,i3,i4)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvvline(int y, int x, int attrchar, int n) - Sets new position and draw a vertical line using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_mvvline) -{ - long i1,i2,i3,i4; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &i1, &i2, &i3, &i4) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvvline(i1,i2,i3,i4)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvcur(int old_y,int old_x, int new_y, int new_x) - Moves cursor immediately */ -PHP_FUNCTION(ncurses_mvcur) -{ - long i1,i2,i3,i4; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &i1, &i2, &i3, &i4) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(mvcur(i1,i2,i3,i4)); -} -/* }}} */ - -/* {{{ proto int ncurses_init_color(int color, int r, int g, int b) - Sets new RGB value for color */ -PHP_FUNCTION(ncurses_init_color) -{ - long i1,i2,i3,i4; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &i1, &i2, &i3, &i4) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(init_color(i1,i2,i3,i4)); -} -/* }}} */ - -/* {{{ proto int ncurses_color_content(int color, int &r, int &g, int &b) - Gets the RGB value for color */ -PHP_FUNCTION(ncurses_color_content) -{ - zval *r, *g, *b; - short rv, gv, bv; - int retval; - long c; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz", &c, &r, &g, &b) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - retval = color_content(c, &rv, &gv, &bv); - - ZVAL_LONG(r, rv); - ZVAL_LONG(g, gv); - ZVAL_LONG(b, bv); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int ncurses_pair_content(int pair, int &f, int &b) - Gets the RGB value for color */ -PHP_FUNCTION(ncurses_pair_content) -{ - zval *f, *b; - short fv, bv; - int retval; - long p; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzz", &p, &f, &b) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - retval = pair_content(p, &fv, &bv); - - ZVAL_LONG(f, fv); - ZVAL_LONG(b, bv); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int ncurses_border(int left, int right, int top, int bottom, int tl_corner, int tr_corner, int bl_corner, int br_corner) - Draws a border around the screen using attributed characters */ -PHP_FUNCTION(ncurses_border) -{ - long i1,i2,i3,i4,i5,i6,i7,i8; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllllll", &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(border(i1,i2,i3,i4,i5,i6,i7,i8)); -} -/* }}} */ - -/* {{{ proto int ncurses_wborder(resource window, int left, int right, int top, int bottom, int tl_corner, int tr_corner, int bl_corner, int br_corner) - Draws a border around the window using attributed characters */ -PHP_FUNCTION(ncurses_wborder) -{ - long i1,i2,i3,i4,i5,i6,i7,i8; - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &handle, &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wborder(*win,i1,i2,i3,i4,i5,i6,i7,i8)); -} -/* }}} */ - -#ifdef HAVE_NCURSES_ASSUME_DEFAULT_COLORS -/* {{{ proto int ncurses_assume_default_colors(int fg, int bg) - Defines default colors for color 0 */ -PHP_FUNCTION(ncurses_assume_default_colors) -{ - long i1,i2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &i1, &i2) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(assume_default_colors(i1,i2)); -} -/* }}} */ -#endif - -/* {{{ proto int ncurses_define_key(string definition, int keycode) - Defines a keycode */ -PHP_FUNCTION(ncurses_define_key) -{ - long n; - char *str; - int str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &str, &str_len, &n) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(define_key(str,n)); -} -/* }}} */ - -/* {{{ proto int ncurses_hline(int charattr, int n) - Draws a horizontal line at current position using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_hline) -{ - long i1,i2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &i1, &i2) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(hline(i1,i2)); -} -/* }}} */ - -/* {{{ proto int ncurses_vline(int charattr, int n) - Draws a vertical line at current position using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_vline) -{ - long i1,i2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &i1, &i2) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(vline(i1,i2)); -} -/* }}} */ - -/* {{{ proto int ncurses_whline(resource window, int charattr, int n) - Draws a horizontal line in a window at current position using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_whline) -{ - long i1,i2; - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &handle, &i1, &i2) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(whline(*win,i1,i2)); -} -/* }}} */ - -/* {{{ proto int ncurses_wvline(resource window, int charattr, int n) - Draws a vertical line in a window at current position using an attributed character and max. n characters long */ -PHP_FUNCTION(ncurses_wvline) -{ - long i1,i2; - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &handle, &i1, &i2) == FAILURE) { - return; - } - FETCH_WINRES(win, &handle); - - RETURN_LONG(wvline(*win,i1,i2)); -} -/* }}} */ - -/* {{{ proto int ncurses_keyok(int keycode, int enable) - Enables or disable a keycode */ -PHP_FUNCTION(ncurses_keyok) -{ - long i,b; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &i, &b) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - RETURN_LONG(hline(i,b)); -} -/* }}} */ - -/* {{{ proto int ncurses_mvwaddstr(resource window, int y, int x, string text) - Adds string at new position in window */ -PHP_FUNCTION(ncurses_mvwaddstr) -{ - zval *handle; - long y, x; - int text_len; - char *text; - WINDOW **w; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlls", &handle, &y, &x, &text, &text_len) == FAILURE) { - return; - } - - FETCH_WINRES(w, &handle); - - RETURN_LONG(mvwaddstr(*w,y,x,text)); -} -/* }}} */ - -/* {{{ proto int ncurses_wrefresh(resource window) - Refreshes window on terminal screen */ -PHP_FUNCTION(ncurses_wrefresh) -{ - zval *handle; - WINDOW **w; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(w, &handle); - - RETURN_LONG(wrefresh(*w)); -} -/* }}} */ - -/* {{{ proto string ncurses_termname(void) - Returns terminal name */ -PHP_FUNCTION(ncurses_termname) -{ - char temp[15]; - - IS_NCURSES_INITIALIZED(); - - strlcpy(temp, termname(), sizeof(temp)); - - RETURN_STRINGL (temp, strlen(temp), 1); -} -/* }}} */ - -/* {{{ proto string ncurses_longname(void) - Returns terminal description */ -PHP_FUNCTION(ncurses_longname) -{ - char temp[128]; - - IS_NCURSES_INITIALIZED(); - - strlcpy(temp, longname(), sizeof(temp)); - - RETURN_STRINGL (temp, strlen(temp), 1); -} -/* }}} */ - -/* {{{ proto int ncurses_mousemask(int newmask, int &oldmask) - Returns and sets mouse options */ -PHP_FUNCTION(ncurses_mousemask) -{ - ulong oldmask; - ulong retval; - zval *param; - long newmask; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &newmask, ¶m) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - retval = mousemask(newmask, &oldmask); - - ZVAL_LONG(param, oldmask); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto bool ncurses_getmouse(array &mevent) - Reads mouse event from queue. The content of mevent is cleared before new data is added. */ -PHP_FUNCTION(ncurses_getmouse) -{ - zval *arg; - MEVENT mevent; - ulong retval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - pval_destructor(arg); - array_init(arg); - - retval = getmouse(&mevent); - - add_assoc_long(arg, "id", mevent.id); - add_assoc_long(arg, "x", mevent.x); - add_assoc_long(arg, "y", mevent.y); - add_assoc_long(arg, "z", mevent.z); - add_assoc_long(arg, "mmask", mevent.bstate); - - RETURN_BOOL(retval == 0); -} -/* }}} */ - -/* {{{ proto int ncurses_ungetmouse(array mevent) - Pushes mouse event to queue */ -PHP_FUNCTION(ncurses_ungetmouse) -{ - zval *arg, **pvalue; - MEVENT mevent; - ulong retval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &arg) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - if (zend_hash_find(Z_ARRVAL_P(arg), "id", sizeof("id"), (void **) &pvalue) == SUCCESS) { - convert_to_long_ex(pvalue); - mevent.id = Z_LVAL_PP(pvalue); - } - - if (zend_hash_find(Z_ARRVAL_P(arg), "x", sizeof("x"), (void **) &pvalue) == SUCCESS) { - convert_to_long_ex(pvalue); - mevent.x = Z_LVAL_PP(pvalue); - } - - if (zend_hash_find(Z_ARRVAL_P(arg), "y", sizeof("y"), (void **) &pvalue) == SUCCESS) { - convert_to_long_ex(pvalue); - mevent.y = Z_LVAL_PP(pvalue); - } - - if (zend_hash_find(Z_ARRVAL_P(arg), "z", sizeof("z"), (void **) &pvalue) == SUCCESS) { - convert_to_long_ex(pvalue); - mevent.z = Z_LVAL_PP(pvalue); - } - - if (zend_hash_find(Z_ARRVAL_P(arg), "mmask", sizeof("mmask"), (void **) &pvalue) == SUCCESS) { - convert_to_long_ex(pvalue); - mevent.bstate = Z_LVAL_PP(pvalue); - } - - retval = ungetmouse(&mevent); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto bool ncurses_mouse_trafo(int &y, int &x, bool toscreen) - Transforms coordinates */ -PHP_FUNCTION(ncurses_mouse_trafo) -{ - zval *x, *y; - zend_bool toscreen; - int nx, ny, retval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzb", &y, &x, &toscreen) == FAILURE) { - return; - } - IS_NCURSES_INITIALIZED(); - - convert_to_long(y); - convert_to_long(x); - - nx = Z_LVAL_P(x); - ny = Z_LVAL_P(y); - - retval = mouse_trafo(&ny, &nx, toscreen); - - ZVAL_LONG(x, nx); - ZVAL_LONG(y, ny); - - RETURN_BOOL(retval); -} -/* }}} */ - -/* {{{ proto bool ncurses_wmouse_trafo(resource window, int &y, int &x, bool toscreen) - Transforms window/stdscr coordinates */ -PHP_FUNCTION(ncurses_wmouse_trafo) -{ - zval *handle, *x, *y; - int nx, ny, retval; - WINDOW **win; - zend_bool toscreen; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzzb", &handle, &y, &x, &toscreen) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - convert_to_long(x); - convert_to_long(y); - - nx = Z_LVAL_P(x); - ny = Z_LVAL_P(y); - - retval = wmouse_trafo (*win, &ny, &nx, toscreen); - - ZVAL_LONG(x, nx); - ZVAL_LONG(y, ny); - - RETURN_BOOL(retval); -} -/* }}} */ - -/* {{{ proto void ncurses_getyx(resource window, int &y, int &x) - Returns the current cursor position for a window */ -PHP_FUNCTION(ncurses_getyx) -{ - zval *handle, *x, *y; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzz", &handle, &y, &x) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - convert_to_long(x); - convert_to_long(y); - - getyx(*win, Z_LVAL_P(y), Z_LVAL_P(x)); -} -/* }}} */ - -/* {{{ proto void ncurses_getmaxyx(resource window, int &y, int &x) - Returns the size of a window */ -PHP_FUNCTION(ncurses_getmaxyx) -{ - zval *handle, *x, *y; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzz", &handle, &y, &x) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - convert_to_long(x); - convert_to_long(y); - - getmaxyx(*win, Z_LVAL_P(y), Z_LVAL_P(x)); -} -/* }}} */ - -/* {{{ proto int ncurses_wmove(resource window, int y, int x) - Moves windows output position */ -PHP_FUNCTION(ncurses_wmove) -{ - zval *handle, *x, *y; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzz", &handle, &y, &x) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - convert_to_long(x); - convert_to_long(y); - - RETURN_LONG(wmove(*win, Z_LVAL_P(y), Z_LVAL_P(x))); -} -/* }}} */ - -/* {{{ proto int ncurses_keypad(resource window, bool bf) - Turns keypad on or off */ -PHP_FUNCTION(ncurses_keypad) -{ - zval *handle; - zend_bool bf; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &handle, &bf) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(keypad(*win, bf)); - -} -/* }}} */ - -#ifdef HAVE_NCURSES_COLOR_SET -/* {{{ proto int ncurses_wcolor_set(resource window, int color_pair) - Sets windows color pairings */ -PHP_FUNCTION(ncurses_wcolor_set) -{ - zval *handle; - long color_pair; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &color_pair) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wcolor_set(*win, color_pair, 0)); -} -/* }}} */ -#endif - -/* {{{ proto int ncurses_wclear(resource window) - Clears window */ -PHP_FUNCTION(ncurses_wclear) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wclear(*win)); -} -/* }}} */ - -/* {{{ proto int ncurses_wnoutrefresh(resource window) - Copies window to virtual screen */ -PHP_FUNCTION(ncurses_wnoutrefresh) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wnoutrefresh(*win)); -} -/* }}} */ - -/* {{{ proto int ncurses_waddstr(resource window, string str [, int n]) - Outputs text at current postion in window */ -PHP_FUNCTION(ncurses_waddstr) -{ - zval *handle; - char *str; - int str_len; - long n = 0; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &handle, &str, &str_len, &n) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - if (!n) { - RETURN_LONG(waddstr(*win, str)); - } else { - RETURN_LONG(waddnstr(*win, str, n)); - } -} -/* }}} */ - -/* {{{ proto int ncurses_wgetch(resource window) - Reads a character from keyboard (window) */ -PHP_FUNCTION(ncurses_wgetch) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wgetch(*win)); -} -/* }}} */ - -/* {{{ proto int ncurses_wattroff(resource window, int attrs) - Turns off attributes for a window */ -PHP_FUNCTION(ncurses_wattroff) -{ - zval *handle; - WINDOW **win; - long attrs; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &attrs) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wattroff(*win, attrs)); -} -/* }}} */ - -/* {{{ proto int ncurses_wattron(resource window, int attrs) - Turns on attributes for a window */ -PHP_FUNCTION(ncurses_wattron) -{ - zval *handle; - WINDOW **win; - long attrs; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &attrs) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wattron(*win, attrs)); -} -/* }}} */ - -/* {{{ proto int ncurses_wattrset(resource window, int attrs) - Set the attributes for a window */ -PHP_FUNCTION(ncurses_wattrset) -{ - zval *handle; - WINDOW **win; - long attrs; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &attrs) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wattrset(*win, attrs)); -} -/* }}} */ - -/* {{{ proto int ncurses_wstandend(resource window) - End standout mode for a window */ -PHP_FUNCTION(ncurses_wstandend) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wstandend(*win)); -} -/* }}} */ - -/* {{{ proto int ncurses_wstandout(resource window) - Enter standout mode for a window */ -PHP_FUNCTION(ncurses_wstandout) -{ - zval *handle; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - RETURN_LONG(wstandout(*win)); -} -/* }}} */ - -#if HAVE_NCURSES_PANEL -/* {{{ proto resource ncurses_new_panel(resource window) - Create a new panel and associate it with window */ -PHP_FUNCTION(ncurses_new_panel) -{ - zval *handle; - WINDOW **win; - PANEL **panel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_WINRES(win, &handle); - - panel = (PANEL **)emalloc(sizeof(PANEL *)); - *panel = new_panel(*win); - - if (*panel == NULL) { - efree(panel); - RETURN_FALSE; - } else { - long id = ZEND_REGISTER_RESOURCE(return_value, panel, le_ncurses_panels); - set_panel_userptr(*panel, (void*)id); - } - -} -/* }}} */ - -/* {{{ proto bool ncurses_del_panel(resource panel) - Remove panel from the stack and delete it (but not the associated window) */ -PHP_FUNCTION(ncurses_del_panel) -{ - zval *handle; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - zend_list_delete(Z_RESVAL_P(handle)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ncurses_hide_panel(resource panel) - Remove panel from the stack, making it invisible */ -PHP_FUNCTION(ncurses_hide_panel) -{ - zval *handle; - PANEL **panel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &handle); - - RETURN_LONG(hide_panel(*panel)); - -} -/* }}} */ - -/* {{{ proto int ncurses_show_panel(resource panel) - Places an invisible panel on top of the stack, making it visible */ -PHP_FUNCTION(ncurses_show_panel) -{ - zval *handle; - PANEL **panel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &handle); - - RETURN_LONG(show_panel(*panel)); - -} -/* }}} */ - -/* {{{ proto int ncurses_top_panel(resource panel) - Moves a visible panel to the top of the stack */ -PHP_FUNCTION(ncurses_top_panel) -{ - zval *handle; - PANEL **panel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &handle); - - RETURN_LONG(top_panel(*panel)); - -} -/* }}} */ - -/* {{{ proto int ncurses_bottom_panel(resource panel) - Moves a visible panel to the bottom of the stack */ -PHP_FUNCTION(ncurses_bottom_panel) -{ - zval *handle; - PANEL **panel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &handle); - - RETURN_LONG(bottom_panel(*panel)); - -} -/* }}} */ - -/* {{{ proto int ncurses_move_panel(resource panel, int startx, int starty) - Moves a panel so that it's upper-left corner is at [startx, starty] */ -PHP_FUNCTION(ncurses_move_panel) -{ - zval *handle; - PANEL **panel; - long startx, starty; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &handle, &startx, &starty) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &handle); - - RETURN_LONG(move_panel(*panel, startx, starty)); - -} -/* }}} */ - -/* {{{ proto int ncurses_replace_panel(resource panel, resource window) - Replaces the window associated with panel */ -PHP_FUNCTION(ncurses_replace_panel) -{ - zval *phandle, *whandle; - PANEL **panel; - WINDOW **window; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &phandle, &whandle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &phandle); - FETCH_WINRES(window, &whandle); - - RETURN_LONG(replace_panel(*panel, *window)); - -} -/* }}} */ - -/* {{{ proto resource ncurses_panel_above(resource panel) - Returns the panel above panel. If panel is null, returns the bottom panel in the stack */ -PHP_FUNCTION(ncurses_panel_above) -{ - zval *phandle = NULL; - PANEL **panel; - PANEL *above; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r!", &phandle) == FAILURE) { - return; - } - - if (phandle) { - FETCH_PANEL(panel, &phandle); - above = panel_above(*panel); - } else { - above = panel_above((PANEL *)0); - } - - if (above) { - long id = (long)panel_userptr(above); - zend_list_addref(id); - RETURN_RESOURCE(id); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource ncurses_panel_below(resource panel) - Returns the panel below panel. If panel is null, returns the top panel in the stack */ -PHP_FUNCTION(ncurses_panel_below) -{ - zval *phandle = NULL; - PANEL **panel; - PANEL *below; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r!", &phandle) == FAILURE) { - return; - } - - if (phandle) { - FETCH_PANEL(panel, &phandle); - below = panel_below(*panel); - } else { - below = panel_below((PANEL *)0); - } - if (below) { - long id = (long)panel_userptr(below); - zend_list_addref(id); - RETURN_RESOURCE(id); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource ncurses_panel_window(resource panel) - Returns the window associated with panel */ -PHP_FUNCTION(ncurses_panel_window) -{ - zval *phandle = NULL; - PANEL **panel; - WINDOW **win; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &phandle) == FAILURE) { - return; - } - - FETCH_PANEL(panel, &phandle); - - win = (WINDOW **)emalloc(sizeof(WINDOW *)); - *win = panel_window(*panel); - - if (*win == NULL) { - efree(win); - RETURN_FALSE; - } - ZEND_REGISTER_RESOURCE(return_value, win, le_ncurses_windows); -} -/* }}} */ - -/* {{{ proto void ncurses_update_panels(void) - Refreshes the virtual screen to reflect the relations between panels in the stack. */ -PHP_FUNCTION(ncurses_update_panels) -{ - IS_NCURSES_INITIALIZED(); - update_panels(); -} -/* }}} */ -#endif /* HAVE_NCURSES_PANEL */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ncurses/package.xml b/ext/ncurses/package.xml deleted file mode 100644 index a5c3af3e4b8ee..0000000000000 --- a/ext/ncurses/package.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>ncurses</name> - <summary>Terminal screen handling and optimization package</summary> - <maintainers> - <maintainer> - <user>hholzgra</user> - <name>Hartmut Holzgraefe</name> - <email>hartmut@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>georg</user> - <name>Georg Richter</name> - <role>developer</role> - <email>georg@php.net</email> - </maintainer> - <maintainer> - <user>iliaa</user> - <name>Ilia Alshanetsky</name> - <role>developer</role> - <email>iliaa@php.net</email> - </maintainer> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <role>developer</role> - <email>wez@php.net</email> - </maintainer> - </maintainers> - <description> -ncurses (new curses) is a free software emulation of curses in -System V Rel 4.0 (and above). It uses terminfo format, supports -pads, colors, multiple highlights, form characters and function -key mapping. Because of the interactive nature of this library, -it will be of little use for writing Web applications, but may -be useful when writing scripts meant using PHP from the command -line. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <configureoptions> - <configureoption name="with-ncurses" default="autodetect" prompt="path to ncurses installation?"/> - </configureoptions> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="doc" name="EXPERIMENTAL"/> - <file role="doc" name="example1.php"/> - <file role="src" name="config.m4"/> - <file role="src" name="ncurses.c"/> - <file role="src" name="ncurses.php"/> - <file role="src" name="ncurses_fe.c"/> - <file role="src" name="ncurses_functions.c"/> - <file role="src" name="php_ncurses.h"/> - <file role="src" name="php_ncurses_fe.h"/> - <file role="test" name="tests/001.phpt"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> --> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/ncurses/php_ncurses.h b/ext/ncurses/php_ncurses.h deleted file mode 100644 index 6b0ebcce6f417..0000000000000 --- a/ext/ncurses/php_ncurses.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe <hholzgra@php.net> | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_NCURSES_H -#define PHP_NCURSES_H - -#ifdef HAVE_NCURSES_H -# include <ncurses.h> -#else -# include <curses.h> -#endif - -extern int le_ncurses_windows; - -#if HAVE_NCURSES_PANEL -# include <panel.h> -extern int le_ncurses_panels; -#endif - - -extern zend_module_entry ncurses_module_entry; -#define phpext_ncurses_ptr &ncurses_module_entry - -extern function_entry ncurses_functions[]; -#include "php_ncurses_fe.h" - -#ifdef PHP_WIN32 -#define PHP_NCURSES_API __declspec(dllexport) -#else -#define PHP_NCURSES_API -#endif - -PHP_MINIT_FUNCTION(ncurses); -PHP_MSHUTDOWN_FUNCTION(ncurses); -PHP_MINFO_FUNCTION(ncurses); - -ZEND_BEGIN_MODULE_GLOBALS(ncurses) - int registered_constants; -ZEND_END_MODULE_GLOBALS(ncurses) - -/* In every function that needs to use variables in php_ncurses_globals, - do call NCURSES_LS_FETCH(); after declaring other variables used by - that function, and always refer to them as NCURSES_G(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define NCURSES_G(v) TSRMG(ncurses_globals_id, zend_ncurses_globals *, v) -#define NCURSES_LS_FETCH() zend_ncurses_globals *ncurses_globals = ts_resource(ncurses_globals_id) -#else -#define NCURSES_G(v) (ncurses_globals.v) -#define NCURSES_LS_FETCH() -#endif - -ZEND_EXTERN_MODULE_GLOBALS(ncurses) - -#endif /* PHP_NCURSES_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/ncurses/php_ncurses_fe.h b/ext/ncurses/php_ncurses_fe.h deleted file mode 100644 index 3397d9cbd1a7e..0000000000000 --- a/ext/ncurses/php_ncurses_fe.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe <hholzgra@php.net> | - | Georg Richter <georg.richter@php-ev.de> | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_NCURSES_FE_H -#define PHP_NCURSES_FE_H - -PHP_FUNCTION(ncurses_addch); -PHP_FUNCTION(ncurses_color_set); -PHP_FUNCTION(ncurses_delwin); -PHP_FUNCTION(ncurses_end); -PHP_FUNCTION(ncurses_getch); -PHP_FUNCTION(ncurses_has_colors); -PHP_FUNCTION(ncurses_init); -PHP_FUNCTION(ncurses_init_pair); -PHP_FUNCTION(ncurses_color_content); -PHP_FUNCTION(ncurses_pair_content); -PHP_FUNCTION(ncurses_move); -PHP_FUNCTION(ncurses_newwin); -PHP_FUNCTION(ncurses_refresh); -PHP_FUNCTION(ncurses_start_color); -PHP_FUNCTION(ncurses_standout); -PHP_FUNCTION(ncurses_standend); -PHP_FUNCTION(ncurses_baudrate); -PHP_FUNCTION(ncurses_beep); -PHP_FUNCTION(ncurses_can_change_color); -PHP_FUNCTION(ncurses_cbreak); -PHP_FUNCTION(ncurses_clear); -PHP_FUNCTION(ncurses_clrtobot); -PHP_FUNCTION(ncurses_clrtoeol); -PHP_FUNCTION(ncurses_def_prog_mode); -PHP_FUNCTION(ncurses_reset_prog_mode); -PHP_FUNCTION(ncurses_def_shell_mode); -PHP_FUNCTION(ncurses_reset_shell_mode); -PHP_FUNCTION(ncurses_delch); -PHP_FUNCTION(ncurses_deleteln); -PHP_FUNCTION(ncurses_doupdate); -PHP_FUNCTION(ncurses_echo); -PHP_FUNCTION(ncurses_erase); -PHP_FUNCTION(ncurses_werase); -PHP_FUNCTION(ncurses_erasechar); -PHP_FUNCTION(ncurses_flash); -PHP_FUNCTION(ncurses_flushinp); -PHP_FUNCTION(ncurses_has_ic); -PHP_FUNCTION(ncurses_has_il); -PHP_FUNCTION(ncurses_inch); -PHP_FUNCTION(ncurses_insertln); -PHP_FUNCTION(ncurses_isendwin); -PHP_FUNCTION(ncurses_killchar); -PHP_FUNCTION(ncurses_nl); -PHP_FUNCTION(ncurses_nocbreak); -PHP_FUNCTION(ncurses_noecho); -PHP_FUNCTION(ncurses_nonl); -PHP_FUNCTION(ncurses_noraw); -PHP_FUNCTION(ncurses_raw); -PHP_FUNCTION(ncurses_meta); -PHP_FUNCTION(ncurses_resetty); -PHP_FUNCTION(ncurses_savetty); -PHP_FUNCTION(ncurses_termattrs); -PHP_FUNCTION(ncurses_use_default_colors); -PHP_FUNCTION(ncurses_slk_attr); -PHP_FUNCTION(ncurses_slk_clear); -PHP_FUNCTION(ncurses_slk_noutrefresh); -PHP_FUNCTION(ncurses_slk_refresh); -PHP_FUNCTION(ncurses_slk_restore); -PHP_FUNCTION(ncurses_slk_touch); -PHP_FUNCTION(ncurses_attroff); -PHP_FUNCTION(ncurses_attron); -PHP_FUNCTION(ncurses_attrset); -PHP_FUNCTION(ncurses_bkgd); -PHP_FUNCTION(ncurses_curs_set); -PHP_FUNCTION(ncurses_delay_output); -PHP_FUNCTION(ncurses_echochar); -PHP_FUNCTION(ncurses_halfdelay); -PHP_FUNCTION(ncurses_has_key); -PHP_FUNCTION(ncurses_insch); -PHP_FUNCTION(ncurses_insdelln); -PHP_FUNCTION(ncurses_mouseinterval); -PHP_FUNCTION(ncurses_napms); -PHP_FUNCTION(ncurses_scrl); -PHP_FUNCTION(ncurses_slk_attroff); -PHP_FUNCTION(ncurses_slk_attron); -PHP_FUNCTION(ncurses_slk_attrset); -PHP_FUNCTION(ncurses_slk_color); -PHP_FUNCTION(ncurses_slk_init); -PHP_FUNCTION(ncurses_slk_set); -PHP_FUNCTION(ncurses_typeahead); -PHP_FUNCTION(ncurses_ungetch); -PHP_FUNCTION(ncurses_vidattr); -PHP_FUNCTION(ncurses_wrefresh); -PHP_FUNCTION(ncurses_use_extended_names); -PHP_FUNCTION(ncurses_bkgdset); -PHP_FUNCTION(ncurses_filter); -PHP_FUNCTION(ncurses_noqiflush); -PHP_FUNCTION(ncurses_qiflush); -PHP_FUNCTION(ncurses_timeout); -PHP_FUNCTION(ncurses_use_env); -PHP_FUNCTION(ncurses_addstr); -PHP_FUNCTION(ncurses_putp); -PHP_FUNCTION(ncurses_scr_dump); -PHP_FUNCTION(ncurses_scr_init); -PHP_FUNCTION(ncurses_scr_restore); -PHP_FUNCTION(ncurses_scr_set); -PHP_FUNCTION(ncurses_mvaddch); -PHP_FUNCTION(ncurses_mvaddchnstr); -PHP_FUNCTION(ncurses_addchnstr); -PHP_FUNCTION(ncurses_mvaddchstr); -PHP_FUNCTION(ncurses_addchstr); -PHP_FUNCTION(ncurses_mvaddnstr); -PHP_FUNCTION(ncurses_addnstr); -PHP_FUNCTION(ncurses_mvaddstr); -PHP_FUNCTION(ncurses_mvdelch); -PHP_FUNCTION(ncurses_mvgetch); -PHP_FUNCTION(ncurses_mvinch); -PHP_FUNCTION(ncurses_mvwaddstr); -PHP_FUNCTION(ncurses_insstr); -PHP_FUNCTION(ncurses_instr); -PHP_FUNCTION(ncurses_mvhline); -PHP_FUNCTION(ncurses_mvcur); -PHP_FUNCTION(ncurses_init_color); -PHP_FUNCTION(ncurses_border); -PHP_FUNCTION(ncurses_assume_default_colors); -PHP_FUNCTION(ncurses_define_key); -PHP_FUNCTION(ncurses_hline); -PHP_FUNCTION(ncurses_vline); -PHP_FUNCTION(ncurses_keyok); -PHP_FUNCTION(ncurses_termname); -PHP_FUNCTION(ncurses_longname); -PHP_FUNCTION(ncurses_mousemask); -PHP_FUNCTION(ncurses_getmouse); -PHP_FUNCTION(ncurses_ungetmouse); -PHP_FUNCTION(ncurses_mouse_trafo); -PHP_FUNCTION(ncurses_wmouse_trafo); -PHP_FUNCTION(ncurses_waddstr); -PHP_FUNCTION(ncurses_wnoutrefresh); -PHP_FUNCTION(ncurses_wclear); -PHP_FUNCTION(ncurses_wcolor_set); -PHP_FUNCTION(ncurses_wgetch); -PHP_FUNCTION(ncurses_keypad); -PHP_FUNCTION(ncurses_wmove); - -PHP_FUNCTION(ncurses_newpad); -PHP_FUNCTION(ncurses_prefresh); -PHP_FUNCTION(ncurses_pnoutrefresh); - -PHP_FUNCTION(ncurses_wstandout); -PHP_FUNCTION(ncurses_wstandend); -PHP_FUNCTION(ncurses_wattrset); -PHP_FUNCTION(ncurses_wattron); -PHP_FUNCTION(ncurses_wattroff); -PHP_FUNCTION(ncurses_waddch); -PHP_FUNCTION(ncurses_wborder); -PHP_FUNCTION(ncurses_whline); -PHP_FUNCTION(ncurses_wvline); -PHP_FUNCTION(ncurses_getyx); -PHP_FUNCTION(ncurses_getmaxyx); -#if HAVE_NCURSES_PANEL -PHP_FUNCTION(ncurses_update_panels); -PHP_FUNCTION(ncurses_panel_window); -PHP_FUNCTION(ncurses_panel_below); -PHP_FUNCTION(ncurses_panel_above); -PHP_FUNCTION(ncurses_replace_panel); -PHP_FUNCTION(ncurses_move_panel); -PHP_FUNCTION(ncurses_bottom_panel); -PHP_FUNCTION(ncurses_top_panel); -PHP_FUNCTION(ncurses_show_panel); -PHP_FUNCTION(ncurses_hide_panel); -PHP_FUNCTION(ncurses_del_panel); -PHP_FUNCTION(ncurses_new_panel); -#endif - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ncurses/tests/001.phpt b/ext/ncurses/tests/001.phpt deleted file mode 100644 index 2316ba1db4c7b..0000000000000 --- a/ext/ncurses/tests/001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Check for ncurses presence ---SKIPIF-- -<?php if (!extension_loaded("ncurses")) print "skip"; ?> ---FILE-- -<?php -echo "ncurses extension is available"; -/* - you can add regression tests for your extension here - - the output of your test code has to be equal to the - text in the --EXPECT-- section below for the tests - to pass, differences between the output and the - expected text are interpreted as failure - - see php5/tests/README for further information on - writing regression tests -*/ -?> ---EXPECT-- -ncurses extension is available \ No newline at end of file diff --git a/ext/oci8/CREDITS b/ext/oci8/CREDITS deleted file mode 100644 index 18cad81c3e234..0000000000000 --- a/ext/oci8/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -OCI8 -Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong diff --git a/ext/oci8/README b/ext/oci8/README deleted file mode 100644 index b9df41db3a869..0000000000000 --- a/ext/oci8/README +++ /dev/null @@ -1,61 +0,0 @@ -Installing OCI8 ---------------- - -1. Common requirements. -2. Installing as shared extension. -3. Installing as statically compiled extension. -4. Installing from PECL. - - -1. Common requirements ----------------------- -In case if you use Oracle Instant Client, you don't have to set ORACLE_HOME and -most of the other environment variables to build PHP with OCI8 support. -The only variables you may have to set are: -LD_LIBRARY_PATH - it must include Instant Client libraries dir -NLS_LANG - in case if you want to change the default encoding used during -interaction with Oracle servers - -If you use common Oracle Client installation that comes along with the Oracle -server installation, you MUST set at least ORACLE_HOME environment variable -and make it visible for your web-server BEFORE it starts. Most appropriate -places to add ORACLE_HOME definition are: -- /etc/profile -- /etc/profile.local -- /etc/profile.d -and others. - -2. Installing as shared extension ---------------------------------- -To install OCI8 as shared extension (i.e. the one you should put into -your php.ini) use the following configure lines to configure PHP: -a) if you use common Oracle Client installation: -./configure --with-oci8=shared,$ORACLE_HOME - -b) with Oracle Instant Client: -./configure --with-oci8=shared,instantclient,/path/to/instant/client/lib -If you use rpm-based installation of Oracle Instant Client, your configure -line will look like this: -./configure --with-oci8=shared,instantclient,/usr/lib/oracle/<OIC version>/client/lib - -Follow the usual building procedure after that and you'll get OCI8 shared -extension (i.e. oci8.so). Add it into the php.ini file like this: -extension=oci8.so -and don't forget to specify the right extension_dir for PHP to be able -to find shared extensions correctly. - -3. Installing as statically compiled extension ----------------------------------------------- -To install OCI8 as statically compiled module use the following configure lines: -a) with common Oracle Client installation -./configure --with-oci8=$ORACLE_HOME - -b) with Oracle Instant Client -./configure --with-oci8=instantclient,/path/to/instant/client/lib - -After successful compile, you don't have to add oci8.so to the php.ini, the module will -be usable without any additional actions. - -4. Installing from PECL ------------------------ -TBD diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 deleted file mode 100644 index 8cdf41bea136a..0000000000000 --- a/ext/oci8/config.m4 +++ /dev/null @@ -1,361 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_OCI_IF_DEFINED],[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$3 - AC_EGREP_CPP(yes,[ -#include <oci.h> -#if defined($1) - yes -#endif - ],[ - CPPFLAGS=$old_CPPFLAGS - $2 - ],[ - CPPFLAGS=$old_CPPFLAGS - ]) -]) - -AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[ - AC_CHECK_SIZEOF(long int, 4) - AC_MSG_CHECKING([checking if we're at 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4" ; then - AC_MSG_RESULT([no]) - TMP_OCI8_LIB_DIR=lib32 - else - AC_MSG_RESULT([yes]) - TMP_OCI8_LIB_DIR=lib - fi - - AC_MSG_CHECKING([OCI8 libraries dir]) - if test -d "$OCI8_DIR/lib" -a ! -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=lib - elif ! test -d "$OCI8_DIR/lib" -a -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=lib32 - elif test -d "$OCI8_DIR/lib" -a -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=$TMP_OCI8_LIB_DIR - else - AC_MSG_ERROR([Oracle (OCI8) required libraries not found]) - fi - AC_MSG_RESULT($OCI8_LIB_DIR) -]) - -AC_DEFUN([AC_OCI8IC_VERSION],[ - AC_MSG_CHECKING([Oracle Instant Client version]) - if test -f $PHP_OCI8_INSTANT_CLIENT/libociei.$SHLIB_SUFFIX_NAME; then - if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then - AC_MSG_ERROR([Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found]) - fi - OCI8_VERSION=10.1 - else - AC_MSG_ERROR([Oracle Instant Client library version not supported]) - fi - else - AC_MSG_ERROR([Oracle Instant Client libraries not found]) - fi - AC_MSG_RESULT([$OCI8_VERSION]) -]) - - -AC_DEFUN([AC_OCI8_VERSION],[ - AC_MSG_CHECKING([Oracle version]) - if test -s "$OCI8_DIR/orainst/unix.rgs"; then - OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$OCI8_VERSION" && OCI8_VERSION=7.3 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - OCI8_VERSION=10.1 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then - OCI8_VERSION=9.0 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then - OCI8_VERSION=8.1 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then - OCI8_VERSION=8.0 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then - if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then - OCI8_VERSION=8.0 - else - OCI8_VERSION=8.1 - fi - else - AC_MSG_ERROR(Oracle-OCI8 needed libraries not found) - fi - AC_MSG_RESULT($OCI8_VERSION) -]) - - -dnl --with-oci8=shared,instantclient,/path/to/client/dir/lib -dnl or -dnl --with-oci8=shared,/path/to/oracle/home -PHP_ARG_WITH(oci8, for Oracle (OCI8) support, -[ --with-oci8[=DIR] Include Oracle (OCI8) support. - The default DIR is ORACLE_HOME. - Use --with-oci8=instantclient,/path/to/oic/lib - to use Oracle Instant Client installation]) - -PHP_OCI8_INSTANT_CLIENT="no" - -if test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then - PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f3`" - PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f1,4`" - if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then - PHP_OCI8_INSTANT_CLIENT="yes" - fi -elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then - PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`" - PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`" - if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then - PHP_OCI8_INSTANT_CLIENT="yes" - fi -fi - -if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then - - AC_MSG_CHECKING([Oracle Install Directory]) - if test "$PHP_OCI8" = "yes"; then - OCI8_DIR=$ORACLE_HOME - else - OCI8_DIR=$PHP_OCI8 - fi - AC_MSG_RESULT($OCI8_DIR) - - AC_OCI8_CHECK_LIB_DIR($OCI8_DIR) - - if test -d "$OCI8_DIR/rdbms/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/rdbms/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public" - fi - if test -d "$OCI8_DIR/rdbms/demo"; then - PHP_ADD_INCLUDE($OCI8_DIR/rdbms/demo) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo" - fi - if test -d "$OCI8_DIR/network/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/network/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public" - fi - if test -d "$OCI8_DIR/plsql/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/plsql/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public" - fi - - if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB) - elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB) - fi - - AC_OCI8_VERSION($OCI8_DIR) - - case $OCI8_VERSION in - 8.0) - PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", OCI8_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(core4, "", OCI8_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(psa, "", OCI8_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate, - [ - AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIStmtPrepare2, - [ - AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - ;; - - 8.1) - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate, - [ - AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIStmtPrepare2, - [ - AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - dnl - dnl OCI_ATTR_STATEMENT is not available in all 8.1.x versions - dnl - PHP_OCI_IF_DEFINED(OCI_ATTR_STATEMENT, [AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])], $OCI8_INCLUDES) - ;; - - 9.0) - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) - - dnl These functions are only available in version >= 9.2 - PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate, - [ - PHP_CHECK_LIBRARY(clntsh, OCINlsCharSetNameToId, - [ - AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) - OCI8_VERSION=9.2 - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate, - [ - AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIStmtPrepare2, - [ - AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - ;; - - 10.1) - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) - AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) - AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) - AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) - AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ]) - ;; - *) - AC_MSG_ERROR([Unsupported Oracle version!]) - ;; - esac - - dnl - dnl Check if we need to add -locijdbc8 - dnl - PHP_CHECK_LIBRARY(clntsh, OCILobIsTemporary, - [ - AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - ], [ - PHP_CHECK_LIBRARY(ocijdbc8, OCILobIsTemporary, - [ - PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - ], [], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - ], [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - dnl - dnl Check if we have collections - dnl - PHP_CHECK_LIBRARY(clntsh, OCICollAssign, - [ - AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ]) - PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared) - ], - [ - PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_interface.c, $ext_shared) - ], - [ - -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD - ]) - - AC_DEFINE(HAVE_OCI8,1,[ ]) - - PHP_SUBST_OLD(OCI8_SHARED_LIBADD) - PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_VERSION) - -elif test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then - - AC_MSG_CHECKING([Oracle Instant Client directory]) - if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then -dnl Generally the Instant Client can be anywhere so the user must pass in the -dnl directory to the libraries. But on Linux we default to the most recent -dnl version in /usr/lib - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client/lib 2> /dev/null | tail -1` - if test -z "$PHP_OCI8_INSTANT_CLIENT"; then - AC_MSG_ERROR([Oracle Instant Client directory not found. Try --with-oci8=instantclient,DIR]) - fi - fi - AC_MSG_RESULT($PHP_OCI8_INSTANT_CLIENT) - - OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT - - AC_MSG_CHECKING([Oracle Instant Client SDK header directory]) - -dnl Header directory for Instant Client SDK RPM install - OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | sed -e 's!^/usr/lib/oracle/\(.*\)/client/lib[[/]]*$!/usr/include/oracle/\1/client!'` - -dnl Header directory for Instant Client SDK zip file install - OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include - -dnl Header directory for manual installation - OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | sed -e 's!\(.*\)/lib[[/]]*$!\1/include!'` - - if test -f "$OCISDKRPMINC/oci.h"; then - AC_MSG_RESULT($OCISDKRPMINC) - PHP_ADD_INCLUDE($OCISDKRPMINC) - OCI8INCDIR=$OCISDKRPMINC - elif test -f "$OCISDKZIPINC/oci.h"; then - AC_MSG_RESULT($OCISDKZIPINC) - PHP_ADD_INCLUDE($OCISDKZIPINC) - OCI8INCDIR=$OCISDKZIPINC - elif test -f "$OCISDKMANINC/oci.h"; then - AC_MSG_RESULT($OCISDKMANINC) - PHP_ADD_INCLUDE($OCISDKMANINC) - OCI8INCDIR=$OCISDKMANINC - else - AC_MSG_ERROR([Oracle Instant Client SDK header files not found]) - fi - - OCISYSLIBLIST=`echo "$OCI8INCDIR" | sed -e 's!\(.*\)/include$!\1/demo/sysliblist!'` - if test -f "$OCISYSLIBLIST"; then - PHP_EVAL_LIBLINE(`cat $OCISYSLIBLIST`, OCI8_SYSLIB) - fi - - AC_OCI8IC_VERSION($PHP_OCI8_INSTANT_CLIENT) - case $OCI8_VERSION in - 10.1) - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD) - ;; - - *) - AC_MSG_ERROR([Unsupported Oracle Instant Client version]) - ;; - esac - - AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[ ]) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) - AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) - AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) - AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) - AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ]) - - PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared) - AC_DEFINE(HAVE_OCI8,1,[ ]) - - PHP_SUBST_OLD(OCI8_SHARED_LIBADD) - PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_VERSION) - -fi diff --git a/ext/oci8/config.w32 b/ext/oci8/config.w32 deleted file mode 100644 index 7b31e448592ed..0000000000000 --- a/ext/oci8/config.w32 +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("oci8", "OCI8 support", "no"); - -if (PHP_OCI8 != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", PHP_PHP_BUILD + "\\include\\instantclient;" + PHP_OCI8) && - CHECK_LIB("oci.lib", "oci8", PHP_PHP_BUILD + "\\lib\\instantclient;" + PHP_OCI8) - - ) { - EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c'); - - AC_DEFINE('HAVE_OCI8_TEMP_LOB', 1); - AC_DEFINE('HAVE_OCI8', 1); - AC_DEFINE('HAVE_OCI8_ATTR_STATEMENT', 1); - AC_DEFINE('PHP_OCI8_HAVE_COLLECTIONS', 1); - - } else { - WARNING("oci8 not enabled; libraries and headers not found"); - } -} - diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c deleted file mode 100644 index 89ef83d84475d..0000000000000 --- a/ext/oci8/oci8.c +++ /dev/null @@ -1,1674 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | Maxim Maletsky <maxim@maxim.cx> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -/* TODO - * - * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() with OCI_ATTR_LOBEMPTY - * - * get OCI_ATTR_CHARSET_ID attr of column to detect UTF string and multiply buffer in 4 times - * - * */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "ext/standard/php_smart_str.h" - -#if HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -ZEND_DECLARE_MODULE_GLOBALS(oci) - -/* True globals, no need for thread safety */ -int le_connection; -int le_pconnection; -int le_statement; -int le_descriptor; -#ifdef PHP_OCI8_HAVE_COLLECTIONS -int le_collection; -#endif - -zend_class_entry *oci_lob_class_entry_ptr; -#ifdef PHP_OCI8_HAVE_COLLECTIONS -zend_class_entry *oci_coll_class_entry_ptr; -#endif - -#ifndef SQLT_BFILEE -#define SQLT_BFILEE 114 -#endif -#ifndef SQLT_CFILEE -#define SQLT_CFILEE 115 -#endif - -#define PHP_OCI_ERRBUF_LEN 512 - -#if ZEND_MODULE_API_NO > 20020429 -#define ONUPDATELONGFUNC OnUpdateLong -#else -#define ONUPDATELONGFUNC OnUpdateInt -#endif - -/* static protos {{{ */ -static void php_oci_connection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); -static void php_oci_pconnection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); -static void php_oci_statement_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); -static void php_oci_descriptor_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); -static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); - -static int php_oci_persistent_helper(list_entry *le TSRMLS_DC); -static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC); -static int php_oci_connection_status(php_oci_connection * TSRMLS_DC); -static int php_oci_connection_close(php_oci_connection * TSRMLS_DC); -/* }}} */ - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_OCI8 -ZEND_GET_MODULE(oci8) -#endif /* COMPILE_DL */ -/* }}} */ - -#ifdef ZEND_ENGINE_2 -ZEND_BEGIN_ARG_INFO(oci_second_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(oci_third_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO() -#else -static unsigned char oci_second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE }; -static unsigned char oci_third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; -#endif - -/* {{{ extension function prototypes -*/ -PHP_FUNCTION(oci_bind_by_name); -PHP_FUNCTION(oci_define_by_name); -PHP_FUNCTION(oci_field_is_null); -PHP_FUNCTION(oci_field_name); -PHP_FUNCTION(oci_field_size); -PHP_FUNCTION(oci_field_scale); -PHP_FUNCTION(oci_field_precision); -PHP_FUNCTION(oci_field_type); -PHP_FUNCTION(oci_field_type_raw); -PHP_FUNCTION(oci_execute); -PHP_FUNCTION(oci_fetch); -PHP_FUNCTION(oci_cancel); -PHP_FUNCTION(ocifetchinto); -PHP_FUNCTION(oci_fetch_object); -PHP_FUNCTION(oci_fetch_row); -PHP_FUNCTION(oci_fetch_assoc); -PHP_FUNCTION(oci_fetch_array); -PHP_FUNCTION(ocifetchstatement); -PHP_FUNCTION(oci_fetch_all); -PHP_FUNCTION(oci_free_statement); -PHP_FUNCTION(oci_internal_debug); -PHP_FUNCTION(oci_close); -PHP_FUNCTION(oci_connect); -PHP_FUNCTION(oci_new_connect); -PHP_FUNCTION(oci_pconnect); -PHP_FUNCTION(oci_error); -PHP_FUNCTION(oci_free_descriptor); -PHP_FUNCTION(oci_commit); -PHP_FUNCTION(oci_rollback); -PHP_FUNCTION(oci_new_descriptor); -PHP_FUNCTION(oci_num_fields); -PHP_FUNCTION(oci_parse); -PHP_FUNCTION(oci_new_cursor); -PHP_FUNCTION(oci_result); -PHP_FUNCTION(oci_server_version); -PHP_FUNCTION(oci_statement_type); -PHP_FUNCTION(oci_num_rows); -PHP_FUNCTION(oci_set_prefetch); -PHP_FUNCTION(oci_password_change); -PHP_FUNCTION(oci_lob_save); -PHP_FUNCTION(oci_lob_import); -PHP_FUNCTION(oci_lob_export); -PHP_FUNCTION(oci_lob_load); -PHP_FUNCTION(oci_lob_tell); -PHP_FUNCTION(oci_lob_write); -PHP_FUNCTION(oci_lob_append); -PHP_FUNCTION(oci_lob_copy); -PHP_FUNCTION(oci_lob_truncate); -PHP_FUNCTION(oci_lob_erase); -PHP_FUNCTION(oci_lob_flush); -PHP_FUNCTION(ocisetbufferinglob); -PHP_FUNCTION(ocigetbufferinglob); -PHP_FUNCTION(oci_lob_is_equal); -PHP_FUNCTION(oci_lob_rewind); -PHP_FUNCTION(oci_lob_read); -PHP_FUNCTION(oci_lob_eof); -PHP_FUNCTION(oci_lob_seek); -PHP_FUNCTION(oci_lob_size); -#ifdef HAVE_OCI8_TEMP_LOB -PHP_FUNCTION(oci_lob_write_temporary); -PHP_FUNCTION(oci_lob_close); -#endif -#ifdef PHP_OCI8_HAVE_COLLECTIONS -PHP_FUNCTION(oci_new_collection); -PHP_FUNCTION(oci_free_collection); -PHP_FUNCTION(oci_collection_append); -PHP_FUNCTION(oci_collection_element_get); -PHP_FUNCTION(oci_collection_element_assign); -PHP_FUNCTION(oci_collection_assign); -PHP_FUNCTION(oci_collection_size); -PHP_FUNCTION(oci_collection_max); -PHP_FUNCTION(oci_collection_trim); -#endif -/* }}} */ - -/* {{{ extension definition structures -*/ -static zend_function_entry php_oci_functions[] = { - PHP_FE(oci_define_by_name, oci_third_arg_force_ref) - PHP_FE(oci_bind_by_name, oci_third_arg_force_ref) - PHP_FE(oci_field_is_null, NULL) - PHP_FE(oci_field_name, NULL) - PHP_FE(oci_field_size, NULL) - PHP_FE(oci_field_scale, NULL) - PHP_FE(oci_field_precision, NULL) - PHP_FE(oci_field_type, NULL) - PHP_FE(oci_field_type_raw, NULL) - PHP_FE(oci_execute, NULL) - PHP_FE(oci_cancel, NULL) - PHP_FE(oci_fetch, NULL) - PHP_FE(oci_fetch_object, NULL) - PHP_FE(oci_fetch_row, NULL) - PHP_FE(oci_fetch_assoc, NULL) - PHP_FE(oci_fetch_array, NULL) - PHP_FE(ocifetchinto, oci_second_arg_force_ref) - PHP_FE(oci_fetch_all, oci_second_arg_force_ref) - PHP_FE(oci_free_statement, NULL) - PHP_FE(oci_internal_debug, NULL) - PHP_FE(oci_num_fields, NULL) - PHP_FE(oci_parse, NULL) - PHP_FE(oci_new_cursor, NULL) - PHP_FE(oci_result, NULL) - PHP_FE(oci_server_version, NULL) - PHP_FE(oci_statement_type, NULL) - PHP_FE(oci_num_rows, NULL) - PHP_FE(oci_close, NULL) - PHP_FE(oci_connect, NULL) - PHP_FE(oci_new_connect, NULL) - PHP_FE(oci_pconnect, NULL) - PHP_FE(oci_error, NULL) - PHP_FE(oci_free_descriptor, NULL) - PHP_FE(oci_lob_save, NULL) - PHP_FE(oci_lob_import, NULL) - PHP_FE(oci_lob_size, NULL) - PHP_FE(oci_lob_load, NULL) - PHP_FE(oci_lob_read, NULL) - PHP_FE(oci_lob_eof, NULL) - PHP_FE(oci_lob_tell, NULL) - PHP_FE(oci_lob_truncate, NULL) - PHP_FE(oci_lob_erase, NULL) - PHP_FE(oci_lob_flush, NULL) - PHP_FE(ocisetbufferinglob, NULL) - PHP_FE(ocigetbufferinglob, NULL) - PHP_FE(oci_lob_is_equal, NULL) - PHP_FE(oci_lob_rewind, NULL) - PHP_FE(oci_lob_write, NULL) - PHP_FE(oci_lob_append, NULL) - PHP_FE(oci_lob_copy, NULL) - PHP_FE(oci_lob_export, NULL) - PHP_FE(oci_commit, NULL) - PHP_FE(oci_rollback, NULL) - PHP_FE(oci_new_descriptor, NULL) - PHP_FE(oci_set_prefetch, NULL) - PHP_FE(oci_password_change, NULL) -#ifdef PHP_OCI8_HAVE_COLLECTIONS - PHP_FE(oci_free_collection, NULL) - PHP_FE(oci_collection_append, NULL) - PHP_FE(oci_collection_element_get, NULL) - PHP_FE(oci_collection_element_assign, NULL) - PHP_FE(oci_collection_assign, NULL) - PHP_FE(oci_collection_size, NULL) - PHP_FE(oci_collection_max, NULL) - PHP_FE(oci_collection_trim, NULL) - PHP_FE(oci_new_collection, NULL) -#endif - - PHP_FALIAS(oci_free_cursor, oci_free_statement, NULL) - PHP_FALIAS(ocifreecursor, oci_free_statement, NULL) - PHP_FALIAS(ocibindbyname, oci_bind_by_name, oci_third_arg_force_ref) - PHP_FALIAS(ocidefinebyname, oci_define_by_name, oci_third_arg_force_ref) - PHP_FALIAS(ocicolumnisnull, oci_field_is_null, NULL) - PHP_FALIAS(ocicolumnname, oci_field_name, NULL) - PHP_FALIAS(ocicolumnsize, oci_field_size, NULL) - PHP_FALIAS(ocicolumnscale, oci_field_scale, NULL) - PHP_FALIAS(ocicolumnprecision, oci_field_precision, NULL) - PHP_FALIAS(ocicolumntype, oci_field_type, NULL) - PHP_FALIAS(ocicolumntyperaw, oci_field_type_raw, NULL) - PHP_FALIAS(ociexecute, oci_execute, NULL) - PHP_FALIAS(ocicancel, oci_cancel, NULL) - PHP_FALIAS(ocifetch, oci_fetch, NULL) - PHP_FALIAS(ocifetchstatement, oci_fetch_all, oci_second_arg_force_ref) - PHP_FALIAS(ocifreestatement, oci_free_statement, NULL) - PHP_FALIAS(ociinternaldebug, oci_internal_debug, NULL) - PHP_FALIAS(ocinumcols, oci_num_fields, NULL) - PHP_FALIAS(ociparse, oci_parse, NULL) - PHP_FALIAS(ocinewcursor, oci_new_cursor, NULL) - PHP_FALIAS(ociresult, oci_result, NULL) - PHP_FALIAS(ociserverversion, oci_server_version, NULL) - PHP_FALIAS(ocistatementtype, oci_statement_type, NULL) - PHP_FALIAS(ocirowcount, oci_num_rows, NULL) - PHP_FALIAS(ocilogoff, oci_close, NULL) - PHP_FALIAS(ocilogon, oci_connect, NULL) - PHP_FALIAS(ocinlogon, oci_new_connect, NULL) - PHP_FALIAS(ociplogon, oci_pconnect, NULL) - PHP_FALIAS(ocierror, oci_error, NULL) - PHP_FALIAS(ocifreedesc, oci_free_descriptor, NULL) - PHP_FALIAS(ocisavelob, oci_lob_save, NULL) - PHP_FALIAS(ocisavelobfile, oci_lob_import, NULL) - PHP_FALIAS(ociwritelobtofile, oci_lob_export, NULL) - PHP_FALIAS(ociloadlob, oci_lob_load, NULL) - PHP_FALIAS(ocicommit, oci_commit, NULL) - PHP_FALIAS(ocirollback, oci_rollback, NULL) - PHP_FALIAS(ocinewdescriptor, oci_new_descriptor, NULL) - PHP_FALIAS(ocisetprefetch, oci_set_prefetch, NULL) - PHP_FALIAS(ocipasswordchange, oci_password_change, NULL) -#ifdef PHP_OCI8_HAVE_COLLECTIONS - PHP_FALIAS(ocifreecollection, oci_free_collection, NULL) - PHP_FALIAS(ocinewcollection, oci_new_collection, NULL) - PHP_FALIAS(ocicollappend, oci_collection_append, NULL) - PHP_FALIAS(ocicollgetelem, oci_collection_element_get, NULL) - PHP_FALIAS(ocicollassignelem, oci_collection_element_assign, NULL) - PHP_FALIAS(ocicollsize, oci_collection_size, NULL) - PHP_FALIAS(ocicollmax, oci_collection_max, NULL) - PHP_FALIAS(ocicolltrim, oci_collection_trim, NULL) -#endif - {NULL,NULL,NULL} -}; - -static zend_function_entry php_oci_lob_class_functions[] = { - PHP_FALIAS(load, oci_lob_load, NULL) - PHP_FALIAS(tell, oci_lob_tell, NULL) - PHP_FALIAS(truncate, oci_lob_truncate, NULL) - PHP_FALIAS(erase, oci_lob_erase, NULL) - PHP_FALIAS(flush, oci_lob_flush, NULL) - PHP_FALIAS(setbuffering,ocisetbufferinglob, NULL) - PHP_FALIAS(getbuffering,ocigetbufferinglob, NULL) - PHP_FALIAS(rewind, oci_lob_rewind, NULL) - PHP_FALIAS(read, oci_lob_read, NULL) - PHP_FALIAS(eof, oci_lob_eof, NULL) - PHP_FALIAS(seek, oci_lob_seek, NULL) - PHP_FALIAS(write, oci_lob_write, NULL) - PHP_FALIAS(append, oci_lob_append, NULL) - PHP_FALIAS(size, oci_lob_size, NULL) - PHP_FALIAS(writetofile, oci_lob_export, NULL) - PHP_FALIAS(export, oci_lob_export, NULL) - PHP_FALIAS(import, oci_lob_import, NULL) -#ifdef HAVE_OCI8_TEMP_LOB - PHP_FALIAS(writetemporary, oci_lob_write_temporary, NULL) - PHP_FALIAS(close, oci_lob_close, NULL) -#endif - PHP_FALIAS(save, oci_lob_save, NULL) - PHP_FALIAS(savefile, oci_lob_import, NULL) - PHP_FALIAS(free, oci_free_descriptor, NULL) - {NULL,NULL,NULL} -}; - -#ifdef PHP_OCI8_HAVE_COLLECTIONS -static zend_function_entry php_oci_coll_class_functions[] = { - PHP_FALIAS(append, oci_collection_append, NULL) - PHP_FALIAS(getelem, oci_collection_element_get, NULL) - PHP_FALIAS(assignelem, oci_collection_element_assign, NULL) - PHP_FALIAS(assign, oci_collection_assign, NULL) - PHP_FALIAS(size, oci_collection_size, NULL) - PHP_FALIAS(max, oci_collection_max, NULL) - PHP_FALIAS(trim, oci_collection_trim, NULL) - PHP_FALIAS(free, oci_free_collection, NULL) - {NULL,NULL,NULL} -}; -#endif - -zend_module_entry oci8_module_entry = { - STANDARD_MODULE_HEADER, - "oci8", /* extension name */ - php_oci_functions, /* extension function list */ - PHP_MINIT(oci), /* extension-wide startup function */ - PHP_MSHUTDOWN(oci), /* extension-wide shutdown function */ - PHP_RINIT(oci), /* per-request startup function */ - PHP_RSHUTDOWN(oci), /* per-request shutdown function */ - PHP_MINFO(oci), /* information function */ - "1.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("oci8.max_persistent", "-1", PHP_INI_SYSTEM, ONUPDATELONGFUNC, max_persistent, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY("oci8.persistent_timeout", "-1", PHP_INI_SYSTEM, ONUPDATELONGFUNC, persistent_timeout, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY("oci8.ping_interval", "60", PHP_INI_SYSTEM, ONUPDATELONGFUNC, ping_interval, zend_oci_globals, oci_globals) - STD_PHP_INI_BOOLEAN("oci8.privileged_connect", "0", PHP_INI_SYSTEM, OnUpdateBool, privileged_connect, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY("oci8.statement_cache_size", "20", PHP_INI_SYSTEM, ONUPDATELONGFUNC, statement_cache_size, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY("oci8.default_prefetch", "10", PHP_INI_SYSTEM, ONUPDATELONGFUNC, default_prefetch, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics, zend_oci_globals, oci_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ startup, shutdown and info functions -*/ - -/* {{{ php_oci_init_global_handles() - Initialize global handles only when they are needed -*/ -static void php_oci_init_global_handles(TSRMLS_D) -{ - sword errcode; - sb4 error_code = 0; - text tmp_buf[PHP_OCI_ERRBUF_LEN]; - - errcode = OCIEnvInit (&OCI_G(env), OCI_DEFAULT, 0, NULL); - - if (errcode == OCI_ERROR) { - goto oci_error; - } - - errcode = OCIHandleAlloc (OCI_G(env), (dvoid **)&OCI_G(err), OCI_HTYPE_ERROR, 0, NULL); - - if (errcode == OCI_ERROR || errcode == OCI_SUCCESS_WITH_INFO) { - goto oci_error; - } - - return; - -oci_error: - - OCIErrorGet(OCI_G(env), (ub4)1, NULL, &error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR); - - if (error_code) { - int tmp_buf_len = strlen(tmp_buf); - - if (tmp_buf[tmp_buf_len - 1] == '\n') { - tmp_buf[tmp_buf_len - 1] = '\0'; - } - - if (errcode != OCI_SUCCESS_WITH_INFO) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_ERROR: %s", tmp_buf); - - OCIHandleFree((dvoid *) OCI_G(env), OCI_HTYPE_ENV); - - OCI_G(env) = NULL; - OCI_G(err) = NULL; - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", tmp_buf); - } - } -} /* }}} */ - -/* {{{ php_oci_cleanup_global_handles() - Free global handles (if they were initialized before) -*/ -static void php_oci_cleanup_global_handles(TSRMLS_D) -{ - if (OCI_G(err)) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) OCI_G(err), OCI_HTYPE_ENV)); - OCI_G(err) = NULL; - } - - if (OCI_G(env)) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) OCI_G(env), OCI_HTYPE_ENV)); - OCI_G(env) = NULL; - } -} /* }}} */ - -/* {{{ php_oci_init_globals() - Zerofill globals during module init -*/ -static void php_oci_init_globals(zend_oci_globals *oci_globals TSRMLS_DC) -{ - memset(oci_globals, 0, sizeof(zend_oci_globals)); -} -/* }}} */ - -PHP_MINIT_FUNCTION(oci) -{ - zend_class_entry oci_lob_class_entry; -#ifdef PHP_OCI8_HAVE_COLLECTIONS - zend_class_entry oci_coll_class_entry; -#endif - -#ifdef PHP_OCI8_HAVE_COLLECTIONS -#define PHP_OCI_INIT_MODE_TMP OCI_DEFAULT | OCI_OBJECT -#else -#define PHP_OCI_INIT_MODE_TMP OCI_DEFAULT -#endif - -#ifdef ZTS -#define PHP_OCI_INIT_MODE PHP_OCI_INIT_MODE_TMP | OCI_THREADED -#else -#define PHP_OCI_INIT_MODE PHP_OCI_INIT_MODE_TMP -#endif - -#if !HAVE_OCI_ENV_CREATE - OCIInitialize(PHP_OCI_INIT_MODE, NULL, NULL, NULL, NULL); -#endif - - ZEND_INIT_MODULE_GLOBALS(oci, php_oci_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number); - le_connection = zend_register_list_destructors_ex(php_oci_connection_list_dtor, NULL, "oci8 connection", module_number); - le_pconnection = zend_register_list_destructors_ex(NULL, php_oci_pconnection_list_dtor, "oci8 persistent connection", module_number); - le_descriptor = zend_register_list_destructors_ex(php_oci_descriptor_list_dtor, NULL, "oci8 descriptor", module_number); -#ifdef PHP_OCI8_HAVE_COLLECTIONS - le_collection = zend_register_list_destructors_ex(php_oci_collection_list_dtor, NULL, "oci8 collection", module_number); -#endif - - INIT_CLASS_ENTRY(oci_lob_class_entry, "OCI-Lob", php_oci_lob_class_functions); -#ifdef PHP_OCI8_HAVE_COLLECTIONS - INIT_CLASS_ENTRY(oci_coll_class_entry, "OCI-Collection", php_oci_coll_class_functions); -#endif - - oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry TSRMLS_CC); -#ifdef PHP_OCI8_HAVE_COLLECTIONS - oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry TSRMLS_CC); -#endif - -/* thies@thieso.net 990203 i do not think that we will need all of them - just in here for completeness for now! */ - REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SYSOPER",OCI_SYSOPER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SYSDBA",OCI_SYSDBA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DESCRIBE_ONLY",OCI_DESCRIBE_ONLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_COMMIT_ON_SUCCESS",OCI_COMMIT_ON_SUCCESS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_EXACT_FETCH",OCI_EXACT_FETCH, CONST_CS | CONST_PERSISTENT); - -/* for $LOB->seek() */ - REGISTER_LONG_CONSTANT("OCI_SEEK_SET",PHP_OCI_SEEK_SET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SEEK_CUR",PHP_OCI_SEEK_CUR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SEEK_END",PHP_OCI_SEEK_END, CONST_CS | CONST_PERSISTENT); - -/* for $LOB->flush() */ - REGISTER_LONG_CONSTANT("OCI_LOB_BUFFER_FREE",OCI_LOB_BUFFER_FREE, CONST_CS | CONST_PERSISTENT); - -/* for OCIBindByName (real "oci" names + short "php" names*/ - REGISTER_LONG_CONSTANT("SQLT_BFILEE",SQLT_BFILEE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_CFILEE",SQLT_CFILEE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_CLOB",SQLT_CLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BLOB",SQLT_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_RDD",SQLT_RDD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_INT",SQLT_INT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_NUM",SQLT_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_RSET",SQLT_RSET, CONST_CS | CONST_PERSISTENT); - -#ifdef PHP_OCI8_HAVE_COLLECTIONS - REGISTER_LONG_CONSTANT("OCI_B_NTY",SQLT_NTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_NTY",SQLT_NTY, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("OCI_SYSDATE","SYSDATE", CONST_CS | CONST_PERSISTENT); -#endif - - REGISTER_LONG_CONSTANT("OCI_B_BFILE",SQLT_BFILEE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CFILEE",SQLT_CFILEE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CLOB",SQLT_CLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_BLOB",SQLT_BLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_ROWID",SQLT_RDD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CURSOR",SQLT_RSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_BIN",SQLT_BIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_INT",SQLT_INT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_NUM",SQLT_NUM, CONST_CS | CONST_PERSISTENT); - -/* for OCIFetchStatement */ - REGISTER_LONG_CONSTANT("OCI_FETCHSTATEMENT_BY_COLUMN", PHP_OCI_FETCHSTATEMENT_BY_COLUMN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FETCHSTATEMENT_BY_ROW", PHP_OCI_FETCHSTATEMENT_BY_ROW, CONST_CS | CONST_PERSISTENT); - -/* for OCIFetchInto & OCIResult */ - REGISTER_LONG_CONSTANT("OCI_ASSOC",PHP_OCI_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_NUM",PHP_OCI_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_BOTH",PHP_OCI_BOTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_RETURN_NULLS",PHP_OCI_RETURN_NULLS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_RETURN_LOBS",PHP_OCI_RETURN_LOBS, CONST_CS | CONST_PERSISTENT); - -/* for OCINewDescriptor (real "oci" names + short "php" names*/ - REGISTER_LONG_CONSTANT("OCI_DTYPE_FILE",OCI_DTYPE_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DTYPE_LOB",OCI_DTYPE_LOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DTYPE_ROWID",OCI_DTYPE_ROWID, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("OCI_D_FILE",OCI_DTYPE_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_D_LOB",OCI_DTYPE_LOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_D_ROWID",OCI_DTYPE_ROWID, CONST_CS | CONST_PERSISTENT); - -/* for OCIWriteTemporaryLob */ -#ifdef HAVE_OCI8_TEMP_LOB - REGISTER_LONG_CONSTANT("OCI_TEMP_CLOB",OCI_TEMP_CLOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_TEMP_BLOB",OCI_TEMP_BLOB, CONST_CS | CONST_PERSISTENT); -#endif - - return SUCCESS; -} - -/* ----------------------------------------------------------------- */ - -PHP_RINIT_FUNCTION(oci) -{ - OCI_G(debug_mode) = 0; /* start "fresh" */ - OCI_G(num_links) = OCI_G(num_persistent); - OCI_G(errcode) = 0; - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(oci) -{ - OCI_G(shutdown) = 1; - - UNREGISTER_INI_ENTRIES(); - -#ifndef ZTS - php_oci_cleanup_global_handles(TSRMLS_C); -#endif - -#if !HAVE_OCI_ENV_CREATE - OCITerminate(OCI_DEFAULT); -#endif - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(oci) -{ - /* check persistent connections and do the necessary actions if needed */ - zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC); - -#ifdef ZTS - php_oci_cleanup_global_handles(TSRMLS_C); -#endif - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(oci) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_row(2, "OCI8 Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision$"); - - sprintf(buf, "%ld", OCI_G(num_persistent)); - php_info_print_table_row(2, "Active Persistent Connections", buf); - sprintf(buf, "%ld", OCI_G(num_links)); - php_info_print_table_row(2, "Active Connections", buf); - -#if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT) - php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION ); - php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR ); - php_info_print_table_row(2, "Libraries Used", PHP_OCI8_SHARED_LIBADD ); -#endif - -#ifdef HAVE_OCI8_TEMP_LOB - php_info_print_table_row(2, "Temporary Lob support", "enabled" ); -#else - php_info_print_table_row(2, "Temporary Lob support", "disabled" ); -#endif - -#ifdef PHP_OCI8_HAVE_COLLECTIONS - php_info_print_table_row(2, "Collections support", "enabled" ); -#else - php_info_print_table_row(2, "Collections support", "disabled" ); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* list destructors {{{ */ - -/* {{{ php_oci_connection_list_dtor() - Non-persistent connection destructor */ -static void php_oci_connection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) -{ - php_oci_connection *connection = (php_oci_connection *)entry->ptr; - php_oci_connection_close(connection TSRMLS_CC); - OCI_G(num_links)--; -} /* }}} */ - -/* {{{ php_oci_pconnection_list_dtor() - Persistent connection destructor */ -static void php_oci_pconnection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) -{ - php_oci_connection *connection = (php_oci_connection *)entry->ptr; - php_oci_connection_close(connection TSRMLS_CC); - OCI_G(num_persistent)--; -} /* }}} */ - -/* {{{ php_oci_statement_list_dtor() - Statement destructor */ -static void php_oci_statement_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) -{ - php_oci_statement *statement = (php_oci_statement *)entry->ptr; - php_oci_statement_free(statement TSRMLS_CC); -} /* }}} */ - -/* {{{ php_oci_descriptor_list_dtor() - Descriptor destructor */ -static void php_oci_descriptor_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) -{ - php_oci_descriptor *descriptor = (php_oci_descriptor *)entry->ptr; - php_oci_lob_free(descriptor TSRMLS_CC); -} /* }}} */ - -/* {{{ php_oci_collection_list_dtor() - Collection destructor */ -static void php_oci_collection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) -{ - php_oci_collection *collection = (php_oci_collection *)entry->ptr; - php_oci_collection_close(collection TSRMLS_CC); -} /* }}} */ - -/* }}} */ - -/* hash destructors {{{ */ - -/* {{{ php_oci_define_hash_dtor() - Define hash destructor */ -void php_oci_define_hash_dtor(void *data) -{ - php_oci_define *define = (php_oci_define *) data; - - zval_ptr_dtor(&define->zval); - - if (define->name) { - efree(define->name); - define->name = NULL; - } -} -/* }}} */ - -/* {{{ php_oci_bind_hash_dtor() - Bind hash destructor */ -void php_oci_bind_hash_dtor(void *data) -{ - php_oci_bind *bind = (php_oci_bind *) data; - - zval_ptr_dtor(&bind->zval); -} -/* }}} */ - -/* {{{ php_oci_column_hash_dtor() - Column hash destructor */ -void php_oci_column_hash_dtor(void *data) -{ - php_oci_out_column *column = (php_oci_out_column *) data; - TSRMLS_FETCH(); - - if (column->stmtid) { - zend_list_delete(column->stmtid); - } - - if (column->is_descr) { - zend_list_delete(column->descid); - } - - if (column->data) { - efree(column->data); - } - - if (column->name) { - efree(column->name); - } -} -/* }}} */ - -/* {{{ php_oci_descriptor_flush_hash_dtor() - Flush descriptors on commit */ -void php_oci_descriptor_flush_hash_dtor(void *data) -{ - php_oci_descriptor *descriptor = *(php_oci_descriptor **)data; - TSRMLS_FETCH(); - - if (descriptor->buffering == PHP_OCI_LOB_BUFFER_USED && (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE)) { - php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC); - descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; - } -} -/* }}} */ - -/* }}} */ - -/* {{{ php_oci_error() - Fetch & print out error message if we get an error */ -sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC) -{ - text *errbuf = (text *)NULL; - sb4 errcode = 0; - - switch (status) { - case OCI_SUCCESS: - break; - case OCI_SUCCESS_WITH_INFO: - errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf); - efree(errbuf); - break; - case OCI_NEED_DATA: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NEED_DATA"); - break; - case OCI_NO_DATA: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NO_DATA"); - break; - case OCI_ERROR: - errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf); - efree(errbuf); - break; - case OCI_INVALID_HANDLE: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_INVALID_HANDLE"); - break; - case OCI_STILL_EXECUTING: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_STILL_EXECUTING"); - break; - case OCI_CONTINUE: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CONTINUE"); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", status); - break; - } - return errcode; -} -/* }}} */ - -/* {{{ php_oci_fetch_errmsg() - Fetch error message into the buffer from the error handle provided */ -sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC) -{ - sb4 error_code = 0; - text tmp_buf[PHP_OCI_ERRBUF_LEN]; - - tmp_buf[0] = '\0'; - - PHP_OCI_CALL(OCIErrorGet, (error_handle, (ub4)1, NULL, &error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR)); - - if (error_code) { - int tmp_buf_len = strlen(tmp_buf); - - if (tmp_buf[tmp_buf_len - 1] == '\n') { - tmp_buf[tmp_buf_len - 1] = '\0'; - } - if (error_buf) { - *error_buf = NULL; - *error_buf = estrndup(tmp_buf, tmp_buf_len + 1); - } - } - return error_code; -} /* }}} */ - -#ifdef HAVE_OCI8_ATTR_STATEMENT -/* {{{ php_oci_fetch_sqltext_offset() - Compute offset in the SQL statement */ -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC) -{ - *sqltext = NULL; - *error_offset = 0; - - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - return 1; - } - - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, OCI_ATTR_PARSE_ERROR_OFFSET, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ -#endif - -/* {{{ php_oci_do_connect() - Connect wrapper */ -void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive) -{ - php_oci_connection *connection; - char *username, *password; - char *dbname = NULL, *charset = NULL; - int username_len = 0, password_len = 0; - int dbname_len = 0, charset_len = 0; - long session_mode = OCI_DEFAULT; - - /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) { - return; - } - - if (!charset_len) { - charset = NULL; - } - - connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC); - - if (!connection) { - RETURN_FALSE; - } - RETURN_RESOURCE(connection->rsrc_id); - -} /* }}} */ - -/* {{{ php_oci_do_connect_ex() - * The real connect function. Allocates all the resources needed, establishes the connection and returns the result handle (or NULL) */ -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) -{ - list_entry *le; - list_entry new_le; - php_oci_connection *connection = NULL; - smart_str hashed_details = {0}; - time_t timestamp; -#if HAVE_OCI_ENV_NLS_CREATE - ub2 charsetid = 0; -#endif - - switch (session_mode) { - case OCI_DEFAULT: - break; - case OCI_SYSOPER: - case OCI_SYSDBA: - if (!OCI_G(privileged_connect)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA"); - return NULL; - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode); - return NULL; - break; - } - - smart_str_appendl_ex(&hashed_details, "oci8___", sizeof("oci8___") - 1, 0); - smart_str_appendl_ex(&hashed_details, username, username_len, 0); - smart_str_appendl_ex(&hashed_details, "__", sizeof("__") - 1, 0); - if (dbname) { - smart_str_appendl_ex(&hashed_details, dbname, dbname_len, 0); - } - smart_str_appendl_ex(&hashed_details, "__", sizeof("__") - 1, 0); - -#if HAVE_OCI_ENV_NLS_CREATE - if (charset && *charset) { - smart_str_appends_ex(&hashed_details, charset, 1); - } - else { - size_t rsize; - - PHP_OCI_CALL(OCINlsEnvironmentVariableGet, (&charsetid, 2, OCI_NLS_CHARSET_ID, 0, &rsize)); - smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); - } -#else - if (charset && *charset) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Your version of Oracle Client doesn't support setting the charset; bad or no charset conversions may result"); - } -#endif - - timestamp = time(NULL); - - smart_str_append_unsigned_ex(&hashed_details, session_mode, 0); - smart_str_0(&hashed_details); - - /* Initialize global handles if the weren't initialized before */ - - if (OCI_G(env) == NULL) { - php_oci_init_global_handles(TSRMLS_C); - } - - if (!exclusive && !new_password) { - - if (persistent && zend_hash_find(&EG(persistent_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) { - /* found */ - if (le->type == le_pconnection) { - connection = (php_oci_connection *)le->ptr; - } - } - else if (!persistent && zend_hash_find(&EG(regular_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) { - if (le->type == le_index_ptr) { - connection = (php_oci_connection *)le->ptr; - } - } - - if (connection) { - if (connection->is_open) { - /* found an open connection. now ping it */ - if (connection->is_persistent) { - /* check connection liveness in the following order: - * 1) always check OCI_ATTR_SERVER_STATUS - * 2) see if it's time to ping it - * 3) ping it if needed - * */ - if (php_oci_connection_status(connection TSRMLS_CC)) { - /* only ping if: - * 1) next_ping > 0, which means that ping_interval is not -1 (aka "Off") - * 2) current_timestamp > next_ping, which means "it's time to check if it's still alive" - * */ - if ( (connection->next_ping > 0) && (timestamp > connection->next_ping) && !php_oci_connection_ping(connection TSRMLS_CC)) { - /* server died */ - } - else { - /* okay, the connection is open and the server is still alive */ - connection->used_this_request = 1; - smart_str_free_ex(&hashed_details, 0); - connection->rsrc_id = zend_list_insert(connection, le_pconnection); - return connection; - } - } - /* server died */ - zend_hash_del(&EG(persistent_list), hashed_details.c, hashed_details.len+1); - php_oci_connection_close(connection TSRMLS_CC); - connection = NULL; - goto open; - } - else { - /* we do not ping non-persistent connections */ - smart_str_free_ex(&hashed_details, 0); - zend_list_addref(connection->rsrc_id); - return connection; - } - } else { - zend_hash_del(&EG(regular_list), hashed_details.c, hashed_details.len+1); - connection = NULL; - goto open; - } - } - else { - /* found something, but it's not a connection, delete it */ - if (persistent) { - zend_hash_del(&EG(persistent_list), hashed_details.c, hashed_details.len+1); - } - else { - zend_hash_del(&EG(regular_list), hashed_details.c, hashed_details.len+1); - } - } - } -open: - if (persistent) { - zend_bool alloc_non_persistent = 0; - - if (OCI_G(max_persistent)!=-1 && OCI_G(num_persistent)>=OCI_G(max_persistent)) { - /* try to find an idle connection and kill it */ - zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC); - - if (OCI_G(max_persistent)!=-1 && OCI_G(num_persistent)>=OCI_G(max_persistent)) { - /* all persistent connactions are in use, fallback to non-persistent connection creation */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%ld)", OCI_G(num_persistent)); - alloc_non_persistent = 1; - } - } - - if (alloc_non_persistent) { - connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); - connection->hash_key = estrndup(hashed_details.c, hashed_details.len+1); - connection->is_persistent = 0; - } - else { - connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection)); - connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len); - connection->is_persistent = 1; - } - } - else { - connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); - connection->hash_key = estrndup(hashed_details.c, hashed_details.len+1); - connection->is_persistent = 0; - } - - connection->idle_expiry = (OCI_G(persistent_timeout) > 0) ? (timestamp + OCI_G(persistent_timeout)) : 0; - if (OCI_G(ping_interval) >= 0) { - connection->next_ping = timestamp + OCI_G(ping_interval); - } - else { - /* -1 means "Off" */ - connection->next_ping = 0; - } - - smart_str_free_ex(&hashed_details, 0); - - /* allocate environment handle */ -#if HAVE_OCI_ENV_NLS_CREATE -#define PHP_OCI_INIT_FUNC_NAME "OCIEnvNlsCreate" - - if (charset && *charset) { - charsetid = PHP_OCI_CALL(OCINlsCharSetNameToId, (OCI_G(env), charset)); - connection->charset = charsetid; - } - else if (charsetid) { - connection->charset = charsetid; - } - - /* create an environment using the character set id, Oracle 9i+ ONLY */ - OCI_G(errcode) = PHP_OCI_CALL(OCIEnvNlsCreate, (&(connection->env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, charsetid, charsetid)); - -#elif HAVE_OCI_ENV_CREATE -#define PHP_OCI_INIT_FUNC_NAME "OCIEnvCreate" - - /* allocate env handle without NLS support */ - OCI_G(errcode) = PHP_OCI_CALL(OCIEnvCreate, (&(connection->env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL)); -#else -#define PHP_OCI_INIT_FUNC_NAME "OCIEnvInit" - - /* the simpliest way */ - OCI_G(errcode) = PHP_OCI_CALL(OCIEnvInit, (&(connection->env), OCI_DEFAULT, 0, NULL)); -#endif - - if (OCI_G(errcode) != OCI_SUCCESS) { -#ifdef HAVE_OCI_INSTANT_CLIENT - php_error_docref(NULL TSRMLS_CC, E_WARNING, PHP_OCI_INIT_FUNC_NAME "() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries"); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, PHP_OCI_INIT_FUNC_NAME "() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory"); -#endif - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - - /* allocate our server handle {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - /* attach to the server {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - connection->is_attached = 1; - - /* allocate our session handle {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - /* allocate our private error-handle {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - /* allocate our service-context {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - /* set the username {{{ */ - if (username) { - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - }/* }}} */ - - /* set the password {{{ */ - if (password) { - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - }/* }}} */ - - /* set the server handle in the service handle {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - /* set the authentication handle in the service handle {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - - if (new_password) { - /* try to change password if new one was provided {{{ */ - OCI_G(errcode) = PHP_OCI_CALL(OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len+1, (text *)password, password_len+1, (text *)new_password, new_password_len+1, OCI_AUTH)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } /* }}} */ - } else { - /* start the session {{{ */ - switch (session_mode) { - case OCI_DEFAULT: -#if HAVE_OCI_STMT_PREPARE2 - /* statement caching is suported only in Oracle 9+ */ - OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) OCI_STMT_CACHE)); -#else - /* others cannot use stmt caching, so we call OCISessionBegin() with OCI_DEFAULT */ - OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) OCI_DEFAULT)); -#endif - break; - case OCI_SYSDBA: - case OCI_SYSOPER: - default: - OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode)); - break; - } - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - /* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when - * user's password has expired, but is still usable. - * */ - if (OCI_G(errcode) != OCI_SUCCESS_WITH_INFO) { - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - } /* }}} */ - } - -#if HAVE_OCI_STMT_PREPARE2 - if (connection->is_persistent) { - ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ? OCI_G(statement_cache_size) : 0; - - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - php_oci_connection_close(connection TSRMLS_CC); - return NULL; - } - } -#endif - - /* mark it as open */ - connection->is_open = 1; - - /* register resource and return it */ - - new_le.ptr = connection; - - /* add to the appropriate hash */ - if (connection->is_persistent) { - new_le.type = le_pconnection; - connection->used_this_request = 1; - connection->rsrc_id = zend_list_insert(connection, le_pconnection); - zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(list_entry), NULL); - OCI_G(num_persistent)++; - } - else if (!exclusive) { - new_le.type = le_index_ptr; - connection->rsrc_id = zend_list_insert(connection, le_connection); - zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(list_entry), NULL); - OCI_G(num_links)++; - } - else { - connection->rsrc_id = zend_list_insert(connection, le_connection); - OCI_G(num_links)++; - } - return connection; -} -/* }}} */ - -/* {{{ php_oci_connection_ping() - * Ping connection. Uses OCIPing() or OCIServerVersion() depending on the Oracle Client version */ -static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) -{ -#if OCI_MAJOR_VERSION >= 10 && OCI_MINOR_VERSION >= 2 - /* OCIPing() is usable only in 10.2 */ - OCI_G(errcode) = PHP_OCI_CALL(OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); -#else - char version[256]; - /* use good old OCIServerVersion() by default */ - OCI_G(errcode) = PHP_OCI_CALL(OCIServerVersion, (connection->server, OCI_G(err), (text*)version, sizeof(version), OCI_HTYPE_SERVER)); -#endif - - if (OCI_G(errcode) == OCI_SUCCESS) { - return 1; - } - - /* ignore errors here, just return failure - * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_status() - Check connection status (pre-ping check) */ -static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC) -{ - ub4 ss = 0; - - /* get OCI_ATTR_SERVER_STATUS */ - OCI_G(errcode) = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); - - if (OCI_G(errcode) == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { - return 1; - } - - /* ignore errors here, just return failure - * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_rollback() - Rollback connection */ -int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC) -{ - connection->errcode = PHP_OCI_CALL(OCITransRollback, (connection->svc, connection->err, (ub4) 0)); - connection->needs_commit = 0; - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_connection_commit() - Commit connection */ -int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC) -{ - if (connection->descriptors) { - zend_hash_apply(connection->descriptors,(apply_func_t) php_oci_descriptor_flush_hash_dtor TSRMLS_CC); - } - - connection->errcode = PHP_OCI_CALL(OCITransCommit, (connection->svc, connection->err, (ub4) 0)); - connection->needs_commit = 0; - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_connection_close() - Close the connection and free all its resources */ -static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) -{ - int result = 0; - - if (connection->descriptors) { - zend_hash_destroy(connection->descriptors); - efree(connection->descriptors); - } - - if (connection->svc) { - /* rollback outstanding transactions */ - if (connection->needs_commit) { - if (php_oci_connection_rollback(connection TSRMLS_CC)) { - /* rollback failed */ - result = 1; - } - } - } - - if (connection->is_attached) { - PHP_OCI_CALL(OCIServerDetach, (connection->server, OCI_G(err), OCI_DEFAULT)); - } - - if (connection->err) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->err, (ub4) OCI_HTYPE_ERROR)); - } - - if (connection->session) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->session, OCI_HTYPE_SESSION)); - } - - if (connection->server) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->server, (ub4) OCI_HTYPE_SERVER)); - } - - if (connection->svc) { - if (connection->session && connection->is_open) { - PHP_OCI_CALL(OCISessionEnd, (connection->svc, OCI_G(err), connection->session, (ub4) 0)); - } - - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); - } - - if (connection->env) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->env, OCI_HTYPE_ENV)); - } - - if (connection->is_persistent) { - if (connection->hash_key) { - free(connection->hash_key); - } - free(connection); - } - else { - if (connection->hash_key) { - efree(connection->hash_key); - } - efree(connection); - } - connection = NULL; - return result; -} /* }}} */ - -/* {{{ php_oci_password_change() - Change password for the user with the username given */ -int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC) -{ - connection->errcode = PHP_OCI_CALL(OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len+1, (text *)pass_old, pass_old_len+1, (text *)pass_new, pass_new_len+1, OCI_DEFAULT)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_server_get_version() - Get Oracle server version */ -int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC) -{ - char version_buff[256]; - - connection->errcode = PHP_OCI_CALL(OCIServerVersion, (connection->svc, connection->err, (text*)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - *version = estrdup(version_buff); - return 0; -} /* }}} */ - -/* {{{ php_oci_column_to_zval() - Convert php_oci_out_column struct into zval */ -int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC) -{ - php_oci_descriptor *descriptor; - ub4 lob_length; - int column_size; - char *lob_buffer; - - if (column->indicator == -1) { /* column is NULL */ - ZVAL_NULL(value); - return 0; - } - - if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */ - ZVAL_RESOURCE(value, column->stmtid); - zend_list_addref(column->stmtid); - } - else if (column->is_descr) { - - if (column->data_type != SQLT_RDD) { - int rsrc_type; - - /* reset descriptor's length */ - descriptor = (php_oci_descriptor *) zend_list_find(column->descid, &rsrc_type); - - if (!descriptor || rsrc_type != le_descriptor) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find LOB descriptor #%d", column->descid); - return 1; - } - - descriptor->lob_size = -1; - descriptor->lob_current_position = 0; - descriptor->buffering = 0; - } - - if (column->data_type != SQLT_RDD && (mode & PHP_OCI_RETURN_LOBS)) { - /* PHP_OCI_RETURN_LOBS means that we want the content of the LOB back instead of the locator */ - - if (php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length TSRMLS_CC)) { - ZVAL_FALSE(value); - return 1; - } else { - if (lob_length > 0) { - ZVAL_STRINGL(value, lob_buffer, lob_length, 0); - } - else { - ZVAL_EMPTY_STRING(value); - } - return 0; - } - } else { - /* return the locator */ - object_init_ex(value, oci_lob_class_entry_ptr); - add_property_resource(value, "descriptor", column->descid); - zend_list_addref(column->descid); - } - } - else { - switch (column->retcode) { - case 0: - /* intact value */ - if (column->piecewise) { - column_size = column->retlen4; - } else { - column_size = column->retlen; - } - break; - - default: - ZVAL_FALSE(value); - return 0; - } - - ZVAL_STRINGL(value, column->data, column_size, 1); - } - return 0; -} -/* }}} */ - -/* {{{ php_oci_fetch_row() - Fetch the next row from the given statement */ -void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args) -{ - zval *z_statement, *array; - php_oci_statement *statement; - php_oci_out_column *column; - ub4 nrows = 1; - int i; - long fetch_mode = 0; - - if (expected_args > 2) { - /* only for ocifetchinto BC */ - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|l", &z_statement, &array, &fetch_mode) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 2) { - fetch_mode = mode; - } - } - else if (expected_args == 2) { - /* only for oci_fetch_array() */ - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &fetch_mode) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 1) { - fetch_mode = mode; - } - } - else { - /* for all oci_fetch_*() */ - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - fetch_mode = mode; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i = 0; i < statement->ncolumns; i++) { - - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - - if (column == NULL) { - continue; - } - if ((column->indicator == -1) && ((fetch_mode & PHP_OCI_RETURN_NULLS) == 0)) { - continue; - } - - if (!(column->indicator == -1)) { - zval *element; - - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(column, element, fetch_mode TSRMLS_CC); - - if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) { - add_index_zval(return_value, i, element); - } - if (fetch_mode & PHP_OCI_ASSOC) { - if (fetch_mode & PHP_OCI_NUM) { - ZVAL_ADDREF(element); - } - add_assoc_zval(return_value, column->name, element); - } - - } else { - if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) { - add_index_null(return_value, i); - } - if (fetch_mode & PHP_OCI_ASSOC) { - add_assoc_null(return_value, column->name); - } - } - } - - if (expected_args > 2) { - /* only for ocifetchinto BC - * in all other cases we return array, not long - */ - REPLACE_ZVAL_VALUE(&array, return_value, 1); /* copy return_value to given reference */ - zval_dtor(return_value); - RETURN_LONG(statement->ncolumns); - } -} -/* }}} */ - -/* {{{ php_oci_persistent_helper() - Helper function to close/rollback persistent connections at the end of request */ -static int php_oci_persistent_helper(list_entry *le TSRMLS_DC) -{ - time_t timestamp; - php_oci_connection *connection; - - timestamp = time(NULL); - - if (le->type == le_pconnection) { - connection = (php_oci_connection *)le->ptr; - - if (connection->used_this_request) { - php_oci_connection_rollback(connection TSRMLS_CC); - - if (connection->descriptors) { - zend_hash_destroy(connection->descriptors); - efree(connection->descriptors); - connection->descriptors = NULL; - } - - if (OCI_G(persistent_timeout) > 0) { - connection->idle_expiry = timestamp + OCI_G(persistent_timeout); - } - - if (OCI_G(ping_interval) >= 0) { - connection->next_ping = timestamp + OCI_G(ping_interval); - } - else { - /* ping_interval is -1 */ - connection->next_ping = 0; - } - - connection->used_this_request = 0; - } - else if (OCI_G(persistent_timeout) != -1) { - if (connection->idle_expiry < timestamp) { - /* connection has timed out */ - return 1; - } - } - } - return 0; -} /* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8.dsp b/ext/oci8/oci8.dsp deleted file mode 100644 index f0b27fa824fe5..0000000000000 --- a/ext/oci8/oci8.dsp +++ /dev/null @@ -1,133 +0,0 @@ -# Microsoft Developer Studio Project File - Name="oci8" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=oci8 - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "oci8.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "oci8.mak" CFG="oci8 - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "oci8 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "oci8 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "oci8 - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_oci8.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\lib\instantclient" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "oci8 - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTP_EXPORTS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_oci8.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\lib\instantclient" - -!ENDIF - -# Begin Target - -# Name "oci8 - Win32 Release_TS" -# Name "oci8 - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\oci8.c -# End Source File -# Begin Source File - -SOURCE=.\oci8_collection.c -# End Source File -# Begin Source File - -SOURCE=.\oci8_interface.c -# End Source File -# Begin Source File - -SOURCE=.\oci8_lob.c -# End Source File -# Begin Source File - -SOURCE=.\oci8_statement.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_oci8.h -# End Source File -# Begin Source File - -SOURCE=.\php_oci8_int.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c deleted file mode 100644 index c17712ae3ad39..0000000000000 --- a/ext/oci8/oci8_collection.c +++ /dev/null @@ -1,611 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#if HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* {{{ php_oci_collection_create() - Create and return connection handle */ -php_oci_collection * php_oci_collection_create(php_oci_connection* connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) -{ - dvoid *dschp1; - dvoid *parmp1; - dvoid *parmp2; - php_oci_collection *collection; - - collection = emalloc(sizeof(php_oci_collection)); - - collection->connection = connection; - collection->collection = NULL; - - /* get type handle by name */ - connection->errcode = PHP_OCI_CALL(OCITypeByName, (connection->env, connection->err, connection->svc, (text *) schema, (ub4) schema_len, (text *) tdo, (ub4) tdo_len, (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, OCI_TYPEGET_ALL, &(collection->tdo))); - - if (connection->errcode) { - goto CLEANUP; - } - - /* allocate describe handle */ - connection->errcode = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); - - if (connection->errcode) { - goto CLEANUP; - } - - /* describe TDO */ - connection->errcode = PHP_OCI_CALL(OCIDescribeAny, (connection->svc, connection->err, (dvoid *) collection->tdo, (ub4) 0, OCI_OTYPE_PTR, (ub1) OCI_DEFAULT, (ub1) OCI_PTYPE_TYPE, dschp1)); - - if (connection->errcode) { - goto CLEANUP; - } - - /* get first parameter handle */ - connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); - - if (connection->errcode) { - goto CLEANUP; - } - - /* get the collection type code of the attribute */ - connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, (dvoid*) &(collection->coll_typecode), (ub4 *) 0, (ub4) OCI_ATTR_COLLECTION_TYPECODE, connection->err)); - - if (connection->errcode) { - goto CLEANUP; - } - - switch(collection->coll_typecode) { - case OCI_TYPECODE_TABLE: - case OCI_TYPECODE_VARRAY: - /* get collection element handle */ - connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, (dvoid*) &parmp2, (ub4 *) 0, (ub4) OCI_ATTR_COLLECTION_ELEMENT, connection->err)); - - if (connection->errcode) { - goto CLEANUP; - } - - /* get REF of the TDO for the type */ - connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, (dvoid*) &(collection->elem_ref), (ub4 *) 0, (ub4) OCI_ATTR_REF_TDO, connection->err)); - - if (connection->errcode) { - goto CLEANUP; - } - - /* get the TDO (only header) */ - connection->errcode = PHP_OCI_CALL(OCITypeByRef, (connection->env, connection->err, collection->elem_ref, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &(collection->element_type))); - - if (connection->errcode) { - goto CLEANUP; - } - - /* get typecode */ - connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, (dvoid*) &(collection->element_typecode), (ub4 *) 0, (ub4) OCI_ATTR_TYPECODE, connection->err)); - - if (connection->errcode) { - goto CLEANUP; - } - break; - /* we only support VARRAYs and TABLEs */ - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCINewCollection - Unknown Type %d", collection->coll_typecode); - break; - } - - /* Create object to hold return table */ - connection->errcode = PHP_OCI_CALL(OCIObjectNew, - ( - connection->env, - connection->err, - connection->svc, - OCI_TYPECODE_TABLE, - collection->tdo, - (dvoid *)0, - OCI_DURATION_DEFAULT, - TRUE, - (dvoid **) &(collection->collection) - ) - ); - - if (connection->errcode) { - goto CLEANUP; - } - - PHP_OCI_REGISTER_RESOURCE(collection, le_collection); - return collection; - -CLEANUP: - - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - php_oci_collection_close(collection TSRMLS_CC); - return NULL; -} /* }}} */ - -/* {{{ php_oci_collection_size() - Return size of the collection */ -int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC) -{ - php_oci_connection *connection = collection->connection; - - connection->errcode = PHP_OCI_CALL(OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_max() - Return max number of elements in the collection */ -int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC) -{ - php_oci_connection *connection = collection->connection; - - *max = PHP_OCI_CALL(OCICollMax, (connection->env, collection->collection)); - - /* error handling is not necessary here? */ - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_trim() - Trim collection to the given number of elements */ -int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC) -{ - php_oci_connection *connection = collection->connection; - - connection->errcode = PHP_OCI_CALL(OCICollTrim, (connection->env, connection->err, trim_size, collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_append_null() - Append NULL element to the end of the collection */ -int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC) -{ - OCIInd null_index = OCI_IND_NULL; - php_oci_connection *connection = collection->connection; - - /* append NULL element */ - connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_append_date() - Append DATE element to the end of the collection (use "DD-MON-YY" format) */ -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIDate oci_date; - php_oci_connection *connection = collection->connection; - - /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date)); - - if (connection->errcode != OCI_SUCCESS) { - /* failed to convert string to date */ - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, connection->err, (dvoid *) &oci_date, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_append_number() - Append NUMBER to the end of the collection */ -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - double element_double; - OCINumber oci_number; - php_oci_connection *connection = collection->connection; - - element_double = zend_strtod(number, NULL); - - connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, connection->err, (dvoid *) &oci_number, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_append_string() - Append STRING to the end of the collection */ -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIString *ocistr = (OCIString *)0; - php_oci_connection *connection = collection->connection; - - connection->errcode = PHP_OCI_CALL(OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, connection->err, (dvoid *) ocistr, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_append() - Append wrapper. Appends any supported element to the end of the collection */ -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) -{ - if (element_len == 0) { - return php_oci_collection_append_null(collection TSRMLS_CC); - } - - switch(collection->element_typecode) { - case OCI_TYPECODE_DATE: - return php_oci_collection_append_date(collection, element, element_len TSRMLS_CC); - break; - - case OCI_TYPECODE_VARCHAR2 : - return php_oci_collection_append_string(collection, element, element_len TSRMLS_CC); - break; - - case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32 : /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL : /* REAL */ - case OCI_TYPECODE_DOUBLE : /* DOUBLE */ - case OCI_TYPECODE_INTEGER : /* INT */ - case OCI_TYPECODE_SIGNED16 : /* SHORT */ - case OCI_TYPECODE_SIGNED32 : /* LONG */ - case OCI_TYPECODE_DECIMAL : /* DECIMAL */ - case OCI_TYPECODE_FLOAT : /* FLOAT */ - case OCI_TYPECODE_NUMBER : /* NUMBER */ - case OCI_TYPECODE_SMALLINT : /* SMALLINT */ - return php_oci_collection_append_number(collection, element, element_len TSRMLS_CC); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - return 1; - break; - } - /* never reached */ - return 1; -} /* }}} */ - -/* {{{ php_oci_collection_element_get() - Get the element with the given index */ -int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC) -{ - php_oci_connection *connection = collection->connection; - dvoid *element; - OCIInd *element_index; - boolean exists; - char buff[1024]; - int buff_len = 1024; - - MAKE_STD_ZVAL(*result_element); - ZVAL_NULL(*result_element); - - connection->errcode = PHP_OCI_CALL(OCICollGetElem, (connection->env, connection->err, collection->collection, (ub4)index, &exists, &element, (dvoid **)&element_index)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - FREE_ZVAL(*result_element); - return 1; - } - - if (exists == 0) { - /* element doesn't exist */ - FREE_ZVAL(*result_element); - return 1; - } - - if (*element_index == OCI_IND_NULL) { - /* this is not an error, we're returning NULL here */ - return 0; - } - - switch (collection->element_typecode) { - case OCI_TYPECODE_DATE: - connection->errcode = PHP_OCI_CALL(OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - FREE_ZVAL(*result_element); - return 1; - } - - ZVAL_STRINGL(*result_element, buff, buff_len, 1); - Z_STRVAL_P(*result_element)[buff_len] = '\0'; - - return 0; - break; - - case OCI_TYPECODE_VARCHAR2: - { - OCIString *oci_string = *(OCIString **)element; - text *str; - - str = (text *)PHP_OCI_CALL(OCIStringPtr, (connection->env, oci_string)); - - if (str) { - ZVAL_STRING(*result_element, str, 1); - } - return 0; - } - break; - - case OCI_TYPECODE_UNSIGNED16: /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32: /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL: /* REAL */ - case OCI_TYPECODE_DOUBLE: /* DOUBLE */ - case OCI_TYPECODE_INTEGER: /* INT */ - case OCI_TYPECODE_SIGNED16: /* SHORT */ - case OCI_TYPECODE_SIGNED32: /* LONG */ - case OCI_TYPECODE_DECIMAL: /* DECIMAL */ - case OCI_TYPECODE_FLOAT: /* FLOAT */ - case OCI_TYPECODE_NUMBER: /* NUMBER */ - case OCI_TYPECODE_SMALLINT: /* SMALLINT */ - { - double double_number; - - connection->errcode = PHP_OCI_CALL(OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - FREE_ZVAL(*result_element); - return 1; - } - - ZVAL_DOUBLE(*result_element, double_number); - - return 0; - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - FREE_ZVAL(*result_element); - return 1; - break; - } - /* never reached */ - return 1; -} /* }}} */ - -/* {{{ php_oci_collection_element_set_null() - Set the element with the given index to NULL */ -int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC) -{ - OCIInd null_index = OCI_IND_NULL; - php_oci_connection *connection = collection->connection; - - /* set NULL element */ - connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_element_set_date() - Change element's value to the given DATE */ -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIDate oci_date; - php_oci_connection *connection = collection->connection; - - /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date)); - - if (connection->errcode != OCI_SUCCESS) { - /* failed to convert string to date */ - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, connection->err, (ub4)index, (dvoid *) &oci_date, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_element_set_number() - Change element's value to the given NUMBER */ -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - double element_double; - OCINumber oci_number; - php_oci_connection *connection = collection->connection; - - element_double = zend_strtod(number, NULL); - - connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *) &oci_number, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_element_set_string() - Change element's value to the given string */ -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIString *ocistr = (OCIString *)0; - php_oci_connection *connection = collection->connection; - - connection->errcode = PHP_OCI_CALL(OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, connection->err, (ub4)index, (dvoid *) ocistr, (dvoid *) &new_index, (OCIColl *) collection->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_element_set() - Collection element setter */ -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC) -{ - if (value_len == 0) { - return php_oci_collection_element_set_null(collection, index TSRMLS_CC); - } - - switch(collection->element_typecode) { - case OCI_TYPECODE_DATE: - return php_oci_collection_element_set_date(collection, index, value, value_len TSRMLS_CC); - break; - - case OCI_TYPECODE_VARCHAR2 : - return php_oci_collection_element_set_string(collection, index, value, value_len TSRMLS_CC); - break; - - case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32 : /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL : /* REAL */ - case OCI_TYPECODE_DOUBLE : /* DOUBLE */ - case OCI_TYPECODE_INTEGER : /* INT */ - case OCI_TYPECODE_SIGNED16 : /* SHORT */ - case OCI_TYPECODE_SIGNED32 : /* LONG */ - case OCI_TYPECODE_DECIMAL : /* DECIMAL */ - case OCI_TYPECODE_FLOAT : /* FLOAT */ - case OCI_TYPECODE_NUMBER : /* NUMBER */ - case OCI_TYPECODE_SMALLINT : /* SMALLINT */ - return php_oci_collection_element_set_number(collection, index, value, value_len TSRMLS_CC); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - return 1; - break; - } - /* never reached */ - return 1; -} /* }}} */ - -/* {{{ php_oci_collection_assign() - Assigns a value to the collection from another collection */ -int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC) -{ - php_oci_connection *connection = collection_dest->connection; - - connection->errcode = PHP_OCI_CALL(OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_collection_close() - Destroy collection and all associated resources */ -void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC) -{ - php_oci_connection *connection = collection->connection; - - if (collection->collection) { - connection->errcode = PHP_OCI_CALL(OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - } - } - - zend_list_delete(collection->connection->rsrc_id); - - efree(collection); - return; -} /* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c deleted file mode 100644 index 71191c1f1ad02..0000000000000 --- a/ext/oci8/oci8_interface.c +++ /dev/null @@ -1,2090 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#if HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* {{{ proto bool oci_define_by_name(resource stmt, string name, mixed &var [, int type]) - Define a PHP variable to an Oracle column by name */ -/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */ -PHP_FUNCTION(oci_define_by_name) -{ - zval *stmt, *var; - char *name; - int name_len; - long type = SQLT_CHR; - php_oci_statement *statement; - php_oci_define *define, *tmp_define; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) { - return; - } - - if (!name_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column name cannot be empty"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_STATEMENT(stmt, statement); - - if (statement->defines == NULL) { - ALLOC_HASHTABLE(statement->defines); - zend_hash_init(statement->defines, 13, NULL, php_oci_define_hash_dtor, 0); - } - - define = ecalloc(1,sizeof(php_oci_define)); - - if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { - efree(define); - define = tmp_define; - } else { - efree(define); - RETURN_FALSE; - } - - define->name = (text*) estrndup(name, name_len); - define->name_len = name_len; - define->type = type; - define->zval = var; - zval_add_ref(&var); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_bind_by_name(resource stmt, string name, mixed &var, [, int maxlength [, int type]]) - Bind a PHP variable to an Oracle placeholder by name */ -/* if you want to bind a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE binding!!! */ -PHP_FUNCTION(oci_bind_by_name) -{ - ub2 bind_type = SQLT_CHR; /* unterminated string */ - int name_len; - long maxlen = -1, type = 0; - char *name; - zval *z_statement; - zval *bind_var = NULL; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) { - return; - } - - if (type) { - bind_type = (ub2) type; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_free_descriptor() - Deletes large object description */ -PHP_FUNCTION(oci_free_descriptor) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - zend_list_delete(descriptor->id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_save( string data [, int offset ]) - Saves a large object */ -PHP_FUNCTION(oci_lob_save) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - char *data; - int data_len; - long offset = 0; - ub4 bytes_written; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &offset) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0"); - RETURN_FALSE; - } - - if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_import( string filename ) - Loads file into a LOB */ -PHP_FUNCTION(oci_lob_import) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - char *filename; - int filename_len; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string oci_lob_load() - Loads a large object */ -PHP_FUNCTION(oci_lob_load) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - char *buffer = NULL; - ub4 buffer_len; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) { - RETURN_FALSE; - } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); - } - else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto string oci_lob_read( int length ) - Reads particular part of a large object */ -PHP_FUNCTION(oci_lob_read) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - long length; - char *buffer; - ub4 buffer_len; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (length <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); - RETURN_FALSE; - } - - if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len TSRMLS_CC)) { - RETURN_FALSE; - } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); - } - else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto bool oci_lob_eof() - Checks if EOF is reached */ -PHP_FUNCTION(oci_lob_eof) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - ub4 lob_length; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) { - if (lob_length == descriptor->lob_current_position) { - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int oci_lob_tell() - Tells LOB pointer position */ -PHP_FUNCTION(oci_lob_tell) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - RETURN_LONG(descriptor->lob_current_position); -} -/* }}} */ - -/* {{{ proto bool oci_lob_rewind() - Rewind pointer of a LOB */ -PHP_FUNCTION(oci_lob_rewind) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - descriptor->lob_current_position = 0; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_seek( int offset [, int whence ]) - Moves the pointer of a LOB */ -PHP_FUNCTION(oci_lob_seek) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - long offset, whence = PHP_OCI_SEEK_SET; - ub4 lob_length; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &offset, &whence) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - RETURN_FALSE; - } - - switch(whence) { - case PHP_OCI_SEEK_CUR: - descriptor->lob_current_position += offset; - break; - case PHP_OCI_SEEK_END: - if (descriptor->lob_size + offset >= 0) { - descriptor->lob_current_position = descriptor->lob_size + offset; - } - else { - descriptor->lob_current_position = 0; - } - break; - case PHP_OCI_SEEK_SET: - default: - descriptor->lob_current_position = (offset > 0) ? offset : 0; - break; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int oci_lob_size() - Returns size of a large object */ -PHP_FUNCTION(oci_lob_size) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - ub4 lob_length; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(lob_length); -} -/* }}} */ - -/* {{{ proto int oci_lob_write( string string [, int length ]) - Writes data to current position of a LOB */ -PHP_FUNCTION(oci_lob_write) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - int data_len; - long write_len = 0; - ub4 bytes_written; - char *data; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &write_len) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 2) { - data_len = MIN(data_len, write_len); - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() == 3) { - data_len = MIN(data_len, write_len); - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (data_len <= 0) { - RETURN_LONG(0); - } - - if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(bytes_written); -} -/* }}} */ - -/* {{{ proto bool oci_lob_append( object lob ) - Appends data from a LOB to another LOB */ -PHP_FUNCTION(oci_lob_append) -{ - zval **tmp_dest, **tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from; - php_oci_descriptor *descriptor_dest, *descriptor_from; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from); - - if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) { - RETURN_FALSE; - } - /* XXX should we increase lob_size here ? */ - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_truncate( [ int length ]) - Truncates a LOB */ -PHP_FUNCTION(oci_lob_truncate) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - ub4 trim_length = 0; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &trim_length) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_truncate(descriptor, trim_length TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int oci_lob_erase( [ int offset [, int length ] ] ) - Erases a specified portion of the internal LOB, starting at a specified offset */ -PHP_FUNCTION(oci_lob_erase) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - ub4 bytes_erased; - long offset = -1, length = -1; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &offset, &length) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 0 && offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() > 1 && length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0"); - RETURN_FALSE; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 1 && offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() > 2 && length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0"); - RETURN_FALSE; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(bytes_erased); -} -/* }}} */ - -/* {{{ proto bool oci_lob_flush( [ int flag ] ) - Flushes the LOB buffer */ -PHP_FUNCTION(oci_lob_flush) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - ub4 flush_flag = 0; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flush_flag) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { - /* buffering wasn't enabled, there is nothing to flush */ - RETURN_FALSE; - } - - if (php_oci_lob_flush(descriptor, flush_flag TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ocisetbufferinglob( boolean flag ) - Enables/disables buffering for a LOB */ -PHP_FUNCTION(ocisetbufferinglob) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - zend_bool flag; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &flag) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ocigetbufferinglob() - Returns current state of buffering for a LOB */ -PHP_FUNCTION(ocigetbufferinglob) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_copy( object lob_to, object lob_from [, int length ] ) - Copies data from a LOB to another LOB */ -PHP_FUNCTION(oci_lob_copy) -{ - zval **tmp_dest, **tmp_from, *z_descriptor_dest, *z_descriptor_from; - php_oci_descriptor *descriptor_dest, *descriptor_from; - long length = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) { - return; - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from); - - if (ZEND_NUM_ARGS() == 3 && length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() == 2) { - /* indicate that we want to copy from the current position to the end of the LOB */ - length = -1; - } - - if (php_oci_lob_copy(descriptor_dest, descriptor_from, length TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_is_equal( object lob1, object lob2 ) - Tests to see if two LOB/FILE locators are equal */ -PHP_FUNCTION(oci_lob_is_equal) -{ - zval **tmp_first, **tmp_second, *z_descriptor_first, *z_descriptor_second; - php_oci_descriptor *descriptor_first, *descriptor_second; - boolean is_equal; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"), (void **)&tmp_first) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"), (void **)&tmp_second) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_first, descriptor_first); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_second, descriptor_second); - - if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) { - RETURN_FALSE; - } - - if (is_equal == TRUE) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_export([string filename [, int start [, int length]]]) - Writes a large object into a file */ -PHP_FUNCTION(oci_lob_export) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - char *filename, *buffer; - int filename_len; - long start = -1, length = -1, block_length; - php_stream *stream; - ub4 lob_length; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 1 && start < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0"); - RETURN_FALSE; - } - if (ZEND_NUM_ARGS() > 2 && length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0"); - RETURN_FALSE; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 2 && start < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0"); - RETURN_FALSE; - } - if (ZEND_NUM_ARGS() > 3 && length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0"); - RETURN_FALSE; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - RETURN_FALSE; - } - - if (start == -1) { - start = 0; - } - - if (length == -1) { - length = lob_length - descriptor->lob_current_position; - } - - if (length == 0) { - /* nothing to write, fail silently */ - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(filename TSRMLS_CC)) { - RETURN_FALSE; - } - - stream = php_stream_open_wrapper_ex(filename, "w", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL); - - block_length = PHP_OCI_LOB_BUFFER_SIZE; - if (block_length > length) { - block_length = length; - } - - while(length > 0) { - ub4 tmp_bytes_read = 0; - if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read TSRMLS_CC)) { - php_stream_close(stream); - RETURN_FALSE; - } - if (tmp_bytes_read && !php_stream_write(stream, buffer, tmp_bytes_read)) { - php_stream_close(stream); - efree(buffer); - RETURN_FALSE; - } - if (buffer) { - efree(buffer); - } - - length -= tmp_bytes_read; - descriptor->lob_current_position += tmp_bytes_read; - start += tmp_bytes_read; - - if (block_length > length) { - block_length = length; - } - } - - php_stream_close(stream); - RETURN_TRUE; -} -/* }}} */ - -#ifdef HAVE_OCI8_TEMP_LOB -/* {{{ proto bool oci_lob_write_temporary(string var [, int lob_type]) - Writes temporary blob */ -PHP_FUNCTION(oci_lob_write_temporary) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - char *data; - int data_len; - long type = OCI_TEMP_CLOB; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_lob_close() - Closes lob descriptor */ -PHP_FUNCTION(oci_lob_close) -{ - zval **tmp, *z_descriptor = getThis(); - php_oci_descriptor *descriptor; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - - if (php_oci_lob_close(descriptor TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto object oci_new_descriptor(resource connection [, int type]) - Initialize a new empty descriptor LOB/FILE (LOB is default) */ -PHP_FUNCTION(oci_new_descriptor) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_descriptor *descriptor; - long type = OCI_DTYPE_LOB; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_connection, &type) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - /* php_oci_lob_create() checks type */ - descriptor = php_oci_lob_create(connection, type TSRMLS_CC); - - if (!descriptor) { - RETURN_NULL(); - } - - object_init_ex(return_value, oci_lob_class_entry_ptr); - add_property_resource(return_value, "descriptor", descriptor->id); -} -/* }}} */ - -/* {{{ proto bool oci_rollback(resource connection) - Rollback the current context */ -PHP_FUNCTION(oci_rollback) -{ - zval *z_connection; - php_oci_connection *connection; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (connection->descriptors) { - zend_hash_apply(connection->descriptors,(apply_func_t) php_oci_descriptor_flush_hash_dtor TSRMLS_CC); - } - - if (php_oci_connection_rollback(connection TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_commit(resource connection) - Commit the current context */ -PHP_FUNCTION(oci_commit) -{ - zval *z_connection; - php_oci_connection *connection; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (connection->descriptors) { - zend_hash_apply(connection->descriptors,(apply_func_t) php_oci_descriptor_flush_hash_dtor TSRMLS_CC); - } - - if (php_oci_connection_commit(connection TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string oci_field_name(resource stmt, int col) - Tell the name of a column */ -PHP_FUNCTION(oci_field_name) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU) ) ) { - RETURN_STRINGL(column->name, column->name_len, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int oci_field_size(resource stmt, int col) - Tell the maximum data size of a column */ -PHP_FUNCTION(oci_field_size) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU) ) ) { - /* Handle data type of LONG */ - if (column->data_type == SQLT_LNG){ - RETURN_LONG(column->storage_size4); - } - RETURN_LONG(column->data_size); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int oci_field_scale(resource stmt, int col) - Tell the scale of a column */ -PHP_FUNCTION(oci_field_scale) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU) ) ) { - RETURN_LONG(column->scale); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int oci_field_precision(resource stmt, int col) - Tell the precision of a column */ -PHP_FUNCTION(oci_field_precision) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU) ) ) { - RETURN_LONG(column->precision); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto mixed oci_field_type(resource stmt, int col) - Tell the data type of a column */ -PHP_FUNCTION(oci_field_type) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU); - - if (!column) { - RETURN_FALSE; - } - - switch (column->data_type) { -#ifdef SQLT_TIMESTAMP - case SQLT_TIMESTAMP: - RETVAL_STRING("TIMESTAMP",1); - break; -#endif -#ifdef SQLT_TIMESTAMP_TZ - case SQLT_TIMESTAMP_TZ: - RETVAL_STRING("TIMESTAMP_TZ",1); - break; -#endif - case SQLT_DAT: - RETVAL_STRING("DATE",1); - break; - case SQLT_NUM: - RETVAL_STRING("NUMBER",1); - break; - case SQLT_LNG: - RETVAL_STRING("LONG",1); - break; - case SQLT_BIN: - RETVAL_STRING("RAW",1); - break; - case SQLT_LBI: - RETVAL_STRING("LONG RAW",1); - break; - case SQLT_CHR: - RETVAL_STRING("VARCHAR",1); - break; - case SQLT_RSET: - RETVAL_STRING("REFCURSOR",1); - break; - case SQLT_AFC: - RETVAL_STRING("CHAR",1); - break; - case SQLT_BLOB: - RETVAL_STRING("BLOB",1); - break; - case SQLT_CLOB: - RETVAL_STRING("CLOB",1); - break; - case SQLT_BFILE: - RETVAL_STRING("BFILE",1); - break; - case SQLT_RDD: - RETVAL_STRING("ROWID",1); - break; - default: - RETVAL_LONG(column->data_type); - } -} -/* }}} */ - -/* {{{ proto int oci_field_type_raw(resource stmt, int col) - Tell the raw oracle data type of a column */ -PHP_FUNCTION(oci_field_type_raw) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (column) { - RETURN_LONG(column->data_type); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool oci_field_is_null(resource stmt, int col) - Tell whether a column is NULL */ -PHP_FUNCTION(oci_field_is_null) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU) ) ) { - if (column->indicator == -1) { - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto void oci_internal_debug(int onoff) - Toggle internal debugging output for the OCI extension */ -PHP_FUNCTION(oci_internal_debug) -{ - zend_bool on_off; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &on_off) == FAILURE) { - return; - } - OCI_G(debug_mode) = on_off; -} -/* }}} */ - -/* {{{ proto bool oci_execute(resource stmt [, int mode]) - Execute a parsed statement */ -PHP_FUNCTION(oci_execute) -{ - zval *z_statement; - php_oci_statement *statement; - long mode = OCI_COMMIT_ON_SUCCESS; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &mode) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_execute(statement, mode TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_cancel(resource stmt) - Cancel reading from a cursor */ -PHP_FUNCTION(oci_cancel) -{ - zval *z_statement; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_cancel(statement TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_fetch(resource stmt) - Prepare a new row of data for reading */ -PHP_FUNCTION(oci_fetch) -{ - zval *z_statement; - php_oci_statement *statement; - ub4 nrows = 1; /* only one row at a time is supported for now */ - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ocifetchinto(resource stmt, array &output [, int mode]) - Fetch a row of result data into an array */ -PHP_FUNCTION(ocifetchinto) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_NUM, 3); -} -/* }}} */ - -/* {{{ proto int oci_fetch_all(resource stmt, array &output[, int skip[, int maxrows[, int flags]]]) - Fetch all rows of result data into an array */ -PHP_FUNCTION(oci_fetch_all) -{ - zval *z_statement, *array, *element, *tmp; - php_oci_statement *statement; - php_oci_out_column **columns; - zval ***outarrs; - ub4 nrows = 1; - int i; - long rows = 0, flags = 0, skip = 0, maxrows = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - zval_dtor(array); - array_init(array); - - while (skip--) { - if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - RETURN_LONG(0); - } - } - - if (flags & PHP_OCI_FETCHSTATEMENT_BY_ROW) { - columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); - - for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - } - - while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - zval *row; - - MAKE_STD_ZVAL(row); - array_init(row); - - for (i = 0; i < statement->ncolumns; i++) { - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC); - - if (flags & PHP_OCI_NUM) { - zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL); - } else { /* default to ASSOC */ - zend_hash_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); - } - } - - zend_hash_next_index_insert(Z_ARRVAL_P(array), &row, sizeof(zval*), NULL); - rows++; - - if (maxrows != -1 && rows == maxrows) { - php_oci_statement_cancel(statement TSRMLS_CC); - break; - } - } - efree(columns); - - } else { /* default to BY_COLUMN */ - columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); - outarrs = safe_emalloc(statement->ncolumns, sizeof(zval*), 0); - - if (flags & PHP_OCI_NUM) { - for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); - } - } else { /* default to ASSOC */ - for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zend_hash_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); - } - } - - while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - for (i = 0; i < statement->ncolumns; i++) { - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC); - zend_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(zval*), NULL); - } - - rows++; - - if (maxrows != -1 && rows == maxrows) { - php_oci_statement_cancel(statement TSRMLS_CC); - break; - } - } - - efree(columns); - efree(outarrs); - } - - RETURN_LONG(rows); -} -/* }}} */ - -/* {{{ proto object oci_fetch_object( resource stmt ) - Fetch a result row as an object */ -PHP_FUNCTION(oci_fetch_object) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_ASSOC, 2); - - if (Z_TYPE_P(return_value) == IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array oci_fetch_row( resource stmt ) - Fetch a result row as an enumerated array */ -PHP_FUNCTION(oci_fetch_row) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_NUM, 1); -} -/* }}} */ - -/* {{{ proto array oci_fetch_assoc( resource stmt ) - Fetch a result row as an associative array */ -PHP_FUNCTION(oci_fetch_assoc) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_ASSOC, 1); -} -/* }}} */ - -/* {{{ proto array oci_fetch_array( resource stmt [, int mode ]) - Fetch a result row as an array */ -PHP_FUNCTION(oci_fetch_array) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_BOTH, 2); -} -/* }}} */ - -/* {{{ proto bool oci_free_statement(resource stmt) - Free all resources associated with a statement */ -PHP_FUNCTION(oci_free_statement) -{ - zval *z_statement; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - zend_list_delete(statement->id); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_close(resource connection) - Disconnect from database */ -PHP_FUNCTION(oci_close) -{ - zval *z_connection; - php_oci_connection *connection; - - if (OCI_G(old_oci_close_semantics)) { - /* do nothing to keep BC */ - return; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - zend_list_delete(connection->rsrc_id); - ZVAL_NULL(z_connection); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto resource oci_new_connect(string user, string pass [, string db]) - Connect to an Oracle database and log on. Returns a new session. */ -PHP_FUNCTION(oci_new_connect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 1); -} -/* }}} */ - -/* {{{ proto resource oci_connect(string user, string pass [, string db]) - Connect to an Oracle database and log on. Returns a new session. */ -PHP_FUNCTION(oci_connect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); -} -/* }}} */ - -/* {{{ proto resource oci_pconnect(string user, string pass [, string db]) - Connect to an Oracle database using a persistent connection and log on. Returns a new session. */ -PHP_FUNCTION(oci_pconnect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, 0); -} -/* }}} */ - -/* {{{ proto array oci_error([resource stmt|connection|global]) - Return the last error of stmt|connection|global. If no error happened returns false. */ -PHP_FUNCTION(oci_error) -{ - zval *arg; - php_oci_statement *statement; - php_oci_connection *connection; - text *errbuf; - sb4 errcode = 0; - sword error = 0; - dvoid *errh = NULL; -#ifdef HAVE_OCI8_ATTR_STATEMENT - ub2 error_offset = 0; - text *sqltext = NULL; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 0) { - statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement); - - if (statement) { - errh = statement->err; - error = statement->errcode; - -#ifdef HAVE_OCI8_ATTR_STATEMENT - if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) { - RETURN_FALSE; - } -#endif - } else { - connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection); - - if (connection) { - errh = connection->err; - error = connection->errcode; - } - } - } else { - errh = OCI_G(err); - error = OCI_G(errcode); - } - - if (error == OCI_SUCCESS) { /* no error set in the handle */ - RETURN_FALSE; - } - - if (!errh) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIError: unable to find error handle"); - RETURN_FALSE; - } - - errcode = php_oci_fetch_errmsg(errh, &errbuf TSRMLS_CC); - - if (errcode) { - array_init(return_value); - add_assoc_long(return_value, "code", errcode); - add_assoc_string(return_value, "message", (char*) errbuf, 0); -#ifdef HAVE_OCI8_ATTR_STATEMENT - add_assoc_long(return_value, "offset", error_offset); - add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : "", 1); -#endif - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int oci_num_fields(resource stmt) - Return the number of result columns in a statement */ -PHP_FUNCTION(oci_num_fields) -{ - zval *z_statement; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - RETURN_LONG(statement->ncolumns); -} -/* }}} */ - -/* {{{ proto resource oci_parse(resource connection, string query) - Parse a query and return a statement */ -PHP_FUNCTION(oci_parse) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_statement *statement; - char *query; - int query_len; - zend_bool cached = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_connection, &query, &query_len, &cached) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - statement = php_oci_statement_create(connection, query, query_len, cached TSRMLS_CC); - - if (statement) { - RETURN_RESOURCE(statement->id); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool oci_set_prefetch(resource stmt, int prefetch_rows) - Sets the number of rows to be prefetched on execute to prefetch_rows for stmt */ -PHP_FUNCTION(oci_set_prefetch) -{ - zval *z_statement; - php_oci_statement *statement; - long size; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_statement, &size) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_set_prefetch(statement, size TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_password_change(resource connection, string username, string old_password, string new_password) - Changes the password of an account */ -PHP_FUNCTION(oci_password_change) -{ - zval *z_connection; - text *user, *pass_old, *pass_new, *dbname; - int user_len, pass_old_len, pass_new_len, dbname_len; - php_oci_connection *connection; - - /* Disable in Safe Mode */ - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "is disabled in Safe Mode"); - RETURN_FALSE; - } - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { - - connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 0 TSRMLS_CC); - if (!connection) { - RETURN_FALSE; - } - RETURN_RESOURCE(connection->rsrc_id); - } - WRONG_PARAM_COUNT; -} -/* }}} */ - -/* {{{ proto resource oci_new_cursor(resource connection) - Return a new cursor (Statement-Handle) - use this to bind ref-cursors! */ -PHP_FUNCTION(oci_new_cursor) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - statement = php_oci_statement_create(connection, NULL, 0, 0 TSRMLS_CC); - - if (statement) { - RETURN_RESOURCE(statement->id); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string oci_result(resource stmt, mixed column) - Return a single column of result data */ -PHP_FUNCTION(oci_result) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if(column) { - php_oci_column_to_zval(column, return_value, 0 TSRMLS_CC); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string oci_server_version(resource connection) - Return a string containing server version information */ -PHP_FUNCTION(oci_server_version) -{ - zval *z_connection; - php_oci_connection *connection; - char *version = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (php_oci_server_get_version(connection, &version TSRMLS_CC)) { - RETURN_FALSE; - } - - RETURN_STRING(version, 0); -} -/* }}} */ - -/* {{{ proto string oci_statement_type(resource stmt) - Return the query type of an OCI statement */ -PHP_FUNCTION(oci_statement_type) -{ - zval *z_statement; - php_oci_statement *statement; - ub2 type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_get_type(statement, &type TSRMLS_CC)) { - RETURN_FALSE; - } - - switch (type) { - case OCI_STMT_SELECT: - RETVAL_STRING("SELECT",1); - break; - case OCI_STMT_UPDATE: - RETVAL_STRING("UPDATE",1); - break; - case OCI_STMT_DELETE: - RETVAL_STRING("DELETE",1); - break; - case OCI_STMT_INSERT: - RETVAL_STRING("INSERT",1); - break; - case OCI_STMT_CREATE: - RETVAL_STRING("CREATE",1); - break; - case OCI_STMT_DROP: - RETVAL_STRING("DROP",1); - break; - case OCI_STMT_ALTER: - RETVAL_STRING("ALTER",1); - break; - case OCI_STMT_BEGIN: - RETVAL_STRING("BEGIN",1); - break; - case OCI_STMT_DECLARE: - RETVAL_STRING("DECLARE",1); - break; - default: - RETVAL_STRING("UNKNOWN",1); - } -} -/* }}} */ - -/* {{{ proto int oci_num_rows(resource stmt) - Return the row count of an OCI statement */ -PHP_FUNCTION(oci_num_rows) -{ - zval *z_statement; - php_oci_statement *statement; - ub4 rowcount; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_get_numrows(statement, &rowcount TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(rowcount); -} -/* }}} */ - -#ifdef PHP_OCI8_HAVE_COLLECTIONS -/* {{{ proto bool oci_free_collection() - Deletes collection object*/ -PHP_FUNCTION(oci_free_collection) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - zend_list_delete(collection->id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_collection_append(string value) - Append an object to the collection */ -PHP_FUNCTION(oci_collection_append) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - char *value; - int value_len; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string oci_collection_element_get(int ndx) - Retrieve the value at collection index ndx */ -PHP_FUNCTION(oci_collection_element_get) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - long element_index; - zval *value; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &element_index) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) { - RETURN_FALSE; - } - - *return_value = *value; - zval_copy_ctor(return_value); - zval_ptr_dtor(&value); -} -/* }}} */ - -/* {{{ proto bool oci_collection_assign(object from) - Assign a collection from another existing collection */ -PHP_FUNCTION(oci_collection_assign) -{ - zval **tmp_dest, **tmp_from, *z_collection_dest = getThis(), *z_collection_from; - php_oci_collection *collection_dest, *collection_from; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection"), (void **)&tmp_dest) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object"); - RETURN_FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection_from), "collection", sizeof("collection"), (void **)&tmp_from) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp_dest, collection_dest); - PHP_OCI_ZVAL_TO_COLLECTION(*tmp_from, collection_from); - - if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool oci_collection_element_assign(int index, string val) - Assign element val to collection at index ndx */ -PHP_FUNCTION(oci_collection_element_assign) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - int value_len; - long element_index; - char *value; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element_index, &value, &value_len) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int oci_collection_size() - Return the size of a collection */ -PHP_FUNCTION(oci_collection_size) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - sb4 size = 0; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_size(collection, &size TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(size); -} -/* }}} */ - -/* {{{ proto int oci_collection_max() - Return the max value of a collection. For a varray this is the maximum length of the array */ -PHP_FUNCTION(oci_collection_max) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - long max; - - if (!getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_max(collection, &max TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_LONG(max); -} -/* }}} */ - -/* {{{ proto bool oci_collection_trim(int num) - Trim num elements from the end of a collection */ -PHP_FUNCTION(oci_collection_trim) -{ - zval **tmp, *z_collection = getThis(); - php_oci_collection *collection; - long trim_size; - - if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &trim_size) == FAILURE) { - return; - } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) { - return; - } - } - - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); - - if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object oci_new_collection(resource connection, string tdo [, string schema]) - Initialize a new collection */ -PHP_FUNCTION(oci_new_collection) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_collection *collection; - char *tdo, *schema = NULL; - int tdo_len, schema_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len TSRMLS_CC)) ) { - object_init_ex(return_value, oci_coll_class_entry_ptr); - add_property_resource(return_value, "collection", collection->id); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -#endif - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c deleted file mode 100644 index 512607942e882..0000000000000 --- a/ext/oci8/oci8_lob.c +++ /dev/null @@ -1,697 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#if HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* for import/export functions */ -#include <fcntl.h> - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -/* {{{ php_oci_lob_create() - Create LOB descriptor and allocate all the resources needed */ -php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long type TSRMLS_DC) -{ - php_oci_descriptor *descriptor; - - switch (type) { - case OCI_DTYPE_FILE: - case OCI_DTYPE_LOB: - case OCI_DTYPE_ROWID: - /* these three are allowed */ - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %ld.", type); - return NULL; - break; - } - - descriptor = emalloc(sizeof(php_oci_descriptor)); - descriptor->type = type; - - OCI_G(errcode) = PHP_OCI_CALL(OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - connection->errcode = php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - efree(descriptor); - return NULL; - } - - descriptor->connection = connection; - - PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor); - - descriptor->lob_current_position = 0; - descriptor->lob_size = -1; /* we should set it to -1 to know, that it's just not initialized */ - descriptor->buffering = PHP_OCI_LOB_BUFFER_DISABLED; /* buffering is off by default */ - - if (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE) { - /* add Lobs & Files to hash. we'll flush them at the end */ - if (!connection->descriptors) { - ALLOC_HASHTABLE(connection->descriptors); - zend_hash_init(connection->descriptors, 13, NULL, php_oci_descriptor_flush_hash_dtor, 0); - } - - zend_hash_next_index_insert(connection->descriptors,&descriptor,sizeof(php_oci_descriptor *),NULL); - } - return descriptor; - -} /* }}} */ - -/* {{{ php_oci_lob_get_length() - Get length of the LOB. The length is cached so we don't need to ask Oracle every time */ -int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - - *length = 0; - - if (descriptor->lob_size >= 0) { - *length = descriptor->lob_size; - return 0; - } else { - if (descriptor->type == OCI_DTYPE_FILE) { - connection->errcode = PHP_OCI_CALL(OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - - connection->errcode = PHP_OCI_CALL(OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - descriptor->lob_size = *length; - - if (descriptor->type == OCI_DTYPE_FILE) { - connection->errcode = PHP_OCI_CALL(OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - } - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_read() - Read specified portion of the LOB into the buffer */ -int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long offset, char **data, ub4 *data_len TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - ub4 length = 0; - ub4 block_length = PHP_OCI_LOB_BUFFER_SIZE; - int bytes_read; - int requested_len = read_length; /* this is by default */ - - *data_len = 0; - *data = NULL; - - if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) { - return 1; - } - - if (length <= 0) { - return 0; - } - - if (offset > length) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be less than size of the LOB"); - return 1; - } - - if (read_length == -1) { - requested_len = length; - } - - if (requested_len > (length - offset)) { - requested_len = length - offset; - } - - if (requested_len == 0) { - return 0; - } - - if (requested_len < block_length) { - block_length = requested_len; - } - - if (descriptor->type == OCI_DTYPE_FILE) { - connection->errcode = PHP_OCI_CALL(OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - - *data = emalloc(block_length + 1); - bytes_read = block_length; - - while (bytes_read > 0 && *data_len < requested_len && offset < length) { - - connection->errcode = PHP_OCI_CALL(OCILobRead, - ( - connection->svc, - connection->err, - descriptor->descriptor, - &bytes_read, /* IN/OUT bytes toread/read */ - offset + 1, /* offset (starts with 1) */ - (dvoid *) ((char *) *data + *data_len), - block_length, /* size of buffer */ - (dvoid *)0, - (OCICallbackLobRead) 0, /* callback... */ - (ub2) connection->charset, /* The character set ID of the buffer data. */ - (ub1) SQLCS_IMPLICIT /* The character set form of the buffer data. */ - ) - ); - - offset += bytes_read; - *data_len += bytes_read; - block_length = PHP_OCI_LOB_BUFFER_SIZE; - descriptor->lob_current_position += bytes_read; - - if (*data_len < requested_len && connection->errcode == OCI_NEED_DATA) { - *data = erealloc(*data, *data_len + PHP_OCI_LOB_BUFFER_SIZE + 1); - continue; - } else { - break; - } - } - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - efree(*data); - *data = NULL; - return 1; - } - - if (descriptor->type == OCI_DTYPE_FILE) { - connection->errcode = PHP_OCI_CALL(OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - efree(*data); - *data = NULL; - return 1; - } - } - - *data = erealloc(*data, *data_len + 1); - (*data)[ *data_len ] = 0; - - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_write() - Write data to the LOB */ -int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC) -{ - OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; - php_oci_connection *connection = (php_oci_connection *) descriptor->connection; - ub4 lob_length; - - *bytes_written = 0; - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - return 1; - } - - if (!data || data_len <= 0) { - return 0; - } - - if (offset < 0) { - offset = 0; - } - - if (offset > descriptor->lob_current_position) { - offset = descriptor->lob_current_position; - } - - connection->errcode = PHP_OCI_CALL(OCILobWrite, (connection->svc, connection->err, lob, (ub4 *)&data_len, (ub4) offset + 1, (dvoid *) data, (ub4) data_len, OCI_ONE_PIECE, (dvoid *)0, (OCICallbackLobWrite) 0, (ub2) 0, (ub1) SQLCS_IMPLICIT)); - - if (connection->errcode) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - *bytes_written = 0; - return 1; - } - *bytes_written = data_len; - descriptor->lob_current_position += data_len; - - if (descriptor->lob_current_position > descriptor->lob_size) { - descriptor->lob_size = descriptor->lob_current_position; - } - - /* marking buffer as used */ - if (descriptor->buffering == PHP_OCI_LOB_BUFFER_ENABLED) { - descriptor->buffering = PHP_OCI_LOB_BUFFER_USED; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_set_buffering() - Turn buffering off/onn for this particular LOB */ -int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - - if (!on_off && descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { - /* disabling when it's already off */ - return 0; - } - - if (on_off && descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - /* enabling when it's already on */ - return 0; - } - - if (on_off) { - connection->errcode = PHP_OCI_CALL(OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); - } - else { - connection->errcode = PHP_OCI_CALL(OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); - } - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - descriptor->buffering = on_off ? PHP_OCI_LOB_BUFFER_ENABLED : PHP_OCI_LOB_BUFFER_DISABLED; - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_get_buffering() - Return current buffering state for the LOB */ -int php_oci_lob_get_buffering (php_oci_descriptor *descriptor TSRMLS_DC) -{ - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - return 1; - } - else { - return 0; - } -} /* }}} */ - -/* {{{ php_oci_lob_copy() - Copy one LOB (or its part) to another one */ -int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, long length TSRMLS_DC) -{ - php_oci_connection *connection = descriptor_dest->connection; - int length_dest, length_from, copy_len; - - if (php_oci_lob_get_length(descriptor_dest, &length_dest TSRMLS_CC)) { - return 1; - } - - if (php_oci_lob_get_length(descriptor_from, &length_from TSRMLS_CC)) { - return 1; - } - - if (length == -1) { - copy_len = length_from - descriptor_from->lob_current_position; - } - else { - copy_len = length; - } - - if ((int)copy_len <= 0) { - /* silently fail, there is nothing to copy */ - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCILobCopy, (connection->svc, connection->err, descriptor_dest->descriptor, descriptor_from->descriptor, copy_len, descriptor_dest->lob_current_position+1, descriptor_from->lob_current_position+1)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_close() - Close LOB */ -int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - int is_temporary; - - connection->errcode = PHP_OCI_CALL(OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - if (is_temporary) { - - connection->errcode = PHP_OCI_CALL(OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_flush() - Flush buffers for the LOB (only if they have been used) */ -int php_oci_lob_flush(php_oci_descriptor *descriptor, int flush_flag TSRMLS_DC) -{ - OCILobLocator *lob = descriptor->descriptor; - php_oci_connection *connection = descriptor->connection; - - if (!lob) { - return 1; - } - - switch (flush_flag) { - case 0: - case OCI_LOB_BUFFER_FREE: - /* only these two are allowed */ - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %d", flush_flag); - return 1; - break; - } - - /* do not really flush buffer, but report success - * to suppress OCI error when flushing not used buffer - * */ - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_USED) { - return 0; - } - - connection->errcode = PHP_OCI_CALL(OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - /* marking buffer as enabled and not used */ - descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_free() - Close LOB descriptor and free associated resources */ -void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC) -{ - /* flushing Lobs & Files with buffering enabled */ - if ((descriptor->type == OCI_DTYPE_FILE || descriptor->type == OCI_DTYPE_LOB) && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED) { - php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC); - } - - PHP_OCI_CALL(OCIDescriptorFree, (descriptor->descriptor, descriptor->type)); - - zend_list_delete(descriptor->connection->rsrc_id); - efree(descriptor); -} /* }}} */ - -/* {{{ php_oci_lob_import() - Import LOB contents from the given file */ -int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC) -{ - int fp, loblen; - OCILobLocator *lob = (OCILobLocator *)descriptor->descriptor; - php_oci_connection *connection = descriptor->connection; - char buf[8192]; - ub4 offset = 1; - - if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) { - return 1; - } - - if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open file %s", filename); - return 1; - } - - while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { - connection->errcode = PHP_OCI_CALL( - OCILobWrite, - ( - connection->svc, - connection->err, - lob, - &loblen, - (ub4) offset, - (dvoid *) &buf, - (ub4) loblen, - OCI_ONE_PIECE, - (dvoid *)0, - (OCICallbackLobWrite) 0, - (ub2) 0, - (ub1) SQLCS_IMPLICIT - ) - ); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - close(fp); - return 1; - } - offset += loblen; - } - close(fp); - - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_append() - Append data to the end of the LOB */ -int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC) -{ - php_oci_connection *connection = descriptor_dest->connection; - OCILobLocator *lob_dest = descriptor_dest->descriptor; - OCILobLocator *lob_from = descriptor_from->descriptor; - ub4 dest_len, from_len; - - if (php_oci_lob_get_length(descriptor_dest, &dest_len TSRMLS_CC)) { - return 1; - } - - if (php_oci_lob_get_length(descriptor_from, &from_len TSRMLS_CC)) { - return 1; - } - - if (from_len <= 0) { - return 0; - } - - connection->errcode = PHP_OCI_CALL(OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_truncate() - Truncate LOB to the given length */ -int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 lob_length; - - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - return 1; - } - - if (lob_length <= 0) { - return 0; - } - - if (new_lob_length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be greater than or equal to 0"); - return 1; - } - - if (new_lob_length > lob_length) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be less than or equal to the current LOB size"); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCILobTrim, (connection->svc, connection->err, lob, new_lob_length)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - descriptor->lob_size = new_lob_length; - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_erase() - Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */ -int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, long length, ub4 *bytes_erased TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 lob_length; - - *bytes_erased = 0; - - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { - return 1; - } - - if (offset == -1) { - offset = descriptor->lob_current_position; - } - - if (length == -1) { - length = lob_length; - } - - connection->errcode = PHP_OCI_CALL(OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - *bytes_erased = length; - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_is_equal() - Compare to LOB descriptors and figure out if they are pointing to the same LOB */ -int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC) -{ - php_oci_connection *connection = descriptor_first->connection; - OCILobLocator *first_lob = descriptor_first->descriptor; - OCILobLocator *second_lob = descriptor_second->descriptor; - - connection->errcode = PHP_OCI_CALL(OCILobIsEqual, (connection->env, first_lob, second_lob, result)); - - if (connection->errcode) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php_oci_lob_write_tmp() - Create temporary LOB and write data to it */ -int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data, int data_len TSRMLS_DC) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 bytes_written = 0; - - switch (type) { - case OCI_TEMP_BLOB: - case OCI_TEMP_CLOB: - /* only these two are allowed */ - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %d", type); - return 1; - break; - } - - if (!data || data_len <= 0) { - /* nothing to write, silently fail */ - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCILobCreateTemporary, (connection->svc, connection->err, lob, OCI_DEFAULT, OCI_DEFAULT, type, OCI_ATTR_NOCACHE, OCI_DURATION_SESSION)); - - if (connection->errcode) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = PHP_OCI_CALL(OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); - - if (connection->errcode) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC); -} /* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c deleted file mode 100644 index 6d9eb1240a42b..0000000000000 --- a/ext/oci8/oci8_statement.c +++ /dev/null @@ -1,998 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#if HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* {{{ php_oci_statement_create() - Create statemend handle and allocate necessary resources */ -php_oci_statement *php_oci_statement_create (php_oci_connection *connection, char *query, long query_len, zend_bool cached TSRMLS_DC) -{ - php_oci_statement *statement; - - statement = ecalloc(1,sizeof(php_oci_statement)); - -#if HAVE_OCI_STMT_PREPARE2 - if (!query_len) { - /* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */ - PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); - } -#else - PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); -#endif - - PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL)); - - if (query_len > 0) { -#if HAVE_OCI_STMT_PREPARE2 - connection->errcode = PHP_OCI_CALL(OCIStmtPrepare2, (connection->svc, &(statement->stmt), connection->err, (text *)query, query_len, NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT)); -#else - connection->errcode = PHP_OCI_CALL(OCIStmtPrepare, (statement->stmt, connection->err, (text *)query, query_len, OCI_NTV_SYNTAX, OCI_DEFAULT)); -#endif - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - -#if HAVE_OCI_STMT_PREPARE2 - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_DEFAULT)); - PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); -#else - PHP_OCI_CALL(OCIHandleFree,(statement->stmt, OCI_HTYPE_STMT)); - PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); -#endif - - efree(statement); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return NULL; - } - } - - if (query && query_len) { - statement->last_query = estrndup(query, query_len); - statement->last_query_len = query_len; - } - else { - statement->last_query = NULL; - statement->last_query_len = 0; - } - - statement->connection = connection; - statement->has_data = 0; - - if (OCI_G(default_prefetch) > 0) { - php_oci_statement_set_prefetch(statement, OCI_G(default_prefetch) TSRMLS_CC); - } - - PHP_OCI_REGISTER_RESOURCE(statement, le_statement); - - return statement; -} -/* }}} */ - -/* {{{ php_oci_statement_set_prefetch() - Set prefetch buffer size for the statement (we're assuming that one row is ~1K sized) */ -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 size TSRMLS_DC) -{ - ub4 prefetch = size * 1024; - - if (size < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of rows has to be greater than or equal to 1"); - return 1; - } - - statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_MEMORY, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - prefetch = size; - statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_statement_fetch() - Fetch a row from the statement */ -int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) -{ - int i; - php_oci_out_column *column; - - statement->errcode = PHP_OCI_CALL(OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); - - if ( statement->errcode == OCI_NO_DATA || nrows == 0 ) { - if (statement->last_query == NULL) { - /* reset define-list for refcursors */ - if (statement->columns) { - zend_hash_destroy(statement->columns); - efree(statement->columns); - statement->columns = NULL; - statement->ncolumns = 0; - } - statement->executed = 0; - } - - statement->errcode = 0; /* OCI_NO_DATA is NO error for us!!! */ - statement->has_data = 0; - - if (nrows == 0) { - /* this is exactly what we requested */ - return 0; - } - - return 1; - } - - /* reset length for all piecewise columns */ - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column->piecewise) { - column->retlen4 = 0; - } - } - - while (statement->errcode == OCI_NEED_DATA) { - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column->piecewise) { - if (!column->data) { - column->data = (text *) emalloc(PHP_OCI_PIECE_SIZE); - } else { - column->data = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE); - } - - column->cb_retlen = PHP_OCI_PIECE_SIZE; - - PHP_OCI_CALL( OCIStmtSetPieceInfo, ((void *) column->oci_define, OCI_HTYPE_DEFINE, statement->err, ((char*)column->data) + column->retlen4, &(column->cb_retlen), OCI_NEXT_PIECE, &column->indicator, &column->retcode)); - } - } - - statement->errcode = PHP_OCI_CALL( OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); - - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column && column->piecewise) { - column->retlen4 += column->cb_retlen; - } - } - } - - if (statement->errcode == OCI_SUCCESS_WITH_INFO || statement->errcode == OCI_SUCCESS) { - statement->has_data = 1; - - /* do the stuff needed for OCIDefineByName */ - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column == NULL) { - continue; - } - - if (!column->define) { - continue; - } - - zval_dtor(column->define->zval); - php_oci_column_to_zval(column, column->define->zval, 0 TSRMLS_CC); - } - - return 0; - } - - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - - statement->has_data = 0; - - return 1; -} -/* }}} */ - -/* {{{ php_oci_statement_get_column() - Get column from the result set */ -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, long column_name_len TSRMLS_DC) -{ - php_oci_out_column *column = NULL; - int i; - - if (statement->columns == NULL) { /* we release the columns at the end of a fetch */ - return NULL; - } - - if (column_name) { - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column == NULL) { - continue; - } else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) { - return column; - } - } - } else if (column_index != -1) { - if (zend_hash_index_find(statement->columns, column_index, (void **)&column) == FAILURE) { - return NULL; - } - return column; - } - - return NULL; -} -/* }}} */ - -/* {{{ php_oci_statement_execute() - Execute statement */ -int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) -{ - php_oci_out_column *outcol; - php_oci_out_column column; - OCIParam *param = NULL; - text *colname; - ub4 counter; - ub2 define_type; - ub4 iters; - ub4 colcount; - ub2 dynamic; - int dtype; - dvoid *buf; - php_oci_descriptor *descr; - - switch (mode) { - case OCI_COMMIT_ON_SUCCESS: - case OCI_DEFAULT: - /* only these two are allowed */ - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode); - return 1; - break; - } - - if (!statement->stmttype) { - /* get statement type */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } - - if (statement->stmttype == OCI_STMT_SELECT) { - iters = 0; - } else { - iters = 1; - } - - if (statement->last_query) { - /* if we execute refcursors we don't have a query and - we don't want to execute!!! */ - - if (statement->binds) { - zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_pre_exec TSRMLS_CC); - } - - /* execute statement */ - statement->errcode = PHP_OCI_CALL(OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - if (statement->binds) { - zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec TSRMLS_CC); - } - - if (mode & OCI_COMMIT_ON_SUCCESS) { - statement->connection->needs_commit = 0; - } else { - statement->connection->needs_commit = 1; - } - } - - if (statement->stmttype == OCI_STMT_SELECT && statement->executed == 0) { - /* we only need to do the define step is this very statement is executed the first time! */ - statement->executed = 1; - - ALLOC_HASHTABLE(statement->columns); - zend_hash_init(statement->columns, 13, NULL, php_oci_column_hash_dtor, 0); - - counter = 1; - - /* get number of columns */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - statement->ncolumns = colcount; - - for (counter = 1; counter <= colcount; counter++) { - memset(&column,0,sizeof(php_oci_out_column)); - - if (zend_hash_index_update(statement->columns, counter, &column, sizeof(php_oci_out_column), (void**) &outcol) == FAILURE) { - efree(statement->columns); - /* out of memory */ - return 1; - } - - outcol->statement = statement; - - /* get column */ - statement->errcode = PHP_OCI_CALL(OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get column datatype */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get size of the column */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - outcol->storage_size4 = outcol->data_size; - outcol->retlen = outcol->data_size; - - /* get scale of the column */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get precision of the column */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get name of the column */ - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - - outcol->name = estrndup((char*) colname, outcol->name_len); - - /* find a user-setted define */ - if (statement->defines) { - zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define); - } - - buf = 0; - switch (outcol->data_type) { - case SQLT_RSET: - outcol->statement = php_oci_statement_create(statement->connection, NULL, 0, 0 TSRMLS_CC); - outcol->stmtid = outcol->statement->id; - - define_type = SQLT_RSET; - outcol->is_cursor = 1; - outcol->storage_size4 = -1; - outcol->retlen = -1; - dynamic = OCI_DEFAULT; - buf = &(outcol->statement->stmt); - break; - - case SQLT_RDD: /* ROWID */ - case SQLT_BLOB: /* binary LOB */ - case SQLT_CLOB: /* character LOB */ - case SQLT_BFILE: /* binary file LOB */ - define_type = outcol->data_type; - outcol->is_descr = 1; - outcol->storage_size4 = -1; - dynamic = OCI_DEFAULT; - - if (outcol->data_type == SQLT_BFILE) { - dtype = OCI_DTYPE_FILE; - } else if (outcol->data_type == SQLT_RDD ) { - dtype = OCI_DTYPE_ROWID; - } else { - dtype = OCI_DTYPE_LOB; - } - - descr = php_oci_lob_create(statement->connection, dtype TSRMLS_CC); - if (!descr) { - efree(outcol->name); - return 1; - } - outcol->descid = descr->id; - buf = &(descr->descriptor); - break; - - case SQLT_LNG: - case SQLT_LBI: - if (outcol->data_type == SQLT_LBI) { - define_type = SQLT_BIN; - } else { - define_type = SQLT_CHR; - } - outcol->storage_size4 = PHP_OCI_MAX_DATA_SIZE; - outcol->piecewise = 1; - dynamic = OCI_DYNAMIC_FETCH; - break; - - case SQLT_BIN: - default: - define_type = SQLT_CHR; - if ((outcol->data_type == SQLT_DAT) || (outcol->data_type == SQLT_NUM) -#ifdef SQLT_TIMESTAMP - || (outcol->data_type == SQLT_TIMESTAMP) -#endif -#ifdef SQLT_TIMESTAMP_TZ - || (outcol->data_type == SQLT_TIMESTAMP_TZ) -#endif - ) { - outcol->storage_size4 = 512; /* XXX this should fit "most" NLS date-formats and Numbers */ - } else { - outcol->storage_size4++; /* add one for string terminator */ - } - - outcol->storage_size4 *= 3; - - dynamic = OCI_DEFAULT; - buf = outcol->data = (text *) emalloc(outcol->storage_size4); - break; - } - - if (dynamic == OCI_DYNAMIC_FETCH) { - statement->errcode = PHP_OCI_CALL( - OCIDefineByPos, - ( - statement->stmt, /* IN/OUT handle to the requested SQL query */ - (OCIDefine **)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define handle */ - statement->err, /* IN/OUT An error handle */ - counter, /* IN position in the select list */ - (dvoid *)NULL, /* IN/OUT pointer to a buffer */ - outcol->storage_size4, /* IN The size of each valuep buffer in bytes */ - define_type, /* IN The data type */ - (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */ - (ub2 *)NULL, /* IN/OUT Pointer to array of length of data fetched */ - (ub2 *)NULL, /* OUT Pointer to array of column-level return codes */ - OCI_DYNAMIC_FETCH /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */ - ) - ); - - } else { - statement->errcode = PHP_OCI_CALL( - OCIDefineByPos, - ( - statement->stmt, /* IN/OUT handle to the requested SQL query */ - (OCIDefine **)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define handle */ - statement->err, /* IN/OUT An error handle */ - counter, /* IN position in the select list */ - (dvoid *)buf, /* IN/OUT pointer to a buffer */ - outcol->storage_size4, /* IN The size of each valuep buffer in bytes */ - define_type, /* IN The data type */ - (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */ - (ub2 *)&outcol->retlen, /* IN/OUT Pointer to array of length of data fetched */ - (ub2 *)&outcol->retcode, /* OUT Pointer to array of column-level return codes */ - OCI_DEFAULT /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */ - ) - ); - - } - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 0; - } - } - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_statement_cancel() - Cancel statement */ -int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC) -{ - - return php_oci_statement_fetch(statement, 0 TSRMLS_CC); - -} /* }}} */ - -/* {{{ php_oci_statement_free() - Destroy statement handle and free associated resources */ -void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) -{ - if (statement->stmt) { -#if HAVE_OCI_STMT_PREPARE2 - if (statement->last_query_len) { /* FIXME: magical */ - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_DEFAULT)); - } - else { - PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT)); - } -#else - PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT)); -#endif - statement->stmt = 0; - } - - if (statement->err) { - PHP_OCI_CALL(OCIHandleFree, (statement->err, OCI_HTYPE_ERROR)); - statement->err = 0; - } - - if (statement->last_query) { - efree(statement->last_query); - } - - if (statement->columns) { - zend_hash_destroy(statement->columns); - efree(statement->columns); - } - - if (statement->binds) { - zend_hash_destroy(statement->binds); - efree(statement->binds); - } - - if (statement->defines) { - zend_hash_destroy(statement->defines); - efree(statement->defines); - } - - zend_list_delete(statement->connection->rsrc_id); - efree(statement); -} /* }}} */ - -/* {{{ php_oci_bind_pre_exec() - Helper function */ -int php_oci_bind_pre_exec(void *data TSRMLS_DC) -{ - php_oci_bind *bind = (php_oci_bind *) data; - - /* reset all bind stuff to a normal state..-. */ - - bind->indicator = 0; - - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_post_exec() - Helper function */ -int php_oci_bind_post_exec(void *data TSRMLS_DC) -{ - php_oci_bind *bind = (php_oci_bind *) data; - - if (bind->indicator == -1) { /* NULL */ - zval *val = bind->zval; - if (Z_TYPE_P(val) == IS_STRING) { - *Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */ - } - zval_dtor(val); - ZVAL_NULL(val); - } else if (Z_TYPE_P(bind->zval) == IS_STRING && Z_STRLEN_P(bind->zval) > 0) { - Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); - Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; - } - - - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_by_name() - Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long maxlength, long type TSRMLS_DC) -{ - php_oci_collection *bind_collection = NULL; - php_oci_descriptor *bind_descriptor = NULL; - php_oci_statement *bind_statement = NULL; - dvoid *oci_desc = NULL; - /* dvoid *php_oci_collection = NULL; */ - OCIStmt *oci_stmt = NULL; - dvoid *bind_data = NULL; - php_oci_bind bind, *bindp; - int mode = OCI_DATA_AT_EXEC; - sb4 value_sz = -1; - - switch (type) { -#ifdef PHP_OCI8_HAVE_COLLECTIONS - case SQLT_NTY: - { - zval **tmp; - - if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); - return 1; - } - - PHP_OCI_ZVAL_TO_COLLECTION_EX(*tmp, bind_collection); - value_sz = sizeof(void*); - mode = OCI_DEFAULT; - - if (!bind_collection->collection) { - return 1; - } - } - break; -#endif - case SQLT_BFILEE: - case SQLT_CFILEE: - case SQLT_CLOB: - case SQLT_BLOB: - case SQLT_RDD: - { - zval **tmp; - - if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); - return 1; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, bind_descriptor); - - value_sz = sizeof(void*); - - oci_desc = bind_descriptor->descriptor; - - if (!oci_desc) { - return 1; - } - } - break; - - case SQLT_INT: - case SQLT_NUM: - convert_to_long(var); - bind_data = (ub4 *)&Z_LVAL_P(var); - value_sz = sizeof(ub4); - mode = OCI_DEFAULT; - break; - - case SQLT_CHR: - /* this is the default case when type was not specified */ - convert_to_string(var); - if (maxlength == -1) { - value_sz = Z_STRLEN_P(var); - } - else { - value_sz = maxlength; - } - break; - - case SQLT_RSET: - PHP_OCI_ZVAL_TO_STATEMENT_EX(var, bind_statement); - value_sz = sizeof(void*); - - oci_stmt = bind_statement->stmt; - - if (!oci_stmt) { - return 1; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %ld", type); - return 1; - break; - } - - if (value_sz == 0) { - value_sz = 1; - } - - if (!statement->binds) { - ALLOC_HASHTABLE(statement->binds); - zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); - } - - memset((void*)&bind,0,sizeof(php_oci_bind)); - zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp); - - bindp->descriptor = oci_desc; - bindp->statement = oci_stmt; - bindp->zval = var; - zval_add_ref(&var); - - statement->errcode = PHP_OCI_CALL( - OCIBindByName, - ( - statement->stmt, /* statement handle */ - (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ - statement->err, /* error handle */ - (text*) name, /* placeholder name */ - name_len, /* placeholder length */ - (dvoid *)bind_data, /* in/out data */ - value_sz, /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ - (ub2)type, /* in/out data type */ - (dvoid *)&bindp->indicator, /* indicator (ignored) */ - (ub2 *)0, /* size array (ignored) */ - (ub2 *)&bindp->retcode, /* return code (ignored) */ - (ub4)0, /* maxarr_len (PL/SQL only?) */ - (ub4 *)0, /* actual array size (PL/SQL only?) */ - mode /* mode */ - ) - ); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - if (mode == OCI_DATA_AT_EXEC) { - statement->errcode = PHP_OCI_CALL(OCIBindDynamic, (bindp->bind, statement->err, (dvoid *)bindp, php_oci_bind_in_callback, (dvoid *)bindp, php_oci_bind_out_callback)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } - -#ifdef PHP_OCI8_HAVE_COLLECTIONS - if (type == SQLT_NTY) { - /* Bind object */ - statement->errcode = PHP_OCI_CALL(OCIBindObject, (bindp->bind, statement->err, bind_collection->tdo, (dvoid **) &(bind_collection->collection), (ub4 *) 0, (dvoid **) 0, (ub4 *) 0)); - - if (statement->errcode) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } -#endif - - return 0; -} /* }}} */ - -/* {{{ php_oci_bind_in_callback() - Callback used when binding LOBs and VARCHARs */ -sb4 php_oci_bind_in_callback( - dvoid *ictxp, /* context pointer */ - OCIBind *bindp, /* bind handle */ - ub4 iter, /* 0-based execute iteration value */ - ub4 index, /* index of current array for PL/SQL or row index for SQL */ - dvoid **bufpp, /* pointer to data */ - ub4 *alenp, /* size after value/piece has been read */ - ub1 *piecep, /* which piece */ - dvoid **indpp) /* indicator value */ -{ - php_oci_bind *phpbind; - zval *val; - TSRMLS_FETCH(); - - if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); - return OCI_ERROR; - } - - if (ZVAL_IS_NULL(val)) { - /* we're going to insert a NULL column */ - phpbind->indicator = -1; - *bufpp = 0; - *alenp = -1; - *indpp = (dvoid *)&phpbind->indicator; - } else if ((phpbind->descriptor == 0) && (phpbind->statement == 0)) { - /* "normal string bind */ - convert_to_string(val); - - *bufpp = Z_STRVAL_P(val); - *alenp = Z_STRLEN_P(val); - *indpp = (dvoid *)&phpbind->indicator; - } else if (phpbind->statement != 0) { - /* RSET */ - *bufpp = phpbind->statement; - *alenp = -1; /* seems to be allright */ - *indpp = (dvoid *)&phpbind->indicator; - } else { - /* descriptor bind */ - *bufpp = phpbind->descriptor; - *alenp = -1; /* seems to be allright */ - *indpp = (dvoid *)&phpbind->indicator; - } - - *piecep = OCI_ONE_PIECE; /* pass all data in one go */ - - return OCI_CONTINUE; -}/* }}} */ - -/* {{{ php_oci_bind_out_callback() - Callback used when binding LOBs and VARCHARs */ -sb4 php_oci_bind_out_callback( - dvoid *octxp, /* context pointer */ - OCIBind *bindp, /* bind handle */ - ub4 iter, /* 0-based execute iteration value */ - ub4 index, /* index of current array for PL/SQL or row index for SQL */ - dvoid **bufpp, /* pointer to data */ - ub4 **alenpp, /* size after value/piece has been read */ - ub1 *piecep, /* which piece */ - dvoid **indpp, /* indicator value */ - ub2 **rcodepp) /* return code */ -{ - php_oci_bind *phpbind; - zval *val; - sb4 retval = OCI_ERROR; - TSRMLS_FETCH(); - - if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); - return retval; - } - - if ((Z_TYPE_P(val) == IS_OBJECT) || (Z_TYPE_P(val) == IS_RESOURCE)) { - retval = OCI_CONTINUE; - } else { - convert_to_string(val); - zval_dtor(val); - - Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ - Z_STRVAL_P(val) = emalloc(Z_STRLEN_P(phpbind->zval)); - - /* XXX we assume that zend-zval len has 4 bytes */ - *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); - *bufpp = Z_STRVAL_P(phpbind->zval); - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - retval = OCI_CONTINUE; - } - - return retval; -} -/* }}} */ - -/* {{{ php_oci_statement_get_column_helper() - Helper function to get column by name and index */ -php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS) -{ - zval *z_statement, *column_index; - php_oci_statement *statement; - php_oci_out_column *column; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_statement, &column_index) == FAILURE) { - return NULL; - } - - statement = (php_oci_statement *) zend_fetch_resource(&z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement); - - if (!statement) { - return NULL; - } - - if (Z_TYPE_P(column_index) == IS_STRING) { - column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC); - if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index)); - return NULL; - } - } - else { - convert_to_long(column_index); - column = php_oci_statement_get_column(statement, Z_LVAL_P(column_index), NULL, 0 TSRMLS_CC); - if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_P(column_index)); - return NULL; - } - } - return column; -} /* }}} */ - -/* {{{ php_oci_statement_get_type() - Return type of the statement */ -int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC) -{ - ub2 statement_type; - - *type = 0; - - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - *type = statement_type; - - return 0; -} /* }}} */ - -/* {{{ php_oci_statement_get_numrows() - Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */ -int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC) -{ - ub4 statement_numrows; - - *numrows = 0; - - statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); - - if (statement->errcode != OCI_SUCCESS) { - php_oci_error(statement->err, statement->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - *numrows = statement_numrows; - - return 0; -} /* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml deleted file mode 100644 index ce9ff36ffd14d..0000000000000 --- a/ext/oci8/package.xml +++ /dev/null @@ -1,201 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>oci8</name> - <summary>OCI8 functions</summary> - <maintainers> - <maintainer> - <user>tony2001</user> - <name>Antony Dovgal</name> - <email>tony2001@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>andi</user> - <name>Andi Gutmans</name> - <email>andi@zend.com</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> - These functions allow you to access Oracle database servers using - the Oracle Call Interface (OCI8). - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>1.2</version> - <date>2005-??-??</date> - <notes> - Fixed PECL bug #5571 (oci_new_connect() not closed by oci_close()) - Fixed bug #33383 (crash when retrieving empty BLOBs) - </notes> - </release> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="doc" name="README"/> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="oci8.dsp"/> - <file role="src" name="oci8.c"/> - <file role="src" name="oci8_interface.c"/> - <file role="src" name="oci8_lob.c"/> - <file role="src" name="oci8_statement.c"/> - <file role="src" name="oci8_collection.c"/> - <file role="src" name="php_oci8.h"/> - <file role="src" name="php_oci8_int.h"/> - <file role="test" name="tests/bug26133.phpt"/> - <file role="test" name="tests/bug27303_2.phpt"/> - <file role="test" name="tests/bug27303_3.phpt"/> - <file role="test" name="tests/bug27303_4.phpt"/> - <file role="test" name="tests/bug27303.phpt"/> - <file role="test" name="tests/bug32325.phpt"/> - <file role="test" name="tests/close.phpt"/> - <file role="test" name="tests/coll_001.phpt"/> - <file role="test" name="tests/coll_002_func.phpt"/> - <file role="test" name="tests/coll_002.phpt"/> - <file role="test" name="tests/coll_003_func.phpt"/> - <file role="test" name="tests/coll_003.phpt"/> - <file role="test" name="tests/coll_004_func.phpt"/> - <file role="test" name="tests/coll_004.phpt"/> - <file role="test" name="tests/coll_005.phpt"/> - <file role="test" name="tests/coll_006_func.phpt"/> - <file role="test" name="tests/coll_006.phpt"/> - <file role="test" name="tests/coll_007.phpt"/> - <file role="test" name="tests/coll_008.phpt"/> - <file role="test" name="tests/coll_009_func.phpt"/> - <file role="test" name="tests/coll_009.phpt"/> - <file role="test" name="tests/coll_010_func.phpt"/> - <file role="test" name="tests/coll_010.phpt"/> - <file role="test" name="tests/coll_011_func.phpt"/> - <file role="test" name="tests/coll_011.phpt"/> - <file role="test" name="tests/coll_012_func.phpt"/> - <file role="test" name="tests/coll_012.phpt"/> - <file role="test" name="tests/coll_013_func.phpt"/> - <file role="test" name="tests/coll_013.phpt"/> - <file role="test" name="tests/coll_014_func.phpt"/> - <file role="test" name="tests/coll_014.phpt"/> - <file role="test" name="tests/coll_015_func.phpt"/> - <file role="test" name="tests/coll_015.phpt"/> - <file role="test" name="tests/coll_016_func.phpt"/> - <file role="test" name="tests/coll_016.phpt"/> - <file role="test" name="tests/coll_017_func.phpt"/> - <file role="test" name="tests/coll_017.phpt"/> - <file role="test" name="tests/commit_old.phpt"/> - <file role="test" name="tests/commit.phpt"/> - <file role="test" name="tests/connect_1_old.phpt"/> - <file role="test" name="tests/connect_1.phpt"/> - <file role="test" name="tests/connect.inc"/> - <file role="test" name="tests/connect_old.phpt"/> - <file role="test" name="tests/connect.phpt"/> - <file role="test" name="tests/connect_without_oracle_home_old.phpt"/> - <file role="test" name="tests/connect_without_oracle_home.phpt"/> - <file role="test" name="tests/create_table.inc"/> - <file role="test" name="tests/create_type.inc"/> - <file role="test" name="tests/cursor_bind_err.phpt"/> - <file role="test" name="tests/cursors_old.phpt"/> - <file role="test" name="tests/cursors.phpt"/> - <file role="test" name="tests/debug.phpt"/> - <file role="test" name="tests/default_prefetch1.phpt"/> - <file role="test" name="tests/default_prefetch2.phpt"/> - <file role="test" name="tests/default_prefetch.phpt"/> - <file role="test" name="tests/define_old.phpt"/> - <file role="test" name="tests/define.phpt"/> - <file role="test" name="tests/drop_table.inc"/> - <file role="test" name="tests/drop_type.inc"/> - <file role="test" name="tests/error_old.phpt"/> - <file role="test" name="tests/error.phpt"/> - <file role="test" name="tests/exec_fetch.phpt"/> - <file role="test" name="tests/fetch_all.phpt"/> - <file role="test" name="tests/fetch_array.phpt"/> - <file role="test" name="tests/fetch_assoc.phpt"/> - <file role="test" name="tests/fetch_into1.phpt"/> - <file role="test" name="tests/fetch_into2.phpt"/> - <file role="test" name="tests/fetch_into.phpt"/> - <file role="test" name="tests/fetch_object.phpt"/> - <file role="test" name="tests/fetch.phpt"/> - <file role="test" name="tests/fetch_row.phpt"/> - <file role="test" name="tests/field_funcs_old.phpt"/> - <file role="test" name="tests/field_funcs.phpt"/> - <file role="test" name="tests/lob_001.phpt"/> - <file role="test" name="tests/lob_002.phpt"/> - <file role="test" name="tests/lob_003.phpt"/> - <file role="test" name="tests/lob_004.phpt"/> - <file role="test" name="tests/lob_005.phpt"/> - <file role="test" name="tests/lob_006.phpt"/> - <file role="test" name="tests/lob_007.phpt"/> - <file role="test" name="tests/lob_008.phpt"/> - <file role="test" name="tests/lob_009.phpt"/> - <file role="test" name="tests/lob_009.txt"/> - <file role="test" name="tests/lob_010.phpt"/> - <file role="test" name="tests/lob_011.phpt"/> - <file role="test" name="tests/lob_012.phpt"/> - <file role="test" name="tests/lob_013.phpt"/> - <file role="test" name="tests/lob_014.phpt"/> - <file role="test" name="tests/lob_015.phpt"/> - <file role="test" name="tests/lob_016.phpt"/> - <file role="test" name="tests/lob_017.phpt"/> - <file role="test" name="tests/lob_018.phpt"/> - <file role="test" name="tests/lob_temp1.phpt"/> - <file role="test" name="tests/lob_temp.phpt"/> - <file role="test" name="tests/num.phpt"/> - <file role="test" name="tests/oci_execute_segfault.phpt"/> - <file role="test" name="tests/old_oci_close1.phpt"/> - <file role="test" name="tests/old_oci_close.phpt"/> - <file role="test" name="tests/password_new.phpt"/> - <file role="test" name="tests/password_old.phpt"/> - <file role="test" name="tests/password.phpt"/> - <file role="test" name="tests/persistent.phpt"/> - <file role="test" name="tests/prefetch_old.phpt"/> - <file role="test" name="tests/prefetch.phpt"/> - <file role="test" name="tests/privileged_connect1.phpt"/> - <file role="test" name="tests/privileged_connect.phpt"/> - <file role="test" name="tests/serverversion.phpt"/> - <file role="test" name="tests/skipif.inc"/> - <file role="test" name="tests/statement_cache.phpt"/> - <file role="test" name="tests/statement_type_old.phpt"/> - <file role="test" name="tests/statement_type.phpt"/> - <file role="test" name="tests/uncommitted.phpt"/> - </filelist> - <configureoptions> - <configureoption name="with-oci8" default="autodetect" prompt="Please provide the path to ORACLE_HOME dir. Use 'instantclient,/path/to/instant/client/lib' if you're compiling against Oracle Instant Client"/> - </configureoptions> - <changelog> - <release> - <state>beta</state> - <version>1.1.1</version> - <date>2005-09-22</date> - <notes> - Fixed segfault when binding empty values. - Fixed problem with oci_error() without arguments. - </notes> - </release> - <release> - <state>beta</state> - <version>1.1</version> - <date>2005-09-07</date> - <notes> - This release fixes a huge amount of bugs and adds support of - statement caching, external credentials etc. - See official announce for details. - </notes> - </release> - <release> - <state>beta</state> - <version>1.0</version> - <date>2004-03-19</date> - <notes> - package.xml added to support installation using pear installer - </notes> - </release> - </changelog> - </package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h deleted file mode 100644 index 6397d3fede704..0000000000000 --- a/ext/oci8/php_oci8.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if HAVE_OCI8 -# ifndef PHP_OCI8_H -# define PHP_OCI8_H - -#ifdef PHP_WIN32 -#define PHP_OCI_API __declspec(dllexport) -#else -#define PHP_OCI_API -#endif - -#ifdef ZTS -# include "TSRM.h" -#endif - -extern zend_module_entry oci8_module_entry; -#define phpext_oci8_ptr &oci8_module_entry - - -PHP_MINIT_FUNCTION(oci); -PHP_RINIT_FUNCTION(oci); -PHP_MSHUTDOWN_FUNCTION(oci); -PHP_RSHUTDOWN_FUNCTION(oci); -PHP_MINFO_FUNCTION(oci); - -# endif /* !PHP_OCI8_H */ -#else /* !HAVE_OCI8 */ - -# define oci8_module_ptr NULL - -#endif /* HAVE_OCI8 */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - - diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h deleted file mode 100644 index 7c57f8d9fe908..0000000000000 --- a/ext/oci8/php_oci8_int.h +++ /dev/null @@ -1,405 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Thies C. Arntzen <thies@thieso.net> | - | | - | Collection support by Andy Sautins <asautins@veripost.net> | - | Temporary LOB support by David Benson <dbenson@mancala.com> | - | ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> | - | | - | Redesigned by: Antony Dovgal <antony@zend.com> | - | Andi Gutmans <andi@zend.com> | - | Wez Furlong <wez@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if HAVE_OCI8 -# ifndef PHP_OCI8_INT_H -# define PHP_OCI8_INT_H - -/* misc defines {{{ */ -# if (defined(__osf__) && defined(__alpha)) -# ifndef A_OSF -# define A_OSF -# endif -# ifndef OSF1 -# define OSF1 -# endif -# ifndef _INTRINSICS -# define _INTRINSICS -# endif -# endif /* osf alpha */ - -#if defined(min) -#undef min -#endif -#if defined(max) -#undef max -#endif -/* }}} */ - -#include <oci.h> - -extern int le_connection; -extern int le_pconnection; -extern int le_statement; -extern int le_descriptor; -#ifdef PHP_OCI8_HAVE_COLLECTIONS -extern int le_collection; -#endif -extern int le_server; -extern int le_session; - -extern zend_class_entry *oci_lob_class_entry_ptr; -#ifdef PHP_OCI8_HAVE_COLLECTIONS -extern zend_class_entry *oci_coll_class_entry_ptr; -#endif - -/* constants {{{ */ -#define PHP_OCI_SEEK_SET 0 -#define PHP_OCI_SEEK_CUR 1 -#define PHP_OCI_SEEK_END 2 - -#define PHP_OCI_MAX_NAME_LEN 64 -#define PHP_OCI_MAX_DATA_SIZE INT_MAX -#define PHP_OCI_PIECE_SIZE (64*1024)-1 -#define PHP_OCI_LOB_BUFFER_SIZE 1048576l - -#define PHP_OCI_ASSOC 1<<0 -#define PHP_OCI_NUM 1<<1 -#define PHP_OCI_BOTH (PHP_OCI_ASSOC|PHP_OCI_NUM) - -#define PHP_OCI_RETURN_NULLS 1<<2 -#define PHP_OCI_RETURN_LOBS 1<<3 - -#define PHP_OCI_FETCHSTATEMENT_BY_COLUMN 1<<4 -#define PHP_OCI_FETCHSTATEMENT_BY_ROW 1<<5 -#define PHP_OCI_FETCHSTATEMENT_BY (PHP_OCI_FETCHSTATEMENT_BY_COLUMN | PHP_OCI_FETCHSTATEMENT_BY_ROW) - -#define PHP_OCI_LOB_BUFFER_DISABLED 0 -#define PHP_OCI_LOB_BUFFER_ENABLED 1 -#define PHP_OCI_LOB_BUFFER_USED 2 - -/* }}} */ - -typedef struct { /* php_oci_connection {{{ */ - OCIEnv *env; /* private env handle */ - ub2 charset; /* charset ID */ - OCIServer *server; /* private server handle */ - OCISvcCtx *svc; /* private service context handle */ - OCISession *session; /* private session handle */ - OCIError *err; /* private error handle */ - sword errcode; /* last errcode */ - - HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ - unsigned is_open:1; /* hels to determine if the connection is dead or not */ - unsigned is_attached:1; /* hels to determine if we should detach from the server when closing/freeing the connection */ - unsigned is_persistent:1; /* self-descriptive */ - unsigned used_this_request:1; /* helps to determine if we should reset connection's next ping time and check its timeout */ - unsigned needs_commit:1; /* helps to determine if we should rollback this connection on close/shutdown */ - int rsrc_id; /* resource ID */ - time_t idle_expiry; /* time when the connection will be considered as expired */ - time_t next_ping; /* time of the next ping */ - char *hash_key; /* hashed details of the connection */ -} php_oci_connection; /* }}} */ - -typedef struct { /* php_oci_descriptor {{{ */ - int id; - php_oci_connection *connection; /* parent connection handle */ - dvoid *descriptor; /* OCI descriptor handle */ - ub4 type; /* descriptor type */ - int lob_current_position; /* LOB internal pointer */ - int lob_size; /* cached LOB size. -1 = Lob wasn't initialized yet */ - int buffering; /* cached buffering flag. 0 - off, 1 - on, 2 - on and buffer was used */ -} php_oci_descriptor; /* }}} */ - -typedef struct { /* php_oci_collection {{{ */ - int id; - php_oci_connection *connection; /* parent connection handle */ - OCIType *tdo; /* collection's type handle */ - OCITypeCode coll_typecode; /* collection's typecode handle */ - OCIRef *elem_ref; /* element's reference handle */ - OCIType *element_type; /* element's type handle */ - OCITypeCode element_typecode; /* element's typecode handle */ - OCIColl *collection; /* collection handle */ -} php_oci_collection; /* }}} */ - -typedef struct { /* php_oci_define {{{ */ - zval *zval; /* zval used in define */ - text *name; /* placeholder's name */ - ub4 name_len; /* placeholder's name length */ - ub4 type; /* define type */ -} php_oci_define; /* }}} */ - -typedef struct { /* php_oci_statement {{{ */ - int id; - php_oci_connection *connection; /* parent connection handle */ - sword errcode; /* last errcode*/ - OCIError *err; /* private error handle */ - OCIStmt *stmt; /* statement handle */ - char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor recieved from Oracle */ - long last_query_len; /* last query length */ - HashTable *columns; /* hash containing all the result columns */ - HashTable *binds; /* binds hash */ - HashTable *defines; /* defines hash */ - int ncolumns; /* number of columns in the result */ - unsigned executed:1; /* statement executed flag */ - unsigned has_data:1; /* statement has more data flag */ - ub2 stmttype; /* statement type */ -} php_oci_statement; /* }}} */ - -typedef struct { /* php_oci_bind {{{ */ - OCIBind *bind; /* bind handle */ - zval *zval; /* value */ - dvoid *descriptor; /* used for binding of LOBS etc */ - OCIStmt *statement; /* used for binding REFCURSORs */ - sb2 indicator; /* */ - ub2 retcode; /* */ -} php_oci_bind; /* }}} */ - -typedef struct { /* php_oci_out_column {{{ */ - php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ - OCIDefine *oci_define; /* define handle */ - char *name; /* column name */ - ub4 name_len; /* column name length */ - ub2 data_type; /* column data type */ - ub2 data_size; /* data size */ - ub4 storage_size4; /* size used when allocating buffers */ - sb2 indicator; /* */ - ub2 retcode; /* code returned when fetching this particular column */ - ub2 retlen; /* */ - ub4 retlen4; /* */ - ub2 is_descr; /* column contains a descriptor */ - ub2 is_cursor; /* column contains a cursor */ - int stmtid; /* statement id for cursors */ - int descid; /* descriptor id for descriptors */ - void *data; /* */ - php_oci_define *define; /* define handle */ - int piecewise; /* column is fetched piece-by-piece */ - ub4 cb_retlen; /* */ - ub2 scale; /* column scale */ - ub2 precision; /* column precision */ -} php_oci_out_column; /* }}} */ - -/* {{{ macros */ - -#define PHP_OCI_CALL(func, params) \ - func params; \ - if (OCI_G(debug_mode)) { \ - php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \ - } - -#define PHP_OCI_HANDLE_ERROR(connection, errcode) \ -{ \ - switch (errcode) { \ - case 1013: \ - zend_bailout(); \ - break; \ - case 22: \ - case 1012: \ - case 3113: \ - case 604: \ - case 1041: \ - case 3114: \ - connection->is_open = 0; \ - break; \ - } \ -} \ - -#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \ - resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \ - zend_list_addref(resource->connection->rsrc_id); - -#define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \ - ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, &zval, -1, "oci8 connection", le_connection, le_pconnection); - -#define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \ - ZEND_FETCH_RESOURCE(statement, php_oci_statement *, &zval, -1, "oci8 statement", le_statement) - -#define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \ - ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, &zval, -1, "oci8 descriptor", le_descriptor) - -#define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \ - ZEND_FETCH_RESOURCE(collection, php_oci_collection *, &zval, -1, "oci8 collection", le_collection) - -#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \ - var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \ - if (!var) { \ - return 1; \ - } - -#define PHP_OCI_ZVAL_TO_CONNECTION_EX(zval, connection) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, connection, php_oci_connection *, "oci8 connection", le_connection) - -#define PHP_OCI_ZVAL_TO_STATEMENT_EX(zval, statement) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, statement, php_oci_statement *, "oci8 statement", le_statement) - -#define PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(zval, descriptor) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, descriptor, php_oci_descriptor *, "oci8 descriptor", le_descriptor) - -#define PHP_OCI_ZVAL_TO_COLLECTION_EX(zval, collection) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, collection, php_oci_collection *, "oci8 collection", le_collection) - -/* }}} */ - -/* PROTOS */ - -/* main prototypes {{{ */ - -void php_oci_column_hash_dtor (void *data); -void php_oci_define_hash_dtor (void *data); -void php_oci_bind_hash_dtor (void *data); -void php_oci_descriptor_flush_hash_dtor (void *data); - -sb4 php_oci_error (OCIError *, sword TSRMLS_DC); -sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC); -#ifdef HAVE_OCI8_ATTR_STATEMENT -int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); -#endif - -void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); - -int php_oci_connection_rollback(php_oci_connection * TSRMLS_DC); -int php_oci_connection_commit(php_oci_connection * TSRMLS_DC); - -int php_oci_password_change(php_oci_connection *, char *, int, char *, int, char *, int TSRMLS_DC); -int php_oci_server_get_version(php_oci_connection *, char ** TSRMLS_DC); - -void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int, int); -int php_oci_column_to_zval(php_oci_out_column *, zval *, int TSRMLS_DC); - -/* }}} */ - -/* lob related prototypes {{{ */ - -php_oci_descriptor * php_oci_lob_create (php_oci_connection *, long TSRMLS_DC); -int php_oci_lob_get_length (php_oci_descriptor *, ub4 * TSRMLS_DC); -int php_oci_lob_read (php_oci_descriptor *, long, long, char **, ub4 * TSRMLS_DC); -int php_oci_lob_write (php_oci_descriptor *, ub4, char *, int, ub4 * TSRMLS_DC); -int php_oci_lob_flush (php_oci_descriptor *, int TSRMLS_DC); -int php_oci_lob_set_buffering (php_oci_descriptor *, int TSRMLS_DC); -int php_oci_lob_get_buffering (php_oci_descriptor * TSRMLS_DC); -int php_oci_lob_copy (php_oci_descriptor *, php_oci_descriptor *, long TSRMLS_DC); -#ifdef HAVE_OCI8_TEMP_LOB -int php_oci_lob_close (php_oci_descriptor * TSRMLS_DC); -int php_oci_lob_write_tmp (php_oci_descriptor *, ub1, char *, int TSRMLS_DC); -#endif -void php_oci_lob_free(php_oci_descriptor * TSRMLS_DC); -int php_oci_lob_import(php_oci_descriptor *descriptor, char * TSRMLS_DC); -int php_oci_lob_append (php_oci_descriptor *, php_oci_descriptor * TSRMLS_DC); -int php_oci_lob_truncate (php_oci_descriptor *, long TSRMLS_DC); -int php_oci_lob_erase (php_oci_descriptor *, long, long, ub4 * TSRMLS_DC); -int php_oci_lob_is_equal (php_oci_descriptor *, php_oci_descriptor *, boolean * TSRMLS_DC); - -/* }}} */ - -/* collection related prototypes {{{ */ - -php_oci_collection * php_oci_collection_create(php_oci_connection *, char *, int, char *, int TSRMLS_DC); -int php_oci_collection_size(php_oci_collection *, sb4 * TSRMLS_DC); -int php_oci_collection_max(php_oci_collection *, long * TSRMLS_DC); -int php_oci_collection_trim(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_append(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_element_get(php_oci_collection *, long, zval** TSRMLS_DC); -int php_oci_collection_element_set(php_oci_collection *, long, char*, int TSRMLS_DC); -int php_oci_collection_element_set_null(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_element_set_date(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_number(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_string(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_assign(php_oci_collection *, php_oci_collection * TSRMLS_DC); -void php_oci_collection_close(php_oci_collection * TSRMLS_DC); -int php_oci_collection_append_null(php_oci_collection * TSRMLS_DC); -int php_oci_collection_append_date(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_number(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_string(php_oci_collection *, char *, int TSRMLS_DC); - - -/* }}} */ - -/* statement related prototypes {{{ */ - -php_oci_statement * php_oci_statement_create (php_oci_connection *, char *, long, zend_bool TSRMLS_DC); -int php_oci_statement_set_prefetch (php_oci_statement *, ub4 TSRMLS_DC); -int php_oci_statement_fetch (php_oci_statement *, ub4 TSRMLS_DC); -php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long, char*, long TSRMLS_DC); -int php_oci_statement_execute (php_oci_statement *, ub4 TSRMLS_DC); -int php_oci_statement_cancel (php_oci_statement * TSRMLS_DC); -void php_oci_statement_free (php_oci_statement * TSRMLS_DC); -int php_oci_bind_pre_exec(void *data TSRMLS_DC); -int php_oci_bind_post_exec(void *data TSRMLS_DC); -int php_oci_bind_by_name(php_oci_statement *, char *, int, zval*, long, long TSRMLS_DC); -sb4 php_oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); -sb4 php_oci_bind_out_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 **, ub1 *, dvoid **, ub2 **); -php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS); - -int php_oci_statement_get_type(php_oci_statement *, ub2 * TSRMLS_DC); -int php_oci_statement_get_numrows(php_oci_statement *, ub4 * TSRMLS_DC); - -/* }}} */ - -ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ */ - sword errcode; /* global last error code (used when connect fails, for example) */ - OCIError *err; /* global error handle */ - - /* - char *default_username; - char *default_password; - char *default_dbname; - */ - - zend_bool debug_mode; /* debug mode flag */ - - long max_persistent; /* maximum number of persistent connections per process */ - long num_persistent; /* number of existing persistent connections */ - long num_links; /* non-persistent + persistent connections */ - long ping_interval; /* time interval between pings */ - long persistent_timeout; /* time period after which idle persistent connection is considered expired */ - long statement_cache_size; /* statement cache size. used with 9i+ clients only*/ - long default_prefetch; /* default prefetch setting */ - zend_bool privileged_connect; /* privileged connect flag (On/Off) */ - zend_bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */ - - int shutdown; /* in shutdown flag */ - - OCIEnv *env; /* global environment handle */ - -ZEND_END_MODULE_GLOBALS(oci) /* }}} */ - -#ifdef ZTS -#define OCI_G(v) TSRMG(oci_globals_id, zend_oci_globals *, v) -#else -#define OCI_G(v) (oci_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(oci) - -# endif /* !PHP_OCI8_INT_H */ -#else /* !HAVE_OCI8 */ - -# define oci8_module_ptr NULL - -#endif /* HAVE_OCI8 */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - - diff --git a/ext/oci8/tests/bind_empty.phpt b/ext/oci8/tests/bind_empty.phpt deleted file mode 100644 index 40886160556a2..0000000000000 --- a/ext/oci8/tests/bind_empty.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -binding empty values ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$drop = "DROP table bind_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -$create = "CREATE table bind_test(name VARCHAR(10))"; -$statement = oci_parse($c, $create); -oci_execute($statement); - - -$name = null; -$stmt = oci_parse($c, "UPDATE bind_test SET name=:name"); -oci_bind_by_name($stmt, ":name", &$name); - -$res = oci_execute($stmt); - -$name = ""; -$stmt = oci_parse($c, "UPDATE bind_test SET name=:name"); -oci_bind_by_name($stmt, ":name", &$name); - -$res = oci_execute($stmt); - -$drop = "DROP table bind_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -Done diff --git a/ext/oci8/tests/bug26133.phpt b/ext/oci8/tests/bug26133.phpt deleted file mode 100644 index a0492cfde67d3..0000000000000 --- a/ext/oci8/tests/bug26133.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #26133 (ocifreedesc() segfault) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - - require dirname(__FILE__).'/connect.inc'; - require dirname(__FILE__).'/create_table.inc'; - - if ($c) { - $ora_sql = "INSERT INTO - ".$schema.$table_name." (id, value) - VALUES ('1','1') - RETURNING - ROWID - INTO :v_rowid "; - - $statement = OCIParse($c,$ora_sql); - $rowid = OCINewDescriptor($c,OCI_D_ROWID); - OCIBindByName($statement,":v_rowid", $rowid,-1,OCI_B_ROWID); - if (OCIExecute($statement)) { - OCICommit($c); - } - OCIFreeStatement($statement); - $rowid->free(); - } - - require dirname(__FILE__).'/drop_table.inc'; - - echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/ext/oci8/tests/bug27303.phpt b/ext/oci8/tests/bug27303.phpt deleted file mode 100644 index 22a1f6d717f7f..0000000000000 --- a/ext/oci8/tests/bug27303.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -bug #27303 (OCIBindByName binds numeric PHP values as characters) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$create_st = array(); -$create_st[] = "drop sequence myseq"; -$create_st[] = "drop table mytab"; -$create_st[] = "create sequence myseq"; -$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -define('MYLIMIT', 200); -define('INITMYBV', 11); - -$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; - -$stid = OCIParse($c, $stmt); -if (!$stid) { echo "Parse error"; die; } - -//$mybv = INITMYBV; // Uncomment this for the 2nd test only -$r = OCIBindByName($stid, ':MYBV', $mybv /*, 5 */); // Uncomment this for the 3rd test only -if (!$r) { echo "Bind error"; die; } - -for ($i = 1; $i < MYLIMIT; $i++) { - $r = OCIExecute($stid, OCI_DEFAULT); - if (!$r) { echo "Execute error"; die; } - var_dump($mybv); -} - -OCICommit($c); - -$drop_st = array(); -$drop_st[] = "drop sequence myseq"; -$drop_st[] = "drop table mytab"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt deleted file mode 100644 index 39c7c1099a55b..0000000000000 --- a/ext/oci8/tests/bug27303_2.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -bug #27303 (OCIBindByName binds numeric PHP values as characters) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$create_st = array(); -$create_st[] = "drop sequence myseq"; -$create_st[] = "drop table mytab"; -$create_st[] = "create sequence myseq"; -$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -define('MYLIMIT', 200); -define('INITMYBV', 11); - -$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; - -$stid = OCIParse($c, $stmt); -if (!$stid) { echo "Parse error"; die; } - -$mybv = INITMYBV; // Uncomment this for the 2nd test only -$r = OCIBindByName($stid, ':MYBV', $mybv /*, 5 */); // Uncomment this for the 3rd test only -if (!$r) { echo "Bind error"; die; } - -for ($i = 1; $i < MYLIMIT; $i++) { - $r = OCIExecute($stid, OCI_DEFAULT); - if (!$r) { echo "Execute error"; die; } - var_dump($mybv); -} - -OCICommit($c); - -$drop_st = array(); -$drop_st[] = "drop sequence myseq"; -$drop_st[] = "drop table mytab"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt deleted file mode 100644 index 137f9070764dc..0000000000000 --- a/ext/oci8/tests/bug27303_3.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -bug #27303 (OCIBindByName binds numeric PHP values as characters) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$create_st = array(); -$create_st[] = "drop sequence myseq"; -$create_st[] = "drop table mytab"; -$create_st[] = "create sequence myseq"; -$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -define('MYLIMIT', 200); -define('INITMYBV', 11); - -$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; - -$stid = OCIParse($c, $stmt); -if (!$stid) { echo "Parse error"; die; } - -$mybv = INITMYBV; // Uncomment this for the 2nd test only -$r = OCIBindByName($stid, ':MYBV', $mybv, 5, SQLT_INT); // Uncomment this for the 3rd test only -if (!$r) { echo "Bind error"; die; } - -for ($i = 1; $i < MYLIMIT; $i++) { - $r = OCIExecute($stid, OCI_DEFAULT); - if (!$r) { echo "Execute error"; die; } - var_dump($mybv); -} - -OCICommit($c); - -$drop_st = array(); -$drop_st[] = "drop sequence myseq"; -$drop_st[] = "drop table mytab"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -echo "Done\n"; -?> ---EXPECTF-- -int(1) -int(2) -int(3) -int(4) -int(5) -int(6) -int(7) -int(8) -int(9) -int(10) -int(11) -int(12) -int(13) -int(14) -int(15) -int(16) -int(17) -int(18) -int(19) -int(20) -int(21) -int(22) -int(23) -int(24) -int(25) -int(26) -int(27) -int(28) -int(29) -int(30) -int(31) -int(32) -int(33) -int(34) -int(35) -int(36) -int(37) -int(38) -int(39) -int(40) -int(41) -int(42) -int(43) -int(44) -int(45) -int(46) -int(47) -int(48) -int(49) -int(50) -int(51) -int(52) -int(53) -int(54) -int(55) -int(56) -int(57) -int(58) -int(59) -int(60) -int(61) -int(62) -int(63) -int(64) -int(65) -int(66) -int(67) -int(68) -int(69) -int(70) -int(71) -int(72) -int(73) -int(74) -int(75) -int(76) -int(77) -int(78) -int(79) -int(80) -int(81) -int(82) -int(83) -int(84) -int(85) -int(86) -int(87) -int(88) -int(89) -int(90) -int(91) -int(92) -int(93) -int(94) -int(95) -int(96) -int(97) -int(98) -int(99) -int(100) -int(101) -int(102) -int(103) -int(104) -int(105) -int(106) -int(107) -int(108) -int(109) -int(110) -int(111) -int(112) -int(113) -int(114) -int(115) -int(116) -int(117) -int(118) -int(119) -int(120) -int(121) -int(122) -int(123) -int(124) -int(125) -int(126) -int(127) -int(128) -int(129) -int(130) -int(131) -int(132) -int(133) -int(134) -int(135) -int(136) -int(137) -int(138) -int(139) -int(140) -int(141) -int(142) -int(143) -int(144) -int(145) -int(146) -int(147) -int(148) -int(149) -int(150) -int(151) -int(152) -int(153) -int(154) -int(155) -int(156) -int(157) -int(158) -int(159) -int(160) -int(161) -int(162) -int(163) -int(164) -int(165) -int(166) -int(167) -int(168) -int(169) -int(170) -int(171) -int(172) -int(173) -int(174) -int(175) -int(176) -int(177) -int(178) -int(179) -int(180) -int(181) -int(182) -int(183) -int(184) -int(185) -int(186) -int(187) -int(188) -int(189) -int(190) -int(191) -int(192) -int(193) -int(194) -int(195) -int(196) -int(197) -int(198) -int(199) -Done diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt deleted file mode 100644 index 70b8d8f36c4b3..0000000000000 --- a/ext/oci8/tests/bug27303_4.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -bug #27303 (OCIBindByName binds numeric PHP values as characters) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$create_st = array(); -$create_st[] = "drop sequence myseq"; -$create_st[] = "drop table mytab"; -$create_st[] = "create sequence myseq"; -$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -define('MYLIMIT', 200); -define('INITMYBV', 11); - -$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; - -$stid = OCIParse($c, $stmt); -if (!$stid) { echo "Parse error"; die; } - -//$mybv = INITMYBV; // Uncomment this for the 2nd test only -$r = OCIBindByName($stid, ':MYBV', $mybv, 0 ); // Uncomment this for the 3rd test only -if (!$r) { echo "Bind error"; die; } - -for ($i = 1; $i < MYLIMIT; $i++) { - $r = OCIExecute($stid, OCI_DEFAULT); - if (!$r) { echo "Execute error"; die; } - var_dump($mybv); -} - -OCICommit($c); - -$drop_st = array(); -$drop_st[] = "drop sequence myseq"; -$drop_st[] = "drop table mytab"; - -foreach ($create_st as $statement) { - $stmt = oci_parse($c, $statement); - oci_execute($stmt); -} - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt deleted file mode 100644 index 1b5dd0d24d372..0000000000000 --- a/ext/oci8/tests/bug32325.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -bug #32325 (Can't retrieve collection using OCI8) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$create_stmt = oci_parse($c, "create or replace type ut_num_list_t as table of number"); -oci_execute($create_stmt); - -$collection = oci_new_collection($c, "UT_NUM_LIST_T"); - -$sql = " - begin - select ut_num_list_t(1,2,3,4) into :list from dual; - end;"; - -$stmt = oci_parse($c, $sql); - -oci_bind_by_name($stmt, ":list", $collection, -1, OCI_B_NTY); -oci_execute($stmt); - -var_dump($collection->size()); -var_dump($collection->getelem(1)); -var_dump($collection->getelem(2)); - -$drop_stmt = oci_parse($c, "drop type ut_num_list_t"); -oci_execute($drop_stmt); - -echo "Done\n"; -?> ---EXPECTF-- -int(4) -float(2) -float(3) -Done diff --git a/ext/oci8/tests/close.phpt b/ext/oci8/tests/close.phpt deleted file mode 100644 index 08bac05ba544d..0000000000000 --- a/ext/oci8/tests/close.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -connect/close/connect ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -oci_close($c); - -oci_connect($user, $password, $dbase); - -echo "Done\n"; -?> ---EXPECTF-- -Done diff --git a/ext/oci8/tests/coll_001.phpt b/ext/oci8/tests/coll_001.phpt deleted file mode 100644 index 8a223f864bc20..0000000000000 --- a/ext/oci8/tests/coll_001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -oci_new_collection() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump(oci_new_collection($c, $type_name)); -var_dump(oci_new_collection($c, "NONEXISTENT")); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} - -Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_002.phpt b/ext/oci8/tests/coll_002.phpt deleted file mode 100644 index 39f0dbf065afd..0000000000000 --- a/ext/oci8/tests/coll_002.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -oci_new_collection() + free() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump($coll1 = oci_new_collection($c, $type_name)); - -var_dump($coll1->free()); -var_dump($coll1->size()); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) - -Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_002_func.phpt b/ext/oci8/tests/coll_002_func.phpt deleted file mode 100644 index 4a7cb209c3e07..0000000000000 --- a/ext/oci8/tests/coll_002_func.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -oci_new_collection() + free() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump($coll1 = oci_new_collection($c, $type_name)); - -var_dump(oci_free_collection($coll1)); -var_dump(oci_collection_size($coll1)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) - -Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_003.phpt b/ext/oci8/tests/coll_003.phpt deleted file mode 100644 index a47816ad2ca85..0000000000000 --- a/ext/oci8/tests/coll_003.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -collection methods ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = oci_new_collection($c, $type_name); - -var_dump($coll1->size()); -var_dump($coll1->max()); -var_dump($coll1->trim(3)); -var_dump($coll1->append(1)); -var_dump($coll1->getElem(0)); -var_dump($coll1->assignElem(0,2)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -int(0) -int(0) - -Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d -bool(false) -bool(true) -float(1) -bool(true) -Done diff --git a/ext/oci8/tests/coll_003_func.phpt b/ext/oci8/tests/coll_003_func.phpt deleted file mode 100644 index 2057b6361a221..0000000000000 --- a/ext/oci8/tests/coll_003_func.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -collection methods ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = oci_new_collection($c, $type_name); - -var_dump(oci_collection_size($coll1)); -var_dump(oci_collection_max($coll1)); -var_dump(oci_collection_trim($coll1, 3)); -var_dump(oci_collection_append($coll1, 1)); -var_dump(oci_collection_element_get($coll1, 0)); -var_dump(oci_collection_element_assign($coll1, 0, 2)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -int(0) -int(0) - -Warning: oci_collection_trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d -bool(false) -bool(true) -float(1) -bool(true) -Done diff --git a/ext/oci8/tests/coll_004.phpt b/ext/oci8/tests/coll_004.phpt deleted file mode 100644 index 4af6d1d90783f..0000000000000 --- a/ext/oci8/tests/coll_004.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_collection_assign() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = oci_new_collection($c, $type_name); -$coll2 = oci_new_collection($c, $type_name); - -var_dump($coll1->append(1)); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(1) -Done diff --git a/ext/oci8/tests/coll_004_func.phpt b/ext/oci8/tests/coll_004_func.phpt deleted file mode 100644 index 9d7f5f6cd98cd..0000000000000 --- a/ext/oci8/tests/coll_004_func.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_collection_assign() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = oci_new_collection($c, $type_name); -$coll2 = oci_new_collection($c, $type_name); - -var_dump(oci_collection_append($coll1, 1)); - -var_dump(oci_collection_assign($coll2, $coll1)); - -var_dump(oci_collection_element_get($coll2, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(1) -Done diff --git a/ext/oci8/tests/coll_005.phpt b/ext/oci8/tests/coll_005.phpt deleted file mode 100644 index d43c856cc7ed3..0000000000000 --- a/ext/oci8/tests/coll_005.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ocinewcollection() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump(ocinewcollection($c, $type_name)); -var_dump(ocinewcollection($c, "NONEXISTENT")); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} - -Warning: ocinewcollection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_006.phpt b/ext/oci8/tests/coll_006.phpt deleted file mode 100644 index a1039987f989a..0000000000000 --- a/ext/oci8/tests/coll_006.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ocinewcollection() + free() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump($coll1 = ocinewcollection($c, $type_name)); - -var_dump($coll1->free()); -var_dump($coll1->size()); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) - -Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_006_func.phpt b/ext/oci8/tests/coll_006_func.phpt deleted file mode 100644 index f43c142c40c8d..0000000000000 --- a/ext/oci8/tests/coll_006_func.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ocinewcollection() + free() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -var_dump($coll1 = ocinewcollection($c, $type_name)); - -var_dump(oci_free_collection($coll1)); -var_dump(oci_collection_size($coll1)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCI-Collection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) - -Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_007.phpt b/ext/oci8/tests/coll_007.phpt deleted file mode 100644 index 256ce0bfa7a17..0000000000000 --- a/ext/oci8/tests/coll_007.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -collection methods ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->size()); -var_dump($coll1->max()); -var_dump($coll1->trim(3)); -var_dump($coll1->append(1)); -var_dump($coll1->getElem(0)); -var_dump($coll1->assignElem(0,2)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -int(0) -int(0) - -Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d -bool(false) -bool(true) -float(1) -bool(true) -Done diff --git a/ext/oci8/tests/coll_008.phpt b/ext/oci8/tests/coll_008.phpt deleted file mode 100644 index 36e052b7ed8a3..0000000000000 --- a/ext/oci8/tests/coll_008.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ocicollassign() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_type.inc"; - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump($coll1->append(1)); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(1) -Done diff --git a/ext/oci8/tests/coll_009.phpt b/ext/oci8/tests/coll_009.phpt deleted file mode 100644 index 1910af9efb192..0000000000000 --- a/ext/oci8/tests/coll_009.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -collections and wrong dates ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("2005-07-28")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -Warning: OCI-Collection::append(): OCI-01861: literal does not match format string in %s on line %d -bool(false) -bool(true) -bool(false) -Done diff --git a/ext/oci8/tests/coll_009_func.phpt b/ext/oci8/tests/coll_009_func.phpt deleted file mode 100644 index d383abe4ad60d..0000000000000 --- a/ext/oci8/tests/coll_009_func.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -collections and wrong dates ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "2005-07-28")); - -var_dump(oci_collection_assign($coll2, $coll1)); - -var_dump(oci_collection_element_get($coll2, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -Warning: oci_collection_append(): OCI-01861: literal does not match format string in %s on line %d -bool(false) -bool(true) -bool(false) -Done diff --git a/ext/oci8/tests/coll_010.phpt b/ext/oci8/tests/coll_010.phpt deleted file mode 100644 index b23096206ea95..0000000000000 --- a/ext/oci8/tests/coll_010.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and nulls ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump($coll1->append(null)); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_010_func.phpt b/ext/oci8/tests/coll_010_func.phpt deleted file mode 100644 index dff980e013ccc..0000000000000 --- a/ext/oci8/tests/coll_010_func.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and nulls ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, null)); - -var_dump(oci_collection_assign($coll2, $coll1)); - -var_dump(oci_collection_element_get($coll2, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_011.phpt b/ext/oci8/tests/coll_011.phpt deleted file mode 100644 index 448b7f9a6bd4a..0000000000000 --- a/ext/oci8/tests/coll_011.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -collections and strings ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("string")); -var_dump($coll1->append("string")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -string(6) "string" -Done diff --git a/ext/oci8/tests/coll_011_func.phpt b/ext/oci8/tests/coll_011_func.phpt deleted file mode 100644 index 3226d15b866ae..0000000000000 --- a/ext/oci8/tests/coll_011_func.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -collections and strings ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "string")); -var_dump(oci_collection_append($coll1, "string")); - -var_dump(oci_collection_assign($coll2, $coll1)); - -var_dump(oci_collection_element_get($coll2, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -string(6) "string" -Done diff --git a/ext/oci8/tests/coll_012.phpt b/ext/oci8/tests/coll_012.phpt deleted file mode 100644 index 59383b0cbcb08..0000000000000 --- a/ext/oci8/tests/coll_012.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and correct dates ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("28-JUL-05")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "28-JUL-05" -Done diff --git a/ext/oci8/tests/coll_012_func.phpt b/ext/oci8/tests/coll_012_func.phpt deleted file mode 100644 index 16b85097d4ceb..0000000000000 --- a/ext/oci8/tests/coll_012_func.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and correct dates ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); -$coll2 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "28-JUL-05")); - -var_dump(oci_collection_assign($coll2, $coll1)); - -var_dump(oci_collection_element_get($coll2, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "28-JUL-05" -Done diff --git a/ext/oci8/tests/coll_013.phpt b/ext/oci8/tests/coll_013.phpt deleted file mode 100644 index cd1c851771500..0000000000000 --- a/ext/oci8/tests/coll_013.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and correct dates (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("28-JUL-05")); -var_dump($coll1->assignElem(0,"01-JAN-05")); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "01-JAN-05" -Done diff --git a/ext/oci8/tests/coll_013_func.phpt b/ext/oci8/tests/coll_013_func.phpt deleted file mode 100644 index 6141105b013c9..0000000000000 --- a/ext/oci8/tests/coll_013_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and correct dates (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "28-JUL-05")); -var_dump(oci_collection_element_assign($coll1, 0, "01-JAN-05")); -var_dump(oci_collection_element_get($coll1, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "01-JAN-05" -Done diff --git a/ext/oci8/tests/coll_014.phpt b/ext/oci8/tests/coll_014.phpt deleted file mode 100644 index abbdbff2745c4..0000000000000 --- a/ext/oci8/tests/coll_014.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and strings (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("striing")); -var_dump($coll1->assignElem(0,"blah")); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(4) "blah" -Done diff --git a/ext/oci8/tests/coll_014_func.phpt b/ext/oci8/tests/coll_014_func.phpt deleted file mode 100644 index a728ee0f7ded8..0000000000000 --- a/ext/oci8/tests/coll_014_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and strings (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "striing")); -var_dump(oci_collection_element_assign($coll1, 0,"blah")); -var_dump(oci_collection_element_get($coll1, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(4) "blah" -Done diff --git a/ext/oci8/tests/coll_015.phpt b/ext/oci8/tests/coll_015.phpt deleted file mode 100644 index c9f9bda941198..0000000000000 --- a/ext/oci8/tests/coll_015.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and numbers (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->append(1)); -var_dump($coll1->assignElem(0,2345)); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(2345) -Done diff --git a/ext/oci8/tests/coll_015_func.phpt b/ext/oci8/tests/coll_015_func.phpt deleted file mode 100644 index 27c4e68cd4213..0000000000000 --- a/ext/oci8/tests/coll_015_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and numbers (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, 1)); -var_dump(oci_collection_element_assign($coll1,0,2345)); -var_dump(oci_collection_element_get($coll1, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(2345) -Done diff --git a/ext/oci8/tests/coll_016.phpt b/ext/oci8/tests/coll_016.phpt deleted file mode 100644 index 3f685dd73f3aa..0000000000000 --- a/ext/oci8/tests/coll_016.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -collections and negative/too big element indexes ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->append(1)); -var_dump($coll1->assignElem(-1,2345)); -var_dump($coll1->assignElem(5000,2345)); -var_dump($coll1->getElem(-1)); -var_dump($coll1->getElem(-100)); -var_dump($coll1->getElem(500)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -bool(true) - -Warning: OCI-Collection::assignelem(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d -bool(false) - -Warning: OCI-Collection::assignelem(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/coll_016_func.phpt b/ext/oci8/tests/coll_016_func.phpt deleted file mode 100644 index f9ba14db49833..0000000000000 --- a/ext/oci8/tests/coll_016_func.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -collections and negative/too big element indexes ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, 1)); -var_dump(oci_collection_element_assign($coll1,-1,2345)); -var_dump(oci_collection_element_assign($coll1,5000,2345)); -var_dump(oci_collection_element_get($coll1, -1)); -var_dump(oci_collection_element_get($coll1, -100)); -var_dump(oci_collection_element_get($coll1, 500)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECTF-- -bool(true) - -Warning: oci_collection_element_assign(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d -bool(false) - -Warning: oci_collection_element_assign(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/coll_017.phpt b/ext/oci8/tests/coll_017.phpt deleted file mode 100644 index 2ba0ce5382554..0000000000000 --- a/ext/oci8/tests/coll_017.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and nulls (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump($coll1->append("string")); -var_dump($coll1->assignElem(0, null)); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_017_func.phpt b/ext/oci8/tests/coll_017_func.phpt deleted file mode 100644 index ada10a192dd58..0000000000000 --- a/ext/oci8/tests/coll_017_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and nulls (2) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$ora_sql = "DROP TYPE - ".$type_name." - "; - -$statement = OCIParse($c,$ora_sql); -@OCIExecute($statement); - -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; - -$statement = OCIParse($c,$ora_sql); -OCIExecute($statement); - - -$coll1 = ocinewcollection($c, $type_name); - -var_dump(oci_collection_append($coll1, "string")); -var_dump(oci_collection_element_assign($coll1, 0, null)); -var_dump(oci_collection_element_get($coll1, 0)); - -echo "Done\n"; - -require dirname(__FILE__)."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/commit.phpt b/ext/oci8/tests/commit.phpt deleted file mode 100644 index 7a44a31a9b2a7..0000000000000 --- a/ext/oci8/tests/commit.phpt +++ /dev/null @@ -1,153 +0,0 @@ ---TEST-- -oci_commit()/oci_rollback() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s, OCI_DEFAULT)) { - die("oci_execute(insert) failed!\n"); - } -} - -var_dump(oci_rollback($c)); - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($select = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -/* oci_fetch_all */ -if (!oci_execute($select)) { - die("oci_execute(select) failed!\n"); -} -var_dump(oci_fetch_all($select, $all)); -var_dump($all); - -/* ocifetchstatement */ -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s, OCI_DEFAULT)) { - die("oci_execute(insert) failed!\n"); - } -} - -var_dump(oci_commit($c)); - -/* oci_fetch_all */ -if (!oci_execute($select)) { - die("oci_execute(select) failed!\n"); -} -var_dump(oci_fetch_all($select, $all)); -var_dump($all); - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -int(0) -array(5) { - ["ID"]=> - array(0) { - } - ["VALUE"]=> - array(0) { - } - ["BLOB"]=> - array(0) { - } - ["CLOB"]=> - array(0) { - } - ["STRING"]=> - array(0) { - } -} -bool(true) -int(4) -array(5) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["VALUE"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["BLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["CLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["STRING"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } -} -Done diff --git a/ext/oci8/tests/commit_old.phpt b/ext/oci8/tests/commit_old.phpt deleted file mode 100644 index 3dfb383113c98..0000000000000 --- a/ext/oci8/tests/commit_old.phpt +++ /dev/null @@ -1,151 +0,0 @@ ---TEST-- -ocicommit()/ocirollback() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = ociparse($c, $insert_sql))) { - die("ociparse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!ociexecute($s, OCI_DEFAULT)) { - die("ociexecute(insert) failed!\n"); - } -} - -var_dump(ocirollback($c)); - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($select = ociparse($c, $select_sql))) { - die("ociparse(select) failed!\n"); -} - -if (!oci_execute($select)) { - die("ociexecute(select) failed!\n"); -} -var_dump(ocifetchstatement($select, $all)); -var_dump($all); - -/* ocifetchstatement */ -if (!ociexecute($s)) { - die("ociexecute(select) failed!\n"); -} - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = ociparse($c, $insert_sql))) { - die("ociparse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!ociexecute($s, OCI_DEFAULT)) { - die("ociexecute(insert) failed!\n"); - } -} - -var_dump(ocicommit($c)); - -if (!ociexecute($select)) { - die("ociexecute(select) failed!\n"); -} -var_dump(ocifetchstatement($select, $all)); -var_dump($all); - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -int(0) -array(5) { - ["ID"]=> - array(0) { - } - ["VALUE"]=> - array(0) { - } - ["BLOB"]=> - array(0) { - } - ["CLOB"]=> - array(0) { - } - ["STRING"]=> - array(0) { - } -} -bool(true) -int(4) -array(5) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["VALUE"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["BLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["CLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["STRING"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } -} -Done diff --git a/ext/oci8/tests/connect.inc b/ext/oci8/tests/connect.inc deleted file mode 100644 index 887c8fdaa107e..0000000000000 --- a/ext/oci8/tests/connect.inc +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * Please, change user, password and dbase to match your configuration. - * - * */ - -$user = "system"; -$password = "system"; -$dbase = "oracle"; - -/* - * You should have privileges to create tables in this schema - * - * */ -/* -$schema = "system"; -*/ - -$table_name = "tb".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5); -$type_name = strtoupper("tp".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5)); - - if (!empty($dbase)) { - $c = ocilogon($user,$password,$dbase); - } - else { - $c = ocilogon($user,$password); - } - - if (!empty($schema)) { - $schema = $schema."."; - } - else { - $schema = ''; - } - -?> diff --git a/ext/oci8/tests/connect.phpt b/ext/oci8/tests/connect.phpt deleted file mode 100644 index d873a7e0150e5..0000000000000 --- a/ext/oci8/tests/connect.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -oci_connect() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(oci_connect($user, $password, $dbase)); -} -else { - var_dump(oci_connect($user, $password)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/connect_1.phpt b/ext/oci8/tests/connect_1.phpt deleted file mode 100644 index e658344496340..0000000000000 --- a/ext/oci8/tests/connect_1.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -oci_pconnect() & oci_new_connect() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump($c1 = oci_pconnect($user, $password, $dbase)); -} -else { - var_dump($c1 = oci_pconnect($user, $password)); -} - -if (!empty($dbase)) { - var_dump($c2 = oci_new_connect($user, $password, $dbase)); -} -else { - var_dump($c2 = oci_new_connect($user, $password)); -} - -var_dump(oci_close($c1)); -var_dump(ocilogoff($c2)); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/connect_1_old.phpt b/ext/oci8/tests/connect_1_old.phpt deleted file mode 100644 index 73c756159df04..0000000000000 --- a/ext/oci8/tests/connect_1_old.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -ociplogon() & ocinlogon() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump($c1 = ociplogon($user, $password, $dbase)); -} -else { - var_dump($c1 = ociplogon($user, $password)); -} - -if (!empty($dbase)) { - var_dump($c2 = ocinlogon($user, $password, $dbase)); -} -else { - var_dump($c2 = ocinlogon($user, $password)); -} - -var_dump(ocilogoff($c1)); -var_dump(ocilogoff($c2)); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/connect_old.phpt b/ext/oci8/tests/connect_old.phpt deleted file mode 100644 index a8183d4ec8097..0000000000000 --- a/ext/oci8/tests/connect_old.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ocilogon() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(ocilogon($user, $password, $dbase)); -} -else { - var_dump(ocilogon($user, $password)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt deleted file mode 100644 index 513d60cefd810..0000000000000 --- a/ext/oci8/tests/connect_without_oracle_home.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(oci_connect($user, $password, $dbase)); -} -else { - var_dump(oci_connect($user, $password)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d - -Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d -bool(false) -Done diff --git a/ext/oci8/tests/connect_without_oracle_home_old.phpt b/ext/oci8/tests/connect_without_oracle_home_old.phpt deleted file mode 100644 index 68b11de1553d2..0000000000000 --- a/ext/oci8/tests/connect_without_oracle_home_old.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(ocilogon($user, $password, $dbase)); -} -else { - var_dump(ocilogon($user, $password)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d - -Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d -bool(false) -Done diff --git a/ext/oci8/tests/create_table.inc b/ext/oci8/tests/create_table.inc deleted file mode 100644 index d6debf2339a73..0000000000000 --- a/ext/oci8/tests/create_table.inc +++ /dev/null @@ -1,19 +0,0 @@ -<?php - - if ($c) { - $ora_sql = "DROP TABLE - ".$schema.$table_name." - "; - - $statement = OCIParse($c, $ora_sql); - @OCIExecute($statement); - - $ora_sql = "CREATE TABLE - ".$schema.$table_name." (id NUMBER, value NUMBER, blob BLOB, clob CLOB, string VARCHAR(10)) - "; - - $statement = OCIParse($c,$ora_sql); - OCIExecute($statement); - } - -?> diff --git a/ext/oci8/tests/create_type.inc b/ext/oci8/tests/create_type.inc deleted file mode 100644 index e23f7cb903351..0000000000000 --- a/ext/oci8/tests/create_type.inc +++ /dev/null @@ -1,17 +0,0 @@ -<?php - - if ($c) { - $ora_sql = "DROP TYPE - ".$type_name." - "; - - $statement = OCIParse($c,$ora_sql); - @OCIExecute($statement); - - $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER(11)"; - - $statement = OCIParse($c,$ora_sql); - OCIExecute($statement); - } - -?> diff --git a/ext/oci8/tests/cursor_bind_err.phpt b/ext/oci8/tests/cursor_bind_err.phpt deleted file mode 100644 index 343167387b3f4..0000000000000 --- a/ext/oci8/tests/cursor_bind_err.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -binding a cursor (with errors) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_table.inc"; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$sql = "select CURSOR(select * from ".$schema.$table_name.") into :cursor from dual"; -$stmt = oci_parse($c, $sql); - -$cursor = oci_new_cursor($c); -oci_bind_by_name($stmt, ":cursor", $cursor, -1, OCI_B_CURSOR); - -oci_execute($stmt); - -oci_execute($cursor); -var_dump(oci_fetch_assoc($cursor)); - -require dirname(__FILE__)."/drop_table.inc"; - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in %s on line %d - -Warning: oci_fetch_assoc(): ORA-24338: statement handle not executed in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/cursors.phpt b/ext/oci8/tests/cursors.phpt deleted file mode 100644 index e69ff82dd2783..0000000000000 --- a/ext/oci8/tests/cursors.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -fetching cursor from a statement ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_table.inc"; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$sql = "select CURSOR(select * from ".$schema.$table_name.") as curs FROM dual"; -$stmt = oci_parse($c, $sql); - -oci_execute($stmt); - -while ($data = oci_fetch_assoc($stmt)) { - oci_execute($data["CURS"]); - $subdata = oci_fetch_assoc($data["CURS"]); - var_dump($subdata); - var_dump(oci_cancel($data["CURS"])); - $subdata = oci_fetch_assoc($data["CURS"]); - var_dump($subdata); - var_dump(oci_cancel($data["CURS"])); -} - -require dirname(__FILE__)."/drop_table.inc"; - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -bool(true) - -Warning: oci_fetch_assoc()%sORA-01002: fetch out of sequence in %scursors.php on line %d -bool(false) -bool(true) -Done diff --git a/ext/oci8/tests/cursors_old.phpt b/ext/oci8/tests/cursors_old.phpt deleted file mode 100644 index 4991ed795aee8..0000000000000 --- a/ext/oci8/tests/cursors_old.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -fetching cursor from a statement ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_table.inc"; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = ociparse($c, $insert_sql))) { - die("ociparse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!ociexecute($s)) { - die("ociexecute(insert) failed!\n"); - } -} - -if (!ocicommit($c)) { - die("ocicommit() failed!\n"); -} - -$sql = "select CURSOR(select * from ".$schema.$table_name.") as curs FROM dual"; -$stmt = ociparse($c, $sql); - -ociexecute($stmt); - -while ($result = ocifetchinto($stmt, $data, OCI_ASSOC)) { - ociexecute($data["CURS"]); - ocifetchinto($data["CURS"], $subdata, OCI_ASSOC); - var_dump($subdata); - var_dump(ocicancel($data["CURS"])); - ocifetchinto($data["CURS"], $subdata, OCI_ASSOC); - var_dump($subdata); - var_dump(ocicancel($data["CURS"])); -} - -require dirname(__FILE__)."/drop_table.inc"; - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -bool(true) - -Warning: ocifetchinto():%sORA-01002: fetch out of sequence in %scursors_old.php on line %d -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -bool(true) -Done diff --git a/ext/oci8/tests/debug.phpt b/ext/oci8/tests/debug.phpt deleted file mode 100644 index 2a2d2f79c2659..0000000000000 --- a/ext/oci8/tests/debug.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -oci_internal_debug() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -oci_internal_debug(true); - -if (!empty($dbase)) { - oci_connect($user, $password, $dbase); -} -else { - oci_connect($user, $password); -} - -echo "Done\n"; - -?> ---EXPECTF-- -OCI8 DEBUG: OCINlsEnvironmentVariableGet in php_oci_do_connect_ex() (%s/oci8.c:%d) -Done -OCI8 DEBUG: OCISessionEnd in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIServerDetach in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) -OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) diff --git a/ext/oci8/tests/default_prefetch.phpt b/ext/oci8/tests/default_prefetch.phpt deleted file mode 100644 index 46d2d07e4c27d..0000000000000 --- a/ext/oci8/tests/default_prefetch.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---INI-- -oci8.default_prefetch=20 ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(oci_fetch($s)); - -var_dump(oci_num_rows($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/default_prefetch1.phpt b/ext/oci8/tests/default_prefetch1.phpt deleted file mode 100644 index 8f43450c84491..0000000000000 --- a/ext/oci8/tests/default_prefetch1.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---INI-- -oci8.default_prefetch=100 ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(oci_fetch($s)); - -var_dump(oci_num_rows($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/default_prefetch2.phpt b/ext/oci8/tests/default_prefetch2.phpt deleted file mode 100644 index 8a0939cdc167f..0000000000000 --- a/ext/oci8/tests/default_prefetch2.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---INI-- -oci8.default_prefetch=100 ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -var_dump(oci_set_prefetch($s, 10)); - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(oci_fetch($s)); - -var_dump(oci_num_rows($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/define.phpt b/ext/oci8/tests/define.phpt deleted file mode 100644 index dde5d575b3d08..0000000000000 --- a/ext/oci8/tests/define.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -oci_define_by_name() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_table.inc"; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (string) VALUES ('some')"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); -} - -$stmt = oci_parse($c, "SELECT string FROM ".$table_name.""); - -/* the define MUST be done BEFORE ociexecute! */ - -$strong = ''; -oci_define_by_name($stmt, "STRING", $string, 20); - -oci_execute($stmt); - -while (oci_fetch($stmt)) { - var_dump($string); -} - -require dirname(__FILE__)."/drop_table.inc"; - -echo "Done\n"; - -?> ---EXPECT-- -string(4) "some" -Done diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt deleted file mode 100644 index e3c8278668f2c..0000000000000 --- a/ext/oci8/tests/define_old.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -ocidefinebyname() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__)."/create_table.inc"; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (string) VALUES ('some')"; - -if (!($s = ociparse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -if (!ociexecute($s)) { - die("oci_execute(insert) failed!\n"); -} - -$stmt = ociparse($c, "SELECT string FROM ".$table_name.""); - -/* the define MUST be done BEFORE ociexecute! */ - -$strong = ''; -ocidefinebyname($stmt, "STRING", $string, 20); - -ociexecute($stmt); - -while (ocifetch($stmt)) { - var_dump($string); -} - -require dirname(__FILE__)."/drop_table.inc"; - -echo "Done\n"; - -?> ---EXPECT-- -string(4) "some" -Done diff --git a/ext/oci8/tests/drop_table.inc b/ext/oci8/tests/drop_table.inc deleted file mode 100644 index ffd99f5af3d0c..0000000000000 --- a/ext/oci8/tests/drop_table.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php - - if ($c) { - $ora_sql = "DROP TABLE - ".$schema.$table_name." - "; - - $statement = OCIParse($c,$ora_sql); - OCIExecute($statement); - } - -?> diff --git a/ext/oci8/tests/drop_type.inc b/ext/oci8/tests/drop_type.inc deleted file mode 100644 index 047968ef28d22..0000000000000 --- a/ext/oci8/tests/drop_type.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php - - if ($c) { - $ora_sql = "DROP TYPE - ".$type_name." - "; - - $statement = OCIParse($c,$ora_sql); - OCIExecute($statement); - } - -?> diff --git a/ext/oci8/tests/error.phpt b/ext/oci8/tests/error.phpt deleted file mode 100644 index 594a3d1319604..0000000000000 --- a/ext/oci8/tests/error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -oci_error() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(oci_connect($user, $password, $dbase)); -} -else { - var_dump(oci_connect($user, $password)); -} - -var_dump($s = oci_parse($c, "WRONG SYNTAX")); -var_dump(oci_execute($s)); -var_dump(oci_error($s)); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%s) of type (oci8 connection) -resource(%s) of type (oci8 statement) - -Warning: oci_execute(): ORA-00900: invalid SQL statement in %s on line %d -bool(false) -array(4) { - ["code"]=> - int(900) - ["message"]=> - string(32) "ORA-00900: invalid SQL statement" - ["offset"]=> - int(0) - ["sqltext"]=> - string(12) "WRONG SYNTAX" -} -Done diff --git a/ext/oci8/tests/error1.phpt b/ext/oci8/tests/error1.phpt deleted file mode 100644 index a150de8975271..0000000000000 --- a/ext/oci8/tests/error1.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -oci_error() when oci_connect() fails ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -var_dump(oci_connect("some", "some", "some")); -var_dump(oci_error()); - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/error_old.phpt b/ext/oci8/tests/error_old.phpt deleted file mode 100644 index fbdcd9e610afc..0000000000000 --- a/ext/oci8/tests/error_old.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ocierror() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump(ocilogon($user, $password, $dbase)); -} -else { - var_dump(ocilogon($user, $password)); -} - -var_dump($s = ociparse($c, "WRONG SYNTAX")); -var_dump(ociexecute($s)); -var_dump(ocierror($s)); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%s) of type (oci8 connection) -resource(%s) of type (oci8 statement) - -Warning: ociexecute(): ORA-00900: invalid SQL statement in %s on line %d -bool(false) -array(4) { - ["code"]=> - int(900) - ["message"]=> - string(32) "ORA-00900: invalid SQL statement" - ["offset"]=> - int(0) - ["sqltext"]=> - string(12) "WRONG SYNTAX" -} -Done diff --git a/ext/oci8/tests/exec_fetch.phpt b/ext/oci8/tests/exec_fetch.phpt deleted file mode 100644 index e1705273aa8de..0000000000000 --- a/ext/oci8/tests/exec_fetch.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -fetch after failed oci_execute() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$sql = "select 2 from nonex_dual"; -$stmt = oci_parse($c, $sql); - -var_dump(oci_execute($stmt)); -var_dump(oci_fetch_array($stmt)); - -echo "Done\n"; -?> ---EXPECTF-- -Done diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt deleted file mode 100644 index 72ca9f3f8051d..0000000000000 --- a/ext/oci8/tests/fetch.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ocifetch() & ociresult() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -while(ocifetch($s)) { - $i = 1; - while ($row = ociresult($s, $i)) { - $i++; - var_dump($row); - } -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -Done diff --git a/ext/oci8/tests/fetch_all.phpt b/ext/oci8/tests/fetch_all.phpt deleted file mode 100644 index 49193ffc87f52..0000000000000 --- a/ext/oci8/tests/fetch_all.phpt +++ /dev/null @@ -1,154 +0,0 @@ ---TEST-- -oci_fetch_all() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -/* oci_fetch_all */ -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -var_dump(oci_fetch_all($s, $all)); -var_dump($all); - -/* ocifetchstatement */ -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(ocifetchstatement($s, $all)); -var_dump($all); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -int(3) -array(5) { - ["ID"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["VALUE"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["BLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["CLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["STRING"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } -} -int(3) -array(5) { - ["ID"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["VALUE"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["BLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["CLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["STRING"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } -} -Done diff --git a/ext/oci8/tests/fetch_array.phpt b/ext/oci8/tests/fetch_array.phpt deleted file mode 100644 index ada162453d503..0000000000000 --- a/ext/oci8/tests/fetch_array.phpt +++ /dev/null @@ -1,235 +0,0 @@ ---TEST-- -oci_fetch_array() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s)) { - var_dump($row); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s, OCI_NUM)) { - var_dump($row); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s, OCI_ASSOC)) { - var_dump($row); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s, OCI_BOTH)) { - var_dump($row); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s, OCI_RETURN_LOBS)) { - var_dump($row); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_array($s, OCI_RETURN_NULLS)) { - var_dump($row); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -Done diff --git a/ext/oci8/tests/fetch_assoc.phpt b/ext/oci8/tests/fetch_assoc.phpt deleted file mode 100644 index 9b6866a100eb4..0000000000000 --- a/ext/oci8/tests/fetch_assoc.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -oci_fetch_assoc() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_assoc($s)) { - var_dump($row); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -Done diff --git a/ext/oci8/tests/fetch_into.phpt b/ext/oci8/tests/fetch_into.phpt deleted file mode 100644 index 4953a25026e59..0000000000000 --- a/ext/oci8/tests/fetch_into.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -ocifetchinto() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -/* oci_fetch_all */ -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -var_dump(ocifetchinto($s, $all)); -var_dump($all); - -/* oci_fetch_all */ -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); -var_dump($all); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -int(5) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -int(5) -array(10) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - [2]=> - NULL - ["BLOB"]=> - NULL - [3]=> - NULL - ["CLOB"]=> - NULL - [4]=> - NULL - ["STRING"]=> - NULL -} -Done diff --git a/ext/oci8/tests/fetch_into1.phpt b/ext/oci8/tests/fetch_into1.phpt deleted file mode 100644 index 91d02e3d5c1fd..0000000000000 --- a/ext/oci8/tests/fetch_into1.phpt +++ /dev/null @@ -1,197 +0,0 @@ ---TEST-- -various ocifetchinto() tests ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<20; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -var_dump(ocifetchinto($s, $all, OCI_NUM)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_ASSOC)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_RETURN_LOBS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS+OCI_RETURN_LOBS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); -var_dump($all); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -int(5) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -int(5) -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -int(5) -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -int(5) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -int(5) -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -int(5) -array(10) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - [2]=> - NULL - ["BLOB"]=> - NULL - [3]=> - NULL - ["CLOB"]=> - NULL - [4]=> - NULL - ["STRING"]=> - NULL -} -int(5) -array(10) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - [2]=> - NULL - ["BLOB"]=> - NULL - [3]=> - NULL - ["CLOB"]=> - NULL - [4]=> - NULL - ["STRING"]=> - NULL -} -int(5) -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -int(5) -array(5) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["BLOB"]=> - NULL - ["CLOB"]=> - NULL - ["STRING"]=> - NULL -} -int(5) -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -Done diff --git a/ext/oci8/tests/fetch_into2.phpt b/ext/oci8/tests/fetch_into2.phpt deleted file mode 100644 index 27c137b4295d3..0000000000000 --- a/ext/oci8/tests/fetch_into2.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -ocifetchinto() & wrong number of params ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<20; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -var_dump(ocifetchinto($s)); -var_dump($all); -var_dump(ocifetchinto($s, $all, OCI_ASSOC, 5)); -var_dump($all); -var_dump(ocifetchinto($c, $all, OCI_RETURN_LOBS)); -var_dump($all); -var_dump(ocifetchinto($s, $all, 1000000)); -var_dump($all); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECTF-- -Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Notice: Undefined variable: all in %s on line %d -NULL - -Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d -NULL -NULL - -Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d -bool(false) -NULL -int(5) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -Done diff --git a/ext/oci8/tests/fetch_object.phpt b/ext/oci8/tests/fetch_object.phpt deleted file mode 100644 index 2df0480a39990..0000000000000 --- a/ext/oci8/tests/fetch_object.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -oci_fetch_object() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_object($s)) { - var_dump($row); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -object(stdClass)#1 (2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -object(stdClass)#2 (2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -object(stdClass)#1 (2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -Done diff --git a/ext/oci8/tests/fetch_row.phpt b/ext/oci8/tests/fetch_row.phpt deleted file mode 100644 index a2c0e883a0bce..0000000000000 --- a/ext/oci8/tests/fetch_row.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -oci_fetch_row() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} -while ($row = oci_fetch_row($s)) { - var_dump($row); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -Done diff --git a/ext/oci8/tests/field_funcs.phpt b/ext/oci8/tests/field_funcs.phpt deleted file mode 100644 index bba6632e86ad8..0000000000000 --- a/ext/oci8/tests/field_funcs.phpt +++ /dev/null @@ -1,110 +0,0 @@ ---TEST-- -oci_field_*() family ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -$row = oci_fetch_array($s, OCI_RETURN_NULLS + OCI_RETURN_LOBS); -var_dump($row); - -foreach ($row as $num => $field) { - $num++; - var_dump(oci_field_is_null($s, $num)); - var_dump(oci_field_name($s, $num)); - var_dump(oci_field_type($s, $num)); - var_dump(oci_field_type_raw($s, $num)); - var_dump(oci_field_scale($s, $num)); - var_dump(oci_field_precision($s, $num)); - var_dump(oci_field_size($s, $num)); -} - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -bool(false) -string(2) "ID" -string(6) "NUMBER" -int(2) -int(0) -int(0) -int(22) -bool(false) -string(5) "VALUE" -string(6) "NUMBER" -int(2) -int(0) -int(0) -int(22) -bool(true) -string(4) "BLOB" -string(4) "BLOB" -int(113) -int(0) -int(0) -int(4000) -bool(true) -string(4) "CLOB" -string(4) "CLOB" -int(112) -int(0) -int(0) -int(4000) -bool(true) -string(6) "STRING" -string(7) "VARCHAR" -int(1) -int(0) -int(0) -int(10) -Done diff --git a/ext/oci8/tests/field_funcs_old.phpt b/ext/oci8/tests/field_funcs_old.phpt deleted file mode 100644 index c5339a7502bbc..0000000000000 --- a/ext/oci8/tests/field_funcs_old.phpt +++ /dev/null @@ -1,110 +0,0 @@ ---TEST-- -ocicolumn*() family ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; - -if (!($s = ociparse($c, $insert_sql))) { - die("ociparse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!ociexecute($s)) { - die("ociexecute(insert) failed!\n"); - } -} - -if (!ocicommit($c)) { - die("ocicommit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema."".$table_name.""; - -if (!($s = ociparse($c, $select_sql))) { - die("ociparse(select) failed!\n"); -} - -if (!ociexecute($s)) { - die("ociexecute(select) failed!\n"); -} - -ocifetchinto($s, $row, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS); -var_dump($row); - -foreach ($row as $num => $field) { - $num++; - var_dump(ocicolumnisnull($s, $num)); - var_dump(ocicolumnname($s, $num)); - var_dump(ocicolumntype($s, $num)); - var_dump(ocicolumntyperaw($s, $num)); - var_dump(ocicolumnscale($s, $num)); - var_dump(ocicolumnprecision($s, $num)); - var_dump(ocicolumnsize($s, $num)); -} - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -bool(false) -string(2) "ID" -string(6) "NUMBER" -int(2) -int(0) -int(0) -int(22) -bool(false) -string(5) "VALUE" -string(6) "NUMBER" -int(2) -int(0) -int(0) -int(22) -bool(true) -string(4) "BLOB" -string(4) "BLOB" -int(113) -int(0) -int(0) -int(4000) -bool(true) -string(4) "CLOB" -string(4) "CLOB" -int(112) -int(0) -int(0) -int(4000) -bool(true) -string(6) "STRING" -string(7) "VARCHAR" -int(1) -int(0) -int(0) -int(10) -Done diff --git a/ext/oci8/tests/lob_001.phpt b/ext/oci8/tests/lob_001.phpt deleted file mode 100644 index 405b2b814c0be..0000000000000 Binary files a/ext/oci8/tests/lob_001.phpt and /dev/null differ diff --git a/ext/oci8/tests/lob_002.phpt b/ext/oci8/tests/lob_002.phpt deleted file mode 100644 index c414905f39b4a..0000000000000 --- a/ext/oci8/tests/lob_002.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -oci_lob_write() and friends (with errors) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); - -var_dump($blob->write("test", -1)); -var_dump($blob->write("test", "str")); -var_dump($blob->write("test", 1000000)); -var_dump($blob->write(str_repeat("test", 10000), 1000000)); -var_dump($blob->tell()); -var_dump($blob->seek("str", -5)); -var_dump($blob->flush()); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row = oci_fetch_array($s, OCI_RETURN_LOBS); - -var_dump(strlen($row[0])); - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(0) - -Warning: OCI-Lob::write() expects parameter 2 to be long, string given in %slob_002.php on line %d -NULL -int(4) -int(40000) -int(40004) - -Warning: OCI-Lob::seek() expects parameter 1 to be long, string given in %slob_002.php on line %d -NULL -bool(false) -int(40004) -Done diff --git a/ext/oci8/tests/lob_003.phpt b/ext/oci8/tests/lob_003.phpt deleted file mode 100644 index 76f1a7e4b0091..0000000000000 Binary files a/ext/oci8/tests/lob_003.phpt and /dev/null differ diff --git a/ext/oci8/tests/lob_004.phpt b/ext/oci8/tests/lob_004.phpt deleted file mode 100644 index 56ccfbcd4a65d..0000000000000 --- a/ext/oci8/tests/lob_004.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -oci_lob_seek()/rewind()/append() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); - -var_dump($blob->write("test")); -var_dump($blob->rewind()); -var_dump($blob->write("str")); -var_dump($blob->seek(10, OCI_SEEK_SET)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->append($blob)); -var_dump($row[0]->read(10000)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -var_dump($row[0]->read(10000)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(4) -bool(true) -int(3) -bool(true) -array(2) { - [0]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -bool(true) -string(4) "strt" -string(8) "strtstrt" -Done diff --git a/ext/oci8/tests/lob_005.phpt b/ext/oci8/tests/lob_005.phpt deleted file mode 100644 index d82400e47ede8..0000000000000 --- a/ext/oci8/tests/lob_005.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -oci_lob_is_equal() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump(oci_lob_is_equal($row[0], $row['BLOB'])); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - [0]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -bool(true) -Done diff --git a/ext/oci8/tests/lob_006.phpt b/ext/oci8/tests/lob_006.phpt deleted file mode 100644 index 321d948b1a599..0000000000000 Binary files a/ext/oci8/tests/lob_006.phpt and /dev/null differ diff --git a/ext/oci8/tests/lob_007.phpt b/ext/oci8/tests/lob_007.phpt deleted file mode 100644 index 0f2920414f0d7..0000000000000 --- a/ext/oci8/tests/lob_007.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -oci_lob_write()/size()/load() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); - -var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); -var_dump($blob->size()); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->size()); -var_dump(strlen($row[0]->load())); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(0) -int(7000) -int(7000) -array(2) { - [0]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -int(7000) -int(7000) -Done diff --git a/ext/oci8/tests/lob_008.phpt b/ext/oci8/tests/lob_008.phpt deleted file mode 100644 index a0b4a557df313..0000000000000 --- a/ext/oci8/tests/lob_008.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -oci_lob_write()/read()/eof() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); - -var_dump($blob->write(str_repeat("string.", 1000))); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - - -$len = 0; -while (!$row[0]->eof()) { - $len += strlen($row[0]->read(1024)); -} -var_dump($len); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(7000) -array(2) { - [0]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -int(7000) -Done diff --git a/ext/oci8/tests/lob_009.phpt b/ext/oci8/tests/lob_009.phpt deleted file mode 100644 index 9b467dd12a7a9..0000000000000 --- a/ext/oci8/tests/lob_009.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -oci_lob_import()/read() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); -var_dump($blob->seek(10, OCI_SEEK_CUR)); -var_dump($blob->import(dirname(__FILE__)."/lob_009.txt")); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -while (!$row[0]->eof()) { - var_dump($row[0]->read(1024)); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -bool(true) -bool(true) -array(2) { - [0]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(43) "this -is -a -test -file for -test lob_009.phpt -" -Done diff --git a/ext/oci8/tests/lob_009.txt b/ext/oci8/tests/lob_009.txt deleted file mode 100644 index f57bc8af37315..0000000000000 --- a/ext/oci8/tests/lob_009.txt +++ /dev/null @@ -1,6 +0,0 @@ -this -is -a -test -file for -test lob_009.phpt diff --git a/ext/oci8/tests/lob_010.phpt b/ext/oci8/tests/lob_010.phpt deleted file mode 100644 index 85d37dc7388b4..0000000000000 --- a/ext/oci8/tests/lob_010.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -oci_lob_save() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob->save("string")); -var_dump($blob->save("string", 3)); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -while (!$row[0]->eof()) { - var_dump($row[0]->read(1024)); -} - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "strstring" -Done diff --git a/ext/oci8/tests/lob_011.phpt b/ext/oci8/tests/lob_011.phpt deleted file mode 100644 index 41d54cf147f87..0000000000000 --- a/ext/oci8/tests/lob_011.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -oci_lob_copy() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (id, blob) - VALUES (1, empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob->write("some string here. string, I said")); -oci_commit($c); - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (id, blob) - VALUES (2, empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 1"; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row1 = oci_fetch_array($s); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row2 = oci_fetch_array($s); - -var_dump(oci_lob_copy($row2[0], $row1[0])); -var_dump($row1[0]->read(100)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row2 = oci_fetch_array($s, OCI_RETURN_LOBS)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(32) -bool(true) -string(32) "some string here. string, I said" -array(1) { - [0]=> - string(32) "some string here. string, I said" -} -Done diff --git a/ext/oci8/tests/lob_012.phpt b/ext/oci8/tests/lob_012.phpt deleted file mode 100644 index fb434d926050d..0000000000000 --- a/ext/oci8/tests/lob_012.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -oci_lob_export() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -$blob; - -var_dump($blob->write("test string is here\nnew string")); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -var_dump($row[0]->export(dirname(__FILE__)."/lob_012.tmp", 3, 10)); - -var_dump(file_get_contents(dirname(__FILE__)."/lob_012.tmp")); - -@unlink(dirname(__FILE__)."/lob_012.tmp"); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(30) -bool(true) -string(10) "t string i" -Done diff --git a/ext/oci8/tests/lob_013.phpt b/ext/oci8/tests/lob_013.phpt deleted file mode 100644 index 608640c7a13a7..0000000000000 --- a/ext/oci8/tests/lob_013.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -lob buffering ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob->write("test")); -var_dump($blob->getBuffering()); -var_dump($blob->setBuffering(true)); -var_dump($blob->write("test")); -var_dump($blob->getBuffering()); -var_dump($blob->flush()); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row = oci_fetch_array($s, OCI_RETURN_LOBS); - -var_dump($row[0]); - - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(4) -bool(false) -bool(true) -int(4) -bool(true) -bool(true) -string(8) "testtest" -Done diff --git a/ext/oci8/tests/lob_014.phpt b/ext/oci8/tests/lob_014.phpt deleted file mode 100644 index b0e0db5a015f5..0000000000000 --- a/ext/oci8/tests/lob_014.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -oci_lob_free()/close() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -$blob; - -var_dump($blob->write("test")); -var_dump($blob->close()); -var_dump($blob->write("test")); -var_dump($blob->free()); -var_dump($blob->write("test")); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -var_dump(oci_fetch_array($s, OCI_NUM + OCI_RETURN_LOBS)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -int(4) - -Warning: OCI-Lob::close(): ORA-22289: cannot perform operation on an unopened file or LOB in %slob_014.php on line %d -bool(false) -int(4) -bool(true) - -Warning: OCI-Lob::write(): %d is not a valid oci8 descriptor resource in %slob_014.php on line %d -bool(false) -array(1) { - [0]=> - string(8) "testtest" -} -Done diff --git a/ext/oci8/tests/lob_015.phpt b/ext/oci8/tests/lob_015.phpt deleted file mode 100644 index 5419087888db1..0000000000000 --- a/ext/oci8/tests/lob_015.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -various tests with wrong param count ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB,1,2,3); -$blob = oci_new_descriptor($c); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB,4); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB,4,5); -oci_bind_by_name($statement,":v_blob", $blob,-1); -oci_bind_by_name($statement,":v_blob", $blob); -oci_bind_by_name($statement,":v_blob"); -oci_bind_by_name($statement); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: oci_new_descriptor() expects at most 2 parameters, 5 given in %slob_015.php on line %d - -Warning: oci_bind_by_name() expects at most 5 parameters, 6 given in %slob_015.php on line %d - -Warning: oci_bind_by_name() expects at most 5 parameters, 7 given in %slob_015.php on line %d - -Notice: Object of class OCI-Lob to string conversion in %slob_015.php on line %d - -Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %slob_015.php on line %d - -Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %slob_015.php on line %d - -Warning: oci_execute(): ORA-00932: inconsistent datatypes: expected NUMBER got BLOB in %slob_015.php on line %d -string(6) "Object" -Done diff --git a/ext/oci8/tests/lob_016.phpt b/ext/oci8/tests/lob_016.phpt deleted file mode 100644 index d021cc3ac830e..0000000000000 --- a/ext/oci8/tests/lob_016.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -returning multiple lobs ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -$create = "CREATE table lob_test(lob_1 BLOB, lob_2 BLOB)"; -$statement = oci_parse($c, $create); -oci_execute($statement); - -$init = "INSERT INTO lob_test VALUES(EMPTY_BLOB(), EMPTY_BLOB())"; -$statement = oci_parse($c, $init); -oci_execute($statement); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); - -unset($row); - -oci_commit($c); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -var_dump($row); -var_dump($row['LOB_1']->load()); -var_dump($row['LOB_2']->load()); - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["LOB_1"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["LOB_2"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(5) "first" -string(6) "second" -Done diff --git a/ext/oci8/tests/lob_017.phpt b/ext/oci8/tests/lob_017.phpt deleted file mode 100644 index 43b4a513b3fcb..0000000000000 --- a/ext/oci8/tests/lob_017.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -returning multiple lobs (using persistent connection) ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$c = oci_pconnect($user, $password, $dbase); - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -$create = "CREATE table lob_test(lob_1 BLOB, lob_2 BLOB)"; -$statement = oci_parse($c, $create); -oci_execute($statement); - -$init = "INSERT INTO lob_test VALUES(EMPTY_BLOB(), EMPTY_BLOB())"; -$statement = oci_parse($c, $init); -oci_execute($statement); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); - -unset($row); - -oci_commit($c); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -var_dump($row); -var_dump($row['LOB_1']->load()); -var_dump($row['LOB_2']->load()); - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["LOB_1"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["LOB_2"]=> - object(OCI-Lob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(5) "first" -string(6) "second" -Done diff --git a/ext/oci8/tests/lob_018.phpt b/ext/oci8/tests/lob_018.phpt deleted file mode 100644 index 360f50f3879e3..0000000000000 --- a/ext/oci8/tests/lob_018.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -fetching the same lob several times ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -$create = "CREATE table lob_test(mykey NUMBER, lob_1 CLOB)"; -$statement = oci_parse($c, $create); -oci_execute($statement); - -$init = "INSERT INTO lob_test (mykey, lob_1) VALUES(1, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; -$statement = oci_parse($c, $init); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); -$clob->save("data"); - -oci_commit($c); - -$init = "INSERT INTO lob_test (mykey, lob_1) VALUES(2, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; -$statement = oci_parse($c, $init); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); -$clob->save("long data"); - -oci_commit($c); - - -$query = 'SELECT * FROM lob_test ORDER BY mykey ASC'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -$query = 'SELECT * FROM lob_test ORDER BY mykey DESC'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -string(4) "data" -string(9) "long data" -string(9) "long data" -string(4) "data" -Done diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt deleted file mode 100644 index 4532d53630a83..0000000000000 --- a/ext/oci8/tests/lob_temp.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -temporary lobs ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->seek(0, SEEK_SET)); -var_dump($blob->read(2)); - -$c = oci_pconnect($user, $password, $dbase); - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->seek(0, SEEK_SET)); -var_dump($blob->read(2)); - -echo "Done\n"; - -?> ---EXPECTF-- -bool(true) -string(4) "test" -bool(true) -string(2) "te" -bool(true) -string(4) "test" -bool(true) -string(2) "te" -Done diff --git a/ext/oci8/tests/lob_temp1.phpt b/ext/oci8/tests/lob_temp1.phpt deleted file mode 100644 index 563a7e1f269e9..0000000000000 --- a/ext/oci8/tests/lob_temp1.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -closing temporary lobs ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->close()); - -$c = oci_pconnect($user, $password, $dbase); - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->close()); - -echo "Done\n"; - -?> ---EXPECTF-- -bool(true) -string(4) "test" -bool(true) -bool(true) -string(4) "test" -bool(true) -Done diff --git a/ext/oci8/tests/num.phpt b/ext/oci8/tests/num.phpt deleted file mode 100644 index 34b1a9c07db80..0000000000000 --- a/ext/oci8/tests/num.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -oci_num_*() family ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(ocirowcount($s)); -var_dump(oci_num_rows($s)); -var_dump(ocinumcols($s)); -var_dump(oci_num_fields($s)); - -$delete_sql = "DELETE FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $delete_sql))) { - die("oci_parse(delete) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(delete) failed!\n"); -} -oci_commit($c); - -var_dump(oci_num_rows($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(0) -int(0) -int(5) -int(5) -int(3) -Done diff --git a/ext/oci8/tests/oci_execute_segfault.phpt b/ext/oci8/tests/oci_execute_segfault.phpt deleted file mode 100644 index b7f0b62c857b0..0000000000000 --- a/ext/oci8/tests/oci_execute_segfault.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_execute() segfault after repeated bind ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__).'/connect.inc'; -require dirname(__FILE__).'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$table_name." (blob, clob) - VALUES (empty_blob(), empty_clob()) - RETURNING - blob - INTO :v_blob "; - -$s = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($s); - -oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($s); - -echo "Done\n"; - -?> ---EXPECT-- -Done diff --git a/ext/oci8/tests/old_oci_close.phpt b/ext/oci8/tests/old_oci_close.phpt deleted file mode 100644 index beb1b34ab5d9c..0000000000000 --- a/ext/oci8/tests/old_oci_close.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -oci8.old_oci_close_semantics On ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---INI-- -oci8.old_oci_close_semantics=1 ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -var_dump($c); -var_dump(oci_close($c)); -var_dump(oci_parse($c, "select 1 from dual")); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -NULL -resource(%d) of type (oci8 statement) -Done diff --git a/ext/oci8/tests/old_oci_close1.phpt b/ext/oci8/tests/old_oci_close1.phpt deleted file mode 100644 index c79eb077bed3b..0000000000000 --- a/ext/oci8/tests/old_oci_close1.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -oci8.old_oci_close_semantics Off ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---INI-- -oci8.old_oci_close_semantics=0 ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -var_dump($c); -var_dump(oci_close($c)); -var_dump(oci_parse($c, "select 1 from dual")); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -bool(true) - -Warning: oci_parse() expects parameter 1 to be resource, null given in %s on line %d -NULL -Done diff --git a/ext/oci8/tests/password.phpt b/ext/oci8/tests/password.phpt deleted file mode 100644 index 37f586cd4fcc6..0000000000000 --- a/ext/oci8/tests/password.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_password_change() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$new_password = "test"; -var_dump(oci_password_change($dbase, $user, $password, $new_password)); - -if (!empty($dbase)) { - var_dump($new_c = ocilogon($user,$new_password,$dbase)); -} -else { - var_dump($new_c = ocilogon($user,$new_password)); -} - -var_dump(oci_password_change($dbase, $user, $new_password, $password)); - - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt deleted file mode 100644 index 37f586cd4fcc6..0000000000000 --- a/ext/oci8/tests/password_new.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_password_change() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$new_password = "test"; -var_dump(oci_password_change($dbase, $user, $password, $new_password)); - -if (!empty($dbase)) { - var_dump($new_c = ocilogon($user,$new_password,$dbase)); -} -else { - var_dump($new_c = ocilogon($user,$new_password)); -} - -var_dump(oci_password_change($dbase, $user, $new_password, $password)); - - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/password_old.phpt b/ext/oci8/tests/password_old.phpt deleted file mode 100644 index 3e715785b510f..0000000000000 --- a/ext/oci8/tests/password_old.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ocipasswordchange() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$new_password = "test"; -var_dump(ocipasswordchange($c, $user, $password, $new_password)); - -if (!empty($dbase)) { - var_dump($new_c = ocilogon($user,$new_password,$dbase)); -} -else { - var_dump($new_c = ocilogon($user,$new_password)); -} - -var_dump(ocipasswordchange($new_c, $user, $new_password, $password)); - - -echo "Done\n"; - -?> ---EXPECTF-- -bool(true) -resource(%d) of type (oci8 connection) -bool(true) -Done diff --git a/ext/oci8/tests/persistent.phpt b/ext/oci8/tests/persistent.phpt deleted file mode 100644 index 088689c722cc5..0000000000000 --- a/ext/oci8/tests/persistent.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -reusing persistent connections ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -var_dump(oci_pconnect($user, $password, $dbase)); -var_dump(oci_pconnect($user, $password, $dbase)); -var_dump(oci_pconnect($user, $password, $dbase)); -var_dump(oci_connect($user, $password, $dbase)); -var_dump(oci_connect($user, $password, $dbase)); -var_dump(oci_connect($user, $password, $dbase)); - -echo "Done\n"; -?> ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/prefetch.phpt b/ext/oci8/tests/prefetch.phpt deleted file mode 100644 index 45d51bd4c384a..0000000000000 --- a/ext/oci8/tests/prefetch.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -oci_set_prefetch() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = oci_parse($c, $insert_sql))) { - die("oci_parse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!oci_execute($s)) { - die("oci_execute(insert) failed!\n"); - } -} - -if (!oci_commit($c)) { - die("oci_commit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = oci_parse($c, $select_sql))) { - die("oci_parse(select) failed!\n"); -} - -var_dump(oci_set_prefetch($s, 10)); - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -var_dump(oci_fetch($s)); - -var_dump(oci_num_rows($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/prefetch_old.phpt b/ext/oci8/tests/prefetch_old.phpt deleted file mode 100644 index 189511d051bc1..0000000000000 --- a/ext/oci8/tests/prefetch_old.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -ocisetprefetch() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; -require dirname(__FILE__).'/create_table.inc'; - -$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; - -if (!($s = ociparse($c, $insert_sql))) { - die("ociparse(insert) failed!\n"); -} - -for ($i = 0; $i<3; $i++) { - if (!ociexecute($s)) { - die("ociexecute(insert) failed!\n"); - } -} - -if (!ocicommit($c)) { - die("ocicommit() failed!\n"); -} - -$select_sql = "SELECT * FROM ".$schema.$table_name.""; - -if (!($s = ociparse($c, $select_sql))) { - die("ociparse(select) failed!\n"); -} - -var_dump(ocisetprefetch($s, 10)); - -if (!ociexecute($s)) { - die("ociexecute(select) failed!\n"); -} - -var_dump(ocifetch($s)); - -var_dump(ocirowcount($s)); - -require dirname(__FILE__).'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECT-- -bool(true) -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt deleted file mode 100644 index aef94b79e1fcf..0000000000000 --- a/ext/oci8/tests/privileged_connect.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -privileged connect tests ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -oci_connect("", "", "", false, OCI_SYSOPER); -oci_connect("", "", "", false, OCI_SYSDBA); -oci_connect("", "", "", false, -1); -oci_connect("", "", "", false, "qwe"); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d - -Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d - -Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d - -Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d -Done diff --git a/ext/oci8/tests/privileged_connect1.phpt b/ext/oci8/tests/privileged_connect1.phpt deleted file mode 100644 index 208d0853c47b6..0000000000000 --- a/ext/oci8/tests/privileged_connect1.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -privileged connect tests ---INI-- -oci8.privileged_connect=1 ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -oci_connect("", "", "", false, OCI_SYSOPER); -oci_connect("", "", "", false, OCI_SYSDBA); -oci_connect("", "", "", false, -1); -oci_connect("", "", "", false, "qwe"); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d - -Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d - -Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d - -Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d -Done diff --git a/ext/oci8/tests/serverversion.phpt b/ext/oci8/tests/serverversion.phpt deleted file mode 100644 index 0a8059964b62e..0000000000000 --- a/ext/oci8/tests/serverversion.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_server_version() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump($c = oci_connect($user, $password, $dbase)); -} -else { - var_dump($c = oci_connect($user, $password)); -} - -$v = oci_server_version($c); -var_dump(str_replace("\n", "", $v)); - -$v = ociserverversion($c); -var_dump(str_replace("\n", "", $v)); - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -string(%d) "%s" -string(%d) "%s" -Done diff --git a/ext/oci8/tests/skipif.inc b/ext/oci8/tests/skipif.inc deleted file mode 100644 index ed0992c8d9c32..0000000000000 --- a/ext/oci8/tests/skipif.inc +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -if (!extension_loaded('oci8')) die("skip oci8 extension is not available\n"); - -/* - * Remove or comment this line to run tests - * - * */ -die("skip change default login/password\n"); -?> diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt deleted file mode 100644 index dc49c427f2465..0000000000000 --- a/ext/oci8/tests/statement_cache.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -statement cache ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$pc = oci_pconnect($user, $password, $dbase); - -$stmt = oci_parse($pc, "select 1+3 from dual", true); -oci_execute($stmt); -var_dump(oci_fetch_array($stmt)); - -$stmt = oci_parse($pc, "select 1+3 from dual", true); -oci_execute($stmt); -var_dump(oci_fetch_array($stmt)); - -echo "Done\n"; -?> ---EXPECTF-- -array(2) { - [0]=> - string(1) "4" - ["1+3"]=> - string(1) "4" -} -array(2) { - [0]=> - string(1) "4" - ["1+3"]=> - string(1) "4" -} -Done diff --git a/ext/oci8/tests/statement_type.phpt b/ext/oci8/tests/statement_type.phpt deleted file mode 100644 index f3215ec31e0b6..0000000000000 --- a/ext/oci8/tests/statement_type.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -oci_statement_type() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump($c = oci_connect($user, $password, $dbase)); -} -else { - var_dump($c = oci_connect($user, $password)); -} - -$sqls = Array( - "SELECT * FROM table", - "DELETE FROM table WHERE id = 1", - "INSERT INTO table VALUES(1)", - "UPDATE table SET id = 1", - "DROP TABLE table", - "CREATE TABLE table (id NUMBER)", - "WRONG SYNTAX", - "" -); - -foreach ($sqls as $sql) { - $s = oci_parse($c, $sql); - var_dump(oci_statement_type($s)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -string(6) "SELECT" -string(6) "DELETE" -string(6) "INSERT" -string(6) "UPDATE" -string(4) "DROP" -string(6) "CREATE" -string(7) "UNKNOWN" -string(7) "UNKNOWN" -Done diff --git a/ext/oci8/tests/statement_type_old.phpt b/ext/oci8/tests/statement_type_old.phpt deleted file mode 100644 index 587beb4f2cfd8..0000000000000 --- a/ext/oci8/tests/statement_type_old.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -ocistatementtype() ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -if (!empty($dbase)) { - var_dump($c = ocilogon($user, $password, $dbase)); -} -else { - var_dump($c = ocilogon($user, $password)); -} - -$sqls = Array( - "SELECT * FROM table", - "DELETE FROM table WHERE id = 1", - "INSERT INTO table VALUES(1)", - "UPDATE table SET id = 1", - "DROP TABLE table", - "CREATE TABLE table (id NUMBER)", - "WRONG SYNTAX", - "" -); - -foreach ($sqls as $sql) { - $s = ociparse($c, $sql); - var_dump(ocistatementtype($s)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -string(6) "SELECT" -string(6) "DELETE" -string(6) "INSERT" -string(6) "UPDATE" -string(4) "DROP" -string(6) "CREATE" -string(7) "UNKNOWN" -string(7) "UNKNOWN" -Done diff --git a/ext/oci8/tests/uncommitted.phpt b/ext/oci8/tests/uncommitted.phpt deleted file mode 100644 index 297b7b0d0669e..0000000000000 --- a/ext/oci8/tests/uncommitted.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -uncommitted connection ---SKIPIF-- -<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> ---ENV-- -return " -ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." -NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." -TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." -"; ---FILE-- -<?php - -require dirname(__FILE__)."/connect.inc"; - -$stmt = oci_parse($c, "select 1 from dual"); -oci_execute($stmt, OCI_DEFAULT); - -echo "Done\n"; -?> ---EXPECTF-- -Done diff --git a/ext/odbc/CREDITS b/ext/odbc/CREDITS deleted file mode 100644 index 238bfb40a11d3..0000000000000 --- a/ext/odbc/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ODBC -Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c deleted file mode 100644 index 5c4c5ffd6a6db..0000000000000 --- a/ext/odbc/birdstep.c +++ /dev/null @@ -1,652 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Nikolay P. Romanyuk <mag@redcom.ru> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * TODO: - * birdstep_fetch_into(), - * Check all on real life apps. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if WIN32 -# include "config.w32.h" -# include "win95nt.h" -# ifdef PHP_EXPORTS -# define PHPAPI __declspec(dllexport) -# else -# define PHPAPI __declspec(dllimport) -# endif -#else -# include <php_config.h> -# define PHPAPI -# define THREAD_LS -#endif - -#ifdef HAVE_BIRDSTEP -#include "php_birdstep.h" -#include "ext/standard/info.h" - -function_entry birdstep_functions[] = { - PHP_FE(birdstep_connect, NULL) - PHP_FE(birdstep_close, NULL) - PHP_FE(birdstep_exec, NULL) - PHP_FE(birdstep_fetch, NULL) - PHP_FE(birdstep_result, NULL) - PHP_FE(birdstep_freeresult, NULL) - PHP_FE(birdstep_autocommit, NULL) - PHP_FE(birdstep_off_autocommit, NULL) - PHP_FE(birdstep_commit, NULL) - PHP_FE(birdstep_rollback, NULL) - PHP_FE(birdstep_fieldnum, NULL) - PHP_FE(birdstep_fieldname, NULL) -/* - * Temporary Function aliases until the next major upgrade to PHP. - * These should allow users to continue to use their current scripts, - * but should in reality warn the user that this functionality is - * deprecated. - */ - PHP_FALIAS(velocis_connect, birdstep_connect, NULL) - PHP_FALIAS(velocis_close, birdstep_close, NULL) - PHP_FALIAS(velocis_exec, birdstep_exec, NULL) - PHP_FALIAS(velocis_fetch, birdstep_fetch, NULL) - PHP_FALIAS(velocis_result, birdstep_result, NULL) - PHP_FALIAS(velocis_freeresult, birdstep_freeresult, NULL) - PHP_FALIAS(velocis_autocommit, birdstep_autocommit, NULL) - PHP_FALIAS(velocis_off_autocommit, birdstep_off_autocommit, NULL) - PHP_FALIAS(velocis_commit, birdstep_commit, NULL) - PHP_FALIAS(velocis_rollback, birdstep_rollback, NULL) - PHP_FALIAS(velocis_fieldnum, birdstep_fieldnum, NULL) - PHP_FALIAS(velocis_fieldname, birdstep_fieldname, NULL) -/* End temporary aliases */ - {NULL, NULL, NULL} -}; - -zend_module_entry birdstep_module_entry = { - STANDARD_MODULE_HEADER, - "birdstep", - birdstep_functions, - PHP_MINIT(birdstep), - PHP_MSHUTDOWN(birdstep), - PHP_RINIT(birdstep), - NULL, - PHP_MINFO(birdstep), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_ODBC -ZEND_GET_MODULE(birdstep) -#endif - -THREAD_LS birdstep_module php_birdstep_module; -THREAD_LS static HENV henv; - -#define PHP_GET_BIRDSTEP_RES_IDX(id) convert_to_long_ex(id); if (!(res = birdstep_find_result(list, Z_LVAL_PP(id)))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not result index (%ld)", Z_LVAL_PP(id)); RETURN_FALSE; } -#define PHP_BIRDSTEP_CHK_LNK(id) convert_to_long_ex(id); if (!(conn = birdstep_find_conn(list,Z_LVAL_PP(id)))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not connection index (%ld)", Z_LVAL_PP(id)); RETURN_FALSE; } - - -static void _close_birdstep_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - VConn *conn = (VConn *)rsrc->ptr; - - if ( conn ) { - efree(conn); - } -} - -static void _free_birdstep_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - Vresult *res = (Vresult *)rsrc->ptr; - - if ( res && res->values ) { - register int i; - for ( i=0; i < res->numcols; i++ ) { - if ( res->values[i].value ) - efree(res->values[i].value); - } - efree(res->values); - } - if ( res ) { - efree(res); - } -} - -PHP_MINIT_FUNCTION(birdstep) -{ - SQLAllocEnv(&henv); - - if ( cfg_get_long("birdstep.max_links",&php_birdstep_module.max_links) == FAILURE ) { - php_birdstep_module.max_links = -1; - } - php_birdstep_module.num_links = 0; - php_birdstep_module.le_link = zend_register_list_destructors_ex(_close_birdstep_link, NULL, "birdstep link", module_number); - php_birdstep_module.le_result = zend_register_list_destructors_ex(_free_birdstep_result, NULL, "birdstep result", module_number); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(birdstep) -{ - return SUCCESS; -} - - -PHP_MINFO_FUNCTION(birdstep) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "RAIMA Birdstep Support", "enabled" ); - php_info_print_table_end(); -} - -PHP_MSHUTDOWN_FUNCTION(birdstep) -{ - SQLFreeEnv(henv); - return SUCCESS; -} - -/* Some internal functions. Connections and result manupulate */ - -static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc) -{ - int ind; - - ind = zend_list_insert(conn,php_birdstep_module.le_link); - conn->hdbc = hdbc; - conn->index = ind; - - return(ind); -} - -static VConn * birdstep_find_conn(HashTable *list,int ind) -{ - VConn *conn; - int type; - - conn = zend_list_find(ind,&type); - if ( !conn || type != php_birdstep_module.le_link ) { - return(NULL); - } - return(conn); -} - -static void birdstep_del_conn(HashTable *list,int ind) -{ - zend_list_delete(ind); -} - -static int birdstep_add_result(HashTable *list,Vresult *res,VConn *conn) -{ - int ind; - - ind = zend_list_insert(res,php_birdstep_module.le_result); - res->conn = conn; - res->index = ind; - - return(ind); -} - -static Vresult * birdstep_find_result(HashTable *list,int ind) -{ - Vresult *res; - int type; - - res = zend_list_find(ind,&type); - if ( !res || type != php_birdstep_module.le_result ) { - return(NULL); - } - return(res); -} - -static void birdstep_del_result(HashTable *list,int ind) -{ - zend_list_delete(ind); -} - -/* Users functions */ - -/* {{{ proto int birdstep_connect(string server, string user, string pass) - */ -PHP_FUNCTION(birdstep_connect) -{ - zval **serv,**user,**pass; - char *Serv = NULL; - char *User = NULL; - char *Pass = NULL; - RETCODE stat; - HDBC hdbc; - VConn *new; - long ind; - - if ( php_birdstep_module.max_links != -1 && php_birdstep_module.num_links == php_birdstep_module.max_links ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links); - RETURN_FALSE; - } - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &serv, &user, &pass) == FAILURE ) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(serv); - convert_to_string_ex(user); - convert_to_string_ex(pass); - Serv = Z_STRVAL_PP(serv); - User = Z_STRVAL_PP(user); - Pass = Z_STRVAL_PP(pass); - stat = SQLAllocConnect(henv,&hdbc); - if ( stat != SQL_SUCCESS ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not allocate connection handle"); - RETURN_FALSE; - } - stat = SQLConnect(hdbc,Serv,SQL_NTS,User,SQL_NTS,Pass,SQL_NTS); - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s",Serv,User); - SQLFreeConnect(hdbc); - RETURN_FALSE; - } - new = (VConn *)emalloc(sizeof(VConn)); - ind = birdstep_add_conn(list,new,hdbc); - php_birdstep_module.num_links++; - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto bool birdstep_close(int id) - */ -PHP_FUNCTION(birdstep_close) -{ - zval **id; - VConn *conn; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &id) == FAILURE) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(id); - - SQLDisconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - birdstep_del_conn(list,Z_LVAL_PP(id)); - php_birdstep_module.num_links--; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int birdstep_exec(int index, string exec_str) - */ -PHP_FUNCTION(birdstep_exec) -{ - zval **ind, **exec_str; - char *query = NULL; - int indx; - VConn *conn; - Vresult *res; - RETCODE stat; - SWORD cols,i,colnamelen; - SDWORD rows,coldesc; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &ind, &exec_str) == FAILURE) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(ind); - - convert_to_string_ex(exec_str); - query = Z_STRVAL_PP(exec_str); - - res = (Vresult *)emalloc(sizeof(Vresult)); - stat = SQLAllocStmt(conn->hdbc,&res->hstmt); - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat); - efree(res); - RETURN_FALSE; - } - stat = SQLExecDirect(res->hstmt,query,SQL_NTS); - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Can not execute \"%s\" query",query); - SQLFreeStmt(res->hstmt,SQL_DROP); - efree(res); - RETURN_FALSE; - } - /* Success query */ - stat = SQLNumResultCols(res->hstmt,&cols); - if ( stat != SQL_SUCCESS ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat); - SQLFreeStmt(res->hstmt,SQL_DROP); - efree(res); - RETURN_FALSE; - } - if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */ - stat = SQLRowCount(res->hstmt,&rows); - if ( stat != SQL_SUCCESS ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat); - SQLFreeStmt(res->hstmt,SQL_DROP); - efree(res); - RETURN_FALSE; - } - SQLFreeStmt(res->hstmt,SQL_DROP); - efree(res); - RETURN_LONG(rows); - } else { /* Was SELECT query */ - res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0); - res->numcols = cols; - for ( i = 0; i < cols; i++ ) { - SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME, - res->values[i].name,sizeof(res->values[i].name), - &colnamelen,NULL); - SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_TYPE, - NULL,0,NULL,&res->values[i].valtype); - switch ( res->values[i].valtype ) { - case SQL_LONGVARBINARY: - case SQL_LONGVARCHAR: - res->values[i].value = NULL; - continue; - default: - break; - } - SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_DISPLAY_SIZE, - NULL,0,NULL,&coldesc); - res->values[i].value = (char *)emalloc(coldesc+1); - SQLBindCol(res->hstmt,i+1,SQL_C_CHAR, res->values[i].value,coldesc+1, &res->values[i].vallen); - } - } - res->fetched = 0; - indx = birdstep_add_result(list,res,conn); - RETURN_LONG(indx); -} -/* }}} */ - -/* {{{ proto bool birdstep_fetch(int index) - */ -PHP_FUNCTION(birdstep_fetch) -{ - zval **ind; - Vresult *res; - RETCODE stat; - UDWORD row; - UWORD RowStat[1]; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ind) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_GET_BIRDSTEP_RES_IDX(ind); - - stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); - if ( stat == SQL_NO_DATA_FOUND ) { - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error"); - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - res->fetched = 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed birdstep_result(int index, int col) - */ -PHP_FUNCTION(birdstep_result) -{ - zval **ind, **col; - Vresult *res; - RETCODE stat; - int i,sql_c_type; - UDWORD row; - UWORD RowStat[1]; - SWORD indx = -1; - char *field = NULL; - - if ( ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &ind, &col) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_GET_BIRDSTEP_RES_IDX(ind); - - if ( Z_TYPE_PP(col) == IS_STRING ) { - field = Z_STRVAL_PP(col); - } else { - convert_to_long_ex(col); - indx = Z_LVAL_PP(col); - } - if ( field ) { - for ( i = 0; i < res->numcols; i++ ) { - if ( !strcasecmp(res->values[i].name,field)) { - indx = i; - break; - } - } - if ( indx < 0 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found",field); - RETURN_FALSE; - } - } else { - if ( indx < 0 || indx >= res->numcols ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range"); - RETURN_FALSE; - } - } - if ( !res->fetched ) { - stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); - if ( stat == SQL_NO_DATA_FOUND ) { - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error"); - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - res->fetched = 1; - } - switch ( res->values[indx].valtype ) { - case SQL_LONGVARBINARY: - sql_c_type = SQL_C_BINARY; - goto l1; - case SQL_LONGVARCHAR: - sql_c_type = SQL_C_CHAR; -l1: - if ( !res->values[indx].value ) { - res->values[indx].value = emalloc(4096); - } - stat = SQLGetData(res->hstmt,indx+1,sql_c_type, - res->values[indx].value,4095,&res->values[indx].vallen); - if ( stat == SQL_NO_DATA_FOUND ) { - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLGetData return error"); - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_FALSE; - } - if ( res->values[indx].valtype == SQL_LONGVARCHAR ) { - RETURN_STRING(res->values[indx].value,TRUE); - } else { - RETURN_LONG((long)res->values[indx].value); - } - default: - if ( res->values[indx].value != NULL ) { - RETURN_STRING(res->values[indx].value,TRUE); - } - } -} -/* }}} */ - -/* {{{ proto bool birdstep_freeresult(int index) - */ -PHP_FUNCTION(birdstep_freeresult) -{ - zval **ind; - Vresult *res; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ind) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_GET_BIRDSTEP_RES_IDX(ind); - - SQLFreeStmt(res->hstmt,SQL_DROP); - birdstep_del_result(list,Z_LVAL_PP(ind)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool birdstep_autocommit(int index) - */ -PHP_FUNCTION(birdstep_autocommit) -{ - zval **id; - RETCODE stat; - VConn *conn; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &id) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(id); - - stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON); - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_on option failure"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool birdstep_off_autocommit(int index) - */ -PHP_FUNCTION(birdstep_off_autocommit) -{ - zval **id; - RETCODE stat; - VConn *conn; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &id) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(id); - - stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF); - if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_off option failure"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool birdstep_commit(int index) - */ -PHP_FUNCTION(birdstep_commit) -{ - zval **id; - RETCODE stat; - VConn *conn; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &id) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(id) - - stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT); - if ( stat != SQL_SUCCESS ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Commit failure"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool birdstep_rollback(int index) - */ -PHP_FUNCTION(birdstep_rollback) -{ - zval **id; - RETCODE stat; - VConn *conn; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &id) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_BIRDSTEP_CHK_LNK(id); - - stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK); - if ( stat != SQL_SUCCESS ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Rollback failure"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string birdstep_fieldname(int index, int col) - */ -PHP_FUNCTION(birdstep_fieldname) -{ - zval **ind, **col; - Vresult *res; - SWORD indx; - - if ( ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &ind, &col) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_GET_BIRDSTEP_RES_IDX(ind); - - convert_to_long_ex(col); - indx = Z_LVAL_PP(col); - if ( indx < 0 || indx >= res->numcols ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range"); - RETURN_FALSE; - } - RETURN_STRING(res->values[indx].name,TRUE); -} -/* }}} */ - -/* {{{ proto int birdstep_fieldnum(int index) - */ -PHP_FUNCTION(birdstep_fieldnum) -{ - zval **ind; - Vresult *res; - - if ( ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ind) == FAILURE ) { - WRONG_PARAM_COUNT; - } - PHP_GET_BIRDSTEP_RES_IDX(ind); - - RETURN_LONG(res->numcols); -} -/* }}} */ - -#endif /* HAVE_BIRDSTEP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 deleted file mode 100644 index ef04a94b88a45..0000000000000 --- a/ext/odbc/config.m4 +++ /dev/null @@ -1,596 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_ODBC_CHECK_HEADER],[ -if ! test -f "$ODBC_INCDIR/$1"; then - AC_MSG_ERROR([ODBC header file '$ODBC_INCDIR/$1' not found!]) -fi -]) - -dnl -dnl Figure out which library file to link with for the Solid support. -dnl -AC_DEFUN([PHP_ODBC_FIND_SOLID_LIBS],[ - AC_MSG_CHECKING([Solid library file]) - ac_solid_uname_r=`uname -r 2>/dev/null` - ac_solid_uname_s=`uname -s 2>/dev/null` - case $ac_solid_uname_s in - AIX) ac_solid_os=a3x;; # a4x for AIX4/ Solid 2.3/3.0 only - HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10 - IRIX) ac_solid_os=irx;; # Solid 2.3(?)/ 3.0 only - Linux) - if ldd -v /bin/sh | grep GLIBC > /dev/null; then - AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ]) - ac_solid_os=l2x - else - AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ]) - ac_solid_os=lux - fi;; - SunOS) - ac_solid_os=ssx;; # should we deal with SunOS 4? - FreeBSD) - if test `expr $ac_solid_uname_r : '\(.\)'` -gt "2"; then - AC_DEFINE(SS_FBX,1,[Needed in sqlunix.h for wchar defs ]) - ac_solid_os=fex - else - AC_DEFINE(SS_FBX,1,[Needed in sqlunix.h for wchar defs ]) - ac_solid_os=fbx - fi;; - esac - - if test -f $1/soc${ac_solid_os}35.a; then - ac_solid_version=35 - ac_solid_prefix=soc - elif test -f $1/scl${ac_solid_os}30.a; then - ac_solid_version=30 - ac_solid_prefix=scl - elif test -f $1/scl${ac_solid_os}23.a; then - ac_solid_version=23 - ac_solid_prefix=scl - fi - -# -# Check for the library files, and setup the ODBC_LIBS path... -# -if test ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \ - ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then - # - # we have an error and should bail out, as we can't find the libs! - # - echo "" - echo "*********************************************************************" - echo "* Unable to locate $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a" - echo "* Please correct this by creating the following links and reconfiguring:" - echo "* $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a" - echo "* $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so" - echo "*********************************************************************" -else - ODBC_LFLAGS=-L$1 - ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version} -fi - - AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`) -]) - - -dnl -dnl Figure out which library file to link with for the Empress support. -dnl - -AC_DEFUN([PHP_ODBC_FIND_EMPRESS_LIBS],[ - AC_MSG_CHECKING([Empress library file]) - ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1` - if test ! -f $ODBC_LIBS; then - ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1` - fi - AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`) -]) - -AC_DEFUN([PHP_ODBC_FIND_EMPRESS_BCS_LIBS],[ - AC_MSG_CHECKING([Empress local access library file]) - ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1` - if test ! -f $ODBCBCS_LIBS; then - ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1` - fi - AC_MSG_RESULT(`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'`) -]) - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Adabas support) -AC_ARG_WITH(adabas, -[ --with-adabas[=DIR] Include Adabas D support. DIR is the Adabas base - install directory [/usr/local]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local - fi - if test "$withval" != "no"; then - PHP_ADD_INCLUDE($withval/incl) - PHP_ADD_LIBPATH($withval/$PHP_LIBDIR) - ODBC_OBJS="$withval/$PHP_LIBDIR/odbclib.a" - ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a" - $srcdir/build/shtool mkdir -f -p ext/odbc - rm -f "$ODBC_LIB" - cp "$ODBC_OBJS" "$ODBC_LIB" - PHP_ADD_LIBRARY(sqlptc) - PHP_ADD_LIBRARY(sqlrte) - PHP_ADD_LIBRARY_WITH_PATH(odbc_adabas, $abs_builddir/ext/odbc) - ODBC_TYPE=adabas - PHP_ODBC_CHECK_HEADER(sqlext.h) - AC_DEFINE(HAVE_ADABAS,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for SAP DB support) -AC_ARG_WITH(sapdb, -[ --with-sapdb[=DIR] Include SAP DB support. DIR is SAP DB base - install directory [/usr/local]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local - fi - if test "$withval" != "no"; then - PHP_ADD_INCLUDE($withval/incl) - PHP_ADD_LIBPATH($withval/lib) - PHP_ADD_LIBRARY(sqlod) - ODBC_TYPE=sapdb - AC_DEFINE(HAVE_SAPDB,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Solid support) -AC_ARG_WITH(solid, -[ --with-solid[=DIR] Include Solid support. DIR is the Solid base - install directory, defaults to /usr/local/solid], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local/solid - fi - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_TYPE=solid - if test -f $ODBC_LIBDIR/soc*35.a; then - AC_DEFINE(HAVE_SOLID_35,1,[ ]) - elif test -f $ODBC_LIBDIR/scl*30.a; then - AC_DEFINE(HAVE_SOLID_30,1,[ ]) - elif test -f $ODBC_LIBDIR/scl*23.a; then - AC_DEFINE(HAVE_SOLID,1,[ ]) - fi - AC_MSG_RESULT(yes) - PHP_ODBC_FIND_SOLID_LIBS($ODBC_LIBDIR) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for IBM DB2 support) -AC_ARG_WITH(ibm-db2, -[ --with-ibm-db2[=DIR] Include IBM DB2 support. DIR is the DB2 base - install directory, defaults to /home/db2inst1/sqllib], -[ - PHP_WITH_SHARED - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - ODBC_INCDIR=/home/db2inst1/sqllib/include - ODBC_LIBDIR=/home/db2inst1/sqllib/lib - else - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - fi - - PHP_ODBC_CHECK_HEADER(sqlcli1.h) - - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_TYPE=db2 - ODBC_LIBS=-ldb2 - - PHP_TEST_BUILD(SQLExecute, [ - AC_DEFINE(HAVE_IBMDB2,1,[ ]) - AC_MSG_RESULT(yes) - ], [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([ -build test failed. Please check the config.log for details. -You need to source your DB2 environment before running PHP configure: -# . \$IBM_DB2/db2profile -]) - ], [ - $ODBC_LFLAGS $ODBC_LIBS - ]) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for ODBCRouter.com support) -AC_ARG_WITH(ODBCRouter, -[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support. DIR is ODBCRouter base - install directory [/usr]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr - fi - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/lib - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LIBS=-lodbcsdk - ODBC_TYPE=ODBCRouter - AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Empress support) -AC_ARG_WITH(empress, -[ --with-empress[=DIR] Include Empress support. DIR is the Empress base - install directory, defaults to \$EMPRESSPATH. - From PHP 4, this option only supports Empress Version - 8.60 and above], -[ - PHP_WITH_SHARED - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - ODBC_INCDIR=$EMPRESSPATH/include/odbc - ODBC_LIBDIR=$EMPRESSPATH/shlib - else - ODBC_INCDIR=$withval/include/odbc - ODBC_LIBDIR=$withval/shlib - fi - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_TYPE=empress - AC_DEFINE(HAVE_EMPRESS,1,[ ]) - AC_MSG_RESULT(yes) - PHP_ODBC_FIND_EMPRESS_LIBS($ODBC_LIBDIR) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Empress local access support) -AC_ARG_WITH(empress-bcs, -[ --with-empress-bcs[=DIR] - Include Empress Local Access support. DIR is the - Empress base install directory. (Empress Version >= 8.60 required) - [\$EMPRESSPATH]], -[ - PHP_WITH_SHARED - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - ODBC_INCDIR=$EMPRESSPATH/include/odbc - ODBC_LIBDIR=$EMPRESSPATH/shlib - else - ODBC_INCDIR=$withval/include/odbc - ODBC_LIBDIR=$withval/shlib - fi - CC="empocc -bcs";export CC; - LD="empocc -bcs";export LD; - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - LIST=`empocc -listlines -bcs -o a a.c` - - NEWLIST= - for I in $LIST - do - case $I in - $EMPRESSPATH/odbccl/lib/* | \ - $EMPRESSPATH/rdbms/lib/* | \ - $EMPRESSPATH/common/lib/*) - NEWLIST="$NEWLIST $I" - ;; - esac - done - ODBC_LIBS="-lempphpbcs -lms -lmscfg -lbasic -lbasic_os -lnlscstab -lnlsmsgtab -lm -ldl -lcrypt" - ODBC_TYPE=empress - AC_DEFINE(HAVE_EMPRESS,1,[ ]) - AC_MSG_RESULT(yes) - PHP_ODBC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Birdstep support) -AC_ARG_WITH(birdstep, -[ --with-birdstep[=DIR] Include Birdstep support. DIR is the Birdstep base - install directory [/usr/local/birdstep]], -[ - PHP_WITH_SHARED - - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - ODBC_INCDIR=/usr/local/birdstep/include - ODBC_LIBDIR=/usr/local/birdstep/lib - else - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - fi - - case $host_alias in - *aix*[)] - AC_DEFINE(AIX,1,[ ]);; - *hpux*[)] - AC_DEFINE(HPUX,1,[ ]);; - *linux*[)] - AC_DEFINE(LINUX,1,[ ]);; - *qnx*[)] - AC_DEFINE(NEUTRINO,1,[ ]);; - i?86-*-solaris*[)] - AC_DEFINE(ISOLARIS,1,[ ]);; - sparc-*-solaris*[)] - AC_DEFINE(SOLARIS,1,[ ]);; - *unixware*[)] - AC_DEFINE(UNIXWARE,1,[ ]);; - esac - - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_TYPE=birdstep - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil" - - if test -e "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then - ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil" - elif test -e "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then - ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil" - fi - - AC_DEFINE(HAVE_BIRDSTEP,1,[ ]) - - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for a custom ODBC support) -AC_ARG_WITH(custom-odbc, -[ --with-custom-odbc[=DIR] - Include a user defined ODBC support. - The DIR is ODBC install base directory, - which defaults to /usr/local. - Make sure to define CUSTOM_ODBC_LIBS and - have some odbc.h in your include dirs. - E.g., you should define following for - Sybase SQL Anywhere 5.5.00 on QNX, prior to - run configure script: - CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\" - LDFLAGS=-lunix - CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"], -[ - if test "$withval" = "yes"; then - withval=/usr/local - fi - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LIBS=$CUSTOM_ODBC_LIBS - ODBC_TYPE=custom - AC_DEFINE(HAVE_CODBC,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for iODBC support) -AC_ARG_WITH(iodbc, -[ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base - install directory [/usr/local]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local - fi - if test "$withval" != "no"; then - PHP_ADD_LIBRARY_WITH_PATH(iodbc, $withval/lib) - PHP_ADD_INCLUDE($withval/include, 1) - ODBC_TYPE=iodbc - ODBC_INCLUDE=-I$withval/include - ODBC_LFLAGS=-L$withval/$PHP_LIBDIR - ODBC_LIBS=-liodbc - AC_DEFINE(HAVE_IODBC,1,[ ]) - AC_DEFINE(HAVE_ODBC2,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support) -AC_ARG_WITH(esoob, -[ --with-esoob[=DIR] Include Easysoft OOB support. DIR is the OOB base - install directory [/usr/local/easysoft/oob/client]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local/easysoft/oob/client - fi - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LIBS=-lesoobclient - ODBC_TYPE=ESOOB - AC_DEFINE(HAVE_ESOOB,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for unixODBC support) -AC_ARG_WITH(unixODBC, -[ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base - install directory [/usr/local]], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - withval=/usr/local - fi - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LIBS=-lodbc - ODBC_TYPE=unixODBC - PHP_ODBC_CHECK_HEADER(sqlext.h) - AC_DEFINE(HAVE_UNIXODBC,1,[ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -z "$ODBC_TYPE"; then -AC_MSG_CHECKING(for DBMaker support) -AC_ARG_WITH(dbmaker, -[ --with-dbmaker[=DIR] Include DBMaker support. DIR is the DBMaker base - install directory, defaults to where the latest - version of DBMaker is installed (such as - /home/dbmaker/3.6)], -[ - PHP_WITH_SHARED - if test "$withval" = "yes"; then - # find dbmaker's home directory - DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'` - - # check DBMaker version (from 5.0 to 2.0) - DBMAKER_VERSION=5.0 - - while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do - DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | $AWK '{ print $1-1;}'` - MAJOR_V=`echo $DM_VER | $AWK '{ print $1/10; }' | $AWK -F. '{ print $1; }'` - MINOR_V=`echo $DM_VER | $AWK '{ print $1%10; }'` - DBMAKER_VERSION=$MAJOR_V.$MINOR_V - done - - if test "$DBMAKER_VERSION" = "2.9"; then - withval=$DBMAKER_HOME - else - DBMAKER_PATH=$DBMAKER_HOME/$DBMAKER_VERSION - fi - - withval=$DBMAKER_PATH - fi - - if test "$withval" != "no"; then - ODBC_INCDIR=$withval/include - ODBC_LIBDIR=$withval/$PHP_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_INCLUDE=-I$ODBC_INCDIR - ODBC_LIBS="-ldmapic -lc" - ODBC_TYPE=dbmaker - - AC_DEFINE(HAVE_DBMAKER,1,[Whether you want DBMaker]) - - if test "$shared" = "yes"; then - AC_MSG_RESULT(yes (shared)) - ODBC_LIBS="-ldmapic -lc -lm" - ODBC_SHARED="odbc.la" - else - AC_MSG_RESULT(yes (static)) - PHP_ADD_LIBRARY_WITH_PATH(dmapic, $ODBC_LIBDIR) - PHP_ADD_INCLUDE($ODBC_INCDIR) - ODBC_STATIC="libphpext_odbc.la" - fi - - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) -fi - -if test -n "$ODBC_TYPE"; then - if test "$ODBC_TYPE" != "dbmaker"; then - ext_shared=$shared - PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD) - if test "$ODBC_TYPE" != "birdstep"; then - AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ]) - fi - fi - - AC_DEFINE(HAVE_UODBC,1,[ ]) - PHP_SUBST(ODBC_SHARED_LIBADD) - PHP_SUBST(ODBC_INCDIR) - PHP_SUBST(ODBC_LIBDIR) - PHP_SUBST_OLD(ODBC_INCLUDE) - PHP_SUBST_OLD(ODBC_LIBS) - PHP_SUBST_OLD(ODBC_LFLAGS) - PHP_SUBST_OLD(ODBC_TYPE) - - PHP_NEW_EXTENSION(odbc, php_odbc.c, $ext_shared,, $ODBC_INCLUDE) -fi diff --git a/ext/odbc/config.w32 b/ext/odbc/config.w32 deleted file mode 100644 index 2ff2a06998401..0000000000000 --- a/ext/odbc/config.w32 +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("odbc", "ODBC support", "yes"); - -if (PHP_ODBC == "yes") { - EXTENSION("odbc", "php_odbc.c"); - AC_DEFINE("HAVE_UODBC", 1, "ODBC support"); - ADD_FLAG('LIBS_ODBC', 'odbc32.lib odbccp32.lib'); -} - - diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h deleted file mode 100644 index b9f5b1da8834d..0000000000000 --- a/ext/odbc/php_birdstep.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Nikolay P. Romanyuk <mag@redcom.ru> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BIRDSTEP_H -#define PHP_BIRDSTEP_H - -#if defined(HAVE_BIRDSTEP) && !HAVE_UODBC -#define UNIX -#include <sql.h> -#include <sqlext.h> - -typedef struct VConn { - HDBC hdbc; - long index; -} VConn; - -typedef struct { - char name[32]; - char *value; - long vallen; - SDWORD valtype; -} VResVal; - -typedef struct Vresult { - HSTMT hstmt; - VConn *conn; - long index; - VResVal *values; - long numcols; - int fetched; -} Vresult; - -typedef struct { - long num_links; - long max_links; - int le_link,le_result; -} birdstep_module; - -extern zend_module_entry birdstep_module_entry; -#define birdstep_module_ptr &birdstep_module_entry - -/* birdstep.c functions */ -PHP_MINIT_FUNCTION(birdstep); -PHP_RINIT_FUNCTION(birdstep); -PHP_MINFO_FUNCTION(birdstep); -PHP_MSHUTDOWN_FUNCTION(birdstep); - -PHP_FUNCTION(birdstep_connect); -PHP_FUNCTION(birdstep_close); -PHP_FUNCTION(birdstep_exec); -PHP_FUNCTION(birdstep_fetch); -PHP_FUNCTION(birdstep_result); -PHP_FUNCTION(birdstep_freeresult); -PHP_FUNCTION(birdstep_autocommit); -PHP_FUNCTION(birdstep_off_autocommit); -PHP_FUNCTION(birdstep_commit); -PHP_FUNCTION(birdstep_rollback); -PHP_FUNCTION(birdstep_fieldnum); -PHP_FUNCTION(birdstep_fieldname); - -extern birdstep_module php_birdstep_module; - -#else - -#define birdstep_module_ptr NULL - -#endif /* HAVE_BIRDSTEP */ -#endif /* PHP_BIRDSTEP_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c deleted file mode 100644 index 83c45c1f13e03..0000000000000 --- a/ext/odbc/php_odbc.c +++ /dev/null @@ -1,3700 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Andreas Karajannis <Andreas.Karajannis@gmd.de> | - | Frank M. Kromann <frank@kromann.info> Support for DB/2 CLI | - | Kevin N. Shallow <kshallow@tampabay.rr.com> Birdstep Support| - | Daniel R. Kalowsky <kalowsky@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" - -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_standard.h" - -#include "php_odbc.h" -#include "php_odbc_includes.h" -#include "php_globals.h" - -#if HAVE_UODBC - -#include <fcntl.h> -#include "ext/standard/head.h" -#include "php_ini.h" - -#ifdef PHP_WIN32 -#include <winsock2.h> - -#define ODBC_TYPE "Win32" -#define PHP_ODBC_TYPE ODBC_TYPE - -#endif - -/* - * not defined elsewhere - */ - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent); - -static int le_result, le_conn, le_pconn; - -#define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0)) - -/* {{{ odbc_functions[] - */ -function_entry odbc_functions[] = { - PHP_FE(odbc_autocommit, NULL) - PHP_FE(odbc_binmode, NULL) - PHP_FE(odbc_close, NULL) - PHP_FE(odbc_close_all, NULL) - PHP_FE(odbc_columns, NULL) - PHP_FE(odbc_commit, NULL) - PHP_FE(odbc_connect, NULL) - PHP_FE(odbc_cursor, NULL) -#ifdef HAVE_SQLDATASOURCES - PHP_FE(odbc_data_source, NULL) -#endif - PHP_FE(odbc_execute, NULL) - PHP_FE(odbc_error, NULL) - PHP_FE(odbc_errormsg, NULL) - PHP_FE(odbc_exec, NULL) -#ifdef PHP_ODBC_HAVE_FETCH_HASH - PHP_FE(odbc_fetch_array, NULL) - PHP_FE(odbc_fetch_object, NULL) -#endif - PHP_FE(odbc_fetch_row, NULL) - PHP_FE(odbc_fetch_into, second_arg_force_ref) - PHP_FE(odbc_field_len, NULL) - PHP_FE(odbc_field_scale, NULL) - PHP_FE(odbc_field_name, NULL) - PHP_FE(odbc_field_type, NULL) - PHP_FE(odbc_field_num, NULL) - PHP_FE(odbc_free_result, NULL) - PHP_FE(odbc_gettypeinfo, NULL) - PHP_FE(odbc_longreadlen, NULL) -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) - PHP_FE(odbc_next_result, NULL) -#endif - PHP_FE(odbc_num_fields, NULL) - PHP_FE(odbc_num_rows, NULL) - PHP_FE(odbc_pconnect, NULL) - PHP_FE(odbc_prepare, NULL) - PHP_FE(odbc_result, NULL) - PHP_FE(odbc_result_all, NULL) - PHP_FE(odbc_rollback, NULL) - PHP_FE(odbc_setoption, NULL) - PHP_FE(odbc_specialcolumns, NULL) - PHP_FE(odbc_statistics, NULL) - PHP_FE(odbc_tables, NULL) - PHP_FE(odbc_primarykeys, NULL) -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP) /* not supported now */ - PHP_FE(odbc_columnprivileges, NULL) - PHP_FE(odbc_tableprivileges, NULL) -#endif -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* not supported */ - PHP_FE(odbc_foreignkeys, NULL) - PHP_FE(odbc_procedures, NULL) -#if !defined(HAVE_BIRDSTEP) - PHP_FE(odbc_procedurecolumns, NULL) -#endif -#endif - PHP_FALIAS(odbc_do, odbc_exec, NULL) - PHP_FALIAS(odbc_field_precision, odbc_field_len, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ odbc_module_entry - */ -zend_module_entry odbc_module_entry = { - STANDARD_MODULE_HEADER, - "odbc", - odbc_functions, - PHP_MINIT(odbc), - PHP_MSHUTDOWN(odbc), - PHP_RINIT(odbc), - PHP_RSHUTDOWN(odbc), - PHP_MINFO(odbc), - "1.0", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef ZTS -int odbc_globals_id; -#else -ZEND_API php_odbc_globals odbc_globals; -#endif - -#ifdef COMPILE_DL_ODBC -ZEND_GET_MODULE(odbc) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* {{{ _free_odbc_result - */ -static void _free_odbc_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - odbc_result *res = (odbc_result *)rsrc->ptr; - int i; - RETCODE rc; - - if (res) { - if (res->values) { - for(i = 0; i < res->numcols; i++) { - if (res->values[i].value) - efree(res->values[i].value); - } - efree(res->values); - res->values = NULL; - } - if (res->stmt) { -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) - SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc, - (UWORD)SQL_COMMIT); -#endif - rc = SQLFreeStmt(res->stmt,SQL_DROP); - /* We don't want the connection to be closed after the last statment has been closed - * Connections will be closed on shutdown - * zend_list_delete(res->conn_ptr->id); - */ - } - efree(res); - } -} -/* }}} */ - -/* {{{ safe_odbc_disconnect - * disconnect, and if it fails, then issue a rollback for any pending transaction (lurcher) - */ -static void safe_odbc_disconnect( void *handle ) -{ - int ret; - - ret = SQLDisconnect( handle ); - if ( ret == SQL_ERROR ) - { - SQLTransact( NULL, handle, SQL_ROLLBACK ); - SQLDisconnect( handle ); - } -} -/* }}} */ - -/* {{{ _close_odbc_conn - */ -static void _close_odbc_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int i, nument, type; - void *ptr; - odbc_result *res; - - odbc_connection *conn = (odbc_connection *)rsrc->ptr; - - nument = zend_hash_next_free_element(&EG(regular_list)); - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - res = (odbc_result *)ptr; - if (res->conn_ptr == conn) { - zend_list_delete(i); - } - } - } - - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); - efree(conn); - ODBCG(num_links)--; -} -/* }}} */ - -/* {{{ void _close_odbc_pconn - */ -static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int i, nument, type; - void *ptr; - odbc_result *res; - odbc_connection *conn = (odbc_connection *)rsrc->ptr; - - nument = zend_hash_next_free_element(&EG(persistent_list)); - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - res = (odbc_result *)ptr; - if (res->conn_ptr == conn) { - zend_list_delete(i); - } - } - } - - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); - free(conn); - - ODBCG(num_links)--; - ODBCG(num_persistent)--; -} -/* }}} */ - -/* {{{ PHP_INI_DISP(display_link_nums) - */ -static PHP_INI_DISP(display_link_nums) -{ - char *value; - TSRMLS_FETCH(); - - if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value) == -1) { - PUTS("Unlimited"); - } else { - php_printf("%s", value); - } - } -} -/* }}} */ - -/* {{{ PHP_INI_DISP(display_defPW) - */ -static PHP_INI_DISP(display_defPW) -{ - char *value; - TSRMLS_FETCH(); - - if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { -#if PHP_DEBUG - php_printf("%s", value); -#else - PUTS("********"); -#endif - } else { - if (PG(html_errors)) { - PUTS("<i>no value</i>"); - } else { - PUTS("no value"); - } - } -} -/* }}} */ - -/* {{{ PHP_INI_DISP(display_binmode) - */ -static PHP_INI_DISP(display_binmode) -{ - char *value; - TSRMLS_FETCH(); - - if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - switch(atoi(value)) { - case 0: - PUTS("passthru"); - break; - case 1: - PUTS("return as is"); - break; - case 2: - PUTS("return as char"); - break; - } - } -} -/* }}} */ - -/* {{{ PHP_INI_DISP(display_lrl) - */ -static PHP_INI_DISP(display_lrl) -{ - char *value; - TSRMLS_FETCH(); - - if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value) <= 0) { - PUTS("Passthru"); - } else { - php_printf("return up to %s bytes", value); - } - } -} -/* }}} */ - -/* {{{ PHP_INI_BEGIN - */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("odbc.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, - allow_persistent, php_odbc_globals, odbc_globals) - STD_PHP_INI_ENTRY_EX("odbc.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, - max_persistent, php_odbc_globals, odbc_globals, display_link_nums) - STD_PHP_INI_ENTRY_EX("odbc.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, - max_links, php_odbc_globals, odbc_globals, display_link_nums) - STD_PHP_INI_ENTRY("odbc.default_db", NULL, PHP_INI_ALL, OnUpdateString, - defDB, php_odbc_globals, odbc_globals) - STD_PHP_INI_ENTRY("odbc.default_user", NULL, PHP_INI_ALL, OnUpdateString, - defUser, php_odbc_globals, odbc_globals) - STD_PHP_INI_ENTRY_EX("odbc.default_pw", NULL, PHP_INI_ALL, OnUpdateString, - defPW, php_odbc_globals, odbc_globals, display_defPW) - STD_PHP_INI_ENTRY_EX("odbc.defaultlrl", "4096", PHP_INI_ALL, OnUpdateLong, - defaultlrl, php_odbc_globals, odbc_globals, display_lrl) - STD_PHP_INI_ENTRY_EX("odbc.defaultbinmode", "1", PHP_INI_ALL, OnUpdateLong, - defaultbinmode, php_odbc_globals, odbc_globals, display_binmode) - STD_PHP_INI_BOOLEAN("odbc.check_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, - check_persistent, php_odbc_globals, odbc_globals) -PHP_INI_END() -/* }}} */ - -#ifdef ZTS -static void php_odbc_init_globals(php_odbc_globals *odbc_globals_p TSRMLS_DC) -{ - ODBCG(num_persistent) = 0; -} -#endif - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(odbc) -{ -#ifdef SQLANY_BUG - ODBC_SQL_CONN_T foobar; - RETCODE rc; -#endif - -#ifdef ZTS - ts_allocate_id(&odbc_globals_id, sizeof(php_odbc_globals), php_odbc_init_globals, NULL); -#else - ODBCG(num_persistent) = 0; -#endif - - REGISTER_INI_ENTRIES(); - le_result = zend_register_list_destructors_ex(_free_odbc_result, NULL, "odbc result", module_number); - le_conn = zend_register_list_destructors_ex(_close_odbc_conn, NULL, "odbc link", module_number); - le_pconn = zend_register_list_destructors_ex(NULL, _close_odbc_pconn, "odbc link persistent", module_number); - Z_TYPE(odbc_module_entry) = type; - - REGISTER_STRING_CONSTANT("ODBC_TYPE", PHP_ODBC_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("ODBC_BINMODE_PASSTHRU", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("ODBC_BINMODE_RETURN", 1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("ODBC_BINMODE_CONVERT", 2, CONST_CS | CONST_PERSISTENT); - /* Define Constants for options - these Constants are defined in <sqlext.h> - */ - REGISTER_LONG_CONSTANT("SQL_ODBC_CURSORS", SQL_ODBC_CURSORS, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC, CONST_PERSISTENT | CONST_CS); - - - REGISTER_LONG_CONSTANT("SQL_CONCURRENCY", SQL_CONCURRENCY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CONCUR_LOCK", SQL_CONCUR_LOCK, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CONCUR_VALUES", SQL_CONCUR_VALUES, CONST_PERSISTENT | CONST_CS); - - REGISTER_LONG_CONSTANT("SQL_CURSOR_TYPE", SQL_CURSOR_TYPE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_CURSOR_STATIC", SQL_CURSOR_STATIC, CONST_PERSISTENT | CONST_CS); - - REGISTER_LONG_CONSTANT("SQL_KEYSET_SIZE", SQL_KEYSET_SIZE, CONST_PERSISTENT | CONST_CS); - - /* these are for the Data Source type */ - REGISTER_LONG_CONSTANT("SQL_FETCH_FIRST", SQL_FETCH_FIRST, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_FETCH_NEXT", SQL_FETCH_NEXT, CONST_PERSISTENT | CONST_CS); - - /* - * register the standard data types - */ - REGISTER_LONG_CONSTANT("SQL_CHAR", SQL_CHAR, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_VARCHAR", SQL_VARCHAR, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_LONGVARCHAR", SQL_LONGVARCHAR, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_DECIMAL", SQL_DECIMAL, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_NUMERIC", SQL_NUMERIC, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_BIT", SQL_BIT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_TINYINT", SQL_TINYINT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_SMALLINT", SQL_SMALLINT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_INTEGER", SQL_INTEGER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_BIGINT", SQL_BIGINT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_REAL", SQL_REAL, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_FLOAT", SQL_FLOAT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_DOUBLE", SQL_DOUBLE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_BINARY", SQL_BINARY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_VARBINARY", SQL_VARBINARY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_LONGVARBINARY", SQL_LONGVARBINARY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_DATE", SQL_DATE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_TIME", SQL_TIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_TIMESTAMP", SQL_TIMESTAMP, CONST_PERSISTENT | CONST_CS); -#if defined(ODBCVER) && (ODBCVER >= 0x0300) - REGISTER_LONG_CONSTANT("SQL_TYPE_DATE", SQL_TYPE_DATE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_TYPE_TIME", SQL_TYPE_TIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_TYPE_TIMESTAMP", SQL_TYPE_TIMESTAMP, CONST_PERSISTENT | CONST_CS); - - /* - * SQLSpecialColumns values - */ - REGISTER_LONG_CONSTANT("SQL_BEST_ROWID", SQL_BEST_ROWID, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_ROWVER", SQL_ROWVER, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_SCOPE_CURROW", SQL_SCOPE_CURROW, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_SCOPE_TRANSACTION", SQL_SCOPE_TRANSACTION, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_SCOPE_SESSION", SQL_SCOPE_SESSION, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_NO_NULLS", SQL_NO_NULLS, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_NULLABLE", SQL_NULLABLE, CONST_PERSISTENT | CONST_CS); - - /* - * SQLStatistics values - */ - REGISTER_LONG_CONSTANT("SQL_INDEX_UNIQUE", SQL_INDEX_UNIQUE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_INDEX_ALL", SQL_INDEX_ALL, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_ENSURE", SQL_ENSURE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_QUICK", SQL_QUICK, CONST_PERSISTENT | CONST_CS); -#endif - -#if defined(HAVE_IBMDB2) && defined(_AIX) - /* atexit() handler in the DB2/AIX library segfaults in PHP CLI */ - /* DB2NOEXITLIST env variable prevents DB2 from invoking atexit() */ - putenv("DB2NOEXITLIST=TRUE"); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(odbc) -{ - ODBCG(defConn) = -1; - ODBCG(num_links) = ODBCG(num_persistent); - memset(ODBCG(laststate), '\0', 6); - memset(ODBCG(lasterrormsg), '\0', SQL_MAX_MESSAGE_LENGTH); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(odbc) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(odbc) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(odbc) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "ODBC Support", "enabled"); - sprintf(buf, "%ld", ODBCG(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - sprintf(buf, "%ld", ODBCG(num_links)); - php_info_print_table_row(2, "Active Links", buf); - php_info_print_table_row(2, "ODBC library", PHP_ODBC_TYPE); -#ifndef PHP_WIN32 - php_info_print_table_row(2, "ODBC_INCLUDE", PHP_ODBC_INCLUDE); - php_info_print_table_row(2, "ODBC_LFLAGS", PHP_ODBC_LFLAGS); - php_info_print_table_row(2, "ODBC_LIBS", PHP_ODBC_LIBS); -#endif - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - -} -/* }}} */ - -/* {{{ odbc_sql_error */ -void odbc_sql_error(ODBC_SQL_ERROR_PARAMS) -{ - char state[6]; - SDWORD error; /* Not used */ - char errormsg[SQL_MAX_MESSAGE_LENGTH]; - SWORD errormsgsize; /* Not used */ - RETCODE rc; - ODBC_SQL_ENV_T henv; - ODBC_SQL_CONN_T conn; - TSRMLS_FETCH(); - - if (conn_resource) { - henv = conn_resource->henv; - conn = conn_resource->hdbc; - } else { - henv = SQL_NULL_HENV; - conn = SQL_NULL_HDBC; - } - - /* This leads to an endless loop in many drivers! - * - while(henv != SQL_NULL_HENV){ - do { - */ - rc = SQLError(henv, conn, stmt, state, &error, errormsg, sizeof(errormsg)-1, &errormsgsize); - if (conn_resource) { - memcpy(conn_resource->laststate, state, sizeof(state)); - memcpy(conn_resource->lasterrormsg, errormsg, sizeof(errormsg)); - } - memcpy(ODBCG(laststate), state, sizeof(state)); - memcpy(ODBCG(lasterrormsg), errormsg, sizeof(errormsg)); - if (func) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); - } - /* - } while (SQL_SUCCEEDED(rc)); - } - */ -} -/* }}} */ - -/* {{{ php_odbc_fetch_attribs */ -void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - odbc_result *result; - pval **pv_res, **pv_flag; - - if (zend_get_parameters_ex(2, &pv_res, &pv_flag) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long_ex(pv_flag); - - if (Z_LVAL_PP(pv_res)) { - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - if (mode) - result->longreadlen = Z_LVAL_PP(pv_flag); - else - result->binmode = Z_LVAL_PP(pv_flag); - } else { - if (mode) - ODBCG(defaultlrl) = Z_LVAL_PP(pv_flag); - else - ODBCG(defaultbinmode) = Z_LVAL_PP(pv_flag); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ odbc_bindcols */ -int odbc_bindcols(odbc_result *result TSRMLS_DC) -{ - RETCODE rc; - int i; - SWORD colnamelen; /* Not used */ - SDWORD displaysize; - - result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); - - result->longreadlen = ODBCG(defaultlrl); - result->binmode = ODBCG(defaultbinmode); - - for(i = 0; i < result->numcols; i++) { - rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_NAME, - result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); - rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_TYPE, - NULL, 0, NULL, &result->values[i].coltype); - - /* Don't bind LONG / BINARY columns, so that fetch behaviour can - * be controlled by odbc_binmode() / odbc_longreadlen() - */ - - switch(result->values[i].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - case SQL_LONGVARCHAR: - result->values[i].value = NULL; - break; - -#ifdef HAVE_ADABAS - case SQL_TIMESTAMP: - result->values[i].value = (char *)emalloc(27); - SQLBindCol(result->stmt, (UWORD)(i+1), SQL_C_CHAR, result->values[i].value, - 27, &result->values[i].vallen); - break; -#endif /* HAVE_ADABAS */ - default: - rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE, - NULL, 0, NULL, &displaysize); - displaysize = displaysize <= result->longreadlen ? displaysize : - result->longreadlen; - result->values[i].value = (char *)emalloc(displaysize + 1); - rc = SQLBindCol(result->stmt, (UWORD)(i+1), SQL_C_CHAR, result->values[i].value, - displaysize + 1, &result->values[i].vallen); - break; - } - } - return 1; -} -/* }}} */ - -/* {{{ odbc_transact */ -void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - odbc_connection *conn; - RETCODE rc; - pval **pv_conn; - - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - rc = SQLTransact(conn->henv, conn->hdbc, (UWORD)((type)?SQL_COMMIT:SQL_ROLLBACK)); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTransact"); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ _close_pconn_with_id */ -static int _close_pconn_with_id(list_entry *le, int *id TSRMLS_DC) -{ - if(Z_TYPE_P(le) == le_pconn && (((odbc_connection *)(le->ptr))->id == *id)){ - return 1; - }else{ - return 0; - } -} -/* }}} */ - -/* {{{ odbc_column_lengths */ -void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - odbc_result *result; -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_OPENLINK) - /* this seems to be necessary for Solid2.3 ( tested by - * tammy@synchronis.com) and Solid 3.0 (tested by eric@terra.telemediair.nl) - * Solid does not seem to declare a SQLINTEGER, but it does declare a - * SQL_INTEGER which does not work (despite being the same type as a SDWORD. - * Solid 3.5 does not have this issue. - */ - SDWORD len; -#else - SQLINTEGER len; -#endif - pval **pv_res, **pv_num; - - if (zend_get_parameters_ex(2, &pv_res, &pv_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pv_num); - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) > result->numcols) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1"); - RETURN_FALSE; - } - - SQLColAttributes(result->stmt, (UWORD)Z_LVAL_PP(pv_num), - (SQLUSMALLINT) (type?SQL_COLUMN_SCALE:SQL_COLUMN_PRECISION), - NULL, 0, NULL, &len); - - RETURN_LONG(len); -} -/* }}} */ - -/* Main User Functions */ - -/* {{{ proto void odbc_close_all(void) - Close all ODBC connections */ -PHP_FUNCTION(odbc_close_all) -{ - void *ptr; - int type; - int i; - int nument; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - nument = zend_hash_next_free_element(&EG(regular_list)); - - /* Loop through list and close all statements */ - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)){ - zend_list_delete(i); - } - } - - /* Second loop through list, now close all connections */ - nument = zend_hash_next_free_element(&EG(regular_list)); - - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr){ - if(type == le_conn){ - zend_list_delete(i); - }else if(type == le_pconn){ - zend_list_delete(i); - /* Delete the persistent connection */ - zend_hash_apply_with_argument(&EG(persistent_list), - (apply_func_arg_t) _close_pconn_with_id, (void *) &i TSRMLS_CC); - } - } - } -} -/* }}} */ - -/* {{{ proto bool odbc_binmode(int result_id, int mode) - Handle binary column data */ -PHP_FUNCTION(odbc_binmode) -{ - php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool odbc_longreadlen(int result_id, int length) - Handle LONG columns */ -PHP_FUNCTION(odbc_longreadlen) -{ - php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto resource odbc_prepare(resource connection_id, string query) - Prepares a statement for execution */ -PHP_FUNCTION(odbc_prepare) -{ - pval **pv_conn, **pv_query; - char *query; - odbc_result *result = NULL; - odbc_connection *conn; - RETCODE rc; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD scrollopts; -#endif - - if (zend_get_parameters_ex(2, &pv_conn, &pv_query) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - convert_to_string_ex(pv_query); - query = Z_STRVAL_PP(pv_query); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - result->numparams = 0; - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - -#ifdef HAVE_SQL_EXTENDED_FETCH - /* Solid doesn't have ExtendedFetch, if DriverManager is used, get Info, - whether Driver supports ExtendedFetch */ - rc = SQLGetInfo(conn->hdbc, SQL_FETCH_DIRECTION, (void *) &scrollopts, sizeof(scrollopts), NULL); - if (rc == SQL_SUCCESS) { - if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { - /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other - type if not possible. - */ - if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_DYNAMIC) - == SQL_ERROR) { - odbc_sql_error(conn, result->stmt, " SQLSetStmtOption"); - SQLFreeStmt(result->stmt, SQL_DROP); - efree(result); - RETURN_FALSE; - } - } - } else { - result->fetch_abs = 0; - } -#endif - - rc = SQLPrepare(result->stmt, query, SQL_NTS); - switch (rc) { - case SQL_SUCCESS: - break; - case SQL_SUCCESS_WITH_INFO: - odbc_sql_error(conn, result->stmt, "SQLPrepare"); - break; - default: - odbc_sql_error(conn, result->stmt, "SQLPrepare"); - RETURN_FALSE; - } - - SQLNumParams(result->stmt, &(result->numparams)); - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->id = zend_list_insert(result, le_result); - zend_list_addref(conn->id); - result->conn_ptr = conn; - result->fetched = 0; - RETURN_RESOURCE(result->id); -} -/* }}} */ - -/* - * Execute prepared SQL statement. Supports only input parameters. - */ - -/* {{{ proto bool odbc_execute(resource result_id [, array parameters_array]) - Execute a prepared statement */ -PHP_FUNCTION(odbc_execute) -{ - pval **pv_res, **pv_param_arr, **tmp; - typedef struct params_t { - SDWORD vallen; - int fp; - } params_t; - params_t *params = NULL; - char *filename; - unsigned char otype; - SWORD sqltype, ctype, scale; - SWORD nullable; - UDWORD precision; - odbc_result *result; - int numArgs, i, ne; - RETCODE rc; - - numArgs = ZEND_NUM_ARGS(); - switch(numArgs) { - case 1: - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) - WRONG_PARAM_COUNT; - break; - case 2: - if (zend_get_parameters_ex(2, &pv_res, &pv_param_arr) == FAILURE) - WRONG_PARAM_COUNT; - if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed"); - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - /* XXX check for already bound parameters*/ - if (result->numparams > 0 && numArgs == 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No parameters to SQL statement given"); - RETURN_FALSE; - } - - if (result->numparams > 0) { - if ((ne = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr))) < result->numparams) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); - RETURN_FALSE; - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); - params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); - - for(i = 1; i <= result->numparams; i++) { - if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); - SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); - efree(params); - RETURN_FALSE; - } - - otype = (*tmp)->type; - convert_to_string(*tmp); - if (Z_TYPE_PP(tmp) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); - SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); - efree(params); - RETURN_FALSE; - } - - SQLDescribeParam(result->stmt, (UWORD)i, &sqltype, &precision, - &scale, &nullable); - params[i-1].vallen = Z_STRLEN_PP(tmp); - params[i-1].fp = -1; - - if (IS_SQL_BINARY(sqltype)) - ctype = SQL_C_BINARY; - else - ctype = SQL_C_CHAR; - - if (Z_STRLEN_PP(tmp) > 2 && - Z_STRVAL_PP(tmp)[0] == '\'' && - Z_STRVAL_PP(tmp)[Z_STRLEN_PP(tmp) - 1] == '\'') { - filename = estrndup(&Z_STRVAL_PP(tmp)[1], Z_STRLEN_PP(tmp) - 2); - filename[strlen(filename)] = '\0'; - - /* Check for safe mode. */ - if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - efree(filename); - efree(params); - RETURN_FALSE; - } - - /* Check the basedir */ - if (php_check_open_basedir(filename TSRMLS_CC)) { - efree(filename); - efree(params); - RETURN_FALSE; - } - - if ((params[i-1].fp = open(filename,O_RDONLY)) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't open file %s", filename); - SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); - for(i = 0; i < result->numparams; i++) { - if (params[i].fp != -1) { - close(params[i].fp); - } - } - efree(params); - efree(filename); - RETURN_FALSE; - } - - efree(filename); - - params[i-1].vallen = SQL_LEN_DATA_AT_EXEC(0); - - rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT, - ctype, sqltype, precision, scale, - (void *)params[i-1].fp, 0, - ¶ms[i-1].vallen); - } else { -#ifdef HAVE_DBMAKER - precision = params[i-1].vallen; -#endif - if (otype == IS_NULL) { - params[i-1].vallen = SQL_NULL_DATA; - } - - rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT, - ctype, sqltype, precision, scale, - Z_STRVAL_PP(tmp), 0, - ¶ms[i-1].vallen); - } - zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr)); - } - } - /* Close cursor, needed for doing multiple selects */ - rc = SQLFreeStmt(result->stmt, SQL_CLOSE); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); - } - - rc = SQLExecute(result->stmt); - - result->fetched = 0; - if (rc == SQL_NEED_DATA) { - char buf[4096]; - int fp, nbytes; - while(rc == SQL_NEED_DATA) { - rc = SQLParamData(result->stmt, (void*)&fp); - if (rc == SQL_NEED_DATA) { - while((nbytes = read(fp, &buf, 4096)) > 0) - SQLPutData(result->stmt, (void*)&buf, nbytes); - } - } - } else { - switch (rc) { - case SQL_SUCCESS: - break; - case SQL_NO_DATA_FOUND: - case SQL_SUCCESS_WITH_INFO: - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); - break; - default: - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); - RETVAL_FALSE; - } - } - - if (result->numparams > 0) { - SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); - for(i = 0; i < result->numparams; i++) { - if (params[i].fp != -1) - close(params[i].fp); - } - efree(params); - } - - if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO || rc == SQL_NO_DATA_FOUND) { - RETVAL_TRUE; - } - - if (result->numcols == 0) { - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETVAL_FALSE; - } - } else { - result->values = NULL; - } - } -} -/* }}} */ - -/* {{{ proto string odbc_cursor(resource result_id) - Get cursor name */ -PHP_FUNCTION(odbc_cursor) -{ - pval **pv_res; - SWORD len, max_len; - char *cursorname; - odbc_result *result; - RETCODE rc; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, - (void *)&max_len,sizeof(max_len),&len); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - RETURN_FALSE; - } - - if (max_len > 0) { - cursorname = emalloc(max_len + 1); - rc = SQLGetCursorName(result->stmt,cursorname,(SWORD)max_len,&len); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - char state[6]; /* Not used */ - SDWORD error; /* Not used */ - char errormsg[255]; - SWORD errormsgsize; /* Not used */ - - SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, - result->stmt, state, &error, errormsg, - sizeof(errormsg)-1, &errormsgsize); - if (!strncmp(state,"S1015",5)) { - sprintf(cursorname,"php_curs_%d", (int)result->stmt); - if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); - RETVAL_FALSE; - } else { - RETVAL_STRING(cursorname,1); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); - RETVAL_FALSE; - } - } else { - RETVAL_STRING(cursorname,1); - } - efree(cursorname); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -#ifdef HAVE_SQLDATASOURCES -/* {{{ proto array odbc_data_source(resource connection_id, int fetch_type) - Return information about the currently connected data source */ -PHP_FUNCTION(odbc_data_source) -{ - zval **zv_fetch_type, **zv_conn; - RETCODE rc = 0; /* assume all is good */ - odbc_connection *conn; - int num_args = ZEND_NUM_ARGS(); - UCHAR server_name[100], - desc[200]; - SQLSMALLINT len1=0, len2=0, fetch_type; - - if (num_args != 2) { - WRONG_PARAM_COUNT; - } - - if (zend_get_parameters_ex(2, &zv_conn, &zv_fetch_type) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to get parameters"); - RETURN_FALSE; - } - - convert_to_long_ex(zv_fetch_type); - fetch_type = (SQLSMALLINT)Z_LVAL_PP(zv_fetch_type); - - if (!(fetch_type == SQL_FETCH_FIRST || - fetch_type == SQL_FETCH_NEXT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fetch type (%d)", fetch_type); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, zv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - /* now we have the "connection" lets call the DataSource object */ - rc = SQLDataSources(conn->henv, - fetch_type, - server_name, - (SQLSMALLINT)sizeof(server_name), - &len1, - desc, - (SQLSMALLINT)sizeof(desc), - &len2); - - if (rc != SQL_SUCCESS) { - /* ummm.... he did it */ - odbc_sql_error(conn, NULL, "SQLDataSources"); - RETURN_FALSE; - } - - if (len1 == 0 || len2 == 0) { - /* we have a non-valid entry... so stop the looping */ - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_string_ex(return_value, "server", sizeof("server"), server_name, 1); - add_assoc_string_ex(return_value, "description", sizeof("description"), desc, 1); - -} -/* }}} */ -#endif /* HAVE_SQLDATASOURCES */ - -/* {{{ proto resource odbc_exec(resource connection_id, string query [, int flags]) - Prepare and execute an SQL statement */ -/* XXX Use flags */ -PHP_FUNCTION(odbc_exec) -{ - pval **pv_conn, **pv_query, **pv_flags; - int numArgs; - char *query; - odbc_result *result = NULL; - odbc_connection *conn; - RETCODE rc; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD scrollopts; -#endif - - numArgs = ZEND_NUM_ARGS(); - if (numArgs > 2) { - if (zend_get_parameters_ex(3, &pv_conn, &pv_query, &pv_flags) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_long_ex(pv_flags); - } else { - if (zend_get_parameters_ex(2, &pv_conn, &pv_query) == FAILURE) - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - convert_to_string_ex(pv_query); - query = Z_STRVAL_PP(pv_query); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - efree(result); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - -#ifdef HAVE_SQL_EXTENDED_FETCH - /* Solid doesn't have ExtendedFetch, if DriverManager is used, get Info, - whether Driver supports ExtendedFetch */ - rc = SQLGetInfo(conn->hdbc, SQL_FETCH_DIRECTION, (void *) &scrollopts, sizeof(scrollopts), NULL); - if (rc == SQL_SUCCESS) { - if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { - /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other - type if not possible. - */ - if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_DYNAMIC) - == SQL_ERROR) { - odbc_sql_error(conn, result->stmt, " SQLSetStmtOption"); - SQLFreeStmt(result->stmt, SQL_DROP); - efree(result); - RETURN_FALSE; - } - } - } else { - result->fetch_abs = 0; - } -#endif - - rc = SQLExecDirect(result->stmt, query, SQL_NTS); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DATA_FOUND) { - /* XXX FIXME we should really check out SQLSTATE with SQLError - * in case rc is SQL_SUCCESS_WITH_INFO here. - */ - odbc_sql_error(conn, result->stmt, "SQLExecDirect"); - SQLFreeStmt(result->stmt, SQL_DROP); - efree(result); - RETURN_FALSE; - } - - SQLNumResultCols(result->stmt, &(result->numcols)); - - /* For insert, update etc. cols == 0 */ - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->id = zend_list_insert(result, le_result); - zend_list_addref(conn->id); - result->conn_ptr = conn; - result->fetched = 0; - - RETURN_RESOURCE(result->id); -} -/* }}} */ - -#ifdef PHP_ODBC_HAVE_FETCH_HASH -#define ODBC_NUM 1 -#define ODBC_OBJECT 2 - -/* {{{ php_odbc_fetch_hash */ -static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) -{ - int i; - odbc_result *result; - RETCODE rc; - SWORD sql_c_type; - char *buf = NULL; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD crow; - UWORD RowStatus[1]; - SDWORD rownum = -1; - pval **pv_res, **pv_row, *tmp; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &pv_res, &pv_row) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pv_row); - rownum = Z_LVAL_PP(pv_row); - break; - default: - WRONG_PARAM_COUNT; - } - -#else - pval **pv_res, *tmp; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } -#endif - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) { - if (rownum > 0) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); - else - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - } else -#endif - rc = SQLFetch(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - RETURN_FALSE; - } - - array_init(return_value); - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (rownum > 0 && result->fetch_abs) - result->fetched = rownum; - else -#endif - result->fetched++; - - for(i = 0; i < result->numcols; i++) { - ALLOC_INIT_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = 0; - sql_c_type = SQL_C_CHAR; - - switch(result->values[i].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - if (result->binmode <= 0) { - Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC(); - break; - } - if (result->binmode == 1) sql_c_type = SQL_C_BINARY; - case SQL_LONGVARCHAR: - if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { - Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC(); - break; - } - if (buf == NULL) buf = emalloc(result->longreadlen + 1); - rc = SQLGetData(result->stmt, (UWORD)(i + 1), sql_c_type, - buf, result->longreadlen + 1, &result->values[i].vallen); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - efree(buf); - RETURN_FALSE; - } - - if (rc == SQL_SUCCESS_WITH_INFO) { - Z_STRLEN_P(tmp) = result->longreadlen; - } else if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(tmp); - break; - } else { - Z_STRLEN_P(tmp) = result->values[i].vallen; - } - Z_STRVAL_P(tmp) = estrndup(buf, Z_STRLEN_P(tmp)); - break; - - default: - if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(tmp); - break; - } - Z_STRLEN_P(tmp) = result->values[i].vallen; - Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); - break; - } - - if (result_type & ODBC_NUM) { - zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(pval *), NULL); - } else { - if (!*(result->values[i].name)) { - zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp), - Z_STRLEN_P(tmp)+1, &tmp, sizeof(pval *), NULL); - } else { - zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, - strlen(result->values[i].name)+1, &tmp, sizeof(pval *), NULL); - } - } - } - if (buf) efree(buf); -} -/* }}} */ - - -/* {{{ proto object odbc_fetch_object(int result [, int rownumber]) - Fetch a result row as an object */ -PHP_FUNCTION(odbc_fetch_object) -{ - php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, ODBC_OBJECT); - if (Z_TYPE_P(return_value) == IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array odbc_fetch_array(int result [, int rownumber]) - Fetch a result row as an associative array */ -PHP_FUNCTION(odbc_fetch_array) -{ - php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, ODBC_OBJECT); -} -/* }}} */ -#endif - -/* {{{ proto int odbc_fetch_into(resource result_id, array result_array, [, int rownumber]) - Fetch one result row into an array */ -PHP_FUNCTION(odbc_fetch_into) -{ - int numArgs, i; - odbc_result *result; - RETCODE rc; - SWORD sql_c_type; - char *buf = NULL; - pval **pv_res, **pv_res_arr, *tmp; -#ifdef HAVE_SQL_EXTENDED_FETCH - pval **pv_row; - UDWORD crow; - UWORD RowStatus[1]; - SDWORD rownum = -1; -#endif /* HAVE_SQL_EXTENDED_FETCH */ - - numArgs = ZEND_NUM_ARGS(); - - switch(numArgs) { - case 2: - if (zend_get_parameters_ex(2, &pv_res, &pv_res_arr) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; -#ifdef HAVE_SQL_EXTENDED_FETCH - case 3: - if (zend_get_parameters_ex(3, &pv_res, &pv_res_arr, &pv_row) == FAILURE) { - WRONG_PARAM_COUNT; - } - SEPARATE_ZVAL(pv_row); - convert_to_long_ex(pv_row); - rownum = Z_LVAL_PP(pv_row); - break; -#endif /* HAVE_SQL_EXTENDED_FETCH */ - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - if (Z_TYPE_PP(pv_res_arr) != IS_ARRAY) { - array_init(*pv_res_arr); - } - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) { - if (rownum > 0) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); - else - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - } else -#endif - rc = SQLFetch(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) - RETURN_FALSE; - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (rownum > 0 && result->fetch_abs) - result->fetched = rownum; - else -#endif - result->fetched++; - - for(i = 0; i < result->numcols; i++) { - ALLOC_ZVAL(tmp); - tmp->refcount = 1; - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = 0; - sql_c_type = SQL_C_CHAR; - - switch(result->values[i].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - if (result->binmode <= 0) { - Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC(); - break; - } - if (result->binmode == 1) sql_c_type = SQL_C_BINARY; - case SQL_LONGVARCHAR: - if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { - Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC(); - break; - } - - if (buf == NULL) buf = emalloc(result->longreadlen + 1); - rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type, - buf, result->longreadlen + 1, &result->values[i].vallen); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - efree(buf); - RETURN_FALSE; - } - if (rc == SQL_SUCCESS_WITH_INFO) { - Z_STRLEN_P(tmp) = result->longreadlen; - } else if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(tmp); - break; - } else { - Z_STRLEN_P(tmp) = result->values[i].vallen; - } - Z_STRVAL_P(tmp) = estrndup(buf, Z_STRLEN_P(tmp)); - break; - - default: - if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(tmp); - break; - } - Z_STRLEN_P(tmp) = result->values[i].vallen; - Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); - break; - } - zend_hash_index_update(Z_ARRVAL_PP(pv_res_arr), i, &tmp, sizeof(pval *), NULL); - } - if (buf) efree(buf); - RETURN_LONG(result->numcols); -} -/* }}} */ - -/* {{{ proto bool solid_fetch_prev(resource result_id) - */ -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) -PHP_FUNCTION(solid_fetch_prev) -{ - odbc_result *result; - RETCODE rc; - pval **pv_res; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - rc = SQLFetchPrev(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - RETURN_FALSE; - } - - if (result->fetched > 1) result->fetched--; - - RETURN_TRUE; -} -#endif -/* }}} */ - -/* {{{ proto bool odbc_fetch_row(resource result_id [, int row_number]) - Fetch a row */ -PHP_FUNCTION(odbc_fetch_row) -{ - int numArgs; - SDWORD rownum = 1; - odbc_result *result; - RETCODE rc; - pval **pv_res, **pv_row; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD crow; - UWORD RowStatus[1]; -#endif - - numArgs = ZEND_NUM_ARGS(); - switch (numArgs) { - case 1: - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) - WRONG_PARAM_COUNT; - break; - case 2: - if (zend_get_parameters_ex(2, &pv_res, &pv_row) == FAILURE) - WRONG_PARAM_COUNT; - convert_to_long_ex(pv_row); - rownum = Z_LVAL_PP(pv_row); - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) { - if (numArgs > 1) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); - else - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - } else -#endif - rc = SQLFetch(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - RETURN_FALSE; - } - - if (numArgs > 1) { - result->fetched = rownum; - } else { - result->fetched++; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed odbc_result(resource result_id, mixed field) - Get result data */ -PHP_FUNCTION(odbc_result) -{ - char *field; - int field_ind; - SWORD sql_c_type = SQL_C_CHAR; - odbc_result *result; - int i = 0; - RETCODE rc; - SDWORD fieldsize; - pval **pv_res, **pv_field; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD crow; - UWORD RowStatus[1]; -#endif - - field_ind = -1; - field = NULL; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2 , &pv_res, &pv_field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(pv_field) == IS_STRING) { - field = Z_STRVAL_PP(pv_field); - } else { - convert_to_long_ex(pv_field); - field_ind = Z_LVAL_PP(pv_field) - 1; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if ((result->numcols == 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - /* get field index if the field parameter was a string */ - if (field != NULL) { - if (result->values == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set contains no data"); - RETURN_FALSE; - } - - for(i = 0; i < result->numcols; i++) { - if (!strcasecmp(result->values[i].name, field)) { - field_ind = i; - break; - } - } - - if (field_ind < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found", field); - RETURN_FALSE; - } - } else { - /* check for limits of field_ind if the field parameter was an int */ - if (field_ind >= result->numcols || field_ind < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index is larger than the number of fields"); - RETURN_FALSE; - } - } - - if (result->fetched == 0) { - /* User forgot to call odbc_fetch_row(), or wants to reload the results, do it now */ -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); - else -#endif - rc = SQLFetch(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) - RETURN_FALSE; - - result->fetched++; - } - - switch(result->values[field_ind].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; - if (result->binmode <= 0) break; - case SQL_LONGVARCHAR: - if (IS_SQL_LONG(result->values[field_ind].coltype)) { - if (result->longreadlen <= 0) - break; - else - fieldsize = result->longreadlen; - } else { - SQLColAttributes(result->stmt, (UWORD)(field_ind + 1), - (UWORD)((sql_c_type == SQL_C_BINARY) ? SQL_COLUMN_LENGTH : - SQL_COLUMN_DISPLAY_SIZE), - NULL, 0, NULL, &fieldsize); - } - /* For char data, the length of the returned string will be longreadlen - 1 */ - fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; - field = emalloc(fieldsize); - - /* SQLGetData will truncate CHAR data to fieldsize - 1 bytes and append \0. - * For binary data it is truncated to fieldsize bytes. - */ - rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1), sql_c_type, - field, fieldsize, &result->values[field_ind].vallen); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - efree(field); - RETURN_FALSE; - } - - if (result->values[field_ind].vallen == SQL_NULL_DATA) { - efree(field); - RETURN_NULL(); - } else if (rc == SQL_NO_DATA_FOUND) { - efree(field); - RETURN_FALSE; - } - /* Reduce fieldlen by 1 if we have char data. One day we might - have binary strings... */ - if (result->values[field_ind].coltype == SQL_LONGVARCHAR) fieldsize -= 1; - /* Don't duplicate result, saves one emalloc. - For SQL_SUCCESS, the length is in vallen. - */ - RETURN_STRINGL(field, (rc == SQL_SUCCESS_WITH_INFO) ? fieldsize : - result->values[field_ind].vallen, 0); - break; - - default: - if (result->values[field_ind].vallen == SQL_NULL_DATA) { - RETURN_NULL(); - } else { - RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen, 1); - } - break; - } - -/* If we come here, output unbound LONG and/or BINARY column data to the client */ - - /* We emalloc 1 byte more for SQL_C_CHAR (trailing \0) */ - fieldsize = (sql_c_type == SQL_C_CHAR) ? 4096 : 4095; - field = emalloc(fieldsize); - - /* Call SQLGetData() until SQL_SUCCESS is returned */ - while(1) { - rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1),sql_c_type, - field, fieldsize, &result->values[field_ind].vallen); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - efree(field); - RETURN_FALSE; - } - - if (result->values[field_ind].vallen == SQL_NULL_DATA) { - efree(field); - RETURN_NULL(); - } - /* chop the trailing \0 by outputing only 4095 bytes */ - PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : - result->values[field_ind].vallen); - - if (rc == SQL_SUCCESS) { /* no more data avail */ - efree(field); - RETURN_TRUE; - } - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int odbc_result_all(resource result_id [, string format]) - Print result as HTML table */ -PHP_FUNCTION(odbc_result_all) -{ - char *buf = NULL; - int i, numArgs; - odbc_result *result; - RETCODE rc; - pval **pv_res, **pv_format; - SWORD sql_c_type; -#ifdef HAVE_SQL_EXTENDED_FETCH - UDWORD crow; - UWORD RowStatus[1]; -#endif - - numArgs = ZEND_NUM_ARGS(); - if (numArgs == 1) { - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) - WRONG_PARAM_COUNT; - } else { - if (zend_get_parameters_ex(2, &pv_res, &pv_format) == FAILURE) - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - else -#endif - rc = SQLFetch(result->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - php_printf("<h2>No rows found</h2>\n"); - RETURN_LONG(0); - } - - /* Start table tag */ - if (numArgs == 1) { - php_printf("<table><tr>"); - } else { - convert_to_string_ex(pv_format); - php_printf("<table %s ><tr>",Z_STRVAL_PP(pv_format)); - } - - for(i = 0; i < result->numcols; i++) - php_printf("<th>%s</th>", result->values[i].name); - - php_printf("</tr>\n"); - - while(rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - result->fetched++; - php_printf("<tr>"); - for(i = 0; i < result->numcols; i++) { - sql_c_type = SQL_C_CHAR; - switch(result->values[i].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - if (result->binmode <= 0) { - php_printf("<td>Not printable</td>"); - break; - } - if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; - case SQL_LONGVARCHAR: - if (IS_SQL_LONG(result->values[i].coltype) && - result->longreadlen <= 0) { - php_printf("<td>Not printable</td>"); - break; - } - - if (buf == NULL) buf = emalloc(result->longreadlen); - - rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type, - buf, result->longreadlen, &result->values[i].vallen); - - php_printf("<td>"); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - php_printf("</td></tr></table>"); - efree(buf); - RETURN_FALSE; - } - if (rc == SQL_SUCCESS_WITH_INFO) - php_printf(buf,result->longreadlen); - else if (result->values[i].vallen == SQL_NULL_DATA) { - php_printf("<td>NULL</td>"); - break; - } else { - php_printf(buf, result->values[i].vallen); - } - php_printf("</td>"); - break; - default: - if (result->values[i].vallen == SQL_NULL_DATA) { - php_printf("<td>NULL</td>"); - } else { - php_printf("<td>%s</td>", result->values[i].value); - } - break; - } - } - php_printf("</tr>\n"); - -#ifdef HAVE_SQL_EXTENDED_FETCH - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - else -#endif - rc = SQLFetch(result->stmt); - } - php_printf("</table>\n"); - if (buf) efree(buf); - RETURN_LONG(result->fetched); -} -/* }}} */ - -/* {{{ proto bool odbc_free_result(resource result_id) - Free resources associated with a result */ -PHP_FUNCTION(odbc_free_result) -{ - pval **pv_res; - odbc_result *result; - int i; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - if (result->values) { - for (i = 0; i < result->numcols; i++) { - if (result->values[i].value) { - efree(result->values[i].value); - } - } - efree(result->values); - result->values = NULL; - } - - zend_list_delete(result->id); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto resource odbc_connect(string DSN, string user, string password [, int cursor_option]) - Connect to a datasource */ -PHP_FUNCTION(odbc_connect) -{ - odbc_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource odbc_pconnect(string DSN, string user, string password [, int cursor_option]) - Establish a persistent connection to a datasource */ -PHP_FUNCTION(odbc_pconnect) -{ - odbc_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ odbc_sqlconnect */ -int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int cur_opt, int persistent TSRMLS_DC) -{ - RETCODE rc; - - *conn = (odbc_connection *)pemalloc(sizeof(odbc_connection), persistent); - (*conn)->persistent = persistent; - SQLAllocEnv(&((*conn)->henv)); - SQLAllocConnect((*conn)->henv, &((*conn)->hdbc)); - -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) - SQLSetConnectOption((*conn)->hdbc, SQL_TRANSLATE_OPTION, - SQL_SOLID_XLATOPT_NOCNV); -#endif -#ifdef HAVE_ODBC_ROUTER - { -#define CONNSTRSIZE 2048 - char *lpszConnStr = emalloc(CONNSTRSIZE); - if (lpszConnStr && db) { - short cbszConnStr; - if (strstr(db, ";")) { - /* the caller has apparently passed a connection-string */ - if (strstr(db, "uid") || strstr(db, "UID")) { - uid = NULL; - } - if (strstr(db, "pwd") || strstr(db, "PWD")) { - pwd = NULL; - } - strncpy( lpszConnStr, db, CONNSTRSIZE); - } - else { - strcpy(lpszConnStr, "DSN="); - strcat(lpszConnStr, db); - } - if (uid) { - if (uid[0]) { - strcat(lpszConnStr, ";UID="); - strcat(lpszConnStr, uid); - strcat(lpszConnStr, ";"); - } - if (pwd) { - if (pwd[0]) { - strcat(lpszConnStr, "PWD="); - strcat(lpszConnStr, pwd); - strcat(lpszConnStr, ";"); - } - } - } - rc = SQLDriverConnect((*conn)->hdbc, NULL, lpszConnStr, SQL_NTS, - lpszConnStr, CONNSTRSIZE, &cbszConnStr, - SQL_DRIVER_NOPROMPT); - efree(lpszConnStr); - } - } -#else -#ifdef HAVE_OPENLINK - { - char dsnbuf[1024]; - short dsnbuflen; - - rc = SQLDriverConnect((*conn)->hdbc, NULL, db, SQL_NTS, - dsnbuf, sizeof(dsnbuf) - 1, &dsnbuflen, - SQL_DRIVER_NOPROMPT); - } -#else - if (cur_opt != SQL_CUR_DEFAULT) { - rc = SQLSetConnectOption((*conn)->hdbc, SQL_ODBC_CURSORS, cur_opt); - if (rc != SQL_SUCCESS) { /* && rc != SQL_SUCCESS_WITH_INFO ? */ - odbc_sql_error(*conn, SQL_NULL_HSTMT, "SQLSetConnectOption"); - SQLFreeConnect((*conn)->hdbc); - pefree(*conn, persistent); - return FALSE; - } - } -/* Possible fix for bug #10250 - * Needs testing on UnixODBC < 2.0.5 though. */ -#if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC) || defined(PHP_WIN32) -/* * Uncomment the line above, and comment line below to fully test - * #ifdef HAVE_EMPRESS */ - { - int direct = 0; - char dsnbuf[1024]; - short dsnbuflen; - char *ldb = 0; - int ldb_len = 0; - - if (strstr((char*)db, ";")) { - direct = 1; - if (uid && !strstr ((char*)db, "uid") && !strstr((char*)db, "UID")) { - ldb = (char*) emalloc(strlen(db) + strlen(uid) + strlen(pwd) + 12); - sprintf(ldb, "%s;UID=%s;PWD=%s", db, uid, pwd); - } else { - ldb_len = strlen(db)+1; - ldb = (char*) emalloc(ldb_len); - memcpy(ldb, db, ldb_len); - } - } - - if (direct) { - rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, - sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT); - } else { - rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); - } - - if (ldb) { - efree(ldb); - } - } -#else - rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); -#endif -#endif -#endif - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(*conn, SQL_NULL_HSTMT, "SQLConnect"); - SQLFreeConnect((*conn)->hdbc); - pefree((*conn), persistent); - return FALSE; - } -/* (*conn)->open = 1;*/ - return TRUE; -} -/* }}} */ - -/* Persistent connections: two list-types le_pconn, le_conn and a plist - * where hashed connection info is stored together with index pointer to - * the actual link of type le_pconn in the list. Only persistent - * connections get hashed up. Normal connections use existing pconnections. - * Maybe this has to change with regard to transactions on pconnections? - * Possibly set autocommit to on on request shutdown. - * - * We do have to hash non-persistent connections, and reuse connections. - * In the case where two connects were being made, without closing the first - * connect, access violations were occuring. This is because some of the - * "globals" in this module should actualy be per-connection variables. I - * simply fixed things to get them working for now. Shane - */ -/* {{{ odbc_do_connect */ -void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *db = NULL; - char *uid = NULL; - char *pwd = NULL; - pval **pv_db, **pv_uid, **pv_pwd, **pv_opt; - odbc_connection *db_conn; - char *hashed_details; - int hashed_len, cur_opt; - - /* Now an optional 4th parameter specifying the cursor type - * defaulting to the cursors default - */ - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &pv_db, &pv_uid, &pv_pwd) == FAILURE) { - WRONG_PARAM_COUNT; - } - /* Use Default: Probably a better way to do this */ - cur_opt = SQL_CUR_DEFAULT; - break; - case 4: - if (zend_get_parameters_ex(4, &pv_db, &pv_uid, &pv_pwd, &pv_opt) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pv_opt); - cur_opt = Z_LVAL_PP(pv_opt); - - /* Confirm the cur_opt range */ - if (! (cur_opt == SQL_CUR_USE_IF_NEEDED || - cur_opt == SQL_CUR_USE_ODBC || - cur_opt == SQL_CUR_USE_DRIVER || - cur_opt == SQL_CUR_DEFAULT) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Cursor type (%d)", cur_opt); - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(pv_db); - convert_to_string_ex(pv_uid); - convert_to_string_ex(pv_pwd); - - db = Z_STRVAL_PP(pv_db); - uid = Z_STRVAL_PP(pv_uid); - pwd = Z_STRVAL_PP(pv_pwd); - - if (ODBCG(allow_persistent) <= 0) { - persistent = 0; - } - - hashed_len = spprintf(&hashed_details, 0, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); - - /* FIXME the idea of checking to see if our connection is already persistent - is good, but it adds a lot of overhead to non-persistent connections. We - should look and see if we can fix that somehow */ - /* try to find if we already have this link in our persistent list, - * no matter if it is to be persistent or not - */ - -try_and_get_another_connection: - - if (persistent) { - list_entry *le; - - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_len + 1, (void **) &le) - == FAILURE) { /* the link is not in the persistent list */ - list_entry new_le; - - if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", ODBCG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - if (ODBCG(max_persistent) != -1 && ODBCG(num_persistent) >= ODBCG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open persistent links (%ld)", ODBCG(num_persistent)); - efree(hashed_details); - RETURN_FALSE; - } - - if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 1 TSRMLS_CC)) { - efree(hashed_details); - RETURN_FALSE; - } - - Z_TYPE(new_le) = le_pconn; - new_le.ptr = db_conn; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_len + 1, &new_le, - sizeof(list_entry), NULL) == FAILURE) { - free(db_conn); - efree(hashed_details); - RETURN_FALSE; - } - ODBCG(num_persistent)++; - ODBCG(num_links)++; - db_conn->id = ZEND_REGISTER_RESOURCE(return_value, db_conn, le_pconn); - } else { /* found connection */ - if (Z_TYPE_P(le) != le_pconn) { - RETURN_FALSE; - } - /* - * check to see if the connection is still valid - */ - db_conn = (odbc_connection *)le->ptr; - - /* - * check to see if the connection is still in place (lurcher) - */ - if(ODBCG(check_persistent)){ - RETCODE ret; - UCHAR d_name[32]; - SWORD len; - - ret = SQLGetInfo(db_conn->hdbc, - SQL_DATA_SOURCE_READ_ONLY, - d_name, sizeof(d_name), &len); - - if(ret != SQL_SUCCESS || len == 0) { - zend_hash_del(&EG(persistent_list), hashed_details, hashed_len + 1); - /* Commented out to fix a possible double closure error - * when working with persistent connections as submitted by - * bug #15758 - * - * safe_odbc_disconnect(db_conn->hdbc); - * SQLFreeConnect(db_conn->hdbc); - */ - goto try_and_get_another_connection; - } - } - } - db_conn->id = ZEND_REGISTER_RESOURCE(return_value, db_conn, le_pconn); - } else { /* non persistent */ - list_entry *index_ptr, new_index_ptr; - - if (zend_hash_find(&EG(regular_list), hashed_details, hashed_len + 1, - (void **) &index_ptr) == SUCCESS) { - int type, conn_id; - void *ptr; - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - RETURN_FALSE; - } - conn_id = (int)index_ptr->ptr; - ptr = zend_list_find(conn_id, &type); /* check if the connection is still there */ - if (ptr && (type == le_conn || type == le_pconn)) { - zend_list_addref(conn_id); - Z_LVAL_P(return_value) = conn_id; - Z_TYPE_P(return_value) = IS_RESOURCE; - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_len + 1); - } - } - if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - - if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0 TSRMLS_CC)) { - efree(hashed_details); - RETURN_FALSE; - } - db_conn->id = ZEND_REGISTER_RESOURCE(return_value, db_conn, le_conn); - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_len + 1, (void *) &new_index_ptr, - sizeof(list_entry), NULL) == FAILURE) { - efree(hashed_details); - RETURN_FALSE; - /* XXX Free Connection */ - } - ODBCG(num_links)++; - } - efree(hashed_details); -} -/* }}} */ - -/* {{{ proto void odbc_close(resource connection_id) - Close an ODBC connection */ -PHP_FUNCTION(odbc_close) -{ - pval **pv_conn; - void *ptr; - odbc_connection *conn; - odbc_result *res; - int nument; - int i; - int type; - int is_pconn = 0; - int found_resource_type = le_conn; - - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - - conn = (odbc_connection *) zend_fetch_resource(pv_conn TSRMLS_CC, -1, "ODBC-Link", &found_resource_type, 2, le_conn, le_pconn); - if (found_resource_type==le_pconn) { - is_pconn = 1; - } - - nument = zend_hash_next_free_element(&EG(regular_list)); - - for(i = 1; i < nument; i++){ - ptr = zend_list_find(i, &type); - if(ptr && (type == le_result)){ - res = (odbc_result *)ptr; - if(res->conn_ptr == conn){ - zend_list_delete(i); - } - } - } - - zend_list_delete(Z_LVAL_PP(pv_conn)); - - if(is_pconn){ - zend_hash_apply_with_argument(&EG(persistent_list), - (apply_func_arg_t) _close_pconn_with_id, (void *) &(Z_LVAL_PP(pv_conn)) TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto int odbc_num_rows(resource result_id) - Get number of rows in a result */ -PHP_FUNCTION(odbc_num_rows) -{ - odbc_result *result; - SDWORD rows; - pval **pv_res; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - SQLRowCount(result->stmt, &rows); - RETURN_LONG(rows); -} -/* }}} */ - -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) -/* {{{ proto bool odbc_next_result(resource result_id) - Checks if multiple results are avaiable */ -PHP_FUNCTION(odbc_next_result) -{ - odbc_result *result; - pval **pv_res; - int rc, i; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->values) { - for(i = 0; i < result->numcols; i++) { - if (result->values[i].value) - efree(result->values[i].value); - } - efree(result->values); - result->values = NULL; - } - - result->fetched = 0; - rc = SQLMoreResults(result->stmt); - if (rc == SQL_SUCCESS_WITH_INFO || rc == SQL_SUCCESS) { - rc = SQLFreeStmt(result->stmt, SQL_UNBIND); - SQLNumParams(result->stmt, &(result->numparams)); - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETVAL_FALSE; - } - } else { - result->values = NULL; - } - RETURN_TRUE; - } else if (rc == SQL_NO_DATA_FOUND) { - RETURN_FALSE; - } else { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); - RETURN_FALSE; - } -} -/* }}} */ -#endif - -/* {{{ proto int odbc_num_fields(resource result_id) - Get number of columns in a result */ -PHP_FUNCTION(odbc_num_fields) -{ - odbc_result *result; - pval **pv_res; - - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - RETURN_LONG(result->numcols); -} -/* }}} */ - -/* {{{ proto string odbc_field_name(resource result_id, int field_number) - Get a column name */ -PHP_FUNCTION(odbc_field_name) -{ - odbc_result *result; - pval **pv_res, **pv_num; - - if (zend_get_parameters_ex(2, &pv_res, &pv_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pv_num); - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) > result->numcols) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1"); - RETURN_FALSE; - } - - RETURN_STRING(result->values[Z_LVAL_PP(pv_num) - 1].name, 1) -} -/* }}} */ - -/* {{{ proto string odbc_field_type(resource result_id, int field_number) - Get the datatype of a column */ -PHP_FUNCTION(odbc_field_type) -{ - odbc_result *result; - char tmp[32]; - SWORD tmplen; - pval **pv_res, **pv_num; - - if (zend_get_parameters_ex(2, &pv_res, &pv_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pv_num); - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) > result->numcols) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields"); - RETURN_FALSE; - } - - if (Z_LVAL_PP(pv_num) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1"); - RETURN_FALSE; - } - - SQLColAttributes(result->stmt, (UWORD)Z_LVAL_PP(pv_num), - SQL_COLUMN_TYPE_NAME, tmp, 31, &tmplen, NULL); - RETURN_STRING(tmp,1) -} -/* }}} */ - -/* {{{ proto int odbc_field_len(resource result_id, int field_number) - Get the length (precision) of a column */ -PHP_FUNCTION(odbc_field_len) -{ - odbc_column_lengths(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int odbc_field_scale(resource result_id, int field_number) - Get the scale of a column */ -PHP_FUNCTION(odbc_field_scale) -{ - odbc_column_lengths(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int odbc_field_num(resource result_id, string field_name) - Return column number */ -PHP_FUNCTION(odbc_field_num) -{ - int field_ind; - char *fname; - odbc_result *result; - int i; - pval **pv_res, **pv_name; - - if (zend_get_parameters_ex(2, &pv_res, &pv_name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); - - if (result->numcols == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - convert_to_string_ex(pv_name); - fname = Z_STRVAL_PP(pv_name); - - field_ind = -1; - for(i = 0; i < result->numcols; i++) { - if (strcasecmp(result->values[i].name, fname) == 0) - field_ind = i + 1; - } - - if (field_ind == -1) - RETURN_FALSE; - RETURN_LONG(field_ind); -} -/* }}} */ - -/* {{{ proto mixed odbc_autocommit(resource connection_id [, int OnOff]) - Toggle autocommit mode or get status */ -/* There can be problems with pconnections!*/ -PHP_FUNCTION(odbc_autocommit) -{ - odbc_connection *conn; - RETCODE rc; - pval **pv_conn, **pv_onoff = NULL; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 2) { - if (zend_get_parameters_ex(2, &pv_conn, &pv_onoff) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (argc == 1) { - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - if (pv_onoff && (*pv_onoff)) { - convert_to_long_ex(pv_onoff); - rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, - (Z_LVAL_PP(pv_onoff)) ? - SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "Set autocommit"); - RETURN_FALSE; - } - RETVAL_TRUE; - } else { - SDWORD status; - - rc = SQLGetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, (PTR)&status); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "Get commit status"); - RETURN_FALSE; - } - RETVAL_LONG((long)status); - } -} -/* }}} */ - -/* {{{ proto bool odbc_commit(resource connection_id) - Commit an ODBC transaction */ -PHP_FUNCTION(odbc_commit) -{ - odbc_transact(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool odbc_rollback(resource connection_id) - Rollback a transaction */ -PHP_FUNCTION(odbc_rollback) -{ - odbc_transact(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ php_odbc_lasterror */ -static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - odbc_connection *conn; - pval **pv_handle; - char *ptr; - int argc, len; - - argc = ZEND_NUM_ARGS(); - - if (argc > 1 || zend_get_parameters_ex(argc, &pv_handle)) { - WRONG_PARAM_COUNT; - } - - if (mode == 0) { /* last state */ - len = 6; - } else { /* last error message */ - len = SQL_MAX_MESSAGE_LENGTH; - } - - if (argc == 1) { - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn); - ptr = ecalloc(len + 1, 1); - if (mode == 0) { - strlcpy(ptr, conn->laststate, len+1); - } else { - strlcpy(ptr, conn->lasterrormsg, len+1); - } - } else { - ptr = ecalloc(len + 1, 1); - if (mode == 0) { - strlcpy(ptr, ODBCG(laststate), len+1); - } else { - strlcpy(ptr, ODBCG(lasterrormsg), len+1); - } - } - RETVAL_STRING(ptr, 0); -} -/* }}} */ - -/* {{{ proto string odbc_error([resource connection_id]) - Get the last error code */ -PHP_FUNCTION(odbc_error) -{ - php_odbc_lasterror(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string odbc_errormsg([resource connection_id]) - Get the last error message */ -PHP_FUNCTION(odbc_errormsg) -{ - php_odbc_lasterror(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool odbc_setoption(resource conn_id|result_id, int which, int option, int value) - Sets connection or statement options */ -/* This one has to be used carefully. We can't allow to set connection options for - persistent connections. I think that SetStmtOption is of little use, since most - of those can only be specified before preparing/executing statements. - On the other hand, they can be made connection wide default through SetConnectOption - - but will be overidden by calls to SetStmtOption() in odbc_prepare/odbc_do -*/ -PHP_FUNCTION(odbc_setoption) -{ - odbc_connection *conn; - odbc_result *result; - RETCODE rc; - pval **pv_handle, **pv_which, **pv_opt, **pv_val; - - if (zend_get_parameters_ex(4, &pv_handle, &pv_which, &pv_opt, &pv_val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pv_which); - convert_to_long_ex(pv_opt); - convert_to_long_ex(pv_val); - - switch (Z_LVAL_PP(pv_which)) { - case 1: /* SQLSetConnectOption */ - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn); - if (conn->persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set option for persistent connection"); - RETURN_FALSE; - } - rc = SQLSetConnectOption(conn->hdbc, (unsigned short)(Z_LVAL_PP(pv_opt)), Z_LVAL_PP(pv_val)); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SetConnectOption"); - RETURN_FALSE; - } - break; - case 2: /* SQLSetStmtOption */ - ZEND_FETCH_RESOURCE(result, odbc_result *, pv_handle, -1, "ODBC result", le_result); - - rc = SQLSetStmtOption(result->stmt, (unsigned short)(Z_LVAL_PP(pv_opt)), (Z_LVAL_PP(pv_val))); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); - RETURN_FALSE; - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option type"); - RETURN_FALSE; - break; - } - - RETURN_TRUE; -} -/* }}} */ - -/* - * metadata functions - */ - -/* {{{ proto resource odbc_tables(resource connection_id [, string qualifier [, string owner [, string name [, string table_types]]]]) - Call the SQLTables function */ -PHP_FUNCTION(odbc_tables) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_table, **pv_type; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *table = NULL, *type = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 5 || zend_get_parameters_ex(argc, &pv_conn, &pv_cat, &pv_schema, &pv_table, &pv_type) == FAILURE) { - WRONG_PARAM_COUNT; - } - switch (argc) { - case 5: - convert_to_string_ex(pv_type); - type = Z_STRVAL_PP(pv_type); - case 4: - convert_to_string_ex(pv_table); - table = Z_STRVAL_PP(pv_table); - case 3: - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - case 2: - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - /* This hack is needed to access table information in Access databases (fmk) */ - if (table && strlen(table) && schema && !strlen(schema)) schema = NULL; - - rc = SQLTables(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table), - type, SAFE_SQL_NTS(type)); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTables"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -/* {{{ proto resource odbc_columns(resource connection_id [, string qualifier [, string owner [, string table_name [, string column_name]]]]) - Returns a result identifier that can be used to fetch a list of column names in specified tables */ -PHP_FUNCTION(odbc_columns) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_table, **pv_column; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *table = NULL, *column = NULL; - SWORD cat_len=0, schema_len=0, table_len=0, column_len=0; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 5 || zend_get_parameters_ex(argc, &pv_conn, &pv_cat, &pv_schema, &pv_table, &pv_column) == FAILURE) { - WRONG_PARAM_COUNT; - } - switch (argc) { - case 5: - convert_to_string_ex(pv_column); - column = Z_STRVAL_PP(pv_column); - column_len = Z_STRLEN_PP(pv_column); - case 4: - convert_to_string_ex(pv_table); - table = Z_STRVAL_PP(pv_table); - table_len = Z_STRLEN_PP(pv_table); - case 3: - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - schema_len = Z_STRLEN_PP(pv_schema); - case 2: - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - cat_len = Z_STRLEN_PP(pv_cat); - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - /* - * Needed to make MS Access happy - */ - if (table && strlen(table) && schema && !strlen(schema)) schema = NULL; - - rc = SQLColumns(result->stmt, - cat, cat_len, - schema, schema_len, - table, table_len, - column, column_len); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumns"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP) -/* {{{ proto resource odbc_columnprivileges(resource connection_id, string catalog, string schema, string table, string column) - Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table */ -PHP_FUNCTION(odbc_columnprivileges) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_table, **pv_column; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *table = NULL, *column = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 5) { - if (zend_get_parameters_ex(5, &pv_conn, &pv_cat, &pv_schema, &pv_table, &pv_column) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_table); - table = Z_STRVAL_PP(pv_table); - convert_to_string_ex(pv_column); - column = Z_STRVAL_PP(pv_column); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLColumnPrivileges(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table), - column, SAFE_SQL_NTS(column)); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumnPrivileges"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ -#endif /* HAVE_DBMAKER || HAVE_SOLID*/ - -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) -/* {{{ proto resource odbc_foreignkeys(resource connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table) - Returns a result identifier to either a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table */ -PHP_FUNCTION(odbc_foreignkeys) -{ - pval **pv_conn, **pv_pcat, **pv_pschema, **pv_ptable; - pval **pv_fcat, **pv_fschema, **pv_ftable; - odbc_result *result = NULL; - odbc_connection *conn; - char *pcat = NULL, *pschema = NULL, *ptable = NULL; - char *fcat = NULL, *fschema = NULL, *ftable = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 7) { - if (zend_get_parameters_ex(7, &pv_conn, &pv_pcat, &pv_pschema, &pv_ptable, - &pv_fcat, &pv_fschema, &pv_ftable) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_pcat); - pcat = Z_STRVAL_PP(pv_pcat); - convert_to_string_ex(pv_pschema); - pschema = Z_STRVAL_PP(pv_pschema); - convert_to_string_ex(pv_ptable); - ptable = Z_STRVAL_PP(pv_ptable); - convert_to_string_ex(pv_fcat); - fcat = Z_STRVAL_PP(pv_fcat); - convert_to_string_ex(pv_fschema); - fschema = Z_STRVAL_PP(pv_fschema); - convert_to_string_ex(pv_ftable); - ftable = Z_STRVAL_PP(pv_ftable); -#if defined(HAVE_DBMAKER) || defined(HAVE_IBMDB2) -#define EMPTY_TO_NULL(xstr) \ - if ((int)strlen((xstr)) == 0) (xstr) = NULL - - EMPTY_TO_NULL(pcat); - EMPTY_TO_NULL(pschema); - EMPTY_TO_NULL(ptable); - EMPTY_TO_NULL(fcat); - EMPTY_TO_NULL(fschema); - EMPTY_TO_NULL(ftable); -#endif - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLForeignKeys(result->stmt, - pcat, SAFE_SQL_NTS(pcat), - pschema, SAFE_SQL_NTS(pschema), - ptable, SAFE_SQL_NTS(ptable), - fcat, SAFE_SQL_NTS(fcat), - fschema, SAFE_SQL_NTS(fschema), - ftable, SAFE_SQL_NTS(ftable) ); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLForeignKeys"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ -#endif /* HAVE_SOLID */ - -/* {{{ proto resource odbc_gettypeinfo(resource connection_id [, int data_type]) - Returns a result identifier containing information about data types supported by the data source */ -PHP_FUNCTION(odbc_gettypeinfo) -{ - pval **pv_conn, **pv_data_type; - odbc_result *result = NULL; - odbc_connection *conn; - RETCODE rc; - int argc; - SWORD data_type = SQL_ALL_TYPES; - - argc = ZEND_NUM_ARGS(); - if (argc == 1) { - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (argc == 2) { - if (zend_get_parameters_ex(2, &pv_conn, &pv_data_type) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pv_data_type); - data_type = (SWORD) Z_LVAL_PP(pv_data_type); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLGetTypeInfo(result->stmt, data_type ); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLGetTypeInfo"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -/* {{{ proto resource odbc_primarykeys(resource connection_id, string qualifier, string owner, string table) - Returns a result identifier listing the column names that comprise the primary key for a table */ -PHP_FUNCTION(odbc_primarykeys) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_table; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *table = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 4) { - if (zend_get_parameters_ex(4, &pv_conn, &pv_cat, &pv_schema, &pv_table) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_table); - table = Z_STRVAL_PP(pv_table); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLPrimaryKeys(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table) ); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLPrimaryKeys"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP) -/* {{{ proto resource odbc_procedurecolumns(resource connection_id [, string qualifier, string owner, string proc, string column]) - Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures */ -PHP_FUNCTION(odbc_procedurecolumns) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_proc, **pv_col; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *proc = NULL, *col = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 1) { - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (argc == 5) { - if (zend_get_parameters_ex(5, &pv_conn, &pv_cat, &pv_schema, &pv_proc, &pv_col) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_proc); - proc = Z_STRVAL_PP(pv_proc); - convert_to_string_ex(pv_col); - col = Z_STRVAL_PP(pv_col); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLProcedureColumns(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - proc, SAFE_SQL_NTS(proc), - col, SAFE_SQL_NTS(col) ); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedureColumns"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ -#endif /* HAVE_SOLID */ - -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) -/* {{{ proto resource odbc_procedures(resource connection_id [, string qualifier, string owner, string name]) - Returns a result identifier containg the list of procedure names in a datasource */ -PHP_FUNCTION(odbc_procedures) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_proc; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *proc = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 1) { - if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - } else if (argc == 4) { - if (zend_get_parameters_ex(4, &pv_conn, &pv_cat, &pv_schema, &pv_proc) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_proc); - proc = Z_STRVAL_PP(pv_proc); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLProcedures(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - proc, SAFE_SQL_NTS(proc) ); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedures"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ -#endif /* HAVE_SOLID */ - -/* {{{ proto resource odbc_specialcolumns(resource connection_id, int type, string qualifier, string owner, string table, int scope, int nullable) - Returns a result identifier containing either the optimal set of columns that uniquely identifies a row in the table or columns that are automatically updated when any value in the row is updated by a transaction */ -PHP_FUNCTION(odbc_specialcolumns) -{ - pval **pv_conn, **pv_type, **pv_cat, **pv_schema, **pv_name; - pval **pv_scope, **pv_nullable; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *name = NULL; - UWORD type; - UWORD scope, nullable; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 7) { - if (zend_get_parameters_ex(7, &pv_conn, &pv_type, &pv_cat, &pv_schema, - &pv_name, &pv_scope, &pv_nullable) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(pv_type); - type = (UWORD) Z_LVAL_PP(pv_type); - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_name); - name = Z_STRVAL_PP(pv_name); - convert_to_long_ex(pv_scope); - scope = (UWORD) Z_LVAL_PP(pv_scope); - convert_to_long_ex(pv_nullable); - nullable = (UWORD) Z_LVAL_PP(pv_nullable); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLSpecialColumns(result->stmt, - type, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - name, SAFE_SQL_NTS(name), - scope, - nullable); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLSpecialColumns"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -/* {{{ proto resource odbc_statistics(resource connection_id, string qualifier, string owner, string name, int unique, int accuracy) - Returns a result identifier that contains statistics about a single table and the indexes associated with the table */ -PHP_FUNCTION(odbc_statistics) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_name; - pval **pv_unique, **pv_reserved; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *name = NULL; - UWORD unique, reserved; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 6) { - if (zend_get_parameters_ex(6, &pv_conn, &pv_cat, &pv_schema, - &pv_name, &pv_unique, &pv_reserved) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_name); - name = Z_STRVAL_PP(pv_name); - convert_to_long_ex(pv_unique); - unique = (UWORD) Z_LVAL_PP(pv_unique); - convert_to_long_ex(pv_reserved); - reserved = (UWORD) Z_LVAL_PP(pv_reserved); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLStatistics(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - name, SAFE_SQL_NTS(name), - unique, - reserved); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLStatistics"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ - -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP) -/* {{{ proto resource odbc_tableprivileges(resource connection_id, string qualifier, string owner, string name) - Returns a result identifier containing a list of tables and the privileges associated with each table */ -PHP_FUNCTION(odbc_tableprivileges) -{ - pval **pv_conn, **pv_cat, **pv_schema, **pv_table; - odbc_result *result = NULL; - odbc_connection *conn; - char *cat = NULL, *schema = NULL, *table = NULL; - RETCODE rc; - int argc; - - argc = ZEND_NUM_ARGS(); - if (argc == 4) { - if (zend_get_parameters_ex(4, &pv_conn, &pv_cat, &pv_schema, &pv_table) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(pv_cat); - cat = Z_STRVAL_PP(pv_cat); - convert_to_string_ex(pv_schema); - schema = Z_STRVAL_PP(pv_schema); - convert_to_string_ex(pv_table); - table = Z_STRVAL_PP(pv_table); - } else { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - - result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); - - rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); - if (rc == SQL_INVALID_HANDLE) { - efree(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'"); - RETURN_FALSE; - } - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLAllocStmt"); - efree(result); - RETURN_FALSE; - } - - rc = SQLTablePrivileges(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table)); - - if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTablePrivileges"); - efree(result); - RETURN_FALSE; - } - - result->numparams = 0; - SQLNumResultCols(result->stmt, &(result->numcols)); - - if (result->numcols > 0) { - if (!odbc_bindcols(result TSRMLS_CC)) { - efree(result); - RETURN_FALSE; - } - } else { - result->values = NULL; - } - result->conn_ptr = conn; - result->fetched = 0; - ZEND_REGISTER_RESOURCE(return_value, result, le_result); -} -/* }}} */ -#endif /* HAVE_DBMAKER */ - -#endif /* HAVE_UODBC */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h deleted file mode 100644 index 8273bef9a405f..0000000000000 --- a/ext/odbc/php_odbc.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Andreas Karajannis <Andreas.Karajannis@gmd.de> | - | Kevin N. Shallow <kshallow@tampabay.rr.com> (Birdstep) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ODBC_H -#define PHP_ODBC_H - -#if HAVE_UODBC -#define ODBCVER 0x0250 - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry odbc_module_entry; -#define odbc_module_ptr &odbc_module_entry - -#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP) -# define PHP_ODBC_HAVE_FETCH_HASH 1 -#endif - -/* user functions */ -PHP_MINIT_FUNCTION(odbc); -PHP_MSHUTDOWN_FUNCTION(odbc); -PHP_RINIT_FUNCTION(odbc); -PHP_RSHUTDOWN_FUNCTION(odbc); -PHP_MINFO_FUNCTION(odbc); - -PHP_FUNCTION(odbc_error); -PHP_FUNCTION(odbc_errormsg); -PHP_FUNCTION(odbc_setoption); -PHP_FUNCTION(odbc_autocommit); -PHP_FUNCTION(odbc_close); -PHP_FUNCTION(odbc_close_all); -PHP_FUNCTION(odbc_commit); -PHP_FUNCTION(odbc_connect); -PHP_FUNCTION(odbc_pconnect); -PHP_FUNCTION(odbc_cursor); -#ifdef HAVE_SQLDATASOURCES -PHP_FUNCTION(odbc_data_source); -#endif -PHP_FUNCTION(odbc_do); -PHP_FUNCTION(odbc_exec); -PHP_FUNCTION(odbc_execute); -#ifdef PHP_ODBC_HAVE_FETCH_HASH -PHP_FUNCTION(odbc_fetch_array); -PHP_FUNCTION(odbc_fetch_object); -#endif -PHP_FUNCTION(odbc_fetch_into); -PHP_FUNCTION(odbc_fetch_row); -PHP_FUNCTION(odbc_field_len); -PHP_FUNCTION(odbc_field_scale); -PHP_FUNCTION(odbc_field_name); -PHP_FUNCTION(odbc_field_type); -PHP_FUNCTION(odbc_field_num); -PHP_FUNCTION(odbc_free_result); -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) -PHP_FUNCTION(odbc_next_result); -#endif -PHP_FUNCTION(odbc_num_fields); -PHP_FUNCTION(odbc_num_rows); -PHP_FUNCTION(odbc_prepare); -PHP_FUNCTION(odbc_result); -PHP_FUNCTION(odbc_result_all); -PHP_FUNCTION(odbc_rollback); -PHP_FUNCTION(odbc_binmode); -PHP_FUNCTION(odbc_longreadlen); -PHP_FUNCTION(odbc_tables); -PHP_FUNCTION(odbc_columns); -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */ -PHP_FUNCTION(odbc_columnprivileges); -PHP_FUNCTION(odbc_tableprivileges); -#endif -#if !defined(HAVE_SOLID) || !defined(HAVE_SOLID_35) /* not supported */ -PHP_FUNCTION(odbc_foreignkeys); -PHP_FUNCTION(odbc_procedures); -PHP_FUNCTION(odbc_procedurecolumns); -#endif -PHP_FUNCTION(odbc_gettypeinfo); -PHP_FUNCTION(odbc_primarykeys); -PHP_FUNCTION(odbc_specialcolumns); -PHP_FUNCTION(odbc_statistics); - -#else - -#define odbc_module_ptr NULL - -#endif /* HAVE_UODBC */ - -#define phpext_odbc_ptr odbc_module_ptr - -#endif /* PHP_ODBC_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h deleted file mode 100644 index d8433ff047c8d..0000000000000 --- a/ext/odbc/php_odbc_includes.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken <ssb@php.net> | - | Andreas Karajannis <Andreas.Karajannis@gmd.de> | - | Kevin N. Shallow <kshallow@tampabay.rr.com> (Birdstep) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ODBC_INCLUDES_H -#define PHP_ODBC_INCLUDES_H - -#if HAVE_UODBC - -#define ODBCVER 0x0250 -/*#ifndef MSVC5 -#define FAR -#endif -*/ - -/* checking in the same order as in configure.in */ - -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) /* Solid Server */ - -#define ODBC_TYPE "Solid" -#if defined(HAVE_SOLID) -# include <cli0core.h> -# include <cli0ext1.h> -# include <cli0env.h> -#elif defined(HAVE_SOLID_30) -# include <cli0cli.h> -# include <cli0defs.h> -# include <cli0env.h> -#elif defined(HAVE_SOLID_35) -# if !defined(PHP_WIN32) -# include <sqlunix.h> -# endif /* end: #if !defined(PHP_WIN32) */ -# include <sqltypes.h> -# include <sqlucode.h> -# include <sqlext.h> -# include <sql.h> -#endif /* end: #if defined(HAVE_SOLID) */ -#undef HAVE_SQL_EXTENDED_FETCH -PHP_FUNCTION(solid_fetch_prev); -#define SQLSMALLINT SWORD -#define SQLUSMALLINT UWORD -#ifndef SQL_SUCCEEDED -#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) -#endif - -#elif defined(HAVE_EMPRESS) /* Empress */ - -#define ODBC_TYPE "Empress" -#include <sql.h> -#include <sqlext.h> -#undef HAVE_SQL_EXTENDED_FETCH - -#elif defined(HAVE_ADABAS) /* Adabas D */ - -#define ODBC_TYPE "Adabas D" -#include <WINDOWS.H> -#include <sql.h> -#include <sqlext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 -#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) -#define SQLINTEGER ULONG -#define SQLUSMALLINT USHORT - -#elif defined(HAVE_SAPDB) /* SAP DB */ - -#define ODBC_TYPE "SAP DB" -#include <WINDOWS.H> -#include <sql.h> -#include <sqlext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 -#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) - -#elif defined(HAVE_IODBC) /* iODBC library */ - -#define ODBC_TYPE "iODBC" -#include <isql.h> -#include <isqlext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 -#define SQL_FD_FETCH_ABSOLUTE 0x00000010L -#define SQL_CURSOR_DYNAMIC 2UL -#define SQL_NO_TOTAL (-4) -#define SQL_SO_DYNAMIC 0x00000004L -#define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) -#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET) -#ifndef SQL_SUCCEEDED -#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) -#endif - -#elif defined(HAVE_UNIXODBC) /* unixODBC library */ - -#ifdef CHAR -#undef CHAR -#endif - -#ifdef SQLCHAR -#undef SQLCHAR -#endif - -#define ODBC_TYPE "unixODBC" -#include <sql.h> -#include <sqlext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 - -#elif defined(HAVE_ESOOB) /* Easysoft ODBC-ODBC Bridge library */ - -#define ODBC_TYPE "ESOOB" -#include <sql.h> -#include <sqlext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 - -#elif defined(HAVE_ODBC_ROUTER) /* ODBCRouter.com */ - -#ifdef CHAR -#undef CHAR -#endif - -#ifdef SQLCHAR -#undef SQLCHAR -#endif - -#define ODBC_TYPE "ODBCRouter" -#include <odbcsdk.h> -#undef HAVE_SQL_EXTENDED_FETCH - -#elif defined(HAVE_OPENLINK) /* OpenLink ODBC drivers */ - -#define ODBC_TYPE "Openlink" -#include <iodbc.h> -#include <isql.h> -#include <isqlext.h> -#include <udbcext.h> -#define HAVE_SQL_EXTENDED_FETCH 1 -#define SQLSMALLINT SWORD -#define SQLUSMALLINT UWORD - -#elif defined(HAVE_BIRDSTEP) /* Raima Birdstep */ - -#define ODBC_TYPE "Birdstep" -#define UNIX -/* - * Extended Fetch in the Birdstep ODBC API is incapable of returning long varchar (memo) fields. - * So the following line has been commented-out to accomadate. - KNS - * - * #define HAVE_SQL_EXTENDED_FETCH 1 - */ -#include <sql.h> -#include <sqlext.h> -#define SQLINTEGER SDWORD -#define SQLSMALLINT SWORD -#define SQLUSMALLINT UWORD - - -#elif defined(HAVE_DBMAKER) /* DBMaker */ - -#define ODBC_TYPE "DBMaker" -#undef ODBCVER -#define ODBCVER 0x0300 -#define HAVE_SQL_EXTENDED_FETCH 1 -#include <odbc.h> - - -#elif defined(HAVE_CODBC) /* Custom ODBC */ - -#define ODBC_TYPE "Custom ODBC" -#define HAVE_SQL_EXTENDED_FETCH 1 -#include <odbc.h> - -#elif defined(HAVE_IBMDB2) /* DB2 CLI */ - -#define ODBC_TYPE "IBM DB2 CLI" -#define HAVE_SQL_EXTENDED_FETCH 1 -#include <sqlcli1.h> -#ifdef DB268K -/* Need to include ASLM for 68K applications */ -#include <LibraryManager.h> -#endif - -#else /* MS ODBC */ - -#define HAVE_SQL_EXTENDED_FETCH 1 -#include <WINDOWS.H> -#include <sql.h> -#include <sqlext.h> -#endif - - -/* Common defines */ - -#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) -#define ODBC_SQL_ENV_T SQLHANDLE -#define ODBC_SQL_CONN_T SQLHANDLE -#define ODBC_SQL_STMT_T SQLHANDLE -#elif defined( HAVE_SOLID_35 ) || defined( HAVE_SAPDB ) || defined ( HAVE_EMPRESS ) -#define ODBC_SQL_ENV_T SQLHENV -#define ODBC_SQL_CONN_T SQLHDBC -#define ODBC_SQL_STMT_T SQLHSTMT -#else -#define ODBC_SQL_ENV_T HENV -#define ODBC_SQL_CONN_T HDBC -#define ODBC_SQL_STMT_T HSTMT -#endif - -typedef struct odbc_connection { - ODBC_SQL_ENV_T henv; - ODBC_SQL_CONN_T hdbc; - char laststate[6]; - char lasterrormsg[SQL_MAX_MESSAGE_LENGTH]; - int id; - int persistent; -} odbc_connection; - -typedef struct odbc_result_value { - char name[32]; - char *value; - SDWORD vallen; - SDWORD coltype; -} odbc_result_value; - -typedef struct odbc_result { - ODBC_SQL_STMT_T stmt; - int id; - odbc_result_value *values; - SWORD numcols; - SWORD numparams; -# if HAVE_SQL_EXTENDED_FETCH - int fetch_abs; -# endif - long longreadlen; - int binmode; - int fetched; - odbc_connection *conn_ptr; -} odbc_result; - -typedef struct { - char *defDB; - char *defUser; - char *defPW; - long allow_persistent; - long check_persistent; - long max_persistent; - long max_links; - long num_persistent; - long num_links; - int defConn; - long defaultlrl; - long defaultbinmode; - char laststate[6]; - char lasterrormsg[SQL_MAX_MESSAGE_LENGTH]; - HashTable *resource_list; - HashTable *resource_plist; -} php_odbc_globals; - -int odbc_add_result(HashTable *list, odbc_result *result); -odbc_result *odbc_get_result(HashTable *list, int count); -void odbc_del_result(HashTable *list, int count); -int odbc_add_conn(HashTable *list, HDBC conn); -odbc_connection *odbc_get_conn(HashTable *list, int count); -void odbc_del_conn(HashTable *list, int ind); -int odbc_bindcols(odbc_result *result TSRMLS_DC); - -#define ODBC_SQL_ERROR_PARAMS odbc_connection *conn_resource, ODBC_SQL_STMT_T stmt, char *func - -void odbc_sql_error(ODBC_SQL_ERROR_PARAMS); - -#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR) -#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY) - -#ifdef ZTS -# define ODBCG(v) TSRMG(odbc_globals_id, php_odbc_globals *, v) -#else -# define ODBCG(v) (odbc_globals.v) -extern ZEND_API php_odbc_globals odbc_globals; -#endif - -#endif /* HAVE_UODBC */ -#endif /* PHP_ODBC_INCLUDES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS deleted file mode 100644 index c2f50d63089ef..0000000000000 --- a/ext/openssl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -OpenSSL -Stig Venaas, Wez Furlong, Sascha Kettler diff --git a/ext/openssl/README b/ext/openssl/README deleted file mode 100644 index 20a38332fb852..0000000000000 --- a/ext/openssl/README +++ /dev/null @@ -1,322 +0,0 @@ -OpenSSL extension for PHP - -$Id$ - -The functions implemented so far make it possible to seal and open data, and -also create and verify signatures. - -NEW: support for S/MIME encrypt/decrypt/sign/verify, as well as more -flexibility for specifying certificates/keys. - -To enable the extension, configure PHP with --with-openssl. - -Specifying keys/certificates ----------------------------- - -Most of the functions require a key or a certificate as a parameter; to make -things easy for you to use openssl, this extension allows you -to specify certificates in the following way: - -1. As an X.509 resource returned from openssl_x509_read -2. As a string in the format file://filename, where filename is the path to the - certificate file (it will be opened and read automatically) -3. As a string containing the data from the certificate file - -Similarly, you can use the following methods of specifying a public key: - -1. As a key resource returned from openssl_get_publickey -2. An X509 resource - public key only -3. As a string in the format file://filename -4. As a string containing the data from the key file - -Additionally, for a private key, when the openssl extension function does not -allow you to enter the passphrase as a parameter you may use the syntax -array($key, "passphrase") where $key can be a key specified using one of the -methods listed above. - -Certificate Verification ------------------------- -When calling a function that will verify a signature/certificate, the cainfo -parameter is an array containing file and directory names that specifiy the -locations of trusted CA files. If a directory is specified, then it must be a -correctly hashed directory. - -Misc: ------ - -mixed openssl_error_string() - -returns the message from the last error that the OpenSSL library encountered -and moves it's internal error pointer to the next message. If there are no -more error messages, returns false. - -General Key/Cert Functions: ---------------------------- - -resource openssl_get_privatekey(mixed key [, string passphrase]) - -Parses the key data and returns a key resource identifier. If the key is -encrypted a passphrase is needed. This can be supplied as second argument. - - -resource openssl_get_publickey(mixed cert) - -Extracts the public key from the given certificate or public key and returns -a key resource identifier. - - -void openssl_free_key(resource key) - -Frees the resource given by the key resource identifier. -Note that this function does not accept the extended key specification -syntax mentioned above, as it doesn't make sense in this case! - -array openssl_x509_parse(mixed x509[, bool shortnames=true]) - -Parses the certificate data and returns an array containing information -about the certificate, it's intended purposes, subject, issuer, validity -etc. etc. If shortnames is true (the default) then the fields will be -keyed by the shortname forms eg: CN as opposed to commonName (shortnames -= false). - - -bool openssl_x509_checkpurpose(mixed x509cert, int purpose, - array cainfo[, string untrustedfile]) - -Verifies if the certificate can be used for a specific purpose. -Purpose can be one of the following values: - X509_PURPOSE_SSL_CLIENT - X509_PURPOSE_SSL_SERVER - X509_PURPOSE_NS_SSL_SERVER - X509_PURPOSE_SMIME_SIGN - X509_PURPOSE_SMIME_ENCRYPT - X509_PURPOSE_CRL_SIGN - X509_PURPOSE_ANY - -cainfo is an array of CA information (as mentioned above). -untrusted file specifies a file containing a bunch of certs that -are not trusted but may be useful in validating the certificate. - - -resource openssl_read_x509(mixed cert) - -Parses the cert and returns a resource that can be used with the -other openssl functions - - -void openssl_free_x509(resource x509) - -Frees the resource given by the x509 resource identifier. -Note that this function does not accept the extended cert specification -syntax mentioned above, as it doesn't make sense in this case! - - -PKCS7 (S/MIME) Sign/Verify/Encrypt/Decrypt Functions: ------------------------------------------------------ - -These functions allow you to manipulate S/MIME messages! - -They are based on apps/smime.c from the openssl dist, so for information, -see the documentation for openssl. - -You may pass in some flags that affect how these functions work using -and array containing the following values: -"detached", "nodetached", "text", "nointern", "noverify", "nochain", -"nocerts", "noattr", "binary", "nosigs". -The options correspond to the options of the same name for the -"openssl smime" command (smime(1)). - - -bool openssl_pkcs7_verify(string filename, array flags[, string signerscerts][, - array cainfo]) - -Verifies that the signature on the MIME message contained in the file -named by filename is valid. If signerscerts is passed in, it holds the -name of a file into which the certificates of those that signed the -message will be stored. -cainfo and flags are CA information and flag information as described -above. - - -bool openssl_pkcs7_encrypt(string infile, string outfile, array recipcerts, - array headers[, array flags]) - -Encrypts the MIME message contained in the file named by infile using -the certificates held in recipcerts. The result is place in the file -named outfile. -recipcerts is an array of certificate identifiers representing the certs -of the intended recipients of the message. -headers is an array of headers to prepend to the message: they will -not be included in the encoded section. -flags is flag information as described above. -Hint: you will want to put "To", "From", and "Subject" headers in headers. -Headers can be either an assoc array keyed by header named, or can be -and indexed array containing a single header line per value. -The message will be encoded using a RC2-40 bit cipher. -TODO: allow user to specify cipher. - -bool openssl_pkcs7_sign(string infile, string outfile, mixed signcert, mixed - signkey, array headers[, array flags][, string extracertsfilename]) - -Signs the MIME message contained in the file named by infile using the -certificate and key pair identified by signcert/signkey. -Signkey must be the private key corresponding to signcert. -The result is placed in the file named by outfile. -Headers and flags have the same effects as mentioned above. -extracertsfilename names a file containing a bunch of additional certificates -to include in the signature, in order to aid the recipient in verifying the -message. - - -bool openssl_pkcs7_decrypt(string infilename, string outfilename, mixed - recipcert, mixed recipkey) - -Decrypts the MIME message contained in the file named by infilename -using the certificate and private key pair recipcert/recipkey. -The descrypted result is placed in outfilename. -TODO: add flags parameter, if needed? - - -EVP Sign/Verify/Encrypt/Decrypt Functions: ------------------------------------------- - -bool openssl_sign(string data, &string signature, mixed key) - -Uses key to create signature for data, returns true on success and false -on failure. signature is passed by reference and contains the newly created -signature on success. - - -int openssl_verify(string data, string signature, mixed key) - -Uses key to verify that the signature is correct for the given data. -Returns 1 if correct, 0 if incorrect, and -1 on error. - - -int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys) - -Encrypts data using pubkeys, so that only owners of the respective private -keys and ekeys can decrypt and read the data. Returns the length of the -sealed data on success, else false. On success, sealdata and ekeys hold -the sealed data and envelope keys. - - -bool openssl_open(string data, &string opendata, string ekey, int privkey) - -Opens (decrypts) sealed data using a private key and the corresponding -envelope key. Returns true on success and false on failure. On success, -opendata will hold the descypted data. - - -See below for more details on usage. Also feel free to mail me at -venaas@php.net if you have questions. The OpenSSL documentation, -especially the EVP documentation at -http://www.openssl.org/docs/crypto/evp.html, might also be of help. - - -HOWTO: - -To do anything you need a private key and a certificate containing the -corresponding public key. This is similar to what you have using say an -Apache webserver with OpenSSL. For testing you could try keys that come -with OpenSSL, that's what the sample scripts below do. You can also get -keys from some CA, or you can create them yourself. - - -Creating private key - -To generate an unprotected 1024 bit RSA private key you can do - - openssl genrsa -out /tmp/test.key 1024 - -Private keys should be protected by a passphrase though. - - -Creating a self signed certificate - -To generate a self signed certificate from the key that is valid for -365 days, do - - openssl req -new -key /tmp/test.key -out /tmp/test.crt -days 365 -x509 - - -Example usage - -These examples use keys that come with OpenSSL, you should perhaps test with -those first. - - -Seal and open - - <?php - $data = "Follow the white rabbit"; - - // Get certificate into a string - // this file comes with OpenSSL 0.9.6 - $fp = fopen("/src/openssl-0.9.6/demos/maurice/cert.pem", "r"); - $cert = fread($fp, 8192); - fclose($fp); - // get public key from certificate - $pk1 = openssl_get_publickey($cert); - // $pk1 is an encryption key resource id if success, else false - // Repeat if want public keys for multiple parties - - $fp = fopen("/src/openssl-0.9.6/demos/sign/cert.pem", "r"); - $cert = fread($fp, 8192); - fclose($fp); - $pk2 = openssl_get_publickey($cert); - - // seal data, only owners of $pk1 and $pk2 can decrypt $sealed with keys - // $ekeys[0] and $ekeys[1] respectively. - openssl_seal($data, $sealed, $ekeys, array($pk1,$pk2)); - openssl_free_key($pk1); - openssl_free_key($pk2); - - // now we try to decrypt data for one of the recipients - $fp = fopen("/src/openssl-0.9.6/demos/sign/key.pem", "r"); - // Get PEM coded key into $pkey - $pkey = fread($fp, 8192); - fclose($fp); - // $key will be resource id for unpacked $pkey - $key = openssl_get_privatekey($pkey); - - openssl_open($sealed, $open, $ekeys[1], $key); - openssl_free_key($key); - echo "$open\n"; - ?> - - -Sign and verify - - <?php - $data = "Follow the white rabbit"; - - // First we need to have a string containing the private key in PEM format - // this file comes with OpenSSL 0.9.6 - $fp = fopen("/src/openssl-0.9.6/demos/sign/key.pem", "r"); - $pkey = fread($fp, 8192); - fclose($fp); - - // get private key from the PEM format - // $key is an encr key resource id if success, else false - $key = openssl_get_privatekey($pkey); - - // calculate signature - openssl_sign($data, $signature, $key); - openssl_free_key($key); - - // recipient verifies signature - // read certificate - $fp = fopen("/src/openssl-0.9.6/demos/sign/cert.pem", "r"); - $cert = fread($fp, 8192); - fclose($fp); - - // Get public key from the certificate - $pubkey = openssl_get_publickey($cert); - - // state whether signature is okay or not - echo openssl_verify($data, $signature, $pubkey) == 1 ? "ok\n" : "bad\n"; - - // free key - openssl_free_key($pubkey); - ?> diff --git a/ext/openssl/config.w32 b/ext/openssl/config.w32 deleted file mode 100644 index 98dc852ee8b48..0000000000000 --- a/ext/openssl/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("openssl", "OpenSSL support", "no"); - -if (PHP_OPENSSL != "no") { - if (CHECK_LIB("ssleay32.lib", "openssl", PHP_OPENSSL) && - CHECK_LIB("libeay32.lib", "openssl", PHP_OPENSSL) && - CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_OPENSSL")) { - EXTENSION("openssl", "openssl.c xp_ssl.c"); - - AC_DEFINE("HAVE_OPENSSL_EXT", PHP_OPENSSL_SHARED ? 0 : 1, "Have openssl"); - AC_DEFINE("HAVE_OPENSSL", 1); - } -} - - diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 deleted file mode 100644 index a51d9e1930844..0000000000000 --- a/ext/openssl/config0.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(openssl, for OpenSSL support, -[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)]) - -PHP_ARG_WITH(kerberos, for Kerberos support, -[ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no) - -if test "$PHP_OPENSSL" != "no"; then - PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared) - PHP_SUBST(OPENSSL_SHARED_LIBADD) - - if test "$PHP_KERBEROS" != "no"; then - PHP_SETUP_KERBEROS(OPENSSL_SHARED_LIBADD) - fi - - PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD, - [ - AC_DEFINE(HAVE_OPENSSL_EXT,1,[ ]) - ], [ - AC_MSG_ERROR([OpenSSL check failed. Please check config.log for more information.]) - ]) -fi diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c deleted file mode 100644 index d25ed7f5ee2cc..0000000000000 --- a/ext/openssl/openssl.c +++ /dev/null @@ -1,3354 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Venaas <venaas@php.net> | - | Wez Furlong <wez@thebrainroom.com> | - | Sascha Kettler <kettler@gmx.net> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_openssl.h" - -/* PHP Includes */ -#include "ext/standard/file.h" -#include "ext/standard/info.h" -#include "ext/standard/php_fopen_wrappers.h" - -/* OpenSSL includes */ -#include <openssl/evp.h> -#include <openssl/x509.h> -#include <openssl/x509v3.h> -#include <openssl/crypto.h> -#include <openssl/pem.h> -#include <openssl/err.h> -#include <openssl/conf.h> -#include <openssl/rand.h> -#include <openssl/ssl.h> - -#define DEFAULT_KEY_LENGTH 512 -#define MIN_KEY_LENGTH 384 - -#define OPENSSL_ALGO_SHA1 1 -#define OPENSSL_ALGO_MD5 2 -#define OPENSSL_ALGO_MD4 3 -#define OPENSSL_ALGO_MD2 4 - -#define DEBUG_SMIME 0 - -static - ZEND_BEGIN_ARG_INFO(arg2and3_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -enum php_openssl_key_type { - OPENSSL_KEYTYPE_RSA, - OPENSSL_KEYTYPE_DSA, - OPENSSL_KEYTYPE_DH, - OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA -}; - -enum php_openssl_cipher_type { - PHP_OPENSSL_CIPHER_RC2_40, - PHP_OPENSSL_CIPHER_RC2_128, - PHP_OPENSSL_CIPHER_RC2_64, - PHP_OPENSSL_CIPHER_DES, - PHP_OPENSSL_CIPHER_3DES, - - PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40 -}; - -/* {{{ openssl_functions[] - */ -function_entry openssl_functions[] = { -/* public/private key functions */ - PHP_FE(openssl_pkey_free, NULL) - PHP_FE(openssl_pkey_new, NULL) - PHP_FE(openssl_pkey_export, second_arg_force_ref) - PHP_FE(openssl_pkey_export_to_file, NULL) - PHP_FE(openssl_pkey_get_private, NULL) - PHP_FE(openssl_pkey_get_public, NULL) - - PHP_FALIAS(openssl_free_key, openssl_pkey_free, NULL) - PHP_FALIAS(openssl_get_privatekey, openssl_pkey_get_private, NULL) - PHP_FALIAS(openssl_get_publickey, openssl_pkey_get_public, NULL) - -/* x.509 cert funcs */ - PHP_FE(openssl_x509_read, NULL) - PHP_FE(openssl_x509_free, NULL) - PHP_FE(openssl_x509_parse, NULL) - PHP_FE(openssl_x509_checkpurpose, NULL) - PHP_FE(openssl_x509_check_private_key, NULL) - PHP_FE(openssl_x509_export, second_arg_force_ref) - PHP_FE(openssl_x509_export_to_file, NULL) - -/* CSR funcs */ - PHP_FE(openssl_csr_new, second_arg_force_ref) - PHP_FE(openssl_csr_export, second_arg_force_ref) - PHP_FE(openssl_csr_export_to_file, NULL) - PHP_FE(openssl_csr_sign, NULL) - - PHP_FE(openssl_sign, second_arg_force_ref) - PHP_FE(openssl_verify, NULL) - PHP_FE(openssl_seal, arg2and3_force_ref) - PHP_FE(openssl_open, second_arg_force_ref) - -/* for S/MIME handling */ - PHP_FE(openssl_pkcs7_verify, NULL) - PHP_FE(openssl_pkcs7_decrypt, NULL) - PHP_FE(openssl_pkcs7_sign, NULL) - PHP_FE(openssl_pkcs7_encrypt, NULL) - - PHP_FE(openssl_private_encrypt, second_arg_force_ref) - PHP_FE(openssl_private_decrypt, second_arg_force_ref) - PHP_FE(openssl_public_encrypt, second_arg_force_ref) - PHP_FE(openssl_public_decrypt, second_arg_force_ref) - - PHP_FE(openssl_error_string, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ openssl_module_entry - */ -zend_module_entry openssl_module_entry = { - STANDARD_MODULE_HEADER, - "openssl", - openssl_functions, - PHP_MINIT(openssl), - PHP_MSHUTDOWN(openssl), - NULL, - NULL, - PHP_MINFO(openssl), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_OPENSSL -ZEND_GET_MODULE(openssl) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -static int le_key; -static int le_x509; -static int le_csr; -static int ssl_stream_data_index; - -/* {{{ resource destructors */ -static void php_pkey_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr; - - assert(pkey != NULL); - - EVP_PKEY_free(pkey); -} - -static void php_x509_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - X509 *x509 = (X509 *)rsrc->ptr; - X509_free(x509); -} - -static void php_csr_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - X509_REQ * csr = (X509_REQ*)rsrc->ptr; - X509_REQ_free(csr); -} -/* }}} */ - -/* {{{ openssl safe_mode & open_basedir checks */ -inline static int php_openssl_safe_mode_chk(char *filename TSRMLS_DC) -{ - if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return -1; - } - if (php_check_open_basedir(filename TSRMLS_CC)) { - return -1; - } - - return 0; -} -/* }}} */ - -/* {{{ openssl -> PHP "bridging" */ -/* true global; readonly after module startup */ -static char default_ssl_conf_filename[MAXPATHLEN]; - -struct php_x509_request { - LHASH * global_config; /* Global SSL config */ - LHASH * req_config; /* SSL config for this request */ - const EVP_MD * md_alg; - const EVP_MD * digest; - char * section_name, - * config_filename, - * digest_name, - * extensions_section, - * request_extensions_section; - int priv_key_bits; - int priv_key_type; - - int priv_key_encrypt; - - EVP_PKEY * priv_key; -}; - - -static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC); -static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC); -static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC); -static X509_STORE * setup_verify(zval * calist TSRMLS_DC); -static STACK_OF(X509) * load_all_certs_from_file(char *certfile); -static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC); -static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC); - - -static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) -{ - zval *subitem, *subentries; - int i, j = -1, last = -1, obj_cnt = 0; - char *sname; - int nid; - X509_NAME_ENTRY * ne; - ASN1_STRING * str; - ASN1_OBJECT * obj; - - MAKE_STD_ZVAL(subitem); - array_init(subitem); - - for (i = 0; i < X509_NAME_entry_count(name); i++) { - ne = X509_NAME_get_entry(name, i); - obj = X509_NAME_ENTRY_get_object(ne); - nid = OBJ_obj2nid(obj); - obj_cnt = 0; - - if (shortname) { - sname = (char *) OBJ_nid2sn(nid); - } else { - sname = (char *) OBJ_nid2ln(nid); - } - - MAKE_STD_ZVAL(subentries); - array_init(subentries); - - last = -1; - for (;;) { - j = X509_NAME_get_index_by_OBJ(name, obj, last); - if (j < 0) { - if (last != -1) break; - } else { - obj_cnt++; - ne = X509_NAME_get_entry(name, j); - str = X509_NAME_ENTRY_get_data(ne); - add_next_index_stringl(subentries, str->data, str->length, 1); - } - last = j; - } - i = last; - - if (obj_cnt > 1) { - add_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries); - } else { - zval_dtor(subentries); - FREE_ZVAL(subentries); - if (obj_cnt) { - add_assoc_stringl(subitem, sname, str->data, str->length, 1); - } - } - } - zend_hash_update(HASH_OF(val), key, strlen(key) + 1, (void *)&subitem, sizeof(subitem), NULL); -} - -static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) -{ - add_assoc_stringl(val, key, str->data, str->length, 1); -} - -static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) -{ -/* - This is how the time string is formatted: - - sprintf(p,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, - ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); -*/ - - time_t ret; - struct tm thetime; - char * strbuf; - char * thestr; - long gmadjust = 0; - - if (timestr->length < 13) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data); - return (time_t)-1; - } - - strbuf = estrdup(timestr->data); - - memset(&thetime, 0, sizeof(thetime)); - - /* we work backwards so that we can use atoi more easily */ - - thestr = strbuf + timestr->length - 3; - - thetime.tm_sec = atoi(thestr); - *thestr = '\0'; - thestr -= 2; - thetime.tm_min = atoi(thestr); - *thestr = '\0'; - thestr -= 2; - thetime.tm_hour = atoi(thestr); - *thestr = '\0'; - thestr -= 2; - thetime.tm_mday = atoi(thestr); - *thestr = '\0'; - thestr -= 2; - thetime.tm_mon = atoi(thestr)-1; - *thestr = '\0'; - thestr -= 2; - thetime.tm_year = atoi(thestr); - - if (thetime.tm_year < 68) { - thetime.tm_year += 100; - } - - thetime.tm_isdst = -1; - ret = mktime(&thetime); - -#if HAVE_TM_GMTOFF - gmadjust = thetime.tm_gmtoff; -#else - /* - ** If correcting for daylight savings time, we set the adjustment to - ** the value of timezone - 3600 seconds. Otherwise, we need to overcorrect and - ** set the adjustment to the main timezone + 3600 seconds. - */ - gmadjust = -(thetime.tm_isdst ? (long)timezone - 3600 : (long)timezone + 3600); -#endif - ret += gmadjust; - - efree(strbuf); - - return ret; -} - -static inline int php_openssl_config_check_syntax( - const char * section_label, - const char * config_filename, - const char * section, - LHASH * config TSRMLS_DC) -{ - X509V3_CTX ctx; - - X509V3_set_ctx_test(&ctx); - X509V3_set_conf_lhash(&ctx, config); - if (!X509V3_EXT_add_conf(config, &ctx, (char *)section, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading %s section %s of %s", - section_label, - section, - config_filename); - return FAILURE; - } - return SUCCESS; -} - -static int add_oid_section(struct php_x509_request * req TSRMLS_DC) -{ - char * str; - STACK_OF(CONF_VALUE) * sktmp; - CONF_VALUE * cnf; - int i; - - str = CONF_get_string(req->req_config, NULL, "oid_section"); - if (str == NULL) { - return SUCCESS; - } - sktmp = CONF_get_section(req->req_config, str); - if (sktmp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem loading oid section %s", str); - return FAILURE; - } - for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) { - cnf = sk_CONF_VALUE_value(sktmp, i); - if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value); - return FAILURE; - } - } - return SUCCESS; -} - -#define PHP_SSL_REQ_INIT(req) memset(req, 0, sizeof(*req)) -#define PHP_SSL_REQ_DISPOSE(req) php_openssl_dispose_config(req TSRMLS_CC) -#define PHP_SSL_REQ_PARSE(req, zval) php_openssl_parse_config(req, zval TSRMLS_CC) - -#define PHP_SSL_CONFIG_SYNTAX_CHECK(var) if (req->var && php_openssl_config_check_syntax(#var, \ - req->config_filename, req->var, req->req_config TSRMLS_CC) == FAILURE) return FAILURE - -#define SET_OPTIONAL_STRING_ARG(key, varname, defval) \ - if (optional_args && zend_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)&item) == SUCCESS) \ - varname = Z_STRVAL_PP(item); \ - else \ - varname = defval - -#define SET_OPTIONAL_LONG_ARG(key, varname, defval) \ - if (optional_args && zend_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)&item) == SUCCESS) \ - varname = Z_LVAL_PP(item); \ - else \ - varname = defval - - - -static int php_openssl_parse_config( - struct php_x509_request * req, - zval * optional_args - TSRMLS_DC - ) -{ - char * str; - zval ** item; - - SET_OPTIONAL_STRING_ARG("config", req->config_filename, default_ssl_conf_filename); - SET_OPTIONAL_STRING_ARG("config_section_name", req->section_name, "req"); - req->global_config = CONF_load(NULL, default_ssl_conf_filename, NULL); - req->req_config = CONF_load(NULL, req->config_filename, NULL); - - if (req->req_config == NULL) { - return FAILURE; - } - - /* read in the oids */ - str = CONF_get_string(req->req_config, NULL, "oid_file"); - if (str && !php_openssl_safe_mode_chk(str TSRMLS_CC)) { - BIO *oid_bio = BIO_new_file(str, "r"); - if (oid_bio) { - OBJ_create_objects(oid_bio); - BIO_free(oid_bio); - } - } - if (add_oid_section(req TSRMLS_CC) == FAILURE) { - return FAILURE; - } - SET_OPTIONAL_STRING_ARG("digest_alg", req->digest_name, - CONF_get_string(req->req_config, req->section_name, "default_md")); - SET_OPTIONAL_STRING_ARG("x509_extensions", req->extensions_section, - CONF_get_string(req->req_config, req->section_name, "x509_extensions")); - SET_OPTIONAL_STRING_ARG("req_extensions", req->extensions_section, - CONF_get_string(req->req_config, req->request_extensions_section, "req_extensions")); - SET_OPTIONAL_LONG_ARG("private_key_bits", req->priv_key_bits, - CONF_get_number(req->req_config, req->section_name, "default_bits")); - - SET_OPTIONAL_LONG_ARG("private_key_type", req->priv_key_type, OPENSSL_KEYTYPE_DEFAULT); - - if (optional_args && zend_hash_find(Z_ARRVAL_P(optional_args), "encrypt_key", sizeof("encrypt_key"), (void**)&item) == SUCCESS) { - req->priv_key_encrypt = Z_BVAL_PP(item); - } else { - str = CONF_get_string(req->req_config, req->section_name, "encrypt_rsa_key"); - if (str == NULL) { - str = CONF_get_string(req->req_config, req->section_name, "encrypt_key"); - } - if (str && strcmp(str, "no") == 0) { - req->priv_key_encrypt = 0; - } else { - req->priv_key_encrypt = 1; - } - } - - /* digest alg */ - if (req->digest_name == NULL) { - req->digest_name = CONF_get_string(req->req_config, req->section_name, "default_md"); - } - if (req->digest_name) { - req->digest = req->md_alg = EVP_get_digestbyname(req->digest_name); - } - if (req->md_alg == NULL) { - req->md_alg = req->digest = EVP_md5(); - } - - PHP_SSL_CONFIG_SYNTAX_CHECK(extensions_section); - - /* set the string mask */ - str = CONF_get_string(req->req_config, req->section_name, "string_mask"); - if (str && !ASN1_STRING_set_default_mask_asc(str)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid global string mask setting %s", str); - return FAILURE; - } - - if (req->request_extensions_section == NULL) { - req->request_extensions_section = CONF_get_string(req->req_config, req->section_name, "req_extensions"); - } - PHP_SSL_CONFIG_SYNTAX_CHECK(request_extensions_section); - - return SUCCESS; -} - -static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) -{ - if (req->priv_key) { - EVP_PKEY_free(req->priv_key); - req->priv_key = NULL; - } - if (req->global_config) { - CONF_free(req->global_config); - req->global_config = NULL; - } - if (req->req_config) { - CONF_free(req->req_config); - req->req_config = NULL; - } -} - -static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) -{ - char buffer[MAXPATHLEN]; - - TSRMLS_FETCH(); - - *egdsocket = 0; - *seeded = 0; - -#ifdef WINDOWS - RAND_screen(); -#endif - if (file == NULL) { - file = RAND_file_name(buffer, sizeof(buffer)); - } else if (RAND_egd(file) > 0) { - /* if the given filename is an EGD socket, don't - * write anything back to it */ - *egdsocket = 1; - return SUCCESS; - } - if (file == NULL || !RAND_load_file(file, -1)) { - if (RAND_status() == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to load random state; not enough random data!"); - return FAILURE; - } - return FAILURE; - } - *seeded = 1; - return SUCCESS; -} - -static int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded) -{ - char buffer[MAXPATHLEN]; - - TSRMLS_FETCH(); - - if (egdsocket || !seeded) { - /* if we did not manage to read the seed file, we should not write - * a low-entropy seed file back */ - return FAILURE; - } - if (file == NULL) { - file = RAND_file_name(buffer, sizeof(buffer)); - } - if (file == NULL || !RAND_write_file(file)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to write random state"); - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(openssl) -{ - char * config_filename; - - le_key = zend_register_list_destructors_ex(php_pkey_free, NULL, "OpenSSL key", module_number); - le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number); - le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "OpenSSL X.509 CSR", module_number); - - OpenSSL_add_all_ciphers(); - OpenSSL_add_all_digests(); - OpenSSL_add_all_algorithms(); - - ERR_load_ERR_strings(); - ERR_load_crypto_strings(); - ERR_load_EVP_strings(); - - /* register a resource id number with openSSL so that we can map SSL -> stream structures in - * openSSL callbacks */ - ssl_stream_data_index = SSL_get_ex_new_index(0, "PHP stream index", NULL, NULL, NULL); - - /* purposes for cert purpose checking */ - REGISTER_LONG_CONSTANT("X509_PURPOSE_SSL_CLIENT", X509_PURPOSE_SSL_CLIENT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("X509_PURPOSE_SSL_SERVER", X509_PURPOSE_SSL_SERVER, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("X509_PURPOSE_NS_SSL_SERVER", X509_PURPOSE_NS_SSL_SERVER, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_SIGN", X509_PURPOSE_SMIME_SIGN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_ENCRYPT", X509_PURPOSE_SMIME_ENCRYPT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("X509_PURPOSE_CRL_SIGN", X509_PURPOSE_CRL_SIGN, CONST_CS|CONST_PERSISTENT); -#ifdef X509_PURPOSE_ANY - REGISTER_LONG_CONSTANT("X509_PURPOSE_ANY", X509_PURPOSE_ANY, CONST_CS|CONST_PERSISTENT); -#endif - - /* signature algorithm constants */ - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA1", OPENSSL_ALGO_SHA1, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD5", OPENSSL_ALGO_MD5, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD4", OPENSSL_ALGO_MD4, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); - - /* flags for S/MIME */ - REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_TEXT", PKCS7_TEXT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOINTERN", PKCS7_NOINTERN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOVERIFY", PKCS7_NOVERIFY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOCHAIN", PKCS7_NOCHAIN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOCERTS", PKCS7_NOCERTS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOATTR", PKCS7_NOATTR, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_BINARY", PKCS7_BINARY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PKCS7_NOSIGS", PKCS7_NOSIGS, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_PADDING", RSA_PKCS1_PADDING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_SSLV23_PADDING", RSA_SSLV23_PADDING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_NO_PADDING", RSA_NO_PADDING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_OAEP_PADDING", RSA_PKCS1_OAEP_PADDING, CONST_CS|CONST_PERSISTENT); - - /* Ciphers */ - REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_40", PHP_OPENSSL_CIPHER_RC2_40, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_128", PHP_OPENSSL_CIPHER_RC2_128, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_64", PHP_OPENSSL_CIPHER_RC2_64, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_DES", PHP_OPENSSL_CIPHER_DES, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_3DES", PHP_OPENSSL_CIPHER_3DES, CONST_CS|CONST_PERSISTENT); - - /* Values for key types */ - REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_RSA", OPENSSL_KEYTYPE_RSA, CONST_CS|CONST_PERSISTENT); -#ifndef NO_DSA - REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DSA", OPENSSL_KEYTYPE_DSA, CONST_CS|CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DH", OPENSSL_KEYTYPE_DH, CONST_CS|CONST_PERSISTENT); - - /* Determine default SSL configuration file */ - config_filename = getenv("OPENSSL_CONF"); - if (config_filename == NULL) { - config_filename = getenv("SSLEAY_CONF"); - } - - /* default to 'openssl.cnf' if no environment variable is set */ - if (config_filename == NULL) { - snprintf(default_ssl_conf_filename, sizeof(default_ssl_conf_filename), "%s/%s", - X509_get_default_cert_area(), - "openssl.cnf"); - } else { - strlcpy(default_ssl_conf_filename, config_filename, sizeof(default_ssl_conf_filename)); - } - - php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC); - php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC); - php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC); - php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC); - - /* override the default tcp socket provider */ - php_stream_xport_register("tcp", php_openssl_ssl_socket_factory TSRMLS_CC); - - php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(openssl) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "OpenSSL support", "enabled"); - php_info_print_table_row(2, "OpenSSL Version", OPENSSL_VERSION_TEXT); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(openssl) -{ - EVP_cleanup(); - - php_unregister_url_stream_wrapper("https" TSRMLS_CC); - php_unregister_url_stream_wrapper("ftps" TSRMLS_CC); - - php_stream_xport_unregister("ssl" TSRMLS_CC); - php_stream_xport_unregister("sslv2" TSRMLS_CC); - php_stream_xport_unregister("sslv3" TSRMLS_CC); - php_stream_xport_unregister("tls" TSRMLS_CC); - - /* reinstate the default tcp handler */ - php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ x509 cert functions */ - -/* {{{ php_openssl_x509_from_zval - Given a zval, coerce it into an X509 object. - The zval can be: - . X509 resource created using openssl_read_x509() - . if it starts with file:// then it will be interpreted as the path to that cert - . it will be interpreted as the cert data - If you supply makeresource, the result will be registered as an x509 resource and - it's value returned in makeresource. -*/ -static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC) -{ - X509 *cert = NULL; - - if (resourceval) { - *resourceval = -1; - } - if (Z_TYPE_PP(val) == IS_RESOURCE) { - /* is it an x509 resource ? */ - void * what; - int type; - - what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509", &type, 1, le_x509); - if (!what) { - return NULL; - } - /* this is so callers can decide if they should free the X509 */ - if (resourceval) { - *resourceval = Z_LVAL_PP(val); - } - if (type == le_x509) { - return (X509*)what; - } - /* other types could be used here - eg: file pointers and read in the data from them */ - - return NULL; - } - /* force it to be a string and check if it refers to a file */ - convert_to_string_ex(val); - - if (Z_STRLEN_PP(val) > 7 && memcmp(Z_STRVAL_PP(val), "file://", sizeof("file://") - 1) == 0) { - /* read cert from the named file */ - BIO *in; - - if (php_openssl_safe_mode_chk(Z_STRVAL_PP(val) + (sizeof("file://") - 1) TSRMLS_CC)) { - return NULL; - } - - in = BIO_new_file(Z_STRVAL_PP(val) + (sizeof("file://") - 1), "r"); - if (in == NULL) { - return NULL; - } - cert = PEM_read_bio_X509(in, NULL, NULL, NULL); - BIO_free(in); - } else { - BIO *in; - - in = BIO_new_mem_buf(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - if (in == NULL) { - return NULL; - } - cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); - BIO_free(in); - } - - if (cert && makeresource && resourceval) { - *resourceval = zend_list_insert(cert, le_x509); - } - return cert; -} - -/* }}} */ - -/* {{{ proto bool openssl_x509_export_to_file(mixed x509, string outfilename [, bool notext = true]) - Exports a CERT to file or a var */ -PHP_FUNCTION(openssl_x509_export_to_file) -{ - X509 * cert; - zval * zcert = NULL; - zend_bool notext = 1; - BIO * bio_out; - long certresource; - char * filename; - int filename_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcert, &filename, &filename_len, ¬ext) == FAILURE) { - return; - } - RETVAL_FALSE; - - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); - return; - } - - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - return; - } - - bio_out = BIO_new_file(filename, "w"); - if (bio_out) { - if (!notext) { - X509_print(bio_out, cert); - } - PEM_write_bio_X509(bio_out, cert); - - RETVAL_TRUE; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename); - } - if (certresource == -1 && cert) { - X509_free(cert); - } - BIO_free(bio_out); -} -/* }}} */ - -/* {{{ proto bool openssl_x509_export(mixed x509, string &out [, bool notext = true]) - Exports a CERT to file or a var */ -PHP_FUNCTION(openssl_x509_export) -{ - X509 * cert; - zval * zcert = NULL, *zout=NULL; - zend_bool notext = 1; - BIO * bio_out; - long certresource; - char * bio_mem_ptr; - long bio_mem_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|b", &zcert, &zout, ¬ext) == FAILURE) { - return; - } - RETVAL_FALSE; - - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); - return; - } - - bio_out = BIO_new(BIO_s_mem()); - if (!notext) { - X509_print(bio_out, cert); - } - PEM_write_bio_X509(bio_out, cert); - - bio_mem_len = BIO_get_mem_data(bio_out, &bio_mem_ptr); - ZVAL_STRINGL(zout, bio_mem_ptr, bio_mem_len, 1); - - RETVAL_TRUE; - - if (certresource == -1 && cert) { - X509_free(cert); - } - BIO_free(bio_out); -} -/* }}} */ - -/* {{{ proto bool openssl_x509_check_private_key(mixed cert, mixed key) - Checks if a private key corresponds to a CERT */ -PHP_FUNCTION(openssl_x509_check_private_key) -{ - zval * zcert, *zkey; - X509 * cert = NULL; - EVP_PKEY * key = NULL; - long certresource = -1, keyresource = -1; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zcert, &zkey) == FAILURE) { - return; - } - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - RETURN_FALSE; - } - key = php_openssl_evp_from_zval(&zkey, 0, "", 1, &keyresource TSRMLS_CC); - if (key) { - RETVAL_BOOL(X509_check_private_key(cert, key)); - } - - if (keyresource == -1 && key) { - EVP_PKEY_free(key); - } - if (certresource == -1 && cert) { - X509_free(cert); - } -} -/* }}} */ - -/* {{{ proto array openssl_x509_parse(mixed x509 [, bool shortnames=true]) - Returns an array of the fields/values of the CERT */ -PHP_FUNCTION(openssl_x509_parse) -{ - zval * zcert; - X509 * cert = NULL; - long certresource = -1; - int i; - zend_bool useshortnames = 1; - char * tmpstr; - zval * subitem; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcert, &useshortnames) == FAILURE) { - return; - } - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - RETURN_FALSE; - } - array_init(return_value); - - if (cert->name) { - add_assoc_string(return_value, "name", cert->name, 1); - } -/* add_assoc_bool(return_value, "valid", cert->valid); */ - - add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_CC); - /* hash as used in CA directories to lookup cert by subject name */ - { - char buf[32]; - snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); - add_assoc_string(return_value, "hash", buf, 1); - } - - add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames TSRMLS_CC); - add_assoc_long(return_value, "version", X509_get_version(cert)); - add_assoc_long(return_value, "serialNumber", ASN1_INTEGER_get(X509_get_serialNumber(cert))); - - add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert)); - add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert)); - - add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert) TSRMLS_CC)); - add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert) TSRMLS_CC)); - - tmpstr = X509_alias_get0(cert, NULL); - if (tmpstr) { - add_assoc_string(return_value, "alias", tmpstr, 1); - } -/* - add_assoc_long(return_value, "signaturetypeLONG", X509_get_signature_type(cert)); - add_assoc_string(return_value, "signaturetype", OBJ_nid2sn(X509_get_signature_type(cert)), 1); - add_assoc_string(return_value, "signaturetypeLN", OBJ_nid2ln(X509_get_signature_type(cert)), 1); -*/ - MAKE_STD_ZVAL(subitem); - array_init(subitem); - - /* NOTE: the purposes are added as integer keys - the keys match up to the X509_PURPOSE_SSL_XXX defines - in x509v3.h */ - for (i = 0; i < X509_PURPOSE_get_count(); i++) { - int id, purpset; - char * pname; - X509_PURPOSE * purp; - zval * subsub; - - MAKE_STD_ZVAL(subsub); - array_init(subsub); - - purp = X509_PURPOSE_get0(i); - id = X509_PURPOSE_get_id(purp); - - purpset = X509_check_purpose(cert, id, 0); - add_index_bool(subsub, 0, purpset); - - purpset = X509_check_purpose(cert, id, 1); - add_index_bool(subsub, 1, purpset); - - pname = useshortnames ? X509_PURPOSE_get0_sname(purp) : X509_PURPOSE_get0_name(purp); - add_index_string(subsub, 2, pname, 1); - - /* NOTE: if purpset > 1 then it's a warning - we should mention it ? */ - - add_index_zval(subitem, id, subsub); - } - add_assoc_zval(return_value, "purposes", subitem); - - if (certresource == -1 && cert) { - X509_free(cert); - } -} -/* }}} */ - -/* {{{ load_all_certs_from_file */ -static STACK_OF(X509) * load_all_certs_from_file(char *certfile) -{ - STACK_OF(X509_INFO) *sk=NULL; - STACK_OF(X509) *stack=NULL, *ret=NULL; - BIO *in=NULL; - X509_INFO *xi; - TSRMLS_FETCH(); - - if(!(stack = sk_X509_new_null())) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure"); - goto end; - } - - if (php_openssl_safe_mode_chk(certfile TSRMLS_CC)) { - goto end; - } - - if(!(in=BIO_new_file(certfile, "r"))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening the file, %s", certfile); - goto end; - } - - /* This loads from a file, a stack of x509/crl/pkey sets */ - if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error reading the file, %s", certfile); - goto end; - } - - /* scan over it and pull out the certs */ - while (sk_X509_INFO_num(sk)) { - xi=sk_X509_INFO_shift(sk); - if (xi->x509 != NULL) { - sk_X509_push(stack,xi->x509); - xi->x509=NULL; - } - X509_INFO_free(xi); - } - if(!sk_X509_num(stack)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no certificates in file, %s", certfile); - sk_X509_free(stack); - goto end; - } - ret=stack; -end: - BIO_free(in); - sk_X509_INFO_free(sk); - - return ret; -} -/* }}} */ - -/* {{{ check_cert */ -static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain, int purpose) -{ - int ret=0; - X509_STORE_CTX *csc; - TSRMLS_FETCH(); - - csc = X509_STORE_CTX_new(); - if (csc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure"); - return 0; - } - X509_STORE_CTX_init(csc, ctx, x, untrustedchain); - - if(purpose >= 0) { - X509_STORE_CTX_set_purpose(csc, purpose); - } - ret = X509_verify_cert(csc); - X509_STORE_CTX_free(csc); - - return ret; -} -/* }}} */ - -/* {{{ proto int openssl_x509_checkpurpose(mixed x509cert, int purpose, array cainfo [, string untrustedfile]) - Checks the CERT to see if it can be used for the purpose in purpose. cainfo holds information about trusted CAs */ -PHP_FUNCTION(openssl_x509_checkpurpose) -{ - zval * zcert, * zcainfo = NULL; - X509_STORE * cainfo = NULL; - X509 * cert = NULL; - long certresource = -1; - STACK_OF(X509) * untrustedchain = NULL; - long purpose; - char * untrusted = NULL; - int untrusted_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) - == FAILURE) { - return; - } - - RETVAL_LONG(-1); - - if (untrusted) { - untrustedchain = load_all_certs_from_file(untrusted); - if (untrustedchain == NULL) { - goto clean_exit; - } - } - - cainfo = setup_verify(zcainfo TSRMLS_CC); - if (cainfo == NULL) { - goto clean_exit; - } - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - goto clean_exit; - } - RETVAL_LONG(check_cert(cainfo, cert, untrustedchain, purpose)); - -clean_exit: - if (certresource == 1 && cert) { - X509_free(cert); - } - if (cainfo) { - X509_STORE_free(cainfo); - } - if (untrustedchain) { - sk_X509_pop_free(untrustedchain, X509_free); - } -} -/* }}} */ - -/* {{{ setup_verify - * calist is an array containing file and directory names. create a - * certificate store and add those certs to it for use in verification. -*/ -static X509_STORE * setup_verify(zval * calist TSRMLS_DC) -{ - X509_STORE *store; - X509_LOOKUP * dir_lookup, * file_lookup; - HashPosition pos; - int ndirs = 0, nfiles = 0; - - store = X509_STORE_new(); - - if (store == NULL) { - return NULL; - } - - if (calist && (Z_TYPE_P(calist) == IS_ARRAY)) { - zend_hash_internal_pointer_reset_ex(HASH_OF(calist), &pos); - for (;; zend_hash_move_forward_ex(HASH_OF(calist), &pos)) { - zval ** item; - struct stat sb; - - if (zend_hash_get_current_data_ex(HASH_OF(calist), (void**)&item, &pos) == FAILURE) { - break; - } - convert_to_string_ex(item); - - if (VCWD_STAT(Z_STRVAL_PP(item), &sb) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to stat %s", Z_STRVAL_PP(item)); - continue; - } - - if ((sb.st_mode & S_IFREG) == S_IFREG) { - file_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); - if (file_lookup == NULL || !X509_LOOKUP_load_file(file_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PEM)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading file %s", Z_STRVAL_PP(item)); - } else { - nfiles++; - } - file_lookup = NULL; - } else { - dir_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); - if (dir_lookup == NULL || !X509_LOOKUP_add_dir(dir_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PEM)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading directory %s", Z_STRVAL_PP(item)); - } else { - ndirs++; - } - dir_lookup = NULL; - } - } - } - if (nfiles == 0) { - file_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); - if (file_lookup) { - X509_LOOKUP_load_file(file_lookup, NULL, X509_FILETYPE_DEFAULT); - } - } - if (ndirs == 0) { - dir_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); - if (dir_lookup) { - X509_LOOKUP_add_dir(dir_lookup, NULL, X509_FILETYPE_DEFAULT); - } - } - return store; -} -/* }}} */ - -/* {{{ proto resource openssl_x509_read(mixed cert) - Reads X.509 certificates */ -PHP_FUNCTION(openssl_x509_read) -{ - zval *cert; - X509 *x509; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) { - return; - } - Z_TYPE_P(return_value) = IS_RESOURCE; - x509 = php_openssl_x509_from_zval(&cert, 1, &Z_LVAL_P(return_value) TSRMLS_CC); - - if (x509 == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied parameter cannot be coerced into an X509 certificate!"); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void openssl_x509_free(resource x509) - Frees X.509 certificates */ -PHP_FUNCTION(openssl_x509_free) -{ - zval *x509; - X509 *cert; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &x509) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(cert, X509 *, &x509, -1, "OpenSSL X.509", le_x509); - zend_list_delete(Z_LVAL_P(x509)); -} -/* }}} */ - -/* }}} */ - -/* {{{ x509 CSR functions */ - -/* {{{ php_openssl_make_REQ */ -static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs TSRMLS_DC) -{ - STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL; - char * str, *dn_sect, *attr_sect; - - dn_sect = CONF_get_string(req->req_config, req->section_name, "distinguished_name"); - if (dn_sect == NULL) { - return FAILURE; - } - dn_sk = CONF_get_section(req->req_config, dn_sect); - if (dn_sk == NULL) { - return FAILURE; - } - attr_sect = CONF_get_string(req->req_config, req->section_name, "attributes"); - if (attr_sect == NULL) { - attr_sk = NULL; - } else { - attr_sk = CONF_get_section(req->req_config, attr_sect); - if (attr_sk == NULL) { - return FAILURE; - } - } - /* setup the version number: version 1 */ - if (X509_REQ_set_version(csr, 0L)) { - int i, nid; - char * type; - CONF_VALUE * v; - X509_NAME * subj; - HashPosition hpos; - zval ** item; - - subj = X509_REQ_get_subject_name(csr); - /* apply values from the dn hash */ - zend_hash_internal_pointer_reset_ex(HASH_OF(dn), &hpos); - while(zend_hash_get_current_data_ex(HASH_OF(dn), (void**)&item, &hpos) == SUCCESS) { - char * strindex; int strindexlen; - long intindex; - - zend_hash_get_current_key_ex(HASH_OF(dn), &strindex, &strindexlen, &intindex, 0, &hpos); - - convert_to_string_ex(item); - - if (strindex) { - int nid; - - nid = OBJ_txt2nid(strindex); - if (nid != NID_undef) { - if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_ASC, - (unsigned char*)Z_STRVAL_PP(item), -1, -1, 0)) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_PP(item)); - return FAILURE; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex); - } - } - zend_hash_move_forward_ex(HASH_OF(dn), &hpos); - } - - /* Finally apply defaults from config file */ - for(i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) { - int len; - char buffer[200]; - - v = sk_CONF_VALUE_value(dn_sk, i); - type = v->name; - - len = strlen(type); - if (len < sizeof("_default")) { - continue; - } - len -= sizeof("_default") - 1; - if (strcmp("_default", type + len) != 0) { - continue; - } - - memcpy(buffer, type, len); - buffer[len] = '\0'; - type = buffer; - - /* Skip past any leading X. X: X, etc to allow for multiple - * instances */ - for (str = type; *str; str++) { - if (*str == ':' || *str == ',' || *str == '.') { - str++; - if (*str) { - type = str; - } - break; - } - } - /* if it is already set, skip this */ - nid = OBJ_txt2nid(type); - if (X509_NAME_get_index_by_NID(subj, nid, -1) >= 0) { - continue; - } - if (!X509_NAME_add_entry_by_txt(subj, type, MBSTRING_ASC, (unsigned char*)v->value, -1, -1, 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value); - return FAILURE; - } - if (!X509_NAME_entry_count(subj)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no objects specified in config file"); - return FAILURE; - } - } - if (attribs) { - zend_hash_internal_pointer_reset_ex(HASH_OF(attribs), &hpos); - while(zend_hash_get_current_data_ex(HASH_OF(attribs), (void**)&item, &hpos) == SUCCESS) { - char * strindex; int strindexlen; - long intindex; - - zend_hash_get_current_key_ex(HASH_OF(attribs), &strindex, &strindexlen, &intindex, 0, &hpos); - convert_to_string_ex(item); - - if (strindex) { - int nid; - - nid = OBJ_txt2nid(strindex); - if (nid != NID_undef) { - if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_ASC, (unsigned char*)Z_STRVAL_PP(item), -1, -1, 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_PP(item)); - return FAILURE; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex); - } - } - zend_hash_move_forward_ex(HASH_OF(attribs), &hpos); - } - for (i = 0; i < sk_CONF_VALUE_num(attr_sk); i++) { - v = sk_CONF_VALUE_value(attr_sk, i); - /* if it is already set, skip this */ - nid = OBJ_txt2nid(v->name); - if (X509_REQ_get_attr_by_NID(csr, nid, -1) >= 0) { - continue; - } - if (!X509_REQ_add1_attr_by_txt(csr, v->name, MBSTRING_ASC, (unsigned char*)v->value, -1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "add1_attr_by_txt %s -> %s (failed)", v->name, v->value); - return FAILURE; - } - } - } - } - - X509_REQ_set_pubkey(csr, req->priv_key); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_openssl_csr_from_zval */ -static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long * resourceval TSRMLS_DC) -{ - X509_REQ * csr = NULL; - char * filename = NULL; - BIO * in; - - if (resourceval) { - *resourceval = -1; - } - if (Z_TYPE_PP(val) == IS_RESOURCE) { - void * what; - int type; - - what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509 CSR", &type, 1, le_csr); - if (what) { - if (resourceval) { - *resourceval = Z_LVAL_PP(val); - } - return (X509_REQ*)what; - } - return NULL; - } else if (Z_TYPE_PP(val) != IS_STRING) { - return NULL; - } - - if (Z_STRLEN_PP(val) > 7 && memcmp(Z_STRVAL_PP(val), "file://", sizeof("file://") - 1) == 0) { - filename = Z_STRVAL_PP(val) + (sizeof("file://") - 1); - } - if (filename) { - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - return NULL; - } - in = BIO_new_file(filename, "r"); - } else { - in = BIO_new_mem_buf(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - } - csr = PEM_read_bio_X509_REQ(in, NULL,NULL,NULL); - BIO_free(in); - - return csr; -} -/* }}} */ - -/* {{{ proto bool openssl_csr_export_to_file(resource csr, string outfilename [, bool notext=true]) - Exports a CSR to file */ -PHP_FUNCTION(openssl_csr_export_to_file) -{ - X509_REQ * csr; - zval * zcsr = NULL; - zend_bool notext = 1; - char * filename = NULL; int filename_len; - BIO * bio_out; - long csr_resource; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcsr, &filename, &filename_len, ¬ext) == FAILURE) { - return; - } - RETVAL_FALSE; - - csr = php_openssl_csr_from_zval(&zcsr, 0, &csr_resource TSRMLS_CC); - if (csr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); - return; - } - - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - return; - } - - bio_out = BIO_new_file(filename, "w"); - if (bio_out) { - if (!notext) { - X509_REQ_print(bio_out, csr); - } - PEM_write_bio_X509_REQ(bio_out, csr); - RETVAL_TRUE; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename); - } - - if (csr_resource == -1 && csr) { - X509_REQ_free(csr); - } - BIO_free(bio_out); -} -/* }}} */ - - - -/* {{{ proto bool openssl_csr_export(resource csr, string &out [, bool notext=true]) - Exports a CSR to file or a var */ -PHP_FUNCTION(openssl_csr_export) -{ - X509_REQ * csr; - zval * zcsr = NULL, *zout=NULL; - zend_bool notext = 1; - BIO * bio_out; - long csr_resource; - char * bio_mem_ptr; - long bio_mem_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|b", &zcsr, &zout, ¬ext) == FAILURE) { - return; - } - RETVAL_FALSE; - - csr = php_openssl_csr_from_zval(&zcsr, 0, &csr_resource TSRMLS_CC); - if (csr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); - return; - } - - /* export to a var */ - - bio_out = BIO_new(BIO_s_mem()); - if (!notext) { - X509_REQ_print(bio_out, csr); - } - PEM_write_bio_X509_REQ(bio_out, csr); - - bio_mem_len = BIO_get_mem_data(bio_out, &bio_mem_ptr); - ZVAL_STRINGL(zout, bio_mem_ptr, bio_mem_len, 1); - - RETVAL_TRUE; - - if (csr_resource == -1 && csr) { - X509_REQ_free(csr); - } - BIO_free(bio_out); -} -/* }}} */ - -/* {{{ proto resource openssl_csr_sign(mixed csr, mixed x509, mixed priv_key, long days [, array config_args [, long serial]]) - Signs a cert with another CERT */ -PHP_FUNCTION(openssl_csr_sign) -{ - zval * zcert = NULL, *zcsr, *zpkey, *args = NULL; - long num_days; - long serial = 0L; - X509 * cert = NULL, *new_cert = NULL; - X509_REQ * csr; - EVP_PKEY * key = NULL, *priv_key = NULL; - long csr_resource, certresource, keyresource; - int i; - struct php_x509_request req; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz!zl|a!l", &zcsr, &zcert, &zpkey, &num_days, &args, &serial) == FAILURE) - return; - - RETVAL_FALSE; - PHP_SSL_REQ_INIT(&req); - - csr = php_openssl_csr_from_zval(&zcsr, 0, &csr_resource TSRMLS_CC); - if (csr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); - return; - } - if (zcert) { - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 2"); - goto cleanup; - } - } - priv_key = php_openssl_evp_from_zval(&zpkey, 0, "", 1, &keyresource TSRMLS_CC); - if (priv_key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3"); - goto cleanup; - } - if (cert && !X509_check_private_key(cert, priv_key)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to signing cert"); - goto cleanup; - } - - if (PHP_SSL_REQ_PARSE(&req, args) == FAILURE) { - goto cleanup; - } - /* Check that the request matches the signature */ - key = X509_REQ_get_pubkey(csr); - if (key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error unpacking public key"); - goto cleanup; - } - i = X509_REQ_verify(csr, key); - - if (i < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature verification problems"); - goto cleanup; - } - else if (i == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature did not match the certificate request"); - goto cleanup; - } - - /* Now we can get on with it */ - - new_cert = X509_new(); - if (new_cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory"); - goto cleanup; - } - /* Version 3 cert */ - if (!X509_set_version(new_cert, 2)) - goto cleanup; - - ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial); - - X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr)); - - if (cert == NULL) { - cert = new_cert; - } - if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { - goto cleanup; - } - X509_gmtime_adj(X509_get_notBefore(new_cert), 0); - X509_gmtime_adj(X509_get_notAfter(new_cert), (long)60*60*24*num_days); - i = X509_set_pubkey(new_cert, key); - if (!i) { - goto cleanup; - } - if (req.request_extensions_section) { - X509V3_CTX ctx; - - X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); - X509V3_set_conf_lhash(&ctx, req.req_config); - if (!X509V3_EXT_add_conf(req.req_config, &ctx, req.request_extensions_section, new_cert)) { - goto cleanup; - } - } - - /* Now sign it */ - if (!X509_sign(new_cert, priv_key, req.digest)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to sign it"); - goto cleanup; - } - - /* Succeeded; lets return the cert */ - RETVAL_RESOURCE(zend_list_insert(new_cert, le_x509)); - new_cert = NULL; - -cleanup: - - if (cert == new_cert) { - cert = NULL; - } - PHP_SSL_REQ_DISPOSE(&req); - - if (keyresource == -1 && priv_key) { - EVP_PKEY_free(priv_key); - } - if (key) { - EVP_PKEY_free(key); - } - if (csr_resource == -1 && csr) { - X509_REQ_free(csr); - } - if (certresource == -1 && cert) { - X509_free(cert); - } - if (new_cert) { - X509_free(new_cert); - } -} -/* }}} */ - -/* {{{ proto bool openssl_csr_new(array dn, resource &privkey [, array configargs, array extraattribs]) - Generates a privkey and CSR */ -PHP_FUNCTION(openssl_csr_new) -{ - struct php_x509_request req; - zval * args = NULL, * dn, *attribs = NULL; - zval * out_pkey; - X509_REQ * csr = NULL; - int we_made_the_key = 1; - long key_resource; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) { - return; - } - RETVAL_FALSE; - - PHP_SSL_REQ_INIT(&req); - - if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) { - /* Generate or use a private key */ - if (Z_TYPE_P(out_pkey) != IS_NULL) { - req.priv_key = php_openssl_evp_from_zval(&out_pkey, 0, NULL, 0, &key_resource TSRMLS_CC); - if (req.priv_key != NULL) { - we_made_the_key = 0; - } - } - if (req.priv_key == NULL) { - php_openssl_generate_private_key(&req TSRMLS_CC); - } - if (req.priv_key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to generate a private key"); - } else { - csr = X509_REQ_new(); - if (csr) { - if (php_openssl_make_REQ(&req, csr, dn, attribs TSRMLS_CC) == SUCCESS) { - X509V3_CTX ext_ctx; - - X509V3_set_ctx(&ext_ctx, NULL, NULL, csr, NULL, 0); - X509V3_set_conf_lhash(&ext_ctx, req.req_config); - - /* Add extensions */ - if (req.request_extensions_section && !X509V3_EXT_REQ_add_conf(req.req_config, - &ext_ctx, req.request_extensions_section, csr)) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading extension section %s", req.request_extensions_section); - } else { - RETVAL_TRUE; - - if (X509_REQ_sign(csr, req.priv_key, req.digest)) { - RETVAL_RESOURCE(zend_list_insert(csr, le_csr)); - csr = NULL; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request"); - } - - if (we_made_the_key) { - /* and a resource for the private key */ - ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key)); - req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ - } else if (key_resource != -1) { - req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ - } - } - } - else { - if (!we_made_the_key) { - /* if we have not made the key we are not supposed to zap it by calling dispose! */ - req.priv_key = NULL; - } - } - } - } - } - if (csr) { - X509_REQ_free(csr); - } - PHP_SSL_REQ_DISPOSE(&req); -} -/* }}} */ - -/* }}} */ - -/* {{{ EVP Public/Private key functions */ - -/* {{{ php_openssl_evp_from_zval - Given a zval, coerce it into a EVP_PKEY object. - It can be: - 1. private key resource from openssl_get_privatekey() - 2. X509 resource -> public key will be extracted from it - 3. if it starts with file:// interpreted as path to key file - 4. interpreted as the data from the cert/key file and interpreted in same way as openssl_get_privatekey() - 5. an array(0 => [items 2..4], 1 => passphrase) - 6. if val is a string (possibly starting with file:///) and it is not an X509 certificate, then interpret as public key - NOTE: If you are requesting a private key but have not specified a passphrase, you should use an - empty string rather than NULL for the passphrase - NULL causes a passphrase prompt to be emitted in - the Apache error log! -*/ -static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC) -{ - EVP_PKEY * key = NULL; - X509 * cert = NULL; - int free_cert = 0; - long cert_res = -1; - char * filename = NULL; - - if (resourceval) { - *resourceval = -1; - } - if (Z_TYPE_PP(val) == IS_ARRAY) { - zval ** zphrase; - - /* get passphrase */ - - if (zend_hash_index_find(HASH_OF(*val), 1, (void **)&zphrase) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)"); - return NULL; - } - convert_to_string_ex(zphrase); - passphrase = Z_STRVAL_PP(zphrase); - - /* now set val to be the key param and continue */ - if (zend_hash_index_find(HASH_OF(*val), 0, (void **)&val) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)"); - return NULL; - } - } - - if (Z_TYPE_PP(val) == IS_RESOURCE) { - void * what; - int type; - - what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key); - if (!what) { - return NULL; - } - if (resourceval) { - *resourceval = Z_LVAL_PP(val); - } - if (type == le_x509) { - /* extract key from cert, depending on public_key param */ - cert = (X509*)what; - free_cert = 0; - } else if (type == le_key) { - int is_priv; - - is_priv = php_openssl_is_private_key((EVP_PKEY*)what TSRMLS_CC); - - /* check whether it is actually a private key if requested */ - if (!public_key && !is_priv) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param is a public key"); - return NULL; - } - - if (public_key && is_priv) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Don't know how to get public key from this private key"); - return NULL; - } else { - /* got the key - return it */ - return (EVP_PKEY*)what; - } - } - - /* other types could be used here - eg: file pointers and read in the data from them */ - - return NULL; - } else { - /* force it to be a string and check if it refers to a file */ - convert_to_string_ex(val); - - if (Z_STRLEN_PP(val) > 7 && memcmp(Z_STRVAL_PP(val), "file://", sizeof("file://") - 1) == 0) { - filename = Z_STRVAL_PP(val) + (sizeof("file://") - 1); - } - /* it's an X509 file/cert of some kind, and we need to extract the data from that */ - if (public_key) { - cert = php_openssl_x509_from_zval(val, 0, &cert_res TSRMLS_CC); - free_cert = (cert_res == -1); - /* actual extraction done later */ - if (!cert) { - /* not a X509 certificate, try to retrieve public key */ - BIO* in; - if (filename) { - in = BIO_new_file(filename, "r"); - } else { - in = BIO_new_mem_buf(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - } - if (in == NULL) { - return NULL; - } - key = PEM_read_bio_PUBKEY(in, NULL,NULL, NULL); - BIO_free(in); - } - } else { - /* we want the private key */ - BIO *in; - - if (filename) { - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - return NULL; - } - in = BIO_new_file(filename, "r"); - } else { - in = BIO_new_mem_buf(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - } - - if (in == NULL) { - return NULL; - } - key = PEM_read_bio_PrivateKey(in, NULL,NULL, passphrase); - BIO_free(in); - } - } - - if (public_key && cert && key == NULL) { - /* extract public key from X509 cert */ - key = (EVP_PKEY *) X509_get_pubkey(cert); - } - - if (free_cert && cert) { - X509_free(cert); - } - if (key && makeresource && resourceval) { - *resourceval = ZEND_REGISTER_RESOURCE(NULL, key, le_key); - } - return key; -} -/* }}} */ - -/* {{{ php_openssl_generate_private_key */ -static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC) -{ - char * randfile = NULL; - int egdsocket, seeded; - EVP_PKEY * return_val = NULL; - - if (req->priv_key_bits < MIN_KEY_LENGTH) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at least %d bits, not %d", - MIN_KEY_LENGTH, req->priv_key_bits); - return NULL; - } - - randfile = CONF_get_string(req->req_config, req->section_name, "RANDFILE"); - php_openssl_load_rand_file(randfile, &egdsocket, &seeded); - - if ((req->priv_key = EVP_PKEY_new()) != NULL) { - switch(req->priv_key_type) { - case OPENSSL_KEYTYPE_RSA: - if (EVP_PKEY_assign_RSA(req->priv_key, RSA_generate_key(req->priv_key_bits, 0x10001, NULL, NULL))) - return_val = req->priv_key; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported private key type"); - } - } - - php_openssl_write_rand_file(randfile, egdsocket, seeded); - - if (return_val == NULL) { - EVP_PKEY_free(req->priv_key); - req->priv_key = NULL; - return NULL; - } - - return return_val; -} -/* }}} */ - -/* {{{ php_openssl_is_private_key - Check whether the supplied key is a private key by checking if the secret prime factors are set */ -static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) -{ - assert(pkey != NULL); - - switch (pkey->type) { -#ifndef NO_RSA - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - assert(pkey->pkey.rsa != NULL); - - if (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q) { - return 0; - } - break; -#endif -#ifndef NO_DSA - case EVP_PKEY_DSA: - case EVP_PKEY_DSA1: - case EVP_PKEY_DSA2: - case EVP_PKEY_DSA3: - case EVP_PKEY_DSA4: - assert(pkey->pkey.dsa != NULL); - - if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key){ - return 0; - } - break; -#endif -#ifndef NO_DH - case EVP_PKEY_DH: - assert(pkey->pkey.dh != NULL); - - if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) { - return 0; - } - break; -#endif - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); - break; - } - return 1; -} -/* }}} */ - -/* {{{ proto resource openssl_pkey_new([array configargs]) - Generates a new private key */ -PHP_FUNCTION(openssl_pkey_new) -{ - struct php_x509_request req; - zval * args = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &args) == FAILURE) { - return; - } - RETVAL_FALSE; - - PHP_SSL_REQ_INIT(&req); - - if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) - { - if (php_openssl_generate_private_key(&req TSRMLS_CC)) { - /* pass back a key resource */ - RETVAL_RESOURCE(zend_list_insert(req.priv_key, le_key)); - /* make sure the cleanup code doesn't zap it! */ - req.priv_key = NULL; - } - } - PHP_SSL_REQ_DISPOSE(&req); -} -/* }}} */ - -/* {{{ proto bool openssl_pkey_export_to_file(mixed key, string outfilename [, string passphrase, array config_args) - Gets an exportable representation of a key into a file */ -PHP_FUNCTION(openssl_pkey_export_to_file) -{ - struct php_x509_request req; - zval * zpkey, * args = NULL; - char * passphrase = NULL; int passphrase_len = 0; - char * filename = NULL; int filename_len = 0; - long key_resource = -1; - EVP_PKEY * key; - BIO * bio_out = NULL; - const EVP_CIPHER * cipher; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) { - return; - } - RETVAL_FALSE; - - key = php_openssl_evp_from_zval(&zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC); - - if (key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1"); - RETURN_FALSE; - } - - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - RETURN_FALSE; - } - - PHP_SSL_REQ_INIT(&req); - - if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) { - bio_out = BIO_new_file(filename, "w"); - - if (passphrase && req.priv_key_encrypt) { - cipher = (EVP_CIPHER *) EVP_des_ede3_cbc(); - } else { - cipher = NULL; - } - if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) { - /* Success! - * If returning the output as a string, do so now */ - RETVAL_TRUE; - } - } - PHP_SSL_REQ_DISPOSE(&req); - - if (key_resource == -1 && key) { - EVP_PKEY_free(key); - } - if (bio_out) { - BIO_free(bio_out); - } -} -/* }}} */ - -/* {{{ proto bool openssl_pkey_export(mixed key, &mixed out [, string passphrase [, array config_args]]) - Gets an exportable representation of a key into a string or file */ -PHP_FUNCTION(openssl_pkey_export) -{ - struct php_x509_request req; - zval * zpkey, * args = NULL, *out; - char * passphrase = NULL; int passphrase_len = 0; - long key_resource = -1; - EVP_PKEY * key; - BIO * bio_out = NULL; - const EVP_CIPHER * cipher; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|s!a!", &zpkey, &out, &passphrase, &passphrase_len, &args) == FAILURE) { - return; - } - RETVAL_FALSE; - - key = php_openssl_evp_from_zval(&zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC); - - if (key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1"); - RETURN_FALSE; - } - - PHP_SSL_REQ_INIT(&req); - - if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) { - bio_out = BIO_new(BIO_s_mem()); - - if (passphrase && req.priv_key_encrypt) { - cipher = (EVP_CIPHER *) EVP_des_ede3_cbc(); - } else { - cipher = NULL; - } - if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) { - /* Success! - * If returning the output as a string, do so now */ - - char * bio_mem_ptr; - long bio_mem_len; - RETVAL_TRUE; - - bio_mem_len = BIO_get_mem_data(bio_out, &bio_mem_ptr); - ZVAL_STRINGL(out, bio_mem_ptr, bio_mem_len, 1); - } - } - PHP_SSL_REQ_DISPOSE(&req); - - if (key_resource == -1 && key) { - EVP_PKEY_free(key); - } - if (bio_out) { - BIO_free(bio_out); - } -} -/* }}} */ - -/* {{{ proto int openssl_pkey_get_public(mixed cert) - Gets public key from X.509 certificate */ -PHP_FUNCTION(openssl_pkey_get_public) -{ - zval *cert; - EVP_PKEY *pkey; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) { - return; - } - Z_TYPE_P(return_value) = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(&cert, 1, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC); - - if (pkey == NULL) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void openssl_pkey_free(int key) - Frees a key */ -PHP_FUNCTION(openssl_pkey_free) -{ - zval *key; - EVP_PKEY *pkey; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key); - zend_list_delete(Z_LVAL_P(key)); -} -/* }}} */ - -/* {{{ proto int openssl_pkey_get_private(string key [, string passphrase]) - Gets private keys */ -PHP_FUNCTION(openssl_pkey_get_private) -{ - zval *cert; - EVP_PKEY *pkey; - char * passphrase = ""; - int passphrase_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) { - return; - } - Z_TYPE_P(return_value) = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(&cert, 0, passphrase, 1, &Z_LVAL_P(return_value) TSRMLS_CC); - - if (pkey == NULL) { - RETURN_FALSE; - } -} - -/* }}} */ - -/* }}} */ - -/* {{{ PKCS7 S/MIME functions */ - -/* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]]) - Verifys that the data block is intact, the signer is who they say they are, and returns the CERTs of the signers */ -PHP_FUNCTION(openssl_pkcs7_verify) -{ - X509_STORE * store = NULL; - zval * cainfo = NULL; - STACK_OF(X509) *signers= NULL; - STACK_OF(X509) *others = NULL; - PKCS7 * p7 = NULL; - BIO * in = NULL, * datain = NULL, * dataout = NULL; - long flags = 0; - char * filename; int filename_len; - char * extracerts = NULL; int extracerts_len; - char * signersfilename = NULL; int signersfilename_len; - char * datafilename = NULL; int datafilename_len; - - RETVAL_LONG(-1); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|sass", &filename, &filename_len, - &flags, &signersfilename, &signersfilename_len, &cainfo, - &extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) { - return; - } - - if (extracerts) { - others = load_all_certs_from_file(extracerts); - if (others == NULL) { - goto clean_exit; - } - } - - flags = flags & ~PKCS7_DETACHED; - - store = setup_verify(cainfo TSRMLS_CC); - - if (!store) { - goto clean_exit; - } - if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) { - goto clean_exit; - } - - in = BIO_new_file(filename, (flags & PKCS7_BINARY) ? "rb" : "r"); - if (in == NULL) { - goto clean_exit; - } - p7 = SMIME_read_PKCS7(in, &datain); - if (p7 == NULL) { -#if DEBUG_SMIME - zend_printf("SMIME_read_PKCS7 failed\n"); -#endif - goto clean_exit; - } - - if (datafilename) { - - if (php_openssl_safe_mode_chk(datafilename TSRMLS_CC)) { - goto clean_exit; - } - - dataout = BIO_new_file(datafilename, "w"); - if (dataout == NULL) { - goto clean_exit; - } - } -#if DEBUG_SMIME - zend_printf("Calling PKCS7 verify\n"); -#endif - - if (PKCS7_verify(p7, others, store, datain, dataout, flags)) { - - RETVAL_TRUE; - - if (signersfilename) { - BIO *certout; - - if (php_openssl_safe_mode_chk(signersfilename TSRMLS_CC)) { - goto clean_exit; - } - - certout = BIO_new_file(signersfilename, "w"); - if (certout) { - int i; - signers = PKCS7_get0_signers(p7, NULL, flags); - - for(i = 0; i < sk_X509_num(signers); i++) { - PEM_write_bio_X509(certout, sk_X509_value(signers, i)); - } - BIO_free(certout); - sk_X509_free(signers); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "signature OK, but cannot open %s for writing", signersfilename); - RETVAL_LONG(-1); - } - } - goto clean_exit; - } else { - RETVAL_FALSE; - } -clean_exit: - X509_STORE_free(store); - BIO_free(datain); - BIO_free(in); - BIO_free(dataout); - PKCS7_free(p7); - sk_X509_free(others); -} -/* }}} */ - -/* {{{ proto bool openssl_pkcs7_encrypt(string infile, string outfile, mixed recipcerts, array headers [, long flags [, long cipher]]) - Encrypts the message in the file named infile with the certificates in recipcerts and output the result to the file named outfile */ -PHP_FUNCTION(openssl_pkcs7_encrypt) -{ - zval * zrecipcerts, * zheaders = NULL; - STACK_OF(X509) * recipcerts = NULL; - BIO * infile = NULL, * outfile = NULL; - long flags = 0; - PKCS7 * p7 = NULL; - HashPosition hpos; - zval ** zcertval; - X509 * cert; - const EVP_CIPHER *cipher = NULL; - long cipherid = PHP_OPENSSL_CIPHER_DEFAULT; - uint strindexlen; - ulong intindex; - char * strindex; - char * infilename = NULL; int infilename_len; - char * outfilename = NULL; int outfilename_len; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssza!|ll", &infilename, &infilename_len, - &outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE) - return; - - - if (php_openssl_safe_mode_chk(infilename TSRMLS_CC) || php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) { - return; - } - - infile = BIO_new_file(infilename, "r"); - if (infile == NULL) { - goto clean_exit; - } - - outfile = BIO_new_file(outfilename, "w"); - if (outfile == NULL) { - goto clean_exit; - } - - recipcerts = sk_X509_new_null(); - - /* get certs */ - if (Z_TYPE_P(zrecipcerts) == IS_ARRAY) { - zend_hash_internal_pointer_reset_ex(HASH_OF(zrecipcerts), &hpos); - while(zend_hash_get_current_data_ex(HASH_OF(zrecipcerts), (void**)&zcertval, &hpos) == SUCCESS) { - long certresource; - - cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - goto clean_exit; - } - - if (certresource != -1) { - /* we shouldn't free this particular cert, as it is a resource. - make a copy and push that on the stack instead */ - cert = X509_dup(cert); - if (cert == NULL) { - goto clean_exit; - } - } - sk_X509_push(recipcerts, cert); - - zend_hash_move_forward_ex(HASH_OF(zrecipcerts), &hpos); - } - } else { - /* a single certificate */ - long certresource; - - cert = php_openssl_x509_from_zval(&zrecipcerts, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - goto clean_exit; - } - - if (certresource != -1) { - /* we shouldn't free this particular cert, as it is a resource. - make a copy and push that on the stack instead */ - cert = X509_dup(cert); - if (cert == NULL) { - goto clean_exit; - } - } - sk_X509_push(recipcerts, cert); - } - - /* sanity check the cipher */ - switch (cipherid) { - case PHP_OPENSSL_CIPHER_RC2_40: - cipher = EVP_rc2_40_cbc(); - break; - case PHP_OPENSSL_CIPHER_RC2_64: - cipher = EVP_rc2_64_cbc(); - break; - case PHP_OPENSSL_CIPHER_RC2_128: - cipher = EVP_rc2_cbc(); - break; - case PHP_OPENSSL_CIPHER_DES: - cipher = EVP_des_cbc(); - break; - case PHP_OPENSSL_CIPHER_3DES: - cipher = EVP_des_ede3_cbc(); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid cipher type `%ld'", cipherid); - goto clean_exit; - } - if (cipher == NULL) { - /* shouldn't happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get cipher"); - goto clean_exit; - } - - p7 = PKCS7_encrypt(recipcerts, infile, (EVP_CIPHER*)cipher, flags); - - if (p7 == NULL) { - goto clean_exit; - } - - /* tack on extra headers */ - if (zheaders) { - zend_hash_internal_pointer_reset_ex(HASH_OF(zheaders), &hpos); - while(zend_hash_get_current_data_ex(HASH_OF(zheaders), (void**)&zcertval, &hpos) == SUCCESS) { - zend_hash_get_current_key_ex(HASH_OF(zheaders), &strindex, &strindexlen, &intindex, 0, &hpos); - - convert_to_string_ex(zcertval); - - if (strindex) { - BIO_printf(outfile, "%s: %s\n", strindex, Z_STRVAL_PP(zcertval)); - } else { - BIO_printf(outfile, "%s\n", Z_STRVAL_PP(zcertval)); - } - - zend_hash_move_forward_ex(HASH_OF(zheaders), &hpos); - } - } - - BIO_reset(infile); - - /* write the encrypted data */ - SMIME_write_PKCS7(outfile, p7, infile, flags); - - RETVAL_TRUE; - -clean_exit: - PKCS7_free(p7); - BIO_free(infile); - BIO_free(outfile); - if (recipcerts) { - sk_X509_pop_free(recipcerts, X509_free); - } -} -/* }}} */ - -/* {{{ proto bool openssl_pkcs7_sign(string infile, string outfile, mixed signcert, mixed signkey, array headers [, long flags [, string extracertsfilename]]) - Signs the MIME message in the file named infile with signcert/signkey and output the result to file name outfile. headers lists plain text headers to exclude from the signed portion of the message, and should include to, from and subject as a minimum */ - -PHP_FUNCTION(openssl_pkcs7_sign) -{ - zval * zcert, * zprivkey, * zheaders; - zval ** hval; - X509 * cert = NULL; - EVP_PKEY * privkey = NULL; - long flags = PKCS7_DETACHED; - PKCS7 * p7 = NULL; - BIO * infile = NULL, * outfile = NULL; - STACK_OF(X509) *others = NULL; - long certresource = -1, keyresource = -1; - ulong intindex; - uint strindexlen; - HashPosition hpos; - char * strindex; - char * infilename; int infilename_len; - char * outfilename; int outfilename_len; - char * extracertsfilename = NULL; int extracertsfilename_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sszza!|ls", - &infilename, &infilename_len, &outfilename, &outfilename_len, - &zcert, &zprivkey, &zheaders, &flags, &extracertsfilename, - &extracertsfilename_len) == FAILURE) { - return; - } - - RETVAL_FALSE; - - if (extracertsfilename) { - others = load_all_certs_from_file(extracertsfilename); - if (others == NULL) { - goto clean_exit; - } - } - - privkey = php_openssl_evp_from_zval(&zprivkey, 0, "", 0, &keyresource TSRMLS_CC); - if (privkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting private key"); - goto clean_exit; - } - - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); - if (cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting cert"); - goto clean_exit; - } - - if (php_openssl_safe_mode_chk(infilename TSRMLS_CC) || php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) { - goto clean_exit; - } - - infile = BIO_new_file(infilename, "r"); - if (infile == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening input file %s!", infilename); - goto clean_exit; - } - - outfile = BIO_new_file(outfilename, "w"); - if (outfile == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening output file %s!", outfilename); - goto clean_exit; - } - - p7 = PKCS7_sign(cert, privkey, others, infile, flags); - if (p7 == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error creating PKCS7 structure!"); - goto clean_exit; - } - - BIO_reset(infile); - - /* tack on extra headers */ - if (zheaders) { - zend_hash_internal_pointer_reset_ex(HASH_OF(zheaders), &hpos); - while(zend_hash_get_current_data_ex(HASH_OF(zheaders), (void**)&hval, &hpos) == SUCCESS) { - zend_hash_get_current_key_ex(HASH_OF(zheaders), &strindex, &strindexlen, &intindex, 0, &hpos); - - convert_to_string_ex(hval); - - if (strindex) { - BIO_printf(outfile, "%s: %s\n", strindex, Z_STRVAL_PP(hval)); - } else { - BIO_printf(outfile, "%s\n", Z_STRVAL_PP(hval)); - } - zend_hash_move_forward_ex(HASH_OF(zheaders), &hpos); - } - } - /* write the signed data */ - SMIME_write_PKCS7(outfile, p7, infile, flags); - - RETVAL_TRUE; - -clean_exit: - PKCS7_free(p7); - BIO_free(infile); - BIO_free(outfile); - if (others) { - sk_X509_pop_free(others, X509_free); - } - if (privkey && keyresource == -1) { - EVP_PKEY_free(privkey); - } - if (cert && certresource == -1) { - X509_free(cert); - } -} -/* }}} */ - -/* {{{ proto bool openssl_pkcs7_decrypt(string infilename, string outfilename, mixed recipcert [, mixed recipkey]) - Decrypts the S/MIME message in the file name infilename and output the results to the file name outfilename. recipcert is a CERT for one of the recipients. recipkey specifies the private key matching recipcert, if recipcert does not include the key */ - -PHP_FUNCTION(openssl_pkcs7_decrypt) -{ - zval * recipcert, * recipkey = NULL; - X509 * cert = NULL; - EVP_PKEY * key = NULL; - long certresval, keyresval; - BIO * in = NULL, * out = NULL, * datain = NULL; - PKCS7 * p7 = NULL; - char * infilename; int infilename_len; - char * outfilename; int outfilename_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &infilename, &infilename_len, - &outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) { - return; - } - - RETVAL_FALSE; - - cert = php_openssl_x509_from_zval(&recipcert, 0, &certresval TSRMLS_CC); - if (cert == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 3 to x509 cert"); - goto clean_exit; - } - - key = php_openssl_evp_from_zval(recipkey ? &recipkey : &recipcert, 0, "", 0, &keyresval TSRMLS_CC); - if (key == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get private key"); - goto clean_exit; - } - - if (php_openssl_safe_mode_chk(infilename TSRMLS_CC) || php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) { - goto clean_exit; - } - - in = BIO_new_file(infilename, "r"); - if (in == NULL) { - goto clean_exit; - } - out = BIO_new_file(outfilename, "w"); - if (out == NULL) { - goto clean_exit; - } - - p7 = SMIME_read_PKCS7(in, &datain); - - if (p7 == NULL) { - goto clean_exit; - } - if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { - RETVAL_TRUE; - } -clean_exit: - PKCS7_free(p7); - BIO_free(datain); - BIO_free(in); - BIO_free(out); - if (cert && certresval == -1) { - X509_free(cert); - } - if (key && keyresval == -1) { - EVP_PKEY_free(key); - } -} -/* }}} */ - -/* }}} */ - -/* {{{ proto bool openssl_private_encrypt(string data, string crypted, mixed key [, int padding]) - Encrypts data with private key */ -PHP_FUNCTION(openssl_private_encrypt) -{ - zval *key, *crypted; - EVP_PKEY *pkey; - int cryptedlen; - unsigned char *cryptedbuf = NULL; - int successful = 0; - long keyresource = -1; - char * data; - int data_len; - long padding = RSA_PKCS1_PADDING; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) { - return; - } - RETVAL_FALSE; - - pkey = php_openssl_evp_from_zval(&key, 0, "", 0, &keyresource TSRMLS_CC); - - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key param is not a valid private key"); - RETURN_FALSE; - } - - cryptedlen = EVP_PKEY_size(pkey); - cryptedbuf = emalloc(cryptedlen + 1); - - switch (pkey->type) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - successful = (RSA_private_encrypt(data_len, - data, - cryptedbuf, - pkey->pkey.rsa, - padding) == cryptedlen); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); - } - - if (successful) { - zval_dtor(crypted); - cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); - cryptedbuf = NULL; - RETVAL_TRUE; - } - if (cryptedbuf) { - efree(cryptedbuf); - } - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } -} -/* }}} */ - -/* {{{ proto bool openssl_private_decrypt(string data, string decrypted, mixed key [, int padding]) - Decrypts data with private key */ -PHP_FUNCTION(openssl_private_decrypt) -{ - zval *key, *crypted; - EVP_PKEY *pkey; - int cryptedlen; - unsigned char *cryptedbuf = NULL; - unsigned char *crypttemp; - int successful = 0; - long padding = RSA_PKCS1_PADDING; - long keyresource = -1; - char * data; - int data_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) { - return; - } - RETVAL_FALSE; - - pkey = php_openssl_evp_from_zval(&key, 0, "", 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid private key"); - RETURN_FALSE; - } - - cryptedlen = EVP_PKEY_size(pkey); - crypttemp = emalloc(cryptedlen + 1); - - switch (pkey->type) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - cryptedlen = RSA_private_decrypt(data_len, - data, - crypttemp, - pkey->pkey.rsa, - padding); - if (cryptedlen != -1) { - cryptedbuf = emalloc(cryptedlen + 1); - memcpy(cryptedbuf, crypttemp, cryptedlen); - successful = 1; - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); - } - - efree(crypttemp); - - if (successful) { - zval_dtor(crypted); - cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); - cryptedbuf = NULL; - RETVAL_TRUE; - } - - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - if (cryptedbuf) { - efree(cryptedbuf); - } -} -/* }}} */ - -/* {{{ proto bool openssl_public_encrypt(string data, string crypted, mixed key [, int padding]) - Encrypts data with public key */ -PHP_FUNCTION(openssl_public_encrypt) -{ - zval *key, *crypted; - EVP_PKEY *pkey; - int cryptedlen; - unsigned char *cryptedbuf; - int successful = 0; - long keyresource = -1; - long padding = RSA_PKCS1_PADDING; - char * data; - int data_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) - return; - - RETVAL_FALSE; - - pkey = php_openssl_evp_from_zval(&key, 1, NULL, 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key"); - RETURN_FALSE; - } - - cryptedlen = EVP_PKEY_size(pkey); - cryptedbuf = emalloc(cryptedlen + 1); - - switch (pkey->type) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - successful = (RSA_public_encrypt(data_len, - data, - cryptedbuf, - pkey->pkey.rsa, - padding) == cryptedlen); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); - - } - - if (successful) { - zval_dtor(crypted); - cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); - cryptedbuf = NULL; - RETVAL_TRUE; - } - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - if (cryptedbuf) { - efree(cryptedbuf); - } -} -/* }}} */ - -/* {{{ proto bool openssl_public_decrypt(string data, string crypted, resource key [, int padding]) - Decrypts data with public key */ -PHP_FUNCTION(openssl_public_decrypt) -{ - zval *key, *crypted; - EVP_PKEY *pkey; - int cryptedlen; - unsigned char *cryptedbuf = NULL; - unsigned char *crypttemp; - int successful = 0; - long keyresource = -1; - long padding = RSA_PKCS1_PADDING; - char * data; - int data_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) { - return; - } - RETVAL_FALSE; - - pkey = php_openssl_evp_from_zval(&key, 1, NULL, 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key"); - RETURN_FALSE; - } - - cryptedlen = EVP_PKEY_size(pkey); - crypttemp = emalloc(cryptedlen + 1); - - switch (pkey->type) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - cryptedlen = RSA_public_decrypt(data_len, - data, - crypttemp, - pkey->pkey.rsa, - padding); - if (cryptedlen != -1) { - cryptedbuf = emalloc(cryptedlen + 1); - memcpy(cryptedbuf, crypttemp, cryptedlen); - successful = 1; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); - - } - - efree(crypttemp); - - if (successful) { - zval_dtor(crypted); - cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); - cryptedbuf = NULL; - RETVAL_TRUE; - } - - if (cryptedbuf) { - efree(cryptedbuf); - } - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } -} -/* }}} */ - -/* {{{ proto mixed openssl_error_string(void) - Returns a description of the last error, and alters the index of the error messages. Returns false when the are no more messages */ -PHP_FUNCTION(openssl_error_string) -{ - char buf[512]; - unsigned long val; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - val = ERR_get_error(); - if (val) { - RETURN_STRING(ERR_error_string(val, buf), 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool openssl_sign(string data, &string signature, mixed key) - Signs data */ -PHP_FUNCTION(openssl_sign) -{ - zval *key, *signature; - EVP_PKEY *pkey; - int siglen; - unsigned char *sigbuf; - long keyresource = -1; - char * data; - int data_len; - EVP_MD_CTX md_ctx; - long signature_algo = OPENSSL_ALGO_SHA1; - EVP_MD *mdtype; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &signature, &key, &signature_algo) == FAILURE) { - return; - } - pkey = php_openssl_evp_from_zval(&key, 0, "", 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a private key"); - RETURN_FALSE; - } - - switch (signature_algo) { - case OPENSSL_ALGO_SHA1: - mdtype = (EVP_MD *) EVP_sha1(); - break; - case OPENSSL_ALGO_MD5: - mdtype = (EVP_MD *) EVP_md5(); - break; - case OPENSSL_ALGO_MD4: - mdtype = (EVP_MD *) EVP_md4(); - break; - case OPENSSL_ALGO_MD2: - mdtype = (EVP_MD *) EVP_md2(); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); - RETURN_FALSE; - break; - } - - siglen = EVP_PKEY_size(pkey); - sigbuf = emalloc(siglen + 1); - - EVP_SignInit(&md_ctx, mdtype); - EVP_SignUpdate(&md_ctx, data, data_len); - if (EVP_SignFinal (&md_ctx, sigbuf, &siglen, pkey)) { - zval_dtor(signature); - sigbuf[siglen] = '\0'; - ZVAL_STRINGL(signature, sigbuf, siglen, 0); - RETVAL_TRUE; - } else { - efree(sigbuf); - RETVAL_FALSE; - } - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } -} -/* }}} */ - -/* {{{ proto int openssl_verify(string data, string signature, mixed key) - Verifys data */ -PHP_FUNCTION(openssl_verify) -{ - zval *key; - EVP_PKEY *pkey; - int err; - EVP_MD_CTX md_ctx; - long keyresource = -1; - char * data; int data_len; - char * signature; int signature_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz", &data, &data_len, &signature, &signature_len, &key) == FAILURE) { - return; - } - - pkey = php_openssl_evp_from_zval(&key, 1, NULL, 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a public key"); - RETURN_FALSE; - } - - EVP_VerifyInit (&md_ctx, EVP_sha1()); - EVP_VerifyUpdate (&md_ctx, data, data_len); - err = EVP_VerifyFinal (&md_ctx, signature, signature_len, pkey); - - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - RETURN_LONG(err); -} -/* }}} */ - -/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys) - Seals data */ -PHP_FUNCTION(openssl_seal) -{ - zval *pubkeys, **pubkey, *sealdata, *ekeys; - HashTable *pubkeysht; - HashPosition pos; - EVP_PKEY **pkeys; - long * key_resources; /* so we know what to cleanup */ - int i, len1, len2, *eksl, nkeys; - unsigned char *buf = NULL, **eks; - char * data; int data_len; - EVP_CIPHER_CTX ctx; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szza/", &data, &data_len, &sealdata, &ekeys, &pubkeys) == FAILURE) { - return; - } - - pubkeysht = HASH_OF(pubkeys); - nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0; - if (!nkeys) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array"); - RETURN_FALSE; - } - - pkeys = safe_emalloc(nkeys, sizeof(*pkeys), 0); - eksl = safe_emalloc(nkeys, sizeof(*eksl), 0); - eks = safe_emalloc(nkeys, sizeof(*eks), 0); - key_resources = safe_emalloc(nkeys, sizeof(long), 0); - - /* get the public keys we are using to seal this data */ - zend_hash_internal_pointer_reset_ex(pubkeysht, &pos); - i = 0; - while (zend_hash_get_current_data_ex(pubkeysht, (void **) &pubkey, - &pos) == SUCCESS) { - pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i] TSRMLS_CC); - if (pkeys[i] == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a public key (%dth member of pubkeys)", i); - RETVAL_FALSE; - goto clean_exit; - } - eks[i] = emalloc(EVP_PKEY_size(pkeys[i]) + 1); - zend_hash_move_forward_ex(pubkeysht, &pos); - i++; - } - - if (!EVP_EncryptInit(&ctx,EVP_rc4(),NULL,NULL)) { - RETVAL_FALSE; - goto clean_exit; - } - -#if 0 - /* Need this if allow ciphers that require initialization vector */ - ivlen = EVP_CIPHER_CTX_iv_length(&ctx); - iv = ivlen ? emalloc(ivlen + 1) : NULL; -#endif - /* allocate one byte extra to make room for \0 */ - buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx)); - - if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, data, data_len)) { - RETVAL_FALSE; - efree(buf); - goto clean_exit; - } - - EVP_SealFinal(&ctx, buf + len1, &len2); - - if (len1 + len2 > 0) { - zval_dtor(sealdata); - buf[len1 + len2] = '\0'; - buf = erealloc(buf, len1 + len2 + 1); - ZVAL_STRINGL(sealdata, buf, len1 + len2, 0); - - zval_dtor(ekeys); - array_init(ekeys); - for (i=0; i<nkeys; i++) { - eks[i][eksl[i]] = '\0'; - add_next_index_stringl(ekeys, erealloc(eks[i], eksl[i] + 1), eksl[i], 0); - eks[i] = NULL; - } -#if 0 - /* If allow ciphers that need IV, we need this */ - zval_dtor(*ivec); - if (ivlen) { - iv[ivlen] = '\0'; - ZVAL_STRINGL(*ivec, erealloc(iv, ivlen + 1), ivlen, 0); - } else { - ZVAL_EMPTY_STRING(*ivec); - } -#endif - } else { - efree(buf); - } - RETVAL_LONG(len1 + len2); - -clean_exit: - for (i=0; i<nkeys; i++) { - if (key_resources[i] == -1) { - EVP_PKEY_free(pkeys[i]); - } - if (eks[i]) { - efree(eks[i]); - } - } - efree(eks); - efree(eksl); - efree(pkeys); - efree(key_resources); -} -/* }}} */ - -/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey) - Opens data */ -PHP_FUNCTION(openssl_open) -{ - zval *privkey, *opendata; - EVP_PKEY *pkey; - int len1, len2; - unsigned char *buf; - long keyresource = -1; - EVP_CIPHER_CTX ctx; - char * data; int data_len; - char * ekey; int ekey_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szsz", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey) == FAILURE) { - return; - } - - pkey = php_openssl_evp_from_zval(&privkey, 0, "", 0, &keyresource TSRMLS_CC); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 4 into a private key"); - RETURN_FALSE; - } - buf = emalloc(data_len + 1); - - if (EVP_OpenInit(&ctx, EVP_rc4(), ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx, buf, &len1, data, data_len)) { - if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || (len1 + len2 == 0)) { - efree(buf); - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - RETURN_FALSE; - } - } else { - efree(buf); - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - RETURN_FALSE; - } - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } - zval_dtor(opendata); - buf[len1 + len2] = '\0'; - ZVAL_STRINGL(opendata, erealloc(buf, len1 + len2 + 1), len1 + len2, 0); - RETURN_TRUE; -} -/* }}} */ - -/* SSL verification functions */ - -#define GET_VER_OPT(name) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, "ssl", name, &val)) -#define GET_VER_OPT_STRING(name, str) if (GET_VER_OPT(name)) { convert_to_string_ex(val); str = Z_STRVAL_PP(val); } - -static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) -{ - php_stream *stream; - SSL *ssl; - X509 *err_cert; - int err, depth, ret; - zval **val; - - ret = preverify_ok; - - /* determine the status for the current cert */ - err_cert = X509_STORE_CTX_get_current_cert(ctx); - err = X509_STORE_CTX_get_error(ctx); - depth = X509_STORE_CTX_get_error_depth(ctx); - - /* conjure the stream & context to use */ - ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); - stream = (php_stream*)SSL_get_ex_data(ssl, ssl_stream_data_index); - - /* if allow_self_signed is set, make sure that verification succeeds */ - if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT && GET_VER_OPT("allow_self_signed") && zval_is_true(*val)) { - ret = 1; - } - - /* check the depth */ - if (GET_VER_OPT("verify_depth")) { - convert_to_long_ex(val); - - if (depth > Z_LVAL_PP(val)) { - ret = 0; - X509_STORE_CTX_set_error(ctx, X509_V_ERR_CERT_CHAIN_TOO_LONG); - } - } - - return ret; - -} - -int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC) -{ - zval **val = NULL; - char *cnmatch = NULL; - X509_NAME *name; - char buf[1024]; - int err; - - /* verification is turned off */ - if (!(GET_VER_OPT("verify_peer") && zval_is_true(*val))) { - return SUCCESS; - } - - if (peer == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate"); - return FAILURE; - } - - err = SSL_get_verify_result(ssl); - switch (err) { - case X509_V_OK: - /* fine */ - break; - case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: - if (GET_VER_OPT("allow_self_signed") && zval_is_true(*val)) { - /* allowed */ - break; - } - /* not allowed, so fall through */ - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not verify peer: code:%d %s", err, X509_verify_cert_error_string(err)); - return FAILURE; - } - - /* if the cert passed the usual checks, apply our own local policies now */ - - name = X509_get_subject_name(peer); - - /* Does the common name match ? (used primarily for https://) */ - GET_VER_OPT_STRING("CN_match", cnmatch); - if (cnmatch) { - int match = 0; - - X509_NAME_get_text_by_NID(name, NID_commonName, buf, sizeof(buf)); - - match = strcmp(cnmatch, buf) == 0; - if (!match && strlen(buf) > 3 && buf[0] == '*' && buf[1] == '.') { - /* Try wildcard */ - - if (strchr(buf+2, '.')) { - char *tmp = strstr(cnmatch, buf+1); - - match = tmp && strcmp(tmp, buf+2) && tmp == strchr(cnmatch, '.'); - } - } - - if (!match) { - /* didn't match */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Peer certificate CN=`%s' did not match expected CN=`%s'", - buf, cnmatch); - - return FAILURE; - } - } - - return SUCCESS; -} - -static int passwd_callback(char *buf, int num, int verify, void *data) -{ - php_stream *stream = (php_stream *)data; - zval **val = NULL; - char *passphrase = NULL; - /* TODO: could expand this to make a callback into PHP user-space */ - - GET_VER_OPT_STRING("passphrase", passphrase); - - if (passphrase) { - if (Z_STRLEN_PP(val) < num - 1) { - memcpy(buf, Z_STRVAL_PP(val), Z_STRLEN_PP(val)+1); - return Z_STRLEN_PP(val); - } - } - return 0; -} - -SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) -{ - zval **val = NULL; - char *cafile = NULL; - char *capath = NULL; - char *certfile = NULL; - char *cipherlist = NULL; - int ok = 1; - - - /* look at context options in the stream and set appropriate verification flags */ - if (GET_VER_OPT("verify_peer") && zval_is_true(*val)) { - - /* turn on verification callback */ - SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_callback); - - /* CA stuff */ - GET_VER_OPT_STRING("cafile", cafile); - GET_VER_OPT_STRING("capath", capath); - - if (cafile || capath) { - if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set verify locations `%s' `%s'", cafile, capath); - return NULL; - } - } - - if (GET_VER_OPT("verify_depth")) { - convert_to_long_ex(val); - SSL_CTX_set_verify_depth(ctx, Z_LVAL_PP(val)); - } - } else { - SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL); - } - - /* callback for the passphrase (for localcert) */ - if (GET_VER_OPT("passphrase")) { - SSL_CTX_set_default_passwd_cb_userdata(ctx, stream); - SSL_CTX_set_default_passwd_cb(ctx, passwd_callback); - } - - GET_VER_OPT_STRING("ciphers", cipherlist); - if (!cipherlist) { - cipherlist = "DEFAULT"; - } - SSL_CTX_set_cipher_list(ctx, cipherlist); - - GET_VER_OPT_STRING("local_cert", certfile); - if (certfile) { - X509 *cert = NULL; - EVP_PKEY *key = NULL; - SSL *tmpssl; - - /* a certificate to use for authentication */ - if (SSL_CTX_use_certificate_chain_file(ctx, certfile) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set local cert chain file `%s'; Check that your cafile/capath settings include details of your certificate and its issuer", certfile); - return NULL; - } - - if (SSL_CTX_use_PrivateKey_file(ctx, certfile, SSL_FILETYPE_PEM) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", certfile); - return NULL; - } - - tmpssl = SSL_new(ctx); - cert = SSL_get_certificate(tmpssl); - - if (cert) { - key = X509_get_pubkey(cert); - EVP_PKEY_copy_parameters(key, SSL_get_privatekey(tmpssl)); - EVP_PKEY_free(key); - } - SSL_free(tmpssl); - - if (!SSL_CTX_check_private_key(ctx)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!"); - } - } - if (ok) { - SSL *ssl = SSL_new(ctx); - - if (ssl) { - /* map SSL => stream */ - SSL_set_ex_data(ssl, ssl_stream_data_index, stream); - } - return ssl; - } - - return NULL; -} - - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 8 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/openssl/openssl.dsp b/ext/openssl/openssl.dsp deleted file mode 100644 index 857666a6a32d7..0000000000000 --- a/ext/openssl/openssl.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="openssl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=openssl - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "openssl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "openssl.mak" CFG="openssl - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "openssl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "openssl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "openssl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_openssl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "openssl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_openssl.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "openssl - Win32 Release_TS" -# Name "openssl - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\openssl.c -# End Source File -# Begin Source File - -SOURCE=.\xp_ssl.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_openssl.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/openssl/openssl.mak b/ext/openssl/openssl.mak deleted file mode 100644 index a0c6fa483e94f..0000000000000 --- a/ext/openssl/openssl.mak +++ /dev/null @@ -1,185 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = php_ossl -MODULE_DESC = "PHP 5 - OpenSSL Extension" -VMAJ = 1 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# OpenSSL directory -OSSL_DIR = P:/APPS/script/sw/OpenSSL - -# Build type defaults to 'release' -ifndef BUILD -BUILD = release -endif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = openssl.c \ - xp_ssl.c \ - start.c \ - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = $(OSSL_DIR)/lib/RSAglue.lib \ - $(OSSL_DIR)/lib/crypto.lib \ - $(OSSL_DIR)/lib/ssl.lib - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS += -c -maxerrors 25 -msgstyle gcc -C_FLAGS += -wchar_t on -bool on -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_OPENSSL=1 - -C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(OSSL_DIR)/include - -ifndef STACK_SIZE -STACK_SIZE=8192 -endif - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off - C_FLAGS += -opt intrinsics -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - - -# Dependencies -MODULE = LibC \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(SDK_DIR)/imports/netware.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.d: %.c - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.cpp - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.c - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - - -$(BINARY): $(OBJECTS) - @echo Import $(IMPORT) > $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - -# Two functions imported to build the openssl extension - @echo Import GetProcessSwitchCount >> $(basename $@).def - @echo Import RunningProcess >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h deleted file mode 100644 index c836b2d1b025f..0000000000000 --- a/ext/openssl/php_openssl.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Venaas <venaas@php.net> | - | Wez Furlong <wez@thebrainroom.com | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_OPENSSL_H -#define PHP_OPENSSL_H -/* HAVE_OPENSSL would include SSL MySQL stuff */ -#ifdef HAVE_OPENSSL_EXT -extern zend_module_entry openssl_module_entry; -#define phpext_openssl_ptr &openssl_module_entry - -php_stream_transport_factory_func php_openssl_ssl_socket_factory; - -PHP_MINIT_FUNCTION(openssl); -PHP_MSHUTDOWN_FUNCTION(openssl); -PHP_MINFO_FUNCTION(openssl); - -PHP_FUNCTION(openssl_pkey_get_private); -PHP_FUNCTION(openssl_pkey_get_public); -PHP_FUNCTION(openssl_pkey_free); -PHP_FUNCTION(openssl_pkey_new); -PHP_FUNCTION(openssl_pkey_export); -PHP_FUNCTION(openssl_pkey_export_to_file); - -PHP_FUNCTION(openssl_sign); -PHP_FUNCTION(openssl_verify); -PHP_FUNCTION(openssl_seal); -PHP_FUNCTION(openssl_open); -PHP_FUNCTION(openssl_private_encrypt); -PHP_FUNCTION(openssl_private_decrypt); -PHP_FUNCTION(openssl_public_encrypt); -PHP_FUNCTION(openssl_public_decrypt); - -PHP_FUNCTION(openssl_pkcs7_verify); -PHP_FUNCTION(openssl_pkcs7_decrypt); -PHP_FUNCTION(openssl_pkcs7_sign); -PHP_FUNCTION(openssl_pkcs7_encrypt); - -PHP_FUNCTION(openssl_error_string); - -PHP_FUNCTION(openssl_x509_read); -PHP_FUNCTION(openssl_x509_free); -PHP_FUNCTION(openssl_x509_parse); -PHP_FUNCTION(openssl_x509_checkpurpose); -PHP_FUNCTION(openssl_x509_export); -PHP_FUNCTION(openssl_x509_export_to_file); -PHP_FUNCTION(openssl_x509_check_private_key); -PHP_FUNCTION(openssl_csr_new); -PHP_FUNCTION(openssl_csr_export); -PHP_FUNCTION(openssl_csr_export_to_file); -PHP_FUNCTION(openssl_csr_sign); - -#else - -#define phpext_openssl_ptr NULL - -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt deleted file mode 100644 index 9987c688b9fc3..0000000000000 --- a/ext/openssl/tests/001.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -OpenSSL private key functions ---SKIPIF-- -<?php // vim600:syn=php -include('skipif.inc'); ?> ---FILE-- -<?php -echo "Creating private key\n"; - -/* stack up some entropy; performance is not critical, - * and being slow will most likely even help the test. - */ -for ($z = "", $i = 0; $i < 1024; $i++) { - $z .= $i * $i; - if (function_exists("usleep")) - usleep($i); -} - -$privkey = openssl_pkey_new(); - -if ($privkey === false) - die("failed to create private key"); - -$passphrase = "banana"; -$key_file_name = tempnam("/tmp", "ssl"); -if ($key_file_name === false) - die("failed to get a temporary filename!"); - -echo "Export key to file\n"; - -openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to file $key_file_name"); - -echo "Load key from file - array syntax\n"; - -$loaded_key = openssl_pkey_get_private(array("file://$key_file_name", $passphrase)); - -if ($loaded_key === false) - die("failed to load key using array syntax"); - -openssl_pkey_free($loaded_key); - -echo "Load key using direct syntax\n"; - -$loaded_key = openssl_pkey_get_private("file://$key_file_name", $passphrase); - -if ($loaded_key === false) - die("failed to load key using direct syntax"); - -openssl_pkey_free($loaded_key); - -echo "Load key manually and use string syntax\n"; - -$key_content = file_get_contents($key_file_name); -$loaded_key = openssl_pkey_get_private($key_content, $passphrase); - -if ($loaded_key === false) - die("failed to load key using string syntax"); - -openssl_pkey_free($loaded_key); - -echo "OK!\n"; - -@unlink($key_file_name); - -?> ---EXPECT-- -Creating private key -Export key to file -Load key from file - array syntax -Load key using direct syntax -Load key manually and use string syntax -OK! diff --git a/ext/openssl/tests/bug25614.phpt b/ext/openssl/tests/bug25614.phpt deleted file mode 100644 index dc8b23ffd63d8..0000000000000 --- a/ext/openssl/tests/bug25614.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -openssl: get public key from generated private key ---SKIPIF-- -<?php if (!extension_loaded("openssl")) print "skip"; ?> ---FILE-- -<?php -$priv = openssl_pkey_new(); -$pub = openssl_pkey_get_public($priv); -?> ---EXPECTF-- -Warning: openssl_pkey_get_public(): Don't know how to get public key from this private key %s diff --git a/ext/openssl/tests/skipif.inc b/ext/openssl/tests/skipif.inc deleted file mode 100644 index 21e947d0b2014..0000000000000 --- a/ext/openssl/tests/skipif.inc +++ /dev/null @@ -1,11 +0,0 @@ -<?php -// This script prints "skip" if condition does not meet. - -if (!extension_loaded("openssl") && ini_get("enable_dl")) { - $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; - @dl("openssl$dlext"); -} -if (!extension_loaded("openssl")) { - die("skip\n"); -} -?> diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c deleted file mode 100644 index 88ff86c8b6ef5..0000000000000 --- a/ext/openssl/xp_ssl.c +++ /dev/null @@ -1,721 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@thebrainroom.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/file.h" -#include "streams/php_streams_int.h" -#include "php_network.h" -#include "php_openssl.h" -#include <openssl/ssl.h> -#include <openssl/x509.h> -#include <openssl/err.h> - -#ifdef NETWARE -#include <sys/select.h> -#endif - -int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC); -SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC); - -/* This implementation is very closely tied to the that of the native - * sockets implemented in the core. - * Don't try this technique in other extensions! - * */ - -typedef struct _php_openssl_netstream_data_t { - php_netstream_data_t s; - SSL *ssl_handle; - int enable_on_connect; - int is_client; - int ssl_active; - php_stream_xport_crypt_method_t method; - unsigned state_set:1; - unsigned _spare:31; -} php_openssl_netstream_data_t; - -php_stream_ops php_openssl_socket_ops; - -/* it doesn't matter that we do some hash traversal here, since it is done only - * in an error condition arising from a network connection problem */ -static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) -{ - if (stream->wrapperdata && stream->wrapper && strcmp(stream->wrapper->wops->label, "HTTP") == 0) { - /* the wrapperdata is an array zval containing the headers */ - zval **tmp; - -#define SERVER_MICROSOFT_IIS "Server: Microsoft-IIS" - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream->wrapperdata)); - while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(stream->wrapperdata), (void**)&tmp)) { - - if (strncasecmp(Z_STRVAL_PP(tmp), SERVER_MICROSOFT_IIS, sizeof(SERVER_MICROSOFT_IIS)-1) == 0) { - return 1; - } - - zend_hash_move_forward(Z_ARRVAL_P(stream->wrapperdata)); - } - } - return 0; -} - -static int handle_ssl_error(php_stream *stream, int nr_bytes TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - int err = SSL_get_error(sslsock->ssl_handle, nr_bytes); - char esbuf[512]; - char *ebuf = NULL, *wptr = NULL; - size_t ebuf_size = 0; - unsigned long code, ecode; - int retry = 1; - - switch(err) { - case SSL_ERROR_ZERO_RETURN: - /* SSL terminated (but socket may still be active) */ - retry = 0; - break; - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - /* re-negotiation, or perhaps the SSL layer needs more - * packets: retry in next iteration */ - errno = EAGAIN; - retry = sslsock->s.is_blocked; - break; - case SSL_ERROR_SYSCALL: - if (ERR_peek_error() == 0) { - if (nr_bytes == 0) { - if (!is_http_stream_talking_to_iis(stream TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "SSL: fatal protocol error"); - } - SSL_set_shutdown(sslsock->ssl_handle, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); - stream->eof = 1; - retry = 0; - } else { - char *estr = php_socket_strerror(php_socket_errno(), NULL, 0); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "SSL: %s", estr); - - efree(estr); - retry = 0; - } - break; - } - - - /* fall through */ - default: - /* some other error */ - ecode = ERR_get_error(); - - switch (ERR_GET_REASON(ecode)) { - case SSL_R_NO_SHARED_CIPHER: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option)"); - retry = 0; - break; - - default: - do { - /* allow room for a NUL and an optional \n */ - if (ebuf) { - esbuf[0] = '\n'; - esbuf[1] = '\0'; - ERR_error_string_n(ecode, esbuf + 1, sizeof(esbuf) - 2); - } else { - esbuf[0] = '\0'; - ERR_error_string_n(ecode, esbuf, sizeof(esbuf) - 1); - } - code = strlen(esbuf); - esbuf[code] = '\0'; - - ebuf = erealloc(ebuf, ebuf_size + code + 1); - if (wptr == NULL) { - wptr = ebuf; - } - - /* also copies the NUL */ - memcpy(wptr, esbuf, code + 1); - wptr += code; - } while ((ecode = ERR_get_error()) != 0); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "SSL operation failed with code %d. %s%s", - err, - ebuf ? "OpenSSL Error messages:\n" : "", - ebuf ? ebuf : ""); - } - - retry = 0; - errno = 0; - } - return retry; -} - - -static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - int didwrite; - - if (sslsock->ssl_active) { - int retry = 1; - - do { - didwrite = SSL_write(sslsock->ssl_handle, buf, count); - - if (didwrite <= 0) { - retry = handle_ssl_error(stream, didwrite TSRMLS_CC); - } else { - break; - } - } while(retry); - - } else { - didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC); - } - - if (didwrite > 0) { - php_stream_notify_progress_increment(stream->context, didwrite, 0); - } - - if (didwrite < 0) { - didwrite = 0; - } - - return didwrite; -} - -static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - int nr_bytes = 0; - - if (sslsock->ssl_active) { - int retry = 1; - - do { - nr_bytes = SSL_read(sslsock->ssl_handle, buf, count); - - if (nr_bytes <= 0) { - retry = handle_ssl_error(stream, nr_bytes TSRMLS_CC); - stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle)); - - } else { - /* we got the data */ - break; - } - } while (retry); - } - else - { - nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC); - } - - if (nr_bytes > 0) { - php_stream_notify_progress_increment(stream->context, nr_bytes, 0); - } - - if (nr_bytes < 0) { - nr_bytes = 0; - } - - return nr_bytes; -} - - -static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; -#ifdef PHP_WIN32 - int n; -#endif - if (close_handle) { - if (sslsock->ssl_active) { - SSL_shutdown(sslsock->ssl_handle); - sslsock->ssl_active = 0; - } - if (sslsock->ssl_handle) { - SSL_free(sslsock->ssl_handle); - sslsock->ssl_handle = NULL; - } - if (sslsock->s.socket != SOCK_ERR) { -#ifdef PHP_WIN32 - /* prevent more data from coming in */ - shutdown(sslsock->s.socket, SHUT_RD); - - /* try to make sure that the OS sends all data before we close the connection. - * Essentially, we are waiting for the socket to become writeable, which means - * that all pending data has been sent. - * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefintely. - * */ - do { - n = php_pollfd_for_ms(sslsock->s.socket, POLLOUT, 500); - } while (n == -1 && php_socket_errno() == EINTR); -#endif - closesocket(sslsock->s.socket); - sslsock->s.socket = SOCK_ERR; - } - } - - pefree(sslsock, php_stream_is_persistent(stream)); - - return 0; -} - -static int php_openssl_sockop_flush(php_stream *stream TSRMLS_DC) -{ - return php_stream_socket_ops.flush(stream TSRMLS_CC); -} - -static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - return php_stream_socket_ops.stat(stream, ssb TSRMLS_CC); -} - - -static inline int php_openssl_setup_crypto(php_stream *stream, - php_openssl_netstream_data_t *sslsock, - php_stream_xport_crypto_param *cparam - TSRMLS_DC) -{ - SSL_CTX *ctx; - SSL_METHOD *method; - - if (sslsock->ssl_handle) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS already set-up for this stream"); - return -1; - } - - /* need to do slightly different things, based on client/server method, - * so lets remember which method was selected */ - - switch (cparam->inputs.method) { - case STREAM_CRYPTO_METHOD_SSLv23_CLIENT: - sslsock->is_client = 1; - method = SSLv23_client_method(); - break; - case STREAM_CRYPTO_METHOD_SSLv2_CLIENT: - sslsock->is_client = 1; - method = SSLv2_client_method(); - break; - case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: - sslsock->is_client = 1; - method = SSLv3_client_method(); - break; - case STREAM_CRYPTO_METHOD_TLS_CLIENT: - sslsock->is_client = 1; - method = TLSv1_client_method(); - break; - case STREAM_CRYPTO_METHOD_SSLv23_SERVER: - sslsock->is_client = 0; - method = SSLv23_server_method(); - break; - case STREAM_CRYPTO_METHOD_SSLv3_SERVER: - sslsock->is_client = 0; - method = SSLv3_server_method(); - break; - case STREAM_CRYPTO_METHOD_SSLv2_SERVER: - sslsock->is_client = 0; - method = SSLv2_server_method(); - break; - case STREAM_CRYPTO_METHOD_TLS_SERVER: - sslsock->is_client = 0; - method = TLSv1_server_method(); - break; - default: - return -1; - - } - - ctx = SSL_CTX_new(method); - if (ctx == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL context"); - return -1; - } - - SSL_CTX_set_options(ctx, SSL_OP_ALL); - - sslsock->ssl_handle = php_SSL_new_from_context(ctx, stream TSRMLS_CC); - if (sslsock->ssl_handle == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle"); - SSL_CTX_free(ctx); - return -1; - } - - if (!SSL_set_fd(sslsock->ssl_handle, sslsock->s.socket)) { - handle_ssl_error(stream, 0 TSRMLS_CC); - } - - if (cparam->inputs.session) { - if (cparam->inputs.session->ops != &php_openssl_socket_ops) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied session stream must be an SSL enabled stream"); - } else { - SSL_copy_session_id(sslsock->ssl_handle, ((php_openssl_netstream_data_t*)cparam->inputs.session->abstract)->ssl_handle); - } - } - return 0; -} - -static inline int php_openssl_enable_crypto(php_stream *stream, - php_openssl_netstream_data_t *sslsock, - php_stream_xport_crypto_param *cparam - TSRMLS_DC) -{ - int n, retry = 1; - - if (cparam->inputs.activate && !sslsock->ssl_active) { - if (!sslsock->state_set) { - if (sslsock->is_client) { - SSL_set_connect_state(sslsock->ssl_handle); - } else { - SSL_set_accept_state(sslsock->ssl_handle); - } - sslsock->state_set = 1; - } - - do { - if (sslsock->is_client) { - n = SSL_connect(sslsock->ssl_handle); - } else { - n = SSL_accept(sslsock->ssl_handle); - } - - if (n <= 0) { - retry = handle_ssl_error(stream, n TSRMLS_CC); - } else { - break; - } - } while (retry); - - if (n == 1) { - X509 *peer_cert; - - peer_cert = SSL_get_peer_certificate(sslsock->ssl_handle); - - if (FAILURE == php_openssl_apply_verification_policy(sslsock->ssl_handle, peer_cert, stream TSRMLS_CC)) { - SSL_shutdown(sslsock->ssl_handle); - } else { - sslsock->ssl_active = 1; - } - - X509_free(peer_cert); - } else { - n = errno == EAGAIN ? 0 : -1; - } - - return n; - - } else if (!cparam->inputs.activate && sslsock->ssl_active) { - /* deactivate - common for server/client */ - SSL_shutdown(sslsock->ssl_handle); - sslsock->ssl_active = 0; - } - return -1; -} - -static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock, - php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC) -{ - int clisock; - - xparam->outputs.client = NULL; - - clisock = php_network_accept_incoming(sock->s.socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL, - xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &xparam->outputs.error_code - TSRMLS_CC); - - if (clisock >= 0) { - php_openssl_netstream_data_t *clisockdata; - - clisockdata = emalloc(sizeof(*clisockdata)); - - if (clisockdata == NULL) { - closesocket(clisock); - /* technically a fatal error */ - } else { - /* copy underlying tcp fields */ - memset(clisockdata, 0, sizeof(*clisockdata)); - memcpy(clisockdata, sock, sizeof(clisockdata->s)); - - clisockdata->s.socket = clisock; - - xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); - if (xparam->outputs.client) { - xparam->outputs.client->context = stream->context; - } - } - - if (xparam->outputs.client && sock->enable_on_connect) { - /* apply crypto */ - switch (sock->method) { - case STREAM_CRYPTO_METHOD_SSLv23_CLIENT: - sock->method = STREAM_CRYPTO_METHOD_SSLv23_SERVER; - break; - case STREAM_CRYPTO_METHOD_SSLv2_CLIENT: - sock->method = STREAM_CRYPTO_METHOD_SSLv2_SERVER; - break; - case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: - sock->method = STREAM_CRYPTO_METHOD_SSLv3_SERVER; - break; - case STREAM_CRYPTO_METHOD_TLS_CLIENT: - sock->method = STREAM_CRYPTO_METHOD_TLS_SERVER; - break; - } - - clisockdata->method = sock->method; - - if (php_stream_xport_crypto_setup(xparam->outputs.client, clisockdata->method, - NULL TSRMLS_CC) < 0 || php_stream_xport_crypto_enable( - xparam->outputs.client, 1 TSRMLS_CC) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto"); - - php_stream_close(xparam->outputs.client); - xparam->outputs.client = NULL; - xparam->outputs.returncode = -1; - } - } - } - - return xparam->outputs.client == NULL ? -1 : 0; -} -static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - php_stream_xport_crypto_param *cparam = (php_stream_xport_crypto_param *)ptrparam; - php_stream_xport_param *xparam = (php_stream_xport_param *)ptrparam; - - switch (option) { - case PHP_STREAM_OPTION_CHECK_LIVENESS: - { - struct timeval tv; - char buf; - int alive = 1; - - if (value == -1) { - if (sslsock->s.timeout.tv_sec == -1) { - tv.tv_sec = FG(default_socket_timeout); - tv.tv_usec = 0; - } else { - tv = sslsock->s.timeout; - } - } else { - tv.tv_sec = value; - tv.tv_usec = 0; - } - - if (sslsock->s.socket == -1) { - alive = 0; - } else if (php_pollfd_for(sslsock->s.socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { - if (sslsock->ssl_active) { - int n; - - do { - n = SSL_peek(sslsock->ssl_handle, &buf, sizeof(buf)); - if (n <= 0) { - int err = SSL_get_error(sslsock->ssl_handle, n); - - if (err == SSL_ERROR_SYSCALL) { - alive = php_socket_errno() == EAGAIN; - break; - } - - if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) { - /* re-negotiate */ - continue; - } - - /* any other problem is a fatal error */ - alive = 0; - } - /* either peek succeeded or there was an error; we - * have set the alive flag appropriately */ - break; - } while (1); - } else if (0 == recv(sslsock->s.socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) { - alive = 0; - } - } - return alive ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; - } - - case PHP_STREAM_OPTION_CRYPTO_API: - - switch(cparam->op) { - - case STREAM_XPORT_CRYPTO_OP_SETUP: - cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - break; - case STREAM_XPORT_CRYPTO_OP_ENABLE: - cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - break; - default: - /* fall through */ - break; - } - - break; - - case PHP_STREAM_OPTION_XPORT_API: - switch(xparam->op) { - - case STREAM_XPORT_OP_CONNECT: - case STREAM_XPORT_OP_CONNECT_ASYNC: - /* TODO: Async connects need to check the enable_on_connect option when - * we notice that the connect has actually been established */ - php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC); - - if (xparam->outputs.returncode == 0 && sslsock->enable_on_connect) { - if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto"); - xparam->outputs.returncode = -1; - } - } - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_ACCEPT: - /* we need to copy the additional fields that the underlying tcp transport - * doesn't know about */ - xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC TSRMLS_CC); - - - return PHP_STREAM_OPTION_RETURN_OK; - - default: - /* fall through */ - break; - } - } - - return php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC); -} - -static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - - switch(castas) { - case PHP_STREAM_AS_STDIO: - if (sslsock->ssl_active) { - return FAILURE; - } - if (ret) { - *ret = fdopen(sslsock->s.socket, stream->mode); - if (*ret) { - return SUCCESS; - } - return FAILURE; - } - return SUCCESS; - - case PHP_STREAM_AS_FD_FOR_SELECT: - if (ret) { - *ret = (void*)sslsock->s.socket; - } - return SUCCESS; - - case PHP_STREAM_AS_FD: - case PHP_STREAM_AS_SOCKETD: - if (sslsock->ssl_active) { - return FAILURE; - } - if (ret) { - *ret = (void*)sslsock->s.socket; - } - return SUCCESS; - default: - return FAILURE; - } -} - -php_stream_ops php_openssl_socket_ops = { - php_openssl_sockop_write, php_openssl_sockop_read, - php_openssl_sockop_close, php_openssl_sockop_flush, - "tcp_socket/ssl", - NULL, /* seek */ - php_openssl_sockop_cast, - php_openssl_sockop_stat, - php_openssl_sockop_set_option, -}; - - -php_stream *php_openssl_ssl_socket_factory(const char *proto, long protolen, - char *resourcename, long resourcenamelen, - const char *persistent_id, int options, int flags, - struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_openssl_netstream_data_t *sslsock = NULL; - - sslsock = pemalloc(sizeof(php_openssl_netstream_data_t), persistent_id ? 1 : 0); - memset(sslsock, 0, sizeof(*sslsock)); - - sslsock->s.is_blocked = 1; - sslsock->s.timeout.tv_sec = FG(default_socket_timeout); - sslsock->s.timeout.tv_usec = 0; - - /* we don't know the socket until we have determined if we are binding or - * connecting */ - sslsock->s.socket = -1; - - stream = php_stream_alloc_rel(&php_openssl_socket_ops, sslsock, persistent_id, "r+"); - - if (stream == NULL) { - pefree(sslsock, persistent_id ? 1 : 0); - return NULL; - } - - if (strncmp(proto, "ssl", protolen) == 0) { - sslsock->enable_on_connect = 1; - sslsock->method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; - } else if (strncmp(proto, "sslv2", protolen) == 0) { - sslsock->enable_on_connect = 1; - sslsock->method = STREAM_CRYPTO_METHOD_SSLv2_CLIENT; - } else if (strncmp(proto, "sslv3", protolen) == 0) { - sslsock->enable_on_connect = 1; - sslsock->method = STREAM_CRYPTO_METHOD_SSLv3_CLIENT; - } else if (strncmp(proto, "tls", protolen) == 0) { - sslsock->enable_on_connect = 1; - sslsock->method = STREAM_CRYPTO_METHOD_TLS_CLIENT; - } - - return stream; -} - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pcntl/CREDITS b/ext/pcntl/CREDITS deleted file mode 100644 index 1d629d7adffe0..0000000000000 --- a/ext/pcntl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -pcntl -Jason Greene diff --git a/ext/pcntl/EXPERIMENTAL b/ext/pcntl/EXPERIMENTAL deleted file mode 100644 index 6443e99646410..0000000000000 --- a/ext/pcntl/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/ext/pcntl/README b/ext/pcntl/README deleted file mode 100644 index cadd11121c84d..0000000000000 --- a/ext/pcntl/README +++ /dev/null @@ -1,16 +0,0 @@ -Process Control Module for PHP (pcntl) - -This module will attempt to implement all features related to process spawning and -control (fork(), waitpid(), signal(), WIF's, etc). This is extremly experimental, -with hope to become stable on most UNIX's. I greatly apreciate any feedback, fixes, -and or suggestions on how to improve/better implement -this functionality. - -Thanks, - -Jason Greeme < jason@inetgurus.net / jason@php.net > - - - - - diff --git a/ext/pcntl/config.m4 b/ext/pcntl/config.m4 deleted file mode 100644 index 4b6b99441adf4..0000000000000 --- a/ext/pcntl/config.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl Process Control (pcntl) extentsion --EXPERIMENTAL-- -dnl TODO - Add platform checks - -PHP_ARG_ENABLE(pcntl, whether to enable pcntl support, -[ --enable-pcntl Enable experimental pcntl support (CLI/CGI only)]) - -if test "$PHP_PCNTL" != "no"; then - - AC_CHECK_FUNCS(fork, [ AC_DEFINE(HAVE_FORK,1,[ ]) ], [ AC_MSG_ERROR(pcntl: fork() not supported by this platform) ]) - AC_CHECK_FUNCS(waitpid, [ AC_DEFINE(HAVE_WAITPID,1,[ ]) ], [ AC_MSG_ERROR(pcntl: fork() not supported by this platform) ]) - AC_CHECK_FUNCS(sigaction, [ AC_DEFINE(HAVE_SIGACTION,1,[ ]) ], [ AC_MSG_ERROR(pcntl: sigaction() not supported by this platform) ]) - AC_CHECK_FUNCS(getpriority setpriority wait3) - - PHP_NEW_EXTENSION(pcntl, pcntl.c php_signal.c, $ext_shared, cli) -fi diff --git a/ext/pcntl/package.xml b/ext/pcntl/package.xml deleted file mode 100644 index a9a3870043a53..0000000000000 --- a/ext/pcntl/package.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>posix</name> - <summary>POSIX functions</summary> - <maintainers> - <maintainer> - <user>???</user> - <name>Kristian Köhntopp</name> - <email>kris@koehntopp.de</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> -This module contains an interface to those functions defined -in the IEEE 1003.1 (POSIX.1) standards document which are not -accessible through other means. POSIX.1 for example defined the -open(), read(), write() and close() functions, too, which -traditionally have been part of PHP for a long time. Some more -system specific functions have not been available before, though, -and this module tries to remedy this by providing easy access -to these functions. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="src" name="config.m4"/> - <file role="src" name="posix.c"/> - <file role="src" name="php_posix.h"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> --> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c deleted file mode 100755 index 94af3d64cea84..0000000000000 --- a/ext/pcntl/pcntl.c +++ /dev/null @@ -1,730 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene <jason@inetgurus.net> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define PCNTL_DEBUG 0 - -#if PCNTL_DEBUG -#define DEBUG_OUT printf("DEBUG: ");printf -#define IF_DEBUG(z) z -#else -#define IF_DEBUG(z) -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pcntl.h" - -#if HAVE_GETPRIORITY || HAVE_SETPRIORITY || HAVE_WAIT3 -#include <sys/time.h> -#include <sys/resource.h> -#endif - -ZEND_DECLARE_MODULE_GLOBALS(pcntl) - -function_entry pcntl_functions[] = { - PHP_FE(pcntl_fork, NULL) - PHP_FE(pcntl_waitpid, second_arg_force_ref) - PHP_FE(pcntl_wait, first_arg_force_ref) - PHP_FE(pcntl_signal, NULL) - PHP_FE(pcntl_wifexited, NULL) - PHP_FE(pcntl_wifstopped, NULL) - PHP_FE(pcntl_wifsignaled, NULL) - PHP_FE(pcntl_wexitstatus, NULL) - PHP_FE(pcntl_wtermsig, NULL) - PHP_FE(pcntl_wstopsig, NULL) - PHP_FE(pcntl_exec, NULL) - PHP_FE(pcntl_alarm, NULL) -#ifdef HAVE_GETPRIORITY - PHP_FE(pcntl_getpriority, NULL) -#endif -#ifdef HAVE_SETPRIORITY - PHP_FE(pcntl_setpriority, NULL) -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry pcntl_module_entry = { - STANDARD_MODULE_HEADER, - "pcntl", - pcntl_functions, - PHP_MINIT(pcntl), - PHP_MSHUTDOWN(pcntl), - PHP_RINIT(pcntl), - PHP_RSHUTDOWN(pcntl), - PHP_MINFO(pcntl), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_PCNTL -ZEND_GET_MODULE(pcntl) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -static void pcntl_signal_handler(int); -static void pcntl_tick_handler(); - -void php_register_signal_constants(INIT_FUNC_ARGS) -{ - - /* Wait Constants */ -#ifdef WNOHANG - REGISTER_LONG_CONSTANT("WNOHANG", (long) WNOHANG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef WUNTRACED - REGISTER_LONG_CONSTANT("WUNTRACED", (long) WUNTRACED, CONST_CS | CONST_PERSISTENT); -#endif - - /* Signal Constants */ - REGISTER_LONG_CONSTANT("SIG_IGN", (long) SIG_IGN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIG_DFL", (long) SIG_DFL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIG_ERR", (long) SIG_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGHUP", (long) SIGHUP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGINT", (long) SIGINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGQUIT", (long) SIGQUIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGILL", (long) SIGILL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGTRAP", (long) SIGTRAP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGABRT", (long) SIGABRT, CONST_CS | CONST_PERSISTENT); -#ifdef SIGIOT - REGISTER_LONG_CONSTANT("SIGIOT", (long) SIGIOT, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("SIGBUS", (long) SIGBUS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGFPE", (long) SIGFPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGKILL", (long) SIGKILL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGUSR1", (long) SIGUSR1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGSEGV", (long) SIGSEGV, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGUSR2", (long) SIGUSR2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGPIPE", (long) SIGPIPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGALRM", (long) SIGALRM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGTERM", (long) SIGTERM, CONST_CS | CONST_PERSISTENT); -#ifdef SIGSTKFLT - REGISTER_LONG_CONSTANT("SIGSTKFLT",(long) SIGSTKFLT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef SIGCLD - REGISTER_LONG_CONSTANT("SIGCLD", (long) SIGCLD, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef SIGCHLD - REGISTER_LONG_CONSTANT("SIGCHLD", (long) SIGCHLD, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("SIGCONT", (long) SIGCONT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGSTOP", (long) SIGSTOP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGTSTP", (long) SIGTSTP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGTTIN", (long) SIGTTIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGTTOU", (long) SIGTTOU, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGURG", (long) SIGURG , CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGXCPU", (long) SIGXCPU, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGXFSZ", (long) SIGXFSZ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGVTALRM",(long) SIGVTALRM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGPROF", (long) SIGPROF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGWINCH", (long) SIGWINCH, CONST_CS | CONST_PERSISTENT); -#ifdef SIGPOLL - REGISTER_LONG_CONSTANT("SIGPOLL", (long) SIGPOLL, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("SIGIO", (long) SIGIO, CONST_CS | CONST_PERSISTENT); -#ifdef SIGPWR - REGISTER_LONG_CONSTANT("SIGPWR", (long) SIGPWR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef SIGSYS - REGISTER_LONG_CONSTANT("SIGSYS", (long) SIGSYS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SIGBABY", (long) SIGSYS, CONST_CS | CONST_PERSISTENT); -#endif - -#if HAVE_GETPRIORITY || HAVE_SETPRIORITY - REGISTER_LONG_CONSTANT("PRIO_PGRP", PRIO_PGRP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PRIO_USER", PRIO_USER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PRIO_PROCESS", PRIO_PROCESS, CONST_CS | CONST_PERSISTENT); -#endif -} - -static void php_pcntl_init_globals(zend_pcntl_globals *pcntl_globals) -{ - memset(pcntl_globals, 0, sizeof(*pcntl_globals)); -} - -PHP_RINIT_FUNCTION(pcntl) -{ - zend_hash_init(&PCNTL_G(php_signal_table), 16, NULL, ZVAL_PTR_DTOR, 0); - PCNTL_G(head) = PCNTL_G(tail) = PCNTL_G(spares) = NULL; - return SUCCESS; -} - -PHP_MINIT_FUNCTION(pcntl) -{ - php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU); - ZEND_INIT_MODULE_GLOBALS(pcntl, php_pcntl_init_globals, NULL); - php_add_tick_function(pcntl_tick_handler); - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(pcntl) -{ - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(pcntl) -{ - struct php_pcntl_pending_signal *sig; - - /* FIXME: if a signal is delivered after this point, things will go pear shaped; - * need to remove signal handlers */ - zend_hash_destroy(&PCNTL_G(php_signal_table)); - while (PCNTL_G(head)) { - sig = PCNTL_G(head); - PCNTL_G(head) = sig->next; - efree(sig); - } - while (PCNTL_G(spares)) { - sig = PCNTL_G(spares); - PCNTL_G(spares) = sig->next; - efree(sig); - } - return SUCCESS; -} - -PHP_MINFO_FUNCTION(pcntl) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "pcntl support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto int pcntl_fork(void) - Forks the currently running process following the same behavior as the UNIX fork() system call*/ -PHP_FUNCTION(pcntl_fork) -{ - pid_t id; - - id = fork(); - if (id == -1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error %d", errno); - } - - RETURN_LONG((long) id); -} -/* }}} */ - -/* {{{ proto int pcntl_alarm(int seconds) - Set an alarm clock for delivery of a signal*/ -PHP_FUNCTION(pcntl_alarm) -{ - long seconds; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) - return; - - RETURN_LONG ((long) alarm(seconds)); -} -/* }}} */ - -/* {{{ proto int pcntl_waitpid(int pid, int &status, int options) - Waits on or returns the status of a forked child as defined by the waitpid() system call */ -PHP_FUNCTION(pcntl_waitpid) -{ - long pid, options = 0; - zval *z_status = NULL; - int status; - pid_t child_id; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|l", &pid, &z_status, &options) == FAILURE) - return; - - convert_to_long_ex(&z_status); - - status = Z_LVAL_P(z_status); - - child_id = waitpid((pid_t) pid, &status, options); - - Z_LVAL_P(z_status) = status; - - RETURN_LONG((long) child_id); -} -/* }}} */ - -/* {{{ proto int pcntl_wait(int &status) - Waits on or returns the status of a forked child as defined by the waitpid() system call */ -PHP_FUNCTION(pcntl_wait) -{ - long options = 0; - zval *z_status = NULL; - int status; - pid_t child_id; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &z_status, &options) == FAILURE) - return; - - convert_to_long_ex(&z_status); - - status = Z_LVAL_P(z_status); -#ifdef HAVE_WAIT3 - if(options) { - child_id = wait3(&status, options, NULL); - } - else { - child_id = wait(&status); - } -#else - child_id = wait(&status); -#endif - Z_LVAL_P(z_status) = status; - - RETURN_LONG((long) child_id); -} -/* }}} */ - -/* {{{ proto bool pcntl_wifexited(int status) - Returns true if the child status code represents a successful exit */ -PHP_FUNCTION(pcntl_wifexited) -{ -#ifdef WIFEXITED - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - if (WIFEXITED(status_word)) RETURN_TRUE; -#endif - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool pcntl_wifstopped(int status) - Returns true if the child status code represents a stopped process (WUNTRACED must have been used with waitpid) */ -PHP_FUNCTION(pcntl_wifstopped) -{ -#ifdef WIFSTOPPED - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - if (WIFSTOPPED(status_word)) RETURN_TRUE; -#endif - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool pcntl_wifsignaled(int status) - Returns true if the child status code represents a process that was terminated due to a signal */ -PHP_FUNCTION(pcntl_wifsignaled) -{ -#ifdef WIFSIGNALED - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - if (WIFSIGNALED(status_word)) RETURN_TRUE; -#endif - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int pcntl_wexitstatus(int status) - Returns the status code of a child's exit */ -PHP_FUNCTION(pcntl_wexitstatus) -{ -#ifdef WEXITSTATUS - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - /* WEXITSTATUS only returns 8 bits so we *MUST* cast this to signed char - if you want to have valid negative exit codes */ - RETURN_LONG((signed char) WEXITSTATUS(status_word)); -#else - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int pcntl_wtermsig(int status) - Returns the number of the signal that terminated the process who's status code is passed */ -PHP_FUNCTION(pcntl_wtermsig) -{ -#ifdef WTERMSIG - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - RETURN_LONG(WTERMSIG(status_word)); -#else - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int pcntl_wstopsig(int status) - Returns the number of the signal that caused the process to stop who's status code is passed */ -PHP_FUNCTION(pcntl_wstopsig) -{ -#ifdef WSTOPSIG - zval **status; - int status_word; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - status_word = (int) Z_LVAL_PP(status); - - RETURN_LONG(WSTOPSIG(status_word)); -#else - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto bool pcntl_exec(string path [, array args [, array envs]]) - Executes specified program in current process space as defined by exec(2) */ -PHP_FUNCTION(pcntl_exec) -{ - zval *args, *envs; - zval **element; - HashTable *args_hash, *envs_hash; - int argc = 0, argi = 0; - int envc = 0, envi = 0; - int return_val = 0; - char **argv = NULL, **envp = NULL; - char **current_arg, **pair; - int pair_length; - char *key; - int key_length; - char *path; - int path_len; - long key_num; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|aa", &path, &path_len, &args, &envs) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() > 1) { - /* Build argumnent list */ - args_hash = HASH_OF(args); - argc = zend_hash_num_elements(args_hash); - - argv = safe_emalloc((argc + 2), sizeof(char *), 0); - *argv = path; - for ( zend_hash_internal_pointer_reset(args_hash), current_arg = argv+1; - (argi < argc && (zend_hash_get_current_data(args_hash, (void **) &element) == SUCCESS)); - (argi++, current_arg++, zend_hash_move_forward(args_hash)) ) { - - convert_to_string_ex(element); - *current_arg = Z_STRVAL_PP(element); - } - *(current_arg) = NULL; - } else { - argv = emalloc(2 * sizeof(char *)); - *argv = path; - *(argv+1) = NULL; - } - - if ( ZEND_NUM_ARGS() == 3 ) { - /* Build environment pair list */ - envs_hash = HASH_OF(envs); - envc = zend_hash_num_elements(envs_hash); - - envp = safe_emalloc((envc + 1), sizeof(char *), 0); - for ( zend_hash_internal_pointer_reset(envs_hash), pair = envp; - (envi < envc && (zend_hash_get_current_data(envs_hash, (void **) &element) == SUCCESS)); - (envi++, pair++, zend_hash_move_forward(envs_hash)) ) { - switch (return_val = zend_hash_get_current_key_ex(envs_hash, &key, &key_length, &key_num, 0, NULL)) { - case HASH_KEY_IS_LONG: - key = emalloc(101); - snprintf(key, 100, "%ld", key_num); - key_length = strlen(key); - break; - case HASH_KEY_NON_EXISTANT: - pair--; - continue; - } - - convert_to_string_ex(element); - - /* Length of element + equal sign + length of key + null */ - pair_length = Z_STRLEN_PP(element) + key_length + 2; - *pair = emalloc(pair_length); - strlcpy(*pair, key, key_length); - strlcat(*pair, "=", pair_length); - strlcat(*pair, Z_STRVAL_PP(element), pair_length); - - /* Cleanup */ - if (return_val == HASH_KEY_IS_LONG) efree(key); - } - *(pair) = NULL; - } - - if (execve(path, argv, envp) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno)); - } - - /* Cleanup */ - if (envp != NULL) { - for (pair = envp; *pair != NULL; pair++) efree(*pair); - efree(envp); - } - - efree(argv); - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool pcntl_signal(int signo, callback handle [, bool restart_syscalls]) - Assigns a system signal handler to a PHP function */ -PHP_FUNCTION(pcntl_signal) -{ - zval *handle, **dest_handle = NULL; - zval func_name; - long signo; - zend_bool restart_syscalls = 1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) { - return; - } - - if (!PCNTL_G(spares)) { - /* since calling malloc() from within a signal handler is not portable, - * pre-allocate a few records for recording signals */ - int i; - for (i = 0; i < 32; i++) { - struct php_pcntl_pending_signal *psig; - - psig = emalloc(sizeof(*psig)); - psig->next = PCNTL_G(spares); - PCNTL_G(spares) = psig; - } - } - - /* Special long value case for SIG_DFL and SIG_IGN */ - if (Z_TYPE_P(handle)==IS_LONG) { - if (Z_LVAL_P(handle)!= (long) SIG_DFL && Z_LVAL_P(handle) != (long) SIG_IGN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for handle argument specifEied"); - } - if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == SIG_ERR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal"); - RETURN_FALSE; - } - RETURN_TRUE; - } - - if (!zend_is_callable(handle, 0, &func_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not a callable function name error", Z_TYPE(func_name), Z_UNIVAL(func_name)); - zval_dtor(&func_name); - RETURN_FALSE; - } - zval_dtor(&func_name); - - /* Add the function name to our signal table */ - zend_hash_index_update(&PCNTL_G(php_signal_table), signo, (void **) &handle, sizeof(zval *), (void **) &dest_handle); - if (dest_handle) zval_add_ref(dest_handle); - - if (php_signal(signo, pcntl_signal_handler, (int) restart_syscalls) == SIG_ERR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -#ifdef HAVE_GETPRIORITY -/* {{{ proto int pcntl_getpriority([int pid [, int process_identifier]]) - Get the priority of any process */ -PHP_FUNCTION(pcntl_getpriority) -{ - long who = PRIO_PROCESS; - long pid = getpid(); - int pri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &pid, &who) == FAILURE) { - RETURN_FALSE; - } - - /* needs to be cleared, since any returned value is valid */ - errno = 0; - - pri = getpriority(who, pid); - - if (errno) { - switch (errno) { - case ESRCH: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno); - break; - case EINVAL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); - break; - } - RETURN_FALSE; - } - - RETURN_LONG(pri); -} -/* }}} */ -#endif - -#ifdef HAVE_SETPRIORITY -/* {{{ proto bool pcntl_setpriority(int priority [, int pid [, int process_identifier]]) - Change the priority of any process */ -PHP_FUNCTION(pcntl_setpriority) -{ - long who = PRIO_PROCESS; - long pid = getpid(); - long pri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &pri, &pid, &who) == FAILURE) { - RETURN_FALSE; - } - - if (setpriority(who, pid, pri)) { - switch (errno) { - case ESRCH: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno); - break; - case EINVAL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno); - break; - case EPERM: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: A process was located, but neither its effective nor real user ID matched the effective user ID of the caller", errno); - break; - case EACCES: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); - break; - } - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* Our custom signal handler that calls the appropriate php_function */ -static void pcntl_signal_handler(int signo) -{ - struct php_pcntl_pending_signal *psig; - TSRMLS_FETCH(); - - psig = PCNTL_G(spares); - if (!psig) { - /* oops, too many signals for us to track, so we'll forget about this one */ - return; - } - PCNTL_G(spares) = psig->next; - - psig->signo = signo; - psig->next = NULL; - - /* the head check is important, as the tick handler cannot atomically clear both - * the head and tail */ - if (PCNTL_G(head) && PCNTL_G(tail)) { - PCNTL_G(tail)->next = psig; - } else { - PCNTL_G(head) = psig; - } - PCNTL_G(tail) = psig; -} - -void pcntl_tick_handler() -{ - zval *param, **handle, *retval; - struct php_pcntl_pending_signal *queue, *next; - TSRMLS_FETCH(); - - /* Bail if the queue is empty or if we are already playing the queue*/ - if (! PCNTL_G(head) || PCNTL_G(processing_signal_queue)) - return; - - /* Prevent reentrant handler calls */ - PCNTL_G(processing_signal_queue) = 1; - - queue = PCNTL_G(head); - PCNTL_G(head) = NULL; /* simple stores are atomic */ - - /* Allocate */ - MAKE_STD_ZVAL(param); - MAKE_STD_ZVAL(retval); - - while (queue) { - if (zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo, (void **) &handle)==SUCCESS) { - ZVAL_LONG(param, queue->signo); - - /* Call php signal handler - Note that we do not report errors, and we ignore the return value */ - /* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */ - call_user_function(EG(function_table), NULL, *handle, retval, 1, ¶m TSRMLS_CC); - } - - next = queue->next; - queue->next = PCNTL_G(spares); - PCNTL_G(spares) = queue; - queue = next; - } - - /* Re-enable queue */ - PCNTL_G(processing_signal_queue) = 0; - - /* Clean up */ - efree(param); - efree(retval); -} - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h deleted file mode 100644 index 98ab55cc6d443..0000000000000 --- a/ext/pcntl/php_pcntl.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene <jason@inetgurus.net> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_PCNTL_H -#define PHP_PCNTL_H - -#include <sys/wait.h> -#include "php_signal.h" -#include "php_ticks.h" -extern zend_module_entry pcntl_module_entry; -#define phpext_pcntl_ptr &pcntl_module_entry - -#ifdef PHP_WIN32 -#define PHP_PCNTL_API __declspec(dllexport) -#else -#define PHP_PCNTL_API -#endif - -PHP_MINIT_FUNCTION(pcntl); -PHP_MSHUTDOWN_FUNCTION(pcntl); -PHP_RINIT_FUNCTION(pcntl); -PHP_RSHUTDOWN_FUNCTION(pcntl); -PHP_MINFO_FUNCTION(pcntl); - -PHP_FUNCTION(pcntl_alarm); -PHP_FUNCTION(pcntl_fork); -PHP_FUNCTION(pcntl_waitpid); -PHP_FUNCTION(pcntl_wait); -PHP_FUNCTION(pcntl_wifexited); -PHP_FUNCTION(pcntl_wifstopped); -PHP_FUNCTION(pcntl_wifsignaled); -PHP_FUNCTION(pcntl_wexitstatus); -PHP_FUNCTION(pcntl_wtermsig); -PHP_FUNCTION(pcntl_wstopsig); -PHP_FUNCTION(pcntl_signal); -PHP_FUNCTION(pcntl_exec); -#ifdef HAVE_GETPRIORITY -PHP_FUNCTION(pcntl_getpriority); -#endif -#ifdef HAVE_SETPRIORITY -PHP_FUNCTION(pcntl_setpriority); -#endif - -struct php_pcntl_pending_signal { - struct php_pcntl_pending_signal *next; - long signo; -}; - -ZEND_BEGIN_MODULE_GLOBALS(pcntl) - HashTable php_signal_table; - int processing_signal_queue; - struct php_pcntl_pending_signal *head, *tail, *spares; -ZEND_END_MODULE_GLOBALS(pcntl) - -#ifdef ZTS -#define PCNTL_G(v) TSRMG(pcntl_globals_id, zend_pcntl_globals *, v) -#else -#define PCNTL_G(v) (pcntl_globals.v) -#endif - -#endif /* PHP_PCNTL_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c deleted file mode 100644 index 6a087af1e909d..0000000000000 --- a/ext/pcntl/php_signal.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene <jason@inetgurus.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php_signal.h" - -/* php_signal using sigaction is derrived from Advanced Programing - * in the Unix Environment by W. Richard Stevens p 298. */ -Sigfunc *php_signal(int signo, Sigfunc *func, int restart) -{ - - struct sigaction act,oact; - act.sa_handler = func; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - if (signo == SIGALRM || (! restart)) { -#ifdef SA_INTERRUPT - act.sa_flags |= SA_INTERRUPT; /* SunOS */ -#endif - } else { -#ifdef SA_RESTART - act.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */ -#endif - } - if (sigaction(signo, &act, &oact) < 0) - return SIG_ERR; - - return oact.sa_handler; -} - diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h deleted file mode 100644 index da00f20562069..0000000000000 --- a/ext/pcntl/php_signal.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene <jason@inetgurus.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include <signal.h> -#ifndef PHP_SIGNAL_H -#define PHP_SIGNAL_H - -typedef void Sigfunc(int); -Sigfunc *php_signal(int signo, Sigfunc *func, int restart); - -#endif diff --git a/ext/pcntl/test-pcntl.php b/ext/pcntl/test-pcntl.php deleted file mode 100755 index 01d44fcad45ca..0000000000000 --- a/ext/pcntl/test-pcntl.php +++ /dev/null @@ -1,40 +0,0 @@ -#!../../php -q -<? - -declare(ticks=1); - -function alarm_handle($signal){ - if ($signal==SIGALRM) print "Child: Caught SIGALRM!!!\n"; -} - -function usr1_handle($signal){ - if ($signal==SIGUSR1) print "Child: Caught SIGUSR1!!!\n"; -} - -print "This test will demonstrate a fork followed by ipc via signals.\n"; - -$pid=pcntl_fork(); -if ($pid==0) { - pcntl_signal(SIGUSR1, "usr1_handle"); - pcntl_signal(SIGALRM, "alarm_handle"); - print "Child: Waiting for alarm.....\n"; - sleep(100); - print "Child: Waiting for usr1......\n"; - sleep(100); - print "Child: Resetting Alarm handler to Ignore....\n"; - pcntl_signal(SIGALRM, SIG_IGN); - print "Child: sleeping for 10 seconds....\n"; - sleep(10); - print "Done\n"; -} else { - print "Parent: Waiting 10 seconds....\n"; - sleep(10); - print "Parent: Sending SIGALRM to Child\n"; - posix_kill($pid,SIGALRM); - sleep(1); - print "Parent: Senging SIGUSR1 to Child\n"; - posix_kill($pid,SIGUSR1); - sleep(2); - print "Parent: Sending SIGALRM to Child\n"; - pcntl_waitpid($pid, &$status, $options); -} diff --git a/ext/pcntl/tests/001.phpt b/ext/pcntl/tests/001.phpt deleted file mode 100644 index 74c529124bf71..0000000000000 --- a/ext/pcntl/tests/001.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test pcntl wait functionality ---SKIPIF-- -<?php - if (!extension_loaded("pcntl")) print "skip"; - if (!function_exists("posix_kill")) print "skip posix_kill() not available"; -?> ---FILE-- -<?php -function test_exit_waits(){ - print "\n\nTesting pcntl_wifexited and wexitstatus...."; - - $pid=pcntl_fork(); - if ($pid==0) { - sleep(1); - exit(-1); - } else { - $options=0; - pcntl_waitpid($pid, $status, $options); - if ( pcntl_wifexited($status) ) print "\nExited With: ". pcntl_wexitstatus($status); - } -} - -function test_exit_signal(){ - print "\n\nTesting pcntl_wifsignaled...."; - - $pid=pcntl_fork(); - - if ($pid==0) { - sleep(10); - exit; - } else { - $options=0; - posix_kill($pid, SIGTERM); - pcntl_waitpid($pid, $status, $options); - if ( pcntl_wifsignaled($status) ) { - $signal_print=pcntl_wtermsig($status); - if ($signal_print==SIGTERM) $signal_print="SIGTERM"; - print "\nProcess was terminated by signal : ". $signal_print; - } - - } -} - - -function test_stop_signal(){ - print "\n\nTesting pcntl_wifstopped and pcntl_wstopsig...."; - - $pid=pcntl_fork(); - - if ($pid==0) { - sleep(1); - exit; - } else { - $options=WUNTRACED; - posix_kill($pid, SIGSTOP); - pcntl_waitpid($pid, $status, $options); - if ( pcntl_wifstopped($status) ) { - $signal_print=pcntl_wstopsig($status); - if ($signal_print==SIGSTOP) $signal_print="SIGSTOP"; - print "\nProcess was stoped by signal : ". $signal_print; - } - posix_kill($pid, SIGCONT); - } -} - -print "Staring wait.h tests...."; -test_exit_waits(); -test_exit_signal(); -test_stop_signal(); -?> ---EXPECT-- -Staring wait.h tests.... - -Testing pcntl_wifexited and wexitstatus.... -Exited With: -1 - -Testing pcntl_wifsignaled.... -Process was terminated by signal : SIGTERM - -Testing pcntl_wifstopped and pcntl_wstopsig.... -Process was stoped by signal : SIGSTOP diff --git a/ext/pcre/CREDITS b/ext/pcre/CREDITS deleted file mode 100644 index ae0fba35d42fd..0000000000000 --- a/ext/pcre/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Perl Compatible Regexps -Andrei Zmievski diff --git a/ext/pcre/config.m4 b/ext/pcre/config.m4 deleted file mode 100644 index d3309f3e40043..0000000000000 --- a/ext/pcre/config.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl By default we'll compile and link against the bundled PCRE library -dnl if DIR is supplied, we'll use that for linking - -PHP_ARG_WITH(pcre-regex,for PCRE support, -[ --without-pcre-regex Do not include Perl Compatible Regular Expressions - support. Use --with-pcre-regex=DIR to specify DIR - where PCRE's include and library files are located, - if not using bundled library.],yes) - -if test "$PHP_PCRE_REGEX" != "no"; then - if test "$PHP_PCRE_REGEX" = "yes"; then - PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_dfa_exec.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_printint.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_ucp_findchar.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -I@ext_srcdir@/pcrelib) - PHP_ADD_BUILD_DIR($ext_builddir/pcrelib) - AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) - else - for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do - test -f $i/pcre.h && PCRE_INCDIR=$i - done - - if test -z "$PCRE_INCDIR"; then - AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX]) - fi - - for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do - test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j - done - - if test -z "$PCRE_LIBDIR" ; then - AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX]) - fi - - changequote({,}) - pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'` - pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'` - changequote([,]) - pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'` - if test "$pcre_minor_length" -eq 2 ; then - pcre_minor="$pcre_minor"0 - fi - pcre_version=$pcre_major$pcre_minor - if test "$pcre_version" -lt 208; then - AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08]) - fi - - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD) - - AC_DEFINE(HAVE_PCRE, 1, [ ]) - PHP_ADD_INCLUDE($PCRE_INCDIR) - PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000) - fi - PHP_SUBST(PCRE_SHARED_LIBADD) -fi diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32 deleted file mode 100644 index 1b37bbe0938a9..0000000000000 --- a/ext/pcre/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pcre-regex", "Perl Compatible Regular Expressions", "yes"); - -if (PHP_PCRE_REGEX == "yes") { - EXTENSION("pcre", "php_pcre.c", PHP_PCRE_REGEX_SHARED, - "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -Iext/pcre/pcrelib -DNO_RECURSE"); - ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_compile.c pcre_config.c pcre_dfa_exec.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_ord2utf8.c pcre_printint.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_ucp_findchar.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre"); - - AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library'); - AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library'); -} diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4 deleted file mode 100644 index d3309f3e40043..0000000000000 --- a/ext/pcre/config0.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl By default we'll compile and link against the bundled PCRE library -dnl if DIR is supplied, we'll use that for linking - -PHP_ARG_WITH(pcre-regex,for PCRE support, -[ --without-pcre-regex Do not include Perl Compatible Regular Expressions - support. Use --with-pcre-regex=DIR to specify DIR - where PCRE's include and library files are located, - if not using bundled library.],yes) - -if test "$PHP_PCRE_REGEX" != "no"; then - if test "$PHP_PCRE_REGEX" = "yes"; then - PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_dfa_exec.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_printint.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_ucp_findchar.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -I@ext_srcdir@/pcrelib) - PHP_ADD_BUILD_DIR($ext_builddir/pcrelib) - AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) - else - for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do - test -f $i/pcre.h && PCRE_INCDIR=$i - done - - if test -z "$PCRE_INCDIR"; then - AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX]) - fi - - for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do - test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j - done - - if test -z "$PCRE_LIBDIR" ; then - AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX]) - fi - - changequote({,}) - pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'` - pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'` - changequote([,]) - pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'` - if test "$pcre_minor_length" -eq 2 ; then - pcre_minor="$pcre_minor"0 - fi - pcre_version=$pcre_major$pcre_minor - if test "$pcre_version" -lt 208; then - AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08]) - fi - - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD) - - AC_DEFINE(HAVE_PCRE, 1, [ ]) - PHP_ADD_INCLUDE($PCRE_INCDIR) - PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000) - fi - PHP_SUBST(PCRE_SHARED_LIBADD) -fi diff --git a/ext/pcre/pcrelib/AUTHORS b/ext/pcre/pcrelib/AUTHORS deleted file mode 100644 index 33df90f8df3e5..0000000000000 --- a/ext/pcre/pcrelib/AUTHORS +++ /dev/null @@ -1,23 +0,0 @@ -THE MAIN PCRE LIBRARY ---------------------- - -Written by: Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk - -University of Cambridge Computing Service, -Cambridge, England. Phone: +44 1223 334714. - -Copyright (c) 1997-2005 University of Cambridge -All rights reserved - - -THE C++ WRAPPER LIBRARY ------------------------ - -Written by: Google Inc. - -Copyright (c) 2005 Google Inc -All rights reserved - -#### diff --git a/ext/pcre/pcrelib/COPYING b/ext/pcre/pcrelib/COPYING deleted file mode 100644 index e8eb0d9370321..0000000000000 --- a/ext/pcre/pcrelib/COPYING +++ /dev/null @@ -1,68 +0,0 @@ -PCRE LICENCE ------------- - -PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - -Release 6 of PCRE is distributed under the terms of the "BSD" licence, as -specified below. The documentation for PCRE, supplied in the "doc" -directory, is distributed under the same terms as the software itself. - -The basic library functions are written in C and are freestanding. Also -included in the distribution is a set of C++ wrapper functions. - - -THE BASIC LIBRARY FUNCTIONS ---------------------------- - -Written by: Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk - -University of Cambridge Computing Service, -Cambridge, England. Phone: +44 1223 334714. - -Copyright (c) 1997-2005 University of Cambridge -All rights reserved. - - -THE C++ WRAPPER FUNCTIONS -------------------------- - -Contributed by: Google Inc. - -Copyright (c) 2005, Google Inc. -All rights reserved. - - -THE "BSD" LICENCE ------------------ - -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 the University of Cambridge nor the name of Google - Inc. nor the names of their 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. - -End diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog deleted file mode 100644 index b9d74d393f71b..0000000000000 --- a/ext/pcre/pcrelib/ChangeLog +++ /dev/null @@ -1,1826 +0,0 @@ -ChangeLog for PCRE ------------------- - -Version 6.2 01-Aug-05 ---------------------- - - 1. There was no test for integer overflow of quantifier values. A construction - such as {1111111111111111} would give undefined results. What is worse, if - a minimum quantifier for a parenthesized subpattern overflowed and became - negative, the calculation of the memory size went wrong. This could have - led to memory overwriting. - - 2. Building PCRE using VPATH was broken. Hopefully it is now fixed. - - 3. Added "b" to the 2nd argument of fopen() in dftables.c, for non-Unix-like - operating environments where this matters. - - 4. Applied Giuseppe Maxia's patch to add additional features for controlling - PCRE options from within the C++ wrapper. - - 5. Named capturing subpatterns were not being correctly counted when a pattern - was compiled. This caused two problems: (a) If there were more than 100 - such subpatterns, the calculation of the memory needed for the whole - compiled pattern went wrong, leading to an overflow error. (b) Numerical - back references of the form \12, where the number was greater than 9, were - not recognized as back references, even though there were sufficient - previous subpatterns. - - 6. Two minor patches to pcrecpp.cc in order to allow it to compile on older - versions of gcc, e.g. 2.95.4. - - -Version 6.1 21-Jun-05 ---------------------- - - 1. There was one reference to the variable "posix" in pcretest.c that was not - surrounded by "#if !defined NOPOSIX". - - 2. Make it possible to compile pcretest without DFA support, UTF8 support, or - the cross-check on the old pcre_info() function, for the benefit of the - cut-down version of PCRE that is currently imported into Exim. - - 3. A (silly) pattern starting with (?i)(?-i) caused an internal space - allocation error. I've done the easy fix, which wastes 2 bytes for sensible - patterns that start (?i) but I don't think that matters. The use of (?i) is - just an example; this all applies to the other options as well. - - 4. Since libtool seems to echo the compile commands it is issuing, the output - from "make" can be reduced a bit by putting "@" in front of each libtool - compile command. - - 5. Patch from the folks at Google for configure.in to be a bit more thorough - in checking for a suitable C++ installation before trying to compile the - C++ stuff. This should fix a reported problem when a compiler was present, - but no suitable headers. - - 6. The man pages all had just "PCRE" as their title. I have changed them to - be the relevant file name. I have also arranged that these names are - retained in the file doc/pcre.txt, which is a concatenation in text format - of all the man pages except the little individual ones for each function. - - 7. The NON-UNIX-USE file had not been updated for the different set of source - files that come with release 6. I also added a few comments about the C++ - wrapper. - - -Version 6.0 07-Jun-05 ---------------------- - - 1. Some minor internal re-organization to help with my DFA experiments. - - 2. Some missing #ifdef SUPPORT_UCP conditionals in pcretest and printint that - didn't matter for the library itself when fully configured, but did matter - when compiling without UCP support, or within Exim, where the ucp files are - not imported. - - 3. Refactoring of the library code to split up the various functions into - different source modules. The addition of the new DFA matching code (see - below) to a single monolithic source would have made it really too - unwieldy, quite apart from causing all the code to be include in a - statically linked application, when only some functions are used. This is - relevant even without the DFA addition now that patterns can be compiled in - one application and matched in another. - - The downside of splitting up is that there have to be some external - functions and data tables that are used internally in different modules of - the library but which are not part of the API. These have all had their - names changed to start with "_pcre_" so that they are unlikely to clash - with other external names. - - 4. Added an alternate matching function, pcre_dfa_exec(), which matches using - a different (DFA) algorithm. Although it is slower than the original - function, it does have some advantages for certain types of matching - problem. - - 5. Upgrades to pcretest in order to test the features of pcre_dfa_exec(), - including restarting after a partial match. - - 6. A patch for pcregrep that defines INVALID_FILE_ATTRIBUTES if it is not - defined when compiling for Windows was sent to me. I have put it into the - code, though I have no means of testing or verifying it. - - 7. Added the pcre_refcount() auxiliary function. - - 8. Added the PCRE_FIRSTLINE option. This constrains an unanchored pattern to - match before or at the first newline in the subject string. In pcretest, - the /f option on a pattern can be used to set this. - - 9. A repeated \w when used in UTF-8 mode with characters greater than 256 - would behave wrongly. This has been present in PCRE since release 4.0. - -10. A number of changes to the pcregrep command: - - (a) Refactored how -x works; insert ^(...)$ instead of setting - PCRE_ANCHORED and checking the length, in preparation for adding - something similar for -w. - - (b) Added the -w (match as a word) option. - - (c) Refactored the way lines are read and buffered so as to have more - than one at a time available. - - (d) Implemented a pcregrep test script. - - (e) Added the -M (multiline match) option. This allows patterns to match - over several lines of the subject. The buffering ensures that at least - 8K, or the rest of the document (whichever is the shorter) is available - for matching (and similarly the previous 8K for lookbehind assertions). - - (f) Changed the --help output so that it now says - - -w, --word-regex(p) - - instead of two lines, one with "regex" and the other with "regexp" - because that confused at least one person since the short forms are the - same. (This required a bit of code, as the output is generated - automatically from a table. It wasn't just a text change.) - - (g) -- can be used to terminate pcregrep options if the next thing isn't an - option but starts with a hyphen. Could be a pattern or a path name - starting with a hyphen, for instance. - - (h) "-" can be given as a file name to represent stdin. - - (i) When file names are being printed, "(standard input)" is used for - the standard input, for compatibility with GNU grep. Previously - "<stdin>" was used. - - (j) The option --label=xxx can be used to supply a name to be used for - stdin when file names are being printed. There is no short form. - - (k) Re-factored the options decoding logic because we are going to add - two more options that take data. Such options can now be given in four - different ways, e.g. "-fname", "-f name", "--file=name", "--file name". - - (l) Added the -A, -B, and -C options for requesting that lines of context - around matches be printed. - - (m) Added the -L option to print the names of files that do not contain - any matching lines, that is, the complement of -l. - - (n) The return code is 2 if any file cannot be opened, but pcregrep does - continue to scan other files. - - (o) The -s option was incorrectly implemented. For compatibility with other - greps, it now suppresses the error message for a non-existent or non- - accessible file (but not the return code). There is a new option called - -q that suppresses the output of matching lines, which was what -s was - previously doing. - - (p) Added --include and --exclude options to specify files for inclusion - and exclusion when recursing. - -11. The Makefile was not using the Autoconf-supported LDFLAGS macro properly. - Hopefully, it now does. - -12. Missing cast in pcre_study(). - -13. Added an "uninstall" target to the makefile. - -14. Replaced "extern" in the function prototypes in Makefile.in with - "PCRE_DATA_SCOPE", which defaults to 'extern' or 'extern "C"' in the Unix - world, but is set differently for Windows. - -15. Added a second compiling function called pcre_compile2(). The only - difference is that it has an extra argument, which is a pointer to an - integer error code. When there is a compile-time failure, this is set - non-zero, in addition to the error test pointer being set to point to an - error message. The new argument may be NULL if no error number is required - (but then you may as well call pcre_compile(), which is now just a - wrapper). This facility is provided because some applications need a - numeric error indication, but it has also enabled me to tidy up the way - compile-time errors are handled in the POSIX wrapper. - -16. Added VPATH=.libs to the makefile; this should help when building with one - prefix path and installing with another. (Or so I'm told by someone who - knows more about this stuff than I do.) - -17. Added a new option, REG_DOTALL, to the POSIX function regcomp(). This - passes PCRE_DOTALL to the pcre_compile() function, making the "." character - match everything, including newlines. This is not POSIX-compatible, but - somebody wanted the feature. From pcretest it can be activated by using - both the P and the s flags. - -18. AC_PROG_LIBTOOL appeared twice in Makefile.in. Removed one. - -19. libpcre.pc was being incorrectly installed as executable. - -20. A couple of places in pcretest check for end-of-line by looking for '\n'; - it now also looks for '\r' so that it will work unmodified on Windows. - -21. Added Google's contributed C++ wrapper to the distribution. - -22. Added some untidy missing memory free() calls in pcretest, to keep - Electric Fence happy when testing. - - - -Version 5.0 13-Sep-04 ---------------------- - - 1. Internal change: literal characters are no longer packed up into items - containing multiple characters in a single byte-string. Each character - is now matched using a separate opcode. However, there may be more than one - byte in the character in UTF-8 mode. - - 2. The pcre_callout_block structure has two new fields: pattern_position and - next_item_length. These contain the offset in the pattern to the next match - item, and its length, respectively. - - 3. The PCRE_AUTO_CALLOUT option for pcre_compile() requests the automatic - insertion of callouts before each pattern item. Added the /C option to - pcretest to make use of this. - - 4. On the advice of a Windows user, the lines - - #if defined(_WIN32) || defined(WIN32) - _setmode( _fileno( stdout ), 0x8000 ); - #endif /* defined(_WIN32) || defined(WIN32) */ - - have been added to the source of pcretest. This apparently does useful - magic in relation to line terminators. - - 5. Changed "r" and "w" in the calls to fopen() in pcretest to "rb" and "wb" - for the benefit of those environments where the "b" makes a difference. - - 6. The icc compiler has the same options as gcc, but "configure" doesn't seem - to know about it. I have put a hack into configure.in that adds in code - to set GCC=yes if CC=icc. This seems to end up at a point in the - generated configure script that is early enough to affect the setting of - compiler options, which is what is needed, but I have no means of testing - whether it really works. (The user who reported this had patched the - generated configure script, which of course I cannot do.) - - LATER: After change 22 below (new libtool files), the configure script - seems to know about icc (and also ecc). Therefore, I have commented out - this hack in configure.in. - - 7. Added support for pkg-config (2 patches were sent in). - - 8. Negated POSIX character classes that used a combination of internal tables - were completely broken. These were [[:^alpha:]], [[:^alnum:]], and - [[:^ascii]]. Typically, they would match almost any characters. The other - POSIX classes were not broken in this way. - - 9. Matching the pattern "\b.*?" against "ab cd", starting at offset 1, failed - to find the match, as PCRE was deluded into thinking that the match had to - start at the start point or following a newline. The same bug applied to - patterns with negative forward assertions or any backward assertions - preceding ".*" at the start, unless the pattern required a fixed first - character. This was a failing pattern: "(?!.bcd).*". The bug is now fixed. - -10. In UTF-8 mode, when moving forwards in the subject after a failed match - starting at the last subject character, bytes beyond the end of the subject - string were read. - -11. Renamed the variable "class" as "classbits" to make life easier for C++ - users. (Previously there was a macro definition, but it apparently wasn't - enough.) - -12. Added the new field "tables" to the extra data so that tables can be passed - in at exec time, or the internal tables can be re-selected. This allows - a compiled regex to be saved and re-used at a later time by a different - program that might have everything at different addresses. - -13. Modified the pcre-config script so that, when run on Solaris, it shows a - -R library as well as a -L library. - -14. The debugging options of pcretest (-d on the command line or D on a - pattern) showed incorrect output for anything following an extended class - that contained multibyte characters and which was followed by a quantifier. - -15. Added optional support for general category Unicode character properties - via the \p, \P, and \X escapes. Unicode property support implies UTF-8 - support. It adds about 90K to the size of the library. The meanings of the - inbuilt class escapes such as \d and \s have NOT been changed. - -16. Updated pcredemo.c to include calls to free() to release the memory for the - compiled pattern. - -17. The generated file chartables.c was being created in the source directory - instead of in the building directory. This caused the build to fail if the - source directory was different from the building directory, and was - read-only. - -18. Added some sample Win commands from Mark Tetrode into the NON-UNIX-USE - file. No doubt somebody will tell me if they don't make sense... Also added - Dan Mooney's comments about building on OpenVMS. - -19. Added support for partial matching via the PCRE_PARTIAL option for - pcre_exec() and the \P data escape in pcretest. - -20. Extended pcretest with 3 new pattern features: - - (i) A pattern option of the form ">rest-of-line" causes pcretest to - write the compiled pattern to the file whose name is "rest-of-line". - This is a straight binary dump of the data, with the saved pointer to - the character tables forced to be NULL. The study data, if any, is - written too. After writing, pcretest reads a new pattern. - - (ii) If, instead of a pattern, "<rest-of-line" is given, pcretest reads a - compiled pattern from the given file. There must not be any - occurrences of "<" in the file name (pretty unlikely); if there are, - pcretest will instead treat the initial "<" as a pattern delimiter. - After reading in the pattern, pcretest goes on to read data lines as - usual. - - (iii) The F pattern option causes pcretest to flip the bytes in the 32-bit - and 16-bit fields in a compiled pattern, to simulate a pattern that - was compiled on a host of opposite endianness. - -21. The pcre-exec() function can now cope with patterns that were compiled on - hosts of opposite endianness, with this restriction: - - As for any compiled expression that is saved and used later, the tables - pointer field cannot be preserved; the extra_data field in the arguments - to pcre_exec() should be used to pass in a tables address if a value - other than the default internal tables were used at compile time. - -22. Calling pcre_exec() with a negative value of the "ovecsize" parameter is - now diagnosed as an error. Previously, most of the time, a negative number - would have been treated as zero, but if in addition "ovector" was passed as - NULL, a crash could occur. - -23. Updated the files ltmain.sh, config.sub, config.guess, and aclocal.m4 with - new versions from the libtool 1.5 distribution (the last one is a copy of - a file called libtool.m4). This seems to have fixed the need to patch - "configure" to support Darwin 1.3 (which I used to do). However, I still - had to patch ltmain.sh to ensure that ${SED} is set (it isn't on my - workstation). - -24. Changed the PCRE licence to be the more standard "BSD" licence. - - -Version 4.5 01-Dec-03 ---------------------- - - 1. There has been some re-arrangement of the code for the match() function so - that it can be compiled in a version that does not call itself recursively. - Instead, it keeps those local variables that need separate instances for - each "recursion" in a frame on the heap, and gets/frees frames whenever it - needs to "recurse". Keeping track of where control must go is done by means - of setjmp/longjmp. The whole thing is implemented by a set of macros that - hide most of the details from the main code, and operates only if - NO_RECURSE is defined while compiling pcre.c. If PCRE is built using the - "configure" mechanism, "--disable-stack-for-recursion" turns on this way of - operating. - - To make it easier for callers to provide specially tailored get/free - functions for this usage, two new functions, pcre_stack_malloc, and - pcre_stack_free, are used. They are always called in strict stacking order, - and the size of block requested is always the same. - - The PCRE_CONFIG_STACKRECURSE info parameter can be used to find out whether - PCRE has been compiled to use the stack or the heap for recursion. The - -C option of pcretest uses this to show which version is compiled. - - A new data escape \S, is added to pcretest; it causes the amounts of store - obtained and freed by both kinds of malloc/free at match time to be added - to the output. - - 2. Changed the locale test to use "fr_FR" instead of "fr" because that's - what's available on my current Linux desktop machine. - - 3. When matching a UTF-8 string, the test for a valid string at the start has - been extended. If start_offset is not zero, PCRE now checks that it points - to a byte that is the start of a UTF-8 character. If not, it returns - PCRE_ERROR_BADUTF8_OFFSET (-11). Note: the whole string is still checked; - this is necessary because there may be backward assertions in the pattern. - When matching the same subject several times, it may save resources to use - PCRE_NO_UTF8_CHECK on all but the first call if the string is long. - - 4. The code for checking the validity of UTF-8 strings has been tightened so - that it rejects (a) strings containing 0xfe or 0xff bytes and (b) strings - containing "overlong sequences". - - 5. Fixed a bug (appearing twice) that I could not find any way of exploiting! - I had written "if ((digitab[*p++] && chtab_digit) == 0)" where the "&&" - should have been "&", but it just so happened that all the cases this let - through by mistake were picked up later in the function. - - 6. I had used a variable called "isblank" - this is a C99 function, causing - some compilers to warn. To avoid this, I renamed it (as "blankclass"). - - 7. Cosmetic: (a) only output another newline at the end of pcretest if it is - prompting; (b) run "./pcretest /dev/null" at the start of the test script - so the version is shown; (c) stop "make test" echoing "./RunTest". - - 8. Added patches from David Burgess to enable PCRE to run on EBCDIC systems. - - 9. The prototype for memmove() for systems that don't have it was using - size_t, but the inclusion of the header that defines size_t was later. I've - moved the #includes for the C headers earlier to avoid this. - -10. Added some adjustments to the code to make it easier to compiler on certain - special systems: - - (a) Some "const" qualifiers were missing. - (b) Added the macro EXPORT before all exported functions; by default this - is defined to be empty. - (c) Changed the dftables auxiliary program (that builds chartables.c) so - that it reads its output file name as an argument instead of writing - to the standard output and assuming this can be redirected. - -11. In UTF-8 mode, if a recursive reference (e.g. (?1)) followed a character - class containing characters with values greater than 255, PCRE compilation - went into a loop. - -12. A recursive reference to a subpattern that was within another subpattern - that had a minimum quantifier of zero caused PCRE to crash. For example, - (x(y(?2))z)? provoked this bug with a subject that got as far as the - recursion. If the recursively-called subpattern itself had a zero repeat, - that was OK. - -13. In pcretest, the buffer for reading a data line was set at 30K, but the - buffer into which it was copied (for escape processing) was still set at - 1024, so long lines caused crashes. - -14. A pattern such as /[ab]{1,3}+/ failed to compile, giving the error - "internal error: code overflow...". This applied to any character class - that was followed by a possessive quantifier. - -15. Modified the Makefile to add libpcre.la as a prerequisite for - libpcreposix.la because I was told this is needed for a parallel build to - work. - -16. If a pattern that contained .* following optional items at the start was - studied, the wrong optimizing data was generated, leading to matching - errors. For example, studying /[ab]*.*c/ concluded, erroneously, that any - matching string must start with a or b or c. The correct conclusion for - this pattern is that a match can start with any character. - - -Version 4.4 13-Aug-03 ---------------------- - - 1. In UTF-8 mode, a character class containing characters with values between - 127 and 255 was not handled correctly if the compiled pattern was studied. - In fixing this, I have also improved the studying algorithm for such - classes (slightly). - - 2. Three internal functions had redundant arguments passed to them. Removal - might give a very teeny performance improvement. - - 3. Documentation bug: the value of the capture_top field in a callout is *one - more than* the number of the hightest numbered captured substring. - - 4. The Makefile linked pcretest and pcregrep with -lpcre, which could result - in incorrectly linking with a previously installed version. They now link - explicitly with libpcre.la. - - 5. configure.in no longer needs to recognize Cygwin specially. - - 6. A problem in pcre.in for Windows platforms is fixed. - - 7. If a pattern was successfully studied, and the -d (or /D) flag was given to - pcretest, it used to include the size of the study block as part of its - output. Unfortunately, the structure contains a field that has a different - size on different hardware architectures. This meant that the tests that - showed this size failed. As the block is currently always of a fixed size, - this information isn't actually particularly useful in pcretest output, so - I have just removed it. - - 8. Three pre-processor statements accidentally did not start in column 1. - Sadly, there are *still* compilers around that complain, even though - standard C has not required this for well over a decade. Sigh. - - 9. In pcretest, the code for checking callouts passed small integers in the - callout_data field, which is a void * field. However, some picky compilers - complained about the casts involved for this on 64-bit systems. Now - pcretest passes the address of the small integer instead, which should get - rid of the warnings. - -10. By default, when in UTF-8 mode, PCRE now checks for valid UTF-8 strings at - both compile and run time, and gives an error if an invalid UTF-8 sequence - is found. There is a option for disabling this check in cases where the - string is known to be correct and/or the maximum performance is wanted. - -11. In response to a bug report, I changed one line in Makefile.in from - - -Wl,--out-implib,.libs/lib@WIN_PREFIX@pcreposix.dll.a \ - to - -Wl,--out-implib,.libs/@WIN_PREFIX@libpcreposix.dll.a \ - - to look similar to other lines, but I have no way of telling whether this - is the right thing to do, as I do not use Windows. No doubt I'll get told - if it's wrong... - - -Version 4.3 21-May-03 ---------------------- - -1. Two instances of @WIN_PREFIX@ omitted from the Windows targets in the - Makefile. - -2. Some refactoring to improve the quality of the code: - - (i) The utf8_table... variables are now declared "const". - - (ii) The code for \cx, which used the "case flipping" table to upper case - lower case letters, now just substracts 32. This is ASCII-specific, - but the whole concept of \cx is ASCII-specific, so it seems - reasonable. - - (iii) PCRE was using its character types table to recognize decimal and - hexadecimal digits in the pattern. This is silly, because it handles - only 0-9, a-f, and A-F, but the character types table is locale- - specific, which means strange things might happen. A private - table is now used for this - though it costs 256 bytes, a table is - much faster than multiple explicit tests. Of course, the standard - character types table is still used for matching digits in subject - strings against \d. - - (iv) Strictly, the identifier ESC_t is reserved by POSIX (all identifiers - ending in _t are). So I've renamed it as ESC_tee. - -3. The first argument for regexec() in the POSIX wrapper should have been - defined as "const". - -4. Changed pcretest to use malloc() for its buffers so that they can be - Electric Fenced for debugging. - -5. There were several places in the code where, in UTF-8 mode, PCRE would try - to read one or more bytes before the start of the subject string. Often this - had no effect on PCRE's behaviour, but in some circumstances it could - provoke a segmentation fault. - -6. A lookbehind at the start of a pattern in UTF-8 mode could also cause PCRE - to try to read one or more bytes before the start of the subject string. - -7. A lookbehind in a pattern matched in non-UTF-8 mode on a PCRE compiled with - UTF-8 support could misbehave in various ways if the subject string - contained bytes with the 0x80 bit set and the 0x40 bit unset in a lookbehind - area. (PCRE was not checking for the UTF-8 mode flag, and trying to move - back over UTF-8 characters.) - - -Version 4.2 14-Apr-03 ---------------------- - -1. Typo "#if SUPPORT_UTF8" instead of "#ifdef SUPPORT_UTF8" fixed. - -2. Changes to the building process, supplied by Ronald Landheer-Cieslak - [ON_WINDOWS]: new variable, "#" on non-Windows platforms - [NOT_ON_WINDOWS]: new variable, "#" on Windows platforms - [WIN_PREFIX]: new variable, "cyg" for Cygwin - * Makefile.in: use autoconf substitution for OBJEXT, EXEEXT, BUILD_OBJEXT - and BUILD_EXEEXT - Note: automatic setting of the BUILD variables is not yet working - set CPPFLAGS and BUILD_CPPFLAGS (but don't use yet) - should be used at - compile-time but not at link-time - [LINK]: use for linking executables only - make different versions for Windows and non-Windows - [LINKLIB]: new variable, copy of UNIX-style LINK, used for linking - libraries - [LINK_FOR_BUILD]: new variable - [OBJEXT]: use throughout - [EXEEXT]: use throughout - <winshared>: new target - <wininstall>: new target - <dftables.o>: use native compiler - <dftables>: use native linker - <install>: handle Windows platform correctly - <clean>: ditto - <check>: ditto - copy DLL to top builddir before testing - - As part of these changes, -no-undefined was removed again. This was reported - to give trouble on HP-UX 11.0, so getting rid of it seems like a good idea - in any case. - -3. Some tidies to get rid of compiler warnings: - - . In the match_data structure, match_limit was an unsigned long int, whereas - match_call_count was an int. I've made them both unsigned long ints. - - . In pcretest the fact that a const uschar * doesn't automatically cast to - a void * provoked a warning. - - . Turning on some more compiler warnings threw up some "shadow" variables - and a few more missing casts. - -4. If PCRE was complied with UTF-8 support, but called without the PCRE_UTF8 - option, a class that contained a single character with a value between 128 - and 255 (e.g. /[\xFF]/) caused PCRE to crash. - -5. If PCRE was compiled with UTF-8 support, but called without the PCRE_UTF8 - option, a class that contained several characters, but with at least one - whose value was between 128 and 255 caused PCRE to crash. - - -Version 4.1 12-Mar-03 ---------------------- - -1. Compiling with gcc -pedantic found a couple of places where casts were -needed, and a string in dftables.c that was longer than standard compilers are -required to support. - -2. Compiling with Sun's compiler found a few more places where the code could -be tidied up in order to avoid warnings. - -3. The variables for cross-compiling were called HOST_CC and HOST_CFLAGS; the -first of these names is deprecated in the latest Autoconf in favour of the name -CC_FOR_BUILD, because "host" is typically used to mean the system on which the -compiled code will be run. I can't find a reference for HOST_CFLAGS, but by -analogy I have changed it to CFLAGS_FOR_BUILD. - -4. Added -no-undefined to the linking command in the Makefile, because this is -apparently helpful for Windows. To make it work, also added "-L. -lpcre" to the -linking step for the pcreposix library. - -5. PCRE was failing to diagnose the case of two named groups with the same -name. - -6. A problem with one of PCRE's optimizations was discovered. PCRE remembers a -literal character that is needed in the subject for a match, and scans along to -ensure that it is present before embarking on the full matching process. This -saves time in cases of nested unlimited repeats that are never going to match. -Problem: the scan can take a lot of time if the subject is very long (e.g. -megabytes), thus penalizing straightforward matches. It is now done only if the -amount of subject to be scanned is less than 1000 bytes. - -7. A lesser problem with the same optimization is that it was recording the -first character of an anchored pattern as "needed", thus provoking a search -right along the subject, even when the first match of the pattern was going to -fail. The "needed" character is now not set for anchored patterns, unless it -follows something in the pattern that is of non-fixed length. Thus, it still -fulfils its original purpose of finding quick non-matches in cases of nested -unlimited repeats, but isn't used for simple anchored patterns such as /^abc/. - - -Version 4.0 17-Feb-03 ---------------------- - -1. If a comment in an extended regex that started immediately after a meta-item -extended to the end of string, PCRE compiled incorrect data. This could lead to -all kinds of weird effects. Example: /#/ was bad; /()#/ was bad; /a#/ was not. - -2. Moved to autoconf 2.53 and libtool 1.4.2. - -3. Perl 5.8 no longer needs "use utf8" for doing UTF-8 things. Consequently, -the special perltest8 script is no longer needed - all the tests can be run -from a single perltest script. - -4. From 5.004, Perl has not included the VT character (0x0b) in the set defined -by \s. It has now been removed in PCRE. This means it isn't recognized as -whitespace in /x regexes too, which is the same as Perl. Note that the POSIX -class [:space:] *does* include VT, thereby creating a mess. - -5. Added the class [:blank:] (a GNU extension from Perl 5.8) to match only -space and tab. - -6. Perl 5.005 was a long time ago. It's time to amalgamate the tests that use -its new features into the main test script, reducing the number of scripts. - -7. Perl 5.8 has changed the meaning of patterns like /a(?i)b/. Earlier versions -were backward compatible, and made the (?i) apply to the whole pattern, as if -/i were given. Now it behaves more logically, and applies the option setting -only to what follows. PCRE has been changed to follow suit. However, if it -finds options settings right at the start of the pattern, it extracts them into -the global options, as before. Thus, they show up in the info data. - -8. Added support for the \Q...\E escape sequence. Characters in between are -treated as literals. This is slightly different from Perl in that $ and @ are -also handled as literals inside the quotes. In Perl, they will cause variable -interpolation. Note the following examples: - - Pattern PCRE matches Perl matches - - \Qabc$xyz\E abc$xyz abc followed by the contents of $xyz - \Qabc\$xyz\E abc\$xyz abc\$xyz - \Qabc\E\$\Qxyz\E abc$xyz abc$xyz - -For compatibility with Perl, \Q...\E sequences are recognized inside character -classes as well as outside them. - -9. Re-organized 3 code statements in pcretest to avoid "overflow in -floating-point constant arithmetic" warnings from a Microsoft compiler. Added a -(size_t) cast to one statement in pcretest and one in pcreposix to avoid -signed/unsigned warnings. - -10. SunOS4 doesn't have strtoul(). This was used only for unpicking the -o -option for pcretest, so I've replaced it by a simple function that does just -that job. - -11. pcregrep was ending with code 0 instead of 2 for the commands "pcregrep" or -"pcregrep -". - -12. Added "possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's -Java package. This provides some syntactic sugar for simple cases of what my -documentation calls "once-only subpatterns". A pattern such as x*+ is the same -as (?>x*). In other words, if what is inside (?>...) is just a single repeated -item, you can use this simplified notation. Note that only makes sense with -greedy quantifiers. Consequently, the use of the possessive quantifier forces -greediness, whatever the setting of the PCRE_UNGREEDY option. - -13. A change of greediness default within a pattern was not taking effect at -the current level for patterns like /(b+(?U)a+)/. It did apply to parenthesized -subpatterns that followed. Patterns like /b+(?U)a+/ worked because the option -was abstracted outside. - -14. PCRE now supports the \G assertion. It is true when the current matching -position is at the start point of the match. This differs from \A when the -starting offset is non-zero. Used with the /g option of pcretest (or similar -code), it works in the same way as it does for Perl's /g option. If all -alternatives of a regex begin with \G, the expression is anchored to the start -match position, and the "anchored" flag is set in the compiled expression. - -15. Some bugs concerning the handling of certain option changes within patterns -have been fixed. These applied to options other than (?ims). For example, -"a(?x: b c )d" did not match "XabcdY" but did match "Xa b c dY". It should have -been the other way round. Some of this was related to change 7 above. - -16. PCRE now gives errors for /[.x.]/ and /[=x=]/ as unsupported POSIX -features, as Perl does. Previously, PCRE gave the warnings only for /[[.x.]]/ -and /[[=x=]]/. PCRE now also gives an error for /[:name:]/ because it supports -POSIX classes only within a class (e.g. /[[:alpha:]]/). - -17. Added support for Perl's \C escape. This matches one byte, even in UTF8 -mode. Unlike ".", it always matches newline, whatever the setting of -PCRE_DOTALL. However, PCRE does not permit \C to appear in lookbehind -assertions. Perl allows it, but it doesn't (in general) work because it can't -calculate the length of the lookbehind. At least, that's the case for Perl -5.8.0 - I've been told they are going to document that it doesn't work in -future. - -18. Added an error diagnosis for escapes that PCRE does not support: these are -\L, \l, \N, \P, \p, \U, \u, and \X. - -19. Although correctly diagnosing a missing ']' in a character class, PCRE was -reading past the end of the pattern in cases such as /[abcd/. - -20. PCRE was getting more memory than necessary for patterns with classes that -contained both POSIX named classes and other characters, e.g. /[[:space:]abc/. - -21. Added some code, conditional on #ifdef VPCOMPAT, to make life easier for -compiling PCRE for use with Virtual Pascal. - -22. Small fix to the Makefile to make it work properly if the build is done -outside the source tree. - -23. Added a new extension: a condition to go with recursion. If a conditional -subpattern starts with (?(R) the "true" branch is used if recursion has -happened, whereas the "false" branch is used only at the top level. - -24. When there was a very long string of literal characters (over 255 bytes -without UTF support, over 250 bytes with UTF support), the computation of how -much memory was required could be incorrect, leading to segfaults or other -strange effects. - -25. PCRE was incorrectly assuming anchoring (either to start of subject or to -start of line for a non-DOTALL pattern) when a pattern started with (.*) and -there was a subsequent back reference to those brackets. This meant that, for -example, /(.*)\d+\1/ failed to match "abc123bc". Unfortunately, it isn't -possible to check for precisely this case. All we can do is abandon the -optimization if .* occurs inside capturing brackets when there are any back -references whatsoever. (See below for a better fix that came later.) - -26. The handling of the optimization for finding the first character of a -non-anchored pattern, and for finding a character that is required later in the -match were failing in some cases. This didn't break the matching; it just -failed to optimize when it could. The way this is done has been re-implemented. - -27. Fixed typo in error message for invalid (?R item (it said "(?p"). - -28. Added a new feature that provides some of the functionality that Perl -provides with (?{...}). The facility is termed a "callout". The way it is done -in PCRE is for the caller to provide an optional function, by setting -pcre_callout to its entry point. Like pcre_malloc and pcre_free, this is a -global variable. By default it is unset, which disables all calling out. To get -the function called, the regex must include (?C) at appropriate points. This -is, in fact, equivalent to (?C0), and any number <= 255 may be given with (?C). -This provides a means of identifying different callout points. When PCRE -reaches such a point in the regex, if pcre_callout has been set, the external -function is called. It is provided with data in a structure called -pcre_callout_block, which is defined in pcre.h. If the function returns 0, -matching continues; if it returns a non-zero value, the match at the current -point fails. However, backtracking will occur if possible. [This was changed -later and other features added - see item 49 below.] - -29. pcretest is upgraded to test the callout functionality. It provides a -callout function that displays information. By default, it shows the start of -the match and the current position in the text. There are some new data escapes -to vary what happens: - - \C+ in addition, show current contents of captured substrings - \C- do not supply a callout function - \C!n return 1 when callout number n is reached - \C!n!m return 1 when callout number n is reached for the mth time - -30. If pcregrep was called with the -l option and just a single file name, it -output "<stdin>" if a match was found, instead of the file name. - -31. Improve the efficiency of the POSIX API to PCRE. If the number of capturing -slots is less than POSIX_MALLOC_THRESHOLD, use a block on the stack to pass to -pcre_exec(). This saves a malloc/free per call. The default value of -POSIX_MALLOC_THRESHOLD is 10; it can be changed by --with-posix-malloc-threshold -when configuring. - -32. The default maximum size of a compiled pattern is 64K. There have been a -few cases of people hitting this limit. The code now uses macros to handle the -storing of links as offsets within the compiled pattern. It defaults to 2-byte -links, but this can be changed to 3 or 4 bytes by --with-link-size when -configuring. Tests 2 and 5 work only with 2-byte links because they output -debugging information about compiled patterns. - -33. Internal code re-arrangements: - -(a) Moved the debugging function for printing out a compiled regex into - its own source file (printint.c) and used #include to pull it into - pcretest.c and, when DEBUG is defined, into pcre.c, instead of having two - separate copies. - -(b) Defined the list of op-code names for debugging as a macro in - internal.h so that it is next to the definition of the opcodes. - -(c) Defined a table of op-code lengths for simpler skipping along compiled - code. This is again a macro in internal.h so that it is next to the - definition of the opcodes. - -34. Added support for recursive calls to individual subpatterns, along the -lines of Robin Houston's patch (but implemented somewhat differently). - -35. Further mods to the Makefile to help Win32. Also, added code to pcregrep to -allow it to read and process whole directories in Win32. This code was -contributed by Lionel Fourquaux; it has not been tested by me. - -36. Added support for named subpatterns. The Python syntax (?P<name>...) is -used to name a group. Names consist of alphanumerics and underscores, and must -be unique. Back references use the syntax (?P=name) and recursive calls use -(?P>name) which is a PCRE extension to the Python extension. Groups still have -numbers. The function pcre_fullinfo() can be used after compilation to extract -a name/number map. There are three relevant calls: - - PCRE_INFO_NAMEENTRYSIZE yields the size of each entry in the map - PCRE_INFO_NAMECOUNT yields the number of entries - PCRE_INFO_NAMETABLE yields a pointer to the map. - -The map is a vector of fixed-size entries. The size of each entry depends on -the length of the longest name used. The first two bytes of each entry are the -group number, most significant byte first. There follows the corresponding -name, zero terminated. The names are in alphabetical order. - -37. Make the maximum literal string in the compiled code 250 for the non-UTF-8 -case instead of 255. Making it the same both with and without UTF-8 support -means that the same test output works with both. - -38. There was a case of malloc(0) in the POSIX testing code in pcretest. Avoid -calling malloc() with a zero argument. - -39. Change 25 above had to resort to a heavy-handed test for the .* anchoring -optimization. I've improved things by keeping a bitmap of backreferences with -numbers 1-31 so that if .* occurs inside capturing brackets that are not in -fact referenced, the optimization can be applied. It is unlikely that a -relevant occurrence of .* (i.e. one which might indicate anchoring or forcing -the match to follow \n) will appear inside brackets with a number greater than -31, but if it does, any back reference > 31 suppresses the optimization. - -40. Added a new compile-time option PCRE_NO_AUTO_CAPTURE. This has the effect -of disabling numbered capturing parentheses. Any opening parenthesis that is -not followed by ? behaves as if it were followed by ?: but named parentheses -can still be used for capturing (and they will acquire numbers in the usual -way). - -41. Redesigned the return codes from the match() function into yes/no/error so -that errors can be passed back from deep inside the nested calls. A malloc -failure while inside a recursive subpattern call now causes the -PCRE_ERROR_NOMEMORY return instead of quietly going wrong. - -42. It is now possible to set a limit on the number of times the match() -function is called in a call to pcre_exec(). This facility makes it possible to -limit the amount of recursion and backtracking, though not in a directly -obvious way, because the match() function is used in a number of different -circumstances. The count starts from zero for each position in the subject -string (for non-anchored patterns). The default limit is, for compatibility, a -large number, namely 10 000 000. You can change this in two ways: - -(a) When configuring PCRE before making, you can use --with-match-limit=n - to set a default value for the compiled library. - -(b) For each call to pcre_exec(), you can pass a pcre_extra block in which - a different value is set. See 45 below. - -If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. - -43. Added a new function pcre_config(int, void *) to enable run-time extraction -of things that can be changed at compile time. The first argument specifies -what is wanted and the second points to where the information is to be placed. -The current list of available information is: - - PCRE_CONFIG_UTF8 - -The output is an integer that is set to one if UTF-8 support is available; -otherwise it is set to zero. - - PCRE_CONFIG_NEWLINE - -The output is an integer that it set to the value of the code that is used for -newline. It is either LF (10) or CR (13). - - PCRE_CONFIG_LINK_SIZE - -The output is an integer that contains the number of bytes used for internal -linkage in compiled expressions. The value is 2, 3, or 4. See item 32 above. - - PCRE_CONFIG_POSIX_MALLOC_THRESHOLD - -The output is an integer that contains the threshold above which the POSIX -interface uses malloc() for output vectors. See item 31 above. - - PCRE_CONFIG_MATCH_LIMIT - -The output is an unsigned integer that contains the default limit of the number -of match() calls in a pcre_exec() execution. See 42 above. - -44. pcretest has been upgraded by the addition of the -C option. This causes it -to extract all the available output from the new pcre_config() function, and to -output it. The program then exits immediately. - -45. A need has arisen to pass over additional data with calls to pcre_exec() in -order to support additional features. One way would have been to define -pcre_exec2() (for example) with extra arguments, but this would not have been -extensible, and would also have required all calls to the original function to -be mapped to the new one. Instead, I have chosen to extend the mechanism that -is used for passing in "extra" data from pcre_study(). - -The pcre_extra structure is now exposed and defined in pcre.h. It currently -contains the following fields: - - flags a bitmap indicating which of the following fields are set - study_data opaque data from pcre_study() - match_limit a way of specifying a limit on match() calls for a specific - call to pcre_exec() - callout_data data for callouts (see 49 below) - -The flag bits are also defined in pcre.h, and are - - PCRE_EXTRA_STUDY_DATA - PCRE_EXTRA_MATCH_LIMIT - PCRE_EXTRA_CALLOUT_DATA - -The pcre_study() function now returns one of these new pcre_extra blocks, with -the actual study data pointed to by the study_data field, and the -PCRE_EXTRA_STUDY_DATA flag set. This can be passed directly to pcre_exec() as -before. That is, this change is entirely upwards-compatible and requires no -change to existing code. - -If you want to pass in additional data to pcre_exec(), you can either place it -in a pcre_extra block provided by pcre_study(), or create your own pcre_extra -block. - -46. pcretest has been extended to test the PCRE_EXTRA_MATCH_LIMIT feature. If a -data string contains the escape sequence \M, pcretest calls pcre_exec() several -times with different match limits, until it finds the minimum value needed for -pcre_exec() to complete. The value is then output. This can be instructive; for -most simple matches the number is quite small, but for pathological cases it -gets very large very quickly. - -47. There's a new option for pcre_fullinfo() called PCRE_INFO_STUDYSIZE. It -returns the size of the data block pointed to by the study_data field in a -pcre_extra block, that is, the value that was passed as the argument to -pcre_malloc() when PCRE was getting memory in which to place the information -created by pcre_study(). The fourth argument should point to a size_t variable. -pcretest has been extended so that this information is shown after a successful -pcre_study() call when information about the compiled regex is being displayed. - -48. Cosmetic change to Makefile: there's no need to have / after $(DESTDIR) -because what follows is always an absolute path. (Later: it turns out that this -is more than cosmetic for MinGW, because it doesn't like empty path -components.) - -49. Some changes have been made to the callout feature (see 28 above): - -(i) A callout function now has three choices for what it returns: - - 0 => success, carry on matching - > 0 => failure at this point, but backtrack if possible - < 0 => serious error, return this value from pcre_exec() - - Negative values should normally be chosen from the set of PCRE_ERROR_xxx - values. In particular, returning PCRE_ERROR_NOMATCH forces a standard - "match failed" error. The error number PCRE_ERROR_CALLOUT is reserved for - use by callout functions. It will never be used by PCRE itself. - -(ii) The pcre_extra structure (see 45 above) has a void * field called - callout_data, with corresponding flag bit PCRE_EXTRA_CALLOUT_DATA. The - pcre_callout_block structure has a field of the same name. The contents of - the field passed in the pcre_extra structure are passed to the callout - function in the corresponding field in the callout block. This makes it - easier to use the same callout-containing regex from multiple threads. For - testing, the pcretest program has a new data escape - - \C*n pass the number n (may be negative) as callout_data - - If the callout function in pcretest receives a non-zero value as - callout_data, it returns that value. - -50. Makefile wasn't handling CFLAGS properly when compiling dftables. Also, -there were some redundant $(CFLAGS) in commands that are now specified as -$(LINK), which already includes $(CFLAGS). - -51. Extensions to UTF-8 support are listed below. These all apply when (a) PCRE -has been compiled with UTF-8 support *and* pcre_compile() has been compiled -with the PCRE_UTF8 flag. Patterns that are compiled without that flag assume -one-byte characters throughout. Note that case-insensitive matching applies -only to characters whose values are less than 256. PCRE doesn't support the -notion of cases for higher-valued characters. - -(i) A character class whose characters are all within 0-255 is handled as - a bit map, and the map is inverted for negative classes. Previously, a - character > 255 always failed to match such a class; however it should - match if the class was a negative one (e.g. [^ab]). This has been fixed. - -(ii) A negated character class with a single character < 255 is coded as - "not this character" (OP_NOT). This wasn't working properly when the test - character was multibyte, either singly or repeated. - -(iii) Repeats of multibyte characters are now handled correctly in UTF-8 - mode, for example: \x{100}{2,3}. - -(iv) The character escapes \b, \B, \d, \D, \s, \S, \w, and \W (either - singly or repeated) now correctly test multibyte characters. However, - PCRE doesn't recognize any characters with values greater than 255 as - digits, spaces, or word characters. Such characters always match \D, \S, - and \W, and never match \d, \s, or \w. - -(v) Classes may now contain characters and character ranges with values - greater than 255. For example: [ab\x{100}-\x{400}]. - -(vi) pcregrep now has a --utf-8 option (synonym -u) which makes it call - PCRE in UTF-8 mode. - -52. The info request value PCRE_INFO_FIRSTCHAR has been renamed -PCRE_INFO_FIRSTBYTE because it is a byte value. However, the old name is -retained for backwards compatibility. (Note that LASTLITERAL is also a byte -value.) - -53. The single man page has become too large. I have therefore split it up into -a number of separate man pages. These also give rise to individual HTML pages; -these are now put in a separate directory, and there is an index.html page that -lists them all. Some hyperlinking between the pages has been installed. - -54. Added convenience functions for handling named capturing parentheses. - -55. Unknown escapes inside character classes (e.g. [\M]) and escapes that -aren't interpreted therein (e.g. [\C]) are literals in Perl. This is now also -true in PCRE, except when the PCRE_EXTENDED option is set, in which case they -are faulted. - -56. Introduced HOST_CC and HOST_CFLAGS which can be set in the environment when -calling configure. These values are used when compiling the dftables.c program -which is run to generate the source of the default character tables. They -default to the values of CC and CFLAGS. If you are cross-compiling PCRE, -you will need to set these values. - -57. Updated the building process for Windows DLL, as provided by Fred Cox. - - -Version 3.9 02-Jan-02 ---------------------- - -1. A bit of extraneous text had somehow crept into the pcregrep documentation. - -2. If --disable-static was given, the building process failed when trying to -build pcretest and pcregrep. (For some reason it was using libtool to compile -them, which is not right, as they aren't part of the library.) - - -Version 3.8 18-Dec-01 ---------------------- - -1. The experimental UTF-8 code was completely screwed up. It was packing the -bytes in the wrong order. How dumb can you get? - - -Version 3.7 29-Oct-01 ---------------------- - -1. In updating pcretest to check change 1 of version 3.6, I screwed up. -This caused pcretest, when used on the test data, to segfault. Unfortunately, -this didn't happen under Solaris 8, where I normally test things. - -2. The Makefile had to be changed to make it work on BSD systems, where 'make' -doesn't seem to recognize that ./xxx and xxx are the same file. (This entry -isn't in ChangeLog distributed with 3.7 because I forgot when I hastily made -this fix an hour or so after the initial 3.7 release.) - - -Version 3.6 23-Oct-01 ---------------------- - -1. Crashed with /(sens|respons)e and \1ibility/ and "sense and sensibility" if -offsets passed as NULL with zero offset count. - -2. The config.guess and config.sub files had not been updated when I moved to -the latest autoconf. - - -Version 3.5 15-Aug-01 ---------------------- - -1. Added some missing #if !defined NOPOSIX conditionals in pcretest.c that -had been forgotten. - -2. By using declared but undefined structures, we can avoid using "void" -definitions in pcre.h while keeping the internal definitions of the structures -private. - -3. The distribution is now built using autoconf 2.50 and libtool 1.4. From a -user point of view, this means that both static and shared libraries are built -by default, but this can be individually controlled. More of the work of -handling this static/shared cases is now inside libtool instead of PCRE's make -file. - -4. The pcretest utility is now installed along with pcregrep because it is -useful for users (to test regexs) and by doing this, it automatically gets -relinked by libtool. The documentation has been turned into a man page, so -there are now .1, .txt, and .html versions in /doc. - -5. Upgrades to pcregrep: - (i) Added long-form option names like gnu grep. - (ii) Added --help to list all options with an explanatory phrase. - (iii) Added -r, --recursive to recurse into sub-directories. - (iv) Added -f, --file to read patterns from a file. - -6. pcre_exec() was referring to its "code" argument before testing that -argument for NULL (and giving an error if it was NULL). - -7. Upgraded Makefile.in to allow for compiling in a different directory from -the source directory. - -8. Tiny buglet in pcretest: when pcre_fullinfo() was called to retrieve the -options bits, the pointer it was passed was to an int instead of to an unsigned -long int. This mattered only on 64-bit systems. - -9. Fixed typo (3.4/1) in pcre.h again. Sigh. I had changed pcre.h (which is -generated) instead of pcre.in, which it its source. Also made the same change -in several of the .c files. - -10. A new release of gcc defines printf() as a macro, which broke pcretest -because it had an ifdef in the middle of a string argument for printf(). Fixed -by using separate calls to printf(). - -11. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure -script, to force use of CR or LF instead of \n in the source. On non-Unix -systems, the value can be set in config.h. - -12. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an -absolute limit. Changed the text of the error message to make this clear, and -likewise updated the man page. - -13. The limit of 99 on the number of capturing subpatterns has been removed. -The new limit is 65535, which I hope will not be a "real" limit. - - -Version 3.4 22-Aug-00 ---------------------- - -1. Fixed typo in pcre.h: unsigned const char * changed to const unsigned char *. - -2. Diagnose condition (?(0) as an error instead of crashing on matching. - - -Version 3.3 01-Aug-00 ---------------------- - -1. If an octal character was given, but the value was greater than \377, it -was not getting masked to the least significant bits, as documented. This could -lead to crashes in some systems. - -2. Perl 5.6 (if not earlier versions) accepts classes like [a-\d] and treats -the hyphen as a literal. PCRE used to give an error; it now behaves like Perl. - -3. Added the functions pcre_free_substring() and pcre_free_substring_list(). -These just pass their arguments on to (pcre_free)(), but they are provided -because some uses of PCRE bind it to non-C systems that can call its functions, -but cannot call free() or pcre_free() directly. - -4. Add "make test" as a synonym for "make check". Corrected some comments in -the Makefile. - -5. Add $(DESTDIR)/ in front of all the paths in the "install" target in the -Makefile. - -6. Changed the name of pgrep to pcregrep, because Solaris has introduced a -command called pgrep for grepping around the active processes. - -7. Added the beginnings of support for UTF-8 character strings. - -8. Arranged for the Makefile to pass over the settings of CC, CFLAGS, and -RANLIB to ./ltconfig so that they are used by libtool. I think these are all -the relevant ones. (AR is not passed because ./ltconfig does its own figuring -out for the ar command.) - - -Version 3.2 12-May-00 ---------------------- - -This is purely a bug fixing release. - -1. If the pattern /((Z)+|A)*/ was matched agained ZABCDEFG it matched Z instead -of ZA. This was just one example of several cases that could provoke this bug, -which was introduced by change 9 of version 2.00. The code for breaking -infinite loops after an iteration that matches an empty string was't working -correctly. - -2. The pcretest program was not imitating Perl correctly for the pattern /a*/g -when matched against abbab (for example). After matching an empty string, it -wasn't forcing anchoring when setting PCRE_NOTEMPTY for the next attempt; this -caused it to match further down the string than it should. - -3. The code contained an inclusion of sys/types.h. It isn't clear why this -was there because it doesn't seem to be needed, and it causes trouble on some -systems, as it is not a Standard C header. It has been removed. - -4. Made 4 silly changes to the source to avoid stupid compiler warnings that -were reported on the Macintosh. The changes were from - - while ((c = *(++ptr)) != 0 && c != '\n'); -to - while ((c = *(++ptr)) != 0 && c != '\n') ; - -Totally extraordinary, but if that's what it takes... - -5. PCRE is being used in one environment where neither memmove() nor bcopy() is -available. Added HAVE_BCOPY and an autoconf test for it; if neither -HAVE_MEMMOVE nor HAVE_BCOPY is set, use a built-in emulation function which -assumes the way PCRE uses memmove() (always moving upwards). - -6. PCRE is being used in one environment where strchr() is not available. There -was only one use in pcre.c, and writing it out to avoid strchr() probably gives -faster code anyway. - - -Version 3.1 09-Feb-00 ---------------------- - -The only change in this release is the fixing of some bugs in Makefile.in for -the "install" target: - -(1) It was failing to install pcreposix.h. - -(2) It was overwriting the pcre.3 man page with the pcreposix.3 man page. - - -Version 3.0 01-Feb-00 ---------------------- - -1. Add support for the /+ modifier to perltest (to output $` like it does in -pcretest). - -2. Add support for the /g modifier to perltest. - -3. Fix pcretest so that it behaves even more like Perl for /g when the pattern -matches null strings. - -4. Fix perltest so that it doesn't do unwanted things when fed an empty -pattern. Perl treats empty patterns specially - it reuses the most recent -pattern, which is not what we want. Replace // by /(?#)/ in order to avoid this -effect. - -5. The POSIX interface was broken in that it was just handing over the POSIX -captured string vector to pcre_exec(), but (since release 2.00) PCRE has -required a bigger vector, with some working space on the end. This means that -the POSIX wrapper now has to get and free some memory, and copy the results. - -6. Added some simple autoconf support, placing the test data and the -documentation in separate directories, re-organizing some of the -information files, and making it build pcre-config (a GNU standard). Also added -libtool support for building PCRE as a shared library, which is now the -default. - -7. Got rid of the leading zero in the definition of PCRE_MINOR because 08 and -09 are not valid octal constants. Single digits will be used for minor values -less than 10. - -8. Defined REG_EXTENDED and REG_NOSUB as zero in the POSIX header, so that -existing programs that set these in the POSIX interface can use PCRE without -modification. - -9. Added a new function, pcre_fullinfo() with an extensible interface. It can -return all that pcre_info() returns, plus additional data. The pcre_info() -function is retained for compatibility, but is considered to be obsolete. - -10. Added experimental recursion feature (?R) to handle one common case that -Perl 5.6 will be able to do with (?p{...}). - -11. Added support for POSIX character classes like [:alpha:], which Perl is -adopting. - - -Version 2.08 31-Aug-99 ----------------------- - -1. When startoffset was not zero and the pattern began with ".*", PCRE was not -trying to match at the startoffset position, but instead was moving forward to -the next newline as if a previous match had failed. - -2. pcretest was not making use of PCRE_NOTEMPTY when repeating for /g and /G, -and could get into a loop if a null string was matched other than at the start -of the subject. - -3. Added definitions of PCRE_MAJOR and PCRE_MINOR to pcre.h so the version can -be distinguished at compile time, and for completeness also added PCRE_DATE. - -5. Added Paul Sokolovsky's minor changes to make it easy to compile a Win32 DLL -in GnuWin32 environments. - - -Version 2.07 29-Jul-99 ----------------------- - -1. The documentation is now supplied in plain text form and HTML as well as in -the form of man page sources. - -2. C++ compilers don't like assigning (void *) values to other pointer types. -In particular this affects malloc(). Although there is no problem in Standard -C, I've put in casts to keep C++ compilers happy. - -3. Typo on pcretest.c; a cast of (unsigned char *) in the POSIX regexec() call -should be (const char *). - -4. If NOPOSIX is defined, pcretest.c compiles without POSIX support. This may -be useful for non-Unix systems who don't want to bother with the POSIX stuff. -However, I haven't made this a standard facility. The documentation doesn't -mention it, and the Makefile doesn't support it. - -5. The Makefile now contains an "install" target, with editable destinations at -the top of the file. The pcretest program is not installed. - -6. pgrep -V now gives the PCRE version number and date. - -7. Fixed bug: a zero repetition after a literal string (e.g. /abcde{0}/) was -causing the entire string to be ignored, instead of just the last character. - -8. If a pattern like /"([^\\"]+|\\.)*"/ is applied in the normal way to a -non-matching string, it can take a very, very long time, even for strings of -quite modest length, because of the nested recursion. PCRE now does better in -some of these cases. It does this by remembering the last required literal -character in the pattern, and pre-searching the subject to ensure it is present -before running the real match. In other words, it applies a heuristic to detect -some types of certain failure quickly, and in the above example, if presented -with a string that has no trailing " it gives "no match" very quickly. - -9. A new runtime option PCRE_NOTEMPTY causes null string matches to be ignored; -other alternatives are tried instead. - - -Version 2.06 09-Jun-99 ----------------------- - -1. Change pcretest's output for amount of store used to show just the code -space, because the remainder (the data block) varies in size between 32-bit and -64-bit systems. - -2. Added an extra argument to pcre_exec() to supply an offset in the subject to -start matching at. This allows lookbehinds to work when searching for multiple -occurrences in a string. - -3. Added additional options to pcretest for testing multiple occurrences: - - /+ outputs the rest of the string that follows a match - /g loops for multiple occurrences, using the new startoffset argument - /G loops for multiple occurrences by passing an incremented pointer - -4. PCRE wasn't doing the "first character" optimization for patterns starting -with \b or \B, though it was doing it for other lookbehind assertions. That is, -it wasn't noticing that a match for a pattern such as /\bxyz/ has to start with -the letter 'x'. On long subject strings, this gives a significant speed-up. - - -Version 2.05 21-Apr-99 ----------------------- - -1. Changed the type of magic_number from int to long int so that it works -properly on 16-bit systems. - -2. Fixed a bug which caused patterns starting with .* not to work correctly -when the subject string contained newline characters. PCRE was assuming -anchoring for such patterns in all cases, which is not correct because .* will -not pass a newline unless PCRE_DOTALL is set. It now assumes anchoring only if -DOTALL is set at top level; otherwise it knows that patterns starting with .* -must be retried after every newline in the subject. - - -Version 2.04 18-Feb-99 ----------------------- - -1. For parenthesized subpatterns with repeats whose minimum was zero, the -computation of the store needed to hold the pattern was incorrect (too large). -If such patterns were nested a few deep, this could multiply and become a real -problem. - -2. Added /M option to pcretest to show the memory requirement of a specific -pattern. Made -m a synonym of -s (which does this globally) for compatibility. - -3. Subpatterns of the form (regex){n,m} (i.e. limited maximum) were being -compiled in such a way that the backtracking after subsequent failure was -pessimal. Something like (a){0,3} was compiled as (a)?(a)?(a)? instead of -((a)((a)(a)?)?)? with disastrous performance if the maximum was of any size. - - -Version 2.03 02-Feb-99 ----------------------- - -1. Fixed typo and small mistake in man page. - -2. Added 4th condition (GPL supersedes if conflict) and created separate -LICENCE file containing the conditions. - -3. Updated pcretest so that patterns such as /abc\/def/ work like they do in -Perl, that is the internal \ allows the delimiter to be included in the -pattern. Locked out the use of \ as a delimiter. If \ immediately follows -the final delimiter, add \ to the end of the pattern (to test the error). - -4. Added the convenience functions for extracting substrings after a successful -match. Updated pcretest to make it able to test these functions. - - -Version 2.02 14-Jan-99 ----------------------- - -1. Initialized the working variables associated with each extraction so that -their saving and restoring doesn't refer to uninitialized store. - -2. Put dummy code into study.c in order to trick the optimizer of the IBM C -compiler for OS/2 into generating correct code. Apparently IBM isn't going to -fix the problem. - -3. Pcretest: the timing code wasn't using LOOPREPEAT for timing execution -calls, and wasn't printing the correct value for compiling calls. Increased the -default value of LOOPREPEAT, and the number of significant figures in the -times. - -4. Changed "/bin/rm" in the Makefile to "-rm" so it works on Windows NT. - -5. Renamed "deftables" as "dftables" to get it down to 8 characters, to avoid -a building problem on Windows NT with a FAT file system. - - -Version 2.01 21-Oct-98 ----------------------- - -1. Changed the API for pcre_compile() to allow for the provision of a pointer -to character tables built by pcre_maketables() in the current locale. If NULL -is passed, the default tables are used. - - -Version 2.00 24-Sep-98 ----------------------- - -1. Since the (>?) facility is in Perl 5.005, don't require PCRE_EXTRA to enable -it any more. - -2. Allow quantification of (?>) groups, and make it work correctly. - -3. The first character computation wasn't working for (?>) groups. - -4. Correct the implementation of \Z (it is permitted to match on the \n at the -end of the subject) and add 5.005's \z, which really does match only at the -very end of the subject. - -5. Remove the \X "cut" facility; Perl doesn't have it, and (?> is neater. - -6. Remove the ability to specify CASELESS, MULTILINE, DOTALL, and -DOLLAR_END_ONLY at runtime, to make it possible to implement the Perl 5.005 -localized options. All options to pcre_study() were also removed. - -7. Add other new features from 5.005: - - $(?<= positive lookbehind - $(?<! negative lookbehind - (?imsx-imsx) added the unsetting capability - such a setting is global if at outer level; local otherwise - (?imsx-imsx:) non-capturing groups with option setting - (?(cond)re|re) conditional pattern matching - - A backreference to itself in a repeated group matches the previous - captured string. - -8. General tidying up of studying (both automatic and via "study") -consequential on the addition of new assertions. - -9. As in 5.005, unlimited repeated groups that could match an empty substring -are no longer faulted at compile time. Instead, the loop is forcibly broken at -runtime if any iteration does actually match an empty substring. - -10. Include the RunTest script in the distribution. - -11. Added tests from the Perl 5.005_02 distribution. This showed up a few -discrepancies, some of which were old and were also with respect to 5.004. They -have now been fixed. - - -Version 1.09 28-Apr-98 ----------------------- - -1. A negated single character class followed by a quantifier with a minimum -value of one (e.g. [^x]{1,6} ) was not compiled correctly. This could lead to -program crashes, or just wrong answers. This did not apply to negated classes -containing more than one character, or to minima other than one. - - -Version 1.08 27-Mar-98 ----------------------- - -1. Add PCRE_UNGREEDY to invert the greediness of quantifiers. - -2. Add (?U) and (?X) to set PCRE_UNGREEDY and PCRE_EXTRA respectively. The -latter must appear before anything that relies on it in the pattern. - - -Version 1.07 16-Feb-98 ----------------------- - -1. A pattern such as /((a)*)*/ was not being diagnosed as in error (unlimited -repeat of a potentially empty string). - - -Version 1.06 23-Jan-98 ----------------------- - -1. Added Markus Oberhumer's little patches for C++. - -2. Literal strings longer than 255 characters were broken. - - -Version 1.05 23-Dec-97 ----------------------- - -1. Negated character classes containing more than one character were failing if -PCRE_CASELESS was set at run time. - - -Version 1.04 19-Dec-97 ----------------------- - -1. Corrected the man page, where some "const" qualifiers had been omitted. - -2. Made debugging output print "{0,xxx}" instead of just "{,xxx}" to agree with -input syntax. - -3. Fixed memory leak which occurred when a regex with back references was -matched with an offsets vector that wasn't big enough. The temporary memory -that is used in this case wasn't being freed if the match failed. - -4. Tidied pcretest to ensure it frees memory that it gets. - -5. Temporary memory was being obtained in the case where the passed offsets -vector was exactly big enough. - -6. Corrected definition of offsetof() from change 5 below. - -7. I had screwed up change 6 below and broken the rules for the use of -setjmp(). Now fixed. - - -Version 1.03 18-Dec-97 ----------------------- - -1. A erroneous regex with a missing opening parenthesis was correctly -diagnosed, but PCRE attempted to access brastack[-1], which could cause crashes -on some systems. - -2. Replaced offsetof(real_pcre, code) by offsetof(real_pcre, code[0]) because -it was reported that one broken compiler failed on the former because "code" is -also an independent variable. - -3. The erroneous regex a[]b caused an array overrun reference. - -4. A regex ending with a one-character negative class (e.g. /[^k]$/) did not -fail on data ending with that character. (It was going on too far, and checking -the next character, typically a binary zero.) This was specific to the -optimized code for single-character negative classes. - -5. Added a contributed patch from the TIN world which does the following: - - + Add an undef for memmove, in case the the system defines a macro for it. - - + Add a definition of offsetof(), in case there isn't one. (I don't know - the reason behind this - offsetof() is part of the ANSI standard - but - it does no harm). - - + Reduce the ifdef's in pcre.c using macro DPRINTF, thereby eliminating - most of the places where whitespace preceded '#'. I have given up and - allowed the remaining 2 cases to be at the margin. - - + Rename some variables in pcre to eliminate shadowing. This seems very - pedantic, but does no harm, of course. - -6. Moved the call to setjmp() into its own function, to get rid of warnings -from gcc -Wall, and avoided calling it at all unless PCRE_EXTRA is used. - -7. Constructs such as \d{8,} were compiling into the equivalent of -\d{8}\d{0,65527} instead of \d{8}\d* which didn't make much difference to the -outcome, but in this particular case used more store than had been allocated, -which caused the bug to be discovered because it threw up an internal error. - -8. The debugging code in both pcre and pcretest for outputting the compiled -form of a regex was going wrong in the case of back references followed by -curly-bracketed repeats. - - -Version 1.02 12-Dec-97 ----------------------- - -1. Typos in pcre.3 and comments in the source fixed. - -2. Applied a contributed patch to get rid of places where it used to remove -'const' from variables, and fixed some signed/unsigned and uninitialized -variable warnings. - -3. Added the "runtest" target to Makefile. - -4. Set default compiler flag to -O2 rather than just -O. - - -Version 1.01 19-Nov-97 ----------------------- - -1. PCRE was failing to diagnose unlimited repeat of empty string for patterns -like /([ab]*)*/, that is, for classes with more than one character in them. - -2. Likewise, it wasn't diagnosing patterns with "once-only" subpatterns, such -as /((?>a*))*/ (a PCRE_EXTRA facility). - - -Version 1.00 18-Nov-97 ----------------------- - -1. Added compile-time macros to support systems such as SunOS4 which don't have -memmove() or strerror() but have other things that can be used instead. - -2. Arranged that "make clean" removes the executables. - - -Version 0.99 27-Oct-97 ----------------------- - -1. Fixed bug in code for optimizing classes with only one character. It was -initializing a 32-byte map regardless, which could cause it to run off the end -of the memory it had got. - -2. Added, conditional on PCRE_EXTRA, the proposed (?>REGEX) construction. - - -Version 0.98 22-Oct-97 ----------------------- - -1. Fixed bug in code for handling temporary memory usage when there are more -back references than supplied space in the ovector. This could cause segfaults. - - -Version 0.97 21-Oct-97 ----------------------- - -1. Added the \X "cut" facility, conditional on PCRE_EXTRA. - -2. Optimized negated single characters not to use a bit map. - -3. Brought error texts together as macro definitions; clarified some of them; -fixed one that was wrong - it said "range out of order" when it meant "invalid -escape sequence". - -4. Changed some char * arguments to const char *. - -5. Added PCRE_NOTBOL and PCRE_NOTEOL (from POSIX). - -6. Added the POSIX-style API wrapper in pcreposix.a and testing facilities in -pcretest. - - -Version 0.96 16-Oct-97 ----------------------- - -1. Added a simple "pgrep" utility to the distribution. - -2. Fixed an incompatibility with Perl: "{" is now treated as a normal character -unless it appears in one of the precise forms "{ddd}", "{ddd,}", or "{ddd,ddd}" -where "ddd" means "one or more decimal digits". - -3. Fixed serious bug. If a pattern had a back reference, but the call to -pcre_exec() didn't supply a large enough ovector to record the related -identifying subpattern, the match always failed. PCRE now remembers the number -of the largest back reference, and gets some temporary memory in which to save -the offsets during matching if necessary, in order to ensure that -backreferences always work. - -4. Increased the compatibility with Perl in a number of ways: - - (a) . no longer matches \n by default; an option PCRE_DOTALL is provided - to request this handling. The option can be set at compile or exec time. - - (b) $ matches before a terminating newline by default; an option - PCRE_DOLLAR_ENDONLY is provided to override this (but not in multiline - mode). The option can be set at compile or exec time. - - (c) The handling of \ followed by a digit other than 0 is now supposed to be - the same as Perl's. If the decimal number it represents is less than 10 - or there aren't that many previous left capturing parentheses, an octal - escape is read. Inside a character class, it's always an octal escape, - even if it is a single digit. - - (d) An escaped but undefined alphabetic character is taken as a literal, - unless PCRE_EXTRA is set. Currently this just reserves the remaining - escapes. - - (e) {0} is now permitted. (The previous item is removed from the compiled - pattern). - -5. Changed all the names of code files so that the basic parts are no longer -than 10 characters, and abolished the teeny "globals.c" file. - -6. Changed the handling of character classes; they are now done with a 32-byte -bit map always. - -7. Added the -d and /D options to pcretest to make it possible to look at the -internals of compilation without having to recompile pcre. - - -Version 0.95 23-Sep-97 ----------------------- - -1. Fixed bug in pre-pass concerning escaped "normal" characters such as \x5c or -\x20 at the start of a run of normal characters. These were being treated as -real characters, instead of the source characters being re-checked. - - -Version 0.94 18-Sep-97 ----------------------- - -1. The functions are now thread-safe, with the caveat that the global variables -containing pointers to malloc() and free() or alternative functions are the -same for all threads. - -2. Get pcre_study() to generate a bitmap of initial characters for non- -anchored patterns when this is possible, and use it if passed to pcre_exec(). - - -Version 0.93 15-Sep-97 ----------------------- - -1. /(b)|(:+)/ was computing an incorrect first character. - -2. Add pcre_study() to the API and the passing of pcre_extra to pcre_exec(), -but not actually doing anything yet. - -3. Treat "-" characters in classes that cannot be part of ranges as literals, -as Perl does (e.g. [-az] or [az-]). - -4. Set the anchored flag if a branch starts with .* or .*? because that tests -all possible positions. - -5. Split up into different modules to avoid including unneeded functions in a -compiled binary. However, compile and exec are still in one module. The "study" -function is split off. - -6. The character tables are now in a separate module whose source is generated -by an auxiliary program - but can then be edited by hand if required. There are -now no calls to isalnum(), isspace(), isdigit(), isxdigit(), tolower() or -toupper() in the code. - -7. Turn the malloc/free funtions variables into pcre_malloc and pcre_free and -make them global. Abolish the function for setting them, as the caller can now -set them directly. - - -Version 0.92 11-Sep-97 ----------------------- - -1. A repeat with a fixed maximum and a minimum of 1 for an ordinary character -(e.g. /a{1,3}/) was broken (I mis-optimized it). - -2. Caseless matching was not working in character classes if the characters in -the pattern were in upper case. - -3. Make ranges like [W-c] work in the same way as Perl for caseless matching. - -4. Make PCRE_ANCHORED public and accept as a compile option. - -5. Add an options word to pcre_exec() and accept PCRE_ANCHORED and -PCRE_CASELESS at run time. Add escapes \A and \I to pcretest to cause it to -pass them. - -6. Give an error if bad option bits passed at compile or run time. - -7. Add PCRE_MULTILINE at compile and exec time, and (?m) as well. Add \M to -pcretest to cause it to pass that flag. - -8. Add pcre_info(), to get the number of identifying subpatterns, the stored -options, and the first character, if set. - -9. Recognize C+ or C{n,m} where n >= 1 as providing a fixed starting character. - - -Version 0.91 10-Sep-97 ----------------------- - -1. PCRE was failing to diagnose unlimited repeats of subpatterns that could -match the empty string as in /(a*)*/. It was looping and ultimately crashing. - -2. PCRE was looping on encountering an indefinitely repeated back reference to -a subpattern that had matched an empty string, e.g. /(a|)\1*/. It now does what -Perl does - treats the match as successful. - -**** diff --git a/ext/pcre/pcrelib/LICENCE b/ext/pcre/pcrelib/LICENCE deleted file mode 100644 index e8eb0d9370321..0000000000000 --- a/ext/pcre/pcrelib/LICENCE +++ /dev/null @@ -1,68 +0,0 @@ -PCRE LICENCE ------------- - -PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - -Release 6 of PCRE is distributed under the terms of the "BSD" licence, as -specified below. The documentation for PCRE, supplied in the "doc" -directory, is distributed under the same terms as the software itself. - -The basic library functions are written in C and are freestanding. Also -included in the distribution is a set of C++ wrapper functions. - - -THE BASIC LIBRARY FUNCTIONS ---------------------------- - -Written by: Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk - -University of Cambridge Computing Service, -Cambridge, England. Phone: +44 1223 334714. - -Copyright (c) 1997-2005 University of Cambridge -All rights reserved. - - -THE C++ WRAPPER FUNCTIONS -------------------------- - -Contributed by: Google Inc. - -Copyright (c) 2005, Google Inc. -All rights reserved. - - -THE "BSD" LICENCE ------------------ - -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 the University of Cambridge nor the name of Google - Inc. nor the names of their 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. - -End diff --git a/ext/pcre/pcrelib/NEWS b/ext/pcre/pcrelib/NEWS deleted file mode 100644 index a6113e08996af..0000000000000 --- a/ext/pcre/pcrelib/NEWS +++ /dev/null @@ -1,233 +0,0 @@ -News about PCRE releases ------------------------- - -Release 6.0 07-Jun-05 ---------------------- - -The release number has been increased to 6.0 because of the addition of several -major new pieces of functionality. - -A new function, pcre_dfa_exec(), which implements pattern matching using a DFA -algorithm, has been added. This has a number of advantages for certain cases, -though it does run more slowly, and lacks the ability to capture substrings. On -the other hand, it does find all matches, not just the first, and it works -better for partial matching. The pcrematching man page discusses the -differences. - -The pcretest program has been enhanced so that it can make use of the new -pcre_dfa_exec() matching function and the extra features it provides. - -The distribution now includes a C++ wrapper library. This is built -automatically if a C++ compiler is found. The pcrecpp man page discusses this -interface. - -The code itself has been re-organized into many more files, one for each -function, so it no longer requires everything to be linked in when static -linkage is used. As a consequence, some internal functions have had to have -their names exposed. These functions all have names starting with _pcre_. They -are undocumented, and are not intended for use by outside callers. - -The pcregrep program has been enhanced with new functionality such as -multiline-matching and options for output more matching context. See the -ChangeLog for a complete list of changes to the library and the utility -programs. - - -Release 5.0 13-Sep-04 ---------------------- - -The licence under which PCRE is released has been changed to the more -conventional "BSD" licence. - -In the code, some bugs have been fixed, and there are also some major changes -in this release (which is why I've increased the number to 5.0). Some changes -are internal rearrangements, and some provide a number of new facilities. The -new features are: - -1. There's an "automatic callout" feature that inserts callouts before every - item in the regex, and there's a new callout field that gives the position - in the pattern - useful for debugging and tracing. - -2. The extra_data structure can now be used to pass in a set of character - tables at exec time. This is useful if compiled regex are saved and re-used - at a later time when the tables may not be at the same address. If the - default internal tables are used, the pointer saved with the compiled - pattern is now set to NULL, which means that you don't need to do anything - special unless you are using custom tables. - -3. It is possible, with some restrictions on the content of the regex, to - request "partial" matching. A special return code is given if all of the - subject string matched part of the regex. This could be useful for testing - an input field as it is being typed. - -4. There is now some optional support for Unicode character properties, which - means that the patterns items such as \p{Lu} and \X can now be used. Only - the general category properties are supported. If PCRE is compiled with this - support, an additional 90K data structure is include, which increases the - size of the library dramatically. - -5. There is support for saving compiled patterns and re-using them later. - -6. There is support for running regular expressions that were compiled on a - different host with the opposite endianness. - -7. The pcretest program has been extended to accommodate the new features. - -The main internal rearrangement is that sequences of literal characters are no -longer handled as strings. Instead, each character is handled on its own. This -makes some UTF-8 handling easier, and makes the support of partial matching -possible. Compiled patterns containing long literal strings will be larger as a -result of this change; I hope that performance will not be much affected. - - -Release 4.5 01-Dec-03 ---------------------- - -Again mainly a bug-fix and tidying release, with only a couple of new features: - -1. It's possible now to compile PCRE so that it does not use recursive -function calls when matching. Instead it gets memory from the heap. This slows -things down, but may be necessary on systems with limited stacks. - -2. UTF-8 string checking has been tightened to reject overlong sequences and to -check that a starting offset points to the start of a character. Failure of the -latter returns a new error code: PCRE_ERROR_BADUTF8_OFFSET. - -3. PCRE can now be compiled for systems that use EBCDIC code. - - -Release 4.4 21-Aug-03 ---------------------- - -This is mainly a bug-fix and tidying release. The only new feature is that PCRE -checks UTF-8 strings for validity by default. There is an option to suppress -this, just in case anybody wants that teeny extra bit of performance. - - -Releases 4.1 - 4.3 ------------------- - -Sorry, I forgot about updating the NEWS file for these releases. Please take a -look at ChangeLog. - - -Release 4.0 17-Feb-03 ---------------------- - -There have been a lot of changes for the 4.0 release, adding additional -functionality and mending bugs. Below is a list of the highlights of the new -functionality. For full details of these features, please consult the -documentation. For a complete list of changes, see the ChangeLog file. - -1. Support for Perl's \Q...\E escapes. - -2. "Possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's Java -package. They provide some syntactic sugar for simple cases of "atomic -grouping". - -3. Support for the \G assertion. It is true when the current matching position -is at the start point of the match. - -4. A new feature that provides some of the functionality that Perl provides -with (?{...}). The facility is termed a "callout". The way it is done in PCRE -is for the caller to provide an optional function, by setting pcre_callout to -its entry point. To get the function called, the regex must include (?C) at -appropriate points. - -5. Support for recursive calls to individual subpatterns. This makes it really -easy to get totally confused. - -6. Support for named subpatterns. The Python syntax (?P<name>...) is used to -name a group. - -7. Several extensions to UTF-8 support; it is now fairly complete. There is an -option for pcregrep to make it operate in UTF-8 mode. - -8. The single man page has been split into a number of separate man pages. -These also give rise to individual HTML pages which are put in a separate -directory. There is an index.html page that lists them all. Some hyperlinking -between the pages has been installed. - - -Release 3.5 15-Aug-01 ---------------------- - -1. The configuring system has been upgraded to use later versions of autoconf -and libtool. By default it builds both a shared and a static library if the OS -supports it. You can use --disable-shared or --disable-static on the configure -command if you want only one of them. - -2. The pcretest utility is now installed along with pcregrep because it is -useful for users (to test regexs) and by doing this, it automatically gets -relinked by libtool. The documentation has been turned into a man page, so -there are now .1, .txt, and .html versions in /doc. - -3. Upgrades to pcregrep: - (i) Added long-form option names like gnu grep. - (ii) Added --help to list all options with an explanatory phrase. - (iii) Added -r, --recursive to recurse into sub-directories. - (iv) Added -f, --file to read patterns from a file. - -4. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure -script, to force use of CR or LF instead of \n in the source. On non-Unix -systems, the value can be set in config.h. - -5. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an -absolute limit. Changed the text of the error message to make this clear, and -likewise updated the man page. - -6. The limit of 99 on the number of capturing subpatterns has been removed. -The new limit is 65535, which I hope will not be a "real" limit. - - -Release 3.3 01-Aug-00 ---------------------- - -There is some support for UTF-8 character strings. This is incomplete and -experimental. The documentation describes what is and what is not implemented. -Otherwise, this is just a bug-fixing release. - - -Release 3.0 01-Feb-00 ---------------------- - -1. A "configure" script is now used to configure PCRE for Unix systems. It -builds a Makefile, a config.h file, and the pcre-config script. - -2. PCRE is built as a shared library by default. - -3. There is support for POSIX classes such as [:alpha:]. - -5. There is an experimental recursion feature. - ----------------------------------------------------------------------------- - IMPORTANT FOR THOSE UPGRADING FROM VERSIONS BEFORE 2.00 - -Please note that there has been a change in the API such that a larger -ovector is required at matching time, to provide some additional workspace. -The new man page has details. This change was necessary in order to support -some of the new functionality in Perl 5.005. - - IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.00 - -Another (I hope this is the last!) change has been made to the API for the -pcre_compile() function. An additional argument has been added to make it -possible to pass over a pointer to character tables built in the current -locale by pcre_maketables(). To use the default tables, this new arguement -should be passed as NULL. - - IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 - -Yet another (and again I hope this really is the last) change has been made -to the API for the pcre_exec() function. An additional argument has been -added to make it possible to start the match other than at the start of the -subject string. This is important if there are lookbehinds. The new man -page has the details, but you just want to convert existing programs, all -you need to do is to stick in a new fifth argument to pcre_exec(), with a -value of zero. For example, change - - pcre_exec(pattern, extra, subject, length, options, ovec, ovecsize) -to - pcre_exec(pattern, extra, subject, length, 0, options, ovec, ovecsize) - -**** diff --git a/ext/pcre/pcrelib/NON-UNIX-USE b/ext/pcre/pcrelib/NON-UNIX-USE deleted file mode 100644 index b7fe4301a6ded..0000000000000 --- a/ext/pcre/pcrelib/NON-UNIX-USE +++ /dev/null @@ -1,277 +0,0 @@ -Compiling PCRE on non-Unix systems ----------------------------------- - -See below for comments on Cygwin or MinGW and OpenVMS usage. I (Philip Hazel) -have no knowledge of Windows or VMS sytems and how their libraries work. The -items in the PCRE Makefile that relate to anything other than Unix-like systems -have been contributed by PCRE users. There are some other comments and files in -the Contrib directory on the ftp site that you may find useful. See - - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib - -If you want to compile PCRE for a non-Unix system (or perhaps, more strictly, -for a system that does not support "configure" and "make" files), note that -PCRE consists entirely of code written in Standard C, and so should compile -successfully on any system that has a Standard C compiler and library. - - -GENERIC INSTRUCTIONS FOR THE C LIBRARY - -The following are generic comments about building PCRE. The interspersed -indented commands are suggestions from Mark Tetrode as to which commands you -might use on a Windows system to build a static library. - -(1) Copy or rename the file config.in as config.h, and change the macros that -define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. -Unfortunately, because of the way Unix autoconf works, the default setting has -to be 0. You may also want to make changes to other macros in config.h. In -particular, if you want to force a specific value for newline, you can define -the NEWLINE macro. The default is to use '\n', thereby using whatever value -your compiler gives to '\n'. - - rem Mark Tetrode's commands - copy config.in config.h - rem Use write, because notepad cannot handle UNIX files. Change values. - write config.h - -(2) Copy or rename the file pcre.in as pcre.h, and change the macro definitions -for PCRE_MAJOR, PCRE_MINOR, and PCRE_DATE near its start to the values set in -configure.in. - - rem Mark Tetrode's commands - copy pcre.in pcre.h - rem Read values from configure.in - write configure.in - rem Change values - write pcre.h - -(3) Compile dftables.c as a stand-alone program, and then run it with -the single argument "chartables.c". This generates a set of standard -character tables and writes them to that file. - - rem Mark Tetrode's commands - rem Compile & run - cl -DSUPPORT_UTF8 -DSUPPORT_UCP dftables.c - dftables.exe chartables.c - -(4) Compile the following source files: - - pcre_chartables.c - pcre_compile.c - pcre_config.c - pcre_dfa_exec.c - pcre_exec.c - pcre_fullinfo.c - pcre_get.c - pcre_globals.c - pcre_info.c - pcre_maketables.c - pcre_ord2utf8.c - pcre_printint.c - pcre_refcount.c - pcre_study.c - pcre_tables.c - pcre_try_flipped.c - pcre_ucp_findchar.c - pcre_valid_utf8.c - pcre_version.c - pcre_xclass.c - -and link them all together into an object library in whichever form your system -keeps such libraries. This is the pcre C library. If your system has static and -shared libraries, you may have to do this once for each type. - - rem These comments are out-of-date, referring to a previous release which - rem had fewer source files. Replace with the file names from above. - rem Mark Tetrode's commands, for a static library - rem Compile & lib - cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c maketables.c get.c study.c pcre.c - lib /OUT:pcre.lib maketables.obj get.obj study.obj pcre.obj - -(5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix -library. - - rem Mark Tetrode's commands, for a static library - rem Compile & lib - cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c pcreposix.c - lib /OUT:pcreposix.lib pcreposix.obj - -(6) Compile the test program pcretest.c. This needs the functions in the -pcre and pcreposix libraries when linking. - - rem Mark Tetrode's commands - rem compile & link - cl /F0x400000 pcretest.c pcre.lib pcreposix.lib - -(7) Run pcretest on the testinput files in the testdata directory, and check -that the output matches the corresponding testoutput files. You must use the --i option when checking testinput2. Note that the supplied files are in Unix -format, with just LF characters as line terminators. You may need to edit them -to change this if your system uses a different convention. - - rem Mark Tetrode's commands - pcretest testdata\testinput1 testdata\myoutput1 - windiff testdata\testoutput1 testdata\myoutput1 - pcretest -i testdata\testinput2 testdata\myoutput2 - windiff testdata\testoutput2 testdata\myoutput2 - pcretest testdata\testinput3 testdata\myoutput3 - windiff testdata\testoutput3 testdata\myoutput3 - pcretest testdata\testinput4 testdata\myoutput4 - windiff testdata\testoutput4 testdata\myoutput4 - pcretest testdata\testinput5 testdata\myoutput5 - windiff testdata\testoutput5 testdata\myoutput5 - pcretest testdata\testinput6 testdata\myoutput6 - windiff testdata\testoutput6 testdata\myoutput6 - -Note that there are now three more tests (7, 8, 9) that did not exist when Mark -wrote those comments. The test the new pcre_dfa_exec() function. - - -THE C++ WRAPPER FUNCTIONS - -The PCRE distribution now contains some C++ wrapper functions and tests, -contributed by Google Inc. On a system that can use "configure" and "make", -the functions are automatically built into a library called pcrecpp. It should -be straightforward to compile the .cc files manually on other systems. The -files called xxx_unittest.cc are test programs for each of the corresponding -xxx.cc files. - - -FURTHER REMARKS - -If you have a system without "configure" but where you can use a Makefile, edit -Makefile.in to create Makefile, substituting suitable values for the variables -at the head of the file. - -Some help in building a Win32 DLL of PCRE in GnuWin32 environments was -contributed by Paul Sokolovsky. These environments are Mingw32 -(http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin -(http://sourceware.cygnus.com/cygwin/). Paul comments: - - For CygWin, set CFLAGS=-mno-cygwin, and do 'make dll'. You'll get - pcre.dll (containing pcreposix also), libpcre.dll.a, and dynamically - linked pgrep and pcretest. If you have /bin/sh, run RunTest (three - main test go ok, locale not supported). - -Changes to do MinGW with autoconf 2.50 were supplied by Fred Cox -<sailorFred@yahoo.com>, who comments as follows: - - If you are using the PCRE DLL, the normal Unix style configure && make && - make check && make install should just work[*]. If you want to statically - link against the .a file, you must define PCRE_STATIC before including - pcre.h, otherwise the pcre_malloc and pcre_free exported functions will be - declared __declspec(dllimport), with hilarious results. See the configure.in - and pcretest.c for how it is done for the static test. - - Also, there will only be a libpcre.la, not a libpcreposix.la, as you - would expect from the Unix version. The single DLL includes the pcreposix - interface. - -[*] But note that the supplied test files are in Unix format, with just LF -characters as line terminators. You will have to edit them to change to CR LF -terminators. - -A script for building PCRE using Borland's C++ compiler for use with VPASCAL -was contributed by Alexander Tokarev. It is called makevp.bat. - -These are some further comments about Win32 builds from Mark Evans. They -were contributed before Fred Cox's changes were made, so it is possible that -they may no longer be relevant. - -"The documentation for Win32 builds is a bit shy. Under MSVC6 I -followed their instructions to the letter, but there were still -some things missing. - -(1) Must #define STATIC for entire project if linking statically. - (I see no reason to use DLLs for code this compact.) This of - course is a project setting in MSVC under Preprocessor. - -(2) Missing some #ifdefs relating to the function pointers - pcre_malloc and pcre_free. See my solution below. (The stubs - may not be mandatory but they made me feel better.)" - -========================= -#ifdef _WIN32 -#include <malloc.h> - -void* malloc_stub(size_t N) -{ return malloc(N); } -void free_stub(void* p) -{ free(p); } -void *(*pcre_malloc)(size_t) = &malloc_stub; -void (*pcre_free)(void *) = &free_stub; - -#else - -void *(*pcre_malloc)(size_t) = malloc; -void (*pcre_free)(void *) = free; - -#endif -========================= - - -BUILDING PCRE ON OPENVMS - -Dan Mooney sent the following comments about building PCRE on OpenVMS. They -relate to an older version of PCRE that used fewer source files, so the exact -commands will need changing. See the current list of source files above. - -"It was quite easy to compile and link the library. I don't have a formal -make file but the attached file [reproduced below] contains the OpenVMS DCL -commands I used to build the library. I had to add #define -POSIX_MALLOC_THRESHOLD 10 to pcre.h since it was not defined anywhere. - -The library was built on: -O/S: HP OpenVMS v7.3-1 -Compiler: Compaq C v6.5-001-48BCD -Linker: vA13-01 - -The test results did not match 100% due to the issues you mention in your -documentation regarding isprint(), iscntrl(), isgraph() and ispunct(). I -modified some of the character tables temporarily and was able to get the -results to match. Tests using the fr locale did not match since I don't have -that locale loaded. The study size was always reported to be 3 less than the -value in the standard test output files." - -========================= -$! This DCL procedure builds PCRE on OpenVMS -$! -$! I followed the instructions in the non-unix-use file in the distribution. -$! -$ COMPILE == "CC/LIST/NOMEMBER_ALIGNMENT/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES -$ COMPILE DFTABLES.C -$ LINK/EXE=DFTABLES.EXE DFTABLES.OBJ -$ RUN DFTABLES.EXE/OUTPUT=CHARTABLES.C -$ COMPILE MAKETABLES.C -$ COMPILE GET.C -$ COMPILE STUDY.C -$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol -$! did not seem to be defined anywhere. -$! I edited pcre.h and added #DEFINE SUPPORT_UTF8 to enable UTF8 support. -$ COMPILE PCRE.C -$ LIB/CREATE PCRE MAKETABLES.OBJ, GET.OBJ, STUDY.OBJ, PCRE.OBJ -$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol -$! did not seem to be defined anywhere. -$ COMPILE PCREPOSIX.C -$ LIB/CREATE PCREPOSIX PCREPOSIX.OBJ -$ COMPILE PCRETEST.C -$ LINK/EXE=PCRETEST.EXE PCRETEST.OBJ, PCRE/LIB, PCREPOSIX/LIB -$! C programs that want access to command line arguments must be -$! defined as a symbol -$ PCRETEST :== "$ SYS$ROADSUSERS:[DMOONEY.REGEXP]PCRETEST.EXE" -$! Arguments must be enclosed in quotes. -$ PCRETEST "-C" -$! Test results: -$! -$! The test results did not match 100%. The functions isprint(), iscntrl(), -$! isgraph() and ispunct() on OpenVMS must not produce the same results -$! as the system that built the test output files provided with the -$! distribution. -$! -$! The study size did not match and was always 3 less on OpenVMS. -$! -$! Locale could not be set to fr -$! -========================= - -**** diff --git a/ext/pcre/pcrelib/README b/ext/pcre/pcrelib/README deleted file mode 100644 index f8d63bbd34c95..0000000000000 --- a/ext/pcre/pcrelib/README +++ /dev/null @@ -1,489 +0,0 @@ -README file for PCRE (Perl-compatible regular expression library) ------------------------------------------------------------------ - -The latest release of PCRE is always available from - - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz - -Please read the NEWS file if you are upgrading from a previous release. - - -The PCRE APIs -------------- - -PCRE is written in C, and it has its own API. The distribution now includes a -set of C++ wrapper functions, courtesy of Google Inc. (see the pcrecpp man page -for details). - -Also included are a set of C wrapper functions that are based on the POSIX -API. These end up in the library called libpcreposix. Note that this just -provides a POSIX calling interface to PCRE: the regular expressions themselves -still follow Perl syntax and semantics. The header file for the POSIX-style -functions is called pcreposix.h. The official POSIX name is regex.h, but I -didn't want to risk possible problems with existing files of that name by -distributing it that way. To use it with an existing program that uses the -POSIX API, it will have to be renamed or pointed at by a link. - -If you are using the POSIX interface to PCRE and there is already a POSIX regex -library installed on your system, you must take care when linking programs to -ensure that they link with PCRE's libpcreposix library. Otherwise they may pick -up the "real" POSIX functions of the same name. - - -Documentation for PCRE ----------------------- - -If you install PCRE in the normal way, you will end up with an installed set of -man pages whose names all start with "pcre". The one that is called "pcre" -lists all the others. In addition to these man pages, the PCRE documentation is -supplied in two other forms; however, as there is no standard place to install -them, they are left in the doc directory of the unpacked source distribution. -These forms are: - - 1. Files called doc/pcre.txt, doc/pcregrep.txt, and doc/pcretest.txt. The - first of these is a concatenation of the text forms of all the section 3 - man pages except those that summarize individual functions. The other two - are the text forms of the section 1 man pages for the pcregrep and - pcretest commands. Text forms are provided for ease of scanning with text - editors or similar tools. - - 2. A subdirectory called doc/html contains all the documentation in HTML - form, hyperlinked in various ways, and rooted in a file called - doc/index.html. - - -Contributions by users of PCRE ------------------------------- - -You can find contributions from PCRE users in the directory - - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib - -where there is also a README file giving brief descriptions of what they are. -Several of them provide support for compiling PCRE on various flavours of -Windows systems (I myself do not use Windows). Some are complete in themselves; -others are pointers to URLs containing relevant files. - - -Building PCRE on a Unix-like system ------------------------------------ - -To build PCRE on a Unix-like system, first run the "configure" command from the -PCRE distribution directory, with your current directory set to the directory -where you want the files to be created. This command is a standard GNU -"autoconf" configuration script, for which generic instructions are supplied in -INSTALL. - -Most commonly, people build PCRE within its own distribution directory, and in -this case, on many systems, just running "./configure" is sufficient, but the -usual methods of changing standard defaults are available. For example: - -CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local - -specifies that the C compiler should be run with the flags '-O2 -Wall' instead -of the default, and that "make install" should install PCRE under /opt/local -instead of the default /usr/local. - -If you want to build in a different directory, just run "configure" with that -directory as current. For example, suppose you have unpacked the PCRE source -into /source/pcre/pcre-xxx, but you want to build it in /build/pcre/pcre-xxx: - -cd /build/pcre/pcre-xxx -/source/pcre/pcre-xxx/configure - -There are some optional features that can be included or omitted from the PCRE -library. You can read more about them in the pcrebuild man page. - -. If you want to make use of the support for UTF-8 character strings in PCRE, - you must add --enable-utf8 to the "configure" command. Without it, the code - for handling UTF-8 is not included in the library. (Even when included, it - still has to be enabled by an option at run time.) - -. If, in addition to support for UTF-8 character strings, you want to include - support for the \P, \p, and \X sequences that recognize Unicode character - properties, you must add --enable-unicode-properties to the "configure" - command. This adds about 90K to the size of the library (in the form of a - property table); only the basic two-letter properties such as Lu are - supported. - -. You can build PCRE to recognized CR or NL as the newline character, instead - of whatever your compiler uses for "\n", by adding --newline-is-cr or - --newline-is-nl to the "configure" command, respectively. Only do this if you - really understand what you are doing. On traditional Unix-like systems, the - newline character is NL. - -. When called via the POSIX interface, PCRE uses malloc() to get additional - storage for processing capturing parentheses if there are more than 10 of - them. You can increase this threshold by setting, for example, - - --with-posix-malloc-threshold=20 - - on the "configure" command. - -. PCRE has a counter that can be set to limit the amount of resources it uses. - If the limit is exceeded during a match, the match fails. The default is ten - million. You can change the default by setting, for example, - - --with-match-limit=500000 - - on the "configure" command. This is just the default; individual calls to - pcre_exec() can supply their own value. There is discussion on the pcreapi - man page. - -. The default maximum compiled pattern size is around 64K. You can increase - this by adding --with-link-size=3 to the "configure" command. You can - increase it even more by setting --with-link-size=4, but this is unlikely - ever to be necessary. If you build PCRE with an increased link size, test 2 - (and 5 if you are using UTF-8) will fail. Part of the output of these tests - is a representation of the compiled pattern, and this changes with the link - size. - -. You can build PCRE so that its internal match() function that is called from - pcre_exec() does not call itself recursively. Instead, it uses blocks of data - from the heap via special functions pcre_stack_malloc() and pcre_stack_free() - to save data that would otherwise be saved on the stack. To build PCRE like - this, use - - --disable-stack-for-recursion - - on the "configure" command. PCRE runs more slowly in this mode, but it may be - necessary in environments with limited stack sizes. This applies only to the - pcre_exec() function; it does not apply to pcre_dfa_exec(), which does not - use deeply nested recursion. - -The "configure" script builds eight files for the basic C library: - -. pcre.h is the header file for C programs that call PCRE -. Makefile is the makefile that builds the library -. config.h contains build-time configuration options for the library -. pcre-config is a script that shows the settings of "configure" options -. libpcre.pc is data for the pkg-config command -. libtool is a script that builds shared and/or static libraries -. RunTest is a script for running tests on the library -. RunGrepTest is a script for running tests on the pcregrep command - -In addition, if a C++ compiler is found, the following are also built: - -. pcrecpp.h is the header file for programs that call PCRE via the C++ wrapper -. pcre_stringpiece.h is the header for the C++ "stringpiece" functions - -The "configure" script also creates config.status, which is an executable -script that can be run to recreate the configuration, and config.log, which -contains compiler output from tests that "configure" runs. - -Once "configure" has run, you can run "make". It builds two libraries, called -libpcre and libpcreposix, a test program called pcretest, and the pcregrep -command. If a C++ compiler was found on your system, it also builds the C++ -wrapper library, which is called libpcrecpp, and some test programs called -pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest. - -The command "make test" runs all the appropriate tests. Details of the PCRE -tests are given in a separate section of this document, below. - -You can use "make install" to copy the libraries, the public header files -pcre.h, pcreposix.h, pcrecpp.h, and pcre_stringpiece.h (the last two only if -the C++ wrapper was built), and the man pages to appropriate live directories -on your system, in the normal way. - -If you want to remove PCRE from your system, you can run "make uninstall". -This removes all the files that "make install" installed. However, it does not -remove any directories, because these are often shared with other programs. - - -Retrieving configuration information on Unix-like systems ---------------------------------------------------------- - -Running "make install" also installs the command pcre-config, which can be used -to recall information about the PCRE configuration and installation. For -example: - - pcre-config --version - -prints the version number, and - - pcre-config --libs - -outputs information about where the library is installed. This command can be -included in makefiles for programs that use PCRE, saving the programmer from -having to remember too many details. - -The pkg-config command is another system for saving and retrieving information -about installed libraries. Instead of separate commands for each library, a -single command is used. For example: - - pkg-config --cflags pcre - -The data is held in *.pc files that are installed in a directory called -pkgconfig. - - -Shared libraries on Unix-like systems -------------------------------------- - -The default distribution builds PCRE as shared libraries and static libraries, -as long as the operating system supports shared libraries. Shared library -support relies on the "libtool" script which is built as part of the -"configure" process. - -The libtool script is used to compile and link both shared and static -libraries. They are placed in a subdirectory called .libs when they are newly -built. The programs pcretest and pcregrep are built to use these uninstalled -libraries (by means of wrapper scripts in the case of shared libraries). When -you use "make install" to install shared libraries, pcregrep and pcretest are -automatically re-built to use the newly installed shared libraries before being -installed themselves. However, the versions left in the source directory still -use the uninstalled libraries. - -To build PCRE using static libraries only you must use --disable-shared when -configuring it. For example: - -./configure --prefix=/usr/gnu --disable-shared - -Then run "make" in the usual way. Similarly, you can use --disable-static to -build only shared libraries. - - -Cross-compiling on a Unix-like system -------------------------------------- - -You can specify CC and CFLAGS in the normal way to the "configure" command, in -order to cross-compile PCRE for some other host. However, during the building -process, the dftables.c source file is compiled *and run* on the local host, in -order to generate the default character tables (the chartables.c file). It -therefore needs to be compiled with the local compiler, not the cross compiler. -You can do this by specifying CC_FOR_BUILD (and if necessary CFLAGS_FOR_BUILD; -there are also CXX_FOR_BUILD and CXXFLAGS_FOR_BUILD for the C++ wrapper) -when calling the "configure" command. If they are not specified, they default -to the values of CC and CFLAGS. - - -Building on non-Unix systems ----------------------------- - -For a non-Unix system, read the comments in the file NON-UNIX-USE, though if -the system supports the use of "configure" and "make" you may be able to build -PCRE in the same way as for Unix systems. - -PCRE has been compiled on Windows systems and on Macintoshes, but I don't know -the details because I don't use those systems. It should be straightforward to -build PCRE on any system that has a Standard C compiler, because it uses only -Standard C functions. - - -Testing PCRE ------------- - -To test PCRE on a Unix system, run the RunTest script that is created by the -configuring process. There is also a script called RunGrepTest that tests the -options of the pcregrep command. If the C++ wrapper library is build, three -test programs called pcrecpp_unittest, pcre_scanner_unittest, and -pcre_stringpiece_unittest are provided. - -Both the scripts and all the program tests are run if you obey "make runtest", -"make check", or "make test". For other systems, see the instructions in -NON-UNIX-USE. - -The RunTest script runs the pcretest test program (which is documented in its -own man page) on each of the testinput files (in the testdata directory) in -turn, and compares the output with the contents of the corresponding testoutput -file. A file called testtry is used to hold the main output from pcretest -(testsavedregex is also used as a working file). To run pcretest on just one of -the test files, give its number as an argument to RunTest, for example: - - RunTest 2 - -The first file can also be fed directly into the perltest script to check that -Perl gives the same results. The only difference you should see is in the first -few lines, where the Perl version is given instead of the PCRE version. - -The second set of tests check pcre_fullinfo(), pcre_info(), pcre_study(), -pcre_copy_substring(), pcre_get_substring(), pcre_get_substring_list(), error -detection, and run-time flags that are specific to PCRE, as well as the POSIX -wrapper API. It also uses the debugging flag to check some of the internals of -pcre_compile(). - -If you build PCRE with a locale setting that is not the standard C locale, the -character tables may be different (see next paragraph). In some cases, this may -cause failures in the second set of tests. For example, in a locale where the -isprint() function yields TRUE for characters in the range 128-255, the use of -[:isascii:] inside a character class defines a different set of characters, and -this shows up in this test as a difference in the compiled code, which is being -listed for checking. Where the comparison test output contains [\x00-\x7f] the -test will contain [\x00-\xff], and similarly in some other cases. This is not a -bug in PCRE. - -The third set of tests checks pcre_maketables(), the facility for building a -set of character tables for a specific locale and using them instead of the -default tables. The tests make use of the "fr_FR" (French) locale. Before -running the test, the script checks for the presence of this locale by running -the "locale" command. If that command fails, or if it doesn't include "fr_FR" -in the list of available locales, the third test cannot be run, and a comment -is output to say why. If running this test produces instances of the error - - ** Failed to set locale "fr_FR" - -in the comparison output, it means that locale is not available on your system, -despite being listed by "locale". This does not mean that PCRE is broken. - -The fourth test checks the UTF-8 support. It is not run automatically unless -PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when -running "configure". This file can be also fed directly to the perltest script, -provided you are running Perl 5.8 or higher. (For Perl 5.6, a small patch, -commented in the script, can be be used.) - -The fifth test checks error handling with UTF-8 encoding, and internal UTF-8 -features of PCRE that are not relevant to Perl. - -The sixth and test checks the support for Unicode character properties. It it -not run automatically unless PCRE is built with Unicode property support. To to -this you must set --enable-unicode-properties when running "configure". - -The seventh, eighth, and ninth tests check the pcre_dfa_exec() alternative -matching function, in non-UTF-8 mode, UTF-8 mode, and UTF-8 mode with Unicode -property support, respectively. The eighth and ninth tests are not run -automatically unless PCRE is build with the relevant support. - - -Character tables ----------------- - -PCRE uses four tables for manipulating and identifying characters whose values -are less than 256. The final argument of the pcre_compile() function is a -pointer to a block of memory containing the concatenated tables. A call to -pcre_maketables() can be used to generate a set of tables in the current -locale. If the final argument for pcre_compile() is passed as NULL, a set of -default tables that is built into the binary is used. - -The source file called chartables.c contains the default set of tables. This is -not supplied in the distribution, but is built by the program dftables -(compiled from dftables.c), which uses the ANSI C character handling functions -such as isalnum(), isalpha(), isupper(), islower(), etc. to build the table -sources. This means that the default C locale which is set for your system will -control the contents of these default tables. You can change the default tables -by editing chartables.c and then re-building PCRE. If you do this, you should -probably also edit Makefile to ensure that the file doesn't ever get -re-generated. - -The first two 256-byte tables provide lower casing and case flipping functions, -respectively. The next table consists of three 32-byte bit maps which identify -digits, "word" characters, and white space, respectively. These are used when -building 32-byte bit maps that represent character classes. - -The final 256-byte table has bits indicating various character types, as -follows: - - 1 white space character - 2 letter - 4 decimal digit - 8 hexadecimal digit - 16 alphanumeric or '_' - 128 regular expression metacharacter or binary zero - -You should not alter the set of characters that contain the 128 bit, as that -will cause PCRE to malfunction. - - -Manifest --------- - -The distribution should contain the following files: - -(A) The actual source files of the PCRE library functions and their - headers: - - dftables.c auxiliary program for building chartables.c - - pcreposix.c ) - pcre_compile.c ) - pcre_config.c ) - pcre_dfa_exec.c ) - pcre_exec.c ) - pcre_fullinfo.c ) - pcre_get.c ) sources for the functions in the library, - pcre_globals.c ) and some internal functions that they use - pcre_info.c ) - pcre_maketables.c ) - pcre_ord2utf8.c ) - pcre_printint.c ) - pcre_study.c ) - pcre_tables.c ) - pcre_try_flipped.c ) - pcre_ucp_findchar.c ) - pcre_valid_utf8.c ) - pcre_version.c ) - pcre_xclass.c ) - - ucp_findchar.c ) - ucp.h ) source for the code that is used for - ucpinternal.h ) Unicode property handling - ucptable.c ) - ucptypetable.c ) - - pcre.in "source" for the header for the external API; pcre.h - is built from this by "configure" - pcreposix.h header for the external POSIX wrapper API - pcre_internal.h header for internal use - config.in template for config.h, which is built by configure - - pcrecpp.h.in "source" for the header file for the C++ wrapper - pcrecpp.cc ) - pcre_scanner.cc ) source for the C++ wrapper library - - pcre_stringpiece.h.in "source" for pcre_stringpiece.h, the header for the - C++ stringpiece functions - pcre_stringpiece.cc source for the C++ stringpiece functions - -(B) Auxiliary files: - - AUTHORS information about the author of PCRE - ChangeLog log of changes to the code - INSTALL generic installation instructions - LICENCE conditions for the use of PCRE - COPYING the same, using GNU's standard name - Makefile.in template for Unix Makefile, which is built by configure - NEWS important changes in this release - NON-UNIX-USE notes on building PCRE on non-Unix systems - README this file - RunTest.in template for a Unix shell script for running tests - RunGrepTest.in template for a Unix shell script for pcregrep tests - config.guess ) files used by libtool, - config.sub ) used only when building a shared library - configure a configuring shell script (built by autoconf) - configure.in the autoconf input used to build configure - doc/Tech.Notes notes on the encoding - doc/*.3 man page sources for the PCRE functions - doc/*.1 man page sources for pcregrep and pcretest - doc/html/* HTML documentation - doc/pcre.txt plain text version of the man pages - doc/pcretest.txt plain text documentation of test program - doc/perltest.txt plain text documentation of Perl test program - install-sh a shell script for installing files - libpcre.pc.in "source" for libpcre.pc for pkg-config - ltmain.sh file used to build a libtool script - mkinstalldirs script for making install directories - pcretest.c comprehensive test program - pcredemo.c simple demonstration of coding calls to PCRE - perltest Perl test program - pcregrep.c source of a grep utility that uses PCRE - pcre-config.in source of script which retains PCRE information - pcrecpp_unittest.c ) - pcre_scanner_unittest.c ) test programs for the C++ wrapper - pcre_stringpiece_unittest.c ) - testdata/testinput* test data for main library tests - testdata/testoutput* expected test results - testdata/grep* input and output for pcregrep tests - -(C) Auxiliary files for Win32 DLL - - libpcre.def - libpcreposix.def - pcre.def - -(D) Auxiliary file for VPASCAL - - makevp.bat - -Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk -June 2005 diff --git a/ext/pcre/pcrelib/dftables.c b/ext/pcre/pcrelib/dftables.c deleted file mode 100644 index 480753887ed51..0000000000000 --- a/ext/pcre/pcrelib/dftables.c +++ /dev/null @@ -1,172 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This is a freestanding support program to generate a file containing default -character tables for PCRE. The tables are built according to the default C -locale. Now that pcre_maketables is a function visible to the outside world, we -make use of its code from here in order to be consistent. */ - -#include <ctype.h> -#include <stdio.h> -#include <string.h> - -#include "pcre_internal.h" - -#define DFTABLES /* pcre_maketables.c notices this */ -#include "pcre_maketables.c" - - -int main(int argc, char **argv) -{ -int i; -FILE *f; -const unsigned char *tables = pcre_maketables(); -const unsigned char *base_of_tables = tables; - -if (argc != 2) - { - fprintf(stderr, "dftables: one filename argument is required\n"); - return 1; - } - -f = fopen(argv[1], "wb"); -if (f == NULL) - { - fprintf(stderr, "dftables: failed to open %s for writing\n", argv[1]); - return 1; - } - -/* There are two fprintf() calls here, because gcc in pedantic mode complains -about the very long string otherwise. */ - -fprintf(f, - "/*************************************************\n" - "* Perl-Compatible Regular Expressions *\n" - "*************************************************/\n\n" - "/* This file is automatically written by the dftables auxiliary \n" - "program. If you edit it by hand, you might like to edit the Makefile to \n" - "prevent its ever being regenerated.\n\n"); -fprintf(f, - "This file contains the default tables for characters with codes less than\n" - "128 (ASCII characters). These tables are used when no external tables are\n" - "passed to PCRE. */\n\n" - "const unsigned char _pcre_default_tables[] = {\n\n" - "/* This table is a lower casing table. */\n\n"); - -fprintf(f, " "); -for (i = 0; i < 256; i++) - { - if ((i & 7) == 0 && i != 0) fprintf(f, "\n "); - fprintf(f, "%3d", *tables++); - if (i != 255) fprintf(f, ","); - } -fprintf(f, ",\n\n"); - -fprintf(f, "/* This table is a case flipping table. */\n\n"); - -fprintf(f, " "); -for (i = 0; i < 256; i++) - { - if ((i & 7) == 0 && i != 0) fprintf(f, "\n "); - fprintf(f, "%3d", *tables++); - if (i != 255) fprintf(f, ","); - } -fprintf(f, ",\n\n"); - -fprintf(f, - "/* This table contains bit maps for various character classes.\n" - "Each map is 32 bytes long and the bits run from the least\n" - "significant end of each byte. The classes that have their own\n" - "maps are: space, xdigit, digit, upper, lower, word, graph\n" - "print, punct, and cntrl. Other classes are built from combinations. */\n\n"); - -fprintf(f, " "); -for (i = 0; i < cbit_length; i++) - { - if ((i & 7) == 0 && i != 0) - { - if ((i & 31) == 0) fprintf(f, "\n"); - fprintf(f, "\n "); - } - fprintf(f, "0x%02x", *tables++); - if (i != cbit_length - 1) fprintf(f, ","); - } -fprintf(f, ",\n\n"); - -fprintf(f, - "/* This table identifies various classes of character by individual bits:\n" - " 0x%02x white space character\n" - " 0x%02x letter\n" - " 0x%02x decimal digit\n" - " 0x%02x hexadecimal digit\n" - " 0x%02x alphanumeric or '_'\n" - " 0x%02x regular expression metacharacter or binary zero\n*/\n\n", - ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word, - ctype_meta); - -fprintf(f, " "); -for (i = 0; i < 256; i++) - { - if ((i & 7) == 0 && i != 0) - { - fprintf(f, " /* "); - if (isprint(i-8)) fprintf(f, " %c -", i-8); - else fprintf(f, "%3d-", i-8); - if (isprint(i-1)) fprintf(f, " %c ", i-1); - else fprintf(f, "%3d", i-1); - fprintf(f, " */\n "); - } - fprintf(f, "0x%02x", *tables++); - if (i != 255) fprintf(f, ","); - } - -fprintf(f, "};/* "); -if (isprint(i-8)) fprintf(f, " %c -", i-8); - else fprintf(f, "%3d-", i-8); -if (isprint(i-1)) fprintf(f, " %c ", i-1); - else fprintf(f, "%3d", i-1); -fprintf(f, " */\n\n/* End of chartables.c */\n"); - -fclose(f); -free((void *)base_of_tables); -return 0; -} - -/* End of dftables.c */ diff --git a/ext/pcre/pcrelib/doc/Tech.Notes b/ext/pcre/pcrelib/doc/Tech.Notes deleted file mode 100644 index 322cc2de131e6..0000000000000 --- a/ext/pcre/pcrelib/doc/Tech.Notes +++ /dev/null @@ -1,339 +0,0 @@ -Technical Notes about PCRE --------------------------- - -Historical note 1 ------------------ - -Many years ago I implemented some regular expression functions to an algorithm -suggested by Martin Richards. These were not Unix-like in form, and were quite -restricted in what they could do by comparison with Perl. The interesting part -about the algorithm was that the amount of space required to hold the compiled -form of an expression was known in advance. The code to apply an expression did -not operate by backtracking, as the original Henry Spencer code and current -Perl code does, but instead checked all possibilities simultaneously by keeping -a list of current states and checking all of them as it advanced through the -subject string. In the terminology of Jeffrey Friedl's book, it was a "DFA -algorithm". When the pattern was all used up, all remaining states were -possible matches, and the one matching the longest subset of the subject string -was chosen. This did not necessarily maximize the individual wild portions of -the pattern, as is expected in Unix and Perl-style regular expressions. - -Historical note 2 ------------------ - -By contrast, the code originally written by Henry Spencer and subsequently -heavily modified for Perl actually compiles the expression twice: once in a -dummy mode in order to find out how much store will be needed, and then for -real. The execution function operates by backtracking and maximizing (or, -optionally, minimizing in Perl) the amount of the subject that matches -individual wild portions of the pattern. This is an "NFA algorithm" in Friedl's -terminology. - -OK, here's the real stuff -------------------------- - -For the set of functions that form the "basic" PCRE library (which are -unrelated to those mentioned above), I tried at first to invent an algorithm -that used an amount of store bounded by a multiple of the number of characters -in the pattern, to save on compiling time. However, because of the greater -complexity in Perl regular expressions, I couldn't do this. In any case, a -first pass through the pattern is needed, for a number of reasons. PCRE works -by running a very degenerate first pass to calculate a maximum store size, and -then a second pass to do the real compile - which may use a bit less than the -predicted amount of store. The idea is that this is going to turn out faster -because the first pass is degenerate and the second pass can just store stuff -straight into the vector, which it knows is big enough. It does make the -compiling functions bigger, of course, but they have got quite big anyway to -handle all the Perl stuff. - -Traditional matching function ------------------------------ - -The "traditional", and original, matching function is called pcre_exec(), and -it implements an NFA algorithm, similar to the original Henry Spencer algorithm -and the way that Perl works. Not surprising, since it is intended to be as -compatible with Perl as possible. This is the function most users of PCRE will -use most of the time. - -Supplementary matching function -------------------------------- - -From PCRE 6.0, there is also a supplementary matching function called -pcre_dfa_exec(). This implements a DFA matching algorithm that searches -simultaneously for all possible matches that start at one point in the subject -string. (Going back to my roots: see Historical Note 1 above.) This function -intreprets the same compiled pattern data as pcre_exec(); however, not all the -facilities are available, and those that are don't always work in quite the -same way. See the user documentation for details. - -Format of compiled patterns ---------------------------- - -The compiled form of a pattern is a vector of bytes, containing items of -variable length. The first byte in an item is an opcode, and the length of the -item is either implicit in the opcode or contained in the data bytes that -follow it. - -In many cases below "two-byte" data values are specified. This is in fact just -a default. PCRE can be compiled to use 3-byte or 4-byte values (impairing the -performance). This is necessary only when patterns whose compiled length is -greater than 64K are going to be processed. In this description, we assume the -"normal" compilation options. - -A list of all the opcodes follows: - -Opcodes with no following data ------------------------------- - -These items are all just one byte long - - OP_END end of pattern - OP_ANY match any character - OP_ANYBYTE match any single byte, even in UTF-8 mode - OP_SOD match start of data: \A - OP_SOM, start of match (subject + offset): \G - OP_CIRC ^ (start of data, or after \n in multiline) - OP_NOT_WORD_BOUNDARY \W - OP_WORD_BOUNDARY \w - OP_NOT_DIGIT \D - OP_DIGIT \d - OP_NOT_WHITESPACE \S - OP_WHITESPACE \s - OP_NOT_WORDCHAR \W - OP_WORDCHAR \w - OP_EODN match end of data or \n at end: \Z - OP_EOD match end of data: \z - OP_DOLL $ (end of data, or before \n in multiline) - OP_EXTUNI match an extended Unicode character - - -Repeating single characters ---------------------------- - -The common repeats (*, +, ?) when applied to a single character use the -following opcodes: - - OP_STAR - OP_MINSTAR - OP_PLUS - OP_MINPLUS - OP_QUERY - OP_MINQUERY - -In ASCII mode, these are two-byte items; in UTF-8 mode, the length is variable. -Those with "MIN" in their name are the minimizing versions. Each is followed by -the character that is to be repeated. Other repeats make use of - - OP_UPTO - OP_MINUPTO - OP_EXACT - -which are followed by a two-byte count (most significant first) and the -repeated character. OP_UPTO matches from 0 to the given number. A repeat with a -non-zero minimum and a fixed maximum is coded as an OP_EXACT followed by an -OP_UPTO (or OP_MINUPTO). - - -Repeating character types -------------------------- - -Repeats of things like \d are done exactly as for single characters, except -that instead of a character, the opcode for the type is stored in the data -byte. The opcodes are: - - OP_TYPESTAR - OP_TYPEMINSTAR - OP_TYPEPLUS - OP_TYPEMINPLUS - OP_TYPEQUERY - OP_TYPEMINQUERY - OP_TYPEUPTO - OP_TYPEMINUPTO - OP_TYPEEXACT - - -Match by Unicode property -------------------------- - -OP_PROP and OP_NOTPROP are used for positive and negative matches of a -character by testing its Unicode property (the \p and \P escape sequences). -Each is followed by a single byte that encodes the desired property value. - -Repeats of these items use the OP_TYPESTAR etc. set of opcodes, followed by two -bytes: OP_PROP or OP_NOTPROP and then the desired property value. - - -Matching literal characters ---------------------------- - -The OP_CHAR opcode is followed by a single character that is to be matched -casefully. For caseless matching, OP_CHARNC is used. In UTF-8 mode, the -character may be more than one byte long. (Earlier versions of PCRE used -multi-character strings, but this was changed to allow some new features to be -added.) - - -Character classes ------------------ - -If there is only one character, OP_CHAR or OP_CHARNC is used for a positive -class, and OP_NOT for a negative one (that is, for something like [^a]). -However, in UTF-8 mode, the use of OP_NOT applies only to characters with -values < 128, because OP_NOT is confined to single bytes. - -Another set of repeating opcodes (OP_NOTSTAR etc.) are used for a repeated, -negated, single-character class. The normal ones (OP_STAR etc.) are used for a -repeated positive single-character class. - -When there's more than one character in a class and all the characters are less -than 256, OP_CLASS is used for a positive class, and OP_NCLASS for a negative -one. In either case, the opcode is followed by a 32-byte bit map containing a 1 -bit for every character that is acceptable. The bits are counted from the least -significant end of each byte. - -The reason for having both OP_CLASS and OP_NCLASS is so that, in UTF-8 mode, -subject characters with values greater than 256 can be handled correctly. For -OP_CLASS they don't match, whereas for OP_NCLASS they do. - -For classes containing characters with values > 255, OP_XCLASS is used. It -optionally uses a bit map (if any characters lie within it), followed by a list -of pairs and single characters. There is a flag character than indicates -whether it's a positive or a negative class. - - -Back references ---------------- - -OP_REF is followed by two bytes containing the reference number. - - -Repeating character classes and back references ------------------------------------------------ - -Single-character classes are handled specially (see above). This applies to -OP_CLASS and OP_REF. In both cases, the repeat information follows the base -item. The matching code looks at the following opcode to see if it is one of - - OP_CRSTAR - OP_CRMINSTAR - OP_CRPLUS - OP_CRMINPLUS - OP_CRQUERY - OP_CRMINQUERY - OP_CRRANGE - OP_CRMINRANGE - -All but the last two are just single-byte items. The others are followed by -four bytes of data, comprising the minimum and maximum repeat counts. - - -Brackets and alternation ------------------------- - -A pair of non-capturing (round) brackets is wrapped round each expression at -compile time, so alternation always happens in the context of brackets. - -Non-capturing brackets use the opcode OP_BRA, while capturing brackets use -OP_BRA+1, OP_BRA+2, etc. [Note for North Americans: "bracket" to some English -speakers, including myself, can be round, square, curly, or pointy. Hence this -usage.] - -Originally PCRE was limited to 99 capturing brackets (so as not to use up all -the opcodes). From release 3.5, there is no limit. What happens is that the -first ones, up to EXTRACT_BASIC_MAX are handled with separate opcodes, as -above. If there are more, the opcode is set to EXTRACT_BASIC_MAX+1, and the -first operation in the bracket is OP_BRANUMBER, followed by a 2-byte bracket -number. This opcode is ignored while matching, but is fished out when handling -the bracket itself. (They could have all been done like this, but I was making -minimal changes.) - -A bracket opcode is followed by LINK_SIZE bytes which give the offset to the -next alternative OP_ALT or, if there aren't any branches, to the matching -OP_KET opcode. Each OP_ALT is followed by LINK_SIZE bytes giving the offset to -the next one, or to the OP_KET opcode. - -OP_KET is used for subpatterns that do not repeat indefinitely, while -OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or -maximally respectively. All three are followed by LINK_SIZE bytes giving (as a -positive number) the offset back to the matching OP_BRA opcode. - -If a subpattern is quantified such that it is permitted to match zero times, it -is preceded by one of OP_BRAZERO or OP_BRAMINZERO. These are single-byte -opcodes which tell the matcher that skipping this subpattern entirely is a -valid branch. - -A subpattern with an indefinite maximum repetition is replicated in the -compiled data its minimum number of times (or once with OP_BRAZERO if the -minimum is zero), with the final copy terminating with OP_KETRMIN or OP_KETRMAX -as appropriate. - -A subpattern with a bounded maximum repetition is replicated in a nested -fashion up to the maximum number of times, with OP_BRAZERO or OP_BRAMINZERO -before each replication after the minimum, so that, for example, (abc){2,5} is -compiled as (abc)(abc)((abc)((abc)(abc)?)?)?. - - -Assertions ----------- - -Forward assertions are just like other subpatterns, but starting with one of -the opcodes OP_ASSERT or OP_ASSERT_NOT. Backward assertions use the opcodes -OP_ASSERTBACK and OP_ASSERTBACK_NOT, and the first opcode inside the assertion -is OP_REVERSE, followed by a two byte count of the number of characters to move -back the pointer in the subject string. When operating in UTF-8 mode, the count -is a character count rather than a byte count. A separate count is present in -each alternative of a lookbehind assertion, allowing them to have different -fixed lengths. - - -Once-only subpatterns ---------------------- - -These are also just like other subpatterns, but they start with the opcode -OP_ONCE. - - -Conditional subpatterns ------------------------ - -These are like other subpatterns, but they start with the opcode OP_COND. If -the condition is a back reference, this is stored at the start of the -subpattern using the opcode OP_CREF followed by two bytes containing the -reference number. If the condition is "in recursion" (coded as "(?(R)"), the -same scheme is used, with a "reference number" of 0xffff. Otherwise, a -conditional subpattern always starts with one of the assertions. - - -Recursion ---------- - -Recursion either matches the current regex, or some subexpression. The opcode -OP_RECURSE is followed by an value which is the offset to the starting bracket -from the start of the whole pattern. - - -Callout -------- - -OP_CALLOUT is followed by one byte of data that holds a callout number in the -range 0 to 254 for manual callouts, or 255 for an automatic callout. In both -cases there follows a two-byte value giving the offset in the pattern to the -start of the following item, and another two-byte item giving the length of the -next item. - - -Changing options ----------------- - -If any of the /i, /m, or /s options are changed within a pattern, an OP_OPT -opcode is compiled, followed by one byte containing the new settings of these -flags. If there are several alternatives, there is an occurrence of OP_OPT at -the start of all those following the first options change, to set appropriate -options for the start of the alternative. Immediately after the end of the -group there is another such item to reset the flags to their previous values. A -change of flag right at the very start of the pattern can be handled entirely -at compile time, and so does not cause anything to be put into the compiled -data. - -Philip Hazel -March 2005 diff --git a/ext/pcre/pcrelib/doc/pcre.txt b/ext/pcre/pcrelib/doc/pcre.txt deleted file mode 100644 index 801bde279b9b2..0000000000000 --- a/ext/pcre/pcrelib/doc/pcre.txt +++ /dev/null @@ -1,4710 +0,0 @@ ------------------------------------------------------------------------------ -This file contains a concatenation of the PCRE man pages, converted to plain -text format for ease of searching with a text editor, or for use on systems -that do not have a man page processor. The small individual files that give -synopses of each function in the library have not been included. There are -separate text files for the pcregrep and pcretest commands. ------------------------------------------------------------------------------ - - -PCRE(3) PCRE(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -INTRODUCTION - - The PCRE library is a set of functions that implement regular expres- - sion pattern matching using the same syntax and semantics as Perl, with - just a few differences. The current implementation of PCRE (release - 6.x) corresponds approximately with Perl 5.8, including support for - UTF-8 encoded strings and Unicode general category properties. However, - this support has to be explicitly enabled; it is not the default. - - In addition to the Perl-compatible matching function, PCRE also con- - tains an alternative matching function that matches the same compiled - patterns in a different way. In certain circumstances, the alternative - function has some advantages. For a discussion of the two matching - algorithms, see the pcrematching page. - - PCRE is written in C and released as a C library. A number of people - have written wrappers and interfaces of various kinds. In particular, - Google Inc. have provided a comprehensive C++ wrapper. This is now - included as part of the PCRE distribution. The pcrecpp page has details - of this interface. Other people's contributions can be found in the - Contrib directory at the primary FTP site, which is: - - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre - - Details of exactly which Perl regular expression features are and are - not supported by PCRE are given in separate documents. See the pcrepat- - tern and pcrecompat pages. - - Some features of PCRE can be included, excluded, or changed when the - library is built. The pcre_config() function makes it possible for a - client to discover which features are available. The features them- - selves are described in the pcrebuild page. Documentation about build- - ing PCRE for various operating systems can be found in the README file - in the source distribution. - - The library contains a number of undocumented internal functions and - data tables that are used by more than one of the exported external - functions, but which are not intended for use by external callers. - Their names all begin with "_pcre_", which hopefully will not provoke - any name clashes. - - -USER DOCUMENTATION - - The user documentation for PCRE comprises a number of different sec- - tions. In the "man" format, each of these is a separate "man page". In - the HTML format, each is a separate page, linked from the index page. - In the plain text format, all the sections are concatenated, for ease - of searching. The sections are as follows: - - pcre this document - pcreapi details of PCRE's native C API - pcrebuild options for building PCRE - pcrecallout details of the callout feature - pcrecompat discussion of Perl compatibility - pcrecpp details of the C++ wrapper - pcregrep description of the pcregrep command - pcrematching discussion of the two matching algorithms - pcrepartial details of the partial matching facility - pcrepattern syntax and semantics of supported - regular expressions - pcreperform discussion of performance issues - pcreposix the POSIX-compatible C API - pcreprecompile details of saving and re-using precompiled patterns - pcresample discussion of the sample program - pcretest description of the pcretest testing command - - In addition, in the "man" and HTML formats, there is a short page for - each C library function, listing its arguments and results. - - -LIMITATIONS - - There are some size limitations in PCRE but it is hoped that they will - never in practice be relevant. - - The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE - is compiled with the default internal linkage size of 2. If you want to - process regular expressions that are truly enormous, you can compile - PCRE with an internal linkage size of 3 or 4 (see the README file in - the source distribution and the pcrebuild documentation for details). - In these cases the limit is substantially larger. However, the speed - of execution will be slower. - - All values in repeating quantifiers must be less than 65536. The maxi- - mum number of capturing subpatterns is 65535. - - There is no limit to the number of non-capturing subpatterns, but the - maximum depth of nesting of all kinds of parenthesized subpattern, - including capturing subpatterns, assertions, and other types of subpat- - tern, is 200. - - The maximum length of a subject string is the largest positive number - that an integer variable can hold. However, when using the traditional - matching function, PCRE uses recursion to handle subpatterns and indef- - inite repetition. This means that the available stack space may limit - the size of a subject string that can be processed by certain patterns. - - -UTF-8 AND UNICODE PROPERTY SUPPORT - - From release 3.3, PCRE has had some support for character strings - encoded in the UTF-8 format. For release 4.0 this was greatly extended - to cover most common requirements, and in release 5.0 additional sup- - port for Unicode general category properties was added. - - In order process UTF-8 strings, you must build PCRE to include UTF-8 - support in the code, and, in addition, you must call pcre_compile() - with the PCRE_UTF8 option flag. When you do this, both the pattern and - any subject strings that are matched against it are treated as UTF-8 - strings instead of just strings of bytes. - - If you compile PCRE with UTF-8 support, but do not use it at run time, - the library will be a bit bigger, but the additional run time overhead - is limited to testing the PCRE_UTF8 flag in several places, so should - not be very large. - - If PCRE is built with Unicode character property support (which implies - UTF-8 support), the escape sequences \p{..}, \P{..}, and \X are sup- - ported. The available properties that can be tested are limited to the - general category properties such as Lu for an upper case letter or Nd - for a decimal number. A full list is given in the pcrepattern documen- - tation. The PCRE library is increased in size by about 90K when Unicode - property support is included. - - The following comments apply when PCRE is running in UTF-8 mode: - - 1. When you set the PCRE_UTF8 flag, the strings passed as patterns and - subjects are checked for validity on entry to the relevant functions. - If an invalid UTF-8 string is passed, an error return is given. In some - situations, you may already know that your strings are valid, and - therefore want to skip these checks in order to improve performance. If - you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, - PCRE assumes that the pattern or subject it is given (respectively) - contains only valid UTF-8 codes. In this case, it does not diagnose an - invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when - PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may - crash. - - 2. In a pattern, the escape sequence \x{...}, where the contents of the - braces is a string of hexadecimal digits, is interpreted as a UTF-8 - character whose code number is the given hexadecimal number, for exam- - ple: \x{1234}. If a non-hexadecimal digit appears between the braces, - the item is not recognized. This escape sequence can be used either as - a literal, or within a character class. - - 3. The original hexadecimal escape sequence, \xhh, matches a two-byte - UTF-8 character if the value is greater than 127. - - 4. Repeat quantifiers apply to complete UTF-8 characters, not to indi- - vidual bytes, for example: \x{100}{3}. - - 5. The dot metacharacter matches one UTF-8 character instead of a sin- - gle byte. - - 6. The escape sequence \C can be used to match a single byte in UTF-8 - mode, but its use can lead to some strange effects. This facility is - not available in the alternative matching function, pcre_dfa_exec(). - - 7. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly - test characters of any code value, but the characters that PCRE recog- - nizes as digits, spaces, or word characters remain the same set as - before, all with values less than 256. This remains true even when PCRE - includes Unicode property support, because to do otherwise would slow - down PCRE in many common cases. If you really want to test for a wider - sense of, say, "digit", you must use Unicode property tests such as - \p{Nd}. - - 8. Similarly, characters that match the POSIX named character classes - are all low-valued characters. - - 9. Case-insensitive matching applies only to characters whose values - are less than 128, unless PCRE is built with Unicode property support. - Even when Unicode property support is available, PCRE still uses its - own character tables when checking the case of low-valued characters, - so as not to degrade performance. The Unicode property information is - used only for characters with higher values. - - -AUTHOR - - Philip Hazel - University Computing Service, - Cambridge CB2 3QG, England. - - Putting an actual email address here seems to have been a spam magnet, - so I've taken it away. If you want to email me, use my initial and sur- - name, separated by a dot, at the domain ucs.cam.ac.uk. - -Last updated: 07 March 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREBUILD(3) PCREBUILD(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE BUILD-TIME OPTIONS - - This document describes the optional features of PCRE that can be - selected when the library is compiled. They are all selected, or dese- - lected, by providing options to the configure script that is run before - the make command. The complete list of options for configure (which - includes the standard ones such as the selection of the installation - directory) can be obtained by running - - ./configure --help - - The following sections describe certain options whose names begin with - --enable or --disable. These settings specify changes to the defaults - for the configure command. Because of the way that configure works, - --enable and --disable always come in pairs, so the complementary - option always exists as well, but as it specifies the default, it is - not described. - - -UTF-8 SUPPORT - - To build PCRE with support for UTF-8 character strings, add - - --enable-utf8 - - to the configure command. Of itself, this does not make PCRE treat - strings as UTF-8. As well as compiling PCRE with this option, you also - have have to set the PCRE_UTF8 option when you call the pcre_compile() - function. - - -UNICODE CHARACTER PROPERTY SUPPORT - - UTF-8 support allows PCRE to process character values greater than 255 - in the strings that it handles. On its own, however, it does not pro- - vide any facilities for accessing the properties of such characters. If - you want to be able to use the pattern escapes \P, \p, and \X, which - refer to Unicode character properties, you must add - - --enable-unicode-properties - - to the configure command. This implies UTF-8 support, even if you have - not explicitly requested it. - - Including Unicode property support adds around 90K of tables to the - PCRE library, approximately doubling its size. Only the general cate- - gory properties such as Lu and Nd are supported. Details are given in - the pcrepattern documentation. - - -CODE VALUE OF NEWLINE - - By default, PCRE treats character 10 (linefeed) as the newline charac- - ter. This is the normal newline character on Unix-like systems. You can - compile PCRE to use character 13 (carriage return) instead by adding - - --enable-newline-is-cr - - to the configure command. For completeness there is also a --enable- - newline-is-lf option, which explicitly specifies linefeed as the new- - line character. - - -BUILDING SHARED AND STATIC LIBRARIES - - The PCRE building process uses libtool to build both shared and static - Unix libraries by default. You can suppress one of these by adding one - of - - --disable-shared - --disable-static - - to the configure command, as required. - - -POSIX MALLOC USAGE - - When PCRE is called through the POSIX interface (see the pcreposix doc- - umentation), additional working storage is required for holding the - pointers to capturing substrings, because PCRE requires three integers - per substring, whereas the POSIX interface provides only two. If the - number of expected substrings is small, the wrapper function uses space - on the stack, because this is faster than using malloc() for each call. - The default threshold above which the stack is no longer used is 10; it - can be changed by adding a setting such as - - --with-posix-malloc-threshold=20 - - to the configure command. - - -LIMITING PCRE RESOURCE USAGE - - Internally, PCRE has a function called match(), which it calls repeat- - edly (possibly recursively) when matching a pattern with the - pcre_exec() function. By controlling the maximum number of times this - function may be called during a single matching operation, a limit can - be placed on the resources used by a single call to pcre_exec(). The - limit can be changed at run time, as described in the pcreapi documen- - tation. The default is 10 million, but this can be changed by adding a - setting such as - - --with-match-limit=500000 - - to the configure command. This setting has no effect on the - pcre_dfa_exec() matching function. - - -HANDLING VERY LARGE PATTERNS - - Within a compiled pattern, offset values are used to point from one - part to another (for example, from an opening parenthesis to an alter- - nation metacharacter). By default, two-byte values are used for these - offsets, leading to a maximum size for a compiled pattern of around - 64K. This is sufficient to handle all but the most gigantic patterns. - Nevertheless, some people do want to process enormous patterns, so it - is possible to compile PCRE to use three-byte or four-byte offsets by - adding a setting such as - - --with-link-size=3 - - to the configure command. The value given must be 2, 3, or 4. Using - longer offsets slows down the operation of PCRE because it has to load - additional bytes when handling them. - - If you build PCRE with an increased link size, test 2 (and test 5 if - you are using UTF-8) will fail. Part of the output of these tests is a - representation of the compiled pattern, and this changes with the link - size. - - -AVOIDING EXCESSIVE STACK USAGE - - When matching with the pcre_exec() function, PCRE implements backtrack- - ing by making recursive calls to an internal function called match(). - In environments where the size of the stack is limited, this can se- - verely limit PCRE's operation. (The Unix environment does not usually - suffer from this problem.) An alternative approach that uses memory - from the heap to remember data, instead of using recursive function - calls, has been implemented to work round this problem. If you want to - build a version of PCRE that works this way, add - - --disable-stack-for-recursion - - to the configure command. With this configuration, PCRE will use the - pcre_stack_malloc and pcre_stack_free variables to call memory manage- - ment functions. Separate functions are provided because the usage is - very predictable: the block sizes requested are always the same, and - the blocks are always freed in reverse order. A calling program might - be able to implement optimized functions that perform better than the - standard malloc() and free() functions. PCRE runs noticeably more - slowly when built in this way. This option affects only the pcre_exec() - function; it is not relevant for the the pcre_dfa_exec() function. - - -USING EBCDIC CODE - - PCRE assumes by default that it will run in an environment where the - character code is ASCII (or Unicode, which is a superset of ASCII). - PCRE can, however, be compiled to run in an EBCDIC environment by - adding - - --enable-ebcdic - - to the configure command. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREMATCHING(3) PCREMATCHING(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE MATCHING ALGORITHMS - - This document describes the two different algorithms that are available - in PCRE for matching a compiled regular expression against a given sub- - ject string. The "standard" algorithm is the one provided by the - pcre_exec() function. This works in the same was as Perl's matching - function, and provides a Perl-compatible matching operation. - - An alternative algorithm is provided by the pcre_dfa_exec() function; - this operates in a different way, and is not Perl-compatible. It has - advantages and disadvantages compared with the standard algorithm, and - these are described below. - - When there is only one possible way in which a given subject string can - match a pattern, the two algorithms give the same answer. A difference - arises, however, when there are multiple possibilities. For example, if - the pattern - - ^<.*> - - is matched against the string - - <something> <something else> <something further> - - there are three possible answers. The standard algorithm finds only one - of them, whereas the DFA algorithm finds all three. - - -REGULAR EXPRESSIONS AS TREES - - The set of strings that are matched by a regular expression can be rep- - resented as a tree structure. An unlimited repetition in the pattern - makes the tree of infinite size, but it is still a tree. Matching the - pattern to a given subject string (from a given starting point) can be - thought of as a search of the tree. There are two standard ways to - search a tree: depth-first and breadth-first, and these correspond to - the two matching algorithms provided by PCRE. - - -THE STANDARD MATCHING ALGORITHM - - In the terminology of Jeffrey Friedl's book Mastering Regular Expres- - sions, the standard algorithm is an "NFA algorithm". It conducts a - depth-first search of the pattern tree. That is, it proceeds along a - single path through the tree, checking that the subject matches what is - required. When there is a mismatch, the algorithm tries any alterna- - tives at the current point, and if they all fail, it backs up to the - previous branch point in the tree, and tries the next alternative - branch at that level. This often involves backing up (moving to the - left) in the subject string as well. The order in which repetition - branches are tried is controlled by the greedy or ungreedy nature of - the quantifier. - - If a leaf node is reached, a matching string has been found, and at - that point the algorithm stops. Thus, if there is more than one possi- - ble match, this algorithm returns the first one that it finds. Whether - this is the shortest, the longest, or some intermediate length depends - on the way the greedy and ungreedy repetition quantifiers are specified - in the pattern. - - Because it ends up with a single path through the tree, it is rela- - tively straightforward for this algorithm to keep track of the sub- - strings that are matched by portions of the pattern in parentheses. - This provides support for capturing parentheses and back references. - - -THE DFA MATCHING ALGORITHM - - DFA stands for "deterministic finite automaton", but you do not need to - understand the origins of that name. This algorithm conducts a breadth- - first search of the tree. Starting from the first matching point in the - subject, it scans the subject string from left to right, once, charac- - ter by character, and as it does this, it remembers all the paths - through the tree that represent valid matches. - - The scan continues until either the end of the subject is reached, or - there are no more unterminated paths. At this point, terminated paths - represent the different matching possibilities (if there are none, the - match has failed). Thus, if there is more than one possible match, - this algorithm finds all of them, and in particular, it finds the long- - est. In PCRE, there is an option to stop the algorithm after the first - match (which is necessarily the shortest) has been found. - - Note that all the matches that are found start at the same point in the - subject. If the pattern - - cat(er(pillar)?) - - is matched against the string "the caterpillar catchment", the result - will be the three strings "cat", "cater", and "caterpillar" that start - at the fourth character of the subject. The algorithm does not automat- - ically move on to find matches that start at later positions. - - There are a number of features of PCRE regular expressions that are not - supported by the DFA matching algorithm. They are as follows: - - 1. Because the algorithm finds all possible matches, the greedy or - ungreedy nature of repetition quantifiers is not relevant. Greedy and - ungreedy quantifiers are treated in exactly the same way. - - 2. When dealing with multiple paths through the tree simultaneously, it - is not straightforward to keep track of captured substrings for the - different matching possibilities, and PCRE's implementation of this - algorithm does not attempt to do this. This means that no captured sub- - strings are available. - - 3. Because no substrings are captured, back references within the pat- - tern are not supported, and cause errors if encountered. - - 4. For the same reason, conditional expressions that use a backrefer- - ence as the condition are not supported. - - 5. Callouts are supported, but the value of the capture_top field is - always 1, and the value of the capture_last field is always -1. - - 6. The \C escape sequence, which (in the standard algorithm) matches a - single byte, even in UTF-8 mode, is not supported because the DFA algo- - rithm moves through the subject string one character at a time, for all - active paths through the tree. - - -ADVANTAGES OF THE DFA ALGORITHM - - Using the DFA matching algorithm provides the following advantages: - - 1. All possible matches (at a single point in the subject) are automat- - ically found, and in particular, the longest match is found. To find - more than one match using the standard algorithm, you have to do kludgy - things with callouts. - - 2. There is much better support for partial matching. The restrictions - on the content of the pattern that apply when using the standard algo- - rithm for partial matching do not apply to the DFA algorithm. For non- - anchored patterns, the starting position of a partial match is avail- - able. - - 3. Because the DFA algorithm scans the subject string just once, and - never needs to backtrack, it is possible to pass very long subject - strings to the matching function in several pieces, checking for par- - tial matching each time. - - -DISADVANTAGES OF THE DFA ALGORITHM - - The DFA algorithm suffers from a number of disadvantages: - - 1. It is substantially slower than the standard algorithm. This is - partly because it has to search for all possible matches, but is also - because it is less susceptible to optimization. - - 2. Capturing parentheses and back references are not supported. - - 3. The "atomic group" feature of PCRE regular expressions is supported, - but does not provide the advantage that it does for the standard algo- - rithm. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREAPI(3) PCREAPI(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE NATIVE API - - #include <pcre.h> - - pcre *pcre_compile(const char *pattern, int options, - const char **errptr, int *erroffset, - const unsigned char *tableptr); - - pcre *pcre_compile2(const char *pattern, int options, - int *errorcodeptr, - const char **errptr, int *erroffset, - const unsigned char *tableptr); - - pcre_extra *pcre_study(const pcre *code, int options, - const char **errptr); - - int pcre_exec(const pcre *code, const pcre_extra *extra, - const char *subject, int length, int startoffset, - int options, int *ovector, int ovecsize); - - int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, - const char *subject, int length, int startoffset, - int options, int *ovector, int ovecsize, - int *workspace, int wscount); - - int pcre_copy_named_substring(const pcre *code, - const char *subject, int *ovector, - int stringcount, const char *stringname, - char *buffer, int buffersize); - - int pcre_copy_substring(const char *subject, int *ovector, - int stringcount, int stringnumber, char *buffer, - int buffersize); - - int pcre_get_named_substring(const pcre *code, - const char *subject, int *ovector, - int stringcount, const char *stringname, - const char **stringptr); - - int pcre_get_stringnumber(const pcre *code, - const char *name); - - int pcre_get_substring(const char *subject, int *ovector, - int stringcount, int stringnumber, - const char **stringptr); - - int pcre_get_substring_list(const char *subject, - int *ovector, int stringcount, const char ***listptr); - - void pcre_free_substring(const char *stringptr); - - void pcre_free_substring_list(const char **stringptr); - - const unsigned char *pcre_maketables(void); - - int pcre_fullinfo(const pcre *code, const pcre_extra *extra, - int what, void *where); - - int pcre_info(const pcre *code, int *optptr, int *firstcharptr); - - int pcre_refcount(pcre *code, int adjust); - - int pcre_config(int what, void *where); - - char *pcre_version(void); - - void *(*pcre_malloc)(size_t); - - void (*pcre_free)(void *); - - void *(*pcre_stack_malloc)(size_t); - - void (*pcre_stack_free)(void *); - - int (*pcre_callout)(pcre_callout_block *); - - -PCRE API OVERVIEW - - PCRE has its own native API, which is described in this document. There - is also a set of wrapper functions that correspond to the POSIX regular - expression API. These are described in the pcreposix documentation. - Both of these APIs define a set of C function calls. A C++ wrapper is - distributed with PCRE. It is documented in the pcrecpp page. - - The native API C function prototypes are defined in the header file - pcre.h, and on Unix systems the library itself is called libpcre. It - can normally be accessed by adding -lpcre to the command for linking an - application that uses PCRE. The header file defines the macros - PCRE_MAJOR and PCRE_MINOR to contain the major and minor release num- - bers for the library. Applications can use these to include support - for different releases of PCRE. - - The functions pcre_compile(), pcre_compile2(), pcre_study(), and - pcre_exec() are used for compiling and matching regular expressions in - a Perl-compatible manner. A sample program that demonstrates the sim- - plest way of using them is provided in the file called pcredemo.c in - the source distribution. The pcresample documentation describes how to - run it. - - A second matching function, pcre_dfa_exec(), which is not Perl-compati- - ble, is also provided. This uses a different algorithm for the match- - ing. This allows it to find all possible matches (at a given point in - the subject), not just one. However, this algorithm does not return - captured substrings. A description of the two matching algorithms and - their advantages and disadvantages is given in the pcrematching docu- - mentation. - - In addition to the main compiling and matching functions, there are - convenience functions for extracting captured substrings from a subject - string that is matched by pcre_exec(). They are: - - pcre_copy_substring() - pcre_copy_named_substring() - pcre_get_substring() - pcre_get_named_substring() - pcre_get_substring_list() - pcre_get_stringnumber() - - pcre_free_substring() and pcre_free_substring_list() are also provided, - to free the memory used for extracted strings. - - The function pcre_maketables() is used to build a set of character - tables in the current locale for passing to pcre_compile(), - pcre_exec(), or pcre_dfa_exec(). This is an optional facility that is - provided for specialist use. Most commonly, no special tables are - passed, in which case internal tables that are generated when PCRE is - built are used. - - The function pcre_fullinfo() is used to find out information about a - compiled pattern; pcre_info() is an obsolete version that returns only - some of the available information, but is retained for backwards com- - patibility. The function pcre_version() returns a pointer to a string - containing the version of PCRE and its date of release. - - The function pcre_refcount() maintains a reference count in a data - block containing a compiled pattern. This is provided for the benefit - of object-oriented applications. - - The global variables pcre_malloc and pcre_free initially contain the - entry points of the standard malloc() and free() functions, respec- - tively. PCRE calls the memory management functions via these variables, - so a calling program can replace them if it wishes to intercept the - calls. This should be done before calling any PCRE functions. - - The global variables pcre_stack_malloc and pcre_stack_free are also - indirections to memory management functions. These special functions - are used only when PCRE is compiled to use the heap for remembering - data, instead of recursive function calls, when running the pcre_exec() - function. This is a non-standard way of building PCRE, for use in envi- - ronments that have limited stacks. Because of the greater use of memory - management, it runs more slowly. Separate functions are provided so - that special-purpose external code can be used for this case. When - used, these functions are always called in a stack-like manner (last - obtained, first freed), and always for memory blocks of the same size. - - The global variable pcre_callout initially contains NULL. It can be set - by the caller to a "callout" function, which PCRE will then call at - specified points during a matching operation. Details are given in the - pcrecallout documentation. - - -MULTITHREADING - - The PCRE functions can be used in multi-threading applications, with - the proviso that the memory management functions pointed to by - pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the - callout function pointed to by pcre_callout, are shared by all threads. - - The compiled form of a regular expression is not altered during match- - ing, so the same compiled pattern can safely be used by several threads - at once. - - -SAVING PRECOMPILED PATTERNS FOR LATER USE - - The compiled form of a regular expression can be saved and re-used at a - later time, possibly by a different program, and even on a host other - than the one on which it was compiled. Details are given in the - pcreprecompile documentation. - - -CHECKING BUILD-TIME OPTIONS - - int pcre_config(int what, void *where); - - The function pcre_config() makes it possible for a PCRE client to dis- - cover which optional features have been compiled into the PCRE library. - The pcrebuild documentation has more details about these optional fea- - tures. - - The first argument for pcre_config() is an integer, specifying which - information is required; the second argument is a pointer to a variable - into which the information is placed. The following information is - available: - - PCRE_CONFIG_UTF8 - - The output is an integer that is set to one if UTF-8 support is avail- - able; otherwise it is set to zero. - - PCRE_CONFIG_UNICODE_PROPERTIES - - The output is an integer that is set to one if support for Unicode - character properties is available; otherwise it is set to zero. - - PCRE_CONFIG_NEWLINE - - The output is an integer that is set to the value of the code that is - used for the newline character. It is either linefeed (10) or carriage - return (13), and should normally be the standard character for your - operating system. - - PCRE_CONFIG_LINK_SIZE - - The output is an integer that contains the number of bytes used for - internal linkage in compiled regular expressions. The value is 2, 3, or - 4. Larger values allow larger regular expressions to be compiled, at - the expense of slower matching. The default value of 2 is sufficient - for all but the most massive patterns, since it allows the compiled - pattern to be up to 64K in size. - - PCRE_CONFIG_POSIX_MALLOC_THRESHOLD - - The output is an integer that contains the threshold above which the - POSIX interface uses malloc() for output vectors. Further details are - given in the pcreposix documentation. - - PCRE_CONFIG_MATCH_LIMIT - - The output is an integer that gives the default limit for the number of - internal matching function calls in a pcre_exec() execution. Further - details are given with pcre_exec() below. - - PCRE_CONFIG_STACKRECURSE - - The output is an integer that is set to one if internal recursion when - running pcre_exec() is implemented by recursive function calls that use - the stack to remember their state. This is the usual way that PCRE is - compiled. The output is zero if PCRE was compiled to use blocks of data - on the heap instead of recursive function calls. In this case, - pcre_stack_malloc and pcre_stack_free are called to manage memory - blocks on the heap, thus avoiding the use of the stack. - - -COMPILING A PATTERN - - pcre *pcre_compile(const char *pattern, int options, - const char **errptr, int *erroffset, - const unsigned char *tableptr); - - pcre *pcre_compile2(const char *pattern, int options, - int *errorcodeptr, - const char **errptr, int *erroffset, - const unsigned char *tableptr); - - Either of the functions pcre_compile() or pcre_compile2() can be called - to compile a pattern into an internal form. The only difference between - the two interfaces is that pcre_compile2() has an additional argument, - errorcodeptr, via which a numerical error code can be returned. - - The pattern is a C string terminated by a binary zero, and is passed in - the pattern argument. A pointer to a single block of memory that is - obtained via pcre_malloc is returned. This contains the compiled code - and related data. The pcre type is defined for the returned block; this - is a typedef for a structure whose contents are not externally defined. - It is up to the caller to free the memory when it is no longer - required. - - Although the compiled code of a PCRE regex is relocatable, that is, it - does not depend on memory location, the complete pcre data block is not - fully relocatable, because it may contain a copy of the tableptr argu- - ment, which is an address (see below). - - The options argument contains independent bits that affect the compila- - tion. It should be zero if no options are required. The available - options are described below. Some of them, in particular, those that - are compatible with Perl, can also be set and unset from within the - pattern (see the detailed description in the pcrepattern documenta- - tion). For these options, the contents of the options argument speci- - fies their initial settings at the start of compilation and execution. - The PCRE_ANCHORED option can be set at the time of matching as well as - at compile time. - - If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, - if compilation of a pattern fails, pcre_compile() returns NULL, and - sets the variable pointed to by errptr to point to a textual error mes- - sage. The offset from the start of the pattern to the character where - the error was discovered is placed in the variable pointed to by - erroffset, which must not be NULL. If it is, an immediate error is - given. - - If pcre_compile2() is used instead of pcre_compile(), and the error- - codeptr argument is not NULL, a non-zero error code number is returned - via this argument in the event of an error. This is in addition to the - textual error message. Error codes and messages are listed below. - - If the final argument, tableptr, is NULL, PCRE uses a default set of - character tables that are built when PCRE is compiled, using the - default C locale. Otherwise, tableptr must be an address that is the - result of a call to pcre_maketables(). This value is stored with the - compiled pattern, and used again by pcre_exec(), unless another table - pointer is passed to it. For more discussion, see the section on locale - support below. - - This code fragment shows a typical straightforward call to pcre_com- - pile(): - - pcre *re; - const char *error; - int erroffset; - re = pcre_compile( - "^A.*Z", /* the pattern */ - 0, /* default options */ - &error, /* for error message */ - &erroffset, /* for error offset */ - NULL); /* use default character tables */ - - The following names for option bits are defined in the pcre.h header - file: - - PCRE_ANCHORED - - If this bit is set, the pattern is forced to be "anchored", that is, it - is constrained to match only at the first matching point in the string - that is being searched (the "subject string"). This effect can also be - achieved by appropriate constructs in the pattern itself, which is the - only way to do it in Perl. - - PCRE_AUTO_CALLOUT - - If this bit is set, pcre_compile() automatically inserts callout items, - all with number 255, before each pattern item. For discussion of the - callout facility, see the pcrecallout documentation. - - PCRE_CASELESS - - If this bit is set, letters in the pattern match both upper and lower - case letters. It is equivalent to Perl's /i option, and it can be - changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE - always understands the concept of case for characters whose values are - less than 128, so caseless matching is always possible. For characters - with higher values, the concept of case is supported if PCRE is com- - piled with Unicode property support, but not otherwise. If you want to - use caseless matching for characters 128 and above, you must ensure - that PCRE is compiled with Unicode property support as well as with - UTF-8 support. - - PCRE_DOLLAR_ENDONLY - - If this bit is set, a dollar metacharacter in the pattern matches only - at the end of the subject string. Without this option, a dollar also - matches immediately before the final character if it is a newline (but - not before any other newlines). The PCRE_DOLLAR_ENDONLY option is - ignored if PCRE_MULTILINE is set. There is no equivalent to this option - in Perl, and no way to set it within a pattern. - - PCRE_DOTALL - - If this bit is set, a dot metacharater in the pattern matches all char- - acters, including newlines. Without it, newlines are excluded. This - option is equivalent to Perl's /s option, and it can be changed within - a pattern by a (?s) option setting. A negative class such as [^a] - always matches a newline character, independent of the setting of this - option. - - PCRE_EXTENDED - - If this bit is set, whitespace data characters in the pattern are - totally ignored except when escaped or inside a character class. White- - space does not include the VT character (code 11). In addition, charac- - ters between an unescaped # outside a character class and the next new- - line character, inclusive, are also ignored. This is equivalent to - Perl's /x option, and it can be changed within a pattern by a (?x) - option setting. - - This option makes it possible to include comments inside complicated - patterns. Note, however, that this applies only to data characters. - Whitespace characters may never appear within special character - sequences in a pattern, for example within the sequence (?( which - introduces a conditional subpattern. - - PCRE_EXTRA - - This option was invented in order to turn on additional functionality - of PCRE that is incompatible with Perl, but it is currently of very - little use. When set, any backslash in a pattern that is followed by a - letter that has no special meaning causes an error, thus reserving - these combinations for future expansion. By default, as in Perl, a - backslash followed by a letter with no special meaning is treated as a - literal. There are at present no other features controlled by this - option. It can also be set by a (?X) option setting within a pattern. - - PCRE_FIRSTLINE - - If this option is set, an unanchored pattern is required to match - before or at the first newline character in the subject string, though - the matched text may continue over the newline. - - PCRE_MULTILINE - - By default, PCRE treats the subject string as consisting of a single - line of characters (even if it actually contains newlines). The "start - of line" metacharacter (^) matches only at the start of the string, - while the "end of line" metacharacter ($) matches only at the end of - the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY - is set). This is the same as Perl. - - When PCRE_MULTILINE it is set, the "start of line" and "end of line" - constructs match immediately following or immediately before any new- - line in the subject string, respectively, as well as at the very start - and end. This is equivalent to Perl's /m option, and it can be changed - within a pattern by a (?m) option setting. If there are no "\n" charac- - ters in a subject string, or no occurrences of ^ or $ in a pattern, - setting PCRE_MULTILINE has no effect. - - PCRE_NO_AUTO_CAPTURE - - If this option is set, it disables the use of numbered capturing paren- - theses in the pattern. Any opening parenthesis that is not followed by - ? behaves as if it were followed by ?: but named parentheses can still - be used for capturing (and they acquire numbers in the usual way). - There is no equivalent of this option in Perl. - - PCRE_UNGREEDY - - This option inverts the "greediness" of the quantifiers so that they - are not greedy by default, but become greedy if followed by "?". It is - not compatible with Perl. It can also be set by a (?U) option setting - within the pattern. - - PCRE_UTF8 - - This option causes PCRE to regard both the pattern and the subject as - strings of UTF-8 characters instead of single-byte character strings. - However, it is available only when PCRE is built to include UTF-8 sup- - port. If not, the use of this option provokes an error. Details of how - this option changes the behaviour of PCRE are given in the section on - UTF-8 support in the main pcre page. - - PCRE_NO_UTF8_CHECK - - When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is - automatically checked. If an invalid UTF-8 sequence of bytes is found, - pcre_compile() returns an error. If you already know that your pattern - is valid, and you want to skip this check for performance reasons, you - can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of - passing an invalid UTF-8 string as a pattern is undefined. It may cause - your program to crash. Note that this option can also be passed to - pcre_exec() and pcre_dfa_exec(), to suppress the UTF-8 validity check- - ing of subject strings. - - -COMPILATION ERROR CODES - - The following table lists the error codes than may be returned by - pcre_compile2(), along with the error messages that may be returned by - both compiling functions. - - 0 no error - 1 \ at end of pattern - 2 \c at end of pattern - 3 unrecognized character follows \ - 4 numbers out of order in {} quantifier - 5 number too big in {} quantifier - 6 missing terminating ] for character class - 7 invalid escape sequence in character class - 8 range out of order in character class - 9 nothing to repeat - 10 operand of unlimited repeat could match the empty string - 11 internal error: unexpected repeat - 12 unrecognized character after (? - 13 POSIX named classes are supported only within a class - 14 missing ) - 15 reference to non-existent subpattern - 16 erroffset passed as NULL - 17 unknown option bit(s) set - 18 missing ) after comment - 19 parentheses nested too deeply - 20 regular expression too large - 21 failed to get memory - 22 unmatched parentheses - 23 internal error: code overflow - 24 unrecognized character after (?< - 25 lookbehind assertion is not fixed length - 26 malformed number after (?( - 27 conditional group contains more than two branches - 28 assertion expected after (?( - 29 (?R or (?digits must be followed by ) - 30 unknown POSIX class name - 31 POSIX collating elements are not supported - 32 this version of PCRE is not compiled with PCRE_UTF8 support - 33 spare error - 34 character value in \x{...} sequence is too large - 35 invalid condition (?(0) - 36 \C not allowed in lookbehind assertion - 37 PCRE does not support \L, \l, \N, \U, or \u - 38 number after (?C is > 255 - 39 closing ) for (?C expected - 40 recursive call could loop indefinitely - 41 unrecognized character after (?P - 42 syntax error after (?P - 43 two named groups have the same name - 44 invalid UTF-8 string - 45 support for \P, \p, and \X has not been compiled - 46 malformed \P or \p sequence - 47 unknown property name after \P or \p - - -STUDYING A PATTERN - - pcre_extra *pcre_study(const pcre *code, int options - const char **errptr); - - If a compiled pattern is going to be used several times, it is worth - spending more time analyzing it in order to speed up the time taken for - matching. The function pcre_study() takes a pointer to a compiled pat- - tern as its first argument. If studying the pattern produces additional - information that will help speed up matching, pcre_study() returns a - pointer to a pcre_extra block, in which the study_data field points to - the results of the study. - - The returned value from pcre_study() can be passed directly to - pcre_exec(). However, a pcre_extra block also contains other fields - that can be set by the caller before the block is passed; these are - described below in the section on matching a pattern. - - If studying the pattern does not produce any additional information - pcre_study() returns NULL. In that circumstance, if the calling program - wants to pass any of the other fields to pcre_exec(), it must set up - its own pcre_extra block. - - The second argument of pcre_study() contains option bits. At present, - no options are defined, and this argument should always be zero. - - The third argument for pcre_study() is a pointer for an error message. - If studying succeeds (even if no data is returned), the variable it - points to is set to NULL. Otherwise it points to a textual error mes- - sage. You should therefore test the error pointer for NULL after call- - ing pcre_study(), to be sure that it has run successfully. - - This is a typical call to pcre_study(): - - pcre_extra *pe; - pe = pcre_study( - re, /* result of pcre_compile() */ - 0, /* no options exist */ - &error); /* set to NULL or points to a message */ - - At present, studying a pattern is useful only for non-anchored patterns - that do not have a single fixed starting character. A bitmap of possi- - ble starting bytes is created. - - -LOCALE SUPPORT - - PCRE handles caseless matching, and determines whether characters are - letters digits, or whatever, by reference to a set of tables, indexed - by character value. When running in UTF-8 mode, this applies only to - characters with codes less than 128. Higher-valued codes never match - escapes such as \w or \d, but can be tested with \p if PCRE is built - with Unicode character property support. - - An internal set of tables is created in the default C locale when PCRE - is built. This is used when the final argument of pcre_compile() is - NULL, and is sufficient for many applications. An alternative set of - tables can, however, be supplied. These may be created in a different - locale from the default. As more and more applications change to using - Unicode, the need for this locale support is expected to die away. - - External tables are built by calling the pcre_maketables() function, - which has no arguments, in the relevant locale. The result can then be - passed to pcre_compile() or pcre_exec() as often as necessary. For - example, to build and use tables that are appropriate for the French - locale (where accented characters with values greater than 128 are - treated as letters), the following code could be used: - - setlocale(LC_CTYPE, "fr_FR"); - tables = pcre_maketables(); - re = pcre_compile(..., tables); - - When pcre_maketables() runs, the tables are built in memory that is - obtained via pcre_malloc. It is the caller's responsibility to ensure - that the memory containing the tables remains available for as long as - it is needed. - - The pointer that is passed to pcre_compile() is saved with the compiled - pattern, and the same tables are used via this pointer by pcre_study() - and normally also by pcre_exec(). Thus, by default, for any single pat- - tern, compilation, studying and matching all happen in the same locale, - but different patterns can be compiled in different locales. - - It is possible to pass a table pointer or NULL (indicating the use of - the internal tables) to pcre_exec(). Although not intended for this - purpose, this facility could be used to match a pattern in a different - locale from the one in which it was compiled. Passing table pointers at - run time is discussed below in the section on matching a pattern. - - -INFORMATION ABOUT A PATTERN - - int pcre_fullinfo(const pcre *code, const pcre_extra *extra, - int what, void *where); - - The pcre_fullinfo() function returns information about a compiled pat- - tern. It replaces the obsolete pcre_info() function, which is neverthe- - less retained for backwards compability (and is documented below). - - The first argument for pcre_fullinfo() is a pointer to the compiled - pattern. The second argument is the result of pcre_study(), or NULL if - the pattern was not studied. The third argument specifies which piece - of information is required, and the fourth argument is a pointer to a - variable to receive the data. The yield of the function is zero for - success, or one of the following negative numbers: - - PCRE_ERROR_NULL the argument code was NULL - the argument where was NULL - PCRE_ERROR_BADMAGIC the "magic number" was not found - PCRE_ERROR_BADOPTION the value of what was invalid - - The "magic number" is placed at the start of each compiled pattern as - an simple check against passing an arbitrary memory pointer. Here is a - typical call of pcre_fullinfo(), to obtain the length of the compiled - pattern: - - int rc; - unsigned long int length; - rc = pcre_fullinfo( - re, /* result of pcre_compile() */ - pe, /* result of pcre_study(), or NULL */ - PCRE_INFO_SIZE, /* what is required */ - &length); /* where to put the data */ - - The possible values for the third argument are defined in pcre.h, and - are as follows: - - PCRE_INFO_BACKREFMAX - - Return the number of the highest back reference in the pattern. The - fourth argument should point to an int variable. Zero is returned if - there are no back references. - - PCRE_INFO_CAPTURECOUNT - - Return the number of capturing subpatterns in the pattern. The fourth - argument should point to an int variable. - - PCRE_INFO_DEFAULT_TABLES - - Return a pointer to the internal default character tables within PCRE. - The fourth argument should point to an unsigned char * variable. This - information call is provided for internal use by the pcre_study() func- - tion. External callers can cause PCRE to use its internal tables by - passing a NULL table pointer. - - PCRE_INFO_FIRSTBYTE - - Return information about the first byte of any matched string, for a - non-anchored pattern. (This option used to be called - PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards - compatibility.) - - If there is a fixed first byte, for example, from a pattern such as - (cat|cow|coyote), it is returned in the integer pointed to by where. - Otherwise, if either - - (a) the pattern was compiled with the PCRE_MULTILINE option, and every - branch starts with "^", or - - (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not - set (if it were set, the pattern would be anchored), - - -1 is returned, indicating that the pattern matches only at the start - of a subject string or after any newline within the string. Otherwise - -2 is returned. For anchored patterns, -2 is returned. - - PCRE_INFO_FIRSTTABLE - - If the pattern was studied, and this resulted in the construction of a - 256-bit table indicating a fixed set of bytes for the first byte in any - matching string, a pointer to the table is returned. Otherwise NULL is - returned. The fourth argument should point to an unsigned char * vari- - able. - - PCRE_INFO_LASTLITERAL - - Return the value of the rightmost literal byte that must exist in any - matched string, other than at its start, if such a byte has been - recorded. The fourth argument should point to an int variable. If there - is no such byte, -1 is returned. For anchored patterns, a last literal - byte is recorded only if it follows something of variable length. For - example, for the pattern /^a\d+z\d+/ the returned value is "z", but for - /^a\dz\d/ the returned value is -1. - - PCRE_INFO_NAMECOUNT - PCRE_INFO_NAMEENTRYSIZE - PCRE_INFO_NAMETABLE - - PCRE supports the use of named as well as numbered capturing parenthe- - ses. The names are just an additional way of identifying the parenthe- - ses, which still acquire numbers. A convenience function called - pcre_get_named_substring() is provided for extracting an individual - captured substring by name. It is also possible to extract the data - directly, by first converting the name to a number in order to access - the correct pointers in the output vector (described with pcre_exec() - below). To do the conversion, you need to use the name-to-number map, - which is described by these three values. - - The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT - gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size - of each entry; both of these return an int value. The entry size - depends on the length of the longest name. PCRE_INFO_NAMETABLE returns - a pointer to the first entry of the table (a pointer to char). The - first two bytes of each entry are the number of the capturing parenthe- - sis, most significant byte first. The rest of the entry is the corre- - sponding name, zero terminated. The names are in alphabetical order. - For example, consider the following pattern (assume PCRE_EXTENDED is - set, so white space - including newlines - is ignored): - - (?P<date> (?P<year>(\d\d)?\d\d) - - (?P<month>\d\d) - (?P<day>\d\d) ) - - There are four named subpatterns, so the table has four entries, and - each entry in the table is eight bytes long. The table is as follows, - with non-printing bytes shows in hexadecimal, and undefined bytes shown - as ??: - - 00 01 d a t e 00 ?? - 00 05 d a y 00 ?? ?? - 00 04 m o n t h 00 - 00 02 y e a r 00 ?? - - When writing code to extract data from named subpatterns using the - name-to-number map, remember that the length of each entry is likely to - be different for each compiled pattern. - - PCRE_INFO_OPTIONS - - Return a copy of the options with which the pattern was compiled. The - fourth argument should point to an unsigned long int variable. These - option bits are those specified in the call to pcre_compile(), modified - by any top-level option settings within the pattern itself. - - A pattern is automatically anchored by PCRE if all of its top-level - alternatives begin with one of the following: - - ^ unless PCRE_MULTILINE is set - \A always - \G always - .* if PCRE_DOTALL is set and there are no back - references to the subpattern in which .* appears - - For such patterns, the PCRE_ANCHORED bit is set in the options returned - by pcre_fullinfo(). - - PCRE_INFO_SIZE - - Return the size of the compiled pattern, that is, the value that was - passed as the argument to pcre_malloc() when PCRE was getting memory in - which to place the compiled data. The fourth argument should point to a - size_t variable. - - PCRE_INFO_STUDYSIZE - - Return the size of the data block pointed to by the study_data field in - a pcre_extra block. That is, it is the value that was passed to - pcre_malloc() when PCRE was getting memory into which to place the data - created by pcre_study(). The fourth argument should point to a size_t - variable. - - -OBSOLETE INFO FUNCTION - - int pcre_info(const pcre *code, int *optptr, int *firstcharptr); - - The pcre_info() function is now obsolete because its interface is too - restrictive to return all the available data about a compiled pattern. - New programs should use pcre_fullinfo() instead. The yield of - pcre_info() is the number of capturing subpatterns, or one of the fol- - lowing negative numbers: - - PCRE_ERROR_NULL the argument code was NULL - PCRE_ERROR_BADMAGIC the "magic number" was not found - - If the optptr argument is not NULL, a copy of the options with which - the pattern was compiled is placed in the integer it points to (see - PCRE_INFO_OPTIONS above). - - If the pattern is not anchored and the firstcharptr argument is not - NULL, it is used to pass back information about the first character of - any matched string (see PCRE_INFO_FIRSTBYTE above). - - -REFERENCE COUNTS - - int pcre_refcount(pcre *code, int adjust); - - The pcre_refcount() function is used to maintain a reference count in - the data block that contains a compiled pattern. It is provided for the - benefit of applications that operate in an object-oriented manner, - where different parts of the application may be using the same compiled - pattern, but you want to free the block when they are all done. - - When a pattern is compiled, the reference count field is initialized to - zero. It is changed only by calling this function, whose action is to - add the adjust value (which may be positive or negative) to it. The - yield of the function is the new value. However, the value of the count - is constrained to lie between 0 and 65535, inclusive. If the new value - is outside these limits, it is forced to the appropriate limit value. - - Except when it is zero, the reference count is not correctly preserved - if a pattern is compiled on one host and then transferred to a host - whose byte-order is different. (This seems a highly unlikely scenario.) - - -MATCHING A PATTERN: THE TRADITIONAL FUNCTION - - int pcre_exec(const pcre *code, const pcre_extra *extra, - const char *subject, int length, int startoffset, - int options, int *ovector, int ovecsize); - - The function pcre_exec() is called to match a subject string against a - compiled pattern, which is passed in the code argument. If the pattern - has been studied, the result of the study should be passed in the extra - argument. This function is the main matching facility of the library, - and it operates in a Perl-like manner. For specialist use there is also - an alternative matching function, which is described below in the sec- - tion about the pcre_dfa_exec() function. - - In most applications, the pattern will have been compiled (and option- - ally studied) in the same process that calls pcre_exec(). However, it - is possible to save compiled patterns and study data, and then use them - later in different processes, possibly even on different hosts. For a - discussion about this, see the pcreprecompile documentation. - - Here is an example of a simple call to pcre_exec(): - - int rc; - int ovector[30]; - rc = pcre_exec( - re, /* result of pcre_compile() */ - NULL, /* we didn't study the pattern */ - "some string", /* the subject string */ - 11, /* the length of the subject string */ - 0, /* start at offset 0 in the subject */ - 0, /* default options */ - ovector, /* vector of integers for substring information */ - 30); /* number of elements (NOT size in bytes) */ - - Extra data for pcre_exec() - - If the extra argument is not NULL, it must point to a pcre_extra data - block. The pcre_study() function returns such a block (when it doesn't - return NULL), but you can also create one for yourself, and pass addi- - tional information in it. The fields in a pcre_extra block are as fol- - lows: - - unsigned long int flags; - void *study_data; - unsigned long int match_limit; - void *callout_data; - const unsigned char *tables; - - The flags field is a bitmap that specifies which of the other fields - are set. The flag bits are: - - PCRE_EXTRA_STUDY_DATA - PCRE_EXTRA_MATCH_LIMIT - PCRE_EXTRA_CALLOUT_DATA - PCRE_EXTRA_TABLES - - Other flag bits should be set to zero. The study_data field is set in - the pcre_extra block that is returned by pcre_study(), together with - the appropriate flag bit. You should not set this yourself, but you may - add to the block by setting the other fields and their corresponding - flag bits. - - The match_limit field provides a means of preventing PCRE from using up - a vast amount of resources when running patterns that are not going to - match, but which have a very large number of possibilities in their - search trees. The classic example is the use of nested unlimited - repeats. - - Internally, PCRE uses a function called match() which it calls repeat- - edly (sometimes recursively). The limit is imposed on the number of - times this function is called during a match, which has the effect of - limiting the amount of recursion and backtracking that can take place. - For patterns that are not anchored, the count starts from zero for each - position in the subject string. - - The default limit for the library can be set when PCRE is built; the - default default is 10 million, which handles all but the most extreme - cases. You can reduce the default by suppling pcre_exec() with a - pcre_extra block in which match_limit is set to a smaller value, and - PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is - exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. - - The pcre_callout field is used in conjunction with the "callout" fea- - ture, which is described in the pcrecallout documentation. - - The tables field is used to pass a character tables pointer to - pcre_exec(); this overrides the value that is stored with the compiled - pattern. A non-NULL value is stored with the compiled pattern only if - custom tables were supplied to pcre_compile() via its tableptr argu- - ment. If NULL is passed to pcre_exec() using this mechanism, it forces - PCRE's internal tables to be used. This facility is helpful when re- - using patterns that have been saved after compiling with an external - set of tables, because the external tables might be at a different - address when pcre_exec() is called. See the pcreprecompile documenta- - tion for a discussion of saving compiled patterns for later use. - - Option bits for pcre_exec() - - The unused bits of the options argument for pcre_exec() must be zero. - The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, - PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK and PCRE_PARTIAL. - - PCRE_ANCHORED - - The PCRE_ANCHORED option limits pcre_exec() to matching at the first - matching position. If a pattern was compiled with PCRE_ANCHORED, or - turned out to be anchored by virtue of its contents, it cannot be made - unachored at matching time. - - PCRE_NOTBOL - - This option specifies that first character of the subject string is not - the beginning of a line, so the circumflex metacharacter should not - match before it. Setting this without PCRE_MULTILINE (at compile time) - causes circumflex never to match. This option affects only the behav- - iour of the circumflex metacharacter. It does not affect \A. - - PCRE_NOTEOL - - This option specifies that the end of the subject string is not the end - of a line, so the dollar metacharacter should not match it nor (except - in multiline mode) a newline immediately before it. Setting this with- - out PCRE_MULTILINE (at compile time) causes dollar never to match. This - option affects only the behaviour of the dollar metacharacter. It does - not affect \Z or \z. - - PCRE_NOTEMPTY - - An empty string is not considered to be a valid match if this option is - set. If there are alternatives in the pattern, they are tried. If all - the alternatives match the empty string, the entire match fails. For - example, if the pattern - - a?b? - - is applied to a string not beginning with "a" or "b", it matches the - empty string at the start of the subject. With PCRE_NOTEMPTY set, this - match is not valid, so PCRE searches further into the string for occur- - rences of "a" or "b". - - Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a spe- - cial case of a pattern match of the empty string within its split() - function, and when using the /g modifier. It is possible to emulate - Perl's behaviour after matching a null string by first trying the match - again at the same offset with PCRE_NOTEMPTY and PCRE_ANCHORED, and then - if that fails by advancing the starting offset (see below) and trying - an ordinary match again. There is some code that demonstrates how to do - this in the pcredemo.c sample program. - - PCRE_NO_UTF8_CHECK - - When PCRE_UTF8 is set at compile time, the validity of the subject as a - UTF-8 string is automatically checked when pcre_exec() is subsequently - called. The value of startoffset is also checked to ensure that it - points to the start of a UTF-8 character. If an invalid UTF-8 sequence - of bytes is found, pcre_exec() returns the error PCRE_ERROR_BADUTF8. If - startoffset contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is - returned. - - If you already know that your subject is valid, and you want to skip - these checks for performance reasons, you can set the - PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to - do this for the second and subsequent calls to pcre_exec() if you are - making repeated calls to find all the matches in a single subject - string. However, you should be sure that the value of startoffset - points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is - set, the effect of passing an invalid UTF-8 string as a subject, or a - value of startoffset that does not point to the start of a UTF-8 char- - acter, is undefined. Your program may crash. - - PCRE_PARTIAL - - This option turns on the partial matching feature. If the subject - string fails to match the pattern, but at some point during the match- - ing process the end of the subject was reached (that is, the subject - partially matches the pattern and the failure to match occurred only - because there were not enough subject characters), pcre_exec() returns - PCRE_ERROR_PARTIAL instead of PCRE_ERROR_NOMATCH. When PCRE_PARTIAL is - used, there are restrictions on what may appear in the pattern. These - are discussed in the pcrepartial documentation. - - The string to be matched by pcre_exec() - - The subject string is passed to pcre_exec() as a pointer in subject, a - length in length, and a starting byte offset in startoffset. In UTF-8 - mode, the byte offset must point to the start of a UTF-8 character. - Unlike the pattern string, the subject may contain binary zero bytes. - When the starting offset is zero, the search for a match starts at the - beginning of the subject, and this is by far the most common case. - - A non-zero starting offset is useful when searching for another match - in the same subject by calling pcre_exec() again after a previous suc- - cess. Setting startoffset differs from just passing over a shortened - string and setting PCRE_NOTBOL in the case of a pattern that begins - with any kind of lookbehind. For example, consider the pattern - - \Biss\B - - which finds occurrences of "iss" in the middle of words. (\B matches - only if the current position in the subject is not a word boundary.) - When applied to the string "Mississipi" the first call to pcre_exec() - finds the first occurrence. If pcre_exec() is called again with just - the remainder of the subject, namely "issipi", it does not match, - because \B is always false at the start of the subject, which is deemed - to be a word boundary. However, if pcre_exec() is passed the entire - string again, but with startoffset set to 4, it finds the second occur- - rence of "iss" because it is able to look behind the starting point to - discover that it is preceded by a letter. - - If a non-zero starting offset is passed when the pattern is anchored, - one attempt to match at the given offset is made. This can only succeed - if the pattern does not require the match to be at the start of the - subject. - - How pcre_exec() returns captured substrings - - In general, a pattern matches a certain portion of the subject, and in - addition, further substrings from the subject may be picked out by - parts of the pattern. Following the usage in Jeffrey Friedl's book, - this is called "capturing" in what follows, and the phrase "capturing - subpattern" is used for a fragment of a pattern that picks out a sub- - string. PCRE supports several other kinds of parenthesized subpattern - that do not cause substrings to be captured. - - Captured substrings are returned to the caller via a vector of integer - offsets whose address is passed in ovector. The number of elements in - the vector is passed in ovecsize, which must be a non-negative number. - Note: this argument is NOT the size of ovector in bytes. - - The first two-thirds of the vector is used to pass back captured sub- - strings, each substring using a pair of integers. The remaining third - of the vector is used as workspace by pcre_exec() while matching cap- - turing subpatterns, and is not available for passing back information. - The length passed in ovecsize should always be a multiple of three. If - it is not, it is rounded down. - - When a match is successful, information about captured substrings is - returned in pairs of integers, starting at the beginning of ovector, - and continuing up to two-thirds of its length at the most. The first - element of a pair is set to the offset of the first character in a sub- - string, and the second is set to the offset of the first character - after the end of a substring. The first pair, ovector[0] and ovec- - tor[1], identify the portion of the subject string matched by the - entire pattern. The next pair is used for the first capturing subpat- - tern, and so on. The value returned by pcre_exec() is the number of - pairs that have been set. If there are no capturing subpatterns, the - return value from a successful match is 1, indicating that just the - first pair of offsets has been set. - - Some convenience functions are provided for extracting the captured - substrings as separate strings. These are described in the following - section. - - It is possible for an capturing subpattern number n+1 to match some - part of the subject when subpattern n has not been used at all. For - example, if the string "abc" is matched against the pattern (a|(z))(bc) - subpatterns 1 and 3 are matched, but 2 is not. When this happens, both - offset values corresponding to the unused subpattern are set to -1. - - If a capturing subpattern is matched repeatedly, it is the last portion - of the string that it matched that is returned. - - If the vector is too small to hold all the captured substring offsets, - it is used as far as possible (up to two-thirds of its length), and the - function returns a value of zero. In particular, if the substring off- - sets are not of interest, pcre_exec() may be called with ovector passed - as NULL and ovecsize as zero. However, if the pattern contains back - references and the ovector is not big enough to remember the related - substrings, PCRE has to get additional memory for use during matching. - Thus it is usually advisable to supply an ovector. - - Note that pcre_info() can be used to find out how many capturing sub- - patterns there are in a compiled pattern. The smallest size for ovector - that will allow for n captured substrings, in addition to the offsets - of the substring matched by the whole pattern, is (n+1)*3. - - Return values from pcre_exec() - - If pcre_exec() fails, it returns a negative number. The following are - defined in the header file: - - PCRE_ERROR_NOMATCH (-1) - - The subject string did not match the pattern. - - PCRE_ERROR_NULL (-2) - - Either code or subject was passed as NULL, or ovector was NULL and - ovecsize was not zero. - - PCRE_ERROR_BADOPTION (-3) - - An unrecognized bit was set in the options argument. - - PCRE_ERROR_BADMAGIC (-4) - - PCRE stores a 4-byte "magic number" at the start of the compiled code, - to catch the case when it is passed a junk pointer and to detect when a - pattern that was compiled in an environment of one endianness is run in - an environment with the other endianness. This is the error that PCRE - gives when the magic number is not present. - - PCRE_ERROR_UNKNOWN_NODE (-5) - - While running the pattern match, an unknown item was encountered in the - compiled pattern. This error could be caused by a bug in PCRE or by - overwriting of the compiled pattern. - - PCRE_ERROR_NOMEMORY (-6) - - If a pattern contains back references, but the ovector that is passed - to pcre_exec() is not big enough to remember the referenced substrings, - PCRE gets a block of memory at the start of matching to use for this - purpose. If the call via pcre_malloc() fails, this error is given. The - memory is automatically freed at the end of matching. - - PCRE_ERROR_NOSUBSTRING (-7) - - This error is used by the pcre_copy_substring(), pcre_get_substring(), - and pcre_get_substring_list() functions (see below). It is never - returned by pcre_exec(). - - PCRE_ERROR_MATCHLIMIT (-8) - - The recursion and backtracking limit, as specified by the match_limit - field in a pcre_extra structure (or defaulted) was reached. See the - description above. - - PCRE_ERROR_CALLOUT (-9) - - This error is never generated by pcre_exec() itself. It is provided for - use by callout functions that want to yield a distinctive error code. - See the pcrecallout documentation for details. - - PCRE_ERROR_BADUTF8 (-10) - - A string that contains an invalid UTF-8 byte sequence was passed as a - subject. - - PCRE_ERROR_BADUTF8_OFFSET (-11) - - The UTF-8 byte sequence that was passed as a subject was valid, but the - value of startoffset did not point to the beginning of a UTF-8 charac- - ter. - - PCRE_ERROR_PARTIAL (-12) - - The subject string did not match, but it did match partially. See the - pcrepartial documentation for details of partial matching. - - PCRE_ERROR_BADPARTIAL (-13) - - The PCRE_PARTIAL option was used with a compiled pattern containing - items that are not supported for partial matching. See the pcrepartial - documentation for details of partial matching. - - PCRE_ERROR_INTERNAL (-14) - - An unexpected internal error has occurred. This error could be caused - by a bug in PCRE or by overwriting of the compiled pattern. - - PCRE_ERROR_BADCOUNT (-15) - - This error is given if the value of the ovecsize argument is negative. - - -EXTRACTING CAPTURED SUBSTRINGS BY NUMBER - - int pcre_copy_substring(const char *subject, int *ovector, - int stringcount, int stringnumber, char *buffer, - int buffersize); - - int pcre_get_substring(const char *subject, int *ovector, - int stringcount, int stringnumber, - const char **stringptr); - - int pcre_get_substring_list(const char *subject, - int *ovector, int stringcount, const char ***listptr); - - Captured substrings can be accessed directly by using the offsets - returned by pcre_exec() in ovector. For convenience, the functions - pcre_copy_substring(), pcre_get_substring(), and pcre_get_sub- - string_list() are provided for extracting captured substrings as new, - separate, zero-terminated strings. These functions identify substrings - by number. The next section describes functions for extracting named - substrings. A substring that contains a binary zero is correctly - extracted and has a further zero added on the end, but the result is - not, of course, a C string. - - The first three arguments are the same for all three of these func- - tions: subject is the subject string that has just been successfully - matched, ovector is a pointer to the vector of integer offsets that was - passed to pcre_exec(), and stringcount is the number of substrings that - were captured by the match, including the substring that matched the - entire regular expression. This is the value returned by pcre_exec() if - it is greater than zero. If pcre_exec() returned zero, indicating that - it ran out of space in ovector, the value passed as stringcount should - be the number of elements in the vector divided by three. - - The functions pcre_copy_substring() and pcre_get_substring() extract a - single substring, whose number is given as stringnumber. A value of - zero extracts the substring that matched the entire pattern, whereas - higher values extract the captured substrings. For pcre_copy_sub- - string(), the string is placed in buffer, whose length is given by - buffersize, while for pcre_get_substring() a new block of memory is - obtained via pcre_malloc, and its address is returned via stringptr. - The yield of the function is the length of the string, not including - the terminating zero, or one of - - PCRE_ERROR_NOMEMORY (-6) - - The buffer was too small for pcre_copy_substring(), or the attempt to - get memory failed for pcre_get_substring(). - - PCRE_ERROR_NOSUBSTRING (-7) - - There is no substring whose number is stringnumber. - - The pcre_get_substring_list() function extracts all available sub- - strings and builds a list of pointers to them. All this is done in a - single block of memory that is obtained via pcre_malloc. The address of - the memory block is returned via listptr, which is also the start of - the list of string pointers. The end of the list is marked by a NULL - pointer. The yield of the function is zero if all went well, or - - PCRE_ERROR_NOMEMORY (-6) - - if the attempt to get the memory block failed. - - When any of these functions encounter a substring that is unset, which - can happen when capturing subpattern number n+1 matches some part of - the subject, but subpattern n has not been used at all, they return an - empty string. This can be distinguished from a genuine zero-length sub- - string by inspecting the appropriate offset in ovector, which is nega- - tive for unset substrings. - - The two convenience functions pcre_free_substring() and pcre_free_sub- - string_list() can be used to free the memory returned by a previous - call of pcre_get_substring() or pcre_get_substring_list(), respec- - tively. They do nothing more than call the function pointed to by - pcre_free, which of course could be called directly from a C program. - However, PCRE is used in some situations where it is linked via a spe- - cial interface to another programming language which cannot use - pcre_free directly; it is for these cases that the functions are pro- - vided. - - -EXTRACTING CAPTURED SUBSTRINGS BY NAME - - int pcre_get_stringnumber(const pcre *code, - const char *name); - - int pcre_copy_named_substring(const pcre *code, - const char *subject, int *ovector, - int stringcount, const char *stringname, - char *buffer, int buffersize); - - int pcre_get_named_substring(const pcre *code, - const char *subject, int *ovector, - int stringcount, const char *stringname, - const char **stringptr); - - To extract a substring by name, you first have to find associated num- - ber. For example, for this pattern - - (a+)b(?P<xxx>\d+)... - - the number of the subpattern called "xxx" is 2. You can find the number - from the name by calling pcre_get_stringnumber(). The first argument is - the compiled pattern, and the second is the name. The yield of the - function is the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if - there is no subpattern of that name. - - Given the number, you can extract the substring directly, or use one of - the functions described in the previous section. For convenience, there - are also two functions that do the whole job. - - Most of the arguments of pcre_copy_named_substring() and - pcre_get_named_substring() are the same as those for the similarly - named functions that extract by number. As these are described in the - previous section, they are not re-described here. There are just two - differences: - - First, instead of a substring number, a substring name is given. Sec- - ond, there is an extra argument, given at the start, which is a pointer - to the compiled pattern. This is needed in order to gain access to the - name-to-number translation table. - - These functions call pcre_get_stringnumber(), and if it succeeds, they - then call pcre_copy_substring() or pcre_get_substring(), as appropri- - ate. - - -FINDING ALL POSSIBLE MATCHES - - The traditional matching function uses a similar algorithm to Perl, - which stops when it finds the first match, starting at a given point in - the subject. If you want to find all possible matches, or the longest - possible match, consider using the alternative matching function (see - below) instead. If you cannot use the alternative function, but still - need to find all possible matches, you can kludge it up by making use - of the callout facility, which is described in the pcrecallout documen- - tation. - - What you have to do is to insert a callout right at the end of the pat- - tern. When your callout function is called, extract and save the cur- - rent matched substring. Then return 1, which forces pcre_exec() to - backtrack and try other alternatives. Ultimately, when it runs out of - matches, pcre_exec() will yield PCRE_ERROR_NOMATCH. - - -MATCHING A PATTERN: THE ALTERNATIVE FUNCTION - - int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, - const char *subject, int length, int startoffset, - int options, int *ovector, int ovecsize, - int *workspace, int wscount); - - The function pcre_dfa_exec() is called to match a subject string - against a compiled pattern, using a "DFA" matching algorithm. This has - different characteristics to the normal algorithm, and is not compati- - ble with Perl. Some of the features of PCRE patterns are not supported. - Nevertheless, there are times when this kind of matching can be useful. - For a discussion of the two matching algorithms, see the pcrematching - documentation. - - The arguments for the pcre_dfa_exec() function are the same as for - pcre_exec(), plus two extras. The ovector argument is used in a differ- - ent way, and this is described below. The other common arguments are - used in the same way as for pcre_exec(), so their description is not - repeated here. - - The two additional arguments provide workspace for the function. The - workspace vector should contain at least 20 elements. It is used for - keeping track of multiple paths through the pattern tree. More - workspace will be needed for patterns and subjects where there are a - lot of possible matches. - - Here is an example of a simple call to pcre_exec(): - - int rc; - int ovector[10]; - int wspace[20]; - rc = pcre_exec( - re, /* result of pcre_compile() */ - NULL, /* we didn't study the pattern */ - "some string", /* the subject string */ - 11, /* the length of the subject string */ - 0, /* start at offset 0 in the subject */ - 0, /* default options */ - ovector, /* vector of integers for substring information */ - 10, /* number of elements (NOT size in bytes) */ - wspace, /* working space vector */ - 20); /* number of elements (NOT size in bytes) */ - - Option bits for pcre_dfa_exec() - - The unused bits of the options argument for pcre_dfa_exec() must be - zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, - PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL, - PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last three of - these are the same as for pcre_exec(), so their description is not - repeated here. - - PCRE_PARTIAL - - This has the same general effect as it does for pcre_exec(), but the - details are slightly different. When PCRE_PARTIAL is set for - pcre_dfa_exec(), the return code PCRE_ERROR_NOMATCH is converted into - PCRE_ERROR_PARTIAL if the end of the subject is reached, there have - been no complete matches, but there is still at least one matching pos- - sibility. The portion of the string that provided the partial match is - set as the first matching string. - - PCRE_DFA_SHORTEST - - Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to - stop as soon as it has found one match. Because of the way the DFA - algorithm works, this is necessarily the shortest possible match at the - first possible matching point in the subject string. - - PCRE_DFA_RESTART - - When pcre_dfa_exec() is called with the PCRE_PARTIAL option, and - returns a partial match, it is possible to call it again, with addi- - tional subject characters, and have it continue with the same match. - The PCRE_DFA_RESTART option requests this action; when it is set, the - workspace and wscount options must reference the same vector as before - because data about the match so far is left in them after a partial - match. There is more discussion of this facility in the pcrepartial - documentation. - - Successful returns from pcre_dfa_exec() - - When pcre_dfa_exec() succeeds, it may have matched more than one sub- - string in the subject. Note, however, that all the matches from one run - of the function start at the same point in the subject. The shorter - matches are all initial substrings of the longer matches. For example, - if the pattern - - <.*> - - is matched against the string - - This is <something> <something else> <something further> no more - - the three matched strings are - - <something> - <something> <something else> - <something> <something else> <something further> - - On success, the yield of the function is a number greater than zero, - which is the number of matched substrings. The substrings themselves - are returned in ovector. Each string uses two elements; the first is - the offset to the start, and the second is the offset to the end. All - the strings have the same start offset. (Space could have been saved by - giving this only once, but it was decided to retain some compatibility - with the way pcre_exec() returns data, even though the meaning of the - strings is different.) - - The strings are returned in reverse order of length; that is, the long- - est matching string is given first. If there were too many matches to - fit into ovector, the yield of the function is zero, and the vector is - filled with the longest matches. - - Error returns from pcre_dfa_exec() - - The pcre_dfa_exec() function returns a negative number when it fails. - Many of the errors are the same as for pcre_exec(), and these are - described above. There are in addition the following errors that are - specific to pcre_dfa_exec(): - - PCRE_ERROR_DFA_UITEM (-16) - - This return is given if pcre_dfa_exec() encounters an item in the pat- - tern that it does not support, for instance, the use of \C or a back - reference. - - PCRE_ERROR_DFA_UCOND (-17) - - This return is given if pcre_dfa_exec() encounters a condition item in - a pattern that uses a back reference for the condition. This is not - supported. - - PCRE_ERROR_DFA_UMLIMIT (-18) - - This return is given if pcre_dfa_exec() is called with an extra block - that contains a setting of the match_limit field. This is not supported - (it is meaningless). - - PCRE_ERROR_DFA_WSSIZE (-19) - - This return is given if pcre_dfa_exec() runs out of space in the - workspace vector. - - PCRE_ERROR_DFA_RECURSE (-20) - - When a recursive subpattern is processed, the matching function calls - itself recursively, using private vectors for ovector and workspace. - This error is given if the output vector is not large enough. This - should be extremely rare, as a vector of size 1000 is used. - -Last updated: 16 May 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCRECALLOUT(3) PCRECALLOUT(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE CALLOUTS - - int (*pcre_callout)(pcre_callout_block *); - - PCRE provides a feature called "callout", which is a means of temporar- - ily passing control to the caller of PCRE in the middle of pattern - matching. The caller of PCRE provides an external function by putting - its entry point in the global variable pcre_callout. By default, this - variable contains NULL, which disables all calling out. - - Within a regular expression, (?C) indicates the points at which the - external function is to be called. Different callout points can be - identified by putting a number less than 256 after the letter C. The - default value is zero. For example, this pattern has two callout - points: - - (?C1)eabc(?C2)def - - If the PCRE_AUTO_CALLOUT option bit is set when pcre_compile() is - called, PCRE automatically inserts callouts, all with number 255, - before each item in the pattern. For example, if PCRE_AUTO_CALLOUT is - used with the pattern - - A(\d{2}|--) - - it is processed as if it were - - (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) - - Notice that there is a callout before and after each parenthesis and - alternation bar. Automatic callouts can be used for tracking the - progress of pattern matching. The pcretest command has an option that - sets automatic callouts; when it is used, the output indicates how the - pattern is matched. This is useful information when you are trying to - optimize the performance of a particular pattern. - - -MISSING CALLOUTS - - You should be aware that, because of optimizations in the way PCRE - matches patterns, callouts sometimes do not happen. For example, if the - pattern is - - ab(?C4)cd - - PCRE knows that any matching string must contain the letter "d". If the - subject string is "abyz", the lack of "d" means that matching doesn't - ever start, and the callout is never reached. However, with "abyd", - though the result is still no match, the callout is obeyed. - - -THE CALLOUT INTERFACE - - During matching, when PCRE reaches a callout point, the external func- - tion defined by pcre_callout is called (if it is set). This applies to - both the pcre_exec() and the pcre_dfa_exec() matching functions. The - only argument to the callout function is a pointer to a pcre_callout - block. This structure contains the following fields: - - int version; - int callout_number; - int *offset_vector; - const char *subject; - int subject_length; - int start_match; - int current_position; - int capture_top; - int capture_last; - void *callout_data; - int pattern_position; - int next_item_length; - - The version field is an integer containing the version number of the - block format. The initial version was 0; the current version is 1. The - version number will change again in future if additional fields are - added, but the intention is never to remove any of the existing fields. - - The callout_number field contains the number of the callout, as com- - piled into the pattern (that is, the number after ?C for manual call- - outs, and 255 for automatically generated callouts). - - The offset_vector field is a pointer to the vector of offsets that was - passed by the caller to pcre_exec() or pcre_dfa_exec(). When - pcre_exec() is used, the contents can be inspected in order to extract - substrings that have been matched so far, in the same way as for - extracting substrings after a match has completed. For pcre_dfa_exec() - this field is not useful. - - The subject and subject_length fields contain copies of the values that - were passed to pcre_exec(). - - The start_match field contains the offset within the subject at which - the current match attempt started. If the pattern is not anchored, the - callout function may be called several times from the same point in the - pattern for different starting points in the subject. - - The current_position field contains the offset within the subject of - the current match pointer. - - When the pcre_exec() function is used, the capture_top field contains - one more than the number of the highest numbered captured substring so - far. If no substrings have been captured, the value of capture_top is - one. This is always the case when pcre_dfa_exec() is used, because it - does not support captured substrings. - - The capture_last field contains the number of the most recently cap- - tured substring. If no substrings have been captured, its value is -1. - This is always the case when pcre_dfa_exec() is used. - - The callout_data field contains a value that is passed to pcre_exec() - or pcre_dfa_exec() specifically so that it can be passed back in call- - outs. It is passed in the pcre_callout field of the pcre_extra data - structure. If no such data was passed, the value of callout_data in a - pcre_callout block is NULL. There is a description of the pcre_extra - structure in the pcreapi documentation. - - The pattern_position field is present from version 1 of the pcre_call- - out structure. It contains the offset to the next item to be matched in - the pattern string. - - The next_item_length field is present from version 1 of the pcre_call- - out structure. It contains the length of the next item to be matched in - the pattern string. When the callout immediately precedes an alterna- - tion bar, a closing parenthesis, or the end of the pattern, the length - is zero. When the callout precedes an opening parenthesis, the length - is that of the entire subpattern. - - The pattern_position and next_item_length fields are intended to help - in distinguishing between different automatic callouts, which all have - the same callout number. However, they are set for all callouts. - - -RETURN VALUES - - The external callout function returns an integer to PCRE. If the value - is zero, matching proceeds as normal. If the value is greater than - zero, matching fails at the current point, but the testing of other - matching possibilities goes ahead, just as if a lookahead assertion had - failed. If the value is less than zero, the match is abandoned, and - pcre_exec() (or pcre_dfa_exec()) returns the negative value. - - Negative values should normally be chosen from the set of - PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a stan- - dard "no match" failure. The error number PCRE_ERROR_CALLOUT is - reserved for use by callout functions; it will never be used by PCRE - itself. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCRECOMPAT(3) PCRECOMPAT(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -DIFFERENCES BETWEEN PCRE AND PERL - - This document describes the differences in the ways that PCRE and Perl - handle regular expressions. The differences described here are with - respect to Perl 5.8. - - 1. PCRE does not have full UTF-8 support. Details of what it does have - are given in the section on UTF-8 support in the main pcre page. - - 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl - permits them, but they do not mean what you might think. For example, - (?!a){3} does not assert that the next three characters are not "a". It - just asserts that the next character is not "a" three times. - - 3. Capturing subpatterns that occur inside negative lookahead asser- - tions are counted, but their entries in the offsets vector are never - set. Perl sets its numerical variables from any such patterns that are - matched before the assertion fails to match something (thereby succeed- - ing), but only if the negative lookahead assertion contains just one - branch. - - 4. Though binary zero characters are supported in the subject string, - they are not allowed in a pattern string because it is passed as a nor- - mal C string, terminated by zero. The escape sequence \0 can be used in - the pattern to represent a binary zero. - - 5. The following Perl escape sequences are not supported: \l, \u, \L, - \U, and \N. In fact these are implemented by Perl's general string-han- - dling and are not part of its pattern matching engine. If any of these - are encountered by PCRE, an error is generated. - - 6. The Perl escape sequences \p, \P, and \X are supported only if PCRE - is built with Unicode character property support. The properties that - can be tested with \p and \P are limited to the general category prop- - erties such as Lu and Nd. - - 7. PCRE does support the \Q...\E escape for quoting substrings. Charac- - ters in between are treated as literals. This is slightly different - from Perl in that $ and @ are also handled as literals inside the - quotes. In Perl, they cause variable interpolation (but of course PCRE - does not have variables). Note the following examples: - - Pattern PCRE matches Perl matches - - \Qabc$xyz\E abc$xyz abc followed by the - contents of $xyz - \Qabc\$xyz\E abc\$xyz abc\$xyz - \Qabc\E\$\Qxyz\E abc$xyz abc$xyz - - The \Q...\E sequence is recognized both inside and outside character - classes. - - 8. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) - constructions. However, there is support for recursive patterns using - the non-Perl items (?R), (?number), and (?P>name). Also, the PCRE - "callout" feature allows an external function to be called during pat- - tern matching. See the pcrecallout documentation for details. - - 9. There are some differences that are concerned with the settings of - captured strings when part of a pattern is repeated. For example, - matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 - unset, but in PCRE it is set to "b". - - 10. PCRE provides some extensions to the Perl regular expression facil- - ities: - - (a) Although lookbehind assertions must match fixed length strings, - each alternative branch of a lookbehind assertion can match a different - length of string. Perl requires them all to have the same length. - - (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ - meta-character matches only at the very end of the string. - - (c) If PCRE_EXTRA is set, a backslash followed by a letter with no spe- - cial meaning is faulted. - - (d) If PCRE_UNGREEDY is set, the greediness of the repetition quanti- - fiers is inverted, that is, by default they are not greedy, but if fol- - lowed by a question mark they are. - - (e) PCRE_ANCHORED can be used at matching time to force a pattern to be - tried only at the first matching position in the subject string. - - (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAP- - TURE options for pcre_exec() have no Perl equivalents. - - (g) The (?R), (?number), and (?P>name) constructs allows for recursive - pattern matching (Perl can do this using the (?p{code}) construct, - which PCRE cannot support.) - - (h) PCRE supports named capturing substrings, using the Python syntax. - - (i) PCRE supports the possessive quantifier "++" syntax, taken from - Sun's Java package. - - (j) The (R) condition, for testing recursion, is a PCRE extension. - - (k) The callout facility is PCRE-specific. - - (l) The partial matching facility is PCRE-specific. - - (m) Patterns compiled by PCRE can be saved and re-used at a later time, - even on different hosts that have the other endianness. - - (n) The alternative matching function (pcre_dfa_exec()) matches in a - different way and is not Perl-compatible. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREPATTERN(3) PCREPATTERN(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE REGULAR EXPRESSION DETAILS - - The syntax and semantics of the regular expressions supported by PCRE - are described below. Regular expressions are also described in the Perl - documentation and in a number of books, some of which have copious - examples. Jeffrey Friedl's "Mastering Regular Expressions", published - by O'Reilly, covers regular expressions in great detail. This descrip- - tion of PCRE's regular expressions is intended as reference material. - - The original operation of PCRE was on strings of one-byte characters. - However, there is now also support for UTF-8 character strings. To use - this, you must build PCRE to include UTF-8 support, and then call - pcre_compile() with the PCRE_UTF8 option. How this affects pattern - matching is mentioned in several places below. There is also a summary - of UTF-8 features in the section on UTF-8 support in the main pcre - page. - - The remainder of this document discusses the patterns that are sup- - ported by PCRE when its main matching function, pcre_exec(), is used. - From release 6.0, PCRE offers a second matching function, - pcre_dfa_exec(), which matches using a different algorithm that is not - Perl-compatible. The advantages and disadvantages of the alternative - function, and how it differs from the normal function, are discussed in - the pcrematching page. - - A regular expression is a pattern that is matched against a subject - string from left to right. Most characters stand for themselves in a - pattern, and match the corresponding characters in the subject. As a - trivial example, the pattern - - The quick brown fox - - matches a portion of a subject string that is identical to itself. When - caseless matching is specified (the PCRE_CASELESS option), letters are - matched independently of case. In UTF-8 mode, PCRE always understands - the concept of case for characters whose values are less than 128, so - caseless matching is always possible. For characters with higher val- - ues, the concept of case is supported if PCRE is compiled with Unicode - property support, but not otherwise. If you want to use caseless - matching for characters 128 and above, you must ensure that PCRE is - compiled with Unicode property support as well as with UTF-8 support. - - The power of regular expressions comes from the ability to include - alternatives and repetitions in the pattern. These are encoded in the - pattern by the use of metacharacters, which do not stand for themselves - but instead are interpreted in some special way. - - There are two different sets of metacharacters: those that are recog- - nized anywhere in the pattern except within square brackets, and those - that are recognized in square brackets. Outside square brackets, the - metacharacters are as follows: - - \ general escape character with several uses - ^ assert start of string (or line, in multiline mode) - $ assert end of string (or line, in multiline mode) - . match any character except newline (by default) - [ start character class definition - | start of alternative branch - ( start subpattern - ) end subpattern - ? extends the meaning of ( - also 0 or 1 quantifier - also quantifier minimizer - * 0 or more quantifier - + 1 or more quantifier - also "possessive quantifier" - { start min/max quantifier - - Part of a pattern that is in square brackets is called a "character - class". In a character class the only metacharacters are: - - \ general escape character - ^ negate the class, but only if the first character - - indicates character range - [ POSIX character class (only if followed by POSIX - syntax) - ] terminates the character class - - The following sections describe the use of each of the metacharacters. - - -BACKSLASH - - The backslash character has several uses. Firstly, if it is followed by - a non-alphanumeric character, it takes away any special meaning that - character may have. This use of backslash as an escape character - applies both inside and outside character classes. - - For example, if you want to match a * character, you write \* in the - pattern. This escaping action applies whether or not the following - character would otherwise be interpreted as a metacharacter, so it is - always safe to precede a non-alphanumeric with backslash to specify - that it stands for itself. In particular, if you want to match a back- - slash, you write \\. - - If a pattern is compiled with the PCRE_EXTENDED option, whitespace in - the pattern (other than in a character class) and characters between a - # outside a character class and the next newline character are ignored. - An escaping backslash can be used to include a whitespace or # charac- - ter as part of the pattern. - - If you want to remove the special meaning from a sequence of charac- - ters, you can do so by putting them between \Q and \E. This is differ- - ent from Perl in that $ and @ are handled as literals in \Q...\E - sequences in PCRE, whereas in Perl, $ and @ cause variable interpola- - tion. Note the following examples: - - Pattern PCRE matches Perl matches - - \Qabc$xyz\E abc$xyz abc followed by the - contents of $xyz - \Qabc\$xyz\E abc\$xyz abc\$xyz - \Qabc\E\$\Qxyz\E abc$xyz abc$xyz - - The \Q...\E sequence is recognized both inside and outside character - classes. - - Non-printing characters - - A second use of backslash provides a way of encoding non-printing char- - acters in patterns in a visible manner. There is no restriction on the - appearance of non-printing characters, apart from the binary zero that - terminates a pattern, but when a pattern is being prepared by text - editing, it is usually easier to use one of the following escape - sequences than the binary character it represents: - - \a alarm, that is, the BEL character (hex 07) - \cx "control-x", where x is any character - \e escape (hex 1B) - \f formfeed (hex 0C) - \n newline (hex 0A) - \r carriage return (hex 0D) - \t tab (hex 09) - \ddd character with octal code ddd, or backreference - \xhh character with hex code hh - \x{hhh..} character with hex code hhh... (UTF-8 mode only) - - The precise effect of \cx is as follows: if x is a lower case letter, - it is converted to upper case. Then bit 6 of the character (hex 40) is - inverted. Thus \cz becomes hex 1A, but \c{ becomes hex 3B, while \c; - becomes hex 7B. - - After \x, from zero to two hexadecimal digits are read (letters can be - in upper or lower case). In UTF-8 mode, any number of hexadecimal dig- - its may appear between \x{ and }, but the value of the character code - must be less than 2**31 (that is, the maximum hexadecimal value is - 7FFFFFFF). If characters other than hexadecimal digits appear between - \x{ and }, or if there is no terminating }, this form of escape is not - recognized. Instead, the initial \x will be interpreted as a basic - hexadecimal escape, with no following digits, giving a character whose - value is zero. - - Characters whose value is less than 256 can be defined by either of the - two syntaxes for \x when PCRE is in UTF-8 mode. There is no difference - in the way they are handled. For example, \xdc is exactly the same as - \x{dc}. - - After \0 up to two further octal digits are read. In both cases, if - there are fewer than two digits, just those that are present are used. - Thus the sequence \0\x\07 specifies two binary zeros followed by a BEL - character (code value 7). Make sure you supply two digits after the - initial zero if the pattern character that follows is itself an octal - digit. - - The handling of a backslash followed by a digit other than 0 is compli- - cated. Outside a character class, PCRE reads it and any following dig- - its as a decimal number. If the number is less than 10, or if there - have been at least that many previous capturing left parentheses in the - expression, the entire sequence is taken as a back reference. A - description of how this works is given later, following the discussion - of parenthesized subpatterns. - - Inside a character class, or if the decimal number is greater than 9 - and there have not been that many capturing subpatterns, PCRE re-reads - up to three octal digits following the backslash, and generates a sin- - gle byte from the least significant 8 bits of the value. Any subsequent - digits stand for themselves. For example: - - \040 is another way of writing a space - \40 is the same, provided there are fewer than 40 - previous capturing subpatterns - \7 is always a back reference - \11 might be a back reference, or another way of - writing a tab - \011 is always a tab - \0113 is a tab followed by the character "3" - \113 might be a back reference, otherwise the - character with octal code 113 - \377 might be a back reference, otherwise - the byte consisting entirely of 1 bits - \81 is either a back reference, or a binary zero - followed by the two characters "8" and "1" - - Note that octal values of 100 or greater must not be introduced by a - leading zero, because no more than three octal digits are ever read. - - All the sequences that define a single byte value or a single UTF-8 - character (in UTF-8 mode) can be used both inside and outside character - classes. In addition, inside a character class, the sequence \b is - interpreted as the backspace character (hex 08), and the sequence \X is - interpreted as the character "X". Outside a character class, these - sequences have different meanings (see below). - - Generic character types - - The third use of backslash is for specifying generic character types. - The following are always recognized: - - \d any decimal digit - \D any character that is not a decimal digit - \s any whitespace character - \S any character that is not a whitespace character - \w any "word" character - \W any "non-word" character - - Each pair of escape sequences partitions the complete set of characters - into two disjoint sets. Any given character matches one, and only one, - of each pair. - - These character type sequences can appear both inside and outside char- - acter classes. They each match one character of the appropriate type. - If the current matching point is at the end of the subject string, all - of them fail, since there is no character to match. - - For compatibility with Perl, \s does not match the VT character (code - 11). This makes it different from the the POSIX "space" class. The \s - characters are HT (9), LF (10), FF (12), CR (13), and space (32). - - A "word" character is an underscore or any character less than 256 that - is a letter or digit. The definition of letters and digits is con- - trolled by PCRE's low-valued character tables, and may vary if locale- - specific matching is taking place (see "Locale support" in the pcreapi - page). For example, in the "fr_FR" (French) locale, some character - codes greater than 128 are used for accented letters, and these are - matched by \w. - - In UTF-8 mode, characters with values greater than 128 never match \d, - \s, or \w, and always match \D, \S, and \W. This is true even when Uni- - code character property support is available. - - Unicode character properties - - When PCRE is built with Unicode character property support, three addi- - tional escape sequences to match generic character types are available - when UTF-8 mode is selected. They are: - - \p{xx} a character with the xx property - \P{xx} a character without the xx property - \X an extended Unicode sequence - - The property names represented by xx above are limited to the Unicode - general category properties. Each character has exactly one such prop- - erty, specified by a two-letter abbreviation. For compatibility with - Perl, negation can be specified by including a circumflex between the - opening brace and the property name. For example, \p{^Lu} is the same - as \P{Lu}. - - If only one letter is specified with \p or \P, it includes all the - properties that start with that letter. In this case, in the absence of - negation, the curly brackets in the escape sequence are optional; these - two examples have the same effect: - - \p{L} - \pL - - The following property codes are supported: - - C Other - Cc Control - Cf Format - Cn Unassigned - Co Private use - Cs Surrogate - - L Letter - Ll Lower case letter - Lm Modifier letter - Lo Other letter - Lt Title case letter - Lu Upper case letter - - M Mark - Mc Spacing mark - Me Enclosing mark - Mn Non-spacing mark - - N Number - Nd Decimal number - Nl Letter number - No Other number - - P Punctuation - Pc Connector punctuation - Pd Dash punctuation - Pe Close punctuation - Pf Final punctuation - Pi Initial punctuation - Po Other punctuation - Ps Open punctuation - - S Symbol - Sc Currency symbol - Sk Modifier symbol - Sm Mathematical symbol - So Other symbol - - Z Separator - Zl Line separator - Zp Paragraph separator - Zs Space separator - - Extended properties such as "Greek" or "InMusicalSymbols" are not sup- - ported by PCRE. - - Specifying caseless matching does not affect these escape sequences. - For example, \p{Lu} always matches only upper case letters. - - The \X escape matches any number of Unicode characters that form an - extended Unicode sequence. \X is equivalent to - - (?>\PM\pM*) - - That is, it matches a character without the "mark" property, followed - by zero or more characters with the "mark" property, and treats the - sequence as an atomic group (see below). Characters with the "mark" - property are typically accents that affect the preceding character. - - Matching characters by Unicode property is not fast, because PCRE has - to search a structure that contains data for over fifteen thousand - characters. That is why the traditional escape sequences such as \d and - \w do not use Unicode properties in PCRE. - - Simple assertions - - The fourth use of backslash is for certain simple assertions. An asser- - tion specifies a condition that has to be met at a particular point in - a match, without consuming any characters from the subject string. The - use of subpatterns for more complicated assertions is described below. - The backslashed assertions are: - - \b matches at a word boundary - \B matches when not at a word boundary - \A matches at start of subject - \Z matches at end of subject or before newline at end - \z matches at end of subject - \G matches at first matching position in subject - - These assertions may not appear in character classes (but note that \b - has a different meaning, namely the backspace character, inside a char- - acter class). - - A word boundary is a position in the subject string where the current - character and the previous character do not both match \w or \W (i.e. - one matches \w and the other matches \W), or the start or end of the - string if the first or last character matches \w, respectively. - - The \A, \Z, and \z assertions differ from the traditional circumflex - and dollar (described in the next section) in that they only ever match - at the very start and end of the subject string, whatever options are - set. Thus, they are independent of multiline mode. These three asser- - tions are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options, which - affect only the behaviour of the circumflex and dollar metacharacters. - However, if the startoffset argument of pcre_exec() is non-zero, indi- - cating that matching is to start at a point other than the beginning of - the subject, \A can never match. The difference between \Z and \z is - that \Z matches before a newline that is the last character of the - string as well as at the end of the string, whereas \z matches only at - the end. - - The \G assertion is true only when the current matching position is at - the start point of the match, as specified by the startoffset argument - of pcre_exec(). It differs from \A when the value of startoffset is - non-zero. By calling pcre_exec() multiple times with appropriate argu- - ments, you can mimic Perl's /g option, and it is in this kind of imple- - mentation where \G can be useful. - - Note, however, that PCRE's interpretation of \G, as the start of the - current match, is subtly different from Perl's, which defines it as the - end of the previous match. In Perl, these can be different when the - previously matched string was empty. Because PCRE does just one match - at a time, it cannot reproduce this behaviour. - - If all the alternatives of a pattern begin with \G, the expression is - anchored to the starting match position, and the "anchored" flag is set - in the compiled regular expression. - - -CIRCUMFLEX AND DOLLAR - - Outside a character class, in the default matching mode, the circumflex - character is an assertion that is true only if the current matching - point is at the start of the subject string. If the startoffset argu- - ment of pcre_exec() is non-zero, circumflex can never match if the - PCRE_MULTILINE option is unset. Inside a character class, circumflex - has an entirely different meaning (see below). - - Circumflex need not be the first character of the pattern if a number - of alternatives are involved, but it should be the first thing in each - alternative in which it appears if the pattern is ever to match that - branch. If all possible alternatives start with a circumflex, that is, - if the pattern is constrained to match only at the start of the sub- - ject, it is said to be an "anchored" pattern. (There are also other - constructs that can cause a pattern to be anchored.) - - A dollar character is an assertion that is true only if the current - matching point is at the end of the subject string, or immediately - before a newline character that is the last character in the string (by - default). Dollar need not be the last character of the pattern if a - number of alternatives are involved, but it should be the last item in - any branch in which it appears. Dollar has no special meaning in a - character class. - - The meaning of dollar can be changed so that it matches only at the - very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at - compile time. This does not affect the \Z assertion. - - The meanings of the circumflex and dollar characters are changed if the - PCRE_MULTILINE option is set. When this is the case, they match immedi- - ately after and immediately before an internal newline character, - respectively, in addition to matching at the start and end of the sub- - ject string. For example, the pattern /^abc$/ matches the subject - string "def\nabc" (where \n represents a newline character) in multi- - line mode, but not otherwise. Consequently, patterns that are anchored - in single line mode because all branches start with ^ are not anchored - in multiline mode, and a match for circumflex is possible when the - startoffset argument of pcre_exec() is non-zero. The PCRE_DOL- - LAR_ENDONLY option is ignored if PCRE_MULTILINE is set. - - Note that the sequences \A, \Z, and \z can be used to match the start - and end of the subject in both modes, and if all branches of a pattern - start with \A it is always anchored, whether PCRE_MULTILINE is set or - not. - - -FULL STOP (PERIOD, DOT) - - Outside a character class, a dot in the pattern matches any one charac- - ter in the subject, including a non-printing character, but not (by - default) newline. In UTF-8 mode, a dot matches any UTF-8 character, - which might be more than one byte long, except (by default) newline. If - the PCRE_DOTALL option is set, dots match newlines as well. The han- - dling of dot is entirely independent of the handling of circumflex and - dollar, the only relationship being that they both involve newline - characters. Dot has no special meaning in a character class. - - -MATCHING A SINGLE BYTE - - Outside a character class, the escape sequence \C matches any one byte, - both in and out of UTF-8 mode. Unlike a dot, it can match a newline. - The feature is provided in Perl in order to match individual bytes in - UTF-8 mode. Because it breaks up UTF-8 characters into individual - bytes, what remains in the string may be a malformed UTF-8 string. For - this reason, the \C escape sequence is best avoided. - - PCRE does not allow \C to appear in lookbehind assertions (described - below), because in UTF-8 mode this would make it impossible to calcu- - late the length of the lookbehind. - - -SQUARE BRACKETS AND CHARACTER CLASSES - - An opening square bracket introduces a character class, terminated by a - closing square bracket. A closing square bracket on its own is not spe- - cial. If a closing square bracket is required as a member of the class, - it should be the first data character in the class (after an initial - circumflex, if present) or escaped with a backslash. - - A character class matches a single character in the subject. In UTF-8 - mode, the character may occupy more than one byte. A matched character - must be in the set of characters defined by the class, unless the first - character in the class definition is a circumflex, in which case the - subject character must not be in the set defined by the class. If a - circumflex is actually required as a member of the class, ensure it is - not the first character, or escape it with a backslash. - - For example, the character class [aeiou] matches any lower case vowel, - while [^aeiou] matches any character that is not a lower case vowel. - Note that a circumflex is just a convenient notation for specifying the - characters that are in the class by enumerating those that are not. A - class that starts with a circumflex is not an assertion: it still con- - sumes a character from the subject string, and therefore it fails if - the current pointer is at the end of the string. - - In UTF-8 mode, characters with values greater than 255 can be included - in a class as a literal string of bytes, or by using the \x{ escaping - mechanism. - - When caseless matching is set, any letters in a class represent both - their upper case and lower case versions, so for example, a caseless - [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not - match "A", whereas a caseful version would. In UTF-8 mode, PCRE always - understands the concept of case for characters whose values are less - than 128, so caseless matching is always possible. For characters with - higher values, the concept of case is supported if PCRE is compiled - with Unicode property support, but not otherwise. If you want to use - caseless matching for characters 128 and above, you must ensure that - PCRE is compiled with Unicode property support as well as with UTF-8 - support. - - The newline character is never treated in any special way in character - classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE - options is. A class such as [^a] will always match a newline. - - The minus (hyphen) character can be used to specify a range of charac- - ters in a character class. For example, [d-m] matches any letter - between d and m, inclusive. If a minus character is required in a - class, it must be escaped with a backslash or appear in a position - where it cannot be interpreted as indicating a range, typically as the - first or last character in the class. - - It is not possible to have the literal character "]" as the end charac- - ter of a range. A pattern such as [W-]46] is interpreted as a class of - two characters ("W" and "-") followed by a literal string "46]", so it - would match "W46]" or "-46]". However, if the "]" is escaped with a - backslash it is interpreted as the end of range, so [W-\]46] is inter- - preted as a class containing a range followed by two other characters. - The octal or hexadecimal representation of "]" can also be used to end - a range. - - Ranges operate in the collating sequence of character values. They can - also be used for characters specified numerically, for example - [\000-\037]. In UTF-8 mode, ranges can include characters whose values - are greater than 255, for example [\x{100}-\x{2ff}]. - - If a range that includes letters is used when caseless matching is set, - it matches the letters in either case. For example, [W-c] is equivalent - to [][\\^_`wxyzabc], matched caselessly, and in non-UTF-8 mode, if - character tables for the "fr_FR" locale are in use, [\xc8-\xcb] matches - accented E characters in both cases. In UTF-8 mode, PCRE supports the - concept of case for characters with values greater than 128 only when - it is compiled with Unicode property support. - - The character types \d, \D, \p, \P, \s, \S, \w, and \W may also appear - in a character class, and add the characters that they match to the - class. For example, [\dABCDEF] matches any hexadecimal digit. A circum- - flex can conveniently be used with the upper case character types to - specify a more restricted set of characters than the matching lower - case type. For example, the class [^\W_] matches any letter or digit, - but not underscore. - - The only metacharacters that are recognized in character classes are - backslash, hyphen (only where it can be interpreted as specifying a - range), circumflex (only at the start), opening square bracket (only - when it can be interpreted as introducing a POSIX class name - see the - next section), and the terminating closing square bracket. However, - escaping other non-alphanumeric characters does no harm. - - -POSIX CHARACTER CLASSES - - Perl supports the POSIX notation for character classes. This uses names - enclosed by [: and :] within the enclosing square brackets. PCRE also - supports this notation. For example, - - [01[:alpha:]%] - - matches "0", "1", any alphabetic character, or "%". The supported class - names are - - alnum letters and digits - alpha letters - ascii character codes 0 - 127 - blank space or tab only - cntrl control characters - digit decimal digits (same as \d) - graph printing characters, excluding space - lower lower case letters - print printing characters, including space - punct printing characters, excluding letters and digits - space white space (not quite the same as \s) - upper upper case letters - word "word" characters (same as \w) - xdigit hexadecimal digits - - The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), - and space (32). Notice that this list includes the VT character (code - 11). This makes "space" different to \s, which does not include VT (for - Perl compatibility). - - The name "word" is a Perl extension, and "blank" is a GNU extension - from Perl 5.8. Another Perl extension is negation, which is indicated - by a ^ character after the colon. For example, - - [12[:^digit:]] - - matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the - POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but - these are not supported, and an error is given if they are encountered. - - In UTF-8 mode, characters with values greater than 128 do not match any - of the POSIX character classes. - - -VERTICAL BAR - - Vertical bar characters are used to separate alternative patterns. For - example, the pattern - - gilbert|sullivan - - matches either "gilbert" or "sullivan". Any number of alternatives may - appear, and an empty alternative is permitted (matching the empty - string). The matching process tries each alternative in turn, from - left to right, and the first one that succeeds is used. If the alterna- - tives are within a subpattern (defined below), "succeeds" means match- - ing the rest of the main pattern as well as the alternative in the sub- - pattern. - - -INTERNAL OPTION SETTING - - The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and - PCRE_EXTENDED options can be changed from within the pattern by a - sequence of Perl option letters enclosed between "(?" and ")". The - option letters are - - i for PCRE_CASELESS - m for PCRE_MULTILINE - s for PCRE_DOTALL - x for PCRE_EXTENDED - - For example, (?im) sets caseless, multiline matching. It is also possi- - ble to unset these options by preceding the letter with a hyphen, and a - combined setting and unsetting such as (?im-sx), which sets PCRE_CASE- - LESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, - is also permitted. If a letter appears both before and after the - hyphen, the option is unset. - - When an option change occurs at top level (that is, not inside subpat- - tern parentheses), the change applies to the remainder of the pattern - that follows. If the change is placed right at the start of a pattern, - PCRE extracts it into the global options (and it will therefore show up - in data extracted by the pcre_fullinfo() function). - - An option change within a subpattern affects only that part of the cur- - rent pattern that follows it, so - - (a(?i)b)c - - matches abc and aBc and no other strings (assuming PCRE_CASELESS is not - used). By this means, options can be made to have different settings - in different parts of the pattern. Any changes made in one alternative - do carry on into subsequent branches within the same subpattern. For - example, - - (a(?i)b|c) - - matches "ab", "aB", "c", and "C", even though when matching "C" the - first branch is abandoned before the option setting. This is because - the effects of option settings happen at compile time. There would be - some very weird behaviour otherwise. - - The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed - in the same way as the Perl-compatible options by using the characters - U and X respectively. The (?X) flag setting is special in that it must - always occur earlier in the pattern than any of the additional features - it turns on, even when it is at top level. It is best to put it at the - start. - - -SUBPATTERNS - - Subpatterns are delimited by parentheses (round brackets), which can be - nested. Turning part of a pattern into a subpattern does two things: - - 1. It localizes a set of alternatives. For example, the pattern - - cat(aract|erpillar|) - - matches one of the words "cat", "cataract", or "caterpillar". Without - the parentheses, it would match "cataract", "erpillar" or the empty - string. - - 2. It sets up the subpattern as a capturing subpattern. This means - that, when the whole pattern matches, that portion of the subject - string that matched the subpattern is passed back to the caller via the - ovector argument of pcre_exec(). Opening parentheses are counted from - left to right (starting from 1) to obtain numbers for the capturing - subpatterns. - - For example, if the string "the red king" is matched against the pat- - tern - - the ((red|white) (king|queen)) - - the captured substrings are "red king", "red", and "king", and are num- - bered 1, 2, and 3, respectively. - - The fact that plain parentheses fulfil two functions is not always - helpful. There are often times when a grouping subpattern is required - without a capturing requirement. If an opening parenthesis is followed - by a question mark and a colon, the subpattern does not do any captur- - ing, and is not counted when computing the number of any subsequent - capturing subpatterns. For example, if the string "the white queen" is - matched against the pattern - - the ((?:red|white) (king|queen)) - - the captured substrings are "white queen" and "queen", and are numbered - 1 and 2. The maximum number of capturing subpatterns is 65535, and the - maximum depth of nesting of all subpatterns, both capturing and non- - capturing, is 200. - - As a convenient shorthand, if any option settings are required at the - start of a non-capturing subpattern, the option letters may appear - between the "?" and the ":". Thus the two patterns - - (?i:saturday|sunday) - (?:(?i)saturday|sunday) - - match exactly the same set of strings. Because alternative branches are - tried from left to right, and options are not reset until the end of - the subpattern is reached, an option setting in one branch does affect - subsequent branches, so the above patterns match "SUNDAY" as well as - "Saturday". - - -NAMED SUBPATTERNS - - Identifying capturing parentheses by number is simple, but it can be - very hard to keep track of the numbers in complicated regular expres- - sions. Furthermore, if an expression is modified, the numbers may - change. To help with this difficulty, PCRE supports the naming of sub- - patterns, something that Perl does not provide. The Python syntax - (?P<name>...) is used. Names consist of alphanumeric characters and - underscores, and must be unique within a pattern. - - Named capturing parentheses are still allocated numbers as well as - names. The PCRE API provides function calls for extracting the name-to- - number translation table from a compiled pattern. There is also a con- - venience function for extracting a captured substring by name. For fur- - ther details see the pcreapi documentation. - - -REPETITION - - Repetition is specified by quantifiers, which can follow any of the - following items: - - a literal data character - the . metacharacter - the \C escape sequence - the \X escape sequence (in UTF-8 mode with Unicode properties) - an escape such as \d that matches a single character - a character class - a back reference (see next section) - a parenthesized subpattern (unless it is an assertion) - - The general repetition quantifier specifies a minimum and maximum num- - ber of permitted matches, by giving the two numbers in curly brackets - (braces), separated by a comma. The numbers must be less than 65536, - and the first must be less than or equal to the second. For example: - - z{2,4} - - matches "zz", "zzz", or "zzzz". A closing brace on its own is not a - special character. If the second number is omitted, but the comma is - present, there is no upper limit; if the second number and the comma - are both omitted, the quantifier specifies an exact number of required - matches. Thus - - [aeiou]{3,} - - matches at least 3 successive vowels, but may match many more, while - - \d{8} - - matches exactly 8 digits. An opening curly bracket that appears in a - position where a quantifier is not allowed, or one that does not match - the syntax of a quantifier, is taken as a literal character. For exam- - ple, {,6} is not a quantifier, but a literal string of four characters. - - In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to - individual bytes. Thus, for example, \x{100}{2} matches two UTF-8 char- - acters, each of which is represented by a two-byte sequence. Similarly, - when Unicode property support is available, \X{3} matches three Unicode - extended sequences, each of which may be several bytes long (and they - may be of different lengths). - - The quantifier {0} is permitted, causing the expression to behave as if - the previous item and the quantifier were not present. - - For convenience (and historical compatibility) the three most common - quantifiers have single-character abbreviations: - - * is equivalent to {0,} - + is equivalent to {1,} - ? is equivalent to {0,1} - - It is possible to construct infinite loops by following a subpattern - that can match no characters with a quantifier that has no upper limit, - for example: - - (a?)* - - Earlier versions of Perl and PCRE used to give an error at compile time - for such patterns. However, because there are cases where this can be - useful, such patterns are now accepted, but if any repetition of the - subpattern does in fact match no characters, the loop is forcibly bro- - ken. - - By default, the quantifiers are "greedy", that is, they match as much - as possible (up to the maximum number of permitted times), without - causing the rest of the pattern to fail. The classic example of where - this gives problems is in trying to match comments in C programs. These - appear between /* and */ and within the comment, individual * and / - characters may appear. An attempt to match C comments by applying the - pattern - - /\*.*\*/ - - to the string - - /* first comment */ not comment /* second comment */ - - fails, because it matches the entire string owing to the greediness of - the .* item. - - However, if a quantifier is followed by a question mark, it ceases to - be greedy, and instead matches the minimum number of times possible, so - the pattern - - /\*.*?\*/ - - does the right thing with the C comments. The meaning of the various - quantifiers is not otherwise changed, just the preferred number of - matches. Do not confuse this use of question mark with its use as a - quantifier in its own right. Because it has two uses, it can sometimes - appear doubled, as in - - \d??\d - - which matches one digit by preference, but can match two if that is the - only way the rest of the pattern matches. - - If the PCRE_UNGREEDY option is set (an option which is not available in - Perl), the quantifiers are not greedy by default, but individual ones - can be made greedy by following them with a question mark. In other - words, it inverts the default behaviour. - - When a parenthesized subpattern is quantified with a minimum repeat - count that is greater than 1 or with a limited maximum, more memory is - required for the compiled pattern, in proportion to the size of the - minimum or maximum. - - If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equiv- - alent to Perl's /s) is set, thus allowing the . to match newlines, the - pattern is implicitly anchored, because whatever follows will be tried - against every character position in the subject string, so there is no - point in retrying the overall match at any position after the first. - PCRE normally treats such a pattern as though it were preceded by \A. - - In cases where it is known that the subject string contains no new- - lines, it is worth setting PCRE_DOTALL in order to obtain this opti- - mization, or alternatively using ^ to indicate anchoring explicitly. - - However, there is one situation where the optimization cannot be used. - When .* is inside capturing parentheses that are the subject of a - backreference elsewhere in the pattern, a match at the start may fail, - and a later one succeed. Consider, for example: - - (.*)abc\1 - - If the subject is "xyz123abc123" the match point is the fourth charac- - ter. For this reason, such a pattern is not implicitly anchored. - - When a capturing subpattern is repeated, the value captured is the sub- - string that matched the final iteration. For example, after - - (tweedle[dume]{3}\s*)+ - - has matched "tweedledum tweedledee" the value of the captured substring - is "tweedledee". However, if there are nested capturing subpatterns, - the corresponding captured values may have been set in previous itera- - tions. For example, after - - /(a|(b))+/ - - matches "aba" the value of the second captured substring is "b". - - -ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS - - With both maximizing and minimizing repetition, failure of what follows - normally causes the repeated item to be re-evaluated to see if a dif- - ferent number of repeats allows the rest of the pattern to match. Some- - times it is useful to prevent this, either to change the nature of the - match, or to cause it fail earlier than it otherwise might, when the - author of the pattern knows there is no point in carrying on. - - Consider, for example, the pattern \d+foo when applied to the subject - line - - 123456bar - - After matching all 6 digits and then failing to match "foo", the normal - action of the matcher is to try again with only 5 digits matching the - \d+ item, and then with 4, and so on, before ultimately failing. - "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides - the means for specifying that once a subpattern has matched, it is not - to be re-evaluated in this way. - - If we use atomic grouping for the previous example, the matcher would - give up immediately on failing to match "foo" the first time. The nota- - tion is a kind of special parenthesis, starting with (?> as in this - example: - - (?>\d+)foo - - This kind of parenthesis "locks up" the part of the pattern it con- - tains once it has matched, and a failure further into the pattern is - prevented from backtracking into it. Backtracking past it to previous - items, however, works as normal. - - An alternative description is that a subpattern of this type matches - the string of characters that an identical standalone pattern would - match, if anchored at the current point in the subject string. - - Atomic grouping subpatterns are not capturing subpatterns. Simple cases - such as the above example can be thought of as a maximizing repeat that - must swallow everything it can. So, while both \d+ and \d+? are pre- - pared to adjust the number of digits they match in order to make the - rest of the pattern match, (?>\d+) can only match an entire sequence of - digits. - - Atomic groups in general can of course contain arbitrarily complicated - subpatterns, and can be nested. However, when the subpattern for an - atomic group is just a single repeated item, as in the example above, a - simpler notation, called a "possessive quantifier" can be used. This - consists of an additional + character following a quantifier. Using - this notation, the previous example can be rewritten as - - \d++foo - - Possessive quantifiers are always greedy; the setting of the - PCRE_UNGREEDY option is ignored. They are a convenient notation for the - simpler forms of atomic group. However, there is no difference in the - meaning or processing of a possessive quantifier and the equivalent - atomic group. - - The possessive quantifier syntax is an extension to the Perl syntax. It - originates in Sun's Java package. - - When a pattern contains an unlimited repeat inside a subpattern that - can itself be repeated an unlimited number of times, the use of an - atomic group is the only way to avoid some failing matches taking a - very long time indeed. The pattern - - (\D+|<\d+>)*[!?] - - matches an unlimited number of substrings that either consist of non- - digits, or digits enclosed in <>, followed by either ! or ?. When it - matches, it runs quickly. However, if it is applied to - - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - - it takes a long time before reporting failure. This is because the - string can be divided between the internal \D+ repeat and the external - * repeat in a large number of ways, and all have to be tried. (The - example uses [!?] rather than a single character at the end, because - both PCRE and Perl have an optimization that allows for fast failure - when a single character is used. They remember the last single charac- - ter that is required for a match, and fail early if it is not present - in the string.) If the pattern is changed so that it uses an atomic - group, like this: - - ((?>\D+)|<\d+>)*[!?] - - sequences of non-digits cannot be broken, and failure happens quickly. - - -BACK REFERENCES - - Outside a character class, a backslash followed by a digit greater than - 0 (and possibly further digits) is a back reference to a capturing sub- - pattern earlier (that is, to its left) in the pattern, provided there - have been that many previous capturing left parentheses. - - However, if the decimal number following the backslash is less than 10, - it is always taken as a back reference, and causes an error only if - there are not that many capturing left parentheses in the entire pat- - tern. In other words, the parentheses that are referenced need not be - to the left of the reference for numbers less than 10. See the subsec- - tion entitled "Non-printing characters" above for further details of - the handling of digits following a backslash. - - A back reference matches whatever actually matched the capturing sub- - pattern in the current subject string, rather than anything matching - the subpattern itself (see "Subpatterns as subroutines" below for a way - of doing that). So the pattern - - (sens|respons)e and \1ibility - - matches "sense and sensibility" and "response and responsibility", but - not "sense and responsibility". If caseful matching is in force at the - time of the back reference, the case of letters is relevant. For exam- - ple, - - ((?i)rah)\s+\1 - - matches "rah rah" and "RAH RAH", but not "RAH rah", even though the - original capturing subpattern is matched caselessly. - - Back references to named subpatterns use the Python syntax (?P=name). - We could rewrite the above example as follows: - - (?<p1>(?i)rah)\s+(?P=p1) - - There may be more than one back reference to the same subpattern. If a - subpattern has not actually been used in a particular match, any back - references to it always fail. For example, the pattern - - (a|(bc))\2 - - always fails if it starts to match "a" rather than "bc". Because there - may be many capturing parentheses in a pattern, all digits following - the backslash are taken as part of a potential back reference number. - If the pattern continues with a digit character, some delimiter must be - used to terminate the back reference. If the PCRE_EXTENDED option is - set, this can be whitespace. Otherwise an empty comment (see "Com- - ments" below) can be used. - - A back reference that occurs inside the parentheses to which it refers - fails when the subpattern is first used, so, for example, (a\1) never - matches. However, such references can be useful inside repeated sub- - patterns. For example, the pattern - - (a|b\1)+ - - matches any number of "a"s and also "aba", "ababbaa" etc. At each iter- - ation of the subpattern, the back reference matches the character - string corresponding to the previous iteration. In order for this to - work, the pattern must be such that the first iteration does not need - to match the back reference. This can be done using alternation, as in - the example above, or by a quantifier with a minimum of zero. - - -ASSERTIONS - - An assertion is a test on the characters following or preceding the - current matching point that does not actually consume any characters. - The simple assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are - described above. - - More complicated assertions are coded as subpatterns. There are two - kinds: those that look ahead of the current position in the subject - string, and those that look behind it. An assertion subpattern is - matched in the normal way, except that it does not cause the current - matching position to be changed. - - Assertion subpatterns are not capturing subpatterns, and may not be - repeated, because it makes no sense to assert the same thing several - times. If any kind of assertion contains capturing subpatterns within - it, these are counted for the purposes of numbering the capturing sub- - patterns in the whole pattern. However, substring capturing is carried - out only for positive assertions, because it does not make sense for - negative assertions. - - Lookahead assertions - - Lookahead assertions start with (?= for positive assertions and (?! for - negative assertions. For example, - - \w+(?=;) - - matches a word followed by a semicolon, but does not include the semi- - colon in the match, and - - foo(?!bar) - - matches any occurrence of "foo" that is not followed by "bar". Note - that the apparently similar pattern - - (?!foo)bar - - does not find an occurrence of "bar" that is preceded by something - other than "foo"; it finds any occurrence of "bar" whatsoever, because - the assertion (?!foo) is always true when the next three characters are - "bar". A lookbehind assertion is needed to achieve the other effect. - - If you want to force a matching failure at some point in a pattern, the - most convenient way to do it is with (?!) because an empty string - always matches, so an assertion that requires there not to be an empty - string must always fail. - - Lookbehind assertions - - Lookbehind assertions start with (?<= for positive assertions and (?<! - for negative assertions. For example, - - (?<!foo)bar - - does find an occurrence of "bar" that is not preceded by "foo". The - contents of a lookbehind assertion are restricted such that all the - strings it matches must have a fixed length. However, if there are sev- - eral alternatives, they do not all have to have the same fixed length. - Thus - - (?<=bullock|donkey) - - is permitted, but - - (?<!dogs?|cats?) - - causes an error at compile time. Branches that match different length - strings are permitted only at the top level of a lookbehind assertion. - This is an extension compared with Perl (at least for 5.8), which - requires all branches to match the same length of string. An assertion - such as - - (?<=ab(c|de)) - - is not permitted, because its single top-level branch can match two - different lengths, but it is acceptable if rewritten to use two top- - level branches: - - (?<=abc|abde) - - The implementation of lookbehind assertions is, for each alternative, - to temporarily move the current position back by the fixed width and - then try to match. If there are insufficient characters before the cur- - rent position, the match is deemed to fail. - - PCRE does not allow the \C escape (which matches a single byte in UTF-8 - mode) to appear in lookbehind assertions, because it makes it impossi- - ble to calculate the length of the lookbehind. The \X escape, which can - match different numbers of bytes, is also not permitted. - - Atomic groups can be used in conjunction with lookbehind assertions to - specify efficient matching at the end of the subject string. Consider a - simple pattern such as - - abcd$ - - when applied to a long string that does not match. Because matching - proceeds from left to right, PCRE will look for each "a" in the subject - and then see if what follows matches the rest of the pattern. If the - pattern is specified as - - ^.*abcd$ - - the initial .* matches the entire string at first, but when this fails - (because there is no following "a"), it backtracks to match all but the - last character, then all but the last two characters, and so on. Once - again the search for "a" covers the entire string, from right to left, - so we are no better off. However, if the pattern is written as - - ^(?>.*)(?<=abcd) - - or, equivalently, using the possessive quantifier syntax, - - ^.*+(?<=abcd) - - there can be no backtracking for the .* item; it can match only the - entire string. The subsequent lookbehind assertion does a single test - on the last four characters. If it fails, the match fails immediately. - For long strings, this approach makes a significant difference to the - processing time. - - Using multiple assertions - - Several assertions (of any sort) may occur in succession. For example, - - (?<=\d{3})(?<!999)foo - - matches "foo" preceded by three digits that are not "999". Notice that - each of the assertions is applied independently at the same point in - the subject string. First there is a check that the previous three - characters are all digits, and then there is a check that the same - three characters are not "999". This pattern does not match "foo" pre- - ceded by six characters, the first of which are digits and the last - three of which are not "999". For example, it doesn't match "123abc- - foo". A pattern to do that is - - (?<=\d{3}...)(?<!999)foo - - This time the first assertion looks at the preceding six characters, - checking that the first three are digits, and then the second assertion - checks that the preceding three characters are not "999". - - Assertions can be nested in any combination. For example, - - (?<=(?<!foo)bar)baz - - matches an occurrence of "baz" that is preceded by "bar" which in turn - is not preceded by "foo", while - - (?<=\d{3}(?!999)...)foo - - is another pattern that matches "foo" preceded by three digits and any - three characters that are not "999". - - -CONDITIONAL SUBPATTERNS - - It is possible to cause the matching process to obey a subpattern con- - ditionally or to choose between two alternative subpatterns, depending - on the result of an assertion, or whether a previous capturing subpat- - tern matched or not. The two possible forms of conditional subpattern - are - - (?(condition)yes-pattern) - (?(condition)yes-pattern|no-pattern) - - If the condition is satisfied, the yes-pattern is used; otherwise the - no-pattern (if present) is used. If there are more than two alterna- - tives in the subpattern, a compile-time error occurs. - - There are three kinds of condition. If the text between the parentheses - consists of a sequence of digits, the condition is satisfied if the - capturing subpattern of that number has previously matched. The number - must be greater than zero. Consider the following pattern, which con- - tains non-significant white space to make it more readable (assume the - PCRE_EXTENDED option) and to divide it into three parts for ease of - discussion: - - ( \( )? [^()]+ (?(1) \) ) - - The first part matches an optional opening parenthesis, and if that - character is present, sets it as the first captured substring. The sec- - ond part matches one or more characters that are not parentheses. The - third part is a conditional subpattern that tests whether the first set - of parentheses matched or not. If they did, that is, if subject started - with an opening parenthesis, the condition is true, and so the yes-pat- - tern is executed and a closing parenthesis is required. Otherwise, - since no-pattern is not present, the subpattern matches nothing. In - other words, this pattern matches a sequence of non-parentheses, - optionally enclosed in parentheses. - - If the condition is the string (R), it is satisfied if a recursive call - to the pattern or subpattern has been made. At "top level", the condi- - tion is false. This is a PCRE extension. Recursive patterns are - described in the next section. - - If the condition is not a sequence of digits or (R), it must be an - assertion. This may be a positive or negative lookahead or lookbehind - assertion. Consider this pattern, again containing non-significant - white space, and with the two alternatives on the second line: - - (?(?=[^a-z]*[a-z]) - \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) - - The condition is a positive lookahead assertion that matches an - optional sequence of non-letters followed by a letter. In other words, - it tests for the presence of at least one letter in the subject. If a - letter is found, the subject is matched against the first alternative; - otherwise it is matched against the second. This pattern matches - strings in one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are - letters and dd are digits. - - -COMMENTS - - The sequence (?# marks the start of a comment that continues up to the - next closing parenthesis. Nested parentheses are not permitted. The - characters that make up a comment play no part in the pattern matching - at all. - - If the PCRE_EXTENDED option is set, an unescaped # character outside a - character class introduces a comment that continues up to the next new- - line character in the pattern. - - -RECURSIVE PATTERNS - - Consider the problem of matching a string in parentheses, allowing for - unlimited nested parentheses. Without the use of recursion, the best - that can be done is to use a pattern that matches up to some fixed - depth of nesting. It is not possible to handle an arbitrary nesting - depth. Perl provides a facility that allows regular expressions to - recurse (amongst other things). It does this by interpolating Perl code - in the expression at run time, and the code can refer to the expression - itself. A Perl pattern to solve the parentheses problem can be created - like this: - - $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x; - - The (?p{...}) item interpolates Perl code at run time, and in this case - refers recursively to the pattern in which it appears. Obviously, PCRE - cannot support the interpolation of Perl code. Instead, it supports - some special syntax for recursion of the entire pattern, and also for - individual subpattern recursion. - - The special item that consists of (? followed by a number greater than - zero and a closing parenthesis is a recursive call of the subpattern of - the given number, provided that it occurs inside that subpattern. (If - not, it is a "subroutine" call, which is described in the next sec- - tion.) The special item (?R) is a recursive call of the entire regular - expression. - - For example, this PCRE pattern solves the nested parentheses problem - (assume the PCRE_EXTENDED option is set so that white space is - ignored): - - \( ( (?>[^()]+) | (?R) )* \) - - First it matches an opening parenthesis. Then it matches any number of - substrings which can either be a sequence of non-parentheses, or a - recursive match of the pattern itself (that is a correctly parenthe- - sized substring). Finally there is a closing parenthesis. - - If this were part of a larger pattern, you would not want to recurse - the entire pattern, so instead you could use this: - - ( \( ( (?>[^()]+) | (?1) )* \) ) - - We have put the pattern into parentheses, and caused the recursion to - refer to them instead of the whole pattern. In a larger pattern, keep- - ing track of parenthesis numbers can be tricky. It may be more conve- - nient to use named parentheses instead. For this, PCRE uses (?P>name), - which is an extension to the Python syntax that PCRE uses for named - parentheses (Perl does not provide named parentheses). We could rewrite - the above example as follows: - - (?P<pn> \( ( (?>[^()]+) | (?P>pn) )* \) ) - - This particular example pattern contains nested unlimited repeats, and - so the use of atomic grouping for matching strings of non-parentheses - is important when applying the pattern to strings that do not match. - For example, when this pattern is applied to - - (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() - - it yields "no match" quickly. However, if atomic grouping is not used, - the match runs for a very long time indeed because there are so many - different ways the + and * repeats can carve up the subject, and all - have to be tested before failure can be reported. - - At the end of a match, the values set for any capturing subpatterns are - those from the outermost level of the recursion at which the subpattern - value is set. If you want to obtain intermediate values, a callout - function can be used (see the next section and the pcrecallout documen- - tation). If the pattern above is matched against - - (ab(cd)ef) - - the value for the capturing parentheses is "ef", which is the last - value taken on at the top level. If additional parentheses are added, - giving - - \( ( ( (?>[^()]+) | (?R) )* ) \) - ^ ^ - ^ ^ - - the string they capture is "ab(cd)ef", the contents of the top level - parentheses. If there are more than 15 capturing parentheses in a pat- - tern, PCRE has to obtain extra memory to store data during a recursion, - which it does by using pcre_malloc, freeing it via pcre_free after- - wards. If no memory can be obtained, the match fails with the - PCRE_ERROR_NOMEMORY error. - - Do not confuse the (?R) item with the condition (R), which tests for - recursion. Consider this pattern, which matches text in angle brack- - ets, allowing for arbitrary nesting. Only digits are allowed in nested - brackets (that is, when recursing), whereas any characters are permit- - ted at the outer level. - - < (?: (?(R) \d++ | [^<>]*+) | (?R)) * > - - In this pattern, (?(R) is the start of a conditional subpattern, with - two different alternatives for the recursive and non-recursive cases. - The (?R) item is the actual recursive call. - - -SUBPATTERNS AS SUBROUTINES - - If the syntax for a recursive subpattern reference (either by number or - by name) is used outside the parentheses to which it refers, it oper- - ates like a subroutine in a programming language. An earlier example - pointed out that the pattern - - (sens|respons)e and \1ibility - - matches "sense and sensibility" and "response and responsibility", but - not "sense and responsibility". If instead the pattern - - (sens|respons)e and (?1)ibility - - is used, it does match "sense and responsibility" as well as the other - two strings. Such references must, however, follow the subpattern to - which they refer. - - -CALLOUTS - - Perl has a feature whereby using the sequence (?{...}) causes arbitrary - Perl code to be obeyed in the middle of matching a regular expression. - This makes it possible, amongst other things, to extract different sub- - strings that match the same pair of parentheses when there is a repeti- - tion. - - PCRE provides a similar feature, but of course it cannot obey arbitrary - Perl code. The feature is called "callout". The caller of PCRE provides - an external function by putting its entry point in the global variable - pcre_callout. By default, this variable contains NULL, which disables - all calling out. - - Within a regular expression, (?C) indicates the points at which the - external function is to be called. If you want to identify different - callout points, you can put a number less than 256 after the letter C. - The default value is zero. For example, this pattern has two callout - points: - - (?C1)abc(?C2)def - - If the PCRE_AUTO_CALLOUT flag is passed to pcre_compile(), callouts are - automatically installed before each item in the pattern. They are all - numbered 255. - - During matching, when PCRE reaches a callout point (and pcre_callout is - set), the external function is called. It is provided with the number - of the callout, the position in the pattern, and, optionally, one item - of data originally supplied by the caller of pcre_exec(). The callout - function may cause matching to proceed, to backtrack, or to fail alto- - gether. A complete description of the interface to the callout function - is given in the pcrecallout documentation. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREPARTIAL(3) PCREPARTIAL(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PARTIAL MATCHING IN PCRE - - In normal use of PCRE, if the subject string that is passed to - pcre_exec() or pcre_dfa_exec() matches as far as it goes, but is too - short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. - There are circumstances where it might be helpful to distinguish this - case from other cases in which there is no match. - - Consider, for example, an application where a human is required to type - in data for a field with specific formatting requirements. An example - might be a date in the form ddmmmyy, defined by this pattern: - - ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$ - - If the application sees the user's keystrokes one by one, and can check - that what has been typed so far is potentially valid, it is able to - raise an error as soon as a mistake is made, possibly beeping and not - reflecting the character that has been typed. This immediate feedback - is likely to be a better user interface than a check that is delayed - until the entire string has been entered. - - PCRE supports the concept of partial matching by means of the PCRE_PAR- - TIAL option, which can be set when calling pcre_exec() or - pcre_dfa_exec(). When this flag is set for pcre_exec(), the return code - PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if at any time - during the matching process the last part of the subject string matched - part of the pattern. Unfortunately, for non-anchored matching, it is - not possible to obtain the position of the start of the partial match. - No captured data is set when PCRE_ERROR_PARTIAL is returned. - - When PCRE_PARTIAL is set for pcre_dfa_exec(), the return code - PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end of - the subject is reached, there have been no complete matches, but there - is still at least one matching possibility. The portion of the string - that provided the partial match is set as the first matching string. - - Using PCRE_PARTIAL disables one of PCRE's optimizations. PCRE remembers - the last literal byte in a pattern, and abandons matching immediately - if such a byte is not present in the subject string. This optimization - cannot be used for a subject string that might match only partially. - - -RESTRICTED PATTERNS FOR PCRE_PARTIAL - - Because of the way certain internal optimizations are implemented in - the pcre_exec() function, the PCRE_PARTIAL option cannot be used with - all patterns. These restrictions do not apply when pcre_dfa_exec() is - used. For pcre_exec(), repeated single characters such as - - a{2,4} - - and repeated single metasequences such as - - \d+ - - are not permitted if the maximum number of occurrences is greater than - one. Optional items such as \d? (where the maximum is one) are permit- - ted. Quantifiers with any values are permitted after parentheses, so - the invalid examples above can be coded thus: - - (a){2,4} - (\d)+ - - These constructions run more slowly, but for the kinds of application - that are envisaged for this facility, this is not felt to be a major - restriction. - - If PCRE_PARTIAL is set for a pattern that does not conform to the - restrictions, pcre_exec() returns the error code PCRE_ERROR_BADPARTIAL - (-13). - - -EXAMPLE OF PARTIAL MATCHING USING PCRETEST - - If the escape sequence \P is present in a pcretest data line, the - PCRE_PARTIAL flag is used for the match. Here is a run of pcretest that - uses the date example quoted above: - - re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ - data> 25jun04P - 0: 25jun04 - 1: jun - data> 25dec3P - Partial match - data> 3juP - Partial match - data> 3jujP - No match - data> jP - No match - - The first data string is matched completely, so pcretest shows the - matched substrings. The remaining four strings do not match the com- - plete pattern, but the first two are partial matches. The same test, - using DFA matching (by means of the \D escape sequence), produces the - following output: - - re> /^?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)$/ - data> 25jun04\P\D - 0: 25jun04 - data> 23dec3\P\D - Partial match: 23dec3 - data> 3ju\P\D - Partial match: 3ju - data> 3juj\P\D - No match - data> j\P\D - No match - - Notice that in this case the portion of the string that was matched is - made available. - - -MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() - - When a partial match has been found using pcre_dfa_exec(), it is possi- - ble to continue the match by providing additional subject data and - calling pcre_dfa_exec() again with the PCRE_DFA_RESTART option and the - same working space (where details of the previous partial match are - stored). Here is an example using pcretest, where the \R escape - sequence sets the PCRE_DFA_RESTART option and the \D escape sequence - requests the use of pcre_dfa_exec(): - - re> /^?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)$/ - data> 23ja\P\D - Partial match: 23ja - data> n05\R\D - 0: n05 - - The first call has "23ja" as the subject, and requests partial match- - ing; the second call has "n05" as the subject for the continued - (restarted) match. Notice that when the match is complete, only the - last part is shown; PCRE does not retain the previously partially- - matched string. It is up to the calling program to do that if it needs - to. - - This facility can be used to pass very long subject strings to - pcre_dfa_exec(). However, some care is needed for certain types of pat- - tern. - - 1. If the pattern contains tests for the beginning or end of a line, - you need to pass the PCRE_NOTBOL or PCRE_NOTEOL options, as appropri- - ate, when the subject string for any call does not contain the begin- - ning or end of a line. - - 2. If the pattern contains backward assertions (including \b or \B), - you need to arrange for some overlap in the subject strings to allow - for this. For example, you could pass the subject in chunks that were - 500 bytes long, but in a buffer of 700 bytes, with the starting offset - set to 200 and the previous 200 bytes at the start of the buffer. - - 3. Matching a subject string that is split into multiple segments does - not always produce exactly the same result as matching over one single - long string. The difference arises when there are multiple matching - possibilities, because a partial match result is given only when there - are no completed matches in a call to fBpcre_dfa_exec(). This means - that as soon as the shortest match has been found, continuation to a - new subject segment is no longer possible. Consider this pcretest - example: - - re> /dog(sbody)?/ - data> do\P\D - Partial match: do - data> gsb\R\P\D - 0: g - data> dogsbody\D - 0: dogsbody - 1: dog - - The pattern matches the words "dog" or "dogsbody". When the subject is - presented in several parts ("do" and "gsb" being the first two) the - match stops when "dog" has been found, and it is not possible to con- - tinue. On the other hand, if "dogsbody" is presented as a single - string, both matches are found. - - Because of this phenomenon, it does not usually make sense to end a - pattern that is going to be matched in this way with a variable repeat. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREPRECOMPILE(3) PCREPRECOMPILE(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -SAVING AND RE-USING PRECOMPILED PCRE PATTERNS - - If you are running an application that uses a large number of regular - expression patterns, it may be useful to store them in a precompiled - form instead of having to compile them every time the application is - run. If you are not using any private character tables (see the - pcre_maketables() documentation), this is relatively straightforward. - If you are using private tables, it is a little bit more complicated. - - If you save compiled patterns to a file, you can copy them to a differ- - ent host and run them there. This works even if the new host has the - opposite endianness to the one on which the patterns were compiled. - There may be a small performance penalty, but it should be insignifi- - cant. - - -SAVING A COMPILED PATTERN - The value returned by pcre_compile() points to a single block of memory - that holds the compiled pattern and associated data. You can find the - length of this block in bytes by calling pcre_fullinfo() with an argu- - ment of PCRE_INFO_SIZE. You can then save the data in any appropriate - manner. Here is sample code that compiles a pattern and writes it to a - file. It assumes that the variable fd refers to a file that is open for - output: - - int erroroffset, rc, size; - char *error; - pcre *re; - - re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL); - if (re == NULL) { ... handle errors ... } - rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size); - if (rc < 0) { ... handle errors ... } - rc = fwrite(re, 1, size, fd); - if (rc != size) { ... handle errors ... } - - In this example, the bytes that comprise the compiled pattern are - copied exactly. Note that this is binary data that may contain any of - the 256 possible byte values. On systems that make a distinction - between binary and non-binary data, be sure that the file is opened for - binary output. - - If you want to write more than one pattern to a file, you will have to - devise a way of separating them. For binary data, preceding each pat- - tern with its length is probably the most straightforward approach. - Another possibility is to write out the data in hexadecimal instead of - binary, one pattern to a line. - - Saving compiled patterns in a file is only one possible way of storing - them for later use. They could equally well be saved in a database, or - in the memory of some daemon process that passes them via sockets to - the processes that want them. - - If the pattern has been studied, it is also possible to save the study - data in a similar way to the compiled pattern itself. When studying - generates additional information, pcre_study() returns a pointer to a - pcre_extra data block. Its format is defined in the section on matching - a pattern in the pcreapi documentation. The study_data field points to - the binary study data, and this is what you must save (not the - pcre_extra block itself). The length of the study data can be obtained - by calling pcre_fullinfo() with an argument of PCRE_INFO_STUDYSIZE. - Remember to check that pcre_study() did return a non-NULL value before - trying to save the study data. - - -RE-USING A PRECOMPILED PATTERN - - Re-using a precompiled pattern is straightforward. Having reloaded it - into main memory, you pass its pointer to pcre_exec() or - pcre_dfa_exec() in the usual way. This should work even on another - host, and even if that host has the opposite endianness to the one - where the pattern was compiled. - - However, if you passed a pointer to custom character tables when the - pattern was compiled (the tableptr argument of pcre_compile()), you - must now pass a similar pointer to pcre_exec() or pcre_dfa_exec(), - because the value saved with the compiled pattern will obviously be - nonsense. A field in a pcre_extra() block is used to pass this data, as - described in the section on matching a pattern in the pcreapi documen- - tation. - - If you did not provide custom character tables when the pattern was - compiled, the pointer in the compiled pattern is NULL, which causes - pcre_exec() to use PCRE's internal tables. Thus, you do not need to - take any special action at run time in this case. - - If you saved study data with the compiled pattern, you need to create - your own pcre_extra data block and set the study_data field to point to - the reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA - bit in the flags field to indicate that study data is present. Then - pass the pcre_extra block to pcre_exec() or pcre_dfa_exec() in the - usual way. - - -COMPATIBILITY WITH DIFFERENT PCRE RELEASES - - The layout of the control block that is at the start of the data that - makes up a compiled pattern was changed for release 5.0. If you have - any saved patterns that were compiled with previous releases (not a - facility that was previously advertised), you will have to recompile - them for release 5.0. However, from now on, it should be possible to - make changes in a compatible manner. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREPERFORM(3) PCREPERFORM(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE PERFORMANCE - - Certain items that may appear in regular expression patterns are more - efficient than others. It is more efficient to use a character class - like [aeiou] than a set of alternatives such as (a|e|i|o|u). In gen- - eral, the simplest construction that provides the required behaviour is - usually the most efficient. Jeffrey Friedl's book contains a lot of - useful general discussion about optimizing regular expressions for - efficient performance. This document contains a few observations about - PCRE. - - Using Unicode character properties (the \p, \P, and \X escapes) is - slow, because PCRE has to scan a structure that contains data for over - fifteen thousand characters whenever it needs a character's property. - If you can find an alternative pattern that does not use character - properties, it will probably be faster. - - When a pattern begins with .* not in parentheses, or in parentheses - that are not the subject of a backreference, and the PCRE_DOTALL option - is set, the pattern is implicitly anchored by PCRE, since it can match - only at the start of a subject string. However, if PCRE_DOTALL is not - set, PCRE cannot make this optimization, because the . metacharacter - does not then match a newline, and if the subject string contains new- - lines, the pattern may match from the character immediately following - one of them instead of from the very start. For example, the pattern - - .*second - - matches the subject "first\nand second" (where \n stands for a newline - character), with the match starting at the seventh character. In order - to do this, PCRE has to retry the match starting after every newline in - the subject. - - If you are using such a pattern with subject strings that do not con- - tain newlines, the best performance is obtained by setting PCRE_DOTALL, - or starting the pattern with ^.* or ^.*? to indicate explicit anchor- - ing. That saves PCRE from having to scan along the subject looking for - a newline to restart at. - - Beware of patterns that contain nested indefinite repeats. These can - take a long time to run when applied to a string that does not match. - Consider the pattern fragment - - (a+)* - - This can match "aaaa" in 33 different ways, and this number increases - very rapidly as the string gets longer. (The * repeat can match 0, 1, - 2, 3, or 4 times, and for each of those cases other than 0, the + - repeats can match different numbers of times.) When the remainder of - the pattern is such that the entire match is going to fail, PCRE has in - principle to try every possible variation, and this can take an - extremely long time. - - An optimization catches some of the more simple cases such as - - (a+)*b - - where a literal character follows. Before embarking on the standard - matching procedure, PCRE checks that there is a "b" later in the sub- - ject string, and if there is not, it fails the match immediately. How- - ever, when there is no following literal this optimization cannot be - used. You can see the difference by comparing the behaviour of - - (a+)*\d - - with the pattern above. The former gives a failure almost instantly - when applied to a whole line of "a" characters, whereas the latter - takes an appreciable time with strings longer than about 20 characters. - - In many cases, the solution to this kind of performance issue is to use - an atomic group or a possessive quantifier. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCREPOSIX(3) PCREPOSIX(3) - - -NAME - PCRE - Perl-compatible regular expressions. - - -SYNOPSIS OF POSIX API - - #include <pcreposix.h> - - int regcomp(regex_t *preg, const char *pattern, - int cflags); - - int regexec(regex_t *preg, const char *string, - size_t nmatch, regmatch_t pmatch[], int eflags); - - size_t regerror(int errcode, const regex_t *preg, - char *errbuf, size_t errbuf_size); - - void regfree(regex_t *preg); - - -DESCRIPTION - - This set of functions provides a POSIX-style API to the PCRE regular - expression package. See the pcreapi documentation for a description of - PCRE's native API, which contains much additional functionality. - - The functions described here are just wrapper functions that ultimately - call the PCRE native API. Their prototypes are defined in the - pcreposix.h header file, and on Unix systems the library itself is - called pcreposix.a, so can be accessed by adding -lpcreposix to the - command for linking an application that uses them. Because the POSIX - functions call the native ones, it is also necessary to add -lpcre. - - I have implemented only those option bits that can be reasonably mapped - to PCRE native options. In addition, the options REG_EXTENDED and - REG_NOSUB are defined with the value zero. They have no effect, but - since programs that are written to the POSIX interface often use them, - this makes it easier to slot in PCRE as a replacement library. Other - POSIX options are not even defined. - - When PCRE is called via these functions, it is only the API that is - POSIX-like in style. The syntax and semantics of the regular expres- - sions themselves are still those of Perl, subject to the setting of - various PCRE options, as described below. "POSIX-like in style" means - that the API approximates to the POSIX definition; it is not fully - POSIX-compatible, and in multi-byte encoding domains it is probably - even less compatible. - - The header for these functions is supplied as pcreposix.h to avoid any - potential clash with other POSIX libraries. It can, of course, be - renamed or aliased as regex.h, which is the "correct" name. It provides - two structure types, regex_t for compiled internal forms, and reg- - match_t for returning captured substrings. It also defines some con- - stants whose names start with "REG_"; these are used for setting - options and identifying error codes. - - -COMPILING A PATTERN - - The function regcomp() is called to compile a pattern into an internal - form. The pattern is a C string terminated by a binary zero, and is - passed in the argument pattern. The preg argument is a pointer to a - regex_t structure that is used as a base for storing information about - the compiled expression. - - The argument cflags is either zero, or contains one or more of the bits - defined by the following macros: - - REG_DOTALL - - The PCRE_DOTALL option is set when the expression is passed for compi- - lation to the native function. Note that REG_DOTALL is not part of the - POSIX standard. - - REG_ICASE - - The PCRE_CASELESS option is set when the expression is passed for com- - pilation to the native function. - - REG_NEWLINE - - The PCRE_MULTILINE option is set when the expression is passed for com- - pilation to the native function. Note that this does not mimic the - defined POSIX behaviour for REG_NEWLINE (see the following section). - - In the absence of these flags, no options are passed to the native - function. This means the the regex is compiled with PCRE default - semantics. In particular, the way it handles newline characters in the - subject string is the Perl way, not the POSIX way. Note that setting - PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. - It does not affect the way newlines are matched by . (they aren't) or - by a negative class such as [^a] (they are). - - The yield of regcomp() is zero on success, and non-zero otherwise. The - preg structure is filled in on success, and one member of the structure - is public: re_nsub contains the number of capturing subpatterns in the - regular expression. Various error codes are defined in the header file. - - -MATCHING NEWLINE CHARACTERS - - This area is not simple, because POSIX and Perl take different views of - things. It is not possible to get PCRE to obey POSIX semantics, but - then PCRE was never intended to be a POSIX engine. The following table - lists the different possibilities for matching newline characters in - PCRE: - - Default Change with - - . matches newline no PCRE_DOTALL - newline matches [^a] yes not changeable - $ matches \n at end yes PCRE_DOLLARENDONLY - $ matches \n in middle no PCRE_MULTILINE - ^ matches \n in middle no PCRE_MULTILINE - - This is the equivalent table for POSIX: - - Default Change with - - . matches newline yes REG_NEWLINE - newline matches [^a] yes REG_NEWLINE - $ matches \n at end no REG_NEWLINE - $ matches \n in middle no REG_NEWLINE - ^ matches \n in middle no REG_NEWLINE - - PCRE's behaviour is the same as Perl's, except that there is no equiva- - lent for PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is - no way to stop newline from matching [^a]. - - The default POSIX newline handling can be obtained by setting - PCRE_DOTALL and PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE - behave exactly as for the REG_NEWLINE action. - - -MATCHING A PATTERN - - The function regexec() is called to match a compiled pattern preg - against a given string, which is terminated by a zero byte, subject to - the options in eflags. These can be: - - REG_NOTBOL - - The PCRE_NOTBOL option is set when calling the underlying PCRE matching - function. - - REG_NOTEOL - - The PCRE_NOTEOL option is set when calling the underlying PCRE matching - function. - - The portion of the string that was matched, and also any captured sub- - strings, are returned via the pmatch argument, which points to an array - of nmatch structures of type regmatch_t, containing the members rm_so - and rm_eo. These contain the offset to the first character of each sub- - string and the offset to the first character after the end of each sub- - string, respectively. The 0th element of the vector relates to the - entire portion of string that was matched; subsequent elements relate - to the capturing subpatterns of the regular expression. Unused entries - in the array have both structure members set to -1. - - A successful match yields a zero return; various error codes are - defined in the header file, of which REG_NOMATCH is the "expected" - failure code. - - -ERROR MESSAGES - - The regerror() function maps a non-zero errorcode from either regcomp() - or regexec() to a printable message. If preg is not NULL, the error - should have arisen from the use of that structure. A message terminated - by a binary zero is placed in errbuf. The length of the message, - including the zero, is limited to errbuf_size. The yield of the func- - tion is the size of buffer needed to hold the whole message. - - -MEMORY USAGE - - Compiling a regular expression causes memory to be allocated and asso- - ciated with the preg structure. The function regfree() frees all such - memory, after which preg may no longer be used as a compiled expres- - sion. - - -AUTHOR - - Philip Hazel - University Computing Service, - Cambridge CB2 3QG, England. - -Last updated: 28 February 2005 -Copyright (c) 1997-2005 University of Cambridge. ------------------------------------------------------------------------------- - - -PCRECPP(3) PCRECPP(3) - - -NAME - PCRE - Perl-compatible regular expressions. - - -SYNOPSIS OF C++ WRAPPER - - #include <pcrecpp.h> - - -DESCRIPTION - - The C++ wrapper for PCRE was provided by Google Inc. Some additional - functionality was added by Giuseppe Maxia. This brief man page was con- - structed from the notes in the pcrecpp.h file, which should be con- - sulted for further details. - - -MATCHING INTERFACE - - The "FullMatch" operation checks that supplied text matches a supplied - pattern exactly. If pointer arguments are supplied, it copies matched - sub-strings that match sub-patterns into them. - - Example: successful match - pcrecpp::RE re("h.*o"); - re.FullMatch("hello"); - - Example: unsuccessful match (requires full match): - pcrecpp::RE re("e"); - !re.FullMatch("hello"); - - Example: creating a temporary RE object: - pcrecpp::RE("h.*o").FullMatch("hello"); - - You can pass in a "const char*" or a "string" for "text". The examples - below tend to use a const char*. You can, as in the different examples - above, store the RE object explicitly in a variable or use a temporary - RE object. The examples below use one mode or the other arbitrarily. - Either could correctly be used for any of these examples. - - You must supply extra pointer arguments to extract matched subpieces. - - Example: extracts "ruby" into "s" and 1234 into "i" - int i; - string s; - pcrecpp::RE re("(\\w+):(\\d+)"); - re.FullMatch("ruby:1234", &s, &i); - - Example: does not try to extract any extra sub-patterns - re.FullMatch("ruby:1234", &s); - - Example: does not try to extract into NULL - re.FullMatch("ruby:1234", NULL, &i); - - Example: integer overflow causes failure - !re.FullMatch("ruby:1234567891234", NULL, &i); - - Example: fails because there aren't enough sub-patterns: - !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); - - Example: fails because string cannot be stored in integer - !pcrecpp::RE("(.*)").FullMatch("ruby", &i); - - The provided pointer arguments can be pointers to any scalar numeric - type, or one of: - - string (matched piece is copied to string) - StringPiece (StringPiece is mutated to point to matched piece) - T (where "bool T::ParseFrom(const char*, int)" exists) - NULL (the corresponding matched sub-pattern is not copied) - - The function returns true iff all of the following conditions are sat- - isfied: - - a. "text" matches "pattern" exactly; - - b. The number of matched sub-patterns is >= number of supplied - pointers; - - c. The "i"th argument has a suitable type for holding the - string captured as the "i"th sub-pattern. If you pass in - NULL for the "i"th argument, or pass fewer arguments than - number of sub-patterns, "i"th captured sub-pattern is - ignored. - - The matching interface supports at most 16 arguments per call. If you - need more, consider using the more general interface - pcrecpp::RE::DoMatch. See pcrecpp.h for the signature for DoMatch. - - -PARTIAL MATCHES - - You can use the "PartialMatch" operation when you want the pattern to - match any substring of the text. - - Example: simple search for a string: - pcrecpp::RE("ell").PartialMatch("hello"); - - Example: find first number in a string: - int number; - pcrecpp::RE re("(\\d+)"); - re.PartialMatch("x*100 + 20", &number); - assert(number == 100); - - -UTF-8 AND THE MATCHING INTERFACE - - By default, pattern and text are plain text, one byte per character. - The UTF8 flag, passed to the constructor, causes both pattern and - string to be treated as UTF-8 text, still a byte stream but potentially - multiple bytes per character. In practice, the text is likelier to be - UTF-8 than the pattern, but the match returned may depend on the UTF8 - flag, so always use it when matching UTF8 text. For example, "." will - match one byte normally but with UTF8 set may match up to three bytes - of a multi-byte character. - - Example: - pcrecpp::RE_Options options; - options.set_utf8(); - pcrecpp::RE re(utf8_pattern, options); - re.FullMatch(utf8_string); - - Example: using the convenience function UTF8(): - pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); - re.FullMatch(utf8_string); - - NOTE: The UTF8 flag is ignored if pcre was not configured with the - --enable-utf8 flag. - - -PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE - - PCRE defines some modifiers to change the behavior of the regular - expression engine. The C++ wrapper defines an auxiliary class, - RE_Options, as a vehicle to pass such modifiers to a RE class. Cur- - rently, the following modifiers are supported: - - modifier description Perl corresponding - - PCRE_CASELESS case insensitive match /i - PCRE_MULTILINE multiple lines match /m - PCRE_DOTALL dot matches newlines /s - PCRE_DOLLAR_ENDONLY $ matches only at end N/A - PCRE_EXTRA strict escape parsing N/A - PCRE_EXTENDED ignore whitespaces /x - PCRE_UTF8 handles UTF8 chars built-in - PCRE_UNGREEDY reverses * and *? N/A - PCRE_NO_AUTO_CAPTURE disables capturing parens N/A (*) - - (*) Both Perl and PCRE allow non capturing parentheses by means of the - "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not cap- - ture, while (ab|cd) does. - - For a full account on how each modifier works, please check the PCRE - API reference page. - - For each modifier, there are two member functions whose name is made - out of the modifier in lowercase, without the "PCRE_" prefix. For - instance, PCRE_CASELESS is handled by - - bool caseless() - - which returns true if the modifier is set, and - - RE_Options & set_caseless(bool) - - which sets or unsets the modifier. Moreover, PCRE_CONFIG_MATCH_LIMIT - can be accessed through the set_match_limit() and match_limit() member - functions. Setting match_limit to a non-zero value will limit the exe- - cution of pcre to keep it from doing bad things like blowing the stack - or taking an eternity to return a result. A value of 5000 is good - enough to stop stack blowup in a 2MB thread stack. Setting match_limit - to zero disables match limiting. - - Normally, to pass one or more modifiers to a RE class, you declare a - RE_Options object, set the appropriate options, and pass this object to - a RE constructor. Example: - - RE_options opt; - opt.set_caseless(true); - if (RE("HELLO", opt).PartialMatch("hello world")) ... - - RE_options has two constructors. The default constructor takes no argu- - ments and creates a set of flags that are off by default. The optional - parameter option_flags is to facilitate transfer of legacy code from C - programs. This lets you do - - RE(pattern, - RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); - - However, new code is better off doing - - RE(pattern, - RE_Options().set_caseless(true).set_multiline(true)) - .PartialMatch(str); - - If you are going to pass one of the most used modifiers, there are some - convenience functions that return a RE_Options class with the appropri- - ate modifier already set: CASELESS(), UTF8(), MULTILINE(), DOTALL(), - and EXTENDED(). - - If you need to set several options at once, and you don't want to go - through the pains of declaring a RE_Options object and setting several - options, there is a parallel method that give you such ability on the - fly. You can concatenate several set_xxxxx() member functions, since - each of them returns a reference to its class object. For example, to - pass PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one - statement, you may write: - - RE(" ^ xyz \\s+ .* blah$", - RE_Options() - .set_caseless(true) - .set_extended(true) - .set_multiline(true)).PartialMatch(sometext); - - -SCANNING TEXT INCREMENTALLY - - The "Consume" operation may be useful if you want to repeatedly match - regular expressions at the front of a string and skip over them as they - match. This requires use of the "StringPiece" type, which represents a - sub-range of a real string. Like RE, StringPiece is defined in the - pcrecpp namespace. - - Example: read lines of the form "var = value" from a string. - string contents = ...; // Fill string somehow - pcrecpp::StringPiece input(contents); // Wrap in a StringPiece - - string var; - int value; - pcrecpp::RE re("(\\w+) = (\\d+)\n"); - while (re.Consume(&input, &var, &value)) { - ...; - } - - Each successful call to "Consume" will set "var/value", and also - advance "input" so it points past the matched text. - - The "FindAndConsume" operation is similar to "Consume" but does not - anchor your match at the beginning of the string. For example, you - could extract all words from a string by repeatedly calling - - pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) - - -PARSING HEX/OCTAL/C-RADIX NUMBERS - - By default, if you pass a pointer to a numeric value, the corresponding - text is interpreted as a base-10 number. You can instead wrap the - pointer with a call to one of the operators Hex(), Octal(), or CRadix() - to interpret the text in another base. The CRadix operator interprets - C-style "0" (base-8) and "0x" (base-16) prefixes, but defaults to - base-10. - - Example: - int a, b, c, d; - pcrecpp::RE re("(.*) (.*) (.*) (.*)"); - re.FullMatch("100 40 0100 0x40", - pcrecpp::Octal(&a), pcrecpp::Hex(&b), - pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); - - will leave 64 in a, b, c, and d. - - -REPLACING PARTS OF STRINGS - - You can replace the first match of "pattern" in "str" with "rewrite". - Within "rewrite", backslash-escaped digits (\1 to \9) can be used to - insert text matching corresponding parenthesized group from the pat- - tern. \0 in "rewrite" refers to the entire matching text. For example: - - string s = "yabba dabba doo"; - pcrecpp::RE("b+").Replace("d", &s); - - will leave "s" containing "yada dabba doo". The result is true if the - pattern matches and a replacement occurs, false otherwise. - - GlobalReplace is like Replace except that it replaces all occurrences - of the pattern in the string with the rewrite. Replacements are not - subject to re-matching. For example: - - string s = "yabba dabba doo"; - pcrecpp::RE("b+").GlobalReplace("d", &s); - - will leave "s" containing "yada dada doo". It returns the number of - replacements made. - - Extract is like Replace, except that if the pattern matches, "rewrite" - is copied into "out" (an additional argument) with substitutions. The - non-matching portions of "text" are ignored. Returns true iff a match - occurred and the extraction happened successfully; if no match occurs, - the string is left unaffected. - - -AUTHOR - - The C++ wrapper was contributed by Google Inc. - Copyright (c) 2005 Google Inc. ------------------------------------------------------------------------------- - - -PCRESAMPLE(3) PCRESAMPLE(3) - - -NAME - PCRE - Perl-compatible regular expressions - - -PCRE SAMPLE PROGRAM - - A simple, complete demonstration program, to get you started with using - PCRE, is supplied in the file pcredemo.c in the PCRE distribution. - - The program compiles the regular expression that is its first argument, - and matches it against the subject string in its second argument. No - PCRE options are set, and default character tables are used. If match- - ing succeeds, the program outputs the portion of the subject that - matched, together with the contents of any captured substrings. - - If the -g option is given on the command line, the program then goes on - to check for further matches of the same regular expression in the same - subject string. The logic is a little bit tricky because of the possi- - bility of matching an empty string. Comments in the code explain what - is going on. - - If PCRE is installed in the standard include and library directories - for your system, you should be able to compile the demonstration pro- - gram using this command: - - gcc -o pcredemo pcredemo.c -lpcre - - If PCRE is installed elsewhere, you may need to add additional options - to the command line. For example, on a Unix-like system that has PCRE - installed in /usr/local, you can compile the demonstration program - using a command like this: - - gcc -o pcredemo -I/usr/local/include pcredemo.c \ - -L/usr/local/lib -lpcre - - Once you have compiled the demonstration program, you can run simple - tests like this: - - ./pcredemo 'cat|dog' 'the cat sat on the mat' - ./pcredemo -g 'cat|dog' 'the dog sat on the cat' - - Note that there is a much more comprehensive test program, called - pcretest, which supports many more facilities for testing regular - expressions and the PCRE library. The pcredemo program is provided as a - simple coding example. - - On some operating systems (e.g. Solaris), when PCRE is not installed in - the standard library directory, you may get an error like this when you - try to run pcredemo: - - ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or - directory - - This is caused by the way shared library support works on those sys- - tems. You need to add - - -R/usr/local/lib - - (for example) to the compile command to get round this problem. - -Last updated: 09 September 2004 -Copyright (c) 1997-2004 University of Cambridge. ------------------------------------------------------------------------------- diff --git a/ext/pcre/pcrelib/libpcre.def b/ext/pcre/pcrelib/libpcre.def deleted file mode 100644 index 01db4bd22c442..0000000000000 --- a/ext/pcre/pcrelib/libpcre.def +++ /dev/null @@ -1,20 +0,0 @@ -LIBRARY libpcre -EXPORTS -pcre_malloc -pcre_free -pcre_config -pcre_callout -pcre_compile -pcre_copy_substring -pcre_dfa_exec -pcre_exec -pcre_get_substring -pcre_get_stringnumber -pcre_get_substring_list -pcre_free_substring -pcre_free_substring_list -pcre_info -pcre_fullinfo -pcre_maketables -pcre_study -pcre_version diff --git a/ext/pcre/pcrelib/libpcreposix.def b/ext/pcre/pcrelib/libpcreposix.def deleted file mode 100644 index 5f30247969463..0000000000000 --- a/ext/pcre/pcrelib/libpcreposix.def +++ /dev/null @@ -1,25 +0,0 @@ -LIBRARY libpcreposix -EXPORTS -pcre_malloc -pcre_free -pcre_config -pcre_callout -pcre_compile -pcre_copy_substring -pcre_dfa_exec -pcre_exec -pcre_get_substring -pcre_get_stringnumber -pcre_get_substring_list -pcre_free_substring -pcre_free_substring_list -pcre_info -pcre_fullinfo -pcre_maketables -pcre_study -pcre_version - -regcomp -regexec -regerror -regfree diff --git a/ext/pcre/pcrelib/pcre.def b/ext/pcre/pcrelib/pcre.def deleted file mode 100644 index adb53160d304d..0000000000000 --- a/ext/pcre/pcrelib/pcre.def +++ /dev/null @@ -1,23 +0,0 @@ -EXPORTS - -pcre_malloc DATA -pcre_free DATA - -pcre_compile -pcre_copy_substring -pcre_dfa_exec -pcre_exec -pcre_get_substring -pcre_get_substring_list -pcre_free_substring -pcre_free_substring_list -pcre_info -pcre_fullinfo -pcre_maketables -pcre_study -pcre_version - -regcomp -regexec -regerror -regfree diff --git a/ext/pcre/pcrelib/pcre.h b/ext/pcre/pcrelib/pcre.h deleted file mode 100644 index ff3577402418c..0000000000000 --- a/ext/pcre/pcrelib/pcre.h +++ /dev/null @@ -1,260 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* In its original form, this is the .in file that is transformed by -"configure" into pcre.h. - - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - -#ifndef _PCRE_H -#define _PCRE_H - -/* The file pcre.h is build by "configure". Do not edit it; instead -make changes to pcre.in. */ - -#include "php_compat.h" - -#define PCRE_MAJOR 6 -#define PCRE_MINOR 2 -#define PCRE_DATE 01-Aug-2005 - -/* Win32 uses DLL by default; it needs special stuff for exported functions. */ - -#ifdef _WIN32 -# ifdef PCRE_DEFINITION -# ifdef DLL_EXPORT -# define PCRE_DATA_SCOPE __declspec(dllexport) -# endif -# else -# ifndef PCRE_STATIC -# define PCRE_DATA_SCOPE extern __declspec(dllimport) -# endif -# endif -#endif - -/* For other operating systems, we use the standard "extern". */ - -#ifndef PCRE_DATA_SCOPE -# ifdef __cplusplus -# define PCRE_DATA_SCOPE extern "C" -# else -# define PCRE_DATA_SCOPE extern -# endif -#endif - -/* Have to include stdlib.h in order to ensure that size_t is defined; -it is needed here for malloc. */ - -#include <stdlib.h> - -/* Allow for C++ users */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Options */ - -#define PCRE_CASELESS 0x00000001 -#define PCRE_MULTILINE 0x00000002 -#define PCRE_DOTALL 0x00000004 -#define PCRE_EXTENDED 0x00000008 -#define PCRE_ANCHORED 0x00000010 -#define PCRE_DOLLAR_ENDONLY 0x00000020 -#define PCRE_EXTRA 0x00000040 -#define PCRE_NOTBOL 0x00000080 -#define PCRE_NOTEOL 0x00000100 -#define PCRE_UNGREEDY 0x00000200 -#define PCRE_NOTEMPTY 0x00000400 -#define PCRE_UTF8 0x00000800 -#define PCRE_NO_AUTO_CAPTURE 0x00001000 -#define PCRE_NO_UTF8_CHECK 0x00002000 -#define PCRE_AUTO_CALLOUT 0x00004000 -#define PCRE_PARTIAL 0x00008000 -#define PCRE_DFA_SHORTEST 0x00010000 -#define PCRE_DFA_RESTART 0x00020000 -#define PCRE_FIRSTLINE 0x00040000 - -/* Exec-time and get/set-time error codes */ - -#define PCRE_ERROR_NOMATCH (-1) -#define PCRE_ERROR_NULL (-2) -#define PCRE_ERROR_BADOPTION (-3) -#define PCRE_ERROR_BADMAGIC (-4) -#define PCRE_ERROR_UNKNOWN_NODE (-5) -#define PCRE_ERROR_NOMEMORY (-6) -#define PCRE_ERROR_NOSUBSTRING (-7) -#define PCRE_ERROR_MATCHLIMIT (-8) -#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ -#define PCRE_ERROR_BADUTF8 (-10) -#define PCRE_ERROR_BADUTF8_OFFSET (-11) -#define PCRE_ERROR_PARTIAL (-12) -#define PCRE_ERROR_BADPARTIAL (-13) -#define PCRE_ERROR_INTERNAL (-14) -#define PCRE_ERROR_BADCOUNT (-15) -#define PCRE_ERROR_DFA_UITEM (-16) -#define PCRE_ERROR_DFA_UCOND (-17) -#define PCRE_ERROR_DFA_UMLIMIT (-18) -#define PCRE_ERROR_DFA_WSSIZE (-19) -#define PCRE_ERROR_DFA_RECURSE (-20) - -/* Request types for pcre_fullinfo() */ - -#define PCRE_INFO_OPTIONS 0 -#define PCRE_INFO_SIZE 1 -#define PCRE_INFO_CAPTURECOUNT 2 -#define PCRE_INFO_BACKREFMAX 3 -#define PCRE_INFO_FIRSTBYTE 4 -#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */ -#define PCRE_INFO_FIRSTTABLE 5 -#define PCRE_INFO_LASTLITERAL 6 -#define PCRE_INFO_NAMEENTRYSIZE 7 -#define PCRE_INFO_NAMECOUNT 8 -#define PCRE_INFO_NAMETABLE 9 -#define PCRE_INFO_STUDYSIZE 10 -#define PCRE_INFO_DEFAULT_TABLES 11 - -/* Request types for pcre_config() */ - -#define PCRE_CONFIG_UTF8 0 -#define PCRE_CONFIG_NEWLINE 1 -#define PCRE_CONFIG_LINK_SIZE 2 -#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 -#define PCRE_CONFIG_MATCH_LIMIT 4 -#define PCRE_CONFIG_STACKRECURSE 5 -#define PCRE_CONFIG_UNICODE_PROPERTIES 6 - -/* Bit flags for the pcre_extra structure */ - -#define PCRE_EXTRA_STUDY_DATA 0x0001 -#define PCRE_EXTRA_MATCH_LIMIT 0x0002 -#define PCRE_EXTRA_CALLOUT_DATA 0x0004 -#define PCRE_EXTRA_TABLES 0x0008 - -/* Types */ - -struct real_pcre; /* declaration; the definition is private */ -typedef struct real_pcre pcre; - -/* The structure for passing additional data to pcre_exec(). This is defined in -such as way as to be extensible. Always add new fields at the end, in order to -remain compatible. */ - -typedef struct pcre_extra { - unsigned long int flags; /* Bits for which fields are set */ - void *study_data; /* Opaque data from pcre_study() */ - unsigned long int match_limit; /* Maximum number of calls to match() */ - void *callout_data; /* Data passed back in callouts */ - const unsigned char *tables; /* Pointer to character tables */ -} pcre_extra; - -/* The structure for passing out data via the pcre_callout_function. We use a -structure so that new fields can be added on the end in future versions, -without changing the API of the function, thereby allowing old clients to work -without modification. */ - -typedef struct pcre_callout_block { - int version; /* Identifies version of block */ - /* ------------------------ Version 0 ------------------------------- */ - int callout_number; /* Number compiled into pattern */ - int *offset_vector; /* The offset vector */ - const char *subject; /* The subject being matched */ - int subject_length; /* The length of the subject */ - int start_match; /* Offset to start of this match attempt */ - int current_position; /* Where we currently are in the subject */ - int capture_top; /* Max current capture */ - int capture_last; /* Most recently closed capture */ - void *callout_data; /* Data passed in with the call */ - /* ------------------- Added for Version 1 -------------------------- */ - int pattern_position; /* Offset to next item in the pattern */ - int next_item_length; /* Length of next item in the pattern */ - /* ------------------------------------------------------------------ */ -} pcre_callout_block; - -/* Indirection for store get and free functions. These can be set to -alternative malloc/free functions if required. Special ones are used in the -non-recursive case for "frames". There is also an optional callout function -that is triggered by the (?) regex item. For Virtual Pascal, these definitions -have to take another form. */ - -#ifndef VPCOMPAT -PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t); -PCRE_DATA_SCOPE void (*pcre_free)(void *); -PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t); -PCRE_DATA_SCOPE void (*pcre_stack_free)(void *); -PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *); -#else /* VPCOMPAT */ -PCRE_DATA_SCOPE void *pcre_malloc(size_t); -PCRE_DATA_SCOPE void pcre_free(void *); -PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t); -PCRE_DATA_SCOPE void pcre_stack_free(void *); -PCRE_DATA_SCOPE int pcre_callout(pcre_callout_block *); -#endif /* VPCOMPAT */ - -/* Exported PCRE functions */ - -PCRE_DATA_SCOPE pcre *pcre_compile(const char *, int, const char **, int *, - const unsigned char *); -PCRE_DATA_SCOPE pcre *pcre_compile2(const char *, int, int *, const char **, - int *, const unsigned char *); -PCRE_DATA_SCOPE int pcre_config(int, void *); -PCRE_DATA_SCOPE int pcre_copy_named_substring(const pcre *, const char *, - int *, int, const char *, char *, int); -PCRE_DATA_SCOPE int pcre_copy_substring(const char *, int *, int, int, char *, - int); -PCRE_DATA_SCOPE int pcre_dfa_exec(const pcre *, const pcre_extra *, - const char *, int, int, int, int *, int , int *, int); -PCRE_DATA_SCOPE int pcre_exec(const pcre *, const pcre_extra *, const char *, - int, int, int, int *, int); -PCRE_DATA_SCOPE void pcre_free_substring(const char *); -PCRE_DATA_SCOPE void pcre_free_substring_list(const char **); -PCRE_DATA_SCOPE int pcre_fullinfo(const pcre *, const pcre_extra *, int, - void *); -PCRE_DATA_SCOPE int pcre_get_named_substring(const pcre *, const char *, - int *, int, const char *, const char **); -PCRE_DATA_SCOPE int pcre_get_stringnumber(const pcre *, const char *); -PCRE_DATA_SCOPE int pcre_get_substring(const char *, int *, int, int, - const char **); -PCRE_DATA_SCOPE int pcre_get_substring_list(const char *, int *, int, - const char ***); -PCRE_DATA_SCOPE int pcre_info(const pcre *, int *, int *); -PCRE_DATA_SCOPE const unsigned char *pcre_maketables(void); -PCRE_DATA_SCOPE int pcre_refcount(pcre *, int); -PCRE_DATA_SCOPE pcre_extra *pcre_study(const pcre *, int, const char **); -PCRE_DATA_SCOPE const char *pcre_version(void); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* End of pcre.h */ diff --git a/ext/pcre/pcrelib/pcre_chartables.c b/ext/pcre/pcrelib/pcre_chartables.c deleted file mode 100644 index d491433e25472..0000000000000 --- a/ext/pcre/pcrelib/pcre_chartables.c +++ /dev/null @@ -1,183 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* This file is automatically written by the dftables auxiliary -program. If you edit it by hand, you might like to edit the Makefile to -prevent its ever being regenerated. - -This file contains the default tables for characters with codes less than -128 (ASCII characters). These tables are used when no external tables are -passed to PCRE. */ - -const unsigned char _pcre_default_tables[] = { - -/* This table is a lower casing table. */ - - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103, - 104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119, - 120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103, - 104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119, - 120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135, - 136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151, - 152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167, - 168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183, - 184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199, - 200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215, - 216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231, - 232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247, - 248,249,250,251,252,253,254,255, - -/* This table is a case flipping table. */ - - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103, - 104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119, - 120,121,122, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135, - 136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151, - 152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167, - 168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183, - 184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199, - 200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215, - 216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231, - 232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247, - 248,249,250,251,252,253,254,255, - -/* This table contains bit maps for various character classes. -Each map is 32 bytes long and the bits run from the least -significant end of each byte. The classes that have their own -maps are: space, xdigit, digit, upper, lower, word, graph -print, punct, and cntrl. Other classes are built from combinations. */ - - 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, - 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, - 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc, - 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - - 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - -/* This table identifies various classes of character by individual bits: - 0x01 white space character - 0x02 letter - 0x04 decimal digit - 0x08 hexadecimal digit - 0x10 alphanumeric or '_' - 0x80 regular expression metacharacter or binary zero -*/ - - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ - 0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ - 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */ - 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */ - 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ - 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */ - 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ - 0x12,0x12,0x12,0x80,0x00,0x00,0x80,0x10, /* X - _ */ - 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ - 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ - -/* End of chartables.c */ diff --git a/ext/pcre/pcrelib/pcre_compile.c b/ext/pcre/pcrelib/pcre_compile.c deleted file mode 100644 index 228995252551f..0000000000000 --- a/ext/pcre/pcrelib/pcre_compile.c +++ /dev/null @@ -1,5059 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_compile(), along with -supporting internal functions that are not used by other modules. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Code parameters and static tables * -*************************************************/ - -/* Maximum number of items on the nested bracket stacks at compile time. This -applies to the nesting of all kinds of parentheses. It does not limit -un-nested, non-capturing parentheses. This number can be made bigger if -necessary - it is used to dimension one int and one unsigned char vector at -compile time. */ - -#define BRASTACK_SIZE 200 - - -/* Table for handling escaped characters in the range '0'-'z'. Positive returns -are simple data values; negative values are for special things like \d and so -on. Zero means further processing is needed (for things like \x), or the escape -is invalid. */ - -#if !EBCDIC /* This is the "normal" table for ASCII systems */ -static const short int escapes[] = { - 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */ - 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */ - '@', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E, 0, -ESC_G, /* @ - G */ - 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ --ESC_P, -ESC_Q, 0, -ESC_S, 0, 0, 0, -ESC_W, /* P - W */ --ESC_X, 0, -ESC_Z, '[', '\\', ']', '^', '_', /* X - _ */ - '`', 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, /* ` - g */ - 0, 0, 0, 0, 0, 0, ESC_n, 0, /* h - o */ --ESC_p, 0, ESC_r, -ESC_s, ESC_tee, 0, 0, -ESC_w, /* p - w */ - 0, 0, -ESC_z /* x - z */ -}; - -#else /* This is the "abnormal" table for EBCDIC systems */ -static const short int escapes[] = { -/* 48 */ 0, 0, 0, '.', '<', '(', '+', '|', -/* 50 */ '&', 0, 0, 0, 0, 0, 0, 0, -/* 58 */ 0, 0, '!', '$', '*', ')', ';', '~', -/* 60 */ '-', '/', 0, 0, 0, 0, 0, 0, -/* 68 */ 0, 0, '|', ',', '%', '_', '>', '?', -/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* 78 */ 0, '`', ':', '#', '@', '\'', '=', '"', -/* 80 */ 0, 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, -/* 88 */ 0, 0, 0, '{', 0, 0, 0, 0, -/* 90 */ 0, 0, 0, 'l', 0, ESC_n, 0, -ESC_p, -/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0, -/* A0 */ 0, '~', -ESC_s, ESC_tee, 0, 0, -ESC_w, 0, -/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0, -/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-', -/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G, -/* C8 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* D0 */ '}', 0, 0, 0, 0, 0, 0, -ESC_P, -/* D8 */-ESC_Q, 0, 0, 0, 0, 0, 0, 0, -/* E0 */ '\\', 0, -ESC_S, 0, 0, 0, -ESC_W, -ESC_X, -/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0, -/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* F8 */ 0, 0, 0, 0, 0, 0, 0, 0 -}; -#endif - - -/* Tables of names of POSIX character classes and their lengths. The list is -terminated by a zero length entry. The first three must be alpha, upper, lower, -as this is assumed for handling case independence. */ - -static const char *const posix_names[] = { - "alpha", "lower", "upper", - "alnum", "ascii", "blank", "cntrl", "digit", "graph", - "print", "punct", "space", "word", "xdigit" }; - -static const uschar posix_name_lengths[] = { - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 }; - -/* Table of class bit maps for each POSIX class; up to three may be combined -to form the class. The table for [:blank:] is dynamically modified to remove -the vertical space characters. */ - -static const int posix_class_maps[] = { - cbit_lower, cbit_upper, -1, /* alpha */ - cbit_lower, -1, -1, /* lower */ - cbit_upper, -1, -1, /* upper */ - cbit_digit, cbit_lower, cbit_upper, /* alnum */ - cbit_print, cbit_cntrl, -1, /* ascii */ - cbit_space, -1, -1, /* blank - a GNU extension */ - cbit_cntrl, -1, -1, /* cntrl */ - cbit_digit, -1, -1, /* digit */ - cbit_graph, -1, -1, /* graph */ - cbit_print, -1, -1, /* print */ - cbit_punct, -1, -1, /* punct */ - cbit_space, -1, -1, /* space */ - cbit_word, -1, -1, /* word - a Perl extension */ - cbit_xdigit,-1, -1 /* xdigit */ -}; - - -/* The texts of compile-time error messages. These are "char *" because they -are passed to the outside world. */ - -static const char *error_texts[] = { - "no error", - "\\ at end of pattern", - "\\c at end of pattern", - "unrecognized character follows \\", - "numbers out of order in {} quantifier", - /* 5 */ - "number too big in {} quantifier", - "missing terminating ] for character class", - "invalid escape sequence in character class", - "range out of order in character class", - "nothing to repeat", - /* 10 */ - "operand of unlimited repeat could match the empty string", - "internal error: unexpected repeat", - "unrecognized character after (?", - "POSIX named classes are supported only within a class", - "missing )", - /* 15 */ - "reference to non-existent subpattern", - "erroffset passed as NULL", - "unknown option bit(s) set", - "missing ) after comment", - "parentheses nested too deeply", - /* 20 */ - "regular expression too large", - "failed to get memory", - "unmatched parentheses", - "internal error: code overflow", - "unrecognized character after (?<", - /* 25 */ - "lookbehind assertion is not fixed length", - "malformed number after (?(", - "conditional group contains more than two branches", - "assertion expected after (?(", - "(?R or (?digits must be followed by )", - /* 30 */ - "unknown POSIX class name", - "POSIX collating elements are not supported", - "this version of PCRE is not compiled with PCRE_UTF8 support", - "spare error", - "character value in \\x{...} sequence is too large", - /* 35 */ - "invalid condition (?(0)", - "\\C not allowed in lookbehind assertion", - "PCRE does not support \\L, \\l, \\N, \\U, or \\u", - "number after (?C is > 255", - "closing ) for (?C expected", - /* 40 */ - "recursive call could loop indefinitely", - "unrecognized character after (?P", - "syntax error after (?P", - "two named groups have the same name", - "invalid UTF-8 string", - /* 45 */ - "support for \\P, \\p, and \\X has not been compiled", - "malformed \\P or \\p sequence", - "unknown property name after \\P or \\p" -}; - - -/* Table to identify digits and hex digits. This is used when compiling -patterns. Note that the tables in chartables are dependent on the locale, and -may mark arbitrary characters as digits - but the PCRE compiling code expects -to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have -a private table here. It costs 256 bytes, but it is a lot faster than doing -character value tests (at least in some simple cases I timed), and in some -applications one wants PCRE to compile efficiently as well as match -efficiently. - -For convenience, we use the same bit definitions as in chartables: - - 0x04 decimal digit - 0x08 hexadecimal digit - -Then we can use ctype_digit and ctype_xdigit in the code. */ - -#if !EBCDIC /* This is the "normal" case, for ASCII systems */ -static const unsigned char digitab[] = - { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */ - 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 */ - 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */ - 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* @ - G */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H - O */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* P - W */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* X - _ */ - 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* ` - g */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h - o */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* p - w */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* x -127 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ - -#else /* This is the "abnormal" case, for EBCDIC systems */ -static const unsigned char digitab[] = - { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 10 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32- 39 20 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 30 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- Ĵ */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */ - 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g 80 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p 90 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x A0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 B0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ - 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* { - G C0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* } - P D0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* \ - X E0 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */ - 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */ - 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */ - -static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */ - 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */ - 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ - 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ - 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 32- 39 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */ - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */ - 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */ - 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- Ĵ */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */ - 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */ - 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */ - 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */ - 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */ - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 */ - 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ - 0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* { - G */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */ - 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* } - P */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */ - 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* \ - X */ - 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */ - 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ - 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */ -#endif - - -/* Definition to allow mutual recursion */ - -static BOOL - compile_regex(int, int, int *, uschar **, const uschar **, int *, BOOL, int, - int *, int *, branch_chain *, compile_data *); - - - -/************************************************* -* Handle escapes * -*************************************************/ - -/* This function is called when a \ has been encountered. It either returns a -positive value for a simple escape such as \n, or a negative value which -encodes one of the more complicated things such as \d. When UTF-8 is enabled, -a positive value greater than 255 may be returned. On entry, ptr is pointing at -the \. On exit, it is on the final character of the escape sequence. - -Arguments: - ptrptr points to the pattern position pointer - errorcodeptr points to the errorcode variable - bracount number of previous extracting brackets - options the options bits - isclass TRUE if inside a character class - -Returns: zero or positive => a data character - negative => a special escape sequence - on error, errorptr is set -*/ - -static int -check_escape(const uschar **ptrptr, int *errorcodeptr, int bracount, - int options, BOOL isclass) -{ -const uschar *ptr = *ptrptr; -int c, i; - -/* If backslash is at the end of the pattern, it's an error. */ - -c = *(++ptr); -if (c == 0) *errorcodeptr = ERR1; - -/* Non-alphamerics are literals. For digits or letters, do an initial lookup in -a table. A non-zero result is something that can be returned immediately. -Otherwise further processing may be required. */ - -#if !EBCDIC /* ASCII coding */ -else if (c < '0' || c > 'z') {} /* Not alphameric */ -else if ((i = escapes[c - '0']) != 0) c = i; - -#else /* EBCDIC coding */ -else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphameric */ -else if ((i = escapes[c - 0x48]) != 0) c = i; -#endif - -/* Escapes that need further processing, or are illegal. */ - -else - { - const uschar *oldptr; - switch (c) - { - /* A number of Perl escapes are not handled by PCRE. We give an explicit - error. */ - - case 'l': - case 'L': - case 'N': - case 'u': - case 'U': - *errorcodeptr = ERR37; - break; - - /* The handling of escape sequences consisting of a string of digits - starting with one that is not zero is not straightforward. By experiment, - the way Perl works seems to be as follows: - - Outside a character class, the digits are read as a decimal number. If the - number is less than 10, or if there are that many previous extracting - left brackets, then it is a back reference. Otherwise, up to three octal - digits are read to form an escaped byte. Thus \123 is likely to be octal - 123 (cf \0123, which is octal 012 followed by the literal 3). If the octal - value is greater than 377, the least significant 8 bits are taken. Inside a - character class, \ followed by a digit is always an octal number. */ - - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - - if (!isclass) - { - oldptr = ptr; - c -= '0'; - while ((digitab[ptr[1]] & ctype_digit) != 0) - c = c * 10 + *(++ptr) - '0'; - if (c < 10 || c <= bracount) - { - c = -(ESC_REF + c); - break; - } - ptr = oldptr; /* Put the pointer back and fall through */ - } - - /* Handle an octal number following \. If the first digit is 8 or 9, Perl - generates a binary zero byte and treats the digit as a following literal. - Thus we have to pull back the pointer by one. */ - - if ((c = *ptr) >= '8') - { - ptr--; - c = 0; - break; - } - - /* \0 always starts an octal number, but we may drop through to here with a - larger first octal digit. */ - - case '0': - c -= '0'; - while(i++ < 2 && ptr[1] >= '0' && ptr[1] <= '7') - c = c * 8 + *(++ptr) - '0'; - c &= 255; /* Take least significant 8 bits */ - break; - - /* \x is complicated when UTF-8 is enabled. \x{ddd} is a character number - which can be greater than 0xff, but only if the ddd are hex digits. */ - - case 'x': -#ifdef SUPPORT_UTF8 - if (ptr[1] == '{' && (options & PCRE_UTF8) != 0) - { - const uschar *pt = ptr + 2; - register int count = 0; - c = 0; - while ((digitab[*pt] & ctype_xdigit) != 0) - { - int cc = *pt++; - count++; -#if !EBCDIC /* ASCII coding */ - if (cc >= 'a') cc -= 32; /* Convert to upper case */ - c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10)); -#else /* EBCDIC coding */ - if (cc >= 'a' && cc <= 'z') cc += 64; /* Convert to upper case */ - c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10)); -#endif - } - if (*pt == '}') - { - if (c < 0 || count > 8) *errorcodeptr = ERR34; - ptr = pt; - break; - } - /* If the sequence of hex digits does not end with '}', then we don't - recognize this construct; fall through to the normal \x handling. */ - } -#endif - - /* Read just a single hex char */ - - c = 0; - while (i++ < 2 && (digitab[ptr[1]] & ctype_xdigit) != 0) - { - int cc; /* Some compilers don't like ++ */ - cc = *(++ptr); /* in initializers */ -#if !EBCDIC /* ASCII coding */ - if (cc >= 'a') cc -= 32; /* Convert to upper case */ - c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10)); -#else /* EBCDIC coding */ - if (cc <= 'z') cc += 64; /* Convert to upper case */ - c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10)); -#endif - } - break; - - /* Other special escapes not starting with a digit are straightforward */ - - case 'c': - c = *(++ptr); - if (c == 0) - { - *errorcodeptr = ERR2; - return 0; - } - - /* A letter is upper-cased; then the 0x40 bit is flipped. This coding - is ASCII-specific, but then the whole concept of \cx is ASCII-specific. - (However, an EBCDIC equivalent has now been added.) */ - -#if !EBCDIC /* ASCII coding */ - if (c >= 'a' && c <= 'z') c -= 32; - c ^= 0x40; -#else /* EBCDIC coding */ - if (c >= 'a' && c <= 'z') c += 64; - c ^= 0xC0; -#endif - break; - - /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any - other alphameric following \ is an error if PCRE_EXTRA was set; otherwise, - for Perl compatibility, it is a literal. This code looks a bit odd, but - there used to be some cases other than the default, and there may be again - in future, so I haven't "optimized" it. */ - - default: - if ((options & PCRE_EXTRA) != 0) switch(c) - { - default: - *errorcodeptr = ERR3; - break; - } - break; - } - } - -*ptrptr = ptr; -return c; -} - - - -#ifdef SUPPORT_UCP -/************************************************* -* Handle \P and \p * -*************************************************/ - -/* This function is called after \P or \p has been encountered, provided that -PCRE is compiled with support for Unicode properties. On entry, ptrptr is -pointing at the P or p. On exit, it is pointing at the final character of the -escape sequence. - -Argument: - ptrptr points to the pattern position pointer - negptr points to a boolean that is set TRUE for negation else FALSE - errorcodeptr points to the error code variable - -Returns: value from ucp_type_table, or -1 for an invalid type -*/ - -static int -get_ucp(const uschar **ptrptr, BOOL *negptr, int *errorcodeptr) -{ -int c, i, bot, top; -const uschar *ptr = *ptrptr; -char name[4]; - -c = *(++ptr); -if (c == 0) goto ERROR_RETURN; - -*negptr = FALSE; - -/* \P or \p can be followed by a one- or two-character name in {}, optionally -preceded by ^ for negation. */ - -if (c == '{') - { - if (ptr[1] == '^') - { - *negptr = TRUE; - ptr++; - } - for (i = 0; i <= 2; i++) - { - c = *(++ptr); - if (c == 0) goto ERROR_RETURN; - if (c == '}') break; - name[i] = c; - } - if (c !='}') /* Try to distinguish error cases */ - { - while (*(++ptr) != 0 && *ptr != '}'); - if (*ptr == '}') goto UNKNOWN_RETURN; else goto ERROR_RETURN; - } - name[i] = 0; - } - -/* Otherwise there is just one following character */ - -else - { - name[0] = c; - name[1] = 0; - } - -*ptrptr = ptr; - -/* Search for a recognized property name using binary chop */ - -bot = 0; -top = _pcre_utt_size; - -while (bot < top) - { - i = (bot + top)/2; - c = strcmp(name, _pcre_utt[i].name); - if (c == 0) return _pcre_utt[i].value; - if (c > 0) bot = i + 1; else top = i; - } - -UNKNOWN_RETURN: -*errorcodeptr = ERR47; -*ptrptr = ptr; -return -1; - -ERROR_RETURN: -*errorcodeptr = ERR46; -*ptrptr = ptr; -return -1; -} -#endif - - - - -/************************************************* -* Check for counted repeat * -*************************************************/ - -/* This function is called when a '{' is encountered in a place where it might -start a quantifier. It looks ahead to see if it really is a quantifier or not. -It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd} -where the ddds are digits. - -Arguments: - p pointer to the first char after '{' - -Returns: TRUE or FALSE -*/ - -static BOOL -is_counted_repeat(const uschar *p) -{ -if ((digitab[*p++] & ctype_digit) == 0) return FALSE; -while ((digitab[*p] & ctype_digit) != 0) p++; -if (*p == '}') return TRUE; - -if (*p++ != ',') return FALSE; -if (*p == '}') return TRUE; - -if ((digitab[*p++] & ctype_digit) == 0) return FALSE; -while ((digitab[*p] & ctype_digit) != 0) p++; - -return (*p == '}'); -} - - - -/************************************************* -* Read repeat counts * -*************************************************/ - -/* Read an item of the form {n,m} and return the values. This is called only -after is_counted_repeat() has confirmed that a repeat-count quantifier exists, -so the syntax is guaranteed to be correct, but we need to check the values. - -Arguments: - p pointer to first char after '{' - minp pointer to int for min - maxp pointer to int for max - returned as -1 if no max - errorcodeptr points to error code variable - -Returns: pointer to '}' on success; - current ptr on error, with errorcodeptr set non-zero -*/ - -static const uschar * -read_repeat_counts(const uschar *p, int *minp, int *maxp, int *errorcodeptr) -{ -int min = 0; -int max = -1; - -/* Read the minimum value and do a paranoid check: a negative value indicates -an integer overflow. */ - -while ((digitab[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0'; -if (min < 0 || min > 65535) - { - *errorcodeptr = ERR5; - return p; - } - -/* Read the maximum value if there is one, and again do a paranoid on its size. -Also, max must not be less than min. */ - -if (*p == '}') max = min; else - { - if (*(++p) != '}') - { - max = 0; - while((digitab[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0'; - if (max < 0 || max > 65535) - { - *errorcodeptr = ERR5; - return p; - } - if (max < min) - { - *errorcodeptr = ERR4; - return p; - } - } - } - -/* Fill in the required variables, and pass back the pointer to the terminating -'}'. */ - -*minp = min; -*maxp = max; -return p; -} - - - -/************************************************* -* Find first significant op code * -*************************************************/ - -/* This is called by several functions that scan a compiled expression looking -for a fixed first character, or an anchoring op code etc. It skips over things -that do not influence this. For some calls, a change of option is important. -For some calls, it makes sense to skip negative forward and all backward -assertions, and also the \b assertion; for others it does not. - -Arguments: - code pointer to the start of the group - options pointer to external options - optbit the option bit whose changing is significant, or - zero if none are - skipassert TRUE if certain assertions are to be skipped - -Returns: pointer to the first significant opcode -*/ - -static const uschar* -first_significant_code(const uschar *code, int *options, int optbit, - BOOL skipassert) -{ -for (;;) - { - switch ((int)*code) - { - case OP_OPT: - if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit)) - *options = (int)code[1]; - code += 2; - break; - - case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: - if (!skipassert) return code; - do code += GET(code, 1); while (*code == OP_ALT); - code += _pcre_OP_lengths[*code]; - break; - - case OP_WORD_BOUNDARY: - case OP_NOT_WORD_BOUNDARY: - if (!skipassert) return code; - /* Fall through */ - - case OP_CALLOUT: - case OP_CREF: - case OP_BRANUMBER: - code += _pcre_OP_lengths[*code]; - break; - - default: - return code; - } - } -/* Control never reaches here */ -} - - - - -/************************************************* -* Find the fixed length of a pattern * -*************************************************/ - -/* Scan a pattern and compute the fixed length of subject that will match it, -if the length is fixed. This is needed for dealing with backward assertions. -In UTF8 mode, the result is in characters rather than bytes. - -Arguments: - code points to the start of the pattern (the bracket) - options the compiling options - -Returns: the fixed length, or -1 if there is no fixed length, - or -2 if \C was encountered -*/ - -static int -find_fixedlength(uschar *code, int options) -{ -int length = -1; - -register int branchlength = 0; -register uschar *cc = code + 1 + LINK_SIZE; - -/* Scan along the opcodes for this branch. If we get to the end of the -branch, check the length against that of the other branches. */ - -for (;;) - { - int d; - register int op = *cc; - if (op >= OP_BRA) op = OP_BRA; - - switch (op) - { - case OP_BRA: - case OP_ONCE: - case OP_COND: - d = find_fixedlength(cc, options); - if (d < 0) return d; - branchlength += d; - do cc += GET(cc, 1); while (*cc == OP_ALT); - cc += 1 + LINK_SIZE; - break; - - /* Reached end of a branch; if it's a ket it is the end of a nested - call. If it's ALT it is an alternation in a nested call. If it is - END it's the end of the outer call. All can be handled by the same code. */ - - case OP_ALT: - case OP_KET: - case OP_KETRMAX: - case OP_KETRMIN: - case OP_END: - if (length < 0) length = branchlength; - else if (length != branchlength) return -1; - if (*cc != OP_ALT) return length; - cc += 1 + LINK_SIZE; - branchlength = 0; - break; - - /* Skip over assertive subpatterns */ - - case OP_ASSERT: - case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: - do cc += GET(cc, 1); while (*cc == OP_ALT); - /* Fall through */ - - /* Skip over things that don't match chars */ - - case OP_REVERSE: - case OP_BRANUMBER: - case OP_CREF: - case OP_OPT: - case OP_CALLOUT: - case OP_SOD: - case OP_SOM: - case OP_EOD: - case OP_EODN: - case OP_CIRC: - case OP_DOLL: - case OP_NOT_WORD_BOUNDARY: - case OP_WORD_BOUNDARY: - cc += _pcre_OP_lengths[*cc]; - break; - - /* Handle literal characters */ - - case OP_CHAR: - case OP_CHARNC: - branchlength++; - cc += 2; -#ifdef SUPPORT_UTF8 - if ((options & PCRE_UTF8) != 0) - { - while ((*cc & 0xc0) == 0x80) cc++; - } -#endif - break; - - /* Handle exact repetitions. The count is already in characters, but we - need to skip over a multibyte character in UTF8 mode. */ - - case OP_EXACT: - branchlength += GET2(cc,1); - cc += 4; -#ifdef SUPPORT_UTF8 - if ((options & PCRE_UTF8) != 0) - { - while((*cc & 0x80) == 0x80) cc++; - } -#endif - break; - - case OP_TYPEEXACT: - branchlength += GET2(cc,1); - cc += 4; - break; - - /* Handle single-char matchers */ - - case OP_PROP: - case OP_NOTPROP: - cc++; - /* Fall through */ - - case OP_NOT_DIGIT: - case OP_DIGIT: - case OP_NOT_WHITESPACE: - case OP_WHITESPACE: - case OP_NOT_WORDCHAR: - case OP_WORDCHAR: - case OP_ANY: - branchlength++; - cc++; - break; - - /* The single-byte matcher isn't allowed */ - - case OP_ANYBYTE: - return -2; - - /* Check a class for variable quantification */ - -#ifdef SUPPORT_UTF8 - case OP_XCLASS: - cc += GET(cc, 1) - 33; - /* Fall through */ -#endif - - case OP_CLASS: - case OP_NCLASS: - cc += 33; - - switch (*cc) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRQUERY: - case OP_CRMINQUERY: - return -1; - - case OP_CRRANGE: - case OP_CRMINRANGE: - if (GET2(cc,1) != GET2(cc,3)) return -1; - branchlength += GET2(cc,1); - cc += 5; - break; - - default: - branchlength++; - } - break; - - /* Anything else is variable length */ - - default: - return -1; - } - } -/* Control never gets here */ -} - - - - -/************************************************* -* Scan compiled regex for numbered bracket * -*************************************************/ - -/* This little function scans through a compiled pattern until it finds a -capturing bracket with the given number. - -Arguments: - code points to start of expression - utf8 TRUE in UTF-8 mode - number the required bracket number - -Returns: pointer to the opcode for the bracket, or NULL if not found -*/ - -static const uschar * -find_bracket(const uschar *code, BOOL utf8, int number) -{ -#ifndef SUPPORT_UTF8 -utf8 = utf8; /* Stop pedantic compilers complaining */ -#endif - -for (;;) - { - register int c = *code; - if (c == OP_END) return NULL; - else if (c > OP_BRA) - { - int n = c - OP_BRA; - if (n > EXTRACT_BASIC_MAX) n = GET2(code, 2+LINK_SIZE); - if (n == number) return (uschar *)code; - code += _pcre_OP_lengths[OP_BRA]; - } - else - { - code += _pcre_OP_lengths[c]; - -#ifdef SUPPORT_UTF8 - - /* In UTF-8 mode, opcodes that are followed by a character may be followed - by a multi-byte character. The length in the table is a minimum, so we have - to scan along to skip the extra bytes. All opcodes are less than 128, so we - can use relatively efficient code. */ - - if (utf8) switch(c) - { - case OP_CHAR: - case OP_CHARNC: - case OP_EXACT: - case OP_UPTO: - case OP_MINUPTO: - case OP_STAR: - case OP_MINSTAR: - case OP_PLUS: - case OP_MINPLUS: - case OP_QUERY: - case OP_MINQUERY: - while ((*code & 0xc0) == 0x80) code++; - break; - - /* XCLASS is used for classes that cannot be represented just by a bit - map. This includes negated single high-valued characters. The length in - the table is zero; the actual length is stored in the compiled code. */ - - case OP_XCLASS: - code += GET(code, 1) + 1; - break; - } -#endif - } - } -} - - - -/************************************************* -* Scan compiled regex for recursion reference * -*************************************************/ - -/* This little function scans through a compiled pattern until it finds an -instance of OP_RECURSE. - -Arguments: - code points to start of expression - utf8 TRUE in UTF-8 mode - -Returns: pointer to the opcode for OP_RECURSE, or NULL if not found -*/ - -static const uschar * -find_recurse(const uschar *code, BOOL utf8) -{ -#ifndef SUPPORT_UTF8 -utf8 = utf8; /* Stop pedantic compilers complaining */ -#endif - -for (;;) - { - register int c = *code; - if (c == OP_END) return NULL; - else if (c == OP_RECURSE) return code; - else if (c > OP_BRA) - { - code += _pcre_OP_lengths[OP_BRA]; - } - else - { - code += _pcre_OP_lengths[c]; - -#ifdef SUPPORT_UTF8 - - /* In UTF-8 mode, opcodes that are followed by a character may be followed - by a multi-byte character. The length in the table is a minimum, so we have - to scan along to skip the extra bytes. All opcodes are less than 128, so we - can use relatively efficient code. */ - - if (utf8) switch(c) - { - case OP_CHAR: - case OP_CHARNC: - case OP_EXACT: - case OP_UPTO: - case OP_MINUPTO: - case OP_STAR: - case OP_MINSTAR: - case OP_PLUS: - case OP_MINPLUS: - case OP_QUERY: - case OP_MINQUERY: - while ((*code & 0xc0) == 0x80) code++; - break; - - /* XCLASS is used for classes that cannot be represented just by a bit - map. This includes negated single high-valued characters. The length in - the table is zero; the actual length is stored in the compiled code. */ - - case OP_XCLASS: - code += GET(code, 1) + 1; - break; - } -#endif - } - } -} - - - -/************************************************* -* Scan compiled branch for non-emptiness * -*************************************************/ - -/* This function scans through a branch of a compiled pattern to see whether it -can match the empty string or not. It is called only from could_be_empty() -below. Note that first_significant_code() skips over assertions. If we hit an -unclosed bracket, we return "empty" - this means we've struck an inner bracket -whose current branch will already have been scanned. - -Arguments: - code points to start of search - endcode points to where to stop - utf8 TRUE if in UTF8 mode - -Returns: TRUE if what is matched could be empty -*/ - -static BOOL -could_be_empty_branch(const uschar *code, const uschar *endcode, BOOL utf8) -{ -register int c; -for (code = first_significant_code(code + 1 + LINK_SIZE, NULL, 0, TRUE); - code < endcode; - code = first_significant_code(code + _pcre_OP_lengths[c], NULL, 0, TRUE)) - { - const uschar *ccode; - - c = *code; - - if (c >= OP_BRA) - { - BOOL empty_branch; - if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ - - /* Scan a closed bracket */ - - empty_branch = FALSE; - do - { - if (!empty_branch && could_be_empty_branch(code, endcode, utf8)) - empty_branch = TRUE; - code += GET(code, 1); - } - while (*code == OP_ALT); - if (!empty_branch) return FALSE; /* All branches are non-empty */ - code += 1 + LINK_SIZE; - c = *code; - } - - else switch (c) - { - /* Check for quantifiers after a class */ - -#ifdef SUPPORT_UTF8 - case OP_XCLASS: - ccode = code + GET(code, 1); - goto CHECK_CLASS_REPEAT; -#endif - - case OP_CLASS: - case OP_NCLASS: - ccode = code + 33; - -#ifdef SUPPORT_UTF8 - CHECK_CLASS_REPEAT: -#endif - - switch (*ccode) - { - case OP_CRSTAR: /* These could be empty; continue */ - case OP_CRMINSTAR: - case OP_CRQUERY: - case OP_CRMINQUERY: - break; - - default: /* Non-repeat => class must match */ - case OP_CRPLUS: /* These repeats aren't empty */ - case OP_CRMINPLUS: - return FALSE; - - case OP_CRRANGE: - case OP_CRMINRANGE: - if (GET2(ccode, 1) > 0) return FALSE; /* Minimum > 0 */ - break; - } - break; - - /* Opcodes that must match a character */ - - case OP_PROP: - case OP_NOTPROP: - case OP_EXTUNI: - case OP_NOT_DIGIT: - case OP_DIGIT: - case OP_NOT_WHITESPACE: - case OP_WHITESPACE: - case OP_NOT_WORDCHAR: - case OP_WORDCHAR: - case OP_ANY: - case OP_ANYBYTE: - case OP_CHAR: - case OP_CHARNC: - case OP_NOT: - case OP_PLUS: - case OP_MINPLUS: - case OP_EXACT: - case OP_NOTPLUS: - case OP_NOTMINPLUS: - case OP_NOTEXACT: - case OP_TYPEPLUS: - case OP_TYPEMINPLUS: - case OP_TYPEEXACT: - return FALSE; - - /* End of branch */ - - case OP_KET: - case OP_KETRMAX: - case OP_KETRMIN: - case OP_ALT: - return TRUE; - - /* In UTF-8 mode, STAR, MINSTAR, QUERY, MINQUERY, UPTO, and MINUPTO may be - followed by a multibyte character */ - -#ifdef SUPPORT_UTF8 - case OP_STAR: - case OP_MINSTAR: - case OP_QUERY: - case OP_MINQUERY: - case OP_UPTO: - case OP_MINUPTO: - if (utf8) while ((code[2] & 0xc0) == 0x80) code++; - break; -#endif - } - } - -return TRUE; -} - - - -/************************************************* -* Scan compiled regex for non-emptiness * -*************************************************/ - -/* This function is called to check for left recursive calls. We want to check -the current branch of the current pattern to see if it could match the empty -string. If it could, we must look outwards for branches at other levels, -stopping when we pass beyond the bracket which is the subject of the recursion. - -Arguments: - code points to start of the recursion - endcode points to where to stop (current RECURSE item) - bcptr points to the chain of current (unclosed) branch starts - utf8 TRUE if in UTF-8 mode - -Returns: TRUE if what is matched could be empty -*/ - -static BOOL -could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr, - BOOL utf8) -{ -while (bcptr != NULL && bcptr->current >= code) - { - if (!could_be_empty_branch(bcptr->current, endcode, utf8)) return FALSE; - bcptr = bcptr->outer; - } -return TRUE; -} - - - -/************************************************* -* Check for POSIX class syntax * -*************************************************/ - -/* This function is called when the sequence "[:" or "[." or "[=" is -encountered in a character class. It checks whether this is followed by an -optional ^ and then a sequence of letters, terminated by a matching ":]" or -".]" or "=]". - -Argument: - ptr pointer to the initial [ - endptr where to return the end pointer - cd pointer to compile data - -Returns: TRUE or FALSE -*/ - -static BOOL -check_posix_syntax(const uschar *ptr, const uschar **endptr, compile_data *cd) -{ -int terminator; /* Don't combine these lines; the Solaris cc */ -terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */ -if (*(++ptr) == '^') ptr++; -while ((cd->ctypes[*ptr] & ctype_letter) != 0) ptr++; -if (*ptr == terminator && ptr[1] == ']') - { - *endptr = ptr; - return TRUE; - } -return FALSE; -} - - - - -/************************************************* -* Check POSIX class name * -*************************************************/ - -/* This function is called to check the name given in a POSIX-style class entry -such as [:alnum:]. - -Arguments: - ptr points to the first letter - len the length of the name - -Returns: a value representing the name, or -1 if unknown -*/ - -static int -check_posix_name(const uschar *ptr, int len) -{ -register int yield = 0; -while (posix_name_lengths[yield] != 0) - { - if (len == posix_name_lengths[yield] && - strncmp((const char *)ptr, posix_names[yield], len) == 0) return yield; - yield++; - } -return -1; -} - - -/************************************************* -* Adjust OP_RECURSE items in repeated group * -*************************************************/ - -/* OP_RECURSE items contain an offset from the start of the regex to the group -that is referenced. This means that groups can be replicated for fixed -repetition simply by copying (because the recursion is allowed to refer to -earlier groups that are outside the current group). However, when a group is -optional (i.e. the minimum quantifier is zero), OP_BRAZERO is inserted before -it, after it has been compiled. This means that any OP_RECURSE items within it -that refer to the group itself or any contained groups have to have their -offsets adjusted. That is the job of this function. Before it is called, the -partially compiled regex must be temporarily terminated with OP_END. - -Arguments: - group points to the start of the group - adjust the amount by which the group is to be moved - utf8 TRUE in UTF-8 mode - cd contains pointers to tables etc. - -Returns: nothing -*/ - -static void -adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd) -{ -uschar *ptr = group; -while ((ptr = (uschar *)find_recurse(ptr, utf8)) != NULL) - { - int offset = GET(ptr, 1); - if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust); - ptr += 1 + LINK_SIZE; - } -} - - - -/************************************************* -* Insert an automatic callout point * -*************************************************/ - -/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert -callout points before each pattern item. - -Arguments: - code current code pointer - ptr current pattern pointer - cd pointers to tables etc - -Returns: new code pointer -*/ - -static uschar * -auto_callout(uschar *code, const uschar *ptr, compile_data *cd) -{ -*code++ = OP_CALLOUT; -*code++ = 255; -PUT(code, 0, ptr - cd->start_pattern); /* Pattern offset */ -PUT(code, LINK_SIZE, 0); /* Default length */ -return code + 2*LINK_SIZE; -} - - - -/************************************************* -* Complete a callout item * -*************************************************/ - -/* A callout item contains the length of the next item in the pattern, which -we can't fill in till after we have reached the relevant point. This is used -for both automatic and manual callouts. - -Arguments: - previous_callout points to previous callout item - ptr current pattern pointer - cd pointers to tables etc - -Returns: nothing -*/ - -static void -complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd) -{ -int length = ptr - cd->start_pattern - GET(previous_callout, 2); -PUT(previous_callout, 2 + LINK_SIZE, length); -} - - - -#ifdef SUPPORT_UCP -/************************************************* -* Get othercase range * -*************************************************/ - -/* This function is passed the start and end of a class range, in UTF-8 mode -with UCP support. It searches up the characters, looking for internal ranges of -characters in the "other" case. Each call returns the next one, updating the -start address. - -Arguments: - cptr points to starting character value; updated - d end value - ocptr where to put start of othercase range - odptr where to put end of othercase range - -Yield: TRUE when range returned; FALSE when no more -*/ - -static BOOL -get_othercase_range(int *cptr, int d, int *ocptr, int *odptr) -{ -int c, chartype, othercase, next; - -for (c = *cptr; c <= d; c++) - { - if (_pcre_ucp_findchar(c, &chartype, &othercase) == ucp_L && othercase != 0) - break; - } - -if (c > d) return FALSE; - -*ocptr = othercase; -next = othercase + 1; - -for (++c; c <= d; c++) - { - if (_pcre_ucp_findchar(c, &chartype, &othercase) != ucp_L || - othercase != next) - break; - next++; - } - -*odptr = next - 1; -*cptr = c; - -return TRUE; -} -#endif /* SUPPORT_UCP */ - - -/************************************************* -* Compile one branch * -*************************************************/ - -/* Scan the pattern, compiling it into the code vector. If the options are -changed during the branch, the pointer is used to change the external options -bits. - -Arguments: - optionsptr pointer to the option bits - brackets points to number of extracting brackets used - codeptr points to the pointer to the current code point - ptrptr points to the current pattern pointer - errorcodeptr points to error code variable - firstbyteptr set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE) - reqbyteptr set to the last literal character required, else < 0 - bcptr points to current branch chain - cd contains pointers to tables etc. - -Returns: TRUE on success - FALSE, with *errorcodeptr set non-zero on error -*/ - -static BOOL -compile_branch(int *optionsptr, int *brackets, uschar **codeptr, - const uschar **ptrptr, int *errorcodeptr, int *firstbyteptr, - int *reqbyteptr, branch_chain *bcptr, compile_data *cd) -{ -int repeat_type, op_type; -int repeat_min = 0, repeat_max = 0; /* To please picky compilers */ -int bravalue = 0; -int greedy_default, greedy_non_default; -int firstbyte, reqbyte; -int zeroreqbyte, zerofirstbyte; -int req_caseopt, reqvary, tempreqvary; -int condcount = 0; -int options = *optionsptr; -int after_manual_callout = 0; -register int c; -register uschar *code = *codeptr; -uschar *tempcode; -BOOL inescq = FALSE; -BOOL groupsetfirstbyte = FALSE; -const uschar *ptr = *ptrptr; -const uschar *tempptr; -uschar *previous = NULL; -uschar *previous_callout = NULL; -uschar classbits[32]; - -#ifdef SUPPORT_UTF8 -BOOL class_utf8; -BOOL utf8 = (options & PCRE_UTF8) != 0; -uschar *class_utf8data; -uschar utf8_char[6]; -#else -BOOL utf8 = FALSE; -#endif - -/* Set up the default and non-default settings for greediness */ - -greedy_default = ((options & PCRE_UNGREEDY) != 0); -greedy_non_default = greedy_default ^ 1; - -/* Initialize no first byte, no required byte. REQ_UNSET means "no char -matching encountered yet". It gets changed to REQ_NONE if we hit something that -matches a non-fixed char first char; reqbyte just remains unset if we never -find one. - -When we hit a repeat whose minimum is zero, we may have to adjust these values -to take the zero repeat into account. This is implemented by setting them to -zerofirstbyte and zeroreqbyte when such a repeat is encountered. The individual -item types that can be repeated set these backoff variables appropriately. */ - -firstbyte = reqbyte = zerofirstbyte = zeroreqbyte = REQ_UNSET; - -/* The variable req_caseopt contains either the REQ_CASELESS value or zero, -according to the current setting of the caseless flag. REQ_CASELESS is a bit -value > 255. It is added into the firstbyte or reqbyte variables to record the -case status of the value. This is used only for ASCII characters. */ - -req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; - -/* Switch on next character until the end of the branch */ - -for (;; ptr++) - { - BOOL negate_class; - BOOL possessive_quantifier; - BOOL is_quantifier; - int class_charcount; - int class_lastchar; - int newoptions; - int recno; - int skipbytes; - int subreqbyte; - int subfirstbyte; - int mclength; - uschar mcbuffer[8]; - - /* Next byte in the pattern */ - - c = *ptr; - - /* If in \Q...\E, check for the end; if not, we have a literal */ - - if (inescq && c != 0) - { - if (c == '\\' && ptr[1] == 'E') - { - inescq = FALSE; - ptr++; - continue; - } - else - { - if (previous_callout != NULL) - { - complete_callout(previous_callout, ptr, cd); - previous_callout = NULL; - } - if ((options & PCRE_AUTO_CALLOUT) != 0) - { - previous_callout = code; - code = auto_callout(code, ptr, cd); - } - goto NORMAL_CHAR; - } - } - - /* Fill in length of a previous callout, except when the next thing is - a quantifier. */ - - is_quantifier = c == '*' || c == '+' || c == '?' || - (c == '{' && is_counted_repeat(ptr+1)); - - if (!is_quantifier && previous_callout != NULL && - after_manual_callout-- <= 0) - { - complete_callout(previous_callout, ptr, cd); - previous_callout = NULL; - } - - /* In extended mode, skip white space and comments */ - - if ((options & PCRE_EXTENDED) != 0) - { - if ((cd->ctypes[c] & ctype_space) != 0) continue; - if (c == '#') - { - /* The space before the ; is to avoid a warning on a silly compiler - on the Macintosh. */ - while ((c = *(++ptr)) != 0 && c != NEWLINE) ; - if (c != 0) continue; /* Else fall through to handle end of string */ - } - } - - /* No auto callout for quantifiers. */ - - if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier) - { - previous_callout = code; - code = auto_callout(code, ptr, cd); - } - - switch(c) - { - /* The branch terminates at end of string, |, or ). */ - - case 0: - case '|': - case ')': - *firstbyteptr = firstbyte; - *reqbyteptr = reqbyte; - *codeptr = code; - *ptrptr = ptr; - return TRUE; - - /* Handle single-character metacharacters. In multiline mode, ^ disables - the setting of any following char as a first character. */ - - case '^': - if ((options & PCRE_MULTILINE) != 0) - { - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - } - previous = NULL; - *code++ = OP_CIRC; - break; - - case '$': - previous = NULL; - *code++ = OP_DOLL; - break; - - /* There can never be a first char if '.' is first, whatever happens about - repeats. The value of reqbyte doesn't change either. */ - - case '.': - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; - previous = code; - *code++ = OP_ANY; - break; - - /* Character classes. If the included characters are all < 255 in value, we - build a 32-byte bitmap of the permitted characters, except in the special - case where there is only one such character. For negated classes, we build - the map as usual, then invert it at the end. However, we use a different - opcode so that data characters > 255 can be handled correctly. - - If the class contains characters outside the 0-255 range, a different - opcode is compiled. It may optionally have a bit map for characters < 256, - but those above are are explicitly listed afterwards. A flag byte tells - whether the bitmap is present, and whether this is a negated class or not. - */ - - case '[': - previous = code; - - /* PCRE supports POSIX class stuff inside a class. Perl gives an error if - they are encountered at the top level, so we'll do that too. */ - - if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && - check_posix_syntax(ptr, &tempptr, cd)) - { - *errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31; - goto FAILED; - } - - /* If the first character is '^', set the negation flag and skip it. */ - - if ((c = *(++ptr)) == '^') - { - negate_class = TRUE; - c = *(++ptr); - } - else - { - negate_class = FALSE; - } - - /* Keep a count of chars with values < 256 so that we can optimize the case - of just a single character (as long as it's < 256). For higher valued UTF-8 - characters, we don't yet do any optimization. */ - - class_charcount = 0; - class_lastchar = -1; - -#ifdef SUPPORT_UTF8 - class_utf8 = FALSE; /* No chars >= 256 */ - class_utf8data = code + LINK_SIZE + 34; /* For UTF-8 items */ -#endif - - /* Initialize the 32-char bit map to all zeros. We have to build the - map in a temporary bit of store, in case the class contains only 1 - character (< 256), because in that case the compiled code doesn't use the - bit map. */ - - memset(classbits, 0, 32 * sizeof(uschar)); - - /* Process characters until ] is reached. By writing this as a "do" it - means that an initial ] is taken as a data character. The first pass - through the regex checked the overall syntax, so we don't need to be very - strict here. At the start of the loop, c contains the first byte of the - character. */ - - do - { -#ifdef SUPPORT_UTF8 - if (utf8 && c > 127) - { /* Braces are required because the */ - GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */ - } -#endif - - /* Inside \Q...\E everything is literal except \E */ - - if (inescq) - { - if (c == '\\' && ptr[1] == 'E') - { - inescq = FALSE; - ptr++; - continue; - } - else goto LONE_SINGLE_CHARACTER; - } - - /* Handle POSIX class names. Perl allows a negation extension of the - form [:^name:]. A square bracket that doesn't match the syntax is - treated as a literal. We also recognize the POSIX constructions - [.ch.] and [=ch=] ("collating elements") and fault them, as Perl - 5.6 and 5.8 do. */ - - if (c == '[' && - (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && - check_posix_syntax(ptr, &tempptr, cd)) - { - BOOL local_negate = FALSE; - int posix_class, i; - register const uschar *cbits = cd->cbits; - - if (ptr[1] != ':') - { - *errorcodeptr = ERR31; - goto FAILED; - } - - ptr += 2; - if (*ptr == '^') - { - local_negate = TRUE; - ptr++; - } - - posix_class = check_posix_name(ptr, tempptr - ptr); - if (posix_class < 0) - { - *errorcodeptr = ERR30; - goto FAILED; - } - - /* If matching is caseless, upper and lower are converted to - alpha. This relies on the fact that the class table starts with - alpha, lower, upper as the first 3 entries. */ - - if ((options & PCRE_CASELESS) != 0 && posix_class <= 2) - posix_class = 0; - - /* Or into the map we are building up to 3 of the static class - tables, or their negations. The [:blank:] class sets up the same - chars as the [:space:] class (all white space). We remove the vertical - white space chars afterwards. */ - - posix_class *= 3; - for (i = 0; i < 3; i++) - { - BOOL blankclass = strncmp((char *)ptr, "blank", 5) == 0; - int taboffset = posix_class_maps[posix_class + i]; - if (taboffset < 0) break; - if (local_negate) - { - if (i == 0) - for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+taboffset]; - else - for (c = 0; c < 32; c++) classbits[c] &= ~cbits[c+taboffset]; - if (blankclass) classbits[1] |= 0x3c; - } - else - { - for (c = 0; c < 32; c++) classbits[c] |= cbits[c+taboffset]; - if (blankclass) classbits[1] &= ~0x3c; - } - } - - ptr = tempptr + 1; - class_charcount = 10; /* Set > 1; assumes more than 1 per class */ - continue; /* End of POSIX syntax handling */ - } - - /* Backslash may introduce a single character, or it may introduce one - of the specials, which just set a flag. Escaped items are checked for - validity in the pre-compiling pass. The sequence \b is a special case. - Inside a class (and only there) it is treated as backspace. Elsewhere - it marks a word boundary. Other escapes have preset maps ready to - or into the one we are building. We assume they have more than one - character in them, so set class_charcount bigger than one. */ - - if (c == '\\') - { - c = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE); - - if (-c == ESC_b) c = '\b'; /* \b is backslash in a class */ - else if (-c == ESC_X) c = 'X'; /* \X is literal X in a class */ - else if (-c == ESC_Q) /* Handle start of quoted string */ - { - if (ptr[1] == '\\' && ptr[2] == 'E') - { - ptr += 2; /* avoid empty string */ - } - else inescq = TRUE; - continue; - } - - if (c < 0) - { - register const uschar *cbits = cd->cbits; - class_charcount += 2; /* Greater than 1 is what matters */ - switch (-c) - { - case ESC_d: - for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit]; - continue; - - case ESC_D: - for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit]; - continue; - - case ESC_w: - for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word]; - continue; - - case ESC_W: - for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word]; - continue; - - case ESC_s: - for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space]; - classbits[1] &= ~0x08; /* Perl 5.004 onwards omits VT from \s */ - continue; - - case ESC_S: - for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space]; - classbits[1] |= 0x08; /* Perl 5.004 onwards omits VT from \s */ - continue; - -#ifdef SUPPORT_UCP - case ESC_p: - case ESC_P: - { - BOOL negated; - int property = get_ucp(&ptr, &negated, errorcodeptr); - if (property < 0) goto FAILED; - class_utf8 = TRUE; - *class_utf8data++ = ((-c == ESC_p) != negated)? - XCL_PROP : XCL_NOTPROP; - *class_utf8data++ = property; - class_charcount -= 2; /* Not a < 256 character */ - } - continue; -#endif - - /* Unrecognized escapes are faulted if PCRE is running in its - strict mode. By default, for compatibility with Perl, they are - treated as literals. */ - - default: - if ((options & PCRE_EXTRA) != 0) - { - *errorcodeptr = ERR7; - goto FAILED; - } - c = *ptr; /* The final character */ - class_charcount -= 2; /* Undo the default count from above */ - } - } - - /* Fall through if we have a single character (c >= 0). This may be - > 256 in UTF-8 mode. */ - - } /* End of backslash handling */ - - /* A single character may be followed by '-' to form a range. However, - Perl does not permit ']' to be the end of the range. A '-' character - here is treated as a literal. */ - - if (ptr[1] == '-' && ptr[2] != ']') - { - int d; - ptr += 2; - -#ifdef SUPPORT_UTF8 - if (utf8) - { /* Braces are required because the */ - GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */ - } - else -#endif - d = *ptr; /* Not UTF-8 mode */ - - /* The second part of a range can be a single-character escape, but - not any of the other escapes. Perl 5.6 treats a hyphen as a literal - in such circumstances. */ - - if (d == '\\') - { - const uschar *oldptr = ptr; - d = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE); - - /* \b is backslash; \X is literal X; any other special means the '-' - was literal */ - - if (d < 0) - { - if (d == -ESC_b) d = '\b'; - else if (d == -ESC_X) d = 'X'; else - { - ptr = oldptr - 2; - goto LONE_SINGLE_CHARACTER; /* A few lines below */ - } - } - } - - /* The check that the two values are in the correct order happens in - the pre-pass. Optimize one-character ranges */ - - if (d == c) goto LONE_SINGLE_CHARACTER; /* A few lines below */ - - /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless - matching, we have to use an XCLASS with extra data items. Caseless - matching for characters > 127 is available only if UCP support is - available. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) - { - class_utf8 = TRUE; - - /* With UCP support, we can find the other case equivalents of - the relevant characters. There may be several ranges. Optimize how - they fit with the basic range. */ - -#ifdef SUPPORT_UCP - if ((options & PCRE_CASELESS) != 0) - { - int occ, ocd; - int cc = c; - int origd = d; - while (get_othercase_range(&cc, origd, &occ, &ocd)) - { - if (occ >= c && ocd <= d) continue; /* Skip embedded ranges */ - - if (occ < c && ocd >= c - 1) /* Extend the basic range */ - { /* if there is overlap, */ - c = occ; /* noting that if occ < c */ - continue; /* we can't have ocd > d */ - } /* because a subrange is */ - if (ocd > d && occ <= d + 1) /* always shorter than */ - { /* the basic range. */ - d = ocd; - continue; - } - - if (occ == ocd) - { - *class_utf8data++ = XCL_SINGLE; - } - else - { - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(occ, class_utf8data); - } - class_utf8data += _pcre_ord2utf8(ocd, class_utf8data); - } - } -#endif /* SUPPORT_UCP */ - - /* Now record the original range, possibly modified for UCP caseless - overlapping ranges. */ - - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(c, class_utf8data); - class_utf8data += _pcre_ord2utf8(d, class_utf8data); - - /* With UCP support, we are done. Without UCP support, there is no - caseless matching for UTF-8 characters > 127; we can use the bit map - for the smaller ones. */ - -#ifdef SUPPORT_UCP - continue; /* With next character in the class */ -#else - if ((options & PCRE_CASELESS) == 0 || c > 127) continue; - - /* Adjust upper limit and fall through to set up the map */ - - d = 127; - -#endif /* SUPPORT_UCP */ - } -#endif /* SUPPORT_UTF8 */ - - /* We use the bit map for all cases when not in UTF-8 mode; else - ranges that lie entirely within 0-127 when there is UCP support; else - for partial ranges without UCP support. */ - - for (; c <= d; c++) - { - classbits[c/8] |= (1 << (c&7)); - if ((options & PCRE_CASELESS) != 0) - { - int uc = cd->fcc[c]; /* flip case */ - classbits[uc/8] |= (1 << (uc&7)); - } - class_charcount++; /* in case a one-char range */ - class_lastchar = c; - } - - continue; /* Go get the next char in the class */ - } - - /* Handle a lone single character - we can get here for a normal - non-escape char, or after \ that introduces a single character or for an - apparent range that isn't. */ - - LONE_SINGLE_CHARACTER: - - /* Handle a character that cannot go in the bit map */ - -#ifdef SUPPORT_UTF8 - if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) - { - class_utf8 = TRUE; - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(c, class_utf8data); - -#ifdef SUPPORT_UCP - if ((options & PCRE_CASELESS) != 0) - { - int chartype; - int othercase; - if (_pcre_ucp_findchar(c, &chartype, &othercase) >= 0 && - othercase > 0) - { - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); - } - } -#endif /* SUPPORT_UCP */ - - } - else -#endif /* SUPPORT_UTF8 */ - - /* Handle a single-byte character */ - { - classbits[c/8] |= (1 << (c&7)); - if ((options & PCRE_CASELESS) != 0) - { - c = cd->fcc[c]; /* flip case */ - classbits[c/8] |= (1 << (c&7)); - } - class_charcount++; - class_lastchar = c; - } - } - - /* Loop until ']' reached; the check for end of string happens inside the - loop. This "while" is the end of the "do" above. */ - - while ((c = *(++ptr)) != ']' || inescq); - - /* If class_charcount is 1, we saw precisely one character whose value is - less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we - can optimize the negative case only if there were no characters >= 128 - because OP_NOT and the related opcodes like OP_NOTSTAR operate on - single-bytes only. This is an historical hangover. Maybe one day we can - tidy these opcodes to handle multi-byte characters. - - The optimization throws away the bit map. We turn the item into a - 1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note - that OP_NOT does not support multibyte characters. In the positive case, it - can cause firstbyte to be set. Otherwise, there can be no first char if - this item is first, whatever repeat count may follow. In the case of - reqbyte, save the previous value for reinstating. */ - -#ifdef SUPPORT_UTF8 - if (class_charcount == 1 && - (!utf8 || - (!class_utf8 && (!negate_class || class_lastchar < 128)))) - -#else - if (class_charcount == 1) -#endif - { - zeroreqbyte = reqbyte; - - /* The OP_NOT opcode works on one-byte characters only. */ - - if (negate_class) - { - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - *code++ = OP_NOT; - *code++ = class_lastchar; - break; - } - - /* For a single, positive character, get the value into mcbuffer, and - then we can handle this with the normal one-character code. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && class_lastchar > 127) - mclength = _pcre_ord2utf8(class_lastchar, mcbuffer); - else -#endif - { - mcbuffer[0] = class_lastchar; - mclength = 1; - } - goto ONE_CHAR; - } /* End of 1-char optimization */ - - /* The general case - not the one-char optimization. If this is the first - thing in the branch, there can be no first char setting, whatever the - repeat count. Any reqbyte setting must remain unchanged after any kind of - repeat. */ - - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; - - /* If there are characters with values > 255, we have to compile an - extended class, with its own opcode. If there are no characters < 256, - we can omit the bitmap. */ - -#ifdef SUPPORT_UTF8 - if (class_utf8) - { - *class_utf8data++ = XCL_END; /* Marks the end of extra data */ - *code++ = OP_XCLASS; - code += LINK_SIZE; - *code = negate_class? XCL_NOT : 0; - - /* If the map is required, install it, and move on to the end of - the extra data */ - - if (class_charcount > 0) - { - *code++ |= XCL_MAP; - memcpy(code, classbits, 32); - code = class_utf8data; - } - - /* If the map is not required, slide down the extra data. */ - - else - { - int len = class_utf8data - (code + 33); - memmove(code + 1, code + 33, len); - code += len + 1; - } - - /* Now fill in the complete length of the item */ - - PUT(previous, 1, code - previous); - break; /* End of class handling */ - } -#endif - - /* If there are no characters > 255, negate the 32-byte map if necessary, - and copy it into the code vector. If this is the first thing in the branch, - there can be no first char setting, whatever the repeat count. Any reqbyte - setting must remain unchanged after any kind of repeat. */ - - if (negate_class) - { - *code++ = OP_NCLASS; - for (c = 0; c < 32; c++) code[c] = ~classbits[c]; - } - else - { - *code++ = OP_CLASS; - memcpy(code, classbits, 32); - } - code += 32; - break; - - /* Various kinds of repeat; '{' is not necessarily a quantifier, but this - has been tested above. */ - - case '{': - if (!is_quantifier) goto NORMAL_CHAR; - ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr); - if (*errorcodeptr != 0) goto FAILED; - goto REPEAT; - - case '*': - repeat_min = 0; - repeat_max = -1; - goto REPEAT; - - case '+': - repeat_min = 1; - repeat_max = -1; - goto REPEAT; - - case '?': - repeat_min = 0; - repeat_max = 1; - - REPEAT: - if (previous == NULL) - { - *errorcodeptr = ERR9; - goto FAILED; - } - - if (repeat_min == 0) - { - firstbyte = zerofirstbyte; /* Adjust for zero repeat */ - reqbyte = zeroreqbyte; /* Ditto */ - } - - /* Remember whether this is a variable length repeat */ - - reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY; - - op_type = 0; /* Default single-char op codes */ - possessive_quantifier = FALSE; /* Default not possessive quantifier */ - - /* Save start of previous item, in case we have to move it up to make space - for an inserted OP_ONCE for the additional '+' extension. */ - - tempcode = previous; - - /* If the next character is '+', we have a possessive quantifier. This - implies greediness, whatever the setting of the PCRE_UNGREEDY option. - If the next character is '?' this is a minimizing repeat, by default, - but if PCRE_UNGREEDY is set, it works the other way round. We change the - repeat type to the non-default. */ - - if (ptr[1] == '+') - { - repeat_type = 0; /* Force greedy */ - possessive_quantifier = TRUE; - ptr++; - } - else if (ptr[1] == '?') - { - repeat_type = greedy_non_default; - ptr++; - } - else repeat_type = greedy_default; - - /* If previous was a recursion, we need to wrap it inside brackets so that - it can be replicated if necessary. */ - - if (*previous == OP_RECURSE) - { - memmove(previous + 1 + LINK_SIZE, previous, 1 + LINK_SIZE); - code += 1 + LINK_SIZE; - *previous = OP_BRA; - PUT(previous, 1, code - previous); - *code = OP_KET; - PUT(code, 1, code - previous); - code += 1 + LINK_SIZE; - } - - /* If previous was a character match, abolish the item and generate a - repeat item instead. If a char item has a minumum of more than one, ensure - that it is set in reqbyte - it might not be if a sequence such as x{3} is - the first thing in a branch because the x will have gone into firstbyte - instead. */ - - if (*previous == OP_CHAR || *previous == OP_CHARNC) - { - /* Deal with UTF-8 characters that take up more than one byte. It's - easier to write this out separately than try to macrify it. Use c to - hold the length of the character in bytes, plus 0x80 to flag that it's a - length rather than a small character. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && (code[-1] & 0x80) != 0) - { - uschar *lastchar = code - 1; - while((*lastchar & 0xc0) == 0x80) lastchar--; - c = code - lastchar; /* Length of UTF-8 character */ - memcpy(utf8_char, lastchar, c); /* Save the char */ - c |= 0x80; /* Flag c as a length */ - } - else -#endif - - /* Handle the case of a single byte - either with no UTF8 support, or - with UTF-8 disabled, or for a UTF-8 character < 128. */ - - { - c = code[-1]; - if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt; - } - - goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */ - } - - /* If previous was a single negated character ([^a] or similar), we use - one of the special opcodes, replacing it. The code is shared with single- - character repeats by setting opt_type to add a suitable offset into - repeat_type. OP_NOT is currently used only for single-byte chars. */ - - else if (*previous == OP_NOT) - { - op_type = OP_NOTSTAR - OP_STAR; /* Use "not" opcodes */ - c = previous[1]; - goto OUTPUT_SINGLE_REPEAT; - } - - /* If previous was a character type match (\d or similar), abolish it and - create a suitable repeat item. The code is shared with single-character - repeats by setting op_type to add a suitable offset into repeat_type. Note - the the Unicode property types will be present only when SUPPORT_UCP is - defined, but we don't wrap the little bits of code here because it just - makes it horribly messy. */ - - else if (*previous < OP_EODN) - { - uschar *oldcode; - int prop_type; - op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */ - c = *previous; - - OUTPUT_SINGLE_REPEAT: - prop_type = (*previous == OP_PROP || *previous == OP_NOTPROP)? - previous[1] : -1; - - oldcode = code; - code = previous; /* Usually overwrite previous item */ - - /* If the maximum is zero then the minimum must also be zero; Perl allows - this case, so we do too - by simply omitting the item altogether. */ - - if (repeat_max == 0) goto END_REPEAT; - - /* All real repeats make it impossible to handle partial matching (maybe - one day we will be able to remove this restriction). */ - - if (repeat_max != 1) cd->nopartial = TRUE; - - /* Combine the op_type with the repeat_type */ - - repeat_type += op_type; - - /* A minimum of zero is handled either as the special case * or ?, or as - an UPTO, with the maximum given. */ - - if (repeat_min == 0) - { - if (repeat_max == -1) *code++ = OP_STAR + repeat_type; - else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type; - else - { - *code++ = OP_UPTO + repeat_type; - PUT2INC(code, 0, repeat_max); - } - } - - /* A repeat minimum of 1 is optimized into some special cases. If the - maximum is unlimited, we use OP_PLUS. Otherwise, the original item it - left in place and, if the maximum is greater than 1, we use OP_UPTO with - one less than the maximum. */ - - else if (repeat_min == 1) - { - if (repeat_max == -1) - *code++ = OP_PLUS + repeat_type; - else - { - code = oldcode; /* leave previous item in place */ - if (repeat_max == 1) goto END_REPEAT; - *code++ = OP_UPTO + repeat_type; - PUT2INC(code, 0, repeat_max - 1); - } - } - - /* The case {n,n} is just an EXACT, while the general case {n,m} is - handled as an EXACT followed by an UPTO. */ - - else - { - *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */ - PUT2INC(code, 0, repeat_min); - - /* If the maximum is unlimited, insert an OP_STAR. Before doing so, - we have to insert the character for the previous code. For a repeated - Unicode property match, there is an extra byte that defines the - required property. In UTF-8 mode, long characters have their length in - c, with the 0x80 bit as a flag. */ - - if (repeat_max < 0) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { - memcpy(code, utf8_char, c & 7); - code += c & 7; - } - else -#endif - { - *code++ = c; - if (prop_type >= 0) *code++ = prop_type; - } - *code++ = OP_STAR + repeat_type; - } - - /* Else insert an UPTO if the max is greater than the min, again - preceded by the character, for the previously inserted code. */ - - else if (repeat_max != repeat_min) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { - memcpy(code, utf8_char, c & 7); - code += c & 7; - } - else -#endif - *code++ = c; - if (prop_type >= 0) *code++ = prop_type; - repeat_max -= repeat_min; - *code++ = OP_UPTO + repeat_type; - PUT2INC(code, 0, repeat_max); - } - } - - /* The character or character type itself comes last in all cases. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { - memcpy(code, utf8_char, c & 7); - code += c & 7; - } - else -#endif - *code++ = c; - - /* For a repeated Unicode property match, there is an extra byte that - defines the required property. */ - -#ifdef SUPPORT_UCP - if (prop_type >= 0) *code++ = prop_type; -#endif - } - - /* If previous was a character class or a back reference, we put the repeat - stuff after it, but just skip the item if the repeat was {0,0}. */ - - else if (*previous == OP_CLASS || - *previous == OP_NCLASS || -#ifdef SUPPORT_UTF8 - *previous == OP_XCLASS || -#endif - *previous == OP_REF) - { - if (repeat_max == 0) - { - code = previous; - goto END_REPEAT; - } - - /* All real repeats make it impossible to handle partial matching (maybe - one day we will be able to remove this restriction). */ - - if (repeat_max != 1) cd->nopartial = TRUE; - - if (repeat_min == 0 && repeat_max == -1) - *code++ = OP_CRSTAR + repeat_type; - else if (repeat_min == 1 && repeat_max == -1) - *code++ = OP_CRPLUS + repeat_type; - else if (repeat_min == 0 && repeat_max == 1) - *code++ = OP_CRQUERY + repeat_type; - else - { - *code++ = OP_CRRANGE + repeat_type; - PUT2INC(code, 0, repeat_min); - if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */ - PUT2INC(code, 0, repeat_max); - } - } - - /* If previous was a bracket group, we may have to replicate it in certain - cases. */ - - else if (*previous >= OP_BRA || *previous == OP_ONCE || - *previous == OP_COND) - { - register int i; - int ketoffset = 0; - int len = code - previous; - uschar *bralink = NULL; - - /* If the maximum repeat count is unlimited, find the end of the bracket - by scanning through from the start, and compute the offset back to it - from the current code pointer. There may be an OP_OPT setting following - the final KET, so we can't find the end just by going back from the code - pointer. */ - - if (repeat_max == -1) - { - register uschar *ket = previous; - do ket += GET(ket, 1); while (*ket != OP_KET); - ketoffset = code - ket; - } - - /* The case of a zero minimum is special because of the need to stick - OP_BRAZERO in front of it, and because the group appears once in the - data, whereas in other cases it appears the minimum number of times. For - this reason, it is simplest to treat this case separately, as otherwise - the code gets far too messy. There are several special subcases when the - minimum is zero. */ - - if (repeat_min == 0) - { - /* If the maximum is also zero, we just omit the group from the output - altogether. */ - - if (repeat_max == 0) - { - code = previous; - goto END_REPEAT; - } - - /* If the maximum is 1 or unlimited, we just have to stick in the - BRAZERO and do no more at this point. However, we do need to adjust - any OP_RECURSE calls inside the group that refer to the group itself or - any internal group, because the offset is from the start of the whole - regex. Temporarily terminate the pattern while doing this. */ - - if (repeat_max <= 1) - { - *code = OP_END; - adjust_recurse(previous, 1, utf8, cd); - memmove(previous+1, previous, len); - code++; - *previous++ = OP_BRAZERO + repeat_type; - } - - /* If the maximum is greater than 1 and limited, we have to replicate - in a nested fashion, sticking OP_BRAZERO before each set of brackets. - The first one has to be handled carefully because it's the original - copy, which has to be moved up. The remainder can be handled by code - that is common with the non-zero minimum case below. We have to - adjust the value or repeat_max, since one less copy is required. Once - again, we may have to adjust any OP_RECURSE calls inside the group. */ - - else - { - int offset; - *code = OP_END; - adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd); - memmove(previous + 2 + LINK_SIZE, previous, len); - code += 2 + LINK_SIZE; - *previous++ = OP_BRAZERO + repeat_type; - *previous++ = OP_BRA; - - /* We chain together the bracket offset fields that have to be - filled in later when the ends of the brackets are reached. */ - - offset = (bralink == NULL)? 0 : previous - bralink; - bralink = previous; - PUTINC(previous, 0, offset); - } - - repeat_max--; - } - - /* If the minimum is greater than zero, replicate the group as many - times as necessary, and adjust the maximum to the number of subsequent - copies that we need. If we set a first char from the group, and didn't - set a required char, copy the latter from the former. */ - - else - { - if (repeat_min > 1) - { - if (groupsetfirstbyte && reqbyte < 0) reqbyte = firstbyte; - for (i = 1; i < repeat_min; i++) - { - memcpy(code, previous, len); - code += len; - } - } - if (repeat_max > 0) repeat_max -= repeat_min; - } - - /* This code is common to both the zero and non-zero minimum cases. If - the maximum is limited, it replicates the group in a nested fashion, - remembering the bracket starts on a stack. In the case of a zero minimum, - the first one was set up above. In all cases the repeat_max now specifies - the number of additional copies needed. */ - - if (repeat_max >= 0) - { - for (i = repeat_max - 1; i >= 0; i--) - { - *code++ = OP_BRAZERO + repeat_type; - - /* All but the final copy start a new nesting, maintaining the - chain of brackets outstanding. */ - - if (i != 0) - { - int offset; - *code++ = OP_BRA; - offset = (bralink == NULL)? 0 : code - bralink; - bralink = code; - PUTINC(code, 0, offset); - } - - memcpy(code, previous, len); - code += len; - } - - /* Now chain through the pending brackets, and fill in their length - fields (which are holding the chain links pro tem). */ - - while (bralink != NULL) - { - int oldlinkoffset; - int offset = code - bralink + 1; - uschar *bra = code - offset; - oldlinkoffset = GET(bra, 1); - bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset; - *code++ = OP_KET; - PUTINC(code, 0, offset); - PUT(bra, 1, offset); - } - } - - /* If the maximum is unlimited, set a repeater in the final copy. We - can't just offset backwards from the current code point, because we - don't know if there's been an options resetting after the ket. The - correct offset was computed above. */ - - else code[-ketoffset] = OP_KETRMAX + repeat_type; - } - - /* Else there's some kind of shambles */ - - else - { - *errorcodeptr = ERR11; - goto FAILED; - } - - /* If the character following a repeat is '+', we wrap the entire repeated - item inside OP_ONCE brackets. This is just syntactic sugar, taken from - Sun's Java package. The repeated item starts at tempcode, not at previous, - which might be the first part of a string whose (former) last char we - repeated. However, we don't support '+' after a greediness '?'. */ - - if (possessive_quantifier) - { - int len = code - tempcode; - memmove(tempcode + 1+LINK_SIZE, tempcode, len); - code += 1 + LINK_SIZE; - len += 1 + LINK_SIZE; - tempcode[0] = OP_ONCE; - *code++ = OP_KET; - PUTINC(code, 0, len); - PUT(tempcode, 1, len); - } - - /* In all case we no longer have a previous item. We also set the - "follows varying string" flag for subsequently encountered reqbytes if - it isn't already set and we have just passed a varying length item. */ - - END_REPEAT: - previous = NULL; - cd->req_varyopt |= reqvary; - break; - - - /* Start of nested bracket sub-expression, or comment or lookahead or - lookbehind or option setting or condition. First deal with special things - that can come after a bracket; all are introduced by ?, and the appearance - of any of them means that this is not a referencing group. They were - checked for validity in the first pass over the string, so we don't have to - check for syntax errors here. */ - - case '(': - newoptions = options; - skipbytes = 0; - - if (*(++ptr) == '?') - { - int set, unset; - int *optset; - - switch (*(++ptr)) - { - case '#': /* Comment; skip to ket */ - ptr++; - while (*ptr != ')') ptr++; - continue; - - case ':': /* Non-extracting bracket */ - bravalue = OP_BRA; - ptr++; - break; - - case '(': - bravalue = OP_COND; /* Conditional group */ - - /* Condition to test for recursion */ - - if (ptr[1] == 'R') - { - code[1+LINK_SIZE] = OP_CREF; - PUT2(code, 2+LINK_SIZE, CREF_RECURSE); - skipbytes = 3; - ptr += 3; - } - - /* Condition to test for a numbered subpattern match. We know that - if a digit follows ( then there will just be digits until ) because - the syntax was checked in the first pass. */ - - else if ((digitab[ptr[1]] && ctype_digit) != 0) - { - int condref; /* Don't amalgamate; some compilers */ - condref = *(++ptr) - '0'; /* grumble at autoincrement in declaration */ - while (*(++ptr) != ')') condref = condref*10 + *ptr - '0'; - if (condref == 0) - { - *errorcodeptr = ERR35; - goto FAILED; - } - ptr++; - code[1+LINK_SIZE] = OP_CREF; - PUT2(code, 2+LINK_SIZE, condref); - skipbytes = 3; - } - /* For conditions that are assertions, we just fall through, having - set bravalue above. */ - break; - - case '=': /* Positive lookahead */ - bravalue = OP_ASSERT; - ptr++; - break; - - case '!': /* Negative lookahead */ - bravalue = OP_ASSERT_NOT; - ptr++; - break; - - case '<': /* Lookbehinds */ - switch (*(++ptr)) - { - case '=': /* Positive lookbehind */ - bravalue = OP_ASSERTBACK; - ptr++; - break; - - case '!': /* Negative lookbehind */ - bravalue = OP_ASSERTBACK_NOT; - ptr++; - break; - } - break; - - case '>': /* One-time brackets */ - bravalue = OP_ONCE; - ptr++; - break; - - case 'C': /* Callout - may be followed by digits; */ - previous_callout = code; /* Save for later completion */ - after_manual_callout = 1; /* Skip one item before completing */ - *code++ = OP_CALLOUT; /* Already checked that the terminating */ - { /* closing parenthesis is present. */ - int n = 0; - while ((digitab[*(++ptr)] & ctype_digit) != 0) - n = n * 10 + *ptr - '0'; - if (n > 255) - { - *errorcodeptr = ERR38; - goto FAILED; - } - *code++ = n; - PUT(code, 0, ptr - cd->start_pattern + 1); /* Pattern offset */ - PUT(code, LINK_SIZE, 0); /* Default length */ - code += 2 * LINK_SIZE; - } - previous = NULL; - continue; - - case 'P': /* Named subpattern handling */ - if (*(++ptr) == '<') /* Definition */ - { - int i, namelen; - uschar *slot = cd->name_table; - const uschar *name; /* Don't amalgamate; some compilers */ - name = ++ptr; /* grumble at autoincrement in declaration */ - - while (*ptr++ != '>'); - namelen = ptr - name - 1; - - for (i = 0; i < cd->names_found; i++) - { - int crc = memcmp(name, slot+2, namelen); - if (crc == 0) - { - if (slot[2+namelen] == 0) - { - *errorcodeptr = ERR43; - goto FAILED; - } - crc = -1; /* Current name is substring */ - } - if (crc < 0) - { - memmove(slot + cd->name_entry_size, slot, - (cd->names_found - i) * cd->name_entry_size); - break; - } - slot += cd->name_entry_size; - } - - PUT2(slot, 0, *brackets + 1); - memcpy(slot + 2, name, namelen); - slot[2+namelen] = 0; - cd->names_found++; - goto NUMBERED_GROUP; - } - - if (*ptr == '=' || *ptr == '>') /* Reference or recursion */ - { - int i, namelen; - int type = *ptr++; - const uschar *name = ptr; - uschar *slot = cd->name_table; - - while (*ptr != ')') ptr++; - namelen = ptr - name; - - for (i = 0; i < cd->names_found; i++) - { - if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break; - slot += cd->name_entry_size; - } - if (i >= cd->names_found) - { - *errorcodeptr = ERR15; - goto FAILED; - } - - recno = GET2(slot, 0); - - if (type == '>') goto HANDLE_RECURSION; /* A few lines below */ - - /* Back reference */ - - previous = code; - *code++ = OP_REF; - PUT2INC(code, 0, recno); - cd->backref_map |= (recno < 32)? (1 << recno) : 1; - if (recno > cd->top_backref) cd->top_backref = recno; - continue; - } - - /* Should never happen */ - break; - - case 'R': /* Pattern recursion */ - ptr++; /* Same as (?0) */ - /* Fall through */ - - /* Recursion or "subroutine" call */ - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - { - const uschar *called; - recno = 0; - while((digitab[*ptr] & ctype_digit) != 0) - recno = recno * 10 + *ptr++ - '0'; - - /* Come here from code above that handles a named recursion */ - - HANDLE_RECURSION: - - previous = code; - - /* Find the bracket that is being referenced. Temporarily end the - regex in case it doesn't exist. */ - - *code = OP_END; - called = (recno == 0)? - cd->start_code : find_bracket(cd->start_code, utf8, recno); - - if (called == NULL) - { - *errorcodeptr = ERR15; - goto FAILED; - } - - /* If the subpattern is still open, this is a recursive call. We - check to see if this is a left recursion that could loop for ever, - and diagnose that case. */ - - if (GET(called, 1) == 0 && could_be_empty(called, code, bcptr, utf8)) - { - *errorcodeptr = ERR40; - goto FAILED; - } - - /* Insert the recursion/subroutine item */ - - *code = OP_RECURSE; - PUT(code, 1, called - cd->start_code); - code += 1 + LINK_SIZE; - } - continue; - - /* Character after (? not specially recognized */ - - default: /* Option setting */ - set = unset = 0; - optset = &set; - - while (*ptr != ')' && *ptr != ':') - { - switch (*ptr++) - { - case '-': optset = &unset; break; - - case 'i': *optset |= PCRE_CASELESS; break; - case 'm': *optset |= PCRE_MULTILINE; break; - case 's': *optset |= PCRE_DOTALL; break; - case 'x': *optset |= PCRE_EXTENDED; break; - case 'U': *optset |= PCRE_UNGREEDY; break; - case 'X': *optset |= PCRE_EXTRA; break; - } - } - - /* Set up the changed option bits, but don't change anything yet. */ - - newoptions = (options | set) & (~unset); - - /* If the options ended with ')' this is not the start of a nested - group with option changes, so the options change at this level. Compile - code to change the ims options if this setting actually changes any of - them. We also pass the new setting back so that it can be put at the - start of any following branches, and when this group ends (if we are in - a group), a resetting item can be compiled. - - Note that if this item is right at the start of the pattern, the - options will have been abstracted and made global, so there will be no - change to compile. */ - - if (*ptr == ')') - { - if ((options & PCRE_IMS) != (newoptions & PCRE_IMS)) - { - *code++ = OP_OPT; - *code++ = newoptions & PCRE_IMS; - } - - /* Change options at this level, and pass them back for use - in subsequent branches. Reset the greedy defaults and the case - value for firstbyte and reqbyte. */ - - *optionsptr = options = newoptions; - greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); - greedy_non_default = greedy_default ^ 1; - req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; - - previous = NULL; /* This item can't be repeated */ - continue; /* It is complete */ - } - - /* If the options ended with ':' we are heading into a nested group - with possible change of options. Such groups are non-capturing and are - not assertions of any kind. All we need to do is skip over the ':'; - the newoptions value is handled below. */ - - bravalue = OP_BRA; - ptr++; - } - } - - /* If PCRE_NO_AUTO_CAPTURE is set, all unadorned brackets become - non-capturing and behave like (?:...) brackets */ - - else if ((options & PCRE_NO_AUTO_CAPTURE) != 0) - { - bravalue = OP_BRA; - } - - /* Else we have a referencing group; adjust the opcode. If the bracket - number is greater than EXTRACT_BASIC_MAX, we set the opcode one higher, and - arrange for the true number to follow later, in an OP_BRANUMBER item. */ - - else - { - NUMBERED_GROUP: - if (++(*brackets) > EXTRACT_BASIC_MAX) - { - bravalue = OP_BRA + EXTRACT_BASIC_MAX + 1; - code[1+LINK_SIZE] = OP_BRANUMBER; - PUT2(code, 2+LINK_SIZE, *brackets); - skipbytes = 3; - } - else bravalue = OP_BRA + *brackets; - } - - /* Process nested bracketed re. Assertions may not be repeated, but other - kinds can be. We copy code into a non-register variable in order to be able - to pass its address because some compilers complain otherwise. Pass in a - new setting for the ims options if they have changed. */ - - previous = (bravalue >= OP_ONCE)? code : NULL; - *code = bravalue; - tempcode = code; - tempreqvary = cd->req_varyopt; /* Save value before bracket */ - - if (!compile_regex( - newoptions, /* The complete new option state */ - options & PCRE_IMS, /* The previous ims option state */ - brackets, /* Extracting bracket count */ - &tempcode, /* Where to put code (updated) */ - &ptr, /* Input pointer (updated) */ - errorcodeptr, /* Where to put an error message */ - (bravalue == OP_ASSERTBACK || - bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */ - skipbytes, /* Skip over OP_COND/OP_BRANUMBER */ - &subfirstbyte, /* For possible first char */ - &subreqbyte, /* For possible last char */ - bcptr, /* Current branch chain */ - cd)) /* Tables block */ - goto FAILED; - - /* At the end of compiling, code is still pointing to the start of the - group, while tempcode has been updated to point past the end of the group - and any option resetting that may follow it. The pattern pointer (ptr) - is on the bracket. */ - - /* If this is a conditional bracket, check that there are no more than - two branches in the group. */ - - else if (bravalue == OP_COND) - { - uschar *tc = code; - condcount = 0; - - do { - condcount++; - tc += GET(tc,1); - } - while (*tc != OP_KET); - - if (condcount > 2) - { - *errorcodeptr = ERR27; - goto FAILED; - } - - /* If there is just one branch, we must not make use of its firstbyte or - reqbyte, because this is equivalent to an empty second branch. */ - - if (condcount == 1) subfirstbyte = subreqbyte = REQ_NONE; - } - - /* Handle updating of the required and first characters. Update for normal - brackets of all kinds, and conditions with two branches (see code above). - If the bracket is followed by a quantifier with zero repeat, we have to - back off. Hence the definition of zeroreqbyte and zerofirstbyte outside the - main loop so that they can be accessed for the back off. */ - - zeroreqbyte = reqbyte; - zerofirstbyte = firstbyte; - groupsetfirstbyte = FALSE; - - if (bravalue >= OP_BRA || bravalue == OP_ONCE || bravalue == OP_COND) - { - /* If we have not yet set a firstbyte in this branch, take it from the - subpattern, remembering that it was set here so that a repeat of more - than one can replicate it as reqbyte if necessary. If the subpattern has - no firstbyte, set "none" for the whole branch. In both cases, a zero - repeat forces firstbyte to "none". */ - - if (firstbyte == REQ_UNSET) - { - if (subfirstbyte >= 0) - { - firstbyte = subfirstbyte; - groupsetfirstbyte = TRUE; - } - else firstbyte = REQ_NONE; - zerofirstbyte = REQ_NONE; - } - - /* If firstbyte was previously set, convert the subpattern's firstbyte - into reqbyte if there wasn't one, using the vary flag that was in - existence beforehand. */ - - else if (subfirstbyte >= 0 && subreqbyte < 0) - subreqbyte = subfirstbyte | tempreqvary; - - /* If the subpattern set a required byte (or set a first byte that isn't - really the first byte - see above), set it. */ - - if (subreqbyte >= 0) reqbyte = subreqbyte; - } - - /* For a forward assertion, we take the reqbyte, if set. This can be - helpful if the pattern that follows the assertion doesn't set a different - char. For example, it's useful for /(?=abcde).+/. We can't set firstbyte - for an assertion, however because it leads to incorrect effect for patterns - such as /(?=a)a.+/ when the "real" "a" would then become a reqbyte instead - of a firstbyte. This is overcome by a scan at the end if there's no - firstbyte, looking for an asserted first char. */ - - else if (bravalue == OP_ASSERT && subreqbyte >= 0) reqbyte = subreqbyte; - - /* Now update the main code pointer to the end of the group. */ - - code = tempcode; - - /* Error if hit end of pattern */ - - if (*ptr != ')') - { - *errorcodeptr = ERR14; - goto FAILED; - } - break; - - /* Check \ for being a real metacharacter; if not, fall through and handle - it as a data character at the start of a string. Escape items are checked - for validity in the pre-compiling pass. */ - - case '\\': - tempptr = ptr; - c = check_escape(&ptr, errorcodeptr, *brackets, options, FALSE); - - /* Handle metacharacters introduced by \. For ones like \d, the ESC_ values - are arranged to be the negation of the corresponding OP_values. For the - back references, the values are ESC_REF plus the reference number. Only - back references and those types that consume a character may be repeated. - We can test for values between ESC_b and ESC_Z for the latter; this may - have to change if any new ones are ever created. */ - - if (c < 0) - { - if (-c == ESC_Q) /* Handle start of quoted string */ - { - if (ptr[1] == '\\' && ptr[2] == 'E') ptr += 2; /* avoid empty string */ - else inescq = TRUE; - continue; - } - - /* For metasequences that actually match a character, we disable the - setting of a first character if it hasn't already been set. */ - - if (firstbyte == REQ_UNSET && -c > ESC_b && -c < ESC_Z) - firstbyte = REQ_NONE; - - /* Set values to reset to if this is followed by a zero repeat. */ - - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; - - /* Back references are handled specially */ - - if (-c >= ESC_REF) - { - int number = -c - ESC_REF; - previous = code; - *code++ = OP_REF; - PUT2INC(code, 0, number); - } - - /* So are Unicode property matches, if supported. We know that get_ucp - won't fail because it was tested in the pre-pass. */ - -#ifdef SUPPORT_UCP - else if (-c == ESC_P || -c == ESC_p) - { - BOOL negated; - int value = get_ucp(&ptr, &negated, errorcodeptr); - previous = code; - *code++ = ((-c == ESC_p) != negated)? OP_PROP : OP_NOTPROP; - *code++ = value; - } -#endif - - /* For the rest, we can obtain the OP value by negating the escape - value */ - - else - { - previous = (-c > ESC_b && -c < ESC_Z)? code : NULL; - *code++ = -c; - } - continue; - } - - /* We have a data character whose value is in c. In UTF-8 mode it may have - a value > 127. We set its representation in the length/buffer, and then - handle it as a data character. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && c > 127) - mclength = _pcre_ord2utf8(c, mcbuffer); - else -#endif - - { - mcbuffer[0] = c; - mclength = 1; - } - - goto ONE_CHAR; - - /* Handle a literal character. It is guaranteed not to be whitespace or # - when the extended flag is set. If we are in UTF-8 mode, it may be a - multi-byte literal character. */ - - default: - NORMAL_CHAR: - mclength = 1; - mcbuffer[0] = c; - -#ifdef SUPPORT_UTF8 - if (utf8 && (c & 0xc0) == 0xc0) - { - while ((ptr[1] & 0xc0) == 0x80) - mcbuffer[mclength++] = *(++ptr); - } -#endif - - /* At this point we have the character's bytes in mcbuffer, and the length - in mclength. When not in UTF-8 mode, the length is always 1. */ - - ONE_CHAR: - previous = code; - *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARNC : OP_CHAR; - for (c = 0; c < mclength; c++) *code++ = mcbuffer[c]; - - /* Set the first and required bytes appropriately. If no previous first - byte, set it from this character, but revert to none on a zero repeat. - Otherwise, leave the firstbyte value alone, and don't change it on a zero - repeat. */ - - if (firstbyte == REQ_UNSET) - { - zerofirstbyte = REQ_NONE; - zeroreqbyte = reqbyte; - - /* If the character is more than one byte long, we can set firstbyte - only if it is not to be matched caselessly. */ - - if (mclength == 1 || req_caseopt == 0) - { - firstbyte = mcbuffer[0] | req_caseopt; - if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt; - } - else firstbyte = reqbyte = REQ_NONE; - } - - /* firstbyte was previously set; we can set reqbyte only the length is - 1 or the matching is caseful. */ - - else - { - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; - if (mclength == 1 || req_caseopt == 0) - reqbyte = code[-1] | req_caseopt | cd->req_varyopt; - } - - break; /* End of literal character handling */ - } - } /* end of big loop */ - -/* Control never reaches here by falling through, only by a goto for all the -error states. Pass back the position in the pattern so that it can be displayed -to the user for diagnosing the error. */ - -FAILED: -*ptrptr = ptr; -return FALSE; -} - - - - -/************************************************* -* Compile sequence of alternatives * -*************************************************/ - -/* On entry, ptr is pointing past the bracket character, but on return -it points to the closing bracket, or vertical bar, or end of string. -The code variable is pointing at the byte into which the BRA operator has been -stored. If the ims options are changed at the start (for a (?ims: group) or -during any branch, we need to insert an OP_OPT item at the start of every -following branch to ensure they get set correctly at run time, and also pass -the new options into every subsequent branch compile. - -Argument: - options option bits, including any changes for this subpattern - oldims previous settings of ims option bits - brackets -> int containing the number of extracting brackets used - codeptr -> the address of the current code pointer - ptrptr -> the address of the current pattern pointer - errorcodeptr -> pointer to error code variable - lookbehind TRUE if this is a lookbehind assertion - skipbytes skip this many bytes at start (for OP_COND, OP_BRANUMBER) - firstbyteptr place to put the first required character, or a negative number - reqbyteptr place to put the last required character, or a negative number - bcptr pointer to the chain of currently open branches - cd points to the data block with tables pointers etc. - -Returns: TRUE on success -*/ - -static BOOL -compile_regex(int options, int oldims, int *brackets, uschar **codeptr, - const uschar **ptrptr, int *errorcodeptr, BOOL lookbehind, int skipbytes, - int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd) -{ -const uschar *ptr = *ptrptr; -uschar *code = *codeptr; -uschar *last_branch = code; -uschar *start_bracket = code; -uschar *reverse_count = NULL; -int firstbyte, reqbyte; -int branchfirstbyte, branchreqbyte; -branch_chain bc; - -bc.outer = bcptr; -bc.current = code; - -firstbyte = reqbyte = REQ_UNSET; - -/* Offset is set zero to mark that this bracket is still open */ - -PUT(code, 1, 0); -code += 1 + LINK_SIZE + skipbytes; - -/* Loop for each alternative branch */ - -for (;;) - { - /* Handle a change of ims options at the start of the branch */ - - if ((options & PCRE_IMS) != oldims) - { - *code++ = OP_OPT; - *code++ = options & PCRE_IMS; - } - - /* Set up dummy OP_REVERSE if lookbehind assertion */ - - if (lookbehind) - { - *code++ = OP_REVERSE; - reverse_count = code; - PUTINC(code, 0, 0); - } - - /* Now compile the branch */ - - if (!compile_branch(&options, brackets, &code, &ptr, errorcodeptr, - &branchfirstbyte, &branchreqbyte, &bc, cd)) - { - *ptrptr = ptr; - return FALSE; - } - - /* If this is the first branch, the firstbyte and reqbyte values for the - branch become the values for the regex. */ - - if (*last_branch != OP_ALT) - { - firstbyte = branchfirstbyte; - reqbyte = branchreqbyte; - } - - /* If this is not the first branch, the first char and reqbyte have to - match the values from all the previous branches, except that if the previous - value for reqbyte didn't have REQ_VARY set, it can still match, and we set - REQ_VARY for the regex. */ - - else - { - /* If we previously had a firstbyte, but it doesn't match the new branch, - we have to abandon the firstbyte for the regex, but if there was previously - no reqbyte, it takes on the value of the old firstbyte. */ - - if (firstbyte >= 0 && firstbyte != branchfirstbyte) - { - if (reqbyte < 0) reqbyte = firstbyte; - firstbyte = REQ_NONE; - } - - /* If we (now or from before) have no firstbyte, a firstbyte from the - branch becomes a reqbyte if there isn't a branch reqbyte. */ - - if (firstbyte < 0 && branchfirstbyte >= 0 && branchreqbyte < 0) - branchreqbyte = branchfirstbyte; - - /* Now ensure that the reqbytes match */ - - if ((reqbyte & ~REQ_VARY) != (branchreqbyte & ~REQ_VARY)) - reqbyte = REQ_NONE; - else reqbyte |= branchreqbyte; /* To "or" REQ_VARY */ - } - - /* If lookbehind, check that this branch matches a fixed-length string, - and put the length into the OP_REVERSE item. Temporarily mark the end of - the branch with OP_END. */ - - if (lookbehind) - { - int length; - *code = OP_END; - length = find_fixedlength(last_branch, options); - DPRINTF(("fixed length = %d\n", length)); - if (length < 0) - { - *errorcodeptr = (length == -2)? ERR36 : ERR25; - *ptrptr = ptr; - return FALSE; - } - PUT(reverse_count, 0, length); - } - - /* Reached end of expression, either ')' or end of pattern. Go back through - the alternative branches and reverse the chain of offsets, with the field in - the BRA item now becoming an offset to the first alternative. If there are - no alternatives, it points to the end of the group. The length in the - terminating ket is always the length of the whole bracketed item. If any of - the ims options were changed inside the group, compile a resetting op-code - following, except at the very end of the pattern. Return leaving the pointer - at the terminating char. */ - - if (*ptr != '|') - { - int length = code - last_branch; - do - { - int prev_length = GET(last_branch, 1); - PUT(last_branch, 1, length); - length = prev_length; - last_branch -= length; - } - while (length > 0); - - /* Fill in the ket */ - - *code = OP_KET; - PUT(code, 1, code - start_bracket); - code += 1 + LINK_SIZE; - - /* Resetting option if needed */ - - if ((options & PCRE_IMS) != oldims && *ptr == ')') - { - *code++ = OP_OPT; - *code++ = oldims; - } - - /* Set values to pass back */ - - *codeptr = code; - *ptrptr = ptr; - *firstbyteptr = firstbyte; - *reqbyteptr = reqbyte; - return TRUE; - } - - /* Another branch follows; insert an "or" node. Its length field points back - to the previous branch while the bracket remains open. At the end the chain - is reversed. It's done like this so that the start of the bracket has a - zero offset until it is closed, making it possible to detect recursion. */ - - *code = OP_ALT; - PUT(code, 1, code - last_branch); - bc.current = last_branch = code; - code += 1 + LINK_SIZE; - ptr++; - } -/* Control never reaches here */ -} - - - - -/************************************************* -* Check for anchored expression * -*************************************************/ - -/* Try to find out if this is an anchored regular expression. Consider each -alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket -all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then -it's anchored. However, if this is a multiline pattern, then only OP_SOD -counts, since OP_CIRC can match in the middle. - -We can also consider a regex to be anchored if OP_SOM starts all its branches. -This is the code for \G, which means "match at start of match position, taking -into account the match offset". - -A branch is also implicitly anchored if it starts with .* and DOTALL is set, -because that will try the rest of the pattern at all possible matching points, -so there is no point trying again.... er .... - -.... except when the .* appears inside capturing parentheses, and there is a -subsequent back reference to those parentheses. We haven't enough information -to catch that case precisely. - -At first, the best we could do was to detect when .* was in capturing brackets -and the highest back reference was greater than or equal to that level. -However, by keeping a bitmap of the first 31 back references, we can catch some -of the more common cases more precisely. - -Arguments: - code points to start of expression (the bracket) - options points to the options setting - bracket_map a bitmap of which brackets we are inside while testing; this - handles up to substring 31; after that we just have to take - the less precise approach - backref_map the back reference bitmap - -Returns: TRUE or FALSE -*/ - -static BOOL -is_anchored(register const uschar *code, int *options, unsigned int bracket_map, - unsigned int backref_map) -{ -do { - const uschar *scode = - first_significant_code(code + 1+LINK_SIZE, options, PCRE_MULTILINE, FALSE); - register int op = *scode; - - /* Capturing brackets */ - - if (op > OP_BRA) - { - int new_map; - op -= OP_BRA; - if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE); - new_map = bracket_map | ((op < 32)? (1 << op) : 1); - if (!is_anchored(scode, options, new_map, backref_map)) return FALSE; - } - - /* Other brackets */ - - else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) - { - if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE; - } - - /* .* is not anchored unless DOTALL is set and it isn't in brackets that - are or may be referenced. */ - - else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) && - (*options & PCRE_DOTALL) != 0) - { - if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE; - } - - /* Check for explicit anchoring */ - - else if (op != OP_SOD && op != OP_SOM && - ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC)) - return FALSE; - code += GET(code, 1); - } -while (*code == OP_ALT); /* Loop for each alternative */ -return TRUE; -} - - - -/************************************************* -* Check for starting with ^ or .* * -*************************************************/ - -/* This is called to find out if every branch starts with ^ or .* so that -"first char" processing can be done to speed things up in multiline -matching and for non-DOTALL patterns that start with .* (which must start at -the beginning or after \n). As in the case of is_anchored() (see above), we -have to take account of back references to capturing brackets that contain .* -because in that case we can't make the assumption. - -Arguments: - code points to start of expression (the bracket) - bracket_map a bitmap of which brackets we are inside while testing; this - handles up to substring 31; after that we just have to take - the less precise approach - backref_map the back reference bitmap - -Returns: TRUE or FALSE -*/ - -static BOOL -is_startline(const uschar *code, unsigned int bracket_map, - unsigned int backref_map) -{ -do { - const uschar *scode = first_significant_code(code + 1+LINK_SIZE, NULL, 0, - FALSE); - register int op = *scode; - - /* Capturing brackets */ - - if (op > OP_BRA) - { - int new_map; - op -= OP_BRA; - if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE); - new_map = bracket_map | ((op < 32)? (1 << op) : 1); - if (!is_startline(scode, new_map, backref_map)) return FALSE; - } - - /* Other brackets */ - - else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) - { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; } - - /* .* means "start at start or after \n" if it isn't in brackets that - may be referenced. */ - - else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR) - { - if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE; - } - - /* Check for explicit circumflex */ - - else if (op != OP_CIRC) return FALSE; - - /* Move on to the next alternative */ - - code += GET(code, 1); - } -while (*code == OP_ALT); /* Loop for each alternative */ -return TRUE; -} - - - -/************************************************* -* Check for asserted fixed first char * -*************************************************/ - -/* During compilation, the "first char" settings from forward assertions are -discarded, because they can cause conflicts with actual literals that follow. -However, if we end up without a first char setting for an unanchored pattern, -it is worth scanning the regex to see if there is an initial asserted first -char. If all branches start with the same asserted char, or with a bracket all -of whose alternatives start with the same asserted char (recurse ad lib), then -we return that char, otherwise -1. - -Arguments: - code points to start of expression (the bracket) - options pointer to the options (used to check casing changes) - inassert TRUE if in an assertion - -Returns: -1 or the fixed first char -*/ - -static int -find_firstassertedchar(const uschar *code, int *options, BOOL inassert) -{ -register int c = -1; -do { - int d; - const uschar *scode = - first_significant_code(code + 1+LINK_SIZE, options, PCRE_CASELESS, TRUE); - register int op = *scode; - - if (op >= OP_BRA) op = OP_BRA; - - switch(op) - { - default: - return -1; - - case OP_BRA: - case OP_ASSERT: - case OP_ONCE: - case OP_COND: - if ((d = find_firstassertedchar(scode, options, op == OP_ASSERT)) < 0) - return -1; - if (c < 0) c = d; else if (c != d) return -1; - break; - - case OP_EXACT: /* Fall through */ - scode += 2; - - case OP_CHAR: - case OP_CHARNC: - case OP_PLUS: - case OP_MINPLUS: - if (!inassert) return -1; - if (c < 0) - { - c = scode[1]; - if ((*options & PCRE_CASELESS) != 0) c |= REQ_CASELESS; - } - else if (c != scode[1]) return -1; - break; - } - - code += GET(code, 1); - } -while (*code == OP_ALT); -return c; -} - - - -/************************************************* -* Compile a Regular Expression * -*************************************************/ - -/* This function takes a string and returns a pointer to a block of store -holding a compiled version of the expression. The original API for this -function had no error code return variable; it is retained for backwards -compatibility. The new function is given a new name. - -Arguments: - pattern the regular expression - options various option bits - errorcodeptr pointer to error code variable (pcre_compile2() only) - can be NULL if you don't want a code value - errorptr pointer to pointer to error text - erroroffset ptr offset in pattern where error was detected - tables pointer to character tables or NULL - -Returns: pointer to compiled data block, or NULL on error, - with errorptr and erroroffset set -*/ - -EXPORT pcre * -pcre_compile(const char *pattern, int options, const char **errorptr, - int *erroroffset, const unsigned char *tables) -{ -return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables); -} - - -EXPORT pcre * -pcre_compile2(const char *pattern, int options, int *errorcodeptr, - const char **errorptr, int *erroroffset, const unsigned char *tables) -{ -real_pcre *re; -int length = 1 + LINK_SIZE; /* For initial BRA plus length */ -int c, firstbyte, reqbyte; -int bracount = 0; -int branch_extra = 0; -int branch_newextra; -int item_count = -1; -int name_count = 0; -int max_name_size = 0; -int lastitemlength = 0; -int errorcode = 0; -#ifdef SUPPORT_UTF8 -BOOL utf8; -BOOL class_utf8; -#endif -BOOL inescq = FALSE; -BOOL capturing; -unsigned int brastackptr = 0; -size_t size; -uschar *code; -const uschar *codestart; -const uschar *ptr; -compile_data compile_block; -int brastack[BRASTACK_SIZE]; -uschar bralenstack[BRASTACK_SIZE]; - -/* We can't pass back an error message if errorptr is NULL; I guess the best we -can do is just return NULL, but we can set a code value if there is a code -pointer. */ - -if (errorptr == NULL) - { - if (errorcodeptr != NULL) *errorcodeptr = 99; - return NULL; - } - -*errorptr = NULL; -if (errorcodeptr != NULL) *errorcodeptr = ERR0; - -/* However, we can give a message for this error */ - -if (erroroffset == NULL) - { - errorcode = ERR16; - goto PCRE_EARLY_ERROR_RETURN; - } - -*erroroffset = 0; - -/* Can't support UTF8 unless PCRE has been compiled to include the code. */ - -#ifdef SUPPORT_UTF8 -utf8 = (options & PCRE_UTF8) != 0; -if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 && - (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0) - { - errorcode = ERR44; - goto PCRE_EARLY_ERROR_RETURN; - } -#else -if ((options & PCRE_UTF8) != 0) - { - errorcode = ERR32; - goto PCRE_EARLY_ERROR_RETURN; - } -#endif - -if ((options & ~PUBLIC_OPTIONS) != 0) - { - errorcode = ERR17; - goto PCRE_EARLY_ERROR_RETURN; - } - -/* Set up pointers to the individual character tables */ - -if (tables == NULL) tables = _pcre_default_tables; -compile_block.lcc = tables + lcc_offset; -compile_block.fcc = tables + fcc_offset; -compile_block.cbits = tables + cbits_offset; -compile_block.ctypes = tables + ctypes_offset; - -/* Maximum back reference and backref bitmap. This is updated for numeric -references during the first pass, but for named references during the actual -compile pass. The bitmap records up to 31 back references to help in deciding -whether (.*) can be treated as anchored or not. */ - -compile_block.top_backref = 0; -compile_block.backref_map = 0; - -/* Reflect pattern for debugging output */ - -DPRINTF(("------------------------------------------------------------------\n")); -DPRINTF(("%s\n", pattern)); - -/* The first thing to do is to make a pass over the pattern to compute the -amount of store required to hold the compiled code. This does not have to be -perfect as long as errors are overestimates. At the same time we can detect any -flag settings right at the start, and extract them. Make an attempt to correct -for any counted white space if an "extended" flag setting appears late in the -pattern. We can't be so clever for #-comments. */ - -ptr = (const uschar *)(pattern - 1); -while ((c = *(++ptr)) != 0) - { - int min, max; - int class_optcount; - int bracket_length; - int duplength; - - /* If we are inside a \Q...\E sequence, all chars are literal */ - - if (inescq) - { - if ((options & PCRE_AUTO_CALLOUT) != 0) length += 2 + 2*LINK_SIZE; - goto NORMAL_CHAR; - } - - /* Otherwise, first check for ignored whitespace and comments */ - - if ((options & PCRE_EXTENDED) != 0) - { - if ((compile_block.ctypes[c] & ctype_space) != 0) continue; - if (c == '#') - { - /* The space before the ; is to avoid a warning on a silly compiler - on the Macintosh. */ - while ((c = *(++ptr)) != 0 && c != NEWLINE) ; - if (c == 0) break; - continue; - } - } - - item_count++; /* Is zero for the first non-comment item */ - - /* Allow space for auto callout before every item except quantifiers. */ - - if ((options & PCRE_AUTO_CALLOUT) != 0 && - c != '*' && c != '+' && c != '?' && - (c != '{' || !is_counted_repeat(ptr + 1))) - length += 2 + 2*LINK_SIZE; - - switch(c) - { - /* A backslashed item may be an escaped data character or it may be a - character type. */ - - case '\\': - c = check_escape(&ptr, &errorcode, bracount, options, FALSE); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - - lastitemlength = 1; /* Default length of last item for repeats */ - - if (c >= 0) /* Data character */ - { - length += 2; /* For a one-byte character */ - -#ifdef SUPPORT_UTF8 - if (utf8 && c > 127) - { - int i; - for (i = 0; i < _pcre_utf8_table1_size; i++) - if (c <= _pcre_utf8_table1[i]) break; - length += i; - lastitemlength += i; - } -#endif - - continue; - } - - /* If \Q, enter "literal" mode */ - - if (-c == ESC_Q) - { - inescq = TRUE; - continue; - } - - /* \X is supported only if Unicode property support is compiled */ - -#ifndef SUPPORT_UCP - if (-c == ESC_X) - { - errorcode = ERR45; - goto PCRE_ERROR_RETURN; - } -#endif - - /* \P and \p are for Unicode properties, but only when the support has - been compiled. Each item needs 2 bytes. */ - - else if (-c == ESC_P || -c == ESC_p) - { -#ifdef SUPPORT_UCP - BOOL negated; - length += 2; - lastitemlength = 2; - if (get_ucp(&ptr, &negated, &errorcode) < 0) goto PCRE_ERROR_RETURN; - continue; -#else - errorcode = ERR45; - goto PCRE_ERROR_RETURN; -#endif - } - - /* Other escapes need one byte */ - - length++; - - /* A back reference needs an additional 2 bytes, plus either one or 5 - bytes for a repeat. We also need to keep the value of the highest - back reference. */ - - if (c <= -ESC_REF) - { - int refnum = -c - ESC_REF; - compile_block.backref_map |= (refnum < 32)? (1 << refnum) : 1; - if (refnum > compile_block.top_backref) - compile_block.top_backref = refnum; - length += 2; /* For single back reference */ - if (ptr[1] == '{' && is_counted_repeat(ptr+2)) - { - ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - if ((min == 0 && (max == 1 || max == -1)) || - (min == 1 && max == -1)) - length++; - else length += 5; - if (ptr[1] == '?') ptr++; - } - } - continue; - - case '^': /* Single-byte metacharacters */ - case '.': - case '$': - length++; - lastitemlength = 1; - continue; - - case '*': /* These repeats won't be after brackets; */ - case '+': /* those are handled separately */ - case '?': - length++; - goto POSESSIVE; /* A few lines below */ - - /* This covers the cases of braced repeats after a single char, metachar, - class, or back reference. */ - - case '{': - if (!is_counted_repeat(ptr+1)) goto NORMAL_CHAR; - ptr = read_repeat_counts(ptr+1, &min, &max, &errorcode); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - - /* These special cases just insert one extra opcode */ - - if ((min == 0 && (max == 1 || max == -1)) || - (min == 1 && max == -1)) - length++; - - /* These cases might insert additional copies of a preceding character. */ - - else - { - if (min != 1) - { - length -= lastitemlength; /* Uncount the original char or metachar */ - if (min > 0) length += 3 + lastitemlength; - } - length += lastitemlength + ((max > 0)? 3 : 1); - } - - if (ptr[1] == '?') ptr++; /* Needs no extra length */ - - POSESSIVE: /* Test for possessive quantifier */ - if (ptr[1] == '+') - { - ptr++; - length += 2 + 2*LINK_SIZE; /* Allow for atomic brackets */ - } - continue; - - /* An alternation contains an offset to the next branch or ket. If any ims - options changed in the previous branch(es), and/or if we are in a - lookbehind assertion, extra space will be needed at the start of the - branch. This is handled by branch_extra. */ - - case '|': - length += 1 + LINK_SIZE + branch_extra; - continue; - - /* A character class uses 33 characters provided that all the character - values are less than 256. Otherwise, it uses a bit map for low valued - characters, and individual items for others. Don't worry about character - types that aren't allowed in classes - they'll get picked up during the - compile. A character class that contains only one single-byte character - uses 2 or 3 bytes, depending on whether it is negated or not. Notice this - where we can. (In UTF-8 mode we can do this only for chars < 128.) */ - - case '[': - if (*(++ptr) == '^') - { - class_optcount = 10; /* Greater than one */ - ptr++; - } - else class_optcount = 0; - -#ifdef SUPPORT_UTF8 - class_utf8 = FALSE; -#endif - - /* Written as a "do" so that an initial ']' is taken as data */ - - if (*ptr != 0) do - { - /* Inside \Q...\E everything is literal except \E */ - - if (inescq) - { - if (*ptr != '\\' || ptr[1] != 'E') goto GET_ONE_CHARACTER; - inescq = FALSE; - ptr += 1; - continue; - } - - /* Outside \Q...\E, check for escapes */ - - if (*ptr == '\\') - { - c = check_escape(&ptr, &errorcode, bracount, options, TRUE); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - - /* \b is backspace inside a class; \X is literal */ - - if (-c == ESC_b) c = '\b'; - else if (-c == ESC_X) c = 'X'; - - /* \Q enters quoting mode */ - - else if (-c == ESC_Q) - { - inescq = TRUE; - continue; - } - - /* Handle escapes that turn into characters */ - - if (c >= 0) goto NON_SPECIAL_CHARACTER; - - /* Escapes that are meta-things. The normal ones just affect the - bit map, but Unicode properties require an XCLASS extended item. */ - - else - { - class_optcount = 10; /* \d, \s etc; make sure > 1 */ -#ifdef SUPPORT_UTF8 - if (-c == ESC_p || -c == ESC_P) - { - if (!class_utf8) - { - class_utf8 = TRUE; - length += LINK_SIZE + 2; - } - length += 2; - } -#endif - } - } - - /* Check the syntax for POSIX stuff. The bits we actually handle are - checked during the real compile phase. */ - - else if (*ptr == '[' && check_posix_syntax(ptr, &ptr, &compile_block)) - { - ptr++; - class_optcount = 10; /* Make sure > 1 */ - } - - /* Anything else increments the possible optimization count. We have to - detect ranges here so that we can compute the number of extra ranges for - caseless wide characters when UCP support is available. If there are wide - characters, we are going to have to use an XCLASS, even for single - characters. */ - - else - { - int d; - - GET_ONE_CHARACTER: - -#ifdef SUPPORT_UTF8 - if (utf8) - { - int extra = 0; - GETCHARLEN(c, ptr, extra); - ptr += extra; - } - else c = *ptr; -#else - c = *ptr; -#endif - - /* Come here from handling \ above when it escapes to a char value */ - - NON_SPECIAL_CHARACTER: - class_optcount++; - - d = -1; - if (ptr[1] == '-') - { - uschar const *hyptr = ptr++; - if (ptr[1] == '\\') - { - ptr++; - d = check_escape(&ptr, &errorcode, bracount, options, TRUE); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - if (-d == ESC_b) d = '\b'; /* backspace */ - else if (-d == ESC_X) d = 'X'; /* literal X in a class */ - } - else if (ptr[1] != 0 && ptr[1] != ']') - { - ptr++; -#ifdef SUPPORT_UTF8 - if (utf8) - { - int extra = 0; - GETCHARLEN(d, ptr, extra); - ptr += extra; - } - else -#endif - d = *ptr; - } - if (d < 0) ptr = hyptr; /* go back to hyphen as data */ - } - - /* If d >= 0 we have a range. In UTF-8 mode, if the end is > 255, or > - 127 for caseless matching, we will need to use an XCLASS. */ - - if (d >= 0) - { - class_optcount = 10; /* Ensure > 1 */ - if (d < c) - { - errorcode = ERR8; - goto PCRE_ERROR_RETURN; - } - -#ifdef SUPPORT_UTF8 - if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) - { - uschar buffer[6]; - if (!class_utf8) /* Allow for XCLASS overhead */ - { - class_utf8 = TRUE; - length += LINK_SIZE + 2; - } - -#ifdef SUPPORT_UCP - /* If we have UCP support, find out how many extra ranges are - needed to map the other case of characters within this range. We - have to mimic the range optimization here, because extending the - range upwards might push d over a boundary that makes is use - another byte in the UTF-8 representation. */ - - if ((options & PCRE_CASELESS) != 0) - { - int occ, ocd; - int cc = c; - int origd = d; - while (get_othercase_range(&cc, origd, &occ, &ocd)) - { - if (occ >= c && ocd <= d) continue; /* Skip embedded */ - - if (occ < c && ocd >= c - 1) /* Extend the basic range */ - { /* if there is overlap, */ - c = occ; /* noting that if occ < c */ - continue; /* we can't have ocd > d */ - } /* because a subrange is */ - if (ocd > d && occ <= d + 1) /* always shorter than */ - { /* the basic range. */ - d = ocd; - continue; - } - - /* An extra item is needed */ - - length += 1 + _pcre_ord2utf8(occ, buffer) + - ((occ == ocd)? 0 : _pcre_ord2utf8(ocd, buffer)); - } - } -#endif /* SUPPORT_UCP */ - - /* The length of the (possibly extended) range */ - - length += 1 + _pcre_ord2utf8(c, buffer) + _pcre_ord2utf8(d, buffer); - } -#endif /* SUPPORT_UTF8 */ - - } - - /* We have a single character. There is nothing to be done unless we - are in UTF-8 mode. If the char is > 255, or 127 when caseless, we must - allow for an XCL_SINGLE item, doubled for caselessness if there is UCP - support. */ - - else - { -#ifdef SUPPORT_UTF8 - if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) - { - uschar buffer[6]; - class_optcount = 10; /* Ensure > 1 */ - if (!class_utf8) /* Allow for XCLASS overhead */ - { - class_utf8 = TRUE; - length += LINK_SIZE + 2; - } -#ifdef SUPPORT_UCP - length += (((options & PCRE_CASELESS) != 0)? 2 : 1) * - (1 + _pcre_ord2utf8(c, buffer)); -#else /* SUPPORT_UCP */ - length += 1 + _pcre_ord2utf8(c, buffer); -#endif /* SUPPORT_UCP */ - } -#endif /* SUPPORT_UTF8 */ - } - } - } - while (*(++ptr) != 0 && (inescq || *ptr != ']')); /* Concludes "do" above */ - - if (*ptr == 0) /* Missing terminating ']' */ - { - errorcode = ERR6; - goto PCRE_ERROR_RETURN; - } - - /* We can optimize when there was only one optimizable character. Repeats - for positive and negated single one-byte chars are handled by the general - code. Here, we handle repeats for the class opcodes. */ - - if (class_optcount == 1) length += 3; else - { - length += 33; - - /* A repeat needs either 1 or 5 bytes. If it is a possessive quantifier, - we also need extra for wrapping the whole thing in a sub-pattern. */ - - if (*ptr != 0 && ptr[1] == '{' && is_counted_repeat(ptr+2)) - { - ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - if ((min == 0 && (max == 1 || max == -1)) || - (min == 1 && max == -1)) - length++; - else length += 5; - if (ptr[1] == '+') - { - ptr++; - length += 2 + 2*LINK_SIZE; - } - else if (ptr[1] == '?') ptr++; - } - } - continue; - - /* Brackets may be genuine groups or special things */ - - case '(': - branch_newextra = 0; - bracket_length = 1 + LINK_SIZE; - capturing = FALSE; - - /* Handle special forms of bracket, which all start (? */ - - if (ptr[1] == '?') - { - int set, unset; - int *optset; - - switch (c = ptr[2]) - { - /* Skip over comments entirely */ - case '#': - ptr += 3; - while (*ptr != 0 && *ptr != ')') ptr++; - if (*ptr == 0) - { - errorcode = ERR18; - goto PCRE_ERROR_RETURN; - } - continue; - - /* Non-referencing groups and lookaheads just move the pointer on, and - then behave like a non-special bracket, except that they don't increment - the count of extracting brackets. Ditto for the "once only" bracket, - which is in Perl from version 5.005. */ - - case ':': - case '=': - case '!': - case '>': - ptr += 2; - break; - - /* (?R) specifies a recursive call to the regex, which is an extension - to provide the facility which can be obtained by (?p{perl-code}) in - Perl 5.6. In Perl 5.8 this has become (??{perl-code}). - - From PCRE 4.00, items such as (?3) specify subroutine-like "calls" to - the appropriate numbered brackets. This includes both recursive and - non-recursive calls. (?R) is now synonymous with (?0). */ - - case 'R': - ptr++; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - ptr += 2; - if (c != 'R') - while ((digitab[*(++ptr)] & ctype_digit) != 0); - if (*ptr != ')') - { - errorcode = ERR29; - goto PCRE_ERROR_RETURN; - } - length += 1 + LINK_SIZE; - - /* If this item is quantified, it will get wrapped inside brackets so - as to use the code for quantified brackets. We jump down and use the - code that handles this for real brackets. */ - - if (ptr[1] == '+' || ptr[1] == '*' || ptr[1] == '?' || ptr[1] == '{') - { - length += 2 + 2 * LINK_SIZE; /* to make bracketed */ - duplength = 5 + 3 * LINK_SIZE; - goto HANDLE_QUANTIFIED_BRACKETS; - } - continue; - - /* (?C) is an extension which provides "callout" - to provide a bit of - the functionality of the Perl (?{...}) feature. An optional number may - follow (default is zero). */ - - case 'C': - ptr += 2; - while ((digitab[*(++ptr)] & ctype_digit) != 0); - if (*ptr != ')') - { - errorcode = ERR39; - goto PCRE_ERROR_RETURN; - } - length += 2 + 2*LINK_SIZE; - continue; - - /* Named subpatterns are an extension copied from Python */ - - case 'P': - ptr += 3; - - /* Handle the definition of a named subpattern */ - - if (*ptr == '<') - { - const uschar *p; /* Don't amalgamate; some compilers */ - p = ++ptr; /* grumble at autoincrement in declaration */ - while ((compile_block.ctypes[*ptr] & ctype_word) != 0) ptr++; - if (*ptr != '>') - { - errorcode = ERR42; - goto PCRE_ERROR_RETURN; - } - name_count++; - if (ptr - p > max_name_size) max_name_size = (ptr - p); - capturing = TRUE; /* Named parentheses are always capturing */ - break; - } - - /* Handle back references and recursive calls to named subpatterns */ - - if (*ptr == '=' || *ptr == '>') - { - while ((compile_block.ctypes[*(++ptr)] & ctype_word) != 0); - if (*ptr != ')') - { - errorcode = ERR42; - goto PCRE_ERROR_RETURN; - } - break; - } - - /* Unknown character after (?P */ - - errorcode = ERR41; - goto PCRE_ERROR_RETURN; - - /* Lookbehinds are in Perl from version 5.005 */ - - case '<': - ptr += 3; - if (*ptr == '=' || *ptr == '!') - { - branch_newextra = 1 + LINK_SIZE; - length += 1 + LINK_SIZE; /* For the first branch */ - break; - } - errorcode = ERR24; - goto PCRE_ERROR_RETURN; - - /* Conditionals are in Perl from version 5.005. The bracket must either - be followed by a number (for bracket reference) or by an assertion - group, or (a PCRE extension) by 'R' for a recursion test. */ - - case '(': - if (ptr[3] == 'R' && ptr[4] == ')') - { - ptr += 4; - length += 3; - } - else if ((digitab[ptr[3]] & ctype_digit) != 0) - { - ptr += 4; - length += 3; - while ((digitab[*ptr] & ctype_digit) != 0) ptr++; - if (*ptr != ')') - { - errorcode = ERR26; - goto PCRE_ERROR_RETURN; - } - } - else /* An assertion must follow */ - { - ptr++; /* Can treat like ':' as far as spacing is concerned */ - if (ptr[2] != '?' || - (ptr[3] != '=' && ptr[3] != '!' && ptr[3] != '<') ) - { - ptr += 2; /* To get right offset in message */ - errorcode = ERR28; - goto PCRE_ERROR_RETURN; - } - } - break; - - /* Else loop checking valid options until ) is met. Anything else is an - error. If we are without any brackets, i.e. at top level, the settings - act as if specified in the options, so massage the options immediately. - This is for backward compatibility with Perl 5.004. */ - - default: - set = unset = 0; - optset = &set; - ptr += 2; - - for (;; ptr++) - { - c = *ptr; - switch (c) - { - case 'i': - *optset |= PCRE_CASELESS; - continue; - - case 'm': - *optset |= PCRE_MULTILINE; - continue; - - case 's': - *optset |= PCRE_DOTALL; - continue; - - case 'x': - *optset |= PCRE_EXTENDED; - continue; - - case 'X': - *optset |= PCRE_EXTRA; - continue; - - case 'U': - *optset |= PCRE_UNGREEDY; - continue; - - case '-': - optset = &unset; - continue; - - /* A termination by ')' indicates an options-setting-only item; if - this is at the very start of the pattern (indicated by item_count - being zero), we use it to set the global options. This is helpful - when analyzing the pattern for first characters, etc. Otherwise - nothing is done here and it is handled during the compiling - process. - - We allow for more than one options setting at the start. If such - settings do not change the existing options, nothing is compiled. - However, we must leave space just in case something is compiled. - This can happen for pathological sequences such as (?i)(?-i) - because the global options will end up with -i set. The space is - small and not significant. (Before I did this there was a reported - bug with (?i)(?-i) in a machine-generated pattern.) - - [Historical note: Up to Perl 5.8, options settings at top level - were always global settings, wherever they appeared in the pattern. - That is, they were equivalent to an external setting. From 5.8 - onwards, they apply only to what follows (which is what you might - expect).] */ - - case ')': - if (item_count == 0) - { - options = (options | set) & (~unset); - set = unset = 0; /* To save length */ - item_count--; /* To allow for several */ - length += 2; - } - - /* Fall through */ - - /* A termination by ':' indicates the start of a nested group with - the given options set. This is again handled at compile time, but - we must allow for compiled space if any of the ims options are - set. We also have to allow for resetting space at the end of - the group, which is why 4 is added to the length and not just 2. - If there are several changes of options within the same group, this - will lead to an over-estimate on the length, but this shouldn't - matter very much. We also have to allow for resetting options at - the start of any alternations, which we do by setting - branch_newextra to 2. Finally, we record whether the case-dependent - flag ever changes within the regex. This is used by the "required - character" code. */ - - case ':': - if (((set|unset) & PCRE_IMS) != 0) - { - length += 4; - branch_newextra = 2; - if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED; - } - goto END_OPTIONS; - - /* Unrecognized option character */ - - default: - errorcode = ERR12; - goto PCRE_ERROR_RETURN; - } - } - - /* If we hit a closing bracket, that's it - this is a freestanding - option-setting. We need to ensure that branch_extra is updated if - necessary. The only values branch_newextra can have here are 0 or 2. - If the value is 2, then branch_extra must either be 2 or 5, depending - on whether this is a lookbehind group or not. */ - - END_OPTIONS: - if (c == ')') - { - if (branch_newextra == 2 && - (branch_extra == 0 || branch_extra == 1+LINK_SIZE)) - branch_extra += branch_newextra; - continue; - } - - /* If options were terminated by ':' control comes here. This is a - non-capturing group with an options change. There is nothing more that - needs to be done because "capturing" is already set FALSE by default; - we can just fall through. */ - - } - } - - /* Ordinary parentheses, not followed by '?', are capturing unless - PCRE_NO_AUTO_CAPTURE is set. */ - - else capturing = (options & PCRE_NO_AUTO_CAPTURE) == 0; - - /* Capturing brackets must be counted so we can process escapes in a - Perlish way. If the number exceeds EXTRACT_BASIC_MAX we are going to need - an additional 3 bytes of memory per capturing bracket. */ - - if (capturing) - { - bracount++; - if (bracount > EXTRACT_BASIC_MAX) bracket_length += 3; - } - - /* Save length for computing whole length at end if there's a repeat that - requires duplication of the group. Also save the current value of - branch_extra, and start the new group with the new value. If non-zero, this - will either be 2 for a (?imsx: group, or 3 for a lookbehind assertion. */ - - if (brastackptr >= sizeof(brastack)/sizeof(int)) - { - errorcode = ERR19; - goto PCRE_ERROR_RETURN; - } - - bralenstack[brastackptr] = branch_extra; - branch_extra = branch_newextra; - - brastack[brastackptr++] = length; - length += bracket_length; - continue; - - /* Handle ket. Look for subsequent max/min; for certain sets of values we - have to replicate this bracket up to that many times. If brastackptr is - 0 this is an unmatched bracket which will generate an error, but take care - not to try to access brastack[-1] when computing the length and restoring - the branch_extra value. */ - - case ')': - length += 1 + LINK_SIZE; - if (brastackptr > 0) - { - duplength = length - brastack[--brastackptr]; - branch_extra = bralenstack[brastackptr]; - } - else duplength = 0; - - /* The following code is also used when a recursion such as (?3) is - followed by a quantifier, because in that case, it has to be wrapped inside - brackets so that the quantifier works. The value of duplength must be - set before arrival. */ - - HANDLE_QUANTIFIED_BRACKETS: - - /* Leave ptr at the final char; for read_repeat_counts this happens - automatically; for the others we need an increment. */ - - if ((c = ptr[1]) == '{' && is_counted_repeat(ptr+2)) - { - ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); - if (errorcode != 0) goto PCRE_ERROR_RETURN; - } - else if (c == '*') { min = 0; max = -1; ptr++; } - else if (c == '+') { min = 1; max = -1; ptr++; } - else if (c == '?') { min = 0; max = 1; ptr++; } - else { min = 1; max = 1; } - - /* If the minimum is zero, we have to allow for an OP_BRAZERO before the - group, and if the maximum is greater than zero, we have to replicate - maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting - bracket set. */ - - if (min == 0) - { - length++; - if (max > 0) length += (max - 1) * (duplength + 3 + 2*LINK_SIZE); - } - - /* When the minimum is greater than zero, we have to replicate up to - minval-1 times, with no additions required in the copies. Then, if there - is a limited maximum we have to replicate up to maxval-1 times allowing - for a BRAZERO item before each optional copy and nesting brackets for all - but one of the optional copies. */ - - else - { - length += (min - 1) * duplength; - if (max > min) /* Need this test as max=-1 means no limit */ - length += (max - min) * (duplength + 3 + 2*LINK_SIZE) - - (2 + 2*LINK_SIZE); - } - - /* Allow space for once brackets for "possessive quantifier" */ - - if (ptr[1] == '+') - { - ptr++; - length += 2 + 2*LINK_SIZE; - } - continue; - - /* Non-special character. It won't be space or # in extended mode, so it is - always a genuine character. If we are in a \Q...\E sequence, check for the - end; if not, we have a literal. */ - - default: - NORMAL_CHAR: - - if (inescq && c == '\\' && ptr[1] == 'E') - { - inescq = FALSE; - ptr++; - continue; - } - - length += 2; /* For a one-byte character */ - lastitemlength = 1; /* Default length of last item for repeats */ - - /* In UTF-8 mode, check for additional bytes. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && (c & 0xc0) == 0xc0) - { - while ((ptr[1] & 0xc0) == 0x80) /* Can't flow over the end */ - { /* because the end is marked */ - lastitemlength++; /* by a zero byte. */ - length++; - ptr++; - } - } -#endif - - continue; - } - } - -length += 2 + LINK_SIZE; /* For final KET and END */ - -if ((options & PCRE_AUTO_CALLOUT) != 0) - length += 2 + 2*LINK_SIZE; /* For final callout */ - -if (length > MAX_PATTERN_SIZE) - { - errorcode = ERR20; - goto PCRE_EARLY_ERROR_RETURN; - } - -/* Compute the size of data block needed and get it, either from malloc or -externally provided function. */ - -size = length + sizeof(real_pcre) + name_count * (max_name_size + 3); -re = (real_pcre *)(pcre_malloc)(size); - -if (re == NULL) - { - errorcode = ERR21; - goto PCRE_EARLY_ERROR_RETURN; - } - -/* Put in the magic number, and save the sizes, options, and character table -pointer. NULL is used for the default character tables. The nullpad field is at -the end; it's there to help in the case when a regex compiled on a system with -4-byte pointers is run on another with 8-byte pointers. */ - -re->magic_number = MAGIC_NUMBER; -re->size = size; -re->options = options; -re->dummy1 = 0; -re->name_table_offset = sizeof(real_pcre); -re->name_entry_size = max_name_size + 3; -re->name_count = name_count; -re->ref_count = 0; -re->tables = (tables == _pcre_default_tables)? NULL : tables; -re->nullpad = NULL; - -/* The starting points of the name/number translation table and of the code are -passed around in the compile data block. */ - -compile_block.names_found = 0; -compile_block.name_entry_size = max_name_size + 3; -compile_block.name_table = (uschar *)re + re->name_table_offset; -codestart = compile_block.name_table + re->name_entry_size * re->name_count; -compile_block.start_code = codestart; -compile_block.start_pattern = (const uschar *)pattern; -compile_block.req_varyopt = 0; -compile_block.nopartial = FALSE; - -/* Set up a starting, non-extracting bracket, then compile the expression. On -error, errorcode will be set non-zero, so we don't need to look at the result -of the function here. */ - -ptr = (const uschar *)pattern; -code = (uschar *)codestart; -*code = OP_BRA; -bracount = 0; -(void)compile_regex(options, options & PCRE_IMS, &bracount, &code, &ptr, - &errorcode, FALSE, 0, &firstbyte, &reqbyte, NULL, &compile_block); -re->top_bracket = bracount; -re->top_backref = compile_block.top_backref; - -if (compile_block.nopartial) re->options |= PCRE_NOPARTIAL; - -/* If not reached end of pattern on success, there's an excess bracket. */ - -if (errorcode == 0 && *ptr != 0) errorcode = ERR22; - -/* Fill in the terminating state and check for disastrous overflow, but -if debugging, leave the test till after things are printed out. */ - -*code++ = OP_END; - -#ifndef DEBUG -if (code - codestart > length) errorcode = ERR23; -#endif - -/* Give an error if there's back reference to a non-existent capturing -subpattern. */ - -if (re->top_backref > re->top_bracket) errorcode = ERR15; - -/* Failed to compile, or error while post-processing */ - -if (errorcode != 0) - { - (pcre_free)(re); - PCRE_ERROR_RETURN: - *erroroffset = ptr - (const uschar *)pattern; - PCRE_EARLY_ERROR_RETURN: - *errorptr = error_texts[errorcode]; - if (errorcodeptr != NULL) *errorcodeptr = errorcode; - return NULL; - } - -/* If the anchored option was not passed, set the flag if we can determine that -the pattern is anchored by virtue of ^ characters or \A or anything else (such -as starting with .* when DOTALL is set). - -Otherwise, if we know what the first character has to be, save it, because that -speeds up unanchored matches no end. If not, see if we can set the -PCRE_STARTLINE flag. This is helpful for multiline matches when all branches -start with ^. and also when all branches start with .* for non-DOTALL matches. -*/ - -if ((options & PCRE_ANCHORED) == 0) - { - int temp_options = options; - if (is_anchored(codestart, &temp_options, 0, compile_block.backref_map)) - re->options |= PCRE_ANCHORED; - else - { - if (firstbyte < 0) - firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE); - if (firstbyte >= 0) /* Remove caseless flag for non-caseable chars */ - { - int ch = firstbyte & 255; - re->first_byte = ((firstbyte & REQ_CASELESS) != 0 && - compile_block.fcc[ch] == ch)? ch : firstbyte; - re->options |= PCRE_FIRSTSET; - } - else if (is_startline(codestart, 0, compile_block.backref_map)) - re->options |= PCRE_STARTLINE; - } - } - -/* For an anchored pattern, we use the "required byte" only if it follows a -variable length item in the regex. Remove the caseless flag for non-caseable -bytes. */ - -if (reqbyte >= 0 && - ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0)) - { - int ch = reqbyte & 255; - re->req_byte = ((reqbyte & REQ_CASELESS) != 0 && - compile_block.fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte; - re->options |= PCRE_REQCHSET; - } - -/* Print out the compiled data for debugging */ - -#ifdef DEBUG - -printf("Length = %d top_bracket = %d top_backref = %d\n", - length, re->top_bracket, re->top_backref); - -if (re->options != 0) - { - printf("%s%s%s%s%s%s%s%s%s%s\n", - ((re->options & PCRE_NOPARTIAL) != 0)? "nopartial " : "", - ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "", - ((re->options & PCRE_CASELESS) != 0)? "caseless " : "", - ((re->options & PCRE_ICHANGED) != 0)? "case state changed " : "", - ((re->options & PCRE_EXTENDED) != 0)? "extended " : "", - ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "", - ((re->options & PCRE_DOTALL) != 0)? "dotall " : "", - ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "", - ((re->options & PCRE_EXTRA) != 0)? "extra " : "", - ((re->options & PCRE_UNGREEDY) != 0)? "ungreedy " : ""); - } - -if ((re->options & PCRE_FIRSTSET) != 0) - { - int ch = re->first_byte & 255; - const char *caseless = ((re->first_byte & REQ_CASELESS) == 0)? "" : " (caseless)"; - if (isprint(ch)) printf("First char = %c%s\n", ch, caseless); - else printf("First char = \\x%02x%s\n", ch, caseless); - } - -if ((re->options & PCRE_REQCHSET) != 0) - { - int ch = re->req_byte & 255; - const char *caseless = ((re->req_byte & REQ_CASELESS) == 0)? "" : " (caseless)"; - if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless); - else printf("Req char = \\x%02x%s\n", ch, caseless); - } - -_pcre_printint(re, stdout); - -/* This check is done here in the debugging case so that the code that -was compiled can be seen. */ - -if (code - codestart > length) - { - (pcre_free)(re); - *errorptr = error_texts[ERR23]; - *erroroffset = ptr - (uschar *)pattern; - if (errorcodeptr != NULL) *errorcodeptr = ERR23; - return NULL; - } -#endif - -return (pcre *)re; -} - -/* End of pcre_compile.c */ diff --git a/ext/pcre/pcrelib/pcre_config.c b/ext/pcre/pcrelib/pcre_config.c deleted file mode 100644 index 04029a9464c76..0000000000000 --- a/ext/pcre/pcrelib/pcre_config.c +++ /dev/null @@ -1,112 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_config(). */ - - -#include "pcre_internal.h" - - -/************************************************* -* Return info about what features are configured * -*************************************************/ - -/* This function has an extensible interface so that additional items can be -added compatibly. - -Arguments: - what what information is required - where where to put the information - -Returns: 0 if data returned, negative on error -*/ - -EXPORT int -pcre_config(int what, void *where) -{ -switch (what) - { - case PCRE_CONFIG_UTF8: -#ifdef SUPPORT_UTF8 - *((int *)where) = 1; -#else - *((int *)where) = 0; -#endif - break; - - case PCRE_CONFIG_UNICODE_PROPERTIES: -#ifdef SUPPORT_UCP - *((int *)where) = 1; -#else - *((int *)where) = 0; -#endif - break; - - case PCRE_CONFIG_NEWLINE: - *((int *)where) = NEWLINE; - break; - - case PCRE_CONFIG_LINK_SIZE: - *((int *)where) = LINK_SIZE; - break; - - case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD: - *((int *)where) = POSIX_MALLOC_THRESHOLD; - break; - - case PCRE_CONFIG_MATCH_LIMIT: - *((unsigned int *)where) = MATCH_LIMIT; - break; - - case PCRE_CONFIG_STACKRECURSE: -#ifdef NO_RECURSE - *((int *)where) = 0; -#else - *((int *)where) = 1; -#endif - break; - - default: return PCRE_ERROR_BADOPTION; - } - -return 0; -} - -/* End of pcre_config.c */ diff --git a/ext/pcre/pcrelib/pcre_dfa_exec.c b/ext/pcre/pcrelib/pcre_dfa_exec.c deleted file mode 100644 index cb3ec186c6df9..0000000000000 --- a/ext/pcre/pcrelib/pcre_dfa_exec.c +++ /dev/null @@ -1,1920 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_dfa_exec(), which is an -alternative matching function that uses a DFA algorithm. This is NOT Perl- -compatible, but it has advantages in certain applications. */ - - -#include "pcre_internal.h" - - -/* For use to indent debugging output */ - -#define SP " " - - - -/************************************************* -* Code parameters and static tables * -*************************************************/ - -/* These are offsets that are used to turn the OP_TYPESTAR and friends opcodes -into others, under special conditions. A gap of 10 between the blocks should be -enough. */ - -#define OP_PROP_EXTRA (EXTRACT_BASIC_MAX+1) -#define OP_EXTUNI_EXTRA (EXTRACT_BASIC_MAX+11) - - -/* This table identifies those opcodes that are followed immediately by a -character that is to be tested in some way. This makes is possible to -centralize the loading of these characters. In the case of Type * etc, the -"character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a -small value. */ - -static uschar coptable[] = { - 0, /* End */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* \A, \G, \B, \b, \D, \d, \S, \s, \W, \w */ - 0, 0, /* Any, Anybyte */ - 0, 0, 0, /* NOTPROP, PROP, EXTUNI */ - 0, 0, 0, 0, 0, /* \Z, \z, Opt, ^, $ */ - 1, /* Char */ - 1, /* Charnc */ - 1, /* not */ - /* Positive single-char repeats */ - 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ - 3, 3, 3, /* upto, minupto, exact */ - /* Negative single-char repeats - only for chars < 256 */ - 1, 1, 1, 1, 1, 1, /* NOT *, *?, +, +?, ?, ?? */ - 3, 3, 3, /* NOT upto, minupto, exact */ - /* Positive type repeats */ - 1, 1, 1, 1, 1, 1, /* Type *, *?, +, +?, ?, ?? */ - 3, 3, 3, /* Type upto, minupto, exact */ - /* Character class & ref repeats */ - 0, 0, 0, 0, 0, 0, /* *, *?, +, +?, ?, ?? */ - 0, 0, /* CRRANGE, CRMINRANGE */ - 0, /* CLASS */ - 0, /* NCLASS */ - 0, /* XCLASS - variable length */ - 0, /* REF */ - 0, /* RECURSE */ - 0, /* CALLOUT */ - 0, /* Alt */ - 0, /* Ket */ - 0, /* KetRmax */ - 0, /* KetRmin */ - 0, /* Assert */ - 0, /* Assert not */ - 0, /* Assert behind */ - 0, /* Assert behind not */ - 0, /* Reverse */ - 0, /* Once */ - 0, /* COND */ - 0, /* CREF */ - 0, 0, /* BRAZERO, BRAMINZERO */ - 0, /* BRANUMBER */ - 0 /* BRA */ -}; - -/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, -and \w */ - -static uschar toptable1[] = { - 0, 0, 0, 0, 0, - ctype_digit, ctype_digit, - ctype_space, ctype_space, - ctype_word, ctype_word, - 0 /* OP_ANY */ -}; - -static uschar toptable2[] = { - 0, 0, 0, 0, 0, - ctype_digit, 0, - ctype_space, 0, - ctype_word, 0, - 1 /* OP_ANY */ -}; - - -/* Structure for holding data about a particular state, which is in effect the -current data for an active path through the match tree. It must consist -entirely of ints because the working vector we are passed, and which we put -these structures in, is a vector of ints. */ - -typedef struct stateblock { - int offset; /* Offset to opcode */ - int count; /* Count for repeats */ - int ims; /* ims flag bits */ - int data; /* Some use extra data */ -} stateblock; - -#define INTS_PER_STATEBLOCK (sizeof(stateblock)/sizeof(int)) - - -#ifdef DEBUG -/************************************************* -* Print character string * -*************************************************/ - -/* Character string printing function for debugging. - -Arguments: - p points to string - length number of bytes - f where to print - -Returns: nothing -*/ - -static void -pchars(unsigned char *p, int length, FILE *f) -{ -int c; -while (length-- > 0) - { - if (isprint(c = *(p++))) - fprintf(f, "%c", c); - else - fprintf(f, "\\x%02x", c); - } -} -#endif - - - -/************************************************* -* Execute a Regular Expression - DFA engine * -*************************************************/ - -/* This internal function applies a compiled pattern to a subject string, -starting at a given point, using a DFA engine. This function is called from the -external one, possibly multiple times if the pattern is not anchored. The -function calls itself recursively for some kinds of subpattern. - -Arguments: - md the match_data block with fixed information - this_start_code the opening bracket of this subexpression's code - current_subject where we currently are in the subject string - start_offset start offset in the subject string - offsets vector to contain the matching string offsets - offsetcount size of same - workspace vector of workspace - wscount size of same - ims the current ims flags - rlevel function call recursion level - recursing regex recursive call level - -Returns: > 0 => - = 0 => - -1 => failed to match - < -1 => some kind of unexpected problem - -The following macros are used for adding states to the two state vectors (one -for the current character, one for the following character). */ - -#define ADD_ACTIVE(x,y) \ - if (active_count++ < wscount) \ - { \ - next_active_state->offset = (x); \ - next_active_state->count = (y); \ - next_active_state->ims = ims; \ - next_active_state++; \ - DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ - } \ - else return PCRE_ERROR_DFA_WSSIZE - -#define ADD_ACTIVE_DATA(x,y,z) \ - if (active_count++ < wscount) \ - { \ - next_active_state->offset = (x); \ - next_active_state->count = (y); \ - next_active_state->ims = ims; \ - next_active_state->data = (z); \ - next_active_state++; \ - DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ - } \ - else return PCRE_ERROR_DFA_WSSIZE - -#define ADD_NEW(x,y) \ - if (new_count++ < wscount) \ - { \ - next_new_state->offset = (x); \ - next_new_state->count = (y); \ - next_new_state->ims = ims; \ - next_new_state++; \ - DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ - } \ - else return PCRE_ERROR_DFA_WSSIZE - -#define ADD_NEW_DATA(x,y,z) \ - if (new_count++ < wscount) \ - { \ - next_new_state->offset = (x); \ - next_new_state->count = (y); \ - next_new_state->ims = ims; \ - next_new_state->data = (z); \ - next_new_state++; \ - DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ - } \ - else return PCRE_ERROR_DFA_WSSIZE - -/* And now, here is the code */ - -static int -internal_dfa_exec( - dfa_match_data *md, - const uschar *this_start_code, - const uschar *current_subject, - int start_offset, - int *offsets, - int offsetcount, - int *workspace, - int wscount, - int ims, - int rlevel, - int recursing) -{ -stateblock *active_states, *new_states, *temp_states; -stateblock *next_active_state, *next_new_state; - -const uschar *ctypes, *lcc, *fcc; -const uschar *ptr; -const uschar *end_code; - -int active_count, new_count, match_count; - -/* Some fields in the md block are frequently referenced, so we load them into -independent variables in the hope that this will perform better. */ - -const uschar *start_subject = md->start_subject; -const uschar *end_subject = md->end_subject; -const uschar *start_code = md->start_code; - -BOOL utf8 = (md->poptions & PCRE_UTF8) != 0; - -rlevel++; -offsetcount &= (-2); - -wscount -= 2; -wscount = (wscount - (wscount % (INTS_PER_STATEBLOCK * 2))) / - (2 * INTS_PER_STATEBLOCK); - -DPRINTF(("\n%.*s---------------------\n" - "%.*sCall to internal_dfa_exec f=%d r=%d\n", - rlevel*2-2, SP, rlevel*2-2, SP, rlevel, recursing)); - -ctypes = md->tables + ctypes_offset; -lcc = md->tables + lcc_offset; -fcc = md->tables + fcc_offset; - -match_count = PCRE_ERROR_NOMATCH; /* A negative number */ - -active_states = (stateblock *)(workspace + 2); -next_new_state = new_states = active_states + wscount; -new_count = 0; - -/* The first thing in any (sub) pattern is a bracket of some sort. Push all -the alternative states onto the list, and find out where the end is. This -makes is possible to use this function recursively, when we want to stop at a -matching internal ket rather than at the end. - -If the first opcode in the first alternative is OP_REVERSE, we are dealing with -a backward assertion. In that case, we have to find out the maximum amount to -move back, and set up each alternative appropriately. */ - -if (this_start_code[1+LINK_SIZE] == OP_REVERSE) - { - int max_back = 0; - int gone_back; - - end_code = this_start_code; - do - { - int back = GET(end_code, 2+LINK_SIZE); - if (back > max_back) max_back = back; - end_code += GET(end_code, 1); - } - while (*end_code == OP_ALT); - - /* If we can't go back the amount required for the longest lookbehind - pattern, go back as far as we can; some alternatives may still be viable. */ - -#ifdef SUPPORT_UTF8 - /* In character mode we have to step back character by character */ - - if (utf8) - { - for (gone_back = 0; gone_back < max_back; gone_back++) - { - if (current_subject <= start_subject) break; - current_subject--; - while (current_subject > start_subject && - (*current_subject & 0xc0) == 0x80) - current_subject--; - } - } - else -#endif - - /* In byte-mode we can do this quickly. */ - - { - gone_back = (current_subject - max_back < start_subject)? - current_subject - start_subject : max_back; - current_subject -= gone_back; - } - - /* Now we can process the individual branches. */ - - end_code = this_start_code; - do - { - int back = GET(end_code, 2+LINK_SIZE); - if (back <= gone_back) - { - int bstate = end_code - start_code + 2 + 2*LINK_SIZE; - ADD_NEW_DATA(-bstate, 0, gone_back - back); - } - end_code += GET(end_code, 1); - } - while (*end_code == OP_ALT); - } - -/* This is the code for a "normal" subpattern (not a backward assertion). The -start of a whole pattern is always one of these. If we are at the top level, -we may be asked to restart matching from the same point that we reached for a -previous partial match. We still have to scan through the top-level branches to -find the end state. */ - -else - { - end_code = this_start_code; - - /* Restarting */ - - if (rlevel == 1 && (md->moptions & PCRE_DFA_RESTART) != 0) - { - do { end_code += GET(end_code, 1); } while (*end_code == OP_ALT); - new_count = workspace[1]; - if (!workspace[0]) - memcpy(new_states, active_states, new_count * sizeof(stateblock)); - } - - /* Not restarting */ - - else - { - do - { - ADD_NEW(end_code - start_code + 1 + LINK_SIZE, 0); - end_code += GET(end_code, 1); - } - while (*end_code == OP_ALT); - } - } - -workspace[0] = 0; /* Bit indicating which vector is current */ - -DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, end_code - start_code)); - -/* Loop for scanning the subject */ - -ptr = current_subject; -for (;;) - { - int i, j; - int c, d, clen, dlen; - - /* Make the new state list into the active state list and empty the - new state list. */ - - temp_states = active_states; - active_states = new_states; - new_states = temp_states; - active_count = new_count; - new_count = 0; - - workspace[0] ^= 1; /* Remember for the restarting feature */ - workspace[1] = active_count; - -#ifdef DEBUG - printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP); - pchars((uschar *)ptr, strlen((char *)ptr), stdout); - printf("\"\n"); - - printf("%.*sActive states: ", rlevel*2-2, SP); - for (i = 0; i < active_count; i++) - printf("%d/%d ", active_states[i].offset, active_states[i].count); - printf("\n"); -#endif - - /* Set the pointers for adding new states */ - - next_active_state = active_states + active_count; - next_new_state = new_states; - - /* Load the current character from the subject outside the loop, as many - different states may want to look at it, and we assume that at least one - will. */ - - if (ptr < end_subject) - { - clen = 1; -#ifdef SUPPORT_UTF8 - if (utf8) { GETCHARLEN(c, ptr, clen); } else -#endif /* SUPPORT_UTF8 */ - c = *ptr; - } - else - { - clen = 0; /* At end subject */ - c = -1; - } - - /* Scan up the active states and act on each one. The result of an action - may be to add more states to the currently active list (e.g. on hitting a - parenthesis) or it may be to put states on the new list, for considering - when we move the character pointer on. */ - - for (i = 0; i < active_count; i++) - { - stateblock *current_state = active_states + i; - const uschar *code; - int state_offset = current_state->offset; - int count, codevalue; - int chartype, othercase; - -#ifdef DEBUG - printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); - if (c < 0) printf("-1\n"); - else if (c > 32 && c < 127) printf("'%c'\n", c); - else printf("0x%02x\n", c); -#endif - - /* This variable is referred to implicity in the ADD_xxx macros. */ - - ims = current_state->ims; - - /* A negative offset is a special case meaning "hold off going to this - (negated) state until the number of characters in the data field have - been skipped". */ - - if (state_offset < 0) - { - if (current_state->data > 0) - { - DPRINTF(("%.*sSkipping this character\n", rlevel*2-2, SP)); - ADD_NEW_DATA(state_offset, current_state->count, - current_state->data - 1); - continue; - } - else - { - current_state->offset = state_offset = -state_offset; - } - } - - /* Check for a duplicate state with the same count, and skip if found. */ - - for (j = 0; j < i; j++) - { - if (active_states[j].offset == state_offset && - active_states[j].count == current_state->count) - { - DPRINTF(("%.*sDuplicate state: skipped\n", rlevel*2-2, SP)); - goto NEXT_ACTIVE_STATE; - } - } - - /* The state offset is the offset to the opcode */ - - code = start_code + state_offset; - codevalue = *code; - if (codevalue >= OP_BRA) codevalue = OP_BRA; /* All brackets are equal */ - - /* If this opcode is followed by an inline character, load it. It is - tempting to test for the presence of a subject character here, but that - is wrong, because sometimes zero repetitions of the subject are - permitted. - - We also use this mechanism for opcodes such as OP_TYPEPLUS that take an - argument that is not a data character - but is always one byte long. - Unfortunately, we have to take special action to deal with \P, \p, and - \X in this case. To keep the other cases fast, convert these ones to new - opcodes. */ - - if (coptable[codevalue] > 0) - { - dlen = 1; -#ifdef SUPPORT_UTF8 - if (utf8) { GETCHARLEN(d, (code + coptable[codevalue]), dlen); } else -#endif /* SUPPORT_UTF8 */ - d = code[coptable[codevalue]]; - if (codevalue >= OP_TYPESTAR) - { - if (d == OP_ANYBYTE) return PCRE_ERROR_DFA_UITEM; - if (d >= OP_NOTPROP) - codevalue += (d == OP_EXTUNI)? OP_EXTUNI_EXTRA : OP_PROP_EXTRA; - } - } - else - { - dlen = 0; /* Not strictly necessary, but compilers moan */ - d = -1; /* if these variables are not set. */ - } - - - /* Now process the individual opcodes */ - - switch (codevalue) - { - -/* ========================================================================== */ - /* Reached a closing bracket. If not at the end of the pattern, carry - on with the next opcode. Otherwise, unless we have an empty string and - PCRE_NOTEMPTY is set, save the match data, shifting up all previous - matches so we always have the longest first. */ - - case OP_KET: - case OP_KETRMIN: - case OP_KETRMAX: - if (code != end_code) - { - ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0); - if (codevalue != OP_KET) - { - ADD_ACTIVE(state_offset - GET(code, 1), 0); - } - } - else if (ptr > current_subject || (md->moptions & PCRE_NOTEMPTY) == 0) - { - if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0; - else if (match_count > 0 && ++match_count * 2 >= offsetcount) - match_count = 0; - count = ((match_count == 0)? offsetcount : match_count * 2) - 2; - if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int)); - if (offsetcount >= 2) - { - offsets[0] = current_subject - start_subject; - offsets[1] = ptr - start_subject; - DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP, - offsets[1] - offsets[0], current_subject)); - } - if ((md->moptions & PCRE_DFA_SHORTEST) != 0) - { - DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" - "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, - match_count, rlevel*2-2, SP)); - return match_count; - } - } - break; - -/* ========================================================================== */ - /* These opcodes add to the current list of states without looking - at the current character. */ - - /*-----------------------------------------------------------------*/ - case OP_ALT: - do { code += GET(code, 1); } while (*code == OP_ALT); - ADD_ACTIVE(code - start_code, 0); - break; - - /*-----------------------------------------------------------------*/ - case OP_BRA: - do - { - ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0); - code += GET(code, 1); - } - while (*code == OP_ALT); - break; - - /*-----------------------------------------------------------------*/ - case OP_BRAZERO: - case OP_BRAMINZERO: - ADD_ACTIVE(state_offset + 1, 0); - code += 1 + GET(code, 2); - while (*code == OP_ALT) code += GET(code, 1); - ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0); - break; - - /*-----------------------------------------------------------------*/ - case OP_BRANUMBER: - ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0); - break; - - /*-----------------------------------------------------------------*/ - case OP_CIRC: - if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) || - ((ims & PCRE_MULTILINE) != 0 && ptr[-1] == NEWLINE)) - { ADD_ACTIVE(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_EOD: - if (ptr >= end_subject) { ADD_ACTIVE(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_OPT: - ims = code[1]; - ADD_ACTIVE(state_offset + 2, 0); - break; - - /*-----------------------------------------------------------------*/ - case OP_SOD: - if (ptr == start_subject) { ADD_ACTIVE(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_SOM: - if (ptr == start_subject + start_offset) { ADD_ACTIVE(state_offset + 1, 0); } - break; - - -/* ========================================================================== */ - /* These opcodes inspect the next subject character, and sometimes - the previous one as well, but do not have an argument. The variable - clen contains the length of the current character and is zero if we are - at the end of the subject. */ - - /*-----------------------------------------------------------------*/ - case OP_ANY: - if (clen > 0 && (c != NEWLINE || (ims & PCRE_DOTALL) != 0)) - { ADD_NEW(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_EODN: - if (clen == 0 || (c == NEWLINE && ptr + 1 == end_subject)) - { ADD_ACTIVE(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_DOLL: - if ((md->moptions & PCRE_NOTEOL) == 0) - { - if (clen == 0 || (c == NEWLINE && (ptr + 1 == end_subject || - (ims & PCRE_MULTILINE) != 0))) - { ADD_ACTIVE(state_offset + 1, 0); } - } - else if (c == NEWLINE && (ims & PCRE_MULTILINE) != 0) - { ADD_ACTIVE(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - - case OP_DIGIT: - case OP_WHITESPACE: - case OP_WORDCHAR: - if (clen > 0 && c < 256 && - ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0) - { ADD_NEW(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_NOT_DIGIT: - case OP_NOT_WHITESPACE: - case OP_NOT_WORDCHAR: - if (clen > 0 && (c >= 256 || - ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0)) - { ADD_NEW(state_offset + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_WORD_BOUNDARY: - case OP_NOT_WORD_BOUNDARY: - { - int left_word, right_word; - - if (ptr > start_subject) - { - const uschar *temp = ptr - 1; -#ifdef SUPPORT_UTF8 - if (utf8) BACKCHAR(temp); -#endif - GETCHARTEST(d, temp); - left_word = d < 256 && (ctypes[d] & ctype_word) != 0; - } - else left_word = 0; - - if (clen > 0) right_word = c < 256 && (ctypes[c] & ctype_word) != 0; - else right_word = 0; - - if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY)) - { ADD_ACTIVE(state_offset + 1, 0); } - } - break; - - -#ifdef SUPPORT_UCP - - /*-----------------------------------------------------------------*/ - /* Check the next character by Unicode property. We will get here only - if the support is in the binary; otherwise a compile-time error occurs. - */ - - case OP_PROP: - case OP_NOTPROP: - if (clen > 0) - { - int rqdtype, category; - category = ucp_findchar(c, &chartype, &othercase); - rqdtype = code[1]; - if (rqdtype >= 128) - { - if ((rqdtype - 128 == category) == (codevalue == OP_PROP)) - { ADD_NEW(state_offset + 2, 0); } - } - else - { - if ((rqdtype == chartype) == (codevalue == OP_PROP)) - { ADD_NEW(state_offset + 2, 0); } - } - } - break; -#endif - - - -/* ========================================================================== */ - /* These opcodes likewise inspect the subject character, but have an - argument that is not a data character. It is one of these opcodes: - OP_ANY, OP_DIGIT, OP_NOT_DIGIT, OP_WHITESPACE, OP_NOT_SPACE, OP_WORDCHAR, - OP_NOT_WORDCHAR. The value is loaded into d. */ - - case OP_TYPEPLUS: - case OP_TYPEMINPLUS: - count = current_state->count; /* Already matched */ - if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } - if (clen > 0) - { - if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || - (c < 256 && - (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && - ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) - { - count++; - ADD_NEW(state_offset, count); - } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_TYPEQUERY: - case OP_TYPEMINQUERY: - ADD_ACTIVE(state_offset + 2, 0); - if (clen > 0) - { - if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || - (c < 256 && - (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && - ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) - { - ADD_NEW(state_offset + 2, 0); - } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_TYPESTAR: - case OP_TYPEMINSTAR: - ADD_ACTIVE(state_offset + 2, 0); - if (clen > 0) - { - if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || - (c < 256 && - (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && - ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) - { - ADD_NEW(state_offset, 0); - } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_TYPEEXACT: - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - if (codevalue != OP_TYPEEXACT) - { ADD_ACTIVE(state_offset + 4, 0); } - count = current_state->count; /* Number already matched */ - if (clen > 0) - { - if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || - (c < 256 && - (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && - ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) - { - if (++count >= GET2(code, 1)) - { ADD_NEW(state_offset + 4, 0); } - else - { ADD_NEW(state_offset, count); } - } - } - break; - -/* ========================================================================== */ - /* These are virtual opcodes that are used when something like - OP_TYPEPLUS has OP_PROP, OP_NOTPROP, or OP_EXTUNI as its argument. It - keeps the code above fast for the other cases. The argument is in the - d variable. */ - - case OP_PROP_EXTRA + OP_TYPEPLUS: - case OP_PROP_EXTRA + OP_TYPEMINPLUS: - count = current_state->count; /* Already matched */ - if (count > 0) { ADD_ACTIVE(state_offset + 3, 0); } - if (clen > 0) - { - int category = ucp_findchar(c, &chartype, &othercase); - int rqdtype = code[2]; - if ((d == OP_PROP) == - (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) - { count++; ADD_NEW(state_offset, count); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_EXTUNI_EXTRA + OP_TYPEPLUS: - case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS: - count = current_state->count; /* Already matched */ - if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } - if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) - { - const uschar *nptr = ptr + clen; - int ncount = 0; - while (nptr < end_subject) - { - int nd; - int ndlen = 1; - GETCHARLEN(nd, nptr, ndlen); - if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; - ncount++; - nptr += ndlen; - } - count++; - ADD_NEW_DATA(-state_offset, count, ncount); - } - break; - - /*-----------------------------------------------------------------*/ - case OP_PROP_EXTRA + OP_TYPEQUERY: - case OP_PROP_EXTRA + OP_TYPEMINQUERY: - count = 3; - goto QS1; - - case OP_PROP_EXTRA + OP_TYPESTAR: - case OP_PROP_EXTRA + OP_TYPEMINSTAR: - count = 0; - - QS1: - - ADD_ACTIVE(state_offset + 3, 0); - if (clen > 0) - { - int category = ucp_findchar(c, &chartype, &othercase); - int rqdtype = code[2]; - if ((d == OP_PROP) == - (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) - { ADD_NEW(state_offset + count, 0); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_EXTUNI_EXTRA + OP_TYPEQUERY: - case OP_EXTUNI_EXTRA + OP_TYPEMINQUERY: - count = 2; - goto QS2; - - case OP_EXTUNI_EXTRA + OP_TYPESTAR: - case OP_EXTUNI_EXTRA + OP_TYPEMINSTAR: - count = 0; - - QS2: - - ADD_ACTIVE(state_offset + 2, 0); - if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) - { - const uschar *nptr = ptr + clen; - int ncount = 0; - while (nptr < end_subject) - { - int nd; - int ndlen = 1; - GETCHARLEN(nd, nptr, ndlen); - if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; - ncount++; - nptr += ndlen; - } - ADD_NEW_DATA(-(state_offset + count), 0, ncount); - } - break; - - /*-----------------------------------------------------------------*/ - case OP_PROP_EXTRA + OP_TYPEEXACT: - case OP_PROP_EXTRA + OP_TYPEUPTO: - case OP_PROP_EXTRA + OP_TYPEMINUPTO: - if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT) - { ADD_ACTIVE(state_offset + 5, 0); } - count = current_state->count; /* Number already matched */ - if (clen > 0) - { - int category = ucp_findchar(c, &chartype, &othercase); - int rqdtype = code[4]; - if ((d == OP_PROP) == - (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) - { - if (++count >= GET2(code, 1)) - { ADD_NEW(state_offset + 5, 0); } - else - { ADD_NEW(state_offset, count); } - } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_EXTUNI_EXTRA + OP_TYPEEXACT: - case OP_EXTUNI_EXTRA + OP_TYPEUPTO: - case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO: - if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) - { ADD_ACTIVE(state_offset + 4, 0); } - count = current_state->count; /* Number already matched */ - if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) - { - const uschar *nptr = ptr + clen; - int ncount = 0; - while (nptr < end_subject) - { - int nd; - int ndlen = 1; - GETCHARLEN(nd, nptr, ndlen); - if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; - ncount++; - nptr += ndlen; - } - if (++count >= GET2(code, 1)) - { ADD_NEW_DATA(-(state_offset + 4), 0, ncount); } - else - { ADD_NEW_DATA(-state_offset, count, ncount); } - } - break; - -/* ========================================================================== */ - /* These opcodes are followed by a character that is usually compared - to the current subject character; it is loaded into d. We still get - here even if there is no subject character, because in some cases zero - repetitions are permitted. */ - - /*-----------------------------------------------------------------*/ - case OP_CHAR: - if (clen > 0 && c == d) { ADD_NEW(state_offset + dlen + 1, 0); } - break; - - /*-----------------------------------------------------------------*/ - case OP_CHARNC: - if (clen == 0) break; - -#ifdef SUPPORT_UTF8 - if (utf8) - { - if (c == d) { ADD_NEW(state_offset + dlen + 1, 0); } else - { - if (c < 128) othercase = fcc[c]; else - - /* If we have Unicode property support, we can use it to test the - other case of the character, if there is one. The result of - ucp_findchar() is < 0 if the char isn't found, and othercase is - returned as zero if there isn't another case. */ - -#ifdef SUPPORT_UCP - if (ucp_findchar(c, &chartype, &othercase) < 0) -#endif - othercase = -1; - - if (d == othercase) { ADD_NEW(state_offset + dlen + 1, 0); } - } - } - else -#endif /* SUPPORT_UTF8 */ - - /* Non-UTF-8 mode */ - { - if (lcc[c] == lcc[d]) { ADD_NEW(state_offset + 2, 0); } - } - break; - - -#ifdef SUPPORT_UCP - /*-----------------------------------------------------------------*/ - /* This is a tricky one because it can match more than one character. - Find out how many characters to skip, and then set up a negative state - to wait for them to pass before continuing. */ - - case OP_EXTUNI: - if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) - { - const uschar *nptr = ptr + clen; - int ncount = 0; - while (nptr < end_subject) - { - int nclen = 1; - GETCHARLEN(c, nptr, nclen); - if (ucp_findchar(c, &chartype, &othercase) != ucp_M) break; - ncount++; - nptr += nclen; - } - ADD_NEW_DATA(-(state_offset + 1), 0, ncount); - } - break; -#endif - - /*-----------------------------------------------------------------*/ - /* Match a negated single character. This is only used for one-byte - characters, that is, we know that d < 256. The character we are - checking (c) can be multibyte. */ - - case OP_NOT: - if (clen > 0) - { - int otherd = ((ims & PCRE_CASELESS) != 0)? fcc[d] : d; - if (c != d && c != otherd) { ADD_NEW(state_offset + dlen + 1, 0); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_PLUS: - case OP_MINPLUS: - case OP_NOTPLUS: - case OP_NOTMINPLUS: - count = current_state->count; /* Already matched */ - if (count > 0) { ADD_ACTIVE(state_offset + dlen + 1, 0); } - if (clen > 0) - { - int otherd = -1; - if ((ims & PCRE_CASELESS) != 0) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { -#ifdef SUPPORT_UCP - if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; -#endif /* SUPPORT_UCP */ - } - else -#endif /* SUPPORT_UTF8 */ - otherd = fcc[d]; - } - if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) - { count++; ADD_NEW(state_offset, count); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_QUERY: - case OP_MINQUERY: - case OP_NOTQUERY: - case OP_NOTMINQUERY: - ADD_ACTIVE(state_offset + dlen + 1, 0); - if (clen > 0) - { - int otherd = -1; - if ((ims && PCRE_CASELESS) != 0) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { -#ifdef SUPPORT_UCP - if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; -#endif /* SUPPORT_UCP */ - } - else -#endif /* SUPPORT_UTF8 */ - otherd = fcc[d]; - } - if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) - { ADD_NEW(state_offset + dlen + 1, 0); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_STAR: - case OP_MINSTAR: - case OP_NOTSTAR: - case OP_NOTMINSTAR: - ADD_ACTIVE(state_offset + dlen + 1, 0); - if (clen > 0) - { - int otherd = -1; - if ((ims && PCRE_CASELESS) != 0) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { -#ifdef SUPPORT_UCP - if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; -#endif /* SUPPORT_UCP */ - } - else -#endif /* SUPPORT_UTF8 */ - otherd = fcc[d]; - } - if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) - { ADD_NEW(state_offset, 0); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_EXACT: - case OP_UPTO: - case OP_MINUPTO: - case OP_NOTEXACT: - case OP_NOTUPTO: - case OP_NOTMINUPTO: - if (codevalue != OP_EXACT && codevalue != OP_NOTEXACT) - { ADD_ACTIVE(state_offset + dlen + 3, 0); } - count = current_state->count; /* Number already matched */ - if (clen > 0) - { - int otherd = -1; - if ((ims & PCRE_CASELESS) != 0) - { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) - { -#ifdef SUPPORT_UCP - if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; -#endif /* SUPPORT_UCP */ - } - else -#endif /* SUPPORT_UTF8 */ - otherd = fcc[d]; - } - if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) - { - if (++count >= GET2(code, 1)) - { ADD_NEW(state_offset + dlen + 3, 0); } - else - { ADD_NEW(state_offset, count); } - } - } - break; - - -/* ========================================================================== */ - /* These are the class-handling opcodes */ - - case OP_CLASS: - case OP_NCLASS: - case OP_XCLASS: - { - BOOL isinclass = FALSE; - int next_state_offset; - const uschar *ecode; - - /* For a simple class, there is always just a 32-byte table, and we - can set isinclass from it. */ - - if (codevalue != OP_XCLASS) - { - ecode = code + 33; - if (clen > 0) - { - isinclass = (c > 255)? (codevalue == OP_NCLASS) : - ((code[1 + c/8] & (1 << (c&7))) != 0); - } - } - - /* An extended class may have a table or a list of single characters, - ranges, or both, and it may be positive or negative. There's a - function that sorts all this out. */ - - else - { - ecode = code + GET(code, 1); - if (clen > 0) isinclass = _pcre_xclass(c, code + 1 + LINK_SIZE); - } - - /* At this point, isinclass is set for all kinds of class, and ecode - points to the byte after the end of the class. If there is a - quantifier, this is where it will be. */ - - next_state_offset = ecode - start_code; - - switch (*ecode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - ADD_ACTIVE(next_state_offset + 1, 0); - if (isinclass) { ADD_NEW(state_offset, 0); } - break; - - case OP_CRPLUS: - case OP_CRMINPLUS: - count = current_state->count; /* Already matched */ - if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); } - if (isinclass) { count++; ADD_NEW(state_offset, count); } - break; - - case OP_CRQUERY: - case OP_CRMINQUERY: - ADD_ACTIVE(next_state_offset + 1, 0); - if (isinclass) { ADD_NEW(next_state_offset + 1, 0); } - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - count = current_state->count; /* Already matched */ - if (count >= GET2(ecode, 1)) - { ADD_ACTIVE(next_state_offset + 5, 0); } - if (isinclass) - { - if (++count >= GET2(ecode, 3)) - { ADD_NEW(next_state_offset + 5, 0); } - else - { ADD_NEW(state_offset, count); } - } - break; - - default: - if (isinclass) { ADD_NEW(next_state_offset, 0); } - break; - } - } - break; - -/* ========================================================================== */ - /* These are the opcodes for fancy brackets of various kinds. We have - to use recursion in order to handle them. */ - - case OP_ASSERT: - case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: - { - int rc; - int local_offsets[2]; - int local_workspace[1000]; - const uschar *endasscode = code + GET(code, 1); - - while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); - - rc = internal_dfa_exec( - md, /* static match data */ - code, /* this subexpression's code */ - ptr, /* where we currently are */ - ptr - start_subject, /* start offset */ - local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(int), /* size of same */ - local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - ims, /* the current ims flags */ - rlevel, /* function recursion level */ - recursing); /* pass on regex recursion */ - - if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK)) - { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_COND: - { - int local_offsets[1000]; - int local_workspace[1000]; - int condcode = code[LINK_SIZE+1]; - - /* The only supported version of OP_CREF is for the value 0xffff, which - means "test if in a recursion". */ - - if (condcode == OP_CREF) - { - int value = GET2(code, LINK_SIZE+2); - if (value != 0xffff) return PCRE_ERROR_DFA_UCOND; - if (recursing > 0) { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); } - else { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); } - } - - /* Otherwise, the condition is an assertion */ - - else - { - int rc; - const uschar *asscode = code + LINK_SIZE + 1; - const uschar *endasscode = asscode + GET(asscode, 1); - - while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); - - rc = internal_dfa_exec( - md, /* fixed match data */ - asscode, /* this subexpression's code */ - ptr, /* where we currently are */ - ptr - start_subject, /* start offset */ - local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(int), /* size of same */ - local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - ims, /* the current ims flags */ - rlevel, /* function recursion level */ - recursing); /* pass on regex recursion */ - - if ((rc >= 0) == - (condcode == OP_ASSERT || condcode == OP_ASSERTBACK)) - { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); } - else - { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); } - } - } - break; - - /*-----------------------------------------------------------------*/ - case OP_RECURSE: - { - int local_offsets[1000]; - int local_workspace[1000]; - int rc; - - DPRINTF(("%.*sStarting regex recursion %d\n", rlevel*2-2, SP, - recursing + 1)); - - rc = internal_dfa_exec( - md, /* fixed match data */ - start_code + GET(code, 1), /* this subexpression's code */ - ptr, /* where we currently are */ - ptr - start_subject, /* start offset */ - local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(int), /* size of same */ - local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - ims, /* the current ims flags */ - rlevel, /* function recursion level */ - recursing + 1); /* regex recurse level */ - - DPRINTF(("%.*sReturn from regex recursion %d: rc=%d\n", rlevel*2-2, SP, - recursing + 1, rc)); - - /* Ran out of internal offsets */ - - if (rc == 0) return PCRE_ERROR_DFA_RECURSE; - - /* For each successful matched substring, set up the next state with a - count of characters to skip before trying it. Note that the count is in - characters, not bytes. */ - - if (rc > 0) - { - for (rc = rc*2 - 2; rc >= 0; rc -= 2) - { - const uschar *p = start_subject + local_offsets[rc]; - const uschar *pp = start_subject + local_offsets[rc+1]; - int charcount = local_offsets[rc+1] - local_offsets[rc]; - while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--; - if (charcount > 0) - { - ADD_NEW_DATA(-(state_offset + LINK_SIZE + 1), 0, (charcount - 1)); - } - else - { - ADD_ACTIVE(state_offset + LINK_SIZE + 1, 0); - } - } - } - else if (rc != PCRE_ERROR_NOMATCH) return rc; - } - break; - - /*-----------------------------------------------------------------*/ - case OP_ONCE: - { - int local_offsets[2]; - int local_workspace[1000]; - - int rc = internal_dfa_exec( - md, /* fixed match data */ - code, /* this subexpression's code */ - ptr, /* where we currently are */ - ptr - start_subject, /* start offset */ - local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(int), /* size of same */ - local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - ims, /* the current ims flags */ - rlevel, /* function recursion level */ - recursing); /* pass on regex recursion */ - - if (rc >= 0) - { - const uschar *end_subpattern = code; - int charcount = local_offsets[1] - local_offsets[0]; - int next_state_offset, repeat_state_offset; - - do { end_subpattern += GET(end_subpattern, 1); } - while (*end_subpattern == OP_ALT); - next_state_offset = end_subpattern - start_code + LINK_SIZE + 1; - - /* If the end of this subpattern is KETRMAX or KETRMIN, we must - arrange for the repeat state also to be added to the relevant list. - Calculate the offset, or set -1 for no repeat. */ - - repeat_state_offset = (*end_subpattern == OP_KETRMAX || - *end_subpattern == OP_KETRMIN)? - end_subpattern - start_code - GET(end_subpattern, 1) : -1; - - /* If we have matched an empty string, add the next state at the - current character pointer. This is important so that the duplicate - checking kicks in, which is what breaks infinite loops that match an - empty string. */ - - if (charcount == 0) - { - ADD_ACTIVE(next_state_offset, 0); - } - - /* Optimization: if there are no more active states, and there - are no new states yet set up, then skip over the subject string - right here, to save looping. Otherwise, set up the new state to swing - into action when the end of the substring is reached. */ - - else if (i + 1 >= active_count && new_count == 0) - { - ptr += charcount; - clen = 0; - ADD_NEW(next_state_offset, 0); - - /* If we are adding a repeat state at the new character position, - we must fudge things so that it is the only current state. - Otherwise, it might be a duplicate of one we processed before, and - that would cause it to be skipped. */ - - if (repeat_state_offset >= 0) - { - next_active_state = active_states; - active_count = 0; - i = -1; - ADD_ACTIVE(repeat_state_offset, 0); - } - } - else - { - const uschar *p = start_subject + local_offsets[0]; - const uschar *pp = start_subject + local_offsets[1]; - while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--; - ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1)); - if (repeat_state_offset >= 0) - { ADD_NEW_DATA(-repeat_state_offset, 0, (charcount - 1)); } - } - - } - else if (rc != PCRE_ERROR_NOMATCH) return rc; - } - break; - - -/* ========================================================================== */ - /* Handle callouts */ - - case OP_CALLOUT: - if (pcre_callout != NULL) - { - int rrc; - pcre_callout_block cb; - cb.version = 1; /* Version 1 of the callout block */ - cb.callout_number = code[1]; - cb.offset_vector = offsets; - cb.subject = (char *)start_subject; - cb.subject_length = end_subject - start_subject; - cb.start_match = current_subject - start_subject; - cb.current_position = ptr - start_subject; - cb.pattern_position = GET(code, 2); - cb.next_item_length = GET(code, 2 + LINK_SIZE); - cb.capture_top = 1; - cb.capture_last = -1; - cb.callout_data = md->callout_data; - if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc; /* Abandon */ - if (rrc == 0) { ADD_ACTIVE(state_offset + 2 + 2*LINK_SIZE, 0); } - } - break; - - -/* ========================================================================== */ - default: /* Unsupported opcode */ - return PCRE_ERROR_DFA_UITEM; - } - - NEXT_ACTIVE_STATE: continue; - - } /* End of loop scanning active states */ - - /* We have finished the processing at the current subject character. If no - new states have been set for the next character, we have found all the - matches that we are going to find. If we are at the top level and partial - matching has been requested, check for appropriate conditions. */ - - if (new_count <= 0) - { - if (match_count < 0 && /* No matches found */ - rlevel == 1 && /* Top level match function */ - (md->moptions & PCRE_PARTIAL) != 0 && /* Want partial matching */ - ptr >= end_subject && /* Reached end of subject */ - ptr > current_subject) /* Matched non-empty string */ - { - if (offsetcount >= 2) - { - offsets[0] = current_subject - start_subject; - offsets[1] = end_subject - start_subject; - } - match_count = PCRE_ERROR_PARTIAL; - } - - DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" - "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, match_count, - rlevel*2-2, SP)); - return match_count; - } - - /* One or more states are active for the next character. */ - - ptr += clen; /* Advance to next subject character */ - } /* Loop to move along the subject string */ - -/* Control never gets here, but we must keep the compiler happy. */ - -DPRINTF(("%.*s+++ Unexpected end of internal_dfa_exec %d +++\n" - "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, rlevel*2-2, SP)); -return PCRE_ERROR_NOMATCH; -} - - - - -/************************************************* -* Execute a Regular Expression - DFA engine * -*************************************************/ - -/* This external function applies a compiled re to a subject string using a DFA -engine. This function calls the internal function multiple times if the pattern -is not anchored. - -Arguments: - argument_re points to the compiled expression - extra_data points to extra data or is NULL (not currently used) - subject points to the subject string - length length of subject string (may contain binary zeros) - start_offset where to start in the subject string - options option bits - offsets vector of match offsets - offsetcount size of same - workspace workspace vector - wscount size of same - -Returns: > 0 => number of match offset pairs placed in offsets - = 0 => offsets overflowed; longest matches are present - -1 => failed to match - < -1 => some kind of unexpected problem -*/ - -EXPORT int -pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, - const char *subject, int length, int start_offset, int options, int *offsets, - int offsetcount, int *workspace, int wscount) -{ -real_pcre *re = (real_pcre *)argument_re; -dfa_match_data match_block; -BOOL utf8, anchored, startline, firstline; -const uschar *current_subject, *end_subject, *lcc; - -pcre_study_data internal_study; -const pcre_study_data *study = NULL; -real_pcre internal_re; - -const uschar *req_byte_ptr; -const uschar *start_bits = NULL; -BOOL first_byte_caseless = FALSE; -BOOL req_byte_caseless = FALSE; -int first_byte = -1; -int req_byte = -1; -int req_byte2 = -1; - -/* Plausibility checks */ - -if ((options & ~PUBLIC_DFA_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; -if (re == NULL || subject == NULL || workspace == NULL || - (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL; -if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; -if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE; - -/* We need to find the pointer to any study data before we test for byte -flipping, so we scan the extra_data block first. This may set two fields in the -match block, so we must initialize them beforehand. However, the other fields -in the match block must not be set until after the byte flipping. */ - -match_block.tables = re->tables; -match_block.callout_data = NULL; - -if (extra_data != NULL) - { - unsigned int flags = extra_data->flags; - if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) - study = (const pcre_study_data *)extra_data->study_data; - if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) return PCRE_ERROR_DFA_UMLIMIT; - if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0) - match_block.callout_data = extra_data->callout_data; - if ((flags & PCRE_EXTRA_TABLES) != 0) - match_block.tables = extra_data->tables; - } - -/* Check that the first field in the block is the magic number. If it is not, -test for a regex that was compiled on a host of opposite endianness. If this is -the case, flipped values are put in internal_re and internal_study if there was -study data too. */ - -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, study, &internal_study); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - if (study != NULL) study = &internal_study; - } - -/* Set some local values */ - -current_subject = (const unsigned char *)subject + start_offset; -end_subject = (const unsigned char *)subject + length; -req_byte_ptr = current_subject - 1; - -utf8 = (re->options & PCRE_UTF8) != 0; -anchored = (options & PCRE_ANCHORED) != 0 || (re->options & PCRE_ANCHORED) != 0; - -/* The remaining fixed data for passing around. */ - -match_block.start_code = (const uschar *)argument_re + - re->name_table_offset + re->name_count * re->name_entry_size; -match_block.start_subject = (const unsigned char *)subject; -match_block.end_subject = end_subject; -match_block.moptions = options; -match_block.poptions = re->options; - -/* Check a UTF-8 string if required. Unfortunately there's no way of passing -back the character offset. */ - -#ifdef SUPPORT_UTF8 -if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) - { - if (_pcre_valid_utf8((uschar *)subject, length) >= 0) - return PCRE_ERROR_BADUTF8; - if (start_offset > 0 && start_offset < length) - { - int tb = ((uschar *)subject)[start_offset]; - if (tb > 127) - { - tb &= 0xc0; - if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET; - } - } - } -#endif - -/* If the exec call supplied NULL for tables, use the inbuilt ones. This -is a feature that makes it possible to save compiled regex and re-use them -in other programs later. */ - -if (match_block.tables == NULL) match_block.tables = _pcre_default_tables; - -/* The lower casing table and the "must be at the start of a line" flag are -used in a loop when finding where to start. */ - -lcc = match_block.tables + lcc_offset; -startline = (re->options & PCRE_STARTLINE) != 0; -firstline = (re->options & PCRE_FIRSTLINE) != 0; - -/* Set up the first character to match, if available. The first_byte value is -never set for an anchored regular expression, but the anchoring may be forced -at run time, so we have to test for anchoring. The first char may be unset for -an unanchored pattern, of course. If there's no first char and the pattern was -studied, there may be a bitmap of possible first characters. */ - -if (!anchored) - { - if ((re->options & PCRE_FIRSTSET) != 0) - { - first_byte = re->first_byte & 255; - if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE) - first_byte = lcc[first_byte]; - } - else - { - if (startline && study != NULL && - (study->options & PCRE_STUDY_MAPPED) != 0) - start_bits = study->start_bits; - } - } - -/* For anchored or unanchored matches, there may be a "last known required -character" set. */ - -if ((re->options & PCRE_REQCHSET) != 0) - { - req_byte = re->req_byte & 255; - req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0; - req_byte2 = (match_block.tables + fcc_offset)[req_byte]; /* case flipped */ - } - -/* Call the main matching function, looping for a non-anchored regex after a -failed match. Unless restarting, optimize by moving to the first match -character if possible, when not anchored. Then unless wanting a partial match, -check for a required later character. */ - -for (;;) - { - int rc; - - if ((options & PCRE_DFA_RESTART) == 0) - { - const uschar *save_end_subject = end_subject; - - /* Advance to a unique first char if possible. If firstline is TRUE, the - start of the match is constrained to the first line of a multiline string. - Implement this by temporarily adjusting end_subject so that we stop scanning - at a newline. If the match fails at the newline, later code breaks this loop. - */ - - if (firstline) - { - const uschar *t = current_subject; - while (t < save_end_subject && *t != '\n') t++; - end_subject = t; - } - - if (first_byte >= 0) - { - if (first_byte_caseless) - while (current_subject < end_subject && - lcc[*current_subject] != first_byte) - current_subject++; - else - while (current_subject < end_subject && *current_subject != first_byte) - current_subject++; - } - - /* Or to just after \n for a multiline match if possible */ - - else if (startline) - { - if (current_subject > match_block.start_subject + start_offset) - { - while (current_subject < end_subject && current_subject[-1] != NEWLINE) - current_subject++; - } - } - - /* Or to a non-unique first char after study */ - - else if (start_bits != NULL) - { - while (current_subject < end_subject) - { - register unsigned int c = *current_subject; - if ((start_bits[c/8] & (1 << (c&7))) == 0) current_subject++; - else break; - } - } - - /* Restore fudged end_subject */ - - end_subject = save_end_subject; - } - - /* If req_byte is set, we know that that character must appear in the subject - for the match to succeed. If the first character is set, req_byte must be - later in the subject; otherwise the test starts at the match point. This - optimization can save a huge amount of work in patterns with nested unlimited - repeats that aren't going to match. Writing separate code for cased/caseless - versions makes it go faster, as does using an autoincrement and backing off - on a match. - - HOWEVER: when the subject string is very, very long, searching to its end can - take a long time, and give bad performance on quite ordinary patterns. This - showed up when somebody was matching /^C/ on a 32-megabyte string... so we - don't do this when the string is sufficiently long. - - ALSO: this processing is disabled when partial matching is requested. - */ - - if (req_byte >= 0 && - end_subject - current_subject < REQ_BYTE_MAX && - (options & PCRE_PARTIAL) == 0) - { - register const uschar *p = current_subject + ((first_byte >= 0)? 1 : 0); - - /* We don't need to repeat the search if we haven't yet reached the - place we found it at last time. */ - - if (p > req_byte_ptr) - { - if (req_byte_caseless) - { - while (p < end_subject) - { - register int pp = *p++; - if (pp == req_byte || pp == req_byte2) { p--; break; } - } - } - else - { - while (p < end_subject) - { - if (*p++ == req_byte) { p--; break; } - } - } - - /* If we can't find the required character, break the matching loop, - which will cause a return or PCRE_ERROR_NOMATCH. */ - - if (p >= end_subject) break; - - /* If we have found the required character, save the point where we - found it, so that we don't search again next time round the loop if - the start hasn't passed this character yet. */ - - req_byte_ptr = p; - } - } - - /* OK, now we can do the business */ - - rc = internal_dfa_exec( - &match_block, /* fixed match data */ - match_block.start_code, /* this subexpression's code */ - current_subject, /* where we currently are */ - start_offset, /* start offset in subject */ - offsets, /* offset vector */ - offsetcount, /* size of same */ - workspace, /* workspace vector */ - wscount, /* size of same */ - re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL), /* ims flags */ - 0, /* function recurse level */ - 0); /* regex recurse level */ - - /* Anything other than "no match" means we are done, always; otherwise, carry - on only if not anchored. */ - - if (rc != PCRE_ERROR_NOMATCH || anchored) return rc; - - /* Advance to the next subject character unless we are at the end of a line - and firstline is set. */ - - if (firstline && *current_subject == NEWLINE) break; - current_subject++; - -#ifdef SUPPORT_UTF8 - if (utf8) - { - while (current_subject < end_subject && (*current_subject & 0xc0) == 0x80) - current_subject++; - } -#endif - - if (current_subject > end_subject) break; - } - -return PCRE_ERROR_NOMATCH; -} - -/* End of pcre_dfa_exec.c */ diff --git a/ext/pcre/pcrelib/pcre_exec.c b/ext/pcre/pcrelib/pcre_exec.c deleted file mode 100644 index 65173e2ba2419..0000000000000 --- a/ext/pcre/pcrelib/pcre_exec.c +++ /dev/null @@ -1,3632 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains pcre_exec(), the externally visible function that does -pattern matching using an NFA algorithm, trying to mimic Perl as closely as -possible. There are also some static supporting functions. */ - - -#include "pcre_internal.h" - - -/* Structure for building a chain of data that actually lives on the -stack, for holding the values of the subject pointer at the start of each -subpattern, so as to detect when an empty string has been matched by a -subpattern - to break infinite loops. When NO_RECURSE is set, these blocks -are on the heap, not on the stack. */ - -typedef struct eptrblock { - struct eptrblock *epb_prev; - const uschar *epb_saved_eptr; -} eptrblock; - -/* Flag bits for the match() function */ - -#define match_condassert 0x01 /* Called to check a condition assertion */ -#define match_isgroup 0x02 /* Set if start of bracketed group */ - -/* Non-error returns from the match() function. Error returns are externally -defined PCRE_ERROR_xxx codes, which are all negative. */ - -#define MATCH_MATCH 1 -#define MATCH_NOMATCH 0 - -/* Maximum number of ints of offset to save on the stack for recursive calls. -If the offset vector is bigger, malloc is used. This should be a multiple of 3, -because the offset vector is always a multiple of 3 long. */ - -#define REC_STACK_SAVE_MAX 30 - -/* Min and max values for the common repeats; for the maxima, 0 => infinity */ - -static const char rep_min[] = { 0, 0, 1, 1, 0, 0 }; -static const char rep_max[] = { 0, 0, 0, 0, 1, 1 }; - - - -#ifdef DEBUG -/************************************************* -* Debugging function to print chars * -*************************************************/ - -/* Print a sequence of chars in printable format, stopping at the end of the -subject if the requested. - -Arguments: - p points to characters - length number to print - is_subject TRUE if printing from within md->start_subject - md pointer to matching data block, if is_subject is TRUE - -Returns: nothing -*/ - -static void -pchars(const uschar *p, int length, BOOL is_subject, match_data *md) -{ -int c; -if (is_subject && length > md->end_subject - p) length = md->end_subject - p; -while (length-- > 0) - if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c); -} -#endif - - - -/************************************************* -* Match a back-reference * -*************************************************/ - -/* If a back reference hasn't been set, the length that is passed is greater -than the number of characters left in the string, so the match fails. - -Arguments: - offset index into the offset vector - eptr points into the subject - length length to be matched - md points to match data block - ims the ims flags - -Returns: TRUE if matched -*/ - -static BOOL -match_ref(int offset, register const uschar *eptr, int length, match_data *md, - unsigned long int ims) -{ -const uschar *p = md->start_subject + md->offset_vector[offset]; - -#ifdef DEBUG -if (eptr >= md->end_subject) - printf("matching subject <null>"); -else - { - printf("matching subject "); - pchars(eptr, length, TRUE, md); - } -printf(" against backref "); -pchars(p, length, FALSE, md); -printf("\n"); -#endif - -/* Always fail if not enough characters left */ - -if (length > md->end_subject - eptr) return FALSE; - -/* Separate the caselesss case for speed */ - -if ((ims & PCRE_CASELESS) != 0) - { - while (length-- > 0) - if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; - } -else - { while (length-- > 0) if (*p++ != *eptr++) return FALSE; } - -return TRUE; -} - - - -/*************************************************************************** -**************************************************************************** - RECURSION IN THE match() FUNCTION - -The match() function is highly recursive. Some regular expressions can cause -it to recurse thousands of times. I was writing for Unix, so I just let it -call itself recursively. This uses the stack for saving everything that has -to be saved for a recursive call. On Unix, the stack can be large, and this -works fine. - -It turns out that on non-Unix systems there are problems with programs that -use a lot of stack. (This despite the fact that every last chip has oodles -of memory these days, and techniques for extending the stack have been known -for decades.) So.... - -There is a fudge, triggered by defining NO_RECURSE, which avoids recursive -calls by keeping local variables that need to be preserved in blocks of memory -obtained from malloc instead instead of on the stack. Macros are used to -achieve this so that the actual code doesn't look very different to what it -always used to. -**************************************************************************** -***************************************************************************/ - - -/* These versions of the macros use the stack, as normal */ - -#ifndef NO_RECURSE -#define REGISTER register -#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg) rx = match(ra,rb,rc,rd,re,rf,rg) -#define RRETURN(ra) return ra -#else - - -/* These versions of the macros manage a private stack on the heap. Note -that the rd argument of RMATCH isn't actually used. It's the md argument of -match(), which never changes. */ - -#define REGISTER - -#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg)\ - {\ - heapframe *newframe = (pcre_stack_malloc)(sizeof(heapframe));\ - if (setjmp(frame->Xwhere) == 0)\ - {\ - newframe->Xeptr = ra;\ - newframe->Xecode = rb;\ - newframe->Xoffset_top = rc;\ - newframe->Xims = re;\ - newframe->Xeptrb = rf;\ - newframe->Xflags = rg;\ - newframe->Xprevframe = frame;\ - frame = newframe;\ - DPRINTF(("restarting from line %d\n", __LINE__));\ - goto HEAP_RECURSE;\ - }\ - else\ - {\ - DPRINTF(("longjumped back to line %d\n", __LINE__));\ - frame = md->thisframe;\ - rx = frame->Xresult;\ - }\ - } - -#define RRETURN(ra)\ - {\ - heapframe *newframe = frame;\ - frame = newframe->Xprevframe;\ - (pcre_stack_free)(newframe);\ - if (frame != NULL)\ - {\ - frame->Xresult = ra;\ - md->thisframe = frame;\ - longjmp(frame->Xwhere, 1);\ - }\ - return ra;\ - } - - -/* Structure for remembering the local variables in a private frame */ - -typedef struct heapframe { - struct heapframe *Xprevframe; - - /* Function arguments that may change */ - - const uschar *Xeptr; - const uschar *Xecode; - int Xoffset_top; - long int Xims; - eptrblock *Xeptrb; - int Xflags; - - /* Function local variables */ - - const uschar *Xcallpat; - const uschar *Xcharptr; - const uschar *Xdata; - const uschar *Xnext; - const uschar *Xpp; - const uschar *Xprev; - const uschar *Xsaved_eptr; - - recursion_info Xnew_recursive; - - BOOL Xcur_is_word; - BOOL Xcondition; - BOOL Xminimize; - BOOL Xprev_is_word; - - unsigned long int Xoriginal_ims; - -#ifdef SUPPORT_UCP - int Xprop_type; - int Xprop_fail_result; - int Xprop_category; - int Xprop_chartype; - int Xprop_othercase; - int Xprop_test_against; - int *Xprop_test_variable; -#endif - - int Xctype; - int Xfc; - int Xfi; - int Xlength; - int Xmax; - int Xmin; - int Xnumber; - int Xoffset; - int Xop; - int Xsave_capture_last; - int Xsave_offset1, Xsave_offset2, Xsave_offset3; - int Xstacksave[REC_STACK_SAVE_MAX]; - - eptrblock Xnewptrb; - - /* Place to pass back result, and where to jump back to */ - - int Xresult; - jmp_buf Xwhere; - -} heapframe; - -#endif - - -/*************************************************************************** -***************************************************************************/ - - - -/************************************************* -* Match from current position * -*************************************************/ - -/* On entry ecode points to the first opcode, and eptr to the first character -in the subject string, while eptrb holds the value of eptr at the start of the -last bracketed group - used for breaking infinite loops matching zero-length -strings. This function is called recursively in many circumstances. Whenever it -returns a negative (error) response, the outer incarnation must also return the -same response. - -Performance note: It might be tempting to extract commonly used fields from the -md structure (e.g. utf8, end_subject) into individual variables to improve -performance. Tests using gcc on a SPARC disproved this; in the first case, it -made performance worse. - -Arguments: - eptr pointer in subject - ecode position in code - offset_top current top pointer - md pointer to "static" info for the match - ims current /i, /m, and /s options - eptrb pointer to chain of blocks containing eptr at start of - brackets - for testing for empty matches - flags can contain - match_condassert - this is an assertion condition - match_isgroup - this is the start of a bracketed group - -Returns: MATCH_MATCH if matched ) these values are >= 0 - MATCH_NOMATCH if failed to match ) - a negative PCRE_ERROR_xxx value if aborted by an error condition - (e.g. stopped by recursion limit) -*/ - -static int -match(REGISTER const uschar *eptr, REGISTER const uschar *ecode, - int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb, - int flags) -{ -/* These variables do not need to be preserved over recursion in this function, -so they can be ordinary variables in all cases. Mark them with "register" -because they are used a lot in loops. */ - -register int rrc; /* Returns from recursive calls */ -register int i; /* Used for loops not involving calls to RMATCH() */ -register int c; /* Character values not kept over RMATCH() calls */ -register BOOL utf8; /* Local copy of UTF-8 flag for speed */ - -/* When recursion is not being used, all "local" variables that have to be -preserved over calls to RMATCH() are part of a "frame" which is obtained from -heap storage. Set up the top-level frame here; others are obtained from the -heap whenever RMATCH() does a "recursion". See the macro definitions above. */ - -#ifdef NO_RECURSE -heapframe *frame = (pcre_stack_malloc)(sizeof(heapframe)); -frame->Xprevframe = NULL; /* Marks the top level */ - -/* Copy in the original argument variables */ - -frame->Xeptr = eptr; -frame->Xecode = ecode; -frame->Xoffset_top = offset_top; -frame->Xims = ims; -frame->Xeptrb = eptrb; -frame->Xflags = flags; - -/* This is where control jumps back to to effect "recursion" */ - -HEAP_RECURSE: - -/* Macros make the argument variables come from the current frame */ - -#define eptr frame->Xeptr -#define ecode frame->Xecode -#define offset_top frame->Xoffset_top -#define ims frame->Xims -#define eptrb frame->Xeptrb -#define flags frame->Xflags - -/* Ditto for the local variables */ - -#ifdef SUPPORT_UTF8 -#define charptr frame->Xcharptr -#endif -#define callpat frame->Xcallpat -#define data frame->Xdata -#define next frame->Xnext -#define pp frame->Xpp -#define prev frame->Xprev -#define saved_eptr frame->Xsaved_eptr - -#define new_recursive frame->Xnew_recursive - -#define cur_is_word frame->Xcur_is_word -#define condition frame->Xcondition -#define minimize frame->Xminimize -#define prev_is_word frame->Xprev_is_word - -#define original_ims frame->Xoriginal_ims - -#ifdef SUPPORT_UCP -#define prop_type frame->Xprop_type -#define prop_fail_result frame->Xprop_fail_result -#define prop_category frame->Xprop_category -#define prop_chartype frame->Xprop_chartype -#define prop_othercase frame->Xprop_othercase -#define prop_test_against frame->Xprop_test_against -#define prop_test_variable frame->Xprop_test_variable -#endif - -#define ctype frame->Xctype -#define fc frame->Xfc -#define fi frame->Xfi -#define length frame->Xlength -#define max frame->Xmax -#define min frame->Xmin -#define number frame->Xnumber -#define offset frame->Xoffset -#define op frame->Xop -#define save_capture_last frame->Xsave_capture_last -#define save_offset1 frame->Xsave_offset1 -#define save_offset2 frame->Xsave_offset2 -#define save_offset3 frame->Xsave_offset3 -#define stacksave frame->Xstacksave - -#define newptrb frame->Xnewptrb - -/* When recursion is being used, local variables are allocated on the stack and -get preserved during recursion in the normal way. In this environment, fi and -i, and fc and c, can be the same variables. */ - -#else -#define fi i -#define fc c - - -#ifdef SUPPORT_UTF8 /* Many of these variables are used ony */ -const uschar *charptr; /* small blocks of the code. My normal */ -#endif /* style of coding would have declared */ -const uschar *callpat; /* them within each of those blocks. */ -const uschar *data; /* However, in order to accommodate the */ -const uschar *next; /* version of this code that uses an */ -const uschar *pp; /* external "stack" implemented on the */ -const uschar *prev; /* heap, it is easier to declare them */ -const uschar *saved_eptr; /* all here, so the declarations can */ - /* be cut out in a block. The only */ -recursion_info new_recursive; /* declarations within blocks below are */ - /* for variables that do not have to */ -BOOL cur_is_word; /* be preserved over a recursive call */ -BOOL condition; /* to RMATCH(). */ -BOOL minimize; -BOOL prev_is_word; - -unsigned long int original_ims; - -#ifdef SUPPORT_UCP -int prop_type; -int prop_fail_result; -int prop_category; -int prop_chartype; -int prop_othercase; -int prop_test_against; -int *prop_test_variable; -#endif - -int ctype; -int length; -int max; -int min; -int number; -int offset; -int op; -int save_capture_last; -int save_offset1, save_offset2, save_offset3; -int stacksave[REC_STACK_SAVE_MAX]; - -eptrblock newptrb; -#endif - -/* These statements are here to stop the compiler complaining about unitialized -variables. */ - -#ifdef SUPPORT_UCP -prop_fail_result = 0; -prop_test_against = 0; -prop_test_variable = NULL; -#endif - -/* OK, now we can get on with the real code of the function. Recursion is -specified by the macros RMATCH and RRETURN. When NO_RECURSE is *not* defined, -these just turn into a recursive call to match() and a "return", respectively. -However, RMATCH isn't like a function call because it's quite a complicated -macro. It has to be used in one particular way. This shouldn't, however, impact -performance when true recursion is being used. */ - -if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); - -original_ims = ims; /* Save for resetting on ')' */ -utf8 = md->utf8; /* Local copy of the flag */ - -/* At the start of a bracketed group, add the current subject pointer to the -stack of such pointers, to be re-instated at the end of the group when we hit -the closing ket. When match() is called in other circumstances, we don't add to -this stack. */ - -if ((flags & match_isgroup) != 0) - { - newptrb.epb_prev = eptrb; - newptrb.epb_saved_eptr = eptr; - eptrb = &newptrb; - } - -/* Now start processing the operations. */ - -for (;;) - { - op = *ecode; - minimize = FALSE; - - /* For partial matching, remember if we ever hit the end of the subject after - matching at least one subject character. */ - - if (md->partial && - eptr >= md->end_subject && - eptr > md->start_match) - md->hitend = TRUE; - - /* Opening capturing bracket. If there is space in the offset vector, save - the current subject position in the working slot at the top of the vector. We - mustn't change the current values of the data slot, because they may be set - from a previous iteration of this group, and be referred to by a reference - inside the group. - - If the bracket fails to match, we need to restore this value and also the - values of the final offsets, in case they were set by a previous iteration of - the same bracket. - - If there isn't enough space in the offset vector, treat this as if it were a - non-capturing bracket. Don't worry about setting the flag for the error case - here; that is handled in the code for KET. */ - - if (op > OP_BRA) - { - number = op - OP_BRA; - - /* For extended extraction brackets (large number), we have to fish out the - number from a dummy opcode at the start. */ - - if (number > EXTRACT_BASIC_MAX) - number = GET2(ecode, 2+LINK_SIZE); - offset = number << 1; - -#ifdef DEBUG - printf("start bracket %d subject=", number); - pchars(eptr, 16, TRUE, md); - printf("\n"); -#endif - - if (offset < md->offset_max) - { - save_offset1 = md->offset_vector[offset]; - save_offset2 = md->offset_vector[offset+1]; - save_offset3 = md->offset_vector[md->offset_end - number]; - save_capture_last = md->capture_last; - - DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); - md->offset_vector[md->offset_end - number] = eptr - md->start_subject; - - do - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, - match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - md->capture_last = save_capture_last; - ecode += GET(ecode, 1); - } - while (*ecode == OP_ALT); - - DPRINTF(("bracket %d failed\n", number)); - - md->offset_vector[offset] = save_offset1; - md->offset_vector[offset+1] = save_offset2; - md->offset_vector[md->offset_end - number] = save_offset3; - - RRETURN(MATCH_NOMATCH); - } - - /* Insufficient room for saving captured contents */ - - else op = OP_BRA; - } - - /* Other types of node can be handled by a switch */ - - switch(op) - { - case OP_BRA: /* Non-capturing bracket: optimized */ - DPRINTF(("start bracket 0\n")); - do - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, - match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode += GET(ecode, 1); - } - while (*ecode == OP_ALT); - DPRINTF(("bracket 0 failed\n")); - RRETURN(MATCH_NOMATCH); - - /* Conditional group: compilation checked that there are no more than - two branches. If the condition is false, skipping the first branch takes us - past the end if there is only one branch, but that's OK because that is - exactly what going to the ket would do. */ - - case OP_COND: - if (ecode[LINK_SIZE+1] == OP_CREF) /* Condition extract or recurse test */ - { - offset = GET2(ecode, LINK_SIZE+2) << 1; /* Doubled ref number */ - condition = (offset == CREF_RECURSE * 2)? - (md->recursive != NULL) : - (offset < offset_top && md->offset_vector[offset] >= 0); - RMATCH(rrc, eptr, ecode + (condition? - (LINK_SIZE + 4) : (LINK_SIZE + 1 + GET(ecode, 1))), - offset_top, md, ims, eptrb, match_isgroup); - RRETURN(rrc); - } - - /* The condition is an assertion. Call match() to evaluate it - setting - the final argument TRUE causes it to stop at the end of an assertion. */ - - else - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, - match_condassert | match_isgroup); - if (rrc == MATCH_MATCH) - { - ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE+2); - while (*ecode == OP_ALT) ecode += GET(ecode, 1); - } - else if (rrc != MATCH_NOMATCH) - { - RRETURN(rrc); /* Need braces because of following else */ - } - else ecode += GET(ecode, 1); - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, - match_isgroup); - RRETURN(rrc); - } - /* Control never reaches here */ - - /* Skip over conditional reference or large extraction number data if - encountered. */ - - case OP_CREF: - case OP_BRANUMBER: - ecode += 3; - break; - - /* End of the pattern. If we are in a recursion, we should restore the - offsets appropriately and continue from after the call. */ - - case OP_END: - if (md->recursive != NULL && md->recursive->group_num == 0) - { - recursion_info *rec = md->recursive; - DPRINTF(("Hit the end in a (?0) recursion\n")); - md->recursive = rec->prevrec; - memmove(md->offset_vector, rec->offset_save, - rec->saved_max * sizeof(int)); - md->start_match = rec->save_start; - ims = original_ims; - ecode = rec->after_call; - break; - } - - /* Otherwise, if PCRE_NOTEMPTY is set, fail if we have matched an empty - string - backtracking will then try other alternatives, if any. */ - - if (md->notempty && eptr == md->start_match) RRETURN(MATCH_NOMATCH); - md->end_match_ptr = eptr; /* Record where we ended */ - md->end_offset_top = offset_top; /* and how many extracts were taken */ - RRETURN(MATCH_MATCH); - - /* Change option settings */ - - case OP_OPT: - ims = ecode[1]; - ecode += 2; - DPRINTF(("ims set to %02lx\n", ims)); - break; - - /* Assertion brackets. Check the alternative branches in turn - the - matching won't pass the KET for an assertion. If any one branch matches, - the assertion is true. Lookbehind assertions have an OP_REVERSE item at the - start of each branch to move the current point backwards, so the code at - this level is identical to the lookahead case. */ - - case OP_ASSERT: - case OP_ASSERTBACK: - do - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, - match_isgroup); - if (rrc == MATCH_MATCH) break; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode += GET(ecode, 1); - } - while (*ecode == OP_ALT); - if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH); - - /* If checking an assertion for a condition, return MATCH_MATCH. */ - - if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); - - /* Continue from after the assertion, updating the offsets high water - mark, since extracts may have been taken during the assertion. */ - - do ecode += GET(ecode,1); while (*ecode == OP_ALT); - ecode += 1 + LINK_SIZE; - offset_top = md->end_offset_top; - continue; - - /* Negative assertion: all branches must fail to match */ - - case OP_ASSERT_NOT: - case OP_ASSERTBACK_NOT: - do - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, - match_isgroup); - if (rrc == MATCH_MATCH) RRETURN(MATCH_NOMATCH); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode += GET(ecode,1); - } - while (*ecode == OP_ALT); - - if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); - - ecode += 1 + LINK_SIZE; - continue; - - /* Move the subject pointer back. This occurs only at the start of - each branch of a lookbehind assertion. If we are too close to the start to - move back, this match function fails. When working with UTF-8 we move - back a number of characters, not bytes. */ - - case OP_REVERSE: -#ifdef SUPPORT_UTF8 - if (utf8) - { - c = GET(ecode,1); - for (i = 0; i < c; i++) - { - eptr--; - if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); - BACKCHAR(eptr) - } - } - else -#endif - - /* No UTF-8 support, or not in UTF-8 mode: count is byte count */ - - { - eptr -= GET(ecode,1); - if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); - } - - /* Skip to next op code */ - - ecode += 1 + LINK_SIZE; - break; - - /* The callout item calls an external function, if one is provided, passing - details of the match so far. This is mainly for debugging, though the - function is able to force a failure. */ - - case OP_CALLOUT: - if (pcre_callout != NULL) - { - pcre_callout_block cb; - cb.version = 1; /* Version 1 of the callout block */ - cb.callout_number = ecode[1]; - cb.offset_vector = md->offset_vector; - cb.subject = (const char *)md->start_subject; - cb.subject_length = md->end_subject - md->start_subject; - cb.start_match = md->start_match - md->start_subject; - cb.current_position = eptr - md->start_subject; - cb.pattern_position = GET(ecode, 2); - cb.next_item_length = GET(ecode, 2 + LINK_SIZE); - cb.capture_top = offset_top/2; - cb.capture_last = md->capture_last; - cb.callout_data = md->callout_data; - if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH); - if (rrc < 0) RRETURN(rrc); - } - ecode += 2 + 2*LINK_SIZE; - break; - - /* Recursion either matches the current regex, or some subexpression. The - offset data is the offset to the starting bracket from the start of the - whole pattern. (This is so that it works from duplicated subpatterns.) - - If there are any capturing brackets started but not finished, we have to - save their starting points and reinstate them after the recursion. However, - we don't know how many such there are (offset_top records the completed - total) so we just have to save all the potential data. There may be up to - 65535 such values, which is too large to put on the stack, but using malloc - for small numbers seems expensive. As a compromise, the stack is used when - there are no more than REC_STACK_SAVE_MAX values to store; otherwise malloc - is used. A problem is what to do if the malloc fails ... there is no way of - returning to the top level with an error. Save the top REC_STACK_SAVE_MAX - values on the stack, and accept that the rest may be wrong. - - There are also other values that have to be saved. We use a chained - sequence of blocks that actually live on the stack. Thanks to Robin Houston - for the original version of this logic. */ - - case OP_RECURSE: - { - callpat = md->start_code + GET(ecode, 1); - new_recursive.group_num = *callpat - OP_BRA; - - /* For extended extraction brackets (large number), we have to fish out - the number from a dummy opcode at the start. */ - - if (new_recursive.group_num > EXTRACT_BASIC_MAX) - new_recursive.group_num = GET2(callpat, 2+LINK_SIZE); - - /* Add to "recursing stack" */ - - new_recursive.prevrec = md->recursive; - md->recursive = &new_recursive; - - /* Find where to continue from afterwards */ - - ecode += 1 + LINK_SIZE; - new_recursive.after_call = ecode; - - /* Now save the offset data. */ - - new_recursive.saved_max = md->offset_end; - if (new_recursive.saved_max <= REC_STACK_SAVE_MAX) - new_recursive.offset_save = stacksave; - else - { - new_recursive.offset_save = - (int *)(pcre_malloc)(new_recursive.saved_max * sizeof(int)); - if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY); - } - - memcpy(new_recursive.offset_save, md->offset_vector, - new_recursive.saved_max * sizeof(int)); - new_recursive.save_start = md->start_match; - md->start_match = eptr; - - /* OK, now we can do the recursion. For each top-level alternative we - restore the offset and recursion data. */ - - DPRINTF(("Recursing into group %d\n", new_recursive.group_num)); - do - { - RMATCH(rrc, eptr, callpat + 1 + LINK_SIZE, offset_top, md, ims, - eptrb, match_isgroup); - if (rrc == MATCH_MATCH) - { - md->recursive = new_recursive.prevrec; - if (new_recursive.offset_save != stacksave) - (pcre_free)(new_recursive.offset_save); - RRETURN(MATCH_MATCH); - } - else if (rrc != MATCH_NOMATCH) RRETURN(rrc); - - md->recursive = &new_recursive; - memcpy(md->offset_vector, new_recursive.offset_save, - new_recursive.saved_max * sizeof(int)); - callpat += GET(callpat, 1); - } - while (*callpat == OP_ALT); - - DPRINTF(("Recursion didn't match\n")); - md->recursive = new_recursive.prevrec; - if (new_recursive.offset_save != stacksave) - (pcre_free)(new_recursive.offset_save); - RRETURN(MATCH_NOMATCH); - } - /* Control never reaches here */ - - /* "Once" brackets are like assertion brackets except that after a match, - the point in the subject string is not moved back. Thus there can never be - a move back into the brackets. Friedl calls these "atomic" subpatterns. - Check the alternative branches in turn - the matching won't pass the KET - for this kind of subpattern. If any one branch matches, we carry on as at - the end of a normal bracket, leaving the subject pointer. */ - - case OP_ONCE: - { - prev = ecode; - saved_eptr = eptr; - - do - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, - eptrb, match_isgroup); - if (rrc == MATCH_MATCH) break; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode += GET(ecode,1); - } - while (*ecode == OP_ALT); - - /* If hit the end of the group (which could be repeated), fail */ - - if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH); - - /* Continue as from after the assertion, updating the offsets high water - mark, since extracts may have been taken. */ - - do ecode += GET(ecode,1); while (*ecode == OP_ALT); - - offset_top = md->end_offset_top; - eptr = md->end_match_ptr; - - /* For a non-repeating ket, just continue at this level. This also - happens for a repeating ket if no characters were matched in the group. - This is the forcible breaking of infinite loops as implemented in Perl - 5.005. If there is an options reset, it will get obeyed in the normal - course of events. */ - - if (*ecode == OP_KET || eptr == saved_eptr) - { - ecode += 1+LINK_SIZE; - break; - } - - /* The repeating kets try the rest of the pattern or restart from the - preceding bracket, in the appropriate order. We need to reset any options - that changed within the bracket before re-running it, so check the next - opcode. */ - - if (ecode[1+LINK_SIZE] == OP_OPT) - { - ims = (ims & ~PCRE_IMS) | ecode[4]; - DPRINTF(("ims set to %02lx at group repeat\n", ims)); - } - - if (*ecode == OP_KETRMIN) - { - RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - else /* OP_KETRMAX */ - { - RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - } - RRETURN(MATCH_NOMATCH); - - /* An alternation is the end of a branch; scan along to find the end of the - bracketed group and go to there. */ - - case OP_ALT: - do ecode += GET(ecode,1); while (*ecode == OP_ALT); - break; - - /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating - that it may occur zero times. It may repeat infinitely, or not at all - - i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper - repeat limits are compiled as a number of copies, with the optional ones - preceded by BRAZERO or BRAMINZERO. */ - - case OP_BRAZERO: - { - next = ecode+1; - RMATCH(rrc, eptr, next, offset_top, md, ims, eptrb, match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - do next += GET(next,1); while (*next == OP_ALT); - ecode = next + 1+LINK_SIZE; - } - break; - - case OP_BRAMINZERO: - { - next = ecode+1; - do next += GET(next,1); while (*next == OP_ALT); - RMATCH(rrc, eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb, - match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode++; - } - break; - - /* End of a group, repeated or non-repeating. If we are at the end of - an assertion "group", stop matching and return MATCH_MATCH, but record the - current high water mark for use by positive assertions. Do this also - for the "once" (not-backup up) groups. */ - - case OP_KET: - case OP_KETRMIN: - case OP_KETRMAX: - { - prev = ecode - GET(ecode, 1); - saved_eptr = eptrb->epb_saved_eptr; - - /* Back up the stack of bracket start pointers. */ - - eptrb = eptrb->epb_prev; - - if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT || - *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT || - *prev == OP_ONCE) - { - md->end_match_ptr = eptr; /* For ONCE */ - md->end_offset_top = offset_top; - RRETURN(MATCH_MATCH); - } - - /* In all other cases except a conditional group we have to check the - group number back at the start and if necessary complete handling an - extraction by setting the offsets and bumping the high water mark. */ - - if (*prev != OP_COND) - { - number = *prev - OP_BRA; - - /* For extended extraction brackets (large number), we have to fish out - the number from a dummy opcode at the start. */ - - if (number > EXTRACT_BASIC_MAX) number = GET2(prev, 2+LINK_SIZE); - offset = number << 1; - -#ifdef DEBUG - printf("end bracket %d", number); - printf("\n"); -#endif - - /* Test for a numbered group. This includes groups called as a result - of recursion. Note that whole-pattern recursion is coded as a recurse - into group 0, so it won't be picked up here. Instead, we catch it when - the OP_END is reached. */ - - if (number > 0) - { - md->capture_last = number; - if (offset >= md->offset_max) md->offset_overflow = TRUE; else - { - md->offset_vector[offset] = - md->offset_vector[md->offset_end - number]; - md->offset_vector[offset+1] = eptr - md->start_subject; - if (offset_top <= offset) offset_top = offset + 2; - } - - /* Handle a recursively called group. Restore the offsets - appropriately and continue from after the call. */ - - if (md->recursive != NULL && md->recursive->group_num == number) - { - recursion_info *rec = md->recursive; - DPRINTF(("Recursion (%d) succeeded - continuing\n", number)); - md->recursive = rec->prevrec; - md->start_match = rec->save_start; - memcpy(md->offset_vector, rec->offset_save, - rec->saved_max * sizeof(int)); - ecode = rec->after_call; - ims = original_ims; - break; - } - } - } - - /* Reset the value of the ims flags, in case they got changed during - the group. */ - - ims = original_ims; - DPRINTF(("ims reset to %02lx\n", ims)); - - /* For a non-repeating ket, just continue at this level. This also - happens for a repeating ket if no characters were matched in the group. - This is the forcible breaking of infinite loops as implemented in Perl - 5.005. If there is an options reset, it will get obeyed in the normal - course of events. */ - - if (*ecode == OP_KET || eptr == saved_eptr) - { - ecode += 1 + LINK_SIZE; - break; - } - - /* The repeating kets try the rest of the pattern or restart from the - preceding bracket, in the appropriate order. */ - - if (*ecode == OP_KETRMIN) - { - RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - else /* OP_KETRMAX */ - { - RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - } - - RRETURN(MATCH_NOMATCH); - - /* Start of subject unless notbol, or after internal newline if multiline */ - - case OP_CIRC: - if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); - if ((ims & PCRE_MULTILINE) != 0) - { - if (eptr != md->start_subject && eptr[-1] != NEWLINE) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - } - /* ... else fall through */ - - /* Start of subject assertion */ - - case OP_SOD: - if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH); - ecode++; - break; - - /* Start of match assertion */ - - case OP_SOM: - if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH); - ecode++; - break; - - /* Assert before internal newline if multiline, or before a terminating - newline unless endonly is set, else end of subject unless noteol is set. */ - - case OP_DOLL: - if ((ims & PCRE_MULTILINE) != 0) - { - if (eptr < md->end_subject) - { if (*eptr != NEWLINE) RRETURN(MATCH_NOMATCH); } - else - { if (md->noteol) RRETURN(MATCH_NOMATCH); } - ecode++; - break; - } - else - { - if (md->noteol) RRETURN(MATCH_NOMATCH); - if (!md->endonly) - { - if (eptr < md->end_subject - 1 || - (eptr == md->end_subject - 1 && *eptr != NEWLINE)) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - } - } - /* ... else fall through */ - - /* End of subject assertion (\z) */ - - case OP_EOD: - if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH); - ecode++; - break; - - /* End of subject or ending \n assertion (\Z) */ - - case OP_EODN: - if (eptr < md->end_subject - 1 || - (eptr == md->end_subject - 1 && *eptr != NEWLINE)) RRETURN(MATCH_NOMATCH); - ecode++; - break; - - /* Word boundary assertions */ - - case OP_NOT_WORD_BOUNDARY: - case OP_WORD_BOUNDARY: - { - - /* Find out if the previous and current characters are "word" characters. - It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to - be "non-word" characters. */ - -#ifdef SUPPORT_UTF8 - if (utf8) - { - if (eptr == md->start_subject) prev_is_word = FALSE; else - { - const uschar *lastptr = eptr - 1; - while((*lastptr & 0xc0) == 0x80) lastptr--; - GETCHAR(c, lastptr); - prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; - } - if (eptr >= md->end_subject) cur_is_word = FALSE; else - { - GETCHAR(c, eptr); - cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; - } - } - else -#endif - - /* More streamlined when not in UTF-8 mode */ - - { - prev_is_word = (eptr != md->start_subject) && - ((md->ctypes[eptr[-1]] & ctype_word) != 0); - cur_is_word = (eptr < md->end_subject) && - ((md->ctypes[*eptr] & ctype_word) != 0); - } - - /* Now see if the situation is what we want */ - - if ((*ecode++ == OP_WORD_BOUNDARY)? - cur_is_word == prev_is_word : cur_is_word != prev_is_word) - RRETURN(MATCH_NOMATCH); - } - break; - - /* Match a single character type; inline for speed */ - - case OP_ANY: - if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && *eptr == NEWLINE) - RRETURN(MATCH_NOMATCH); - if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); -#ifdef SUPPORT_UTF8 - if (utf8) - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; -#endif - ecode++; - break; - - /* Match a single byte, even in UTF-8 mode. This opcode really does match - any byte, even newline, independent of the setting of PCRE_DOTALL. */ - - case OP_ANYBYTE: - if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_NOT_DIGIT: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c < 256 && -#endif - (md->ctypes[c] & ctype_digit) != 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_DIGIT: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c >= 256 || -#endif - (md->ctypes[c] & ctype_digit) == 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_NOT_WHITESPACE: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c < 256 && -#endif - (md->ctypes[c] & ctype_space) != 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_WHITESPACE: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c >= 256 || -#endif - (md->ctypes[c] & ctype_space) == 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_NOT_WORDCHAR: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c < 256 && -#endif - (md->ctypes[c] & ctype_word) != 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - - case OP_WORDCHAR: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - if ( -#ifdef SUPPORT_UTF8 - c >= 256 || -#endif - (md->ctypes[c] & ctype_word) == 0 - ) - RRETURN(MATCH_NOMATCH); - ecode++; - break; - -#ifdef SUPPORT_UCP - /* Check the next character by Unicode property. We will get here only - if the support is in the binary; otherwise a compile-time error occurs. */ - - case OP_PROP: - case OP_NOTPROP: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - { - int chartype, rqdtype; - int othercase; - int category = ucp_findchar(c, &chartype, &othercase); - - rqdtype = *(++ecode); - ecode++; - - if (rqdtype >= 128) - { - if ((rqdtype - 128 != category) == (op == OP_PROP)) - RRETURN(MATCH_NOMATCH); - } - else - { - if ((rqdtype != chartype) == (op == OP_PROP)) - RRETURN(MATCH_NOMATCH); - } - } - break; - - /* Match an extended Unicode sequence. We will get here only if the support - is in the binary; otherwise a compile-time error occurs. */ - - case OP_EXTUNI: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - { - int chartype; - int othercase; - int category = ucp_findchar(c, &chartype, &othercase); - if (category == ucp_M) RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject) - { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - category = ucp_findchar(c, &chartype, &othercase); - if (category != ucp_M) break; - eptr += len; - } - } - ecode++; - break; -#endif - - - /* Match a back reference, possibly repeatedly. Look past the end of the - item to see if there is repeat information following. The code is similar - to that for character classes, but repeated for efficiency. Then obey - similar code to character type repeats - written out again for speed. - However, if the referenced string is the empty string, always treat - it as matched, any number of times (otherwise there could be infinite - loops). */ - - case OP_REF: - { - offset = GET2(ecode, 1) << 1; /* Doubled ref number */ - ecode += 3; /* Advance past item */ - - /* If the reference is unset, set the length to be longer than the amount - of subject left; this ensures that every attempt at a match fails. We - can't just fail here, because of the possibility of quantifiers with zero - minima. */ - - length = (offset >= offset_top || md->offset_vector[offset] < 0)? - md->end_subject - eptr + 1 : - md->offset_vector[offset+1] - md->offset_vector[offset]; - - /* Set up for repetition, or handle the non-repeated case */ - - switch (*ecode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPLUS: - case OP_CRMINPLUS: - case OP_CRQUERY: - case OP_CRMINQUERY: - c = *ecode++ - OP_CRSTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - minimize = (*ecode == OP_CRMINRANGE); - min = GET2(ecode, 1); - max = GET2(ecode, 3); - if (max == 0) max = INT_MAX; - ecode += 5; - break; - - default: /* No repeat follows */ - if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH); - eptr += length; - continue; /* With the main loop */ - } - - /* If the length of the reference is zero, just continue with the - main loop. */ - - if (length == 0) continue; - - /* First, ensure the minimum number of matches are present. We get back - the length of the reference string explicitly rather than passing the - address of eptr, so that eptr can be a register variable. */ - - for (i = 1; i <= min; i++) - { - if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH); - eptr += length; - } - - /* If min = max, continue at the same level without recursion. - They are not both allowed to be zero. */ - - if (min == max) continue; - - /* If minimizing, keep trying and advancing the pointer */ - - if (minimize) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || !match_ref(offset, eptr, length, md, ims)) - RRETURN(MATCH_NOMATCH); - eptr += length; - } - /* Control never gets here */ - } - - /* If maximizing, find the longest string and work backwards */ - - else - { - pp = eptr; - for (i = min; i < max; i++) - { - if (!match_ref(offset, eptr, length, md, ims)) break; - eptr += length; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - eptr -= length; - } - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - - - - /* Match a bit-mapped character class, possibly repeatedly. This op code is - used when all the characters in the class have values in the range 0-255, - and either the matching is caseful, or the characters are in the range - 0-127 when UTF-8 processing is enabled. The only difference between - OP_CLASS and OP_NCLASS occurs when a data character outside the range is - encountered. - - First, look past the end of the item to see if there is repeat information - following. Then obey similar code to character type repeats - written out - again for speed. */ - - case OP_NCLASS: - case OP_CLASS: - { - data = ecode + 1; /* Save for matching */ - ecode += 33; /* Advance past the item */ - - switch (*ecode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPLUS: - case OP_CRMINPLUS: - case OP_CRQUERY: - case OP_CRMINQUERY: - c = *ecode++ - OP_CRSTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - minimize = (*ecode == OP_CRMINRANGE); - min = GET2(ecode, 1); - max = GET2(ecode, 3); - if (max == 0) max = INT_MAX; - ecode += 5; - break; - - default: /* No repeat follows */ - min = max = 1; - break; - } - - /* First, ensure the minimum number of matches are present. */ - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - if (c > 255) - { - if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); - } - else - { - if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); - } - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - c = *eptr++; - if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); - } - } - - /* If max == min we can continue with the main loop without the - need to recurse. */ - - if (min == max) continue; - - /* If minimizing, keep testing the rest of the expression and advancing - the pointer while it matches the class. */ - - if (minimize) - { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - if (c > 255) - { - if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); - } - else - { - if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); - } - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - c = *eptr++; - if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - } - - /* If maximizing, find the longest possible run, then work backwards. */ - - else - { - pp = eptr; - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c > 255) - { - if (op == OP_CLASS) break; - } - else - { - if ((data[c/8] & (1 << (c&7))) == 0) break; - } - eptr += len; - } - for (;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject) break; - c = *eptr; - if ((data[c/8] & (1 << (c&7))) == 0) break; - eptr++; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - eptr--; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - } - - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - - - /* Match an extended character class. This opcode is encountered only - in UTF-8 mode, because that's the only time it is compiled. */ - -#ifdef SUPPORT_UTF8 - case OP_XCLASS: - { - data = ecode + 1 + LINK_SIZE; /* Save for matching */ - ecode += GET(ecode, 1); /* Advance past the item */ - - switch (*ecode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPLUS: - case OP_CRMINPLUS: - case OP_CRQUERY: - case OP_CRMINQUERY: - c = *ecode++ - OP_CRSTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - minimize = (*ecode == OP_CRMINRANGE); - min = GET2(ecode, 1); - max = GET2(ecode, 3); - if (max == 0) max = INT_MAX; - ecode += 5; - break; - - default: /* No repeat follows */ - min = max = 1; - break; - } - - /* First, ensure the minimum number of matches are present. */ - - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); - } - - /* If max == min we can continue with the main loop without the - need to recurse. */ - - if (min == max) continue; - - /* If minimizing, keep testing the rest of the expression and advancing - the pointer while it matches the class. */ - - if (minimize) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - - /* If maximizing, find the longest possible run, then work backwards. */ - - else - { - pp = eptr; - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (!_pcre_xclass(c, data)) break; - eptr += len; - } - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr) - } - RRETURN(MATCH_NOMATCH); - } - - /* Control never gets here */ - } -#endif /* End of XCLASS */ - - /* Match a single character, casefully */ - - case OP_CHAR: -#ifdef SUPPORT_UTF8 - if (utf8) - { - length = 1; - ecode++; - GETCHARLEN(fc, ecode, length); - if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); - } - else -#endif - - /* Non-UTF-8 mode */ - { - if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); - if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); - ecode += 2; - } - break; - - /* Match a single character, caselessly */ - - case OP_CHARNC: -#ifdef SUPPORT_UTF8 - if (utf8) - { - length = 1; - ecode++; - GETCHARLEN(fc, ecode, length); - - if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - - /* If the pattern character's value is < 128, we have only one byte, and - can use the fast lookup table. */ - - if (fc < 128) - { - if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); - } - - /* Otherwise we must pick up the subject character */ - - else - { - int dc; - GETCHARINC(dc, eptr); - ecode += length; - - /* If we have Unicode property support, we can use it to test the other - case of the character, if there is one. The result of ucp_findchar() is - < 0 if the char isn't found, and othercase is returned as zero if there - isn't one. */ - - if (fc != dc) - { -#ifdef SUPPORT_UCP - int chartype; - int othercase; - if (ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) -#endif - RRETURN(MATCH_NOMATCH); - } - } - } - else -#endif /* SUPPORT_UTF8 */ - - /* Non-UTF-8 mode */ - { - if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); - if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); - ecode += 2; - } - break; - - /* Match a single character repeatedly; different opcodes share code. */ - - case OP_EXACT: - min = max = GET2(ecode, 1); - ecode += 3; - goto REPEATCHAR; - - case OP_UPTO: - case OP_MINUPTO: - min = 0; - max = GET2(ecode, 1); - minimize = *ecode == OP_MINUPTO; - ecode += 3; - goto REPEATCHAR; - - case OP_STAR: - case OP_MINSTAR: - case OP_PLUS: - case OP_MINPLUS: - case OP_QUERY: - case OP_MINQUERY: - c = *ecode++ - OP_STAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - - /* Common code for all repeated single-character matches. We can give - up quickly if there are fewer than the minimum number of characters left in - the subject. */ - - REPEATCHAR: -#ifdef SUPPORT_UTF8 - if (utf8) - { - length = 1; - charptr = ecode; - GETCHARLEN(fc, ecode, length); - if (min * length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - ecode += length; - - /* Handle multibyte character matching specially here. There is - support for caseless matching if UCP support is present. */ - - if (length > 1) - { - int oclength = 0; - uschar occhars[8]; - -#ifdef SUPPORT_UCP - int othercase; - int chartype; - if ((ims & PCRE_CASELESS) != 0 && - ucp_findchar(fc, &chartype, &othercase) >= 0 && - othercase > 0) - oclength = _pcre_ord2utf8(othercase, occhars); -#endif /* SUPPORT_UCP */ - - for (i = 1; i <= min; i++) - { - if (memcmp(eptr, charptr, length) == 0) eptr += length; - /* Need braces because of following else */ - else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } - else - { - if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH); - eptr += oclength; - } - } - - if (min == max) continue; - - if (minimize) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - if (memcmp(eptr, charptr, length) == 0) eptr += length; - /* Need braces because of following else */ - else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } - else - { - if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH); - eptr += oclength; - } - } - /* Control never gets here */ - } - else - { - pp = eptr; - for (i = min; i < max; i++) - { - if (eptr > md->end_subject - length) break; - if (memcmp(eptr, charptr, length) == 0) eptr += length; - else if (oclength == 0) break; - else - { - if (memcmp(eptr, occhars, oclength) != 0) break; - eptr += oclength; - } - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - eptr -= length; - } - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - - /* If the length of a UTF-8 character is 1, we fall through here, and - obey the code as for non-UTF-8 characters below, though in this case the - value of fc will always be < 128. */ - } - else -#endif /* SUPPORT_UTF8 */ - - /* When not in UTF-8 mode, load a single-byte character. */ - { - if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - fc = *ecode++; - } - - /* The value of fc at this point is always less than 256, though we may or - may not be in UTF-8 mode. The code is duplicated for the caseless and - caseful cases, for speed, since matching characters is likely to be quite - common. First, ensure the minimum number of matches are present. If min = - max, continue at the same level without recursing. Otherwise, if - minimizing, keep trying the rest of the expression and advancing one - matching character if failing, up to the maximum. Alternatively, if - maximizing, find the maximum number of characters and work backwards. */ - - DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, - max, eptr)); - - if ((ims & PCRE_CASELESS) != 0) - { - fc = md->lcc[fc]; - for (i = 1; i <= min; i++) - if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); - if (min == max) continue; - if (minimize) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject || - fc != md->lcc[*eptr++]) - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - else - { - pp = eptr; - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || fc != md->lcc[*eptr]) break; - eptr++; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - eptr--; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - - /* Caseful comparisons (includes all multi-byte characters) */ - - else - { - for (i = 1; i <= min; i++) if (fc != *eptr++) RRETURN(MATCH_NOMATCH); - if (min == max) continue; - if (minimize) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject || fc != *eptr++) - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - else - { - pp = eptr; - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || fc != *eptr) break; - eptr++; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - eptr--; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - - /* Match a negated single one-byte character. The character we are - checking can be multibyte. */ - - case OP_NOT: - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - ecode++; - GETCHARINCTEST(c, eptr); - if ((ims & PCRE_CASELESS) != 0) - { -#ifdef SUPPORT_UTF8 - if (c < 256) -#endif - c = md->lcc[c]; - if (md->lcc[*ecode++] == c) RRETURN(MATCH_NOMATCH); - } - else - { - if (*ecode++ == c) RRETURN(MATCH_NOMATCH); - } - break; - - /* Match a negated single one-byte character repeatedly. This is almost a - repeat of the code for a repeated single character, but I haven't found a - nice way of commoning these up that doesn't require a test of the - positive/negative option for each character match. Maybe that wouldn't add - very much to the time taken, but character matching *is* what this is all - about... */ - - case OP_NOTEXACT: - min = max = GET2(ecode, 1); - ecode += 3; - goto REPEATNOTCHAR; - - case OP_NOTUPTO: - case OP_NOTMINUPTO: - min = 0; - max = GET2(ecode, 1); - minimize = *ecode == OP_NOTMINUPTO; - ecode += 3; - goto REPEATNOTCHAR; - - case OP_NOTSTAR: - case OP_NOTMINSTAR: - case OP_NOTPLUS: - case OP_NOTMINPLUS: - case OP_NOTQUERY: - case OP_NOTMINQUERY: - c = *ecode++ - OP_NOTSTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - - /* Common code for all repeated single-byte matches. We can give up quickly - if there are fewer than the minimum number of bytes left in the - subject. */ - - REPEATNOTCHAR: - if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - fc = *ecode++; - - /* The code is duplicated for the caseless and caseful cases, for speed, - since matching characters is likely to be quite common. First, ensure the - minimum number of matches are present. If min = max, continue at the same - level without recursing. Otherwise, if minimizing, keep trying the rest of - the expression and advancing one matching character if failing, up to the - maximum. Alternatively, if maximizing, find the maximum number of - characters and work backwards. */ - - DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, - max, eptr)); - - if ((ims & PCRE_CASELESS) != 0) - { - fc = md->lcc[fc]; - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (i = 1; i <= min; i++) - { - GETCHARINC(d, eptr); - if (d < 256) d = md->lcc[d]; - if (fc == d) RRETURN(MATCH_NOMATCH); - } - } - else -#endif - - /* Not UTF-8 mode */ - { - for (i = 1; i <= min; i++) - if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); - } - - if (min == max) continue; - - if (minimize) - { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - GETCHARINC(d, eptr); - if (d < 256) d = md->lcc[d]; - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject || fc == md->lcc[*eptr++]) - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - } - - /* Maximize case */ - - else - { - pp = eptr; - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(d, eptr, len); - if (d < 256) d = md->lcc[d]; - if (fc == d) break; - eptr += len; - } - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break; - eptr++; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - eptr--; - } - } - - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - } - - /* Caseful comparisons */ - - else - { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (i = 1; i <= min; i++) - { - GETCHARINC(d, eptr); - if (fc == d) RRETURN(MATCH_NOMATCH); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (i = 1; i <= min; i++) - if (fc == *eptr++) RRETURN(MATCH_NOMATCH); - } - - if (min == max) continue; - - if (minimize) - { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - GETCHARINC(d, eptr); - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject || fc == *eptr++) - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - } - - /* Maximize case */ - - else - { - pp = eptr; - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - register int d; - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(d, eptr, len); - if (fc == d) break; - eptr += len; - } - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr); - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || fc == *eptr) break; - eptr++; - } - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - eptr--; - } - } - - RRETURN(MATCH_NOMATCH); - } - } - /* Control never gets here */ - - /* Match a single character type repeatedly; several different opcodes - share code. This is very similar to the code for single characters, but we - repeat it in the interests of efficiency. */ - - case OP_TYPEEXACT: - min = max = GET2(ecode, 1); - minimize = TRUE; - ecode += 3; - goto REPEATTYPE; - - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - min = 0; - max = GET2(ecode, 1); - minimize = *ecode == OP_TYPEMINUPTO; - ecode += 3; - goto REPEATTYPE; - - case OP_TYPESTAR: - case OP_TYPEMINSTAR: - case OP_TYPEPLUS: - case OP_TYPEMINPLUS: - case OP_TYPEQUERY: - case OP_TYPEMINQUERY: - c = *ecode++ - OP_TYPESTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - - /* Common code for all repeated single character type matches. Note that - in UTF-8 mode, '.' matches a character of any length, but for the other - character types, the valid characters are all one-byte long. */ - - REPEATTYPE: - ctype = *ecode++; /* Code for the character type */ - -#ifdef SUPPORT_UCP - if (ctype == OP_PROP || ctype == OP_NOTPROP) - { - prop_fail_result = ctype == OP_NOTPROP; - prop_type = *ecode++; - if (prop_type >= 128) - { - prop_test_against = prop_type - 128; - prop_test_variable = &prop_category; - } - else - { - prop_test_against = prop_type; - prop_test_variable = &prop_chartype; - } - } - else prop_type = -1; -#endif - - /* First, ensure the minimum number of matches are present. Use inline - code for maximizing the speed, and do the type test once at the start - (i.e. keep it out of the loop). Also we can test that there are at least - the minimum number of bytes before we start. This isn't as effective in - UTF-8 mode, but it does no harm. Separate the UTF-8 code completely as that - is tidier. Also separate the UCP code, which can be the same for both UTF-8 - and single-bytes. */ - - if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); - if (min > 0) - { -#ifdef SUPPORT_UCP - if (prop_type > 0) - { - for (i = 1; i <= min; i++) - { - GETCHARINC(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if ((*prop_test_variable == prop_test_against) == prop_fail_result) - RRETURN(MATCH_NOMATCH); - } - } - - /* Match extended Unicode sequences. We will get here only if the - support is in the binary; otherwise a compile-time error occurs. */ - - else if (ctype == OP_EXTUNI) - { - for (i = 1; i <= min; i++) - { - GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject) - { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category != ucp_M) break; - eptr += len; - } - } - } - - else -#endif /* SUPPORT_UCP */ - -/* Handle all other cases when the coding is UTF-8 */ - -#ifdef SUPPORT_UTF8 - if (utf8) switch(ctype) - { - case OP_ANY: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - (*eptr++ == NEWLINE && (ims & PCRE_DOTALL) == 0)) - RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; - } - break; - - case OP_ANYBYTE: - eptr += min; - break; - - case OP_NOT_DIGIT: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) - RRETURN(MATCH_NOMATCH); - } - break; - - case OP_DIGIT: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - *eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0) - RRETURN(MATCH_NOMATCH); - /* No need to skip more bytes - we know it's a 1-byte character */ - } - break; - - case OP_NOT_WHITESPACE: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - (*eptr < 128 && (md->ctypes[*eptr++] & ctype_space) != 0)) - RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; - } - break; - - case OP_WHITESPACE: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - *eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0) - RRETURN(MATCH_NOMATCH); - /* No need to skip more bytes - we know it's a 1-byte character */ - } - break; - - case OP_NOT_WORDCHAR: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - (*eptr < 128 && (md->ctypes[*eptr++] & ctype_word) != 0)) - RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; - } - break; - - case OP_WORDCHAR: - for (i = 1; i <= min; i++) - { - if (eptr >= md->end_subject || - *eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0) - RRETURN(MATCH_NOMATCH); - /* No need to skip more bytes - we know it's a 1-byte character */ - } - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } /* End switch(ctype) */ - - else -#endif /* SUPPORT_UTF8 */ - - /* Code for the non-UTF-8 case for minimum matching of operators other - than OP_PROP and OP_NOTPROP. */ - - switch(ctype) - { - case OP_ANY: - if ((ims & PCRE_DOTALL) == 0) - { - for (i = 1; i <= min; i++) - if (*eptr++ == NEWLINE) RRETURN(MATCH_NOMATCH); - } - else eptr += min; - break; - - case OP_ANYBYTE: - eptr += min; - break; - - case OP_NOT_DIGIT: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_DIGIT: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WHITESPACE: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_WHITESPACE: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WORDCHAR: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_word) != 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_WORDCHAR: - for (i = 1; i <= min; i++) - if ((md->ctypes[*eptr++] & ctype_word) == 0) - RRETURN(MATCH_NOMATCH); - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } - } - - /* If min = max, continue at the same level without recursing */ - - if (min == max) continue; - - /* If minimizing, we have to test the rest of the pattern before each - subsequent match. Again, separate the UTF-8 case for speed, and also - separate the UCP cases. */ - - if (minimize) - { -#ifdef SUPPORT_UCP - if (prop_type > 0) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINC(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if ((*prop_test_variable == prop_test_against) == prop_fail_result) - RRETURN(MATCH_NOMATCH); - } - } - - /* Match extended Unicode sequences. We will get here only if the - support is in the binary; otherwise a compile-time error occurs. */ - - else if (ctype == OP_EXTUNI) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject) - { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category != ucp_M) break; - eptr += len; - } - } - } - - else -#endif /* SUPPORT_UCP */ - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - - GETCHARINC(c, eptr); - switch(ctype) - { - case OP_ANY: - if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH); - break; - - case OP_ANYBYTE: - break; - - case OP_NOT_DIGIT: - if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_DIGIT: - if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WHITESPACE: - if (c < 256 && (md->ctypes[c] & ctype_space) != 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_WHITESPACE: - if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WORDCHAR: - if (c < 256 && (md->ctypes[c] & ctype_word) != 0) - RRETURN(MATCH_NOMATCH); - break; - - case OP_WORDCHAR: - if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) - RRETURN(MATCH_NOMATCH); - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } - } - } - else -#endif - /* Not UTF-8 mode */ - { - for (fi = min;; fi++) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); - c = *eptr++; - switch(ctype) - { - case OP_ANY: - if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH); - break; - - case OP_ANYBYTE: - break; - - case OP_NOT_DIGIT: - if ((md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_DIGIT: - if ((md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WHITESPACE: - if ((md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_WHITESPACE: - if ((md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_NOT_WORDCHAR: - if ((md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); - break; - - case OP_WORDCHAR: - if ((md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } - } - } - /* Control never gets here */ - } - - /* If maximizing it is worth using inline code for speed, doing the type - test once at the start (i.e. keep it out of the loop). Again, keep the - UTF-8 and UCP stuff separate. */ - - else - { - pp = eptr; /* Remember where we started */ - -#ifdef SUPPORT_UCP - if (prop_type > 0) - { - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if ((*prop_test_variable == prop_test_against) == prop_fail_result) - break; - eptr+= len; - } - - /* eptr is now past the end of the maximum run */ - - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr); - } - } - - /* Match extended Unicode sequences. We will get here only if the - support is in the binary; otherwise a compile-time error occurs. */ - - else if (ctype == OP_EXTUNI) - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject) break; - GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category == ucp_M) break; - while (eptr < md->end_subject) - { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category != ucp_M) break; - eptr += len; - } - } - - /* eptr is now past the end of the maximum run */ - - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - for (;;) /* Move back over one extended */ - { - int len = 1; - BACKCHAR(eptr); - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); - if (prop_category != ucp_M) break; - eptr--; - } - } - } - - else -#endif /* SUPPORT_UCP */ - -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - - if (utf8) - { - switch(ctype) - { - case OP_ANY: - - /* Special code is required for UTF8, but when the maximum is unlimited - we don't need it, so we repeat the non-UTF8 code. This is probably - worth it, because .* is quite a common idiom. */ - - if (max < INT_MAX) - { - if ((ims & PCRE_DOTALL) == 0) - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || *eptr == NEWLINE) break; - eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; - } - } - else - { - for (i = min; i < max; i++) - { - eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; - } - } - } - - /* Handle unlimited UTF-8 repeat */ - - else - { - if ((ims & PCRE_DOTALL) == 0) - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || *eptr == NEWLINE) break; - eptr++; - } - break; - } - else - { - c = max - min; - if (c > md->end_subject - eptr) c = md->end_subject - eptr; - eptr += c; - } - } - break; - - /* The byte case is the same as non-UTF8 */ - - case OP_ANYBYTE: - c = max - min; - if (c > md->end_subject - eptr) c = md->end_subject - eptr; - eptr += c; - break; - - case OP_NOT_DIGIT: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break; - eptr+= len; - } - break; - - case OP_DIGIT: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break; - eptr+= len; - } - break; - - case OP_NOT_WHITESPACE: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c < 256 && (md->ctypes[c] & ctype_space) != 0) break; - eptr+= len; - } - break; - - case OP_WHITESPACE: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c >= 256 ||(md->ctypes[c] & ctype_space) == 0) break; - eptr+= len; - } - break; - - case OP_NOT_WORDCHAR: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break; - eptr+= len; - } - break; - - case OP_WORDCHAR: - for (i = min; i < max; i++) - { - int len = 1; - if (eptr >= md->end_subject) break; - GETCHARLEN(c, eptr, len); - if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break; - eptr+= len; - } - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } - - /* eptr is now past the end of the maximum run */ - - for(;;) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr-- == pp) break; /* Stop if tried at original pos */ - BACKCHAR(eptr); - } - } - else -#endif - - /* Not UTF-8 mode */ - { - switch(ctype) - { - case OP_ANY: - if ((ims & PCRE_DOTALL) == 0) - { - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || *eptr == NEWLINE) break; - eptr++; - } - break; - } - /* For DOTALL case, fall through and treat as \C */ - - case OP_ANYBYTE: - c = max - min; - if (c > md->end_subject - eptr) c = md->end_subject - eptr; - eptr += c; - break; - - case OP_NOT_DIGIT: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0) - break; - eptr++; - } - break; - - case OP_DIGIT: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0) - break; - eptr++; - } - break; - - case OP_NOT_WHITESPACE: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0) - break; - eptr++; - } - break; - - case OP_WHITESPACE: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0) - break; - eptr++; - } - break; - - case OP_NOT_WORDCHAR: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0) - break; - eptr++; - } - break; - - case OP_WORDCHAR: - for (i = min; i < max; i++) - { - if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0) - break; - eptr++; - } - break; - - default: - RRETURN(PCRE_ERROR_INTERNAL); - } - - /* eptr is now past the end of the maximum run */ - - while (eptr >= pp) - { - RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); - eptr--; - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - } - } - - /* Get here if we can't make it match with any permitted repetitions */ - - RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - - /* There's been some horrible disaster. Since all codes > OP_BRA are - for capturing brackets, and there shouldn't be any gaps between 0 and - OP_BRA, arrival here can only mean there is something seriously wrong - in the code above or the OP_xxx definitions. */ - - default: - DPRINTF(("Unknown opcode %d\n", *ecode)); - RRETURN(PCRE_ERROR_UNKNOWN_NODE); - } - - /* Do not stick any code in here without much thought; it is assumed - that "continue" in the code above comes out to here to repeat the main - loop. */ - - } /* End of main loop */ -/* Control never reaches here */ -} - - -/*************************************************************************** -**************************************************************************** - RECURSION IN THE match() FUNCTION - -Undefine all the macros that were defined above to handle this. */ - -#ifdef NO_RECURSE -#undef eptr -#undef ecode -#undef offset_top -#undef ims -#undef eptrb -#undef flags - -#undef callpat -#undef charptr -#undef data -#undef next -#undef pp -#undef prev -#undef saved_eptr - -#undef new_recursive - -#undef cur_is_word -#undef condition -#undef minimize -#undef prev_is_word - -#undef original_ims - -#undef ctype -#undef length -#undef max -#undef min -#undef number -#undef offset -#undef op -#undef save_capture_last -#undef save_offset1 -#undef save_offset2 -#undef save_offset3 -#undef stacksave - -#undef newptrb - -#endif - -/* These two are defined as macros in both cases */ - -#undef fc -#undef fi - -/*************************************************************************** -***************************************************************************/ - - - -/************************************************* -* Execute a Regular Expression * -*************************************************/ - -/* This function applies a compiled re to a subject string and picks out -portions of the string if it matches. Two elements in the vector are set for -each substring: the offsets to the start and end of the substring. - -Arguments: - argument_re points to the compiled expression - extra_data points to extra data or is NULL - subject points to the subject string - length length of subject string (may contain binary zeros) - start_offset where to start in the subject string - options option bits - offsets points to a vector of ints to be filled in with offsets - offsetcount the number of elements in the vector - -Returns: > 0 => success; value is the number of elements filled in - = 0 => success, but offsets is not big enough - -1 => failed to match - < -1 => some kind of unexpected problem -*/ - -EXPORT int -pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, - const char *subject, int length, int start_offset, int options, int *offsets, - int offsetcount) -{ -int rc, resetcount, ocount; -int first_byte = -1; -int req_byte = -1; -int req_byte2 = -1; -unsigned long int ims = 0; -BOOL using_temporary_offsets = FALSE; -BOOL anchored; -BOOL startline; -BOOL firstline; -BOOL first_byte_caseless = FALSE; -BOOL req_byte_caseless = FALSE; -match_data match_block; -const uschar *tables; -const uschar *start_bits = NULL; -const uschar *start_match = (const uschar *)subject + start_offset; -const uschar *end_subject; -const uschar *req_byte_ptr = start_match - 1; - -pcre_study_data internal_study; -const pcre_study_data *study; - -real_pcre internal_re; -const real_pcre *external_re = (const real_pcre *)argument_re; -const real_pcre *re = external_re; - -/* Plausibility checks */ - -if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; -if (re == NULL || subject == NULL || - (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL; -if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; - -/* Fish out the optional data from the extra_data structure, first setting -the default values. */ - -study = NULL; -match_block.match_limit = MATCH_LIMIT; -match_block.callout_data = NULL; - -/* The table pointer is always in native byte order. */ - -tables = external_re->tables; - -if (extra_data != NULL) - { - register unsigned int flags = extra_data->flags; - if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) - study = (const pcre_study_data *)extra_data->study_data; - if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) - match_block.match_limit = extra_data->match_limit; - if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0) - match_block.callout_data = extra_data->callout_data; - if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables; - } - -/* If the exec call supplied NULL for tables, use the inbuilt ones. This -is a feature that makes it possible to save compiled regex and re-use them -in other programs later. */ - -if (tables == NULL) tables = _pcre_default_tables; - -/* Check that the first field in the block is the magic number. If it is not, -test for a regex that was compiled on a host of opposite endianness. If this is -the case, flipped values are put in internal_re and internal_study if there was -study data too. */ - -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, study, &internal_study); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - if (study != NULL) study = &internal_study; - } - -/* Set up other data */ - -anchored = ((re->options | options) & PCRE_ANCHORED) != 0; -startline = (re->options & PCRE_STARTLINE) != 0; -firstline = (re->options & PCRE_FIRSTLINE) != 0; - -/* The code starts after the real_pcre block and the capture name table. */ - -match_block.start_code = (const uschar *)external_re + re->name_table_offset + - re->name_count * re->name_entry_size; - -match_block.start_subject = (const uschar *)subject; -match_block.start_offset = start_offset; -match_block.end_subject = match_block.start_subject + length; -end_subject = match_block.end_subject; - -match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; -match_block.utf8 = (re->options & PCRE_UTF8) != 0; - -match_block.notbol = (options & PCRE_NOTBOL) != 0; -match_block.noteol = (options & PCRE_NOTEOL) != 0; -match_block.notempty = (options & PCRE_NOTEMPTY) != 0; -match_block.partial = (options & PCRE_PARTIAL) != 0; -match_block.hitend = FALSE; - -match_block.recursive = NULL; /* No recursion at top level */ - -match_block.lcc = tables + lcc_offset; -match_block.ctypes = tables + ctypes_offset; - -/* Partial matching is supported only for a restricted set of regexes at the -moment. */ - -if (match_block.partial && (re->options & PCRE_NOPARTIAL) != 0) - return PCRE_ERROR_BADPARTIAL; - -/* Check a UTF-8 string if required. Unfortunately there's no way of passing -back the character offset. */ - -#ifdef SUPPORT_UTF8 -if (match_block.utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) - { - if (_pcre_valid_utf8((uschar *)subject, length) >= 0) - return PCRE_ERROR_BADUTF8; - if (start_offset > 0 && start_offset < length) - { - int tb = ((uschar *)subject)[start_offset]; - if (tb > 127) - { - tb &= 0xc0; - if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET; - } - } - } -#endif - -/* The ims options can vary during the matching as a result of the presence -of (?ims) items in the pattern. They are kept in a local variable so that -restoring at the exit of a group is easy. */ - -ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL); - -/* If the expression has got more back references than the offsets supplied can -hold, we get a temporary chunk of working store to use during the matching. -Otherwise, we can use the vector supplied, rounding down its size to a multiple -of 3. */ - -ocount = offsetcount - (offsetcount % 3); - -if (re->top_backref > 0 && re->top_backref >= ocount/3) - { - ocount = re->top_backref * 3 + 3; - match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int)); - if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY; - using_temporary_offsets = TRUE; - DPRINTF(("Got memory to hold back references\n")); - } -else match_block.offset_vector = offsets; - -match_block.offset_end = ocount; -match_block.offset_max = (2*ocount)/3; -match_block.offset_overflow = FALSE; -match_block.capture_last = -1; - -/* Compute the minimum number of offsets that we need to reset each time. Doing -this makes a huge difference to execution time when there aren't many brackets -in the pattern. */ - -resetcount = 2 + re->top_bracket * 2; -if (resetcount > offsetcount) resetcount = ocount; - -/* Reset the working variable associated with each extraction. These should -never be used unless previously set, but they get saved and restored, and so we -initialize them to avoid reading uninitialized locations. */ - -if (match_block.offset_vector != NULL) - { - register int *iptr = match_block.offset_vector + ocount; - register int *iend = iptr - resetcount/2 + 1; - while (--iptr >= iend) *iptr = -1; - } - -/* Set up the first character to match, if available. The first_byte value is -never set for an anchored regular expression, but the anchoring may be forced -at run time, so we have to test for anchoring. The first char may be unset for -an unanchored pattern, of course. If there's no first char and the pattern was -studied, there may be a bitmap of possible first characters. */ - -if (!anchored) - { - if ((re->options & PCRE_FIRSTSET) != 0) - { - first_byte = re->first_byte & 255; - if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE) - first_byte = match_block.lcc[first_byte]; - } - else - if (!startline && study != NULL && - (study->options & PCRE_STUDY_MAPPED) != 0) - start_bits = study->start_bits; - } - -/* For anchored or unanchored matches, there may be a "last known required -character" set. */ - -if ((re->options & PCRE_REQCHSET) != 0) - { - req_byte = re->req_byte & 255; - req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0; - req_byte2 = (tables + fcc_offset)[req_byte]; /* case flipped */ - } - -/* Loop for handling unanchored repeated matching attempts; for anchored regexs -the loop runs just once. */ - -do - { - const uschar *save_end_subject = end_subject; - - /* Reset the maximum number of extractions we might see. */ - - if (match_block.offset_vector != NULL) - { - register int *iptr = match_block.offset_vector; - register int *iend = iptr + resetcount; - while (iptr < iend) *iptr++ = -1; - } - - /* Advance to a unique first char if possible. If firstline is TRUE, the - start of the match is constrained to the first line of a multiline string. - Implement this by temporarily adjusting end_subject so that we stop scanning - at a newline. If the match fails at the newline, later code breaks this loop. - */ - - if (firstline) - { - const uschar *t = start_match; - while (t < save_end_subject && *t != '\n') t++; - end_subject = t; - } - - /* Now test for a unique first byte */ - - if (first_byte >= 0) - { - if (first_byte_caseless) - while (start_match < end_subject && - match_block.lcc[*start_match] != first_byte) - start_match++; - else - while (start_match < end_subject && *start_match != first_byte) - start_match++; - } - - /* Or to just after \n for a multiline match if possible */ - - else if (startline) - { - if (start_match > match_block.start_subject + start_offset) - { - while (start_match < end_subject && start_match[-1] != NEWLINE) - start_match++; - } - } - - /* Or to a non-unique first char after study */ - - else if (start_bits != NULL) - { - while (start_match < end_subject) - { - register unsigned int c = *start_match; - if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; else break; - } - } - - /* Restore fudged end_subject */ - - end_subject = save_end_subject; - -#ifdef DEBUG /* Sigh. Some compilers never learn. */ - printf(">>>> Match against: "); - pchars(start_match, end_subject - start_match, TRUE, &match_block); - printf("\n"); -#endif - - /* If req_byte is set, we know that that character must appear in the subject - for the match to succeed. If the first character is set, req_byte must be - later in the subject; otherwise the test starts at the match point. This - optimization can save a huge amount of backtracking in patterns with nested - unlimited repeats that aren't going to match. Writing separate code for - cased/caseless versions makes it go faster, as does using an autoincrement - and backing off on a match. - - HOWEVER: when the subject string is very, very long, searching to its end can - take a long time, and give bad performance on quite ordinary patterns. This - showed up when somebody was matching /^C/ on a 32-megabyte string... so we - don't do this when the string is sufficiently long. - - ALSO: this processing is disabled when partial matching is requested. - */ - - if (req_byte >= 0 && - end_subject - start_match < REQ_BYTE_MAX && - !match_block.partial) - { - register const uschar *p = start_match + ((first_byte >= 0)? 1 : 0); - - /* We don't need to repeat the search if we haven't yet reached the - place we found it at last time. */ - - if (p > req_byte_ptr) - { - if (req_byte_caseless) - { - while (p < end_subject) - { - register int pp = *p++; - if (pp == req_byte || pp == req_byte2) { p--; break; } - } - } - else - { - while (p < end_subject) - { - if (*p++ == req_byte) { p--; break; } - } - } - - /* If we can't find the required character, break the matching loop */ - - if (p >= end_subject) break; - - /* If we have found the required character, save the point where we - found it, so that we don't search again next time round the loop if - the start hasn't passed this character yet. */ - - req_byte_ptr = p; - } - } - - /* When a match occurs, substrings will be set for all internal extractions; - we just need to set up the whole thing as substring 0 before returning. If - there were too many extractions, set the return code to zero. In the case - where we had to get some local store to hold offsets for backreferences, copy - those back references that we can. In this case there need not be overflow - if certain parts of the pattern were not used. */ - - match_block.start_match = start_match; - match_block.match_call_count = 0; - - rc = match(start_match, match_block.start_code, 2, &match_block, ims, NULL, - match_isgroup); - - /* When the result is no match, if the subject's first character was a - newline and the PCRE_FIRSTLINE option is set, break (which will return - PCRE_ERROR_NOMATCH). The option requests that a match occur before the first - newline in the subject. Otherwise, advance the pointer to the next character - and continue - but the continuation will actually happen only when the - pattern is not anchored. */ - - if (rc == MATCH_NOMATCH) - { - if (firstline && *start_match == NEWLINE) break; - start_match++; -#ifdef SUPPORT_UTF8 - if (match_block.utf8) - while(start_match < end_subject && (*start_match & 0xc0) == 0x80) - start_match++; -#endif - continue; - } - - if (rc != MATCH_MATCH) - { - DPRINTF((">>>> error: returning %d\n", rc)); - return rc; - } - - /* We have a match! Copy the offset information from temporary store if - necessary */ - - if (using_temporary_offsets) - { - if (offsetcount >= 4) - { - memcpy(offsets + 2, match_block.offset_vector + 2, - (offsetcount - 2) * sizeof(int)); - DPRINTF(("Copied offsets from temporary memory\n")); - } - if (match_block.end_offset_top > offsetcount) - match_block.offset_overflow = TRUE; - - DPRINTF(("Freeing temporary memory\n")); - (pcre_free)(match_block.offset_vector); - } - - rc = match_block.offset_overflow? 0 : match_block.end_offset_top/2; - - if (offsetcount < 2) rc = 0; else - { - offsets[0] = start_match - match_block.start_subject; - offsets[1] = match_block.end_match_ptr - match_block.start_subject; - } - - DPRINTF((">>>> returning %d\n", rc)); - return rc; - } - -/* This "while" is the end of the "do" above */ - -while (!anchored && start_match <= end_subject); - -if (using_temporary_offsets) - { - DPRINTF(("Freeing temporary memory\n")); - (pcre_free)(match_block.offset_vector); - } - -if (match_block.partial && match_block.hitend) - { - DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n")); - return PCRE_ERROR_PARTIAL; - } -else - { - DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); - return PCRE_ERROR_NOMATCH; - } -} - -/* End of pcre_exec.c */ diff --git a/ext/pcre/pcrelib/pcre_fullinfo.c b/ext/pcre/pcrelib/pcre_fullinfo.c deleted file mode 100644 index ac80e65e2a1bb..0000000000000 --- a/ext/pcre/pcrelib/pcre_fullinfo.c +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/*PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_fullinfo(), which returns -information about a compiled pattern. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Return info about compiled pattern * -*************************************************/ - -/* This is a newer "info" function which has an extensible interface so -that additional items can be added compatibly. - -Arguments: - argument_re points to compiled code - extra_data points extra data, or NULL - what what information is required - where where to put the information - -Returns: 0 if data returned, negative on error -*/ - -EXPORT int -pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, - void *where) -{ -real_pcre internal_re; -pcre_study_data internal_study; -const real_pcre *re = (const real_pcre *)argument_re; -const pcre_study_data *study = NULL; - -if (re == NULL || where == NULL) return PCRE_ERROR_NULL; - -if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0) - study = (const pcre_study_data *)extra_data->study_data; - -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, study, &internal_study); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - if (study != NULL) study = &internal_study; - } - -switch (what) - { - case PCRE_INFO_OPTIONS: - *((unsigned long int *)where) = re->options & PUBLIC_OPTIONS; - break; - - case PCRE_INFO_SIZE: - *((size_t *)where) = re->size; - break; - - case PCRE_INFO_STUDYSIZE: - *((size_t *)where) = (study == NULL)? 0 : study->size; - break; - - case PCRE_INFO_CAPTURECOUNT: - *((int *)where) = re->top_bracket; - break; - - case PCRE_INFO_BACKREFMAX: - *((int *)where) = re->top_backref; - break; - - case PCRE_INFO_FIRSTBYTE: - *((int *)where) = - ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte : - ((re->options & PCRE_STARTLINE) != 0)? -1 : -2; - break; - - /* Make sure we pass back the pointer to the bit vector in the external - block, not the internal copy (with flipped integer fields). */ - - case PCRE_INFO_FIRSTTABLE: - *((const uschar **)where) = - (study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)? - ((const pcre_study_data *)extra_data->study_data)->start_bits : NULL; - break; - - case PCRE_INFO_LASTLITERAL: - *((int *)where) = - ((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1; - break; - - case PCRE_INFO_NAMEENTRYSIZE: - *((int *)where) = re->name_entry_size; - break; - - case PCRE_INFO_NAMECOUNT: - *((int *)where) = re->name_count; - break; - - case PCRE_INFO_NAMETABLE: - *((const uschar **)where) = (const uschar *)re + re->name_table_offset; - break; - - case PCRE_INFO_DEFAULT_TABLES: - *((const uschar **)where) = (const uschar *)(_pcre_default_tables); - break; - - default: return PCRE_ERROR_BADOPTION; - } - -return 0; -} - -/* End of pcre_fullinfo.c */ diff --git a/ext/pcre/pcrelib/pcre_get.c b/ext/pcre/pcrelib/pcre_get.c deleted file mode 100644 index fc4a14ac14f8e..0000000000000 --- a/ext/pcre/pcrelib/pcre_get.c +++ /dev/null @@ -1,352 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains some convenience functions for extracting substrings -from the subject string after a regex match has succeeded. The original idea -for these functions came from Scott Wimer. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Find number for named string * -*************************************************/ - -/* This function is used by the two extraction functions below, as well -as being generally available. - -Arguments: - code the compiled regex - stringname the name whose number is required - -Returns: the number of the named parentheses, or a negative number - (PCRE_ERROR_NOSUBSTRING) if not found -*/ - -int -pcre_get_stringnumber(const pcre *code, const char *stringname) -{ -int rc; -int entrysize; -int top, bot; -uschar *nametable; - -if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) - return rc; -if (top <= 0) return PCRE_ERROR_NOSUBSTRING; - -if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0) - return rc; -if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) - return rc; - -bot = 0; -while (top > bot) - { - int mid = (top + bot) / 2; - uschar *entry = nametable + entrysize*mid; - int c = strcmp(stringname, (char *)(entry + 2)); - if (c == 0) return (entry[0] << 8) + entry[1]; - if (c > 0) bot = mid + 1; else top = mid; - } - -return PCRE_ERROR_NOSUBSTRING; -} - - - -/************************************************* -* Copy captured string to given buffer * -*************************************************/ - -/* This function copies a single captured substring into a given buffer. -Note that we use memcpy() rather than strncpy() in case there are binary zeros -in the string. - -Arguments: - subject the subject string that was matched - ovector pointer to the offsets table - stringcount the number of substrings that were captured - (i.e. the yield of the pcre_exec call, unless - that was zero, in which case it should be 1/3 - of the offset table size) - stringnumber the number of the required substring - buffer where to put the substring - size the size of the buffer - -Returns: if successful: - the length of the copied string, not including the zero - that is put on the end; can be zero - if not successful: - PCRE_ERROR_NOMEMORY (-6) buffer too small - PCRE_ERROR_NOSUBSTRING (-7) no such captured substring -*/ - -int -pcre_copy_substring(const char *subject, int *ovector, int stringcount, - int stringnumber, char *buffer, int size) -{ -int yield; -if (stringnumber < 0 || stringnumber >= stringcount) - return PCRE_ERROR_NOSUBSTRING; -stringnumber *= 2; -yield = ovector[stringnumber+1] - ovector[stringnumber]; -if (size < yield + 1) return PCRE_ERROR_NOMEMORY; -memcpy(buffer, subject + ovector[stringnumber], yield); -buffer[yield] = 0; -return yield; -} - - - -/************************************************* -* Copy named captured string to given buffer * -*************************************************/ - -/* This function copies a single captured substring into a given buffer, -identifying it by name. - -Arguments: - code the compiled regex - subject the subject string that was matched - ovector pointer to the offsets table - stringcount the number of substrings that were captured - (i.e. the yield of the pcre_exec call, unless - that was zero, in which case it should be 1/3 - of the offset table size) - stringname the name of the required substring - buffer where to put the substring - size the size of the buffer - -Returns: if successful: - the length of the copied string, not including the zero - that is put on the end; can be zero - if not successful: - PCRE_ERROR_NOMEMORY (-6) buffer too small - PCRE_ERROR_NOSUBSTRING (-7) no such captured substring -*/ - -int -pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, - int stringcount, const char *stringname, char *buffer, int size) -{ -int n = pcre_get_stringnumber(code, stringname); -if (n <= 0) return n; -return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size); -} - - - -/************************************************* -* Copy all captured strings to new store * -*************************************************/ - -/* This function gets one chunk of store and builds a list of pointers and all -of the captured substrings in it. A NULL pointer is put on the end of the list. - -Arguments: - subject the subject string that was matched - ovector pointer to the offsets table - stringcount the number of substrings that were captured - (i.e. the yield of the pcre_exec call, unless - that was zero, in which case it should be 1/3 - of the offset table size) - listptr set to point to the list of pointers - -Returns: if successful: 0 - if not successful: - PCRE_ERROR_NOMEMORY (-6) failed to get store -*/ - -int -pcre_get_substring_list(const char *subject, int *ovector, int stringcount, - const char ***listptr) -{ -int i; -int size = sizeof(char *); -int double_count = stringcount * 2; -char **stringlist; -char *p; - -for (i = 0; i < double_count; i += 2) - size += sizeof(char *) + ovector[i+1] - ovector[i] + 1; - -stringlist = (char **)(pcre_malloc)(size); -if (stringlist == NULL) return PCRE_ERROR_NOMEMORY; - -*listptr = (const char **)stringlist; -p = (char *)(stringlist + stringcount + 1); - -for (i = 0; i < double_count; i += 2) - { - int len = ovector[i+1] - ovector[i]; - memcpy(p, subject + ovector[i], len); - *stringlist++ = p; - p += len; - *p++ = 0; - } - -*stringlist = NULL; -return 0; -} - - - -/************************************************* -* Free store obtained by get_substring_list * -*************************************************/ - -/* This function exists for the benefit of people calling PCRE from non-C -programs that can call its functions, but not free() or (pcre_free)() directly. - -Argument: the result of a previous pcre_get_substring_list() -Returns: nothing -*/ - -void -pcre_free_substring_list(const char **pointer) -{ -(pcre_free)((void *)pointer); -} - - - -/************************************************* -* Copy captured string to new store * -*************************************************/ - -/* This function copies a single captured substring into a piece of new -store - -Arguments: - subject the subject string that was matched - ovector pointer to the offsets table - stringcount the number of substrings that were captured - (i.e. the yield of the pcre_exec call, unless - that was zero, in which case it should be 1/3 - of the offset table size) - stringnumber the number of the required substring - stringptr where to put a pointer to the substring - -Returns: if successful: - the length of the string, not including the zero that - is put on the end; can be zero - if not successful: - PCRE_ERROR_NOMEMORY (-6) failed to get store - PCRE_ERROR_NOSUBSTRING (-7) substring not present -*/ - -int -pcre_get_substring(const char *subject, int *ovector, int stringcount, - int stringnumber, const char **stringptr) -{ -int yield; -char *substring; -if (stringnumber < 0 || stringnumber >= stringcount) - return PCRE_ERROR_NOSUBSTRING; -stringnumber *= 2; -yield = ovector[stringnumber+1] - ovector[stringnumber]; -substring = (char *)(pcre_malloc)(yield + 1); -if (substring == NULL) return PCRE_ERROR_NOMEMORY; -memcpy(substring, subject + ovector[stringnumber], yield); -substring[yield] = 0; -*stringptr = substring; -return yield; -} - - - -/************************************************* -* Copy named captured string to new store * -*************************************************/ - -/* This function copies a single captured substring, identified by name, into -new store. - -Arguments: - code the compiled regex - subject the subject string that was matched - ovector pointer to the offsets table - stringcount the number of substrings that were captured - (i.e. the yield of the pcre_exec call, unless - that was zero, in which case it should be 1/3 - of the offset table size) - stringname the name of the required substring - stringptr where to put the pointer - -Returns: if successful: - the length of the copied string, not including the zero - that is put on the end; can be zero - if not successful: - PCRE_ERROR_NOMEMORY (-6) couldn't get memory - PCRE_ERROR_NOSUBSTRING (-7) no such captured substring -*/ - -int -pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, - int stringcount, const char *stringname, const char **stringptr) -{ -int n = pcre_get_stringnumber(code, stringname); -if (n <= 0) return n; -return pcre_get_substring(subject, ovector, stringcount, n, stringptr); -} - - - - -/************************************************* -* Free store obtained by get_substring * -*************************************************/ - -/* This function exists for the benefit of people calling PCRE from non-C -programs that can call its functions, but not free() or (pcre_free)() directly. - -Argument: the result of a previous pcre_get_substring() -Returns: nothing -*/ - -void -pcre_free_substring(const char *pointer) -{ -(pcre_free)((void *)pointer); -} - -/* End of pcre_get.c */ diff --git a/ext/pcre/pcrelib/pcre_globals.c b/ext/pcre/pcrelib/pcre_globals.c deleted file mode 100644 index 1a839802ba028..0000000000000 --- a/ext/pcre/pcrelib/pcre_globals.c +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains global variables that are exported by the PCRE library. -PCRE is thread-clean and doesn't use any global variables in the normal sense. -However, it calls memory allocation and freeing functions via the four -indirections below, and it can optionally do callouts, using the fifth -indirection. These values can be changed by the caller, but are shared between -all threads. However, when compiling for Virtual Pascal, things are done -differently, and global variables are not used (see pcre.in). */ - - -#include "pcre_internal.h" - - -#ifndef VPCOMPAT -#ifdef __cplusplus -extern "C" void *(*pcre_malloc)(size_t) = malloc; -extern "C" void (*pcre_free)(void *) = free; -extern "C" void *(*pcre_stack_malloc)(size_t) = malloc; -extern "C" void (*pcre_stack_free)(void *) = free; -extern "C" int (*pcre_callout)(pcre_callout_block *) = NULL; -#else -void *(*pcre_malloc)(size_t) = malloc; -void (*pcre_free)(void *) = free; -void *(*pcre_stack_malloc)(size_t) = malloc; -void (*pcre_stack_free)(void *) = free; -int (*pcre_callout)(pcre_callout_block *) = NULL; -#endif -#endif - -/* End of pcre_globals.c */ diff --git a/ext/pcre/pcrelib/pcre_info.c b/ext/pcre/pcrelib/pcre_info.c deleted file mode 100644 index 228949d0cd2a4..0000000000000 --- a/ext/pcre/pcrelib/pcre_info.c +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_info(), which gives some -information about a compiled pattern. However, use of this function is now -deprecated, as it has been superseded by pcre_fullinfo(). */ - - -#include "pcre_internal.h" - - -/************************************************* -* (Obsolete) Return info about compiled pattern * -*************************************************/ - -/* This is the original "info" function. It picks potentially useful data out -of the private structure, but its interface was too rigid. It remains for -backwards compatibility. The public options are passed back in an int - though -the re->options field has been expanded to a long int, all the public options -at the low end of it, and so even on 16-bit systems this will still be OK. -Therefore, I haven't changed the API for pcre_info(). - -Arguments: - argument_re points to compiled code - optptr where to pass back the options - first_byte where to pass back the first character, - or -1 if multiline and all branches start ^, - or -2 otherwise - -Returns: number of capturing subpatterns - or negative values on error -*/ - -EXPORT int -pcre_info(const pcre *argument_re, int *optptr, int *first_byte) -{ -real_pcre internal_re; -const real_pcre *re = (const real_pcre *)argument_re; -if (re == NULL) return PCRE_ERROR_NULL; -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, NULL, NULL); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - } -if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_OPTIONS); -if (first_byte != NULL) - *first_byte = ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte : - ((re->options & PCRE_STARTLINE) != 0)? -1 : -2; -return re->top_bracket; -} - -/* End of pcre_info.c */ diff --git a/ext/pcre/pcrelib/pcre_internal.h b/ext/pcre/pcrelib/pcre_internal.h deleted file mode 100644 index bffab024cb3b9..0000000000000 --- a/ext/pcre/pcrelib/pcre_internal.h +++ /dev/null @@ -1,909 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - -/* This header contains definitions that are shared between the different -modules, but which are not relevant to the exported API. This includes some -functions whose names all begin with "_pcre_". */ - - -/* Define DEBUG to get debugging output on stdout. */ - -/**** -#define DEBUG -****/ - -/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef -inline, and there are *still* stupid compilers about that don't like indented -pre-processor statements, or at least there were when I first wrote this. After -all, it had only been about 10 years then... */ - -#ifdef DEBUG -#define DPRINTF(p) printf p -#else -#define DPRINTF(p) /*nothing*/ -#endif - - -/* Get the definitions provided by running "configure" */ - -#ifdef PHP_WIN32 -# include "config.w32.h" -#else -# include <php_config.h> -#endif - -/* Standard C headers plus the external interface definition. The only time -setjmp and stdarg are used is when NO_RECURSE is set. */ - -#include <ctype.h> -#include <limits.h> -#include <setjmp.h> -#include <stdarg.h> -#include <stddef.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#ifndef PCRE_SPY -#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */ -#endif - -/* We need to have types that specify unsigned 16-bit and 32-bit integers. We -cannot determine these outside the compilation (e.g. by running a program as -part of "configure") because PCRE is often cross-compiled for use on other -systems. Instead we make use of the maximum sizes that are available at -preprocessor time in standard C environments. */ - -#if USHRT_MAX == 65535 - typedef unsigned short pcre_uint16; -#elif UINT_MAX == 65535 - typedef unsigned int pcre_uint16; -#else - #error Cannot determine a type for 16-bit unsigned integers -#endif - -#if UINT_MAX == 4294967295 - typedef unsigned int pcre_uint32; -#elif ULONG_MAX == 4294967295 - typedef unsigned long int pcre_uint32; -#else - #error Cannot determine a type for 32-bit unsigned integers -#endif - -/* All character handling must be done as unsigned characters. Otherwise there -are problems with top-bit-set characters and functions such as isspace(). -However, we leave the interface to the outside world as char *, because that -should make things easier for callers. We define a short type for unsigned char -to save lots of typing. I tried "uchar", but it causes problems on Digital -Unix, where it is defined in sys/types, so use "uschar" instead. */ - -typedef unsigned char uschar; - -/* Include the public PCRE header */ - -#include "pcre.h" - -/* Include the (copy of) the public ucp header, changing the external name into -a private one. This does no harm, even if we aren't compiling UCP support. */ - -#define ucp_findchar _pcre_ucp_findchar -#include "ucp.h" - -/* When compiling for use with the Virtual Pascal compiler, these functions -need to have their names changed. PCRE must be compiled with the -DVPCOMPAT -option on the command line. */ - -#ifdef VPCOMPAT -#define strncmp(s1,s2,m) _strncmp(s1,s2,m) -#define memcpy(d,s,n) _memcpy(d,s,n) -#define memmove(d,s,n) _memmove(d,s,n) -#define memset(s,c,n) _memset(s,c,n) -#else /* VPCOMPAT */ - -/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), -define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY -is set. Otherwise, include an emulating function for those systems that have -neither (there some non-Unix environments where this is the case). This assumes -that all calls to memmove are moving strings upwards in store, which is the -case in PCRE. */ - -#if ! HAVE_MEMMOVE -#undef memmove /* some systems may have a macro */ -#if HAVE_BCOPY -#define memmove(a, b, c) bcopy(b, a, c) -#else /* HAVE_BCOPY */ -void * -pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n) -{ -int i; -dest += n; -src += n; -for (i = 0; i < n; ++i) *(--dest) = *(--src); -} -#define memmove(a, b, c) pcre_memmove(a, b, c) -#endif /* not HAVE_BCOPY */ -#endif /* not HAVE_MEMMOVE */ -#endif /* not VPCOMPAT */ - - -/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored -in big-endian order) by default. These are used, for example, to link from the -start of a subpattern to its alternatives and its end. The use of 2 bytes per -offset limits the size of the compiled regex to around 64K, which is big enough -for almost everybody. However, I received a request for an even bigger limit. -For this reason, and also to make the code easier to maintain, the storing and -loading of offsets from the byte string is now handled by the macros that are -defined here. - -The macros are controlled by the value of LINK_SIZE. This defaults to 2 in -the config.h file, but can be overridden by using -D on the command line. This -is automated on Unix systems via the "configure" command. */ - -#if LINK_SIZE == 2 - -#define PUT(a,n,d) \ - (a[n] = (d) >> 8), \ - (a[(n)+1] = (d) & 255) - -#define GET(a,n) \ - (((a)[n] << 8) | (a)[(n)+1]) - -#define MAX_PATTERN_SIZE (1 << 16) - - -#elif LINK_SIZE == 3 - -#define PUT(a,n,d) \ - (a[n] = (d) >> 16), \ - (a[(n)+1] = (d) >> 8), \ - (a[(n)+2] = (d) & 255) - -#define GET(a,n) \ - (((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2]) - -#define MAX_PATTERN_SIZE (1 << 24) - - -#elif LINK_SIZE == 4 - -#define PUT(a,n,d) \ - (a[n] = (d) >> 24), \ - (a[(n)+1] = (d) >> 16), \ - (a[(n)+2] = (d) >> 8), \ - (a[(n)+3] = (d) & 255) - -#define GET(a,n) \ - (((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3]) - -#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ - - -#else -#error LINK_SIZE must be either 2, 3, or 4 -#endif - - -/* Convenience macro defined in terms of the others */ - -#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE - - -/* PCRE uses some other 2-byte quantities that do not change when the size of -offsets changes. There are used for repeat counts and for other things such as -capturing parenthesis numbers in back references. */ - -#define PUT2(a,n,d) \ - a[n] = (d) >> 8; \ - a[(n)+1] = (d) & 255 - -#define GET2(a,n) \ - (((a)[n] << 8) | (a)[(n)+1]) - -#define PUT2INC(a,n,d) PUT2(a,n,d), a += 2 - - -/* When UTF-8 encoding is being used, a character is no longer just a single -byte. The macros for character handling generate simple sequences when used in -byte-mode, and more complicated ones for UTF-8 characters. */ - -#ifndef SUPPORT_UTF8 -#define GETCHAR(c, eptr) c = *eptr; -#define GETCHARTEST(c, eptr) c = *eptr; -#define GETCHARINC(c, eptr) c = *eptr++; -#define GETCHARINCTEST(c, eptr) c = *eptr++; -#define GETCHARLEN(c, eptr, len) c = *eptr; -#define BACKCHAR(eptr) - -#else /* SUPPORT_UTF8 */ - -/* Get the next UTF-8 character, not advancing the pointer. This is called when -we know we are in UTF-8 mode. */ - -#define GETCHAR(c, eptr) \ - c = *eptr; \ - if ((c & 0xc0) == 0xc0) \ - { \ - int gcii; \ - int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ - int gcss = 6*gcaa; \ - c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ - for (gcii = 1; gcii <= gcaa; gcii++) \ - { \ - gcss -= 6; \ - c |= (eptr[gcii] & 0x3f) << gcss; \ - } \ - } - -/* Get the next UTF-8 character, testing for UTF-8 mode, and not advancing the -pointer. */ - -#define GETCHARTEST(c, eptr) \ - c = *eptr; \ - if (utf8 && (c & 0xc0) == 0xc0) \ - { \ - int gcii; \ - int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ - int gcss = 6*gcaa; \ - c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ - for (gcii = 1; gcii <= gcaa; gcii++) \ - { \ - gcss -= 6; \ - c |= (eptr[gcii] & 0x3f) << gcss; \ - } \ - } - -/* Get the next UTF-8 character, advancing the pointer. This is called when we -know we are in UTF-8 mode. */ - -#define GETCHARINC(c, eptr) \ - c = *eptr++; \ - if ((c & 0xc0) == 0xc0) \ - { \ - int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ - int gcss = 6*gcaa; \ - c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ - while (gcaa-- > 0) \ - { \ - gcss -= 6; \ - c |= (*eptr++ & 0x3f) << gcss; \ - } \ - } - -/* Get the next character, testing for UTF-8 mode, and advancing the pointer */ - -#define GETCHARINCTEST(c, eptr) \ - c = *eptr++; \ - if (utf8 && (c & 0xc0) == 0xc0) \ - { \ - int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ - int gcss = 6*gcaa; \ - c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ - while (gcaa-- > 0) \ - { \ - gcss -= 6; \ - c |= (*eptr++ & 0x3f) << gcss; \ - } \ - } - -/* Get the next UTF-8 character, not advancing the pointer, incrementing length -if there are extra bytes. This is called when we know we are in UTF-8 mode. */ - -#define GETCHARLEN(c, eptr, len) \ - c = *eptr; \ - if ((c & 0xc0) == 0xc0) \ - { \ - int gcii; \ - int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ - int gcss = 6*gcaa; \ - c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ - for (gcii = 1; gcii <= gcaa; gcii++) \ - { \ - gcss -= 6; \ - c |= (eptr[gcii] & 0x3f) << gcss; \ - } \ - len += gcaa; \ - } - -/* If the pointer is not at the start of a character, move it back until -it is. Called only in UTF-8 mode. */ - -#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--; - -#endif - - -/* In case there is no definition of offsetof() provided - though any proper -Standard C system should have one. */ - -#ifndef offsetof -#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field)) -#endif - - -/* These are the public options that can change during matching. */ - -#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL) - -/* Private options flags start at the most significant end of the four bytes, -but skip the top bit so we can use ints for convenience without getting tangled -with negative values. The public options defined in pcre.h start at the least -significant end. Make sure they don't overlap! */ - -#define PCRE_FIRSTSET 0x40000000 /* first_byte is set */ -#define PCRE_REQCHSET 0x20000000 /* req_byte is set */ -#define PCRE_STARTLINE 0x10000000 /* start after \n for multiline */ -#define PCRE_ICHANGED 0x08000000 /* i option changes within regex */ -#define PCRE_NOPARTIAL 0x04000000 /* can't use partial with this regex */ - -/* Options for the "extra" block produced by pcre_study(). */ - -#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */ - -/* Masks for identifying the public options that are permitted at compile -time, run time, or study time, respectively. */ - -#define PUBLIC_OPTIONS \ - (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ - PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \ - PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE) - -#define PUBLIC_EXEC_OPTIONS \ - (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ - PCRE_PARTIAL) - -#define PUBLIC_DFA_EXEC_OPTIONS \ - (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ - PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART) - -#define PUBLIC_STUDY_OPTIONS 0 /* None defined */ - -/* Magic number to provide a small check against being handed junk. Also used -to detect whether a pattern was compiled on a host of different endianness. */ - -#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ - -/* Negative values for the firstchar and reqchar variables */ - -#define REQ_UNSET (-2) -#define REQ_NONE (-1) - -/* The maximum remaining length of subject we are prepared to search for a -req_byte match. */ - -#define REQ_BYTE_MAX 1000 - -/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a -variable-length repeat, or a anything other than literal characters. */ - -#define REQ_CASELESS 0x0100 /* indicates caselessness */ -#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ - -/* Miscellaneous definitions */ - -typedef int BOOL; - -#define FALSE 0 -#define TRUE 1 - -/* Escape items that are just an encoding of a particular data value. Note that -ESC_n is defined as yet another macro, which is set in config.h to either \n -(the default) or \r (which some people want). */ - -#ifndef ESC_e -#define ESC_e 27 -#endif - -#ifndef ESC_f -#define ESC_f '\f' -#endif - -#ifndef ESC_n -#define ESC_n NEWLINE -#endif - -#ifndef ESC_r -#define ESC_r '\r' -#endif - -/* We can't officially use ESC_t because it is a POSIX reserved identifier -(presumably because of all the others like size_t). */ - -#ifndef ESC_tee -#define ESC_tee '\t' -#endif - -/* These are escaped items that aren't just an encoding of a particular data -value such as \n. They must have non-zero values, as check_escape() returns -their negation. Also, they must appear in the same order as in the opcode -definitions below, up to ESC_z. There's a dummy for OP_ANY because it -corresponds to "." rather than an escape sequence. The final one must be -ESC_REF as subsequent values are used for \1, \2, \3, etc. There is are two -tests in the code for an escape greater than ESC_b and less than ESC_Z to -detect the types that may be repeated. These are the types that consume -characters. If any new escapes are put in between that don't consume a -character, that code will have to change. */ - -enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, - ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E, - ESC_Q, ESC_REF }; - -/* Flag bits and data types for the extended class (OP_XCLASS) for classes that -contain UTF-8 characters with values greater than 255. */ - -#define XCL_NOT 0x01 /* Flag: this is a negative class */ -#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */ - -#define XCL_END 0 /* Marks end of individual items */ -#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */ -#define XCL_RANGE 2 /* A range (two multibyte chars) follows */ -#define XCL_PROP 3 /* Unicode property (one property code) follows */ -#define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ - - -/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets -that extract substrings. Starting from 1 (i.e. after OP_END), the values up to -OP_EOD must correspond in order to the list of escapes immediately above. -Note that whenever this list is updated, the two macro definitions that follow -must also be updated to match. */ - -enum { - OP_END, /* 0 End of pattern */ - - /* Values corresponding to backslashed metacharacters */ - - OP_SOD, /* 1 Start of data: \A */ - OP_SOM, /* 2 Start of match (subject + offset): \G */ - OP_NOT_WORD_BOUNDARY, /* 3 \B */ - OP_WORD_BOUNDARY, /* 4 \b */ - OP_NOT_DIGIT, /* 5 \D */ - OP_DIGIT, /* 6 \d */ - OP_NOT_WHITESPACE, /* 7 \S */ - OP_WHITESPACE, /* 8 \s */ - OP_NOT_WORDCHAR, /* 9 \W */ - OP_WORDCHAR, /* 10 \w */ - OP_ANY, /* 11 Match any character */ - OP_ANYBYTE, /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */ - OP_NOTPROP, /* 13 \P (not Unicode property) */ - OP_PROP, /* 14 \p (Unicode property) */ - OP_EXTUNI, /* 15 \X (extended Unicode sequence */ - OP_EODN, /* 16 End of data or \n at end of data: \Z. */ - OP_EOD, /* 17 End of data: \z */ - - OP_OPT, /* 18 Set runtime options */ - OP_CIRC, /* 19 Start of line - varies with multiline switch */ - OP_DOLL, /* 20 End of line - varies with multiline switch */ - OP_CHAR, /* 21 Match one character, casefully */ - OP_CHARNC, /* 22 Match one character, caselessly */ - OP_NOT, /* 23 Match anything but the following char */ - - OP_STAR, /* 24 The maximizing and minimizing versions of */ - OP_MINSTAR, /* 25 all these opcodes must come in pairs, with */ - OP_PLUS, /* 26 the minimizing one second. */ - OP_MINPLUS, /* 27 This first set applies to single characters */ - OP_QUERY, /* 28 */ - OP_MINQUERY, /* 29 */ - OP_UPTO, /* 30 From 0 to n matches */ - OP_MINUPTO, /* 31 */ - OP_EXACT, /* 32 Exactly n matches */ - - OP_NOTSTAR, /* 33 The maximizing and minimizing versions of */ - OP_NOTMINSTAR, /* 34 all these opcodes must come in pairs, with */ - OP_NOTPLUS, /* 35 the minimizing one second. */ - OP_NOTMINPLUS, /* 36 This set applies to "not" single characters */ - OP_NOTQUERY, /* 37 */ - OP_NOTMINQUERY, /* 38 */ - OP_NOTUPTO, /* 39 From 0 to n matches */ - OP_NOTMINUPTO, /* 40 */ - OP_NOTEXACT, /* 41 Exactly n matches */ - - OP_TYPESTAR, /* 42 The maximizing and minimizing versions of */ - OP_TYPEMINSTAR, /* 43 all these opcodes must come in pairs, with */ - OP_TYPEPLUS, /* 44 the minimizing one second. These codes must */ - OP_TYPEMINPLUS, /* 45 be in exactly the same order as those above. */ - OP_TYPEQUERY, /* 46 This set applies to character types such as \d */ - OP_TYPEMINQUERY, /* 47 */ - OP_TYPEUPTO, /* 48 From 0 to n matches */ - OP_TYPEMINUPTO, /* 49 */ - OP_TYPEEXACT, /* 50 Exactly n matches */ - - OP_CRSTAR, /* 51 The maximizing and minimizing versions of */ - OP_CRMINSTAR, /* 52 all these opcodes must come in pairs, with */ - OP_CRPLUS, /* 53 the minimizing one second. These codes must */ - OP_CRMINPLUS, /* 54 be in exactly the same order as those above. */ - OP_CRQUERY, /* 55 These are for character classes and back refs */ - OP_CRMINQUERY, /* 56 */ - OP_CRRANGE, /* 57 These are different to the three sets above. */ - OP_CRMINRANGE, /* 58 */ - - OP_CLASS, /* 59 Match a character class, chars < 256 only */ - OP_NCLASS, /* 60 Same, but the bitmap was created from a negative - class - the difference is relevant only when a UTF-8 - character > 255 is encountered. */ - - OP_XCLASS, /* 61 Extended class for handling UTF-8 chars within the - class. This does both positive and negative. */ - - OP_REF, /* 62 Match a back reference */ - OP_RECURSE, /* 63 Match a numbered subpattern (possibly recursive) */ - OP_CALLOUT, /* 64 Call out to external function if provided */ - - OP_ALT, /* 65 Start of alternation */ - OP_KET, /* 66 End of group that doesn't have an unbounded repeat */ - OP_KETRMAX, /* 67 These two must remain together and in this */ - OP_KETRMIN, /* 68 order. They are for groups the repeat for ever. */ - - /* The assertions must come before ONCE and COND */ - - OP_ASSERT, /* 69 Positive lookahead */ - OP_ASSERT_NOT, /* 70 Negative lookahead */ - OP_ASSERTBACK, /* 71 Positive lookbehind */ - OP_ASSERTBACK_NOT, /* 72 Negative lookbehind */ - OP_REVERSE, /* 73 Move pointer back - used in lookbehind assertions */ - - /* ONCE and COND must come after the assertions, with ONCE first, as there's - a test for >= ONCE for a subpattern that isn't an assertion. */ - - OP_ONCE, /* 74 Once matched, don't back up into the subpattern */ - OP_COND, /* 75 Conditional group */ - OP_CREF, /* 76 Used to hold an extraction string number (cond ref) */ - - OP_BRAZERO, /* 77 These two must remain together and in this */ - OP_BRAMINZERO, /* 78 order. */ - - OP_BRANUMBER, /* 79 Used for extracting brackets whose number is greater - than can fit into an opcode. */ - - OP_BRA /* 80 This and greater values are used for brackets that - extract substrings up to EXTRACT_BASIC_MAX. After - that, use is made of OP_BRANUMBER. */ -}; - -/* WARNING WARNING WARNING: There is an implicit assumption in pcre.c and -study.c that all opcodes are less than 128 in value. This makes handling UTF-8 -character sequences easier. */ - -/* The highest extraction number before we have to start using additional -bytes. (Originally PCRE didn't have support for extraction counts highter than -this number.) The value is limited by the number of opcodes left after OP_BRA, -i.e. 255 - OP_BRA. We actually set it a bit lower to leave room for additional -opcodes. */ - -#define EXTRACT_BASIC_MAX 100 - - -/* This macro defines textual names for all the opcodes. These are used only -for debugging. The macro is referenced only in pcre_printint.c. */ - -#define OP_NAME_LIST \ - "End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d", \ - "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte", \ - "notprop", "prop", "extuni", \ - "\\Z", "\\z", \ - "Opt", "^", "$", "char", "charnc", "not", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", \ - "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \ - "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \ - "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\ - "Brazero", "Braminzero", "Branumber", "Bra" - - -/* This macro defines the length of fixed length operations in the compiled -regex. The lengths are used when searching for specific things, and also in the -debugging printing of a compiled regex. We use a macro so that it can be -defined close to the definitions of the opcodes themselves. - -As things have been extended, some of these are no longer fixed lenths, but are -minima instead. For example, the length of a single-character repeat may vary -in UTF-8 mode. The code that uses this table must know about such things. */ - -#define OP_LENGTHS \ - 1, /* End */ \ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \ - 1, 1, /* Any, Anybyte */ \ - 2, 2, 1, /* NOTPROP, PROP, EXTUNI */ \ - 1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \ - 2, /* Char - the minimum length */ \ - 2, /* Charnc - the minimum length */ \ - 2, /* not */ \ - /* Positive single-char repeats ** These are */ \ - 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ - 4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \ - /* Negative single-char repeats - only for chars < 256 */ \ - 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \ - 4, 4, 4, /* NOT upto, minupto, exact */ \ - /* Positive type repeats */ \ - 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \ - 4, 4, 4, /* Type upto, minupto, exact */ \ - /* Character class & ref repeats */ \ - 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \ - 5, 5, /* CRRANGE, CRMINRANGE */ \ - 33, /* CLASS */ \ - 33, /* NCLASS */ \ - 0, /* XCLASS - variable length */ \ - 3, /* REF */ \ - 1+LINK_SIZE, /* RECURSE */ \ - 2+2*LINK_SIZE, /* CALLOUT */ \ - 1+LINK_SIZE, /* Alt */ \ - 1+LINK_SIZE, /* Ket */ \ - 1+LINK_SIZE, /* KetRmax */ \ - 1+LINK_SIZE, /* KetRmin */ \ - 1+LINK_SIZE, /* Assert */ \ - 1+LINK_SIZE, /* Assert not */ \ - 1+LINK_SIZE, /* Assert behind */ \ - 1+LINK_SIZE, /* Assert behind not */ \ - 1+LINK_SIZE, /* Reverse */ \ - 1+LINK_SIZE, /* Once */ \ - 1+LINK_SIZE, /* COND */ \ - 3, /* CREF */ \ - 1, 1, /* BRAZERO, BRAMINZERO */ \ - 3, /* BRANUMBER */ \ - 1+LINK_SIZE /* BRA */ \ - - -/* A magic value for OP_CREF to indicate the "in recursion" condition. */ - -#define CREF_RECURSE 0xffff - -/* Error code numbers. They are given names so that they can more easily be -tracked. */ - -enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, - ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, - ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29, - ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, - ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47 }; - -/* The real format of the start of the pcre block; the index of names and the -code vector run on as long as necessary after the end. We store an explicit -offset to the name table so that if a regex is compiled on one host, saved, and -then run on another where the size of pointers is different, all might still -be well. For the case of compiled-on-4 and run-on-8, we include an extra -pointer that is always NULL. For future-proofing, a few dummy fields were -originally included - even though you can never get this planning right - but -there is only one left now. - -NOTE NOTE NOTE: -Because people can now save and re-use compiled patterns, any additions to this -structure should be made at the end, and something earlier (e.g. a new -flag in the options or one of the dummy fields) should indicate that the new -fields are present. Currently PCRE always sets the dummy fields to zero. -NOTE NOTE NOTE: -*/ - -typedef struct real_pcre { - pcre_uint32 magic_number; - pcre_uint32 size; /* Total that was malloced */ - pcre_uint32 options; - pcre_uint32 dummy1; /* For future use, maybe */ - - pcre_uint16 top_bracket; - pcre_uint16 top_backref; - pcre_uint16 first_byte; - pcre_uint16 req_byte; - pcre_uint16 name_table_offset; /* Offset to name table that follows */ - pcre_uint16 name_entry_size; /* Size of any name items */ - pcre_uint16 name_count; /* Number of name items */ - pcre_uint16 ref_count; /* Reference count */ - - const unsigned char *tables; /* Pointer to tables or NULL for std */ - const unsigned char *nullpad; /* NULL padding */ -} real_pcre; - -/* The format of the block used to store data from pcre_study(). The same -remark (see NOTE above) about extending this structure applies. */ - -typedef struct pcre_study_data { - pcre_uint32 size; /* Total that was malloced */ - pcre_uint32 options; - uschar start_bits[32]; -} pcre_study_data; - -/* Structure for passing "static" information around between the functions -doing the compiling, so that they are thread-safe. */ - -typedef struct compile_data { - const uschar *lcc; /* Points to lower casing table */ - const uschar *fcc; /* Points to case-flipping table */ - const uschar *cbits; /* Points to character type table */ - const uschar *ctypes; /* Points to table of type maps */ - const uschar *start_code; /* The start of the compiled code */ - const uschar *start_pattern; /* The start of the pattern */ - uschar *name_table; /* The name/number table */ - int names_found; /* Number of entries so far */ - int name_entry_size; /* Size of each entry */ - int top_backref; /* Maximum back reference */ - unsigned int backref_map; /* Bitmap of low back refs */ - int req_varyopt; /* "After variable item" flag for reqbyte */ - BOOL nopartial; /* Set TRUE if partial won't work */ -} compile_data; - -/* Structure for maintaining a chain of pointers to the currently incomplete -branches, for testing for left recursion. */ - -typedef struct branch_chain { - struct branch_chain *outer; - uschar *current; -} branch_chain; - -/* Structure for items in a linked list that represents an explicit recursive -call within the pattern. */ - -typedef struct recursion_info { - struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ - int group_num; /* Number of group that was called */ - const uschar *after_call; /* "Return value": points after the call in the expr */ - const uschar *save_start; /* Old value of md->start_match */ - int *offset_save; /* Pointer to start of saved offsets */ - int saved_max; /* Number of saved offsets */ -} recursion_info; - -/* When compiling in a mode that doesn't use recursive calls to match(), -a structure is used to remember local variables on the heap. It is defined in -pcre.c, close to the match() function, so that it is easy to keep it in step -with any changes of local variable. However, the pointer to the current frame -must be saved in some "static" place over a longjmp(). We declare the -structure here so that we can put a pointer in the match_data structure. -NOTE: This isn't used for a "normal" compilation of pcre. */ - -struct heapframe; - -/* Structure for passing "static" information around between the functions -doing traditional NFA matching, so that they are thread-safe. */ - -typedef struct match_data { - unsigned long int match_call_count; /* As it says */ - unsigned long int match_limit;/* As it says */ - int *offset_vector; /* Offset vector */ - int offset_end; /* One past the end */ - int offset_max; /* The maximum usable for return data */ - const uschar *lcc; /* Points to lower casing table */ - const uschar *ctypes; /* Points to table of type maps */ - BOOL offset_overflow; /* Set if too many extractions */ - BOOL notbol; /* NOTBOL flag */ - BOOL noteol; /* NOTEOL flag */ - BOOL utf8; /* UTF8 flag */ - BOOL endonly; /* Dollar not before final \n */ - BOOL notempty; /* Empty string match not wanted */ - BOOL partial; /* PARTIAL flag */ - BOOL hitend; /* Hit the end of the subject at some point */ - const uschar *start_code; /* For use when recursing */ - const uschar *start_subject; /* Start of the subject string */ - const uschar *end_subject; /* End of the subject string */ - const uschar *start_match; /* Start of this match attempt */ - const uschar *end_match_ptr; /* Subject position at end match */ - int end_offset_top; /* Highwater mark at end of match */ - int capture_last; /* Most recent capture number */ - int start_offset; /* The start offset value */ - recursion_info *recursive; /* Linked list of recursion data */ - void *callout_data; /* To pass back to callouts */ - struct heapframe *thisframe; /* Used only when compiling for no recursion */ -} match_data; - -/* A similar structure is used for the same purpose by the DFA matching -functions. */ - -typedef struct dfa_match_data { - const uschar *start_code; /* Start of the compiled pattern */ - const uschar *start_subject; /* Start of the subject string */ - const uschar *end_subject; /* End of subject string */ - const uschar *tables; /* Character tables */ - int moptions; /* Match options */ - int poptions; /* Pattern options */ - void *callout_data; /* To pass back to callouts */ -} dfa_match_data; - -/* Bit definitions for entries in the pcre_ctypes table. */ - -#define ctype_space 0x01 -#define ctype_letter 0x02 -#define ctype_digit 0x04 -#define ctype_xdigit 0x08 -#define ctype_word 0x10 /* alphameric or '_' */ -#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ - -/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set -of bits for a class map. Some classes are built by combining these tables. */ - -#define cbit_space 0 /* [:space:] or \s */ -#define cbit_xdigit 32 /* [:xdigit:] */ -#define cbit_digit 64 /* [:digit:] or \d */ -#define cbit_upper 96 /* [:upper:] */ -#define cbit_lower 128 /* [:lower:] */ -#define cbit_word 160 /* [:word:] or \w */ -#define cbit_graph 192 /* [:graph:] */ -#define cbit_print 224 /* [:print:] */ -#define cbit_punct 256 /* [:punct:] */ -#define cbit_cntrl 288 /* [:cntrl:] */ -#define cbit_length 320 /* Length of the cbits table */ - -/* Offsets of the various tables from the base tables pointer, and -total length. */ - -#define lcc_offset 0 -#define fcc_offset 256 -#define cbits_offset 512 -#define ctypes_offset (cbits_offset + cbit_length) -#define tables_length (ctypes_offset + 256) - -/* Layout of the UCP type table that translates property names into codes for -ucp_findchar(). */ - -typedef struct { - const char *name; - int value; -} ucp_type_table; - - -/* Internal shared data tables. These are tables that are used by more than one -of the exported public functions. They have to be "external" in the C sense, -but are not part of the PCRE public API. The data for these tables is in the -pcre_tables.c module. */ - -extern const int _pcre_utf8_table1[]; -extern const int _pcre_utf8_table2[]; -extern const int _pcre_utf8_table3[]; -extern const uschar _pcre_utf8_table4[]; - -extern const int _pcre_utf8_table1_size; - -extern const ucp_type_table _pcre_utt[]; -extern const int _pcre_utt_size; - -extern const uschar _pcre_default_tables[]; - -extern const uschar _pcre_OP_lengths[]; - - -/* Internal shared functions. These are functions that are used by more than -one of the exported public functions. They have to be "external" in the C -sense, but are not part of the PCRE public API. */ - -extern int _pcre_ord2utf8(int, uschar *); -extern void _pcre_printint(pcre *, FILE *); -extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *, - const pcre_study_data *, pcre_study_data *); -extern int _pcre_ucp_findchar(const int, int *, int *); -extern int _pcre_valid_utf8(const uschar *, int); -extern BOOL _pcre_xclass(int, const uschar *); - -/* End of pcre_internal.h */ diff --git a/ext/pcre/pcrelib/pcre_maketables.c b/ext/pcre/pcrelib/pcre_maketables.c deleted file mode 100644 index c4954b2648170..0000000000000 --- a/ext/pcre/pcrelib/pcre_maketables.c +++ /dev/null @@ -1,145 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_maketables(), which builds -character tables for PCRE in the current locale. The file is compiled on its -own as part of the PCRE library. However, it is also included in the -compilation of dftables.c, in which case the macro DFTABLES is defined. */ - - -#ifndef DFTABLES -#include "pcre_internal.h" -#endif - - -/************************************************* -* Create PCRE character tables * -*************************************************/ - -/* This function builds a set of character tables for use by PCRE and returns -a pointer to them. They are build using the ctype functions, and consequently -their contents will depend upon the current locale setting. When compiled as -part of the library, the store is obtained via pcre_malloc(), but when compiled -inside dftables, use malloc(). - -Arguments: none -Returns: pointer to the contiguous block of data -*/ - -const unsigned char * -pcre_maketables(void) -{ -unsigned char *yield, *p; -int i; - -#ifndef DFTABLES -yield = (unsigned char*)(pcre_malloc)(tables_length); -#else -yield = (unsigned char*)malloc(tables_length); -#endif - -if (yield == NULL) return NULL; -p = yield; - -/* First comes the lower casing table */ - -for (i = 0; i < 256; i++) *p++ = tolower(i); - -/* Next the case-flipping table */ - -for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i); - -/* Then the character class tables. Don't try to be clever and save effort -on exclusive ones - in some locales things may be different. Note that the -table for "space" includes everything "isspace" gives, including VT in the -default locale. This makes it work for the POSIX class [:space:]. */ - -memset(p, 0, cbit_length); -for (i = 0; i < 256; i++) - { - if (isdigit(i)) - { - p[cbit_digit + i/8] |= 1 << (i&7); - p[cbit_word + i/8] |= 1 << (i&7); - } - if (isupper(i)) - { - p[cbit_upper + i/8] |= 1 << (i&7); - p[cbit_word + i/8] |= 1 << (i&7); - } - if (islower(i)) - { - p[cbit_lower + i/8] |= 1 << (i&7); - p[cbit_word + i/8] |= 1 << (i&7); - } - if (i == '_') p[cbit_word + i/8] |= 1 << (i&7); - if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7); - if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7); - if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7); - if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7); - if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7); - if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7); - } -p += cbit_length; - -/* Finally, the character type table. In this, we exclude VT from the white -space chars, because Perl doesn't recognize it as such for \s and for comments -within regexes. */ - -for (i = 0; i < 256; i++) - { - int x = 0; - if (i != 0x0b && isspace(i)) x += ctype_space; - if (isalpha(i)) x += ctype_letter; - if (isdigit(i)) x += ctype_digit; - if (isxdigit(i)) x += ctype_xdigit; - if (isalnum(i) || i == '_') x += ctype_word; - - /* Note: strchr includes the terminating zero in the characters it considers. - In this instance, that is ok because we want binary zero to be flagged as a - meta-character, which in this sense is any character that terminates a run - of data characters. */ - - if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; } - -return yield; -} - -/* End of pcre_maketables.c */ diff --git a/ext/pcre/pcrelib/pcre_ord2utf8.c b/ext/pcre/pcrelib/pcre_ord2utf8.c deleted file mode 100644 index f6a06fc6eafe0..0000000000000 --- a/ext/pcre/pcrelib/pcre_ord2utf8.c +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This file contains a private PCRE function that converts an ordinal -character value into a UTF8 string. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Convert character value to UTF-8 * -*************************************************/ - -/* This function takes an integer value in the range 0 - 0x7fffffff -and encodes it as a UTF-8 character in 0 to 6 bytes. - -Arguments: - cvalue the character value - buffer pointer to buffer for result - at least 6 bytes long - -Returns: number of characters placed in the buffer -*/ - -EXPORT int -_pcre_ord2utf8(int cvalue, uschar *buffer) -{ -register int i, j; -for (i = 0; i < _pcre_utf8_table1_size; i++) - if (cvalue <= _pcre_utf8_table1[i]) break; -buffer += i; -for (j = i; j > 0; j--) - { - *buffer-- = 0x80 | (cvalue & 0x3f); - cvalue >>= 6; - } -*buffer = _pcre_utf8_table2[i] | cvalue; -return i + 1; -} - -/* End of pcre_ord2utf8.c */ diff --git a/ext/pcre/pcrelib/pcre_printint.c b/ext/pcre/pcrelib/pcre_printint.c deleted file mode 100644 index d18f399252722..0000000000000 --- a/ext/pcre/pcrelib/pcre_printint.c +++ /dev/null @@ -1,451 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains an PCRE private debugging function for printing out the -internal form of a compiled regular expression, along with some supporting -local functions. */ - - -#include "pcre_internal.h" - - -static const char *OP_names[] = { OP_NAME_LIST }; - - -/************************************************* -* Print single- or multi-byte character * -*************************************************/ - -static int -print_char(FILE *f, uschar *ptr, BOOL utf8) -{ -int c = *ptr; - -if (!utf8 || (c & 0xc0) != 0xc0) - { - if (isprint(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c); - return 0; - } -else - { - int i; - int a = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ - int s = 6*a; - c = (c & _pcre_utf8_table3[a]) << s; - for (i = 1; i <= a; i++) - { - /* This is a check for malformed UTF-8; it should only occur if the sanity - check has been turned off. Rather than swallow random bytes, just stop if - we hit a bad one. Print it with \X instead of \x as an indication. */ - - if ((ptr[i] & 0xc0) != 0x80) - { - fprintf(f, "\\X{%x}", c); - return i - 1; - } - - /* The byte is OK */ - - s -= 6; - c |= (ptr[i] & 0x3f) << s; - } - if (c < 128) fprintf(f, "\\x%02x", c); else fprintf(f, "\\x{%x}", c); - return a; - } -} - - - -/************************************************* -* Find Unicode property name * -*************************************************/ - -static const char * -get_ucpname(int property) -{ -#ifdef SUPPORT_UCP -int i; -for (i = _pcre_utt_size; i >= 0; i--) - { - if (property == _pcre_utt[i].value) break; - } -return (i >= 0)? _pcre_utt[i].name : "??"; -#else -return "??"; -#endif -} - - - -/************************************************* -* Print compiled regex * -*************************************************/ - -/* Make this function work for a regex with integers either byte order. -However, we assume that what we are passed is a compiled regex. */ - -EXPORT void -_pcre_printint(pcre *external_re, FILE *f) -{ -real_pcre *re = (real_pcre *)external_re; -uschar *codestart, *code; -BOOL utf8; - -unsigned int options = re->options; -int offset = re->name_table_offset; -int count = re->name_count; -int size = re->name_entry_size; - -if (re->magic_number != MAGIC_NUMBER) - { - offset = ((offset << 8) & 0xff00) | ((offset >> 8) & 0xff); - count = ((count << 8) & 0xff00) | ((count >> 8) & 0xff); - size = ((size << 8) & 0xff00) | ((size >> 8) & 0xff); - options = ((options << 24) & 0xff000000) | - ((options << 8) & 0x00ff0000) | - ((options >> 8) & 0x0000ff00) | - ((options >> 24) & 0x000000ff); - } - -code = codestart = (uschar *)re + offset + count * size; -utf8 = (options & PCRE_UTF8) != 0; - -for(;;) - { - uschar *ccode; - int c; - int extra = 0; - - fprintf(f, "%3d ", (int)(code - codestart)); - - if (*code >= OP_BRA) - { - if (*code - OP_BRA > EXTRACT_BASIC_MAX) - fprintf(f, "%3d Bra extra\n", GET(code, 1)); - else - fprintf(f, "%3d Bra %d\n", GET(code, 1), *code - OP_BRA); - code += _pcre_OP_lengths[OP_BRA]; - continue; - } - - switch(*code) - { - case OP_END: - fprintf(f, " %s\n", OP_names[*code]); - fprintf(f, "------------------------------------------------------------------\n"); - return; - - case OP_OPT: - fprintf(f, " %.2x %s", code[1], OP_names[*code]); - break; - - case OP_CHAR: - { - fprintf(f, " "); - do - { - code++; - code += 1 + print_char(f, code, utf8); - } - while (*code == OP_CHAR); - fprintf(f, "\n"); - continue; - } - break; - - case OP_CHARNC: - { - fprintf(f, " NC "); - do - { - code++; - code += 1 + print_char(f, code, utf8); - } - while (*code == OP_CHARNC); - fprintf(f, "\n"); - continue; - } - break; - - case OP_KETRMAX: - case OP_KETRMIN: - case OP_ALT: - case OP_KET: - case OP_ASSERT: - case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: - case OP_ONCE: - case OP_COND: - case OP_REVERSE: - fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); - break; - - case OP_BRANUMBER: - printf("%3d %s", GET2(code, 1), OP_names[*code]); - break; - - case OP_CREF: - if (GET2(code, 1) == CREF_RECURSE) - fprintf(f, " Cond recurse"); - else - fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]); - break; - - case OP_STAR: - case OP_MINSTAR: - case OP_PLUS: - case OP_MINPLUS: - case OP_QUERY: - case OP_MINQUERY: - case OP_TYPESTAR: - case OP_TYPEMINSTAR: - case OP_TYPEPLUS: - case OP_TYPEMINPLUS: - case OP_TYPEQUERY: - case OP_TYPEMINQUERY: - fprintf(f, " "); - if (*code >= OP_TYPESTAR) - { - fprintf(f, "%s", OP_names[code[1]]); - if (code[1] == OP_PROP || code[1] == OP_NOTPROP) - { - fprintf(f, " %s ", get_ucpname(code[2])); - extra = 1; - } - } - else extra = print_char(f, code+1, utf8); - fprintf(f, "%s", OP_names[*code]); - break; - - case OP_EXACT: - case OP_UPTO: - case OP_MINUPTO: - fprintf(f, " "); - extra = print_char(f, code+3, utf8); - fprintf(f, "{"); - if (*code != OP_EXACT) fprintf(f, ","); - fprintf(f, "%d}", GET2(code,1)); - if (*code == OP_MINUPTO) fprintf(f, "?"); - break; - - case OP_TYPEEXACT: - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - fprintf(f, " %s", OP_names[code[3]]); - if (code[3] == OP_PROP || code[3] == OP_NOTPROP) - { - fprintf(f, " %s ", get_ucpname(code[4])); - extra = 1; - } - fprintf(f, "{"); - if (*code != OP_TYPEEXACT) fprintf(f, "0,"); - fprintf(f, "%d}", GET2(code,1)); - if (*code == OP_TYPEMINUPTO) fprintf(f, "?"); - break; - - case OP_NOT: - if (isprint(c = code[1])) fprintf(f, " [^%c]", c); - else fprintf(f, " [^\\x%02x]", c); - break; - - case OP_NOTSTAR: - case OP_NOTMINSTAR: - case OP_NOTPLUS: - case OP_NOTMINPLUS: - case OP_NOTQUERY: - case OP_NOTMINQUERY: - if (isprint(c = code[1])) fprintf(f, " [^%c]", c); - else fprintf(f, " [^\\x%02x]", c); - fprintf(f, "%s", OP_names[*code]); - break; - - case OP_NOTEXACT: - case OP_NOTUPTO: - case OP_NOTMINUPTO: - if (isprint(c = code[3])) fprintf(f, " [^%c]{", c); - else fprintf(f, " [^\\x%02x]{", c); - if (*code != OP_NOTEXACT) fprintf(f, "0,"); - fprintf(f, "%d}", GET2(code,1)); - if (*code == OP_NOTMINUPTO) fprintf(f, "?"); - break; - - case OP_RECURSE: - fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); - break; - - case OP_REF: - fprintf(f, " \\%d", GET2(code,1)); - ccode = code + _pcre_OP_lengths[*code]; - goto CLASS_REF_REPEAT; - - case OP_CALLOUT: - fprintf(f, " %s %d %d %d", OP_names[*code], code[1], GET(code,2), - GET(code, 2 + LINK_SIZE)); - break; - - case OP_PROP: - case OP_NOTPROP: - fprintf(f, " %s %s", OP_names[*code], get_ucpname(code[1])); - break; - - /* OP_XCLASS can only occur in UTF-8 mode. However, there's no harm in - having this code always here, and it makes it less messy without all those - #ifdefs. */ - - case OP_CLASS: - case OP_NCLASS: - case OP_XCLASS: - { - int i, min, max; - BOOL printmap; - - fprintf(f, " ["); - - if (*code == OP_XCLASS) - { - extra = GET(code, 1); - ccode = code + LINK_SIZE + 1; - printmap = (*ccode & XCL_MAP) != 0; - if ((*ccode++ & XCL_NOT) != 0) fprintf(f, "^"); - } - else - { - printmap = TRUE; - ccode = code + 1; - } - - /* Print a bit map */ - - if (printmap) - { - for (i = 0; i < 256; i++) - { - if ((ccode[i/8] & (1 << (i&7))) != 0) - { - int j; - for (j = i+1; j < 256; j++) - if ((ccode[j/8] & (1 << (j&7))) == 0) break; - if (i == '-' || i == ']') fprintf(f, "\\"); - if (isprint(i)) fprintf(f, "%c", i); else fprintf(f, "\\x%02x", i); - if (--j > i) - { - if (j != i + 1) fprintf(f, "-"); - if (j == '-' || j == ']') fprintf(f, "\\"); - if (isprint(j)) fprintf(f, "%c", j); else fprintf(f, "\\x%02x", j); - } - i = j; - } - } - ccode += 32; - } - - /* For an XCLASS there is always some additional data */ - - if (*code == OP_XCLASS) - { - int ch; - while ((ch = *ccode++) != XCL_END) - { - if (ch == XCL_PROP) - { - fprintf(f, "\\p{%s}", get_ucpname(*ccode++)); - } - else if (ch == XCL_NOTPROP) - { - fprintf(f, "\\P{%s}", get_ucpname(*ccode++)); - } - else - { - ccode += 1 + print_char(f, ccode, TRUE); - if (ch == XCL_RANGE) - { - fprintf(f, "-"); - ccode += 1 + print_char(f, ccode, TRUE); - } - } - } - } - - /* Indicate a non-UTF8 class which was created by negation */ - - fprintf(f, "]%s", (*code == OP_NCLASS)? " (neg)" : ""); - - /* Handle repeats after a class or a back reference */ - - CLASS_REF_REPEAT: - switch(*ccode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPLUS: - case OP_CRMINPLUS: - case OP_CRQUERY: - case OP_CRMINQUERY: - fprintf(f, "%s", OP_names[*ccode]); - extra += _pcre_OP_lengths[*ccode]; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - min = GET2(ccode,1); - max = GET2(ccode,3); - if (max == 0) fprintf(f, "{%d,}", min); - else fprintf(f, "{%d,%d}", min, max); - if (*ccode == OP_CRMINRANGE) fprintf(f, "?"); - extra += _pcre_OP_lengths[*ccode]; - break; - } - } - break; - - /* Anything else is just an item with no data*/ - - default: - fprintf(f, " %s", OP_names[*code]); - break; - } - - code += _pcre_OP_lengths[*code] + extra; - fprintf(f, "\n"); - } -} - -/* End of pcre_printint.c */ diff --git a/ext/pcre/pcrelib/pcre_refcount.c b/ext/pcre/pcrelib/pcre_refcount.c deleted file mode 100644 index 35a7ee869113a..0000000000000 --- a/ext/pcre/pcrelib/pcre_refcount.c +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_refcount(), which is an -auxiliary function that can be used to maintain a reference count in a compiled -pattern data block. This might be helpful in applications where the block is -shared by different users. */ - -#include "pcre_internal.h" - - -/************************************************* -* Maintain reference count * -*************************************************/ - -/* The reference count is a 16-bit field, initialized to zero. It is not -possible to transfer a non-zero count from one host to a different host that -has a different byte order - though I can't see why anyone in their right mind -would ever want to do that! - -Arguments: - argument_re points to compiled code - adjust value to add to the count - -Returns: the (possibly updated) count value (a non-negative number), or - a negative error number -*/ - -EXPORT int -pcre_refcount(pcre *argument_re, int adjust) -{ -real_pcre *re = (real_pcre *)argument_re; -if (re == NULL) return PCRE_ERROR_NULL; -re->ref_count = (-adjust > re->ref_count)? 0 : - (adjust + re->ref_count > 65535)? 65535 : - re->ref_count + adjust; -return re->ref_count; -} - -/* End of pcre_refcount.c */ diff --git a/ext/pcre/pcrelib/pcre_scanner.cc b/ext/pcre/pcrelib/pcre_scanner.cc deleted file mode 100644 index 4a66fdf0ba2af..0000000000000 --- a/ext/pcre/pcrelib/pcre_scanner.cc +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat - -#include <vector> -#include <algorithm> // for count() -#include <assert.h> -#include "config.h" -#include "pcre_scanner.h" - -using std::vector; - -namespace pcrecpp { - -Scanner::Scanner() - : data_(), - input_(data_), - skip_(NULL), - should_skip_(false), - save_comments_(false), - comments_(NULL), - comments_offset_(0) { -} - -Scanner::Scanner(const string& in) - : data_(in), - input_(data_), - skip_(NULL), - should_skip_(false), - save_comments_(false), - comments_(NULL), - comments_offset_(0) { -} - -Scanner::~Scanner() { - delete skip_; - delete comments_; -} - -void Scanner::Skip(const char* re) { - delete skip_; - if (re != NULL) { - skip_ = new RE(re); - should_skip_ = true; - ConsumeSkip(); - } else { - skip_ = NULL; - should_skip_ = false; - } -} - -void Scanner::DisableSkip() { - assert(skip_ != NULL); - should_skip_ = false; -} - -void Scanner::EnableSkip() { - assert(skip_ != NULL); - should_skip_ = true; - ConsumeSkip(); -} - -int Scanner::LineNumber() const { - // TODO: Make it more efficient by keeping track of the last point - // where we computed line numbers and counting newlines since then. - return 1 + std::count(data_.data(), input_.data(), '\n'); -} - -int Scanner::Offset() const { - return input_.data() - data_.c_str(); -} - -bool Scanner::LookingAt(const RE& re) const { - int consumed; - return re.DoMatch(input_, RE::ANCHOR_START, &consumed, 0, 0); -} - - -bool Scanner::Consume(const RE& re, - const Arg& arg0, - const Arg& arg1, - const Arg& arg2) { - const bool result = re.Consume(&input_, arg0, arg1, arg2); - if (result && should_skip_) ConsumeSkip(); - return result; -} - -// helper function to consume *skip_ and honour save_comments_ -void Scanner::ConsumeSkip() { - if (save_comments_) { - if (NULL == comments_) { - comments_ = new vector<StringPiece>; - } - const char *start_data = input_.data(); - skip_->Consume(&input_); - // already pointing one past end, so no need to +1 - int length = input_.data() - start_data; - if (length > 0) { - comments_->push_back(StringPiece(start_data, length)); - } - } else { - skip_->Consume(&input_); - } -} - - -void Scanner::GetComments(int start, int end, vector<StringPiece> *ranges) { - // short circuit out if we've not yet initialized comments_ - // (e.g., when save_comments is false) - if (!comments_) { - return; - } - // TODO: if we guarantee that comments_ will contain StringPieces - // that are ordered by their start, then we can do a binary search - // for the first StringPiece at or past start and then scan for the - // ones contained in the range, quit early (use equal_range or - // lower_bound) - for (vector<StringPiece>::const_iterator it = comments_->begin(); - it != comments_->end(); ++it) { - if ((it->data() >= data_.c_str() + start && - it->data() + it->size() <= data_.c_str() + end)) { - ranges->push_back(*it); - } - } -} - - -void Scanner::GetNextComments(vector<StringPiece> *ranges) { - // short circuit out if we've not yet initialized comments_ - // (e.g., when save_comments is false) - if (!comments_) { - return; - } - for (vector<StringPiece>::const_iterator it = - comments_->begin() + comments_offset_; - it != comments_->end(); ++it) { - ranges->push_back(*it); - ++comments_offset_; - } -} - -} // namespace pcrecpp diff --git a/ext/pcre/pcrelib/pcre_scanner.h b/ext/pcre/pcrelib/pcre_scanner.h deleted file mode 100644 index a73b72fd2d1c5..0000000000000 --- a/ext/pcre/pcrelib/pcre_scanner.h +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat -// -// Regular-expression based scanner for parsing an input stream. -// -// Example 1: parse a sequence of "var = number" entries from input: -// -// Scanner scanner(input); -// string var; -// int number; -// scanner.Skip("\\s+"); // Skip any white space we encounter -// while (scanner.Consume("(\\w+) = (\\d+)", &var, &number)) { -// ...; -// } - -#ifndef _PCRE_SCANNER_H -#define _PCRE_SCANNER_H - -#include <assert.h> -#include <string> -#include <vector> -#include <pcrecpp.h> -#include <pcre_stringpiece.h> - -namespace pcrecpp { - -class Scanner { - public: - Scanner(); - explicit Scanner(const std::string& input); - ~Scanner(); - - // Return current line number. The returned line-number is - // one-based. I.e. it returns 1 + the number of consumed newlines. - // - // Note: this method may be slow. It may take time proportional to - // the size of the input. - int LineNumber() const; - - // Return the byte-offset that the scanner is looking in the - // input data; - int Offset() const; - - // Return true iff the start of the remaining input matches "re" - bool LookingAt(const RE& re) const; - - // Return true iff all of the following are true - // a. the start of the remaining input matches "re", - // b. if any arguments are supplied, matched sub-patterns can be - // parsed and stored into the arguments. - // If it returns true, it skips over the matched input and any - // following input that matches the "skip" regular expression. - bool Consume(const RE& re, - const Arg& arg0 = no_arg, - const Arg& arg1 = no_arg, - const Arg& arg2 = no_arg - // TODO: Allow more arguments? - ); - - // Set the "skip" regular expression. If after consuming some data, - // a prefix of the input matches this RE, it is automatically - // skipped. For example, a programming language scanner would use - // a skip RE that matches white space and comments. - // - // scanner.Skip("(\\s|//.*|/[*](.|\n)*?[*]/)*"); - // - // You can pass NULL for "re" if you do not want any data to be skipped. - void Skip(const char* re); - - // Temporarily pause "skip"ing. This - // Skip("Foo"); code ; DisableSkip(); code; EnableSkip() - // is similar to - // Skip("Foo"); code ; Skip(NULL); code ; Skip("Foo"); - // but avoids creating/deleting new RE objects. - void DisableSkip(); - - // Reenable previously paused skipping. Any prefix of the input - // that matches the skip pattern is immediately dropped. - void EnableSkip(); - - /***** Special wrappers around SetSkip() for some common idioms *****/ - - // Arranges to skip whitespace, C comments, C++ comments. - // The overall RE is a repeated disjunction of the following REs: - // \\s whitespace - // //.*\n C++ comment - // /[*](.|\n)*?[*]/ C comment (x*? means minimal repetitions of x) - void SkipCXXComments() { - Skip("((\\s|//.*\n|/[*](.|\n)*?[*]/)*)"); - } - - void set_save_comments(bool comments) { - save_comments_ = comments; - } - - bool save_comments() { - return save_comments_; - } - - // Append to vector ranges the comments found in the - // byte range [start,end] (inclusive) of the input data. - // Only comments that were extracted entirely within that - // range are returned: no range splitting of atomically-extracted - // comments is performed. - void GetComments(int start, int end, std::vector<StringPiece> *ranges); - - // Append to vector ranges the comments added - // since the last time this was called. This - // functionality is provided for efficiency when - // interleaving scanning with parsing. - void GetNextComments(std::vector<StringPiece> *ranges); - - private: - std::string data_; // All the input data - StringPiece input_; // Unprocessed input - RE* skip_; // If non-NULL, RE for skipping input - bool should_skip_; // If true, use skip_ - bool save_comments_; // If true, aggregate the skip expression - - // the skipped comments - // TODO: later consider requiring that the StringPieces be added - // in order by their start position - std::vector<StringPiece> *comments_; - - // the offset into comments_ that has been returned by GetNextComments - int comments_offset_; - - // helper function to consume *skip_ and honour - // save_comments_ - void ConsumeSkip(); -}; - -} // namespace pcrecpp - -#endif /* _PCRE_SCANNER_H */ diff --git a/ext/pcre/pcrelib/pcre_scanner_unittest.cc b/ext/pcre/pcrelib/pcre_scanner_unittest.cc deleted file mode 100644 index e000a078d592f..0000000000000 --- a/ext/pcre/pcrelib/pcre_scanner_unittest.cc +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Greg J. Badros -// -// Unittest for scanner, especially GetNextComments and GetComments() -// functionality. - -#include <stdio.h> -#include <vector> -#include <pcre_stringpiece.h> -#include <pcre_scanner.h> - -// Dies with a fatal error if the two values are not equal. -#define CHECK_EQ(a, b) do { \ - if ( (a) != (b) ) { \ - fprintf(stderr, "%s:%d: Check failed because %s != %s\n", \ - __FILE__, __LINE__, #a, #b); \ - exit(1); \ - } \ -} while (0) - -using std::vector; -using pcrecpp::StringPiece; -using pcrecpp::Scanner; - -static void TestScanner() { - const char input[] = "\n" - "alpha = 1; // this sets alpha\n" - "bravo = 2; // bravo is set here\n" - "gamma = 33; /* and here is gamma */\n"; - - const char *re = "(\\w+) = (\\d+);"; - - Scanner s(input); - string var; - int number; - s.SkipCXXComments(); - s.set_save_comments(true); - vector<StringPiece> comments; - - s.Consume(re, &var, &number); - CHECK_EQ(var, "alpha"); - CHECK_EQ(number, 1); - s.GetNextComments(&comments); - CHECK_EQ(comments.size(), 1); - CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); - comments.resize(0); - - s.Consume(re, &var, &number); - CHECK_EQ(var, "bravo"); - CHECK_EQ(number, 2); - s.GetNextComments(&comments); - CHECK_EQ(comments.size(), 1); - CHECK_EQ(comments[0].as_string(), " // bravo is set here\n"); - comments.resize(0); - - s.Consume(re, &var, &number); - CHECK_EQ(var, "gamma"); - CHECK_EQ(number, 33); - s.GetNextComments(&comments); - CHECK_EQ(comments.size(), 1); - CHECK_EQ(comments[0].as_string(), " /* and here is gamma */\n"); - comments.resize(0); - - s.GetComments(0, sizeof(input), &comments); - CHECK_EQ(comments.size(), 3); - CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); - CHECK_EQ(comments[1].as_string(), " // bravo is set here\n"); - CHECK_EQ(comments[2].as_string(), " /* and here is gamma */\n"); - comments.resize(0); - - s.GetComments(0, strchr(input, '/') - input, &comments); - CHECK_EQ(comments.size(), 0); - comments.resize(0); - - s.GetComments(strchr(input, '/') - input - 1, sizeof(input), - &comments); - CHECK_EQ(comments.size(), 3); - CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); - CHECK_EQ(comments[1].as_string(), " // bravo is set here\n"); - CHECK_EQ(comments[2].as_string(), " /* and here is gamma */\n"); - comments.resize(0); - - s.GetComments(strchr(input, '/') - input - 1, - strchr(input + 1, '\n') - input + 1, &comments); - CHECK_EQ(comments.size(), 1); - CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); - comments.resize(0); -} - -int main(int argc, char** argv) { - TestScanner(); - - // Done - printf("OK\n"); - - return 0; -} diff --git a/ext/pcre/pcrelib/pcre_stringpiece.cc b/ext/pcre/pcrelib/pcre_stringpiece.cc deleted file mode 100644 index dbdb509b3b64d..0000000000000 --- a/ext/pcre/pcrelib/pcre_stringpiece.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: wilsonh@google.com (Wilson Hsieh) -// - -#include <iostream> -#include "config.h" -#include "pcre_stringpiece.h" - -std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece) { - return (o << piece.as_string()); -} diff --git a/ext/pcre/pcrelib/pcre_stringpiece.h b/ext/pcre/pcrelib/pcre_stringpiece.h deleted file mode 100644 index 89d5449651a4b..0000000000000 --- a/ext/pcre/pcrelib/pcre_stringpiece.h +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat -// -// A string like object that points into another piece of memory. -// Useful for providing an interface that allows clients to easily -// pass in either a "const char*" or a "string". -// -// Arghh! I wish C++ literals were automatically of type "string". - -#ifndef _PCRE_STRINGPIECE_H -#define _PCRE_STRINGPIECE_H - -#include <string.h> -#include <string> -#include <iosfwd> // for ostream forward-declaration - -#if 1 -#define HAVE_TYPE_TRAITS -#include <type_traits.h> -#elif 0 -#define HAVE_TYPE_TRAITS -#include <bits/type_traits.h> -#endif - -using std::string; - -namespace pcrecpp { - -class StringPiece { - private: - const char* ptr_; - int length_; - - public: - // We provide non-explicit singleton constructors so users can pass - // in a "const char*" or a "string" wherever a "StringPiece" is - // expected. - StringPiece() - : ptr_(NULL), length_(0) { } - StringPiece(const char* str) - : ptr_(str), length_(static_cast<int>(strlen(str))) { } - StringPiece(const string& str) - : ptr_(str.data()), length_(static_cast<int>(str.size())) { } - StringPiece(const char* offset, int len) - : ptr_(offset), length_(len) { } - - // data() may return a pointer to a buffer with embedded NULs, and the - // returned buffer may or may not be null terminated. Therefore it is - // typically a mistake to pass data() to a routine that expects a NUL - // terminated string. Use "as_string().c_str()" if you really need to do - // this. Or better yet, change your routine so it does not rely on NUL - // termination. - const char* data() const { return ptr_; } - int size() const { return length_; } - bool empty() const { return length_ == 0; } - - void clear() { ptr_ = NULL; length_ = 0; } - void set(const char* buffer, int len) { ptr_ = buffer; length_ = len; } - void set(const char* str) { - ptr_ = str; - length_ = static_cast<int>(strlen(str)); - } - void set(const void* buffer, int len) { - ptr_ = reinterpret_cast<const char*>(buffer); - length_ = len; - } - - char operator[](int i) const { return ptr_[i]; } - - void remove_prefix(int n) { - ptr_ += n; - length_ -= n; - } - - void remove_suffix(int n) { - length_ -= n; - } - - bool operator==(const StringPiece& x) const { - return ((length_ == x.length_) && - (memcmp(ptr_, x.ptr_, length_) == 0)); - } - bool operator!=(const StringPiece& x) const { - return !(*this == x); - } - -#define STRINGPIECE_BINARY_PREDICATE(cmp,auxcmp) \ - bool operator cmp (const StringPiece& x) const { \ - int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); \ - return ((r auxcmp 0) || ((r == 0) && (length_ cmp x.length_))); \ - } - STRINGPIECE_BINARY_PREDICATE(<, <); - STRINGPIECE_BINARY_PREDICATE(<=, <); - STRINGPIECE_BINARY_PREDICATE(>=, >); - STRINGPIECE_BINARY_PREDICATE(>, >); -#undef STRINGPIECE_BINARY_PREDICATE - - int compare(const StringPiece& x) const { - int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); - if (r == 0) { - if (length_ < x.length_) r = -1; - else if (length_ > x.length_) r = +1; - } - return r; - } - - string as_string() const { - return string(data(), size()); - } - - void CopyToString(string* target) const { - target->assign(ptr_, length_); - } - - // Does "this" start with "x" - bool starts_with(const StringPiece& x) const { - return ((length_ >= x.length_) && (memcmp(ptr_, x.ptr_, x.length_) == 0)); - } -}; - -} // namespace pcrecpp - -// ------------------------------------------------------------------ -// Functions used to create STL containers that use StringPiece -// Remember that a StringPiece's lifetime had better be less than -// that of the underlying string or char*. If it is not, then you -// cannot safely store a StringPiece into an STL container -// ------------------------------------------------------------------ - -#ifdef HAVE_TYPE_TRAITS -// This makes vector<StringPiece> really fast for some STL implementations -template<> struct __type_traits<pcrecpp::StringPiece> { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; -}; -#endif - -// allow StringPiece to be logged -std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece); - -#endif /* _PCRE_STRINGPIECE_H */ diff --git a/ext/pcre/pcrelib/pcre_stringpiece_unittest.cc b/ext/pcre/pcrelib/pcre_stringpiece_unittest.cc deleted file mode 100644 index d6a89e8c7a299..0000000000000 --- a/ext/pcre/pcrelib/pcre_stringpiece_unittest.cc +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2003 and onwards Google Inc. -// Author: Sanjay Ghemawat - -#include <stdio.h> -#include <map> -#include <algorithm> // for make_pair -#include <pcre_stringpiece.h> - -// CHECK dies with a fatal error if condition is not true. It is *not* -// controlled by NDEBUG, so the check will be executed regardless of -// compilation mode. Therefore, it is safe to do things like: -// CHECK(fp->Write(x) == 4) -#define CHECK(condition) do { \ - if (!(condition)) { \ - fprintf(stderr, "%s:%d: Check failed: %s\n", \ - __FILE__, __LINE__, #condition); \ - exit(1); \ - } \ -} while (0) - -using std::map; -using std::make_pair; -using pcrecpp::StringPiece; - -static void CheckSTLComparator() { - string s1("foo"); - string s2("bar"); - string s3("baz"); - - StringPiece p1(s1); - StringPiece p2(s2); - StringPiece p3(s3); - - typedef map<StringPiece, int> TestMap; - TestMap map; - - map.insert(make_pair(p1, 0)); - map.insert(make_pair(p2, 1)); - map.insert(make_pair(p3, 2)); - CHECK(map.size() == 3); - - TestMap::const_iterator iter = map.begin(); - CHECK(iter->second == 1); - ++iter; - CHECK(iter->second == 2); - ++iter; - CHECK(iter->second == 0); - ++iter; - CHECK(iter == map.end()); - - TestMap::iterator new_iter = map.find("zot"); - CHECK(new_iter == map.end()); - - new_iter = map.find("bar"); - CHECK(new_iter != map.end()); - - map.erase(new_iter); - CHECK(map.size() == 2); - - iter = map.begin(); - CHECK(iter->second == 2); - ++iter; - CHECK(iter->second == 0); - ++iter; - CHECK(iter == map.end()); -} - -static void CheckComparisonOperators() { -#define CMP_Y(op, x, y) \ - CHECK( (StringPiece((x)) op StringPiece((y)))); \ - CHECK( (StringPiece((x)).compare(StringPiece((y))) op 0)) - -#define CMP_N(op, x, y) \ - CHECK(!(StringPiece((x)) op StringPiece((y)))); \ - CHECK(!(StringPiece((x)).compare(StringPiece((y))) op 0)) - - CMP_Y(==, "", ""); - CMP_Y(==, "a", "a"); - CMP_Y(==, "aa", "aa"); - CMP_N(==, "a", ""); - CMP_N(==, "", "a"); - CMP_N(==, "a", "b"); - CMP_N(==, "a", "aa"); - CMP_N(==, "aa", "a"); - - CMP_N(!=, "", ""); - CMP_N(!=, "a", "a"); - CMP_N(!=, "aa", "aa"); - CMP_Y(!=, "a", ""); - CMP_Y(!=, "", "a"); - CMP_Y(!=, "a", "b"); - CMP_Y(!=, "a", "aa"); - CMP_Y(!=, "aa", "a"); - - CMP_Y(<, "a", "b"); - CMP_Y(<, "a", "aa"); - CMP_Y(<, "aa", "b"); - CMP_Y(<, "aa", "bb"); - CMP_N(<, "a", "a"); - CMP_N(<, "b", "a"); - CMP_N(<, "aa", "a"); - CMP_N(<, "b", "aa"); - CMP_N(<, "bb", "aa"); - - CMP_Y(<=, "a", "a"); - CMP_Y(<=, "a", "b"); - CMP_Y(<=, "a", "aa"); - CMP_Y(<=, "aa", "b"); - CMP_Y(<=, "aa", "bb"); - CMP_N(<=, "b", "a"); - CMP_N(<=, "aa", "a"); - CMP_N(<=, "b", "aa"); - CMP_N(<=, "bb", "aa"); - - CMP_N(>=, "a", "b"); - CMP_N(>=, "a", "aa"); - CMP_N(>=, "aa", "b"); - CMP_N(>=, "aa", "bb"); - CMP_Y(>=, "a", "a"); - CMP_Y(>=, "b", "a"); - CMP_Y(>=, "aa", "a"); - CMP_Y(>=, "b", "aa"); - CMP_Y(>=, "bb", "aa"); - - CMP_N(>, "a", "a"); - CMP_N(>, "a", "b"); - CMP_N(>, "a", "aa"); - CMP_N(>, "aa", "b"); - CMP_N(>, "aa", "bb"); - CMP_Y(>, "b", "a"); - CMP_Y(>, "aa", "a"); - CMP_Y(>, "b", "aa"); - CMP_Y(>, "bb", "aa"); - -#undef CMP_Y -#undef CMP_N -} - -int main(int argc, char** argv) { - CheckComparisonOperators(); - CheckSTLComparator(); - - printf("OK\n"); - return 0; -} diff --git a/ext/pcre/pcrelib/pcre_study.c b/ext/pcre/pcrelib/pcre_study.c deleted file mode 100644 index 7c10c049171ad..0000000000000 --- a/ext/pcre/pcrelib/pcre_study.c +++ /dev/null @@ -1,482 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_study(), along with local -supporting functions. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Set a bit and maybe its alternate case * -*************************************************/ - -/* Given a character, set its bit in the table, and also the bit for the other -version of a letter if we are caseless. - -Arguments: - start_bits points to the bit map - c is the character - caseless the caseless flag - cd the block with char table pointers - -Returns: nothing -*/ - -static void -set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd) -{ -start_bits[c/8] |= (1 << (c&7)); -if (caseless && (cd->ctypes[c] & ctype_letter) != 0) - start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7)); -} - - - -/************************************************* -* Create bitmap of starting chars * -*************************************************/ - -/* This function scans a compiled unanchored expression and attempts to build a -bitmap of the set of initial characters. If it can't, it returns FALSE. As time -goes by, we may be able to get more clever at doing this. - -Arguments: - code points to an expression - start_bits points to a 32-byte table, initialized to 0 - caseless the current state of the caseless flag - utf8 TRUE if in UTF-8 mode - cd the block with char table pointers - -Returns: TRUE if table built, FALSE otherwise -*/ - -static BOOL -set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless, - BOOL utf8, compile_data *cd) -{ -register int c; - -/* This next statement and the later reference to dummy are here in order to -trick the optimizer of the IBM C compiler for OS/2 into generating correct -code. Apparently IBM isn't going to fix the problem, and we would rather not -disable optimization (in this module it actually makes a big difference, and -the pcre module can use all the optimization it can get). */ - -volatile int dummy; - -do - { - const uschar *tcode = code + 1 + LINK_SIZE; - BOOL try_next = TRUE; - - while (try_next) - { - /* If a branch starts with a bracket or a positive lookahead assertion, - recurse to set bits from within them. That's all for this branch. */ - - if ((int)*tcode >= OP_BRA || *tcode == OP_ASSERT) - { - if (!set_start_bits(tcode, start_bits, caseless, utf8, cd)) - return FALSE; - try_next = FALSE; - } - - else switch(*tcode) - { - default: - return FALSE; - - /* Skip over callout */ - - case OP_CALLOUT: - tcode += 2 + 2*LINK_SIZE; - break; - - /* Skip over extended extraction bracket number */ - - case OP_BRANUMBER: - tcode += 3; - break; - - /* Skip over lookbehind and negative lookahead assertions */ - - case OP_ASSERT_NOT: - case OP_ASSERTBACK: - case OP_ASSERTBACK_NOT: - do tcode += GET(tcode, 1); while (*tcode == OP_ALT); - tcode += 1+LINK_SIZE; - break; - - /* Skip over an option setting, changing the caseless flag */ - - case OP_OPT: - caseless = (tcode[1] & PCRE_CASELESS) != 0; - tcode += 2; - break; - - /* BRAZERO does the bracket, but carries on. */ - - case OP_BRAZERO: - case OP_BRAMINZERO: - if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd)) - return FALSE; - dummy = 1; - do tcode += GET(tcode,1); while (*tcode == OP_ALT); - tcode += 1+LINK_SIZE; - break; - - /* Single-char * or ? sets the bit and tries the next item */ - - case OP_STAR: - case OP_MINSTAR: - case OP_QUERY: - case OP_MINQUERY: - set_bit(start_bits, tcode[1], caseless, cd); - tcode += 2; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; -#endif - break; - - /* Single-char upto sets the bit and tries the next */ - - case OP_UPTO: - case OP_MINUPTO: - set_bit(start_bits, tcode[3], caseless, cd); - tcode += 4; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; -#endif - break; - - /* At least one single char sets the bit and stops */ - - case OP_EXACT: /* Fall through */ - tcode += 2; - - case OP_CHAR: - case OP_CHARNC: - case OP_PLUS: - case OP_MINPLUS: - set_bit(start_bits, tcode[1], caseless, cd); - try_next = FALSE; - break; - - /* Single character type sets the bits and stops */ - - case OP_NOT_DIGIT: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_digit]; - try_next = FALSE; - break; - - case OP_DIGIT: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_digit]; - try_next = FALSE; - break; - - case OP_NOT_WHITESPACE: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_space]; - try_next = FALSE; - break; - - case OP_WHITESPACE: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_space]; - try_next = FALSE; - break; - - case OP_NOT_WORDCHAR: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_word]; - try_next = FALSE; - break; - - case OP_WORDCHAR: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_word]; - try_next = FALSE; - break; - - /* One or more character type fudges the pointer and restarts, knowing - it will hit a single character type and stop there. */ - - case OP_TYPEPLUS: - case OP_TYPEMINPLUS: - tcode++; - break; - - case OP_TYPEEXACT: - tcode += 3; - break; - - /* Zero or more repeats of character types set the bits and then - try again. */ - - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - tcode += 2; /* Fall through */ - - case OP_TYPESTAR: - case OP_TYPEMINSTAR: - case OP_TYPEQUERY: - case OP_TYPEMINQUERY: - switch(tcode[1]) - { - case OP_ANY: - return FALSE; - - case OP_NOT_DIGIT: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_digit]; - break; - - case OP_DIGIT: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_digit]; - break; - - case OP_NOT_WHITESPACE: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_space]; - break; - - case OP_WHITESPACE: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_space]; - break; - - case OP_NOT_WORDCHAR: - for (c = 0; c < 32; c++) - start_bits[c] |= ~cd->cbits[c+cbit_word]; - break; - - case OP_WORDCHAR: - for (c = 0; c < 32; c++) - start_bits[c] |= cd->cbits[c+cbit_word]; - break; - } - - tcode += 2; - break; - - /* Character class where all the information is in a bit map: set the - bits and either carry on or not, according to the repeat count. If it was - a negative class, and we are operating with UTF-8 characters, any byte - with a value >= 0xc4 is a potentially valid starter because it starts a - character with a value > 255. */ - - case OP_NCLASS: - if (utf8) - { - start_bits[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */ - memset(start_bits+25, 0xff, 7); /* Bits for 0xc9 - 0xff */ - } - /* Fall through */ - - case OP_CLASS: - { - tcode++; - - /* In UTF-8 mode, the bits in a bit map correspond to character - values, not to byte values. However, the bit map we are constructing is - for byte values. So we have to do a conversion for characters whose - value is > 127. In fact, there are only two possible starting bytes for - characters in the range 128 - 255. */ - - if (utf8) - { - for (c = 0; c < 16; c++) start_bits[c] |= tcode[c]; - for (c = 128; c < 256; c++) - { - if ((tcode[c/8] && (1 << (c&7))) != 0) - { - int d = (c >> 6) | 0xc0; /* Set bit for this starter */ - start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */ - c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ - } - } - } - - /* In non-UTF-8 mode, the two bit maps are completely compatible. */ - - else - { - for (c = 0; c < 32; c++) start_bits[c] |= tcode[c]; - } - - /* Advance past the bit map, and act on what follows */ - - tcode += 32; - switch (*tcode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRQUERY: - case OP_CRMINQUERY: - tcode++; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5; - else try_next = FALSE; - break; - - default: - try_next = FALSE; - break; - } - } - break; /* End of bitmap class handling */ - - } /* End of switch */ - } /* End of try_next loop */ - - code += GET(code, 1); /* Advance to next branch */ - } -while (*code == OP_ALT); -return TRUE; -} - - - -/************************************************* -* Study a compiled expression * -*************************************************/ - -/* This function is handed a compiled expression that it must study to produce -information that will speed up the matching. It returns a pcre_extra block -which then gets handed back to pcre_exec(). - -Arguments: - re points to the compiled expression - options contains option bits - errorptr points to where to place error messages; - set NULL unless error - -Returns: pointer to a pcre_extra block, with study_data filled in and the - appropriate flag set; - NULL on error or if no optimization possible -*/ - -EXPORT pcre_extra * -pcre_study(const pcre *external_re, int options, const char **errorptr) -{ -uschar start_bits[32]; -pcre_extra *extra; -pcre_study_data *study; -const uschar *tables; -const real_pcre *re = (const real_pcre *)external_re; -uschar *code = (uschar *)re + re->name_table_offset + - (re->name_count * re->name_entry_size); -compile_data compile_block; - -*errorptr = NULL; - -if (re == NULL || re->magic_number != MAGIC_NUMBER) - { - *errorptr = "argument is not a compiled regular expression"; - return NULL; - } - -if ((options & ~PUBLIC_STUDY_OPTIONS) != 0) - { - *errorptr = "unknown or incorrect option bit(s) set"; - return NULL; - } - -/* For an anchored pattern, or an unanchored pattern that has a first char, or -a multiline pattern that matches only at "line starts", no further processing -at present. */ - -if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0) - return NULL; - -/* Set the character tables in the block that is passed around */ - -tables = re->tables; -if (tables == NULL) - (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES, - (void *)(&tables)); - -compile_block.lcc = tables + lcc_offset; -compile_block.fcc = tables + fcc_offset; -compile_block.cbits = tables + cbits_offset; -compile_block.ctypes = tables + ctypes_offset; - -/* See if we can find a fixed set of initial characters for the pattern. */ - -memset(start_bits, 0, 32 * sizeof(uschar)); -if (!set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0, - (re->options & PCRE_UTF8) != 0, &compile_block)) return NULL; - -/* Get a pcre_extra block and a pcre_study_data block. The study data is put in -the latter, which is pointed to by the former, which may also get additional -data set later by the calling program. At the moment, the size of -pcre_study_data is fixed. We nevertheless save it in a field for returning via -the pcre_fullinfo() function so that if it becomes variable in the future, we -don't have to change that code. */ - -extra = (pcre_extra *)(pcre_malloc) - (sizeof(pcre_extra) + sizeof(pcre_study_data)); - -if (extra == NULL) - { - *errorptr = "failed to get memory"; - return NULL; - } - -study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra)); -extra->flags = PCRE_EXTRA_STUDY_DATA; -extra->study_data = study; - -study->size = sizeof(pcre_study_data); -study->options = PCRE_STUDY_MAPPED; -memcpy(study->start_bits, start_bits, sizeof(start_bits)); - -return extra; -} - -/* End of pcre_study.c */ diff --git a/ext/pcre/pcrelib/pcre_tables.c b/ext/pcre/pcrelib/pcre_tables.c deleted file mode 100644 index 4f442eae033e9..0000000000000 --- a/ext/pcre/pcrelib/pcre_tables.c +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains some fixed tables that are used by more than one of the -PCRE code modules. */ - - -#include "pcre_internal.h" - - -/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that -the definition is next to the definition of the opcodes in internal.h. */ - -const uschar _pcre_OP_lengths[] = { OP_LENGTHS }; - - - -/************************************************* -* Tables for UTF-8 support * -*************************************************/ - -/* These are the breakpoints for different numbers of bytes in a UTF-8 -character. */ - -const int _pcre_utf8_table1[] = - { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; - -const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int); - -/* These are the indicator bits and the mask for the data bits to set in the -first byte of a character, indexed by the number of additional bytes. */ - -const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; -const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; - -/* Table of the number of extra characters, indexed by the first character -masked with 0x3f. The highest number for a valid UTF-8 character is in fact -0x3d. */ - -const uschar _pcre_utf8_table4[] = { - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; - -/* This table translates Unicode property names into code values for the -ucp_findchar() function. It is used by pcretest as well as by the library -functions. */ - -const ucp_type_table _pcre_utt[] = { - { "C", 128 + ucp_C }, - { "Cc", ucp_Cc }, - { "Cf", ucp_Cf }, - { "Cn", ucp_Cn }, - { "Co", ucp_Co }, - { "Cs", ucp_Cs }, - { "L", 128 + ucp_L }, - { "Ll", ucp_Ll }, - { "Lm", ucp_Lm }, - { "Lo", ucp_Lo }, - { "Lt", ucp_Lt }, - { "Lu", ucp_Lu }, - { "M", 128 + ucp_M }, - { "Mc", ucp_Mc }, - { "Me", ucp_Me }, - { "Mn", ucp_Mn }, - { "N", 128 + ucp_N }, - { "Nd", ucp_Nd }, - { "Nl", ucp_Nl }, - { "No", ucp_No }, - { "P", 128 + ucp_P }, - { "Pc", ucp_Pc }, - { "Pd", ucp_Pd }, - { "Pe", ucp_Pe }, - { "Pf", ucp_Pf }, - { "Pi", ucp_Pi }, - { "Po", ucp_Po }, - { "Ps", ucp_Ps }, - { "S", 128 + ucp_S }, - { "Sc", ucp_Sc }, - { "Sk", ucp_Sk }, - { "Sm", ucp_Sm }, - { "So", ucp_So }, - { "Z", 128 + ucp_Z }, - { "Zl", ucp_Zl }, - { "Zp", ucp_Zp }, - { "Zs", ucp_Zs } -}; - -const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); - -/* End of pcre_tables.c */ diff --git a/ext/pcre/pcrelib/pcre_try_flipped.c b/ext/pcre/pcrelib/pcre_try_flipped.c deleted file mode 100644 index a07bb23db0610..0000000000000 --- a/ext/pcre/pcrelib/pcre_try_flipped.c +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains an internal function that tests a compiled pattern to -see if it was compiled with the opposite endianness. If so, it uses an -auxiliary local function to flip the appropriate bytes. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Flip bytes in an integer * -*************************************************/ - -/* This function is called when the magic number in a regex doesn't match, in -order to flip its bytes to see if we are dealing with a pattern that was -compiled on a host of different endianness. If so, this function is used to -flip other byte values. - -Arguments: - value the number to flip - n the number of bytes to flip (assumed to be 2 or 4) - -Returns: the flipped value -*/ - -static long int -byteflip(long int value, int n) -{ -if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); -return ((value & 0x000000ff) << 24) | - ((value & 0x0000ff00) << 8) | - ((value & 0x00ff0000) >> 8) | - ((value & 0xff000000) >> 24); -} - - - -/************************************************* -* Test for a byte-flipped compiled regex * -*************************************************/ - -/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from -pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that -is, it was compiled on a system of opposite endianness. The function is called -only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped, -we flip all the relevant values into a different data block, and return it. - -Arguments: - re points to the regex - study points to study data, or NULL - internal_re points to a new regex block - internal_study points to a new study block - -Returns: the new block if is is indeed a byte-flipped regex - NULL if it is not -*/ - -EXPORT real_pcre * -_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, - const pcre_study_data *study, pcre_study_data *internal_study) -{ -if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) - return NULL; - -*internal_re = *re; /* To copy other fields */ -internal_re->size = byteflip(re->size, sizeof(re->size)); -internal_re->options = byteflip(re->options, sizeof(re->options)); -internal_re->top_bracket = - (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket)); -internal_re->top_backref = - (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref)); -internal_re->first_byte = - (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte)); -internal_re->req_byte = - (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte)); -internal_re->name_table_offset = - (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset)); -internal_re->name_entry_size = - (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size)); -internal_re->name_count = - (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count)); - -if (study != NULL) - { - *internal_study = *study; /* To copy other fields */ - internal_study->size = byteflip(study->size, sizeof(study->size)); - internal_study->options = byteflip(study->options, sizeof(study->options)); - } - -return internal_re; -} - -/* End of pcre_tryflipped.c */ diff --git a/ext/pcre/pcrelib/pcre_ucp_findchar.c b/ext/pcre/pcrelib/pcre_ucp_findchar.c deleted file mode 100644 index 9f8de0663e96c..0000000000000 --- a/ext/pcre/pcrelib/pcre_ucp_findchar.c +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module compiles code for supporting the use of Unicode character -properties. We use the (embryonic at the time of writing) UCP library, by -including some of its files, copies of which have been put in the PCRE -distribution. There is a macro in pcre_internal.h that changes the name -ucp_findchar into _pcre_ucp_findchar. */ - - -#include "pcre_internal.h" - -#include "ucp_findchar.c" - - -/* End of pcre_ucp_findchar.c */ diff --git a/ext/pcre/pcrelib/pcre_valid_utf8.c b/ext/pcre/pcrelib/pcre_valid_utf8.c deleted file mode 100644 index 72f0f5e6e206b..0000000000000 --- a/ext/pcre/pcrelib/pcre_valid_utf8.c +++ /dev/null @@ -1,130 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains an internal function for validating UTF-8 character -strings. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Validate a UTF-8 string * -*************************************************/ - -/* This function is called (optionally) at the start of compile or match, to -validate that a supposed UTF-8 string is actually valid. The early check means -that subsequent code can assume it is dealing with a valid string. The check -can be turned off for maximum performance, but the consequences of supplying -an invalid string are then undefined. - -Arguments: - string points to the string - length length of string, or -1 if the string is zero-terminated - -Returns: < 0 if the string is a valid UTF-8 string - >= 0 otherwise; the value is the offset of the bad byte -*/ - -EXPORT int -_pcre_valid_utf8(const uschar *string, int length) -{ -register const uschar *p; - -if (length < 0) - { - for (p = string; *p != 0; p++); - length = p - string; - } - -for (p = string; length-- > 0; p++) - { - register int ab; - register int c = *p; - if (c < 128) continue; - if ((c & 0xc0) != 0xc0) return p - string; - ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ - if (length < ab) return p - string; - length -= ab; - - /* Check top bits in the second byte */ - if ((*(++p) & 0xc0) != 0x80) return p - string; - - /* Check for overlong sequences for each different length */ - switch (ab) - { - /* Check for xx00 000x */ - case 1: - if ((c & 0x3e) == 0) return p - string; - continue; /* We know there aren't any more bytes to check */ - - /* Check for 1110 0000, xx0x xxxx */ - case 2: - if (c == 0xe0 && (*p & 0x20) == 0) return p - string; - break; - - /* Check for 1111 0000, xx00 xxxx */ - case 3: - if (c == 0xf0 && (*p & 0x30) == 0) return p - string; - break; - - /* Check for 1111 1000, xx00 0xxx */ - case 4: - if (c == 0xf8 && (*p & 0x38) == 0) return p - string; - break; - - /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */ - case 5: - if (c == 0xfe || c == 0xff || - (c == 0xfc && (*p & 0x3c) == 0)) return p - string; - break; - } - - /* Check for valid bytes after the 2nd, if any; all must start 10 */ - while (--ab > 0) - { - if ((*(++p) & 0xc0) != 0x80) return p - string; - } - } - -return -1; -} - -/* End of pcre_valid_utf8.c */ diff --git a/ext/pcre/pcrelib/pcre_version.c b/ext/pcre/pcrelib/pcre_version.c deleted file mode 100644 index d296eea809c9f..0000000000000 --- a/ext/pcre/pcrelib/pcre_version.c +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_version(), which returns a -string that identifies the PCRE version that is in use. */ - - -#include "pcre_internal.h" - - -/************************************************* -* Return version string * -*************************************************/ - -#define STRING(a) # a -#define XSTRING(s) STRING(s) - -EXPORT const char * -pcre_version(void) -{ -return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE); -} - -/* End of pcre_version.c */ diff --git a/ext/pcre/pcrelib/pcre_xclass.c b/ext/pcre/pcrelib/pcre_xclass.c deleted file mode 100644 index 40d2654da0881..0000000000000 --- a/ext/pcre/pcrelib/pcre_xclass.c +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module contains an internal function that is used to match an extended -class (one that contains characters whose values are > 255). It is used by both -pcre_exec() and pcre_def_exec(). */ - - -#include "pcre_internal.h" - - -/************************************************* -* Match character against an XCLASS * -*************************************************/ - -/* This function is called to match a character against an extended class that -might contain values > 255. - -Arguments: - c the character - data points to the flag byte of the XCLASS data - -Returns: TRUE if character matches, else FALSE -*/ - -EXPORT BOOL -_pcre_xclass(int c, const uschar *data) -{ -int t; -BOOL negated = (*data & XCL_NOT) != 0; - -/* Character values < 256 are matched against a bitmap, if one is present. If -not, we still carry on, because there may be ranges that start below 256 in the -additional data. */ - -if (c < 256) - { - if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0) - return !negated; /* char found */ - } - -/* First skip the bit map if present. Then match against the list of Unicode -properties or large chars or ranges that end with a large char. We won't ever -encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */ - -if ((*data++ & XCL_MAP) != 0) data += 32; - -while ((t = *data++) != XCL_END) - { - int x, y; - if (t == XCL_SINGLE) - { - GETCHARINC(x, data); - if (c == x) return !negated; - } - else if (t == XCL_RANGE) - { - GETCHARINC(x, data); - GETCHARINC(y, data); - if (c >= x && c <= y) return !negated; - } - -#ifdef SUPPORT_UCP - else /* XCL_PROP & XCL_NOTPROP */ - { - int chartype, othercase; - int rqdtype = *data++; - int category = ucp_findchar(c, &chartype, &othercase); - if (rqdtype >= 128) - { - if ((rqdtype - 128 == category) == (t == XCL_PROP)) return !negated; - } - else - { - if ((rqdtype == chartype) == (t == XCL_PROP)) return !negated; - } - } -#endif /* SUPPORT_UCP */ - } - -return negated; /* char did not match */ -} - -/* End of pcre_xclass.c */ diff --git a/ext/pcre/pcrelib/pcrecpp.cc b/ext/pcre/pcrelib/pcrecpp.cc deleted file mode 100644 index 0ffd221d2335e..0000000000000 --- a/ext/pcre/pcrelib/pcrecpp.cc +++ /dev/null @@ -1,770 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat - -#include <stdlib.h> -#include <stdio.h> -#include <ctype.h> -#include <limits.h> /* for SHRT_MIN, USHRT_MAX, etc */ -#include <assert.h> -#include <errno.h> -#include <string> -#include <algorithm> -#include "config.h" -// We need this to compile the proper dll on windows/msys. This is copied -// from pcre_internal.h. It would probably be better just to include that. -#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */ -#include "pcre.h" -#include "pcre_stringpiece.h" -#include "pcrecpp.h" - - -namespace pcrecpp { - -// Maximum number of args we can set -static const int kMaxArgs = 16; -static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace - -// Special object that stands-in for no argument -Arg no_arg((void*)NULL); - -// If a regular expression has no error, its error_ field points here -static const string empty_string; - -// If the user doesn't ask for any options, we just use this one -static RE_Options default_options; - -void RE::Init(const char* pat, const RE_Options* options) { - pattern_ = pat; - if (options == NULL) { - options_ = default_options; - } else { - options_ = *options; - } - error_ = &empty_string; - re_full_ = NULL; - re_partial_ = NULL; - - re_partial_ = Compile(UNANCHORED); - if (re_partial_ != NULL) { - // Check for complicated patterns. The following change is - // conservative in that it may treat some "simple" patterns - // as "complex" (e.g., if the vertical bar is in a character - // class or is escaped). But it seems good enough. - if (strchr(pat, '|') == NULL) { - // Simple pattern: we can use position-based checks to perform - // fully anchored matches - re_full_ = re_partial_; - } else { - // We need a special pattern for anchored matches - re_full_ = Compile(ANCHOR_BOTH); - } - } -} - -RE::~RE() { - if (re_full_ != NULL && re_full_ != re_partial_) (*pcre_free)(re_full_); - if (re_partial_ != NULL) (*pcre_free)(re_partial_); - if (error_ != &empty_string) delete error_; -} - -pcre* RE::Compile(Anchor anchor) { - // First, convert RE_Options into pcre options - int pcre_options = 0; - pcre_options = options_.all_options(); - - // Special treatment for anchoring. This is needed because at - // runtime pcre only provides an option for anchoring at the - // beginning of a string (unless you use offset). - // - // There are three types of anchoring we want: - // UNANCHORED Compile the original pattern, and use - // a pcre unanchored match. - // ANCHOR_START Compile the original pattern, and use - // a pcre anchored match. - // ANCHOR_BOTH Tack a "\z" to the end of the original pattern - // and use a pcre anchored match. - - const char* compile_error; - int eoffset; - pcre* re; - if (anchor != ANCHOR_BOTH) { - re = pcre_compile(pattern_.c_str(), pcre_options, - &compile_error, &eoffset, NULL); - } else { - // Tack a '\z' at the end of RE. Parenthesize it first so that - // the '\z' applies to all top-level alternatives in the regexp. - string wrapped = "(?:"; // A non-counting grouping operator - wrapped += pattern_; - wrapped += ")\\z"; - re = pcre_compile(wrapped.c_str(), pcre_options, - &compile_error, &eoffset, NULL); - } - if (re == NULL) { - if (error_ == &empty_string) error_ = new string(compile_error); - } - return re; -} - -/***** Matching interfaces *****/ - -bool RE::FullMatch(const StringPiece& text, - const Arg& ptr1, - const Arg& ptr2, - const Arg& ptr3, - const Arg& ptr4, - const Arg& ptr5, - const Arg& ptr6, - const Arg& ptr7, - const Arg& ptr8, - const Arg& ptr9, - const Arg& ptr10, - const Arg& ptr11, - const Arg& ptr12, - const Arg& ptr13, - const Arg& ptr14, - const Arg& ptr15, - const Arg& ptr16) const { - const Arg* args[kMaxArgs]; - int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; - done: - - int consumed; - int vec[kVecSize]; - return DoMatchImpl(text, ANCHOR_BOTH, &consumed, args, n, vec, kVecSize); -} - -bool RE::PartialMatch(const StringPiece& text, - const Arg& ptr1, - const Arg& ptr2, - const Arg& ptr3, - const Arg& ptr4, - const Arg& ptr5, - const Arg& ptr6, - const Arg& ptr7, - const Arg& ptr8, - const Arg& ptr9, - const Arg& ptr10, - const Arg& ptr11, - const Arg& ptr12, - const Arg& ptr13, - const Arg& ptr14, - const Arg& ptr15, - const Arg& ptr16) const { - const Arg* args[kMaxArgs]; - int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; - done: - - int consumed; - int vec[kVecSize]; - return DoMatchImpl(text, UNANCHORED, &consumed, args, n, vec, kVecSize); -} - -bool RE::Consume(StringPiece* input, - const Arg& ptr1, - const Arg& ptr2, - const Arg& ptr3, - const Arg& ptr4, - const Arg& ptr5, - const Arg& ptr6, - const Arg& ptr7, - const Arg& ptr8, - const Arg& ptr9, - const Arg& ptr10, - const Arg& ptr11, - const Arg& ptr12, - const Arg& ptr13, - const Arg& ptr14, - const Arg& ptr15, - const Arg& ptr16) const { - const Arg* args[kMaxArgs]; - int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; - done: - - int consumed; - int vec[kVecSize]; - if (DoMatchImpl(*input, ANCHOR_START, &consumed, - args, n, vec, kVecSize)) { - input->remove_prefix(consumed); - return true; - } else { - return false; - } -} - -bool RE::FindAndConsume(StringPiece* input, - const Arg& ptr1, - const Arg& ptr2, - const Arg& ptr3, - const Arg& ptr4, - const Arg& ptr5, - const Arg& ptr6, - const Arg& ptr7, - const Arg& ptr8, - const Arg& ptr9, - const Arg& ptr10, - const Arg& ptr11, - const Arg& ptr12, - const Arg& ptr13, - const Arg& ptr14, - const Arg& ptr15, - const Arg& ptr16) const { - const Arg* args[kMaxArgs]; - int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; - done: - - int consumed; - int vec[kVecSize]; - if (DoMatchImpl(*input, UNANCHORED, &consumed, - args, n, vec, kVecSize)) { - input->remove_prefix(consumed); - return true; - } else { - return false; - } -} - -bool RE::Replace(const StringPiece& rewrite, - string *str) const { - int vec[kVecSize]; - int matches = TryMatch(*str, 0, UNANCHORED, vec, kVecSize); - if (matches == 0) - return false; - - string s; - if (!Rewrite(&s, rewrite, *str, vec, matches)) - return false; - - assert(vec[0] >= 0); - assert(vec[1] >= 0); - str->replace(vec[0], vec[1] - vec[0], s); - return true; -} - -int RE::GlobalReplace(const StringPiece& rewrite, - string *str) const { - int count = 0; - int vec[kVecSize]; - string out; - int start = 0; - int lastend = -1; - - for (; start <= static_cast<int>(str->length()); count++) { - int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize); - if (matches <= 0) - break; - int matchstart = vec[0], matchend = vec[1]; - assert(matchstart >= start); - assert(matchend >= matchstart); - if (matchstart == matchend && matchstart == lastend) { - // advance one character if we matched an empty string at the same - // place as the last match occurred - if (start < static_cast<int>(str->length())) - out.push_back((*str)[start]); - start++; - } else { - out.append(*str, start, matchstart - start); - Rewrite(&out, rewrite, *str, vec, matches); - start = matchend; - lastend = matchend; - count++; - } - } - - if (count == 0) - return 0; - - if (start < static_cast<int>(str->length())) - out.append(*str, start, str->length() - start); - swap(out, *str); - return count; -} - -bool RE::Extract(const StringPiece& rewrite, - const StringPiece& text, - string *out) const { - int vec[kVecSize]; - int matches = TryMatch(text, 0, UNANCHORED, vec, kVecSize); - if (matches == 0) - return false; - out->erase(); - return Rewrite(out, rewrite, text, vec, matches); -} - -/***** Actual matching and rewriting code *****/ - -int RE::TryMatch(const StringPiece& text, - int startpos, - Anchor anchor, - int *vec, - int vecsize) const { - pcre* re = (anchor == ANCHOR_BOTH) ? re_full_ : re_partial_; - if (re == NULL) { - //fprintf(stderr, "Matching against invalid re: %s\n", error_->c_str()); - return 0; - } - - pcre_extra extra = { 0 }; - if (options_.match_limit() > 0) { - extra.flags = PCRE_EXTRA_MATCH_LIMIT; - extra.match_limit = options_.match_limit(); - } - int rc = pcre_exec(re, // The regular expression object - &extra, - text.data(), - text.size(), - startpos, - (anchor == UNANCHORED) ? 0 : PCRE_ANCHORED, - vec, - vecsize); - - // Handle errors - if (rc == PCRE_ERROR_NOMATCH) { - return 0; - } else if (rc < 0) { - //fprintf(stderr, "Unexpected return code: %d when matching '%s'\n", - // re, pattern_.c_str()); - return 0; - } else if (rc == 0) { - // pcre_exec() returns 0 as a special case when the number of - // capturing subpatterns exceeds the size of the vector. - // When this happens, there is a match and the output vector - // is filled, but we miss out on the positions of the extra subpatterns. - rc = vecsize / 2; - } - - if ((anchor == ANCHOR_BOTH) && (re_full_ == re_partial_)) { - // We need an extra check to make sure that the match extended - // to the end of the input string - assert(vec[0] == 0); // PCRE_ANCHORED forces starting match - if (vec[1] != text.size()) return 0; // Did not get ending match - } - - return rc; -} - -bool RE::DoMatchImpl(const StringPiece& text, - Anchor anchor, - int* consumed, - const Arg* const* args, - int n, - int* vec, - int vecsize) const { - assert((1 + n) * 3 <= vecsize); // results + PCRE workspace - int matches = TryMatch(text, 0, anchor, vec, vecsize); - assert(matches >= 0); // TryMatch never returns negatives - if (matches == 0) - return false; - - *consumed = vec[1]; - - if (args == NULL) { - // We are not interested in results - return true; - } - - // If we got here, we must have matched the whole pattern. - // We do not need (can not do) any more checks on the value of 'matches' here - // -- see the comment for TryMatch. - for (int i = 0; i < n; i++) { - const int start = vec[2*(i+1)]; - const int limit = vec[2*(i+1)+1]; - if (!args[i]->Parse(text.data() + start, limit-start)) { - // TODO: Should we indicate what the error was? - return false; - } - } - - return true; -} - -bool RE::DoMatch(const StringPiece& text, - Anchor anchor, - int* consumed, - const Arg* const args[], - int n) const { - assert(n >= 0); - size_t const vecsize = (1 + n) * 3; // results + PCRE workspace - // (as for kVecSize) - int space[21]; // use stack allocation for small vecsize (common case) - int* vec = vecsize <= 21 ? space : new int[vecsize]; - bool retval = DoMatchImpl(text, anchor, consumed, args, n, vec, vecsize); - if (vec != space) delete [] vec; - return retval; -} - -bool RE::Rewrite(string *out, const StringPiece &rewrite, - const StringPiece &text, int *vec, int veclen) const { - for (const char *s = rewrite.data(), *end = s + rewrite.size(); - s < end; s++) { - int c = *s; - if (c == '\\') { - c = *++s; - if (isdigit(c)) { - int n = (c - '0'); - if (n >= veclen) { - //fprintf(stderr, requested group %d in regexp %.*s\n", - // n, rewrite.size(), rewrite.data()); - return false; - } - int start = vec[2 * n]; - if (start >= 0) - out->append(text.data() + start, vec[2 * n + 1] - start); - } else if (c == '\\') { - out->push_back('\\'); - } else { - //fprintf(stderr, "invalid rewrite pattern: %.*s\n", - // rewrite.size(), rewrite.data()); - return false; - } - } else { - out->push_back(c); - } - } - return true; -} - -// Return the number of capturing subpatterns, or -1 if the -// regexp wasn't valid on construction. -int RE::NumberOfCapturingGroups() { - if (re_partial_ == NULL) return -1; - - int result; - int pcre_retval = pcre_fullinfo(re_partial_, // The regular expression object - NULL, // We did not study the pattern - PCRE_INFO_CAPTURECOUNT, - &result); - assert(pcre_retval == 0); - return result; -} - -/***** Parsers for various types *****/ - -bool Arg::parse_null(const char* str, int n, void* dest) { - // We fail if somebody asked us to store into a non-NULL void* pointer - return (dest == NULL); -} - -bool Arg::parse_string(const char* str, int n, void* dest) { - reinterpret_cast<string*>(dest)->assign(str, n); - return true; -} - -bool Arg::parse_stringpiece(const char* str, int n, void* dest) { - reinterpret_cast<StringPiece*>(dest)->set(str, n); - return true; -} - -bool Arg::parse_char(const char* str, int n, void* dest) { - if (n != 1) return false; - *(reinterpret_cast<char*>(dest)) = str[0]; - return true; -} - -bool Arg::parse_uchar(const char* str, int n, void* dest) { - if (n != 1) return false; - *(reinterpret_cast<unsigned char*>(dest)) = str[0]; - return true; -} - -// Largest number spec that we are willing to parse -static const int kMaxNumberLength = 32; - -// REQUIRES "buf" must have length at least kMaxNumberLength+1 -// REQUIRES "n > 0" -// Copies "str" into "buf" and null-terminates if necessary. -// Returns one of: -// a. "str" if no termination is needed -// b. "buf" if the string was copied and null-terminated -// c. "" if the input was invalid and has no hope of being parsed -static const char* TerminateNumber(char* buf, const char* str, int n) { - if ((n > 0) && isspace(*str)) { - // We are less forgiving than the strtoxxx() routines and do not - // allow leading spaces. - return ""; - } - - // See if the character right after the input text may potentially - // look like a digit. - if (isdigit(str[n]) || - ((str[n] >= 'a') && (str[n] <= 'f')) || - ((str[n] >= 'A') && (str[n] <= 'F'))) { - if (n > kMaxNumberLength) return ""; // Input too big to be a valid number - memcpy(buf, str, n); - buf[n] = '\0'; - return buf; - } else { - // We can parse right out of the supplied string, so return it. - return str; - } -} - -bool Arg::parse_long_radix(const char* str, - int n, - void* dest, - int radix) { - if (n == 0) return false; - char buf[kMaxNumberLength+1]; - str = TerminateNumber(buf, str, n); - char* end; - errno = 0; - long r = strtol(str, &end, radix); - if (end != str + n) return false; // Leftover junk - if (errno) return false; - *(reinterpret_cast<long*>(dest)) = r; - return true; -} - -bool Arg::parse_ulong_radix(const char* str, - int n, - void* dest, - int radix) { - if (n == 0) return false; - char buf[kMaxNumberLength+1]; - str = TerminateNumber(buf, str, n); - char* end; - errno = 0; - unsigned long r = strtoul(str, &end, radix); - if (end != str + n) return false; // Leftover junk - if (errno) return false; - *(reinterpret_cast<unsigned long*>(dest)) = r; - return true; -} - -bool Arg::parse_short_radix(const char* str, - int n, - void* dest, - int radix) { - long r; - if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse - if (r < SHRT_MIN || r > SHRT_MAX) return false; // Out of range - *(reinterpret_cast<short*>(dest)) = r; - return true; -} - -bool Arg::parse_ushort_radix(const char* str, - int n, - void* dest, - int radix) { - unsigned long r; - if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse - if (r > USHRT_MAX) return false; // Out of range - *(reinterpret_cast<unsigned short*>(dest)) = r; - return true; -} - -bool Arg::parse_int_radix(const char* str, - int n, - void* dest, - int radix) { - long r; - if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse - if (r < INT_MIN || r > INT_MAX) return false; // Out of range - *(reinterpret_cast<int*>(dest)) = r; - return true; -} - -bool Arg::parse_uint_radix(const char* str, - int n, - void* dest, - int radix) { - unsigned long r; - if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse - if (r > UINT_MAX) return false; // Out of range - *(reinterpret_cast<unsigned int*>(dest)) = r; - return true; -} - -bool Arg::parse_longlong_radix(const char* str, - int n, - void* dest, - int radix) { -#ifndef HAVE_LONG_LONG - return false; -#else - if (n == 0) return false; - char buf[kMaxNumberLength+1]; - str = TerminateNumber(buf, str, n); - char* end; - errno = 0; -#if defined HAVE_STRTOQ - long long r = strtoq(str, &end, radix); -#elif defined HAVE_STRTOLL - long long r = strtoll(str, &end, radix); -#else -#error parse_longlong_radix: cannot convert input to a long-long -#endif - if (end != str + n) return false; // Leftover junk - if (errno) return false; - *(reinterpret_cast<long long*>(dest)) = r; - return true; -#endif /* HAVE_LONG_LONG */ -} - -bool Arg::parse_ulonglong_radix(const char* str, - int n, - void* dest, - int radix) { -#ifndef HAVE_UNSIGNED_LONG_LONG - return false; -#else - if (n == 0) return false; - char buf[kMaxNumberLength+1]; - str = TerminateNumber(buf, str, n); - char* end; - errno = 0; -#if defined HAVE_STRTOQ - unsigned long long r = strtouq(str, &end, radix); -#elif defined HAVE_STRTOLL - unsigned long long r = strtoull(str, &end, radix); -#else -#error parse_ulonglong_radix: cannot convert input to a long-long -#endif - if (end != str + n) return false; // Leftover junk - if (errno) return false; - *(reinterpret_cast<unsigned long long*>(dest)) = r; - return true; -#endif /* HAVE_UNSIGNED_LONG_LONG */ -} - -bool Arg::parse_double(const char* str, int n, void* dest) { - if (n == 0) return false; - static const int kMaxLength = 200; - char buf[kMaxLength]; - if (n >= kMaxLength) return false; - memcpy(buf, str, n); - buf[n] = '\0'; - errno = 0; - char* end; - double r = strtod(buf, &end); - if (end != buf + n) return false; // Leftover junk - if (errno) return false; - *(reinterpret_cast<double*>(dest)) = r; - return true; -} - -bool Arg::parse_float(const char* str, int n, void* dest) { - double r; - if (!parse_double(str, n, &r)) return false; - *(reinterpret_cast<float*>(dest)) = static_cast<float>(r); - return true; -} - - -#define DEFINE_INTEGER_PARSERS(name) \ - bool Arg::parse_##name(const char* str, int n, void* dest) { \ - return parse_##name##_radix(str, n, dest, 10); \ - } \ - bool Arg::parse_##name##_hex(const char* str, int n, void* dest) { \ - return parse_##name##_radix(str, n, dest, 16); \ - } \ - bool Arg::parse_##name##_octal(const char* str, int n, void* dest) { \ - return parse_##name##_radix(str, n, dest, 8); \ - } \ - bool Arg::parse_##name##_cradix(const char* str, int n, void* dest) { \ - return parse_##name##_radix(str, n, dest, 0); \ - } - -DEFINE_INTEGER_PARSERS(short); -DEFINE_INTEGER_PARSERS(ushort); -DEFINE_INTEGER_PARSERS(int); -DEFINE_INTEGER_PARSERS(uint); -DEFINE_INTEGER_PARSERS(long); -DEFINE_INTEGER_PARSERS(ulong); -DEFINE_INTEGER_PARSERS(longlong); -DEFINE_INTEGER_PARSERS(ulonglong); - -#undef DEFINE_INTEGER_PARSERS - -} // namespace pcrecpp diff --git a/ext/pcre/pcrelib/pcrecpp.h b/ext/pcre/pcrelib/pcrecpp.h deleted file mode 100644 index ef9d9b2b58c0a..0000000000000 --- a/ext/pcre/pcrelib/pcrecpp.h +++ /dev/null @@ -1,786 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat -// Support for PCRE_XXX modifiers added by Giuseppe Maxia, July 2005 - -#ifndef _PCRE_REGEXP_H -#define _PCRE_REGEXP_H - -// C++ interface to the pcre regular-expression library. RE supports -// Perl-style regular expressions (with extensions like \d, \w, \s, -// ...). -// -// ----------------------------------------------------------------------- -// REGEXP SYNTAX: -// -// This module is part of the pcre library and hence supports its syntax -// for regular expressions. -// -// The syntax is pretty similar to Perl's. For those not familiar -// with Perl's regular expressions, here are some examples of the most -// commonly used extensions: -// -// "hello (\\w+) world" -- \w matches a "word" character -// "version (\\d+)" -- \d matches a digit -// "hello\\s+world" -- \s matches any whitespace character -// "\\b(\\w+)\\b" -- \b matches empty string at a word boundary -// "(?i)hello" -- (?i) turns on case-insensitive matching -// "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible -// -// ----------------------------------------------------------------------- -// MATCHING INTERFACE: -// -// The "FullMatch" operation checks that supplied text matches a -// supplied pattern exactly. -// -// Example: successful match -// pcrecpp::RE re("h.*o"); -// re.FullMatch("hello"); -// -// Example: unsuccessful match (requires full match): -// pcrecpp::RE re("e"); -// !re.FullMatch("hello"); -// -// Example: creating a temporary RE object: -// pcrecpp::RE("h.*o").FullMatch("hello"); -// -// You can pass in a "const char*" or a "string" for "text". The -// examples below tend to use a const char*. -// -// You can, as in the different examples above, store the RE object -// explicitly in a variable or use a temporary RE object. The -// examples below use one mode or the other arbitrarily. Either -// could correctly be used for any of these examples. -// -// ----------------------------------------------------------------------- -// MATCHING WITH SUB-STRING EXTRACTION: -// -// You can supply extra pointer arguments to extract matched subpieces. -// -// Example: extracts "ruby" into "s" and 1234 into "i" -// int i; -// string s; -// pcrecpp::RE re("(\\w+):(\\d+)"); -// re.FullMatch("ruby:1234", &s, &i); -// -// Example: does not try to extract any extra sub-patterns -// re.FullMatch("ruby:1234", &s); -// -// Example: does not try to extract into NULL -// re.FullMatch("ruby:1234", NULL, &i); -// -// Example: integer overflow causes failure -// !re.FullMatch("ruby:1234567891234", NULL, &i); -// -// Example: fails because there aren't enough sub-patterns: -// !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); -// -// Example: fails because string cannot be stored in integer -// !pcrecpp::RE("(.*)").FullMatch("ruby", &i); -// -// The provided pointer arguments can be pointers to any scalar numeric -// type, or one of -// string (matched piece is copied to string) -// StringPiece (StringPiece is mutated to point to matched piece) -// T (where "bool T::ParseFrom(const char*, int)" exists) -// NULL (the corresponding matched sub-pattern is not copied) -// -// ----------------------------------------------------------------------- -// DO_MATCH -// -// The matching interface supports at most 16 arguments per call. -// If you need more, consider using the more general interface -// pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch. -// -// ----------------------------------------------------------------------- -// PARTIAL MATCHES -// -// You can use the "PartialMatch" operation when you want the pattern -// to match any substring of the text. -// -// Example: simple search for a string: -// pcrecpp::RE("ell").PartialMatch("hello"); -// -// Example: find first number in a string: -// int number; -// pcrecpp::RE re("(\\d+)"); -// re.PartialMatch("x*100 + 20", &number); -// assert(number == 100); -// -// ----------------------------------------------------------------------- -// UTF-8 AND THE MATCHING INTERFACE: -// -// By default, pattern and text are plain text, one byte per character. -// The UTF8 flag, passed to the constructor, causes both pattern -// and string to be treated as UTF-8 text, still a byte stream but -// potentially multiple bytes per character. In practice, the text -// is likelier to be UTF-8 than the pattern, but the match returned -// may depend on the UTF8 flag, so always use it when matching -// UTF8 text. E.g., "." will match one byte normally but with UTF8 -// set may match up to three bytes of a multi-byte character. -// -// Example: -// pcrecpp::RE_Options options; -// options.set_utf8(); -// pcrecpp::RE re(utf8_pattern, options); -// re.FullMatch(utf8_string); -// -// Example: using the convenience function UTF8(): -// pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); -// re.FullMatch(utf8_string); -// -// NOTE: The UTF8 option is ignored if pcre was not configured with the -// --enable-utf8 flag. -// -// ----------------------------------------------------------------------- -// PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE -// -// PCRE defines some modifiers to change the behavior of the regular -// expression engine. -// The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle -// to pass such modifiers to a RE class. -// -// Currently, the following modifiers are supported -// -// modifier description Perl corresponding -// -// PCRE_CASELESS case insensitive match /i -// PCRE_MULTILINE multiple lines match /m -// PCRE_DOTALL dot matches newlines /s -// PCRE_DOLLAR_ENDONLY $ matches only at end N/A -// PCRE_EXTRA strict escape parsing N/A -// PCRE_EXTENDED ignore whitespaces /x -// PCRE_UTF8 handles UTF8 chars built-in -// PCRE_UNGREEDY reverses * and *? N/A -// PCRE_NO_AUTO_CAPTURE disables matching parens N/A (*) -// -// (For a full account on how each modifier works, please check the -// PCRE API reference manual). -// -// (*) Both Perl and PCRE allow non matching parentheses by means of the -// "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not -// capture, while (ab|cd) does. -// -// For each modifier, there are two member functions whose name is made -// out of the modifier in lowercase, without the "PCRE_" prefix. For -// instance, PCRE_CASELESS is handled by -// bool caseless(), -// which returns true if the modifier is set, and -// RE_Options & set_caseless(bool), -// which sets or unsets the modifier. -// -// Moreover, PCRE_CONFIG_MATCH_LIMIT can be accessed through the -// set_match_limit() and match_limit() member functions. -// Setting match_limit to a non-zero value will limit the executation of -// pcre to keep it from doing bad things like blowing the stack or taking -// an eternity to return a result. A value of 5000 is good enough to stop -// stack blowup in a 2MB thread stack. Setting match_limit to zero will -// disable match limiting. -// -// Normally, to pass one or more modifiers to a RE class, you declare -// a RE_Options object, set the appropriate options, and pass this -// object to a RE constructor. Example: -// -// RE_options opt; -// opt.set_caseless(true); -// -// if (RE("HELLO", opt).PartialMatch("hello world")) ... -// -// RE_options has two constructors. The default constructor takes no -// arguments and creates a set of flags that are off by default. -// -// The optional parameter 'option_flags' is to facilitate transfer -// of legacy code from C programs. This lets you do -// RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); -// -// But new code is better off doing -// RE(pattern, -// RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); -// (See below) -// -// If you are going to pass one of the most used modifiers, there are some -// convenience functions that return a RE_Options class with the -// appropriate modifier already set: -// CASELESS(), UTF8(), MULTILINE(), DOTALL(), EXTENDED() -// -// If you need to set several options at once, and you don't want to go -// through the pains of declaring a RE_Options object and setting several -// options, there is a parallel method that give you such ability on the -// fly. You can concatenate several set_xxxxx member functions, since each -// of them returns a reference to its class object. e.g.: to pass -// PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one -// statement, you may write -// -// RE(" ^ xyz \\s+ .* blah$", RE_Options() -// .set_caseless(true) -// .set_extended(true) -// .set_multiline(true)).PartialMatch(sometext); -// -// ----------------------------------------------------------------------- -// SCANNING TEXT INCREMENTALLY -// -// The "Consume" operation may be useful if you want to repeatedly -// match regular expressions at the front of a string and skip over -// them as they match. This requires use of the "StringPiece" type, -// which represents a sub-range of a real string. Like RE, StringPiece -// is defined in the pcrecpp namespace. -// -// Example: read lines of the form "var = value" from a string. -// string contents = ...; // Fill string somehow -// pcrecpp::StringPiece input(contents); // Wrap in a StringPiece -// -// string var; -// int value; -// pcrecpp::RE re("(\\w+) = (\\d+)\n"); -// while (re.Consume(&input, &var, &value)) { -// ...; -// } -// -// Each successful call to "Consume" will set "var/value", and also -// advance "input" so it points past the matched text. -// -// The "FindAndConsume" operation is similar to "Consume" but does not -// anchor your match at the beginning of the string. For example, you -// could extract all words from a string by repeatedly calling -// pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) -// -// ----------------------------------------------------------------------- -// PARSING HEX/OCTAL/C-RADIX NUMBERS -// -// By default, if you pass a pointer to a numeric value, the -// corresponding text is interpreted as a base-10 number. You can -// instead wrap the pointer with a call to one of the operators Hex(), -// Octal(), or CRadix() to interpret the text in another base. The -// CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) -// prefixes, but defaults to base-10. -// -// Example: -// int a, b, c, d; -// pcrecpp::RE re("(.*) (.*) (.*) (.*)"); -// re.FullMatch("100 40 0100 0x40", -// pcrecpp::Octal(&a), pcrecpp::Hex(&b), -// pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); -// will leave 64 in a, b, c, and d. -// -// ----------------------------------------------------------------------- -// REPLACING PARTS OF STRINGS -// -// You can replace the first match of "pattern" in "str" with -// "rewrite". Within "rewrite", backslash-escaped digits (\1 to \9) -// can be used to insert text matching corresponding parenthesized -// group from the pattern. \0 in "rewrite" refers to the entire -// matching text. E.g., -// -// string s = "yabba dabba doo"; -// pcrecpp::RE("b+").Replace("d", &s); -// -// will leave "s" containing "yada dabba doo". The result is true if -// the pattern matches and a replacement occurs, or false otherwise. -// -// GlobalReplace() is like Replace(), except that it replaces all -// occurrences of the pattern in the string with the rewrite. -// Replacements are not subject to re-matching. E.g., -// -// string s = "yabba dabba doo"; -// pcrecpp::RE("b+").GlobalReplace("d", &s); -// -// will leave "s" containing "yada dada doo". It returns the number -// of replacements made. -// -// Extract() is like Replace(), except that if the pattern matches, -// "rewrite" is copied into "out" (an additional argument) with -// substitutions. The non-matching portions of "text" are ignored. -// Returns true iff a match occurred and the extraction happened -// successfully. If no match occurs, the string is left unaffected. - - -#include <string> -// These aren't technically needed here, but we include them -// anyway so folks who include pcrecpp.h don't have to include -// all these other header files as well. -#include <pcre.h> -#include <pcre_stringpiece.h> - -namespace pcrecpp { - -#define PCRE_SET_OR_CLEAR(b, o) \ - if (b) all_options_ |= (o); else all_options_ &= ~(o); \ - return *this - -#define PCRE_IS_SET(o) \ - (all_options_ & o) == o - -// We convert user-passed pointers into special Arg objects -class Arg; -extern Arg no_arg; - -/***** Compiling regular expressions: the RE class *****/ - -// RE_Options allow you to set options to be passed along to pcre, -// along with other options we put on top of pcre. -// Only 9 modifiers, plus match_limit are supported now. -class RE_Options { - public: - // constructor - RE_Options() : match_limit_(0), all_options_(0) {} - - // alternative constructor. - // To facilitate transfer of legacy code from C programs - // - // This lets you do - // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); - // But new code is better off doing - // RE(pattern, - // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); - RE_Options(int option_flags) : match_limit_(0), all_options_ (option_flags) {} - // we're fine with the default destructor, copy constructor, etc. - - // accessors and mutators - int match_limit() const { return match_limit_; }; - RE_Options &set_match_limit(int limit) { - match_limit_ = limit; - return *this; - } - - bool caseless() const { - return PCRE_IS_SET(PCRE_CASELESS); - } - RE_Options &set_caseless(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_CASELESS); - } - - bool multiline() const { - return PCRE_IS_SET(PCRE_MULTILINE); - } - RE_Options &set_multiline(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_MULTILINE); - } - - bool dotall() const { - return PCRE_IS_SET(PCRE_DOTALL); - } - RE_Options &set_dotall(bool x) { - PCRE_SET_OR_CLEAR(x,PCRE_DOTALL); - } - - bool extended() const { - return PCRE_IS_SET(PCRE_EXTENDED); - } - RE_Options &set_extended(bool x) { - PCRE_SET_OR_CLEAR(x,PCRE_EXTENDED); - } - - bool dollar_endonly() const { - return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY); - } - RE_Options &set_dollar_endonly(bool x) { - PCRE_SET_OR_CLEAR(x,PCRE_DOLLAR_ENDONLY); - } - - bool extra() const { - return PCRE_IS_SET( PCRE_EXTRA); - } - RE_Options &set_extra(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_EXTRA); - } - - bool ungreedy() const { - return PCRE_IS_SET(PCRE_UNGREEDY); - } - RE_Options &set_ungreedy(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_UNGREEDY); - } - - bool utf8() const { - return PCRE_IS_SET(PCRE_UTF8); - } - RE_Options &set_utf8(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_UTF8); - } - - bool no_auto_capture() const { - return PCRE_IS_SET(PCRE_NO_AUTO_CAPTURE); - } - RE_Options &set_no_auto_capture(bool x) { - PCRE_SET_OR_CLEAR(x, PCRE_NO_AUTO_CAPTURE); - } - - RE_Options &set_all_options(int opt) { - all_options_ = opt; - return *this; - } - int all_options() const { - return all_options_ ; - } - - // TODO: add other pcre flags - - private: - int match_limit_; - int all_options_; -}; - -// These functions return some common RE_Options -static inline RE_Options UTF8() { - return RE_Options().set_utf8(true); -} - -static inline RE_Options CASELESS() { - return RE_Options().set_caseless(true); -} -static inline RE_Options MULTILINE() { - return RE_Options().set_multiline(true); -} - -static inline RE_Options DOTALL() { - return RE_Options().set_dotall(true); -} - -static inline RE_Options EXTENDED() { - return RE_Options().set_extended(true); -} - -// Interface for regular expression matching. Also corresponds to a -// pre-compiled regular expression. An "RE" object is safe for -// concurrent use by multiple threads. -class RE { - public: - // We provide implicit conversions from strings so that users can - // pass in a string or a "const char*" wherever an "RE" is expected. - RE(const char* pat) { Init(pat, NULL); } - RE(const char *pat, const RE_Options& option) { Init(pat, &option); } - RE(const string& pat) { Init(pat.c_str(), NULL); } - RE(const string& pat, const RE_Options& option) { Init(pat.c_str(), &option); } - - ~RE(); - - // The string specification for this RE. E.g. - // RE re("ab*c?d+"); - // re.pattern(); // "ab*c?d+" - const string& pattern() const { return pattern_; } - - // If RE could not be created properly, returns an error string. - // Else returns the empty string. - const string& error() const { return *error_; } - - /***** The useful part: the matching interface *****/ - - // This is provided so one can do pattern.ReplaceAll() just as - // easily as ReplaceAll(pattern-text, ....) - - bool FullMatch(const StringPiece& text, - const Arg& ptr1 = no_arg, - const Arg& ptr2 = no_arg, - const Arg& ptr3 = no_arg, - const Arg& ptr4 = no_arg, - const Arg& ptr5 = no_arg, - const Arg& ptr6 = no_arg, - const Arg& ptr7 = no_arg, - const Arg& ptr8 = no_arg, - const Arg& ptr9 = no_arg, - const Arg& ptr10 = no_arg, - const Arg& ptr11 = no_arg, - const Arg& ptr12 = no_arg, - const Arg& ptr13 = no_arg, - const Arg& ptr14 = no_arg, - const Arg& ptr15 = no_arg, - const Arg& ptr16 = no_arg) const; - - bool PartialMatch(const StringPiece& text, - const Arg& ptr1 = no_arg, - const Arg& ptr2 = no_arg, - const Arg& ptr3 = no_arg, - const Arg& ptr4 = no_arg, - const Arg& ptr5 = no_arg, - const Arg& ptr6 = no_arg, - const Arg& ptr7 = no_arg, - const Arg& ptr8 = no_arg, - const Arg& ptr9 = no_arg, - const Arg& ptr10 = no_arg, - const Arg& ptr11 = no_arg, - const Arg& ptr12 = no_arg, - const Arg& ptr13 = no_arg, - const Arg& ptr14 = no_arg, - const Arg& ptr15 = no_arg, - const Arg& ptr16 = no_arg) const; - - bool Consume(StringPiece* input, - const Arg& ptr1 = no_arg, - const Arg& ptr2 = no_arg, - const Arg& ptr3 = no_arg, - const Arg& ptr4 = no_arg, - const Arg& ptr5 = no_arg, - const Arg& ptr6 = no_arg, - const Arg& ptr7 = no_arg, - const Arg& ptr8 = no_arg, - const Arg& ptr9 = no_arg, - const Arg& ptr10 = no_arg, - const Arg& ptr11 = no_arg, - const Arg& ptr12 = no_arg, - const Arg& ptr13 = no_arg, - const Arg& ptr14 = no_arg, - const Arg& ptr15 = no_arg, - const Arg& ptr16 = no_arg) const; - - bool FindAndConsume(StringPiece* input, - const Arg& ptr1 = no_arg, - const Arg& ptr2 = no_arg, - const Arg& ptr3 = no_arg, - const Arg& ptr4 = no_arg, - const Arg& ptr5 = no_arg, - const Arg& ptr6 = no_arg, - const Arg& ptr7 = no_arg, - const Arg& ptr8 = no_arg, - const Arg& ptr9 = no_arg, - const Arg& ptr10 = no_arg, - const Arg& ptr11 = no_arg, - const Arg& ptr12 = no_arg, - const Arg& ptr13 = no_arg, - const Arg& ptr14 = no_arg, - const Arg& ptr15 = no_arg, - const Arg& ptr16 = no_arg) const; - - bool Replace(const StringPiece& rewrite, - string *str) const; - - int GlobalReplace(const StringPiece& rewrite, - string *str) const; - - bool Extract(const StringPiece &rewrite, - const StringPiece &text, - string *out) const; - - /***** Generic matching interface *****/ - - // Type of match (TODO: Should be restructured as part of RE_Options) - enum Anchor { - UNANCHORED, // No anchoring - ANCHOR_START, // Anchor at start only - ANCHOR_BOTH // Anchor at start and end - }; - - // General matching routine. Stores the length of the match in - // "*consumed" if successful. - bool DoMatch(const StringPiece& text, - Anchor anchor, - int* consumed, - const Arg* const* args, int n) const; - - // Return the number of capturing subpatterns, or -1 if the - // regexp wasn't valid on construction. - int NumberOfCapturingGroups(); - - private: - - void Init(const char* pattern, const RE_Options* options); - - // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with - // pairs of integers for the beginning and end positions of matched - // text. The first pair corresponds to the entire matched text; - // subsequent pairs correspond, in order, to parentheses-captured - // matches. Returns the number of pairs (one more than the number of - // the last subpattern with a match) if matching was successful - // and zero if the match failed. - // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching - // against "foo", "bar", and "baz" respectively. - // When matching RE("(foo)|hello") against "hello", it will return 1. - // But the values for all subpattern are filled in into "vec". - int TryMatch(const StringPiece& text, - int startpos, - Anchor anchor, - int *vec, - int vecsize) const; - - // Append the "rewrite" string, with backslash subsitutions from "text" - // and "vec", to string "out". - bool Rewrite(string *out, - const StringPiece& rewrite, - const StringPiece& text, - int *vec, - int veclen) const; - - // internal implementation for DoMatch - bool DoMatchImpl(const StringPiece& text, - Anchor anchor, - int* consumed, - const Arg* const args[], - int n, - int* vec, - int vecsize) const; - - // Compile the regexp for the specified anchoring mode - pcre* Compile(Anchor anchor); - - string pattern_; - RE_Options options_; - pcre* re_full_; // For full matches - pcre* re_partial_; // For partial matches - const string* error_; // Error indicator (or points to empty string) - int match_limit_; // limit on execution resources - - // Don't allow the default copy or assignment constructors -- - // they're expensive and too easy to do by accident. - RE(const RE&); - void operator=(const RE&); -}; - - -/***** Implementation details *****/ - -// Hex/Octal/Binary? - -// Special class for parsing into objects that define a ParseFrom() method -template <class T> -class _RE_MatchObject { - public: - static inline bool Parse(const char* str, int n, void* dest) { - T* object = reinterpret_cast<T*>(dest); - return object->ParseFrom(str, n); - } -}; - -class Arg { - public: - // Empty constructor so we can declare arrays of Arg - Arg(); - - // Constructor specially designed for NULL arguments - Arg(void*); - - typedef bool (*Parser)(const char* str, int n, void* dest); - -// Type-specific parsers -#define PCRE_MAKE_PARSER(type,name) \ - Arg(type* p) : arg_(p), parser_(name) { } \ - Arg(type* p, Parser parser) : arg_(p), parser_(parser) { } - - - PCRE_MAKE_PARSER(char, parse_char); - PCRE_MAKE_PARSER(unsigned char, parse_uchar); - PCRE_MAKE_PARSER(short, parse_short); - PCRE_MAKE_PARSER(unsigned short, parse_ushort); - PCRE_MAKE_PARSER(int, parse_int); - PCRE_MAKE_PARSER(unsigned int, parse_uint); - PCRE_MAKE_PARSER(long, parse_long); - PCRE_MAKE_PARSER(unsigned long, parse_ulong); -#if 1 - PCRE_MAKE_PARSER(long long, parse_longlong); -#endif -#if 1 - PCRE_MAKE_PARSER(unsigned long long, parse_ulonglong); -#endif - PCRE_MAKE_PARSER(float, parse_float); - PCRE_MAKE_PARSER(double, parse_double); - PCRE_MAKE_PARSER(string, parse_string); - PCRE_MAKE_PARSER(StringPiece, parse_stringpiece); - -#undef PCRE_MAKE_PARSER - - // Generic constructor - template <class T> Arg(T*, Parser parser); - // Generic constructor template - template <class T> Arg(T* p) - : arg_(p), parser_(_RE_MatchObject<T>::Parse) { - } - - // Parse the data - bool Parse(const char* str, int n) const; - - private: - void* arg_; - Parser parser_; - - static bool parse_null (const char* str, int n, void* dest); - static bool parse_char (const char* str, int n, void* dest); - static bool parse_uchar (const char* str, int n, void* dest); - static bool parse_float (const char* str, int n, void* dest); - static bool parse_double (const char* str, int n, void* dest); - static bool parse_string (const char* str, int n, void* dest); - static bool parse_stringpiece (const char* str, int n, void* dest); - -#define PCRE_DECLARE_INTEGER_PARSER(name) \ - private: \ - static bool parse_ ## name(const char* str, int n, void* dest); \ - static bool parse_ ## name ## _radix( \ - const char* str, int n, void* dest, int radix); \ - public: \ - static bool parse_ ## name ## _hex(const char* str, int n, void* dest); \ - static bool parse_ ## name ## _octal(const char* str, int n, void* dest); \ - static bool parse_ ## name ## _cradix(const char* str, int n, void* dest) - - PCRE_DECLARE_INTEGER_PARSER(short); - PCRE_DECLARE_INTEGER_PARSER(ushort); - PCRE_DECLARE_INTEGER_PARSER(int); - PCRE_DECLARE_INTEGER_PARSER(uint); - PCRE_DECLARE_INTEGER_PARSER(long); - PCRE_DECLARE_INTEGER_PARSER(ulong); - PCRE_DECLARE_INTEGER_PARSER(longlong); - PCRE_DECLARE_INTEGER_PARSER(ulonglong); - -#undef PCRE_DECLARE_INTEGER_PARSER -}; - -inline Arg::Arg() : arg_(NULL), parser_(parse_null) { } -inline Arg::Arg(void* p) : arg_(p), parser_(parse_null) { } - -inline bool Arg::Parse(const char* str, int n) const { - return (*parser_)(str, n, arg_); -} - -// This part of the parser, appropriate only for ints, deals with bases -#define MAKE_INTEGER_PARSER(type, name) \ - inline Arg Hex(type* ptr) { \ - return Arg(ptr, Arg::parse_ ## name ## _hex); } \ - inline Arg Octal(type* ptr) { \ - return Arg(ptr, Arg::parse_ ## name ## _octal); } \ - inline Arg CRadix(type* ptr) { \ - return Arg(ptr, Arg::parse_ ## name ## _cradix); } - -MAKE_INTEGER_PARSER(short, short); -MAKE_INTEGER_PARSER(unsigned short, ushort); -MAKE_INTEGER_PARSER(int, int); -MAKE_INTEGER_PARSER(unsigned int, uint); -MAKE_INTEGER_PARSER(long, long); -MAKE_INTEGER_PARSER(unsigned long, ulong); -#if 1 -MAKE_INTEGER_PARSER(long long, longlong); -#endif -#if 1 -MAKE_INTEGER_PARSER(unsigned long long, ulonglong); -#endif - -#undef PCRE_IS_SET -#undef PCRE_SET_OR_CLEAR -#undef MAKE_INTEGER_PARSER - -} // namespace pcrecpp - - -#endif /* _PCRE_REGEXP_H */ diff --git a/ext/pcre/pcrelib/pcrecpp_unittest.cc b/ext/pcre/pcrelib/pcrecpp_unittest.cc deleted file mode 100644 index 6a03744a7dbea..0000000000000 --- a/ext/pcre/pcrelib/pcrecpp_unittest.cc +++ /dev/null @@ -1,1042 +0,0 @@ -// Copyright (c) 2005, Google Inc. -// 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 Google Inc. nor the names of its -// 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. -// -// Author: Sanjay Ghemawat -// -// TODO: Test extractions for PartialMatch/Consume - -#include <stdio.h> -#include <vector> -#include "config.h" -#include "pcrecpp.h" - -using pcrecpp::StringPiece; -using pcrecpp::RE; -using pcrecpp::RE_Options; -using pcrecpp::Hex; -using pcrecpp::Octal; -using pcrecpp::CRadix; - -static bool VERBOSE_TEST = false; - -// CHECK dies with a fatal error if condition is not true. It is *not* -// controlled by NDEBUG, so the check will be executed regardless of -// compilation mode. Therefore, it is safe to do things like: -// CHECK_EQ(fp->Write(x), 4) -#define CHECK(condition) do { \ - if (!(condition)) { \ - fprintf(stderr, "%s:%d: Check failed: %s\n", \ - __FILE__, __LINE__, #condition); \ - exit(1); \ - } \ -} while (0) - -#define CHECK_EQ(a, b) CHECK(a == b) - -static void Timing1(int num_iters) { - // Same pattern lots of times - RE pattern("ruby:\\d+"); - StringPiece p("ruby:1234"); - for (int j = num_iters; j > 0; j--) { - CHECK(pattern.FullMatch(p)); - } -} - -static void Timing2(int num_iters) { - // Same pattern lots of times - RE pattern("ruby:(\\d+)"); - int i; - for (int j = num_iters; j > 0; j--) { - CHECK(pattern.FullMatch("ruby:1234", &i)); - CHECK_EQ(i, 1234); - } -} - -static void Timing3(int num_iters) { - string text_string; - for (int j = num_iters; j > 0; j--) { - text_string += "this is another line\n"; - } - - RE line_matcher(".*\n"); - string line; - StringPiece text(text_string); - int counter = 0; - while (line_matcher.Consume(&text)) { - counter++; - } - printf("Matched %d lines\n", counter); -} - -#if 0 // uncomment this if you have a way of defining VirtualProcessSize() - -static void LeakTest() { - // Check for memory leaks - unsigned long long initial_size = 0; - for (int i = 0; i < 100000; i++) { - if (i == 50000) { - initial_size = VirtualProcessSize(); - printf("Size after 50000: %llu\n", initial_size); - } - char buf[100]; - snprintf(buf, sizeof(buf), "pat%09d", i); - RE newre(buf); - } - uint64 final_size = VirtualProcessSize(); - printf("Size after 100000: %llu\n", final_size); - const double growth = double(final_size - initial_size) / final_size; - printf("Growth: %0.2f%%", growth * 100); - CHECK(growth < 0.02); // Allow < 2% growth -} - -#endif - -static void RadixTests() { - printf("Testing hex\n"); - -#define CHECK_HEX(type, value) \ - do { \ - type v; \ - CHECK(RE("([0-9a-fA-F]+)[uUlL]*").FullMatch(#value, Hex(&v))); \ - CHECK_EQ(v, 0x ## value); \ - CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0x" #value, CRadix(&v))); \ - CHECK_EQ(v, 0x ## value); \ - } while(0) - - CHECK_HEX(short, 2bad); - CHECK_HEX(unsigned short, 2badU); - CHECK_HEX(int, dead); - CHECK_HEX(unsigned int, deadU); - CHECK_HEX(long, 7eadbeefL); - CHECK_HEX(unsigned long, deadbeefUL); -#ifdef HAVE_LONG_LONG - CHECK_HEX(long long, 12345678deadbeefLL); -#endif -#ifdef HAVE_UNSIGNED_LONG_LONG - CHECK_HEX(unsigned long long, cafebabedeadbeefULL); -#endif - -#undef CHECK_HEX - - printf("Testing octal\n"); - -#define CHECK_OCTAL(type, value) \ - do { \ - type v; \ - CHECK(RE("([0-7]+)[uUlL]*").FullMatch(#value, Octal(&v))); \ - CHECK_EQ(v, 0 ## value); \ - CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0" #value, CRadix(&v))); \ - CHECK_EQ(v, 0 ## value); \ - } while(0) - - CHECK_OCTAL(short, 77777); - CHECK_OCTAL(unsigned short, 177777U); - CHECK_OCTAL(int, 17777777777); - CHECK_OCTAL(unsigned int, 37777777777U); - CHECK_OCTAL(long, 17777777777L); - CHECK_OCTAL(unsigned long, 37777777777UL); -#ifdef HAVE_LONG_LONG - CHECK_OCTAL(long long, 777777777777777777777LL); -#endif -#ifdef HAVE_UNSIGNED_LONG_LONG - CHECK_OCTAL(unsigned long long, 1777777777777777777777ULL); -#endif - -#undef CHECK_OCTAL - - printf("Testing decimal\n"); - -#define CHECK_DECIMAL(type, value) \ - do { \ - type v; \ - CHECK(RE("(-?[0-9]+)[uUlL]*").FullMatch(#value, &v)); \ - CHECK_EQ(v, value); \ - CHECK(RE("(-?[0-9a-fA-FxX]+)[uUlL]*").FullMatch(#value, CRadix(&v))); \ - CHECK_EQ(v, value); \ - } while(0) - - CHECK_DECIMAL(short, -1); - CHECK_DECIMAL(unsigned short, 9999); - CHECK_DECIMAL(int, -1000); - CHECK_DECIMAL(unsigned int, 12345U); - CHECK_DECIMAL(long, -10000000L); - CHECK_DECIMAL(unsigned long, 3083324652U); -#ifdef HAVE_LONG_LONG - CHECK_DECIMAL(long long, -100000000000000LL); -#endif -#ifdef HAVE_UNSIGNED_LONG_LONG - CHECK_DECIMAL(unsigned long long, 1234567890987654321ULL); -#endif - -#undef CHECK_DECIMAL - -} - -static void TestReplace() { - printf("Testing Replace\n"); - - struct ReplaceTest { - const char *regexp; - const char *rewrite; - const char *original; - const char *single; - const char *global; - }; - static const ReplaceTest tests[] = { - { "(qu|[b-df-hj-np-tv-z]*)([a-z]+)", - "\\2\\1ay", - "the quick brown fox jumps over the lazy dogs.", - "ethay quick brown fox jumps over the lazy dogs.", - "ethay ickquay ownbray oxfay umpsjay overay ethay azylay ogsday." }, - { "\\w+", - "\\0-NOSPAM", - "paul.haahr@google.com", - "paul-NOSPAM.haahr@google.com", - "paul-NOSPAM.haahr-NOSPAM@google-NOSPAM.com-NOSPAM" }, - { "^", - "(START)", - "foo", - "(START)foo", - "(START)foo" }, - { "^", - "(START)", - "", - "(START)", - "(START)" }, - { "$", - "(END)", - "", - "(END)", - "(END)" }, - { "b", - "bb", - "ababababab", - "abbabababab", - "abbabbabbabbabb" }, - { "b", - "bb", - "bbbbbb", - "bbbbbbb", - "bbbbbbbbbbbb" }, - { "b+", - "bb", - "bbbbbb", - "bb", - "bb" }, - { "b*", - "bb", - "bbbbbb", - "bb", - "bb" }, - { "b*", - "bb", - "aaaaa", - "bbaaaaa", - "bbabbabbabbabbabb" }, - { "", NULL, NULL, NULL, NULL } - }; - - for (const ReplaceTest *t = tests; t->original != NULL; ++t) { - string one(t->original); - CHECK(RE(t->regexp).Replace(t->rewrite, &one)); - CHECK_EQ(one, t->single); - string all(t->original); - CHECK(RE(t->regexp).GlobalReplace(t->rewrite, &all) > 0); - CHECK_EQ(all, t->global); - } -} - -static void TestExtract() { - printf("Testing Extract\n"); - - string s; - - CHECK(RE("(.*)@([^.]*)").Extract("\\2!\\1", "boris@kremvax.ru", &s)); - CHECK_EQ(s, "kremvax!boris"); - - // check the RE interface as well - CHECK(RE(".*").Extract("'\\0'", "foo", &s)); - CHECK_EQ(s, "'foo'"); - CHECK(!RE("bar").Extract("'\\0'", "baz", &s)); - CHECK_EQ(s, "'foo'"); -} - -static void TestConsume() { - printf("Testing Consume\n"); - - string word; - - string s(" aaa b!@#$@#$cccc"); - StringPiece input(s); - - RE r("\\s*(\\w+)"); // matches a word, possibly proceeded by whitespace - CHECK(r.Consume(&input, &word)); - CHECK_EQ(word, "aaa"); - CHECK(r.Consume(&input, &word)); - CHECK_EQ(word, "b"); - CHECK(! r.Consume(&input, &word)); -} - -static void TestFindAndConsume() { - printf("Testing FindAndConsume\n"); - - string word; - - string s(" aaa b!@#$@#$cccc"); - StringPiece input(s); - - RE r("(\\w+)"); // matches a word - CHECK(r.FindAndConsume(&input, &word)); - CHECK_EQ(word, "aaa"); - CHECK(r.FindAndConsume(&input, &word)); - CHECK_EQ(word, "b"); - CHECK(r.FindAndConsume(&input, &word)); - CHECK_EQ(word, "cccc"); - CHECK(! r.FindAndConsume(&input, &word)); -} - -static void TestMatchNumberPeculiarity() { - printf("Testing match-number peculiaraity\n"); - - string word1; - string word2; - string word3; - - RE r("(foo)|(bar)|(baz)"); - CHECK(r.PartialMatch("foo", &word1, &word2, &word3)); - CHECK_EQ(word1, "foo"); - CHECK_EQ(word2, ""); - CHECK_EQ(word3, ""); - CHECK(r.PartialMatch("bar", &word1, &word2, &word3)); - CHECK_EQ(word1, ""); - CHECK_EQ(word2, "bar"); - CHECK_EQ(word3, ""); - CHECK(r.PartialMatch("baz", &word1, &word2, &word3)); - CHECK_EQ(word1, ""); - CHECK_EQ(word2, ""); - CHECK_EQ(word3, "baz"); - CHECK(!r.PartialMatch("f", &word1, &word2, &word3)); - - string a; - CHECK(RE("(foo)|hello").FullMatch("hello", &a)); - CHECK_EQ(a, ""); -} - -static void TestRecursion(int size, const char *pattern, int match_limit) { - printf("Testing recursion\n"); - - // Fill up a string repeating the pattern given - string domain; - domain.resize(size); - int patlen = strlen(pattern); - for (int i = 0; i < size; ++i) { - domain[i] = pattern[i % patlen]; - } - // Just make sure it doesn't crash due to too much recursion. - RE_Options options; - options.set_match_limit(match_limit); - RE re("([a-zA-Z0-9]|-)+(\\.([a-zA-Z0-9]|-)+)*(\\.)?", options); - re.FullMatch(domain); -} - -// -// Options tests contributed by -// Giuseppe Maxia, CTO, Stardata s.r.l. -// July 2005 -// -static void GetOneOptionResult( - const char *option_name, - const char *regex, - const char *str, - RE_Options options, - bool full, - string expected) { - - printf("Testing Option <%s>\n", option_name); - if(VERBOSE_TEST) - printf("/%s/ finds \"%s\" within \"%s\" \n", - regex, - expected.c_str(), - str); - string captured(""); - if (full) - RE(regex,options).FullMatch(str, &captured); - else - RE(regex,options).PartialMatch(str, &captured); - CHECK_EQ(captured, expected); -} - -static void TestOneOption( - const char *option_name, - const char *regex, - const char *str, - RE_Options options, - bool full, - bool assertive = true) { - - printf("Testing Option <%s>\n", option_name); - if (VERBOSE_TEST) - printf("'%s' %s /%s/ \n", - str, - (assertive? "matches" : "doesn't match"), - regex); - if (assertive) { - if (full) - CHECK(RE(regex,options).FullMatch(str)); - else - CHECK(RE(regex,options).PartialMatch(str)); - } else { - if (full) - CHECK(!RE(regex,options).FullMatch(str)); - else - CHECK(!RE(regex,options).PartialMatch(str)); - } -} - -static void Test_CASELESS() { - RE_Options options; - RE_Options options2; - - options.set_caseless(true); - TestOneOption("CASELESS (class)", "HELLO", "hello", options, false); - TestOneOption("CASELESS (class2)", "HELLO", "hello", options2.set_caseless(true), false); - TestOneOption("CASELESS (class)", "^[A-Z]+$", "Hello", options, false); - - TestOneOption("CASELESS (function)", "HELLO", "hello", pcrecpp::CASELESS(), false); - TestOneOption("CASELESS (function)", "^[A-Z]+$", "Hello", pcrecpp::CASELESS(), false); - options.set_caseless(false); - TestOneOption("no CASELESS", "HELLO", "hello", options, false, false); -} - -static void Test_MULTILINE() { - RE_Options options; - RE_Options options2; - const char *str = "HELLO\n" "cruel\n" "world\n"; - - options.set_multiline(true); - TestOneOption("MULTILINE (class)", "^cruel$", str, options, false); - TestOneOption("MULTILINE (class2)", "^cruel$", str, options2.set_multiline(true), false); - TestOneOption("MULTILINE (function)", "^cruel$", str, pcrecpp::MULTILINE(), false); - options.set_multiline(false); - TestOneOption("no MULTILINE", "^cruel$", str, options, false, false); -} - -static void Test_DOTALL() { - RE_Options options; - RE_Options options2; - const char *str = "HELLO\n" "cruel\n" "world"; - - options.set_dotall(true); - TestOneOption("DOTALL (class)", "HELLO.*world", str, options, true); - TestOneOption("DOTALL (class2)", "HELLO.*world", str, options2.set_dotall(true), true); - TestOneOption("DOTALL (function)", "HELLO.*world", str, pcrecpp::DOTALL(), true); - options.set_dotall(false); - TestOneOption("no DOTALL", "HELLO.*world", str, options, true, false); -} - -static void Test_DOLLAR_ENDONLY() { - RE_Options options; - RE_Options options2; - const char *str = "HELLO world\n"; - - TestOneOption("no DOLLAR_ENDONLY", "world$", str, options, false); - options.set_dollar_endonly(true); - TestOneOption("DOLLAR_ENDONLY 1", "world$", str, options, false, false); - TestOneOption("DOLLAR_ENDONLY 2", "world$", str, options2.set_dollar_endonly(true), false, false); -} - -static void Test_EXTRA() { - RE_Options options; - const char *str = "HELLO"; - - options.set_extra(true); - TestOneOption("EXTRA 1", "\\HELL\\O", str, options, true, false ); - TestOneOption("EXTRA 2", "\\HELL\\O", str, RE_Options().set_extra(true), true, false ); - options.set_extra(false); - TestOneOption("no EXTRA", "\\HELL\\O", str, options, true ); -} - -static void Test_EXTENDED() { - RE_Options options; - RE_Options options2; - const char *str = "HELLO world"; - - options.set_extended(true); - TestOneOption("EXTENDED (class)", "HELLO world", str, options, false, false); - TestOneOption("EXTENDED (class2)", "HELLO world", str, options2.set_extended(true), false, false); - TestOneOption("EXTENDED (class)", - "^ HE L{2} O " - "\\s+ " - "\\w+ $ ", - str, - options, - false); - - TestOneOption("EXTENDED (function)", "HELLO world", str, pcrecpp::EXTENDED(), false, false); - TestOneOption("EXTENDED (function)", - "^ HE L{2} O " - "\\s+ " - "\\w+ $ ", - str, - pcrecpp::EXTENDED(), - false); - - options.set_extended(false); - TestOneOption("no EXTENDED", "HELLO world", str, options, false); -} - -static void Test_NO_AUTO_CAPTURE() { - RE_Options options; - const char *str = "HELLO world"; - string captured; - - printf("Testing Option <no NO_AUTO_CAPTURE>\n"); - if (VERBOSE_TEST) - printf("parentheses capture text\n"); - RE re("(world|universe)$", options); - CHECK(re.Extract("\\1", str , &captured)); - CHECK_EQ(captured, "world"); - options.set_no_auto_capture(true); - printf("testing Option <NO_AUTO_CAPTURE>\n"); - if (VERBOSE_TEST) - printf("parentheses do not capture text\n"); - re.Extract("\\1",str, &captured ); - CHECK_EQ(captured, "world"); -} - -static void Test_UNGREEDY() { - RE_Options options; - const char *str = "HELLO, 'this' is the 'world'"; - - options.set_ungreedy(true); - GetOneOptionResult("UNGREEDY 1", "('.*')", str, options, false, "'this'" ); - GetOneOptionResult("UNGREEDY 2", "('.*')", str, RE_Options().set_ungreedy(true), false, "'this'" ); - GetOneOptionResult("UNGREEDY", "('.*?')", str, options, false, "'this' is the 'world'" ); - - options.set_ungreedy(false); - GetOneOptionResult("no UNGREEDY", "('.*')", str, options, false, "'this' is the 'world'" ); - GetOneOptionResult("no UNGREEDY", "('.*?')", str, options, false, "'this'" ); -} - -static void Test_all_options() { - const char *str = "HELLO\n" "cruel\n" "world"; - RE_Options options; - options.set_all_options(PCRE_CASELESS | PCRE_DOTALL); - - TestOneOption("all_options (CASELESS|DOTALL)", "^hello.*WORLD", str , options, false); - options.set_all_options(0); - TestOneOption("all_options (0)", "^hello.*WORLD", str , options, false, false); - options.set_all_options(PCRE_MULTILINE | PCRE_EXTENDED); - - TestOneOption("all_options (MULTILINE|EXTENDED)", " ^ c r u e l $ ", str, options, false); - TestOneOption("all_options (MULTILINE|EXTENDED) with constructor", - " ^ c r u e l $ ", - str, - RE_Options(PCRE_MULTILINE | PCRE_EXTENDED), - false); - - TestOneOption("all_options (MULTILINE|EXTENDED) with concatenation", - " ^ c r u e l $ ", - str, - RE_Options() - .set_multiline(true) - .set_extended(true), - false); - - options.set_all_options(0); - TestOneOption("all_options (0)", "^ c r u e l $", str, options, false, false); - -} - -static void TestOptions() { - printf("Testing Options\n"); - Test_CASELESS(); - Test_MULTILINE(); - Test_DOTALL(); - Test_DOLLAR_ENDONLY(); - Test_EXTENDED(); - Test_NO_AUTO_CAPTURE(); - Test_UNGREEDY(); - Test_EXTRA(); - Test_all_options(); -} - -int main(int argc, char** argv) { - // Treat any flag as --help - if (argc > 1 && argv[1][0] == '-') { - printf("Usage: %s [timing1|timing2|timing3 num-iters]\n" - " If 'timingX ###' is specified, run the given timing test\n" - " with the given number of iterations, rather than running\n" - " the default corectness test.\n", argv[0]); - return 0; - } - - if (argc > 1) { - if ( argc == 2 || atoi(argv[2]) == 0) { - printf("timing mode needs a num-iters argument\n"); - return 1; - } - if (!strcmp(argv[1], "timing1")) - Timing1(atoi(argv[2])); - else if (!strcmp(argv[1], "timing2")) - Timing2(atoi(argv[2])); - else if (!strcmp(argv[1], "timing3")) - Timing3(atoi(argv[2])); - else - printf("Unknown argument '%s'\n", argv[1]); - return 0; - } - - printf("Testing FullMatch\n"); - - int i; - string s; - - /***** FullMatch with no args *****/ - - CHECK(RE("h.*o").FullMatch("hello")); - CHECK(!RE("h.*o").FullMatch("othello")); - CHECK(!RE("h.*o").FullMatch("hello!")); - - /***** FullMatch with args *****/ - - // Zero-arg - CHECK(RE("\\d+").FullMatch("1001")); - - // Single-arg - CHECK(RE("(\\d+)").FullMatch("1001", &i)); - CHECK_EQ(i, 1001); - CHECK(RE("(-?\\d+)").FullMatch("-123", &i)); - CHECK_EQ(i, -123); - CHECK(!RE("()\\d+").FullMatch("10", &i)); - CHECK(!RE("(\\d+)").FullMatch("1234567890123456789012345678901234567890", - &i)); - - // Digits surrounding integer-arg - CHECK(RE("1(\\d*)4").FullMatch("1234", &i)); - CHECK_EQ(i, 23); - CHECK(RE("(\\d)\\d+").FullMatch("1234", &i)); - CHECK_EQ(i, 1); - CHECK(RE("(-\\d)\\d+").FullMatch("-1234", &i)); - CHECK_EQ(i, -1); - CHECK(RE("(\\d)").PartialMatch("1234", &i)); - CHECK_EQ(i, 1); - CHECK(RE("(-\\d)").PartialMatch("-1234", &i)); - CHECK_EQ(i, -1); - - // String-arg - CHECK(RE("h(.*)o").FullMatch("hello", &s)); - CHECK_EQ(s, string("ell")); - - // StringPiece-arg - StringPiece sp; - CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &sp, &i)); - CHECK_EQ(sp.size(), 4); - CHECK(memcmp(sp.data(), "ruby", 4) == 0); - CHECK_EQ(i, 1234); - - // Multi-arg - CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &s, &i)); - CHECK_EQ(s, string("ruby")); - CHECK_EQ(i, 1234); - - // Ignored arg - CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i)); - CHECK_EQ(s, string("ruby")); - CHECK_EQ(i, 1234); - - // Type tests - { - char c; - CHECK(RE("(H)ello").FullMatch("Hello", &c)); - CHECK_EQ(c, 'H'); - } - { - unsigned char c; - CHECK(RE("(H)ello").FullMatch("Hello", &c)); - CHECK_EQ(c, static_cast<unsigned char>('H')); - } - { - short v; - CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); - CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); - CHECK(RE("(-?\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); - CHECK(RE("(-?\\d+)").FullMatch("-32768", &v)); CHECK_EQ(v, -32768); - CHECK(!RE("(-?\\d+)").FullMatch("-32769", &v)); - CHECK(!RE("(-?\\d+)").FullMatch("32768", &v)); - } - { - unsigned short v; - CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); - CHECK(RE("(\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); - CHECK(RE("(\\d+)").FullMatch("65535", &v)); CHECK_EQ(v, 65535); - CHECK(!RE("(\\d+)").FullMatch("65536", &v)); - } - { - int v; - static const int max_value = 0x7fffffff; - static const int min_value = -max_value - 1; - CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); - CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); - CHECK(RE("(-?\\d+)").FullMatch("2147483647", &v)); CHECK_EQ(v, max_value); - CHECK(RE("(-?\\d+)").FullMatch("-2147483648", &v)); CHECK_EQ(v, min_value); - CHECK(!RE("(-?\\d+)").FullMatch("-2147483649", &v)); - CHECK(!RE("(-?\\d+)").FullMatch("2147483648", &v)); - } - { - unsigned int v; - static const unsigned int max_value = 0xfffffffful; - CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); - CHECK(RE("(\\d+)").FullMatch("4294967295", &v)); CHECK_EQ(v, max_value); - CHECK(!RE("(\\d+)").FullMatch("4294967296", &v)); - } -#ifdef HAVE_LONG_LONG - { - long long v; - static const long long max_value = 0x7fffffffffffffffLL; - static const long long min_value = -max_value - 1; - char buf[32]; - - CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); - CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100); - - snprintf(buf, sizeof(buf), "%lld", max_value); - CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); - - snprintf(buf, sizeof(buf), "%lld", min_value); - CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value); - - snprintf(buf, sizeof(buf), "%lld", max_value); - assert(buf[strlen(buf)-1] != '9'); - buf[strlen(buf)-1]++; - CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); - - snprintf(buf, sizeof(buf), "%lld", min_value); - assert(buf[strlen(buf)-1] != '9'); - buf[strlen(buf)-1]++; - CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); - } -#endif -#if defined HAVE_UNSIGNED_LONG_LONG && defined HAVE_LONG_LONG - { - unsigned long long v; - long long v2; - static const unsigned long long max_value = 0xffffffffffffffffULL; - char buf[32]; - - CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100); - CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100); - - snprintf(buf, sizeof(buf), "%llu", max_value); - CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); - - assert(buf[strlen(buf)-1] != '9'); - buf[strlen(buf)-1]++; - CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); - } -#endif - { - float v; - CHECK(RE("(.*)").FullMatch("100", &v)); - CHECK(RE("(.*)").FullMatch("-100.", &v)); - CHECK(RE("(.*)").FullMatch("1e23", &v)); - } - { - double v; - CHECK(RE("(.*)").FullMatch("100", &v)); - CHECK(RE("(.*)").FullMatch("-100.", &v)); - CHECK(RE("(.*)").FullMatch("1e23", &v)); - } - - // Check that matching is fully anchored - CHECK(!RE("(\\d+)").FullMatch("x1001", &i)); - CHECK(!RE("(\\d+)").FullMatch("1001x", &i)); - CHECK(RE("x(\\d+)").FullMatch("x1001", &i)); CHECK_EQ(i, 1001); - CHECK(RE("(\\d+)x").FullMatch("1001x", &i)); CHECK_EQ(i, 1001); - - // Braces - CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcd")); - CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcde")); - CHECK(!RE("[0-9a-f+.-]{5,}").FullMatch("0abc")); - - // Complicated RE - CHECK(RE("foo|bar|[A-Z]").FullMatch("foo")); - CHECK(RE("foo|bar|[A-Z]").FullMatch("bar")); - CHECK(RE("foo|bar|[A-Z]").FullMatch("X")); - CHECK(!RE("foo|bar|[A-Z]").FullMatch("XY")); - - // Check full-match handling (needs '$' tacked on internally) - CHECK(RE("fo|foo").FullMatch("fo")); - CHECK(RE("fo|foo").FullMatch("foo")); - CHECK(RE("fo|foo$").FullMatch("fo")); - CHECK(RE("fo|foo$").FullMatch("foo")); - CHECK(RE("foo$").FullMatch("foo")); - CHECK(!RE("foo\\$").FullMatch("foo$bar")); - CHECK(!RE("fo|bar").FullMatch("fox")); - - // Uncomment the following if we change the handling of '$' to - // prevent it from matching a trailing newline - if (false) { - // Check that we don't get bitten by pcre's special handling of a - // '\n' at the end of the string matching '$' - CHECK(!RE("foo$").PartialMatch("foo\n")); - } - - // Number of args - int a[16]; - CHECK(RE("").FullMatch("")); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d){1}").FullMatch("1", - &a[0])); - CHECK_EQ(a[0], 1); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)").FullMatch("12", - &a[0], &a[1])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)").FullMatch("123", - &a[0], &a[1], &a[2])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)(\\d)").FullMatch("1234", - &a[0], &a[1], &a[2], &a[3])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - CHECK_EQ(a[3], 4); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("12345", - &a[0], &a[1], &a[2], - &a[3], &a[4])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - CHECK_EQ(a[3], 4); - CHECK_EQ(a[4], 5); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("123456", - &a[0], &a[1], &a[2], - &a[3], &a[4], &a[5])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - CHECK_EQ(a[3], 4); - CHECK_EQ(a[4], 5); - CHECK_EQ(a[5], 6); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("1234567", - &a[0], &a[1], &a[2], &a[3], - &a[4], &a[5], &a[6])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - CHECK_EQ(a[3], 4); - CHECK_EQ(a[4], 5); - CHECK_EQ(a[5], 6); - CHECK_EQ(a[6], 7); - - memset(a, 0, sizeof(0)); - CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)" - "(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch( - "1234567890123456", - &a[0], &a[1], &a[2], &a[3], - &a[4], &a[5], &a[6], &a[7], - &a[8], &a[9], &a[10], &a[11], - &a[12], &a[13], &a[14], &a[15])); - CHECK_EQ(a[0], 1); - CHECK_EQ(a[1], 2); - CHECK_EQ(a[2], 3); - CHECK_EQ(a[3], 4); - CHECK_EQ(a[4], 5); - CHECK_EQ(a[5], 6); - CHECK_EQ(a[6], 7); - CHECK_EQ(a[7], 8); - CHECK_EQ(a[8], 9); - CHECK_EQ(a[9], 0); - CHECK_EQ(a[10], 1); - CHECK_EQ(a[11], 2); - CHECK_EQ(a[12], 3); - CHECK_EQ(a[13], 4); - CHECK_EQ(a[14], 5); - CHECK_EQ(a[15], 6); - - /***** PartialMatch *****/ - - printf("Testing PartialMatch\n"); - - CHECK(RE("h.*o").PartialMatch("hello")); - CHECK(RE("h.*o").PartialMatch("othello")); - CHECK(RE("h.*o").PartialMatch("hello!")); - CHECK(RE("((((((((((((((((((((x))))))))))))))))))))").PartialMatch("x")); - - RadixTests(); - TestReplace(); - TestExtract(); - TestConsume(); - TestFindAndConsume(); - TestMatchNumberPeculiarity(); - - // Check the pattern() accessor - { - const string kPattern = "http://([^/]+)/.*"; - const RE re(kPattern); - CHECK_EQ(kPattern, re.pattern()); - } - - // Check RE error field. - { - RE re("foo"); - CHECK(re.error().empty()); // Must have no error - } - -#ifdef SUPPORT_UTF8 - // Check UTF-8 handling - { - printf("Testing UTF-8 handling\n"); - - // Three Japanese characters (nihongo) - const char utf8_string[] = { - 0xe6, 0x97, 0xa5, // 65e5 - 0xe6, 0x9c, 0xac, // 627c - 0xe8, 0xaa, 0x9e, // 8a9e - 0 - }; - const char utf8_pattern[] = { - '.', - 0xe6, 0x9c, 0xac, // 627c - '.', - 0 - }; - - // Both should match in either mode, bytes or UTF-8 - RE re_test1("........."); - CHECK(re_test1.FullMatch(utf8_string)); - RE re_test2("...", pcrecpp::UTF8()); - CHECK(re_test2.FullMatch(utf8_string)); - - // Check that '.' matches one byte or UTF-8 character - // according to the mode. - string ss; - RE re_test3("(.)"); - CHECK(re_test3.PartialMatch(utf8_string, &ss)); - CHECK_EQ(ss, string("\xe6")); - RE re_test4("(.)", pcrecpp::UTF8()); - CHECK(re_test4.PartialMatch(utf8_string, &ss)); - CHECK_EQ(ss, string("\xe6\x97\xa5")); - - // Check that string matches itself in either mode - RE re_test5(utf8_string); - CHECK(re_test5.FullMatch(utf8_string)); - RE re_test6(utf8_string, pcrecpp::UTF8()); - CHECK(re_test6.FullMatch(utf8_string)); - - // Check that pattern matches string only in UTF8 mode - RE re_test7(utf8_pattern); - CHECK(!re_test7.FullMatch(utf8_string)); - RE re_test8(utf8_pattern, pcrecpp::UTF8()); - CHECK(re_test8.FullMatch(utf8_string)); - } - - // Check that ungreedy, UTF8 regular expressions don't match when they - // oughtn't -- see bug 82246. - { - // This code always worked. - const char* pattern = "\\w+X"; - const string target = "a aX"; - RE match_sentence(pattern); - RE match_sentence_re(pattern, pcrecpp::UTF8()); - - CHECK(!match_sentence.FullMatch(target)); - CHECK(!match_sentence_re.FullMatch(target)); - } - - { - const char* pattern = "(?U)\\w+X"; - const string target = "a aX"; - RE match_sentence(pattern); - RE match_sentence_re(pattern, pcrecpp::UTF8()); - - CHECK(!match_sentence.FullMatch(target)); - CHECK(!match_sentence_re.FullMatch(target)); - } -#endif /* def SUPPORT_UTF8 */ - - printf("Testing error reporting\n"); - - { RE re("a\\1"); CHECK(!re.error().empty()); } - { - RE re("a[x"); - CHECK(!re.error().empty()); - } - { - RE re("a[z-a]"); - CHECK(!re.error().empty()); - } - { - RE re("a[[:foobar:]]"); - CHECK(!re.error().empty()); - } - { - RE re("a(b"); - CHECK(!re.error().empty()); - } - { - RE re("a\\"); - CHECK(!re.error().empty()); - } - - // Test that recursion is stopped: there will be some errors reported - int matchlimit = 5000; - int bytes = 15 * 1024; // enough to crash if there was no match limit - TestRecursion(bytes, ".", matchlimit); - TestRecursion(bytes, "a", matchlimit); - TestRecursion(bytes, "a.", matchlimit); - TestRecursion(bytes, "ab.", matchlimit); - TestRecursion(bytes, "abc.", matchlimit); - - // Test Options - if (getenv("VERBOSE_TEST") != NULL) - VERBOSE_TEST = true; - TestOptions(); - - // Done - printf("OK\n"); - - return 0; -} diff --git a/ext/pcre/pcrelib/pcredemo.c b/ext/pcre/pcrelib/pcredemo.c deleted file mode 100644 index 3817203b5fda1..0000000000000 --- a/ext/pcre/pcrelib/pcredemo.c +++ /dev/null @@ -1,324 +0,0 @@ -/************************************************* -* PCRE DEMONSTRATION PROGRAM * -*************************************************/ - -/* This is a demonstration program to illustrate the most straightforward ways -of calling the PCRE regular expression library from a C program. See the -pcresample documentation for a short discussion. - -Compile thuswise: - gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \ - -R/usr/local/lib -lpcre - -Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and -library files for PCRE are installed on your system. Only some operating -systems (e.g. Solaris) use the -R option. -*/ - - -#include <stdio.h> -#include <string.h> -#include <pcre.h> - -#define OVECCOUNT 30 /* should be a multiple of 3 */ - - -int main(int argc, char **argv) -{ -pcre *re; -const char *error; -char *pattern; -char *subject; -unsigned char *name_table; -int erroffset; -int find_all; -int namecount; -int name_entry_size; -int ovector[OVECCOUNT]; -int subject_length; -int rc, i; - - -/************************************************************************** -* First, sort out the command line. There is only one possible option at * -* the moment, "-g" to request repeated matching to find all occurrences, * -* like Perl's /g option. We set the variable find_all to a non-zero value * -* if the -g option is present. Apart from that, there must be exactly two * -* arguments. * -**************************************************************************/ - -find_all = 0; -for (i = 1; i < argc; i++) - { - if (strcmp(argv[i], "-g") == 0) find_all = 1; - else break; - } - -/* After the options, we require exactly two arguments, which are the pattern, -and the subject string. */ - -if (argc - i != 2) - { - printf("Two arguments required: a regex and a subject string\n"); - return 1; - } - -pattern = argv[i]; -subject = argv[i+1]; -subject_length = (int)strlen(subject); - - -/************************************************************************* -* Now we are going to compile the regular expression pattern, and handle * -* and errors that are detected. * -*************************************************************************/ - -re = pcre_compile( - pattern, /* the pattern */ - 0, /* default options */ - &error, /* for error message */ - &erroffset, /* for error offset */ - NULL); /* use default character tables */ - -/* Compilation failed: print the error message and exit */ - -if (re == NULL) - { - printf("PCRE compilation failed at offset %d: %s\n", erroffset, error); - return 1; - } - - -/************************************************************************* -* If the compilation succeeded, we call PCRE again, in order to do a * -* pattern match against the subject string. This does just ONE match. If * -* further matching is needed, it will be done below. * -*************************************************************************/ - -rc = pcre_exec( - re, /* the compiled pattern */ - NULL, /* no extra data - we didn't study the pattern */ - subject, /* the subject string */ - subject_length, /* the length of the subject */ - 0, /* start at offset 0 in the subject */ - 0, /* default options */ - ovector, /* output vector for substring information */ - OVECCOUNT); /* number of elements in the output vector */ - -/* Matching failed: handle error cases */ - -if (rc < 0) - { - switch(rc) - { - case PCRE_ERROR_NOMATCH: printf("No match\n"); break; - /* - Handle other special cases if you like - */ - default: printf("Matching error %d\n", rc); break; - } - free(re); /* Release memory used for the compiled pattern */ - return 1; - } - -/* Match succeded */ - -printf("\nMatch succeeded at offset %d\n", ovector[0]); - - -/************************************************************************* -* We have found the first match within the subject string. If the output * -* vector wasn't big enough, set its size to the maximum. Then output any * -* substrings that were captured. * -*************************************************************************/ - -/* The output vector wasn't big enough */ - -if (rc == 0) - { - rc = OVECCOUNT/3; - printf("ovector only has room for %d captured substrings\n", rc - 1); - } - -/* Show substrings stored in the output vector by number. Obviously, in a real -application you might want to do things other than print them. */ - -for (i = 0; i < rc; i++) - { - char *substring_start = subject + ovector[2*i]; - int substring_length = ovector[2*i+1] - ovector[2*i]; - printf("%2d: %.*s\n", i, substring_length, substring_start); - } - - -/************************************************************************** -* That concludes the basic part of this demonstration program. We have * -* compiled a pattern, and performed a single match. The code that follows * -* first shows how to access named substrings, and then how to code for * -* repeated matches on the same subject. * -**************************************************************************/ - -/* See if there are any named substrings, and if so, show them by name. First -we have to extract the count of named parentheses from the pattern. */ - -(void)pcre_fullinfo( - re, /* the compiled pattern */ - NULL, /* no extra data - we didn't study the pattern */ - PCRE_INFO_NAMECOUNT, /* number of named substrings */ - &namecount); /* where to put the answer */ - -if (namecount <= 0) printf("No named substrings\n"); else - { - unsigned char *tabptr; - printf("Named substrings\n"); - - /* Before we can access the substrings, we must extract the table for - translating names to numbers, and the size of each entry in the table. */ - - (void)pcre_fullinfo( - re, /* the compiled pattern */ - NULL, /* no extra data - we didn't study the pattern */ - PCRE_INFO_NAMETABLE, /* address of the table */ - &name_table); /* where to put the answer */ - - (void)pcre_fullinfo( - re, /* the compiled pattern */ - NULL, /* no extra data - we didn't study the pattern */ - PCRE_INFO_NAMEENTRYSIZE, /* size of each entry in the table */ - &name_entry_size); /* where to put the answer */ - - /* Now we can scan the table and, for each entry, print the number, the name, - and the substring itself. */ - - tabptr = name_table; - for (i = 0; i < namecount; i++) - { - int n = (tabptr[0] << 8) | tabptr[1]; - printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, - ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); - tabptr += name_entry_size; - } - } - - -/************************************************************************* -* If the "-g" option was given on the command line, we want to continue * -* to search for additional matches in the subject string, in a similar * -* way to the /g option in Perl. This turns out to be trickier than you * -* might think because of the possibility of matching an empty string. * -* What happens is as follows: * -* * -* If the previous match was NOT for an empty string, we can just start * -* the next match at the end of the previous one. * -* * -* If the previous match WAS for an empty string, we can't do that, as it * -* would lead to an infinite loop. Instead, a special call of pcre_exec() * -* is made with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set. The first * -* of these tells PCRE that an empty string is not a valid match; other * -* possibilities must be tried. The second flag restricts PCRE to one * -* match attempt at the initial string position. If this match succeeds, * -* an alternative to the empty string match has been found, and we can * -* proceed round the loop. * -*************************************************************************/ - -if (!find_all) - { - free(re); /* Release the memory used for the compiled pattern */ - return 0; /* Finish unless -g was given */ - } - -/* Loop for second and subsequent matches */ - -for (;;) - { - int options = 0; /* Normally no options */ - int start_offset = ovector[1]; /* Start at end of previous match */ - - /* If the previous match was for an empty string, we are finished if we are - at the end of the subject. Otherwise, arrange to run another match at the - same point to see if a non-empty match can be found. */ - - if (ovector[0] == ovector[1]) - { - if (ovector[0] == subject_length) break; - options = PCRE_NOTEMPTY | PCRE_ANCHORED; - } - - /* Run the next matching operation */ - - rc = pcre_exec( - re, /* the compiled pattern */ - NULL, /* no extra data - we didn't study the pattern */ - subject, /* the subject string */ - subject_length, /* the length of the subject */ - start_offset, /* starting offset in the subject */ - options, /* options */ - ovector, /* output vector for substring information */ - OVECCOUNT); /* number of elements in the output vector */ - - /* This time, a result of NOMATCH isn't an error. If the value in "options" - is zero, it just means we have found all possible matches, so the loop ends. - Otherwise, it means we have failed to find a non-empty-string match at a - point where there was a previous empty-string match. In this case, we do what - Perl does: advance the matching position by one, and continue. We do this by - setting the "end of previous match" offset, because that is picked up at the - top of the loop as the point at which to start again. */ - - if (rc == PCRE_ERROR_NOMATCH) - { - if (options == 0) break; - ovector[1] = start_offset + 1; - continue; /* Go round the loop again */ - } - - /* Other matching errors are not recoverable. */ - - if (rc < 0) - { - printf("Matching error %d\n", rc); - free(re); /* Release memory used for the compiled pattern */ - return 1; - } - - /* Match succeded */ - - printf("\nMatch succeeded again at offset %d\n", ovector[0]); - - /* The match succeeded, but the output vector wasn't big enough. */ - - if (rc == 0) - { - rc = OVECCOUNT/3; - printf("ovector only has room for %d captured substrings\n", rc - 1); - } - - /* As before, show substrings stored in the output vector by number, and then - also any named substrings. */ - - for (i = 0; i < rc; i++) - { - char *substring_start = subject + ovector[2*i]; - int substring_length = ovector[2*i+1] - ovector[2*i]; - printf("%2d: %.*s\n", i, substring_length, substring_start); - } - - if (namecount <= 0) printf("No named substrings\n"); else - { - unsigned char *tabptr = name_table; - printf("Named substrings\n"); - for (i = 0; i < namecount; i++) - { - int n = (tabptr[0] << 8) | tabptr[1]; - printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, - ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); - tabptr += name_entry_size; - } - } - } /* End of loop to find second and subsequent matches */ - -printf("\n"); -free(re); /* Release memory used for the compiled pattern */ -return 0; -} - -/* End of pcredemo.c */ diff --git a/ext/pcre/pcrelib/pcregrep.c b/ext/pcre/pcrelib/pcregrep.c deleted file mode 100644 index f6e5180557e5c..0000000000000 --- a/ext/pcre/pcrelib/pcregrep.c +++ /dev/null @@ -1,1162 +0,0 @@ -/************************************************* -* pcregrep program * -*************************************************/ - -/* This is a grep program that uses the PCRE regular expression library to do -its pattern matching. On a Unix or Win32 system it can recurse into -directories. - - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - -#include <ctype.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <errno.h> - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -#include "config.h" -#include "pcre.h" - -#define FALSE 0 -#define TRUE 1 - -typedef int BOOL; - -#define VERSION "4.0 07-Jun-2005" -#define MAX_PATTERN_COUNT 100 - -#if BUFSIZ > 8192 -#define MBUFTHIRD BUFSIZ -#else -#define MBUFTHIRD 8192 -#endif - - - -/************************************************* -* Global variables * -*************************************************/ - -static char *pattern_filename = NULL; -static char *stdin_name = (char *)"(standard input)"; -static int pattern_count = 0; -static pcre **pattern_list; -static pcre_extra **hints_list; - -static char *include_pattern = NULL; -static char *exclude_pattern = NULL; - -static pcre *include_compiled = NULL; -static pcre *exclude_compiled = NULL; - -static int after_context = 0; -static int before_context = 0; -static int both_context = 0; - -static BOOL count_only = FALSE; -static BOOL filenames = TRUE; -static BOOL filenames_only = FALSE; -static BOOL filenames_nomatch_only = FALSE; -static BOOL hyphenpending = FALSE; -static BOOL invert = FALSE; -static BOOL multiline = FALSE; -static BOOL number = FALSE; -static BOOL quiet = FALSE; -static BOOL recurse = FALSE; -static BOOL silent = FALSE; -static BOOL whole_lines = FALSE; -static BOOL word_match = FALSE; - -/* Structure for options and list of them */ - -enum { OP_NODATA, OP_STRING, OP_NUMBER }; - -typedef struct option_item { - int type; - int one_char; - void *dataptr; - const char *long_name; - const char *help_text; -} option_item; - -static option_item optionlist[] = { - { OP_NODATA, -1, NULL, "", " terminate options" }, - { OP_NODATA, -1, NULL, "help", "display this help and exit" }, - { OP_NUMBER, 'A', &after_context, "after-context=number", "set number of following context lines" }, - { OP_NUMBER, 'B', &before_context, "before-context=number", "set number of prior context lines" }, - { OP_NUMBER, 'C', &both_context, "context=number", "set number of context lines, before & after" }, - { OP_NODATA, 'c', NULL, "count", "print only a count of matching lines per FILE" }, - { OP_STRING, 'f', &pattern_filename, "file=path", "read patterns from file" }, - { OP_NODATA, 'h', NULL, "no-filename", "suppress the prefixing filename on output" }, - { OP_NODATA, 'i', NULL, "ignore-case", "ignore case distinctions" }, - { OP_NODATA, 'l', NULL, "files-with-matches", "print only FILE names containing matches" }, - { OP_NODATA, 'L', NULL, "files-without-match","print only FILE names not containing matches" }, - { OP_STRING, -1, &stdin_name, "label=name", "set name for standard input" }, - { OP_NODATA, 'M', NULL, "multiline", "run in multiline mode" }, - { OP_NODATA, 'n', NULL, "line-number", "print line number with output lines" }, - { OP_NODATA, 'q', NULL, "quiet", "suppress output, just set return code" }, - { OP_NODATA, 'r', NULL, "recursive", "recursively scan sub-directories" }, - { OP_STRING, -1, &exclude_pattern, "exclude=pattern","exclude matching files when recursing" }, - { OP_STRING, -1, &include_pattern, "include=pattern","include matching files when recursing" }, - { OP_NODATA, 's', NULL, "no-messages", "suppress error messages" }, - { OP_NODATA, 'u', NULL, "utf-8", "use UTF-8 mode" }, - { OP_NODATA, 'V', NULL, "version", "print version information and exit" }, - { OP_NODATA, 'v', NULL, "invert-match", "select non-matching lines" }, - { OP_NODATA, 'w', NULL, "word-regex(p)", "force PATTERN to match only as a word" }, - { OP_NODATA, 'x', NULL, "line-regex(p)", "force PATTERN to match only whole lines" }, - { OP_NODATA, 0, NULL, NULL, NULL } -}; - - -/************************************************* -* Functions for directory scanning * -*************************************************/ - -/* These functions are defined so that they can be made system specific, -although at present the only ones are for Unix, Win32, and for "no directory -recursion support". */ - - -/************* Directory scanning in Unix ***********/ - -#if IS_UNIX -#include <sys/types.h> -#include <sys/stat.h> -#include <dirent.h> - -typedef DIR directory_type; - -static int -isdirectory(char *filename) -{ -struct stat statbuf; -if (stat(filename, &statbuf) < 0) - return 0; /* In the expectation that opening as a file will fail */ -return ((statbuf.st_mode & S_IFMT) == S_IFDIR)? '/' : 0; -} - -static directory_type * -opendirectory(char *filename) -{ -return opendir(filename); -} - -static char * -readdirectory(directory_type *dir) -{ -for (;;) - { - struct dirent *dent = readdir(dir); - if (dent == NULL) return NULL; - if (strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0) - return dent->d_name; - } -return NULL; /* Keep compiler happy; never executed */ -} - -static void -closedirectory(directory_type *dir) -{ -closedir(dir); -} - - -/************* Directory scanning in Win32 ***********/ - -/* I (Philip Hazel) have no means of testing this code. It was contributed by -Lionel Fourquaux. David Burgess added a patch to define INVALID_FILE_ATTRIBUTES -when it did not exist. */ - - -#elif HAVE_WIN32API - -#ifndef STRICT -# define STRICT -#endif -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif -#ifndef INVALID_FILE_ATTRIBUTES -#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF -#endif - -#include <windows.h> - -typedef struct directory_type -{ -HANDLE handle; -BOOL first; -WIN32_FIND_DATA data; -} directory_type; - -int -isdirectory(char *filename) -{ -DWORD attr = GetFileAttributes(filename); -if (attr == INVALID_FILE_ATTRIBUTES) - return 0; -return ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) ? '/' : 0; -} - -directory_type * -opendirectory(char *filename) -{ -size_t len; -char *pattern; -directory_type *dir; -DWORD err; -len = strlen(filename); -pattern = (char *) malloc(len + 3); -dir = (directory_type *) malloc(sizeof(*dir)); -if ((pattern == NULL) || (dir == NULL)) - { - fprintf(stderr, "pcregrep: malloc failed\n"); - exit(2); - } -memcpy(pattern, filename, len); -memcpy(&(pattern[len]), "\\*", 3); -dir->handle = FindFirstFile(pattern, &(dir->data)); -if (dir->handle != INVALID_HANDLE_VALUE) - { - free(pattern); - dir->first = TRUE; - return dir; - } -err = GetLastError(); -free(pattern); -free(dir); -errno = (err == ERROR_ACCESS_DENIED) ? EACCES : ENOENT; -return NULL; -} - -char * -readdirectory(directory_type *dir) -{ -for (;;) - { - if (!dir->first) - { - if (!FindNextFile(dir->handle, &(dir->data))) - return NULL; - } - else - { - dir->first = FALSE; - } - if (strcmp(dir->data.cFileName, ".") != 0 && strcmp(dir->data.cFileName, "..") != 0) - return dir->data.cFileName; - } -#ifndef _MSC_VER -return NULL; /* Keep compiler happy; never executed */ -#endif -} - -void -closedirectory(directory_type *dir) -{ -FindClose(dir->handle); -free(dir); -} - - -/************* Directory scanning when we can't do it ***********/ - -/* The type is void, and apart from isdirectory(), the functions do nothing. */ - -#else - -typedef void directory_type; - -int isdirectory(char *filename) { return FALSE; } -directory_type * opendirectory(char *filename) {} -char *readdirectory(directory_type *dir) {} -void closedirectory(directory_type *dir) {} - -#endif - - - -#if ! HAVE_STRERROR -/************************************************* -* Provide strerror() for non-ANSI libraries * -*************************************************/ - -/* Some old-fashioned systems still around (e.g. SunOS4) don't have strerror() -in their libraries, but can provide the same facility by this simple -alternative function. */ - -extern int sys_nerr; -extern char *sys_errlist[]; - -char * -strerror(int n) -{ -if (n < 0 || n >= sys_nerr) return "unknown error number"; -return sys_errlist[n]; -} -#endif /* HAVE_STRERROR */ - - - -/************************************************* -* Print the previous "after" lines * -*************************************************/ - -/* This is called if we are about to lose said lines because of buffer filling, -and at the end of the file. - -Arguments: - lastmatchnumber the number of the last matching line, plus one - lastmatchrestart where we restarted after the last match - endptr end of available data - printname filename for printing - -Returns: nothing -*/ - -static void do_after_lines(int lastmatchnumber, char *lastmatchrestart, - char *endptr, char *printname) -{ -if (after_context > 0 && lastmatchnumber > 0) - { - int count = 0; - while (lastmatchrestart < endptr && count++ < after_context) - { - char *pp = lastmatchrestart; - if (printname != NULL) fprintf(stdout, "%s-", printname); - if (number) fprintf(stdout, "%d-", lastmatchnumber++); - while (*pp != '\n') pp++; - fprintf(stdout, "%.*s", pp - lastmatchrestart + 1, lastmatchrestart); - lastmatchrestart = pp + 1; - } - hyphenpending = TRUE; - } -} - - - -/************************************************* -* Grep an individual file * -*************************************************/ - -/* This is called from grep_or_recurse() below. It uses a buffer that is three -times the value of MBUFTHIRD. The matching point is never allowed to stray into -the top third of the buffer, thus keeping more of the file available for -context printing or for multiline scanning. For large files, the pointer will -be in the middle third most of the time, so the bottom third is available for -"before" context printing. - -Arguments: - in the fopened FILE stream - printname the file name if it is to be printed for each match - or NULL if the file name is not to be printed - it cannot be NULL if filenames[_nomatch]_only is set - -Returns: 0 if there was at least one match - 1 otherwise (no matches) -*/ - -static int -pcregrep(FILE *in, char *printname) -{ -int rc = 1; -int linenumber = 1; -int lastmatchnumber = 0; -int count = 0; -int offsets[99]; -char *lastmatchrestart = NULL; -char buffer[3*MBUFTHIRD]; -char *ptr = buffer; -char *endptr; -size_t bufflength; -BOOL endhyphenpending = FALSE; - -/* Do the first read into the start of the buffer and set up the pointer to -end of what we have. */ - -bufflength = fread(buffer, 1, 3*MBUFTHIRD, in); -endptr = buffer + bufflength; - -/* Loop while the current pointer is not at the end of the file. For large -files, endptr will be at the end of the buffer when we are in the middle of the -file, but ptr will never get there, because as soon as it gets over 2/3 of the -way, the buffer is shifted left and re-filled. */ - -while (ptr < endptr) - { - int i; - BOOL match = FALSE; - char *t = ptr; - size_t length, linelength; - - /* At this point, ptr is at the start of a line. We need to find the length - of the subject string to pass to pcre_exec(). In multiline mode, it is the - length remainder of the data in the buffer. Otherwise, it is the length of - the next line. After matching, we always advance by the length of the next - line. In multiline mode the PCRE_FIRSTLINE option is used for compiling, so - that any match is constrained to be in the first line. */ - - linelength = 0; - while (t < endptr && *t++ != '\n') linelength++; - length = multiline? endptr - ptr : linelength; - - /* Run through all the patterns until one matches. Note that we don't include - the final newline in the subject string. */ - - for (i = 0; !match && i < pattern_count; i++) - { - match = pcre_exec(pattern_list[i], hints_list[i], ptr, length, 0, 0, - offsets, 99) >= 0; - } - - /* If it's a match or a not-match (as required), print what's wanted. */ - - if (match != invert) - { - BOOL hyphenprinted = FALSE; - - if (filenames_nomatch_only) return 1; - - if (count_only) count++; - - else if (filenames_only) - { - fprintf(stdout, "%s\n", printname); - return 0; - } - - else if (quiet) return 0; - - else - { - /* See if there is a requirement to print some "after" lines from a - previous match. We never print any overlaps. */ - - if (after_context > 0 && lastmatchnumber > 0) - { - int linecount = 0; - char *p = lastmatchrestart; - - while (p < ptr && linecount < after_context) - { - while (*p != '\n') p++; - p++; - linecount++; - } - - /* It is important to advance lastmatchrestart during this printing so - that it interacts correctly with any "before" printing below. */ - - while (lastmatchrestart < p) - { - char *pp = lastmatchrestart; - if (printname != NULL) fprintf(stdout, "%s-", printname); - if (number) fprintf(stdout, "%d-", lastmatchnumber++); - while (*pp != '\n') pp++; - fprintf(stdout, "%.*s", pp - lastmatchrestart + 1, lastmatchrestart); - lastmatchrestart = pp + 1; - } - if (lastmatchrestart != ptr) hyphenpending = TRUE; - } - - /* If there were non-contiguous lines printed above, insert hyphens. */ - - if (hyphenpending) - { - fprintf(stdout, "--\n"); - hyphenpending = FALSE; - hyphenprinted = TRUE; - } - - /* See if there is a requirement to print some "before" lines for this - match. Again, don't print overlaps. */ - - if (before_context > 0) - { - int linecount = 0; - char *p = ptr; - - while (p > buffer && (lastmatchnumber == 0 || p > lastmatchrestart) && - linecount++ < before_context) - { - p--; - while (p > buffer && p[-1] != '\n') p--; - } - - if (lastmatchnumber > 0 && p > lastmatchrestart && !hyphenprinted) - fprintf(stdout, "--\n"); - - while (p < ptr) - { - char *pp = p; - if (printname != NULL) fprintf(stdout, "%s-", printname); - if (number) fprintf(stdout, "%d-", linenumber - linecount--); - while (*pp != '\n') pp++; - fprintf(stdout, "%.*s", pp - p + 1, p); - p = pp + 1; - } - } - - /* Now print the matching line(s); ensure we set hyphenpending at the end - of the file. */ - - endhyphenpending = TRUE; - if (printname != NULL) fprintf(stdout, "%s:", printname); - if (number) fprintf(stdout, "%d:", linenumber); - - /* In multiline mode, we want to print to the end of the line in which - the end of the matched string is found, so we adjust linelength and the - line number appropriately. Because the PCRE_FIRSTLINE option is set, the - start of the match will always be before the first \n character. */ - - if (multiline) - { - char *endmatch = ptr + offsets[1]; - t = ptr; - while (t < endmatch) { if (*t++ == '\n') linenumber++; } - while (endmatch < endptr && *endmatch != '\n') endmatch++; - linelength = endmatch - ptr; - } - - fprintf(stdout, "%.*s\n", linelength, ptr); - } - - rc = 0; /* Had some success */ - - /* Remember where the last match happened for after_context. We remember - where we are about to restart, and that line's number. */ - - lastmatchrestart = ptr + linelength + 1; - lastmatchnumber = linenumber + 1; - } - - /* Advance to after the newline and increment the line number. */ - - ptr += linelength + 1; - linenumber++; - - /* If we haven't yet reached the end of the file (the buffer is full), and - the current point is in the top 1/3 of the buffer, slide the buffer down by - 1/3 and refill it. Before we do this, if some unprinted "after" lines are - about to be lost, print them. */ - - if (bufflength >= sizeof(buffer) && ptr > buffer + 2*MBUFTHIRD) - { - if (after_context > 0 && - lastmatchnumber > 0 && - lastmatchrestart < buffer + MBUFTHIRD) - { - do_after_lines(lastmatchnumber, lastmatchrestart, endptr, printname); - lastmatchnumber = 0; - } - - /* Now do the shuffle */ - - memmove(buffer, buffer + MBUFTHIRD, 2*MBUFTHIRD); - ptr -= MBUFTHIRD; - bufflength = 2*MBUFTHIRD + fread(buffer + 2*MBUFTHIRD, 1, MBUFTHIRD, in); - endptr = buffer + bufflength; - - /* Adjust any last match point */ - - if (lastmatchnumber > 0) lastmatchrestart -= MBUFTHIRD; - } - } /* Loop through the whole file */ - -/* End of file; print final "after" lines if wanted; do_after_lines sets -hyphenpending if it prints something. */ - -do_after_lines(lastmatchnumber, lastmatchrestart, endptr, printname); -hyphenpending |= endhyphenpending; - -/* Print the file name if we are looking for those without matches and there -were none. If we found a match, we won't have got this far. */ - -if (filenames_nomatch_only) - { - fprintf(stdout, "%s\n", printname); - return 0; - } - -/* Print the match count if wanted */ - -if (count_only) - { - if (printname != NULL) fprintf(stdout, "%s:", printname); - fprintf(stdout, "%d\n", count); - } - -return rc; -} - - - -/************************************************* -* Grep a file or recurse into a directory * -*************************************************/ - -/* Given a path name, if it's a directory, scan all the files if we are -recursing; if it's a file, grep it. - -Arguments: - pathname the path to investigate - dir_recurse TRUE if recursing is wanted (-r) - show_filenames TRUE if file names are wanted for multiple files, except - for the only file at top level when not filenames_only - only_one_at_top TRUE if the path is the only one at toplevel - -Returns: 0 if there was at least one match - 1 if there were no matches - 2 there was some kind of error - -However, file opening failures are suppressed if "silent" is set. -*/ - -static int -grep_or_recurse(char *pathname, BOOL dir_recurse, BOOL show_filenames, - BOOL only_one_at_top) -{ -int rc = 1; -int sep; -FILE *in; -char *printname; - -/* If the file name is "-" we scan stdin */ - -if (strcmp(pathname, "-") == 0) - { - return pcregrep(stdin, - (filenames_only || filenames_nomatch_only || - (show_filenames && !only_one_at_top))? - stdin_name : NULL); - } - -/* If the file is a directory and we are recursing, scan each file within it, -subject to any include or exclude patterns that were set. The scanning code is -localized so it can be made system-specific. */ - -if ((sep = isdirectory(pathname)) != 0 && dir_recurse) - { - char buffer[1024]; - char *nextfile; - directory_type *dir = opendirectory(pathname); - - if (dir == NULL) - { - if (!silent) - fprintf(stderr, "pcregrep: Failed to open directory %s: %s\n", pathname, - strerror(errno)); - return 2; - } - - while ((nextfile = readdirectory(dir)) != NULL) - { - int frc, blen; - sprintf(buffer, "%.512s%c%.128s", pathname, sep, nextfile); - blen = strlen(buffer); - - if (exclude_compiled != NULL && - pcre_exec(exclude_compiled, NULL, buffer, blen, 0, 0, NULL, 0) >= 0) - continue; - - if (include_compiled != NULL && - pcre_exec(include_compiled, NULL, buffer, blen, 0, 0, NULL, 0) < 0) - continue; - - frc = grep_or_recurse(buffer, dir_recurse, TRUE, FALSE); - if (frc > 1) rc = frc; - else if (frc == 0 && rc == 1) rc = 0; - } - - closedirectory(dir); - return rc; - } - -/* If the file is not a directory, or we are not recursing, scan it. If this is -the first and only argument at top level, we don't show the file name (unless -we are only showing the file name). Otherwise, control is via the -show_filenames variable. */ - -in = fopen(pathname, "r"); -if (in == NULL) - { - if (!silent) - fprintf(stderr, "pcregrep: Failed to open %s: %s\n", pathname, - strerror(errno)); - return 2; - } - -printname = (filenames_only || filenames_nomatch_only || - (show_filenames && !only_one_at_top))? pathname : NULL; - -rc = pcregrep(in, printname); - -fclose(in); -return rc; -} - - - - -/************************************************* -* Usage function * -*************************************************/ - -static int -usage(int rc) -{ -fprintf(stderr, "Usage: pcregrep [-LMVcfhilnqrsvwx] [long-options] [pattern] [file1 file2 ...]\n"); -fprintf(stderr, "Type `pcregrep --help' for more information.\n"); -return rc; -} - - - - -/************************************************* -* Help function * -*************************************************/ - -static void -help(void) -{ -option_item *op; - -printf("Usage: pcregrep [OPTION]... [PATTERN] [FILE1 FILE2 ...]\n"); -printf("Search for PATTERN in each FILE or standard input.\n"); -printf("PATTERN must be present if -f is not used.\n"); -printf("\"-\" can be used as a file name to mean STDIN.\n"); -printf("Example: pcregrep -i 'hello.*world' menu.h main.c\n\n"); - -printf("Options:\n"); - -for (op = optionlist; op->one_char != 0; op++) - { - int n; - char s[4]; - if (op->one_char > 0) sprintf(s, "-%c,", op->one_char); else strcpy(s, " "); - printf(" %s --%s%n", s, op->long_name, &n); - n = 30 - n; - if (n < 1) n = 1; - printf("%.*s%s\n", n, " ", op->help_text); - } - -printf("\nWhen reading patterns from a file instead of using a command line option,\n"); -printf("trailing white space is removed and blank lines are ignored.\n"); -printf("There is a maximum of %d patterns.\n", MAX_PATTERN_COUNT); - -printf("\nWith no FILEs, read standard input. If fewer than two FILEs given, assume -h.\n"); -printf("Exit status is 0 if any matches, 1 if no matches, and 2 if trouble.\n"); -} - - - - -/************************************************* -* Handle a single-letter, no data option * -*************************************************/ - -static int -handle_option(int letter, int options) -{ -switch(letter) - { - case -1: help(); exit(0); - case 'c': count_only = TRUE; break; - case 'h': filenames = FALSE; break; - case 'i': options |= PCRE_CASELESS; break; - case 'l': filenames_only = TRUE; break; - case 'L': filenames_nomatch_only = TRUE; break; - case 'M': multiline = TRUE; options |= PCRE_MULTILINE|PCRE_FIRSTLINE; break; - case 'n': number = TRUE; break; - case 'q': quiet = TRUE; break; - case 'r': recurse = TRUE; break; - case 's': silent = TRUE; break; - case 'u': options |= PCRE_UTF8; break; - case 'v': invert = TRUE; break; - case 'w': word_match = TRUE; break; - case 'x': whole_lines = TRUE; break; - - case 'V': - fprintf(stderr, "pcregrep version %s using ", VERSION); - fprintf(stderr, "PCRE version %s\n", pcre_version()); - exit(0); - break; - - default: - fprintf(stderr, "pcregrep: Unknown option -%c\n", letter); - exit(usage(2)); - } - -return options; -} - - - - -/************************************************* -* Main program * -*************************************************/ - -/* Returns 0 if something matched, 1 if nothing matched, 2 after an error. */ - -int -main(int argc, char **argv) -{ -int i, j; -int rc = 1; -int options = 0; -int errptr; -const char *error; -BOOL only_one_at_top; - -/* Process the options */ - -for (i = 1; i < argc; i++) - { - option_item *op = NULL; - char *option_data = (char *)""; /* default to keep compiler happy */ - BOOL longop; - BOOL longopwasequals = FALSE; - - if (argv[i][0] != '-') break; - - /* If we hit an argument that is just "-", it may be a reference to STDIN, - but only if we have previously had -f to define the patterns. */ - - if (argv[i][1] == 0) - { - if (pattern_filename != NULL) break; - else exit(usage(2)); - } - - /* Handle a long name option, or -- to terminate the options */ - - if (argv[i][1] == '-') - { - char *arg = argv[i] + 2; - char *argequals = strchr(arg, '='); - - if (*arg == 0) /* -- terminates options */ - { - i++; - break; /* out of the options-handling loop */ - } - - longop = TRUE; - - /* Some long options have data that follows after =, for example file=name. - Some options have variations in the long name spelling: specifically, we - allow "regexp" because GNU grep allows it, though I personally go along - with Jeff Friedl in preferring "regex" without the "p". These options are - entered in the table as "regex(p)". No option is in both these categories, - fortunately. */ - - for (op = optionlist; op->one_char != 0; op++) - { - char *opbra = strchr(op->long_name, '('); - char *equals = strchr(op->long_name, '='); - if (opbra == NULL) /* Not a (p) case */ - { - if (equals == NULL) /* Not thing=data case */ - { - if (strcmp(arg, op->long_name) == 0) break; - } - else /* Special case xxx=data */ - { - int oplen = equals - op->long_name; - int arglen = (argequals == NULL)? strlen(arg) : argequals - arg; - if (oplen == arglen && strncmp(arg, op->long_name, oplen) == 0) - { - option_data = arg + arglen; - if (*option_data == '=') - { - option_data++; - longopwasequals = TRUE; - } - break; - } - } - } - else /* Special case xxxx(p) */ - { - char buff1[24]; - char buff2[24]; - int baselen = opbra - op->long_name; - sprintf(buff1, "%.*s", baselen, op->long_name); - sprintf(buff2, "%s%.*s", buff1, strlen(op->long_name) - baselen - 2, - opbra + 1); - if (strcmp(arg, buff1) == 0 || strcmp(arg, buff2) == 0) - break; - } - } - - if (op->one_char == 0) - { - fprintf(stderr, "pcregrep: Unknown option %s\n", argv[i]); - exit(usage(2)); - } - } - - /* One-char options; many that have no data may be in a single argument; we - continue till we hit the last one or one that needs data. */ - - else - { - char *s = argv[i] + 1; - longop = FALSE; - while (*s != 0) - { - for (op = optionlist; op->one_char != 0; op++) - { if (*s == op->one_char) break; } - if (op->one_char == 0) - { - fprintf(stderr, "pcregrep: Unknown option letter '%c' in \"%s\"\n", - *s, argv[i]); - exit(usage(2)); - } - if (op->type != OP_NODATA || s[1] == 0) - { - option_data = s+1; - break; - } - options = handle_option(*s++, options); - } - } - - /* At this point we should have op pointing to a matched option */ - - if (op->type == OP_NODATA) - options = handle_option(op->one_char, options); - else - { - if (*option_data == 0) - { - if (i >= argc - 1 || longopwasequals) - { - fprintf(stderr, "pcregrep: Data missing after %s\n", argv[i]); - exit(usage(2)); - } - option_data = argv[++i]; - } - - if (op->type == OP_STRING) *((char **)op->dataptr) = option_data; else - { - char *endptr; - int n = strtoul(option_data, &endptr, 10); - if (*endptr != 0) - { - if (longop) - fprintf(stderr, "pcregrep: Malformed number \"%s\" after --%s\n", - option_data, op->long_name); - else - fprintf(stderr, "pcregrep: Malformed number \"%s\" after -%c\n", - option_data, op->one_char); - exit(usage(2)); - } - *((int *)op->dataptr) = n; - } - } - } - -/* Options have been decoded. If -C was used, its value is used as a default -for -A and -B. */ - -if (both_context > 0) - { - if (after_context == 0) after_context = both_context; - if (before_context == 0) before_context = both_context; - } - -pattern_list = (pcre **)malloc(MAX_PATTERN_COUNT * sizeof(pcre *)); -hints_list = (pcre_extra **)malloc(MAX_PATTERN_COUNT * sizeof(pcre_extra *)); - -if (pattern_list == NULL || hints_list == NULL) - { - fprintf(stderr, "pcregrep: malloc failed\n"); - return 2; - } - -/* Compile the regular expression(s). */ - -if (pattern_filename != NULL) - { - FILE *f = fopen(pattern_filename, "r"); - char buffer[MBUFTHIRD + 16]; - char *rdstart; - int adjust = 0; - - if (f == NULL) - { - fprintf(stderr, "pcregrep: Failed to open %s: %s\n", pattern_filename, - strerror(errno)); - return 2; - } - - if (whole_lines) - { - strcpy(buffer, "^(?:"); - adjust = 4; - } - else if (word_match) - { - strcpy(buffer, "\\b"); - adjust = 2; - } - - rdstart = buffer + adjust; - while (fgets(rdstart, MBUFTHIRD, f) != NULL) - { - char *s = rdstart + (int)strlen(rdstart); - if (pattern_count >= MAX_PATTERN_COUNT) - { - fprintf(stderr, "pcregrep: Too many patterns in file (max %d)\n", - MAX_PATTERN_COUNT); - return 2; - } - while (s > rdstart && isspace((unsigned char)(s[-1]))) s--; - if (s == rdstart) continue; - if (whole_lines) strcpy(s, ")$"); - else if (word_match)strcpy(s, "\\b"); - else *s = 0; - pattern_list[pattern_count] = pcre_compile(buffer, options, &error, - &errptr, NULL); - if (pattern_list[pattern_count++] == NULL) - { - fprintf(stderr, "pcregrep: Error in regex number %d at offset %d: %s\n", - pattern_count, errptr - adjust, error); - return 2; - } - } - fclose(f); - } - -/* If no file name, a single regex must be given inline. */ - -else - { - char buffer[MBUFTHIRD + 16]; - char *pat; - int adjust = 0; - - if (i >= argc) return usage(2); - - if (whole_lines) - { - sprintf(buffer, "^(?:%.*s)$", MBUFTHIRD, argv[i++]); - pat = buffer; - adjust = 4; - } - else if (word_match) - { - sprintf(buffer, "\\b%.*s\\b", MBUFTHIRD, argv[i++]); - pat = buffer; - adjust = 2; - } - else pat = argv[i++]; - - pattern_list[0] = pcre_compile(pat, options, &error, &errptr, NULL); - - if (pattern_list[0] == NULL) - { - fprintf(stderr, "pcregrep: Error in regex at offset %d: %s\n", - errptr - adjust, error); - return 2; - } - pattern_count++; - } - -/* Study the regular expressions, as we will be running them many times */ - -for (j = 0; j < pattern_count; j++) - { - hints_list[j] = pcre_study(pattern_list[j], 0, &error); - if (error != NULL) - { - char s[16]; - if (pattern_count == 1) s[0] = 0; else sprintf(s, " number %d", j); - fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); - return 2; - } - } - -/* If there are include or exclude patterns, compile them. */ - -if (exclude_pattern != NULL) - { - exclude_compiled = pcre_compile(exclude_pattern, 0, &error, &errptr, NULL); - if (exclude_compiled == NULL) - { - fprintf(stderr, "pcregrep: Error in 'exclude' regex at offset %d: %s\n", - errptr, error); - return 2; - } - } - -if (include_pattern != NULL) - { - include_compiled = pcre_compile(include_pattern, 0, &error, &errptr, NULL); - if (include_compiled == NULL) - { - fprintf(stderr, "pcregrep: Error in 'include' regex at offset %d: %s\n", - errptr, error); - return 2; - } - } - -/* If there are no further arguments, do the business on stdin and exit */ - -if (i >= argc) return pcregrep(stdin, - (filenames_only || filenames_nomatch_only)? stdin_name : NULL); - -/* Otherwise, work through the remaining arguments as files or directories. -Pass in the fact that there is only one argument at top level - this suppresses -the file name if the argument is not a directory and filenames_only is not set. -*/ - -only_one_at_top = (i == argc - 1); - -for (; i < argc; i++) - { - int frc = grep_or_recurse(argv[i], recurse, filenames, only_one_at_top); - if (frc > 1) rc = frc; - else if (frc == 0 && rc == 1) rc = 0; - } - -return rc; -} - -/* End of pcregrep */ diff --git a/ext/pcre/pcrelib/pcreposix.c b/ext/pcre/pcrelib/pcreposix.c deleted file mode 100644 index 06fd58bcbf552..0000000000000 --- a/ext/pcre/pcrelib/pcreposix.c +++ /dev/null @@ -1,294 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -/* This module is a wrapper that provides a POSIX API to the underlying PCRE -functions. */ - - -#include "pcre_internal.h" -#include "pcreposix.h" -#include "stdlib.h" - - - -/* Table to translate PCRE compile time error codes into POSIX error codes. */ - -static const int eint[] = { - 0, /* no error */ - REG_EESCAPE, /* \ at end of pattern */ - REG_EESCAPE, /* \c at end of pattern */ - REG_EESCAPE, /* unrecognized character follows \ */ - REG_BADBR, /* numbers out of order in {} quantifier */ - REG_BADBR, /* number too big in {} quantifier */ - REG_EBRACK, /* missing terminating ] for character class */ - REG_ECTYPE, /* invalid escape sequence in character class */ - REG_ERANGE, /* range out of order in character class */ - REG_BADRPT, /* nothing to repeat */ - REG_BADRPT, /* operand of unlimited repeat could match the empty string */ - REG_ASSERT, /* internal error: unexpected repeat */ - REG_BADPAT, /* unrecognized character after (? */ - REG_BADPAT, /* POSIX named classes are supported only within a class */ - REG_EPAREN, /* missing ) */ - REG_ESUBREG, /* reference to non-existent subpattern */ - REG_INVARG, /* erroffset passed as NULL */ - REG_INVARG, /* unknown option bit(s) set */ - REG_EPAREN, /* missing ) after comment */ - REG_ESIZE, /* parentheses nested too deeply */ - REG_ESIZE, /* regular expression too large */ - REG_ESPACE, /* failed to get memory */ - REG_EPAREN, /* unmatched brackets */ - REG_ASSERT, /* internal error: code overflow */ - REG_BADPAT, /* unrecognized character after (?< */ - REG_BADPAT, /* lookbehind assertion is not fixed length */ - REG_BADPAT, /* malformed number after (?( */ - REG_BADPAT, /* conditional group containe more than two branches */ - REG_BADPAT, /* assertion expected after (?( */ - REG_BADPAT, /* (?R or (?digits must be followed by ) */ - REG_ECTYPE, /* unknown POSIX class name */ - REG_BADPAT, /* POSIX collating elements are not supported */ - REG_INVARG, /* this version of PCRE is not compiled with PCRE_UTF8 support */ - REG_BADPAT, /* spare error */ - REG_BADPAT, /* character value in \x{...} sequence is too large */ - REG_BADPAT, /* invalid condition (?(0) */ - REG_BADPAT, /* \C not allowed in lookbehind assertion */ - REG_EESCAPE, /* PCRE does not support \L, \l, \N, \U, or \u */ - REG_BADPAT, /* number after (?C is > 255 */ - REG_BADPAT, /* closing ) for (?C expected */ - REG_BADPAT, /* recursive call could loop indefinitely */ - REG_BADPAT, /* unrecognized character after (?P */ - REG_BADPAT, /* syntax error after (?P */ - REG_BADPAT, /* two named groups have the same name */ - REG_BADPAT, /* invalid UTF-8 string */ - REG_BADPAT, /* support for \P, \p, and \X has not been compiled */ - REG_BADPAT, /* malformed \P or \p sequence */ - REG_BADPAT /* unknown property name after \P or \p */ -}; - -/* Table of texts corresponding to POSIX error codes */ - -static const char *const pstring[] = { - "", /* Dummy for value 0 */ - "internal error", /* REG_ASSERT */ - "invalid repeat counts in {}", /* BADBR */ - "pattern error", /* BADPAT */ - "? * + invalid", /* BADRPT */ - "unbalanced {}", /* EBRACE */ - "unbalanced []", /* EBRACK */ - "collation error - not relevant", /* ECOLLATE */ - "bad class", /* ECTYPE */ - "bad escape sequence", /* EESCAPE */ - "empty expression", /* EMPTY */ - "unbalanced ()", /* EPAREN */ - "bad range inside []", /* ERANGE */ - "expression too big", /* ESIZE */ - "failed to get memory", /* ESPACE */ - "bad back reference", /* ESUBREG */ - "bad argument", /* INVARG */ - "match failed" /* NOMATCH */ -}; - - - - -/************************************************* -* Translate error code to string * -*************************************************/ - -EXPORT size_t -regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) -{ -const char *message, *addmessage; -size_t length, addlength; - -message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))? - "unknown error code" : pstring[errcode]; -length = strlen(message) + 1; - -addmessage = " at offset "; -addlength = (preg != NULL && (int)preg->re_erroffset != -1)? - strlen(addmessage) + 6 : 0; - -if (errbuf_size > 0) - { - if (addlength > 0 && errbuf_size >= length + addlength) - sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset); - else - { - strncpy(errbuf, message, errbuf_size - 1); - errbuf[errbuf_size-1] = 0; - } - } - -return length + addlength; -} - - - - -/************************************************* -* Free store held by a regex * -*************************************************/ - -EXPORT void -regfree(regex_t *preg) -{ -(pcre_free)(preg->re_pcre); -} - - - - -/************************************************* -* Compile a regular expression * -*************************************************/ - -/* -Arguments: - preg points to a structure for recording the compiled expression - pattern the pattern to compile - cflags compilation flags - -Returns: 0 on success - various non-zero codes on failure -*/ - -EXPORT int -regcomp(regex_t *preg, const char *pattern, int cflags) -{ -const char *errorptr; -int erroffset; -int errorcode; -int options = 0; - -if ((cflags & REG_ICASE) != 0) options |= PCRE_CASELESS; -if ((cflags & REG_NEWLINE) != 0) options |= PCRE_MULTILINE; -if ((cflags & REG_DOTALL) != 0) options |= PCRE_DOTALL; - -preg->re_pcre = pcre_compile2(pattern, options, &errorcode, &errorptr, - &erroffset, NULL); -preg->re_erroffset = erroffset; - -if (preg->re_pcre == NULL) return eint[errorcode]; - -preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); -return 0; -} - - - - -/************************************************* -* Match a regular expression * -*************************************************/ - -/* Unfortunately, PCRE requires 3 ints of working space for each captured -substring, so we have to get and release working store instead of just using -the POSIX structures as was done in earlier releases when PCRE needed only 2 -ints. However, if the number of possible capturing brackets is small, use a -block of store on the stack, to reduce the use of malloc/free. The threshold is -in a macro that can be changed at configure time. */ - -EXPORT int -regexec(const regex_t *preg, const char *string, size_t nmatch, - regmatch_t pmatch[], int eflags) -{ -int rc; -int options = 0; -int *ovector = NULL; -int small_ovector[POSIX_MALLOC_THRESHOLD * 3]; -BOOL allocated_ovector = FALSE; - -if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL; -if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL; - -((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */ - -if (nmatch > 0) - { - if (nmatch <= POSIX_MALLOC_THRESHOLD) - { - ovector = &(small_ovector[0]); - } - else - { - ovector = (int *)malloc(sizeof(int) * nmatch * 3); - if (ovector == NULL) return REG_ESPACE; - allocated_ovector = TRUE; - } - } - -rc = pcre_exec((const pcre *)preg->re_pcre, NULL, string, (int)strlen(string), - 0, options, ovector, nmatch * 3); - -if (rc == 0) rc = nmatch; /* All captured slots were filled in */ - -if (rc >= 0) - { - size_t i; - for (i = 0; i < (size_t)rc; i++) - { - pmatch[i].rm_so = ovector[i*2]; - pmatch[i].rm_eo = ovector[i*2+1]; - } - if (allocated_ovector) free(ovector); - for (; i < nmatch; i++) pmatch[i].rm_so = pmatch[i].rm_eo = -1; - return 0; - } - -else - { - if (allocated_ovector) free(ovector); - switch(rc) - { - case PCRE_ERROR_NOMATCH: return REG_NOMATCH; - case PCRE_ERROR_NULL: return REG_INVARG; - case PCRE_ERROR_BADOPTION: return REG_INVARG; - case PCRE_ERROR_BADMAGIC: return REG_INVARG; - case PCRE_ERROR_UNKNOWN_NODE: return REG_ASSERT; - case PCRE_ERROR_NOMEMORY: return REG_ESPACE; - case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE; - case PCRE_ERROR_BADUTF8: return REG_INVARG; - case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG; - default: return REG_ASSERT; - } - } -} - -/* End of pcreposix.c */ diff --git a/ext/pcre/pcrelib/pcreposix.h b/ext/pcre/pcrelib/pcreposix.h deleted file mode 100644 index 4f1b1abd4515d..0000000000000 --- a/ext/pcre/pcrelib/pcreposix.h +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -#ifndef _PCREPOSIX_H -#define _PCREPOSIX_H - -/* This is the header for the POSIX wrapper interface to the PCRE Perl- -Compatible Regular Expression library. It defines the things POSIX says should -be there. I hope. - - Copyright (c) 1997-2005 University of Cambridge - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - -/* Have to include stdlib.h in order to ensure that size_t is defined. */ - -#include <stdlib.h> - -/* Allow for C++ users */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Options defined by POSIX. */ - -#define REG_ICASE 0x01 -#define REG_NEWLINE 0x02 -#define REG_NOTBOL 0x04 -#define REG_NOTEOL 0x08 - -/* Additional options, not defined by POSIX, but somebody wanted them. */ - -#define REG_DOTALL 0x10 - -/* These are not used by PCRE, but by defining them we make it easier -to slot PCRE into existing programs that make POSIX calls. */ - -#define REG_EXTENDED 0 -#define REG_NOSUB 0 - -/* Error values. Not all these are relevant or used by the wrapper. */ - -enum { - REG_ASSERT = 1, /* internal error ? */ - REG_BADBR, /* invalid repeat counts in {} */ - REG_BADPAT, /* pattern error */ - REG_BADRPT, /* ? * + invalid */ - REG_EBRACE, /* unbalanced {} */ - REG_EBRACK, /* unbalanced [] */ - REG_ECOLLATE, /* collation error - not relevant */ - REG_ECTYPE, /* bad class */ - REG_EESCAPE, /* bad escape sequence */ - REG_EMPTY, /* empty expression */ - REG_EPAREN, /* unbalanced () */ - REG_ERANGE, /* bad range inside [] */ - REG_ESIZE, /* expression too big */ - REG_ESPACE, /* failed to get memory */ - REG_ESUBREG, /* bad back reference */ - REG_INVARG, /* bad argument */ - REG_NOMATCH /* match failed */ -}; - - -/* The structure representing a compiled regular expression. */ - -typedef struct { - void *re_pcre; - size_t re_nsub; - size_t re_erroffset; -} regex_t; - -/* The structure in which a captured offset is returned. */ - -typedef int regoff_t; - -typedef struct { - regoff_t rm_so; - regoff_t rm_eo; -} regmatch_t; - -/* The functions */ - -extern int regcomp(regex_t *, const char *, int); -extern int regexec(const regex_t *, const char *, size_t, regmatch_t *, int); -extern size_t regerror(int, const regex_t *, char *, size_t); -extern void regfree(regex_t *); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* End of pcreposix.h */ diff --git a/ext/pcre/pcrelib/pcretest.c b/ext/pcre/pcrelib/pcretest.c deleted file mode 100644 index 9b63470863883..0000000000000 --- a/ext/pcre/pcrelib/pcretest.c +++ /dev/null @@ -1,1841 +0,0 @@ -/************************************************* -* PCRE testing program * -*************************************************/ - -/* This program was hacked up as a tester for PCRE. I really should have -written it more tidily in the first place. Will I ever learn? It has grown and -been extended and consequently is now rather, er, *very* untidy in places. - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -#include <ctype.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <time.h> -#include <locale.h> -#include <errno.h> - -#define PCRE_SPY /* For Win32 build, import data, not export */ - -/* We need the internal info for displaying the results of pcre_study() and -other internal data; pcretest also uses some of the fixed tables, and generally -has "inside information" compared to a program that strictly follows the PCRE -API. */ - -#include "pcre_internal.h" - - -/* It is possible to compile this test program without including support for -testing the POSIX interface, though this is not available via the standard -Makefile. */ - -#if !defined NOPOSIX -#include "pcreposix.h" -#endif - -/* It is also possible, for the benefit of the version imported into Exim, to -build pcretest without support for UTF8 (define NOUTF8), without the interface -to the DFA matcher (NODFA), and without the doublecheck of the old "info" -function (define NOINFOCHECK). */ - - -#ifndef CLOCKS_PER_SEC -#ifdef CLK_TCK -#define CLOCKS_PER_SEC CLK_TCK -#else -#define CLOCKS_PER_SEC 100 -#endif -#endif - -#define LOOPREPEAT 500000 - -#define BUFFER_SIZE 30000 -#define PBUFFER_SIZE BUFFER_SIZE -#define DBUFFER_SIZE BUFFER_SIZE - - -static FILE *outfile; -static int log_store = 0; -static int callout_count; -static int callout_extra; -static int callout_fail_count; -static int callout_fail_id; -static int first_callout; -static int show_malloc; -static int use_utf8; -static size_t gotten_store; - -static uschar *pbuffer = NULL; - - - -/************************************************* -* Read number from string * -*************************************************/ - -/* We don't use strtoul() because SunOS4 doesn't have it. Rather than mess -around with conditional compilation, just do the job by hand. It is only used -for unpicking the -o argument, so just keep it simple. - -Arguments: - str string to be converted - endptr where to put the end pointer - -Returns: the unsigned long -*/ - -static int -get_value(unsigned char *str, unsigned char **endptr) -{ -int result = 0; -while(*str != 0 && isspace(*str)) str++; -while (isdigit(*str)) result = result * 10 + (int)(*str++ - '0'); -*endptr = str; -return(result); -} - - - - -/************************************************* -* Convert UTF-8 string to value * -*************************************************/ - -/* This function takes one or more bytes that represents a UTF-8 character, -and returns the value of the character. - -Argument: - buffer a pointer to the byte vector - vptr a pointer to an int to receive the value - -Returns: > 0 => the number of bytes consumed - -6 to 0 => malformed UTF-8 character at offset = (-return) -*/ - -#if !defined NOUTF8 - -static int -utf82ord(unsigned char *buffer, int *vptr) -{ -int c = *buffer++; -int d = c; -int i, j, s; - -for (i = -1; i < 6; i++) /* i is number of additional bytes */ - { - if ((d & 0x80) == 0) break; - d <<= 1; - } - -if (i == -1) { *vptr = c; return 1; } /* ascii character */ -if (i == 0 || i == 6) return 0; /* invalid UTF-8 */ - -/* i now has a value in the range 1-5 */ - -s = 6*i; -d = (c & _pcre_utf8_table3[i]) << s; - -for (j = 0; j < i; j++) - { - c = *buffer++; - if ((c & 0xc0) != 0x80) return -(j+1); - s -= 6; - d |= (c & 0x3f) << s; - } - -/* Check that encoding was the correct unique one */ - -for (j = 0; j < _pcre_utf8_table1_size; j++) - if (d <= _pcre_utf8_table1[j]) break; -if (j != i) return -(i+1); - -/* Valid value */ - -*vptr = d; -return i+1; -} - -#endif - - - -/************************************************* -* Print character string * -*************************************************/ - -/* Character string printing function. Must handle UTF-8 strings in utf8 -mode. Yields number of characters printed. If handed a NULL file, just counts -chars without printing. */ - -static int pchars(unsigned char *p, int length, FILE *f) -{ -int c; -int yield = 0; - -while (length-- > 0) - { -#if !defined NOUTF8 - if (use_utf8) - { - int rc = utf82ord(p, &c); - - if (rc > 0 && rc <= length + 1) /* Mustn't run over the end */ - { - length -= rc - 1; - p += rc; - if (c < 256 && isprint(c)) - { - if (f != NULL) fprintf(f, "%c", c); - yield++; - } - else - { - int n; - if (f != NULL) fprintf(f, "\\x{%02x}%n", c, &n); - yield += n; - } - continue; - } - } -#endif - - /* Not UTF-8, or malformed UTF-8 */ - - if (isprint(c = *(p++))) - { - if (f != NULL) fprintf(f, "%c", c); - yield++; - } - else - { - if (f != NULL) fprintf(f, "\\x%02x", c); - yield += 4; - } - } - -return yield; -} - - - -/************************************************* -* Callout function * -*************************************************/ - -/* Called from PCRE as a result of the (?C) item. We print out where we are in -the match. Yield zero unless more callouts than the fail count, or the callout -data is not zero. */ - -static int callout(pcre_callout_block *cb) -{ -FILE *f = (first_callout | callout_extra)? outfile : NULL; -int i, pre_start, post_start, subject_length; - -if (callout_extra) - { - fprintf(f, "Callout %d: last capture = %d\n", - cb->callout_number, cb->capture_last); - - for (i = 0; i < cb->capture_top * 2; i += 2) - { - if (cb->offset_vector[i] < 0) - fprintf(f, "%2d: <unset>\n", i/2); - else - { - fprintf(f, "%2d: ", i/2); - (void)pchars((unsigned char *)cb->subject + cb->offset_vector[i], - cb->offset_vector[i+1] - cb->offset_vector[i], f); - fprintf(f, "\n"); - } - } - } - -/* Re-print the subject in canonical form, the first time or if giving full -datails. On subsequent calls in the same match, we use pchars just to find the -printed lengths of the substrings. */ - -if (f != NULL) fprintf(f, "--->"); - -pre_start = pchars((unsigned char *)cb->subject, cb->start_match, f); -post_start = pchars((unsigned char *)(cb->subject + cb->start_match), - cb->current_position - cb->start_match, f); - -subject_length = pchars((unsigned char *)cb->subject, cb->subject_length, NULL); - -(void)pchars((unsigned char *)(cb->subject + cb->current_position), - cb->subject_length - cb->current_position, f); - -if (f != NULL) fprintf(f, "\n"); - -/* Always print appropriate indicators, with callout number if not already -shown. For automatic callouts, show the pattern offset. */ - -if (cb->callout_number == 255) - { - fprintf(outfile, "%+3d ", cb->pattern_position); - if (cb->pattern_position > 99) fprintf(outfile, "\n "); - } -else - { - if (callout_extra) fprintf(outfile, " "); - else fprintf(outfile, "%3d ", cb->callout_number); - } - -for (i = 0; i < pre_start; i++) fprintf(outfile, " "); -fprintf(outfile, "^"); - -if (post_start > 0) - { - for (i = 0; i < post_start - 1; i++) fprintf(outfile, " "); - fprintf(outfile, "^"); - } - -for (i = 0; i < subject_length - pre_start - post_start + 4; i++) - fprintf(outfile, " "); - -fprintf(outfile, "%.*s", (cb->next_item_length == 0)? 1 : cb->next_item_length, - pbuffer + cb->pattern_position); - -fprintf(outfile, "\n"); -first_callout = 0; - -if (cb->callout_data != NULL) - { - int callout_data = *((int *)(cb->callout_data)); - if (callout_data != 0) - { - fprintf(outfile, "Callout data = %d\n", callout_data); - return callout_data; - } - } - -return (cb->callout_number != callout_fail_id)? 0 : - (++callout_count >= callout_fail_count)? 1 : 0; -} - - -/************************************************* -* Local malloc functions * -*************************************************/ - -/* Alternative malloc function, to test functionality and show the size of the -compiled re. */ - -static void *new_malloc(size_t size) -{ -void *block = malloc(size); -gotten_store = size; -if (show_malloc) - fprintf(outfile, "malloc %3d %p\n", (int)size, block); -return block; -} - -static void new_free(void *block) -{ -if (show_malloc) - fprintf(outfile, "free %p\n", block); -free(block); -} - - -/* For recursion malloc/free, to test stacking calls */ - -static void *stack_malloc(size_t size) -{ -void *block = malloc(size); -if (show_malloc) - fprintf(outfile, "stack_malloc %3d %p\n", (int)size, block); -return block; -} - -static void stack_free(void *block) -{ -if (show_malloc) - fprintf(outfile, "stack_free %p\n", block); -free(block); -} - - -/************************************************* -* Call pcre_fullinfo() * -*************************************************/ - -/* Get one piece of information from the pcre_fullinfo() function */ - -static void new_info(pcre *re, pcre_extra *study, int option, void *ptr) -{ -int rc; -if ((rc = pcre_fullinfo(re, study, option, ptr)) < 0) - fprintf(outfile, "Error %d from pcre_fullinfo(%d)\n", rc, option); -} - - - -/************************************************* -* Byte flipping function * -*************************************************/ - -static long int -byteflip(long int value, int n) -{ -if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); -return ((value & 0x000000ff) << 24) | - ((value & 0x0000ff00) << 8) | - ((value & 0x00ff0000) >> 8) | - ((value & 0xff000000) >> 24); -} - - - - -/************************************************* -* Main Program * -*************************************************/ - -/* Read lines from named file or stdin and write to named file or stdout; lines -consist of a regular expression, in delimiters and optionally followed by -options, followed by a set of test data, terminated by an empty line. */ - -int main(int argc, char **argv) -{ -FILE *infile = stdin; -int options = 0; -int study_options = 0; -int op = 1; -int timeit = 0; -int showinfo = 0; -int showstore = 0; -int size_offsets = 45; -int size_offsets_max; -int *offsets = NULL; -#if !defined NOPOSIX -int posix = 0; -#endif -int debug = 0; -int done = 0; -int all_use_dfa = 0; -int yield = 0; - -unsigned char *buffer; -unsigned char *dbuffer; - -/* Get buffers from malloc() so that Electric Fence will check their misuse -when I am debugging. */ - -buffer = (unsigned char *)malloc(BUFFER_SIZE); -dbuffer = (unsigned char *)malloc(DBUFFER_SIZE); -pbuffer = (unsigned char *)malloc(PBUFFER_SIZE); - -/* The outfile variable is static so that new_malloc can use it. The _setmode() -stuff is some magic that I don't understand, but which apparently does good -things in Windows. It's related to line terminations. */ - -#if defined(_WIN32) || defined(WIN32) -_setmode( _fileno( stdout ), 0x8000 ); -#endif /* defined(_WIN32) || defined(WIN32) */ - -outfile = stdout; - -/* Scan options */ - -while (argc > 1 && argv[op][0] == '-') - { - unsigned char *endptr; - - if (strcmp(argv[op], "-s") == 0 || strcmp(argv[op], "-m") == 0) - showstore = 1; - else if (strcmp(argv[op], "-t") == 0) timeit = 1; - else if (strcmp(argv[op], "-i") == 0) showinfo = 1; - else if (strcmp(argv[op], "-d") == 0) showinfo = debug = 1; -#if !defined NODFA - else if (strcmp(argv[op], "-dfa") == 0) all_use_dfa = 1; -#endif - else if (strcmp(argv[op], "-o") == 0 && argc > 2 && - ((size_offsets = get_value((unsigned char *)argv[op+1], &endptr)), - *endptr == 0)) - { - op++; - argc--; - } -#if !defined NOPOSIX - else if (strcmp(argv[op], "-p") == 0) posix = 1; -#endif - else if (strcmp(argv[op], "-C") == 0) - { - int rc; - printf("PCRE version %s\n", pcre_version()); - printf("Compiled with\n"); - (void)pcre_config(PCRE_CONFIG_UTF8, &rc); - printf(" %sUTF-8 support\n", rc? "" : "No "); - (void)pcre_config(PCRE_CONFIG_UNICODE_PROPERTIES, &rc); - printf(" %sUnicode properties support\n", rc? "" : "No "); - (void)pcre_config(PCRE_CONFIG_NEWLINE, &rc); - printf(" Newline character is %s\n", (rc == '\r')? "CR" : "LF"); - (void)pcre_config(PCRE_CONFIG_LINK_SIZE, &rc); - printf(" Internal link size = %d\n", rc); - (void)pcre_config(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc); - printf(" POSIX malloc threshold = %d\n", rc); - (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT, &rc); - printf(" Default match limit = %d\n", rc); - (void)pcre_config(PCRE_CONFIG_STACKRECURSE, &rc); - printf(" Match recursion uses %s\n", rc? "stack" : "heap"); - exit(0); - } - else - { - printf("** Unknown or malformed option %s\n", argv[op]); - printf("Usage: pcretest [-d] [-i] [-o <n>] [-p] [-s] [-t] [<input> [<output>]]\n"); - printf(" -C show PCRE compile-time options and exit\n"); - printf(" -d debug: show compiled code; implies -i\n"); -#if !defined NODFA - printf(" -dfa force DFA matching for all subjects\n"); -#endif - printf(" -i show information about compiled pattern\n" - " -m output memory used information\n" - " -o <n> set size of offsets vector to <n>\n"); -#if !defined NOPOSIX - printf(" -p use POSIX interface\n"); -#endif - printf(" -s output store (memory) used information\n" - " -t time compilation and execution\n"); - yield = 1; - goto EXIT; - } - op++; - argc--; - } - -/* Get the store for the offsets vector, and remember what it was */ - -size_offsets_max = size_offsets; -offsets = (int *)malloc(size_offsets_max * sizeof(int)); -if (offsets == NULL) - { - printf("** Failed to get %d bytes of memory for offsets vector\n", - size_offsets_max * sizeof(int)); - yield = 1; - goto EXIT; - } - -/* Sort out the input and output files */ - -if (argc > 1) - { - infile = fopen(argv[op], "rb"); - if (infile == NULL) - { - printf("** Failed to open %s\n", argv[op]); - yield = 1; - goto EXIT; - } - } - -if (argc > 2) - { - outfile = fopen(argv[op+1], "wb"); - if (outfile == NULL) - { - printf("** Failed to open %s\n", argv[op+1]); - yield = 1; - goto EXIT; - } - } - -/* Set alternative malloc function */ - -pcre_malloc = new_malloc; -pcre_free = new_free; -pcre_stack_malloc = stack_malloc; -pcre_stack_free = stack_free; - -/* Heading line, then prompt for first regex if stdin */ - -fprintf(outfile, "PCRE version %s\n\n", pcre_version()); - -/* Main loop */ - -while (!done) - { - pcre *re = NULL; - pcre_extra *extra = NULL; - -#if !defined NOPOSIX /* There are still compilers that require no indent */ - regex_t preg; - int do_posix = 0; -#endif - - const char *error; - unsigned char *p, *pp, *ppp; - unsigned char *to_file = NULL; - const unsigned char *tables = NULL; - unsigned long int true_size, true_study_size = 0; - size_t size, regex_gotten_store; - int do_study = 0; - int do_debug = debug; - int do_G = 0; - int do_g = 0; - int do_showinfo = showinfo; - int do_showrest = 0; - int do_flip = 0; - int erroroffset, len, delimiter; - - use_utf8 = 0; - - if (infile == stdin) printf(" re> "); - if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) break; - if (infile != stdin) fprintf(outfile, "%s", (char *)buffer); - fflush(outfile); - - p = buffer; - while (isspace(*p)) p++; - if (*p == 0) continue; - - /* See if the pattern is to be loaded pre-compiled from a file. */ - - if (*p == '<' && strchr((char *)(p+1), '<') == NULL) - { - unsigned long int magic; - uschar sbuf[8]; - FILE *f; - - p++; - pp = p + (int)strlen((char *)p); - while (isspace(pp[-1])) pp--; - *pp = 0; - - f = fopen((char *)p, "rb"); - if (f == NULL) - { - fprintf(outfile, "Failed to open %s: %s\n", p, strerror(errno)); - continue; - } - - if (fread(sbuf, 1, 8, f) != 8) goto FAIL_READ; - - true_size = - (sbuf[0] << 24) | (sbuf[1] << 16) | (sbuf[2] << 8) | sbuf[3]; - true_study_size = - (sbuf[4] << 24) | (sbuf[5] << 16) | (sbuf[6] << 8) | sbuf[7]; - - re = (real_pcre *)new_malloc(true_size); - regex_gotten_store = gotten_store; - - if (fread(re, 1, true_size, f) != true_size) goto FAIL_READ; - - magic = ((real_pcre *)re)->magic_number; - if (magic != MAGIC_NUMBER) - { - if (byteflip(magic, sizeof(magic)) == MAGIC_NUMBER) - { - do_flip = 1; - } - else - { - fprintf(outfile, "Data in %s is not a compiled PCRE regex\n", p); - fclose(f); - continue; - } - } - - fprintf(outfile, "Compiled regex%s loaded from %s\n", - do_flip? " (byte-inverted)" : "", p); - - /* Need to know if UTF-8 for printing data strings */ - - new_info(re, NULL, PCRE_INFO_OPTIONS, &options); - use_utf8 = (options & PCRE_UTF8) != 0; - - /* Now see if there is any following study data */ - - if (true_study_size != 0) - { - pcre_study_data *psd; - - extra = (pcre_extra *)new_malloc(sizeof(pcre_extra) + true_study_size); - extra->flags = PCRE_EXTRA_STUDY_DATA; - - psd = (pcre_study_data *)(((char *)extra) + sizeof(pcre_extra)); - extra->study_data = psd; - - if (fread(psd, 1, true_study_size, f) != true_study_size) - { - FAIL_READ: - fprintf(outfile, "Failed to read data from %s\n", p); - if (extra != NULL) new_free(extra); - if (re != NULL) new_free(re); - fclose(f); - continue; - } - fprintf(outfile, "Study data loaded from %s\n", p); - do_study = 1; /* To get the data output if requested */ - } - else fprintf(outfile, "No study data\n"); - - fclose(f); - goto SHOW_INFO; - } - - /* In-line pattern (the usual case). Get the delimiter and seek the end of - the pattern; if is isn't complete, read more. */ - - delimiter = *p++; - - if (isalnum(delimiter) || delimiter == '\\') - { - fprintf(outfile, "** Delimiter must not be alphameric or \\\n"); - goto SKIP_DATA; - } - - pp = p; - - for(;;) - { - while (*pp != 0) - { - if (*pp == '\\' && pp[1] != 0) pp++; - else if (*pp == delimiter) break; - pp++; - } - if (*pp != 0) break; - - len = BUFFER_SIZE - (pp - buffer); - if (len < 256) - { - fprintf(outfile, "** Expression too long - missing delimiter?\n"); - goto SKIP_DATA; - } - - if (infile == stdin) printf(" > "); - if (fgets((char *)pp, len, infile) == NULL) - { - fprintf(outfile, "** Unexpected EOF\n"); - done = 1; - goto CONTINUE; - } - if (infile != stdin) fprintf(outfile, "%s", (char *)pp); - } - - /* If the first character after the delimiter is backslash, make - the pattern end with backslash. This is purely to provide a way - of testing for the error message when a pattern ends with backslash. */ - - if (pp[1] == '\\') *pp++ = '\\'; - - /* Terminate the pattern at the delimiter, and save a copy of the pattern - for callouts. */ - - *pp++ = 0; - strcpy((char *)pbuffer, (char *)p); - - /* Look for options after final delimiter */ - - options = 0; - study_options = 0; - log_store = showstore; /* default from command line */ - - while (*pp != 0) - { - switch (*pp++) - { - case 'f': options |= PCRE_FIRSTLINE; break; - case 'g': do_g = 1; break; - case 'i': options |= PCRE_CASELESS; break; - case 'm': options |= PCRE_MULTILINE; break; - case 's': options |= PCRE_DOTALL; break; - case 'x': options |= PCRE_EXTENDED; break; - - case '+': do_showrest = 1; break; - case 'A': options |= PCRE_ANCHORED; break; - case 'C': options |= PCRE_AUTO_CALLOUT; break; - case 'D': do_debug = do_showinfo = 1; break; - case 'E': options |= PCRE_DOLLAR_ENDONLY; break; - case 'F': do_flip = 1; break; - case 'G': do_G = 1; break; - case 'I': do_showinfo = 1; break; - case 'M': log_store = 1; break; - case 'N': options |= PCRE_NO_AUTO_CAPTURE; break; - -#if !defined NOPOSIX - case 'P': do_posix = 1; break; -#endif - - case 'S': do_study = 1; break; - case 'U': options |= PCRE_UNGREEDY; break; - case 'X': options |= PCRE_EXTRA; break; - case '8': options |= PCRE_UTF8; use_utf8 = 1; break; - case '?': options |= PCRE_NO_UTF8_CHECK; break; - - case 'L': - ppp = pp; - /* The '\r' test here is so that it works on Windows */ - while (*ppp != '\n' && *ppp != '\r' && *ppp != ' ') ppp++; - *ppp = 0; - if (setlocale(LC_CTYPE, (const char *)pp) == NULL) - { - fprintf(outfile, "** Failed to set locale \"%s\"\n", pp); - goto SKIP_DATA; - } - tables = pcre_maketables(); - pp = ppp; - break; - - case '>': - to_file = pp; - while (*pp != 0) pp++; - while (isspace(pp[-1])) pp--; - *pp = 0; - break; - - case '\r': /* So that it works in Windows */ - case '\n': - case ' ': - break; - - default: - fprintf(outfile, "** Unknown option '%c'\n", pp[-1]); - goto SKIP_DATA; - } - } - - /* Handle compiling via the POSIX interface, which doesn't support the - timing, showing, or debugging options, nor the ability to pass over - local character tables. */ - -#if !defined NOPOSIX - if (posix || do_posix) - { - int rc; - int cflags = 0; - - if ((options & PCRE_CASELESS) != 0) cflags |= REG_ICASE; - if ((options & PCRE_MULTILINE) != 0) cflags |= REG_NEWLINE; - if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL; - rc = regcomp(&preg, (char *)p, cflags); - - /* Compilation failed; go back for another re, skipping to blank line - if non-interactive. */ - - if (rc != 0) - { - (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE); - fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, buffer); - goto SKIP_DATA; - } - } - - /* Handle compiling via the native interface */ - - else -#endif /* !defined NOPOSIX */ - - { - if (timeit) - { - register int i; - clock_t time_taken; - clock_t start_time = clock(); - for (i = 0; i < LOOPREPEAT; i++) - { - re = pcre_compile((char *)p, options, &error, &erroroffset, tables); - if (re != NULL) free(re); - } - time_taken = clock() - start_time; - fprintf(outfile, "Compile time %.3f milliseconds\n", - (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / - (double)CLOCKS_PER_SEC); - } - - re = pcre_compile((char *)p, options, &error, &erroroffset, tables); - - /* Compilation failed; go back for another re, skipping to blank line - if non-interactive. */ - - if (re == NULL) - { - fprintf(outfile, "Failed: %s at offset %d\n", error, erroroffset); - SKIP_DATA: - if (infile != stdin) - { - for (;;) - { - if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) - { - done = 1; - goto CONTINUE; - } - len = (int)strlen((char *)buffer); - while (len > 0 && isspace(buffer[len-1])) len--; - if (len == 0) break; - } - fprintf(outfile, "\n"); - } - goto CONTINUE; - } - - /* Compilation succeeded; print data if required. There are now two - info-returning functions. The old one has a limited interface and - returns only limited data. Check that it agrees with the newer one. */ - - if (log_store) - fprintf(outfile, "Memory allocation (code space): %d\n", - (int)(gotten_store - - sizeof(real_pcre) - - ((real_pcre *)re)->name_count * ((real_pcre *)re)->name_entry_size)); - - /* Extract the size for possible writing before possibly flipping it, - and remember the store that was got. */ - - true_size = ((real_pcre *)re)->size; - regex_gotten_store = gotten_store; - - /* If /S was present, study the regexp to generate additional info to - help with the matching. */ - - if (do_study) - { - if (timeit) - { - register int i; - clock_t time_taken; - clock_t start_time = clock(); - for (i = 0; i < LOOPREPEAT; i++) - extra = pcre_study(re, study_options, &error); - time_taken = clock() - start_time; - if (extra != NULL) free(extra); - fprintf(outfile, " Study time %.3f milliseconds\n", - (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / - (double)CLOCKS_PER_SEC); - } - extra = pcre_study(re, study_options, &error); - if (error != NULL) - fprintf(outfile, "Failed to study: %s\n", error); - else if (extra != NULL) - true_study_size = ((pcre_study_data *)(extra->study_data))->size; - } - - /* If the 'F' option was present, we flip the bytes of all the integer - fields in the regex data block and the study block. This is to make it - possible to test PCRE's handling of byte-flipped patterns, e.g. those - compiled on a different architecture. */ - - if (do_flip) - { - real_pcre *rre = (real_pcre *)re; - rre->magic_number = byteflip(rre->magic_number, sizeof(rre->magic_number)); - rre->size = byteflip(rre->size, sizeof(rre->size)); - rre->options = byteflip(rre->options, sizeof(rre->options)); - rre->top_bracket = byteflip(rre->top_bracket, sizeof(rre->top_bracket)); - rre->top_backref = byteflip(rre->top_backref, sizeof(rre->top_backref)); - rre->first_byte = byteflip(rre->first_byte, sizeof(rre->first_byte)); - rre->req_byte = byteflip(rre->req_byte, sizeof(rre->req_byte)); - rre->name_table_offset = byteflip(rre->name_table_offset, - sizeof(rre->name_table_offset)); - rre->name_entry_size = byteflip(rre->name_entry_size, - sizeof(rre->name_entry_size)); - rre->name_count = byteflip(rre->name_count, sizeof(rre->name_count)); - - if (extra != NULL) - { - pcre_study_data *rsd = (pcre_study_data *)(extra->study_data); - rsd->size = byteflip(rsd->size, sizeof(rsd->size)); - rsd->options = byteflip(rsd->options, sizeof(rsd->options)); - } - } - - /* Extract information from the compiled data if required */ - - SHOW_INFO: - - if (do_showinfo) - { - unsigned long int get_options, all_options; -#if !defined NOINFOCHECK - int old_first_char, old_options, old_count; -#endif - int count, backrefmax, first_char, need_char; - int nameentrysize, namecount; - const uschar *nametable; - - if (do_debug) - { - fprintf(outfile, "------------------------------------------------------------------\n"); - _pcre_printint(re, outfile); - } - - new_info(re, NULL, PCRE_INFO_OPTIONS, &get_options); - new_info(re, NULL, PCRE_INFO_SIZE, &size); - new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count); - new_info(re, NULL, PCRE_INFO_BACKREFMAX, &backrefmax); - new_info(re, NULL, PCRE_INFO_FIRSTBYTE, &first_char); - new_info(re, NULL, PCRE_INFO_LASTLITERAL, &need_char); - new_info(re, NULL, PCRE_INFO_NAMEENTRYSIZE, &nameentrysize); - new_info(re, NULL, PCRE_INFO_NAMECOUNT, &namecount); - new_info(re, NULL, PCRE_INFO_NAMETABLE, (void *)&nametable); - -#if !defined NOINFOCHECK - old_count = pcre_info(re, &old_options, &old_first_char); - if (count < 0) fprintf(outfile, - "Error %d from pcre_info()\n", count); - else - { - if (old_count != count) fprintf(outfile, - "Count disagreement: pcre_fullinfo=%d pcre_info=%d\n", count, - old_count); - - if (old_first_char != first_char) fprintf(outfile, - "First char disagreement: pcre_fullinfo=%d pcre_info=%d\n", - first_char, old_first_char); - - if (old_options != (int)get_options) fprintf(outfile, - "Options disagreement: pcre_fullinfo=%ld pcre_info=%d\n", - get_options, old_options); - } -#endif - - if (size != regex_gotten_store) fprintf(outfile, - "Size disagreement: pcre_fullinfo=%d call to malloc for %d\n", - (int)size, (int)regex_gotten_store); - - fprintf(outfile, "Capturing subpattern count = %d\n", count); - if (backrefmax > 0) - fprintf(outfile, "Max back reference = %d\n", backrefmax); - - if (namecount > 0) - { - fprintf(outfile, "Named capturing subpatterns:\n"); - while (namecount-- > 0) - { - fprintf(outfile, " %s %*s%3d\n", nametable + 2, - nameentrysize - 3 - (int)strlen((char *)nametable + 2), "", - GET2(nametable, 0)); - nametable += nameentrysize; - } - } - - /* The NOPARTIAL bit is a private bit in the options, so we have - to fish it out via out back door */ - - all_options = ((real_pcre *)re)->options; - if (do_flip) - { - all_options = byteflip(all_options, sizeof(all_options)); - } - - if ((all_options & PCRE_NOPARTIAL) != 0) - fprintf(outfile, "Partial matching not supported\n"); - - if (get_options == 0) fprintf(outfile, "No options\n"); - else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s\n", - ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "", - ((get_options & PCRE_CASELESS) != 0)? " caseless" : "", - ((get_options & PCRE_EXTENDED) != 0)? " extended" : "", - ((get_options & PCRE_MULTILINE) != 0)? " multiline" : "", - ((get_options & PCRE_FIRSTLINE) != 0)? " firstline" : "", - ((get_options & PCRE_DOTALL) != 0)? " dotall" : "", - ((get_options & PCRE_DOLLAR_ENDONLY) != 0)? " dollar_endonly" : "", - ((get_options & PCRE_EXTRA) != 0)? " extra" : "", - ((get_options & PCRE_UNGREEDY) != 0)? " ungreedy" : "", - ((get_options & PCRE_UTF8) != 0)? " utf8" : "", - ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : ""); - - if (((((real_pcre *)re)->options) & PCRE_ICHANGED) != 0) - fprintf(outfile, "Case state changes\n"); - - if (first_char == -1) - { - fprintf(outfile, "First char at start or follows \\n\n"); - } - else if (first_char < 0) - { - fprintf(outfile, "No first char\n"); - } - else - { - int ch = first_char & 255; - const char *caseless = ((first_char & REQ_CASELESS) == 0)? - "" : " (caseless)"; - if (isprint(ch)) - fprintf(outfile, "First char = \'%c\'%s\n", ch, caseless); - else - fprintf(outfile, "First char = %d%s\n", ch, caseless); - } - - if (need_char < 0) - { - fprintf(outfile, "No need char\n"); - } - else - { - int ch = need_char & 255; - const char *caseless = ((need_char & REQ_CASELESS) == 0)? - "" : " (caseless)"; - if (isprint(ch)) - fprintf(outfile, "Need char = \'%c\'%s\n", ch, caseless); - else - fprintf(outfile, "Need char = %d%s\n", ch, caseless); - } - - /* Don't output study size; at present it is in any case a fixed - value, but it varies, depending on the computer architecture, and - so messes up the test suite. (And with the /F option, it might be - flipped.) */ - - if (do_study) - { - if (extra == NULL) - fprintf(outfile, "Study returned NULL\n"); - else - { - uschar *start_bits = NULL; - new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits); - - if (start_bits == NULL) - fprintf(outfile, "No starting byte set\n"); - else - { - int i; - int c = 24; - fprintf(outfile, "Starting byte set: "); - for (i = 0; i < 256; i++) - { - if ((start_bits[i/8] & (1<<(i&7))) != 0) - { - if (c > 75) - { - fprintf(outfile, "\n "); - c = 2; - } - if (isprint(i) && i != ' ') - { - fprintf(outfile, "%c ", i); - c += 2; - } - else - { - fprintf(outfile, "\\x%02x ", i); - c += 5; - } - } - } - fprintf(outfile, "\n"); - } - } - } - } - - /* If the '>' option was present, we write out the regex to a file, and - that is all. The first 8 bytes of the file are the regex length and then - the study length, in big-endian order. */ - - if (to_file != NULL) - { - FILE *f = fopen((char *)to_file, "wb"); - if (f == NULL) - { - fprintf(outfile, "Unable to open %s: %s\n", to_file, strerror(errno)); - } - else - { - uschar sbuf[8]; - sbuf[0] = (true_size >> 24) & 255; - sbuf[1] = (true_size >> 16) & 255; - sbuf[2] = (true_size >> 8) & 255; - sbuf[3] = (true_size) & 255; - - sbuf[4] = (true_study_size >> 24) & 255; - sbuf[5] = (true_study_size >> 16) & 255; - sbuf[6] = (true_study_size >> 8) & 255; - sbuf[7] = (true_study_size) & 255; - - if (fwrite(sbuf, 1, 8, f) < 8 || - fwrite(re, 1, true_size, f) < true_size) - { - fprintf(outfile, "Write error on %s: %s\n", to_file, strerror(errno)); - } - else - { - fprintf(outfile, "Compiled regex written to %s\n", to_file); - if (extra != NULL) - { - if (fwrite(extra->study_data, 1, true_study_size, f) < - true_study_size) - { - fprintf(outfile, "Write error on %s: %s\n", to_file, - strerror(errno)); - } - else fprintf(outfile, "Study data written to %s\n", to_file); - } - } - fclose(f); - } - - new_free(re); - if (extra != NULL) new_free(extra); - if (tables != NULL) new_free((void *)tables); - continue; /* With next regex */ - } - } /* End of non-POSIX compile */ - - /* Read data lines and test them */ - - for (;;) - { - unsigned char *q; - unsigned char *bptr = dbuffer; - int *use_offsets = offsets; - int use_size_offsets = size_offsets; - int callout_data = 0; - int callout_data_set = 0; - int count, c; - int copystrings = 0; - int find_match_limit = 0; - int getstrings = 0; - int getlist = 0; - int gmatched = 0; - int start_offset = 0; - int g_notempty = 0; - int use_dfa = 0; - - options = 0; - - pcre_callout = callout; - first_callout = 1; - callout_extra = 0; - callout_count = 0; - callout_fail_count = 999999; - callout_fail_id = -1; - show_malloc = 0; - - if (infile == stdin) printf("data> "); - if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) - { - done = 1; - goto CONTINUE; - } - if (infile != stdin) fprintf(outfile, "%s", (char *)buffer); - - len = (int)strlen((char *)buffer); - while (len > 0 && isspace(buffer[len-1])) len--; - buffer[len] = 0; - if (len == 0) break; - - p = buffer; - while (isspace(*p)) p++; - - q = dbuffer; - while ((c = *p++) != 0) - { - int i = 0; - int n = 0; - - if (c == '\\') switch ((c = *p++)) - { - case 'a': c = 7; break; - case 'b': c = '\b'; break; - case 'e': c = 27; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - case 'v': c = '\v'; break; - - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - c -= '0'; - while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9') - c = c * 8 + *p++ - '0'; - break; - - case 'x': - - /* Handle \x{..} specially - new Perl thing for utf8 */ - -#if !defined NOUTF8 - if (*p == '{') - { - unsigned char *pt = p; - c = 0; - while (isxdigit(*(++pt))) - c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'W'); - if (*pt == '}') - { - unsigned char buff8[8]; - int ii, utn; - utn = _pcre_ord2utf8(c, buff8); - for (ii = 0; ii < utn - 1; ii++) *q++ = buff8[ii]; - c = buff8[ii]; /* Last byte */ - p = pt + 1; - break; - } - /* Not correct form; fall through */ - } -#endif - - /* Ordinary \x */ - - c = 0; - while (i++ < 2 && isxdigit(*p)) - { - c = c * 16 + tolower(*p) - ((isdigit(*p))? '0' : 'W'); - p++; - } - break; - - case 0: /* \ followed by EOF allows for an empty line */ - p--; - continue; - - case '>': - while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0'; - continue; - - case 'A': /* Option setting */ - options |= PCRE_ANCHORED; - continue; - - case 'B': - options |= PCRE_NOTBOL; - continue; - - case 'C': - if (isdigit(*p)) /* Set copy string */ - { - while(isdigit(*p)) n = n * 10 + *p++ - '0'; - copystrings |= 1 << n; - } - else if (isalnum(*p)) - { - uschar name[256]; - uschar *npp = name; - while (isalnum(*p)) *npp++ = *p++; - *npp = 0; - n = pcre_get_stringnumber(re, (char *)name); - if (n < 0) - fprintf(outfile, "no parentheses with name \"%s\"\n", name); - else copystrings |= 1 << n; - } - else if (*p == '+') - { - callout_extra = 1; - p++; - } - else if (*p == '-') - { - pcre_callout = NULL; - p++; - } - else if (*p == '!') - { - callout_fail_id = 0; - p++; - while(isdigit(*p)) - callout_fail_id = callout_fail_id * 10 + *p++ - '0'; - callout_fail_count = 0; - if (*p == '!') - { - p++; - while(isdigit(*p)) - callout_fail_count = callout_fail_count * 10 + *p++ - '0'; - } - } - else if (*p == '*') - { - int sign = 1; - callout_data = 0; - if (*(++p) == '-') { sign = -1; p++; } - while(isdigit(*p)) - callout_data = callout_data * 10 + *p++ - '0'; - callout_data *= sign; - callout_data_set = 1; - } - continue; - -#if !defined NODFA - case 'D': -#if !defined NOPOSIX - if (posix || do_posix) - printf("** Can't use dfa matching in POSIX mode: \\D ignored\n"); - else -#endif - use_dfa = 1; - continue; - - case 'F': - options |= PCRE_DFA_SHORTEST; - continue; -#endif - - case 'G': - if (isdigit(*p)) - { - while(isdigit(*p)) n = n * 10 + *p++ - '0'; - getstrings |= 1 << n; - } - else if (isalnum(*p)) - { - uschar name[256]; - uschar *npp = name; - while (isalnum(*p)) *npp++ = *p++; - *npp = 0; - n = pcre_get_stringnumber(re, (char *)name); - if (n < 0) - fprintf(outfile, "no parentheses with name \"%s\"\n", name); - else getstrings |= 1 << n; - } - continue; - - case 'L': - getlist = 1; - continue; - - case 'M': - find_match_limit = 1; - continue; - - case 'N': - options |= PCRE_NOTEMPTY; - continue; - - case 'O': - while(isdigit(*p)) n = n * 10 + *p++ - '0'; - if (n > size_offsets_max) - { - size_offsets_max = n; - free(offsets); - use_offsets = offsets = (int *)malloc(size_offsets_max * sizeof(int)); - if (offsets == NULL) - { - printf("** Failed to get %d bytes of memory for offsets vector\n", - size_offsets_max * sizeof(int)); - yield = 1; - goto EXIT; - } - } - use_size_offsets = n; - if (n == 0) use_offsets = NULL; /* Ensures it can't write to it */ - continue; - - case 'P': - options |= PCRE_PARTIAL; - continue; - -#if !defined NODFA - case 'R': - options |= PCRE_DFA_RESTART; - continue; -#endif - - case 'S': - show_malloc = 1; - continue; - - case 'Z': - options |= PCRE_NOTEOL; - continue; - - case '?': - options |= PCRE_NO_UTF8_CHECK; - continue; - } - *q++ = c; - } - *q = 0; - len = q - dbuffer; - - if ((all_use_dfa || use_dfa) && find_match_limit) - { - printf("**Match limit not relevant for DFA matching: ignored\n"); - find_match_limit = 0; - } - - /* Handle matching via the POSIX interface, which does not - support timing or playing with the match limit or callout data. */ - -#if !defined NOPOSIX - if (posix || do_posix) - { - int rc; - int eflags = 0; - regmatch_t *pmatch = NULL; - if (use_size_offsets > 0) - pmatch = (regmatch_t *)malloc(sizeof(regmatch_t) * use_size_offsets); - if ((options & PCRE_NOTBOL) != 0) eflags |= REG_NOTBOL; - if ((options & PCRE_NOTEOL) != 0) eflags |= REG_NOTEOL; - - rc = regexec(&preg, (const char *)bptr, use_size_offsets, pmatch, eflags); - - if (rc != 0) - { - (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE); - fprintf(outfile, "No match: POSIX code %d: %s\n", rc, buffer); - } - else - { - size_t i; - for (i = 0; i < (size_t)use_size_offsets; i++) - { - if (pmatch[i].rm_so >= 0) - { - fprintf(outfile, "%2d: ", (int)i); - (void)pchars(dbuffer + pmatch[i].rm_so, - pmatch[i].rm_eo - pmatch[i].rm_so, outfile); - fprintf(outfile, "\n"); - if (i == 0 && do_showrest) - { - fprintf(outfile, " 0+ "); - (void)pchars(dbuffer + pmatch[i].rm_eo, len - pmatch[i].rm_eo, - outfile); - fprintf(outfile, "\n"); - } - } - } - } - free(pmatch); - } - - /* Handle matching via the native interface - repeats for /g and /G */ - - else -#endif /* !defined NOPOSIX */ - - for (;; gmatched++) /* Loop for /g or /G */ - { - if (timeit) - { - register int i; - clock_t time_taken; - clock_t start_time = clock(); - -#if !defined NODFA - if (all_use_dfa || use_dfa) - { - int workspace[1000]; - for (i = 0; i < LOOPREPEAT; i++) - count = pcre_dfa_exec(re, NULL, (char *)bptr, len, start_offset, - options | g_notempty, use_offsets, use_size_offsets, workspace, - sizeof(workspace)/sizeof(int)); - } - else -#endif - - for (i = 0; i < LOOPREPEAT; i++) - count = pcre_exec(re, extra, (char *)bptr, len, - start_offset, options | g_notempty, use_offsets, use_size_offsets); - - time_taken = clock() - start_time; - fprintf(outfile, "Execute time %.3f milliseconds\n", - (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / - (double)CLOCKS_PER_SEC); - } - - /* If find_match_limit is set, we want to do repeated matches with - varying limits in order to find the minimum value. */ - - if (find_match_limit) - { - int min = 0; - int mid = 64; - int max = -1; - - if (extra == NULL) - { - extra = (pcre_extra *)malloc(sizeof(pcre_extra)); - extra->flags = 0; - } - extra->flags |= PCRE_EXTRA_MATCH_LIMIT; - - for (;;) - { - extra->match_limit = mid; - count = pcre_exec(re, extra, (char *)bptr, len, start_offset, - options | g_notempty, use_offsets, use_size_offsets); - if (count == PCRE_ERROR_MATCHLIMIT) - { - /* fprintf(outfile, "Testing match limit = %d\n", mid); */ - min = mid; - mid = (mid == max - 1)? max : (max > 0)? (min + max)/2 : mid*2; - } - else if (count >= 0 || count == PCRE_ERROR_NOMATCH || - count == PCRE_ERROR_PARTIAL) - { - if (mid == min + 1) - { - fprintf(outfile, "Minimum match limit = %d\n", mid); - break; - } - /* fprintf(outfile, "Testing match limit = %d\n", mid); */ - max = mid; - mid = (min + mid)/2; - } - else break; /* Some other error */ - } - - extra->flags &= ~PCRE_EXTRA_MATCH_LIMIT; - } - - /* If callout_data is set, use the interface with additional data */ - - else if (callout_data_set) - { - if (extra == NULL) - { - extra = (pcre_extra *)malloc(sizeof(pcre_extra)); - extra->flags = 0; - } - extra->flags |= PCRE_EXTRA_CALLOUT_DATA; - extra->callout_data = &callout_data; - count = pcre_exec(re, extra, (char *)bptr, len, start_offset, - options | g_notempty, use_offsets, use_size_offsets); - extra->flags &= ~PCRE_EXTRA_CALLOUT_DATA; - } - - /* The normal case is just to do the match once, with the default - value of match_limit. */ - -#if !defined NODFA - else if (all_use_dfa || use_dfa) - { - int workspace[1000]; - count = pcre_dfa_exec(re, NULL, (char *)bptr, len, start_offset, - options | g_notempty, use_offsets, use_size_offsets, workspace, - sizeof(workspace)/sizeof(int)); - if (count == 0) - { - fprintf(outfile, "Matched, but too many subsidiary matches\n"); - count = use_size_offsets/2; - } - } -#endif - - else - { - count = pcre_exec(re, extra, (char *)bptr, len, - start_offset, options | g_notempty, use_offsets, use_size_offsets); - if (count == 0) - { - fprintf(outfile, "Matched, but too many substrings\n"); - count = use_size_offsets/3; - } - } - - /* Matched */ - - if (count >= 0) - { - int i; - for (i = 0; i < count * 2; i += 2) - { - if (use_offsets[i] < 0) - fprintf(outfile, "%2d: <unset>\n", i/2); - else - { - fprintf(outfile, "%2d: ", i/2); - (void)pchars(bptr + use_offsets[i], - use_offsets[i+1] - use_offsets[i], outfile); - fprintf(outfile, "\n"); - if (i == 0) - { - if (do_showrest) - { - fprintf(outfile, " 0+ "); - (void)pchars(bptr + use_offsets[i+1], len - use_offsets[i+1], - outfile); - fprintf(outfile, "\n"); - } - } - } - } - - for (i = 0; i < 32; i++) - { - if ((copystrings & (1 << i)) != 0) - { - char copybuffer[16]; - int rc = pcre_copy_substring((char *)bptr, use_offsets, count, - i, copybuffer, sizeof(copybuffer)); - if (rc < 0) - fprintf(outfile, "copy substring %d failed %d\n", i, rc); - else - fprintf(outfile, "%2dC %s (%d)\n", i, copybuffer, rc); - } - } - - for (i = 0; i < 32; i++) - { - if ((getstrings & (1 << i)) != 0) - { - const char *substring; - int rc = pcre_get_substring((char *)bptr, use_offsets, count, - i, &substring); - if (rc < 0) - fprintf(outfile, "get substring %d failed %d\n", i, rc); - else - { - fprintf(outfile, "%2dG %s (%d)\n", i, substring, rc); - /* free((void *)substring); */ - pcre_free_substring(substring); - } - } - } - - if (getlist) - { - const char **stringlist; - int rc = pcre_get_substring_list((char *)bptr, use_offsets, count, - &stringlist); - if (rc < 0) - fprintf(outfile, "get substring list failed %d\n", rc); - else - { - for (i = 0; i < count; i++) - fprintf(outfile, "%2dL %s\n", i, stringlist[i]); - if (stringlist[i] != NULL) - fprintf(outfile, "string list not terminated by NULL\n"); - /* free((void *)stringlist); */ - pcre_free_substring_list(stringlist); - } - } - } - - /* There was a partial match */ - - else if (count == PCRE_ERROR_PARTIAL) - { - fprintf(outfile, "Partial match"); -#if !defined NODFA - if ((all_use_dfa || use_dfa) && use_size_offsets > 2) - fprintf(outfile, ": %.*s", use_offsets[1] - use_offsets[0], - bptr + use_offsets[0]); -#endif - fprintf(outfile, "\n"); - break; /* Out of the /g loop */ - } - - /* Failed to match. If this is a /g or /G loop and we previously set - g_notempty after a null match, this is not necessarily the end. - We want to advance the start offset, and continue. In the case of UTF-8 - matching, the advance must be one character, not one byte. Fudge the - offset values to achieve this. We won't be at the end of the string - - that was checked before setting g_notempty. */ - - else - { - if (g_notempty != 0) - { - int onechar = 1; - use_offsets[0] = start_offset; - if (use_utf8) - { - while (start_offset + onechar < len) - { - int tb = bptr[start_offset+onechar]; - if (tb <= 127) break; - tb &= 0xc0; - if (tb != 0 && tb != 0xc0) onechar++; - } - } - use_offsets[1] = start_offset + onechar; - } - else - { - if (count == PCRE_ERROR_NOMATCH) - { - if (gmatched == 0) fprintf(outfile, "No match\n"); - } - else fprintf(outfile, "Error %d\n", count); - break; /* Out of the /g loop */ - } - } - - /* If not /g or /G we are done */ - - if (!do_g && !do_G) break; - - /* If we have matched an empty string, first check to see if we are at - the end of the subject. If so, the /g loop is over. Otherwise, mimic - what Perl's /g options does. This turns out to be rather cunning. First - we set PCRE_NOTEMPTY and PCRE_ANCHORED and try the match again at the - same point. If this fails (picked up above) we advance to the next - character. */ - - g_notempty = 0; - if (use_offsets[0] == use_offsets[1]) - { - if (use_offsets[0] == len) break; - g_notempty = PCRE_NOTEMPTY | PCRE_ANCHORED; - } - - /* For /g, update the start offset, leaving the rest alone */ - - if (do_g) start_offset = use_offsets[1]; - - /* For /G, update the pointer and length */ - - else - { - bptr += use_offsets[1]; - len -= use_offsets[1]; - } - } /* End of loop for /g and /G */ - } /* End of loop for data lines */ - - CONTINUE: - -#if !defined NOPOSIX - if (posix || do_posix) regfree(&preg); -#endif - - if (re != NULL) new_free(re); - if (extra != NULL) new_free(extra); - if (tables != NULL) - { - new_free((void *)tables); - setlocale(LC_CTYPE, "C"); - } - } - -if (infile == stdin) fprintf(outfile, "\n"); - -EXIT: - -if (infile != NULL && infile != stdin) fclose(infile); -if (outfile != NULL && outfile != stdout) fclose(outfile); - -free(buffer); -free(dbuffer); -free(pbuffer); -free(offsets); - -return yield; -} - -/* End of pcretest.c */ diff --git a/ext/pcre/pcrelib/testdata/grepinput b/ext/pcre/pcrelib/testdata/grepinput deleted file mode 100644 index 2a89c2e09dd53..0000000000000 --- a/ext/pcre/pcrelib/testdata/grepinput +++ /dev/null @@ -1,588 +0,0 @@ -This is a file of miscellaneous text that is used as test data for checking -that the pcregrep command is working correctly. The file must be more than 24K -long so that it needs more than a single read() call to process it. New -features should be added at the end, because some of the tests involve the -output of line numbers, and we don't want these to change. - -PATTERN at the start of a line. -In the middle of a line, PATTERN appears. - -This pattern is in lower case. - -Here follows a whole lot of stuff that makes the file over 24K long. - -------------------------------------------------------------------------------- -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. - -The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the -lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox -jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick -brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -------------------------------------------------------------------------------- - -Check up on PATTERN near the end. - -This is the last line of this file. diff --git a/ext/pcre/pcrelib/testdata/grepinputx b/ext/pcre/pcrelib/testdata/grepinputx deleted file mode 100644 index aebba027703a7..0000000000000 --- a/ext/pcre/pcrelib/testdata/grepinputx +++ /dev/null @@ -1,42 +0,0 @@ -This is a second file of input for the pcregrep tests. - -Here is the pattern again. - -Pattern -That time it was on a line by itself. - -To pat or not to pat, that is the question. - -complete pair -of lines - -That was a complete pair -of lines all by themselves. - -complete pair -of lines - -And there they were again, to check line numbers. - -one -two -three -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty - -This is the last line of this file. diff --git a/ext/pcre/pcrelib/testdata/greplist b/ext/pcre/pcrelib/testdata/greplist deleted file mode 100644 index bb2705e390abf..0000000000000 --- a/ext/pcre/pcrelib/testdata/greplist +++ /dev/null @@ -1,4 +0,0 @@ -This is a file of patterns for testing the -f option. Don't include any blank -lines because they will match everything! -pattern -line by itself diff --git a/ext/pcre/pcrelib/testdata/grepoutput b/ext/pcre/pcrelib/testdata/grepoutput deleted file mode 100644 index 27ab7e4a5ff6b..0000000000000 --- a/ext/pcre/pcrelib/testdata/grepoutput +++ /dev/null @@ -1,336 +0,0 @@ -pcregrep version 4.0 07-Jun-2005 using PCRE version 6.2 01-Aug-2005 ----------------------------- Test 1 ------------------------------ -PATTERN at the start of a line. -In the middle of a line, PATTERN appears. -Check up on PATTERN near the end. ----------------------------- Test 2 ------------------------------ -PATTERN at the start of a line. ----------------------------- Test 3 ------------------------------ -7:PATTERN at the start of a line. -8:In the middle of a line, PATTERN appears. -10:This pattern is in lower case. -586:Check up on PATTERN near the end. ----------------------------- Test 4 ------------------------------ -4 ----------------------------- Test 5 ------------------------------ -./testdata/grepinput:7:PATTERN at the start of a line. -./testdata/grepinput:8:In the middle of a line, PATTERN appears. -./testdata/grepinput:10:This pattern is in lower case. -./testdata/grepinput:586:Check up on PATTERN near the end. --- -./testdata/grepinputx:3:Here is the pattern again. -./testdata/grepinputx:5:Pattern ----------------------------- Test 6 ------------------------------ -7:PATTERN at the start of a line. -8:In the middle of a line, PATTERN appears. -10:This pattern is in lower case. -586:Check up on PATTERN near the end. --- -3:Here is the pattern again. -5:Pattern ----------------------------- Test 7 ------------------------------ -./testdata/grepinput -./testdata/grepinputx ----------------------------- Test 8 ------------------------------ -./testdata/grepinput ----------------------------- Test 9 ------------------------------ -RC=0 ----------------------------- Test 10 ----------------------------- -RC=1 ----------------------------- Test 11 ----------------------------- -1:This is a second file of input for the pcregrep tests. -2: -4: -5:Pattern -6:That time it was on a line by itself. -7: -8:To pat or not to pat, that is the question. -9: -10:complete pair -11:of lines -12: -13:That was a complete pair -14:of lines all by themselves. -15: -16:complete pair -17:of lines -18: -19:And there they were again, to check line numbers. -20: -21:one -22:two -23:three -24:four -25:five -26:six -27:seven -28:eight -29:nine -30:ten -31:eleven -32:twelve -33:thirteen -34:fourteen -35:fifteen -36:sixteen -37:seventeen -38:eighteen -39:nineteen -40:twenty -41: -42:This is the last line of this file. ----------------------------- Test 12 ----------------------------- -Pattern ----------------------------- Test 13 ----------------------------- -Here is the pattern again. -That time it was on a line by itself. ----------------------------- Test 14 ----------------------------- -./testdata/grepinputx:To pat or not to pat, that is the question. ----------------------------- Test 15 ----------------------------- -pcregrep: Error in regex at offset 4: nothing to repeat ----------------------------- Test 16 ----------------------------- -pcregrep: Failed to open ./testdata/nonexistfile: No such file or directory ----------------------------- Test 17 ----------------------------- -features should be added at the end, because some of the tests involve the -output of line numbers, and we don't want these to change. ----------------------------- Test 18 ----------------------------- -4:features should be added at the end, because some of the tests involve the -output of line numbers, and we don't want these to change. -583:brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -------------------------------------------------------------------------------- ----------------------------- Test 19 ----------------------------- -Pattern ----------------------------- Test 20 ----------------------------- -10:complete pair -of lines -16:complete pair -of lines ----------------------------- Test 21 ----------------------------- -24:four -25-five -26-six -27-seven --- -34:fourteen -35-fifteen -36-sixteen -37-seventeen ----------------------------- Test 22 ----------------------------- -20-one -21-two -22-three -24:four --- -30-eleven -31-twelve -32-thirteen -34:fourteen ----------------------------- Test 23 ----------------------------- -one -two -three -four -five -six -seven --- -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen ----------------------------- Test 24 ----------------------------- -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty - -This is the last line of this file. ----------------------------- Test 25 ----------------------------- -14- -15-complete pair -16-of lines -17- -18-And there they were again, to check line numbers. -19- -20-one -21-two -22-three -24:four -25-five -26-six -27-seven -28-eight -29-nine -30-ten -31-eleven -32-twelve -33-thirteen -34:fourteen ----------------------------- Test 26 ----------------------------- - -complete pair -of lines - -And there they were again, to check line numbers. - -one -two -three -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty - -This is the last line of this file. ----------------------------- Test 27 ----------------------------- -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty - -This is the last line of this file. ----------------------------- Test 28 ----------------------------- -13-of lines all by themselves. -14- -15-complete pair -16-of lines -17- -18-And there they were again, to check line numbers. -19- -20-one -21-two -22-three -24:four -25-five -26-six -27-seven -28-eight -29-nine -30-ten -31-eleven -32-twelve -33-thirteen -34:fourteen ----------------------------- Test 29 ----------------------------- -of lines all by themselves. - -complete pair -of lines - -And there they were again, to check line numbers. - -one -two -three -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty - -This is the last line of this file. ----------------------------- Test 30 ----------------------------- -./testdata/grepinput-3-features should be added at the end, because some of the tests involve the -./testdata/grepinput-4-output of line numbers, and we don't want these to change. -./testdata/grepinput-5- -./testdata/grepinput:7:PATTERN at the start of a line. -./testdata/grepinput:8:In the middle of a line, PATTERN appears. -./testdata/grepinput-9- -./testdata/grepinput:10:This pattern is in lower case. --- -./testdata/grepinput-582-brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -./testdata/grepinput-583-------------------------------------------------------------------------------- -./testdata/grepinput-584- -./testdata/grepinput:586:Check up on PATTERN near the end. --- -./testdata/grepinputx-1-This is a second file of input for the pcregrep tests. -./testdata/grepinputx-2- -./testdata/grepinputx:3:Here is the pattern again. -./testdata/grepinputx-4- -./testdata/grepinputx:5:Pattern ----------------------------- Test 31 ----------------------------- -./testdata/grepinput:7:PATTERN at the start of a line. -./testdata/grepinput:8:In the middle of a line, PATTERN appears. -./testdata/grepinput-9- -./testdata/grepinput:10:This pattern is in lower case. -./testdata/grepinput-11- -./testdata/grepinput-12-Here follows a whole lot of stuff that makes the file over 24K long. -./testdata/grepinput-13- --- -./testdata/grepinput:586:Check up on PATTERN near the end. -./testdata/grepinput-587- -./testdata/grepinput-588-This is the last line of this file. --- -./testdata/grepinputx:3:Here is the pattern again. -./testdata/grepinputx-4- -./testdata/grepinputx:5:Pattern -./testdata/grepinputx-6-That time it was on a line by itself. -./testdata/grepinputx-7- -./testdata/grepinputx-8-To pat or not to pat, that is the question. ----------------------------- Test 32 ----------------------------- -./testdata/grepinputx ----------------------------- Test 33 ----------------------------- -pcregrep: Failed to open ./testdata/grepnonexist: No such file or directory -RC=2 ----------------------------- Test 34 ----------------------------- -RC=2 ----------------------------- Test 35 ----------------------------- -./testdata/grepinputx -RC=0 ----------------------------- Test 36 ----------------------------- -./testdata/grepinputx -RC=0 diff --git a/ext/pcre/pcrelib/testdata/testinput1 b/ext/pcre/pcrelib/testdata/testinput1 deleted file mode 100644 index 88ff5bf8e7dde..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput1 +++ /dev/null @@ -1,3850 +0,0 @@ -/the quick brown fox/ - the quick brown fox - The quick brown FOX - What do you know about the quick brown fox? - What do you know about THE QUICK BROWN FOX? - -/The quick brown fox/i - the quick brown fox - The quick brown FOX - What do you know about the quick brown fox? - What do you know about THE QUICK BROWN FOX? - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - *** Failers - abxyzpqrrabbxyyyypqAzz - abxyzpqrrrrabbxyyyypqAzz - abxyzpqrrrabxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyypqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz - -/^(abc){1,2}zz/ - abczz - abcabczz - *** Failers - zz - abcabcabczz - >>abczz - -/^(b+?|a){1,2}?c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}?bc/ - bbc - -/^(b*|ba){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^(ba|b*){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - -/^[ab\]cde]/ - athing - bthing - ]thing - cthing - dthing - ething - *** Failers - fthing - [thing - \\thing - -/^[]cde]/ - ]thing - cthing - dthing - ething - *** Failers - athing - fthing - -/^[^ab\]cde]/ - fthing - [thing - \\thing - *** Failers - athing - bthing - ]thing - cthing - dthing - ething - -/^[^]cde]/ - athing - fthing - *** Failers - ]thing - cthing - dthing - ething - -/^\/ -  - -/^˙/ - ˙ - -/^[0-9]+$/ - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 100 - *** Failers - abc - -/^.*nter/ - enter - inter - uponter - -/^xxx[0-9]+$/ - xxx0 - xxx1234 - *** Failers - xxx - -/^.+[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - *** Failers - !pqr=apquxz.ixr.zzz.ac.uk - abc!=apquxz.ixr.zzz.ac.uk - abc!pqr=apquxz:ixr.zzz.ac.uk - abc!pqr=apquxz.ixr.zzz.ac.ukk - -/:/ - Well, we need a colon: somewhere - *** Fail if we don't - -/([\da-f:]+)$/i - 0abc - abc - fed - E - :: - 5f03:12C0::932e - fed def - Any old stuff - *** Failers - 0zzz - gzzz - fed\x20 - Any old rubbish - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - A.12.123.0 - *** Failers - .1.2.3333 - 1.2.3 - 1234.2.3 - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 1 IN SOA non-sp1 non-sp2 ( - *** Failers - 1IN SOA non-sp1 non-sp2( - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - Z. - 2. - ab-c.pq-r. - sxk.zzz.ac.uk. - x-.y-. - *** Failers - -abc.peq. - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - *.b0-a - *.c3-b.c - *.c-a.b-c - *** Failers - *.0 - *.a- - *.a-b.c- - *.c-a.0-c - -/^(?=ab(de))(abd)(e)/ - abde - -/^(?!(ab)de|x)(abd)(f)/ - abdf - -/^(?=(ab(cd)))(ab)/ - abcd - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - A.B.C.D - a.b.c.1.2.3.C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - \"abcd\" ; - \"\" ; rhubarb - *** Failers - \"1234\" : things - -/^$/ - \ - *** Failers - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - *** Failers - abc - ab cde - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - *** Failers - abc - ab cde - -/^ a\ b[c ]d $/x - a bcd - a b d - *** Failers - abcd - ab d - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - -/^a*\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a*?\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a+\w/ - az - aaaz - aa - aaaa - aa+ - -/^a+?\w/ - az - aaaz - aa - aaaa - aa+ - -/^\d{8}\w{2,}/ - 1234567890 - 12345678ab - 12345678__ - *** Failers - 1234567 - -/^[aeiou\d]{4,5}$/ - uoie - 1234 - 12345 - aaaaa - *** Failers - 123456 - -/^[aeiou\d]{4,5}?/ - uoie - 1234 - 12345 - aaaaa - 123456 - -/\A(abc|def)=(\1){2,3}\Z/ - abc=abcabc - def=defdefdef - *** Failers - abc=defdef - -/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ - abcdefghijkcda2 - abcdefghijkkkkcda2 - -/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ - cataract cataract23 - catatonic catatonic23 - caterpillar caterpillar23 - - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - From abcd Mon Sep 1 12:33:02 1997 - *** Failers - From abcd Sep 01 12:33:02 1997 - -/^12.34/s - 12\n34 - 12\r34 - -/\w+(?=\t)/ - the quick brown\t fox - -/foo(?!bar)(.*)/ - foobar is foolish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - barrel - 2barrel - A barrel - -/^(\D*)(?=\d)(?!123)/ - abc456 - *** Failers - abc123 - -/^1234(?# test newlines - inside)/ - 1234 - -/^1234 #comment in extended re - /x - 1234 - -/#rhubarb - abcd/x - abcd - -/^abcd#rhubarb/x - abcd - -/^(a)\1{2,3}(.)/ - aaab - aaaab - aaaaab - aaaaaab - -/(?!^)abc/ - the abc - *** Failers - abc - -/(?=^)abc/ - abc - *** Failers - the abc - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other <user\@dom.ain> - <user\@dom.ain> - user\@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - A. Other <user.1234\@dom.ain> (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle <user\@some.where - *** Failers - The quick brown fox - -/[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional leading comment -(?: -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other <user\@dom.ain> - <user\@dom.ain> - user\@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - A. Other <user.1234\@dom.ain> (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle <user\@some.where - *** Failers - The quick brown fox - -/abc\0def\00pqr\000xyz\0000AB/ - abc\0def\00pqr\000xyz\0000AB - abc456 abc\0def\00pqr\000xyz\0000ABCDE - -/abc\x0def\x00pqr\x000xyz\x0000AB/ - abc\x0def\x00pqr\x000xyz\x0000AB - abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE - -/^[\000-\037]/ - \0A - \01B - \037C - -/\0*/ - \0\0\0\0 - -/A\x0{2,3}Z/ - The A\x0\x0Z - An A\0\x0\0Z - *** Failers - A\0Z - A\0\x0\0\x0Z - -/^(cow|)\1(bell)/ - cowcowbell - bell - *** Failers - cowbell - -/^\s/ - \040abc - \x0cabc - \nabc - \rabc - \tabc - *** Failers - abc - -/^a b - - c/x - abc - -/^(a|)\1*b/ - ab - aaaab - b - *** Failers - acb - -/^(a|)\1+b/ - aab - aaaab - b - *** Failers - ab - -/^(a|)\1?b/ - ab - aab - b - *** Failers - acb - -/^(a|)\1{2}b/ - aaab - b - *** Failers - ab - aab - aaaab - -/^(a|)\1{2,3}b/ - aaab - aaaab - b - *** Failers - ab - aab - aaaaab - -/ab{1,3}bc/ - abbbbc - abbbc - abbc - *** Failers - abc - abbbbbc - -/([^.]*)\.([^:]*):[T ]+(.*)/ - track1.title:TBlah blah blah - -/([^.]*)\.([^:]*):[T ]+(.*)/i - track1.title:TBlah blah blah - -/([^.]*)\.([^:]*):[t ]+(.*)/i - track1.title:TBlah blah blah - -/^[W-c]+$/ - WXY_^abc - *** Failers - wxy - -/^[W-c]+$/i - WXY_^abc - wxy_^ABC - -/^[\x3f-\x5F]+$/i - WXY_^abc - wxy_^ABC - -/^abc$/m - abc - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/^abc$/ - abc - *** Failers - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/\Aabc\Z/m - abc - abc\n - *** Failers - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/\A(.)*\Z/s - abc\ndef - -/\A(.)*\Z/m - *** Failers - abc\ndef - -/(?:b)|(?::+)/ - b::c - c::b - -/[-az]+/ - az- - *** Failers - b - -/[az-]+/ - za- - *** Failers - b - -/[a\-z]+/ - a-z - *** Failers - b - -/[a-z]+/ - abcdxyz - -/[\d-]+/ - 12-34 - *** Failers - aaa - -/[\d-z]+/ - 12-34z - *** Failers - aaa - -/\x5c/ - \\ - -/\x20Z/ - the Zoo - *** Failers - Zulu - -/(abc)\1/i - abcabc - ABCabc - abcABC - -/ab{3cd/ - ab{3cd - -/ab{3,cd/ - ab{3,cd - -/ab{3,4a}cd/ - ab{3,4a}cd - -/{4,5a}bc/ - {4,5a}bc - -/^a.b/ - a\rb - *** Failers - a\nb - -/abc$/ - abc - abc\n - *** Failers - abc\ndef - -/(abc)\123/ - abc\x53 - -/(abc)\223/ - abc\x93 - -/(abc)\323/ - abc\xd3 - -/(abc)\500/ - abc\x40 - abc\100 - -/(abc)\5000/ - abc\x400 - abc\x40\x30 - abc\1000 - abc\100\x30 - abc\100\060 - abc\100\60 - -/abc\81/ - abc\081 - abc\0\x38\x31 - -/abc\91/ - abc\091 - abc\0\x39\x31 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/ - abcdefghijkllS - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - -/ab\gdef/ - abgdef - -/a{0}bc/ - bc - -/(a|(bc)){0,0}?xyz/ - xyz - -/abc[\10]de/ - abc\010de - -/abc[\1]de/ - abc\1de - -/(abc)[\1]de/ - abc\1de - -/(?s)a.b/ - a\nb - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - baNOTcccd - baNOTccd - bacccd - *** Failers - anything - b\bc - baccd - -/[^a]/ - Abc - -/[^a]/i - Abc - -/[^a]+/ - AAAaAbc - -/[^a]+/i - AAAaAbc - -/[^a]+/ - bbb\nccc - -/[^k]$/ - abc - *** Failers - abk - -/[^k]{2,3}$/ - abc - kbc - kabc - *** Failers - abk - akb - akk - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 123456789\@x.y.z - *** Failers - 12345678\@x.y.uk - 1234567\@a.b.c.d - -/(a)\1{8,}/ - aaaaaaaaa - aaaaaaaaaa - *** Failers - aaaaaaa - -/[^a]/ - aaaabcd - aaAabcd - -/[^a]/i - aaaabcd - aaAabcd - -/[^az]/ - aaaabcd - aaAabcd - -/[^az]/i - aaaabcd - aaAabcd - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 1.875000282 - 1.235 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/a(?)b/ - ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - -/foo(.*)bar/ - The food is under the bar in the barn. - -/foo(.*?)bar/ - The food is under the bar in the barn. - -/(.*)(\d*)/ - I have 2 numbers: 53147 - -/(.*)(\d+)/ - I have 2 numbers: 53147 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - -/^\D*(?!123)/ - ABC123 - -/^(\D*)(?=\d)(?!123)/ - ABC445 - *** Failers - ABC123 - -/^[W-]46]/ - W46]789 - -46]789 - *** Failers - Wall - Zebra - 42 - [abcd] - ]abcd[ - -/^[W-\]46]/ - W46]789 - Wall - Zebra - Xylophone - 42 - [abcd] - ]abcd[ - \\backslash - *** Failers - -46]789 - well - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope - -/^(a){0,0}/ - bcd - abc - aab - -/^(a){0,1}/ - bcd - abc - aab - -/^(a){0,2}/ - bcd - abc - aab - -/^(a){0,3}/ - bcd - abc - aab - aaa - -/^(a){0,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/^(a){1,1}/ - bcd - abc - aab - -/^(a){1,2}/ - bcd - abc - aab - -/^(a){1,3}/ - bcd - abc - aab - aaa - -/^(a){1,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/.*\.gif/ - borfle\nbib.gif\nno - -/.{0,}\.gif/ - borfle\nbib.gif\nno - -/.*\.gif/m - borfle\nbib.gif\nno - -/.*\.gif/s - borfle\nbib.gif\nno - -/.*\.gif/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno - -/.*$/m - borfle\nbib.gif\nno - -/.*$/s - borfle\nbib.gif\nno - -/.*$/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno\n - -/.*$/m - borfle\nbib.gif\nno\n - -/.*$/s - borfle\nbib.gif\nno\n - -/.*$/ms - borfle\nbib.gif\nno\n - -/(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/m - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(.*X|^B)/s - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/ms - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(?s:.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/^.*B/ - **** Failers - abc\nB - -/(?s)^.*B/ - abc\nB - -/(?m)^.*B/ - abc\nB - -/(?ms)^.*B/ - abc\nB - -/(?ms)^B/ - abc\nB - -/(?s)B$/ - B\n - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - -/^[abc]{12}/ - abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - *** Failers - z - -/abcde{0,0}/ - abcd - *** Failers - abce - -/ab[cd]{0,0}e/ - abe - *** Failers - abcde - -/ab(c){0,0}d/ - abd - *** Failers - abcd - -/a(b*)/ - a - ab - abbbb - *** Failers - bbbbb - -/ab\d{0}e/ - abe - *** Failers - ab1e - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - \"the \\\"quick\\\" brown fox\" - -/.*?/g+ - abc - -/\b/g+ - abc - -/\b/+g - abc - -//g - abc - -/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - -/a[^a]b/ - acb - a\nb - -/a.b/ - acb - *** Failers - a\nb - -/a[^a]b/s - acb - a\nb - -/a.b/s - acb - a\nb - -/^(b+?|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/^(b+|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/(?!\A)x/m - x\nb\n - a\bx\n - -/\x0{ab}/ - \0{ab} - -/(A|B)*?CD/ - CD - -/(A|B)*CD/ - CD - -/(AB)*?\1/ - ABABAB - -/(AB)*\1/ - ABABAB - -/(?<!bar)foo/ - foo - catfood - arfootle - rfoosh - *** Failers - barfoo - towbarfoo - -/\w{3}(?<!bar)foo/ - catfood - *** Failers - foo - barfoo - towbarfoo - -/(?<=(foo)a)bar/ - fooabar - *** Failers - bar - foobbar - -/\Aabc\z/m - abc - *** Failers - abc\n - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - *** Failers - this is not a line with only words and spaces! - -/(\d+)(\w)/ - 12345a - 12345+ - -/((?>\d+))(\w)/ - 12345a - *** Failers - 12345+ - -/(?>a+)b/ - aaab - -/((?>a+)b)/ - aaab - -/(?>(a+))b/ - aaab - -/(?>b)+/ - aaabbbccc - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - (abc(def)xyz) - *** Failers - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/a(?-i)b/i - ab - Ab - *** Failers - aB - AB - -/(a (?x)b c)d e/ - a bcd e - *** Failers - a b cd e - abcd e - a bcde - -/(a b(?x)c d (?-x)e f)/ - a bcde f - *** Failers - abcdef - -/(a(?i)b)c/ - abc - aBc - *** Failers - abC - aBC - Abc - ABc - ABC - AbC - -/a(?i:b)c/ - abc - aBc - *** Failers - ABC - abC - aBC - -/a(?i:b)*c/ - aBc - aBBc - *** Failers - aBC - aBBC - -/a(?=b(?i)c)\w\wd/ - abcd - abCd - *** Failers - aBCd - abcD - -/(?s-i:more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?:(?s-i)more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?>a(?i)b+)+c/ - abc - aBbc - aBBc - *** Failers - Abc - abAb - abbC - -/(?=a(?i)b)\w\wc/ - abc - aBc - *** Failers - Ab - abC - aBC - -/(?<=a(?i)b)(\w\w)c/ - abxxc - aBxxc - *** Failers - Abxxc - ABxxc - abxxC - -/(?:(a)|b)(?(1)A|B)/ - aA - bB - *** Failers - aB - bA - -/^(a)?(?(1)a|b)+$/ - aa - b - bb - *** Failers - ab - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 12 - *** Failers - 123 - xyz - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 12 - *** Failers - 123 - xyz - -/(?(?<=foo)bar|cat)/ - foobar - cat - fcat - focat - *** Failers - foocat - -/(?(?<!foo)cat|bar)/ - foobar - cat - fcat - focat - *** Failers - foocat - -/( \( )? [^()]+ (?(1) \) |) /x - abcd - (abcd) - the quick (abcd) fox - (abcd - -/( \( )? [^()]+ (?(1) \) ) /x - abcd - (abcd) - the quick (abcd) fox - (abcd - -/^(?(2)a|(1)(2))+$/ - 12 - 12a - 12aa - *** Failers - 1234 - -/((?i)blah)\s+\1/ - blah blah - BLAH BLAH - Blah Blah - blaH blaH - *** Failers - blah BLAH - Blah blah - blaH blah - -/((?i)blah)\s+(?i:\1)/ - blah blah - BLAH BLAH - Blah Blah - blaH blaH - blah BLAH - Blah blah - blaH blah - -/(?>a*)*/ - a - aa - aaaa - -/(abc|)+/ - abc - abcabc - abcabcabc - xyz - -/([a]*)*/ - a - aaaaa - -/([ab]*)*/ - a - b - ababab - aaaabcde - bbbb - -/([^a]*)*/ - b - bbbb - aaa - -/([^ab]*)*/ - cccc - abab - -/([a]*?)*/ - a - aaaa - -/([ab]*?)*/ - a - b - abab - baba - -/([^a]*?)*/ - b - bbbb - aaa - -/([^ab]*?)*/ - c - cccc - baba - -/(?>a*)*/ - a - aaabcde - -/((?>a*))*/ - aaaaa - aabbaa - -/((?>a*?))*/ - aaaaa - aabbaa - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 12-09-98 - *** Failers - sep-12-98 - -/(?<=(foo))bar\1/ - foobarfoo - foobarfootling - *** Failers - foobar - barfoo - -/(?i:saturday|sunday)/ - saturday - sunday - Saturday - Sunday - SATURDAY - SUNDAY - SunDay - -/(a(?i)bc|BB)x/ - abcx - aBCx - bbx - BBx - *** Failers - abcX - aBCX - bbX - BBX - -/^([ab](?i)[cd]|[ef])/ - ac - aC - bD - elephant - Europe - frog - France - *** Failers - Africa - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - aBd - xy - xY - zebra - Zambesi - *** Failers - aCD - XY - -/(?<=foo\n)^bar/m - foo\nbar - *** Failers - bar - baz\nbar - -/(?<=(?<!foo)bar)baz/ - barbaz - barbarbaz - koobarbaz - *** Failers - baz - foobarbaz - -/The case of aaaaaa is missed out below because I think Perl 5.005_02 gets/ -/it wrong; it sets $1 to aaa rather than aa. Compare the following test,/ -/where it does set $1 to aa when matching aaaaaa./ - -/^(a\1?){4}$/ - a - aa - aaa - aaaa - aaaaa - aaaaaaa - aaaaaaaa - aaaaaaaaa - aaaaaaaaaa - aaaaaaaaaaa - aaaaaaaaaaaa - aaaaaaaaaaaaa - aaaaaaaaaaaaaa - aaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaa - -/^(a\1?)(a\1?)(a\2?)(a\3?)$/ - a - aa - aaa - aaaa - aaaaa - aaaaaa - aaaaaaa - aaaaaaaa - aaaaaaaaa - aaaaaaaaaa - aaaaaaaaaaa - aaaaaaaaaaaa - aaaaaaaaaaaaa - aaaaaaaaaaaaaa - aaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaa - -/The following tests are taken from the Perl 5.005 test suite; some of them/ -/are compatible with 5.004, but I'd rather not have to sort them out./ - -/abc/ - abc - xabcy - ababc - *** Failers - xbc - axc - abx - -/ab*c/ - abc - -/ab*bc/ - abc - abbc - abbbbc - -/.{1}/ - abbbbc - -/.{3,4}/ - abbbbc - -/ab{0,}bc/ - abbbbc - -/ab+bc/ - abbc - *** Failers - abc - abq - -/ab{1,}bc/ - -/ab+bc/ - abbbbc - -/ab{1,}bc/ - abbbbc - -/ab{1,3}bc/ - abbbbc - -/ab{3,4}bc/ - abbbbc - -/ab{4,5}bc/ - *** Failers - abq - abbbbc - -/ab?bc/ - abbc - abc - -/ab{0,1}bc/ - abc - -/ab?bc/ - -/ab?c/ - abc - -/ab{0,1}c/ - abc - -/^abc$/ - abc - *** Failers - abbbbc - abcc - -/^abc/ - abcc - -/^abc$/ - -/abc$/ - aabc - *** Failers - aabc - aabcd - -/^/ - abc - -/$/ - abc - -/a.c/ - abc - axc - -/a.*c/ - axyzc - -/a[bc]d/ - abd - *** Failers - axyzd - abc - -/a[b-d]e/ - ace - -/a[b-d]/ - aac - -/a[-b]/ - a- - -/a[b-]/ - a- - -/a]/ - a] - -/a[]]b/ - a]b - -/a[^bc]d/ - aed - *** Failers - abd - abd - -/a[^-b]c/ - adc - -/a[^]b]c/ - adc - *** Failers - a-c - a]c - -/\ba\b/ - a- - -a - -a- - -/\by\b/ - *** Failers - xy - yz - xyz - -/\Ba\B/ - *** Failers - a- - -a - -a- - -/\By\b/ - xy - -/\by\B/ - yz - -/\By\B/ - xyz - -/\w/ - a - -/\W/ - - - *** Failers - - - a - -/a\sb/ - a b - -/a\Sb/ - a-b - *** Failers - a-b - a b - -/\d/ - 1 - -/\D/ - - - *** Failers - - - 1 - -/[\w]/ - a - -/[\W]/ - - - *** Failers - - - a - -/a[\s]b/ - a b - -/a[\S]b/ - a-b - *** Failers - a-b - a b - -/[\d]/ - 1 - -/[\D]/ - - - *** Failers - - - 1 - -/ab|cd/ - abc - abcd - -/()ef/ - def - -/$b/ - -/a\(b/ - a(b - -/a\(*b/ - ab - a((b - -/a\\b/ - a\b - -/((a))/ - abc - -/(a)b(c)/ - abc - -/a+b+c/ - aabbabc - -/a{1,}b{1,}c/ - aabbabc - -/a.+?c/ - abcabc - -/(a+|b)*/ - ab - -/(a+|b){0,}/ - ab - -/(a+|b)+/ - ab - -/(a+|b){1,}/ - ab - -/(a+|b)?/ - ab - -/(a+|b){0,1}/ - ab - -/[^ab]*/ - cde - -/abc/ - *** Failers - b - - -/a*/ - - -/([abc])*d/ - abbbcd - -/([abc])*bcd/ - abcd - -/a|b|c|d|e/ - e - -/(a|b|c|d|e)f/ - ef - -/abcd*efg/ - abcdefg - -/ab*/ - xabyabbbz - xayabbbz - -/(ab|cd)e/ - abcde - -/[abhgefdc]ij/ - hij - -/^(ab|cd)e/ - -/(abc|)ef/ - abcdef - -/(a|b)c*d/ - abcd - -/(ab|ab*)bc/ - abc - -/a([bc]*)c*/ - abc - -/a([bc]*)(c*d)/ - abcd - -/a([bc]+)(c*d)/ - abcd - -/a([bc]*)(c+d)/ - abcd - -/a[bcd]*dcdcde/ - adcdcde - -/a[bcd]+dcdcde/ - *** Failers - abcde - adcdcde - -/(ab|a)b*c/ - abc - -/((a)(b)c)(d)/ - abcd - -/[a-zA-Z_][a-zA-Z0-9_]*/ - alpha - -/^a(bc+|b[eh])g|.h$/ - abh - -/(bc+d$|ef*g.|h?i(j|k))/ - effgz - ij - reffgz - *** Failers - effg - bcdd - -/((((((((((a))))))))))/ - a - -/((((((((((a))))))))))\10/ - aa - -/(((((((((a)))))))))/ - a - -/multiple words of text/ - *** Failers - aa - uh-uh - -/multiple words/ - multiple words, yeah - -/(.*)c(.*)/ - abcde - -/\((.*), (.*)\)/ - (a, b) - -/[k]/ - -/abcd/ - abcd - -/a(bc)d/ - abcd - -/a[-]?c/ - ac - -/(abc)\1/ - abcabc - -/([a-c]*)\1/ - abcabc - -/(a)|\1/ - a - *** Failers - ab - x - -/(([a-c])b*?\2)*/ - ababbbcbc - -/(([a-c])b*?\2){3}/ - ababbbcbc - -/((\3|b)\2(a)x)+/ - aaaxabaxbaaxbbax - -/((\3|b)\2(a)){2,}/ - bbaababbabaaaaabbaaaabba - -/abc/i - ABC - XABCY - ABABC - *** Failers - aaxabxbaxbbx - XBC - AXC - ABX - -/ab*c/i - ABC - -/ab*bc/i - ABC - ABBC - -/ab*?bc/i - ABBBBC - -/ab{0,}?bc/i - ABBBBC - -/ab+?bc/i - ABBC - -/ab+bc/i - *** Failers - ABC - ABQ - -/ab{1,}bc/i - -/ab+bc/i - ABBBBC - -/ab{1,}?bc/i - ABBBBC - -/ab{1,3}?bc/i - ABBBBC - -/ab{3,4}?bc/i - ABBBBC - -/ab{4,5}?bc/i - *** Failers - ABQ - ABBBBC - -/ab??bc/i - ABBC - ABC - -/ab{0,1}?bc/i - ABC - -/ab??bc/i - -/ab??c/i - ABC - -/ab{0,1}?c/i - ABC - -/^abc$/i - ABC - *** Failers - ABBBBC - ABCC - -/^abc/i - ABCC - -/^abc$/i - -/abc$/i - AABC - -/^/i - ABC - -/$/i - ABC - -/a.c/i - ABC - AXC - -/a.*?c/i - AXYZC - -/a.*c/i - *** Failers - AABC - AXYZD - -/a[bc]d/i - ABD - -/a[b-d]e/i - ACE - *** Failers - ABC - ABD - -/a[b-d]/i - AAC - -/a[-b]/i - A- - -/a[b-]/i - A- - -/a]/i - A] - -/a[]]b/i - A]B - -/a[^bc]d/i - AED - -/a[^-b]c/i - ADC - *** Failers - ABD - A-C - -/a[^]b]c/i - ADC - -/ab|cd/i - ABC - ABCD - -/()ef/i - DEF - -/$b/i - *** Failers - A]C - B - -/a\(b/i - A(B - -/a\(*b/i - AB - A((B - -/a\\b/i - A\B - -/((a))/i - ABC - -/(a)b(c)/i - ABC - -/a+b+c/i - AABBABC - -/a{1,}b{1,}c/i - AABBABC - -/a.+?c/i - ABCABC - -/a.*?c/i - ABCABC - -/a.{0,5}?c/i - ABCABC - -/(a+|b)*/i - AB - -/(a+|b){0,}/i - AB - -/(a+|b)+/i - AB - -/(a+|b){1,}/i - AB - -/(a+|b)?/i - AB - -/(a+|b){0,1}/i - AB - -/(a+|b){0,1}?/i - AB - -/[^ab]*/i - CDE - -/abc/i - -/a*/i - - -/([abc])*d/i - ABBBCD - -/([abc])*bcd/i - ABCD - -/a|b|c|d|e/i - E - -/(a|b|c|d|e)f/i - EF - -/abcd*efg/i - ABCDEFG - -/ab*/i - XABYABBBZ - XAYABBBZ - -/(ab|cd)e/i - ABCDE - -/[abhgefdc]ij/i - HIJ - -/^(ab|cd)e/i - ABCDE - -/(abc|)ef/i - ABCDEF - -/(a|b)c*d/i - ABCD - -/(ab|ab*)bc/i - ABC - -/a([bc]*)c*/i - ABC - -/a([bc]*)(c*d)/i - ABCD - -/a([bc]+)(c*d)/i - ABCD - -/a([bc]*)(c+d)/i - ABCD - -/a[bcd]*dcdcde/i - ADCDCDE - -/a[bcd]+dcdcde/i - -/(ab|a)b*c/i - ABC - -/((a)(b)c)(d)/i - ABCD - -/[a-zA-Z_][a-zA-Z0-9_]*/i - ALPHA - -/^a(bc+|b[eh])g|.h$/i - ABH - -/(bc+d$|ef*g.|h?i(j|k))/i - EFFGZ - IJ - REFFGZ - *** Failers - ADCDCDE - EFFG - BCDD - -/((((((((((a))))))))))/i - A - -/((((((((((a))))))))))\10/i - AA - -/(((((((((a)))))))))/i - A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i - A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i - C - -/multiple words of text/i - *** Failers - AA - UH-UH - -/multiple words/i - MULTIPLE WORDS, YEAH - -/(.*)c(.*)/i - ABCDE - -/\((.*), (.*)\)/i - (A, B) - -/[k]/i - -/abcd/i - ABCD - -/a(bc)d/i - ABCD - -/a[-]?c/i - AC - -/(abc)\1/i - ABCABC - -/([a-c]*)\1/i - ABCABC - -/a(?!b)./ - abad - -/a(?=d)./ - abad - -/a(?=c|d)./ - abad - -/a(?:b|c|d)(.)/ - ace - -/a(?:b|c|d)*(.)/ - ace - -/a(?:b|c|d)+?(.)/ - ace - acdbcdbe - -/a(?:b|c|d)+(.)/ - acdbcdbe - -/a(?:b|c|d){2}(.)/ - acdbcdbe - -/a(?:b|c|d){4,5}(.)/ - acdbcdbe - -/a(?:b|c|d){4,5}?(.)/ - acdbcdbe - -/((foo)|(bar))*/ - foobar - -/a(?:b|c|d){6,7}(.)/ - acdbcdbe - -/a(?:b|c|d){6,7}?(.)/ - acdbcdbe - -/a(?:b|c|d){5,6}(.)/ - acdbcdbe - -/a(?:b|c|d){5,6}?(.)/ - acdbcdbe - -/a(?:b|c|d){5,7}(.)/ - acdbcdbe - -/a(?:b|c|d){5,7}?(.)/ - acdbcdbe - -/a(?:b|(c|e){1,2}?|d)+?(.)/ - ace - -/^(.+)?B/ - AB - -/^([^a-z])|(\^)$/ - . - -/^[<>]&/ - <&OUT - -/^(a\1?){4}$/ - aaaaaaaaaa - *** Failers - AB - aaaaaaaaa - aaaaaaaaaaa - -/^(a(?(1)\1)){4}$/ - aaaaaaaaaa - *** Failers - aaaaaaaaa - aaaaaaaaaaa - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - -/(?<=a)b/ - ab - *** Failers - cb - b - -/(?<!c)b/ - ab - b - b - -/(?:..)*a/ - aba - -/(?:..)*?a/ - aba - -/^(?:b|a(?=(.)))*\1/ - abc - -/^(){3,5}/ - abc - -/^(a+)*ax/ - aax - -/^((a|b)+)*ax/ - aax - -/^((a|bc)+)*ax/ - aax - -/(a|x)*ab/ - cab - -/(a)*ab/ - cab - -/(?:(?i)a)b/ - ab - -/((?i)a)b/ - ab - -/(?:(?i)a)b/ - Ab - -/((?i)a)b/ - Ab - -/(?:(?i)a)b/ - *** Failers - cb - aB - -/((?i)a)b/ - -/(?i:a)b/ - ab - -/((?i:a))b/ - ab - -/(?i:a)b/ - Ab - -/((?i:a))b/ - Ab - -/(?i:a)b/ - *** Failers - aB - aB - -/((?i:a))b/ - -/(?:(?-i)a)b/i - ab - -/((?-i)a)b/i - ab - -/(?:(?-i)a)b/i - aB - -/((?-i)a)b/i - aB - -/(?:(?-i)a)b/i - *** Failers - aB - Ab - -/((?-i)a)b/i - -/(?:(?-i)a)b/i - aB - -/((?-i)a)b/i - aB - -/(?:(?-i)a)b/i - *** Failers - Ab - AB - -/((?-i)a)b/i - -/(?-i:a)b/i - ab - -/((?-i:a))b/i - ab - -/(?-i:a)b/i - aB - -/((?-i:a))b/i - aB - -/(?-i:a)b/i - *** Failers - AB - Ab - -/((?-i:a))b/i - -/(?-i:a)b/i - aB - -/((?-i:a))b/i - aB - -/(?-i:a)b/i - *** Failers - Ab - AB - -/((?-i:a))b/i - -/((?-i:a.))b/i - *** Failers - AB - a\nB - -/((?s-i:a.))b/i - a\nB - -/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ - cabbbb - -/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ - caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - -/(ab)\d\1/i - Ab4ab - ab4Ab - -/foo\w*\d{4}baz/ - foobar1234baz - -/x(~~)*(?:(?:F)?)?/ - x~~ - -/^a(?#xxx){3}c/ - aaac - -/^a (?#xxx) (?#yyy) {3}c/x - aaac - -/(?<![cd])b/ - *** Failers - B\nB - dbcb - -/(?<![cd])[ab]/ - dbaacb - -/(?<!(c|d))b/ - -/(?<!(c|d))[ab]/ - dbaacb - -/(?<!cd)[ab]/ - cdaccb - -/^(?:a?b?)*$/ - *** Failers - dbcb - a-- - -/((?s)^a(.))((?m)^b$)/ - a\nb\nc\n - -/((?m)^b$)/ - a\nb\nc\n - -/(?m)^b/ - a\nb\n - -/(?m)^(b)/ - a\nb\n - -/((?m)^b)/ - a\nb\n - -/\n((?m)^b)/ - a\nb\n - -/((?s).)c(?!.)/ - a\nb\nc\n - a\nb\nc\n - -/((?s)b.)c(?!.)/ - a\nb\nc\n - a\nb\nc\n - -/^b/ - -/()^b/ - *** Failers - a\nb\nc\n - a\nb\nc\n - -/((?m)^b)/ - a\nb\nc\n - -/(?(1)a|b)/ - -/(?(1)b|a)/ - a - -/(x)?(?(1)a|b)/ - *** Failers - a - a - -/(x)?(?(1)b|a)/ - a - -/()?(?(1)b|a)/ - a - -/()(?(1)b|a)/ - -/()?(?(1)a|b)/ - a - -/^(\()?blah(?(1)(\)))$/ - (blah) - blah - *** Failers - a - blah) - (blah - -/^(\(+)?blah(?(1)(\)))$/ - (blah) - blah - *** Failers - blah) - (blah - -/(?(?!a)a|b)/ - -/(?(?!a)b|a)/ - a - -/(?(?=a)b|a)/ - *** Failers - a - a - -/(?(?=a)a|b)/ - a - -/(?=(a+?))(\1ab)/ - aaab - -/^(?=(a+?))\1ab/ - -/(\w+:)+/ - one: - -/$(?<=^(a))/ - a - -/(?=(a+?))(\1ab)/ - aaab - -/^(?=(a+?))\1ab/ - *** Failers - aaab - aaab - -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - -/^[^bcd]*(c+)/ - aexycd - -/(a*)b+/ - caab - -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - *** Failers - abcd: - abcd: - -/^[^bcd]*(c+)/ - aexycd - -/(>a+)ab/ - -/(?>a+)b/ - aaab - -/([[:]+)/ - a:[b]: - -/([[=]+)/ - a=[b]= - -/([[.]+)/ - a.[b]. - -/((?>a+)b)/ - aaab - -/(?>(a+))b/ - aaab - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/a\Z/ - *** Failers - aaab - a\nb\n - -/b\Z/ - a\nb\n - -/b\z/ - -/b\Z/ - a\nb - -/b\z/ - a\nb - *** Failers - -/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ - a - abc - a-b - 0-9 - a.b - 5.6.7 - the.quick.brown.fox - a100.b200.300c - 12-ab.1245 - *** Failers - \ - .a - -a - a- - a. - a_b - a.- - a.. - ab..bc - the.quick.brown.fox- - the.quick.brown.fox. - the.quick.brown.fox_ - the.quick.brown.fox+ - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - endingwxyz - *** Failers - a rather long string that doesn't end with one of them - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope - -/(?<=\d{3}(?!999))foo/ - 999foo - 123999foo - *** Failers - 123abcfoo - -/(?<=(?!...999)\d{3})foo/ - 999foo - 123999foo - *** Failers - 123abcfoo - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 123456foo - *** Failers - 123999foo - -/(?<=\d{3}...)(?<!999)foo/ - 123abcfoo - 123456foo - *** Failers - 123999foo - -/<a[\s]+href[\s]*=[\s]* # find <a href= - ([\"\'])? # find single or double quote - (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - <a href=\"abcd xyz pqr\" cats - <a href=\'abcd xyz pqr\' cats - -/<a\s+href\s*=\s* # find <a href= - (["'])? # find single or double quote - (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - <a href=\"abcd xyz pqr\" cats - <a href = \'abcd xyz pqr\' cats - -/<a\s+href(?>\s*)=(?>\s*) # find <a href= - (["'])? # find single or double quote - (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - <a href=\"abcd xyz pqr\" cats - <a href = \'abcd xyz pqr\' cats - -/((Z)+|A)*/ - ZABCDEFG - -/(Z()|A)*/ - ZABCDEFG - -/(Z(())|A)*/ - ZABCDEFG - -/((?>Z)+|A)*/ - ZABCDEFG - -/((?>)+|A)*/ - ZABCDEFG - -/a*/g - abbab - -/^[a-\d]/ - abcde - -things - 0digit - *** Failers - bcdef - -/^[\d-a]/ - abcde - -things - 0digit - *** Failers - bcdef - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - -/a b/x - ab - -/(?!\A)x/m - a\nxb\n - -/(?!^)x/m - a\nxb\n - -/abc\Qabc\Eabc/ - abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc - -/ abc\Q abc\Eabc/x - abc abcabc - *** Failers - abcabcabc - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal - -/\Qabc\$xyz\E/ - abc\\\$xyz - -/\Qabc\E\$\Qxyz\E/ - abc\$xyz - -/\Gabc/ - abc - *** Failers - xyzabc - -/\Gabc./g - abc1abc2xyzabc3 - -/abc./g - abc1abc2xyzabc3 - -/a(?x: b c )d/ - XabcdY - *** Failers - Xa b c d Y - -/((?x)x y z | a b c)/ - XabcY - AxyzB - -/(?i)AB(?-i)C/ - XabCY - *** Failers - XabcY - -/((?i)AB(?-i)C|D)E/ - abCE - DE - *** Failers - abcE - abCe - dE - De - -/(.*)\d+\1/ - abc123abc - abc123bc - -/(.*)\d+\1/s - abc123abc - abc123bc - -/((.*))\d+\1/ - abc123abc - abc123bc - -/-- This tests for an IPv6 address in the form where it can have up to --/ -/-- eight components, one and only one of which is empty. This must be --/ -/-- an internal component. --/ - -/^(?!:) # colon disallowed at start - (?: # start of item - (?: [0-9a-f]{1,4} | # 1-4 hex digits or - (?(1)0 | () ) ) # if null previously matched, fail; else null - : # followed by colon - ){1,7} # end item; 1-7 of them required - [0-9a-f]{1,4} $ # final hex number at end of string - (?(1)|.) # check that there was an empty component - /xi - a123::a123 - a123:b342::abcd - a123:b342::324e:abcd - a123:ddde:b342::324e:abcd - a123:ddde:b342::324e:dcba:abcd - a123:ddde:9999:b342::324e:dcba:abcd - *** Failers - 1:2:3:4:5:6:7:8 - a123:bce:ddde:9999:b342::324e:dcba:abcd - a123::9999:b342::324e:dcba:abcd - abcde:2:3:4:5:6:7:8 - ::1 - abcd:fee0:123:: - :1 - 1: - -/[z\Qa-d]\E]/ - z - a - - - d - ] - *** Failers - b - -/[\z\C]/ - z - C - -/\M/ - M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - regulaer - Regex - regulär - -/Ċĉċä[à-˙À-ß]+/ - Ċĉċäà - Ċĉċä˙ - ĊĉċäÀ - Ċĉċäß - -/(?<=Z)X./ - \x84XAZXB - -/ab cd (?x) de fg/ - ab cd defg - -/ab cd(?x) de fg/ - ab cddefg - ** Failers - abcddefg - -/ End of testinput1 / diff --git a/ext/pcre/pcrelib/testdata/testinput2 b/ext/pcre/pcrelib/testdata/testinput2 deleted file mode 100644 index befb65a4412f4..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput2 +++ /dev/null @@ -1,1453 +0,0 @@ -/(a)b|/ - -/abc/ - abc - defabc - \Aabc - *** Failers - \Adefabc - ABC - -/^abc/ - abc - \Aabc - *** Failers - defabc - \Adefabc - -/a+bc/ - -/a*bc/ - -/a{3}bc/ - -/(abc|a+z)/ - -/^abc$/ - abc - *** Failers - def\nabc - -/ab\gdef/X - -/(?X)ab\gdef/X - -/x{5,4}/ - -/z{65536}/ - -/[abcd/ - -/(?X)[\B]/ - -/[z-a]/ - -/^*/ - -/(abc/ - -/(?# abc/ - -/(?z)abc/ - -/.*b/ - -/.*?b/ - -/cat|dog|elephant/ - this sentence eventually mentions a cat - this sentences rambles on and on for a while and then reaches elephant - -/cat|dog|elephant/S - this sentence eventually mentions a cat - this sentences rambles on and on for a while and then reaches elephant - -/cat|dog|elephant/iS - this sentence eventually mentions a CAT cat - this sentences rambles on and on for a while to elephant ElePhant - -/a|[bcd]/S - -/(a|[^\dZ])/S - -/(a|b)*[\s]/S - -/(ab\2)/ - -/{4,5}abc/ - -/(a)(b)(c)\2/ - abcb - \O0abcb - \O3abcb - \O6abcb - \O9abcb - \O12abcb - -/(a)bc|(a)(b)\2/ - abc - \O0abc - \O3abc - \O6abc - aba - \O0aba - \O3aba - \O6aba - \O9aba - \O12aba - -/abc$/E - abc - *** Failers - abc\n - abc\ndef - -/(a)(b)(c)(d)(e)\6/ - -/the quick brown fox/ - the quick brown fox - this is a line with the quick brown fox - -/the quick brown fox/A - the quick brown fox - *** Failers - this is a line with the quick brown fox - -/ab(?z)cd/ - -/^abc|def/ - abcdef - abcdef\B - -/.*((abc)$|(def))/ - defabc - \Zdefabc - -/abc/P - abc - *** Failers - -/^abc|def/P - abcdef - abcdef\B - -/.*((abc)$|(def))/P - defabc - \Zdefabc - -/the quick brown fox/P - the quick brown fox - *** Failers - The Quick Brown Fox - -/the quick brown fox/Pi - the quick brown fox - The Quick Brown Fox - -/abc.def/P - *** Failers - abc\ndef - -/abc$/P - abc - abc\n - -/(abc)\2/P - -/(abc\1)/P - abc - -/)/ - -/a[]b/ - -/[^aeiou ]{3,}/ - co-processors, and for - -/<.*>/ - abc<def>ghi<klm>nop - -/<.*?>/ - abc<def>ghi<klm>nop - -/<.*>/U - abc<def>ghi<klm>nop - -/(?U)<.*>/ - abc<def>ghi<klm>nop - -/<.*?>/U - abc<def>ghi<klm>nop - -/={3,}/U - abc========def - -/(?U)={3,}?/ - abc========def - -/(?<!bar|cattle)foo/ - foo - catfoo - *** Failers - the barfoo - and cattlefoo - -/(?<=a+)b/ - -/(?<=aaa|b{0,3})b/ - -/(?<!(foo)a\1)bar/ - -/(?i)abc/ - -/(a|(?m)a)/ - -/(?i)^1234/ - -/(^b|(?i)^d)/ - -/(?s).*/ - -/[abcd]/S - -/(?i)[abcd]/S - -/(?m)[xy]|(b|c)/S - -/(^a|^b)/m - -/(?i)(^a|^b)/m - -/(a)(?(1)a|b|c)/ - -/(?(?=a)a|b|c)/ - -/(?(1a)/ - -/(?(?i))/ - -/(?(abc))/ - -/(?(?<ab))/ - -/((?s)blah)\s+\1/ - -/((?i)blah)\s+\1/ - -/((?i)b)/DS - -/(a*b|(?i:c*(?-i)d))/S - -/a$/ - a - a\n - *** Failers - \Za - \Za\n - -/a$/m - a - a\n - \Za\n - *** Failers - \Za - -/\Aabc/m - -/^abc/m - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/ - aaaaabbbbbcccccdef - -/(?<=foo)[ab]/S - -/(?<!foo)(alpha|omega)/S - -/(?!alphabet)[ab]/S - -/(?<=foo\n)^bar/m - foo\nbarbar - ***Failers - rhubarb - barbell - abc\nbarton - -/^(?<=foo\n)bar/m - foo\nbarbar - ***Failers - rhubarb - barbell - abc\nbarton - -/(?>^abc)/m - abc - def\nabc - *** Failers - defabc - -/(?<=ab(c+)d)ef/ - -/(?<=ab(?<=c+)d)ef/ - -/(?<=ab(c|de)f)g/ - -/The next three are in testinput2 because they have variable length branches/ - -/(?<=bullock|donkey)-cart/ - the bullock-cart - a donkey-cart race - *** Failers - cart - horse-and-cart - -/(?<=ab(?i)x|y|z)/ - -/(?>.*)(?<=(abcd)|(xyz))/ - alphabetabcd - endingxyz - -/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/ - abxyZZ - abXyZZ - ZZZ - zZZ - bZZ - BZZ - *** Failers - ZZ - abXYZZ - zzz - bzz - -/(?<!(foo)a)bar/ - bar - foobbar - *** Failers - fooabar - -/This one is here because Perl 5.005_02 doesn't fail it/ - -/^(a)?(?(1)a|b)+$/ - *** Failers - a - -/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/ - -/^(a\1?){4}$/ - aaaaaa - -/These are syntax tests from Perl 5.005/ - -/a[b-a]/ - -/a[]b/ - -/a[/ - -/*a/ - -/(*)b/ - -/abc)/ - -/(abc/ - -/a**/ - -/)(/ - -/\1/ - -/\2/ - -/(a)|\2/ - -/a[b-a]/i - -/a[]b/i - -/a[/i - -/*a/i - -/(*)b/i - -/abc)/i - -/(abc/i - -/a**/i - -/)(/i - -/:(?:/ - -/(?<%)b/ - -/a(?{)b/ - -/a(?{{})b/ - -/a(?{}})b/ - -/a(?{"{"})b/ - -/a(?{"{"}})b/ - -/(?(1?)a|b)/ - -/(?(1)a|b|c)/ - -/[a[:xyz:/ - -/(?<=x+)y/ - -/a{37,17}/ - -/abc/\ - -/abc/\P - -/abc/\i - -/(a)bc(d)/ - abcd - abcd\C2 - abcd\C5 - -/(.{20})/ - abcdefghijklmnopqrstuvwxyz - abcdefghijklmnopqrstuvwxyz\C1 - abcdefghijklmnopqrstuvwxyz\G1 - -/(.{15})/ - abcdefghijklmnopqrstuvwxyz - abcdefghijklmnopqrstuvwxyz\C1\G1 - -/(.{16})/ - abcdefghijklmnopqrstuvwxyz - abcdefghijklmnopqrstuvwxyz\C1\G1\L - -/^(a|(bc))de(f)/ - adef\G1\G2\G3\G4\L - bcdef\G1\G2\G3\G4\L - adefghijk\C0 - -/^abc\00def/ - abc\00def\L\C0 - -/word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ -)((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ -)?)?)?)?)?)?)?)?)?otherword/M - -/.*X/D - -/.*X/Ds - -/(.*X|^B)/D - -/(.*X|^B)/Ds - -/(?s)(.*X|^B)/D - -/(?s:.*X|^B)/D - -/\Biss\B/+ - Mississippi - -/\Biss\B/+P - Mississippi - -/iss/G+ - Mississippi - -/\Biss\B/G+ - Mississippi - -/\Biss\B/g+ - Mississippi - *** Failers - Mississippi\A - -/(?<=[Ms])iss/g+ - Mississippi - -/(?<=[Ms])iss/G+ - Mississippi - -/^iss/g+ - ississippi - -/.*iss/g+ - abciss\nxyzisspqr - -/.i./+g - Mississippi - Mississippi\A - Missouri river - Missouri river\A - -/^.is/+g - Mississippi - -/^ab\n/g+ - ab\nab\ncd - -/^ab\n/mg+ - ab\nab\ncd - -/abc/ - -/abc|bac/ - -/(abc|bac)/ - -/(abc|(c|dc))/ - -/(abc|(d|de)c)/ - -/a*/ - -/a+/ - -/(baa|a+)/ - -/a{0,3}/ - -/baa{3,}/ - -/"([^\\"]+|\\.)*"/ - -/(abc|ab[cd])/ - -/(a|.)/ - -/a|ba|\w/ - -/abc(?=pqr)/ - -/...(?<=abc)/ - -/abc(?!pqr)/ - -/ab./ - -/ab[xyz]/ - -/abc*/ - -/ab.c*/ - -/a.c*/ - -/.c*/ - -/ac*/ - -/(a.c*|b.c*)/ - -/a.c*|aba/ - -/.+a/ - -/(?=abcda)a.*/ - -/(?=a)a.*/ - -/a(b)*/ - -/a\d*/ - -/ab\d*/ - -/a(\d)*/ - -/abcde{0,0}/ - -/ab\d+/ - -/a(?(1)b)/ - -/a(?(1)bag|big)/ - -/a(?(1)bag|big)*/ - -/a(?(1)bag|big)+/ - -/a(?(1)b..|b..)/ - -/ab\d{0}e/ - -/a?b?/ - a - b - ab - \ - *** Failers - \N - -/|-/ - abcd - -abc - \Nab-c - *** Failers - \Nabc - -/a*(b+)(z)(z)/P - aaaabbbbzzzz - aaaabbbbzzzz\O0 - aaaabbbbzzzz\O1 - aaaabbbbzzzz\O2 - aaaabbbbzzzz\O3 - aaaabbbbzzzz\O4 - aaaabbbbzzzz\O5 - -/^.?abcd/S - -/\( # ( at start - (?: # Non-capturing bracket - (?>[^()]+) # Either a sequence of non-brackets (no backtracking) - | # Or - (?R) # Recurse - i.e. nested bracketed string - )* # Zero or more contents - \) # Closing ) - /x - (abcd) - (abcd)xyz - xyz(abcd) - (ab(xy)cd)pqr - (ab(xycd)pqr - () abc () - 12(abcde(fsh)xyz(foo(bar))lmno)89 - *** Failers - abcd - abcd) - (abcd - -/\( ( (?>[^()]+) | (?R) )* \) /xg - (ab(xy)cd)pqr - 1(abcd)(x(y)z)pqr - -/\( (?: (?>[^()]+) | (?R) ) \) /x - (abcd) - (ab(xy)cd) - (a(b(c)d)e) - ((ab)) - *** Failers - () - -/\( (?: (?>[^()]+) | (?R) )? \) /x - () - 12(abcde(fsh)xyz(foo(bar))lmno)89 - -/\( ( (?>[^()]+) | (?R) )* \) /x - (ab(xy)cd) - -/\( ( ( (?>[^()]+) | (?R) )* ) \) /x - (ab(xy)cd) - -/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x - (ab(xy)cd) - (123ab(xy)cd) - -/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x - (ab(xy)cd) - (123ab(xy)cd) - -/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x - (ab(xy)cd) - -/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x - (abcd(xyz<p>qrs)123) - -/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x - (ab(cd)ef) - (ab(cd(ef)gh)ij) - -/^[[:alnum:]]/D - -/^[[:^alnum:]]/D - -/^[[:alpha:]]/D - -/^[[:^alpha:]]/D - -/^[[:ascii:]]/D - -/^[[:^ascii:]]/D - -/^[[:blank:]]/D - -/^[[:cntrl:]]/D - -/^[[:digit:]]/D - -/^[[:graph:]]/D - -/^[[:lower:]]/D - -/^[[:print:]]/D - -/^[[:punct:]]/D - -/^[[:space:]]/D - -/^[[:upper:]]/D - -/^[[:xdigit:]]/D - -/^[[:word:]]/D - -/^[[:^cntrl:]]/D - -/^[12[:^digit:]]/D - -/^[[:^blank:]]/D - -/[01[:alpha:]%]/D - -/[[.ch.]]/ - -/[[=ch=]]/ - -/[[:rhubarb:]]/ - -/[[:upper:]]/i - A - a - -/[[:lower:]]/i - A - a - -/((?-i)[[:lower:]])[[:lower:]]/i - ab - aB - *** Failers - Ab - AB - -/[\200-\410]/ - -/^(?(0)f|b)oo/ - -/This one's here because of the large output vector needed/ - -/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/ - \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC - -/This one's here because Perl does this differently and PCRE can't at present/ - -/(main(O)?)+/ - mainmain - mainOmain - -/These are all cases where Perl does it differently (nested captures)/ - -/^(a(b)?)+$/ - aba - -/^(aa(bb)?)+$/ - aabbaa - -/^(aa|aa(bb))+$/ - aabbaa - -/^(aa(bb)??)+$/ - aabbaa - -/^(?:aa(bb)?)+$/ - aabbaa - -/^(aa(b(b))?)+$/ - aabbaa - -/^(?:aa(b(b))?)+$/ - aabbaa - -/^(?:aa(b(?:b))?)+$/ - aabbaa - -/^(?:aa(bb(?:b))?)+$/ - aabbbaa - -/^(?:aa(b(?:bb))?)+$/ - aabbbaa - -/^(?:aa(?:b(b))?)+$/ - aabbaa - -/^(?:aa(?:b(bb))?)+$/ - aabbbaa - -/^(aa(b(bb))?)+$/ - aabbbaa - -/^(aa(bb(bb))?)+$/ - aabbbbaa - -/--------------------------------------------------------------------/ - -/#/xMD - -/a#/xMD - -/[\s]/D - -/[\S]/D - -/a(?i)b/D - ab - aB - *** Failers - AB - -/(a(?i)b)/D - ab - aB - *** Failers - AB - -/ (?i)abc/xD - -/#this is a comment - (?i)abc/xD - -/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D - -/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D - -/\Q\E/D - \ - -/\Q\Ex/D - -/ \Q\E/D - -/a\Q\E/D - abc - bca - bac - -/a\Q\Eb/D - abc - -/\Q\Eabc/D - -/x*+\w/D - *** Failers - xxxxx - -/x?+/D - -/x++/D - -/x{1,3}+/D - -/(x)*+/D - -/^(\w++|\s++)*$/ - now is the time for all good men to come to the aid of the party - *** Failers - this is not a line with only words and spaces! - -/(\d++)(\w)/ - 12345a - *** Failers - 12345+ - -/a++b/ - aaab - -/(a++b)/ - aaab - -/(a++)b/ - aaab - -/([^()]++|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/\(([^()]++|\([^()]+\))+\)/ - (abc) - (abc(def)xyz) - *** Failers - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/(abc){1,3}+/D - -/a+?+/ - -/a{2,3}?+b/ - -/(?U)a+?+/ - -/a{2,3}?+b/U - -/x(?U)a++b/D - xaaaab - -/(?U)xa++b/D - xaaaab - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/D - -/^x(?U)a+b/D - -/^x(?U)(a+)b/D - -/[.x.]/ - -/[=x=]/ - -/[:x:]/ - -/\l/ - -/\L/ - -/\N{name}/ - -/\u/ - -/\U/ - -/[/ - -/[a-/ - -/[[:space:]/ - -/[\s]/DM - -/[[:space:]]/DM - -/[[:space:]abcde]/DM - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x - <> - <abcd> - <abc <123> hij> - <abc <def> hij> - <abc<>def> - <abc<> - *** Failers - <abc - -|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM - -|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM - -/(.*)\d+\1/I - -/(.*)\d+/I - -/(.*)\d+\1/Is - -/(.*)\d+/Is - -/(.*(xyz))\d+\2/I - -/((.*))\d+\1/I - abc123bc - -/a[b]/I - -/(?=a).*/I - -/(?=abc).xyz/iI - -/(?=abc)(?i).xyz/I - -/(?=a)(?=b)/I - -/(?=.)a/I - -/((?=abcda)a)/I - -/((?=abcda)ab)/I - -/()a/I - -/(?(1)ab|ac)/I - -/(?(1)abz|acz)/I - -/(?(1)abz)/I - -/(?(1)abz)123/I - -/(a)+/I - -/(a){2,3}/I - -/(a)*/I - -/[a]/I - -/[ab]/I - -/[ab]/IS - -/[^a]/I - -/\d456/I - -/\d456/IS - -/a^b/I - -/^a/mI - abcde - xy\nabc - *** Failers - xyabc - -/c|abc/I - -/(?i)[ab]/IS - -/[ab](?i)cd/IS - -/abc(?C)def/ - abcdef - 1234abcdef - *** Failers - abcxyz - abcxyzf - -/abc(?C)de(?C1)f/ - 123abcdef - -/(?C1)\dabc(?C2)def/ - 1234abcdef - *** Failers - abcdef - -/(?C255)ab/ - -/(?C256)ab/ - -/(?Cab)xx/ - -/(?C12vr)x/ - -/abc(?C)def/ - *** Failers - \x83\x0\x61bcdef - -/(abc)(?C)de(?C1)f/ - 123abcdef - 123abcdef\C+ - 123abcdef\C- - *** Failers - 123abcdef\C!1 - -/(?C0)(abc(?C1))*/ - abcabcabc - abcabc\C!1!3 - *** Failers - abcabcabc\C!1!3 - -/(\d{3}(?C))*/ - 123\C+ - 123456\C+ - 123456789\C+ - -/((xyz)(?C)p|(?C1)xyzabc)/ - xyzabc\C+ - -/(X)((xyz)(?C)p|(?C1)xyzabc)/ - Xxyzabc\C+ - -/(?=(abc))(?C)abcdef/ - abcdef\C+ - -/(?!(abc)(?C1)d)(?C2)abcxyz/ - abcxyz\C+ - -/(?<=(abc)(?C))xyz/ - abcxyz\C+ - -/a(b+)(c*)(?C1)/ - abbbbbccc\C*1 - -/a(b+?)(c*?)(?C1)/ - abbbbbccc\C*1 - -/(?C)abc/ - -/(?C)^abc/ - -/(?C)a|b/S - -/(?R)/ - -/(a|(?R))/ - -/(ab|(bc|(de|(?R))))/ - -/x(ab|(bc|(de|(?R))))/ - xab - xbc - xde - xxab - xxxab - *** Failers - xyab - -/(ab|(bc|(de|(?1))))/ - -/x(ab|(bc|(de|(?1)x)x)x)/ - -/^([^()]|\((?1)*\))*$/ - abc - a(b)c - a(b(c))d - *** Failers) - a(b(c)d - -/^>abc>([^()]|\((?1)*\))*<xyz<$/ - >abc>123<xyz< - >abc>1(2)3<xyz< - >abc>(1(2)3)<xyz< - -/(a(?1)b)/D - -/(a(?1)+b)/D - -/^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/i - 1221 - Satan, oscillate my metallic sonatas! - A man, a plan, a canal: Panama! - Able was I ere I saw Elba. - *** Failers - The quick brown fox - -/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ - 12 - (((2+2)*-3)-7) - -12 - *** Failers - ((2+2)*-3)-7) - -/^(x(y|(?1){2})z)/ - xyz - xxyzxyzz - *** Failers - xxyzz - xxyzxyzxyzz - -/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x - <> - <abcd> - <abc <123> hij> - <abc <def> hij> - <abc<>def> - <abc<> - *** Failers - <abc - -/(?1)/ - -/((?2)(abc)/ - -/^(abc)def(?1)/ - abcdefabc - -/^(a|b|c)=(?1)+/ - a=a - a=b - a=bc - -/^(a|b|c)=((?1))+/ - a=a - a=b - a=bc - -/a(?P<name1>b|c)d(?P<longername2>e)/D - abde - acde - -/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/D - -/(?P<a>a)...(?P=a)bbb(?P>a)d/D - -/^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/i - 1221 - Satan, oscillate my metallic sonatas! - A man, a plan, a canal: Panama! - Able was I ere I saw Elba. - *** Failers - The quick brown fox - -/((?(R)a|b))\1(?1)?/ - bb - bbaa - -/(.*)a/sI - -/(.*)a\1/sI - -/(.*)a(b)\2/sI - -/((.*)a|(.*)b)z/sI - -/((.*)a|(.*)b)z\1/sI - -/((.*)a|(.*)b)z\2/sI - -/((.*)a|(.*)b)z\3/sI - -/((.*)a|^(.*)b)z\3/sI - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/sI - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/sI - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/sI - -/(a)(bc)/ND - abc - -/(?P<one>a)(bc)/ND - abc - -/(a)(?P<named>bc)/ND - -/(a+)*zz/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M - aaaaaaaaaaaaaz\M - -/(aaa(?C1)bbb|ab)/ - aaabbb - aaabbb\C*0 - aaabbb\C*1 - aaabbb\C*-1 - -/ab(?P<one>cd)ef(?P<two>gh)/ - abcdefgh - abcdefgh\C1\Gtwo - abcdefgh\Cone\Ctwo - abcdefgh\Cthree - -/(?P<Tes>)(?P<Test>)/D - -/(?P<Test>)(?P<Tes>)/D - -/(?P<Z>zz)(?P<A>aa)/ - zzaa\CZ - zzaa\CA - -/(?P<x>eks)(?P<x>eccs)/ - -/(?P<abc>abc(?P<def>def)(?P<abc>xyz))/ - -"\[((?P<elem>\d+)(,(?P>elem))*)\]" - [10,20,30,5,5,4,4,2,43,23,4234] - *** Failers - [] - -"\[((?P<elem>\d+)(,(?P>elem))*)?\]" - [10,20,30,5,5,4,4,2,43,23,4234] - [] - -/(a(b(?2)c))?/D - -/(a(b(?2)c))*/D - -/(a(b(?2)c)){0,2}/D - -/[ab]{1}+/D - -/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/i - Baby Bjorn Active Carrier - With free SHIPPING!! - -/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/iS - Baby Bjorn Active Carrier - With free SHIPPING!! - -/a*.*b/SD - -/(a|b)*.?c/SD - -/abc(?C255)de(?C)f/D - -/abcde/CD - abcde - abcdfe - -/a*b/CD - ab - aaaab - aaaacb - -/a+b/CD - ab - aaaab - aaaacb - -/(abc|def)x/CD - abcx - defx - abcdefzx - -/(ab|cd){3,4}/C - ababab - abcdabcd - abcdcdcdcdcd - -/([ab]{,4}c|xy)/CD - Note: that { does NOT introduce a quantifier - -/([ab]{1,4}c|xy){4,5}?123/CD - aacaacaacaacaac123 - -/\b.*/I - ab cd\>1 - -/\b.*/Is - ab cd\>1 - -/(?!.bcd).*/I - Xbcd12345 - -/abcde/ - ab\P - abc\P - abcd\P - abcde\P - the quick brown abc\P - ** Failers\P - the quick brown abxyz fox\P - -"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$" - 13/05/04\P - 13/5/2004\P - 02/05/09\P - 1\P - 1/2\P - 1/2/0\P - 1/2/04\P - 0\P - 02/\P - 02/0\P - 02/1\P - ** Failers\P - \P - 123\P - 33/4/04\P - 3/13/04\P - 0/1/2003\P - 0/\P - 02/0/\P - 02/13\P - -/0{0,2}ABC/I - -/\d{3,}ABC/I - -/\d*ABC/I - -/[abc]+DE/I - -/[abc]?123/ - 123\P - a\P - b\P - c\P - c12\P - c123\P - -/^(?:\d){3,5}X/ - 1\P - 123\P - 123X - 1234\P - 1234X - 12345\P - 12345X - *** Failers - 1X - 123456\P - -/abc/>testsavedregex -<testsavedregex - abc - ** Failers - bca - -/abc/F>testsavedregex -<testsavedregex - abc - ** Failers - bca - -/(a|b)/S>testsavedregex -<testsavedregex - abc - ** Failers - def - -/(a|b)/SF>testsavedregex -<testsavedregex - abc - ** Failers - def - -~<(\w+)/?>(.)*</(\1)>~smg - <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite> - -/^a/IF - -/line\nbreak/ - this is a line\nbreak - line one\nthis is a line\nbreak in the second line - -/line\nbreak/f - this is a line\nbreak - ** Failers - line one\nthis is a line\nbreak in the second line - -/line\nbreak/mf - this is a line\nbreak - ** Failers - line one\nthis is a line\nbreak in the second line - -/ab.cd/P - ab-cd - ab=cd - ** Failers - ab\ncd - -/ab.cd/Ps - ab-cd - ab=cd - ab\ncd - -/(?i)(?-i)AbCd/ - AbCd - ** Failers - abcd - -/a{11111111111111111111}/ - -/(){64294967295}/ - -/(){2,4294967295}/ - -"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B" - abcdefghijklAkB - -"(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B" - abcdefghijklAkB - -"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B" - abcdefghijklAkB - -"(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)" - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -"(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)" - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/ End of testinput2 / diff --git a/ext/pcre/pcrelib/testdata/testinput3 b/ext/pcre/pcrelib/testdata/testinput3 deleted file mode 100644 index c2abdbfdb55c1..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput3 +++ /dev/null @@ -1,65 +0,0 @@ -/^[\w]+/ - *** Failers - École - -/^[\w]+/Lfr_FR - École - -/^[\w]+/ - *** Failers - École - -/^[\W]+/ - École - -/^[\W]+/Lfr_FR - *** Failers - École - -/[\b]/ - \b - *** Failers - a - -/[\b]/Lfr_FR - \b - *** Failers - a - -/^\w+/ - *** Failers - École - -/^\w+/Lfr_FR - École - -/(.+)\b(.+)/ - École - -/(.+)\b(.+)/Lfr_FR - *** Failers - École - -/École/i - École - *** Failers - école - -/École/iLfr_FR - École - école - -/\w/IS - -/\w/ISLfr_FR - -/^[\xc8-\xc9]/iLfr_FR - École - école - -/^[\xc8-\xc9]/Lfr_FR - École - *** Failers - école - -/ End of testinput3 / diff --git a/ext/pcre/pcrelib/testdata/testinput4 b/ext/pcre/pcrelib/testdata/testinput4 deleted file mode 100644 index c16e9d9983bbd..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput4 +++ /dev/null @@ -1,513 +0,0 @@ -/-- Do not use the \x{} construct except with patterns that have the --/ -/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ -/-- that option is set. However, the latest Perls recognize them always. --/ - -/a.b/8 - acb - a\x7fb - a\x{100}b - *** Failers - a\nb - -/a(.{3})b/8 - a\x{4000}xyb - a\x{4000}\x7fyb - a\x{4000}\x{100}yb - *** Failers - a\x{4000}b - ac\ncb - -/a(.*?)(.)/ - a\xc0\x88b - -/a(.*?)(.)/8 - a\x{100}b - -/a(.*)(.)/ - a\xc0\x88b - -/a(.*)(.)/8 - a\x{100}b - -/a(.)(.)/ - a\xc0\x92bcd - -/a(.)(.)/8 - a\x{240}bcd - -/a(.?)(.)/ - a\xc0\x92bcd - -/a(.?)(.)/8 - a\x{240}bcd - -/a(.??)(.)/ - a\xc0\x92bcd - -/a(.??)(.)/8 - a\x{240}bcd - -/a(.{3})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - *** Failers - a\x{1234}b - ac\ncb - -/a(.{3,})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers - a\x{1234}b - -/a(.{3,}?)b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers - a\x{1234}b - -/a(.{3,5})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - axxxxxbcdefghijb - *** Failers - a\x{1234}b - axxxxxxbcdefghijb - -/a(.{3,5}?)b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - axxxxxbcdefghijb - *** Failers - a\x{1234}b - axxxxxxbcdefghijb - -/^[a\x{c0}]/8 - *** Failers - \x{100} - -/(?<=aXb)cd/8 - aXbcd - -/(?<=a\x{100}b)cd/8 - a\x{100}bcd - -/(?<=a\x{100000}b)cd/8 - a\x{100000}bcd - -/(?:\x{100}){3}b/8 - \x{100}\x{100}\x{100}b - *** Failers - \x{100}\x{100}b - -/\x{ab}/8 - \x{ab} - \xc2\xab - *** Failers - \x00{ab} - -/(?<=(.))X/8 - WXYZ - \x{256}XYZ - *** Failers - XYZ - -/X(\C{3})/8 - X\x{1234} - -/X(\C{4})/8 - X\x{1234}YZ - -/X\C*/8 - XYZabcdce - -/X\C*?/8 - XYZabcde - -/X\C{3,5}/8 - Xabcdefg - X\x{1234} - X\x{1234}YZ - X\x{1234}\x{512} - X\x{1234}\x{512}YZ - -/X\C{3,5}?/8 - Xabcdefg - X\x{1234} - X\x{1234}YZ - X\x{1234}\x{512} - -/[^a]+/8g - bcd - \x{100}aY\x{256}Z - -/^[^a]{2}/8 - \x{100}bc - -/^[^a]{2,}/8 - \x{100}bcAa - -/^[^a]{2,}?/8 - \x{100}bca - -/[^a]+/8ig - bcd - \x{100}aY\x{256}Z - -/^[^a]{2}/8i - \x{100}bc - -/^[^a]{2,}/8i - \x{100}bcAa - -/^[^a]{2,}?/8i - \x{100}bca - -/\x{100}{0,0}/8 - abcd - -/\x{100}?/8 - abcd - \x{100}\x{100} - -/\x{100}{0,3}/8 - \x{100}\x{100} - \x{100}\x{100}\x{100}\x{100} - -/\x{100}*/8 - abce - \x{100}\x{100}\x{100}\x{100} - -/\x{100}{1,1}/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}{1,3}/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}+/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}{3}/8 - abcd\x{100}\x{100}\x{100}XX - -/\x{100}{3,5}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - -/\x{100}{3,}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - -/(?<=a\x{100}{2}b)X/8+ - Xyyya\x{100}\x{100}bXzzz - -/\D*/8 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\D*/8 - \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/\D/8 - 1X2 - 1\x{100}2 - -/>\S/8 - > >X Y - > >\x{100} Y - -/\d/8 - \x{100}3 - -/\s/8 - \x{100} X - -/\D+/8 - 12abcd34 - *** Failers - 1234 - -/\D{2,3}/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 - -/\D{2,3}?/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 - -/\d+/8 - 12abcd34 - *** Failers - -/\d{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 - -/\d{2,3}?/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 - -/\S+/8 - 12abcd34 - *** Failers - \ \ - -/\S{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - \ \ - -/\S{2,3}?/8 - 12abcd34 - 1234abcd - *** Failers - \ \ - -/>\s+</8+ - 12> <34 - *** Failers - -/>\s{2,3}</8+ - ab> <cd - ab> <ce - *** Failers - ab> <cd - -/>\s{2,3}?</8+ - ab> <cd - ab> <ce - *** Failers - ab> <cd - -/\w+/8 - 12 34 - *** Failers - +++=*! - -/\w{2,3}/8 - ab cd - abcd ce - *** Failers - a.b.c - -/\w{2,3}?/8 - ab cd - abcd ce - *** Failers - a.b.c - -/\W+/8 - 12====34 - *** Failers - abcd - -/\W{2,3}/8 - ab====cd - ab==cd - *** Failers - a.b.c - -/\W{2,3}?/8 - ab====cd - ab==cd - *** Failers - a.b.c - -/[\x{100}]/8 - \x{100} - Z\x{100} - \x{100}Z - *** Failers - -/[Z\x{100}]/8 - Z\x{100} - \x{100} - \x{100}Z - *** Failers - -/[\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - *** Failers - -/[\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - *** Failers - -/[z-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - *** Failers - -/[Q\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - Q? - *** Failers - -/[Q\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - Q? - *** Failers - -/[Qz-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - Q? - *** Failers - -/[\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[Q\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[Q\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/(?<=[\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X - *** Failers - X - -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X - abQX - *** Failers - X - -/(?<=[\x{100}\x{200}]{3})X/8 - abc\x{100}\x{200}\x{100}X - *** Failers - abc\x{200}X - X - -/[^\x{100}\x{200}]X/8 - AX - \x{150}X - \x{500}X - *** Failers - \x{100}X - \x{200}X - -/[^Q\x{100}\x{200}]X/8 - AX - \x{150}X - \x{500}X - *** Failers - \x{100}X - \x{200}X - QX - -/[^\x{100}-\x{200}]X/8 - AX - \x{500}X - *** Failers - \x{100}X - \x{150}X - \x{200}X - -/a\Cb/ - aXb - a\nb - -/a\Cb/8 - aXb - a\nb - *** Failers - a\x{100}b - -/[z-\x{100}]/8i - z - Z - \x{100} - *** Failers - \x{102} - y - -/[\xFF]/ - >\xff< - -/[\xff]/8 - >\x{ff}< - -/[^\xFF]/ - XYZ - -/[^\xff]/8 - XYZ - \x{123} - -/^[ac]*b/8 - xb - -/^[ac\x{100}]*b/8 - xb - -/^[^x]*b/8i - xb - -/^[^x]*b/8 - xb - -/^\d*b/8 - xb - -/(|a)/g8 - catac - a\x{256}a - -/^\x{85}$/8i - \x{85} - -/ End of testinput4 / diff --git a/ext/pcre/pcrelib/testdata/testinput5 b/ext/pcre/pcrelib/testdata/testinput5 deleted file mode 100644 index fe6ee3e65652b..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput5 +++ /dev/null @@ -1,263 +0,0 @@ -/\x{100}/8DM - -/\x{1000}/8DM - -/\x{10000}/8DM - -/\x{100000}/8DM - -/\x{1000000}/8DM - -/\x{4000000}/8DM - -/\x{7fffFFFF}/8DM - -/[\x{ff}]/8DM - -/[\x{100}]/8DM - -/\x{ffffffff}/8 - -/\x{100000000}/8 - -/^\x{100}a\x{1234}/8 - \x{100}a\x{1234}bcd - -/\x80/8D - -/\xff/8D - -/\x{0041}\x{2262}\x{0391}\x{002e}/D8 - \x{0041}\x{2262}\x{0391}\x{002e} - -/\x{D55c}\x{ad6d}\x{C5B4}/D8 - \x{D55c}\x{ad6d}\x{C5B4} - -/\x{65e5}\x{672c}\x{8a9e}/D8 - \x{65e5}\x{672c}\x{8a9e} - -/\x{80}/D8 - -/\x{084}/D8 - -/\x{104}/D8 - -/\x{861}/D8 - -/\x{212ab}/D8 - -/.{3,5}X/D8 - \x{212ab}\x{212ab}\x{212ab}\x{861}X - - -/.{3,5}?/D8 - \x{212ab}\x{212ab}\x{212ab}\x{861} - -/-- These tests are here rather than in testinput4 because Perl 5.6 has --/ -/-- some problems with UTF-8 support, in the area of \x{..} where the --/ -/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ - -/^[a\x{c0}]b/8 - \x{c0}b - -/^([a\x{c0}]*?)aa/8 - a\x{c0}aaaa/ - -/^([a\x{c0}]*?)aa/8 - a\x{c0}aaaa/ - a\x{c0}a\x{c0}aaa/ - -/^([a\x{c0}]*)aa/8 - a\x{c0}aaaa/ - a\x{c0}a\x{c0}aaa/ - -/^([a\x{c0}]*)a\x{c0}/8 - a\x{c0}aaaa/ - a\x{c0}a\x{c0}aaa/ - -/-- --/ - -/(?<=\C)X/8 - Should produce an error diagnostic - -/-- This one is here not because it's different to Perl, but because the --/ -/-- way the captured single-byte is displayed. (In Perl it becomes a --/ -/-- character, and you can't tell the difference.) --/ - -/X(\C)(.*)/8 - X\x{1234} - X\nabc - -/^[ab]/8D - bar - *** Failers - c - \x{ff} - \x{100} - -/^[^ab]/8D - c - \x{ff} - \x{100} - *** Failers - aaa - -/[^ab\xC0-\xF0]/8SD - \x{f1} - \x{bf} - \x{100} - \x{1000} - *** Failers - \x{c0} - \x{f0} - -/Ā{3,4}/8SD - \x{100}\x{100}\x{100}\x{100\x{100} - -/(\x{100}+|x)/8SD - -/(\x{100}*a|x)/8SD - -/(\x{100}{0,2}a|x)/8SD - -/(\x{100}{1,2}a|x)/8SD - -/\x{100}*(\d+|"(?1)")/8 - 1234 - "1234" - \x{100}1234 - "\x{100}1234" - \x{100}\x{100}12ab - \x{100}\x{100}"12" - *** Failers - \x{100}\x{100}abcd - -/\x{100}/8D - -/\x{100}*/8D - -/a\x{100}*/8D - -/ab\x{100}*/8D - -/a\x{100}\x{101}*/8D - -/a\x{100}\x{101}+/8D - -/\x{100}*A/8D - A - -/\x{100}*\d(?R)/8D - -/[^\x{c4}]/D - -/[^\x{c4}]/8D - -/[\x{100}]/8DM - \x{100} - Z\x{100} - \x{100}Z - *** Failers - -/[Z\x{100}]/8DM - Z\x{100} - \x{100} - \x{100}Z - *** Failers - -/[\x{200}-\x{100}]/8 - -/[Ā-Ą]/8 - \x{100} - \x{104} - *** Failers - \x{105} - \x{ff} - -/[z-\x{100}]/8D - -/[z\Qa-d]Ā\E]/8D - \x{100} - Ā - -/[\xFF]/D - >\xff< - -/[\xff]/D8 - >\x{ff}< - -/[^\xFF]/D - -/[^\xff]/8D - -/[„-œ]/8 - – # Matches without Study - \x{d6} - -/[„-œ]/8S - – <-- Same with Study - \x{d6} - -/[\x{c4}-\x{dc}]/8 - – # Matches without Study - \x{d6} - -/[\x{c4}-\x{dc}]/8S - – <-- Same with Study - \x{d6} - -/[]/8 - -//8 - -/xxx/8 - -/xxx/8?D - -/abc/8 - ] - - - \? - -/anything/8 - \xc0\x80 - \xc1\x8f - \xe0\x9f\x80 - \xf0\x8f\x80\x80 - \xf8\x87\x80\x80\x80 - \xfc\x83\x80\x80\x80\x80 - \xfe\x80\x80\x80\x80\x80 - \xff\x80\x80\x80\x80\x80 - \xc3\x8f - \xe0\xaf\x80 - \xe1\x80\x80 - \xf0\x9f\x80\x80 - \xf1\x8f\x80\x80 - \xf8\x88\x80\x80\x80 - \xf9\x87\x80\x80\x80 - \xfc\x84\x80\x80\x80\x80 - \xfd\x83\x80\x80\x80\x80 - -/\x{100}abc(xyz(?1))/8D - -/[^\x{100}]abc(xyz(?1))/8D - -/[ab\x{100}]abc(xyz(?1))/8D - -/(\x{100}(b(?2)c))?/D8 - -/(\x{100}(b(?2)c)){0,2}/D8 - -/(\x{100}(b(?1)c))?/D8 - -/(\x{100}(b(?1)c)){0,2}/D8 - -/\W/8 - A.B - A\x{100}B - -/\w/8 - \x{100}X - -/ End of testinput5 / diff --git a/ext/pcre/pcrelib/testdata/testinput6 b/ext/pcre/pcrelib/testdata/testinput6 deleted file mode 100644 index 01a39477ac45a..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput6 +++ /dev/null @@ -1,517 +0,0 @@ -/^\pC\pL\pM\pN\pP\pS\pZ</8 - \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - \np\x{300}9!\$ < - ** Failers - ap\x{300}9!\$ < - -/^\PC/8 - X - ** Failers - \x7f - -/^\PL/8 - 9 - ** Failers - \x{c0} - -/^\PM/8 - X - ** Failers - \x{30f} - -/^\PN/8 - X - ** Failers - \x{660} - -/^\PP/8 - X - ** Failers - \x{66c} - -/^\PS/8 - X - ** Failers - \x{f01} - -/^\PZ/8 - X - ** Failers - \x{1680} - -/^\p{Cc}/8 - \x{017} - \x{09f} - ** Failers - \x{0600} - -/^\p{Cf}/8 - \x{601} - ** Failers - \x{09f} - -/^\p{Cn}/8 - ** Failers - \x{09f} - -/^\p{Co}/8 - \x{f8ff} - ** Failers - \x{09f} - -/^\p{Cs}/8 - \x{dfff} - ** Failers - \x{09f} - -/^\p{Ll}/8 - a - ** Failers - Z - \x{dfff} - -/^\p{Lm}/8 - \x{2b0} - ** Failers - a - -/^\p{Lo}/8 - \x{1bb} - ** Failers - a - \x{2b0} - -/^\p{Lt}/8 - \x{1c5} - ** Failers - a - \x{2b0} - -/^\p{Lu}/8 - A - ** Failers - \x{2b0} - -/^\p{Mc}/8 - \x{903} - ** Failers - X - \x{300} - -/^\p{Me}/8 - \x{488} - ** Failers - X - \x{903} - \x{300} - -/^\p{Mn}/8 - \x{300} - ** Failers - X - \x{903} - -/^\p{Nd}+/8 - 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a} - \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa} - \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970} - ** Failers - X - -/^\p{Nl}/8 - \x{16ee} - ** Failers - X - \x{966} - -/^\p{No}/8 - \x{b2} - \x{b3} - ** Failers - X - \x{16ee} - -/^\p{Pc}/8 - \x5f - \x{203f} - ** Failers - X - - - \x{58a} - -/^\p{Pd}/8 - - - \x{58a} - ** Failers - X - \x{203f} - -/^\p{Pe}/8 - ) - ] - } - \x{f3b} - ** Failers - X - \x{203f} - ( - [ - { - \x{f3c} - -/^\p{Pf}/8 - \x{bb} - \x{2019} - ** Failers - X - \x{203f} - -/^\p{Pi}/8 - \x{ab} - \x{2018} - ** Failers - X - \x{203f} - -/^\p{Po}/8 - ! - \x{37e} - ** Failers - X - \x{203f} - -/^\p{Ps}/8 - ( - [ - { - \x{f3c} - ** Failers - X - ) - ] - } - \x{f3b} - -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - \x{9f2} - ** Failers - X - \x{2c2} - -/^\p{Sk}/8 - \x{2c2} - ** Failers - X - \x{9f2} - -/^\p{Sm}+/8 - +<|~\x{ac}\x{2044} - ** Failers - X - \x{9f2} - -/^\p{So}/8 - \x{a6} - \x{482} - ** Failers - X - \x{9f2} - -/^\p{Zl}/8 - \x{2028} - ** Failers - X - \x{2029} - -/^\p{Zp}/8 - \x{2029} - ** Failers - X - \x{2028} - -/^\p{Zs}/8 - \ \ - \x{a0} - \x{1680} - \x{180e} - \x{2000} - \x{2001} - ** Failers - \x{2028} - \x{200d} - -/\p{Nd}+(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}+?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,3}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,3}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}??(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(...)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(....)/8 - ** Failers - \x{660}\x{661}\x{662}ABC - -/\p{Lu}/8i - A - a\x{10a0}B - ** Failers - a - \x{1d00} - -/\p{^Lu}/8i - 1234 - ** Failers - ABC - -/\P{Lu}/8i - 1234 - ** Failers - ABC - -/(?<=A\p{Nd})XYZ/8 - A2XYZ - 123A5XYZPQR - ABA\x{660}XYZpqr - ** Failers - AXYZ - XYZ - -/(?<!\pL)XYZ/8 - 1XYZ - AB=XYZ.. - XYZ - ** Failers - WXYZ - -/[\p{L}]/D - -/[\p{^L}]/D - -/[\P{L}]/D - -/[\P{^L}]/D - -/[abc\p{L}\x{0660}]/8D - -/[\p{Nd}]/8DM - 1234 - -/[\p{Nd}+-]+/8DM - 1234 - 12-34 - 12+\x{661}-34 - ** Failers - abcd - -/[\P{Nd}]+/8 - abcd - ** Failers - 1234 - -/\D+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\P{Nd}+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\pL/8 - a - A - -/\pL/8i - a - A - -/\p{Lu}/8 - A - aZ - ** Failers - abc - -/\p{Lu}/8i - A - aZ - ** Failers - abc - -/\p{Ll}/8 - a - Az - ** Failers - ABC - -/\p{Ll}/8i - a - Az - ** Failers - ABC - -/^\x{c0}$/8i - \x{c0} - \x{e0} - -/^\x{e0}$/8i - \x{c0} - \x{e0} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - ** Failers - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8i - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iD - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8D - -/AB\x{1fb0}/8D - -/AB\x{1fb0}/8Di - -/\x{391}+/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - -/\x{391}{3,5}(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/\x{391}{3,5}?(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/[\x{391}\x{ff3a}]/8i - \x{391} - \x{ff3a} - \x{3b1} - \x{ff5a} - -/[\x{c0}\x{391}]/8i - \x{c0} - \x{e0} - -/[\x{105}-\x{109}]/8iD - \x{104} - \x{105} - \x{109} - ** Failers - \x{100} - \x{10a} - -/[z-\x{100}]/8iD - Z - z - \x{39c} - \x{178} - | - \x{80} - \x{ff} - \x{100} - \x{101} - ** Failers - \x{102} - Y - y - -/[z-\x{100}]/8Di - -/^\X/8 - A - A\x{300}BC - A\x{300}\x{301}\x{302}BC - *** Failers - \x{300} - -/^[\X]/8 - X123 - *** Failers - AXYZ - -/^(\X*)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*?)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*?)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^\X(.)/8 - *** Failers - A\x{300}\x{301}\x{302} - -/^\X{2,3}(.)/8 - A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - -/^\X{2,3}?(.)/8 - A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - -/ End of testinput6 / diff --git a/ext/pcre/pcrelib/testdata/testinput7 b/ext/pcre/pcrelib/testdata/testinput7 deleted file mode 100644 index cecbc0065f7c1..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput7 +++ /dev/null @@ -1,4014 +0,0 @@ -/abc/ - abc - -/ab*c/ - abc - abbbbc - ac - -/ab+c/ - abc - abbbbbbc - *** Failers - ac - ab - -/a*/ - a - aaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F - -/(a|abcd|african)/ - a - abcd - african - -/^abc/ - abcdef - *** Failers - xyzabc - xyz\nabc - -/^abc/m - abcdef - xyz\nabc - *** Failers - xyzabc - -/\Aabc/ - abcdef - *** Failers - xyzabc - xyz\nabc - -/\Aabc/m - abcdef - *** Failers - xyzabc - xyz\nabc - -/\Gabc/ - abcdef - xyzabc\>3 - *** Failers - xyzabc - xyzabc\>2 - -/x\dy\Dz/ - x9yzz - x0y+z - *** Failers - xyz - xxy0z - -/x\sy\Sz/ - x yzz - x y+z - *** Failers - xyz - xxyyz - -/x\wy\Wz/ - xxy+z - *** Failers - xxy0z - x+y+z - -/x.y/ - x+y - x-y - *** Failers - x\ny - -/x.y/s - x+y - x-y - x\ny - -/(a.b(?s)c.d|x.y)p.q/ - a+bc+dp+q - a+bc\ndp+q - x\nyp+q - *** Failers - a\nbc\ndp+q - a+bc\ndp\nq - x\nyp\nq - -/a\d\z/ - ba0 - *** Failers - ba0\n - ba0\ncd - -/a\d\z/m - ba0 - *** Failers - ba0\n - ba0\ncd - -/a\d\Z/ - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d\Z/m - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d$/ - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d$/m - ba0 - ba0\n - ba0\ncd - *** Failers - -/abc/i - abc - aBc - ABC - -/[^a]/ - abcd - -/ab?\w/ - abz - abbz - azz - -/x{0,3}yz/ - ayzq - axyzq - axxyz - axxxyzq - axxxxyzq - *** Failers - ax - axx - -/x{3}yz/ - axxxyzq - axxxxyzq - *** Failers - ax - axx - ayzq - axyzq - axxyz - -/x{2,3}yz/ - axxyz - axxxyzq - axxxxyzq - *** Failers - ax - axx - ayzq - axyzq - -/[^a]+/ - bac - bcdefax - *** Failers - aaaaa - -/[^a]*/ - bac - bcdefax - *** Failers - aaaaa - -/[^a]{3,5}/ - xyz - awxyza - abcdefa - abcdefghijk - *** Failers - axya - axa - aaaaa - -/\d*/ - 1234b567 - xyz - -/\D*/ - a1234b567 - xyz - -/\d+/ - ab1234c56 - *** Failers - xyz - -/\D+/ - ab123c56 - *** Failers - 789 - -/\d?A/ - 045ABC - ABC - *** Failers - XYZ - -/\D?A/ - ABC - BAC - 9ABC - *** Failers - -/a+/ - aaaa - -/^.*xyz/ - xyz - ggggggggxyz - -/^.+xyz/ - abcdxyz - axyz - *** Failers - xyz - -/^.?xyz/ - xyz - cxyz - -/^\d{2,3}X/ - 12X - 123X - *** Failers - X - 1X - 1234X - -/^[abcd]\d/ - a45 - b93 - c99z - d04 - *** Failers - e45 - abcd - abcd1234 - 1234 - -/^[abcd]*\d/ - a45 - b93 - c99z - d04 - abcd1234 - 1234 - *** Failers - e45 - abcd - -/^[abcd]+\d/ - a45 - b93 - c99z - d04 - abcd1234 - *** Failers - 1234 - e45 - abcd - -/^a+X/ - aX - aaX - -/^[abcd]?\d/ - a45 - b93 - c99z - d04 - 1234 - *** Failers - abcd1234 - e45 - -/^[abcd]{2,3}\d/ - ab45 - bcd93 - *** Failers - 1234 - a36 - abcd1234 - ee45 - -/^(abc)*\d/ - abc45 - abcabcabc45 - 42xyz - *** Failers - -/^(abc)+\d/ - abc45 - abcabcabc45 - *** Failers - 42xyz - -/^(abc)?\d/ - abc45 - 42xyz - *** Failers - abcabcabc45 - -/^(abc){2,3}\d/ - abcabc45 - abcabcabc45 - *** Failers - abcabcabcabc45 - abc45 - 42xyz - -/1(abc|xyz)2(?1)3/ - 1abc2abc3456 - 1abc2xyz3456 - -/^(a*\w|ab)=(a*\w|ab)/ - ab=ab - -/^(a*\w|ab)=(?1)/ - ab=ab - -/^([^()]|\((?1)*\))*$/ - abc - a(b)c - a(b(c))d - *** Failers) - a(b(c)d - -/^>abc>([^()]|\((?1)*\))*<xyz<$/ - >abc>123<xyz< - >abc>1(2)3<xyz< - >abc>(1(2)3)<xyz< - -/^(?>a*)\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 - *** Failers - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x - <> - <abcd> - <abc <123> hij> - <abc <def> hij> - <abc<>def> - <abc<> - *** Failers - <abc - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 12 - *** Failers - 123 - xyz - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 12 - *** Failers - 123 - xyz - -/^(?=abc)\w{5}:$/ - abcde: - *** Failers - abc.. - 123 - vwxyz - -/^(?!abc)\d\d$/ - 12 - *** Failers - abcde: - abc.. - 123 - vwxyz - -/(?<=abc|xy)123/ - abc12345 - wxy123z - *** Failers - 123abc - -/(?<!abc|xy)123/ - 123abc - mno123456 - *** Failers - abc12345 - wxy123z - -/abc(?C1)xyz/ - abcxyz - 123abcxyz999 - -/(ab|cd){3,4}/C - ababab - abcdabcd - abcdcdcdcdcd - -/^abc/ - abcdef - *** Failers - abcdef\B - -/^(a*|xyz)/ - bcd - aaabcd - xyz - xyz\N - *** Failers - bcd\N - -/xyz$/ - xyz - xyz\n - *** Failers - xyz\Z - xyz\n\Z - -/xyz$/m - xyz - xyz\n - abcxyz\npqr - abcxyz\npqr\Z - xyz\n\Z - *** Failers - xyz\Z - -/\Gabc/ - abcdef - defabcxyz\>3 - *** Failers - defabcxyz - -/^abcdef/ - ab\P - abcde\P - abcdef\P - *** Failers - abx\P - -/^a{2,4}\d+z/ - a\P - aa\P - aa2\P - aaa\P - aaa23\P - aaaa12345\P - aa0z\P - aaaa4444444444444z\P - *** Failers - az\P - aaaaa\P - a56\P - -/^abcdef/ - abc\P - def\R - -/(?<=foo)bar/ - xyzfo\P - foob\R\P\>2 - foobar...\R\P\>4 - xyzfo\P - foobar\R\>2 - *** Failers - xyzfo\P - obar\R - -/(ab*(cd|ef))+X/ - adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z - lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z - cdabbbbbbbb\P\R\B\Z - efabbbbbbbbbbbbbbbb\P\R\B\Z - bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z - -/(a|b)/SF>testsavedregex -<testsavedregex - abc - ** Failers - def - -/the quick brown fox/ - the quick brown fox - The quick brown FOX - What do you know about the quick brown fox? - What do you know about THE QUICK BROWN FOX? - -/The quick brown fox/i - the quick brown fox - The quick brown FOX - What do you know about the quick brown fox? - What do you know about THE QUICK BROWN FOX? - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - *** Failers - abxyzpqrrabbxyyyypqAzz - abxyzpqrrrrabbxyyyypqAzz - abxyzpqrrrabxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyypqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz - -/^(abc){1,2}zz/ - abczz - abcabczz - *** Failers - zz - abcabcabczz - >>abczz - -/^(b+?|a){1,2}?c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}?bc/ - bbc - -/^(b*|ba){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^(ba|b*){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - -/^[ab\]cde]/ - athing - bthing - ]thing - cthing - dthing - ething - *** Failers - fthing - [thing - \\thing - -/^[]cde]/ - ]thing - cthing - dthing - ething - *** Failers - athing - fthing - -/^[^ab\]cde]/ - fthing - [thing - \\thing - *** Failers - athing - bthing - ]thing - cthing - dthing - ething - -/^[^]cde]/ - athing - fthing - *** Failers - ]thing - cthing - dthing - ething - -/^\/ -  - -/^˙/ - ˙ - -/^[0-9]+$/ - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 100 - *** Failers - abc - -/^.*nter/ - enter - inter - uponter - -/^xxx[0-9]+$/ - xxx0 - xxx1234 - *** Failers - xxx - -/^.+[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - *** Failers - !pqr=apquxz.ixr.zzz.ac.uk - abc!=apquxz.ixr.zzz.ac.uk - abc!pqr=apquxz:ixr.zzz.ac.uk - abc!pqr=apquxz.ixr.zzz.ac.ukk - -/:/ - Well, we need a colon: somewhere - *** Fail if we don't - -/([\da-f:]+)$/i - 0abc - abc - fed - E - :: - 5f03:12C0::932e - fed def - Any old stuff - *** Failers - 0zzz - gzzz - fed\x20 - Any old rubbish - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - A.12.123.0 - *** Failers - .1.2.3333 - 1.2.3 - 1234.2.3 - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 1 IN SOA non-sp1 non-sp2 ( - *** Failers - 1IN SOA non-sp1 non-sp2( - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - Z. - 2. - ab-c.pq-r. - sxk.zzz.ac.uk. - x-.y-. - *** Failers - -abc.peq. - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - *.b0-a - *.c3-b.c - *.c-a.b-c - *** Failers - *.0 - *.a- - *.a-b.c- - *.c-a.0-c - -/^(?=ab(de))(abd)(e)/ - abde - -/^(?!(ab)de|x)(abd)(f)/ - abdf - -/^(?=(ab(cd)))(ab)/ - abcd - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - A.B.C.D - a.b.c.1.2.3.C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - \"abcd\" ; - \"\" ; rhubarb - *** Failers - \"1234\" : things - -/^$/ - \ - *** Failers - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - *** Failers - abc - ab cde - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - *** Failers - abc - ab cde - -/^ a\ b[c ]d $/x - a bcd - a b d - *** Failers - abcd - ab d - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - -/^a*\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a*?\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a+\w/ - az - aaaz - aa - aaaa - aa+ - -/^a+?\w/ - az - aaaz - aa - aaaa - aa+ - -/^\d{8}\w{2,}/ - 1234567890 - 12345678ab - 12345678__ - *** Failers - 1234567 - -/^[aeiou\d]{4,5}$/ - uoie - 1234 - 12345 - aaaaa - *** Failers - 123456 - -/^[aeiou\d]{4,5}?/ - uoie - 1234 - 12345 - aaaaa - 123456 - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - From abcd Mon Sep 1 12:33:02 1997 - *** Failers - From abcd Sep 01 12:33:02 1997 - -/^12.34/s - 12\n34 - 12\r34 - -/\w+(?=\t)/ - the quick brown\t fox - -/foo(?!bar)(.*)/ - foobar is foolish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - barrel - 2barrel - A barrel - -/^(\D*)(?=\d)(?!123)/ - abc456 - *** Failers - abc123 - -/^1234(?# test newlines - inside)/ - 1234 - -/^1234 #comment in extended re - /x - 1234 - -/#rhubarb - abcd/x - abcd - -/^abcd#rhubarb/x - abcd - -/(?!^)abc/ - the abc - *** Failers - abc - -/(?=^)abc/ - abc - *** Failers - the abc - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other <user\@dom.ain> - <user\@dom.ain> - user\@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - A. Other <user.1234\@dom.ain> (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle <user\@some.where - *** Failers - The quick brown fox - -/[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional leading comment -(?: -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other <user\@dom.ain> - <user\@dom.ain> - user\@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - A. Other <user.1234\@dom.ain> (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle <user\@some.where - *** Failers - The quick brown fox - -/abc\0def\00pqr\000xyz\0000AB/ - abc\0def\00pqr\000xyz\0000AB - abc456 abc\0def\00pqr\000xyz\0000ABCDE - -/abc\x0def\x00pqr\x000xyz\x0000AB/ - abc\x0def\x00pqr\x000xyz\x0000AB - abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE - -/^[\000-\037]/ - \0A - \01B - \037C - -/\0*/ - \0\0\0\0 - -/A\x0{2,3}Z/ - The A\x0\x0Z - An A\0\x0\0Z - *** Failers - A\0Z - A\0\x0\0\x0Z - -/^\s/ - \040abc - \x0cabc - \nabc - \rabc - \tabc - *** Failers - abc - -/^a b - - c/x - abc - -/ab{1,3}bc/ - abbbbc - abbbc - abbc - *** Failers - abc - abbbbbc - -/([^.]*)\.([^:]*):[T ]+(.*)/ - track1.title:TBlah blah blah - -/([^.]*)\.([^:]*):[T ]+(.*)/i - track1.title:TBlah blah blah - -/([^.]*)\.([^:]*):[t ]+(.*)/i - track1.title:TBlah blah blah - -/^[W-c]+$/ - WXY_^abc - *** Failers - wxy - -/^[W-c]+$/i - WXY_^abc - wxy_^ABC - -/^[\x3f-\x5F]+$/i - WXY_^abc - wxy_^ABC - -/^abc$/m - abc - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/^abc$/ - abc - *** Failers - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/\Aabc\Z/m - abc - abc\n - *** Failers - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -/\A(.)*\Z/s - abc\ndef - -/\A(.)*\Z/m - *** Failers - abc\ndef - -/(?:b)|(?::+)/ - b::c - c::b - -/[-az]+/ - az- - *** Failers - b - -/[az-]+/ - za- - *** Failers - b - -/[a\-z]+/ - a-z - *** Failers - b - -/[a-z]+/ - abcdxyz - -/[\d-]+/ - 12-34 - *** Failers - aaa - -/[\d-z]+/ - 12-34z - *** Failers - aaa - -/\x5c/ - \\ - -/\x20Z/ - the Zoo - *** Failers - Zulu - -/ab{3cd/ - ab{3cd - -/ab{3,cd/ - ab{3,cd - -/ab{3,4a}cd/ - ab{3,4a}cd - -/{4,5a}bc/ - {4,5a}bc - -/^a.b/ - a\rb - *** Failers - a\nb - -/abc$/ - abc - abc\n - *** Failers - abc\ndef - -/(abc)\123/ - abc\x53 - -/(abc)\223/ - abc\x93 - -/(abc)\323/ - abc\xd3 - -/(abc)\500/ - abc\x40 - abc\100 - -/(abc)\5000/ - abc\x400 - abc\x40\x30 - abc\1000 - abc\100\x30 - abc\100\060 - abc\100\60 - -/abc\81/ - abc\081 - abc\0\x38\x31 - -/abc\91/ - abc\091 - abc\0\x39\x31 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - -/ab\gdef/ - abgdef - -/a{0}bc/ - bc - -/(a|(bc)){0,0}?xyz/ - xyz - -/abc[\10]de/ - abc\010de - -/abc[\1]de/ - abc\1de - -/(abc)[\1]de/ - abc\1de - -/(?s)a.b/ - a\nb - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - baNOTcccd - baNOTccd - bacccd - *** Failers - anything - b\bc - baccd - -/[^a]/ - Abc - -/[^a]/i - Abc - -/[^a]+/ - AAAaAbc - -/[^a]+/i - AAAaAbc - -/[^a]+/ - bbb\nccc - -/[^k]$/ - abc - *** Failers - abk - -/[^k]{2,3}$/ - abc - kbc - kabc - *** Failers - abk - akb - akk - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 123456789\@x.y.z - *** Failers - 12345678\@x.y.uk - 1234567\@a.b.c.d - -/[^a]/ - aaaabcd - aaAabcd - -/[^a]/i - aaaabcd - aaAabcd - -/[^az]/ - aaaabcd - aaAabcd - -/[^az]/i - aaaabcd - aaAabcd - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 1.875000282 - 1.235 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/a(?)b/ - ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - -/foo(.*)bar/ - The food is under the bar in the barn. - -/foo(.*?)bar/ - The food is under the bar in the barn. - -/(.*)(\d*)/ - I have 2 numbers: 53147 - -/(.*)(\d+)/ - I have 2 numbers: 53147 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - -/^\D*(?!123)/ - ABC123 - -/^(\D*)(?=\d)(?!123)/ - ABC445 - *** Failers - ABC123 - -/^[W-]46]/ - W46]789 - -46]789 - *** Failers - Wall - Zebra - 42 - [abcd] - ]abcd[ - -/^[W-\]46]/ - W46]789 - Wall - Zebra - Xylophone - 42 - [abcd] - ]abcd[ - \\backslash - *** Failers - -46]789 - well - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope - -/^(a){0,0}/ - bcd - abc - aab - -/^(a){0,1}/ - bcd - abc - aab - -/^(a){0,2}/ - bcd - abc - aab - -/^(a){0,3}/ - bcd - abc - aab - aaa - -/^(a){0,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/^(a){1,1}/ - bcd - abc - aab - -/^(a){1,2}/ - bcd - abc - aab - -/^(a){1,3}/ - bcd - abc - aab - aaa - -/^(a){1,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/.*\.gif/ - borfle\nbib.gif\nno - -/.{0,}\.gif/ - borfle\nbib.gif\nno - -/.*\.gif/m - borfle\nbib.gif\nno - -/.*\.gif/s - borfle\nbib.gif\nno - -/.*\.gif/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno - -/.*$/m - borfle\nbib.gif\nno - -/.*$/s - borfle\nbib.gif\nno - -/.*$/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno\n - -/.*$/m - borfle\nbib.gif\nno\n - -/.*$/s - borfle\nbib.gif\nno\n - -/.*$/ms - borfle\nbib.gif\nno\n - -/(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/m - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(.*X|^B)/s - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/ms - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(?s:.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/^.*B/ - **** Failers - abc\nB - -/(?s)^.*B/ - abc\nB - -/(?m)^.*B/ - abc\nB - -/(?ms)^.*B/ - abc\nB - -/(?ms)^B/ - abc\nB - -/(?s)B$/ - B\n - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - -/^[abc]{12}/ - abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - *** Failers - z - -/abcde{0,0}/ - abcd - *** Failers - abce - -/ab[cd]{0,0}e/ - abe - *** Failers - abcde - -/ab(c){0,0}d/ - abd - *** Failers - abcd - -/a(b*)/ - a - ab - abbbb - *** Failers - bbbbb - -/ab\d{0}e/ - abe - *** Failers - ab1e - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - \"the \\\"quick\\\" brown fox\" - -/.*?/g+ - abc - -/\b/g+ - abc - -/\b/+g - abc - -//g - abc - -/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - -/a[^a]b/ - acb - a\nb - -/a.b/ - acb - *** Failers - a\nb - -/a[^a]b/s - acb - a\nb - -/a.b/s - acb - a\nb - -/^(b+?|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/^(b+|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/(?!\A)x/m - x\nb\n - a\bx\n - -/\x0{ab}/ - \0{ab} - -/(A|B)*?CD/ - CD - -/(A|B)*CD/ - CD - -/(?<!bar)foo/ - foo - catfood - arfootle - rfoosh - *** Failers - barfoo - towbarfoo - -/\w{3}(?<!bar)foo/ - catfood - *** Failers - foo - barfoo - towbarfoo - -/(?<=(foo)a)bar/ - fooabar - *** Failers - bar - foobbar - -/\Aabc\z/m - abc - *** Failers - abc\n - qqq\nabc - abc\nzzz - qqq\nabc\nzzz - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - *** Failers - this is not a line with only words and spaces! - -/(\d+)(\w)/ - 12345a - 12345+ - -/((?>\d+))(\w)/ - 12345a - *** Failers - 12345+ - -/(?>a+)b/ - aaab - -/((?>a+)b)/ - aaab - -/(?>(a+))b/ - aaab - -/(?>b)+/ - aaabbbccc - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - -/(a+|b+|c+)*c/ - aaabbbbccccd - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - (abc(def)xyz) - *** Failers - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/a(?-i)b/i - ab - Ab - *** Failers - aB - AB - -/(a (?x)b c)d e/ - a bcd e - *** Failers - a b cd e - abcd e - a bcde - -/(a b(?x)c d (?-x)e f)/ - a bcde f - *** Failers - abcdef - -/(a(?i)b)c/ - abc - aBc - *** Failers - abC - aBC - Abc - ABc - ABC - AbC - -/a(?i:b)c/ - abc - aBc - *** Failers - ABC - abC - aBC - -/a(?i:b)*c/ - aBc - aBBc - *** Failers - aBC - aBBC - -/a(?=b(?i)c)\w\wd/ - abcd - abCd - *** Failers - aBCd - abcD - -/(?s-i:more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?:(?s-i)more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?>a(?i)b+)+c/ - abc - aBbc - aBBc - *** Failers - Abc - abAb - abbC - -/(?=a(?i)b)\w\wc/ - abc - aBc - *** Failers - Ab - abC - aBC - -/(?<=a(?i)b)(\w\w)c/ - abxxc - aBxxc - *** Failers - Abxxc - ABxxc - abxxC - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 12 - *** Failers - 123 - xyz - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 12 - *** Failers - 123 - xyz - -/(?(?<=foo)bar|cat)/ - foobar - cat - fcat - focat - *** Failers - foocat - -/(?(?<!foo)cat|bar)/ - foobar - cat - fcat - focat - *** Failers - foocat - -/(?>a*)*/ - a - aa - aaaa - -/(abc|)+/ - abc - abcabc - abcabcabc - xyz - -/([a]*)*/ - a - aaaaa - -/([ab]*)*/ - a - b - ababab - aaaabcde - bbbb - -/([^a]*)*/ - b - bbbb - aaa - -/([^ab]*)*/ - cccc - abab - -/([a]*?)*/ - a - aaaa - -/([ab]*?)*/ - a - b - abab - baba - -/([^a]*?)*/ - b - bbbb - aaa - -/([^ab]*?)*/ - c - cccc - baba - -/(?>a*)*/ - a - aaabcde - -/((?>a*))*/ - aaaaa - aabbaa - -/((?>a*?))*/ - aaaaa - aabbaa - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 12-09-98 - *** Failers - sep-12-98 - -/(?i:saturday|sunday)/ - saturday - sunday - Saturday - Sunday - SATURDAY - SUNDAY - SunDay - -/(a(?i)bc|BB)x/ - abcx - aBCx - bbx - BBx - *** Failers - abcX - aBCX - bbX - BBX - -/^([ab](?i)[cd]|[ef])/ - ac - aC - bD - elephant - Europe - frog - France - *** Failers - Africa - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - aBd - xy - xY - zebra - Zambesi - *** Failers - aCD - XY - -/(?<=foo\n)^bar/m - foo\nbar - *** Failers - bar - baz\nbar - -/(?<=(?<!foo)bar)baz/ - barbaz - barbarbaz - koobarbaz - *** Failers - baz - foobarbaz - -/The following tests are taken from the Perl 5.005 test suite; some of them/ -/are compatible with 5.004, but I'd rather not have to sort them out./ - -/abc/ - abc - xabcy - ababc - *** Failers - xbc - axc - abx - -/ab*c/ - abc - -/ab*bc/ - abc - abbc - abbbbc - -/.{1}/ - abbbbc - -/.{3,4}/ - abbbbc - -/ab{0,}bc/ - abbbbc - -/ab+bc/ - abbc - *** Failers - abc - abq - -/ab{1,}bc/ - -/ab+bc/ - abbbbc - -/ab{1,}bc/ - abbbbc - -/ab{1,3}bc/ - abbbbc - -/ab{3,4}bc/ - abbbbc - -/ab{4,5}bc/ - *** Failers - abq - abbbbc - -/ab?bc/ - abbc - abc - -/ab{0,1}bc/ - abc - -/ab?bc/ - -/ab?c/ - abc - -/ab{0,1}c/ - abc - -/^abc$/ - abc - *** Failers - abbbbc - abcc - -/^abc/ - abcc - -/^abc$/ - -/abc$/ - aabc - *** Failers - aabc - aabcd - -/^/ - abc - -/$/ - abc - -/a.c/ - abc - axc - -/a.*c/ - axyzc - -/a[bc]d/ - abd - *** Failers - axyzd - abc - -/a[b-d]e/ - ace - -/a[b-d]/ - aac - -/a[-b]/ - a- - -/a[b-]/ - a- - -/a]/ - a] - -/a[]]b/ - a]b - -/a[^bc]d/ - aed - *** Failers - abd - abd - -/a[^-b]c/ - adc - -/a[^]b]c/ - adc - *** Failers - a-c - a]c - -/\ba\b/ - a- - -a - -a- - -/\by\b/ - *** Failers - xy - yz - xyz - -/\Ba\B/ - *** Failers - a- - -a - -a- - -/\By\b/ - xy - -/\by\B/ - yz - -/\By\B/ - xyz - -/\w/ - a - -/\W/ - - - *** Failers - - - a - -/a\sb/ - a b - -/a\Sb/ - a-b - *** Failers - a-b - a b - -/\d/ - 1 - -/\D/ - - - *** Failers - - - 1 - -/[\w]/ - a - -/[\W]/ - - - *** Failers - - - a - -/a[\s]b/ - a b - -/a[\S]b/ - a-b - *** Failers - a-b - a b - -/[\d]/ - 1 - -/[\D]/ - - - *** Failers - - - 1 - -/ab|cd/ - abc - abcd - -/()ef/ - def - -/$b/ - -/a\(b/ - a(b - -/a\(*b/ - ab - a((b - -/a\\b/ - a\b - -/((a))/ - abc - -/(a)b(c)/ - abc - -/a+b+c/ - aabbabc - -/a{1,}b{1,}c/ - aabbabc - -/a.+?c/ - abcabc - -/(a+|b)*/ - ab - -/(a+|b){0,}/ - ab - -/(a+|b)+/ - ab - -/(a+|b){1,}/ - ab - -/(a+|b)?/ - ab - -/(a+|b){0,1}/ - ab - -/[^ab]*/ - cde - -/abc/ - *** Failers - b - - -/a*/ - - -/([abc])*d/ - abbbcd - -/([abc])*bcd/ - abcd - -/a|b|c|d|e/ - e - -/(a|b|c|d|e)f/ - ef - -/abcd*efg/ - abcdefg - -/ab*/ - xabyabbbz - xayabbbz - -/(ab|cd)e/ - abcde - -/[abhgefdc]ij/ - hij - -/^(ab|cd)e/ - -/(abc|)ef/ - abcdef - -/(a|b)c*d/ - abcd - -/(ab|ab*)bc/ - abc - -/a([bc]*)c*/ - abc - -/a([bc]*)(c*d)/ - abcd - -/a([bc]+)(c*d)/ - abcd - -/a([bc]*)(c+d)/ - abcd - -/a[bcd]*dcdcde/ - adcdcde - -/a[bcd]+dcdcde/ - *** Failers - abcde - adcdcde - -/(ab|a)b*c/ - abc - -/((a)(b)c)(d)/ - abcd - -/[a-zA-Z_][a-zA-Z0-9_]*/ - alpha - -/^a(bc+|b[eh])g|.h$/ - abh - -/(bc+d$|ef*g.|h?i(j|k))/ - effgz - ij - reffgz - *** Failers - effg - bcdd - -/((((((((((a))))))))))/ - a - -/(((((((((a)))))))))/ - a - -/multiple words of text/ - *** Failers - aa - uh-uh - -/multiple words/ - multiple words, yeah - -/(.*)c(.*)/ - abcde - -/\((.*), (.*)\)/ - (a, b) - -/[k]/ - -/abcd/ - abcd - -/a(bc)d/ - abcd - -/a[-]?c/ - ac - -/abc/i - ABC - XABCY - ABABC - *** Failers - aaxabxbaxbbx - XBC - AXC - ABX - -/ab*c/i - ABC - -/ab*bc/i - ABC - ABBC - -/ab*?bc/i - ABBBBC - -/ab{0,}?bc/i - ABBBBC - -/ab+?bc/i - ABBC - -/ab+bc/i - *** Failers - ABC - ABQ - -/ab{1,}bc/i - -/ab+bc/i - ABBBBC - -/ab{1,}?bc/i - ABBBBC - -/ab{1,3}?bc/i - ABBBBC - -/ab{3,4}?bc/i - ABBBBC - -/ab{4,5}?bc/i - *** Failers - ABQ - ABBBBC - -/ab??bc/i - ABBC - ABC - -/ab{0,1}?bc/i - ABC - -/ab??bc/i - -/ab??c/i - ABC - -/ab{0,1}?c/i - ABC - -/^abc$/i - ABC - *** Failers - ABBBBC - ABCC - -/^abc/i - ABCC - -/^abc$/i - -/abc$/i - AABC - -/^/i - ABC - -/$/i - ABC - -/a.c/i - ABC - AXC - -/a.*?c/i - AXYZC - -/a.*c/i - *** Failers - AABC - AXYZD - -/a[bc]d/i - ABD - -/a[b-d]e/i - ACE - *** Failers - ABC - ABD - -/a[b-d]/i - AAC - -/a[-b]/i - A- - -/a[b-]/i - A- - -/a]/i - A] - -/a[]]b/i - A]B - -/a[^bc]d/i - AED - -/a[^-b]c/i - ADC - *** Failers - ABD - A-C - -/a[^]b]c/i - ADC - -/ab|cd/i - ABC - ABCD - -/()ef/i - DEF - -/$b/i - *** Failers - A]C - B - -/a\(b/i - A(B - -/a\(*b/i - AB - A((B - -/a\\b/i - A\B - -/((a))/i - ABC - -/(a)b(c)/i - ABC - -/a+b+c/i - AABBABC - -/a{1,}b{1,}c/i - AABBABC - -/a.+?c/i - ABCABC - -/a.*?c/i - ABCABC - -/a.{0,5}?c/i - ABCABC - -/(a+|b)*/i - AB - -/(a+|b){0,}/i - AB - -/(a+|b)+/i - AB - -/(a+|b){1,}/i - AB - -/(a+|b)?/i - AB - -/(a+|b){0,1}/i - AB - -/(a+|b){0,1}?/i - AB - -/[^ab]*/i - CDE - -/abc/i - -/a*/i - - -/([abc])*d/i - ABBBCD - -/([abc])*bcd/i - ABCD - -/a|b|c|d|e/i - E - -/(a|b|c|d|e)f/i - EF - -/abcd*efg/i - ABCDEFG - -/ab*/i - XABYABBBZ - XAYABBBZ - -/(ab|cd)e/i - ABCDE - -/[abhgefdc]ij/i - HIJ - -/^(ab|cd)e/i - ABCDE - -/(abc|)ef/i - ABCDEF - -/(a|b)c*d/i - ABCD - -/(ab|ab*)bc/i - ABC - -/a([bc]*)c*/i - ABC - -/a([bc]*)(c*d)/i - ABCD - -/a([bc]+)(c*d)/i - ABCD - -/a([bc]*)(c+d)/i - ABCD - -/a[bcd]*dcdcde/i - ADCDCDE - -/a[bcd]+dcdcde/i - -/(ab|a)b*c/i - ABC - -/((a)(b)c)(d)/i - ABCD - -/[a-zA-Z_][a-zA-Z0-9_]*/i - ALPHA - -/^a(bc+|b[eh])g|.h$/i - ABH - -/(bc+d$|ef*g.|h?i(j|k))/i - EFFGZ - IJ - REFFGZ - *** Failers - ADCDCDE - EFFG - BCDD - -/((((((((((a))))))))))/i - A - -/(((((((((a)))))))))/i - A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i - A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i - C - -/multiple words of text/i - *** Failers - AA - UH-UH - -/multiple words/i - MULTIPLE WORDS, YEAH - -/(.*)c(.*)/i - ABCDE - -/\((.*), (.*)\)/i - (A, B) - -/[k]/i - -/abcd/i - ABCD - -/a(bc)d/i - ABCD - -/a[-]?c/i - AC - -/a(?!b)./ - abad - -/a(?=d)./ - abad - -/a(?=c|d)./ - abad - -/a(?:b|c|d)(.)/ - ace - -/a(?:b|c|d)*(.)/ - ace - -/a(?:b|c|d)+?(.)/ - ace - acdbcdbe - -/a(?:b|c|d)+(.)/ - acdbcdbe - -/a(?:b|c|d){2}(.)/ - acdbcdbe - -/a(?:b|c|d){4,5}(.)/ - acdbcdbe - -/a(?:b|c|d){4,5}?(.)/ - acdbcdbe - -/((foo)|(bar))*/ - foobar - -/a(?:b|c|d){6,7}(.)/ - acdbcdbe - -/a(?:b|c|d){6,7}?(.)/ - acdbcdbe - -/a(?:b|c|d){5,6}(.)/ - acdbcdbe - -/a(?:b|c|d){5,6}?(.)/ - acdbcdbe - -/a(?:b|c|d){5,7}(.)/ - acdbcdbe - -/a(?:b|c|d){5,7}?(.)/ - acdbcdbe - -/a(?:b|(c|e){1,2}?|d)+?(.)/ - ace - -/^(.+)?B/ - AB - -/^([^a-z])|(\^)$/ - . - -/^[<>]&/ - <&OUT - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - -/(?<=a)b/ - ab - *** Failers - cb - b - -/(?<!c)b/ - ab - b - b - -/(?:..)*a/ - aba - -/(?:..)*?a/ - aba - -/^(){3,5}/ - abc - -/^(a+)*ax/ - aax - -/^((a|b)+)*ax/ - aax - -/^((a|bc)+)*ax/ - aax - -/(a|x)*ab/ - cab - -/(a)*ab/ - cab - -/(?:(?i)a)b/ - ab - -/((?i)a)b/ - ab - -/(?:(?i)a)b/ - Ab - -/((?i)a)b/ - Ab - -/(?:(?i)a)b/ - *** Failers - cb - aB - -/((?i)a)b/ - -/(?i:a)b/ - ab - -/((?i:a))b/ - ab - -/(?i:a)b/ - Ab - -/((?i:a))b/ - Ab - -/(?i:a)b/ - *** Failers - aB - aB - -/((?i:a))b/ - -/(?:(?-i)a)b/i - ab - -/((?-i)a)b/i - ab - -/(?:(?-i)a)b/i - aB - -/((?-i)a)b/i - aB - -/(?:(?-i)a)b/i - *** Failers - aB - Ab - -/((?-i)a)b/i - -/(?:(?-i)a)b/i - aB - -/((?-i)a)b/i - aB - -/(?:(?-i)a)b/i - *** Failers - Ab - AB - -/((?-i)a)b/i - -/(?-i:a)b/i - ab - -/((?-i:a))b/i - ab - -/(?-i:a)b/i - aB - -/((?-i:a))b/i - aB - -/(?-i:a)b/i - *** Failers - AB - Ab - -/((?-i:a))b/i - -/(?-i:a)b/i - aB - -/((?-i:a))b/i - aB - -/(?-i:a)b/i - *** Failers - Ab - AB - -/((?-i:a))b/i - -/((?-i:a.))b/i - *** Failers - AB - a\nB - -/((?s-i:a.))b/i - a\nB - -/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ - cabbbb - -/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ - caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - -/foo\w*\d{4}baz/ - foobar1234baz - -/x(~~)*(?:(?:F)?)?/ - x~~ - -/^a(?#xxx){3}c/ - aaac - -/^a (?#xxx) (?#yyy) {3}c/x - aaac - -/(?<![cd])b/ - *** Failers - B\nB - dbcb - -/(?<![cd])[ab]/ - dbaacb - -/(?<!(c|d))b/ - -/(?<!(c|d))[ab]/ - dbaacb - -/(?<!cd)[ab]/ - cdaccb - -/^(?:a?b?)*$/ - *** Failers - dbcb - a-- - -/((?s)^a(.))((?m)^b$)/ - a\nb\nc\n - -/((?m)^b$)/ - a\nb\nc\n - -/(?m)^b/ - a\nb\n - -/(?m)^(b)/ - a\nb\n - -/((?m)^b)/ - a\nb\n - -/\n((?m)^b)/ - a\nb\n - -/((?s).)c(?!.)/ - a\nb\nc\n - a\nb\nc\n - -/((?s)b.)c(?!.)/ - a\nb\nc\n - a\nb\nc\n - -/^b/ - -/()^b/ - *** Failers - a\nb\nc\n - a\nb\nc\n - -/((?m)^b)/ - a\nb\nc\n - -/(?(?!a)a|b)/ - -/(?(?!a)b|a)/ - a - -/(?(?=a)b|a)/ - *** Failers - a - a - -/(?(?=a)a|b)/ - a - -/(\w+:)+/ - one: - -/$(?<=^(a))/ - a - -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - -/^[^bcd]*(c+)/ - aexycd - -/(a*)b+/ - caab - -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - *** Failers - abcd: - abcd: - -/^[^bcd]*(c+)/ - aexycd - -/(>a+)ab/ - -/(?>a+)b/ - aaab - -/([[:]+)/ - a:[b]: - -/([[=]+)/ - a=[b]= - -/([[.]+)/ - a.[b]. - -/((?>a+)b)/ - aaab - -/(?>(a+))b/ - aaab - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/a\Z/ - *** Failers - aaab - a\nb\n - -/b\Z/ - a\nb\n - -/b\z/ - -/b\Z/ - a\nb - -/b\z/ - a\nb - *** Failers - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - endingwxyz - *** Failers - a rather long string that doesn't end with one of them - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope - -/(?<=\d{3}(?!999))foo/ - 999foo - 123999foo - *** Failers - 123abcfoo - -/(?<=(?!...999)\d{3})foo/ - 999foo - 123999foo - *** Failers - 123abcfoo - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 123456foo - *** Failers - 123999foo - -/(?<=\d{3}...)(?<!999)foo/ - 123abcfoo - 123456foo - *** Failers - 123999foo - -/((Z)+|A)*/ - ZABCDEFG - -/(Z()|A)*/ - ZABCDEFG - -/(Z(())|A)*/ - ZABCDEFG - -/((?>Z)+|A)*/ - ZABCDEFG - -/((?>)+|A)*/ - ZABCDEFG - -/a*/g - abbab - -/^[a-\d]/ - abcde - -things - 0digit - *** Failers - bcdef - -/^[\d-a]/ - abcde - -things - 0digit - *** Failers - bcdef - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - -/a b/x - ab - -/(?!\A)x/m - a\nxb\n - -/(?!^)x/m - a\nxb\n - -/abc\Qabc\Eabc/ - abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc - -/ abc\Q abc\Eabc/x - abc abcabc - *** Failers - abcabcabc - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal - -/\Qabc\$xyz\E/ - abc\\\$xyz - -/\Qabc\E\$\Qxyz\E/ - abc\$xyz - -/\Gabc/ - abc - *** Failers - xyzabc - -/\Gabc./g - abc1abc2xyzabc3 - -/abc./g - abc1abc2xyzabc3 - -/a(?x: b c )d/ - XabcdY - *** Failers - Xa b c d Y - -/((?x)x y z | a b c)/ - XabcY - AxyzB - -/(?i)AB(?-i)C/ - XabCY - *** Failers - XabcY - -/((?i)AB(?-i)C|D)E/ - abCE - DE - *** Failers - abcE - abCe - dE - De - -/[z\Qa-d]\E]/ - z - a - - - d - ] - *** Failers - b - -/[\z\C]/ - z - C - -/\M/ - M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - regulaer - Regex - regulär - -/Ċĉċä[à-˙À-ß]+/ - Ċĉċäà - Ċĉċä˙ - ĊĉċäÀ - Ċĉċäß - -/(?<=Z)X./ - \x84XAZXB - -/^(?(2)a|(1)(2))+$/ - 123a - -/(?<=a|bbbb)c/ - ac - bbbbc - -/abc/>testsavedregex -<testsavedregex - abc - *** Failers - bca - -/abc/F>testsavedregex -<testsavedregex - abc - *** Failers - bca - -/(a|b)/S>testsavedregex -<testsavedregex - abc - *** Failers - def - -/(a|b)/SF>testsavedregex -<testsavedregex - abc - *** Failers - def - -/line\nbreak/ - this is a line\nbreak - line one\nthis is a line\nbreak in the second line - -/line\nbreak/f - this is a line\nbreak - ** Failers - line one\nthis is a line\nbreak in the second line - -/line\nbreak/mf - this is a line\nbreak - ** Failers - line one\nthis is a line\nbreak in the second line - -/ End of testinput7 / diff --git a/ext/pcre/pcrelib/testdata/testinput8 b/ext/pcre/pcrelib/testdata/testinput8 deleted file mode 100644 index 36db2433e4f35..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput8 +++ /dev/null @@ -1,540 +0,0 @@ -/-- Do not use the \x{} construct except with patterns that have the --/ -/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ -/-- that option is set. However, the latest Perls recognize them always. --/ - -/\x{100}ab/8 - \x{100}ab - -/a\x{100}*b/8 - ab - a\x{100}b - a\x{100}\x{100}b - -/a\x{100}+b/8 - a\x{100}b - a\x{100}\x{100}b - *** Failers - ab - -/\bX/8 - Xoanon - +Xoanon - \x{300}Xoanon - *** Failers - YXoanon - -/\BX/8 - YXoanon - *** Failers - Xoanon - +Xoanon - \x{300}Xoanon - -/X\b/8 - X+oanon - ZX\x{300}oanon - FAX - *** Failers - Xoanon - -/X\B/8 - Xoanon - *** Failers - X+oanon - ZX\x{300}oanon - FAX - -/[^a]/8 - abcd - a\x{100} - -/^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 - ab99 - \x{123}\x{123}45 - \x{400}\x{401}\x{402}6 - *** Failers - d99 - \x{123}\x{122}4 - \x{400}\x{403}6 - \x{400}\x{401}\x{402}\x{402}6 - -/abc/8 - ] - - - \? - -/a.b/8 - acb - a\x7fb - a\x{100}b - *** Failers - a\nb - -/a(.{3})b/8 - a\x{4000}xyb - a\x{4000}\x7fyb - a\x{4000}\x{100}yb - *** Failers - a\x{4000}b - ac\ncb - -/a(.*?)(.)/ - a\xc0\x88b - -/a(.*?)(.)/8 - a\x{100}b - -/a(.*)(.)/ - a\xc0\x88b - -/a(.*)(.)/8 - a\x{100}b - -/a(.)(.)/ - a\xc0\x92bcd - -/a(.)(.)/8 - a\x{240}bcd - -/a(.?)(.)/ - a\xc0\x92bcd - -/a(.?)(.)/8 - a\x{240}bcd - -/a(.??)(.)/ - a\xc0\x92bcd - -/a(.??)(.)/8 - a\x{240}bcd - -/a(.{3})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - *** Failers - a\x{1234}b - ac\ncb - -/a(.{3,})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers - a\x{1234}b - -/a(.{3,}?)b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers - a\x{1234}b - -/a(.{3,5})b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - axxxxxbcdefghijb - *** Failers - a\x{1234}b - axxxxxxbcdefghijb - -/a(.{3,5}?)b/8 - a\x{1234}xyb - a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - axxxxxbcdefghijb - *** Failers - a\x{1234}b - axxxxxxbcdefghijb - -/^[a\x{c0}]/8 - *** Failers - \x{100} - -/(?<=aXb)cd/8 - aXbcd - -/(?<=a\x{100}b)cd/8 - a\x{100}bcd - -/(?<=a\x{100000}b)cd/8 - a\x{100000}bcd - -/(?:\x{100}){3}b/8 - \x{100}\x{100}\x{100}b - *** Failers - \x{100}\x{100}b - -/\x{ab}/8 - \x{ab} - \xc2\xab - *** Failers - \x00{ab} - -/(?<=(.))X/8 - WXYZ - \x{256}XYZ - *** Failers - XYZ - -/[^a]+/8g - bcd - \x{100}aY\x{256}Z - -/^[^a]{2}/8 - \x{100}bc - -/^[^a]{2,}/8 - \x{100}bcAa - -/^[^a]{2,}?/8 - \x{100}bca - -/[^a]+/8ig - bcd - \x{100}aY\x{256}Z - -/^[^a]{2}/8i - \x{100}bc - -/^[^a]{2,}/8i - \x{100}bcAa - -/^[^a]{2,}?/8i - \x{100}bca - -/\x{100}{0,0}/8 - abcd - -/\x{100}?/8 - abcd - \x{100}\x{100} - -/\x{100}{0,3}/8 - \x{100}\x{100} - \x{100}\x{100}\x{100}\x{100} - -/\x{100}*/8 - abce - \x{100}\x{100}\x{100}\x{100} - -/\x{100}{1,1}/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}{1,3}/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}+/8 - abcd\x{100}\x{100}\x{100}\x{100} - -/\x{100}{3}/8 - abcd\x{100}\x{100}\x{100}XX - -/\x{100}{3,5}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - -/\x{100}{3,}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - -/(?<=a\x{100}{2}b)X/8 - Xyyya\x{100}\x{100}bXzzz - -/\D*/8 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\D*/8 - \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/\D/8 - 1X2 - 1\x{100}2 - -/>\S/8 - > >X Y - > >\x{100} Y - -/\d/8 - \x{100}3 - -/\s/8 - \x{100} X - -/\D+/8 - 12abcd34 - *** Failers - 1234 - -/\D{2,3}/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 - -/\D{2,3}?/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 - -/\d+/8 - 12abcd34 - *** Failers - -/\d{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 - -/\d{2,3}?/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 - -/\S+/8 - 12abcd34 - *** Failers - \ \ - -/\S{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - \ \ - -/\S{2,3}?/8 - 12abcd34 - 1234abcd - *** Failers - \ \ - -/>\s+</8 - 12> <34 - *** Failers - -/>\s{2,3}</8 - ab> <cd - ab> <ce - *** Failers - ab> <cd - -/>\s{2,3}?</8 - ab> <cd - ab> <ce - *** Failers - ab> <cd - -/\w+/8 - 12 34 - *** Failers - +++=*! - -/\w{2,3}/8 - ab cd - abcd ce - *** Failers - a.b.c - -/\w{2,3}?/8 - ab cd - abcd ce - *** Failers - a.b.c - -/\W+/8 - 12====34 - *** Failers - abcd - -/\W{2,3}/8 - ab====cd - ab==cd - *** Failers - a.b.c - -/\W{2,3}?/8 - ab====cd - ab==cd - *** Failers - a.b.c - -/[\x{100}]/8 - \x{100} - Z\x{100} - \x{100}Z - *** Failers - -/[Z\x{100}]/8 - Z\x{100} - \x{100} - \x{100}Z - *** Failers - -/[\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - *** Failers - -/[\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - *** Failers - -/[z-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - *** Failers - -/[Q\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - Q? - *** Failers - -/[Q\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - Q? - *** Failers - -/[Qz-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - Q? - *** Failers - -/[\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[Q\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/[Q\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers - -/(?<=[\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X - *** Failers - X - -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X - abQX - *** Failers - X - -/(?<=[\x{100}\x{200}]{3})X/8 - abc\x{100}\x{200}\x{100}X - *** Failers - abc\x{200}X - X - -/[^\x{100}\x{200}]X/8 - AX - \x{150}X - \x{500}X - *** Failers - \x{100}X - \x{200}X - -/[^Q\x{100}\x{200}]X/8 - AX - \x{150}X - \x{500}X - *** Failers - \x{100}X - \x{200}X - QX - -/[^\x{100}-\x{200}]X/8 - AX - \x{500}X - *** Failers - \x{100}X - \x{150}X - \x{200}X - -/[z-\x{100}]/8i - z - Z - \x{100} - *** Failers - \x{102} - y - -/[\xFF]/ - >\xff< - -/[\xff]/8 - >\x{ff}< - -/[^\xFF]/ - XYZ - -/[^\xff]/8 - XYZ - \x{123} - -/^[ac]*b/8 - xb - -/^[ac\x{100}]*b/8 - xb - -/^[^x]*b/8i - xb - -/^[^x]*b/8 - xb - -/^\d*b/8 - xb - -/(|a)/g8 - catac - a\x{256}a - -/^\x{85}$/8i - \x{85} - -/ End of testinput 8 / diff --git a/ext/pcre/pcrelib/testdata/testinput9 b/ext/pcre/pcrelib/testdata/testinput9 deleted file mode 100644 index f18dd12c4a67e..0000000000000 --- a/ext/pcre/pcrelib/testdata/testinput9 +++ /dev/null @@ -1,599 +0,0 @@ -/\pL\P{Nd}/8 - AB - *** Failers - A0 - 00 - -/\X./8 - AB - A\x{300}BC - A\x{300}\x{301}\x{302}BC - *** Failers - \x{300} - -/\X\X/8 - ABC - A\x{300}B\x{300}\x{301}C - A\x{300}\x{301}\x{302}BC - *** Failers - \x{300} - -/^\pL+/8 - abcd - a - *** Failers - -/^\PL+/8 - 1234 - = - *** Failers - abcd - -/^\X+/8 - abcdA\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - a - *** Failers - \x{300}\x{301}\x{302} - -/\X?abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc - *** Failers - -/^\X?abc/8 - abc - A\x{300}abc - *** Failers - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc - -/\X*abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc - *** Failers - -/^\X*abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - *** Failers - \x{300}abc - -/^\pL?=./8 - A=b - =c - *** Failers - 1=2 - AAAA=b - -/^\pL*=./8 - AAAA=b - =c - *** Failers - 1=2 - -/^\X{2,3}X/8 - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - *** Failers - X - A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - -/^\pC\pL\pM\pN\pP\pS\pZ</8 - \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - \np\x{300}9!\$ < - ** Failers - ap\x{300}9!\$ < - -/^\PC/8 - X - ** Failers - \x7f - -/^\PL/8 - 9 - ** Failers - \x{c0} - -/^\PM/8 - X - ** Failers - \x{30f} - -/^\PN/8 - X - ** Failers - \x{660} - -/^\PP/8 - X - ** Failers - \x{66c} - -/^\PS/8 - X - ** Failers - \x{f01} - -/^\PZ/8 - X - ** Failers - \x{1680} - -/^\p{Cc}/8 - \x{017} - \x{09f} - ** Failers - \x{0600} - -/^\p{Cf}/8 - \x{601} - ** Failers - \x{09f} - -/^\p{Cn}/8 - ** Failers - \x{09f} - -/^\p{Co}/8 - \x{f8ff} - ** Failers - \x{09f} - -/^\p{Cs}/8 - \x{dfff} - ** Failers - \x{09f} - -/^\p{Ll}/8 - a - ** Failers - Z - \x{dfff} - -/^\p{Lm}/8 - \x{2b0} - ** Failers - a - -/^\p{Lo}/8 - \x{1bb} - ** Failers - a - \x{2b0} - -/^\p{Lt}/8 - \x{1c5} - ** Failers - a - \x{2b0} - -/^\p{Lu}/8 - A - ** Failers - \x{2b0} - -/^\p{Mc}/8 - \x{903} - ** Failers - X - \x{300} - -/^\p{Me}/8 - \x{488} - ** Failers - X - \x{903} - \x{300} - -/^\p{Mn}/8 - \x{300} - ** Failers - X - \x{903} - -/^\p{Nd}+/8 - 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a} - \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa} - \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970} - ** Failers - X - -/^\p{Nl}/8 - \x{16ee} - ** Failers - X - \x{966} - -/^\p{No}/8 - \x{b2} - \x{b3} - ** Failers - X - \x{16ee} - -/^\p{Pc}/8 - \x5f - \x{203f} - ** Failers - X - - - \x{58a} - -/^\p{Pd}/8 - - - \x{58a} - ** Failers - X - \x{203f} - -/^\p{Pe}/8 - ) - ] - } - \x{f3b} - ** Failers - X - \x{203f} - ( - [ - { - \x{f3c} - -/^\p{Pf}/8 - \x{bb} - \x{2019} - ** Failers - X - \x{203f} - -/^\p{Pi}/8 - \x{ab} - \x{2018} - ** Failers - X - \x{203f} - -/^\p{Po}/8 - ! - \x{37e} - ** Failers - X - \x{203f} - -/^\p{Ps}/8 - ( - [ - { - \x{f3c} - ** Failers - X - ) - ] - } - \x{f3b} - -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - \x{9f2} - ** Failers - X - \x{2c2} - -/^\p{Sk}/8 - \x{2c2} - ** Failers - X - \x{9f2} - -/^\p{Sm}+/8 - +<|~\x{ac}\x{2044} - ** Failers - X - \x{9f2} - -/^\p{So}/8 - \x{a6} - \x{482} - ** Failers - X - \x{9f2} - -/^\p{Zl}/8 - \x{2028} - ** Failers - X - \x{2029} - -/^\p{Zp}/8 - \x{2029} - ** Failers - X - \x{2028} - -/^\p{Zs}/8 - \ \ - \x{a0} - \x{1680} - \x{180e} - \x{2000} - \x{2001} - ** Failers - \x{2028} - \x{200d} - -/\p{Nd}+(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}+?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,3}(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}{2,3}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}?(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}??(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(..)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(...)/8 - \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(....)/8 - ** Failers - \x{660}\x{661}\x{662}ABC - -/\p{Lu}/8i - A - a\x{10a0}B - ** Failers - a - \x{1d00} - -/\p{^Lu}/8i - 1234 - ** Failers - ABC - -/\P{Lu}/8i - 1234 - ** Failers - ABC - -/(?<=A\p{Nd})XYZ/8 - A2XYZ - 123A5XYZPQR - ABA\x{660}XYZpqr - ** Failers - AXYZ - XYZ - -/(?<!\pL)XYZ/8 - 1XYZ - AB=XYZ.. - XYZ - ** Failers - WXYZ - -/[\p{Nd}]/8 - 1234 - -/[\p{Nd}+-]+/8 - 1234 - 12-34 - 12+\x{661}-34 - ** Failers - abcd - -/[\P{Nd}]+/8 - abcd - ** Failers - 1234 - -/\D+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\P{Nd}+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\pL/8 - a - A - -/\pL/8i - a - A - -/\p{Lu}/8 - A - aZ - ** Failers - abc - -/\p{Lu}/8i - A - aZ - ** Failers - abc - -/\p{Ll}/8 - a - Az - ** Failers - ABC - -/\p{Ll}/8i - a - Az - ** Failers - ABC - -/^\x{c0}$/8i - \x{c0} - \x{e0} - -/^\x{e0}$/8i - \x{c0} - \x{e0} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - ** Failers - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8i - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/\x{391}+/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - -/\x{391}{3,5}(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/\x{391}{3,5}?(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/[\x{391}\x{ff3a}]/8i - \x{391} - \x{ff3a} - \x{3b1} - \x{ff5a} - -/[\x{c0}\x{391}]/8i - \x{c0} - \x{e0} - -/[\x{105}-\x{109}]/8i - \x{104} - \x{105} - \x{109} - ** Failers - \x{100} - \x{10a} - -/[z-\x{100}]/8i - Z - z - \x{39c} - \x{178} - | - \x{80} - \x{ff} - \x{100} - \x{101} - ** Failers - \x{102} - Y - y - -/[z-\x{100}]/8i - -/^\X/8 - A - A\x{300}BC - A\x{300}\x{301}\x{302}BC - *** Failers - \x{300} - -/^[\X]/8 - X123 - *** Failers - AXYZ - -/^(\X*)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*?)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^(\X*?)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - -/^\X(.)/8 - *** Failers - A\x{300}\x{301}\x{302} - -/^\X{2,3}(.)/8 - A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - -/^\X{2,3}?(.)/8 - A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - -/^\pN{2,3}X/ - 12X - 123X - *** Failers - X - 1X - 1234X - -/\x{100}/i8 - \x{100} - \x{101} - -/ End / diff --git a/ext/pcre/pcrelib/testdata/testoutput1 b/ext/pcre/pcrelib/testdata/testoutput1 deleted file mode 100644 index 1f835b7886bf1..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput1 +++ /dev/null @@ -1,6287 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/the quick brown fox/ - the quick brown fox - 0: the quick brown fox - The quick brown FOX -No match - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? -No match - -/The quick brown fox/i - the quick brown fox - 0: the quick brown fox - The quick brown FOX - 0: The quick brown FOX - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? - 0: THE QUICK BROWN FOX - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - 0: aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - 0: aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - 0: aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - 0: aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - 0: aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - 0: abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - 0: aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - 0: abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - 0: aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - 0: aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - 0: aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - *** Failers -No match - abxyzpqrrabbxyyyypqAzz -No match - abxyzpqrrrrabbxyyyypqAzz -No match - abxyzpqrrrabxyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyypqAzz -No match - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz -No match - -/^(abc){1,2}zz/ - abczz - 0: abczz - 1: abc - abcabczz - 0: abcabczz - 1: abc - *** Failers -No match - zz -No match - abcabcabczz -No match - >>abczz -No match - -/^(b+?|a){1,2}?c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: b - bbbc - 0: bbbc - 1: bb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: bb - bbbc - 0: bbbc - 1: bbb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}?bc/ - bbc - 0: bbc - 1: b - -/^(b*|ba){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba - *** Failers -No match - bababbc -No match - babababc -No match - -/^(ba|b*){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba - *** Failers -No match - bababbc -No match - babababc -No match - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - 0: \x01\x01\x1b;z - -/^[ab\]cde]/ - athing - 0: a - bthing - 0: b - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - fthing -No match - [thing -No match - \\thing -No match - -/^[]cde]/ - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - athing -No match - fthing -No match - -/^[^ab\]cde]/ - fthing - 0: f - [thing - 0: [ - \\thing - 0: \ - *** Failers - 0: * - athing -No match - bthing -No match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^[^]cde]/ - athing - 0: a - fthing - 0: f - *** Failers - 0: * - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^\/ -  - 0: \x81 - -/^˙/ - ˙ - 0: \xff - -/^[0-9]+$/ - 0 - 0: 0 - 1 - 0: 1 - 2 - 0: 2 - 3 - 0: 3 - 4 - 0: 4 - 5 - 0: 5 - 6 - 0: 6 - 7 - 0: 7 - 8 - 0: 8 - 9 - 0: 9 - 10 - 0: 10 - 100 - 0: 100 - *** Failers -No match - abc -No match - -/^.*nter/ - enter - 0: enter - inter - 0: inter - uponter - 0: uponter - -/^xxx[0-9]+$/ - xxx0 - 0: xxx0 - xxx1234 - 0: xxx1234 - *** Failers -No match - xxx -No match - -/^.+[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - 0: abc!pqr=apquxz.ixr.zzz.ac.uk - 1: abc - 2: pqr - *** Failers -No match - !pqr=apquxz.ixr.zzz.ac.uk -No match - abc!=apquxz.ixr.zzz.ac.uk -No match - abc!pqr=apquxz:ixr.zzz.ac.uk -No match - abc!pqr=apquxz.ixr.zzz.ac.ukk -No match - -/:/ - Well, we need a colon: somewhere - 0: : - *** Fail if we don't -No match - -/([\da-f:]+)$/i - 0abc - 0: 0abc - 1: 0abc - abc - 0: abc - 1: abc - fed - 0: fed - 1: fed - E - 0: E - 1: E - :: - 0: :: - 1: :: - 5f03:12C0::932e - 0: 5f03:12C0::932e - 1: 5f03:12C0::932e - fed def - 0: def - 1: def - Any old stuff - 0: ff - 1: ff - *** Failers -No match - 0zzz -No match - gzzz -No match - fed\x20 -No match - Any old rubbish -No match - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - 0: .1.2.3 - 1: 1 - 2: 2 - 3: 3 - A.12.123.0 - 0: A.12.123.0 - 1: 12 - 2: 123 - 3: 0 - *** Failers -No match - .1.2.3333 -No match - 1.2.3 -No match - 1234.2.3 -No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1: 1 - 2: non-sp1 - 3: non-sp2 - 1 IN SOA non-sp1 non-sp2 ( - 0: 1 IN SOA non-sp1 non-sp2 ( - 1: 1 - 2: non-sp1 - 3: non-sp2 - *** Failers -No match - 1IN SOA non-sp1 non-sp2( -No match - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - 0: a. - Z. - 0: Z. - 2. - 0: 2. - ab-c.pq-r. - 0: ab-c.pq-r. - 1: .pq-r - sxk.zzz.ac.uk. - 0: sxk.zzz.ac.uk. - 1: .uk - x-.y-. - 0: x-.y-. - 1: .y- - *** Failers -No match - -abc.peq. -No match - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - 0: *.a - *.b0-a - 0: *.b0-a - 1: 0-a - *.c3-b.c - 0: *.c3-b.c - 1: 3-b - 2: .c - *.c-a.b-c - 0: *.c-a.b-c - 1: -a - 2: .b-c - 3: -c - *** Failers -No match - *.0 -No match - *.a- -No match - *.a-b.c- -No match - *.c-a.0-c -No match - -/^(?=ab(de))(abd)(e)/ - abde - 0: abde - 1: de - 2: abd - 3: e - -/^(?!(ab)de|x)(abd)(f)/ - abdf - 0: abdf - 1: <unset> - 2: abd - 3: f - -/^(?=(ab(cd)))(ab)/ - abcd - 0: ab - 1: abcd - 2: cd - 3: ab - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - 0: a.b.c.d - 1: .d - A.B.C.D - 0: A.B.C.D - 1: .D - a.b.c.1.2.3.C - 0: a.b.c.1.2.3.C - 1: .C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - 0: "1234" - \"abcd\" ; - 0: "abcd" ; - 1: ; - \"\" ; rhubarb - 0: "" ; rhubarb - 1: ; rhubarb - *** Failers -No match - \"1234\" : things -No match - -/^$/ - \ - 0: - *** Failers -No match - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/^ a\ b[c ]d $/x - a bcd - 0: a bcd - a b d - 0: a b d - *** Failers -No match - abcd -No match - ab d -No match - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: abc - 2: bc - 3: c - 4: def - 5: ef - 6: f - 7: hij - 8: ij - 9: j -10: klm -11: lm -12: m - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: bc - 2: c - 3: ef - 4: f - 5: ij - 6: j - 7: lm - 8: m - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - 0: a+ Z0+\x08\x0a\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - 0: .^$(*+)|{?,?} - -/^a*\w/ - z - 0: z - az - 0: az - aaaz - 0: aaaz - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - a+ - 0: a - aa+ - 0: aa - -/^a*?\w/ - z - 0: z - az - 0: a - aaaz - 0: a - a - 0: a - aa - 0: a - aaaa - 0: a - a+ - 0: a - aa+ - 0: a - -/^a+\w/ - az - 0: az - aaaz - 0: aaaz - aa - 0: aa - aaaa - 0: aaaa - aa+ - 0: aa - -/^a+?\w/ - az - 0: az - aaaz - 0: aa - aa - 0: aa - aaaa - 0: aa - aa+ - 0: aa - -/^\d{8}\w{2,}/ - 1234567890 - 0: 1234567890 - 12345678ab - 0: 12345678ab - 12345678__ - 0: 12345678__ - *** Failers -No match - 1234567 -No match - -/^[aeiou\d]{4,5}$/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - aaaaa - 0: aaaaa - *** Failers -No match - 123456 -No match - -/^[aeiou\d]{4,5}?/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 1234 - aaaaa - 0: aaaa - 123456 - 0: 1234 - -/\A(abc|def)=(\1){2,3}\Z/ - abc=abcabc - 0: abc=abcabc - 1: abc - 2: abc - def=defdefdef - 0: def=defdefdef - 1: def - 2: def - *** Failers -No match - abc=defdef -No match - -/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ - abcdefghijkcda2 - 0: abcdefghijkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - abcdefghijkkkkcda2 - 0: abcdefghijkkkkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - -/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ - cataract cataract23 - 0: cataract cataract23 - 1: cataract - 2: aract - 3: ract - 4: - 5: 3 - catatonic catatonic23 - 0: catatonic catatonic23 - 1: catatonic - 2: atonic - 3: tonic - 4: - 5: 3 - caterpillar caterpillar23 - 0: caterpillar caterpillar23 - 1: caterpillar - 2: erpillar - 3: <unset> - 4: - 5: 3 - - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: abcd - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: Sep - From abcd Mon Sep 1 12:33:02 1997 - 0: From abcd Mon Sep 1 12:33 - 1: Sep - *** Failers -No match - From abcd Sep 01 12:33:02 1997 -No match - -/^12.34/s - 12\n34 - 0: 12\x0a34 - 12\r34 - 0: 12\x0d34 - -/\w+(?=\t)/ - the quick brown\t fox - 0: brown - -/foo(?!bar)(.*)/ - foobar is foolish see? - 0: foolish see? - 1: lish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - 0: rowbar etc - 1: etc - barrel - 0: barrel - 1: rel - 2barrel - 0: 2barrel - 1: rel - A barrel - 0: A barrel - 1: rel - -/^(\D*)(?=\d)(?!123)/ - abc456 - 0: abc - 1: abc - *** Failers -No match - abc123 -No match - -/^1234(?# test newlines - inside)/ - 1234 - 0: 1234 - -/^1234 #comment in extended re - /x - 1234 - 0: 1234 - -/#rhubarb - abcd/x - abcd - 0: abcd - -/^abcd#rhubarb/x - abcd - 0: abcd - -/^(a)\1{2,3}(.)/ - aaab - 0: aaab - 1: a - 2: b - aaaab - 0: aaaab - 1: a - 2: b - aaaaab - 0: aaaaa - 1: a - 2: a - aaaaaab - 0: aaaaa - 1: a - 2: a - -/(?!^)abc/ - the abc - 0: abc - *** Failers -No match - abc -No match - -/(?=^)abc/ - abc - 0: abc - *** Failers -No match - the abc -No match - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - 0: aabb - 1: b - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: abbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - 0: aa - 1: a - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - 0: aabb - 1: b - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other <user\@dom.ain> - 0: Alan Other <user@dom.ain> - <user\@dom.ain> - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - 0: "A. Other" <user.1234@dom.ain> (a comment) - A. Other <user.1234\@dom.ain> (a comment) - 0: Other <user.1234@dom.ain> (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle <user\@some.where - 0: user@some.where - *** Failers -No match - The quick brown fox -No match - -/[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional leading comment -(?: -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other <user\@dom.ain> - 0: Alan Other <user@dom.ain> - <user\@dom.ain> - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" <user.1234\@dom.ain> (a comment) - 0: "A. Other" <user.1234@dom.ain> - A. Other <user.1234\@dom.ain> (a comment) - 0: Other <user.1234@dom.ain> - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle <user\@some.where - 0: user@some.where - *** Failers -No match - The quick brown fox -No match - -/abc\0def\00pqr\000xyz\0000AB/ - abc\0def\00pqr\000xyz\0000AB - 0: abc\x00def\x00pqr\x00xyz\x000AB - abc456 abc\0def\00pqr\000xyz\0000ABCDE - 0: abc\x00def\x00pqr\x00xyz\x000AB - -/abc\x0def\x00pqr\x000xyz\x0000AB/ - abc\x0def\x00pqr\x000xyz\x0000AB - 0: abc\x0def\x00pqr\x000xyz\x0000AB - abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE - 0: abc\x0def\x00pqr\x000xyz\x0000AB - -/^[\000-\037]/ - \0A - 0: \x00 - \01B - 0: \x01 - \037C - 0: \x1f - -/\0*/ - \0\0\0\0 - 0: \x00\x00\x00\x00 - -/A\x0{2,3}Z/ - The A\x0\x0Z - 0: A\x00\x00Z - An A\0\x0\0Z - 0: A\x00\x00\x00Z - *** Failers -No match - A\0Z -No match - A\0\x0\0\x0Z -No match - -/^(cow|)\1(bell)/ - cowcowbell - 0: cowcowbell - 1: cow - 2: bell - bell - 0: bell - 1: - 2: bell - *** Failers -No match - cowbell -No match - -/^\s/ - \040abc - 0: - \x0cabc - 0: \x0c - \nabc - 0: \x0a - \rabc - 0: \x0d - \tabc - 0: \x09 - *** Failers -No match - abc -No match - -/^a b - - c/x - abc - 0: abc - -/^(a|)\1*b/ - ab - 0: ab - 1: a - aaaab - 0: aaaab - 1: a - b - 0: b - 1: - *** Failers -No match - acb -No match - -/^(a|)\1+b/ - aab - 0: aab - 1: a - aaaab - 0: aaaab - 1: a - b - 0: b - 1: - *** Failers -No match - ab -No match - -/^(a|)\1?b/ - ab - 0: ab - 1: a - aab - 0: aab - 1: a - b - 0: b - 1: - *** Failers -No match - acb -No match - -/^(a|)\1{2}b/ - aaab - 0: aaab - 1: a - b - 0: b - 1: - *** Failers -No match - ab -No match - aab -No match - aaaab -No match - -/^(a|)\1{2,3}b/ - aaab - 0: aaab - 1: a - aaaab - 0: aaaab - 1: a - b - 0: b - 1: - *** Failers -No match - ab -No match - aab -No match - aaaaab -No match - -/ab{1,3}bc/ - abbbbc - 0: abbbbc - abbbc - 0: abbbc - abbc - 0: abbc - *** Failers -No match - abc -No match - abbbbbc -No match - -/([^.]*)\.([^:]*):[T ]+(.*)/ - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1 - 2: title - 3: Blah blah blah - -/([^.]*)\.([^:]*):[T ]+(.*)/i - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1 - 2: title - 3: Blah blah blah - -/([^.]*)\.([^:]*):[t ]+(.*)/i - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1 - 2: title - 3: Blah blah blah - -/^[W-c]+$/ - WXY_^abc - 0: WXY_^abc - *** Failers -No match - wxy -No match - -/^[W-c]+$/i - WXY_^abc - 0: WXY_^abc - wxy_^ABC - 0: wxy_^ABC - -/^[\x3f-\x5F]+$/i - WXY_^abc - 0: WXY_^abc - wxy_^ABC - 0: wxy_^ABC - -/^abc$/m - abc - 0: abc - qqq\nabc - 0: abc - abc\nzzz - 0: abc - qqq\nabc\nzzz - 0: abc - -/^abc$/ - abc - 0: abc - *** Failers -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -/\Aabc\Z/m - abc - 0: abc - abc\n - 0: abc - *** Failers -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -/\A(.)*\Z/s - abc\ndef - 0: abc\x0adef - 1: f - -/\A(.)*\Z/m - *** Failers - 0: *** Failers - 1: s - abc\ndef -No match - -/(?:b)|(?::+)/ - b::c - 0: b - c::b - 0: :: - -/[-az]+/ - az- - 0: az- - *** Failers - 0: a - b -No match - -/[az-]+/ - za- - 0: za- - *** Failers - 0: a - b -No match - -/[a\-z]+/ - a-z - 0: a-z - *** Failers - 0: a - b -No match - -/[a-z]+/ - abcdxyz - 0: abcdxyz - -/[\d-]+/ - 12-34 - 0: 12-34 - *** Failers -No match - aaa -No match - -/[\d-z]+/ - 12-34z - 0: 12-34z - *** Failers -No match - aaa -No match - -/\x5c/ - \\ - 0: \ - -/\x20Z/ - the Zoo - 0: Z - *** Failers -No match - Zulu -No match - -/(abc)\1/i - abcabc - 0: abcabc - 1: abc - ABCabc - 0: ABCabc - 1: ABC - abcABC - 0: abcABC - 1: abc - -/ab{3cd/ - ab{3cd - 0: ab{3cd - -/ab{3,cd/ - ab{3,cd - 0: ab{3,cd - -/ab{3,4a}cd/ - ab{3,4a}cd - 0: ab{3,4a}cd - -/{4,5a}bc/ - {4,5a}bc - 0: {4,5a}bc - -/^a.b/ - a\rb - 0: a\x0db - *** Failers -No match - a\nb -No match - -/abc$/ - abc - 0: abc - abc\n - 0: abc - *** Failers -No match - abc\ndef -No match - -/(abc)\123/ - abc\x53 - 0: abcS - 1: abc - -/(abc)\223/ - abc\x93 - 0: abc\x93 - 1: abc - -/(abc)\323/ - abc\xd3 - 0: abc\xd3 - 1: abc - -/(abc)\500/ - abc\x40 - 0: abc@ - 1: abc - abc\100 - 0: abc@ - 1: abc - -/(abc)\5000/ - abc\x400 - 0: abc@0 - 1: abc - abc\x40\x30 - 0: abc@0 - 1: abc - abc\1000 - 0: abc@0 - 1: abc - abc\100\x30 - 0: abc@0 - 1: abc - abc\100\060 - 0: abc@0 - 1: abc - abc\100\60 - 0: abc@0 - 1: abc - -/abc\81/ - abc\081 - 0: abc\x0081 - abc\0\x38\x31 - 0: abc\x0081 - -/abc\91/ - abc\091 - 0: abc\x0091 - abc\0\x39\x31 - 0: abc\x0091 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/ - abcdefghijkllS - 0: abcdefghijkllS - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: l - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - 0: abcdefghijk\x0aS - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k - -/ab\gdef/ - abgdef - 0: abgdef - -/a{0}bc/ - bc - 0: bc - -/(a|(bc)){0,0}?xyz/ - xyz - 0: xyz - -/abc[\10]de/ - abc\010de - 0: abc\x08de - -/abc[\1]de/ - abc\1de - 0: abc\x01de - -/(abc)[\1]de/ - abc\1de - 0: abc\x01de - 1: abc - -/(?s)a.b/ - a\nb - 0: a\x0ab - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - 0: baNOTcccc - 1: b - 2: a - 3: NOT - 4: cccc - baNOTcccd - 0: baNOTccc - 1: b - 2: a - 3: NOT - 4: ccc - baNOTccd - 0: baNOTcc - 1: b - 2: a - 3: NO - 4: Tcc - bacccd - 0: baccc - 1: b - 2: a - 3: - 4: ccc - *** Failers - 0: *** Failers - 1: * - 2: * - 3: * Fail - 4: ers - anything -No match - b\bc -No match - baccd -No match - -/[^a]/ - Abc - 0: A - -/[^a]/i - Abc - 0: b - -/[^a]+/ - AAAaAbc - 0: AAA - -/[^a]+/i - AAAaAbc - 0: bc - -/[^a]+/ - bbb\nccc - 0: bbb\x0accc - -/[^k]$/ - abc - 0: c - *** Failers - 0: s - abk -No match - -/[^k]{2,3}$/ - abc - 0: abc - kbc - 0: bc - kabc - 0: abc - *** Failers - 0: ers - abk -No match - akb -No match - akk -No match - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 0: 12345678@a.b.c.d - 123456789\@x.y.z - 0: 123456789@x.y.z - *** Failers -No match - 12345678\@x.y.uk -No match - 1234567\@a.b.c.d -No match - -/(a)\1{8,}/ - aaaaaaaaa - 0: aaaaaaaaa - 1: a - aaaaaaaaaa - 0: aaaaaaaaaa - 1: a - *** Failers -No match - aaaaaaa -No match - -/[^a]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^a]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/[^az]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^az]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 - 1.235 - 0: .235 - 1: .23 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 0: .23 - 1: .23 - 2: - 1.875000282 - 0: .875 - 1: .875 - 2: 5 - *** Failers -No match - 1.235 -No match - -/a(?)b/ - ab - 0: ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - 0: foo table - 1: foo - 2: table - -/foo(.*)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: d is under the bar in the - -/foo(.*?)bar/ - The food is under the bar in the barn. - 0: food is under the bar - 1: d is under the - -/(.*)(\d*)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 53147 - 2: - -/(.*)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - 0: - 1: - 2: - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 - 1: I have - 2: 2 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/^\D*(?!123)/ - ABC123 - 0: AB - -/^(\D*)(?=\d)(?!123)/ - ABC445 - 0: ABC - 1: ABC - *** Failers -No match - ABC123 -No match - -/^[W-]46]/ - W46]789 - 0: W46] - -46]789 - 0: -46] - *** Failers -No match - Wall -No match - Zebra -No match - 42 -No match - [abcd] -No match - ]abcd[ -No match - -/^[W-\]46]/ - W46]789 - 0: W - Wall - 0: W - Zebra - 0: Z - Xylophone - 0: X - 42 - 0: 4 - [abcd] - 0: [ - ]abcd[ - 0: ] - \\backslash - 0: \ - *** Failers -No match - -46]789 -No match - well -No match - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - 0: 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/^(a){0,0}/ - bcd - 0: - abc - 0: - aab - 0: - -/^(a){0,1}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: a - 1: a - -/^(a){0,2}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - -/^(a){0,3}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - -/^(a){0,}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a - -/^(a){1,1}/ - bcd -No match - abc - 0: a - 1: a - aab - 0: a - 1: a - -/^(a){1,2}/ - bcd -No match - abc - 0: a - 1: a - aab - 0: aa - 1: a - -/^(a){1,3}/ - bcd -No match - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - -/^(a){1,}/ - bcd -No match - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a - -/.*\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.{0,}\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/m - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*\.gif/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*$/ - borfle\nbib.gif\nno - 0: no - -/.*$/m - borfle\nbib.gif\nno - 0: borfle - -/.*$/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ - borfle\nbib.gif\nno\n - 0: no - -/.*$/m - borfle\nbib.gif\nno\n - 0: borfle - -/.*$/s - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/.*$/ms - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/(.*X|^B)/ - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/m - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(.*X|^B)/s - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/ms - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B - *** Failers -No match - abcde\nBar -No match - -/(?s:.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/^.*B/ - **** Failers -No match - abc\nB -No match - -/(?s)^.*B/ - abc\nB - 0: abc\x0aB - -/(?m)^.*B/ - abc\nB - 0: B - -/(?ms)^.*B/ - abc\nB - 0: abc\x0aB - -/(?ms)^B/ - abc\nB - 0: B - -/(?s)B$/ - B\n - 0: B - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - 0: 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - 0: 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - 0: 123456654321 - -/^[abc]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - 0: abcabcabcabc - 1: c - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - 0: n - *** Failers -No match - z -No match - -/abcde{0,0}/ - abcd - 0: abcd - *** Failers -No match - abce -No match - -/ab[cd]{0,0}e/ - abe - 0: abe - *** Failers -No match - abcde -No match - -/ab(c){0,0}d/ - abd - 0: abd - *** Failers -No match - abcd -No match - -/a(b*)/ - a - 0: a - 1: - ab - 0: ab - 1: b - abbbb - 0: abbbb - 1: bbbb - *** Failers - 0: a - 1: - bbbbb -No match - -/ab\d{0}e/ - abe - 0: abe - *** Failers -No match - ab1e -No match - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - 0: "quick" - 1: quick - \"the \\\"quick\\\" brown fox\" - 0: "the \"quick\" brown fox" - 1: brown fox - -/.*?/g+ - abc - 0: - 0+ abc - 0: a - 0+ bc - 0: - 0+ bc - 0: b - 0+ c - 0: - 0+ c - 0: c - 0+ - 0: - 0+ - -/\b/g+ - abc - 0: - 0+ abc - 0: - 0+ - -/\b/+g - abc - 0: - 0+ abc - 0: - 0+ - -//g - abc - 0: - 0: - 0: - 0: - -/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - 0: <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - 1: BGCOLOR='#DBE9E9' - 2: align=left valign=top - 3: 43. - 4: <a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286) - 5: - 6: - 7: <unset> - 8: align=left valign=top - 9: Lega lstaff.com -10: align=left valign=top -11: CA - Statewide - -/a[^a]b/ - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/ - acb - 0: acb - *** Failers -No match - a\nb -No match - -/a[^a]b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/^(b+?|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/^(b+|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/(?!\A)x/m - x\nb\n -No match - a\bx\n - 0: x - -/\x0{ab}/ - \0{ab} - 0: \x00{ab} - -/(A|B)*?CD/ - CD - 0: CD - -/(A|B)*CD/ - CD - 0: CD - -/(AB)*?\1/ - ABABAB - 0: ABAB - 1: AB - -/(AB)*\1/ - ABABAB - 0: ABABAB - 1: AB - -/(?<!bar)foo/ - foo - 0: foo - catfood - 0: foo - arfootle - 0: foo - rfoosh - 0: foo - *** Failers -No match - barfoo -No match - towbarfoo -No match - -/\w{3}(?<!bar)foo/ - catfood - 0: catfoo - *** Failers -No match - foo -No match - barfoo -No match - towbarfoo -No match - -/(?<=(foo)a)bar/ - fooabar - 0: bar - 1: foo - *** Failers -No match - bar -No match - foobbar -No match - -/\Aabc\z/m - abc - 0: abc - *** Failers -No match - abc\n -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ -No match - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 - *** Failers -No match - 1.235 -No match - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - 1: party - *** Failers -No match - this is not a line with only words and spaces! -No match - -/(\d+)(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a - 12345+ - 0: 12345 - 1: 1234 - 2: 5 - -/((?>\d+))(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a - *** Failers -No match - 12345+ -No match - -/(?>a+)b/ - aaab - 0: aaab - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/(?>b)+/ - aaabbbccc - 0: bbb - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbc - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - 0: (abc) - 1: abc - (abc(def)xyz) - 0: (abc(def)xyz) - 1: xyz - *** Failers -No match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/a(?-i)b/i - ab - 0: ab - Ab - 0: Ab - *** Failers -No match - aB -No match - AB -No match - -/(a (?x)b c)d e/ - a bcd e - 0: a bcd e - 1: a bc - *** Failers -No match - a b cd e -No match - abcd e -No match - a bcde -No match - -/(a b(?x)c d (?-x)e f)/ - a bcde f - 0: a bcde f - 1: a bcde f - *** Failers -No match - abcdef -No match - -/(a(?i)b)c/ - abc - 0: abc - 1: ab - aBc - 0: aBc - 1: aB - *** Failers -No match - abC -No match - aBC -No match - Abc -No match - ABc -No match - ABC -No match - AbC -No match - -/a(?i:b)c/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - ABC -No match - abC -No match - aBC -No match - -/a(?i:b)*c/ - aBc - 0: aBc - aBBc - 0: aBBc - *** Failers -No match - aBC -No match - aBBC -No match - -/a(?=b(?i)c)\w\wd/ - abcd - 0: abcd - abCd - 0: abCd - *** Failers -No match - aBCd -No match - abcD -No match - -/(?s-i:more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?:(?s-i)more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?>a(?i)b+)+c/ - abc - 0: abc - aBbc - 0: aBbc - aBBc - 0: aBBc - *** Failers -No match - Abc -No match - abAb -No match - abbC -No match - -/(?=a(?i)b)\w\wc/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - Ab -No match - abC -No match - aBC -No match - -/(?<=a(?i)b)(\w\w)c/ - abxxc - 0: xxc - 1: xx - aBxxc - 0: xxc - 1: xx - *** Failers -No match - Abxxc -No match - ABxxc -No match - abxxC -No match - -/(?:(a)|b)(?(1)A|B)/ - aA - 0: aA - 1: a - bB - 0: bB - *** Failers -No match - aB -No match - bA -No match - -/^(a)?(?(1)a|b)+$/ - aa - 0: aa - 1: a - b - 0: b - bb - 0: bb - *** Failers -No match - ab -No match - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/(?(?<=foo)bar|cat)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat - *** Failers -No match - foocat -No match - -/(?(?<!foo)cat|bar)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat - *** Failers -No match - foocat -No match - -/( \( )? [^()]+ (?(1) \) |) /x - abcd - 0: abcd - (abcd) - 0: (abcd) - 1: ( - the quick (abcd) fox - 0: the quick - (abcd - 0: abcd - -/( \( )? [^()]+ (?(1) \) ) /x - abcd - 0: abcd - (abcd) - 0: (abcd) - 1: ( - the quick (abcd) fox - 0: the quick - (abcd - 0: abcd - -/^(?(2)a|(1)(2))+$/ - 12 - 0: 12 - 1: 1 - 2: 2 - 12a - 0: 12a - 1: 1 - 2: 2 - 12aa - 0: 12aa - 1: 1 - 2: 2 - *** Failers -No match - 1234 -No match - -/((?i)blah)\s+\1/ - blah blah - 0: blah blah - 1: blah - BLAH BLAH - 0: BLAH BLAH - 1: BLAH - Blah Blah - 0: Blah Blah - 1: Blah - blaH blaH - 0: blaH blaH - 1: blaH - *** Failers -No match - blah BLAH -No match - Blah blah -No match - blaH blah -No match - -/((?i)blah)\s+(?i:\1)/ - blah blah - 0: blah blah - 1: blah - BLAH BLAH - 0: BLAH BLAH - 1: BLAH - Blah Blah - 0: Blah Blah - 1: Blah - blaH blaH - 0: blaH blaH - 1: blaH - blah BLAH - 0: blah BLAH - 1: blah - Blah blah - 0: Blah blah - 1: Blah - blaH blah - 0: blaH blah - 1: blaH - -/(?>a*)*/ - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - -/(abc|)+/ - abc - 0: abc - 1: - abcabc - 0: abcabc - 1: - abcabcabc - 0: abcabcabc - 1: - xyz - 0: - 1: - -/([a]*)*/ - a - 0: a - 1: - aaaaa - 0: aaaaa - 1: - -/([ab]*)*/ - a - 0: a - 1: - b - 0: b - 1: - ababab - 0: ababab - 1: - aaaabcde - 0: aaaab - 1: - bbbb - 0: bbbb - 1: - -/([^a]*)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: - aaa - 0: - 1: - -/([^ab]*)*/ - cccc - 0: cccc - 1: - abab - 0: - 1: - -/([a]*?)*/ - a - 0: - 1: - aaaa - 0: - 1: - -/([ab]*?)*/ - a - 0: - 1: - b - 0: - 1: - abab - 0: - 1: - baba - 0: - 1: - -/([^a]*?)*/ - b - 0: - 1: - bbbb - 0: - 1: - aaa - 0: - 1: - -/([^ab]*?)*/ - c - 0: - 1: - cccc - 0: - 1: - baba - 0: - 1: - -/(?>a*)*/ - a - 0: a - aaabcde - 0: aaa - -/((?>a*))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/((?>a*?))*/ - aaaaa - 0: - 1: - aabbaa - 0: - 1: - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 0: 12-sep-98 - 12-09-98 - 0: 12-09-98 - *** Failers -No match - sep-12-98 -No match - -/(?<=(foo))bar\1/ - foobarfoo - 0: barfoo - 1: foo - foobarfootling - 0: barfoo - 1: foo - *** Failers -No match - foobar -No match - barfoo -No match - -/(?i:saturday|sunday)/ - saturday - 0: saturday - sunday - 0: sunday - Saturday - 0: Saturday - Sunday - 0: Sunday - SATURDAY - 0: SATURDAY - SUNDAY - 0: SUNDAY - SunDay - 0: SunDay - -/(a(?i)bc|BB)x/ - abcx - 0: abcx - 1: abc - aBCx - 0: aBCx - 1: aBC - bbx - 0: bbx - 1: bb - BBx - 0: BBx - 1: BB - *** Failers -No match - abcX -No match - aBCX -No match - bbX -No match - BBX -No match - -/^([ab](?i)[cd]|[ef])/ - ac - 0: ac - 1: ac - aC - 0: aC - 1: aC - bD - 0: bD - 1: bD - elephant - 0: e - 1: e - Europe - 0: E - 1: E - frog - 0: f - 1: f - France - 0: F - 1: F - *** Failers -No match - Africa -No match - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - 0: ab - 1: ab - aBd - 0: aBd - 1: aBd - xy - 0: xy - 1: xy - xY - 0: xY - 1: xY - zebra - 0: z - 1: z - Zambesi - 0: Z - 1: Z - *** Failers -No match - aCD -No match - XY -No match - -/(?<=foo\n)^bar/m - foo\nbar - 0: bar - *** Failers -No match - bar -No match - baz\nbar -No match - -/(?<=(?<!foo)bar)baz/ - barbaz - 0: baz - barbarbaz - 0: baz - koobarbaz - 0: baz - *** Failers -No match - baz -No match - foobarbaz -No match - -/The case of aaaaaa is missed out below because I think Perl 5.005_02 gets/ -/it wrong; it sets $1 to aaa rather than aa. Compare the following test,/ -No match -/where it does set $1 to aa when matching aaaaaa./ -No match - -/^(a\1?){4}$/ - a -No match - aa -No match - aaa -No match - aaaa - 0: aaaa - 1: a - aaaaa - 0: aaaaa - 1: a - aaaaaaa - 0: aaaaaaa - 1: a - aaaaaaaa -No match - aaaaaaaaa -No match - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa - aaaaaaaaaaa -No match - aaaaaaaaaaaa -No match - aaaaaaaaaaaaa -No match - aaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaaa -No match - -/^(a\1?)(a\1?)(a\2?)(a\3?)$/ - a -No match - aa -No match - aaa -No match - aaaa - 0: aaaa - 1: a - 2: a - 3: a - 4: a - aaaaa - 0: aaaaa - 1: a - 2: aa - 3: a - 4: a - aaaaaa - 0: aaaaaa - 1: a - 2: aa - 3: a - 4: aa - aaaaaaa - 0: aaaaaaa - 1: a - 2: aa - 3: aaa - 4: a - aaaaaaaa -No match - aaaaaaaaa -No match - aaaaaaaaaa - 0: aaaaaaaaaa - 1: a - 2: aa - 3: aaa - 4: aaaa - aaaaaaaaaaa -No match - aaaaaaaaaaaa -No match - aaaaaaaaaaaaa -No match - aaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaaa -No match - -/The following tests are taken from the Perl 5.005 test suite; some of them/ -/are compatible with 5.004, but I'd rather not have to sort them out./ -No match - -/abc/ - abc - 0: abc - xabcy - 0: abc - ababc - 0: abc - *** Failers -No match - xbc -No match - axc -No match - abx -No match - -/ab*c/ - abc - 0: abc - -/ab*bc/ - abc - 0: abc - abbc - 0: abbc - abbbbc - 0: abbbbc - -/.{1}/ - abbbbc - 0: a - -/.{3,4}/ - abbbbc - 0: abbb - -/ab{0,}bc/ - abbbbc - 0: abbbbc - -/ab+bc/ - abbc - 0: abbc - *** Failers -No match - abc -No match - abq -No match - -/ab{1,}bc/ - -/ab+bc/ - abbbbc - 0: abbbbc - -/ab{1,}bc/ - abbbbc - 0: abbbbc - -/ab{1,3}bc/ - abbbbc - 0: abbbbc - -/ab{3,4}bc/ - abbbbc - 0: abbbbc - -/ab{4,5}bc/ - *** Failers -No match - abq -No match - abbbbc -No match - -/ab?bc/ - abbc - 0: abbc - abc - 0: abc - -/ab{0,1}bc/ - abc - 0: abc - -/ab?bc/ - -/ab?c/ - abc - 0: abc - -/ab{0,1}c/ - abc - 0: abc - -/^abc$/ - abc - 0: abc - *** Failers -No match - abbbbc -No match - abcc -No match - -/^abc/ - abcc - 0: abc - -/^abc$/ - -/abc$/ - aabc - 0: abc - *** Failers -No match - aabc - 0: abc - aabcd -No match - -/^/ - abc - 0: - -/$/ - abc - 0: - -/a.c/ - abc - 0: abc - axc - 0: axc - -/a.*c/ - axyzc - 0: axyzc - -/a[bc]d/ - abd - 0: abd - *** Failers -No match - axyzd -No match - abc -No match - -/a[b-d]e/ - ace - 0: ace - -/a[b-d]/ - aac - 0: ac - -/a[-b]/ - a- - 0: a- - -/a[b-]/ - a- - 0: a- - -/a]/ - a] - 0: a] - -/a[]]b/ - a]b - 0: a]b - -/a[^bc]d/ - aed - 0: aed - *** Failers -No match - abd -No match - abd -No match - -/a[^-b]c/ - adc - 0: adc - -/a[^]b]c/ - adc - 0: adc - *** Failers -No match - a-c - 0: a-c - a]c -No match - -/\ba\b/ - a- - 0: a - -a - 0: a - -a- - 0: a - -/\by\b/ - *** Failers -No match - xy -No match - yz -No match - xyz -No match - -/\Ba\B/ - *** Failers - 0: a - a- -No match - -a -No match - -a- -No match - -/\By\b/ - xy - 0: y - -/\by\B/ - yz - 0: y - -/\By\B/ - xyz - 0: y - -/\w/ - a - 0: a - -/\W/ - - - 0: - - *** Failers - 0: * - - - 0: - - a -No match - -/a\sb/ - a b - 0: a b - -/a\Sb/ - a-b - 0: a-b - *** Failers -No match - a-b - 0: a-b - a b -No match - -/\d/ - 1 - 0: 1 - -/\D/ - - - 0: - - *** Failers - 0: * - - - 0: - - 1 -No match - -/[\w]/ - a - 0: a - -/[\W]/ - - - 0: - - *** Failers - 0: * - - - 0: - - a -No match - -/a[\s]b/ - a b - 0: a b - -/a[\S]b/ - a-b - 0: a-b - *** Failers -No match - a-b - 0: a-b - a b -No match - -/[\d]/ - 1 - 0: 1 - -/[\D]/ - - - 0: - - *** Failers - 0: * - - - 0: - - 1 -No match - -/ab|cd/ - abc - 0: ab - abcd - 0: ab - -/()ef/ - def - 0: ef - 1: - -/$b/ - -/a\(b/ - a(b - 0: a(b - -/a\(*b/ - ab - 0: ab - a((b - 0: a((b - -/a\\b/ - a\b -No match - -/((a))/ - abc - 0: a - 1: a - 2: a - -/(a)b(c)/ - abc - 0: abc - 1: a - 2: c - -/a+b+c/ - aabbabc - 0: abc - -/a{1,}b{1,}c/ - aabbabc - 0: abc - -/a.+?c/ - abcabc - 0: abc - -/(a+|b)*/ - ab - 0: ab - 1: b - -/(a+|b){0,}/ - ab - 0: ab - 1: b - -/(a+|b)+/ - ab - 0: ab - 1: b - -/(a+|b){1,}/ - ab - 0: ab - 1: b - -/(a+|b)?/ - ab - 0: a - 1: a - -/(a+|b){0,1}/ - ab - 0: a - 1: a - -/[^ab]*/ - cde - 0: cde - -/abc/ - *** Failers -No match - b -No match - - -/a*/ - - -/([abc])*d/ - abbbcd - 0: abbbcd - 1: c - -/([abc])*bcd/ - abcd - 0: abcd - 1: a - -/a|b|c|d|e/ - e - 0: e - -/(a|b|c|d|e)f/ - ef - 0: ef - 1: e - -/abcd*efg/ - abcdefg - 0: abcdefg - -/ab*/ - xabyabbbz - 0: ab - xayabbbz - 0: a - -/(ab|cd)e/ - abcde - 0: cde - 1: cd - -/[abhgefdc]ij/ - hij - 0: hij - -/^(ab|cd)e/ - -/(abc|)ef/ - abcdef - 0: ef - 1: - -/(a|b)c*d/ - abcd - 0: bcd - 1: b - -/(ab|ab*)bc/ - abc - 0: abc - 1: a - -/a([bc]*)c*/ - abc - 0: abc - 1: bc - -/a([bc]*)(c*d)/ - abcd - 0: abcd - 1: bc - 2: d - -/a([bc]+)(c*d)/ - abcd - 0: abcd - 1: bc - 2: d - -/a([bc]*)(c+d)/ - abcd - 0: abcd - 1: b - 2: cd - -/a[bcd]*dcdcde/ - adcdcde - 0: adcdcde - -/a[bcd]+dcdcde/ - *** Failers -No match - abcde -No match - adcdcde -No match - -/(ab|a)b*c/ - abc - 0: abc - 1: ab - -/((a)(b)c)(d)/ - abcd - 0: abcd - 1: abc - 2: a - 3: b - 4: d - -/[a-zA-Z_][a-zA-Z0-9_]*/ - alpha - 0: alpha - -/^a(bc+|b[eh])g|.h$/ - abh - 0: bh - -/(bc+d$|ef*g.|h?i(j|k))/ - effgz - 0: effgz - 1: effgz - ij - 0: ij - 1: ij - 2: j - reffgz - 0: effgz - 1: effgz - *** Failers -No match - effg -No match - bcdd -No match - -/((((((((((a))))))))))/ - a - 0: a - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a -10: a - -/((((((((((a))))))))))\10/ - aa - 0: aa - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a -10: a - -/(((((((((a)))))))))/ - a - 0: a - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a - -/multiple words of text/ - *** Failers -No match - aa -No match - uh-uh -No match - -/multiple words/ - multiple words, yeah - 0: multiple words - -/(.*)c(.*)/ - abcde - 0: abcde - 1: ab - 2: de - -/\((.*), (.*)\)/ - (a, b) - 0: (a, b) - 1: a - 2: b - -/[k]/ - -/abcd/ - abcd - 0: abcd - -/a(bc)d/ - abcd - 0: abcd - 1: bc - -/a[-]?c/ - ac - 0: ac - -/(abc)\1/ - abcabc - 0: abcabc - 1: abc - -/([a-c]*)\1/ - abcabc - 0: abcabc - 1: abc - -/(a)|\1/ - a - 0: a - 1: a - *** Failers - 0: a - 1: a - ab - 0: a - 1: a - x -No match - -/(([a-c])b*?\2)*/ - ababbbcbc - 0: ababb - 1: bb - 2: b - -/(([a-c])b*?\2){3}/ - ababbbcbc - 0: ababbbcbc - 1: cbc - 2: c - -/((\3|b)\2(a)x)+/ - aaaxabaxbaaxbbax - 0: bbax - 1: bbax - 2: b - 3: a - -/((\3|b)\2(a)){2,}/ - bbaababbabaaaaabbaaaabba - 0: bbaaaabba - 1: bba - 2: b - 3: a - -/abc/i - ABC - 0: ABC - XABCY - 0: ABC - ABABC - 0: ABC - *** Failers -No match - aaxabxbaxbbx -No match - XBC -No match - AXC -No match - ABX -No match - -/ab*c/i - ABC - 0: ABC - -/ab*bc/i - ABC - 0: ABC - ABBC - 0: ABBC - -/ab*?bc/i - ABBBBC - 0: ABBBBC - -/ab{0,}?bc/i - ABBBBC - 0: ABBBBC - -/ab+?bc/i - ABBC - 0: ABBC - -/ab+bc/i - *** Failers -No match - ABC -No match - ABQ -No match - -/ab{1,}bc/i - -/ab+bc/i - ABBBBC - 0: ABBBBC - -/ab{1,}?bc/i - ABBBBC - 0: ABBBBC - -/ab{1,3}?bc/i - ABBBBC - 0: ABBBBC - -/ab{3,4}?bc/i - ABBBBC - 0: ABBBBC - -/ab{4,5}?bc/i - *** Failers -No match - ABQ -No match - ABBBBC -No match - -/ab??bc/i - ABBC - 0: ABBC - ABC - 0: ABC - -/ab{0,1}?bc/i - ABC - 0: ABC - -/ab??bc/i - -/ab??c/i - ABC - 0: ABC - -/ab{0,1}?c/i - ABC - 0: ABC - -/^abc$/i - ABC - 0: ABC - *** Failers -No match - ABBBBC -No match - ABCC -No match - -/^abc/i - ABCC - 0: ABC - -/^abc$/i - -/abc$/i - AABC - 0: ABC - -/^/i - ABC - 0: - -/$/i - ABC - 0: - -/a.c/i - ABC - 0: ABC - AXC - 0: AXC - -/a.*?c/i - AXYZC - 0: AXYZC - -/a.*c/i - *** Failers -No match - AABC - 0: AABC - AXYZD -No match - -/a[bc]d/i - ABD - 0: ABD - -/a[b-d]e/i - ACE - 0: ACE - *** Failers -No match - ABC -No match - ABD -No match - -/a[b-d]/i - AAC - 0: AC - -/a[-b]/i - A- - 0: A- - -/a[b-]/i - A- - 0: A- - -/a]/i - A] - 0: A] - -/a[]]b/i - A]B - 0: A]B - -/a[^bc]d/i - AED - 0: AED - -/a[^-b]c/i - ADC - 0: ADC - *** Failers -No match - ABD -No match - A-C -No match - -/a[^]b]c/i - ADC - 0: ADC - -/ab|cd/i - ABC - 0: AB - ABCD - 0: AB - -/()ef/i - DEF - 0: EF - 1: - -/$b/i - *** Failers -No match - A]C -No match - B -No match - -/a\(b/i - A(B - 0: A(B - -/a\(*b/i - AB - 0: AB - A((B - 0: A((B - -/a\\b/i - A\B -No match - -/((a))/i - ABC - 0: A - 1: A - 2: A - -/(a)b(c)/i - ABC - 0: ABC - 1: A - 2: C - -/a+b+c/i - AABBABC - 0: ABC - -/a{1,}b{1,}c/i - AABBABC - 0: ABC - -/a.+?c/i - ABCABC - 0: ABC - -/a.*?c/i - ABCABC - 0: ABC - -/a.{0,5}?c/i - ABCABC - 0: ABC - -/(a+|b)*/i - AB - 0: AB - 1: B - -/(a+|b){0,}/i - AB - 0: AB - 1: B - -/(a+|b)+/i - AB - 0: AB - 1: B - -/(a+|b){1,}/i - AB - 0: AB - 1: B - -/(a+|b)?/i - AB - 0: A - 1: A - -/(a+|b){0,1}/i - AB - 0: A - 1: A - -/(a+|b){0,1}?/i - AB - 0: - -/[^ab]*/i - CDE - 0: CDE - -/abc/i - -/a*/i - - -/([abc])*d/i - ABBBCD - 0: ABBBCD - 1: C - -/([abc])*bcd/i - ABCD - 0: ABCD - 1: A - -/a|b|c|d|e/i - E - 0: E - -/(a|b|c|d|e)f/i - EF - 0: EF - 1: E - -/abcd*efg/i - ABCDEFG - 0: ABCDEFG - -/ab*/i - XABYABBBZ - 0: AB - XAYABBBZ - 0: A - -/(ab|cd)e/i - ABCDE - 0: CDE - 1: CD - -/[abhgefdc]ij/i - HIJ - 0: HIJ - -/^(ab|cd)e/i - ABCDE -No match - -/(abc|)ef/i - ABCDEF - 0: EF - 1: - -/(a|b)c*d/i - ABCD - 0: BCD - 1: B - -/(ab|ab*)bc/i - ABC - 0: ABC - 1: A - -/a([bc]*)c*/i - ABC - 0: ABC - 1: BC - -/a([bc]*)(c*d)/i - ABCD - 0: ABCD - 1: BC - 2: D - -/a([bc]+)(c*d)/i - ABCD - 0: ABCD - 1: BC - 2: D - -/a([bc]*)(c+d)/i - ABCD - 0: ABCD - 1: B - 2: CD - -/a[bcd]*dcdcde/i - ADCDCDE - 0: ADCDCDE - -/a[bcd]+dcdcde/i - -/(ab|a)b*c/i - ABC - 0: ABC - 1: AB - -/((a)(b)c)(d)/i - ABCD - 0: ABCD - 1: ABC - 2: A - 3: B - 4: D - -/[a-zA-Z_][a-zA-Z0-9_]*/i - ALPHA - 0: ALPHA - -/^a(bc+|b[eh])g|.h$/i - ABH - 0: BH - -/(bc+d$|ef*g.|h?i(j|k))/i - EFFGZ - 0: EFFGZ - 1: EFFGZ - IJ - 0: IJ - 1: IJ - 2: J - REFFGZ - 0: EFFGZ - 1: EFFGZ - *** Failers -No match - ADCDCDE -No match - EFFG -No match - BCDD -No match - -/((((((((((a))))))))))/i - A - 0: A - 1: A - 2: A - 3: A - 4: A - 5: A - 6: A - 7: A - 8: A - 9: A -10: A - -/((((((((((a))))))))))\10/i - AA - 0: AA - 1: A - 2: A - 3: A - 4: A - 5: A - 6: A - 7: A - 8: A - 9: A -10: A - -/(((((((((a)))))))))/i - A - 0: A - 1: A - 2: A - 3: A - 4: A - 5: A - 6: A - 7: A - 8: A - 9: A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i - A - 0: A - 1: A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i - C - 0: C - 1: C - -/multiple words of text/i - *** Failers -No match - AA -No match - UH-UH -No match - -/multiple words/i - MULTIPLE WORDS, YEAH - 0: MULTIPLE WORDS - -/(.*)c(.*)/i - ABCDE - 0: ABCDE - 1: AB - 2: DE - -/\((.*), (.*)\)/i - (A, B) - 0: (A, B) - 1: A - 2: B - -/[k]/i - -/abcd/i - ABCD - 0: ABCD - -/a(bc)d/i - ABCD - 0: ABCD - 1: BC - -/a[-]?c/i - AC - 0: AC - -/(abc)\1/i - ABCABC - 0: ABCABC - 1: ABC - -/([a-c]*)\1/i - ABCABC - 0: ABCABC - 1: ABC - -/a(?!b)./ - abad - 0: ad - -/a(?=d)./ - abad - 0: ad - -/a(?=c|d)./ - abad - 0: ad - -/a(?:b|c|d)(.)/ - ace - 0: ace - 1: e - -/a(?:b|c|d)*(.)/ - ace - 0: ace - 1: e - -/a(?:b|c|d)+?(.)/ - ace - 0: ace - 1: e - acdbcdbe - 0: acd - 1: d - -/a(?:b|c|d)+(.)/ - acdbcdbe - 0: acdbcdbe - 1: e - -/a(?:b|c|d){2}(.)/ - acdbcdbe - 0: acdb - 1: b - -/a(?:b|c|d){4,5}(.)/ - acdbcdbe - 0: acdbcdb - 1: b - -/a(?:b|c|d){4,5}?(.)/ - acdbcdbe - 0: acdbcd - 1: d - -/((foo)|(bar))*/ - foobar - 0: foobar - 1: bar - 2: foo - 3: bar - -/a(?:b|c|d){6,7}(.)/ - acdbcdbe - 0: acdbcdbe - 1: e - -/a(?:b|c|d){6,7}?(.)/ - acdbcdbe - 0: acdbcdbe - 1: e - -/a(?:b|c|d){5,6}(.)/ - acdbcdbe - 0: acdbcdbe - 1: e - -/a(?:b|c|d){5,6}?(.)/ - acdbcdbe - 0: acdbcdb - 1: b - -/a(?:b|c|d){5,7}(.)/ - acdbcdbe - 0: acdbcdbe - 1: e - -/a(?:b|c|d){5,7}?(.)/ - acdbcdbe - 0: acdbcdb - 1: b - -/a(?:b|(c|e){1,2}?|d)+?(.)/ - ace - 0: ace - 1: c - 2: e - -/^(.+)?B/ - AB - 0: AB - 1: A - -/^([^a-z])|(\^)$/ - . - 0: . - 1: . - -/^[<>]&/ - <&OUT - 0: <& - -/^(a\1?){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa - *** Failers -No match - AB -No match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/^(a(?(1)\1)){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa - *** Failers -No match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - 0: foobar - 1: f - 2: o - 3: o - 4: b - 5: a - 6: r - -/(?<=a)b/ - ab - 0: b - *** Failers -No match - cb -No match - b -No match - -/(?<!c)b/ - ab - 0: b - b - 0: b - b - 0: b - -/(?:..)*a/ - aba - 0: aba - -/(?:..)*?a/ - aba - 0: a - -/^(?:b|a(?=(.)))*\1/ - abc - 0: ab - 1: b - -/^(){3,5}/ - abc - 0: - 1: - -/^(a+)*ax/ - aax - 0: aax - 1: a - -/^((a|b)+)*ax/ - aax - 0: aax - 1: a - 2: a - -/^((a|bc)+)*ax/ - aax - 0: aax - 1: a - 2: a - -/(a|x)*ab/ - cab - 0: ab - -/(a)*ab/ - cab - 0: ab - -/(?:(?i)a)b/ - ab - 0: ab - -/((?i)a)b/ - ab - 0: ab - 1: a - -/(?:(?i)a)b/ - Ab - 0: Ab - -/((?i)a)b/ - Ab - 0: Ab - 1: A - -/(?:(?i)a)b/ - *** Failers -No match - cb -No match - aB -No match - -/((?i)a)b/ - -/(?i:a)b/ - ab - 0: ab - -/((?i:a))b/ - ab - 0: ab - 1: a - -/(?i:a)b/ - Ab - 0: Ab - -/((?i:a))b/ - Ab - 0: Ab - 1: A - -/(?i:a)b/ - *** Failers -No match - aB -No match - aB -No match - -/((?i:a))b/ - -/(?:(?-i)a)b/i - ab - 0: ab - -/((?-i)a)b/i - ab - 0: ab - 1: a - -/(?:(?-i)a)b/i - aB - 0: aB - -/((?-i)a)b/i - aB - 0: aB - 1: a - -/(?:(?-i)a)b/i - *** Failers -No match - aB - 0: aB - Ab -No match - -/((?-i)a)b/i - -/(?:(?-i)a)b/i - aB - 0: aB - -/((?-i)a)b/i - aB - 0: aB - 1: a - -/(?:(?-i)a)b/i - *** Failers -No match - Ab -No match - AB -No match - -/((?-i)a)b/i - -/(?-i:a)b/i - ab - 0: ab - -/((?-i:a))b/i - ab - 0: ab - 1: a - -/(?-i:a)b/i - aB - 0: aB - -/((?-i:a))b/i - aB - 0: aB - 1: a - -/(?-i:a)b/i - *** Failers -No match - AB -No match - Ab -No match - -/((?-i:a))b/i - -/(?-i:a)b/i - aB - 0: aB - -/((?-i:a))b/i - aB - 0: aB - 1: a - -/(?-i:a)b/i - *** Failers -No match - Ab -No match - AB -No match - -/((?-i:a))b/i - -/((?-i:a.))b/i - *** Failers -No match - AB -No match - a\nB -No match - -/((?s-i:a.))b/i - a\nB - 0: a\x0aB - 1: a\x0a - -/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ - cabbbb - 0: cabbbb - -/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ - caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - 0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - -/(ab)\d\1/i - Ab4ab - 0: Ab4ab - 1: Ab - ab4Ab - 0: ab4Ab - 1: ab - -/foo\w*\d{4}baz/ - foobar1234baz - 0: foobar1234baz - -/x(~~)*(?:(?:F)?)?/ - x~~ - 0: x~~ - 1: ~~ - -/^a(?#xxx){3}c/ - aaac - 0: aaac - -/^a (?#xxx) (?#yyy) {3}c/x - aaac - 0: aaac - -/(?<![cd])b/ - *** Failers -No match - B\nB -No match - dbcb -No match - -/(?<![cd])[ab]/ - dbaacb - 0: a - -/(?<!(c|d))b/ - -/(?<!(c|d))[ab]/ - dbaacb - 0: a - -/(?<!cd)[ab]/ - cdaccb - 0: b - -/^(?:a?b?)*$/ - *** Failers -No match - dbcb -No match - a-- -No match - -/((?s)^a(.))((?m)^b$)/ - a\nb\nc\n - 0: a\x0ab - 1: a\x0a - 2: \x0a - 3: b - -/((?m)^b$)/ - a\nb\nc\n - 0: b - 1: b - -/(?m)^b/ - a\nb\n - 0: b - -/(?m)^(b)/ - a\nb\n - 0: b - 1: b - -/((?m)^b)/ - a\nb\n - 0: b - 1: b - -/\n((?m)^b)/ - a\nb\n - 0: \x0ab - 1: b - -/((?s).)c(?!.)/ - a\nb\nc\n - 0: \x0ac - 1: \x0a - a\nb\nc\n - 0: \x0ac - 1: \x0a - -/((?s)b.)c(?!.)/ - a\nb\nc\n - 0: b\x0ac - 1: b\x0a - a\nb\nc\n - 0: b\x0ac - 1: b\x0a - -/^b/ - -/()^b/ - *** Failers -No match - a\nb\nc\n -No match - a\nb\nc\n -No match - -/((?m)^b)/ - a\nb\nc\n - 0: b - 1: b - -/(?(1)a|b)/ - -/(?(1)b|a)/ - a - 0: a - -/(x)?(?(1)a|b)/ - *** Failers -No match - a -No match - a -No match - -/(x)?(?(1)b|a)/ - a - 0: a - -/()?(?(1)b|a)/ - a - 0: a - -/()(?(1)b|a)/ - -/()?(?(1)a|b)/ - a - 0: a - 1: - -/^(\()?blah(?(1)(\)))$/ - (blah) - 0: (blah) - 1: ( - 2: ) - blah - 0: blah - *** Failers -No match - a -No match - blah) -No match - (blah -No match - -/^(\(+)?blah(?(1)(\)))$/ - (blah) - 0: (blah) - 1: ( - 2: ) - blah - 0: blah - *** Failers -No match - blah) -No match - (blah -No match - -/(?(?!a)a|b)/ - -/(?(?!a)b|a)/ - a - 0: a - -/(?(?=a)b|a)/ - *** Failers -No match - a -No match - a -No match - -/(?(?=a)a|b)/ - a - 0: a - -/(?=(a+?))(\1ab)/ - aaab - 0: aab - 1: a - 2: aab - -/^(?=(a+?))\1ab/ - -/(\w+:)+/ - one: - 0: one: - 1: one: - -/$(?<=^(a))/ - a - 0: - 1: a - -/(?=(a+?))(\1ab)/ - aaab - 0: aab - 1: a - 2: aab - -/^(?=(a+?))\1ab/ - *** Failers -No match - aaab -No match - aaab -No match - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - 1: <unset> - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(a*)b+/ - caab - 0: aab - 1: aa - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - 1: <unset> - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd - *** Failers - 0: Failers - 1: <unset> - 2: Failers - abcd: -No match - abcd: -No match - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(>a+)ab/ - -/(?>a+)b/ - aaab - 0: aaab - -/([[:]+)/ - a:[b]: - 0: :[ - 1: :[ - -/([[=]+)/ - a=[b]= - 0: =[ - 1: =[ - -/([[.]+)/ - a.[b]. - 0: .[ - 1: .[ - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/a\Z/ - *** Failers -No match - aaab -No match - a\nb\n -No match - -/b\Z/ - a\nb\n - 0: b - -/b\z/ - -/b\Z/ - a\nb - 0: b - -/b\z/ - a\nb - 0: b - *** Failers -No match - -/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ - a - 0: a - 1: - abc - 0: abc - 1: - a-b - 0: a-b - 1: - 0-9 - 0: 0-9 - 1: - a.b - 0: a.b - 1: - 5.6.7 - 0: 5.6.7 - 1: - the.quick.brown.fox - 0: the.quick.brown.fox - 1: - a100.b200.300c - 0: a100.b200.300c - 1: - 12-ab.1245 - 0: 12-ab.1245 - 1: - *** Failers -No match - \ -No match - .a -No match - -a -No match - a- -No match - a. -No match - a_b -No match - a.- -No match - a.. -No match - ab..bc -No match - the.quick.brown.fox- -No match - the.quick.brown.fox. -No match - the.quick.brown.fox_ -No match - the.quick.brown.fox+ -No match - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - 0: alphabetabcd - 1: abcd - endingwxyz - 0: endingwxyz - 1: wxyz - *** Failers -No match - a rather long string that doesn't end with one of them -No match - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/(?<=\d{3}(?!999))foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match - -/(?<=(?!...999)\d{3})foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo - *** Failers -No match - 123999foo -No match - -/(?<=\d{3}...)(?<!999)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo - *** Failers -No match - 123999foo -No match - -/<a[\s]+href[\s]*=[\s]* # find <a href= - ([\"\'])? # find single or double quote - (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - 0: <a href=abcd - 1: <unset> - 2: <unset> - 3: abcd - <a href=\"abcd xyz pqr\" cats - 0: <a href="abcd xyz pqr" - 1: " - 2: abcd xyz pqr - <a href=\'abcd xyz pqr\' cats - 0: <a href='abcd xyz pqr' - 1: ' - 2: abcd xyz pqr - -/<a\s+href\s*=\s* # find <a href= - (["'])? # find single or double quote - (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - 0: <a href=abcd - 1: <unset> - 2: <unset> - 3: abcd - <a href=\"abcd xyz pqr\" cats - 0: <a href="abcd xyz pqr" - 1: " - 2: abcd xyz pqr - <a href = \'abcd xyz pqr\' cats - 0: <a href = 'abcd xyz pqr' - 1: ' - 2: abcd xyz pqr - -/<a\s+href(?>\s*)=(?>\s*) # find <a href= - (["'])? # find single or double quote - (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching - # quote, otherwise match up to next space -/isx - <a href=abcd xyz - 0: <a href=abcd - 1: <unset> - 2: <unset> - 3: abcd - <a href=\"abcd xyz pqr\" cats - 0: <a href="abcd xyz pqr" - 1: " - 2: abcd xyz pqr - <a href = \'abcd xyz pqr\' cats - 0: <a href = 'abcd xyz pqr' - 1: ' - 2: abcd xyz pqr - -/((Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: A - 2: Z - -/(Z()|A)*/ - ZABCDEFG - 0: ZA - 1: A - 2: - -/(Z(())|A)*/ - ZABCDEFG - 0: ZA - 1: A - 2: - 3: - -/((?>Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: A - -/((?>)+|A)*/ - ZABCDEFG - 0: - 1: - -/a*/g - abbab - 0: a - 0: - 0: - 0: a - 0: - 0: - -/^[a-\d]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match - -/^[\d-a]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09 - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - -/a b/x - ab -No match - -/(?!\A)x/m - a\nxb\n - 0: x - -/(?!^)x/m - a\nxb\n -No match - -/abc\Qabc\Eabc/ - abcabcabc - 0: abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc - 0: abc(*+|abc - -/ abc\Q abc\Eabc/x - abc abcabc - 0: abc abcabc - *** Failers -No match - abcabcabc -No match - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/\Qabc\$xyz\E/ - abc\\\$xyz - 0: abc\$xyz - -/\Qabc\E\$\Qxyz\E/ - abc\$xyz - 0: abc$xyz - -/\Gabc/ - abc - 0: abc - *** Failers -No match - xyzabc -No match - -/\Gabc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 - -/abc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 - 0: abc3 - -/a(?x: b c )d/ - XabcdY - 0: abcd - *** Failers -No match - Xa b c d Y -No match - -/((?x)x y z | a b c)/ - XabcY - 0: abc - 1: abc - AxyzB - 0: xyz - 1: xyz - -/(?i)AB(?-i)C/ - XabCY - 0: abC - *** Failers -No match - XabcY -No match - -/((?i)AB(?-i)C|D)E/ - abCE - 0: abCE - 1: abC - DE - 0: DE - 1: D - *** Failers -No match - abcE -No match - abCe -No match - dE -No match - De -No match - -/(.*)\d+\1/ - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/(.*)\d+\1/s - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/((.*))\d+\1/ - abc123abc - 0: abc123abc - 1: abc - 2: abc - abc123bc - 0: bc123bc - 1: bc - 2: bc - -/-- This tests for an IPv6 address in the form where it can have up to --/ -/-- eight components, one and only one of which is empty. This must be --/ -No match -/-- an internal component. --/ -No match - -/^(?!:) # colon disallowed at start - (?: # start of item - (?: [0-9a-f]{1,4} | # 1-4 hex digits or - (?(1)0 | () ) ) # if null previously matched, fail; else null - : # followed by colon - ){1,7} # end item; 1-7 of them required - [0-9a-f]{1,4} $ # final hex number at end of string - (?(1)|.) # check that there was an empty component - /xi - a123::a123 - 0: a123::a123 - 1: - a123:b342::abcd - 0: a123:b342::abcd - 1: - a123:b342::324e:abcd - 0: a123:b342::324e:abcd - 1: - a123:ddde:b342::324e:abcd - 0: a123:ddde:b342::324e:abcd - 1: - a123:ddde:b342::324e:dcba:abcd - 0: a123:ddde:b342::324e:dcba:abcd - 1: - a123:ddde:9999:b342::324e:dcba:abcd - 0: a123:ddde:9999:b342::324e:dcba:abcd - 1: - *** Failers -No match - 1:2:3:4:5:6:7:8 -No match - a123:bce:ddde:9999:b342::324e:dcba:abcd -No match - a123::9999:b342::324e:dcba:abcd -No match - abcde:2:3:4:5:6:7:8 -No match - ::1 -No match - abcd:fee0:123:: -No match - :1 -No match - 1: -No match - -/[z\Qa-d]\E]/ - z - 0: z - a - 0: a - - - 0: - - d - 0: d - ] - 0: ] - *** Failers - 0: a - b -No match - -/[\z\C]/ - z - 0: z - C - 0: C - -/\M/ - M - 0: M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - 0: REGular - regulaer - 0: regulaer - Regex - 0: Regex - regulär - 0: regul\xe4r - -/Ċĉċä[à-˙À-ß]+/ - Ċĉċäà - 0: \xc5\xe6\xe5\xe4\xe0 - Ċĉċä˙ - 0: \xc5\xe6\xe5\xe4\xff - ĊĉċäÀ - 0: \xc5\xe6\xe5\xe4\xc0 - Ċĉċäß - 0: \xc5\xe6\xe5\xe4\xdf - -/(?<=Z)X./ - \x84XAZXB - 0: XB - -/ab cd (?x) de fg/ - ab cd defg - 0: ab cd defg - -/ab cd(?x) de fg/ - ab cddefg - 0: ab cddefg - ** Failers -No match - abcddefg -No match - -/ End of testinput1 / diff --git a/ext/pcre/pcrelib/testdata/testoutput2 b/ext/pcre/pcrelib/testdata/testoutput2 deleted file mode 100644 index 8f078b8464d8f..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput2 +++ /dev/null @@ -1,5946 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/(a)b|/ -Capturing subpattern count = 1 -No options -No first char -No need char - -/abc/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - abc - 0: abc - defabc - 0: abc - \Aabc - 0: abc - *** Failers -No match - \Adefabc -No match - ABC -No match - -/^abc/ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - abc - 0: abc - \Aabc - 0: abc - *** Failers -No match - defabc -No match - \Adefabc -No match - -/a+bc/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'c' - -/a*bc/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'c' - -/a{3}bc/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'c' - -/(abc|a+z)/ -Capturing subpattern count = 1 -Partial matching not supported -No options -First char = 'a' -No need char - -/^abc$/ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - abc - 0: abc - *** Failers -No match - def\nabc -No match - -/ab\gdef/X -Failed: unrecognized character follows \ at offset 3 - -/(?X)ab\gdef/X -Failed: unrecognized character follows \ at offset 7 - -/x{5,4}/ -Failed: numbers out of order in {} quantifier at offset 5 - -/z{65536}/ -Failed: number too big in {} quantifier at offset 7 - -/[abcd/ -Failed: missing terminating ] for character class at offset 5 - -/(?X)[\B]/ -Failed: invalid escape sequence in character class at offset 6 - -/[z-a]/ -Failed: range out of order in character class at offset 3 - -/^*/ -Failed: nothing to repeat at offset 1 - -/(abc/ -Failed: missing ) at offset 4 - -/(?# abc/ -Failed: missing ) after comment at offset 7 - -/(?z)abc/ -Failed: unrecognized character after (? at offset 2 - -/.*b/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char at start or follows \n -Need char = 'b' - -/.*?b/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char at start or follows \n -Need char = 'b' - -/cat|dog|elephant/ -Capturing subpattern count = 0 -No options -No first char -No need char - this sentence eventually mentions a cat - 0: cat - this sentences rambles on and on for a while and then reaches elephant - 0: elephant - -/cat|dog|elephant/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: c d e - this sentence eventually mentions a cat - 0: cat - this sentences rambles on and on for a while and then reaches elephant - 0: elephant - -/cat|dog|elephant/iS -Capturing subpattern count = 0 -Options: caseless -No first char -No need char -Starting byte set: C D E c d e - this sentence eventually mentions a CAT cat - 0: CAT - this sentences rambles on and on for a while to elephant ElePhant - 0: elephant - -/a|[bcd]/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b c d - -/(a|[^\dZ])/S -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a - \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 - \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > - ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y [ \ ] ^ _ ` a b c d - e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 - \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 - \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 - \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 - \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf - \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce - \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd - \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec - \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb - \xfc \xfd \xfe \xff - -/(a|b)*[\s]/S -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: \x09 \x0a \x0c \x0d \x20 a b - -/(ab\2)/ -Failed: reference to non-existent subpattern at offset 6 - -/{4,5}abc/ -Failed: nothing to repeat at offset 4 - -/(a)(b)(c)\2/ -Capturing subpattern count = 3 -Max back reference = 2 -No options -First char = 'a' -Need char = 'c' - abcb - 0: abcb - 1: a - 2: b - 3: c - \O0abcb -Matched, but too many substrings - \O3abcb -Matched, but too many substrings - 0: abcb - \O6abcb -Matched, but too many substrings - 0: abcb - 1: a - \O9abcb -Matched, but too many substrings - 0: abcb - 1: a - 2: b - \O12abcb - 0: abcb - 1: a - 2: b - 3: c - -/(a)bc|(a)(b)\2/ -Capturing subpattern count = 3 -Max back reference = 2 -No options -First char = 'a' -No need char - abc - 0: abc - 1: a - \O0abc -Matched, but too many substrings - \O3abc -Matched, but too many substrings - 0: abc - \O6abc - 0: abc - 1: a - aba - 0: aba - 1: <unset> - 2: a - 3: b - \O0aba -Matched, but too many substrings - \O3aba -Matched, but too many substrings - 0: aba - \O6aba -Matched, but too many substrings - 0: aba - 1: <unset> - \O9aba -Matched, but too many substrings - 0: aba - 1: <unset> - 2: a - \O12aba - 0: aba - 1: <unset> - 2: a - 3: b - -/abc$/E -Capturing subpattern count = 0 -Options: dollar_endonly -First char = 'a' -Need char = 'c' - abc - 0: abc - *** Failers -No match - abc\n -No match - abc\ndef -No match - -/(a)(b)(c)(d)(e)\6/ -Failed: reference to non-existent subpattern at offset 17 - -/the quick brown fox/ -Capturing subpattern count = 0 -No options -First char = 't' -Need char = 'x' - the quick brown fox - 0: the quick brown fox - this is a line with the quick brown fox - 0: the quick brown fox - -/the quick brown fox/A -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - the quick brown fox - 0: the quick brown fox - *** Failers -No match - this is a line with the quick brown fox -No match - -/ab(?z)cd/ -Failed: unrecognized character after (? at offset 4 - -/^abc|def/ -Capturing subpattern count = 0 -No options -No first char -No need char - abcdef - 0: abc - abcdef\B - 0: def - -/.*((abc)$|(def))/ -Capturing subpattern count = 3 -Partial matching not supported -No options -First char at start or follows \n -No need char - defabc - 0: defabc - 1: abc - 2: abc - \Zdefabc - 0: def - 1: def - 2: <unset> - 3: def - -/abc/P - abc - 0: abc - *** Failers -No match: POSIX code 17: match failed - -/^abc|def/P - abcdef - 0: abc - abcdef\B - 0: def - -/.*((abc)$|(def))/P - defabc - 0: defabc - 1: abc - 2: abc - \Zdefabc - 0: def - 1: def - 3: def - -/the quick brown fox/P - the quick brown fox - 0: the quick brown fox - *** Failers -No match: POSIX code 17: match failed - The Quick Brown Fox -No match: POSIX code 17: match failed - -/the quick brown fox/Pi - the quick brown fox - 0: the quick brown fox - The Quick Brown Fox - 0: The Quick Brown Fox - -/abc.def/P - *** Failers -No match: POSIX code 17: match failed - abc\ndef -No match: POSIX code 17: match failed - -/abc$/P - abc - 0: abc - abc\n - 0: abc - -/(abc)\2/P -Failed: POSIX code 15: bad back reference at offset 7 - -/(abc\1)/P - abc -No match: POSIX code 17: match failed - -/)/ -Failed: unmatched parentheses at offset 0 - -/a[]b/ -Failed: missing terminating ] for character class at offset 4 - -/[^aeiou ]{3,}/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - co-processors, and for - 0: -pr - -/<.*>/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = '<' -Need char = '>' - abc<def>ghi<klm>nop - 0: <def>ghi<klm> - -/<.*?>/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = '<' -Need char = '>' - abc<def>ghi<klm>nop - 0: <def> - -/<.*>/U -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = '<' -Need char = '>' - abc<def>ghi<klm>nop - 0: <def> - -/(?U)<.*>/ -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = '<' -Need char = '>' - abc<def>ghi<klm>nop - 0: <def> - -/<.*?>/U -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = '<' -Need char = '>' - abc<def>ghi<klm>nop - 0: <def>ghi<klm> - -/={3,}/U -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = '=' -Need char = '=' - abc========def - 0: === - -/(?U)={3,}?/ -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = '=' -Need char = '=' - abc========def - 0: ======== - -/(?<!bar|cattle)foo/ -Capturing subpattern count = 0 -No options -First char = 'f' -Need char = 'o' - foo - 0: foo - catfoo - 0: foo - *** Failers -No match - the barfoo -No match - and cattlefoo -No match - -/(?<=a+)b/ -Failed: lookbehind assertion is not fixed length at offset 6 - -/(?<=aaa|b{0,3})b/ -Failed: lookbehind assertion is not fixed length at offset 14 - -/(?<!(foo)a\1)bar/ -Failed: lookbehind assertion is not fixed length at offset 12 - -/(?i)abc/ -Capturing subpattern count = 0 -Options: caseless -First char = 'a' (caseless) -Need char = 'c' (caseless) - -/(a|(?m)a)/ -Capturing subpattern count = 1 -No options -First char = 'a' -No need char - -/(?i)^1234/ -Capturing subpattern count = 0 -Options: anchored caseless -No first char -No need char - -/(^b|(?i)^d)/ -Capturing subpattern count = 1 -Options: anchored -Case state changes -No first char -No need char - -/(?s).*/ -Capturing subpattern count = 0 -Partial matching not supported -Options: anchored dotall -No first char -No need char - -/[abcd]/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b c d - -/(?i)[abcd]/S -Capturing subpattern count = 0 -Options: caseless -No first char -No need char -Starting byte set: A B C D a b c d - -/(?m)[xy]|(b|c)/S -Capturing subpattern count = 1 -Options: multiline -No first char -No need char -Starting byte set: b c x y - -/(^a|^b)/m -Capturing subpattern count = 1 -Options: multiline -First char at start or follows \n -No need char - -/(?i)(^a|^b)/m -Capturing subpattern count = 1 -Options: caseless multiline -First char at start or follows \n -No need char - -/(a)(?(1)a|b|c)/ -Failed: conditional group contains more than two branches at offset 13 - -/(?(?=a)a|b|c)/ -Failed: conditional group contains more than two branches at offset 12 - -/(?(1a)/ -Failed: malformed number after (?( at offset 4 - -/(?(?i))/ -Failed: assertion expected after (?( at offset 3 - -/(?(abc))/ -Failed: assertion expected after (?( at offset 3 - -/(?(?<ab))/ -Failed: unrecognized character after (?< at offset 5 - -/((?s)blah)\s+\1/ -Capturing subpattern count = 1 -Max back reference = 1 -Partial matching not supported -No options -First char = 'b' -Need char = 'h' - -/((?i)blah)\s+\1/ -Capturing subpattern count = 1 -Max back reference = 1 -Partial matching not supported -No options -Case state changes -First char = 'b' (caseless) -Need char = 'h' (caseless) - -/((?i)b)/DS ------------------------------------------------------------------- - 0 15 Bra 0 - 3 7 Bra 1 - 6 01 Opt - 8 NC b - 10 7 Ket - 13 00 Opt - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -Case state changes -First char = 'b' (caseless) -No need char -Study returned NULL - -/(a*b|(?i:c*(?-i)d))/S -Capturing subpattern count = 1 -Partial matching not supported -No options -Case state changes -No first char -No need char -Starting byte set: C a b c d - -/a$/ -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - a - 0: a - a\n - 0: a - *** Failers -No match - \Za -No match - \Za\n -No match - -/a$/m -Capturing subpattern count = 0 -Options: multiline -First char = 'a' -No need char - a - 0: a - a\n - 0: a - \Za\n - 0: a - *** Failers -No match - \Za -No match - -/\Aabc/m -Capturing subpattern count = 0 -Options: anchored multiline -No first char -No need char - -/^abc/m -Capturing subpattern count = 0 -Options: multiline -First char at start or follows \n -Need char = 'c' - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/ -Capturing subpattern count = 5 -Partial matching not supported -Options: anchored -No first char -No need char - aaaaabbbbbcccccdef - 0: aaaaabbbbbcccccdef - 1: aaaaabbbbbcccccdef - 2: aaaaa - 3: b - 4: bbbbccccc - 5: def - -/(?<=foo)[ab]/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b - -/(?<!foo)(alpha|omega)/S -Capturing subpattern count = 1 -No options -No first char -Need char = 'a' -Starting byte set: a o - -/(?!alphabet)[ab]/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b - -/(?<=foo\n)^bar/m -Capturing subpattern count = 0 -Options: multiline -No first char -Need char = 'r' - foo\nbarbar - 0: bar - ***Failers -No match - rhubarb -No match - barbell -No match - abc\nbarton -No match - -/^(?<=foo\n)bar/m -Capturing subpattern count = 0 -Options: multiline -First char at start or follows \n -Need char = 'r' - foo\nbarbar - 0: bar - ***Failers -No match - rhubarb -No match - barbell -No match - abc\nbarton -No match - -/(?>^abc)/m -Capturing subpattern count = 0 -Options: multiline -First char at start or follows \n -Need char = 'c' - abc - 0: abc - def\nabc - 0: abc - *** Failers -No match - defabc -No match - -/(?<=ab(c+)d)ef/ -Failed: lookbehind assertion is not fixed length at offset 11 - -/(?<=ab(?<=c+)d)ef/ -Failed: lookbehind assertion is not fixed length at offset 12 - -/(?<=ab(c|de)f)g/ -Failed: lookbehind assertion is not fixed length at offset 13 - -/The next three are in testinput2 because they have variable length branches/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = 's' - -/(?<=bullock|donkey)-cart/ -Capturing subpattern count = 0 -No options -First char = '-' -Need char = 't' - the bullock-cart - 0: -cart - a donkey-cart race - 0: -cart - *** Failers -No match - cart -No match - horse-and-cart -No match - -/(?<=ab(?i)x|y|z)/ -Capturing subpattern count = 0 -No options -Case state changes -No first char -No need char - -/(?>.*)(?<=(abcd)|(xyz))/ -Capturing subpattern count = 2 -Partial matching not supported -No options -First char at start or follows \n -No need char - alphabetabcd - 0: alphabetabcd - 1: abcd - endingxyz - 0: endingxyz - 1: <unset> - 2: xyz - -/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/ -Capturing subpattern count = 0 -No options -Case state changes -First char = 'Z' -Need char = 'Z' - abxyZZ - 0: ZZ - abXyZZ - 0: ZZ - ZZZ - 0: ZZ - zZZ - 0: ZZ - bZZ - 0: ZZ - BZZ - 0: ZZ - *** Failers -No match - ZZ -No match - abXYZZ -No match - zzz -No match - bzz -No match - -/(?<!(foo)a)bar/ -Capturing subpattern count = 1 -No options -First char = 'b' -Need char = 'r' - bar - 0: bar - foobbar - 0: bar - *** Failers -No match - fooabar -No match - -/This one is here because Perl 5.005_02 doesn't fail it/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = 't' - -/^(a)?(?(1)a|b)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - *** Failers -No match - a -No match - -/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = 'g' - -/^(a\1?){4}$/ -Capturing subpattern count = 1 -Max back reference = 1 -Options: anchored -No first char -No need char - aaaaaa - 0: aaaaaa - 1: aa - -/These are syntax tests from Perl 5.005/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = '5' - -/a[b-a]/ -Failed: range out of order in character class at offset 4 - -/a[]b/ -Failed: missing terminating ] for character class at offset 4 - -/a[/ -Failed: missing terminating ] for character class at offset 2 - -/*a/ -Failed: nothing to repeat at offset 0 - -/(*)b/ -Failed: nothing to repeat at offset 1 - -/abc)/ -Failed: unmatched parentheses at offset 3 - -/(abc/ -Failed: missing ) at offset 4 - -/a**/ -Failed: nothing to repeat at offset 2 - -/)(/ -Failed: unmatched parentheses at offset 0 - -/\1/ -Failed: reference to non-existent subpattern at offset 2 - -/\2/ -Failed: reference to non-existent subpattern at offset 2 - -/(a)|\2/ -Failed: reference to non-existent subpattern at offset 6 - -/a[b-a]/i -Failed: range out of order in character class at offset 4 - -/a[]b/i -Failed: missing terminating ] for character class at offset 4 - -/a[/i -Failed: missing terminating ] for character class at offset 2 - -/*a/i -Failed: nothing to repeat at offset 0 - -/(*)b/i -Failed: nothing to repeat at offset 1 - -/abc)/i -Failed: unmatched parentheses at offset 3 - -/(abc/i -Failed: missing ) at offset 4 - -/a**/i -Failed: nothing to repeat at offset 2 - -/)(/i -Failed: unmatched parentheses at offset 0 - -/:(?:/ -Failed: missing ) at offset 4 - -/(?<%)b/ -Failed: unrecognized character after (?< at offset 3 - -/a(?{)b/ -Failed: unrecognized character after (? at offset 3 - -/a(?{{})b/ -Failed: unrecognized character after (? at offset 3 - -/a(?{}})b/ -Failed: unrecognized character after (? at offset 3 - -/a(?{"{"})b/ -Failed: unrecognized character after (? at offset 3 - -/a(?{"{"}})b/ -Failed: unrecognized character after (? at offset 3 - -/(?(1?)a|b)/ -Failed: malformed number after (?( at offset 4 - -/(?(1)a|b|c)/ -Failed: conditional group contains more than two branches at offset 10 - -/[a[:xyz:/ -Failed: missing terminating ] for character class at offset 8 - -/(?<=x+)y/ -Failed: lookbehind assertion is not fixed length at offset 6 - -/a{37,17}/ -Failed: numbers out of order in {} quantifier at offset 7 - -/abc/\ -Failed: \ at end of pattern at offset 4 - -/abc/\P -Failed: POSIX code 9: bad escape sequence at offset 4 - -/abc/\i -Failed: \ at end of pattern at offset 4 - -/(a)bc(d)/ -Capturing subpattern count = 2 -No options -First char = 'a' -Need char = 'd' - abcd - 0: abcd - 1: a - 2: d - abcd\C2 - 0: abcd - 1: a - 2: d - 2C d (1) - abcd\C5 - 0: abcd - 1: a - 2: d -copy substring 5 failed -7 - -/(.{20})/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - abcdefghijklmnopqrstuvwxyz - 0: abcdefghijklmnopqrst - 1: abcdefghijklmnopqrst - abcdefghijklmnopqrstuvwxyz\C1 - 0: abcdefghijklmnopqrst - 1: abcdefghijklmnopqrst -copy substring 1 failed -6 - abcdefghijklmnopqrstuvwxyz\G1 - 0: abcdefghijklmnopqrst - 1: abcdefghijklmnopqrst - 1G abcdefghijklmnopqrst (20) - -/(.{15})/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - abcdefghijklmnopqrstuvwxyz - 0: abcdefghijklmno - 1: abcdefghijklmno - abcdefghijklmnopqrstuvwxyz\C1\G1 - 0: abcdefghijklmno - 1: abcdefghijklmno - 1C abcdefghijklmno (15) - 1G abcdefghijklmno (15) - -/(.{16})/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - abcdefghijklmnopqrstuvwxyz - 0: abcdefghijklmnop - 1: abcdefghijklmnop - abcdefghijklmnopqrstuvwxyz\C1\G1\L - 0: abcdefghijklmnop - 1: abcdefghijklmnop -copy substring 1 failed -6 - 1G abcdefghijklmnop (16) - 0L abcdefghijklmnop - 1L abcdefghijklmnop - -/^(a|(bc))de(f)/ -Capturing subpattern count = 3 -Options: anchored -No first char -No need char - adef\G1\G2\G3\G4\L - 0: adef - 1: a - 2: <unset> - 3: f - 1G a (1) - 2G (0) - 3G f (1) -get substring 4 failed -7 - 0L adef - 1L a - 2L - 3L f - bcdef\G1\G2\G3\G4\L - 0: bcdef - 1: bc - 2: bc - 3: f - 1G bc (2) - 2G bc (2) - 3G f (1) -get substring 4 failed -7 - 0L bcdef - 1L bc - 2L bc - 3L f - adefghijk\C0 - 0: adef - 1: a - 2: <unset> - 3: f - 0C adef (4) - -/^abc\00def/ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - abc\00def\L\C0 - 0: abc\x00def - 0C abc (7) - 0L abc - -/word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ -)((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ -)?)?)?)?)?)?)?)?)?otherword/M -Memory allocation (code space): 432 -Capturing subpattern count = 8 -Partial matching not supported -No options -First char = 'w' -Need char = 'd' - -/.*X/D ------------------------------------------------------------------- - 0 7 Bra 0 - 3 Any* - 5 X - 7 7 Ket - 10 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -First char at start or follows \n -Need char = 'X' - -/.*X/Ds ------------------------------------------------------------------- - 0 7 Bra 0 - 3 Any* - 5 X - 7 7 Ket - 10 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: anchored dotall -No first char -Need char = 'X' - -/(.*X|^B)/D ------------------------------------------------------------------- - 0 19 Bra 0 - 3 7 Bra 1 - 6 Any* - 8 X - 10 6 Alt - 13 ^ - 14 B - 16 13 Ket - 19 19 Ket - 22 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -No options -First char at start or follows \n -No need char - -/(.*X|^B)/Ds ------------------------------------------------------------------- - 0 19 Bra 0 - 3 7 Bra 1 - 6 Any* - 8 X - 10 6 Alt - 13 ^ - 14 B - 16 13 Ket - 19 19 Ket - 22 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored dotall -No first char -No need char - -/(?s)(.*X|^B)/D ------------------------------------------------------------------- - 0 19 Bra 0 - 3 7 Bra 1 - 6 Any* - 8 X - 10 6 Alt - 13 ^ - 14 B - 16 13 Ket - 19 19 Ket - 22 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored dotall -No first char -No need char - -/(?s:.*X|^B)/D ------------------------------------------------------------------- - 0 25 Bra 0 - 3 9 Bra 0 - 6 04 Opt - 8 Any* - 10 X - 12 8 Alt - 15 04 Opt - 17 ^ - 18 B - 20 17 Ket - 23 00 Opt - 25 25 Ket - 28 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -First char at start or follows \n -No need char - -/\Biss\B/+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - -/\Biss\B/+P - Mississippi - 0: iss - 0+ issippi - -/iss/G+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - 0: iss - 0+ ippi - -/\Biss\B/G+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - -/\Biss\B/g+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - 0: iss - 0+ ippi - *** Failers -No match - Mississippi\A -No match - -/(?<=[Ms])iss/g+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - 0: iss - 0+ ippi - -/(?<=[Ms])iss/G+ -Capturing subpattern count = 0 -No options -First char = 'i' -Need char = 's' - Mississippi - 0: iss - 0+ issippi - -/^iss/g+ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - ississippi - 0: iss - 0+ issippi - -/.*iss/g+ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char at start or follows \n -Need char = 's' - abciss\nxyzisspqr - 0: abciss - 0+ \x0axyzisspqr - 0: xyziss - 0+ pqr - -/.i./+g -Capturing subpattern count = 0 -No options -No first char -Need char = 'i' - Mississippi - 0: Mis - 0+ sissippi - 0: sis - 0+ sippi - 0: sip - 0+ pi - Mississippi\A - 0: Mis - 0+ sissippi - 0: sis - 0+ sippi - 0: sip - 0+ pi - Missouri river - 0: Mis - 0+ souri river - 0: ri - 0+ river - 0: riv - 0+ er - Missouri river\A - 0: Mis - 0+ souri river - -/^.is/+g -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - Mississippi - 0: Mis - 0+ sissippi - -/^ab\n/g+ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - ab\nab\ncd - 0: ab\x0a - 0+ ab\x0acd - -/^ab\n/mg+ -Capturing subpattern count = 0 -Options: multiline -First char at start or follows \n -Need char = 10 - ab\nab\ncd - 0: ab\x0a - 0+ ab\x0acd - 0: ab\x0a - 0+ cd - -/abc/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - -/abc|bac/ -Capturing subpattern count = 0 -No options -No first char -Need char = 'c' - -/(abc|bac)/ -Capturing subpattern count = 1 -No options -No first char -Need char = 'c' - -/(abc|(c|dc))/ -Capturing subpattern count = 2 -No options -No first char -Need char = 'c' - -/(abc|(d|de)c)/ -Capturing subpattern count = 2 -No options -No first char -Need char = 'c' - -/a*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - -/a+/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/(baa|a+)/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -Need char = 'a' - -/a{0,3}/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - -/baa{3,}/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'b' -Need char = 'a' - -/"([^\\"]+|\\.)*"/ -Capturing subpattern count = 1 -Partial matching not supported -No options -First char = '"' -Need char = '"' - -/(abc|ab[cd])/ -Capturing subpattern count = 1 -No options -First char = 'a' -No need char - -/(a|.)/ -Capturing subpattern count = 1 -No options -No first char -No need char - -/a|ba|\w/ -Capturing subpattern count = 0 -No options -No first char -No need char - -/abc(?=pqr)/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'r' - -/...(?<=abc)/ -Capturing subpattern count = 0 -No options -No first char -No need char - -/abc(?!pqr)/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - -/ab./ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/ab[xyz]/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/abc*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - -/ab.c*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - -/a.c*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/.c*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - -/ac*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/(a.c*|b.c*)/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - -/a.c*|aba/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/.+a/ -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'a' - -/(?=abcda)a.*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'a' - -/(?=a)a.*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/a(b)*/ -Capturing subpattern count = 1 -No options -First char = 'a' -No need char - -/a\d*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/ab\d*/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - -/a(\d)*/ -Capturing subpattern count = 1 -No options -First char = 'a' -No need char - -/abcde{0,0}/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'd' - -/ab\d+/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - -/a(?(1)b)/ -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/a(?(1)bag|big)/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'g' - -/a(?(1)bag|big)*/ -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/a(?(1)bag|big)+/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'g' - -/a(?(1)b..|b..)/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/ab\d{0}e/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'e' - -/a?b?/ -Capturing subpattern count = 0 -No options -No first char -No need char - a - 0: a - b - 0: b - ab - 0: ab - \ - 0: - *** Failers - 0: - \N -No match - -/|-/ -Capturing subpattern count = 0 -No options -No first char -No need char - abcd - 0: - -abc - 0: - \Nab-c - 0: - - *** Failers - 0: - \Nabc -No match - -/a*(b+)(z)(z)/P - aaaabbbbzzzz - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - aaaabbbbzzzz\O0 - aaaabbbbzzzz\O1 - 0: aaaabbbbzz - aaaabbbbzzzz\O2 - 0: aaaabbbbzz - 1: bbbb - aaaabbbbzzzz\O3 - 0: aaaabbbbzz - 1: bbbb - 2: z - aaaabbbbzzzz\O4 - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - aaaabbbbzzzz\O5 - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - -/^.?abcd/S -Capturing subpattern count = 0 -Options: anchored -No first char -Need char = 'd' -Study returned NULL - -/\( # ( at start - (?: # Non-capturing bracket - (?>[^()]+) # Either a sequence of non-brackets (no backtracking) - | # Or - (?R) # Recurse - i.e. nested bracketed string - )* # Zero or more contents - \) # Closing ) - /x -Capturing subpattern count = 0 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (abcd) - 0: (abcd) - (abcd)xyz - 0: (abcd) - xyz(abcd) - 0: (abcd) - (ab(xy)cd)pqr - 0: (ab(xy)cd) - (ab(xycd)pqr - 0: (xycd) - () abc () - 0: () - 12(abcde(fsh)xyz(foo(bar))lmno)89 - 0: (abcde(fsh)xyz(foo(bar))lmno) - *** Failers -No match - abcd -No match - abcd) -No match - (abcd -No match - -/\( ( (?>[^()]+) | (?R) )* \) /xg -Capturing subpattern count = 1 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd)pqr - 0: (ab(xy)cd) - 1: cd - 1(abcd)(x(y)z)pqr - 0: (abcd) - 1: abcd - 0: (x(y)z) - 1: z - -/\( (?: (?>[^()]+) | (?R) ) \) /x -Capturing subpattern count = 0 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (abcd) - 0: (abcd) - (ab(xy)cd) - 0: (xy) - (a(b(c)d)e) - 0: (c) - ((ab)) - 0: ((ab)) - *** Failers -No match - () -No match - -/\( (?: (?>[^()]+) | (?R) )? \) /x -Capturing subpattern count = 0 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - () - 0: () - 12(abcde(fsh)xyz(foo(bar))lmno)89 - 0: (fsh) - -/\( ( (?>[^()]+) | (?R) )* \) /x -Capturing subpattern count = 1 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd) - 0: (ab(xy)cd) - 1: cd - -/\( ( ( (?>[^()]+) | (?R) )* ) \) /x -Capturing subpattern count = 2 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd) - 0: (ab(xy)cd) - 1: ab(xy)cd - 2: cd - -/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x -Capturing subpattern count = 3 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd) - 0: (ab(xy)cd) - 1: <unset> - 2: ab(xy)cd - 3: cd - (123ab(xy)cd) - 0: (123ab(xy)cd) - 1: 123 - 2: ab(xy)cd - 3: cd - -/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x -Capturing subpattern count = 3 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd) - 0: (ab(xy)cd) - 1: ab(xy)cd - 2: <unset> - 3: cd - (123ab(xy)cd) - 0: (123ab(xy)cd) - 1: 123ab(xy)cd - 2: 123 - 3: cd - -/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x -Capturing subpattern count = 11 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(xy)cd) - 0: (ab(xy)cd) - 1: ab(xy)cd - 2: ab(xy)cd - 3: ab(xy)cd - 4: ab(xy)cd - 5: ab(xy)cd - 6: ab(xy)cd - 7: ab(xy)cd - 8: ab(xy)cd - 9: ab(xy)cd -10: ab(xy)cd -11: cd - -/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x -Capturing subpattern count = 3 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (abcd(xyz<p>qrs)123) - 0: (abcd(xyz<p>qrs)123) - 1: abcd(xyz<p>qrs)123 - 2: 123 - 3: <unset> - -/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x -Capturing subpattern count = 3 -Partial matching not supported -Options: extended -First char = '(' -Need char = ')' - (ab(cd)ef) - 0: (ab(cd)ef) - 1: ab(cd)ef - 2: ef - 3: (cd) - (ab(cd(ef)gh)ij) - 0: (ab(cd(ef)gh)ij) - 1: ab(cd(ef)gh)ij - 2: ij - 3: (cd(ef)gh) - -/^[[:alnum:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [0-9A-Za-z] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:^alnum:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-/:-@[-`{-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:alpha:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [A-Za-z] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:^alpha:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-@[-`{-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:ascii:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-\x7f] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:^ascii:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x80-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:blank:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x09 ] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:cntrl:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-\x1f\x7f] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:digit:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [0-9] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:graph:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [!-~] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:lower:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [a-z] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:print:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [ -~] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:punct:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [!-/:-@[-`{-~] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:space:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x09-\x0d ] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:upper:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [A-Z] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:xdigit:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [0-9A-Fa-f] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:word:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [0-9A-Z_a-z] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:^cntrl:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [ -~\x80-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[12[:^digit:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-/12:-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/^[[:^blank:]]/D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-\x08\x0a-\x1f!-\xff] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/[01[:alpha:]%]/D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [%01A-Za-z] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[[.ch.]]/ -Failed: POSIX collating elements are not supported at offset 1 - -/[[=ch=]]/ -Failed: POSIX collating elements are not supported at offset 1 - -/[[:rhubarb:]]/ -Failed: unknown POSIX class name at offset 3 - -/[[:upper:]]/i -Capturing subpattern count = 0 -Options: caseless -No first char -No need char - A - 0: A - a - 0: a - -/[[:lower:]]/i -Capturing subpattern count = 0 -Options: caseless -No first char -No need char - A - 0: A - a - 0: a - -/((?-i)[[:lower:]])[[:lower:]]/i -Capturing subpattern count = 1 -Options: caseless -Case state changes -No first char -No need char - ab - 0: ab - 1: a - aB - 0: aB - 1: a - *** Failers - 0: ai - 1: a - Ab -No match - AB -No match - -/[\200-\410]/ -Failed: range out of order in character class at offset 9 - -/^(?(0)f|b)oo/ -Failed: invalid condition (?(0) at offset 5 - -/This one's here because of the large output vector needed/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = 'd' - -/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/ -Capturing subpattern count = 271 -Max back reference = 270 -Partial matching not supported -No options -No first char -No need char - \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC - 0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC - 1: 1 - 2: 2 - 3: 3 - 4: 4 - 5: 5 - 6: 6 - 7: 7 - 8: 8 - 9: 9 -10: 10 -11: 11 -12: 12 -13: 13 -14: 14 -15: 15 -16: 16 -17: 17 -18: 18 -19: 19 -20: 20 -21: 21 -22: 22 -23: 23 -24: 24 -25: 25 -26: 26 -27: 27 -28: 28 -29: 29 -30: 30 -31: 31 -32: 32 -33: 33 -34: 34 -35: 35 -36: 36 -37: 37 -38: 38 -39: 39 -40: 40 -41: 41 -42: 42 -43: 43 -44: 44 -45: 45 -46: 46 -47: 47 -48: 48 -49: 49 -50: 50 -51: 51 -52: 52 -53: 53 -54: 54 -55: 55 -56: 56 -57: 57 -58: 58 -59: 59 -60: 60 -61: 61 -62: 62 -63: 63 -64: 64 -65: 65 -66: 66 -67: 67 -68: 68 -69: 69 -70: 70 -71: 71 -72: 72 -73: 73 -74: 74 -75: 75 -76: 76 -77: 77 -78: 78 -79: 79 -80: 80 -81: 81 -82: 82 -83: 83 -84: 84 -85: 85 -86: 86 -87: 87 -88: 88 -89: 89 -90: 90 -91: 91 -92: 92 -93: 93 -94: 94 -95: 95 -96: 96 -97: 97 -98: 98 -99: 99 -100: 100 -101: 101 -102: 102 -103: 103 -104: 104 -105: 105 -106: 106 -107: 107 -108: 108 -109: 109 -110: 110 -111: 111 -112: 112 -113: 113 -114: 114 -115: 115 -116: 116 -117: 117 -118: 118 -119: 119 -120: 120 -121: 121 -122: 122 -123: 123 -124: 124 -125: 125 -126: 126 -127: 127 -128: 128 -129: 129 -130: 130 -131: 131 -132: 132 -133: 133 -134: 134 -135: 135 -136: 136 -137: 137 -138: 138 -139: 139 -140: 140 -141: 141 -142: 142 -143: 143 -144: 144 -145: 145 -146: 146 -147: 147 -148: 148 -149: 149 -150: 150 -151: 151 -152: 152 -153: 153 -154: 154 -155: 155 -156: 156 -157: 157 -158: 158 -159: 159 -160: 160 -161: 161 -162: 162 -163: 163 -164: 164 -165: 165 -166: 166 -167: 167 -168: 168 -169: 169 -170: 170 -171: 171 -172: 172 -173: 173 -174: 174 -175: 175 -176: 176 -177: 177 -178: 178 -179: 179 -180: 180 -181: 181 -182: 182 -183: 183 -184: 184 -185: 185 -186: 186 -187: 187 -188: 188 -189: 189 -190: 190 -191: 191 -192: 192 -193: 193 -194: 194 -195: 195 -196: 196 -197: 197 -198: 198 -199: 199 -200: 200 -201: 201 -202: 202 -203: 203 -204: 204 -205: 205 -206: 206 -207: 207 -208: 208 -209: 209 -210: 210 -211: 211 -212: 212 -213: 213 -214: 214 -215: 215 -216: 216 -217: 217 -218: 218 -219: 219 -220: 220 -221: 221 -222: 222 -223: 223 -224: 224 -225: 225 -226: 226 -227: 227 -228: 228 -229: 229 -230: 230 -231: 231 -232: 232 -233: 233 -234: 234 -235: 235 -236: 236 -237: 237 -238: 238 -239: 239 -240: 240 -241: 241 -242: 242 -243: 243 -244: 244 -245: 245 -246: 246 -247: 247 -248: 248 -249: 249 -250: 250 -251: 251 -252: 252 -253: 253 -254: 254 -255: 255 -256: 256 -257: 257 -258: 258 -259: 259 -260: 260 -261: 261 -262: 262 -263: 263 -264: 264 -265: 265 -266: 266 -267: 267 -268: 268 -269: 269 -270: ABC -271: ABC - -/This one's here because Perl does this differently and PCRE can't at present/ -Capturing subpattern count = 0 -No options -First char = 'T' -Need char = 't' - -/(main(O)?)+/ -Capturing subpattern count = 2 -No options -First char = 'm' -Need char = 'n' - mainmain - 0: mainmain - 1: main - mainOmain - 0: mainOmain - 1: main - 2: O - -/These are all cases where Perl does it differently (nested captures)/ -Capturing subpattern count = 1 -No options -First char = 'T' -Need char = 's' - -/^(a(b)?)+$/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - aba - 0: aba - 1: a - 2: b - -/^(aa(bb)?)+$/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: aa - 2: bb - -/^(aa|aa(bb))+$/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: aa - 2: bb - -/^(aa(bb)??)+$/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: aa - 2: bb - -/^(?:aa(bb)?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: bb - -/^(aa(b(b))?)+$/ -Capturing subpattern count = 3 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: aa - 2: bb - 3: b - -/^(?:aa(b(b))?)+$/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: bb - 2: b - -/^(?:aa(b(?:b))?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: bb - -/^(?:aa(bb(?:b))?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbbaa - 0: aabbbaa - 1: bbb - -/^(?:aa(b(?:bb))?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbbaa - 0: aabbbaa - 1: bbb - -/^(?:aa(?:b(b))?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbaa - 0: aabbaa - 1: b - -/^(?:aa(?:b(bb))?)+$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - aabbbaa - 0: aabbbaa - 1: bb - -/^(aa(b(bb))?)+$/ -Capturing subpattern count = 3 -Options: anchored -No first char -No need char - aabbbaa - 0: aabbbaa - 1: aa - 2: bbb - 3: bb - -/^(aa(bb(bb))?)+$/ -Capturing subpattern count = 3 -Options: anchored -No first char -No need char - aabbbbaa - 0: aabbbbaa - 1: aa - 2: bbbb - 3: bb - -/--------------------------------------------------------------------/ -Capturing subpattern count = 0 -No options -First char = '-' -Need char = '-' - -/#/xMD -Memory allocation (code space): 7 ------------------------------------------------------------------- - 0 3 Bra 0 - 3 3 Ket - 6 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: extended -No first char -No need char - -/a#/xMD -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra 0 - 3 a - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: extended -First char = 'a' -No need char - -/[\s]/D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x09\x0a\x0c\x0d ] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\S]/D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x00-\x08\x0b\x0e-\x1f!-\xff] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/a(?i)b/D ------------------------------------------------------------------- - 0 9 Bra 0 - 3 a - 5 01 Opt - 7 NC b - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -Case state changes -First char = 'a' -Need char = 'b' (caseless) - ab - 0: ab - aB - 0: aB - *** Failers -No match - AB -No match - -/(a(?i)b)/D ------------------------------------------------------------------- - 0 17 Bra 0 - 3 9 Bra 1 - 6 a - 8 01 Opt - 10 NC b - 12 9 Ket - 15 00 Opt - 17 17 Ket - 20 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -Case state changes -First char = 'a' -Need char = 'b' (caseless) - ab - 0: ab - 1: ab - aB - 0: aB - 1: aB - *** Failers -No match - AB -No match - -/ (?i)abc/xD ------------------------------------------------------------------- - 0 9 Bra 0 - 3 NC abc - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless extended -First char = 'a' (caseless) -Need char = 'c' (caseless) - -/#this is a comment - (?i)abc/xD ------------------------------------------------------------------- - 0 9 Bra 0 - 3 NC abc - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless extended -First char = 'a' (caseless) -Need char = 'c' (caseless) - -/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D ------------------------------------------------------------------- - 0 603 Bra 0 - 3 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 -603 603 Ket -606 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = '1' -Need char = '0' - -/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D ------------------------------------------------------------------- - 0 603 Bra 0 - 3 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 -603 603 Ket -606 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = '1' -Need char = '0' - -/\Q\E/D ------------------------------------------------------------------- - 0 3 Bra 0 - 3 3 Ket - 6 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - \ - 0: - -/\Q\Ex/D ------------------------------------------------------------------- - 0 5 Bra 0 - 3 x - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 'x' -No need char - -/ \Q\E/D ------------------------------------------------------------------- - 0 5 Bra 0 - 3 - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = ' ' -No need char - -/a\Q\E/D ------------------------------------------------------------------- - 0 5 Bra 0 - 3 a - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - abc - 0: a - bca - 0: a - bac - 0: a - -/a\Q\Eb/D ------------------------------------------------------------------- - 0 7 Bra 0 - 3 ab - 7 7 Ket - 10 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - abc - 0: ab - -/\Q\Eabc/D ------------------------------------------------------------------- - 0 9 Bra 0 - 3 abc - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - -/x*+\w/D ------------------------------------------------------------------- - 0 12 Bra 0 - 3 5 Once - 6 x* - 8 5 Ket - 11 \w - 12 12 Ket - 15 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - *** Failers - 0: F - xxxxx -No match - -/x?+/D ------------------------------------------------------------------- - 0 11 Bra 0 - 3 5 Once - 6 x? - 8 5 Ket - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/x++/D ------------------------------------------------------------------- - 0 11 Bra 0 - 3 5 Once - 6 x+ - 8 5 Ket - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'x' -No need char - -/x{1,3}+/D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 9 Once - 6 x - 8 x{,2} - 12 9 Ket - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'x' -No need char - -/(x)*+/D ------------------------------------------------------------------- - 0 18 Bra 0 - 3 12 Once - 6 Brazero - 7 5 Bra 1 - 10 x - 12 5 KetRmax - 15 12 Ket - 18 18 Ket - 21 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -No first char -No need char - -/^(\w++|\s++)*$/ -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored -No first char -No need char - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - 1: party - *** Failers -No match - this is not a line with only words and spaces! -No match - -/(\d++)(\w)/ -Capturing subpattern count = 2 -Partial matching not supported -No options -No first char -No need char - 12345a - 0: 12345a - 1: 12345 - 2: a - *** Failers -No match - 12345+ -No match - -/a++b/ -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - aaab - 0: aaab - -/(a++b)/ -Capturing subpattern count = 1 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - aaab - 0: aaab - 1: aaab - -/(a++)b/ -Capturing subpattern count = 1 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - aaab - 0: aaab - 1: aaa - -/([^()]++|\([^()]*\))+/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/\(([^()]++|\([^()]+\))+\)/ -Capturing subpattern count = 1 -Partial matching not supported -No options -First char = '(' -Need char = ')' - (abc) - 0: (abc) - 1: abc - (abc(def)xyz) - 0: (abc(def)xyz) - 1: xyz - *** Failers -No match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(abc){1,3}+/D ------------------------------------------------------------------- - 0 53 Bra 0 - 3 47 Once - 6 9 Bra 1 - 9 abc - 15 9 Ket - 18 Brazero - 19 28 Bra 0 - 22 9 Bra 1 - 25 abc - 31 9 Ket - 34 Brazero - 35 9 Bra 1 - 38 abc - 44 9 Ket - 47 28 Ket - 50 47 Ket - 53 53 Ket - 56 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'c' - -/a+?+/ -Failed: nothing to repeat at offset 3 - -/a{2,3}?+b/ -Failed: nothing to repeat at offset 7 - -/(?U)a+?+/ -Failed: nothing to repeat at offset 7 - -/a{2,3}?+b/U -Failed: nothing to repeat at offset 7 - -/x(?U)a++b/D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 x - 5 5 Once - 8 a+ - 10 5 Ket - 13 b - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'x' -Need char = 'b' - xaaaab - 0: xaaaab - -/(?U)xa++b/D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 x - 5 5 Once - 8 a+ - 10 5 Ket - 13 b - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: ungreedy -First char = 'x' -Need char = 'b' - xaaaab - 0: xaaaab - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/D ------------------------------------------------------------------- - 0 106 Bra 0 - 3 ^ - 4 99 Bra 1 - 7 5 Bra 2 - 10 a+ - 12 5 Ket - 15 37 Bra 3 - 18 [ab]+? - 52 37 Ket - 55 37 Bra 4 - 58 [bc]+ - 92 37 Ket - 95 5 Bra 5 - 98 \w* -100 5 Ket -103 99 Ket -106 106 Ket -109 End ------------------------------------------------------------------- -Capturing subpattern count = 5 -Partial matching not supported -Options: anchored -No first char -No need char - -/^x(?U)a+b/D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 ^ - 4 x - 6 a+? - 8 b - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: anchored -No first char -Need char = 'b' - -/^x(?U)(a+)b/D ------------------------------------------------------------------- - 0 16 Bra 0 - 3 ^ - 4 x - 6 5 Bra 1 - 9 a+? - 11 5 Ket - 14 b - 16 16 Ket - 19 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored -No first char -Need char = 'b' - -/[.x.]/ -Failed: POSIX collating elements are not supported at offset 0 - -/[=x=]/ -Failed: POSIX collating elements are not supported at offset 0 - -/[:x:]/ -Failed: POSIX named classes are supported only within a class at offset 0 - -/\l/ -Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 - -/\L/ -Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 - -/\N{name}/ -Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 - -/\u/ -Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 - -/\U/ -Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 - -/[/ -Failed: missing terminating ] for character class at offset 1 - -/[a-/ -Failed: missing terminating ] for character class at offset 3 - -/[[:space:]/ -Failed: missing terminating ] for character class at offset 10 - -/[\s]/DM -Memory allocation (code space): 40 ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x09\x0a\x0c\x0d ] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[[:space:]]/DM -Memory allocation (code space): 40 ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x09-\x0d ] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[[:space:]abcde]/DM -Memory allocation (code space): 40 ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x09-\x0d a-e] - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x -Capturing subpattern count = 0 -Partial matching not supported -Options: extended -First char = '<' -Need char = '>' - <> - 0: <> - <abcd> - 0: <abcd> - <abc <123> hij> - 0: <abc <123> hij> - <abc <def> hij> - 0: <def> - <abc<>def> - 0: <abc<>def> - <abc<> - 0: <> - *** Failers -No match - <abc -No match - -|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM -Memory allocation (code space): 826 ------------------------------------------------------------------- - 0 822 Bra 0 - 3 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X -821 \b -822 822 Ket -825 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = '8' -Need char = 'X' - -|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM -Memory allocation (code space): 816 ------------------------------------------------------------------- - 0 812 Bra 0 - 3 $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X -811 \b -812 812 Ket -815 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = '$' -Need char = 'X' - -/(.*)\d+\1/I -Capturing subpattern count = 1 -Max back reference = 1 -Partial matching not supported -No options -No first char -No need char - -/(.*)\d+/I -Capturing subpattern count = 1 -Partial matching not supported -No options -First char at start or follows \n -No need char - -/(.*)\d+\1/Is -Capturing subpattern count = 1 -Max back reference = 1 -Partial matching not supported -Options: dotall -No first char -No need char - -/(.*)\d+/Is -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored dotall -No first char -No need char - -/(.*(xyz))\d+\2/I -Capturing subpattern count = 2 -Max back reference = 2 -Partial matching not supported -No options -First char at start or follows \n -Need char = 'z' - -/((.*))\d+\1/I -Capturing subpattern count = 2 -Max back reference = 1 -Partial matching not supported -No options -No first char -No need char - abc123bc - 0: bc123bc - 1: bc - 2: bc - -/a[b]/I -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/(?=a).*/I -Capturing subpattern count = 0 -Partial matching not supported -No options -First char = 'a' -No need char - -/(?=abc).xyz/iI -Capturing subpattern count = 0 -Options: caseless -First char = 'a' (caseless) -Need char = 'z' (caseless) - -/(?=abc)(?i).xyz/I -Capturing subpattern count = 0 -No options -Case state changes -First char = 'a' -Need char = 'z' (caseless) - -/(?=a)(?=b)/I -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/(?=.)a/I -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/((?=abcda)a)/I -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'a' - -/((?=abcda)ab)/I -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'b' - -/()a/I -Capturing subpattern count = 1 -No options -No first char -Need char = 'a' - -/(?(1)ab|ac)/I -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/(?(1)abz|acz)/I -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'z' - -/(?(1)abz)/I -Capturing subpattern count = 0 -No options -No first char -No need char - -/(?(1)abz)123/I -Capturing subpattern count = 0 -No options -No first char -Need char = '3' - -/(a)+/I -Capturing subpattern count = 1 -No options -First char = 'a' -No need char - -/(a){2,3}/I -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'a' - -/(a)*/I -Capturing subpattern count = 1 -No options -No first char -No need char - -/[a]/I -Capturing subpattern count = 0 -No options -First char = 'a' -No need char - -/[ab]/I -Capturing subpattern count = 0 -No options -No first char -No need char - -/[ab]/IS -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b - -/[^a]/I -Capturing subpattern count = 0 -No options -No first char -No need char - -/\d456/I -Capturing subpattern count = 0 -No options -No first char -Need char = '6' - -/\d456/IS -Capturing subpattern count = 0 -No options -No first char -Need char = '6' -Starting byte set: 0 1 2 3 4 5 6 7 8 9 - -/a^b/I -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/^a/mI -Capturing subpattern count = 0 -Options: multiline -First char at start or follows \n -Need char = 'a' - abcde - 0: a - xy\nabc - 0: a - *** Failers -No match - xyabc -No match - -/c|abc/I -Capturing subpattern count = 0 -No options -No first char -Need char = 'c' - -/(?i)[ab]/IS -Capturing subpattern count = 0 -Options: caseless -No first char -No need char -Starting byte set: A B a b - -/[ab](?i)cd/IS -Capturing subpattern count = 0 -No options -Case state changes -No first char -Need char = 'd' (caseless) -Starting byte set: a b - -/abc(?C)def/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'f' - abcdef ---->abcdef - 0 ^ ^ d - 0: abcdef - 1234abcdef ---->1234abcdef - 0 ^ ^ d - 0: abcdef - *** Failers -No match - abcxyz -No match - abcxyzf ---->abcxyzf - 0 ^ ^ d -No match - -/abc(?C)de(?C1)f/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'f' - 123abcdef ---->123abcdef - 0 ^ ^ d - 1 ^ ^ f - 0: abcdef - -/(?C1)\dabc(?C2)def/ -Capturing subpattern count = 0 -No options -No first char -Need char = 'f' - 1234abcdef ---->1234abcdef - 1 ^ \d - 1 ^ \d - 1 ^ \d - 1 ^ \d - 2 ^ ^ d - 0: 4abcdef - *** Failers -No match - abcdef ---->abcdef - 1 ^ \d - 1 ^ \d - 1 ^ \d - 1 ^ \d - 1 ^ \d - 1 ^ \d -No match - -/(?C255)ab/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'b' - -/(?C256)ab/ -Failed: number after (?C is > 255 at offset 6 - -/(?Cab)xx/ -Failed: closing ) for (?C expected at offset 3 - -/(?C12vr)x/ -Failed: closing ) for (?C expected at offset 5 - -/abc(?C)def/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'f' - *** Failers -No match - \x83\x0\x61bcdef ---->\x83\x00abcdef - 0 ^ ^ d - 0: abcdef - -/(abc)(?C)de(?C1)f/ -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'f' - 123abcdef ---->123abcdef - 0 ^ ^ d - 1 ^ ^ f - 0: abcdef - 1: abc - 123abcdef\C+ -Callout 0: last capture = 1 - 0: <unset> - 1: abc ---->123abcdef - ^ ^ d -Callout 1: last capture = 1 - 0: <unset> - 1: abc ---->123abcdef - ^ ^ f - 0: abcdef - 1: abc - 123abcdef\C- - 0: abcdef - 1: abc - *** Failers -No match - 123abcdef\C!1 ---->123abcdef - 0 ^ ^ d - 1 ^ ^ f -No match - -/(?C0)(abc(?C1))*/ -Capturing subpattern count = 1 -No options -No first char -No need char - abcabcabc ---->abcabcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) - 1 ^ ^ ) - 0: abcabcabc - 1: abc - abcabc\C!1!3 ---->abcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) - 0: abcabc - 1: abc - *** Failers ---->*** Failers - 0 ^ (abc(?C1))* - 0: - abcabcabc\C!1!3 ---->abcabcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) - 1 ^ ^ ) - 0: abcabc - 1: abc - -/(\d{3}(?C))*/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -No need char - 123\C+ -Callout 0: last capture = -1 - 0: <unset> ---->123 - ^ ^ ) - 0: 123 - 1: 123 - 123456\C+ -Callout 0: last capture = -1 - 0: <unset> ---->123456 - ^ ^ ) -Callout 0: last capture = 1 - 0: <unset> - 1: 123 ---->123456 - ^ ^ ) - 0: 123456 - 1: 456 - 123456789\C+ -Callout 0: last capture = -1 - 0: <unset> ---->123456789 - ^ ^ ) -Callout 0: last capture = 1 - 0: <unset> - 1: 123 ---->123456789 - ^ ^ ) -Callout 0: last capture = 1 - 0: <unset> - 1: 456 ---->123456789 - ^ ^ ) - 0: 123456789 - 1: 789 - -/((xyz)(?C)p|(?C1)xyzabc)/ -Capturing subpattern count = 2 -No options -First char = 'x' -No need char - xyzabc\C+ -Callout 0: last capture = 2 - 0: <unset> - 1: <unset> - 2: xyz ---->xyzabc - ^ ^ p -Callout 1: last capture = -1 - 0: <unset> ---->xyzabc - ^ x - 0: xyzabc - 1: xyzabc - -/(X)((xyz)(?C)p|(?C1)xyzabc)/ -Capturing subpattern count = 3 -No options -First char = 'X' -Need char = 'x' - Xxyzabc\C+ -Callout 0: last capture = 3 - 0: <unset> - 1: X - 2: <unset> - 3: xyz ---->Xxyzabc - ^ ^ p -Callout 1: last capture = 1 - 0: <unset> - 1: X ---->Xxyzabc - ^^ x - 0: Xxyzabc - 1: X - 2: xyzabc - -/(?=(abc))(?C)abcdef/ -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'f' - abcdef\C+ -Callout 0: last capture = 1 - 0: <unset> - 1: abc ---->abcdef - ^ a - 0: abcdef - 1: abc - -/(?!(abc)(?C1)d)(?C2)abcxyz/ -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'z' - abcxyz\C+ -Callout 1: last capture = 1 - 0: <unset> - 1: abc ---->abcxyz - ^ ^ d -Callout 2: last capture = -1 - 0: <unset> ---->abcxyz - ^ a - 0: abcxyz - -/(?<=(abc)(?C))xyz/ -Capturing subpattern count = 1 -No options -First char = 'x' -Need char = 'z' - abcxyz\C+ -Callout 0: last capture = 1 - 0: <unset> - 1: abc ---->abcxyz - ^ ) - 0: xyz - 1: abc - -/a(b+)(c*)(?C1)/ -Capturing subpattern count = 2 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - abbbbbccc\C*1 ---->abbbbbccc - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 -No match - -/a(b+?)(c*?)(?C1)/ -Capturing subpattern count = 2 -Partial matching not supported -No options -First char = 'a' -Need char = 'b' - abbbbbccc\C*1 ---->abbbbbccc - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 - 1 ^ ^ -Callout data = 1 -No match - -/(?C)abc/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - -/(?C)^abc/ -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/(?C)a|b/S -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: a b - -/(?R)/ -Failed: recursive call could loop indefinitely at offset 3 - -/(a|(?R))/ -Failed: recursive call could loop indefinitely at offset 6 - -/(ab|(bc|(de|(?R))))/ -Failed: recursive call could loop indefinitely at offset 15 - -/x(ab|(bc|(de|(?R))))/ -Capturing subpattern count = 3 -No options -First char = 'x' -No need char - xab - 0: xab - 1: ab - xbc - 0: xbc - 1: bc - 2: bc - xde - 0: xde - 1: de - 2: de - 3: de - xxab - 0: xxab - 1: xab - 2: xab - 3: xab - xxxab - 0: xxxab - 1: xxab - 2: xxab - 3: xxab - *** Failers -No match - xyab -No match - -/(ab|(bc|(de|(?1))))/ -Failed: recursive call could loop indefinitely at offset 15 - -/x(ab|(bc|(de|(?1)x)x)x)/ -Failed: recursive call could loop indefinitely at offset 16 - -/^([^()]|\((?1)*\))*$/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - abc - 0: abc - 1: c - a(b)c - 0: a(b)c - 1: c - a(b(c))d - 0: a(b(c))d - 1: d - *** Failers) -No match - a(b(c)d -No match - -/^>abc>([^()]|\((?1)*\))*<xyz<$/ -Capturing subpattern count = 1 -Options: anchored -No first char -Need char = '<' - >abc>123<xyz< - 0: >abc>123<xyz< - 1: 3 - >abc>1(2)3<xyz< - 0: >abc>1(2)3<xyz< - 1: 3 - >abc>(1(2)3)<xyz< - 0: >abc>(1(2)3)<xyz< - 1: (1(2)3) - -/(a(?1)b)/D ------------------------------------------------------------------- - 0 16 Bra 0 - 3 10 Bra 1 - 6 a - 8 3 Recurse - 11 b - 13 10 Ket - 16 16 Ket - 19 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'b' - -/(a(?1)+b)/D ------------------------------------------------------------------- - 0 22 Bra 0 - 3 16 Bra 1 - 6 a - 8 6 Bra 0 - 11 3 Recurse - 14 6 KetRmax - 17 b - 19 16 Ket - 22 22 Ket - 25 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'b' - -/^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/i -Capturing subpattern count = 4 -Max back reference = 4 -Partial matching not supported -Options: anchored caseless -No first char -No need char - 1221 - 0: 1221 - 1: 1221 - 2: 1 - Satan, oscillate my metallic sonatas! - 0: Satan, oscillate my metallic sonatas! - 1: <unset> - 2: <unset> - 3: Satan, oscillate my metallic sonatas - 4: S - A man, a plan, a canal: Panama! - 0: A man, a plan, a canal: Panama! - 1: <unset> - 2: <unset> - 3: A man, a plan, a canal: Panama - 4: A - Able was I ere I saw Elba. - 0: Able was I ere I saw Elba. - 1: <unset> - 2: <unset> - 3: Able was I ere I saw Elba - 4: A - *** Failers -No match - The quick brown fox -No match - -/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ -Capturing subpattern count = 2 -Partial matching not supported -Options: anchored -No first char -No need char - 12 - 0: 12 - 1: 12 - (((2+2)*-3)-7) - 0: (((2+2)*-3)-7) - 1: (((2+2)*-3)-7) - 2: - - -12 - 0: -12 - 1: -12 - *** Failers -No match - ((2+2)*-3)-7) -No match - -/^(x(y|(?1){2})z)/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - xyz - 0: xyz - 1: xyz - 2: y - xxyzxyzz - 0: xxyzxyzz - 1: xxyzxyzz - 2: xyzxyz - *** Failers -No match - xxyzz -No match - xxyzxyzxyzz -No match - -/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x -Capturing subpattern count = 2 -Partial matching not supported -Options: extended -First char = '<' -Need char = '>' - <> - 0: <> - 1: <> - 2: <> - <abcd> - 0: <abcd> - 1: <abcd> - 2: <abcd> - <abc <123> hij> - 0: <abc <123> hij> - 1: <abc <123> hij> - 2: <abc <123> hij> - <abc <def> hij> - 0: <def> - 1: <def> - 2: <def> - <abc<>def> - 0: <abc<>def> - 1: <abc<>def> - 2: <abc<>def> - <abc<> - 0: <> - 1: <> - 2: <> - *** Failers -No match - <abc -No match - -/(?1)/ -Failed: reference to non-existent subpattern at offset 3 - -/((?2)(abc)/ -Failed: reference to non-existent subpattern at offset 4 - -/^(abc)def(?1)/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - abcdefabc - 0: abcdefabc - 1: abc - -/^(a|b|c)=(?1)+/ -Capturing subpattern count = 1 -Options: anchored -No first char -No need char - a=a - 0: a=a - 1: a - a=b - 0: a=b - 1: a - a=bc - 0: a=bc - 1: a - -/^(a|b|c)=((?1))+/ -Capturing subpattern count = 2 -Options: anchored -No first char -No need char - a=a - 0: a=a - 1: a - 2: a - a=b - 0: a=b - 1: a - 2: b - a=bc - 0: a=bc - 1: a - 2: c - -/a(?P<name1>b|c)d(?P<longername2>e)/D ------------------------------------------------------------------- - 0 28 Bra 0 - 3 a - 5 5 Bra 1 - 8 b - 10 5 Alt - 13 c - 15 10 Ket - 18 d - 20 5 Bra 2 - 23 e - 25 5 Ket - 28 28 Ket - 31 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Named capturing subpatterns: - longername2 2 - name1 1 -No options -First char = 'a' -Need char = 'e' - abde - 0: abde - 1: b - 2: e - acde - 0: acde - 1: c - 2: e - -/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/D ------------------------------------------------------------------- - 0 35 Bra 0 - 3 21 Bra 0 - 6 a - 8 13 Bra 1 - 11 c - 13 5 Bra 2 - 16 d - 18 5 Ket - 21 13 Ket - 24 21 Ket - 27 5 Bra 3 - 30 a - 32 5 Ket - 35 35 Ket - 38 End ------------------------------------------------------------------- -Capturing subpattern count = 3 -Named capturing subpatterns: - a 3 - c 1 - d 2 -No options -First char = 'a' -Need char = 'a' - -/(?P<a>a)...(?P=a)bbb(?P>a)d/D ------------------------------------------------------------------- - 0 28 Bra 0 - 3 5 Bra 1 - 6 a - 8 5 Ket - 11 Any - 12 Any - 13 Any - 14 \1 - 17 bbb - 23 3 Recurse - 26 d - 28 28 Ket - 31 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Max back reference = 1 -Named capturing subpatterns: - a 1 -No options -First char = 'a' -Need char = 'd' - -/^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/i -Capturing subpattern count = 4 -Max back reference = 4 -Named capturing subpatterns: - four 4 - one 1 - three 3 - two 2 -Partial matching not supported -Options: anchored caseless -No first char -No need char - 1221 - 0: 1221 - 1: 1221 - 2: 1 - Satan, oscillate my metallic sonatas! - 0: Satan, oscillate my metallic sonatas! - 1: <unset> - 2: <unset> - 3: Satan, oscillate my metallic sonatas - 4: S - A man, a plan, a canal: Panama! - 0: A man, a plan, a canal: Panama! - 1: <unset> - 2: <unset> - 3: A man, a plan, a canal: Panama - 4: A - Able was I ere I saw Elba. - 0: Able was I ere I saw Elba. - 1: <unset> - 2: <unset> - 3: Able was I ere I saw Elba - 4: A - *** Failers -No match - The quick brown fox -No match - -/((?(R)a|b))\1(?1)?/ -Capturing subpattern count = 1 -Max back reference = 1 -No options -No first char -No need char - bb - 0: bb - 1: b - bbaa - 0: bba - 1: b - -/(.*)a/sI -Capturing subpattern count = 1 -Partial matching not supported -Options: anchored dotall -No first char -Need char = 'a' - -/(.*)a\1/sI -Capturing subpattern count = 1 -Max back reference = 1 -Partial matching not supported -Options: dotall -No first char -Need char = 'a' - -/(.*)a(b)\2/sI -Capturing subpattern count = 2 -Max back reference = 2 -Partial matching not supported -Options: anchored dotall -No first char -Need char = 'b' - -/((.*)a|(.*)b)z/sI -Capturing subpattern count = 3 -Partial matching not supported -Options: anchored dotall -No first char -Need char = 'z' - -/((.*)a|(.*)b)z\1/sI -Capturing subpattern count = 3 -Max back reference = 1 -Partial matching not supported -Options: dotall -No first char -Need char = 'z' - -/((.*)a|(.*)b)z\2/sI -Capturing subpattern count = 3 -Max back reference = 2 -Partial matching not supported -Options: dotall -No first char -Need char = 'z' - -/((.*)a|(.*)b)z\3/sI -Capturing subpattern count = 3 -Max back reference = 3 -Partial matching not supported -Options: dotall -No first char -Need char = 'z' - -/((.*)a|^(.*)b)z\3/sI -Capturing subpattern count = 3 -Max back reference = 3 -Partial matching not supported -Options: anchored dotall -No first char -Need char = 'z' - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/sI -Capturing subpattern count = 31 -Partial matching not supported -Options: anchored dotall -No first char -No need char - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/sI -Capturing subpattern count = 31 -Max back reference = 31 -Partial matching not supported -Options: dotall -No first char -No need char - -/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/sI -Capturing subpattern count = 32 -Max back reference = 32 -Partial matching not supported -Options: dotall -No first char -No need char - -/(a)(bc)/ND ------------------------------------------------------------------- - 0 21 Bra 0 - 3 5 Bra 0 - 6 a - 8 5 Ket - 11 7 Bra 0 - 14 bc - 18 7 Ket - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: -First char = 'a' -Need char = 'c' - abc - 0: abc - -/(?P<one>a)(bc)/ND ------------------------------------------------------------------- - 0 21 Bra 0 - 3 5 Bra 1 - 6 a - 8 5 Ket - 11 7 Bra 0 - 14 bc - 18 7 Ket - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Named capturing subpatterns: - one 1 -Options: -First char = 'a' -Need char = 'c' - abc - 0: abc - 1: a - -/(a)(?P<named>bc)/ND ------------------------------------------------------------------- - 0 21 Bra 0 - 3 5 Bra 0 - 6 a - 8 5 Ket - 11 7 Bra 1 - 14 bc - 18 7 Ket - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Named capturing subpatterns: - named 1 -Options: -First char = 'a' -Need char = 'c' - -/(a+)*zz/ -Capturing subpattern count = 1 -Partial matching not supported -No options -No first char -Need char = 'z' - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M -Minimum match limit = 8 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaz\M -Minimum match limit = 32768 -No match - -/(aaa(?C1)bbb|ab)/ -Capturing subpattern count = 1 -No options -First char = 'a' -Need char = 'b' - aaabbb ---->aaabbb - 1 ^ ^ b - 0: aaabbb - 1: aaabbb - aaabbb\C*0 ---->aaabbb - 1 ^ ^ b - 0: aaabbb - 1: aaabbb - aaabbb\C*1 ---->aaabbb - 1 ^ ^ b -Callout data = 1 - 0: ab - 1: ab - aaabbb\C*-1 ---->aaabbb - 1 ^ ^ b -Callout data = -1 -No match - -/ab(?P<one>cd)ef(?P<two>gh)/ -Capturing subpattern count = 2 -Named capturing subpatterns: - one 1 - two 2 -No options -First char = 'a' -Need char = 'h' - abcdefgh - 0: abcdefgh - 1: cd - 2: gh - abcdefgh\C1\Gtwo - 0: abcdefgh - 1: cd - 2: gh - 1C cd (2) - 2G gh (2) - abcdefgh\Cone\Ctwo - 0: abcdefgh - 1: cd - 2: gh - 1C cd (2) - 2C gh (2) - abcdefgh\Cthree -no parentheses with name "three" - 0: abcdefgh - 1: cd - 2: gh - -/(?P<Tes>)(?P<Test>)/D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 3 Bra 1 - 6 3 Ket - 9 3 Bra 2 - 12 3 Ket - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Named capturing subpatterns: - Tes 1 - Test 2 -No options -No first char -No need char - -/(?P<Test>)(?P<Tes>)/D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 3 Bra 1 - 6 3 Ket - 9 3 Bra 2 - 12 3 Ket - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Named capturing subpatterns: - Tes 2 - Test 1 -No options -No first char -No need char - -/(?P<Z>zz)(?P<A>aa)/ -Capturing subpattern count = 2 -Named capturing subpatterns: - A 2 - Z 1 -No options -First char = 'z' -Need char = 'a' - zzaa\CZ - 0: zzaa - 1: zz - 2: aa - 1C zz (2) - zzaa\CA - 0: zzaa - 1: zz - 2: aa - 2C aa (2) - -/(?P<x>eks)(?P<x>eccs)/ -Failed: two named groups have the same name at offset 16 - -/(?P<abc>abc(?P<def>def)(?P<abc>xyz))/ -Failed: two named groups have the same name at offset 31 - -"\[((?P<elem>\d+)(,(?P>elem))*)\]" -Capturing subpattern count = 3 -Named capturing subpatterns: - elem 2 -Partial matching not supported -No options -First char = '[' -Need char = ']' - [10,20,30,5,5,4,4,2,43,23,4234] - 0: [10,20,30,5,5,4,4,2,43,23,4234] - 1: 10,20,30,5,5,4,4,2,43,23,4234 - 2: 10 - 3: ,4234 - *** Failers -No match - [] -No match - -"\[((?P<elem>\d+)(,(?P>elem))*)?\]" -Capturing subpattern count = 3 -Named capturing subpatterns: - elem 2 -Partial matching not supported -No options -First char = '[' -Need char = ']' - [10,20,30,5,5,4,4,2,43,23,4234] - 0: [10,20,30,5,5,4,4,2,43,23,4234] - 1: 10,20,30,5,5,4,4,2,43,23,4234 - 2: 10 - 3: ,4234 - [] - 0: [] - -/(a(b(?2)c))?/D ------------------------------------------------------------------- - 0 25 Bra 0 - 3 Brazero - 4 18 Bra 1 - 7 a - 9 10 Bra 2 - 12 b - 14 9 Recurse - 17 c - 19 10 Ket - 22 18 Ket - 25 25 Ket - 28 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -No options -No first char -No need char - -/(a(b(?2)c))*/D ------------------------------------------------------------------- - 0 25 Bra 0 - 3 Brazero - 4 18 Bra 1 - 7 a - 9 10 Bra 2 - 12 b - 14 9 Recurse - 17 c - 19 10 Ket - 22 18 KetRmax - 25 25 Ket - 28 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -No options -No first char -No need char - -/(a(b(?2)c)){0,2}/D ------------------------------------------------------------------- - 0 53 Bra 0 - 3 Brazero - 4 46 Bra 0 - 7 18 Bra 1 - 10 a - 12 10 Bra 2 - 15 b - 17 12 Recurse - 20 c - 22 10 Ket - 25 18 Ket - 28 Brazero - 29 18 Bra 1 - 32 a - 34 10 Bra 2 - 37 b - 39 12 Recurse - 42 c - 44 10 Ket - 47 18 Ket - 50 46 Ket - 53 53 Ket - 56 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -No options -No first char -No need char - -/[ab]{1}+/D ------------------------------------------------------------------- - 0 47 Bra 0 - 3 41 Once - 6 [ab]{1,1} - 44 41 Ket - 47 47 Ket - 50 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/i -Capturing subpattern count = 3 -Partial matching not supported -Options: caseless -No first char -Need char = 'g' (caseless) - Baby Bjorn Active Carrier - With free SHIPPING!! - 0: Baby Bjorn Active Carrier - With free SHIPPING!! - 1: Baby Bjorn Active Carrier - With free SHIPPING!! - -/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/iS -Capturing subpattern count = 3 -Partial matching not supported -Options: caseless -No first char -Need char = 'g' (caseless) -Study returned NULL - Baby Bjorn Active Carrier - With free SHIPPING!! - 0: Baby Bjorn Active Carrier - With free SHIPPING!! - 1: Baby Bjorn Active Carrier - With free SHIPPING!! - -/a*.*b/SD ------------------------------------------------------------------- - 0 9 Bra 0 - 3 a* - 5 Any* - 7 b - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'b' -Study returned NULL - -/(a|b)*.?c/SD ------------------------------------------------------------------- - 0 21 Bra 0 - 3 Brazero - 4 5 Bra 1 - 7 a - 9 5 Alt - 12 b - 14 10 KetRmax - 17 Any? - 19 c - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -No options -No first char -Need char = 'c' -Study returned NULL - -/abc(?C255)de(?C)f/D ------------------------------------------------------------------- - 0 27 Bra 0 - 3 abc - 9 Callout 255 10 1 - 15 de - 19 Callout 0 16 1 - 25 f - 27 27 Ket - 30 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'f' - -/abcde/CD ------------------------------------------------------------------- - 0 49 Bra 0 - 3 Callout 255 0 1 - 9 a - 11 Callout 255 1 1 - 17 b - 19 Callout 255 2 1 - 25 c - 27 Callout 255 3 1 - 33 d - 35 Callout 255 4 1 - 41 e - 43 Callout 255 5 0 - 49 49 Ket - 52 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: -First char = 'a' -Need char = 'e' - abcde ---->abcde - +0 ^ a - +1 ^^ b - +2 ^ ^ c - +3 ^ ^ d - +4 ^ ^ e - +5 ^ ^ - 0: abcde - abcdfe ---->abcdfe - +0 ^ a - +1 ^^ b - +2 ^ ^ c - +3 ^ ^ d - +4 ^ ^ e -No match - -/a*b/CD ------------------------------------------------------------------- - 0 25 Bra 0 - 3 Callout 255 0 2 - 9 a* - 11 Callout 255 2 1 - 17 b - 19 Callout 255 3 0 - 25 25 Ket - 28 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: -No first char -Need char = 'b' - ab ---->ab - +0 ^ a* - +2 ^^ b - +3 ^ ^ - 0: ab - aaaab ---->aaaab - +0 ^ a* - +2 ^ ^ b - +3 ^ ^ - 0: aaaab - aaaacb ---->aaaacb - +0 ^ a* - +2 ^ ^ b - +2 ^ ^ b - +2 ^ ^ b - +2 ^^ b - +2 ^ b - +0 ^ a* - +2 ^ ^ b - +2 ^ ^ b - +2 ^^ b - +2 ^ b - +0 ^ a* - +2 ^ ^ b - +2 ^^ b - +2 ^ b - +0 ^ a* - +2 ^^ b - +2 ^ b - +0 ^ a* - +2 ^ b - +0 ^ a* - +2 ^ b - +3 ^^ - 0: b - -/a+b/CD ------------------------------------------------------------------- - 0 25 Bra 0 - 3 Callout 255 0 2 - 9 a+ - 11 Callout 255 2 1 - 17 b - 19 Callout 255 3 0 - 25 25 Ket - 28 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: -First char = 'a' -Need char = 'b' - ab ---->ab - +0 ^ a+ - +2 ^^ b - +3 ^ ^ - 0: ab - aaaab ---->aaaab - +0 ^ a+ - +2 ^ ^ b - +3 ^ ^ - 0: aaaab - aaaacb ---->aaaacb - +0 ^ a+ - +2 ^ ^ b - +2 ^ ^ b - +2 ^ ^ b - +2 ^^ b - +0 ^ a+ - +2 ^ ^ b - +2 ^ ^ b - +2 ^^ b - +0 ^ a+ - +2 ^ ^ b - +2 ^^ b - +0 ^ a+ - +2 ^^ b -No match - -/(abc|def)x/CD ------------------------------------------------------------------- - 0 92 Bra 0 - 3 Callout 255 0 9 - 9 33 Bra 1 - 12 Callout 255 1 1 - 18 a - 20 Callout 255 2 1 - 26 b - 28 Callout 255 3 1 - 34 c - 36 Callout 255 4 0 - 42 33 Alt - 45 Callout 255 5 1 - 51 d - 53 Callout 255 6 1 - 59 e - 61 Callout 255 7 1 - 67 f - 69 Callout 255 8 0 - 75 66 Ket - 78 Callout 255 9 1 - 84 x - 86 Callout 255 10 0 - 92 92 Ket - 95 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: -No first char -Need char = 'x' - abcx ---->abcx - +0 ^ (abc|def) - +1 ^ a - +2 ^^ b - +3 ^ ^ c - +4 ^ ^ | - +9 ^ ^ x -+10 ^ ^ - 0: abcx - 1: abc - defx ---->defx - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +6 ^^ e - +7 ^ ^ f - +8 ^ ^ ) - +9 ^ ^ x -+10 ^ ^ - 0: defx - 1: def - abcdefzx ---->abcdefzx - +0 ^ (abc|def) - +1 ^ a - +2 ^^ b - +3 ^ ^ c - +4 ^ ^ | - +9 ^ ^ x - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +6 ^^ e - +7 ^ ^ f - +8 ^ ^ ) - +9 ^ ^ x - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d - +0 ^ (abc|def) - +1 ^ a - +5 ^ d -No match - -/(ab|cd){3,4}/C -Capturing subpattern count = 1 -Options: -No first char -No need char - ababab ---->ababab - +0 ^ (ab|cd){3,4} - +1 ^ a - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +2 ^ ^ b - +3 ^ ^ | - +1 ^ ^ a - +2 ^ ^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c -+12 ^ ^ - 0: ababab - 1: ab - abcdabcd ---->abcdabcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +2 ^ ^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdabcd - 1: cd - abcdcdcdcdcd ---->abcdcdcdcdcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdcdcd - 1: cd - -/([ab]{,4}c|xy)/CD ------------------------------------------------------------------- - 0 131 Bra 0 - 3 Callout 255 0 14 - 9 88 Bra 1 - 12 Callout 255 1 4 - 18 [ab] - 51 Callout 255 5 1 - 57 { - 59 Callout 255 6 1 - 65 , - 67 Callout 255 7 1 - 73 4 - 75 Callout 255 8 1 - 81 } - 83 Callout 255 9 1 - 89 c - 91 Callout 255 10 0 - 97 25 Alt -100 Callout 255 11 1 -106 x -108 Callout 255 12 1 -114 y -116 Callout 255 13 0 -122 113 Ket -125 Callout 255 14 0 -131 131 Ket -134 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: -No first char -No need char - Note: that { does NOT introduce a quantifier ---->Note: that { does NOT introduce a quantifier - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] - +5 ^^ { -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] - +5 ^^ { -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] - +5 ^^ { -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x - +0 ^ ([ab]{,4}c|xy) - +1 ^ [ab] -+11 ^ x -No match - -/([ab]{1,4}c|xy){4,5}?123/CD ------------------------------------------------------------------- - 0 485 Bra 0 - 3 Callout 255 0 21 - 9 61 Bra 1 - 12 Callout 255 1 9 - 18 [ab]{1,4} - 56 Callout 255 10 1 - 62 c - 64 Callout 255 11 0 - 70 25 Alt - 73 Callout 255 12 1 - 79 x - 81 Callout 255 13 1 - 87 y - 89 Callout 255 14 0 - 95 86 Ket - 98 61 Bra 1 -101 Callout 255 1 9 -107 [ab]{1,4} -145 Callout 255 10 1 -151 c -153 Callout 255 11 0 -159 25 Alt -162 Callout 255 12 1 -168 x -170 Callout 255 13 1 -176 y -178 Callout 255 14 0 -184 86 Ket -187 61 Bra 1 -190 Callout 255 1 9 -196 [ab]{1,4} -234 Callout 255 10 1 -240 c -242 Callout 255 11 0 -248 25 Alt -251 Callout 255 12 1 -257 x -259 Callout 255 13 1 -265 y -267 Callout 255 14 0 -273 86 Ket -276 61 Bra 1 -279 Callout 255 1 9 -285 [ab]{1,4} -323 Callout 255 10 1 -329 c -331 Callout 255 11 0 -337 25 Alt -340 Callout 255 12 1 -346 x -348 Callout 255 13 1 -354 y -356 Callout 255 14 0 -362 86 Ket -365 Braminzero -366 61 Bra 1 -369 Callout 255 1 9 -375 [ab]{1,4} -413 Callout 255 10 1 -419 c -421 Callout 255 11 0 -427 25 Alt -430 Callout 255 12 1 -436 x -438 Callout 255 13 1 -444 y -446 Callout 255 14 0 -452 86 Ket -455 Callout 255 21 1 -461 1 -463 Callout 255 22 1 -469 2 -471 Callout 255 23 1 -477 3 -479 Callout 255 24 0 -485 485 Ket -488 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: -No first char -Need char = '3' - aacaacaacaacaac123 ---->aacaacaacaacaac123 - +0 ^ ([ab]{1,4}c|xy){4,5}? - +1 ^ [ab]{1,4} -+10 ^ ^ c -+11 ^ ^ | - +1 ^ ^ [ab]{1,4} -+10 ^ ^ c -+11 ^ ^ | - +1 ^ ^ [ab]{1,4} -+10 ^ ^ c -+11 ^ ^ | - +1 ^ ^ [ab]{1,4} -+10 ^ ^ c -+11 ^ ^ | -+21 ^ ^ 1 - +1 ^ ^ [ab]{1,4} -+10 ^ ^ c -+11 ^ ^ | -+21 ^ ^ 1 -+22 ^ ^ 2 -+23 ^ ^ 3 -+24 ^ ^ - 0: aacaacaacaacaac123 - 1: aac - -/\b.*/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - ab cd\>1 - 0: cd - -/\b.*/Is -Capturing subpattern count = 0 -Partial matching not supported -Options: dotall -No first char -No need char - ab cd\>1 - 0: cd - -/(?!.bcd).*/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -No need char - Xbcd12345 - 0: bcd12345 - -/abcde/ -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'e' - ab\P -Partial match - abc\P -Partial match - abcd\P -Partial match - abcde\P - 0: abcde - the quick brown abc\P -Partial match - ** Failers\P -No match - the quick brown abxyz fox\P -No match - -"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$" -Capturing subpattern count = 3 -Options: anchored -No first char -Need char = '/' - 13/05/04\P - 0: 13/05/04 - 1: 13 - 2: 05 - 13/5/2004\P - 0: 13/5/2004 - 1: 13 - 2: 5 - 3: 20 - 02/05/09\P - 0: 02/05/09 - 1: 02 - 2: 05 - 1\P -Partial match - 1/2\P -Partial match - 1/2/0\P -Partial match - 1/2/04\P - 0: 1/2/04 - 1: 1 - 2: 2 - 0\P -Partial match - 02/\P -Partial match - 02/0\P -Partial match - 02/1\P -Partial match - ** Failers\P -No match - \P -No match - 123\P -No match - 33/4/04\P -No match - 3/13/04\P -No match - 0/1/2003\P -No match - 0/\P -No match - 02/0/\P -No match - 02/13\P -No match - -/0{0,2}ABC/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'C' - -/\d{3,}ABC/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'C' - -/\d*ABC/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'C' - -/[abc]+DE/I -Capturing subpattern count = 0 -Partial matching not supported -No options -No first char -Need char = 'E' - -/[abc]?123/ -Capturing subpattern count = 0 -No options -No first char -Need char = '3' - 123\P - 0: 123 - a\P -Partial match - b\P -Partial match - c\P -Partial match - c12\P -Partial match - c123\P - 0: c123 - -/^(?:\d){3,5}X/ -Capturing subpattern count = 0 -Options: anchored -No first char -Need char = 'X' - 1\P -Partial match - 123\P -Partial match - 123X - 0: 123X - 1234\P -Partial match - 1234X - 0: 1234X - 12345\P -Partial match - 12345X - 0: 12345X - *** Failers -No match - 1X -No match - 123456\P -No match - -/abc/>testsavedregex -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' -Compiled regex written to testsavedregex -<testsavedregex -Compiled regex loaded from testsavedregex -No study data -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - abc - 0: abc - ** Failers -No match - bca -No match - -/abc/F>testsavedregex -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' -Compiled regex written to testsavedregex -<testsavedregex -Compiled regex (byte-inverted) loaded from testsavedregex -No study data -Capturing subpattern count = 0 -No options -First char = 'a' -Need char = 'c' - abc - 0: abc - ** Failers -No match - bca -No match - -/(a|b)/S>testsavedregex -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: a b -Compiled regex written to testsavedregex -Study data written to testsavedregex -<testsavedregex -Compiled regex loaded from testsavedregex -Study data loaded from testsavedregex -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: a b - abc - 0: a - 1: a - ** Failers - 0: a - 1: a - def -No match - -/(a|b)/SF>testsavedregex -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: a b -Compiled regex written to testsavedregex -Study data written to testsavedregex -<testsavedregex -Compiled regex (byte-inverted) loaded from testsavedregex -Study data loaded from testsavedregex -Capturing subpattern count = 1 -No options -No first char -No need char -Starting byte set: a b - abc - 0: a - 1: a - ** Failers - 0: a - 1: a - def -No match - -~<(\w+)/?>(.)*</(\1)>~smg -Capturing subpattern count = 3 -Max back reference = 1 -Partial matching not supported -Options: multiline dotall -First char = '<' -Need char = '>' - <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite> - 0: <seite>\x0a<dokumenteninformation>\x0a<seitentitel>Partner der LCO</seitentitel>\x0a<sprache>de</sprache>\x0a<seitenbeschreibung>Partner der LINEAS Consulting\x0aGmbH</seitenbeschreibung>\x0a<schluesselworte>LINEAS Consulting GmbH Hamburg\x0aPartnerfirmen</schluesselworte>\x0a<revisit>30 days</revisit>\x0a<robots>index,follow</robots>\x0a<menueinformation>\x0a<aktiv>ja</aktiv>\x0a<menueposition>3</menueposition>\x0a<menuetext>Partner</menuetext>\x0a</menueinformation>\x0a<lastedited>\x0a<autor>LCO</autor>\x0a<firma>LINEAS Consulting</firma>\x0a<datum>15.10.2003</datum>\x0a</lastedited>\x0a</dokumenteninformation>\x0a<inhalt>\x0a\x0a<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\x0aGmbH</absatzueberschrift>\x0a\x0a<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\x0a<bild name="logo_ca.gif" rahmen="no"/></link> <link\x0aziel="http://www.ey.com/" zielfenster="_blank"><bild\x0aname="logo_euy.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\x0a<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.atelion.de/"\x0azielfenster="_blank"><bild\x0aname="logo_atelion.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.line-information.de/"\x0azielfenster="_blank">\x0a<bild name="logo_line_information.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\x0a\x0a<absatz><link ziel="http://www.incognis.de/"\x0azielfenster="_blank"><bild\x0aname="logo_incognis.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.addcraft.com/"\x0azielfenster="_blank"><bild\x0aname="logo_addcraft.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.comendo.com/"\x0azielfenster="_blank"><bild\x0aname="logo_comendo.gif" rahmen="no"/></link></absatz>\x0a\x0a</inhalt>\x0a</seite> - 1: seite - 2: \x0a - 3: seite - -/^a/IF -Capturing subpattern count = 0 -Options: anchored -No first char -No need char - -/line\nbreak/ -Capturing subpattern count = 0 -No options -First char = 'l' -Need char = 'k' - this is a line\nbreak - 0: line\x0abreak - line one\nthis is a line\nbreak in the second line - 0: line\x0abreak - -/line\nbreak/f -Capturing subpattern count = 0 -Options: firstline -First char = 'l' -Need char = 'k' - this is a line\nbreak - 0: line\x0abreak - ** Failers -No match - line one\nthis is a line\nbreak in the second line -No match - -/line\nbreak/mf -Capturing subpattern count = 0 -Options: multiline firstline -First char = 'l' -Need char = 'k' - this is a line\nbreak - 0: line\x0abreak - ** Failers -No match - line one\nthis is a line\nbreak in the second line -No match - -/ab.cd/P - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ** Failers -No match: POSIX code 17: match failed - ab\ncd -No match: POSIX code 17: match failed - -/ab.cd/Ps - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ab\ncd - 0: ab\x0acd - -/(?i)(?-i)AbCd/ -Capturing subpattern count = 0 -No options -First char = 'A' -Need char = 'd' - AbCd - 0: AbCd - ** Failers -No match - abcd -No match - -/a{11111111111111111111}/ -Failed: number too big in {} quantifier at offset 22 - -/(){64294967295}/ -Failed: number too big in {} quantifier at offset 14 - -/(){2,4294967295}/ -Failed: number too big in {} quantifier at offset 15 - -"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B" -Capturing subpattern count = 1 -Max back reference = 1 -No options -Case state changes -First char = 'a' (caseless) -Need char = 'B' - abcdefghijklAkB - 0: abcdefghijklAkB - 1: k - -"(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B" -Capturing subpattern count = 12 -Max back reference = 11 -Named capturing subpatterns: - n0 1 - n1 2 - n10 11 - n11 12 - n2 3 - n3 4 - n4 5 - n5 6 - n6 7 - n7 8 - n8 9 - n9 10 -No options -First char = 'a' -Need char = 'B' - abcdefghijklAkB - 0: abcdefghijklAkB - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: l - -"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B" -Capturing subpattern count = 12 -Max back reference = 11 -No options -First char = 'a' -Need char = 'B' - abcdefghijklAkB - 0: abcdefghijklAkB - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: l - -"(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)" -Capturing subpattern count = 101 -Named capturing subpatterns: - name0 1 - name1 2 - name10 11 - name100 101 - name11 12 - name12 13 - name13 14 - name14 15 - name15 16 - name16 17 - name17 18 - name18 19 - name19 20 - name2 3 - name20 21 - name21 22 - name22 23 - name23 24 - name24 25 - name25 26 - name26 27 - name27 28 - name28 29 - name29 30 - name3 4 - name30 31 - name31 32 - name32 33 - name33 34 - name34 35 - name35 36 - name36 37 - name37 38 - name38 39 - name39 40 - name4 5 - name40 41 - name41 42 - name42 43 - name43 44 - name44 45 - name45 46 - name46 47 - name47 48 - name48 49 - name49 50 - name5 6 - name50 51 - name51 52 - name52 53 - name53 54 - name54 55 - name55 56 - name56 57 - name57 58 - name58 59 - name59 60 - name6 7 - name60 61 - name61 62 - name62 63 - name63 64 - name64 65 - name65 66 - name66 67 - name67 68 - name68 69 - name69 70 - name7 8 - name70 71 - name71 72 - name72 73 - name73 74 - name74 75 - name75 76 - name76 77 - name77 78 - name78 79 - name79 80 - name8 9 - name80 81 - name81 82 - name82 83 - name83 84 - name84 85 - name85 86 - name86 87 - name87 88 - name88 89 - name89 90 - name9 10 - name90 91 - name91 92 - name92 93 - name93 94 - name94 95 - name95 96 - name96 97 - name97 98 - name98 99 - name99 100 -No options -First char = 'a' -Need char = 'a' - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many substrings - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a -10: a -11: a -12: a -13: a -14: a - -"(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)" -Capturing subpattern count = 101 -No options -First char = 'a' -Need char = 'a' - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many substrings - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a -10: a -11: a -12: a -13: a -14: a - -/ End of testinput2 / -Capturing subpattern count = 0 -No options -First char = ' ' -Need char = ' ' diff --git a/ext/pcre/pcrelib/testdata/testoutput3 b/ext/pcre/pcrelib/testdata/testoutput3 deleted file mode 100644 index 16ebc7125a374..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput3 +++ /dev/null @@ -1,115 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/^[\w]+/ - *** Failers -No match - École -No match - -/^[\w]+/Lfr_FR - École - 0: École - -/^[\w]+/ - *** Failers -No match - École -No match - -/^[\W]+/ - École - 0: \xc9 - -/^[\W]+/Lfr_FR - *** Failers - 0: *** - École -No match - -/[\b]/ - \b - 0: \x08 - *** Failers -No match - a -No match - -/[\b]/Lfr_FR - \b - 0: \x08 - *** Failers -No match - a -No match - -/^\w+/ - *** Failers -No match - École -No match - -/^\w+/Lfr_FR - École - 0: École - -/(.+)\b(.+)/ - École - 0: \xc9cole - 1: \xc9 - 2: cole - -/(.+)\b(.+)/Lfr_FR - *** Failers - 0: *** Failers - 1: *** - 2: Failers - École -No match - -/École/i - École - 0: \xc9cole - *** Failers -No match - école -No match - -/École/iLfr_FR - École - 0: École - école - 0: école - -/\w/IS -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P - Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z - -/\w/ISLfr_FR -Capturing subpattern count = 0 -No options -No first char -No need char -Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P - Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z - µ À Á Â Ä Ċ Ĉ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Ġ Ö Ĝ Ù Ú Û Ü Ŭ Ŝ ß à á â ä - ċ ĉ ç è é ê ë ì í î ï ñ ò ó ô ġ ö ĝ ù ú û ü ŭ ŝ ˙ - -/^[\xc8-\xc9]/iLfr_FR - École - 0: É - école - 0: é - -/^[\xc8-\xc9]/Lfr_FR - École - 0: É - *** Failers -No match - école -No match - -/ End of testinput3 / diff --git a/ext/pcre/pcrelib/testdata/testoutput4 b/ext/pcre/pcrelib/testdata/testoutput4 deleted file mode 100644 index 234fd1ae145e0..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput4 +++ /dev/null @@ -1,903 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/-- Do not use the \x{} construct except with patterns that have the --/ -/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ -No match -/-- that option is set. However, the latest Perls recognize them always. --/ -No match - -/a.b/8 - acb - 0: acb - a\x7fb - 0: a\x{7f}b - a\x{100}b - 0: a\x{100}b - *** Failers -No match - a\nb -No match - -/a(.{3})b/8 - a\x{4000}xyb - 0: a\x{4000}xyb - 1: \x{4000}xy - a\x{4000}\x7fyb - 0: a\x{4000}\x{7f}yb - 1: \x{4000}\x{7f}y - a\x{4000}\x{100}yb - 0: a\x{4000}\x{100}yb - 1: \x{4000}\x{100}y - *** Failers -No match - a\x{4000}b -No match - ac\ncb -No match - -/a(.*?)(.)/ - a\xc0\x88b - 0: a\xc0 - 1: - 2: \xc0 - -/a(.*?)(.)/8 - a\x{100}b - 0: a\x{100} - 1: - 2: \x{100} - -/a(.*)(.)/ - a\xc0\x88b - 0: a\xc0\x88b - 1: \xc0\x88 - 2: b - -/a(.*)(.)/8 - a\x{100}b - 0: a\x{100}b - 1: \x{100} - 2: b - -/a(.)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: \xc0 - 2: \x92 - -/a(.)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: \x{240} - 2: b - -/a(.?)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: \xc0 - 2: \x92 - -/a(.?)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: \x{240} - 2: b - -/a(.??)(.)/ - a\xc0\x92bcd - 0: a\xc0 - 1: - 2: \xc0 - -/a(.??)(.)/8 - a\x{240}bcd - 0: a\x{240} - 1: - 2: \x{240} - -/a(.{3})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - 1: \x{1234}xy - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - 1: \x{1234}\x{4321}y - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - 1: \x{1234}\x{4321}\x{3412} - *** Failers -No match - a\x{1234}b -No match - ac\ncb -No match - -/a(.{3,})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - 1: \x{1234}xy - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - 1: \x{1234}\x{4321}y - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - 1: \x{1234}\x{4321}\x{3412} - axxxxbcdefghijb - 0: axxxxbcdefghijb - 1: xxxxbcdefghij - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - 1: \x{1234}\x{4321}\x{3412}\x{3421} - *** Failers -No match - a\x{1234}b -No match - -/a(.{3,}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - 1: \x{1234}xy - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - 1: \x{1234}\x{4321}y - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - 1: \x{1234}\x{4321}\x{3412} - axxxxbcdefghijb - 0: axxxxb - 1: xxxx - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - 1: \x{1234}\x{4321}\x{3412}\x{3421} - *** Failers -No match - a\x{1234}b -No match - -/a(.{3,5})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - 1: \x{1234}xy - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - 1: \x{1234}\x{4321}y - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - 1: \x{1234}\x{4321}\x{3412} - axxxxbcdefghijb - 0: axxxxb - 1: xxxx - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - 1: \x{1234}\x{4321}\x{3412}\x{3421} - axbxxbcdefghijb - 0: axbxxb - 1: xbxx - axxxxxbcdefghijb - 0: axxxxxb - 1: xxxxx - *** Failers -No match - a\x{1234}b -No match - axxxxxxbcdefghijb -No match - -/a(.{3,5}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - 1: \x{1234}xy - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - 1: \x{1234}\x{4321}y - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - 1: \x{1234}\x{4321}\x{3412} - axxxxbcdefghijb - 0: axxxxb - 1: xxxx - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - 1: \x{1234}\x{4321}\x{3412}\x{3421} - axbxxbcdefghijb - 0: axbxxb - 1: xbxx - axxxxxbcdefghijb - 0: axxxxxb - 1: xxxxx - *** Failers -No match - a\x{1234}b -No match - axxxxxxbcdefghijb -No match - -/^[a\x{c0}]/8 - *** Failers -No match - \x{100} -No match - -/(?<=aXb)cd/8 - aXbcd - 0: cd - -/(?<=a\x{100}b)cd/8 - a\x{100}bcd - 0: cd - -/(?<=a\x{100000}b)cd/8 - a\x{100000}bcd - 0: cd - -/(?:\x{100}){3}b/8 - \x{100}\x{100}\x{100}b - 0: \x{100}\x{100}\x{100}b - *** Failers -No match - \x{100}\x{100}b -No match - -/\x{ab}/8 - \x{ab} - 0: \x{ab} - \xc2\xab - 0: \x{ab} - *** Failers -No match - \x00{ab} -No match - -/(?<=(.))X/8 - WXYZ - 0: X - 1: W - \x{256}XYZ - 0: X - 1: \x{256} - *** Failers -No match - XYZ -No match - -/X(\C{3})/8 - X\x{1234} - 0: X\x{1234} - 1: \x{1234} - -/X(\C{4})/8 - X\x{1234}YZ - 0: X\x{1234}Y - 1: \x{1234}Y - -/X\C*/8 - XYZabcdce - 0: XYZabcdce - -/X\C*?/8 - XYZabcde - 0: X - -/X\C{3,5}/8 - Xabcdefg - 0: Xabcde - X\x{1234} - 0: X\x{1234} - X\x{1234}YZ - 0: X\x{1234}YZ - X\x{1234}\x{512} - 0: X\x{1234}\x{512} - X\x{1234}\x{512}YZ - 0: X\x{1234}\x{512} - -/X\C{3,5}?/8 - Xabcdefg - 0: Xabc - X\x{1234} - 0: X\x{1234} - X\x{1234}YZ - 0: X\x{1234} - X\x{1234}\x{512} - 0: X\x{1234} - -/[^a]+/8g - bcd - 0: bcd - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - -/^[^a]{2}/8 - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8 - \x{100}bcAa - 0: \x{100}bcA - -/^[^a]{2,}?/8 - \x{100}bca - 0: \x{100}b - -/[^a]+/8ig - bcd - 0: bcd - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - -/^[^a]{2}/8i - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8i - \x{100}bcAa - 0: \x{100}bc - -/^[^a]{2,}?/8i - \x{100}bca - 0: \x{100}b - -/\x{100}{0,0}/8 - abcd - 0: - -/\x{100}?/8 - abcd - 0: - \x{100}\x{100} - 0: \x{100} - -/\x{100}{0,3}/8 - \x{100}\x{100} - 0: \x{100}\x{100} - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - -/\x{100}*/8 - abce - 0: - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - -/\x{100}{1,1}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100} - -/\x{100}{1,3}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - -/\x{100}+/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - -/\x{100}{3}/8 - abcd\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100} - -/\x{100}{3,5}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100} - -/\x{100}{3,}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/(?<=a\x{100}{2}b)X/8+ - Xyyya\x{100}\x{100}bXzzz - 0: X - 0+ zzz - -/\D*/8 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\D*/8 - \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/\D/8 - 1X2 - 0: X - 1\x{100}2 - 0: \x{100} - -/>\S/8 - > >X Y - 0: >X - > >\x{100} Y - 0: >\x{100} - -/\d/8 - \x{100}3 - 0: 3 - -/\s/8 - \x{100} X - 0: - -/\D+/8 - 12abcd34 - 0: abcd - *** Failers - 0: *** Failers - 1234 -No match - -/\D{2,3}/8 - 12abcd34 - 0: abc - 12ab34 - 0: ab - *** Failers - 0: *** - 1234 -No match - 12a34 -No match - -/\D{2,3}?/8 - 12abcd34 - 0: ab - 12ab34 - 0: ab - *** Failers - 0: ** - 1234 -No match - 12a34 -No match - -/\d+/8 - 12abcd34 - 0: 12 - *** Failers -No match - -/\d{2,3}/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 123 - *** Failers -No match - 1.4 -No match - -/\d{2,3}?/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 12 - *** Failers -No match - 1.4 -No match - -/\S+/8 - 12abcd34 - 0: 12abcd34 - *** Failers - 0: *** - \ \ -No match - -/\S{2,3}/8 - 12abcd34 - 0: 12a - 1234abcd - 0: 123 - *** Failers - 0: *** - \ \ -No match - -/\S{2,3}?/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 12 - *** Failers - 0: ** - \ \ -No match - -/>\s+</8+ - 12> <34 - 0: > < - 0+ 34 - *** Failers -No match - -/>\s{2,3}</8+ - ab> <cd - 0: > < - 0+ cd - ab> <ce - 0: > < - 0+ ce - *** Failers -No match - ab> <cd -No match - -/>\s{2,3}?</8+ - ab> <cd - 0: > < - 0+ cd - ab> <ce - 0: > < - 0+ ce - *** Failers -No match - ab> <cd -No match - -/\w+/8 - 12 34 - 0: 12 - *** Failers - 0: Failers - +++=*! -No match - -/\w{2,3}/8 - ab cd - 0: ab - abcd ce - 0: abc - *** Failers - 0: Fai - a.b.c -No match - -/\w{2,3}?/8 - ab cd - 0: ab - abcd ce - 0: ab - *** Failers - 0: Fa - a.b.c -No match - -/\W+/8 - 12====34 - 0: ==== - *** Failers - 0: *** - abcd -No match - -/\W{2,3}/8 - ab====cd - 0: === - ab==cd - 0: == - *** Failers - 0: *** - a.b.c -No match - -/\W{2,3}?/8 - ab====cd - 0: == - ab==cd - 0: == - *** Failers - 0: ** - a.b.c -No match - -/[\x{100}]/8 - \x{100} - 0: \x{100} - Z\x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[Z\x{100}]/8 - Z\x{100} - 0: Z - \x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[\x{100}\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - *** Failers -No match - -/[\x{100}-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - *** Failers -No match - -/[z-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - abzcd - 0: z - ab|cd - 0: | - *** Failers -No match - -/[Q\x{100}\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - Q? - 0: Q - *** Failers -No match - -/[Q\x{100}-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - Q? - 0: Q - *** Failers -No match - -/[Qz-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - abzcd - 0: z - ab|cd - 0: | - Q? - 0: Q - *** Failers -No match - -/[\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - *** Failers -No match - -/[\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200} - *** Failers -No match - -/[Q\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - *** Failers -No match - -/[Q\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200} - *** Failers -No match - -/(?<=[\x{100}\x{200}])X/8 - abc\x{200}X - 0: X - abc\x{100}X - 0: X - *** Failers -No match - X -No match - -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - 0: X - abc\x{100}X - 0: X - abQX - 0: X - *** Failers -No match - X -No match - -/(?<=[\x{100}\x{200}]{3})X/8 - abc\x{100}\x{200}\x{100}X - 0: X - *** Failers -No match - abc\x{200}X -No match - X -No match - -/[^\x{100}\x{200}]X/8 - AX - 0: AX - \x{150}X - 0: \x{150}X - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{200}X -No match - -/[^Q\x{100}\x{200}]X/8 - AX - 0: AX - \x{150}X - 0: \x{150}X - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{200}X -No match - QX -No match - -/[^\x{100}-\x{200}]X/8 - AX - 0: AX - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{150}X -No match - \x{200}X -No match - -/a\Cb/ - aXb - 0: aXb - a\nb - 0: a\x0ab - -/a\Cb/8 - aXb - 0: aXb - a\nb - 0: a\x{0a}b - *** Failers -No match - a\x{100}b -No match - -/[z-\x{100}]/8i - z - 0: z - Z - 0: Z - \x{100} - 0: \x{100} - *** Failers -No match - \x{102} -No match - y -No match - -/[\xFF]/ - >\xff< - 0: \xff - -/[\xff]/8 - >\x{ff}< - 0: \x{ff} - -/[^\xFF]/ - XYZ - 0: X - -/[^\xff]/8 - XYZ - 0: X - \x{123} - 0: \x{123} - -/^[ac]*b/8 - xb -No match - -/^[ac\x{100}]*b/8 - xb -No match - -/^[^x]*b/8i - xb -No match - -/^[^x]*b/8 - xb -No match - -/^\d*b/8 - xb -No match - -/(|a)/g8 - catac - 0: - 1: - 0: - 1: - 0: a - 1: a - 0: - 1: - 0: - 1: - 0: a - 1: a - 0: - 1: - 0: - 1: - a\x{256}a - 0: - 1: - 0: a - 1: a - 0: - 1: - 0: - 1: - 0: a - 1: a - 0: - 1: - -/^\x{85}$/8i - \x{85} - 0: \x{85} - -/ End of testinput4 / diff --git a/ext/pcre/pcrelib/testdata/testoutput5 b/ext/pcre/pcrelib/testdata/testoutput5 deleted file mode 100644 index 6e0d418020508..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput5 +++ /dev/null @@ -1,1075 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/\x{100}/8DM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{100} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 - -/\x{1000}/8DM -Memory allocation (code space): 11 ------------------------------------------------------------------- - 0 7 Bra 0 - 3 \x{1000} - 7 7 Ket - 10 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 225 -Need char = 128 - -/\x{10000}/8DM -Memory allocation (code space): 12 ------------------------------------------------------------------- - 0 8 Bra 0 - 3 \x{10000} - 8 8 Ket - 11 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 240 -Need char = 128 - -/\x{100000}/8DM -Memory allocation (code space): 12 ------------------------------------------------------------------- - 0 8 Bra 0 - 3 \x{100000} - 8 8 Ket - 11 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 244 -Need char = 128 - -/\x{1000000}/8DM -Memory allocation (code space): 13 ------------------------------------------------------------------- - 0 9 Bra 0 - 3 \x{1000000} - 9 9 Ket - 12 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 249 -Need char = 128 - -/\x{4000000}/8DM -Memory allocation (code space): 14 ------------------------------------------------------------------- - 0 10 Bra 0 - 3 \x{4000000} - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 252 -Need char = 128 - -/\x{7fffFFFF}/8DM -Memory allocation (code space): 14 ------------------------------------------------------------------- - 0 10 Bra 0 - 3 \x{7fffffff} - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 253 -Need char = 191 - -/[\x{ff}]/8DM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{ff} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - -/[\x{100}]/8DM -Memory allocation (code space): 47 ------------------------------------------------------------------- - 0 11 Bra 0 - 3 [\x{100}] - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/\x{ffffffff}/8 -Failed: character value in \x{...} sequence is too large at offset 11 - -/\x{100000000}/8 -Failed: character value in \x{...} sequence is too large at offset 12 - -/^\x{100}a\x{1234}/8 - \x{100}a\x{1234}bcd - 0: \x{100}a\x{1234} - -/\x80/8D ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{80} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 128 - -/\xff/8D ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{ff} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - -/\x{0041}\x{2262}\x{0391}\x{002e}/D8 ------------------------------------------------------------------- - 0 14 Bra 0 - 3 A\x{2262}\x{391}. - 14 14 Ket - 17 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = '.' - \x{0041}\x{2262}\x{0391}\x{002e} - 0: A\x{2262}\x{391}. - -/\x{D55c}\x{ad6d}\x{C5B4}/D8 ------------------------------------------------------------------- - 0 15 Bra 0 - 3 \x{d55c}\x{ad6d}\x{c5b4} - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 237 -Need char = 180 - \x{D55c}\x{ad6d}\x{C5B4} - 0: \x{d55c}\x{ad6d}\x{c5b4} - -/\x{65e5}\x{672c}\x{8a9e}/D8 ------------------------------------------------------------------- - 0 15 Bra 0 - 3 \x{65e5}\x{672c}\x{8a9e} - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 230 -Need char = 158 - \x{65e5}\x{672c}\x{8a9e} - 0: \x{65e5}\x{672c}\x{8a9e} - -/\x{80}/D8 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{80} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 128 - -/\x{084}/D8 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{84} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 132 - -/\x{104}/D8 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{104} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 132 - -/\x{861}/D8 ------------------------------------------------------------------- - 0 7 Bra 0 - 3 \x{861} - 7 7 Ket - 10 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 224 -Need char = 161 - -/\x{212ab}/D8 ------------------------------------------------------------------- - 0 8 Bra 0 - 3 \x{212ab} - 8 8 Ket - 11 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 240 -Need char = 171 - -/.{3,5}X/D8 ------------------------------------------------------------------- - 0 13 Bra 0 - 3 Any{3} - 7 Any{0,2} - 11 X - 13 13 Ket - 16 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -Need char = 'X' - \x{212ab}\x{212ab}\x{212ab}\x{861}X - 0: \x{212ab}\x{212ab}\x{212ab}\x{861}X - - -/.{3,5}?/D8 ------------------------------------------------------------------- - 0 11 Bra 0 - 3 Any{3} - 7 Any{0,2}? - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -No need char - \x{212ab}\x{212ab}\x{212ab}\x{861} - 0: \x{212ab}\x{212ab}\x{212ab} - -/-- These tests are here rather than in testinput4 because Perl 5.6 has --/ -/-- some problems with UTF-8 support, in the area of \x{..} where the --/ -No match -/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ -No match - -/^[a\x{c0}]b/8 - \x{c0}b - 0: \x{c0}b - -/^([a\x{c0}]*?)aa/8 - a\x{c0}aaaa/ - 0: a\x{c0}aa - 1: a\x{c0} - -/^([a\x{c0}]*?)aa/8 - a\x{c0}aaaa/ - 0: a\x{c0}aa - 1: a\x{c0} - a\x{c0}a\x{c0}aaa/ - 0: a\x{c0}a\x{c0}aa - 1: a\x{c0}a\x{c0} - -/^([a\x{c0}]*)aa/8 - a\x{c0}aaaa/ - 0: a\x{c0}aaaa - 1: a\x{c0}aa - a\x{c0}a\x{c0}aaa/ - 0: a\x{c0}a\x{c0}aaa - 1: a\x{c0}a\x{c0}a - -/^([a\x{c0}]*)a\x{c0}/8 - a\x{c0}aaaa/ - 0: a\x{c0} - 1: - a\x{c0}a\x{c0}aaa/ - 0: a\x{c0}a\x{c0} - 1: a\x{c0} - -/-- --/ - -/(?<=\C)X/8 -Failed: \C not allowed in lookbehind assertion at offset 6 - -/-- This one is here not because it's different to Perl, but because the --/ -/-- way the captured single-byte is displayed. (In Perl it becomes a --/ -No match -/-- character, and you can't tell the difference.) --/ -No match - -/X(\C)(.*)/8 - X\x{1234} - 0: X\x{1234} - 1: \xe1 - 2: \x88\xb4 - X\nabc - 0: X\x{0a}abc - 1: \x{0a} - 2: abc - -/^[ab]/8D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [ab] - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored utf8 -No first char -No need char - bar - 0: b - *** Failers -No match - c -No match - \x{ff} -No match - \x{100} -No match - -/^[^ab]/8D ------------------------------------------------------------------- - 0 37 Bra 0 - 3 ^ - 4 [\x00-`c-\xff] (neg) - 37 37 Ket - 40 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: anchored utf8 -No first char -No need char - c - 0: c - \x{ff} - 0: \x{ff} - \x{100} - 0: \x{100} - *** Failers - 0: * - aaa -No match - -/[^ab\xC0-\xF0]/8SD ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x00-`c-\xbf\xf1-\xff] (neg) - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char -Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a - \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 - \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 - 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y - Z [ \ ] ^ _ ` c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f - \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 - \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf - \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee - \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd - \xfe \xff - \x{f1} - 0: \x{f1} - \x{bf} - 0: \x{bf} - \x{100} - 0: \x{100} - \x{1000} - 0: \x{1000} - *** Failers - 0: * - \x{c0} -No match - \x{f0} -No match - -/Ā{3,4}/8SD ------------------------------------------------------------------- - 0 13 Bra 0 - 3 \x{100}{3} - 8 \x{100}{,1} - 13 13 Ket - 16 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -First char = 196 -Need char = 128 -Study returned NULL - \x{100}\x{100}\x{100}\x{100\x{100} - 0: \x{100}\x{100}\x{100} - -/(\x{100}+|x)/8SD ------------------------------------------------------------------- - 0 17 Bra 0 - 3 6 Bra 1 - 6 \x{100}+ - 9 5 Alt - 12 x - 14 11 Ket - 17 17 Ket - 20 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: utf8 -No first char -No need char -Starting byte set: x \xc4 - -/(\x{100}*a|x)/8SD ------------------------------------------------------------------- - 0 19 Bra 0 - 3 8 Bra 1 - 6 \x{100}* - 9 a - 11 5 Alt - 14 x - 16 13 Ket - 19 19 Ket - 22 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: utf8 -No first char -No need char -Starting byte set: a x \xc4 - -/(\x{100}{0,2}a|x)/8SD ------------------------------------------------------------------- - 0 21 Bra 0 - 3 10 Bra 1 - 6 \x{100}{,2} - 11 a - 13 5 Alt - 16 x - 18 15 Ket - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: utf8 -No first char -No need char -Starting byte set: a x \xc4 - -/(\x{100}{1,2}a|x)/8SD ------------------------------------------------------------------- - 0 24 Bra 0 - 3 13 Bra 1 - 6 \x{100} - 9 \x{100}{,1} - 14 a - 16 5 Alt - 19 x - 21 18 Ket - 24 24 Ket - 27 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Partial matching not supported -Options: utf8 -No first char -No need char -Starting byte set: x \xc4 - -/\x{100}*(\d+|"(?1)")/8 - 1234 - 0: 1234 - 1: 1234 - "1234" - 0: "1234" - 1: "1234" - \x{100}1234 - 0: \x{100}1234 - 1: 1234 - "\x{100}1234" - 0: \x{100}1234 - 1: 1234 - \x{100}\x{100}12ab - 0: \x{100}\x{100}12 - 1: 12 - \x{100}\x{100}"12" - 0: \x{100}\x{100}"12" - 1: "12" - *** Failers -No match - \x{100}\x{100}abcd -No match - -/\x{100}/8D ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{100} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 - -/\x{100}*/8D ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{100}* - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -No need char - -/a\x{100}*/8D ------------------------------------------------------------------- - 0 8 Bra 0 - 3 a - 5 \x{100}* - 8 8 Ket - 11 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -First char = 'a' -No need char - -/ab\x{100}*/8D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 ab - 7 \x{100}* - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -First char = 'a' -Need char = 'b' - -/a\x{100}\x{101}*/8D ------------------------------------------------------------------- - 0 11 Bra 0 - 3 a\x{100} - 8 \x{101}* - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -First char = 'a' -Need char = 128 - -/a\x{100}\x{101}+/8D ------------------------------------------------------------------- - 0 11 Bra 0 - 3 a\x{100} - 8 \x{101}+ - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -First char = 'a' -Need char = 129 - -/\x{100}*A/8D ------------------------------------------------------------------- - 0 8 Bra 0 - 3 \x{100}* - 6 A - 8 8 Ket - 11 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -Need char = 'A' - A - 0: A - -/\x{100}*\d(?R)/8D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 \x{100}* - 6 \d - 7 0 Recurse - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -No need char - -/[^\x{c4}]/D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x01-35-bd-z|~-\xff] (neg) - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[^\x{c4}]/8D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x00-\xc3\xc5-\xff] (neg) - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[\x{100}]/8DM -Memory allocation (code space): 47 ------------------------------------------------------------------- - 0 11 Bra 0 - 3 [\x{100}] - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - \x{100} - 0: \x{100} - Z\x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[Z\x{100}]/8DM -Memory allocation (code space): 47 ------------------------------------------------------------------- - 0 43 Bra 0 - 3 [Z\x{100}] - 43 43 Ket - 46 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - Z\x{100} - 0: Z - \x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[\x{200}-\x{100}]/8 -Failed: range out of order in character class at offset 15 - -/[Ā-Ą]/8 - \x{100} - 0: \x{100} - \x{104} - 0: \x{104} - *** Failers -No match - \x{105} -No match - \x{ff} -No match - -/[z-\x{100}]/8D ------------------------------------------------------------------- - 0 12 Bra 0 - 3 [z-\x{100}] - 12 12 Ket - 15 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[z\Qa-d]Ā\E]/8D ------------------------------------------------------------------- - 0 43 Bra 0 - 3 [\-\]adz\x{100}] - 43 43 Ket - 46 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - \x{100} - 0: \x{100} - Ā - 0: \x{100} - -/[\xFF]/D ------------------------------------------------------------------- - 0 5 Bra 0 - 3 \xff - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -First char = 255 -No need char - >\xff< - 0: \xff - -/[\xff]/D8 ------------------------------------------------------------------- - 0 6 Bra 0 - 3 \x{ff} - 6 6 Ket - 9 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - >\x{ff}< - 0: \x{ff} - -/[^\xFF]/D ------------------------------------------------------------------- - 0 5 Bra 0 - 3 [^\xff] - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[^\xff]/8D ------------------------------------------------------------------- - 0 36 Bra 0 - 3 [\x00-\xfe] (neg) - 36 36 Ket - 39 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[„-œ]/8 - – # Matches without Study - 0: \x{d6} - \x{d6} - 0: \x{d6} - -/[„-œ]/8S - – <-- Same with Study - 0: \x{d6} - \x{d6} - 0: \x{d6} - -/[\x{c4}-\x{dc}]/8 - – # Matches without Study - 0: \x{d6} - \x{d6} - 0: \x{d6} - -/[\x{c4}-\x{dc}]/8S - – <-- Same with Study - 0: \x{d6} - \x{d6} - 0: \x{d6} - -/[]/8 -Failed: invalid UTF-8 string at offset 2 - -//8 -Failed: invalid UTF-8 string at offset 0 - -/xxx/8 -Failed: invalid UTF-8 string at offset 1 - -/xxx/8?D ------------------------------------------------------------------- - 0 15 Bra 0 - 3 \X{c0}\X{c0}\X{c0}xxx - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 no_utf8_check -First char = 195 -Need char = 'x' - -/abc/8 - ] -Error -10 - -Error -10 - -Error -10 - \? -No match - -/anything/8 - \xc0\x80 -Error -10 - \xc1\x8f -Error -10 - \xe0\x9f\x80 -Error -10 - \xf0\x8f\x80\x80 -Error -10 - \xf8\x87\x80\x80\x80 -Error -10 - \xfc\x83\x80\x80\x80\x80 -Error -10 - \xfe\x80\x80\x80\x80\x80 -Error -10 - \xff\x80\x80\x80\x80\x80 -Error -10 - \xc3\x8f -No match - \xe0\xaf\x80 -No match - \xe1\x80\x80 -No match - \xf0\x9f\x80\x80 -No match - \xf1\x8f\x80\x80 -No match - \xf8\x88\x80\x80\x80 -No match - \xf9\x87\x80\x80\x80 -No match - \xfc\x84\x80\x80\x80\x80 -No match - \xfd\x83\x80\x80\x80\x80 -No match - -/\x{100}abc(xyz(?1))/8D ------------------------------------------------------------------- - 0 27 Bra 0 - 3 \x{100}abc - 12 12 Bra 1 - 15 xyz - 21 12 Recurse - 24 12 Ket - 27 27 Ket - 30 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -First char = 196 -Need char = 'z' - -/[^\x{100}]abc(xyz(?1))/8D ------------------------------------------------------------------- - 0 32 Bra 0 - 3 [^\x{100}] - 11 abc - 17 12 Bra 1 - 20 xyz - 26 17 Recurse - 29 12 Ket - 32 32 Ket - 35 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -Need char = 'z' - -/[ab\x{100}]abc(xyz(?1))/8D ------------------------------------------------------------------- - 0 64 Bra 0 - 3 [ab\x{100}] - 43 abc - 49 12 Bra 1 - 52 xyz - 58 49 Recurse - 61 12 Ket - 64 64 Ket - 67 End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -Need char = 'z' - -/(\x{100}(b(?2)c))?/D8 ------------------------------------------------------------------- - 0 26 Bra 0 - 3 Brazero - 4 19 Bra 1 - 7 \x{100} - 10 10 Bra 2 - 13 b - 15 10 Recurse - 18 c - 20 10 Ket - 23 19 Ket - 26 26 Ket - 29 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Options: utf8 -No first char -No need char - -/(\x{100}(b(?2)c)){0,2}/D8 ------------------------------------------------------------------- - 0 55 Bra 0 - 3 Brazero - 4 48 Bra 0 - 7 19 Bra 1 - 10 \x{100} - 13 10 Bra 2 - 16 b - 18 13 Recurse - 21 c - 23 10 Ket - 26 19 Ket - 29 Brazero - 30 19 Bra 1 - 33 \x{100} - 36 10 Bra 2 - 39 b - 41 13 Recurse - 44 c - 46 10 Ket - 49 19 Ket - 52 48 Ket - 55 55 Ket - 58 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Options: utf8 -No first char -No need char - -/(\x{100}(b(?1)c))?/D8 ------------------------------------------------------------------- - 0 26 Bra 0 - 3 Brazero - 4 19 Bra 1 - 7 \x{100} - 10 10 Bra 2 - 13 b - 15 4 Recurse - 18 c - 20 10 Ket - 23 19 Ket - 26 26 Ket - 29 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Options: utf8 -No first char -No need char - -/(\x{100}(b(?1)c)){0,2}/D8 ------------------------------------------------------------------- - 0 55 Bra 0 - 3 Brazero - 4 48 Bra 0 - 7 19 Bra 1 - 10 \x{100} - 13 10 Bra 2 - 16 b - 18 7 Recurse - 21 c - 23 10 Ket - 26 19 Ket - 29 Brazero - 30 19 Bra 1 - 33 \x{100} - 36 10 Bra 2 - 39 b - 41 7 Recurse - 44 c - 46 10 Ket - 49 19 Ket - 52 48 Ket - 55 55 Ket - 58 End ------------------------------------------------------------------- -Capturing subpattern count = 2 -Options: utf8 -No first char -No need char - -/\W/8 - A.B - 0: . - A\x{100}B - 0: \x{100} - -/\w/8 - \x{100}X - 0: X - -/ End of testinput5 / diff --git a/ext/pcre/pcrelib/testdata/testoutput6 b/ext/pcre/pcrelib/testdata/testoutput6 deleted file mode 100644 index 9f9421e51937b..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput6 +++ /dev/null @@ -1,1013 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/^\pC\pL\pM\pN\pP\pS\pZ</8 - \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - 0: \x{7f}\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - \np\x{300}9!\$ < - 0: \x{0a}p\x{300}9!$ < - ** Failers -No match - ap\x{300}9!\$ < -No match - -/^\PC/8 - X - 0: X - ** Failers - 0: * - \x7f -No match - -/^\PL/8 - 9 - 0: 9 - ** Failers - 0: * - \x{c0} -No match - -/^\PM/8 - X - 0: X - ** Failers - 0: * - \x{30f} -No match - -/^\PN/8 - X - 0: X - ** Failers - 0: * - \x{660} -No match - -/^\PP/8 - X - 0: X - ** Failers -No match - \x{66c} -No match - -/^\PS/8 - X - 0: X - ** Failers - 0: * - \x{f01} -No match - -/^\PZ/8 - X - 0: X - ** Failers - 0: * - \x{1680} -No match - -/^\p{Cc}/8 - \x{017} - 0: \x{17} - \x{09f} - 0: \x{9f} - ** Failers -No match - \x{0600} -No match - -/^\p{Cf}/8 - \x{601} - 0: \x{601} - ** Failers -No match - \x{09f} -No match - -/^\p{Cn}/8 - ** Failers -No match - \x{09f} -No match - -/^\p{Co}/8 - \x{f8ff} - 0: \x{f8ff} - ** Failers -No match - \x{09f} -No match - -/^\p{Cs}/8 - \x{dfff} - 0: \x{dfff} - ** Failers -No match - \x{09f} -No match - -/^\p{Ll}/8 - a - 0: a - ** Failers -No match - Z -No match - \x{dfff} -No match - -/^\p{Lm}/8 - \x{2b0} - 0: \x{2b0} - ** Failers -No match - a -No match - -/^\p{Lo}/8 - \x{1bb} - 0: \x{1bb} - ** Failers -No match - a -No match - \x{2b0} -No match - -/^\p{Lt}/8 - \x{1c5} - 0: \x{1c5} - ** Failers -No match - a -No match - \x{2b0} -No match - -/^\p{Lu}/8 - A - 0: A - ** Failers -No match - \x{2b0} -No match - -/^\p{Mc}/8 - \x{903} - 0: \x{903} - ** Failers -No match - X -No match - \x{300} -No match - -/^\p{Me}/8 - \x{488} - 0: \x{488} - ** Failers -No match - X -No match - \x{903} -No match - \x{300} -No match - -/^\p{Mn}/8 - \x{300} - 0: \x{300} - ** Failers -No match - X -No match - \x{903} -No match - -/^\p{Nd}+/8 - 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a} - 0: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669} - \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa} - 0: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9} - \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970} - 0: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f} - ** Failers -No match - X -No match - -/^\p{Nl}/8 - \x{16ee} - 0: \x{16ee} - ** Failers -No match - X -No match - \x{966} -No match - -/^\p{No}/8 - \x{b2} - 0: \x{b2} - \x{b3} - 0: \x{b3} - ** Failers -No match - X -No match - \x{16ee} -No match - -/^\p{Pc}/8 - \x5f - 0: _ - \x{203f} - 0: \x{203f} - ** Failers -No match - X -No match - - -No match - \x{58a} -No match - -/^\p{Pd}/8 - - - 0: - - \x{58a} - 0: \x{58a} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Pe}/8 - ) - 0: ) - ] - 0: ] - } - 0: } - \x{f3b} - 0: \x{f3b} - ** Failers -No match - X -No match - \x{203f} -No match - ( -No match - [ -No match - { -No match - \x{f3c} -No match - -/^\p{Pf}/8 - \x{bb} - 0: \x{bb} - \x{2019} - 0: \x{2019} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Pi}/8 - \x{ab} - 0: \x{ab} - \x{2018} - 0: \x{2018} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Po}/8 - ! - 0: ! - \x{37e} - 0: \x{37e} - ** Failers - 0: * - X -No match - \x{203f} -No match - -/^\p{Ps}/8 - ( - 0: ( - [ - 0: [ - { - 0: { - \x{f3c} - 0: \x{f3c} - ** Failers -No match - X -No match - ) -No match - ] -No match - } -No match - \x{f3b} -No match - -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - 0: $\x{a2}\x{a3}\x{a4}\x{a5} - \x{9f2} - 0: \x{9f2} - ** Failers -No match - X -No match - \x{2c2} -No match - -/^\p{Sk}/8 - \x{2c2} - 0: \x{2c2} - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{Sm}+/8 - +<|~\x{ac}\x{2044} - 0: +<|~\x{ac}\x{2044} - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{So}/8 - \x{a6} - 0: \x{a6} - \x{482} - 0: \x{482} - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{Zl}/8 - \x{2028} - 0: \x{2028} - ** Failers -No match - X -No match - \x{2029} -No match - -/^\p{Zp}/8 - \x{2029} - 0: \x{2029} - ** Failers -No match - X -No match - \x{2028} -No match - -/^\p{Zs}/8 - \ \ - 0: - \x{a0} - 0: \x{a0} - \x{1680} - 0: \x{1680} - \x{180e} - 0: \x{180e} - \x{2000} - 0: \x{2000} - \x{2001} - 0: \x{2001} - ** Failers -No match - \x{2028} -No match - \x{200d} -No match - -/\p{Nd}+(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: AB - -/\p{Nd}+?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662} - 1: \x{661}\x{662} - -/\p{Nd}{2,}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: AB - -/\p{Nd}{2,}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}A - 1: \x{662}A - -/\p{Nd}*(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: AB - -/\p{Nd}*?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661} - 1: \x{660}\x{661} - -/\p{Nd}{2}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}A - 1: \x{662}A - -/\p{Nd}{2,3}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: AB - -/\p{Nd}{2,3}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}A - 1: \x{662}A - -/\p{Nd}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662} - 1: \x{661}\x{662} - -/\p{Nd}??(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661} - 1: \x{660}\x{661} - -/\p{Nd}*+(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: AB - -/\p{Nd}*+(...)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}ABC - 1: ABC - -/\p{Nd}*+(....)/8 - ** Failers - 0: ** F - 1: ** F - \x{660}\x{661}\x{662}ABC -No match - -/\p{Lu}/8i - A - 0: A - a\x{10a0}B - 0: \x{10a0} - ** Failers - 0: F - a -No match - \x{1d00} -No match - -/\p{^Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - -/\P{Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - -/(?<=A\p{Nd})XYZ/8 - A2XYZ - 0: XYZ - 123A5XYZPQR - 0: XYZ - ABA\x{660}XYZpqr - 0: XYZ - ** Failers -No match - AXYZ -No match - XYZ -No match - -/(?<!\pL)XYZ/8 - 1XYZ - 0: XYZ - AB=XYZ.. - 0: XYZ - XYZ - 0: XYZ - ** Failers -No match - WXYZ -No match - -/[\p{L}]/D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 [\p{L}] - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\p{^L}]/D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 [\P{L}] - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\P{L}]/D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 [\P{L}] - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\P{^L}]/D ------------------------------------------------------------------- - 0 10 Bra 0 - 3 [\p{L}] - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[abc\p{L}\x{0660}]/8D ------------------------------------------------------------------- - 0 45 Bra 0 - 3 [a-c\p{L}\x{660}] - 45 45 Ket - 48 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[\p{Nd}]/8DM -Memory allocation (code space): 46 ------------------------------------------------------------------- - 0 10 Bra 0 - 3 [\p{Nd}] - 10 10 Ket - 13 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - 1234 - 0: 1 - -/[\p{Nd}+-]+/8DM -Memory allocation (code space): 47 ------------------------------------------------------------------- - 0 43 Bra 0 - 3 [+\-\p{Nd}]+ - 43 43 Ket - 46 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Partial matching not supported -Options: utf8 -No first char -No need char - 1234 - 0: 1234 - 12-34 - 0: 12-34 - 12+\x{661}-34 - 0: 12+\x{661}-34 - ** Failers -No match - abcd -No match - -/[\P{Nd}]+/8 - abcd - 0: abcd - ** Failers - 0: ** Failers - 1234 -No match - -/\D+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\P{Nd}+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\pL/8 - a - 0: a - A - 0: A - -/\pL/8i - a - 0: a - A - 0: A - -/\p{Lu}/8 - A - 0: A - aZ - 0: Z - ** Failers - 0: F - abc -No match - -/\p{Lu}/8i - A - 0: A - aZ - 0: Z - ** Failers - 0: F - abc -No match - -/\p{Ll}/8 - a - 0: a - Az - 0: z - ** Failers - 0: a - ABC -No match - -/\p{Ll}/8i - a - 0: a - Az - 0: z - ** Failers - 0: a - ABC -No match - -/^\x{c0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/^\x{e0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb0} - ** Failers -No match - a\x{391}\x{10427}\x{ff3a}\x{1fb0} -No match - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} -No match - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} -No match - A\x{391}\x{10427}\x{ff5a}\x{1fb0} -No match - A\x{391}\x{10427}\x{ff3a}\x{1fb8} -No match - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8i - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb0} - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{1044f}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iD ------------------------------------------------------------------- - 0 21 Bra 0 - 3 NC A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -First char = 'A' (caseless) -No need char - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8D ------------------------------------------------------------------- - 0 21 Bra 0 - 3 A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 21 21 Ket - 24 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = 176 - -/AB\x{1fb0}/8D ------------------------------------------------------------------- - 0 11 Bra 0 - 3 AB\x{1fb0} - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = 176 - -/AB\x{1fb0}/8Di ------------------------------------------------------------------- - 0 11 Bra 0 - 3 NC AB\x{1fb0} - 11 11 Ket - 14 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -First char = 'A' (caseless) -Need char = 'B' (caseless) - -/\x{391}+/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - -/\x{391}{3,5}(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 1: X - -/\x{391}{3,5}?(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 0: \x{391}\x{3b1}\x{3b1}\x{3b1} - 1: \x{3b1} - -/[\x{391}\x{ff3a}]/8i - \x{391} - 0: \x{391} - \x{ff3a} - 0: \x{ff3a} - \x{3b1} - 0: \x{3b1} - \x{ff5a} - 0: \x{ff5a} - -/[\x{c0}\x{391}]/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/[\x{105}-\x{109}]/8iD ------------------------------------------------------------------- - 0 13 Bra 0 - 3 [\x{104}-\x{109}] - 13 13 Ket - 16 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - \x{104} - 0: \x{104} - \x{105} - 0: \x{105} - \x{109} - 0: \x{109} - ** Failers -No match - \x{100} -No match - \x{10a} -No match - -/[z-\x{100}]/8iD ------------------------------------------------------------------- - 0 20 Bra 0 - 3 [Z\x{39c}\x{178}z-\x{101}] - 20 20 Ket - 23 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - Z - 0: Z - z - 0: z - \x{39c} - 0: \x{39c} - \x{178} - 0: \x{178} - | - 0: | - \x{80} - 0: \x{80} - \x{ff} - 0: \x{ff} - \x{100} - 0: \x{100} - \x{101} - 0: \x{101} - ** Failers -No match - \x{102} -No match - Y -No match - y -No match - -/[z-\x{100}]/8Di ------------------------------------------------------------------- - 0 20 Bra 0 - 3 [Z\x{39c}\x{178}z-\x{101}] - 20 20 Ket - 23 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - -/^\X/8 - A - 0: A - A\x{300}BC - 0: A\x{300} - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302} - *** Failers - 0: * - \x{300} -No match - -/^[\X]/8 - X123 - 0: X - *** Failers -No match - AXYZ -No match - -/^(\X*)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BC - 1: A\x{300}\x{301}\x{302}B - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - -/^(\X*?)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BC - 1: A\x{300}\x{301}\x{302}B - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BC - 1: A\x{300}\x{301}\x{302}B - -/^(\X*)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BCA - 1: A\x{300}\x{301}\x{302}BC - 2: A - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 2: C - -/^(\X*?)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A - 1: - 2: A - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A - 1: - 2: A - -/^\X(.)/8 - *** Failers - 0: ** - 1: * - A\x{300}\x{301}\x{302} -No match - -/^\X{2,3}(.)/8 - A\x{300}\x{301}B\x{300}X - 0: A\x{300}\x{301}B\x{300}X - 1: X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - 0: A\x{300}\x{301}B\x{300}C - 1: C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 1: X - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}D - 1: D - -/^\X{2,3}?(.)/8 - A\x{300}\x{301}B\x{300}X - 0: A\x{300}\x{301}B\x{300}X - 1: X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - 0: A\x{300}\x{301}B\x{300}C - 1: C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 0: A\x{300}\x{301}B\x{300}C - 1: C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - 0: A\x{300}\x{301}B\x{300}C - 1: C - -/ End of testinput6 / diff --git a/ext/pcre/pcrelib/testdata/testoutput7 b/ext/pcre/pcrelib/testdata/testoutput7 deleted file mode 100644 index 85dd0a634400e..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput7 +++ /dev/null @@ -1,6517 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/abc/ - abc - 0: abc - -/ab*c/ - abc - 0: abc - abbbbc - 0: abbbbc - ac - 0: ac - -/ab+c/ - abc - 0: abc - abbbbbbc - 0: abbbbbbc - *** Failers -No match - ac -No match - ab -No match - -/a*/ - a - 0: a - 1: - aaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaa - 4: aaaaaaaaaaaaa - 5: aaaaaaaaaaaa - 6: aaaaaaaaaaa - 7: aaaaaaaaaa - 8: aaaaaaaaa - 9: aaaaaaaa -10: aaaaaaa -11: aaaaaa -12: aaaaa -13: aaaa -14: aaa -15: aa -16: a -17: - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaa -17: aaaaaaaaaaaaa -18: aaaaaaaaaaaa -19: aaaaaaaaaaa -20: aaaaaaaaaa -21: aaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F - 0: - -/(a|abcd|african)/ - a - 0: a - abcd - 0: abcd - 1: a - african - 0: african - 1: a - -/^abc/ - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/^abc/m - abcdef - 0: abc - xyz\nabc - 0: abc - *** Failers -No match - xyzabc -No match - -/\Aabc/ - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/\Aabc/m - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/\Gabc/ - abcdef - 0: abc - xyzabc\>3 - 0: abc - *** Failers -No match - xyzabc -No match - xyzabc\>2 -No match - -/x\dy\Dz/ - x9yzz - 0: x9yzz - x0y+z - 0: x0y+z - *** Failers -No match - xyz -No match - xxy0z -No match - -/x\sy\Sz/ - x yzz - 0: x yzz - x y+z - 0: x y+z - *** Failers -No match - xyz -No match - xxyyz -No match - -/x\wy\Wz/ - xxy+z - 0: xxy+z - *** Failers -No match - xxy0z -No match - x+y+z -No match - -/x.y/ - x+y - 0: x+y - x-y - 0: x-y - *** Failers -No match - x\ny -No match - -/x.y/s - x+y - 0: x+y - x-y - 0: x-y - x\ny - 0: x\x0ay - -/(a.b(?s)c.d|x.y)p.q/ - a+bc+dp+q - 0: a+bc+dp+q - a+bc\ndp+q - 0: a+bc\x0adp+q - x\nyp+q - 0: x\x0ayp+q - *** Failers -No match - a\nbc\ndp+q -No match - a+bc\ndp\nq -No match - x\nyp\nq -No match - -/a\d\z/ - ba0 - 0: a0 - *** Failers -No match - ba0\n -No match - ba0\ncd -No match - -/a\d\z/m - ba0 - 0: a0 - *** Failers -No match - ba0\n -No match - ba0\ncd -No match - -/a\d\Z/ - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d\Z/m - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d$/ - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d$/m - ba0 - 0: a0 - ba0\n - 0: a0 - ba0\ncd - 0: a0 - *** Failers -No match - -/abc/i - abc - 0: abc - aBc - 0: aBc - ABC - 0: ABC - -/[^a]/ - abcd - 0: b - -/ab?\w/ - abz - 0: abz - 1: ab - abbz - 0: abb - 1: ab - azz - 0: az - -/x{0,3}yz/ - ayzq - 0: yz - axyzq - 0: xyz - axxyz - 0: xxyz - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - -/x{3}yz/ - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - ayzq -No match - axyzq -No match - axxyz -No match - -/x{2,3}yz/ - axxyz - 0: xxyz - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - ayzq -No match - axyzq -No match - -/[^a]+/ - bac - 0: b - bcdefax - 0: bcdef - 1: bcde - 2: bcd - 3: bc - 4: b - *** Failers - 0: *** F - 1: *** - 2: *** - 3: ** - 4: * - aaaaa -No match - -/[^a]*/ - bac - 0: b - 1: - bcdefax - 0: bcdef - 1: bcde - 2: bcd - 3: bc - 4: b - 5: - *** Failers - 0: *** F - 1: *** - 2: *** - 3: ** - 4: * - 5: - aaaaa - 0: - -/[^a]{3,5}/ - xyz - 0: xyz - awxyza - 0: wxyz - 1: wxy - abcdefa - 0: bcdef - 1: bcde - 2: bcd - abcdefghijk - 0: bcdef - 1: bcde - 2: bcd - *** Failers - 0: *** F - 1: *** - 2: *** - axya -No match - axa -No match - aaaaa -No match - -/\d*/ - 1234b567 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - 4: - xyz - 0: - -/\D*/ - a1234b567 - 0: a - 1: - xyz - 0: xyz - 1: xy - 2: x - 3: - -/\d+/ - ab1234c56 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - *** Failers -No match - xyz -No match - -/\D+/ - ab123c56 - 0: ab - 1: a - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - 7: *** - 8: *** - 9: ** -10: * - 789 -No match - -/\d?A/ - 045ABC - 0: 5A - ABC - 0: A - *** Failers -No match - XYZ -No match - -/\D?A/ - ABC - 0: A - BAC - 0: BA - 9ABC - 0: A - *** Failers -No match - -/a+/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - -/^.*xyz/ - xyz - 0: xyz - ggggggggxyz - 0: ggggggggxyz - -/^.+xyz/ - abcdxyz - 0: abcdxyz - axyz - 0: axyz - *** Failers -No match - xyz -No match - -/^.?xyz/ - xyz - 0: xyz - cxyz - 0: cxyz - -/^\d{2,3}X/ - 12X - 0: 12X - 123X - 0: 123X - *** Failers -No match - X -No match - 1X -No match - 1234X -No match - -/^[abcd]\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - *** Failers -No match - e45 -No match - abcd -No match - abcd1234 -No match - 1234 -No match - -/^[abcd]*\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - abcd1234 - 0: abcd1 - 1234 - 0: 1 - *** Failers -No match - e45 -No match - abcd -No match - -/^[abcd]+\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - abcd1234 - 0: abcd1 - *** Failers -No match - 1234 -No match - e45 -No match - abcd -No match - -/^a+X/ - aX - 0: aX - aaX - 0: aaX - -/^[abcd]?\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - 1234 - 0: 1 - *** Failers -No match - abcd1234 -No match - e45 -No match - -/^[abcd]{2,3}\d/ - ab45 - 0: ab4 - bcd93 - 0: bcd9 - *** Failers -No match - 1234 -No match - a36 -No match - abcd1234 -No match - ee45 -No match - -/^(abc)*\d/ - abc45 - 0: abc4 - abcabcabc45 - 0: abcabcabc4 - 42xyz - 0: 4 - *** Failers -No match - -/^(abc)+\d/ - abc45 - 0: abc4 - abcabcabc45 - 0: abcabcabc4 - *** Failers -No match - 42xyz -No match - -/^(abc)?\d/ - abc45 - 0: abc4 - 42xyz - 0: 4 - *** Failers -No match - abcabcabc45 -No match - -/^(abc){2,3}\d/ - abcabc45 - 0: abcabc4 - abcabcabc45 - 0: abcabcabc4 - *** Failers -No match - abcabcabcabc45 -No match - abc45 -No match - 42xyz -No match - -/1(abc|xyz)2(?1)3/ - 1abc2abc3456 - 0: 1abc2abc3 - 1abc2xyz3456 - 0: 1abc2xyz3 - -/^(a*\w|ab)=(a*\w|ab)/ - ab=ab - 0: ab=ab - 1: ab=a - -/^(a*\w|ab)=(?1)/ - ab=ab - 0: ab=ab - 1: ab=a - -/^([^()]|\((?1)*\))*$/ - abc - 0: abc - a(b)c - 0: a(b)c - a(b(c))d - 0: a(b(c))d - *** Failers) -No match - a(b(c)d -No match - -/^>abc>([^()]|\((?1)*\))*<xyz<$/ - >abc>123<xyz< - 0: >abc>123<xyz< - >abc>1(2)3<xyz< - 0: >abc>1(2)3<xyz< - >abc>(1(2)3)<xyz< - 0: >abc>(1(2)3)<xyz< - -/^(?>a*)\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9 - *** Failers -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x - <> - 0: <> - <abcd> - 0: <abcd> - <abc <123> hij> - 0: <abc <123> hij> - <abc <def> hij> - 0: <def> - <abc<>def> - 0: <abc<>def> - <abc<> - 0: <> - *** Failers -No match - <abc -No match - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/^(?=abc)\w{5}:$/ - abcde: - 0: abcde: - *** Failers -No match - abc.. -No match - 123 -No match - vwxyz -No match - -/^(?!abc)\d\d$/ - 12 - 0: 12 - *** Failers -No match - abcde: -No match - abc.. -No match - 123 -No match - vwxyz -No match - -/(?<=abc|xy)123/ - abc12345 - 0: 123 - wxy123z - 0: 123 - *** Failers -No match - 123abc -No match - -/(?<!abc|xy)123/ - 123abc - 0: 123 - mno123456 - 0: 123 - *** Failers -No match - abc12345 -No match - wxy123z -No match - -/abc(?C1)xyz/ - abcxyz ---->abcxyz - 1 ^ ^ x - 0: abcxyz - 123abcxyz999 ---->123abcxyz999 - 1 ^ ^ x - 0: abcxyz - -/(ab|cd){3,4}/C - ababab ---->ababab - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - 0: ababab - abcdabcd ---->abcdabcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdabcd - 1: abcdab - abcdcdcdcdcd ---->abcdcdcdcdcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdcdcd - 1: abcdcd - -/^abc/ - abcdef - 0: abc - *** Failers -No match - abcdef\B -No match - -/^(a*|xyz)/ - bcd - 0: - aaabcd - 0: aaa - 1: aa - 2: a - 3: - xyz - 0: xyz - 1: - xyz\N - 0: xyz - *** Failers - 0: - bcd\N -No match - -/xyz$/ - xyz - 0: xyz - xyz\n - 0: xyz - *** Failers -No match - xyz\Z -No match - xyz\n\Z -No match - -/xyz$/m - xyz - 0: xyz - xyz\n - 0: xyz - abcxyz\npqr - 0: xyz - abcxyz\npqr\Z - 0: xyz - xyz\n\Z - 0: xyz - *** Failers -No match - xyz\Z -No match - -/\Gabc/ - abcdef - 0: abc - defabcxyz\>3 - 0: abc - *** Failers -No match - defabcxyz -No match - -/^abcdef/ - ab\P -Partial match: ab - abcde\P -Partial match: abcde - abcdef\P - 0: abcdef - *** Failers -No match - abx\P -No match - -/^a{2,4}\d+z/ - a\P -Partial match: a - aa\P -Partial match: aa - aa2\P -Partial match: aa2 - aaa\P -Partial match: aaa - aaa23\P -Partial match: aaa23 - aaaa12345\P -Partial match: aaaa12345 - aa0z\P - 0: aa0z - aaaa4444444444444z\P - 0: aaaa4444444444444z - *** Failers -No match - az\P -No match - aaaaa\P -No match - a56\P -No match - -/^abcdef/ - abc\P -Partial match: abc - def\R - 0: def - -/(?<=foo)bar/ - xyzfo\P -No match - foob\R\P\>2 -Partial match: b - foobar...\R\P\>4 - 0: ar - xyzfo\P -No match - foobar\R\>2 - 0: bar - *** Failers -No match - xyzfo\P -No match - obar\R -No match - -/(ab*(cd|ef))+X/ - adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z -No match - lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z -Partial match: abbbbbbcdaefabbbbbbbefa - cdabbbbbbbb\P\R\B\Z -Partial match: cdabbbbbbbb - efabbbbbbbbbbbbbbbb\P\R\B\Z -Partial match: efabbbbbbbbbbbbbbbb - bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z - 0: bbbbbbbbbbbbcdX - -/(a|b)/SF>testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex -<testsavedregex -Compiled regex (byte-inverted) loaded from testsavedregex -Study data loaded from testsavedregex - abc - 0: a - ** Failers - 0: a - def -No match - -/the quick brown fox/ - the quick brown fox - 0: the quick brown fox - The quick brown FOX -No match - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? -No match - -/The quick brown fox/i - the quick brown fox - 0: the quick brown fox - The quick brown FOX - 0: The quick brown FOX - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? - 0: THE QUICK BROWN FOX - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - 0: aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - 0: aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - 0: aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - 0: aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - 0: aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - 0: abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - 0: aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - 0: abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - 0: aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - 0: aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - 0: aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - *** Failers -No match - abxyzpqrrabbxyyyypqAzz -No match - abxyzpqrrrrabbxyyyypqAzz -No match - abxyzpqrrrabxyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyypqAzz -No match - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz -No match - -/^(abc){1,2}zz/ - abczz - 0: abczz - abcabczz - 0: abcabczz - *** Failers -No match - zz -No match - abcabcabczz -No match - >>abczz -No match - -/^(b+?|a){1,2}?c/ - bc - 0: bc - bbc - 0: bbc - bbbc - 0: bbbc - bac - 0: bac - bbac - 0: bbac - aac - 0: aac - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}c/ - bc - 0: bc - bbc - 0: bbc - bbbc - 0: bbbc - bac - 0: bac - bbac - 0: bbac - aac - 0: aac - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}?bc/ - bbc - 0: bbc - -/^(b*|ba){1,2}?bc/ - babc - 0: babc - bbabc - 0: bbabc - bababc - 0: bababc - *** Failers -No match - bababbc -No match - babababc -No match - -/^(ba|b*){1,2}?bc/ - babc - 0: babc - bbabc - 0: bbabc - bababc - 0: bababc - *** Failers -No match - bababbc -No match - babababc -No match - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - 0: \x01\x01\x1b;z - -/^[ab\]cde]/ - athing - 0: a - bthing - 0: b - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - fthing -No match - [thing -No match - \\thing -No match - -/^[]cde]/ - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - athing -No match - fthing -No match - -/^[^ab\]cde]/ - fthing - 0: f - [thing - 0: [ - \\thing - 0: \ - *** Failers - 0: * - athing -No match - bthing -No match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^[^]cde]/ - athing - 0: a - fthing - 0: f - *** Failers - 0: * - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^\/ -  - 0: \x81 - -/^˙/ - ˙ - 0: \xff - -/^[0-9]+$/ - 0 - 0: 0 - 1 - 0: 1 - 2 - 0: 2 - 3 - 0: 3 - 4 - 0: 4 - 5 - 0: 5 - 6 - 0: 6 - 7 - 0: 7 - 8 - 0: 8 - 9 - 0: 9 - 10 - 0: 10 - 100 - 0: 100 - *** Failers -No match - abc -No match - -/^.*nter/ - enter - 0: enter - inter - 0: inter - uponter - 0: uponter - -/^xxx[0-9]+$/ - xxx0 - 0: xxx0 - xxx1234 - 0: xxx1234 - *** Failers -No match - xxx -No match - -/^.+[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - 0: abc!pqr=apquxz.ixr.zzz.ac.uk - *** Failers -No match - !pqr=apquxz.ixr.zzz.ac.uk -No match - abc!=apquxz.ixr.zzz.ac.uk -No match - abc!pqr=apquxz:ixr.zzz.ac.uk -No match - abc!pqr=apquxz.ixr.zzz.ac.ukk -No match - -/:/ - Well, we need a colon: somewhere - 0: : - *** Fail if we don't -No match - -/([\da-f:]+)$/i - 0abc - 0: 0abc - abc - 0: abc - fed - 0: fed - E - 0: E - :: - 0: :: - 5f03:12C0::932e - 0: 5f03:12C0::932e - fed def - 0: def - Any old stuff - 0: ff - *** Failers -No match - 0zzz -No match - gzzz -No match - fed\x20 -No match - Any old rubbish -No match - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - 0: .1.2.3 - A.12.123.0 - 0: A.12.123.0 - *** Failers -No match - .1.2.3333 -No match - 1.2.3 -No match - 1234.2.3 -No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1 IN SOA non-sp1 non-sp2 ( - 0: 1 IN SOA non-sp1 non-sp2 ( - *** Failers -No match - 1IN SOA non-sp1 non-sp2( -No match - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - 0: a. - Z. - 0: Z. - 2. - 0: 2. - ab-c.pq-r. - 0: ab-c.pq-r. - sxk.zzz.ac.uk. - 0: sxk.zzz.ac.uk. - x-.y-. - 0: x-.y-. - *** Failers -No match - -abc.peq. -No match - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - 0: *.a - *.b0-a - 0: *.b0-a - *.c3-b.c - 0: *.c3-b.c - *.c-a.b-c - 0: *.c-a.b-c - *** Failers -No match - *.0 -No match - *.a- -No match - *.a-b.c- -No match - *.c-a.0-c -No match - -/^(?=ab(de))(abd)(e)/ - abde - 0: abde - -/^(?!(ab)de|x)(abd)(f)/ - abdf - 0: abdf - -/^(?=(ab(cd)))(ab)/ - abcd - 0: ab - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - 0: a.b.c.d - A.B.C.D - 0: A.B.C.D - a.b.c.1.2.3.C - 0: a.b.c.1.2.3.C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - 0: "1234" - \"abcd\" ; - 0: "abcd" ; - \"\" ; rhubarb - 0: "" ; rhubarb - *** Failers -No match - \"1234\" : things -No match - -/^$/ - \ - 0: - *** Failers -No match - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/^ a\ b[c ]d $/x - a bcd - 0: a bcd - a b d - 0: a b d - *** Failers -No match - abcd -No match - ab d -No match - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - 0: a+ Z0+\x08\x0a\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - 0: .^$(*+)|{?,?} - 1: .^$(*+)|{?,? - 2: .^$(*+)|{?, - 3: .^$(*+)|{? - 4: .^$(*+)|{ - 5: .^$(*+)| - 6: .^$(*+) - 7: .^$(*+ - 8: .^$(* - 9: .^$( -10: .^$ -11: .^ -12: . - -/^a*\w/ - z - 0: z - az - 0: az - 1: a - aaaz - 0: aaaz - 1: aaa - 2: aa - 3: a - a - 0: a - aa - 0: aa - 1: a - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - a+ - 0: a - aa+ - 0: aa - 1: a - -/^a*?\w/ - z - 0: z - az - 0: az - 1: a - aaaz - 0: aaaz - 1: aaa - 2: aa - 3: a - a - 0: a - aa - 0: aa - 1: a - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - a+ - 0: a - aa+ - 0: aa - 1: a - -/^a+\w/ - az - 0: az - aaaz - 0: aaaz - 1: aaa - 2: aa - aa - 0: aa - aaaa - 0: aaaa - 1: aaa - 2: aa - aa+ - 0: aa - -/^a+?\w/ - az - 0: az - aaaz - 0: aaaz - 1: aaa - 2: aa - aa - 0: aa - aaaa - 0: aaaa - 1: aaa - 2: aa - aa+ - 0: aa - -/^\d{8}\w{2,}/ - 1234567890 - 0: 1234567890 - 12345678ab - 0: 12345678ab - 12345678__ - 0: 12345678__ - *** Failers -No match - 1234567 -No match - -/^[aeiou\d]{4,5}$/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - aaaaa - 0: aaaaa - *** Failers -No match - 123456 -No match - -/^[aeiou\d]{4,5}?/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - 1: 1234 - aaaaa - 0: aaaaa - 1: aaaa - 123456 - 0: 12345 - 1: 1234 - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - From abcd Mon Sep 1 12:33:02 1997 - 0: From abcd Mon Sep 1 12:33 - *** Failers -No match - From abcd Sep 01 12:33:02 1997 -No match - -/^12.34/s - 12\n34 - 0: 12\x0a34 - 12\r34 - 0: 12\x0d34 - -/\w+(?=\t)/ - the quick brown\t fox - 0: brown - -/foo(?!bar)(.*)/ - foobar is foolish see? - 0: foolish see? - 1: foolish see - 2: foolish se - 3: foolish s - 4: foolish - 5: foolish - 6: foolis - 7: fooli - 8: fool - 9: foo - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - 0: rowbar etc - 1: rowbar et - 2: rowbar e - 3: rowbar - 4: rowbar - barrel - 0: barrel - 1: barre - 2: barr - 3: bar - 2barrel - 0: 2barrel - 1: 2barre - 2: 2barr - 3: 2bar - A barrel - 0: A barrel - 1: A barre - 2: A barr - 3: A bar - -/^(\D*)(?=\d)(?!123)/ - abc456 - 0: abc - *** Failers -No match - abc123 -No match - -/^1234(?# test newlines - inside)/ - 1234 - 0: 1234 - -/^1234 #comment in extended re - /x - 1234 - 0: 1234 - -/#rhubarb - abcd/x - abcd - 0: abcd - -/^abcd#rhubarb/x - abcd - 0: abcd - -/(?!^)abc/ - the abc - 0: abc - *** Failers -No match - abc -No match - -/(?=^)abc/ - abc - 0: abc - *** Failers -No match - the abc -No match - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other <user\@dom.ain> - 0: Alan Other <user@dom.ain> - <user\@dom.ain> - 0: user@dom.ain - 1: user@dom - user\@dom.ain - 0: user@dom.ain - 1: user@dom - \"A. Other\" <user.1234\@dom.ain> (a comment) - 0: "A. Other" <user.1234@dom.ain> (a comment) - 1: "A. Other" <user.1234@dom.ain> - 2: "A. Other" <user.1234@dom.ain> - A. Other <user.1234\@dom.ain> (a comment) - 0: Other <user.1234@dom.ain> (a comment) - 1: Other <user.1234@dom.ain> - 2: Other <user.1234@dom.ain> - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re - A missing angle <user\@some.where - 0: user@some.where - 1: user@some - *** Failers -No match - The quick brown fox -No match - -/[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional leading comment -(?: -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other <user\@dom.ain> - 0: Alan Other <user@dom.ain> - <user\@dom.ain> - 0: user@dom.ain - 1: user@dom - user\@dom.ain - 0: user@dom.ain - 1: user@dom - \"A. Other\" <user.1234\@dom.ain> (a comment) - 0: "A. Other" <user.1234@dom.ain> - A. Other <user.1234\@dom.ain> (a comment) - 0: Other <user.1234@dom.ain> - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re - A missing angle <user\@some.where - 0: user@some.where - 1: user@some - *** Failers -No match - The quick brown fox -No match - -/abc\0def\00pqr\000xyz\0000AB/ - abc\0def\00pqr\000xyz\0000AB - 0: abc\x00def\x00pqr\x00xyz\x000AB - abc456 abc\0def\00pqr\000xyz\0000ABCDE - 0: abc\x00def\x00pqr\x00xyz\x000AB - -/abc\x0def\x00pqr\x000xyz\x0000AB/ - abc\x0def\x00pqr\x000xyz\x0000AB - 0: abc\x0def\x00pqr\x000xyz\x0000AB - abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE - 0: abc\x0def\x00pqr\x000xyz\x0000AB - -/^[\000-\037]/ - \0A - 0: \x00 - \01B - 0: \x01 - \037C - 0: \x1f - -/\0*/ - \0\0\0\0 - 0: \x00\x00\x00\x00 - 1: \x00\x00\x00 - 2: \x00\x00 - 3: \x00 - 4: - -/A\x0{2,3}Z/ - The A\x0\x0Z - 0: A\x00\x00Z - An A\0\x0\0Z - 0: A\x00\x00\x00Z - *** Failers -No match - A\0Z -No match - A\0\x0\0\x0Z -No match - -/^\s/ - \040abc - 0: - \x0cabc - 0: \x0c - \nabc - 0: \x0a - \rabc - 0: \x0d - \tabc - 0: \x09 - *** Failers -No match - abc -No match - -/^a b - - c/x - abc - 0: abc - -/ab{1,3}bc/ - abbbbc - 0: abbbbc - abbbc - 0: abbbc - abbc - 0: abbc - *** Failers -No match - abc -No match - abbbbbc -No match - -/([^.]*)\.([^:]*):[T ]+(.*)/ - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1.title:TBlah blah bla - 2: track1.title:TBlah blah bl - 3: track1.title:TBlah blah b - 4: track1.title:TBlah blah - 5: track1.title:TBlah blah - 6: track1.title:TBlah bla - 7: track1.title:TBlah bl - 8: track1.title:TBlah b - 9: track1.title:TBlah -10: track1.title:TBlah -11: track1.title:TBla -12: track1.title:TBl -13: track1.title:TB -14: track1.title:T - -/([^.]*)\.([^:]*):[T ]+(.*)/i - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1.title:TBlah blah bla - 2: track1.title:TBlah blah bl - 3: track1.title:TBlah blah b - 4: track1.title:TBlah blah - 5: track1.title:TBlah blah - 6: track1.title:TBlah bla - 7: track1.title:TBlah bl - 8: track1.title:TBlah b - 9: track1.title:TBlah -10: track1.title:TBlah -11: track1.title:TBla -12: track1.title:TBl -13: track1.title:TB -14: track1.title:T - -/([^.]*)\.([^:]*):[t ]+(.*)/i - track1.title:TBlah blah blah - 0: track1.title:TBlah blah blah - 1: track1.title:TBlah blah bla - 2: track1.title:TBlah blah bl - 3: track1.title:TBlah blah b - 4: track1.title:TBlah blah - 5: track1.title:TBlah blah - 6: track1.title:TBlah bla - 7: track1.title:TBlah bl - 8: track1.title:TBlah b - 9: track1.title:TBlah -10: track1.title:TBlah -11: track1.title:TBla -12: track1.title:TBl -13: track1.title:TB -14: track1.title:T - -/^[W-c]+$/ - WXY_^abc - 0: WXY_^abc - *** Failers -No match - wxy -No match - -/^[W-c]+$/i - WXY_^abc - 0: WXY_^abc - wxy_^ABC - 0: wxy_^ABC - -/^[\x3f-\x5F]+$/i - WXY_^abc - 0: WXY_^abc - wxy_^ABC - 0: wxy_^ABC - -/^abc$/m - abc - 0: abc - qqq\nabc - 0: abc - abc\nzzz - 0: abc - qqq\nabc\nzzz - 0: abc - -/^abc$/ - abc - 0: abc - *** Failers -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -/\Aabc\Z/m - abc - 0: abc - abc\n - 0: abc - *** Failers -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -/\A(.)*\Z/s - abc\ndef - 0: abc\x0adef - -/\A(.)*\Z/m - *** Failers - 0: *** Failers - abc\ndef -No match - -/(?:b)|(?::+)/ - b::c - 0: b - c::b - 0: :: - 1: : - -/[-az]+/ - az- - 0: az- - 1: az - 2: a - *** Failers - 0: a - b -No match - -/[az-]+/ - za- - 0: za- - 1: za - 2: z - *** Failers - 0: a - b -No match - -/[a\-z]+/ - a-z - 0: a-z - 1: a- - 2: a - *** Failers - 0: a - b -No match - -/[a-z]+/ - abcdxyz - 0: abcdxyz - 1: abcdxy - 2: abcdx - 3: abcd - 4: abc - 5: ab - 6: a - -/[\d-]+/ - 12-34 - 0: 12-34 - 1: 12-3 - 2: 12- - 3: 12 - 4: 1 - *** Failers -No match - aaa -No match - -/[\d-z]+/ - 12-34z - 0: 12-34z - 1: 12-34 - 2: 12-3 - 3: 12- - 4: 12 - 5: 1 - *** Failers -No match - aaa -No match - -/\x5c/ - \\ - 0: \ - -/\x20Z/ - the Zoo - 0: Z - *** Failers -No match - Zulu -No match - -/ab{3cd/ - ab{3cd - 0: ab{3cd - -/ab{3,cd/ - ab{3,cd - 0: ab{3,cd - -/ab{3,4a}cd/ - ab{3,4a}cd - 0: ab{3,4a}cd - -/{4,5a}bc/ - {4,5a}bc - 0: {4,5a}bc - -/^a.b/ - a\rb - 0: a\x0db - *** Failers -No match - a\nb -No match - -/abc$/ - abc - 0: abc - abc\n - 0: abc - *** Failers -No match - abc\ndef -No match - -/(abc)\123/ - abc\x53 - 0: abcS - -/(abc)\223/ - abc\x93 - 0: abc\x93 - -/(abc)\323/ - abc\xd3 - 0: abc\xd3 - -/(abc)\500/ - abc\x40 - 0: abc@ - abc\100 - 0: abc@ - -/(abc)\5000/ - abc\x400 - 0: abc@0 - abc\x40\x30 - 0: abc@0 - abc\1000 - 0: abc@0 - abc\100\x30 - 0: abc@0 - abc\100\060 - 0: abc@0 - abc\100\60 - 0: abc@0 - -/abc\81/ - abc\081 - 0: abc\x0081 - abc\0\x38\x31 - 0: abc\x0081 - -/abc\91/ - abc\091 - 0: abc\x0091 - abc\0\x39\x31 - 0: abc\x0091 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - 0: abcdefghijk\x0aS - -/ab\gdef/ - abgdef - 0: abgdef - -/a{0}bc/ - bc - 0: bc - -/(a|(bc)){0,0}?xyz/ - xyz - 0: xyz - -/abc[\10]de/ - abc\010de - 0: abc\x08de - -/abc[\1]de/ - abc\1de - 0: abc\x01de - -/(abc)[\1]de/ - abc\1de - 0: abc\x01de - -/(?s)a.b/ - a\nb - 0: a\x0ab - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - 0: baNOTcccc - 1: baNOTccc - 2: baNOTcc - 3: baNOTc - 4: baNOT - baNOTcccd - 0: baNOTccc - 1: baNOTcc - 2: baNOTc - 3: baNOT - baNOTccd - 0: baNOTcc - 1: baNOTc - 2: baNOT - bacccd - 0: baccc - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - anything -No match - b\bc -No match - baccd -No match - -/[^a]/ - Abc - 0: A - -/[^a]/i - Abc - 0: b - -/[^a]+/ - AAAaAbc - 0: AAA - 1: AA - 2: A - -/[^a]+/i - AAAaAbc - 0: bc - 1: b - -/[^a]+/ - bbb\nccc - 0: bbb\x0accc - 1: bbb\x0acc - 2: bbb\x0ac - 3: bbb\x0a - 4: bbb - 5: bb - 6: b - -/[^k]$/ - abc - 0: c - *** Failers - 0: s - abk -No match - -/[^k]{2,3}$/ - abc - 0: abc - kbc - 0: bc - kabc - 0: abc - *** Failers - 0: ers - abk -No match - akb -No match - akk -No match - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 0: 12345678@a.b.c.d - 123456789\@x.y.z - 0: 123456789@x.y.z - *** Failers -No match - 12345678\@x.y.uk -No match - 1234567\@a.b.c.d -No match - -/[^a]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^a]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/[^az]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^az]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 0: .230003938 - 1: .23000393 - 2: .2300039 - 3: .230003 - 4: .23000 - 5: .2300 - 6: .230 - 1.875000282 - 0: .875000282 - 1: .87500028 - 2: .8750002 - 3: .875000 - 4: .87500 - 5: .8750 - 6: .875 - 1.235 - 0: .235 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 0: .230 - 1: .23 - 1.875000282 - 0: .875 - *** Failers -No match - 1.235 -No match - -/a(?)b/ - ab - 0: ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - 0: foo table - 1: foo tabl - 2: foo tab - 3: foo ta - 4: foo t - -/foo(.*)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: food is under the bar - -/foo(.*?)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: food is under the bar - -/(.*)(\d*)/ - I have 2 numbers: 53147 -Matched, but too many subsidiary matches - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 numbers: - 6: I have 2 numbers: - 7: I have 2 numbers - 8: I have 2 number - 9: I have 2 numbe -10: I have 2 numb -11: I have 2 num -12: I have 2 nu -13: I have 2 n -14: I have 2 -15: I have 2 -16: I have -17: I have -18: I hav -19: I ha -20: I h -21: I - -/(.*)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 -Matched, but too many subsidiary matches - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 numbers: - 6: I have 2 numbers: - 7: I have 2 numbers - 8: I have 2 number - 9: I have 2 numbe -10: I have 2 numb -11: I have 2 num -12: I have 2 nu -13: I have 2 n -14: I have 2 -15: I have 2 -16: I have -17: I have -18: I hav -19: I ha -20: I h -21: I - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/^\D*(?!123)/ - ABC123 - 0: AB - 1: A - 2: - -/^(\D*)(?=\d)(?!123)/ - ABC445 - 0: ABC - *** Failers -No match - ABC123 -No match - -/^[W-]46]/ - W46]789 - 0: W46] - -46]789 - 0: -46] - *** Failers -No match - Wall -No match - Zebra -No match - 42 -No match - [abcd] -No match - ]abcd[ -No match - -/^[W-\]46]/ - W46]789 - 0: W - Wall - 0: W - Zebra - 0: Z - Xylophone - 0: X - 42 - 0: 4 - [abcd] - 0: [ - ]abcd[ - 0: ] - \\backslash - 0: \ - *** Failers -No match - -46]789 -No match - well -No match - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - 0: 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/^(a){0,0}/ - bcd - 0: - abc - 0: - aab - 0: - -/^(a){0,1}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: a - 1: - -/^(a){0,2}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - -/^(a){0,3}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - aaa - 0: aaa - 1: aa - 2: a - 3: - -/^(a){0,}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - aaa - 0: aaa - 1: aa - 2: a - 3: - aaaaaaaa - 0: aaaaaaaa - 1: aaaaaaa - 2: aaaaaa - 3: aaaaa - 4: aaaa - 5: aaa - 6: aa - 7: a - 8: - -/^(a){1,1}/ - bcd -No match - abc - 0: a - aab - 0: a - -/^(a){1,2}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - -/^(a){1,3}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: aa - 2: a - -/^(a){1,}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: aa - 2: a - aaaaaaaa - 0: aaaaaaaa - 1: aaaaaaa - 2: aaaaaa - 3: aaaaa - 4: aaaa - 5: aaa - 6: aa - 7: a - -/.*\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.{0,}\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/m - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*\.gif/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*$/ - borfle\nbib.gif\nno - 0: no - -/.*$/m - borfle\nbib.gif\nno - 0: borfle - -/.*$/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - 1: borfle\x0abib.gif - 2: borfle - -/.*$/ - borfle\nbib.gif\nno\n - 0: no - -/.*$/m - borfle\nbib.gif\nno\n - 0: borfle - -/.*$/s - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - 1: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - 1: borfle\x0abib.gif\x0ano - 2: borfle\x0abib.gif - 3: borfle - -/(.*X|^B)/ - abcde\n1234Xyz - 0: 1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/m - abcde\n1234Xyz - 0: 1234X - BarFoo - 0: B - abcde\nBar - 0: B - -/(.*X|^B)/s - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/ms - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - abcde\nBar - 0: B - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(?s:.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/^.*B/ - **** Failers -No match - abc\nB -No match - -/(?s)^.*B/ - abc\nB - 0: abc\x0aB - -/(?m)^.*B/ - abc\nB - 0: B - -/(?ms)^.*B/ - abc\nB - 0: abc\x0aB - -/(?ms)^B/ - abc\nB - 0: B - -/(?s)B$/ - B\n - 0: B - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - 0: 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - 0: 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - 0: 123456654321 - -/^[abc]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - 0: n - *** Failers -No match - z -No match - -/abcde{0,0}/ - abcd - 0: abcd - *** Failers -No match - abce -No match - -/ab[cd]{0,0}e/ - abe - 0: abe - *** Failers -No match - abcde -No match - -/ab(c){0,0}d/ - abd - 0: abd - *** Failers -No match - abcd -No match - -/a(b*)/ - a - 0: a - ab - 0: ab - 1: a - abbbb - 0: abbbb - 1: abbb - 2: abb - 3: ab - 4: a - *** Failers - 0: a - bbbbb -No match - -/ab\d{0}e/ - abe - 0: abe - *** Failers -No match - ab1e -No match - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - 0: "quick" - \"the \\\"quick\\\" brown fox\" - 0: "the \"quick\" brown fox" - -/.*?/g+ - abc - 0: abc - 0+ - 1: ab - 2: a - 3: - 0: - 0+ - -/\b/g+ - abc - 0: - 0+ abc - 0: - 0+ - -/\b/+g - abc - 0: - 0+ abc - 0: - 0+ - -//g - abc - 0: - 0: - 0: - 0: - -/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - 0: <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> - -/a[^a]b/ - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/ - acb - 0: acb - *** Failers -No match - a\nb -No match - -/a[^a]b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/^(b+?|a){1,2}?c/ - bac - 0: bac - bbac - 0: bbac - bbbac - 0: bbbac - bbbbac - 0: bbbbac - bbbbbac - 0: bbbbbac - -/^(b+|a){1,2}?c/ - bac - 0: bac - bbac - 0: bbac - bbbac - 0: bbbac - bbbbac - 0: bbbbac - bbbbbac - 0: bbbbbac - -/(?!\A)x/m - x\nb\n -No match - a\bx\n - 0: x - -/\x0{ab}/ - \0{ab} - 0: \x00{ab} - -/(A|B)*?CD/ - CD - 0: CD - -/(A|B)*CD/ - CD - 0: CD - -/(?<!bar)foo/ - foo - 0: foo - catfood - 0: foo - arfootle - 0: foo - rfoosh - 0: foo - *** Failers -No match - barfoo -No match - towbarfoo -No match - -/\w{3}(?<!bar)foo/ - catfood - 0: catfoo - *** Failers -No match - foo -No match - barfoo -No match - towbarfoo -No match - -/(?<=(foo)a)bar/ - fooabar - 0: bar - *** Failers -No match - bar -No match - foobbar -No match - -/\Aabc\z/m - abc - 0: abc - *** Failers -No match - abc\n -No match - qqq\nabc -No match - abc\nzzz -No match - qqq\nabc\nzzz -No match - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ -No match - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 0: .230003938 - 1: .23000393 - 2: .2300039 - 3: .230003 - 4: .23000 - 5: .2300 - 6: .230 - 1.875000282 - 0: .875000282 - 1: .87500028 - 2: .8750002 - 3: .875000 - 4: .87500 - 5: .8750 - *** Failers -No match - 1.235 -No match - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - *** Failers -No match - this is not a line with only words and spaces! -No match - -/(\d+)(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: 1234 - 3: 123 - 4: 12 - 12345+ - 0: 12345 - 1: 1234 - 2: 123 - 3: 12 - -/((?>\d+))(\w)/ - 12345a - 0: 12345a - *** Failers -No match - 12345+ -No match - -/(?>a+)b/ - aaab - 0: aaab - -/((?>a+)b)/ - aaab - 0: aaab - -/(?>(a+))b/ - aaab - 0: aaab - -/(?>b)+/ - aaabbbccc - 0: bbb - 1: bb - 2: b - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbcccc - 1: aaabbbbc - -/(a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbcccc - 1: aaabbbbccc - 2: aaabbbbcc - 3: aaabbbbc - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: abc(ade)ufh()() - 2: abc(ade)ufh() - 3: abc(ade)ufh - 4: abc(ade) - 5: abc - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - 0: (abc) - (abc(def)xyz) - 0: (abc(def)xyz) - *** Failers -No match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/a(?-i)b/i - ab - 0: ab - Ab - 0: Ab - *** Failers -No match - aB -No match - AB -No match - -/(a (?x)b c)d e/ - a bcd e - 0: a bcd e - *** Failers -No match - a b cd e -No match - abcd e -No match - a bcde -No match - -/(a b(?x)c d (?-x)e f)/ - a bcde f - 0: a bcde f - *** Failers -No match - abcdef -No match - -/(a(?i)b)c/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - abC -No match - aBC -No match - Abc -No match - ABc -No match - ABC -No match - AbC -No match - -/a(?i:b)c/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - ABC -No match - abC -No match - aBC -No match - -/a(?i:b)*c/ - aBc - 0: aBc - aBBc - 0: aBBc - *** Failers -No match - aBC -No match - aBBC -No match - -/a(?=b(?i)c)\w\wd/ - abcd - 0: abcd - abCd - 0: abCd - *** Failers -No match - aBCd -No match - abcD -No match - -/(?s-i:more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?:(?s-i)more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?>a(?i)b+)+c/ - abc - 0: abc - aBbc - 0: aBbc - aBBc - 0: aBBc - *** Failers -No match - Abc -No match - abAb -No match - abbC -No match - -/(?=a(?i)b)\w\wc/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - Ab -No match - abC -No match - aBC -No match - -/(?<=a(?i)b)(\w\w)c/ - abxxc - 0: xxc - aBxxc - 0: xxc - *** Failers -No match - Abxxc -No match - ABxxc -No match - abxxC -No match - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/(?(?<=foo)bar|cat)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat - *** Failers -No match - foocat -No match - -/(?(?<!foo)cat|bar)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat - *** Failers -No match - foocat -No match - -/(?>a*)*/ - a - 0: a - 1: - aa - 0: aa - 1: - aaaa - 0: aaaa - 1: - -/(abc|)+/ - abc - 0: abc - 1: - abcabc - 0: abcabc - 1: abc - 2: - abcabcabc - 0: abcabcabc - 1: abcabc - 2: abc - 3: - xyz - 0: - -/([a]*)*/ - a - 0: a - 1: - aaaaa - 0: aaaaa - 1: aaaa - 2: aaa - 3: aa - 4: a - 5: - -/([ab]*)*/ - a - 0: a - 1: - b - 0: b - 1: - ababab - 0: ababab - 1: ababa - 2: abab - 3: aba - 4: ab - 5: a - 6: - aaaabcde - 0: aaaab - 1: aaaa - 2: aaa - 3: aa - 4: a - 5: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - -/([^a]*)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - aaa - 0: - -/([^ab]*)*/ - cccc - 0: cccc - 1: ccc - 2: cc - 3: c - 4: - abab - 0: - -/([a]*?)*/ - a - 0: a - 1: - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - 4: - -/([ab]*?)*/ - a - 0: a - 1: - b - 0: b - 1: - abab - 0: abab - 1: aba - 2: ab - 3: a - 4: - baba - 0: baba - 1: bab - 2: ba - 3: b - 4: - -/([^a]*?)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - aaa - 0: - -/([^ab]*?)*/ - c - 0: c - 1: - cccc - 0: cccc - 1: ccc - 2: cc - 3: c - 4: - baba - 0: - -/(?>a*)*/ - a - 0: a - 1: - aaabcde - 0: aaa - 1: - -/((?>a*))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/((?>a*?))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 0: 12-sep-98 - 12-09-98 - 0: 12-09-98 - *** Failers -No match - sep-12-98 -No match - -/(?i:saturday|sunday)/ - saturday - 0: saturday - sunday - 0: sunday - Saturday - 0: Saturday - Sunday - 0: Sunday - SATURDAY - 0: SATURDAY - SUNDAY - 0: SUNDAY - SunDay - 0: SunDay - -/(a(?i)bc|BB)x/ - abcx - 0: abcx - aBCx - 0: aBCx - bbx - 0: bbx - BBx - 0: BBx - *** Failers -No match - abcX -No match - aBCX -No match - bbX -No match - BBX -No match - -/^([ab](?i)[cd]|[ef])/ - ac - 0: ac - aC - 0: aC - bD - 0: bD - elephant - 0: e - Europe - 0: E - frog - 0: f - France - 0: F - *** Failers -No match - Africa -No match - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - 0: ab - aBd - 0: aBd - xy - 0: xy - xY - 0: xY - zebra - 0: z - Zambesi - 0: Z - *** Failers -No match - aCD -No match - XY -No match - -/(?<=foo\n)^bar/m - foo\nbar - 0: bar - *** Failers -No match - bar -No match - baz\nbar -No match - -/(?<=(?<!foo)bar)baz/ - barbaz - 0: baz - barbarbaz - 0: baz - koobarbaz - 0: baz - *** Failers -No match - baz -No match - foobarbaz -No match - -/The following tests are taken from the Perl 5.005 test suite; some of them/ -/are compatible with 5.004, but I'd rather not have to sort them out./ -No match - -/abc/ - abc - 0: abc - xabcy - 0: abc - ababc - 0: abc - *** Failers -No match - xbc -No match - axc -No match - abx -No match - -/ab*c/ - abc - 0: abc - -/ab*bc/ - abc - 0: abc - abbc - 0: abbc - abbbbc - 0: abbbbc - -/.{1}/ - abbbbc - 0: a - -/.{3,4}/ - abbbbc - 0: abbb - 1: abb - -/ab{0,}bc/ - abbbbc - 0: abbbbc - -/ab+bc/ - abbc - 0: abbc - *** Failers -No match - abc -No match - abq -No match - -/ab{1,}bc/ - -/ab+bc/ - abbbbc - 0: abbbbc - -/ab{1,}bc/ - abbbbc - 0: abbbbc - -/ab{1,3}bc/ - abbbbc - 0: abbbbc - -/ab{3,4}bc/ - abbbbc - 0: abbbbc - -/ab{4,5}bc/ - *** Failers -No match - abq -No match - abbbbc -No match - -/ab?bc/ - abbc - 0: abbc - abc - 0: abc - -/ab{0,1}bc/ - abc - 0: abc - -/ab?bc/ - -/ab?c/ - abc - 0: abc - -/ab{0,1}c/ - abc - 0: abc - -/^abc$/ - abc - 0: abc - *** Failers -No match - abbbbc -No match - abcc -No match - -/^abc/ - abcc - 0: abc - -/^abc$/ - -/abc$/ - aabc - 0: abc - *** Failers -No match - aabc - 0: abc - aabcd -No match - -/^/ - abc - 0: - -/$/ - abc - 0: - -/a.c/ - abc - 0: abc - axc - 0: axc - -/a.*c/ - axyzc - 0: axyzc - -/a[bc]d/ - abd - 0: abd - *** Failers -No match - axyzd -No match - abc -No match - -/a[b-d]e/ - ace - 0: ace - -/a[b-d]/ - aac - 0: ac - -/a[-b]/ - a- - 0: a- - -/a[b-]/ - a- - 0: a- - -/a]/ - a] - 0: a] - -/a[]]b/ - a]b - 0: a]b - -/a[^bc]d/ - aed - 0: aed - *** Failers -No match - abd -No match - abd -No match - -/a[^-b]c/ - adc - 0: adc - -/a[^]b]c/ - adc - 0: adc - *** Failers -No match - a-c - 0: a-c - a]c -No match - -/\ba\b/ - a- - 0: a - -a - 0: a - -a- - 0: a - -/\by\b/ - *** Failers -No match - xy -No match - yz -No match - xyz -No match - -/\Ba\B/ - *** Failers - 0: a - a- -No match - -a -No match - -a- -No match - -/\By\b/ - xy - 0: y - -/\by\B/ - yz - 0: y - -/\By\B/ - xyz - 0: y - -/\w/ - a - 0: a - -/\W/ - - - 0: - - *** Failers - 0: * - - - 0: - - a -No match - -/a\sb/ - a b - 0: a b - -/a\Sb/ - a-b - 0: a-b - *** Failers -No match - a-b - 0: a-b - a b -No match - -/\d/ - 1 - 0: 1 - -/\D/ - - - 0: - - *** Failers - 0: * - - - 0: - - 1 -No match - -/[\w]/ - a - 0: a - -/[\W]/ - - - 0: - - *** Failers - 0: * - - - 0: - - a -No match - -/a[\s]b/ - a b - 0: a b - -/a[\S]b/ - a-b - 0: a-b - *** Failers -No match - a-b - 0: a-b - a b -No match - -/[\d]/ - 1 - 0: 1 - -/[\D]/ - - - 0: - - *** Failers - 0: * - - - 0: - - 1 -No match - -/ab|cd/ - abc - 0: ab - abcd - 0: ab - -/()ef/ - def - 0: ef - -/$b/ - -/a\(b/ - a(b - 0: a(b - -/a\(*b/ - ab - 0: ab - a((b - 0: a((b - -/a\\b/ - a\b -No match - -/((a))/ - abc - 0: a - -/(a)b(c)/ - abc - 0: abc - -/a+b+c/ - aabbabc - 0: abc - -/a{1,}b{1,}c/ - aabbabc - 0: abc - -/a.+?c/ - abcabc - 0: abcabc - 1: abc - -/(a+|b)*/ - ab - 0: ab - 1: a - 2: - -/(a+|b){0,}/ - ab - 0: ab - 1: a - 2: - -/(a+|b)+/ - ab - 0: ab - 1: a - -/(a+|b){1,}/ - ab - 0: ab - 1: a - -/(a+|b)?/ - ab - 0: a - 1: - -/(a+|b){0,1}/ - ab - 0: a - 1: - -/[^ab]*/ - cde - 0: cde - 1: cd - 2: c - 3: - -/abc/ - *** Failers -No match - b -No match - - -/a*/ - - -/([abc])*d/ - abbbcd - 0: abbbcd - -/([abc])*bcd/ - abcd - 0: abcd - -/a|b|c|d|e/ - e - 0: e - -/(a|b|c|d|e)f/ - ef - 0: ef - -/abcd*efg/ - abcdefg - 0: abcdefg - -/ab*/ - xabyabbbz - 0: ab - 1: a - xayabbbz - 0: a - -/(ab|cd)e/ - abcde - 0: cde - -/[abhgefdc]ij/ - hij - 0: hij - -/^(ab|cd)e/ - -/(abc|)ef/ - abcdef - 0: ef - -/(a|b)c*d/ - abcd - 0: bcd - -/(ab|ab*)bc/ - abc - 0: abc - -/a([bc]*)c*/ - abc - 0: abc - 1: ab - 2: a - -/a([bc]*)(c*d)/ - abcd - 0: abcd - -/a([bc]+)(c*d)/ - abcd - 0: abcd - -/a([bc]*)(c+d)/ - abcd - 0: abcd - -/a[bcd]*dcdcde/ - adcdcde - 0: adcdcde - -/a[bcd]+dcdcde/ - *** Failers -No match - abcde -No match - adcdcde -No match - -/(ab|a)b*c/ - abc - 0: abc - -/((a)(b)c)(d)/ - abcd - 0: abcd - -/[a-zA-Z_][a-zA-Z0-9_]*/ - alpha - 0: alpha - 1: alph - 2: alp - 3: al - 4: a - -/^a(bc+|b[eh])g|.h$/ - abh - 0: bh - -/(bc+d$|ef*g.|h?i(j|k))/ - effgz - 0: effgz - ij - 0: ij - reffgz - 0: effgz - *** Failers -No match - effg -No match - bcdd -No match - -/((((((((((a))))))))))/ - a - 0: a - -/(((((((((a)))))))))/ - a - 0: a - -/multiple words of text/ - *** Failers -No match - aa -No match - uh-uh -No match - -/multiple words/ - multiple words, yeah - 0: multiple words - -/(.*)c(.*)/ - abcde - 0: abcde - 1: abcd - 2: abc - -/\((.*), (.*)\)/ - (a, b) - 0: (a, b) - -/[k]/ - -/abcd/ - abcd - 0: abcd - -/a(bc)d/ - abcd - 0: abcd - -/a[-]?c/ - ac - 0: ac - -/abc/i - ABC - 0: ABC - XABCY - 0: ABC - ABABC - 0: ABC - *** Failers -No match - aaxabxbaxbbx -No match - XBC -No match - AXC -No match - ABX -No match - -/ab*c/i - ABC - 0: ABC - -/ab*bc/i - ABC - 0: ABC - ABBC - 0: ABBC - -/ab*?bc/i - ABBBBC - 0: ABBBBC - -/ab{0,}?bc/i - ABBBBC - 0: ABBBBC - -/ab+?bc/i - ABBC - 0: ABBC - -/ab+bc/i - *** Failers -No match - ABC -No match - ABQ -No match - -/ab{1,}bc/i - -/ab+bc/i - ABBBBC - 0: ABBBBC - -/ab{1,}?bc/i - ABBBBC - 0: ABBBBC - -/ab{1,3}?bc/i - ABBBBC - 0: ABBBBC - -/ab{3,4}?bc/i - ABBBBC - 0: ABBBBC - -/ab{4,5}?bc/i - *** Failers -No match - ABQ -No match - ABBBBC -No match - -/ab??bc/i - ABBC - 0: ABBC - ABC - 0: ABC - -/ab{0,1}?bc/i - ABC - 0: ABC - -/ab??bc/i - -/ab??c/i - ABC - 0: ABC - -/ab{0,1}?c/i - ABC - 0: ABC - -/^abc$/i - ABC - 0: ABC - *** Failers -No match - ABBBBC -No match - ABCC -No match - -/^abc/i - ABCC - 0: ABC - -/^abc$/i - -/abc$/i - AABC - 0: ABC - -/^/i - ABC - 0: - -/$/i - ABC - 0: - -/a.c/i - ABC - 0: ABC - AXC - 0: AXC - -/a.*?c/i - AXYZC - 0: AXYZC - -/a.*c/i - *** Failers -No match - AABC - 0: AABC - AXYZD -No match - -/a[bc]d/i - ABD - 0: ABD - -/a[b-d]e/i - ACE - 0: ACE - *** Failers -No match - ABC -No match - ABD -No match - -/a[b-d]/i - AAC - 0: AC - -/a[-b]/i - A- - 0: A- - -/a[b-]/i - A- - 0: A- - -/a]/i - A] - 0: A] - -/a[]]b/i - A]B - 0: A]B - -/a[^bc]d/i - AED - 0: AED - -/a[^-b]c/i - ADC - 0: ADC - *** Failers -No match - ABD -No match - A-C -No match - -/a[^]b]c/i - ADC - 0: ADC - -/ab|cd/i - ABC - 0: AB - ABCD - 0: AB - -/()ef/i - DEF - 0: EF - -/$b/i - *** Failers -No match - A]C -No match - B -No match - -/a\(b/i - A(B - 0: A(B - -/a\(*b/i - AB - 0: AB - A((B - 0: A((B - -/a\\b/i - A\B -No match - -/((a))/i - ABC - 0: A - -/(a)b(c)/i - ABC - 0: ABC - -/a+b+c/i - AABBABC - 0: ABC - -/a{1,}b{1,}c/i - AABBABC - 0: ABC - -/a.+?c/i - ABCABC - 0: ABCABC - 1: ABC - -/a.*?c/i - ABCABC - 0: ABCABC - 1: ABC - -/a.{0,5}?c/i - ABCABC - 0: ABCABC - 1: ABC - -/(a+|b)*/i - AB - 0: AB - 1: A - 2: - -/(a+|b){0,}/i - AB - 0: AB - 1: A - 2: - -/(a+|b)+/i - AB - 0: AB - 1: A - -/(a+|b){1,}/i - AB - 0: AB - 1: A - -/(a+|b)?/i - AB - 0: A - 1: - -/(a+|b){0,1}/i - AB - 0: A - 1: - -/(a+|b){0,1}?/i - AB - 0: A - 1: - -/[^ab]*/i - CDE - 0: CDE - 1: CD - 2: C - 3: - -/abc/i - -/a*/i - - -/([abc])*d/i - ABBBCD - 0: ABBBCD - -/([abc])*bcd/i - ABCD - 0: ABCD - -/a|b|c|d|e/i - E - 0: E - -/(a|b|c|d|e)f/i - EF - 0: EF - -/abcd*efg/i - ABCDEFG - 0: ABCDEFG - -/ab*/i - XABYABBBZ - 0: AB - 1: A - XAYABBBZ - 0: A - -/(ab|cd)e/i - ABCDE - 0: CDE - -/[abhgefdc]ij/i - HIJ - 0: HIJ - -/^(ab|cd)e/i - ABCDE -No match - -/(abc|)ef/i - ABCDEF - 0: EF - -/(a|b)c*d/i - ABCD - 0: BCD - -/(ab|ab*)bc/i - ABC - 0: ABC - -/a([bc]*)c*/i - ABC - 0: ABC - 1: AB - 2: A - -/a([bc]*)(c*d)/i - ABCD - 0: ABCD - -/a([bc]+)(c*d)/i - ABCD - 0: ABCD - -/a([bc]*)(c+d)/i - ABCD - 0: ABCD - -/a[bcd]*dcdcde/i - ADCDCDE - 0: ADCDCDE - -/a[bcd]+dcdcde/i - -/(ab|a)b*c/i - ABC - 0: ABC - -/((a)(b)c)(d)/i - ABCD - 0: ABCD - -/[a-zA-Z_][a-zA-Z0-9_]*/i - ALPHA - 0: ALPHA - 1: ALPH - 2: ALP - 3: AL - 4: A - -/^a(bc+|b[eh])g|.h$/i - ABH - 0: BH - -/(bc+d$|ef*g.|h?i(j|k))/i - EFFGZ - 0: EFFGZ - IJ - 0: IJ - REFFGZ - 0: EFFGZ - *** Failers -No match - ADCDCDE -No match - EFFG -No match - BCDD -No match - -/((((((((((a))))))))))/i - A - 0: A - -/(((((((((a)))))))))/i - A - 0: A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i - A - 0: A - -/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i - C - 0: C - -/multiple words of text/i - *** Failers -No match - AA -No match - UH-UH -No match - -/multiple words/i - MULTIPLE WORDS, YEAH - 0: MULTIPLE WORDS - -/(.*)c(.*)/i - ABCDE - 0: ABCDE - 1: ABCD - 2: ABC - -/\((.*), (.*)\)/i - (A, B) - 0: (A, B) - -/[k]/i - -/abcd/i - ABCD - 0: ABCD - -/a(bc)d/i - ABCD - 0: ABCD - -/a[-]?c/i - AC - 0: AC - -/a(?!b)./ - abad - 0: ad - -/a(?=d)./ - abad - 0: ad - -/a(?=c|d)./ - abad - 0: ad - -/a(?:b|c|d)(.)/ - ace - 0: ace - -/a(?:b|c|d)*(.)/ - ace - 0: ace - 1: ac - -/a(?:b|c|d)+?(.)/ - ace - 0: ace - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - 2: acdbcd - 3: acdbc - 4: acdb - 5: acd - -/a(?:b|c|d)+(.)/ - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - 2: acdbcd - 3: acdbc - 4: acdb - 5: acd - -/a(?:b|c|d){2}(.)/ - acdbcdbe - 0: acdb - -/a(?:b|c|d){4,5}(.)/ - acdbcdbe - 0: acdbcdb - 1: acdbcd - -/a(?:b|c|d){4,5}?(.)/ - acdbcdbe - 0: acdbcdb - 1: acdbcd - -/((foo)|(bar))*/ - foobar - 0: foobar - 1: foo - 2: - -/a(?:b|c|d){6,7}(.)/ - acdbcdbe - 0: acdbcdbe - -/a(?:b|c|d){6,7}?(.)/ - acdbcdbe - 0: acdbcdbe - -/a(?:b|c|d){5,6}(.)/ - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - -/a(?:b|c|d){5,6}?(.)/ - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - -/a(?:b|c|d){5,7}(.)/ - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - -/a(?:b|c|d){5,7}?(.)/ - acdbcdbe - 0: acdbcdbe - 1: acdbcdb - -/a(?:b|(c|e){1,2}?|d)+?(.)/ - ace - 0: ace - -/^(.+)?B/ - AB - 0: AB - -/^([^a-z])|(\^)$/ - . - 0: . - -/^[<>]&/ - <&OUT - 0: <& - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - 0: foobar - 1: foo - 2: - -/(?<=a)b/ - ab - 0: b - *** Failers -No match - cb -No match - b -No match - -/(?<!c)b/ - ab - 0: b - b - 0: b - b - 0: b - -/(?:..)*a/ - aba - 0: aba - 1: a - -/(?:..)*?a/ - aba - 0: aba - 1: a - -/^(){3,5}/ - abc - 0: - -/^(a+)*ax/ - aax - 0: aax - -/^((a|b)+)*ax/ - aax - 0: aax - -/^((a|bc)+)*ax/ - aax - 0: aax - -/(a|x)*ab/ - cab - 0: ab - -/(a)*ab/ - cab - 0: ab - -/(?:(?i)a)b/ - ab - 0: ab - -/((?i)a)b/ - ab - 0: ab - -/(?:(?i)a)b/ - Ab - 0: Ab - -/((?i)a)b/ - Ab - 0: Ab - -/(?:(?i)a)b/ - *** Failers -No match - cb -No match - aB -No match - -/((?i)a)b/ - -/(?i:a)b/ - ab - 0: ab - -/((?i:a))b/ - ab - 0: ab - -/(?i:a)b/ - Ab - 0: Ab - -/((?i:a))b/ - Ab - 0: Ab - -/(?i:a)b/ - *** Failers -No match - aB -No match - aB -No match - -/((?i:a))b/ - -/(?:(?-i)a)b/i - ab - 0: ab - -/((?-i)a)b/i - ab - 0: ab - -/(?:(?-i)a)b/i - aB - 0: aB - -/((?-i)a)b/i - aB - 0: aB - -/(?:(?-i)a)b/i - *** Failers -No match - aB - 0: aB - Ab -No match - -/((?-i)a)b/i - -/(?:(?-i)a)b/i - aB - 0: aB - -/((?-i)a)b/i - aB - 0: aB - -/(?:(?-i)a)b/i - *** Failers -No match - Ab -No match - AB -No match - -/((?-i)a)b/i - -/(?-i:a)b/i - ab - 0: ab - -/((?-i:a))b/i - ab - 0: ab - -/(?-i:a)b/i - aB - 0: aB - -/((?-i:a))b/i - aB - 0: aB - -/(?-i:a)b/i - *** Failers -No match - AB -No match - Ab -No match - -/((?-i:a))b/i - -/(?-i:a)b/i - aB - 0: aB - -/((?-i:a))b/i - aB - 0: aB - -/(?-i:a)b/i - *** Failers -No match - Ab -No match - AB -No match - -/((?-i:a))b/i - -/((?-i:a.))b/i - *** Failers -No match - AB -No match - a\nB -No match - -/((?s-i:a.))b/i - a\nB - 0: a\x0aB - -/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ - cabbbb - 0: cabbbb - -/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ - caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - 0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - -/foo\w*\d{4}baz/ - foobar1234baz - 0: foobar1234baz - -/x(~~)*(?:(?:F)?)?/ - x~~ - 0: x~~ - 1: x - -/^a(?#xxx){3}c/ - aaac - 0: aaac - -/^a (?#xxx) (?#yyy) {3}c/x - aaac - 0: aaac - -/(?<![cd])b/ - *** Failers -No match - B\nB -No match - dbcb -No match - -/(?<![cd])[ab]/ - dbaacb - 0: a - -/(?<!(c|d))b/ - -/(?<!(c|d))[ab]/ - dbaacb - 0: a - -/(?<!cd)[ab]/ - cdaccb - 0: b - -/^(?:a?b?)*$/ - *** Failers -No match - dbcb -No match - a-- -No match - -/((?s)^a(.))((?m)^b$)/ - a\nb\nc\n - 0: a\x0ab - -/((?m)^b$)/ - a\nb\nc\n - 0: b - -/(?m)^b/ - a\nb\n - 0: b - -/(?m)^(b)/ - a\nb\n - 0: b - -/((?m)^b)/ - a\nb\n - 0: b - -/\n((?m)^b)/ - a\nb\n - 0: \x0ab - -/((?s).)c(?!.)/ - a\nb\nc\n - 0: \x0ac - a\nb\nc\n - 0: \x0ac - -/((?s)b.)c(?!.)/ - a\nb\nc\n - 0: b\x0ac - a\nb\nc\n - 0: b\x0ac - -/^b/ - -/()^b/ - *** Failers -No match - a\nb\nc\n -No match - a\nb\nc\n -No match - -/((?m)^b)/ - a\nb\nc\n - 0: b - -/(?(?!a)a|b)/ - -/(?(?!a)b|a)/ - a - 0: a - -/(?(?=a)b|a)/ - *** Failers -No match - a -No match - a -No match - -/(?(?=a)a|b)/ - a - 0: a - -/(\w+:)+/ - one: - 0: one: - -/$(?<=^(a))/ - a - 0: - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - xy:z:::abcd - 0: xy:z:::abcd - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - -/(a*)b+/ - caab - 0: aab - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - xy:z:::abcd - 0: xy:z:::abcd - *** Failers - 0: Failers - abcd: -No match - abcd: -No match - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - -/(>a+)ab/ - -/(?>a+)b/ - aaab - 0: aaab - -/([[:]+)/ - a:[b]: - 0: :[ - 1: : - -/([[=]+)/ - a=[b]= - 0: =[ - 1: = - -/([[.]+)/ - a.[b]. - 0: .[ - 1: . - -/((?>a+)b)/ - aaab - 0: aaab - -/(?>(a+))b/ - aaab - 0: aaab - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: abc(ade)ufh()() - 2: abc(ade)ufh() - 3: abc(ade)ufh - 4: abc(ade) - 5: abc - -/a\Z/ - *** Failers -No match - aaab -No match - a\nb\n -No match - -/b\Z/ - a\nb\n - 0: b - -/b\z/ - -/b\Z/ - a\nb - 0: b - -/b\z/ - a\nb - 0: b - *** Failers -No match - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - 0: alphabetabcd - endingwxyz - 0: endingwxyz - *** Failers -No match - a rather long string that doesn't end with one of them -No match - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/(?<=\d{3}(?!999))foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match - -/(?<=(?!...999)\d{3})foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo - *** Failers -No match - 123999foo -No match - -/(?<=\d{3}...)(?<!999)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo - *** Failers -No match - 123999foo -No match - -/((Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: Z - 2: - -/(Z()|A)*/ - ZABCDEFG - 0: ZA - 1: Z - 2: - -/(Z(())|A)*/ - ZABCDEFG - 0: ZA - 1: Z - 2: - -/((?>Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: Z - 2: - -/((?>)+|A)*/ - ZABCDEFG - 0: - -/a*/g - abbab - 0: a - 1: - 0: - 0: - 0: a - 1: - 0: - 0: - -/^[a-\d]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match - -/^[\d-a]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - 1: \x09\x0a\x0c\x0d - 2: \x09\x0a\x0c - 3: \x09\x0a - 4: \x09 - 5: - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09 - 1: - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - 1: \x09\x0a\x0c - 2: \x09\x0a - 3: \x09 - 4: - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - 1: \x09\x0a\x0c - 2: \x09\x0a - 3: \x09 - 4: - -/a b/x - ab -No match - -/(?!\A)x/m - a\nxb\n - 0: x - -/(?!^)x/m - a\nxb\n -No match - -/abc\Qabc\Eabc/ - abcabcabc - 0: abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc - 0: abc(*+|abc - -/ abc\Q abc\Eabc/x - abc abcabc - 0: abc abcabc - *** Failers -No match - abcabcabc -No match - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/\Qabc\$xyz\E/ - abc\\\$xyz - 0: abc\$xyz - -/\Qabc\E\$\Qxyz\E/ - abc\$xyz - 0: abc$xyz - -/\Gabc/ - abc - 0: abc - *** Failers -No match - xyzabc -No match - -/\Gabc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 - -/abc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 - 0: abc3 - -/a(?x: b c )d/ - XabcdY - 0: abcd - *** Failers -No match - Xa b c d Y -No match - -/((?x)x y z | a b c)/ - XabcY - 0: abc - AxyzB - 0: xyz - -/(?i)AB(?-i)C/ - XabCY - 0: abC - *** Failers -No match - XabcY -No match - -/((?i)AB(?-i)C|D)E/ - abCE - 0: abCE - DE - 0: DE - *** Failers -No match - abcE -No match - abCe -No match - dE -No match - De -No match - -/[z\Qa-d]\E]/ - z - 0: z - a - 0: a - - - 0: - - d - 0: d - ] - 0: ] - *** Failers - 0: a - b -No match - -/[\z\C]/ - z - 0: z - C - 0: C - -/\M/ - M - 0: M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - 0: REGular - regulaer - 0: regulaer - Regex - 0: Regex - regulär - 0: regul\xe4r - -/Ċĉċä[à-˙À-ß]+/ - Ċĉċäà - 0: \xc5\xe6\xe5\xe4\xe0 - Ċĉċä˙ - 0: \xc5\xe6\xe5\xe4\xff - ĊĉċäÀ - 0: \xc5\xe6\xe5\xe4\xc0 - Ċĉċäß - 0: \xc5\xe6\xe5\xe4\xdf - -/(?<=Z)X./ - \x84XAZXB - 0: XB - -/^(?(2)a|(1)(2))+$/ - 123a -Error -17 - -/(?<=a|bbbb)c/ - ac - 0: c - bbbbc - 0: c - -/abc/>testsavedregex -Compiled regex written to testsavedregex -<testsavedregex -Compiled regex loaded from testsavedregex -No study data - abc - 0: abc - *** Failers -No match - bca -No match - -/abc/F>testsavedregex -Compiled regex written to testsavedregex -<testsavedregex -Compiled regex (byte-inverted) loaded from testsavedregex -No study data - abc - 0: abc - *** Failers -No match - bca -No match - -/(a|b)/S>testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex -<testsavedregex -Compiled regex loaded from testsavedregex -Study data loaded from testsavedregex - abc - 0: a - *** Failers - 0: a - def -No match - -/(a|b)/SF>testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex -<testsavedregex -Compiled regex (byte-inverted) loaded from testsavedregex -Study data loaded from testsavedregex - abc - 0: a - *** Failers - 0: a - def -No match - -/line\nbreak/ - this is a line\nbreak - 0: line\x0abreak - line one\nthis is a line\nbreak in the second line - 0: line\x0abreak - -/line\nbreak/f - this is a line\nbreak - 0: line\x0abreak - ** Failers -No match - line one\nthis is a line\nbreak in the second line -No match - -/line\nbreak/mf - this is a line\nbreak - 0: line\x0abreak - ** Failers -No match - line one\nthis is a line\nbreak in the second line -No match - -/ End of testinput7 / diff --git a/ext/pcre/pcrelib/testdata/testoutput8 b/ext/pcre/pcrelib/testdata/testoutput8 deleted file mode 100644 index eb585ad1ae699..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput8 +++ /dev/null @@ -1,1033 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/-- Do not use the \x{} construct except with patterns that have the --/ -/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ -No match -/-- that option is set. However, the latest Perls recognize them always. --/ -No match - -/\x{100}ab/8 - \x{100}ab - 0: \x{100}ab - -/a\x{100}*b/8 - ab - 0: ab - a\x{100}b - 0: a\x{100}b - a\x{100}\x{100}b - 0: a\x{100}\x{100}b - -/a\x{100}+b/8 - a\x{100}b - 0: a\x{100}b - a\x{100}\x{100}b - 0: a\x{100}\x{100}b - *** Failers -No match - ab -No match - -/\bX/8 - Xoanon - 0: X - +Xoanon - 0: X - \x{300}Xoanon - 0: X - *** Failers -No match - YXoanon -No match - -/\BX/8 - YXoanon - 0: X - *** Failers -No match - Xoanon -No match - +Xoanon -No match - \x{300}Xoanon -No match - -/X\b/8 - X+oanon - 0: X - ZX\x{300}oanon - 0: X - FAX - 0: X - *** Failers -No match - Xoanon -No match - -/X\B/8 - Xoanon - 0: X - *** Failers -No match - X+oanon -No match - ZX\x{300}oanon -No match - FAX -No match - -/[^a]/8 - abcd - 0: b - a\x{100} - 0: \x{100} - -/^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 - ab99 - 0: ab9 - \x{123}\x{123}45 - 0: \x{123}\x{123}4 - \x{400}\x{401}\x{402}6 - 0: \x{400}\x{401}\x{402}6 - *** Failers -No match - d99 -No match - \x{123}\x{122}4 -No match - \x{400}\x{403}6 -No match - \x{400}\x{401}\x{402}\x{402}6 -No match - -/abc/8 - ] -Error -10 - -Error -10 - -Error -10 - \? -No match - -/a.b/8 - acb - 0: acb - a\x7fb - 0: a\x{7f}b - a\x{100}b - 0: a\x{100}b - *** Failers -No match - a\nb -No match - -/a(.{3})b/8 - a\x{4000}xyb - 0: a\x{4000}xyb - a\x{4000}\x7fyb - 0: a\x{4000}\x{7f}yb - a\x{4000}\x{100}yb - 0: a\x{4000}\x{100}yb - *** Failers -No match - a\x{4000}b -No match - ac\ncb -No match - -/a(.*?)(.)/ - a\xc0\x88b - 0: a\xc0\x88b - 1: a\xc0\x88 - 2: a\xc0 - -/a(.*?)(.)/8 - a\x{100}b - 0: a\x{100}b - 1: a\x{100} - -/a(.*)(.)/ - a\xc0\x88b - 0: a\xc0\x88b - 1: a\xc0\x88 - 2: a\xc0 - -/a(.*)(.)/8 - a\x{100}b - 0: a\x{100}b - 1: a\x{100} - -/a(.)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - -/a(.)(.)/8 - a\x{240}bcd - 0: a\x{240}b - -/a(.?)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: a\xc0 - -/a(.?)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: a\x{240} - -/a(.??)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: a\xc0 - -/a(.??)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: a\x{240} - -/a(.{3})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - *** Failers -No match - a\x{1234}b -No match - ac\ncb -No match - -/a(.{3,})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxbcdefghijb - 1: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers -No match - a\x{1234}b -No match - -/a(.{3,}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxbcdefghijb - 1: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - *** Failers -No match - a\x{1234}b -No match - -/a(.{3,5})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - 0: axbxxb - axxxxxbcdefghijb - 0: axxxxxb - *** Failers -No match - a\x{1234}b -No match - axxxxxxbcdefghijb -No match - -/a(.{3,5}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - 0: axbxxb - axxxxxbcdefghijb - 0: axxxxxb - *** Failers -No match - a\x{1234}b -No match - axxxxxxbcdefghijb -No match - -/^[a\x{c0}]/8 - *** Failers -No match - \x{100} -No match - -/(?<=aXb)cd/8 - aXbcd - 0: cd - -/(?<=a\x{100}b)cd/8 - a\x{100}bcd - 0: cd - -/(?<=a\x{100000}b)cd/8 - a\x{100000}bcd - 0: cd - -/(?:\x{100}){3}b/8 - \x{100}\x{100}\x{100}b - 0: \x{100}\x{100}\x{100}b - *** Failers -No match - \x{100}\x{100}b -No match - -/\x{ab}/8 - \x{ab} - 0: \x{ab} - \xc2\xab - 0: \x{ab} - *** Failers -No match - \x00{ab} -No match - -/(?<=(.))X/8 - WXYZ - 0: X - \x{256}XYZ - 0: X - *** Failers -No match - XYZ -No match - -/[^a]+/8g - bcd - 0: bcd - 1: bc - 2: b - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - 1: Y\x{256} - 2: Y - -/^[^a]{2}/8 - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8 - \x{100}bcAa - 0: \x{100}bcA - 1: \x{100}bc - 2: \x{100}b - -/^[^a]{2,}?/8 - \x{100}bca - 0: \x{100}bc - 1: \x{100}b - -/[^a]+/8ig - bcd - 0: bcd - 1: bc - 2: b - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - 1: Y\x{256} - 2: Y - -/^[^a]{2}/8i - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8i - \x{100}bcAa - 0: \x{100}bc - 1: \x{100}b - -/^[^a]{2,}?/8i - \x{100}bca - 0: \x{100}bc - 1: \x{100}b - -/\x{100}{0,0}/8 - abcd - 0: - -/\x{100}?/8 - abcd - 0: - \x{100}\x{100} - 0: \x{100} - 1: - -/\x{100}{0,3}/8 - \x{100}\x{100} - 0: \x{100}\x{100} - 1: \x{100} - 2: - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - 1: \x{100}\x{100} - 2: \x{100} - 3: - -/\x{100}*/8 - abce - 0: - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100} - 2: \x{100}\x{100} - 3: \x{100} - 4: - -/\x{100}{1,1}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100} - -/\x{100}{1,3}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - 1: \x{100}\x{100} - 2: \x{100} - -/\x{100}+/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100} - 2: \x{100}\x{100} - 3: \x{100} - -/\x{100}{3}/8 - abcd\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100} - -/\x{100}{3,5}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100} - -/\x{100}{3,}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100}\x{100}\x{100} - 3: \x{100}\x{100}\x{100}\x{100} - 4: \x{100}\x{100}\x{100} - -/(?<=a\x{100}{2}b)X/8 - Xyyya\x{100}\x{100}bXzzz - 0: X - -/\D*/8 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\D*/8 - \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -Matched, but too many subsidiary matches - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 3: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 4: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 5: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 6: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 7: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 8: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 9: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -10: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -11: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -12: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -13: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -14: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -15: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -16: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -17: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -18: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -19: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -20: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -21: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/\D/8 - 1X2 - 0: X - 1\x{100}2 - 0: \x{100} - -/>\S/8 - > >X Y - 0: >X - > >\x{100} Y - 0: >\x{100} - -/\d/8 - \x{100}3 - 0: 3 - -/\s/8 - \x{100} X - 0: - -/\D+/8 - 12abcd34 - 0: abcd - 1: abc - 2: ab - 3: a - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - 7: *** - 8: *** - 9: ** -10: * - 1234 -No match - -/\D{2,3}/8 - 12abcd34 - 0: abc - 1: ab - 12ab34 - 0: ab - *** Failers - 0: *** - 1: ** - 1234 -No match - 12a34 -No match - -/\D{2,3}?/8 - 12abcd34 - 0: abc - 1: ab - 12ab34 - 0: ab - *** Failers - 0: *** - 1: ** - 1234 -No match - 12a34 -No match - -/\d+/8 - 12abcd34 - 0: 12 - 1: 1 - *** Failers -No match - -/\d{2,3}/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers -No match - 1.4 -No match - -/\d{2,3}?/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers -No match - 1.4 -No match - -/\S+/8 - 12abcd34 - 0: 12abcd34 - 1: 12abcd3 - 2: 12abcd - 3: 12abc - 4: 12ab - 5: 12a - 6: 12 - 7: 1 - *** Failers - 0: *** - 1: ** - 2: * - \ \ -No match - -/\S{2,3}/8 - 12abcd34 - 0: 12a - 1: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers - 0: *** - 1: ** - \ \ -No match - -/\S{2,3}?/8 - 12abcd34 - 0: 12a - 1: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers - 0: *** - 1: ** - \ \ -No match - -/>\s+</8 - 12> <34 - 0: > < - *** Failers -No match - -/>\s{2,3}</8 - ab> <cd - 0: > < - ab> <ce - 0: > < - *** Failers -No match - ab> <cd -No match - -/>\s{2,3}?</8 - ab> <cd - 0: > < - ab> <ce - 0: > < - *** Failers -No match - ab> <cd -No match - -/\w+/8 - 12 34 - 0: 12 - 1: 1 - *** Failers - 0: Failers - 1: Failer - 2: Faile - 3: Fail - 4: Fai - 5: Fa - 6: F - +++=*! -No match - -/\w{2,3}/8 - ab cd - 0: ab - abcd ce - 0: abc - 1: ab - *** Failers - 0: Fai - 1: Fa - a.b.c -No match - -/\w{2,3}?/8 - ab cd - 0: ab - abcd ce - 0: abc - 1: ab - *** Failers - 0: Fai - 1: Fa - a.b.c -No match - -/\W+/8 - 12====34 - 0: ==== - 1: === - 2: == - 3: = - *** Failers - 0: *** - 1: *** - 2: ** - 3: * - abcd -No match - -/\W{2,3}/8 - ab====cd - 0: === - 1: == - ab==cd - 0: == - *** Failers - 0: *** - 1: ** - a.b.c -No match - -/\W{2,3}?/8 - ab====cd - 0: === - 1: == - ab==cd - 0: == - *** Failers - 0: *** - 1: ** - a.b.c -No match - -/[\x{100}]/8 - \x{100} - 0: \x{100} - Z\x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[Z\x{100}]/8 - Z\x{100} - 0: Z - \x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match - -/[\x{100}\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - *** Failers -No match - -/[\x{100}-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - *** Failers -No match - -/[z-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - abzcd - 0: z - ab|cd - 0: | - *** Failers -No match - -/[Q\x{100}\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - Q? - 0: Q - *** Failers -No match - -/[Q\x{100}-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - Q? - 0: Q - *** Failers -No match - -/[Qz-\x{200}]/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{111}cd - 0: \x{111} - abzcd - 0: z - ab|cd - 0: | - Q? - 0: Q - *** Failers -No match - -/[\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - 1: \x{200}\x{100} - 2: \x{200} - *** Failers -No match - -/[\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - 1: \x{200}\x{100} - 2: \x{200} - *** Failers -No match - -/[Q\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - 1: \x{200}\x{100} - 2: \x{200} - *** Failers -No match - -/[Q\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - 0: \x{100} - ab\x{200}cd - 0: \x{200} - ab\x{200}\x{100}\x{200}\x{100}cd - 0: \x{200}\x{100}\x{200} - 1: \x{200}\x{100} - 2: \x{200} - *** Failers -No match - -/(?<=[\x{100}\x{200}])X/8 - abc\x{200}X - 0: X - abc\x{100}X - 0: X - *** Failers -No match - X -No match - -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - 0: X - abc\x{100}X - 0: X - abQX - 0: X - *** Failers -No match - X -No match - -/(?<=[\x{100}\x{200}]{3})X/8 - abc\x{100}\x{200}\x{100}X - 0: X - *** Failers -No match - abc\x{200}X -No match - X -No match - -/[^\x{100}\x{200}]X/8 - AX - 0: AX - \x{150}X - 0: \x{150}X - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{200}X -No match - -/[^Q\x{100}\x{200}]X/8 - AX - 0: AX - \x{150}X - 0: \x{150}X - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{200}X -No match - QX -No match - -/[^\x{100}-\x{200}]X/8 - AX - 0: AX - \x{500}X - 0: \x{500}X - *** Failers -No match - \x{100}X -No match - \x{150}X -No match - \x{200}X -No match - -/[z-\x{100}]/8i - z - 0: z - Z - 0: Z - \x{100} - 0: \x{100} - *** Failers -No match - \x{102} -No match - y -No match - -/[\xFF]/ - >\xff< - 0: \xff - -/[\xff]/8 - >\x{ff}< - 0: \x{ff} - -/[^\xFF]/ - XYZ - 0: X - -/[^\xff]/8 - XYZ - 0: X - \x{123} - 0: \x{123} - -/^[ac]*b/8 - xb -No match - -/^[ac\x{100}]*b/8 - xb -No match - -/^[^x]*b/8i - xb -No match - -/^[^x]*b/8 - xb -No match - -/^\d*b/8 - xb -No match - -/(|a)/g8 - catac - 0: - 0: a - 1: - 0: - 0: a - 1: - 0: - 0: - a\x{256}a - 0: a - 1: - 0: - 0: a - 1: - 0: - -/^\x{85}$/8i - \x{85} - 0: \x{85} - -/ End of testinput 8 / diff --git a/ext/pcre/pcrelib/testdata/testoutput9 b/ext/pcre/pcrelib/testdata/testoutput9 deleted file mode 100644 index f7b46611d05a3..0000000000000 --- a/ext/pcre/pcrelib/testdata/testoutput9 +++ /dev/null @@ -1,1234 +0,0 @@ -PCRE version 6.2 01-Aug-2005 - -/\pL\P{Nd}/8 - AB - 0: AB - *** Failers - 0: Fa - A0 -No match - 00 -No match - -/\X./8 - AB - 0: AB - A\x{300}BC - 0: A\x{300}B - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302}B - *** Failers - 0: ** - \x{300} -No match - -/\X\X/8 - ABC - 0: AB - A\x{300}B\x{300}\x{301}C - 0: A\x{300}B\x{300}\x{301} - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302}B - *** Failers - 0: ** - \x{300} -No match - -/^\pL+/8 - abcd - 0: abcd - 1: abc - 2: ab - 3: a - a - 0: a - *** Failers -No match - -/^\PL+/8 - 1234 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - = - 0: = - *** Failers - 0: *** - 1: *** - 2: ** - 3: * - abcd -No match - -/^\X+/8 - abcdA\x{300}\x{301}\x{302} - 0: abcdA\x{300}\x{301}\x{302} - 1: abcd - 2: abc - 3: ab - 4: a - A\x{300}\x{301}\x{302} - 0: A\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - 1: A\x{300}\x{301}\x{302} - a - 0: a - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - 7: *** - 8: *** - 9: ** -10: * - \x{300}\x{301}\x{302} -No match - -/\X?abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}abc - \x{300}abc - 0: abc - *** Failers -No match - -/^\X?abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - *** Failers -No match - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz -No match - \x{300}abc -No match - -/\X*abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc - \x{300}abc - 0: abc - *** Failers -No match - -/^\X*abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc - *** Failers -No match - \x{300}abc -No match - -/^\pL?=./8 - A=b - 0: A=b - =c - 0: =c - *** Failers -No match - 1=2 -No match - AAAA=b -No match - -/^\pL*=./8 - AAAA=b - 0: AAAA=b - =c - 0: =c - *** Failers -No match - 1=2 -No match - -/^\X{2,3}X/8 - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - *** Failers -No match - X -No match - A\x{300}\x{301}\x{302}X -No match - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X -No match - -/^\pC\pL\pM\pN\pP\pS\pZ</8 - \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - 0: \x{7f}\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}< - \np\x{300}9!\$ < - 0: \x{0a}p\x{300}9!$ < - ** Failers -No match - ap\x{300}9!\$ < -No match - -/^\PC/8 - X - 0: X - ** Failers - 0: * - \x7f -No match - -/^\PL/8 - 9 - 0: 9 - ** Failers - 0: * - \x{c0} -No match - -/^\PM/8 - X - 0: X - ** Failers - 0: * - \x{30f} -No match - -/^\PN/8 - X - 0: X - ** Failers - 0: * - \x{660} -No match - -/^\PP/8 - X - 0: X - ** Failers -No match - \x{66c} -No match - -/^\PS/8 - X - 0: X - ** Failers - 0: * - \x{f01} -No match - -/^\PZ/8 - X - 0: X - ** Failers - 0: * - \x{1680} -No match - -/^\p{Cc}/8 - \x{017} - 0: \x{17} - \x{09f} - 0: \x{9f} - ** Failers -No match - \x{0600} -No match - -/^\p{Cf}/8 - \x{601} - 0: \x{601} - ** Failers -No match - \x{09f} -No match - -/^\p{Cn}/8 - ** Failers -No match - \x{09f} -No match - -/^\p{Co}/8 - \x{f8ff} - 0: \x{f8ff} - ** Failers -No match - \x{09f} -No match - -/^\p{Cs}/8 - \x{dfff} - 0: \x{dfff} - ** Failers -No match - \x{09f} -No match - -/^\p{Ll}/8 - a - 0: a - ** Failers -No match - Z -No match - \x{dfff} -No match - -/^\p{Lm}/8 - \x{2b0} - 0: \x{2b0} - ** Failers -No match - a -No match - -/^\p{Lo}/8 - \x{1bb} - 0: \x{1bb} - ** Failers -No match - a -No match - \x{2b0} -No match - -/^\p{Lt}/8 - \x{1c5} - 0: \x{1c5} - ** Failers -No match - a -No match - \x{2b0} -No match - -/^\p{Lu}/8 - A - 0: A - ** Failers -No match - \x{2b0} -No match - -/^\p{Mc}/8 - \x{903} - 0: \x{903} - ** Failers -No match - X -No match - \x{300} -No match - -/^\p{Me}/8 - \x{488} - 0: \x{488} - ** Failers -No match - X -No match - \x{903} -No match - \x{300} -No match - -/^\p{Mn}/8 - \x{300} - 0: \x{300} - ** Failers -No match - X -No match - \x{903} -No match - -/^\p{Nd}+/8 - 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a} - 0: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669} - 1: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668} - 2: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667} - 3: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666} - 4: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665} - 5: 0123456789\x{660}\x{661}\x{662}\x{663}\x{664} - 6: 0123456789\x{660}\x{661}\x{662}\x{663} - 7: 0123456789\x{660}\x{661}\x{662} - 8: 0123456789\x{660}\x{661} - 9: 0123456789\x{660} -10: 0123456789 -11: 012345678 -12: 01234567 -13: 0123456 -14: 012345 -15: 01234 -16: 0123 -17: 012 -18: 01 -19: 0 - \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa} - 0: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9} - 1: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8} - 2: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7} - 3: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6} - 4: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5} - 5: \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4} - 6: \x{6f0}\x{6f1}\x{6f2}\x{6f3} - 7: \x{6f0}\x{6f1}\x{6f2} - 8: \x{6f0}\x{6f1} - 9: \x{6f0} - \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970} - 0: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f} - 1: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e} - 2: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d} - 3: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c} - 4: \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b} - 5: \x{966}\x{967}\x{968}\x{969}\x{96a} - 6: \x{966}\x{967}\x{968}\x{969} - 7: \x{966}\x{967}\x{968} - 8: \x{966}\x{967} - 9: \x{966} - ** Failers -No match - X -No match - -/^\p{Nl}/8 - \x{16ee} - 0: \x{16ee} - ** Failers -No match - X -No match - \x{966} -No match - -/^\p{No}/8 - \x{b2} - 0: \x{b2} - \x{b3} - 0: \x{b3} - ** Failers -No match - X -No match - \x{16ee} -No match - -/^\p{Pc}/8 - \x5f - 0: _ - \x{203f} - 0: \x{203f} - ** Failers -No match - X -No match - - -No match - \x{58a} -No match - -/^\p{Pd}/8 - - - 0: - - \x{58a} - 0: \x{58a} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Pe}/8 - ) - 0: ) - ] - 0: ] - } - 0: } - \x{f3b} - 0: \x{f3b} - ** Failers -No match - X -No match - \x{203f} -No match - ( -No match - [ -No match - { -No match - \x{f3c} -No match - -/^\p{Pf}/8 - \x{bb} - 0: \x{bb} - \x{2019} - 0: \x{2019} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Pi}/8 - \x{ab} - 0: \x{ab} - \x{2018} - 0: \x{2018} - ** Failers -No match - X -No match - \x{203f} -No match - -/^\p{Po}/8 - ! - 0: ! - \x{37e} - 0: \x{37e} - ** Failers - 0: * - X -No match - \x{203f} -No match - -/^\p{Ps}/8 - ( - 0: ( - [ - 0: [ - { - 0: { - \x{f3c} - 0: \x{f3c} - ** Failers -No match - X -No match - ) -No match - ] -No match - } -No match - \x{f3b} -No match - -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - 0: $\x{a2}\x{a3}\x{a4}\x{a5} - 1: $\x{a2}\x{a3}\x{a4} - 2: $\x{a2}\x{a3} - 3: $\x{a2} - 4: $ - \x{9f2} - 0: \x{9f2} - ** Failers -No match - X -No match - \x{2c2} -No match - -/^\p{Sk}/8 - \x{2c2} - 0: \x{2c2} - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{Sm}+/8 - +<|~\x{ac}\x{2044} - 0: +<|~\x{ac}\x{2044} - 1: +<|~\x{ac} - 2: +<|~ - 3: +<| - 4: +< - 5: + - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{So}/8 - \x{a6} - 0: \x{a6} - \x{482} - 0: \x{482} - ** Failers -No match - X -No match - \x{9f2} -No match - -/^\p{Zl}/8 - \x{2028} - 0: \x{2028} - ** Failers -No match - X -No match - \x{2029} -No match - -/^\p{Zp}/8 - \x{2029} - 0: \x{2029} - ** Failers -No match - X -No match - \x{2028} -No match - -/^\p{Zs}/8 - \ \ - 0: - \x{a0} - 0: \x{a0} - \x{1680} - 0: \x{1680} - \x{180e} - 0: \x{180e} - \x{2000} - 0: \x{2000} - \x{2001} - 0: \x{2001} - ** Failers -No match - \x{2028} -No match - \x{200d} -No match - -/\p{Nd}+(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - 2: \x{660}\x{661}\x{662} - -/\p{Nd}+?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - 2: \x{660}\x{661}\x{662} - -/\p{Nd}{2,}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - -/\p{Nd}{2,}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - -/\p{Nd}*(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - 2: \x{660}\x{661}\x{662} - 3: \x{660}\x{661} - -/\p{Nd}*?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - 2: \x{660}\x{661}\x{662} - 3: \x{660}\x{661} - -/\p{Nd}{2}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}A - -/\p{Nd}{2,3}(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - -/\p{Nd}{2,3}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - 1: \x{660}\x{661}\x{662}A - -/\p{Nd}?(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662} - 1: \x{660}\x{661} - -/\p{Nd}??(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662} - 1: \x{660}\x{661} - -/\p{Nd}*+(..)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}AB - -/\p{Nd}*+(...)/8 - \x{660}\x{661}\x{662}ABC - 0: \x{660}\x{661}\x{662}ABC - -/\p{Nd}*+(....)/8 - ** Failers - 0: ** F - \x{660}\x{661}\x{662}ABC -No match - -/\p{Lu}/8i - A - 0: A - a\x{10a0}B - 0: \x{10a0} - ** Failers - 0: F - a -No match - \x{1d00} -No match - -/\p{^Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - -/\P{Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - -/(?<=A\p{Nd})XYZ/8 - A2XYZ - 0: XYZ - 123A5XYZPQR - 0: XYZ - ABA\x{660}XYZpqr - 0: XYZ - ** Failers -No match - AXYZ -No match - XYZ -No match - -/(?<!\pL)XYZ/8 - 1XYZ - 0: XYZ - AB=XYZ.. - 0: XYZ - XYZ - 0: XYZ - ** Failers -No match - WXYZ -No match - -/[\p{Nd}]/8 - 1234 - 0: 1 - -/[\p{Nd}+-]+/8 - 1234 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - 12-34 - 0: 12-34 - 1: 12-3 - 2: 12- - 3: 12 - 4: 1 - 12+\x{661}-34 - 0: 12+\x{661}-34 - 1: 12+\x{661}-3 - 2: 12+\x{661}- - 3: 12+\x{661} - 4: 12+ - 5: 12 - 6: 1 - ** Failers -No match - abcd -No match - -/[\P{Nd}]+/8 - abcd - 0: abcd - 1: abc - 2: ab - 3: a - ** Failers - 0: ** Failers - 1: ** Failer - 2: ** Faile - 3: ** Fail - 4: ** Fai - 5: ** Fa - 6: ** F - 7: ** - 8: ** - 9: * - 1234 -No match - -/\D+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\P{Nd}+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\pL/8 - a - 0: a - A - 0: A - -/\pL/8i - a - 0: a - A - 0: A - -/\p{Lu}/8 - A - 0: A - aZ - 0: Z - ** Failers - 0: F - abc -No match - -/\p{Lu}/8i - A - 0: A - aZ - 0: Z - ** Failers - 0: F - abc -No match - -/\p{Ll}/8 - a - 0: a - Az - 0: z - ** Failers - 0: a - ABC -No match - -/\p{Ll}/8i - a - 0: a - Az - 0: z - ** Failers - 0: a - ABC -No match - -/^\x{c0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/^\x{e0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb0} - ** Failers -No match - a\x{391}\x{10427}\x{ff3a}\x{1fb0} -No match - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} -No match - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} -No match - A\x{391}\x{10427}\x{ff5a}\x{1fb0} -No match - A\x{391}\x{10427}\x{ff3a}\x{1fb8} -No match - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8i - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb0} - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - 0: a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - 0: A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - 0: A\x{391}\x{1044f}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - 0: A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - 0: A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/\x{391}+/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - 1: \x{391}\x{3b1}\x{3b1}\x{3b1} - 2: \x{391}\x{3b1}\x{3b1} - 3: \x{391}\x{3b1} - 4: \x{391} - -/\x{391}{3,5}(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 1: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - 2: \x{391}\x{3b1}\x{3b1}\x{3b1} - -/\x{391}{3,5}?(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - 1: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - 2: \x{391}\x{3b1}\x{3b1}\x{3b1} - -/[\x{391}\x{ff3a}]/8i - \x{391} - 0: \x{391} - \x{ff3a} - 0: \x{ff3a} - \x{3b1} - 0: \x{3b1} - \x{ff5a} - 0: \x{ff5a} - -/[\x{c0}\x{391}]/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/[\x{105}-\x{109}]/8i - \x{104} - 0: \x{104} - \x{105} - 0: \x{105} - \x{109} - 0: \x{109} - ** Failers -No match - \x{100} -No match - \x{10a} -No match - -/[z-\x{100}]/8i - Z - 0: Z - z - 0: z - \x{39c} - 0: \x{39c} - \x{178} - 0: \x{178} - | - 0: | - \x{80} - 0: \x{80} - \x{ff} - 0: \x{ff} - \x{100} - 0: \x{100} - \x{101} - 0: \x{101} - ** Failers -No match - \x{102} -No match - Y -No match - y -No match - -/[z-\x{100}]/8i - -/^\X/8 - A - 0: A - A\x{300}BC - 0: A\x{300} - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302} - *** Failers - 0: * - \x{300} -No match - -/^[\X]/8 - X123 - 0: X - *** Failers -No match - AXYZ -No match - -/^(\X*)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BC - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BC - -/^(\X*?)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BC - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BC - -/^(\X*)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BCA - 1: A\x{300}\x{301}\x{302}BC - 2: A\x{300}\x{301}\x{302}B - 3: A - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BCA - 2: A\x{300}\x{301}\x{302}BC - 3: A\x{300}\x{301}\x{302}B - 4: A - -/^(\X*?)(.)/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - 0: A\x{300}\x{301}\x{302}BCA - 1: A\x{300}\x{301}\x{302}BC - 2: A\x{300}\x{301}\x{302}B - 3: A - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 0: A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C - 1: A\x{300}\x{301}\x{302}BCA - 2: A\x{300}\x{301}\x{302}BC - 3: A\x{300}\x{301}\x{302}B - 4: A - -/^\X(.)/8 - *** Failers - 0: ** - A\x{300}\x{301}\x{302} -No match - -/^\X{2,3}(.)/8 - A\x{300}\x{301}B\x{300}X - 0: A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - 0: A\x{300}\x{301}B\x{300}C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 1: A\x{300}\x{301}B\x{300}C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}D - 1: A\x{300}\x{301}B\x{300}C - -/^\X{2,3}?(.)/8 - A\x{300}\x{301}B\x{300}X - 0: A\x{300}\x{301}B\x{300}X - A\x{300}\x{301}B\x{300}C\x{300}\x{301} - 0: A\x{300}\x{301}B\x{300}C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}X - 1: A\x{300}\x{301}B\x{300}C - A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X - 0: A\x{300}\x{301}B\x{300}C\x{300}\x{301}D - 1: A\x{300}\x{301}B\x{300}C - -/^\pN{2,3}X/ - 12X - 0: 12X - 123X - 0: 123X - *** Failers -No match - X -No match - 1X -No match - 1234X -No match - -/\x{100}/i8 - \x{100} - 0: \x{100} - \x{101} - 0: \x{101} - -/ End / diff --git a/ext/pcre/pcrelib/ucp.h b/ext/pcre/pcrelib/ucp.h deleted file mode 100644 index 955e104a6a841..0000000000000 --- a/ext/pcre/pcrelib/ucp.h +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************* -* libucp - Unicode Property Table handler * -*************************************************/ - - -#ifndef _UCP_H -#define _UCP_H - -/* These are the character categories that are returned by ucp_findchar */ - -enum { - ucp_C, /* Other */ - ucp_L, /* Letter */ - ucp_M, /* Mark */ - ucp_N, /* Number */ - ucp_P, /* Punctuation */ - ucp_S, /* Symbol */ - ucp_Z /* Separator */ -}; - -/* These are the detailed character types that are returned by ucp_findchar */ - -enum { - ucp_Cc, /* Control */ - ucp_Cf, /* Format */ - ucp_Cn, /* Unassigned */ - ucp_Co, /* Private use */ - ucp_Cs, /* Surrogate */ - ucp_Ll, /* Lower case letter */ - ucp_Lm, /* Modifier letter */ - ucp_Lo, /* Other letter */ - ucp_Lt, /* Title case letter */ - ucp_Lu, /* Upper case letter */ - ucp_Mc, /* Spacing mark */ - ucp_Me, /* Enclosing mark */ - ucp_Mn, /* Non-spacing mark */ - ucp_Nd, /* Decimal number */ - ucp_Nl, /* Letter number */ - ucp_No, /* Other number */ - ucp_Pc, /* Connector punctuation */ - ucp_Pd, /* Dash punctuation */ - ucp_Pe, /* Close punctuation */ - ucp_Pf, /* Final punctuation */ - ucp_Pi, /* Initial punctuation */ - ucp_Po, /* Other punctuation */ - ucp_Ps, /* Open punctuation */ - ucp_Sc, /* Currency symbol */ - ucp_Sk, /* Modifier symbol */ - ucp_Sm, /* Mathematical symbol */ - ucp_So, /* Other symbol */ - ucp_Zl, /* Line separator */ - ucp_Zp, /* Paragraph separator */ - ucp_Zs /* Space separator */ -}; - -extern int ucp_findchar(const int, int *, int *); - -#endif - -/* End of ucp.h */ diff --git a/ext/pcre/pcrelib/ucp_findchar.c b/ext/pcre/pcrelib/ucp_findchar.c deleted file mode 100644 index 1f451172f9ce9..0000000000000 --- a/ext/pcre/pcrelib/ucp_findchar.c +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************* -* libucp - Unicode Property Table handler * -*************************************************/ - -/* Copyright (c) University of Cambridge 2004 */ - -/* This little library provides a fast way of obtaining the basic Unicode -properties of a character, using a compact binary tree that occupies less than -100K bytes. - ------------------------------------------------------------------------------ -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 the University of Cambridge nor the names of its - 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. ------------------------------------------------------------------------------ -*/ - - -#include "ucp.h" /* Exported interface */ -#include "ucpinternal.h" /* Internal table details */ -#include "ucptable.c" /* The table itself */ - - -/* In some environments, external functions have to be preceded by some magic. -In my world (Unix), they do not. Use a macro to deal with this. */ - -#ifndef EXPORT -#define EXPORT -#endif - - - -/************************************************* -* Search table and return data * -*************************************************/ - -/* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed -character type is ucp_Lu, ucp_Nd, etc. - -Arguments: - c the character value - type_ptr the detailed character type is returned here - case_ptr for letters, the opposite case is returned here, if there - is one, else zero - -Returns: the character type category or -1 if not found -*/ - -EXPORT int -ucp_findchar(const int c, int *type_ptr, int *case_ptr) -{ -cnode *node = ucp_table; -register int cc = c; -int case_offset; - -for (;;) - { - register int d = node->f1 | ((node->f0 & f0_chhmask) << 16); - if (cc == d) break; - if (cc < d) - { - if ((node->f0 & f0_leftexists) == 0) return -1; - node ++; - } - else - { - register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift; - if (roffset == 0) return -1; - node += 1 << (roffset - 1); - } - } - -switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) - { - case ucp_Cc: - case ucp_Cf: - case ucp_Cn: - case ucp_Co: - case ucp_Cs: - return ucp_C; - break; - - case ucp_Ll: - case ucp_Lu: - case_offset = node->f2 & f2_casemask; - if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000; - *case_ptr = (case_offset == 0)? 0 : cc + case_offset; - return ucp_L; - - case ucp_Lm: - case ucp_Lo: - case ucp_Lt: - *case_ptr = 0; - return ucp_L; - break; - - case ucp_Mc: - case ucp_Me: - case ucp_Mn: - return ucp_M; - break; - - case ucp_Nd: - case ucp_Nl: - case ucp_No: - return ucp_N; - break; - - case ucp_Pc: - case ucp_Pd: - case ucp_Pe: - case ucp_Pf: - case ucp_Pi: - case ucp_Ps: - case ucp_Po: - return ucp_P; - break; - - case ucp_Sc: - case ucp_Sk: - case ucp_Sm: - case ucp_So: - return ucp_S; - break; - - case ucp_Zl: - case ucp_Zp: - case ucp_Zs: - return ucp_Z; - break; - - default: /* "Should never happen" */ - return -1; - break; - } -} - -/* End of ucp_findchar.c */ diff --git a/ext/pcre/pcrelib/ucpinternal.h b/ext/pcre/pcrelib/ucpinternal.h deleted file mode 100644 index faefb030c9f61..0000000000000 --- a/ext/pcre/pcrelib/ucpinternal.h +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************* -* libucp - Unicode Property Table handler * -*************************************************/ - -/* Internal header file defining the layout of compact nodes in the tree. */ - -typedef struct cnode { - unsigned short int f0; - unsigned short int f1; - unsigned short int f2; -} cnode; - -/* Things for the f0 field */ - -#define f0_leftexists 0x8000 /* Left child exists */ -#define f0_typemask 0x3f00 /* Type bits */ -#define f0_typeshift 8 /* Type shift */ -#define f0_chhmask 0x00ff /* Character high bits */ - -/* Things for the f2 field */ - -#define f2_rightmask 0xf000 /* Mask for right offset bits */ -#define f2_rightshift 12 /* Shift for right offset */ -#define f2_casemask 0x0fff /* Mask for case offset */ - -/* The tree consists of a vector of structures of type cnode, with the root -node as the first element. The three short ints (16-bits) are used as follows: - -(f0) (1) The 0x8000 bit of f0 is set if a left child exists. The child's node - is the next node in the vector. - (2) The 0x4000 bits of f0 is spare. - (3) The 0x3f00 bits of f0 contain the character type; this is a number - defined by the enumeration in ucp.h (e.g. ucp_Lu). - (4) The bottom 8 bits of f0 contain the most significant byte of the - character's 24-bit codepoint. - -(f1) (1) The f1 field contains the two least significant bytes of the - codepoint. - -(f2) (1) The 0xf000 bits of f2 contain zero if there is no right child of this - node. Otherwise, they contain one plus the exponent of the power of - two of the offset to the right node (e.g. a value of 3 means 8). The - units of the offset are node items. - - (2) The 0x0fff bits of f2 contain the signed offset from this character to - its alternate cased value. They are zero if there is no such - character. - - ------------------------------------------------------------------------------ -||.|.| type (6) | ms char (8) || ls char (16) ||....| case offset (12) || ------------------------------------------------------------------------------ - | | | - | |-> spare | - | exponent of right - |-> left child exists child offset - - -The upper/lower casing information is set only for characters that come in -pairs. There are (at present) four non-one-to-one mappings in the Unicode data. -These are ignored. They are: - - 1FBE Greek Prosgegrammeni (lower, with upper -> capital iota) - 2126 Ohm - 212A Kelvin - 212B Angstrom - -Certainly for the last three, having an alternate case would seem to be a -mistake. I don't know any Greek, so cannot comment on the first one. - - -When searching the tree, proceed as follows: - -(1) Start at the first node. - -(2) Extract the character value from f1 and the bottom 8 bits of f0; - -(3) Compare with the character being sought. If equal, we are done. - -(4) If the test character is smaller, inspect the f0_leftexists flag. If it is - not set, the character is not in the tree. If it is set, move to the next - node, and go to (2). - -(5) If the test character is bigger, extract the f2_rightmask bits from f2, and - shift them right by f2_rightshift. If the result is zero, the character is - not in the tree. Otherwise, calculate the number of nodes to skip by - shifting the value 1 left by this number minus one. Go to (2). -*/ - - -/* End of internal.h */ diff --git a/ext/pcre/pcrelib/ucptable.c b/ext/pcre/pcrelib/ucptable.c deleted file mode 100644 index 7fb3a12343294..0000000000000 --- a/ext/pcre/pcrelib/ucptable.c +++ /dev/null @@ -1,15105 +0,0 @@ -/* This source module is automatically generated from the Unicode -property table. See internal.h for a description of the layout. */ - -static cnode ucp_table[] = { - { 0x9a00, 0x2f1f, 0xe000 }, - { 0x8700, 0x1558, 0xd000 }, - { 0x8700, 0x0a99, 0xc000 }, - { 0x8500, 0x0435, 0xbfe0 }, - { 0x8500, 0x01ff, 0xafff }, - { 0x8500, 0x00ff, 0x9079 }, - { 0x8000, 0x007f, 0x8000 }, - { 0x9500, 0x003f, 0x7000 }, - { 0x8000, 0x001f, 0x6000 }, - { 0x8000, 0x000f, 0x5000 }, - { 0x8000, 0x0007, 0x4000 }, - { 0x8000, 0x0003, 0x3000 }, - { 0x8000, 0x0001, 0x2000 }, - { 0x0000, 0x0000, 0x0000 }, - { 0x0000, 0x0002, 0x0000 }, - { 0x8000, 0x0005, 0x2000 }, - { 0x0000, 0x0004, 0x0000 }, - { 0x0000, 0x0006, 0x0000 }, - { 0x8000, 0x000b, 0x3000 }, - { 0x8000, 0x0009, 0x2000 }, - { 0x0000, 0x0008, 0x0000 }, - { 0x0000, 0x000a, 0x0000 }, - { 0x8000, 0x000d, 0x2000 }, - { 0x0000, 0x000c, 0x0000 }, - { 0x0000, 0x000e, 0x0000 }, - { 0x8000, 0x0017, 0x4000 }, - { 0x8000, 0x0013, 0x3000 }, - { 0x8000, 0x0011, 0x2000 }, - { 0x0000, 0x0010, 0x0000 }, - { 0x0000, 0x0012, 0x0000 }, - { 0x8000, 0x0015, 0x2000 }, - { 0x0000, 0x0014, 0x0000 }, - { 0x0000, 0x0016, 0x0000 }, - { 0x8000, 0x001b, 0x3000 }, - { 0x8000, 0x0019, 0x2000 }, - { 0x0000, 0x0018, 0x0000 }, - { 0x0000, 0x001a, 0x0000 }, - { 0x8000, 0x001d, 0x2000 }, - { 0x0000, 0x001c, 0x0000 }, - { 0x0000, 0x001e, 0x0000 }, - { 0x9500, 0x002f, 0x5000 }, - { 0x9500, 0x0027, 0x4000 }, - { 0x9500, 0x0023, 0x3000 }, - { 0x9500, 0x0021, 0x2000 }, - { 0x1d00, 0x0020, 0x0000 }, - { 0x1500, 0x0022, 0x0000 }, - { 0x9500, 0x0025, 0x2000 }, - { 0x1700, 0x0024, 0x0000 }, - { 0x1500, 0x0026, 0x0000 }, - { 0x9900, 0x002b, 0x3000 }, - { 0x9200, 0x0029, 0x2000 }, - { 0x1600, 0x0028, 0x0000 }, - { 0x1500, 0x002a, 0x0000 }, - { 0x9100, 0x002d, 0x2000 }, - { 0x1500, 0x002c, 0x0000 }, - { 0x1500, 0x002e, 0x0000 }, - { 0x8d00, 0x0037, 0x4000 }, - { 0x8d00, 0x0033, 0x3000 }, - { 0x8d00, 0x0031, 0x2000 }, - { 0x0d00, 0x0030, 0x0000 }, - { 0x0d00, 0x0032, 0x0000 }, - { 0x8d00, 0x0035, 0x2000 }, - { 0x0d00, 0x0034, 0x0000 }, - { 0x0d00, 0x0036, 0x0000 }, - { 0x9500, 0x003b, 0x3000 }, - { 0x8d00, 0x0039, 0x2000 }, - { 0x0d00, 0x0038, 0x0000 }, - { 0x1500, 0x003a, 0x0000 }, - { 0x9900, 0x003d, 0x2000 }, - { 0x1900, 0x003c, 0x0000 }, - { 0x1900, 0x003e, 0x0000 }, - { 0x9000, 0x005f, 0x6000 }, - { 0x8900, 0x004f, 0x5020 }, - { 0x8900, 0x0047, 0x4020 }, - { 0x8900, 0x0043, 0x3020 }, - { 0x8900, 0x0041, 0x2020 }, - { 0x1500, 0x0040, 0x0000 }, - { 0x0900, 0x0042, 0x0020 }, - { 0x8900, 0x0045, 0x2020 }, - { 0x0900, 0x0044, 0x0020 }, - { 0x0900, 0x0046, 0x0020 }, - { 0x8900, 0x004b, 0x3020 }, - { 0x8900, 0x0049, 0x2020 }, - { 0x0900, 0x0048, 0x0020 }, - { 0x0900, 0x004a, 0x0020 }, - { 0x8900, 0x004d, 0x2020 }, - { 0x0900, 0x004c, 0x0020 }, - { 0x0900, 0x004e, 0x0020 }, - { 0x8900, 0x0057, 0x4020 }, - { 0x8900, 0x0053, 0x3020 }, - { 0x8900, 0x0051, 0x2020 }, - { 0x0900, 0x0050, 0x0020 }, - { 0x0900, 0x0052, 0x0020 }, - { 0x8900, 0x0055, 0x2020 }, - { 0x0900, 0x0054, 0x0020 }, - { 0x0900, 0x0056, 0x0020 }, - { 0x9600, 0x005b, 0x3000 }, - { 0x8900, 0x0059, 0x2020 }, - { 0x0900, 0x0058, 0x0020 }, - { 0x0900, 0x005a, 0x0020 }, - { 0x9200, 0x005d, 0x2000 }, - { 0x1500, 0x005c, 0x0000 }, - { 0x1800, 0x005e, 0x0000 }, - { 0x8500, 0x006f, 0x5fe0 }, - { 0x8500, 0x0067, 0x4fe0 }, - { 0x8500, 0x0063, 0x3fe0 }, - { 0x8500, 0x0061, 0x2fe0 }, - { 0x1800, 0x0060, 0x0000 }, - { 0x0500, 0x0062, 0x0fe0 }, - { 0x8500, 0x0065, 0x2fe0 }, - { 0x0500, 0x0064, 0x0fe0 }, - { 0x0500, 0x0066, 0x0fe0 }, - { 0x8500, 0x006b, 0x3fe0 }, - { 0x8500, 0x0069, 0x2fe0 }, - { 0x0500, 0x0068, 0x0fe0 }, - { 0x0500, 0x006a, 0x0fe0 }, - { 0x8500, 0x006d, 0x2fe0 }, - { 0x0500, 0x006c, 0x0fe0 }, - { 0x0500, 0x006e, 0x0fe0 }, - { 0x8500, 0x0077, 0x4fe0 }, - { 0x8500, 0x0073, 0x3fe0 }, - { 0x8500, 0x0071, 0x2fe0 }, - { 0x0500, 0x0070, 0x0fe0 }, - { 0x0500, 0x0072, 0x0fe0 }, - { 0x8500, 0x0075, 0x2fe0 }, - { 0x0500, 0x0074, 0x0fe0 }, - { 0x0500, 0x0076, 0x0fe0 }, - { 0x9600, 0x007b, 0x3000 }, - { 0x8500, 0x0079, 0x2fe0 }, - { 0x0500, 0x0078, 0x0fe0 }, - { 0x0500, 0x007a, 0x0fe0 }, - { 0x9200, 0x007d, 0x2000 }, - { 0x1900, 0x007c, 0x0000 }, - { 0x1900, 0x007e, 0x0000 }, - { 0x9500, 0x00bf, 0x7000 }, - { 0x8000, 0x009f, 0x6000 }, - { 0x8000, 0x008f, 0x5000 }, - { 0x8000, 0x0087, 0x4000 }, - { 0x8000, 0x0083, 0x3000 }, - { 0x8000, 0x0081, 0x2000 }, - { 0x0000, 0x0080, 0x0000 }, - { 0x0000, 0x0082, 0x0000 }, - { 0x8000, 0x0085, 0x2000 }, - { 0x0000, 0x0084, 0x0000 }, - { 0x0000, 0x0086, 0x0000 }, - { 0x8000, 0x008b, 0x3000 }, - { 0x8000, 0x0089, 0x2000 }, - { 0x0000, 0x0088, 0x0000 }, - { 0x0000, 0x008a, 0x0000 }, - { 0x8000, 0x008d, 0x2000 }, - { 0x0000, 0x008c, 0x0000 }, - { 0x0000, 0x008e, 0x0000 }, - { 0x8000, 0x0097, 0x4000 }, - { 0x8000, 0x0093, 0x3000 }, - { 0x8000, 0x0091, 0x2000 }, - { 0x0000, 0x0090, 0x0000 }, - { 0x0000, 0x0092, 0x0000 }, - { 0x8000, 0x0095, 0x2000 }, - { 0x0000, 0x0094, 0x0000 }, - { 0x0000, 0x0096, 0x0000 }, - { 0x8000, 0x009b, 0x3000 }, - { 0x8000, 0x0099, 0x2000 }, - { 0x0000, 0x0098, 0x0000 }, - { 0x0000, 0x009a, 0x0000 }, - { 0x8000, 0x009d, 0x2000 }, - { 0x0000, 0x009c, 0x0000 }, - { 0x0000, 0x009e, 0x0000 }, - { 0x9800, 0x00af, 0x5000 }, - { 0x9a00, 0x00a7, 0x4000 }, - { 0x9700, 0x00a3, 0x3000 }, - { 0x9500, 0x00a1, 0x2000 }, - { 0x1d00, 0x00a0, 0x0000 }, - { 0x1700, 0x00a2, 0x0000 }, - { 0x9700, 0x00a5, 0x2000 }, - { 0x1700, 0x00a4, 0x0000 }, - { 0x1a00, 0x00a6, 0x0000 }, - { 0x9400, 0x00ab, 0x3000 }, - { 0x9a00, 0x00a9, 0x2000 }, - { 0x1800, 0x00a8, 0x0000 }, - { 0x0500, 0x00aa, 0x0000 }, - { 0x8100, 0x00ad, 0x2000 }, - { 0x1900, 0x00ac, 0x0000 }, - { 0x1a00, 0x00ae, 0x0000 }, - { 0x9500, 0x00b7, 0x4000 }, - { 0x8f00, 0x00b3, 0x3000 }, - { 0x9900, 0x00b1, 0x2000 }, - { 0x1a00, 0x00b0, 0x0000 }, - { 0x0f00, 0x00b2, 0x0000 }, - { 0x8500, 0x00b5, 0x22e7 }, - { 0x1800, 0x00b4, 0x0000 }, - { 0x1a00, 0x00b6, 0x0000 }, - { 0x9300, 0x00bb, 0x3000 }, - { 0x8f00, 0x00b9, 0x2000 }, - { 0x1800, 0x00b8, 0x0000 }, - { 0x0500, 0x00ba, 0x0000 }, - { 0x8f00, 0x00bd, 0x2000 }, - { 0x0f00, 0x00bc, 0x0000 }, - { 0x0f00, 0x00be, 0x0000 }, - { 0x8500, 0x00df, 0x6000 }, - { 0x8900, 0x00cf, 0x5020 }, - { 0x8900, 0x00c7, 0x4020 }, - { 0x8900, 0x00c3, 0x3020 }, - { 0x8900, 0x00c1, 0x2020 }, - { 0x0900, 0x00c0, 0x0020 }, - { 0x0900, 0x00c2, 0x0020 }, - { 0x8900, 0x00c5, 0x2020 }, - { 0x0900, 0x00c4, 0x0020 }, - { 0x0900, 0x00c6, 0x0020 }, - { 0x8900, 0x00cb, 0x3020 }, - { 0x8900, 0x00c9, 0x2020 }, - { 0x0900, 0x00c8, 0x0020 }, - { 0x0900, 0x00ca, 0x0020 }, - { 0x8900, 0x00cd, 0x2020 }, - { 0x0900, 0x00cc, 0x0020 }, - { 0x0900, 0x00ce, 0x0020 }, - { 0x9900, 0x00d7, 0x4000 }, - { 0x8900, 0x00d3, 0x3020 }, - { 0x8900, 0x00d1, 0x2020 }, - { 0x0900, 0x00d0, 0x0020 }, - { 0x0900, 0x00d2, 0x0020 }, - { 0x8900, 0x00d5, 0x2020 }, - { 0x0900, 0x00d4, 0x0020 }, - { 0x0900, 0x00d6, 0x0020 }, - { 0x8900, 0x00db, 0x3020 }, - { 0x8900, 0x00d9, 0x2020 }, - { 0x0900, 0x00d8, 0x0020 }, - { 0x0900, 0x00da, 0x0020 }, - { 0x8900, 0x00dd, 0x2020 }, - { 0x0900, 0x00dc, 0x0020 }, - { 0x0900, 0x00de, 0x0020 }, - { 0x8500, 0x00ef, 0x5fe0 }, - { 0x8500, 0x00e7, 0x4fe0 }, - { 0x8500, 0x00e3, 0x3fe0 }, - { 0x8500, 0x00e1, 0x2fe0 }, - { 0x0500, 0x00e0, 0x0fe0 }, - { 0x0500, 0x00e2, 0x0fe0 }, - { 0x8500, 0x00e5, 0x2fe0 }, - { 0x0500, 0x00e4, 0x0fe0 }, - { 0x0500, 0x00e6, 0x0fe0 }, - { 0x8500, 0x00eb, 0x3fe0 }, - { 0x8500, 0x00e9, 0x2fe0 }, - { 0x0500, 0x00e8, 0x0fe0 }, - { 0x0500, 0x00ea, 0x0fe0 }, - { 0x8500, 0x00ed, 0x2fe0 }, - { 0x0500, 0x00ec, 0x0fe0 }, - { 0x0500, 0x00ee, 0x0fe0 }, - { 0x9900, 0x00f7, 0x4000 }, - { 0x8500, 0x00f3, 0x3fe0 }, - { 0x8500, 0x00f1, 0x2fe0 }, - { 0x0500, 0x00f0, 0x0fe0 }, - { 0x0500, 0x00f2, 0x0fe0 }, - { 0x8500, 0x00f5, 0x2fe0 }, - { 0x0500, 0x00f4, 0x0fe0 }, - { 0x0500, 0x00f6, 0x0fe0 }, - { 0x8500, 0x00fb, 0x3fe0 }, - { 0x8500, 0x00f9, 0x2fe0 }, - { 0x0500, 0x00f8, 0x0fe0 }, - { 0x0500, 0x00fa, 0x0fe0 }, - { 0x8500, 0x00fd, 0x2fe0 }, - { 0x0500, 0x00fc, 0x0fe0 }, - { 0x0500, 0x00fe, 0x0fe0 }, - { 0x8500, 0x017f, 0x8ed4 }, - { 0x8900, 0x013f, 0x7001 }, - { 0x8500, 0x011f, 0x6fff }, - { 0x8500, 0x010f, 0x5fff }, - { 0x8500, 0x0107, 0x4fff }, - { 0x8500, 0x0103, 0x3fff }, - { 0x8500, 0x0101, 0x2fff }, - { 0x0900, 0x0100, 0x0001 }, - { 0x0900, 0x0102, 0x0001 }, - { 0x8500, 0x0105, 0x2fff }, - { 0x0900, 0x0104, 0x0001 }, - { 0x0900, 0x0106, 0x0001 }, - { 0x8500, 0x010b, 0x3fff }, - { 0x8500, 0x0109, 0x2fff }, - { 0x0900, 0x0108, 0x0001 }, - { 0x0900, 0x010a, 0x0001 }, - { 0x8500, 0x010d, 0x2fff }, - { 0x0900, 0x010c, 0x0001 }, - { 0x0900, 0x010e, 0x0001 }, - { 0x8500, 0x0117, 0x4fff }, - { 0x8500, 0x0113, 0x3fff }, - { 0x8500, 0x0111, 0x2fff }, - { 0x0900, 0x0110, 0x0001 }, - { 0x0900, 0x0112, 0x0001 }, - { 0x8500, 0x0115, 0x2fff }, - { 0x0900, 0x0114, 0x0001 }, - { 0x0900, 0x0116, 0x0001 }, - { 0x8500, 0x011b, 0x3fff }, - { 0x8500, 0x0119, 0x2fff }, - { 0x0900, 0x0118, 0x0001 }, - { 0x0900, 0x011a, 0x0001 }, - { 0x8500, 0x011d, 0x2fff }, - { 0x0900, 0x011c, 0x0001 }, - { 0x0900, 0x011e, 0x0001 }, - { 0x8500, 0x012f, 0x5fff }, - { 0x8500, 0x0127, 0x4fff }, - { 0x8500, 0x0123, 0x3fff }, - { 0x8500, 0x0121, 0x2fff }, - { 0x0900, 0x0120, 0x0001 }, - { 0x0900, 0x0122, 0x0001 }, - { 0x8500, 0x0125, 0x2fff }, - { 0x0900, 0x0124, 0x0001 }, - { 0x0900, 0x0126, 0x0001 }, - { 0x8500, 0x012b, 0x3fff }, - { 0x8500, 0x0129, 0x2fff }, - { 0x0900, 0x0128, 0x0001 }, - { 0x0900, 0x012a, 0x0001 }, - { 0x8500, 0x012d, 0x2fff }, - { 0x0900, 0x012c, 0x0001 }, - { 0x0900, 0x012e, 0x0001 }, - { 0x8500, 0x0137, 0x4fff }, - { 0x8500, 0x0133, 0x3fff }, - { 0x8500, 0x0131, 0x2f18 }, - { 0x0900, 0x0130, 0x0f39 }, - { 0x0900, 0x0132, 0x0001 }, - { 0x8500, 0x0135, 0x2fff }, - { 0x0900, 0x0134, 0x0001 }, - { 0x0900, 0x0136, 0x0001 }, - { 0x8900, 0x013b, 0x3001 }, - { 0x8900, 0x0139, 0x2001 }, - { 0x0500, 0x0138, 0x0000 }, - { 0x0500, 0x013a, 0x0fff }, - { 0x8900, 0x013d, 0x2001 }, - { 0x0500, 0x013c, 0x0fff }, - { 0x0500, 0x013e, 0x0fff }, - { 0x8500, 0x015f, 0x6fff }, - { 0x8500, 0x014f, 0x5fff }, - { 0x8900, 0x0147, 0x4001 }, - { 0x8900, 0x0143, 0x3001 }, - { 0x8900, 0x0141, 0x2001 }, - { 0x0500, 0x0140, 0x0fff }, - { 0x0500, 0x0142, 0x0fff }, - { 0x8900, 0x0145, 0x2001 }, - { 0x0500, 0x0144, 0x0fff }, - { 0x0500, 0x0146, 0x0fff }, - { 0x8500, 0x014b, 0x3fff }, - { 0x8500, 0x0149, 0x2000 }, - { 0x0500, 0x0148, 0x0fff }, - { 0x0900, 0x014a, 0x0001 }, - { 0x8500, 0x014d, 0x2fff }, - { 0x0900, 0x014c, 0x0001 }, - { 0x0900, 0x014e, 0x0001 }, - { 0x8500, 0x0157, 0x4fff }, - { 0x8500, 0x0153, 0x3fff }, - { 0x8500, 0x0151, 0x2fff }, - { 0x0900, 0x0150, 0x0001 }, - { 0x0900, 0x0152, 0x0001 }, - { 0x8500, 0x0155, 0x2fff }, - { 0x0900, 0x0154, 0x0001 }, - { 0x0900, 0x0156, 0x0001 }, - { 0x8500, 0x015b, 0x3fff }, - { 0x8500, 0x0159, 0x2fff }, - { 0x0900, 0x0158, 0x0001 }, - { 0x0900, 0x015a, 0x0001 }, - { 0x8500, 0x015d, 0x2fff }, - { 0x0900, 0x015c, 0x0001 }, - { 0x0900, 0x015e, 0x0001 }, - { 0x8500, 0x016f, 0x5fff }, - { 0x8500, 0x0167, 0x4fff }, - { 0x8500, 0x0163, 0x3fff }, - { 0x8500, 0x0161, 0x2fff }, - { 0x0900, 0x0160, 0x0001 }, - { 0x0900, 0x0162, 0x0001 }, - { 0x8500, 0x0165, 0x2fff }, - { 0x0900, 0x0164, 0x0001 }, - { 0x0900, 0x0166, 0x0001 }, - { 0x8500, 0x016b, 0x3fff }, - { 0x8500, 0x0169, 0x2fff }, - { 0x0900, 0x0168, 0x0001 }, - { 0x0900, 0x016a, 0x0001 }, - { 0x8500, 0x016d, 0x2fff }, - { 0x0900, 0x016c, 0x0001 }, - { 0x0900, 0x016e, 0x0001 }, - { 0x8500, 0x0177, 0x4fff }, - { 0x8500, 0x0173, 0x3fff }, - { 0x8500, 0x0171, 0x2fff }, - { 0x0900, 0x0170, 0x0001 }, - { 0x0900, 0x0172, 0x0001 }, - { 0x8500, 0x0175, 0x2fff }, - { 0x0900, 0x0174, 0x0001 }, - { 0x0900, 0x0176, 0x0001 }, - { 0x8900, 0x017b, 0x3001 }, - { 0x8900, 0x0179, 0x2001 }, - { 0x0900, 0x0178, 0x0f87 }, - { 0x0500, 0x017a, 0x0fff }, - { 0x8900, 0x017d, 0x2001 }, - { 0x0500, 0x017c, 0x0fff }, - { 0x0500, 0x017e, 0x0fff }, - { 0x8500, 0x01bf, 0x7038 }, - { 0x8900, 0x019f, 0x60d6 }, - { 0x8900, 0x018f, 0x50ca }, - { 0x8900, 0x0187, 0x4001 }, - { 0x8500, 0x0183, 0x3fff }, - { 0x8900, 0x0181, 0x20d2 }, - { 0x0500, 0x0180, 0x0000 }, - { 0x0900, 0x0182, 0x0001 }, - { 0x8500, 0x0185, 0x2fff }, - { 0x0900, 0x0184, 0x0001 }, - { 0x0900, 0x0186, 0x00ce }, - { 0x8900, 0x018b, 0x3001 }, - { 0x8900, 0x0189, 0x20cd }, - { 0x0500, 0x0188, 0x0fff }, - { 0x0900, 0x018a, 0x00cd }, - { 0x8500, 0x018d, 0x2000 }, - { 0x0500, 0x018c, 0x0fff }, - { 0x0900, 0x018e, 0x004f }, - { 0x8900, 0x0197, 0x40d1 }, - { 0x8900, 0x0193, 0x30cd }, - { 0x8900, 0x0191, 0x2001 }, - { 0x0900, 0x0190, 0x00cb }, - { 0x0500, 0x0192, 0x0fff }, - { 0x8500, 0x0195, 0x2061 }, - { 0x0900, 0x0194, 0x00cf }, - { 0x0900, 0x0196, 0x00d3 }, - { 0x8500, 0x019b, 0x3000 }, - { 0x8500, 0x0199, 0x2fff }, - { 0x0900, 0x0198, 0x0001 }, - { 0x0500, 0x019a, 0x0000 }, - { 0x8900, 0x019d, 0x20d5 }, - { 0x0900, 0x019c, 0x00d3 }, - { 0x0500, 0x019e, 0x0082 }, - { 0x8900, 0x01af, 0x5001 }, - { 0x8900, 0x01a7, 0x4001 }, - { 0x8500, 0x01a3, 0x3fff }, - { 0x8500, 0x01a1, 0x2fff }, - { 0x0900, 0x01a0, 0x0001 }, - { 0x0900, 0x01a2, 0x0001 }, - { 0x8500, 0x01a5, 0x2fff }, - { 0x0900, 0x01a4, 0x0001 }, - { 0x0900, 0x01a6, 0x00da }, - { 0x8500, 0x01ab, 0x3000 }, - { 0x8900, 0x01a9, 0x20da }, - { 0x0500, 0x01a8, 0x0fff }, - { 0x0500, 0x01aa, 0x0000 }, - { 0x8500, 0x01ad, 0x2fff }, - { 0x0900, 0x01ac, 0x0001 }, - { 0x0900, 0x01ae, 0x00da }, - { 0x8900, 0x01b7, 0x40db }, - { 0x8900, 0x01b3, 0x3001 }, - { 0x8900, 0x01b1, 0x20d9 }, - { 0x0500, 0x01b0, 0x0fff }, - { 0x0900, 0x01b2, 0x00d9 }, - { 0x8900, 0x01b5, 0x2001 }, - { 0x0500, 0x01b4, 0x0fff }, - { 0x0500, 0x01b6, 0x0fff }, - { 0x8700, 0x01bb, 0x3000 }, - { 0x8500, 0x01b9, 0x2fff }, - { 0x0900, 0x01b8, 0x0001 }, - { 0x0500, 0x01ba, 0x0000 }, - { 0x8500, 0x01bd, 0x2fff }, - { 0x0900, 0x01bc, 0x0001 }, - { 0x0500, 0x01be, 0x0000 }, - { 0x8500, 0x01df, 0x6fff }, - { 0x8900, 0x01cf, 0x5001 }, - { 0x8900, 0x01c7, 0x4002 }, - { 0x8700, 0x01c3, 0x3000 }, - { 0x8700, 0x01c1, 0x2000 }, - { 0x0700, 0x01c0, 0x0000 }, - { 0x0700, 0x01c2, 0x0000 }, - { 0x8800, 0x01c5, 0x2000 }, - { 0x0900, 0x01c4, 0x0002 }, - { 0x0500, 0x01c6, 0x0ffe }, - { 0x8800, 0x01cb, 0x3000 }, - { 0x8500, 0x01c9, 0x2ffe }, - { 0x0800, 0x01c8, 0x0000 }, - { 0x0900, 0x01ca, 0x0002 }, - { 0x8900, 0x01cd, 0x2001 }, - { 0x0500, 0x01cc, 0x0ffe }, - { 0x0500, 0x01ce, 0x0fff }, - { 0x8900, 0x01d7, 0x4001 }, - { 0x8900, 0x01d3, 0x3001 }, - { 0x8900, 0x01d1, 0x2001 }, - { 0x0500, 0x01d0, 0x0fff }, - { 0x0500, 0x01d2, 0x0fff }, - { 0x8900, 0x01d5, 0x2001 }, - { 0x0500, 0x01d4, 0x0fff }, - { 0x0500, 0x01d6, 0x0fff }, - { 0x8900, 0x01db, 0x3001 }, - { 0x8900, 0x01d9, 0x2001 }, - { 0x0500, 0x01d8, 0x0fff }, - { 0x0500, 0x01da, 0x0fff }, - { 0x8500, 0x01dd, 0x2fb1 }, - { 0x0500, 0x01dc, 0x0fff }, - { 0x0900, 0x01de, 0x0001 }, - { 0x8500, 0x01ef, 0x5fff }, - { 0x8500, 0x01e7, 0x4fff }, - { 0x8500, 0x01e3, 0x3fff }, - { 0x8500, 0x01e1, 0x2fff }, - { 0x0900, 0x01e0, 0x0001 }, - { 0x0900, 0x01e2, 0x0001 }, - { 0x8500, 0x01e5, 0x2fff }, - { 0x0900, 0x01e4, 0x0001 }, - { 0x0900, 0x01e6, 0x0001 }, - { 0x8500, 0x01eb, 0x3fff }, - { 0x8500, 0x01e9, 0x2fff }, - { 0x0900, 0x01e8, 0x0001 }, - { 0x0900, 0x01ea, 0x0001 }, - { 0x8500, 0x01ed, 0x2fff }, - { 0x0900, 0x01ec, 0x0001 }, - { 0x0900, 0x01ee, 0x0001 }, - { 0x8900, 0x01f7, 0x4fc8 }, - { 0x8500, 0x01f3, 0x3ffe }, - { 0x8900, 0x01f1, 0x2002 }, - { 0x0500, 0x01f0, 0x0000 }, - { 0x0800, 0x01f2, 0x0000 }, - { 0x8500, 0x01f5, 0x2fff }, - { 0x0900, 0x01f4, 0x0001 }, - { 0x0900, 0x01f6, 0x0f9f }, - { 0x8500, 0x01fb, 0x3fff }, - { 0x8500, 0x01f9, 0x2fff }, - { 0x0900, 0x01f8, 0x0001 }, - { 0x0900, 0x01fa, 0x0001 }, - { 0x8500, 0x01fd, 0x2fff }, - { 0x0900, 0x01fc, 0x0001 }, - { 0x0900, 0x01fe, 0x0001 }, - { 0x8c00, 0x0318, 0x9000 }, - { 0x8500, 0x0298, 0x8000 }, - { 0x8500, 0x0258, 0x7000 }, - { 0x8500, 0x021f, 0x6fff }, - { 0x8500, 0x020f, 0x5fff }, - { 0x8500, 0x0207, 0x4fff }, - { 0x8500, 0x0203, 0x3fff }, - { 0x8500, 0x0201, 0x2fff }, - { 0x0900, 0x0200, 0x0001 }, - { 0x0900, 0x0202, 0x0001 }, - { 0x8500, 0x0205, 0x2fff }, - { 0x0900, 0x0204, 0x0001 }, - { 0x0900, 0x0206, 0x0001 }, - { 0x8500, 0x020b, 0x3fff }, - { 0x8500, 0x0209, 0x2fff }, - { 0x0900, 0x0208, 0x0001 }, - { 0x0900, 0x020a, 0x0001 }, - { 0x8500, 0x020d, 0x2fff }, - { 0x0900, 0x020c, 0x0001 }, - { 0x0900, 0x020e, 0x0001 }, - { 0x8500, 0x0217, 0x4fff }, - { 0x8500, 0x0213, 0x3fff }, - { 0x8500, 0x0211, 0x2fff }, - { 0x0900, 0x0210, 0x0001 }, - { 0x0900, 0x0212, 0x0001 }, - { 0x8500, 0x0215, 0x2fff }, - { 0x0900, 0x0214, 0x0001 }, - { 0x0900, 0x0216, 0x0001 }, - { 0x8500, 0x021b, 0x3fff }, - { 0x8500, 0x0219, 0x2fff }, - { 0x0900, 0x0218, 0x0001 }, - { 0x0900, 0x021a, 0x0001 }, - { 0x8500, 0x021d, 0x2fff }, - { 0x0900, 0x021c, 0x0001 }, - { 0x0900, 0x021e, 0x0001 }, - { 0x8500, 0x022f, 0x5fff }, - { 0x8500, 0x0227, 0x4fff }, - { 0x8500, 0x0223, 0x3fff }, - { 0x8500, 0x0221, 0x2000 }, - { 0x0900, 0x0220, 0x0f7e }, - { 0x0900, 0x0222, 0x0001 }, - { 0x8500, 0x0225, 0x2fff }, - { 0x0900, 0x0224, 0x0001 }, - { 0x0900, 0x0226, 0x0001 }, - { 0x8500, 0x022b, 0x3fff }, - { 0x8500, 0x0229, 0x2fff }, - { 0x0900, 0x0228, 0x0001 }, - { 0x0900, 0x022a, 0x0001 }, - { 0x8500, 0x022d, 0x2fff }, - { 0x0900, 0x022c, 0x0001 }, - { 0x0900, 0x022e, 0x0001 }, - { 0x8500, 0x0250, 0x4000 }, - { 0x8500, 0x0233, 0x3fff }, - { 0x8500, 0x0231, 0x2fff }, - { 0x0900, 0x0230, 0x0001 }, - { 0x0900, 0x0232, 0x0001 }, - { 0x8500, 0x0235, 0x2000 }, - { 0x0500, 0x0234, 0x0000 }, - { 0x0500, 0x0236, 0x0000 }, - { 0x8500, 0x0254, 0x3f32 }, - { 0x8500, 0x0252, 0x2000 }, - { 0x0500, 0x0251, 0x0000 }, - { 0x0500, 0x0253, 0x0f2e }, - { 0x8500, 0x0256, 0x2f33 }, - { 0x0500, 0x0255, 0x0000 }, - { 0x0500, 0x0257, 0x0f33 }, - { 0x8500, 0x0278, 0x6000 }, - { 0x8500, 0x0268, 0x5f2f }, - { 0x8500, 0x0260, 0x4f33 }, - { 0x8500, 0x025c, 0x3000 }, - { 0x8500, 0x025a, 0x2000 }, - { 0x0500, 0x0259, 0x0f36 }, - { 0x0500, 0x025b, 0x0f35 }, - { 0x8500, 0x025e, 0x2000 }, - { 0x0500, 0x025d, 0x0000 }, - { 0x0500, 0x025f, 0x0000 }, - { 0x8500, 0x0264, 0x3000 }, - { 0x8500, 0x0262, 0x2000 }, - { 0x0500, 0x0261, 0x0000 }, - { 0x0500, 0x0263, 0x0f31 }, - { 0x8500, 0x0266, 0x2000 }, - { 0x0500, 0x0265, 0x0000 }, - { 0x0500, 0x0267, 0x0000 }, - { 0x8500, 0x0270, 0x4000 }, - { 0x8500, 0x026c, 0x3000 }, - { 0x8500, 0x026a, 0x2000 }, - { 0x0500, 0x0269, 0x0f2d }, - { 0x0500, 0x026b, 0x0000 }, - { 0x8500, 0x026e, 0x2000 }, - { 0x0500, 0x026d, 0x0000 }, - { 0x0500, 0x026f, 0x0f2d }, - { 0x8500, 0x0274, 0x3000 }, - { 0x8500, 0x0272, 0x2f2b }, - { 0x0500, 0x0271, 0x0000 }, - { 0x0500, 0x0273, 0x0000 }, - { 0x8500, 0x0276, 0x2000 }, - { 0x0500, 0x0275, 0x0f2a }, - { 0x0500, 0x0277, 0x0000 }, - { 0x8500, 0x0288, 0x5f26 }, - { 0x8500, 0x0280, 0x4f26 }, - { 0x8500, 0x027c, 0x3000 }, - { 0x8500, 0x027a, 0x2000 }, - { 0x0500, 0x0279, 0x0000 }, - { 0x0500, 0x027b, 0x0000 }, - { 0x8500, 0x027e, 0x2000 }, - { 0x0500, 0x027d, 0x0000 }, - { 0x0500, 0x027f, 0x0000 }, - { 0x8500, 0x0284, 0x3000 }, - { 0x8500, 0x0282, 0x2000 }, - { 0x0500, 0x0281, 0x0000 }, - { 0x0500, 0x0283, 0x0f26 }, - { 0x8500, 0x0286, 0x2000 }, - { 0x0500, 0x0285, 0x0000 }, - { 0x0500, 0x0287, 0x0000 }, - { 0x8500, 0x0290, 0x4000 }, - { 0x8500, 0x028c, 0x3000 }, - { 0x8500, 0x028a, 0x2f27 }, - { 0x0500, 0x0289, 0x0000 }, - { 0x0500, 0x028b, 0x0f27 }, - { 0x8500, 0x028e, 0x2000 }, - { 0x0500, 0x028d, 0x0000 }, - { 0x0500, 0x028f, 0x0000 }, - { 0x8500, 0x0294, 0x3000 }, - { 0x8500, 0x0292, 0x2f25 }, - { 0x0500, 0x0291, 0x0000 }, - { 0x0500, 0x0293, 0x0000 }, - { 0x8500, 0x0296, 0x2000 }, - { 0x0500, 0x0295, 0x0000 }, - { 0x0500, 0x0297, 0x0000 }, - { 0x9800, 0x02d8, 0x7000 }, - { 0x8600, 0x02b8, 0x6000 }, - { 0x8500, 0x02a8, 0x5000 }, - { 0x8500, 0x02a0, 0x4000 }, - { 0x8500, 0x029c, 0x3000 }, - { 0x8500, 0x029a, 0x2000 }, - { 0x0500, 0x0299, 0x0000 }, - { 0x0500, 0x029b, 0x0000 }, - { 0x8500, 0x029e, 0x2000 }, - { 0x0500, 0x029d, 0x0000 }, - { 0x0500, 0x029f, 0x0000 }, - { 0x8500, 0x02a4, 0x3000 }, - { 0x8500, 0x02a2, 0x2000 }, - { 0x0500, 0x02a1, 0x0000 }, - { 0x0500, 0x02a3, 0x0000 }, - { 0x8500, 0x02a6, 0x2000 }, - { 0x0500, 0x02a5, 0x0000 }, - { 0x0500, 0x02a7, 0x0000 }, - { 0x8600, 0x02b0, 0x4000 }, - { 0x8500, 0x02ac, 0x3000 }, - { 0x8500, 0x02aa, 0x2000 }, - { 0x0500, 0x02a9, 0x0000 }, - { 0x0500, 0x02ab, 0x0000 }, - { 0x8500, 0x02ae, 0x2000 }, - { 0x0500, 0x02ad, 0x0000 }, - { 0x0500, 0x02af, 0x0000 }, - { 0x8600, 0x02b4, 0x3000 }, - { 0x8600, 0x02b2, 0x2000 }, - { 0x0600, 0x02b1, 0x0000 }, - { 0x0600, 0x02b3, 0x0000 }, - { 0x8600, 0x02b6, 0x2000 }, - { 0x0600, 0x02b5, 0x0000 }, - { 0x0600, 0x02b7, 0x0000 }, - { 0x8600, 0x02c8, 0x5000 }, - { 0x8600, 0x02c0, 0x4000 }, - { 0x8600, 0x02bc, 0x3000 }, - { 0x8600, 0x02ba, 0x2000 }, - { 0x0600, 0x02b9, 0x0000 }, - { 0x0600, 0x02bb, 0x0000 }, - { 0x8600, 0x02be, 0x2000 }, - { 0x0600, 0x02bd, 0x0000 }, - { 0x0600, 0x02bf, 0x0000 }, - { 0x9800, 0x02c4, 0x3000 }, - { 0x9800, 0x02c2, 0x2000 }, - { 0x0600, 0x02c1, 0x0000 }, - { 0x1800, 0x02c3, 0x0000 }, - { 0x8600, 0x02c6, 0x2000 }, - { 0x1800, 0x02c5, 0x0000 }, - { 0x0600, 0x02c7, 0x0000 }, - { 0x8600, 0x02d0, 0x4000 }, - { 0x8600, 0x02cc, 0x3000 }, - { 0x8600, 0x02ca, 0x2000 }, - { 0x0600, 0x02c9, 0x0000 }, - { 0x0600, 0x02cb, 0x0000 }, - { 0x8600, 0x02ce, 0x2000 }, - { 0x0600, 0x02cd, 0x0000 }, - { 0x0600, 0x02cf, 0x0000 }, - { 0x9800, 0x02d4, 0x3000 }, - { 0x9800, 0x02d2, 0x2000 }, - { 0x0600, 0x02d1, 0x0000 }, - { 0x1800, 0x02d3, 0x0000 }, - { 0x9800, 0x02d6, 0x2000 }, - { 0x1800, 0x02d5, 0x0000 }, - { 0x1800, 0x02d7, 0x0000 }, - { 0x9800, 0x02f8, 0x6000 }, - { 0x9800, 0x02e8, 0x5000 }, - { 0x8600, 0x02e0, 0x4000 }, - { 0x9800, 0x02dc, 0x3000 }, - { 0x9800, 0x02da, 0x2000 }, - { 0x1800, 0x02d9, 0x0000 }, - { 0x1800, 0x02db, 0x0000 }, - { 0x9800, 0x02de, 0x2000 }, - { 0x1800, 0x02dd, 0x0000 }, - { 0x1800, 0x02df, 0x0000 }, - { 0x8600, 0x02e4, 0x3000 }, - { 0x8600, 0x02e2, 0x2000 }, - { 0x0600, 0x02e1, 0x0000 }, - { 0x0600, 0x02e3, 0x0000 }, - { 0x9800, 0x02e6, 0x2000 }, - { 0x1800, 0x02e5, 0x0000 }, - { 0x1800, 0x02e7, 0x0000 }, - { 0x9800, 0x02f0, 0x4000 }, - { 0x9800, 0x02ec, 0x3000 }, - { 0x9800, 0x02ea, 0x2000 }, - { 0x1800, 0x02e9, 0x0000 }, - { 0x1800, 0x02eb, 0x0000 }, - { 0x8600, 0x02ee, 0x2000 }, - { 0x1800, 0x02ed, 0x0000 }, - { 0x1800, 0x02ef, 0x0000 }, - { 0x9800, 0x02f4, 0x3000 }, - { 0x9800, 0x02f2, 0x2000 }, - { 0x1800, 0x02f1, 0x0000 }, - { 0x1800, 0x02f3, 0x0000 }, - { 0x9800, 0x02f6, 0x2000 }, - { 0x1800, 0x02f5, 0x0000 }, - { 0x1800, 0x02f7, 0x0000 }, - { 0x8c00, 0x0308, 0x5000 }, - { 0x8c00, 0x0300, 0x4000 }, - { 0x9800, 0x02fc, 0x3000 }, - { 0x9800, 0x02fa, 0x2000 }, - { 0x1800, 0x02f9, 0x0000 }, - { 0x1800, 0x02fb, 0x0000 }, - { 0x9800, 0x02fe, 0x2000 }, - { 0x1800, 0x02fd, 0x0000 }, - { 0x1800, 0x02ff, 0x0000 }, - { 0x8c00, 0x0304, 0x3000 }, - { 0x8c00, 0x0302, 0x2000 }, - { 0x0c00, 0x0301, 0x0000 }, - { 0x0c00, 0x0303, 0x0000 }, - { 0x8c00, 0x0306, 0x2000 }, - { 0x0c00, 0x0305, 0x0000 }, - { 0x0c00, 0x0307, 0x0000 }, - { 0x8c00, 0x0310, 0x4000 }, - { 0x8c00, 0x030c, 0x3000 }, - { 0x8c00, 0x030a, 0x2000 }, - { 0x0c00, 0x0309, 0x0000 }, - { 0x0c00, 0x030b, 0x0000 }, - { 0x8c00, 0x030e, 0x2000 }, - { 0x0c00, 0x030d, 0x0000 }, - { 0x0c00, 0x030f, 0x0000 }, - { 0x8c00, 0x0314, 0x3000 }, - { 0x8c00, 0x0312, 0x2000 }, - { 0x0c00, 0x0311, 0x0000 }, - { 0x0c00, 0x0313, 0x0000 }, - { 0x8c00, 0x0316, 0x2000 }, - { 0x0c00, 0x0315, 0x0000 }, - { 0x0c00, 0x0317, 0x0000 }, - { 0x8500, 0x03b0, 0x8000 }, - { 0x8c00, 0x035d, 0x7000 }, - { 0x8c00, 0x0338, 0x6000 }, - { 0x8c00, 0x0328, 0x5000 }, - { 0x8c00, 0x0320, 0x4000 }, - { 0x8c00, 0x031c, 0x3000 }, - { 0x8c00, 0x031a, 0x2000 }, - { 0x0c00, 0x0319, 0x0000 }, - { 0x0c00, 0x031b, 0x0000 }, - { 0x8c00, 0x031e, 0x2000 }, - { 0x0c00, 0x031d, 0x0000 }, - { 0x0c00, 0x031f, 0x0000 }, - { 0x8c00, 0x0324, 0x3000 }, - { 0x8c00, 0x0322, 0x2000 }, - { 0x0c00, 0x0321, 0x0000 }, - { 0x0c00, 0x0323, 0x0000 }, - { 0x8c00, 0x0326, 0x2000 }, - { 0x0c00, 0x0325, 0x0000 }, - { 0x0c00, 0x0327, 0x0000 }, - { 0x8c00, 0x0330, 0x4000 }, - { 0x8c00, 0x032c, 0x3000 }, - { 0x8c00, 0x032a, 0x2000 }, - { 0x0c00, 0x0329, 0x0000 }, - { 0x0c00, 0x032b, 0x0000 }, - { 0x8c00, 0x032e, 0x2000 }, - { 0x0c00, 0x032d, 0x0000 }, - { 0x0c00, 0x032f, 0x0000 }, - { 0x8c00, 0x0334, 0x3000 }, - { 0x8c00, 0x0332, 0x2000 }, - { 0x0c00, 0x0331, 0x0000 }, - { 0x0c00, 0x0333, 0x0000 }, - { 0x8c00, 0x0336, 0x2000 }, - { 0x0c00, 0x0335, 0x0000 }, - { 0x0c00, 0x0337, 0x0000 }, - { 0x8c00, 0x0348, 0x5000 }, - { 0x8c00, 0x0340, 0x4000 }, - { 0x8c00, 0x033c, 0x3000 }, - { 0x8c00, 0x033a, 0x2000 }, - { 0x0c00, 0x0339, 0x0000 }, - { 0x0c00, 0x033b, 0x0000 }, - { 0x8c00, 0x033e, 0x2000 }, - { 0x0c00, 0x033d, 0x0000 }, - { 0x0c00, 0x033f, 0x0000 }, - { 0x8c00, 0x0344, 0x3000 }, - { 0x8c00, 0x0342, 0x2000 }, - { 0x0c00, 0x0341, 0x0000 }, - { 0x0c00, 0x0343, 0x0000 }, - { 0x8c00, 0x0346, 0x2000 }, - { 0x0c00, 0x0345, 0x0000 }, - { 0x0c00, 0x0347, 0x0000 }, - { 0x8c00, 0x0350, 0x4000 }, - { 0x8c00, 0x034c, 0x3000 }, - { 0x8c00, 0x034a, 0x2000 }, - { 0x0c00, 0x0349, 0x0000 }, - { 0x0c00, 0x034b, 0x0000 }, - { 0x8c00, 0x034e, 0x2000 }, - { 0x0c00, 0x034d, 0x0000 }, - { 0x0c00, 0x034f, 0x0000 }, - { 0x8c00, 0x0354, 0x3000 }, - { 0x8c00, 0x0352, 0x2000 }, - { 0x0c00, 0x0351, 0x0000 }, - { 0x0c00, 0x0353, 0x0000 }, - { 0x8c00, 0x0356, 0x2000 }, - { 0x0c00, 0x0355, 0x0000 }, - { 0x0c00, 0x0357, 0x0000 }, - { 0x8900, 0x038f, 0x603f }, - { 0x8c00, 0x036d, 0x5000 }, - { 0x8c00, 0x0365, 0x4000 }, - { 0x8c00, 0x0361, 0x3000 }, - { 0x8c00, 0x035f, 0x2000 }, - { 0x0c00, 0x035e, 0x0000 }, - { 0x0c00, 0x0360, 0x0000 }, - { 0x8c00, 0x0363, 0x2000 }, - { 0x0c00, 0x0362, 0x0000 }, - { 0x0c00, 0x0364, 0x0000 }, - { 0x8c00, 0x0369, 0x3000 }, - { 0x8c00, 0x0367, 0x2000 }, - { 0x0c00, 0x0366, 0x0000 }, - { 0x0c00, 0x0368, 0x0000 }, - { 0x8c00, 0x036b, 0x2000 }, - { 0x0c00, 0x036a, 0x0000 }, - { 0x0c00, 0x036c, 0x0000 }, - { 0x9800, 0x0385, 0x4000 }, - { 0x9800, 0x0375, 0x3000 }, - { 0x8c00, 0x036f, 0x2000 }, - { 0x0c00, 0x036e, 0x0000 }, - { 0x1800, 0x0374, 0x0000 }, - { 0x9500, 0x037e, 0x2000 }, - { 0x0600, 0x037a, 0x0000 }, - { 0x1800, 0x0384, 0x0000 }, - { 0x8900, 0x0389, 0x3025 }, - { 0x9500, 0x0387, 0x2000 }, - { 0x0900, 0x0386, 0x0026 }, - { 0x0900, 0x0388, 0x0025 }, - { 0x8900, 0x038c, 0x2040 }, - { 0x0900, 0x038a, 0x0025 }, - { 0x0900, 0x038e, 0x003f }, - { 0x8900, 0x039f, 0x5020 }, - { 0x8900, 0x0397, 0x4020 }, - { 0x8900, 0x0393, 0x3020 }, - { 0x8900, 0x0391, 0x2020 }, - { 0x0500, 0x0390, 0x0000 }, - { 0x0900, 0x0392, 0x0020 }, - { 0x8900, 0x0395, 0x2020 }, - { 0x0900, 0x0394, 0x0020 }, - { 0x0900, 0x0396, 0x0020 }, - { 0x8900, 0x039b, 0x3020 }, - { 0x8900, 0x0399, 0x2020 }, - { 0x0900, 0x0398, 0x0020 }, - { 0x0900, 0x039a, 0x0020 }, - { 0x8900, 0x039d, 0x2020 }, - { 0x0900, 0x039c, 0x0020 }, - { 0x0900, 0x039e, 0x0020 }, - { 0x8900, 0x03a8, 0x4020 }, - { 0x8900, 0x03a4, 0x3020 }, - { 0x8900, 0x03a1, 0x2020 }, - { 0x0900, 0x03a0, 0x0020 }, - { 0x0900, 0x03a3, 0x0020 }, - { 0x8900, 0x03a6, 0x2020 }, - { 0x0900, 0x03a5, 0x0020 }, - { 0x0900, 0x03a7, 0x0020 }, - { 0x8500, 0x03ac, 0x3fda }, - { 0x8900, 0x03aa, 0x2020 }, - { 0x0900, 0x03a9, 0x0020 }, - { 0x0900, 0x03ab, 0x0020 }, - { 0x8500, 0x03ae, 0x2fdb }, - { 0x0500, 0x03ad, 0x0fdb }, - { 0x0500, 0x03af, 0x0fdb }, - { 0x8500, 0x03f1, 0x7fb0 }, - { 0x8500, 0x03d1, 0x6fc7 }, - { 0x8500, 0x03c0, 0x5fe0 }, - { 0x8500, 0x03b8, 0x4fe0 }, - { 0x8500, 0x03b4, 0x3fe0 }, - { 0x8500, 0x03b2, 0x2fe0 }, - { 0x0500, 0x03b1, 0x0fe0 }, - { 0x0500, 0x03b3, 0x0fe0 }, - { 0x8500, 0x03b6, 0x2fe0 }, - { 0x0500, 0x03b5, 0x0fe0 }, - { 0x0500, 0x03b7, 0x0fe0 }, - { 0x8500, 0x03bc, 0x3fe0 }, - { 0x8500, 0x03ba, 0x2fe0 }, - { 0x0500, 0x03b9, 0x0fe0 }, - { 0x0500, 0x03bb, 0x0fe0 }, - { 0x8500, 0x03be, 0x2fe0 }, - { 0x0500, 0x03bd, 0x0fe0 }, - { 0x0500, 0x03bf, 0x0fe0 }, - { 0x8500, 0x03c8, 0x4fe0 }, - { 0x8500, 0x03c4, 0x3fe0 }, - { 0x8500, 0x03c2, 0x2fe1 }, - { 0x0500, 0x03c1, 0x0fe0 }, - { 0x0500, 0x03c3, 0x0fe0 }, - { 0x8500, 0x03c6, 0x2fe0 }, - { 0x0500, 0x03c5, 0x0fe0 }, - { 0x0500, 0x03c7, 0x0fe0 }, - { 0x8500, 0x03cc, 0x3fc0 }, - { 0x8500, 0x03ca, 0x2fe0 }, - { 0x0500, 0x03c9, 0x0fe0 }, - { 0x0500, 0x03cb, 0x0fe0 }, - { 0x8500, 0x03ce, 0x2fc1 }, - { 0x0500, 0x03cd, 0x0fc1 }, - { 0x0500, 0x03d0, 0x0fc2 }, - { 0x8500, 0x03e1, 0x5fff }, - { 0x8500, 0x03d9, 0x4fff }, - { 0x8500, 0x03d5, 0x3fd1 }, - { 0x8900, 0x03d3, 0x2000 }, - { 0x0900, 0x03d2, 0x0000 }, - { 0x0900, 0x03d4, 0x0000 }, - { 0x8500, 0x03d7, 0x2000 }, - { 0x0500, 0x03d6, 0x0fca }, - { 0x0900, 0x03d8, 0x0001 }, - { 0x8500, 0x03dd, 0x3fff }, - { 0x8500, 0x03db, 0x2fff }, - { 0x0900, 0x03da, 0x0001 }, - { 0x0900, 0x03dc, 0x0001 }, - { 0x8500, 0x03df, 0x2fff }, - { 0x0900, 0x03de, 0x0001 }, - { 0x0900, 0x03e0, 0x0001 }, - { 0x8500, 0x03e9, 0x4fff }, - { 0x8500, 0x03e5, 0x3fff }, - { 0x8500, 0x03e3, 0x2fff }, - { 0x0900, 0x03e2, 0x0001 }, - { 0x0900, 0x03e4, 0x0001 }, - { 0x8500, 0x03e7, 0x2fff }, - { 0x0900, 0x03e6, 0x0001 }, - { 0x0900, 0x03e8, 0x0001 }, - { 0x8500, 0x03ed, 0x3fff }, - { 0x8500, 0x03eb, 0x2fff }, - { 0x0900, 0x03ea, 0x0001 }, - { 0x0900, 0x03ec, 0x0001 }, - { 0x8500, 0x03ef, 0x2fff }, - { 0x0900, 0x03ee, 0x0001 }, - { 0x0500, 0x03f0, 0x0faa }, - { 0x8900, 0x0415, 0x6020 }, - { 0x8900, 0x0405, 0x5050 }, - { 0x8900, 0x03f9, 0x4ff9 }, - { 0x8500, 0x03f5, 0x3fa0 }, - { 0x8500, 0x03f3, 0x2000 }, - { 0x0500, 0x03f2, 0x0007 }, - { 0x0900, 0x03f4, 0x0fc4 }, - { 0x8900, 0x03f7, 0x2001 }, - { 0x1900, 0x03f6, 0x0000 }, - { 0x0500, 0x03f8, 0x0fff }, - { 0x8900, 0x0401, 0x3050 }, - { 0x8500, 0x03fb, 0x2fff }, - { 0x0900, 0x03fa, 0x0001 }, - { 0x0900, 0x0400, 0x0050 }, - { 0x8900, 0x0403, 0x2050 }, - { 0x0900, 0x0402, 0x0050 }, - { 0x0900, 0x0404, 0x0050 }, - { 0x8900, 0x040d, 0x4050 }, - { 0x8900, 0x0409, 0x3050 }, - { 0x8900, 0x0407, 0x2050 }, - { 0x0900, 0x0406, 0x0050 }, - { 0x0900, 0x0408, 0x0050 }, - { 0x8900, 0x040b, 0x2050 }, - { 0x0900, 0x040a, 0x0050 }, - { 0x0900, 0x040c, 0x0050 }, - { 0x8900, 0x0411, 0x3020 }, - { 0x8900, 0x040f, 0x2050 }, - { 0x0900, 0x040e, 0x0050 }, - { 0x0900, 0x0410, 0x0020 }, - { 0x8900, 0x0413, 0x2020 }, - { 0x0900, 0x0412, 0x0020 }, - { 0x0900, 0x0414, 0x0020 }, - { 0x8900, 0x0425, 0x5020 }, - { 0x8900, 0x041d, 0x4020 }, - { 0x8900, 0x0419, 0x3020 }, - { 0x8900, 0x0417, 0x2020 }, - { 0x0900, 0x0416, 0x0020 }, - { 0x0900, 0x0418, 0x0020 }, - { 0x8900, 0x041b, 0x2020 }, - { 0x0900, 0x041a, 0x0020 }, - { 0x0900, 0x041c, 0x0020 }, - { 0x8900, 0x0421, 0x3020 }, - { 0x8900, 0x041f, 0x2020 }, - { 0x0900, 0x041e, 0x0020 }, - { 0x0900, 0x0420, 0x0020 }, - { 0x8900, 0x0423, 0x2020 }, - { 0x0900, 0x0422, 0x0020 }, - { 0x0900, 0x0424, 0x0020 }, - { 0x8900, 0x042d, 0x4020 }, - { 0x8900, 0x0429, 0x3020 }, - { 0x8900, 0x0427, 0x2020 }, - { 0x0900, 0x0426, 0x0020 }, - { 0x0900, 0x0428, 0x0020 }, - { 0x8900, 0x042b, 0x2020 }, - { 0x0900, 0x042a, 0x0020 }, - { 0x0900, 0x042c, 0x0020 }, - { 0x8500, 0x0431, 0x3fe0 }, - { 0x8900, 0x042f, 0x2020 }, - { 0x0900, 0x042e, 0x0020 }, - { 0x0500, 0x0430, 0x0fe0 }, - { 0x8500, 0x0433, 0x2fe0 }, - { 0x0500, 0x0432, 0x0fe0 }, - { 0x0500, 0x0434, 0x0fe0 }, - { 0x8700, 0x06a4, 0xa000 }, - { 0x8500, 0x0563, 0x9fd0 }, - { 0x8900, 0x04b6, 0x8001 }, - { 0x8500, 0x0475, 0x7fff }, - { 0x8500, 0x0455, 0x6fb0 }, - { 0x8500, 0x0445, 0x5fe0 }, - { 0x8500, 0x043d, 0x4fe0 }, - { 0x8500, 0x0439, 0x3fe0 }, - { 0x8500, 0x0437, 0x2fe0 }, - { 0x0500, 0x0436, 0x0fe0 }, - { 0x0500, 0x0438, 0x0fe0 }, - { 0x8500, 0x043b, 0x2fe0 }, - { 0x0500, 0x043a, 0x0fe0 }, - { 0x0500, 0x043c, 0x0fe0 }, - { 0x8500, 0x0441, 0x3fe0 }, - { 0x8500, 0x043f, 0x2fe0 }, - { 0x0500, 0x043e, 0x0fe0 }, - { 0x0500, 0x0440, 0x0fe0 }, - { 0x8500, 0x0443, 0x2fe0 }, - { 0x0500, 0x0442, 0x0fe0 }, - { 0x0500, 0x0444, 0x0fe0 }, - { 0x8500, 0x044d, 0x4fe0 }, - { 0x8500, 0x0449, 0x3fe0 }, - { 0x8500, 0x0447, 0x2fe0 }, - { 0x0500, 0x0446, 0x0fe0 }, - { 0x0500, 0x0448, 0x0fe0 }, - { 0x8500, 0x044b, 0x2fe0 }, - { 0x0500, 0x044a, 0x0fe0 }, - { 0x0500, 0x044c, 0x0fe0 }, - { 0x8500, 0x0451, 0x3fb0 }, - { 0x8500, 0x044f, 0x2fe0 }, - { 0x0500, 0x044e, 0x0fe0 }, - { 0x0500, 0x0450, 0x0fb0 }, - { 0x8500, 0x0453, 0x2fb0 }, - { 0x0500, 0x0452, 0x0fb0 }, - { 0x0500, 0x0454, 0x0fb0 }, - { 0x8500, 0x0465, 0x5fff }, - { 0x8500, 0x045d, 0x4fb0 }, - { 0x8500, 0x0459, 0x3fb0 }, - { 0x8500, 0x0457, 0x2fb0 }, - { 0x0500, 0x0456, 0x0fb0 }, - { 0x0500, 0x0458, 0x0fb0 }, - { 0x8500, 0x045b, 0x2fb0 }, - { 0x0500, 0x045a, 0x0fb0 }, - { 0x0500, 0x045c, 0x0fb0 }, - { 0x8500, 0x0461, 0x3fff }, - { 0x8500, 0x045f, 0x2fb0 }, - { 0x0500, 0x045e, 0x0fb0 }, - { 0x0900, 0x0460, 0x0001 }, - { 0x8500, 0x0463, 0x2fff }, - { 0x0900, 0x0462, 0x0001 }, - { 0x0900, 0x0464, 0x0001 }, - { 0x8500, 0x046d, 0x4fff }, - { 0x8500, 0x0469, 0x3fff }, - { 0x8500, 0x0467, 0x2fff }, - { 0x0900, 0x0466, 0x0001 }, - { 0x0900, 0x0468, 0x0001 }, - { 0x8500, 0x046b, 0x2fff }, - { 0x0900, 0x046a, 0x0001 }, - { 0x0900, 0x046c, 0x0001 }, - { 0x8500, 0x0471, 0x3fff }, - { 0x8500, 0x046f, 0x2fff }, - { 0x0900, 0x046e, 0x0001 }, - { 0x0900, 0x0470, 0x0001 }, - { 0x8500, 0x0473, 0x2fff }, - { 0x0900, 0x0472, 0x0001 }, - { 0x0900, 0x0474, 0x0001 }, - { 0x8900, 0x0496, 0x6001 }, - { 0x8c00, 0x0485, 0x5000 }, - { 0x8500, 0x047d, 0x4fff }, - { 0x8500, 0x0479, 0x3fff }, - { 0x8500, 0x0477, 0x2fff }, - { 0x0900, 0x0476, 0x0001 }, - { 0x0900, 0x0478, 0x0001 }, - { 0x8500, 0x047b, 0x2fff }, - { 0x0900, 0x047a, 0x0001 }, - { 0x0900, 0x047c, 0x0001 }, - { 0x8500, 0x0481, 0x3fff }, - { 0x8500, 0x047f, 0x2fff }, - { 0x0900, 0x047e, 0x0001 }, - { 0x0900, 0x0480, 0x0001 }, - { 0x8c00, 0x0483, 0x2000 }, - { 0x1a00, 0x0482, 0x0000 }, - { 0x0c00, 0x0484, 0x0000 }, - { 0x8900, 0x048e, 0x4001 }, - { 0x8900, 0x048a, 0x3001 }, - { 0x8b00, 0x0488, 0x2000 }, - { 0x0c00, 0x0486, 0x0000 }, - { 0x0b00, 0x0489, 0x0000 }, - { 0x8900, 0x048c, 0x2001 }, - { 0x0500, 0x048b, 0x0fff }, - { 0x0500, 0x048d, 0x0fff }, - { 0x8900, 0x0492, 0x3001 }, - { 0x8900, 0x0490, 0x2001 }, - { 0x0500, 0x048f, 0x0fff }, - { 0x0500, 0x0491, 0x0fff }, - { 0x8900, 0x0494, 0x2001 }, - { 0x0500, 0x0493, 0x0fff }, - { 0x0500, 0x0495, 0x0fff }, - { 0x8900, 0x04a6, 0x5001 }, - { 0x8900, 0x049e, 0x4001 }, - { 0x8900, 0x049a, 0x3001 }, - { 0x8900, 0x0498, 0x2001 }, - { 0x0500, 0x0497, 0x0fff }, - { 0x0500, 0x0499, 0x0fff }, - { 0x8900, 0x049c, 0x2001 }, - { 0x0500, 0x049b, 0x0fff }, - { 0x0500, 0x049d, 0x0fff }, - { 0x8900, 0x04a2, 0x3001 }, - { 0x8900, 0x04a0, 0x2001 }, - { 0x0500, 0x049f, 0x0fff }, - { 0x0500, 0x04a1, 0x0fff }, - { 0x8900, 0x04a4, 0x2001 }, - { 0x0500, 0x04a3, 0x0fff }, - { 0x0500, 0x04a5, 0x0fff }, - { 0x8900, 0x04ae, 0x4001 }, - { 0x8900, 0x04aa, 0x3001 }, - { 0x8900, 0x04a8, 0x2001 }, - { 0x0500, 0x04a7, 0x0fff }, - { 0x0500, 0x04a9, 0x0fff }, - { 0x8900, 0x04ac, 0x2001 }, - { 0x0500, 0x04ab, 0x0fff }, - { 0x0500, 0x04ad, 0x0fff }, - { 0x8900, 0x04b2, 0x3001 }, - { 0x8900, 0x04b0, 0x2001 }, - { 0x0500, 0x04af, 0x0fff }, - { 0x0500, 0x04b1, 0x0fff }, - { 0x8900, 0x04b4, 0x2001 }, - { 0x0500, 0x04b3, 0x0fff }, - { 0x0500, 0x04b5, 0x0fff }, - { 0x8500, 0x04f9, 0x7fff }, - { 0x8500, 0x04d7, 0x6fff }, - { 0x8500, 0x04c6, 0x5fff }, - { 0x8900, 0x04be, 0x4001 }, - { 0x8900, 0x04ba, 0x3001 }, - { 0x8900, 0x04b8, 0x2001 }, - { 0x0500, 0x04b7, 0x0fff }, - { 0x0500, 0x04b9, 0x0fff }, - { 0x8900, 0x04bc, 0x2001 }, - { 0x0500, 0x04bb, 0x0fff }, - { 0x0500, 0x04bd, 0x0fff }, - { 0x8500, 0x04c2, 0x3fff }, - { 0x8900, 0x04c0, 0x2000 }, - { 0x0500, 0x04bf, 0x0fff }, - { 0x0900, 0x04c1, 0x0001 }, - { 0x8500, 0x04c4, 0x2fff }, - { 0x0900, 0x04c3, 0x0001 }, - { 0x0900, 0x04c5, 0x0001 }, - { 0x8500, 0x04ce, 0x4fff }, - { 0x8500, 0x04ca, 0x3fff }, - { 0x8500, 0x04c8, 0x2fff }, - { 0x0900, 0x04c7, 0x0001 }, - { 0x0900, 0x04c9, 0x0001 }, - { 0x8500, 0x04cc, 0x2fff }, - { 0x0900, 0x04cb, 0x0001 }, - { 0x0900, 0x04cd, 0x0001 }, - { 0x8500, 0x04d3, 0x3fff }, - { 0x8500, 0x04d1, 0x2fff }, - { 0x0900, 0x04d0, 0x0001 }, - { 0x0900, 0x04d2, 0x0001 }, - { 0x8500, 0x04d5, 0x2fff }, - { 0x0900, 0x04d4, 0x0001 }, - { 0x0900, 0x04d6, 0x0001 }, - { 0x8500, 0x04e7, 0x5fff }, - { 0x8500, 0x04df, 0x4fff }, - { 0x8500, 0x04db, 0x3fff }, - { 0x8500, 0x04d9, 0x2fff }, - { 0x0900, 0x04d8, 0x0001 }, - { 0x0900, 0x04da, 0x0001 }, - { 0x8500, 0x04dd, 0x2fff }, - { 0x0900, 0x04dc, 0x0001 }, - { 0x0900, 0x04de, 0x0001 }, - { 0x8500, 0x04e3, 0x3fff }, - { 0x8500, 0x04e1, 0x2fff }, - { 0x0900, 0x04e0, 0x0001 }, - { 0x0900, 0x04e2, 0x0001 }, - { 0x8500, 0x04e5, 0x2fff }, - { 0x0900, 0x04e4, 0x0001 }, - { 0x0900, 0x04e6, 0x0001 }, - { 0x8500, 0x04ef, 0x4fff }, - { 0x8500, 0x04eb, 0x3fff }, - { 0x8500, 0x04e9, 0x2fff }, - { 0x0900, 0x04e8, 0x0001 }, - { 0x0900, 0x04ea, 0x0001 }, - { 0x8500, 0x04ed, 0x2fff }, - { 0x0900, 0x04ec, 0x0001 }, - { 0x0900, 0x04ee, 0x0001 }, - { 0x8500, 0x04f3, 0x3fff }, - { 0x8500, 0x04f1, 0x2fff }, - { 0x0900, 0x04f0, 0x0001 }, - { 0x0900, 0x04f2, 0x0001 }, - { 0x8500, 0x04f5, 0x2fff }, - { 0x0900, 0x04f4, 0x0001 }, - { 0x0900, 0x04f8, 0x0001 }, - { 0x8900, 0x0540, 0x6030 }, - { 0x8500, 0x050f, 0x5fff }, - { 0x8500, 0x0507, 0x4fff }, - { 0x8500, 0x0503, 0x3fff }, - { 0x8500, 0x0501, 0x2fff }, - { 0x0900, 0x0500, 0x0001 }, - { 0x0900, 0x0502, 0x0001 }, - { 0x8500, 0x0505, 0x2fff }, - { 0x0900, 0x0504, 0x0001 }, - { 0x0900, 0x0506, 0x0001 }, - { 0x8500, 0x050b, 0x3fff }, - { 0x8500, 0x0509, 0x2fff }, - { 0x0900, 0x0508, 0x0001 }, - { 0x0900, 0x050a, 0x0001 }, - { 0x8500, 0x050d, 0x2fff }, - { 0x0900, 0x050c, 0x0001 }, - { 0x0900, 0x050e, 0x0001 }, - { 0x8900, 0x0538, 0x4030 }, - { 0x8900, 0x0534, 0x3030 }, - { 0x8900, 0x0532, 0x2030 }, - { 0x0900, 0x0531, 0x0030 }, - { 0x0900, 0x0533, 0x0030 }, - { 0x8900, 0x0536, 0x2030 }, - { 0x0900, 0x0535, 0x0030 }, - { 0x0900, 0x0537, 0x0030 }, - { 0x8900, 0x053c, 0x3030 }, - { 0x8900, 0x053a, 0x2030 }, - { 0x0900, 0x0539, 0x0030 }, - { 0x0900, 0x053b, 0x0030 }, - { 0x8900, 0x053e, 0x2030 }, - { 0x0900, 0x053d, 0x0030 }, - { 0x0900, 0x053f, 0x0030 }, - { 0x8900, 0x0550, 0x5030 }, - { 0x8900, 0x0548, 0x4030 }, - { 0x8900, 0x0544, 0x3030 }, - { 0x8900, 0x0542, 0x2030 }, - { 0x0900, 0x0541, 0x0030 }, - { 0x0900, 0x0543, 0x0030 }, - { 0x8900, 0x0546, 0x2030 }, - { 0x0900, 0x0545, 0x0030 }, - { 0x0900, 0x0547, 0x0030 }, - { 0x8900, 0x054c, 0x3030 }, - { 0x8900, 0x054a, 0x2030 }, - { 0x0900, 0x0549, 0x0030 }, - { 0x0900, 0x054b, 0x0030 }, - { 0x8900, 0x054e, 0x2030 }, - { 0x0900, 0x054d, 0x0030 }, - { 0x0900, 0x054f, 0x0030 }, - { 0x9500, 0x055a, 0x4000 }, - { 0x8900, 0x0554, 0x3030 }, - { 0x8900, 0x0552, 0x2030 }, - { 0x0900, 0x0551, 0x0030 }, - { 0x0900, 0x0553, 0x0030 }, - { 0x8900, 0x0556, 0x2030 }, - { 0x0900, 0x0555, 0x0030 }, - { 0x0600, 0x0559, 0x0000 }, - { 0x9500, 0x055e, 0x3000 }, - { 0x9500, 0x055c, 0x2000 }, - { 0x1500, 0x055b, 0x0000 }, - { 0x1500, 0x055d, 0x0000 }, - { 0x8500, 0x0561, 0x2fd0 }, - { 0x1500, 0x055f, 0x0000 }, - { 0x0500, 0x0562, 0x0fd0 }, - { 0x9a00, 0x060f, 0x8000 }, - { 0x8c00, 0x05ab, 0x7000 }, - { 0x8500, 0x0583, 0x6fd0 }, - { 0x8500, 0x0573, 0x5fd0 }, - { 0x8500, 0x056b, 0x4fd0 }, - { 0x8500, 0x0567, 0x3fd0 }, - { 0x8500, 0x0565, 0x2fd0 }, - { 0x0500, 0x0564, 0x0fd0 }, - { 0x0500, 0x0566, 0x0fd0 }, - { 0x8500, 0x0569, 0x2fd0 }, - { 0x0500, 0x0568, 0x0fd0 }, - { 0x0500, 0x056a, 0x0fd0 }, - { 0x8500, 0x056f, 0x3fd0 }, - { 0x8500, 0x056d, 0x2fd0 }, - { 0x0500, 0x056c, 0x0fd0 }, - { 0x0500, 0x056e, 0x0fd0 }, - { 0x8500, 0x0571, 0x2fd0 }, - { 0x0500, 0x0570, 0x0fd0 }, - { 0x0500, 0x0572, 0x0fd0 }, - { 0x8500, 0x057b, 0x4fd0 }, - { 0x8500, 0x0577, 0x3fd0 }, - { 0x8500, 0x0575, 0x2fd0 }, - { 0x0500, 0x0574, 0x0fd0 }, - { 0x0500, 0x0576, 0x0fd0 }, - { 0x8500, 0x0579, 0x2fd0 }, - { 0x0500, 0x0578, 0x0fd0 }, - { 0x0500, 0x057a, 0x0fd0 }, - { 0x8500, 0x057f, 0x3fd0 }, - { 0x8500, 0x057d, 0x2fd0 }, - { 0x0500, 0x057c, 0x0fd0 }, - { 0x0500, 0x057e, 0x0fd0 }, - { 0x8500, 0x0581, 0x2fd0 }, - { 0x0500, 0x0580, 0x0fd0 }, - { 0x0500, 0x0582, 0x0fd0 }, - { 0x8c00, 0x059a, 0x5000 }, - { 0x8c00, 0x0592, 0x4000 }, - { 0x8500, 0x0587, 0x3000 }, - { 0x8500, 0x0585, 0x2fd0 }, - { 0x0500, 0x0584, 0x0fd0 }, - { 0x0500, 0x0586, 0x0fd0 }, - { 0x9100, 0x058a, 0x2000 }, - { 0x1500, 0x0589, 0x0000 }, - { 0x0c00, 0x0591, 0x0000 }, - { 0x8c00, 0x0596, 0x3000 }, - { 0x8c00, 0x0594, 0x2000 }, - { 0x0c00, 0x0593, 0x0000 }, - { 0x0c00, 0x0595, 0x0000 }, - { 0x8c00, 0x0598, 0x2000 }, - { 0x0c00, 0x0597, 0x0000 }, - { 0x0c00, 0x0599, 0x0000 }, - { 0x8c00, 0x05a3, 0x4000 }, - { 0x8c00, 0x059e, 0x3000 }, - { 0x8c00, 0x059c, 0x2000 }, - { 0x0c00, 0x059b, 0x0000 }, - { 0x0c00, 0x059d, 0x0000 }, - { 0x8c00, 0x05a0, 0x2000 }, - { 0x0c00, 0x059f, 0x0000 }, - { 0x0c00, 0x05a1, 0x0000 }, - { 0x8c00, 0x05a7, 0x3000 }, - { 0x8c00, 0x05a5, 0x2000 }, - { 0x0c00, 0x05a4, 0x0000 }, - { 0x0c00, 0x05a6, 0x0000 }, - { 0x8c00, 0x05a9, 0x2000 }, - { 0x0c00, 0x05a8, 0x0000 }, - { 0x0c00, 0x05aa, 0x0000 }, - { 0x8700, 0x05d7, 0x6000 }, - { 0x8c00, 0x05bc, 0x5000 }, - { 0x8c00, 0x05b3, 0x4000 }, - { 0x8c00, 0x05af, 0x3000 }, - { 0x8c00, 0x05ad, 0x2000 }, - { 0x0c00, 0x05ac, 0x0000 }, - { 0x0c00, 0x05ae, 0x0000 }, - { 0x8c00, 0x05b1, 0x2000 }, - { 0x0c00, 0x05b0, 0x0000 }, - { 0x0c00, 0x05b2, 0x0000 }, - { 0x8c00, 0x05b7, 0x3000 }, - { 0x8c00, 0x05b5, 0x2000 }, - { 0x0c00, 0x05b4, 0x0000 }, - { 0x0c00, 0x05b6, 0x0000 }, - { 0x8c00, 0x05b9, 0x2000 }, - { 0x0c00, 0x05b8, 0x0000 }, - { 0x0c00, 0x05bb, 0x0000 }, - { 0x8c00, 0x05c4, 0x4000 }, - { 0x9500, 0x05c0, 0x3000 }, - { 0x9500, 0x05be, 0x2000 }, - { 0x0c00, 0x05bd, 0x0000 }, - { 0x0c00, 0x05bf, 0x0000 }, - { 0x8c00, 0x05c2, 0x2000 }, - { 0x0c00, 0x05c1, 0x0000 }, - { 0x1500, 0x05c3, 0x0000 }, - { 0x8700, 0x05d3, 0x3000 }, - { 0x8700, 0x05d1, 0x2000 }, - { 0x0700, 0x05d0, 0x0000 }, - { 0x0700, 0x05d2, 0x0000 }, - { 0x8700, 0x05d5, 0x2000 }, - { 0x0700, 0x05d4, 0x0000 }, - { 0x0700, 0x05d6, 0x0000 }, - { 0x8700, 0x05e7, 0x5000 }, - { 0x8700, 0x05df, 0x4000 }, - { 0x8700, 0x05db, 0x3000 }, - { 0x8700, 0x05d9, 0x2000 }, - { 0x0700, 0x05d8, 0x0000 }, - { 0x0700, 0x05da, 0x0000 }, - { 0x8700, 0x05dd, 0x2000 }, - { 0x0700, 0x05dc, 0x0000 }, - { 0x0700, 0x05de, 0x0000 }, - { 0x8700, 0x05e3, 0x3000 }, - { 0x8700, 0x05e1, 0x2000 }, - { 0x0700, 0x05e0, 0x0000 }, - { 0x0700, 0x05e2, 0x0000 }, - { 0x8700, 0x05e5, 0x2000 }, - { 0x0700, 0x05e4, 0x0000 }, - { 0x0700, 0x05e6, 0x0000 }, - { 0x9500, 0x05f4, 0x4000 }, - { 0x8700, 0x05f0, 0x3000 }, - { 0x8700, 0x05e9, 0x2000 }, - { 0x0700, 0x05e8, 0x0000 }, - { 0x0700, 0x05ea, 0x0000 }, - { 0x8700, 0x05f2, 0x2000 }, - { 0x0700, 0x05f1, 0x0000 }, - { 0x1500, 0x05f3, 0x0000 }, - { 0x8100, 0x0603, 0x3000 }, - { 0x8100, 0x0601, 0x2000 }, - { 0x0100, 0x0600, 0x0000 }, - { 0x0100, 0x0602, 0x0000 }, - { 0x9500, 0x060d, 0x2000 }, - { 0x1500, 0x060c, 0x0000 }, - { 0x1a00, 0x060e, 0x0000 }, - { 0x8d00, 0x0664, 0x7000 }, - { 0x8700, 0x0638, 0x6000 }, - { 0x8700, 0x0628, 0x5000 }, - { 0x9500, 0x061f, 0x4000 }, - { 0x8c00, 0x0613, 0x3000 }, - { 0x8c00, 0x0611, 0x2000 }, - { 0x0c00, 0x0610, 0x0000 }, - { 0x0c00, 0x0612, 0x0000 }, - { 0x8c00, 0x0615, 0x2000 }, - { 0x0c00, 0x0614, 0x0000 }, - { 0x1500, 0x061b, 0x0000 }, - { 0x8700, 0x0624, 0x3000 }, - { 0x8700, 0x0622, 0x2000 }, - { 0x0700, 0x0621, 0x0000 }, - { 0x0700, 0x0623, 0x0000 }, - { 0x8700, 0x0626, 0x2000 }, - { 0x0700, 0x0625, 0x0000 }, - { 0x0700, 0x0627, 0x0000 }, - { 0x8700, 0x0630, 0x4000 }, - { 0x8700, 0x062c, 0x3000 }, - { 0x8700, 0x062a, 0x2000 }, - { 0x0700, 0x0629, 0x0000 }, - { 0x0700, 0x062b, 0x0000 }, - { 0x8700, 0x062e, 0x2000 }, - { 0x0700, 0x062d, 0x0000 }, - { 0x0700, 0x062f, 0x0000 }, - { 0x8700, 0x0634, 0x3000 }, - { 0x8700, 0x0632, 0x2000 }, - { 0x0700, 0x0631, 0x0000 }, - { 0x0700, 0x0633, 0x0000 }, - { 0x8700, 0x0636, 0x2000 }, - { 0x0700, 0x0635, 0x0000 }, - { 0x0700, 0x0637, 0x0000 }, - { 0x8c00, 0x064d, 0x5000 }, - { 0x8700, 0x0645, 0x4000 }, - { 0x8700, 0x0641, 0x3000 }, - { 0x8700, 0x063a, 0x2000 }, - { 0x0700, 0x0639, 0x0000 }, - { 0x0600, 0x0640, 0x0000 }, - { 0x8700, 0x0643, 0x2000 }, - { 0x0700, 0x0642, 0x0000 }, - { 0x0700, 0x0644, 0x0000 }, - { 0x8700, 0x0649, 0x3000 }, - { 0x8700, 0x0647, 0x2000 }, - { 0x0700, 0x0646, 0x0000 }, - { 0x0700, 0x0648, 0x0000 }, - { 0x8c00, 0x064b, 0x2000 }, - { 0x0700, 0x064a, 0x0000 }, - { 0x0c00, 0x064c, 0x0000 }, - { 0x8c00, 0x0655, 0x4000 }, - { 0x8c00, 0x0651, 0x3000 }, - { 0x8c00, 0x064f, 0x2000 }, - { 0x0c00, 0x064e, 0x0000 }, - { 0x0c00, 0x0650, 0x0000 }, - { 0x8c00, 0x0653, 0x2000 }, - { 0x0c00, 0x0652, 0x0000 }, - { 0x0c00, 0x0654, 0x0000 }, - { 0x8d00, 0x0660, 0x3000 }, - { 0x8c00, 0x0657, 0x2000 }, - { 0x0c00, 0x0656, 0x0000 }, - { 0x0c00, 0x0658, 0x0000 }, - { 0x8d00, 0x0662, 0x2000 }, - { 0x0d00, 0x0661, 0x0000 }, - { 0x0d00, 0x0663, 0x0000 }, - { 0x8700, 0x0684, 0x6000 }, - { 0x8700, 0x0674, 0x5000 }, - { 0x9500, 0x066c, 0x4000 }, - { 0x8d00, 0x0668, 0x3000 }, - { 0x8d00, 0x0666, 0x2000 }, - { 0x0d00, 0x0665, 0x0000 }, - { 0x0d00, 0x0667, 0x0000 }, - { 0x9500, 0x066a, 0x2000 }, - { 0x0d00, 0x0669, 0x0000 }, - { 0x1500, 0x066b, 0x0000 }, - { 0x8c00, 0x0670, 0x3000 }, - { 0x8700, 0x066e, 0x2000 }, - { 0x1500, 0x066d, 0x0000 }, - { 0x0700, 0x066f, 0x0000 }, - { 0x8700, 0x0672, 0x2000 }, - { 0x0700, 0x0671, 0x0000 }, - { 0x0700, 0x0673, 0x0000 }, - { 0x8700, 0x067c, 0x4000 }, - { 0x8700, 0x0678, 0x3000 }, - { 0x8700, 0x0676, 0x2000 }, - { 0x0700, 0x0675, 0x0000 }, - { 0x0700, 0x0677, 0x0000 }, - { 0x8700, 0x067a, 0x2000 }, - { 0x0700, 0x0679, 0x0000 }, - { 0x0700, 0x067b, 0x0000 }, - { 0x8700, 0x0680, 0x3000 }, - { 0x8700, 0x067e, 0x2000 }, - { 0x0700, 0x067d, 0x0000 }, - { 0x0700, 0x067f, 0x0000 }, - { 0x8700, 0x0682, 0x2000 }, - { 0x0700, 0x0681, 0x0000 }, - { 0x0700, 0x0683, 0x0000 }, - { 0x8700, 0x0694, 0x5000 }, - { 0x8700, 0x068c, 0x4000 }, - { 0x8700, 0x0688, 0x3000 }, - { 0x8700, 0x0686, 0x2000 }, - { 0x0700, 0x0685, 0x0000 }, - { 0x0700, 0x0687, 0x0000 }, - { 0x8700, 0x068a, 0x2000 }, - { 0x0700, 0x0689, 0x0000 }, - { 0x0700, 0x068b, 0x0000 }, - { 0x8700, 0x0690, 0x3000 }, - { 0x8700, 0x068e, 0x2000 }, - { 0x0700, 0x068d, 0x0000 }, - { 0x0700, 0x068f, 0x0000 }, - { 0x8700, 0x0692, 0x2000 }, - { 0x0700, 0x0691, 0x0000 }, - { 0x0700, 0x0693, 0x0000 }, - { 0x8700, 0x069c, 0x4000 }, - { 0x8700, 0x0698, 0x3000 }, - { 0x8700, 0x0696, 0x2000 }, - { 0x0700, 0x0695, 0x0000 }, - { 0x0700, 0x0697, 0x0000 }, - { 0x8700, 0x069a, 0x2000 }, - { 0x0700, 0x0699, 0x0000 }, - { 0x0700, 0x069b, 0x0000 }, - { 0x8700, 0x06a0, 0x3000 }, - { 0x8700, 0x069e, 0x2000 }, - { 0x0700, 0x069d, 0x0000 }, - { 0x0700, 0x069f, 0x0000 }, - { 0x8700, 0x06a2, 0x2000 }, - { 0x0700, 0x06a1, 0x0000 }, - { 0x0700, 0x06a3, 0x0000 }, - { 0x8700, 0x0926, 0x9000 }, - { 0x8700, 0x0725, 0x8000 }, - { 0x8c00, 0x06e4, 0x7000 }, - { 0x8700, 0x06c4, 0x6000 }, - { 0x8700, 0x06b4, 0x5000 }, - { 0x8700, 0x06ac, 0x4000 }, - { 0x8700, 0x06a8, 0x3000 }, - { 0x8700, 0x06a6, 0x2000 }, - { 0x0700, 0x06a5, 0x0000 }, - { 0x0700, 0x06a7, 0x0000 }, - { 0x8700, 0x06aa, 0x2000 }, - { 0x0700, 0x06a9, 0x0000 }, - { 0x0700, 0x06ab, 0x0000 }, - { 0x8700, 0x06b0, 0x3000 }, - { 0x8700, 0x06ae, 0x2000 }, - { 0x0700, 0x06ad, 0x0000 }, - { 0x0700, 0x06af, 0x0000 }, - { 0x8700, 0x06b2, 0x2000 }, - { 0x0700, 0x06b1, 0x0000 }, - { 0x0700, 0x06b3, 0x0000 }, - { 0x8700, 0x06bc, 0x4000 }, - { 0x8700, 0x06b8, 0x3000 }, - { 0x8700, 0x06b6, 0x2000 }, - { 0x0700, 0x06b5, 0x0000 }, - { 0x0700, 0x06b7, 0x0000 }, - { 0x8700, 0x06ba, 0x2000 }, - { 0x0700, 0x06b9, 0x0000 }, - { 0x0700, 0x06bb, 0x0000 }, - { 0x8700, 0x06c0, 0x3000 }, - { 0x8700, 0x06be, 0x2000 }, - { 0x0700, 0x06bd, 0x0000 }, - { 0x0700, 0x06bf, 0x0000 }, - { 0x8700, 0x06c2, 0x2000 }, - { 0x0700, 0x06c1, 0x0000 }, - { 0x0700, 0x06c3, 0x0000 }, - { 0x9500, 0x06d4, 0x5000 }, - { 0x8700, 0x06cc, 0x4000 }, - { 0x8700, 0x06c8, 0x3000 }, - { 0x8700, 0x06c6, 0x2000 }, - { 0x0700, 0x06c5, 0x0000 }, - { 0x0700, 0x06c7, 0x0000 }, - { 0x8700, 0x06ca, 0x2000 }, - { 0x0700, 0x06c9, 0x0000 }, - { 0x0700, 0x06cb, 0x0000 }, - { 0x8700, 0x06d0, 0x3000 }, - { 0x8700, 0x06ce, 0x2000 }, - { 0x0700, 0x06cd, 0x0000 }, - { 0x0700, 0x06cf, 0x0000 }, - { 0x8700, 0x06d2, 0x2000 }, - { 0x0700, 0x06d1, 0x0000 }, - { 0x0700, 0x06d3, 0x0000 }, - { 0x8c00, 0x06dc, 0x4000 }, - { 0x8c00, 0x06d8, 0x3000 }, - { 0x8c00, 0x06d6, 0x2000 }, - { 0x0700, 0x06d5, 0x0000 }, - { 0x0c00, 0x06d7, 0x0000 }, - { 0x8c00, 0x06da, 0x2000 }, - { 0x0c00, 0x06d9, 0x0000 }, - { 0x0c00, 0x06db, 0x0000 }, - { 0x8c00, 0x06e0, 0x3000 }, - { 0x8b00, 0x06de, 0x2000 }, - { 0x0100, 0x06dd, 0x0000 }, - { 0x0c00, 0x06df, 0x0000 }, - { 0x8c00, 0x06e2, 0x2000 }, - { 0x0c00, 0x06e1, 0x0000 }, - { 0x0c00, 0x06e3, 0x0000 }, - { 0x9500, 0x0704, 0x6000 }, - { 0x8d00, 0x06f4, 0x5000 }, - { 0x8c00, 0x06ec, 0x4000 }, - { 0x8c00, 0x06e8, 0x3000 }, - { 0x8600, 0x06e6, 0x2000 }, - { 0x0600, 0x06e5, 0x0000 }, - { 0x0c00, 0x06e7, 0x0000 }, - { 0x8c00, 0x06ea, 0x2000 }, - { 0x1a00, 0x06e9, 0x0000 }, - { 0x0c00, 0x06eb, 0x0000 }, - { 0x8d00, 0x06f0, 0x3000 }, - { 0x8700, 0x06ee, 0x2000 }, - { 0x0c00, 0x06ed, 0x0000 }, - { 0x0700, 0x06ef, 0x0000 }, - { 0x8d00, 0x06f2, 0x2000 }, - { 0x0d00, 0x06f1, 0x0000 }, - { 0x0d00, 0x06f3, 0x0000 }, - { 0x8700, 0x06fc, 0x4000 }, - { 0x8d00, 0x06f8, 0x3000 }, - { 0x8d00, 0x06f6, 0x2000 }, - { 0x0d00, 0x06f5, 0x0000 }, - { 0x0d00, 0x06f7, 0x0000 }, - { 0x8700, 0x06fa, 0x2000 }, - { 0x0d00, 0x06f9, 0x0000 }, - { 0x0700, 0x06fb, 0x0000 }, - { 0x9500, 0x0700, 0x3000 }, - { 0x9a00, 0x06fe, 0x2000 }, - { 0x1a00, 0x06fd, 0x0000 }, - { 0x0700, 0x06ff, 0x0000 }, - { 0x9500, 0x0702, 0x2000 }, - { 0x1500, 0x0701, 0x0000 }, - { 0x1500, 0x0703, 0x0000 }, - { 0x8700, 0x0715, 0x5000 }, - { 0x9500, 0x070c, 0x4000 }, - { 0x9500, 0x0708, 0x3000 }, - { 0x9500, 0x0706, 0x2000 }, - { 0x1500, 0x0705, 0x0000 }, - { 0x1500, 0x0707, 0x0000 }, - { 0x9500, 0x070a, 0x2000 }, - { 0x1500, 0x0709, 0x0000 }, - { 0x1500, 0x070b, 0x0000 }, - { 0x8c00, 0x0711, 0x3000 }, - { 0x8100, 0x070f, 0x2000 }, - { 0x1500, 0x070d, 0x0000 }, - { 0x0700, 0x0710, 0x0000 }, - { 0x8700, 0x0713, 0x2000 }, - { 0x0700, 0x0712, 0x0000 }, - { 0x0700, 0x0714, 0x0000 }, - { 0x8700, 0x071d, 0x4000 }, - { 0x8700, 0x0719, 0x3000 }, - { 0x8700, 0x0717, 0x2000 }, - { 0x0700, 0x0716, 0x0000 }, - { 0x0700, 0x0718, 0x0000 }, - { 0x8700, 0x071b, 0x2000 }, - { 0x0700, 0x071a, 0x0000 }, - { 0x0700, 0x071c, 0x0000 }, - { 0x8700, 0x0721, 0x3000 }, - { 0x8700, 0x071f, 0x2000 }, - { 0x0700, 0x071e, 0x0000 }, - { 0x0700, 0x0720, 0x0000 }, - { 0x8700, 0x0723, 0x2000 }, - { 0x0700, 0x0722, 0x0000 }, - { 0x0700, 0x0724, 0x0000 }, - { 0x8700, 0x0797, 0x7000 }, - { 0x8c00, 0x0745, 0x6000 }, - { 0x8c00, 0x0735, 0x5000 }, - { 0x8700, 0x072d, 0x4000 }, - { 0x8700, 0x0729, 0x3000 }, - { 0x8700, 0x0727, 0x2000 }, - { 0x0700, 0x0726, 0x0000 }, - { 0x0700, 0x0728, 0x0000 }, - { 0x8700, 0x072b, 0x2000 }, - { 0x0700, 0x072a, 0x0000 }, - { 0x0700, 0x072c, 0x0000 }, - { 0x8c00, 0x0731, 0x3000 }, - { 0x8700, 0x072f, 0x2000 }, - { 0x0700, 0x072e, 0x0000 }, - { 0x0c00, 0x0730, 0x0000 }, - { 0x8c00, 0x0733, 0x2000 }, - { 0x0c00, 0x0732, 0x0000 }, - { 0x0c00, 0x0734, 0x0000 }, - { 0x8c00, 0x073d, 0x4000 }, - { 0x8c00, 0x0739, 0x3000 }, - { 0x8c00, 0x0737, 0x2000 }, - { 0x0c00, 0x0736, 0x0000 }, - { 0x0c00, 0x0738, 0x0000 }, - { 0x8c00, 0x073b, 0x2000 }, - { 0x0c00, 0x073a, 0x0000 }, - { 0x0c00, 0x073c, 0x0000 }, - { 0x8c00, 0x0741, 0x3000 }, - { 0x8c00, 0x073f, 0x2000 }, - { 0x0c00, 0x073e, 0x0000 }, - { 0x0c00, 0x0740, 0x0000 }, - { 0x8c00, 0x0743, 0x2000 }, - { 0x0c00, 0x0742, 0x0000 }, - { 0x0c00, 0x0744, 0x0000 }, - { 0x8700, 0x0787, 0x5000 }, - { 0x8700, 0x074f, 0x4000 }, - { 0x8c00, 0x0749, 0x3000 }, - { 0x8c00, 0x0747, 0x2000 }, - { 0x0c00, 0x0746, 0x0000 }, - { 0x0c00, 0x0748, 0x0000 }, - { 0x8700, 0x074d, 0x2000 }, - { 0x0c00, 0x074a, 0x0000 }, - { 0x0700, 0x074e, 0x0000 }, - { 0x8700, 0x0783, 0x3000 }, - { 0x8700, 0x0781, 0x2000 }, - { 0x0700, 0x0780, 0x0000 }, - { 0x0700, 0x0782, 0x0000 }, - { 0x8700, 0x0785, 0x2000 }, - { 0x0700, 0x0784, 0x0000 }, - { 0x0700, 0x0786, 0x0000 }, - { 0x8700, 0x078f, 0x4000 }, - { 0x8700, 0x078b, 0x3000 }, - { 0x8700, 0x0789, 0x2000 }, - { 0x0700, 0x0788, 0x0000 }, - { 0x0700, 0x078a, 0x0000 }, - { 0x8700, 0x078d, 0x2000 }, - { 0x0700, 0x078c, 0x0000 }, - { 0x0700, 0x078e, 0x0000 }, - { 0x8700, 0x0793, 0x3000 }, - { 0x8700, 0x0791, 0x2000 }, - { 0x0700, 0x0790, 0x0000 }, - { 0x0700, 0x0792, 0x0000 }, - { 0x8700, 0x0795, 0x2000 }, - { 0x0700, 0x0794, 0x0000 }, - { 0x0700, 0x0796, 0x0000 }, - { 0x8700, 0x0906, 0x6000 }, - { 0x8c00, 0x07a7, 0x5000 }, - { 0x8700, 0x079f, 0x4000 }, - { 0x8700, 0x079b, 0x3000 }, - { 0x8700, 0x0799, 0x2000 }, - { 0x0700, 0x0798, 0x0000 }, - { 0x0700, 0x079a, 0x0000 }, - { 0x8700, 0x079d, 0x2000 }, - { 0x0700, 0x079c, 0x0000 }, - { 0x0700, 0x079e, 0x0000 }, - { 0x8700, 0x07a3, 0x3000 }, - { 0x8700, 0x07a1, 0x2000 }, - { 0x0700, 0x07a0, 0x0000 }, - { 0x0700, 0x07a2, 0x0000 }, - { 0x8700, 0x07a5, 0x2000 }, - { 0x0700, 0x07a4, 0x0000 }, - { 0x0c00, 0x07a6, 0x0000 }, - { 0x8c00, 0x07af, 0x4000 }, - { 0x8c00, 0x07ab, 0x3000 }, - { 0x8c00, 0x07a9, 0x2000 }, - { 0x0c00, 0x07a8, 0x0000 }, - { 0x0c00, 0x07aa, 0x0000 }, - { 0x8c00, 0x07ad, 0x2000 }, - { 0x0c00, 0x07ac, 0x0000 }, - { 0x0c00, 0x07ae, 0x0000 }, - { 0x8c00, 0x0902, 0x3000 }, - { 0x8700, 0x07b1, 0x2000 }, - { 0x0c00, 0x07b0, 0x0000 }, - { 0x0c00, 0x0901, 0x0000 }, - { 0x8700, 0x0904, 0x2000 }, - { 0x0a00, 0x0903, 0x0000 }, - { 0x0700, 0x0905, 0x0000 }, - { 0x8700, 0x0916, 0x5000 }, - { 0x8700, 0x090e, 0x4000 }, - { 0x8700, 0x090a, 0x3000 }, - { 0x8700, 0x0908, 0x2000 }, - { 0x0700, 0x0907, 0x0000 }, - { 0x0700, 0x0909, 0x0000 }, - { 0x8700, 0x090c, 0x2000 }, - { 0x0700, 0x090b, 0x0000 }, - { 0x0700, 0x090d, 0x0000 }, - { 0x8700, 0x0912, 0x3000 }, - { 0x8700, 0x0910, 0x2000 }, - { 0x0700, 0x090f, 0x0000 }, - { 0x0700, 0x0911, 0x0000 }, - { 0x8700, 0x0914, 0x2000 }, - { 0x0700, 0x0913, 0x0000 }, - { 0x0700, 0x0915, 0x0000 }, - { 0x8700, 0x091e, 0x4000 }, - { 0x8700, 0x091a, 0x3000 }, - { 0x8700, 0x0918, 0x2000 }, - { 0x0700, 0x0917, 0x0000 }, - { 0x0700, 0x0919, 0x0000 }, - { 0x8700, 0x091c, 0x2000 }, - { 0x0700, 0x091b, 0x0000 }, - { 0x0700, 0x091d, 0x0000 }, - { 0x8700, 0x0922, 0x3000 }, - { 0x8700, 0x0920, 0x2000 }, - { 0x0700, 0x091f, 0x0000 }, - { 0x0700, 0x0921, 0x0000 }, - { 0x8700, 0x0924, 0x2000 }, - { 0x0700, 0x0923, 0x0000 }, - { 0x0700, 0x0925, 0x0000 }, - { 0x8c00, 0x09cd, 0x8000 }, - { 0x8d00, 0x096d, 0x7000 }, - { 0x8c00, 0x0948, 0x6000 }, - { 0x8700, 0x0936, 0x5000 }, - { 0x8700, 0x092e, 0x4000 }, - { 0x8700, 0x092a, 0x3000 }, - { 0x8700, 0x0928, 0x2000 }, - { 0x0700, 0x0927, 0x0000 }, - { 0x0700, 0x0929, 0x0000 }, - { 0x8700, 0x092c, 0x2000 }, - { 0x0700, 0x092b, 0x0000 }, - { 0x0700, 0x092d, 0x0000 }, - { 0x8700, 0x0932, 0x3000 }, - { 0x8700, 0x0930, 0x2000 }, - { 0x0700, 0x092f, 0x0000 }, - { 0x0700, 0x0931, 0x0000 }, - { 0x8700, 0x0934, 0x2000 }, - { 0x0700, 0x0933, 0x0000 }, - { 0x0700, 0x0935, 0x0000 }, - { 0x8a00, 0x0940, 0x4000 }, - { 0x8c00, 0x093c, 0x3000 }, - { 0x8700, 0x0938, 0x2000 }, - { 0x0700, 0x0937, 0x0000 }, - { 0x0700, 0x0939, 0x0000 }, - { 0x8a00, 0x093e, 0x2000 }, - { 0x0700, 0x093d, 0x0000 }, - { 0x0a00, 0x093f, 0x0000 }, - { 0x8c00, 0x0944, 0x3000 }, - { 0x8c00, 0x0942, 0x2000 }, - { 0x0c00, 0x0941, 0x0000 }, - { 0x0c00, 0x0943, 0x0000 }, - { 0x8c00, 0x0946, 0x2000 }, - { 0x0c00, 0x0945, 0x0000 }, - { 0x0c00, 0x0947, 0x0000 }, - { 0x8700, 0x095d, 0x5000 }, - { 0x8c00, 0x0952, 0x4000 }, - { 0x8a00, 0x094c, 0x3000 }, - { 0x8a00, 0x094a, 0x2000 }, - { 0x0a00, 0x0949, 0x0000 }, - { 0x0a00, 0x094b, 0x0000 }, - { 0x8700, 0x0950, 0x2000 }, - { 0x0c00, 0x094d, 0x0000 }, - { 0x0c00, 0x0951, 0x0000 }, - { 0x8700, 0x0959, 0x3000 }, - { 0x8c00, 0x0954, 0x2000 }, - { 0x0c00, 0x0953, 0x0000 }, - { 0x0700, 0x0958, 0x0000 }, - { 0x8700, 0x095b, 0x2000 }, - { 0x0700, 0x095a, 0x0000 }, - { 0x0700, 0x095c, 0x0000 }, - { 0x9500, 0x0965, 0x4000 }, - { 0x8700, 0x0961, 0x3000 }, - { 0x8700, 0x095f, 0x2000 }, - { 0x0700, 0x095e, 0x0000 }, - { 0x0700, 0x0960, 0x0000 }, - { 0x8c00, 0x0963, 0x2000 }, - { 0x0c00, 0x0962, 0x0000 }, - { 0x1500, 0x0964, 0x0000 }, - { 0x8d00, 0x0969, 0x3000 }, - { 0x8d00, 0x0967, 0x2000 }, - { 0x0d00, 0x0966, 0x0000 }, - { 0x0d00, 0x0968, 0x0000 }, - { 0x8d00, 0x096b, 0x2000 }, - { 0x0d00, 0x096a, 0x0000 }, - { 0x0d00, 0x096c, 0x0000 }, - { 0x8700, 0x09a2, 0x6000 }, - { 0x8700, 0x0990, 0x5000 }, - { 0x8700, 0x0986, 0x4000 }, - { 0x8c00, 0x0981, 0x3000 }, - { 0x8d00, 0x096f, 0x2000 }, - { 0x0d00, 0x096e, 0x0000 }, - { 0x1500, 0x0970, 0x0000 }, - { 0x8a00, 0x0983, 0x2000 }, - { 0x0a00, 0x0982, 0x0000 }, - { 0x0700, 0x0985, 0x0000 }, - { 0x8700, 0x098a, 0x3000 }, - { 0x8700, 0x0988, 0x2000 }, - { 0x0700, 0x0987, 0x0000 }, - { 0x0700, 0x0989, 0x0000 }, - { 0x8700, 0x098c, 0x2000 }, - { 0x0700, 0x098b, 0x0000 }, - { 0x0700, 0x098f, 0x0000 }, - { 0x8700, 0x099a, 0x4000 }, - { 0x8700, 0x0996, 0x3000 }, - { 0x8700, 0x0994, 0x2000 }, - { 0x0700, 0x0993, 0x0000 }, - { 0x0700, 0x0995, 0x0000 }, - { 0x8700, 0x0998, 0x2000 }, - { 0x0700, 0x0997, 0x0000 }, - { 0x0700, 0x0999, 0x0000 }, - { 0x8700, 0x099e, 0x3000 }, - { 0x8700, 0x099c, 0x2000 }, - { 0x0700, 0x099b, 0x0000 }, - { 0x0700, 0x099d, 0x0000 }, - { 0x8700, 0x09a0, 0x2000 }, - { 0x0700, 0x099f, 0x0000 }, - { 0x0700, 0x09a1, 0x0000 }, - { 0x8700, 0x09b7, 0x5000 }, - { 0x8700, 0x09ab, 0x4000 }, - { 0x8700, 0x09a6, 0x3000 }, - { 0x8700, 0x09a4, 0x2000 }, - { 0x0700, 0x09a3, 0x0000 }, - { 0x0700, 0x09a5, 0x0000 }, - { 0x8700, 0x09a8, 0x2000 }, - { 0x0700, 0x09a7, 0x0000 }, - { 0x0700, 0x09aa, 0x0000 }, - { 0x8700, 0x09af, 0x3000 }, - { 0x8700, 0x09ad, 0x2000 }, - { 0x0700, 0x09ac, 0x0000 }, - { 0x0700, 0x09ae, 0x0000 }, - { 0x8700, 0x09b2, 0x2000 }, - { 0x0700, 0x09b0, 0x0000 }, - { 0x0700, 0x09b6, 0x0000 }, - { 0x8c00, 0x09c1, 0x4000 }, - { 0x8700, 0x09bd, 0x3000 }, - { 0x8700, 0x09b9, 0x2000 }, - { 0x0700, 0x09b8, 0x0000 }, - { 0x0c00, 0x09bc, 0x0000 }, - { 0x8a00, 0x09bf, 0x2000 }, - { 0x0a00, 0x09be, 0x0000 }, - { 0x0a00, 0x09c0, 0x0000 }, - { 0x8a00, 0x09c7, 0x3000 }, - { 0x8c00, 0x09c3, 0x2000 }, - { 0x0c00, 0x09c2, 0x0000 }, - { 0x0c00, 0x09c4, 0x0000 }, - { 0x8a00, 0x09cb, 0x2000 }, - { 0x0a00, 0x09c8, 0x0000 }, - { 0x0a00, 0x09cc, 0x0000 }, - { 0x8700, 0x0a2b, 0x7000 }, - { 0x8a00, 0x0a03, 0x6000 }, - { 0x8d00, 0x09ed, 0x5000 }, - { 0x8c00, 0x09e3, 0x4000 }, - { 0x8700, 0x09df, 0x3000 }, - { 0x8700, 0x09dc, 0x2000 }, - { 0x0a00, 0x09d7, 0x0000 }, - { 0x0700, 0x09dd, 0x0000 }, - { 0x8700, 0x09e1, 0x2000 }, - { 0x0700, 0x09e0, 0x0000 }, - { 0x0c00, 0x09e2, 0x0000 }, - { 0x8d00, 0x09e9, 0x3000 }, - { 0x8d00, 0x09e7, 0x2000 }, - { 0x0d00, 0x09e6, 0x0000 }, - { 0x0d00, 0x09e8, 0x0000 }, - { 0x8d00, 0x09eb, 0x2000 }, - { 0x0d00, 0x09ea, 0x0000 }, - { 0x0d00, 0x09ec, 0x0000 }, - { 0x8f00, 0x09f5, 0x4000 }, - { 0x8700, 0x09f1, 0x3000 }, - { 0x8d00, 0x09ef, 0x2000 }, - { 0x0d00, 0x09ee, 0x0000 }, - { 0x0700, 0x09f0, 0x0000 }, - { 0x9700, 0x09f3, 0x2000 }, - { 0x1700, 0x09f2, 0x0000 }, - { 0x0f00, 0x09f4, 0x0000 }, - { 0x8f00, 0x09f9, 0x3000 }, - { 0x8f00, 0x09f7, 0x2000 }, - { 0x0f00, 0x09f6, 0x0000 }, - { 0x0f00, 0x09f8, 0x0000 }, - { 0x8c00, 0x0a01, 0x2000 }, - { 0x1a00, 0x09fa, 0x0000 }, - { 0x0c00, 0x0a02, 0x0000 }, - { 0x8700, 0x0a1a, 0x5000 }, - { 0x8700, 0x0a10, 0x4000 }, - { 0x8700, 0x0a08, 0x3000 }, - { 0x8700, 0x0a06, 0x2000 }, - { 0x0700, 0x0a05, 0x0000 }, - { 0x0700, 0x0a07, 0x0000 }, - { 0x8700, 0x0a0a, 0x2000 }, - { 0x0700, 0x0a09, 0x0000 }, - { 0x0700, 0x0a0f, 0x0000 }, - { 0x8700, 0x0a16, 0x3000 }, - { 0x8700, 0x0a14, 0x2000 }, - { 0x0700, 0x0a13, 0x0000 }, - { 0x0700, 0x0a15, 0x0000 }, - { 0x8700, 0x0a18, 0x2000 }, - { 0x0700, 0x0a17, 0x0000 }, - { 0x0700, 0x0a19, 0x0000 }, - { 0x8700, 0x0a22, 0x4000 }, - { 0x8700, 0x0a1e, 0x3000 }, - { 0x8700, 0x0a1c, 0x2000 }, - { 0x0700, 0x0a1b, 0x0000 }, - { 0x0700, 0x0a1d, 0x0000 }, - { 0x8700, 0x0a20, 0x2000 }, - { 0x0700, 0x0a1f, 0x0000 }, - { 0x0700, 0x0a21, 0x0000 }, - { 0x8700, 0x0a26, 0x3000 }, - { 0x8700, 0x0a24, 0x2000 }, - { 0x0700, 0x0a23, 0x0000 }, - { 0x0700, 0x0a25, 0x0000 }, - { 0x8700, 0x0a28, 0x2000 }, - { 0x0700, 0x0a27, 0x0000 }, - { 0x0700, 0x0a2a, 0x0000 }, - { 0x8d00, 0x0a6a, 0x6000 }, - { 0x8c00, 0x0a41, 0x5000 }, - { 0x8700, 0x0a35, 0x4000 }, - { 0x8700, 0x0a2f, 0x3000 }, - { 0x8700, 0x0a2d, 0x2000 }, - { 0x0700, 0x0a2c, 0x0000 }, - { 0x0700, 0x0a2e, 0x0000 }, - { 0x8700, 0x0a32, 0x2000 }, - { 0x0700, 0x0a30, 0x0000 }, - { 0x0700, 0x0a33, 0x0000 }, - { 0x8c00, 0x0a3c, 0x3000 }, - { 0x8700, 0x0a38, 0x2000 }, - { 0x0700, 0x0a36, 0x0000 }, - { 0x0700, 0x0a39, 0x0000 }, - { 0x8a00, 0x0a3f, 0x2000 }, - { 0x0a00, 0x0a3e, 0x0000 }, - { 0x0a00, 0x0a40, 0x0000 }, - { 0x8700, 0x0a5a, 0x4000 }, - { 0x8c00, 0x0a4b, 0x3000 }, - { 0x8c00, 0x0a47, 0x2000 }, - { 0x0c00, 0x0a42, 0x0000 }, - { 0x0c00, 0x0a48, 0x0000 }, - { 0x8c00, 0x0a4d, 0x2000 }, - { 0x0c00, 0x0a4c, 0x0000 }, - { 0x0700, 0x0a59, 0x0000 }, - { 0x8d00, 0x0a66, 0x3000 }, - { 0x8700, 0x0a5c, 0x2000 }, - { 0x0700, 0x0a5b, 0x0000 }, - { 0x0700, 0x0a5e, 0x0000 }, - { 0x8d00, 0x0a68, 0x2000 }, - { 0x0d00, 0x0a67, 0x0000 }, - { 0x0d00, 0x0a69, 0x0000 }, - { 0x8700, 0x0a87, 0x5000 }, - { 0x8700, 0x0a72, 0x4000 }, - { 0x8d00, 0x0a6e, 0x3000 }, - { 0x8d00, 0x0a6c, 0x2000 }, - { 0x0d00, 0x0a6b, 0x0000 }, - { 0x0d00, 0x0a6d, 0x0000 }, - { 0x8c00, 0x0a70, 0x2000 }, - { 0x0d00, 0x0a6f, 0x0000 }, - { 0x0c00, 0x0a71, 0x0000 }, - { 0x8c00, 0x0a82, 0x3000 }, - { 0x8700, 0x0a74, 0x2000 }, - { 0x0700, 0x0a73, 0x0000 }, - { 0x0c00, 0x0a81, 0x0000 }, - { 0x8700, 0x0a85, 0x2000 }, - { 0x0a00, 0x0a83, 0x0000 }, - { 0x0700, 0x0a86, 0x0000 }, - { 0x8700, 0x0a90, 0x4000 }, - { 0x8700, 0x0a8b, 0x3000 }, - { 0x8700, 0x0a89, 0x2000 }, - { 0x0700, 0x0a88, 0x0000 }, - { 0x0700, 0x0a8a, 0x0000 }, - { 0x8700, 0x0a8d, 0x2000 }, - { 0x0700, 0x0a8c, 0x0000 }, - { 0x0700, 0x0a8f, 0x0000 }, - { 0x8700, 0x0a95, 0x3000 }, - { 0x8700, 0x0a93, 0x2000 }, - { 0x0700, 0x0a91, 0x0000 }, - { 0x0700, 0x0a94, 0x0000 }, - { 0x8700, 0x0a97, 0x2000 }, - { 0x0700, 0x0a96, 0x0000 }, - { 0x0700, 0x0a98, 0x0000 }, - { 0x8700, 0x10ef, 0xb000 }, - { 0x8700, 0x0dc6, 0xa000 }, - { 0x8700, 0x0c31, 0x9000 }, - { 0x8700, 0x0b5f, 0x8000 }, - { 0x8a00, 0x0b03, 0x7000 }, - { 0x8a00, 0x0abe, 0x6000 }, - { 0x8700, 0x0aaa, 0x5000 }, - { 0x8700, 0x0aa1, 0x4000 }, - { 0x8700, 0x0a9d, 0x3000 }, - { 0x8700, 0x0a9b, 0x2000 }, - { 0x0700, 0x0a9a, 0x0000 }, - { 0x0700, 0x0a9c, 0x0000 }, - { 0x8700, 0x0a9f, 0x2000 }, - { 0x0700, 0x0a9e, 0x0000 }, - { 0x0700, 0x0aa0, 0x0000 }, - { 0x8700, 0x0aa5, 0x3000 }, - { 0x8700, 0x0aa3, 0x2000 }, - { 0x0700, 0x0aa2, 0x0000 }, - { 0x0700, 0x0aa4, 0x0000 }, - { 0x8700, 0x0aa7, 0x2000 }, - { 0x0700, 0x0aa6, 0x0000 }, - { 0x0700, 0x0aa8, 0x0000 }, - { 0x8700, 0x0ab3, 0x4000 }, - { 0x8700, 0x0aae, 0x3000 }, - { 0x8700, 0x0aac, 0x2000 }, - { 0x0700, 0x0aab, 0x0000 }, - { 0x0700, 0x0aad, 0x0000 }, - { 0x8700, 0x0ab0, 0x2000 }, - { 0x0700, 0x0aaf, 0x0000 }, - { 0x0700, 0x0ab2, 0x0000 }, - { 0x8700, 0x0ab8, 0x3000 }, - { 0x8700, 0x0ab6, 0x2000 }, - { 0x0700, 0x0ab5, 0x0000 }, - { 0x0700, 0x0ab7, 0x0000 }, - { 0x8c00, 0x0abc, 0x2000 }, - { 0x0700, 0x0ab9, 0x0000 }, - { 0x0700, 0x0abd, 0x0000 }, - { 0x8700, 0x0ae1, 0x5000 }, - { 0x8c00, 0x0ac7, 0x4000 }, - { 0x8c00, 0x0ac2, 0x3000 }, - { 0x8a00, 0x0ac0, 0x2000 }, - { 0x0a00, 0x0abf, 0x0000 }, - { 0x0c00, 0x0ac1, 0x0000 }, - { 0x8c00, 0x0ac4, 0x2000 }, - { 0x0c00, 0x0ac3, 0x0000 }, - { 0x0c00, 0x0ac5, 0x0000 }, - { 0x8a00, 0x0acc, 0x3000 }, - { 0x8a00, 0x0ac9, 0x2000 }, - { 0x0c00, 0x0ac8, 0x0000 }, - { 0x0a00, 0x0acb, 0x0000 }, - { 0x8700, 0x0ad0, 0x2000 }, - { 0x0c00, 0x0acd, 0x0000 }, - { 0x0700, 0x0ae0, 0x0000 }, - { 0x8d00, 0x0aeb, 0x4000 }, - { 0x8d00, 0x0ae7, 0x3000 }, - { 0x8c00, 0x0ae3, 0x2000 }, - { 0x0c00, 0x0ae2, 0x0000 }, - { 0x0d00, 0x0ae6, 0x0000 }, - { 0x8d00, 0x0ae9, 0x2000 }, - { 0x0d00, 0x0ae8, 0x0000 }, - { 0x0d00, 0x0aea, 0x0000 }, - { 0x8d00, 0x0aef, 0x3000 }, - { 0x8d00, 0x0aed, 0x2000 }, - { 0x0d00, 0x0aec, 0x0000 }, - { 0x0d00, 0x0aee, 0x0000 }, - { 0x8c00, 0x0b01, 0x2000 }, - { 0x1700, 0x0af1, 0x0000 }, - { 0x0a00, 0x0b02, 0x0000 }, - { 0x8700, 0x0b28, 0x6000 }, - { 0x8700, 0x0b18, 0x5000 }, - { 0x8700, 0x0b0c, 0x4000 }, - { 0x8700, 0x0b08, 0x3000 }, - { 0x8700, 0x0b06, 0x2000 }, - { 0x0700, 0x0b05, 0x0000 }, - { 0x0700, 0x0b07, 0x0000 }, - { 0x8700, 0x0b0a, 0x2000 }, - { 0x0700, 0x0b09, 0x0000 }, - { 0x0700, 0x0b0b, 0x0000 }, - { 0x8700, 0x0b14, 0x3000 }, - { 0x8700, 0x0b10, 0x2000 }, - { 0x0700, 0x0b0f, 0x0000 }, - { 0x0700, 0x0b13, 0x0000 }, - { 0x8700, 0x0b16, 0x2000 }, - { 0x0700, 0x0b15, 0x0000 }, - { 0x0700, 0x0b17, 0x0000 }, - { 0x8700, 0x0b20, 0x4000 }, - { 0x8700, 0x0b1c, 0x3000 }, - { 0x8700, 0x0b1a, 0x2000 }, - { 0x0700, 0x0b19, 0x0000 }, - { 0x0700, 0x0b1b, 0x0000 }, - { 0x8700, 0x0b1e, 0x2000 }, - { 0x0700, 0x0b1d, 0x0000 }, - { 0x0700, 0x0b1f, 0x0000 }, - { 0x8700, 0x0b24, 0x3000 }, - { 0x8700, 0x0b22, 0x2000 }, - { 0x0700, 0x0b21, 0x0000 }, - { 0x0700, 0x0b23, 0x0000 }, - { 0x8700, 0x0b26, 0x2000 }, - { 0x0700, 0x0b25, 0x0000 }, - { 0x0700, 0x0b27, 0x0000 }, - { 0x8700, 0x0b3d, 0x5000 }, - { 0x8700, 0x0b32, 0x4000 }, - { 0x8700, 0x0b2d, 0x3000 }, - { 0x8700, 0x0b2b, 0x2000 }, - { 0x0700, 0x0b2a, 0x0000 }, - { 0x0700, 0x0b2c, 0x0000 }, - { 0x8700, 0x0b2f, 0x2000 }, - { 0x0700, 0x0b2e, 0x0000 }, - { 0x0700, 0x0b30, 0x0000 }, - { 0x8700, 0x0b37, 0x3000 }, - { 0x8700, 0x0b35, 0x2000 }, - { 0x0700, 0x0b33, 0x0000 }, - { 0x0700, 0x0b36, 0x0000 }, - { 0x8700, 0x0b39, 0x2000 }, - { 0x0700, 0x0b38, 0x0000 }, - { 0x0c00, 0x0b3c, 0x0000 }, - { 0x8a00, 0x0b48, 0x4000 }, - { 0x8c00, 0x0b41, 0x3000 }, - { 0x8c00, 0x0b3f, 0x2000 }, - { 0x0a00, 0x0b3e, 0x0000 }, - { 0x0a00, 0x0b40, 0x0000 }, - { 0x8c00, 0x0b43, 0x2000 }, - { 0x0c00, 0x0b42, 0x0000 }, - { 0x0a00, 0x0b47, 0x0000 }, - { 0x8c00, 0x0b56, 0x3000 }, - { 0x8a00, 0x0b4c, 0x2000 }, - { 0x0a00, 0x0b4b, 0x0000 }, - { 0x0c00, 0x0b4d, 0x0000 }, - { 0x8700, 0x0b5c, 0x2000 }, - { 0x0a00, 0x0b57, 0x0000 }, - { 0x0700, 0x0b5d, 0x0000 }, - { 0x8d00, 0x0be7, 0x7000 }, - { 0x8700, 0x0b9c, 0x6000 }, - { 0x8700, 0x0b83, 0x5000 }, - { 0x8d00, 0x0b6b, 0x4000 }, - { 0x8d00, 0x0b67, 0x3000 }, - { 0x8700, 0x0b61, 0x2000 }, - { 0x0700, 0x0b60, 0x0000 }, - { 0x0d00, 0x0b66, 0x0000 }, - { 0x8d00, 0x0b69, 0x2000 }, - { 0x0d00, 0x0b68, 0x0000 }, - { 0x0d00, 0x0b6a, 0x0000 }, - { 0x8d00, 0x0b6f, 0x3000 }, - { 0x8d00, 0x0b6d, 0x2000 }, - { 0x0d00, 0x0b6c, 0x0000 }, - { 0x0d00, 0x0b6e, 0x0000 }, - { 0x8700, 0x0b71, 0x2000 }, - { 0x1a00, 0x0b70, 0x0000 }, - { 0x0c00, 0x0b82, 0x0000 }, - { 0x8700, 0x0b8f, 0x4000 }, - { 0x8700, 0x0b88, 0x3000 }, - { 0x8700, 0x0b86, 0x2000 }, - { 0x0700, 0x0b85, 0x0000 }, - { 0x0700, 0x0b87, 0x0000 }, - { 0x8700, 0x0b8a, 0x2000 }, - { 0x0700, 0x0b89, 0x0000 }, - { 0x0700, 0x0b8e, 0x0000 }, - { 0x8700, 0x0b94, 0x3000 }, - { 0x8700, 0x0b92, 0x2000 }, - { 0x0700, 0x0b90, 0x0000 }, - { 0x0700, 0x0b93, 0x0000 }, - { 0x8700, 0x0b99, 0x2000 }, - { 0x0700, 0x0b95, 0x0000 }, - { 0x0700, 0x0b9a, 0x0000 }, - { 0x8700, 0x0bb7, 0x5000 }, - { 0x8700, 0x0bae, 0x4000 }, - { 0x8700, 0x0ba4, 0x3000 }, - { 0x8700, 0x0b9f, 0x2000 }, - { 0x0700, 0x0b9e, 0x0000 }, - { 0x0700, 0x0ba3, 0x0000 }, - { 0x8700, 0x0ba9, 0x2000 }, - { 0x0700, 0x0ba8, 0x0000 }, - { 0x0700, 0x0baa, 0x0000 }, - { 0x8700, 0x0bb2, 0x3000 }, - { 0x8700, 0x0bb0, 0x2000 }, - { 0x0700, 0x0baf, 0x0000 }, - { 0x0700, 0x0bb1, 0x0000 }, - { 0x8700, 0x0bb4, 0x2000 }, - { 0x0700, 0x0bb3, 0x0000 }, - { 0x0700, 0x0bb5, 0x0000 }, - { 0x8a00, 0x0bc6, 0x4000 }, - { 0x8a00, 0x0bbf, 0x3000 }, - { 0x8700, 0x0bb9, 0x2000 }, - { 0x0700, 0x0bb8, 0x0000 }, - { 0x0a00, 0x0bbe, 0x0000 }, - { 0x8a00, 0x0bc1, 0x2000 }, - { 0x0c00, 0x0bc0, 0x0000 }, - { 0x0a00, 0x0bc2, 0x0000 }, - { 0x8a00, 0x0bcb, 0x3000 }, - { 0x8a00, 0x0bc8, 0x2000 }, - { 0x0a00, 0x0bc7, 0x0000 }, - { 0x0a00, 0x0bca, 0x0000 }, - { 0x8c00, 0x0bcd, 0x2000 }, - { 0x0a00, 0x0bcc, 0x0000 }, - { 0x0a00, 0x0bd7, 0x0000 }, - { 0x8700, 0x0c0f, 0x6000 }, - { 0x9a00, 0x0bf7, 0x5000 }, - { 0x8d00, 0x0bef, 0x4000 }, - { 0x8d00, 0x0beb, 0x3000 }, - { 0x8d00, 0x0be9, 0x2000 }, - { 0x0d00, 0x0be8, 0x0000 }, - { 0x0d00, 0x0bea, 0x0000 }, - { 0x8d00, 0x0bed, 0x2000 }, - { 0x0d00, 0x0bec, 0x0000 }, - { 0x0d00, 0x0bee, 0x0000 }, - { 0x9a00, 0x0bf3, 0x3000 }, - { 0x8f00, 0x0bf1, 0x2000 }, - { 0x0f00, 0x0bf0, 0x0000 }, - { 0x0f00, 0x0bf2, 0x0000 }, - { 0x9a00, 0x0bf5, 0x2000 }, - { 0x1a00, 0x0bf4, 0x0000 }, - { 0x1a00, 0x0bf6, 0x0000 }, - { 0x8700, 0x0c06, 0x4000 }, - { 0x8a00, 0x0c01, 0x3000 }, - { 0x9700, 0x0bf9, 0x2000 }, - { 0x1a00, 0x0bf8, 0x0000 }, - { 0x1a00, 0x0bfa, 0x0000 }, - { 0x8a00, 0x0c03, 0x2000 }, - { 0x0a00, 0x0c02, 0x0000 }, - { 0x0700, 0x0c05, 0x0000 }, - { 0x8700, 0x0c0a, 0x3000 }, - { 0x8700, 0x0c08, 0x2000 }, - { 0x0700, 0x0c07, 0x0000 }, - { 0x0700, 0x0c09, 0x0000 }, - { 0x8700, 0x0c0c, 0x2000 }, - { 0x0700, 0x0c0b, 0x0000 }, - { 0x0700, 0x0c0e, 0x0000 }, - { 0x8700, 0x0c20, 0x5000 }, - { 0x8700, 0x0c18, 0x4000 }, - { 0x8700, 0x0c14, 0x3000 }, - { 0x8700, 0x0c12, 0x2000 }, - { 0x0700, 0x0c10, 0x0000 }, - { 0x0700, 0x0c13, 0x0000 }, - { 0x8700, 0x0c16, 0x2000 }, - { 0x0700, 0x0c15, 0x0000 }, - { 0x0700, 0x0c17, 0x0000 }, - { 0x8700, 0x0c1c, 0x3000 }, - { 0x8700, 0x0c1a, 0x2000 }, - { 0x0700, 0x0c19, 0x0000 }, - { 0x0700, 0x0c1b, 0x0000 }, - { 0x8700, 0x0c1e, 0x2000 }, - { 0x0700, 0x0c1d, 0x0000 }, - { 0x0700, 0x0c1f, 0x0000 }, - { 0x8700, 0x0c28, 0x4000 }, - { 0x8700, 0x0c24, 0x3000 }, - { 0x8700, 0x0c22, 0x2000 }, - { 0x0700, 0x0c21, 0x0000 }, - { 0x0700, 0x0c23, 0x0000 }, - { 0x8700, 0x0c26, 0x2000 }, - { 0x0700, 0x0c25, 0x0000 }, - { 0x0700, 0x0c27, 0x0000 }, - { 0x8700, 0x0c2d, 0x3000 }, - { 0x8700, 0x0c2b, 0x2000 }, - { 0x0700, 0x0c2a, 0x0000 }, - { 0x0700, 0x0c2c, 0x0000 }, - { 0x8700, 0x0c2f, 0x2000 }, - { 0x0700, 0x0c2e, 0x0000 }, - { 0x0700, 0x0c30, 0x0000 }, - { 0x8700, 0x0d0e, 0x8000 }, - { 0x8700, 0x0ca1, 0x7000 }, - { 0x8d00, 0x0c6c, 0x6000 }, - { 0x8c00, 0x0c47, 0x5000 }, - { 0x8c00, 0x0c3e, 0x4000 }, - { 0x8700, 0x0c36, 0x3000 }, - { 0x8700, 0x0c33, 0x2000 }, - { 0x0700, 0x0c32, 0x0000 }, - { 0x0700, 0x0c35, 0x0000 }, - { 0x8700, 0x0c38, 0x2000 }, - { 0x0700, 0x0c37, 0x0000 }, - { 0x0700, 0x0c39, 0x0000 }, - { 0x8a00, 0x0c42, 0x3000 }, - { 0x8c00, 0x0c40, 0x2000 }, - { 0x0c00, 0x0c3f, 0x0000 }, - { 0x0a00, 0x0c41, 0x0000 }, - { 0x8a00, 0x0c44, 0x2000 }, - { 0x0a00, 0x0c43, 0x0000 }, - { 0x0c00, 0x0c46, 0x0000 }, - { 0x8700, 0x0c60, 0x4000 }, - { 0x8c00, 0x0c4c, 0x3000 }, - { 0x8c00, 0x0c4a, 0x2000 }, - { 0x0c00, 0x0c48, 0x0000 }, - { 0x0c00, 0x0c4b, 0x0000 }, - { 0x8c00, 0x0c55, 0x2000 }, - { 0x0c00, 0x0c4d, 0x0000 }, - { 0x0c00, 0x0c56, 0x0000 }, - { 0x8d00, 0x0c68, 0x3000 }, - { 0x8d00, 0x0c66, 0x2000 }, - { 0x0700, 0x0c61, 0x0000 }, - { 0x0d00, 0x0c67, 0x0000 }, - { 0x8d00, 0x0c6a, 0x2000 }, - { 0x0d00, 0x0c69, 0x0000 }, - { 0x0d00, 0x0c6b, 0x0000 }, - { 0x8700, 0x0c90, 0x5000 }, - { 0x8700, 0x0c87, 0x4000 }, - { 0x8a00, 0x0c82, 0x3000 }, - { 0x8d00, 0x0c6e, 0x2000 }, - { 0x0d00, 0x0c6d, 0x0000 }, - { 0x0d00, 0x0c6f, 0x0000 }, - { 0x8700, 0x0c85, 0x2000 }, - { 0x0a00, 0x0c83, 0x0000 }, - { 0x0700, 0x0c86, 0x0000 }, - { 0x8700, 0x0c8b, 0x3000 }, - { 0x8700, 0x0c89, 0x2000 }, - { 0x0700, 0x0c88, 0x0000 }, - { 0x0700, 0x0c8a, 0x0000 }, - { 0x8700, 0x0c8e, 0x2000 }, - { 0x0700, 0x0c8c, 0x0000 }, - { 0x0700, 0x0c8f, 0x0000 }, - { 0x8700, 0x0c99, 0x4000 }, - { 0x8700, 0x0c95, 0x3000 }, - { 0x8700, 0x0c93, 0x2000 }, - { 0x0700, 0x0c92, 0x0000 }, - { 0x0700, 0x0c94, 0x0000 }, - { 0x8700, 0x0c97, 0x2000 }, - { 0x0700, 0x0c96, 0x0000 }, - { 0x0700, 0x0c98, 0x0000 }, - { 0x8700, 0x0c9d, 0x3000 }, - { 0x8700, 0x0c9b, 0x2000 }, - { 0x0700, 0x0c9a, 0x0000 }, - { 0x0700, 0x0c9c, 0x0000 }, - { 0x8700, 0x0c9f, 0x2000 }, - { 0x0700, 0x0c9e, 0x0000 }, - { 0x0700, 0x0ca0, 0x0000 }, - { 0x8c00, 0x0cc6, 0x6000 }, - { 0x8700, 0x0cb2, 0x5000 }, - { 0x8700, 0x0caa, 0x4000 }, - { 0x8700, 0x0ca5, 0x3000 }, - { 0x8700, 0x0ca3, 0x2000 }, - { 0x0700, 0x0ca2, 0x0000 }, - { 0x0700, 0x0ca4, 0x0000 }, - { 0x8700, 0x0ca7, 0x2000 }, - { 0x0700, 0x0ca6, 0x0000 }, - { 0x0700, 0x0ca8, 0x0000 }, - { 0x8700, 0x0cae, 0x3000 }, - { 0x8700, 0x0cac, 0x2000 }, - { 0x0700, 0x0cab, 0x0000 }, - { 0x0700, 0x0cad, 0x0000 }, - { 0x8700, 0x0cb0, 0x2000 }, - { 0x0700, 0x0caf, 0x0000 }, - { 0x0700, 0x0cb1, 0x0000 }, - { 0x8700, 0x0cbd, 0x4000 }, - { 0x8700, 0x0cb7, 0x3000 }, - { 0x8700, 0x0cb5, 0x2000 }, - { 0x0700, 0x0cb3, 0x0000 }, - { 0x0700, 0x0cb6, 0x0000 }, - { 0x8700, 0x0cb9, 0x2000 }, - { 0x0700, 0x0cb8, 0x0000 }, - { 0x0c00, 0x0cbc, 0x0000 }, - { 0x8a00, 0x0cc1, 0x3000 }, - { 0x8c00, 0x0cbf, 0x2000 }, - { 0x0a00, 0x0cbe, 0x0000 }, - { 0x0a00, 0x0cc0, 0x0000 }, - { 0x8a00, 0x0cc3, 0x2000 }, - { 0x0a00, 0x0cc2, 0x0000 }, - { 0x0a00, 0x0cc4, 0x0000 }, - { 0x8d00, 0x0cea, 0x5000 }, - { 0x8a00, 0x0cd6, 0x4000 }, - { 0x8a00, 0x0ccb, 0x3000 }, - { 0x8a00, 0x0cc8, 0x2000 }, - { 0x0a00, 0x0cc7, 0x0000 }, - { 0x0a00, 0x0cca, 0x0000 }, - { 0x8c00, 0x0ccd, 0x2000 }, - { 0x0c00, 0x0ccc, 0x0000 }, - { 0x0a00, 0x0cd5, 0x0000 }, - { 0x8d00, 0x0ce6, 0x3000 }, - { 0x8700, 0x0ce0, 0x2000 }, - { 0x0700, 0x0cde, 0x0000 }, - { 0x0700, 0x0ce1, 0x0000 }, - { 0x8d00, 0x0ce8, 0x2000 }, - { 0x0d00, 0x0ce7, 0x0000 }, - { 0x0d00, 0x0ce9, 0x0000 }, - { 0x8700, 0x0d05, 0x4000 }, - { 0x8d00, 0x0cee, 0x3000 }, - { 0x8d00, 0x0cec, 0x2000 }, - { 0x0d00, 0x0ceb, 0x0000 }, - { 0x0d00, 0x0ced, 0x0000 }, - { 0x8a00, 0x0d02, 0x2000 }, - { 0x0d00, 0x0cef, 0x0000 }, - { 0x0a00, 0x0d03, 0x0000 }, - { 0x8700, 0x0d09, 0x3000 }, - { 0x8700, 0x0d07, 0x2000 }, - { 0x0700, 0x0d06, 0x0000 }, - { 0x0700, 0x0d08, 0x0000 }, - { 0x8700, 0x0d0b, 0x2000 }, - { 0x0700, 0x0d0a, 0x0000 }, - { 0x0700, 0x0d0c, 0x0000 }, - { 0x8d00, 0x0d6c, 0x7000 }, - { 0x8700, 0x0d30, 0x6000 }, - { 0x8700, 0x0d1f, 0x5000 }, - { 0x8700, 0x0d17, 0x4000 }, - { 0x8700, 0x0d13, 0x3000 }, - { 0x8700, 0x0d10, 0x2000 }, - { 0x0700, 0x0d0f, 0x0000 }, - { 0x0700, 0x0d12, 0x0000 }, - { 0x8700, 0x0d15, 0x2000 }, - { 0x0700, 0x0d14, 0x0000 }, - { 0x0700, 0x0d16, 0x0000 }, - { 0x8700, 0x0d1b, 0x3000 }, - { 0x8700, 0x0d19, 0x2000 }, - { 0x0700, 0x0d18, 0x0000 }, - { 0x0700, 0x0d1a, 0x0000 }, - { 0x8700, 0x0d1d, 0x2000 }, - { 0x0700, 0x0d1c, 0x0000 }, - { 0x0700, 0x0d1e, 0x0000 }, - { 0x8700, 0x0d27, 0x4000 }, - { 0x8700, 0x0d23, 0x3000 }, - { 0x8700, 0x0d21, 0x2000 }, - { 0x0700, 0x0d20, 0x0000 }, - { 0x0700, 0x0d22, 0x0000 }, - { 0x8700, 0x0d25, 0x2000 }, - { 0x0700, 0x0d24, 0x0000 }, - { 0x0700, 0x0d26, 0x0000 }, - { 0x8700, 0x0d2c, 0x3000 }, - { 0x8700, 0x0d2a, 0x2000 }, - { 0x0700, 0x0d28, 0x0000 }, - { 0x0700, 0x0d2b, 0x0000 }, - { 0x8700, 0x0d2e, 0x2000 }, - { 0x0700, 0x0d2d, 0x0000 }, - { 0x0700, 0x0d2f, 0x0000 }, - { 0x8a00, 0x0d46, 0x5000 }, - { 0x8700, 0x0d38, 0x4000 }, - { 0x8700, 0x0d34, 0x3000 }, - { 0x8700, 0x0d32, 0x2000 }, - { 0x0700, 0x0d31, 0x0000 }, - { 0x0700, 0x0d33, 0x0000 }, - { 0x8700, 0x0d36, 0x2000 }, - { 0x0700, 0x0d35, 0x0000 }, - { 0x0700, 0x0d37, 0x0000 }, - { 0x8a00, 0x0d40, 0x3000 }, - { 0x8a00, 0x0d3e, 0x2000 }, - { 0x0700, 0x0d39, 0x0000 }, - { 0x0a00, 0x0d3f, 0x0000 }, - { 0x8c00, 0x0d42, 0x2000 }, - { 0x0c00, 0x0d41, 0x0000 }, - { 0x0c00, 0x0d43, 0x0000 }, - { 0x8700, 0x0d60, 0x4000 }, - { 0x8a00, 0x0d4b, 0x3000 }, - { 0x8a00, 0x0d48, 0x2000 }, - { 0x0a00, 0x0d47, 0x0000 }, - { 0x0a00, 0x0d4a, 0x0000 }, - { 0x8c00, 0x0d4d, 0x2000 }, - { 0x0a00, 0x0d4c, 0x0000 }, - { 0x0a00, 0x0d57, 0x0000 }, - { 0x8d00, 0x0d68, 0x3000 }, - { 0x8d00, 0x0d66, 0x2000 }, - { 0x0700, 0x0d61, 0x0000 }, - { 0x0d00, 0x0d67, 0x0000 }, - { 0x8d00, 0x0d6a, 0x2000 }, - { 0x0d00, 0x0d69, 0x0000 }, - { 0x0d00, 0x0d6b, 0x0000 }, - { 0x8700, 0x0da2, 0x6000 }, - { 0x8700, 0x0d8f, 0x5000 }, - { 0x8700, 0x0d87, 0x4000 }, - { 0x8a00, 0x0d82, 0x3000 }, - { 0x8d00, 0x0d6e, 0x2000 }, - { 0x0d00, 0x0d6d, 0x0000 }, - { 0x0d00, 0x0d6f, 0x0000 }, - { 0x8700, 0x0d85, 0x2000 }, - { 0x0a00, 0x0d83, 0x0000 }, - { 0x0700, 0x0d86, 0x0000 }, - { 0x8700, 0x0d8b, 0x3000 }, - { 0x8700, 0x0d89, 0x2000 }, - { 0x0700, 0x0d88, 0x0000 }, - { 0x0700, 0x0d8a, 0x0000 }, - { 0x8700, 0x0d8d, 0x2000 }, - { 0x0700, 0x0d8c, 0x0000 }, - { 0x0700, 0x0d8e, 0x0000 }, - { 0x8700, 0x0d9a, 0x4000 }, - { 0x8700, 0x0d93, 0x3000 }, - { 0x8700, 0x0d91, 0x2000 }, - { 0x0700, 0x0d90, 0x0000 }, - { 0x0700, 0x0d92, 0x0000 }, - { 0x8700, 0x0d95, 0x2000 }, - { 0x0700, 0x0d94, 0x0000 }, - { 0x0700, 0x0d96, 0x0000 }, - { 0x8700, 0x0d9e, 0x3000 }, - { 0x8700, 0x0d9c, 0x2000 }, - { 0x0700, 0x0d9b, 0x0000 }, - { 0x0700, 0x0d9d, 0x0000 }, - { 0x8700, 0x0da0, 0x2000 }, - { 0x0700, 0x0d9f, 0x0000 }, - { 0x0700, 0x0da1, 0x0000 }, - { 0x8700, 0x0db3, 0x5000 }, - { 0x8700, 0x0daa, 0x4000 }, - { 0x8700, 0x0da6, 0x3000 }, - { 0x8700, 0x0da4, 0x2000 }, - { 0x0700, 0x0da3, 0x0000 }, - { 0x0700, 0x0da5, 0x0000 }, - { 0x8700, 0x0da8, 0x2000 }, - { 0x0700, 0x0da7, 0x0000 }, - { 0x0700, 0x0da9, 0x0000 }, - { 0x8700, 0x0dae, 0x3000 }, - { 0x8700, 0x0dac, 0x2000 }, - { 0x0700, 0x0dab, 0x0000 }, - { 0x0700, 0x0dad, 0x0000 }, - { 0x8700, 0x0db0, 0x2000 }, - { 0x0700, 0x0daf, 0x0000 }, - { 0x0700, 0x0db1, 0x0000 }, - { 0x8700, 0x0dbb, 0x4000 }, - { 0x8700, 0x0db7, 0x3000 }, - { 0x8700, 0x0db5, 0x2000 }, - { 0x0700, 0x0db4, 0x0000 }, - { 0x0700, 0x0db6, 0x0000 }, - { 0x8700, 0x0db9, 0x2000 }, - { 0x0700, 0x0db8, 0x0000 }, - { 0x0700, 0x0dba, 0x0000 }, - { 0x8700, 0x0dc2, 0x3000 }, - { 0x8700, 0x0dc0, 0x2000 }, - { 0x0700, 0x0dbd, 0x0000 }, - { 0x0700, 0x0dc1, 0x0000 }, - { 0x8700, 0x0dc4, 0x2000 }, - { 0x0700, 0x0dc3, 0x0000 }, - { 0x0700, 0x0dc5, 0x0000 }, - { 0x8700, 0x0f55, 0x9000 }, - { 0x8700, 0x0ea5, 0x8000 }, - { 0x8700, 0x0e2d, 0x7000 }, - { 0x8700, 0x0e0d, 0x6000 }, - { 0x8a00, 0x0ddf, 0x5000 }, - { 0x8c00, 0x0dd6, 0x4000 }, - { 0x8a00, 0x0dd1, 0x3000 }, - { 0x8a00, 0x0dcf, 0x2000 }, - { 0x0c00, 0x0dca, 0x0000 }, - { 0x0a00, 0x0dd0, 0x0000 }, - { 0x8c00, 0x0dd3, 0x2000 }, - { 0x0c00, 0x0dd2, 0x0000 }, - { 0x0c00, 0x0dd4, 0x0000 }, - { 0x8a00, 0x0ddb, 0x3000 }, - { 0x8a00, 0x0dd9, 0x2000 }, - { 0x0a00, 0x0dd8, 0x0000 }, - { 0x0a00, 0x0dda, 0x0000 }, - { 0x8a00, 0x0ddd, 0x2000 }, - { 0x0a00, 0x0ddc, 0x0000 }, - { 0x0a00, 0x0dde, 0x0000 }, - { 0x8700, 0x0e05, 0x4000 }, - { 0x8700, 0x0e01, 0x3000 }, - { 0x8a00, 0x0df3, 0x2000 }, - { 0x0a00, 0x0df2, 0x0000 }, - { 0x1500, 0x0df4, 0x0000 }, - { 0x8700, 0x0e03, 0x2000 }, - { 0x0700, 0x0e02, 0x0000 }, - { 0x0700, 0x0e04, 0x0000 }, - { 0x8700, 0x0e09, 0x3000 }, - { 0x8700, 0x0e07, 0x2000 }, - { 0x0700, 0x0e06, 0x0000 }, - { 0x0700, 0x0e08, 0x0000 }, - { 0x8700, 0x0e0b, 0x2000 }, - { 0x0700, 0x0e0a, 0x0000 }, - { 0x0700, 0x0e0c, 0x0000 }, - { 0x8700, 0x0e1d, 0x5000 }, - { 0x8700, 0x0e15, 0x4000 }, - { 0x8700, 0x0e11, 0x3000 }, - { 0x8700, 0x0e0f, 0x2000 }, - { 0x0700, 0x0e0e, 0x0000 }, - { 0x0700, 0x0e10, 0x0000 }, - { 0x8700, 0x0e13, 0x2000 }, - { 0x0700, 0x0e12, 0x0000 }, - { 0x0700, 0x0e14, 0x0000 }, - { 0x8700, 0x0e19, 0x3000 }, - { 0x8700, 0x0e17, 0x2000 }, - { 0x0700, 0x0e16, 0x0000 }, - { 0x0700, 0x0e18, 0x0000 }, - { 0x8700, 0x0e1b, 0x2000 }, - { 0x0700, 0x0e1a, 0x0000 }, - { 0x0700, 0x0e1c, 0x0000 }, - { 0x8700, 0x0e25, 0x4000 }, - { 0x8700, 0x0e21, 0x3000 }, - { 0x8700, 0x0e1f, 0x2000 }, - { 0x0700, 0x0e1e, 0x0000 }, - { 0x0700, 0x0e20, 0x0000 }, - { 0x8700, 0x0e23, 0x2000 }, - { 0x0700, 0x0e22, 0x0000 }, - { 0x0700, 0x0e24, 0x0000 }, - { 0x8700, 0x0e29, 0x3000 }, - { 0x8700, 0x0e27, 0x2000 }, - { 0x0700, 0x0e26, 0x0000 }, - { 0x0700, 0x0e28, 0x0000 }, - { 0x8700, 0x0e2b, 0x2000 }, - { 0x0700, 0x0e2a, 0x0000 }, - { 0x0700, 0x0e2c, 0x0000 }, - { 0x8d00, 0x0e51, 0x6000 }, - { 0x8700, 0x0e41, 0x5000 }, - { 0x8c00, 0x0e35, 0x4000 }, - { 0x8c00, 0x0e31, 0x3000 }, - { 0x8700, 0x0e2f, 0x2000 }, - { 0x0700, 0x0e2e, 0x0000 }, - { 0x0700, 0x0e30, 0x0000 }, - { 0x8700, 0x0e33, 0x2000 }, - { 0x0700, 0x0e32, 0x0000 }, - { 0x0c00, 0x0e34, 0x0000 }, - { 0x8c00, 0x0e39, 0x3000 }, - { 0x8c00, 0x0e37, 0x2000 }, - { 0x0c00, 0x0e36, 0x0000 }, - { 0x0c00, 0x0e38, 0x0000 }, - { 0x9700, 0x0e3f, 0x2000 }, - { 0x0c00, 0x0e3a, 0x0000 }, - { 0x0700, 0x0e40, 0x0000 }, - { 0x8c00, 0x0e49, 0x4000 }, - { 0x8700, 0x0e45, 0x3000 }, - { 0x8700, 0x0e43, 0x2000 }, - { 0x0700, 0x0e42, 0x0000 }, - { 0x0700, 0x0e44, 0x0000 }, - { 0x8c00, 0x0e47, 0x2000 }, - { 0x0600, 0x0e46, 0x0000 }, - { 0x0c00, 0x0e48, 0x0000 }, - { 0x8c00, 0x0e4d, 0x3000 }, - { 0x8c00, 0x0e4b, 0x2000 }, - { 0x0c00, 0x0e4a, 0x0000 }, - { 0x0c00, 0x0e4c, 0x0000 }, - { 0x9500, 0x0e4f, 0x2000 }, - { 0x0c00, 0x0e4e, 0x0000 }, - { 0x0d00, 0x0e50, 0x0000 }, - { 0x8700, 0x0e8a, 0x5000 }, - { 0x8d00, 0x0e59, 0x4000 }, - { 0x8d00, 0x0e55, 0x3000 }, - { 0x8d00, 0x0e53, 0x2000 }, - { 0x0d00, 0x0e52, 0x0000 }, - { 0x0d00, 0x0e54, 0x0000 }, - { 0x8d00, 0x0e57, 0x2000 }, - { 0x0d00, 0x0e56, 0x0000 }, - { 0x0d00, 0x0e58, 0x0000 }, - { 0x8700, 0x0e82, 0x3000 }, - { 0x9500, 0x0e5b, 0x2000 }, - { 0x1500, 0x0e5a, 0x0000 }, - { 0x0700, 0x0e81, 0x0000 }, - { 0x8700, 0x0e87, 0x2000 }, - { 0x0700, 0x0e84, 0x0000 }, - { 0x0700, 0x0e88, 0x0000 }, - { 0x8700, 0x0e9b, 0x4000 }, - { 0x8700, 0x0e96, 0x3000 }, - { 0x8700, 0x0e94, 0x2000 }, - { 0x0700, 0x0e8d, 0x0000 }, - { 0x0700, 0x0e95, 0x0000 }, - { 0x8700, 0x0e99, 0x2000 }, - { 0x0700, 0x0e97, 0x0000 }, - { 0x0700, 0x0e9a, 0x0000 }, - { 0x8700, 0x0e9f, 0x3000 }, - { 0x8700, 0x0e9d, 0x2000 }, - { 0x0700, 0x0e9c, 0x0000 }, - { 0x0700, 0x0e9e, 0x0000 }, - { 0x8700, 0x0ea2, 0x2000 }, - { 0x0700, 0x0ea1, 0x0000 }, - { 0x0700, 0x0ea3, 0x0000 }, - { 0x9a00, 0x0f14, 0x7000 }, - { 0x8d00, 0x0ed0, 0x6000 }, - { 0x8c00, 0x0eb9, 0x5000 }, - { 0x8c00, 0x0eb1, 0x4000 }, - { 0x8700, 0x0ead, 0x3000 }, - { 0x8700, 0x0eaa, 0x2000 }, - { 0x0700, 0x0ea7, 0x0000 }, - { 0x0700, 0x0eab, 0x0000 }, - { 0x8700, 0x0eaf, 0x2000 }, - { 0x0700, 0x0eae, 0x0000 }, - { 0x0700, 0x0eb0, 0x0000 }, - { 0x8c00, 0x0eb5, 0x3000 }, - { 0x8700, 0x0eb3, 0x2000 }, - { 0x0700, 0x0eb2, 0x0000 }, - { 0x0c00, 0x0eb4, 0x0000 }, - { 0x8c00, 0x0eb7, 0x2000 }, - { 0x0c00, 0x0eb6, 0x0000 }, - { 0x0c00, 0x0eb8, 0x0000 }, - { 0x8700, 0x0ec4, 0x4000 }, - { 0x8700, 0x0ec0, 0x3000 }, - { 0x8c00, 0x0ebc, 0x2000 }, - { 0x0c00, 0x0ebb, 0x0000 }, - { 0x0700, 0x0ebd, 0x0000 }, - { 0x8700, 0x0ec2, 0x2000 }, - { 0x0700, 0x0ec1, 0x0000 }, - { 0x0700, 0x0ec3, 0x0000 }, - { 0x8c00, 0x0eca, 0x3000 }, - { 0x8c00, 0x0ec8, 0x2000 }, - { 0x0600, 0x0ec6, 0x0000 }, - { 0x0c00, 0x0ec9, 0x0000 }, - { 0x8c00, 0x0ecc, 0x2000 }, - { 0x0c00, 0x0ecb, 0x0000 }, - { 0x0c00, 0x0ecd, 0x0000 }, - { 0x9500, 0x0f04, 0x5000 }, - { 0x8d00, 0x0ed8, 0x4000 }, - { 0x8d00, 0x0ed4, 0x3000 }, - { 0x8d00, 0x0ed2, 0x2000 }, - { 0x0d00, 0x0ed1, 0x0000 }, - { 0x0d00, 0x0ed3, 0x0000 }, - { 0x8d00, 0x0ed6, 0x2000 }, - { 0x0d00, 0x0ed5, 0x0000 }, - { 0x0d00, 0x0ed7, 0x0000 }, - { 0x8700, 0x0f00, 0x3000 }, - { 0x8700, 0x0edc, 0x2000 }, - { 0x0d00, 0x0ed9, 0x0000 }, - { 0x0700, 0x0edd, 0x0000 }, - { 0x9a00, 0x0f02, 0x2000 }, - { 0x1a00, 0x0f01, 0x0000 }, - { 0x1a00, 0x0f03, 0x0000 }, - { 0x9500, 0x0f0c, 0x4000 }, - { 0x9500, 0x0f08, 0x3000 }, - { 0x9500, 0x0f06, 0x2000 }, - { 0x1500, 0x0f05, 0x0000 }, - { 0x1500, 0x0f07, 0x0000 }, - { 0x9500, 0x0f0a, 0x2000 }, - { 0x1500, 0x0f09, 0x0000 }, - { 0x1500, 0x0f0b, 0x0000 }, - { 0x9500, 0x0f10, 0x3000 }, - { 0x9500, 0x0f0e, 0x2000 }, - { 0x1500, 0x0f0d, 0x0000 }, - { 0x1500, 0x0f0f, 0x0000 }, - { 0x9500, 0x0f12, 0x2000 }, - { 0x1500, 0x0f11, 0x0000 }, - { 0x1a00, 0x0f13, 0x0000 }, - { 0x9a00, 0x0f34, 0x6000 }, - { 0x8d00, 0x0f24, 0x5000 }, - { 0x9a00, 0x0f1c, 0x4000 }, - { 0x8c00, 0x0f18, 0x3000 }, - { 0x9a00, 0x0f16, 0x2000 }, - { 0x1a00, 0x0f15, 0x0000 }, - { 0x1a00, 0x0f17, 0x0000 }, - { 0x9a00, 0x0f1a, 0x2000 }, - { 0x0c00, 0x0f19, 0x0000 }, - { 0x1a00, 0x0f1b, 0x0000 }, - { 0x8d00, 0x0f20, 0x3000 }, - { 0x9a00, 0x0f1e, 0x2000 }, - { 0x1a00, 0x0f1d, 0x0000 }, - { 0x1a00, 0x0f1f, 0x0000 }, - { 0x8d00, 0x0f22, 0x2000 }, - { 0x0d00, 0x0f21, 0x0000 }, - { 0x0d00, 0x0f23, 0x0000 }, - { 0x8f00, 0x0f2c, 0x4000 }, - { 0x8d00, 0x0f28, 0x3000 }, - { 0x8d00, 0x0f26, 0x2000 }, - { 0x0d00, 0x0f25, 0x0000 }, - { 0x0d00, 0x0f27, 0x0000 }, - { 0x8f00, 0x0f2a, 0x2000 }, - { 0x0d00, 0x0f29, 0x0000 }, - { 0x0f00, 0x0f2b, 0x0000 }, - { 0x8f00, 0x0f30, 0x3000 }, - { 0x8f00, 0x0f2e, 0x2000 }, - { 0x0f00, 0x0f2d, 0x0000 }, - { 0x0f00, 0x0f2f, 0x0000 }, - { 0x8f00, 0x0f32, 0x2000 }, - { 0x0f00, 0x0f31, 0x0000 }, - { 0x0f00, 0x0f33, 0x0000 }, - { 0x8700, 0x0f44, 0x5000 }, - { 0x9600, 0x0f3c, 0x4000 }, - { 0x9a00, 0x0f38, 0x3000 }, - { 0x9a00, 0x0f36, 0x2000 }, - { 0x0c00, 0x0f35, 0x0000 }, - { 0x0c00, 0x0f37, 0x0000 }, - { 0x9600, 0x0f3a, 0x2000 }, - { 0x0c00, 0x0f39, 0x0000 }, - { 0x1200, 0x0f3b, 0x0000 }, - { 0x8700, 0x0f40, 0x3000 }, - { 0x8a00, 0x0f3e, 0x2000 }, - { 0x1200, 0x0f3d, 0x0000 }, - { 0x0a00, 0x0f3f, 0x0000 }, - { 0x8700, 0x0f42, 0x2000 }, - { 0x0700, 0x0f41, 0x0000 }, - { 0x0700, 0x0f43, 0x0000 }, - { 0x8700, 0x0f4d, 0x4000 }, - { 0x8700, 0x0f49, 0x3000 }, - { 0x8700, 0x0f46, 0x2000 }, - { 0x0700, 0x0f45, 0x0000 }, - { 0x0700, 0x0f47, 0x0000 }, - { 0x8700, 0x0f4b, 0x2000 }, - { 0x0700, 0x0f4a, 0x0000 }, - { 0x0700, 0x0f4c, 0x0000 }, - { 0x8700, 0x0f51, 0x3000 }, - { 0x8700, 0x0f4f, 0x2000 }, - { 0x0700, 0x0f4e, 0x0000 }, - { 0x0700, 0x0f50, 0x0000 }, - { 0x8700, 0x0f53, 0x2000 }, - { 0x0700, 0x0f52, 0x0000 }, - { 0x0700, 0x0f54, 0x0000 }, - { 0x8700, 0x1013, 0x8000 }, - { 0x8c00, 0x0fa0, 0x7000 }, - { 0x8c00, 0x0f7b, 0x6000 }, - { 0x8700, 0x0f65, 0x5000 }, - { 0x8700, 0x0f5d, 0x4000 }, - { 0x8700, 0x0f59, 0x3000 }, - { 0x8700, 0x0f57, 0x2000 }, - { 0x0700, 0x0f56, 0x0000 }, - { 0x0700, 0x0f58, 0x0000 }, - { 0x8700, 0x0f5b, 0x2000 }, - { 0x0700, 0x0f5a, 0x0000 }, - { 0x0700, 0x0f5c, 0x0000 }, - { 0x8700, 0x0f61, 0x3000 }, - { 0x8700, 0x0f5f, 0x2000 }, - { 0x0700, 0x0f5e, 0x0000 }, - { 0x0700, 0x0f60, 0x0000 }, - { 0x8700, 0x0f63, 0x2000 }, - { 0x0700, 0x0f62, 0x0000 }, - { 0x0700, 0x0f64, 0x0000 }, - { 0x8c00, 0x0f73, 0x4000 }, - { 0x8700, 0x0f69, 0x3000 }, - { 0x8700, 0x0f67, 0x2000 }, - { 0x0700, 0x0f66, 0x0000 }, - { 0x0700, 0x0f68, 0x0000 }, - { 0x8c00, 0x0f71, 0x2000 }, - { 0x0700, 0x0f6a, 0x0000 }, - { 0x0c00, 0x0f72, 0x0000 }, - { 0x8c00, 0x0f77, 0x3000 }, - { 0x8c00, 0x0f75, 0x2000 }, - { 0x0c00, 0x0f74, 0x0000 }, - { 0x0c00, 0x0f76, 0x0000 }, - { 0x8c00, 0x0f79, 0x2000 }, - { 0x0c00, 0x0f78, 0x0000 }, - { 0x0c00, 0x0f7a, 0x0000 }, - { 0x8700, 0x0f8b, 0x5000 }, - { 0x8c00, 0x0f83, 0x4000 }, - { 0x8a00, 0x0f7f, 0x3000 }, - { 0x8c00, 0x0f7d, 0x2000 }, - { 0x0c00, 0x0f7c, 0x0000 }, - { 0x0c00, 0x0f7e, 0x0000 }, - { 0x8c00, 0x0f81, 0x2000 }, - { 0x0c00, 0x0f80, 0x0000 }, - { 0x0c00, 0x0f82, 0x0000 }, - { 0x8c00, 0x0f87, 0x3000 }, - { 0x9500, 0x0f85, 0x2000 }, - { 0x0c00, 0x0f84, 0x0000 }, - { 0x0c00, 0x0f86, 0x0000 }, - { 0x8700, 0x0f89, 0x2000 }, - { 0x0700, 0x0f88, 0x0000 }, - { 0x0700, 0x0f8a, 0x0000 }, - { 0x8c00, 0x0f97, 0x4000 }, - { 0x8c00, 0x0f93, 0x3000 }, - { 0x8c00, 0x0f91, 0x2000 }, - { 0x0c00, 0x0f90, 0x0000 }, - { 0x0c00, 0x0f92, 0x0000 }, - { 0x8c00, 0x0f95, 0x2000 }, - { 0x0c00, 0x0f94, 0x0000 }, - { 0x0c00, 0x0f96, 0x0000 }, - { 0x8c00, 0x0f9c, 0x3000 }, - { 0x8c00, 0x0f9a, 0x2000 }, - { 0x0c00, 0x0f99, 0x0000 }, - { 0x0c00, 0x0f9b, 0x0000 }, - { 0x8c00, 0x0f9e, 0x2000 }, - { 0x0c00, 0x0f9d, 0x0000 }, - { 0x0c00, 0x0f9f, 0x0000 }, - { 0x9a00, 0x0fc1, 0x6000 }, - { 0x8c00, 0x0fb0, 0x5000 }, - { 0x8c00, 0x0fa8, 0x4000 }, - { 0x8c00, 0x0fa4, 0x3000 }, - { 0x8c00, 0x0fa2, 0x2000 }, - { 0x0c00, 0x0fa1, 0x0000 }, - { 0x0c00, 0x0fa3, 0x0000 }, - { 0x8c00, 0x0fa6, 0x2000 }, - { 0x0c00, 0x0fa5, 0x0000 }, - { 0x0c00, 0x0fa7, 0x0000 }, - { 0x8c00, 0x0fac, 0x3000 }, - { 0x8c00, 0x0faa, 0x2000 }, - { 0x0c00, 0x0fa9, 0x0000 }, - { 0x0c00, 0x0fab, 0x0000 }, - { 0x8c00, 0x0fae, 0x2000 }, - { 0x0c00, 0x0fad, 0x0000 }, - { 0x0c00, 0x0faf, 0x0000 }, - { 0x8c00, 0x0fb8, 0x4000 }, - { 0x8c00, 0x0fb4, 0x3000 }, - { 0x8c00, 0x0fb2, 0x2000 }, - { 0x0c00, 0x0fb1, 0x0000 }, - { 0x0c00, 0x0fb3, 0x0000 }, - { 0x8c00, 0x0fb6, 0x2000 }, - { 0x0c00, 0x0fb5, 0x0000 }, - { 0x0c00, 0x0fb7, 0x0000 }, - { 0x8c00, 0x0fbc, 0x3000 }, - { 0x8c00, 0x0fba, 0x2000 }, - { 0x0c00, 0x0fb9, 0x0000 }, - { 0x0c00, 0x0fbb, 0x0000 }, - { 0x9a00, 0x0fbf, 0x2000 }, - { 0x1a00, 0x0fbe, 0x0000 }, - { 0x1a00, 0x0fc0, 0x0000 }, - { 0x8700, 0x1003, 0x5000 }, - { 0x9a00, 0x0fc9, 0x4000 }, - { 0x9a00, 0x0fc5, 0x3000 }, - { 0x9a00, 0x0fc3, 0x2000 }, - { 0x1a00, 0x0fc2, 0x0000 }, - { 0x1a00, 0x0fc4, 0x0000 }, - { 0x9a00, 0x0fc7, 0x2000 }, - { 0x0c00, 0x0fc6, 0x0000 }, - { 0x1a00, 0x0fc8, 0x0000 }, - { 0x9a00, 0x0fcf, 0x3000 }, - { 0x9a00, 0x0fcb, 0x2000 }, - { 0x1a00, 0x0fca, 0x0000 }, - { 0x1a00, 0x0fcc, 0x0000 }, - { 0x8700, 0x1001, 0x2000 }, - { 0x0700, 0x1000, 0x0000 }, - { 0x0700, 0x1002, 0x0000 }, - { 0x8700, 0x100b, 0x4000 }, - { 0x8700, 0x1007, 0x3000 }, - { 0x8700, 0x1005, 0x2000 }, - { 0x0700, 0x1004, 0x0000 }, - { 0x0700, 0x1006, 0x0000 }, - { 0x8700, 0x1009, 0x2000 }, - { 0x0700, 0x1008, 0x0000 }, - { 0x0700, 0x100a, 0x0000 }, - { 0x8700, 0x100f, 0x3000 }, - { 0x8700, 0x100d, 0x2000 }, - { 0x0700, 0x100c, 0x0000 }, - { 0x0700, 0x100e, 0x0000 }, - { 0x8700, 0x1011, 0x2000 }, - { 0x0700, 0x1010, 0x0000 }, - { 0x0700, 0x1012, 0x0000 }, - { 0x8900, 0x10a5, 0x7000 }, - { 0x8c00, 0x1039, 0x6000 }, - { 0x8700, 0x1024, 0x5000 }, - { 0x8700, 0x101b, 0x4000 }, - { 0x8700, 0x1017, 0x3000 }, - { 0x8700, 0x1015, 0x2000 }, - { 0x0700, 0x1014, 0x0000 }, - { 0x0700, 0x1016, 0x0000 }, - { 0x8700, 0x1019, 0x2000 }, - { 0x0700, 0x1018, 0x0000 }, - { 0x0700, 0x101a, 0x0000 }, - { 0x8700, 0x101f, 0x3000 }, - { 0x8700, 0x101d, 0x2000 }, - { 0x0700, 0x101c, 0x0000 }, - { 0x0700, 0x101e, 0x0000 }, - { 0x8700, 0x1021, 0x2000 }, - { 0x0700, 0x1020, 0x0000 }, - { 0x0700, 0x1023, 0x0000 }, - { 0x8c00, 0x102e, 0x4000 }, - { 0x8700, 0x1029, 0x3000 }, - { 0x8700, 0x1026, 0x2000 }, - { 0x0700, 0x1025, 0x0000 }, - { 0x0700, 0x1027, 0x0000 }, - { 0x8a00, 0x102c, 0x2000 }, - { 0x0700, 0x102a, 0x0000 }, - { 0x0c00, 0x102d, 0x0000 }, - { 0x8c00, 0x1032, 0x3000 }, - { 0x8c00, 0x1030, 0x2000 }, - { 0x0c00, 0x102f, 0x0000 }, - { 0x0a00, 0x1031, 0x0000 }, - { 0x8c00, 0x1037, 0x2000 }, - { 0x0c00, 0x1036, 0x0000 }, - { 0x0a00, 0x1038, 0x0000 }, - { 0x9500, 0x104f, 0x5000 }, - { 0x8d00, 0x1047, 0x4000 }, - { 0x8d00, 0x1043, 0x3000 }, - { 0x8d00, 0x1041, 0x2000 }, - { 0x0d00, 0x1040, 0x0000 }, - { 0x0d00, 0x1042, 0x0000 }, - { 0x8d00, 0x1045, 0x2000 }, - { 0x0d00, 0x1044, 0x0000 }, - { 0x0d00, 0x1046, 0x0000 }, - { 0x9500, 0x104b, 0x3000 }, - { 0x8d00, 0x1049, 0x2000 }, - { 0x0d00, 0x1048, 0x0000 }, - { 0x1500, 0x104a, 0x0000 }, - { 0x9500, 0x104d, 0x2000 }, - { 0x1500, 0x104c, 0x0000 }, - { 0x1500, 0x104e, 0x0000 }, - { 0x8a00, 0x1057, 0x4000 }, - { 0x8700, 0x1053, 0x3000 }, - { 0x8700, 0x1051, 0x2000 }, - { 0x0700, 0x1050, 0x0000 }, - { 0x0700, 0x1052, 0x0000 }, - { 0x8700, 0x1055, 0x2000 }, - { 0x0700, 0x1054, 0x0000 }, - { 0x0a00, 0x1056, 0x0000 }, - { 0x8900, 0x10a1, 0x3000 }, - { 0x8c00, 0x1059, 0x2000 }, - { 0x0c00, 0x1058, 0x0000 }, - { 0x0900, 0x10a0, 0x0000 }, - { 0x8900, 0x10a3, 0x2000 }, - { 0x0900, 0x10a2, 0x0000 }, - { 0x0900, 0x10a4, 0x0000 }, - { 0x8900, 0x10c5, 0x6000 }, - { 0x8900, 0x10b5, 0x5000 }, - { 0x8900, 0x10ad, 0x4000 }, - { 0x8900, 0x10a9, 0x3000 }, - { 0x8900, 0x10a7, 0x2000 }, - { 0x0900, 0x10a6, 0x0000 }, - { 0x0900, 0x10a8, 0x0000 }, - { 0x8900, 0x10ab, 0x2000 }, - { 0x0900, 0x10aa, 0x0000 }, - { 0x0900, 0x10ac, 0x0000 }, - { 0x8900, 0x10b1, 0x3000 }, - { 0x8900, 0x10af, 0x2000 }, - { 0x0900, 0x10ae, 0x0000 }, - { 0x0900, 0x10b0, 0x0000 }, - { 0x8900, 0x10b3, 0x2000 }, - { 0x0900, 0x10b2, 0x0000 }, - { 0x0900, 0x10b4, 0x0000 }, - { 0x8900, 0x10bd, 0x4000 }, - { 0x8900, 0x10b9, 0x3000 }, - { 0x8900, 0x10b7, 0x2000 }, - { 0x0900, 0x10b6, 0x0000 }, - { 0x0900, 0x10b8, 0x0000 }, - { 0x8900, 0x10bb, 0x2000 }, - { 0x0900, 0x10ba, 0x0000 }, - { 0x0900, 0x10bc, 0x0000 }, - { 0x8900, 0x10c1, 0x3000 }, - { 0x8900, 0x10bf, 0x2000 }, - { 0x0900, 0x10be, 0x0000 }, - { 0x0900, 0x10c0, 0x0000 }, - { 0x8900, 0x10c3, 0x2000 }, - { 0x0900, 0x10c2, 0x0000 }, - { 0x0900, 0x10c4, 0x0000 }, - { 0x8700, 0x10df, 0x5000 }, - { 0x8700, 0x10d7, 0x4000 }, - { 0x8700, 0x10d3, 0x3000 }, - { 0x8700, 0x10d1, 0x2000 }, - { 0x0700, 0x10d0, 0x0000 }, - { 0x0700, 0x10d2, 0x0000 }, - { 0x8700, 0x10d5, 0x2000 }, - { 0x0700, 0x10d4, 0x0000 }, - { 0x0700, 0x10d6, 0x0000 }, - { 0x8700, 0x10db, 0x3000 }, - { 0x8700, 0x10d9, 0x2000 }, - { 0x0700, 0x10d8, 0x0000 }, - { 0x0700, 0x10da, 0x0000 }, - { 0x8700, 0x10dd, 0x2000 }, - { 0x0700, 0x10dc, 0x0000 }, - { 0x0700, 0x10de, 0x0000 }, - { 0x8700, 0x10e7, 0x4000 }, - { 0x8700, 0x10e3, 0x3000 }, - { 0x8700, 0x10e1, 0x2000 }, - { 0x0700, 0x10e0, 0x0000 }, - { 0x0700, 0x10e2, 0x0000 }, - { 0x8700, 0x10e5, 0x2000 }, - { 0x0700, 0x10e4, 0x0000 }, - { 0x0700, 0x10e6, 0x0000 }, - { 0x8700, 0x10eb, 0x3000 }, - { 0x8700, 0x10e9, 0x2000 }, - { 0x0700, 0x10e8, 0x0000 }, - { 0x0700, 0x10ea, 0x0000 }, - { 0x8700, 0x10ed, 0x2000 }, - { 0x0700, 0x10ec, 0x0000 }, - { 0x0700, 0x10ee, 0x0000 }, - { 0x8700, 0x1322, 0xa000 }, - { 0x8700, 0x1205, 0x9000 }, - { 0x8700, 0x117a, 0x8000 }, - { 0x8700, 0x1135, 0x7000 }, - { 0x8700, 0x1115, 0x6000 }, - { 0x8700, 0x1105, 0x5000 }, - { 0x8700, 0x10f7, 0x4000 }, - { 0x8700, 0x10f3, 0x3000 }, - { 0x8700, 0x10f1, 0x2000 }, - { 0x0700, 0x10f0, 0x0000 }, - { 0x0700, 0x10f2, 0x0000 }, - { 0x8700, 0x10f5, 0x2000 }, - { 0x0700, 0x10f4, 0x0000 }, - { 0x0700, 0x10f6, 0x0000 }, - { 0x8700, 0x1101, 0x3000 }, - { 0x9500, 0x10fb, 0x2000 }, - { 0x0700, 0x10f8, 0x0000 }, - { 0x0700, 0x1100, 0x0000 }, - { 0x8700, 0x1103, 0x2000 }, - { 0x0700, 0x1102, 0x0000 }, - { 0x0700, 0x1104, 0x0000 }, - { 0x8700, 0x110d, 0x4000 }, - { 0x8700, 0x1109, 0x3000 }, - { 0x8700, 0x1107, 0x2000 }, - { 0x0700, 0x1106, 0x0000 }, - { 0x0700, 0x1108, 0x0000 }, - { 0x8700, 0x110b, 0x2000 }, - { 0x0700, 0x110a, 0x0000 }, - { 0x0700, 0x110c, 0x0000 }, - { 0x8700, 0x1111, 0x3000 }, - { 0x8700, 0x110f, 0x2000 }, - { 0x0700, 0x110e, 0x0000 }, - { 0x0700, 0x1110, 0x0000 }, - { 0x8700, 0x1113, 0x2000 }, - { 0x0700, 0x1112, 0x0000 }, - { 0x0700, 0x1114, 0x0000 }, - { 0x8700, 0x1125, 0x5000 }, - { 0x8700, 0x111d, 0x4000 }, - { 0x8700, 0x1119, 0x3000 }, - { 0x8700, 0x1117, 0x2000 }, - { 0x0700, 0x1116, 0x0000 }, - { 0x0700, 0x1118, 0x0000 }, - { 0x8700, 0x111b, 0x2000 }, - { 0x0700, 0x111a, 0x0000 }, - { 0x0700, 0x111c, 0x0000 }, - { 0x8700, 0x1121, 0x3000 }, - { 0x8700, 0x111f, 0x2000 }, - { 0x0700, 0x111e, 0x0000 }, - { 0x0700, 0x1120, 0x0000 }, - { 0x8700, 0x1123, 0x2000 }, - { 0x0700, 0x1122, 0x0000 }, - { 0x0700, 0x1124, 0x0000 }, - { 0x8700, 0x112d, 0x4000 }, - { 0x8700, 0x1129, 0x3000 }, - { 0x8700, 0x1127, 0x2000 }, - { 0x0700, 0x1126, 0x0000 }, - { 0x0700, 0x1128, 0x0000 }, - { 0x8700, 0x112b, 0x2000 }, - { 0x0700, 0x112a, 0x0000 }, - { 0x0700, 0x112c, 0x0000 }, - { 0x8700, 0x1131, 0x3000 }, - { 0x8700, 0x112f, 0x2000 }, - { 0x0700, 0x112e, 0x0000 }, - { 0x0700, 0x1130, 0x0000 }, - { 0x8700, 0x1133, 0x2000 }, - { 0x0700, 0x1132, 0x0000 }, - { 0x0700, 0x1134, 0x0000 }, - { 0x8700, 0x1155, 0x6000 }, - { 0x8700, 0x1145, 0x5000 }, - { 0x8700, 0x113d, 0x4000 }, - { 0x8700, 0x1139, 0x3000 }, - { 0x8700, 0x1137, 0x2000 }, - { 0x0700, 0x1136, 0x0000 }, - { 0x0700, 0x1138, 0x0000 }, - { 0x8700, 0x113b, 0x2000 }, - { 0x0700, 0x113a, 0x0000 }, - { 0x0700, 0x113c, 0x0000 }, - { 0x8700, 0x1141, 0x3000 }, - { 0x8700, 0x113f, 0x2000 }, - { 0x0700, 0x113e, 0x0000 }, - { 0x0700, 0x1140, 0x0000 }, - { 0x8700, 0x1143, 0x2000 }, - { 0x0700, 0x1142, 0x0000 }, - { 0x0700, 0x1144, 0x0000 }, - { 0x8700, 0x114d, 0x4000 }, - { 0x8700, 0x1149, 0x3000 }, - { 0x8700, 0x1147, 0x2000 }, - { 0x0700, 0x1146, 0x0000 }, - { 0x0700, 0x1148, 0x0000 }, - { 0x8700, 0x114b, 0x2000 }, - { 0x0700, 0x114a, 0x0000 }, - { 0x0700, 0x114c, 0x0000 }, - { 0x8700, 0x1151, 0x3000 }, - { 0x8700, 0x114f, 0x2000 }, - { 0x0700, 0x114e, 0x0000 }, - { 0x0700, 0x1150, 0x0000 }, - { 0x8700, 0x1153, 0x2000 }, - { 0x0700, 0x1152, 0x0000 }, - { 0x0700, 0x1154, 0x0000 }, - { 0x8700, 0x116a, 0x5000 }, - { 0x8700, 0x1162, 0x4000 }, - { 0x8700, 0x1159, 0x3000 }, - { 0x8700, 0x1157, 0x2000 }, - { 0x0700, 0x1156, 0x0000 }, - { 0x0700, 0x1158, 0x0000 }, - { 0x8700, 0x1160, 0x2000 }, - { 0x0700, 0x115f, 0x0000 }, - { 0x0700, 0x1161, 0x0000 }, - { 0x8700, 0x1166, 0x3000 }, - { 0x8700, 0x1164, 0x2000 }, - { 0x0700, 0x1163, 0x0000 }, - { 0x0700, 0x1165, 0x0000 }, - { 0x8700, 0x1168, 0x2000 }, - { 0x0700, 0x1167, 0x0000 }, - { 0x0700, 0x1169, 0x0000 }, - { 0x8700, 0x1172, 0x4000 }, - { 0x8700, 0x116e, 0x3000 }, - { 0x8700, 0x116c, 0x2000 }, - { 0x0700, 0x116b, 0x0000 }, - { 0x0700, 0x116d, 0x0000 }, - { 0x8700, 0x1170, 0x2000 }, - { 0x0700, 0x116f, 0x0000 }, - { 0x0700, 0x1171, 0x0000 }, - { 0x8700, 0x1176, 0x3000 }, - { 0x8700, 0x1174, 0x2000 }, - { 0x0700, 0x1173, 0x0000 }, - { 0x0700, 0x1175, 0x0000 }, - { 0x8700, 0x1178, 0x2000 }, - { 0x0700, 0x1177, 0x0000 }, - { 0x0700, 0x1179, 0x0000 }, - { 0x8700, 0x11bf, 0x7000 }, - { 0x8700, 0x119a, 0x6000 }, - { 0x8700, 0x118a, 0x5000 }, - { 0x8700, 0x1182, 0x4000 }, - { 0x8700, 0x117e, 0x3000 }, - { 0x8700, 0x117c, 0x2000 }, - { 0x0700, 0x117b, 0x0000 }, - { 0x0700, 0x117d, 0x0000 }, - { 0x8700, 0x1180, 0x2000 }, - { 0x0700, 0x117f, 0x0000 }, - { 0x0700, 0x1181, 0x0000 }, - { 0x8700, 0x1186, 0x3000 }, - { 0x8700, 0x1184, 0x2000 }, - { 0x0700, 0x1183, 0x0000 }, - { 0x0700, 0x1185, 0x0000 }, - { 0x8700, 0x1188, 0x2000 }, - { 0x0700, 0x1187, 0x0000 }, - { 0x0700, 0x1189, 0x0000 }, - { 0x8700, 0x1192, 0x4000 }, - { 0x8700, 0x118e, 0x3000 }, - { 0x8700, 0x118c, 0x2000 }, - { 0x0700, 0x118b, 0x0000 }, - { 0x0700, 0x118d, 0x0000 }, - { 0x8700, 0x1190, 0x2000 }, - { 0x0700, 0x118f, 0x0000 }, - { 0x0700, 0x1191, 0x0000 }, - { 0x8700, 0x1196, 0x3000 }, - { 0x8700, 0x1194, 0x2000 }, - { 0x0700, 0x1193, 0x0000 }, - { 0x0700, 0x1195, 0x0000 }, - { 0x8700, 0x1198, 0x2000 }, - { 0x0700, 0x1197, 0x0000 }, - { 0x0700, 0x1199, 0x0000 }, - { 0x8700, 0x11af, 0x5000 }, - { 0x8700, 0x11a2, 0x4000 }, - { 0x8700, 0x119e, 0x3000 }, - { 0x8700, 0x119c, 0x2000 }, - { 0x0700, 0x119b, 0x0000 }, - { 0x0700, 0x119d, 0x0000 }, - { 0x8700, 0x11a0, 0x2000 }, - { 0x0700, 0x119f, 0x0000 }, - { 0x0700, 0x11a1, 0x0000 }, - { 0x8700, 0x11ab, 0x3000 }, - { 0x8700, 0x11a9, 0x2000 }, - { 0x0700, 0x11a8, 0x0000 }, - { 0x0700, 0x11aa, 0x0000 }, - { 0x8700, 0x11ad, 0x2000 }, - { 0x0700, 0x11ac, 0x0000 }, - { 0x0700, 0x11ae, 0x0000 }, - { 0x8700, 0x11b7, 0x4000 }, - { 0x8700, 0x11b3, 0x3000 }, - { 0x8700, 0x11b1, 0x2000 }, - { 0x0700, 0x11b0, 0x0000 }, - { 0x0700, 0x11b2, 0x0000 }, - { 0x8700, 0x11b5, 0x2000 }, - { 0x0700, 0x11b4, 0x0000 }, - { 0x0700, 0x11b6, 0x0000 }, - { 0x8700, 0x11bb, 0x3000 }, - { 0x8700, 0x11b9, 0x2000 }, - { 0x0700, 0x11b8, 0x0000 }, - { 0x0700, 0x11ba, 0x0000 }, - { 0x8700, 0x11bd, 0x2000 }, - { 0x0700, 0x11bc, 0x0000 }, - { 0x0700, 0x11be, 0x0000 }, - { 0x8700, 0x11df, 0x6000 }, - { 0x8700, 0x11cf, 0x5000 }, - { 0x8700, 0x11c7, 0x4000 }, - { 0x8700, 0x11c3, 0x3000 }, - { 0x8700, 0x11c1, 0x2000 }, - { 0x0700, 0x11c0, 0x0000 }, - { 0x0700, 0x11c2, 0x0000 }, - { 0x8700, 0x11c5, 0x2000 }, - { 0x0700, 0x11c4, 0x0000 }, - { 0x0700, 0x11c6, 0x0000 }, - { 0x8700, 0x11cb, 0x3000 }, - { 0x8700, 0x11c9, 0x2000 }, - { 0x0700, 0x11c8, 0x0000 }, - { 0x0700, 0x11ca, 0x0000 }, - { 0x8700, 0x11cd, 0x2000 }, - { 0x0700, 0x11cc, 0x0000 }, - { 0x0700, 0x11ce, 0x0000 }, - { 0x8700, 0x11d7, 0x4000 }, - { 0x8700, 0x11d3, 0x3000 }, - { 0x8700, 0x11d1, 0x2000 }, - { 0x0700, 0x11d0, 0x0000 }, - { 0x0700, 0x11d2, 0x0000 }, - { 0x8700, 0x11d5, 0x2000 }, - { 0x0700, 0x11d4, 0x0000 }, - { 0x0700, 0x11d6, 0x0000 }, - { 0x8700, 0x11db, 0x3000 }, - { 0x8700, 0x11d9, 0x2000 }, - { 0x0700, 0x11d8, 0x0000 }, - { 0x0700, 0x11da, 0x0000 }, - { 0x8700, 0x11dd, 0x2000 }, - { 0x0700, 0x11dc, 0x0000 }, - { 0x0700, 0x11de, 0x0000 }, - { 0x8700, 0x11ef, 0x5000 }, - { 0x8700, 0x11e7, 0x4000 }, - { 0x8700, 0x11e3, 0x3000 }, - { 0x8700, 0x11e1, 0x2000 }, - { 0x0700, 0x11e0, 0x0000 }, - { 0x0700, 0x11e2, 0x0000 }, - { 0x8700, 0x11e5, 0x2000 }, - { 0x0700, 0x11e4, 0x0000 }, - { 0x0700, 0x11e6, 0x0000 }, - { 0x8700, 0x11eb, 0x3000 }, - { 0x8700, 0x11e9, 0x2000 }, - { 0x0700, 0x11e8, 0x0000 }, - { 0x0700, 0x11ea, 0x0000 }, - { 0x8700, 0x11ed, 0x2000 }, - { 0x0700, 0x11ec, 0x0000 }, - { 0x0700, 0x11ee, 0x0000 }, - { 0x8700, 0x11f7, 0x4000 }, - { 0x8700, 0x11f3, 0x3000 }, - { 0x8700, 0x11f1, 0x2000 }, - { 0x0700, 0x11f0, 0x0000 }, - { 0x0700, 0x11f2, 0x0000 }, - { 0x8700, 0x11f5, 0x2000 }, - { 0x0700, 0x11f4, 0x0000 }, - { 0x0700, 0x11f6, 0x0000 }, - { 0x8700, 0x1201, 0x3000 }, - { 0x8700, 0x11f9, 0x2000 }, - { 0x0700, 0x11f8, 0x0000 }, - { 0x0700, 0x1200, 0x0000 }, - { 0x8700, 0x1203, 0x2000 }, - { 0x0700, 0x1202, 0x0000 }, - { 0x0700, 0x1204, 0x0000 }, - { 0x8700, 0x1292, 0x8000 }, - { 0x8700, 0x1246, 0x7000 }, - { 0x8700, 0x1226, 0x6000 }, - { 0x8700, 0x1216, 0x5000 }, - { 0x8700, 0x120e, 0x4000 }, - { 0x8700, 0x120a, 0x3000 }, - { 0x8700, 0x1208, 0x2000 }, - { 0x0700, 0x1206, 0x0000 }, - { 0x0700, 0x1209, 0x0000 }, - { 0x8700, 0x120c, 0x2000 }, - { 0x0700, 0x120b, 0x0000 }, - { 0x0700, 0x120d, 0x0000 }, - { 0x8700, 0x1212, 0x3000 }, - { 0x8700, 0x1210, 0x2000 }, - { 0x0700, 0x120f, 0x0000 }, - { 0x0700, 0x1211, 0x0000 }, - { 0x8700, 0x1214, 0x2000 }, - { 0x0700, 0x1213, 0x0000 }, - { 0x0700, 0x1215, 0x0000 }, - { 0x8700, 0x121e, 0x4000 }, - { 0x8700, 0x121a, 0x3000 }, - { 0x8700, 0x1218, 0x2000 }, - { 0x0700, 0x1217, 0x0000 }, - { 0x0700, 0x1219, 0x0000 }, - { 0x8700, 0x121c, 0x2000 }, - { 0x0700, 0x121b, 0x0000 }, - { 0x0700, 0x121d, 0x0000 }, - { 0x8700, 0x1222, 0x3000 }, - { 0x8700, 0x1220, 0x2000 }, - { 0x0700, 0x121f, 0x0000 }, - { 0x0700, 0x1221, 0x0000 }, - { 0x8700, 0x1224, 0x2000 }, - { 0x0700, 0x1223, 0x0000 }, - { 0x0700, 0x1225, 0x0000 }, - { 0x8700, 0x1236, 0x5000 }, - { 0x8700, 0x122e, 0x4000 }, - { 0x8700, 0x122a, 0x3000 }, - { 0x8700, 0x1228, 0x2000 }, - { 0x0700, 0x1227, 0x0000 }, - { 0x0700, 0x1229, 0x0000 }, - { 0x8700, 0x122c, 0x2000 }, - { 0x0700, 0x122b, 0x0000 }, - { 0x0700, 0x122d, 0x0000 }, - { 0x8700, 0x1232, 0x3000 }, - { 0x8700, 0x1230, 0x2000 }, - { 0x0700, 0x122f, 0x0000 }, - { 0x0700, 0x1231, 0x0000 }, - { 0x8700, 0x1234, 0x2000 }, - { 0x0700, 0x1233, 0x0000 }, - { 0x0700, 0x1235, 0x0000 }, - { 0x8700, 0x123e, 0x4000 }, - { 0x8700, 0x123a, 0x3000 }, - { 0x8700, 0x1238, 0x2000 }, - { 0x0700, 0x1237, 0x0000 }, - { 0x0700, 0x1239, 0x0000 }, - { 0x8700, 0x123c, 0x2000 }, - { 0x0700, 0x123b, 0x0000 }, - { 0x0700, 0x123d, 0x0000 }, - { 0x8700, 0x1242, 0x3000 }, - { 0x8700, 0x1240, 0x2000 }, - { 0x0700, 0x123f, 0x0000 }, - { 0x0700, 0x1241, 0x0000 }, - { 0x8700, 0x1244, 0x2000 }, - { 0x0700, 0x1243, 0x0000 }, - { 0x0700, 0x1245, 0x0000 }, - { 0x8700, 0x126e, 0x6000 }, - { 0x8700, 0x125c, 0x5000 }, - { 0x8700, 0x1252, 0x4000 }, - { 0x8700, 0x124c, 0x3000 }, - { 0x8700, 0x124a, 0x2000 }, - { 0x0700, 0x1248, 0x0000 }, - { 0x0700, 0x124b, 0x0000 }, - { 0x8700, 0x1250, 0x2000 }, - { 0x0700, 0x124d, 0x0000 }, - { 0x0700, 0x1251, 0x0000 }, - { 0x8700, 0x1256, 0x3000 }, - { 0x8700, 0x1254, 0x2000 }, - { 0x0700, 0x1253, 0x0000 }, - { 0x0700, 0x1255, 0x0000 }, - { 0x8700, 0x125a, 0x2000 }, - { 0x0700, 0x1258, 0x0000 }, - { 0x0700, 0x125b, 0x0000 }, - { 0x8700, 0x1266, 0x4000 }, - { 0x8700, 0x1262, 0x3000 }, - { 0x8700, 0x1260, 0x2000 }, - { 0x0700, 0x125d, 0x0000 }, - { 0x0700, 0x1261, 0x0000 }, - { 0x8700, 0x1264, 0x2000 }, - { 0x0700, 0x1263, 0x0000 }, - { 0x0700, 0x1265, 0x0000 }, - { 0x8700, 0x126a, 0x3000 }, - { 0x8700, 0x1268, 0x2000 }, - { 0x0700, 0x1267, 0x0000 }, - { 0x0700, 0x1269, 0x0000 }, - { 0x8700, 0x126c, 0x2000 }, - { 0x0700, 0x126b, 0x0000 }, - { 0x0700, 0x126d, 0x0000 }, - { 0x8700, 0x127e, 0x5000 }, - { 0x8700, 0x1276, 0x4000 }, - { 0x8700, 0x1272, 0x3000 }, - { 0x8700, 0x1270, 0x2000 }, - { 0x0700, 0x126f, 0x0000 }, - { 0x0700, 0x1271, 0x0000 }, - { 0x8700, 0x1274, 0x2000 }, - { 0x0700, 0x1273, 0x0000 }, - { 0x0700, 0x1275, 0x0000 }, - { 0x8700, 0x127a, 0x3000 }, - { 0x8700, 0x1278, 0x2000 }, - { 0x0700, 0x1277, 0x0000 }, - { 0x0700, 0x1279, 0x0000 }, - { 0x8700, 0x127c, 0x2000 }, - { 0x0700, 0x127b, 0x0000 }, - { 0x0700, 0x127d, 0x0000 }, - { 0x8700, 0x1286, 0x4000 }, - { 0x8700, 0x1282, 0x3000 }, - { 0x8700, 0x1280, 0x2000 }, - { 0x0700, 0x127f, 0x0000 }, - { 0x0700, 0x1281, 0x0000 }, - { 0x8700, 0x1284, 0x2000 }, - { 0x0700, 0x1283, 0x0000 }, - { 0x0700, 0x1285, 0x0000 }, - { 0x8700, 0x128c, 0x3000 }, - { 0x8700, 0x128a, 0x2000 }, - { 0x0700, 0x1288, 0x0000 }, - { 0x0700, 0x128b, 0x0000 }, - { 0x8700, 0x1290, 0x2000 }, - { 0x0700, 0x128d, 0x0000 }, - { 0x0700, 0x1291, 0x0000 }, - { 0x8700, 0x12dc, 0x7000 }, - { 0x8700, 0x12b4, 0x6000 }, - { 0x8700, 0x12a2, 0x5000 }, - { 0x8700, 0x129a, 0x4000 }, - { 0x8700, 0x1296, 0x3000 }, - { 0x8700, 0x1294, 0x2000 }, - { 0x0700, 0x1293, 0x0000 }, - { 0x0700, 0x1295, 0x0000 }, - { 0x8700, 0x1298, 0x2000 }, - { 0x0700, 0x1297, 0x0000 }, - { 0x0700, 0x1299, 0x0000 }, - { 0x8700, 0x129e, 0x3000 }, - { 0x8700, 0x129c, 0x2000 }, - { 0x0700, 0x129b, 0x0000 }, - { 0x0700, 0x129d, 0x0000 }, - { 0x8700, 0x12a0, 0x2000 }, - { 0x0700, 0x129f, 0x0000 }, - { 0x0700, 0x12a1, 0x0000 }, - { 0x8700, 0x12aa, 0x4000 }, - { 0x8700, 0x12a6, 0x3000 }, - { 0x8700, 0x12a4, 0x2000 }, - { 0x0700, 0x12a3, 0x0000 }, - { 0x0700, 0x12a5, 0x0000 }, - { 0x8700, 0x12a8, 0x2000 }, - { 0x0700, 0x12a7, 0x0000 }, - { 0x0700, 0x12a9, 0x0000 }, - { 0x8700, 0x12ae, 0x3000 }, - { 0x8700, 0x12ac, 0x2000 }, - { 0x0700, 0x12ab, 0x0000 }, - { 0x0700, 0x12ad, 0x0000 }, - { 0x8700, 0x12b2, 0x2000 }, - { 0x0700, 0x12b0, 0x0000 }, - { 0x0700, 0x12b3, 0x0000 }, - { 0x8700, 0x12ca, 0x5000 }, - { 0x8700, 0x12be, 0x4000 }, - { 0x8700, 0x12ba, 0x3000 }, - { 0x8700, 0x12b8, 0x2000 }, - { 0x0700, 0x12b5, 0x0000 }, - { 0x0700, 0x12b9, 0x0000 }, - { 0x8700, 0x12bc, 0x2000 }, - { 0x0700, 0x12bb, 0x0000 }, - { 0x0700, 0x12bd, 0x0000 }, - { 0x8700, 0x12c4, 0x3000 }, - { 0x8700, 0x12c2, 0x2000 }, - { 0x0700, 0x12c0, 0x0000 }, - { 0x0700, 0x12c3, 0x0000 }, - { 0x8700, 0x12c8, 0x2000 }, - { 0x0700, 0x12c5, 0x0000 }, - { 0x0700, 0x12c9, 0x0000 }, - { 0x8700, 0x12d3, 0x4000 }, - { 0x8700, 0x12ce, 0x3000 }, - { 0x8700, 0x12cc, 0x2000 }, - { 0x0700, 0x12cb, 0x0000 }, - { 0x0700, 0x12cd, 0x0000 }, - { 0x8700, 0x12d1, 0x2000 }, - { 0x0700, 0x12d0, 0x0000 }, - { 0x0700, 0x12d2, 0x0000 }, - { 0x8700, 0x12d8, 0x3000 }, - { 0x8700, 0x12d5, 0x2000 }, - { 0x0700, 0x12d4, 0x0000 }, - { 0x0700, 0x12d6, 0x0000 }, - { 0x8700, 0x12da, 0x2000 }, - { 0x0700, 0x12d9, 0x0000 }, - { 0x0700, 0x12db, 0x0000 }, - { 0x8700, 0x12fd, 0x6000 }, - { 0x8700, 0x12ec, 0x5000 }, - { 0x8700, 0x12e4, 0x4000 }, - { 0x8700, 0x12e0, 0x3000 }, - { 0x8700, 0x12de, 0x2000 }, - { 0x0700, 0x12dd, 0x0000 }, - { 0x0700, 0x12df, 0x0000 }, - { 0x8700, 0x12e2, 0x2000 }, - { 0x0700, 0x12e1, 0x0000 }, - { 0x0700, 0x12e3, 0x0000 }, - { 0x8700, 0x12e8, 0x3000 }, - { 0x8700, 0x12e6, 0x2000 }, - { 0x0700, 0x12e5, 0x0000 }, - { 0x0700, 0x12e7, 0x0000 }, - { 0x8700, 0x12ea, 0x2000 }, - { 0x0700, 0x12e9, 0x0000 }, - { 0x0700, 0x12eb, 0x0000 }, - { 0x8700, 0x12f5, 0x4000 }, - { 0x8700, 0x12f1, 0x3000 }, - { 0x8700, 0x12ee, 0x2000 }, - { 0x0700, 0x12ed, 0x0000 }, - { 0x0700, 0x12f0, 0x0000 }, - { 0x8700, 0x12f3, 0x2000 }, - { 0x0700, 0x12f2, 0x0000 }, - { 0x0700, 0x12f4, 0x0000 }, - { 0x8700, 0x12f9, 0x3000 }, - { 0x8700, 0x12f7, 0x2000 }, - { 0x0700, 0x12f6, 0x0000 }, - { 0x0700, 0x12f8, 0x0000 }, - { 0x8700, 0x12fb, 0x2000 }, - { 0x0700, 0x12fa, 0x0000 }, - { 0x0700, 0x12fc, 0x0000 }, - { 0x8700, 0x130d, 0x5000 }, - { 0x8700, 0x1305, 0x4000 }, - { 0x8700, 0x1301, 0x3000 }, - { 0x8700, 0x12ff, 0x2000 }, - { 0x0700, 0x12fe, 0x0000 }, - { 0x0700, 0x1300, 0x0000 }, - { 0x8700, 0x1303, 0x2000 }, - { 0x0700, 0x1302, 0x0000 }, - { 0x0700, 0x1304, 0x0000 }, - { 0x8700, 0x1309, 0x3000 }, - { 0x8700, 0x1307, 0x2000 }, - { 0x0700, 0x1306, 0x0000 }, - { 0x0700, 0x1308, 0x0000 }, - { 0x8700, 0x130b, 0x2000 }, - { 0x0700, 0x130a, 0x0000 }, - { 0x0700, 0x130c, 0x0000 }, - { 0x8700, 0x1319, 0x4000 }, - { 0x8700, 0x1313, 0x3000 }, - { 0x8700, 0x1310, 0x2000 }, - { 0x0700, 0x130e, 0x0000 }, - { 0x0700, 0x1312, 0x0000 }, - { 0x8700, 0x1315, 0x2000 }, - { 0x0700, 0x1314, 0x0000 }, - { 0x0700, 0x1318, 0x0000 }, - { 0x8700, 0x131d, 0x3000 }, - { 0x8700, 0x131b, 0x2000 }, - { 0x0700, 0x131a, 0x0000 }, - { 0x0700, 0x131c, 0x0000 }, - { 0x8700, 0x1320, 0x2000 }, - { 0x0700, 0x131e, 0x0000 }, - { 0x0700, 0x1321, 0x0000 }, - { 0x8700, 0x1458, 0x9000 }, - { 0x8700, 0x13cc, 0x8000 }, - { 0x8d00, 0x1369, 0x7000 }, - { 0x8700, 0x1342, 0x6000 }, - { 0x8700, 0x1332, 0x5000 }, - { 0x8700, 0x132a, 0x4000 }, - { 0x8700, 0x1326, 0x3000 }, - { 0x8700, 0x1324, 0x2000 }, - { 0x0700, 0x1323, 0x0000 }, - { 0x0700, 0x1325, 0x0000 }, - { 0x8700, 0x1328, 0x2000 }, - { 0x0700, 0x1327, 0x0000 }, - { 0x0700, 0x1329, 0x0000 }, - { 0x8700, 0x132e, 0x3000 }, - { 0x8700, 0x132c, 0x2000 }, - { 0x0700, 0x132b, 0x0000 }, - { 0x0700, 0x132d, 0x0000 }, - { 0x8700, 0x1330, 0x2000 }, - { 0x0700, 0x132f, 0x0000 }, - { 0x0700, 0x1331, 0x0000 }, - { 0x8700, 0x133a, 0x4000 }, - { 0x8700, 0x1336, 0x3000 }, - { 0x8700, 0x1334, 0x2000 }, - { 0x0700, 0x1333, 0x0000 }, - { 0x0700, 0x1335, 0x0000 }, - { 0x8700, 0x1338, 0x2000 }, - { 0x0700, 0x1337, 0x0000 }, - { 0x0700, 0x1339, 0x0000 }, - { 0x8700, 0x133e, 0x3000 }, - { 0x8700, 0x133c, 0x2000 }, - { 0x0700, 0x133b, 0x0000 }, - { 0x0700, 0x133d, 0x0000 }, - { 0x8700, 0x1340, 0x2000 }, - { 0x0700, 0x133f, 0x0000 }, - { 0x0700, 0x1341, 0x0000 }, - { 0x8700, 0x1353, 0x5000 }, - { 0x8700, 0x134b, 0x4000 }, - { 0x8700, 0x1346, 0x3000 }, - { 0x8700, 0x1344, 0x2000 }, - { 0x0700, 0x1343, 0x0000 }, - { 0x0700, 0x1345, 0x0000 }, - { 0x8700, 0x1349, 0x2000 }, - { 0x0700, 0x1348, 0x0000 }, - { 0x0700, 0x134a, 0x0000 }, - { 0x8700, 0x134f, 0x3000 }, - { 0x8700, 0x134d, 0x2000 }, - { 0x0700, 0x134c, 0x0000 }, - { 0x0700, 0x134e, 0x0000 }, - { 0x8700, 0x1351, 0x2000 }, - { 0x0700, 0x1350, 0x0000 }, - { 0x0700, 0x1352, 0x0000 }, - { 0x9500, 0x1361, 0x4000 }, - { 0x8700, 0x1357, 0x3000 }, - { 0x8700, 0x1355, 0x2000 }, - { 0x0700, 0x1354, 0x0000 }, - { 0x0700, 0x1356, 0x0000 }, - { 0x8700, 0x1359, 0x2000 }, - { 0x0700, 0x1358, 0x0000 }, - { 0x0700, 0x135a, 0x0000 }, - { 0x9500, 0x1365, 0x3000 }, - { 0x9500, 0x1363, 0x2000 }, - { 0x1500, 0x1362, 0x0000 }, - { 0x1500, 0x1364, 0x0000 }, - { 0x9500, 0x1367, 0x2000 }, - { 0x1500, 0x1366, 0x0000 }, - { 0x1500, 0x1368, 0x0000 }, - { 0x8700, 0x13ac, 0x6000 }, - { 0x8f00, 0x1379, 0x5000 }, - { 0x8d00, 0x1371, 0x4000 }, - { 0x8d00, 0x136d, 0x3000 }, - { 0x8d00, 0x136b, 0x2000 }, - { 0x0d00, 0x136a, 0x0000 }, - { 0x0d00, 0x136c, 0x0000 }, - { 0x8d00, 0x136f, 0x2000 }, - { 0x0d00, 0x136e, 0x0000 }, - { 0x0d00, 0x1370, 0x0000 }, - { 0x8f00, 0x1375, 0x3000 }, - { 0x8f00, 0x1373, 0x2000 }, - { 0x0f00, 0x1372, 0x0000 }, - { 0x0f00, 0x1374, 0x0000 }, - { 0x8f00, 0x1377, 0x2000 }, - { 0x0f00, 0x1376, 0x0000 }, - { 0x0f00, 0x1378, 0x0000 }, - { 0x8700, 0x13a4, 0x4000 }, - { 0x8700, 0x13a0, 0x3000 }, - { 0x8f00, 0x137b, 0x2000 }, - { 0x0f00, 0x137a, 0x0000 }, - { 0x0f00, 0x137c, 0x0000 }, - { 0x8700, 0x13a2, 0x2000 }, - { 0x0700, 0x13a1, 0x0000 }, - { 0x0700, 0x13a3, 0x0000 }, - { 0x8700, 0x13a8, 0x3000 }, - { 0x8700, 0x13a6, 0x2000 }, - { 0x0700, 0x13a5, 0x0000 }, - { 0x0700, 0x13a7, 0x0000 }, - { 0x8700, 0x13aa, 0x2000 }, - { 0x0700, 0x13a9, 0x0000 }, - { 0x0700, 0x13ab, 0x0000 }, - { 0x8700, 0x13bc, 0x5000 }, - { 0x8700, 0x13b4, 0x4000 }, - { 0x8700, 0x13b0, 0x3000 }, - { 0x8700, 0x13ae, 0x2000 }, - { 0x0700, 0x13ad, 0x0000 }, - { 0x0700, 0x13af, 0x0000 }, - { 0x8700, 0x13b2, 0x2000 }, - { 0x0700, 0x13b1, 0x0000 }, - { 0x0700, 0x13b3, 0x0000 }, - { 0x8700, 0x13b8, 0x3000 }, - { 0x8700, 0x13b6, 0x2000 }, - { 0x0700, 0x13b5, 0x0000 }, - { 0x0700, 0x13b7, 0x0000 }, - { 0x8700, 0x13ba, 0x2000 }, - { 0x0700, 0x13b9, 0x0000 }, - { 0x0700, 0x13bb, 0x0000 }, - { 0x8700, 0x13c4, 0x4000 }, - { 0x8700, 0x13c0, 0x3000 }, - { 0x8700, 0x13be, 0x2000 }, - { 0x0700, 0x13bd, 0x0000 }, - { 0x0700, 0x13bf, 0x0000 }, - { 0x8700, 0x13c2, 0x2000 }, - { 0x0700, 0x13c1, 0x0000 }, - { 0x0700, 0x13c3, 0x0000 }, - { 0x8700, 0x13c8, 0x3000 }, - { 0x8700, 0x13c6, 0x2000 }, - { 0x0700, 0x13c5, 0x0000 }, - { 0x0700, 0x13c7, 0x0000 }, - { 0x8700, 0x13ca, 0x2000 }, - { 0x0700, 0x13c9, 0x0000 }, - { 0x0700, 0x13cb, 0x0000 }, - { 0x8700, 0x1418, 0x7000 }, - { 0x8700, 0x13ec, 0x6000 }, - { 0x8700, 0x13dc, 0x5000 }, - { 0x8700, 0x13d4, 0x4000 }, - { 0x8700, 0x13d0, 0x3000 }, - { 0x8700, 0x13ce, 0x2000 }, - { 0x0700, 0x13cd, 0x0000 }, - { 0x0700, 0x13cf, 0x0000 }, - { 0x8700, 0x13d2, 0x2000 }, - { 0x0700, 0x13d1, 0x0000 }, - { 0x0700, 0x13d3, 0x0000 }, - { 0x8700, 0x13d8, 0x3000 }, - { 0x8700, 0x13d6, 0x2000 }, - { 0x0700, 0x13d5, 0x0000 }, - { 0x0700, 0x13d7, 0x0000 }, - { 0x8700, 0x13da, 0x2000 }, - { 0x0700, 0x13d9, 0x0000 }, - { 0x0700, 0x13db, 0x0000 }, - { 0x8700, 0x13e4, 0x4000 }, - { 0x8700, 0x13e0, 0x3000 }, - { 0x8700, 0x13de, 0x2000 }, - { 0x0700, 0x13dd, 0x0000 }, - { 0x0700, 0x13df, 0x0000 }, - { 0x8700, 0x13e2, 0x2000 }, - { 0x0700, 0x13e1, 0x0000 }, - { 0x0700, 0x13e3, 0x0000 }, - { 0x8700, 0x13e8, 0x3000 }, - { 0x8700, 0x13e6, 0x2000 }, - { 0x0700, 0x13e5, 0x0000 }, - { 0x0700, 0x13e7, 0x0000 }, - { 0x8700, 0x13ea, 0x2000 }, - { 0x0700, 0x13e9, 0x0000 }, - { 0x0700, 0x13eb, 0x0000 }, - { 0x8700, 0x1408, 0x5000 }, - { 0x8700, 0x13f4, 0x4000 }, - { 0x8700, 0x13f0, 0x3000 }, - { 0x8700, 0x13ee, 0x2000 }, - { 0x0700, 0x13ed, 0x0000 }, - { 0x0700, 0x13ef, 0x0000 }, - { 0x8700, 0x13f2, 0x2000 }, - { 0x0700, 0x13f1, 0x0000 }, - { 0x0700, 0x13f3, 0x0000 }, - { 0x8700, 0x1404, 0x3000 }, - { 0x8700, 0x1402, 0x2000 }, - { 0x0700, 0x1401, 0x0000 }, - { 0x0700, 0x1403, 0x0000 }, - { 0x8700, 0x1406, 0x2000 }, - { 0x0700, 0x1405, 0x0000 }, - { 0x0700, 0x1407, 0x0000 }, - { 0x8700, 0x1410, 0x4000 }, - { 0x8700, 0x140c, 0x3000 }, - { 0x8700, 0x140a, 0x2000 }, - { 0x0700, 0x1409, 0x0000 }, - { 0x0700, 0x140b, 0x0000 }, - { 0x8700, 0x140e, 0x2000 }, - { 0x0700, 0x140d, 0x0000 }, - { 0x0700, 0x140f, 0x0000 }, - { 0x8700, 0x1414, 0x3000 }, - { 0x8700, 0x1412, 0x2000 }, - { 0x0700, 0x1411, 0x0000 }, - { 0x0700, 0x1413, 0x0000 }, - { 0x8700, 0x1416, 0x2000 }, - { 0x0700, 0x1415, 0x0000 }, - { 0x0700, 0x1417, 0x0000 }, - { 0x8700, 0x1438, 0x6000 }, - { 0x8700, 0x1428, 0x5000 }, - { 0x8700, 0x1420, 0x4000 }, - { 0x8700, 0x141c, 0x3000 }, - { 0x8700, 0x141a, 0x2000 }, - { 0x0700, 0x1419, 0x0000 }, - { 0x0700, 0x141b, 0x0000 }, - { 0x8700, 0x141e, 0x2000 }, - { 0x0700, 0x141d, 0x0000 }, - { 0x0700, 0x141f, 0x0000 }, - { 0x8700, 0x1424, 0x3000 }, - { 0x8700, 0x1422, 0x2000 }, - { 0x0700, 0x1421, 0x0000 }, - { 0x0700, 0x1423, 0x0000 }, - { 0x8700, 0x1426, 0x2000 }, - { 0x0700, 0x1425, 0x0000 }, - { 0x0700, 0x1427, 0x0000 }, - { 0x8700, 0x1430, 0x4000 }, - { 0x8700, 0x142c, 0x3000 }, - { 0x8700, 0x142a, 0x2000 }, - { 0x0700, 0x1429, 0x0000 }, - { 0x0700, 0x142b, 0x0000 }, - { 0x8700, 0x142e, 0x2000 }, - { 0x0700, 0x142d, 0x0000 }, - { 0x0700, 0x142f, 0x0000 }, - { 0x8700, 0x1434, 0x3000 }, - { 0x8700, 0x1432, 0x2000 }, - { 0x0700, 0x1431, 0x0000 }, - { 0x0700, 0x1433, 0x0000 }, - { 0x8700, 0x1436, 0x2000 }, - { 0x0700, 0x1435, 0x0000 }, - { 0x0700, 0x1437, 0x0000 }, - { 0x8700, 0x1448, 0x5000 }, - { 0x8700, 0x1440, 0x4000 }, - { 0x8700, 0x143c, 0x3000 }, - { 0x8700, 0x143a, 0x2000 }, - { 0x0700, 0x1439, 0x0000 }, - { 0x0700, 0x143b, 0x0000 }, - { 0x8700, 0x143e, 0x2000 }, - { 0x0700, 0x143d, 0x0000 }, - { 0x0700, 0x143f, 0x0000 }, - { 0x8700, 0x1444, 0x3000 }, - { 0x8700, 0x1442, 0x2000 }, - { 0x0700, 0x1441, 0x0000 }, - { 0x0700, 0x1443, 0x0000 }, - { 0x8700, 0x1446, 0x2000 }, - { 0x0700, 0x1445, 0x0000 }, - { 0x0700, 0x1447, 0x0000 }, - { 0x8700, 0x1450, 0x4000 }, - { 0x8700, 0x144c, 0x3000 }, - { 0x8700, 0x144a, 0x2000 }, - { 0x0700, 0x1449, 0x0000 }, - { 0x0700, 0x144b, 0x0000 }, - { 0x8700, 0x144e, 0x2000 }, - { 0x0700, 0x144d, 0x0000 }, - { 0x0700, 0x144f, 0x0000 }, - { 0x8700, 0x1454, 0x3000 }, - { 0x8700, 0x1452, 0x2000 }, - { 0x0700, 0x1451, 0x0000 }, - { 0x0700, 0x1453, 0x0000 }, - { 0x8700, 0x1456, 0x2000 }, - { 0x0700, 0x1455, 0x0000 }, - { 0x0700, 0x1457, 0x0000 }, - { 0x8700, 0x14d8, 0x8000 }, - { 0x8700, 0x1498, 0x7000 }, - { 0x8700, 0x1478, 0x6000 }, - { 0x8700, 0x1468, 0x5000 }, - { 0x8700, 0x1460, 0x4000 }, - { 0x8700, 0x145c, 0x3000 }, - { 0x8700, 0x145a, 0x2000 }, - { 0x0700, 0x1459, 0x0000 }, - { 0x0700, 0x145b, 0x0000 }, - { 0x8700, 0x145e, 0x2000 }, - { 0x0700, 0x145d, 0x0000 }, - { 0x0700, 0x145f, 0x0000 }, - { 0x8700, 0x1464, 0x3000 }, - { 0x8700, 0x1462, 0x2000 }, - { 0x0700, 0x1461, 0x0000 }, - { 0x0700, 0x1463, 0x0000 }, - { 0x8700, 0x1466, 0x2000 }, - { 0x0700, 0x1465, 0x0000 }, - { 0x0700, 0x1467, 0x0000 }, - { 0x8700, 0x1470, 0x4000 }, - { 0x8700, 0x146c, 0x3000 }, - { 0x8700, 0x146a, 0x2000 }, - { 0x0700, 0x1469, 0x0000 }, - { 0x0700, 0x146b, 0x0000 }, - { 0x8700, 0x146e, 0x2000 }, - { 0x0700, 0x146d, 0x0000 }, - { 0x0700, 0x146f, 0x0000 }, - { 0x8700, 0x1474, 0x3000 }, - { 0x8700, 0x1472, 0x2000 }, - { 0x0700, 0x1471, 0x0000 }, - { 0x0700, 0x1473, 0x0000 }, - { 0x8700, 0x1476, 0x2000 }, - { 0x0700, 0x1475, 0x0000 }, - { 0x0700, 0x1477, 0x0000 }, - { 0x8700, 0x1488, 0x5000 }, - { 0x8700, 0x1480, 0x4000 }, - { 0x8700, 0x147c, 0x3000 }, - { 0x8700, 0x147a, 0x2000 }, - { 0x0700, 0x1479, 0x0000 }, - { 0x0700, 0x147b, 0x0000 }, - { 0x8700, 0x147e, 0x2000 }, - { 0x0700, 0x147d, 0x0000 }, - { 0x0700, 0x147f, 0x0000 }, - { 0x8700, 0x1484, 0x3000 }, - { 0x8700, 0x1482, 0x2000 }, - { 0x0700, 0x1481, 0x0000 }, - { 0x0700, 0x1483, 0x0000 }, - { 0x8700, 0x1486, 0x2000 }, - { 0x0700, 0x1485, 0x0000 }, - { 0x0700, 0x1487, 0x0000 }, - { 0x8700, 0x1490, 0x4000 }, - { 0x8700, 0x148c, 0x3000 }, - { 0x8700, 0x148a, 0x2000 }, - { 0x0700, 0x1489, 0x0000 }, - { 0x0700, 0x148b, 0x0000 }, - { 0x8700, 0x148e, 0x2000 }, - { 0x0700, 0x148d, 0x0000 }, - { 0x0700, 0x148f, 0x0000 }, - { 0x8700, 0x1494, 0x3000 }, - { 0x8700, 0x1492, 0x2000 }, - { 0x0700, 0x1491, 0x0000 }, - { 0x0700, 0x1493, 0x0000 }, - { 0x8700, 0x1496, 0x2000 }, - { 0x0700, 0x1495, 0x0000 }, - { 0x0700, 0x1497, 0x0000 }, - { 0x8700, 0x14b8, 0x6000 }, - { 0x8700, 0x14a8, 0x5000 }, - { 0x8700, 0x14a0, 0x4000 }, - { 0x8700, 0x149c, 0x3000 }, - { 0x8700, 0x149a, 0x2000 }, - { 0x0700, 0x1499, 0x0000 }, - { 0x0700, 0x149b, 0x0000 }, - { 0x8700, 0x149e, 0x2000 }, - { 0x0700, 0x149d, 0x0000 }, - { 0x0700, 0x149f, 0x0000 }, - { 0x8700, 0x14a4, 0x3000 }, - { 0x8700, 0x14a2, 0x2000 }, - { 0x0700, 0x14a1, 0x0000 }, - { 0x0700, 0x14a3, 0x0000 }, - { 0x8700, 0x14a6, 0x2000 }, - { 0x0700, 0x14a5, 0x0000 }, - { 0x0700, 0x14a7, 0x0000 }, - { 0x8700, 0x14b0, 0x4000 }, - { 0x8700, 0x14ac, 0x3000 }, - { 0x8700, 0x14aa, 0x2000 }, - { 0x0700, 0x14a9, 0x0000 }, - { 0x0700, 0x14ab, 0x0000 }, - { 0x8700, 0x14ae, 0x2000 }, - { 0x0700, 0x14ad, 0x0000 }, - { 0x0700, 0x14af, 0x0000 }, - { 0x8700, 0x14b4, 0x3000 }, - { 0x8700, 0x14b2, 0x2000 }, - { 0x0700, 0x14b1, 0x0000 }, - { 0x0700, 0x14b3, 0x0000 }, - { 0x8700, 0x14b6, 0x2000 }, - { 0x0700, 0x14b5, 0x0000 }, - { 0x0700, 0x14b7, 0x0000 }, - { 0x8700, 0x14c8, 0x5000 }, - { 0x8700, 0x14c0, 0x4000 }, - { 0x8700, 0x14bc, 0x3000 }, - { 0x8700, 0x14ba, 0x2000 }, - { 0x0700, 0x14b9, 0x0000 }, - { 0x0700, 0x14bb, 0x0000 }, - { 0x8700, 0x14be, 0x2000 }, - { 0x0700, 0x14bd, 0x0000 }, - { 0x0700, 0x14bf, 0x0000 }, - { 0x8700, 0x14c4, 0x3000 }, - { 0x8700, 0x14c2, 0x2000 }, - { 0x0700, 0x14c1, 0x0000 }, - { 0x0700, 0x14c3, 0x0000 }, - { 0x8700, 0x14c6, 0x2000 }, - { 0x0700, 0x14c5, 0x0000 }, - { 0x0700, 0x14c7, 0x0000 }, - { 0x8700, 0x14d0, 0x4000 }, - { 0x8700, 0x14cc, 0x3000 }, - { 0x8700, 0x14ca, 0x2000 }, - { 0x0700, 0x14c9, 0x0000 }, - { 0x0700, 0x14cb, 0x0000 }, - { 0x8700, 0x14ce, 0x2000 }, - { 0x0700, 0x14cd, 0x0000 }, - { 0x0700, 0x14cf, 0x0000 }, - { 0x8700, 0x14d4, 0x3000 }, - { 0x8700, 0x14d2, 0x2000 }, - { 0x0700, 0x14d1, 0x0000 }, - { 0x0700, 0x14d3, 0x0000 }, - { 0x8700, 0x14d6, 0x2000 }, - { 0x0700, 0x14d5, 0x0000 }, - { 0x0700, 0x14d7, 0x0000 }, - { 0x8700, 0x1518, 0x7000 }, - { 0x8700, 0x14f8, 0x6000 }, - { 0x8700, 0x14e8, 0x5000 }, - { 0x8700, 0x14e0, 0x4000 }, - { 0x8700, 0x14dc, 0x3000 }, - { 0x8700, 0x14da, 0x2000 }, - { 0x0700, 0x14d9, 0x0000 }, - { 0x0700, 0x14db, 0x0000 }, - { 0x8700, 0x14de, 0x2000 }, - { 0x0700, 0x14dd, 0x0000 }, - { 0x0700, 0x14df, 0x0000 }, - { 0x8700, 0x14e4, 0x3000 }, - { 0x8700, 0x14e2, 0x2000 }, - { 0x0700, 0x14e1, 0x0000 }, - { 0x0700, 0x14e3, 0x0000 }, - { 0x8700, 0x14e6, 0x2000 }, - { 0x0700, 0x14e5, 0x0000 }, - { 0x0700, 0x14e7, 0x0000 }, - { 0x8700, 0x14f0, 0x4000 }, - { 0x8700, 0x14ec, 0x3000 }, - { 0x8700, 0x14ea, 0x2000 }, - { 0x0700, 0x14e9, 0x0000 }, - { 0x0700, 0x14eb, 0x0000 }, - { 0x8700, 0x14ee, 0x2000 }, - { 0x0700, 0x14ed, 0x0000 }, - { 0x0700, 0x14ef, 0x0000 }, - { 0x8700, 0x14f4, 0x3000 }, - { 0x8700, 0x14f2, 0x2000 }, - { 0x0700, 0x14f1, 0x0000 }, - { 0x0700, 0x14f3, 0x0000 }, - { 0x8700, 0x14f6, 0x2000 }, - { 0x0700, 0x14f5, 0x0000 }, - { 0x0700, 0x14f7, 0x0000 }, - { 0x8700, 0x1508, 0x5000 }, - { 0x8700, 0x1500, 0x4000 }, - { 0x8700, 0x14fc, 0x3000 }, - { 0x8700, 0x14fa, 0x2000 }, - { 0x0700, 0x14f9, 0x0000 }, - { 0x0700, 0x14fb, 0x0000 }, - { 0x8700, 0x14fe, 0x2000 }, - { 0x0700, 0x14fd, 0x0000 }, - { 0x0700, 0x14ff, 0x0000 }, - { 0x8700, 0x1504, 0x3000 }, - { 0x8700, 0x1502, 0x2000 }, - { 0x0700, 0x1501, 0x0000 }, - { 0x0700, 0x1503, 0x0000 }, - { 0x8700, 0x1506, 0x2000 }, - { 0x0700, 0x1505, 0x0000 }, - { 0x0700, 0x1507, 0x0000 }, - { 0x8700, 0x1510, 0x4000 }, - { 0x8700, 0x150c, 0x3000 }, - { 0x8700, 0x150a, 0x2000 }, - { 0x0700, 0x1509, 0x0000 }, - { 0x0700, 0x150b, 0x0000 }, - { 0x8700, 0x150e, 0x2000 }, - { 0x0700, 0x150d, 0x0000 }, - { 0x0700, 0x150f, 0x0000 }, - { 0x8700, 0x1514, 0x3000 }, - { 0x8700, 0x1512, 0x2000 }, - { 0x0700, 0x1511, 0x0000 }, - { 0x0700, 0x1513, 0x0000 }, - { 0x8700, 0x1516, 0x2000 }, - { 0x0700, 0x1515, 0x0000 }, - { 0x0700, 0x1517, 0x0000 }, - { 0x8700, 0x1538, 0x6000 }, - { 0x8700, 0x1528, 0x5000 }, - { 0x8700, 0x1520, 0x4000 }, - { 0x8700, 0x151c, 0x3000 }, - { 0x8700, 0x151a, 0x2000 }, - { 0x0700, 0x1519, 0x0000 }, - { 0x0700, 0x151b, 0x0000 }, - { 0x8700, 0x151e, 0x2000 }, - { 0x0700, 0x151d, 0x0000 }, - { 0x0700, 0x151f, 0x0000 }, - { 0x8700, 0x1524, 0x3000 }, - { 0x8700, 0x1522, 0x2000 }, - { 0x0700, 0x1521, 0x0000 }, - { 0x0700, 0x1523, 0x0000 }, - { 0x8700, 0x1526, 0x2000 }, - { 0x0700, 0x1525, 0x0000 }, - { 0x0700, 0x1527, 0x0000 }, - { 0x8700, 0x1530, 0x4000 }, - { 0x8700, 0x152c, 0x3000 }, - { 0x8700, 0x152a, 0x2000 }, - { 0x0700, 0x1529, 0x0000 }, - { 0x0700, 0x152b, 0x0000 }, - { 0x8700, 0x152e, 0x2000 }, - { 0x0700, 0x152d, 0x0000 }, - { 0x0700, 0x152f, 0x0000 }, - { 0x8700, 0x1534, 0x3000 }, - { 0x8700, 0x1532, 0x2000 }, - { 0x0700, 0x1531, 0x0000 }, - { 0x0700, 0x1533, 0x0000 }, - { 0x8700, 0x1536, 0x2000 }, - { 0x0700, 0x1535, 0x0000 }, - { 0x0700, 0x1537, 0x0000 }, - { 0x8700, 0x1548, 0x5000 }, - { 0x8700, 0x1540, 0x4000 }, - { 0x8700, 0x153c, 0x3000 }, - { 0x8700, 0x153a, 0x2000 }, - { 0x0700, 0x1539, 0x0000 }, - { 0x0700, 0x153b, 0x0000 }, - { 0x8700, 0x153e, 0x2000 }, - { 0x0700, 0x153d, 0x0000 }, - { 0x0700, 0x153f, 0x0000 }, - { 0x8700, 0x1544, 0x3000 }, - { 0x8700, 0x1542, 0x2000 }, - { 0x0700, 0x1541, 0x0000 }, - { 0x0700, 0x1543, 0x0000 }, - { 0x8700, 0x1546, 0x2000 }, - { 0x0700, 0x1545, 0x0000 }, - { 0x0700, 0x1547, 0x0000 }, - { 0x8700, 0x1550, 0x4000 }, - { 0x8700, 0x154c, 0x3000 }, - { 0x8700, 0x154a, 0x2000 }, - { 0x0700, 0x1549, 0x0000 }, - { 0x0700, 0x154b, 0x0000 }, - { 0x8700, 0x154e, 0x2000 }, - { 0x0700, 0x154d, 0x0000 }, - { 0x0700, 0x154f, 0x0000 }, - { 0x8700, 0x1554, 0x3000 }, - { 0x8700, 0x1552, 0x2000 }, - { 0x0700, 0x1551, 0x0000 }, - { 0x0700, 0x1553, 0x0000 }, - { 0x8700, 0x1556, 0x2000 }, - { 0x0700, 0x1555, 0x0000 }, - { 0x0700, 0x1557, 0x0000 }, - { 0x9900, 0x22ae, 0xc000 }, - { 0x8900, 0x1e24, 0xb001 }, - { 0x8700, 0x17a2, 0xa000 }, - { 0x8700, 0x1658, 0x9000 }, - { 0x8700, 0x15d8, 0x8000 }, - { 0x8700, 0x1598, 0x7000 }, - { 0x8700, 0x1578, 0x6000 }, - { 0x8700, 0x1568, 0x5000 }, - { 0x8700, 0x1560, 0x4000 }, - { 0x8700, 0x155c, 0x3000 }, - { 0x8700, 0x155a, 0x2000 }, - { 0x0700, 0x1559, 0x0000 }, - { 0x0700, 0x155b, 0x0000 }, - { 0x8700, 0x155e, 0x2000 }, - { 0x0700, 0x155d, 0x0000 }, - { 0x0700, 0x155f, 0x0000 }, - { 0x8700, 0x1564, 0x3000 }, - { 0x8700, 0x1562, 0x2000 }, - { 0x0700, 0x1561, 0x0000 }, - { 0x0700, 0x1563, 0x0000 }, - { 0x8700, 0x1566, 0x2000 }, - { 0x0700, 0x1565, 0x0000 }, - { 0x0700, 0x1567, 0x0000 }, - { 0x8700, 0x1570, 0x4000 }, - { 0x8700, 0x156c, 0x3000 }, - { 0x8700, 0x156a, 0x2000 }, - { 0x0700, 0x1569, 0x0000 }, - { 0x0700, 0x156b, 0x0000 }, - { 0x8700, 0x156e, 0x2000 }, - { 0x0700, 0x156d, 0x0000 }, - { 0x0700, 0x156f, 0x0000 }, - { 0x8700, 0x1574, 0x3000 }, - { 0x8700, 0x1572, 0x2000 }, - { 0x0700, 0x1571, 0x0000 }, - { 0x0700, 0x1573, 0x0000 }, - { 0x8700, 0x1576, 0x2000 }, - { 0x0700, 0x1575, 0x0000 }, - { 0x0700, 0x1577, 0x0000 }, - { 0x8700, 0x1588, 0x5000 }, - { 0x8700, 0x1580, 0x4000 }, - { 0x8700, 0x157c, 0x3000 }, - { 0x8700, 0x157a, 0x2000 }, - { 0x0700, 0x1579, 0x0000 }, - { 0x0700, 0x157b, 0x0000 }, - { 0x8700, 0x157e, 0x2000 }, - { 0x0700, 0x157d, 0x0000 }, - { 0x0700, 0x157f, 0x0000 }, - { 0x8700, 0x1584, 0x3000 }, - { 0x8700, 0x1582, 0x2000 }, - { 0x0700, 0x1581, 0x0000 }, - { 0x0700, 0x1583, 0x0000 }, - { 0x8700, 0x1586, 0x2000 }, - { 0x0700, 0x1585, 0x0000 }, - { 0x0700, 0x1587, 0x0000 }, - { 0x8700, 0x1590, 0x4000 }, - { 0x8700, 0x158c, 0x3000 }, - { 0x8700, 0x158a, 0x2000 }, - { 0x0700, 0x1589, 0x0000 }, - { 0x0700, 0x158b, 0x0000 }, - { 0x8700, 0x158e, 0x2000 }, - { 0x0700, 0x158d, 0x0000 }, - { 0x0700, 0x158f, 0x0000 }, - { 0x8700, 0x1594, 0x3000 }, - { 0x8700, 0x1592, 0x2000 }, - { 0x0700, 0x1591, 0x0000 }, - { 0x0700, 0x1593, 0x0000 }, - { 0x8700, 0x1596, 0x2000 }, - { 0x0700, 0x1595, 0x0000 }, - { 0x0700, 0x1597, 0x0000 }, - { 0x8700, 0x15b8, 0x6000 }, - { 0x8700, 0x15a8, 0x5000 }, - { 0x8700, 0x15a0, 0x4000 }, - { 0x8700, 0x159c, 0x3000 }, - { 0x8700, 0x159a, 0x2000 }, - { 0x0700, 0x1599, 0x0000 }, - { 0x0700, 0x159b, 0x0000 }, - { 0x8700, 0x159e, 0x2000 }, - { 0x0700, 0x159d, 0x0000 }, - { 0x0700, 0x159f, 0x0000 }, - { 0x8700, 0x15a4, 0x3000 }, - { 0x8700, 0x15a2, 0x2000 }, - { 0x0700, 0x15a1, 0x0000 }, - { 0x0700, 0x15a3, 0x0000 }, - { 0x8700, 0x15a6, 0x2000 }, - { 0x0700, 0x15a5, 0x0000 }, - { 0x0700, 0x15a7, 0x0000 }, - { 0x8700, 0x15b0, 0x4000 }, - { 0x8700, 0x15ac, 0x3000 }, - { 0x8700, 0x15aa, 0x2000 }, - { 0x0700, 0x15a9, 0x0000 }, - { 0x0700, 0x15ab, 0x0000 }, - { 0x8700, 0x15ae, 0x2000 }, - { 0x0700, 0x15ad, 0x0000 }, - { 0x0700, 0x15af, 0x0000 }, - { 0x8700, 0x15b4, 0x3000 }, - { 0x8700, 0x15b2, 0x2000 }, - { 0x0700, 0x15b1, 0x0000 }, - { 0x0700, 0x15b3, 0x0000 }, - { 0x8700, 0x15b6, 0x2000 }, - { 0x0700, 0x15b5, 0x0000 }, - { 0x0700, 0x15b7, 0x0000 }, - { 0x8700, 0x15c8, 0x5000 }, - { 0x8700, 0x15c0, 0x4000 }, - { 0x8700, 0x15bc, 0x3000 }, - { 0x8700, 0x15ba, 0x2000 }, - { 0x0700, 0x15b9, 0x0000 }, - { 0x0700, 0x15bb, 0x0000 }, - { 0x8700, 0x15be, 0x2000 }, - { 0x0700, 0x15bd, 0x0000 }, - { 0x0700, 0x15bf, 0x0000 }, - { 0x8700, 0x15c4, 0x3000 }, - { 0x8700, 0x15c2, 0x2000 }, - { 0x0700, 0x15c1, 0x0000 }, - { 0x0700, 0x15c3, 0x0000 }, - { 0x8700, 0x15c6, 0x2000 }, - { 0x0700, 0x15c5, 0x0000 }, - { 0x0700, 0x15c7, 0x0000 }, - { 0x8700, 0x15d0, 0x4000 }, - { 0x8700, 0x15cc, 0x3000 }, - { 0x8700, 0x15ca, 0x2000 }, - { 0x0700, 0x15c9, 0x0000 }, - { 0x0700, 0x15cb, 0x0000 }, - { 0x8700, 0x15ce, 0x2000 }, - { 0x0700, 0x15cd, 0x0000 }, - { 0x0700, 0x15cf, 0x0000 }, - { 0x8700, 0x15d4, 0x3000 }, - { 0x8700, 0x15d2, 0x2000 }, - { 0x0700, 0x15d1, 0x0000 }, - { 0x0700, 0x15d3, 0x0000 }, - { 0x8700, 0x15d6, 0x2000 }, - { 0x0700, 0x15d5, 0x0000 }, - { 0x0700, 0x15d7, 0x0000 }, - { 0x8700, 0x1618, 0x7000 }, - { 0x8700, 0x15f8, 0x6000 }, - { 0x8700, 0x15e8, 0x5000 }, - { 0x8700, 0x15e0, 0x4000 }, - { 0x8700, 0x15dc, 0x3000 }, - { 0x8700, 0x15da, 0x2000 }, - { 0x0700, 0x15d9, 0x0000 }, - { 0x0700, 0x15db, 0x0000 }, - { 0x8700, 0x15de, 0x2000 }, - { 0x0700, 0x15dd, 0x0000 }, - { 0x0700, 0x15df, 0x0000 }, - { 0x8700, 0x15e4, 0x3000 }, - { 0x8700, 0x15e2, 0x2000 }, - { 0x0700, 0x15e1, 0x0000 }, - { 0x0700, 0x15e3, 0x0000 }, - { 0x8700, 0x15e6, 0x2000 }, - { 0x0700, 0x15e5, 0x0000 }, - { 0x0700, 0x15e7, 0x0000 }, - { 0x8700, 0x15f0, 0x4000 }, - { 0x8700, 0x15ec, 0x3000 }, - { 0x8700, 0x15ea, 0x2000 }, - { 0x0700, 0x15e9, 0x0000 }, - { 0x0700, 0x15eb, 0x0000 }, - { 0x8700, 0x15ee, 0x2000 }, - { 0x0700, 0x15ed, 0x0000 }, - { 0x0700, 0x15ef, 0x0000 }, - { 0x8700, 0x15f4, 0x3000 }, - { 0x8700, 0x15f2, 0x2000 }, - { 0x0700, 0x15f1, 0x0000 }, - { 0x0700, 0x15f3, 0x0000 }, - { 0x8700, 0x15f6, 0x2000 }, - { 0x0700, 0x15f5, 0x0000 }, - { 0x0700, 0x15f7, 0x0000 }, - { 0x8700, 0x1608, 0x5000 }, - { 0x8700, 0x1600, 0x4000 }, - { 0x8700, 0x15fc, 0x3000 }, - { 0x8700, 0x15fa, 0x2000 }, - { 0x0700, 0x15f9, 0x0000 }, - { 0x0700, 0x15fb, 0x0000 }, - { 0x8700, 0x15fe, 0x2000 }, - { 0x0700, 0x15fd, 0x0000 }, - { 0x0700, 0x15ff, 0x0000 }, - { 0x8700, 0x1604, 0x3000 }, - { 0x8700, 0x1602, 0x2000 }, - { 0x0700, 0x1601, 0x0000 }, - { 0x0700, 0x1603, 0x0000 }, - { 0x8700, 0x1606, 0x2000 }, - { 0x0700, 0x1605, 0x0000 }, - { 0x0700, 0x1607, 0x0000 }, - { 0x8700, 0x1610, 0x4000 }, - { 0x8700, 0x160c, 0x3000 }, - { 0x8700, 0x160a, 0x2000 }, - { 0x0700, 0x1609, 0x0000 }, - { 0x0700, 0x160b, 0x0000 }, - { 0x8700, 0x160e, 0x2000 }, - { 0x0700, 0x160d, 0x0000 }, - { 0x0700, 0x160f, 0x0000 }, - { 0x8700, 0x1614, 0x3000 }, - { 0x8700, 0x1612, 0x2000 }, - { 0x0700, 0x1611, 0x0000 }, - { 0x0700, 0x1613, 0x0000 }, - { 0x8700, 0x1616, 0x2000 }, - { 0x0700, 0x1615, 0x0000 }, - { 0x0700, 0x1617, 0x0000 }, - { 0x8700, 0x1638, 0x6000 }, - { 0x8700, 0x1628, 0x5000 }, - { 0x8700, 0x1620, 0x4000 }, - { 0x8700, 0x161c, 0x3000 }, - { 0x8700, 0x161a, 0x2000 }, - { 0x0700, 0x1619, 0x0000 }, - { 0x0700, 0x161b, 0x0000 }, - { 0x8700, 0x161e, 0x2000 }, - { 0x0700, 0x161d, 0x0000 }, - { 0x0700, 0x161f, 0x0000 }, - { 0x8700, 0x1624, 0x3000 }, - { 0x8700, 0x1622, 0x2000 }, - { 0x0700, 0x1621, 0x0000 }, - { 0x0700, 0x1623, 0x0000 }, - { 0x8700, 0x1626, 0x2000 }, - { 0x0700, 0x1625, 0x0000 }, - { 0x0700, 0x1627, 0x0000 }, - { 0x8700, 0x1630, 0x4000 }, - { 0x8700, 0x162c, 0x3000 }, - { 0x8700, 0x162a, 0x2000 }, - { 0x0700, 0x1629, 0x0000 }, - { 0x0700, 0x162b, 0x0000 }, - { 0x8700, 0x162e, 0x2000 }, - { 0x0700, 0x162d, 0x0000 }, - { 0x0700, 0x162f, 0x0000 }, - { 0x8700, 0x1634, 0x3000 }, - { 0x8700, 0x1632, 0x2000 }, - { 0x0700, 0x1631, 0x0000 }, - { 0x0700, 0x1633, 0x0000 }, - { 0x8700, 0x1636, 0x2000 }, - { 0x0700, 0x1635, 0x0000 }, - { 0x0700, 0x1637, 0x0000 }, - { 0x8700, 0x1648, 0x5000 }, - { 0x8700, 0x1640, 0x4000 }, - { 0x8700, 0x163c, 0x3000 }, - { 0x8700, 0x163a, 0x2000 }, - { 0x0700, 0x1639, 0x0000 }, - { 0x0700, 0x163b, 0x0000 }, - { 0x8700, 0x163e, 0x2000 }, - { 0x0700, 0x163d, 0x0000 }, - { 0x0700, 0x163f, 0x0000 }, - { 0x8700, 0x1644, 0x3000 }, - { 0x8700, 0x1642, 0x2000 }, - { 0x0700, 0x1641, 0x0000 }, - { 0x0700, 0x1643, 0x0000 }, - { 0x8700, 0x1646, 0x2000 }, - { 0x0700, 0x1645, 0x0000 }, - { 0x0700, 0x1647, 0x0000 }, - { 0x8700, 0x1650, 0x4000 }, - { 0x8700, 0x164c, 0x3000 }, - { 0x8700, 0x164a, 0x2000 }, - { 0x0700, 0x1649, 0x0000 }, - { 0x0700, 0x164b, 0x0000 }, - { 0x8700, 0x164e, 0x2000 }, - { 0x0700, 0x164d, 0x0000 }, - { 0x0700, 0x164f, 0x0000 }, - { 0x8700, 0x1654, 0x3000 }, - { 0x8700, 0x1652, 0x2000 }, - { 0x0700, 0x1651, 0x0000 }, - { 0x0700, 0x1653, 0x0000 }, - { 0x8700, 0x1656, 0x2000 }, - { 0x0700, 0x1655, 0x0000 }, - { 0x0700, 0x1657, 0x0000 }, - { 0x8700, 0x16e4, 0x8000 }, - { 0x8700, 0x16a4, 0x7000 }, - { 0x8700, 0x1681, 0x6000 }, - { 0x8700, 0x1668, 0x5000 }, - { 0x8700, 0x1660, 0x4000 }, - { 0x8700, 0x165c, 0x3000 }, - { 0x8700, 0x165a, 0x2000 }, - { 0x0700, 0x1659, 0x0000 }, - { 0x0700, 0x165b, 0x0000 }, - { 0x8700, 0x165e, 0x2000 }, - { 0x0700, 0x165d, 0x0000 }, - { 0x0700, 0x165f, 0x0000 }, - { 0x8700, 0x1664, 0x3000 }, - { 0x8700, 0x1662, 0x2000 }, - { 0x0700, 0x1661, 0x0000 }, - { 0x0700, 0x1663, 0x0000 }, - { 0x8700, 0x1666, 0x2000 }, - { 0x0700, 0x1665, 0x0000 }, - { 0x0700, 0x1667, 0x0000 }, - { 0x8700, 0x1670, 0x4000 }, - { 0x8700, 0x166c, 0x3000 }, - { 0x8700, 0x166a, 0x2000 }, - { 0x0700, 0x1669, 0x0000 }, - { 0x0700, 0x166b, 0x0000 }, - { 0x9500, 0x166e, 0x2000 }, - { 0x1500, 0x166d, 0x0000 }, - { 0x0700, 0x166f, 0x0000 }, - { 0x8700, 0x1674, 0x3000 }, - { 0x8700, 0x1672, 0x2000 }, - { 0x0700, 0x1671, 0x0000 }, - { 0x0700, 0x1673, 0x0000 }, - { 0x8700, 0x1676, 0x2000 }, - { 0x0700, 0x1675, 0x0000 }, - { 0x1d00, 0x1680, 0x0000 }, - { 0x8700, 0x1691, 0x5000 }, - { 0x8700, 0x1689, 0x4000 }, - { 0x8700, 0x1685, 0x3000 }, - { 0x8700, 0x1683, 0x2000 }, - { 0x0700, 0x1682, 0x0000 }, - { 0x0700, 0x1684, 0x0000 }, - { 0x8700, 0x1687, 0x2000 }, - { 0x0700, 0x1686, 0x0000 }, - { 0x0700, 0x1688, 0x0000 }, - { 0x8700, 0x168d, 0x3000 }, - { 0x8700, 0x168b, 0x2000 }, - { 0x0700, 0x168a, 0x0000 }, - { 0x0700, 0x168c, 0x0000 }, - { 0x8700, 0x168f, 0x2000 }, - { 0x0700, 0x168e, 0x0000 }, - { 0x0700, 0x1690, 0x0000 }, - { 0x8700, 0x1699, 0x4000 }, - { 0x8700, 0x1695, 0x3000 }, - { 0x8700, 0x1693, 0x2000 }, - { 0x0700, 0x1692, 0x0000 }, - { 0x0700, 0x1694, 0x0000 }, - { 0x8700, 0x1697, 0x2000 }, - { 0x0700, 0x1696, 0x0000 }, - { 0x0700, 0x1698, 0x0000 }, - { 0x8700, 0x16a0, 0x3000 }, - { 0x9600, 0x169b, 0x2000 }, - { 0x0700, 0x169a, 0x0000 }, - { 0x1200, 0x169c, 0x0000 }, - { 0x8700, 0x16a2, 0x2000 }, - { 0x0700, 0x16a1, 0x0000 }, - { 0x0700, 0x16a3, 0x0000 }, - { 0x8700, 0x16c4, 0x6000 }, - { 0x8700, 0x16b4, 0x5000 }, - { 0x8700, 0x16ac, 0x4000 }, - { 0x8700, 0x16a8, 0x3000 }, - { 0x8700, 0x16a6, 0x2000 }, - { 0x0700, 0x16a5, 0x0000 }, - { 0x0700, 0x16a7, 0x0000 }, - { 0x8700, 0x16aa, 0x2000 }, - { 0x0700, 0x16a9, 0x0000 }, - { 0x0700, 0x16ab, 0x0000 }, - { 0x8700, 0x16b0, 0x3000 }, - { 0x8700, 0x16ae, 0x2000 }, - { 0x0700, 0x16ad, 0x0000 }, - { 0x0700, 0x16af, 0x0000 }, - { 0x8700, 0x16b2, 0x2000 }, - { 0x0700, 0x16b1, 0x0000 }, - { 0x0700, 0x16b3, 0x0000 }, - { 0x8700, 0x16bc, 0x4000 }, - { 0x8700, 0x16b8, 0x3000 }, - { 0x8700, 0x16b6, 0x2000 }, - { 0x0700, 0x16b5, 0x0000 }, - { 0x0700, 0x16b7, 0x0000 }, - { 0x8700, 0x16ba, 0x2000 }, - { 0x0700, 0x16b9, 0x0000 }, - { 0x0700, 0x16bb, 0x0000 }, - { 0x8700, 0x16c0, 0x3000 }, - { 0x8700, 0x16be, 0x2000 }, - { 0x0700, 0x16bd, 0x0000 }, - { 0x0700, 0x16bf, 0x0000 }, - { 0x8700, 0x16c2, 0x2000 }, - { 0x0700, 0x16c1, 0x0000 }, - { 0x0700, 0x16c3, 0x0000 }, - { 0x8700, 0x16d4, 0x5000 }, - { 0x8700, 0x16cc, 0x4000 }, - { 0x8700, 0x16c8, 0x3000 }, - { 0x8700, 0x16c6, 0x2000 }, - { 0x0700, 0x16c5, 0x0000 }, - { 0x0700, 0x16c7, 0x0000 }, - { 0x8700, 0x16ca, 0x2000 }, - { 0x0700, 0x16c9, 0x0000 }, - { 0x0700, 0x16cb, 0x0000 }, - { 0x8700, 0x16d0, 0x3000 }, - { 0x8700, 0x16ce, 0x2000 }, - { 0x0700, 0x16cd, 0x0000 }, - { 0x0700, 0x16cf, 0x0000 }, - { 0x8700, 0x16d2, 0x2000 }, - { 0x0700, 0x16d1, 0x0000 }, - { 0x0700, 0x16d3, 0x0000 }, - { 0x8700, 0x16dc, 0x4000 }, - { 0x8700, 0x16d8, 0x3000 }, - { 0x8700, 0x16d6, 0x2000 }, - { 0x0700, 0x16d5, 0x0000 }, - { 0x0700, 0x16d7, 0x0000 }, - { 0x8700, 0x16da, 0x2000 }, - { 0x0700, 0x16d9, 0x0000 }, - { 0x0700, 0x16db, 0x0000 }, - { 0x8700, 0x16e0, 0x3000 }, - { 0x8700, 0x16de, 0x2000 }, - { 0x0700, 0x16dd, 0x0000 }, - { 0x0700, 0x16df, 0x0000 }, - { 0x8700, 0x16e2, 0x2000 }, - { 0x0700, 0x16e1, 0x0000 }, - { 0x0700, 0x16e3, 0x0000 }, - { 0x8700, 0x1748, 0x7000 }, - { 0x8c00, 0x1714, 0x6000 }, - { 0x8700, 0x1703, 0x5000 }, - { 0x9500, 0x16ec, 0x4000 }, - { 0x8700, 0x16e8, 0x3000 }, - { 0x8700, 0x16e6, 0x2000 }, - { 0x0700, 0x16e5, 0x0000 }, - { 0x0700, 0x16e7, 0x0000 }, - { 0x8700, 0x16ea, 0x2000 }, - { 0x0700, 0x16e9, 0x0000 }, - { 0x1500, 0x16eb, 0x0000 }, - { 0x8e00, 0x16f0, 0x3000 }, - { 0x8e00, 0x16ee, 0x2000 }, - { 0x1500, 0x16ed, 0x0000 }, - { 0x0e00, 0x16ef, 0x0000 }, - { 0x8700, 0x1701, 0x2000 }, - { 0x0700, 0x1700, 0x0000 }, - { 0x0700, 0x1702, 0x0000 }, - { 0x8700, 0x170b, 0x4000 }, - { 0x8700, 0x1707, 0x3000 }, - { 0x8700, 0x1705, 0x2000 }, - { 0x0700, 0x1704, 0x0000 }, - { 0x0700, 0x1706, 0x0000 }, - { 0x8700, 0x1709, 0x2000 }, - { 0x0700, 0x1708, 0x0000 }, - { 0x0700, 0x170a, 0x0000 }, - { 0x8700, 0x1710, 0x3000 }, - { 0x8700, 0x170e, 0x2000 }, - { 0x0700, 0x170c, 0x0000 }, - { 0x0700, 0x170f, 0x0000 }, - { 0x8c00, 0x1712, 0x2000 }, - { 0x0700, 0x1711, 0x0000 }, - { 0x0c00, 0x1713, 0x0000 }, - { 0x8700, 0x172f, 0x5000 }, - { 0x8700, 0x1727, 0x4000 }, - { 0x8700, 0x1723, 0x3000 }, - { 0x8700, 0x1721, 0x2000 }, - { 0x0700, 0x1720, 0x0000 }, - { 0x0700, 0x1722, 0x0000 }, - { 0x8700, 0x1725, 0x2000 }, - { 0x0700, 0x1724, 0x0000 }, - { 0x0700, 0x1726, 0x0000 }, - { 0x8700, 0x172b, 0x3000 }, - { 0x8700, 0x1729, 0x2000 }, - { 0x0700, 0x1728, 0x0000 }, - { 0x0700, 0x172a, 0x0000 }, - { 0x8700, 0x172d, 0x2000 }, - { 0x0700, 0x172c, 0x0000 }, - { 0x0700, 0x172e, 0x0000 }, - { 0x8700, 0x1740, 0x4000 }, - { 0x8c00, 0x1733, 0x3000 }, - { 0x8700, 0x1731, 0x2000 }, - { 0x0700, 0x1730, 0x0000 }, - { 0x0c00, 0x1732, 0x0000 }, - { 0x9500, 0x1735, 0x2000 }, - { 0x0c00, 0x1734, 0x0000 }, - { 0x1500, 0x1736, 0x0000 }, - { 0x8700, 0x1744, 0x3000 }, - { 0x8700, 0x1742, 0x2000 }, - { 0x0700, 0x1741, 0x0000 }, - { 0x0700, 0x1743, 0x0000 }, - { 0x8700, 0x1746, 0x2000 }, - { 0x0700, 0x1745, 0x0000 }, - { 0x0700, 0x1747, 0x0000 }, - { 0x8700, 0x1782, 0x6000 }, - { 0x8700, 0x1764, 0x5000 }, - { 0x8700, 0x1750, 0x4000 }, - { 0x8700, 0x174c, 0x3000 }, - { 0x8700, 0x174a, 0x2000 }, - { 0x0700, 0x1749, 0x0000 }, - { 0x0700, 0x174b, 0x0000 }, - { 0x8700, 0x174e, 0x2000 }, - { 0x0700, 0x174d, 0x0000 }, - { 0x0700, 0x174f, 0x0000 }, - { 0x8700, 0x1760, 0x3000 }, - { 0x8c00, 0x1752, 0x2000 }, - { 0x0700, 0x1751, 0x0000 }, - { 0x0c00, 0x1753, 0x0000 }, - { 0x8700, 0x1762, 0x2000 }, - { 0x0700, 0x1761, 0x0000 }, - { 0x0700, 0x1763, 0x0000 }, - { 0x8700, 0x176c, 0x4000 }, - { 0x8700, 0x1768, 0x3000 }, - { 0x8700, 0x1766, 0x2000 }, - { 0x0700, 0x1765, 0x0000 }, - { 0x0700, 0x1767, 0x0000 }, - { 0x8700, 0x176a, 0x2000 }, - { 0x0700, 0x1769, 0x0000 }, - { 0x0700, 0x176b, 0x0000 }, - { 0x8c00, 0x1772, 0x3000 }, - { 0x8700, 0x176f, 0x2000 }, - { 0x0700, 0x176e, 0x0000 }, - { 0x0700, 0x1770, 0x0000 }, - { 0x8700, 0x1780, 0x2000 }, - { 0x0c00, 0x1773, 0x0000 }, - { 0x0700, 0x1781, 0x0000 }, - { 0x8700, 0x1792, 0x5000 }, - { 0x8700, 0x178a, 0x4000 }, - { 0x8700, 0x1786, 0x3000 }, - { 0x8700, 0x1784, 0x2000 }, - { 0x0700, 0x1783, 0x0000 }, - { 0x0700, 0x1785, 0x0000 }, - { 0x8700, 0x1788, 0x2000 }, - { 0x0700, 0x1787, 0x0000 }, - { 0x0700, 0x1789, 0x0000 }, - { 0x8700, 0x178e, 0x3000 }, - { 0x8700, 0x178c, 0x2000 }, - { 0x0700, 0x178b, 0x0000 }, - { 0x0700, 0x178d, 0x0000 }, - { 0x8700, 0x1790, 0x2000 }, - { 0x0700, 0x178f, 0x0000 }, - { 0x0700, 0x1791, 0x0000 }, - { 0x8700, 0x179a, 0x4000 }, - { 0x8700, 0x1796, 0x3000 }, - { 0x8700, 0x1794, 0x2000 }, - { 0x0700, 0x1793, 0x0000 }, - { 0x0700, 0x1795, 0x0000 }, - { 0x8700, 0x1798, 0x2000 }, - { 0x0700, 0x1797, 0x0000 }, - { 0x0700, 0x1799, 0x0000 }, - { 0x8700, 0x179e, 0x3000 }, - { 0x8700, 0x179c, 0x2000 }, - { 0x0700, 0x179b, 0x0000 }, - { 0x0700, 0x179d, 0x0000 }, - { 0x8700, 0x17a0, 0x2000 }, - { 0x0700, 0x179f, 0x0000 }, - { 0x0700, 0x17a1, 0x0000 }, - { 0x8700, 0x1915, 0x9000 }, - { 0x8700, 0x1837, 0x8000 }, - { 0x8d00, 0x17e4, 0x7000 }, - { 0x8a00, 0x17c2, 0x6000 }, - { 0x8700, 0x17b2, 0x5000 }, - { 0x8700, 0x17aa, 0x4000 }, - { 0x8700, 0x17a6, 0x3000 }, - { 0x8700, 0x17a4, 0x2000 }, - { 0x0700, 0x17a3, 0x0000 }, - { 0x0700, 0x17a5, 0x0000 }, - { 0x8700, 0x17a8, 0x2000 }, - { 0x0700, 0x17a7, 0x0000 }, - { 0x0700, 0x17a9, 0x0000 }, - { 0x8700, 0x17ae, 0x3000 }, - { 0x8700, 0x17ac, 0x2000 }, - { 0x0700, 0x17ab, 0x0000 }, - { 0x0700, 0x17ad, 0x0000 }, - { 0x8700, 0x17b0, 0x2000 }, - { 0x0700, 0x17af, 0x0000 }, - { 0x0700, 0x17b1, 0x0000 }, - { 0x8c00, 0x17ba, 0x4000 }, - { 0x8a00, 0x17b6, 0x3000 }, - { 0x8100, 0x17b4, 0x2000 }, - { 0x0700, 0x17b3, 0x0000 }, - { 0x0100, 0x17b5, 0x0000 }, - { 0x8c00, 0x17b8, 0x2000 }, - { 0x0c00, 0x17b7, 0x0000 }, - { 0x0c00, 0x17b9, 0x0000 }, - { 0x8a00, 0x17be, 0x3000 }, - { 0x8c00, 0x17bc, 0x2000 }, - { 0x0c00, 0x17bb, 0x0000 }, - { 0x0c00, 0x17bd, 0x0000 }, - { 0x8a00, 0x17c0, 0x2000 }, - { 0x0a00, 0x17bf, 0x0000 }, - { 0x0a00, 0x17c1, 0x0000 }, - { 0x8c00, 0x17d2, 0x5000 }, - { 0x8c00, 0x17ca, 0x4000 }, - { 0x8c00, 0x17c6, 0x3000 }, - { 0x8a00, 0x17c4, 0x2000 }, - { 0x0a00, 0x17c3, 0x0000 }, - { 0x0a00, 0x17c5, 0x0000 }, - { 0x8a00, 0x17c8, 0x2000 }, - { 0x0a00, 0x17c7, 0x0000 }, - { 0x0c00, 0x17c9, 0x0000 }, - { 0x8c00, 0x17ce, 0x3000 }, - { 0x8c00, 0x17cc, 0x2000 }, - { 0x0c00, 0x17cb, 0x0000 }, - { 0x0c00, 0x17cd, 0x0000 }, - { 0x8c00, 0x17d0, 0x2000 }, - { 0x0c00, 0x17cf, 0x0000 }, - { 0x0c00, 0x17d1, 0x0000 }, - { 0x9500, 0x17da, 0x4000 }, - { 0x9500, 0x17d6, 0x3000 }, - { 0x9500, 0x17d4, 0x2000 }, - { 0x0c00, 0x17d3, 0x0000 }, - { 0x1500, 0x17d5, 0x0000 }, - { 0x9500, 0x17d8, 0x2000 }, - { 0x0600, 0x17d7, 0x0000 }, - { 0x1500, 0x17d9, 0x0000 }, - { 0x8d00, 0x17e0, 0x3000 }, - { 0x8700, 0x17dc, 0x2000 }, - { 0x1700, 0x17db, 0x0000 }, - { 0x0c00, 0x17dd, 0x0000 }, - { 0x8d00, 0x17e2, 0x2000 }, - { 0x0d00, 0x17e1, 0x0000 }, - { 0x0d00, 0x17e3, 0x0000 }, - { 0x8d00, 0x1811, 0x6000 }, - { 0x9500, 0x1800, 0x5000 }, - { 0x8f00, 0x17f2, 0x4000 }, - { 0x8d00, 0x17e8, 0x3000 }, - { 0x8d00, 0x17e6, 0x2000 }, - { 0x0d00, 0x17e5, 0x0000 }, - { 0x0d00, 0x17e7, 0x0000 }, - { 0x8f00, 0x17f0, 0x2000 }, - { 0x0d00, 0x17e9, 0x0000 }, - { 0x0f00, 0x17f1, 0x0000 }, - { 0x8f00, 0x17f6, 0x3000 }, - { 0x8f00, 0x17f4, 0x2000 }, - { 0x0f00, 0x17f3, 0x0000 }, - { 0x0f00, 0x17f5, 0x0000 }, - { 0x8f00, 0x17f8, 0x2000 }, - { 0x0f00, 0x17f7, 0x0000 }, - { 0x0f00, 0x17f9, 0x0000 }, - { 0x9500, 0x1808, 0x4000 }, - { 0x9500, 0x1804, 0x3000 }, - { 0x9500, 0x1802, 0x2000 }, - { 0x1500, 0x1801, 0x0000 }, - { 0x1500, 0x1803, 0x0000 }, - { 0x9100, 0x1806, 0x2000 }, - { 0x1500, 0x1805, 0x0000 }, - { 0x1500, 0x1807, 0x0000 }, - { 0x8c00, 0x180c, 0x3000 }, - { 0x9500, 0x180a, 0x2000 }, - { 0x1500, 0x1809, 0x0000 }, - { 0x0c00, 0x180b, 0x0000 }, - { 0x9d00, 0x180e, 0x2000 }, - { 0x0c00, 0x180d, 0x0000 }, - { 0x0d00, 0x1810, 0x0000 }, - { 0x8700, 0x1827, 0x5000 }, - { 0x8d00, 0x1819, 0x4000 }, - { 0x8d00, 0x1815, 0x3000 }, - { 0x8d00, 0x1813, 0x2000 }, - { 0x0d00, 0x1812, 0x0000 }, - { 0x0d00, 0x1814, 0x0000 }, - { 0x8d00, 0x1817, 0x2000 }, - { 0x0d00, 0x1816, 0x0000 }, - { 0x0d00, 0x1818, 0x0000 }, - { 0x8700, 0x1823, 0x3000 }, - { 0x8700, 0x1821, 0x2000 }, - { 0x0700, 0x1820, 0x0000 }, - { 0x0700, 0x1822, 0x0000 }, - { 0x8700, 0x1825, 0x2000 }, - { 0x0700, 0x1824, 0x0000 }, - { 0x0700, 0x1826, 0x0000 }, - { 0x8700, 0x182f, 0x4000 }, - { 0x8700, 0x182b, 0x3000 }, - { 0x8700, 0x1829, 0x2000 }, - { 0x0700, 0x1828, 0x0000 }, - { 0x0700, 0x182a, 0x0000 }, - { 0x8700, 0x182d, 0x2000 }, - { 0x0700, 0x182c, 0x0000 }, - { 0x0700, 0x182e, 0x0000 }, - { 0x8700, 0x1833, 0x3000 }, - { 0x8700, 0x1831, 0x2000 }, - { 0x0700, 0x1830, 0x0000 }, - { 0x0700, 0x1832, 0x0000 }, - { 0x8700, 0x1835, 0x2000 }, - { 0x0700, 0x1834, 0x0000 }, - { 0x0700, 0x1836, 0x0000 }, - { 0x8700, 0x1877, 0x7000 }, - { 0x8700, 0x1857, 0x6000 }, - { 0x8700, 0x1847, 0x5000 }, - { 0x8700, 0x183f, 0x4000 }, - { 0x8700, 0x183b, 0x3000 }, - { 0x8700, 0x1839, 0x2000 }, - { 0x0700, 0x1838, 0x0000 }, - { 0x0700, 0x183a, 0x0000 }, - { 0x8700, 0x183d, 0x2000 }, - { 0x0700, 0x183c, 0x0000 }, - { 0x0700, 0x183e, 0x0000 }, - { 0x8600, 0x1843, 0x3000 }, - { 0x8700, 0x1841, 0x2000 }, - { 0x0700, 0x1840, 0x0000 }, - { 0x0700, 0x1842, 0x0000 }, - { 0x8700, 0x1845, 0x2000 }, - { 0x0700, 0x1844, 0x0000 }, - { 0x0700, 0x1846, 0x0000 }, - { 0x8700, 0x184f, 0x4000 }, - { 0x8700, 0x184b, 0x3000 }, - { 0x8700, 0x1849, 0x2000 }, - { 0x0700, 0x1848, 0x0000 }, - { 0x0700, 0x184a, 0x0000 }, - { 0x8700, 0x184d, 0x2000 }, - { 0x0700, 0x184c, 0x0000 }, - { 0x0700, 0x184e, 0x0000 }, - { 0x8700, 0x1853, 0x3000 }, - { 0x8700, 0x1851, 0x2000 }, - { 0x0700, 0x1850, 0x0000 }, - { 0x0700, 0x1852, 0x0000 }, - { 0x8700, 0x1855, 0x2000 }, - { 0x0700, 0x1854, 0x0000 }, - { 0x0700, 0x1856, 0x0000 }, - { 0x8700, 0x1867, 0x5000 }, - { 0x8700, 0x185f, 0x4000 }, - { 0x8700, 0x185b, 0x3000 }, - { 0x8700, 0x1859, 0x2000 }, - { 0x0700, 0x1858, 0x0000 }, - { 0x0700, 0x185a, 0x0000 }, - { 0x8700, 0x185d, 0x2000 }, - { 0x0700, 0x185c, 0x0000 }, - { 0x0700, 0x185e, 0x0000 }, - { 0x8700, 0x1863, 0x3000 }, - { 0x8700, 0x1861, 0x2000 }, - { 0x0700, 0x1860, 0x0000 }, - { 0x0700, 0x1862, 0x0000 }, - { 0x8700, 0x1865, 0x2000 }, - { 0x0700, 0x1864, 0x0000 }, - { 0x0700, 0x1866, 0x0000 }, - { 0x8700, 0x186f, 0x4000 }, - { 0x8700, 0x186b, 0x3000 }, - { 0x8700, 0x1869, 0x2000 }, - { 0x0700, 0x1868, 0x0000 }, - { 0x0700, 0x186a, 0x0000 }, - { 0x8700, 0x186d, 0x2000 }, - { 0x0700, 0x186c, 0x0000 }, - { 0x0700, 0x186e, 0x0000 }, - { 0x8700, 0x1873, 0x3000 }, - { 0x8700, 0x1871, 0x2000 }, - { 0x0700, 0x1870, 0x0000 }, - { 0x0700, 0x1872, 0x0000 }, - { 0x8700, 0x1875, 0x2000 }, - { 0x0700, 0x1874, 0x0000 }, - { 0x0700, 0x1876, 0x0000 }, - { 0x8700, 0x189f, 0x6000 }, - { 0x8700, 0x188f, 0x5000 }, - { 0x8700, 0x1887, 0x4000 }, - { 0x8700, 0x1883, 0x3000 }, - { 0x8700, 0x1881, 0x2000 }, - { 0x0700, 0x1880, 0x0000 }, - { 0x0700, 0x1882, 0x0000 }, - { 0x8700, 0x1885, 0x2000 }, - { 0x0700, 0x1884, 0x0000 }, - { 0x0700, 0x1886, 0x0000 }, - { 0x8700, 0x188b, 0x3000 }, - { 0x8700, 0x1889, 0x2000 }, - { 0x0700, 0x1888, 0x0000 }, - { 0x0700, 0x188a, 0x0000 }, - { 0x8700, 0x188d, 0x2000 }, - { 0x0700, 0x188c, 0x0000 }, - { 0x0700, 0x188e, 0x0000 }, - { 0x8700, 0x1897, 0x4000 }, - { 0x8700, 0x1893, 0x3000 }, - { 0x8700, 0x1891, 0x2000 }, - { 0x0700, 0x1890, 0x0000 }, - { 0x0700, 0x1892, 0x0000 }, - { 0x8700, 0x1895, 0x2000 }, - { 0x0700, 0x1894, 0x0000 }, - { 0x0700, 0x1896, 0x0000 }, - { 0x8700, 0x189b, 0x3000 }, - { 0x8700, 0x1899, 0x2000 }, - { 0x0700, 0x1898, 0x0000 }, - { 0x0700, 0x189a, 0x0000 }, - { 0x8700, 0x189d, 0x2000 }, - { 0x0700, 0x189c, 0x0000 }, - { 0x0700, 0x189e, 0x0000 }, - { 0x8700, 0x1905, 0x5000 }, - { 0x8700, 0x18a7, 0x4000 }, - { 0x8700, 0x18a3, 0x3000 }, - { 0x8700, 0x18a1, 0x2000 }, - { 0x0700, 0x18a0, 0x0000 }, - { 0x0700, 0x18a2, 0x0000 }, - { 0x8700, 0x18a5, 0x2000 }, - { 0x0700, 0x18a4, 0x0000 }, - { 0x0700, 0x18a6, 0x0000 }, - { 0x8700, 0x1901, 0x3000 }, - { 0x8c00, 0x18a9, 0x2000 }, - { 0x0700, 0x18a8, 0x0000 }, - { 0x0700, 0x1900, 0x0000 }, - { 0x8700, 0x1903, 0x2000 }, - { 0x0700, 0x1902, 0x0000 }, - { 0x0700, 0x1904, 0x0000 }, - { 0x8700, 0x190d, 0x4000 }, - { 0x8700, 0x1909, 0x3000 }, - { 0x8700, 0x1907, 0x2000 }, - { 0x0700, 0x1906, 0x0000 }, - { 0x0700, 0x1908, 0x0000 }, - { 0x8700, 0x190b, 0x2000 }, - { 0x0700, 0x190a, 0x0000 }, - { 0x0700, 0x190c, 0x0000 }, - { 0x8700, 0x1911, 0x3000 }, - { 0x8700, 0x190f, 0x2000 }, - { 0x0700, 0x190e, 0x0000 }, - { 0x0700, 0x1910, 0x0000 }, - { 0x8700, 0x1913, 0x2000 }, - { 0x0700, 0x1912, 0x0000 }, - { 0x0700, 0x1914, 0x0000 }, - { 0x8500, 0x1d10, 0x8000 }, - { 0x8700, 0x1963, 0x7000 }, - { 0x9a00, 0x1940, 0x6000 }, - { 0x8c00, 0x1928, 0x5000 }, - { 0x8c00, 0x1920, 0x4000 }, - { 0x8700, 0x1919, 0x3000 }, - { 0x8700, 0x1917, 0x2000 }, - { 0x0700, 0x1916, 0x0000 }, - { 0x0700, 0x1918, 0x0000 }, - { 0x8700, 0x191b, 0x2000 }, - { 0x0700, 0x191a, 0x0000 }, - { 0x0700, 0x191c, 0x0000 }, - { 0x8a00, 0x1924, 0x3000 }, - { 0x8c00, 0x1922, 0x2000 }, - { 0x0c00, 0x1921, 0x0000 }, - { 0x0a00, 0x1923, 0x0000 }, - { 0x8a00, 0x1926, 0x2000 }, - { 0x0a00, 0x1925, 0x0000 }, - { 0x0c00, 0x1927, 0x0000 }, - { 0x8a00, 0x1934, 0x4000 }, - { 0x8a00, 0x1930, 0x3000 }, - { 0x8a00, 0x192a, 0x2000 }, - { 0x0a00, 0x1929, 0x0000 }, - { 0x0a00, 0x192b, 0x0000 }, - { 0x8c00, 0x1932, 0x2000 }, - { 0x0a00, 0x1931, 0x0000 }, - { 0x0a00, 0x1933, 0x0000 }, - { 0x8a00, 0x1938, 0x3000 }, - { 0x8a00, 0x1936, 0x2000 }, - { 0x0a00, 0x1935, 0x0000 }, - { 0x0a00, 0x1937, 0x0000 }, - { 0x8c00, 0x193a, 0x2000 }, - { 0x0c00, 0x1939, 0x0000 }, - { 0x0c00, 0x193b, 0x0000 }, - { 0x8700, 0x1953, 0x5000 }, - { 0x8d00, 0x194b, 0x4000 }, - { 0x8d00, 0x1947, 0x3000 }, - { 0x9500, 0x1945, 0x2000 }, - { 0x1500, 0x1944, 0x0000 }, - { 0x0d00, 0x1946, 0x0000 }, - { 0x8d00, 0x1949, 0x2000 }, - { 0x0d00, 0x1948, 0x0000 }, - { 0x0d00, 0x194a, 0x0000 }, - { 0x8d00, 0x194f, 0x3000 }, - { 0x8d00, 0x194d, 0x2000 }, - { 0x0d00, 0x194c, 0x0000 }, - { 0x0d00, 0x194e, 0x0000 }, - { 0x8700, 0x1951, 0x2000 }, - { 0x0700, 0x1950, 0x0000 }, - { 0x0700, 0x1952, 0x0000 }, - { 0x8700, 0x195b, 0x4000 }, - { 0x8700, 0x1957, 0x3000 }, - { 0x8700, 0x1955, 0x2000 }, - { 0x0700, 0x1954, 0x0000 }, - { 0x0700, 0x1956, 0x0000 }, - { 0x8700, 0x1959, 0x2000 }, - { 0x0700, 0x1958, 0x0000 }, - { 0x0700, 0x195a, 0x0000 }, - { 0x8700, 0x195f, 0x3000 }, - { 0x8700, 0x195d, 0x2000 }, - { 0x0700, 0x195c, 0x0000 }, - { 0x0700, 0x195e, 0x0000 }, - { 0x8700, 0x1961, 0x2000 }, - { 0x0700, 0x1960, 0x0000 }, - { 0x0700, 0x1962, 0x0000 }, - { 0x9a00, 0x19f0, 0x6000 }, - { 0x9a00, 0x19e0, 0x5000 }, - { 0x8700, 0x196b, 0x4000 }, - { 0x8700, 0x1967, 0x3000 }, - { 0x8700, 0x1965, 0x2000 }, - { 0x0700, 0x1964, 0x0000 }, - { 0x0700, 0x1966, 0x0000 }, - { 0x8700, 0x1969, 0x2000 }, - { 0x0700, 0x1968, 0x0000 }, - { 0x0700, 0x196a, 0x0000 }, - { 0x8700, 0x1971, 0x3000 }, - { 0x8700, 0x196d, 0x2000 }, - { 0x0700, 0x196c, 0x0000 }, - { 0x0700, 0x1970, 0x0000 }, - { 0x8700, 0x1973, 0x2000 }, - { 0x0700, 0x1972, 0x0000 }, - { 0x0700, 0x1974, 0x0000 }, - { 0x9a00, 0x19e8, 0x4000 }, - { 0x9a00, 0x19e4, 0x3000 }, - { 0x9a00, 0x19e2, 0x2000 }, - { 0x1a00, 0x19e1, 0x0000 }, - { 0x1a00, 0x19e3, 0x0000 }, - { 0x9a00, 0x19e6, 0x2000 }, - { 0x1a00, 0x19e5, 0x0000 }, - { 0x1a00, 0x19e7, 0x0000 }, - { 0x9a00, 0x19ec, 0x3000 }, - { 0x9a00, 0x19ea, 0x2000 }, - { 0x1a00, 0x19e9, 0x0000 }, - { 0x1a00, 0x19eb, 0x0000 }, - { 0x9a00, 0x19ee, 0x2000 }, - { 0x1a00, 0x19ed, 0x0000 }, - { 0x1a00, 0x19ef, 0x0000 }, - { 0x8500, 0x1d00, 0x5000 }, - { 0x9a00, 0x19f8, 0x4000 }, - { 0x9a00, 0x19f4, 0x3000 }, - { 0x9a00, 0x19f2, 0x2000 }, - { 0x1a00, 0x19f1, 0x0000 }, - { 0x1a00, 0x19f3, 0x0000 }, - { 0x9a00, 0x19f6, 0x2000 }, - { 0x1a00, 0x19f5, 0x0000 }, - { 0x1a00, 0x19f7, 0x0000 }, - { 0x9a00, 0x19fc, 0x3000 }, - { 0x9a00, 0x19fa, 0x2000 }, - { 0x1a00, 0x19f9, 0x0000 }, - { 0x1a00, 0x19fb, 0x0000 }, - { 0x9a00, 0x19fe, 0x2000 }, - { 0x1a00, 0x19fd, 0x0000 }, - { 0x1a00, 0x19ff, 0x0000 }, - { 0x8500, 0x1d08, 0x4000 }, - { 0x8500, 0x1d04, 0x3000 }, - { 0x8500, 0x1d02, 0x2000 }, - { 0x0500, 0x1d01, 0x0000 }, - { 0x0500, 0x1d03, 0x0000 }, - { 0x8500, 0x1d06, 0x2000 }, - { 0x0500, 0x1d05, 0x0000 }, - { 0x0500, 0x1d07, 0x0000 }, - { 0x8500, 0x1d0c, 0x3000 }, - { 0x8500, 0x1d0a, 0x2000 }, - { 0x0500, 0x1d09, 0x0000 }, - { 0x0500, 0x1d0b, 0x0000 }, - { 0x8500, 0x1d0e, 0x2000 }, - { 0x0500, 0x1d0d, 0x0000 }, - { 0x0500, 0x1d0f, 0x0000 }, - { 0x8600, 0x1d50, 0x7000 }, - { 0x8600, 0x1d30, 0x6000 }, - { 0x8500, 0x1d20, 0x5000 }, - { 0x8500, 0x1d18, 0x4000 }, - { 0x8500, 0x1d14, 0x3000 }, - { 0x8500, 0x1d12, 0x2000 }, - { 0x0500, 0x1d11, 0x0000 }, - { 0x0500, 0x1d13, 0x0000 }, - { 0x8500, 0x1d16, 0x2000 }, - { 0x0500, 0x1d15, 0x0000 }, - { 0x0500, 0x1d17, 0x0000 }, - { 0x8500, 0x1d1c, 0x3000 }, - { 0x8500, 0x1d1a, 0x2000 }, - { 0x0500, 0x1d19, 0x0000 }, - { 0x0500, 0x1d1b, 0x0000 }, - { 0x8500, 0x1d1e, 0x2000 }, - { 0x0500, 0x1d1d, 0x0000 }, - { 0x0500, 0x1d1f, 0x0000 }, - { 0x8500, 0x1d28, 0x4000 }, - { 0x8500, 0x1d24, 0x3000 }, - { 0x8500, 0x1d22, 0x2000 }, - { 0x0500, 0x1d21, 0x0000 }, - { 0x0500, 0x1d23, 0x0000 }, - { 0x8500, 0x1d26, 0x2000 }, - { 0x0500, 0x1d25, 0x0000 }, - { 0x0500, 0x1d27, 0x0000 }, - { 0x8600, 0x1d2c, 0x3000 }, - { 0x8500, 0x1d2a, 0x2000 }, - { 0x0500, 0x1d29, 0x0000 }, - { 0x0500, 0x1d2b, 0x0000 }, - { 0x8600, 0x1d2e, 0x2000 }, - { 0x0600, 0x1d2d, 0x0000 }, - { 0x0600, 0x1d2f, 0x0000 }, - { 0x8600, 0x1d40, 0x5000 }, - { 0x8600, 0x1d38, 0x4000 }, - { 0x8600, 0x1d34, 0x3000 }, - { 0x8600, 0x1d32, 0x2000 }, - { 0x0600, 0x1d31, 0x0000 }, - { 0x0600, 0x1d33, 0x0000 }, - { 0x8600, 0x1d36, 0x2000 }, - { 0x0600, 0x1d35, 0x0000 }, - { 0x0600, 0x1d37, 0x0000 }, - { 0x8600, 0x1d3c, 0x3000 }, - { 0x8600, 0x1d3a, 0x2000 }, - { 0x0600, 0x1d39, 0x0000 }, - { 0x0600, 0x1d3b, 0x0000 }, - { 0x8600, 0x1d3e, 0x2000 }, - { 0x0600, 0x1d3d, 0x0000 }, - { 0x0600, 0x1d3f, 0x0000 }, - { 0x8600, 0x1d48, 0x4000 }, - { 0x8600, 0x1d44, 0x3000 }, - { 0x8600, 0x1d42, 0x2000 }, - { 0x0600, 0x1d41, 0x0000 }, - { 0x0600, 0x1d43, 0x0000 }, - { 0x8600, 0x1d46, 0x2000 }, - { 0x0600, 0x1d45, 0x0000 }, - { 0x0600, 0x1d47, 0x0000 }, - { 0x8600, 0x1d4c, 0x3000 }, - { 0x8600, 0x1d4a, 0x2000 }, - { 0x0600, 0x1d49, 0x0000 }, - { 0x0600, 0x1d4b, 0x0000 }, - { 0x8600, 0x1d4e, 0x2000 }, - { 0x0600, 0x1d4d, 0x0000 }, - { 0x0600, 0x1d4f, 0x0000 }, - { 0x8900, 0x1e04, 0x6001 }, - { 0x8600, 0x1d60, 0x5000 }, - { 0x8600, 0x1d58, 0x4000 }, - { 0x8600, 0x1d54, 0x3000 }, - { 0x8600, 0x1d52, 0x2000 }, - { 0x0600, 0x1d51, 0x0000 }, - { 0x0600, 0x1d53, 0x0000 }, - { 0x8600, 0x1d56, 0x2000 }, - { 0x0600, 0x1d55, 0x0000 }, - { 0x0600, 0x1d57, 0x0000 }, - { 0x8600, 0x1d5c, 0x3000 }, - { 0x8600, 0x1d5a, 0x2000 }, - { 0x0600, 0x1d59, 0x0000 }, - { 0x0600, 0x1d5b, 0x0000 }, - { 0x8600, 0x1d5e, 0x2000 }, - { 0x0600, 0x1d5d, 0x0000 }, - { 0x0600, 0x1d5f, 0x0000 }, - { 0x8500, 0x1d68, 0x4000 }, - { 0x8500, 0x1d64, 0x3000 }, - { 0x8500, 0x1d62, 0x2000 }, - { 0x0600, 0x1d61, 0x0000 }, - { 0x0500, 0x1d63, 0x0000 }, - { 0x8500, 0x1d66, 0x2000 }, - { 0x0500, 0x1d65, 0x0000 }, - { 0x0500, 0x1d67, 0x0000 }, - { 0x8900, 0x1e00, 0x3001 }, - { 0x8500, 0x1d6a, 0x2000 }, - { 0x0500, 0x1d69, 0x0000 }, - { 0x0500, 0x1d6b, 0x0000 }, - { 0x8900, 0x1e02, 0x2001 }, - { 0x0500, 0x1e01, 0x0fff }, - { 0x0500, 0x1e03, 0x0fff }, - { 0x8900, 0x1e14, 0x5001 }, - { 0x8900, 0x1e0c, 0x4001 }, - { 0x8900, 0x1e08, 0x3001 }, - { 0x8900, 0x1e06, 0x2001 }, - { 0x0500, 0x1e05, 0x0fff }, - { 0x0500, 0x1e07, 0x0fff }, - { 0x8900, 0x1e0a, 0x2001 }, - { 0x0500, 0x1e09, 0x0fff }, - { 0x0500, 0x1e0b, 0x0fff }, - { 0x8900, 0x1e10, 0x3001 }, - { 0x8900, 0x1e0e, 0x2001 }, - { 0x0500, 0x1e0d, 0x0fff }, - { 0x0500, 0x1e0f, 0x0fff }, - { 0x8900, 0x1e12, 0x2001 }, - { 0x0500, 0x1e11, 0x0fff }, - { 0x0500, 0x1e13, 0x0fff }, - { 0x8900, 0x1e1c, 0x4001 }, - { 0x8900, 0x1e18, 0x3001 }, - { 0x8900, 0x1e16, 0x2001 }, - { 0x0500, 0x1e15, 0x0fff }, - { 0x0500, 0x1e17, 0x0fff }, - { 0x8900, 0x1e1a, 0x2001 }, - { 0x0500, 0x1e19, 0x0fff }, - { 0x0500, 0x1e1b, 0x0fff }, - { 0x8900, 0x1e20, 0x3001 }, - { 0x8900, 0x1e1e, 0x2001 }, - { 0x0500, 0x1e1d, 0x0fff }, - { 0x0500, 0x1e1f, 0x0fff }, - { 0x8900, 0x1e22, 0x2001 }, - { 0x0500, 0x1e21, 0x0fff }, - { 0x0500, 0x1e23, 0x0fff }, - { 0x9600, 0x2045, 0xa000 }, - { 0x8500, 0x1f32, 0x9008 }, - { 0x8900, 0x1ea8, 0x8001 }, - { 0x8900, 0x1e64, 0x7001 }, - { 0x8900, 0x1e44, 0x6001 }, - { 0x8900, 0x1e34, 0x5001 }, - { 0x8900, 0x1e2c, 0x4001 }, - { 0x8900, 0x1e28, 0x3001 }, - { 0x8900, 0x1e26, 0x2001 }, - { 0x0500, 0x1e25, 0x0fff }, - { 0x0500, 0x1e27, 0x0fff }, - { 0x8900, 0x1e2a, 0x2001 }, - { 0x0500, 0x1e29, 0x0fff }, - { 0x0500, 0x1e2b, 0x0fff }, - { 0x8900, 0x1e30, 0x3001 }, - { 0x8900, 0x1e2e, 0x2001 }, - { 0x0500, 0x1e2d, 0x0fff }, - { 0x0500, 0x1e2f, 0x0fff }, - { 0x8900, 0x1e32, 0x2001 }, - { 0x0500, 0x1e31, 0x0fff }, - { 0x0500, 0x1e33, 0x0fff }, - { 0x8900, 0x1e3c, 0x4001 }, - { 0x8900, 0x1e38, 0x3001 }, - { 0x8900, 0x1e36, 0x2001 }, - { 0x0500, 0x1e35, 0x0fff }, - { 0x0500, 0x1e37, 0x0fff }, - { 0x8900, 0x1e3a, 0x2001 }, - { 0x0500, 0x1e39, 0x0fff }, - { 0x0500, 0x1e3b, 0x0fff }, - { 0x8900, 0x1e40, 0x3001 }, - { 0x8900, 0x1e3e, 0x2001 }, - { 0x0500, 0x1e3d, 0x0fff }, - { 0x0500, 0x1e3f, 0x0fff }, - { 0x8900, 0x1e42, 0x2001 }, - { 0x0500, 0x1e41, 0x0fff }, - { 0x0500, 0x1e43, 0x0fff }, - { 0x8900, 0x1e54, 0x5001 }, - { 0x8900, 0x1e4c, 0x4001 }, - { 0x8900, 0x1e48, 0x3001 }, - { 0x8900, 0x1e46, 0x2001 }, - { 0x0500, 0x1e45, 0x0fff }, - { 0x0500, 0x1e47, 0x0fff }, - { 0x8900, 0x1e4a, 0x2001 }, - { 0x0500, 0x1e49, 0x0fff }, - { 0x0500, 0x1e4b, 0x0fff }, - { 0x8900, 0x1e50, 0x3001 }, - { 0x8900, 0x1e4e, 0x2001 }, - { 0x0500, 0x1e4d, 0x0fff }, - { 0x0500, 0x1e4f, 0x0fff }, - { 0x8900, 0x1e52, 0x2001 }, - { 0x0500, 0x1e51, 0x0fff }, - { 0x0500, 0x1e53, 0x0fff }, - { 0x8900, 0x1e5c, 0x4001 }, - { 0x8900, 0x1e58, 0x3001 }, - { 0x8900, 0x1e56, 0x2001 }, - { 0x0500, 0x1e55, 0x0fff }, - { 0x0500, 0x1e57, 0x0fff }, - { 0x8900, 0x1e5a, 0x2001 }, - { 0x0500, 0x1e59, 0x0fff }, - { 0x0500, 0x1e5b, 0x0fff }, - { 0x8900, 0x1e60, 0x3001 }, - { 0x8900, 0x1e5e, 0x2001 }, - { 0x0500, 0x1e5d, 0x0fff }, - { 0x0500, 0x1e5f, 0x0fff }, - { 0x8900, 0x1e62, 0x2001 }, - { 0x0500, 0x1e61, 0x0fff }, - { 0x0500, 0x1e63, 0x0fff }, - { 0x8900, 0x1e84, 0x6001 }, - { 0x8900, 0x1e74, 0x5001 }, - { 0x8900, 0x1e6c, 0x4001 }, - { 0x8900, 0x1e68, 0x3001 }, - { 0x8900, 0x1e66, 0x2001 }, - { 0x0500, 0x1e65, 0x0fff }, - { 0x0500, 0x1e67, 0x0fff }, - { 0x8900, 0x1e6a, 0x2001 }, - { 0x0500, 0x1e69, 0x0fff }, - { 0x0500, 0x1e6b, 0x0fff }, - { 0x8900, 0x1e70, 0x3001 }, - { 0x8900, 0x1e6e, 0x2001 }, - { 0x0500, 0x1e6d, 0x0fff }, - { 0x0500, 0x1e6f, 0x0fff }, - { 0x8900, 0x1e72, 0x2001 }, - { 0x0500, 0x1e71, 0x0fff }, - { 0x0500, 0x1e73, 0x0fff }, - { 0x8900, 0x1e7c, 0x4001 }, - { 0x8900, 0x1e78, 0x3001 }, - { 0x8900, 0x1e76, 0x2001 }, - { 0x0500, 0x1e75, 0x0fff }, - { 0x0500, 0x1e77, 0x0fff }, - { 0x8900, 0x1e7a, 0x2001 }, - { 0x0500, 0x1e79, 0x0fff }, - { 0x0500, 0x1e7b, 0x0fff }, - { 0x8900, 0x1e80, 0x3001 }, - { 0x8900, 0x1e7e, 0x2001 }, - { 0x0500, 0x1e7d, 0x0fff }, - { 0x0500, 0x1e7f, 0x0fff }, - { 0x8900, 0x1e82, 0x2001 }, - { 0x0500, 0x1e81, 0x0fff }, - { 0x0500, 0x1e83, 0x0fff }, - { 0x8900, 0x1e94, 0x5001 }, - { 0x8900, 0x1e8c, 0x4001 }, - { 0x8900, 0x1e88, 0x3001 }, - { 0x8900, 0x1e86, 0x2001 }, - { 0x0500, 0x1e85, 0x0fff }, - { 0x0500, 0x1e87, 0x0fff }, - { 0x8900, 0x1e8a, 0x2001 }, - { 0x0500, 0x1e89, 0x0fff }, - { 0x0500, 0x1e8b, 0x0fff }, - { 0x8900, 0x1e90, 0x3001 }, - { 0x8900, 0x1e8e, 0x2001 }, - { 0x0500, 0x1e8d, 0x0fff }, - { 0x0500, 0x1e8f, 0x0fff }, - { 0x8900, 0x1e92, 0x2001 }, - { 0x0500, 0x1e91, 0x0fff }, - { 0x0500, 0x1e93, 0x0fff }, - { 0x8900, 0x1ea0, 0x4001 }, - { 0x8500, 0x1e98, 0x3000 }, - { 0x8500, 0x1e96, 0x2000 }, - { 0x0500, 0x1e95, 0x0fff }, - { 0x0500, 0x1e97, 0x0000 }, - { 0x8500, 0x1e9a, 0x2000 }, - { 0x0500, 0x1e99, 0x0000 }, - { 0x0500, 0x1e9b, 0x0fc5 }, - { 0x8900, 0x1ea4, 0x3001 }, - { 0x8900, 0x1ea2, 0x2001 }, - { 0x0500, 0x1ea1, 0x0fff }, - { 0x0500, 0x1ea3, 0x0fff }, - { 0x8900, 0x1ea6, 0x2001 }, - { 0x0500, 0x1ea5, 0x0fff }, - { 0x0500, 0x1ea7, 0x0fff }, - { 0x8900, 0x1ee8, 0x7001 }, - { 0x8900, 0x1ec8, 0x6001 }, - { 0x8900, 0x1eb8, 0x5001 }, - { 0x8900, 0x1eb0, 0x4001 }, - { 0x8900, 0x1eac, 0x3001 }, - { 0x8900, 0x1eaa, 0x2001 }, - { 0x0500, 0x1ea9, 0x0fff }, - { 0x0500, 0x1eab, 0x0fff }, - { 0x8900, 0x1eae, 0x2001 }, - { 0x0500, 0x1ead, 0x0fff }, - { 0x0500, 0x1eaf, 0x0fff }, - { 0x8900, 0x1eb4, 0x3001 }, - { 0x8900, 0x1eb2, 0x2001 }, - { 0x0500, 0x1eb1, 0x0fff }, - { 0x0500, 0x1eb3, 0x0fff }, - { 0x8900, 0x1eb6, 0x2001 }, - { 0x0500, 0x1eb5, 0x0fff }, - { 0x0500, 0x1eb7, 0x0fff }, - { 0x8900, 0x1ec0, 0x4001 }, - { 0x8900, 0x1ebc, 0x3001 }, - { 0x8900, 0x1eba, 0x2001 }, - { 0x0500, 0x1eb9, 0x0fff }, - { 0x0500, 0x1ebb, 0x0fff }, - { 0x8900, 0x1ebe, 0x2001 }, - { 0x0500, 0x1ebd, 0x0fff }, - { 0x0500, 0x1ebf, 0x0fff }, - { 0x8900, 0x1ec4, 0x3001 }, - { 0x8900, 0x1ec2, 0x2001 }, - { 0x0500, 0x1ec1, 0x0fff }, - { 0x0500, 0x1ec3, 0x0fff }, - { 0x8900, 0x1ec6, 0x2001 }, - { 0x0500, 0x1ec5, 0x0fff }, - { 0x0500, 0x1ec7, 0x0fff }, - { 0x8900, 0x1ed8, 0x5001 }, - { 0x8900, 0x1ed0, 0x4001 }, - { 0x8900, 0x1ecc, 0x3001 }, - { 0x8900, 0x1eca, 0x2001 }, - { 0x0500, 0x1ec9, 0x0fff }, - { 0x0500, 0x1ecb, 0x0fff }, - { 0x8900, 0x1ece, 0x2001 }, - { 0x0500, 0x1ecd, 0x0fff }, - { 0x0500, 0x1ecf, 0x0fff }, - { 0x8900, 0x1ed4, 0x3001 }, - { 0x8900, 0x1ed2, 0x2001 }, - { 0x0500, 0x1ed1, 0x0fff }, - { 0x0500, 0x1ed3, 0x0fff }, - { 0x8900, 0x1ed6, 0x2001 }, - { 0x0500, 0x1ed5, 0x0fff }, - { 0x0500, 0x1ed7, 0x0fff }, - { 0x8900, 0x1ee0, 0x4001 }, - { 0x8900, 0x1edc, 0x3001 }, - { 0x8900, 0x1eda, 0x2001 }, - { 0x0500, 0x1ed9, 0x0fff }, - { 0x0500, 0x1edb, 0x0fff }, - { 0x8900, 0x1ede, 0x2001 }, - { 0x0500, 0x1edd, 0x0fff }, - { 0x0500, 0x1edf, 0x0fff }, - { 0x8900, 0x1ee4, 0x3001 }, - { 0x8900, 0x1ee2, 0x2001 }, - { 0x0500, 0x1ee1, 0x0fff }, - { 0x0500, 0x1ee3, 0x0fff }, - { 0x8900, 0x1ee6, 0x2001 }, - { 0x0500, 0x1ee5, 0x0fff }, - { 0x0500, 0x1ee7, 0x0fff }, - { 0x8900, 0x1f0e, 0x6ff8 }, - { 0x8900, 0x1ef8, 0x5001 }, - { 0x8900, 0x1ef0, 0x4001 }, - { 0x8900, 0x1eec, 0x3001 }, - { 0x8900, 0x1eea, 0x2001 }, - { 0x0500, 0x1ee9, 0x0fff }, - { 0x0500, 0x1eeb, 0x0fff }, - { 0x8900, 0x1eee, 0x2001 }, - { 0x0500, 0x1eed, 0x0fff }, - { 0x0500, 0x1eef, 0x0fff }, - { 0x8900, 0x1ef4, 0x3001 }, - { 0x8900, 0x1ef2, 0x2001 }, - { 0x0500, 0x1ef1, 0x0fff }, - { 0x0500, 0x1ef3, 0x0fff }, - { 0x8900, 0x1ef6, 0x2001 }, - { 0x0500, 0x1ef5, 0x0fff }, - { 0x0500, 0x1ef7, 0x0fff }, - { 0x8500, 0x1f06, 0x4008 }, - { 0x8500, 0x1f02, 0x3008 }, - { 0x8500, 0x1f00, 0x2008 }, - { 0x0500, 0x1ef9, 0x0fff }, - { 0x0500, 0x1f01, 0x0008 }, - { 0x8500, 0x1f04, 0x2008 }, - { 0x0500, 0x1f03, 0x0008 }, - { 0x0500, 0x1f05, 0x0008 }, - { 0x8900, 0x1f0a, 0x3ff8 }, - { 0x8900, 0x1f08, 0x2ff8 }, - { 0x0500, 0x1f07, 0x0008 }, - { 0x0900, 0x1f09, 0x0ff8 }, - { 0x8900, 0x1f0c, 0x2ff8 }, - { 0x0900, 0x1f0b, 0x0ff8 }, - { 0x0900, 0x1f0d, 0x0ff8 }, - { 0x8500, 0x1f22, 0x5008 }, - { 0x8900, 0x1f18, 0x4ff8 }, - { 0x8500, 0x1f12, 0x3008 }, - { 0x8500, 0x1f10, 0x2008 }, - { 0x0900, 0x1f0f, 0x0ff8 }, - { 0x0500, 0x1f11, 0x0008 }, - { 0x8500, 0x1f14, 0x2008 }, - { 0x0500, 0x1f13, 0x0008 }, - { 0x0500, 0x1f15, 0x0008 }, - { 0x8900, 0x1f1c, 0x3ff8 }, - { 0x8900, 0x1f1a, 0x2ff8 }, - { 0x0900, 0x1f19, 0x0ff8 }, - { 0x0900, 0x1f1b, 0x0ff8 }, - { 0x8500, 0x1f20, 0x2008 }, - { 0x0900, 0x1f1d, 0x0ff8 }, - { 0x0500, 0x1f21, 0x0008 }, - { 0x8900, 0x1f2a, 0x4ff8 }, - { 0x8500, 0x1f26, 0x3008 }, - { 0x8500, 0x1f24, 0x2008 }, - { 0x0500, 0x1f23, 0x0008 }, - { 0x0500, 0x1f25, 0x0008 }, - { 0x8900, 0x1f28, 0x2ff8 }, - { 0x0500, 0x1f27, 0x0008 }, - { 0x0900, 0x1f29, 0x0ff8 }, - { 0x8900, 0x1f2e, 0x3ff8 }, - { 0x8900, 0x1f2c, 0x2ff8 }, - { 0x0900, 0x1f2b, 0x0ff8 }, - { 0x0900, 0x1f2d, 0x0ff8 }, - { 0x8500, 0x1f30, 0x2008 }, - { 0x0900, 0x1f2f, 0x0ff8 }, - { 0x0500, 0x1f31, 0x0008 }, - { 0x9800, 0x1fbd, 0x8000 }, - { 0x8500, 0x1f7a, 0x7070 }, - { 0x8500, 0x1f56, 0x6000 }, - { 0x8500, 0x1f42, 0x5008 }, - { 0x8900, 0x1f3a, 0x4ff8 }, - { 0x8500, 0x1f36, 0x3008 }, - { 0x8500, 0x1f34, 0x2008 }, - { 0x0500, 0x1f33, 0x0008 }, - { 0x0500, 0x1f35, 0x0008 }, - { 0x8900, 0x1f38, 0x2ff8 }, - { 0x0500, 0x1f37, 0x0008 }, - { 0x0900, 0x1f39, 0x0ff8 }, - { 0x8900, 0x1f3e, 0x3ff8 }, - { 0x8900, 0x1f3c, 0x2ff8 }, - { 0x0900, 0x1f3b, 0x0ff8 }, - { 0x0900, 0x1f3d, 0x0ff8 }, - { 0x8500, 0x1f40, 0x2008 }, - { 0x0900, 0x1f3f, 0x0ff8 }, - { 0x0500, 0x1f41, 0x0008 }, - { 0x8900, 0x1f4c, 0x4ff8 }, - { 0x8900, 0x1f48, 0x3ff8 }, - { 0x8500, 0x1f44, 0x2008 }, - { 0x0500, 0x1f43, 0x0008 }, - { 0x0500, 0x1f45, 0x0008 }, - { 0x8900, 0x1f4a, 0x2ff8 }, - { 0x0900, 0x1f49, 0x0ff8 }, - { 0x0900, 0x1f4b, 0x0ff8 }, - { 0x8500, 0x1f52, 0x3000 }, - { 0x8500, 0x1f50, 0x2000 }, - { 0x0900, 0x1f4d, 0x0ff8 }, - { 0x0500, 0x1f51, 0x0008 }, - { 0x8500, 0x1f54, 0x2000 }, - { 0x0500, 0x1f53, 0x0008 }, - { 0x0500, 0x1f55, 0x0008 }, - { 0x8900, 0x1f6a, 0x5ff8 }, - { 0x8500, 0x1f62, 0x4008 }, - { 0x8900, 0x1f5d, 0x3ff8 }, - { 0x8900, 0x1f59, 0x2ff8 }, - { 0x0500, 0x1f57, 0x0008 }, - { 0x0900, 0x1f5b, 0x0ff8 }, - { 0x8500, 0x1f60, 0x2008 }, - { 0x0900, 0x1f5f, 0x0ff8 }, - { 0x0500, 0x1f61, 0x0008 }, - { 0x8500, 0x1f66, 0x3008 }, - { 0x8500, 0x1f64, 0x2008 }, - { 0x0500, 0x1f63, 0x0008 }, - { 0x0500, 0x1f65, 0x0008 }, - { 0x8900, 0x1f68, 0x2ff8 }, - { 0x0500, 0x1f67, 0x0008 }, - { 0x0900, 0x1f69, 0x0ff8 }, - { 0x8500, 0x1f72, 0x4056 }, - { 0x8900, 0x1f6e, 0x3ff8 }, - { 0x8900, 0x1f6c, 0x2ff8 }, - { 0x0900, 0x1f6b, 0x0ff8 }, - { 0x0900, 0x1f6d, 0x0ff8 }, - { 0x8500, 0x1f70, 0x204a }, - { 0x0900, 0x1f6f, 0x0ff8 }, - { 0x0500, 0x1f71, 0x004a }, - { 0x8500, 0x1f76, 0x3064 }, - { 0x8500, 0x1f74, 0x2056 }, - { 0x0500, 0x1f73, 0x0056 }, - { 0x0500, 0x1f75, 0x0056 }, - { 0x8500, 0x1f78, 0x2080 }, - { 0x0500, 0x1f77, 0x0064 }, - { 0x0500, 0x1f79, 0x0080 }, - { 0x8800, 0x1f9c, 0x6000 }, - { 0x8800, 0x1f8c, 0x5000 }, - { 0x8500, 0x1f84, 0x4008 }, - { 0x8500, 0x1f80, 0x3008 }, - { 0x8500, 0x1f7c, 0x207e }, - { 0x0500, 0x1f7b, 0x0070 }, - { 0x0500, 0x1f7d, 0x007e }, - { 0x8500, 0x1f82, 0x2008 }, - { 0x0500, 0x1f81, 0x0008 }, - { 0x0500, 0x1f83, 0x0008 }, - { 0x8800, 0x1f88, 0x3000 }, - { 0x8500, 0x1f86, 0x2008 }, - { 0x0500, 0x1f85, 0x0008 }, - { 0x0500, 0x1f87, 0x0008 }, - { 0x8800, 0x1f8a, 0x2000 }, - { 0x0800, 0x1f89, 0x0000 }, - { 0x0800, 0x1f8b, 0x0000 }, - { 0x8500, 0x1f94, 0x4008 }, - { 0x8500, 0x1f90, 0x3008 }, - { 0x8800, 0x1f8e, 0x2000 }, - { 0x0800, 0x1f8d, 0x0000 }, - { 0x0800, 0x1f8f, 0x0000 }, - { 0x8500, 0x1f92, 0x2008 }, - { 0x0500, 0x1f91, 0x0008 }, - { 0x0500, 0x1f93, 0x0008 }, - { 0x8800, 0x1f98, 0x3000 }, - { 0x8500, 0x1f96, 0x2008 }, - { 0x0500, 0x1f95, 0x0008 }, - { 0x0500, 0x1f97, 0x0008 }, - { 0x8800, 0x1f9a, 0x2000 }, - { 0x0800, 0x1f99, 0x0000 }, - { 0x0800, 0x1f9b, 0x0000 }, - { 0x8800, 0x1fac, 0x5000 }, - { 0x8500, 0x1fa4, 0x4008 }, - { 0x8500, 0x1fa0, 0x3008 }, - { 0x8800, 0x1f9e, 0x2000 }, - { 0x0800, 0x1f9d, 0x0000 }, - { 0x0800, 0x1f9f, 0x0000 }, - { 0x8500, 0x1fa2, 0x2008 }, - { 0x0500, 0x1fa1, 0x0008 }, - { 0x0500, 0x1fa3, 0x0008 }, - { 0x8800, 0x1fa8, 0x3000 }, - { 0x8500, 0x1fa6, 0x2008 }, - { 0x0500, 0x1fa5, 0x0008 }, - { 0x0500, 0x1fa7, 0x0008 }, - { 0x8800, 0x1faa, 0x2000 }, - { 0x0800, 0x1fa9, 0x0000 }, - { 0x0800, 0x1fab, 0x0000 }, - { 0x8500, 0x1fb4, 0x4000 }, - { 0x8500, 0x1fb0, 0x3008 }, - { 0x8800, 0x1fae, 0x2000 }, - { 0x0800, 0x1fad, 0x0000 }, - { 0x0800, 0x1faf, 0x0000 }, - { 0x8500, 0x1fb2, 0x2000 }, - { 0x0500, 0x1fb1, 0x0008 }, - { 0x0500, 0x1fb3, 0x0009 }, - { 0x8900, 0x1fb9, 0x3ff8 }, - { 0x8500, 0x1fb7, 0x2000 }, - { 0x0500, 0x1fb6, 0x0000 }, - { 0x0900, 0x1fb8, 0x0ff8 }, - { 0x8900, 0x1fbb, 0x2fb6 }, - { 0x0900, 0x1fba, 0x0fb6 }, - { 0x0800, 0x1fbc, 0x0000 }, - { 0x9d00, 0x2005, 0x7000 }, - { 0x8500, 0x1fe1, 0x6008 }, - { 0x9800, 0x1fce, 0x5000 }, - { 0x8500, 0x1fc6, 0x4000 }, - { 0x9800, 0x1fc1, 0x3000 }, - { 0x9800, 0x1fbf, 0x2000 }, - { 0x0500, 0x1fbe, 0x0000 }, - { 0x1800, 0x1fc0, 0x0000 }, - { 0x8500, 0x1fc3, 0x2009 }, - { 0x0500, 0x1fc2, 0x0000 }, - { 0x0500, 0x1fc4, 0x0000 }, - { 0x8900, 0x1fca, 0x3faa }, - { 0x8900, 0x1fc8, 0x2faa }, - { 0x0500, 0x1fc7, 0x0000 }, - { 0x0900, 0x1fc9, 0x0faa }, - { 0x8800, 0x1fcc, 0x2000 }, - { 0x0900, 0x1fcb, 0x0faa }, - { 0x1800, 0x1fcd, 0x0000 }, - { 0x8900, 0x1fd8, 0x4ff8 }, - { 0x8500, 0x1fd2, 0x3000 }, - { 0x8500, 0x1fd0, 0x2008 }, - { 0x1800, 0x1fcf, 0x0000 }, - { 0x0500, 0x1fd1, 0x0008 }, - { 0x8500, 0x1fd6, 0x2000 }, - { 0x0500, 0x1fd3, 0x0000 }, - { 0x0500, 0x1fd7, 0x0000 }, - { 0x9800, 0x1fdd, 0x3000 }, - { 0x8900, 0x1fda, 0x2f9c }, - { 0x0900, 0x1fd9, 0x0ff8 }, - { 0x0900, 0x1fdb, 0x0f9c }, - { 0x9800, 0x1fdf, 0x2000 }, - { 0x1800, 0x1fde, 0x0000 }, - { 0x0500, 0x1fe0, 0x0008 }, - { 0x8500, 0x1ff3, 0x5009 }, - { 0x8900, 0x1fe9, 0x4ff8 }, - { 0x8500, 0x1fe5, 0x3007 }, - { 0x8500, 0x1fe3, 0x2000 }, - { 0x0500, 0x1fe2, 0x0000 }, - { 0x0500, 0x1fe4, 0x0000 }, - { 0x8500, 0x1fe7, 0x2000 }, - { 0x0500, 0x1fe6, 0x0000 }, - { 0x0900, 0x1fe8, 0x0ff8 }, - { 0x9800, 0x1fed, 0x3000 }, - { 0x8900, 0x1feb, 0x2f90 }, - { 0x0900, 0x1fea, 0x0f90 }, - { 0x0900, 0x1fec, 0x0ff9 }, - { 0x9800, 0x1fef, 0x2000 }, - { 0x1800, 0x1fee, 0x0000 }, - { 0x0500, 0x1ff2, 0x0000 }, - { 0x8800, 0x1ffc, 0x4000 }, - { 0x8900, 0x1ff8, 0x3f80 }, - { 0x8500, 0x1ff6, 0x2000 }, - { 0x0500, 0x1ff4, 0x0000 }, - { 0x0500, 0x1ff7, 0x0000 }, - { 0x8900, 0x1ffa, 0x2f82 }, - { 0x0900, 0x1ff9, 0x0f80 }, - { 0x0900, 0x1ffb, 0x0f82 }, - { 0x9d00, 0x2001, 0x3000 }, - { 0x9800, 0x1ffe, 0x2000 }, - { 0x1800, 0x1ffd, 0x0000 }, - { 0x1d00, 0x2000, 0x0000 }, - { 0x9d00, 0x2003, 0x2000 }, - { 0x1d00, 0x2002, 0x0000 }, - { 0x1d00, 0x2004, 0x0000 }, - { 0x9500, 0x2025, 0x6000 }, - { 0x9100, 0x2015, 0x5000 }, - { 0x8100, 0x200d, 0x4000 }, - { 0x9d00, 0x2009, 0x3000 }, - { 0x9d00, 0x2007, 0x2000 }, - { 0x1d00, 0x2006, 0x0000 }, - { 0x1d00, 0x2008, 0x0000 }, - { 0x9d00, 0x200b, 0x2000 }, - { 0x1d00, 0x200a, 0x0000 }, - { 0x0100, 0x200c, 0x0000 }, - { 0x9100, 0x2011, 0x3000 }, - { 0x8100, 0x200f, 0x2000 }, - { 0x0100, 0x200e, 0x0000 }, - { 0x1100, 0x2010, 0x0000 }, - { 0x9100, 0x2013, 0x2000 }, - { 0x1100, 0x2012, 0x0000 }, - { 0x1100, 0x2014, 0x0000 }, - { 0x9300, 0x201d, 0x4000 }, - { 0x9300, 0x2019, 0x3000 }, - { 0x9500, 0x2017, 0x2000 }, - { 0x1500, 0x2016, 0x0000 }, - { 0x1400, 0x2018, 0x0000 }, - { 0x9400, 0x201b, 0x2000 }, - { 0x1600, 0x201a, 0x0000 }, - { 0x1400, 0x201c, 0x0000 }, - { 0x9500, 0x2021, 0x3000 }, - { 0x9400, 0x201f, 0x2000 }, - { 0x1600, 0x201e, 0x0000 }, - { 0x1500, 0x2020, 0x0000 }, - { 0x9500, 0x2023, 0x2000 }, - { 0x1500, 0x2022, 0x0000 }, - { 0x1500, 0x2024, 0x0000 }, - { 0x9500, 0x2035, 0x5000 }, - { 0x8100, 0x202d, 0x4000 }, - { 0x9c00, 0x2029, 0x3000 }, - { 0x9500, 0x2027, 0x2000 }, - { 0x1500, 0x2026, 0x0000 }, - { 0x1b00, 0x2028, 0x0000 }, - { 0x8100, 0x202b, 0x2000 }, - { 0x0100, 0x202a, 0x0000 }, - { 0x0100, 0x202c, 0x0000 }, - { 0x9500, 0x2031, 0x3000 }, - { 0x9d00, 0x202f, 0x2000 }, - { 0x0100, 0x202e, 0x0000 }, - { 0x1500, 0x2030, 0x0000 }, - { 0x9500, 0x2033, 0x2000 }, - { 0x1500, 0x2032, 0x0000 }, - { 0x1500, 0x2034, 0x0000 }, - { 0x9500, 0x203d, 0x4000 }, - { 0x9400, 0x2039, 0x3000 }, - { 0x9500, 0x2037, 0x2000 }, - { 0x1500, 0x2036, 0x0000 }, - { 0x1500, 0x2038, 0x0000 }, - { 0x9500, 0x203b, 0x2000 }, - { 0x1300, 0x203a, 0x0000 }, - { 0x1500, 0x203c, 0x0000 }, - { 0x9500, 0x2041, 0x3000 }, - { 0x9000, 0x203f, 0x2000 }, - { 0x1500, 0x203e, 0x0000 }, - { 0x1000, 0x2040, 0x0000 }, - { 0x9500, 0x2043, 0x2000 }, - { 0x1500, 0x2042, 0x0000 }, - { 0x1900, 0x2044, 0x0000 }, - { 0x9900, 0x21ae, 0x9000 }, - { 0x8900, 0x211a, 0x8000 }, - { 0x9700, 0x20a7, 0x7000 }, - { 0x8f00, 0x2076, 0x6000 }, - { 0x9500, 0x2057, 0x5000 }, - { 0x9500, 0x204d, 0x4000 }, - { 0x9500, 0x2049, 0x3000 }, - { 0x9500, 0x2047, 0x2000 }, - { 0x1200, 0x2046, 0x0000 }, - { 0x1500, 0x2048, 0x0000 }, - { 0x9500, 0x204b, 0x2000 }, - { 0x1500, 0x204a, 0x0000 }, - { 0x1500, 0x204c, 0x0000 }, - { 0x9500, 0x2051, 0x3000 }, - { 0x9500, 0x204f, 0x2000 }, - { 0x1500, 0x204e, 0x0000 }, - { 0x1500, 0x2050, 0x0000 }, - { 0x9500, 0x2053, 0x2000 }, - { 0x1900, 0x2052, 0x0000 }, - { 0x1000, 0x2054, 0x0000 }, - { 0x8100, 0x206c, 0x4000 }, - { 0x8100, 0x2062, 0x3000 }, - { 0x8100, 0x2060, 0x2000 }, - { 0x1d00, 0x205f, 0x0000 }, - { 0x0100, 0x2061, 0x0000 }, - { 0x8100, 0x206a, 0x2000 }, - { 0x0100, 0x2063, 0x0000 }, - { 0x0100, 0x206b, 0x0000 }, - { 0x8f00, 0x2070, 0x3000 }, - { 0x8100, 0x206e, 0x2000 }, - { 0x0100, 0x206d, 0x0000 }, - { 0x0100, 0x206f, 0x0000 }, - { 0x8f00, 0x2074, 0x2000 }, - { 0x0500, 0x2071, 0x0000 }, - { 0x0f00, 0x2075, 0x0000 }, - { 0x8f00, 0x2086, 0x5000 }, - { 0x9200, 0x207e, 0x4000 }, - { 0x9900, 0x207a, 0x3000 }, - { 0x8f00, 0x2078, 0x2000 }, - { 0x0f00, 0x2077, 0x0000 }, - { 0x0f00, 0x2079, 0x0000 }, - { 0x9900, 0x207c, 0x2000 }, - { 0x1900, 0x207b, 0x0000 }, - { 0x1600, 0x207d, 0x0000 }, - { 0x8f00, 0x2082, 0x3000 }, - { 0x8f00, 0x2080, 0x2000 }, - { 0x0500, 0x207f, 0x0000 }, - { 0x0f00, 0x2081, 0x0000 }, - { 0x8f00, 0x2084, 0x2000 }, - { 0x0f00, 0x2083, 0x0000 }, - { 0x0f00, 0x2085, 0x0000 }, - { 0x9200, 0x208e, 0x4000 }, - { 0x9900, 0x208a, 0x3000 }, - { 0x8f00, 0x2088, 0x2000 }, - { 0x0f00, 0x2087, 0x0000 }, - { 0x0f00, 0x2089, 0x0000 }, - { 0x9900, 0x208c, 0x2000 }, - { 0x1900, 0x208b, 0x0000 }, - { 0x1600, 0x208d, 0x0000 }, - { 0x9700, 0x20a3, 0x3000 }, - { 0x9700, 0x20a1, 0x2000 }, - { 0x1700, 0x20a0, 0x0000 }, - { 0x1700, 0x20a2, 0x0000 }, - { 0x9700, 0x20a5, 0x2000 }, - { 0x1700, 0x20a4, 0x0000 }, - { 0x1700, 0x20a6, 0x0000 }, - { 0x8c00, 0x20e5, 0x6000 }, - { 0x8c00, 0x20d5, 0x5000 }, - { 0x9700, 0x20af, 0x4000 }, - { 0x9700, 0x20ab, 0x3000 }, - { 0x9700, 0x20a9, 0x2000 }, - { 0x1700, 0x20a8, 0x0000 }, - { 0x1700, 0x20aa, 0x0000 }, - { 0x9700, 0x20ad, 0x2000 }, - { 0x1700, 0x20ac, 0x0000 }, - { 0x1700, 0x20ae, 0x0000 }, - { 0x8c00, 0x20d1, 0x3000 }, - { 0x9700, 0x20b1, 0x2000 }, - { 0x1700, 0x20b0, 0x0000 }, - { 0x0c00, 0x20d0, 0x0000 }, - { 0x8c00, 0x20d3, 0x2000 }, - { 0x0c00, 0x20d2, 0x0000 }, - { 0x0c00, 0x20d4, 0x0000 }, - { 0x8b00, 0x20dd, 0x4000 }, - { 0x8c00, 0x20d9, 0x3000 }, - { 0x8c00, 0x20d7, 0x2000 }, - { 0x0c00, 0x20d6, 0x0000 }, - { 0x0c00, 0x20d8, 0x0000 }, - { 0x8c00, 0x20db, 0x2000 }, - { 0x0c00, 0x20da, 0x0000 }, - { 0x0c00, 0x20dc, 0x0000 }, - { 0x8c00, 0x20e1, 0x3000 }, - { 0x8b00, 0x20df, 0x2000 }, - { 0x0b00, 0x20de, 0x0000 }, - { 0x0b00, 0x20e0, 0x0000 }, - { 0x8b00, 0x20e3, 0x2000 }, - { 0x0b00, 0x20e2, 0x0000 }, - { 0x0b00, 0x20e4, 0x0000 }, - { 0x8500, 0x210a, 0x5000 }, - { 0x8900, 0x2102, 0x4000 }, - { 0x8c00, 0x20e9, 0x3000 }, - { 0x8c00, 0x20e7, 0x2000 }, - { 0x0c00, 0x20e6, 0x0000 }, - { 0x0c00, 0x20e8, 0x0000 }, - { 0x9a00, 0x2100, 0x2000 }, - { 0x0c00, 0x20ea, 0x0000 }, - { 0x1a00, 0x2101, 0x0000 }, - { 0x9a00, 0x2106, 0x3000 }, - { 0x9a00, 0x2104, 0x2000 }, - { 0x1a00, 0x2103, 0x0000 }, - { 0x1a00, 0x2105, 0x0000 }, - { 0x9a00, 0x2108, 0x2000 }, - { 0x0900, 0x2107, 0x0000 }, - { 0x1a00, 0x2109, 0x0000 }, - { 0x8900, 0x2112, 0x4000 }, - { 0x8500, 0x210e, 0x3000 }, - { 0x8900, 0x210c, 0x2000 }, - { 0x0900, 0x210b, 0x0000 }, - { 0x0900, 0x210d, 0x0000 }, - { 0x8900, 0x2110, 0x2000 }, - { 0x0500, 0x210f, 0x0000 }, - { 0x0900, 0x2111, 0x0000 }, - { 0x9a00, 0x2116, 0x3000 }, - { 0x9a00, 0x2114, 0x2000 }, - { 0x0500, 0x2113, 0x0000 }, - { 0x0900, 0x2115, 0x0000 }, - { 0x9a00, 0x2118, 0x2000 }, - { 0x1a00, 0x2117, 0x0000 }, - { 0x0900, 0x2119, 0x0000 }, - { 0x8e00, 0x2162, 0x7000 }, - { 0x9a00, 0x213a, 0x6000 }, - { 0x8900, 0x212a, 0x5000 }, - { 0x9a00, 0x2122, 0x4000 }, - { 0x9a00, 0x211e, 0x3000 }, - { 0x8900, 0x211c, 0x2000 }, - { 0x0900, 0x211b, 0x0000 }, - { 0x0900, 0x211d, 0x0000 }, - { 0x9a00, 0x2120, 0x2000 }, - { 0x1a00, 0x211f, 0x0000 }, - { 0x1a00, 0x2121, 0x0000 }, - { 0x8900, 0x2126, 0x3000 }, - { 0x8900, 0x2124, 0x2000 }, - { 0x1a00, 0x2123, 0x0000 }, - { 0x1a00, 0x2125, 0x0000 }, - { 0x8900, 0x2128, 0x2000 }, - { 0x1a00, 0x2127, 0x0000 }, - { 0x1a00, 0x2129, 0x0000 }, - { 0x9a00, 0x2132, 0x4000 }, - { 0x9a00, 0x212e, 0x3000 }, - { 0x8900, 0x212c, 0x2000 }, - { 0x0900, 0x212b, 0x0000 }, - { 0x0900, 0x212d, 0x0000 }, - { 0x8900, 0x2130, 0x2000 }, - { 0x0500, 0x212f, 0x0000 }, - { 0x0900, 0x2131, 0x0000 }, - { 0x8700, 0x2136, 0x3000 }, - { 0x8500, 0x2134, 0x2000 }, - { 0x0900, 0x2133, 0x0000 }, - { 0x0700, 0x2135, 0x0000 }, - { 0x8700, 0x2138, 0x2000 }, - { 0x0700, 0x2137, 0x0000 }, - { 0x0500, 0x2139, 0x0000 }, - { 0x9900, 0x214b, 0x5000 }, - { 0x9900, 0x2143, 0x4000 }, - { 0x8900, 0x213f, 0x3000 }, - { 0x8500, 0x213d, 0x2000 }, - { 0x1a00, 0x213b, 0x0000 }, - { 0x0900, 0x213e, 0x0000 }, - { 0x9900, 0x2141, 0x2000 }, - { 0x1900, 0x2140, 0x0000 }, - { 0x1900, 0x2142, 0x0000 }, - { 0x8500, 0x2147, 0x3000 }, - { 0x8900, 0x2145, 0x2000 }, - { 0x1900, 0x2144, 0x0000 }, - { 0x0500, 0x2146, 0x0000 }, - { 0x8500, 0x2149, 0x2000 }, - { 0x0500, 0x2148, 0x0000 }, - { 0x1a00, 0x214a, 0x0000 }, - { 0x8f00, 0x215a, 0x4000 }, - { 0x8f00, 0x2156, 0x3000 }, - { 0x8f00, 0x2154, 0x2000 }, - { 0x0f00, 0x2153, 0x0000 }, - { 0x0f00, 0x2155, 0x0000 }, - { 0x8f00, 0x2158, 0x2000 }, - { 0x0f00, 0x2157, 0x0000 }, - { 0x0f00, 0x2159, 0x0000 }, - { 0x8f00, 0x215e, 0x3000 }, - { 0x8f00, 0x215c, 0x2000 }, - { 0x0f00, 0x215b, 0x0000 }, - { 0x0f00, 0x215d, 0x0000 }, - { 0x8e00, 0x2160, 0x2000 }, - { 0x0f00, 0x215f, 0x0000 }, - { 0x0e00, 0x2161, 0x0000 }, - { 0x8e00, 0x2182, 0x6000 }, - { 0x8e00, 0x2172, 0x5000 }, - { 0x8e00, 0x216a, 0x4000 }, - { 0x8e00, 0x2166, 0x3000 }, - { 0x8e00, 0x2164, 0x2000 }, - { 0x0e00, 0x2163, 0x0000 }, - { 0x0e00, 0x2165, 0x0000 }, - { 0x8e00, 0x2168, 0x2000 }, - { 0x0e00, 0x2167, 0x0000 }, - { 0x0e00, 0x2169, 0x0000 }, - { 0x8e00, 0x216e, 0x3000 }, - { 0x8e00, 0x216c, 0x2000 }, - { 0x0e00, 0x216b, 0x0000 }, - { 0x0e00, 0x216d, 0x0000 }, - { 0x8e00, 0x2170, 0x2000 }, - { 0x0e00, 0x216f, 0x0000 }, - { 0x0e00, 0x2171, 0x0000 }, - { 0x8e00, 0x217a, 0x4000 }, - { 0x8e00, 0x2176, 0x3000 }, - { 0x8e00, 0x2174, 0x2000 }, - { 0x0e00, 0x2173, 0x0000 }, - { 0x0e00, 0x2175, 0x0000 }, - { 0x8e00, 0x2178, 0x2000 }, - { 0x0e00, 0x2177, 0x0000 }, - { 0x0e00, 0x2179, 0x0000 }, - { 0x8e00, 0x217e, 0x3000 }, - { 0x8e00, 0x217c, 0x2000 }, - { 0x0e00, 0x217b, 0x0000 }, - { 0x0e00, 0x217d, 0x0000 }, - { 0x8e00, 0x2180, 0x2000 }, - { 0x0e00, 0x217f, 0x0000 }, - { 0x0e00, 0x2181, 0x0000 }, - { 0x9a00, 0x219e, 0x5000 }, - { 0x9a00, 0x2196, 0x4000 }, - { 0x9900, 0x2192, 0x3000 }, - { 0x9900, 0x2190, 0x2000 }, - { 0x0e00, 0x2183, 0x0000 }, - { 0x1900, 0x2191, 0x0000 }, - { 0x9900, 0x2194, 0x2000 }, - { 0x1900, 0x2193, 0x0000 }, - { 0x1a00, 0x2195, 0x0000 }, - { 0x9900, 0x219a, 0x3000 }, - { 0x9a00, 0x2198, 0x2000 }, - { 0x1a00, 0x2197, 0x0000 }, - { 0x1a00, 0x2199, 0x0000 }, - { 0x9a00, 0x219c, 0x2000 }, - { 0x1900, 0x219b, 0x0000 }, - { 0x1a00, 0x219d, 0x0000 }, - { 0x9900, 0x21a6, 0x4000 }, - { 0x9a00, 0x21a2, 0x3000 }, - { 0x9900, 0x21a0, 0x2000 }, - { 0x1a00, 0x219f, 0x0000 }, - { 0x1a00, 0x21a1, 0x0000 }, - { 0x9a00, 0x21a4, 0x2000 }, - { 0x1900, 0x21a3, 0x0000 }, - { 0x1a00, 0x21a5, 0x0000 }, - { 0x9a00, 0x21aa, 0x3000 }, - { 0x9a00, 0x21a8, 0x2000 }, - { 0x1a00, 0x21a7, 0x0000 }, - { 0x1a00, 0x21a9, 0x0000 }, - { 0x9a00, 0x21ac, 0x2000 }, - { 0x1a00, 0x21ab, 0x0000 }, - { 0x1a00, 0x21ad, 0x0000 }, - { 0x9900, 0x222e, 0x8000 }, - { 0x9a00, 0x21ee, 0x7000 }, - { 0x9900, 0x21ce, 0x6000 }, - { 0x9a00, 0x21be, 0x5000 }, - { 0x9a00, 0x21b6, 0x4000 }, - { 0x9a00, 0x21b2, 0x3000 }, - { 0x9a00, 0x21b0, 0x2000 }, - { 0x1a00, 0x21af, 0x0000 }, - { 0x1a00, 0x21b1, 0x0000 }, - { 0x9a00, 0x21b4, 0x2000 }, - { 0x1a00, 0x21b3, 0x0000 }, - { 0x1a00, 0x21b5, 0x0000 }, - { 0x9a00, 0x21ba, 0x3000 }, - { 0x9a00, 0x21b8, 0x2000 }, - { 0x1a00, 0x21b7, 0x0000 }, - { 0x1a00, 0x21b9, 0x0000 }, - { 0x9a00, 0x21bc, 0x2000 }, - { 0x1a00, 0x21bb, 0x0000 }, - { 0x1a00, 0x21bd, 0x0000 }, - { 0x9a00, 0x21c6, 0x4000 }, - { 0x9a00, 0x21c2, 0x3000 }, - { 0x9a00, 0x21c0, 0x2000 }, - { 0x1a00, 0x21bf, 0x0000 }, - { 0x1a00, 0x21c1, 0x0000 }, - { 0x9a00, 0x21c4, 0x2000 }, - { 0x1a00, 0x21c3, 0x0000 }, - { 0x1a00, 0x21c5, 0x0000 }, - { 0x9a00, 0x21ca, 0x3000 }, - { 0x9a00, 0x21c8, 0x2000 }, - { 0x1a00, 0x21c7, 0x0000 }, - { 0x1a00, 0x21c9, 0x0000 }, - { 0x9a00, 0x21cc, 0x2000 }, - { 0x1a00, 0x21cb, 0x0000 }, - { 0x1a00, 0x21cd, 0x0000 }, - { 0x9a00, 0x21de, 0x5000 }, - { 0x9a00, 0x21d6, 0x4000 }, - { 0x9900, 0x21d2, 0x3000 }, - { 0x9a00, 0x21d0, 0x2000 }, - { 0x1900, 0x21cf, 0x0000 }, - { 0x1a00, 0x21d1, 0x0000 }, - { 0x9900, 0x21d4, 0x2000 }, - { 0x1a00, 0x21d3, 0x0000 }, - { 0x1a00, 0x21d5, 0x0000 }, - { 0x9a00, 0x21da, 0x3000 }, - { 0x9a00, 0x21d8, 0x2000 }, - { 0x1a00, 0x21d7, 0x0000 }, - { 0x1a00, 0x21d9, 0x0000 }, - { 0x9a00, 0x21dc, 0x2000 }, - { 0x1a00, 0x21db, 0x0000 }, - { 0x1a00, 0x21dd, 0x0000 }, - { 0x9a00, 0x21e6, 0x4000 }, - { 0x9a00, 0x21e2, 0x3000 }, - { 0x9a00, 0x21e0, 0x2000 }, - { 0x1a00, 0x21df, 0x0000 }, - { 0x1a00, 0x21e1, 0x0000 }, - { 0x9a00, 0x21e4, 0x2000 }, - { 0x1a00, 0x21e3, 0x0000 }, - { 0x1a00, 0x21e5, 0x0000 }, - { 0x9a00, 0x21ea, 0x3000 }, - { 0x9a00, 0x21e8, 0x2000 }, - { 0x1a00, 0x21e7, 0x0000 }, - { 0x1a00, 0x21e9, 0x0000 }, - { 0x9a00, 0x21ec, 0x2000 }, - { 0x1a00, 0x21eb, 0x0000 }, - { 0x1a00, 0x21ed, 0x0000 }, - { 0x9900, 0x220e, 0x6000 }, - { 0x9900, 0x21fe, 0x5000 }, - { 0x9900, 0x21f6, 0x4000 }, - { 0x9a00, 0x21f2, 0x3000 }, - { 0x9a00, 0x21f0, 0x2000 }, - { 0x1a00, 0x21ef, 0x0000 }, - { 0x1a00, 0x21f1, 0x0000 }, - { 0x9900, 0x21f4, 0x2000 }, - { 0x1a00, 0x21f3, 0x0000 }, - { 0x1900, 0x21f5, 0x0000 }, - { 0x9900, 0x21fa, 0x3000 }, - { 0x9900, 0x21f8, 0x2000 }, - { 0x1900, 0x21f7, 0x0000 }, - { 0x1900, 0x21f9, 0x0000 }, - { 0x9900, 0x21fc, 0x2000 }, - { 0x1900, 0x21fb, 0x0000 }, - { 0x1900, 0x21fd, 0x0000 }, - { 0x9900, 0x2206, 0x4000 }, - { 0x9900, 0x2202, 0x3000 }, - { 0x9900, 0x2200, 0x2000 }, - { 0x1900, 0x21ff, 0x0000 }, - { 0x1900, 0x2201, 0x0000 }, - { 0x9900, 0x2204, 0x2000 }, - { 0x1900, 0x2203, 0x0000 }, - { 0x1900, 0x2205, 0x0000 }, - { 0x9900, 0x220a, 0x3000 }, - { 0x9900, 0x2208, 0x2000 }, - { 0x1900, 0x2207, 0x0000 }, - { 0x1900, 0x2209, 0x0000 }, - { 0x9900, 0x220c, 0x2000 }, - { 0x1900, 0x220b, 0x0000 }, - { 0x1900, 0x220d, 0x0000 }, - { 0x9900, 0x221e, 0x5000 }, - { 0x9900, 0x2216, 0x4000 }, - { 0x9900, 0x2212, 0x3000 }, - { 0x9900, 0x2210, 0x2000 }, - { 0x1900, 0x220f, 0x0000 }, - { 0x1900, 0x2211, 0x0000 }, - { 0x9900, 0x2214, 0x2000 }, - { 0x1900, 0x2213, 0x0000 }, - { 0x1900, 0x2215, 0x0000 }, - { 0x9900, 0x221a, 0x3000 }, - { 0x9900, 0x2218, 0x2000 }, - { 0x1900, 0x2217, 0x0000 }, - { 0x1900, 0x2219, 0x0000 }, - { 0x9900, 0x221c, 0x2000 }, - { 0x1900, 0x221b, 0x0000 }, - { 0x1900, 0x221d, 0x0000 }, - { 0x9900, 0x2226, 0x4000 }, - { 0x9900, 0x2222, 0x3000 }, - { 0x9900, 0x2220, 0x2000 }, - { 0x1900, 0x221f, 0x0000 }, - { 0x1900, 0x2221, 0x0000 }, - { 0x9900, 0x2224, 0x2000 }, - { 0x1900, 0x2223, 0x0000 }, - { 0x1900, 0x2225, 0x0000 }, - { 0x9900, 0x222a, 0x3000 }, - { 0x9900, 0x2228, 0x2000 }, - { 0x1900, 0x2227, 0x0000 }, - { 0x1900, 0x2229, 0x0000 }, - { 0x9900, 0x222c, 0x2000 }, - { 0x1900, 0x222b, 0x0000 }, - { 0x1900, 0x222d, 0x0000 }, - { 0x9900, 0x226e, 0x7000 }, - { 0x9900, 0x224e, 0x6000 }, - { 0x9900, 0x223e, 0x5000 }, - { 0x9900, 0x2236, 0x4000 }, - { 0x9900, 0x2232, 0x3000 }, - { 0x9900, 0x2230, 0x2000 }, - { 0x1900, 0x222f, 0x0000 }, - { 0x1900, 0x2231, 0x0000 }, - { 0x9900, 0x2234, 0x2000 }, - { 0x1900, 0x2233, 0x0000 }, - { 0x1900, 0x2235, 0x0000 }, - { 0x9900, 0x223a, 0x3000 }, - { 0x9900, 0x2238, 0x2000 }, - { 0x1900, 0x2237, 0x0000 }, - { 0x1900, 0x2239, 0x0000 }, - { 0x9900, 0x223c, 0x2000 }, - { 0x1900, 0x223b, 0x0000 }, - { 0x1900, 0x223d, 0x0000 }, - { 0x9900, 0x2246, 0x4000 }, - { 0x9900, 0x2242, 0x3000 }, - { 0x9900, 0x2240, 0x2000 }, - { 0x1900, 0x223f, 0x0000 }, - { 0x1900, 0x2241, 0x0000 }, - { 0x9900, 0x2244, 0x2000 }, - { 0x1900, 0x2243, 0x0000 }, - { 0x1900, 0x2245, 0x0000 }, - { 0x9900, 0x224a, 0x3000 }, - { 0x9900, 0x2248, 0x2000 }, - { 0x1900, 0x2247, 0x0000 }, - { 0x1900, 0x2249, 0x0000 }, - { 0x9900, 0x224c, 0x2000 }, - { 0x1900, 0x224b, 0x0000 }, - { 0x1900, 0x224d, 0x0000 }, - { 0x9900, 0x225e, 0x5000 }, - { 0x9900, 0x2256, 0x4000 }, - { 0x9900, 0x2252, 0x3000 }, - { 0x9900, 0x2250, 0x2000 }, - { 0x1900, 0x224f, 0x0000 }, - { 0x1900, 0x2251, 0x0000 }, - { 0x9900, 0x2254, 0x2000 }, - { 0x1900, 0x2253, 0x0000 }, - { 0x1900, 0x2255, 0x0000 }, - { 0x9900, 0x225a, 0x3000 }, - { 0x9900, 0x2258, 0x2000 }, - { 0x1900, 0x2257, 0x0000 }, - { 0x1900, 0x2259, 0x0000 }, - { 0x9900, 0x225c, 0x2000 }, - { 0x1900, 0x225b, 0x0000 }, - { 0x1900, 0x225d, 0x0000 }, - { 0x9900, 0x2266, 0x4000 }, - { 0x9900, 0x2262, 0x3000 }, - { 0x9900, 0x2260, 0x2000 }, - { 0x1900, 0x225f, 0x0000 }, - { 0x1900, 0x2261, 0x0000 }, - { 0x9900, 0x2264, 0x2000 }, - { 0x1900, 0x2263, 0x0000 }, - { 0x1900, 0x2265, 0x0000 }, - { 0x9900, 0x226a, 0x3000 }, - { 0x9900, 0x2268, 0x2000 }, - { 0x1900, 0x2267, 0x0000 }, - { 0x1900, 0x2269, 0x0000 }, - { 0x9900, 0x226c, 0x2000 }, - { 0x1900, 0x226b, 0x0000 }, - { 0x1900, 0x226d, 0x0000 }, - { 0x9900, 0x228e, 0x6000 }, - { 0x9900, 0x227e, 0x5000 }, - { 0x9900, 0x2276, 0x4000 }, - { 0x9900, 0x2272, 0x3000 }, - { 0x9900, 0x2270, 0x2000 }, - { 0x1900, 0x226f, 0x0000 }, - { 0x1900, 0x2271, 0x0000 }, - { 0x9900, 0x2274, 0x2000 }, - { 0x1900, 0x2273, 0x0000 }, - { 0x1900, 0x2275, 0x0000 }, - { 0x9900, 0x227a, 0x3000 }, - { 0x9900, 0x2278, 0x2000 }, - { 0x1900, 0x2277, 0x0000 }, - { 0x1900, 0x2279, 0x0000 }, - { 0x9900, 0x227c, 0x2000 }, - { 0x1900, 0x227b, 0x0000 }, - { 0x1900, 0x227d, 0x0000 }, - { 0x9900, 0x2286, 0x4000 }, - { 0x9900, 0x2282, 0x3000 }, - { 0x9900, 0x2280, 0x2000 }, - { 0x1900, 0x227f, 0x0000 }, - { 0x1900, 0x2281, 0x0000 }, - { 0x9900, 0x2284, 0x2000 }, - { 0x1900, 0x2283, 0x0000 }, - { 0x1900, 0x2285, 0x0000 }, - { 0x9900, 0x228a, 0x3000 }, - { 0x9900, 0x2288, 0x2000 }, - { 0x1900, 0x2287, 0x0000 }, - { 0x1900, 0x2289, 0x0000 }, - { 0x9900, 0x228c, 0x2000 }, - { 0x1900, 0x228b, 0x0000 }, - { 0x1900, 0x228d, 0x0000 }, - { 0x9900, 0x229e, 0x5000 }, - { 0x9900, 0x2296, 0x4000 }, - { 0x9900, 0x2292, 0x3000 }, - { 0x9900, 0x2290, 0x2000 }, - { 0x1900, 0x228f, 0x0000 }, - { 0x1900, 0x2291, 0x0000 }, - { 0x9900, 0x2294, 0x2000 }, - { 0x1900, 0x2293, 0x0000 }, - { 0x1900, 0x2295, 0x0000 }, - { 0x9900, 0x229a, 0x3000 }, - { 0x9900, 0x2298, 0x2000 }, - { 0x1900, 0x2297, 0x0000 }, - { 0x1900, 0x2299, 0x0000 }, - { 0x9900, 0x229c, 0x2000 }, - { 0x1900, 0x229b, 0x0000 }, - { 0x1900, 0x229d, 0x0000 }, - { 0x9900, 0x22a6, 0x4000 }, - { 0x9900, 0x22a2, 0x3000 }, - { 0x9900, 0x22a0, 0x2000 }, - { 0x1900, 0x229f, 0x0000 }, - { 0x1900, 0x22a1, 0x0000 }, - { 0x9900, 0x22a4, 0x2000 }, - { 0x1900, 0x22a3, 0x0000 }, - { 0x1900, 0x22a5, 0x0000 }, - { 0x9900, 0x22aa, 0x3000 }, - { 0x9900, 0x22a8, 0x2000 }, - { 0x1900, 0x22a7, 0x0000 }, - { 0x1900, 0x22a9, 0x0000 }, - { 0x9900, 0x22ac, 0x2000 }, - { 0x1900, 0x22ab, 0x0000 }, - { 0x1900, 0x22ad, 0x0000 }, - { 0x8f00, 0x2787, 0xb000 }, - { 0x9a00, 0x250b, 0xa000 }, - { 0x9900, 0x23ae, 0x9000 }, - { 0x9a00, 0x232e, 0x8000 }, - { 0x9900, 0x22ee, 0x7000 }, - { 0x9900, 0x22ce, 0x6000 }, - { 0x9900, 0x22be, 0x5000 }, - { 0x9900, 0x22b6, 0x4000 }, - { 0x9900, 0x22b2, 0x3000 }, - { 0x9900, 0x22b0, 0x2000 }, - { 0x1900, 0x22af, 0x0000 }, - { 0x1900, 0x22b1, 0x0000 }, - { 0x9900, 0x22b4, 0x2000 }, - { 0x1900, 0x22b3, 0x0000 }, - { 0x1900, 0x22b5, 0x0000 }, - { 0x9900, 0x22ba, 0x3000 }, - { 0x9900, 0x22b8, 0x2000 }, - { 0x1900, 0x22b7, 0x0000 }, - { 0x1900, 0x22b9, 0x0000 }, - { 0x9900, 0x22bc, 0x2000 }, - { 0x1900, 0x22bb, 0x0000 }, - { 0x1900, 0x22bd, 0x0000 }, - { 0x9900, 0x22c6, 0x4000 }, - { 0x9900, 0x22c2, 0x3000 }, - { 0x9900, 0x22c0, 0x2000 }, - { 0x1900, 0x22bf, 0x0000 }, - { 0x1900, 0x22c1, 0x0000 }, - { 0x9900, 0x22c4, 0x2000 }, - { 0x1900, 0x22c3, 0x0000 }, - { 0x1900, 0x22c5, 0x0000 }, - { 0x9900, 0x22ca, 0x3000 }, - { 0x9900, 0x22c8, 0x2000 }, - { 0x1900, 0x22c7, 0x0000 }, - { 0x1900, 0x22c9, 0x0000 }, - { 0x9900, 0x22cc, 0x2000 }, - { 0x1900, 0x22cb, 0x0000 }, - { 0x1900, 0x22cd, 0x0000 }, - { 0x9900, 0x22de, 0x5000 }, - { 0x9900, 0x22d6, 0x4000 }, - { 0x9900, 0x22d2, 0x3000 }, - { 0x9900, 0x22d0, 0x2000 }, - { 0x1900, 0x22cf, 0x0000 }, - { 0x1900, 0x22d1, 0x0000 }, - { 0x9900, 0x22d4, 0x2000 }, - { 0x1900, 0x22d3, 0x0000 }, - { 0x1900, 0x22d5, 0x0000 }, - { 0x9900, 0x22da, 0x3000 }, - { 0x9900, 0x22d8, 0x2000 }, - { 0x1900, 0x22d7, 0x0000 }, - { 0x1900, 0x22d9, 0x0000 }, - { 0x9900, 0x22dc, 0x2000 }, - { 0x1900, 0x22db, 0x0000 }, - { 0x1900, 0x22dd, 0x0000 }, - { 0x9900, 0x22e6, 0x4000 }, - { 0x9900, 0x22e2, 0x3000 }, - { 0x9900, 0x22e0, 0x2000 }, - { 0x1900, 0x22df, 0x0000 }, - { 0x1900, 0x22e1, 0x0000 }, - { 0x9900, 0x22e4, 0x2000 }, - { 0x1900, 0x22e3, 0x0000 }, - { 0x1900, 0x22e5, 0x0000 }, - { 0x9900, 0x22ea, 0x3000 }, - { 0x9900, 0x22e8, 0x2000 }, - { 0x1900, 0x22e7, 0x0000 }, - { 0x1900, 0x22e9, 0x0000 }, - { 0x9900, 0x22ec, 0x2000 }, - { 0x1900, 0x22eb, 0x0000 }, - { 0x1900, 0x22ed, 0x0000 }, - { 0x9a00, 0x230e, 0x6000 }, - { 0x9900, 0x22fe, 0x5000 }, - { 0x9900, 0x22f6, 0x4000 }, - { 0x9900, 0x22f2, 0x3000 }, - { 0x9900, 0x22f0, 0x2000 }, - { 0x1900, 0x22ef, 0x0000 }, - { 0x1900, 0x22f1, 0x0000 }, - { 0x9900, 0x22f4, 0x2000 }, - { 0x1900, 0x22f3, 0x0000 }, - { 0x1900, 0x22f5, 0x0000 }, - { 0x9900, 0x22fa, 0x3000 }, - { 0x9900, 0x22f8, 0x2000 }, - { 0x1900, 0x22f7, 0x0000 }, - { 0x1900, 0x22f9, 0x0000 }, - { 0x9900, 0x22fc, 0x2000 }, - { 0x1900, 0x22fb, 0x0000 }, - { 0x1900, 0x22fd, 0x0000 }, - { 0x9a00, 0x2306, 0x4000 }, - { 0x9a00, 0x2302, 0x3000 }, - { 0x9a00, 0x2300, 0x2000 }, - { 0x1900, 0x22ff, 0x0000 }, - { 0x1a00, 0x2301, 0x0000 }, - { 0x9a00, 0x2304, 0x2000 }, - { 0x1a00, 0x2303, 0x0000 }, - { 0x1a00, 0x2305, 0x0000 }, - { 0x9900, 0x230a, 0x3000 }, - { 0x9900, 0x2308, 0x2000 }, - { 0x1a00, 0x2307, 0x0000 }, - { 0x1900, 0x2309, 0x0000 }, - { 0x9a00, 0x230c, 0x2000 }, - { 0x1900, 0x230b, 0x0000 }, - { 0x1a00, 0x230d, 0x0000 }, - { 0x9a00, 0x231e, 0x5000 }, - { 0x9a00, 0x2316, 0x4000 }, - { 0x9a00, 0x2312, 0x3000 }, - { 0x9a00, 0x2310, 0x2000 }, - { 0x1a00, 0x230f, 0x0000 }, - { 0x1a00, 0x2311, 0x0000 }, - { 0x9a00, 0x2314, 0x2000 }, - { 0x1a00, 0x2313, 0x0000 }, - { 0x1a00, 0x2315, 0x0000 }, - { 0x9a00, 0x231a, 0x3000 }, - { 0x9a00, 0x2318, 0x2000 }, - { 0x1a00, 0x2317, 0x0000 }, - { 0x1a00, 0x2319, 0x0000 }, - { 0x9a00, 0x231c, 0x2000 }, - { 0x1a00, 0x231b, 0x0000 }, - { 0x1a00, 0x231d, 0x0000 }, - { 0x9a00, 0x2326, 0x4000 }, - { 0x9a00, 0x2322, 0x3000 }, - { 0x9900, 0x2320, 0x2000 }, - { 0x1a00, 0x231f, 0x0000 }, - { 0x1900, 0x2321, 0x0000 }, - { 0x9a00, 0x2324, 0x2000 }, - { 0x1a00, 0x2323, 0x0000 }, - { 0x1a00, 0x2325, 0x0000 }, - { 0x9200, 0x232a, 0x3000 }, - { 0x9a00, 0x2328, 0x2000 }, - { 0x1a00, 0x2327, 0x0000 }, - { 0x1600, 0x2329, 0x0000 }, - { 0x9a00, 0x232c, 0x2000 }, - { 0x1a00, 0x232b, 0x0000 }, - { 0x1a00, 0x232d, 0x0000 }, - { 0x9a00, 0x236e, 0x7000 }, - { 0x9a00, 0x234e, 0x6000 }, - { 0x9a00, 0x233e, 0x5000 }, - { 0x9a00, 0x2336, 0x4000 }, - { 0x9a00, 0x2332, 0x3000 }, - { 0x9a00, 0x2330, 0x2000 }, - { 0x1a00, 0x232f, 0x0000 }, - { 0x1a00, 0x2331, 0x0000 }, - { 0x9a00, 0x2334, 0x2000 }, - { 0x1a00, 0x2333, 0x0000 }, - { 0x1a00, 0x2335, 0x0000 }, - { 0x9a00, 0x233a, 0x3000 }, - { 0x9a00, 0x2338, 0x2000 }, - { 0x1a00, 0x2337, 0x0000 }, - { 0x1a00, 0x2339, 0x0000 }, - { 0x9a00, 0x233c, 0x2000 }, - { 0x1a00, 0x233b, 0x0000 }, - { 0x1a00, 0x233d, 0x0000 }, - { 0x9a00, 0x2346, 0x4000 }, - { 0x9a00, 0x2342, 0x3000 }, - { 0x9a00, 0x2340, 0x2000 }, - { 0x1a00, 0x233f, 0x0000 }, - { 0x1a00, 0x2341, 0x0000 }, - { 0x9a00, 0x2344, 0x2000 }, - { 0x1a00, 0x2343, 0x0000 }, - { 0x1a00, 0x2345, 0x0000 }, - { 0x9a00, 0x234a, 0x3000 }, - { 0x9a00, 0x2348, 0x2000 }, - { 0x1a00, 0x2347, 0x0000 }, - { 0x1a00, 0x2349, 0x0000 }, - { 0x9a00, 0x234c, 0x2000 }, - { 0x1a00, 0x234b, 0x0000 }, - { 0x1a00, 0x234d, 0x0000 }, - { 0x9a00, 0x235e, 0x5000 }, - { 0x9a00, 0x2356, 0x4000 }, - { 0x9a00, 0x2352, 0x3000 }, - { 0x9a00, 0x2350, 0x2000 }, - { 0x1a00, 0x234f, 0x0000 }, - { 0x1a00, 0x2351, 0x0000 }, - { 0x9a00, 0x2354, 0x2000 }, - { 0x1a00, 0x2353, 0x0000 }, - { 0x1a00, 0x2355, 0x0000 }, - { 0x9a00, 0x235a, 0x3000 }, - { 0x9a00, 0x2358, 0x2000 }, - { 0x1a00, 0x2357, 0x0000 }, - { 0x1a00, 0x2359, 0x0000 }, - { 0x9a00, 0x235c, 0x2000 }, - { 0x1a00, 0x235b, 0x0000 }, - { 0x1a00, 0x235d, 0x0000 }, - { 0x9a00, 0x2366, 0x4000 }, - { 0x9a00, 0x2362, 0x3000 }, - { 0x9a00, 0x2360, 0x2000 }, - { 0x1a00, 0x235f, 0x0000 }, - { 0x1a00, 0x2361, 0x0000 }, - { 0x9a00, 0x2364, 0x2000 }, - { 0x1a00, 0x2363, 0x0000 }, - { 0x1a00, 0x2365, 0x0000 }, - { 0x9a00, 0x236a, 0x3000 }, - { 0x9a00, 0x2368, 0x2000 }, - { 0x1a00, 0x2367, 0x0000 }, - { 0x1a00, 0x2369, 0x0000 }, - { 0x9a00, 0x236c, 0x2000 }, - { 0x1a00, 0x236b, 0x0000 }, - { 0x1a00, 0x236d, 0x0000 }, - { 0x9a00, 0x238e, 0x6000 }, - { 0x9a00, 0x237e, 0x5000 }, - { 0x9a00, 0x2376, 0x4000 }, - { 0x9a00, 0x2372, 0x3000 }, - { 0x9a00, 0x2370, 0x2000 }, - { 0x1a00, 0x236f, 0x0000 }, - { 0x1a00, 0x2371, 0x0000 }, - { 0x9a00, 0x2374, 0x2000 }, - { 0x1a00, 0x2373, 0x0000 }, - { 0x1a00, 0x2375, 0x0000 }, - { 0x9a00, 0x237a, 0x3000 }, - { 0x9a00, 0x2378, 0x2000 }, - { 0x1a00, 0x2377, 0x0000 }, - { 0x1a00, 0x2379, 0x0000 }, - { 0x9900, 0x237c, 0x2000 }, - { 0x1a00, 0x237b, 0x0000 }, - { 0x1a00, 0x237d, 0x0000 }, - { 0x9a00, 0x2386, 0x4000 }, - { 0x9a00, 0x2382, 0x3000 }, - { 0x9a00, 0x2380, 0x2000 }, - { 0x1a00, 0x237f, 0x0000 }, - { 0x1a00, 0x2381, 0x0000 }, - { 0x9a00, 0x2384, 0x2000 }, - { 0x1a00, 0x2383, 0x0000 }, - { 0x1a00, 0x2385, 0x0000 }, - { 0x9a00, 0x238a, 0x3000 }, - { 0x9a00, 0x2388, 0x2000 }, - { 0x1a00, 0x2387, 0x0000 }, - { 0x1a00, 0x2389, 0x0000 }, - { 0x9a00, 0x238c, 0x2000 }, - { 0x1a00, 0x238b, 0x0000 }, - { 0x1a00, 0x238d, 0x0000 }, - { 0x9900, 0x239e, 0x5000 }, - { 0x9a00, 0x2396, 0x4000 }, - { 0x9a00, 0x2392, 0x3000 }, - { 0x9a00, 0x2390, 0x2000 }, - { 0x1a00, 0x238f, 0x0000 }, - { 0x1a00, 0x2391, 0x0000 }, - { 0x9a00, 0x2394, 0x2000 }, - { 0x1a00, 0x2393, 0x0000 }, - { 0x1a00, 0x2395, 0x0000 }, - { 0x9a00, 0x239a, 0x3000 }, - { 0x9a00, 0x2398, 0x2000 }, - { 0x1a00, 0x2397, 0x0000 }, - { 0x1a00, 0x2399, 0x0000 }, - { 0x9900, 0x239c, 0x2000 }, - { 0x1900, 0x239b, 0x0000 }, - { 0x1900, 0x239d, 0x0000 }, - { 0x9900, 0x23a6, 0x4000 }, - { 0x9900, 0x23a2, 0x3000 }, - { 0x9900, 0x23a0, 0x2000 }, - { 0x1900, 0x239f, 0x0000 }, - { 0x1900, 0x23a1, 0x0000 }, - { 0x9900, 0x23a4, 0x2000 }, - { 0x1900, 0x23a3, 0x0000 }, - { 0x1900, 0x23a5, 0x0000 }, - { 0x9900, 0x23aa, 0x3000 }, - { 0x9900, 0x23a8, 0x2000 }, - { 0x1900, 0x23a7, 0x0000 }, - { 0x1900, 0x23a9, 0x0000 }, - { 0x9900, 0x23ac, 0x2000 }, - { 0x1900, 0x23ab, 0x0000 }, - { 0x1900, 0x23ad, 0x0000 }, - { 0x8f00, 0x248b, 0x8000 }, - { 0x9a00, 0x241d, 0x7000 }, - { 0x9a00, 0x23ce, 0x6000 }, - { 0x9a00, 0x23be, 0x5000 }, - { 0x9500, 0x23b6, 0x4000 }, - { 0x9900, 0x23b2, 0x3000 }, - { 0x9900, 0x23b0, 0x2000 }, - { 0x1900, 0x23af, 0x0000 }, - { 0x1900, 0x23b1, 0x0000 }, - { 0x9600, 0x23b4, 0x2000 }, - { 0x1900, 0x23b3, 0x0000 }, - { 0x1200, 0x23b5, 0x0000 }, - { 0x9a00, 0x23ba, 0x3000 }, - { 0x9a00, 0x23b8, 0x2000 }, - { 0x1a00, 0x23b7, 0x0000 }, - { 0x1a00, 0x23b9, 0x0000 }, - { 0x9a00, 0x23bc, 0x2000 }, - { 0x1a00, 0x23bb, 0x0000 }, - { 0x1a00, 0x23bd, 0x0000 }, - { 0x9a00, 0x23c6, 0x4000 }, - { 0x9a00, 0x23c2, 0x3000 }, - { 0x9a00, 0x23c0, 0x2000 }, - { 0x1a00, 0x23bf, 0x0000 }, - { 0x1a00, 0x23c1, 0x0000 }, - { 0x9a00, 0x23c4, 0x2000 }, - { 0x1a00, 0x23c3, 0x0000 }, - { 0x1a00, 0x23c5, 0x0000 }, - { 0x9a00, 0x23ca, 0x3000 }, - { 0x9a00, 0x23c8, 0x2000 }, - { 0x1a00, 0x23c7, 0x0000 }, - { 0x1a00, 0x23c9, 0x0000 }, - { 0x9a00, 0x23cc, 0x2000 }, - { 0x1a00, 0x23cb, 0x0000 }, - { 0x1a00, 0x23cd, 0x0000 }, - { 0x9a00, 0x240d, 0x5000 }, - { 0x9a00, 0x2405, 0x4000 }, - { 0x9a00, 0x2401, 0x3000 }, - { 0x9a00, 0x23d0, 0x2000 }, - { 0x1a00, 0x23cf, 0x0000 }, - { 0x1a00, 0x2400, 0x0000 }, - { 0x9a00, 0x2403, 0x2000 }, - { 0x1a00, 0x2402, 0x0000 }, - { 0x1a00, 0x2404, 0x0000 }, - { 0x9a00, 0x2409, 0x3000 }, - { 0x9a00, 0x2407, 0x2000 }, - { 0x1a00, 0x2406, 0x0000 }, - { 0x1a00, 0x2408, 0x0000 }, - { 0x9a00, 0x240b, 0x2000 }, - { 0x1a00, 0x240a, 0x0000 }, - { 0x1a00, 0x240c, 0x0000 }, - { 0x9a00, 0x2415, 0x4000 }, - { 0x9a00, 0x2411, 0x3000 }, - { 0x9a00, 0x240f, 0x2000 }, - { 0x1a00, 0x240e, 0x0000 }, - { 0x1a00, 0x2410, 0x0000 }, - { 0x9a00, 0x2413, 0x2000 }, - { 0x1a00, 0x2412, 0x0000 }, - { 0x1a00, 0x2414, 0x0000 }, - { 0x9a00, 0x2419, 0x3000 }, - { 0x9a00, 0x2417, 0x2000 }, - { 0x1a00, 0x2416, 0x0000 }, - { 0x1a00, 0x2418, 0x0000 }, - { 0x9a00, 0x241b, 0x2000 }, - { 0x1a00, 0x241a, 0x0000 }, - { 0x1a00, 0x241c, 0x0000 }, - { 0x8f00, 0x246b, 0x6000 }, - { 0x9a00, 0x2446, 0x5000 }, - { 0x9a00, 0x2425, 0x4000 }, - { 0x9a00, 0x2421, 0x3000 }, - { 0x9a00, 0x241f, 0x2000 }, - { 0x1a00, 0x241e, 0x0000 }, - { 0x1a00, 0x2420, 0x0000 }, - { 0x9a00, 0x2423, 0x2000 }, - { 0x1a00, 0x2422, 0x0000 }, - { 0x1a00, 0x2424, 0x0000 }, - { 0x9a00, 0x2442, 0x3000 }, - { 0x9a00, 0x2440, 0x2000 }, - { 0x1a00, 0x2426, 0x0000 }, - { 0x1a00, 0x2441, 0x0000 }, - { 0x9a00, 0x2444, 0x2000 }, - { 0x1a00, 0x2443, 0x0000 }, - { 0x1a00, 0x2445, 0x0000 }, - { 0x8f00, 0x2463, 0x4000 }, - { 0x9a00, 0x244a, 0x3000 }, - { 0x9a00, 0x2448, 0x2000 }, - { 0x1a00, 0x2447, 0x0000 }, - { 0x1a00, 0x2449, 0x0000 }, - { 0x8f00, 0x2461, 0x2000 }, - { 0x0f00, 0x2460, 0x0000 }, - { 0x0f00, 0x2462, 0x0000 }, - { 0x8f00, 0x2467, 0x3000 }, - { 0x8f00, 0x2465, 0x2000 }, - { 0x0f00, 0x2464, 0x0000 }, - { 0x0f00, 0x2466, 0x0000 }, - { 0x8f00, 0x2469, 0x2000 }, - { 0x0f00, 0x2468, 0x0000 }, - { 0x0f00, 0x246a, 0x0000 }, - { 0x8f00, 0x247b, 0x5000 }, - { 0x8f00, 0x2473, 0x4000 }, - { 0x8f00, 0x246f, 0x3000 }, - { 0x8f00, 0x246d, 0x2000 }, - { 0x0f00, 0x246c, 0x0000 }, - { 0x0f00, 0x246e, 0x0000 }, - { 0x8f00, 0x2471, 0x2000 }, - { 0x0f00, 0x2470, 0x0000 }, - { 0x0f00, 0x2472, 0x0000 }, - { 0x8f00, 0x2477, 0x3000 }, - { 0x8f00, 0x2475, 0x2000 }, - { 0x0f00, 0x2474, 0x0000 }, - { 0x0f00, 0x2476, 0x0000 }, - { 0x8f00, 0x2479, 0x2000 }, - { 0x0f00, 0x2478, 0x0000 }, - { 0x0f00, 0x247a, 0x0000 }, - { 0x8f00, 0x2483, 0x4000 }, - { 0x8f00, 0x247f, 0x3000 }, - { 0x8f00, 0x247d, 0x2000 }, - { 0x0f00, 0x247c, 0x0000 }, - { 0x0f00, 0x247e, 0x0000 }, - { 0x8f00, 0x2481, 0x2000 }, - { 0x0f00, 0x2480, 0x0000 }, - { 0x0f00, 0x2482, 0x0000 }, - { 0x8f00, 0x2487, 0x3000 }, - { 0x8f00, 0x2485, 0x2000 }, - { 0x0f00, 0x2484, 0x0000 }, - { 0x0f00, 0x2486, 0x0000 }, - { 0x8f00, 0x2489, 0x2000 }, - { 0x0f00, 0x2488, 0x0000 }, - { 0x0f00, 0x248a, 0x0000 }, - { 0x9a00, 0x24cb, 0x7000 }, - { 0x9a00, 0x24ab, 0x6000 }, - { 0x8f00, 0x249b, 0x5000 }, - { 0x8f00, 0x2493, 0x4000 }, - { 0x8f00, 0x248f, 0x3000 }, - { 0x8f00, 0x248d, 0x2000 }, - { 0x0f00, 0x248c, 0x0000 }, - { 0x0f00, 0x248e, 0x0000 }, - { 0x8f00, 0x2491, 0x2000 }, - { 0x0f00, 0x2490, 0x0000 }, - { 0x0f00, 0x2492, 0x0000 }, - { 0x8f00, 0x2497, 0x3000 }, - { 0x8f00, 0x2495, 0x2000 }, - { 0x0f00, 0x2494, 0x0000 }, - { 0x0f00, 0x2496, 0x0000 }, - { 0x8f00, 0x2499, 0x2000 }, - { 0x0f00, 0x2498, 0x0000 }, - { 0x0f00, 0x249a, 0x0000 }, - { 0x9a00, 0x24a3, 0x4000 }, - { 0x9a00, 0x249f, 0x3000 }, - { 0x9a00, 0x249d, 0x2000 }, - { 0x1a00, 0x249c, 0x0000 }, - { 0x1a00, 0x249e, 0x0000 }, - { 0x9a00, 0x24a1, 0x2000 }, - { 0x1a00, 0x24a0, 0x0000 }, - { 0x1a00, 0x24a2, 0x0000 }, - { 0x9a00, 0x24a7, 0x3000 }, - { 0x9a00, 0x24a5, 0x2000 }, - { 0x1a00, 0x24a4, 0x0000 }, - { 0x1a00, 0x24a6, 0x0000 }, - { 0x9a00, 0x24a9, 0x2000 }, - { 0x1a00, 0x24a8, 0x0000 }, - { 0x1a00, 0x24aa, 0x0000 }, - { 0x9a00, 0x24bb, 0x5000 }, - { 0x9a00, 0x24b3, 0x4000 }, - { 0x9a00, 0x24af, 0x3000 }, - { 0x9a00, 0x24ad, 0x2000 }, - { 0x1a00, 0x24ac, 0x0000 }, - { 0x1a00, 0x24ae, 0x0000 }, - { 0x9a00, 0x24b1, 0x2000 }, - { 0x1a00, 0x24b0, 0x0000 }, - { 0x1a00, 0x24b2, 0x0000 }, - { 0x9a00, 0x24b7, 0x3000 }, - { 0x9a00, 0x24b5, 0x2000 }, - { 0x1a00, 0x24b4, 0x0000 }, - { 0x1a00, 0x24b6, 0x0000 }, - { 0x9a00, 0x24b9, 0x2000 }, - { 0x1a00, 0x24b8, 0x0000 }, - { 0x1a00, 0x24ba, 0x0000 }, - { 0x9a00, 0x24c3, 0x4000 }, - { 0x9a00, 0x24bf, 0x3000 }, - { 0x9a00, 0x24bd, 0x2000 }, - { 0x1a00, 0x24bc, 0x0000 }, - { 0x1a00, 0x24be, 0x0000 }, - { 0x9a00, 0x24c1, 0x2000 }, - { 0x1a00, 0x24c0, 0x0000 }, - { 0x1a00, 0x24c2, 0x0000 }, - { 0x9a00, 0x24c7, 0x3000 }, - { 0x9a00, 0x24c5, 0x2000 }, - { 0x1a00, 0x24c4, 0x0000 }, - { 0x1a00, 0x24c6, 0x0000 }, - { 0x9a00, 0x24c9, 0x2000 }, - { 0x1a00, 0x24c8, 0x0000 }, - { 0x1a00, 0x24ca, 0x0000 }, - { 0x8f00, 0x24eb, 0x6000 }, - { 0x9a00, 0x24db, 0x5000 }, - { 0x9a00, 0x24d3, 0x4000 }, - { 0x9a00, 0x24cf, 0x3000 }, - { 0x9a00, 0x24cd, 0x2000 }, - { 0x1a00, 0x24cc, 0x0000 }, - { 0x1a00, 0x24ce, 0x0000 }, - { 0x9a00, 0x24d1, 0x2000 }, - { 0x1a00, 0x24d0, 0x0000 }, - { 0x1a00, 0x24d2, 0x0000 }, - { 0x9a00, 0x24d7, 0x3000 }, - { 0x9a00, 0x24d5, 0x2000 }, - { 0x1a00, 0x24d4, 0x0000 }, - { 0x1a00, 0x24d6, 0x0000 }, - { 0x9a00, 0x24d9, 0x2000 }, - { 0x1a00, 0x24d8, 0x0000 }, - { 0x1a00, 0x24da, 0x0000 }, - { 0x9a00, 0x24e3, 0x4000 }, - { 0x9a00, 0x24df, 0x3000 }, - { 0x9a00, 0x24dd, 0x2000 }, - { 0x1a00, 0x24dc, 0x0000 }, - { 0x1a00, 0x24de, 0x0000 }, - { 0x9a00, 0x24e1, 0x2000 }, - { 0x1a00, 0x24e0, 0x0000 }, - { 0x1a00, 0x24e2, 0x0000 }, - { 0x9a00, 0x24e7, 0x3000 }, - { 0x9a00, 0x24e5, 0x2000 }, - { 0x1a00, 0x24e4, 0x0000 }, - { 0x1a00, 0x24e6, 0x0000 }, - { 0x9a00, 0x24e9, 0x2000 }, - { 0x1a00, 0x24e8, 0x0000 }, - { 0x0f00, 0x24ea, 0x0000 }, - { 0x8f00, 0x24fb, 0x5000 }, - { 0x8f00, 0x24f3, 0x4000 }, - { 0x8f00, 0x24ef, 0x3000 }, - { 0x8f00, 0x24ed, 0x2000 }, - { 0x0f00, 0x24ec, 0x0000 }, - { 0x0f00, 0x24ee, 0x0000 }, - { 0x8f00, 0x24f1, 0x2000 }, - { 0x0f00, 0x24f0, 0x0000 }, - { 0x0f00, 0x24f2, 0x0000 }, - { 0x8f00, 0x24f7, 0x3000 }, - { 0x8f00, 0x24f5, 0x2000 }, - { 0x0f00, 0x24f4, 0x0000 }, - { 0x0f00, 0x24f6, 0x0000 }, - { 0x8f00, 0x24f9, 0x2000 }, - { 0x0f00, 0x24f8, 0x0000 }, - { 0x0f00, 0x24fa, 0x0000 }, - { 0x9a00, 0x2503, 0x4000 }, - { 0x8f00, 0x24ff, 0x3000 }, - { 0x8f00, 0x24fd, 0x2000 }, - { 0x0f00, 0x24fc, 0x0000 }, - { 0x0f00, 0x24fe, 0x0000 }, - { 0x9a00, 0x2501, 0x2000 }, - { 0x1a00, 0x2500, 0x0000 }, - { 0x1a00, 0x2502, 0x0000 }, - { 0x9a00, 0x2507, 0x3000 }, - { 0x9a00, 0x2505, 0x2000 }, - { 0x1a00, 0x2504, 0x0000 }, - { 0x1a00, 0x2506, 0x0000 }, - { 0x9a00, 0x2509, 0x2000 }, - { 0x1a00, 0x2508, 0x0000 }, - { 0x1a00, 0x250a, 0x0000 }, - { 0x9a00, 0x260b, 0x9000 }, - { 0x9a00, 0x258b, 0x8000 }, - { 0x9a00, 0x254b, 0x7000 }, - { 0x9a00, 0x252b, 0x6000 }, - { 0x9a00, 0x251b, 0x5000 }, - { 0x9a00, 0x2513, 0x4000 }, - { 0x9a00, 0x250f, 0x3000 }, - { 0x9a00, 0x250d, 0x2000 }, - { 0x1a00, 0x250c, 0x0000 }, - { 0x1a00, 0x250e, 0x0000 }, - { 0x9a00, 0x2511, 0x2000 }, - { 0x1a00, 0x2510, 0x0000 }, - { 0x1a00, 0x2512, 0x0000 }, - { 0x9a00, 0x2517, 0x3000 }, - { 0x9a00, 0x2515, 0x2000 }, - { 0x1a00, 0x2514, 0x0000 }, - { 0x1a00, 0x2516, 0x0000 }, - { 0x9a00, 0x2519, 0x2000 }, - { 0x1a00, 0x2518, 0x0000 }, - { 0x1a00, 0x251a, 0x0000 }, - { 0x9a00, 0x2523, 0x4000 }, - { 0x9a00, 0x251f, 0x3000 }, - { 0x9a00, 0x251d, 0x2000 }, - { 0x1a00, 0x251c, 0x0000 }, - { 0x1a00, 0x251e, 0x0000 }, - { 0x9a00, 0x2521, 0x2000 }, - { 0x1a00, 0x2520, 0x0000 }, - { 0x1a00, 0x2522, 0x0000 }, - { 0x9a00, 0x2527, 0x3000 }, - { 0x9a00, 0x2525, 0x2000 }, - { 0x1a00, 0x2524, 0x0000 }, - { 0x1a00, 0x2526, 0x0000 }, - { 0x9a00, 0x2529, 0x2000 }, - { 0x1a00, 0x2528, 0x0000 }, - { 0x1a00, 0x252a, 0x0000 }, - { 0x9a00, 0x253b, 0x5000 }, - { 0x9a00, 0x2533, 0x4000 }, - { 0x9a00, 0x252f, 0x3000 }, - { 0x9a00, 0x252d, 0x2000 }, - { 0x1a00, 0x252c, 0x0000 }, - { 0x1a00, 0x252e, 0x0000 }, - { 0x9a00, 0x2531, 0x2000 }, - { 0x1a00, 0x2530, 0x0000 }, - { 0x1a00, 0x2532, 0x0000 }, - { 0x9a00, 0x2537, 0x3000 }, - { 0x9a00, 0x2535, 0x2000 }, - { 0x1a00, 0x2534, 0x0000 }, - { 0x1a00, 0x2536, 0x0000 }, - { 0x9a00, 0x2539, 0x2000 }, - { 0x1a00, 0x2538, 0x0000 }, - { 0x1a00, 0x253a, 0x0000 }, - { 0x9a00, 0x2543, 0x4000 }, - { 0x9a00, 0x253f, 0x3000 }, - { 0x9a00, 0x253d, 0x2000 }, - { 0x1a00, 0x253c, 0x0000 }, - { 0x1a00, 0x253e, 0x0000 }, - { 0x9a00, 0x2541, 0x2000 }, - { 0x1a00, 0x2540, 0x0000 }, - { 0x1a00, 0x2542, 0x0000 }, - { 0x9a00, 0x2547, 0x3000 }, - { 0x9a00, 0x2545, 0x2000 }, - { 0x1a00, 0x2544, 0x0000 }, - { 0x1a00, 0x2546, 0x0000 }, - { 0x9a00, 0x2549, 0x2000 }, - { 0x1a00, 0x2548, 0x0000 }, - { 0x1a00, 0x254a, 0x0000 }, - { 0x9a00, 0x256b, 0x6000 }, - { 0x9a00, 0x255b, 0x5000 }, - { 0x9a00, 0x2553, 0x4000 }, - { 0x9a00, 0x254f, 0x3000 }, - { 0x9a00, 0x254d, 0x2000 }, - { 0x1a00, 0x254c, 0x0000 }, - { 0x1a00, 0x254e, 0x0000 }, - { 0x9a00, 0x2551, 0x2000 }, - { 0x1a00, 0x2550, 0x0000 }, - { 0x1a00, 0x2552, 0x0000 }, - { 0x9a00, 0x2557, 0x3000 }, - { 0x9a00, 0x2555, 0x2000 }, - { 0x1a00, 0x2554, 0x0000 }, - { 0x1a00, 0x2556, 0x0000 }, - { 0x9a00, 0x2559, 0x2000 }, - { 0x1a00, 0x2558, 0x0000 }, - { 0x1a00, 0x255a, 0x0000 }, - { 0x9a00, 0x2563, 0x4000 }, - { 0x9a00, 0x255f, 0x3000 }, - { 0x9a00, 0x255d, 0x2000 }, - { 0x1a00, 0x255c, 0x0000 }, - { 0x1a00, 0x255e, 0x0000 }, - { 0x9a00, 0x2561, 0x2000 }, - { 0x1a00, 0x2560, 0x0000 }, - { 0x1a00, 0x2562, 0x0000 }, - { 0x9a00, 0x2567, 0x3000 }, - { 0x9a00, 0x2565, 0x2000 }, - { 0x1a00, 0x2564, 0x0000 }, - { 0x1a00, 0x2566, 0x0000 }, - { 0x9a00, 0x2569, 0x2000 }, - { 0x1a00, 0x2568, 0x0000 }, - { 0x1a00, 0x256a, 0x0000 }, - { 0x9a00, 0x257b, 0x5000 }, - { 0x9a00, 0x2573, 0x4000 }, - { 0x9a00, 0x256f, 0x3000 }, - { 0x9a00, 0x256d, 0x2000 }, - { 0x1a00, 0x256c, 0x0000 }, - { 0x1a00, 0x256e, 0x0000 }, - { 0x9a00, 0x2571, 0x2000 }, - { 0x1a00, 0x2570, 0x0000 }, - { 0x1a00, 0x2572, 0x0000 }, - { 0x9a00, 0x2577, 0x3000 }, - { 0x9a00, 0x2575, 0x2000 }, - { 0x1a00, 0x2574, 0x0000 }, - { 0x1a00, 0x2576, 0x0000 }, - { 0x9a00, 0x2579, 0x2000 }, - { 0x1a00, 0x2578, 0x0000 }, - { 0x1a00, 0x257a, 0x0000 }, - { 0x9a00, 0x2583, 0x4000 }, - { 0x9a00, 0x257f, 0x3000 }, - { 0x9a00, 0x257d, 0x2000 }, - { 0x1a00, 0x257c, 0x0000 }, - { 0x1a00, 0x257e, 0x0000 }, - { 0x9a00, 0x2581, 0x2000 }, - { 0x1a00, 0x2580, 0x0000 }, - { 0x1a00, 0x2582, 0x0000 }, - { 0x9a00, 0x2587, 0x3000 }, - { 0x9a00, 0x2585, 0x2000 }, - { 0x1a00, 0x2584, 0x0000 }, - { 0x1a00, 0x2586, 0x0000 }, - { 0x9a00, 0x2589, 0x2000 }, - { 0x1a00, 0x2588, 0x0000 }, - { 0x1a00, 0x258a, 0x0000 }, - { 0x9a00, 0x25cb, 0x7000 }, - { 0x9a00, 0x25ab, 0x6000 }, - { 0x9a00, 0x259b, 0x5000 }, - { 0x9a00, 0x2593, 0x4000 }, - { 0x9a00, 0x258f, 0x3000 }, - { 0x9a00, 0x258d, 0x2000 }, - { 0x1a00, 0x258c, 0x0000 }, - { 0x1a00, 0x258e, 0x0000 }, - { 0x9a00, 0x2591, 0x2000 }, - { 0x1a00, 0x2590, 0x0000 }, - { 0x1a00, 0x2592, 0x0000 }, - { 0x9a00, 0x2597, 0x3000 }, - { 0x9a00, 0x2595, 0x2000 }, - { 0x1a00, 0x2594, 0x0000 }, - { 0x1a00, 0x2596, 0x0000 }, - { 0x9a00, 0x2599, 0x2000 }, - { 0x1a00, 0x2598, 0x0000 }, - { 0x1a00, 0x259a, 0x0000 }, - { 0x9a00, 0x25a3, 0x4000 }, - { 0x9a00, 0x259f, 0x3000 }, - { 0x9a00, 0x259d, 0x2000 }, - { 0x1a00, 0x259c, 0x0000 }, - { 0x1a00, 0x259e, 0x0000 }, - { 0x9a00, 0x25a1, 0x2000 }, - { 0x1a00, 0x25a0, 0x0000 }, - { 0x1a00, 0x25a2, 0x0000 }, - { 0x9a00, 0x25a7, 0x3000 }, - { 0x9a00, 0x25a5, 0x2000 }, - { 0x1a00, 0x25a4, 0x0000 }, - { 0x1a00, 0x25a6, 0x0000 }, - { 0x9a00, 0x25a9, 0x2000 }, - { 0x1a00, 0x25a8, 0x0000 }, - { 0x1a00, 0x25aa, 0x0000 }, - { 0x9a00, 0x25bb, 0x5000 }, - { 0x9a00, 0x25b3, 0x4000 }, - { 0x9a00, 0x25af, 0x3000 }, - { 0x9a00, 0x25ad, 0x2000 }, - { 0x1a00, 0x25ac, 0x0000 }, - { 0x1a00, 0x25ae, 0x0000 }, - { 0x9a00, 0x25b1, 0x2000 }, - { 0x1a00, 0x25b0, 0x0000 }, - { 0x1a00, 0x25b2, 0x0000 }, - { 0x9900, 0x25b7, 0x3000 }, - { 0x9a00, 0x25b5, 0x2000 }, - { 0x1a00, 0x25b4, 0x0000 }, - { 0x1a00, 0x25b6, 0x0000 }, - { 0x9a00, 0x25b9, 0x2000 }, - { 0x1a00, 0x25b8, 0x0000 }, - { 0x1a00, 0x25ba, 0x0000 }, - { 0x9a00, 0x25c3, 0x4000 }, - { 0x9a00, 0x25bf, 0x3000 }, - { 0x9a00, 0x25bd, 0x2000 }, - { 0x1a00, 0x25bc, 0x0000 }, - { 0x1a00, 0x25be, 0x0000 }, - { 0x9900, 0x25c1, 0x2000 }, - { 0x1a00, 0x25c0, 0x0000 }, - { 0x1a00, 0x25c2, 0x0000 }, - { 0x9a00, 0x25c7, 0x3000 }, - { 0x9a00, 0x25c5, 0x2000 }, - { 0x1a00, 0x25c4, 0x0000 }, - { 0x1a00, 0x25c6, 0x0000 }, - { 0x9a00, 0x25c9, 0x2000 }, - { 0x1a00, 0x25c8, 0x0000 }, - { 0x1a00, 0x25ca, 0x0000 }, - { 0x9a00, 0x25eb, 0x6000 }, - { 0x9a00, 0x25db, 0x5000 }, - { 0x9a00, 0x25d3, 0x4000 }, - { 0x9a00, 0x25cf, 0x3000 }, - { 0x9a00, 0x25cd, 0x2000 }, - { 0x1a00, 0x25cc, 0x0000 }, - { 0x1a00, 0x25ce, 0x0000 }, - { 0x9a00, 0x25d1, 0x2000 }, - { 0x1a00, 0x25d0, 0x0000 }, - { 0x1a00, 0x25d2, 0x0000 }, - { 0x9a00, 0x25d7, 0x3000 }, - { 0x9a00, 0x25d5, 0x2000 }, - { 0x1a00, 0x25d4, 0x0000 }, - { 0x1a00, 0x25d6, 0x0000 }, - { 0x9a00, 0x25d9, 0x2000 }, - { 0x1a00, 0x25d8, 0x0000 }, - { 0x1a00, 0x25da, 0x0000 }, - { 0x9a00, 0x25e3, 0x4000 }, - { 0x9a00, 0x25df, 0x3000 }, - { 0x9a00, 0x25dd, 0x2000 }, - { 0x1a00, 0x25dc, 0x0000 }, - { 0x1a00, 0x25de, 0x0000 }, - { 0x9a00, 0x25e1, 0x2000 }, - { 0x1a00, 0x25e0, 0x0000 }, - { 0x1a00, 0x25e2, 0x0000 }, - { 0x9a00, 0x25e7, 0x3000 }, - { 0x9a00, 0x25e5, 0x2000 }, - { 0x1a00, 0x25e4, 0x0000 }, - { 0x1a00, 0x25e6, 0x0000 }, - { 0x9a00, 0x25e9, 0x2000 }, - { 0x1a00, 0x25e8, 0x0000 }, - { 0x1a00, 0x25ea, 0x0000 }, - { 0x9900, 0x25fb, 0x5000 }, - { 0x9a00, 0x25f3, 0x4000 }, - { 0x9a00, 0x25ef, 0x3000 }, - { 0x9a00, 0x25ed, 0x2000 }, - { 0x1a00, 0x25ec, 0x0000 }, - { 0x1a00, 0x25ee, 0x0000 }, - { 0x9a00, 0x25f1, 0x2000 }, - { 0x1a00, 0x25f0, 0x0000 }, - { 0x1a00, 0x25f2, 0x0000 }, - { 0x9a00, 0x25f7, 0x3000 }, - { 0x9a00, 0x25f5, 0x2000 }, - { 0x1a00, 0x25f4, 0x0000 }, - { 0x1a00, 0x25f6, 0x0000 }, - { 0x9900, 0x25f9, 0x2000 }, - { 0x1900, 0x25f8, 0x0000 }, - { 0x1900, 0x25fa, 0x0000 }, - { 0x9a00, 0x2603, 0x4000 }, - { 0x9900, 0x25ff, 0x3000 }, - { 0x9900, 0x25fd, 0x2000 }, - { 0x1900, 0x25fc, 0x0000 }, - { 0x1900, 0x25fe, 0x0000 }, - { 0x9a00, 0x2601, 0x2000 }, - { 0x1a00, 0x2600, 0x0000 }, - { 0x1a00, 0x2602, 0x0000 }, - { 0x9a00, 0x2607, 0x3000 }, - { 0x9a00, 0x2605, 0x2000 }, - { 0x1a00, 0x2604, 0x0000 }, - { 0x1a00, 0x2606, 0x0000 }, - { 0x9a00, 0x2609, 0x2000 }, - { 0x1a00, 0x2608, 0x0000 }, - { 0x1a00, 0x260a, 0x0000 }, - { 0x9a00, 0x268e, 0x8000 }, - { 0x9a00, 0x264c, 0x7000 }, - { 0x9a00, 0x262c, 0x6000 }, - { 0x9a00, 0x261c, 0x5000 }, - { 0x9a00, 0x2613, 0x4000 }, - { 0x9a00, 0x260f, 0x3000 }, - { 0x9a00, 0x260d, 0x2000 }, - { 0x1a00, 0x260c, 0x0000 }, - { 0x1a00, 0x260e, 0x0000 }, - { 0x9a00, 0x2611, 0x2000 }, - { 0x1a00, 0x2610, 0x0000 }, - { 0x1a00, 0x2612, 0x0000 }, - { 0x9a00, 0x2617, 0x3000 }, - { 0x9a00, 0x2615, 0x2000 }, - { 0x1a00, 0x2614, 0x0000 }, - { 0x1a00, 0x2616, 0x0000 }, - { 0x9a00, 0x261a, 0x2000 }, - { 0x1a00, 0x2619, 0x0000 }, - { 0x1a00, 0x261b, 0x0000 }, - { 0x9a00, 0x2624, 0x4000 }, - { 0x9a00, 0x2620, 0x3000 }, - { 0x9a00, 0x261e, 0x2000 }, - { 0x1a00, 0x261d, 0x0000 }, - { 0x1a00, 0x261f, 0x0000 }, - { 0x9a00, 0x2622, 0x2000 }, - { 0x1a00, 0x2621, 0x0000 }, - { 0x1a00, 0x2623, 0x0000 }, - { 0x9a00, 0x2628, 0x3000 }, - { 0x9a00, 0x2626, 0x2000 }, - { 0x1a00, 0x2625, 0x0000 }, - { 0x1a00, 0x2627, 0x0000 }, - { 0x9a00, 0x262a, 0x2000 }, - { 0x1a00, 0x2629, 0x0000 }, - { 0x1a00, 0x262b, 0x0000 }, - { 0x9a00, 0x263c, 0x5000 }, - { 0x9a00, 0x2634, 0x4000 }, - { 0x9a00, 0x2630, 0x3000 }, - { 0x9a00, 0x262e, 0x2000 }, - { 0x1a00, 0x262d, 0x0000 }, - { 0x1a00, 0x262f, 0x0000 }, - { 0x9a00, 0x2632, 0x2000 }, - { 0x1a00, 0x2631, 0x0000 }, - { 0x1a00, 0x2633, 0x0000 }, - { 0x9a00, 0x2638, 0x3000 }, - { 0x9a00, 0x2636, 0x2000 }, - { 0x1a00, 0x2635, 0x0000 }, - { 0x1a00, 0x2637, 0x0000 }, - { 0x9a00, 0x263a, 0x2000 }, - { 0x1a00, 0x2639, 0x0000 }, - { 0x1a00, 0x263b, 0x0000 }, - { 0x9a00, 0x2644, 0x4000 }, - { 0x9a00, 0x2640, 0x3000 }, - { 0x9a00, 0x263e, 0x2000 }, - { 0x1a00, 0x263d, 0x0000 }, - { 0x1a00, 0x263f, 0x0000 }, - { 0x9a00, 0x2642, 0x2000 }, - { 0x1a00, 0x2641, 0x0000 }, - { 0x1a00, 0x2643, 0x0000 }, - { 0x9a00, 0x2648, 0x3000 }, - { 0x9a00, 0x2646, 0x2000 }, - { 0x1a00, 0x2645, 0x0000 }, - { 0x1a00, 0x2647, 0x0000 }, - { 0x9a00, 0x264a, 0x2000 }, - { 0x1a00, 0x2649, 0x0000 }, - { 0x1a00, 0x264b, 0x0000 }, - { 0x9a00, 0x266c, 0x6000 }, - { 0x9a00, 0x265c, 0x5000 }, - { 0x9a00, 0x2654, 0x4000 }, - { 0x9a00, 0x2650, 0x3000 }, - { 0x9a00, 0x264e, 0x2000 }, - { 0x1a00, 0x264d, 0x0000 }, - { 0x1a00, 0x264f, 0x0000 }, - { 0x9a00, 0x2652, 0x2000 }, - { 0x1a00, 0x2651, 0x0000 }, - { 0x1a00, 0x2653, 0x0000 }, - { 0x9a00, 0x2658, 0x3000 }, - { 0x9a00, 0x2656, 0x2000 }, - { 0x1a00, 0x2655, 0x0000 }, - { 0x1a00, 0x2657, 0x0000 }, - { 0x9a00, 0x265a, 0x2000 }, - { 0x1a00, 0x2659, 0x0000 }, - { 0x1a00, 0x265b, 0x0000 }, - { 0x9a00, 0x2664, 0x4000 }, - { 0x9a00, 0x2660, 0x3000 }, - { 0x9a00, 0x265e, 0x2000 }, - { 0x1a00, 0x265d, 0x0000 }, - { 0x1a00, 0x265f, 0x0000 }, - { 0x9a00, 0x2662, 0x2000 }, - { 0x1a00, 0x2661, 0x0000 }, - { 0x1a00, 0x2663, 0x0000 }, - { 0x9a00, 0x2668, 0x3000 }, - { 0x9a00, 0x2666, 0x2000 }, - { 0x1a00, 0x2665, 0x0000 }, - { 0x1a00, 0x2667, 0x0000 }, - { 0x9a00, 0x266a, 0x2000 }, - { 0x1a00, 0x2669, 0x0000 }, - { 0x1a00, 0x266b, 0x0000 }, - { 0x9a00, 0x267c, 0x5000 }, - { 0x9a00, 0x2674, 0x4000 }, - { 0x9a00, 0x2670, 0x3000 }, - { 0x9a00, 0x266e, 0x2000 }, - { 0x1a00, 0x266d, 0x0000 }, - { 0x1900, 0x266f, 0x0000 }, - { 0x9a00, 0x2672, 0x2000 }, - { 0x1a00, 0x2671, 0x0000 }, - { 0x1a00, 0x2673, 0x0000 }, - { 0x9a00, 0x2678, 0x3000 }, - { 0x9a00, 0x2676, 0x2000 }, - { 0x1a00, 0x2675, 0x0000 }, - { 0x1a00, 0x2677, 0x0000 }, - { 0x9a00, 0x267a, 0x2000 }, - { 0x1a00, 0x2679, 0x0000 }, - { 0x1a00, 0x267b, 0x0000 }, - { 0x9a00, 0x2686, 0x4000 }, - { 0x9a00, 0x2682, 0x3000 }, - { 0x9a00, 0x2680, 0x2000 }, - { 0x1a00, 0x267d, 0x0000 }, - { 0x1a00, 0x2681, 0x0000 }, - { 0x9a00, 0x2684, 0x2000 }, - { 0x1a00, 0x2683, 0x0000 }, - { 0x1a00, 0x2685, 0x0000 }, - { 0x9a00, 0x268a, 0x3000 }, - { 0x9a00, 0x2688, 0x2000 }, - { 0x1a00, 0x2687, 0x0000 }, - { 0x1a00, 0x2689, 0x0000 }, - { 0x9a00, 0x268c, 0x2000 }, - { 0x1a00, 0x268b, 0x0000 }, - { 0x1a00, 0x268d, 0x0000 }, - { 0x9a00, 0x273f, 0x7000 }, - { 0x9a00, 0x271e, 0x6000 }, - { 0x9a00, 0x270e, 0x5000 }, - { 0x9a00, 0x2703, 0x4000 }, - { 0x9a00, 0x26a0, 0x3000 }, - { 0x9a00, 0x2690, 0x2000 }, - { 0x1a00, 0x268f, 0x0000 }, - { 0x1a00, 0x2691, 0x0000 }, - { 0x9a00, 0x2701, 0x2000 }, - { 0x1a00, 0x26a1, 0x0000 }, - { 0x1a00, 0x2702, 0x0000 }, - { 0x9a00, 0x2708, 0x3000 }, - { 0x9a00, 0x2706, 0x2000 }, - { 0x1a00, 0x2704, 0x0000 }, - { 0x1a00, 0x2707, 0x0000 }, - { 0x9a00, 0x270c, 0x2000 }, - { 0x1a00, 0x2709, 0x0000 }, - { 0x1a00, 0x270d, 0x0000 }, - { 0x9a00, 0x2716, 0x4000 }, - { 0x9a00, 0x2712, 0x3000 }, - { 0x9a00, 0x2710, 0x2000 }, - { 0x1a00, 0x270f, 0x0000 }, - { 0x1a00, 0x2711, 0x0000 }, - { 0x9a00, 0x2714, 0x2000 }, - { 0x1a00, 0x2713, 0x0000 }, - { 0x1a00, 0x2715, 0x0000 }, - { 0x9a00, 0x271a, 0x3000 }, - { 0x9a00, 0x2718, 0x2000 }, - { 0x1a00, 0x2717, 0x0000 }, - { 0x1a00, 0x2719, 0x0000 }, - { 0x9a00, 0x271c, 0x2000 }, - { 0x1a00, 0x271b, 0x0000 }, - { 0x1a00, 0x271d, 0x0000 }, - { 0x9a00, 0x272f, 0x5000 }, - { 0x9a00, 0x2726, 0x4000 }, - { 0x9a00, 0x2722, 0x3000 }, - { 0x9a00, 0x2720, 0x2000 }, - { 0x1a00, 0x271f, 0x0000 }, - { 0x1a00, 0x2721, 0x0000 }, - { 0x9a00, 0x2724, 0x2000 }, - { 0x1a00, 0x2723, 0x0000 }, - { 0x1a00, 0x2725, 0x0000 }, - { 0x9a00, 0x272b, 0x3000 }, - { 0x9a00, 0x2729, 0x2000 }, - { 0x1a00, 0x2727, 0x0000 }, - { 0x1a00, 0x272a, 0x0000 }, - { 0x9a00, 0x272d, 0x2000 }, - { 0x1a00, 0x272c, 0x0000 }, - { 0x1a00, 0x272e, 0x0000 }, - { 0x9a00, 0x2737, 0x4000 }, - { 0x9a00, 0x2733, 0x3000 }, - { 0x9a00, 0x2731, 0x2000 }, - { 0x1a00, 0x2730, 0x0000 }, - { 0x1a00, 0x2732, 0x0000 }, - { 0x9a00, 0x2735, 0x2000 }, - { 0x1a00, 0x2734, 0x0000 }, - { 0x1a00, 0x2736, 0x0000 }, - { 0x9a00, 0x273b, 0x3000 }, - { 0x9a00, 0x2739, 0x2000 }, - { 0x1a00, 0x2738, 0x0000 }, - { 0x1a00, 0x273a, 0x0000 }, - { 0x9a00, 0x273d, 0x2000 }, - { 0x1a00, 0x273c, 0x0000 }, - { 0x1a00, 0x273e, 0x0000 }, - { 0x9a00, 0x2767, 0x6000 }, - { 0x9a00, 0x2751, 0x5000 }, - { 0x9a00, 0x2747, 0x4000 }, - { 0x9a00, 0x2743, 0x3000 }, - { 0x9a00, 0x2741, 0x2000 }, - { 0x1a00, 0x2740, 0x0000 }, - { 0x1a00, 0x2742, 0x0000 }, - { 0x9a00, 0x2745, 0x2000 }, - { 0x1a00, 0x2744, 0x0000 }, - { 0x1a00, 0x2746, 0x0000 }, - { 0x9a00, 0x274b, 0x3000 }, - { 0x9a00, 0x2749, 0x2000 }, - { 0x1a00, 0x2748, 0x0000 }, - { 0x1a00, 0x274a, 0x0000 }, - { 0x9a00, 0x274f, 0x2000 }, - { 0x1a00, 0x274d, 0x0000 }, - { 0x1a00, 0x2750, 0x0000 }, - { 0x9a00, 0x275d, 0x4000 }, - { 0x9a00, 0x2759, 0x3000 }, - { 0x9a00, 0x2756, 0x2000 }, - { 0x1a00, 0x2752, 0x0000 }, - { 0x1a00, 0x2758, 0x0000 }, - { 0x9a00, 0x275b, 0x2000 }, - { 0x1a00, 0x275a, 0x0000 }, - { 0x1a00, 0x275c, 0x0000 }, - { 0x9a00, 0x2763, 0x3000 }, - { 0x9a00, 0x2761, 0x2000 }, - { 0x1a00, 0x275e, 0x0000 }, - { 0x1a00, 0x2762, 0x0000 }, - { 0x9a00, 0x2765, 0x2000 }, - { 0x1a00, 0x2764, 0x0000 }, - { 0x1a00, 0x2766, 0x0000 }, - { 0x8f00, 0x2777, 0x5000 }, - { 0x9200, 0x276f, 0x4000 }, - { 0x9200, 0x276b, 0x3000 }, - { 0x9200, 0x2769, 0x2000 }, - { 0x1600, 0x2768, 0x0000 }, - { 0x1600, 0x276a, 0x0000 }, - { 0x9200, 0x276d, 0x2000 }, - { 0x1600, 0x276c, 0x0000 }, - { 0x1600, 0x276e, 0x0000 }, - { 0x9200, 0x2773, 0x3000 }, - { 0x9200, 0x2771, 0x2000 }, - { 0x1600, 0x2770, 0x0000 }, - { 0x1600, 0x2772, 0x0000 }, - { 0x9200, 0x2775, 0x2000 }, - { 0x1600, 0x2774, 0x0000 }, - { 0x0f00, 0x2776, 0x0000 }, - { 0x8f00, 0x277f, 0x4000 }, - { 0x8f00, 0x277b, 0x3000 }, - { 0x8f00, 0x2779, 0x2000 }, - { 0x0f00, 0x2778, 0x0000 }, - { 0x0f00, 0x277a, 0x0000 }, - { 0x8f00, 0x277d, 0x2000 }, - { 0x0f00, 0x277c, 0x0000 }, - { 0x0f00, 0x277e, 0x0000 }, - { 0x8f00, 0x2783, 0x3000 }, - { 0x8f00, 0x2781, 0x2000 }, - { 0x0f00, 0x2780, 0x0000 }, - { 0x0f00, 0x2782, 0x0000 }, - { 0x8f00, 0x2785, 0x2000 }, - { 0x0f00, 0x2784, 0x0000 }, - { 0x0f00, 0x2786, 0x0000 }, - { 0x9900, 0x29a0, 0xa000 }, - { 0x9a00, 0x28a0, 0x9000 }, - { 0x9a00, 0x2820, 0x8000 }, - { 0x9900, 0x27dc, 0x7000 }, - { 0x9a00, 0x27aa, 0x6000 }, - { 0x9a00, 0x279a, 0x5000 }, - { 0x8f00, 0x278f, 0x4000 }, - { 0x8f00, 0x278b, 0x3000 }, - { 0x8f00, 0x2789, 0x2000 }, - { 0x0f00, 0x2788, 0x0000 }, - { 0x0f00, 0x278a, 0x0000 }, - { 0x8f00, 0x278d, 0x2000 }, - { 0x0f00, 0x278c, 0x0000 }, - { 0x0f00, 0x278e, 0x0000 }, - { 0x8f00, 0x2793, 0x3000 }, - { 0x8f00, 0x2791, 0x2000 }, - { 0x0f00, 0x2790, 0x0000 }, - { 0x0f00, 0x2792, 0x0000 }, - { 0x9a00, 0x2798, 0x2000 }, - { 0x1a00, 0x2794, 0x0000 }, - { 0x1a00, 0x2799, 0x0000 }, - { 0x9a00, 0x27a2, 0x4000 }, - { 0x9a00, 0x279e, 0x3000 }, - { 0x9a00, 0x279c, 0x2000 }, - { 0x1a00, 0x279b, 0x0000 }, - { 0x1a00, 0x279d, 0x0000 }, - { 0x9a00, 0x27a0, 0x2000 }, - { 0x1a00, 0x279f, 0x0000 }, - { 0x1a00, 0x27a1, 0x0000 }, - { 0x9a00, 0x27a6, 0x3000 }, - { 0x9a00, 0x27a4, 0x2000 }, - { 0x1a00, 0x27a3, 0x0000 }, - { 0x1a00, 0x27a5, 0x0000 }, - { 0x9a00, 0x27a8, 0x2000 }, - { 0x1a00, 0x27a7, 0x0000 }, - { 0x1a00, 0x27a9, 0x0000 }, - { 0x9a00, 0x27bb, 0x5000 }, - { 0x9a00, 0x27b3, 0x4000 }, - { 0x9a00, 0x27ae, 0x3000 }, - { 0x9a00, 0x27ac, 0x2000 }, - { 0x1a00, 0x27ab, 0x0000 }, - { 0x1a00, 0x27ad, 0x0000 }, - { 0x9a00, 0x27b1, 0x2000 }, - { 0x1a00, 0x27af, 0x0000 }, - { 0x1a00, 0x27b2, 0x0000 }, - { 0x9a00, 0x27b7, 0x3000 }, - { 0x9a00, 0x27b5, 0x2000 }, - { 0x1a00, 0x27b4, 0x0000 }, - { 0x1a00, 0x27b6, 0x0000 }, - { 0x9a00, 0x27b9, 0x2000 }, - { 0x1a00, 0x27b8, 0x0000 }, - { 0x1a00, 0x27ba, 0x0000 }, - { 0x9900, 0x27d4, 0x4000 }, - { 0x9900, 0x27d0, 0x3000 }, - { 0x9a00, 0x27bd, 0x2000 }, - { 0x1a00, 0x27bc, 0x0000 }, - { 0x1a00, 0x27be, 0x0000 }, - { 0x9900, 0x27d2, 0x2000 }, - { 0x1900, 0x27d1, 0x0000 }, - { 0x1900, 0x27d3, 0x0000 }, - { 0x9900, 0x27d8, 0x3000 }, - { 0x9900, 0x27d6, 0x2000 }, - { 0x1900, 0x27d5, 0x0000 }, - { 0x1900, 0x27d7, 0x0000 }, - { 0x9900, 0x27da, 0x2000 }, - { 0x1900, 0x27d9, 0x0000 }, - { 0x1900, 0x27db, 0x0000 }, - { 0x9a00, 0x2800, 0x6000 }, - { 0x9900, 0x27f0, 0x5000 }, - { 0x9900, 0x27e4, 0x4000 }, - { 0x9900, 0x27e0, 0x3000 }, - { 0x9900, 0x27de, 0x2000 }, - { 0x1900, 0x27dd, 0x0000 }, - { 0x1900, 0x27df, 0x0000 }, - { 0x9900, 0x27e2, 0x2000 }, - { 0x1900, 0x27e1, 0x0000 }, - { 0x1900, 0x27e3, 0x0000 }, - { 0x9600, 0x27e8, 0x3000 }, - { 0x9600, 0x27e6, 0x2000 }, - { 0x1900, 0x27e5, 0x0000 }, - { 0x1200, 0x27e7, 0x0000 }, - { 0x9600, 0x27ea, 0x2000 }, - { 0x1200, 0x27e9, 0x0000 }, - { 0x1200, 0x27eb, 0x0000 }, - { 0x9900, 0x27f8, 0x4000 }, - { 0x9900, 0x27f4, 0x3000 }, - { 0x9900, 0x27f2, 0x2000 }, - { 0x1900, 0x27f1, 0x0000 }, - { 0x1900, 0x27f3, 0x0000 }, - { 0x9900, 0x27f6, 0x2000 }, - { 0x1900, 0x27f5, 0x0000 }, - { 0x1900, 0x27f7, 0x0000 }, - { 0x9900, 0x27fc, 0x3000 }, - { 0x9900, 0x27fa, 0x2000 }, - { 0x1900, 0x27f9, 0x0000 }, - { 0x1900, 0x27fb, 0x0000 }, - { 0x9900, 0x27fe, 0x2000 }, - { 0x1900, 0x27fd, 0x0000 }, - { 0x1900, 0x27ff, 0x0000 }, - { 0x9a00, 0x2810, 0x5000 }, - { 0x9a00, 0x2808, 0x4000 }, - { 0x9a00, 0x2804, 0x3000 }, - { 0x9a00, 0x2802, 0x2000 }, - { 0x1a00, 0x2801, 0x0000 }, - { 0x1a00, 0x2803, 0x0000 }, - { 0x9a00, 0x2806, 0x2000 }, - { 0x1a00, 0x2805, 0x0000 }, - { 0x1a00, 0x2807, 0x0000 }, - { 0x9a00, 0x280c, 0x3000 }, - { 0x9a00, 0x280a, 0x2000 }, - { 0x1a00, 0x2809, 0x0000 }, - { 0x1a00, 0x280b, 0x0000 }, - { 0x9a00, 0x280e, 0x2000 }, - { 0x1a00, 0x280d, 0x0000 }, - { 0x1a00, 0x280f, 0x0000 }, - { 0x9a00, 0x2818, 0x4000 }, - { 0x9a00, 0x2814, 0x3000 }, - { 0x9a00, 0x2812, 0x2000 }, - { 0x1a00, 0x2811, 0x0000 }, - { 0x1a00, 0x2813, 0x0000 }, - { 0x9a00, 0x2816, 0x2000 }, - { 0x1a00, 0x2815, 0x0000 }, - { 0x1a00, 0x2817, 0x0000 }, - { 0x9a00, 0x281c, 0x3000 }, - { 0x9a00, 0x281a, 0x2000 }, - { 0x1a00, 0x2819, 0x0000 }, - { 0x1a00, 0x281b, 0x0000 }, - { 0x9a00, 0x281e, 0x2000 }, - { 0x1a00, 0x281d, 0x0000 }, - { 0x1a00, 0x281f, 0x0000 }, - { 0x9a00, 0x2860, 0x7000 }, - { 0x9a00, 0x2840, 0x6000 }, - { 0x9a00, 0x2830, 0x5000 }, - { 0x9a00, 0x2828, 0x4000 }, - { 0x9a00, 0x2824, 0x3000 }, - { 0x9a00, 0x2822, 0x2000 }, - { 0x1a00, 0x2821, 0x0000 }, - { 0x1a00, 0x2823, 0x0000 }, - { 0x9a00, 0x2826, 0x2000 }, - { 0x1a00, 0x2825, 0x0000 }, - { 0x1a00, 0x2827, 0x0000 }, - { 0x9a00, 0x282c, 0x3000 }, - { 0x9a00, 0x282a, 0x2000 }, - { 0x1a00, 0x2829, 0x0000 }, - { 0x1a00, 0x282b, 0x0000 }, - { 0x9a00, 0x282e, 0x2000 }, - { 0x1a00, 0x282d, 0x0000 }, - { 0x1a00, 0x282f, 0x0000 }, - { 0x9a00, 0x2838, 0x4000 }, - { 0x9a00, 0x2834, 0x3000 }, - { 0x9a00, 0x2832, 0x2000 }, - { 0x1a00, 0x2831, 0x0000 }, - { 0x1a00, 0x2833, 0x0000 }, - { 0x9a00, 0x2836, 0x2000 }, - { 0x1a00, 0x2835, 0x0000 }, - { 0x1a00, 0x2837, 0x0000 }, - { 0x9a00, 0x283c, 0x3000 }, - { 0x9a00, 0x283a, 0x2000 }, - { 0x1a00, 0x2839, 0x0000 }, - { 0x1a00, 0x283b, 0x0000 }, - { 0x9a00, 0x283e, 0x2000 }, - { 0x1a00, 0x283d, 0x0000 }, - { 0x1a00, 0x283f, 0x0000 }, - { 0x9a00, 0x2850, 0x5000 }, - { 0x9a00, 0x2848, 0x4000 }, - { 0x9a00, 0x2844, 0x3000 }, - { 0x9a00, 0x2842, 0x2000 }, - { 0x1a00, 0x2841, 0x0000 }, - { 0x1a00, 0x2843, 0x0000 }, - { 0x9a00, 0x2846, 0x2000 }, - { 0x1a00, 0x2845, 0x0000 }, - { 0x1a00, 0x2847, 0x0000 }, - { 0x9a00, 0x284c, 0x3000 }, - { 0x9a00, 0x284a, 0x2000 }, - { 0x1a00, 0x2849, 0x0000 }, - { 0x1a00, 0x284b, 0x0000 }, - { 0x9a00, 0x284e, 0x2000 }, - { 0x1a00, 0x284d, 0x0000 }, - { 0x1a00, 0x284f, 0x0000 }, - { 0x9a00, 0x2858, 0x4000 }, - { 0x9a00, 0x2854, 0x3000 }, - { 0x9a00, 0x2852, 0x2000 }, - { 0x1a00, 0x2851, 0x0000 }, - { 0x1a00, 0x2853, 0x0000 }, - { 0x9a00, 0x2856, 0x2000 }, - { 0x1a00, 0x2855, 0x0000 }, - { 0x1a00, 0x2857, 0x0000 }, - { 0x9a00, 0x285c, 0x3000 }, - { 0x9a00, 0x285a, 0x2000 }, - { 0x1a00, 0x2859, 0x0000 }, - { 0x1a00, 0x285b, 0x0000 }, - { 0x9a00, 0x285e, 0x2000 }, - { 0x1a00, 0x285d, 0x0000 }, - { 0x1a00, 0x285f, 0x0000 }, - { 0x9a00, 0x2880, 0x6000 }, - { 0x9a00, 0x2870, 0x5000 }, - { 0x9a00, 0x2868, 0x4000 }, - { 0x9a00, 0x2864, 0x3000 }, - { 0x9a00, 0x2862, 0x2000 }, - { 0x1a00, 0x2861, 0x0000 }, - { 0x1a00, 0x2863, 0x0000 }, - { 0x9a00, 0x2866, 0x2000 }, - { 0x1a00, 0x2865, 0x0000 }, - { 0x1a00, 0x2867, 0x0000 }, - { 0x9a00, 0x286c, 0x3000 }, - { 0x9a00, 0x286a, 0x2000 }, - { 0x1a00, 0x2869, 0x0000 }, - { 0x1a00, 0x286b, 0x0000 }, - { 0x9a00, 0x286e, 0x2000 }, - { 0x1a00, 0x286d, 0x0000 }, - { 0x1a00, 0x286f, 0x0000 }, - { 0x9a00, 0x2878, 0x4000 }, - { 0x9a00, 0x2874, 0x3000 }, - { 0x9a00, 0x2872, 0x2000 }, - { 0x1a00, 0x2871, 0x0000 }, - { 0x1a00, 0x2873, 0x0000 }, - { 0x9a00, 0x2876, 0x2000 }, - { 0x1a00, 0x2875, 0x0000 }, - { 0x1a00, 0x2877, 0x0000 }, - { 0x9a00, 0x287c, 0x3000 }, - { 0x9a00, 0x287a, 0x2000 }, - { 0x1a00, 0x2879, 0x0000 }, - { 0x1a00, 0x287b, 0x0000 }, - { 0x9a00, 0x287e, 0x2000 }, - { 0x1a00, 0x287d, 0x0000 }, - { 0x1a00, 0x287f, 0x0000 }, - { 0x9a00, 0x2890, 0x5000 }, - { 0x9a00, 0x2888, 0x4000 }, - { 0x9a00, 0x2884, 0x3000 }, - { 0x9a00, 0x2882, 0x2000 }, - { 0x1a00, 0x2881, 0x0000 }, - { 0x1a00, 0x2883, 0x0000 }, - { 0x9a00, 0x2886, 0x2000 }, - { 0x1a00, 0x2885, 0x0000 }, - { 0x1a00, 0x2887, 0x0000 }, - { 0x9a00, 0x288c, 0x3000 }, - { 0x9a00, 0x288a, 0x2000 }, - { 0x1a00, 0x2889, 0x0000 }, - { 0x1a00, 0x288b, 0x0000 }, - { 0x9a00, 0x288e, 0x2000 }, - { 0x1a00, 0x288d, 0x0000 }, - { 0x1a00, 0x288f, 0x0000 }, - { 0x9a00, 0x2898, 0x4000 }, - { 0x9a00, 0x2894, 0x3000 }, - { 0x9a00, 0x2892, 0x2000 }, - { 0x1a00, 0x2891, 0x0000 }, - { 0x1a00, 0x2893, 0x0000 }, - { 0x9a00, 0x2896, 0x2000 }, - { 0x1a00, 0x2895, 0x0000 }, - { 0x1a00, 0x2897, 0x0000 }, - { 0x9a00, 0x289c, 0x3000 }, - { 0x9a00, 0x289a, 0x2000 }, - { 0x1a00, 0x2899, 0x0000 }, - { 0x1a00, 0x289b, 0x0000 }, - { 0x9a00, 0x289e, 0x2000 }, - { 0x1a00, 0x289d, 0x0000 }, - { 0x1a00, 0x289f, 0x0000 }, - { 0x9900, 0x2920, 0x8000 }, - { 0x9a00, 0x28e0, 0x7000 }, - { 0x9a00, 0x28c0, 0x6000 }, - { 0x9a00, 0x28b0, 0x5000 }, - { 0x9a00, 0x28a8, 0x4000 }, - { 0x9a00, 0x28a4, 0x3000 }, - { 0x9a00, 0x28a2, 0x2000 }, - { 0x1a00, 0x28a1, 0x0000 }, - { 0x1a00, 0x28a3, 0x0000 }, - { 0x9a00, 0x28a6, 0x2000 }, - { 0x1a00, 0x28a5, 0x0000 }, - { 0x1a00, 0x28a7, 0x0000 }, - { 0x9a00, 0x28ac, 0x3000 }, - { 0x9a00, 0x28aa, 0x2000 }, - { 0x1a00, 0x28a9, 0x0000 }, - { 0x1a00, 0x28ab, 0x0000 }, - { 0x9a00, 0x28ae, 0x2000 }, - { 0x1a00, 0x28ad, 0x0000 }, - { 0x1a00, 0x28af, 0x0000 }, - { 0x9a00, 0x28b8, 0x4000 }, - { 0x9a00, 0x28b4, 0x3000 }, - { 0x9a00, 0x28b2, 0x2000 }, - { 0x1a00, 0x28b1, 0x0000 }, - { 0x1a00, 0x28b3, 0x0000 }, - { 0x9a00, 0x28b6, 0x2000 }, - { 0x1a00, 0x28b5, 0x0000 }, - { 0x1a00, 0x28b7, 0x0000 }, - { 0x9a00, 0x28bc, 0x3000 }, - { 0x9a00, 0x28ba, 0x2000 }, - { 0x1a00, 0x28b9, 0x0000 }, - { 0x1a00, 0x28bb, 0x0000 }, - { 0x9a00, 0x28be, 0x2000 }, - { 0x1a00, 0x28bd, 0x0000 }, - { 0x1a00, 0x28bf, 0x0000 }, - { 0x9a00, 0x28d0, 0x5000 }, - { 0x9a00, 0x28c8, 0x4000 }, - { 0x9a00, 0x28c4, 0x3000 }, - { 0x9a00, 0x28c2, 0x2000 }, - { 0x1a00, 0x28c1, 0x0000 }, - { 0x1a00, 0x28c3, 0x0000 }, - { 0x9a00, 0x28c6, 0x2000 }, - { 0x1a00, 0x28c5, 0x0000 }, - { 0x1a00, 0x28c7, 0x0000 }, - { 0x9a00, 0x28cc, 0x3000 }, - { 0x9a00, 0x28ca, 0x2000 }, - { 0x1a00, 0x28c9, 0x0000 }, - { 0x1a00, 0x28cb, 0x0000 }, - { 0x9a00, 0x28ce, 0x2000 }, - { 0x1a00, 0x28cd, 0x0000 }, - { 0x1a00, 0x28cf, 0x0000 }, - { 0x9a00, 0x28d8, 0x4000 }, - { 0x9a00, 0x28d4, 0x3000 }, - { 0x9a00, 0x28d2, 0x2000 }, - { 0x1a00, 0x28d1, 0x0000 }, - { 0x1a00, 0x28d3, 0x0000 }, - { 0x9a00, 0x28d6, 0x2000 }, - { 0x1a00, 0x28d5, 0x0000 }, - { 0x1a00, 0x28d7, 0x0000 }, - { 0x9a00, 0x28dc, 0x3000 }, - { 0x9a00, 0x28da, 0x2000 }, - { 0x1a00, 0x28d9, 0x0000 }, - { 0x1a00, 0x28db, 0x0000 }, - { 0x9a00, 0x28de, 0x2000 }, - { 0x1a00, 0x28dd, 0x0000 }, - { 0x1a00, 0x28df, 0x0000 }, - { 0x9900, 0x2900, 0x6000 }, - { 0x9a00, 0x28f0, 0x5000 }, - { 0x9a00, 0x28e8, 0x4000 }, - { 0x9a00, 0x28e4, 0x3000 }, - { 0x9a00, 0x28e2, 0x2000 }, - { 0x1a00, 0x28e1, 0x0000 }, - { 0x1a00, 0x28e3, 0x0000 }, - { 0x9a00, 0x28e6, 0x2000 }, - { 0x1a00, 0x28e5, 0x0000 }, - { 0x1a00, 0x28e7, 0x0000 }, - { 0x9a00, 0x28ec, 0x3000 }, - { 0x9a00, 0x28ea, 0x2000 }, - { 0x1a00, 0x28e9, 0x0000 }, - { 0x1a00, 0x28eb, 0x0000 }, - { 0x9a00, 0x28ee, 0x2000 }, - { 0x1a00, 0x28ed, 0x0000 }, - { 0x1a00, 0x28ef, 0x0000 }, - { 0x9a00, 0x28f8, 0x4000 }, - { 0x9a00, 0x28f4, 0x3000 }, - { 0x9a00, 0x28f2, 0x2000 }, - { 0x1a00, 0x28f1, 0x0000 }, - { 0x1a00, 0x28f3, 0x0000 }, - { 0x9a00, 0x28f6, 0x2000 }, - { 0x1a00, 0x28f5, 0x0000 }, - { 0x1a00, 0x28f7, 0x0000 }, - { 0x9a00, 0x28fc, 0x3000 }, - { 0x9a00, 0x28fa, 0x2000 }, - { 0x1a00, 0x28f9, 0x0000 }, - { 0x1a00, 0x28fb, 0x0000 }, - { 0x9a00, 0x28fe, 0x2000 }, - { 0x1a00, 0x28fd, 0x0000 }, - { 0x1a00, 0x28ff, 0x0000 }, - { 0x9900, 0x2910, 0x5000 }, - { 0x9900, 0x2908, 0x4000 }, - { 0x9900, 0x2904, 0x3000 }, - { 0x9900, 0x2902, 0x2000 }, - { 0x1900, 0x2901, 0x0000 }, - { 0x1900, 0x2903, 0x0000 }, - { 0x9900, 0x2906, 0x2000 }, - { 0x1900, 0x2905, 0x0000 }, - { 0x1900, 0x2907, 0x0000 }, - { 0x9900, 0x290c, 0x3000 }, - { 0x9900, 0x290a, 0x2000 }, - { 0x1900, 0x2909, 0x0000 }, - { 0x1900, 0x290b, 0x0000 }, - { 0x9900, 0x290e, 0x2000 }, - { 0x1900, 0x290d, 0x0000 }, - { 0x1900, 0x290f, 0x0000 }, - { 0x9900, 0x2918, 0x4000 }, - { 0x9900, 0x2914, 0x3000 }, - { 0x9900, 0x2912, 0x2000 }, - { 0x1900, 0x2911, 0x0000 }, - { 0x1900, 0x2913, 0x0000 }, - { 0x9900, 0x2916, 0x2000 }, - { 0x1900, 0x2915, 0x0000 }, - { 0x1900, 0x2917, 0x0000 }, - { 0x9900, 0x291c, 0x3000 }, - { 0x9900, 0x291a, 0x2000 }, - { 0x1900, 0x2919, 0x0000 }, - { 0x1900, 0x291b, 0x0000 }, - { 0x9900, 0x291e, 0x2000 }, - { 0x1900, 0x291d, 0x0000 }, - { 0x1900, 0x291f, 0x0000 }, - { 0x9900, 0x2960, 0x7000 }, - { 0x9900, 0x2940, 0x6000 }, - { 0x9900, 0x2930, 0x5000 }, - { 0x9900, 0x2928, 0x4000 }, - { 0x9900, 0x2924, 0x3000 }, - { 0x9900, 0x2922, 0x2000 }, - { 0x1900, 0x2921, 0x0000 }, - { 0x1900, 0x2923, 0x0000 }, - { 0x9900, 0x2926, 0x2000 }, - { 0x1900, 0x2925, 0x0000 }, - { 0x1900, 0x2927, 0x0000 }, - { 0x9900, 0x292c, 0x3000 }, - { 0x9900, 0x292a, 0x2000 }, - { 0x1900, 0x2929, 0x0000 }, - { 0x1900, 0x292b, 0x0000 }, - { 0x9900, 0x292e, 0x2000 }, - { 0x1900, 0x292d, 0x0000 }, - { 0x1900, 0x292f, 0x0000 }, - { 0x9900, 0x2938, 0x4000 }, - { 0x9900, 0x2934, 0x3000 }, - { 0x9900, 0x2932, 0x2000 }, - { 0x1900, 0x2931, 0x0000 }, - { 0x1900, 0x2933, 0x0000 }, - { 0x9900, 0x2936, 0x2000 }, - { 0x1900, 0x2935, 0x0000 }, - { 0x1900, 0x2937, 0x0000 }, - { 0x9900, 0x293c, 0x3000 }, - { 0x9900, 0x293a, 0x2000 }, - { 0x1900, 0x2939, 0x0000 }, - { 0x1900, 0x293b, 0x0000 }, - { 0x9900, 0x293e, 0x2000 }, - { 0x1900, 0x293d, 0x0000 }, - { 0x1900, 0x293f, 0x0000 }, - { 0x9900, 0x2950, 0x5000 }, - { 0x9900, 0x2948, 0x4000 }, - { 0x9900, 0x2944, 0x3000 }, - { 0x9900, 0x2942, 0x2000 }, - { 0x1900, 0x2941, 0x0000 }, - { 0x1900, 0x2943, 0x0000 }, - { 0x9900, 0x2946, 0x2000 }, - { 0x1900, 0x2945, 0x0000 }, - { 0x1900, 0x2947, 0x0000 }, - { 0x9900, 0x294c, 0x3000 }, - { 0x9900, 0x294a, 0x2000 }, - { 0x1900, 0x2949, 0x0000 }, - { 0x1900, 0x294b, 0x0000 }, - { 0x9900, 0x294e, 0x2000 }, - { 0x1900, 0x294d, 0x0000 }, - { 0x1900, 0x294f, 0x0000 }, - { 0x9900, 0x2958, 0x4000 }, - { 0x9900, 0x2954, 0x3000 }, - { 0x9900, 0x2952, 0x2000 }, - { 0x1900, 0x2951, 0x0000 }, - { 0x1900, 0x2953, 0x0000 }, - { 0x9900, 0x2956, 0x2000 }, - { 0x1900, 0x2955, 0x0000 }, - { 0x1900, 0x2957, 0x0000 }, - { 0x9900, 0x295c, 0x3000 }, - { 0x9900, 0x295a, 0x2000 }, - { 0x1900, 0x2959, 0x0000 }, - { 0x1900, 0x295b, 0x0000 }, - { 0x9900, 0x295e, 0x2000 }, - { 0x1900, 0x295d, 0x0000 }, - { 0x1900, 0x295f, 0x0000 }, - { 0x9900, 0x2980, 0x6000 }, - { 0x9900, 0x2970, 0x5000 }, - { 0x9900, 0x2968, 0x4000 }, - { 0x9900, 0x2964, 0x3000 }, - { 0x9900, 0x2962, 0x2000 }, - { 0x1900, 0x2961, 0x0000 }, - { 0x1900, 0x2963, 0x0000 }, - { 0x9900, 0x2966, 0x2000 }, - { 0x1900, 0x2965, 0x0000 }, - { 0x1900, 0x2967, 0x0000 }, - { 0x9900, 0x296c, 0x3000 }, - { 0x9900, 0x296a, 0x2000 }, - { 0x1900, 0x2969, 0x0000 }, - { 0x1900, 0x296b, 0x0000 }, - { 0x9900, 0x296e, 0x2000 }, - { 0x1900, 0x296d, 0x0000 }, - { 0x1900, 0x296f, 0x0000 }, - { 0x9900, 0x2978, 0x4000 }, - { 0x9900, 0x2974, 0x3000 }, - { 0x9900, 0x2972, 0x2000 }, - { 0x1900, 0x2971, 0x0000 }, - { 0x1900, 0x2973, 0x0000 }, - { 0x9900, 0x2976, 0x2000 }, - { 0x1900, 0x2975, 0x0000 }, - { 0x1900, 0x2977, 0x0000 }, - { 0x9900, 0x297c, 0x3000 }, - { 0x9900, 0x297a, 0x2000 }, - { 0x1900, 0x2979, 0x0000 }, - { 0x1900, 0x297b, 0x0000 }, - { 0x9900, 0x297e, 0x2000 }, - { 0x1900, 0x297d, 0x0000 }, - { 0x1900, 0x297f, 0x0000 }, - { 0x9200, 0x2990, 0x5000 }, - { 0x9200, 0x2988, 0x4000 }, - { 0x9200, 0x2984, 0x3000 }, - { 0x9900, 0x2982, 0x2000 }, - { 0x1900, 0x2981, 0x0000 }, - { 0x1600, 0x2983, 0x0000 }, - { 0x9200, 0x2986, 0x2000 }, - { 0x1600, 0x2985, 0x0000 }, - { 0x1600, 0x2987, 0x0000 }, - { 0x9200, 0x298c, 0x3000 }, - { 0x9200, 0x298a, 0x2000 }, - { 0x1600, 0x2989, 0x0000 }, - { 0x1600, 0x298b, 0x0000 }, - { 0x9200, 0x298e, 0x2000 }, - { 0x1600, 0x298d, 0x0000 }, - { 0x1600, 0x298f, 0x0000 }, - { 0x9200, 0x2998, 0x4000 }, - { 0x9200, 0x2994, 0x3000 }, - { 0x9200, 0x2992, 0x2000 }, - { 0x1600, 0x2991, 0x0000 }, - { 0x1600, 0x2993, 0x0000 }, - { 0x9200, 0x2996, 0x2000 }, - { 0x1600, 0x2995, 0x0000 }, - { 0x1600, 0x2997, 0x0000 }, - { 0x9900, 0x299c, 0x3000 }, - { 0x9900, 0x299a, 0x2000 }, - { 0x1900, 0x2999, 0x0000 }, - { 0x1900, 0x299b, 0x0000 }, - { 0x9900, 0x299e, 0x2000 }, - { 0x1900, 0x299d, 0x0000 }, - { 0x1900, 0x299f, 0x0000 }, - { 0x9900, 0x2aa0, 0x9000 }, - { 0x9900, 0x2a20, 0x8000 }, - { 0x9900, 0x29e0, 0x7000 }, - { 0x9900, 0x29c0, 0x6000 }, - { 0x9900, 0x29b0, 0x5000 }, - { 0x9900, 0x29a8, 0x4000 }, - { 0x9900, 0x29a4, 0x3000 }, - { 0x9900, 0x29a2, 0x2000 }, - { 0x1900, 0x29a1, 0x0000 }, - { 0x1900, 0x29a3, 0x0000 }, - { 0x9900, 0x29a6, 0x2000 }, - { 0x1900, 0x29a5, 0x0000 }, - { 0x1900, 0x29a7, 0x0000 }, - { 0x9900, 0x29ac, 0x3000 }, - { 0x9900, 0x29aa, 0x2000 }, - { 0x1900, 0x29a9, 0x0000 }, - { 0x1900, 0x29ab, 0x0000 }, - { 0x9900, 0x29ae, 0x2000 }, - { 0x1900, 0x29ad, 0x0000 }, - { 0x1900, 0x29af, 0x0000 }, - { 0x9900, 0x29b8, 0x4000 }, - { 0x9900, 0x29b4, 0x3000 }, - { 0x9900, 0x29b2, 0x2000 }, - { 0x1900, 0x29b1, 0x0000 }, - { 0x1900, 0x29b3, 0x0000 }, - { 0x9900, 0x29b6, 0x2000 }, - { 0x1900, 0x29b5, 0x0000 }, - { 0x1900, 0x29b7, 0x0000 }, - { 0x9900, 0x29bc, 0x3000 }, - { 0x9900, 0x29ba, 0x2000 }, - { 0x1900, 0x29b9, 0x0000 }, - { 0x1900, 0x29bb, 0x0000 }, - { 0x9900, 0x29be, 0x2000 }, - { 0x1900, 0x29bd, 0x0000 }, - { 0x1900, 0x29bf, 0x0000 }, - { 0x9900, 0x29d0, 0x5000 }, - { 0x9900, 0x29c8, 0x4000 }, - { 0x9900, 0x29c4, 0x3000 }, - { 0x9900, 0x29c2, 0x2000 }, - { 0x1900, 0x29c1, 0x0000 }, - { 0x1900, 0x29c3, 0x0000 }, - { 0x9900, 0x29c6, 0x2000 }, - { 0x1900, 0x29c5, 0x0000 }, - { 0x1900, 0x29c7, 0x0000 }, - { 0x9900, 0x29cc, 0x3000 }, - { 0x9900, 0x29ca, 0x2000 }, - { 0x1900, 0x29c9, 0x0000 }, - { 0x1900, 0x29cb, 0x0000 }, - { 0x9900, 0x29ce, 0x2000 }, - { 0x1900, 0x29cd, 0x0000 }, - { 0x1900, 0x29cf, 0x0000 }, - { 0x9600, 0x29d8, 0x4000 }, - { 0x9900, 0x29d4, 0x3000 }, - { 0x9900, 0x29d2, 0x2000 }, - { 0x1900, 0x29d1, 0x0000 }, - { 0x1900, 0x29d3, 0x0000 }, - { 0x9900, 0x29d6, 0x2000 }, - { 0x1900, 0x29d5, 0x0000 }, - { 0x1900, 0x29d7, 0x0000 }, - { 0x9900, 0x29dc, 0x3000 }, - { 0x9600, 0x29da, 0x2000 }, - { 0x1200, 0x29d9, 0x0000 }, - { 0x1200, 0x29db, 0x0000 }, - { 0x9900, 0x29de, 0x2000 }, - { 0x1900, 0x29dd, 0x0000 }, - { 0x1900, 0x29df, 0x0000 }, - { 0x9900, 0x2a00, 0x6000 }, - { 0x9900, 0x29f0, 0x5000 }, - { 0x9900, 0x29e8, 0x4000 }, - { 0x9900, 0x29e4, 0x3000 }, - { 0x9900, 0x29e2, 0x2000 }, - { 0x1900, 0x29e1, 0x0000 }, - { 0x1900, 0x29e3, 0x0000 }, - { 0x9900, 0x29e6, 0x2000 }, - { 0x1900, 0x29e5, 0x0000 }, - { 0x1900, 0x29e7, 0x0000 }, - { 0x9900, 0x29ec, 0x3000 }, - { 0x9900, 0x29ea, 0x2000 }, - { 0x1900, 0x29e9, 0x0000 }, - { 0x1900, 0x29eb, 0x0000 }, - { 0x9900, 0x29ee, 0x2000 }, - { 0x1900, 0x29ed, 0x0000 }, - { 0x1900, 0x29ef, 0x0000 }, - { 0x9900, 0x29f8, 0x4000 }, - { 0x9900, 0x29f4, 0x3000 }, - { 0x9900, 0x29f2, 0x2000 }, - { 0x1900, 0x29f1, 0x0000 }, - { 0x1900, 0x29f3, 0x0000 }, - { 0x9900, 0x29f6, 0x2000 }, - { 0x1900, 0x29f5, 0x0000 }, - { 0x1900, 0x29f7, 0x0000 }, - { 0x9600, 0x29fc, 0x3000 }, - { 0x9900, 0x29fa, 0x2000 }, - { 0x1900, 0x29f9, 0x0000 }, - { 0x1900, 0x29fb, 0x0000 }, - { 0x9900, 0x29fe, 0x2000 }, - { 0x1200, 0x29fd, 0x0000 }, - { 0x1900, 0x29ff, 0x0000 }, - { 0x9900, 0x2a10, 0x5000 }, - { 0x9900, 0x2a08, 0x4000 }, - { 0x9900, 0x2a04, 0x3000 }, - { 0x9900, 0x2a02, 0x2000 }, - { 0x1900, 0x2a01, 0x0000 }, - { 0x1900, 0x2a03, 0x0000 }, - { 0x9900, 0x2a06, 0x2000 }, - { 0x1900, 0x2a05, 0x0000 }, - { 0x1900, 0x2a07, 0x0000 }, - { 0x9900, 0x2a0c, 0x3000 }, - { 0x9900, 0x2a0a, 0x2000 }, - { 0x1900, 0x2a09, 0x0000 }, - { 0x1900, 0x2a0b, 0x0000 }, - { 0x9900, 0x2a0e, 0x2000 }, - { 0x1900, 0x2a0d, 0x0000 }, - { 0x1900, 0x2a0f, 0x0000 }, - { 0x9900, 0x2a18, 0x4000 }, - { 0x9900, 0x2a14, 0x3000 }, - { 0x9900, 0x2a12, 0x2000 }, - { 0x1900, 0x2a11, 0x0000 }, - { 0x1900, 0x2a13, 0x0000 }, - { 0x9900, 0x2a16, 0x2000 }, - { 0x1900, 0x2a15, 0x0000 }, - { 0x1900, 0x2a17, 0x0000 }, - { 0x9900, 0x2a1c, 0x3000 }, - { 0x9900, 0x2a1a, 0x2000 }, - { 0x1900, 0x2a19, 0x0000 }, - { 0x1900, 0x2a1b, 0x0000 }, - { 0x9900, 0x2a1e, 0x2000 }, - { 0x1900, 0x2a1d, 0x0000 }, - { 0x1900, 0x2a1f, 0x0000 }, - { 0x9900, 0x2a60, 0x7000 }, - { 0x9900, 0x2a40, 0x6000 }, - { 0x9900, 0x2a30, 0x5000 }, - { 0x9900, 0x2a28, 0x4000 }, - { 0x9900, 0x2a24, 0x3000 }, - { 0x9900, 0x2a22, 0x2000 }, - { 0x1900, 0x2a21, 0x0000 }, - { 0x1900, 0x2a23, 0x0000 }, - { 0x9900, 0x2a26, 0x2000 }, - { 0x1900, 0x2a25, 0x0000 }, - { 0x1900, 0x2a27, 0x0000 }, - { 0x9900, 0x2a2c, 0x3000 }, - { 0x9900, 0x2a2a, 0x2000 }, - { 0x1900, 0x2a29, 0x0000 }, - { 0x1900, 0x2a2b, 0x0000 }, - { 0x9900, 0x2a2e, 0x2000 }, - { 0x1900, 0x2a2d, 0x0000 }, - { 0x1900, 0x2a2f, 0x0000 }, - { 0x9900, 0x2a38, 0x4000 }, - { 0x9900, 0x2a34, 0x3000 }, - { 0x9900, 0x2a32, 0x2000 }, - { 0x1900, 0x2a31, 0x0000 }, - { 0x1900, 0x2a33, 0x0000 }, - { 0x9900, 0x2a36, 0x2000 }, - { 0x1900, 0x2a35, 0x0000 }, - { 0x1900, 0x2a37, 0x0000 }, - { 0x9900, 0x2a3c, 0x3000 }, - { 0x9900, 0x2a3a, 0x2000 }, - { 0x1900, 0x2a39, 0x0000 }, - { 0x1900, 0x2a3b, 0x0000 }, - { 0x9900, 0x2a3e, 0x2000 }, - { 0x1900, 0x2a3d, 0x0000 }, - { 0x1900, 0x2a3f, 0x0000 }, - { 0x9900, 0x2a50, 0x5000 }, - { 0x9900, 0x2a48, 0x4000 }, - { 0x9900, 0x2a44, 0x3000 }, - { 0x9900, 0x2a42, 0x2000 }, - { 0x1900, 0x2a41, 0x0000 }, - { 0x1900, 0x2a43, 0x0000 }, - { 0x9900, 0x2a46, 0x2000 }, - { 0x1900, 0x2a45, 0x0000 }, - { 0x1900, 0x2a47, 0x0000 }, - { 0x9900, 0x2a4c, 0x3000 }, - { 0x9900, 0x2a4a, 0x2000 }, - { 0x1900, 0x2a49, 0x0000 }, - { 0x1900, 0x2a4b, 0x0000 }, - { 0x9900, 0x2a4e, 0x2000 }, - { 0x1900, 0x2a4d, 0x0000 }, - { 0x1900, 0x2a4f, 0x0000 }, - { 0x9900, 0x2a58, 0x4000 }, - { 0x9900, 0x2a54, 0x3000 }, - { 0x9900, 0x2a52, 0x2000 }, - { 0x1900, 0x2a51, 0x0000 }, - { 0x1900, 0x2a53, 0x0000 }, - { 0x9900, 0x2a56, 0x2000 }, - { 0x1900, 0x2a55, 0x0000 }, - { 0x1900, 0x2a57, 0x0000 }, - { 0x9900, 0x2a5c, 0x3000 }, - { 0x9900, 0x2a5a, 0x2000 }, - { 0x1900, 0x2a59, 0x0000 }, - { 0x1900, 0x2a5b, 0x0000 }, - { 0x9900, 0x2a5e, 0x2000 }, - { 0x1900, 0x2a5d, 0x0000 }, - { 0x1900, 0x2a5f, 0x0000 }, - { 0x9900, 0x2a80, 0x6000 }, - { 0x9900, 0x2a70, 0x5000 }, - { 0x9900, 0x2a68, 0x4000 }, - { 0x9900, 0x2a64, 0x3000 }, - { 0x9900, 0x2a62, 0x2000 }, - { 0x1900, 0x2a61, 0x0000 }, - { 0x1900, 0x2a63, 0x0000 }, - { 0x9900, 0x2a66, 0x2000 }, - { 0x1900, 0x2a65, 0x0000 }, - { 0x1900, 0x2a67, 0x0000 }, - { 0x9900, 0x2a6c, 0x3000 }, - { 0x9900, 0x2a6a, 0x2000 }, - { 0x1900, 0x2a69, 0x0000 }, - { 0x1900, 0x2a6b, 0x0000 }, - { 0x9900, 0x2a6e, 0x2000 }, - { 0x1900, 0x2a6d, 0x0000 }, - { 0x1900, 0x2a6f, 0x0000 }, - { 0x9900, 0x2a78, 0x4000 }, - { 0x9900, 0x2a74, 0x3000 }, - { 0x9900, 0x2a72, 0x2000 }, - { 0x1900, 0x2a71, 0x0000 }, - { 0x1900, 0x2a73, 0x0000 }, - { 0x9900, 0x2a76, 0x2000 }, - { 0x1900, 0x2a75, 0x0000 }, - { 0x1900, 0x2a77, 0x0000 }, - { 0x9900, 0x2a7c, 0x3000 }, - { 0x9900, 0x2a7a, 0x2000 }, - { 0x1900, 0x2a79, 0x0000 }, - { 0x1900, 0x2a7b, 0x0000 }, - { 0x9900, 0x2a7e, 0x2000 }, - { 0x1900, 0x2a7d, 0x0000 }, - { 0x1900, 0x2a7f, 0x0000 }, - { 0x9900, 0x2a90, 0x5000 }, - { 0x9900, 0x2a88, 0x4000 }, - { 0x9900, 0x2a84, 0x3000 }, - { 0x9900, 0x2a82, 0x2000 }, - { 0x1900, 0x2a81, 0x0000 }, - { 0x1900, 0x2a83, 0x0000 }, - { 0x9900, 0x2a86, 0x2000 }, - { 0x1900, 0x2a85, 0x0000 }, - { 0x1900, 0x2a87, 0x0000 }, - { 0x9900, 0x2a8c, 0x3000 }, - { 0x9900, 0x2a8a, 0x2000 }, - { 0x1900, 0x2a89, 0x0000 }, - { 0x1900, 0x2a8b, 0x0000 }, - { 0x9900, 0x2a8e, 0x2000 }, - { 0x1900, 0x2a8d, 0x0000 }, - { 0x1900, 0x2a8f, 0x0000 }, - { 0x9900, 0x2a98, 0x4000 }, - { 0x9900, 0x2a94, 0x3000 }, - { 0x9900, 0x2a92, 0x2000 }, - { 0x1900, 0x2a91, 0x0000 }, - { 0x1900, 0x2a93, 0x0000 }, - { 0x9900, 0x2a96, 0x2000 }, - { 0x1900, 0x2a95, 0x0000 }, - { 0x1900, 0x2a97, 0x0000 }, - { 0x9900, 0x2a9c, 0x3000 }, - { 0x9900, 0x2a9a, 0x2000 }, - { 0x1900, 0x2a99, 0x0000 }, - { 0x1900, 0x2a9b, 0x0000 }, - { 0x9900, 0x2a9e, 0x2000 }, - { 0x1900, 0x2a9d, 0x0000 }, - { 0x1900, 0x2a9f, 0x0000 }, - { 0x9a00, 0x2e92, 0x8000 }, - { 0x9900, 0x2ae0, 0x7000 }, - { 0x9900, 0x2ac0, 0x6000 }, - { 0x9900, 0x2ab0, 0x5000 }, - { 0x9900, 0x2aa8, 0x4000 }, - { 0x9900, 0x2aa4, 0x3000 }, - { 0x9900, 0x2aa2, 0x2000 }, - { 0x1900, 0x2aa1, 0x0000 }, - { 0x1900, 0x2aa3, 0x0000 }, - { 0x9900, 0x2aa6, 0x2000 }, - { 0x1900, 0x2aa5, 0x0000 }, - { 0x1900, 0x2aa7, 0x0000 }, - { 0x9900, 0x2aac, 0x3000 }, - { 0x9900, 0x2aaa, 0x2000 }, - { 0x1900, 0x2aa9, 0x0000 }, - { 0x1900, 0x2aab, 0x0000 }, - { 0x9900, 0x2aae, 0x2000 }, - { 0x1900, 0x2aad, 0x0000 }, - { 0x1900, 0x2aaf, 0x0000 }, - { 0x9900, 0x2ab8, 0x4000 }, - { 0x9900, 0x2ab4, 0x3000 }, - { 0x9900, 0x2ab2, 0x2000 }, - { 0x1900, 0x2ab1, 0x0000 }, - { 0x1900, 0x2ab3, 0x0000 }, - { 0x9900, 0x2ab6, 0x2000 }, - { 0x1900, 0x2ab5, 0x0000 }, - { 0x1900, 0x2ab7, 0x0000 }, - { 0x9900, 0x2abc, 0x3000 }, - { 0x9900, 0x2aba, 0x2000 }, - { 0x1900, 0x2ab9, 0x0000 }, - { 0x1900, 0x2abb, 0x0000 }, - { 0x9900, 0x2abe, 0x2000 }, - { 0x1900, 0x2abd, 0x0000 }, - { 0x1900, 0x2abf, 0x0000 }, - { 0x9900, 0x2ad0, 0x5000 }, - { 0x9900, 0x2ac8, 0x4000 }, - { 0x9900, 0x2ac4, 0x3000 }, - { 0x9900, 0x2ac2, 0x2000 }, - { 0x1900, 0x2ac1, 0x0000 }, - { 0x1900, 0x2ac3, 0x0000 }, - { 0x9900, 0x2ac6, 0x2000 }, - { 0x1900, 0x2ac5, 0x0000 }, - { 0x1900, 0x2ac7, 0x0000 }, - { 0x9900, 0x2acc, 0x3000 }, - { 0x9900, 0x2aca, 0x2000 }, - { 0x1900, 0x2ac9, 0x0000 }, - { 0x1900, 0x2acb, 0x0000 }, - { 0x9900, 0x2ace, 0x2000 }, - { 0x1900, 0x2acd, 0x0000 }, - { 0x1900, 0x2acf, 0x0000 }, - { 0x9900, 0x2ad8, 0x4000 }, - { 0x9900, 0x2ad4, 0x3000 }, - { 0x9900, 0x2ad2, 0x2000 }, - { 0x1900, 0x2ad1, 0x0000 }, - { 0x1900, 0x2ad3, 0x0000 }, - { 0x9900, 0x2ad6, 0x2000 }, - { 0x1900, 0x2ad5, 0x0000 }, - { 0x1900, 0x2ad7, 0x0000 }, - { 0x9900, 0x2adc, 0x3000 }, - { 0x9900, 0x2ada, 0x2000 }, - { 0x1900, 0x2ad9, 0x0000 }, - { 0x1900, 0x2adb, 0x0000 }, - { 0x9900, 0x2ade, 0x2000 }, - { 0x1900, 0x2add, 0x0000 }, - { 0x1900, 0x2adf, 0x0000 }, - { 0x9a00, 0x2b00, 0x6000 }, - { 0x9900, 0x2af0, 0x5000 }, - { 0x9900, 0x2ae8, 0x4000 }, - { 0x9900, 0x2ae4, 0x3000 }, - { 0x9900, 0x2ae2, 0x2000 }, - { 0x1900, 0x2ae1, 0x0000 }, - { 0x1900, 0x2ae3, 0x0000 }, - { 0x9900, 0x2ae6, 0x2000 }, - { 0x1900, 0x2ae5, 0x0000 }, - { 0x1900, 0x2ae7, 0x0000 }, - { 0x9900, 0x2aec, 0x3000 }, - { 0x9900, 0x2aea, 0x2000 }, - { 0x1900, 0x2ae9, 0x0000 }, - { 0x1900, 0x2aeb, 0x0000 }, - { 0x9900, 0x2aee, 0x2000 }, - { 0x1900, 0x2aed, 0x0000 }, - { 0x1900, 0x2aef, 0x0000 }, - { 0x9900, 0x2af8, 0x4000 }, - { 0x9900, 0x2af4, 0x3000 }, - { 0x9900, 0x2af2, 0x2000 }, - { 0x1900, 0x2af1, 0x0000 }, - { 0x1900, 0x2af3, 0x0000 }, - { 0x9900, 0x2af6, 0x2000 }, - { 0x1900, 0x2af5, 0x0000 }, - { 0x1900, 0x2af7, 0x0000 }, - { 0x9900, 0x2afc, 0x3000 }, - { 0x9900, 0x2afa, 0x2000 }, - { 0x1900, 0x2af9, 0x0000 }, - { 0x1900, 0x2afb, 0x0000 }, - { 0x9900, 0x2afe, 0x2000 }, - { 0x1900, 0x2afd, 0x0000 }, - { 0x1900, 0x2aff, 0x0000 }, - { 0x9a00, 0x2e82, 0x5000 }, - { 0x9a00, 0x2b08, 0x4000 }, - { 0x9a00, 0x2b04, 0x3000 }, - { 0x9a00, 0x2b02, 0x2000 }, - { 0x1a00, 0x2b01, 0x0000 }, - { 0x1a00, 0x2b03, 0x0000 }, - { 0x9a00, 0x2b06, 0x2000 }, - { 0x1a00, 0x2b05, 0x0000 }, - { 0x1a00, 0x2b07, 0x0000 }, - { 0x9a00, 0x2b0c, 0x3000 }, - { 0x9a00, 0x2b0a, 0x2000 }, - { 0x1a00, 0x2b09, 0x0000 }, - { 0x1a00, 0x2b0b, 0x0000 }, - { 0x9a00, 0x2e80, 0x2000 }, - { 0x1a00, 0x2b0d, 0x0000 }, - { 0x1a00, 0x2e81, 0x0000 }, - { 0x9a00, 0x2e8a, 0x4000 }, - { 0x9a00, 0x2e86, 0x3000 }, - { 0x9a00, 0x2e84, 0x2000 }, - { 0x1a00, 0x2e83, 0x0000 }, - { 0x1a00, 0x2e85, 0x0000 }, - { 0x9a00, 0x2e88, 0x2000 }, - { 0x1a00, 0x2e87, 0x0000 }, - { 0x1a00, 0x2e89, 0x0000 }, - { 0x9a00, 0x2e8e, 0x3000 }, - { 0x9a00, 0x2e8c, 0x2000 }, - { 0x1a00, 0x2e8b, 0x0000 }, - { 0x1a00, 0x2e8d, 0x0000 }, - { 0x9a00, 0x2e90, 0x2000 }, - { 0x1a00, 0x2e8f, 0x0000 }, - { 0x1a00, 0x2e91, 0x0000 }, - { 0x9a00, 0x2ed3, 0x7000 }, - { 0x9a00, 0x2eb3, 0x6000 }, - { 0x9a00, 0x2ea3, 0x5000 }, - { 0x9a00, 0x2e9b, 0x4000 }, - { 0x9a00, 0x2e96, 0x3000 }, - { 0x9a00, 0x2e94, 0x2000 }, - { 0x1a00, 0x2e93, 0x0000 }, - { 0x1a00, 0x2e95, 0x0000 }, - { 0x9a00, 0x2e98, 0x2000 }, - { 0x1a00, 0x2e97, 0x0000 }, - { 0x1a00, 0x2e99, 0x0000 }, - { 0x9a00, 0x2e9f, 0x3000 }, - { 0x9a00, 0x2e9d, 0x2000 }, - { 0x1a00, 0x2e9c, 0x0000 }, - { 0x1a00, 0x2e9e, 0x0000 }, - { 0x9a00, 0x2ea1, 0x2000 }, - { 0x1a00, 0x2ea0, 0x0000 }, - { 0x1a00, 0x2ea2, 0x0000 }, - { 0x9a00, 0x2eab, 0x4000 }, - { 0x9a00, 0x2ea7, 0x3000 }, - { 0x9a00, 0x2ea5, 0x2000 }, - { 0x1a00, 0x2ea4, 0x0000 }, - { 0x1a00, 0x2ea6, 0x0000 }, - { 0x9a00, 0x2ea9, 0x2000 }, - { 0x1a00, 0x2ea8, 0x0000 }, - { 0x1a00, 0x2eaa, 0x0000 }, - { 0x9a00, 0x2eaf, 0x3000 }, - { 0x9a00, 0x2ead, 0x2000 }, - { 0x1a00, 0x2eac, 0x0000 }, - { 0x1a00, 0x2eae, 0x0000 }, - { 0x9a00, 0x2eb1, 0x2000 }, - { 0x1a00, 0x2eb0, 0x0000 }, - { 0x1a00, 0x2eb2, 0x0000 }, - { 0x9a00, 0x2ec3, 0x5000 }, - { 0x9a00, 0x2ebb, 0x4000 }, - { 0x9a00, 0x2eb7, 0x3000 }, - { 0x9a00, 0x2eb5, 0x2000 }, - { 0x1a00, 0x2eb4, 0x0000 }, - { 0x1a00, 0x2eb6, 0x0000 }, - { 0x9a00, 0x2eb9, 0x2000 }, - { 0x1a00, 0x2eb8, 0x0000 }, - { 0x1a00, 0x2eba, 0x0000 }, - { 0x9a00, 0x2ebf, 0x3000 }, - { 0x9a00, 0x2ebd, 0x2000 }, - { 0x1a00, 0x2ebc, 0x0000 }, - { 0x1a00, 0x2ebe, 0x0000 }, - { 0x9a00, 0x2ec1, 0x2000 }, - { 0x1a00, 0x2ec0, 0x0000 }, - { 0x1a00, 0x2ec2, 0x0000 }, - { 0x9a00, 0x2ecb, 0x4000 }, - { 0x9a00, 0x2ec7, 0x3000 }, - { 0x9a00, 0x2ec5, 0x2000 }, - { 0x1a00, 0x2ec4, 0x0000 }, - { 0x1a00, 0x2ec6, 0x0000 }, - { 0x9a00, 0x2ec9, 0x2000 }, - { 0x1a00, 0x2ec8, 0x0000 }, - { 0x1a00, 0x2eca, 0x0000 }, - { 0x9a00, 0x2ecf, 0x3000 }, - { 0x9a00, 0x2ecd, 0x2000 }, - { 0x1a00, 0x2ecc, 0x0000 }, - { 0x1a00, 0x2ece, 0x0000 }, - { 0x9a00, 0x2ed1, 0x2000 }, - { 0x1a00, 0x2ed0, 0x0000 }, - { 0x1a00, 0x2ed2, 0x0000 }, - { 0x9a00, 0x2ef3, 0x6000 }, - { 0x9a00, 0x2ee3, 0x5000 }, - { 0x9a00, 0x2edb, 0x4000 }, - { 0x9a00, 0x2ed7, 0x3000 }, - { 0x9a00, 0x2ed5, 0x2000 }, - { 0x1a00, 0x2ed4, 0x0000 }, - { 0x1a00, 0x2ed6, 0x0000 }, - { 0x9a00, 0x2ed9, 0x2000 }, - { 0x1a00, 0x2ed8, 0x0000 }, - { 0x1a00, 0x2eda, 0x0000 }, - { 0x9a00, 0x2edf, 0x3000 }, - { 0x9a00, 0x2edd, 0x2000 }, - { 0x1a00, 0x2edc, 0x0000 }, - { 0x1a00, 0x2ede, 0x0000 }, - { 0x9a00, 0x2ee1, 0x2000 }, - { 0x1a00, 0x2ee0, 0x0000 }, - { 0x1a00, 0x2ee2, 0x0000 }, - { 0x9a00, 0x2eeb, 0x4000 }, - { 0x9a00, 0x2ee7, 0x3000 }, - { 0x9a00, 0x2ee5, 0x2000 }, - { 0x1a00, 0x2ee4, 0x0000 }, - { 0x1a00, 0x2ee6, 0x0000 }, - { 0x9a00, 0x2ee9, 0x2000 }, - { 0x1a00, 0x2ee8, 0x0000 }, - { 0x1a00, 0x2eea, 0x0000 }, - { 0x9a00, 0x2eef, 0x3000 }, - { 0x9a00, 0x2eed, 0x2000 }, - { 0x1a00, 0x2eec, 0x0000 }, - { 0x1a00, 0x2eee, 0x0000 }, - { 0x9a00, 0x2ef1, 0x2000 }, - { 0x1a00, 0x2ef0, 0x0000 }, - { 0x1a00, 0x2ef2, 0x0000 }, - { 0x9a00, 0x2f0f, 0x5000 }, - { 0x9a00, 0x2f07, 0x4000 }, - { 0x9a00, 0x2f03, 0x3000 }, - { 0x9a00, 0x2f01, 0x2000 }, - { 0x1a00, 0x2f00, 0x0000 }, - { 0x1a00, 0x2f02, 0x0000 }, - { 0x9a00, 0x2f05, 0x2000 }, - { 0x1a00, 0x2f04, 0x0000 }, - { 0x1a00, 0x2f06, 0x0000 }, - { 0x9a00, 0x2f0b, 0x3000 }, - { 0x9a00, 0x2f09, 0x2000 }, - { 0x1a00, 0x2f08, 0x0000 }, - { 0x1a00, 0x2f0a, 0x0000 }, - { 0x9a00, 0x2f0d, 0x2000 }, - { 0x1a00, 0x2f0c, 0x0000 }, - { 0x1a00, 0x2f0e, 0x0000 }, - { 0x9a00, 0x2f17, 0x4000 }, - { 0x9a00, 0x2f13, 0x3000 }, - { 0x9a00, 0x2f11, 0x2000 }, - { 0x1a00, 0x2f10, 0x0000 }, - { 0x1a00, 0x2f12, 0x0000 }, - { 0x9a00, 0x2f15, 0x2000 }, - { 0x1a00, 0x2f14, 0x0000 }, - { 0x1a00, 0x2f16, 0x0000 }, - { 0x9a00, 0x2f1b, 0x3000 }, - { 0x9a00, 0x2f19, 0x2000 }, - { 0x1a00, 0x2f18, 0x0000 }, - { 0x1a00, 0x2f1a, 0x0000 }, - { 0x9a00, 0x2f1d, 0x2000 }, - { 0x1a00, 0x2f1c, 0x0000 }, - { 0x1a00, 0x2f1e, 0x0000 }, - { 0x8701, 0x00f0, 0xd000 }, - { 0x8700, 0xa34d, 0xc000 }, - { 0x9a00, 0x3391, 0xb000 }, - { 0x8700, 0x3149, 0xa000 }, - { 0x9500, 0x303d, 0x9000 }, - { 0x9a00, 0x2f9f, 0x8000 }, - { 0x9a00, 0x2f5f, 0x7000 }, - { 0x9a00, 0x2f3f, 0x6000 }, - { 0x9a00, 0x2f2f, 0x5000 }, - { 0x9a00, 0x2f27, 0x4000 }, - { 0x9a00, 0x2f23, 0x3000 }, - { 0x9a00, 0x2f21, 0x2000 }, - { 0x1a00, 0x2f20, 0x0000 }, - { 0x1a00, 0x2f22, 0x0000 }, - { 0x9a00, 0x2f25, 0x2000 }, - { 0x1a00, 0x2f24, 0x0000 }, - { 0x1a00, 0x2f26, 0x0000 }, - { 0x9a00, 0x2f2b, 0x3000 }, - { 0x9a00, 0x2f29, 0x2000 }, - { 0x1a00, 0x2f28, 0x0000 }, - { 0x1a00, 0x2f2a, 0x0000 }, - { 0x9a00, 0x2f2d, 0x2000 }, - { 0x1a00, 0x2f2c, 0x0000 }, - { 0x1a00, 0x2f2e, 0x0000 }, - { 0x9a00, 0x2f37, 0x4000 }, - { 0x9a00, 0x2f33, 0x3000 }, - { 0x9a00, 0x2f31, 0x2000 }, - { 0x1a00, 0x2f30, 0x0000 }, - { 0x1a00, 0x2f32, 0x0000 }, - { 0x9a00, 0x2f35, 0x2000 }, - { 0x1a00, 0x2f34, 0x0000 }, - { 0x1a00, 0x2f36, 0x0000 }, - { 0x9a00, 0x2f3b, 0x3000 }, - { 0x9a00, 0x2f39, 0x2000 }, - { 0x1a00, 0x2f38, 0x0000 }, - { 0x1a00, 0x2f3a, 0x0000 }, - { 0x9a00, 0x2f3d, 0x2000 }, - { 0x1a00, 0x2f3c, 0x0000 }, - { 0x1a00, 0x2f3e, 0x0000 }, - { 0x9a00, 0x2f4f, 0x5000 }, - { 0x9a00, 0x2f47, 0x4000 }, - { 0x9a00, 0x2f43, 0x3000 }, - { 0x9a00, 0x2f41, 0x2000 }, - { 0x1a00, 0x2f40, 0x0000 }, - { 0x1a00, 0x2f42, 0x0000 }, - { 0x9a00, 0x2f45, 0x2000 }, - { 0x1a00, 0x2f44, 0x0000 }, - { 0x1a00, 0x2f46, 0x0000 }, - { 0x9a00, 0x2f4b, 0x3000 }, - { 0x9a00, 0x2f49, 0x2000 }, - { 0x1a00, 0x2f48, 0x0000 }, - { 0x1a00, 0x2f4a, 0x0000 }, - { 0x9a00, 0x2f4d, 0x2000 }, - { 0x1a00, 0x2f4c, 0x0000 }, - { 0x1a00, 0x2f4e, 0x0000 }, - { 0x9a00, 0x2f57, 0x4000 }, - { 0x9a00, 0x2f53, 0x3000 }, - { 0x9a00, 0x2f51, 0x2000 }, - { 0x1a00, 0x2f50, 0x0000 }, - { 0x1a00, 0x2f52, 0x0000 }, - { 0x9a00, 0x2f55, 0x2000 }, - { 0x1a00, 0x2f54, 0x0000 }, - { 0x1a00, 0x2f56, 0x0000 }, - { 0x9a00, 0x2f5b, 0x3000 }, - { 0x9a00, 0x2f59, 0x2000 }, - { 0x1a00, 0x2f58, 0x0000 }, - { 0x1a00, 0x2f5a, 0x0000 }, - { 0x9a00, 0x2f5d, 0x2000 }, - { 0x1a00, 0x2f5c, 0x0000 }, - { 0x1a00, 0x2f5e, 0x0000 }, - { 0x9a00, 0x2f7f, 0x6000 }, - { 0x9a00, 0x2f6f, 0x5000 }, - { 0x9a00, 0x2f67, 0x4000 }, - { 0x9a00, 0x2f63, 0x3000 }, - { 0x9a00, 0x2f61, 0x2000 }, - { 0x1a00, 0x2f60, 0x0000 }, - { 0x1a00, 0x2f62, 0x0000 }, - { 0x9a00, 0x2f65, 0x2000 }, - { 0x1a00, 0x2f64, 0x0000 }, - { 0x1a00, 0x2f66, 0x0000 }, - { 0x9a00, 0x2f6b, 0x3000 }, - { 0x9a00, 0x2f69, 0x2000 }, - { 0x1a00, 0x2f68, 0x0000 }, - { 0x1a00, 0x2f6a, 0x0000 }, - { 0x9a00, 0x2f6d, 0x2000 }, - { 0x1a00, 0x2f6c, 0x0000 }, - { 0x1a00, 0x2f6e, 0x0000 }, - { 0x9a00, 0x2f77, 0x4000 }, - { 0x9a00, 0x2f73, 0x3000 }, - { 0x9a00, 0x2f71, 0x2000 }, - { 0x1a00, 0x2f70, 0x0000 }, - { 0x1a00, 0x2f72, 0x0000 }, - { 0x9a00, 0x2f75, 0x2000 }, - { 0x1a00, 0x2f74, 0x0000 }, - { 0x1a00, 0x2f76, 0x0000 }, - { 0x9a00, 0x2f7b, 0x3000 }, - { 0x9a00, 0x2f79, 0x2000 }, - { 0x1a00, 0x2f78, 0x0000 }, - { 0x1a00, 0x2f7a, 0x0000 }, - { 0x9a00, 0x2f7d, 0x2000 }, - { 0x1a00, 0x2f7c, 0x0000 }, - { 0x1a00, 0x2f7e, 0x0000 }, - { 0x9a00, 0x2f8f, 0x5000 }, - { 0x9a00, 0x2f87, 0x4000 }, - { 0x9a00, 0x2f83, 0x3000 }, - { 0x9a00, 0x2f81, 0x2000 }, - { 0x1a00, 0x2f80, 0x0000 }, - { 0x1a00, 0x2f82, 0x0000 }, - { 0x9a00, 0x2f85, 0x2000 }, - { 0x1a00, 0x2f84, 0x0000 }, - { 0x1a00, 0x2f86, 0x0000 }, - { 0x9a00, 0x2f8b, 0x3000 }, - { 0x9a00, 0x2f89, 0x2000 }, - { 0x1a00, 0x2f88, 0x0000 }, - { 0x1a00, 0x2f8a, 0x0000 }, - { 0x9a00, 0x2f8d, 0x2000 }, - { 0x1a00, 0x2f8c, 0x0000 }, - { 0x1a00, 0x2f8e, 0x0000 }, - { 0x9a00, 0x2f97, 0x4000 }, - { 0x9a00, 0x2f93, 0x3000 }, - { 0x9a00, 0x2f91, 0x2000 }, - { 0x1a00, 0x2f90, 0x0000 }, - { 0x1a00, 0x2f92, 0x0000 }, - { 0x9a00, 0x2f95, 0x2000 }, - { 0x1a00, 0x2f94, 0x0000 }, - { 0x1a00, 0x2f96, 0x0000 }, - { 0x9a00, 0x2f9b, 0x3000 }, - { 0x9a00, 0x2f99, 0x2000 }, - { 0x1a00, 0x2f98, 0x0000 }, - { 0x1a00, 0x2f9a, 0x0000 }, - { 0x9a00, 0x2f9d, 0x2000 }, - { 0x1a00, 0x2f9c, 0x0000 }, - { 0x1a00, 0x2f9e, 0x0000 }, - { 0x9a00, 0x2ff9, 0x7000 }, - { 0x9a00, 0x2fbf, 0x6000 }, - { 0x9a00, 0x2faf, 0x5000 }, - { 0x9a00, 0x2fa7, 0x4000 }, - { 0x9a00, 0x2fa3, 0x3000 }, - { 0x9a00, 0x2fa1, 0x2000 }, - { 0x1a00, 0x2fa0, 0x0000 }, - { 0x1a00, 0x2fa2, 0x0000 }, - { 0x9a00, 0x2fa5, 0x2000 }, - { 0x1a00, 0x2fa4, 0x0000 }, - { 0x1a00, 0x2fa6, 0x0000 }, - { 0x9a00, 0x2fab, 0x3000 }, - { 0x9a00, 0x2fa9, 0x2000 }, - { 0x1a00, 0x2fa8, 0x0000 }, - { 0x1a00, 0x2faa, 0x0000 }, - { 0x9a00, 0x2fad, 0x2000 }, - { 0x1a00, 0x2fac, 0x0000 }, - { 0x1a00, 0x2fae, 0x0000 }, - { 0x9a00, 0x2fb7, 0x4000 }, - { 0x9a00, 0x2fb3, 0x3000 }, - { 0x9a00, 0x2fb1, 0x2000 }, - { 0x1a00, 0x2fb0, 0x0000 }, - { 0x1a00, 0x2fb2, 0x0000 }, - { 0x9a00, 0x2fb5, 0x2000 }, - { 0x1a00, 0x2fb4, 0x0000 }, - { 0x1a00, 0x2fb6, 0x0000 }, - { 0x9a00, 0x2fbb, 0x3000 }, - { 0x9a00, 0x2fb9, 0x2000 }, - { 0x1a00, 0x2fb8, 0x0000 }, - { 0x1a00, 0x2fba, 0x0000 }, - { 0x9a00, 0x2fbd, 0x2000 }, - { 0x1a00, 0x2fbc, 0x0000 }, - { 0x1a00, 0x2fbe, 0x0000 }, - { 0x9a00, 0x2fcf, 0x5000 }, - { 0x9a00, 0x2fc7, 0x4000 }, - { 0x9a00, 0x2fc3, 0x3000 }, - { 0x9a00, 0x2fc1, 0x2000 }, - { 0x1a00, 0x2fc0, 0x0000 }, - { 0x1a00, 0x2fc2, 0x0000 }, - { 0x9a00, 0x2fc5, 0x2000 }, - { 0x1a00, 0x2fc4, 0x0000 }, - { 0x1a00, 0x2fc6, 0x0000 }, - { 0x9a00, 0x2fcb, 0x3000 }, - { 0x9a00, 0x2fc9, 0x2000 }, - { 0x1a00, 0x2fc8, 0x0000 }, - { 0x1a00, 0x2fca, 0x0000 }, - { 0x9a00, 0x2fcd, 0x2000 }, - { 0x1a00, 0x2fcc, 0x0000 }, - { 0x1a00, 0x2fce, 0x0000 }, - { 0x9a00, 0x2ff1, 0x4000 }, - { 0x9a00, 0x2fd3, 0x3000 }, - { 0x9a00, 0x2fd1, 0x2000 }, - { 0x1a00, 0x2fd0, 0x0000 }, - { 0x1a00, 0x2fd2, 0x0000 }, - { 0x9a00, 0x2fd5, 0x2000 }, - { 0x1a00, 0x2fd4, 0x0000 }, - { 0x1a00, 0x2ff0, 0x0000 }, - { 0x9a00, 0x2ff5, 0x3000 }, - { 0x9a00, 0x2ff3, 0x2000 }, - { 0x1a00, 0x2ff2, 0x0000 }, - { 0x1a00, 0x2ff4, 0x0000 }, - { 0x9a00, 0x2ff7, 0x2000 }, - { 0x1a00, 0x2ff6, 0x0000 }, - { 0x1a00, 0x2ff8, 0x0000 }, - { 0x9600, 0x301d, 0x6000 }, - { 0x9200, 0x300d, 0x5000 }, - { 0x8600, 0x3005, 0x4000 }, - { 0x9500, 0x3001, 0x3000 }, - { 0x9a00, 0x2ffb, 0x2000 }, - { 0x1a00, 0x2ffa, 0x0000 }, - { 0x1d00, 0x3000, 0x0000 }, - { 0x9500, 0x3003, 0x2000 }, - { 0x1500, 0x3002, 0x0000 }, - { 0x1a00, 0x3004, 0x0000 }, - { 0x9200, 0x3009, 0x3000 }, - { 0x8e00, 0x3007, 0x2000 }, - { 0x0700, 0x3006, 0x0000 }, - { 0x1600, 0x3008, 0x0000 }, - { 0x9200, 0x300b, 0x2000 }, - { 0x1600, 0x300a, 0x0000 }, - { 0x1600, 0x300c, 0x0000 }, - { 0x9200, 0x3015, 0x4000 }, - { 0x9200, 0x3011, 0x3000 }, - { 0x9200, 0x300f, 0x2000 }, - { 0x1600, 0x300e, 0x0000 }, - { 0x1600, 0x3010, 0x0000 }, - { 0x9a00, 0x3013, 0x2000 }, - { 0x1a00, 0x3012, 0x0000 }, - { 0x1600, 0x3014, 0x0000 }, - { 0x9200, 0x3019, 0x3000 }, - { 0x9200, 0x3017, 0x2000 }, - { 0x1600, 0x3016, 0x0000 }, - { 0x1600, 0x3018, 0x0000 }, - { 0x9200, 0x301b, 0x2000 }, - { 0x1600, 0x301a, 0x0000 }, - { 0x1100, 0x301c, 0x0000 }, - { 0x8c00, 0x302d, 0x5000 }, - { 0x8e00, 0x3025, 0x4000 }, - { 0x8e00, 0x3021, 0x3000 }, - { 0x9200, 0x301f, 0x2000 }, - { 0x1200, 0x301e, 0x0000 }, - { 0x1a00, 0x3020, 0x0000 }, - { 0x8e00, 0x3023, 0x2000 }, - { 0x0e00, 0x3022, 0x0000 }, - { 0x0e00, 0x3024, 0x0000 }, - { 0x8e00, 0x3029, 0x3000 }, - { 0x8e00, 0x3027, 0x2000 }, - { 0x0e00, 0x3026, 0x0000 }, - { 0x0e00, 0x3028, 0x0000 }, - { 0x8c00, 0x302b, 0x2000 }, - { 0x0c00, 0x302a, 0x0000 }, - { 0x0c00, 0x302c, 0x0000 }, - { 0x8600, 0x3035, 0x4000 }, - { 0x8600, 0x3031, 0x3000 }, - { 0x8c00, 0x302f, 0x2000 }, - { 0x0c00, 0x302e, 0x0000 }, - { 0x1100, 0x3030, 0x0000 }, - { 0x8600, 0x3033, 0x2000 }, - { 0x0600, 0x3032, 0x0000 }, - { 0x0600, 0x3034, 0x0000 }, - { 0x8e00, 0x3039, 0x3000 }, - { 0x9a00, 0x3037, 0x2000 }, - { 0x1a00, 0x3036, 0x0000 }, - { 0x0e00, 0x3038, 0x0000 }, - { 0x8600, 0x303b, 0x2000 }, - { 0x0e00, 0x303a, 0x0000 }, - { 0x0700, 0x303c, 0x0000 }, - { 0x8700, 0x30c0, 0x8000 }, - { 0x8700, 0x307e, 0x7000 }, - { 0x8700, 0x305e, 0x6000 }, - { 0x8700, 0x304e, 0x5000 }, - { 0x8700, 0x3046, 0x4000 }, - { 0x8700, 0x3042, 0x3000 }, - { 0x9a00, 0x303f, 0x2000 }, - { 0x1a00, 0x303e, 0x0000 }, - { 0x0700, 0x3041, 0x0000 }, - { 0x8700, 0x3044, 0x2000 }, - { 0x0700, 0x3043, 0x0000 }, - { 0x0700, 0x3045, 0x0000 }, - { 0x8700, 0x304a, 0x3000 }, - { 0x8700, 0x3048, 0x2000 }, - { 0x0700, 0x3047, 0x0000 }, - { 0x0700, 0x3049, 0x0000 }, - { 0x8700, 0x304c, 0x2000 }, - { 0x0700, 0x304b, 0x0000 }, - { 0x0700, 0x304d, 0x0000 }, - { 0x8700, 0x3056, 0x4000 }, - { 0x8700, 0x3052, 0x3000 }, - { 0x8700, 0x3050, 0x2000 }, - { 0x0700, 0x304f, 0x0000 }, - { 0x0700, 0x3051, 0x0000 }, - { 0x8700, 0x3054, 0x2000 }, - { 0x0700, 0x3053, 0x0000 }, - { 0x0700, 0x3055, 0x0000 }, - { 0x8700, 0x305a, 0x3000 }, - { 0x8700, 0x3058, 0x2000 }, - { 0x0700, 0x3057, 0x0000 }, - { 0x0700, 0x3059, 0x0000 }, - { 0x8700, 0x305c, 0x2000 }, - { 0x0700, 0x305b, 0x0000 }, - { 0x0700, 0x305d, 0x0000 }, - { 0x8700, 0x306e, 0x5000 }, - { 0x8700, 0x3066, 0x4000 }, - { 0x8700, 0x3062, 0x3000 }, - { 0x8700, 0x3060, 0x2000 }, - { 0x0700, 0x305f, 0x0000 }, - { 0x0700, 0x3061, 0x0000 }, - { 0x8700, 0x3064, 0x2000 }, - { 0x0700, 0x3063, 0x0000 }, - { 0x0700, 0x3065, 0x0000 }, - { 0x8700, 0x306a, 0x3000 }, - { 0x8700, 0x3068, 0x2000 }, - { 0x0700, 0x3067, 0x0000 }, - { 0x0700, 0x3069, 0x0000 }, - { 0x8700, 0x306c, 0x2000 }, - { 0x0700, 0x306b, 0x0000 }, - { 0x0700, 0x306d, 0x0000 }, - { 0x8700, 0x3076, 0x4000 }, - { 0x8700, 0x3072, 0x3000 }, - { 0x8700, 0x3070, 0x2000 }, - { 0x0700, 0x306f, 0x0000 }, - { 0x0700, 0x3071, 0x0000 }, - { 0x8700, 0x3074, 0x2000 }, - { 0x0700, 0x3073, 0x0000 }, - { 0x0700, 0x3075, 0x0000 }, - { 0x8700, 0x307a, 0x3000 }, - { 0x8700, 0x3078, 0x2000 }, - { 0x0700, 0x3077, 0x0000 }, - { 0x0700, 0x3079, 0x0000 }, - { 0x8700, 0x307c, 0x2000 }, - { 0x0700, 0x307b, 0x0000 }, - { 0x0700, 0x307d, 0x0000 }, - { 0x9100, 0x30a0, 0x6000 }, - { 0x8700, 0x308e, 0x5000 }, - { 0x8700, 0x3086, 0x4000 }, - { 0x8700, 0x3082, 0x3000 }, - { 0x8700, 0x3080, 0x2000 }, - { 0x0700, 0x307f, 0x0000 }, - { 0x0700, 0x3081, 0x0000 }, - { 0x8700, 0x3084, 0x2000 }, - { 0x0700, 0x3083, 0x0000 }, - { 0x0700, 0x3085, 0x0000 }, - { 0x8700, 0x308a, 0x3000 }, - { 0x8700, 0x3088, 0x2000 }, - { 0x0700, 0x3087, 0x0000 }, - { 0x0700, 0x3089, 0x0000 }, - { 0x8700, 0x308c, 0x2000 }, - { 0x0700, 0x308b, 0x0000 }, - { 0x0700, 0x308d, 0x0000 }, - { 0x8700, 0x3096, 0x4000 }, - { 0x8700, 0x3092, 0x3000 }, - { 0x8700, 0x3090, 0x2000 }, - { 0x0700, 0x308f, 0x0000 }, - { 0x0700, 0x3091, 0x0000 }, - { 0x8700, 0x3094, 0x2000 }, - { 0x0700, 0x3093, 0x0000 }, - { 0x0700, 0x3095, 0x0000 }, - { 0x9800, 0x309c, 0x3000 }, - { 0x8c00, 0x309a, 0x2000 }, - { 0x0c00, 0x3099, 0x0000 }, - { 0x1800, 0x309b, 0x0000 }, - { 0x8600, 0x309e, 0x2000 }, - { 0x0600, 0x309d, 0x0000 }, - { 0x0700, 0x309f, 0x0000 }, - { 0x8700, 0x30b0, 0x5000 }, - { 0x8700, 0x30a8, 0x4000 }, - { 0x8700, 0x30a4, 0x3000 }, - { 0x8700, 0x30a2, 0x2000 }, - { 0x0700, 0x30a1, 0x0000 }, - { 0x0700, 0x30a3, 0x0000 }, - { 0x8700, 0x30a6, 0x2000 }, - { 0x0700, 0x30a5, 0x0000 }, - { 0x0700, 0x30a7, 0x0000 }, - { 0x8700, 0x30ac, 0x3000 }, - { 0x8700, 0x30aa, 0x2000 }, - { 0x0700, 0x30a9, 0x0000 }, - { 0x0700, 0x30ab, 0x0000 }, - { 0x8700, 0x30ae, 0x2000 }, - { 0x0700, 0x30ad, 0x0000 }, - { 0x0700, 0x30af, 0x0000 }, - { 0x8700, 0x30b8, 0x4000 }, - { 0x8700, 0x30b4, 0x3000 }, - { 0x8700, 0x30b2, 0x2000 }, - { 0x0700, 0x30b1, 0x0000 }, - { 0x0700, 0x30b3, 0x0000 }, - { 0x8700, 0x30b6, 0x2000 }, - { 0x0700, 0x30b5, 0x0000 }, - { 0x0700, 0x30b7, 0x0000 }, - { 0x8700, 0x30bc, 0x3000 }, - { 0x8700, 0x30ba, 0x2000 }, - { 0x0700, 0x30b9, 0x0000 }, - { 0x0700, 0x30bb, 0x0000 }, - { 0x8700, 0x30be, 0x2000 }, - { 0x0700, 0x30bd, 0x0000 }, - { 0x0700, 0x30bf, 0x0000 }, - { 0x8700, 0x3105, 0x7000 }, - { 0x8700, 0x30e0, 0x6000 }, - { 0x8700, 0x30d0, 0x5000 }, - { 0x8700, 0x30c8, 0x4000 }, - { 0x8700, 0x30c4, 0x3000 }, - { 0x8700, 0x30c2, 0x2000 }, - { 0x0700, 0x30c1, 0x0000 }, - { 0x0700, 0x30c3, 0x0000 }, - { 0x8700, 0x30c6, 0x2000 }, - { 0x0700, 0x30c5, 0x0000 }, - { 0x0700, 0x30c7, 0x0000 }, - { 0x8700, 0x30cc, 0x3000 }, - { 0x8700, 0x30ca, 0x2000 }, - { 0x0700, 0x30c9, 0x0000 }, - { 0x0700, 0x30cb, 0x0000 }, - { 0x8700, 0x30ce, 0x2000 }, - { 0x0700, 0x30cd, 0x0000 }, - { 0x0700, 0x30cf, 0x0000 }, - { 0x8700, 0x30d8, 0x4000 }, - { 0x8700, 0x30d4, 0x3000 }, - { 0x8700, 0x30d2, 0x2000 }, - { 0x0700, 0x30d1, 0x0000 }, - { 0x0700, 0x30d3, 0x0000 }, - { 0x8700, 0x30d6, 0x2000 }, - { 0x0700, 0x30d5, 0x0000 }, - { 0x0700, 0x30d7, 0x0000 }, - { 0x8700, 0x30dc, 0x3000 }, - { 0x8700, 0x30da, 0x2000 }, - { 0x0700, 0x30d9, 0x0000 }, - { 0x0700, 0x30db, 0x0000 }, - { 0x8700, 0x30de, 0x2000 }, - { 0x0700, 0x30dd, 0x0000 }, - { 0x0700, 0x30df, 0x0000 }, - { 0x8700, 0x30f0, 0x5000 }, - { 0x8700, 0x30e8, 0x4000 }, - { 0x8700, 0x30e4, 0x3000 }, - { 0x8700, 0x30e2, 0x2000 }, - { 0x0700, 0x30e1, 0x0000 }, - { 0x0700, 0x30e3, 0x0000 }, - { 0x8700, 0x30e6, 0x2000 }, - { 0x0700, 0x30e5, 0x0000 }, - { 0x0700, 0x30e7, 0x0000 }, - { 0x8700, 0x30ec, 0x3000 }, - { 0x8700, 0x30ea, 0x2000 }, - { 0x0700, 0x30e9, 0x0000 }, - { 0x0700, 0x30eb, 0x0000 }, - { 0x8700, 0x30ee, 0x2000 }, - { 0x0700, 0x30ed, 0x0000 }, - { 0x0700, 0x30ef, 0x0000 }, - { 0x8700, 0x30f8, 0x4000 }, - { 0x8700, 0x30f4, 0x3000 }, - { 0x8700, 0x30f2, 0x2000 }, - { 0x0700, 0x30f1, 0x0000 }, - { 0x0700, 0x30f3, 0x0000 }, - { 0x8700, 0x30f6, 0x2000 }, - { 0x0700, 0x30f5, 0x0000 }, - { 0x0700, 0x30f7, 0x0000 }, - { 0x8600, 0x30fc, 0x3000 }, - { 0x8700, 0x30fa, 0x2000 }, - { 0x0700, 0x30f9, 0x0000 }, - { 0x1000, 0x30fb, 0x0000 }, - { 0x8600, 0x30fe, 0x2000 }, - { 0x0600, 0x30fd, 0x0000 }, - { 0x0700, 0x30ff, 0x0000 }, - { 0x8700, 0x3125, 0x6000 }, - { 0x8700, 0x3115, 0x5000 }, - { 0x8700, 0x310d, 0x4000 }, - { 0x8700, 0x3109, 0x3000 }, - { 0x8700, 0x3107, 0x2000 }, - { 0x0700, 0x3106, 0x0000 }, - { 0x0700, 0x3108, 0x0000 }, - { 0x8700, 0x310b, 0x2000 }, - { 0x0700, 0x310a, 0x0000 }, - { 0x0700, 0x310c, 0x0000 }, - { 0x8700, 0x3111, 0x3000 }, - { 0x8700, 0x310f, 0x2000 }, - { 0x0700, 0x310e, 0x0000 }, - { 0x0700, 0x3110, 0x0000 }, - { 0x8700, 0x3113, 0x2000 }, - { 0x0700, 0x3112, 0x0000 }, - { 0x0700, 0x3114, 0x0000 }, - { 0x8700, 0x311d, 0x4000 }, - { 0x8700, 0x3119, 0x3000 }, - { 0x8700, 0x3117, 0x2000 }, - { 0x0700, 0x3116, 0x0000 }, - { 0x0700, 0x3118, 0x0000 }, - { 0x8700, 0x311b, 0x2000 }, - { 0x0700, 0x311a, 0x0000 }, - { 0x0700, 0x311c, 0x0000 }, - { 0x8700, 0x3121, 0x3000 }, - { 0x8700, 0x311f, 0x2000 }, - { 0x0700, 0x311e, 0x0000 }, - { 0x0700, 0x3120, 0x0000 }, - { 0x8700, 0x3123, 0x2000 }, - { 0x0700, 0x3122, 0x0000 }, - { 0x0700, 0x3124, 0x0000 }, - { 0x8700, 0x3139, 0x5000 }, - { 0x8700, 0x3131, 0x4000 }, - { 0x8700, 0x3129, 0x3000 }, - { 0x8700, 0x3127, 0x2000 }, - { 0x0700, 0x3126, 0x0000 }, - { 0x0700, 0x3128, 0x0000 }, - { 0x8700, 0x312b, 0x2000 }, - { 0x0700, 0x312a, 0x0000 }, - { 0x0700, 0x312c, 0x0000 }, - { 0x8700, 0x3135, 0x3000 }, - { 0x8700, 0x3133, 0x2000 }, - { 0x0700, 0x3132, 0x0000 }, - { 0x0700, 0x3134, 0x0000 }, - { 0x8700, 0x3137, 0x2000 }, - { 0x0700, 0x3136, 0x0000 }, - { 0x0700, 0x3138, 0x0000 }, - { 0x8700, 0x3141, 0x4000 }, - { 0x8700, 0x313d, 0x3000 }, - { 0x8700, 0x313b, 0x2000 }, - { 0x0700, 0x313a, 0x0000 }, - { 0x0700, 0x313c, 0x0000 }, - { 0x8700, 0x313f, 0x2000 }, - { 0x0700, 0x313e, 0x0000 }, - { 0x0700, 0x3140, 0x0000 }, - { 0x8700, 0x3145, 0x3000 }, - { 0x8700, 0x3143, 0x2000 }, - { 0x0700, 0x3142, 0x0000 }, - { 0x0700, 0x3144, 0x0000 }, - { 0x8700, 0x3147, 0x2000 }, - { 0x0700, 0x3146, 0x0000 }, - { 0x0700, 0x3148, 0x0000 }, - { 0x9a00, 0x3290, 0x9000 }, - { 0x9a00, 0x3202, 0x8000 }, - { 0x8700, 0x3189, 0x7000 }, - { 0x8700, 0x3169, 0x6000 }, - { 0x8700, 0x3159, 0x5000 }, - { 0x8700, 0x3151, 0x4000 }, - { 0x8700, 0x314d, 0x3000 }, - { 0x8700, 0x314b, 0x2000 }, - { 0x0700, 0x314a, 0x0000 }, - { 0x0700, 0x314c, 0x0000 }, - { 0x8700, 0x314f, 0x2000 }, - { 0x0700, 0x314e, 0x0000 }, - { 0x0700, 0x3150, 0x0000 }, - { 0x8700, 0x3155, 0x3000 }, - { 0x8700, 0x3153, 0x2000 }, - { 0x0700, 0x3152, 0x0000 }, - { 0x0700, 0x3154, 0x0000 }, - { 0x8700, 0x3157, 0x2000 }, - { 0x0700, 0x3156, 0x0000 }, - { 0x0700, 0x3158, 0x0000 }, - { 0x8700, 0x3161, 0x4000 }, - { 0x8700, 0x315d, 0x3000 }, - { 0x8700, 0x315b, 0x2000 }, - { 0x0700, 0x315a, 0x0000 }, - { 0x0700, 0x315c, 0x0000 }, - { 0x8700, 0x315f, 0x2000 }, - { 0x0700, 0x315e, 0x0000 }, - { 0x0700, 0x3160, 0x0000 }, - { 0x8700, 0x3165, 0x3000 }, - { 0x8700, 0x3163, 0x2000 }, - { 0x0700, 0x3162, 0x0000 }, - { 0x0700, 0x3164, 0x0000 }, - { 0x8700, 0x3167, 0x2000 }, - { 0x0700, 0x3166, 0x0000 }, - { 0x0700, 0x3168, 0x0000 }, - { 0x8700, 0x3179, 0x5000 }, - { 0x8700, 0x3171, 0x4000 }, - { 0x8700, 0x316d, 0x3000 }, - { 0x8700, 0x316b, 0x2000 }, - { 0x0700, 0x316a, 0x0000 }, - { 0x0700, 0x316c, 0x0000 }, - { 0x8700, 0x316f, 0x2000 }, - { 0x0700, 0x316e, 0x0000 }, - { 0x0700, 0x3170, 0x0000 }, - { 0x8700, 0x3175, 0x3000 }, - { 0x8700, 0x3173, 0x2000 }, - { 0x0700, 0x3172, 0x0000 }, - { 0x0700, 0x3174, 0x0000 }, - { 0x8700, 0x3177, 0x2000 }, - { 0x0700, 0x3176, 0x0000 }, - { 0x0700, 0x3178, 0x0000 }, - { 0x8700, 0x3181, 0x4000 }, - { 0x8700, 0x317d, 0x3000 }, - { 0x8700, 0x317b, 0x2000 }, - { 0x0700, 0x317a, 0x0000 }, - { 0x0700, 0x317c, 0x0000 }, - { 0x8700, 0x317f, 0x2000 }, - { 0x0700, 0x317e, 0x0000 }, - { 0x0700, 0x3180, 0x0000 }, - { 0x8700, 0x3185, 0x3000 }, - { 0x8700, 0x3183, 0x2000 }, - { 0x0700, 0x3182, 0x0000 }, - { 0x0700, 0x3184, 0x0000 }, - { 0x8700, 0x3187, 0x2000 }, - { 0x0700, 0x3186, 0x0000 }, - { 0x0700, 0x3188, 0x0000 }, - { 0x8700, 0x31aa, 0x6000 }, - { 0x9a00, 0x319a, 0x5000 }, - { 0x8f00, 0x3192, 0x4000 }, - { 0x8700, 0x318d, 0x3000 }, - { 0x8700, 0x318b, 0x2000 }, - { 0x0700, 0x318a, 0x0000 }, - { 0x0700, 0x318c, 0x0000 }, - { 0x9a00, 0x3190, 0x2000 }, - { 0x0700, 0x318e, 0x0000 }, - { 0x1a00, 0x3191, 0x0000 }, - { 0x9a00, 0x3196, 0x3000 }, - { 0x8f00, 0x3194, 0x2000 }, - { 0x0f00, 0x3193, 0x0000 }, - { 0x0f00, 0x3195, 0x0000 }, - { 0x9a00, 0x3198, 0x2000 }, - { 0x1a00, 0x3197, 0x0000 }, - { 0x1a00, 0x3199, 0x0000 }, - { 0x8700, 0x31a2, 0x4000 }, - { 0x9a00, 0x319e, 0x3000 }, - { 0x9a00, 0x319c, 0x2000 }, - { 0x1a00, 0x319b, 0x0000 }, - { 0x1a00, 0x319d, 0x0000 }, - { 0x8700, 0x31a0, 0x2000 }, - { 0x1a00, 0x319f, 0x0000 }, - { 0x0700, 0x31a1, 0x0000 }, - { 0x8700, 0x31a6, 0x3000 }, - { 0x8700, 0x31a4, 0x2000 }, - { 0x0700, 0x31a3, 0x0000 }, - { 0x0700, 0x31a5, 0x0000 }, - { 0x8700, 0x31a8, 0x2000 }, - { 0x0700, 0x31a7, 0x0000 }, - { 0x0700, 0x31a9, 0x0000 }, - { 0x8700, 0x31f2, 0x5000 }, - { 0x8700, 0x31b2, 0x4000 }, - { 0x8700, 0x31ae, 0x3000 }, - { 0x8700, 0x31ac, 0x2000 }, - { 0x0700, 0x31ab, 0x0000 }, - { 0x0700, 0x31ad, 0x0000 }, - { 0x8700, 0x31b0, 0x2000 }, - { 0x0700, 0x31af, 0x0000 }, - { 0x0700, 0x31b1, 0x0000 }, - { 0x8700, 0x31b6, 0x3000 }, - { 0x8700, 0x31b4, 0x2000 }, - { 0x0700, 0x31b3, 0x0000 }, - { 0x0700, 0x31b5, 0x0000 }, - { 0x8700, 0x31f0, 0x2000 }, - { 0x0700, 0x31b7, 0x0000 }, - { 0x0700, 0x31f1, 0x0000 }, - { 0x8700, 0x31fa, 0x4000 }, - { 0x8700, 0x31f6, 0x3000 }, - { 0x8700, 0x31f4, 0x2000 }, - { 0x0700, 0x31f3, 0x0000 }, - { 0x0700, 0x31f5, 0x0000 }, - { 0x8700, 0x31f8, 0x2000 }, - { 0x0700, 0x31f7, 0x0000 }, - { 0x0700, 0x31f9, 0x0000 }, - { 0x8700, 0x31fe, 0x3000 }, - { 0x8700, 0x31fc, 0x2000 }, - { 0x0700, 0x31fb, 0x0000 }, - { 0x0700, 0x31fd, 0x0000 }, - { 0x9a00, 0x3200, 0x2000 }, - { 0x0700, 0x31ff, 0x0000 }, - { 0x1a00, 0x3201, 0x0000 }, - { 0x9a00, 0x3243, 0x7000 }, - { 0x8f00, 0x3223, 0x6000 }, - { 0x9a00, 0x3212, 0x5000 }, - { 0x9a00, 0x320a, 0x4000 }, - { 0x9a00, 0x3206, 0x3000 }, - { 0x9a00, 0x3204, 0x2000 }, - { 0x1a00, 0x3203, 0x0000 }, - { 0x1a00, 0x3205, 0x0000 }, - { 0x9a00, 0x3208, 0x2000 }, - { 0x1a00, 0x3207, 0x0000 }, - { 0x1a00, 0x3209, 0x0000 }, - { 0x9a00, 0x320e, 0x3000 }, - { 0x9a00, 0x320c, 0x2000 }, - { 0x1a00, 0x320b, 0x0000 }, - { 0x1a00, 0x320d, 0x0000 }, - { 0x9a00, 0x3210, 0x2000 }, - { 0x1a00, 0x320f, 0x0000 }, - { 0x1a00, 0x3211, 0x0000 }, - { 0x9a00, 0x321a, 0x4000 }, - { 0x9a00, 0x3216, 0x3000 }, - { 0x9a00, 0x3214, 0x2000 }, - { 0x1a00, 0x3213, 0x0000 }, - { 0x1a00, 0x3215, 0x0000 }, - { 0x9a00, 0x3218, 0x2000 }, - { 0x1a00, 0x3217, 0x0000 }, - { 0x1a00, 0x3219, 0x0000 }, - { 0x9a00, 0x321e, 0x3000 }, - { 0x9a00, 0x321c, 0x2000 }, - { 0x1a00, 0x321b, 0x0000 }, - { 0x1a00, 0x321d, 0x0000 }, - { 0x8f00, 0x3221, 0x2000 }, - { 0x0f00, 0x3220, 0x0000 }, - { 0x0f00, 0x3222, 0x0000 }, - { 0x9a00, 0x3233, 0x5000 }, - { 0x9a00, 0x322b, 0x4000 }, - { 0x8f00, 0x3227, 0x3000 }, - { 0x8f00, 0x3225, 0x2000 }, - { 0x0f00, 0x3224, 0x0000 }, - { 0x0f00, 0x3226, 0x0000 }, - { 0x8f00, 0x3229, 0x2000 }, - { 0x0f00, 0x3228, 0x0000 }, - { 0x1a00, 0x322a, 0x0000 }, - { 0x9a00, 0x322f, 0x3000 }, - { 0x9a00, 0x322d, 0x2000 }, - { 0x1a00, 0x322c, 0x0000 }, - { 0x1a00, 0x322e, 0x0000 }, - { 0x9a00, 0x3231, 0x2000 }, - { 0x1a00, 0x3230, 0x0000 }, - { 0x1a00, 0x3232, 0x0000 }, - { 0x9a00, 0x323b, 0x4000 }, - { 0x9a00, 0x3237, 0x3000 }, - { 0x9a00, 0x3235, 0x2000 }, - { 0x1a00, 0x3234, 0x0000 }, - { 0x1a00, 0x3236, 0x0000 }, - { 0x9a00, 0x3239, 0x2000 }, - { 0x1a00, 0x3238, 0x0000 }, - { 0x1a00, 0x323a, 0x0000 }, - { 0x9a00, 0x323f, 0x3000 }, - { 0x9a00, 0x323d, 0x2000 }, - { 0x1a00, 0x323c, 0x0000 }, - { 0x1a00, 0x323e, 0x0000 }, - { 0x9a00, 0x3241, 0x2000 }, - { 0x1a00, 0x3240, 0x0000 }, - { 0x1a00, 0x3242, 0x0000 }, - { 0x9a00, 0x326f, 0x6000 }, - { 0x8f00, 0x325f, 0x5000 }, - { 0x8f00, 0x3257, 0x4000 }, - { 0x8f00, 0x3253, 0x3000 }, - { 0x8f00, 0x3251, 0x2000 }, - { 0x1a00, 0x3250, 0x0000 }, - { 0x0f00, 0x3252, 0x0000 }, - { 0x8f00, 0x3255, 0x2000 }, - { 0x0f00, 0x3254, 0x0000 }, - { 0x0f00, 0x3256, 0x0000 }, - { 0x8f00, 0x325b, 0x3000 }, - { 0x8f00, 0x3259, 0x2000 }, - { 0x0f00, 0x3258, 0x0000 }, - { 0x0f00, 0x325a, 0x0000 }, - { 0x8f00, 0x325d, 0x2000 }, - { 0x0f00, 0x325c, 0x0000 }, - { 0x0f00, 0x325e, 0x0000 }, - { 0x9a00, 0x3267, 0x4000 }, - { 0x9a00, 0x3263, 0x3000 }, - { 0x9a00, 0x3261, 0x2000 }, - { 0x1a00, 0x3260, 0x0000 }, - { 0x1a00, 0x3262, 0x0000 }, - { 0x9a00, 0x3265, 0x2000 }, - { 0x1a00, 0x3264, 0x0000 }, - { 0x1a00, 0x3266, 0x0000 }, - { 0x9a00, 0x326b, 0x3000 }, - { 0x9a00, 0x3269, 0x2000 }, - { 0x1a00, 0x3268, 0x0000 }, - { 0x1a00, 0x326a, 0x0000 }, - { 0x9a00, 0x326d, 0x2000 }, - { 0x1a00, 0x326c, 0x0000 }, - { 0x1a00, 0x326e, 0x0000 }, - { 0x8f00, 0x3280, 0x5000 }, - { 0x9a00, 0x3277, 0x4000 }, - { 0x9a00, 0x3273, 0x3000 }, - { 0x9a00, 0x3271, 0x2000 }, - { 0x1a00, 0x3270, 0x0000 }, - { 0x1a00, 0x3272, 0x0000 }, - { 0x9a00, 0x3275, 0x2000 }, - { 0x1a00, 0x3274, 0x0000 }, - { 0x1a00, 0x3276, 0x0000 }, - { 0x9a00, 0x327b, 0x3000 }, - { 0x9a00, 0x3279, 0x2000 }, - { 0x1a00, 0x3278, 0x0000 }, - { 0x1a00, 0x327a, 0x0000 }, - { 0x9a00, 0x327d, 0x2000 }, - { 0x1a00, 0x327c, 0x0000 }, - { 0x1a00, 0x327f, 0x0000 }, - { 0x8f00, 0x3288, 0x4000 }, - { 0x8f00, 0x3284, 0x3000 }, - { 0x8f00, 0x3282, 0x2000 }, - { 0x0f00, 0x3281, 0x0000 }, - { 0x0f00, 0x3283, 0x0000 }, - { 0x8f00, 0x3286, 0x2000 }, - { 0x0f00, 0x3285, 0x0000 }, - { 0x0f00, 0x3287, 0x0000 }, - { 0x9a00, 0x328c, 0x3000 }, - { 0x9a00, 0x328a, 0x2000 }, - { 0x0f00, 0x3289, 0x0000 }, - { 0x1a00, 0x328b, 0x0000 }, - { 0x9a00, 0x328e, 0x2000 }, - { 0x1a00, 0x328d, 0x0000 }, - { 0x1a00, 0x328f, 0x0000 }, - { 0x9a00, 0x3311, 0x8000 }, - { 0x9a00, 0x32d0, 0x7000 }, - { 0x9a00, 0x32b0, 0x6000 }, - { 0x9a00, 0x32a0, 0x5000 }, - { 0x9a00, 0x3298, 0x4000 }, - { 0x9a00, 0x3294, 0x3000 }, - { 0x9a00, 0x3292, 0x2000 }, - { 0x1a00, 0x3291, 0x0000 }, - { 0x1a00, 0x3293, 0x0000 }, - { 0x9a00, 0x3296, 0x2000 }, - { 0x1a00, 0x3295, 0x0000 }, - { 0x1a00, 0x3297, 0x0000 }, - { 0x9a00, 0x329c, 0x3000 }, - { 0x9a00, 0x329a, 0x2000 }, - { 0x1a00, 0x3299, 0x0000 }, - { 0x1a00, 0x329b, 0x0000 }, - { 0x9a00, 0x329e, 0x2000 }, - { 0x1a00, 0x329d, 0x0000 }, - { 0x1a00, 0x329f, 0x0000 }, - { 0x9a00, 0x32a8, 0x4000 }, - { 0x9a00, 0x32a4, 0x3000 }, - { 0x9a00, 0x32a2, 0x2000 }, - { 0x1a00, 0x32a1, 0x0000 }, - { 0x1a00, 0x32a3, 0x0000 }, - { 0x9a00, 0x32a6, 0x2000 }, - { 0x1a00, 0x32a5, 0x0000 }, - { 0x1a00, 0x32a7, 0x0000 }, - { 0x9a00, 0x32ac, 0x3000 }, - { 0x9a00, 0x32aa, 0x2000 }, - { 0x1a00, 0x32a9, 0x0000 }, - { 0x1a00, 0x32ab, 0x0000 }, - { 0x9a00, 0x32ae, 0x2000 }, - { 0x1a00, 0x32ad, 0x0000 }, - { 0x1a00, 0x32af, 0x0000 }, - { 0x9a00, 0x32c0, 0x5000 }, - { 0x8f00, 0x32b8, 0x4000 }, - { 0x8f00, 0x32b4, 0x3000 }, - { 0x8f00, 0x32b2, 0x2000 }, - { 0x0f00, 0x32b1, 0x0000 }, - { 0x0f00, 0x32b3, 0x0000 }, - { 0x8f00, 0x32b6, 0x2000 }, - { 0x0f00, 0x32b5, 0x0000 }, - { 0x0f00, 0x32b7, 0x0000 }, - { 0x8f00, 0x32bc, 0x3000 }, - { 0x8f00, 0x32ba, 0x2000 }, - { 0x0f00, 0x32b9, 0x0000 }, - { 0x0f00, 0x32bb, 0x0000 }, - { 0x8f00, 0x32be, 0x2000 }, - { 0x0f00, 0x32bd, 0x0000 }, - { 0x0f00, 0x32bf, 0x0000 }, - { 0x9a00, 0x32c8, 0x4000 }, - { 0x9a00, 0x32c4, 0x3000 }, - { 0x9a00, 0x32c2, 0x2000 }, - { 0x1a00, 0x32c1, 0x0000 }, - { 0x1a00, 0x32c3, 0x0000 }, - { 0x9a00, 0x32c6, 0x2000 }, - { 0x1a00, 0x32c5, 0x0000 }, - { 0x1a00, 0x32c7, 0x0000 }, - { 0x9a00, 0x32cc, 0x3000 }, - { 0x9a00, 0x32ca, 0x2000 }, - { 0x1a00, 0x32c9, 0x0000 }, - { 0x1a00, 0x32cb, 0x0000 }, - { 0x9a00, 0x32ce, 0x2000 }, - { 0x1a00, 0x32cd, 0x0000 }, - { 0x1a00, 0x32cf, 0x0000 }, - { 0x9a00, 0x32f0, 0x6000 }, - { 0x9a00, 0x32e0, 0x5000 }, - { 0x9a00, 0x32d8, 0x4000 }, - { 0x9a00, 0x32d4, 0x3000 }, - { 0x9a00, 0x32d2, 0x2000 }, - { 0x1a00, 0x32d1, 0x0000 }, - { 0x1a00, 0x32d3, 0x0000 }, - { 0x9a00, 0x32d6, 0x2000 }, - { 0x1a00, 0x32d5, 0x0000 }, - { 0x1a00, 0x32d7, 0x0000 }, - { 0x9a00, 0x32dc, 0x3000 }, - { 0x9a00, 0x32da, 0x2000 }, - { 0x1a00, 0x32d9, 0x0000 }, - { 0x1a00, 0x32db, 0x0000 }, - { 0x9a00, 0x32de, 0x2000 }, - { 0x1a00, 0x32dd, 0x0000 }, - { 0x1a00, 0x32df, 0x0000 }, - { 0x9a00, 0x32e8, 0x4000 }, - { 0x9a00, 0x32e4, 0x3000 }, - { 0x9a00, 0x32e2, 0x2000 }, - { 0x1a00, 0x32e1, 0x0000 }, - { 0x1a00, 0x32e3, 0x0000 }, - { 0x9a00, 0x32e6, 0x2000 }, - { 0x1a00, 0x32e5, 0x0000 }, - { 0x1a00, 0x32e7, 0x0000 }, - { 0x9a00, 0x32ec, 0x3000 }, - { 0x9a00, 0x32ea, 0x2000 }, - { 0x1a00, 0x32e9, 0x0000 }, - { 0x1a00, 0x32eb, 0x0000 }, - { 0x9a00, 0x32ee, 0x2000 }, - { 0x1a00, 0x32ed, 0x0000 }, - { 0x1a00, 0x32ef, 0x0000 }, - { 0x9a00, 0x3301, 0x5000 }, - { 0x9a00, 0x32f8, 0x4000 }, - { 0x9a00, 0x32f4, 0x3000 }, - { 0x9a00, 0x32f2, 0x2000 }, - { 0x1a00, 0x32f1, 0x0000 }, - { 0x1a00, 0x32f3, 0x0000 }, - { 0x9a00, 0x32f6, 0x2000 }, - { 0x1a00, 0x32f5, 0x0000 }, - { 0x1a00, 0x32f7, 0x0000 }, - { 0x9a00, 0x32fc, 0x3000 }, - { 0x9a00, 0x32fa, 0x2000 }, - { 0x1a00, 0x32f9, 0x0000 }, - { 0x1a00, 0x32fb, 0x0000 }, - { 0x9a00, 0x32fe, 0x2000 }, - { 0x1a00, 0x32fd, 0x0000 }, - { 0x1a00, 0x3300, 0x0000 }, - { 0x9a00, 0x3309, 0x4000 }, - { 0x9a00, 0x3305, 0x3000 }, - { 0x9a00, 0x3303, 0x2000 }, - { 0x1a00, 0x3302, 0x0000 }, - { 0x1a00, 0x3304, 0x0000 }, - { 0x9a00, 0x3307, 0x2000 }, - { 0x1a00, 0x3306, 0x0000 }, - { 0x1a00, 0x3308, 0x0000 }, - { 0x9a00, 0x330d, 0x3000 }, - { 0x9a00, 0x330b, 0x2000 }, - { 0x1a00, 0x330a, 0x0000 }, - { 0x1a00, 0x330c, 0x0000 }, - { 0x9a00, 0x330f, 0x2000 }, - { 0x1a00, 0x330e, 0x0000 }, - { 0x1a00, 0x3310, 0x0000 }, - { 0x9a00, 0x3351, 0x7000 }, - { 0x9a00, 0x3331, 0x6000 }, - { 0x9a00, 0x3321, 0x5000 }, - { 0x9a00, 0x3319, 0x4000 }, - { 0x9a00, 0x3315, 0x3000 }, - { 0x9a00, 0x3313, 0x2000 }, - { 0x1a00, 0x3312, 0x0000 }, - { 0x1a00, 0x3314, 0x0000 }, - { 0x9a00, 0x3317, 0x2000 }, - { 0x1a00, 0x3316, 0x0000 }, - { 0x1a00, 0x3318, 0x0000 }, - { 0x9a00, 0x331d, 0x3000 }, - { 0x9a00, 0x331b, 0x2000 }, - { 0x1a00, 0x331a, 0x0000 }, - { 0x1a00, 0x331c, 0x0000 }, - { 0x9a00, 0x331f, 0x2000 }, - { 0x1a00, 0x331e, 0x0000 }, - { 0x1a00, 0x3320, 0x0000 }, - { 0x9a00, 0x3329, 0x4000 }, - { 0x9a00, 0x3325, 0x3000 }, - { 0x9a00, 0x3323, 0x2000 }, - { 0x1a00, 0x3322, 0x0000 }, - { 0x1a00, 0x3324, 0x0000 }, - { 0x9a00, 0x3327, 0x2000 }, - { 0x1a00, 0x3326, 0x0000 }, - { 0x1a00, 0x3328, 0x0000 }, - { 0x9a00, 0x332d, 0x3000 }, - { 0x9a00, 0x332b, 0x2000 }, - { 0x1a00, 0x332a, 0x0000 }, - { 0x1a00, 0x332c, 0x0000 }, - { 0x9a00, 0x332f, 0x2000 }, - { 0x1a00, 0x332e, 0x0000 }, - { 0x1a00, 0x3330, 0x0000 }, - { 0x9a00, 0x3341, 0x5000 }, - { 0x9a00, 0x3339, 0x4000 }, - { 0x9a00, 0x3335, 0x3000 }, - { 0x9a00, 0x3333, 0x2000 }, - { 0x1a00, 0x3332, 0x0000 }, - { 0x1a00, 0x3334, 0x0000 }, - { 0x9a00, 0x3337, 0x2000 }, - { 0x1a00, 0x3336, 0x0000 }, - { 0x1a00, 0x3338, 0x0000 }, - { 0x9a00, 0x333d, 0x3000 }, - { 0x9a00, 0x333b, 0x2000 }, - { 0x1a00, 0x333a, 0x0000 }, - { 0x1a00, 0x333c, 0x0000 }, - { 0x9a00, 0x333f, 0x2000 }, - { 0x1a00, 0x333e, 0x0000 }, - { 0x1a00, 0x3340, 0x0000 }, - { 0x9a00, 0x3349, 0x4000 }, - { 0x9a00, 0x3345, 0x3000 }, - { 0x9a00, 0x3343, 0x2000 }, - { 0x1a00, 0x3342, 0x0000 }, - { 0x1a00, 0x3344, 0x0000 }, - { 0x9a00, 0x3347, 0x2000 }, - { 0x1a00, 0x3346, 0x0000 }, - { 0x1a00, 0x3348, 0x0000 }, - { 0x9a00, 0x334d, 0x3000 }, - { 0x9a00, 0x334b, 0x2000 }, - { 0x1a00, 0x334a, 0x0000 }, - { 0x1a00, 0x334c, 0x0000 }, - { 0x9a00, 0x334f, 0x2000 }, - { 0x1a00, 0x334e, 0x0000 }, - { 0x1a00, 0x3350, 0x0000 }, - { 0x9a00, 0x3371, 0x6000 }, - { 0x9a00, 0x3361, 0x5000 }, - { 0x9a00, 0x3359, 0x4000 }, - { 0x9a00, 0x3355, 0x3000 }, - { 0x9a00, 0x3353, 0x2000 }, - { 0x1a00, 0x3352, 0x0000 }, - { 0x1a00, 0x3354, 0x0000 }, - { 0x9a00, 0x3357, 0x2000 }, - { 0x1a00, 0x3356, 0x0000 }, - { 0x1a00, 0x3358, 0x0000 }, - { 0x9a00, 0x335d, 0x3000 }, - { 0x9a00, 0x335b, 0x2000 }, - { 0x1a00, 0x335a, 0x0000 }, - { 0x1a00, 0x335c, 0x0000 }, - { 0x9a00, 0x335f, 0x2000 }, - { 0x1a00, 0x335e, 0x0000 }, - { 0x1a00, 0x3360, 0x0000 }, - { 0x9a00, 0x3369, 0x4000 }, - { 0x9a00, 0x3365, 0x3000 }, - { 0x9a00, 0x3363, 0x2000 }, - { 0x1a00, 0x3362, 0x0000 }, - { 0x1a00, 0x3364, 0x0000 }, - { 0x9a00, 0x3367, 0x2000 }, - { 0x1a00, 0x3366, 0x0000 }, - { 0x1a00, 0x3368, 0x0000 }, - { 0x9a00, 0x336d, 0x3000 }, - { 0x9a00, 0x336b, 0x2000 }, - { 0x1a00, 0x336a, 0x0000 }, - { 0x1a00, 0x336c, 0x0000 }, - { 0x9a00, 0x336f, 0x2000 }, - { 0x1a00, 0x336e, 0x0000 }, - { 0x1a00, 0x3370, 0x0000 }, - { 0x9a00, 0x3381, 0x5000 }, - { 0x9a00, 0x3379, 0x4000 }, - { 0x9a00, 0x3375, 0x3000 }, - { 0x9a00, 0x3373, 0x2000 }, - { 0x1a00, 0x3372, 0x0000 }, - { 0x1a00, 0x3374, 0x0000 }, - { 0x9a00, 0x3377, 0x2000 }, - { 0x1a00, 0x3376, 0x0000 }, - { 0x1a00, 0x3378, 0x0000 }, - { 0x9a00, 0x337d, 0x3000 }, - { 0x9a00, 0x337b, 0x2000 }, - { 0x1a00, 0x337a, 0x0000 }, - { 0x1a00, 0x337c, 0x0000 }, - { 0x9a00, 0x337f, 0x2000 }, - { 0x1a00, 0x337e, 0x0000 }, - { 0x1a00, 0x3380, 0x0000 }, - { 0x9a00, 0x3389, 0x4000 }, - { 0x9a00, 0x3385, 0x3000 }, - { 0x9a00, 0x3383, 0x2000 }, - { 0x1a00, 0x3382, 0x0000 }, - { 0x1a00, 0x3384, 0x0000 }, - { 0x9a00, 0x3387, 0x2000 }, - { 0x1a00, 0x3386, 0x0000 }, - { 0x1a00, 0x3388, 0x0000 }, - { 0x9a00, 0x338d, 0x3000 }, - { 0x9a00, 0x338b, 0x2000 }, - { 0x1a00, 0x338a, 0x0000 }, - { 0x1a00, 0x338c, 0x0000 }, - { 0x9a00, 0x338f, 0x2000 }, - { 0x1a00, 0x338e, 0x0000 }, - { 0x1a00, 0x3390, 0x0000 }, - { 0x8700, 0xa14d, 0xa000 }, - { 0x8700, 0xa04d, 0x9000 }, - { 0x9a00, 0x4dcf, 0x8000 }, - { 0x9a00, 0x33d1, 0x7000 }, - { 0x9a00, 0x33b1, 0x6000 }, - { 0x9a00, 0x33a1, 0x5000 }, - { 0x9a00, 0x3399, 0x4000 }, - { 0x9a00, 0x3395, 0x3000 }, - { 0x9a00, 0x3393, 0x2000 }, - { 0x1a00, 0x3392, 0x0000 }, - { 0x1a00, 0x3394, 0x0000 }, - { 0x9a00, 0x3397, 0x2000 }, - { 0x1a00, 0x3396, 0x0000 }, - { 0x1a00, 0x3398, 0x0000 }, - { 0x9a00, 0x339d, 0x3000 }, - { 0x9a00, 0x339b, 0x2000 }, - { 0x1a00, 0x339a, 0x0000 }, - { 0x1a00, 0x339c, 0x0000 }, - { 0x9a00, 0x339f, 0x2000 }, - { 0x1a00, 0x339e, 0x0000 }, - { 0x1a00, 0x33a0, 0x0000 }, - { 0x9a00, 0x33a9, 0x4000 }, - { 0x9a00, 0x33a5, 0x3000 }, - { 0x9a00, 0x33a3, 0x2000 }, - { 0x1a00, 0x33a2, 0x0000 }, - { 0x1a00, 0x33a4, 0x0000 }, - { 0x9a00, 0x33a7, 0x2000 }, - { 0x1a00, 0x33a6, 0x0000 }, - { 0x1a00, 0x33a8, 0x0000 }, - { 0x9a00, 0x33ad, 0x3000 }, - { 0x9a00, 0x33ab, 0x2000 }, - { 0x1a00, 0x33aa, 0x0000 }, - { 0x1a00, 0x33ac, 0x0000 }, - { 0x9a00, 0x33af, 0x2000 }, - { 0x1a00, 0x33ae, 0x0000 }, - { 0x1a00, 0x33b0, 0x0000 }, - { 0x9a00, 0x33c1, 0x5000 }, - { 0x9a00, 0x33b9, 0x4000 }, - { 0x9a00, 0x33b5, 0x3000 }, - { 0x9a00, 0x33b3, 0x2000 }, - { 0x1a00, 0x33b2, 0x0000 }, - { 0x1a00, 0x33b4, 0x0000 }, - { 0x9a00, 0x33b7, 0x2000 }, - { 0x1a00, 0x33b6, 0x0000 }, - { 0x1a00, 0x33b8, 0x0000 }, - { 0x9a00, 0x33bd, 0x3000 }, - { 0x9a00, 0x33bb, 0x2000 }, - { 0x1a00, 0x33ba, 0x0000 }, - { 0x1a00, 0x33bc, 0x0000 }, - { 0x9a00, 0x33bf, 0x2000 }, - { 0x1a00, 0x33be, 0x0000 }, - { 0x1a00, 0x33c0, 0x0000 }, - { 0x9a00, 0x33c9, 0x4000 }, - { 0x9a00, 0x33c5, 0x3000 }, - { 0x9a00, 0x33c3, 0x2000 }, - { 0x1a00, 0x33c2, 0x0000 }, - { 0x1a00, 0x33c4, 0x0000 }, - { 0x9a00, 0x33c7, 0x2000 }, - { 0x1a00, 0x33c6, 0x0000 }, - { 0x1a00, 0x33c8, 0x0000 }, - { 0x9a00, 0x33cd, 0x3000 }, - { 0x9a00, 0x33cb, 0x2000 }, - { 0x1a00, 0x33ca, 0x0000 }, - { 0x1a00, 0x33cc, 0x0000 }, - { 0x9a00, 0x33cf, 0x2000 }, - { 0x1a00, 0x33ce, 0x0000 }, - { 0x1a00, 0x33d0, 0x0000 }, - { 0x9a00, 0x33f1, 0x6000 }, - { 0x9a00, 0x33e1, 0x5000 }, - { 0x9a00, 0x33d9, 0x4000 }, - { 0x9a00, 0x33d5, 0x3000 }, - { 0x9a00, 0x33d3, 0x2000 }, - { 0x1a00, 0x33d2, 0x0000 }, - { 0x1a00, 0x33d4, 0x0000 }, - { 0x9a00, 0x33d7, 0x2000 }, - { 0x1a00, 0x33d6, 0x0000 }, - { 0x1a00, 0x33d8, 0x0000 }, - { 0x9a00, 0x33dd, 0x3000 }, - { 0x9a00, 0x33db, 0x2000 }, - { 0x1a00, 0x33da, 0x0000 }, - { 0x1a00, 0x33dc, 0x0000 }, - { 0x9a00, 0x33df, 0x2000 }, - { 0x1a00, 0x33de, 0x0000 }, - { 0x1a00, 0x33e0, 0x0000 }, - { 0x9a00, 0x33e9, 0x4000 }, - { 0x9a00, 0x33e5, 0x3000 }, - { 0x9a00, 0x33e3, 0x2000 }, - { 0x1a00, 0x33e2, 0x0000 }, - { 0x1a00, 0x33e4, 0x0000 }, - { 0x9a00, 0x33e7, 0x2000 }, - { 0x1a00, 0x33e6, 0x0000 }, - { 0x1a00, 0x33e8, 0x0000 }, - { 0x9a00, 0x33ed, 0x3000 }, - { 0x9a00, 0x33eb, 0x2000 }, - { 0x1a00, 0x33ea, 0x0000 }, - { 0x1a00, 0x33ec, 0x0000 }, - { 0x9a00, 0x33ef, 0x2000 }, - { 0x1a00, 0x33ee, 0x0000 }, - { 0x1a00, 0x33f0, 0x0000 }, - { 0x8700, 0x4db5, 0x5000 }, - { 0x9a00, 0x33f9, 0x4000 }, - { 0x9a00, 0x33f5, 0x3000 }, - { 0x9a00, 0x33f3, 0x2000 }, - { 0x1a00, 0x33f2, 0x0000 }, - { 0x1a00, 0x33f4, 0x0000 }, - { 0x9a00, 0x33f7, 0x2000 }, - { 0x1a00, 0x33f6, 0x0000 }, - { 0x1a00, 0x33f8, 0x0000 }, - { 0x9a00, 0x33fd, 0x3000 }, - { 0x9a00, 0x33fb, 0x2000 }, - { 0x1a00, 0x33fa, 0x0000 }, - { 0x1a00, 0x33fc, 0x0000 }, - { 0x9a00, 0x33ff, 0x2000 }, - { 0x1a00, 0x33fe, 0x0000 }, - { 0x0700, 0x3400, 0x0000 }, - { 0x9a00, 0x4dc7, 0x4000 }, - { 0x9a00, 0x4dc3, 0x3000 }, - { 0x9a00, 0x4dc1, 0x2000 }, - { 0x1a00, 0x4dc0, 0x0000 }, - { 0x1a00, 0x4dc2, 0x0000 }, - { 0x9a00, 0x4dc5, 0x2000 }, - { 0x1a00, 0x4dc4, 0x0000 }, - { 0x1a00, 0x4dc6, 0x0000 }, - { 0x9a00, 0x4dcb, 0x3000 }, - { 0x9a00, 0x4dc9, 0x2000 }, - { 0x1a00, 0x4dc8, 0x0000 }, - { 0x1a00, 0x4dca, 0x0000 }, - { 0x9a00, 0x4dcd, 0x2000 }, - { 0x1a00, 0x4dcc, 0x0000 }, - { 0x1a00, 0x4dce, 0x0000 }, - { 0x8700, 0xa00d, 0x7000 }, - { 0x9a00, 0x4def, 0x6000 }, - { 0x9a00, 0x4ddf, 0x5000 }, - { 0x9a00, 0x4dd7, 0x4000 }, - { 0x9a00, 0x4dd3, 0x3000 }, - { 0x9a00, 0x4dd1, 0x2000 }, - { 0x1a00, 0x4dd0, 0x0000 }, - { 0x1a00, 0x4dd2, 0x0000 }, - { 0x9a00, 0x4dd5, 0x2000 }, - { 0x1a00, 0x4dd4, 0x0000 }, - { 0x1a00, 0x4dd6, 0x0000 }, - { 0x9a00, 0x4ddb, 0x3000 }, - { 0x9a00, 0x4dd9, 0x2000 }, - { 0x1a00, 0x4dd8, 0x0000 }, - { 0x1a00, 0x4dda, 0x0000 }, - { 0x9a00, 0x4ddd, 0x2000 }, - { 0x1a00, 0x4ddc, 0x0000 }, - { 0x1a00, 0x4dde, 0x0000 }, - { 0x9a00, 0x4de7, 0x4000 }, - { 0x9a00, 0x4de3, 0x3000 }, - { 0x9a00, 0x4de1, 0x2000 }, - { 0x1a00, 0x4de0, 0x0000 }, - { 0x1a00, 0x4de2, 0x0000 }, - { 0x9a00, 0x4de5, 0x2000 }, - { 0x1a00, 0x4de4, 0x0000 }, - { 0x1a00, 0x4de6, 0x0000 }, - { 0x9a00, 0x4deb, 0x3000 }, - { 0x9a00, 0x4de9, 0x2000 }, - { 0x1a00, 0x4de8, 0x0000 }, - { 0x1a00, 0x4dea, 0x0000 }, - { 0x9a00, 0x4ded, 0x2000 }, - { 0x1a00, 0x4dec, 0x0000 }, - { 0x1a00, 0x4dee, 0x0000 }, - { 0x9a00, 0x4dff, 0x5000 }, - { 0x9a00, 0x4df7, 0x4000 }, - { 0x9a00, 0x4df3, 0x3000 }, - { 0x9a00, 0x4df1, 0x2000 }, - { 0x1a00, 0x4df0, 0x0000 }, - { 0x1a00, 0x4df2, 0x0000 }, - { 0x9a00, 0x4df5, 0x2000 }, - { 0x1a00, 0x4df4, 0x0000 }, - { 0x1a00, 0x4df6, 0x0000 }, - { 0x9a00, 0x4dfb, 0x3000 }, - { 0x9a00, 0x4df9, 0x2000 }, - { 0x1a00, 0x4df8, 0x0000 }, - { 0x1a00, 0x4dfa, 0x0000 }, - { 0x9a00, 0x4dfd, 0x2000 }, - { 0x1a00, 0x4dfc, 0x0000 }, - { 0x1a00, 0x4dfe, 0x0000 }, - { 0x8700, 0xa005, 0x4000 }, - { 0x8700, 0xa001, 0x3000 }, - { 0x8700, 0x9fa5, 0x2000 }, - { 0x0700, 0x4e00, 0x0000 }, - { 0x0700, 0xa000, 0x0000 }, - { 0x8700, 0xa003, 0x2000 }, - { 0x0700, 0xa002, 0x0000 }, - { 0x0700, 0xa004, 0x0000 }, - { 0x8700, 0xa009, 0x3000 }, - { 0x8700, 0xa007, 0x2000 }, - { 0x0700, 0xa006, 0x0000 }, - { 0x0700, 0xa008, 0x0000 }, - { 0x8700, 0xa00b, 0x2000 }, - { 0x0700, 0xa00a, 0x0000 }, - { 0x0700, 0xa00c, 0x0000 }, - { 0x8700, 0xa02d, 0x6000 }, - { 0x8700, 0xa01d, 0x5000 }, - { 0x8700, 0xa015, 0x4000 }, - { 0x8700, 0xa011, 0x3000 }, - { 0x8700, 0xa00f, 0x2000 }, - { 0x0700, 0xa00e, 0x0000 }, - { 0x0700, 0xa010, 0x0000 }, - { 0x8700, 0xa013, 0x2000 }, - { 0x0700, 0xa012, 0x0000 }, - { 0x0700, 0xa014, 0x0000 }, - { 0x8700, 0xa019, 0x3000 }, - { 0x8700, 0xa017, 0x2000 }, - { 0x0700, 0xa016, 0x0000 }, - { 0x0700, 0xa018, 0x0000 }, - { 0x8700, 0xa01b, 0x2000 }, - { 0x0700, 0xa01a, 0x0000 }, - { 0x0700, 0xa01c, 0x0000 }, - { 0x8700, 0xa025, 0x4000 }, - { 0x8700, 0xa021, 0x3000 }, - { 0x8700, 0xa01f, 0x2000 }, - { 0x0700, 0xa01e, 0x0000 }, - { 0x0700, 0xa020, 0x0000 }, - { 0x8700, 0xa023, 0x2000 }, - { 0x0700, 0xa022, 0x0000 }, - { 0x0700, 0xa024, 0x0000 }, - { 0x8700, 0xa029, 0x3000 }, - { 0x8700, 0xa027, 0x2000 }, - { 0x0700, 0xa026, 0x0000 }, - { 0x0700, 0xa028, 0x0000 }, - { 0x8700, 0xa02b, 0x2000 }, - { 0x0700, 0xa02a, 0x0000 }, - { 0x0700, 0xa02c, 0x0000 }, - { 0x8700, 0xa03d, 0x5000 }, - { 0x8700, 0xa035, 0x4000 }, - { 0x8700, 0xa031, 0x3000 }, - { 0x8700, 0xa02f, 0x2000 }, - { 0x0700, 0xa02e, 0x0000 }, - { 0x0700, 0xa030, 0x0000 }, - { 0x8700, 0xa033, 0x2000 }, - { 0x0700, 0xa032, 0x0000 }, - { 0x0700, 0xa034, 0x0000 }, - { 0x8700, 0xa039, 0x3000 }, - { 0x8700, 0xa037, 0x2000 }, - { 0x0700, 0xa036, 0x0000 }, - { 0x0700, 0xa038, 0x0000 }, - { 0x8700, 0xa03b, 0x2000 }, - { 0x0700, 0xa03a, 0x0000 }, - { 0x0700, 0xa03c, 0x0000 }, - { 0x8700, 0xa045, 0x4000 }, - { 0x8700, 0xa041, 0x3000 }, - { 0x8700, 0xa03f, 0x2000 }, - { 0x0700, 0xa03e, 0x0000 }, - { 0x0700, 0xa040, 0x0000 }, - { 0x8700, 0xa043, 0x2000 }, - { 0x0700, 0xa042, 0x0000 }, - { 0x0700, 0xa044, 0x0000 }, - { 0x8700, 0xa049, 0x3000 }, - { 0x8700, 0xa047, 0x2000 }, - { 0x0700, 0xa046, 0x0000 }, - { 0x0700, 0xa048, 0x0000 }, - { 0x8700, 0xa04b, 0x2000 }, - { 0x0700, 0xa04a, 0x0000 }, - { 0x0700, 0xa04c, 0x0000 }, - { 0x8700, 0xa0cd, 0x8000 }, - { 0x8700, 0xa08d, 0x7000 }, - { 0x8700, 0xa06d, 0x6000 }, - { 0x8700, 0xa05d, 0x5000 }, - { 0x8700, 0xa055, 0x4000 }, - { 0x8700, 0xa051, 0x3000 }, - { 0x8700, 0xa04f, 0x2000 }, - { 0x0700, 0xa04e, 0x0000 }, - { 0x0700, 0xa050, 0x0000 }, - { 0x8700, 0xa053, 0x2000 }, - { 0x0700, 0xa052, 0x0000 }, - { 0x0700, 0xa054, 0x0000 }, - { 0x8700, 0xa059, 0x3000 }, - { 0x8700, 0xa057, 0x2000 }, - { 0x0700, 0xa056, 0x0000 }, - { 0x0700, 0xa058, 0x0000 }, - { 0x8700, 0xa05b, 0x2000 }, - { 0x0700, 0xa05a, 0x0000 }, - { 0x0700, 0xa05c, 0x0000 }, - { 0x8700, 0xa065, 0x4000 }, - { 0x8700, 0xa061, 0x3000 }, - { 0x8700, 0xa05f, 0x2000 }, - { 0x0700, 0xa05e, 0x0000 }, - { 0x0700, 0xa060, 0x0000 }, - { 0x8700, 0xa063, 0x2000 }, - { 0x0700, 0xa062, 0x0000 }, - { 0x0700, 0xa064, 0x0000 }, - { 0x8700, 0xa069, 0x3000 }, - { 0x8700, 0xa067, 0x2000 }, - { 0x0700, 0xa066, 0x0000 }, - { 0x0700, 0xa068, 0x0000 }, - { 0x8700, 0xa06b, 0x2000 }, - { 0x0700, 0xa06a, 0x0000 }, - { 0x0700, 0xa06c, 0x0000 }, - { 0x8700, 0xa07d, 0x5000 }, - { 0x8700, 0xa075, 0x4000 }, - { 0x8700, 0xa071, 0x3000 }, - { 0x8700, 0xa06f, 0x2000 }, - { 0x0700, 0xa06e, 0x0000 }, - { 0x0700, 0xa070, 0x0000 }, - { 0x8700, 0xa073, 0x2000 }, - { 0x0700, 0xa072, 0x0000 }, - { 0x0700, 0xa074, 0x0000 }, - { 0x8700, 0xa079, 0x3000 }, - { 0x8700, 0xa077, 0x2000 }, - { 0x0700, 0xa076, 0x0000 }, - { 0x0700, 0xa078, 0x0000 }, - { 0x8700, 0xa07b, 0x2000 }, - { 0x0700, 0xa07a, 0x0000 }, - { 0x0700, 0xa07c, 0x0000 }, - { 0x8700, 0xa085, 0x4000 }, - { 0x8700, 0xa081, 0x3000 }, - { 0x8700, 0xa07f, 0x2000 }, - { 0x0700, 0xa07e, 0x0000 }, - { 0x0700, 0xa080, 0x0000 }, - { 0x8700, 0xa083, 0x2000 }, - { 0x0700, 0xa082, 0x0000 }, - { 0x0700, 0xa084, 0x0000 }, - { 0x8700, 0xa089, 0x3000 }, - { 0x8700, 0xa087, 0x2000 }, - { 0x0700, 0xa086, 0x0000 }, - { 0x0700, 0xa088, 0x0000 }, - { 0x8700, 0xa08b, 0x2000 }, - { 0x0700, 0xa08a, 0x0000 }, - { 0x0700, 0xa08c, 0x0000 }, - { 0x8700, 0xa0ad, 0x6000 }, - { 0x8700, 0xa09d, 0x5000 }, - { 0x8700, 0xa095, 0x4000 }, - { 0x8700, 0xa091, 0x3000 }, - { 0x8700, 0xa08f, 0x2000 }, - { 0x0700, 0xa08e, 0x0000 }, - { 0x0700, 0xa090, 0x0000 }, - { 0x8700, 0xa093, 0x2000 }, - { 0x0700, 0xa092, 0x0000 }, - { 0x0700, 0xa094, 0x0000 }, - { 0x8700, 0xa099, 0x3000 }, - { 0x8700, 0xa097, 0x2000 }, - { 0x0700, 0xa096, 0x0000 }, - { 0x0700, 0xa098, 0x0000 }, - { 0x8700, 0xa09b, 0x2000 }, - { 0x0700, 0xa09a, 0x0000 }, - { 0x0700, 0xa09c, 0x0000 }, - { 0x8700, 0xa0a5, 0x4000 }, - { 0x8700, 0xa0a1, 0x3000 }, - { 0x8700, 0xa09f, 0x2000 }, - { 0x0700, 0xa09e, 0x0000 }, - { 0x0700, 0xa0a0, 0x0000 }, - { 0x8700, 0xa0a3, 0x2000 }, - { 0x0700, 0xa0a2, 0x0000 }, - { 0x0700, 0xa0a4, 0x0000 }, - { 0x8700, 0xa0a9, 0x3000 }, - { 0x8700, 0xa0a7, 0x2000 }, - { 0x0700, 0xa0a6, 0x0000 }, - { 0x0700, 0xa0a8, 0x0000 }, - { 0x8700, 0xa0ab, 0x2000 }, - { 0x0700, 0xa0aa, 0x0000 }, - { 0x0700, 0xa0ac, 0x0000 }, - { 0x8700, 0xa0bd, 0x5000 }, - { 0x8700, 0xa0b5, 0x4000 }, - { 0x8700, 0xa0b1, 0x3000 }, - { 0x8700, 0xa0af, 0x2000 }, - { 0x0700, 0xa0ae, 0x0000 }, - { 0x0700, 0xa0b0, 0x0000 }, - { 0x8700, 0xa0b3, 0x2000 }, - { 0x0700, 0xa0b2, 0x0000 }, - { 0x0700, 0xa0b4, 0x0000 }, - { 0x8700, 0xa0b9, 0x3000 }, - { 0x8700, 0xa0b7, 0x2000 }, - { 0x0700, 0xa0b6, 0x0000 }, - { 0x0700, 0xa0b8, 0x0000 }, - { 0x8700, 0xa0bb, 0x2000 }, - { 0x0700, 0xa0ba, 0x0000 }, - { 0x0700, 0xa0bc, 0x0000 }, - { 0x8700, 0xa0c5, 0x4000 }, - { 0x8700, 0xa0c1, 0x3000 }, - { 0x8700, 0xa0bf, 0x2000 }, - { 0x0700, 0xa0be, 0x0000 }, - { 0x0700, 0xa0c0, 0x0000 }, - { 0x8700, 0xa0c3, 0x2000 }, - { 0x0700, 0xa0c2, 0x0000 }, - { 0x0700, 0xa0c4, 0x0000 }, - { 0x8700, 0xa0c9, 0x3000 }, - { 0x8700, 0xa0c7, 0x2000 }, - { 0x0700, 0xa0c6, 0x0000 }, - { 0x0700, 0xa0c8, 0x0000 }, - { 0x8700, 0xa0cb, 0x2000 }, - { 0x0700, 0xa0ca, 0x0000 }, - { 0x0700, 0xa0cc, 0x0000 }, - { 0x8700, 0xa10d, 0x7000 }, - { 0x8700, 0xa0ed, 0x6000 }, - { 0x8700, 0xa0dd, 0x5000 }, - { 0x8700, 0xa0d5, 0x4000 }, - { 0x8700, 0xa0d1, 0x3000 }, - { 0x8700, 0xa0cf, 0x2000 }, - { 0x0700, 0xa0ce, 0x0000 }, - { 0x0700, 0xa0d0, 0x0000 }, - { 0x8700, 0xa0d3, 0x2000 }, - { 0x0700, 0xa0d2, 0x0000 }, - { 0x0700, 0xa0d4, 0x0000 }, - { 0x8700, 0xa0d9, 0x3000 }, - { 0x8700, 0xa0d7, 0x2000 }, - { 0x0700, 0xa0d6, 0x0000 }, - { 0x0700, 0xa0d8, 0x0000 }, - { 0x8700, 0xa0db, 0x2000 }, - { 0x0700, 0xa0da, 0x0000 }, - { 0x0700, 0xa0dc, 0x0000 }, - { 0x8700, 0xa0e5, 0x4000 }, - { 0x8700, 0xa0e1, 0x3000 }, - { 0x8700, 0xa0df, 0x2000 }, - { 0x0700, 0xa0de, 0x0000 }, - { 0x0700, 0xa0e0, 0x0000 }, - { 0x8700, 0xa0e3, 0x2000 }, - { 0x0700, 0xa0e2, 0x0000 }, - { 0x0700, 0xa0e4, 0x0000 }, - { 0x8700, 0xa0e9, 0x3000 }, - { 0x8700, 0xa0e7, 0x2000 }, - { 0x0700, 0xa0e6, 0x0000 }, - { 0x0700, 0xa0e8, 0x0000 }, - { 0x8700, 0xa0eb, 0x2000 }, - { 0x0700, 0xa0ea, 0x0000 }, - { 0x0700, 0xa0ec, 0x0000 }, - { 0x8700, 0xa0fd, 0x5000 }, - { 0x8700, 0xa0f5, 0x4000 }, - { 0x8700, 0xa0f1, 0x3000 }, - { 0x8700, 0xa0ef, 0x2000 }, - { 0x0700, 0xa0ee, 0x0000 }, - { 0x0700, 0xa0f0, 0x0000 }, - { 0x8700, 0xa0f3, 0x2000 }, - { 0x0700, 0xa0f2, 0x0000 }, - { 0x0700, 0xa0f4, 0x0000 }, - { 0x8700, 0xa0f9, 0x3000 }, - { 0x8700, 0xa0f7, 0x2000 }, - { 0x0700, 0xa0f6, 0x0000 }, - { 0x0700, 0xa0f8, 0x0000 }, - { 0x8700, 0xa0fb, 0x2000 }, - { 0x0700, 0xa0fa, 0x0000 }, - { 0x0700, 0xa0fc, 0x0000 }, - { 0x8700, 0xa105, 0x4000 }, - { 0x8700, 0xa101, 0x3000 }, - { 0x8700, 0xa0ff, 0x2000 }, - { 0x0700, 0xa0fe, 0x0000 }, - { 0x0700, 0xa100, 0x0000 }, - { 0x8700, 0xa103, 0x2000 }, - { 0x0700, 0xa102, 0x0000 }, - { 0x0700, 0xa104, 0x0000 }, - { 0x8700, 0xa109, 0x3000 }, - { 0x8700, 0xa107, 0x2000 }, - { 0x0700, 0xa106, 0x0000 }, - { 0x0700, 0xa108, 0x0000 }, - { 0x8700, 0xa10b, 0x2000 }, - { 0x0700, 0xa10a, 0x0000 }, - { 0x0700, 0xa10c, 0x0000 }, - { 0x8700, 0xa12d, 0x6000 }, - { 0x8700, 0xa11d, 0x5000 }, - { 0x8700, 0xa115, 0x4000 }, - { 0x8700, 0xa111, 0x3000 }, - { 0x8700, 0xa10f, 0x2000 }, - { 0x0700, 0xa10e, 0x0000 }, - { 0x0700, 0xa110, 0x0000 }, - { 0x8700, 0xa113, 0x2000 }, - { 0x0700, 0xa112, 0x0000 }, - { 0x0700, 0xa114, 0x0000 }, - { 0x8700, 0xa119, 0x3000 }, - { 0x8700, 0xa117, 0x2000 }, - { 0x0700, 0xa116, 0x0000 }, - { 0x0700, 0xa118, 0x0000 }, - { 0x8700, 0xa11b, 0x2000 }, - { 0x0700, 0xa11a, 0x0000 }, - { 0x0700, 0xa11c, 0x0000 }, - { 0x8700, 0xa125, 0x4000 }, - { 0x8700, 0xa121, 0x3000 }, - { 0x8700, 0xa11f, 0x2000 }, - { 0x0700, 0xa11e, 0x0000 }, - { 0x0700, 0xa120, 0x0000 }, - { 0x8700, 0xa123, 0x2000 }, - { 0x0700, 0xa122, 0x0000 }, - { 0x0700, 0xa124, 0x0000 }, - { 0x8700, 0xa129, 0x3000 }, - { 0x8700, 0xa127, 0x2000 }, - { 0x0700, 0xa126, 0x0000 }, - { 0x0700, 0xa128, 0x0000 }, - { 0x8700, 0xa12b, 0x2000 }, - { 0x0700, 0xa12a, 0x0000 }, - { 0x0700, 0xa12c, 0x0000 }, - { 0x8700, 0xa13d, 0x5000 }, - { 0x8700, 0xa135, 0x4000 }, - { 0x8700, 0xa131, 0x3000 }, - { 0x8700, 0xa12f, 0x2000 }, - { 0x0700, 0xa12e, 0x0000 }, - { 0x0700, 0xa130, 0x0000 }, - { 0x8700, 0xa133, 0x2000 }, - { 0x0700, 0xa132, 0x0000 }, - { 0x0700, 0xa134, 0x0000 }, - { 0x8700, 0xa139, 0x3000 }, - { 0x8700, 0xa137, 0x2000 }, - { 0x0700, 0xa136, 0x0000 }, - { 0x0700, 0xa138, 0x0000 }, - { 0x8700, 0xa13b, 0x2000 }, - { 0x0700, 0xa13a, 0x0000 }, - { 0x0700, 0xa13c, 0x0000 }, - { 0x8700, 0xa145, 0x4000 }, - { 0x8700, 0xa141, 0x3000 }, - { 0x8700, 0xa13f, 0x2000 }, - { 0x0700, 0xa13e, 0x0000 }, - { 0x0700, 0xa140, 0x0000 }, - { 0x8700, 0xa143, 0x2000 }, - { 0x0700, 0xa142, 0x0000 }, - { 0x0700, 0xa144, 0x0000 }, - { 0x8700, 0xa149, 0x3000 }, - { 0x8700, 0xa147, 0x2000 }, - { 0x0700, 0xa146, 0x0000 }, - { 0x0700, 0xa148, 0x0000 }, - { 0x8700, 0xa14b, 0x2000 }, - { 0x0700, 0xa14a, 0x0000 }, - { 0x0700, 0xa14c, 0x0000 }, - { 0x8700, 0xa24d, 0x9000 }, - { 0x8700, 0xa1cd, 0x8000 }, - { 0x8700, 0xa18d, 0x7000 }, - { 0x8700, 0xa16d, 0x6000 }, - { 0x8700, 0xa15d, 0x5000 }, - { 0x8700, 0xa155, 0x4000 }, - { 0x8700, 0xa151, 0x3000 }, - { 0x8700, 0xa14f, 0x2000 }, - { 0x0700, 0xa14e, 0x0000 }, - { 0x0700, 0xa150, 0x0000 }, - { 0x8700, 0xa153, 0x2000 }, - { 0x0700, 0xa152, 0x0000 }, - { 0x0700, 0xa154, 0x0000 }, - { 0x8700, 0xa159, 0x3000 }, - { 0x8700, 0xa157, 0x2000 }, - { 0x0700, 0xa156, 0x0000 }, - { 0x0700, 0xa158, 0x0000 }, - { 0x8700, 0xa15b, 0x2000 }, - { 0x0700, 0xa15a, 0x0000 }, - { 0x0700, 0xa15c, 0x0000 }, - { 0x8700, 0xa165, 0x4000 }, - { 0x8700, 0xa161, 0x3000 }, - { 0x8700, 0xa15f, 0x2000 }, - { 0x0700, 0xa15e, 0x0000 }, - { 0x0700, 0xa160, 0x0000 }, - { 0x8700, 0xa163, 0x2000 }, - { 0x0700, 0xa162, 0x0000 }, - { 0x0700, 0xa164, 0x0000 }, - { 0x8700, 0xa169, 0x3000 }, - { 0x8700, 0xa167, 0x2000 }, - { 0x0700, 0xa166, 0x0000 }, - { 0x0700, 0xa168, 0x0000 }, - { 0x8700, 0xa16b, 0x2000 }, - { 0x0700, 0xa16a, 0x0000 }, - { 0x0700, 0xa16c, 0x0000 }, - { 0x8700, 0xa17d, 0x5000 }, - { 0x8700, 0xa175, 0x4000 }, - { 0x8700, 0xa171, 0x3000 }, - { 0x8700, 0xa16f, 0x2000 }, - { 0x0700, 0xa16e, 0x0000 }, - { 0x0700, 0xa170, 0x0000 }, - { 0x8700, 0xa173, 0x2000 }, - { 0x0700, 0xa172, 0x0000 }, - { 0x0700, 0xa174, 0x0000 }, - { 0x8700, 0xa179, 0x3000 }, - { 0x8700, 0xa177, 0x2000 }, - { 0x0700, 0xa176, 0x0000 }, - { 0x0700, 0xa178, 0x0000 }, - { 0x8700, 0xa17b, 0x2000 }, - { 0x0700, 0xa17a, 0x0000 }, - { 0x0700, 0xa17c, 0x0000 }, - { 0x8700, 0xa185, 0x4000 }, - { 0x8700, 0xa181, 0x3000 }, - { 0x8700, 0xa17f, 0x2000 }, - { 0x0700, 0xa17e, 0x0000 }, - { 0x0700, 0xa180, 0x0000 }, - { 0x8700, 0xa183, 0x2000 }, - { 0x0700, 0xa182, 0x0000 }, - { 0x0700, 0xa184, 0x0000 }, - { 0x8700, 0xa189, 0x3000 }, - { 0x8700, 0xa187, 0x2000 }, - { 0x0700, 0xa186, 0x0000 }, - { 0x0700, 0xa188, 0x0000 }, - { 0x8700, 0xa18b, 0x2000 }, - { 0x0700, 0xa18a, 0x0000 }, - { 0x0700, 0xa18c, 0x0000 }, - { 0x8700, 0xa1ad, 0x6000 }, - { 0x8700, 0xa19d, 0x5000 }, - { 0x8700, 0xa195, 0x4000 }, - { 0x8700, 0xa191, 0x3000 }, - { 0x8700, 0xa18f, 0x2000 }, - { 0x0700, 0xa18e, 0x0000 }, - { 0x0700, 0xa190, 0x0000 }, - { 0x8700, 0xa193, 0x2000 }, - { 0x0700, 0xa192, 0x0000 }, - { 0x0700, 0xa194, 0x0000 }, - { 0x8700, 0xa199, 0x3000 }, - { 0x8700, 0xa197, 0x2000 }, - { 0x0700, 0xa196, 0x0000 }, - { 0x0700, 0xa198, 0x0000 }, - { 0x8700, 0xa19b, 0x2000 }, - { 0x0700, 0xa19a, 0x0000 }, - { 0x0700, 0xa19c, 0x0000 }, - { 0x8700, 0xa1a5, 0x4000 }, - { 0x8700, 0xa1a1, 0x3000 }, - { 0x8700, 0xa19f, 0x2000 }, - { 0x0700, 0xa19e, 0x0000 }, - { 0x0700, 0xa1a0, 0x0000 }, - { 0x8700, 0xa1a3, 0x2000 }, - { 0x0700, 0xa1a2, 0x0000 }, - { 0x0700, 0xa1a4, 0x0000 }, - { 0x8700, 0xa1a9, 0x3000 }, - { 0x8700, 0xa1a7, 0x2000 }, - { 0x0700, 0xa1a6, 0x0000 }, - { 0x0700, 0xa1a8, 0x0000 }, - { 0x8700, 0xa1ab, 0x2000 }, - { 0x0700, 0xa1aa, 0x0000 }, - { 0x0700, 0xa1ac, 0x0000 }, - { 0x8700, 0xa1bd, 0x5000 }, - { 0x8700, 0xa1b5, 0x4000 }, - { 0x8700, 0xa1b1, 0x3000 }, - { 0x8700, 0xa1af, 0x2000 }, - { 0x0700, 0xa1ae, 0x0000 }, - { 0x0700, 0xa1b0, 0x0000 }, - { 0x8700, 0xa1b3, 0x2000 }, - { 0x0700, 0xa1b2, 0x0000 }, - { 0x0700, 0xa1b4, 0x0000 }, - { 0x8700, 0xa1b9, 0x3000 }, - { 0x8700, 0xa1b7, 0x2000 }, - { 0x0700, 0xa1b6, 0x0000 }, - { 0x0700, 0xa1b8, 0x0000 }, - { 0x8700, 0xa1bb, 0x2000 }, - { 0x0700, 0xa1ba, 0x0000 }, - { 0x0700, 0xa1bc, 0x0000 }, - { 0x8700, 0xa1c5, 0x4000 }, - { 0x8700, 0xa1c1, 0x3000 }, - { 0x8700, 0xa1bf, 0x2000 }, - { 0x0700, 0xa1be, 0x0000 }, - { 0x0700, 0xa1c0, 0x0000 }, - { 0x8700, 0xa1c3, 0x2000 }, - { 0x0700, 0xa1c2, 0x0000 }, - { 0x0700, 0xa1c4, 0x0000 }, - { 0x8700, 0xa1c9, 0x3000 }, - { 0x8700, 0xa1c7, 0x2000 }, - { 0x0700, 0xa1c6, 0x0000 }, - { 0x0700, 0xa1c8, 0x0000 }, - { 0x8700, 0xa1cb, 0x2000 }, - { 0x0700, 0xa1ca, 0x0000 }, - { 0x0700, 0xa1cc, 0x0000 }, - { 0x8700, 0xa20d, 0x7000 }, - { 0x8700, 0xa1ed, 0x6000 }, - { 0x8700, 0xa1dd, 0x5000 }, - { 0x8700, 0xa1d5, 0x4000 }, - { 0x8700, 0xa1d1, 0x3000 }, - { 0x8700, 0xa1cf, 0x2000 }, - { 0x0700, 0xa1ce, 0x0000 }, - { 0x0700, 0xa1d0, 0x0000 }, - { 0x8700, 0xa1d3, 0x2000 }, - { 0x0700, 0xa1d2, 0x0000 }, - { 0x0700, 0xa1d4, 0x0000 }, - { 0x8700, 0xa1d9, 0x3000 }, - { 0x8700, 0xa1d7, 0x2000 }, - { 0x0700, 0xa1d6, 0x0000 }, - { 0x0700, 0xa1d8, 0x0000 }, - { 0x8700, 0xa1db, 0x2000 }, - { 0x0700, 0xa1da, 0x0000 }, - { 0x0700, 0xa1dc, 0x0000 }, - { 0x8700, 0xa1e5, 0x4000 }, - { 0x8700, 0xa1e1, 0x3000 }, - { 0x8700, 0xa1df, 0x2000 }, - { 0x0700, 0xa1de, 0x0000 }, - { 0x0700, 0xa1e0, 0x0000 }, - { 0x8700, 0xa1e3, 0x2000 }, - { 0x0700, 0xa1e2, 0x0000 }, - { 0x0700, 0xa1e4, 0x0000 }, - { 0x8700, 0xa1e9, 0x3000 }, - { 0x8700, 0xa1e7, 0x2000 }, - { 0x0700, 0xa1e6, 0x0000 }, - { 0x0700, 0xa1e8, 0x0000 }, - { 0x8700, 0xa1eb, 0x2000 }, - { 0x0700, 0xa1ea, 0x0000 }, - { 0x0700, 0xa1ec, 0x0000 }, - { 0x8700, 0xa1fd, 0x5000 }, - { 0x8700, 0xa1f5, 0x4000 }, - { 0x8700, 0xa1f1, 0x3000 }, - { 0x8700, 0xa1ef, 0x2000 }, - { 0x0700, 0xa1ee, 0x0000 }, - { 0x0700, 0xa1f0, 0x0000 }, - { 0x8700, 0xa1f3, 0x2000 }, - { 0x0700, 0xa1f2, 0x0000 }, - { 0x0700, 0xa1f4, 0x0000 }, - { 0x8700, 0xa1f9, 0x3000 }, - { 0x8700, 0xa1f7, 0x2000 }, - { 0x0700, 0xa1f6, 0x0000 }, - { 0x0700, 0xa1f8, 0x0000 }, - { 0x8700, 0xa1fb, 0x2000 }, - { 0x0700, 0xa1fa, 0x0000 }, - { 0x0700, 0xa1fc, 0x0000 }, - { 0x8700, 0xa205, 0x4000 }, - { 0x8700, 0xa201, 0x3000 }, - { 0x8700, 0xa1ff, 0x2000 }, - { 0x0700, 0xa1fe, 0x0000 }, - { 0x0700, 0xa200, 0x0000 }, - { 0x8700, 0xa203, 0x2000 }, - { 0x0700, 0xa202, 0x0000 }, - { 0x0700, 0xa204, 0x0000 }, - { 0x8700, 0xa209, 0x3000 }, - { 0x8700, 0xa207, 0x2000 }, - { 0x0700, 0xa206, 0x0000 }, - { 0x0700, 0xa208, 0x0000 }, - { 0x8700, 0xa20b, 0x2000 }, - { 0x0700, 0xa20a, 0x0000 }, - { 0x0700, 0xa20c, 0x0000 }, - { 0x8700, 0xa22d, 0x6000 }, - { 0x8700, 0xa21d, 0x5000 }, - { 0x8700, 0xa215, 0x4000 }, - { 0x8700, 0xa211, 0x3000 }, - { 0x8700, 0xa20f, 0x2000 }, - { 0x0700, 0xa20e, 0x0000 }, - { 0x0700, 0xa210, 0x0000 }, - { 0x8700, 0xa213, 0x2000 }, - { 0x0700, 0xa212, 0x0000 }, - { 0x0700, 0xa214, 0x0000 }, - { 0x8700, 0xa219, 0x3000 }, - { 0x8700, 0xa217, 0x2000 }, - { 0x0700, 0xa216, 0x0000 }, - { 0x0700, 0xa218, 0x0000 }, - { 0x8700, 0xa21b, 0x2000 }, - { 0x0700, 0xa21a, 0x0000 }, - { 0x0700, 0xa21c, 0x0000 }, - { 0x8700, 0xa225, 0x4000 }, - { 0x8700, 0xa221, 0x3000 }, - { 0x8700, 0xa21f, 0x2000 }, - { 0x0700, 0xa21e, 0x0000 }, - { 0x0700, 0xa220, 0x0000 }, - { 0x8700, 0xa223, 0x2000 }, - { 0x0700, 0xa222, 0x0000 }, - { 0x0700, 0xa224, 0x0000 }, - { 0x8700, 0xa229, 0x3000 }, - { 0x8700, 0xa227, 0x2000 }, - { 0x0700, 0xa226, 0x0000 }, - { 0x0700, 0xa228, 0x0000 }, - { 0x8700, 0xa22b, 0x2000 }, - { 0x0700, 0xa22a, 0x0000 }, - { 0x0700, 0xa22c, 0x0000 }, - { 0x8700, 0xa23d, 0x5000 }, - { 0x8700, 0xa235, 0x4000 }, - { 0x8700, 0xa231, 0x3000 }, - { 0x8700, 0xa22f, 0x2000 }, - { 0x0700, 0xa22e, 0x0000 }, - { 0x0700, 0xa230, 0x0000 }, - { 0x8700, 0xa233, 0x2000 }, - { 0x0700, 0xa232, 0x0000 }, - { 0x0700, 0xa234, 0x0000 }, - { 0x8700, 0xa239, 0x3000 }, - { 0x8700, 0xa237, 0x2000 }, - { 0x0700, 0xa236, 0x0000 }, - { 0x0700, 0xa238, 0x0000 }, - { 0x8700, 0xa23b, 0x2000 }, - { 0x0700, 0xa23a, 0x0000 }, - { 0x0700, 0xa23c, 0x0000 }, - { 0x8700, 0xa245, 0x4000 }, - { 0x8700, 0xa241, 0x3000 }, - { 0x8700, 0xa23f, 0x2000 }, - { 0x0700, 0xa23e, 0x0000 }, - { 0x0700, 0xa240, 0x0000 }, - { 0x8700, 0xa243, 0x2000 }, - { 0x0700, 0xa242, 0x0000 }, - { 0x0700, 0xa244, 0x0000 }, - { 0x8700, 0xa249, 0x3000 }, - { 0x8700, 0xa247, 0x2000 }, - { 0x0700, 0xa246, 0x0000 }, - { 0x0700, 0xa248, 0x0000 }, - { 0x8700, 0xa24b, 0x2000 }, - { 0x0700, 0xa24a, 0x0000 }, - { 0x0700, 0xa24c, 0x0000 }, - { 0x8700, 0xa2cd, 0x8000 }, - { 0x8700, 0xa28d, 0x7000 }, - { 0x8700, 0xa26d, 0x6000 }, - { 0x8700, 0xa25d, 0x5000 }, - { 0x8700, 0xa255, 0x4000 }, - { 0x8700, 0xa251, 0x3000 }, - { 0x8700, 0xa24f, 0x2000 }, - { 0x0700, 0xa24e, 0x0000 }, - { 0x0700, 0xa250, 0x0000 }, - { 0x8700, 0xa253, 0x2000 }, - { 0x0700, 0xa252, 0x0000 }, - { 0x0700, 0xa254, 0x0000 }, - { 0x8700, 0xa259, 0x3000 }, - { 0x8700, 0xa257, 0x2000 }, - { 0x0700, 0xa256, 0x0000 }, - { 0x0700, 0xa258, 0x0000 }, - { 0x8700, 0xa25b, 0x2000 }, - { 0x0700, 0xa25a, 0x0000 }, - { 0x0700, 0xa25c, 0x0000 }, - { 0x8700, 0xa265, 0x4000 }, - { 0x8700, 0xa261, 0x3000 }, - { 0x8700, 0xa25f, 0x2000 }, - { 0x0700, 0xa25e, 0x0000 }, - { 0x0700, 0xa260, 0x0000 }, - { 0x8700, 0xa263, 0x2000 }, - { 0x0700, 0xa262, 0x0000 }, - { 0x0700, 0xa264, 0x0000 }, - { 0x8700, 0xa269, 0x3000 }, - { 0x8700, 0xa267, 0x2000 }, - { 0x0700, 0xa266, 0x0000 }, - { 0x0700, 0xa268, 0x0000 }, - { 0x8700, 0xa26b, 0x2000 }, - { 0x0700, 0xa26a, 0x0000 }, - { 0x0700, 0xa26c, 0x0000 }, - { 0x8700, 0xa27d, 0x5000 }, - { 0x8700, 0xa275, 0x4000 }, - { 0x8700, 0xa271, 0x3000 }, - { 0x8700, 0xa26f, 0x2000 }, - { 0x0700, 0xa26e, 0x0000 }, - { 0x0700, 0xa270, 0x0000 }, - { 0x8700, 0xa273, 0x2000 }, - { 0x0700, 0xa272, 0x0000 }, - { 0x0700, 0xa274, 0x0000 }, - { 0x8700, 0xa279, 0x3000 }, - { 0x8700, 0xa277, 0x2000 }, - { 0x0700, 0xa276, 0x0000 }, - { 0x0700, 0xa278, 0x0000 }, - { 0x8700, 0xa27b, 0x2000 }, - { 0x0700, 0xa27a, 0x0000 }, - { 0x0700, 0xa27c, 0x0000 }, - { 0x8700, 0xa285, 0x4000 }, - { 0x8700, 0xa281, 0x3000 }, - { 0x8700, 0xa27f, 0x2000 }, - { 0x0700, 0xa27e, 0x0000 }, - { 0x0700, 0xa280, 0x0000 }, - { 0x8700, 0xa283, 0x2000 }, - { 0x0700, 0xa282, 0x0000 }, - { 0x0700, 0xa284, 0x0000 }, - { 0x8700, 0xa289, 0x3000 }, - { 0x8700, 0xa287, 0x2000 }, - { 0x0700, 0xa286, 0x0000 }, - { 0x0700, 0xa288, 0x0000 }, - { 0x8700, 0xa28b, 0x2000 }, - { 0x0700, 0xa28a, 0x0000 }, - { 0x0700, 0xa28c, 0x0000 }, - { 0x8700, 0xa2ad, 0x6000 }, - { 0x8700, 0xa29d, 0x5000 }, - { 0x8700, 0xa295, 0x4000 }, - { 0x8700, 0xa291, 0x3000 }, - { 0x8700, 0xa28f, 0x2000 }, - { 0x0700, 0xa28e, 0x0000 }, - { 0x0700, 0xa290, 0x0000 }, - { 0x8700, 0xa293, 0x2000 }, - { 0x0700, 0xa292, 0x0000 }, - { 0x0700, 0xa294, 0x0000 }, - { 0x8700, 0xa299, 0x3000 }, - { 0x8700, 0xa297, 0x2000 }, - { 0x0700, 0xa296, 0x0000 }, - { 0x0700, 0xa298, 0x0000 }, - { 0x8700, 0xa29b, 0x2000 }, - { 0x0700, 0xa29a, 0x0000 }, - { 0x0700, 0xa29c, 0x0000 }, - { 0x8700, 0xa2a5, 0x4000 }, - { 0x8700, 0xa2a1, 0x3000 }, - { 0x8700, 0xa29f, 0x2000 }, - { 0x0700, 0xa29e, 0x0000 }, - { 0x0700, 0xa2a0, 0x0000 }, - { 0x8700, 0xa2a3, 0x2000 }, - { 0x0700, 0xa2a2, 0x0000 }, - { 0x0700, 0xa2a4, 0x0000 }, - { 0x8700, 0xa2a9, 0x3000 }, - { 0x8700, 0xa2a7, 0x2000 }, - { 0x0700, 0xa2a6, 0x0000 }, - { 0x0700, 0xa2a8, 0x0000 }, - { 0x8700, 0xa2ab, 0x2000 }, - { 0x0700, 0xa2aa, 0x0000 }, - { 0x0700, 0xa2ac, 0x0000 }, - { 0x8700, 0xa2bd, 0x5000 }, - { 0x8700, 0xa2b5, 0x4000 }, - { 0x8700, 0xa2b1, 0x3000 }, - { 0x8700, 0xa2af, 0x2000 }, - { 0x0700, 0xa2ae, 0x0000 }, - { 0x0700, 0xa2b0, 0x0000 }, - { 0x8700, 0xa2b3, 0x2000 }, - { 0x0700, 0xa2b2, 0x0000 }, - { 0x0700, 0xa2b4, 0x0000 }, - { 0x8700, 0xa2b9, 0x3000 }, - { 0x8700, 0xa2b7, 0x2000 }, - { 0x0700, 0xa2b6, 0x0000 }, - { 0x0700, 0xa2b8, 0x0000 }, - { 0x8700, 0xa2bb, 0x2000 }, - { 0x0700, 0xa2ba, 0x0000 }, - { 0x0700, 0xa2bc, 0x0000 }, - { 0x8700, 0xa2c5, 0x4000 }, - { 0x8700, 0xa2c1, 0x3000 }, - { 0x8700, 0xa2bf, 0x2000 }, - { 0x0700, 0xa2be, 0x0000 }, - { 0x0700, 0xa2c0, 0x0000 }, - { 0x8700, 0xa2c3, 0x2000 }, - { 0x0700, 0xa2c2, 0x0000 }, - { 0x0700, 0xa2c4, 0x0000 }, - { 0x8700, 0xa2c9, 0x3000 }, - { 0x8700, 0xa2c7, 0x2000 }, - { 0x0700, 0xa2c6, 0x0000 }, - { 0x0700, 0xa2c8, 0x0000 }, - { 0x8700, 0xa2cb, 0x2000 }, - { 0x0700, 0xa2ca, 0x0000 }, - { 0x0700, 0xa2cc, 0x0000 }, - { 0x8700, 0xa30d, 0x7000 }, - { 0x8700, 0xa2ed, 0x6000 }, - { 0x8700, 0xa2dd, 0x5000 }, - { 0x8700, 0xa2d5, 0x4000 }, - { 0x8700, 0xa2d1, 0x3000 }, - { 0x8700, 0xa2cf, 0x2000 }, - { 0x0700, 0xa2ce, 0x0000 }, - { 0x0700, 0xa2d0, 0x0000 }, - { 0x8700, 0xa2d3, 0x2000 }, - { 0x0700, 0xa2d2, 0x0000 }, - { 0x0700, 0xa2d4, 0x0000 }, - { 0x8700, 0xa2d9, 0x3000 }, - { 0x8700, 0xa2d7, 0x2000 }, - { 0x0700, 0xa2d6, 0x0000 }, - { 0x0700, 0xa2d8, 0x0000 }, - { 0x8700, 0xa2db, 0x2000 }, - { 0x0700, 0xa2da, 0x0000 }, - { 0x0700, 0xa2dc, 0x0000 }, - { 0x8700, 0xa2e5, 0x4000 }, - { 0x8700, 0xa2e1, 0x3000 }, - { 0x8700, 0xa2df, 0x2000 }, - { 0x0700, 0xa2de, 0x0000 }, - { 0x0700, 0xa2e0, 0x0000 }, - { 0x8700, 0xa2e3, 0x2000 }, - { 0x0700, 0xa2e2, 0x0000 }, - { 0x0700, 0xa2e4, 0x0000 }, - { 0x8700, 0xa2e9, 0x3000 }, - { 0x8700, 0xa2e7, 0x2000 }, - { 0x0700, 0xa2e6, 0x0000 }, - { 0x0700, 0xa2e8, 0x0000 }, - { 0x8700, 0xa2eb, 0x2000 }, - { 0x0700, 0xa2ea, 0x0000 }, - { 0x0700, 0xa2ec, 0x0000 }, - { 0x8700, 0xa2fd, 0x5000 }, - { 0x8700, 0xa2f5, 0x4000 }, - { 0x8700, 0xa2f1, 0x3000 }, - { 0x8700, 0xa2ef, 0x2000 }, - { 0x0700, 0xa2ee, 0x0000 }, - { 0x0700, 0xa2f0, 0x0000 }, - { 0x8700, 0xa2f3, 0x2000 }, - { 0x0700, 0xa2f2, 0x0000 }, - { 0x0700, 0xa2f4, 0x0000 }, - { 0x8700, 0xa2f9, 0x3000 }, - { 0x8700, 0xa2f7, 0x2000 }, - { 0x0700, 0xa2f6, 0x0000 }, - { 0x0700, 0xa2f8, 0x0000 }, - { 0x8700, 0xa2fb, 0x2000 }, - { 0x0700, 0xa2fa, 0x0000 }, - { 0x0700, 0xa2fc, 0x0000 }, - { 0x8700, 0xa305, 0x4000 }, - { 0x8700, 0xa301, 0x3000 }, - { 0x8700, 0xa2ff, 0x2000 }, - { 0x0700, 0xa2fe, 0x0000 }, - { 0x0700, 0xa300, 0x0000 }, - { 0x8700, 0xa303, 0x2000 }, - { 0x0700, 0xa302, 0x0000 }, - { 0x0700, 0xa304, 0x0000 }, - { 0x8700, 0xa309, 0x3000 }, - { 0x8700, 0xa307, 0x2000 }, - { 0x0700, 0xa306, 0x0000 }, - { 0x0700, 0xa308, 0x0000 }, - { 0x8700, 0xa30b, 0x2000 }, - { 0x0700, 0xa30a, 0x0000 }, - { 0x0700, 0xa30c, 0x0000 }, - { 0x8700, 0xa32d, 0x6000 }, - { 0x8700, 0xa31d, 0x5000 }, - { 0x8700, 0xa315, 0x4000 }, - { 0x8700, 0xa311, 0x3000 }, - { 0x8700, 0xa30f, 0x2000 }, - { 0x0700, 0xa30e, 0x0000 }, - { 0x0700, 0xa310, 0x0000 }, - { 0x8700, 0xa313, 0x2000 }, - { 0x0700, 0xa312, 0x0000 }, - { 0x0700, 0xa314, 0x0000 }, - { 0x8700, 0xa319, 0x3000 }, - { 0x8700, 0xa317, 0x2000 }, - { 0x0700, 0xa316, 0x0000 }, - { 0x0700, 0xa318, 0x0000 }, - { 0x8700, 0xa31b, 0x2000 }, - { 0x0700, 0xa31a, 0x0000 }, - { 0x0700, 0xa31c, 0x0000 }, - { 0x8700, 0xa325, 0x4000 }, - { 0x8700, 0xa321, 0x3000 }, - { 0x8700, 0xa31f, 0x2000 }, - { 0x0700, 0xa31e, 0x0000 }, - { 0x0700, 0xa320, 0x0000 }, - { 0x8700, 0xa323, 0x2000 }, - { 0x0700, 0xa322, 0x0000 }, - { 0x0700, 0xa324, 0x0000 }, - { 0x8700, 0xa329, 0x3000 }, - { 0x8700, 0xa327, 0x2000 }, - { 0x0700, 0xa326, 0x0000 }, - { 0x0700, 0xa328, 0x0000 }, - { 0x8700, 0xa32b, 0x2000 }, - { 0x0700, 0xa32a, 0x0000 }, - { 0x0700, 0xa32c, 0x0000 }, - { 0x8700, 0xa33d, 0x5000 }, - { 0x8700, 0xa335, 0x4000 }, - { 0x8700, 0xa331, 0x3000 }, - { 0x8700, 0xa32f, 0x2000 }, - { 0x0700, 0xa32e, 0x0000 }, - { 0x0700, 0xa330, 0x0000 }, - { 0x8700, 0xa333, 0x2000 }, - { 0x0700, 0xa332, 0x0000 }, - { 0x0700, 0xa334, 0x0000 }, - { 0x8700, 0xa339, 0x3000 }, - { 0x8700, 0xa337, 0x2000 }, - { 0x0700, 0xa336, 0x0000 }, - { 0x0700, 0xa338, 0x0000 }, - { 0x8700, 0xa33b, 0x2000 }, - { 0x0700, 0xa33a, 0x0000 }, - { 0x0700, 0xa33c, 0x0000 }, - { 0x8700, 0xa345, 0x4000 }, - { 0x8700, 0xa341, 0x3000 }, - { 0x8700, 0xa33f, 0x2000 }, - { 0x0700, 0xa33e, 0x0000 }, - { 0x0700, 0xa340, 0x0000 }, - { 0x8700, 0xa343, 0x2000 }, - { 0x0700, 0xa342, 0x0000 }, - { 0x0700, 0xa344, 0x0000 }, - { 0x8700, 0xa349, 0x3000 }, - { 0x8700, 0xa347, 0x2000 }, - { 0x0700, 0xa346, 0x0000 }, - { 0x0700, 0xa348, 0x0000 }, - { 0x8700, 0xa34b, 0x2000 }, - { 0x0700, 0xa34a, 0x0000 }, - { 0x0700, 0xa34c, 0x0000 }, - { 0x8700, 0xfc4d, 0xb000 }, - { 0x8700, 0xf97f, 0xa000 }, - { 0x8700, 0xa44d, 0x9000 }, - { 0x8700, 0xa3cd, 0x8000 }, - { 0x8700, 0xa38d, 0x7000 }, - { 0x8700, 0xa36d, 0x6000 }, - { 0x8700, 0xa35d, 0x5000 }, - { 0x8700, 0xa355, 0x4000 }, - { 0x8700, 0xa351, 0x3000 }, - { 0x8700, 0xa34f, 0x2000 }, - { 0x0700, 0xa34e, 0x0000 }, - { 0x0700, 0xa350, 0x0000 }, - { 0x8700, 0xa353, 0x2000 }, - { 0x0700, 0xa352, 0x0000 }, - { 0x0700, 0xa354, 0x0000 }, - { 0x8700, 0xa359, 0x3000 }, - { 0x8700, 0xa357, 0x2000 }, - { 0x0700, 0xa356, 0x0000 }, - { 0x0700, 0xa358, 0x0000 }, - { 0x8700, 0xa35b, 0x2000 }, - { 0x0700, 0xa35a, 0x0000 }, - { 0x0700, 0xa35c, 0x0000 }, - { 0x8700, 0xa365, 0x4000 }, - { 0x8700, 0xa361, 0x3000 }, - { 0x8700, 0xa35f, 0x2000 }, - { 0x0700, 0xa35e, 0x0000 }, - { 0x0700, 0xa360, 0x0000 }, - { 0x8700, 0xa363, 0x2000 }, - { 0x0700, 0xa362, 0x0000 }, - { 0x0700, 0xa364, 0x0000 }, - { 0x8700, 0xa369, 0x3000 }, - { 0x8700, 0xa367, 0x2000 }, - { 0x0700, 0xa366, 0x0000 }, - { 0x0700, 0xa368, 0x0000 }, - { 0x8700, 0xa36b, 0x2000 }, - { 0x0700, 0xa36a, 0x0000 }, - { 0x0700, 0xa36c, 0x0000 }, - { 0x8700, 0xa37d, 0x5000 }, - { 0x8700, 0xa375, 0x4000 }, - { 0x8700, 0xa371, 0x3000 }, - { 0x8700, 0xa36f, 0x2000 }, - { 0x0700, 0xa36e, 0x0000 }, - { 0x0700, 0xa370, 0x0000 }, - { 0x8700, 0xa373, 0x2000 }, - { 0x0700, 0xa372, 0x0000 }, - { 0x0700, 0xa374, 0x0000 }, - { 0x8700, 0xa379, 0x3000 }, - { 0x8700, 0xa377, 0x2000 }, - { 0x0700, 0xa376, 0x0000 }, - { 0x0700, 0xa378, 0x0000 }, - { 0x8700, 0xa37b, 0x2000 }, - { 0x0700, 0xa37a, 0x0000 }, - { 0x0700, 0xa37c, 0x0000 }, - { 0x8700, 0xa385, 0x4000 }, - { 0x8700, 0xa381, 0x3000 }, - { 0x8700, 0xa37f, 0x2000 }, - { 0x0700, 0xa37e, 0x0000 }, - { 0x0700, 0xa380, 0x0000 }, - { 0x8700, 0xa383, 0x2000 }, - { 0x0700, 0xa382, 0x0000 }, - { 0x0700, 0xa384, 0x0000 }, - { 0x8700, 0xa389, 0x3000 }, - { 0x8700, 0xa387, 0x2000 }, - { 0x0700, 0xa386, 0x0000 }, - { 0x0700, 0xa388, 0x0000 }, - { 0x8700, 0xa38b, 0x2000 }, - { 0x0700, 0xa38a, 0x0000 }, - { 0x0700, 0xa38c, 0x0000 }, - { 0x8700, 0xa3ad, 0x6000 }, - { 0x8700, 0xa39d, 0x5000 }, - { 0x8700, 0xa395, 0x4000 }, - { 0x8700, 0xa391, 0x3000 }, - { 0x8700, 0xa38f, 0x2000 }, - { 0x0700, 0xa38e, 0x0000 }, - { 0x0700, 0xa390, 0x0000 }, - { 0x8700, 0xa393, 0x2000 }, - { 0x0700, 0xa392, 0x0000 }, - { 0x0700, 0xa394, 0x0000 }, - { 0x8700, 0xa399, 0x3000 }, - { 0x8700, 0xa397, 0x2000 }, - { 0x0700, 0xa396, 0x0000 }, - { 0x0700, 0xa398, 0x0000 }, - { 0x8700, 0xa39b, 0x2000 }, - { 0x0700, 0xa39a, 0x0000 }, - { 0x0700, 0xa39c, 0x0000 }, - { 0x8700, 0xa3a5, 0x4000 }, - { 0x8700, 0xa3a1, 0x3000 }, - { 0x8700, 0xa39f, 0x2000 }, - { 0x0700, 0xa39e, 0x0000 }, - { 0x0700, 0xa3a0, 0x0000 }, - { 0x8700, 0xa3a3, 0x2000 }, - { 0x0700, 0xa3a2, 0x0000 }, - { 0x0700, 0xa3a4, 0x0000 }, - { 0x8700, 0xa3a9, 0x3000 }, - { 0x8700, 0xa3a7, 0x2000 }, - { 0x0700, 0xa3a6, 0x0000 }, - { 0x0700, 0xa3a8, 0x0000 }, - { 0x8700, 0xa3ab, 0x2000 }, - { 0x0700, 0xa3aa, 0x0000 }, - { 0x0700, 0xa3ac, 0x0000 }, - { 0x8700, 0xa3bd, 0x5000 }, - { 0x8700, 0xa3b5, 0x4000 }, - { 0x8700, 0xa3b1, 0x3000 }, - { 0x8700, 0xa3af, 0x2000 }, - { 0x0700, 0xa3ae, 0x0000 }, - { 0x0700, 0xa3b0, 0x0000 }, - { 0x8700, 0xa3b3, 0x2000 }, - { 0x0700, 0xa3b2, 0x0000 }, - { 0x0700, 0xa3b4, 0x0000 }, - { 0x8700, 0xa3b9, 0x3000 }, - { 0x8700, 0xa3b7, 0x2000 }, - { 0x0700, 0xa3b6, 0x0000 }, - { 0x0700, 0xa3b8, 0x0000 }, - { 0x8700, 0xa3bb, 0x2000 }, - { 0x0700, 0xa3ba, 0x0000 }, - { 0x0700, 0xa3bc, 0x0000 }, - { 0x8700, 0xa3c5, 0x4000 }, - { 0x8700, 0xa3c1, 0x3000 }, - { 0x8700, 0xa3bf, 0x2000 }, - { 0x0700, 0xa3be, 0x0000 }, - { 0x0700, 0xa3c0, 0x0000 }, - { 0x8700, 0xa3c3, 0x2000 }, - { 0x0700, 0xa3c2, 0x0000 }, - { 0x0700, 0xa3c4, 0x0000 }, - { 0x8700, 0xa3c9, 0x3000 }, - { 0x8700, 0xa3c7, 0x2000 }, - { 0x0700, 0xa3c6, 0x0000 }, - { 0x0700, 0xa3c8, 0x0000 }, - { 0x8700, 0xa3cb, 0x2000 }, - { 0x0700, 0xa3ca, 0x0000 }, - { 0x0700, 0xa3cc, 0x0000 }, - { 0x8700, 0xa40d, 0x7000 }, - { 0x8700, 0xa3ed, 0x6000 }, - { 0x8700, 0xa3dd, 0x5000 }, - { 0x8700, 0xa3d5, 0x4000 }, - { 0x8700, 0xa3d1, 0x3000 }, - { 0x8700, 0xa3cf, 0x2000 }, - { 0x0700, 0xa3ce, 0x0000 }, - { 0x0700, 0xa3d0, 0x0000 }, - { 0x8700, 0xa3d3, 0x2000 }, - { 0x0700, 0xa3d2, 0x0000 }, - { 0x0700, 0xa3d4, 0x0000 }, - { 0x8700, 0xa3d9, 0x3000 }, - { 0x8700, 0xa3d7, 0x2000 }, - { 0x0700, 0xa3d6, 0x0000 }, - { 0x0700, 0xa3d8, 0x0000 }, - { 0x8700, 0xa3db, 0x2000 }, - { 0x0700, 0xa3da, 0x0000 }, - { 0x0700, 0xa3dc, 0x0000 }, - { 0x8700, 0xa3e5, 0x4000 }, - { 0x8700, 0xa3e1, 0x3000 }, - { 0x8700, 0xa3df, 0x2000 }, - { 0x0700, 0xa3de, 0x0000 }, - { 0x0700, 0xa3e0, 0x0000 }, - { 0x8700, 0xa3e3, 0x2000 }, - { 0x0700, 0xa3e2, 0x0000 }, - { 0x0700, 0xa3e4, 0x0000 }, - { 0x8700, 0xa3e9, 0x3000 }, - { 0x8700, 0xa3e7, 0x2000 }, - { 0x0700, 0xa3e6, 0x0000 }, - { 0x0700, 0xa3e8, 0x0000 }, - { 0x8700, 0xa3eb, 0x2000 }, - { 0x0700, 0xa3ea, 0x0000 }, - { 0x0700, 0xa3ec, 0x0000 }, - { 0x8700, 0xa3fd, 0x5000 }, - { 0x8700, 0xa3f5, 0x4000 }, - { 0x8700, 0xa3f1, 0x3000 }, - { 0x8700, 0xa3ef, 0x2000 }, - { 0x0700, 0xa3ee, 0x0000 }, - { 0x0700, 0xa3f0, 0x0000 }, - { 0x8700, 0xa3f3, 0x2000 }, - { 0x0700, 0xa3f2, 0x0000 }, - { 0x0700, 0xa3f4, 0x0000 }, - { 0x8700, 0xa3f9, 0x3000 }, - { 0x8700, 0xa3f7, 0x2000 }, - { 0x0700, 0xa3f6, 0x0000 }, - { 0x0700, 0xa3f8, 0x0000 }, - { 0x8700, 0xa3fb, 0x2000 }, - { 0x0700, 0xa3fa, 0x0000 }, - { 0x0700, 0xa3fc, 0x0000 }, - { 0x8700, 0xa405, 0x4000 }, - { 0x8700, 0xa401, 0x3000 }, - { 0x8700, 0xa3ff, 0x2000 }, - { 0x0700, 0xa3fe, 0x0000 }, - { 0x0700, 0xa400, 0x0000 }, - { 0x8700, 0xa403, 0x2000 }, - { 0x0700, 0xa402, 0x0000 }, - { 0x0700, 0xa404, 0x0000 }, - { 0x8700, 0xa409, 0x3000 }, - { 0x8700, 0xa407, 0x2000 }, - { 0x0700, 0xa406, 0x0000 }, - { 0x0700, 0xa408, 0x0000 }, - { 0x8700, 0xa40b, 0x2000 }, - { 0x0700, 0xa40a, 0x0000 }, - { 0x0700, 0xa40c, 0x0000 }, - { 0x8700, 0xa42d, 0x6000 }, - { 0x8700, 0xa41d, 0x5000 }, - { 0x8700, 0xa415, 0x4000 }, - { 0x8700, 0xa411, 0x3000 }, - { 0x8700, 0xa40f, 0x2000 }, - { 0x0700, 0xa40e, 0x0000 }, - { 0x0700, 0xa410, 0x0000 }, - { 0x8700, 0xa413, 0x2000 }, - { 0x0700, 0xa412, 0x0000 }, - { 0x0700, 0xa414, 0x0000 }, - { 0x8700, 0xa419, 0x3000 }, - { 0x8700, 0xa417, 0x2000 }, - { 0x0700, 0xa416, 0x0000 }, - { 0x0700, 0xa418, 0x0000 }, - { 0x8700, 0xa41b, 0x2000 }, - { 0x0700, 0xa41a, 0x0000 }, - { 0x0700, 0xa41c, 0x0000 }, - { 0x8700, 0xa425, 0x4000 }, - { 0x8700, 0xa421, 0x3000 }, - { 0x8700, 0xa41f, 0x2000 }, - { 0x0700, 0xa41e, 0x0000 }, - { 0x0700, 0xa420, 0x0000 }, - { 0x8700, 0xa423, 0x2000 }, - { 0x0700, 0xa422, 0x0000 }, - { 0x0700, 0xa424, 0x0000 }, - { 0x8700, 0xa429, 0x3000 }, - { 0x8700, 0xa427, 0x2000 }, - { 0x0700, 0xa426, 0x0000 }, - { 0x0700, 0xa428, 0x0000 }, - { 0x8700, 0xa42b, 0x2000 }, - { 0x0700, 0xa42a, 0x0000 }, - { 0x0700, 0xa42c, 0x0000 }, - { 0x8700, 0xa43d, 0x5000 }, - { 0x8700, 0xa435, 0x4000 }, - { 0x8700, 0xa431, 0x3000 }, - { 0x8700, 0xa42f, 0x2000 }, - { 0x0700, 0xa42e, 0x0000 }, - { 0x0700, 0xa430, 0x0000 }, - { 0x8700, 0xa433, 0x2000 }, - { 0x0700, 0xa432, 0x0000 }, - { 0x0700, 0xa434, 0x0000 }, - { 0x8700, 0xa439, 0x3000 }, - { 0x8700, 0xa437, 0x2000 }, - { 0x0700, 0xa436, 0x0000 }, - { 0x0700, 0xa438, 0x0000 }, - { 0x8700, 0xa43b, 0x2000 }, - { 0x0700, 0xa43a, 0x0000 }, - { 0x0700, 0xa43c, 0x0000 }, - { 0x8700, 0xa445, 0x4000 }, - { 0x8700, 0xa441, 0x3000 }, - { 0x8700, 0xa43f, 0x2000 }, - { 0x0700, 0xa43e, 0x0000 }, - { 0x0700, 0xa440, 0x0000 }, - { 0x8700, 0xa443, 0x2000 }, - { 0x0700, 0xa442, 0x0000 }, - { 0x0700, 0xa444, 0x0000 }, - { 0x8700, 0xa449, 0x3000 }, - { 0x8700, 0xa447, 0x2000 }, - { 0x0700, 0xa446, 0x0000 }, - { 0x0700, 0xa448, 0x0000 }, - { 0x8700, 0xa44b, 0x2000 }, - { 0x0700, 0xa44a, 0x0000 }, - { 0x0700, 0xa44c, 0x0000 }, - { 0x8300, 0xf8ff, 0x8000 }, - { 0x9a00, 0xa490, 0x7000 }, - { 0x8700, 0xa46d, 0x6000 }, - { 0x8700, 0xa45d, 0x5000 }, - { 0x8700, 0xa455, 0x4000 }, - { 0x8700, 0xa451, 0x3000 }, - { 0x8700, 0xa44f, 0x2000 }, - { 0x0700, 0xa44e, 0x0000 }, - { 0x0700, 0xa450, 0x0000 }, - { 0x8700, 0xa453, 0x2000 }, - { 0x0700, 0xa452, 0x0000 }, - { 0x0700, 0xa454, 0x0000 }, - { 0x8700, 0xa459, 0x3000 }, - { 0x8700, 0xa457, 0x2000 }, - { 0x0700, 0xa456, 0x0000 }, - { 0x0700, 0xa458, 0x0000 }, - { 0x8700, 0xa45b, 0x2000 }, - { 0x0700, 0xa45a, 0x0000 }, - { 0x0700, 0xa45c, 0x0000 }, - { 0x8700, 0xa465, 0x4000 }, - { 0x8700, 0xa461, 0x3000 }, - { 0x8700, 0xa45f, 0x2000 }, - { 0x0700, 0xa45e, 0x0000 }, - { 0x0700, 0xa460, 0x0000 }, - { 0x8700, 0xa463, 0x2000 }, - { 0x0700, 0xa462, 0x0000 }, - { 0x0700, 0xa464, 0x0000 }, - { 0x8700, 0xa469, 0x3000 }, - { 0x8700, 0xa467, 0x2000 }, - { 0x0700, 0xa466, 0x0000 }, - { 0x0700, 0xa468, 0x0000 }, - { 0x8700, 0xa46b, 0x2000 }, - { 0x0700, 0xa46a, 0x0000 }, - { 0x0700, 0xa46c, 0x0000 }, - { 0x8700, 0xa47d, 0x5000 }, - { 0x8700, 0xa475, 0x4000 }, - { 0x8700, 0xa471, 0x3000 }, - { 0x8700, 0xa46f, 0x2000 }, - { 0x0700, 0xa46e, 0x0000 }, - { 0x0700, 0xa470, 0x0000 }, - { 0x8700, 0xa473, 0x2000 }, - { 0x0700, 0xa472, 0x0000 }, - { 0x0700, 0xa474, 0x0000 }, - { 0x8700, 0xa479, 0x3000 }, - { 0x8700, 0xa477, 0x2000 }, - { 0x0700, 0xa476, 0x0000 }, - { 0x0700, 0xa478, 0x0000 }, - { 0x8700, 0xa47b, 0x2000 }, - { 0x0700, 0xa47a, 0x0000 }, - { 0x0700, 0xa47c, 0x0000 }, - { 0x8700, 0xa485, 0x4000 }, - { 0x8700, 0xa481, 0x3000 }, - { 0x8700, 0xa47f, 0x2000 }, - { 0x0700, 0xa47e, 0x0000 }, - { 0x0700, 0xa480, 0x0000 }, - { 0x8700, 0xa483, 0x2000 }, - { 0x0700, 0xa482, 0x0000 }, - { 0x0700, 0xa484, 0x0000 }, - { 0x8700, 0xa489, 0x3000 }, - { 0x8700, 0xa487, 0x2000 }, - { 0x0700, 0xa486, 0x0000 }, - { 0x0700, 0xa488, 0x0000 }, - { 0x8700, 0xa48b, 0x2000 }, - { 0x0700, 0xa48a, 0x0000 }, - { 0x0700, 0xa48c, 0x0000 }, - { 0x9a00, 0xa4b0, 0x6000 }, - { 0x9a00, 0xa4a0, 0x5000 }, - { 0x9a00, 0xa498, 0x4000 }, - { 0x9a00, 0xa494, 0x3000 }, - { 0x9a00, 0xa492, 0x2000 }, - { 0x1a00, 0xa491, 0x0000 }, - { 0x1a00, 0xa493, 0x0000 }, - { 0x9a00, 0xa496, 0x2000 }, - { 0x1a00, 0xa495, 0x0000 }, - { 0x1a00, 0xa497, 0x0000 }, - { 0x9a00, 0xa49c, 0x3000 }, - { 0x9a00, 0xa49a, 0x2000 }, - { 0x1a00, 0xa499, 0x0000 }, - { 0x1a00, 0xa49b, 0x0000 }, - { 0x9a00, 0xa49e, 0x2000 }, - { 0x1a00, 0xa49d, 0x0000 }, - { 0x1a00, 0xa49f, 0x0000 }, - { 0x9a00, 0xa4a8, 0x4000 }, - { 0x9a00, 0xa4a4, 0x3000 }, - { 0x9a00, 0xa4a2, 0x2000 }, - { 0x1a00, 0xa4a1, 0x0000 }, - { 0x1a00, 0xa4a3, 0x0000 }, - { 0x9a00, 0xa4a6, 0x2000 }, - { 0x1a00, 0xa4a5, 0x0000 }, - { 0x1a00, 0xa4a7, 0x0000 }, - { 0x9a00, 0xa4ac, 0x3000 }, - { 0x9a00, 0xa4aa, 0x2000 }, - { 0x1a00, 0xa4a9, 0x0000 }, - { 0x1a00, 0xa4ab, 0x0000 }, - { 0x9a00, 0xa4ae, 0x2000 }, - { 0x1a00, 0xa4ad, 0x0000 }, - { 0x1a00, 0xa4af, 0x0000 }, - { 0x9a00, 0xa4c0, 0x5000 }, - { 0x9a00, 0xa4b8, 0x4000 }, - { 0x9a00, 0xa4b4, 0x3000 }, - { 0x9a00, 0xa4b2, 0x2000 }, - { 0x1a00, 0xa4b1, 0x0000 }, - { 0x1a00, 0xa4b3, 0x0000 }, - { 0x9a00, 0xa4b6, 0x2000 }, - { 0x1a00, 0xa4b5, 0x0000 }, - { 0x1a00, 0xa4b7, 0x0000 }, - { 0x9a00, 0xa4bc, 0x3000 }, - { 0x9a00, 0xa4ba, 0x2000 }, - { 0x1a00, 0xa4b9, 0x0000 }, - { 0x1a00, 0xa4bb, 0x0000 }, - { 0x9a00, 0xa4be, 0x2000 }, - { 0x1a00, 0xa4bd, 0x0000 }, - { 0x1a00, 0xa4bf, 0x0000 }, - { 0x8700, 0xd7a3, 0x4000 }, - { 0x9a00, 0xa4c4, 0x3000 }, - { 0x9a00, 0xa4c2, 0x2000 }, - { 0x1a00, 0xa4c1, 0x0000 }, - { 0x1a00, 0xa4c3, 0x0000 }, - { 0x9a00, 0xa4c6, 0x2000 }, - { 0x1a00, 0xa4c5, 0x0000 }, - { 0x0700, 0xac00, 0x0000 }, - { 0x8400, 0xdbff, 0x3000 }, - { 0x8400, 0xdb7f, 0x2000 }, - { 0x0400, 0xd800, 0x0000 }, - { 0x0400, 0xdb80, 0x0000 }, - { 0x8400, 0xdfff, 0x2000 }, - { 0x0400, 0xdc00, 0x0000 }, - { 0x0300, 0xe000, 0x0000 }, - { 0x8700, 0xf93f, 0x7000 }, - { 0x8700, 0xf91f, 0x6000 }, - { 0x8700, 0xf90f, 0x5000 }, - { 0x8700, 0xf907, 0x4000 }, - { 0x8700, 0xf903, 0x3000 }, - { 0x8700, 0xf901, 0x2000 }, - { 0x0700, 0xf900, 0x0000 }, - { 0x0700, 0xf902, 0x0000 }, - { 0x8700, 0xf905, 0x2000 }, - { 0x0700, 0xf904, 0x0000 }, - { 0x0700, 0xf906, 0x0000 }, - { 0x8700, 0xf90b, 0x3000 }, - { 0x8700, 0xf909, 0x2000 }, - { 0x0700, 0xf908, 0x0000 }, - { 0x0700, 0xf90a, 0x0000 }, - { 0x8700, 0xf90d, 0x2000 }, - { 0x0700, 0xf90c, 0x0000 }, - { 0x0700, 0xf90e, 0x0000 }, - { 0x8700, 0xf917, 0x4000 }, - { 0x8700, 0xf913, 0x3000 }, - { 0x8700, 0xf911, 0x2000 }, - { 0x0700, 0xf910, 0x0000 }, - { 0x0700, 0xf912, 0x0000 }, - { 0x8700, 0xf915, 0x2000 }, - { 0x0700, 0xf914, 0x0000 }, - { 0x0700, 0xf916, 0x0000 }, - { 0x8700, 0xf91b, 0x3000 }, - { 0x8700, 0xf919, 0x2000 }, - { 0x0700, 0xf918, 0x0000 }, - { 0x0700, 0xf91a, 0x0000 }, - { 0x8700, 0xf91d, 0x2000 }, - { 0x0700, 0xf91c, 0x0000 }, - { 0x0700, 0xf91e, 0x0000 }, - { 0x8700, 0xf92f, 0x5000 }, - { 0x8700, 0xf927, 0x4000 }, - { 0x8700, 0xf923, 0x3000 }, - { 0x8700, 0xf921, 0x2000 }, - { 0x0700, 0xf920, 0x0000 }, - { 0x0700, 0xf922, 0x0000 }, - { 0x8700, 0xf925, 0x2000 }, - { 0x0700, 0xf924, 0x0000 }, - { 0x0700, 0xf926, 0x0000 }, - { 0x8700, 0xf92b, 0x3000 }, - { 0x8700, 0xf929, 0x2000 }, - { 0x0700, 0xf928, 0x0000 }, - { 0x0700, 0xf92a, 0x0000 }, - { 0x8700, 0xf92d, 0x2000 }, - { 0x0700, 0xf92c, 0x0000 }, - { 0x0700, 0xf92e, 0x0000 }, - { 0x8700, 0xf937, 0x4000 }, - { 0x8700, 0xf933, 0x3000 }, - { 0x8700, 0xf931, 0x2000 }, - { 0x0700, 0xf930, 0x0000 }, - { 0x0700, 0xf932, 0x0000 }, - { 0x8700, 0xf935, 0x2000 }, - { 0x0700, 0xf934, 0x0000 }, - { 0x0700, 0xf936, 0x0000 }, - { 0x8700, 0xf93b, 0x3000 }, - { 0x8700, 0xf939, 0x2000 }, - { 0x0700, 0xf938, 0x0000 }, - { 0x0700, 0xf93a, 0x0000 }, - { 0x8700, 0xf93d, 0x2000 }, - { 0x0700, 0xf93c, 0x0000 }, - { 0x0700, 0xf93e, 0x0000 }, - { 0x8700, 0xf95f, 0x6000 }, - { 0x8700, 0xf94f, 0x5000 }, - { 0x8700, 0xf947, 0x4000 }, - { 0x8700, 0xf943, 0x3000 }, - { 0x8700, 0xf941, 0x2000 }, - { 0x0700, 0xf940, 0x0000 }, - { 0x0700, 0xf942, 0x0000 }, - { 0x8700, 0xf945, 0x2000 }, - { 0x0700, 0xf944, 0x0000 }, - { 0x0700, 0xf946, 0x0000 }, - { 0x8700, 0xf94b, 0x3000 }, - { 0x8700, 0xf949, 0x2000 }, - { 0x0700, 0xf948, 0x0000 }, - { 0x0700, 0xf94a, 0x0000 }, - { 0x8700, 0xf94d, 0x2000 }, - { 0x0700, 0xf94c, 0x0000 }, - { 0x0700, 0xf94e, 0x0000 }, - { 0x8700, 0xf957, 0x4000 }, - { 0x8700, 0xf953, 0x3000 }, - { 0x8700, 0xf951, 0x2000 }, - { 0x0700, 0xf950, 0x0000 }, - { 0x0700, 0xf952, 0x0000 }, - { 0x8700, 0xf955, 0x2000 }, - { 0x0700, 0xf954, 0x0000 }, - { 0x0700, 0xf956, 0x0000 }, - { 0x8700, 0xf95b, 0x3000 }, - { 0x8700, 0xf959, 0x2000 }, - { 0x0700, 0xf958, 0x0000 }, - { 0x0700, 0xf95a, 0x0000 }, - { 0x8700, 0xf95d, 0x2000 }, - { 0x0700, 0xf95c, 0x0000 }, - { 0x0700, 0xf95e, 0x0000 }, - { 0x8700, 0xf96f, 0x5000 }, - { 0x8700, 0xf967, 0x4000 }, - { 0x8700, 0xf963, 0x3000 }, - { 0x8700, 0xf961, 0x2000 }, - { 0x0700, 0xf960, 0x0000 }, - { 0x0700, 0xf962, 0x0000 }, - { 0x8700, 0xf965, 0x2000 }, - { 0x0700, 0xf964, 0x0000 }, - { 0x0700, 0xf966, 0x0000 }, - { 0x8700, 0xf96b, 0x3000 }, - { 0x8700, 0xf969, 0x2000 }, - { 0x0700, 0xf968, 0x0000 }, - { 0x0700, 0xf96a, 0x0000 }, - { 0x8700, 0xf96d, 0x2000 }, - { 0x0700, 0xf96c, 0x0000 }, - { 0x0700, 0xf96e, 0x0000 }, - { 0x8700, 0xf977, 0x4000 }, - { 0x8700, 0xf973, 0x3000 }, - { 0x8700, 0xf971, 0x2000 }, - { 0x0700, 0xf970, 0x0000 }, - { 0x0700, 0xf972, 0x0000 }, - { 0x8700, 0xf975, 0x2000 }, - { 0x0700, 0xf974, 0x0000 }, - { 0x0700, 0xf976, 0x0000 }, - { 0x8700, 0xf97b, 0x3000 }, - { 0x8700, 0xf979, 0x2000 }, - { 0x0700, 0xf978, 0x0000 }, - { 0x0700, 0xf97a, 0x0000 }, - { 0x8700, 0xf97d, 0x2000 }, - { 0x0700, 0xf97c, 0x0000 }, - { 0x0700, 0xf97e, 0x0000 }, - { 0x8700, 0xfb27, 0x9000 }, - { 0x8700, 0xf9ff, 0x8000 }, - { 0x8700, 0xf9bf, 0x7000 }, - { 0x8700, 0xf99f, 0x6000 }, - { 0x8700, 0xf98f, 0x5000 }, - { 0x8700, 0xf987, 0x4000 }, - { 0x8700, 0xf983, 0x3000 }, - { 0x8700, 0xf981, 0x2000 }, - { 0x0700, 0xf980, 0x0000 }, - { 0x0700, 0xf982, 0x0000 }, - { 0x8700, 0xf985, 0x2000 }, - { 0x0700, 0xf984, 0x0000 }, - { 0x0700, 0xf986, 0x0000 }, - { 0x8700, 0xf98b, 0x3000 }, - { 0x8700, 0xf989, 0x2000 }, - { 0x0700, 0xf988, 0x0000 }, - { 0x0700, 0xf98a, 0x0000 }, - { 0x8700, 0xf98d, 0x2000 }, - { 0x0700, 0xf98c, 0x0000 }, - { 0x0700, 0xf98e, 0x0000 }, - { 0x8700, 0xf997, 0x4000 }, - { 0x8700, 0xf993, 0x3000 }, - { 0x8700, 0xf991, 0x2000 }, - { 0x0700, 0xf990, 0x0000 }, - { 0x0700, 0xf992, 0x0000 }, - { 0x8700, 0xf995, 0x2000 }, - { 0x0700, 0xf994, 0x0000 }, - { 0x0700, 0xf996, 0x0000 }, - { 0x8700, 0xf99b, 0x3000 }, - { 0x8700, 0xf999, 0x2000 }, - { 0x0700, 0xf998, 0x0000 }, - { 0x0700, 0xf99a, 0x0000 }, - { 0x8700, 0xf99d, 0x2000 }, - { 0x0700, 0xf99c, 0x0000 }, - { 0x0700, 0xf99e, 0x0000 }, - { 0x8700, 0xf9af, 0x5000 }, - { 0x8700, 0xf9a7, 0x4000 }, - { 0x8700, 0xf9a3, 0x3000 }, - { 0x8700, 0xf9a1, 0x2000 }, - { 0x0700, 0xf9a0, 0x0000 }, - { 0x0700, 0xf9a2, 0x0000 }, - { 0x8700, 0xf9a5, 0x2000 }, - { 0x0700, 0xf9a4, 0x0000 }, - { 0x0700, 0xf9a6, 0x0000 }, - { 0x8700, 0xf9ab, 0x3000 }, - { 0x8700, 0xf9a9, 0x2000 }, - { 0x0700, 0xf9a8, 0x0000 }, - { 0x0700, 0xf9aa, 0x0000 }, - { 0x8700, 0xf9ad, 0x2000 }, - { 0x0700, 0xf9ac, 0x0000 }, - { 0x0700, 0xf9ae, 0x0000 }, - { 0x8700, 0xf9b7, 0x4000 }, - { 0x8700, 0xf9b3, 0x3000 }, - { 0x8700, 0xf9b1, 0x2000 }, - { 0x0700, 0xf9b0, 0x0000 }, - { 0x0700, 0xf9b2, 0x0000 }, - { 0x8700, 0xf9b5, 0x2000 }, - { 0x0700, 0xf9b4, 0x0000 }, - { 0x0700, 0xf9b6, 0x0000 }, - { 0x8700, 0xf9bb, 0x3000 }, - { 0x8700, 0xf9b9, 0x2000 }, - { 0x0700, 0xf9b8, 0x0000 }, - { 0x0700, 0xf9ba, 0x0000 }, - { 0x8700, 0xf9bd, 0x2000 }, - { 0x0700, 0xf9bc, 0x0000 }, - { 0x0700, 0xf9be, 0x0000 }, - { 0x8700, 0xf9df, 0x6000 }, - { 0x8700, 0xf9cf, 0x5000 }, - { 0x8700, 0xf9c7, 0x4000 }, - { 0x8700, 0xf9c3, 0x3000 }, - { 0x8700, 0xf9c1, 0x2000 }, - { 0x0700, 0xf9c0, 0x0000 }, - { 0x0700, 0xf9c2, 0x0000 }, - { 0x8700, 0xf9c5, 0x2000 }, - { 0x0700, 0xf9c4, 0x0000 }, - { 0x0700, 0xf9c6, 0x0000 }, - { 0x8700, 0xf9cb, 0x3000 }, - { 0x8700, 0xf9c9, 0x2000 }, - { 0x0700, 0xf9c8, 0x0000 }, - { 0x0700, 0xf9ca, 0x0000 }, - { 0x8700, 0xf9cd, 0x2000 }, - { 0x0700, 0xf9cc, 0x0000 }, - { 0x0700, 0xf9ce, 0x0000 }, - { 0x8700, 0xf9d7, 0x4000 }, - { 0x8700, 0xf9d3, 0x3000 }, - { 0x8700, 0xf9d1, 0x2000 }, - { 0x0700, 0xf9d0, 0x0000 }, - { 0x0700, 0xf9d2, 0x0000 }, - { 0x8700, 0xf9d5, 0x2000 }, - { 0x0700, 0xf9d4, 0x0000 }, - { 0x0700, 0xf9d6, 0x0000 }, - { 0x8700, 0xf9db, 0x3000 }, - { 0x8700, 0xf9d9, 0x2000 }, - { 0x0700, 0xf9d8, 0x0000 }, - { 0x0700, 0xf9da, 0x0000 }, - { 0x8700, 0xf9dd, 0x2000 }, - { 0x0700, 0xf9dc, 0x0000 }, - { 0x0700, 0xf9de, 0x0000 }, - { 0x8700, 0xf9ef, 0x5000 }, - { 0x8700, 0xf9e7, 0x4000 }, - { 0x8700, 0xf9e3, 0x3000 }, - { 0x8700, 0xf9e1, 0x2000 }, - { 0x0700, 0xf9e0, 0x0000 }, - { 0x0700, 0xf9e2, 0x0000 }, - { 0x8700, 0xf9e5, 0x2000 }, - { 0x0700, 0xf9e4, 0x0000 }, - { 0x0700, 0xf9e6, 0x0000 }, - { 0x8700, 0xf9eb, 0x3000 }, - { 0x8700, 0xf9e9, 0x2000 }, - { 0x0700, 0xf9e8, 0x0000 }, - { 0x0700, 0xf9ea, 0x0000 }, - { 0x8700, 0xf9ed, 0x2000 }, - { 0x0700, 0xf9ec, 0x0000 }, - { 0x0700, 0xf9ee, 0x0000 }, - { 0x8700, 0xf9f7, 0x4000 }, - { 0x8700, 0xf9f3, 0x3000 }, - { 0x8700, 0xf9f1, 0x2000 }, - { 0x0700, 0xf9f0, 0x0000 }, - { 0x0700, 0xf9f2, 0x0000 }, - { 0x8700, 0xf9f5, 0x2000 }, - { 0x0700, 0xf9f4, 0x0000 }, - { 0x0700, 0xf9f6, 0x0000 }, - { 0x8700, 0xf9fb, 0x3000 }, - { 0x8700, 0xf9f9, 0x2000 }, - { 0x0700, 0xf9f8, 0x0000 }, - { 0x0700, 0xf9fa, 0x0000 }, - { 0x8700, 0xf9fd, 0x2000 }, - { 0x0700, 0xf9fc, 0x0000 }, - { 0x0700, 0xf9fe, 0x0000 }, - { 0x8700, 0xfa41, 0x7000 }, - { 0x8700, 0xfa1f, 0x6000 }, - { 0x8700, 0xfa0f, 0x5000 }, - { 0x8700, 0xfa07, 0x4000 }, - { 0x8700, 0xfa03, 0x3000 }, - { 0x8700, 0xfa01, 0x2000 }, - { 0x0700, 0xfa00, 0x0000 }, - { 0x0700, 0xfa02, 0x0000 }, - { 0x8700, 0xfa05, 0x2000 }, - { 0x0700, 0xfa04, 0x0000 }, - { 0x0700, 0xfa06, 0x0000 }, - { 0x8700, 0xfa0b, 0x3000 }, - { 0x8700, 0xfa09, 0x2000 }, - { 0x0700, 0xfa08, 0x0000 }, - { 0x0700, 0xfa0a, 0x0000 }, - { 0x8700, 0xfa0d, 0x2000 }, - { 0x0700, 0xfa0c, 0x0000 }, - { 0x0700, 0xfa0e, 0x0000 }, - { 0x8700, 0xfa17, 0x4000 }, - { 0x8700, 0xfa13, 0x3000 }, - { 0x8700, 0xfa11, 0x2000 }, - { 0x0700, 0xfa10, 0x0000 }, - { 0x0700, 0xfa12, 0x0000 }, - { 0x8700, 0xfa15, 0x2000 }, - { 0x0700, 0xfa14, 0x0000 }, - { 0x0700, 0xfa16, 0x0000 }, - { 0x8700, 0xfa1b, 0x3000 }, - { 0x8700, 0xfa19, 0x2000 }, - { 0x0700, 0xfa18, 0x0000 }, - { 0x0700, 0xfa1a, 0x0000 }, - { 0x8700, 0xfa1d, 0x2000 }, - { 0x0700, 0xfa1c, 0x0000 }, - { 0x0700, 0xfa1e, 0x0000 }, - { 0x8700, 0xfa31, 0x5000 }, - { 0x8700, 0xfa27, 0x4000 }, - { 0x8700, 0xfa23, 0x3000 }, - { 0x8700, 0xfa21, 0x2000 }, - { 0x0700, 0xfa20, 0x0000 }, - { 0x0700, 0xfa22, 0x0000 }, - { 0x8700, 0xfa25, 0x2000 }, - { 0x0700, 0xfa24, 0x0000 }, - { 0x0700, 0xfa26, 0x0000 }, - { 0x8700, 0xfa2b, 0x3000 }, - { 0x8700, 0xfa29, 0x2000 }, - { 0x0700, 0xfa28, 0x0000 }, - { 0x0700, 0xfa2a, 0x0000 }, - { 0x8700, 0xfa2d, 0x2000 }, - { 0x0700, 0xfa2c, 0x0000 }, - { 0x0700, 0xfa30, 0x0000 }, - { 0x8700, 0xfa39, 0x4000 }, - { 0x8700, 0xfa35, 0x3000 }, - { 0x8700, 0xfa33, 0x2000 }, - { 0x0700, 0xfa32, 0x0000 }, - { 0x0700, 0xfa34, 0x0000 }, - { 0x8700, 0xfa37, 0x2000 }, - { 0x0700, 0xfa36, 0x0000 }, - { 0x0700, 0xfa38, 0x0000 }, - { 0x8700, 0xfa3d, 0x3000 }, - { 0x8700, 0xfa3b, 0x2000 }, - { 0x0700, 0xfa3a, 0x0000 }, - { 0x0700, 0xfa3c, 0x0000 }, - { 0x8700, 0xfa3f, 0x2000 }, - { 0x0700, 0xfa3e, 0x0000 }, - { 0x0700, 0xfa40, 0x0000 }, - { 0x8700, 0xfa61, 0x6000 }, - { 0x8700, 0xfa51, 0x5000 }, - { 0x8700, 0xfa49, 0x4000 }, - { 0x8700, 0xfa45, 0x3000 }, - { 0x8700, 0xfa43, 0x2000 }, - { 0x0700, 0xfa42, 0x0000 }, - { 0x0700, 0xfa44, 0x0000 }, - { 0x8700, 0xfa47, 0x2000 }, - { 0x0700, 0xfa46, 0x0000 }, - { 0x0700, 0xfa48, 0x0000 }, - { 0x8700, 0xfa4d, 0x3000 }, - { 0x8700, 0xfa4b, 0x2000 }, - { 0x0700, 0xfa4a, 0x0000 }, - { 0x0700, 0xfa4c, 0x0000 }, - { 0x8700, 0xfa4f, 0x2000 }, - { 0x0700, 0xfa4e, 0x0000 }, - { 0x0700, 0xfa50, 0x0000 }, - { 0x8700, 0xfa59, 0x4000 }, - { 0x8700, 0xfa55, 0x3000 }, - { 0x8700, 0xfa53, 0x2000 }, - { 0x0700, 0xfa52, 0x0000 }, - { 0x0700, 0xfa54, 0x0000 }, - { 0x8700, 0xfa57, 0x2000 }, - { 0x0700, 0xfa56, 0x0000 }, - { 0x0700, 0xfa58, 0x0000 }, - { 0x8700, 0xfa5d, 0x3000 }, - { 0x8700, 0xfa5b, 0x2000 }, - { 0x0700, 0xfa5a, 0x0000 }, - { 0x0700, 0xfa5c, 0x0000 }, - { 0x8700, 0xfa5f, 0x2000 }, - { 0x0700, 0xfa5e, 0x0000 }, - { 0x0700, 0xfa60, 0x0000 }, - { 0x8500, 0xfb06, 0x5000 }, - { 0x8700, 0xfa69, 0x4000 }, - { 0x8700, 0xfa65, 0x3000 }, - { 0x8700, 0xfa63, 0x2000 }, - { 0x0700, 0xfa62, 0x0000 }, - { 0x0700, 0xfa64, 0x0000 }, - { 0x8700, 0xfa67, 0x2000 }, - { 0x0700, 0xfa66, 0x0000 }, - { 0x0700, 0xfa68, 0x0000 }, - { 0x8500, 0xfb02, 0x3000 }, - { 0x8500, 0xfb00, 0x2000 }, - { 0x0700, 0xfa6a, 0x0000 }, - { 0x0500, 0xfb01, 0x0000 }, - { 0x8500, 0xfb04, 0x2000 }, - { 0x0500, 0xfb03, 0x0000 }, - { 0x0500, 0xfb05, 0x0000 }, - { 0x8700, 0xfb1f, 0x4000 }, - { 0x8500, 0xfb16, 0x3000 }, - { 0x8500, 0xfb14, 0x2000 }, - { 0x0500, 0xfb13, 0x0000 }, - { 0x0500, 0xfb15, 0x0000 }, - { 0x8700, 0xfb1d, 0x2000 }, - { 0x0500, 0xfb17, 0x0000 }, - { 0x0c00, 0xfb1e, 0x0000 }, - { 0x8700, 0xfb23, 0x3000 }, - { 0x8700, 0xfb21, 0x2000 }, - { 0x0700, 0xfb20, 0x0000 }, - { 0x0700, 0xfb22, 0x0000 }, - { 0x8700, 0xfb25, 0x2000 }, - { 0x0700, 0xfb24, 0x0000 }, - { 0x0700, 0xfb26, 0x0000 }, - { 0x8700, 0xfbac, 0x8000 }, - { 0x8700, 0xfb6c, 0x7000 }, - { 0x8700, 0xfb4c, 0x6000 }, - { 0x8700, 0xfb38, 0x5000 }, - { 0x8700, 0xfb2f, 0x4000 }, - { 0x8700, 0xfb2b, 0x3000 }, - { 0x9900, 0xfb29, 0x2000 }, - { 0x0700, 0xfb28, 0x0000 }, - { 0x0700, 0xfb2a, 0x0000 }, - { 0x8700, 0xfb2d, 0x2000 }, - { 0x0700, 0xfb2c, 0x0000 }, - { 0x0700, 0xfb2e, 0x0000 }, - { 0x8700, 0xfb33, 0x3000 }, - { 0x8700, 0xfb31, 0x2000 }, - { 0x0700, 0xfb30, 0x0000 }, - { 0x0700, 0xfb32, 0x0000 }, - { 0x8700, 0xfb35, 0x2000 }, - { 0x0700, 0xfb34, 0x0000 }, - { 0x0700, 0xfb36, 0x0000 }, - { 0x8700, 0xfb43, 0x4000 }, - { 0x8700, 0xfb3c, 0x3000 }, - { 0x8700, 0xfb3a, 0x2000 }, - { 0x0700, 0xfb39, 0x0000 }, - { 0x0700, 0xfb3b, 0x0000 }, - { 0x8700, 0xfb40, 0x2000 }, - { 0x0700, 0xfb3e, 0x0000 }, - { 0x0700, 0xfb41, 0x0000 }, - { 0x8700, 0xfb48, 0x3000 }, - { 0x8700, 0xfb46, 0x2000 }, - { 0x0700, 0xfb44, 0x0000 }, - { 0x0700, 0xfb47, 0x0000 }, - { 0x8700, 0xfb4a, 0x2000 }, - { 0x0700, 0xfb49, 0x0000 }, - { 0x0700, 0xfb4b, 0x0000 }, - { 0x8700, 0xfb5c, 0x5000 }, - { 0x8700, 0xfb54, 0x4000 }, - { 0x8700, 0xfb50, 0x3000 }, - { 0x8700, 0xfb4e, 0x2000 }, - { 0x0700, 0xfb4d, 0x0000 }, - { 0x0700, 0xfb4f, 0x0000 }, - { 0x8700, 0xfb52, 0x2000 }, - { 0x0700, 0xfb51, 0x0000 }, - { 0x0700, 0xfb53, 0x0000 }, - { 0x8700, 0xfb58, 0x3000 }, - { 0x8700, 0xfb56, 0x2000 }, - { 0x0700, 0xfb55, 0x0000 }, - { 0x0700, 0xfb57, 0x0000 }, - { 0x8700, 0xfb5a, 0x2000 }, - { 0x0700, 0xfb59, 0x0000 }, - { 0x0700, 0xfb5b, 0x0000 }, - { 0x8700, 0xfb64, 0x4000 }, - { 0x8700, 0xfb60, 0x3000 }, - { 0x8700, 0xfb5e, 0x2000 }, - { 0x0700, 0xfb5d, 0x0000 }, - { 0x0700, 0xfb5f, 0x0000 }, - { 0x8700, 0xfb62, 0x2000 }, - { 0x0700, 0xfb61, 0x0000 }, - { 0x0700, 0xfb63, 0x0000 }, - { 0x8700, 0xfb68, 0x3000 }, - { 0x8700, 0xfb66, 0x2000 }, - { 0x0700, 0xfb65, 0x0000 }, - { 0x0700, 0xfb67, 0x0000 }, - { 0x8700, 0xfb6a, 0x2000 }, - { 0x0700, 0xfb69, 0x0000 }, - { 0x0700, 0xfb6b, 0x0000 }, - { 0x8700, 0xfb8c, 0x6000 }, - { 0x8700, 0xfb7c, 0x5000 }, - { 0x8700, 0xfb74, 0x4000 }, - { 0x8700, 0xfb70, 0x3000 }, - { 0x8700, 0xfb6e, 0x2000 }, - { 0x0700, 0xfb6d, 0x0000 }, - { 0x0700, 0xfb6f, 0x0000 }, - { 0x8700, 0xfb72, 0x2000 }, - { 0x0700, 0xfb71, 0x0000 }, - { 0x0700, 0xfb73, 0x0000 }, - { 0x8700, 0xfb78, 0x3000 }, - { 0x8700, 0xfb76, 0x2000 }, - { 0x0700, 0xfb75, 0x0000 }, - { 0x0700, 0xfb77, 0x0000 }, - { 0x8700, 0xfb7a, 0x2000 }, - { 0x0700, 0xfb79, 0x0000 }, - { 0x0700, 0xfb7b, 0x0000 }, - { 0x8700, 0xfb84, 0x4000 }, - { 0x8700, 0xfb80, 0x3000 }, - { 0x8700, 0xfb7e, 0x2000 }, - { 0x0700, 0xfb7d, 0x0000 }, - { 0x0700, 0xfb7f, 0x0000 }, - { 0x8700, 0xfb82, 0x2000 }, - { 0x0700, 0xfb81, 0x0000 }, - { 0x0700, 0xfb83, 0x0000 }, - { 0x8700, 0xfb88, 0x3000 }, - { 0x8700, 0xfb86, 0x2000 }, - { 0x0700, 0xfb85, 0x0000 }, - { 0x0700, 0xfb87, 0x0000 }, - { 0x8700, 0xfb8a, 0x2000 }, - { 0x0700, 0xfb89, 0x0000 }, - { 0x0700, 0xfb8b, 0x0000 }, - { 0x8700, 0xfb9c, 0x5000 }, - { 0x8700, 0xfb94, 0x4000 }, - { 0x8700, 0xfb90, 0x3000 }, - { 0x8700, 0xfb8e, 0x2000 }, - { 0x0700, 0xfb8d, 0x0000 }, - { 0x0700, 0xfb8f, 0x0000 }, - { 0x8700, 0xfb92, 0x2000 }, - { 0x0700, 0xfb91, 0x0000 }, - { 0x0700, 0xfb93, 0x0000 }, - { 0x8700, 0xfb98, 0x3000 }, - { 0x8700, 0xfb96, 0x2000 }, - { 0x0700, 0xfb95, 0x0000 }, - { 0x0700, 0xfb97, 0x0000 }, - { 0x8700, 0xfb9a, 0x2000 }, - { 0x0700, 0xfb99, 0x0000 }, - { 0x0700, 0xfb9b, 0x0000 }, - { 0x8700, 0xfba4, 0x4000 }, - { 0x8700, 0xfba0, 0x3000 }, - { 0x8700, 0xfb9e, 0x2000 }, - { 0x0700, 0xfb9d, 0x0000 }, - { 0x0700, 0xfb9f, 0x0000 }, - { 0x8700, 0xfba2, 0x2000 }, - { 0x0700, 0xfba1, 0x0000 }, - { 0x0700, 0xfba3, 0x0000 }, - { 0x8700, 0xfba8, 0x3000 }, - { 0x8700, 0xfba6, 0x2000 }, - { 0x0700, 0xfba5, 0x0000 }, - { 0x0700, 0xfba7, 0x0000 }, - { 0x8700, 0xfbaa, 0x2000 }, - { 0x0700, 0xfba9, 0x0000 }, - { 0x0700, 0xfbab, 0x0000 }, - { 0x8700, 0xfc0d, 0x7000 }, - { 0x8700, 0xfbed, 0x6000 }, - { 0x8700, 0xfbdd, 0x5000 }, - { 0x8700, 0xfbd5, 0x4000 }, - { 0x8700, 0xfbb0, 0x3000 }, - { 0x8700, 0xfbae, 0x2000 }, - { 0x0700, 0xfbad, 0x0000 }, - { 0x0700, 0xfbaf, 0x0000 }, - { 0x8700, 0xfbd3, 0x2000 }, - { 0x0700, 0xfbb1, 0x0000 }, - { 0x0700, 0xfbd4, 0x0000 }, - { 0x8700, 0xfbd9, 0x3000 }, - { 0x8700, 0xfbd7, 0x2000 }, - { 0x0700, 0xfbd6, 0x0000 }, - { 0x0700, 0xfbd8, 0x0000 }, - { 0x8700, 0xfbdb, 0x2000 }, - { 0x0700, 0xfbda, 0x0000 }, - { 0x0700, 0xfbdc, 0x0000 }, - { 0x8700, 0xfbe5, 0x4000 }, - { 0x8700, 0xfbe1, 0x3000 }, - { 0x8700, 0xfbdf, 0x2000 }, - { 0x0700, 0xfbde, 0x0000 }, - { 0x0700, 0xfbe0, 0x0000 }, - { 0x8700, 0xfbe3, 0x2000 }, - { 0x0700, 0xfbe2, 0x0000 }, - { 0x0700, 0xfbe4, 0x0000 }, - { 0x8700, 0xfbe9, 0x3000 }, - { 0x8700, 0xfbe7, 0x2000 }, - { 0x0700, 0xfbe6, 0x0000 }, - { 0x0700, 0xfbe8, 0x0000 }, - { 0x8700, 0xfbeb, 0x2000 }, - { 0x0700, 0xfbea, 0x0000 }, - { 0x0700, 0xfbec, 0x0000 }, - { 0x8700, 0xfbfd, 0x5000 }, - { 0x8700, 0xfbf5, 0x4000 }, - { 0x8700, 0xfbf1, 0x3000 }, - { 0x8700, 0xfbef, 0x2000 }, - { 0x0700, 0xfbee, 0x0000 }, - { 0x0700, 0xfbf0, 0x0000 }, - { 0x8700, 0xfbf3, 0x2000 }, - { 0x0700, 0xfbf2, 0x0000 }, - { 0x0700, 0xfbf4, 0x0000 }, - { 0x8700, 0xfbf9, 0x3000 }, - { 0x8700, 0xfbf7, 0x2000 }, - { 0x0700, 0xfbf6, 0x0000 }, - { 0x0700, 0xfbf8, 0x0000 }, - { 0x8700, 0xfbfb, 0x2000 }, - { 0x0700, 0xfbfa, 0x0000 }, - { 0x0700, 0xfbfc, 0x0000 }, - { 0x8700, 0xfc05, 0x4000 }, - { 0x8700, 0xfc01, 0x3000 }, - { 0x8700, 0xfbff, 0x2000 }, - { 0x0700, 0xfbfe, 0x0000 }, - { 0x0700, 0xfc00, 0x0000 }, - { 0x8700, 0xfc03, 0x2000 }, - { 0x0700, 0xfc02, 0x0000 }, - { 0x0700, 0xfc04, 0x0000 }, - { 0x8700, 0xfc09, 0x3000 }, - { 0x8700, 0xfc07, 0x2000 }, - { 0x0700, 0xfc06, 0x0000 }, - { 0x0700, 0xfc08, 0x0000 }, - { 0x8700, 0xfc0b, 0x2000 }, - { 0x0700, 0xfc0a, 0x0000 }, - { 0x0700, 0xfc0c, 0x0000 }, - { 0x8700, 0xfc2d, 0x6000 }, - { 0x8700, 0xfc1d, 0x5000 }, - { 0x8700, 0xfc15, 0x4000 }, - { 0x8700, 0xfc11, 0x3000 }, - { 0x8700, 0xfc0f, 0x2000 }, - { 0x0700, 0xfc0e, 0x0000 }, - { 0x0700, 0xfc10, 0x0000 }, - { 0x8700, 0xfc13, 0x2000 }, - { 0x0700, 0xfc12, 0x0000 }, - { 0x0700, 0xfc14, 0x0000 }, - { 0x8700, 0xfc19, 0x3000 }, - { 0x8700, 0xfc17, 0x2000 }, - { 0x0700, 0xfc16, 0x0000 }, - { 0x0700, 0xfc18, 0x0000 }, - { 0x8700, 0xfc1b, 0x2000 }, - { 0x0700, 0xfc1a, 0x0000 }, - { 0x0700, 0xfc1c, 0x0000 }, - { 0x8700, 0xfc25, 0x4000 }, - { 0x8700, 0xfc21, 0x3000 }, - { 0x8700, 0xfc1f, 0x2000 }, - { 0x0700, 0xfc1e, 0x0000 }, - { 0x0700, 0xfc20, 0x0000 }, - { 0x8700, 0xfc23, 0x2000 }, - { 0x0700, 0xfc22, 0x0000 }, - { 0x0700, 0xfc24, 0x0000 }, - { 0x8700, 0xfc29, 0x3000 }, - { 0x8700, 0xfc27, 0x2000 }, - { 0x0700, 0xfc26, 0x0000 }, - { 0x0700, 0xfc28, 0x0000 }, - { 0x8700, 0xfc2b, 0x2000 }, - { 0x0700, 0xfc2a, 0x0000 }, - { 0x0700, 0xfc2c, 0x0000 }, - { 0x8700, 0xfc3d, 0x5000 }, - { 0x8700, 0xfc35, 0x4000 }, - { 0x8700, 0xfc31, 0x3000 }, - { 0x8700, 0xfc2f, 0x2000 }, - { 0x0700, 0xfc2e, 0x0000 }, - { 0x0700, 0xfc30, 0x0000 }, - { 0x8700, 0xfc33, 0x2000 }, - { 0x0700, 0xfc32, 0x0000 }, - { 0x0700, 0xfc34, 0x0000 }, - { 0x8700, 0xfc39, 0x3000 }, - { 0x8700, 0xfc37, 0x2000 }, - { 0x0700, 0xfc36, 0x0000 }, - { 0x0700, 0xfc38, 0x0000 }, - { 0x8700, 0xfc3b, 0x2000 }, - { 0x0700, 0xfc3a, 0x0000 }, - { 0x0700, 0xfc3c, 0x0000 }, - { 0x8700, 0xfc45, 0x4000 }, - { 0x8700, 0xfc41, 0x3000 }, - { 0x8700, 0xfc3f, 0x2000 }, - { 0x0700, 0xfc3e, 0x0000 }, - { 0x0700, 0xfc40, 0x0000 }, - { 0x8700, 0xfc43, 0x2000 }, - { 0x0700, 0xfc42, 0x0000 }, - { 0x0700, 0xfc44, 0x0000 }, - { 0x8700, 0xfc49, 0x3000 }, - { 0x8700, 0xfc47, 0x2000 }, - { 0x0700, 0xfc46, 0x0000 }, - { 0x0700, 0xfc48, 0x0000 }, - { 0x8700, 0xfc4b, 0x2000 }, - { 0x0700, 0xfc4a, 0x0000 }, - { 0x0700, 0xfc4c, 0x0000 }, - { 0x8700, 0xfeac, 0xa000 }, - { 0x8700, 0xfd5d, 0x9000 }, - { 0x8700, 0xfccd, 0x8000 }, - { 0x8700, 0xfc8d, 0x7000 }, - { 0x8700, 0xfc6d, 0x6000 }, - { 0x8700, 0xfc5d, 0x5000 }, - { 0x8700, 0xfc55, 0x4000 }, - { 0x8700, 0xfc51, 0x3000 }, - { 0x8700, 0xfc4f, 0x2000 }, - { 0x0700, 0xfc4e, 0x0000 }, - { 0x0700, 0xfc50, 0x0000 }, - { 0x8700, 0xfc53, 0x2000 }, - { 0x0700, 0xfc52, 0x0000 }, - { 0x0700, 0xfc54, 0x0000 }, - { 0x8700, 0xfc59, 0x3000 }, - { 0x8700, 0xfc57, 0x2000 }, - { 0x0700, 0xfc56, 0x0000 }, - { 0x0700, 0xfc58, 0x0000 }, - { 0x8700, 0xfc5b, 0x2000 }, - { 0x0700, 0xfc5a, 0x0000 }, - { 0x0700, 0xfc5c, 0x0000 }, - { 0x8700, 0xfc65, 0x4000 }, - { 0x8700, 0xfc61, 0x3000 }, - { 0x8700, 0xfc5f, 0x2000 }, - { 0x0700, 0xfc5e, 0x0000 }, - { 0x0700, 0xfc60, 0x0000 }, - { 0x8700, 0xfc63, 0x2000 }, - { 0x0700, 0xfc62, 0x0000 }, - { 0x0700, 0xfc64, 0x0000 }, - { 0x8700, 0xfc69, 0x3000 }, - { 0x8700, 0xfc67, 0x2000 }, - { 0x0700, 0xfc66, 0x0000 }, - { 0x0700, 0xfc68, 0x0000 }, - { 0x8700, 0xfc6b, 0x2000 }, - { 0x0700, 0xfc6a, 0x0000 }, - { 0x0700, 0xfc6c, 0x0000 }, - { 0x8700, 0xfc7d, 0x5000 }, - { 0x8700, 0xfc75, 0x4000 }, - { 0x8700, 0xfc71, 0x3000 }, - { 0x8700, 0xfc6f, 0x2000 }, - { 0x0700, 0xfc6e, 0x0000 }, - { 0x0700, 0xfc70, 0x0000 }, - { 0x8700, 0xfc73, 0x2000 }, - { 0x0700, 0xfc72, 0x0000 }, - { 0x0700, 0xfc74, 0x0000 }, - { 0x8700, 0xfc79, 0x3000 }, - { 0x8700, 0xfc77, 0x2000 }, - { 0x0700, 0xfc76, 0x0000 }, - { 0x0700, 0xfc78, 0x0000 }, - { 0x8700, 0xfc7b, 0x2000 }, - { 0x0700, 0xfc7a, 0x0000 }, - { 0x0700, 0xfc7c, 0x0000 }, - { 0x8700, 0xfc85, 0x4000 }, - { 0x8700, 0xfc81, 0x3000 }, - { 0x8700, 0xfc7f, 0x2000 }, - { 0x0700, 0xfc7e, 0x0000 }, - { 0x0700, 0xfc80, 0x0000 }, - { 0x8700, 0xfc83, 0x2000 }, - { 0x0700, 0xfc82, 0x0000 }, - { 0x0700, 0xfc84, 0x0000 }, - { 0x8700, 0xfc89, 0x3000 }, - { 0x8700, 0xfc87, 0x2000 }, - { 0x0700, 0xfc86, 0x0000 }, - { 0x0700, 0xfc88, 0x0000 }, - { 0x8700, 0xfc8b, 0x2000 }, - { 0x0700, 0xfc8a, 0x0000 }, - { 0x0700, 0xfc8c, 0x0000 }, - { 0x8700, 0xfcad, 0x6000 }, - { 0x8700, 0xfc9d, 0x5000 }, - { 0x8700, 0xfc95, 0x4000 }, - { 0x8700, 0xfc91, 0x3000 }, - { 0x8700, 0xfc8f, 0x2000 }, - { 0x0700, 0xfc8e, 0x0000 }, - { 0x0700, 0xfc90, 0x0000 }, - { 0x8700, 0xfc93, 0x2000 }, - { 0x0700, 0xfc92, 0x0000 }, - { 0x0700, 0xfc94, 0x0000 }, - { 0x8700, 0xfc99, 0x3000 }, - { 0x8700, 0xfc97, 0x2000 }, - { 0x0700, 0xfc96, 0x0000 }, - { 0x0700, 0xfc98, 0x0000 }, - { 0x8700, 0xfc9b, 0x2000 }, - { 0x0700, 0xfc9a, 0x0000 }, - { 0x0700, 0xfc9c, 0x0000 }, - { 0x8700, 0xfca5, 0x4000 }, - { 0x8700, 0xfca1, 0x3000 }, - { 0x8700, 0xfc9f, 0x2000 }, - { 0x0700, 0xfc9e, 0x0000 }, - { 0x0700, 0xfca0, 0x0000 }, - { 0x8700, 0xfca3, 0x2000 }, - { 0x0700, 0xfca2, 0x0000 }, - { 0x0700, 0xfca4, 0x0000 }, - { 0x8700, 0xfca9, 0x3000 }, - { 0x8700, 0xfca7, 0x2000 }, - { 0x0700, 0xfca6, 0x0000 }, - { 0x0700, 0xfca8, 0x0000 }, - { 0x8700, 0xfcab, 0x2000 }, - { 0x0700, 0xfcaa, 0x0000 }, - { 0x0700, 0xfcac, 0x0000 }, - { 0x8700, 0xfcbd, 0x5000 }, - { 0x8700, 0xfcb5, 0x4000 }, - { 0x8700, 0xfcb1, 0x3000 }, - { 0x8700, 0xfcaf, 0x2000 }, - { 0x0700, 0xfcae, 0x0000 }, - { 0x0700, 0xfcb0, 0x0000 }, - { 0x8700, 0xfcb3, 0x2000 }, - { 0x0700, 0xfcb2, 0x0000 }, - { 0x0700, 0xfcb4, 0x0000 }, - { 0x8700, 0xfcb9, 0x3000 }, - { 0x8700, 0xfcb7, 0x2000 }, - { 0x0700, 0xfcb6, 0x0000 }, - { 0x0700, 0xfcb8, 0x0000 }, - { 0x8700, 0xfcbb, 0x2000 }, - { 0x0700, 0xfcba, 0x0000 }, - { 0x0700, 0xfcbc, 0x0000 }, - { 0x8700, 0xfcc5, 0x4000 }, - { 0x8700, 0xfcc1, 0x3000 }, - { 0x8700, 0xfcbf, 0x2000 }, - { 0x0700, 0xfcbe, 0x0000 }, - { 0x0700, 0xfcc0, 0x0000 }, - { 0x8700, 0xfcc3, 0x2000 }, - { 0x0700, 0xfcc2, 0x0000 }, - { 0x0700, 0xfcc4, 0x0000 }, - { 0x8700, 0xfcc9, 0x3000 }, - { 0x8700, 0xfcc7, 0x2000 }, - { 0x0700, 0xfcc6, 0x0000 }, - { 0x0700, 0xfcc8, 0x0000 }, - { 0x8700, 0xfccb, 0x2000 }, - { 0x0700, 0xfcca, 0x0000 }, - { 0x0700, 0xfccc, 0x0000 }, - { 0x8700, 0xfd0d, 0x7000 }, - { 0x8700, 0xfced, 0x6000 }, - { 0x8700, 0xfcdd, 0x5000 }, - { 0x8700, 0xfcd5, 0x4000 }, - { 0x8700, 0xfcd1, 0x3000 }, - { 0x8700, 0xfccf, 0x2000 }, - { 0x0700, 0xfcce, 0x0000 }, - { 0x0700, 0xfcd0, 0x0000 }, - { 0x8700, 0xfcd3, 0x2000 }, - { 0x0700, 0xfcd2, 0x0000 }, - { 0x0700, 0xfcd4, 0x0000 }, - { 0x8700, 0xfcd9, 0x3000 }, - { 0x8700, 0xfcd7, 0x2000 }, - { 0x0700, 0xfcd6, 0x0000 }, - { 0x0700, 0xfcd8, 0x0000 }, - { 0x8700, 0xfcdb, 0x2000 }, - { 0x0700, 0xfcda, 0x0000 }, - { 0x0700, 0xfcdc, 0x0000 }, - { 0x8700, 0xfce5, 0x4000 }, - { 0x8700, 0xfce1, 0x3000 }, - { 0x8700, 0xfcdf, 0x2000 }, - { 0x0700, 0xfcde, 0x0000 }, - { 0x0700, 0xfce0, 0x0000 }, - { 0x8700, 0xfce3, 0x2000 }, - { 0x0700, 0xfce2, 0x0000 }, - { 0x0700, 0xfce4, 0x0000 }, - { 0x8700, 0xfce9, 0x3000 }, - { 0x8700, 0xfce7, 0x2000 }, - { 0x0700, 0xfce6, 0x0000 }, - { 0x0700, 0xfce8, 0x0000 }, - { 0x8700, 0xfceb, 0x2000 }, - { 0x0700, 0xfcea, 0x0000 }, - { 0x0700, 0xfcec, 0x0000 }, - { 0x8700, 0xfcfd, 0x5000 }, - { 0x8700, 0xfcf5, 0x4000 }, - { 0x8700, 0xfcf1, 0x3000 }, - { 0x8700, 0xfcef, 0x2000 }, - { 0x0700, 0xfcee, 0x0000 }, - { 0x0700, 0xfcf0, 0x0000 }, - { 0x8700, 0xfcf3, 0x2000 }, - { 0x0700, 0xfcf2, 0x0000 }, - { 0x0700, 0xfcf4, 0x0000 }, - { 0x8700, 0xfcf9, 0x3000 }, - { 0x8700, 0xfcf7, 0x2000 }, - { 0x0700, 0xfcf6, 0x0000 }, - { 0x0700, 0xfcf8, 0x0000 }, - { 0x8700, 0xfcfb, 0x2000 }, - { 0x0700, 0xfcfa, 0x0000 }, - { 0x0700, 0xfcfc, 0x0000 }, - { 0x8700, 0xfd05, 0x4000 }, - { 0x8700, 0xfd01, 0x3000 }, - { 0x8700, 0xfcff, 0x2000 }, - { 0x0700, 0xfcfe, 0x0000 }, - { 0x0700, 0xfd00, 0x0000 }, - { 0x8700, 0xfd03, 0x2000 }, - { 0x0700, 0xfd02, 0x0000 }, - { 0x0700, 0xfd04, 0x0000 }, - { 0x8700, 0xfd09, 0x3000 }, - { 0x8700, 0xfd07, 0x2000 }, - { 0x0700, 0xfd06, 0x0000 }, - { 0x0700, 0xfd08, 0x0000 }, - { 0x8700, 0xfd0b, 0x2000 }, - { 0x0700, 0xfd0a, 0x0000 }, - { 0x0700, 0xfd0c, 0x0000 }, - { 0x8700, 0xfd2d, 0x6000 }, - { 0x8700, 0xfd1d, 0x5000 }, - { 0x8700, 0xfd15, 0x4000 }, - { 0x8700, 0xfd11, 0x3000 }, - { 0x8700, 0xfd0f, 0x2000 }, - { 0x0700, 0xfd0e, 0x0000 }, - { 0x0700, 0xfd10, 0x0000 }, - { 0x8700, 0xfd13, 0x2000 }, - { 0x0700, 0xfd12, 0x0000 }, - { 0x0700, 0xfd14, 0x0000 }, - { 0x8700, 0xfd19, 0x3000 }, - { 0x8700, 0xfd17, 0x2000 }, - { 0x0700, 0xfd16, 0x0000 }, - { 0x0700, 0xfd18, 0x0000 }, - { 0x8700, 0xfd1b, 0x2000 }, - { 0x0700, 0xfd1a, 0x0000 }, - { 0x0700, 0xfd1c, 0x0000 }, - { 0x8700, 0xfd25, 0x4000 }, - { 0x8700, 0xfd21, 0x3000 }, - { 0x8700, 0xfd1f, 0x2000 }, - { 0x0700, 0xfd1e, 0x0000 }, - { 0x0700, 0xfd20, 0x0000 }, - { 0x8700, 0xfd23, 0x2000 }, - { 0x0700, 0xfd22, 0x0000 }, - { 0x0700, 0xfd24, 0x0000 }, - { 0x8700, 0xfd29, 0x3000 }, - { 0x8700, 0xfd27, 0x2000 }, - { 0x0700, 0xfd26, 0x0000 }, - { 0x0700, 0xfd28, 0x0000 }, - { 0x8700, 0xfd2b, 0x2000 }, - { 0x0700, 0xfd2a, 0x0000 }, - { 0x0700, 0xfd2c, 0x0000 }, - { 0x8700, 0xfd3d, 0x5000 }, - { 0x8700, 0xfd35, 0x4000 }, - { 0x8700, 0xfd31, 0x3000 }, - { 0x8700, 0xfd2f, 0x2000 }, - { 0x0700, 0xfd2e, 0x0000 }, - { 0x0700, 0xfd30, 0x0000 }, - { 0x8700, 0xfd33, 0x2000 }, - { 0x0700, 0xfd32, 0x0000 }, - { 0x0700, 0xfd34, 0x0000 }, - { 0x8700, 0xfd39, 0x3000 }, - { 0x8700, 0xfd37, 0x2000 }, - { 0x0700, 0xfd36, 0x0000 }, - { 0x0700, 0xfd38, 0x0000 }, - { 0x8700, 0xfd3b, 0x2000 }, - { 0x0700, 0xfd3a, 0x0000 }, - { 0x0700, 0xfd3c, 0x0000 }, - { 0x8700, 0xfd55, 0x4000 }, - { 0x8700, 0xfd51, 0x3000 }, - { 0x9200, 0xfd3f, 0x2000 }, - { 0x1600, 0xfd3e, 0x0000 }, - { 0x0700, 0xfd50, 0x0000 }, - { 0x8700, 0xfd53, 0x2000 }, - { 0x0700, 0xfd52, 0x0000 }, - { 0x0700, 0xfd54, 0x0000 }, - { 0x8700, 0xfd59, 0x3000 }, - { 0x8700, 0xfd57, 0x2000 }, - { 0x0700, 0xfd56, 0x0000 }, - { 0x0700, 0xfd58, 0x0000 }, - { 0x8700, 0xfd5b, 0x2000 }, - { 0x0700, 0xfd5a, 0x0000 }, - { 0x0700, 0xfd5c, 0x0000 }, - { 0x8c00, 0xfe09, 0x8000 }, - { 0x8700, 0xfd9f, 0x7000 }, - { 0x8700, 0xfd7d, 0x6000 }, - { 0x8700, 0xfd6d, 0x5000 }, - { 0x8700, 0xfd65, 0x4000 }, - { 0x8700, 0xfd61, 0x3000 }, - { 0x8700, 0xfd5f, 0x2000 }, - { 0x0700, 0xfd5e, 0x0000 }, - { 0x0700, 0xfd60, 0x0000 }, - { 0x8700, 0xfd63, 0x2000 }, - { 0x0700, 0xfd62, 0x0000 }, - { 0x0700, 0xfd64, 0x0000 }, - { 0x8700, 0xfd69, 0x3000 }, - { 0x8700, 0xfd67, 0x2000 }, - { 0x0700, 0xfd66, 0x0000 }, - { 0x0700, 0xfd68, 0x0000 }, - { 0x8700, 0xfd6b, 0x2000 }, - { 0x0700, 0xfd6a, 0x0000 }, - { 0x0700, 0xfd6c, 0x0000 }, - { 0x8700, 0xfd75, 0x4000 }, - { 0x8700, 0xfd71, 0x3000 }, - { 0x8700, 0xfd6f, 0x2000 }, - { 0x0700, 0xfd6e, 0x0000 }, - { 0x0700, 0xfd70, 0x0000 }, - { 0x8700, 0xfd73, 0x2000 }, - { 0x0700, 0xfd72, 0x0000 }, - { 0x0700, 0xfd74, 0x0000 }, - { 0x8700, 0xfd79, 0x3000 }, - { 0x8700, 0xfd77, 0x2000 }, - { 0x0700, 0xfd76, 0x0000 }, - { 0x0700, 0xfd78, 0x0000 }, - { 0x8700, 0xfd7b, 0x2000 }, - { 0x0700, 0xfd7a, 0x0000 }, - { 0x0700, 0xfd7c, 0x0000 }, - { 0x8700, 0xfd8d, 0x5000 }, - { 0x8700, 0xfd85, 0x4000 }, - { 0x8700, 0xfd81, 0x3000 }, - { 0x8700, 0xfd7f, 0x2000 }, - { 0x0700, 0xfd7e, 0x0000 }, - { 0x0700, 0xfd80, 0x0000 }, - { 0x8700, 0xfd83, 0x2000 }, - { 0x0700, 0xfd82, 0x0000 }, - { 0x0700, 0xfd84, 0x0000 }, - { 0x8700, 0xfd89, 0x3000 }, - { 0x8700, 0xfd87, 0x2000 }, - { 0x0700, 0xfd86, 0x0000 }, - { 0x0700, 0xfd88, 0x0000 }, - { 0x8700, 0xfd8b, 0x2000 }, - { 0x0700, 0xfd8a, 0x0000 }, - { 0x0700, 0xfd8c, 0x0000 }, - { 0x8700, 0xfd97, 0x4000 }, - { 0x8700, 0xfd93, 0x3000 }, - { 0x8700, 0xfd8f, 0x2000 }, - { 0x0700, 0xfd8e, 0x0000 }, - { 0x0700, 0xfd92, 0x0000 }, - { 0x8700, 0xfd95, 0x2000 }, - { 0x0700, 0xfd94, 0x0000 }, - { 0x0700, 0xfd96, 0x0000 }, - { 0x8700, 0xfd9b, 0x3000 }, - { 0x8700, 0xfd99, 0x2000 }, - { 0x0700, 0xfd98, 0x0000 }, - { 0x0700, 0xfd9a, 0x0000 }, - { 0x8700, 0xfd9d, 0x2000 }, - { 0x0700, 0xfd9c, 0x0000 }, - { 0x0700, 0xfd9e, 0x0000 }, - { 0x8700, 0xfdbf, 0x6000 }, - { 0x8700, 0xfdaf, 0x5000 }, - { 0x8700, 0xfda7, 0x4000 }, - { 0x8700, 0xfda3, 0x3000 }, - { 0x8700, 0xfda1, 0x2000 }, - { 0x0700, 0xfda0, 0x0000 }, - { 0x0700, 0xfda2, 0x0000 }, - { 0x8700, 0xfda5, 0x2000 }, - { 0x0700, 0xfda4, 0x0000 }, - { 0x0700, 0xfda6, 0x0000 }, - { 0x8700, 0xfdab, 0x3000 }, - { 0x8700, 0xfda9, 0x2000 }, - { 0x0700, 0xfda8, 0x0000 }, - { 0x0700, 0xfdaa, 0x0000 }, - { 0x8700, 0xfdad, 0x2000 }, - { 0x0700, 0xfdac, 0x0000 }, - { 0x0700, 0xfdae, 0x0000 }, - { 0x8700, 0xfdb7, 0x4000 }, - { 0x8700, 0xfdb3, 0x3000 }, - { 0x8700, 0xfdb1, 0x2000 }, - { 0x0700, 0xfdb0, 0x0000 }, - { 0x0700, 0xfdb2, 0x0000 }, - { 0x8700, 0xfdb5, 0x2000 }, - { 0x0700, 0xfdb4, 0x0000 }, - { 0x0700, 0xfdb6, 0x0000 }, - { 0x8700, 0xfdbb, 0x3000 }, - { 0x8700, 0xfdb9, 0x2000 }, - { 0x0700, 0xfdb8, 0x0000 }, - { 0x0700, 0xfdba, 0x0000 }, - { 0x8700, 0xfdbd, 0x2000 }, - { 0x0700, 0xfdbc, 0x0000 }, - { 0x0700, 0xfdbe, 0x0000 }, - { 0x8700, 0xfdf7, 0x5000 }, - { 0x8700, 0xfdc7, 0x4000 }, - { 0x8700, 0xfdc3, 0x3000 }, - { 0x8700, 0xfdc1, 0x2000 }, - { 0x0700, 0xfdc0, 0x0000 }, - { 0x0700, 0xfdc2, 0x0000 }, - { 0x8700, 0xfdc5, 0x2000 }, - { 0x0700, 0xfdc4, 0x0000 }, - { 0x0700, 0xfdc6, 0x0000 }, - { 0x8700, 0xfdf3, 0x3000 }, - { 0x8700, 0xfdf1, 0x2000 }, - { 0x0700, 0xfdf0, 0x0000 }, - { 0x0700, 0xfdf2, 0x0000 }, - { 0x8700, 0xfdf5, 0x2000 }, - { 0x0700, 0xfdf4, 0x0000 }, - { 0x0700, 0xfdf6, 0x0000 }, - { 0x8c00, 0xfe01, 0x4000 }, - { 0x8700, 0xfdfb, 0x3000 }, - { 0x8700, 0xfdf9, 0x2000 }, - { 0x0700, 0xfdf8, 0x0000 }, - { 0x0700, 0xfdfa, 0x0000 }, - { 0x9a00, 0xfdfd, 0x2000 }, - { 0x1700, 0xfdfc, 0x0000 }, - { 0x0c00, 0xfe00, 0x0000 }, - { 0x8c00, 0xfe05, 0x3000 }, - { 0x8c00, 0xfe03, 0x2000 }, - { 0x0c00, 0xfe02, 0x0000 }, - { 0x0c00, 0xfe04, 0x0000 }, - { 0x8c00, 0xfe07, 0x2000 }, - { 0x0c00, 0xfe06, 0x0000 }, - { 0x0c00, 0xfe08, 0x0000 }, - { 0x9900, 0xfe66, 0x7000 }, - { 0x9500, 0xfe45, 0x6000 }, - { 0x9600, 0xfe35, 0x5000 }, - { 0x8c00, 0xfe21, 0x4000 }, - { 0x8c00, 0xfe0d, 0x3000 }, - { 0x8c00, 0xfe0b, 0x2000 }, - { 0x0c00, 0xfe0a, 0x0000 }, - { 0x0c00, 0xfe0c, 0x0000 }, - { 0x8c00, 0xfe0f, 0x2000 }, - { 0x0c00, 0xfe0e, 0x0000 }, - { 0x0c00, 0xfe20, 0x0000 }, - { 0x9100, 0xfe31, 0x3000 }, - { 0x8c00, 0xfe23, 0x2000 }, - { 0x0c00, 0xfe22, 0x0000 }, - { 0x1500, 0xfe30, 0x0000 }, - { 0x9000, 0xfe33, 0x2000 }, - { 0x1100, 0xfe32, 0x0000 }, - { 0x1000, 0xfe34, 0x0000 }, - { 0x9600, 0xfe3d, 0x4000 }, - { 0x9600, 0xfe39, 0x3000 }, - { 0x9600, 0xfe37, 0x2000 }, - { 0x1200, 0xfe36, 0x0000 }, - { 0x1200, 0xfe38, 0x0000 }, - { 0x9600, 0xfe3b, 0x2000 }, - { 0x1200, 0xfe3a, 0x0000 }, - { 0x1200, 0xfe3c, 0x0000 }, - { 0x9600, 0xfe41, 0x3000 }, - { 0x9600, 0xfe3f, 0x2000 }, - { 0x1200, 0xfe3e, 0x0000 }, - { 0x1200, 0xfe40, 0x0000 }, - { 0x9600, 0xfe43, 0x2000 }, - { 0x1200, 0xfe42, 0x0000 }, - { 0x1200, 0xfe44, 0x0000 }, - { 0x9500, 0xfe56, 0x5000 }, - { 0x9000, 0xfe4d, 0x4000 }, - { 0x9500, 0xfe49, 0x3000 }, - { 0x9600, 0xfe47, 0x2000 }, - { 0x1500, 0xfe46, 0x0000 }, - { 0x1200, 0xfe48, 0x0000 }, - { 0x9500, 0xfe4b, 0x2000 }, - { 0x1500, 0xfe4a, 0x0000 }, - { 0x1500, 0xfe4c, 0x0000 }, - { 0x9500, 0xfe51, 0x3000 }, - { 0x9000, 0xfe4f, 0x2000 }, - { 0x1000, 0xfe4e, 0x0000 }, - { 0x1500, 0xfe50, 0x0000 }, - { 0x9500, 0xfe54, 0x2000 }, - { 0x1500, 0xfe52, 0x0000 }, - { 0x1500, 0xfe55, 0x0000 }, - { 0x9200, 0xfe5e, 0x4000 }, - { 0x9200, 0xfe5a, 0x3000 }, - { 0x9100, 0xfe58, 0x2000 }, - { 0x1500, 0xfe57, 0x0000 }, - { 0x1600, 0xfe59, 0x0000 }, - { 0x9200, 0xfe5c, 0x2000 }, - { 0x1600, 0xfe5b, 0x0000 }, - { 0x1600, 0xfe5d, 0x0000 }, - { 0x9900, 0xfe62, 0x3000 }, - { 0x9500, 0xfe60, 0x2000 }, - { 0x1500, 0xfe5f, 0x0000 }, - { 0x1500, 0xfe61, 0x0000 }, - { 0x9900, 0xfe64, 0x2000 }, - { 0x1100, 0xfe63, 0x0000 }, - { 0x1900, 0xfe65, 0x0000 }, - { 0x8700, 0xfe8c, 0x6000 }, - { 0x8700, 0xfe7c, 0x5000 }, - { 0x8700, 0xfe73, 0x4000 }, - { 0x9500, 0xfe6b, 0x3000 }, - { 0x9700, 0xfe69, 0x2000 }, - { 0x1500, 0xfe68, 0x0000 }, - { 0x1500, 0xfe6a, 0x0000 }, - { 0x8700, 0xfe71, 0x2000 }, - { 0x0700, 0xfe70, 0x0000 }, - { 0x0700, 0xfe72, 0x0000 }, - { 0x8700, 0xfe78, 0x3000 }, - { 0x8700, 0xfe76, 0x2000 }, - { 0x0700, 0xfe74, 0x0000 }, - { 0x0700, 0xfe77, 0x0000 }, - { 0x8700, 0xfe7a, 0x2000 }, - { 0x0700, 0xfe79, 0x0000 }, - { 0x0700, 0xfe7b, 0x0000 }, - { 0x8700, 0xfe84, 0x4000 }, - { 0x8700, 0xfe80, 0x3000 }, - { 0x8700, 0xfe7e, 0x2000 }, - { 0x0700, 0xfe7d, 0x0000 }, - { 0x0700, 0xfe7f, 0x0000 }, - { 0x8700, 0xfe82, 0x2000 }, - { 0x0700, 0xfe81, 0x0000 }, - { 0x0700, 0xfe83, 0x0000 }, - { 0x8700, 0xfe88, 0x3000 }, - { 0x8700, 0xfe86, 0x2000 }, - { 0x0700, 0xfe85, 0x0000 }, - { 0x0700, 0xfe87, 0x0000 }, - { 0x8700, 0xfe8a, 0x2000 }, - { 0x0700, 0xfe89, 0x0000 }, - { 0x0700, 0xfe8b, 0x0000 }, - { 0x8700, 0xfe9c, 0x5000 }, - { 0x8700, 0xfe94, 0x4000 }, - { 0x8700, 0xfe90, 0x3000 }, - { 0x8700, 0xfe8e, 0x2000 }, - { 0x0700, 0xfe8d, 0x0000 }, - { 0x0700, 0xfe8f, 0x0000 }, - { 0x8700, 0xfe92, 0x2000 }, - { 0x0700, 0xfe91, 0x0000 }, - { 0x0700, 0xfe93, 0x0000 }, - { 0x8700, 0xfe98, 0x3000 }, - { 0x8700, 0xfe96, 0x2000 }, - { 0x0700, 0xfe95, 0x0000 }, - { 0x0700, 0xfe97, 0x0000 }, - { 0x8700, 0xfe9a, 0x2000 }, - { 0x0700, 0xfe99, 0x0000 }, - { 0x0700, 0xfe9b, 0x0000 }, - { 0x8700, 0xfea4, 0x4000 }, - { 0x8700, 0xfea0, 0x3000 }, - { 0x8700, 0xfe9e, 0x2000 }, - { 0x0700, 0xfe9d, 0x0000 }, - { 0x0700, 0xfe9f, 0x0000 }, - { 0x8700, 0xfea2, 0x2000 }, - { 0x0700, 0xfea1, 0x0000 }, - { 0x0700, 0xfea3, 0x0000 }, - { 0x8700, 0xfea8, 0x3000 }, - { 0x8700, 0xfea6, 0x2000 }, - { 0x0700, 0xfea5, 0x0000 }, - { 0x0700, 0xfea7, 0x0000 }, - { 0x8700, 0xfeaa, 0x2000 }, - { 0x0700, 0xfea9, 0x0000 }, - { 0x0700, 0xfeab, 0x0000 }, - { 0x8700, 0xffaf, 0x9000 }, - { 0x8900, 0xff2f, 0x8020 }, - { 0x8700, 0xfeec, 0x7000 }, - { 0x8700, 0xfecc, 0x6000 }, - { 0x8700, 0xfebc, 0x5000 }, - { 0x8700, 0xfeb4, 0x4000 }, - { 0x8700, 0xfeb0, 0x3000 }, - { 0x8700, 0xfeae, 0x2000 }, - { 0x0700, 0xfead, 0x0000 }, - { 0x0700, 0xfeaf, 0x0000 }, - { 0x8700, 0xfeb2, 0x2000 }, - { 0x0700, 0xfeb1, 0x0000 }, - { 0x0700, 0xfeb3, 0x0000 }, - { 0x8700, 0xfeb8, 0x3000 }, - { 0x8700, 0xfeb6, 0x2000 }, - { 0x0700, 0xfeb5, 0x0000 }, - { 0x0700, 0xfeb7, 0x0000 }, - { 0x8700, 0xfeba, 0x2000 }, - { 0x0700, 0xfeb9, 0x0000 }, - { 0x0700, 0xfebb, 0x0000 }, - { 0x8700, 0xfec4, 0x4000 }, - { 0x8700, 0xfec0, 0x3000 }, - { 0x8700, 0xfebe, 0x2000 }, - { 0x0700, 0xfebd, 0x0000 }, - { 0x0700, 0xfebf, 0x0000 }, - { 0x8700, 0xfec2, 0x2000 }, - { 0x0700, 0xfec1, 0x0000 }, - { 0x0700, 0xfec3, 0x0000 }, - { 0x8700, 0xfec8, 0x3000 }, - { 0x8700, 0xfec6, 0x2000 }, - { 0x0700, 0xfec5, 0x0000 }, - { 0x0700, 0xfec7, 0x0000 }, - { 0x8700, 0xfeca, 0x2000 }, - { 0x0700, 0xfec9, 0x0000 }, - { 0x0700, 0xfecb, 0x0000 }, - { 0x8700, 0xfedc, 0x5000 }, - { 0x8700, 0xfed4, 0x4000 }, - { 0x8700, 0xfed0, 0x3000 }, - { 0x8700, 0xfece, 0x2000 }, - { 0x0700, 0xfecd, 0x0000 }, - { 0x0700, 0xfecf, 0x0000 }, - { 0x8700, 0xfed2, 0x2000 }, - { 0x0700, 0xfed1, 0x0000 }, - { 0x0700, 0xfed3, 0x0000 }, - { 0x8700, 0xfed8, 0x3000 }, - { 0x8700, 0xfed6, 0x2000 }, - { 0x0700, 0xfed5, 0x0000 }, - { 0x0700, 0xfed7, 0x0000 }, - { 0x8700, 0xfeda, 0x2000 }, - { 0x0700, 0xfed9, 0x0000 }, - { 0x0700, 0xfedb, 0x0000 }, - { 0x8700, 0xfee4, 0x4000 }, - { 0x8700, 0xfee0, 0x3000 }, - { 0x8700, 0xfede, 0x2000 }, - { 0x0700, 0xfedd, 0x0000 }, - { 0x0700, 0xfedf, 0x0000 }, - { 0x8700, 0xfee2, 0x2000 }, - { 0x0700, 0xfee1, 0x0000 }, - { 0x0700, 0xfee3, 0x0000 }, - { 0x8700, 0xfee8, 0x3000 }, - { 0x8700, 0xfee6, 0x2000 }, - { 0x0700, 0xfee5, 0x0000 }, - { 0x0700, 0xfee7, 0x0000 }, - { 0x8700, 0xfeea, 0x2000 }, - { 0x0700, 0xfee9, 0x0000 }, - { 0x0700, 0xfeeb, 0x0000 }, - { 0x9500, 0xff0f, 0x6000 }, - { 0x8700, 0xfefc, 0x5000 }, - { 0x8700, 0xfef4, 0x4000 }, - { 0x8700, 0xfef0, 0x3000 }, - { 0x8700, 0xfeee, 0x2000 }, - { 0x0700, 0xfeed, 0x0000 }, - { 0x0700, 0xfeef, 0x0000 }, - { 0x8700, 0xfef2, 0x2000 }, - { 0x0700, 0xfef1, 0x0000 }, - { 0x0700, 0xfef3, 0x0000 }, - { 0x8700, 0xfef8, 0x3000 }, - { 0x8700, 0xfef6, 0x2000 }, - { 0x0700, 0xfef5, 0x0000 }, - { 0x0700, 0xfef7, 0x0000 }, - { 0x8700, 0xfefa, 0x2000 }, - { 0x0700, 0xfef9, 0x0000 }, - { 0x0700, 0xfefb, 0x0000 }, - { 0x9500, 0xff07, 0x4000 }, - { 0x9500, 0xff03, 0x3000 }, - { 0x9500, 0xff01, 0x2000 }, - { 0x0100, 0xfeff, 0x0000 }, - { 0x1500, 0xff02, 0x0000 }, - { 0x9500, 0xff05, 0x2000 }, - { 0x1700, 0xff04, 0x0000 }, - { 0x1500, 0xff06, 0x0000 }, - { 0x9900, 0xff0b, 0x3000 }, - { 0x9200, 0xff09, 0x2000 }, - { 0x1600, 0xff08, 0x0000 }, - { 0x1500, 0xff0a, 0x0000 }, - { 0x9100, 0xff0d, 0x2000 }, - { 0x1500, 0xff0c, 0x0000 }, - { 0x1500, 0xff0e, 0x0000 }, - { 0x9500, 0xff1f, 0x5000 }, - { 0x8d00, 0xff17, 0x4000 }, - { 0x8d00, 0xff13, 0x3000 }, - { 0x8d00, 0xff11, 0x2000 }, - { 0x0d00, 0xff10, 0x0000 }, - { 0x0d00, 0xff12, 0x0000 }, - { 0x8d00, 0xff15, 0x2000 }, - { 0x0d00, 0xff14, 0x0000 }, - { 0x0d00, 0xff16, 0x0000 }, - { 0x9500, 0xff1b, 0x3000 }, - { 0x8d00, 0xff19, 0x2000 }, - { 0x0d00, 0xff18, 0x0000 }, - { 0x1500, 0xff1a, 0x0000 }, - { 0x9900, 0xff1d, 0x2000 }, - { 0x1900, 0xff1c, 0x0000 }, - { 0x1900, 0xff1e, 0x0000 }, - { 0x8900, 0xff27, 0x4020 }, - { 0x8900, 0xff23, 0x3020 }, - { 0x8900, 0xff21, 0x2020 }, - { 0x1500, 0xff20, 0x0000 }, - { 0x0900, 0xff22, 0x0020 }, - { 0x8900, 0xff25, 0x2020 }, - { 0x0900, 0xff24, 0x0020 }, - { 0x0900, 0xff26, 0x0020 }, - { 0x8900, 0xff2b, 0x3020 }, - { 0x8900, 0xff29, 0x2020 }, - { 0x0900, 0xff28, 0x0020 }, - { 0x0900, 0xff2a, 0x0020 }, - { 0x8900, 0xff2d, 0x2020 }, - { 0x0900, 0xff2c, 0x0020 }, - { 0x0900, 0xff2e, 0x0020 }, - { 0x8700, 0xff6f, 0x7000 }, - { 0x8500, 0xff4f, 0x6fe0 }, - { 0x9000, 0xff3f, 0x5000 }, - { 0x8900, 0xff37, 0x4020 }, - { 0x8900, 0xff33, 0x3020 }, - { 0x8900, 0xff31, 0x2020 }, - { 0x0900, 0xff30, 0x0020 }, - { 0x0900, 0xff32, 0x0020 }, - { 0x8900, 0xff35, 0x2020 }, - { 0x0900, 0xff34, 0x0020 }, - { 0x0900, 0xff36, 0x0020 }, - { 0x9600, 0xff3b, 0x3000 }, - { 0x8900, 0xff39, 0x2020 }, - { 0x0900, 0xff38, 0x0020 }, - { 0x0900, 0xff3a, 0x0020 }, - { 0x9200, 0xff3d, 0x2000 }, - { 0x1500, 0xff3c, 0x0000 }, - { 0x1800, 0xff3e, 0x0000 }, - { 0x8500, 0xff47, 0x4fe0 }, - { 0x8500, 0xff43, 0x3fe0 }, - { 0x8500, 0xff41, 0x2fe0 }, - { 0x1800, 0xff40, 0x0000 }, - { 0x0500, 0xff42, 0x0fe0 }, - { 0x8500, 0xff45, 0x2fe0 }, - { 0x0500, 0xff44, 0x0fe0 }, - { 0x0500, 0xff46, 0x0fe0 }, - { 0x8500, 0xff4b, 0x3fe0 }, - { 0x8500, 0xff49, 0x2fe0 }, - { 0x0500, 0xff48, 0x0fe0 }, - { 0x0500, 0xff4a, 0x0fe0 }, - { 0x8500, 0xff4d, 0x2fe0 }, - { 0x0500, 0xff4c, 0x0fe0 }, - { 0x0500, 0xff4e, 0x0fe0 }, - { 0x9600, 0xff5f, 0x5000 }, - { 0x8500, 0xff57, 0x4fe0 }, - { 0x8500, 0xff53, 0x3fe0 }, - { 0x8500, 0xff51, 0x2fe0 }, - { 0x0500, 0xff50, 0x0fe0 }, - { 0x0500, 0xff52, 0x0fe0 }, - { 0x8500, 0xff55, 0x2fe0 }, - { 0x0500, 0xff54, 0x0fe0 }, - { 0x0500, 0xff56, 0x0fe0 }, - { 0x9600, 0xff5b, 0x3000 }, - { 0x8500, 0xff59, 0x2fe0 }, - { 0x0500, 0xff58, 0x0fe0 }, - { 0x0500, 0xff5a, 0x0fe0 }, - { 0x9200, 0xff5d, 0x2000 }, - { 0x1900, 0xff5c, 0x0000 }, - { 0x1900, 0xff5e, 0x0000 }, - { 0x8700, 0xff67, 0x4000 }, - { 0x9200, 0xff63, 0x3000 }, - { 0x9500, 0xff61, 0x2000 }, - { 0x1200, 0xff60, 0x0000 }, - { 0x1600, 0xff62, 0x0000 }, - { 0x9000, 0xff65, 0x2000 }, - { 0x1500, 0xff64, 0x0000 }, - { 0x0700, 0xff66, 0x0000 }, - { 0x8700, 0xff6b, 0x3000 }, - { 0x8700, 0xff69, 0x2000 }, - { 0x0700, 0xff68, 0x0000 }, - { 0x0700, 0xff6a, 0x0000 }, - { 0x8700, 0xff6d, 0x2000 }, - { 0x0700, 0xff6c, 0x0000 }, - { 0x0700, 0xff6e, 0x0000 }, - { 0x8700, 0xff8f, 0x6000 }, - { 0x8700, 0xff7f, 0x5000 }, - { 0x8700, 0xff77, 0x4000 }, - { 0x8700, 0xff73, 0x3000 }, - { 0x8700, 0xff71, 0x2000 }, - { 0x0600, 0xff70, 0x0000 }, - { 0x0700, 0xff72, 0x0000 }, - { 0x8700, 0xff75, 0x2000 }, - { 0x0700, 0xff74, 0x0000 }, - { 0x0700, 0xff76, 0x0000 }, - { 0x8700, 0xff7b, 0x3000 }, - { 0x8700, 0xff79, 0x2000 }, - { 0x0700, 0xff78, 0x0000 }, - { 0x0700, 0xff7a, 0x0000 }, - { 0x8700, 0xff7d, 0x2000 }, - { 0x0700, 0xff7c, 0x0000 }, - { 0x0700, 0xff7e, 0x0000 }, - { 0x8700, 0xff87, 0x4000 }, - { 0x8700, 0xff83, 0x3000 }, - { 0x8700, 0xff81, 0x2000 }, - { 0x0700, 0xff80, 0x0000 }, - { 0x0700, 0xff82, 0x0000 }, - { 0x8700, 0xff85, 0x2000 }, - { 0x0700, 0xff84, 0x0000 }, - { 0x0700, 0xff86, 0x0000 }, - { 0x8700, 0xff8b, 0x3000 }, - { 0x8700, 0xff89, 0x2000 }, - { 0x0700, 0xff88, 0x0000 }, - { 0x0700, 0xff8a, 0x0000 }, - { 0x8700, 0xff8d, 0x2000 }, - { 0x0700, 0xff8c, 0x0000 }, - { 0x0700, 0xff8e, 0x0000 }, - { 0x8600, 0xff9f, 0x5000 }, - { 0x8700, 0xff97, 0x4000 }, - { 0x8700, 0xff93, 0x3000 }, - { 0x8700, 0xff91, 0x2000 }, - { 0x0700, 0xff90, 0x0000 }, - { 0x0700, 0xff92, 0x0000 }, - { 0x8700, 0xff95, 0x2000 }, - { 0x0700, 0xff94, 0x0000 }, - { 0x0700, 0xff96, 0x0000 }, - { 0x8700, 0xff9b, 0x3000 }, - { 0x8700, 0xff99, 0x2000 }, - { 0x0700, 0xff98, 0x0000 }, - { 0x0700, 0xff9a, 0x0000 }, - { 0x8700, 0xff9d, 0x2000 }, - { 0x0700, 0xff9c, 0x0000 }, - { 0x0600, 0xff9e, 0x0000 }, - { 0x8700, 0xffa7, 0x4000 }, - { 0x8700, 0xffa3, 0x3000 }, - { 0x8700, 0xffa1, 0x2000 }, - { 0x0700, 0xffa0, 0x0000 }, - { 0x0700, 0xffa2, 0x0000 }, - { 0x8700, 0xffa5, 0x2000 }, - { 0x0700, 0xffa4, 0x0000 }, - { 0x0700, 0xffa6, 0x0000 }, - { 0x8700, 0xffab, 0x3000 }, - { 0x8700, 0xffa9, 0x2000 }, - { 0x0700, 0xffa8, 0x0000 }, - { 0x0700, 0xffaa, 0x0000 }, - { 0x8700, 0xffad, 0x2000 }, - { 0x0700, 0xffac, 0x0000 }, - { 0x0700, 0xffae, 0x0000 }, - { 0x8701, 0x004c, 0x8000 }, - { 0x8701, 0x0008, 0x7000 }, - { 0x8700, 0xffd6, 0x6000 }, - { 0x8700, 0xffc2, 0x5000 }, - { 0x8700, 0xffb7, 0x4000 }, - { 0x8700, 0xffb3, 0x3000 }, - { 0x8700, 0xffb1, 0x2000 }, - { 0x0700, 0xffb0, 0x0000 }, - { 0x0700, 0xffb2, 0x0000 }, - { 0x8700, 0xffb5, 0x2000 }, - { 0x0700, 0xffb4, 0x0000 }, - { 0x0700, 0xffb6, 0x0000 }, - { 0x8700, 0xffbb, 0x3000 }, - { 0x8700, 0xffb9, 0x2000 }, - { 0x0700, 0xffb8, 0x0000 }, - { 0x0700, 0xffba, 0x0000 }, - { 0x8700, 0xffbd, 0x2000 }, - { 0x0700, 0xffbc, 0x0000 }, - { 0x0700, 0xffbe, 0x0000 }, - { 0x8700, 0xffcc, 0x4000 }, - { 0x8700, 0xffc6, 0x3000 }, - { 0x8700, 0xffc4, 0x2000 }, - { 0x0700, 0xffc3, 0x0000 }, - { 0x0700, 0xffc5, 0x0000 }, - { 0x8700, 0xffca, 0x2000 }, - { 0x0700, 0xffc7, 0x0000 }, - { 0x0700, 0xffcb, 0x0000 }, - { 0x8700, 0xffd2, 0x3000 }, - { 0x8700, 0xffce, 0x2000 }, - { 0x0700, 0xffcd, 0x0000 }, - { 0x0700, 0xffcf, 0x0000 }, - { 0x8700, 0xffd4, 0x2000 }, - { 0x0700, 0xffd3, 0x0000 }, - { 0x0700, 0xffd5, 0x0000 }, - { 0x9900, 0xffec, 0x5000 }, - { 0x9800, 0xffe3, 0x4000 }, - { 0x8700, 0xffdc, 0x3000 }, - { 0x8700, 0xffda, 0x2000 }, - { 0x0700, 0xffd7, 0x0000 }, - { 0x0700, 0xffdb, 0x0000 }, - { 0x9700, 0xffe1, 0x2000 }, - { 0x1700, 0xffe0, 0x0000 }, - { 0x1900, 0xffe2, 0x0000 }, - { 0x9a00, 0xffe8, 0x3000 }, - { 0x9700, 0xffe5, 0x2000 }, - { 0x1a00, 0xffe4, 0x0000 }, - { 0x1700, 0xffe6, 0x0000 }, - { 0x9900, 0xffea, 0x2000 }, - { 0x1900, 0xffe9, 0x0000 }, - { 0x1900, 0xffeb, 0x0000 }, - { 0x8701, 0x0000, 0x4000 }, - { 0x8100, 0xfffa, 0x3000 }, - { 0x9a00, 0xffee, 0x2000 }, - { 0x1a00, 0xffed, 0x0000 }, - { 0x0100, 0xfff9, 0x0000 }, - { 0x9a00, 0xfffc, 0x2000 }, - { 0x0100, 0xfffb, 0x0000 }, - { 0x1a00, 0xfffd, 0x0000 }, - { 0x8701, 0x0004, 0x3000 }, - { 0x8701, 0x0002, 0x2000 }, - { 0x0701, 0x0001, 0x0000 }, - { 0x0701, 0x0003, 0x0000 }, - { 0x8701, 0x0006, 0x2000 }, - { 0x0701, 0x0005, 0x0000 }, - { 0x0701, 0x0007, 0x0000 }, - { 0x8701, 0x002a, 0x6000 }, - { 0x8701, 0x0019, 0x5000 }, - { 0x8701, 0x0011, 0x4000 }, - { 0x8701, 0x000d, 0x3000 }, - { 0x8701, 0x000a, 0x2000 }, - { 0x0701, 0x0009, 0x0000 }, - { 0x0701, 0x000b, 0x0000 }, - { 0x8701, 0x000f, 0x2000 }, - { 0x0701, 0x000e, 0x0000 }, - { 0x0701, 0x0010, 0x0000 }, - { 0x8701, 0x0015, 0x3000 }, - { 0x8701, 0x0013, 0x2000 }, - { 0x0701, 0x0012, 0x0000 }, - { 0x0701, 0x0014, 0x0000 }, - { 0x8701, 0x0017, 0x2000 }, - { 0x0701, 0x0016, 0x0000 }, - { 0x0701, 0x0018, 0x0000 }, - { 0x8701, 0x0021, 0x4000 }, - { 0x8701, 0x001d, 0x3000 }, - { 0x8701, 0x001b, 0x2000 }, - { 0x0701, 0x001a, 0x0000 }, - { 0x0701, 0x001c, 0x0000 }, - { 0x8701, 0x001f, 0x2000 }, - { 0x0701, 0x001e, 0x0000 }, - { 0x0701, 0x0020, 0x0000 }, - { 0x8701, 0x0025, 0x3000 }, - { 0x8701, 0x0023, 0x2000 }, - { 0x0701, 0x0022, 0x0000 }, - { 0x0701, 0x0024, 0x0000 }, - { 0x8701, 0x0028, 0x2000 }, - { 0x0701, 0x0026, 0x0000 }, - { 0x0701, 0x0029, 0x0000 }, - { 0x8701, 0x003a, 0x5000 }, - { 0x8701, 0x0032, 0x4000 }, - { 0x8701, 0x002e, 0x3000 }, - { 0x8701, 0x002c, 0x2000 }, - { 0x0701, 0x002b, 0x0000 }, - { 0x0701, 0x002d, 0x0000 }, - { 0x8701, 0x0030, 0x2000 }, - { 0x0701, 0x002f, 0x0000 }, - { 0x0701, 0x0031, 0x0000 }, - { 0x8701, 0x0036, 0x3000 }, - { 0x8701, 0x0034, 0x2000 }, - { 0x0701, 0x0033, 0x0000 }, - { 0x0701, 0x0035, 0x0000 }, - { 0x8701, 0x0038, 0x2000 }, - { 0x0701, 0x0037, 0x0000 }, - { 0x0701, 0x0039, 0x0000 }, - { 0x8701, 0x0044, 0x4000 }, - { 0x8701, 0x0040, 0x3000 }, - { 0x8701, 0x003d, 0x2000 }, - { 0x0701, 0x003c, 0x0000 }, - { 0x0701, 0x003f, 0x0000 }, - { 0x8701, 0x0042, 0x2000 }, - { 0x0701, 0x0041, 0x0000 }, - { 0x0701, 0x0043, 0x0000 }, - { 0x8701, 0x0048, 0x3000 }, - { 0x8701, 0x0046, 0x2000 }, - { 0x0701, 0x0045, 0x0000 }, - { 0x0701, 0x0047, 0x0000 }, - { 0x8701, 0x004a, 0x2000 }, - { 0x0701, 0x0049, 0x0000 }, - { 0x0701, 0x004b, 0x0000 }, - { 0x8701, 0x00b0, 0x7000 }, - { 0x8701, 0x0090, 0x6000 }, - { 0x8701, 0x0080, 0x5000 }, - { 0x8701, 0x0056, 0x4000 }, - { 0x8701, 0x0052, 0x3000 }, - { 0x8701, 0x0050, 0x2000 }, - { 0x0701, 0x004d, 0x0000 }, - { 0x0701, 0x0051, 0x0000 }, - { 0x8701, 0x0054, 0x2000 }, - { 0x0701, 0x0053, 0x0000 }, - { 0x0701, 0x0055, 0x0000 }, - { 0x8701, 0x005a, 0x3000 }, - { 0x8701, 0x0058, 0x2000 }, - { 0x0701, 0x0057, 0x0000 }, - { 0x0701, 0x0059, 0x0000 }, - { 0x8701, 0x005c, 0x2000 }, - { 0x0701, 0x005b, 0x0000 }, - { 0x0701, 0x005d, 0x0000 }, - { 0x8701, 0x0088, 0x4000 }, - { 0x8701, 0x0084, 0x3000 }, - { 0x8701, 0x0082, 0x2000 }, - { 0x0701, 0x0081, 0x0000 }, - { 0x0701, 0x0083, 0x0000 }, - { 0x8701, 0x0086, 0x2000 }, - { 0x0701, 0x0085, 0x0000 }, - { 0x0701, 0x0087, 0x0000 }, - { 0x8701, 0x008c, 0x3000 }, - { 0x8701, 0x008a, 0x2000 }, - { 0x0701, 0x0089, 0x0000 }, - { 0x0701, 0x008b, 0x0000 }, - { 0x8701, 0x008e, 0x2000 }, - { 0x0701, 0x008d, 0x0000 }, - { 0x0701, 0x008f, 0x0000 }, - { 0x8701, 0x00a0, 0x5000 }, - { 0x8701, 0x0098, 0x4000 }, - { 0x8701, 0x0094, 0x3000 }, - { 0x8701, 0x0092, 0x2000 }, - { 0x0701, 0x0091, 0x0000 }, - { 0x0701, 0x0093, 0x0000 }, - { 0x8701, 0x0096, 0x2000 }, - { 0x0701, 0x0095, 0x0000 }, - { 0x0701, 0x0097, 0x0000 }, - { 0x8701, 0x009c, 0x3000 }, - { 0x8701, 0x009a, 0x2000 }, - { 0x0701, 0x0099, 0x0000 }, - { 0x0701, 0x009b, 0x0000 }, - { 0x8701, 0x009e, 0x2000 }, - { 0x0701, 0x009d, 0x0000 }, - { 0x0701, 0x009f, 0x0000 }, - { 0x8701, 0x00a8, 0x4000 }, - { 0x8701, 0x00a4, 0x3000 }, - { 0x8701, 0x00a2, 0x2000 }, - { 0x0701, 0x00a1, 0x0000 }, - { 0x0701, 0x00a3, 0x0000 }, - { 0x8701, 0x00a6, 0x2000 }, - { 0x0701, 0x00a5, 0x0000 }, - { 0x0701, 0x00a7, 0x0000 }, - { 0x8701, 0x00ac, 0x3000 }, - { 0x8701, 0x00aa, 0x2000 }, - { 0x0701, 0x00a9, 0x0000 }, - { 0x0701, 0x00ab, 0x0000 }, - { 0x8701, 0x00ae, 0x2000 }, - { 0x0701, 0x00ad, 0x0000 }, - { 0x0701, 0x00af, 0x0000 }, - { 0x8701, 0x00d0, 0x6000 }, - { 0x8701, 0x00c0, 0x5000 }, - { 0x8701, 0x00b8, 0x4000 }, - { 0x8701, 0x00b4, 0x3000 }, - { 0x8701, 0x00b2, 0x2000 }, - { 0x0701, 0x00b1, 0x0000 }, - { 0x0701, 0x00b3, 0x0000 }, - { 0x8701, 0x00b6, 0x2000 }, - { 0x0701, 0x00b5, 0x0000 }, - { 0x0701, 0x00b7, 0x0000 }, - { 0x8701, 0x00bc, 0x3000 }, - { 0x8701, 0x00ba, 0x2000 }, - { 0x0701, 0x00b9, 0x0000 }, - { 0x0701, 0x00bb, 0x0000 }, - { 0x8701, 0x00be, 0x2000 }, - { 0x0701, 0x00bd, 0x0000 }, - { 0x0701, 0x00bf, 0x0000 }, - { 0x8701, 0x00c8, 0x4000 }, - { 0x8701, 0x00c4, 0x3000 }, - { 0x8701, 0x00c2, 0x2000 }, - { 0x0701, 0x00c1, 0x0000 }, - { 0x0701, 0x00c3, 0x0000 }, - { 0x8701, 0x00c6, 0x2000 }, - { 0x0701, 0x00c5, 0x0000 }, - { 0x0701, 0x00c7, 0x0000 }, - { 0x8701, 0x00cc, 0x3000 }, - { 0x8701, 0x00ca, 0x2000 }, - { 0x0701, 0x00c9, 0x0000 }, - { 0x0701, 0x00cb, 0x0000 }, - { 0x8701, 0x00ce, 0x2000 }, - { 0x0701, 0x00cd, 0x0000 }, - { 0x0701, 0x00cf, 0x0000 }, - { 0x8701, 0x00e0, 0x5000 }, - { 0x8701, 0x00d8, 0x4000 }, - { 0x8701, 0x00d4, 0x3000 }, - { 0x8701, 0x00d2, 0x2000 }, - { 0x0701, 0x00d1, 0x0000 }, - { 0x0701, 0x00d3, 0x0000 }, - { 0x8701, 0x00d6, 0x2000 }, - { 0x0701, 0x00d5, 0x0000 }, - { 0x0701, 0x00d7, 0x0000 }, - { 0x8701, 0x00dc, 0x3000 }, - { 0x8701, 0x00da, 0x2000 }, - { 0x0701, 0x00d9, 0x0000 }, - { 0x0701, 0x00db, 0x0000 }, - { 0x8701, 0x00de, 0x2000 }, - { 0x0701, 0x00dd, 0x0000 }, - { 0x0701, 0x00df, 0x0000 }, - { 0x8701, 0x00e8, 0x4000 }, - { 0x8701, 0x00e4, 0x3000 }, - { 0x8701, 0x00e2, 0x2000 }, - { 0x0701, 0x00e1, 0x0000 }, - { 0x0701, 0x00e3, 0x0000 }, - { 0x8701, 0x00e6, 0x2000 }, - { 0x0701, 0x00e5, 0x0000 }, - { 0x0701, 0x00e7, 0x0000 }, - { 0x8701, 0x00ec, 0x3000 }, - { 0x8701, 0x00ea, 0x2000 }, - { 0x0701, 0x00e9, 0x0000 }, - { 0x0701, 0x00eb, 0x0000 }, - { 0x8701, 0x00ee, 0x2000 }, - { 0x0701, 0x00ed, 0x0000 }, - { 0x0701, 0x00ef, 0x0000 }, - { 0x8501, 0xd459, 0xb000 }, - { 0x9a01, 0xd080, 0xa000 }, - { 0x8701, 0x045f, 0x9000 }, - { 0x8701, 0x0349, 0x8000 }, - { 0x9a01, 0x013c, 0x7000 }, - { 0x8f01, 0x0119, 0x6000 }, - { 0x8f01, 0x0109, 0x5000 }, - { 0x8701, 0x00f8, 0x4000 }, - { 0x8701, 0x00f4, 0x3000 }, - { 0x8701, 0x00f2, 0x2000 }, - { 0x0701, 0x00f1, 0x0000 }, - { 0x0701, 0x00f3, 0x0000 }, - { 0x8701, 0x00f6, 0x2000 }, - { 0x0701, 0x00f5, 0x0000 }, - { 0x0701, 0x00f7, 0x0000 }, - { 0x9501, 0x0101, 0x3000 }, - { 0x8701, 0x00fa, 0x2000 }, - { 0x0701, 0x00f9, 0x0000 }, - { 0x1501, 0x0100, 0x0000 }, - { 0x8f01, 0x0107, 0x2000 }, - { 0x1a01, 0x0102, 0x0000 }, - { 0x0f01, 0x0108, 0x0000 }, - { 0x8f01, 0x0111, 0x4000 }, - { 0x8f01, 0x010d, 0x3000 }, - { 0x8f01, 0x010b, 0x2000 }, - { 0x0f01, 0x010a, 0x0000 }, - { 0x0f01, 0x010c, 0x0000 }, - { 0x8f01, 0x010f, 0x2000 }, - { 0x0f01, 0x010e, 0x0000 }, - { 0x0f01, 0x0110, 0x0000 }, - { 0x8f01, 0x0115, 0x3000 }, - { 0x8f01, 0x0113, 0x2000 }, - { 0x0f01, 0x0112, 0x0000 }, - { 0x0f01, 0x0114, 0x0000 }, - { 0x8f01, 0x0117, 0x2000 }, - { 0x0f01, 0x0116, 0x0000 }, - { 0x0f01, 0x0118, 0x0000 }, - { 0x8f01, 0x0129, 0x5000 }, - { 0x8f01, 0x0121, 0x4000 }, - { 0x8f01, 0x011d, 0x3000 }, - { 0x8f01, 0x011b, 0x2000 }, - { 0x0f01, 0x011a, 0x0000 }, - { 0x0f01, 0x011c, 0x0000 }, - { 0x8f01, 0x011f, 0x2000 }, - { 0x0f01, 0x011e, 0x0000 }, - { 0x0f01, 0x0120, 0x0000 }, - { 0x8f01, 0x0125, 0x3000 }, - { 0x8f01, 0x0123, 0x2000 }, - { 0x0f01, 0x0122, 0x0000 }, - { 0x0f01, 0x0124, 0x0000 }, - { 0x8f01, 0x0127, 0x2000 }, - { 0x0f01, 0x0126, 0x0000 }, - { 0x0f01, 0x0128, 0x0000 }, - { 0x8f01, 0x0131, 0x4000 }, - { 0x8f01, 0x012d, 0x3000 }, - { 0x8f01, 0x012b, 0x2000 }, - { 0x0f01, 0x012a, 0x0000 }, - { 0x0f01, 0x012c, 0x0000 }, - { 0x8f01, 0x012f, 0x2000 }, - { 0x0f01, 0x012e, 0x0000 }, - { 0x0f01, 0x0130, 0x0000 }, - { 0x9a01, 0x0138, 0x3000 }, - { 0x8f01, 0x0133, 0x2000 }, - { 0x0f01, 0x0132, 0x0000 }, - { 0x1a01, 0x0137, 0x0000 }, - { 0x9a01, 0x013a, 0x2000 }, - { 0x1a01, 0x0139, 0x0000 }, - { 0x1a01, 0x013b, 0x0000 }, - { 0x8701, 0x031c, 0x6000 }, - { 0x8701, 0x030c, 0x5000 }, - { 0x8701, 0x0304, 0x4000 }, - { 0x8701, 0x0300, 0x3000 }, - { 0x9a01, 0x013e, 0x2000 }, - { 0x1a01, 0x013d, 0x0000 }, - { 0x1a01, 0x013f, 0x0000 }, - { 0x8701, 0x0302, 0x2000 }, - { 0x0701, 0x0301, 0x0000 }, - { 0x0701, 0x0303, 0x0000 }, - { 0x8701, 0x0308, 0x3000 }, - { 0x8701, 0x0306, 0x2000 }, - { 0x0701, 0x0305, 0x0000 }, - { 0x0701, 0x0307, 0x0000 }, - { 0x8701, 0x030a, 0x2000 }, - { 0x0701, 0x0309, 0x0000 }, - { 0x0701, 0x030b, 0x0000 }, - { 0x8701, 0x0314, 0x4000 }, - { 0x8701, 0x0310, 0x3000 }, - { 0x8701, 0x030e, 0x2000 }, - { 0x0701, 0x030d, 0x0000 }, - { 0x0701, 0x030f, 0x0000 }, - { 0x8701, 0x0312, 0x2000 }, - { 0x0701, 0x0311, 0x0000 }, - { 0x0701, 0x0313, 0x0000 }, - { 0x8701, 0x0318, 0x3000 }, - { 0x8701, 0x0316, 0x2000 }, - { 0x0701, 0x0315, 0x0000 }, - { 0x0701, 0x0317, 0x0000 }, - { 0x8701, 0x031a, 0x2000 }, - { 0x0701, 0x0319, 0x0000 }, - { 0x0701, 0x031b, 0x0000 }, - { 0x8701, 0x0339, 0x5000 }, - { 0x8701, 0x0331, 0x4000 }, - { 0x8f01, 0x0321, 0x3000 }, - { 0x8701, 0x031e, 0x2000 }, - { 0x0701, 0x031d, 0x0000 }, - { 0x0f01, 0x0320, 0x0000 }, - { 0x8f01, 0x0323, 0x2000 }, - { 0x0f01, 0x0322, 0x0000 }, - { 0x0701, 0x0330, 0x0000 }, - { 0x8701, 0x0335, 0x3000 }, - { 0x8701, 0x0333, 0x2000 }, - { 0x0701, 0x0332, 0x0000 }, - { 0x0701, 0x0334, 0x0000 }, - { 0x8701, 0x0337, 0x2000 }, - { 0x0701, 0x0336, 0x0000 }, - { 0x0701, 0x0338, 0x0000 }, - { 0x8701, 0x0341, 0x4000 }, - { 0x8701, 0x033d, 0x3000 }, - { 0x8701, 0x033b, 0x2000 }, - { 0x0701, 0x033a, 0x0000 }, - { 0x0701, 0x033c, 0x0000 }, - { 0x8701, 0x033f, 0x2000 }, - { 0x0701, 0x033e, 0x0000 }, - { 0x0701, 0x0340, 0x0000 }, - { 0x8701, 0x0345, 0x3000 }, - { 0x8701, 0x0343, 0x2000 }, - { 0x0701, 0x0342, 0x0000 }, - { 0x0701, 0x0344, 0x0000 }, - { 0x8701, 0x0347, 0x2000 }, - { 0x0701, 0x0346, 0x0000 }, - { 0x0701, 0x0348, 0x0000 }, - { 0x8901, 0x041f, 0x7028 }, - { 0x9501, 0x039f, 0x6000 }, - { 0x8701, 0x038e, 0x5000 }, - { 0x8701, 0x0386, 0x4000 }, - { 0x8701, 0x0382, 0x3000 }, - { 0x8701, 0x0380, 0x2000 }, - { 0x0e01, 0x034a, 0x0000 }, - { 0x0701, 0x0381, 0x0000 }, - { 0x8701, 0x0384, 0x2000 }, - { 0x0701, 0x0383, 0x0000 }, - { 0x0701, 0x0385, 0x0000 }, - { 0x8701, 0x038a, 0x3000 }, - { 0x8701, 0x0388, 0x2000 }, - { 0x0701, 0x0387, 0x0000 }, - { 0x0701, 0x0389, 0x0000 }, - { 0x8701, 0x038c, 0x2000 }, - { 0x0701, 0x038b, 0x0000 }, - { 0x0701, 0x038d, 0x0000 }, - { 0x8701, 0x0396, 0x4000 }, - { 0x8701, 0x0392, 0x3000 }, - { 0x8701, 0x0390, 0x2000 }, - { 0x0701, 0x038f, 0x0000 }, - { 0x0701, 0x0391, 0x0000 }, - { 0x8701, 0x0394, 0x2000 }, - { 0x0701, 0x0393, 0x0000 }, - { 0x0701, 0x0395, 0x0000 }, - { 0x8701, 0x039a, 0x3000 }, - { 0x8701, 0x0398, 0x2000 }, - { 0x0701, 0x0397, 0x0000 }, - { 0x0701, 0x0399, 0x0000 }, - { 0x8701, 0x039c, 0x2000 }, - { 0x0701, 0x039b, 0x0000 }, - { 0x0701, 0x039d, 0x0000 }, - { 0x8901, 0x040f, 0x5028 }, - { 0x8901, 0x0407, 0x4028 }, - { 0x8901, 0x0403, 0x3028 }, - { 0x8901, 0x0401, 0x2028 }, - { 0x0901, 0x0400, 0x0028 }, - { 0x0901, 0x0402, 0x0028 }, - { 0x8901, 0x0405, 0x2028 }, - { 0x0901, 0x0404, 0x0028 }, - { 0x0901, 0x0406, 0x0028 }, - { 0x8901, 0x040b, 0x3028 }, - { 0x8901, 0x0409, 0x2028 }, - { 0x0901, 0x0408, 0x0028 }, - { 0x0901, 0x040a, 0x0028 }, - { 0x8901, 0x040d, 0x2028 }, - { 0x0901, 0x040c, 0x0028 }, - { 0x0901, 0x040e, 0x0028 }, - { 0x8901, 0x0417, 0x4028 }, - { 0x8901, 0x0413, 0x3028 }, - { 0x8901, 0x0411, 0x2028 }, - { 0x0901, 0x0410, 0x0028 }, - { 0x0901, 0x0412, 0x0028 }, - { 0x8901, 0x0415, 0x2028 }, - { 0x0901, 0x0414, 0x0028 }, - { 0x0901, 0x0416, 0x0028 }, - { 0x8901, 0x041b, 0x3028 }, - { 0x8901, 0x0419, 0x2028 }, - { 0x0901, 0x0418, 0x0028 }, - { 0x0901, 0x041a, 0x0028 }, - { 0x8901, 0x041d, 0x2028 }, - { 0x0901, 0x041c, 0x0028 }, - { 0x0901, 0x041e, 0x0028 }, - { 0x8501, 0x043f, 0x6fd8 }, - { 0x8501, 0x042f, 0x5fd8 }, - { 0x8901, 0x0427, 0x4028 }, - { 0x8901, 0x0423, 0x3028 }, - { 0x8901, 0x0421, 0x2028 }, - { 0x0901, 0x0420, 0x0028 }, - { 0x0901, 0x0422, 0x0028 }, - { 0x8901, 0x0425, 0x2028 }, - { 0x0901, 0x0424, 0x0028 }, - { 0x0901, 0x0426, 0x0028 }, - { 0x8501, 0x042b, 0x3fd8 }, - { 0x8501, 0x0429, 0x2fd8 }, - { 0x0501, 0x0428, 0x0fd8 }, - { 0x0501, 0x042a, 0x0fd8 }, - { 0x8501, 0x042d, 0x2fd8 }, - { 0x0501, 0x042c, 0x0fd8 }, - { 0x0501, 0x042e, 0x0fd8 }, - { 0x8501, 0x0437, 0x4fd8 }, - { 0x8501, 0x0433, 0x3fd8 }, - { 0x8501, 0x0431, 0x2fd8 }, - { 0x0501, 0x0430, 0x0fd8 }, - { 0x0501, 0x0432, 0x0fd8 }, - { 0x8501, 0x0435, 0x2fd8 }, - { 0x0501, 0x0434, 0x0fd8 }, - { 0x0501, 0x0436, 0x0fd8 }, - { 0x8501, 0x043b, 0x3fd8 }, - { 0x8501, 0x0439, 0x2fd8 }, - { 0x0501, 0x0438, 0x0fd8 }, - { 0x0501, 0x043a, 0x0fd8 }, - { 0x8501, 0x043d, 0x2fd8 }, - { 0x0501, 0x043c, 0x0fd8 }, - { 0x0501, 0x043e, 0x0fd8 }, - { 0x8501, 0x044f, 0x5fd8 }, - { 0x8501, 0x0447, 0x4fd8 }, - { 0x8501, 0x0443, 0x3fd8 }, - { 0x8501, 0x0441, 0x2fd8 }, - { 0x0501, 0x0440, 0x0fd8 }, - { 0x0501, 0x0442, 0x0fd8 }, - { 0x8501, 0x0445, 0x2fd8 }, - { 0x0501, 0x0444, 0x0fd8 }, - { 0x0501, 0x0446, 0x0fd8 }, - { 0x8501, 0x044b, 0x3fd8 }, - { 0x8501, 0x0449, 0x2fd8 }, - { 0x0501, 0x0448, 0x0fd8 }, - { 0x0501, 0x044a, 0x0fd8 }, - { 0x8501, 0x044d, 0x2fd8 }, - { 0x0501, 0x044c, 0x0fd8 }, - { 0x0501, 0x044e, 0x0fd8 }, - { 0x8701, 0x0457, 0x4000 }, - { 0x8701, 0x0453, 0x3000 }, - { 0x8701, 0x0451, 0x2000 }, - { 0x0701, 0x0450, 0x0000 }, - { 0x0701, 0x0452, 0x0000 }, - { 0x8701, 0x0455, 0x2000 }, - { 0x0701, 0x0454, 0x0000 }, - { 0x0701, 0x0456, 0x0000 }, - { 0x8701, 0x045b, 0x3000 }, - { 0x8701, 0x0459, 0x2000 }, - { 0x0701, 0x0458, 0x0000 }, - { 0x0701, 0x045a, 0x0000 }, - { 0x8701, 0x045d, 0x2000 }, - { 0x0701, 0x045c, 0x0000 }, - { 0x0701, 0x045e, 0x0000 }, - { 0x9a01, 0xd000, 0x8000 }, - { 0x8d01, 0x04a1, 0x7000 }, - { 0x8701, 0x047f, 0x6000 }, - { 0x8701, 0x046f, 0x5000 }, - { 0x8701, 0x0467, 0x4000 }, - { 0x8701, 0x0463, 0x3000 }, - { 0x8701, 0x0461, 0x2000 }, - { 0x0701, 0x0460, 0x0000 }, - { 0x0701, 0x0462, 0x0000 }, - { 0x8701, 0x0465, 0x2000 }, - { 0x0701, 0x0464, 0x0000 }, - { 0x0701, 0x0466, 0x0000 }, - { 0x8701, 0x046b, 0x3000 }, - { 0x8701, 0x0469, 0x2000 }, - { 0x0701, 0x0468, 0x0000 }, - { 0x0701, 0x046a, 0x0000 }, - { 0x8701, 0x046d, 0x2000 }, - { 0x0701, 0x046c, 0x0000 }, - { 0x0701, 0x046e, 0x0000 }, - { 0x8701, 0x0477, 0x4000 }, - { 0x8701, 0x0473, 0x3000 }, - { 0x8701, 0x0471, 0x2000 }, - { 0x0701, 0x0470, 0x0000 }, - { 0x0701, 0x0472, 0x0000 }, - { 0x8701, 0x0475, 0x2000 }, - { 0x0701, 0x0474, 0x0000 }, - { 0x0701, 0x0476, 0x0000 }, - { 0x8701, 0x047b, 0x3000 }, - { 0x8701, 0x0479, 0x2000 }, - { 0x0701, 0x0478, 0x0000 }, - { 0x0701, 0x047a, 0x0000 }, - { 0x8701, 0x047d, 0x2000 }, - { 0x0701, 0x047c, 0x0000 }, - { 0x0701, 0x047e, 0x0000 }, - { 0x8701, 0x048f, 0x5000 }, - { 0x8701, 0x0487, 0x4000 }, - { 0x8701, 0x0483, 0x3000 }, - { 0x8701, 0x0481, 0x2000 }, - { 0x0701, 0x0480, 0x0000 }, - { 0x0701, 0x0482, 0x0000 }, - { 0x8701, 0x0485, 0x2000 }, - { 0x0701, 0x0484, 0x0000 }, - { 0x0701, 0x0486, 0x0000 }, - { 0x8701, 0x048b, 0x3000 }, - { 0x8701, 0x0489, 0x2000 }, - { 0x0701, 0x0488, 0x0000 }, - { 0x0701, 0x048a, 0x0000 }, - { 0x8701, 0x048d, 0x2000 }, - { 0x0701, 0x048c, 0x0000 }, - { 0x0701, 0x048e, 0x0000 }, - { 0x8701, 0x0497, 0x4000 }, - { 0x8701, 0x0493, 0x3000 }, - { 0x8701, 0x0491, 0x2000 }, - { 0x0701, 0x0490, 0x0000 }, - { 0x0701, 0x0492, 0x0000 }, - { 0x8701, 0x0495, 0x2000 }, - { 0x0701, 0x0494, 0x0000 }, - { 0x0701, 0x0496, 0x0000 }, - { 0x8701, 0x049b, 0x3000 }, - { 0x8701, 0x0499, 0x2000 }, - { 0x0701, 0x0498, 0x0000 }, - { 0x0701, 0x049a, 0x0000 }, - { 0x8701, 0x049d, 0x2000 }, - { 0x0701, 0x049c, 0x0000 }, - { 0x0d01, 0x04a0, 0x0000 }, - { 0x8701, 0x081a, 0x6000 }, - { 0x8701, 0x080a, 0x5000 }, - { 0x8d01, 0x04a9, 0x4000 }, - { 0x8d01, 0x04a5, 0x3000 }, - { 0x8d01, 0x04a3, 0x2000 }, - { 0x0d01, 0x04a2, 0x0000 }, - { 0x0d01, 0x04a4, 0x0000 }, - { 0x8d01, 0x04a7, 0x2000 }, - { 0x0d01, 0x04a6, 0x0000 }, - { 0x0d01, 0x04a8, 0x0000 }, - { 0x8701, 0x0803, 0x3000 }, - { 0x8701, 0x0801, 0x2000 }, - { 0x0701, 0x0800, 0x0000 }, - { 0x0701, 0x0802, 0x0000 }, - { 0x8701, 0x0805, 0x2000 }, - { 0x0701, 0x0804, 0x0000 }, - { 0x0701, 0x0808, 0x0000 }, - { 0x8701, 0x0812, 0x4000 }, - { 0x8701, 0x080e, 0x3000 }, - { 0x8701, 0x080c, 0x2000 }, - { 0x0701, 0x080b, 0x0000 }, - { 0x0701, 0x080d, 0x0000 }, - { 0x8701, 0x0810, 0x2000 }, - { 0x0701, 0x080f, 0x0000 }, - { 0x0701, 0x0811, 0x0000 }, - { 0x8701, 0x0816, 0x3000 }, - { 0x8701, 0x0814, 0x2000 }, - { 0x0701, 0x0813, 0x0000 }, - { 0x0701, 0x0815, 0x0000 }, - { 0x8701, 0x0818, 0x2000 }, - { 0x0701, 0x0817, 0x0000 }, - { 0x0701, 0x0819, 0x0000 }, - { 0x8701, 0x082a, 0x5000 }, - { 0x8701, 0x0822, 0x4000 }, - { 0x8701, 0x081e, 0x3000 }, - { 0x8701, 0x081c, 0x2000 }, - { 0x0701, 0x081b, 0x0000 }, - { 0x0701, 0x081d, 0x0000 }, - { 0x8701, 0x0820, 0x2000 }, - { 0x0701, 0x081f, 0x0000 }, - { 0x0701, 0x0821, 0x0000 }, - { 0x8701, 0x0826, 0x3000 }, - { 0x8701, 0x0824, 0x2000 }, - { 0x0701, 0x0823, 0x0000 }, - { 0x0701, 0x0825, 0x0000 }, - { 0x8701, 0x0828, 0x2000 }, - { 0x0701, 0x0827, 0x0000 }, - { 0x0701, 0x0829, 0x0000 }, - { 0x8701, 0x0832, 0x4000 }, - { 0x8701, 0x082e, 0x3000 }, - { 0x8701, 0x082c, 0x2000 }, - { 0x0701, 0x082b, 0x0000 }, - { 0x0701, 0x082d, 0x0000 }, - { 0x8701, 0x0830, 0x2000 }, - { 0x0701, 0x082f, 0x0000 }, - { 0x0701, 0x0831, 0x0000 }, - { 0x8701, 0x0837, 0x3000 }, - { 0x8701, 0x0834, 0x2000 }, - { 0x0701, 0x0833, 0x0000 }, - { 0x0701, 0x0835, 0x0000 }, - { 0x8701, 0x083c, 0x2000 }, - { 0x0701, 0x0838, 0x0000 }, - { 0x0701, 0x083f, 0x0000 }, - { 0x9a01, 0xd040, 0x7000 }, - { 0x9a01, 0xd020, 0x6000 }, - { 0x9a01, 0xd010, 0x5000 }, - { 0x9a01, 0xd008, 0x4000 }, - { 0x9a01, 0xd004, 0x3000 }, - { 0x9a01, 0xd002, 0x2000 }, - { 0x1a01, 0xd001, 0x0000 }, - { 0x1a01, 0xd003, 0x0000 }, - { 0x9a01, 0xd006, 0x2000 }, - { 0x1a01, 0xd005, 0x0000 }, - { 0x1a01, 0xd007, 0x0000 }, - { 0x9a01, 0xd00c, 0x3000 }, - { 0x9a01, 0xd00a, 0x2000 }, - { 0x1a01, 0xd009, 0x0000 }, - { 0x1a01, 0xd00b, 0x0000 }, - { 0x9a01, 0xd00e, 0x2000 }, - { 0x1a01, 0xd00d, 0x0000 }, - { 0x1a01, 0xd00f, 0x0000 }, - { 0x9a01, 0xd018, 0x4000 }, - { 0x9a01, 0xd014, 0x3000 }, - { 0x9a01, 0xd012, 0x2000 }, - { 0x1a01, 0xd011, 0x0000 }, - { 0x1a01, 0xd013, 0x0000 }, - { 0x9a01, 0xd016, 0x2000 }, - { 0x1a01, 0xd015, 0x0000 }, - { 0x1a01, 0xd017, 0x0000 }, - { 0x9a01, 0xd01c, 0x3000 }, - { 0x9a01, 0xd01a, 0x2000 }, - { 0x1a01, 0xd019, 0x0000 }, - { 0x1a01, 0xd01b, 0x0000 }, - { 0x9a01, 0xd01e, 0x2000 }, - { 0x1a01, 0xd01d, 0x0000 }, - { 0x1a01, 0xd01f, 0x0000 }, - { 0x9a01, 0xd030, 0x5000 }, - { 0x9a01, 0xd028, 0x4000 }, - { 0x9a01, 0xd024, 0x3000 }, - { 0x9a01, 0xd022, 0x2000 }, - { 0x1a01, 0xd021, 0x0000 }, - { 0x1a01, 0xd023, 0x0000 }, - { 0x9a01, 0xd026, 0x2000 }, - { 0x1a01, 0xd025, 0x0000 }, - { 0x1a01, 0xd027, 0x0000 }, - { 0x9a01, 0xd02c, 0x3000 }, - { 0x9a01, 0xd02a, 0x2000 }, - { 0x1a01, 0xd029, 0x0000 }, - { 0x1a01, 0xd02b, 0x0000 }, - { 0x9a01, 0xd02e, 0x2000 }, - { 0x1a01, 0xd02d, 0x0000 }, - { 0x1a01, 0xd02f, 0x0000 }, - { 0x9a01, 0xd038, 0x4000 }, - { 0x9a01, 0xd034, 0x3000 }, - { 0x9a01, 0xd032, 0x2000 }, - { 0x1a01, 0xd031, 0x0000 }, - { 0x1a01, 0xd033, 0x0000 }, - { 0x9a01, 0xd036, 0x2000 }, - { 0x1a01, 0xd035, 0x0000 }, - { 0x1a01, 0xd037, 0x0000 }, - { 0x9a01, 0xd03c, 0x3000 }, - { 0x9a01, 0xd03a, 0x2000 }, - { 0x1a01, 0xd039, 0x0000 }, - { 0x1a01, 0xd03b, 0x0000 }, - { 0x9a01, 0xd03e, 0x2000 }, - { 0x1a01, 0xd03d, 0x0000 }, - { 0x1a01, 0xd03f, 0x0000 }, - { 0x9a01, 0xd060, 0x6000 }, - { 0x9a01, 0xd050, 0x5000 }, - { 0x9a01, 0xd048, 0x4000 }, - { 0x9a01, 0xd044, 0x3000 }, - { 0x9a01, 0xd042, 0x2000 }, - { 0x1a01, 0xd041, 0x0000 }, - { 0x1a01, 0xd043, 0x0000 }, - { 0x9a01, 0xd046, 0x2000 }, - { 0x1a01, 0xd045, 0x0000 }, - { 0x1a01, 0xd047, 0x0000 }, - { 0x9a01, 0xd04c, 0x3000 }, - { 0x9a01, 0xd04a, 0x2000 }, - { 0x1a01, 0xd049, 0x0000 }, - { 0x1a01, 0xd04b, 0x0000 }, - { 0x9a01, 0xd04e, 0x2000 }, - { 0x1a01, 0xd04d, 0x0000 }, - { 0x1a01, 0xd04f, 0x0000 }, - { 0x9a01, 0xd058, 0x4000 }, - { 0x9a01, 0xd054, 0x3000 }, - { 0x9a01, 0xd052, 0x2000 }, - { 0x1a01, 0xd051, 0x0000 }, - { 0x1a01, 0xd053, 0x0000 }, - { 0x9a01, 0xd056, 0x2000 }, - { 0x1a01, 0xd055, 0x0000 }, - { 0x1a01, 0xd057, 0x0000 }, - { 0x9a01, 0xd05c, 0x3000 }, - { 0x9a01, 0xd05a, 0x2000 }, - { 0x1a01, 0xd059, 0x0000 }, - { 0x1a01, 0xd05b, 0x0000 }, - { 0x9a01, 0xd05e, 0x2000 }, - { 0x1a01, 0xd05d, 0x0000 }, - { 0x1a01, 0xd05f, 0x0000 }, - { 0x9a01, 0xd070, 0x5000 }, - { 0x9a01, 0xd068, 0x4000 }, - { 0x9a01, 0xd064, 0x3000 }, - { 0x9a01, 0xd062, 0x2000 }, - { 0x1a01, 0xd061, 0x0000 }, - { 0x1a01, 0xd063, 0x0000 }, - { 0x9a01, 0xd066, 0x2000 }, - { 0x1a01, 0xd065, 0x0000 }, - { 0x1a01, 0xd067, 0x0000 }, - { 0x9a01, 0xd06c, 0x3000 }, - { 0x9a01, 0xd06a, 0x2000 }, - { 0x1a01, 0xd069, 0x0000 }, - { 0x1a01, 0xd06b, 0x0000 }, - { 0x9a01, 0xd06e, 0x2000 }, - { 0x1a01, 0xd06d, 0x0000 }, - { 0x1a01, 0xd06f, 0x0000 }, - { 0x9a01, 0xd078, 0x4000 }, - { 0x9a01, 0xd074, 0x3000 }, - { 0x9a01, 0xd072, 0x2000 }, - { 0x1a01, 0xd071, 0x0000 }, - { 0x1a01, 0xd073, 0x0000 }, - { 0x9a01, 0xd076, 0x2000 }, - { 0x1a01, 0xd075, 0x0000 }, - { 0x1a01, 0xd077, 0x0000 }, - { 0x9a01, 0xd07c, 0x3000 }, - { 0x9a01, 0xd07a, 0x2000 }, - { 0x1a01, 0xd079, 0x0000 }, - { 0x1a01, 0xd07b, 0x0000 }, - { 0x9a01, 0xd07e, 0x2000 }, - { 0x1a01, 0xd07d, 0x0000 }, - { 0x1a01, 0xd07f, 0x0000 }, - { 0x9a01, 0xd18d, 0x9000 }, - { 0x9a01, 0xd10a, 0x8000 }, - { 0x9a01, 0xd0c0, 0x7000 }, - { 0x9a01, 0xd0a0, 0x6000 }, - { 0x9a01, 0xd090, 0x5000 }, - { 0x9a01, 0xd088, 0x4000 }, - { 0x9a01, 0xd084, 0x3000 }, - { 0x9a01, 0xd082, 0x2000 }, - { 0x1a01, 0xd081, 0x0000 }, - { 0x1a01, 0xd083, 0x0000 }, - { 0x9a01, 0xd086, 0x2000 }, - { 0x1a01, 0xd085, 0x0000 }, - { 0x1a01, 0xd087, 0x0000 }, - { 0x9a01, 0xd08c, 0x3000 }, - { 0x9a01, 0xd08a, 0x2000 }, - { 0x1a01, 0xd089, 0x0000 }, - { 0x1a01, 0xd08b, 0x0000 }, - { 0x9a01, 0xd08e, 0x2000 }, - { 0x1a01, 0xd08d, 0x0000 }, - { 0x1a01, 0xd08f, 0x0000 }, - { 0x9a01, 0xd098, 0x4000 }, - { 0x9a01, 0xd094, 0x3000 }, - { 0x9a01, 0xd092, 0x2000 }, - { 0x1a01, 0xd091, 0x0000 }, - { 0x1a01, 0xd093, 0x0000 }, - { 0x9a01, 0xd096, 0x2000 }, - { 0x1a01, 0xd095, 0x0000 }, - { 0x1a01, 0xd097, 0x0000 }, - { 0x9a01, 0xd09c, 0x3000 }, - { 0x9a01, 0xd09a, 0x2000 }, - { 0x1a01, 0xd099, 0x0000 }, - { 0x1a01, 0xd09b, 0x0000 }, - { 0x9a01, 0xd09e, 0x2000 }, - { 0x1a01, 0xd09d, 0x0000 }, - { 0x1a01, 0xd09f, 0x0000 }, - { 0x9a01, 0xd0b0, 0x5000 }, - { 0x9a01, 0xd0a8, 0x4000 }, - { 0x9a01, 0xd0a4, 0x3000 }, - { 0x9a01, 0xd0a2, 0x2000 }, - { 0x1a01, 0xd0a1, 0x0000 }, - { 0x1a01, 0xd0a3, 0x0000 }, - { 0x9a01, 0xd0a6, 0x2000 }, - { 0x1a01, 0xd0a5, 0x0000 }, - { 0x1a01, 0xd0a7, 0x0000 }, - { 0x9a01, 0xd0ac, 0x3000 }, - { 0x9a01, 0xd0aa, 0x2000 }, - { 0x1a01, 0xd0a9, 0x0000 }, - { 0x1a01, 0xd0ab, 0x0000 }, - { 0x9a01, 0xd0ae, 0x2000 }, - { 0x1a01, 0xd0ad, 0x0000 }, - { 0x1a01, 0xd0af, 0x0000 }, - { 0x9a01, 0xd0b8, 0x4000 }, - { 0x9a01, 0xd0b4, 0x3000 }, - { 0x9a01, 0xd0b2, 0x2000 }, - { 0x1a01, 0xd0b1, 0x0000 }, - { 0x1a01, 0xd0b3, 0x0000 }, - { 0x9a01, 0xd0b6, 0x2000 }, - { 0x1a01, 0xd0b5, 0x0000 }, - { 0x1a01, 0xd0b7, 0x0000 }, - { 0x9a01, 0xd0bc, 0x3000 }, - { 0x9a01, 0xd0ba, 0x2000 }, - { 0x1a01, 0xd0b9, 0x0000 }, - { 0x1a01, 0xd0bb, 0x0000 }, - { 0x9a01, 0xd0be, 0x2000 }, - { 0x1a01, 0xd0bd, 0x0000 }, - { 0x1a01, 0xd0bf, 0x0000 }, - { 0x9a01, 0xd0e0, 0x6000 }, - { 0x9a01, 0xd0d0, 0x5000 }, - { 0x9a01, 0xd0c8, 0x4000 }, - { 0x9a01, 0xd0c4, 0x3000 }, - { 0x9a01, 0xd0c2, 0x2000 }, - { 0x1a01, 0xd0c1, 0x0000 }, - { 0x1a01, 0xd0c3, 0x0000 }, - { 0x9a01, 0xd0c6, 0x2000 }, - { 0x1a01, 0xd0c5, 0x0000 }, - { 0x1a01, 0xd0c7, 0x0000 }, - { 0x9a01, 0xd0cc, 0x3000 }, - { 0x9a01, 0xd0ca, 0x2000 }, - { 0x1a01, 0xd0c9, 0x0000 }, - { 0x1a01, 0xd0cb, 0x0000 }, - { 0x9a01, 0xd0ce, 0x2000 }, - { 0x1a01, 0xd0cd, 0x0000 }, - { 0x1a01, 0xd0cf, 0x0000 }, - { 0x9a01, 0xd0d8, 0x4000 }, - { 0x9a01, 0xd0d4, 0x3000 }, - { 0x9a01, 0xd0d2, 0x2000 }, - { 0x1a01, 0xd0d1, 0x0000 }, - { 0x1a01, 0xd0d3, 0x0000 }, - { 0x9a01, 0xd0d6, 0x2000 }, - { 0x1a01, 0xd0d5, 0x0000 }, - { 0x1a01, 0xd0d7, 0x0000 }, - { 0x9a01, 0xd0dc, 0x3000 }, - { 0x9a01, 0xd0da, 0x2000 }, - { 0x1a01, 0xd0d9, 0x0000 }, - { 0x1a01, 0xd0db, 0x0000 }, - { 0x9a01, 0xd0de, 0x2000 }, - { 0x1a01, 0xd0dd, 0x0000 }, - { 0x1a01, 0xd0df, 0x0000 }, - { 0x9a01, 0xd0f0, 0x5000 }, - { 0x9a01, 0xd0e8, 0x4000 }, - { 0x9a01, 0xd0e4, 0x3000 }, - { 0x9a01, 0xd0e2, 0x2000 }, - { 0x1a01, 0xd0e1, 0x0000 }, - { 0x1a01, 0xd0e3, 0x0000 }, - { 0x9a01, 0xd0e6, 0x2000 }, - { 0x1a01, 0xd0e5, 0x0000 }, - { 0x1a01, 0xd0e7, 0x0000 }, - { 0x9a01, 0xd0ec, 0x3000 }, - { 0x9a01, 0xd0ea, 0x2000 }, - { 0x1a01, 0xd0e9, 0x0000 }, - { 0x1a01, 0xd0eb, 0x0000 }, - { 0x9a01, 0xd0ee, 0x2000 }, - { 0x1a01, 0xd0ed, 0x0000 }, - { 0x1a01, 0xd0ef, 0x0000 }, - { 0x9a01, 0xd102, 0x4000 }, - { 0x9a01, 0xd0f4, 0x3000 }, - { 0x9a01, 0xd0f2, 0x2000 }, - { 0x1a01, 0xd0f1, 0x0000 }, - { 0x1a01, 0xd0f3, 0x0000 }, - { 0x9a01, 0xd100, 0x2000 }, - { 0x1a01, 0xd0f5, 0x0000 }, - { 0x1a01, 0xd101, 0x0000 }, - { 0x9a01, 0xd106, 0x3000 }, - { 0x9a01, 0xd104, 0x2000 }, - { 0x1a01, 0xd103, 0x0000 }, - { 0x1a01, 0xd105, 0x0000 }, - { 0x9a01, 0xd108, 0x2000 }, - { 0x1a01, 0xd107, 0x0000 }, - { 0x1a01, 0xd109, 0x0000 }, - { 0x9a01, 0xd14d, 0x7000 }, - { 0x9a01, 0xd12d, 0x6000 }, - { 0x9a01, 0xd11a, 0x5000 }, - { 0x9a01, 0xd112, 0x4000 }, - { 0x9a01, 0xd10e, 0x3000 }, - { 0x9a01, 0xd10c, 0x2000 }, - { 0x1a01, 0xd10b, 0x0000 }, - { 0x1a01, 0xd10d, 0x0000 }, - { 0x9a01, 0xd110, 0x2000 }, - { 0x1a01, 0xd10f, 0x0000 }, - { 0x1a01, 0xd111, 0x0000 }, - { 0x9a01, 0xd116, 0x3000 }, - { 0x9a01, 0xd114, 0x2000 }, - { 0x1a01, 0xd113, 0x0000 }, - { 0x1a01, 0xd115, 0x0000 }, - { 0x9a01, 0xd118, 0x2000 }, - { 0x1a01, 0xd117, 0x0000 }, - { 0x1a01, 0xd119, 0x0000 }, - { 0x9a01, 0xd122, 0x4000 }, - { 0x9a01, 0xd11e, 0x3000 }, - { 0x9a01, 0xd11c, 0x2000 }, - { 0x1a01, 0xd11b, 0x0000 }, - { 0x1a01, 0xd11d, 0x0000 }, - { 0x9a01, 0xd120, 0x2000 }, - { 0x1a01, 0xd11f, 0x0000 }, - { 0x1a01, 0xd121, 0x0000 }, - { 0x9a01, 0xd126, 0x3000 }, - { 0x9a01, 0xd124, 0x2000 }, - { 0x1a01, 0xd123, 0x0000 }, - { 0x1a01, 0xd125, 0x0000 }, - { 0x9a01, 0xd12b, 0x2000 }, - { 0x1a01, 0xd12a, 0x0000 }, - { 0x1a01, 0xd12c, 0x0000 }, - { 0x9a01, 0xd13d, 0x5000 }, - { 0x9a01, 0xd135, 0x4000 }, - { 0x9a01, 0xd131, 0x3000 }, - { 0x9a01, 0xd12f, 0x2000 }, - { 0x1a01, 0xd12e, 0x0000 }, - { 0x1a01, 0xd130, 0x0000 }, - { 0x9a01, 0xd133, 0x2000 }, - { 0x1a01, 0xd132, 0x0000 }, - { 0x1a01, 0xd134, 0x0000 }, - { 0x9a01, 0xd139, 0x3000 }, - { 0x9a01, 0xd137, 0x2000 }, - { 0x1a01, 0xd136, 0x0000 }, - { 0x1a01, 0xd138, 0x0000 }, - { 0x9a01, 0xd13b, 0x2000 }, - { 0x1a01, 0xd13a, 0x0000 }, - { 0x1a01, 0xd13c, 0x0000 }, - { 0x9a01, 0xd145, 0x4000 }, - { 0x9a01, 0xd141, 0x3000 }, - { 0x9a01, 0xd13f, 0x2000 }, - { 0x1a01, 0xd13e, 0x0000 }, - { 0x1a01, 0xd140, 0x0000 }, - { 0x9a01, 0xd143, 0x2000 }, - { 0x1a01, 0xd142, 0x0000 }, - { 0x1a01, 0xd144, 0x0000 }, - { 0x9a01, 0xd149, 0x3000 }, - { 0x9a01, 0xd147, 0x2000 }, - { 0x1a01, 0xd146, 0x0000 }, - { 0x1a01, 0xd148, 0x0000 }, - { 0x9a01, 0xd14b, 0x2000 }, - { 0x1a01, 0xd14a, 0x0000 }, - { 0x1a01, 0xd14c, 0x0000 }, - { 0x8a01, 0xd16d, 0x6000 }, - { 0x9a01, 0xd15d, 0x5000 }, - { 0x9a01, 0xd155, 0x4000 }, - { 0x9a01, 0xd151, 0x3000 }, - { 0x9a01, 0xd14f, 0x2000 }, - { 0x1a01, 0xd14e, 0x0000 }, - { 0x1a01, 0xd150, 0x0000 }, - { 0x9a01, 0xd153, 0x2000 }, - { 0x1a01, 0xd152, 0x0000 }, - { 0x1a01, 0xd154, 0x0000 }, - { 0x9a01, 0xd159, 0x3000 }, - { 0x9a01, 0xd157, 0x2000 }, - { 0x1a01, 0xd156, 0x0000 }, - { 0x1a01, 0xd158, 0x0000 }, - { 0x9a01, 0xd15b, 0x2000 }, - { 0x1a01, 0xd15a, 0x0000 }, - { 0x1a01, 0xd15c, 0x0000 }, - { 0x8a01, 0xd165, 0x4000 }, - { 0x9a01, 0xd161, 0x3000 }, - { 0x9a01, 0xd15f, 0x2000 }, - { 0x1a01, 0xd15e, 0x0000 }, - { 0x1a01, 0xd160, 0x0000 }, - { 0x9a01, 0xd163, 0x2000 }, - { 0x1a01, 0xd162, 0x0000 }, - { 0x1a01, 0xd164, 0x0000 }, - { 0x8c01, 0xd169, 0x3000 }, - { 0x8c01, 0xd167, 0x2000 }, - { 0x0a01, 0xd166, 0x0000 }, - { 0x0c01, 0xd168, 0x0000 }, - { 0x9a01, 0xd16b, 0x2000 }, - { 0x1a01, 0xd16a, 0x0000 }, - { 0x1a01, 0xd16c, 0x0000 }, - { 0x8c01, 0xd17d, 0x5000 }, - { 0x8101, 0xd175, 0x4000 }, - { 0x8a01, 0xd171, 0x3000 }, - { 0x8a01, 0xd16f, 0x2000 }, - { 0x0a01, 0xd16e, 0x0000 }, - { 0x0a01, 0xd170, 0x0000 }, - { 0x8101, 0xd173, 0x2000 }, - { 0x0a01, 0xd172, 0x0000 }, - { 0x0101, 0xd174, 0x0000 }, - { 0x8101, 0xd179, 0x3000 }, - { 0x8101, 0xd177, 0x2000 }, - { 0x0101, 0xd176, 0x0000 }, - { 0x0101, 0xd178, 0x0000 }, - { 0x8c01, 0xd17b, 0x2000 }, - { 0x0101, 0xd17a, 0x0000 }, - { 0x0c01, 0xd17c, 0x0000 }, - { 0x8c01, 0xd185, 0x4000 }, - { 0x8c01, 0xd181, 0x3000 }, - { 0x8c01, 0xd17f, 0x2000 }, - { 0x0c01, 0xd17e, 0x0000 }, - { 0x0c01, 0xd180, 0x0000 }, - { 0x9a01, 0xd183, 0x2000 }, - { 0x0c01, 0xd182, 0x0000 }, - { 0x1a01, 0xd184, 0x0000 }, - { 0x8c01, 0xd189, 0x3000 }, - { 0x8c01, 0xd187, 0x2000 }, - { 0x0c01, 0xd186, 0x0000 }, - { 0x0c01, 0xd188, 0x0000 }, - { 0x8c01, 0xd18b, 0x2000 }, - { 0x0c01, 0xd18a, 0x0000 }, - { 0x1a01, 0xd18c, 0x0000 }, - { 0x9a01, 0xd32f, 0x8000 }, - { 0x9a01, 0xd1cd, 0x7000 }, - { 0x8c01, 0xd1ad, 0x6000 }, - { 0x9a01, 0xd19d, 0x5000 }, - { 0x9a01, 0xd195, 0x4000 }, - { 0x9a01, 0xd191, 0x3000 }, - { 0x9a01, 0xd18f, 0x2000 }, - { 0x1a01, 0xd18e, 0x0000 }, - { 0x1a01, 0xd190, 0x0000 }, - { 0x9a01, 0xd193, 0x2000 }, - { 0x1a01, 0xd192, 0x0000 }, - { 0x1a01, 0xd194, 0x0000 }, - { 0x9a01, 0xd199, 0x3000 }, - { 0x9a01, 0xd197, 0x2000 }, - { 0x1a01, 0xd196, 0x0000 }, - { 0x1a01, 0xd198, 0x0000 }, - { 0x9a01, 0xd19b, 0x2000 }, - { 0x1a01, 0xd19a, 0x0000 }, - { 0x1a01, 0xd19c, 0x0000 }, - { 0x9a01, 0xd1a5, 0x4000 }, - { 0x9a01, 0xd1a1, 0x3000 }, - { 0x9a01, 0xd19f, 0x2000 }, - { 0x1a01, 0xd19e, 0x0000 }, - { 0x1a01, 0xd1a0, 0x0000 }, - { 0x9a01, 0xd1a3, 0x2000 }, - { 0x1a01, 0xd1a2, 0x0000 }, - { 0x1a01, 0xd1a4, 0x0000 }, - { 0x9a01, 0xd1a9, 0x3000 }, - { 0x9a01, 0xd1a7, 0x2000 }, - { 0x1a01, 0xd1a6, 0x0000 }, - { 0x1a01, 0xd1a8, 0x0000 }, - { 0x8c01, 0xd1ab, 0x2000 }, - { 0x0c01, 0xd1aa, 0x0000 }, - { 0x0c01, 0xd1ac, 0x0000 }, - { 0x9a01, 0xd1bd, 0x5000 }, - { 0x9a01, 0xd1b5, 0x4000 }, - { 0x9a01, 0xd1b1, 0x3000 }, - { 0x9a01, 0xd1af, 0x2000 }, - { 0x1a01, 0xd1ae, 0x0000 }, - { 0x1a01, 0xd1b0, 0x0000 }, - { 0x9a01, 0xd1b3, 0x2000 }, - { 0x1a01, 0xd1b2, 0x0000 }, - { 0x1a01, 0xd1b4, 0x0000 }, - { 0x9a01, 0xd1b9, 0x3000 }, - { 0x9a01, 0xd1b7, 0x2000 }, - { 0x1a01, 0xd1b6, 0x0000 }, - { 0x1a01, 0xd1b8, 0x0000 }, - { 0x9a01, 0xd1bb, 0x2000 }, - { 0x1a01, 0xd1ba, 0x0000 }, - { 0x1a01, 0xd1bc, 0x0000 }, - { 0x9a01, 0xd1c5, 0x4000 }, - { 0x9a01, 0xd1c1, 0x3000 }, - { 0x9a01, 0xd1bf, 0x2000 }, - { 0x1a01, 0xd1be, 0x0000 }, - { 0x1a01, 0xd1c0, 0x0000 }, - { 0x9a01, 0xd1c3, 0x2000 }, - { 0x1a01, 0xd1c2, 0x0000 }, - { 0x1a01, 0xd1c4, 0x0000 }, - { 0x9a01, 0xd1c9, 0x3000 }, - { 0x9a01, 0xd1c7, 0x2000 }, - { 0x1a01, 0xd1c6, 0x0000 }, - { 0x1a01, 0xd1c8, 0x0000 }, - { 0x9a01, 0xd1cb, 0x2000 }, - { 0x1a01, 0xd1ca, 0x0000 }, - { 0x1a01, 0xd1cc, 0x0000 }, - { 0x9a01, 0xd30f, 0x6000 }, - { 0x9a01, 0xd1dd, 0x5000 }, - { 0x9a01, 0xd1d5, 0x4000 }, - { 0x9a01, 0xd1d1, 0x3000 }, - { 0x9a01, 0xd1cf, 0x2000 }, - { 0x1a01, 0xd1ce, 0x0000 }, - { 0x1a01, 0xd1d0, 0x0000 }, - { 0x9a01, 0xd1d3, 0x2000 }, - { 0x1a01, 0xd1d2, 0x0000 }, - { 0x1a01, 0xd1d4, 0x0000 }, - { 0x9a01, 0xd1d9, 0x3000 }, - { 0x9a01, 0xd1d7, 0x2000 }, - { 0x1a01, 0xd1d6, 0x0000 }, - { 0x1a01, 0xd1d8, 0x0000 }, - { 0x9a01, 0xd1db, 0x2000 }, - { 0x1a01, 0xd1da, 0x0000 }, - { 0x1a01, 0xd1dc, 0x0000 }, - { 0x9a01, 0xd307, 0x4000 }, - { 0x9a01, 0xd303, 0x3000 }, - { 0x9a01, 0xd301, 0x2000 }, - { 0x1a01, 0xd300, 0x0000 }, - { 0x1a01, 0xd302, 0x0000 }, - { 0x9a01, 0xd305, 0x2000 }, - { 0x1a01, 0xd304, 0x0000 }, - { 0x1a01, 0xd306, 0x0000 }, - { 0x9a01, 0xd30b, 0x3000 }, - { 0x9a01, 0xd309, 0x2000 }, - { 0x1a01, 0xd308, 0x0000 }, - { 0x1a01, 0xd30a, 0x0000 }, - { 0x9a01, 0xd30d, 0x2000 }, - { 0x1a01, 0xd30c, 0x0000 }, - { 0x1a01, 0xd30e, 0x0000 }, - { 0x9a01, 0xd31f, 0x5000 }, - { 0x9a01, 0xd317, 0x4000 }, - { 0x9a01, 0xd313, 0x3000 }, - { 0x9a01, 0xd311, 0x2000 }, - { 0x1a01, 0xd310, 0x0000 }, - { 0x1a01, 0xd312, 0x0000 }, - { 0x9a01, 0xd315, 0x2000 }, - { 0x1a01, 0xd314, 0x0000 }, - { 0x1a01, 0xd316, 0x0000 }, - { 0x9a01, 0xd31b, 0x3000 }, - { 0x9a01, 0xd319, 0x2000 }, - { 0x1a01, 0xd318, 0x0000 }, - { 0x1a01, 0xd31a, 0x0000 }, - { 0x9a01, 0xd31d, 0x2000 }, - { 0x1a01, 0xd31c, 0x0000 }, - { 0x1a01, 0xd31e, 0x0000 }, - { 0x9a01, 0xd327, 0x4000 }, - { 0x9a01, 0xd323, 0x3000 }, - { 0x9a01, 0xd321, 0x2000 }, - { 0x1a01, 0xd320, 0x0000 }, - { 0x1a01, 0xd322, 0x0000 }, - { 0x9a01, 0xd325, 0x2000 }, - { 0x1a01, 0xd324, 0x0000 }, - { 0x1a01, 0xd326, 0x0000 }, - { 0x9a01, 0xd32b, 0x3000 }, - { 0x9a01, 0xd329, 0x2000 }, - { 0x1a01, 0xd328, 0x0000 }, - { 0x1a01, 0xd32a, 0x0000 }, - { 0x9a01, 0xd32d, 0x2000 }, - { 0x1a01, 0xd32c, 0x0000 }, - { 0x1a01, 0xd32e, 0x0000 }, - { 0x8901, 0xd418, 0x7000 }, - { 0x9a01, 0xd34f, 0x6000 }, - { 0x9a01, 0xd33f, 0x5000 }, - { 0x9a01, 0xd337, 0x4000 }, - { 0x9a01, 0xd333, 0x3000 }, - { 0x9a01, 0xd331, 0x2000 }, - { 0x1a01, 0xd330, 0x0000 }, - { 0x1a01, 0xd332, 0x0000 }, - { 0x9a01, 0xd335, 0x2000 }, - { 0x1a01, 0xd334, 0x0000 }, - { 0x1a01, 0xd336, 0x0000 }, - { 0x9a01, 0xd33b, 0x3000 }, - { 0x9a01, 0xd339, 0x2000 }, - { 0x1a01, 0xd338, 0x0000 }, - { 0x1a01, 0xd33a, 0x0000 }, - { 0x9a01, 0xd33d, 0x2000 }, - { 0x1a01, 0xd33c, 0x0000 }, - { 0x1a01, 0xd33e, 0x0000 }, - { 0x9a01, 0xd347, 0x4000 }, - { 0x9a01, 0xd343, 0x3000 }, - { 0x9a01, 0xd341, 0x2000 }, - { 0x1a01, 0xd340, 0x0000 }, - { 0x1a01, 0xd342, 0x0000 }, - { 0x9a01, 0xd345, 0x2000 }, - { 0x1a01, 0xd344, 0x0000 }, - { 0x1a01, 0xd346, 0x0000 }, - { 0x9a01, 0xd34b, 0x3000 }, - { 0x9a01, 0xd349, 0x2000 }, - { 0x1a01, 0xd348, 0x0000 }, - { 0x1a01, 0xd34a, 0x0000 }, - { 0x9a01, 0xd34d, 0x2000 }, - { 0x1a01, 0xd34c, 0x0000 }, - { 0x1a01, 0xd34e, 0x0000 }, - { 0x8901, 0xd408, 0x5000 }, - { 0x8901, 0xd400, 0x4000 }, - { 0x9a01, 0xd353, 0x3000 }, - { 0x9a01, 0xd351, 0x2000 }, - { 0x1a01, 0xd350, 0x0000 }, - { 0x1a01, 0xd352, 0x0000 }, - { 0x9a01, 0xd355, 0x2000 }, - { 0x1a01, 0xd354, 0x0000 }, - { 0x1a01, 0xd356, 0x0000 }, - { 0x8901, 0xd404, 0x3000 }, - { 0x8901, 0xd402, 0x2000 }, - { 0x0901, 0xd401, 0x0000 }, - { 0x0901, 0xd403, 0x0000 }, - { 0x8901, 0xd406, 0x2000 }, - { 0x0901, 0xd405, 0x0000 }, - { 0x0901, 0xd407, 0x0000 }, - { 0x8901, 0xd410, 0x4000 }, - { 0x8901, 0xd40c, 0x3000 }, - { 0x8901, 0xd40a, 0x2000 }, - { 0x0901, 0xd409, 0x0000 }, - { 0x0901, 0xd40b, 0x0000 }, - { 0x8901, 0xd40e, 0x2000 }, - { 0x0901, 0xd40d, 0x0000 }, - { 0x0901, 0xd40f, 0x0000 }, - { 0x8901, 0xd414, 0x3000 }, - { 0x8901, 0xd412, 0x2000 }, - { 0x0901, 0xd411, 0x0000 }, - { 0x0901, 0xd413, 0x0000 }, - { 0x8901, 0xd416, 0x2000 }, - { 0x0901, 0xd415, 0x0000 }, - { 0x0901, 0xd417, 0x0000 }, - { 0x8901, 0xd438, 0x6000 }, - { 0x8501, 0xd428, 0x5000 }, - { 0x8501, 0xd420, 0x4000 }, - { 0x8501, 0xd41c, 0x3000 }, - { 0x8501, 0xd41a, 0x2000 }, - { 0x0901, 0xd419, 0x0000 }, - { 0x0501, 0xd41b, 0x0000 }, - { 0x8501, 0xd41e, 0x2000 }, - { 0x0501, 0xd41d, 0x0000 }, - { 0x0501, 0xd41f, 0x0000 }, - { 0x8501, 0xd424, 0x3000 }, - { 0x8501, 0xd422, 0x2000 }, - { 0x0501, 0xd421, 0x0000 }, - { 0x0501, 0xd423, 0x0000 }, - { 0x8501, 0xd426, 0x2000 }, - { 0x0501, 0xd425, 0x0000 }, - { 0x0501, 0xd427, 0x0000 }, - { 0x8501, 0xd430, 0x4000 }, - { 0x8501, 0xd42c, 0x3000 }, - { 0x8501, 0xd42a, 0x2000 }, - { 0x0501, 0xd429, 0x0000 }, - { 0x0501, 0xd42b, 0x0000 }, - { 0x8501, 0xd42e, 0x2000 }, - { 0x0501, 0xd42d, 0x0000 }, - { 0x0501, 0xd42f, 0x0000 }, - { 0x8901, 0xd434, 0x3000 }, - { 0x8501, 0xd432, 0x2000 }, - { 0x0501, 0xd431, 0x0000 }, - { 0x0501, 0xd433, 0x0000 }, - { 0x8901, 0xd436, 0x2000 }, - { 0x0901, 0xd435, 0x0000 }, - { 0x0901, 0xd437, 0x0000 }, - { 0x8901, 0xd448, 0x5000 }, - { 0x8901, 0xd440, 0x4000 }, - { 0x8901, 0xd43c, 0x3000 }, - { 0x8901, 0xd43a, 0x2000 }, - { 0x0901, 0xd439, 0x0000 }, - { 0x0901, 0xd43b, 0x0000 }, - { 0x8901, 0xd43e, 0x2000 }, - { 0x0901, 0xd43d, 0x0000 }, - { 0x0901, 0xd43f, 0x0000 }, - { 0x8901, 0xd444, 0x3000 }, - { 0x8901, 0xd442, 0x2000 }, - { 0x0901, 0xd441, 0x0000 }, - { 0x0901, 0xd443, 0x0000 }, - { 0x8901, 0xd446, 0x2000 }, - { 0x0901, 0xd445, 0x0000 }, - { 0x0901, 0xd447, 0x0000 }, - { 0x8501, 0xd450, 0x4000 }, - { 0x8901, 0xd44c, 0x3000 }, - { 0x8901, 0xd44a, 0x2000 }, - { 0x0901, 0xd449, 0x0000 }, - { 0x0901, 0xd44b, 0x0000 }, - { 0x8501, 0xd44e, 0x2000 }, - { 0x0901, 0xd44d, 0x0000 }, - { 0x0501, 0xd44f, 0x0000 }, - { 0x8501, 0xd454, 0x3000 }, - { 0x8501, 0xd452, 0x2000 }, - { 0x0501, 0xd451, 0x0000 }, - { 0x0501, 0xd453, 0x0000 }, - { 0x8501, 0xd457, 0x2000 }, - { 0x0501, 0xd456, 0x0000 }, - { 0x0501, 0xd458, 0x0000 }, - { 0x8702, 0xf876, 0xb000 }, - { 0x8901, 0xd670, 0xa000 }, - { 0x8901, 0xd570, 0x9000 }, - { 0x8901, 0xd4e4, 0x8000 }, - { 0x8501, 0xd499, 0x7000 }, - { 0x8901, 0xd479, 0x6000 }, - { 0x8901, 0xd469, 0x5000 }, - { 0x8501, 0xd461, 0x4000 }, - { 0x8501, 0xd45d, 0x3000 }, - { 0x8501, 0xd45b, 0x2000 }, - { 0x0501, 0xd45a, 0x0000 }, - { 0x0501, 0xd45c, 0x0000 }, - { 0x8501, 0xd45f, 0x2000 }, - { 0x0501, 0xd45e, 0x0000 }, - { 0x0501, 0xd460, 0x0000 }, - { 0x8501, 0xd465, 0x3000 }, - { 0x8501, 0xd463, 0x2000 }, - { 0x0501, 0xd462, 0x0000 }, - { 0x0501, 0xd464, 0x0000 }, - { 0x8501, 0xd467, 0x2000 }, - { 0x0501, 0xd466, 0x0000 }, - { 0x0901, 0xd468, 0x0000 }, - { 0x8901, 0xd471, 0x4000 }, - { 0x8901, 0xd46d, 0x3000 }, - { 0x8901, 0xd46b, 0x2000 }, - { 0x0901, 0xd46a, 0x0000 }, - { 0x0901, 0xd46c, 0x0000 }, - { 0x8901, 0xd46f, 0x2000 }, - { 0x0901, 0xd46e, 0x0000 }, - { 0x0901, 0xd470, 0x0000 }, - { 0x8901, 0xd475, 0x3000 }, - { 0x8901, 0xd473, 0x2000 }, - { 0x0901, 0xd472, 0x0000 }, - { 0x0901, 0xd474, 0x0000 }, - { 0x8901, 0xd477, 0x2000 }, - { 0x0901, 0xd476, 0x0000 }, - { 0x0901, 0xd478, 0x0000 }, - { 0x8501, 0xd489, 0x5000 }, - { 0x8901, 0xd481, 0x4000 }, - { 0x8901, 0xd47d, 0x3000 }, - { 0x8901, 0xd47b, 0x2000 }, - { 0x0901, 0xd47a, 0x0000 }, - { 0x0901, 0xd47c, 0x0000 }, - { 0x8901, 0xd47f, 0x2000 }, - { 0x0901, 0xd47e, 0x0000 }, - { 0x0901, 0xd480, 0x0000 }, - { 0x8501, 0xd485, 0x3000 }, - { 0x8501, 0xd483, 0x2000 }, - { 0x0501, 0xd482, 0x0000 }, - { 0x0501, 0xd484, 0x0000 }, - { 0x8501, 0xd487, 0x2000 }, - { 0x0501, 0xd486, 0x0000 }, - { 0x0501, 0xd488, 0x0000 }, - { 0x8501, 0xd491, 0x4000 }, - { 0x8501, 0xd48d, 0x3000 }, - { 0x8501, 0xd48b, 0x2000 }, - { 0x0501, 0xd48a, 0x0000 }, - { 0x0501, 0xd48c, 0x0000 }, - { 0x8501, 0xd48f, 0x2000 }, - { 0x0501, 0xd48e, 0x0000 }, - { 0x0501, 0xd490, 0x0000 }, - { 0x8501, 0xd495, 0x3000 }, - { 0x8501, 0xd493, 0x2000 }, - { 0x0501, 0xd492, 0x0000 }, - { 0x0501, 0xd494, 0x0000 }, - { 0x8501, 0xd497, 0x2000 }, - { 0x0501, 0xd496, 0x0000 }, - { 0x0501, 0xd498, 0x0000 }, - { 0x8501, 0xd4c3, 0x6000 }, - { 0x8901, 0xd4b1, 0x5000 }, - { 0x8901, 0xd4a6, 0x4000 }, - { 0x8901, 0xd49e, 0x3000 }, - { 0x8501, 0xd49b, 0x2000 }, - { 0x0501, 0xd49a, 0x0000 }, - { 0x0901, 0xd49c, 0x0000 }, - { 0x8901, 0xd4a2, 0x2000 }, - { 0x0901, 0xd49f, 0x0000 }, - { 0x0901, 0xd4a5, 0x0000 }, - { 0x8901, 0xd4ac, 0x3000 }, - { 0x8901, 0xd4aa, 0x2000 }, - { 0x0901, 0xd4a9, 0x0000 }, - { 0x0901, 0xd4ab, 0x0000 }, - { 0x8901, 0xd4af, 0x2000 }, - { 0x0901, 0xd4ae, 0x0000 }, - { 0x0901, 0xd4b0, 0x0000 }, - { 0x8501, 0xd4b9, 0x4000 }, - { 0x8901, 0xd4b5, 0x3000 }, - { 0x8901, 0xd4b3, 0x2000 }, - { 0x0901, 0xd4b2, 0x0000 }, - { 0x0901, 0xd4b4, 0x0000 }, - { 0x8501, 0xd4b7, 0x2000 }, - { 0x0501, 0xd4b6, 0x0000 }, - { 0x0501, 0xd4b8, 0x0000 }, - { 0x8501, 0xd4bf, 0x3000 }, - { 0x8501, 0xd4bd, 0x2000 }, - { 0x0501, 0xd4bb, 0x0000 }, - { 0x0501, 0xd4be, 0x0000 }, - { 0x8501, 0xd4c1, 0x2000 }, - { 0x0501, 0xd4c0, 0x0000 }, - { 0x0501, 0xd4c2, 0x0000 }, - { 0x8901, 0xd4d4, 0x5000 }, - { 0x8501, 0xd4cc, 0x4000 }, - { 0x8501, 0xd4c8, 0x3000 }, - { 0x8501, 0xd4c6, 0x2000 }, - { 0x0501, 0xd4c5, 0x0000 }, - { 0x0501, 0xd4c7, 0x0000 }, - { 0x8501, 0xd4ca, 0x2000 }, - { 0x0501, 0xd4c9, 0x0000 }, - { 0x0501, 0xd4cb, 0x0000 }, - { 0x8901, 0xd4d0, 0x3000 }, - { 0x8501, 0xd4ce, 0x2000 }, - { 0x0501, 0xd4cd, 0x0000 }, - { 0x0501, 0xd4cf, 0x0000 }, - { 0x8901, 0xd4d2, 0x2000 }, - { 0x0901, 0xd4d1, 0x0000 }, - { 0x0901, 0xd4d3, 0x0000 }, - { 0x8901, 0xd4dc, 0x4000 }, - { 0x8901, 0xd4d8, 0x3000 }, - { 0x8901, 0xd4d6, 0x2000 }, - { 0x0901, 0xd4d5, 0x0000 }, - { 0x0901, 0xd4d7, 0x0000 }, - { 0x8901, 0xd4da, 0x2000 }, - { 0x0901, 0xd4d9, 0x0000 }, - { 0x0901, 0xd4db, 0x0000 }, - { 0x8901, 0xd4e0, 0x3000 }, - { 0x8901, 0xd4de, 0x2000 }, - { 0x0901, 0xd4dd, 0x0000 }, - { 0x0901, 0xd4df, 0x0000 }, - { 0x8901, 0xd4e2, 0x2000 }, - { 0x0901, 0xd4e1, 0x0000 }, - { 0x0901, 0xd4e3, 0x0000 }, - { 0x8501, 0xd529, 0x7000 }, - { 0x8901, 0xd504, 0x6000 }, - { 0x8501, 0xd4f4, 0x5000 }, - { 0x8501, 0xd4ec, 0x4000 }, - { 0x8901, 0xd4e8, 0x3000 }, - { 0x8901, 0xd4e6, 0x2000 }, - { 0x0901, 0xd4e5, 0x0000 }, - { 0x0901, 0xd4e7, 0x0000 }, - { 0x8501, 0xd4ea, 0x2000 }, - { 0x0901, 0xd4e9, 0x0000 }, - { 0x0501, 0xd4eb, 0x0000 }, - { 0x8501, 0xd4f0, 0x3000 }, - { 0x8501, 0xd4ee, 0x2000 }, - { 0x0501, 0xd4ed, 0x0000 }, - { 0x0501, 0xd4ef, 0x0000 }, - { 0x8501, 0xd4f2, 0x2000 }, - { 0x0501, 0xd4f1, 0x0000 }, - { 0x0501, 0xd4f3, 0x0000 }, - { 0x8501, 0xd4fc, 0x4000 }, - { 0x8501, 0xd4f8, 0x3000 }, - { 0x8501, 0xd4f6, 0x2000 }, - { 0x0501, 0xd4f5, 0x0000 }, - { 0x0501, 0xd4f7, 0x0000 }, - { 0x8501, 0xd4fa, 0x2000 }, - { 0x0501, 0xd4f9, 0x0000 }, - { 0x0501, 0xd4fb, 0x0000 }, - { 0x8501, 0xd500, 0x3000 }, - { 0x8501, 0xd4fe, 0x2000 }, - { 0x0501, 0xd4fd, 0x0000 }, - { 0x0501, 0xd4ff, 0x0000 }, - { 0x8501, 0xd502, 0x2000 }, - { 0x0501, 0xd501, 0x0000 }, - { 0x0501, 0xd503, 0x0000 }, - { 0x8901, 0xd518, 0x5000 }, - { 0x8901, 0xd50f, 0x4000 }, - { 0x8901, 0xd509, 0x3000 }, - { 0x8901, 0xd507, 0x2000 }, - { 0x0901, 0xd505, 0x0000 }, - { 0x0901, 0xd508, 0x0000 }, - { 0x8901, 0xd50d, 0x2000 }, - { 0x0901, 0xd50a, 0x0000 }, - { 0x0901, 0xd50e, 0x0000 }, - { 0x8901, 0xd513, 0x3000 }, - { 0x8901, 0xd511, 0x2000 }, - { 0x0901, 0xd510, 0x0000 }, - { 0x0901, 0xd512, 0x0000 }, - { 0x8901, 0xd516, 0x2000 }, - { 0x0901, 0xd514, 0x0000 }, - { 0x0901, 0xd517, 0x0000 }, - { 0x8501, 0xd521, 0x4000 }, - { 0x8901, 0xd51c, 0x3000 }, - { 0x8901, 0xd51a, 0x2000 }, - { 0x0901, 0xd519, 0x0000 }, - { 0x0901, 0xd51b, 0x0000 }, - { 0x8501, 0xd51f, 0x2000 }, - { 0x0501, 0xd51e, 0x0000 }, - { 0x0501, 0xd520, 0x0000 }, - { 0x8501, 0xd525, 0x3000 }, - { 0x8501, 0xd523, 0x2000 }, - { 0x0501, 0xd522, 0x0000 }, - { 0x0501, 0xd524, 0x0000 }, - { 0x8501, 0xd527, 0x2000 }, - { 0x0501, 0xd526, 0x0000 }, - { 0x0501, 0xd528, 0x0000 }, - { 0x8901, 0xd54f, 0x6000 }, - { 0x8901, 0xd539, 0x5000 }, - { 0x8501, 0xd531, 0x4000 }, - { 0x8501, 0xd52d, 0x3000 }, - { 0x8501, 0xd52b, 0x2000 }, - { 0x0501, 0xd52a, 0x0000 }, - { 0x0501, 0xd52c, 0x0000 }, - { 0x8501, 0xd52f, 0x2000 }, - { 0x0501, 0xd52e, 0x0000 }, - { 0x0501, 0xd530, 0x0000 }, - { 0x8501, 0xd535, 0x3000 }, - { 0x8501, 0xd533, 0x2000 }, - { 0x0501, 0xd532, 0x0000 }, - { 0x0501, 0xd534, 0x0000 }, - { 0x8501, 0xd537, 0x2000 }, - { 0x0501, 0xd536, 0x0000 }, - { 0x0901, 0xd538, 0x0000 }, - { 0x8901, 0xd543, 0x4000 }, - { 0x8901, 0xd53e, 0x3000 }, - { 0x8901, 0xd53c, 0x2000 }, - { 0x0901, 0xd53b, 0x0000 }, - { 0x0901, 0xd53d, 0x0000 }, - { 0x8901, 0xd541, 0x2000 }, - { 0x0901, 0xd540, 0x0000 }, - { 0x0901, 0xd542, 0x0000 }, - { 0x8901, 0xd54b, 0x3000 }, - { 0x8901, 0xd546, 0x2000 }, - { 0x0901, 0xd544, 0x0000 }, - { 0x0901, 0xd54a, 0x0000 }, - { 0x8901, 0xd54d, 0x2000 }, - { 0x0901, 0xd54c, 0x0000 }, - { 0x0901, 0xd54e, 0x0000 }, - { 0x8501, 0xd560, 0x5000 }, - { 0x8501, 0xd558, 0x4000 }, - { 0x8501, 0xd554, 0x3000 }, - { 0x8501, 0xd552, 0x2000 }, - { 0x0901, 0xd550, 0x0000 }, - { 0x0501, 0xd553, 0x0000 }, - { 0x8501, 0xd556, 0x2000 }, - { 0x0501, 0xd555, 0x0000 }, - { 0x0501, 0xd557, 0x0000 }, - { 0x8501, 0xd55c, 0x3000 }, - { 0x8501, 0xd55a, 0x2000 }, - { 0x0501, 0xd559, 0x0000 }, - { 0x0501, 0xd55b, 0x0000 }, - { 0x8501, 0xd55e, 0x2000 }, - { 0x0501, 0xd55d, 0x0000 }, - { 0x0501, 0xd55f, 0x0000 }, - { 0x8501, 0xd568, 0x4000 }, - { 0x8501, 0xd564, 0x3000 }, - { 0x8501, 0xd562, 0x2000 }, - { 0x0501, 0xd561, 0x0000 }, - { 0x0501, 0xd563, 0x0000 }, - { 0x8501, 0xd566, 0x2000 }, - { 0x0501, 0xd565, 0x0000 }, - { 0x0501, 0xd567, 0x0000 }, - { 0x8901, 0xd56c, 0x3000 }, - { 0x8501, 0xd56a, 0x2000 }, - { 0x0501, 0xd569, 0x0000 }, - { 0x0501, 0xd56b, 0x0000 }, - { 0x8901, 0xd56e, 0x2000 }, - { 0x0901, 0xd56d, 0x0000 }, - { 0x0901, 0xd56f, 0x0000 }, - { 0x8501, 0xd5f0, 0x8000 }, - { 0x8901, 0xd5b0, 0x7000 }, - { 0x8501, 0xd590, 0x6000 }, - { 0x8901, 0xd580, 0x5000 }, - { 0x8901, 0xd578, 0x4000 }, - { 0x8901, 0xd574, 0x3000 }, - { 0x8901, 0xd572, 0x2000 }, - { 0x0901, 0xd571, 0x0000 }, - { 0x0901, 0xd573, 0x0000 }, - { 0x8901, 0xd576, 0x2000 }, - { 0x0901, 0xd575, 0x0000 }, - { 0x0901, 0xd577, 0x0000 }, - { 0x8901, 0xd57c, 0x3000 }, - { 0x8901, 0xd57a, 0x2000 }, - { 0x0901, 0xd579, 0x0000 }, - { 0x0901, 0xd57b, 0x0000 }, - { 0x8901, 0xd57e, 0x2000 }, - { 0x0901, 0xd57d, 0x0000 }, - { 0x0901, 0xd57f, 0x0000 }, - { 0x8501, 0xd588, 0x4000 }, - { 0x8901, 0xd584, 0x3000 }, - { 0x8901, 0xd582, 0x2000 }, - { 0x0901, 0xd581, 0x0000 }, - { 0x0901, 0xd583, 0x0000 }, - { 0x8501, 0xd586, 0x2000 }, - { 0x0901, 0xd585, 0x0000 }, - { 0x0501, 0xd587, 0x0000 }, - { 0x8501, 0xd58c, 0x3000 }, - { 0x8501, 0xd58a, 0x2000 }, - { 0x0501, 0xd589, 0x0000 }, - { 0x0501, 0xd58b, 0x0000 }, - { 0x8501, 0xd58e, 0x2000 }, - { 0x0501, 0xd58d, 0x0000 }, - { 0x0501, 0xd58f, 0x0000 }, - { 0x8901, 0xd5a0, 0x5000 }, - { 0x8501, 0xd598, 0x4000 }, - { 0x8501, 0xd594, 0x3000 }, - { 0x8501, 0xd592, 0x2000 }, - { 0x0501, 0xd591, 0x0000 }, - { 0x0501, 0xd593, 0x0000 }, - { 0x8501, 0xd596, 0x2000 }, - { 0x0501, 0xd595, 0x0000 }, - { 0x0501, 0xd597, 0x0000 }, - { 0x8501, 0xd59c, 0x3000 }, - { 0x8501, 0xd59a, 0x2000 }, - { 0x0501, 0xd599, 0x0000 }, - { 0x0501, 0xd59b, 0x0000 }, - { 0x8501, 0xd59e, 0x2000 }, - { 0x0501, 0xd59d, 0x0000 }, - { 0x0501, 0xd59f, 0x0000 }, - { 0x8901, 0xd5a8, 0x4000 }, - { 0x8901, 0xd5a4, 0x3000 }, - { 0x8901, 0xd5a2, 0x2000 }, - { 0x0901, 0xd5a1, 0x0000 }, - { 0x0901, 0xd5a3, 0x0000 }, - { 0x8901, 0xd5a6, 0x2000 }, - { 0x0901, 0xd5a5, 0x0000 }, - { 0x0901, 0xd5a7, 0x0000 }, - { 0x8901, 0xd5ac, 0x3000 }, - { 0x8901, 0xd5aa, 0x2000 }, - { 0x0901, 0xd5a9, 0x0000 }, - { 0x0901, 0xd5ab, 0x0000 }, - { 0x8901, 0xd5ae, 0x2000 }, - { 0x0901, 0xd5ad, 0x0000 }, - { 0x0901, 0xd5af, 0x0000 }, - { 0x8501, 0xd5d0, 0x6000 }, - { 0x8501, 0xd5c0, 0x5000 }, - { 0x8901, 0xd5b8, 0x4000 }, - { 0x8901, 0xd5b4, 0x3000 }, - { 0x8901, 0xd5b2, 0x2000 }, - { 0x0901, 0xd5b1, 0x0000 }, - { 0x0901, 0xd5b3, 0x0000 }, - { 0x8901, 0xd5b6, 0x2000 }, - { 0x0901, 0xd5b5, 0x0000 }, - { 0x0901, 0xd5b7, 0x0000 }, - { 0x8501, 0xd5bc, 0x3000 }, - { 0x8501, 0xd5ba, 0x2000 }, - { 0x0901, 0xd5b9, 0x0000 }, - { 0x0501, 0xd5bb, 0x0000 }, - { 0x8501, 0xd5be, 0x2000 }, - { 0x0501, 0xd5bd, 0x0000 }, - { 0x0501, 0xd5bf, 0x0000 }, - { 0x8501, 0xd5c8, 0x4000 }, - { 0x8501, 0xd5c4, 0x3000 }, - { 0x8501, 0xd5c2, 0x2000 }, - { 0x0501, 0xd5c1, 0x0000 }, - { 0x0501, 0xd5c3, 0x0000 }, - { 0x8501, 0xd5c6, 0x2000 }, - { 0x0501, 0xd5c5, 0x0000 }, - { 0x0501, 0xd5c7, 0x0000 }, - { 0x8501, 0xd5cc, 0x3000 }, - { 0x8501, 0xd5ca, 0x2000 }, - { 0x0501, 0xd5c9, 0x0000 }, - { 0x0501, 0xd5cb, 0x0000 }, - { 0x8501, 0xd5ce, 0x2000 }, - { 0x0501, 0xd5cd, 0x0000 }, - { 0x0501, 0xd5cf, 0x0000 }, - { 0x8901, 0xd5e0, 0x5000 }, - { 0x8901, 0xd5d8, 0x4000 }, - { 0x8901, 0xd5d4, 0x3000 }, - { 0x8501, 0xd5d2, 0x2000 }, - { 0x0501, 0xd5d1, 0x0000 }, - { 0x0501, 0xd5d3, 0x0000 }, - { 0x8901, 0xd5d6, 0x2000 }, - { 0x0901, 0xd5d5, 0x0000 }, - { 0x0901, 0xd5d7, 0x0000 }, - { 0x8901, 0xd5dc, 0x3000 }, - { 0x8901, 0xd5da, 0x2000 }, - { 0x0901, 0xd5d9, 0x0000 }, - { 0x0901, 0xd5db, 0x0000 }, - { 0x8901, 0xd5de, 0x2000 }, - { 0x0901, 0xd5dd, 0x0000 }, - { 0x0901, 0xd5df, 0x0000 }, - { 0x8901, 0xd5e8, 0x4000 }, - { 0x8901, 0xd5e4, 0x3000 }, - { 0x8901, 0xd5e2, 0x2000 }, - { 0x0901, 0xd5e1, 0x0000 }, - { 0x0901, 0xd5e3, 0x0000 }, - { 0x8901, 0xd5e6, 0x2000 }, - { 0x0901, 0xd5e5, 0x0000 }, - { 0x0901, 0xd5e7, 0x0000 }, - { 0x8901, 0xd5ec, 0x3000 }, - { 0x8901, 0xd5ea, 0x2000 }, - { 0x0901, 0xd5e9, 0x0000 }, - { 0x0901, 0xd5eb, 0x0000 }, - { 0x8501, 0xd5ee, 0x2000 }, - { 0x0901, 0xd5ed, 0x0000 }, - { 0x0501, 0xd5ef, 0x0000 }, - { 0x8501, 0xd630, 0x7000 }, - { 0x8901, 0xd610, 0x6000 }, - { 0x8501, 0xd600, 0x5000 }, - { 0x8501, 0xd5f8, 0x4000 }, - { 0x8501, 0xd5f4, 0x3000 }, - { 0x8501, 0xd5f2, 0x2000 }, - { 0x0501, 0xd5f1, 0x0000 }, - { 0x0501, 0xd5f3, 0x0000 }, - { 0x8501, 0xd5f6, 0x2000 }, - { 0x0501, 0xd5f5, 0x0000 }, - { 0x0501, 0xd5f7, 0x0000 }, - { 0x8501, 0xd5fc, 0x3000 }, - { 0x8501, 0xd5fa, 0x2000 }, - { 0x0501, 0xd5f9, 0x0000 }, - { 0x0501, 0xd5fb, 0x0000 }, - { 0x8501, 0xd5fe, 0x2000 }, - { 0x0501, 0xd5fd, 0x0000 }, - { 0x0501, 0xd5ff, 0x0000 }, - { 0x8901, 0xd608, 0x4000 }, - { 0x8501, 0xd604, 0x3000 }, - { 0x8501, 0xd602, 0x2000 }, - { 0x0501, 0xd601, 0x0000 }, - { 0x0501, 0xd603, 0x0000 }, - { 0x8501, 0xd606, 0x2000 }, - { 0x0501, 0xd605, 0x0000 }, - { 0x0501, 0xd607, 0x0000 }, - { 0x8901, 0xd60c, 0x3000 }, - { 0x8901, 0xd60a, 0x2000 }, - { 0x0901, 0xd609, 0x0000 }, - { 0x0901, 0xd60b, 0x0000 }, - { 0x8901, 0xd60e, 0x2000 }, - { 0x0901, 0xd60d, 0x0000 }, - { 0x0901, 0xd60f, 0x0000 }, - { 0x8901, 0xd620, 0x5000 }, - { 0x8901, 0xd618, 0x4000 }, - { 0x8901, 0xd614, 0x3000 }, - { 0x8901, 0xd612, 0x2000 }, - { 0x0901, 0xd611, 0x0000 }, - { 0x0901, 0xd613, 0x0000 }, - { 0x8901, 0xd616, 0x2000 }, - { 0x0901, 0xd615, 0x0000 }, - { 0x0901, 0xd617, 0x0000 }, - { 0x8901, 0xd61c, 0x3000 }, - { 0x8901, 0xd61a, 0x2000 }, - { 0x0901, 0xd619, 0x0000 }, - { 0x0901, 0xd61b, 0x0000 }, - { 0x8901, 0xd61e, 0x2000 }, - { 0x0901, 0xd61d, 0x0000 }, - { 0x0901, 0xd61f, 0x0000 }, - { 0x8501, 0xd628, 0x4000 }, - { 0x8501, 0xd624, 0x3000 }, - { 0x8501, 0xd622, 0x2000 }, - { 0x0901, 0xd621, 0x0000 }, - { 0x0501, 0xd623, 0x0000 }, - { 0x8501, 0xd626, 0x2000 }, - { 0x0501, 0xd625, 0x0000 }, - { 0x0501, 0xd627, 0x0000 }, - { 0x8501, 0xd62c, 0x3000 }, - { 0x8501, 0xd62a, 0x2000 }, - { 0x0501, 0xd629, 0x0000 }, - { 0x0501, 0xd62b, 0x0000 }, - { 0x8501, 0xd62e, 0x2000 }, - { 0x0501, 0xd62d, 0x0000 }, - { 0x0501, 0xd62f, 0x0000 }, - { 0x8901, 0xd650, 0x6000 }, - { 0x8901, 0xd640, 0x5000 }, - { 0x8501, 0xd638, 0x4000 }, - { 0x8501, 0xd634, 0x3000 }, - { 0x8501, 0xd632, 0x2000 }, - { 0x0501, 0xd631, 0x0000 }, - { 0x0501, 0xd633, 0x0000 }, - { 0x8501, 0xd636, 0x2000 }, - { 0x0501, 0xd635, 0x0000 }, - { 0x0501, 0xd637, 0x0000 }, - { 0x8901, 0xd63c, 0x3000 }, - { 0x8501, 0xd63a, 0x2000 }, - { 0x0501, 0xd639, 0x0000 }, - { 0x0501, 0xd63b, 0x0000 }, - { 0x8901, 0xd63e, 0x2000 }, - { 0x0901, 0xd63d, 0x0000 }, - { 0x0901, 0xd63f, 0x0000 }, - { 0x8901, 0xd648, 0x4000 }, - { 0x8901, 0xd644, 0x3000 }, - { 0x8901, 0xd642, 0x2000 }, - { 0x0901, 0xd641, 0x0000 }, - { 0x0901, 0xd643, 0x0000 }, - { 0x8901, 0xd646, 0x2000 }, - { 0x0901, 0xd645, 0x0000 }, - { 0x0901, 0xd647, 0x0000 }, - { 0x8901, 0xd64c, 0x3000 }, - { 0x8901, 0xd64a, 0x2000 }, - { 0x0901, 0xd649, 0x0000 }, - { 0x0901, 0xd64b, 0x0000 }, - { 0x8901, 0xd64e, 0x2000 }, - { 0x0901, 0xd64d, 0x0000 }, - { 0x0901, 0xd64f, 0x0000 }, - { 0x8501, 0xd660, 0x5000 }, - { 0x8501, 0xd658, 0x4000 }, - { 0x8901, 0xd654, 0x3000 }, - { 0x8901, 0xd652, 0x2000 }, - { 0x0901, 0xd651, 0x0000 }, - { 0x0901, 0xd653, 0x0000 }, - { 0x8501, 0xd656, 0x2000 }, - { 0x0901, 0xd655, 0x0000 }, - { 0x0501, 0xd657, 0x0000 }, - { 0x8501, 0xd65c, 0x3000 }, - { 0x8501, 0xd65a, 0x2000 }, - { 0x0501, 0xd659, 0x0000 }, - { 0x0501, 0xd65b, 0x0000 }, - { 0x8501, 0xd65e, 0x2000 }, - { 0x0501, 0xd65d, 0x0000 }, - { 0x0501, 0xd65f, 0x0000 }, - { 0x8501, 0xd668, 0x4000 }, - { 0x8501, 0xd664, 0x3000 }, - { 0x8501, 0xd662, 0x2000 }, - { 0x0501, 0xd661, 0x0000 }, - { 0x0501, 0xd663, 0x0000 }, - { 0x8501, 0xd666, 0x2000 }, - { 0x0501, 0xd665, 0x0000 }, - { 0x0501, 0xd667, 0x0000 }, - { 0x8501, 0xd66c, 0x3000 }, - { 0x8501, 0xd66a, 0x2000 }, - { 0x0501, 0xd669, 0x0000 }, - { 0x0501, 0xd66b, 0x0000 }, - { 0x8501, 0xd66e, 0x2000 }, - { 0x0501, 0xd66d, 0x0000 }, - { 0x0501, 0xd66f, 0x0000 }, - { 0x8501, 0xd774, 0x9000 }, - { 0x8901, 0xd6f4, 0x8000 }, - { 0x8901, 0xd6b4, 0x7000 }, - { 0x8501, 0xd690, 0x6000 }, - { 0x8901, 0xd680, 0x5000 }, - { 0x8901, 0xd678, 0x4000 }, - { 0x8901, 0xd674, 0x3000 }, - { 0x8901, 0xd672, 0x2000 }, - { 0x0901, 0xd671, 0x0000 }, - { 0x0901, 0xd673, 0x0000 }, - { 0x8901, 0xd676, 0x2000 }, - { 0x0901, 0xd675, 0x0000 }, - { 0x0901, 0xd677, 0x0000 }, - { 0x8901, 0xd67c, 0x3000 }, - { 0x8901, 0xd67a, 0x2000 }, - { 0x0901, 0xd679, 0x0000 }, - { 0x0901, 0xd67b, 0x0000 }, - { 0x8901, 0xd67e, 0x2000 }, - { 0x0901, 0xd67d, 0x0000 }, - { 0x0901, 0xd67f, 0x0000 }, - { 0x8901, 0xd688, 0x4000 }, - { 0x8901, 0xd684, 0x3000 }, - { 0x8901, 0xd682, 0x2000 }, - { 0x0901, 0xd681, 0x0000 }, - { 0x0901, 0xd683, 0x0000 }, - { 0x8901, 0xd686, 0x2000 }, - { 0x0901, 0xd685, 0x0000 }, - { 0x0901, 0xd687, 0x0000 }, - { 0x8501, 0xd68c, 0x3000 }, - { 0x8501, 0xd68a, 0x2000 }, - { 0x0901, 0xd689, 0x0000 }, - { 0x0501, 0xd68b, 0x0000 }, - { 0x8501, 0xd68e, 0x2000 }, - { 0x0501, 0xd68d, 0x0000 }, - { 0x0501, 0xd68f, 0x0000 }, - { 0x8501, 0xd6a0, 0x5000 }, - { 0x8501, 0xd698, 0x4000 }, - { 0x8501, 0xd694, 0x3000 }, - { 0x8501, 0xd692, 0x2000 }, - { 0x0501, 0xd691, 0x0000 }, - { 0x0501, 0xd693, 0x0000 }, - { 0x8501, 0xd696, 0x2000 }, - { 0x0501, 0xd695, 0x0000 }, - { 0x0501, 0xd697, 0x0000 }, - { 0x8501, 0xd69c, 0x3000 }, - { 0x8501, 0xd69a, 0x2000 }, - { 0x0501, 0xd699, 0x0000 }, - { 0x0501, 0xd69b, 0x0000 }, - { 0x8501, 0xd69e, 0x2000 }, - { 0x0501, 0xd69d, 0x0000 }, - { 0x0501, 0xd69f, 0x0000 }, - { 0x8901, 0xd6ac, 0x4000 }, - { 0x8901, 0xd6a8, 0x3000 }, - { 0x8501, 0xd6a2, 0x2000 }, - { 0x0501, 0xd6a1, 0x0000 }, - { 0x0501, 0xd6a3, 0x0000 }, - { 0x8901, 0xd6aa, 0x2000 }, - { 0x0901, 0xd6a9, 0x0000 }, - { 0x0901, 0xd6ab, 0x0000 }, - { 0x8901, 0xd6b0, 0x3000 }, - { 0x8901, 0xd6ae, 0x2000 }, - { 0x0901, 0xd6ad, 0x0000 }, - { 0x0901, 0xd6af, 0x0000 }, - { 0x8901, 0xd6b2, 0x2000 }, - { 0x0901, 0xd6b1, 0x0000 }, - { 0x0901, 0xd6b3, 0x0000 }, - { 0x8501, 0xd6d4, 0x6000 }, - { 0x8501, 0xd6c4, 0x5000 }, - { 0x8901, 0xd6bc, 0x4000 }, - { 0x8901, 0xd6b8, 0x3000 }, - { 0x8901, 0xd6b6, 0x2000 }, - { 0x0901, 0xd6b5, 0x0000 }, - { 0x0901, 0xd6b7, 0x0000 }, - { 0x8901, 0xd6ba, 0x2000 }, - { 0x0901, 0xd6b9, 0x0000 }, - { 0x0901, 0xd6bb, 0x0000 }, - { 0x8901, 0xd6c0, 0x3000 }, - { 0x8901, 0xd6be, 0x2000 }, - { 0x0901, 0xd6bd, 0x0000 }, - { 0x0901, 0xd6bf, 0x0000 }, - { 0x8501, 0xd6c2, 0x2000 }, - { 0x1901, 0xd6c1, 0x0000 }, - { 0x0501, 0xd6c3, 0x0000 }, - { 0x8501, 0xd6cc, 0x4000 }, - { 0x8501, 0xd6c8, 0x3000 }, - { 0x8501, 0xd6c6, 0x2000 }, - { 0x0501, 0xd6c5, 0x0000 }, - { 0x0501, 0xd6c7, 0x0000 }, - { 0x8501, 0xd6ca, 0x2000 }, - { 0x0501, 0xd6c9, 0x0000 }, - { 0x0501, 0xd6cb, 0x0000 }, - { 0x8501, 0xd6d0, 0x3000 }, - { 0x8501, 0xd6ce, 0x2000 }, - { 0x0501, 0xd6cd, 0x0000 }, - { 0x0501, 0xd6cf, 0x0000 }, - { 0x8501, 0xd6d2, 0x2000 }, - { 0x0501, 0xd6d1, 0x0000 }, - { 0x0501, 0xd6d3, 0x0000 }, - { 0x8901, 0xd6e4, 0x5000 }, - { 0x8501, 0xd6dc, 0x4000 }, - { 0x8501, 0xd6d8, 0x3000 }, - { 0x8501, 0xd6d6, 0x2000 }, - { 0x0501, 0xd6d5, 0x0000 }, - { 0x0501, 0xd6d7, 0x0000 }, - { 0x8501, 0xd6da, 0x2000 }, - { 0x0501, 0xd6d9, 0x0000 }, - { 0x1901, 0xd6db, 0x0000 }, - { 0x8501, 0xd6e0, 0x3000 }, - { 0x8501, 0xd6de, 0x2000 }, - { 0x0501, 0xd6dd, 0x0000 }, - { 0x0501, 0xd6df, 0x0000 }, - { 0x8901, 0xd6e2, 0x2000 }, - { 0x0501, 0xd6e1, 0x0000 }, - { 0x0901, 0xd6e3, 0x0000 }, - { 0x8901, 0xd6ec, 0x4000 }, - { 0x8901, 0xd6e8, 0x3000 }, - { 0x8901, 0xd6e6, 0x2000 }, - { 0x0901, 0xd6e5, 0x0000 }, - { 0x0901, 0xd6e7, 0x0000 }, - { 0x8901, 0xd6ea, 0x2000 }, - { 0x0901, 0xd6e9, 0x0000 }, - { 0x0901, 0xd6eb, 0x0000 }, - { 0x8901, 0xd6f0, 0x3000 }, - { 0x8901, 0xd6ee, 0x2000 }, - { 0x0901, 0xd6ed, 0x0000 }, - { 0x0901, 0xd6ef, 0x0000 }, - { 0x8901, 0xd6f2, 0x2000 }, - { 0x0901, 0xd6f1, 0x0000 }, - { 0x0901, 0xd6f3, 0x0000 }, - { 0x8901, 0xd734, 0x7000 }, - { 0x8501, 0xd714, 0x6000 }, - { 0x8501, 0xd704, 0x5000 }, - { 0x8501, 0xd6fc, 0x4000 }, - { 0x8901, 0xd6f8, 0x3000 }, - { 0x8901, 0xd6f6, 0x2000 }, - { 0x0901, 0xd6f5, 0x0000 }, - { 0x0901, 0xd6f7, 0x0000 }, - { 0x8901, 0xd6fa, 0x2000 }, - { 0x0901, 0xd6f9, 0x0000 }, - { 0x1901, 0xd6fb, 0x0000 }, - { 0x8501, 0xd700, 0x3000 }, - { 0x8501, 0xd6fe, 0x2000 }, - { 0x0501, 0xd6fd, 0x0000 }, - { 0x0501, 0xd6ff, 0x0000 }, - { 0x8501, 0xd702, 0x2000 }, - { 0x0501, 0xd701, 0x0000 }, - { 0x0501, 0xd703, 0x0000 }, - { 0x8501, 0xd70c, 0x4000 }, - { 0x8501, 0xd708, 0x3000 }, - { 0x8501, 0xd706, 0x2000 }, - { 0x0501, 0xd705, 0x0000 }, - { 0x0501, 0xd707, 0x0000 }, - { 0x8501, 0xd70a, 0x2000 }, - { 0x0501, 0xd709, 0x0000 }, - { 0x0501, 0xd70b, 0x0000 }, - { 0x8501, 0xd710, 0x3000 }, - { 0x8501, 0xd70e, 0x2000 }, - { 0x0501, 0xd70d, 0x0000 }, - { 0x0501, 0xd70f, 0x0000 }, - { 0x8501, 0xd712, 0x2000 }, - { 0x0501, 0xd711, 0x0000 }, - { 0x0501, 0xd713, 0x0000 }, - { 0x8901, 0xd724, 0x5000 }, - { 0x8901, 0xd71c, 0x4000 }, - { 0x8501, 0xd718, 0x3000 }, - { 0x8501, 0xd716, 0x2000 }, - { 0x1901, 0xd715, 0x0000 }, - { 0x0501, 0xd717, 0x0000 }, - { 0x8501, 0xd71a, 0x2000 }, - { 0x0501, 0xd719, 0x0000 }, - { 0x0501, 0xd71b, 0x0000 }, - { 0x8901, 0xd720, 0x3000 }, - { 0x8901, 0xd71e, 0x2000 }, - { 0x0901, 0xd71d, 0x0000 }, - { 0x0901, 0xd71f, 0x0000 }, - { 0x8901, 0xd722, 0x2000 }, - { 0x0901, 0xd721, 0x0000 }, - { 0x0901, 0xd723, 0x0000 }, - { 0x8901, 0xd72c, 0x4000 }, - { 0x8901, 0xd728, 0x3000 }, - { 0x8901, 0xd726, 0x2000 }, - { 0x0901, 0xd725, 0x0000 }, - { 0x0901, 0xd727, 0x0000 }, - { 0x8901, 0xd72a, 0x2000 }, - { 0x0901, 0xd729, 0x0000 }, - { 0x0901, 0xd72b, 0x0000 }, - { 0x8901, 0xd730, 0x3000 }, - { 0x8901, 0xd72e, 0x2000 }, - { 0x0901, 0xd72d, 0x0000 }, - { 0x0901, 0xd72f, 0x0000 }, - { 0x8901, 0xd732, 0x2000 }, - { 0x0901, 0xd731, 0x0000 }, - { 0x0901, 0xd733, 0x0000 }, - { 0x8501, 0xd754, 0x6000 }, - { 0x8501, 0xd744, 0x5000 }, - { 0x8501, 0xd73c, 0x4000 }, - { 0x8501, 0xd738, 0x3000 }, - { 0x8501, 0xd736, 0x2000 }, - { 0x1901, 0xd735, 0x0000 }, - { 0x0501, 0xd737, 0x0000 }, - { 0x8501, 0xd73a, 0x2000 }, - { 0x0501, 0xd739, 0x0000 }, - { 0x0501, 0xd73b, 0x0000 }, - { 0x8501, 0xd740, 0x3000 }, - { 0x8501, 0xd73e, 0x2000 }, - { 0x0501, 0xd73d, 0x0000 }, - { 0x0501, 0xd73f, 0x0000 }, - { 0x8501, 0xd742, 0x2000 }, - { 0x0501, 0xd741, 0x0000 }, - { 0x0501, 0xd743, 0x0000 }, - { 0x8501, 0xd74c, 0x4000 }, - { 0x8501, 0xd748, 0x3000 }, - { 0x8501, 0xd746, 0x2000 }, - { 0x0501, 0xd745, 0x0000 }, - { 0x0501, 0xd747, 0x0000 }, - { 0x8501, 0xd74a, 0x2000 }, - { 0x0501, 0xd749, 0x0000 }, - { 0x0501, 0xd74b, 0x0000 }, - { 0x8501, 0xd750, 0x3000 }, - { 0x8501, 0xd74e, 0x2000 }, - { 0x0501, 0xd74d, 0x0000 }, - { 0x1901, 0xd74f, 0x0000 }, - { 0x8501, 0xd752, 0x2000 }, - { 0x0501, 0xd751, 0x0000 }, - { 0x0501, 0xd753, 0x0000 }, - { 0x8901, 0xd764, 0x5000 }, - { 0x8901, 0xd75c, 0x4000 }, - { 0x8901, 0xd758, 0x3000 }, - { 0x8901, 0xd756, 0x2000 }, - { 0x0501, 0xd755, 0x0000 }, - { 0x0901, 0xd757, 0x0000 }, - { 0x8901, 0xd75a, 0x2000 }, - { 0x0901, 0xd759, 0x0000 }, - { 0x0901, 0xd75b, 0x0000 }, - { 0x8901, 0xd760, 0x3000 }, - { 0x8901, 0xd75e, 0x2000 }, - { 0x0901, 0xd75d, 0x0000 }, - { 0x0901, 0xd75f, 0x0000 }, - { 0x8901, 0xd762, 0x2000 }, - { 0x0901, 0xd761, 0x0000 }, - { 0x0901, 0xd763, 0x0000 }, - { 0x8901, 0xd76c, 0x4000 }, - { 0x8901, 0xd768, 0x3000 }, - { 0x8901, 0xd766, 0x2000 }, - { 0x0901, 0xd765, 0x0000 }, - { 0x0901, 0xd767, 0x0000 }, - { 0x8901, 0xd76a, 0x2000 }, - { 0x0901, 0xd769, 0x0000 }, - { 0x0901, 0xd76b, 0x0000 }, - { 0x8501, 0xd770, 0x3000 }, - { 0x8901, 0xd76e, 0x2000 }, - { 0x0901, 0xd76d, 0x0000 }, - { 0x1901, 0xd76f, 0x0000 }, - { 0x8501, 0xd772, 0x2000 }, - { 0x0501, 0xd771, 0x0000 }, - { 0x0501, 0xd773, 0x0000 }, - { 0x8d01, 0xd7f8, 0x8000 }, - { 0x8501, 0xd7b4, 0x7000 }, - { 0x8901, 0xd794, 0x6000 }, - { 0x8501, 0xd784, 0x5000 }, - { 0x8501, 0xd77c, 0x4000 }, - { 0x8501, 0xd778, 0x3000 }, - { 0x8501, 0xd776, 0x2000 }, - { 0x0501, 0xd775, 0x0000 }, - { 0x0501, 0xd777, 0x0000 }, - { 0x8501, 0xd77a, 0x2000 }, - { 0x0501, 0xd779, 0x0000 }, - { 0x0501, 0xd77b, 0x0000 }, - { 0x8501, 0xd780, 0x3000 }, - { 0x8501, 0xd77e, 0x2000 }, - { 0x0501, 0xd77d, 0x0000 }, - { 0x0501, 0xd77f, 0x0000 }, - { 0x8501, 0xd782, 0x2000 }, - { 0x0501, 0xd781, 0x0000 }, - { 0x0501, 0xd783, 0x0000 }, - { 0x8501, 0xd78c, 0x4000 }, - { 0x8501, 0xd788, 0x3000 }, - { 0x8501, 0xd786, 0x2000 }, - { 0x0501, 0xd785, 0x0000 }, - { 0x0501, 0xd787, 0x0000 }, - { 0x8501, 0xd78a, 0x2000 }, - { 0x1901, 0xd789, 0x0000 }, - { 0x0501, 0xd78b, 0x0000 }, - { 0x8901, 0xd790, 0x3000 }, - { 0x8501, 0xd78e, 0x2000 }, - { 0x0501, 0xd78d, 0x0000 }, - { 0x0501, 0xd78f, 0x0000 }, - { 0x8901, 0xd792, 0x2000 }, - { 0x0901, 0xd791, 0x0000 }, - { 0x0901, 0xd793, 0x0000 }, - { 0x8901, 0xd7a4, 0x5000 }, - { 0x8901, 0xd79c, 0x4000 }, - { 0x8901, 0xd798, 0x3000 }, - { 0x8901, 0xd796, 0x2000 }, - { 0x0901, 0xd795, 0x0000 }, - { 0x0901, 0xd797, 0x0000 }, - { 0x8901, 0xd79a, 0x2000 }, - { 0x0901, 0xd799, 0x0000 }, - { 0x0901, 0xd79b, 0x0000 }, - { 0x8901, 0xd7a0, 0x3000 }, - { 0x8901, 0xd79e, 0x2000 }, - { 0x0901, 0xd79d, 0x0000 }, - { 0x0901, 0xd79f, 0x0000 }, - { 0x8901, 0xd7a2, 0x2000 }, - { 0x0901, 0xd7a1, 0x0000 }, - { 0x0901, 0xd7a3, 0x0000 }, - { 0x8501, 0xd7ac, 0x4000 }, - { 0x8901, 0xd7a8, 0x3000 }, - { 0x8901, 0xd7a6, 0x2000 }, - { 0x0901, 0xd7a5, 0x0000 }, - { 0x0901, 0xd7a7, 0x0000 }, - { 0x8501, 0xd7aa, 0x2000 }, - { 0x1901, 0xd7a9, 0x0000 }, - { 0x0501, 0xd7ab, 0x0000 }, - { 0x8501, 0xd7b0, 0x3000 }, - { 0x8501, 0xd7ae, 0x2000 }, - { 0x0501, 0xd7ad, 0x0000 }, - { 0x0501, 0xd7af, 0x0000 }, - { 0x8501, 0xd7b2, 0x2000 }, - { 0x0501, 0xd7b1, 0x0000 }, - { 0x0501, 0xd7b3, 0x0000 }, - { 0x8d01, 0xd7d8, 0x6000 }, - { 0x8501, 0xd7c4, 0x5000 }, - { 0x8501, 0xd7bc, 0x4000 }, - { 0x8501, 0xd7b8, 0x3000 }, - { 0x8501, 0xd7b6, 0x2000 }, - { 0x0501, 0xd7b5, 0x0000 }, - { 0x0501, 0xd7b7, 0x0000 }, - { 0x8501, 0xd7ba, 0x2000 }, - { 0x0501, 0xd7b9, 0x0000 }, - { 0x0501, 0xd7bb, 0x0000 }, - { 0x8501, 0xd7c0, 0x3000 }, - { 0x8501, 0xd7be, 0x2000 }, - { 0x0501, 0xd7bd, 0x0000 }, - { 0x0501, 0xd7bf, 0x0000 }, - { 0x8501, 0xd7c2, 0x2000 }, - { 0x0501, 0xd7c1, 0x0000 }, - { 0x1901, 0xd7c3, 0x0000 }, - { 0x8d01, 0xd7d0, 0x4000 }, - { 0x8501, 0xd7c8, 0x3000 }, - { 0x8501, 0xd7c6, 0x2000 }, - { 0x0501, 0xd7c5, 0x0000 }, - { 0x0501, 0xd7c7, 0x0000 }, - { 0x8d01, 0xd7ce, 0x2000 }, - { 0x0501, 0xd7c9, 0x0000 }, - { 0x0d01, 0xd7cf, 0x0000 }, - { 0x8d01, 0xd7d4, 0x3000 }, - { 0x8d01, 0xd7d2, 0x2000 }, - { 0x0d01, 0xd7d1, 0x0000 }, - { 0x0d01, 0xd7d3, 0x0000 }, - { 0x8d01, 0xd7d6, 0x2000 }, - { 0x0d01, 0xd7d5, 0x0000 }, - { 0x0d01, 0xd7d7, 0x0000 }, - { 0x8d01, 0xd7e8, 0x5000 }, - { 0x8d01, 0xd7e0, 0x4000 }, - { 0x8d01, 0xd7dc, 0x3000 }, - { 0x8d01, 0xd7da, 0x2000 }, - { 0x0d01, 0xd7d9, 0x0000 }, - { 0x0d01, 0xd7db, 0x0000 }, - { 0x8d01, 0xd7de, 0x2000 }, - { 0x0d01, 0xd7dd, 0x0000 }, - { 0x0d01, 0xd7df, 0x0000 }, - { 0x8d01, 0xd7e4, 0x3000 }, - { 0x8d01, 0xd7e2, 0x2000 }, - { 0x0d01, 0xd7e1, 0x0000 }, - { 0x0d01, 0xd7e3, 0x0000 }, - { 0x8d01, 0xd7e6, 0x2000 }, - { 0x0d01, 0xd7e5, 0x0000 }, - { 0x0d01, 0xd7e7, 0x0000 }, - { 0x8d01, 0xd7f0, 0x4000 }, - { 0x8d01, 0xd7ec, 0x3000 }, - { 0x8d01, 0xd7ea, 0x2000 }, - { 0x0d01, 0xd7e9, 0x0000 }, - { 0x0d01, 0xd7eb, 0x0000 }, - { 0x8d01, 0xd7ee, 0x2000 }, - { 0x0d01, 0xd7ed, 0x0000 }, - { 0x0d01, 0xd7ef, 0x0000 }, - { 0x8d01, 0xd7f4, 0x3000 }, - { 0x8d01, 0xd7f2, 0x2000 }, - { 0x0d01, 0xd7f1, 0x0000 }, - { 0x0d01, 0xd7f3, 0x0000 }, - { 0x8d01, 0xd7f6, 0x2000 }, - { 0x0d01, 0xd7f5, 0x0000 }, - { 0x0d01, 0xd7f7, 0x0000 }, - { 0x8702, 0xf836, 0x7000 }, - { 0x8702, 0xf816, 0x6000 }, - { 0x8702, 0xf806, 0x5000 }, - { 0x8702, 0x0000, 0x4000 }, - { 0x8d01, 0xd7fc, 0x3000 }, - { 0x8d01, 0xd7fa, 0x2000 }, - { 0x0d01, 0xd7f9, 0x0000 }, - { 0x0d01, 0xd7fb, 0x0000 }, - { 0x8d01, 0xd7fe, 0x2000 }, - { 0x0d01, 0xd7fd, 0x0000 }, - { 0x0d01, 0xd7ff, 0x0000 }, - { 0x8702, 0xf802, 0x3000 }, - { 0x8702, 0xf800, 0x2000 }, - { 0x0702, 0xa6d6, 0x0000 }, - { 0x0702, 0xf801, 0x0000 }, - { 0x8702, 0xf804, 0x2000 }, - { 0x0702, 0xf803, 0x0000 }, - { 0x0702, 0xf805, 0x0000 }, - { 0x8702, 0xf80e, 0x4000 }, - { 0x8702, 0xf80a, 0x3000 }, - { 0x8702, 0xf808, 0x2000 }, - { 0x0702, 0xf807, 0x0000 }, - { 0x0702, 0xf809, 0x0000 }, - { 0x8702, 0xf80c, 0x2000 }, - { 0x0702, 0xf80b, 0x0000 }, - { 0x0702, 0xf80d, 0x0000 }, - { 0x8702, 0xf812, 0x3000 }, - { 0x8702, 0xf810, 0x2000 }, - { 0x0702, 0xf80f, 0x0000 }, - { 0x0702, 0xf811, 0x0000 }, - { 0x8702, 0xf814, 0x2000 }, - { 0x0702, 0xf813, 0x0000 }, - { 0x0702, 0xf815, 0x0000 }, - { 0x8702, 0xf826, 0x5000 }, - { 0x8702, 0xf81e, 0x4000 }, - { 0x8702, 0xf81a, 0x3000 }, - { 0x8702, 0xf818, 0x2000 }, - { 0x0702, 0xf817, 0x0000 }, - { 0x0702, 0xf819, 0x0000 }, - { 0x8702, 0xf81c, 0x2000 }, - { 0x0702, 0xf81b, 0x0000 }, - { 0x0702, 0xf81d, 0x0000 }, - { 0x8702, 0xf822, 0x3000 }, - { 0x8702, 0xf820, 0x2000 }, - { 0x0702, 0xf81f, 0x0000 }, - { 0x0702, 0xf821, 0x0000 }, - { 0x8702, 0xf824, 0x2000 }, - { 0x0702, 0xf823, 0x0000 }, - { 0x0702, 0xf825, 0x0000 }, - { 0x8702, 0xf82e, 0x4000 }, - { 0x8702, 0xf82a, 0x3000 }, - { 0x8702, 0xf828, 0x2000 }, - { 0x0702, 0xf827, 0x0000 }, - { 0x0702, 0xf829, 0x0000 }, - { 0x8702, 0xf82c, 0x2000 }, - { 0x0702, 0xf82b, 0x0000 }, - { 0x0702, 0xf82d, 0x0000 }, - { 0x8702, 0xf832, 0x3000 }, - { 0x8702, 0xf830, 0x2000 }, - { 0x0702, 0xf82f, 0x0000 }, - { 0x0702, 0xf831, 0x0000 }, - { 0x8702, 0xf834, 0x2000 }, - { 0x0702, 0xf833, 0x0000 }, - { 0x0702, 0xf835, 0x0000 }, - { 0x8702, 0xf856, 0x6000 }, - { 0x8702, 0xf846, 0x5000 }, - { 0x8702, 0xf83e, 0x4000 }, - { 0x8702, 0xf83a, 0x3000 }, - { 0x8702, 0xf838, 0x2000 }, - { 0x0702, 0xf837, 0x0000 }, - { 0x0702, 0xf839, 0x0000 }, - { 0x8702, 0xf83c, 0x2000 }, - { 0x0702, 0xf83b, 0x0000 }, - { 0x0702, 0xf83d, 0x0000 }, - { 0x8702, 0xf842, 0x3000 }, - { 0x8702, 0xf840, 0x2000 }, - { 0x0702, 0xf83f, 0x0000 }, - { 0x0702, 0xf841, 0x0000 }, - { 0x8702, 0xf844, 0x2000 }, - { 0x0702, 0xf843, 0x0000 }, - { 0x0702, 0xf845, 0x0000 }, - { 0x8702, 0xf84e, 0x4000 }, - { 0x8702, 0xf84a, 0x3000 }, - { 0x8702, 0xf848, 0x2000 }, - { 0x0702, 0xf847, 0x0000 }, - { 0x0702, 0xf849, 0x0000 }, - { 0x8702, 0xf84c, 0x2000 }, - { 0x0702, 0xf84b, 0x0000 }, - { 0x0702, 0xf84d, 0x0000 }, - { 0x8702, 0xf852, 0x3000 }, - { 0x8702, 0xf850, 0x2000 }, - { 0x0702, 0xf84f, 0x0000 }, - { 0x0702, 0xf851, 0x0000 }, - { 0x8702, 0xf854, 0x2000 }, - { 0x0702, 0xf853, 0x0000 }, - { 0x0702, 0xf855, 0x0000 }, - { 0x8702, 0xf866, 0x5000 }, - { 0x8702, 0xf85e, 0x4000 }, - { 0x8702, 0xf85a, 0x3000 }, - { 0x8702, 0xf858, 0x2000 }, - { 0x0702, 0xf857, 0x0000 }, - { 0x0702, 0xf859, 0x0000 }, - { 0x8702, 0xf85c, 0x2000 }, - { 0x0702, 0xf85b, 0x0000 }, - { 0x0702, 0xf85d, 0x0000 }, - { 0x8702, 0xf862, 0x3000 }, - { 0x8702, 0xf860, 0x2000 }, - { 0x0702, 0xf85f, 0x0000 }, - { 0x0702, 0xf861, 0x0000 }, - { 0x8702, 0xf864, 0x2000 }, - { 0x0702, 0xf863, 0x0000 }, - { 0x0702, 0xf865, 0x0000 }, - { 0x8702, 0xf86e, 0x4000 }, - { 0x8702, 0xf86a, 0x3000 }, - { 0x8702, 0xf868, 0x2000 }, - { 0x0702, 0xf867, 0x0000 }, - { 0x0702, 0xf869, 0x0000 }, - { 0x8702, 0xf86c, 0x2000 }, - { 0x0702, 0xf86b, 0x0000 }, - { 0x0702, 0xf86d, 0x0000 }, - { 0x8702, 0xf872, 0x3000 }, - { 0x8702, 0xf870, 0x2000 }, - { 0x0702, 0xf86f, 0x0000 }, - { 0x0702, 0xf871, 0x0000 }, - { 0x8702, 0xf874, 0x2000 }, - { 0x0702, 0xf873, 0x0000 }, - { 0x0702, 0xf875, 0x0000 }, - { 0x8702, 0xf976, 0x9000 }, - { 0x8702, 0xf8f6, 0x8000 }, - { 0x8702, 0xf8b6, 0x7000 }, - { 0x8702, 0xf896, 0x6000 }, - { 0x8702, 0xf886, 0x5000 }, - { 0x8702, 0xf87e, 0x4000 }, - { 0x8702, 0xf87a, 0x3000 }, - { 0x8702, 0xf878, 0x2000 }, - { 0x0702, 0xf877, 0x0000 }, - { 0x0702, 0xf879, 0x0000 }, - { 0x8702, 0xf87c, 0x2000 }, - { 0x0702, 0xf87b, 0x0000 }, - { 0x0702, 0xf87d, 0x0000 }, - { 0x8702, 0xf882, 0x3000 }, - { 0x8702, 0xf880, 0x2000 }, - { 0x0702, 0xf87f, 0x0000 }, - { 0x0702, 0xf881, 0x0000 }, - { 0x8702, 0xf884, 0x2000 }, - { 0x0702, 0xf883, 0x0000 }, - { 0x0702, 0xf885, 0x0000 }, - { 0x8702, 0xf88e, 0x4000 }, - { 0x8702, 0xf88a, 0x3000 }, - { 0x8702, 0xf888, 0x2000 }, - { 0x0702, 0xf887, 0x0000 }, - { 0x0702, 0xf889, 0x0000 }, - { 0x8702, 0xf88c, 0x2000 }, - { 0x0702, 0xf88b, 0x0000 }, - { 0x0702, 0xf88d, 0x0000 }, - { 0x8702, 0xf892, 0x3000 }, - { 0x8702, 0xf890, 0x2000 }, - { 0x0702, 0xf88f, 0x0000 }, - { 0x0702, 0xf891, 0x0000 }, - { 0x8702, 0xf894, 0x2000 }, - { 0x0702, 0xf893, 0x0000 }, - { 0x0702, 0xf895, 0x0000 }, - { 0x8702, 0xf8a6, 0x5000 }, - { 0x8702, 0xf89e, 0x4000 }, - { 0x8702, 0xf89a, 0x3000 }, - { 0x8702, 0xf898, 0x2000 }, - { 0x0702, 0xf897, 0x0000 }, - { 0x0702, 0xf899, 0x0000 }, - { 0x8702, 0xf89c, 0x2000 }, - { 0x0702, 0xf89b, 0x0000 }, - { 0x0702, 0xf89d, 0x0000 }, - { 0x8702, 0xf8a2, 0x3000 }, - { 0x8702, 0xf8a0, 0x2000 }, - { 0x0702, 0xf89f, 0x0000 }, - { 0x0702, 0xf8a1, 0x0000 }, - { 0x8702, 0xf8a4, 0x2000 }, - { 0x0702, 0xf8a3, 0x0000 }, - { 0x0702, 0xf8a5, 0x0000 }, - { 0x8702, 0xf8ae, 0x4000 }, - { 0x8702, 0xf8aa, 0x3000 }, - { 0x8702, 0xf8a8, 0x2000 }, - { 0x0702, 0xf8a7, 0x0000 }, - { 0x0702, 0xf8a9, 0x0000 }, - { 0x8702, 0xf8ac, 0x2000 }, - { 0x0702, 0xf8ab, 0x0000 }, - { 0x0702, 0xf8ad, 0x0000 }, - { 0x8702, 0xf8b2, 0x3000 }, - { 0x8702, 0xf8b0, 0x2000 }, - { 0x0702, 0xf8af, 0x0000 }, - { 0x0702, 0xf8b1, 0x0000 }, - { 0x8702, 0xf8b4, 0x2000 }, - { 0x0702, 0xf8b3, 0x0000 }, - { 0x0702, 0xf8b5, 0x0000 }, - { 0x8702, 0xf8d6, 0x6000 }, - { 0x8702, 0xf8c6, 0x5000 }, - { 0x8702, 0xf8be, 0x4000 }, - { 0x8702, 0xf8ba, 0x3000 }, - { 0x8702, 0xf8b8, 0x2000 }, - { 0x0702, 0xf8b7, 0x0000 }, - { 0x0702, 0xf8b9, 0x0000 }, - { 0x8702, 0xf8bc, 0x2000 }, - { 0x0702, 0xf8bb, 0x0000 }, - { 0x0702, 0xf8bd, 0x0000 }, - { 0x8702, 0xf8c2, 0x3000 }, - { 0x8702, 0xf8c0, 0x2000 }, - { 0x0702, 0xf8bf, 0x0000 }, - { 0x0702, 0xf8c1, 0x0000 }, - { 0x8702, 0xf8c4, 0x2000 }, - { 0x0702, 0xf8c3, 0x0000 }, - { 0x0702, 0xf8c5, 0x0000 }, - { 0x8702, 0xf8ce, 0x4000 }, - { 0x8702, 0xf8ca, 0x3000 }, - { 0x8702, 0xf8c8, 0x2000 }, - { 0x0702, 0xf8c7, 0x0000 }, - { 0x0702, 0xf8c9, 0x0000 }, - { 0x8702, 0xf8cc, 0x2000 }, - { 0x0702, 0xf8cb, 0x0000 }, - { 0x0702, 0xf8cd, 0x0000 }, - { 0x8702, 0xf8d2, 0x3000 }, - { 0x8702, 0xf8d0, 0x2000 }, - { 0x0702, 0xf8cf, 0x0000 }, - { 0x0702, 0xf8d1, 0x0000 }, - { 0x8702, 0xf8d4, 0x2000 }, - { 0x0702, 0xf8d3, 0x0000 }, - { 0x0702, 0xf8d5, 0x0000 }, - { 0x8702, 0xf8e6, 0x5000 }, - { 0x8702, 0xf8de, 0x4000 }, - { 0x8702, 0xf8da, 0x3000 }, - { 0x8702, 0xf8d8, 0x2000 }, - { 0x0702, 0xf8d7, 0x0000 }, - { 0x0702, 0xf8d9, 0x0000 }, - { 0x8702, 0xf8dc, 0x2000 }, - { 0x0702, 0xf8db, 0x0000 }, - { 0x0702, 0xf8dd, 0x0000 }, - { 0x8702, 0xf8e2, 0x3000 }, - { 0x8702, 0xf8e0, 0x2000 }, - { 0x0702, 0xf8df, 0x0000 }, - { 0x0702, 0xf8e1, 0x0000 }, - { 0x8702, 0xf8e4, 0x2000 }, - { 0x0702, 0xf8e3, 0x0000 }, - { 0x0702, 0xf8e5, 0x0000 }, - { 0x8702, 0xf8ee, 0x4000 }, - { 0x8702, 0xf8ea, 0x3000 }, - { 0x8702, 0xf8e8, 0x2000 }, - { 0x0702, 0xf8e7, 0x0000 }, - { 0x0702, 0xf8e9, 0x0000 }, - { 0x8702, 0xf8ec, 0x2000 }, - { 0x0702, 0xf8eb, 0x0000 }, - { 0x0702, 0xf8ed, 0x0000 }, - { 0x8702, 0xf8f2, 0x3000 }, - { 0x8702, 0xf8f0, 0x2000 }, - { 0x0702, 0xf8ef, 0x0000 }, - { 0x0702, 0xf8f1, 0x0000 }, - { 0x8702, 0xf8f4, 0x2000 }, - { 0x0702, 0xf8f3, 0x0000 }, - { 0x0702, 0xf8f5, 0x0000 }, - { 0x8702, 0xf936, 0x7000 }, - { 0x8702, 0xf916, 0x6000 }, - { 0x8702, 0xf906, 0x5000 }, - { 0x8702, 0xf8fe, 0x4000 }, - { 0x8702, 0xf8fa, 0x3000 }, - { 0x8702, 0xf8f8, 0x2000 }, - { 0x0702, 0xf8f7, 0x0000 }, - { 0x0702, 0xf8f9, 0x0000 }, - { 0x8702, 0xf8fc, 0x2000 }, - { 0x0702, 0xf8fb, 0x0000 }, - { 0x0702, 0xf8fd, 0x0000 }, - { 0x8702, 0xf902, 0x3000 }, - { 0x8702, 0xf900, 0x2000 }, - { 0x0702, 0xf8ff, 0x0000 }, - { 0x0702, 0xf901, 0x0000 }, - { 0x8702, 0xf904, 0x2000 }, - { 0x0702, 0xf903, 0x0000 }, - { 0x0702, 0xf905, 0x0000 }, - { 0x8702, 0xf90e, 0x4000 }, - { 0x8702, 0xf90a, 0x3000 }, - { 0x8702, 0xf908, 0x2000 }, - { 0x0702, 0xf907, 0x0000 }, - { 0x0702, 0xf909, 0x0000 }, - { 0x8702, 0xf90c, 0x2000 }, - { 0x0702, 0xf90b, 0x0000 }, - { 0x0702, 0xf90d, 0x0000 }, - { 0x8702, 0xf912, 0x3000 }, - { 0x8702, 0xf910, 0x2000 }, - { 0x0702, 0xf90f, 0x0000 }, - { 0x0702, 0xf911, 0x0000 }, - { 0x8702, 0xf914, 0x2000 }, - { 0x0702, 0xf913, 0x0000 }, - { 0x0702, 0xf915, 0x0000 }, - { 0x8702, 0xf926, 0x5000 }, - { 0x8702, 0xf91e, 0x4000 }, - { 0x8702, 0xf91a, 0x3000 }, - { 0x8702, 0xf918, 0x2000 }, - { 0x0702, 0xf917, 0x0000 }, - { 0x0702, 0xf919, 0x0000 }, - { 0x8702, 0xf91c, 0x2000 }, - { 0x0702, 0xf91b, 0x0000 }, - { 0x0702, 0xf91d, 0x0000 }, - { 0x8702, 0xf922, 0x3000 }, - { 0x8702, 0xf920, 0x2000 }, - { 0x0702, 0xf91f, 0x0000 }, - { 0x0702, 0xf921, 0x0000 }, - { 0x8702, 0xf924, 0x2000 }, - { 0x0702, 0xf923, 0x0000 }, - { 0x0702, 0xf925, 0x0000 }, - { 0x8702, 0xf92e, 0x4000 }, - { 0x8702, 0xf92a, 0x3000 }, - { 0x8702, 0xf928, 0x2000 }, - { 0x0702, 0xf927, 0x0000 }, - { 0x0702, 0xf929, 0x0000 }, - { 0x8702, 0xf92c, 0x2000 }, - { 0x0702, 0xf92b, 0x0000 }, - { 0x0702, 0xf92d, 0x0000 }, - { 0x8702, 0xf932, 0x3000 }, - { 0x8702, 0xf930, 0x2000 }, - { 0x0702, 0xf92f, 0x0000 }, - { 0x0702, 0xf931, 0x0000 }, - { 0x8702, 0xf934, 0x2000 }, - { 0x0702, 0xf933, 0x0000 }, - { 0x0702, 0xf935, 0x0000 }, - { 0x8702, 0xf956, 0x6000 }, - { 0x8702, 0xf946, 0x5000 }, - { 0x8702, 0xf93e, 0x4000 }, - { 0x8702, 0xf93a, 0x3000 }, - { 0x8702, 0xf938, 0x2000 }, - { 0x0702, 0xf937, 0x0000 }, - { 0x0702, 0xf939, 0x0000 }, - { 0x8702, 0xf93c, 0x2000 }, - { 0x0702, 0xf93b, 0x0000 }, - { 0x0702, 0xf93d, 0x0000 }, - { 0x8702, 0xf942, 0x3000 }, - { 0x8702, 0xf940, 0x2000 }, - { 0x0702, 0xf93f, 0x0000 }, - { 0x0702, 0xf941, 0x0000 }, - { 0x8702, 0xf944, 0x2000 }, - { 0x0702, 0xf943, 0x0000 }, - { 0x0702, 0xf945, 0x0000 }, - { 0x8702, 0xf94e, 0x4000 }, - { 0x8702, 0xf94a, 0x3000 }, - { 0x8702, 0xf948, 0x2000 }, - { 0x0702, 0xf947, 0x0000 }, - { 0x0702, 0xf949, 0x0000 }, - { 0x8702, 0xf94c, 0x2000 }, - { 0x0702, 0xf94b, 0x0000 }, - { 0x0702, 0xf94d, 0x0000 }, - { 0x8702, 0xf952, 0x3000 }, - { 0x8702, 0xf950, 0x2000 }, - { 0x0702, 0xf94f, 0x0000 }, - { 0x0702, 0xf951, 0x0000 }, - { 0x8702, 0xf954, 0x2000 }, - { 0x0702, 0xf953, 0x0000 }, - { 0x0702, 0xf955, 0x0000 }, - { 0x8702, 0xf966, 0x5000 }, - { 0x8702, 0xf95e, 0x4000 }, - { 0x8702, 0xf95a, 0x3000 }, - { 0x8702, 0xf958, 0x2000 }, - { 0x0702, 0xf957, 0x0000 }, - { 0x0702, 0xf959, 0x0000 }, - { 0x8702, 0xf95c, 0x2000 }, - { 0x0702, 0xf95b, 0x0000 }, - { 0x0702, 0xf95d, 0x0000 }, - { 0x8702, 0xf962, 0x3000 }, - { 0x8702, 0xf960, 0x2000 }, - { 0x0702, 0xf95f, 0x0000 }, - { 0x0702, 0xf961, 0x0000 }, - { 0x8702, 0xf964, 0x2000 }, - { 0x0702, 0xf963, 0x0000 }, - { 0x0702, 0xf965, 0x0000 }, - { 0x8702, 0xf96e, 0x4000 }, - { 0x8702, 0xf96a, 0x3000 }, - { 0x8702, 0xf968, 0x2000 }, - { 0x0702, 0xf967, 0x0000 }, - { 0x0702, 0xf969, 0x0000 }, - { 0x8702, 0xf96c, 0x2000 }, - { 0x0702, 0xf96b, 0x0000 }, - { 0x0702, 0xf96d, 0x0000 }, - { 0x8702, 0xf972, 0x3000 }, - { 0x8702, 0xf970, 0x2000 }, - { 0x0702, 0xf96f, 0x0000 }, - { 0x0702, 0xf971, 0x0000 }, - { 0x8702, 0xf974, 0x2000 }, - { 0x0702, 0xf973, 0x0000 }, - { 0x0702, 0xf975, 0x0000 }, - { 0x810e, 0x0077, 0x9000 }, - { 0x8702, 0xf9f6, 0x8000 }, - { 0x8702, 0xf9b6, 0x7000 }, - { 0x8702, 0xf996, 0x6000 }, - { 0x8702, 0xf986, 0x5000 }, - { 0x8702, 0xf97e, 0x4000 }, - { 0x8702, 0xf97a, 0x3000 }, - { 0x8702, 0xf978, 0x2000 }, - { 0x0702, 0xf977, 0x0000 }, - { 0x0702, 0xf979, 0x0000 }, - { 0x8702, 0xf97c, 0x2000 }, - { 0x0702, 0xf97b, 0x0000 }, - { 0x0702, 0xf97d, 0x0000 }, - { 0x8702, 0xf982, 0x3000 }, - { 0x8702, 0xf980, 0x2000 }, - { 0x0702, 0xf97f, 0x0000 }, - { 0x0702, 0xf981, 0x0000 }, - { 0x8702, 0xf984, 0x2000 }, - { 0x0702, 0xf983, 0x0000 }, - { 0x0702, 0xf985, 0x0000 }, - { 0x8702, 0xf98e, 0x4000 }, - { 0x8702, 0xf98a, 0x3000 }, - { 0x8702, 0xf988, 0x2000 }, - { 0x0702, 0xf987, 0x0000 }, - { 0x0702, 0xf989, 0x0000 }, - { 0x8702, 0xf98c, 0x2000 }, - { 0x0702, 0xf98b, 0x0000 }, - { 0x0702, 0xf98d, 0x0000 }, - { 0x8702, 0xf992, 0x3000 }, - { 0x8702, 0xf990, 0x2000 }, - { 0x0702, 0xf98f, 0x0000 }, - { 0x0702, 0xf991, 0x0000 }, - { 0x8702, 0xf994, 0x2000 }, - { 0x0702, 0xf993, 0x0000 }, - { 0x0702, 0xf995, 0x0000 }, - { 0x8702, 0xf9a6, 0x5000 }, - { 0x8702, 0xf99e, 0x4000 }, - { 0x8702, 0xf99a, 0x3000 }, - { 0x8702, 0xf998, 0x2000 }, - { 0x0702, 0xf997, 0x0000 }, - { 0x0702, 0xf999, 0x0000 }, - { 0x8702, 0xf99c, 0x2000 }, - { 0x0702, 0xf99b, 0x0000 }, - { 0x0702, 0xf99d, 0x0000 }, - { 0x8702, 0xf9a2, 0x3000 }, - { 0x8702, 0xf9a0, 0x2000 }, - { 0x0702, 0xf99f, 0x0000 }, - { 0x0702, 0xf9a1, 0x0000 }, - { 0x8702, 0xf9a4, 0x2000 }, - { 0x0702, 0xf9a3, 0x0000 }, - { 0x0702, 0xf9a5, 0x0000 }, - { 0x8702, 0xf9ae, 0x4000 }, - { 0x8702, 0xf9aa, 0x3000 }, - { 0x8702, 0xf9a8, 0x2000 }, - { 0x0702, 0xf9a7, 0x0000 }, - { 0x0702, 0xf9a9, 0x0000 }, - { 0x8702, 0xf9ac, 0x2000 }, - { 0x0702, 0xf9ab, 0x0000 }, - { 0x0702, 0xf9ad, 0x0000 }, - { 0x8702, 0xf9b2, 0x3000 }, - { 0x8702, 0xf9b0, 0x2000 }, - { 0x0702, 0xf9af, 0x0000 }, - { 0x0702, 0xf9b1, 0x0000 }, - { 0x8702, 0xf9b4, 0x2000 }, - { 0x0702, 0xf9b3, 0x0000 }, - { 0x0702, 0xf9b5, 0x0000 }, - { 0x8702, 0xf9d6, 0x6000 }, - { 0x8702, 0xf9c6, 0x5000 }, - { 0x8702, 0xf9be, 0x4000 }, - { 0x8702, 0xf9ba, 0x3000 }, - { 0x8702, 0xf9b8, 0x2000 }, - { 0x0702, 0xf9b7, 0x0000 }, - { 0x0702, 0xf9b9, 0x0000 }, - { 0x8702, 0xf9bc, 0x2000 }, - { 0x0702, 0xf9bb, 0x0000 }, - { 0x0702, 0xf9bd, 0x0000 }, - { 0x8702, 0xf9c2, 0x3000 }, - { 0x8702, 0xf9c0, 0x2000 }, - { 0x0702, 0xf9bf, 0x0000 }, - { 0x0702, 0xf9c1, 0x0000 }, - { 0x8702, 0xf9c4, 0x2000 }, - { 0x0702, 0xf9c3, 0x0000 }, - { 0x0702, 0xf9c5, 0x0000 }, - { 0x8702, 0xf9ce, 0x4000 }, - { 0x8702, 0xf9ca, 0x3000 }, - { 0x8702, 0xf9c8, 0x2000 }, - { 0x0702, 0xf9c7, 0x0000 }, - { 0x0702, 0xf9c9, 0x0000 }, - { 0x8702, 0xf9cc, 0x2000 }, - { 0x0702, 0xf9cb, 0x0000 }, - { 0x0702, 0xf9cd, 0x0000 }, - { 0x8702, 0xf9d2, 0x3000 }, - { 0x8702, 0xf9d0, 0x2000 }, - { 0x0702, 0xf9cf, 0x0000 }, - { 0x0702, 0xf9d1, 0x0000 }, - { 0x8702, 0xf9d4, 0x2000 }, - { 0x0702, 0xf9d3, 0x0000 }, - { 0x0702, 0xf9d5, 0x0000 }, - { 0x8702, 0xf9e6, 0x5000 }, - { 0x8702, 0xf9de, 0x4000 }, - { 0x8702, 0xf9da, 0x3000 }, - { 0x8702, 0xf9d8, 0x2000 }, - { 0x0702, 0xf9d7, 0x0000 }, - { 0x0702, 0xf9d9, 0x0000 }, - { 0x8702, 0xf9dc, 0x2000 }, - { 0x0702, 0xf9db, 0x0000 }, - { 0x0702, 0xf9dd, 0x0000 }, - { 0x8702, 0xf9e2, 0x3000 }, - { 0x8702, 0xf9e0, 0x2000 }, - { 0x0702, 0xf9df, 0x0000 }, - { 0x0702, 0xf9e1, 0x0000 }, - { 0x8702, 0xf9e4, 0x2000 }, - { 0x0702, 0xf9e3, 0x0000 }, - { 0x0702, 0xf9e5, 0x0000 }, - { 0x8702, 0xf9ee, 0x4000 }, - { 0x8702, 0xf9ea, 0x3000 }, - { 0x8702, 0xf9e8, 0x2000 }, - { 0x0702, 0xf9e7, 0x0000 }, - { 0x0702, 0xf9e9, 0x0000 }, - { 0x8702, 0xf9ec, 0x2000 }, - { 0x0702, 0xf9eb, 0x0000 }, - { 0x0702, 0xf9ed, 0x0000 }, - { 0x8702, 0xf9f2, 0x3000 }, - { 0x8702, 0xf9f0, 0x2000 }, - { 0x0702, 0xf9ef, 0x0000 }, - { 0x0702, 0xf9f1, 0x0000 }, - { 0x8702, 0xf9f4, 0x2000 }, - { 0x0702, 0xf9f3, 0x0000 }, - { 0x0702, 0xf9f5, 0x0000 }, - { 0x810e, 0x0037, 0x7000 }, - { 0x8702, 0xfa16, 0x6000 }, - { 0x8702, 0xfa06, 0x5000 }, - { 0x8702, 0xf9fe, 0x4000 }, - { 0x8702, 0xf9fa, 0x3000 }, - { 0x8702, 0xf9f8, 0x2000 }, - { 0x0702, 0xf9f7, 0x0000 }, - { 0x0702, 0xf9f9, 0x0000 }, - { 0x8702, 0xf9fc, 0x2000 }, - { 0x0702, 0xf9fb, 0x0000 }, - { 0x0702, 0xf9fd, 0x0000 }, - { 0x8702, 0xfa02, 0x3000 }, - { 0x8702, 0xfa00, 0x2000 }, - { 0x0702, 0xf9ff, 0x0000 }, - { 0x0702, 0xfa01, 0x0000 }, - { 0x8702, 0xfa04, 0x2000 }, - { 0x0702, 0xfa03, 0x0000 }, - { 0x0702, 0xfa05, 0x0000 }, - { 0x8702, 0xfa0e, 0x4000 }, - { 0x8702, 0xfa0a, 0x3000 }, - { 0x8702, 0xfa08, 0x2000 }, - { 0x0702, 0xfa07, 0x0000 }, - { 0x0702, 0xfa09, 0x0000 }, - { 0x8702, 0xfa0c, 0x2000 }, - { 0x0702, 0xfa0b, 0x0000 }, - { 0x0702, 0xfa0d, 0x0000 }, - { 0x8702, 0xfa12, 0x3000 }, - { 0x8702, 0xfa10, 0x2000 }, - { 0x0702, 0xfa0f, 0x0000 }, - { 0x0702, 0xfa11, 0x0000 }, - { 0x8702, 0xfa14, 0x2000 }, - { 0x0702, 0xfa13, 0x0000 }, - { 0x0702, 0xfa15, 0x0000 }, - { 0x810e, 0x0027, 0x5000 }, - { 0x810e, 0x0001, 0x4000 }, - { 0x8702, 0xfa1a, 0x3000 }, - { 0x8702, 0xfa18, 0x2000 }, - { 0x0702, 0xfa17, 0x0000 }, - { 0x0702, 0xfa19, 0x0000 }, - { 0x8702, 0xfa1c, 0x2000 }, - { 0x0702, 0xfa1b, 0x0000 }, - { 0x0702, 0xfa1d, 0x0000 }, - { 0x810e, 0x0023, 0x3000 }, - { 0x810e, 0x0021, 0x2000 }, - { 0x010e, 0x0020, 0x0000 }, - { 0x010e, 0x0022, 0x0000 }, - { 0x810e, 0x0025, 0x2000 }, - { 0x010e, 0x0024, 0x0000 }, - { 0x010e, 0x0026, 0x0000 }, - { 0x810e, 0x002f, 0x4000 }, - { 0x810e, 0x002b, 0x3000 }, - { 0x810e, 0x0029, 0x2000 }, - { 0x010e, 0x0028, 0x0000 }, - { 0x010e, 0x002a, 0x0000 }, - { 0x810e, 0x002d, 0x2000 }, - { 0x010e, 0x002c, 0x0000 }, - { 0x010e, 0x002e, 0x0000 }, - { 0x810e, 0x0033, 0x3000 }, - { 0x810e, 0x0031, 0x2000 }, - { 0x010e, 0x0030, 0x0000 }, - { 0x010e, 0x0032, 0x0000 }, - { 0x810e, 0x0035, 0x2000 }, - { 0x010e, 0x0034, 0x0000 }, - { 0x010e, 0x0036, 0x0000 }, - { 0x810e, 0x0057, 0x6000 }, - { 0x810e, 0x0047, 0x5000 }, - { 0x810e, 0x003f, 0x4000 }, - { 0x810e, 0x003b, 0x3000 }, - { 0x810e, 0x0039, 0x2000 }, - { 0x010e, 0x0038, 0x0000 }, - { 0x010e, 0x003a, 0x0000 }, - { 0x810e, 0x003d, 0x2000 }, - { 0x010e, 0x003c, 0x0000 }, - { 0x010e, 0x003e, 0x0000 }, - { 0x810e, 0x0043, 0x3000 }, - { 0x810e, 0x0041, 0x2000 }, - { 0x010e, 0x0040, 0x0000 }, - { 0x010e, 0x0042, 0x0000 }, - { 0x810e, 0x0045, 0x2000 }, - { 0x010e, 0x0044, 0x0000 }, - { 0x010e, 0x0046, 0x0000 }, - { 0x810e, 0x004f, 0x4000 }, - { 0x810e, 0x004b, 0x3000 }, - { 0x810e, 0x0049, 0x2000 }, - { 0x010e, 0x0048, 0x0000 }, - { 0x010e, 0x004a, 0x0000 }, - { 0x810e, 0x004d, 0x2000 }, - { 0x010e, 0x004c, 0x0000 }, - { 0x010e, 0x004e, 0x0000 }, - { 0x810e, 0x0053, 0x3000 }, - { 0x810e, 0x0051, 0x2000 }, - { 0x010e, 0x0050, 0x0000 }, - { 0x010e, 0x0052, 0x0000 }, - { 0x810e, 0x0055, 0x2000 }, - { 0x010e, 0x0054, 0x0000 }, - { 0x010e, 0x0056, 0x0000 }, - { 0x810e, 0x0067, 0x5000 }, - { 0x810e, 0x005f, 0x4000 }, - { 0x810e, 0x005b, 0x3000 }, - { 0x810e, 0x0059, 0x2000 }, - { 0x010e, 0x0058, 0x0000 }, - { 0x010e, 0x005a, 0x0000 }, - { 0x810e, 0x005d, 0x2000 }, - { 0x010e, 0x005c, 0x0000 }, - { 0x010e, 0x005e, 0x0000 }, - { 0x810e, 0x0063, 0x3000 }, - { 0x810e, 0x0061, 0x2000 }, - { 0x010e, 0x0060, 0x0000 }, - { 0x010e, 0x0062, 0x0000 }, - { 0x810e, 0x0065, 0x2000 }, - { 0x010e, 0x0064, 0x0000 }, - { 0x010e, 0x0066, 0x0000 }, - { 0x810e, 0x006f, 0x4000 }, - { 0x810e, 0x006b, 0x3000 }, - { 0x810e, 0x0069, 0x2000 }, - { 0x010e, 0x0068, 0x0000 }, - { 0x010e, 0x006a, 0x0000 }, - { 0x810e, 0x006d, 0x2000 }, - { 0x010e, 0x006c, 0x0000 }, - { 0x010e, 0x006e, 0x0000 }, - { 0x810e, 0x0073, 0x3000 }, - { 0x810e, 0x0071, 0x2000 }, - { 0x010e, 0x0070, 0x0000 }, - { 0x010e, 0x0072, 0x0000 }, - { 0x810e, 0x0075, 0x2000 }, - { 0x010e, 0x0074, 0x0000 }, - { 0x010e, 0x0076, 0x0000 }, - { 0x8c0e, 0x0177, 0x8000 }, - { 0x8c0e, 0x0137, 0x7000 }, - { 0x8c0e, 0x0117, 0x6000 }, - { 0x8c0e, 0x0107, 0x5000 }, - { 0x810e, 0x007f, 0x4000 }, - { 0x810e, 0x007b, 0x3000 }, - { 0x810e, 0x0079, 0x2000 }, - { 0x010e, 0x0078, 0x0000 }, - { 0x010e, 0x007a, 0x0000 }, - { 0x810e, 0x007d, 0x2000 }, - { 0x010e, 0x007c, 0x0000 }, - { 0x010e, 0x007e, 0x0000 }, - { 0x8c0e, 0x0103, 0x3000 }, - { 0x8c0e, 0x0101, 0x2000 }, - { 0x0c0e, 0x0100, 0x0000 }, - { 0x0c0e, 0x0102, 0x0000 }, - { 0x8c0e, 0x0105, 0x2000 }, - { 0x0c0e, 0x0104, 0x0000 }, - { 0x0c0e, 0x0106, 0x0000 }, - { 0x8c0e, 0x010f, 0x4000 }, - { 0x8c0e, 0x010b, 0x3000 }, - { 0x8c0e, 0x0109, 0x2000 }, - { 0x0c0e, 0x0108, 0x0000 }, - { 0x0c0e, 0x010a, 0x0000 }, - { 0x8c0e, 0x010d, 0x2000 }, - { 0x0c0e, 0x010c, 0x0000 }, - { 0x0c0e, 0x010e, 0x0000 }, - { 0x8c0e, 0x0113, 0x3000 }, - { 0x8c0e, 0x0111, 0x2000 }, - { 0x0c0e, 0x0110, 0x0000 }, - { 0x0c0e, 0x0112, 0x0000 }, - { 0x8c0e, 0x0115, 0x2000 }, - { 0x0c0e, 0x0114, 0x0000 }, - { 0x0c0e, 0x0116, 0x0000 }, - { 0x8c0e, 0x0127, 0x5000 }, - { 0x8c0e, 0x011f, 0x4000 }, - { 0x8c0e, 0x011b, 0x3000 }, - { 0x8c0e, 0x0119, 0x2000 }, - { 0x0c0e, 0x0118, 0x0000 }, - { 0x0c0e, 0x011a, 0x0000 }, - { 0x8c0e, 0x011d, 0x2000 }, - { 0x0c0e, 0x011c, 0x0000 }, - { 0x0c0e, 0x011e, 0x0000 }, - { 0x8c0e, 0x0123, 0x3000 }, - { 0x8c0e, 0x0121, 0x2000 }, - { 0x0c0e, 0x0120, 0x0000 }, - { 0x0c0e, 0x0122, 0x0000 }, - { 0x8c0e, 0x0125, 0x2000 }, - { 0x0c0e, 0x0124, 0x0000 }, - { 0x0c0e, 0x0126, 0x0000 }, - { 0x8c0e, 0x012f, 0x4000 }, - { 0x8c0e, 0x012b, 0x3000 }, - { 0x8c0e, 0x0129, 0x2000 }, - { 0x0c0e, 0x0128, 0x0000 }, - { 0x0c0e, 0x012a, 0x0000 }, - { 0x8c0e, 0x012d, 0x2000 }, - { 0x0c0e, 0x012c, 0x0000 }, - { 0x0c0e, 0x012e, 0x0000 }, - { 0x8c0e, 0x0133, 0x3000 }, - { 0x8c0e, 0x0131, 0x2000 }, - { 0x0c0e, 0x0130, 0x0000 }, - { 0x0c0e, 0x0132, 0x0000 }, - { 0x8c0e, 0x0135, 0x2000 }, - { 0x0c0e, 0x0134, 0x0000 }, - { 0x0c0e, 0x0136, 0x0000 }, - { 0x8c0e, 0x0157, 0x6000 }, - { 0x8c0e, 0x0147, 0x5000 }, - { 0x8c0e, 0x013f, 0x4000 }, - { 0x8c0e, 0x013b, 0x3000 }, - { 0x8c0e, 0x0139, 0x2000 }, - { 0x0c0e, 0x0138, 0x0000 }, - { 0x0c0e, 0x013a, 0x0000 }, - { 0x8c0e, 0x013d, 0x2000 }, - { 0x0c0e, 0x013c, 0x0000 }, - { 0x0c0e, 0x013e, 0x0000 }, - { 0x8c0e, 0x0143, 0x3000 }, - { 0x8c0e, 0x0141, 0x2000 }, - { 0x0c0e, 0x0140, 0x0000 }, - { 0x0c0e, 0x0142, 0x0000 }, - { 0x8c0e, 0x0145, 0x2000 }, - { 0x0c0e, 0x0144, 0x0000 }, - { 0x0c0e, 0x0146, 0x0000 }, - { 0x8c0e, 0x014f, 0x4000 }, - { 0x8c0e, 0x014b, 0x3000 }, - { 0x8c0e, 0x0149, 0x2000 }, - { 0x0c0e, 0x0148, 0x0000 }, - { 0x0c0e, 0x014a, 0x0000 }, - { 0x8c0e, 0x014d, 0x2000 }, - { 0x0c0e, 0x014c, 0x0000 }, - { 0x0c0e, 0x014e, 0x0000 }, - { 0x8c0e, 0x0153, 0x3000 }, - { 0x8c0e, 0x0151, 0x2000 }, - { 0x0c0e, 0x0150, 0x0000 }, - { 0x0c0e, 0x0152, 0x0000 }, - { 0x8c0e, 0x0155, 0x2000 }, - { 0x0c0e, 0x0154, 0x0000 }, - { 0x0c0e, 0x0156, 0x0000 }, - { 0x8c0e, 0x0167, 0x5000 }, - { 0x8c0e, 0x015f, 0x4000 }, - { 0x8c0e, 0x015b, 0x3000 }, - { 0x8c0e, 0x0159, 0x2000 }, - { 0x0c0e, 0x0158, 0x0000 }, - { 0x0c0e, 0x015a, 0x0000 }, - { 0x8c0e, 0x015d, 0x2000 }, - { 0x0c0e, 0x015c, 0x0000 }, - { 0x0c0e, 0x015e, 0x0000 }, - { 0x8c0e, 0x0163, 0x3000 }, - { 0x8c0e, 0x0161, 0x2000 }, - { 0x0c0e, 0x0160, 0x0000 }, - { 0x0c0e, 0x0162, 0x0000 }, - { 0x8c0e, 0x0165, 0x2000 }, - { 0x0c0e, 0x0164, 0x0000 }, - { 0x0c0e, 0x0166, 0x0000 }, - { 0x8c0e, 0x016f, 0x4000 }, - { 0x8c0e, 0x016b, 0x3000 }, - { 0x8c0e, 0x0169, 0x2000 }, - { 0x0c0e, 0x0168, 0x0000 }, - { 0x0c0e, 0x016a, 0x0000 }, - { 0x8c0e, 0x016d, 0x2000 }, - { 0x0c0e, 0x016c, 0x0000 }, - { 0x0c0e, 0x016e, 0x0000 }, - { 0x8c0e, 0x0173, 0x3000 }, - { 0x8c0e, 0x0171, 0x2000 }, - { 0x0c0e, 0x0170, 0x0000 }, - { 0x0c0e, 0x0172, 0x0000 }, - { 0x8c0e, 0x0175, 0x2000 }, - { 0x0c0e, 0x0174, 0x0000 }, - { 0x0c0e, 0x0176, 0x0000 }, - { 0x8c0e, 0x01b7, 0x7000 }, - { 0x8c0e, 0x0197, 0x6000 }, - { 0x8c0e, 0x0187, 0x5000 }, - { 0x8c0e, 0x017f, 0x4000 }, - { 0x8c0e, 0x017b, 0x3000 }, - { 0x8c0e, 0x0179, 0x2000 }, - { 0x0c0e, 0x0178, 0x0000 }, - { 0x0c0e, 0x017a, 0x0000 }, - { 0x8c0e, 0x017d, 0x2000 }, - { 0x0c0e, 0x017c, 0x0000 }, - { 0x0c0e, 0x017e, 0x0000 }, - { 0x8c0e, 0x0183, 0x3000 }, - { 0x8c0e, 0x0181, 0x2000 }, - { 0x0c0e, 0x0180, 0x0000 }, - { 0x0c0e, 0x0182, 0x0000 }, - { 0x8c0e, 0x0185, 0x2000 }, - { 0x0c0e, 0x0184, 0x0000 }, - { 0x0c0e, 0x0186, 0x0000 }, - { 0x8c0e, 0x018f, 0x4000 }, - { 0x8c0e, 0x018b, 0x3000 }, - { 0x8c0e, 0x0189, 0x2000 }, - { 0x0c0e, 0x0188, 0x0000 }, - { 0x0c0e, 0x018a, 0x0000 }, - { 0x8c0e, 0x018d, 0x2000 }, - { 0x0c0e, 0x018c, 0x0000 }, - { 0x0c0e, 0x018e, 0x0000 }, - { 0x8c0e, 0x0193, 0x3000 }, - { 0x8c0e, 0x0191, 0x2000 }, - { 0x0c0e, 0x0190, 0x0000 }, - { 0x0c0e, 0x0192, 0x0000 }, - { 0x8c0e, 0x0195, 0x2000 }, - { 0x0c0e, 0x0194, 0x0000 }, - { 0x0c0e, 0x0196, 0x0000 }, - { 0x8c0e, 0x01a7, 0x5000 }, - { 0x8c0e, 0x019f, 0x4000 }, - { 0x8c0e, 0x019b, 0x3000 }, - { 0x8c0e, 0x0199, 0x2000 }, - { 0x0c0e, 0x0198, 0x0000 }, - { 0x0c0e, 0x019a, 0x0000 }, - { 0x8c0e, 0x019d, 0x2000 }, - { 0x0c0e, 0x019c, 0x0000 }, - { 0x0c0e, 0x019e, 0x0000 }, - { 0x8c0e, 0x01a3, 0x3000 }, - { 0x8c0e, 0x01a1, 0x2000 }, - { 0x0c0e, 0x01a0, 0x0000 }, - { 0x0c0e, 0x01a2, 0x0000 }, - { 0x8c0e, 0x01a5, 0x2000 }, - { 0x0c0e, 0x01a4, 0x0000 }, - { 0x0c0e, 0x01a6, 0x0000 }, - { 0x8c0e, 0x01af, 0x4000 }, - { 0x8c0e, 0x01ab, 0x3000 }, - { 0x8c0e, 0x01a9, 0x2000 }, - { 0x0c0e, 0x01a8, 0x0000 }, - { 0x0c0e, 0x01aa, 0x0000 }, - { 0x8c0e, 0x01ad, 0x2000 }, - { 0x0c0e, 0x01ac, 0x0000 }, - { 0x0c0e, 0x01ae, 0x0000 }, - { 0x8c0e, 0x01b3, 0x3000 }, - { 0x8c0e, 0x01b1, 0x2000 }, - { 0x0c0e, 0x01b0, 0x0000 }, - { 0x0c0e, 0x01b2, 0x0000 }, - { 0x8c0e, 0x01b5, 0x2000 }, - { 0x0c0e, 0x01b4, 0x0000 }, - { 0x0c0e, 0x01b6, 0x0000 }, - { 0x8c0e, 0x01d7, 0x6000 }, - { 0x8c0e, 0x01c7, 0x5000 }, - { 0x8c0e, 0x01bf, 0x4000 }, - { 0x8c0e, 0x01bb, 0x3000 }, - { 0x8c0e, 0x01b9, 0x2000 }, - { 0x0c0e, 0x01b8, 0x0000 }, - { 0x0c0e, 0x01ba, 0x0000 }, - { 0x8c0e, 0x01bd, 0x2000 }, - { 0x0c0e, 0x01bc, 0x0000 }, - { 0x0c0e, 0x01be, 0x0000 }, - { 0x8c0e, 0x01c3, 0x3000 }, - { 0x8c0e, 0x01c1, 0x2000 }, - { 0x0c0e, 0x01c0, 0x0000 }, - { 0x0c0e, 0x01c2, 0x0000 }, - { 0x8c0e, 0x01c5, 0x2000 }, - { 0x0c0e, 0x01c4, 0x0000 }, - { 0x0c0e, 0x01c6, 0x0000 }, - { 0x8c0e, 0x01cf, 0x4000 }, - { 0x8c0e, 0x01cb, 0x3000 }, - { 0x8c0e, 0x01c9, 0x2000 }, - { 0x0c0e, 0x01c8, 0x0000 }, - { 0x0c0e, 0x01ca, 0x0000 }, - { 0x8c0e, 0x01cd, 0x2000 }, - { 0x0c0e, 0x01cc, 0x0000 }, - { 0x0c0e, 0x01ce, 0x0000 }, - { 0x8c0e, 0x01d3, 0x3000 }, - { 0x8c0e, 0x01d1, 0x2000 }, - { 0x0c0e, 0x01d0, 0x0000 }, - { 0x0c0e, 0x01d2, 0x0000 }, - { 0x8c0e, 0x01d5, 0x2000 }, - { 0x0c0e, 0x01d4, 0x0000 }, - { 0x0c0e, 0x01d6, 0x0000 }, - { 0x8c0e, 0x01e7, 0x5000 }, - { 0x8c0e, 0x01df, 0x4000 }, - { 0x8c0e, 0x01db, 0x3000 }, - { 0x8c0e, 0x01d9, 0x2000 }, - { 0x0c0e, 0x01d8, 0x0000 }, - { 0x0c0e, 0x01da, 0x0000 }, - { 0x8c0e, 0x01dd, 0x2000 }, - { 0x0c0e, 0x01dc, 0x0000 }, - { 0x0c0e, 0x01de, 0x0000 }, - { 0x8c0e, 0x01e3, 0x3000 }, - { 0x8c0e, 0x01e1, 0x2000 }, - { 0x0c0e, 0x01e0, 0x0000 }, - { 0x0c0e, 0x01e2, 0x0000 }, - { 0x8c0e, 0x01e5, 0x2000 }, - { 0x0c0e, 0x01e4, 0x0000 }, - { 0x0c0e, 0x01e6, 0x0000 }, - { 0x8c0e, 0x01ef, 0x4000 }, - { 0x8c0e, 0x01eb, 0x3000 }, - { 0x8c0e, 0x01e9, 0x2000 }, - { 0x0c0e, 0x01e8, 0x0000 }, - { 0x0c0e, 0x01ea, 0x0000 }, - { 0x8c0e, 0x01ed, 0x2000 }, - { 0x0c0e, 0x01ec, 0x0000 }, - { 0x0c0e, 0x01ee, 0x0000 }, - { 0x830f, 0xfffd, 0x2000 }, - { 0x030f, 0x0000, 0x0000 }, - { 0x0310, 0x0000, 0x1000 }, - { 0x0310, 0xfffd, 0x0000 }, -}; diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c deleted file mode 100644 index 20a53efae57a9..0000000000000 --- a/ext/pcre/php_pcre.c +++ /dev/null @@ -1,1664 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "php_pcre.h" -#include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - -#include "ext/standard/php_string.h" - -#define PREG_PATTERN_ORDER 1 -#define PREG_SET_ORDER 2 -#define PREG_OFFSET_CAPTURE (1<<8) - -#define PREG_SPLIT_NO_EMPTY (1<<0) -#define PREG_SPLIT_DELIM_CAPTURE (1<<1) -#define PREG_SPLIT_OFFSET_CAPTURE (1<<2) - -#define PREG_REPLACE_EVAL (1<<0) - -#define PREG_GREP_INVERT (1<<0) - - -ZEND_DECLARE_MODULE_GLOBALS(pcre) - -static void php_free_pcre_cache(void *data) -{ - pcre_cache_entry *pce = (pcre_cache_entry *) data; - if (!pce) return; - pefree(pce->re, 1); -#if HAVE_SETLOCALE - if ((void*)pce->tables) pefree((void*)pce->tables, 1); - pefree(pce->locale, 1); -#endif -} - - -static void php_pcre_init_globals(zend_pcre_globals *pcre_globals TSRMLS_DC) -{ - zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1); -} - -static void php_pcre_shutdown_globals(zend_pcre_globals *pcre_globals TSRMLS_DC) -{ - zend_hash_destroy(&pcre_globals->pcre_cache); -} - - -/* {{{ PHP_MINFO_FUNCTION(pcre) */ -static PHP_MINFO_FUNCTION(pcre) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "PCRE (Perl Compatible Regular Expressions) Support", "enabled" ); - php_info_print_table_row(2, "PCRE Library Version", pcre_version() ); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(pcre) */ -static PHP_MINIT_FUNCTION(pcre) -{ - ZEND_INIT_MODULE_GLOBALS(pcre, php_pcre_init_globals, php_pcre_shutdown_globals); - - REGISTER_LONG_CONSTANT("PREG_PATTERN_ORDER", PREG_PATTERN_ORDER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_SET_ORDER", PREG_SET_ORDER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_OFFSET_CAPTURE", PREG_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_SPLIT_NO_EMPTY", PREG_SPLIT_NO_EMPTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_SPLIT_DELIM_CAPTURE", PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_SPLIT_OFFSET_CAPTURE", PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PREG_GREP_INVERT", PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */ -static PHP_MSHUTDOWN_FUNCTION(pcre) -{ -#ifndef ZTS - php_pcre_shutdown_globals(&pcre_globals TSRMLS_CC); -#endif - - return SUCCESS; -} -/* }}} */ - -#define PCRE_CACHE_SIZE 4096 - -/* {{{ static pcre_clean_cache */ -static int pcre_clean_cache(void *data, void *arg TSRMLS_DC) -{ - int *num_clean = (int *)arg; - - if (*num_clean > 0) { - (*num_clean)--; - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ pcre_get_compiled_regex_cache - */ -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC) -{ - pcre *re = NULL; - int coptions = 0; - int soptions = 0; - const char *error; - int erroffset; - char delimiter; - char start_delimiter; - char end_delimiter; - char *p, *pp; - char *pattern; - int do_study = 0; - int poptions = 0; - unsigned const char *tables = NULL; -#if HAVE_SETLOCALE - char *locale = setlocale(LC_CTYPE, NULL); -#endif - pcre_cache_entry *pce; - pcre_cache_entry new_entry; - - /* Try to lookup the cached regex entry, and if successful, just pass - back the compiled pattern, otherwise go on and compile it. */ - regex_len = strlen(regex); - if (zend_hash_find(&PCRE_G(pcre_cache), regex, regex_len+1, (void **)&pce) == SUCCESS) { - /* - * We use a quick pcre_info() check to see whether cache is corrupted, and if it - * is, we flush it and compile the pattern from scratch. - */ - if (pcre_info(pce->re, NULL, NULL) == PCRE_ERROR_BADMAGIC) { - zend_hash_clean(&PCRE_G(pcre_cache)); - } else { -#if HAVE_SETLOCALE - if (!strcmp(pce->locale, locale)) { -#endif - *extra = pce->extra; - *preg_options = pce->preg_options; - *compile_options = pce->compile_options; - return pce; -#if HAVE_SETLOCALE - } - } -#endif - } - - p = regex; - - /* Parse through the leading whitespace, and display a warning if we - get to the end without encountering a delimiter. */ - while (isspace((int)*(unsigned char *)p)) p++; - if (*p == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); - return NULL; - } - - /* Get the delimiter and display a warning if it is alphanumeric - or a backslash. */ - delimiter = *p++; - if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Delimiter must not be alphanumeric or backslash"); - return NULL; - } - - start_delimiter = delimiter; - if ((pp = strchr("([{< )]}> )]}>", delimiter))) - delimiter = pp[5]; - end_delimiter = delimiter; - - if (start_delimiter == end_delimiter) { - /* We need to iterate through the pattern, searching for the ending delimiter, - but skipping the backslashed delimiters. If the ending delimiter is not - found, display a warning. */ - pp = p; - while (*pp != 0) { - if (*pp == '\\' && pp[1] != 0) pp++; - else if (*pp == delimiter) - break; - pp++; - } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter); - return NULL; - } - } else { - /* We iterate through the pattern, searching for the matching ending - * delimiter. For each matching starting delimiter, we increment nesting - * level, and decrement it for each matching ending delimiter. If we - * reach the end of the pattern without matching, display a warning. - */ - int brackets = 1; /* brackets nesting level */ - pp = p; - while (*pp != 0) { - if (*pp == '\\' && pp[1] != 0) pp++; - else if (*pp == end_delimiter && --brackets <= 0) - break; - else if (*pp == start_delimiter) - brackets++; - pp++; - } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", end_delimiter); - return NULL; - } - } - - /* Make a copy of the actual pattern. */ - pattern = estrndup(p, pp-p); - - /* Move on to the options */ - pp++; - - /* Clear out preg options */ - *preg_options = 0; - - /* Parse through the options, setting appropriate flags. Display - a warning if we encounter an unknown modifier. */ - while (*pp != 0) { - switch (*pp++) { - /* Perl compatible options */ - case 'i': coptions |= PCRE_CASELESS; break; - case 'm': coptions |= PCRE_MULTILINE; break; - case 's': coptions |= PCRE_DOTALL; break; - case 'x': coptions |= PCRE_EXTENDED; break; - - /* PCRE specific options */ - case 'A': coptions |= PCRE_ANCHORED; break; - case 'D': coptions |= PCRE_DOLLAR_ENDONLY;break; - case 'S': do_study = 1; break; - case 'U': coptions |= PCRE_UNGREEDY; break; - case 'X': coptions |= PCRE_EXTRA; break; - case 'u': coptions |= PCRE_UTF8; break; - - /* Custom preg options */ - case 'e': poptions |= PREG_REPLACE_EVAL; break; - - case ' ': - case '\n': - break; - - default: - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]); - efree(pattern); - return NULL; - } - } - -#if HAVE_SETLOCALE - if (strcmp(locale, "C")) - tables = pcre_maketables(); -#endif - - /* Compile pattern and display a warning if compilation failed. */ - re = pcre_compile(pattern, - coptions, - &error, - &erroffset, - tables); - - if (re == NULL) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset); - efree(pattern); - return NULL; - } - - /* If study option was specified, study the pattern and - store the result in extra for passing to pcre_exec. */ - if (do_study) { - *extra = pcre_study(re, soptions, &error); - if (error != NULL) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Error while studying pattern"); - } - } - - *preg_options = poptions; - *compile_options = coptions; - - efree(pattern); - - /* - * If we reached cache limit, clean out the items from the head of the list; - * these are supposedly the oldest ones (but not necessarily the least used - * ones). - */ - if (zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) { - int num_clean = PCRE_CACHE_SIZE / 8; - zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean TSRMLS_CC); - } - - /* Store the compiled pattern and extra info in the cache. */ - new_entry.re = re; - new_entry.extra = *extra; - new_entry.preg_options = poptions; - new_entry.compile_options = coptions; -#if HAVE_SETLOCALE - new_entry.locale = pestrdup(locale, 1); - new_entry.tables = tables; -#endif - zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry, - sizeof(pcre_cache_entry), (void**)&pce); - - return pce; -} -/* }}} */ - -/* {{{ pcre_get_compiled_regex - */ -PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) -{ - int compile_options; - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex), extra, preg_options, &compile_options TSRMLS_CC); - - return pce ? pce->re : NULL; -} -/* }}} */ - -/* {{{ pcre_get_compiled_regex_ex - */ -PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC) -{ - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex), extra, preg_options, compile_options TSRMLS_CC); - - return pce ? pce->re : NULL; -} -/* }}} */ - -/* {{{ add_offset_pair */ -static inline void add_offset_pair(zval *result, char *str, int len, int offset, char *name) -{ - zval *match_pair; - - ALLOC_ZVAL(match_pair); - array_init(match_pair); - INIT_PZVAL(match_pair); - - /* Add (match, offset) to the return value */ - add_next_index_stringl(match_pair, str, len, 1); - add_next_index_long(match_pair, offset); - - if (name) { - zval_add_ref(&match_pair); - zend_hash_update(Z_ARRVAL_P(result), name, strlen(name)+1, &match_pair, sizeof(zval *), NULL); - } - zend_hash_next_index_insert(Z_ARRVAL_P(result), &match_pair, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ php_pcre_match - */ -static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) -{ - /* parameters */ - char *regex; /* Regular expression */ - char *subject; /* String to match against */ - int regex_len; - int subject_len; - zval *subpats = NULL; /* Array for subpatterns */ - long flags; /* Match control flags */ - - zval *result_set, /* Holds a set of subpatterns after - a global match */ - **match_sets = NULL; /* An array of sets of matches for each - subpattern after a global match */ - pcre *re = NULL; /* Compiled regular expression */ - pcre_extra *extra = NULL; /* Holds results of studying */ - int exoptions = 0; /* Execution options */ - int preg_options = 0; /* Custom preg options */ - int count = 0; /* Count of matched subpatterns */ - int *offsets; /* Array of subpattern offsets */ - int num_subpats; /* Number of captured subpatterns */ - int size_offsets; /* Size of the offsets array */ - long start_offset = 0; /* Where the new search starts */ - int matched; /* Has anything matched */ - int subpats_order = 0; /* Order of subpattern matches */ - int offset_capture = 0;/* Capture match offsets: yes/no */ - int g_notempty = 0; /* If the match should not be empty */ - const char **stringlist; /* Holds list of subpatterns */ - char *match; /* The current match */ - char **subpat_names = NULL;/* Array for named subpatterns */ - int i, rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ((global) ? "ssz|ll" : "ss|zll"), ®ex, ®ex_len, - &subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) { - RETURN_FALSE; - } - - if (global) - subpats_order = PREG_PATTERN_ORDER; - - if (ZEND_NUM_ARGS() > 3) { - offset_capture = flags & PREG_OFFSET_CAPTURE; - /* - * subpats_order is pre-set to pattern mode so we change it only if - * necessary. - */ - if (flags & 0xff) { - subpats_order = flags & 0xff; - } - if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) || - (!global && subpats_order != 0)) { - zend_error(E_WARNING, "Wrong value for parameter 4 in call to %s()", get_active_function_name(TSRMLS_C)); - return; - } - } - - /* Overwrite the passed-in value for subpatterns with an empty array. */ - if (subpats != NULL) { - zval_dtor(subpats); - array_init(subpats); - } - - /* Negative offset counts from the end of the string. */ - if (start_offset < 0) { - start_offset = subject_len + start_offset; - if (start_offset < 0) { - start_offset = 0; - } - } - - /* Compile regex or get it from cache. */ - if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - - /* Calculate the size of the offsets array, and allocate memory for it. */ - rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats); - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - RETURN_FALSE; - } - num_subpats++; - size_offsets = num_subpats * 3; - offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - - /* - * Build a mapping from subpattern numbers to their names. We will always - * allocate the table, even though they may be no named subpatterns. This - * avoids somewhat more complicated logic in the inner loops. - */ - subpat_names = (char **)safe_emalloc(num_subpats, sizeof(char *), 0); - memset(subpat_names, 0, sizeof(char *) * num_subpats); - { - int name_cnt = 0, name_size, ni = 0; - char *name_table; - unsigned short name_idx; - - rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &name_cnt); - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - RETURN_FALSE; - } - if (name_cnt > 0) { - int rc1, rc2; - rc1 = pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, &name_table); - rc2 = pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size); - rc = rc2 ? rc2 : rc1; - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - RETURN_FALSE; - } - - while (ni++ < name_cnt) { - name_idx = 0xff * name_table[0] + name_table[1]; - subpat_names[name_idx] = name_table + 2; - name_table += name_size; - } - } - } - - /* Allocate match sets array and initialize the values. */ - if (global && subpats_order == PREG_PATTERN_ORDER) { - match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); - for (i=0; i<num_subpats; i++) { - ALLOC_ZVAL(match_sets[i]); - array_init(match_sets[i]); - INIT_PZVAL(match_sets[i]); - } - } - - match = NULL; - matched = 0; - - do { - /* Execute the regular expression. */ - count = pcre_exec(re, extra, subject, subject_len, start_offset, - exoptions|g_notempty, offsets, size_offsets); - - /* Check for too many substrings condition. */ - if (count == 0) { - zend_error(E_NOTICE, "Matched, but too many substrings"); - count = size_offsets/3; - } - - /* If something has matched */ - if (count >= 0) { - matched++; - match = subject + offsets[0]; - - /* If subpatterns array has been passed, fill it in with values. */ - if (subpats != NULL) { - /* Try to get the list of substrings and display a warning if failed. */ - if (pcre_get_substring_list(subject, offsets, count, &stringlist) < 0) { - efree(subpat_names); - efree(offsets); - efree(re); - zend_error(E_WARNING, "Get subpatterns list failed"); - return; - } - - if (global) { /* global pattern matching */ - if (subpats_order == PREG_PATTERN_ORDER) { - /* For each subpattern, insert it into the appropriate array. */ - for (i = 0; i < count; i++) { - if (offset_capture) { - add_offset_pair(match_sets[i], (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], offsets[i<<1], NULL); - } else { - add_next_index_stringl(match_sets[i], (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], 1); - } - } - /* - * If the number of captured subpatterns on this run is - * less than the total possible number, pad the result - * arrays with empty strings. - */ - if (count < num_subpats) { - for (; i < num_subpats; i++) { - add_next_index_string(match_sets[i], "", 1); - } - } - } else { - /* Allocate the result set array */ - ALLOC_ZVAL(result_set); - array_init(result_set); - INIT_PZVAL(result_set); - - /* Add all the subpatterns to it */ - for (i = 0; i < count; i++) { - if (offset_capture) { - add_offset_pair(result_set, (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], offsets[i<<1], subpat_names[i]); - } else { - if (subpat_names[i]) { - add_assoc_stringl(result_set, subpat_names[i], (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], 1); - } - add_next_index_stringl(result_set, (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], 1); - } - } - /* And add it to the output array */ - zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &result_set, sizeof(zval *), NULL); - } - } else { /* single pattern matching */ - /* For each subpattern, insert it into the subpatterns array. */ - for (i = 0; i < count; i++) { - if (offset_capture) { - add_offset_pair(subpats, (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], - offsets[i<<1], subpat_names[i]); - } else { - if (subpat_names[i]) { - add_assoc_stringl(subpats, subpat_names[i], (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], 1); - } - add_next_index_stringl(subpats, (char *)stringlist[i], - offsets[(i<<1)+1] - offsets[i<<1], 1); - } - } - } - - pcre_free((void *) stringlist); - } - } - else { /* Failed to match */ - /* If we previously set PCRE_NOTEMPTY after a null match, - this is not necessarily the end. We need to advance - the start offset, and continue. Fudge the offset values - to achieve this, unless we're already at the end of the string. */ - if (g_notempty != 0 && start_offset < subject_len) { - offsets[0] = start_offset; - offsets[1] = start_offset + 1; - } else - break; - } - - /* If we have matched an empty string, mimic what Perl's /g options does. - This turns out to be rather cunning. First we set PCRE_NOTEMPTY and try - the match again at the same point. If this fails (picked up above) we - advance to the next character. */ - g_notempty = (offsets[1] == offsets[0])? PCRE_NOTEMPTY | PCRE_ANCHORED : 0; - - /* Advance to the position right after the last full match */ - start_offset = offsets[1]; - } while (global); - - /* Add the match sets to the output array and clean up */ - if (global && subpats_order == PREG_PATTERN_ORDER) { - for (i = 0; i < num_subpats; i++) { - if (subpat_names[i]) { - zend_hash_update(Z_ARRVAL_P(subpats), subpat_names[i], - strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL); - ZVAL_ADDREF(match_sets[i]); - } - zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &match_sets[i], sizeof(zval *), NULL); - } - efree(match_sets); - } - - efree(offsets); - efree(subpat_names); - - RETVAL_LONG(matched); -} -/* }}} */ - -/* {{{ proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]]) - Perform a Perl-style regular expression match */ -PHP_FUNCTION(preg_match) -{ - php_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]]) - Perform a Perl-style global regular expression match */ -PHP_FUNCTION(preg_match_all) -{ - php_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ preg_get_backref - */ -static int preg_get_backref(char **str, int *backref) -{ - register char in_brace = 0; - register char *walk = *str; - - if (walk[1] == 0) - return 0; - - if (*walk == '$' && walk[1] == '{') { - in_brace = 1; - walk++; - } - walk++; - - if (*walk >= '0' && *walk <= '9') { - *backref = *walk - '0'; - walk++; - } else - return 0; - - if (*walk && *walk >= '0' && *walk <= '9') { - *backref = *backref * 10 + *walk - '0'; - walk++; - } - - if (in_brace) { - if (*walk == 0 || *walk != '}') - return 0; - else - walk++; - } - - *str = walk; - return 1; -} -/* }}} */ - -/* {{{ preg_do_repl_func - */ -static int preg_do_repl_func(zval *function, char *subject, int *offsets, int count, char **result TSRMLS_DC) -{ - zval *retval_ptr; /* Function return value */ - zval **args[1]; /* Argument to pass to function */ - zval *subpats; /* Captured subpatterns */ - int result_len; /* Return value length */ - int i; - - MAKE_STD_ZVAL(subpats); - array_init(subpats); - for (i = 0; i < count; i++) - add_next_index_stringl(subpats, &subject[offsets[i<<1]], offsets[(i<<1)+1] - offsets[i<<1], 1); - args[0] = &subpats; - - if (call_user_function_ex(EG(function_table), NULL, function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { - convert_to_string_ex(&retval_ptr); - *result = estrndup(Z_STRVAL_P(retval_ptr), Z_STRLEN_P(retval_ptr)); - result_len = Z_STRLEN_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function"); - result_len = offsets[1] - offsets[0]; - *result = estrndup(&subject[offsets[0]], result_len); - } - zval_dtor(subpats); - FREE_ZVAL(subpats); - - return result_len; -} -/* }}} */ - -/* {{{ preg_do_eval - */ -static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, - int *offsets, int count, char **result TSRMLS_DC) -{ - zval retval; /* Return value from evaluation */ - char *eval_str_end, /* End of eval string */ - *match, /* Current match for a backref */ - *esc_match, /* Quote-escaped match */ - *walk, /* Used to walk the code string */ - *segment, /* Start of segment to append while walking */ - walk_last; /* Last walked character */ - int match_len; /* Length of the match */ - int esc_match_len; /* Length of the quote-escaped match */ - int result_len; /* Length of the result of the evaluation */ - int backref; /* Current backref */ - char *compiled_string_description; - smart_str code = {0}; - - eval_str_end = eval_str + eval_str_len; - walk = segment = eval_str; - walk_last = 0; - - while (walk < eval_str_end) { - /* If found a backreference.. */ - if ('\\' == *walk || '$' == *walk) { - smart_str_appendl(&code, segment, walk - segment); - if (walk_last == '\\') { - code.c[code.len-1] = *walk++; - segment = walk; - walk_last = 0; - continue; - } - segment = walk; - if (preg_get_backref(&walk, &backref)) { - if (backref < count) { - /* Find the corresponding string match and substitute it - in instead of the backref */ - match = subject + offsets[backref<<1]; - match_len = offsets[(backref<<1)+1] - offsets[backref<<1]; - if (match_len) { - esc_match = php_addslashes_ex(match, match_len, &esc_match_len, 0, 1 TSRMLS_CC); - } else { - esc_match = match; - esc_match_len = 0; - } - } else { - esc_match = ""; - esc_match_len = 0; - match_len = 0; - } - smart_str_appendl(&code, esc_match, esc_match_len); - - segment = walk; - - /* Clean up and reassign */ - if (esc_match_len) - efree(esc_match); - continue; - } - } - walk++; - walk_last = walk[-1]; - } - smart_str_appendl(&code, segment, walk - segment); - smart_str_0(&code); - - compiled_string_description = zend_make_compiled_string_description("regexp code" TSRMLS_CC); - /* Run the code */ - if (zend_eval_string(code.c, &retval, compiled_string_description TSRMLS_CC) == FAILURE) { - efree(compiled_string_description); - php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.c); - /* zend_error() does not return in this case */ - } - efree(compiled_string_description); - convert_to_string(&retval); - - /* Save the return value and its length */ - *result = estrndup(Z_STRVAL(retval), Z_STRLEN(retval)); - result_len = Z_STRLEN(retval); - - /* Clean up */ - zval_dtor(&retval); - smart_str_free(&code); - - return result_len; -} -/* }}} */ - -/* {{{ php_pcre_replace - */ -PHPAPI char *php_pcre_replace(char *regex, int regex_len, - char *subject, int subject_len, - zval *replace_val, int is_callable_replace, - int *result_len, int limit, int *replace_count TSRMLS_DC) -{ - pcre *re = NULL; /* Compiled regular expression */ - pcre_extra *extra = NULL; /* Holds results of studying */ - int exoptions = 0; /* Execution options */ - int preg_options = 0; /* Custom preg options */ - int count = 0; /* Count of matched subpatterns */ - int *offsets; /* Array of subpattern offsets */ - int size_offsets; /* Size of the offsets array */ - int new_len; /* Length of needed storage */ - int alloc_len; /* Actual allocated length */ - int eval_result_len=0; /* Length of the eval'ed or - function-returned string */ - int match_len; /* Length of the current match */ - int backref; /* Backreference number */ - int eval; /* If the replacement string should be eval'ed */ - int start_offset; /* Where the new search starts */ - int g_notempty=0; /* If the match should not be empty */ - int replace_len=0; /* Length of replacement string */ - char *result, /* Result of replacement */ - *replace=NULL, /* Replacement string */ - *new_buf, /* Temporary buffer for re-allocation */ - *walkbuf, /* Location of current replacement in the result */ - *walk, /* Used to walk the replacement string */ - *match, /* The current match */ - *piece, /* The current piece of subject */ - *replace_end=NULL, /* End of replacement string */ - *eval_result, /* Result of eval or custom function */ - walk_last; /* Last walked character */ - int rc; - - /* Compile regex or get it from cache. */ - if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options TSRMLS_CC)) == NULL) { - return NULL; - } - - eval = preg_options & PREG_REPLACE_EVAL; - if (is_callable_replace) { - if (eval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "/e modifier cannot be used with replacement callback"); - return NULL; - } - } else { - replace = Z_STRVAL_P(replace_val); - replace_len = Z_STRLEN_P(replace_val); - replace_end = replace + replace_len; - } - - /* Calculate the size of the offsets array, and allocate memory for it. */ - rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets); - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - return NULL; - } - size_offsets = (size_offsets + 1) * 3; - offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - - alloc_len = 2 * subject_len + 1; - result = safe_emalloc(alloc_len, sizeof(char), 0); - - /* Initialize */ - match = NULL; - *result_len = 0; - start_offset = 0; - - while (1) { - /* Execute the regular expression. */ - count = pcre_exec(re, extra, subject, subject_len, start_offset, - exoptions|g_notempty, offsets, size_offsets); - - /* Check for too many substrings condition. */ - if (count == 0) { - php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings"); - count = size_offsets/3; - } - - piece = subject + start_offset; - - if (count > 0 && (limit == -1 || limit > 0)) { - if (replace_count) { - ++*replace_count; - } - /* Set the match location in subject */ - match = subject + offsets[0]; - - new_len = *result_len + offsets[0] - start_offset; /* part before the match */ - - /* If evaluating, do it and add the return string's length */ - if (eval) { - eval_result_len = preg_do_eval(replace, replace_len, subject, - offsets, count, &eval_result TSRMLS_CC); - new_len += eval_result_len; - } else if (is_callable_replace) { - /* Use custom function to get replacement string and its length. */ - eval_result_len = preg_do_repl_func(replace_val, subject, offsets, - count, &eval_result TSRMLS_CC); - new_len += eval_result_len; - } else { /* do regular substitution */ - walk = replace; - walk_last = 0; - while (walk < replace_end) { - if ('\\' == *walk || '$' == *walk) { - if (walk_last == '\\') { - walk++; - walk_last = 0; - continue; - } - if (preg_get_backref(&walk, &backref)) { - if (backref < count) - new_len += offsets[(backref<<1)+1] - offsets[backref<<1]; - continue; - } - } - new_len++; - walk++; - walk_last = walk[-1]; - } - } - - if (new_len + 1 > alloc_len) { - alloc_len = 1 + alloc_len + 2 * new_len; - new_buf = emalloc(alloc_len); - memcpy(new_buf, result, *result_len); - efree(result); - result = new_buf; - } - /* copy the part of the string before the match */ - memcpy(&result[*result_len], piece, match-piece); - *result_len += match-piece; - - /* copy replacement and backrefs */ - walkbuf = result + *result_len; - - /* If evaluating or using custom function, copy result to the buffer - * and clean up. */ - if (eval || is_callable_replace) { - memcpy(walkbuf, eval_result, eval_result_len); - *result_len += eval_result_len; - STR_FREE(eval_result); - } else { /* do regular backreference copying */ - walk = replace; - walk_last = 0; - while (walk < replace_end) { - if ('\\' == *walk || '$' == *walk) { - if (walk_last == '\\') { - *(walkbuf-1) = *walk++; - walk_last = 0; - continue; - } - if (preg_get_backref(&walk, &backref)) { - if (backref < count) { - match_len = offsets[(backref<<1)+1] - offsets[backref<<1]; - memcpy(walkbuf, subject + offsets[backref<<1], match_len); - walkbuf += match_len; - } - continue; - } - } - *walkbuf++ = *walk++; - walk_last = walk[-1]; - } - *walkbuf = '\0'; - /* increment the result length by how much we've added to the string */ - *result_len += walkbuf - (result + *result_len); - } - - if (limit != -1) - limit--; - - } else { /* Failed to match */ - /* If we previously set PCRE_NOTEMPTY after a null match, - this is not necessarily the end. We need to advance - the start offset, and continue. Fudge the offset values - to achieve this, unless we're already at the end of the string. */ - if (g_notempty != 0 && start_offset < subject_len) { - offsets[0] = start_offset; - offsets[1] = start_offset + 1; - memcpy(&result[*result_len], piece, 1); - (*result_len)++; - } else { - new_len = *result_len + subject_len - start_offset; - if (new_len + 1 > alloc_len) { - alloc_len = new_len + 1; /* now we know exactly how long it is */ - new_buf = safe_emalloc(alloc_len, sizeof(char), 0); - memcpy(new_buf, result, *result_len); - efree(result); - result = new_buf; - } - /* stick that last bit of string on our output */ - memcpy(&result[*result_len], piece, subject_len - start_offset); - *result_len += subject_len - start_offset; - result[*result_len] = '\0'; - break; - } - } - - /* If we have matched an empty string, mimic what Perl's /g options does. - This turns out to be rather cunning. First we set PCRE_NOTEMPTY and try - the match again at the same point. If this fails (picked up above) we - advance to the next character. */ - g_notempty = (offsets[1] == offsets[0])? PCRE_NOTEMPTY | PCRE_ANCHORED : 0; - - /* Advance to the next piece. */ - start_offset = offsets[1]; - } - - efree(offsets); - - return result; -} -/* }}} */ - -/* {{{ php_replace_in_subject - */ -static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace, int *replace_count TSRMLS_DC) -{ - zval **regex_entry, - **replace_entry = NULL, - *replace_value, - empty_replace; - char *subject_value, - *result; - int subject_len; - - /* Make sure we're dealing with strings. */ - convert_to_string_ex(subject); - /* FIXME: This might need to be changed to STR_EMPTY_ALLOC(). Check if this zval could be dtor()'ed somehow */ - ZVAL_STRINGL(&empty_replace, "", 0, 0); - - /* If regex is an array */ - if (Z_TYPE_P(regex) == IS_ARRAY) { - /* Duplicate subject string for repeated replacement */ - subject_value = estrndup(Z_STRVAL_PP(subject), Z_STRLEN_PP(subject)); - subject_len = Z_STRLEN_PP(subject); - *result_len = subject_len; - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(regex)); - - replace_value = replace; - if (Z_TYPE_P(replace) == IS_ARRAY && !is_callable_replace) - zend_hash_internal_pointer_reset(Z_ARRVAL_P(replace)); - - /* For each entry in the regex array, get the entry */ - while (zend_hash_get_current_data(Z_ARRVAL_P(regex), (void **)®ex_entry) == SUCCESS) { - /* Make sure we're dealing with strings. */ - convert_to_string_ex(regex_entry); - - /* If replace is an array and not a callable construct */ - if (Z_TYPE_P(replace) == IS_ARRAY && !is_callable_replace) { - /* Get current entry */ - if (zend_hash_get_current_data(Z_ARRVAL_P(replace), (void **)&replace_entry) == SUCCESS) { - if (!is_callable_replace) { - convert_to_string_ex(replace_entry); - } - replace_value = *replace_entry; - zend_hash_move_forward(Z_ARRVAL_P(replace)); - } else { - /* We've run out of replacement strings, so use an empty one */ - replace_value = &empty_replace; - } - } - - /* Do the actual replacement and put the result back into subject_value - for further replacements. */ - if ((result = php_pcre_replace(Z_STRVAL_PP(regex_entry), - Z_STRLEN_PP(regex_entry), - subject_value, - subject_len, - replace_value, - is_callable_replace, - result_len, - limit, - replace_count TSRMLS_CC)) != NULL) { - efree(subject_value); - subject_value = result; - subject_len = *result_len; - } - - zend_hash_move_forward(Z_ARRVAL_P(regex)); - } - - return subject_value; - } else { - result = php_pcre_replace(Z_STRVAL_P(regex), - Z_STRLEN_P(regex), - Z_STRVAL_PP(subject), - Z_STRLEN_PP(subject), - replace, - is_callable_replace, - result_len, - limit, - replace_count TSRMLS_CC); - return result; - } -} -/* }}} */ - -/* {{{ preg_replace_impl - */ -static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callable_replace) -{ - zval **regex, - **replace, - **subject, - **limit, - **subject_entry, - **zcount; - char *result; - int result_len; - int limit_val = -1; - char *string_key; - ulong num_key; - zval callback_name; - int replace_count=0; - int *replace_count_ptr=NULL; - - /* Get function parameters and do error-checking. */ - if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 5 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), ®ex, &replace, &subject, &limit, &zcount) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (!is_callable_replace && Z_TYPE_PP(replace) == IS_ARRAY && Z_TYPE_PP(regex) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter mismatch, pattern is a string while replacement in an array."); - RETURN_FALSE; - } - - SEPARATE_ZVAL(replace); - if (Z_TYPE_PP(replace) != IS_ARRAY) - convert_to_string_ex(replace); - if (is_callable_replace) { - if (!zend_is_callable(*replace, 0, &callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "requires argument 2, '%R', to be a valid callback", Z_TYPE(callback_name), Z_UNIVAL(callback_name)); - zval_dtor(&callback_name); - *return_value = **subject; - zval_copy_ctor(return_value); - return; - } - zval_dtor(&callback_name); - } - - SEPARATE_ZVAL(regex); - SEPARATE_ZVAL(subject); - - if (ZEND_NUM_ARGS() > 3) { - convert_to_long_ex(limit); - limit_val = Z_LVAL_PP(limit); - } - if (ZEND_NUM_ARGS() > 4) { - replace_count_ptr =& replace_count; - } - - if (Z_TYPE_PP(regex) != IS_ARRAY) - convert_to_string_ex(regex); - - /* if subject is an array */ - if (Z_TYPE_PP(subject) == IS_ARRAY) { - array_init(return_value); - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(subject)); - - /* For each subject entry, convert it to string, then perform replacement - and add the result to the return_value array. */ - while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { - SEPARATE_ZVAL(subject_entry); - if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace, replace_count_ptr TSRMLS_CC)) != NULL) { - /* Add to return array */ - switch(zend_hash_get_current_key(Z_ARRVAL_PP(subject), &string_key, &num_key, 0)) - { - case HASH_KEY_IS_STRING: - add_assoc_stringl(return_value, string_key, result, result_len, 0); - break; - - case HASH_KEY_IS_LONG: - add_index_stringl(return_value, num_key, result, result_len, 0); - break; - } - } - - zend_hash_move_forward(Z_ARRVAL_PP(subject)); - } - } else { /* if subject is not an array */ - if ((result = php_replace_in_subject(*regex, *replace, subject, &result_len, limit_val, is_callable_replace, replace_count_ptr TSRMLS_CC)) != NULL) { - RETVAL_STRINGL(result, result_len, 0); - } - } - if (replace_count_ptr) { - zval_dtor(*zcount); - ZVAL_LONG(*zcount, replace_count); - } - -} -/* }}} */ - -/* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]]) - Perform Perl-style regular expression replacement. */ -PHP_FUNCTION(preg_replace) -{ - preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit [, count]]) - Perform Perl-style regular expression replacement using replacement callback. */ -PHP_FUNCTION(preg_replace_callback) -{ - preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto array preg_split(string pattern, string subject [, int limit [, int flags]]) - Split string into an array using a perl-style regular expression as a delimiter */ -PHP_FUNCTION(preg_split) -{ - zval **regex, /* Regular expression to split by */ - **subject, /* Subject string to split */ - **limit, /* Number of pieces to return */ - **flags; - pcre *re = NULL; /* Compiled regular expression */ - pcre *re_bump = NULL; /* Regex instance for empty matches */ - pcre_extra *extra = NULL; /* Holds results of studying */ - pcre_extra *extra_bump = NULL; /* Almost dummy */ - int *offsets; /* Array of subpattern offsets */ - int size_offsets; /* Size of the offsets array */ - int exoptions = 0; /* Execution options */ - int preg_options = 0; /* Custom preg options */ - int coptions = 0; /* Custom preg options */ - int argc; /* Argument count */ - int limit_val = -1; /* Integer value of limit */ - int no_empty = 0; /* If NO_EMPTY flag is set */ - int delim_capture = 0; /* If delimiters should be captured */ - int offset_capture = 0;/* If offsets should be captured */ - int count = 0; /* Count of matched subpatterns */ - int start_offset; /* Where the new search starts */ - int next_offset; /* End of the last delimiter match + 1 */ - int g_notempty = 0; /* If the match should not be empty */ - char *match, /* The current match */ - *last_match; /* Location of last match */ - int rc; - - /* Get function parameters and do error checking */ - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 4 || zend_get_parameters_ex(argc, ®ex, &subject, &limit, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 2) { - convert_to_long_ex(limit); - limit_val = Z_LVAL_PP(limit); - if (limit_val == 0) - limit_val = -1; - - if (argc > 3) { - convert_to_long_ex(flags); - no_empty = Z_LVAL_PP(flags) & PREG_SPLIT_NO_EMPTY; - delim_capture = Z_LVAL_PP(flags) & PREG_SPLIT_DELIM_CAPTURE; - offset_capture = Z_LVAL_PP(flags) & PREG_SPLIT_OFFSET_CAPTURE; - } - } - - /* Make sure we're dealing with strings */ - convert_to_string_ex(regex); - convert_to_string_ex(subject); - - /* Compile regex or get it from cache. */ - if ((re = pcre_get_compiled_regex_ex(Z_STRVAL_PP(regex), &extra, &preg_options, &coptions TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - - /* Initialize return value */ - array_init(return_value); - - /* Calculate the size of the offsets array, and allocate memory for it. */ - rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets); - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - RETURN_FALSE; - } - size_offsets = (size_offsets + 1) * 3; - offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - - /* Start at the beginning of the string */ - start_offset = 0; - next_offset = 0; - last_match = Z_STRVAL_PP(subject); - match = NULL; - - /* Get next piece if no limit or limit not yet reached and something matched*/ - while ((limit_val == -1 || limit_val > 1)) { - count = pcre_exec(re, extra, Z_STRVAL_PP(subject), - Z_STRLEN_PP(subject), start_offset, - exoptions|g_notempty, offsets, size_offsets); - - /* Check for too many substrings condition. */ - if (count == 0) { - php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings"); - count = size_offsets/3; - } - - /* If something matched */ - if (count > 0) { - match = Z_STRVAL_PP(subject) + offsets[0]; - - if (!no_empty || &Z_STRVAL_PP(subject)[offsets[0]] != last_match) { - - if (offset_capture) { - /* Add (match, offset) pair to the return value */ - add_offset_pair(return_value, last_match, &Z_STRVAL_PP(subject)[offsets[0]]-last_match, next_offset, NULL); - } else { - /* Add the piece to the return value */ - add_next_index_stringl(return_value, last_match, - &Z_STRVAL_PP(subject)[offsets[0]]-last_match, 1); - } - - /* One less left to do */ - if (limit_val != -1) - limit_val--; - } - - last_match = &Z_STRVAL_PP(subject)[offsets[1]]; - next_offset = offsets[1]; - - if (delim_capture) { - int i, match_len; - for (i = 1; i < count; i++) { - match_len = offsets[(i<<1)+1] - offsets[i<<1]; - /* If we have matched a delimiter */ - if (!no_empty || match_len > 0) { - if (offset_capture) { - add_offset_pair(return_value, &Z_STRVAL_PP(subject)[offsets[i<<1]], match_len, offsets[i<<1], NULL); - } else { - add_next_index_stringl(return_value, - &Z_STRVAL_PP(subject)[offsets[i<<1]], - match_len, 1); - } - } - } - } - } else { /* Failed to match */ - /* If we previously set PCRE_NOTEMPTY after a null match, - this is not necessarily the end. We need to advance - the start offset, and continue. Fudge the offset values - to achieve this, unless we're already at the end of the string. */ - if (g_notempty != 0 && start_offset < Z_STRLEN_PP(subject)) { - if (coptions & PCRE_UTF8) { - if (re_bump == NULL) { - int dummy; - - if ((re_bump = pcre_get_compiled_regex("/./u", &extra_bump, &dummy TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - } - count = pcre_exec(re_bump, extra_bump, Z_STRVAL_PP(subject), - Z_STRLEN_PP(subject), start_offset, - exoptions, offsets, size_offsets); - if (count < 1) { - php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Unknown error"); - offsets[0] = start_offset; - offsets[1] = start_offset + 1; - } - } else { - offsets[0] = start_offset; - offsets[1] = start_offset + 1; - } - } else - break; - } - - /* If we have matched an empty string, mimic what Perl's /g options does. - This turns out to be rather cunning. First we set PCRE_NOTEMPTY and try - the match again at the same point. If this fails (picked up above) we - advance to the next character. */ - g_notempty = (offsets[1] == offsets[0])? PCRE_NOTEMPTY | PCRE_ANCHORED : 0; - - /* Advance to the position right after the last full match */ - start_offset = offsets[1]; - } - - - if (!no_empty || start_offset != Z_STRLEN_PP(subject)) - { - if (offset_capture) { - /* Add the last (match, offset) pair to the return value */ - add_offset_pair(return_value, &Z_STRVAL_PP(subject)[start_offset], Z_STRLEN_PP(subject) - start_offset, start_offset, NULL); - } else { - /* Add the last piece to the return value */ - add_next_index_stringl(return_value, last_match, Z_STRVAL_PP(subject) + Z_STRLEN_PP(subject) - last_match, 1); - } - } - - - /* Clean up */ - efree(offsets); -} -/* }}} */ - -/* {{{ proto string preg_quote(string str, string delim_char) - Quote regular expression characters plus an optional character */ -PHP_FUNCTION(preg_quote) -{ - zval **in_str_arg; /* Input string argument */ - zval **delim; /* Additional delimiter argument */ - char *in_str, /* Input string */ - *in_str_end, /* End of the input string */ - *out_str, /* Output string with quoted characters */ - *p, /* Iterator for input string */ - *q, /* Iterator for output string */ - delim_char=0, /* Delimiter character to be quoted */ - c; /* Current character */ - zend_bool quote_delim = 0; /* Whether to quote additional delim char */ - - /* Get the arguments and check for errors */ - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 2 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &in_str_arg, &delim) == FAILURE) { - WRONG_PARAM_COUNT; - } - - /* Make sure we're working with strings */ - convert_to_string_ex(in_str_arg); - in_str = Z_STRVAL_PP(in_str_arg); - in_str_end = Z_STRVAL_PP(in_str_arg) + Z_STRLEN_PP(in_str_arg); - - /* Nothing to do if we got an empty string */ - if (in_str == in_str_end) { - RETURN_EMPTY_STRING(); - } - - if (ZEND_NUM_ARGS() == 2) { - convert_to_string_ex(delim); - if (Z_STRLEN_PP(delim) > 0) { - delim_char = Z_STRVAL_PP(delim)[0]; - quote_delim = 1; - } - } - - /* Allocate enough memory so that even if each character - is quoted, we won't run out of room */ - out_str = safe_emalloc(2, Z_STRLEN_PP(in_str_arg), 1); - - /* Go through the string and quote necessary characters */ - for(p = in_str, q = out_str; p != in_str_end; p++) { - c = *p; - switch(c) { - case '.': - case '\\': - case '+': - case '*': - case '?': - case '[': - case '^': - case ']': - case '$': - case '(': - case ')': - case '{': - case '}': - case '=': - case '!': - case '>': - case '<': - case '|': - case ':': - *q++ = '\\'; - *q++ = c; - break; - - case '\0': - *q++ = '\\'; - *q++ = '0'; - break; - - default: - if (quote_delim && c == delim_char) - *q++ = '\\'; - *q++ = c; - break; - } - } - *q = '\0'; - - /* Reallocate string and return it */ - RETVAL_STRINGL(erealloc(out_str, q - out_str + 1), q - out_str, 0); -} -/* }}} */ - -/* {{{ proto array preg_grep(string regex, array input) - Searches array and returns entries which match regex */ -PHP_FUNCTION(preg_grep) -{ - zval **regex, /* Regular expression */ - **input, /* Input array */ - **flags, - **entry; /* An entry in the input array */ - pcre *re = NULL; /* Compiled regular expression */ - pcre_extra *extra = NULL; /* Holds results of studying */ - int preg_options = 0; /* Custom preg options */ - int *offsets; /* Array of subpattern offsets */ - int size_offsets; /* Size of the offsets array */ - int count = 0; /* Count of matched subpatterns */ - char *string_key; - ulong num_key; - zend_bool invert = 0; /* Whether to return non-matching - entries */ - int rc; - - /* Get arguments and do error checking */ - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), ®ex, &input, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Second argument to preg_grep() should be an array"); - return; - } - - SEPARATE_ZVAL(input); - - /* Make sure regex is a string */ - convert_to_string_ex(regex); - - if (ZEND_NUM_ARGS() > 2) { - convert_to_long_ex(flags); - invert = (Z_LVAL_PP(flags) & PREG_GREP_INVERT) ? 1 : 0; - } - - /* Compile regex or get it from cache. */ - if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options TSRMLS_CC)) == NULL) { - RETURN_FALSE; - } - - /* Calculate the size of the offsets array, and allocate memory for it. */ - rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets); - if (rc < 0) { - php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d", - get_active_function_name(TSRMLS_C), rc); - RETURN_FALSE; - } - size_offsets = (size_offsets + 1) * 3; - offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - - /* Initialize return array */ - array_init(return_value); - - /* Go through the input array */ - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(input)); - while(zend_hash_get_current_data(Z_ARRVAL_PP(input), (void **)&entry) == SUCCESS) { - - convert_to_string_ex(entry); - - /* Perform the match */ - count = pcre_exec(re, extra, Z_STRVAL_PP(entry), - Z_STRLEN_PP(entry), 0, - 0, offsets, size_offsets); - - /* Check for too many substrings condition. */ - if (count == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings"); - count = size_offsets/3; - } - - /* If the entry fits our requirements */ - if ((count > 0 && !invert) || - (count < 0 && invert)) { - (*entry)->refcount++; - - /* Add to return array */ - switch(zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 0)) - { - case HASH_KEY_IS_STRING: - zend_hash_update(Z_ARRVAL_P(return_value), string_key, - strlen(string_key)+1, entry, sizeof(zval *), NULL); - break; - - case HASH_KEY_IS_LONG: - zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, entry, - sizeof(zval *), NULL); - break; - } - } - - zend_hash_move_forward(Z_ARRVAL_PP(input)); - } - - /* Clean up */ - efree(offsets); -} -/* }}} */ - -/* {{{ module definition structures */ - -function_entry pcre_functions[] = { - PHP_FE(preg_match, third_arg_force_ref) - PHP_FE(preg_match_all, third_arg_force_ref) - PHP_FE(preg_replace, NULL) - PHP_FE(preg_replace_callback, NULL) - PHP_FE(preg_split, NULL) - PHP_FE(preg_quote, NULL) - PHP_FE(preg_grep, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry pcre_module_entry = { - STANDARD_MODULE_HEADER, - "pcre", - pcre_functions, - PHP_MINIT(pcre), - PHP_MSHUTDOWN(pcre), - NULL, - NULL, - PHP_MINFO(pcre), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_PCRE -ZEND_GET_MODULE(pcre) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* }}} */ - -#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h deleted file mode 100644 index cc9685d09b1bc..0000000000000 --- a/ext/pcre/php_pcre.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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$ */ - -#ifndef PHP_PCRE_H -#define PHP_PCRE_H - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - -#if HAVE_BUNDLED_PCRE -#include "pcrelib/pcre.h" -#else -#include "pcre.h" -#endif - -#if HAVE_LOCALE_H -#include <locale.h> -#endif - -PHP_FUNCTION(preg_match); -PHP_FUNCTION(preg_match_all); -PHP_FUNCTION(preg_replace); -PHP_FUNCTION(preg_replace_callback); -PHP_FUNCTION(preg_split); -PHP_FUNCTION(preg_quote); -PHP_FUNCTION(preg_grep); - -PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); -PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC); -PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC); - -extern zend_module_entry pcre_module_entry; -#define pcre_module_ptr &pcre_module_entry - -typedef struct { - pcre *re; - pcre_extra *extra; - int preg_options; -#if HAVE_SETLOCALE - char *locale; - unsigned const char *tables; -#endif - int compile_options; - int refcount; -} pcre_cache_entry; - -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC); - -ZEND_BEGIN_MODULE_GLOBALS(pcre) - HashTable pcre_cache; -ZEND_END_MODULE_GLOBALS(pcre) - -#ifdef ZTS -# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v) -#else -# define PCRE_G(v) (pcre_globals.v) -#endif - -#else - -#define pcre_module_ptr NULL - -#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ - -#define phpext_pcre_ptr pcre_module_ptr - -#endif /* PHP_PCRE_H */ diff --git a/ext/pcre/tests/bug20528.phpt b/ext/pcre/tests/bug20528.phpt deleted file mode 100644 index 8182fd9bfe5a7..0000000000000 --- a/ext/pcre/tests/bug20528.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #20528 (preg_split() drops characters (re-opens Bug #15413)) ---FILE-- -<?php - $data = '(#11/19/2002#)'; - var_dump(preg_split('/\b/', $data)); -?> ---EXPECT-- -array(7) { - [0]=> - string(2) "(#" - [1]=> - string(2) "11" - [2]=> - string(1) "/" - [3]=> - string(2) "19" - [4]=> - string(1) "/" - [5]=> - string(4) "2002" - [6]=> - string(2) "#)" -} diff --git a/ext/pcre/tests/bug21732.phpt b/ext/pcre/tests/bug21732.phpt deleted file mode 100644 index 3dfc41e19fe94..0000000000000 --- a/ext/pcre/tests/bug21732.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #21732 (preg_replace() segfaults with invalid parameters) ---INI-- -error_reporting=0 ---FILE-- -<?php -class foo { - function cb($param) { - var_dump($param); - return "yes!"; - } -} - -var_dump(preg_replace('', array(), '')); -var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde')); -?> ---EXPECT-- -bool(false) -array(4) { - [0]=> - string(5) "abcde" - [1]=> - string(2) "ab" - [2]=> - string(2) "cd" - [3]=> - string(1) "e" -} -string(4) "yes!" diff --git a/ext/pcre/tests/bug26927.phpt b/ext/pcre/tests/bug26927.phpt deleted file mode 100644 index 25b6b2e572ea9..0000000000000 --- a/ext/pcre/tests/bug26927.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #26927 (preg_quote() does not escape \0) ---FILE-- -<?php - $str = "a\000b"; - $str_quoted = preg_quote($str); - var_dump(preg_match("!{$str_quoted}!", $str), $str_quoted); -?> ---EXPECT-- -int(1) -string(4) "a\0b" diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt deleted file mode 100644 index 185225d31082b..0000000000000 --- a/ext/pcre/tests/bug27103.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets) ---FILE-- -<?php -function iter($ar) -{ - foreach ($ar as $c) { - echo htmlentities($c, 0, "UTF-8"), ": ", strlen($c), "\n"; - } -} -$teststr = "\xe2\x82\xac hi there"; -iter(preg_split('//u', $teststr, -1, PREG_SPLIT_NO_EMPTY)); -preg_match_all('/./u', $teststr, $matches); -iter($matches[0]); -?> ---EXPECT-- -€: 3 - : 1 -h: 1 -i: 1 - : 1 -t: 1 -h: 1 -e: 1 -r: 1 -e: 1 -€: 3 - : 1 -h: 1 -i: 1 - : 1 -t: 1 -h: 1 -e: 1 -r: 1 -e: 1 - diff --git a/ext/pcre/tests/bug33200.phpt b/ext/pcre/tests/bug33200.phpt deleted file mode 100644 index b00b72ac28f48..0000000000000 --- a/ext/pcre/tests/bug33200.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #33200 (magic_quotes_sybase = On makes 'e' modifier misbehave) ---INI-- -magic_quotes_sybase=1 ---FILE-- -<?php -$str = 'some \'$sample\' text'; -$str = preg_replace("/(some.*text)/e", "strtoupper('\\1')", $str); -echo $str; -?> ---EXPECT-- -SOME '$SAMPLE' TEXT diff --git a/ext/pcre/tests/bug34790.phpt b/ext/pcre/tests/bug34790.phpt deleted file mode 100755 index c375ae5ac8d56..0000000000000 --- a/ext/pcre/tests/bug34790.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #34790 (preg_match_all(), named capturing groups, variable assignment/return => crash) ---FILE-- -<?php -function func1(){ - $string = 'what the word and the other word the'; - preg_match_all('/(?P<word>the)/', $string, $matches); - return $matches['word']; -} -$words = func1(); -var_dump($words); -?> ---EXPECT-- -array(4) { - [0]=> - string(3) "the" - [1]=> - string(3) "the" - [2]=> - string(3) "the" - [3]=> - string(3) "the" -} diff --git a/ext/pcre/tests/pcre_count.phpt b/ext/pcre/tests/pcre_count.phpt deleted file mode 100644 index 1239d48ffb549..0000000000000 --- a/ext/pcre/tests/pcre_count.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -preg_replace() fifth parameter - count ---FILE-- -<?php -$regex = '/(([0-9a-z]+)-([0-9]+))-(([0-9]+)-([0-9]+))/'; - -$string= '1-2-3-4 a-2-3-4 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a 4-3-2-1 100-200-300-400-500-600-700-800'; -$count = 0; -var_dump(preg_replace($regex, 'xxxx', $string, -1, $count)); -var_dump($count); -////////////////////////////////////////////////////// - -$regex = '/([a-z]+)/'; - -$string= 'Here must only number like 42 and 13 appear'; -var_dump(preg_replace($regex, 'xxxx', $string, -1, $count)); -var_dump($count); - -//////////////////////////////////////////////////////// -$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i'; - -$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/'; -var_dump(preg_replace($regex, '...', $string, -1, $count)); -var_dump($count); -//////////////////////////////////////////////////////// -$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i'; -$count = NULL; -$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/'; -var_dump(preg_replace($regex, '...', $string, -1)); -var_dump($count); -?> ---EXPECT-- -string(56) "xxxx xxxx 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a xxxx xxxx-xxxx" -int(5) -string(41) "Hxxxx xxxx xxxx xxxx xxxx 42 xxxx 13 xxxx" -int(7) -string(25) "... ... ... ... v1c0d1/|/" -int(4) -string(25) "... ... ... ... v1c0d1/|/" -NULL diff --git a/ext/pdo/CREDITS b/ext/pdo/CREDITS deleted file mode 100755 index e650219359a87..0000000000000 --- a/ext/pdo/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -PHP Data Objects -Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle diff --git a/ext/pdo/EXPERIMENTAL b/ext/pdo/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/pdo/Makefile.frag b/ext/pdo/Makefile.frag deleted file mode 100644 index 283a6e24330f7..0000000000000 --- a/ext/pdo/Makefile.frag +++ /dev/null @@ -1,26 +0,0 @@ -phpincludedir=$(prefix)/include/php - -PDO_HEADER_FILES= \ - php_pdo.h \ - php_pdo_driver.h - -install-pdo-headers: - @echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo - @for f in $(PDO_HEADER_FILES); do \ - if test -f "$(top_srcdir)/$$f"; then \ - $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \ - elif test -f "$(top_builddir)/$$f"; then \ - $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \ - elif test -f "$(top_srcdir)/ext/pdo/$$f"; then \ - $(INSTALL_DATA) $(top_srcdir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \ - elif test -f "$(top_builddir)/ext/pdo/$$f"; then \ - $(INSTALL_DATA) $(top_builddir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \ - else \ - echo "hmmm"; \ - fi \ - done; - -# mini hack -install: $(all_targets) $(install_targets) install-pdo-headers - diff --git a/ext/pdo/README b/ext/pdo/README deleted file mode 100755 index da806b0f30fc5..0000000000000 --- a/ext/pdo/README +++ /dev/null @@ -1,56 +0,0 @@ -$Id$ - -PHP Data Objects -================ - -Concept: Data Access Abstraction - -Goals: - -1/ Be light-weight -2/ Provide common API for common database operations -3/ Be performant -4/ Keep majority of PHP specific stuff in the PDO core (such as persistent - resource management); drivers should only have to worry about getting the - data and not about PHP internals. - - -Transactions and autocommit -=========================== - -When you create a database handle, you *should* specify the autocommit -behaviour that you require. PDO will default to autocommit on. - -$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true)); - -When auto-commit is on, the driver will implicitly commit each query as it is -executed. This works fine for most simple tasks but can be significantly -slower when you are making a large number of udpates. - -$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false)); - -When auto-commit is off, you must then use $dbh->beginTransaction() to -initiate a transaction. When your work is done, you then call $dbh->commit() -or $dbh->rollBack() to persist or abort your changes respectively. Not all -databases support transactions. - -You can change the auto-commit mode at run-time: - -$dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false); - -Regardless of the error handling mode set on the database handle, if the -autocommit mode cannot be changed, an exception will be thrown. - -Some drivers will allow you to temporarily disable autocommit if you call -$dbh->beginTransaction(). When you commit() or rollBack() such a transaction, -the handle will switch back to autocommit mode again. If the mode could not -be changed, an exception will be raised, as noted above. - -When the database handle is closed or destroyed (or at request end for -persistent handles), the driver will implicitly rollBack(). It is your -responsibility to call commit() when you are done making changes and -autocommit is turned off. - -vim:tw=78:et - - diff --git a/ext/pdo/TODO b/ext/pdo/TODO deleted file mode 100755 index ff3b6ed505ca7..0000000000000 --- a/ext/pdo/TODO +++ /dev/null @@ -1,21 +0,0 @@ -$Id$ - -In no particular order: - -Probable Bugs: -- persistent connections with bound parameters might segv on subsequent - requests - -Low-level: - -- $dbh->quote() -- LOB support via Streams API -- make errors generated at the pdo level (as opposed to driver level) use the - selected error mode. - -Not-so-low-level: -- fetchAll(), single row, single column fetches etc. - -Could be more... - -vim:tw=78:et diff --git a/ext/pdo/config.m4 b/ext/pdo/config.m4 deleted file mode 100755 index 71379a338cab1..0000000000000 --- a/ext/pdo/config.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension pdo -dnl vim:se ts=2 sw=2 et: - -AC_DEFUN([PHP_PDO_PEAR_CHECK],[ - pdo_running_under_pear=0 - case `pwd` in - /var/tmp/pear-build-*) - pdo_running_under_pear=1 - ;; - esac - - if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then - # we're running in an environment that smells like pear, - # and the PHP_PEAR_VERSION env var is not set. That implies - # that we're running under a slightly broken pear installer - AC_MSG_ERROR([ -PDO requires that you upgrade your PEAR installer tools. Please -do so now by running: - - % sudo pear upgrade pear - -or by manually downloading and installing PEAR version 1.3.5 or higher. - -Once you've upgraded, please re-try your PDO install. - ]) - fi -]) - -PHP_ARG_ENABLE(pdo, whether to enable PDO support, -[ --disable-pdo Disable PHP Data Objects support], yes) - -if test "$PHP_PDO" != "no"; then - - PHP_PDO_PEAR_CHECK - - if test "$ext_shared" = "yes" ; then - case $host_alias in - *darwin*) - if test "$pdo_running_under_pear" = "1"; then - AC_MSG_ERROR([ -Due to the way that loadable modules work on OSX/Darwin, you need to -compile the PDO package statically into the PHP core. - -Please follow the instructions at: http://netevil.org/node.php?nid=202 -for more detail on this issue. - ]) - fi - ext_shared=no - ;; - esac - fi - PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared) - PHP_ADD_EXTENSION_DEP(pdo, spl, true) - - ifdef([PHP_INSTALL_HEADERS], - [ - PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h]) - ], [ - PHP_ADD_MAKEFILE_FRAGMENT - ]) -fi diff --git a/ext/pdo/config.w32 b/ext/pdo/config.w32 deleted file mode 100755 index ae8829388ea05..0000000000000 --- a/ext/pdo/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no"); - -if (PHP_PDO != "no") { - EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c'); - ADD_EXTENSION_DEP('pdo', 'spl', true); -} - diff --git a/ext/pdo/package.xml b/ext/pdo/package.xml deleted file mode 100755 index ce7917fc20a88..0000000000000 --- a/ext/pdo/package.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO</name> - <summary>PHP Data Objects Interface</summary> - <maintainers> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>helly</user> - <name>Marcus Boerger</name> - <email>helly@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>iliaa</user> - <name>Ilia Alshanetsky</name> - <email>iliaa@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>gschlossnagle</user> - <name>George Schlossnagle</name> - <email>george@omniti.com</email> - <role>lead</role> - </maintainer> - </maintainers> - - <description> - PDO provides a uniform data access interface, sporting advanced features such - as prepared statements and bound parameters. PDO drivers are dynamically - loadable and may be developed independently from the core, but still accessed - using the same API. - - Read the documentation at http://www.php.net/pdo for more information. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>1.1dev</version> - <date>2005-09-11</date> - - <notes> -You need to install a PDO database driver to make use of PDO, -check http://pecl.php.net/package-search.php?pkg_name=PDO -for a list of available PDO drivers. - -It is highly recommended that you update to the latest stable PHP 5 snapshot -before using PDO. -You can obtain it from http://snaps.php.net. - -If you are running on Windows, you should download: -http://snaps.php.net/win32/php5.0-win32-latest.zip -http://snaps.php.net/win32/PECL_5_0/php_pdo.dll - -You can find additional PDO drivers at: -http://snaps.php.net/win32/PECL_5_0/ - -- Consult the PHP 5.1b3 release notes and http://netevil.org/node.php?nid=325 - for more recent changes. - -- New fetch modes: - PDO_FETCH_FUNC, PDO_FETCH_GROUP, PDO_FETCH_UNIQUE, PDO_FETCH_CLASSTYPE -- New fetch mode for PHP 5.1 and higher: PDO_FETCH_SERIALIZE -- Changed signature for PDO::lastInsertId(); it is now: - string PDO::lastInsertId([string name]) - this allows arbitrary unique identifiers to be returned, and allows for - better support for RDBMS with sequences. -- Improved bound parameter emulation when using non-string types. -- PDOStatement implements SPL Traversable interface when SPL is present. - -- Added PDO::quote($string). Closes PECL Bug #3393 -- Fixed PDO::query() for drivers using bound parameter emulation. -- Fixed PECL Bug #3434, crash when using odbc with named parameters. -- Added PDOStatement::fetchObject(string class_name [, NULL|array ctor_args]]) -- PDO_FETCH_CLASS now passes args through to the class constructor -- Now builds directly via "pear install PDO" (upgrade to PEAR 1.3.5 first) - -** Note ** - -You should uninstall and re-install your individual database drivers whenever -you upgrade the base PDO package, otherwise you will see an error about PDO API -numbers when you run your PHP scripts. - - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="pdo.c"/> - <file role="src" name="pdo_dbh.c"/> - <file role="src" name="pdo_stmt.c"/> - <file role="src" name="php_pdo.h"/> - <file role="src" name="php_pdo_driver.h"/> - <file role="src" name="php_pdo_int.h"/> - <file role="src" name="pdo_sql_parser.re"/> - <file role="src" name="pdo_sql_parser.c"/> - <file role="src" name="pdo_sqlstate.c"/> - <file role="src" name="php_pdo_phpvers_compat.h"/> - <file role="src" name="Makefile.frag"/> - - <file role="doc" name="README"/> - <file role="doc" name="TODO"/> - <file role="doc" name="pdo.php"/> - <file role="doc" name="CREDITS"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - </deps> - </release> -</package> diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c deleted file mode 100755 index 837697de3bb26..0000000000000 --- a/ext/pdo/pdo.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Marcus Boerger <helly@php.net> | - | Sterling Hughes <sterling@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <ctype.h> -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pdo.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" -#include "zend_exceptions.h" - -static zend_class_entry *spl_ce_RuntimeException; - -ZEND_DECLARE_MODULE_GLOBALS(pdo) - -/* True global resources - no need for thread safety here */ - -/* the registry of PDO drivers */ -HashTable pdo_driver_hash; - -/* we use persistent resources for the driver connection stuff */ -static int le_ppdo; - -int php_pdo_list_entry(void) -{ - return le_ppdo; -} - -/* for exceptional circumstances */ -zend_class_entry *pdo_exception_ce; - -PDO_API zend_class_entry *php_pdo_get_exception(TSRMLS_D) -{ - return U_CLASS_ENTRY(pdo_exception_ce); -} - -PDO_API char *php_pdo_str_tolower_dup(const char *src, int len) -{ - char *dest = emalloc(len + 1); - zend_str_tolower_copy(dest, src, len); - return dest; -} - -PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC) -{ -#if can_handle_soft_dependency_on_SPL && defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)) - if (!root) { - if (!spl_ce_RuntimeException) { - zend_class_entry **pce; - - if (zend_hash_find(CG(class_table), "runtimeexception", sizeof("RuntimeException"), (void **) &pce) == SUCCESS) { - spl_ce_RuntimeException = *pce; - return *pce; - } - } else { - return spl_ce_RuntimeException; - } - } -#endif -#if (PHP_MAJOR_VERSION < 6) - return zend_exception_get_default(); -#else - return zend_exception_get_default(TSRMLS_C); -#endif -} - -zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce; - -/* proto array pdo_drivers() - Return array of available PDO drivers */ -PHP_FUNCTION(pdo_drivers) -{ - HashPosition pos; - pdo_driver_t **pdriver; - - array_init(return_value); - - zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos); - while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) { - add_next_index_stringl(return_value, (char*)(*pdriver)->driver_name, (*pdriver)->driver_name_len, 1); - zend_hash_move_forward_ex(&pdo_driver_hash, &pos); - } -} -/* }}} */ - -/* {{{ pdo_functions[] */ -function_entry pdo_functions[] = { - PHP_FE(pdo_drivers, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_functions[] */ -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_deps[] = { -#ifdef HAVE_SPL - ZEND_MOD_REQUIRED("spl") -#endif - {NULL, NULL, NULL} -}; -#endif -/* }}} */ - -/* {{{ pdo_module_entry */ -zend_module_entry pdo_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "PDO", - pdo_functions, - PHP_MINIT(pdo), - PHP_MSHUTDOWN(pdo), - PHP_RINIT(pdo), - PHP_RSHUTDOWN(pdo), - PHP_MINFO(pdo), - "1.1dev", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO -ZEND_GET_MODULE(pdo) -#endif - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("pdo.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_pdo_globals, pdo_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_pdo_init_globals */ -static void php_pdo_init_globals(zend_pdo_globals *pdo_globals) -{ - pdo_globals->global_value = 0; -} -/* }}} */ - -PDO_API int php_pdo_register_driver(pdo_driver_t *driver) -{ - if (driver->api_version != PDO_DRIVER_API) { - zend_error(E_ERROR, "PDO: driver %s requires PDO API version %ld; this is PDO version %d", - driver->driver_name, driver->api_version, PDO_DRIVER_API); - return FAILURE; - } - if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) { - zend_error(E_ERROR, "You MUST load PDO before loading any PDO drivers"); - return FAILURE; /* NOTREACHED */ - } - - return zend_hash_add(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len, - (void**)&driver, sizeof(driver), NULL); -} - -PDO_API void php_pdo_unregister_driver(pdo_driver_t *driver) -{ - if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) { - return; - } - - zend_hash_del(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len); -} - -pdo_driver_t *pdo_find_driver(const char *name, int namelen) -{ - pdo_driver_t **driver = NULL; - - zend_hash_find(&pdo_driver_hash, (char*)name, namelen, (void**)&driver); - - return driver ? *driver : NULL; -} - -PDO_API int php_pdo_parse_data_source(const char *data_source, - unsigned long data_source_len, struct pdo_data_src_parser *parsed, - int nparams) -{ - int i, j; - int valstart = -1; - int semi = -1; - int optstart = 0; - int nlen; - int n_matches = 0; - - i = 0; - while (i < data_source_len) { - /* looking for NAME= */ - - if (data_source[i] == '\0') { - break; - } - - if (data_source[i] != '=') { - ++i; - continue; - } - - valstart = ++i; - - /* now we're looking for VALUE; or just VALUE<NUL> */ - semi = -1; - while (i < data_source_len) { - if (data_source[i] == '\0') { - semi = i++; - break; - } - if (data_source[i] == ';') { - semi = i++; - break; - } - ++i; - } - - if (semi == -1) { - semi = i; - } - - /* find the entry in the array */ - nlen = valstart - optstart - 1; - for (j = 0; j < nparams; j++) { - if (0 == strncmp(data_source + optstart, parsed[j].optname, nlen) && parsed[j].optname[nlen] == '\0') { - /* got a match */ - if (parsed[j].freeme) { - efree(parsed[j].optval); - } - parsed[j].optval = estrndup(data_source + valstart, semi - valstart); - parsed[j].freeme = 1; - ++n_matches; - break; - } - } - - while (i < data_source_len && isspace(data_source[i])) { - i++; - } - - optstart = i; - } - - return n_matches; -} - -static const char digit_vec[] = "0123456789"; -PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC) -{ - char buffer[65]; - char outbuf[65] = ""; - register char *p; - long long_val; - char *dst = outbuf; - - if (i64 < 0) { - i64 = -i64; - *dst++ = '-'; - } - - if (i64 == 0) { - *dst++ = '0'; - *dst++ = '\0'; - return estrdup(outbuf); - } - - p = &buffer[sizeof(buffer)-1]; - *p = '\0'; - - while ((pdo_uint64_t)i64 > (pdo_uint64_t)LONG_MAX) { - pdo_uint64_t quo = (pdo_uint64_t)i64 / (unsigned int)10; - unsigned int rem = (unsigned int)(i64 - quo*10U); - *--p = digit_vec[rem]; - i64 = (pdo_int64_t)quo; - } - long_val = (long)i64; - while (long_val != 0) { - long quo = long_val / 10; - *--p = digit_vec[(unsigned int)(long_val - quo * 10)]; - long_val = quo; - } - while ((*dst++ = *p++) != 0) - ; - *dst = '\0'; - return estrdup(outbuf); -} - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(pdo) -{ - zend_class_entry ce; - - spl_ce_RuntimeException = NULL; - - ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL); - REGISTER_INI_ENTRIES(); - - if (FAILURE == pdo_sqlstate_init_error_table()) { - return FAILURE; - } - - zend_hash_init(&pdo_driver_hash, 0, NULL, NULL, 1); - - le_ppdo = zend_register_list_destructors_ex(NULL, php_pdo_pdbh_dtor, - "PDO persistent database", module_number); - - INIT_CLASS_ENTRY(ce, "PDOException", NULL); - - pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); - - zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC TSRMLS_CC); - - pdo_dbh_init(TSRMLS_C); - pdo_stmt_init(TSRMLS_C); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(pdo) -{ - UNREGISTER_INI_ENTRIES(); - zend_hash_destroy(&pdo_driver_hash); - pdo_sqlstate_fini_error_table(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(pdo) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(pdo) -{ - /* TODO: visit persistent handles: for each persistent statement handle, - * remove bound parameter associations */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(pdo) -{ - HashPosition pos; - char *drivers = NULL, *ldrivers = estrdup(""); - pdo_driver_t **pdriver; - - php_info_print_table_start(); - php_info_print_table_header(2, "PDO support", "enabled"); - - zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos); - while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) { - spprintf(&drivers, 0, "%s, %s", ldrivers, (*pdriver)->driver_name); - zend_hash_move_forward_ex(&pdo_driver_hash, &pos); - efree(ldrivers); - ldrivers = drivers; - } - - php_info_print_table_row(2, "PDO drivers", drivers ? drivers+2 : ""); - - if (drivers) { - efree(drivers); - } - - php_info_print_table_end(); - -#if 0 - DISPLAY_INI_ENTRIES(); -#endif -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo.php b/ext/pdo/pdo.php deleted file mode 100755 index 1008f7bd04d3f..0000000000000 --- a/ext/pdo/pdo.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -dl('pdo.so'); -dl('pdo_sqlite.so'); - -//$x = new PDO("oci:dbname=hostname", 'php', 'php'); -$x = new PDO("sqlite::memory:"); - -$x->query("create table test(name string, value string)"); -debug_zval_dump($x); - -$stmt = $x->prepare("INSERT INTO test (NAME, VALUE) VALUES (:name, :value)"); - -$stmt->bindParam(":name", $the_name, PDO_PARAM_STR, 32); -$stmt->bindParam(":value", $the_value, PDO_PARAM_STR, 32); - -for ($i = 0; $i < 4; $i++) { - $the_name = "foo" . rand(); - $the_value = "bar" . rand(); - - if (!$stmt->execute()) { - break; - } -} - -$stmt = null; - -echo "DEFAULT:\n"; -foreach ($x->query("select NAME, VALUE from test") as $row) { - print_r($row); -} - -echo "OBJ:\n"; - -class Foo { - public $NAME = "Don't change me"; -} - -$foo = new foo; - -foreach ($x->query("select NAME, VALUE from test", PDO_FETCH_COLUMN, 1) as $row) { - debug_zval_dump($row); -} - -echo "Done\n"; -exit; - -$stmt = $x->prepare("select NAME, VALUE from test where value like ?"); -$the_name = 'bar%'; -$stmt->execute(array($the_name)) or die("failed to execute!"); -$stmt->bindColumn('VALUE', $value); - -while ($row = $stmt->fetch()) { - echo "name=$row[NAME] value=$row[VALUE]\n"; - echo "value is $value\n"; - echo "\n"; -} - -echo "Let's try an update\n"; - -echo "All done\n"; - -?> diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c deleted file mode 100755 index 2e133da5a364b..0000000000000 --- a/ext/pdo/pdo_dbh.c +++ /dev/null @@ -1,1400 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Marcus Boerger <helly@php.net> | - | Sterling Hughes <sterling@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* The PDO Database Handle Class */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pdo.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" -#include "zend_exceptions.h" -#include "zend_object_handlers.h" -#include "zend_hash.h" - -void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp TSRMLS_DC) -{ - pdo_error_type *pdo_err = &dbh->error_code; - char *message = NULL; - const char *msg; - zval *info = NULL; - - if (dbh->error_mode == PDO_ERRMODE_SILENT) { -#if 0 - /* BUG: if user is running in silent mode and hits an error at the driver level - * when they use the PDO methods to call up the error information, they may - * get bogus information */ - return; -#endif - } - - if (stmt) { - pdo_err = &stmt->error_code; - } - - strcpy(*pdo_err, sqlstate); - - /* hash sqlstate to error messages */ - msg = pdo_sqlstate_state_to_description(*pdo_err); - if (!msg) { - msg = "<<Unknown error>>"; - } - - MAKE_STD_ZVAL(info); - array_init(info); - - add_next_index_string(info, *pdo_err, 1); - add_next_index_long(info, 0); - - if (supp) { - spprintf(&message, 0, "SQLSTATE[%s]: %s: %s", *pdo_err, msg, supp); - } else { - spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg); - } - - if (dbh->error_mode != PDO_ERRMODE_EXCEPTION) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); - - if (info) { - zval_ptr_dtor(&info); - } - } else { - zval *ex; - zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception(TSRMLS_C); - - MAKE_STD_ZVAL(ex); - object_init_ex(ex, pdo_ex); - - zend_update_property_string(def_ex, ex, "message", sizeof("message")-1, message TSRMLS_CC); - zend_update_property_string(def_ex, ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC); - - if (info) { - zend_update_property(pdo_ex, ex, "errorInfo", sizeof("errorInfo")-1, info TSRMLS_CC); - zval_ptr_dtor(&info); - } - - zend_throw_exception_object(ex TSRMLS_CC); - } - - if (message) { - efree(message); - } -} - -void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_error_type *pdo_err = &dbh->error_code; - const char *msg = "<<Unknown>>"; - char *supp = NULL; - long native_code = 0; - char *message = NULL; - zval *info = NULL; - - if (dbh->error_mode == PDO_ERRMODE_SILENT) { - return; - } - - if (stmt) { - pdo_err = &stmt->error_code; - } - - /* hash sqlstate to error messages */ - msg = pdo_sqlstate_state_to_description(*pdo_err); - if (!msg) { - msg = "<<Unknown error>>"; - } - - if (dbh->methods->fetch_err) { - - MAKE_STD_ZVAL(info); - array_init(info); - - add_next_index_string(info, *pdo_err, 1); - - if (dbh->methods->fetch_err(dbh, stmt, info TSRMLS_CC)) { - zval **item; - - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 1, (void**)&item)) { - native_code = Z_LVAL_PP(item); - } - - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 2, (void**)&item)) { - supp = estrndup(Z_STRVAL_PP(item), Z_STRLEN_PP(item)); - } - } - - zval_ptr_dtor(&info); - info = NULL; - } - - if (supp) { - spprintf(&message, 0, "SQLSTATE[%s]: %s: %ld %s", *pdo_err, msg, native_code, supp); - } else { - spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg); - } - - if (dbh->error_mode == PDO_ERRMODE_WARNING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); - - if (info) { - zval_ptr_dtor(&info); - } - } else if (EG(exception) == NULL) { - zval *ex; - zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception(TSRMLS_C); - - MAKE_STD_ZVAL(ex); - object_init_ex(ex, pdo_ex); - - zend_update_property_string(def_ex, ex, "message", sizeof("message")-1, message TSRMLS_CC); - zend_update_property_string(def_ex, ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC); - - if (info) { - zend_update_property(pdo_ex, ex, "errorInfo", sizeof("errorInfo")-1, info TSRMLS_CC); - zval_ptr_dtor(&info); - } - - zend_throw_exception_object(ex TSRMLS_CC); - } - - if (message) { - efree(message); - } - - if (supp) { - efree(supp); - } -} - -static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) -{ - php_stream *stream; - char *dsn = NULL; - - stream = php_stream_open_wrapper(uri, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); - if (stream) { - dsn = php_stream_get_line(stream, buf, buflen, NULL); - php_stream_close(stream); - } - return dsn; -} - -/* {{{ proto object PDO::__construct(string dsn, string username, string passwd [, array options]) - */ -static PHP_METHOD(PDO, dbh_constructor) -{ - zval *object = getThis(); - pdo_dbh_t *dbh = NULL; - zend_bool is_persistent = FALSE; - char *data_source; - int data_source_len; - char *colon; - char *username=NULL, *password=NULL; - int usernamelen, passwordlen; - pdo_driver_t *driver = NULL; - zval *options = NULL; - char alt_dsn[512]; - int call_factory = 1; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!", &data_source, &data_source_len, - &username, &usernamelen, &password, &passwordlen, &options)) { - ZVAL_NULL(object); - return; - } - - /* parse the data source name */ - colon = strchr(data_source, ':'); - - if (!colon) { - /* let's see if this string has a matching dsn in the php.ini */ - char *ini_dsn = NULL; - - snprintf(alt_dsn, sizeof(alt_dsn), "pdo.dsn.%s", data_source); - if (FAILURE == cfg_get_string(alt_dsn, &ini_dsn)) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "invalid data source name"); - ZVAL_NULL(object); - return; - } - - data_source = ini_dsn; - colon = strchr(data_source, ':'); - - if (!colon) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "invalid data source name (via INI: %s)", alt_dsn); - ZVAL_NULL(object); - return; - } - } - - if (!strncmp(data_source, "uri:", sizeof("uri:")-1)) { - /* the specified URI holds connection details */ - data_source = dsn_from_uri(data_source, alt_dsn, sizeof(alt_dsn) TSRMLS_CC); - if (!data_source) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "invalid data source URI"); - ZVAL_NULL(object); - return; - } - colon = strchr(data_source, ':'); - if (!colon) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "invalid data source name (via URI)"); - ZVAL_NULL(object); - return; - } - } - - driver = pdo_find_driver(data_source, colon - data_source); - - if (!driver) { - /* NB: don't want to include the data_source in the error message as - * it might contain a password */ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "could not find driver"); - ZVAL_NULL(object); - return; - } - - dbh = (pdo_dbh_t *) zend_object_store_get_object(object TSRMLS_CC); - - /* is this supposed to be a persistent connection ? */ - if (options) { - zval **v; - int plen; - char *hashkey = NULL; - list_entry *le; - pdo_dbh_t *pdbh = NULL; - - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT, (void**)&v)) { - if (Z_TYPE_PP(v) == IS_STRING) { - /* user specified key */ - plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s:%s", data_source, - username ? username : "", - password ? password : "", - Z_STRVAL_PP(v)); - is_persistent = 1; - } else { - convert_to_long_ex(v); - is_persistent = Z_LVAL_PP(v) ? 1 : 0; - plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s", data_source, - username ? username : "", - password ? password : ""); - } - } - - if (is_persistent) { - /* let's see if we have one cached.... */ - if (SUCCESS == zend_hash_find(&EG(persistent_list), hashkey, plen+1, (void*)&le)) { - if (Z_TYPE_P(le) == php_pdo_list_entry()) { - pdbh = (pdo_dbh_t*)le->ptr; - - /* is the connection still alive ? */ - if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh TSRMLS_CC)) { - /* nope... need to kill it */ - pdbh = NULL; - } - } - } - - if (pdbh) { - call_factory = 0; - } else { - /* need a brand new pdbh */ - pdbh = pecalloc(1, sizeof(*pdbh), 1); - - if (!pdbh) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle"); - /* NOTREACHED */ - } - - pdbh->is_persistent = 1; - if (!(pdbh->persistent_id = pemalloc(plen + 1, 1))) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle"); - } - memcpy((char *)pdbh->persistent_id, hashkey, plen+1); - pdbh->persistent_id_len = plen+1; - pdbh->refcount = 1; - } - } - - if (pdbh) { - /* let's copy the emalloc bits over from the other handle */ - pdbh->ce = dbh->ce; - pdbh->properties = dbh->properties; - /* kill the non-persistent thingamy */ - efree(dbh); - /* switch over to the persistent one */ - dbh = pdbh; - zend_object_store_set_object(object, dbh TSRMLS_CC); - dbh->refcount++; - } - - if (hashkey) { - efree(hashkey); - } - } - - dbh->data_source_len = strlen(colon + 1); - dbh->data_source = (const char*)pestrdup(colon + 1, is_persistent); - dbh->username = username ? pestrdup(username, is_persistent) : NULL; - dbh->password = password ? pestrdup(password, is_persistent) : NULL; - - dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1 TSRMLS_CC); - - if (!dbh->data_source || (username && !dbh->username) || (password && !dbh->password)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory"); - } - - if (!call_factory) { - /* we got a persistent guy from our cache */ - return; - } - - if (driver->db_handle_factory(dbh, options TSRMLS_CC)) { - /* all set */ - - if (is_persistent) { - list_entry le; - - /* register in the persistent list etc. */ - /* we should also need to replace the object store entry, - since it was created with emalloc */ - - le.type = php_pdo_list_entry(); - le.ptr = dbh; - - if (FAILURE == zend_hash_update(&EG(persistent_list), - (char*)dbh->persistent_id, dbh->persistent_id_len, (void*)&le, - sizeof(le), NULL)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry"); - } - } - - dbh->driver = driver; - return; - } - - /* the connection failed; things will tidy up in free_storage */ - /* XXX raise exception */ - ZVAL_NULL(object); -} -/* }}} */ - -static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */ -{ - if (ctor_args) { - if (Z_TYPE_P(ctor_args) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array" TSRMLS_CC); - return NULL; - } - if (!dbstmt_ce->constructor) { - pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments" TSRMLS_CC); - return NULL; - } - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, dbstmt_ce); - object->refcount = 1; - object->is_ref = 1; - - return object; -} /* }}} */ - -static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */ -{ - zval *query_string; - zval z_key; - - MAKE_STD_ZVAL(query_string); - ZVAL_RT_STRINGL(query_string, stmt->query_string, stmt->query_stringlen, 1); - ZVAL_ASCII_STRINGL(&z_key, "queryString", sizeof("queryString")-1, 0); - std_object_handlers.write_property(object, &z_key, query_string TSRMLS_CC); - zval_ptr_dtor(&query_string); -#ifdef UG - if (UG(unicode)) { - zval_dtor(&z_key); - } -#endif - - if (dbstmt_ce->constructor) { - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *retval; - - fci.size = sizeof(zend_fcall_info); - fci.function_table = &dbstmt_ce->function_table; - fci.function_name = NULL; - fci.object_pp = &object; - fci.symbol_table = NULL; - fci.retval_ptr_ptr = &retval; - if (ctor_args) { - HashTable *ht = Z_ARRVAL_P(ctor_args); - Bucket *p; - - fci.param_count = 0; - fci.params = safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0); - p = ht->pListHead; - while (p != NULL) { - fci.params[fci.param_count++] = (zval**)p->pData; - p = p->pListNext; - } - } else { - fci.param_count = 0; - fci.params = NULL; - } - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = dbstmt_ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &object; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zval_dtor(object); - ZVAL_NULL(object); - object = NULL; /* marks failure */ - } else { - zval_ptr_dtor(&retval); - } - - if (fci.params) { - efree(fci.params); - } - } -} -/* }}} */ - -/* {{{ proto object PDO::prepare(string statment [, array options]) - Prepares a statement for execution and returns a statement object */ -static PHP_METHOD(PDO, prepare) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - pdo_stmt_t *stmt; - char *statement; - int statement_len; - zval *options = NULL, **opt, **item, *ctor_args; - zend_class_entry *dbstmt_ce, **pce; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &statement, - &statement_len, &options)) { - RETURN_FALSE; - } - - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - - if (ZEND_NUM_ARGS() > 1 && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS, (void**)&opt)) { - if (zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE - || !PDO_ZVAL_PP_IS_TEXT(item) - || zend_u_lookup_class(Z_TYPE_PP(item), Z_UNIVAL_PP(item), Z_UNILEN_PP(item), &pce TSRMLS_CC) == FAILURE - ) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO_ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "the classname must be a string specifying an existing class" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - dbstmt_ce = *pce; - if (!instanceof_function(dbstmt_ce, U_CLASS_ENTRY(pdo_dbstmt_ce) TSRMLS_CC)) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - if (dbstmt_ce->constructor && !(dbstmt_ce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class cannot have a public constructor" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - if (zend_hash_index_find(Z_ARRVAL_PP(opt), 1, (void**)&item) == SUCCESS) { - if (Z_TYPE_PP(item) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO_ATTR_STATEMENT_CLASS requires format array(classname, ctor_args); " - "ctor_args must be an array" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - ctor_args = *item; - } else { - ctor_args = NULL; - } - } else { - dbstmt_ce = dbh->def_stmt_ce; - ctor_args = dbh->def_stmt_ctor_args; - } - - if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, ctor_args TSRMLS_CC)) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "failed to instantiate user-supplied statement class" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - stmt = (pdo_stmt_t*)zend_object_store_get_object(return_value TSRMLS_CC); - - /* unconditionally keep this for later reference */ - stmt->query_string = estrndup(statement, statement_len); - stmt->query_stringlen = statement_len; - stmt->default_fetch_type = PDO_FETCH_BOTH; - stmt->dbh = dbh; - /* give it a reference to me */ - zend_objects_store_add_ref(getThis() TSRMLS_CC); - stmt->database_object_handle = *getThis(); - /* we haven't created a lazy object yet */ - ZVAL_NULL(&stmt->lazy_object_ref); - - if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) { - pdo_stmt_construct(stmt, return_value, dbstmt_ce, ctor_args TSRMLS_CC); - return; - } - - PDO_HANDLE_DBH_ERR(); - - /* kill the object handle for the stmt here */ - zval_dtor(return_value); - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool PDO::beginTransaction() - Initiates a transaction */ -static PHP_METHOD(PDO, beginTransaction) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - - PDO_CONSTRUCT_CHECK; - - if (dbh->in_txn) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "There is already an active transaction"); - RETURN_FALSE; - } - - if (!dbh->methods->begin) { - /* TODO: this should be an exception; see the auto-commit mode - * comments below */ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "This driver doesn't support transactions"); - RETURN_FALSE; - } - - if (dbh->methods->begin(dbh TSRMLS_CC)) { - dbh->in_txn = 1; - RETURN_TRUE; - } - - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool PDO::commit() - Commit a transaction */ -static PHP_METHOD(PDO, commit) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - - PDO_CONSTRUCT_CHECK; - - if (!dbh->in_txn) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "There is no active transaction"); - RETURN_FALSE; - } - - if (dbh->methods->commit(dbh TSRMLS_CC)) { - dbh->in_txn = 0; - RETURN_TRUE; - } - - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool PDO::rollBack() - roll back a transaction */ -static PHP_METHOD(PDO, rollBack) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - - PDO_CONSTRUCT_CHECK; - - if (!dbh->in_txn) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "There is no active transaction"); - RETURN_FALSE; - } - - if (dbh->methods->rollback(dbh TSRMLS_CC)) { - dbh->in_txn = 0; - RETURN_TRUE; - } - - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool PDO::setAttribute(long attribute, mixed value) - Set an attribute */ -static PHP_METHOD(PDO, setAttribute) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - long attr; - zval *value = NULL; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) { - RETURN_FALSE; - } - - PDO_CONSTRUCT_CHECK; - - switch (attr) { - case PDO_ATTR_ERRMODE: - convert_to_long(value); - switch (Z_LVAL_P(value)) { - case PDO_ERRMODE_SILENT: - case PDO_ERRMODE_WARNING: - case PDO_ERRMODE_EXCEPTION: - dbh->error_mode = Z_LVAL_P(value); - RETURN_TRUE; - default: - pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - RETURN_FALSE; - - case PDO_ATTR_CASE: - convert_to_long(value); - switch (Z_LVAL_P(value)) { - case PDO_CASE_NATURAL: - case PDO_CASE_UPPER: - case PDO_CASE_LOWER: - dbh->desired_case = Z_LVAL_P(value); - RETURN_TRUE; - default: - pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - RETURN_FALSE; - - case PDO_ATTR_ORACLE_NULLS: - convert_to_long(value); - dbh->oracle_nulls = Z_LVAL_P(value); - RETURN_TRUE; - - case PDO_ATTR_STRINGIFY_FETCHES: - convert_to_long(value); - dbh->stringify = Z_LVAL_P(value) ? 1 : 0; - RETURN_TRUE; - - case PDO_ATTR_STATEMENT_CLASS: { - /* array(string classname, array(mixed ctor_args)) */ - zend_class_entry **pce; - zval **item; - - if (dbh->is_persistent) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO_ATTR_STATEMENT_CLASS cannot be used with persistent PDO instances" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - if (Z_TYPE_P(value) != IS_ARRAY - || zend_hash_index_find(Z_ARRVAL_P(value), 0, (void**)&item) == FAILURE - || !PDO_ZVAL_PP_IS_TEXT(item) - || zend_u_lookup_class(Z_TYPE_PP(item), Z_UNIVAL_PP(item), Z_UNILEN_PP(item), &pce TSRMLS_CC) == FAILURE - ) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO_ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "the classname must be a string specifying an existing class" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - if (!instanceof_function(*pce, U_CLASS_ENTRY(pdo_dbstmt_ce) TSRMLS_CC)) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - if ((*pce)->constructor && !((*pce)->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class cannot have a public constructor" TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - dbh->def_stmt_ce = *pce; - if (dbh->def_stmt_ctor_args) { - zval_ptr_dtor(&dbh->def_stmt_ctor_args); - dbh->def_stmt_ctor_args = NULL; - } - if (zend_hash_index_find(Z_ARRVAL_P(value), 1, (void**)&item) == SUCCESS) { - if (Z_TYPE_PP(item) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO_ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "ctor_args must be an array" - TSRMLS_CC); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } - (*item)->refcount++; - dbh->def_stmt_ctor_args = *item; - } - RETURN_TRUE; - } - - default: - ; - } - - if (!dbh->methods->set_attribute) { - goto fail; - } - - PDO_DBH_CLEAR_ERR(); - if (dbh->methods->set_attribute(dbh, attr, value TSRMLS_CC)) { - RETURN_TRUE; - } - -fail: - if (attr == PDO_ATTR_AUTOCOMMIT) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "The auto-commit mode cannot be changed for this driver"); - } else if (!dbh->methods->set_attribute) { - pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes" TSRMLS_CC); - } else { - PDO_HANDLE_DBH_ERR(); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto mixed PDO::getAttribute(long attribute) - Get an attribute */ -static PHP_METHOD(PDO, getAttribute) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - long attr; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) { - RETURN_FALSE; - } - - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - - /* handle generic PDO-level atributes */ - switch (attr) { - case PDO_ATTR_PERSISTENT: - RETURN_BOOL(dbh->is_persistent); - - case PDO_ATTR_CASE: - RETURN_LONG(dbh->desired_case); - - case PDO_ATTR_ORACLE_NULLS: - RETURN_LONG(dbh->oracle_nulls); - - case PDO_ATTR_ERRMODE: - RETURN_LONG(dbh->error_mode); - - case PDO_ATTR_DRIVER_NAME: - RETURN_STRINGL((char*)dbh->driver->driver_name, dbh->driver->driver_name_len, 1); - - case PDO_ATTR_STATEMENT_CLASS: - array_init(return_value); - add_next_index_text(return_value, dbh->def_stmt_ce->name, 1); - if (dbh->def_stmt_ctor_args) { - dbh->def_stmt_ctor_args->refcount++; - add_next_index_zval(return_value, dbh->def_stmt_ctor_args); - } - return; - } - - if (!dbh->methods->get_attribute) { - pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes" TSRMLS_CC); - RETURN_FALSE; - } - - switch (dbh->methods->get_attribute(dbh, attr, return_value TSRMLS_CC)) { - case -1: - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - - case 0: - pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute" TSRMLS_CC); - RETURN_FALSE; - - default: - return; - } -} -/* }}} */ - -/* {{{ proto long PDO::exec(string query) - Execute a query that does not return a row set, returning the number of affected rows */ -static PHP_METHOD(PDO, exec) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - char *statement; - int statement_len; - long ret; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &statement, &statement_len)) { - RETURN_FALSE; - } - - if (!statement_len) { - RETURN_FALSE; - } - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - ret = dbh->methods->doer(dbh, statement, statement_len TSRMLS_CC); - if(ret == -1) { - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } else { - RETURN_LONG(ret); - } -} -/* }}} */ - - -/* {{{ proto string PDO::lastInsertId([string seqname]) - Returns the id of the last row that we affected on this connection. Some databases require a sequence or table name to be passed in. Not always meaningful. */ -static PHP_METHOD(PDO, lastInsertId) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - char *name = NULL; - int namelen; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &namelen)) { - RETURN_FALSE; - } - - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - if (!dbh->methods->last_id) { - pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC); - RETURN_FALSE; - } else { - Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, &Z_STRLEN_P(return_value) TSRMLS_CC); - if (!Z_STRVAL_P(return_value)) { - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; - } else { - Z_TYPE_P(return_value) = IS_STRING; - } - } -} -/* }}} */ - -/* {{{ proto string PDO::errorCode() - Fetch the error code associated with the last operation on the database handle */ -static PHP_METHOD(PDO, errorCode) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; - } - PDO_CONSTRUCT_CHECK; - - RETURN_STRING(dbh->error_code, 1); -} -/* }}} */ - -/* {{{ proto int PDO::errorInfo() - Fetch extended error information associated with the last operation on the database handle */ -static PHP_METHOD(PDO, errorInfo) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; - } - PDO_CONSTRUCT_CHECK; - - array_init(return_value); - add_next_index_string(return_value, dbh->error_code, 1); - - if (dbh->methods->fetch_err) { - dbh->methods->fetch_err(dbh, NULL, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto object PDO::query(string sql [, PDOStatement::setFetchMode() args]) - Prepare and execute $sql; returns the statement object for iteration */ -static PHP_METHOD(PDO, query) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - pdo_stmt_t *stmt; - char *statement; - int statement_len; - - if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &statement, - &statement_len)) { - RETURN_FALSE; - } - - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - - if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, dbh->def_stmt_ctor_args TSRMLS_CC)) { - pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class" TSRMLS_CC); - return; - } - stmt = (pdo_stmt_t*)zend_object_store_get_object(return_value TSRMLS_CC); - - /* unconditionally keep this for later reference */ - stmt->query_string = estrndup(statement, statement_len); - stmt->query_stringlen = statement_len; - stmt->default_fetch_type = PDO_FETCH_BOTH; - stmt->active_query_string = stmt->query_string; - stmt->active_query_stringlen = statement_len; - stmt->dbh = dbh; - /* give it a reference to me */ - zend_objects_store_add_ref(getThis() TSRMLS_CC); - stmt->database_object_handle = *getThis(); - /* we haven't created a lazy object yet */ - ZVAL_NULL(&stmt->lazy_object_ref); - - if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL TSRMLS_CC)) { - if (ZEND_NUM_ARGS() == 1 || SUCCESS == pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, 1)) { - PDO_STMT_CLEAR_ERR(); - - /* now execute the statement */ - PDO_STMT_CLEAR_ERR(); - if (stmt->methods->executer(stmt TSRMLS_CC)) { - int ret = 1; - if (!stmt->executed) { - if (stmt->dbh->alloc_own_columns) { - ret = pdo_stmt_describe_columns(stmt TSRMLS_CC); - } - stmt->executed = 1; - } - if (ret) { - pdo_stmt_construct(stmt, return_value, dbh->def_stmt_ce, dbh->def_stmt_ctor_args TSRMLS_CC); - return; - } - } - } - /* something broke */ - } - - PDO_HANDLE_STMT_ERR(); - - /* kill the object handle for the stmt here */ - zval_dtor(return_value); - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string PDO::quote(string string [, int paramtype]) - quotes string for use in a query. The optional paramtype acts as a hint for drivers that have alternate quoting styles. The default value is PDO_PARAM_STR */ -static PHP_METHOD(PDO, quote) -{ - pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - char *str; - int str_len; - long paramtype = PDO_PARAM_STR; - char *qstr; - int qlen; - - if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s|l", &str, &str_len, - ¶mtype)) { - RETURN_FALSE; - } - - PDO_DBH_CLEAR_ERR(); - PDO_CONSTRUCT_CHECK; - if (!dbh->methods->quoter) { - pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting" TSRMLS_CC); - RETURN_FALSE; - } - - if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype TSRMLS_CC)) { - RETURN_STRINGL(qstr, qlen, 0); - } - PDO_HANDLE_DBH_ERR(); -} -/* }}} */ - -/* {{{ proto int PDO::__wakeup() - Prevents use of a PDO instance that has been unserialized */ -static PHP_METHOD(PDO, __wakeup) -{ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances"); -} -/* }}} */ - -/* {{{ proto int PDO::__sleep() - Prevents serialization of a PDO instance */ -static PHP_METHOD(PDO, __sleep) -{ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances"); -} -/* }}} */ - -/* {{{ proto array pdo_drivers() - Return array of available PDO drivers */ -static PHP_METHOD(PDO, getAvailableDrivers) -{ - HashPosition pos; - pdo_driver_t **pdriver; - - array_init(return_value); - - zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos); - while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) { - add_next_index_stringl(return_value, (char*)(*pdriver)->driver_name, (*pdriver)->driver_name_len, 1); - zend_hash_move_forward_ex(&pdo_driver_hash, &pos); - } -} -/* }}} */ - -function_entry pdo_dbh_functions[] = { - ZEND_MALIAS(PDO, __construct, dbh_constructor, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, prepare, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, beginTransaction,NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, commit, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, rollBack, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, setAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, exec, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, query, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, lastInsertId, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, errorCode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, errorInfo, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, getAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, quote, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, __wakeup, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(PDO, __sleep, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(PDO, getAvailableDrivers, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} -}; - -/* {{{ overloaded object handlers for PDO class */ -int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC) -{ - function_entry *funcs; - zend_function func; - zend_internal_function *ifunc = (zend_internal_function*)&func; - int namelen; - char *lc_name; - - if (!dbh->methods->get_driver_methods) { - return 0; - } - funcs = dbh->methods->get_driver_methods(dbh, - PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC); - if (!funcs) { - return 0; - } - - if (!(dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent))) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO methods."); - } - zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, NULL, dbh->is_persistent, 0); - - while (funcs->fname) { - ifunc->type = ZEND_INTERNAL_FUNCTION; - ifunc->handler = funcs->handler; - ifunc->function_name = funcs->fname; - ifunc->scope = dbh->ce; - ifunc->prototype = NULL; - if (funcs->arg_info) { - ifunc->arg_info = funcs->arg_info + 1; - ifunc->num_args = funcs->num_args; - if (funcs->arg_info[0].required_num_args == -1) { - ifunc->required_num_args = funcs->num_args; - } else { - ifunc->required_num_args = funcs->arg_info[0].required_num_args; - } - ifunc->pass_rest_by_reference = funcs->arg_info[0].pass_by_reference; - ifunc->return_reference = funcs->arg_info[0].return_reference; - } else { - ifunc->arg_info = NULL; - ifunc->num_args = 0; - ifunc->required_num_args = 0; - ifunc->pass_rest_by_reference = 0; - ifunc->return_reference = 0; - } - if (funcs->flags) { - ifunc->fn_flags = funcs->flags; - } else { - ifunc->fn_flags = ZEND_ACC_PUBLIC; - } - namelen = strlen(funcs->fname); - lc_name = emalloc(namelen+1); - zend_str_tolower_copy(lc_name, funcs->fname, namelen); - zend_hash_add(dbh->cls_methods[kind], lc_name, namelen+1, &func, sizeof(func), NULL); - efree(lc_name); - funcs++; - } - - return 1; -} - -static union _zend_function *dbh_method_get( -#if PHP_API_VERSION >= 20041225 - zval **object_pp, -#else - zval *object, -#endif - char *method_name, int method_len TSRMLS_DC) -{ - zend_function *fbc = NULL; - char *lc_method_name; -#if PHP_API_VERSION >= 20041225 - zval *object = *object_pp; -#endif - pdo_dbh_t *dbh = zend_object_store_get_object(object TSRMLS_CC); -#ifdef IS_UNICODE - zend_uchar ztype = UG(unicode) ? IS_UNICODE : IS_STRING; -#endif - - lc_method_name = zend_u_str_tolower_dup(ztype, method_name, method_len); - - if (zend_u_hash_find(&dbh->ce->function_table, ztype, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { - /* not a pre-defined method, nor a user-defined method; check - * the driver specific methods */ - if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) { - if (!pdo_hash_methods(dbh, - PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC) - || !dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) { - goto out; - } - } - - if (zend_u_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH], - ztype, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { - fbc = NULL; - goto out; - } - /* got it */ - } - -out: - efree(lc_method_name); - return fbc; -} - -static int dbh_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - return -1; -} - -static zend_object_handlers pdo_dbh_object_handlers; - -void pdo_dbh_init(TSRMLS_D) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions); - pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC); - pdo_dbh_ce->create_object = pdo_dbh_new; - - memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - pdo_dbh_object_handlers.get_method = dbh_method_get; - pdo_dbh_object_handlers.compare_objects = dbh_compare; - - REGISTER_PDO_CLASS_CONST_LONG("PARAM_BOOL", (long)PDO_PARAM_BOOL); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_NULL", (long)PDO_PARAM_NULL); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_INT", (long)PDO_PARAM_INT); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_STR", (long)PDO_PARAM_STR); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_LOB", (long)PDO_PARAM_LOB); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_STMT", (long)PDO_PARAM_STMT); - REGISTER_PDO_CLASS_CONST_LONG("PARAM_INPUT_OUTPUT", (long)PDO_PARAM_INPUT_OUTPUT); - - REGISTER_PDO_CLASS_CONST_LONG("FETCH_LAZY", (long)PDO_FETCH_LAZY); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ASSOC",(long)PDO_FETCH_ASSOC); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_NUM", (long)PDO_FETCH_NUM); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_BOTH", (long)PDO_FETCH_BOTH); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_OBJ", (long)PDO_FETCH_OBJ); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_BOUND",(long)PDO_FETCH_BOUND); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_COLUMN",(long)PDO_FETCH_COLUMN); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_CLASS",(long)PDO_FETCH_CLASS); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_INTO", (long)PDO_FETCH_INTO); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_FUNC", (long)PDO_FETCH_FUNC); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_GROUP",(long)PDO_FETCH_GROUP); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_UNIQUE",(long)PDO_FETCH_UNIQUE); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_CLASSTYPE",(long)PDO_FETCH_CLASSTYPE); -#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1 - REGISTER_PDO_CLASS_CONST_LONG("FETCH_SERIALIZE",(long)PDO_FETCH_SERIALIZE); -#endif - REGISTER_PDO_CLASS_CONST_LONG("FETCH_NAMED",(long)PDO_FETCH_NAMED); - - REGISTER_PDO_CLASS_CONST_LONG("ATTR_AUTOCOMMIT", (long)PDO_ATTR_AUTOCOMMIT); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_PREFETCH", (long)PDO_ATTR_PREFETCH); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_TIMEOUT", (long)PDO_ATTR_TIMEOUT); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_ERRMODE", (long)PDO_ATTR_ERRMODE); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_SERVER_VERSION", (long)PDO_ATTR_SERVER_VERSION); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_CLIENT_VERSION", (long)PDO_ATTR_CLIENT_VERSION); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_SERVER_INFO", (long)PDO_ATTR_SERVER_INFO); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_CONNECTION_STATUS", (long)PDO_ATTR_CONNECTION_STATUS); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_CASE", (long)PDO_ATTR_CASE); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_CURSOR_NAME", (long)PDO_ATTR_CURSOR_NAME); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_CURSOR", (long)PDO_ATTR_CURSOR); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_ORACLE_NULLS", (long)PDO_ATTR_ORACLE_NULLS); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_PERSISTENT", (long)PDO_ATTR_PERSISTENT); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_STATEMENT_CLASS", (long)PDO_ATTR_STATEMENT_CLASS); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_FETCH_TABLE_NAMES", (long)PDO_ATTR_FETCH_TABLE_NAMES); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_FETCH_CATALOG_NAMES", (long)PDO_ATTR_FETCH_CATALOG_NAMES); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_DRIVER_NAME", (long)PDO_ATTR_DRIVER_NAME); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_STRINGIFY_FETCHES",(long)PDO_ATTR_STRINGIFY_FETCHES); - REGISTER_PDO_CLASS_CONST_LONG("ATTR_MAX_COLUMN_LEN",(long)PDO_ATTR_MAX_COLUMN_LEN); - - REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_SILENT", (long)PDO_ERRMODE_SILENT); - REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_WARNING", (long)PDO_ERRMODE_WARNING); - REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_EXCEPTION", (long)PDO_ERRMODE_EXCEPTION); - - REGISTER_PDO_CLASS_CONST_LONG("CASE_NATURAL", (long)PDO_CASE_NATURAL); - REGISTER_PDO_CLASS_CONST_LONG("CASE_LOWER", (long)PDO_CASE_LOWER); - REGISTER_PDO_CLASS_CONST_LONG("CASE_UPPER", (long)PDO_CASE_UPPER); - - REGISTER_PDO_CLASS_CONST_LONG("NULL_NATURAL", (long)PDO_NULL_NATURAL); - REGISTER_PDO_CLASS_CONST_LONG("NULL_EMPTY_STRING", (long)PDO_NULL_EMPTY_STRING); - REGISTER_PDO_CLASS_CONST_LONG("NULL_TO_STRING", (long)PDO_NULL_TO_STRING); - - REGISTER_PDO_CLASS_CONST_STRING("ERR_NONE", PDO_ERR_NONE); - - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_NEXT", (long)PDO_FETCH_ORI_NEXT); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_PRIOR", (long)PDO_FETCH_ORI_PRIOR); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_FIRST", (long)PDO_FETCH_ORI_FIRST); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_LAST", (long)PDO_FETCH_ORI_LAST); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_ABS", (long)PDO_FETCH_ORI_ABS); - REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_REL", (long)PDO_FETCH_ORI_REL); - - REGISTER_PDO_CLASS_CONST_LONG("CURSOR_FWDONLY", (long)PDO_CURSOR_FWDONLY); - REGISTER_PDO_CLASS_CONST_LONG("CURSOR_SCROLL", (long)PDO_CURSOR_SCROLL); - -#if 0 - REGISTER_PDO_CLASS_CONST_LONG("ERR_CANT_MAP", (long)PDO_ERR_CANT_MAP); - REGISTER_PDO_CLASS_CONST_LONG("ERR_SYNTAX", (long)PDO_ERR_SYNTAX); - REGISTER_PDO_CLASS_CONST_LONG("ERR_CONSTRAINT", (long)PDO_ERR_CONSTRAINT); - REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_FOUND", (long)PDO_ERR_NOT_FOUND); - REGISTER_PDO_CLASS_CONST_LONG("ERR_ALREADY_EXISTS", (long)PDO_ERR_ALREADY_EXISTS); - REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_IMPLEMENTED", (long)PDO_ERR_NOT_IMPLEMENTED); - REGISTER_PDO_CLASS_CONST_LONG("ERR_MISMATCH", (long)PDO_ERR_MISMATCH); - REGISTER_PDO_CLASS_CONST_LONG("ERR_TRUNCATED", (long)PDO_ERR_TRUNCATED); - REGISTER_PDO_CLASS_CONST_LONG("ERR_DISCONNECTED", (long)PDO_ERR_DISCONNECTED); - REGISTER_PDO_CLASS_CONST_LONG("ERR_NO_PERM", (long)PDO_ERR_NO_PERM); -#endif - -} - -static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) -{ - if (--dbh->refcount) - return; - - if (dbh->methods) { - dbh->methods->closer(dbh TSRMLS_CC); - } - - if (dbh->data_source) { - pefree((char *)dbh->data_source, dbh->is_persistent); - } - if (dbh->username) { - pefree(dbh->username, dbh->is_persistent); - } - if (dbh->password) { - pefree(dbh->password, dbh->is_persistent); - } - - if (dbh->def_stmt_ctor_args) { - zval_ptr_dtor(&dbh->def_stmt_ctor_args); - } - - pefree(dbh, dbh->is_persistent); -} - -static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) -{ - if (dbh->in_txn && dbh->methods && dbh->methods->rollback) { - dbh->methods->rollback(dbh TSRMLS_CC); - dbh->in_txn = 0; - } - - if (dbh->properties) { - zend_hash_destroy(dbh->properties); - efree(dbh->properties); - dbh->properties = NULL; - } - if (dbh->cls_methods) { - zend_hash_destroy(&dbh->cls_methods); - } - - if (!dbh->is_persistent) { - dbh_free(dbh TSRMLS_CC); - } else if (dbh->methods->persistent_shutdown) { - dbh->methods->persistent_shutdown(dbh TSRMLS_CC); - } -} - -zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - pdo_dbh_t *dbh; - zval *tmp; - - dbh = emalloc(sizeof(*dbh)); - memset(dbh, 0, sizeof(*dbh)); - dbh->ce = ce; - dbh->refcount = 1; - ALLOC_HASHTABLE(dbh->properties); - zend_hash_init(dbh->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(dbh->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - dbh->def_stmt_ce = U_CLASS_ENTRY(pdo_dbstmt_ce); - - retval.handle = zend_objects_store_put(dbh, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbh_free_storage, NULL TSRMLS_CC); - retval.handlers = &pdo_dbh_object_handlers; - - return retval; -} - -/* }}} */ - -ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor) -{ - if (rsrc->ptr) { - pdo_dbh_t *dbh = (pdo_dbh_t*)rsrc->ptr; - dbh_free(dbh TSRMLS_CC); - rsrc->ptr = NULL; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c deleted file mode 100644 index a0a2852acb0f6..0000000000000 --- a/ext/pdo/pdo_sql_parser.c +++ /dev/null @@ -1,712 +0,0 @@ -/* Generated by re2c 0.9.9.rc1 on Sun Sep 11 00:03:44 2005 */ -#line 1 "pdo_sql_parser.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" - -#define PDO_PARSER_TEXT 1 -#define PDO_PARSER_BIND 2 -#define PDO_PARSER_BIND_POS 3 -#define PDO_PARSER_EOI 4 - -#define RET(i) {s->cur = cursor; return i; } - -#define YYCTYPE char -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) - -typedef struct Scanner { - char *lim, *ptr, *cur, *tok; -} Scanner; - -static int scan(Scanner *s) -{ - char *cursor = s->cur; - - s->tok = cursor; - #line 55 "pdo_sql_parser.re" - - - { - static unsigned char yybm[] = { - 0, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 52, 162, 162, 162, 162, 196, - 162, 162, 162, 162, 162, 162, 162, 162, - 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 244, 162, 162, 162, 162, 244, - 162, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 162, 2, 162, 162, 170, - 162, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - }; - -#line 89 "<stdout>" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy0; - ++YYCURSOR; -yy0: - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - if(yybm[0+yych] & 2) { - goto yy8; - } - if(yych <= 0x00) goto yy11; - if(yych <= '&') goto yy2; - if(yych <= '\'') goto yy4; - if(yych <= '>') goto yy5; - goto yy6; -yy2: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 64) { - goto yy30; - } - if(yych <= 0x00) goto yy3; - if(yych == '"') goto yy28; - goto yy33; -yy3: -#line 63 "pdo_sql_parser.re" -{ RET(PDO_PARSER_TEXT); } -#line 117 "<stdout>" -yy4: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yybm[0+yych] & 16) { - goto yy19; - } - if(yych <= 0x00) goto yy3; - if(yych == '\'') goto yy21; - goto yy24; -yy5: yych = *++YYCURSOR; - if(yybm[0+yych] & 4) { - goto yy13; - } - if(yych <= 'Z'){ - if(yych <= '/') goto yy3; - if(yych <= ':') goto yy16; - if(yych <= '@') goto yy3; - goto yy16; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy3; - goto yy16; - } else { - if(yych <= '`') goto yy3; - if(yych <= 'z') goto yy16; - goto yy3; - } - } -yy6: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 4) { - yych = *YYCURSOR; - goto yy13; - } - goto yy7; -yy7: -#line 62 "pdo_sql_parser.re" -{ RET(PDO_PARSER_BIND_POS); } -#line 154 "<stdout>" -yy8: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy9; -yy9: if(yybm[0+yych] & 2) { - goto yy8; - } - goto yy10; -yy10: -#line 64 "pdo_sql_parser.re" -{ RET(PDO_PARSER_TEXT); } -#line 166 "<stdout>" -yy11: ++YYCURSOR; - goto yy12; -yy12: -#line 65 "pdo_sql_parser.re" -{ RET(PDO_PARSER_EOI); } -#line 172 "<stdout>" -yy13: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy14; -yy14: if(yybm[0+yych] & 4) { - goto yy13; - } - goto yy15; -yy15: -#line 60 "pdo_sql_parser.re" -{ RET(PDO_PARSER_TEXT); } -#line 184 "<stdout>" -yy16: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy17; -yy17: if(yybm[0+yych] & 8) { - goto yy16; - } - goto yy18; -yy18: -#line 61 "pdo_sql_parser.re" -{ RET(PDO_PARSER_BIND); } -#line 196 "<stdout>" -yy19: yyaccept = 1; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy20; -yy20: if(yybm[0+yych] & 16) { - goto yy19; - } - if(yych <= '\''){ - if(yych <= 0x00) goto yy15; - if(yych <= '&') goto yy23; - goto yy21; - } else { - if(yych == '\\') goto yy26; - goto yy23; - } -yy21: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 4) { - yych = *YYCURSOR; - goto yy13; - } - goto yy22; -yy22: -#line 59 "pdo_sql_parser.re" -{ RET(PDO_PARSER_TEXT); } -#line 222 "<stdout>" -yy23: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy24; -yy24: if(yybm[0+yych] & 32) { - goto yy23; - } - if(yych <= 0x00) goto yy25; - if(yych <= '[') goto yy27; - goto yy26; -yy25: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 1: goto yy15; - case 0: goto yy3; - } -yy26: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '\'') goto yy23; - goto yy25; -yy27: yych = *++YYCURSOR; - goto yy22; -yy28: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 4) { - yych = *YYCURSOR; - goto yy13; - } - goto yy29; -yy29: -#line 58 "pdo_sql_parser.re" -{ RET(PDO_PARSER_TEXT); } -#line 254 "<stdout>" -yy30: yyaccept = 1; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy31; -yy31: if(yybm[0+yych] & 64) { - goto yy30; - } - if(yych <= '"'){ - if(yych <= 0x00) goto yy15; - if(yych >= '"') goto yy28; - goto yy32; - } else { - if(yych == '\\') goto yy34; - goto yy32; - } -yy32: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy33; -yy33: if(yybm[0+yych] & 128) { - goto yy32; - } - if(yych <= 0x00) goto yy25; - if(yych <= '[') goto yy35; - goto yy34; -yy34: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '"') goto yy32; - goto yy25; -yy35: ++YYCURSOR; - yych = *YYCURSOR; - goto yy29; -} -} -#line 66 "pdo_sql_parser.re" - -} - -struct placeholder { - char *pos; - int len; - int bindno; - int qlen; /* quoted length of value */ - char *quoted; /* quoted value */ - int freeq; - struct placeholder *next; -}; - -PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, - char **outquery, int *outquery_len TSRMLS_DC) -{ - Scanner s; - char *ptr, *newbuffer; - int t; - int bindno = 0; - int ret = 0; - int newbuffer_len; - HashTable *params; - struct pdo_bound_param_data *param; - int query_type = PDO_PLACEHOLDER_NONE; - struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL; - - ptr = *outquery; - s.cur = inquery; - s.lim = inquery + inquery_len; - - /* phase 1: look for args */ - while((t = scan(&s)) != PDO_PARSER_EOI) { - if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) { - if (t == PDO_PARSER_BIND) { - query_type |= PDO_PLACEHOLDER_NAMED; - } else { - query_type |= PDO_PLACEHOLDER_POSITIONAL; - } - - plc = emalloc(sizeof(*plc)); - memset(plc, 0, sizeof(*plc)); - plc->next = NULL; - plc->pos = s.tok; - plc->len = s.cur - s.tok; - plc->bindno = bindno++; - - if (placetail) { - placetail->next = plc; - } else { - placeholders = plc; - } - placetail = plc; - } - } - - if (bindno == 0) { - /* nothing to do; good! */ - return 0; - } - - /* did the query make sense to me? */ - if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) { - /* they mixed both types; punt */ - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC); - return -1; - } - - - if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) { - /* query matches native syntax */ - ret = 0; - goto clean_up; - } - - if (stmt->named_rewrite_template) { - /* magic/hack. - * We we pretend that the query was positional even if - * it was named so that we fall into the - * named rewrite case below. Not too pretty, - * but it works. */ - query_type = PDO_PLACEHOLDER_POSITIONAL; - } - - params = stmt->bound_params; - - /* Do we have placeholders but no bound params */ - if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC); - ret = -1; - goto clean_up; - } - - /* what are we going to do ? */ - - if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - /* query generation */ - - newbuffer_len = inquery_len; - - /* let's quote all the values */ - for (plc = placeholders; plc; plc = plc->next) { - if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - ret = zend_hash_index_find(params, plc->bindno, (void**) ¶m); - } else { - ret = zend_hash_find(params, plc->pos, plc->len, (void**) ¶m); - } - if (ret == FAILURE) { - /* parameter was not defined */ - ret = -1; - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); - goto clean_up; - } - if (stmt->dbh->methods->quoter) { - if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(param->parameter) == IS_RESOURCE) { - php_stream *stm; - - php_stream_from_zval_no_verify(stm, ¶m->parameter); - if (stm) { - size_t len; - char *buf = NULL; - - len = php_stream_copy_to_mem(stm, &buf, PHP_STREAM_COPY_ALL, 0); - if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen, - param->param_type TSRMLS_CC)) { - /* bork */ - ret = -1; - strcpy(stmt->error_code, stmt->dbh->error_code); - efree(buf); - goto clean_up; - } - efree(buf); - - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC); - ret = -1; - goto clean_up; - } - plc->freeq = 1; - } else { - switch (Z_TYPE_P(param->parameter)) { - case IS_NULL: - plc->quoted = "NULL"; - plc->qlen = sizeof("NULL")-1; - plc->freeq = 0; - break; - - case IS_LONG: - case IS_DOUBLE: - convert_to_string(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - plc->quoted = Z_STRVAL_P(param->parameter); - plc->freeq = 0; - break; - - case IS_BOOL: - convert_to_long(param->parameter); - default: - convert_to_string(param->parameter); - if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen, - param->param_type TSRMLS_CC)) { - /* bork */ - ret = -1; - strcpy(stmt->error_code, stmt->dbh->error_code); - goto clean_up; - } - plc->freeq = 1; - } - } - } else { - plc->quoted = Z_STRVAL_P(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - } - newbuffer_len += plc->qlen; - } - -rewrite: - /* allocate output buffer */ - newbuffer = emalloc(newbuffer_len + 1); - *outquery = newbuffer; - - /* and build the query */ - plc = placeholders; - ptr = inquery; - - do { - t = plc->pos - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - memcpy(newbuffer, plc->quoted, plc->qlen); - newbuffer += plc->qlen; - ptr = plc->pos + plc->len; - - plc = plc->next; - } while (plc); - - t = (inquery + inquery_len) - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - *newbuffer = '\0'; - *outquery_len = newbuffer - *outquery; - - ret = 1; - goto clean_up; - - } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - /* rewrite ? to :pdoX */ - char idxbuf[32]; - const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d"; - char *name; - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - snprintf(idxbuf, sizeof(idxbuf), tmpl, plc->bindno + 1); - plc->quoted = estrdup(idxbuf); - plc->qlen = strlen(plc->quoted); - plc->freeq = 1; - newbuffer_len += plc->qlen; - - name = estrndup(plc->pos, plc->len); - - if (stmt->named_rewrite_template) { - /* create a mapping */ - - zend_hash_update(stmt->bound_param_map, name, plc->len + 1, idxbuf, plc->qlen + 1, NULL); - } - - /* map number to name */ - zend_hash_index_update(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1, NULL); - - efree(name); - } - - goto rewrite; - - } else { - /* rewrite :name to ? */ - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - char *name; - - name = estrndup(plc->pos, plc->len); - zend_hash_index_update(stmt->bound_param_map, plc->bindno, name, plc->len + 1, NULL); - efree(name); - plc->quoted = "?"; - plc->qlen = 1; - } - - goto rewrite; - } - -clean_up: - - while (placeholders) { - plc = placeholders; - placeholders = plc->next; - - if (plc->freeq) { - efree(plc->quoted); - } - - efree(plc); - } - - return ret; -} - -#if 0 -int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery, - int *outquery_len TSRMLS_DC) -{ - Scanner s; - char *ptr; - int t; - int bindno = 0; - int newbuffer_len; - int padding; - HashTable *params = stmt->bound_params; - struct pdo_bound_param_data *param; - /* allocate buffer for query with expanded binds, ptr is our writing pointer */ - newbuffer_len = inquery_len; - - /* calculate the possible padding factor due to quoting */ - if(stmt->dbh->max_escaped_char_length) { - padding = stmt->dbh->max_escaped_char_length; - } else { - padding = 3; - } - if(params) { - zend_hash_internal_pointer_reset(params); - while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { - if(param->parameter) { - convert_to_string(param->parameter); - /* accomodate a string that needs to be fully quoted - bind placeholders are at least 2 characters, so - the accomodate their own "'s - */ - newbuffer_len += padding * Z_STRLEN_P(param->parameter); - } - zend_hash_move_forward(params); - } - } - *outquery = (char *) emalloc(newbuffer_len + 1); - *outquery_len = 0; - - ptr = *outquery; - s.cur = inquery; - s.lim = inquery + inquery_len; - while((t = scan(&s)) != PDO_PARSER_EOI) { - if(t == PDO_PARSER_TEXT) { - memcpy(ptr, s.tok, s.cur - s.tok); - ptr += (s.cur - s.tok); - *outquery_len += (s.cur - s.tok); - } - else if(t == PDO_PARSER_BIND) { - if(!params) { - /* error */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - /* lookup bind first via hash and then index */ - /* stupid keys need to be null-terminated, even though we know their length */ - if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)¶m)) - || - (SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m))) - { - char *quotedstr; - int quotedstrlen; - /* restore the in-string key, doesn't need null-termination here */ - /* currently everything is a string here */ - - /* quote the bind value if necessary */ - if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), "edstr, "edstrlen TSRMLS_CC)) - { - memcpy(ptr, quotedstr, quotedstrlen); - ptr += quotedstrlen; - *outquery_len += quotedstrlen; - efree(quotedstr); - } else { - memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter)); - ptr += Z_STRLEN_P(param->parameter); - *outquery_len += (Z_STRLEN_P(param->parameter)); - } - } - else { - /* error and cleanup */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - bindno++; - } - else if(t == PDO_PARSER_BIND_POS) { - if(!params) { - /* error */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - /* lookup bind by index */ - if(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)) - { - char *quotedstr; - int quotedstrlen; - /* currently everything is a string here */ - - /* quote the bind value if necessary */ - if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), "edstr, "edstrlen TSRMLS_CC)) - { - memcpy(ptr, quotedstr, quotedstrlen); - ptr += quotedstrlen; - *outquery_len += quotedstrlen; - efree(quotedstr); - } else { - memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter)); - ptr += Z_STRLEN_P(param->parameter); - *outquery_len += (Z_STRLEN_P(param->parameter)); - } - } - else { - /* error and cleanup */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - bindno++; - } - } - *ptr = '\0'; - return 0; -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker ft=c - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re deleted file mode 100644 index eeae984573c70..0000000000000 --- a/ext/pdo/pdo_sql_parser.re +++ /dev/null @@ -1,487 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" - -#define PDO_PARSER_TEXT 1 -#define PDO_PARSER_BIND 2 -#define PDO_PARSER_BIND_POS 3 -#define PDO_PARSER_EOI 4 - -#define RET(i) {s->cur = cursor; return i; } - -#define YYCTYPE char -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) - -typedef struct Scanner { - char *lim, *ptr, *cur, *tok; -} Scanner; - -static int scan(Scanner *s) -{ - char *cursor = s->cur; - - s->tok = cursor; - /*!re2c - BINDCHR = [:][a-zA-Z0-9_]+; - QUESTION = [?]; - SPECIALS = [:?"']; - ESCQQ = [\\]["]; - ESCQ = [\\][']; - EOF = [\000]; - ANYNOEOF = [\001-\377]; - */ - - /*!re2c - (["] (ESCQQ|ANYNOEOF\[\\"])* ["]) { RET(PDO_PARSER_TEXT); } - (['] (ESCQ|ANYNOEOF\[\\'])* [']) { RET(PDO_PARSER_TEXT); } - SPECIALS{2,} { RET(PDO_PARSER_TEXT); } - BINDCHR { RET(PDO_PARSER_BIND); } - QUESTION { RET(PDO_PARSER_BIND_POS); } - SPECIALS { RET(PDO_PARSER_TEXT); } - (ANYNOEOF\SPECIALS)+ { RET(PDO_PARSER_TEXT); } - EOF { RET(PDO_PARSER_EOI); } - */ -} - -struct placeholder { - char *pos; - int len; - int bindno; - int qlen; /* quoted length of value */ - char *quoted; /* quoted value */ - int freeq; - struct placeholder *next; -}; - -PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, - char **outquery, int *outquery_len TSRMLS_DC) -{ - Scanner s; - char *ptr, *newbuffer; - int t; - int bindno = 0; - int ret = 0; - int newbuffer_len; - HashTable *params; - struct pdo_bound_param_data *param; - int query_type = PDO_PLACEHOLDER_NONE; - struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL; - - ptr = *outquery; - s.cur = inquery; - s.lim = inquery + inquery_len; - - /* phase 1: look for args */ - while((t = scan(&s)) != PDO_PARSER_EOI) { - if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) { - if (t == PDO_PARSER_BIND) { - query_type |= PDO_PLACEHOLDER_NAMED; - } else { - query_type |= PDO_PLACEHOLDER_POSITIONAL; - } - - plc = emalloc(sizeof(*plc)); - memset(plc, 0, sizeof(*plc)); - plc->next = NULL; - plc->pos = s.tok; - plc->len = s.cur - s.tok; - plc->bindno = bindno++; - - if (placetail) { - placetail->next = plc; - } else { - placeholders = plc; - } - placetail = plc; - } - } - - if (bindno == 0) { - /* nothing to do; good! */ - return 0; - } - - /* did the query make sense to me? */ - if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) { - /* they mixed both types; punt */ - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC); - return -1; - } - - - if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) { - /* query matches native syntax */ - ret = 0; - goto clean_up; - } - - if (stmt->named_rewrite_template) { - /* magic/hack. - * We we pretend that the query was positional even if - * it was named so that we fall into the - * named rewrite case below. Not too pretty, - * but it works. */ - query_type = PDO_PLACEHOLDER_POSITIONAL; - } - - params = stmt->bound_params; - - /* Do we have placeholders but no bound params */ - if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC); - ret = -1; - goto clean_up; - } - - /* what are we going to do ? */ - - if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) { - /* query generation */ - - newbuffer_len = inquery_len; - - /* let's quote all the values */ - for (plc = placeholders; plc; plc = plc->next) { - if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - ret = zend_hash_index_find(params, plc->bindno, (void**) ¶m); - } else { - ret = zend_hash_find(params, plc->pos, plc->len, (void**) ¶m); - } - if (ret == FAILURE) { - /* parameter was not defined */ - ret = -1; - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); - goto clean_up; - } - if (stmt->dbh->methods->quoter) { - if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(param->parameter) == IS_RESOURCE) { - php_stream *stm; - - php_stream_from_zval_no_verify(stm, ¶m->parameter); - if (stm) { - size_t len; - char *buf = NULL; - - len = php_stream_copy_to_mem(stm, &buf, PHP_STREAM_COPY_ALL, 0); - if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen, - param->param_type TSRMLS_CC)) { - /* bork */ - ret = -1; - strcpy(stmt->error_code, stmt->dbh->error_code); - efree(buf); - goto clean_up; - } - efree(buf); - - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC); - ret = -1; - goto clean_up; - } - plc->freeq = 1; - } else { - switch (Z_TYPE_P(param->parameter)) { - case IS_NULL: - plc->quoted = "NULL"; - plc->qlen = sizeof("NULL")-1; - plc->freeq = 0; - break; - - case IS_LONG: - case IS_DOUBLE: - convert_to_string(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - plc->quoted = Z_STRVAL_P(param->parameter); - plc->freeq = 0; - break; - - case IS_BOOL: - convert_to_long(param->parameter); - default: - convert_to_string(param->parameter); - if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen, - param->param_type TSRMLS_CC)) { - /* bork */ - ret = -1; - strcpy(stmt->error_code, stmt->dbh->error_code); - goto clean_up; - } - plc->freeq = 1; - } - } - } else { - plc->quoted = Z_STRVAL_P(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - } - newbuffer_len += plc->qlen; - } - -rewrite: - /* allocate output buffer */ - newbuffer = emalloc(newbuffer_len + 1); - *outquery = newbuffer; - - /* and build the query */ - plc = placeholders; - ptr = inquery; - - do { - t = plc->pos - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - memcpy(newbuffer, plc->quoted, plc->qlen); - newbuffer += plc->qlen; - ptr = plc->pos + plc->len; - - plc = plc->next; - } while (plc); - - t = (inquery + inquery_len) - ptr; - if (t) { - memcpy(newbuffer, ptr, t); - newbuffer += t; - } - *newbuffer = '\0'; - *outquery_len = newbuffer - *outquery; - - ret = 1; - goto clean_up; - - } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) { - /* rewrite ? to :pdoX */ - char idxbuf[32]; - const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d"; - char *name; - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - snprintf(idxbuf, sizeof(idxbuf), tmpl, plc->bindno + 1); - plc->quoted = estrdup(idxbuf); - plc->qlen = strlen(plc->quoted); - plc->freeq = 1; - newbuffer_len += plc->qlen; - - name = estrndup(plc->pos, plc->len); - - if (stmt->named_rewrite_template) { - /* create a mapping */ - - zend_hash_update(stmt->bound_param_map, name, plc->len + 1, idxbuf, plc->qlen + 1, NULL); - } - - /* map number to name */ - zend_hash_index_update(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1, NULL); - - efree(name); - } - - goto rewrite; - - } else { - /* rewrite :name to ? */ - - newbuffer_len = inquery_len; - - if (stmt->bound_param_map == NULL) { - ALLOC_HASHTABLE(stmt->bound_param_map); - zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0); - } - - for (plc = placeholders; plc; plc = plc->next) { - char *name; - - name = estrndup(plc->pos, plc->len); - zend_hash_index_update(stmt->bound_param_map, plc->bindno, name, plc->len + 1, NULL); - efree(name); - plc->quoted = "?"; - plc->qlen = 1; - } - - goto rewrite; - } - -clean_up: - - while (placeholders) { - plc = placeholders; - placeholders = plc->next; - - if (plc->freeq) { - efree(plc->quoted); - } - - efree(plc); - } - - return ret; -} - -#if 0 -int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery, - int *outquery_len TSRMLS_DC) -{ - Scanner s; - char *ptr; - int t; - int bindno = 0; - int newbuffer_len; - int padding; - HashTable *params = stmt->bound_params; - struct pdo_bound_param_data *param; - /* allocate buffer for query with expanded binds, ptr is our writing pointer */ - newbuffer_len = inquery_len; - - /* calculate the possible padding factor due to quoting */ - if(stmt->dbh->max_escaped_char_length) { - padding = stmt->dbh->max_escaped_char_length; - } else { - padding = 3; - } - if(params) { - zend_hash_internal_pointer_reset(params); - while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { - if(param->parameter) { - convert_to_string(param->parameter); - /* accomodate a string that needs to be fully quoted - bind placeholders are at least 2 characters, so - the accomodate their own "'s - */ - newbuffer_len += padding * Z_STRLEN_P(param->parameter); - } - zend_hash_move_forward(params); - } - } - *outquery = (char *) emalloc(newbuffer_len + 1); - *outquery_len = 0; - - ptr = *outquery; - s.cur = inquery; - s.lim = inquery + inquery_len; - while((t = scan(&s)) != PDO_PARSER_EOI) { - if(t == PDO_PARSER_TEXT) { - memcpy(ptr, s.tok, s.cur - s.tok); - ptr += (s.cur - s.tok); - *outquery_len += (s.cur - s.tok); - } - else if(t == PDO_PARSER_BIND) { - if(!params) { - /* error */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - /* lookup bind first via hash and then index */ - /* stupid keys need to be null-terminated, even though we know their length */ - if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)¶m)) - || - (SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m))) - { - char *quotedstr; - int quotedstrlen; - /* restore the in-string key, doesn't need null-termination here */ - /* currently everything is a string here */ - - /* quote the bind value if necessary */ - if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), "edstr, "edstrlen TSRMLS_CC)) - { - memcpy(ptr, quotedstr, quotedstrlen); - ptr += quotedstrlen; - *outquery_len += quotedstrlen; - efree(quotedstr); - } else { - memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter)); - ptr += Z_STRLEN_P(param->parameter); - *outquery_len += (Z_STRLEN_P(param->parameter)); - } - } - else { - /* error and cleanup */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - bindno++; - } - else if(t == PDO_PARSER_BIND_POS) { - if(!params) { - /* error */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - /* lookup bind by index */ - if(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)) - { - char *quotedstr; - int quotedstrlen; - /* currently everything is a string here */ - - /* quote the bind value if necessary */ - if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), "edstr, "edstrlen TSRMLS_CC)) - { - memcpy(ptr, quotedstr, quotedstrlen); - ptr += quotedstrlen; - *outquery_len += quotedstrlen; - efree(quotedstr); - } else { - memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter)); - ptr += Z_STRLEN_P(param->parameter); - *outquery_len += (Z_STRLEN_P(param->parameter)); - } - } - else { - /* error and cleanup */ - efree(*outquery); - *outquery = NULL; - return (int) (s.cur - inquery); - } - bindno++; - } - } - *ptr = '\0'; - return 0; -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker ft=c - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c deleted file mode 100644 index 07f2589aa4f02..0000000000000 --- a/ext/pdo/pdo_sqlstate.c +++ /dev/null @@ -1,340 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pdo.h" -#include "php_pdo_driver.h" - -struct pdo_sqlstate_info { - char state[6]; - const char *desc; -}; - -static HashTable err_hash; - -static struct pdo_sqlstate_info err_initializer[] = { - { "00000", "No error" }, - { "01000", "Warning" }, - { "01001", "Cursor operation conflict" }, - { "01002", "Disconnect error" }, - { "01003", "NULL value eliminated in set function" }, - { "01004", "String data, right truncated" }, - { "01006", "Privilege not revoked" }, - { "01007", "Privilege not granted" }, - { "01008", "Implicit zero bit padding" }, - { "0100C", "Dynamic result sets returned" }, - { "01P01", "Deprecated feature" }, - { "01S00", "Invalid connection string attribute" }, - { "01S01", "Error in row" }, - { "01S02", "Option value changed" }, - { "01S06", "Attempt to fetch before the result set returned the first rowset" }, - { "01S07", "Fractional truncation" }, - { "01S08", "Error saving File DSN" }, - { "01S09", "Invalid keyword" }, - { "02000", "No data" }, - { "02001", "No additional dynamic result sets returned" }, - { "03000", "Sql statement not yet complete" }, - { "07002", "COUNT field incorrect" }, - { "07005", "Prepared statement not a cursor-specification" }, - { "07006", "Restricted data type attribute violation" }, - { "07009", "Invalid descriptor index" }, - { "07S01", "Invalid use of default parameter" }, - { "08000", "Connection exception" }, - { "08001", "Client unable to establish connection" }, - { "08002", "Connection name in use" }, - { "08003", "Connection does not exist" }, - { "08004", "Server rejected the connection" }, - { "08006", "Connection failure" }, - { "08007", "Connection failure during transaction" }, - { "08S01", "Communication link failure" }, - { "09000", "Triggered action exception" }, - { "0A000", "Feature not supported" }, - { "0B000", "Invalid transaction initiation" }, - { "0F000", "Locator exception" }, - { "0F001", "Invalid locator specification" }, - { "0L000", "Invalid grantor" }, - { "0LP01", "Invalid grant operation" }, - { "0P000", "Invalid role specification" }, - { "21000", "Cardinality violation" }, - { "21S01", "Insert value list does not match column list" }, - { "21S02", "Degree of derived table does not match column list" }, - { "22000", "Data exception" }, - { "22001", "String data, right truncated" }, - { "22002", "Indicator variable required but not supplied" }, - { "22003", "Numeric value out of range" }, - { "22004", "Null value not allowed" }, - { "22005", "Error in assignment" }, - { "22007", "Invalid datetime format" }, - { "22008", "Datetime field overflow" }, - { "22009", "Invalid time zone displacement value" }, - { "2200B", "Escape character conflict" }, - { "2200C", "Invalid use of escape character" }, - { "2200D", "Invalid escape octet" }, - { "2200F", "Zero length character string" }, - { "2200G", "Most specific type mismatch" }, - { "22010", "Invalid indicator parameter value" }, - { "22011", "Substring error" }, - { "22012", "Division by zero" }, - { "22015", "Interval field overflow" }, - { "22018", "Invalid character value for cast specification" }, - { "22019", "Invalid escape character" }, - { "2201B", "Invalid regular expression" }, - { "2201E", "Invalid argument for logarithm" }, - { "2201F", "Invalid argument for power function" }, - { "2201G", "Invalid argument for width bucket function" }, - { "22020", "Invalid limit value" }, - { "22021", "Character not in repertoire" }, - { "22022", "Indicator overflow" }, - { "22023", "Invalid parameter value" }, - { "22024", "Unterminated c string" }, - { "22025", "Invalid escape sequence" }, - { "22026", "String data, length mismatch" }, - { "22027", "Trim error" }, - { "2202E", "Array subscript error" }, - { "22P01", "Floating point exception" }, - { "22P02", "Invalid text representation" }, - { "22P03", "Invalid binary representation" }, - { "22P04", "Bad copy file format" }, - { "22P05", "Untranslatable character" }, - { "23000", "Integrity constraint violation" }, - { "23001", "Restrict violation" }, - { "23502", "Not null violation" }, - { "23503", "Foreign key violation" }, - { "23505", "Unique violation" }, - { "23514", "Check violation" }, - { "24000", "Invalid cursor state" }, - { "25000", "Invalid transaction state" }, - { "25001", "Active sql transaction" }, - { "25002", "Branch transaction already active" }, - { "25003", "Inappropriate access mode for branch transaction" }, - { "25004", "Inappropriate isolation level for branch transaction" }, - { "25005", "No active sql transaction for branch transaction" }, - { "25006", "Read only sql transaction" }, - { "25007", "Schema and data statement mixing not supported" }, - { "25008", "Held cursor requires same isolation level" }, - { "25P01", "No active sql transaction" }, - { "25P02", "In failed sql transaction" }, - { "25S01", "Transaction state" }, - { "25S02", "Transaction is still active" }, - { "25S03", "Transaction is rolled back" }, - { "26000", "Invalid sql statement name" }, - { "27000", "Triggered data change violation" }, - { "28000", "Invalid authorization specification" }, - { "2B000", "Dependent privilege descriptors still exist" }, - { "2BP01", "Dependent objects still exist" }, - { "2D000", "Invalid transaction termination" }, - { "2F000", "Sql routine exception" }, - { "2F002", "Modifying sql data not permitted" }, - { "2F003", "Prohibited sql statement attempted" }, - { "2F004", "Reading sql data not permitted" }, - { "2F005", "Function executed no return statement" }, - { "34000", "Invalid cursor name" }, - { "38000", "External routine exception" }, - { "38001", "Containing sql not permitted" }, - { "38002", "Modifying sql data not permitted" }, - { "38003", "Prohibited sql statement attempted" }, - { "38004", "Reading sql data not permitted" }, - { "39000", "External routine invocation exception" }, - { "39001", "Invalid sqlstate returned" }, - { "39004", "Null value not allowed" }, - { "39P01", "Trigger protocol violated" }, - { "39P02", "Srf protocol violated" }, - { "3B000", "Savepoint exception" }, - { "3B001", "Invalid savepoint specification" }, - { "3C000", "Duplicate cursor name" }, - { "3D000", "Invalid catalog name" }, - { "3F000", "Invalid schema name" }, - { "40000", "Transaction rollback" }, - { "40001", "Serialization failure" }, - { "40002", "Transaction integrity constraint violation" }, - { "40003", "Statement completion unknown" }, - { "40P01", "Deadlock detected" }, - { "42000", "Syntax error or access violation" }, - { "42501", "Insufficient privilege" }, - { "42601", "Syntax error" }, - { "42602", "Invalid name" }, - { "42611", "Invalid column definition" }, - { "42622", "Name too long" }, - { "42701", "Duplicate column" }, - { "42702", "Ambiguous column" }, - { "42703", "Undefined column" }, - { "42704", "Undefined object" }, - { "42710", "Duplicate object" }, - { "42712", "Duplicate alias" }, - { "42723", "Duplicate function" }, - { "42725", "Ambiguous function" }, - { "42803", "Grouping error" }, - { "42804", "Datatype mismatch" }, - { "42809", "Wrong object type" }, - { "42830", "Invalid foreign key" }, - { "42846", "Cannot coerce" }, - { "42883", "Undefined function" }, - { "42939", "Reserved name" }, - { "42P01", "Undefined table" }, - { "42P02", "Undefined parameter" }, - { "42P03", "Duplicate cursor" }, - { "42P04", "Duplicate database" }, - { "42P05", "Duplicate prepared statement" }, - { "42P06", "Duplicate schema" }, - { "42P07", "Duplicate table" }, - { "42P08", "Ambiguous parameter" }, - { "42P09", "Ambiguous alias" }, - { "42P10", "Invalid column reference" }, - { "42P11", "Invalid cursor definition" }, - { "42P12", "Invalid database definition" }, - { "42P13", "Invalid function definition" }, - { "42P14", "Invalid prepared statement definition" }, - { "42P15", "Invalid schema definition" }, - { "42P16", "Invalid table definition" }, - { "42P17", "Invalid object definition" }, - { "42P18", "Indeterminate datatype" }, - { "42S01", "Base table or view already exists" }, - { "42S02", "Base table or view not found" }, - { "42S11", "Index already exists" }, - { "42S12", "Index not found" }, - { "42S21", "Column already exists" }, - { "42S22", "Column not found" }, - { "44000", "WITH CHECK OPTION violation" }, - { "53000", "Insufficient resources" }, - { "53100", "Disk full" }, - { "53200", "Out of memory" }, - { "53300", "Too many connections" }, - { "54000", "Program limit exceeded" }, - { "54001", "Statement too complex" }, - { "54011", "Too many columns" }, - { "54023", "Too many arguments" }, - { "55000", "Object not in prerequisite state" }, - { "55006", "Object in use" }, - { "55P02", "Cant change runtime param" }, - { "55P03", "Lock not available" }, - { "57000", "Operator intervention" }, - { "57014", "Query canceled" }, - { "57P01", "Admin shutdown" }, - { "57P02", "Crash shutdown" }, - { "57P03", "Cannot connect now" }, - { "58030", "Io error" }, - { "58P01", "Undefined file" }, - { "58P02", "Duplicate file" }, - { "F0000", "Config file error" }, - { "F0001", "Lock file exists" }, - { "HY000", "General error" }, - { "HY001", "Memory allocation error" }, - { "HY003", "Invalid application buffer type" }, - { "HY004", "Invalid SQL data type" }, - { "HY007", "Associated statement is not prepared" }, - { "HY008", "Operation canceled" }, - { "HY009", "Invalid use of null pointer" }, - { "HY010", "Function sequence error" }, - { "HY011", "Attribute cannot be set now" }, - { "HY012", "Invalid transaction operation code" }, - { "HY013", "Memory management error" }, - { "HY014", "Limit on the number of handles exceeded" }, - { "HY015", "No cursor name available" }, - { "HY016", "Cannot modify an implementation row descriptor" }, - { "HY017", "Invalid use of an automatically allocated descriptor handle" }, - { "HY018", "Server declined cancel request" }, - { "HY019", "Non-character and non-binary data sent in pieces" }, - { "HY020", "Attempt to concatenate a null value" }, - { "HY021", "Inconsistent descriptor information" }, - { "HY024", "Invalid attribute value" }, - { "HY090", "Invalid string or buffer length" }, - { "HY091", "Invalid descriptor field identifier" }, - { "HY092", "Invalid attribute/option identifier" }, - { "HY093", "Invalid parameter number" }, - { "HY095", "Function type out of range" }, - { "HY096", "Invalid information type" }, - { "HY097", "Column type out of range" }, - { "HY098", "Scope type out of range" }, - { "HY099", "Nullable type out of range" }, - { "HY100", "Uniqueness option type out of range" }, - { "HY101", "Accuracy option type out of range" }, - { "HY103", "Invalid retrieval code" }, - { "HY104", "Invalid precision or scale value" }, - { "HY105", "Invalid parameter type" }, - { "HY106", "Fetch type out of range" }, - { "HY107", "Row value out of range" }, - { "HY109", "Invalid cursor position" }, - { "HY110", "Invalid driver completion" }, - { "HY111", "Invalid bookmark value" }, - { "HYC00", "Optional feature not implemented" }, - { "HYT00", "Timeout expired" }, - { "HYT01", "Connection timeout expired" }, - { "IM001", "Driver does not support this function" }, - { "IM002", "Data source name not found and no default driver specified" }, - { "IM003", "Specified driver could not be loaded" }, - { "IM004", "Driver's SQLAllocHandle on SQL_HANDLE_ENV failed" }, - { "IM005", "Driver's SQLAllocHandle on SQL_HANDLE_DBC failed" }, - { "IM006", "Driver's SQLSetConnectAttr failed" }, - { "IM007", "No data source or driver specified; dialog prohibited" }, - { "IM008", "Dialog failed" }, - { "IM009", "Unable to load translation DLL" }, - { "IM010", "Data source name too long" }, - { "IM011", "Driver name too long" }, - { "IM012", "DRIVER keyword syntax error" }, - { "IM013", "Trace file error" }, - { "IM014", "Invalid name of File DSN" }, - { "IM015", "Corrupt file data source" }, - { "P0000", "Plpgsql error" }, - { "P0001", "Raise exception" }, - { "XX000", "Internal error" }, - { "XX001", "Data corrupted" }, - { "XX002", "Index corrupted" } -}; - -void pdo_sqlstate_fini_error_table(void) -{ - zend_hash_destroy(&err_hash); -} - -int pdo_sqlstate_init_error_table(void) -{ - int i; - struct pdo_sqlstate_info *info; - - if (FAILURE == zend_hash_init(&err_hash, - sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1)) { - return FAILURE; - } - - for (i = 0; i < sizeof(err_initializer)/sizeof(err_initializer[0]); i++) { - info = &err_initializer[i]; - - zend_hash_add(&err_hash, info->state, sizeof(info->state), &info, sizeof(info), NULL); - } - - return SUCCESS; -} - -const char *pdo_sqlstate_state_to_description(char *state) -{ - struct pdo_sqlstate_info **info; - if (SUCCESS == zend_hash_find(&err_hash, state, sizeof(err_initializer[0].state), - (void**)&info)) { - return (*info)->desc; - } - return NULL; -} - diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c deleted file mode 100755 index 9a48a301186ad..0000000000000 --- a/ext/pdo/pdo_stmt.c +++ /dev/null @@ -1,2417 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Marcus Boerger <helly@php.net> | - | Sterling Hughes <sterling@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* The PDO Statement Handle Class */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/php_var.h" -#include "php_pdo.h" -#include "php_pdo_driver.h" -#include "php_pdo_int.h" -#include "zend_exceptions.h" -#include "zend_interfaces.h" -#include "php_memory_streams.h" - -#if COMPILE_DL_PDO -/* {{{ content from zend_arg_defs.c: - * since it is a .c file, it won't be installed for use by PECL extensions, so we include it here. */ -ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO(); - - -ZEND_BEGIN_ARG_INFO(second_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO(third_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO(); - - -ZEND_BEGIN_ARG_INFO(fourth_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1) -ZEND_END_ARG_INFO(); -/* }}} */ -#endif - -static PHP_FUNCTION(dbstmt_constructor) /* {{{ */ -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a PDOStatement manually"); -} -/* }}} */ - -static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param TSRMLS_DC) /* {{{ */ -{ - if (stmt->bound_param_map) { - /* rewriting :name to ? style. - * We need to fixup the parameter numbers on the parameters. - * If we find that a given named parameter has been used twice, - * we will raise an error, as we can't be sure that it is safe - * to bind multiple parameters onto the same zval in the underlying - * driver */ - char *name; - int position = 0; - - if (stmt->named_rewrite_template) { - /* this is not an error here */ - return 1; - } - if (!param->name) { - /* do the reverse; map the parameter number to the name */ - if (SUCCESS == zend_hash_index_find(stmt->bound_param_map, param->paramno, (void**)&name)) { - param->name = estrdup(name); - param->namelen = strlen(param->name); - return 1; - } - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); - return 0; - } - - zend_hash_internal_pointer_reset(stmt->bound_param_map); - while (SUCCESS == zend_hash_get_current_data(stmt->bound_param_map, (void**)&name)) { - if (strcmp(name, param->name)) { - position++; - zend_hash_move_forward(stmt->bound_param_map); - continue; - } - if (param->paramno >= 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead" TSRMLS_CC); - return -1; - } - param->paramno = position; - return 1; - } - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); - return 0; - } - return 1; -} -/* }}} */ - -/* trigger callback hook for parameters */ -static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */ -{ - int ret = 1, is_param = 1; - struct pdo_bound_param_data *param; - HashTable *ht; - - if (!stmt->methods->param_hook) { - return 1; - } - - ht = stmt->bound_params; - -iterate: - if (ht) { - zend_hash_internal_pointer_reset(ht); - while (SUCCESS == zend_hash_get_current_data(ht, (void**)¶m)) { - if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) { - ret = 0; - break; - } - - zend_hash_move_forward(ht); - } - } - if (ret && is_param) { - ht = stmt->bound_columns; - is_param = 0; - goto iterate; - } - - return ret; -} -/* }}} */ - -int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - int col; - - stmt->columns = ecalloc(stmt->column_count, sizeof(struct pdo_column_data)); - - for (col = 0; col < stmt->column_count; col++) { - if (!stmt->methods->describer(stmt, col TSRMLS_CC)) { - return 0; - } - - /* if we are applying case conversions on column names, do so now */ - if (stmt->dbh->native_case != stmt->dbh->desired_case && stmt->dbh->desired_case != PDO_CASE_NATURAL) { - char *s = stmt->columns[col].name; - - switch (stmt->dbh->desired_case) { - case PDO_CASE_UPPER: - while (*s != '\0') { - *s = toupper(*s); - s++; - } - break; - case PDO_CASE_LOWER: - while (*s != '\0') { - *s = tolower(*s); - s++; - } - break; - default: - ; - } - } - -#if 0 - /* update the column index on named bound parameters */ - if (stmt->bound_params) { - struct pdo_bound_param_data *param; - - if (SUCCESS == zend_hash_find(stmt->bound_params, stmt->columns[col].name, - stmt->columns[col].namelen, (void**)¶m)) { - param->paramno = col; - } - } -#endif - if (stmt->bound_columns) { - struct pdo_bound_param_data *param; - - if (SUCCESS == zend_hash_find(stmt->bound_columns, stmt->columns[col].name, - stmt->columns[col].namelen, (void**)¶m)) { - param->paramno = col; - } - } - - } - return 1; -} -/* }}} */ - -static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value TSRMLS_DC) /* {{{ */ -{ - if (Z_TYPE(stmt->lazy_object_ref) == IS_NULL) { - Z_TYPE(stmt->lazy_object_ref) = IS_OBJECT; - Z_OBJ_HANDLE(stmt->lazy_object_ref) = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC); - Z_OBJ_HT(stmt->lazy_object_ref) = &pdo_row_object_handlers; - /* stmt->refcount++; */ - } - Z_TYPE_P(return_value) = IS_OBJECT; - Z_OBJ_HANDLE_P(return_value) = Z_OBJ_HANDLE(stmt->lazy_object_ref); - Z_OBJ_HT_P(return_value) = Z_OBJ_HT(stmt->lazy_object_ref); - zend_objects_store_add_ref(return_value TSRMLS_CC); -} -/* }}} */ - -static void param_dtor(void *data) /* {{{ */ -{ - struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)data; - TSRMLS_FETCH(); - - /* tell the driver that it is going away */ - if (param->stmt->methods->param_hook) { - param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE TSRMLS_CC); - } - - if (param->name) { - efree(param->name); - } - - zval_ptr_dtor(&(param->parameter)); - if (param->driver_params) { - zval_ptr_dtor(&(param->driver_params)); - } -} -/* }}} */ - -static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param TSRMLS_DC) /* {{{ */ -{ - HashTable *hash; - struct pdo_bound_param_data *pparam = NULL; - - hash = is_param ? stmt->bound_params : stmt->bound_columns; - - if (!hash) { - ALLOC_HASHTABLE(hash); - zend_hash_init(hash, 13, NULL, param_dtor, 0); - - if (is_param) { - stmt->bound_params = hash; - } else { - stmt->bound_columns = hash; - } - } - - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && ! ZVAL_IS_NULL(param->parameter)) { - convert_to_string(param->parameter); - } - - param->stmt = stmt; - param->is_param = is_param; - - ZVAL_ADDREF(param->parameter); - if (param->driver_params) { - ZVAL_ADDREF(param->driver_params); - } - - if (param->name && stmt->columns) { - /* try to map the name to the column */ - int i; - - for (i = 0; i < stmt->column_count; i++) { - if (strcmp(stmt->columns[i].name, param->name) == 0) { - param->paramno = i; - break; - } - } - -#if 0 - /* if you prepare and then execute passing an array of params keyed by names, - * then this will trigger, and we don't want that */ - if (param->paramno == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Did not found column name '%s' in the defined columns; it will not be bound", param->name); - } -#endif - } - - if (param->name) { - if (is_param && param->name[0] != ':') { - char *temp = emalloc(++param->namelen + 1); - temp[0] = ':'; - memmove(temp+1, param->name, param->namelen); - param->name = temp; - } else { - param->name = estrndup(param->name, param->namelen); - } - zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam); - } else { - zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam); - } - - if (is_param && !rewrite_name_to_position(stmt, pparam TSRMLS_CC)) { - return 0; - } - - /* tell the driver we just created a parameter */ - if (stmt->methods->param_hook) { - return stmt->methods->param_hook(stmt, pparam, PDO_PARAM_EVT_ALLOC TSRMLS_CC); - } - - return 1; -} -/* }}} */ - -/* {{{ proto bool PDOStatement::execute([array $bound_input_params]) - Execute a prepared statement, optionally binding parameters */ -static PHP_METHOD(PDOStatement, execute) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - zval *input_params = NULL; - int ret = 1; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &input_params)) { - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - - if (input_params) { - struct pdo_bound_param_data param; - zval **tmp; - uint str_length; - ulong num_index; - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(input_params)); - while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) { - memset(¶m, 0, sizeof(param)); - - if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(input_params), - ¶m.name, &str_length, &num_index, 0, NULL)) { - /* yes this is correct. we don't want to count the null byte. ask wez */ - param.namelen = str_length - 1; - param.paramno = -1; - } else { - /* we're okay to be zero based here */ - if (num_index < 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL TSRMLS_CC); - RETURN_FALSE; - } - param.paramno = num_index; - } - - param.param_type = PDO_PARAM_STR; - param.parameter = *tmp; - - if (!really_register_bound_param(¶m, stmt, 1 TSRMLS_CC)) { - RETURN_FALSE; - } - - zend_hash_move_forward(Z_ARRVAL_P(input_params)); - } - } - - if (PDO_PLACEHOLDER_NONE == stmt->supports_placeholders) { - /* handle the emulated parameter binding, - * stmt->active_query_string holds the query with binds expanded and - * quoted. - */ - - ret = pdo_parse_params(stmt, stmt->query_string, stmt->query_stringlen, - &stmt->active_query_string, &stmt->active_query_stringlen TSRMLS_CC); - - if (ret == 0) { - /* no changes were made */ - stmt->active_query_string = stmt->query_string; - stmt->active_query_stringlen = stmt->query_stringlen; - } else if (ret == -1) { - /* something broke */ - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - if (stmt->methods->executer(stmt TSRMLS_CC)) { - if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) { - efree(stmt->active_query_string); - } - stmt->active_query_string = NULL; - if (!stmt->executed) { - /* this is the first execute */ - - if (stmt->dbh->alloc_own_columns) { - /* for "big boy" drivers, we need to allocate memory to fetch - * the results into, so lets do that now */ - ret = pdo_stmt_describe_columns(stmt TSRMLS_CC); - } - - stmt->executed = 1; - } - - if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST TSRMLS_CC)) { - RETURN_FALSE; - } - - RETURN_BOOL(ret); - } - if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) { - efree(stmt->active_query_string); - } - stmt->active_query_string = NULL; - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; -} -/* }}} */ - -static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno TSRMLS_DC) /* {{{ */ -{ - struct pdo_column_data *col; - char *value = NULL; - unsigned long value_len = 0; - int caller_frees = 0; - - col = &stmt->columns[colno]; - - value = NULL; - value_len = 0; - - stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees TSRMLS_CC); - - switch (PDO_PARAM_TYPE(col->param_type)) { - case PDO_PARAM_INT: - if (value && value_len == sizeof(long)) { - ZVAL_LONG(dest, *(long*)value); - break; - } - ZVAL_NULL(dest); - break; - - case PDO_PARAM_BOOL: - if (value && value_len == sizeof(zend_bool)) { - ZVAL_BOOL(dest, *(zend_bool*)value); - break; - } - ZVAL_NULL(dest); - break; - - case PDO_PARAM_LOB: - if (value == NULL) { - ZVAL_NULL(dest); - } else if (value_len == 0) { - php_stream_to_zval((php_stream*)value, dest); - } else { - /* they gave us a string, but LOBs are represented as streams in PDO */ - php_stream *stm; -#ifdef TEMP_STREAM_TAKE_BUFFER - if (caller_frees) { - stm = php_stream_memory_open(TEMP_STREAM_TAKE_BUFFER, value, value_len); - if (stm) { - caller_frees = 0; - } - } else -#endif - { - stm = php_stream_memory_open(TEMP_STREAM_READONLY, value, value_len); - } - if (stm) { - php_stream_to_zval(stm, dest); - } else { - ZVAL_NULL(dest); - } - } - break; - - case PDO_PARAM_STR: - if (value && !(value_len == 0 && stmt->dbh->oracle_nulls == PDO_NULL_EMPTY_STRING)) { -#ifdef IS_UNICODE - if (UG(unicode)) { - UErrorCode status = U_ZERO_ERROR; - UChar *u_str; - int32_t u_len; - - zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, value, value_len, &status); - ZVAL_UNICODEL(dest, u_str, u_len, 0); - if (caller_frees) { - efree(value); - } - } else -#endif - { - ZVAL_STRINGL(dest, value, value_len, !caller_frees); - } - if (caller_frees) { - caller_frees = 0; - } - break; - } - default: - ZVAL_NULL(dest); - } - - if (caller_frees && value) { - efree(value); - } - - if (stmt->dbh->stringify) { - switch (Z_TYPE_P(dest)) { - case IS_LONG: - case IS_DOUBLE: - convert_to_string(dest); - break; - } - } - - if (Z_TYPE_P(dest) == IS_NULL && stmt->dbh->oracle_nulls == PDO_NULL_TO_STRING) { - ZVAL_EMPTY_STRING(dest); - } -} -/* }}} */ - -static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, - long offset, int do_bind TSRMLS_DC) /* {{{ */ -{ - if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE TSRMLS_CC)) { - return 0; - } - - if (!stmt->methods->fetcher(stmt, ori, offset TSRMLS_CC)) { - return 0; - } - - /* some drivers might need to describe the columns now */ - if (!stmt->columns && !pdo_stmt_describe_columns(stmt TSRMLS_CC)) { - return 0; - } - - if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST TSRMLS_CC)) { - return 0; - } - - if (do_bind && stmt->bound_columns) { - /* update those bound column variables now */ - struct pdo_bound_param_data *param; - - zend_hash_internal_pointer_reset(stmt->bound_columns); - while (SUCCESS == zend_hash_get_current_data(stmt->bound_columns, (void**)¶m)) { - if (param->paramno >= 0) { - convert_to_string(param->parameter); - - /* delete old value */ - zval_dtor(param->parameter); - - /* set new value */ - fetch_value(stmt, param->parameter, param->paramno TSRMLS_CC); - - /* TODO: some smart thing that avoids duplicating the value in the - * general loop below. For now, if you're binding output columns, - * it's better to use LAZY or BOUND fetches if you want to shave - * off those cycles */ - } - - zend_hash_move_forward(stmt->bound_columns); - } - } - - return 1; -} -/* }}} */ - -static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - zend_class_entry * ce = stmt->fetch.cls.ce; - zend_fcall_info * fci = &stmt->fetch.cls.fci; - zend_fcall_info_cache * fcc = &stmt->fetch.cls.fcc; - - fci->size = sizeof(zend_fcall_info); - - if (!ce) { - stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; - } - - if (ce->constructor) { - fci->function_table = &ce->function_table; - fci->function_name = NULL; - fci->symbol_table = NULL; - fci->retval_ptr_ptr = &stmt->fetch.cls.retval_ptr; - if (stmt->fetch.cls.ctor_args) { - HashTable *ht = Z_ARRVAL_P(stmt->fetch.cls.ctor_args); - Bucket *p; - - fci->param_count = 0; - fci->params = safe_emalloc(sizeof(zval**), ht->nNumOfElements, 0); - p = ht->pListHead; - while (p != NULL) { - fci->params[fci->param_count++] = (zval**)p->pData; - p = p->pListNext; - } - } else { - fci->param_count = 0; - fci->params = NULL; - } - fci->no_separation = 1; - - fcc->initialized = 1; - fcc->function_handler = ce->constructor; - fcc->calling_scope = EG(scope); - return 1; - } else if (stmt->fetch.cls.ctor_args) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC); - return 0; - } else { - return 1; /* no ctor no args is also ok */ - } -} -/* }}} */ - -static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args TSRMLS_DC) /* {{{ */ -{ - zval **object = NULL, **method; - zend_class_entry * ce = NULL, **pce; - zend_function *function_handler; - - if (Z_TYPE_P(callable) == IS_ARRAY) { - if (Z_ARRVAL_P(callable)->nNumOfElements < 2) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC); - return 0; - } - object = (zval**)Z_ARRVAL_P(callable)->pListHead->pData; - method = (zval**)Z_ARRVAL_P(callable)->pListHead->pListNext->pData; - - if (PDO_ZVAL_PP_IS_TEXT(object)) { /* static call */ - if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not exist" TSRMLS_CC); - return 0; - } else { - ce = *pce; - } - object = NULL; - } else if (Z_TYPE_PP(object) == IS_OBJECT) { /* object call */ - ce = Z_OBJCE_PP(object); - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback; bogus object/class name" TSRMLS_CC); - return 0; - } - - if (!PDO_ZVAL_PP_IS_TEXT(method)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback; bogus method name" TSRMLS_CC); - return 0; - } - } else if (PDO_ZVAL_P_IS_TEXT(callable)) { - method = &callable; - } - - if (!zend_is_callable(callable, 0, NULL)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC); - return 0; - } - - fci->function_table = ce ? &ce->function_table : EG(function_table); - if (zend_u_hash_find(fci->function_table, Z_TYPE_PP(method), Z_UNIVAL_PP(method), Z_UNILEN_PP(method)+1, (void **)&function_handler) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function does not exist" TSRMLS_CC); - return 0; - } - - fci->size = sizeof(zend_fcall_info); - fci->function_name = NULL; - fci->symbol_table = NULL; - fci->param_count = num_args; /* probably less */ - fci->params = safe_emalloc(sizeof(zval**), num_args, 0); - fci->object_pp = object; - - fcc->initialized = 1; - fcc->function_handler = function_handler; - fcc->calling_scope = EG(scope); - fcc->object_pp = object; - - return 1; -} -/* }}} */ - -static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - zend_fcall_info * fci = &stmt->fetch.cls.fci; - zend_fcall_info_cache * fcc = &stmt->fetch.cls.fcc; - - if (!make_callable_ex(stmt, stmt->fetch.func.function, fci, fcc, stmt->column_count TSRMLS_CC)) { - return 0; - } else { - stmt->fetch.func.values = safe_emalloc(sizeof(zval*), stmt->column_count, 0); - return 1; - } -} -/* }}} */ - -static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /* {{{ */ -{ - /* fci.size is used to check if it is valid */ - if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) { - efree(stmt->fetch.cls.fci.params); - stmt->fetch.cls.fci.params = NULL; - } - stmt->fetch.cls.fci.size = 0; - if (stmt->fetch.cls.ctor_args && free_ctor_agrs) { - zval_ptr_dtor(&stmt->fetch.cls.ctor_args); - stmt->fetch.cls.ctor_args = NULL; - stmt->fetch.cls.fci.param_count = 0; - } - if (stmt->fetch.func.values) { - FREE_ZVAL(stmt->fetch.func.values); - stmt->fetch.func.values = NULL; - } - return 1; -} -/* }}} */ - -/* perform a fetch. If do_bind is true, update any bound columns. - * If return_value is not null, store values into it according to HOW. */ -static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, - enum pdo_fetch_type how, enum pdo_fetch_orientation ori, long offset, zval *return_all TSRMLS_DC) /* {{{ */ -{ - int flags = how & PDO_FETCH_FLAGS, idx, old_arg_count; - zend_class_entry * ce, * old_ce; - zval grp_val, *grp, **pgrp, *retval, *old_ctor_args; - - how = how & ~PDO_FETCH_FLAGS; - if (how == PDO_FETCH_USE_DEFAULT) { - how = stmt->default_fetch_type; - } - - if (!do_fetch_common(stmt, ori, offset, do_bind TSRMLS_CC)) { - return 0; - } - - if (how == PDO_FETCH_BOUND) { - RETVAL_TRUE; - return 1; - } - - if (return_value) { - int i = 0; - - if (how == PDO_FETCH_LAZY) { - get_lazy_object(stmt, return_value TSRMLS_CC); - return 1; - } - - RETVAL_FALSE; - - switch (how) { - case PDO_FETCH_ASSOC: - case PDO_FETCH_BOTH: - case PDO_FETCH_NUM: - case PDO_FETCH_NAMED: - array_init(return_value); - break; - - case PDO_FETCH_COLUMN: - if (stmt->fetch.column >= 0 && stmt->fetch.column < stmt->column_count) { - fetch_value(stmt, return_value, stmt->fetch.column TSRMLS_CC); - if (!return_all) { - return 1; - } else { - break; - } - } - return 0; - - case PDO_FETCH_OBJ: - object_init_ex(return_value, ZEND_STANDARD_CLASS_DEF_PTR); - break; - - case PDO_FETCH_CLASS: - if (flags & PDO_FETCH_CLASSTYPE) { - zval val; - zend_class_entry **cep; - - old_ce = stmt->fetch.cls.ce; - old_ctor_args = stmt->fetch.cls.ctor_args; - old_arg_count = stmt->fetch.cls.fci.param_count; - do_fetch_opt_finish(stmt, 0 TSRMLS_CC); - - INIT_PZVAL(&val); - fetch_value(stmt, &val, i++ TSRMLS_CC); - if (Z_TYPE(val) != IS_NULL) { - convert_to_text(&val); - if (zend_u_lookup_class(Z_TYPE(val), Z_UNIVAL(val), Z_UNILEN(val), &cep TSRMLS_CC) == FAILURE) { - stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; - } else { - stmt->fetch.cls.ce = *cep; - } - } - - do_fetch_class_prepare(stmt TSRMLS_CC); - zval_dtor(&val); - } - ce = stmt->fetch.cls.ce; - if ((flags & PDO_FETCH_SERIALIZE) == 0) { - object_init_ex(return_value, ce); - if (!stmt->fetch.cls.fci.size) { - if (!do_fetch_class_prepare(stmt TSRMLS_CC)) - { - return 0; - } - } - } - break; - - case PDO_FETCH_INTO: - if (!stmt->fetch.into) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified." TSRMLS_CC); - return 0; - break; - } - - Z_TYPE_P(return_value) = IS_OBJECT; - Z_OBJ_HANDLE_P(return_value) = Z_OBJ_HANDLE_P(stmt->fetch.into); - Z_OBJ_HT_P(return_value) = Z_OBJ_HT_P(stmt->fetch.into); - zend_objects_store_add_ref(stmt->fetch.into TSRMLS_CC); - - if (zend_get_class_entry(return_value TSRMLS_CC) == ZEND_STANDARD_CLASS_DEF_PTR) { - how = PDO_FETCH_OBJ; - } - break; - - case PDO_FETCH_FUNC: - if (!stmt->fetch.func.fci.size) { - if (!do_fetch_func_prepare(stmt TSRMLS_CC)) - { - return 0; - } - } - break; - - - default: - /* shouldn't happen */ - return 0; - } - - if (return_all) { - INIT_PZVAL(&grp_val); - fetch_value(stmt, &grp_val, i TSRMLS_CC); - convert_to_string(&grp_val); - if (how == PDO_FETCH_COLUMN) { - i = stmt->column_count; /* no more data to fetch */ - } else { - i++; - } - } - - for (idx = 0; i < stmt->column_count; i++, idx++) { - zval *val; - MAKE_STD_ZVAL(val); - fetch_value(stmt, val, i TSRMLS_CC); - - switch (how) { - case PDO_FETCH_ASSOC: - add_assoc_zval(return_value, stmt->columns[i].name, val); - break; - - case PDO_FETCH_BOTH: - add_assoc_zval(return_value, stmt->columns[i].name, val); - ZVAL_ADDREF(val); - add_next_index_zval(return_value, val); - break; - - case PDO_FETCH_NAMED: - /* already have an item with this name? */ - { - zval **curr_val = NULL; - if (zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name, - strlen(stmt->columns[i].name)+1, - (void**)&curr_val) == SUCCESS) { - zval *arr; - if (Z_TYPE_PP(curr_val) != IS_ARRAY) { - /* a little bit of black magic here: - * we're creating a new array and swapping it for the - * zval that's already stored in the hash under the name - * we want. We then add that zval to the array. - * This is effectively the same thing as: - * if (!is_array($hash[$name])) { - * $hash[$name] = array($hash[$name]); - * } - * */ - zval *cur; - - MAKE_STD_ZVAL(arr); - array_init(arr); - - cur = *curr_val; - *curr_val = arr; - - add_next_index_zval(arr, cur); - } else { - arr = *curr_val; - } - add_next_index_zval(arr, val); - } else { - add_assoc_zval(return_value, stmt->columns[i].name, val); - } - } - break; - - case PDO_FETCH_NUM: - add_next_index_zval(return_value, val); - break; - - case PDO_FETCH_OBJ: - case PDO_FETCH_INTO: - zend_update_property(NULL, return_value, - stmt->columns[i].name, stmt->columns[i].namelen, - val TSRMLS_CC); - zval_ptr_dtor(&val); - break; - - case PDO_FETCH_CLASS: - if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) { - zend_update_property(ce, return_value, - stmt->columns[i].name, stmt->columns[i].namelen, - val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { -#ifdef MBO_0 - php_unserialize_data_t var_hash; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (php_var_unserialize(&return_value, (const unsigned char**)&Z_STRVAL_P(val), Z_STRVAL_P(val)+Z_STRLEN_P(val), NULL TSRMLS_CC) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data" TSRMLS_CC); - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - return 0; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); -#endif -#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1 - if (!ce->unserialize) { - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); - return 0; - } else if (ce->unserialize(&return_value, ce, Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : "", Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) { - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); - zval_dtor(return_value); - ZVAL_NULL(return_value); - return 0; - } else { - zval_ptr_dtor(&val); - } -#endif - } - break; - - case PDO_FETCH_FUNC: - stmt->fetch.func.values[idx] = val; - stmt->fetch.cls.fci.params[idx] = &stmt->fetch.func.values[idx]; - break; - - default: - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC); - return 0; - break; - } - } - - switch (how) { - case PDO_FETCH_CLASS: - if (ce->constructor) { - stmt->fetch.cls.fci.object_pp = &return_value; - stmt->fetch.cls.fcc.object_pp = &return_value; - if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC); - return 0; - } else { - if (stmt->fetch.cls.retval_ptr) { - zval_ptr_dtor(&stmt->fetch.cls.retval_ptr); - } - } - } - if (flags & PDO_FETCH_CLASSTYPE) { - do_fetch_opt_finish(stmt, 0 TSRMLS_CC); - stmt->fetch.cls.ce = old_ce; - stmt->fetch.cls.ctor_args = old_ctor_args; - stmt->fetch.cls.fci.param_count = old_arg_count; - } - break; - - case PDO_FETCH_FUNC: - stmt->fetch.func.fci.param_count = idx; - stmt->fetch.func.fci.retval_ptr_ptr = &retval; - if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc TSRMLS_CC) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function" TSRMLS_CC); - return 0; - } else { - if (return_all) { - zval_ptr_dtor(&return_value); /* we don't need that */ - return_value = retval; - } else { - *return_value = *retval; - zval_copy_ctor(return_value); - zval_ptr_dtor(&retval); - } - } - while(idx--) { - zval_ptr_dtor(&stmt->fetch.func.values[idx]); - } - break; - - default: - break; - } - - if (return_all) { - if ((flags & PDO_FETCH_UNIQUE) == PDO_FETCH_UNIQUE) { - add_assoc_zval(return_all, Z_STRVAL(grp_val), return_value); - } else { - if (zend_symtable_find(Z_ARRVAL_P(return_all), Z_STRVAL(grp_val), Z_STRLEN(grp_val)+1, (void**)&pgrp) == FAILURE) { - MAKE_STD_ZVAL(grp); - array_init(grp); - add_assoc_zval(return_all, Z_STRVAL(grp_val), grp); - } else { - grp = *pgrp; - } - add_next_index_zval(grp, return_value); - } - zval_dtor(&grp_val); - } - - } - - return 1; -} -/* }}} */ - -static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, int mode, int fetch_all TSRMLS_DC) /* {{{ */ -{ - int flags = mode & PDO_FETCH_FLAGS; - - mode = mode & ~PDO_FETCH_FLAGS; - - if (mode == PDO_FETCH_USE_DEFAULT) { - flags = stmt->default_fetch_type & PDO_FETCH_FLAGS; - mode = stmt->default_fetch_type & ~PDO_FETCH_FLAGS; - } - -#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 1 - if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO_FETCH_SERIALIZE is not supported in this PHP version" TSRMLS_CC); - return 0; - } -#endif - - switch(mode) { - case PDO_FETCH_FUNC: - if (!fetch_all) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_FETCH_FUNC is only allowed in PDOStatement::fetchAll()" TSRMLS_CC); - return 0; - } - return 1; - - default: - if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_FETCH_SERIALIZE can only be used together with PDO_FETCH_CLASS" TSRMLS_CC); - return 0; - } - if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_FETCH_CLASSTYPE can only be used together with PDO_FETCH_CLASS" TSRMLS_CC); - return 0; - } - if (mode >= PDO_FETCH__MAX) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC); - return 0; - } - /* no break; */ - - case PDO_FETCH_CLASS: - return 1; - } -} -/* }}} */ - -/* {{{ proto mixed PDOStatement::fetch([int $how = PDO_FETCH_BOTH [, int $orientation [, int $offset]]]) - Fetches the next row and returns it, or false if there are no more rows */ -static PHP_METHOD(PDOStatement, fetch) -{ - long how = PDO_FETCH_USE_DEFAULT; - long ori = PDO_FETCH_ORI_NEXT; - long off = 0; - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lll", &how, - &ori, &off)) { - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - - if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto mixed PDOStatement::fetchObject(string class_name [, NULL|array ctor_args]) - Fetches the next row and returns it as an object. */ -static PHP_METHOD(PDOStatement, fetchObject) -{ - long how = PDO_FETCH_CLASS; - long ori = PDO_FETCH_ORI_NEXT; - long off = 0; - char *class_name; - int class_name_len; - zend_class_entry *old_ce; - zval *old_ctor_args, *ctor_args; - int error = 0, old_arg_count; - - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sz", - &class_name, &class_name_len, &ctor_args)) { - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - - if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) { - RETURN_FALSE; - } - - old_ce = stmt->fetch.cls.ce; - old_ctor_args = stmt->fetch.cls.ctor_args; - old_arg_count = stmt->fetch.cls.fci.param_count; - - do_fetch_opt_finish(stmt, 0 TSRMLS_CC); - - switch(ZEND_NUM_ARGS()) { - case 0: - stmt->fetch.cls.ce = U_CLASS_ENTRY(zend_standard_class_def); - break; - case 2: - if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC); - error = 1; - break; - } - if (Z_TYPE_P(ctor_args) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) { - ALLOC_ZVAL(stmt->fetch.cls.ctor_args); - *stmt->fetch.cls.ctor_args = *ctor_args; - zval_copy_ctor(stmt->fetch.cls.ctor_args); - } else { - stmt->fetch.cls.ctor_args = NULL; - } - /* no break */ - case 1: - stmt->fetch.cls.ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - - if (!stmt->fetch.cls.ce) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class" TSRMLS_CC); - error = 1; - break; - } - } - - if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) { - error = 1; - } - if (error) { - PDO_HANDLE_STMT_ERR(); - } - do_fetch_opt_finish(stmt, 1 TSRMLS_CC); - - stmt->fetch.cls.ce = old_ce; - stmt->fetch.cls.ctor_args = old_ctor_args; - stmt->fetch.cls.fci.param_count = old_arg_count; - if (error) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string PDOStatement::fetchColumn([int column_number]) - Returns a data of the specified column in the result set. */ -static PHP_METHOD(PDOStatement, fetchColumn) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - long col_n = 0; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &col_n)) { - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - - if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - - fetch_value(stmt, return_value, col_n TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto array PDOStatement::fetchAll([int $how = PDO_FETCH_BOTH [, string class_name [, NULL|array ctor_args]]]) - Returns an array of all of the results. */ -static PHP_METHOD(PDOStatement, fetchAll) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - long how = PDO_FETCH_USE_DEFAULT; - zval *data, *return_all; - zval *arg2; - zend_class_entry *old_ce; - zval *old_ctor_args, *ctor_args = NULL; - int error = 0, old_arg_count; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lzz", &how, &arg2, &ctor_args)) { - RETURN_FALSE; - } - - if (!pdo_stmt_verify_mode(stmt, how, 1 TSRMLS_CC)) { - RETURN_FALSE; - } - - old_ce = stmt->fetch.cls.ce; - old_ctor_args = stmt->fetch.cls.ctor_args; - old_arg_count = stmt->fetch.cls.fci.param_count; - - do_fetch_opt_finish(stmt, 0 TSRMLS_CC); - - switch(how & ~PDO_FETCH_FLAGS) { - case PDO_FETCH_CLASS: - switch(ZEND_NUM_ARGS()) { - case 0: - case 1: - stmt->fetch.cls.ce = U_CLASS_ENTRY(zend_standard_class_def); - break; - case 3: - if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC); - error = 1; - break; - } - if (Z_TYPE_P(ctor_args) != IS_ARRAY || !zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) { - ctor_args = NULL; - } - /* no break */ - case 2: - stmt->fetch.cls.ctor_args = ctor_args; /* we're not going to free these */ - if (!PDO_ZVAL_P_IS_TEXT(arg2)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)" TSRMLS_CC); - error = 1; - break; - } else { - stmt->fetch.cls.ce = zend_u_fetch_class(Z_TYPE_P(arg2), Z_STRVAL_P(arg2), Z_STRLEN_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - if (!stmt->fetch.cls.ce) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class" TSRMLS_CC); - error = 1; - break; - } - } - } - if (!error) { - do_fetch_class_prepare(stmt TSRMLS_CC); - } - break; - - case PDO_FETCH_FUNC: - switch(ZEND_NUM_ARGS()) { - case 0: - case 1: - break; - case 3: - case 2: - stmt->fetch.func.function = arg2; - break; - } - do_fetch_func_prepare(stmt TSRMLS_CC); - break; - - case PDO_FETCH_COLUMN: - switch(ZEND_NUM_ARGS()) { - case 0: - case 1: - stmt->fetch.column = how & PDO_FETCH_GROUP ? 1 : 0; - break; - case 2: - convert_to_long(arg2); - stmt->fetch.column = Z_LVAL_P(arg2); - break; - case 3: - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO_FETCH_COLUMN" TSRMLS_CC); - error = 1; - } - break; - - default: - if (ZEND_NUM_ARGS() > 1) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters" TSRMLS_CC); - error = 1; - } - } - - if (!error) { - PDO_STMT_CLEAR_ERR(); - MAKE_STD_ZVAL(data); - if (how & PDO_FETCH_GROUP) { - array_init(return_value); - return_all = return_value; - } else { - return_all = 0; - } - if (!do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC)) { - FREE_ZVAL(data); - error = 2; - } - } - if (!error) { - if ((how & PDO_FETCH_GROUP)) { - do { - MAKE_STD_ZVAL(data); - } while (do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC)); - } else { - array_init(return_value); - do { - add_next_index_zval(return_value, data); - MAKE_STD_ZVAL(data); - } while (do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)); - } - FREE_ZVAL(data); - } - - do_fetch_opt_finish(stmt, 0 TSRMLS_CC); - - stmt->fetch.cls.ce = old_ce; - stmt->fetch.cls.ctor_args = old_ctor_args; - stmt->fetch.cls.fci.param_count = old_arg_count; - - if (error) { - PDO_HANDLE_STMT_ERR(); - if (error != 2) { - RETURN_FALSE; - } else { /* on no results, return an empty array */ - array_init(return_value); - return; - } - } -} -/* }}} */ - -static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int is_param) /* {{{ */ -{ - struct pdo_bound_param_data param = {0}; - - param.paramno = -1; - param.param_type = PDO_PARAM_STR; - - if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "lz|llz!", ¶m.paramno, ¶m.parameter, ¶m.param_type, ¶m.max_value_len, - ¶m.driver_params)) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|llz!", ¶m.name, - ¶m.namelen, ¶m.parameter, ¶m.param_type, ¶m.max_value_len, - ¶m.driver_params)) { - return 0; - } - } - - if (param.paramno > 0) { - --param.paramno; /* make it zero-based internally */ - } else if (!param.name) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC); - return 0; - } - - return really_register_bound_param(¶m, stmt, is_param TSRMLS_CC); -} /* }}} */ - -/* {{{ proto bool PDOStatement::bindValue(mixed $paramno, mixed $param [, int $type ]) - bind an input parameter to the value of a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). It should be called prior to execute(). */ -static PHP_METHOD(PDOStatement, bindValue) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - struct pdo_bound_param_data param = {0}; - - param.paramno = -1; - param.param_type = PDO_PARAM_STR; - - if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "lz/|l", ¶m.paramno, ¶m.parameter, ¶m.param_type)) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|l", ¶m.name, - ¶m.namelen, ¶m.parameter, ¶m.param_type)) { - RETURN_FALSE; - } - } - - if (param.paramno > 0) { - --param.paramno; /* make it zero-based internally */ - } else if (!param.name) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC); - RETURN_FALSE; - } - - RETURN_BOOL(really_register_bound_param(¶m, stmt, TRUE TSRMLS_CC)); -} -/* }}} */ - - -/* {{{ proto bool PDOStatement::bindParam(mixed $paramno, mixed &$param [, int $type [, int $maxlen [, mixed $driverdata]]]) - bind a parameter to a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). This isn't supported by all drivers. It should be called prior to execute(). */ -static PHP_METHOD(PDOStatement, bindParam) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, TRUE)); -} -/* }}} */ - -/* {{{ proto bool PDOStatement::bindColumn(mixed $column, mixed &$param [, int $type [, int $maxlen [, mixed $driverdata]]]) - bind a column to a PHP variable. On each row fetch $param will contain the value of the corresponding column. $column is the 1-based offset of the column, or the column name. For portability, don't call this before execute(). */ -static PHP_METHOD(PDOStatement, bindColumn) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, FALSE)); -} -/* }}} */ - -/* {{{ proto int PDOStatement::rowCount() - Returns the number of rows in a result set, or the number of rows affected by the last execute(). It is not always meaningful. */ -static PHP_METHOD(PDOStatement, rowCount) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(stmt->row_count); -} -/* }}} */ - -/* {{{ proto string PDOStatement::errorCode() - Fetch the error code associated with the last operation on the statement handle */ -static PHP_METHOD(PDOStatement, errorCode) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; - } - - RETURN_STRING(stmt->error_code, 1); -} -/* }}} */ - -/* {{{ proto array PDOStatement::errorInfo() - Fetch extended error information associated with the last operation on the statement handle */ -static PHP_METHOD(PDOStatement, errorInfo) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; - } - - array_init(return_value); - add_next_index_string(return_value, stmt->error_code, 1); - - if (stmt->dbh->methods->fetch_err) { - stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto bool PDOStatement::setAttribute(long attribute, mixed value) - Set an attribute */ -static PHP_METHOD(PDOStatement, setAttribute) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - long attr; - zval *value = NULL; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) { - RETURN_FALSE; - } - - if (!stmt->methods->set_attribute) { - goto fail; - } - - PDO_STMT_CLEAR_ERR(); - if (stmt->methods->set_attribute(stmt, attr, value TSRMLS_CC)) { - RETURN_TRUE; - } - -fail: - if (!stmt->methods->set_attribute) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes" TSRMLS_CC); - } else { - PDO_HANDLE_STMT_ERR(); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto mixed PDOStatement::getAttribute(long attribute) - Get an attribute */ -static PHP_METHOD(PDOStatement, getAttribute) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - long attr; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) { - RETURN_FALSE; - } - - if (!stmt->methods->get_attribute) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support getting attributes" TSRMLS_CC); - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - switch (stmt->methods->get_attribute(stmt, attr, return_value TSRMLS_CC)) { - case -1: - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - - case 0: - /* XXX: should do something better here */ - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support getting that attribute" TSRMLS_CC); - RETURN_FALSE; - - default: - return; - } -} -/* }}} */ - -/* {{{ proto int PDOStatement::columnCount() - Returns the number of columns in the result set */ -static PHP_METHOD(PDOStatement, columnCount) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; - } - RETURN_LONG(stmt->column_count); -} -/* }}} */ - -/* {{{ proto array PDOStatement::getColumnMeta(int $column) - Returns meta data for a numbered column */ -static PHP_METHOD(PDOStatement, getColumnMeta) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - long colno; - struct pdo_column_data *col; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colno)) { - RETURN_FALSE; - } - if(colno < 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative" TSRMLS_CC); - RETURN_FALSE; - } - - if (!stmt->methods->get_column_meta) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data" TSRMLS_CC); - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - - /* add stock items */ - col = &stmt->columns[colno]; - add_assoc_string(return_value, "name", col->name, 1); - add_assoc_long(return_value, "len", col->maxlen); /* FIXME: unsigned ? */ - add_assoc_long(return_value, "precision", col->precision); - add_assoc_long(return_value, "pdo_type", col->param_type); -} -/* }}} */ - -/* {{{ proto bool PDOStatement::setFetchMode(int mode [mixed* params]) - Changes the default fetch mode for subsequent fetches (params have different meaning for different fetch modes) */ - -int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip) -{ - long mode = PDO_FETCH_BOTH; - int argc = ZEND_NUM_ARGS() - skip; - zval ***args; - zend_class_entry **cep; - - do_fetch_opt_finish(stmt, 1 TSRMLS_CC); - - switch (stmt->default_fetch_type) { - case PDO_FETCH_INTO: - if (stmt->fetch.into) { - ZVAL_DELREF(stmt->fetch.into); - stmt->fetch.into = NULL; - } - break; - default: - ; - } - - stmt->default_fetch_type = PDO_FETCH_BOTH; - - if (argc == 0) { - return SUCCESS; - } - - args = safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval*), 0); - - if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args)) { -fail_out: - efree(args); - return FAILURE; - } - - convert_to_long_ex(args[skip]); - mode = Z_LVAL_PP(args[skip]); - - if (!pdo_stmt_verify_mode(stmt, mode, 0 TSRMLS_CC)) { - return FAILURE; - } - - switch (mode & ~PDO_FETCH_FLAGS) { - case PDO_FETCH_LAZY: - case PDO_FETCH_ASSOC: - case PDO_FETCH_NUM: - case PDO_FETCH_BOTH: - case PDO_FETCH_OBJ: - case PDO_FETCH_BOUND: - case PDO_FETCH_NAMED: - break; - - case PDO_FETCH_COLUMN: - if (argc != 2) { - goto fail_out; - } - convert_to_long_ex(args[skip+1]); - stmt->fetch.column = Z_LVAL_PP(args[skip+1]); - break; - - case PDO_FETCH_CLASS: - if (argc < 2 || argc > 3) { - goto fail_out; - } - convert_to_string_ex(args[skip+1]); - - if (FAILURE == zend_lookup_class(Z_STRVAL_PP(args[skip+1]), - Z_STRLEN_PP(args[skip+1]), &cep TSRMLS_CC)) { - goto fail_out; - } - - if (!cep || !*cep) { - goto fail_out; - } - - stmt->fetch.cls.ce = *cep; - stmt->fetch.cls.ctor_args = NULL; - - if (stmt->dbh->is_persistent) { - /* TODO: CRITICAL for final release */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release"); - } - - if (argc == 3) { - if (Z_TYPE_PP(args[skip+2]) != IS_NULL && Z_TYPE_PP(args[skip+2]) != IS_ARRAY) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC); - } else if (Z_TYPE_PP(args[skip+2]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_PP(args[skip+2]))) { - ALLOC_ZVAL(stmt->fetch.cls.ctor_args); - *stmt->fetch.cls.ctor_args = **args[skip+2]; - zval_copy_ctor(stmt->fetch.cls.ctor_args); - } - } - - do_fetch_class_prepare(stmt TSRMLS_CC); - break; - - case PDO_FETCH_INTO: - if (argc != 2) { - goto fail_out; - } - if (Z_TYPE_PP(args[skip+1]) != IS_OBJECT) { - goto fail_out; - } - - if (stmt->dbh->is_persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release"); - } - - MAKE_STD_ZVAL(stmt->fetch.into); - - Z_TYPE_P(stmt->fetch.into) = IS_OBJECT; - Z_OBJ_HANDLE_P(stmt->fetch.into) = Z_OBJ_HANDLE_PP(args[skip+1]); - Z_OBJ_HT_P(stmt->fetch.into) = Z_OBJ_HT_PP(args[skip+1]); - zend_objects_store_add_ref(stmt->fetch.into TSRMLS_CC); - break; - - default: - if ((mode & ~PDO_FETCH_FLAGS) < PDO_FETCH__MAX && (mode & ~PDO_FETCH_FLAGS) >= 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "22003", "unhandled mode; this is a PDO bug, please report it" TSRMLS_CC); - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC); - } - return FAILURE; - } - - stmt->default_fetch_type = mode; - efree(args); - - return SUCCESS; -} - -static PHP_METHOD(PDOStatement, setFetchMode) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETVAL_BOOL( - pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, - stmt, 0) == SUCCESS ? 1 : 0 - ); -} -/* }}} */ - -/* {{{ proto bool PDOStatement::nextRowset() - Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeded, false otherwise */ - -static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) -{ - if (!stmt->methods->next_rowset(stmt TSRMLS_CC)) { - return 0; - } - - /* un-describe */ - if (stmt->columns) { - int i; - struct pdo_column_data *cols = stmt->columns; - - for (i = 0; i < stmt->column_count; i++) { - efree(cols[i].name); - } - efree(stmt->columns); - stmt->columns = NULL; - stmt->column_count = 0; - } - - pdo_stmt_describe_columns(stmt TSRMLS_CC); - - return 1; -} - -static PHP_METHOD(PDOStatement, nextRowset) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!stmt->methods->next_rowset) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets" TSRMLS_CC); - RETURN_FALSE; - } - - PDO_STMT_CLEAR_ERR(); - - if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - - pdo_stmt_describe_columns(stmt TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool PDOStatement::closeCursor() - Closes the cursor, leaving the statement ready for re-execution. */ -static PHP_METHOD(PDOStatement, closeCursor) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!stmt->methods->cursor_closer) { - /* emulate it by fetching and discarding rows */ - do { - while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0 TSRMLS_CC)) - ; - if (!stmt->methods->next_rowset) { - break; - } - - if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) { - break; - } - - } while (1); - RETURN_TRUE; - } - - PDO_STMT_CLEAR_ERR(); - - if (!stmt->methods->cursor_closer(stmt TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void PDOStatement::debugDumpParams() - A utility for internals hackers to debug parameter internals */ -static PHP_METHOD(PDOStatement, debugDumpParams) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - php_stream *out = php_stream_open_wrapper("php://output", "w", 0, NULL); - HashPosition pos; - struct pdo_bound_param_data *param; - - php_stream_printf(out TSRMLS_CC, "SQL: [%d] %.*s\n", - stmt->query_stringlen, - stmt->query_stringlen, stmt->query_string); - - php_stream_printf(out TSRMLS_CC, "Params: %d\n", - stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0); - - if (stmt->bound_params) { - zend_hash_internal_pointer_reset_ex(stmt->bound_params, &pos); - while (SUCCESS == zend_hash_get_current_data_ex(stmt->bound_params, - (void**)¶m, &pos)) { - char *str; - uint len; - ulong num; - - if (zend_hash_get_current_key_ex(stmt->bound_params, &str, &len, &num, 0, &pos) == HASH_KEY_IS_STRING) { - php_stream_printf(out TSRMLS_CC, "Key: Position #%d:\n", num); - } else { - php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", len, len, str); - } - - php_stream_printf(out TSRMLS_CC, "paramno=%d\nname=[%d] %.*s\nis_param=%d\nparam_type=%d\n", - param->paramno, param->namelen, param->namelen, param->name, - param->is_param, - param->param_type); - - } - } - - php_stream_close(out); -} -/* }}} */ - -/* {{{ proto int PDOStatement::__wakeup() - Prevents use of a PDOStatement instance that has been unserialized */ -static PHP_METHOD(PDOStatement, __wakeup) -{ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances"); -} -/* }}} */ - -/* {{{ proto int PDOStatement::__sleep() - Prevents serialization of a PDOStatement instance */ -static PHP_METHOD(PDOStatement, __sleep) -{ - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances"); -} -/* }}} */ - -function_entry pdo_dbstmt_functions[] = { - PHP_ME(PDOStatement, execute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, fetch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, bindParam, second_arg_force_ref, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, bindColumn, second_arg_force_ref, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, bindValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, rowCount, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, fetchColumn, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, fetchAll, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, fetchObject, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, errorCode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, errorInfo, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, setAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, getAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, columnCount, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, getColumnMeta, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, setFetchMode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, nextRowset, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, closeCursor, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, debugDumpParams, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDOStatement, __wakeup, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(PDOStatement, __sleep, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - {NULL, NULL, NULL} -}; - -/* {{{ overloaded handlers for PDOStatement class */ -static void dbstmt_prop_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC); - - convert_to_text(member); - - if (PDO_MEMBER_IS(member, "queryString")) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC); - } else { - std_object_handlers.write_property(object, member, value TSRMLS_CC); - } -} - -static void dbstmt_prop_delete(zval *object, zval *member TSRMLS_DC) -{ - pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC); - - convert_to_text(member); - - if (PDO_MEMBER_IS(member, "queryString")) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC); - } else { - std_object_handlers.unset_property(object, member TSRMLS_CC); - } -} - -static union _zend_function *dbstmt_method_get( -#if PHP_API_VERSION >= 20041225 - zval **object_pp, -#else - zval *object, -#endif - char *method_name, int method_len TSRMLS_DC) -{ - zend_function *fbc = NULL; - char *lc_method_name; -#if PHP_API_VERSION >= 20041225 - zval *object = *object_pp; -#endif -#ifdef IS_UNICODE - zend_uchar ztype = UG(unicode) ? IS_UNICODE : IS_STRING; -#endif - - lc_method_name = zend_u_str_tolower_dup(ztype, method_name, method_len); - - if (zend_u_hash_find(&Z_OBJCE_P(object)->function_table, ztype, lc_method_name, - method_len+1, (void**)&fbc) == FAILURE) { - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC); - /* not a pre-defined method, nor a user-defined method; check - * the driver specific methods */ - if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) { - if (!pdo_hash_methods(stmt->dbh, - PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC) - || !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) { - goto out; - } - } - - if (zend_u_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT], - ztype, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { - fbc = NULL; - goto out; - } - /* got it */ - } - -out: - efree(lc_method_name); - return fbc; -} - -static int dbstmt_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - return -1; -} - -zend_object_handlers pdo_dbstmt_object_handlers; - -void pdo_stmt_init(TSRMLS_D) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions); - pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC); - pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get; - pdo_dbstmt_ce->create_object = pdo_dbstmt_new; - zend_class_implements(pdo_dbstmt_ce TSRMLS_CC, 1, zend_ce_traversable); - zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC TSRMLS_CC); - - memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write; - pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete; - pdo_dbstmt_object_handlers.get_method = dbstmt_method_get; - pdo_dbstmt_object_handlers.compare_objects = dbstmt_compare; - - INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions); - pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC); - pdo_row_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; /* when removing this a lot of handlers need to be redone */ - pdo_row_ce->create_object = pdo_row_new; -} - -static void free_statement(pdo_stmt_t *stmt TSRMLS_DC) -{ - if (stmt->properties) { - zend_hash_destroy(stmt->properties); - efree(stmt->properties); - stmt->properties = NULL; - } - - if (stmt->bound_params) { - zend_hash_destroy(stmt->bound_params); - FREE_HASHTABLE(stmt->bound_params); - stmt->bound_params = NULL; - } - if (stmt->bound_param_map) { - zend_hash_destroy(stmt->bound_param_map); - FREE_HASHTABLE(stmt->bound_param_map); - stmt->bound_param_map = NULL; - } - if (stmt->bound_columns) { - zend_hash_destroy(stmt->bound_columns); - FREE_HASHTABLE(stmt->bound_columns); - stmt->bound_columns = NULL; - } - - if (stmt->methods && stmt->methods->dtor) { - stmt->methods->dtor(stmt TSRMLS_CC); - } - if (stmt->query_string) { - efree(stmt->query_string); - } - - if (stmt->columns) { - int i; - struct pdo_column_data *cols = stmt->columns; - - for (i = 0; i < stmt->column_count; i++) { - if (cols[i].name) { - efree(cols[i].name); - cols[i].name = NULL; - } - } - efree(stmt->columns); - stmt->columns = NULL; - } - - if (stmt->fetch.into && stmt->default_fetch_type == PDO_FETCH_INTO) { - FREE_ZVAL(stmt->fetch.into); - stmt->fetch.into = NULL; - } - - do_fetch_opt_finish(stmt, 1 TSRMLS_CC); - - zend_objects_store_del_ref(&stmt->database_object_handle TSRMLS_CC); - efree(stmt); -} - -void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC) -{ - if (--stmt->refcount == 0) { - free_statement(stmt TSRMLS_CC); - } -} - -zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - zval *tmp; - - pdo_stmt_t *stmt; - stmt = emalloc(sizeof(*stmt)); - memset(stmt, 0, sizeof(*stmt)); - stmt->ce = ce; - stmt->refcount = 1; - ALLOC_HASHTABLE(stmt->properties); - zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(stmt->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, NULL TSRMLS_CC); - retval.handlers = &pdo_dbstmt_object_handlers; - - return retval; -} -/* }}} */ - -/* {{{ statement iterator */ - -struct php_pdo_iterator { - zend_object_iterator iter; - pdo_stmt_t *stmt; - ulong key; - zval *fetch_ahead; -}; - -static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; - - if (--I->stmt->refcount == 0) { - free_statement(I->stmt TSRMLS_CC); - } - - if (I->fetch_ahead) { - zval_ptr_dtor(&I->fetch_ahead); - } - - efree(I); -} - -static int pdo_stmt_iter_valid(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; - - return I->fetch_ahead ? SUCCESS : FAILURE; -} - -static void pdo_stmt_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; - - /* sanity */ - if (!I->fetch_ahead) { - *data = NULL; - return; - } - - *data = &I->fetch_ahead; -} - -static int pdo_stmt_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) -{ - struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; - - if (I->key == (ulong)-1) { - return HASH_KEY_NON_EXISTANT; - } - *int_key = I->key; - return HASH_KEY_IS_LONG; -} - -static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; - - if (I->fetch_ahead) { - zval_ptr_dtor(&I->fetch_ahead); - I->fetch_ahead = NULL; - } - - MAKE_STD_ZVAL(I->fetch_ahead); - - if (!do_fetch(I->stmt, TRUE, I->fetch_ahead, PDO_FETCH_USE_DEFAULT, - PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) { - pdo_stmt_t *stmt = I->stmt; /* for PDO_HANDLE_STMT_ERR() */ - - PDO_HANDLE_STMT_ERR(); - I->key = (ulong)-1; - FREE_ZVAL(I->fetch_ahead); - I->fetch_ahead = NULL; - - return; - } - - I->key++; -} - -static zend_object_iterator_funcs pdo_stmt_iter_funcs = { - pdo_stmt_iter_dtor, - pdo_stmt_iter_valid, - pdo_stmt_iter_get_data, - pdo_stmt_iter_get_key, - pdo_stmt_iter_move_forwards, - NULL -}; - -zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC); - struct php_pdo_iterator *I; - - I = ecalloc(1, sizeof(*I)); - I->iter.funcs = &pdo_stmt_iter_funcs; - I->iter.data = I; - I->stmt = stmt; - stmt->refcount++; - - MAKE_STD_ZVAL(I->fetch_ahead); - if (!do_fetch(I->stmt, TRUE, I->fetch_ahead, PDO_FETCH_USE_DEFAULT, - PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) { - PDO_HANDLE_STMT_ERR(); - I->key = (ulong)-1; - FREE_ZVAL(I->fetch_ahead); - I->fetch_ahead = NULL; - } - - return &I->iter; -} - -/* }}} */ - -/* {{{ overloaded handlers for PDORow class (used by PDO_FETCH_LAZY) */ - -function_entry pdo_row_functions[] = { - {NULL, NULL, NULL} -}; - -static zval *row_prop_or_dim_read(zval *object, zval *member, int type TSRMLS_DC) -{ - zval *return_value; - pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC); - int colno = -1; - - MAKE_STD_ZVAL(return_value); - - if (Z_TYPE_P(member) == IS_LONG) { - if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) { - fetch_value(stmt, return_value, Z_LVAL_P(member) TSRMLS_CC); - } - } else { - convert_to_string(member); - /* TODO: replace this with a hash of available column names to column - * numbers */ - for (colno = 0; colno < stmt->column_count; colno++) { - if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) { - fetch_value(stmt, return_value, colno TSRMLS_CC); - break; - } - } - } - - return_value->refcount = 0; - return_value->is_ref = 0; - - return return_value; -} - -static void row_prop_or_dim_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); -} - -static int row_prop_or_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC); - int colno = -1; - - if (Z_TYPE_P(member) == IS_LONG) { - return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count; - } else { - convert_to_string(member); - - /* TODO: replace this with a hash of available column names to column - * numbers */ - for (colno = 0; colno < stmt->column_count; colno++) { - if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) { - return 1; - } - } - } - - return 0; -} - -static void row_prop_or_dim_delete(zval *object, zval *offset TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow"); -} - -static HashTable *row_get_properties(zval *object TSRMLS_DC) -{ - zval *tmp; - pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC); - int i; - HashTable *ht; - - MAKE_STD_ZVAL(tmp); - array_init(tmp); - - for (i = 0; i < stmt->column_count; i++) { - zval *val; - MAKE_STD_ZVAL(val); - fetch_value(stmt, val, i TSRMLS_CC); - - add_assoc_zval(tmp, stmt->columns[i].name, val); - } - - ht = Z_ARRVAL_P(tmp); - - ZVAL_NULL(tmp); - FREE_ZVAL(tmp); - - return ht; -} - -static union _zend_function *row_method_get( -#if PHP_API_VERSION >= 20041225 - zval **object_pp, -#else - zval *object, -#endif - char *method_name, int method_len TSRMLS_DC) -{ - zend_function *fbc; - char *lc_method_name; - - lc_method_name = emalloc(method_len + 1); - zend_str_tolower_copy(lc_method_name, method_name, method_len); - - if (zend_hash_find(&pdo_row_ce->function_table, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { - efree(lc_method_name); - return NULL; - } - - efree(lc_method_name); - return fbc; -} - -static int row_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - return FAILURE; -} - -static union _zend_function *row_get_ctor(zval *object TSRMLS_DC) -{ - static zend_internal_function ctor = {0}; - - ctor.type = ZEND_INTERNAL_FUNCTION; - ctor.function_name = "__construct"; - ctor.scope = pdo_row_ce; - ctor.handler = ZEND_FN(dbstmt_constructor); - - return (union _zend_function*)&ctor; -} - -static zend_class_entry *row_get_ce(zval *object TSRMLS_DC) -{ - return U_CLASS_ENTRY(pdo_dbstmt_ce); -} - -static int row_get_classname(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - *class_name = estrndup("PDORow", sizeof("PDORow")-1); - *class_name_len = sizeof("PDORow")-1; - return 0; -} - -static int row_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - return -1; -} - -zend_object_handlers pdo_row_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - row_prop_or_dim_read, - row_prop_or_dim_write, - row_prop_or_dim_read, - row_prop_or_dim_write, - NULL, - NULL, - NULL, - row_prop_or_dim_exists, - row_prop_or_dim_delete, - row_prop_or_dim_exists, - row_prop_or_dim_delete, - row_get_properties, - row_method_get, - row_call_method, - row_get_ctor, - row_get_ce, - row_get_classname, - row_compare, - NULL, /* cast */ - NULL -}; - -void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC) -{ -#if 0 - ZVAL_NULL(&stmt->lazy_object_ref); - - if (--stmt->refcount == 0) { - free_statement(stmt TSRMLS_CC); - } -#endif -} - -zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - - retval.handle = zend_objects_store_put(NULL, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC); - retval.handlers = &pdo_row_object_handlers; - - return retval; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h deleted file mode 100755 index 63499575c652c..0000000000000 --- a/ext/pdo/php_pdo.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_H -#define PHP_PDO_H - -#include "zend.h" - -#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) -#define can_handle_soft_dependency_on_SPL 1 -#endif - -extern zend_module_entry pdo_module_entry; -#define phpext_pdo_ptr &pdo_module_entry - -#ifdef PHP_WIN32 -# if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO)) -# define PDO_API __declspec(dllexport) -# elif defined(COMPILE_DL_PDO) -# define PDO_API __declspec(dllimport) -# else -# define PDO_API /* nothing special */ -# endif -#else -# define PDO_API /* nothing special */ -#endif - -#ifdef ZTS -# include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo); -PHP_MSHUTDOWN_FUNCTION(pdo); -PHP_RINIT_FUNCTION(pdo); -PHP_RSHUTDOWN_FUNCTION(pdo); -PHP_MINFO_FUNCTION(pdo); - -ZEND_BEGIN_MODULE_GLOBALS(pdo) - long global_value; -ZEND_END_MODULE_GLOBALS(pdo) - -#ifdef ZTS -# define PDOG(v) TSRMG(pdo_globals_id, zend_pdo_globals *, v) -#else -# define PDOG(v) (pdo_globals.v) -#endif - -#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \ - zend_declare_class_constant_long(pdo_dbh_ce, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); - -#define REGISTER_PDO_CONST_LONG(const_name, value) { \ - zend_class_entry **pce; \ - if (zend_hash_find(CG(class_table), "pdo", sizeof("pdo"), (void **) &pce) != FAILURE) \ - zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); \ -} \ - -#define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \ - zend_declare_class_constant_stringl(pdo_dbh_ce, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC); - -#define PDO_CONSTRUCT_CHECK \ - if (!dbh->driver) { \ - pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC); \ - return; \ - } \ - - -#endif /* PHP_PDO_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h deleted file mode 100755 index c9244a82b4b6f..0000000000000 --- a/ext/pdo/php_pdo_driver.h +++ /dev/null @@ -1,640 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_DRIVER_H -#define PHP_PDO_DRIVER_H - -#include "php_pdo.h" - -/* forward declarations */ -typedef struct _pdo_dbh_t pdo_dbh_t; -typedef struct _pdo_stmt_t pdo_stmt_t; -struct pdo_bound_param_data; - -#ifdef PHP_WIN32 -typedef __int64 pdo_int64_t; -typedef unsigned __int64 pdo_uint64_t; -#else -typedef long long int pdo_int64_t; -typedef unsigned long long int pdo_uint64_t; -#endif -PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC); - -#ifndef TRUE -# define TRUE 1 -#endif -#ifndef FALSE -# define FALSE 0 -#endif - -#define PDO_DRIVER_API 20050711 - -enum pdo_param_type { - PDO_PARAM_NULL, - - /* int as in long (the php native int type). - * If you mark a column as an int, PDO expects get_col to return - * a pointer to a long */ - PDO_PARAM_INT, - - /* get_col ptr should point to start of the string buffer */ - PDO_PARAM_STR, - - /* get_col: when len is 0 ptr should point to a php_stream *, - * otherwise it should behave like a string. Indicate a NULL field - * value by setting the ptr to NULL */ - PDO_PARAM_LOB, - - /* get_col: will expect the ptr to point to a new PDOStatement object handle, - * but this isn't wired up yet */ - PDO_PARAM_STMT, /* hierarchical result set */ - - /* get_col ptr should point to a zend_bool */ - PDO_PARAM_BOOL, -}; - -/* magic flag to denote a parameter as being input/output */ -#define PDO_PARAM_INPUT_OUTPUT 0x80000000 - -#define PDO_PARAM_FLAGS 0xFFFF0000 - -#define PDO_PARAM_TYPE(x) ((x) & ~PDO_PARAM_FLAGS) - -enum pdo_fetch_type { - PDO_FETCH_USE_DEFAULT, - PDO_FETCH_LAZY, - PDO_FETCH_ASSOC, - PDO_FETCH_NUM, - PDO_FETCH_BOTH, - PDO_FETCH_OBJ, - PDO_FETCH_BOUND, /* return true/false only; rely on bound columns */ - PDO_FETCH_COLUMN, /* fetch a numbered column only */ - PDO_FETCH_CLASS, /* create an instance of named class, call ctor and set properties */ - PDO_FETCH_INTO, /* fetch row into an existing object */ - PDO_FETCH_FUNC, /* fetch into function and return its result */ - PDO_FETCH_NAMED, /* like PDO_FETCH_ASSOC, but can handle duplicate names */ - PDO_FETCH__MAX /* must be last */ -}; - -#define PDO_FETCH_FLAGS 0xFFFF0000 /* fetchAll() modes or'd to PDO_FETCH_XYZ */ -#define PDO_FETCH_GROUP 0x00010000 /* fetch into groups */ -#define PDO_FETCH_UNIQUE 0x00030000 /* fetch into groups assuming first col is unique */ -#define PDO_FETCH_CLASSTYPE 0x00040000 /* fetch class gets its class name from 1st column */ -#define PDO_FETCH_SERIALIZE 0x00080000 /* fetch class instances by calling serialize */ - -/* fetch orientation for scrollable cursors */ -enum pdo_fetch_orientation { - PDO_FETCH_ORI_NEXT, /* default: fetch the next available row */ - PDO_FETCH_ORI_PRIOR, /* scroll back to prior row and fetch that */ - PDO_FETCH_ORI_FIRST, /* scroll to the first row and fetch that */ - PDO_FETCH_ORI_LAST, /* scroll to the last row and fetch that */ - PDO_FETCH_ORI_ABS, /* scroll to an absolute numbered row and fetch that */ - PDO_FETCH_ORI_REL /* scroll relative to the current row, and fetch that */ -}; - -enum pdo_attribute_type { - PDO_ATTR_AUTOCOMMIT, /* use to turn on or off auto-commit mode */ - PDO_ATTR_PREFETCH, /* configure the prefetch size for drivers that support it. Size is in KB */ - PDO_ATTR_TIMEOUT, /* connection timeout in seconds */ - PDO_ATTR_ERRMODE, /* control how errors are handled */ - PDO_ATTR_SERVER_VERSION, /* database server version */ - PDO_ATTR_CLIENT_VERSION, /* client library version */ - PDO_ATTR_SERVER_INFO, /* server information */ - PDO_ATTR_CONNECTION_STATUS, /* connection status */ - PDO_ATTR_CASE, /* control case folding for portability */ - PDO_ATTR_CURSOR_NAME, /* name a cursor for use in "WHERE CURRENT OF <name>" */ - PDO_ATTR_CURSOR, /* cursor type */ - PDO_ATTR_ORACLE_NULLS, /* convert empty strings to NULL */ - PDO_ATTR_PERSISTENT, /* pconnect style connection */ - PDO_ATTR_STATEMENT_CLASS, /* array(classname, array(ctor_args)) to specify the class of the constructed statement */ - PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, where available */ - PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in the column names, where available */ - PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the constructor) */ - PDO_ATTR_STRINGIFY_FETCHES, /* converts integer/float types to strings during fetch */ - PDO_ATTR_MAX_COLUMN_LEN, /* make database calculate maximum length of data found in a column */ - - /* this defines the start of the range for driver specific options. - * Drivers should define their own attribute constants beginning with this - * value. */ - PDO_ATTR_DRIVER_SPECIFIC = 1000 -}; - -enum pdo_cursor_type { - PDO_CURSOR_FWDONLY, /* forward only cursor (default) */ - PDO_CURSOR_SCROLL /* scrollable cursor */ -}; - -/* SQL-92 SQLSTATE error codes. - -The character string value returned for an SQLSTATE consists of a two-character -class value followed by a three-character subclass value. A class value of 01 -indicates a warning and is accompanied by a return code of -SQL_SUCCESS_WITH_INFO. - -Class values other than '01', except for the class 'IM', -indicate an error and are accompanied by a return code of SQL_ERROR. The class -'IM' is specific to warnings and errors that derive from the implementation of -ODBC itself. - -The subclass value '000' in any class indicates that there is no -subclass for that SQLSTATE. The assignment of class and subclass values is -defined by SQL-92. -*/ - -typedef char pdo_error_type[6]; /* SQLSTATE */ - - -#define PDO_ERR_NONE "00000" - -enum pdo_error_mode { - PDO_ERRMODE_SILENT, /* just set error codes */ - PDO_ERRMODE_WARNING, /* raise E_WARNING */ - PDO_ERRMODE_EXCEPTION /* throw exceptions */ -}; - -enum pdo_case_conversion { - PDO_CASE_NATURAL, - PDO_CASE_UPPER, - PDO_CASE_LOWER -}; - -/* oracle interop settings */ -enum pdo_null_handling { - PDO_NULL_NATURAL = 0, - PDO_NULL_EMPTY_STRING = 1, - PDO_NULL_TO_STRING = 2, -}; - -/* {{{ utils for reading attributes set as driver_options */ -static inline long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, long defval TSRMLS_DC) -{ - zval **v; - - if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) { - convert_to_long_ex(v); - return Z_LVAL_PP(v); - } - return defval; -} -/* }}} */ - -/* This structure is registered with PDO when a PDO driver extension is - * initialized */ -typedef struct { - const char *driver_name; - unsigned long driver_name_len; - unsigned long api_version; /* needs to be compatible with PDO */ - -#define PDO_DRIVER_HEADER(name) \ - #name, sizeof(#name)-1, \ - PDO_DRIVER_API - - /* create driver specific portion of the database handle and stash it into - * the dbh. dbh contains the data source string and flags for this - * instance. You MUST respect dbh->is_persistent and pass that flag to - * pemalloc() for all allocations that are stored in the dbh or your instance - * data in the db, otherwise you will crash PHP when persistent connections - * are used. - */ - int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC); - -} pdo_driver_t; - -/* {{{ methods for a database handle */ - -/* close or otherwise disconnect the database */ -typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh TSRMLS_DC); - -/* prepare a statement and stash driver specific portion into stmt */ -typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC); - -/* execute a statement (that does not return a result set) */ -typedef long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC); - -/* quote a string */ -typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC); - -/* transaction related */ -typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh TSRMLS_DC); - -/* setting of attributes */ -typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC); - -/* return last insert id. NULL indicates error condition, otherwise, the return value - * MUST be an emalloc'd NULL terminated string. */ -typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC); - -/* fetch error information. if stmt is not null, fetch information pertaining - * to the statement, otherwise fetch global error information. The driver - * should add the following information to the array "info" in this order: - * - native error code - * - string representation of the error code ... any other optional driver - * specific data ... */ -typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC); - -/* fetching of attributes */ -typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC); - -/* checking/pinging persistent connections; return SUCCESS if the connection - * is still alive and ready to be used, FAILURE otherwise. - * You may set this handler to NULL, which is equivalent to returning SUCCESS. */ -typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC); - -/* called at request end for each persistent dbh; this gives the driver - * the opportunity to safely release resources that only have per-request - * scope */ -typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC); - -/* for adding methods to the dbh or stmt objects -pointer to a list of driver specific functions. The convention is -to prefix the function names using the PDO driver name; this will -reduce the chance of collisions with future functionality in the -PDO class or in user code (they can extend the PDO object). -*/ -enum { - PDO_DBH_DRIVER_METHOD_KIND_DBH = 0, - PDO_DBH_DRIVER_METHOD_KIND_STMT, - PDO_DBH_DRIVER_METHOD_KIND__MAX -}; - -typedef function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC); - -struct pdo_dbh_methods { - pdo_dbh_close_func closer; - pdo_dbh_prepare_func preparer; - pdo_dbh_do_func doer; - pdo_dbh_quote_func quoter; - pdo_dbh_txn_func begin; - pdo_dbh_txn_func commit; - pdo_dbh_txn_func rollback; - pdo_dbh_set_attr_func set_attribute; - pdo_dbh_last_id_func last_id; - pdo_dbh_fetch_error_func fetch_err; - pdo_dbh_get_attr_func get_attribute; - pdo_dbh_check_liveness_func check_liveness; - pdo_dbh_get_driver_methods_func get_driver_methods; - pdo_dbh_request_shutdown persistent_shutdown; -}; - -/* }}} */ - -/* {{{ methods for a statement handle */ - -/* free the statement handle */ -typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt TSRMLS_DC); - -/* start the query */ -typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt TSRMLS_DC); - -/* causes the next row in the set to be fetched; indicates if there are no - * more rows. The ori and offset params modify which row should be returned, - * if the stmt represents a scrollable cursor */ -typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC); - -/* queries information about the type of a column, by index (0 based). - * Driver should populate stmt->columns[colno] with appropriate info */ -typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC); - -/* retrieves pointer and size of the value for a column. - * Note that PDO expects the driver to manage the lifetime of this data; - * it will copy the value into a zval on behalf of the script. - * If the driver sets caller_frees, ptr should point to emalloc'd memory - * and PDO will free it as soon as it is done using it. - */ -typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC); - -/* hook for bound params */ -enum pdo_param_event { - PDO_PARAM_EVT_ALLOC, - PDO_PARAM_EVT_FREE, - PDO_PARAM_EVT_EXEC_PRE, - PDO_PARAM_EVT_EXEC_POST, - PDO_PARAM_EVT_FETCH_PRE, - PDO_PARAM_EVT_FETCH_POST -}; - -typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC); - -/* setting of attributes */ -typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC); - -/* fetching of attributes */ -typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC); - -/* retrieves meta data for a numbered column. - * Returns SUCCESS/FAILURE. - * On SUCCESS, fill in return_value with an array with the following fields. - * If a particular field is not supported, then the driver simply does not add it to - * the array, so that scripts can use isset() to check for it. - * - * ### this is just a rough first cut, and subject to change ### - * - * these are added by PDO itself, based on data from the describe handler: - * name => the column name - * len => the length/size of the column - * precision => precision of the column - * pdo_type => an integer, one of the PDO_PARAM_XXX values - * - * scale => the floating point scale - * table => the table for that column - * type => a string representation of the type, mapped to the PHP equivalent type name - * native_type => a string representation of the type, native style, if different from - * the mapped name. - * flags => an array of flags including zero or more of the following: - * primary_key, not_null, unique_key, multiple_key, unsigned, auto_increment, blob - * - * Any driver specific data should be returned using a prefixed key or value. - * Eg: custom data for the mysql driver would use either - * 'mysql:foobar' => 'some data' // to add a new key to the array - * or - * 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key - */ -typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC); - -/* advances the statement to the next rowset of the batch. - * If it returns 1, PDO will tear down its idea of columns - * and meta data. If it returns 0, PDO will indicate an error - * to the caller. */ -typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt TSRMLS_DC); - -/* closes the active cursor on a statement, leaving the prepared - * statement ready for re-execution. Useful to explicitly state - * that you are done with a given rowset, without having to explicitly - * fetch all the rows. */ -typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt TSRMLS_DC); - -struct pdo_stmt_methods { - pdo_stmt_dtor_func dtor; - pdo_stmt_execute_func executer; - pdo_stmt_fetch_func fetcher; - pdo_stmt_describe_col_func describer; - pdo_stmt_get_col_data_func get_col; - pdo_stmt_param_hook_func param_hook; - pdo_stmt_set_attr_func set_attribute; - pdo_stmt_get_attr_func get_attribute; - pdo_stmt_get_column_meta_func get_column_meta; - pdo_stmt_next_rowset_func next_rowset; - pdo_stmt_cursor_closer_func cursor_closer; -}; - -/* }}} */ - -enum pdo_placeholder_support { - PDO_PLACEHOLDER_NONE=0, - PDO_PLACEHOLDER_NAMED=1, - PDO_PLACEHOLDER_POSITIONAL=2 -}; - -/* represents a connection to a database */ -struct _pdo_dbh_t { - /* these items must appear in this order at the beginning of the - struct so that this can be cast as a zend_object. we need this - to allow the extending class to escape all the custom handlers - that PDO declares. - */ - zend_class_entry *ce; - HashTable *properties; - unsigned int in_get:1; - unsigned int in_set:1; - - /* driver specific methods */ - struct pdo_dbh_methods *methods; - /* driver specific data */ - void *driver_data; - - /* credentials */ - char *username, *password; - - /* if true, then data stored and pointed at by this handle must all be - * persistently allocated */ - unsigned is_persistent:1; - - /* if true, driver should act as though a COMMIT were executed between - * each executed statement; otherwise, COMMIT must be carried out manually - * */ - unsigned auto_commit:1; - - /* if true, the handle has been closed and will not function anymore */ - unsigned is_closed:1; - - /* if true, the driver requires that memory be allocated explicitly for - * the columns that are returned */ - unsigned alloc_own_columns:1; - - /* if true, commit or rollBack is allowed to be called */ - unsigned in_txn:1; - - /* max length a single character can become after correct quoting */ - unsigned max_escaped_char_length:3; - - /* oracle compat; see enum pdo_null_handling */ - unsigned oracle_nulls:2; - - /* when set, convert int/floats to strings */ - unsigned stringify:1; - - /* the sum of the number of bits here and the bit fields preceeding should - * equal 32 */ - unsigned _reserved_flags:21; - - /* data source string used to open this handle */ - const char *data_source; - unsigned long data_source_len; - - /* the global error code. */ - pdo_error_type error_code; - - enum pdo_error_mode error_mode; - - enum pdo_case_conversion native_case, desired_case; - - /* persistent hash key associated with this handle */ - const char *persistent_id; - int persistent_id_len; - unsigned int refcount; - - /* driver specific "class" methods for the dbh and stmt */ - HashTable *cls_methods[PDO_DBH_DRIVER_METHOD_KIND__MAX]; - - pdo_driver_t *driver; - - zend_class_entry *def_stmt_ce; - - zval *def_stmt_ctor_args; -}; - -/* describes a column */ -struct pdo_column_data { - char *name; - long namelen; - unsigned long maxlen; - enum pdo_param_type param_type; - unsigned long precision; - - /* don't touch this unless your name is dbdo */ - void *dbdo_data; -}; - -/* describes a bound parameter */ -struct pdo_bound_param_data { - long paramno; /* if -1, then it has a name, and we don't know the index *yet* */ - char *name; - long namelen; - - long max_value_len; /* as a hint for pre-allocation */ - - zval *parameter; /* the variable itself */ - enum pdo_param_type param_type; /* desired or suggested type */ - - zval *driver_params; /* optional parameter(s) for the driver */ - void *driver_data; - - pdo_stmt_t *stmt; /* for convenience in dtor */ - int is_param; /* parameter or column ? */ -}; - -/* represents a prepared statement */ -struct _pdo_stmt_t { - /* these items must appear in this order at the beginning of the - struct so that this can be cast as a zend_object. we need this - to allow the extending class to escape all the custom handlers - that PDO declares. - */ - zend_class_entry *ce; - HashTable *properties; - unsigned int in_get:1; - unsigned int in_set:1; - - /* driver specifics */ - struct pdo_stmt_methods *methods; - void *driver_data; - - /* if true, we've already successfully executed this statement at least - * once */ - unsigned executed:1; - /* if true, the statement supports placeholders and can implement - * bindParam() for its prepared statements, if false, PDO should - * emulate prepare and bind on its behalf */ - unsigned supports_placeholders:2; - - unsigned _reserved:29; - - /* the number of columns in the result set; not valid until after - * the statement has been executed at least once. In some cases, might - * not be valid until fetch (at the driver level) has been called at least once. - * */ - int column_count; - struct pdo_column_data *columns; - - /* we want to keep the dbh alive while we live, so we own a reference */ - zval database_object_handle; - pdo_dbh_t *dbh; - - /* keep track of bound input parameters. Some drivers support - * input/output parameters, but you can't rely on that working */ - HashTable *bound_params; - /* When rewriting from named to positional, this maps positions to names */ - HashTable *bound_param_map; - /* keep track of PHP variables bound to named (or positional) columns - * in the result set */ - HashTable *bound_columns; - - /* not always meaningful */ - long row_count; - - /* used to hold the statement's current query */ - char *query_string; - int query_stringlen; - - /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */ - char *active_query_string; - int active_query_stringlen; - - /* the cursor specific error code. */ - pdo_error_type error_code; - - /* for lazy fetches, we always return the same lazy object handle. - * Let's keep it here. */ - zval lazy_object_ref; - unsigned long refcount; - - /* defaults for fetches */ - enum pdo_fetch_type default_fetch_type; - union { - int column; - struct { - zend_class_entry *ce; - zval *ctor_args; /* freed */ - zval *retval_ptr; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - } cls; - struct { - zval *function; - zval *fetch_args; /* freed */ - zval *object; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval **values; /* freed */ - } func; - zval *into; - } fetch; - - /* used by the query parser for driver specific - * parameter naming (see pgsql driver for example) */ - const char *named_rewrite_template; -}; - -/* call this in MINIT to register your PDO driver */ -PDO_API int php_pdo_register_driver(pdo_driver_t *driver); -/* call this in MSHUTDOWN to unregister your PDO driver */ -PDO_API void php_pdo_unregister_driver(pdo_driver_t *driver); - -/* For the convenience of drivers, this function will parse a data source - * string, of the form "name=value; name2=value2" and populate variables - * according to the data you pass in and array of pdo_data_src_parser structures */ -struct pdo_data_src_parser { - const char *optname; - char *optval; - int freeme; -}; - -PDO_API int php_pdo_parse_data_source(const char *data_source, - unsigned long data_source_len, struct pdo_data_src_parser *parsed, - int nparams); - -PDO_API zend_class_entry *php_pdo_get_exception(TSRMLS_D); - -PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, - char **outquery, int *outquery_len TSRMLS_DC); - -PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, - const char *sqlstate, const char *supp TSRMLS_DC); - -#endif /* PHP_PDO_DRIVER_H */ -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h deleted file mode 100755 index 6bca408d54221..0000000000000 --- a/ext/pdo/php_pdo_int.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Marcus Boerger <helly@php.net> | - | Sterling Hughes <sterling@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php_pdo_phpvers_compat.h" - -/* Stuff private to the PDO extension and not for consumption by PDO drivers - * */ - -extern HashTable pdo_driver_hash; -extern zend_class_entry *pdo_exception_ce; -PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC); -int php_pdo_list_entry(void); - -void pdo_dbh_init(TSRMLS_D); -void pdo_stmt_init(TSRMLS_D); - -extern zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC); -extern function_entry pdo_dbh_functions[]; -extern zend_class_entry *pdo_dbh_ce; -extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor); - -extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC); -extern function_entry pdo_dbstmt_functions[]; -extern zend_class_entry *pdo_dbstmt_ce; -void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC); -zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC); -extern zend_object_handlers pdo_dbstmt_object_handlers; -int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC); -int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip_first_arg); - -extern zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC); -extern function_entry pdo_row_functions[]; -extern zend_class_entry *pdo_row_ce; -void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC); -extern zend_object_handlers pdo_row_object_handlers; - -zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC); - -extern pdo_driver_t *pdo_find_driver(const char *name, int namelen); - -extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC); - -#define PDO_DBH_CLEAR_ERR() strcpy(dbh->error_code, PDO_ERR_NONE) -#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE) -#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); } -#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); } - -int pdo_sqlstate_init_error_table(void); -void pdo_sqlstate_fini_error_table(void); -const char *pdo_sqlstate_state_to_description(char *state); -int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC); - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_phpvers_compat.h b/ext/pdo/php_pdo_phpvers_compat.h deleted file mode 100644 index 6622cf081166a..0000000000000 --- a/ext/pdo/php_pdo_phpvers_compat.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* macros for backwards compatibility with PHP 5, so that HEAD of PDO and its - * drivers may still build against PHP 5 */ - -#ifndef PHP_PDO_PHPVERS_COMPAT_H -# define PHP_PDO_PHPVERS_COMPAT_H -# if PHP_MAJOR_VERSION < 6 - -# define ZVAL_RT_STRINGL(a, b, c, d) ZVAL_STRINGL(a, b, c, d) -# define ZVAL_ASCII_STRINGL(a, b, c, d) ZVAL_STRINGL(a, b, c, d) -# define U_CLASS_ENTRY(ce) ce -# define PDO_ZVAL_PP_IS_TEXT(pp) (Z_TYPE_PP(pp) == IS_STRING) -# define PDO_ZVAL_P_IS_TEXT(pp) (Z_TYPE_P(pp) == IS_STRING) -# define Z_UNIVAL_PP(x) Z_STRVAL_PP(x) -# define Z_UNIVAL_P(x) Z_STRVAL_P(x) -# define Z_UNIVAL(x) Z_STRVAL(x) -# define Z_UNILEN_PP(x) Z_STRLEN_PP(x) -# define Z_UNILEN_P(x) Z_STRLEN_P(x) -# define Z_UNILEN(x) Z_STRLEN(x) -# define zend_u_hash_find(a, b, c, d, e) zend_hash_find(a, c, d, e) -# define zend_u_lookup_class(a, b, c, d) zend_lookup_class(b, c, d) -PDO_API char *php_pdo_str_tolower_dup(const char *src, int len); -# define zend_u_str_tolower_dup(a, b, c) php_pdo_str_tolower_dup(b, c) -# define convert_to_text(x) convert_to_string(x) -# define zend_u_fetch_class(a, b, c, d) zend_fetch_class(b, c, d) -# define PDO_MEMBER_IS(z, strlit) ((Z_STRLEN_P(z) == sizeof(strlit)-1) && 0 == strcmp(Z_STRVAL_P(z), strlit)) - -# else - -# define PDO_ZVAL_PP_IS_TEXT(pp) ((Z_TYPE_PP(pp) == IS_STRING) || (Z_TYPE_PP(pp) == IS_UNICODE)) -# define PDO_ZVAL_P_IS_TEXT(pp) ((Z_TYPE_P(pp) == IS_STRING) || (Z_TYPE_P(pp) == IS_UNICODE)) - -# define PDO_MEMBER_IS(z, strlit) ((Z_UNILEN_P(z) == sizeof(strlit)-1) && (ZEND_U_EQUAL(Z_TYPE_P(z), Z_UNIVAL_P(z), Z_UNILEN_P(z), strlit, sizeof(strlit)-1))) - -# endif -#endif - diff --git a/ext/pdo/tests/bug_34630.phpt b/ext/pdo/tests/bug_34630.phpt deleted file mode 100644 index f308f230e45e5..0000000000000 --- a/ext/pdo/tests/bug_34630.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -PDO Common: PHP Bug #34630: inserting streams as LOBs ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); -$db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(256))'); -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$fp = tmpfile(); -fwrite($fp, "I am the LOB data"); -rewind($fp); - -$insert = $db->prepare("insert into test (id, val) values (1, ?)"); -$insert->bindValue(1, $fp, PDO::PARAM_LOB); -$insert->execute(); - -print_r($db->query("SELECT * from test")->fetchAll(PDO::FETCH_ASSOC)); - -?> ---EXPECT-- -Array -( - [0] => Array - ( - [id] => 1 - [val] => I am the LOB data - ) - -) diff --git a/ext/pdo/tests/pdo.inc b/ext/pdo/tests/pdo.inc deleted file mode 100755 index 6d8fa1ea02880..0000000000000 --- a/ext/pdo/tests/pdo.inc +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -function set_sql($name, $query) -{ - if (empty($GLOBALS['SQL'][$name])) - { - $GLOBALS['SQL'][$name] = $query; - } -} - -?> diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt deleted file mode 100644 index cc6a90f7911a9..0000000000000 --- a/ext/pdo/tests/pdo_001.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_ASSOC ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); - -$stmt = $db->prepare('SELECT * from test'); -$stmt->execute(); - -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); -?> ---EXPECT-- -array(3) { - [0]=> - array(2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - array(2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - [2]=> - array(2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } -} ---UEXPECT-- -array(3) { - [0]=> - array(2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - array(2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [2]=> - array(2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_002.phpt b/ext/pdo/tests/pdo_002.phpt deleted file mode 100644 index 60bfffd74381d..0000000000000 --- a/ext/pdo/tests/pdo_002.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_NUM ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); - -$stmt = $db->prepare('SELECT * from test'); -$stmt->execute(); - -var_dump($stmt->fetchAll(PDO::FETCH_NUM)); -?> ---EXPECT-- -array(3) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "A" - } - [1]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - string(1) "B" - } - [2]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(1) "C" - } -} ---UEXPECT-- -array(3) { - [0]=> - array(2) { - [0]=> - unicode(1) "1" - [1]=> - unicode(1) "A" - } - [1]=> - array(2) { - [0]=> - unicode(1) "2" - [1]=> - unicode(1) "B" - } - [2]=> - array(2) { - [0]=> - unicode(1) "3" - [1]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_003.phpt b/ext/pdo/tests/pdo_003.phpt deleted file mode 100644 index 617ebbc18b38c..0000000000000 --- a/ext/pdo/tests/pdo_003.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_BOTH ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); - -$stmt = $db->prepare('SELECT * from test'); -$stmt->execute(); - -var_dump($stmt->fetchAll(PDO::FETCH_BOTH)); -?> ---EXPECT-- -array(3) { - [0]=> - array(4) { - ["id"]=> - string(1) "1" - [0]=> - string(1) "1" - ["val"]=> - string(1) "A" - [1]=> - string(1) "A" - } - [1]=> - array(4) { - ["id"]=> - string(1) "2" - [0]=> - string(1) "2" - ["val"]=> - string(1) "B" - [1]=> - string(1) "B" - } - [2]=> - array(4) { - ["id"]=> - string(1) "3" - [0]=> - string(1) "3" - ["val"]=> - string(1) "C" - [1]=> - string(1) "C" - } -} ---UEXPECT-- -array(3) { - [0]=> - array(4) { - [u"id"]=> - unicode(1) "1" - [0]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - [1]=> - unicode(1) "A" - } - [1]=> - array(4) { - [u"id"]=> - unicode(1) "2" - [0]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - [1]=> - unicode(1) "B" - } - [2]=> - array(4) { - [u"id"]=> - unicode(1) "3" - [0]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - [1]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_004.phpt b/ext/pdo/tests/pdo_004.phpt deleted file mode 100644 index 558eef4a5ad06..0000000000000 --- a/ext/pdo/tests/pdo_004.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_OBJ ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); - -$stmt = $db->prepare('SELECT * from test'); -$stmt->execute(); - -var_dump($stmt->fetchAll(PDO::FETCH_OBJ)); -?> ---EXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - object(stdClass)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - [2]=> - object(stdClass)#%d (2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } -} ---UEXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - object(stdClass)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [2]=> - object(stdClass)#%d (2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_005.phpt b/ext/pdo/tests/pdo_005.phpt deleted file mode 100644 index 3d20159bacb57..0000000000000 --- a/ext/pdo/tests/pdo_005.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_CLASS ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A', 'AA')"); -$db->exec("INSERT INTO test VALUES(2, 'B', 'BB')"); -$db->exec("INSERT INTO test VALUES(3, 'C', 'CC')"); - -$stmt = $db->prepare('SELECT id, val, val2 from test'); - -class TestBase -{ - public $id; - protected $val; - private $val2; -} - -class TestDerived extends TestBase -{ - protected $row; - - public function __construct(&$row) - { - echo __METHOD__ . "($row,{$this->id})\n"; - $this->row = $row++; - } -} - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS)); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestBase')); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestDerived', array(0))); - -?> ---EXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (3) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - ["val2"]=> - string(2) "AA" - } - [1]=> - object(stdClass)#%d (3) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - ["val2"]=> - string(2) "BB" - } - [2]=> - object(stdClass)#%d (3) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - ["val2"]=> - string(2) "CC" - } -} -array(3) { - [0]=> - object(TestBase)#%d (3) { - ["id"]=> - string(1) "1" - ["val":protected]=> - string(1) "A" - ["val2":"TestBase":private]=> - string(2) "AA" - } - [1]=> - object(TestBase)#%d (3) { - ["id"]=> - string(1) "2" - ["val":protected]=> - string(1) "B" - ["val2":"TestBase":private]=> - string(2) "BB" - } - [2]=> - object(TestBase)#%d (3) { - ["id"]=> - string(1) "3" - ["val":protected]=> - string(1) "C" - ["val2":"TestBase":private]=> - string(2) "CC" - } -} -TestDerived::__construct(0,1) -TestDerived::__construct(1,2) -TestDerived::__construct(2,3) -array(3) { - [0]=> - object(TestDerived)#%d (5) { - ["row":protected]=> - int(0) - ["id"]=> - string(1) "1" - ["val":protected]=> - string(1) "A" - ["val2":"TestBase":private]=> - NULL - ["val2"]=> - string(2) "AA" - } - [1]=> - object(TestDerived)#%d (5) { - ["row":protected]=> - int(1) - ["id"]=> - string(1) "2" - ["val":protected]=> - string(1) "B" - ["val2":"TestBase":private]=> - NULL - ["val2"]=> - string(2) "BB" - } - [2]=> - object(TestDerived)#%d (5) { - ["row":protected]=> - int(2) - ["id"]=> - string(1) "3" - ["val":protected]=> - string(1) "C" - ["val2":"TestBase":private]=> - NULL - ["val2"]=> - string(2) "CC" - } -} ---UEXPECTF-- -array(3) { - [0]=> - object(stdClass)#%d (3) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - [u"val2"]=> - unicode(2) "AA" - } - [1]=> - object(stdClass)#%d (3) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - [u"val2"]=> - unicode(2) "BB" - } - [2]=> - object(stdClass)#%d (3) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - [u"val2"]=> - unicode(2) "CC" - } -} -array(3) { - [0]=> - object(TestBase)#%d (3) { - [u"id"]=> - unicode(1) "1" - [u"val":protected]=> - unicode(1) "A" - [u"val2":u"TestBase":private]=> - unicode(2) "AA" - } - [1]=> - object(TestBase)#%d (3) { - [u"id"]=> - unicode(1) "2" - [u"val":protected]=> - unicode(1) "B" - [u"val2":u"TestBase":private]=> - unicode(2) "BB" - } - [2]=> - object(TestBase)#%d (3) { - [u"id"]=> - unicode(1) "3" - [u"val":protected]=> - unicode(1) "C" - [u"val2":u"TestBase":private]=> - unicode(2) "CC" - } -} -TestDerived::__construct(0,1) -TestDerived::__construct(1,2) -TestDerived::__construct(2,3) -array(3) { - [0]=> - object(TestDerived)#%d (5) { - [u"row":protected]=> - int(0) - [u"id"]=> - unicode(1) "1" - [u"val":protected]=> - unicode(1) "A" - [u"val2":u"TestBase":private]=> - NULL - [u"val2"]=> - unicode(2) "AA" - } - [1]=> - object(TestDerived)#%d (5) { - [u"row":protected]=> - int(1) - [u"id"]=> - unicode(1) "2" - [u"val":protected]=> - unicode(1) "B" - [u"val2":u"TestBase":private]=> - NULL - [u"val2"]=> - unicode(2) "BB" - } - [2]=> - object(TestDerived)#%d (5) { - [u"row":protected]=> - int(2) - [u"id"]=> - unicode(1) "3" - [u"val":protected]=> - unicode(1) "C" - [u"val2":u"TestBase":private]=> - NULL - [u"val2"]=> - unicode(2) "CC" - } -} diff --git a/ext/pdo/tests/pdo_006.phpt b/ext/pdo/tests/pdo_006.phpt deleted file mode 100644 index 4636e951c19c5..0000000000000 --- a/ext/pdo/tests/pdo_006.phpt +++ /dev/null @@ -1,124 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_GROUP ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'A')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); - -$stmt = $db->prepare('SELECT val, id from test'); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_GROUP)); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_GROUP)); - -?> ---EXPECT-- -array(2) { - ["A"]=> - array(2) { - [0]=> - array(1) { - [0]=> - string(1) "1" - } - [1]=> - array(1) { - [0]=> - string(1) "2" - } - } - ["C"]=> - array(1) { - [0]=> - array(1) { - [0]=> - string(1) "3" - } - } -} -array(2) { - ["A"]=> - array(2) { - [0]=> - array(1) { - ["id"]=> - string(1) "1" - } - [1]=> - array(1) { - ["id"]=> - string(1) "2" - } - } - ["C"]=> - array(1) { - [0]=> - array(1) { - ["id"]=> - string(1) "3" - } - } -} ---UEXPECT-- -array(2) { - [u"A"]=> - array(2) { - [0]=> - array(1) { - [0]=> - unicode(1) "1" - } - [1]=> - array(1) { - [0]=> - unicode(1) "2" - } - } - [u"C"]=> - array(1) { - [0]=> - array(1) { - [0]=> - unicode(1) "3" - } - } -} -array(2) { - [u"A"]=> - array(2) { - [0]=> - array(1) { - [u"id"]=> - unicode(1) "1" - } - [1]=> - array(1) { - [u"id"]=> - unicode(1) "2" - } - } - [u"C"]=> - array(1) { - [0]=> - array(1) { - [u"id"]=> - unicode(1) "3" - } - } -} diff --git a/ext/pdo/tests/pdo_007.phpt b/ext/pdo/tests/pdo_007.phpt deleted file mode 100644 index c69098e9b28eb..0000000000000 --- a/ext/pdo/tests/pdo_007.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_UNIQUE ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES('A', 'A')"); -$db->exec("INSERT INTO test VALUES('B', 'A')"); -$db->exec("INSERT INTO test VALUES('C', 'C')"); - -$stmt = $db->prepare('SELECT id, val from test'); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE)); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE)); - -?> ---EXPECT-- -array(3) { - ["A"]=> - array(1) { - [0]=> - string(1) "A" - } - ["B"]=> - array(1) { - [0]=> - string(1) "A" - } - ["C"]=> - array(1) { - [0]=> - string(1) "C" - } -} -array(3) { - ["A"]=> - array(1) { - ["val"]=> - string(1) "A" - } - ["B"]=> - array(1) { - ["val"]=> - string(1) "A" - } - ["C"]=> - array(1) { - ["val"]=> - string(1) "C" - } -} ---UEXPECT-- -array(3) { - [u"A"]=> - array(1) { - [0]=> - unicode(1) "A" - } - [u"B"]=> - array(1) { - [0]=> - unicode(1) "A" - } - [u"C"]=> - array(1) { - [0]=> - unicode(1) "C" - } -} -array(3) { - [u"A"]=> - array(1) { - [u"val"]=> - unicode(1) "A" - } - [u"B"]=> - array(1) { - [u"val"]=> - unicode(1) "A" - } - [u"C"]=> - array(1) { - [u"val"]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_008.phpt b/ext/pdo/tests/pdo_008.phpt deleted file mode 100644 index f83c7d89a31a6..0000000000000 --- a/ext/pdo/tests/pdo_008.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_UNIQUE conflict ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->exec("INSERT INTO test VALUES('A', 'A')"); -$db->exec("INSERT INTO test VALUES('B', 'A')"); -$db->exec("INSERT INTO test VALUES('C', 'C')"); - -$stmt = $db->prepare('SELECT val, id from test'); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE)); - -?> ---EXPECT-- -array(2) { - ["A"]=> - array(1) { - [0]=> - string(1) "B" - } - ["C"]=> - array(1) { - [0]=> - string(1) "C" - } -} ---UEXPECT-- -array(2) { - [u"A"]=> - array(1) { - [0]=> - unicode(1) "B" - } - [u"C"]=> - array(1) { - [0]=> - unicode(1) "C" - } -} diff --git a/ext/pdo/tests/pdo_009.phpt b/ext/pdo/tests/pdo_009.phpt deleted file mode 100644 index cc27999d8fc48..0000000000000 --- a/ext/pdo/tests/pdo_009.phpt +++ /dev/null @@ -1,203 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_CLASSTYPE ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)'); -$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); -$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); -$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, 0, \'A\')'); -$db->exec('INSERT INTO test VALUES(2, 1, \'B\')'); -$db->exec('INSERT INTO test VALUES(3, 2, \'C\')'); -$db->exec('INSERT INTO test VALUES(4, 3, \'D\')'); - -$stmt = $db->prepare('SELECT classtypes.name, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id'); - -class Test1 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test2 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test3 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_NUM)); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE, 'Test3')); - -?> ---EXPECTF-- -array(4) { - [0]=> - array(3) { - [0]=> - string(8) "stdClass" - [1]=> - string(1) "1" - [2]=> - string(1) "A" - } - [1]=> - array(3) { - [0]=> - string(5) "Test1" - [1]=> - string(1) "2" - [2]=> - string(1) "B" - } - [2]=> - array(3) { - [0]=> - string(5) "Test2" - [1]=> - string(1) "3" - [2]=> - string(1) "C" - } - [3]=> - array(3) { - [0]=> - NULL - [1]=> - string(1) "4" - [2]=> - string(1) "D" - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(4) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - [2]=> - object(Test2)#%d (2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } - [3]=> - object(Test3)#%d (2) { - ["id"]=> - string(1) "4" - ["val"]=> - string(1) "D" - } -} ---UEXPECTF-- -array(4) { - [0]=> - array(3) { - [0]=> - unicode(8) "stdClass" - [1]=> - unicode(1) "1" - [2]=> - unicode(1) "A" - } - [1]=> - array(3) { - [0]=> - unicode(5) "Test1" - [1]=> - unicode(1) "2" - [2]=> - unicode(1) "B" - } - [2]=> - array(3) { - [0]=> - unicode(5) "Test2" - [1]=> - unicode(1) "3" - [2]=> - unicode(1) "C" - } - [3]=> - array(3) { - [0]=> - NULL - [1]=> - unicode(1) "4" - [2]=> - unicode(1) "D" - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(4) { - [0]=> - object(stdClass)#%d (2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [2]=> - object(Test2)#%d (2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } - [3]=> - object(Test3)#%d (2) { - [u"id"]=> - unicode(1) "4" - [u"val"]=> - unicode(1) "D" - } -} diff --git a/ext/pdo/tests/pdo_010.phpt b/ext/pdo/tests/pdo_010.phpt deleted file mode 100644 index b68b022a2a520..0000000000000 --- a/ext/pdo/tests/pdo_010.phpt +++ /dev/null @@ -1,178 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_CLASSTYPE and GROUP/UNIQUE ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)'); -$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); -$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); -$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10), grp VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, 0, \'A\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(2, 1, \'B\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(3, 2, \'C\', \'Group2\')'); -$db->exec('INSERT INTO test VALUES(4, 3, \'D\', \'Group2\')'); - -$stmt = $db->prepare('SELECT classtypes.name, test.grp AS grp, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id'); - -class Test1 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test2 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - -class Test3 -{ - public function __construct() - { - echo __METHOD__ . "()\n"; - } -} - - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_GROUP, 'Test3')); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_UNIQUE, 'Test3')); - -?> ---EXPECTF-- -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - ["Group1"]=> - array(2) { - [0]=> - object(stdClass)#%d (2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - } - ["Group2"]=> - array(2) { - [0]=> - object(Test2)#%d (2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } - [1]=> - object(Test3)#%d (2) { - ["id"]=> - string(1) "4" - ["val"]=> - string(1) "D" - } - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - ["Group1"]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - ["Group2"]=> - object(Test3)#%d (2) { - ["id"]=> - string(1) "4" - ["val"]=> - string(1) "D" - } -} ---UEXPECTF-- -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - [u"Group1"]=> - array(2) { - [0]=> - object(stdClass)#%d (2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - } - [u"Group2"]=> - array(2) { - [0]=> - object(Test2)#%d (2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } - [1]=> - object(Test3)#%d (2) { - [u"id"]=> - unicode(1) "4" - [u"val"]=> - unicode(1) "D" - } - } -} -Test1::__construct() -Test2::__construct() -Test3::__construct() -array(2) { - [u"Group1"]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [u"Group2"]=> - object(Test3)#%d (2) { - [u"id"]=> - unicode(1) "4" - [u"val"]=> - unicode(1) "D" - } -} diff --git a/ext/pdo/tests/pdo_011.phpt b/ext/pdo/tests/pdo_011.phpt deleted file mode 100644 index 570f0c706ecc5..0000000000000 --- a/ext/pdo/tests/pdo_011.phpt +++ /dev/null @@ -1,409 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_FUNC and statement overloading ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(3, \'C\', \'Group2\')'); -$db->exec('INSERT INTO test VALUES(4, \'D\', \'Group2\')'); - -class DerivedStatement extends PDOStatement -{ - private function __construct($name, $db) - { - $this->name = $name; - echo __METHOD__ . "($name)\n"; - } - - function retrieve($id, $val) { - echo __METHOD__ . "($id,$val)\n"; - return array($id=>$val); - } -} - -$select1 = $db->prepare('SELECT grp, id FROM test'); -$select2 = $db->prepare('SELECT id, val FROM test'); -$derived = $db->prepare('SELECT id, val FROM test', array(PDO::ATTR_STATEMENT_CLASS=>array('DerivedStatement', array('Overloaded', $db)))); - -class Test1 -{ - public function __construct($id, $val) - { - echo __METHOD__ . "($id,$val)\n"; - $this->id = $id; - $this->val = $val; - } - - static public function factory($id, $val) - { - echo __METHOD__ . "($id,$val)\n"; - return new self($id, $val); - } -} - -function test($id,$val='N/A') -{ - echo __METHOD__ . "($id,$val)\n"; - return array($id=>$val); -} - -$f = new Test1(0,0); - -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_FUNC|PDO::FETCH_GROUP, 'test')); - -$select2->execute(); -var_dump($select2->fetchAll(PDO::FETCH_FUNC, 'test')); - -$select2->execute(); -var_dump($select2->fetchAll(PDO::FETCH_FUNC, array('Test1','factory'))); - -$select2->execute(); -var_dump($select2->fetchAll(PDO::FETCH_FUNC, array($f, 'factory'))); - -var_dump(get_class($derived)); -$derived->execute(); -var_dump($derived->fetchAll(PDO::FETCH_FUNC, array($derived, 'retrieve'))); - -?> ---EXPECTF-- -DerivedStatement::__construct(Overloaded) -Test1::__construct(0,0) -test(1,N/A) -test(2,N/A) -test(3,N/A) -test(4,N/A) -array(2) { - ["Group1"]=> - array(2) { - [0]=> - array(1) { - [1]=> - string(3) "N/A" - } - [1]=> - array(1) { - [2]=> - string(3) "N/A" - } - } - ["Group2"]=> - array(2) { - [0]=> - array(1) { - [3]=> - string(3) "N/A" - } - [1]=> - array(1) { - [4]=> - string(3) "N/A" - } - } -} -test(1,A) -test(2,B) -test(3,C) -test(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - string(1) "A" - } - [1]=> - array(1) { - [2]=> - string(1) "B" - } - [2]=> - array(1) { - [3]=> - string(1) "C" - } - [3]=> - array(1) { - [4]=> - string(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - [2]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } - [3]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "4" - ["val"]=> - string(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "1" - ["val"]=> - string(1) "A" - } - [1]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "2" - ["val"]=> - string(1) "B" - } - [2]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "3" - ["val"]=> - string(1) "C" - } - [3]=> - object(Test1)#%d (2) { - ["id"]=> - string(1) "4" - ["val"]=> - string(1) "D" - } -} -string(16) "DerivedStatement" -DerivedStatement::retrieve(1,A) -DerivedStatement::retrieve(2,B) -DerivedStatement::retrieve(3,C) -DerivedStatement::retrieve(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - string(1) "A" - } - [1]=> - array(1) { - [2]=> - string(1) "B" - } - [2]=> - array(1) { - [3]=> - string(1) "C" - } - [3]=> - array(1) { - [4]=> - string(1) "D" - } -} ---UEXPECTF-- -DerivedStatement::__construct(Overloaded) -Test1::__construct(0,0) -test(1,N/A) -test(2,N/A) -test(3,N/A) -test(4,N/A) -array(2) { - [u"Group1"]=> - array(2) { - [0]=> - array(1) { - [1]=> - unicode(3) "N/A" - } - [1]=> - array(1) { - [2]=> - unicode(3) "N/A" - } - } - [u"Group2"]=> - array(2) { - [0]=> - array(1) { - [3]=> - unicode(3) "N/A" - } - [1]=> - array(1) { - [4]=> - unicode(3) "N/A" - } - } -} -test(1,A) -test(2,B) -test(3,C) -test(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - unicode(1) "A" - } - [1]=> - array(1) { - [2]=> - unicode(1) "B" - } - [2]=> - array(1) { - [3]=> - unicode(1) "C" - } - [3]=> - array(1) { - [4]=> - unicode(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [2]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } - [3]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "4" - [u"val"]=> - unicode(1) "D" - } -} -Test1::factory(1,A) -Test1::__construct(1,A) -Test1::factory(2,B) -Test1::__construct(2,B) -Test1::factory(3,C) -Test1::__construct(3,C) -Test1::factory(4,D) -Test1::__construct(4,D) -array(4) { - [0]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "1" - [u"val"]=> - unicode(1) "A" - } - [1]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "2" - [u"val"]=> - unicode(1) "B" - } - [2]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "3" - [u"val"]=> - unicode(1) "C" - } - [3]=> - object(Test1)#%d (2) { - [u"id"]=> - unicode(1) "4" - [u"val"]=> - unicode(1) "D" - } -} -unicode(16) "DerivedStatement" -DerivedStatement::retrieve(1,A) -DerivedStatement::retrieve(2,B) -DerivedStatement::retrieve(3,C) -DerivedStatement::retrieve(4,D) -array(4) { - [0]=> - array(1) { - [1]=> - unicode(1) "A" - } - [1]=> - array(1) { - [2]=> - unicode(1) "B" - } - [2]=> - array(1) { - [3]=> - unicode(1) "C" - } - [3]=> - array(1) { - [4]=> - unicode(1) "D" - } -} diff --git a/ext/pdo/tests/pdo_012.phpt b/ext/pdo/tests/pdo_012.phpt deleted file mode 100644 index f73a8eb941bb2..0000000000000 --- a/ext/pdo/tests/pdo_012.phpt +++ /dev/null @@ -1,151 +0,0 @@ ---TEST-- -PDO Common: PDOStatement::setFetchMode ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')'); - -$SELECT = 'SELECT val, grp FROM test'; - -$stmt = $db->query($SELECT, PDO::FETCH_NUM); -var_dump($stmt->fetchAll()); - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -unset($stmt); - -$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test'); -var_dump($stmt->fetchAll()); - -unset($stmt); - -$stmt = $db->query($SELECT, PDO::FETCH_NUM); -$stmt->setFetchMode(PDO::FETCH_CLASS, 'Test', array('Changed')); -var_dump($stmt->fetchAll()); - -?> ---EXPECTF-- -array(2) { - [0]=> - array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" - } - [1]=> - array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" - } -} -Test::__construct(N/A) -Test::__construct(N/A) -array(2) { - [0]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" - } -} -Test::__construct(Changed) -Test::__construct(Changed) -array(2) { - [0]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" - } -} ---UEXPECTF-- -array(2) { - [0]=> - array(2) { - [0]=> - unicode(1) "A" - [1]=> - unicode(6) "Group1" - } - [1]=> - array(2) { - [0]=> - unicode(1) "B" - [1]=> - unicode(6) "Group2" - } -} -Test::__construct(N/A) -Test::__construct(N/A) -array(2) { - [0]=> - object(Test)#%d (2) { - [u"val"]=> - unicode(1) "A" - [u"grp"]=> - unicode(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - [u"val"]=> - unicode(1) "B" - [u"grp"]=> - unicode(6) "Group2" - } -} -Test::__construct(Changed) -Test::__construct(Changed) -array(2) { - [0]=> - object(Test)#%d (2) { - [u"val"]=> - unicode(1) "A" - [u"grp"]=> - unicode(6) "Group1" - } - [1]=> - object(Test)#%d (2) { - [u"val"]=> - unicode(1) "B" - [u"grp"]=> - unicode(6) "Group2" - } -} diff --git a/ext/pdo/tests/pdo_013.phpt b/ext/pdo/tests/pdo_013.phpt deleted file mode 100644 index c560b6405a071..0000000000000 --- a/ext/pdo/tests/pdo_013.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -PDO Common: PDOStatement iterator ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')'); - -$SELECT = 'SELECT val, grp FROM test'; - -$stmt = $db->prepare($SELECT); - -$stmt->execute(); -$stmt->setFetchMode(PDO::FETCH_NUM); -foreach ($stmt as $data) -{ - var_dump($data); -} - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -unset($stmt); - -foreach ($db->query($SELECT, PDO::FETCH_CLASS, 'Test') as $data) -{ - var_dump($data); -} - -unset($stmt); - -$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test', array('WOW')); - -foreach($stmt as $data) -{ - var_dump($data); -} -?> ---EXPECTF-- -array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" -} -array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" -} -Test::__construct(N/A) -object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(N/A) -object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} -Test::__construct(WOW) -object(Test)#%d (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(WOW) -object(Test)#%d (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} ---UEXPECTF-- -array(2) { - [0]=> - unicode(1) "A" - [1]=> - unicode(6) "Group1" -} -array(2) { - [0]=> - unicode(1) "B" - [1]=> - unicode(6) "Group2" -} -Test::__construct(N/A) -object(Test)#%d (2) { - [u"val"]=> - unicode(1) "A" - [u"grp"]=> - unicode(6) "Group1" -} -Test::__construct(N/A) -object(Test)#%d (2) { - [u"val"]=> - unicode(1) "B" - [u"grp"]=> - unicode(6) "Group2" -} -Test::__construct(WOW) -object(Test)#%d (2) { - [u"val"]=> - unicode(1) "A" - [u"grp"]=> - unicode(6) "Group1" -} -Test::__construct(WOW) -object(Test)#%d (2) { - [u"val"]=> - unicode(1) "B" - [u"grp"]=> - unicode(6) "Group2" -} diff --git a/ext/pdo/tests/pdo_014.phpt b/ext/pdo/tests/pdo_014.phpt deleted file mode 100644 index 8692d8bee2edb..0000000000000 --- a/ext/pdo/tests/pdo_014.phpt +++ /dev/null @@ -1,133 +0,0 @@ ---TEST-- -PDO Common: PDOStatement SPL iterator ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -if (!extension_loaded('SPL')) print 'skip SPL not available'; -if (!class_exists('IteratorIterator', false)) die('skip IteratorIterator class not present'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')'); -$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')'); -$SELECT = 'SELECT val, grp FROM test'; - -class Test -{ - function __construct($name = 'N/A') - { - echo __METHOD__ . "($name)\n"; - } -} - -$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test', array('WOW')); - -$it = new IteratorIterator($stmt); /* check if we can convert that thing */ - -/*** HINT: If YOU plan to do so remember not to call rewind() -> see below ***/ - -foreach($it as $data) -{ - var_dump($data); -} - -$it->next(); /* must be allowed */ -var_dump($it->current()); /* must return NULL */ -var_dump($it->valid()); /* must return false */ - -class PDOStatementAggregate extends PDOStatement implements IteratorAggregate -{ - private function __construct() - { - echo __METHOD__ . "\n"; - $this->setFetchMode(PDO::FETCH_NUM); - /* default fetch mode is BOTH, so we see if the ctor can overwrite that */ - } - - function getIterator() - { - echo __METHOD__ . "\n"; - $this->execute(); - return new IteratorIterator($this, 'PDOStatement'); - } -} - -$stmt = $db->prepare($SELECT, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementAggregate'))); - -foreach($stmt as $data) -{ - var_dump($data); -} - -?> ---EXPECTF-- -Test::__construct(WOW) -object(Test)#4 (2) { - ["val"]=> - string(1) "A" - ["grp"]=> - string(6) "Group1" -} -Test::__construct(WOW) -object(Test)#6 (2) { - ["val"]=> - string(1) "B" - ["grp"]=> - string(6) "Group2" -} -NULL -bool(false) -PDOStatementAggregate::__construct -PDOStatementAggregate::getIterator -array(2) { - [0]=> - string(1) "A" - [1]=> - string(6) "Group1" -} -array(2) { - [0]=> - string(1) "B" - [1]=> - string(6) "Group2" -} ---UEXPECTF-- -Test::__construct(WOW) -object(Test)#4 (2) { - [u"val"]=> - unicode(1) "A" - [u"grp"]=> - unicode(6) "Group1" -} -Test::__construct(WOW) -object(Test)#6 (2) { - [u"val"]=> - unicode(1) "B" - [u"grp"]=> - unicode(6) "Group2" -} -NULL -bool(false) -PDOStatementAggregate::__construct -PDOStatementAggregate::getIterator -array(2) { - [0]=> - unicode(1) "A" - [1]=> - unicode(6) "Group1" -} -array(2) { - [0]=> - unicode(1) "B" - [1]=> - unicode(6) "Group2" -} diff --git a/ext/pdo/tests/pdo_015.phpt b/ext/pdo/tests/pdo_015.phpt deleted file mode 100644 index 4140d4b4a27d9..0000000000000 --- a/ext/pdo/tests/pdo_015.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_COLUMN ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(20))'); -$db->exec('INSERT INTO test VALUES(1, \'A\', \'A2\')'); -$db->exec('INSERT INTO test VALUES(2, \'A\', \'B2\')'); - -$select1 = $db->prepare('SELECT id, val, val2 FROM test'); -$select2 = $db->prepare('SELECT val, val2 FROM test'); - -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN, 2)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 0)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 1)); -$select1->execute(); -var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 2)); - -$select2->execute(); -var_dump($select2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP)); - -?> ---EXPECT-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" -} -array(2) { - [0]=> - string(2) "A2" - [1]=> - string(2) "B2" -} -array(2) { - [1]=> - array(1) { - [0]=> - string(1) "A" - } - [2]=> - array(1) { - [0]=> - string(1) "A" - } -} -array(2) { - [1]=> - string(1) "A" - [2]=> - string(1) "A" -} -array(2) { - [1]=> - string(1) "1" - [2]=> - string(1) "2" -} -array(2) { - [1]=> - string(1) "A" - [2]=> - string(1) "A" -} -array(2) { - [1]=> - string(2) "A2" - [2]=> - string(2) "B2" -} -array(1) { - ["A"]=> - array(2) { - [0]=> - string(2) "A2" - [1]=> - string(2) "B2" - } -} ---UEXPECT-- -array(2) { - [0]=> - unicode(1) "1" - [1]=> - unicode(1) "2" -} -array(2) { - [0]=> - unicode(2) "A2" - [1]=> - unicode(2) "B2" -} -array(2) { - [1]=> - array(1) { - [0]=> - unicode(1) "A" - } - [2]=> - array(1) { - [0]=> - unicode(1) "A" - } -} -array(2) { - [1]=> - unicode(1) "A" - [2]=> - unicode(1) "A" -} -array(2) { - [1]=> - unicode(1) "1" - [2]=> - unicode(1) "2" -} -array(2) { - [1]=> - unicode(1) "A" - [2]=> - unicode(1) "A" -} -array(2) { - [1]=> - unicode(2) "A2" - [2]=> - unicode(2) "B2" -} -array(1) { - [u"A"]=> - array(2) { - [0]=> - unicode(2) "A2" - [1]=> - unicode(2) "B2" - } -} diff --git a/ext/pdo/tests/pdo_016.phpt b/ext/pdo/tests/pdo_016.phpt deleted file mode 100644 index 7f4db0beabff8..0000000000000 --- a/ext/pdo/tests/pdo_016.phpt +++ /dev/null @@ -1,294 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_BOUND ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))'); -$db->exec('INSERT INTO test VALUES(0, \'String0\')'); -$db->exec('INSERT INTO test VALUES(1, \'String1\')'); -$db->exec('INSERT INTO test VALUES(2, \'String2\')'); - -$stmt1 = $db->prepare('SELECT COUNT(idx) FROM test'); -$stmt2 = $db->prepare('SELECT idx, txt FROM test ORDER by idx'); - -$stmt1->execute(); -var_dump($stmt1->fetchColumn()); -$stmt1 = null; - -$stmt2->execute(); -$cont = $stmt2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE); -var_dump($cont); - -echo "===WHILE===\n"; - -$stmt2->bindColumn('idx', $idx); -$stmt2->bindColumn('txt', $txt); -$stmt2->execute(); - -while($stmt2->fetch(PDO::FETCH_BOUND)) { - var_dump(array($idx=>$txt)); -} - -echo "===ALONE===\n"; - -$stmt3 = $db->prepare('SELECT txt FROM test WHERE idx=:inp'); -$stmt3->bindParam(':inp', $idx); /* by foreign name */ - -$stmt4 = $db->prepare('SELECT idx FROM test WHERE txt=:txt'); -$stmt4->bindParam(':txt', $txt); /* using same name */ - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - - if ($idx == 0) { - /* portability-wise, you may only bindColumn()s - * after execute() has been called at least once */ - $stmt3->bindColumn('txt', $col1); - } - var_dump($stmt3->fetch(PDO::FETCH_BOUND)); - $stmt3->closeCursor(); - - var_dump($stmt4->execute()); - if ($idx == 0) { - /* portability-wise, you may only bindColumn()s - * after execute() has been called at least once */ - $stmt4->bindColumn('idx', $col2); - } - var_dump($stmt4->fetch(PDO::FETCH_BOUND)); - $stmt4->closeCursor(); - var_dump(array($col2=>$col1)); -} - -echo "===REBIND/SAME===\n"; - -$stmt4->bindColumn('idx', $col1); - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - var_dump($stmt3->fetch(PDO::FETCH_BOUND)); - $stmt3->closeCursor(); - var_dump($col1); - var_dump($stmt4->execute()); - var_dump($stmt4->fetch(PDO::FETCH_BOUND)); - $stmt4->closeCursor(); - var_dump($col1); -} - -echo "===REBIND/CONFLICT===\n"; - -$stmt2->bindColumn('idx', $col1); -$stmt2->bindColumn('txt', $col1); -$stmt2->execute(); - -while($stmt2->fetch(PDO::FETCH_BOUND)) -{ - var_dump($col1); -} - - -?> ---EXPECT-- -string(1) "3" -array(3) { - [0]=> - string(7) "String0" - [1]=> - string(7) "String1" - [2]=> - string(7) "String2" -} -===WHILE=== -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -===ALONE=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [2]=> - string(7) "String2" -} -===REBIND/SAME=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -string(7) "String0" -bool(true) -bool(true) -string(1) "0" -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -string(7) "String1" -bool(true) -bool(true) -string(1) "1" -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -string(7) "String2" -bool(true) -bool(true) -string(1) "2" -===REBIND/CONFLICT=== -string(7) "String0" -string(7) "String1" -string(7) "String2" ---UEXPECT-- -unicode(1) "3" -array(3) { - [0]=> - unicode(7) "String0" - [1]=> - unicode(7) "String1" - [2]=> - unicode(7) "String2" -} -===WHILE=== -array(1) { - [0]=> - unicode(7) "String0" -} -array(1) { - [1]=> - unicode(7) "String1" -} -array(1) { - [2]=> - unicode(7) "String2" -} -===ALONE=== -array(1) { - [0]=> - unicode(7) "String0" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [0]=> - unicode(7) "String0" -} -array(1) { - [1]=> - unicode(7) "String1" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [1]=> - unicode(7) "String1" -} -array(1) { - [2]=> - unicode(7) "String2" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [2]=> - unicode(7) "String2" -} -===REBIND/SAME=== -array(1) { - [0]=> - unicode(7) "String0" -} -bool(true) -bool(true) -unicode(7) "String0" -bool(true) -bool(true) -unicode(1) "0" -array(1) { - [1]=> - unicode(7) "String1" -} -bool(true) -bool(true) -unicode(7) "String1" -bool(true) -bool(true) -unicode(1) "1" -array(1) { - [2]=> - unicode(7) "String2" -} -bool(true) -bool(true) -unicode(7) "String2" -bool(true) -bool(true) -unicode(1) "2" -===REBIND/CONFLICT=== -unicode(7) "String0" -unicode(7) "String1" -unicode(7) "String2" diff --git a/ext/pdo/tests/pdo_016a.phpt b/ext/pdo/tests/pdo_016a.phpt deleted file mode 100755 index 34ecf41d54001..0000000000000 --- a/ext/pdo/tests/pdo_016a.phpt +++ /dev/null @@ -1,294 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_BOUND w/o : ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))'); -$db->exec('INSERT INTO test VALUES(0, \'String0\')'); -$db->exec('INSERT INTO test VALUES(1, \'String1\')'); -$db->exec('INSERT INTO test VALUES(2, \'String2\')'); - -$stmt1 = $db->prepare('SELECT COUNT(idx) FROM test'); -$stmt2 = $db->prepare('SELECT idx, txt FROM test ORDER by idx'); - -$stmt1->execute(); -var_dump($stmt1->fetchColumn()); -$stmt1 = null; - -$stmt2->execute(); -$cont = $stmt2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE); -var_dump($cont); - -echo "===WHILE===\n"; - -$stmt2->bindColumn('idx', $idx); -$stmt2->bindColumn('txt', $txt); -$stmt2->execute(); - -while($stmt2->fetch(PDO::FETCH_BOUND)) { - var_dump(array($idx=>$txt)); -} - -echo "===ALONE===\n"; - -$stmt3 = $db->prepare('SELECT txt FROM test WHERE idx=:inp'); -$stmt3->bindParam('inp', $idx); /* by foreign name */ - -$stmt4 = $db->prepare('SELECT idx FROM test WHERE txt=:txt'); -$stmt4->bindParam('txt', $txt); /* using same name */ - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - - if ($idx == 0) { - /* portability-wise, you may only bindColumn()s - * after execute() has been called at least once */ - $stmt3->bindColumn('txt', $col1); - } - var_dump($stmt3->fetch(PDO::FETCH_BOUND)); - $stmt3->closeCursor(); - - var_dump($stmt4->execute()); - if ($idx == 0) { - /* portability-wise, you may only bindColumn()s - * after execute() has been called at least once */ - $stmt4->bindColumn('idx', $col2); - } - var_dump($stmt4->fetch(PDO::FETCH_BOUND)); - $stmt4->closeCursor(); - var_dump(array($col2=>$col1)); -} - -echo "===REBIND/SAME===\n"; - -$stmt4->bindColumn('idx', $col1); - -foreach($cont as $idx => $txt) -{ - var_dump(array($idx=>$txt)); - var_dump($stmt3->execute()); - var_dump($stmt3->fetch(PDO::FETCH_BOUND)); - $stmt3->closeCursor(); - var_dump($col1); - var_dump($stmt4->execute()); - var_dump($stmt4->fetch(PDO::FETCH_BOUND)); - $stmt4->closeCursor(); - var_dump($col1); -} - -echo "===REBIND/CONFLICT===\n"; - -$stmt2->bindColumn('idx', $col1); -$stmt2->bindColumn('txt', $col1); -$stmt2->execute(); - -while($stmt2->fetch(PDO::FETCH_BOUND)) -{ - var_dump($col1); -} - - -?> ---EXPECT-- -string(1) "3" -array(3) { - [0]=> - string(7) "String0" - [1]=> - string(7) "String1" - [2]=> - string(7) "String2" -} -===WHILE=== -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -===ALONE=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [2]=> - string(7) "String2" -} -===REBIND/SAME=== -array(1) { - [0]=> - string(7) "String0" -} -bool(true) -bool(true) -string(7) "String0" -bool(true) -bool(true) -string(1) "0" -array(1) { - [1]=> - string(7) "String1" -} -bool(true) -bool(true) -string(7) "String1" -bool(true) -bool(true) -string(1) "1" -array(1) { - [2]=> - string(7) "String2" -} -bool(true) -bool(true) -string(7) "String2" -bool(true) -bool(true) -string(1) "2" -===REBIND/CONFLICT=== -string(7) "String0" -string(7) "String1" -string(7) "String2" ---UEXPECT-- -unicode(1) "3" -array(3) { - [0]=> - unicode(7) "String0" - [1]=> - unicode(7) "String1" - [2]=> - unicode(7) "String2" -} -===WHILE=== -array(1) { - [0]=> - unicode(7) "String0" -} -array(1) { - [1]=> - unicode(7) "String1" -} -array(1) { - [2]=> - unicode(7) "String2" -} -===ALONE=== -array(1) { - [0]=> - unicode(7) "String0" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [0]=> - unicode(7) "String0" -} -array(1) { - [1]=> - unicode(7) "String1" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [1]=> - unicode(7) "String1" -} -array(1) { - [2]=> - unicode(7) "String2" -} -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - [2]=> - unicode(7) "String2" -} -===REBIND/SAME=== -array(1) { - [0]=> - unicode(7) "String0" -} -bool(true) -bool(true) -unicode(7) "String0" -bool(true) -bool(true) -unicode(1) "0" -array(1) { - [1]=> - unicode(7) "String1" -} -bool(true) -bool(true) -unicode(7) "String1" -bool(true) -bool(true) -unicode(1) "1" -array(1) { - [2]=> - unicode(7) "String2" -} -bool(true) -bool(true) -unicode(7) "String2" -bool(true) -bool(true) -unicode(1) "2" -===REBIND/CONFLICT=== -unicode(7) "String0" -unicode(7) "String1" -unicode(7) "String2" diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt deleted file mode 100644 index 6713bfda9dc7c..0000000000000 --- a/ext/pdo/tests/pdo_017.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -PDO Common: transactions ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); - -$db = PDOTest::factory(); -try { - $db->beginTransaction(); -} catch (PDOException $e) { - die('skip no working transactions: ' . $e->getMessage()); -} - -if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { - if (false === PDOTest::detect_transactional_mysql_engine($db)) { - die('skip your mysql configuration does not support working transactions'); - } -} -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { - $suf = ' Type=' . PDOTest::detect_transactional_mysql_engine($db); -} else { - $suf = ''; -} - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))'.$suf); -$db->exec("INSERT INTO test VALUES(1, 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C')"); -$delete = $db->prepare('DELETE FROM test'); - -function countRows($action) { - global $db; - $select = $db->prepare('SELECT COUNT(*) FROM test'); - $select->execute(); - $res = $select->fetchColumn(); - return "Counted $res rows after $action.\n"; -} - -echo countRows('insert'); - -$db->beginTransaction(); -$delete->execute(); -echo countRows('delete'); -$db->rollBack(); - -echo countRows('rollback'); - -?> ---EXPECT-- -Counted 3 rows after insert. -Counted 0 rows after delete. -Counted 3 rows after rollback. diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt deleted file mode 100644 index 79d59d36e3282..0000000000000 --- a/ext/pdo/tests/pdo_018.phpt +++ /dev/null @@ -1,383 +0,0 @@ ---TEST-- -PDO Common: serializing ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -if (!interface_exists('Serializable')) die('skip no Serializable interface'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -class TestBase implements Serializable -{ - public $BasePub = 'Public'; - protected $BasePro = 'Protected'; - private $BasePri = 'Private'; - - function serialize() - { - $serialized = array(); - foreach($this as $prop => $val) { - $serialized[$prop] = $val; - } - $serialized = serialize($serialized); - echo __METHOD__ . "() = '$serialized'\n"; - return $serialized; - } - - function unserialize($serialized) - { - echo __METHOD__ . "($serialized)\n"; - foreach(unserialize($serialized) as $prop => $val) { - $this->$prop = '#'.$val; - } - return true; - } -} - -class TestDerived extends TestBase -{ - public $BasePub = 'DerivedPublic'; - protected $BasePro = 'DerivdeProtected'; - public $DerivedPub = 'Public'; - protected $DerivedPro = 'Protected'; - private $DerivedPri = 'Private'; - - function serialize() - { - echo __METHOD__ . "()\n"; - return TestBase::serialize(); - } - - function unserialize($serialized) - { - echo __METHOD__ . "()\n"; - return TestBase::unserialize($serialized); - } -} - -class TestLeaf extends TestDerived -{ -} - -$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(20) NOT NULL UNIQUE)'); -$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); -$db->exec('INSERT INTO classtypes VALUES(1, \'TestBase\')'); -$db->exec('INSERT INTO classtypes VALUES(2, \'TestDerived\')'); -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(255))'); - -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -var_dump($db->query('SELECT COUNT(*) FROM classtypes')->fetchColumn()); -var_dump($db->query('SELECT id, name FROM classtypes ORDER by id')->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE)); - -$objs = array(); -$objs[0] = new stdClass; -$objs[1] = new TestBase; -$objs[2] = new TestDerived; -$objs[3] = new TestLeaf; - -$stmt = $db->prepare('SELECT id FROM classtypes WHERE name=:cname'); -$stmt->bindParam(':cname', $cname); - -$ctypes = array(); - -foreach($objs as $obj) -{ - $cname = get_class($obj); - $ctype = NULL; /* set default for non stored class name */ - $stmt->execute(); - $stmt->bindColumn('id', $ctype); - $stmt->fetch(PDO::FETCH_BOUND); - $ctypes[$cname] = $ctype; -} - -echo "===TYPES===\n"; -var_dump($ctypes); - -unset($stmt); - -echo "===INSERT===\n"; -$stmt = $db->prepare('INSERT INTO test VALUES(:id, :classtype, :val)'); -$stmt->bindParam(':id', $idx); -$stmt->bindParam(':classtype', $ctype); -$stmt->bindParam(':val', $val); - -foreach($objs as $idx => $obj) -{ - $ctype = $ctypes[get_class($obj)]; - if (method_exists($obj, 'serialize')) - { - $val = $obj->serialize(); - } - else - { - $val = ''; - } - $stmt->execute(); -} - -unset($stmt); - -echo "===DATA===\n"; -var_dump($db->query('SELECT test.val FROM test')->fetchAll(PDO::FETCH_COLUMN)); - -echo "===FAILURE===\n"; -try -{ - $db->query('SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id')->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_SERIALIZE, 'TestLeaf', array()); -} -catch (PDOException $e) -{ - echo 'Exception:'; - echo $e->getMessage()."\n"; -} - -echo "===COUNT===\n"; -var_dump($db->query('SELECT COUNT(*) FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)')->fetchColumn()); - -echo "===DATABASE===\n"; -$stmt = $db->prepare('SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)'); - -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); - -echo "===FETCHCLASS===\n"; -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_SERIALIZE, 'TestLeaf')); - - -?> ---EXPECTF-- -string(1) "3" -array(3) { - [0]=> - string(8) "stdClass" - [1]=> - string(8) "TestBase" - [2]=> - string(11) "TestDerived" -} -===TYPES=== -array(4) { - ["stdClass"]=> - string(1) "0" - ["TestBase"]=> - string(1) "1" - ["TestDerived"]=> - string(1) "2" - ["TestLeaf"]=> - NULL -} -===INSERT=== -TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -===DATA=== -array(4) { - [0]=> - string(0) "" - [1]=> - string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - [2]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - [3]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" -} -===FAILURE=== -Exception:SQLSTATE[HY000]: General error: cannot unserialize class -===COUNT=== -string(1) "3" -===DATABASE=== -array(3) { - [0]=> - array(2) { - ["name"]=> - string(8) "TestBase" - ["val"]=> - string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - } - [1]=> - array(2) { - ["name"]=> - string(11) "TestDerived" - ["val"]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } - [2]=> - array(2) { - ["name"]=> - NULL - ["val"]=> - string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } -} -===FETCHCLASS=== -TestBase::unserialize(a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}) -TestDerived::unserialize() -TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -TestDerived::unserialize() -TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -array(3) { - [0]=> - object(TestBase)#%d (3) { - ["BasePub"]=> - string(7) "#Public" - ["BasePro":protected]=> - string(10) "#Protected" - ["BasePri":"TestBase":private]=> - string(8) "#Private" - } - [1]=> - object(TestDerived)#%d (6) { - ["BasePub"]=> - string(14) "#DerivedPublic" - ["BasePro":protected]=> - string(17) "#DerivdeProtected" - ["DerivedPub"]=> - string(7) "#Public" - ["DerivedPro":protected]=> - string(10) "#Protected" - ["DerivedPri":"TestDerived":private]=> - string(7) "Private" - ["BasePri":"TestBase":private]=> - string(7) "Private" - } - [2]=> - object(TestLeaf)#%d (6) { - ["BasePub"]=> - string(14) "#DerivedPublic" - ["BasePro":protected]=> - string(17) "#DerivdeProtected" - ["DerivedPub"]=> - string(7) "#Public" - ["DerivedPro":protected]=> - string(10) "#Protected" - ["DerivedPri":"TestDerived":private]=> - string(7) "Private" - ["BasePri":"TestBase":private]=> - string(7) "Private" - } -} ---UEXPECTF-- -unicode(1) "3" -array(3) { - [0]=> - unicode(8) "stdClass" - [1]=> - unicode(8) "TestBase" - [2]=> - unicode(11) "TestDerived" -} -===TYPES=== -array(4) { - [u"stdClass"]=> - unicode(1) "0" - [u"TestBase"]=> - unicode(1) "1" - [u"TestDerived"]=> - unicode(1) "2" - [u"TestLeaf"]=> - NULL -} -===INSERT=== -TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -TestDerived::serialize() -TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' -===DATA=== -array(4) { - [0]=> - unicode(0) "" - [1]=> - unicode(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - [2]=> - unicode(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - [3]=> - unicode(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" -} -===FAILURE=== -Exception:SQLSTATE[HY000]: General error: cannot unserialize class -===COUNT=== -unicode(1) "3" -===DATABASE=== -array(3) { - [0]=> - array(2) { - [u"name"]=> - unicode(8) "TestBase" - [u"val"]=> - unicode(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" - } - [1]=> - array(2) { - [u"name"]=> - unicode(11) "TestDerived" - [u"val"]=> - unicode(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } - [2]=> - array(2) { - [u"name"]=> - NULL - [u"val"]=> - unicode(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" - } -} -===FETCHCLASS=== -TestBase::unserialize(a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}) -TestDerived::unserialize() -TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -TestDerived::unserialize() -TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) -array(3) { - [0]=> - object(TestBase)#%d (3) { - [u"BasePub"]=> - unicode(7) "#Public" - [u"BasePro":protected]=> - unicode(10) "#Protected" - [u"BasePri":u"TestBase":private]=> - unicode(8) "#Private" - } - [1]=> - object(TestDerived)#%d (6) { - [u"BasePub"]=> - unicode(14) "#DerivedPublic" - [u"BasePro":protected]=> - unicode(17) "#DerivdeProtected" - [u"DerivedPub"]=> - unicode(7) "#Public" - [u"DerivedPro":protected]=> - unicode(10) "#Protected" - [u"DerivedPri":u"TestDerived":private]=> - unicode(7) "Private" - [u"BasePri":u"TestBase":private]=> - unicode(7) "Private" - } - [2]=> - object(TestLeaf)#%d (6) { - [u"BasePub"]=> - unicode(14) "#DerivedPublic" - [u"BasePro":protected]=> - unicode(17) "#DerivdeProtected" - [u"DerivedPub"]=> - unicode(7) "#Public" - [u"DerivedPro":protected]=> - unicode(10) "#Protected" - [u"DerivedPri":u"TestDerived":private]=> - unicode(7) "Private" - [u"BasePri":u"TestBase":private]=> - unicode(7) "Private" - } -} diff --git a/ext/pdo/tests/pdo_019.phpt b/ext/pdo/tests/pdo_019.phpt deleted file mode 100644 index 0e1021706076a..0000000000000 --- a/ext/pdo/tests/pdo_019.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -PDO Common: fetch() and while() ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))'); -$db->exec('INSERT INTO test VALUES(0, \'String0\')'); -$db->exec('INSERT INTO test VALUES(1, \'String1\')'); -$db->exec('INSERT INTO test VALUES(2, \'String2\')'); -$db->exec('INSERT INTO test VALUES(3, \'String3\')'); - - -var_dump($db->query('SELECT COUNT(*) FROM test')->fetchColumn()); - -$stmt = $db->prepare('SELECT idx, txt FROM test ORDER by idx'); - -$stmt->execute(); -$cont = $stmt->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE); -var_dump($cont); - -echo "===WHILE===\n"; - -$stmt->bindColumn('idx', $idx); -$stmt->bindColumn('txt', $txt); -$stmt->execute(); - -while($stmt->fetch(PDO::FETCH_BOUND)) { - var_dump(array($idx=>$txt)); -} - -?> ---EXPECT-- -string(1) "4" -array(4) { - [0]=> - string(7) "String0" - [1]=> - string(7) "String1" - [2]=> - string(7) "String2" - [3]=> - string(7) "String3" -} -===WHILE=== -array(1) { - [0]=> - string(7) "String0" -} -array(1) { - [1]=> - string(7) "String1" -} -array(1) { - [2]=> - string(7) "String2" -} -array(1) { - [3]=> - string(7) "String3" -} ---UEXPECT-- -unicode(1) "4" -array(4) { - [0]=> - unicode(7) "String0" - [1]=> - unicode(7) "String1" - [2]=> - unicode(7) "String2" - [3]=> - unicode(7) "String3" -} -===WHILE=== -array(1) { - [0]=> - unicode(7) "String0" -} -array(1) { - [1]=> - unicode(7) "String1" -} -array(1) { - [2]=> - unicode(7) "String2" -} -array(1) { - [3]=> - unicode(7) "String3" -} diff --git a/ext/pdo/tests/pdo_020.phpt b/ext/pdo/tests/pdo_020.phpt deleted file mode 100644 index 9fd5a90897cea..0000000000000 --- a/ext/pdo/tests/pdo_020.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -PDO Common: PDOStatement::columnCount ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); -$db->exec("INSERT INTO test VALUES(1, 'A', 'A')"); -$db->exec("INSERT INTO test VALUES(2, 'B', 'B')"); -$db->exec("INSERT INTO test VALUES(3, 'C', 'C')"); - -foreach (array('SELECT id, val FROM test', 'SELECT id, val, val2 FROM test', 'SELECT COUNT(*) FROM test') as $sql) { - - $stmt = $db->query($sql); - $res = $stmt->columnCount(); - echo "Counted $res columns after $sql.\n"; - $stmt = null; -} - -?> ---EXPECT-- -Counted 2 columns after SELECT id, val FROM test. -Counted 3 columns after SELECT id, val, val2 FROM test. -Counted 1 columns after SELECT COUNT(*) FROM test. diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt deleted file mode 100644 index 976df96972d6d..0000000000000 --- a/ext/pdo/tests/pdo_021.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -PDO Common: PDOStatement::execute with parameters ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$select = $db->prepare('SELECT COUNT(id) FROM test'); - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), - array('40', 'Jkl', 'qpo'), - array('50', 'Mno', 'nml'), - array('60', 'Pqr', 'kji'), -); - - -// Insert using question mark placeholders -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -foreach ($data as $row) { - $stmt->execute($row); -} -$select->execute(); -$num = $select->fetchColumn(); -echo 'There are ' . $num . " rows in the table.\n"; - -$select->closeCursor(); - -// Insert using named parameters -$stmt2 = $db->prepare("INSERT INTO test VALUES(:first, :second, :third)"); -foreach ($data as $row) { - $stmt2->execute(array(':first'=>($row[0] + 5), ':second'=>$row[1], - ':third'=>$row[2])); -} - -$select->execute(); -$num = $select->fetchColumn(); -echo 'There are ' . $num . " rows in the table.\n"; - - -?> ---EXPECT-- -There are 6 rows in the table. -There are 12 rows in the table. diff --git a/ext/pdo/tests/pdo_022.phpt b/ext/pdo/tests/pdo_022.phpt deleted file mode 100644 index 942f7defc5808..0000000000000 --- a/ext/pdo/tests/pdo_022.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -PDO Common: PDOStatement::getColumnMeta ---SKIPIF-- -<?php # vim:ft=php -die('skip this feature is not yet finalized, no test makes sense'); -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -/* - * Note well: meta information is a nightmare to handle portably. - * it's not really PDOs job. - * We've not yet defined exactly what makes sense for getColumnMeta, - * so no tests make any sense to anyone. When they do, we can enable - * this test file. - * TODO: filter out driver dependent components from this common core - * test file. - */ -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); -$db->exec('insert2', "INSERT INTO test VALUES(:first, :second, :third)"); - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), - array('40', 'Jkl', 'qpo'), - array('50', 'Mno', 'nml'), - array('60', 'Pqr', 'kji'), -); - - -// Insert using question mark placeholders -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -foreach ($data as $row) { - $stmt->execute($row); -} - -// Retrieve column metadata for a result set returned by explicit SELECT -$select = $db->query('SELECT id, val, val2 FROM test'); -$meta = $select->getColumnMeta(0); -var_dump($meta); -$meta = $select->getColumnMeta(1); -var_dump($meta); -$meta = $select->getColumnMeta(2); -var_dump($meta); - -// Retrieve column metadata for a result set returned by a function -$select = $db->query('SELECT COUNT(*) FROM test'); -$meta = $select->getColumnMeta(0); -var_dump($meta); - -?> ---EXPECT-- -The unexpected! diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt deleted file mode 100644 index bf05c5a35c47e..0000000000000 --- a/ext/pdo/tests/pdo_023.phpt +++ /dev/null @@ -1,148 +0,0 @@ ---TEST-- -PDO Common: extending PDO ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; - -class PDOStatementX extends PDOStatement -{ - public $test1 = 1; - - protected function __construct() - { - $this->test2 = 2; - $this->test2 = 22; - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } -} - -class PDODatabaseX extends PDO -{ - public $test1 = 1; - - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function test() - { - $this->test2 = 2; - var_dump($this->test1); - var_dump($this->test2); - $this->test2 = 22; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - $stmt = parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx'))); - $stmt->execute(); - return $stmt; - } -} - -$db = PDOTest::factory('PDODatabaseX'); -$db->test(); -var_dump($db); - -$db->query('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))'); -$db->query('INSERT INTO test VALUES(0, \'A\')'); -$db->query('INSERT INTO test VALUES(1, \'B\')'); - - -$stmt = $db->query('SELECT val, id FROM test'); -var_dump($stmt); -var_dump($stmt->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE)); - -$stmt = NULL; -$db = NULL; - - -?> ---EXPECTF-- -int(1) -int(2) -object(PDODatabaseX)#%d (2) { - ["test1"]=> - int(1) - ["test2"]=> - int(22) -} -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -object(PDOStatementX)#%d (3) { - ["test1"]=> - int(1) - ["queryString"]=> - string(24) "SELECT val, id FROM test" - ["test2"]=> - int(22) -} -array(2) { - ["A"]=> - string(1) "0" - ["B"]=> - string(1) "1" -} -PDOStatementX::__destruct() -PDODatabaseX::__destruct() ---UEXPECTF-- -int(1) -int(2) -object(PDODatabaseX)#%d (2) { - [u"test1"]=> - int(1) - [u"test2"]=> - int(22) -} -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -PDOStatementX::__destruct() -PDODatabaseX::query() -PDOStatementX::__construct() -object(PDOStatementX)#%d (3) { - [u"test1"]=> - int(1) - [u"queryString"]=> - unicode(24) "SELECT val, id FROM test" - [u"test2"]=> - int(22) -} -array(2) { - [u"A"]=> - unicode(1) "0" - [u"B"]=> - unicode(1) "1" -} -PDOStatementX::__destruct() -PDODatabaseX::__destruct() diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt deleted file mode 100644 index ccaec3fcfc510..0000000000000 --- a/ext/pdo/tests/pdo_024.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -PDO Common: assert that bindParam does not modify parameter ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('create table test (id int, name varchar(10))'); - -$stmt = $db->prepare('insert into test (id, name) values(0, :name)'); -$name = NULL; -$before_bind = $name; -$stmt->bindParam(':name', $name); -if ($name !== $before_bind) { - echo "bind: fail\n"; -} else { - echo "bind: success\n"; -} -var_dump($stmt->execute()); -var_dump($db->query('select name from test where id=0')->fetchColumn()); - -?> ---EXPECT-- -bind: success -bool(true) -NULL diff --git a/ext/pdo/tests/pdo_025.phpt b/ext/pdo/tests/pdo_025.phpt deleted file mode 100644 index 8594c1240a2d9..0000000000000 --- a/ext/pdo/tests/pdo_025.phpt +++ /dev/null @@ -1,165 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_INTO ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), - array('40', 'Jkl', 'qpo'), - array('50', 'Mno', 'nml'), - array('60', 'Pqr', 'kji'), -); - - -// Insert using question mark placeholders -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -foreach ($data as $row) { - $stmt->execute($row); -} - -class Test { - public $id, $val, $val2; -} - -$stmt = $db->prepare('SELECT * FROM test'); -$stmt->setFetchMode(PDO::FETCH_INTO, new Test); -$stmt->execute(); - -foreach($stmt as $obj) { - var_dump($obj); -} - -echo "===FAIL===\n"; - -class Fail { - protected $id; - public $val, $val2; -} - -$stmt->setFetchMode(PDO::FETCH_INTO, new Fail); -$stmt->execute(); - -foreach($stmt as $obj) { - var_dump($obj); -} - -?> ---EXPECTF-- -object(Test)#%d (3) { - ["id"]=> - string(2) "10" - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -object(Test)#%d (3) { - ["id"]=> - string(2) "20" - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -object(Test)#%d (3) { - ["id"]=> - string(2) "30" - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -object(Test)#%d (3) { - ["id"]=> - string(2) "40" - ["val"]=> - string(3) "Jkl" - ["val2"]=> - string(3) "qpo" -} -object(Test)#%d (3) { - ["id"]=> - string(2) "50" - ["val"]=> - string(3) "Mno" - ["val2"]=> - string(3) "nml" -} -object(Test)#%d (3) { - ["id"]=> - string(2) "60" - ["val"]=> - string(3) "Pqr" - ["val2"]=> - string(3) "kji" -} -===FAIL=== - -Fatal error: Cannot access protected property Fail::$id in %spdo_025.php on line %d ---UEXPECTF-- -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "10" - [u"val"]=> - unicode(3) "Abc" - [u"val2"]=> - unicode(3) "zxy" -} -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "20" - [u"val"]=> - unicode(3) "Def" - [u"val2"]=> - unicode(3) "wvu" -} -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "30" - [u"val"]=> - unicode(3) "Ghi" - [u"val2"]=> - unicode(3) "tsr" -} -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "40" - [u"val"]=> - unicode(3) "Jkl" - [u"val2"]=> - unicode(3) "qpo" -} -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "50" - [u"val"]=> - unicode(3) "Mno" - [u"val2"]=> - unicode(3) "nml" -} -object(Test)#%d (3) { - [u"id"]=> - unicode(2) "60" - [u"val"]=> - unicode(3) "Pqr" - [u"val2"]=> - unicode(3) "kji" -} -===FAIL=== - -Fatal error: Cannot access protected property Fail::$id in %spdo_025.php on line %d diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt deleted file mode 100644 index 738a6f483e7ae..0000000000000 --- a/ext/pdo/tests/pdo_026.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -PDO Common: extending PDO (2) ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), -); - -class PDOStatementX extends PDOStatement -{ - public $dbh; - - protected function __construct($dbh) - { - $this->dbh = $dbh; - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } -} - -class PDODatabase extends PDO -{ - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); - $stmt->setFetchMode(PDO::FETCH_ASSOC); - $stmt->execute(); - return $stmt; - } -} - -$db = PDOTest::factory('PDODatabase'); -var_dump(get_class($db)); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -var_dump(get_class($stmt)); -foreach ($data as $row) { - $stmt->execute($row); -} - -unset($stmt); - -$stmt = $db->query('SELECT * FROM test'); -var_dump(get_class($stmt)); -var_dump(get_class($stmt->dbh)); - -foreach($stmt as $obj) { - var_dump($obj); -} - -echo "===DONE===\n"; -?> ---EXPECT-- -string(11) "PDODatabase" -string(12) "PDOStatement" -PDODatabase::query() -PDOStatementX::__construct() -string(13) "PDOStatementX" -string(11) "PDODatabase" -array(3) { - ["id"]=> - string(2) "10" - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -array(3) { - ["id"]=> - string(2) "20" - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -array(3) { - ["id"]=> - string(2) "30" - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() ---UEXPECT-- -unicode(11) "PDODatabase" -unicode(12) "PDOStatement" -PDODatabase::query() -PDOStatementX::__construct() -unicode(13) "PDOStatementX" -unicode(11) "PDODatabase" -array(3) { - [u"id"]=> - unicode(2) "10" - [u"val"]=> - unicode(3) "Abc" - [u"val2"]=> - unicode(3) "zxy" -} -array(3) { - [u"id"]=> - unicode(2) "20" - [u"val"]=> - unicode(3) "Def" - [u"val2"]=> - unicode(3) "wvu" -} -array(3) { - [u"id"]=> - unicode(2) "30" - [u"val"]=> - unicode(3) "Ghi" - [u"val2"]=> - unicode(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() diff --git a/ext/pdo/tests/pdo_027.phpt b/ext/pdo/tests/pdo_027.phpt deleted file mode 100644 index a21524d75ffba..0000000000000 --- a/ext/pdo/tests/pdo_027.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -PDO Common: PDO::FETCH_LAZY ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('create table test (id int, name varchar(10))'); -$db->exec("INSERT INTO test (id,name) VALUES(1,'test1')"); -$db->exec("INSERT INTO test (id,name) VALUES(2,'test2')"); - -foreach ($db->query("SELECT * FROM test", PDO::FETCH_LAZY) as $v) { - echo "lazy: " . $v->id.$v->name."\n"; -} -echo "End\n"; -?> ---EXPECT-- -lazy: 1test1 -lazy: 2test2 -End diff --git a/ext/pdo/tests/pdo_028.phpt b/ext/pdo/tests/pdo_028.phpt deleted file mode 100644 index a7797a89b8ce9..0000000000000 --- a/ext/pdo/tests/pdo_028.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -PDO Common: bindValue ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val1 VARCHAR(10), val2 VARCHAR(10), val3 VARCHAR(10))'); -$stmt = $db->prepare('INSERT INTO test values (1, ?, ?, ?)'); - -$data = array("one", "two", "three"); - -foreach ($data as $i => $v) { - $stmt->bindValue($i+1, $v); -} -$stmt->execute(); - -$stmt = $db->prepare('SELECT * from test'); -$stmt->execute(); - -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); -?> ---EXPECT-- -array(1) { - [0]=> - array(4) { - ["id"]=> - string(1) "1" - ["val1"]=> - string(3) "one" - ["val2"]=> - string(3) "two" - ["val3"]=> - string(5) "three" - } -} ---UEXPECT-- -array(1) { - [0]=> - array(4) { - [u"id"]=> - unicode(1) "1" - [u"val1"]=> - unicode(3) "one" - [u"val2"]=> - unicode(3) "two" - [u"val3"]=> - unicode(5) "three" - } -} diff --git a/ext/pdo/tests/pdo_029.phpt b/ext/pdo/tests/pdo_029.phpt deleted file mode 100755 index 0c70563790352..0000000000000 --- a/ext/pdo/tests/pdo_029.phpt +++ /dev/null @@ -1,162 +0,0 @@ ---TEST-- -PDO Common: extending PDO (3) ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), -); - -class PDOStatementX extends PDOStatement -{ - public $dbh; - - protected function __construct($dbh) - { - $this->dbh = $dbh; - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function execute() - { - echo __METHOD__ . "()\n"; - parent::execute(); - } -} - -class PDODatabase extends PDO -{ - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); - $stmt->setFetchMode(PDO::FETCH_ASSOC); - $stmt->execute(); - return $stmt; - } -} - -$db = PDOTest::factory('PDODatabase'); -var_dump(get_class($db)); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -var_dump(get_class($stmt)); -foreach ($data as $row) { - $stmt->execute($row); -} - -unset($stmt); - -echo "===QUERY===\n"; - -$stmt = $db->query('SELECT * FROM test'); -var_dump(get_class($stmt)); -var_dump(get_class($stmt->dbh)); - -echo "===FOREACH===\n"; - -foreach($stmt as $obj) { - var_dump($obj); -} - -echo "===DONE===\n"; -exit(0); -?> ---EXPECT-- -string(11) "PDODatabase" -string(12) "PDOStatement" -===QUERY=== -PDODatabase::query() -PDOStatementX::__construct() -PDOStatementX::execute() -string(13) "PDOStatementX" -string(11) "PDODatabase" -===FOREACH=== -array(3) { - ["id"]=> - string(2) "10" - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -array(3) { - ["id"]=> - string(2) "20" - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -array(3) { - ["id"]=> - string(2) "30" - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() ---UEXPECT-- -unicode(11) "PDODatabase" -unicode(12) "PDOStatement" -===QUERY=== -PDODatabase::query() -PDOStatementX::__construct() -PDOStatementX::execute() -unicode(13) "PDOStatementX" -unicode(11) "PDODatabase" -===FOREACH=== -array(3) { - [u"id"]=> - unicode(2) "10" - [u"val"]=> - unicode(3) "Abc" - [u"val2"]=> - unicode(3) "zxy" -} -array(3) { - [u"id"]=> - unicode(2) "20" - [u"val"]=> - unicode(3) "Def" - [u"val2"]=> - unicode(3) "wvu" -} -array(3) { - [u"id"]=> - unicode(2) "30" - [u"val"]=> - unicode(3) "Ghi" - [u"val2"]=> - unicode(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() diff --git a/ext/pdo/tests/pdo_030.phpt b/ext/pdo/tests/pdo_030.phpt deleted file mode 100755 index 7c260afec008e..0000000000000 --- a/ext/pdo/tests/pdo_030.phpt +++ /dev/null @@ -1,189 +0,0 @@ ---TEST-- -PDO Common: extending PDO (4) ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), -); - -class PDOStatementX extends PDOStatement -{ - public $dbh; - - protected function __construct($dbh) - { - $this->dbh = $dbh; - $this->setFetchMode(PDO::FETCH_ASSOC); - echo __METHOD__ . "()\n"; - } - - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function execute() - { - echo __METHOD__ . "()\n"; - parent::execute(); - } -} - -class PDODatabase extends PDO -{ - function __destruct() - { - echo __METHOD__ . "()\n"; - } - - function query($sql) - { - echo __METHOD__ . "()\n"; - return parent::query($sql); - } -} - -$db = PDOTest::factory('PDODatabase'); -var_dump(get_class($db)); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -var_dump(get_class($stmt)); -foreach ($data as $row) { - $stmt->execute($row); -} - -unset($stmt); - -echo "===QUERY===\n"; - -var_dump($db->getAttribute(PDO::ATTR_STATEMENT_CLASS)); -$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatementx', array($db))); -var_dump($db->getAttribute(PDO::ATTR_STATEMENT_CLASS)); -$stmt = $db->query('SELECT * FROM test'); -var_dump(get_class($stmt)); -var_dump(get_class($stmt->dbh)); - -echo "===FOREACH===\n"; - -foreach($stmt as $obj) { - var_dump($obj); -} - -echo "===DONE===\n"; -exit(0); -?> ---EXPECTF-- -string(11) "PDODatabase" -string(12) "PDOStatement" -===QUERY=== -array(1) { - [0]=> - string(12) "PDOStatement" -} -array(2) { - [0]=> - string(13) "PDOStatementX" - [1]=> - array(1) { - [0]=> - object(PDODatabase)#%d (0) { - } - } -} -PDODatabase::query() -PDOStatementX::__construct() -string(13) "PDOStatementX" -string(11) "PDODatabase" -===FOREACH=== -array(3) { - ["id"]=> - string(2) "10" - ["val"]=> - string(3) "Abc" - ["val2"]=> - string(3) "zxy" -} -array(3) { - ["id"]=> - string(2) "20" - ["val"]=> - string(3) "Def" - ["val2"]=> - string(3) "wvu" -} -array(3) { - ["id"]=> - string(2) "30" - ["val"]=> - string(3) "Ghi" - ["val2"]=> - string(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() ---UEXPECTF-- -unicode(11) "PDODatabase" -unicode(12) "PDOStatement" -===QUERY=== -array(1) { - [0]=> - unicode(12) "PDOStatement" -} -array(2) { - [0]=> - unicode(13) "PDOStatementX" - [1]=> - array(1) { - [0]=> - object(PDODatabase)#%d (0) { - } - } -} -PDODatabase::query() -PDOStatementX::__construct() -unicode(13) "PDOStatementX" -unicode(11) "PDODatabase" -===FOREACH=== -array(3) { - [u"id"]=> - unicode(2) "10" - [u"val"]=> - unicode(3) "Abc" - [u"val2"]=> - unicode(3) "zxy" -} -array(3) { - [u"id"]=> - unicode(2) "20" - [u"val"]=> - unicode(3) "Def" - [u"val2"]=> - unicode(3) "wvu" -} -array(3) { - [u"id"]=> - unicode(2) "30" - [u"val"]=> - unicode(3) "Ghi" - [u"val2"]=> - unicode(3) "tsr" -} -===DONE=== -PDODatabase::__destruct() -PDOStatementX::__destruct() diff --git a/ext/pdo/tests/pdo_031.phpt b/ext/pdo/tests/pdo_031.phpt deleted file mode 100755 index 30a75d79b417f..0000000000000 --- a/ext/pdo/tests/pdo_031.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -PDO Common: PDOStatement SPL iterator ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -if (!extension_loaded('SPL')) print 'skip SPL not available'; -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -if (!class_exists('RecursiveArrayIterator', false)) die('skip Class RecursiveArrayIterator missing'); -if (!class_exists('RecursiveTreeIterator', false) && !file_exists(getenv('REDIR_TEST_DIR').'../../spl/examples/recursivetreeiterator.inc')) die('skip Class RecursiveTreeIterator missing'); -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -if (!class_exists('RecursiveTreeIterator', false)) require_once(getenv('REDIR_TEST_DIR').'../../spl/examples/recursivetreeiterator.inc'); - -$data = array( - array('10', 'Abc', 'zxy'), - array('20', 'Def', 'wvu'), - array('30', 'Ghi', 'tsr'), -); - -$db = PDOTest::factory(); - -$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); - -$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); -foreach ($data as $row) { - $stmt->execute($row); -} - -unset($stmt); - -echo "===QUERY===\n"; - -$stmt = $db->query('SELECT * FROM test'); - -foreach(new RecursiveTreeIterator(new RecursiveArrayIterator($stmt->fetchAll(PDO::FETCH_ASSOC)), RecursiveTreeIterator::BYPASS_KEY) as $c=>$v) -{ - echo "$v [$c]\n"; -} - -echo "===DONE===\n"; -exit(0); -?> ---EXPECT-- -===QUERY=== -|-Array [0] -| |-10 [id] -| |-Abc [val] -| \-zxy [val2] -|-Array [1] -| |-20 [id] -| |-Def [val] -| \-wvu [val2] -\-Array [2] - |-30 [id] - |-Ghi [val] - \-tsr [val2] -===DONE=== diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc deleted file mode 100644 index 94fa9fbbfaa51..0000000000000 --- a/ext/pdo/tests/pdo_test.inc +++ /dev/null @@ -1,84 +0,0 @@ -<?php -# PDO test framework utilities - -if (getenv('PDOTEST_DSN') === false) { - $common = ''; - $append = false; - foreach(file(dirname($_SERVER['PHP_SELF']).'/common.phpt') as $line) { - if ($append) { - $common .= $line; - } elseif (trim($line) == '--REDIRECTTEST--') { - $append = true; - } - } - if (ini_get('magic_quotes_runtime')) $common = stripslashes($common); - $conf = eval($common); - foreach($conf['ENV'] as $n=>$v) putenv("$n=$v"); -} - -class PDOTest { - // create an instance of the PDO driver, based on - // the current environment - static function factory($classname = 'PDO') { - $dsn = getenv('PDOTEST_DSN'); - $user = getenv('PDOTEST_USER'); - $pass = getenv('PDOTEST_PASS'); - $attr = getenv('PDOTEST_ATTR'); - if (is_string($attr) && strlen($attr)) { - $attr = unserialize($attr); - } else { - $attr = null; - } - - if ($user === false) $user = NULL; - if ($pass === false) $pass = NULL; - - $db = new $classname($dsn, $user, $pass, $attr); - - // clean up any crufty test tables we might have left behind - // on a previous run - static $test_tables = array( - 'test', - 'classtypes' - ); - foreach ($test_tables as $table) { - $db->exec("DROP TABLE $table"); - } - - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); - $db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); - $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); - return $db; - } - - static function skip() { - try { - $db = PDOTest::factory(); - } catch (PDOException $e) { - die("skip " . $e->getMessage()); - } - } - - static function detect_transactional_mysql_engine($db) { - foreach ($db->query('show engines') as $row) { - if ($row[1] == 'YES' && ($row[0] == 'INNOBASE' || $row[0] == 'BDB')) { - return $row[0]; - } - } - return false; - } - - static function test_factory($file) { - $data = file_get_contents($file); - $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data); - $config = eval($data); - foreach ($config['ENV'] as $k => $v) { - putenv("$k=$v"); - } - return self::factory(); - } -} - - - -?> diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt deleted file mode 100644 index 30e54f00bc483..0000000000000 --- a/ext/pdo/tests/pecl_bug_5217.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -PDO Common: PECL Bug #5217: serialize/unserialze safety ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); -$dir = getenv('REDIR_TEST_DIR'); -if (false == $dir) die('skip no driver'); -require_once $dir . 'pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); -require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; -$db = PDOTest::factory(); -try { - $ser = serialize($db); - debug_zval_dump($ser); - $db = unserialize($ser); - $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); -} catch (Exception $e) { - echo "Safely caught " . $e->getMessage() . "\n"; -} - -echo "PHP Didn't crash!\n"; -?> ---EXPECT-- -Safely caught You cannot serialize or unserialize PDO instances -PHP Didn't crash! diff --git a/ext/pdo_dblib/CREDITS b/ext/pdo_dblib/CREDITS deleted file mode 100644 index 91a8057be39c8..0000000000000 --- a/ext/pdo_dblib/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DB-LIB (MS SQL, Sybase) -Wez Furlong, Frank M. Kromann diff --git a/ext/pdo_dblib/README b/ext/pdo_dblib/README deleted file mode 100644 index 888ffb676f15d..0000000000000 --- a/ext/pdo_dblib/README +++ /dev/null @@ -1,25 +0,0 @@ -This is the unified Sybase-DB style driver for PDO. -There are three implementations of this library that are known to me: - -- The Sybase DB lib itself -- MSSQL DB lib -- FreeTDS DB lib - -This extension will compile and register itself as 'mssql' when built against -the mssql libraries (and be named php_pdo_mssql.dll), or 'sybase' otherwise -(php_pdo_sybase.dll) - -If you want to try out the free "desktop" version of SQL Server, known as the MSDE, google to obtain the appropriate download link. Here are some short tips on getting it running: - -- Download it and run it to extract it -- Open up a command prompt -- cd \MSDERelA -- setup.exe SQLSECURITY=1 SAPWD=yoursecretpassword -- cd \Program Files\Microsoft SQL Server\80\Tools\Binn -- SVRNETCN.exe -- enable TCP (you MUST do this if you want to access it via FreeTDS/Sybase libs) -- net start mssqlserver - -Consult the MS docs for more information about all this stuff. - - diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4 deleted file mode 100644 index ff4e03be4bb49..0000000000000 --- a/ext/pdo_dblib/config.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl -dnl $Id$ -dnl - -if test "$PHP_PDO" != "no"; then -PHP_ARG_WITH(pdo-dblib, for PDO_DBLIB support via FreeTDS, -[ --with-pdo-dblib[=DIR] Include PDO_DBLIB-DB support. DIR is the FreeTDS home - directory]) - - -if test "$PHP_PDO_DBLIB" != "no"; then - - PDO_FREETDS_INSTALLATION_DIR="" - if test "$PHP_PDO_DBLIB" = "yes"; then - - for i in /usr/local /usr; do - if test -f $i/include/tds.h; then - PDO_FREETDS_INSTALLATION_DIR=$i - break - fi - done - - if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then - AC_MSG_ERROR(Cannot find FreeTDS in known installation directories) - fi - - elif test "$PHP_PDO_DBLIB" != "no"; then - - if test -f $PHP_PDO_DBLIB/include/tds.h; then - PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB - else - AC_MSG_ERROR(Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory) - fi - fi - - if test "x$PHP_LIBDIR" = "x" ; then - PHP_LIBDIR=lib - fi - - if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then - AC_MSG_ERROR(Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so]) - fi - - PDO_DBLIB_INCDIR=$PDO_FREETDS_INSTALLATION_DIR/include - PDO_DBLIB_LIBDIR=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR - - PHP_ADD_INCLUDE($PDO_DBLIB_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_DBLIB_LIBDIR, PDO_DBLIB_SHARED_LIBADD) - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" - PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_DBLIB_DEFS) - AC_CHECK_LIB(dnet_stub, dnet_addr, - [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) - ]) - AC_DEFINE(HAVE_PDO_DBLIB,1,[ ]) - AC_DEFINE(HAVE_FREETDS,1,[ ]) - PHP_SUBST(PDO_DBLIB_SHARED_LIBADD) - - ifdef([PHP_ADD_EXTENSION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_dblib, pdo) - ]) -fi - -fi diff --git a/ext/pdo_dblib/config.w32 b/ext/pdo_dblib/config.w32 deleted file mode 100755 index 1d0a83a207dc7..0000000000000 --- a/ext/pdo_dblib/config.w32 +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-dblib", "freetds dblib (Sybase, MS-SQL) support for PDO", "no"); - -if (PHP_PDO_DBLIB != "no") { - /* if they pointed us to a freetds dir, pick that up, - * otherwise we'll poke around and look for MSSQL libs */ - - if (CHECK_LIB("sybdb.lib", "pdo_dblib", PHP_PDO_DBLIB) && - CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_DBLIB", - PHP_PDO_DBLIB, null, null, true)) - { - EXTENSION("pdo_dblib", "pdo_dblib.c dblib_driver.c dblib_stmt.c"); - ADD_FLAG('CFLAGS_PDO_DBLIB', "/I pecl /I ..\\pecl /D PDO_DBLIB_FLAVOUR=\\\"freetds\\\""); - } - ADD_EXTENSION_DEP('pdo_dblib', 'pdo'); -} - -ARG_WITH("pdo-mssql", "Native MS-SQL support for PDO", "no"); - -if (PHP_PDO_MSSQL != "no") { - /* if they pointed us to a freetds dir, pick that up, - * otherwise we'll poke around and look for MSSQL libs */ - - pdo_mssql_locations = new Array( - PHP_PDO_MSSQL, - "\\Program Files\\Microsoft SQL Server\\80", - "\\MSSQL8", - "\\MSSQL7", - PHP_PHP_BUILD + "\\MSSQL80" - ); - PDO_DBLIB_FLAVOUR = 0; - - if (CHECK_LIB("sybdb.lib", "pdo_mssql", PHP_PDO_MSSQL) && - CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_MSSQL", - PHP_PDO_MSSQL, null, null, true)) { - /* smells like FreeTDS (or maybe native sybase dblib) */ - PDO_DBLIB_FLAVOUR = "freetds"; - } else { - - for (i = 0; i < pdo_mssql_locations.length; i++) { - if (CHECK_LIB("ntwdblib.lib", "pdo_mssql", - pdo_mssql_locations[i] + "\\DevTools\\Lib") && - CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_PDO_MSSQL", - pdo_mssql_locations[i] + "\\DevTools\\Include", - null, null, true)) { - if (pdo_mssql_locations[i] == 'yes') { - PDO_DBLIB_FLAVOUR = 70; - } else { - pdo_mssql_locations[i].match(new RegExp("(\\d)")); - PDO_DBLIB_FLAVOUR = RegExp.$1 + 0; - } - break; - } - } - } - - if (PDO_DBLIB_FLAVOUR != 0) { - EXTENSION("pdo_mssql", "pdo_dblib.c dblib_driver.c dblib_stmt.c", null, null, null, "ext\\pdo_mssql"); - if (PDO_DBLIB_FLAVOUR != "freetds") { - ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPHP_DBLIB_IS_MSSQL=1 /DDBNTWIN32=1 /DMSSQL" + PDO_DBLIB_FLAVOUR + "0=1 /DMSSQL_VERSION=\\\"" + PDO_DBLIB_FLAVOUR + ".0\\\""); - ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPDO_DBLIB_IS_MSSQL=" + PDO_DBLIB_FLAVOUR); - PDO_DBLIB_FLAVOUR = "MSSQL_" + PDO_DBLIB_FLAVOUR; - } - ADD_FLAG('CFLAGS_PDO_MSSQL', "/I pecl /I ..\\pecl /D PDO_DBLIB_FLAVOUR=\\\"" + PDO_DBLIB_FLAVOUR + "\\\""); - } - ADD_EXTENSION_DEP('pdo_mssql', 'pdo'); -} diff --git a/ext/pdo_dblib/db.php b/ext/pdo_dblib/db.php deleted file mode 100644 index f9bac04d2993c..0000000000000 --- a/ext/pdo_dblib/db.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* assumes that you have the freetds db.lib on windows */ - -dl('php_pdo.dll'); -dl('php_pdo_sybase.dll'); - -try { - -$db = new PDO('sybase:', 'pdo', 'pdo'); -$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION); -debug_zval_dump($db); - -$stmt = $db->prepare('select 10'); -debug_zval_dump($stmt); - -$x = $stmt->execute(); -debug_zval_dump($x); - -while (($r = $stmt->fetch())) { - print_r($r); -} - -} catch (Exception $e) { - print $e; -} - -$stmt = null; -$db = null; -echo "All done\n"; -?> diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c deleted file mode 100644 index 996b0034c8978..0000000000000 --- a/ext/pdo_dblib/dblib_driver.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_dblib.h" -#include "php_pdo_dblib_int.h" -#include "zend_exceptions.h" - -static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) -{ - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - pdo_dblib_err *einfo = &H->err; - pdo_dblib_stmt *S = NULL; - char *message; - char *msg; - - if (stmt) { - S = (pdo_dblib_stmt*)stmt->driver_data; - einfo = &S->err; - } - - if (einfo->dberr == SYBESMSG && einfo->lastmsg) { - msg = einfo->lastmsg; - } else if (einfo->dberr == SYBESMSG && DBLIB_G(err).lastmsg) { - msg = DBLIB_G(err).lastmsg; - DBLIB_G(err).lastmsg = NULL; - } else { - msg = einfo->dberrstr; - } - - spprintf(&message, 0, "%s [%d] (severity %d) [%s]", - msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : ""); - - add_next_index_long(info, einfo->dberr); - add_next_index_string(info, message, 0); - add_next_index_long(info, einfo->oserr); - add_next_index_long(info, einfo->severity); - if (einfo->oserrstr) { - add_next_index_string(info, einfo->oserrstr, 1); - } - - return 1; -} - - -static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - - if (H) { - if (H->link) { - dbclose(H->link); - H->link = NULL; - } - if (H->login) { - dbfreelogin(H->login); - H->login = NULL; - } - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - } - return 0; -} - -static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - pdo_dblib_stmt *S = ecalloc(1, sizeof(*S)); - - S->H = H; - stmt->driver_data = S; - stmt->methods = &dblib_stmt_methods; - stmt->supports_placeholders = PDO_PLACEHOLDER_NONE; - S->err.sqlstate = stmt->error_code; - - return 1; -} - -static long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - RETCODE ret, resret; - - dbsetuserdata(H->link, (BYTE*)&H->err); - - if (FAIL == dbcmd(H->link, sql)) { - return -1; - } - - if (FAIL == dbsqlexec(H->link)) { - return -1; - } - - resret = dbresults(H->link); - - if (resret == FAIL) { - return -1; - } - - ret = dbnextrow(H->link); - if (ret == FAIL) { - return -1; - } - - if (dbnumcols(H->link) <= 0) { - return DBCOUNT(H->link); - } - - /* throw away any rows it might have returned */ - dbcanquery(H->link); - - return DBCOUNT(H->link); -} - -static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - char *q; - int l = 1; - - *quoted = q = emalloc(2 * unquotedlen + 3); - *q++ = '\''; - - while (unquotedlen--) { - if (*unquoted == '\'') { - *q++ = '\''; - *q++ = '\''; - l += 2; - } else { - *q++ = *unquoted; - ++l; - } - unquoted++; - } - - *q++ = '\''; - *q++ = '\0'; - *quotedlen = l+1; - - return 1; -} - -static struct pdo_dbh_methods dblib_methods = { - dblib_handle_closer, - dblib_handle_preparer, - dblib_handle_doer, - dblib_handle_quoter, - NULL, - NULL, - NULL, - NULL, - NULL, /* last insert */ - dblib_fetch_error, /* fetch error */ - NULL, /* get attr */ - NULL, /* check liveness */ -}; - -static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) -{ - pdo_dblib_db_handle *H; - int i, ret = 0; - struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 }, - { "host", "127.0.0.1", 0 }, - { "dbname", NULL, 0 }, - { "secure", NULL, 0 }, /* DBSETLSECURE */ - /* TODO: DBSETLVERSION ? */ - }; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5); - - H = pecalloc(1, sizeof(*H), dbh->is_persistent); - H->login = dblogin(); - H->err.sqlstate = dbh->error_code; - - if (!H->login) { - goto cleanup; - } - - if (dbh->username) { - DBSETLUSER(H->login, dbh->username); - } - if (dbh->password) { - DBSETLPWD(H->login, dbh->password); - } - -#if !PHP_DBLIB_IS_MSSQL - if (vars[0].optval) { - DBSETLCHARSET(H->login, vars[0].optval); - } -#endif - - DBSETLAPP(H->login, vars[1].optval); - -#if PHP_DBLIB_IS_MSSQL - dbprocerrhandle(H->login, (EHANDLEFUNC) error_handler); - dbprocmsghandle(H->login, (MHANDLEFUNC) msg_handler); -#endif - - H->link = dbopen(H->login, vars[2].optval); - - if (H->link == NULL) { - goto cleanup; - } - - if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) { - goto cleanup; - } - - ret = 1; - dbh->max_escaped_char_length = 2; - dbh->alloc_own_columns = 1; - -cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - dbh->methods = &dblib_methods; - dbh->driver_data = H; - - if (!ret) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, - "SQLSTATE[%s] %s (severity %d)", - DBLIB_G(err).sqlstate, - DBLIB_G(err).dberrstr, - DBLIB_G(err).severity); - } - - return ret; -} - -pdo_driver_t pdo_dblib_driver = { -#if PDO_DBLIB_IS_MSSQL - PDO_DRIVER_HEADER(mssql), -#elif defined(PHP_WIN32) - PDO_DRIVER_HEADER(sybase), -#else - PDO_DRIVER_HEADER(dblib), -#endif - pdo_dblib_handle_factory -}; - diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c deleted file mode 100644 index f965b5dd592ef..0000000000000 --- a/ext/pdo_dblib/dblib_stmt.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_dblib.h" -#include "php_pdo_dblib_int.h" -#include "zend_exceptions.h" - -static void free_rows(pdo_dblib_stmt *S TSRMLS_DC) -{ - int i, j; - - for (i = 0; i < S->nrows; i++) { - for (j = 0; j < S->ncols; j++) { - pdo_dblib_colval *val = &S->rows[i] + j; - if (val->data) { - efree(val->data); - val->data = NULL; - } - } - } - efree(S->rows); - S->rows = NULL; - S->nrows = 0; -} - -static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - - if (S->rows) { - free_rows(S TSRMLS_CC); - } - if (S->cols) { - efree(S->cols); - } - efree(S); - - return 1; -} - -static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_dbh_t *dbh = stmt->dbh; - pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - pdo_dblib_db_handle *H = S->H; - RETCODE resret, ret; - int i, j; - int arows; - unsigned int size; - - dbsetuserdata(H->link, &S->err); - - if (S->rows) { - /* clean them up */ - free_rows(S TSRMLS_CC); - } - - if (FAIL == dbcmd(H->link, stmt->active_query_string)) { - return 0; - } - if (FAIL == dbsqlexec(H->link)) { - return 0; - } - - resret = dbresults(H->link); - if (resret == FAIL) { - return 0; - } - - ret = dbnextrow(H->link); - - stmt->row_count = DBCOUNT(H->link); - - if (ret == NO_MORE_ROWS) { - return 1; - } - - if (!S->cols) { - S->ncols = dbnumcols(H->link); - - if (S->ncols <= 0) { - return 1; - } - - S->cols = ecalloc(S->ncols, sizeof(pdo_dblib_col)); - stmt->column_count = S->ncols; - - for (i = 0, j = 0; i < S->ncols; i++) { - S->cols[i].coltype = dbcoltype(H->link, i+1); - S->cols[i].name = dbcolname(H->link, i+1); - if (S->cols[i].name) { - S->cols[i].name = estrdup(S->cols[i].name); - } else if (j) { - spprintf(&S->cols[i].name, 0, "computed%d", j++); - } else { - S->cols[i].name = estrdup("computed"); - j++; - } - S->cols[i].source = dbcolsource(H->link, i+1); - S->cols[i].source = estrdup(S->cols[i].source ? S->cols[i].source : ""); - S->cols[i].maxlen = dbcollen(H->link, i+1); - } - } - - arows = 100; - size = S->ncols * sizeof(pdo_dblib_colval); - S->rows = emalloc(arows * size); - - /* let's fetch all the data */ - do { - if (S->nrows >= arows) { - arows *= 2; - S->rows = erealloc(S->rows, arows * size); - } - for (i = 0; i < S->ncols; i++) { - pdo_dblib_colval *val = &S->rows[S->nrows * S->ncols + i]; - - if (dbdatlen(H->link, i+1) == 0 && dbdata(H->link, i+1) == NULL) { - val->len = 0; - val->data = NULL; - } else { - switch (S->cols[i].coltype) { - case SQLCHAR: - case SQLTEXT: - case SQLVARBINARY: - case SQLBINARY: - case SQLIMAGE: - val->len = dbdatlen(H->link, i+1); - val->data = emalloc(val->len + 1); - memcpy(val->data, dbdata(H->link, i+1), val->len); - val->data[val->len] = '\0'; - break; - - default: - if (dbwillconvert(S->cols[i].coltype, SQLCHAR)) { - val->len = 32 + (2 * dbdatlen(H->link, i+1)); - val->data = emalloc(val->len); - - val->len = dbconvert(NULL, S->cols[i].coltype, dbdata(H->link, i+1), - dbdatlen(H->link, i+1), SQLCHAR, val->data, val->len); - - if (val->len >= 0) { - val->data[val->len] = '\0'; - } - } else { - val->len = 0; - val->data = NULL; - } - } - } - } - - S->nrows++; - - ret = dbnextrow(H->link); - - if (ret == BUF_FULL) { - dbclrbuf(H->link, DBLASTROW(H->link)-1); - } - } while (ret != FAIL && ret != NO_MORE_ROWS); - - if (resret != NO_MORE_RESULTS) { - /* there are additional result sets available */ - dbresults(H->link); - /* cancel pending rows */ - dbcanquery(H->link); - - /* TODO: figure out a sane solution */ - } - - S->current = -1; - - return 1; -} - -static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - - if (!S->rows) { - return 0; - } - - if (++S->current < S->nrows) { - return 1; - } - - return 0; -} - -static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - struct pdo_column_data *col = &stmt->columns[colno]; - - if (!S->rows) { - return 0; - } - - col->maxlen = S->cols[colno].maxlen; - col->namelen = strlen(S->cols[colno].name); - col->name = estrdup(S->cols[colno].name); - col->param_type = PDO_PARAM_STR; - - return 1; -} - -static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, - unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - pdo_dblib_colval *val = &S->rows[S->current * S->ncols + colno]; - - *ptr = val->data; - *len = val->len; - return 1; -} - -static int pdo_dblib_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ - return 1; -} - - -struct pdo_stmt_methods dblib_stmt_methods = { - pdo_dblib_stmt_dtor, - pdo_dblib_stmt_execute, - pdo_dblib_stmt_fetch, - pdo_dblib_stmt_describe, - pdo_dblib_stmt_get_col, - pdo_dblib_stmt_param_hook, - NULL, /* set attr */ - NULL, /* get attr */ - NULL, /* meta */ -}; - diff --git a/ext/pdo_dblib/package.xml b/ext/pdo_dblib/package.xml deleted file mode 100644 index 4701b2309195d..0000000000000 --- a/ext/pdo_dblib/package.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_DBLIB</name> - <summary>FreeTDS/Sybase/MSSQL driver for PDO</summary> - <maintainers> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>fmk</user> - <name>Frank M. Kromann</name> - <email>fmk@php.net</email> - <role>lead</role> - </maintainer> - - </maintainers> - <description> - This extension provides a FreeTDS/Sybase driver for PDO. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - First ever PECL release. - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="pdo_dblib.c"/> - <file role="src" name="dblib_driver.c"/> - <file role="src" name="dblib_stmt.c"/> - <file role="src" name="php_pdo_dblib.h"/> - <file role="src" name="php_pdo_dblib_int.h"/> - - <file role="doc" name="CREDITS"/> - <file role="doc" name="README"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" name="pdo" rel="ge" version="0.9"/> - </deps> - </release> -</package> diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c deleted file mode 100644 index be11d9ff4a9a8..0000000000000 --- a/ext/pdo_dblib/pdo_dblib.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_dblib.h" -#include "php_pdo_dblib_int.h" -#include "zend_exceptions.h" - -ZEND_DECLARE_MODULE_GLOBALS(dblib) - -function_entry pdo_dblib_functions[] = { - {NULL, NULL, NULL} -}; - -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_dblib_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif - -zend_module_entry pdo_dblib_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_dblib_deps, -#else - STANDARD_MODULE_HEADER, -#endif -#if PDO_DBLIB_IS_MSSQL - "pdo_mssql", -#elif defined(PHP_WIN32) - "pdo_sybase", -#else - "pdo_dblib", -#endif - pdo_dblib_functions, - PHP_MINIT(pdo_dblib), - PHP_MSHUTDOWN(pdo_dblib), - NULL, - PHP_RSHUTDOWN(pdo_dblib), - PHP_MINFO(pdo_dblib), - "0.9", - STANDARD_MODULE_PROPERTIES -}; - -#if defined(COMPILE_DL_PDO_DBLIB) || defined(COMPILE_DL_PDO_MSSQL) -ZEND_GET_MODULE(pdo_dblib) -#endif - -int error_handler(DBPROCESS *dbproc, int severity, int dberr, - int oserr, char *dberrstr, char *oserrstr) -{ - pdo_dblib_err *einfo; - char *state = "HY000"; - TSRMLS_FETCH(); - - einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); - if (!einfo) einfo = &DBLIB_G(err); - - einfo->severity = severity; - einfo->oserr = oserr; - einfo->dberr = dberr; - if (einfo->oserrstr) { - efree(einfo->oserrstr); - } - if (einfo->dberrstr) { - efree(einfo->dberrstr); - } - if (oserrstr) { - einfo->oserrstr = estrdup(oserrstr); - } else { - einfo->oserrstr = NULL; - } - if (dberrstr) { - einfo->dberrstr = estrdup(dberrstr); - } else { - einfo->dberrstr = NULL; - } - - switch (dberr) { - case SYBESEOF: - case SYBEFCON: state = "01002"; break; - case SYBEMEM: state = "HY001"; break; - case SYBEPWD: state = "28000"; break; - } - strcpy(einfo->sqlstate, state); - -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "dblib error: %d %s (severity %d)", - dberr, dberrstr, severity); -#endif - - return INT_CANCEL; -} - -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, - int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line) -{ - pdo_dblib_err *einfo; - TSRMLS_FETCH(); - - if (severity) { - einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); - if (!einfo) { - einfo = &DBLIB_G(err); - } - - if (einfo->lastmsg) { - efree(einfo->lastmsg); - } - - einfo->lastmsg = estrdup(msgtext); - } - -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity); -#endif - - return 0; -} - -static int init_dblib_globals(zend_dblib_globals *g) -{ - memset(g, 0, sizeof(*g)); - g->err.sqlstate = g->sqlstate; - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(pdo_dblib) -{ - if (DBLIB_G(err).oserrstr) { - efree(DBLIB_G(err).oserrstr); - DBLIB_G(err).oserrstr = NULL; - } - if (DBLIB_G(err).dberrstr) { - efree(DBLIB_G(err).dberrstr); - DBLIB_G(err).dberrstr = NULL; - } - if (DBLIB_G(err).lastmsg) { - efree(DBLIB_G(err).lastmsg); - DBLIB_G(err).lastmsg = NULL; - } - return SUCCESS; -} - -PHP_MINIT_FUNCTION(pdo_dblib) -{ - if (FAIL == dbinit()) { - return FAILURE; - } - - if (FAILURE == php_pdo_register_driver(&pdo_dblib_driver)) { - return FAILURE; - } - - ZEND_INIT_MODULE_GLOBALS(dblib, init_dblib_globals, NULL); - - /* TODO: - - dbsetifile() - dbsetmaxprocs() - dbsetlogintime() - dbsettime() - - */ - -#if !PHP_DBLIB_IS_MSSQL - dberrhandle(error_handler); - dbmsghandle(msg_handler); -#endif - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(pdo_dblib) -{ - php_pdo_unregister_driver(&pdo_dblib_driver); - dbexit(); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(pdo_dblib) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for " -#if PDO_DBLIB_IS_MSSQL - "MSSQL" -#elif defined(PHP_WIN32) - "FreeTDS/Sybase/MSSQL" -#else - "FreeTDS/Sybase" -#endif - " DB-lib", "enabled"); - php_info_print_table_row(2, "Flavour", PDO_DBLIB_FLAVOUR); - php_info_print_table_end(); -} - diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h deleted file mode 100644 index d05ae24bc2dae..0000000000000 --- a/ext/pdo_dblib/php_pdo_dblib.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_DBLIB_H -#define PHP_PDO_DBLIB_H - - -extern zend_module_entry pdo_dblib_module_entry; -#define phpext_pdo_dblib_ptr &pdo_dblib_module_entry - -#ifdef PHP_WIN32 -# define PHP_PDO_DBLIB_API __declspec(dllexport) -#else -# define PHP_PDO_DBLIB_API -#endif - -#ifdef ZTS -# include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_dblib); -PHP_MSHUTDOWN_FUNCTION(pdo_dblib); -PHP_MINFO_FUNCTION(pdo_dblib); -PHP_RSHUTDOWN_FUNCTION(pdo_dblib); - -#endif - diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h deleted file mode 100644 index ec34c521f724b..0000000000000 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - | Frank M. Kromann <frank@kromann.info> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_DBLIB_INT_H -#define PHP_PDO_DBLIB_INT_H - -#ifndef PDO_DBLIB_FLAVOUR -# define PDO_DBLIB_FLAVOUR "Generic DB-lib" -#endif - -#if PHP_DBLIB_IS_MSSQL -# include <sqlfront.h> -# include <sqldb.h> - -# define DBERRHANDLE(a, b) dbprocerrhandle(a, b) -# define DBMSGHANDLE(a, b) dbprocmsghandle(a, b) -# define EHANDLEFUNC DBERRHANDLE_PROC -# define MHANDLEFUNC DBMSGHANDLE_PROC -# define DBSETOPT(a, b, c) dbsetopt(a, b, c) -# define SYBESMSG SQLESMSG -# define SYBESEOF SQLESEOF -# define SYBEFCON SQLECONN // SQLEFCON does not exist in MS SQL Server. -# define SYBEMEM SQLEMEM -# define SYBEPWD SQLEPWD - -#else -# include <sybfront.h> -# include <sybdb.h> -# include <syberror.h> - -/* alias some types */ -# define SQLTEXT SYBTEXT -# define SQLCHAR SYBCHAR -# define SQLVARCHAR SYBVARCHAR -# define SQLINT1 SYBINT1 -# define SQLINT2 SYBINT2 -# define SQLINT4 SYBINT4 -# define SQLINTN SYBINTN -# define SQLBIT SYBBIT -# define SQLFLT4 SYBREAL -# define SQLFLT8 SYBFLT8 -# define SQLFLTN SYBFLTN -# define SQLDECIMAL SYBDECIMAL -# define SQLNUMERIC SYBNUMERIC -# define SQLDATETIME SYBDATETIME -# define SQLDATETIM4 SYBDATETIME4 -# define SQLDATETIMN SYBDATETIMN -# define SQLMONEY SYBMONEY -# define SQLMONEY4 SYBMONEY4 -# define SQLMONEYN SYBMONEYN -# define SQLIMAGE SYBIMAGE -# define SQLBINARY SYBBINARY -# define SQLVARBINARY SYBVARBINARY -# ifdef SYBUNIQUE -# define SQLUNIQUE SYBUNIQUE -# endif - -# define DBERRHANDLE(a, b) dberrhandle(b) -# define DBMSGHANDLE(a, b) dbmsghandle(b) -# define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1) -# define NO_MORE_RPC_RESULTS 3 -# define dbfreelogin dbloginfree -# define dbrpcexec dbrpcsend - -typedef short TDS_SHORT; -# ifndef PHP_WIN32 -typedef unsigned char *LPBYTE; -# endif -typedef float DBFLT4; -#endif - -int error_handler(DBPROCESS *dbproc, int severity, int dberr, - int oserr, char *dberrstr, char *oserrstr); - -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, - int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line); - -extern pdo_driver_t pdo_dblib_driver; -extern struct pdo_stmt_methods dblib_stmt_methods; - -typedef struct { - int severity; - int oserr; - int dberr; - char *oserrstr; - char *dberrstr; - char *sqlstate; - char *lastmsg; -} pdo_dblib_err; - -typedef struct { - LOGINREC *login; - DBPROCESS *link; - - pdo_dblib_err err; -} pdo_dblib_db_handle; - -typedef struct { - int coltype; - char *name; - int maxlen; - char *source; -} pdo_dblib_col; - -typedef struct { - unsigned long len; - char *data; -} pdo_dblib_colval; - -typedef struct { - pdo_dblib_db_handle *H; - - int ncols; - pdo_dblib_col *cols; - - pdo_dblib_colval *rows; - int nrows; - - int current; - - pdo_dblib_err err; -} pdo_dblib_stmt; - -ZEND_BEGIN_MODULE_GLOBALS(dblib) - pdo_dblib_err err; - char sqlstate[6]; -ZEND_END_MODULE_GLOBALS(dblib) - -#ifdef ZTS -# define DBLIB_G(v) TSRMG(dblib_globals_id, zend_dblib_globals *, v) -#else -# define DBLIB_G(v) (dblib_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(dblib); - -#endif - diff --git a/ext/pdo_dblib/tests/common.phpt b/ext/pdo_dblib/tests/common.phpt deleted file mode 100644 index 8cd1c40885723..0000000000000 --- a/ext/pdo_dblib/tests/common.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -DBLIB ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_dblib')) print 'skip'; ?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - - -if (false !== getenv('PDO_DBLIB_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_DBLIB_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_DBLIB_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_DBLIB_TEST_PASS'); - if (false !== getenv('PDO_DBLIB_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_DBLIB_TEST_ATTR'); - } -} -return $config; diff --git a/ext/pdo_firebird/CREDITS b/ext/pdo_firebird/CREDITS deleted file mode 100644 index a33294b69c0e6..0000000000000 --- a/ext/pdo_firebird/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Firebird/InterBase driver for PDO -Ard Biesheuvel diff --git a/ext/pdo_firebird/EXPERIMENTAL b/ext/pdo_firebird/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 deleted file mode 100644 index 90aa1a9e2150e..0000000000000 --- a/ext/pdo_firebird/config.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl -dnl $Id$ -dnl - -if test "$PHP_PDO" != "no"; then - -PHP_ARG_WITH(pdo-firebird,for Firebird support for PDO, -[ --with-pdo-firebird[=DIR] PDO: Firebird support. DIR is the Firebird base - install directory, defaults to /opt/firebird]) - -if test "$PHP_PDO_FIREBIRD" != "no"; then - if test "$PHP_PDO_FIREBIRD" = "yes"; then - FIREBIRD_INCDIR=/opt/firebird/include - FIREBIRD_LIBDIR=/opt/firebird/lib - else - FIREBIRD_INCDIR=$PHP_PDO_FIREBIRD/include - FIREBIRD_LIBDIR=$PHP_PDO_FIREBIRD/lib - fi - - PHP_CHECK_LIBRARY(fbclient, isc_detach_database, - [ - FIREBIRD_LIBNAME=fbclient - ], [ - PHP_CHECK_LIBRARY(gds, isc_detach_database, - [ - FIREBIRD_LIBNAME=gds - ], [ - PHP_CHECK_LIBRARY(ib_util, isc_detach_database, - [ - FIREBIRD_LIBNAME=ib_util - ], [ - AC_MSG_ERROR([libfbclient, libgds or libib_util not found! Check config.log for more information.]) - ], [ - -L$FIREBIRD_LIBDIR - ]) - ], [ - -L$FIREBIRD_LIBDIR - ]) - ], [ - -L$FIREBIRD_LIBDIR - ]) - - PHP_CHECK_PDO_INCLUDES - - PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD) - PHP_ADD_INCLUDE($FIREBIRD_INCDIR) - AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ]) - PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_inc_path) - PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD) - PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo) -fi - -fi diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32 deleted file mode 100644 index 30b87c2d1d63d..0000000000000 --- a/ext/pdo_firebird/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-firebird", "Firebird support for PDO", "no"); - -if (PHP_PDO_FIREBIRD != "no") { - - if ((CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD) - || CHECK_LIB("gds32_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD) - ) && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD", PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)) { - - EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c"); - ADD_FLAG('CFLAGS_PDO_FIREBIRD', "/I ..\\pecl"); - } else { - WARNING("pdo_firebird not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_firebird', 'pdo'); -} diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c deleted file mode 100644 index d040c2614ba33..0000000000000 --- a/ext/pdo_firebird/firebird_driver.c +++ /dev/null @@ -1,664 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel <abies@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define _GNU_SOURCE - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_firebird.h" -#include "php_pdo_firebird_int.h" - -static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, long, XSQLDA*, isc_stmt_handle*, - HashTable* TSRMLS_DC); - -/* map driver specific error message to PDO error */ -void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H - : (pdo_firebird_db_handle *)dbh->driver_data; - pdo_error_type *const error_code = stmt ? &stmt->error_code : &dbh->error_code; - -#if 0 - switch (isc_sqlcode(H->isc_status)) { - - case 0: - *error_code = PDO_ERR_NONE; - break; - default: - *error_code = PDO_ERR_CANT_MAP; - break; - case -104: - *error_code = PDO_ERR_SYNTAX; - break; - case -530: - case -803: - *error_code = PDO_ERR_CONSTRAINT; - break; - case -204: - case -205: - case -206: - case -829: - *error_code = PDO_ERR_NOT_FOUND; - break; - - *error_code = PDO_ERR_ALREADY_EXISTS; - break; - - *error_code = PDO_ERR_NOT_IMPLEMENTED; - break; - case -313: - case -804: - *error_code = PDO_ERR_MISMATCH; - break; - case -303: - case -314: - case -413: - *error_code = PDO_ERR_TRUNCATED; - break; - - *error_code = PDO_ERR_DISCONNECTED; - break; - } -#else - strcpy(*error_code, "HY000"); -#endif -} -/* }}} */ - -#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC) - -/* called by PDO to close a db handle */ -static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - - if (dbh->in_txn) { - if (dbh->auto_commit) { - if (isc_commit_transaction(H->isc_status, &H->tr)) { - RECORD_ERROR(dbh); - } - } else { - if (isc_rollback_transaction(H->isc_status, &H->tr)) { - RECORD_ERROR(dbh); - } - } - } - - if (isc_detach_database(H->isc_status, &H->db)) { - RECORD_ERROR(dbh); - } - - pefree(H, dbh->is_persistent); - - return 0; -} -/* }}} */ - -/* called by PDO to prepare an SQL query */ -static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, /* {{{ */ - pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - pdo_firebird_stmt *S = NULL; - HashTable *np; - - do { - isc_stmt_handle s = NULL; - XSQLDA num_sqlda; - static char const info[] = { isc_info_sql_stmt_type }; - char result[8]; - - num_sqlda.version = PDO_FB_SQLDA_VERSION; - num_sqlda.sqln = 1; - - ALLOC_HASHTABLE(np); - zend_hash_init(np, 8, NULL, NULL, 0); - - /* allocate and prepare statement */ - if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np TSRMLS_CC)) { - break; - } - - /* allocate a statement handle struct of the right size (struct out_sqlda is inlined) */ - S = ecalloc(1, sizeof(*S)-sizeof(XSQLDA) + XSQLDA_LENGTH(num_sqlda.sqld)); - S->H = H; - S->stmt = s; - S->fetch_buf = ecalloc(1,sizeof(char*) * num_sqlda.sqld); - S->out_sqlda.version = PDO_FB_SQLDA_VERSION; - S->out_sqlda.sqln = stmt->column_count = num_sqlda.sqld; - S->named_params = np; - - /* determine the statement type */ - if (isc_dsql_sql_info(H->isc_status, &s, sizeof(info), const_cast(info), sizeof(result), - result)) { - break; - } - S->statement_type = result[3]; - - /* fill the output sqlda with information about the prepared query */ - if (isc_dsql_describe(H->isc_status, &s, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) { - RECORD_ERROR(dbh); - break; - } - - /* allocate the input descriptors */ - if (isc_dsql_describe_bind(H->isc_status, &s, PDO_FB_SQLDA_VERSION, &num_sqlda)) { - break; - } - - if (num_sqlda.sqld) { - S->in_sqlda = ecalloc(1,XSQLDA_LENGTH(num_sqlda.sqld)); - S->in_sqlda->version = PDO_FB_SQLDA_VERSION; - S->in_sqlda->sqln = num_sqlda.sqld; - - if (isc_dsql_describe_bind(H->isc_status, &s, PDO_FB_SQLDA_VERSION, S->in_sqlda)) { - break; - } - } - - stmt->driver_data = S; - stmt->methods = &firebird_stmt_methods; - stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL; - - return 1; - - } while (0); - - RECORD_ERROR(dbh); - - zend_hash_destroy(np); - FREE_HASHTABLE(np); - - if (S) { - if (S->in_sqlda) { - efree(S->in_sqlda); - } - efree(S); - } - - return 0; -} -/* }}} */ - -/* called by PDO to execute a statement that doesn't produce a result set */ -static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - isc_stmt_handle stmt = NULL; - static char const info_count[] = { isc_info_sql_records }; - char result[64]; - int ret = 0; - XSQLDA in_sqlda, out_sqlda; - - /* TODO no placeholders in exec() for now */ - in_sqlda.version = out_sqlda.version = PDO_FB_SQLDA_VERSION; - in_sqlda.sqld = out_sqlda.sqld = 0; - - /* allocate and prepare statement */ - if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0 TSRMLS_CC)) { - return -1; - } - - /* execute the statement */ - if (isc_dsql_execute2(H->isc_status, &H->tr, &stmt, PDO_FB_SQLDA_VERSION, &in_sqlda, &out_sqlda)) { - RECORD_ERROR(dbh); - return -1; - } - - /* find out how many rows were affected */ - if (isc_dsql_sql_info(H->isc_status, &stmt, sizeof(info_count), const_cast(info_count), - sizeof(result), result)) { - RECORD_ERROR(dbh); - return -1; - } - - if (result[0] == isc_info_sql_records) { - unsigned i = 3, result_size = isc_vax_integer(&result[1],2); - - while (result[i] != isc_info_end && i < result_size) { - short len = (short)isc_vax_integer(&result[i+1],2); - if (result[i] != isc_info_req_select_count) { - ret += isc_vax_integer(&result[i+3],len); - } - i += len+3; - } - } - - /* commit if we're in auto_commit mode */ - if (dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) { - RECORD_ERROR(dbh); - } - - return ret; -} -/* }}} */ - -/* called by the PDO SQL parser to add quotes to values that are copied into SQL */ -static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, /* {{{ */ - char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - int qcount = 0; - char const *c; - - /* Firebird only requires single quotes to be doubled if string lengths are used */ - - /* count the number of ' characters */ - for (c = unquoted; (c = strchr(c,'\'')); qcount++, c++); - - if (!qcount) { - return 0; - } else { - char const *l, *r; - char *c; - - *quotedlen = unquotedlen + qcount; - *quoted = c = emalloc(*quotedlen+1); - - /* foreach (chunk that ends in a quote) */ - for (l = unquoted; (r = strchr(l,'\'')); l = r+1) { - - /* copy the chunk */ - strncpy(c, l, r-l); - c += (r-l); - - /* add the second quote */ - *c++ = '\''; - } - - /* copy the remainder */ - strncpy(c, l, *quotedlen-(c-*quoted)); - - return 1; - } -} -/* }}} */ - -/* called by PDO to start a transaction */ -static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - char tpb[8] = { isc_tpb_version3 }, *ptpb = tpb+1; -#if abies_0 - if (dbh->transaction_flags & PDO_TRANS_ISOLATION_LEVEL) { - if (dbh->transaction_flags & PDO_TRANS_READ_UNCOMMITTED) { - /* this is a poor fit, but it's all we have */ - *ptpb++ = isc_tpb_read_committed; - *ptpb++ = isc_tpb_rec_version; - dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_READ_UNCOMMITTED); - } else if (dbh->transaction_flags & PDO_TRANS_READ_COMMITTED) { - *ptpb++ = isc_tpb_read_committed; - *ptpb++ = isc_tpb_no_rec_version; - dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_READ_COMMITTED); - } else if (dbh->transaction_flags & PDO_TRANS_REPEATABLE_READ) { - *ptpb++ = isc_tpb_concurrency; - dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_REPEATABLE_READ); - } else { - *ptpb++ = isc_tpb_consistency; - dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_SERIALIZABLE); - } - } - - if (dbh->transaction_flags & PDO_TRANS_ACCESS_MODE) { - if (dbh->transaction_flags & PDO_TRANS_READONLY) { - *ptpb++ = isc_tpb_read; - dbh->transaction_flags &= ~(PDO_TRANS_ACCESS_MODE^PDO_TRANS_READONLY); - } else { - *ptpb++ = isc_tpb_write; - dbh->transaction_flags &= ~(PDO_TRANS_ACCESS_MODE^PDO_TRANS_READWRITE); - } - } - - if (dbh->transaction_flags & PDO_TRANS_CONFLICT_RESOLUTION) { - if (dbh->transaction_flags & PDO_TRANS_RETRY) { - *ptpb++ = isc_tpb_wait; - dbh->transaction_flags &= ~(PDO_TRANS_CONFLICT_RESOLUTION^PDO_TRANS_RETRY); - } else { - *ptpb++ = isc_tpb_nowait; - dbh->transaction_flags &= ~(PDO_TRANS_CONFLICT_RESOLUTION^PDO_TRANS_ABORT); - } - } -#endif - if (isc_start_transaction(H->isc_status, &H->tr, 1, &H->db, (unsigned short)(ptpb-tpb), tpb)) { - RECORD_ERROR(dbh); - return 0; - } - return 1; -} -/* }}} */ - -/* called by PDO to commit a transaction */ -static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - - if (isc_commit_transaction(H->isc_status, &H->tr)) { - RECORD_ERROR(dbh); - return 0; - } - return 1; -} -/* }}} */ - -/* called by PDO to rollback a transaction */ -static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - - if (isc_rollback_transaction(H->isc_status, &H->tr)) { - RECORD_ERROR(dbh); - return 0; - } - return 1; -} -/* }}} */ - -/* used by prepare and exec to allocate a statement handle and prepare the SQL */ -static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, long sql_len, /* {{{ */ - XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params TSRMLS_DC) -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - char *c, *new_sql, in_quote, in_param, pname[64], *ppname; - long l, pindex = -1; - - /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */ - if (sql_len > SHORT_MAX) { - strcpy(dbh->error_code, "01004"); - return 0; - } - - /* start a new transaction implicitly if auto_commit is enabled and no transaction is open */ - if (dbh->auto_commit && !dbh->in_txn) { - /* dbh->transaction_flags = PDO_TRANS_READ_UNCOMMITTED; */ - - if (!firebird_handle_begin(dbh TSRMLS_CC)) { - return 0; - } - dbh->in_txn = 1; - } - - /* allocate the statement */ - if (isc_dsql_allocate_statement(H->isc_status, &H->db, s)) { - RECORD_ERROR(dbh); - return 0; - } - - /* in order to support named params, which Firebird itself doesn't, - we need to replace :foo by ?, and store the name we just replaced */ - new_sql = c = emalloc(sql_len+1); - - for (l = in_quote = in_param = 0; l <= sql_len; ++l) { - if ( !(in_quote ^= (sql[l] == '\''))) { - if (!in_param) { - switch (sql[l]) { - case ':': - in_param = 1; - ppname = pname; - case '?': - *c++ = '?'; - ++pindex; - continue; - } - } else { - if ((in_param &= (sql[l] == '_') || (sql[l] >= 'A' && sql[l] <= 'Z') - || (sql[l] >= 'a' && sql[l] <= 'z') || (sql[l] >= '0' && sql[l] <= '9'))) { - *ppname++ = sql[l]; - continue; - } else { - *ppname++ = 0; - if (named_params) { - zend_hash_update(named_params, pname, (unsigned int)(ppname-pname), - (void*)&pindex, sizeof(long)+1,NULL); - } - } - } - } - *c++ = sql[l]; - } - - /* prepare the statement */ - if (isc_dsql_prepare(H->isc_status, &H->tr, s, 0, new_sql, PDO_FB_DIALECT, out_sqlda)) { - RECORD_ERROR(dbh); - efree(new_sql); - return 0; - } - - efree(new_sql); - return 1; -} -/* }}} */ - -/* called by PDO to set a driver-specific dbh attribute */ -static int firebird_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_AUTOCOMMIT: - - convert_to_boolean(val); - - /* ignore if the new value equals the old one */ - if (dbh->auto_commit ^ Z_BVAL_P(val)) { - if (dbh->in_txn) { - if (Z_BVAL_P(val)) { - /* turning on auto_commit with an open transaction is illegal, because - we won't know what to do with it */ - H->last_app_error = "Cannot enable auto-commit while a transaction is already open"; - return 0; - } else { - /* close the transaction */ - if (!firebird_handle_commit(dbh TSRMLS_CC)) { - break; - } - dbh->in_txn = 0; - } - } - dbh->auto_commit = Z_BVAL_P(val); - } - return 1; - } - return 0; -} -/* }}} */ - -/* callback to used to report database server info */ -static void firebird_info_cb(void *arg, char const *s) /* {{{ */ -{ - if (arg) { - if (*(char*)arg) { /* second call */ - strcat(arg, " "); - } - strcat(arg, s); - } -} -/* }}} */ - -/* called by PDO to get a driver-specific dbh attribute */ -static int firebird_handle_get_attribute(pdo_dbh_t const *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - - switch (attr) { - char tmp[200]; - - case PDO_ATTR_AUTOCOMMIT: - ZVAL_LONG(val,dbh->auto_commit); - return 1; - - case PDO_ATTR_CONNECTION_STATUS: - ZVAL_BOOL(val, !isc_version(&H->db, firebird_info_cb, NULL)); - return 1; - - case PDO_ATTR_CLIENT_VERSION: { -#if defined(__GNUC__) || defined(PHP_WIN32) - info_func_t info_func = NULL; -#ifdef __GNUC__ - info_func = (info_func_t)dlsym(RTLD_DEFAULT, "isc_get_client_version"); -#else - HMODULE l = GetModuleHandle("fbclient"); - - if (!l && !(l = GetModuleHandle("gds32"))) { - break; - } - info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version"); -#endif - if (info_func) { - info_func(tmp); - ZVAL_STRING(val,tmp,1); - } else { - ZVAL_STRING(val,"Firebird 1.0/Interbase 6",1); - } -#else - ZVAL_NULL(val); -#endif - } - return 1; - - case PDO_ATTR_SERVER_VERSION: - case PDO_ATTR_SERVER_INFO: - *tmp = 0; - - if (!isc_version(&H->db, firebird_info_cb, (void*)tmp)) { - ZVAL_STRING(val,tmp,1); - return 1; - } - } - return 0; -} -/* }}} */ - -/* called by PDO to retrieve driver-specific information about an error that has occurred */ -static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - ISC_STATUS *s = H->isc_status; - char buf[400]; - long i = 0, l, sqlcode = isc_sqlcode(s); - - if (sqlcode) { - add_next_index_long(info, sqlcode); - - while ((l = isc_interprete(&buf[i],&s))) { - i += l; - strcpy(&buf[i++], " "); - } - add_next_index_string(info, buf, 1); - } else { - add_next_index_long(info, -999); - add_next_index_string(info, const_cast(H->last_app_error),1); - } - return 1; -} -/* }}} */ - -static struct pdo_dbh_methods firebird_methods = { /* {{{ */ - firebird_handle_closer, - firebird_handle_preparer, - firebird_handle_doer, - firebird_handle_quoter, - firebird_handle_begin, - firebird_handle_commit, - firebird_handle_rollback, - firebird_handle_set_attribute, - NULL, /* last_id not supported */ - pdo_firebird_fetch_error_func, - firebird_handle_get_attribute, - NULL /* check_liveness */ -}; -/* }}} */ - -/* the driver-specific PDO handle constructor */ -static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - struct pdo_data_src_parser vars[] = { - { "dbname", NULL, 0 }, - { "charset", NULL, 0 }, - { "role", NULL, 0 } - }; - int i, ret = 0; - pdo_firebird_db_handle *H = dbh->driver_data = pecalloc(1,sizeof(*H),dbh->is_persistent); - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 3); - - do { - static char const dpb_flags[] = { - isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name }; - char const *dpb_values[] = { dbh->username, dbh->password, vars[1].optval, vars[2].optval }; - char dpb_buffer[256] = { isc_dpb_version1 }, *dpb; - - dpb = dpb_buffer + 1; - - /* loop through all the provided arguments and set dpb fields accordingly */ - for (i = 0; i < sizeof(dpb_flags); ++i) { - if (dpb_values[i]) { - dpb += sprintf(dpb, "%c%c%s", dpb_flags[i], (unsigned char)strlen(dpb_values[i]), - dpb_values[i]); - } - } - - /* fire it up baby! */ - if (isc_attach_database(H->isc_status, 0, vars[0].optval, &H->db,(short)(dpb-dpb_buffer), - dpb_buffer)) { - break; - } - - dbh->methods = &firebird_methods; - dbh->native_case = PDO_CASE_UPPER; - dbh->alloc_own_columns = 1; - - ret = 1; - - } while (0); - - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); ++i) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - if (!ret) { - firebird_handle_closer(dbh TSRMLS_CC); - } - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_firebird_driver = { /* {{{ */ - PDO_DRIVER_HEADER(firebird), - pdo_firebird_handle_factory -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c deleted file mode 100644 index 51ee730a0b904..0000000000000 --- a/ext/pdo_firebird/firebird_statement.c +++ /dev/null @@ -1,702 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel <abies@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_firebird.h" -#include "php_pdo_firebird_int.h" - -#include <time.h> - -#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC) - -/* free the allocated space for passing field values to the db and back */ -static void free_sqlda(XSQLDA const *sqlda) /* {{{ */ -{ - int i; - - for (i = 0; i < sqlda->sqld; ++i) { - XSQLVAR const *var = &sqlda->sqlvar[i]; - - if (var->sqlind) { - efree(var->sqlind); - } - } -} -/* }}} */ - -/* called by PDO to clean up a statement handle */ -static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - int result = 1, i; - - /* release the statement */ - if (isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_drop)) { - RECORD_ERROR(stmt); - result = 0; - } - - /* clean up the fetch buffers if they have been used */ - for (i = 0; i < S->out_sqlda.sqld; ++i) { - if (S->fetch_buf[i]) { - efree(S->fetch_buf[i]); - } - } - efree(S->fetch_buf); - - zend_hash_destroy(S->named_params); - FREE_HASHTABLE(S->named_params); - - /* clean up the input descriptor */ - if (S->in_sqlda) { - free_sqlda(S->in_sqlda); - efree(S->in_sqlda); - } - - free_sqlda(&S->out_sqlda); - efree(S); - - return result; -} -/* }}} */ - -/* called by PDO to execute a prepared query */ -static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - pdo_firebird_db_handle *H = S->H; - - do { - /* named cursors should be closed first */ - if (*S->name && isc_dsql_free_statement(H->isc_status, &S->stmt, DSQL_close)) { - break; - } - - /* assume all params have been bound */ - - if ((S->statement_type == isc_info_sql_stmt_exec_procedure && - isc_dsql_execute2(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, - S->in_sqlda, &S->out_sqlda)) - || isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, - S->in_sqlda)) { - break; - } - - /* commit? */ - if (stmt->dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) { - break; - } - - *S->name = 0; - S->exhausted = 0; - - return 1; - } while (0); - - RECORD_ERROR(stmt); - - return 0; -} -/* }}} */ - -/* called by PDO to fetch the next row from a statement */ -static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */ - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - pdo_firebird_db_handle *H = S->H; - - if (!stmt->executed) { - strcpy(stmt->error_code, "HY000"); - H->last_app_error = "Cannot fetch from a closed cursor"; - } else if (!S->exhausted) { - - /* an EXECUTE PROCEDURE statement can be fetched from once, without calling the API, because - * the result was returned in the execute call */ - if (S->statement_type == isc_info_sql_stmt_exec_procedure) { - S->exhausted = 1; - } else { - if (isc_dsql_fetch(H->isc_status, &S->stmt, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) { - if (H->isc_status[0] && H->isc_status[1]) { - RECORD_ERROR(stmt); - } - S->exhausted = 1; - return 0; - } - } - return 1; - } - return 0; -} -/* }}} */ - -/* called by PDO to retrieve information about the fields being returned */ -static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - struct pdo_column_data *col = &stmt->columns[colno]; - XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; - - /* allocate storage for the column */ - var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); - var->sqldata = &((char*)var->sqlind)[sizeof(short)]; - - col->precision = -var->sqlscale; - col->maxlen = var->sqllen; - col->namelen = var->aliasname_length; - col->name = estrndup(var->aliasname,var->aliasname_length); - - return 1; -} -/* }}} */ - -#if abies_0 -/* internal function to override return types of parameters */ -static void set_param_type(enum pdo_param_type *param_type, XSQLVAR const *var) /* {{{ */ -{ - /* set the param type after the field type */ - switch (var->sqltype & ~1) { - case SQL_INT64: -#if SIZEOF_LONG < 8 - if (0) /* always a string if its size exceeds native long */ -#endif - case SQL_SHORT: - case SQL_LONG: - if (var->sqlscale == 0) { - *param_type = PDO_PARAM_INT; - break; - } - case SQL_TEXT: - case SQL_VARYING: - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - case SQL_TIMESTAMP: - case SQL_BLOB: - *param_type = PDO_PARAM_STR; - break; - case SQL_FLOAT: - case SQL_DOUBLE: - *param_type = PDO_PARAM_DBL; - break; - } -} -/* }}} */ -#endif - -#define FETCH_BUF(buf,type,len,lenvar) ((buf) = (buf) ? (buf) : \ - emalloc((len) ? (len * sizeof(type)) : ((*(unsigned long*)lenvar) = sizeof(type)))) - -/* fetch a blob into a fetch buffer */ -static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */ - unsigned long *len, ISC_QUAD *blob_id TSRMLS_DC) -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - pdo_firebird_db_handle *H = S->H; - isc_blob_handle blobh = NULL; - char const bl_item = isc_info_blob_total_length; - char bl_info[20]; - unsigned short i; - int result = *len = 0; - - if (isc_open_blob(H->isc_status, &H->db, &H->tr, &blobh, blob_id)) { - RECORD_ERROR(stmt); - return 0; - } - - if (isc_blob_info(H->isc_status, &blobh, 1, const_cast(&bl_item), - sizeof(bl_info), bl_info)) { - RECORD_ERROR(stmt); - goto fetch_blob_end; - } - - /* find total length of blob's data */ - for (i = 0; i < sizeof(bl_info); ) { - unsigned short item_len; - char item = bl_info[i++]; - - if (item == isc_info_end || item == isc_info_truncated || item == isc_info_error - || i >= sizeof(bl_info)) { - H->last_app_error = "Couldn't determine BLOB size"; - goto fetch_blob_end; - } - - item_len = (unsigned short) isc_vax_integer(&bl_info[i], 2); - - if (item == isc_info_blob_total_length) { - *len = isc_vax_integer(&bl_info[i+2], item_len); - break; - } - i += item_len+2; - } - - /* we've found the blob's length, now fetch! */ - - if (*len) { - unsigned long cur_len; - unsigned short seg_len; - ISC_STATUS stat; - - *ptr = S->fetch_buf[colno] = erealloc(*ptr, *len+1); - - for (cur_len = stat = 0; (!stat || stat == isc_segment) && cur_len < *len; cur_len += seg_len) { - - unsigned short chunk_size = (*len-cur_len) > USHRT_MAX ? USHRT_MAX - : (unsigned short)(*len-cur_len); - - stat = isc_get_segment(H->isc_status, &blobh, &seg_len, chunk_size, &(*ptr)[cur_len]); - } - - (*ptr)[*len++] = '\0'; - - if (H->isc_status[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment)) { - H->last_app_error = "Error reading from BLOB"; - goto fetch_blob_end; - } - } - result = 1; - -fetch_blob_end: - if (isc_close_blob(H->isc_status, &blobh)) { - RECORD_ERROR(stmt); - return 0; - } - return result; -} -/* }}} */ - -static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */ - unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; - - if (*var->sqlind == -1) { - /* A NULL value */ - *ptr = NULL; - *len = 0; - } else { - /* override the column param type */ - /* set_param_type(&stmt->columns[colno].param_type,var); */ - stmt->columns[colno].param_type = PDO_PARAM_STR; - - if (var->sqlscale < 0) { - static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, - 100000000, 1000000000, 1000000000, LL_LIT(10000000000),LL_LIT(100000000000), - LL_LIT(10000000000000), LL_LIT(100000000000000),LL_LIT(1000000000000000), - LL_LIT(1000000000000000),LL_LIT(1000000000000000000) }; - ISC_INT64 n, f = scales[-var->sqlscale]; - - switch (var->sqltype & ~1) { - case SQL_SHORT: - n = *(short*)var->sqldata; - break; - case SQL_LONG: - n = *(ISC_LONG*)var->sqldata; - break; - case SQL_INT64: - n = *(ISC_INT64*)var->sqldata; - } - - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - - if (n >= 0) { - *len = sprintf(*ptr, "%" LL_MASK "d.%0*" LL_MASK "d", - n / f, -var->sqlscale, n % f); - } else if (n < -f) { - *len = sprintf(*ptr, "%" LL_MASK "d.%0*" LL_MASK "d", - n / f, -var->sqlscale, -n % f); - } else { - *len = sprintf(*ptr, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); - } - } else { - switch (var->sqltype & ~1) { - struct tm t; - char *fmt; - -/** -* For the time being, this code has been changed to convert every returned value to a string -* before passing it back up to the PDO driver. -*/ - - case SQL_VARYING: - *ptr = &var->sqldata[2]; - *len = *(short*)var->sqldata; - break; - case SQL_TEXT: - *ptr = var->sqldata; - *len = var->sqllen; - break; -/* --- cut here --- */ - case SQL_SHORT: - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - *len = sprintf(*ptr, "%d", *(short*)var->sqldata); - break; - case SQL_LONG: - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - *len = sprintf(*ptr, "%ld", *(ISC_LONG*)var->sqldata); - break; - case SQL_INT64: - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - *len = sprintf(*ptr, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); - break; - case SQL_FLOAT: - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - *len = sprintf(*ptr, "%f", *(float*)var->sqldata); - break; - case SQL_DOUBLE: - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL); - *len = sprintf(*ptr, "%f" , *(double*)var->sqldata); - break; -/* --- cut here --- */ -#if abies_0 - case SQL_SHORT: - *ptr = FETCH_BUF(S->fetch_buf[colno], long, 0, *len); - *(long*)*ptr = *(short*)var->sqldata; - break; - case SQL_LONG: -#if SIZEOF_LONG == 8 - *ptr = FETCH_BUF(S->fetch_buf[colno], long, 0, *len); - *(long*)*ptr = *(ISC_LONG*)var->sqldata; -#else - *ptr = var->sqldata; -#endif - break; - case SQL_INT64: - *len = sizeof(long); -#if SIZEOF_LONG == 8 - *ptr = var->sqldata; -#else - *ptr = FETCH_BUF(S->fetch_buf[colno], char, 20, NULL); - *len = sprintf(*ptr, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); -#endif - break; - case SQL_FLOAT: - *ptr = FETCH_BUF(S->fetch_buf[colno], double, 0, *len); - *(double*)*ptr = *(float*)var->sqldata; - break; - case SQL_DOUBLE: - *ptr = var->sqldata; - *len = sizeof(double); - break; -#endif - case SQL_TYPE_DATE: - isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); - fmt = INI_STR("ibase.dateformat"); - if (0) { - case SQL_TYPE_TIME: - isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); - fmt = INI_STR("ibase.timeformat"); - } else if (0) { - case SQL_TIMESTAMP: - isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t); - fmt = INI_STR("ibase.timestampformat"); - } - - /* convert the timestamp into a string */ - *ptr = FETCH_BUF(S->fetch_buf[colno], char, *len = 80, NULL); - *len = strftime(*ptr, *len, fmt, &t); - break; - case SQL_BLOB: - return firebird_fetch_blob(stmt,colno,ptr,len, - (ISC_QUAD*)var->sqldata TSRMLS_CC); - } - } - } - return 1; -} -/* }}} */ - -static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param TSRMLS_DC) -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - pdo_firebird_db_handle *H = S->H; - isc_blob_handle h = NULL; - unsigned long put_cnt = 0, rem_cnt; - unsigned short chunk_size; - int result = 1; - - if (isc_create_blob(H->isc_status, &H->db, &H->tr, &h, blob_id)) { - RECORD_ERROR(stmt); - return 0; - } - - SEPARATE_ZVAL(¶m); - - convert_to_string_ex(¶m); - - for (rem_cnt = Z_STRLEN_P(param); rem_cnt > 0; rem_cnt -= chunk_size) { - - chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt; - - if (isc_put_segment(H->isc_status, &h, chunk_size, &Z_STRVAL_P(param)[put_cnt])) { - RECORD_ERROR(stmt); - result = 0; - break; - } - put_cnt += chunk_size; - } - - zval_dtor(param); - - if (isc_close_blob(H->isc_status, &h)) { - RECORD_ERROR(stmt); - return 0; - } - return result; -} - -static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */ - enum pdo_param_event event_type TSRMLS_DC) -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - XSQLDA *sqlda = param->is_param ? S->in_sqlda : &S->out_sqlda; - XSQLVAR *var; - - if (event_type == PDO_PARAM_EVT_FREE) { /* not used */ - return 1; - } - - if (!sqlda || param->paramno >= sqlda->sqld) { - strcpy(stmt->error_code, "HY093"); - S->H->last_app_error = "Invalid parameter index"; - return 0; - } - if (param->is_param && param->paramno == -1) { - long *index; - - /* try to determine the index by looking in the named_params hash */ - if (SUCCESS == zend_hash_find(S->named_params, param->name, param->namelen+1, (void*)&index)) { - param->paramno = *index; - } else { - /* ... or by looking in the input descriptor */ - int i; - - for (i = 0; i < sqlda->sqld; ++i) { - XSQLVAR *var = &sqlda->sqlvar[i]; - - if ((var->aliasname_length && !strncasecmp(param->name, var->aliasname, - min(param->namelen, var->aliasname_length))) - || (var->sqlname_length && !strncasecmp(param->name, var->sqlname, - min(param->namelen, var->sqlname_length)))) { - param->paramno = i; - break; - } - } - if (i >= sqlda->sqld) { - strcpy(stmt->error_code, "HY093"); - S->H->last_app_error = "Invalid parameter name"; - return 0; - } - } - } - - var = &sqlda->sqlvar[param->paramno]; - - switch (event_type) { - char *value; - unsigned long value_len; - int caller_frees; - - case PDO_PARAM_EVT_ALLOC: - if (param->is_param) { - /* allocate the parameter */ - var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); - var->sqldata = &((char*)var->sqlind)[sizeof(short)]; - } - break; - - case PDO_PARAM_EVT_EXEC_PRE: - if (!param->is_param) { - break; - } - - *var->sqlind = 0; - - switch (var->sqltype & ~1) { - case SQL_ARRAY: - strcpy(stmt->error_code, "HY000"); - S->H->last_app_error = "Cannot bind to array field"; - return 0; - - case SQL_BLOB: - return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, - param->parameter TSRMLS_CC); - } - - /* check if a NULL should be inserted */ - switch (Z_TYPE_P(param->parameter)) { - int force_null; - - case IS_LONG: - var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG; - var->sqldata = (void*)&Z_LVAL_P(param->parameter); - var->sqllen = sizeof(long); - break; - case IS_DOUBLE: - var->sqltype = SQL_DOUBLE; - var->sqldata = (void*)&Z_DVAL_P(param->parameter); - var->sqllen = sizeof(double); - break; - case IS_STRING: - force_null = 0; - - /* for these types, an empty string can be handled like a NULL value */ - switch (var->sqltype & ~1) { - case SQL_SHORT: - case SQL_LONG: - case SQL_INT64: - case SQL_FLOAT: - case SQL_DOUBLE: - case SQL_TIMESTAMP: - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - force_null = (Z_STRLEN_P(param->parameter) == 0); - } - if (!force_null) { - var->sqltype = SQL_TEXT; - var->sqldata = Z_STRVAL_P(param->parameter); - var->sqllen = Z_STRLEN_P(param->parameter); - break; - } - case IS_NULL: - /* complain if this field doesn't allow NULL values */ - if (~var->sqltype & 1) { - strcpy(stmt->error_code, "HY105"); - S->H->last_app_error = "Parameter requires non-null value"; - return 0; - } - *var->sqlind = -1; - break; - default: - strcpy(stmt->error_code, "HY105"); - S->H->last_app_error = "Binding arrays/objects is not supported"; - return 0; - } - break; - - case PDO_PARAM_EVT_FETCH_POST: - value = NULL; - value_len = 0; - caller_frees = 0; - - if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) { - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_STR: - if (value) { - ZVAL_STRINGL(param->parameter, value, value_len, 1); - break; - } - case PDO_PARAM_INT: - if (value) { - ZVAL_LONG(param->parameter, *(long*)value); - break; - } -#if abies_0 - case PDO_PARAM_DBL: - if (value) { - ZVAL_DOUBLE(param->parameter, *(double*)value); - break; - } -#endif - default: - ZVAL_NULL(param->parameter); - } - if (value && caller_frees) { - efree(value); - } - return 1; - } - return 0; - default: - ; - } - return 1; -} -/* }}} */ - -static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - - switch (attr) { - default: - return 0; - case PDO_ATTR_CURSOR_NAME: - convert_to_string(val); - - if (isc_dsql_set_cursor_name(S->H->isc_status, &S->stmt, Z_STRVAL_P(val),0)) { - RECORD_ERROR(stmt); - return 0; - } - strncpy(S->name, Z_STRVAL_P(val), sizeof(S->name)); - S->name[sizeof(S->name)] = 0; - break; - } - return 1; -} -/* }}} */ - -static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */ -{ - pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; - - switch (attr) { - default: - return 0; - case PDO_ATTR_CURSOR_NAME: - if (*S->name) { - ZVAL_STRING(val,S->name,1); - } else { - ZVAL_NULL(val); - } - break; - } - return 1; -} -/* }}} */ - -struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */ - firebird_stmt_dtor, - firebird_stmt_execute, - firebird_stmt_fetch, - firebird_stmt_describe, - firebird_stmt_get_col, - firebird_stmt_param_hook, - firebird_stmt_set_attribute, - firebird_stmt_get_attribute -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_firebird/package.xml b/ext/pdo_firebird/package.xml deleted file mode 100644 index c6f613558b237..0000000000000 --- a/ext/pdo_firebird/package.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"><!-- $Id: package.xml,v 1.7 2005-02-09 05:26:38 wez Exp $ --> - <name>PDO_FIREBIRD</name> - <summary>Firebird/InterBase 6 driver for PDO</summary> - <maintainers> - <maintainer> - <user>abies</user> - <name>Ard Biesheuvel</name> - <email>abies@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <configureoptions> - <configureoption name="with-pdo-firebird" prompt="dir"/> -</configureoptions> - <description> - This extension provides a Firebird/InterBase driver for PDO. It supports - all versions of Firebird and InterBase versions 6 and up. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.2</version> - <date>2005-02-09</date> - - <notes> - To compile and run this module, you will need to have the main PDO module and Firebird's - or InterBase's client library installed on your system. - - Hope it works! - </notes> - - <filelist> - <file role="doc" name="CREDITS"/> - - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="firebird_driver.c"/> - <file role="src" name="firebird_statement.c"/> - <file role="src" name="pdo_firebird.c"/> - <file role="src" name="php_pdo_firebird.h"/> - <file role="src" name="php_pdo_firebird_int.h"/> - - <dir name="tests"> - <file role="test">connect.phpt</file> - <file role="test">ddl.phpt</file> - <file role="test">execute.phpt</file> - </dir> - - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" rel="ge" name="pdo" version="0.2"/> - </deps> - </release> -</package> diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c deleted file mode 100644 index 1413a61ba0aad..0000000000000 --- a/ext/pdo_firebird/pdo_firebird.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel <abies@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_firebird.h" -#include "php_pdo_firebird_int.h" - -function_entry pdo_firebird_functions[] = { /* {{{ */ - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry pdo_firebird_module_entry = { /* {{{ */ - STANDARD_MODULE_HEADER, - "PDO_Firebird", - pdo_firebird_functions, - PHP_MINIT(pdo_firebird), - PHP_MSHUTDOWN(pdo_firebird), - NULL, - NULL, - PHP_MINFO(pdo_firebird), - "0.2", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_FIREBIRD -ZEND_GET_MODULE(pdo_firebird) -#endif - -PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */ -{ - php_pdo_register_driver(&pdo_firebird_driver); - - return SUCCESS; -} -/* }}} */ - -PHP_MSHUTDOWN_FUNCTION(pdo_firebird) /* {{{ */ -{ - php_pdo_unregister_driver(&pdo_firebird_driver); - - return SUCCESS; -} -/* }}} */ - -PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */ -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for Firebird/InterBase", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h deleted file mode 100644 index 43bfb256d8f68..0000000000000 --- a/ext/pdo_firebird/php_pdo_firebird.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel <abies@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_FIREBIRD_H -#define PHP_PDO_FIREBIRD_H - -extern zend_module_entry pdo_firebird_module_entry; -#define phpext_pdo_firebird_ptr &pdo_firebird_module_entry - -#ifdef PHP_WIN32 -# ifdef PDO_FIREBIRD_EXPORTS -# define PDO_FB_API __declspec(dllexport) -# elif defined(COMPILE_DL_PDO_FIREBIRD) -# define PDO_FB_API __declspec(dllimport) -# else -# define PDO_FB_API -# endif -#else -# define PDO_FB_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_firebird); -PHP_MSHUTDOWN_FUNCTION(pdo_firebird); -PHP_RINIT_FUNCTION(pdo_firebird); -PHP_RSHUTDOWN_FUNCTION(pdo_firebird); -PHP_MINFO_FUNCTION(pdo_firebird); - -#endif /* PHP_PDO_FIREBIRD_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h deleted file mode 100644 index e485737aabff4..0000000000000 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ard Biesheuvel <abies@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_FIREBIRD_INT_H -#define PHP_PDO_FIREBIRD_INT_H - -#include <ibase.h> - -#ifdef SQLDA_VERSION -#define PDO_FB_SQLDA_VERSION SQLDA_VERSION -#else -#define PDO_FB_SQLDA_VERSION 1 -#endif - -#define PDO_FB_DIALECT 3 - -#define SHORT_MAX (1 << (8*sizeof(short)-1)) - -#if SIZEOF_LONG == 8 -# define LL_MASK "l" -# define LL_LIT(lit) lit ## L -#else -# ifdef PHP_WIN32 -# define LL_MASK "I64" -# define LL_LIT(lit) lit ## I64 -# else -# define LL_MASK "ll" -# define LL_LIT(lit) lit ## LL -# endif -#endif - -/* Firebird API has a couple of missing const decls in its API */ -#define const_cast(s) ((char*)(s)) - -#ifdef PHP_WIN32 -typedef void (__stdcall *info_func_t)(char*); -#else -typedef void (*info_func_t)(char*); -#endif - -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - -typedef struct { - - /* the result of the last API call */ - ISC_STATUS isc_status[20]; - - /* the connection handle */ - isc_db_handle db; - - /* the transaction handle */ - isc_tr_handle tr; - - /* the last error that didn't come from the API */ - char const *last_app_error; - -} pdo_firebird_db_handle; - - -typedef struct { - - /* the link that owns this statement */ - pdo_firebird_db_handle *H; - - /* the statement handle */ - isc_stmt_handle stmt; - - /* the name of the cursor (if it has one) */ - char name[32]; - - /* the type of statement that was issued */ - char statement_type:8; - - /* whether EOF was reached for this statement */ - unsigned exhausted:1; - - unsigned _reserved:23; - - /* the named params that were converted to ?'s by the driver */ - HashTable *named_params; - - /* allocated space to convert fields values to other types */ - char **fetch_buf; - - /* the input SQLDA */ - XSQLDA *in_sqlda; - - /* the output SQLDA */ - XSQLDA out_sqlda; /* last member */ - -} pdo_firebird_stmt; - -extern pdo_driver_t pdo_firebird_driver; - -extern struct pdo_stmt_methods firebird_stmt_methods; - -void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC); - -#endif /* PHP_PDO_FIREBIRD_INT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_firebird/tests/common.phpt b/ext/pdo_firebird/tests/common.phpt deleted file mode 100644 index cb1caf31503b2..0000000000000 --- a/ext/pdo_firebird/tests/common.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -FIREBIRD ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_odbc')) print 'skip'; ?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - - -if (false !== getenv('PDO_FIREBIRD_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_FIREBIRD_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_FIREBIRD_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_FIREBIRD_TEST_PASS'); - if (false !== getenv('PDO_FIREBIRD_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_FIREBIRD_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'firebird:dbname=/opt/firebird/test.gdb'; - $config['ENV']['PDOTEST_USER'] = 'SYSDBA'; - $config['ENV']['PDOTEST_PASS'] = 'password'; -} -return $config; diff --git a/ext/pdo_firebird/tests/connect.phpt b/ext/pdo_firebird/tests/connect.phpt deleted file mode 100644 index e4bb8ef54eace..0000000000000 --- a/ext/pdo_firebird/tests/connect.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -PDO_Firebird: connect/disconnect ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php /* $Id$ */ - - require("testdb.inc"); - - $db = new PDO("firebird:dbname=$test_base",$user,$password) or die; - unset($db); - echo "done\n"; - -?> ---EXPECT-- -done diff --git a/ext/pdo_firebird/tests/ddl.phpt b/ext/pdo_firebird/tests/ddl.phpt deleted file mode 100644 index 7709bb3f078fd..0000000000000 --- a/ext/pdo_firebird/tests/ddl.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -PDO_Firebird: DDL/transactions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php /* $Id$ */ - - require("testdb.inc"); - - $db = new PDO("firebird:dbname=$test_base",$user,$password) or die; - $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); - - $db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)"); - $db->exec("CREATE GENERATOR gen_ddl_id"); - $db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS - BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END"); - - $db->setAttribute(PDO_ATTR_AUTOCOMMIT,0); - - $db->beginTransaction(); - var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')")); - var_dump($db->exec("UPDATE ddl SET text='blabla'")); - $db->rollback(); - - $db->beginTransaction(); - var_dump($db->exec("DELETE FROM ddl")); - $db->commit(); - - unset($db); - echo "done\n"; - -?> ---EXPECT-- -int(1) -int(1) -int(0) -done diff --git a/ext/pdo_firebird/tests/execute.phpt b/ext/pdo_firebird/tests/execute.phpt deleted file mode 100644 index 89750483255f1..0000000000000 --- a/ext/pdo_firebird/tests/execute.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -PDO_Firebird: prepare/execute/binding ---SKIPIF-- -<?php include("skipif.inc"); ?> ---INI-- -ibase.timestampformat=%Y-%m-%d %H:%M:%S ---FILE-- -<?php /* $Id$ */ - - require("testdb.inc"); - - $db = new PDO("firebird:dbname=$test_base",$user,$password) or die; - - var_dump($db->getAttribute(PDO_ATTR_CONNECTION_STATUS)); - - $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); - - $db->exec("CREATE TABLE ddl (id SMALLINT NOT NULL PRIMARY KEY, text VARCHAR(32), - datetime TIMESTAMP DEFAULT '2000-02-12' NOT NULL)"); - $db->exec("INSERT INTO ddl (id,text) VALUES (1,'bla')"); - - $s = $db->prepare("SELECT * FROM ddl WHERE id=? FOR UPDATE"); - - $s->bindParam(1,$id = 0); - $s->bindColumn("TEXT",$var = null); - $id = 1; - $s->execute(); - $s->setAttribute(PDO_ATTR_CURSOR_NAME, "c"); - - var_dump($id); - - var_dump($s->fetch()); - - var_dump($var); - - var_dump($db->exec("UPDATE ddl SET id=2 WHERE CURRENT OF c")); - - var_dump($s->fetch()); - - unset($s); - unset($db); - echo "done\n"; - -?> ---EXPECT-- -bool(true) -int(1) -array(6) { - ["ID"]=> - string(1) "1" - [0]=> - string(1) "1" - ["TEXT"]=> - string(3) "bla" - [1]=> - string(3) "bla" - ["DATETIME"]=> - string(19) "2000-02-12 00:00:00" - [2]=> - string(19) "2000-02-12 00:00:00" -} -string(3) "bla" -int(1) -bool(false) -done diff --git a/ext/pdo_firebird/tests/skipif.inc b/ext/pdo_firebird/tests/skipif.inc deleted file mode 100644 index 5a6cd372d1084..0000000000000 --- a/ext/pdo_firebird/tests/skipif.inc +++ /dev/null @@ -1,5 +0,0 @@ -<?php /* $Id$ */ - -if (!extension_loaded("interbase") || !extension_loaded("pdo_firebird")) print "skip"; - -?> diff --git a/ext/pdo_firebird/tests/testdb.inc b/ext/pdo_firebird/tests/testdb.inc deleted file mode 100644 index f6951a7b13282..0000000000000 --- a/ext/pdo_firebird/tests/testdb.inc +++ /dev/null @@ -1,34 +0,0 @@ -<?php /* $Id$ */ - -$user = 'SYSDBA'; -$password = 'masterkey'; -ini_set('ibase.default_user',$user); -ini_set('ibase.default_password',$password); - -/* we need just the generated name, not the file itself */ -unlink($test_base = tempnam('/tmp',"php_ibase_test")); - -function init_db() -{ - global $test_base, $user, $password; - - $test_db = ibase_query(IBASE_CREATE,sprintf("CREATE DATABASE '%s' USER '%s' PASSWORD '%s'", - $test_base, $user, $password)); - $tr = ibase_trans($test_db); - ibase_query($tr,"create table test1 (i integer, c varchar(100))"); - ibase_commit_ret($tr); - ibase_query($tr,"insert into test1(i, c) values(1, 'test table not created with isql')"); - ibase_commit($tr); - ibase_close($test_db); -} - -function cleanup_db() -{ - global $test_base; - - $r = ibase_connect($test_base); - ibase_drop_db($r); -} - -register_shutdown_function('cleanup_db'); -init_db(); diff --git a/ext/pdo_mysql/CREDITS b/ext/pdo_mysql/CREDITS deleted file mode 100755 index 0735d9a1e816f..0000000000000 --- a/ext/pdo_mysql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -mySQL 3.x driver for PDO -George Schlossnagle diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 deleted file mode 100755 index 287a770d81f00..0000000000000 --- a/ext/pdo_mysql/config.m4 +++ /dev/null @@ -1,95 +0,0 @@ -dnl -dnl $Id$ -dnl - -if test "$PHP_PDO" != "no"; then - -AC_DEFUN([PDO_MYSQL_LIB_CHK], [ - str="$PDO_MYSQL_DIR/$1/libmysqlclient.*" - for j in `echo $str`; do - if test -r $j; then - PDO_MYSQL_LIB_DIR=$MYSQL_DIR/$1 - break 2 - fi - done -]) - -PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO, -[ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory]) - -if test "$PHP_PDO_MYSQL" != "no"; then - AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) - - for i in $PHP_PDO_MYSQL /usr/local /usr ; do - PDO_MYSQL_DIR=$i - PDO_MYSQL_CONFIG=$PDO_MYSQL_DIR/bin/mysql_config - if test -r $i/include/mysql; then - PDO_MYSQL_INC_DIR=$i/include/mysql - else - PDO_MYSQL_INC_DIR=$i/include - fi - if test -r $i/lib/mysql; then - PDO_MYSQL_LIB_DIR=$i/lib/mysql - else - PDO_MYSQL_LIB_DIR=$i/lib - fi - if test -x $PDO_MYSQL_CONFIG; then - break - fi - done - - if test -z "$PDO_MYSQL_DIR"; then - AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL. -Note that the MySQL client library is not bundled anymore!]) - fi - - if test -x $PDO_MYSQL_CONFIG; then - PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` - fi - - AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ]) - - PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $PDO_MYSQL_LIB_DIR, PDO_MYSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR) - if test -x $PDO_MYSQL_CONFIG; then - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs` - PHP_SUBST_OLD(PDO_MYSQL_LIBS) - fi - - _SAVE_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $PDO_MYSQL_LIBS" - AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate]) - LDFLAGS=$_SAVE_LDFLAGS - - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path) - ifdef([PHP_ADD_EXTENSION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo) - ]) - PDO_MYSQL_MODULE_TYPE=external - PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR - - PHP_SUBST(PDO_MYSQL_SHARED_LIBADD) - PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE) - PHP_SUBST_OLD(PDO_MYSQL_LIBS) - PHP_SUBST_OLD(PDO_MYSQL_INCLUDE) -fi - -fi diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32 deleted file mode 100644 index 24b2f7cf53513..0000000000000 --- a/ext/pdo_mysql/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-mysql", "MySQL support for PDO", "no"); - -if (PHP_PDO_MYSQL != "no") { - if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) && - CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) { - EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c"); - ADD_FLAG('CFLAGS_PDO_MYSQL', "/I ..\\pecl"); - } else { - WARNING("pdo_mysql not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_mysql', 'pdo'); -} diff --git a/ext/pdo_mysql/get_error_codes.php b/ext/pdo_mysql/get_error_codes.php deleted file mode 100644 index 2785c93b993bb..0000000000000 --- a/ext/pdo_mysql/get_error_codes.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - $codes = array(); - $maxlen = 0; - - while (!feof(STDIN)) { - $line = fgets(STDIN); - - if (ereg('^(ER_.*),[[:space:]]+"(.*)",[[:space:]]+"(.*)"', $line, $matches)) { - $codes[$matches[1]] = $matches[2]; - $maxlen = max($maxlen, strlen($matches[1])); - } - } - - if (empty($codes)) { - fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n"); - exit(3); - } - - echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n"; - foreach ($codes as $code => $state) { - echo "#ifdef $code\n"; - printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state); - echo "#endif\n"; - } - - -?> \ No newline at end of file diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c deleted file mode 100755 index d97e350298c90..0000000000000 --- a/ext/pdo_mysql/mysql_driver.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - | Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_mysql.h" -#include "php_pdo_mysql_int.h" -#include <mysqld_error.h> -#include "zend_exceptions.h" - - -const char *pdo_mysql_get_sqlstate(unsigned int my_errno) { - switch (my_errno) { - /* import auto-generated case: code */ -#include "php_pdo_mysql_sqlstate.h" - default: return "HY000"; - } -} - -int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_error_type *pdo_err; - pdo_mysql_error_info *einfo; - pdo_mysql_stmt *S = NULL; - - if (stmt) { - S = (pdo_mysql_stmt*)stmt->driver_data; - pdo_err = &stmt->error_code; - einfo = &S->einfo; - } else { - pdo_err = &dbh->error_code; - einfo = &H->einfo; - } - - einfo->errcode = mysql_errno(H->server); - einfo->file = file; - einfo->line = line; - - if (einfo->errmsg) { - pefree(einfo->errmsg, dbh->is_persistent); - einfo->errmsg = NULL; - } - - if (einfo->errcode) { - if (2014 != einfo->errcode) { - einfo->errmsg = pestrdup(mysql_error(H->server), dbh->is_persistent); - } else { - einfo->errmsg = pestrdup( - "Cannot execute queries while other unbuffered queries are active. " - "Consider using PDOStatement::fetchAll(). Alternatively, if your code " - "is only ever going to run against mysql, you may enable query " - "buffering by setting the PDO_MYSQL_ATTR_USE_BUFFERED_QUERY attribute.", - dbh->is_persistent); - } - } else { /* no error */ - strcpy(*pdo_err, PDO_ERR_NONE); - return 0; - } - -#if HAVE_MYSQL_SQLSTATE -# if HAVE_MYSQL_STMT_PREPARE - if (S && S->stmt) { - strcpy(*pdo_err, mysql_stmt_sqlstate(S->stmt)); - } else -# endif - { - strcpy(*pdo_err, mysql_sqlstate(H->server)); - } -#else - strcpy(*pdo_err, pdo_mysql_get_sqlstate(einfo->errcode)); -#endif - - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", - *pdo_err, einfo->errcode, einfo->errmsg); - } -/* printf("** [%s:%d] %s %s\n", file, line, *pdo_err, einfo->errmsg); */ - - return einfo->errcode; -} -/* }}} */ - -static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_mysql_error_info *einfo = &H->einfo; - - if (stmt) { - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - einfo = &S->einfo; - } else { - einfo = &H->einfo; - } - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); - } - - return 1; -} - -static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - if (H) { - if (H->server) { - mysql_close(H->server); - H->server = NULL; - } - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - H->einfo.errmsg = NULL; - } - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - } - return 0; -} -/* }}} */ - -static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt)); -#if HAVE_MYSQL_STMT_PREPARE - char *nsql = NULL; - int nsql_len = 0; - int ret; -#endif - - S->H = H; - stmt->driver_data = S; - stmt->methods = &mysql_stmt_methods; - - /* TODO: add runtime check to determine if the server we are talking to supports - * prepared statements; if it doesn't, we should set stmt->supports_placeholders - * to PDO_PLACEHOLDER_NONE, and have the rest of the code look at S->stmt to - * determine if we're using real prepared statements or the PDO emulated version */ -#if HAVE_MYSQL_STMT_PREPARE - stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL; - ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC); - - if (ret == 1) { - /* query was rewritten */ - sql = nsql; - sql_len = nsql_len; - } else if (ret == -1) { - /* failed to parse */ - strcpy(dbh->error_code, stmt->error_code); - return 0; - } - - if (!(S->stmt = mysql_stmt_init(H->server))) { - pdo_mysql_error(dbh); - if (nsql) { - efree(nsql); - } - return 0; - } - - if (mysql_stmt_prepare(S->stmt, sql, sql_len)) { - /* TODO: might need to pull statement specific info here? */ - /* if the query isn't supported by the protocol, fallback to emulation */ - if (mysql_errno(H->server) == 1295) { - if (nsql) { - efree(nsql); - } - goto fallback; - } - pdo_mysql_error(dbh); - if (nsql) { - efree(nsql); - } - return 0; - } - if (nsql) { - efree(nsql); - } - - S->num_params = mysql_stmt_param_count(S->stmt); - - if (S->num_params) { - S->params = ecalloc(S->num_params, sizeof(MYSQL_BIND)); - S->in_null = ecalloc(S->num_params, sizeof(my_bool)); - S->in_length = ecalloc(S->num_params, sizeof(unsigned long)); - } - - dbh->alloc_own_columns = 1; - - S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0 TSRMLS_CC); - - return 1; - -fallback: -#endif - stmt->supports_placeholders = PDO_PLACEHOLDER_NONE; - - return 1; -} - -static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - if (mysql_real_query(H->server, sql, sql_len)) { - pdo_mysql_error(dbh); - return -1; - } else { - my_ulonglong c = mysql_affected_rows(H->server); - if (c != (my_ulonglong) -1) { - pdo_mysql_error(dbh); - return (H->einfo.errcode ? -1 : 0); - } else { - return c; - } - } -} - -static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - char *id = php_pdo_int64_to_str(mysql_insert_id(H->server) TSRMLS_CC); - *len = strlen(id); - return id; -} - -static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - *quoted = safe_emalloc(2, unquotedlen, 3); - *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen); - (*quoted)[0] =(*quoted)[++*quotedlen] = '"'; - (*quoted)[++*quotedlen] = '\0'; - return 1; -} - -static int mysql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) -{ - return 0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION") TSRMLS_CC); -} - -static int mysql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) -{ - return 0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT") TSRMLS_CC); -} - -static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) -{ - return 0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK") TSRMLS_CC); -} - -static int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC) -{ - if (dbh->auto_commit) { - return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1") TSRMLS_CC); - } else { - return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0") TSRMLS_CC); - } -} - -static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) -{ - switch (attr) { - case PDO_ATTR_AUTOCOMMIT: - - convert_to_boolean(val); - - /* ignore if the new value equals the old one */ - if (dbh->auto_commit ^ Z_BVAL_P(val)) { - dbh->auto_commit = Z_BVAL_P(val); - mysql_handle_autocommit(dbh TSRMLS_CC); - } - return 1; - - case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY: - ((pdo_mysql_db_handle *)dbh->driver_data)->buffered = Z_BVAL_P(val); - return 1; - - default: - return 0; - } -} - -static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - ZVAL_STRING(return_value, (char *)mysql_get_client_info(), 1); - break; - - case PDO_ATTR_SERVER_VERSION: - ZVAL_STRING(return_value, (char *)mysql_get_server_info(H->server), 1); - break; - - case PDO_ATTR_CONNECTION_STATUS: - ZVAL_STRING(return_value, (char *)mysql_get_host_info(H->server), 1); - break; - - case PDO_ATTR_SERVER_INFO: { - char *tmp; - - if ((tmp = (char *)mysql_stat(H->server))) { - ZVAL_STRING(return_value, tmp, 1); - } else { - pdo_mysql_error(dbh); - return -1; - } - } - break; - - case PDO_ATTR_AUTOCOMMIT: - ZVAL_LONG(return_value, dbh->auto_commit); - return 1; - - case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY: - ZVAL_LONG(return_value, H->buffered); - return 1; - - default: - return 0; - } - - return 1; -} - - -static struct pdo_dbh_methods mysql_methods = { - mysql_handle_closer, - mysql_handle_preparer, - mysql_handle_doer, - mysql_handle_quoter, - mysql_handle_begin, - mysql_handle_commit, - mysql_handle_rollback, - pdo_mysql_set_attribute, - pdo_mysql_last_insert_id, - pdo_mysql_fetch_error_func, - pdo_mysql_get_attribute, - NULL /* check_liveness: TODO: ping */ -}; - -#ifndef PDO_MYSQL_UNIX_ADDR -# ifdef PHP_WIN32 -# define PDO_MYSQL_UNIX_ADDR "MySQL" -# else -# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock" -# endif -#endif - -static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_mysql_db_handle *H; - int i, ret = 0; - char *host = NULL, *unix_socket = NULL; - unsigned int port = 3306; - char *dbname; - struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "dbname", "", 0 }, - { "host", "localhost", 0 }, - { "port", "3306", 0 }, - { "unix_socket", PDO_MYSQL_UNIX_ADDR, 0 }, - }; - int connect_opts = 0 -#ifdef CLIENT_MULTI_RESULTS - |CLIENT_MULTI_RESULTS -#endif -#ifdef CLIENT_MULTI_STATEMENTS - |CLIENT_MULTI_STATEMENTS -#endif - ; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5); - - H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent); - - H->einfo.errcode = 0; - H->einfo.errmsg = NULL; - - /* allocate an environment */ - - /* handle for the server */ - if (!(H->server = mysql_init(NULL))) { - pdo_mysql_error(dbh); - goto cleanup; - } - - dbh->driver_data = H; - - /* handle MySQL options */ - if (driver_options) { - long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC); - H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC); - - if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) { - pdo_mysql_error(dbh); - goto cleanup; - } - } - - dbname = vars[1].optval; - host = vars[2].optval; - if(vars[3].optval) { - port = atoi(vars[3].optval); - } - if (vars[2].optval && !strcmp("localhost", vars[2].optval)) { - unix_socket = vars[4].optval; - } - if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) { - pdo_mysql_error(dbh); - goto cleanup; - } - - mysql_handle_autocommit(dbh TSRMLS_CC); - - H->attached = 1; - - dbh->alloc_own_columns = 1; - dbh->max_escaped_char_length = 2; - dbh->methods = &mysql_methods; - - ret = 1; - -cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - dbh->methods = &mysql_methods; - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_mysql_driver = { - PDO_DRIVER_HEADER(mysql), - pdo_mysql_handle_factory -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c deleted file mode 100755 index 9a48b128a0435..0000000000000 --- a/ext/pdo_mysql/mysql_statement.c +++ /dev/null @@ -1,559 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - | Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_mysql.h" -#include "php_pdo_mysql_int.h" - - -static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - - if (S->result) { - /* free the resource */ - mysql_free_result(S->result); - S->result = NULL; - } - if (S->einfo.errmsg) { - efree(S->einfo.errmsg); - S->einfo.errmsg = NULL; - } -#if HAVE_MYSQL_STMT_PREPARE - if (S->stmt) { - mysql_stmt_close(S->stmt); - S->stmt = NULL; - } - if (S->params) { - efree(S->params); - efree(S->in_null); - efree(S->in_length); - } - if (S->bound_result) - { - int i; - for (i = 0; i < stmt->column_count; i++) { - efree(S->bound_result[i].buffer); - } - - efree(S->bound_result); - efree(S->out_null); - efree(S->out_length); - } -#endif - efree(S); - return 1; -} - -#define PDO_MYSQL_MAX_BUFFER 1024*1024 /* 1 megabyte */ - -static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - pdo_mysql_db_handle *H = S->H; - my_ulonglong row_count; -#if HAVE_MYSQL_STMT_PREPARE - int i; - - if (S->stmt) { - /* (re)bind the parameters */ - if (mysql_stmt_bind_param(S->stmt, S->params)) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - if (mysql_stmt_execute(S->stmt)) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - if (!S->result) { - /* figure out the result set format, if any */ - S->result = mysql_stmt_result_metadata(S->stmt); - if (S->result) { - int calc_max_length = H->buffered && S->max_length == 1; - - S->fields = mysql_fetch_fields(S->result); - - if (S->bound_result) { - int i; - for (i = 0; i < stmt->column_count; i++) { - efree(S->bound_result[i].buffer); - } - efree(S->bound_result); - efree(S->out_null); - efree(S->out_length); - } - - stmt->column_count = (int)mysql_num_fields(S->result); - S->bound_result = ecalloc(stmt->column_count, sizeof(MYSQL_BIND)); - S->out_null = ecalloc(stmt->column_count, sizeof(my_bool)); - S->out_length = ecalloc(stmt->column_count, sizeof(unsigned long)); - - /* summon memory to hold the row */ - for (i = 0; i < stmt->column_count; i++) { - if (calc_max_length && S->fields[i].type == FIELD_TYPE_BLOB) { - my_bool on = 1; - mysql_stmt_attr_set(S->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &on); - calc_max_length = 0; - } - switch (S->fields[i].type) { - case FIELD_TYPE_INT24: - S->bound_result[i].buffer_length = MAX_MEDIUMINT_WIDTH; - break; - case FIELD_TYPE_LONG: - S->bound_result[i].buffer_length = MAX_INT_WIDTH; - break; - case FIELD_TYPE_LONGLONG: - S->bound_result[i].buffer_length = MAX_BIGINT_WIDTH; - break; - case FIELD_TYPE_TINY: - S->bound_result[i].buffer_length = MAX_TINYINT_WIDTH; - break; - case FIELD_TYPE_SHORT: - S->bound_result[i].buffer_length = MAX_SMALLINT_WIDTH; - break; - default: - S->bound_result[i].buffer_length = - S->fields[i].max_length? S->fields[i].max_length: - S->fields[i].length; - /* work-around for longtext and alike */ - if (S->bound_result[i].buffer_length > PDO_MYSQL_MAX_BUFFER) { - S->bound_result[i].buffer_length = PDO_MYSQL_MAX_BUFFER; - } - } - S->bound_result[i].buffer = emalloc(S->bound_result[i].buffer_length); - S->bound_result[i].is_null = &S->out_null[i]; - S->bound_result[i].length = &S->out_length[i]; - S->bound_result[i].buffer_type = MYSQL_TYPE_STRING; - } - - if (mysql_stmt_bind_result(S->stmt, S->bound_result)) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - /* if buffered, pre-fetch all the data */ - if (H->buffered) { - mysql_stmt_store_result(S->stmt); - } - } - } - - row_count = mysql_stmt_affected_rows(S->stmt); - if (row_count != (my_ulonglong)-1) { - stmt->row_count = row_count; - } - return 1; - } -#endif - /* ensure that we free any previous unfetched results */ - if (S->result) { - mysql_free_result(S->result); - S->result = NULL; - } - - if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - row_count = mysql_affected_rows(H->server); - if (row_count == (my_ulonglong)-1) { - /* we either have a query that returned a result set or an error occured - lets see if we have access to a result set */ - if (!H->buffered) { - S->result = mysql_use_result(H->server); - } else { - S->result = mysql_store_result(H->server); - } - if (NULL == S->result) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - stmt->row_count = 0; - - if (!stmt->executed) { - stmt->column_count = (int) mysql_num_fields(S->result); - S->fields = mysql_fetch_fields(S->result); - } - } else { - /* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */ - stmt->row_count = row_count; - } - - return 1; -} - -static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) -{ -#if HAVE_MYSQL_NEXT_RESULT - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - pdo_mysql_db_handle *H = S->H; - my_ulonglong row_count; - int ret; - - /* ensure that we free any previous unfetched results */ - if (S->result) { - mysql_free_result(S->result); - S->result = NULL; - } - - ret = mysql_next_result(H->server); - - if (ret > 0) { - pdo_mysql_error_stmt(stmt); - return 0; - } else if (ret < 0) { - /* No more results */ - return 0; - } else { - if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) { - pdo_mysql_error_stmt(stmt); - return 0; - } - - if (!H->buffered) { - S->result = mysql_use_result(H->server); - } else { - S->result = mysql_store_result(H->server); - } - - if (NULL == S->result) { - return 0; - } - - stmt->row_count = row_count; - stmt->column_count = (int) mysql_num_fields(S->result); - S->fields = mysql_fetch_fields(S->result); - return 1; - } -#else - strcpy(stmt->error_code, "HYC00"); - return 0; -#endif -} - - -static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ -#if HAVE_MYSQL_STMT_PREPARE - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - MYSQL_BIND *b; - - if (S->stmt && param->is_param) { - switch (event_type) { - case PDO_PARAM_EVT_ALLOC: - /* sanity check parameter number range */ - if (param->paramno < 0 || param->paramno >= S->num_params) { - strcpy(stmt->error_code, "HY093"); - return 0; - } - b = &S->params[param->paramno]; - param->driver_data = b; - b->is_null = &S->in_null[param->paramno]; - b->length = &S->in_length[param->paramno]; - return 1; - - case PDO_PARAM_EVT_EXEC_PRE: - b = (MYSQL_BIND*)param->driver_data; - - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL || - Z_TYPE_P(param->parameter) == IS_NULL) { - *b->is_null = 1; - b->buffer_type = MYSQL_TYPE_STRING; - b->buffer = NULL; - b->buffer_length = 0; - *b->length = 0; - return 1; - } - - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_LOB: - case PDO_PARAM_STMT: - return 0; - default: - ; - } - - switch (Z_TYPE_P(param->parameter)) { - case IS_STRING: - b->buffer_type = MYSQL_TYPE_STRING; - b->buffer = Z_STRVAL_P(param->parameter); - b->buffer_length = Z_STRLEN_P(param->parameter); - *b->length = Z_STRLEN_P(param->parameter); - return 1; - - case IS_LONG: - b->buffer_type = MYSQL_TYPE_LONG; - b->buffer = &Z_LVAL_P(param->parameter); - return 1; - - case IS_DOUBLE: - b->buffer_type = MYSQL_TYPE_DOUBLE; - b->buffer = &Z_DVAL_P(param->parameter); - return 1; - - default: - return 0; - } - } - } -#endif - return 1; -} - -static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; -#if HAVE_MYSQL_STMT_PREPARE - int ret; - - if (S->stmt) { - ret = mysql_stmt_fetch(S->stmt); - -#ifdef MYSQL_DATA_TRUNCATED - if (ret == MYSQL_DATA_TRUNCATED) { - ret = 0; - } -#endif - - if (ret) { - if (ret != MYSQL_NO_DATA) { - pdo_mysql_error_stmt(stmt); - } - return 0; - } - - return 1; - } -#endif - - if (!S->result) { - return 0; - } - if ((S->current_data = mysql_fetch_row(S->result)) == NULL) { - if (mysql_errno(S->H->server)) { - pdo_mysql_error_stmt(stmt); - } - return 0; - } - S->current_lengths = mysql_fetch_lengths(S->result); - return 1; -} - -static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - struct pdo_column_data *cols = stmt->columns; - unsigned int i; - - if (!S->result) { - return 0; - } - - if (colno >= stmt->column_count) { - /* error invalid column */ - return 0; - } - - /* fetch all on demand, this seems easiest - ** if we've been here before bail out - */ - if (cols[0].name) { - return 1; - } - for (i=0; i < stmt->column_count; i++) { - int namelen; - namelen = strlen(S->fields[i].name); - cols[i].precision = S->fields[i].decimals; - cols[i].maxlen = S->fields[i].length; - cols[i].namelen = namelen; - cols[i].name = estrndup(S->fields[i].name, namelen); - cols[i].param_type = PDO_PARAM_STR; - } - return 1; -} - -static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - -#if HAVE_MYSQL_STMT_PREPARE - if (!S->stmt) { -#endif - if (S->current_data == NULL || !S->result) { - return 0; - } -#if HAVE_MYSQL_STMT_PREPARE - } -#endif - if (colno >= stmt->column_count) { - /* error invalid column */ - return 0; - } -#if HAVE_MYSQL_STMT_PREPARE - if (S->stmt) { - if (S->out_null[colno]) { - *ptr = NULL; - *len = 0; - return 1; - } - *ptr = S->bound_result[colno].buffer; - *len = S->out_length[colno]; - return 1; - } -#endif - *ptr = S->current_data[colno]; - *len = S->current_lengths[colno]; - return 1; -} - -static char *type_to_name_native(int type) -{ -#define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x; - - switch (type) { - PDO_MYSQL_NATIVE_TYPE_NAME(STRING) - PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING) -#ifdef MYSQL_HAS_TINY - PDO_MYSQL_NATIVE_TYPE_NAME(TINY) -#endif - PDO_MYSQL_NATIVE_TYPE_NAME(SHORT) - PDO_MYSQL_NATIVE_TYPE_NAME(LONG) - PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG) - PDO_MYSQL_NATIVE_TYPE_NAME(INT24) - PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT) - PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE) - PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL) - PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP) -#ifdef MYSQL_HAS_YEAR - PDO_MYSQL_NATIVE_TYPE_NAME(YEAR) -#endif - PDO_MYSQL_NATIVE_TYPE_NAME(DATE) - PDO_MYSQL_NATIVE_TYPE_NAME(TIME) - PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME) - PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB) - PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB) - PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB) - PDO_MYSQL_NATIVE_TYPE_NAME(BLOB) - PDO_MYSQL_NATIVE_TYPE_NAME(NULL) - default: - return NULL; - } -} - -static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; - MYSQL_FIELD *F; - zval *flags; - char *str; - - if (!S->result) { - return FAILURE; - } - if (colno >= stmt->column_count || colno < 0) { - /* error invalid column */ - return FAILURE; - } - - array_init(return_value); - MAKE_STD_ZVAL(flags); - array_init(flags); - - F = S->fields + colno; - - if (F->def) { - add_assoc_string(return_value, "mysql:def", F->def, 1); - } - if (IS_NOT_NULL(F->flags)) { - add_next_index_string(flags, "not_null", 1); - } - if (IS_PRI_KEY(F->flags)) { - add_next_index_string(flags, "primary_key", 1); - } - if (F->flags & MULTIPLE_KEY_FLAG) { - add_next_index_string(flags, "multiple_key", 1); - } - if (F->flags & UNIQUE_KEY_FLAG) { - add_next_index_string(flags, "unique_key", 1); - } - if (IS_BLOB(F->flags)) { - add_next_index_string(flags, "blob", 1); - } - str = type_to_name_native(F->type); - if (str) { - add_assoc_string(return_value, "native_type", str, 1); - } - - add_assoc_zval(return_value, "flags", flags); - return SUCCESS; -} - -static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; -#if HAVE_MYSQL_STMT_PREPARE - if (S->stmt) { - return mysql_stmt_free_result(S->stmt); - } -#endif - if (S->result) { - mysql_free_result(S->result); - S->result = NULL; - } - return 1; -} - -struct pdo_stmt_methods mysql_stmt_methods = { - pdo_mysql_stmt_dtor, - pdo_mysql_stmt_execute, - pdo_mysql_stmt_fetch, - pdo_mysql_stmt_describe, - pdo_mysql_stmt_get_col, - pdo_mysql_stmt_param_hook, - NULL, /* set_attr */ - NULL, /* get_attr */ - pdo_mysql_stmt_col_meta, - pdo_mysql_stmt_next_rowset, - pdo_mysql_stmt_cursor_closer -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_mysql/package.xml b/ext/pdo_mysql/package.xml deleted file mode 100644 index 7c7e1c27b2b3e..0000000000000 --- a/ext/pdo_mysql/package.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_MYSQL</name> - <summary>Mysql 3.x/4.0 driver for PDO</summary> - <maintainers> - <maintainer> - <user>gschlossnagle</user> - <name>George Schlossnagle</name> - <email>george@omniti.com</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>iliaa</user> - <name>Ilia Alshanetsky</name> - <email>iliaa@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - - </maintainers> - <description> - This extension provides a Mysql 3.x/4.x driver for PDO. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - Much more robust, featuring native prepared statements and multi-rowset - query support. - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="pdo_mysql.c"/> - <file role="src" name="mysql_driver.c"/> - <file role="src" name="mysql_statement.c"/> - <file role="src" name="php_pdo_mysql.h"/> - <file role="src" name="php_pdo_mysql_int.h"/> - <file role="src" name="php_pdo_mysql_sqlstate.h"/> - - <file role="doc" name="CREDITS"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" name="pdo" rel="ge" version="0.9"/> - </deps> - </release> -</package> diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c deleted file mode 100755 index c83fcb42a280f..0000000000000 --- a/ext/pdo_mysql/pdo_mysql.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_mysql.h" -#include "php_pdo_mysql_int.h" - -/* {{{ pdo_mysql_functions[] */ -function_entry pdo_mysql_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_mysql_functions[] */ -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_mysql_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif -/* }}} */ - -/* {{{ pdo_mysql_module_entry */ -zend_module_entry pdo_mysql_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_mysql_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "pdo_mysql", - pdo_mysql_functions, - PHP_MINIT(pdo_mysql), - PHP_MSHUTDOWN(pdo_mysql), - NULL, - NULL, - PHP_MINFO(pdo_mysql), - "0.9", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_MYSQL -ZEND_GET_MODULE(pdo_mysql) -#endif - -/* true global environment */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pdo_mysql) -{ - REGISTER_PDO_CONST_LONG("MYSQL_ATTR_USE_BUFFERED_QUERY", (long)PDO_MYSQL_ATTR_USE_BUFFERED_QUERY); - - return php_pdo_register_driver(&pdo_mysql_driver); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_mysql) -{ - php_pdo_unregister_driver(&pdo_mysql_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_mysql) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for MySQL 3.x Client Libraries", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h deleted file mode 100755 index 0c71d47500f7f..0000000000000 --- a/ext/pdo_mysql/php_pdo_mysql.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_MYSQL_H -#define PHP_PDO_MYSQL_H - -extern zend_module_entry pdo_mysql_module_entry; -#define phpext_pdo_mysql_ptr &pdo_mysql_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_MYSQL_API __declspec(dllexport) -#else -#define PHP_PDO_MYSQL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_mysql); -PHP_MSHUTDOWN_FUNCTION(pdo_mysql); -PHP_RINIT_FUNCTION(pdo_mysql); -PHP_RSHUTDOWN_FUNCTION(pdo_mysql); -PHP_MINFO_FUNCTION(pdo_mysql); - -#endif /* PHP_PDO_MYSQL_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h deleted file mode 100755 index 7879aeb3e580d..0000000000000 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: George Schlossnagle <george@omniti.com> | - | Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_MYSQL_INT_H -#define PHP_PDO_MYSQL_INT_H - -#include <mysql.h> - -typedef struct { - const char *file; - int line; - unsigned int errcode; - char *errmsg; -} pdo_mysql_error_info; - -/* stuff we use in a mySQL database handle */ -typedef struct { - MYSQL *server; - - unsigned attached:1; - unsigned buffered:1; - unsigned _reserved:31; - - pdo_mysql_error_info einfo; -} pdo_mysql_db_handle; - -typedef struct { - MYSQL_FIELD *def; -} pdo_mysql_column; - -typedef struct { - pdo_mysql_db_handle *H; - MYSQL_RES *result; - MYSQL_FIELD *fields; - MYSQL_ROW current_data; - long *current_lengths; - pdo_mysql_error_info einfo; -#if HAVE_MYSQL_STMT_PREPARE - MYSQL_STMT *stmt; - - int num_params; - MYSQL_BIND *params; - my_bool *in_null; - unsigned long *in_length; - - MYSQL_BIND *bound_result; - my_bool *out_null; - unsigned long *out_length; - unsigned max_length:1; -#endif -} pdo_mysql_stmt; - -extern pdo_driver_t pdo_mysql_driver; - -extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC); -#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods mysql_stmt_methods; - -enum { - PDO_MYSQL_ATTR_USE_BUFFERED_QUERY = PDO_ATTR_DRIVER_SPECIFIC, -}; -#endif diff --git a/ext/pdo_mysql/php_pdo_mysql_sqlstate.h b/ext/pdo_mysql/php_pdo_mysql_sqlstate.h deleted file mode 100644 index 97724b72e974b..0000000000000 --- a/ext/pdo_mysql/php_pdo_mysql_sqlstate.h +++ /dev/null @@ -1,388 +0,0 @@ -/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */ -#ifdef ER_DUP_KEY - case ER_DUP_KEY : return "23000"; -#endif -#ifdef ER_OUTOFMEMORY - case ER_OUTOFMEMORY : return "HY001"; -#endif -#ifdef ER_OUT_OF_SORTMEMORY - case ER_OUT_OF_SORTMEMORY : return "HY001"; -#endif -#ifdef ER_CON_COUNT_ERROR - case ER_CON_COUNT_ERROR : return "08004"; -#endif -#ifdef ER_BAD_HOST_ERROR - case ER_BAD_HOST_ERROR : return "08S01"; -#endif -#ifdef ER_HANDSHAKE_ERROR - case ER_HANDSHAKE_ERROR : return "08S01"; -#endif -#ifdef ER_DBACCESS_DENIED_ERROR - case ER_DBACCESS_DENIED_ERROR : return "42000"; -#endif -#ifdef ER_ACCESS_DENIED_ERROR - case ER_ACCESS_DENIED_ERROR : return "28000"; -#endif -#ifdef ER_NO_DB_ERROR - case ER_NO_DB_ERROR : return "3D000"; -#endif -#ifdef ER_UNKNOWN_COM_ERROR - case ER_UNKNOWN_COM_ERROR : return "08S01"; -#endif -#ifdef ER_BAD_NULL_ERROR - case ER_BAD_NULL_ERROR : return "23000"; -#endif -#ifdef ER_BAD_DB_ERROR - case ER_BAD_DB_ERROR : return "42000"; -#endif -#ifdef ER_TABLE_EXISTS_ERROR - case ER_TABLE_EXISTS_ERROR : return "42S01"; -#endif -#ifdef ER_BAD_TABLE_ERROR - case ER_BAD_TABLE_ERROR : return "42S02"; -#endif -#ifdef ER_NON_UNIQ_ERROR - case ER_NON_UNIQ_ERROR : return "23000"; -#endif -#ifdef ER_SERVER_SHUTDOWN - case ER_SERVER_SHUTDOWN : return "08S01"; -#endif -#ifdef ER_BAD_FIELD_ERROR - case ER_BAD_FIELD_ERROR : return "42S22"; -#endif -#ifdef ER_WRONG_FIELD_WITH_GROUP - case ER_WRONG_FIELD_WITH_GROUP : return "42000"; -#endif -#ifdef ER_WRONG_GROUP_FIELD - case ER_WRONG_GROUP_FIELD : return "42000"; -#endif -#ifdef ER_WRONG_SUM_SELECT - case ER_WRONG_SUM_SELECT : return "42000"; -#endif -#ifdef ER_WRONG_VALUE_COUNT - case ER_WRONG_VALUE_COUNT : return "21S01"; -#endif -#ifdef ER_TOO_LONG_IDENT - case ER_TOO_LONG_IDENT : return "42000"; -#endif -#ifdef ER_DUP_FIELDNAME - case ER_DUP_FIELDNAME : return "42S21"; -#endif -#ifdef ER_DUP_KEYNAME - case ER_DUP_KEYNAME : return "42000"; -#endif -#ifdef ER_DUP_ENTRY - case ER_DUP_ENTRY : return "23000"; -#endif -#ifdef ER_WRONG_FIELD_SPEC - case ER_WRONG_FIELD_SPEC : return "42000"; -#endif -#ifdef ER_PARSE_ERROR - case ER_PARSE_ERROR : return "42000"; -#endif -#ifdef ER_NONUNIQ_TABLE - case ER_NONUNIQ_TABLE : return "42000"; -#endif -#ifdef ER_INVALID_DEFAULT - case ER_INVALID_DEFAULT : return "42000"; -#endif -#ifdef ER_MULTIPLE_PRI_KEY - case ER_MULTIPLE_PRI_KEY : return "42000"; -#endif -#ifdef ER_TOO_MANY_KEYS - case ER_TOO_MANY_KEYS : return "42000"; -#endif -#ifdef ER_TOO_MANY_KEY_PARTS - case ER_TOO_MANY_KEY_PARTS : return "42000"; -#endif -#ifdef ER_TOO_LONG_KEY - case ER_TOO_LONG_KEY : return "42000"; -#endif -#ifdef ER_KEY_COLUMN_DOES_NOT_EXITS - case ER_KEY_COLUMN_DOES_NOT_EXITS : return "42000"; -#endif -#ifdef ER_BLOB_USED_AS_KEY - case ER_BLOB_USED_AS_KEY : return "42000"; -#endif -#ifdef ER_TOO_BIG_FIELDLENGTH - case ER_TOO_BIG_FIELDLENGTH : return "42000"; -#endif -#ifdef ER_WRONG_AUTO_KEY - case ER_WRONG_AUTO_KEY : return "42000"; -#endif -#ifdef ER_FORCING_CLOSE - case ER_FORCING_CLOSE : return "08S01"; -#endif -#ifdef ER_IPSOCK_ERROR - case ER_IPSOCK_ERROR : return "08S01"; -#endif -#ifdef ER_NO_SUCH_INDEX - case ER_NO_SUCH_INDEX : return "42S12"; -#endif -#ifdef ER_WRONG_FIELD_TERMINATORS - case ER_WRONG_FIELD_TERMINATORS : return "42000"; -#endif -#ifdef ER_BLOBS_AND_NO_TERMINATED - case ER_BLOBS_AND_NO_TERMINATED : return "42000"; -#endif -#ifdef ER_CANT_REMOVE_ALL_FIELDS - case ER_CANT_REMOVE_ALL_FIELDS : return "42000"; -#endif -#ifdef ER_CANT_DROP_FIELD_OR_KEY - case ER_CANT_DROP_FIELD_OR_KEY : return "42000"; -#endif -#ifdef ER_BLOB_CANT_HAVE_DEFAULT - case ER_BLOB_CANT_HAVE_DEFAULT : return "42000"; -#endif -#ifdef ER_WRONG_DB_NAME - case ER_WRONG_DB_NAME : return "42000"; -#endif -#ifdef ER_WRONG_TABLE_NAME - case ER_WRONG_TABLE_NAME : return "42000"; -#endif -#ifdef ER_TOO_BIG_SELECT - case ER_TOO_BIG_SELECT : return "42000"; -#endif -#ifdef ER_UNKNOWN_PROCEDURE - case ER_UNKNOWN_PROCEDURE : return "42000"; -#endif -#ifdef ER_WRONG_PARAMCOUNT_TO_PROCEDURE - case ER_WRONG_PARAMCOUNT_TO_PROCEDURE : return "42000"; -#endif -#ifdef ER_UNKNOWN_TABLE - case ER_UNKNOWN_TABLE : return "42S02"; -#endif -#ifdef ER_FIELD_SPECIFIED_TWICE - case ER_FIELD_SPECIFIED_TWICE : return "42000"; -#endif -#ifdef ER_UNSUPPORTED_EXTENSION - case ER_UNSUPPORTED_EXTENSION : return "42000"; -#endif -#ifdef ER_TABLE_MUST_HAVE_COLUMNS - case ER_TABLE_MUST_HAVE_COLUMNS : return "42000"; -#endif -#ifdef ER_UNKNOWN_CHARACTER_SET - case ER_UNKNOWN_CHARACTER_SET : return "42000"; -#endif -#ifdef ER_TOO_BIG_ROWSIZE - case ER_TOO_BIG_ROWSIZE : return "42000"; -#endif -#ifdef ER_WRONG_OUTER_JOIN - case ER_WRONG_OUTER_JOIN : return "42000"; -#endif -#ifdef ER_NULL_COLUMN_IN_INDEX - case ER_NULL_COLUMN_IN_INDEX : return "42000"; -#endif -#ifdef ER_PASSWORD_ANONYMOUS_USER - case ER_PASSWORD_ANONYMOUS_USER : return "42000"; -#endif -#ifdef ER_PASSWORD_NOT_ALLOWED - case ER_PASSWORD_NOT_ALLOWED : return "42000"; -#endif -#ifdef ER_PASSWORD_NO_MATCH - case ER_PASSWORD_NO_MATCH : return "42000"; -#endif -#ifdef ER_WRONG_VALUE_COUNT_ON_ROW - case ER_WRONG_VALUE_COUNT_ON_ROW : return "21S01"; -#endif -#ifdef ER_INVALID_USE_OF_NULL - case ER_INVALID_USE_OF_NULL : return "42000"; -#endif -#ifdef ER_REGEXP_ERROR - case ER_REGEXP_ERROR : return "42000"; -#endif -#ifdef ER_NONEXISTING_GRANT - case ER_NONEXISTING_GRANT : return "42000"; -#endif -#ifdef ER_TABLEACCESS_DENIED_ERROR - case ER_TABLEACCESS_DENIED_ERROR : return "42000"; -#endif -#ifdef ER_COLUMNACCESS_DENIED_ERROR - case ER_COLUMNACCESS_DENIED_ERROR : return "42000"; -#endif -#ifdef ER_ILLEGAL_GRANT_FOR_TABLE - case ER_ILLEGAL_GRANT_FOR_TABLE : return "42000"; -#endif -#ifdef ER_GRANT_WRONG_HOST_OR_USER - case ER_GRANT_WRONG_HOST_OR_USER : return "42000"; -#endif -#ifdef ER_NO_SUCH_TABLE - case ER_NO_SUCH_TABLE : return "42S02"; -#endif -#ifdef ER_NONEXISTING_TABLE_GRANT - case ER_NONEXISTING_TABLE_GRANT : return "42000"; -#endif -#ifdef ER_NOT_ALLOWED_COMMAND - case ER_NOT_ALLOWED_COMMAND : return "42000"; -#endif -#ifdef ER_SYNTAX_ERROR - case ER_SYNTAX_ERROR : return "42000"; -#endif -#ifdef ER_ABORTING_CONNECTION - case ER_ABORTING_CONNECTION : return "08S01"; -#endif -#ifdef ER_NET_PACKET_TOO_LARGE - case ER_NET_PACKET_TOO_LARGE : return "08S01"; -#endif -#ifdef ER_NET_READ_ERROR_FROM_PIPE - case ER_NET_READ_ERROR_FROM_PIPE : return "08S01"; -#endif -#ifdef ER_NET_FCNTL_ERROR - case ER_NET_FCNTL_ERROR : return "08S01"; -#endif -#ifdef ER_NET_PACKETS_OUT_OF_ORDER - case ER_NET_PACKETS_OUT_OF_ORDER : return "08S01"; -#endif -#ifdef ER_NET_UNCOMPRESS_ERROR - case ER_NET_UNCOMPRESS_ERROR : return "08S01"; -#endif -#ifdef ER_NET_READ_ERROR - case ER_NET_READ_ERROR : return "08S01"; -#endif -#ifdef ER_NET_READ_INTERRUPTED - case ER_NET_READ_INTERRUPTED : return "08S01"; -#endif -#ifdef ER_NET_ERROR_ON_WRITE - case ER_NET_ERROR_ON_WRITE : return "08S01"; -#endif -#ifdef ER_NET_WRITE_INTERRUPTED - case ER_NET_WRITE_INTERRUPTED : return "08S01"; -#endif -#ifdef ER_TOO_LONG_STRING - case ER_TOO_LONG_STRING : return "42000"; -#endif -#ifdef ER_TABLE_CANT_HANDLE_BLOB - case ER_TABLE_CANT_HANDLE_BLOB : return "42000"; -#endif -#ifdef ER_TABLE_CANT_HANDLE_AUTO_INCREMENT - case ER_TABLE_CANT_HANDLE_AUTO_INCREMENT : return "42000"; -#endif -#ifdef ER_WRONG_COLUMN_NAME - case ER_WRONG_COLUMN_NAME : return "42000"; -#endif -#ifdef ER_WRONG_KEY_COLUMN - case ER_WRONG_KEY_COLUMN : return "42000"; -#endif -#ifdef ER_DUP_UNIQUE - case ER_DUP_UNIQUE : return "23000"; -#endif -#ifdef ER_BLOB_KEY_WITHOUT_LENGTH - case ER_BLOB_KEY_WITHOUT_LENGTH : return "42000"; -#endif -#ifdef ER_PRIMARY_CANT_HAVE_NULL - case ER_PRIMARY_CANT_HAVE_NULL : return "42000"; -#endif -#ifdef ER_TOO_MANY_ROWS - case ER_TOO_MANY_ROWS : return "42000"; -#endif -#ifdef ER_REQUIRES_PRIMARY_KEY - case ER_REQUIRES_PRIMARY_KEY : return "42000"; -#endif -#ifdef ER_CHECK_NO_SUCH_TABLE - case ER_CHECK_NO_SUCH_TABLE : return "42000"; -#endif -#ifdef ER_CHECK_NOT_IMPLEMENTED - case ER_CHECK_NOT_IMPLEMENTED : return "42000"; -#endif -#ifdef ER_CANT_DO_THIS_DURING_AN_TRANSACTION - case ER_CANT_DO_THIS_DURING_AN_TRANSACTION: return "25000"; -#endif -#ifdef ER_NEW_ABORTING_CONNECTION - case ER_NEW_ABORTING_CONNECTION : return "08S01"; -#endif -#ifdef ER_MASTER_NET_READ - case ER_MASTER_NET_READ : return "08S01"; -#endif -#ifdef ER_MASTER_NET_WRITE - case ER_MASTER_NET_WRITE : return "08S01"; -#endif -#ifdef ER_TOO_MANY_USER_CONNECTIONS - case ER_TOO_MANY_USER_CONNECTIONS : return "42000"; -#endif -#ifdef ER_READ_ONLY_TRANSACTION - case ER_READ_ONLY_TRANSACTION : return "25000"; -#endif -#ifdef ER_LOCK_DEADLOCK - case ER_LOCK_DEADLOCK : return "40001"; -#endif -#ifdef ER_NO_REFERENCED_ROW - case ER_NO_REFERENCED_ROW : return "23000"; -#endif -#ifdef ER_ROW_IS_REFERENCED - case ER_ROW_IS_REFERENCED : return "23000"; -#endif -#ifdef ER_CONNECT_TO_MASTER - case ER_CONNECT_TO_MASTER : return "08S01"; -#endif -#ifdef ER_USER_LIMIT_REACHED - case ER_USER_LIMIT_REACHED : return "42000"; -#endif -#ifdef ER_NO_DEFAULT - case ER_NO_DEFAULT : return "42000"; -#endif -#ifdef ER_WRONG_VALUE_FOR_VAR - case ER_WRONG_VALUE_FOR_VAR : return "42000"; -#endif -#ifdef ER_WRONG_TYPE_FOR_VAR - case ER_WRONG_TYPE_FOR_VAR : return "42000"; -#endif -#ifdef ER_CANT_USE_OPTION_HERE - case ER_CANT_USE_OPTION_HERE : return "42000"; -#endif -#ifdef ER_NOT_SUPPORTED_YET - case ER_NOT_SUPPORTED_YET : return "42000"; -#endif -#ifdef ER_WRONG_FK_DEF - case ER_WRONG_FK_DEF : return "42000"; -#endif -#ifdef ER_OPERAND_COLUMNS - case ER_OPERAND_COLUMNS : return "21000"; -#endif -#ifdef ER_SUBQUERY_NO_1_ROW - case ER_SUBQUERY_NO_1_ROW : return "21000"; -#endif -#ifdef ER_ILLEGAL_REFERENCE - case ER_ILLEGAL_REFERENCE : return "42S22"; -#endif -#ifdef ER_DERIVED_MUST_HAVE_ALIAS - case ER_DERIVED_MUST_HAVE_ALIAS : return "42000"; -#endif -#ifdef ER_SELECT_REDUCED - case ER_SELECT_REDUCED : return "01000"; -#endif -#ifdef ER_TABLENAME_NOT_ALLOWED_HERE - case ER_TABLENAME_NOT_ALLOWED_HERE : return "42000"; -#endif -#ifdef ER_NOT_SUPPORTED_AUTH_MODE - case ER_NOT_SUPPORTED_AUTH_MODE : return "08004"; -#endif -#ifdef ER_SPATIAL_CANT_HAVE_NULL - case ER_SPATIAL_CANT_HAVE_NULL : return "42000"; -#endif -#ifdef ER_COLLATION_CHARSET_MISMATCH - case ER_COLLATION_CHARSET_MISMATCH : return "42000"; -#endif -#ifdef ER_WARN_TOO_FEW_RECORDS - case ER_WARN_TOO_FEW_RECORDS : return "01000"; -#endif -#ifdef ER_WARN_TOO_MANY_RECORDS - case ER_WARN_TOO_MANY_RECORDS : return "01000"; -#endif -#ifdef ER_WARN_NULL_TO_NOTNULL - case ER_WARN_NULL_TO_NOTNULL : return "01000"; -#endif -#ifdef ER_WARN_DATA_OUT_OF_RANGE - case ER_WARN_DATA_OUT_OF_RANGE : return "01000"; -#endif -#ifdef ER_WARN_DATA_TRUNCATED - case ER_WARN_DATA_TRUNCATED : return "01000"; -#endif -#ifdef ER_WRONG_NAME_FOR_INDEX - case ER_WRONG_NAME_FOR_INDEX : return "42000"; -#endif -#ifdef ER_WRONG_NAME_FOR_CATALOG - case ER_WRONG_NAME_FOR_CATALOG : return "42000"; -#endif -#ifdef ER_UNKNOWN_STORAGE_ENGINE - case ER_UNKNOWN_STORAGE_ENGINE : return "42000"; -#endif diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt deleted file mode 100644 index 6df65695648ae..0000000000000 --- a/ext/pdo_mysql/tests/bug_33689.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -PDO MySQL Bug #33689 ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require 'ext/pdo_mysql/tests/config.inc'; -require 'ext/pdo/tests/pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -require 'ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory('ext/pdo_mysql/tests/common.phpt'); - -$db->exec('CREATE TABLE test (bar INT NOT NULL)'); -$db->exec('INSERT INTO test VALUES(1)'); - -var_dump($db->query('SELECT * from test')); -foreach ($db->query('SELECT * from test') as $row) { - print_r($row); -} - -$stmt = $db->prepare('SELECT * from test'); -print_r($stmt->getColumnMeta(0)); -$stmt->execute(); -print_r($stmt->getColumnMeta(0)); - ---EXPECTF-- -object(PDOStatement)#%d (1) { - ["queryString"]=> - string(18) "SELECT * from test" -} -Array -( - [bar] => 1 - [0] => 1 -) -Array -( - [native_type] => LONG - [flags] => Array - ( - [0] => not_null - ) - - [name] => bar - [len] => 11 - [precision] => 0 - [pdo_type] => 2 -) diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt deleted file mode 100644 index 8179454cf76d1..0000000000000 --- a/ext/pdo_mysql/tests/common.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -MySQL ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded'; -?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - -if (false !== getenv('PDO_MYSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS'); - if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = ''; -} - -return $config; diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc deleted file mode 100644 index 855f89bc1e3f3..0000000000000 --- a/ext/pdo_mysql/tests/config.inc +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -if (false !== getenv('PDO_MYSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS'); - if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = ''; -} - -foreach ($config['ENV'] as $k => $v) { - putenv("$k=$v"); -} diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt deleted file mode 100644 index dc95d5f5f706d..0000000000000 --- a/ext/pdo_mysql/tests/show_tables.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -PDO MySQL SHOW TABLES ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require 'ext/pdo_mysql/tests/config.inc'; -require 'ext/pdo/tests/pdo_test.inc'; -PDOTest::skip(); -?> ---FILE-- -<?php -require 'ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory('ext/pdo_mysql/tests/common.phpt'); - -print_r($db->query('SHOW TABLES')); ---EXPECT-- -PDOStatement Object -( - [queryString] => SHOW TABLES -) diff --git a/ext/pdo_oci/CREDITS b/ext/pdo_oci/CREDITS deleted file mode 100755 index 63e863a22dd97..0000000000000 --- a/ext/pdo_oci/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Oracle (OCI) driver for PDO -Wez Furlong diff --git a/ext/pdo_oci/EXPERIMENTAL b/ext/pdo_oci/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 deleted file mode 100755 index 507cfd03f46f1..0000000000000 --- a/ext/pdo_oci/config.m4 +++ /dev/null @@ -1,209 +0,0 @@ -dnl $Id$ - -if test "$PHP_PDO" != "no"; then - -AC_DEFUN([AC_PDO_OCI_VERSION],[ - AC_MSG_CHECKING([Oracle version]) - if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then - PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3 - elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - PDO_OCI_VERSION=10.1 - elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then - PDO_OCI_VERSION=9.0 - elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then - PDO_OCI_VERSION=8.1 - elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then - PDO_OCI_VERSION=8.0 - elif test -f $PDO_OCI_DIR/lib/libclntsh.a; then - if test -f $PDO_OCI_DIR/lib/libcore4.a; then - PDO_OCI_VERSION=8.0 - else - PDO_OCI_VERSION=8.1 - fi - else - AC_MSG_ERROR(Oracle-OCI needed libraries not found under $PDO_OCI_DIR) - fi - AC_MSG_RESULT($PDO_OCI_VERSION) -]) - -PHP_ARG_WITH(pdo-oci, Oracle OCI support for PDO, -[ --with-pdo-oci[=DIR] PDO: Oracle-OCI support. Default DIR is ORACLE_HOME. - You may also use --with-pdo-oci=instantclient,prefix,version to use - the InstantClient SDK. For Linux with 10.1.0.3 rpms (for example) use: - --with-pdo-oci=instantclient,/usr,10.1.0.3]) - -if test "$PHP_PDO_OCI" != "no"; then - AC_MSG_CHECKING([Oracle Install-Dir]) - if test "$PHP_PDO_OCI" = "yes" -o -z "$PHP_PDO_OCI"; then - PDO_OCI_DIR=$ORACLE_HOME - else - PDO_OCI_DIR=$PHP_PDO_OCI - fi - AC_MSG_RESULT($PDO_OCI_DIR :$PHP_PDO_OCI:) - - AC_MSG_CHECKING([if that is sane]) - if test -z "$PDO_OCI_DIR"; then - AC_MSG_ERROR([ -You need to tell me where to find your oracle SDK, or set ORACLE_HOME. -]) - else - AC_MSG_RESULT([yes]) - fi - - if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then - PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`" - PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`" - AC_MSG_CHECKING([for oci.h]) - if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then - PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client) - AC_MSG_RESULT($PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client) - elif test -f $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then - PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include) - AC_MSG_RESULT($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include) - else - AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your instant client install]) - fi - PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib" - PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`" - else - if test -d "$PDO_OCI_DIR/rdbms/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public" - fi - if test -d "$PDO_OCI_DIR/rdbms/demo"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/demo) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/demo" - fi - if test -d "$PDO_OCI_DIR/network/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/network/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/network/public" - fi - if test -d "$PDO_OCI_DIR/plsql/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/plsql/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/plsql/public" - fi - if test -d "$PDO_OCI_DIR/include"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/include) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include" - fi - - if test -f "$PDO_OCI_DIR/lib/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/lib/sysliblist`, PDO_OCI_SYSLIB) - elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/rdbms/lib/sysliblist`, PDO_OCI_SYSLIB) - fi - PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" - AC_PDO_OCI_VERSION($PDO_OCI_DIR) - fi - - case $PDO_OCI_VERSION in - 8.0) - PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", PDO_OCI_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(core4, "", PDO_OCI_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(psa, "", PDO_OCI_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(clntsh, $PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD) - ;; - - 8.1) - PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) - ;; - - 9.0) - PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) - ;; - - 10.1) - PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) - ;; - 10.2) - PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) - ;; - *) - AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION) - ;; - esac - - PHP_ADD_LIBPATH($PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate, - [ - AC_DEFINE(HAVE_OCIENVCREATE,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate, - [ - AC_DEFINE(HAVE_OCIENVNLSCREATE,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - dnl - dnl Check if we need to add -locijdbc8 - dnl - PHP_CHECK_LIBRARY(clntsh, OCILobIsTemporary, - [ - AC_DEFINE(HAVE_OCILOBISTEMPORARY,1,[ ]) - ], [ - PHP_CHECK_LIBRARY(ocijdbc8, OCILobIsTemporary, - [ - PHP_ADD_LIBRARY(ocijdbc8, 1, PDO_OCI_SHARED_LIBADD) - AC_DEFINE(HAVE_OCILOBISTEMPORARY,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - ], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - dnl - dnl Check if we have collections - dnl - PHP_CHECK_LIBRARY(clntsh, OCICollAssign, - [ - AC_DEFINE(HAVE_OCICOLLASSIGN,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - dnl Scrollable cursors? - PHP_CHECK_LIBRARY(clntsh, OCIStmtFetch2, - [ - AC_DEFINE(HAVE_OCISTMTFETCH2,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path) - - PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD) - PHP_SUBST_OLD(PDO_OCI_DIR) - PHP_SUBST_OLD(PDO_OCI_VERSION) - - ifdef([PHP_ADD_EXTENSION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_oci, pdo) - ]) - -fi - -fi diff --git a/ext/pdo_oci/config.w32 b/ext/pdo_oci/config.w32 deleted file mode 100755 index 1e0729e47dfa9..0000000000000 --- a/ext/pdo_oci/config.w32 +++ /dev/null @@ -1,86 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no"); - -if (PHP_PDO_OCI != "no") { - - pdo_oci_dirs = new Array( - PHP_PDO_OCI, - PHP_PDO_OCI + "\\oci", - PHP_PHP_BUILD + "\\instantclient10_*\\sdk", - PHP_PHP_BUILD + "\\oci92" - ); - - pdo_oci_lib_paths = ""; - pdo_oci_inc_paths = ""; - - // find the oracle install - for (i = 0; i < pdo_oci_dirs.length; i++) { - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;"; - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;"; - pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;"; - } - - pdo_oci_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;" - pdo_oci_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;"; - - pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI", pdo_oci_inc_paths, null, null, true); - - if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci", pdo_oci_lib_paths)) { - - pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header); - - EXTENSION('pdo_oci', 'pdo_oci.c oci_driver.c oci_statement.c'); - ADD_FLAG('CFLAGS_PDO_OCI', "/I ..\\pecl"); - - /* probe for some functions not present in older versions */ - pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header); - CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - - } else { - WARNING("pdo-oci not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_oci', 'pdo'); -} - -ARG_WITH("pdo-oci8", "Oracle OCI 8 (only) support for PDO", "no"); - -if (PHP_PDO_OCI8 != "no") { - pdo_oci_dirs = new Array( - PHP_PDO_OCI, - PHP_PHP_BUILD + "\\oci805" - ); - - pdo_oci_lib_paths = ""; - pdo_oci_inc_paths = ""; - - // find the oracle install - for (i = 0; i < pdo_oci_dirs.length; i++) { - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;"; - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;"; - pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;"; - } - - pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI8", pdo_oci_inc_paths, null, null, true); - - if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci8", pdo_oci_lib_paths)) { - pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header); - - EXTENSION('pdo_oci8', 'pdo_oci.c oci_driver.c oci_statement.c', null, null, null, "ext\\pdo_oci8"); - ADD_FLAG('CFLAGS_PDO_OCI8', "/I ..\\pecl"); - - /* probe for some functions not present in older versions */ - pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header); - CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8'); - - } else { - WARNING("pdo-oci8 not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_oci8', 'pdo'); -} - diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c deleted file mode 100755 index 706faebf38510..0000000000000 --- a/ext/pdo_oci/oci_driver.c +++ /dev/null @@ -1,558 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" -#include "Zend/zend_exceptions.h" - -static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_error_info *einfo; - - einfo = &H->einfo; - - if (stmt) { - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - - if (S->einfo.errmsg) { - einfo = &S->einfo; - } - } - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); - } - - return 1; -} -/* }}} */ - -ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - text errbuf[1024] = "<<Unknown>>"; - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_error_info *einfo; - pdo_oci_stmt *S = NULL; - pdo_error_type *pdo_err = &dbh->error_code; - - if (stmt) { - S = (pdo_oci_stmt*)stmt->driver_data; - einfo = &S->einfo; - pdo_err = &stmt->error_code; - if (einfo->errmsg) { - efree(einfo->errmsg); - } - } - else { - einfo = &H->einfo; - if (einfo->errmsg) { - pefree(einfo->errmsg, dbh->is_persistent); - } - } - - einfo->errmsg = NULL; - einfo->errcode = 0; - einfo->file = file; - einfo->line = line; - - switch (status) { - case OCI_SUCCESS: - strcpy(*pdo_err, "00000"); - break; - case OCI_ERROR: - OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); - spprintf(&einfo->errmsg, 0, "%s: %s (%s:%d)", what, errbuf, file, line); - break; - case OCI_SUCCESS_WITH_INFO: - OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); - spprintf(&einfo->errmsg, 0, "%s: OCI_SUCCESS_WITH_INFO: %s (%s:%d)", what, errbuf, file, line); - break; - case OCI_NEED_DATA: - spprintf(&einfo->errmsg, 0, "%s: OCI_NEED_DATA (%s:%d)", what, file, line); - break; - case OCI_NO_DATA: - spprintf(&einfo->errmsg, 0, "%s: OCI_NO_DATA (%s:%d)", what, file, line); - break; - case OCI_INVALID_HANDLE: - spprintf(&einfo->errmsg, 0, "%s: OCI_INVALID_HANDLE (%s:%d)", what, file, line); - break; - case OCI_STILL_EXECUTING: - spprintf(&einfo->errmsg, 0, "%s: OCI_STILL_EXECUTING (%s:%d)", what, file, line); - break; - case OCI_CONTINUE: - spprintf(&einfo->errmsg, 0, "%s: OCI_CONTINUE (%s:%d)", what, file, line); - break; - } - - if (einfo->errcode) { - switch (einfo->errcode) { - case 1013: /* user requested cancel of current operation */ - zend_bailout(); - break; - -#if 0 - case 955: /* ORA-00955: name is already used by an existing object */ - *pdo_err = PDO_ERR_ALREADY_EXISTS; - break; -#endif - - case 12154: /* ORA-12154: TNS:could not resolve service name */ - strcpy(*pdo_err, "42S02"); - break; - - case 22: /* ORA-00022: invalid session id */ - case 1012: /* ORA-01012: */ - case 3113: /* ORA-03133: end of file on communication channel */ - case 604: - case 1041: - /* consider the connection closed */ - dbh->is_closed = 1; - H->attached = 0; - strcpy(*pdo_err, "01002"); /* FIXME */ - break; - - default: - strcpy(*pdo_err, "HY000"); - } - } - - if (stmt) { - /* always propogate the error code back up to the dbh, - * so that we can catch the error information when execute - * is called via query. See Bug #33707 */ - if (H->einfo.errmsg) { - efree(H->einfo.errmsg); - } - H->einfo = *einfo; - H->einfo.errmsg = einfo->errmsg ? estrdup(einfo->errmsg) : NULL; - strcpy(dbh->error_code, stmt->error_code); - } - - /* little mini hack so that we can use this code from the dbh ctor */ - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg); - } - - return einfo->errcode; -} -/* }}} */ - -static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - if (H->svc) { - /* rollback any outstanding work */ - OCITransRollback(H->svc, H->err, 0); - } - - if (H->session) { - OCIHandleFree(H->session, OCI_HTYPE_SESSION); - H->session = NULL; - } - - if (H->svc) { - OCIHandleFree(H->svc, OCI_HTYPE_SVCCTX); - H->svc = NULL; - } - - if (H->server && H->attached) { - H->last_err = OCIServerDetach(H->server, H->err, OCI_DEFAULT); - if (H->last_err) { - oci_drv_error("OCIServerDetach"); - } - H->attached = 0; - } - - if (H->server) { - OCIHandleFree(H->server, OCI_HTYPE_SERVER); - H->server = NULL; - } - - OCIHandleFree(H->err, OCI_HTYPE_ERROR); - H->err = NULL; - - if (H->charset && H->env) { - OCIHandleFree(H->env, OCI_HTYPE_ENV); - H->env = NULL; - } - - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - H->einfo.errmsg = NULL; - } - - pefree(H, dbh->is_persistent); - - return 0; -} -/* }}} */ - -static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_stmt *S = ecalloc(1, sizeof(*S)); - ub4 prefetch; - char *nsql = NULL; - int nsql_len = 0; - int ret; - -#if HAVE_OCISTMTFETCH2 - S->exec_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, - PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL ? - OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT; -#else - S->exec_type = OCI_DEFAULT; -#endif - - S->H = H; - stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED; - ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC); - - if (ret == 1) { - /* query was re-written */ - sql = nsql; - sql_len = nsql_len; - } else if (ret == -1) { - /* couldn't grok it */ - strcpy(dbh->error_code, stmt->error_code); - efree(S); - return 0; - } - - /* create an OCI statement handle */ - OCIHandleAlloc(H->env, (dvoid*)&S->stmt, OCI_HTYPE_STMT, 0, NULL); - - /* and our own private error handle */ - OCIHandleAlloc(H->env, (dvoid*)&S->err, OCI_HTYPE_ERROR, 0, NULL); - - if (sql_len) { - H->last_err = OCIStmtPrepare(S->stmt, H->err, (text*)sql, sql_len, OCI_NTV_SYNTAX, OCI_DEFAULT); - if (nsql) { - efree(nsql); - nsql = NULL; - } - if (H->last_err) { - H->last_err = oci_drv_error("OCIStmtPrepare"); - OCIHandleFree(S->stmt, OCI_HTYPE_STMT); - OCIHandleFree(S->err, OCI_HTYPE_ERROR); - efree(S); - return 0; - } - - } - - prefetch = 1024 * pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, 100 TSRMLS_CC); - if (prefetch) { - H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0, - OCI_ATTR_PREFETCH_MEMORY, H->err); - if (!H->last_err) { - prefetch /= 1024; - H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0, - OCI_ATTR_PREFETCH_ROWS, H->err); - } - } - - stmt->driver_data = S; - stmt->methods = &oci_stmt_methods; - if (nsql) { - efree(nsql); - nsql = NULL; - } - - return 1; -} -/* }}} */ - -static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - OCIStmt *stmt; - ub2 stmt_type; - ub4 rowcount; - int ret = -1; - - OCIHandleAlloc(H->env, (dvoid*)&stmt, OCI_HTYPE_STMT, 0, NULL); - - H->last_err = OCIStmtPrepare(stmt, H->err, (text*)sql, sql_len, OCI_NTV_SYNTAX, OCI_DEFAULT); - if (H->last_err) { - H->last_err = oci_drv_error("OCIStmtPrepare"); - OCIHandleFree(stmt, OCI_HTYPE_STMT); - return -1; - } - - H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &stmt_type, 0, OCI_ATTR_STMT_TYPE, H->err); - - if (stmt_type == OCI_STMT_SELECT) { - /* invalid usage; cancel it */ - OCIHandleFree(stmt, OCI_HTYPE_STMT); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "issuing a SELECT query here is invalid"); - return -1; - } - - /* now we are good to go */ - H->last_err = OCIStmtExecute(H->svc, stmt, H->err, 1, 0, NULL, NULL, - (dbh->auto_commit && !dbh->in_txn) ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT); - - if (H->last_err) { - H->last_err = oci_drv_error("OCIStmtExecute"); - } else { - /* return the number of affected rows */ - H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, H->err); - ret = rowcount; - } - - OCIHandleFree(stmt, OCI_HTYPE_STMT); - - return ret; -} -/* }}} */ - -static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - return 0; -} -/* }}} */ - -static int oci_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - /* with Oracle, there is nothing special to be done */ - return 1; -} -/* }}} */ - -static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - H->last_err = OCITransCommit(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransCommit"); - return 0; - } - return 1; -} -/* }}} */ - -static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - H->last_err = OCITransRollback(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransRollback"); - return 0; - } - return 1; -} -/* }}} */ - -static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - if (attr == PDO_ATTR_AUTOCOMMIT) { - if (dbh->in_txn) { - /* Assume they want to commit whatever is outstanding */ - H->last_err = OCITransCommit(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransCommit"); - return 0; - } - dbh->in_txn = 0; - } - - convert_to_long(val); - - dbh->auto_commit = Z_LVAL_P(val); - return 1; - } else { - return 0; - } - -} -/* }}} */ - -static struct pdo_dbh_methods oci_methods = { - oci_handle_closer, - oci_handle_preparer, - oci_handle_doer, - oci_handle_quoter, - oci_handle_begin, - oci_handle_commit, - oci_handle_rollback, - oci_handle_set_attribute, - NULL, - pdo_oci_fetch_error_func, - NULL, /* get_attr */ - NULL, /* check_liveness */ - NULL /* get_driver_methods */ -}; - -static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_oci_db_handle *H; - int i, ret = 0; - struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "dbname", "", 0 } - }; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 2); - - H = pecalloc(1, sizeof(*H), dbh->is_persistent); - dbh->driver_data = H; - - /* allocate an environment */ -#if HAVE_OCIENVNLSCREATE - if (vars[0].optval) { - H->charset = OCINlsCharSetNameToId(pdo_oci_Env, vars[0].optval); - if (H->charset) { - OCIEnvNlsCreate(&H->env, PDO_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, H->charset, H->charset); - } - } -#endif - if (H->env == NULL) { - /* use the global environment */ - H->env = pdo_oci_Env; - } - - /* something to hold errors */ - OCIHandleAlloc(H->env, (dvoid **)&H->err, OCI_HTYPE_ERROR, 0, NULL); - - /* handle for the server */ - OCIHandleAlloc(H->env, (dvoid **)&H->server, OCI_HTYPE_SERVER, 0, NULL); - - H->last_err = OCIServerAttach(H->server, H->err, (text*)vars[1].optval, - strlen(vars[1].optval), OCI_DEFAULT); - - if (H->last_err) { - oci_drv_error("pdo_oci_handle_factory"); - goto cleanup; - } - - H->attached = 1; - - /* create a service context */ - H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->svc, OCI_HTYPE_SVCCTX, 0, NULL); - if (H->last_err) { - oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SVCCTX"); - goto cleanup; - } - - H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->session, OCI_HTYPE_SESSION, 0, NULL); - if (H->last_err) { - oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SESSION"); - goto cleanup; - } - - /* set server handle into service handle */ - H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->server, 0, OCI_ATTR_SERVER, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_SERVER"); - goto cleanup; - } - - /* username */ - if (dbh->username) { - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - dbh->username, strlen(dbh->username), - OCI_ATTR_USERNAME, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_USERNAME"); - goto cleanup; - } - } - - /* password */ - if (dbh->password) { - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - dbh->password, strlen(dbh->password), - OCI_ATTR_PASSWORD, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_PASSWORD"); - goto cleanup; - } - } - - /* Now fire up the session */ - H->last_err = OCISessionBegin(H->svc, H->err, H->session, OCI_CRED_RDBMS, OCI_DEFAULT); - if (H->last_err) { - oci_drv_error("OCISessionBegin:"); - goto cleanup; - } - - /* set the server handle into service handle */ - H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->session, 0, OCI_ATTR_SESSION, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_SESSION:"); - goto cleanup; - } - - dbh->methods = &oci_methods; - dbh->alloc_own_columns = 1; - dbh->native_case = PDO_CASE_UPPER; - - ret = 1; - -cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - if (!ret) { - oci_handle_closer(dbh TSRMLS_CC); - } - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_oci_driver = { - PDO_DRIVER_HEADER(oci), - pdo_oci_handle_factory -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c deleted file mode 100755 index 10a4d2f32508a..0000000000000 --- a/ext/pdo_oci/oci_statement.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" -#include "Zend/zend_extensions.h" - -#define STMT_CALL(name, params) \ - S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, __FILE__, __LINE__ TSRMLS_CC); \ - if (S->last_err) { \ - return 0; \ - } - -#define STMT_CALL_MSG(name, msg, params) \ - S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, __FILE__, __LINE__ TSRMLS_CC); \ - if (S->last_err) { \ - return 0; \ - } - - -static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - HashTable *BC = stmt->bound_columns; - HashTable *BP = stmt->bound_params; - - int i; - - if (S->stmt) { - /* cancel server side resources for the statement if we didn't - * fetch it all */ - OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); - - /* free the handle */ - OCIHandleFree(S->stmt, OCI_HTYPE_STMT); - S->stmt = NULL; - } - if (S->err) { - OCIHandleFree(S->err, OCI_HTYPE_ERROR); - S->err = NULL; - } - - /* need to ensure these go away now */ - if (BC) { - zend_hash_destroy(BC); - FREE_HASHTABLE(stmt->bound_columns); - stmt->bound_columns = NULL; - } - - if (BP) { - zend_hash_destroy(BP); - FREE_HASHTABLE(stmt->bound_params); - stmt->bound_params = NULL; - } - - if (S->einfo.errmsg) { - efree(S->einfo.errmsg); - S->einfo.errmsg = NULL; - } - - if (S->cols) { - for (i = 0; i < stmt->column_count; i++) { - if (S->cols[i].data) { - efree(S->cols[i].data); - } - } - efree(S->cols); - S->cols = NULL; - } - efree(S); - - stmt->driver_data = NULL; - - return 1; -} /* }}} */ - -static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - ub4 rowcount; - b4 mode; - - if (!S->stmt_type) { - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_STMT_TYPE", - (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0, OCI_ATTR_STMT_TYPE, S->err)); - } - - if (stmt->executed) { - /* ensure that we cancel the cursor from a previous fetch */ - OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); - } - -#ifdef OCI_STMT_SCROLLABLE_READONLY /* needed for oci8 ? */ - if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) { - mode = OCI_STMT_SCROLLABLE_READONLY; - } else -#endif - if (stmt->dbh->auto_commit && !stmt->dbh->in_txn) { - mode = OCI_COMMIT_ON_SUCCESS; - } else { - mode = OCI_DEFAULT; - } - - STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err, - S->stmt_type == OCI_STMT_SELECT ? 0 : 1, 0, NULL, NULL, - mode)); - - if (!stmt->executed) { - ub4 colcount; - /* do first-time-only definition of bind/mapping stuff */ - - /* how many columns do we have ? */ - STMT_CALL_MSG(OCIAttrGet, "ATTR_PARAM_COUNT", - (S->stmt, OCI_HTYPE_STMT, &colcount, 0, OCI_ATTR_PARAM_COUNT, S->err)); - - stmt->column_count = (int)colcount; - - S->cols = ecalloc(colcount, sizeof(pdo_oci_column)); - } - - STMT_CALL_MSG(OCIAttrGet, "ATTR_ROW_COUNT", - (S->stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, S->err)); - stmt->row_count = (long)rowcount; - - return 1; -} /* }}} */ - -static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) /* {{{ */ -{ - struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; - pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - TSRMLS_FETCH(); - - if (!param || !param->parameter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen"); - return OCI_ERROR; - } - - *indpp = &P->indicator; - - if (ZVAL_IS_NULL(param->parameter)) { - /* insert a NULL value into the column */ - P->indicator = -1; /* NULL */ - *bufpp = 0; - *alenp = -1; - } else if (!P->thing) { - /* regular string bind */ - convert_to_string(param->parameter); - *bufpp = Z_STRVAL_P(param->parameter); - *alenp = Z_STRLEN_P(param->parameter); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "P->thing should not be set??"); - return OCI_ERROR; - } - - *piecep = OCI_ONE_PIECE; - return OCI_CONTINUE; -} /* }}} */ - -static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) /* {{{ */ -{ - struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; - pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - TSRMLS_FETCH(); - - if (!param || !param->parameter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen"); - return OCI_ERROR; - } - - if (Z_TYPE_P(param->parameter) == IS_OBJECT || Z_TYPE_P(param->parameter) == IS_RESOURCE) { - return OCI_CONTINUE; - } - - convert_to_string(param->parameter); - zval_dtor(param->parameter); - - Z_STRLEN_P(param->parameter) = param->max_value_len; - Z_STRVAL_P(param->parameter) = emalloc(Z_STRLEN_P(param->parameter)+1); - P->used_for_output = 1; - - P->actual_len = Z_STRLEN_P(param->parameter); - *alenpp = &P->actual_len; - *bufpp = Z_STRVAL_P(param->parameter); - *piecep = OCI_ONE_PIECE; - *rcodepp = &P->retcode; - *indpp = &P->indicator; - - return OCI_CONTINUE; -} /* }}} */ - -static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - - /* we're only interested in parameters for prepared SQL right now */ - if (param->is_param) { - pdo_oci_bound_param *P; - sb4 value_sz = -1; - - P = (pdo_oci_bound_param*)param->driver_data; - - switch (event_type) { - case PDO_PARAM_EVT_FREE: - P = param->driver_data; - if (P) { - efree(P); - } - break; - - case PDO_PARAM_EVT_ALLOC: - P = (pdo_oci_bound_param*)ecalloc(1, sizeof(pdo_oci_bound_param)); - param->driver_data = P; - - /* figure out what we're doing */ - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_LOB: - case PDO_PARAM_STMT: - return 0; - - case PDO_PARAM_STR: - default: - P->oci_type = SQLT_CHR; - value_sz = param->max_value_len + 1; - if (param->max_value_len == 0) { - value_sz = 4000; /* maximum size before value is interpreted as a LONG value */ - } - - } - - if (param->name) { - STMT_CALL(OCIBindByName, (S->stmt, - &P->bind, S->err, (text*)param->name, - param->namelen, 0, value_sz, P->oci_type, - &P->indicator, 0, &P->retcode, 0, 0, - OCI_DATA_AT_EXEC)); - } else { - STMT_CALL(OCIBindByPos, (S->stmt, - &P->bind, S->err, param->paramno+1, - 0, value_sz, P->oci_type, - &P->indicator, 0, &P->retcode, 0, 0, - OCI_DATA_AT_EXEC)); - } - - STMT_CALL(OCIBindDynamic, (P->bind, - S->err, - param, oci_bind_input_cb, - param, oci_bind_output_cb)); - - return 1; - - case PDO_PARAM_EVT_EXEC_PRE: - P->indicator = 0; - P->used_for_output = 0; - return 1; - - case PDO_PARAM_EVT_EXEC_POST: - /* fixup stuff set in motion in oci_bind_output_cb */ - if (P->used_for_output) { - if (P->indicator == -1) { - /* set up a NULL value */ - if (Z_TYPE_P(param->parameter) == IS_STRING -#if ZEND_EXTENSION_API_NO < 220040718 - && Z_STRVAL_P(param->parameter) != empty_string -#endif - ) { - /* OCI likes to stick non-terminated strings in things */ - *Z_STRVAL_P(param->parameter) = '\0'; - } - zval_dtor(param->parameter); - ZVAL_NULL(param->parameter); - } else if (Z_TYPE_P(param->parameter) == IS_STRING -#if ZEND_EXTENSION_API_NO < 220040718 - && Z_STRVAL_P(param->parameter) != empty_string -#endif - ) { - Z_STRLEN_P(param->parameter) = P->actual_len; - Z_STRVAL_P(param->parameter) = erealloc(Z_STRVAL_P(param->parameter), P->actual_len+1); - Z_STRVAL_P(param->parameter)[P->actual_len] = '\0'; - } - } - - return 1; - } - } - - return 1; -} /* }}} */ - -static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */ -{ -#if HAVE_OCISTMTFETCH2 - ub4 ociori; -#endif - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - -#if HAVE_OCISTMTFETCH2 - switch (ori) { - case PDO_FETCH_ORI_NEXT: ociori = OCI_FETCH_NEXT; break; - case PDO_FETCH_ORI_PRIOR: ociori = OCI_FETCH_PRIOR; break; - case PDO_FETCH_ORI_FIRST: ociori = OCI_FETCH_FIRST; break; - case PDO_FETCH_ORI_LAST: ociori = OCI_FETCH_LAST; break; - case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE; break; - case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE; break; - } - S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset, OCI_DEFAULT); -#else - S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT); -#endif - - if (S->last_err == OCI_NO_DATA) { - /* no (more) data */ - return 0; - } - - if (S->last_err == OCI_NEED_DATA) { - oci_stmt_error("OCI_NEED_DATA"); - return 0; - } - - if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS) { - return 1; - } - - oci_stmt_error("OCIStmtFetch"); - - return 0; -} /* }}} */ - -static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - OCIParam *param = NULL; - text *colname; - ub2 dtype, data_size, scale, precis; - ub4 namelen; - struct pdo_column_data *col = &stmt->columns[colno]; - zend_bool dyn = FALSE; - - /* describe the column */ - STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1)); - - /* what type ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE", - (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); - - /* how big ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE", - (param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err)); - - /* scale ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE", - (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err)); - - /* precision ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION", - (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); - - /* name ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME", - (param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err)); - - col->precision = scale; - col->maxlen = data_size; - col->namelen = namelen; - col->name = estrndup(colname, namelen); - - /* how much room do we need to store the field */ - switch (dtype) { - case SQLT_BIN: - default: - dyn = FALSE; - if (dtype == SQLT_DAT || dtype == SQLT_NUM -#ifdef SQLT_TIMESTAMP - || dtype == SQLT_TIMESTAMP -#endif -#ifdef SQLT_TIMESTAMP_TZ - || dtype == SQLT_TIMESTAMP_TZ -#endif - ) { - /* should be big enough for most date formats and numbers */ - S->cols[colno].datalen = 512; - } else { - S->cols[colno].datalen = col->maxlen; - } - if (dtype == SQLT_BIN) { - S->cols[colno].datalen *= 3; - } - S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); - dtype = SQLT_CHR; - - /* returning data as a string */ - col->param_type = PDO_PARAM_STR; - } - - if (!dyn) { - STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def, S->err, colno+1, - S->cols[colno].data, S->cols[colno].datalen, dtype, &S->cols[colno].indicator, - &S->cols[colno].fetched_len, &S->cols[colno].retcode, OCI_DEFAULT)); - } - - return 1; -} /* }}} */ - -static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - pdo_oci_column *C = &S->cols[colno]; - - /* check the indicator to ensure that the data is intact */ - if (C->indicator == -1) { - /* A NULL value */ - *ptr = NULL; - *len = 0; - return 1; - } else if (C->indicator == 0) { - /* it was stored perfectly */ - *ptr = C->data; - *len = C->fetched_len; - return 1; - } else { - /* it was truncated */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno); - - *ptr = C->data; - *len = C->fetched_len; - return 1; - } -} /* }}} */ - -struct pdo_stmt_methods oci_stmt_methods = { - oci_stmt_dtor, - oci_stmt_execute, - oci_stmt_fetch, - oci_stmt_describe, - oci_stmt_get_col, - oci_stmt_param_hook -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_oci/package.xml b/ext/pdo_oci/package.xml deleted file mode 100755 index 4702c5f06ac9c..0000000000000 --- a/ext/pdo_oci/package.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_OCI</name> - <summary>Oracle Call Interface driver for PDO</summary> - <maintainers> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> - This extension provides an Oracle driver for PDO. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - You need to install the PDO core module before you can make use of this one. - You also require Oracle OCI 8 or higher client libraries installed on the machine where you intend to build and/or use it. - - If you are running on windows, you can download the binary from here: - http://snaps.php.net/win32/PECL_5_0/php_pdo_oci.dll - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="pdo_oci.c"/> - <file role="src" name="oci_driver.c"/> - <file role="src" name="oci_statement.c"/> - <file role="src" name="php_pdo_oci.h"/> - <file role="src" name="php_pdo_oci_int.h"/> - - <file role="doc" name="CREDITS"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" rel="ge" name="pdo" version="0.9"/> - </deps> - </release> -</package> diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c deleted file mode 100755 index 5e5e873d5cdfc..0000000000000 --- a/ext/pdo_oci/pdo_oci.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" - -/* {{{ pdo_oci_functions[] */ -function_entry pdo_oci_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_oci_module_entry */ - -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_oci_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif - -zend_module_entry pdo_oci_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_oci_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "PDO_OCI", - pdo_oci_functions, - PHP_MINIT(pdo_oci), - PHP_MSHUTDOWN(pdo_oci), - NULL, - NULL, - PHP_MINFO(pdo_oci), - "0.9", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_OCI -ZEND_GET_MODULE(pdo_oci) -#endif - -const ub4 PDO_OCI_INIT_MODE = -#if 0 && defined(OCI_SHARED) - /* shared mode is known to be bad for PHP */ - OCI_SHARED -#else - OCI_DEFAULT -#endif -#ifdef OCI_OBJECT - |OCI_OBJECT -#endif -#ifdef ZTS - |OCI_THREADED -#endif - ; - -/* true global environment */ -OCIEnv *pdo_oci_Env = NULL; - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pdo_oci) -{ - php_pdo_register_driver(&pdo_oci_driver); - -#if HAVE_OCIENVCREATE - OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL); -#else - OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL); - OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_oci) -{ - php_pdo_unregister_driver(&pdo_oci_driver); - OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_oci) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for OCI 8 and later", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h deleted file mode 100755 index 7e37c3e60cede..0000000000000 --- a/ext/pdo_oci/php_pdo_oci.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_OCI_H -#define PHP_PDO_OCI_H - -extern zend_module_entry pdo_oci_module_entry; -#define phpext_pdo_oci_ptr &pdo_oci_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_OCI_API __declspec(dllexport) -#else -#define PHP_PDO_OCI_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_oci); -PHP_MSHUTDOWN_FUNCTION(pdo_oci); -PHP_RINIT_FUNCTION(pdo_oci); -PHP_RSHUTDOWN_FUNCTION(pdo_oci); -PHP_MINFO_FUNCTION(pdo_oci); - -#endif /* PHP_PDO_OCI_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h deleted file mode 100755 index a28d466eacdd2..0000000000000 --- a/ext/pdo_oci/php_pdo_oci_int.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include <oci.h> - -typedef struct { - const char *file; - int line; - sb4 errcode; - char *errmsg; -} pdo_oci_error_info; - -/* stuff we use in an OCI database handle */ -typedef struct { - OCIServer *server; - OCISession *session; - OCIEnv *env; - OCIError *err; - OCISvcCtx *svc; - /* OCI9; 0 == use NLS_LANG */ - ub2 charset; - sword last_err; - - unsigned attached:1; - unsigned _reserved:31; - - pdo_oci_error_info einfo; -} pdo_oci_db_handle; - -typedef struct { - OCIDefine *def; - ub2 fetched_len; - ub2 retcode; - sb2 indicator; - - char *data; - unsigned long datalen; - -} pdo_oci_column; - -typedef struct { - pdo_oci_db_handle *H; - OCIStmt *stmt; - OCIError *err; - sword last_err; - ub2 stmt_type; - ub4 exec_type; - pdo_oci_column *cols; - pdo_oci_error_info einfo; -} pdo_oci_stmt; - -typedef struct { - OCIBind *bind; /* allocated by OCI */ - sb2 oci_type; - sb2 indicator; - ub2 retcode; - - ub4 actual_len; - - dvoid *thing; /* for LOBS, REFCURSORS etc. */ - - unsigned used_for_output; -} pdo_oci_bound_param; - -extern const ub4 PDO_OCI_INIT_MODE; -extern pdo_driver_t pdo_oci_driver; -extern OCIEnv *pdo_oci_Env; - -ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, const char *file, int line TSRMLS_DC); -#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, __FILE__, __LINE__ TSRMLS_CC) -#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods oci_stmt_methods; - diff --git a/ext/pdo_oci/tests/common.phpt b/ext/pdo_oci/tests/common.phpt deleted file mode 100644 index 413b57bbf2c9a..0000000000000 --- a/ext/pdo_oci/tests/common.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -OCI ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_oci')) print 'skip'; ?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - - -if (false !== getenv('PDO_OCI_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_OCI_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_OCI_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_OCI_TEST_PASS'); - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_OCI_TEST_ATTR'); -} else { - $config['ENV']['PDOTEST_DSN'] = 'oci:dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'SYSTEM'; - $config['ENV']['PDOTEST_PASS'] = 'PASSWORD'; -} - -return $config; diff --git a/ext/pdo_odbc/CREDITS b/ext/pdo_odbc/CREDITS deleted file mode 100755 index b5af9df356b8a..0000000000000 --- a/ext/pdo_odbc/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ODBC driver for PDO -Wez Furlong diff --git a/ext/pdo_odbc/EXPERIMENTAL b/ext/pdo_odbc/EXPERIMENTAL deleted file mode 100644 index 139597f9cb07c..0000000000000 --- a/ext/pdo_odbc/EXPERIMENTAL +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4 deleted file mode 100755 index 25ce0811c5950..0000000000000 --- a/ext/pdo_odbc/config.m4 +++ /dev/null @@ -1,169 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension pdo_odbc -dnl vim:et:sw=2:ts=2: - -if test "$PHP_PDO" != "no"; then - -define([PDO_ODBC_HELP_TEXT],[[ - include and lib dirs are looked for under 'dir'. - - 'flavour' can be one of: ibm-db2, unixODBC, generic - If ',dir' part is omitted, default for the flavour - you have selected will used. e.g.: - - --with-pdo-odbc=unixODBC - - will check for unixODBC under /usr/local. You may attempt - to use an otherwise unsupported driver using the \"generic\" - flavour. The syntax for generic ODBC support is: - - --with-pdo-odbc=generic,dir,libname,ldflags,cflags - - This extension will always be created as a shared extension - named pdo_odbc.so]]) - -PHP_ARG_WITH(pdo-odbc, for ODBC v3 support for PDO, -[ --with-pdo-odbc=flavour,dir - PDO: Support for 'flavour' ODBC driver.]PDO_ODBC_HELP_TEXT) - - -AC_DEFUN([PDO_ODBC_CHECK_HEADER],[ - AC_MSG_CHECKING([for $1 in $PDO_ODBC_INCDIR]) - if test -f "$PDO_ODBC_INCDIR/$1"; then - php_pdo_have_header=yes - PHP_DEF_HAVE(translit($1,.,_)) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -]) - -if test "$PHP_PDO_ODBC" != "no"; then - - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - AC_MSG_CHECKING([for selected PDO ODBC flavour]) - - pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`" - pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`" - - if test "$pdo_odbc_dir" = "$PHP_PDO_ODBC" ; then - pdo_odbc_dir= - fi - - case $pdo_odbc_flavour in - ibm-db2) - pdo_odbc_def_libdir=/home/db2inst1/sqllib/lib - pdo_odbc_def_incdir=/home/db2inst1/sqllib/include - pdo_odbc_def_lib=db2 - ;; - - unixODBC|unixodbc) - pdo_odbc_def_libdir=/usr/local/lib - pdo_odbc_def_incdir=/usr/local/include - pdo_odbc_def_lib=odbc - ;; - - ODBCRouter|odbcrouter) - pdo_odbc_def_libdir=/usr/lib - pdo_odbc_def_incdir=/usr/include - pdo_odbc_def_lib=odbcsdk - ;; - - generic) - pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`" - pdo_odbc_def_ldflags="`echo $PHP_PDO_ODBC | cut -d, -f4`" - pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f5`" - pdo_odbc_flavour="$pdo_odbc_flavour ($pdo_odbc_def_lib)" - ;; - - *) - AC_MSG_ERROR([Unknown ODBC flavour $pdo_odbc_flavour]PDO_ODBC_HELP_TEXT) - ;; - esac - - if test -n "$pdo_odbc_dir"; then - PDO_ODBC_INCDIR="$pdo_odbc_dir/include" - PDO_ODBC_LIBDIR="$pdo_odbc_dir/lib" - else - PDO_ODBC_INCDIR="$pdo_odbc_def_incdir" - PDO_ODBC_LIBDIR="$pdo_odbc_def_libdir" - fi - - AC_MSG_RESULT([$pdo_odbc_flavour - libs $PDO_ODBC_LIBDIR, - headers $PDO_ODBC_INCDIR]) - - if test ! -d "$PDO_ODBC_LIBDIR" ; then - AC_MSG_WARN([library dir $PDO_ODBC_LIBDIR does not exist]) - fi - - PDO_ODBC_CHECK_HEADER(odbc.h) - PDO_ODBC_CHECK_HEADER(odbcsdk.h) - PDO_ODBC_CHECK_HEADER(iodbc.h) - PDO_ODBC_CHECK_HEADER(sqlunix.h) - PDO_ODBC_CHECK_HEADER(sqltypes.h) - PDO_ODBC_CHECK_HEADER(sqlucode.h) - PDO_ODBC_CHECK_HEADER(sql.h) - PDO_ODBC_CHECK_HEADER(isql.h) - PDO_ODBC_CHECK_HEADER(sqlext.h) - PDO_ODBC_CHECK_HEADER(isqlext.h) - PDO_ODBC_CHECK_HEADER(udbcext.h) - PDO_ODBC_CHECK_HEADER(sqlcli1.h) - PDO_ODBC_CHECK_HEADER(LibraryManager.h) - PDO_ODBC_CHECK_HEADER(cli0core.h) - PDO_ODBC_CHECK_HEADER(cli0ext.h) - PDO_ODBC_CHECK_HEADER(cli0cli.h) - PDO_ODBC_CHECK_HEADER(cli0defs.h) - PDO_ODBC_CHECK_HEADER(cli0env.h) - - if test "$php_pdo_have_header" != "yes"; then - AC_MSG_ERROR([Cannot find header file(s) for pdo_odbc]) - fi - - PDO_ODBC_INCLUDE="$pdo_odbc_def_cflags -I$PDO_ODBC_INCDIR -DPDO_ODBC_TYPE=\\\"$pdo_odbc_flavour\\\"" - PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags -L$PDO_ODBC_LIBDIR -l$pdo_odbc_def_lib" - - PHP_EVAL_LIBLINE([$PDO_ODBC_LDFLAGS], [PDO_ODBC_SHARED_LIBADD]) - - dnl Check first for an ODBC 1.0 function to assert that the libraries work - PHP_CHECK_LIBRARY($pdo_odbc_def_lib, SQLBindCol, - [ - dnl And now check for an ODBC 3.0 function to assert that they're - dnl *good* libraries. - PHP_CHECK_LIBRARY($pdo_odbc_def_lib, SQLAllocHandle, - [], [ - AC_MSG_ERROR([ -Your ODBC library does not appear to be ODBC 3 compatible. -You should consider using unixODBC instead, and loading your -libraries as a driver in that environment; it will emulate the -functions required for PDO support. -])], $PDO_ODBC_LDFLAGS) - ],[ - AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information]) - ], $PDO_ODBC_LDFLAGS) - - PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE) - PHP_SUBST(PDO_ODBC_SHARED_LIBADD) - ifdef([PHP_ADD_EXTENDION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_odbc, pdo) - ]) -fi - -fi diff --git a/ext/pdo_odbc/config.w32 b/ext/pdo_odbc/config.w32 deleted file mode 100755 index d7cc443f17ae2..0000000000000 --- a/ext/pdo_odbc/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-odbc", "ODBC support for PDO", "no"); - -if (PHP_PDO_ODBC != "no") { - if (CHECK_LIB("odbc32.lib", "pdo_odbc") && CHECK_LIB("odbccp32.lib", "pdo_odbc")) { - EXTENSION("pdo_odbc", "pdo_odbc.c odbc_driver.c odbc_stmt.c"); - CHECK_HEADER_ADD_INCLUDE('sql.h', 'CFLAGS_PDO_ODBC'); - CHECK_HEADER_ADD_INCLUDE('sqlext.h', 'CFLAGS_PDO_ODBC'); - ADD_FLAG('CFLAGS_PDO_ODBC', "/I ..\\pecl"); - } - ADD_EXTENSION_DEP('pdo_odbc', 'pdo'); -} - diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c deleted file mode 100755 index 4952c1aa62426..0000000000000 --- a/ext/pdo_odbc/odbc_driver.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_odbc.h" -#include "php_pdo_odbc_int.h" -#include "zend_exceptions.h" - -static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - pdo_odbc_errinfo *einfo = &H->einfo; - pdo_odbc_stmt *S = NULL; - char *message = NULL; - - if (stmt) { - S = (pdo_odbc_stmt*)stmt->driver_data; - einfo = &S->einfo; - } - - spprintf(&message, 0, "%s (%s[%ld] at %s:%d)", - einfo->last_err_msg, - einfo->what, einfo->last_error, - einfo->file, einfo->line); - - add_next_index_long(info, einfo->last_error); - add_next_index_string(info, message, 0); - add_next_index_string(info, einfo->last_state, 1); - - return 1; -} - - -void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - RETCODE rc; - SWORD errmsgsize; - pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data; - pdo_odbc_errinfo *einfo = &H->einfo; - pdo_odbc_stmt *S = NULL; - pdo_error_type *pdo_err = &dbh->error_code; - - if (stmt) { - S = (pdo_odbc_stmt*)stmt->driver_data; - - einfo = &S->einfo; - pdo_err = &stmt->error_code; - } - - if (statement == SQL_NULL_HSTMT && S) { - statement = S->stmt; - } - - rc = SQLError(H->env, H->dbc, statement, einfo->last_state, &einfo->last_error, - einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize); - - einfo->last_err_msg[errmsgsize] = '\0'; - einfo->file = file; - einfo->line = line; - einfo->what = what; - - strcpy(*pdo_err, einfo->last_state); -/* printf("@@ SQLSTATE[%s] %s\n", *pdo_err, einfo->last_err_msg); */ - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] %s: %d %s", - *pdo_err, what, einfo->last_error, einfo->last_err_msg); - } -} -/* }}} */ - -static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data; - - if (H->dbc != SQL_NULL_HANDLE) { - SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_ROLLBACK); - SQLDisconnect(H->dbc); - SQLFreeHandle(SQL_HANDLE_DBC, H->dbc); - H->dbc = NULL; - } - SQLFreeHandle(SQL_HANDLE_ENV, H->env); - H->env = NULL; - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - - return 0; -} - -static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - RETCODE rc; - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - pdo_odbc_stmt *S = ecalloc(1, sizeof(*S)); - enum pdo_cursor_type cursor_type = PDO_CURSOR_FWDONLY; - int ret; - char *nsql = NULL; - int nsql_len = 0; - - S->H = H; - - /* before we prepare, we need to peek at the query; if it uses named parameters, - * we want PDO to rewrite them for us */ - stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL; - ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC); - - if (ret == 1) { - /* query was re-written */ - sql = nsql; - } else if (ret == -1) { - /* couldn't grok it */ - strcpy(dbh->error_code, stmt->error_code); - efree(S); - return 0; - } - - rc = SQLAllocHandle(SQL_HANDLE_STMT, H->dbc, &S->stmt); - - if (rc == SQL_INVALID_HANDLE || rc == SQL_ERROR) { - efree(S); - if (nsql) { - efree(nsql); - } - pdo_odbc_drv_error("SQLAllocStmt"); - return 0; - } - - cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC); - if (cursor_type != PDO_CURSOR_FWDONLY) { - rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_stmt_error("SQLSetStmtAttr: SQL_ATTR_CURSOR_SCROLLABLE"); - SQLFreeHandle(SQL_HANDLE_STMT, S->stmt); - if (nsql) { - efree(nsql); - } - return 0; - } - } - - rc = SQLPrepare(S->stmt, (char*)sql, SQL_NTS); - if (nsql) { - efree(nsql); - } - - if (rc != SQL_SUCCESS) { - pdo_odbc_stmt_error("SQLPrepare"); - } - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - SQLFreeHandle(SQL_HANDLE_STMT, S->stmt); - return 0; - } - - stmt->driver_data = S; - stmt->methods = &odbc_stmt_methods; - - return 1; -} - -static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - RETCODE rc; - long row_count = -1; - PDO_ODBC_HSTMT stmt; - - rc = SQLAllocHandle(SQL_HANDLE_STMT, H->dbc, &stmt); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLAllocHandle: STMT"); - return -1; - } - - rc = SQLExecDirect(stmt, (char *)sql, sql_len); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_doer_error("SQLExecDirect"); - goto out; - } - - rc = SQLRowCount(stmt, &row_count); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_doer_error("SQLRowCount"); - goto out; - } - if (row_count == -1) { - row_count = 0; - } -out: - SQLFreeHandle(SQL_HANDLE_STMT, stmt); - return row_count; -} - -static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - /* TODO: figure it out */ - return 0; -} - -static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) -{ - if (dbh->auto_commit) { - /* we need to disable auto-commit now, to be able to initiate a transaction */ - RETCODE rc; - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - - rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_OFF, SQL_IS_INTEGER); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = OFF"); - return 0; - } - } - return 1; -} - -static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - RETCODE rc; - - rc = SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_COMMIT); - - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLEndTran: Commit"); - - if (rc != SQL_SUCCESS_WITH_INFO) { - return 0; - } - } - - if (dbh->auto_commit) { - /* turn auto-commit back on again */ - rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_INTEGER); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = ON"); - return 0; - } - } - return 1; -} - -static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; - RETCODE rc; - - rc = SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_ROLLBACK); - - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLEndTran: Rollback"); - - if (rc != SQL_SUCCESS_WITH_INFO) { - return 0; - } - } - if (dbh->auto_commit && H->dbc) { - /* turn auto-commit back on again */ - rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_INTEGER); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = ON"); - return 0; - } - } - - return 1; -} - -static int odbc_handle_get_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) -{ - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - ZVAL_STRING(val, "ODBC-" PDO_ODBC_TYPE, 1); - return 1; - - case PDO_ATTR_SERVER_VERSION: - case PDO_ATTR_PREFETCH: - case PDO_ATTR_TIMEOUT: - case PDO_ATTR_SERVER_INFO: - case PDO_ATTR_CONNECTION_STATUS: - break; - - } - return 0; -} - -static struct pdo_dbh_methods odbc_methods = { - odbc_handle_closer, - odbc_handle_preparer, - odbc_handle_doer, - odbc_handle_quoter, - odbc_handle_begin, - odbc_handle_commit, - odbc_handle_rollback, - NULL, /* set attr */ - NULL, /* last id */ - pdo_odbc_fetch_error_func, - odbc_handle_get_attr, /* get attr */ - NULL, /* check_liveness */ -}; - -static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_odbc_db_handle *H; - RETCODE rc; - int use_direct = 0; - SQLUINTEGER cursor_lib; - - H = pecalloc(1, sizeof(*H), dbh->is_persistent); - - dbh->driver_data = H; - - SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &H->env); - rc = SQLSetEnvAttr(H->env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_drv_error("SQLSetEnvAttr: ODBC3"); - goto fail; - } - -#ifdef SQL_ATTR_CONNECTION_POOLING - if (pdo_odbc_pool_on != SQL_CP_OFF) { - rc = SQLSetEnvAttr(H->env, SQL_ATTR_CP_MATCH, (void*)pdo_odbc_pool_mode, 0); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLSetEnvAttr: SQL_ATTR_CP_MATCH"); - goto fail; - } - } -#endif - - rc = SQLAllocHandle(SQL_HANDLE_DBC, H->env, &H->dbc); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_drv_error("SQLAllocHandle (DBC)"); - goto fail; - } - - rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, - (SQLPOINTER)(dbh->auto_commit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF), SQL_IS_INTEGER); - if (rc != SQL_SUCCESS) { - pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT"); - goto fail; - } - - /* set up the cursor library, if needed, or if configured explicitly */ - cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC); - rc = SQLSetConnectAttr(H->dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, SQL_IS_INTEGER); - if (rc != SQL_SUCCESS && cursor_lib != SQL_CUR_USE_IF_NEEDED) { - pdo_odbc_drv_error("SQLSetConnectAttr SQL_ODBC_CURSORS"); - goto fail; - } - - if (strchr(dbh->data_source, ';')) { - char dsnbuf[1024]; - short dsnbuflen; - - use_direct = 1; - - /* Force UID and PWD to be set in the DSN */ - if (dbh->username && *dbh->username && !strstr(dbh->data_source, "uid") - && !strstr(dbh->data_source, "UID")) { - char *dsn = pemalloc(strlen(dbh->data_source) + strlen(dbh->username) + strlen(dbh->password) + sizeof(";UID=;PWD="), dbh->is_persistent); - sprintf(dsn, "%s;UID=%s;PWD=%s", dbh->data_source, dbh->username, dbh->password); - pefree((char*)dbh->data_source, dbh->is_persistent); - dbh->data_source = dsn; - } - - rc = SQLDriverConnect(H->dbc, NULL, (char*)dbh->data_source, strlen(dbh->data_source), - dsnbuf, sizeof(dsnbuf)-1, &dsnbuflen, SQL_DRIVER_NOPROMPT); - } - if (!use_direct) { - rc = SQLConnect(H->dbc, (char*)dbh->data_source, SQL_NTS, dbh->username, SQL_NTS, dbh->password, SQL_NTS); - } - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - pdo_odbc_drv_error(use_direct ? "SQLDriverConnect" : "SQLConnect"); - goto fail; - } - - /* TODO: if we want to play nicely, we should check to see if the driver really supports ODBC v3 or not */ - - dbh->methods = &odbc_methods; - dbh->alloc_own_columns = 1; - - return 1; - -fail: - dbh->methods = &odbc_methods; - return 0; -} -/* }}} */ - -pdo_driver_t pdo_odbc_driver = { - PDO_DRIVER_HEADER(odbc), - pdo_odbc_handle_factory -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c deleted file mode 100755 index 60bddb4383de8..0000000000000 --- a/ext/pdo_odbc/odbc_stmt.c +++ /dev/null @@ -1,612 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_odbc.h" -#include "php_pdo_odbc_int.h" - -static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC) -{ - if (S->cols) { - int i; - - for (i = 0; i < stmt->column_count; i++) { - if (S->cols[i].data) { - efree(S->cols[i].data); - } - } - efree(S->cols); - S->cols = NULL; - } -} - -static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - - if (S->stmt != SQL_NULL_HANDLE) { - if (stmt->executed) { - SQLCloseCursor(S->stmt); - } - SQLFreeHandle(SQL_HANDLE_STMT, S->stmt); - S->stmt = SQL_NULL_HANDLE; - } - - free_cols(stmt, S TSRMLS_CC); - - efree(S); - - return 1; -} - -static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - RETCODE rc; - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - char *buf = NULL; - - if (stmt->executed) { - SQLCloseCursor(S->stmt); - } - - rc = SQLExecute(S->stmt); - - while (rc == SQL_NEED_DATA) { - struct pdo_bound_param_data *param; - rc = SQLParamData(S->stmt, (SQLPOINTER*)¶m); - if (rc == SQL_NEED_DATA) { - php_stream *stm; - int len; - - if (Z_TYPE_P(param->parameter) != IS_RESOURCE) { - /* they passed in a string */ - convert_to_string(param->parameter); - SQLPutData(S->stmt, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter)); - continue; - } - - php_stream_from_zval_no_verify(stm, ¶m->parameter); - if (!stm) { - /* shouldn't happen either */ - pdo_odbc_stmt_error("input LOB is no longer a stream"); - SQLCloseCursor(S->stmt); - if (buf) { - efree(buf); - } - return 0; - } - - /* now suck data from the stream and stick it into the database */ - if (buf == NULL) { - buf = emalloc(8192); - } - - do { - len = php_stream_read(stm, buf, 8192); - if (len == 0) { - break; - } - SQLPutData(S->stmt, buf, len); - } while (1); - } - } - - if (buf) { - efree(buf); - } - - switch (rc) { - case SQL_SUCCESS: - break; - case SQL_NO_DATA_FOUND: - case SQL_SUCCESS_WITH_INFO: - pdo_odbc_stmt_error("SQLExecute"); - break; - - default: - pdo_odbc_stmt_error("SQLExecute"); - return 0; - } - - if (!stmt->executed) { - /* do first-time-only definition of bind/mapping stuff */ - SQLSMALLINT colcount; - - /* how many columns do we have ? */ - SQLNumResultCols(S->stmt, &colcount); - - stmt->column_count = (int)colcount; - S->cols = ecalloc(colcount, sizeof(pdo_odbc_column)); - } - - return 1; -} - -static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - RETCODE rc; - SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0; - UDWORD precision = 0; - pdo_odbc_param *P; - - /* we're only interested in parameters for prepared SQL right now */ - if (param->is_param) { - - switch (event_type) { - case PDO_PARAM_EVT_FREE: - P = param->driver_data; - if (P) { - efree(P); - } - break; - - case PDO_PARAM_EVT_ALLOC: - { - /* figure out what we're doing */ - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_LOB: - break; - - case PDO_PARAM_STMT: - return 0; - - default: - break; - } - - rc = SQLDescribeParam(S->stmt, param->paramno+1, &sqltype, &precision, &scale, &nullable); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - /* MS Access, for instance, doesn't support SQLDescribeParam, - * so we need to guess */ - sqltype = PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB ? - SQL_LONGVARBINARY : - SQL_LONGVARCHAR; - precision = 4000; - scale = 5; - nullable = 1; - - if (param->max_value_len > 0) { - precision = param->max_value_len; - } - } - if (sqltype == SQL_BINARY || sqltype == SQL_VARBINARY || sqltype == SQL_LONGVARBINARY) { - ctype = SQL_C_BINARY; - } else { - ctype = SQL_C_CHAR; - } - - P = emalloc(sizeof(*P)); - param->driver_data = P; - - P->len = 0; /* is re-populated each EXEC_PRE */ - P->outbuf = NULL; - - if ((param->param_type & PDO_PARAM_INPUT_OUTPUT) == PDO_PARAM_INPUT_OUTPUT) { - P->paramtype = SQL_PARAM_INPUT_OUTPUT; - } else if (param->max_value_len <= 0) { - P->paramtype = SQL_PARAM_INPUT; - } else { - P->paramtype = SQL_PARAM_OUTPUT; - } - - if (P->paramtype != SQL_PARAM_INPUT) { - if (PDO_PARAM_TYPE(param->param_type) != PDO_PARAM_NULL) { - /* need an explicit buffer to hold result */ - P->len = param->max_value_len > 0 ? param->max_value_len : precision; - P->outbuf = emalloc(P->len + 1); - } - } - - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB && P->paramtype != SQL_PARAM_INPUT) { - pdo_odbc_stmt_error("Can't bind a lob for output"); - return 0; - } - - rc = SQLBindParameter(S->stmt, param->paramno+1, - P->paramtype, ctype, sqltype, precision, scale, - P->paramtype == SQL_PARAM_INPUT ? - (SQLPOINTER)param : - P->outbuf, - P->len, - &P->len - ); - - if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - return 1; - } - pdo_odbc_stmt_error("SQLBindParameter"); - return 0; - } - - case PDO_PARAM_EVT_EXEC_PRE: - P = param->driver_data; - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) { - if (Z_TYPE_P(param->parameter) == IS_RESOURCE) { - php_stream *stm; - php_stream_statbuf sb; - - php_stream_from_zval_no_verify(stm, ¶m->parameter); - - if (!stm) { - return 0; - } - - if (0 == php_stream_stat(stm, &sb)) { - if (P->outbuf) { - int len, amount; - char *ptr = P->outbuf; - char *end = P->outbuf + P->len; - - P->len = 0; - do { - amount = end - ptr; - if (amount == 0) { - break; - } - if (amount > 8192) - amount = 8192; - len = php_stream_read(stm, ptr, amount); - if (len == 0) { - break; - } - ptr += len; - P->len += len; - } while (1); - - } else { - P->len = SQL_LEN_DATA_AT_EXEC(sb.sb.st_size); - } - } else { - if (P->outbuf) { - P->len = 0; - } else { - P->len = SQL_LEN_DATA_AT_EXEC(0); - } - } - } else { - convert_to_string(param->parameter); - if (P->outbuf) { - P->len = Z_STRLEN_P(param->parameter); - memcpy(P->outbuf, Z_STRVAL_P(param->parameter), P->len); - } else { - P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(param->parameter)); - } - } - } else if (Z_TYPE_P(param->parameter) == IS_NULL || PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL) { - P->len = SQL_NULL_DATA; - } else { - convert_to_string(param->parameter); - if (P->outbuf) { - P->len = Z_STRLEN_P(param->parameter); - memcpy(P->outbuf, Z_STRVAL_P(param->parameter), P->len); - } else { - P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(param->parameter)); - } - } - return 1; - - case PDO_PARAM_EVT_EXEC_POST: - P = param->driver_data; - if (P->outbuf) { - switch (P->len) { - case SQL_NULL_DATA: - zval_dtor(param->parameter); - ZVAL_NULL(param->parameter); - break; - default: - convert_to_string(param->parameter); - Z_STRVAL_P(param->parameter) = erealloc(Z_STRVAL_P(param->parameter), P->len+1); - memcpy(Z_STRVAL_P(param->parameter), P->outbuf, P->len); - Z_STRLEN_P(param->parameter) = P->len; - Z_STRVAL_P(param->parameter)[P->len] = '\0'; - } - } - return 1; - } - } - return 1; -} - -static int odbc_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - RETCODE rc; - SQLSMALLINT odbcori; - - switch (ori) { - case PDO_FETCH_ORI_NEXT: odbcori = SQL_FETCH_NEXT; break; - case PDO_FETCH_ORI_PRIOR: odbcori = SQL_FETCH_PRIOR; break; - case PDO_FETCH_ORI_FIRST: odbcori = SQL_FETCH_FIRST; break; - case PDO_FETCH_ORI_LAST: odbcori = SQL_FETCH_LAST; break; - case PDO_FETCH_ORI_ABS: odbcori = SQL_FETCH_ABSOLUTE; break; - case PDO_FETCH_ORI_REL: odbcori = SQL_FETCH_RELATIVE; break; - default: - strcpy(stmt->error_code, "HY106"); - return 0; - } - rc = SQLFetchScroll(S->stmt, odbcori, offset); - - if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - pdo_odbc_stmt_error("SQLFetchScroll"); - return 1; - } - - if (rc == SQL_NO_DATA) { - /* pdo_odbc_stmt_error("SQLFetchScroll"); */ - return 0; - } - - pdo_odbc_stmt_error("SQLFetchScroll"); - - return 0; -} - -static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - struct pdo_column_data *col = &stmt->columns[colno]; - zend_bool dyn = FALSE; - RETCODE rc; - SWORD colnamelen; - SDWORD colsize; - - rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname, - sizeof(S->cols[colno].colname)-1, &colnamelen, - &S->cols[colno].coltype, &colsize, NULL, NULL); - - if (rc != SQL_SUCCESS) { - pdo_odbc_stmt_error("SQLBindCol"); - return 0; - } - - col->maxlen = S->cols[colno].datalen = colsize; - col->namelen = colnamelen; - col->name = estrdup(S->cols[colno].colname); - - /* returning data as a string */ - col->param_type = PDO_PARAM_STR; - - /* tell ODBC to put it straight into our buffer, but only if it - * isn't "long" data */ - if (colsize < 256) { - S->cols[colno].data = emalloc(colsize+1); - - rc = SQLBindCol(S->stmt, colno+1, SQL_C_CHAR, S->cols[colno].data, - S->cols[colno].datalen+1, &S->cols[colno].fetched_len); - - if (rc != SQL_SUCCESS) { - pdo_odbc_stmt_error("SQLBindCol"); - return 0; - } - } else { - /* allocate a smaller buffer to keep around for smaller - * "long" columns */ - S->cols[colno].data = emalloc(256); - } - - return 1; -} - -static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - pdo_odbc_column *C = &S->cols[colno]; - - /* if it is a column containing "long" data, perform late binding now */ - if (C->datalen > 255) { - unsigned long alloced = 4096; - unsigned long used = 0; - char *buf; - RETCODE rc; - - /* fetch it into C->data, which is allocated with a length - * of 256 bytes; if there is more to be had, we then allocate - * bigger buffer for the caller to free */ - - rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, C->data, - 256, &C->fetched_len); - - if (rc == SQL_SUCCESS) { - /* all the data fit into our little buffer; - * jump down to the generic bound data case */ - goto in_data; - } - - if (rc == SQL_SUCCESS_WITH_INFO) { - /* promote up to a bigger buffer */ - - if (C->fetched_len != SQL_NO_TOTAL) { - /* use size suggested by the driver, if it knows it */ - alloced = C->fetched_len + 1; - } - - buf = emalloc(alloced); - memcpy(buf, C->data, 256); - used = 255; /* not 256; the driver NUL terminated the buffer */ - - do { - C->fetched_len = 0; - rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, - buf + used, alloced - used, - &C->fetched_len); - - if (rc == SQL_NO_DATA) { - /* we got the lot */ - break; - } - - if (C->fetched_len == SQL_NO_TOTAL) { - used += alloced - used; - } else { - used += C->fetched_len; - } - - /* we need to fetch another chunk; resize the - * buffer */ - alloced *= 2; - buf = erealloc(buf, alloced); - } while (1); - - /* size down */ - if (used < alloced - 1024) { - alloced = used+1; - buf = erealloc(buf, used+1); - } - buf[used] = '\0'; - *ptr = buf; - *caller_frees = 1; - *len = used; - return 1; - } - - /* something went caca */ - *ptr = NULL; - *len = 0; - return 1; - } - -in_data: - /* check the indicator to ensure that the data is intact */ - if (C->fetched_len == SQL_NULL_DATA) { - /* A NULL value */ - *ptr = NULL; - *len = 0; - return 1; - } else if (C->fetched_len >= 0) { - /* it was stored perfectly */ - *ptr = C->data; - *len = C->fetched_len; - return 1; - } else { - /* no data? */ - *ptr = NULL; - *len = 0; - return 1; - } -} - -static int odbc_stmt_set_param(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) -{ - SQLRETURN rc; - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - - switch (attr) { - case PDO_ATTR_CURSOR_NAME: - convert_to_string(val); - rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRLEN_P(val)); - - if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - return 1; - } - pdo_odbc_stmt_error("SQLSetCursorName"); - return 0; - - default: - strcpy(S->einfo.last_err_msg, "Unknown Attribute"); - S->einfo.what = "setAttribute"; - strcpy(S->einfo.last_state, "IM0001"); - return -1; - } -} - -static int odbc_stmt_get_attr(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) -{ - SQLRETURN rc; - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - - switch (attr) { - case PDO_ATTR_CURSOR_NAME: - { - char buf[256]; - SQLSMALLINT len = 0; - rc = SQLGetCursorName(S->stmt, buf, sizeof(buf), &len); - - if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - ZVAL_STRINGL(val, buf, len, 1); - return 1; - } - pdo_odbc_stmt_error("SQLGetCursorName"); - return 0; - } - - default: - strcpy(S->einfo.last_err_msg, "Unknown Attribute"); - S->einfo.what = "getAttribute"; - strcpy(S->einfo.last_state, "IM0001"); - return -1; - } -} - -static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) -{ - SQLRETURN rc; - SQLSMALLINT colcount; - pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; - - /* NOTE: can't guarantee that output or input/output parameters - * are set until this fella returns SQL_NO_DATA, according to - * MSDN ODBC docs */ - rc = SQLMoreResults(S->stmt); - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - return 0; - } - - free_cols(stmt, S TSRMLS_CC); - /* how many columns do we have ? */ - SQLNumResultCols(S->stmt, &colcount); - stmt->column_count = (int)colcount; - S->cols = ecalloc(colcount, sizeof(pdo_odbc_column)); - - return 1; -} - -struct pdo_stmt_methods odbc_stmt_methods = { - odbc_stmt_dtor, - odbc_stmt_execute, - odbc_stmt_fetch, - odbc_stmt_describe, - odbc_stmt_get_col, - odbc_stmt_param_hook, - odbc_stmt_set_param, - odbc_stmt_get_attr, /* get attr */ - NULL, /* get column meta */ - odbc_stmt_next_rowset -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_odbc/package.xml b/ext/pdo_odbc/package.xml deleted file mode 100755 index a25b04cc50f81..0000000000000 --- a/ext/pdo_odbc/package.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_ODBC</name> - <summary>ODBC v3 Interface driver for PDO</summary> - <maintainers> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <configureoptions> - <configureoption name="with-pdo-odbc" prompt="flavour,dir? (just leave blank for help)"/> -</configureoptions> - <description> - This extension provides an ODBC v3 driver for PDO. It supports unixODBC - and IBM DB2 libraries, and will support more in future releases. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - You need to install the PDO core module before you can make use of this one. - You also require either IBM DB2 CLI libraries or unixODBC. - - If you are running on windows, you can download the binary from here: - http://snaps.php.net/win32/PECL_5_0/php_pdo_odbc.dll - - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="pdo_odbc.c"/> - <file role="src" name="odbc_driver.c"/> - <file role="src" name="odbc_stmt.c"/> - <file role="src" name="php_pdo_odbc.h"/> - <file role="src" name="php_pdo_odbc_int.h"/> - - <file role="doc" name="CREDITS"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" rel="ge" name="pdo" version="0.9"/> - </deps> - </release> -</package> diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c deleted file mode 100755 index 9b744cd28454c..0000000000000 --- a/ext/pdo_odbc/pdo_odbc.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_odbc.h" -#include "php_pdo_odbc_int.h" - -/* {{{ pdo_odbc_functions[] */ -function_entry pdo_odbc_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_odbc_deps[] */ -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_odbc_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif -/* }}} */ - -/* {{{ pdo_odbc_module_entry */ -zend_module_entry pdo_odbc_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_odbc_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "PDO_ODBC", - pdo_odbc_functions, - PHP_MINIT(pdo_odbc), - PHP_MSHUTDOWN(pdo_odbc), - NULL, - NULL, - PHP_MINFO(pdo_odbc), - "0.9", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_ODBC -ZEND_GET_MODULE(pdo_odbc) -#endif - -#ifdef SQL_ATTR_CONNECTION_POOLING -SQLUINTEGER pdo_odbc_pool_on = SQL_CP_OFF; -SQLUINTEGER pdo_odbc_pool_mode = SQL_CP_ONE_PER_HENV; -#endif - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(pdo_odbc) -{ -#ifdef SQL_ATTR_CONNECTION_POOLING - char *pooling_val = NULL; -#endif - - if (FAILURE == php_pdo_register_driver(&pdo_odbc_driver)) { - return FAILURE; - } - -#ifdef SQL_ATTR_CONNECTION_POOLING - /* ugh, we don't really like .ini stuff in PDO, but since ODBC connection - * pooling is process wide, we can't set it from within the scope of a - * request without affecting others, which goes against our isolated request - * policy. So, we use cfg_get_string here to check it this once. - * */ - if (FAILURE == cfg_get_string("pdo_odbc.connection_pooling", &pooling_val) || pooling_val == NULL) { - pooling_val = "strict"; - } - if (strcasecmp(pooling_val, "strict") == 0 || strcmp(pooling_val, "1") == 0) { - pdo_odbc_pool_on = SQL_CP_ONE_PER_HENV; - pdo_odbc_pool_mode = SQL_CP_STRICT_MATCH; - } else if (strcasecmp(pooling_val, "relaxed") == 0) { - pdo_odbc_pool_on = SQL_CP_ONE_PER_HENV; - pdo_odbc_pool_mode = SQL_CP_RELAXED_MATCH; - } else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) { - pdo_odbc_pool_on = SQL_CP_OFF; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'"); - return FAILURE; - } - - if (pdo_odbc_pool_on != SQL_CP_OFF) { - SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)pdo_odbc_pool_on, 0); - } -#endif - - REGISTER_PDO_CLASS_CONST_LONG("ODBC_ATTR_USE_CURSOR_LIBRARY", PDO_ODBC_ATTR_USE_CURSOR_LIBRARY); - REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED); - REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER); - REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_odbc) -{ - php_pdo_unregister_driver(&pdo_odbc_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_odbc) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for ODBC (" PDO_ODBC_TYPE ")" , "enabled"); -#ifdef SQL_ATTR_CONNECTION_POOLING - php_info_print_table_row(2, "ODBC Connection Pooling", pdo_odbc_pool_on == SQL_CP_OFF ? - "Disabled" : (pdo_odbc_pool_mode == SQL_CP_STRICT_MATCH ? "Enabled, strict matching" : "Enabled, relaxed matching")); -#else - php_info_print_table_row(2, "ODBC Connection Pooling", "Not supported in this build"); -#endif - php_info_print_table_end(); - -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h deleted file mode 100644 index 8d290b38b4ef5..0000000000000 --- a/ext/pdo_odbc/php_pdo_odbc.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_ODBC_H -#define PHP_PDO_ODBC_H - -extern zend_module_entry pdo_odbc_module_entry; -#define phpext_pdo_odbc_ptr &pdo_odbc_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_ODBC_API __declspec(dllexport) -#else -#define PHP_PDO_ODBC_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_odbc); -PHP_MSHUTDOWN_FUNCTION(pdo_odbc); -PHP_RINIT_FUNCTION(pdo_odbc); -PHP_RSHUTDOWN_FUNCTION(pdo_odbc); -PHP_MINFO_FUNCTION(pdo_odbc); - -PHP_FUNCTION(confirm_pdo_odbc_compiled); /* For testing, remove later. */ - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(pdo_odbc) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(pdo_odbc) -*/ - -/* In every utility function you add that needs to use variables - in php_pdo_odbc_globals, call TSRMLS_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as PDO_ODBC_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define PDO_ODBC_G(v) TSRMG(pdo_odbc_globals_id, zend_pdo_odbc_globals *, v) -#else -#define PDO_ODBC_G(v) (pdo_odbc_globals.v) -#endif - -#endif /* PHP_PDO_ODBC_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h deleted file mode 100755 index 72a65ede294e7..0000000000000 --- a/ext/pdo_odbc/php_pdo_odbc_int.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef PHP_WIN32 -# define PDO_ODBC_TYPE "Win32" -#endif - -#ifndef PDO_ODBC_TYPE -# warning Please fix configure to give your ODBC libraries a name -# define PDO_ODBC_TYPE "Unknown" -#endif - -/* {{{ Roll a dice, pick a header at random... */ -#if HAVE_SQLCLI1_H -# include <sqlcli1.h> -# if defined(DB268K) && HAVE_LIBRARYMANAGER_H -# include <LibraryManager.h> -# endif -#endif - -#if HAVE_ODBC_H -# include <odbc.h> -#endif - -#if HAVE_IODBC_H -# include <iodbc.h> -#endif - -#if HAVE_SQLUNIX_H && !defined(PHP_WIN32) -# include <sqlunix.h> -#endif - -#if HAVE_SQLTYPES_H -# include <sqltypes.h> -#endif - -#if HAVE_SQLUCODE_H -# include <sqlucode.h> -#endif - -#if HAVE_SQL_H -# include <sql.h> -#endif - -#if HAVE_ISQL_H -# include <isql.h> -#endif - -#if HAVE_SQLEXT_H -# include <sqlext.h> -#endif - -#if HAVE_ISQLEXT_H -# include <isqlext.h> -#endif - -#if HAVE_UDBCEXT_H -# include <udbcext.h> -#endif - -#if HAVE_CLI0CORE_H -# include <cli0core.h> -#endif - -#if HAVE_CLI0EXT1_H -# include <cli0ext.h> -#endif - -#if HAVE_CLI0CLI_H -# include <cli0cli.h> -#endif - -#if HAVE_CLI0DEFS_H -# include <cli0defs.h> -#endif - -#if HAVE_CLI0ENV_H -# include <cli0env.h> -#endif - -#if HAVE_ODBCSDK_H -# include <odbcsdk.h> -#endif - -/* }}} */ - -/* {{{ Figure out the type for handles */ -#if !defined(HENV) && !defined(SQLHENV) && defined(SQLHANDLE) -# define PDO_ODBC_HENV SQLHANDLE -# define PDO_ODBC_HDBC SQLHANDLE -# define PDO_ODBC_HSTMT SQLHANDLE -#elif !defined(HENV) && (defined(SQLHENV) || defined(DB2CLI_VER)) -# define PDO_ODBC_HENV SQLHENV -# define PDO_ODBC_HDBC SQLHDBC -# define PDO_ODBC_HSTMT SQLHSTMT -#else -# define PDO_ODBC_HENV HENV -# define PDO_ODBC_HDBC HDBC -# define PDO_ODBC_HSTMT HSTMT -#endif -/* }}} */ - -typedef struct { - char last_state[6]; - char last_err_msg[SQL_MAX_MESSAGE_LENGTH]; - SDWORD last_error; - const char *file, *what; - int line; -} pdo_odbc_errinfo; - -typedef struct { - PDO_ODBC_HENV env; - PDO_ODBC_HDBC dbc; - pdo_odbc_errinfo einfo; -} pdo_odbc_db_handle; - -typedef struct { - char *data; - unsigned long datalen; - long fetched_len; - SWORD coltype; - char colname[32]; -} pdo_odbc_column; - -typedef struct { - PDO_ODBC_HSTMT stmt; - pdo_odbc_column *cols; - pdo_odbc_db_handle *H; - pdo_odbc_errinfo einfo; -} pdo_odbc_stmt; - -typedef struct { - SQLINTEGER len; - SQLSMALLINT paramtype; - char *outbuf; -} pdo_odbc_param; - -extern pdo_driver_t pdo_odbc_driver; -extern struct pdo_stmt_methods odbc_stmt_methods; - -void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC); -#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__ TSRMLS_CC) - -void pdo_odbc_init_error_table(void); -void pdo_odbc_fini_error_table(void); - -#ifdef SQL_ATTR_CONNECTION_POOLING -extern SQLUINTEGER pdo_odbc_pool_on; -extern SQLUINTEGER pdo_odbc_pool_mode; -#endif - -enum { - PDO_ODBC_ATTR_USE_CURSOR_LIBRARY = PDO_ATTR_DRIVER_SPECIFIC, -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_odbc/tests/common.phpt b/ext/pdo_odbc/tests/common.phpt deleted file mode 100644 index f64da1a438e86..0000000000000 --- a/ext/pdo_odbc/tests/common.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -ODBC ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_odbc')) print 'skip'; ?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - - -if (false !== getenv('PDO_ODBC_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_ODBC_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_ODBC_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_ODBC_TEST_PASS'); - if (false !== getenv('PDO_ODBC_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR'); - } -} elseif (preg_match('/^WIN/i', PHP_OS)) { - # on windows, try to create a temporary MS access database - $path = realpath(dirname(__FILE__)) . '\pdo_odbc.mdb'; - if (!file_exists($path)) { - try { - $adox = new COM('ADOX.Catalog'); - $adox->Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' . $path); - $adox = null; - - } catch (Exception $e) { - } - } - if (file_exists($path)) { - $config['ENV']['PDOTEST_DSN'] = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=$path;Uid=Admin"; - } -} -# other magic autodetection here, eg: for DB2 by inspecting env -/* -$USER = 'db2inst1'; -$PASSWD = 'ibmdb2'; -$DBNAME = 'SAMPLE'; - -$CONNECTION = "odbc:DSN=$DBNAME;UID=$USER;PWD=$PASSWD;"; -*/ - - -return $config; diff --git a/ext/pdo_odbc/tests/long_columns.phpt b/ext/pdo_odbc/tests/long_columns.phpt deleted file mode 100644 index bc3abe94cac49..0000000000000 --- a/ext/pdo_odbc/tests/long_columns.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -PDO ODBC "long" columns ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_odbc')) print 'skip not loaded'; -?> ---FILE-- -<?php -require 'ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt'); -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - -if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data CLOB)')) { - if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data longtext)')) { - die("BORK: don't know how to create a long column here:\n" . implode(", ", $db->errorInfo())); - } -} - -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$sizes = array(32, 64, 128, 253, 254, 255, 256, 257, 258, 512, 1024, 2048, 3998, 3999, 4000); - -$db->beginTransaction(); -$insert = $db->prepare('INSERT INTO TEST VALUES (?, ?)'); -foreach ($sizes as $num) { - $insert->execute(array($num, str_repeat('i', $num))); -} -$insert = null; -$db->commit(); - -foreach ($db->query('SELECT id, data from TEST') as $row) { - $expect = str_repeat('i', $row[0]); - if (strcmp($expect, $row[1])) { - echo "Failed on size $row[id]:\n"; - printf("Expected %d bytes, got %d\n", strlen($expect), strlen($row['data'])); - echo bin2hex($expect) . "\n"; - echo bin2hex($row['data']) . "\n"; - } -} - -echo "Finished\n"; - ---EXPECT-- -Finished diff --git a/ext/pdo_pgsql/CREDITS b/ext/pdo_pgsql/CREDITS deleted file mode 100644 index bbb7b944282b1..0000000000000 --- a/ext/pdo_pgsql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -PostgreSQL driver for PDO -Edin Kadribasic, Ilia Alshanetsky diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 deleted file mode 100644 index 9f356db64afb7..0000000000000 --- a/ext/pdo_pgsql/config.m4 +++ /dev/null @@ -1,131 +0,0 @@ -dnl -dnl $Id$ -dnl - -if test "$PHP_PDO" != "no"; then - -AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[ -]) - -PHP_ARG_WITH(pdo-pgsql,for PostgreSQL support for PDO, -[ --with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base - install directory or the path to pg_config]) - -if test "$PHP_PDO_PGSQL" != "no"; then - PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE) - - AC_MSG_CHECKING(for pg_config) - for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do - if test -x $i/pg_config; then - PG_CONFIG="$i/pg_config" - break; - fi - done - - if test -n "$PG_CONFIG"; then - AC_MSG_RESULT([$PG_CONFIG]) - PGSQL_INCLUDE=`$PG_CONFIG --includedir` - PGSQL_LIBDIR=`$PG_CONFIG --libdir` - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - else - AC_MSG_RESULT(not found) - if test "$PHP_PDO_PGSQL" = "yes"; then - PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" - else - PGSQL_SEARCH_PATHS=$PHP_PDO_PGSQL - fi - - for i in $PGSQL_SEARCH_PATHS; do - for j in include include/pgsql include/postgres include/postgresql ""; do - if test -r "$i/$j/libpq-fe.h"; then - PGSQL_INC_BASE=$i - PGSQL_INCLUDE=$i/$j - if test -r "$i/$j/pg_config.h"; then - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - fi - fi - done - - for j in lib lib/pgsql lib/postgres lib/postgresql ""; do - if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then - PGSQL_LIBDIR=$i/$j - fi - done - done - fi - - if test -z "$PGSQL_INCLUDE"; then - AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_LIBDIR"; then - AC_MSG_ERROR(Cannot find libpq.so. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then - AC_MSG_ERROR([Unable to find libpq anywhere under $withval]) - fi - - AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not]) - - AC_MSG_CHECKING([for openssl dependencies]) - if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then - AC_MSG_RESULT([yes]) - if pkg-config openssl ; then - PDO_PGSQL_CFLAGS="`pkg-config openssl --cflags`" - fi - else - AC_MSG_RESULT([no]) - fi - - old_LIBS=$LIBS - old_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR" - AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 or later])) - AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows])) - AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL])) - AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQExecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte])) - - AC_CHECK_LIB(pq, PQprepare,AC_DEFINE(HAVE_PQPREPARE,1,[prepared statements])) - - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - - PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PDO_PGSQL_SHARED_LIBADD) - PHP_SUBST(PDO_PGSQL_SHARED_LIBADD) - - PHP_ADD_INCLUDE($PGSQL_INCLUDE) - - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS) - ifdef([PHP_ADD_EXTENSION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo) - ]) -fi - -fi diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32 deleted file mode 100644 index 6af9c98072a67..0000000000000 --- a/ext/pdo_pgsql/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no"); - -if (PHP_PDO_PGSQL != "no") { - if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) && - CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) { - EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c"); - ADD_FLAG('CFLAGS_PDO_PGSQL', "/I ..\\pecl"); - AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library'); - ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1"); - } else { - WARNING("pdo_pgsql not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_pgsql', 'pdo'); -} diff --git a/ext/pdo_pgsql/package.xml b/ext/pdo_pgsql/package.xml deleted file mode 100644 index 7c79c8e8f26ac..0000000000000 --- a/ext/pdo_pgsql/package.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_PGSQL</name> - <summary>PostgreSQL driver for PDO</summary> - <maintainers> - <maintainer> - <user>edink</user> - <name>Edin Kadribasic</name> - <email>edink@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>iliaa</user> - <name>Ilia Alshanetsky</name> - <email>iliaa@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - - </maintainers> - <description> - This extension provides an PostgreSQL driver for PDO. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - Now features native prepared statements and numerous other improvements. - - You need to install the PDO core module before you can make use of this one. - You also require PostgreSQL client libraries installed on the machine where you intend to build and/or use it. - - If you are running on windows, you can download the binary from here: - http://snaps.php.net/win32/PECL_5_0/php_pdo_pgsql.dll - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="pdo_pgsql.c"/> - <file role="src" name="pgsql_driver.c"/> - <file role="src" name="pgsql_statement.c"/> - <file role="src" name="php_pdo_pgsql.h"/> - <file role="src" name="php_pdo_pgsql_int.h"/> - - <file role="doc" name="CREDITS"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" rel="ge" name="pdo" version="0.9"/> - </deps> - </release> -</package> diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c deleted file mode 100644 index 1120cd5aad444..0000000000000 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" - -/* {{{ pdo_pgsql_functions[] */ -function_entry pdo_pgsql_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_sqlite_deps - */ -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_pgsql_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif -/* }}} */ - -/* {{{ pdo_pgsql_module_entry */ -zend_module_entry pdo_pgsql_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_pgsql_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "pdo_pgsql", - pdo_pgsql_functions, - PHP_MINIT(pdo_pgsql), - PHP_MSHUTDOWN(pdo_pgsql), - PHP_RINIT(pdo_pgsql), - PHP_RSHUTDOWN(pdo_pgsql), - PHP_MINFO(pdo_pgsql), - "0.9", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_PGSQL -ZEND_GET_MODULE(pdo_pgsql) -#endif - -/* true global environment */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pdo_pgsql) -{ - php_pdo_register_driver(&pdo_pgsql_driver); - REGISTER_PDO_CONST_LONG("PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT", PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_pgsql) -{ - php_pdo_unregister_driver(&pdo_pgsql_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(pdo_pgsql) -{ - /* php_pdo_register_driver(&pdo_pgsql_driver); */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(pdo_pgsql) -{ - /* php_pdo_unregister_driver(&pdo_pgsql_driver); */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_pgsql) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c deleted file mode 100644 index 5c15e4f13dadb..0000000000000 --- a/ext/pdo_pgsql/pgsql_driver.c +++ /dev/null @@ -1,517 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" - -#include "pg_config.h" /* needed for PG_VERSION */ -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" -#include "zend_exceptions.h" - -static char * _pdo_pgsql_trim_message(const char *message, int persistent) -{ - register int i = strlen(message)-1; - char *tmp; - - if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') { - --i; - } - while (i>0 && (message[i] == '\r' || message[i] == '\n')) { - --i; - } - ++i; - tmp = pemalloc(i + 1, persistent); - memcpy(tmp, message, i); - tmp[i] = '\0'; - - return tmp; -} - -int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; - pdo_pgsql_error_info *einfo = &H->einfo; - char *errmsg = PQerrorMessage(H->server); - - einfo->errcode = errcode; - einfo->file = file; - einfo->line = line; - - if (einfo->errmsg) { - pefree(einfo->errmsg, dbh->is_persistent); - einfo->errmsg = NULL; - } - - if (sqlstate == NULL) { - strcpy(*pdo_err, "HY000"); - } - else { - strcpy(*pdo_err, sqlstate); - } - - if (errmsg) { - einfo->errmsg = _pdo_pgsql_trim_message(errmsg, dbh->is_persistent); - } - - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", - *pdo_err, einfo->errcode, einfo->errmsg); - } - - return errcode; -} -/* }}} */ - -static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */ -{ -/* pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */ -} -/* }}} */ - -static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_pgsql_error_info *einfo = &H->einfo; - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); - } - - return 1; -} -/* }}} */ - -static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - if (H) { - if (H->server) { - PQfinish(H->server); - H->server = NULL; - } - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - H->einfo.errmsg = NULL; - } - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - } - return 0; -} -/* }}} */ - -static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt)); - int scrollable; -#if HAVE_PQPREPARE - PGresult *res; - int ret; - char *nsql = NULL; - int nsql_len = 0; - ExecStatusType status; -#endif - - S->H = H; - stmt->driver_data = S; - stmt->methods = &pgsql_stmt_methods; - - scrollable = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, - PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL; - - if (scrollable) { - /* TODO: check how scrollable cursors related to prepared statements */ - spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt); - } - -#if HAVE_PQPREPARE - if (!driver_options || pdo_attr_lval(driver_options, - PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, 0 TSRMLS_CC) == 0) { - stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED; - stmt->named_rewrite_template = "$%d"; - ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC); - - if (ret == 1) { - /* query was re-written */ - sql = nsql; - } else if (ret == -1) { - /* couldn't grok it */ - strcpy(dbh->error_code, stmt->error_code); - return 0; - } - - spprintf(&S->stmt_name, 0, "pdo_pgsql_stmt_%08x", (unsigned int)stmt); - res = PQprepare(H->server, S->stmt_name, sql, 0, NULL); - if (nsql) { - efree(nsql); - } - if (!res) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - return 0; - } - - /* check if the connection is using protocol version 2.0. - * if that is the reason that the prepare failed, we want to fall - * through and let PDO emulate it for us */ - status = PQresultStatus(res); - switch (status) { - case PGRES_COMMAND_OK: - case PGRES_TUPLES_OK: - /* it worked */ - PQclear(res); - return 1; - - case PGRES_BAD_RESPONSE: - /* server is probably too old; fall through and let - * PDO emulate it */ - efree(S->stmt_name); - S->stmt_name = NULL; - PQclear(res); - break; - - default: - /* protocol 3.0 and above; hard error */ - pdo_pgsql_error(dbh, status, pdo_pgsql_sqlstate(res)); - PQclear(res); - return 0; - } - /* fall through */ - } -#endif - - stmt->supports_placeholders = PDO_PLACEHOLDER_NONE; - return 1; -} - -static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - PGresult *res; - - if (!(res = PQexec(H->server, sql))) { - /* fatal error */ - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - return -1; - } else { - ExecStatusType qs = PQresultStatus(res); - if (qs != PGRES_COMMAND_OK && qs != PGRES_TUPLES_OK) { - pdo_pgsql_error(dbh, qs, pdo_pgsql_sqlstate(res)); - PQclear(res); - return -1; - } - H->pgoid = PQoidValue(res); - PQclear(res); - } - - return 1; -} - -static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - unsigned char *escaped; - - switch (paramtype) { - case PDO_PARAM_LOB: - /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */ - escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen); - *quotedlen += 1; - *quoted = emalloc(*quotedlen + 1); - memcpy((*quoted)+1, escaped, *quotedlen-2); - (*quoted)[0] = '\''; - (*quoted)[*quotedlen-1] = '\''; - (*quoted)[*quotedlen] = '\0'; - free(escaped); - break; - default: - *quoted = emalloc(2*unquotedlen + 3); - (*quoted)[0] = '\''; - *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen); - (*quoted)[*quotedlen + 1] = '\''; - (*quoted)[*quotedlen + 2] = '\0'; - *quotedlen += 2; - } - return 1; -} - -static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - char *id = NULL; - - if (name == NULL) { - if (H->pgoid == InvalidOid) { - return NULL; - } - *len = spprintf(&id, 0, "%ld", (long) H->pgoid); - } else { - PGresult *res; - ExecStatusType status; -#ifdef HAVE_PQEXECPARAMS - const char *q[1]; - q[0] = name; - res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0); -#else - char *name_escaped, *q; - size_t l = strlen(name); - - name_escaped = safe_emalloc(l, 2, 1); - PQescapeString(name_escaped, name, l); - spprintf(&q, 0, "SELECT CURRVAL('%s')", name_escaped); - res = PQexec(H->server, q); - efree(name_escaped); - efree(q); -#endif - status = PQresultStatus(res); - - if (res && (status == PGRES_TUPLES_OK)) { - id = estrdup((char *)PQgetvalue(res, 0, 0)); - *len = PQgetlength(res, 0, 0); - } else { - pdo_pgsql_error(dbh, status, pdo_pgsql_sqlstate(res)); - } - - if (res) { - PQclear(res); - } - } - return id; -} - -static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - ZVAL_STRING(return_value, PG_VERSION, 1); - break; - - case PDO_ATTR_SERVER_VERSION: -#ifdef HAVE_PQPROTOCOLVERSION - if (PQprotocolVersion(H->server) >= 3) { /* PostgreSQL 7.4 or later */ - ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version"), 1); - } else /* emulate above via a query */ -#endif - { - PGresult *res = PQexec(H->server, "SELECT VERSION()"); - if (res && PQresultStatus(res) == PGRES_TUPLES_OK) { - ZVAL_STRING(return_value, (char *)PQgetvalue(res, 0, 0), 1); - } - - if (res) { - PQclear(res); - } - } - break; - - case PDO_ATTR_CONNECTION_STATUS: - switch (PQstatus(H->server)) { - case CONNECTION_STARTED: - ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1); - break; - - case CONNECTION_MADE: - case CONNECTION_OK: - ZVAL_STRINGL(return_value, "Connection OK; waiting to send.", sizeof("Connection OK; waiting to send.")-1, 1); - break; - - case CONNECTION_AWAITING_RESPONSE: - ZVAL_STRINGL(return_value, "Waiting for a response from the server.", sizeof("Waiting for a response from the server.")-1, 1); - break; - - case CONNECTION_AUTH_OK: - ZVAL_STRINGL(return_value, "Received authentication; waiting for backend start-up to finish.", sizeof("Received authentication; waiting for backend start-up to finish.")-1, 1); - break; -#ifdef CONNECTION_SSL_STARTUP - case CONNECTION_SSL_STARTUP: - ZVAL_STRINGL(return_value, "Negotiating SSL encryption.", sizeof("Negotiating SSL encryption.")-1, 1); - break; -#endif - case CONNECTION_SETENV: - ZVAL_STRINGL(return_value, "Negotiating environment-driven parameter settings.", sizeof("Negotiating environment-driven parameter settings.")-1, 1); - break; - - case CONNECTION_BAD: - default: - ZVAL_STRINGL(return_value, "Bad connection.", sizeof("Bad connection.")-1, 1); - break; - } - break; - - case PDO_ATTR_SERVER_INFO: { - int spid = PQbackendPID(H->server); - char *tmp; -#ifdef HAVE_PQPROTOCOLVERSION - spprintf(&tmp, 0, - "PID: %d; Client Encoding: %s; Is Superuser: %s; Session Authorization: %s; Date Style: %s", - spid, - (char*)PQparameterStatus(H->server, "client_encoding"), - (char*)PQparameterStatus(H->server, "is_superuser"), - (char*)PQparameterStatus(H->server, "session_authorization"), - (char*)PQparameterStatus(H->server, "DateStyle")); -#else - spprintf(&tmp, 0, "PID: %d", spid); -#endif - ZVAL_STRING(return_value, tmp, 0); - } - break; - - default: - return 0; - } - - return 1; -} - -static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; - PGresult *res; - int ret = 1; - - res = PQexec(H->server, cmd); - - if (PQresultStatus(res) != PGRES_COMMAND_OK) { - ret = 0; - } - - PQclear(res); - return ret; -} - -static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("BEGIN", dbh TSRMLS_CC); -} - -static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); -} - -static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) -{ - return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); -} - -static struct pdo_dbh_methods pgsql_methods = { - pgsql_handle_closer, - pgsql_handle_preparer, - pgsql_handle_doer, - pgsql_handle_quoter, - pgsql_handle_begin, - pgsql_handle_commit, - pgsql_handle_rollback, - NULL, /* set_attr */ - pdo_pgsql_last_insert_id, - pdo_pgsql_fetch_error_func, - pdo_pgsql_get_attribute, - NULL, /* check_liveness */ - NULL /* get_driver_methods */ -}; - -static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_pgsql_db_handle *H; - int ret = 0; - char *conn_str, *p, *e; - - H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent); - dbh->driver_data = H; - - H->einfo.errcode = 0; - H->einfo.errmsg = NULL; - - /* PostgreSQL wants params in the connect string to be separated by spaces, - * if the PDO standard semicolons are used, we convert them to spaces - */ - e = (char *) dbh->data_source + strlen(dbh->data_source); - p = (char *) dbh->data_source; - while ((p = memchr(p, ';', (e - p)))) { - *p = ' '; - } - - /* support both full connection string & connection string + login and/or password */ - if (!dbh->username || !dbh->password) { - conn_str = (char *) dbh->data_source; - } else if (dbh->username && dbh->password) { - spprintf(&conn_str, 0, "%s user=%s password=%s", dbh->data_source, dbh->username, dbh->password); - } else if (dbh->username) { - spprintf(&conn_str, 0, "%s user=%s", dbh->data_source, dbh->username); - } else { - spprintf(&conn_str, 0, "%s password=%s", dbh->data_source, dbh->password); - } - - H->server = PQconnectdb(conn_str); - - if (conn_str != dbh->data_source) { - efree(conn_str); - } - - if (PQstatus(H->server) != CONNECTION_OK) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE); - goto cleanup; - } - - PQsetNoticeProcessor(H->server, (void(*)(void*,const char*))_pdo_pgsql_notice, (void *)&dbh); - - H->attached = 1; - H->pgoid = -1; - - dbh->methods = &pgsql_methods; - dbh->alloc_own_columns = 1; - dbh->max_escaped_char_length = 2; - - ret = 1; - -cleanup: - dbh->methods = &pgsql_methods; - if (!ret) { - pgsql_handle_closer(dbh TSRMLS_CC); - } - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_pgsql_driver = { - PDO_DRIVER_HEADER(pgsql), - pdo_pgsql_handle_factory -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c deleted file mode 100644 index e5889ef4d7ce2..0000000000000 --- a/ext/pdo_pgsql/pgsql_statement.c +++ /dev/null @@ -1,535 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_pgsql.h" -#include "php_pdo_pgsql_int.h" - -/* from postgresql/src/include/catalog/pg_type.h */ -#define BOOLOID 16 -#define BYTEAOID 17 -#define INT8OID 20 -#define INT2OID 21 -#define INT4OID 23 -#define OIDOID 26 - - -static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - - if (S->result) { - /* free the resource */ - PQclear(S->result); - S->result = NULL; - } - -#if HAVE_PQPREPARE - if (S->stmt_name) { - pdo_pgsql_db_handle *H = S->H; - char *q = NULL; - PGresult *res; - - spprintf(&q, 0, "DEALLOCATE %s", S->stmt_name); - res = PQexec(H->server, q); - efree(q); - if (res) PQclear(res); - efree(S->stmt_name); - S->stmt_name = NULL; - } - if (S->param_lengths) { - efree(S->param_lengths); - S->param_lengths = NULL; - } - if (S->param_values) { - efree(S->param_values); - S->param_values = NULL; - } - if (S->param_formats) { - efree(S->param_formats); - S->param_formats = NULL; - } - -#endif - - if (S->cursor_name) { - pdo_pgsql_db_handle *H = S->H; - char *q = NULL; - PGresult *res; - - spprintf(&q, 0, "CLOSE %s", S->cursor_name); - res = PQexec(H->server, q); - efree(q); - if (res) PQclear(res); - efree(S->cursor_name); - S->cursor_name = NULL; - } - - if(S->cols) { - efree(S->cols); - S->cols = NULL; - } - efree(S); - stmt->driver_data = NULL; - return 1; -} - -static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - pdo_pgsql_db_handle *H = S->H; - ExecStatusType status; - - if (stmt->executed) { - /* ensure that we free any previous unfetched results */ - if(S->result) { - PQclear(S->result); - S->result = NULL; - } - } - - S->current_row = 0; - -#if HAVE_PQPREPARE - if (S->stmt_name) { - /* using a prepared statement */ - - S->result = PQexecPrepared(H->server, S->stmt_name, - stmt->bound_params ? - zend_hash_num_elements(stmt->bound_params) : - 0, - (const char**)S->param_values, - S->param_lengths, - NULL, - 0); - } else -#endif - if (S->cursor_name) { - char *q = NULL; - spprintf(&q, 0, "DECLARE %s CURSOR FOR %s", S->cursor_name, stmt->active_query_string); - S->result = PQexec(H->server, q); - efree(q); - } else { - S->result = PQexec(H->server, stmt->active_query_string); - } - status = PQresultStatus(S->result); - - if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { - pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result)); - return 0; - } - - if(!stmt->executed) { - stmt->column_count = (int) PQnfields(S->result); - S->cols = ecalloc(stmt->column_count, sizeof(pdo_pgsql_column)); - } - - if (status == PGRES_COMMAND_OK) { - stmt->row_count = (long)atoi(PQcmdTuples(S->result)); - H->pgoid = PQoidValue(S->result); - } else { - stmt->row_count = (long)PQntuples(S->result); - } - - return 1; -} - -static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; -#if HAVE_PQPREPARE - if (S->stmt_name && param->is_param) { - switch (event_type) { - case PDO_PARAM_EVT_ALLOC: - /* decode name from $1, $2 into 0, 1 etc. */ - if (param->name) { - if (param->name[0] == '$') { - param->paramno = atoi(param->name + 1); - } else { - /* resolve parameter name to rewritten name */ - char *nameptr; - if (SUCCESS == zend_hash_find(stmt->bound_param_map, - param->name, param->namelen + 1, (void**)&nameptr)) { - param->paramno = atoi(nameptr + 1) - 1; - } else { - pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093"); - return 0; - } - } - } - break; - - case PDO_PARAM_EVT_EXEC_PRE: - if (!S->param_values) { - S->param_values = ecalloc( - zend_hash_num_elements(stmt->bound_params), - sizeof(char*)); - S->param_lengths = ecalloc( - zend_hash_num_elements(stmt->bound_params), - sizeof(int)); - S->param_formats = ecalloc( - zend_hash_num_elements(stmt->bound_params), - sizeof(int)); - - } - if (param->paramno >= 0) { - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL || - Z_TYPE_P(param->parameter) == IS_NULL) { - S->param_values[param->paramno] = NULL; - S->param_lengths[param->paramno] = 0; - } else if (Z_TYPE_P(param->parameter) == IS_BOOL) { - S->param_values[param->paramno] = Z_BVAL_P(param->parameter) ? "t" : "f"; - S->param_lengths[param->paramno] = 1; - S->param_formats[param->paramno] = 1; - } else { - convert_to_string(param->parameter); - S->param_values[param->paramno] = Z_STRVAL_P(param->parameter); - S->param_lengths[param->paramno] = Z_STRLEN_P(param->parameter); - S->param_formats[param->paramno] = 1; - } - } - break; - } - } -#endif - return 1; -} - -static int pgsql_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - - if (S->cursor_name) { - char *ori_str; - char *q = NULL; - ExecStatusType status; - - switch (ori) { - case PDO_FETCH_ORI_NEXT: ori_str = "FORWARD"; break; - case PDO_FETCH_ORI_PRIOR: ori_str = "BACKWARD"; break; - case PDO_FETCH_ORI_REL: ori_str = "RELATIVE"; break; - default: - return 0; - } - - spprintf(&q, 0, "FETCH %s %ld FROM %s", ori_str, offset, S->cursor_name); - S->result = PQexec(S->H->server, q); - status = PQresultStatus(S->result); - - if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { - pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result)); - return 0; - } - - S->current_row = 1; - return 1; - - } else { - if (S->current_row < stmt->row_count) { - S->current_row++; - return 1; - } else { - return 0; - } - } -} - -static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - struct pdo_column_data *cols = stmt->columns; - - if (!S->result) { - return 0; - } - - cols[colno].name = estrdup(PQfname(S->result, colno)); - cols[colno].namelen = strlen(cols[colno].name); - cols[colno].maxlen = PQfsize(S->result, colno); - cols[colno].precision = PQfmod(S->result, colno); - S->cols[colno].pgsql_type = PQftype(S->result, colno); - - switch(S->cols[colno].pgsql_type) { - - case BOOLOID: - cols[colno].param_type = PDO_PARAM_BOOL; - break; - - case INT2OID: - case INT4OID: - case OIDOID: - cols[colno].param_type = PDO_PARAM_INT; - break; - - case INT8OID: - if (sizeof(long)>=8) { - cols[colno].param_type = PDO_PARAM_INT; - } else { - cols[colno].param_type = PDO_PARAM_STR; - } - break; - - case BYTEAOID: - cols[colno].param_type = PDO_PARAM_LOB; - break; - - default: - cols[colno].param_type = PDO_PARAM_STR; - } - - return 1; -} - -/* PQunescapeBytea() from PostgreSQL 7.3 to provide bytea unescape feature to 7.2 users. - Renamed to php_pdo_pgsql_unescape_bytea() */ -/* - * PQunescapeBytea - converts the null terminated string representation - * of a bytea, strtext, into binary, filling a buffer. It returns a - * pointer to the buffer which is NULL on error, and the size of the - * buffer in retbuflen. The pointer may subsequently be used as an - * argument to the function free(3). It is the reverse of PQescapeBytea. - * - * The following transformations are reversed: - * '\0' == ASCII 0 == \000 - * '\'' == ASCII 39 == \' - * '\\' == ASCII 92 == \\ - * - * States: - * 0 normal 0->1->2->3->4 - * 1 \ 1->5 - * 2 \0 1->6 - * 3 \00 - * 4 \000 - * 5 \' - * 6 \\ - */ -static unsigned char *php_pdo_pgsql_unescape_bytea(unsigned char *strtext, size_t *retbuflen) -{ - size_t buflen; - unsigned char *buffer, - *sp, - *bp; - unsigned int state = 0; - - if (strtext == NULL) - return NULL; - buflen = strlen(strtext); /* will shrink, also we discover if - * strtext */ - buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */ - for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++) - { - switch (state) - { - case 0: - if (*sp == '\\') - state = 1; - *bp = *sp; - break; - case 1: - if (*sp == '\'') /* state=5 */ - { /* replace \' with 39 */ - bp--; - *bp = '\''; - buflen--; - state = 0; - } - else if (*sp == '\\') /* state=6 */ - { /* replace \\ with 92 */ - bp--; - *bp = '\\'; - buflen--; - state = 0; - } - else - { - if (isdigit(*sp)) - state = 2; - else - state = 0; - *bp = *sp; - } - break; - case 2: - if (isdigit(*sp)) - state = 3; - else - state = 0; - *bp = *sp; - break; - case 3: - if (isdigit(*sp)) /* state=4 */ - { - unsigned char *start, *end, buf[4]; /* 000 + '\0' */ - - bp -= 3; - memcpy(buf, sp-2, 3); - buf[3] = '\0'; - start = buf; - *bp = (unsigned char)strtoul(start, (char **)&end, 8); - buflen -= 3; - state = 0; - } - else - { - *bp = *sp; - state = 0; - } - break; - } - } - buffer = erealloc(buffer, buflen+1); - buffer[buflen] = '\0'; - - *retbuflen = buflen; - return buffer; -} - -static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - struct pdo_column_data *cols = stmt->columns; - size_t tmp_len; - - if (!S->result) { - return 0; - } - - /* We have already increased count by 1 in pgsql_stmt_fetch() */ - if (PQgetisnull(S->result, S->current_row - 1, colno)) { /* Check if we got NULL */ - *ptr = NULL; - *len = 0; - } else { - *ptr = PQgetvalue(S->result, S->current_row - 1, colno); - *len = PQgetlength(S->result, S->current_row - 1, colno); - - switch(cols[colno].param_type) { - - case PDO_PARAM_INT: - S->cols[colno].intval = atol(*ptr); - *ptr = (char *) &(S->cols[colno].intval); - *len = sizeof(long); - break; - - case PDO_PARAM_BOOL: - S->cols[colno].boolval = **ptr == 't' ? 1: 0; - *ptr = (char *) &(S->cols[colno].boolval); - *len = sizeof(zend_bool); - break; - - case PDO_PARAM_LOB: - *ptr = php_pdo_pgsql_unescape_bytea(*ptr, &tmp_len); - *len = tmp_len; - *caller_frees = 1; - break; - case PDO_PARAM_NULL: - case PDO_PARAM_STR: - case PDO_PARAM_STMT: - case PDO_PARAM_INPUT_OUTPUT: - break; - } - } - - return 1; -} - -static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) -{ - pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data; - PGresult *res; - char *q=NULL; - ExecStatusType status; - - if (!S->result) { - return FAILURE; - } - - if (colno >= stmt->column_count) { - return FAILURE; - } - - array_init(return_value); - add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type); - - /* Fetch metadata from Postgres system catalogue */ - spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type); - res = PQexec(S->H->server, q); - efree(q); - - status = PQresultStatus(res); - - if (status != PGRES_TUPLES_OK) { - /* Failed to get system catalogue, but return success - * with the data we have collected so far - */ - PQclear(res); - return 1; - } - - /* We want exactly one row returned */ - if (1 != PQntuples(res)) { - PQclear(res); - return 1; - } - - add_assoc_string(return_value, "native_type", PQgetvalue(res, 0, 0), 1); - - PQclear(res); - return 1; -} - -static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) -{ -#if HAVE_PQPREPARE - return 1; -#endif -} - -struct pdo_stmt_methods pgsql_stmt_methods = { - pgsql_stmt_dtor, - pgsql_stmt_execute, - pgsql_stmt_fetch, - pgsql_stmt_describe, - pgsql_stmt_get_col, - pgsql_stmt_param_hook, - NULL, /* set_attr */ - NULL, /* get_attr */ - pgsql_stmt_get_column_meta, - NULL, /* next_rowset */ - pdo_pgsql_stmt_cursor_closer -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h deleted file mode 100644 index bfb0385017766..0000000000000 --- a/ext/pdo_pgsql/php_pdo_pgsql.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_PGSQL_H -#define PHP_PDO_PGSQL_H - -#include <libpq-fe.h> - -extern zend_module_entry pdo_pgsql_module_entry; -#define phpext_pdo_pgsql_ptr &pdo_pgsql_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_PGSQL_API __declspec(dllexport) -#else -#define PHP_PDO_PGSQL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_pgsql); -PHP_MSHUTDOWN_FUNCTION(pdo_pgsql); -PHP_RINIT_FUNCTION(pdo_pgsql); -PHP_RSHUTDOWN_FUNCTION(pdo_pgsql); -PHP_MINFO_FUNCTION(pdo_pgsql); - -#endif /* PHP_PDO_PGSQL_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h deleted file mode 100644 index 855c934488236..0000000000000 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic <edink@emini.dk> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_PGSQL_INT_H -#define PHP_PDO_PGSQL_INT_H - -#include <libpq-fe.h> -#include <php.h> - -#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006" - -typedef struct { - const char *file; - int line; - unsigned int errcode; - char *errmsg; -} pdo_pgsql_error_info; - -/* stuff we use in a pgsql database handle */ -typedef struct { - PGconn *server; - unsigned attached:1; - unsigned _reserved:31; - pdo_pgsql_error_info einfo; - Oid pgoid; -} pdo_pgsql_db_handle; - -typedef struct { - char *def; - Oid pgsql_type; - long intval; - zend_bool boolval; -} pdo_pgsql_column; - -typedef struct { - pdo_pgsql_db_handle *H; - PGresult *result; - int current_row; - pdo_pgsql_column *cols; - char *cursor_name; -#if HAVE_PQPREPARE - char *stmt_name; - char **param_values; - int *param_lengths; - int *param_formats; -#endif -} pdo_pgsql_stmt; - -typedef struct { - char *repr; - long repr_len; - int pgsql_type; - void *thing; /* for LOBS, REFCURSORS etc. */ -} pdo_pgsql_bound_param; - -extern pdo_driver_t pdo_pgsql_driver; - -extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC); -#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods pgsql_stmt_methods; - -#ifdef HAVE_PQRESULTERRORFIELD -#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE) -#else -#define pdo_pgsql_sqlstate(r) (const char *)NULL -#endif - -enum { - PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = PDO_ATTR_DRIVER_SPECIFIC, -}; - -#endif /* PHP_PDO_PGSQL_INT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_pgsql/tests/common.phpt b/ext/pdo_pgsql/tests/common.phpt deleted file mode 100644 index 383700904c54d..0000000000000 --- a/ext/pdo_pgsql/tests/common.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Postgres ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_pgsql')) print 'skip'; ?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - -if (false !== getenv('PDO_PGSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_PGSQL_TEST_DSN'); - if (false !== getenv('PDO_PGSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_PGSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'pgsql:host=localhost port=5432 dbname=test user=root password='; -} - -return $config; diff --git a/ext/pdo_sqlite/CREDITS b/ext/pdo_sqlite/CREDITS deleted file mode 100644 index 0a6c14588bf4e..0000000000000 --- a/ext/pdo_sqlite/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SQLite 3.x driver for PDO -Wez Furlong diff --git a/ext/pdo_sqlite/EXPERIMENTAL b/ext/pdo_sqlite/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 deleted file mode 100644 index 2f1a98536d57c..0000000000000 --- a/ext/pdo_sqlite/config.m4 +++ /dev/null @@ -1,122 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension pdo_sqlite -dnl vim:et:sw=2:ts=2: - -if test "$PHP_PDO" != "no"; then - -PHP_ARG_WITH(pdo-sqlite, for sqlite 3 driver for PDO, -[ --without-pdo-sqlite PDO: sqlite 3 support],yes) - -if test "$PHP_PDO_SQLITE" != "no"; then - - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_inc_path) - ]) - - php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" - - if test "$PHP_PDO_SQLITE" != "yes"; then - SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this - SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this - if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter - PDO_SQLITE_DIR=$PHP_PDO_SQLITE - else # search default path list - AC_MSG_CHECKING([for sqlite3 files in default path]) - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - PDO_SQLITE_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - if test -z "$PDO_SQLITE_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the sqlite3 distribution]) - fi - - PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include) - - LIBNAME=sqlite3 - LIBSYMBOL=sqlite3_open - - PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, - [ - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/lib, PDO_SQLITE_SHARED_LIBADD) - AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ]) - ],[ - AC_MSG_ERROR([wrong sqlite lib version or lib not found]) - ],[ - -L$PDO_SQLITE_DIR/lib -lm - ]) - PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[ - AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support]) - ]) - - PHP_SUBST(PDO_SQLITE_SHARED_LIBADD) - PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_inc_path) - else - # use bundled libs - pdo_sqlite_sources="sqlite/src/attach.c sqlite/src/auth.c sqlite/src/btree.c \ - sqlite/src/build.c sqlite/src/callback.c sqlite/src/date.c sqlite/src/delete.c sqlite/src/expr.c \ - sqlite/src/func.c sqlite/src/hash.c sqlite/src/insert.c sqlite/src/legacy.c \ - sqlite/src/main.c sqlite/src/os_mac.c sqlite/src/os_unix.c sqlite/src/os_win.c \ - sqlite/src/pager.c sqlite/src/pragma.c sqlite/src/prepare.c \ - sqlite/src/printf.c sqlite/src/random.c sqlite/src/select.c \ - sqlite/src/table.c sqlite/src/tokenize.c sqlite/src/analyze.c \ - sqlite/src/trigger.c sqlite/src/update.c sqlite/src/utf.c sqlite/src/util.c \ - sqlite/src/vacuum.c sqlite/src/vdbeapi.c sqlite/src/vdbeaux.c sqlite/src/vdbe.c \ - sqlite/src/vdbemem.c sqlite/src/where.c sqlite/src/parse.c sqlite/src/opcodes.c \ - sqlite/src/alter.c sqlite/src/vdbefifo.c sqlite/src/experimental.c" - - PHP_NEW_EXTENSION(pdo_sqlite, - $php_pdo_sqlite_sources_core $pdo_sqlite_sources, - $ext_shared,,-I@ext_builddir@/sqlite/src -DPDO_SQLITE_BUNDLED=1 -DSQLITE_OMIT_CURSOR -I$pdo_inc_path) - - PHP_ADD_BUILD_DIR($ext_builddir/sqlite/src, 1) - AC_CHECK_SIZEOF(char *,4) - AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer]) - PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION` - PDO_SQLITE_VERSION_NUMBER=`echo $PDO_SQLITE_VERSION | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}'` - sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/ $ext_srcdir/sqlite/src/sqlite.h.in > $ext_builddir/sqlite/src/sqlite3.h - - touch $ext_srcdir/sqlite/src/parse.c $ext_srcdir/sqlite/src/parse.h - - if test "$ext_shared" = "no" -o "$ext_srcdir" != "$abs_srcdir"; then - echo '#include <php_config.h>' > $ext_srcdir/sqlite/src/config.h - else - echo "#include \"$abs_builddir/config.h\"" > $ext_srcdir/sqlite/src/config.h - fi - cat >> $ext_srcdir/sqlite/src/config.h <<EOF -#if ZTS -# define THREADSAFE 1 -#endif -#if !ZEND_DEBUG -# define NDEBUG -#endif -/* discourage foolishness */ -#define sqlite3_temp_directory sqlite3_temp_directory_unsafe_except_in_minit -EOF - AC_CHECK_FUNCS(usleep nanosleep) - AC_CHECK_HEADERS(time.h) - - fi - ifdef([PHP_ADD_EXTENSION_DEP], - [ - PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo) - ]) -fi - -fi diff --git a/ext/pdo_sqlite/config.w32 b/ext/pdo_sqlite/config.w32 deleted file mode 100644 index fed572403a778..0000000000000 --- a/ext/pdo_sqlite/config.w32 +++ /dev/null @@ -1,31 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no"); - -if (PHP_PDO_SQLITE != "no") { - - php_pdo_sqlite_version = file_get_contents(configure_module_dirname + "\\sqlite\\VERSION").replace(new RegExp("[\r\n]+", "g")); - php_pdo_sqlite_version.match(/(\d+)\.(\d+)\.(\d+)/); - // this only works for single digit numbers - php_pdo_sqlite_lib_version = RegExp.$1 + "000" + RegExp.$2 + "000" + RegExp.$3; - - copy_and_subst(configure_module_dirname + "\\sqlite\\src\\sqlite.h.in", - configure_module_dirname + "\\sqlite3.h", new Array( - "--VERS--", php_pdo_sqlite_version, - "--VERSION-NUMBER--", php_pdo_sqlite_lib_version - )); - - FSO.CopyFile(configure_module_dirname + "\\sqlite\\src\\sqlite_config.w32.h", - configure_module_dirname + "\\sqlite\\src\\config.h"); - - EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/DSQLITE_OMIT_CURSOR /I" + configure_module_dirname + "/sqlite/src /I pecl /I ..\\pecl /I" + configure_module_dirname); - ADD_SOURCES(configure_module_dirname + "/sqlite/src", - "attach.c auth.c btree.c build.c callback.c date.c delete.c expr.c func.c hash.c insert.c \ - legacy.c main.c os_mac.c os_unix.c os_win.c pager.c pragma.c prepare.c printf.c random.c \ - select.c table.c tokenize.c trigger.c update.c utf.c util.c vacuum.c vdbeapi.c analyze.c \ - vdbeaux.c vdbe.c vdbemem.c vdbefifo.c where.c parse.c opcodes.c alter.c experimental.c", "pdo_sqlite"); - - ADD_EXTENSION_DEP('pdo_sqlite', 'pdo'); -} - diff --git a/ext/pdo_sqlite/package.xml b/ext/pdo_sqlite/package.xml deleted file mode 100755 index a47666a7a46b0..0000000000000 --- a/ext/pdo_sqlite/package.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package version="1.0"> - <name>PDO_SQLITE</name> - <summary>SQLite v3 Interface driver for PDO</summary> - <maintainers> - <maintainer> - <user>wez</user> - <name>Wez Furlong</name> - <email>wez@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <!-- configureoptions> - <configureoption name="with-pdo-sqlite" prompt="Path to your sqlite3 install"/> -</configureoptions --> - <description> - This extension provides an SQLite v3 driver for PDO. - SQLite V3 is NOT compatible with the bundled SQLite 2 in PHP 5, but is a significant - step forwards, featuring complete utf-8 support, native support for blobs, - native support for prepared statements with bound parameters and improved - concurrency. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>0.9</version> - <date>2005-07-27</date> - - <notes> - You need to install the PDO core module before you can make use of this one. - This package includes a bundled SQLite 3 library. - - Windows binary: http://snaps.php.net/win32/PECL_5_0/php_pdo_sqlite.dll - - - Fixed PECL Bug #3452; problem when first row of a result set contains a NULL value. - - Upgraded bundled sqlite to 3.1.3 - - setting PDO_ATTR_TIMEOUT controls the busy timeout - - Fixed PECL Bug #3391; cannot bind NULL parameters - - Fixed build problem when building the bundled sqlite library - </notes> - - <filelist> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="pdo_sqlite.c"/> - <file role="src" name="sqlite_driver.c"/> - <file role="src" name="sqlite_statement.c"/> - <file role="src" name="php_pdo_sqlite.h"/> - <file role="src" name="php_pdo_sqlite_int.h"/> - - <file role="doc" name="CREDITS"/> - - <dir name="sqlite"> -<file role="src" name="aclocal.m4"/> -<file role="src" name="config.guess"/> -<file role="src" name="config.sub"/> -<file role="src" name="configure"/> -<file role="src" name="configure.ac"/> -<file role="src" name="install-sh"/> -<file role="src" name="ltmain.sh"/> -<file role="src" name="main.mk"/> -<file role="src" name="Makefile.in"/> -<file role="src" name="Makefile.linux-gcc"/> -<file role="src" name="mkdll.sh"/> -<file role="src" name="mkopcodec.awk"/> -<file role="src" name="mkopcodeh.awk"/> -<file role="src" name="mkso.sh"/> -<file role="src" name="publish.sh"/> -<file role="src" name="README"/> -<file role="src" name="spec.template"/> -<file role="src" name="sqlite.1"/> -<file role="src" name="sqlite3.def"/> -<file role="src" name="sqlite3.pc.in"/> -<file role="src" name="sqlite.pc.in"/> -<file role="src" name="VERSION"/> -<dir name="src"> -<file role="src" name="attach.c"/> -<file role="src" name="alter.c"/> -<file role="src" name="auth.c"/> -<file role="src" name="btree.c"/> -<file role="src" name="btree.h"/> -<file role="src" name="build.c"/> -<file role="src" name="callback.c"/> -<file role="src" name="date.c"/> -<file role="src" name="delete.c"/> -<file role="src" name="expr.c"/> -<file role="src" name="experimental.c"/> -<file role="src" name="func.c"/> -<file role="src" name="hash.c"/> -<file role="src" name="hash.h"/> -<file role="src" name="insert.c"/> -<file role="src" name="legacy.c"/> -<file role="src" name="main.c"/> -<file role="src" name="md5.c"/> -<file role="src" name="keywordhash.h"/> -<file role="src" name="opcodes.c"/> -<file role="src" name="opcodes.h"/> -<file role="src" name="os_common.h"/> -<file role="src" name="os.h"/> -<file role="src" name="os_mac.c"/> -<file role="src" name="os_mac.h"/> -<file role="src" name="os_test.c"/> -<file role="src" name="os_test.h"/> -<file role="src" name="os_unix.c"/> -<file role="src" name="os_unix.h"/> -<file role="src" name="os_win.c"/> -<file role="src" name="os_win.h"/> -<file role="src" name="pager.c"/> -<file role="src" name="pager.h"/> -<file role="src" name="parse.y"/> -<file role="src" name="parse.c"/> -<file role="src" name="parse.h"/> -<file role="src" name="pragma.c"/> -<file role="src" name="prepare.c"/> -<file role="src" name="printf.c"/> -<file role="src" name="random.c"/> -<file role="src" name="select.c"/> -<file role="src" name="shell.c"/> -<file role="src" name="sqlite.h.in"/> -<file role="src" name="sqliteInt.h"/> -<file role="src" name="table.c"/> -<file role="src" name="tclsqlite.c"/> -<file role="src" name="test1.c"/> -<file role="src" name="test2.c"/> -<file role="src" name="test3.c"/> -<file role="src" name="test4.c"/> -<file role="src" name="test5.c"/> -<file role="src" name="tokenize.c"/> -<file role="src" name="trigger.c"/> -<file role="src" name="update.c"/> -<file role="src" name="utf.c"/> -<file role="src" name="util.c"/> -<file role="src" name="vacuum.c"/> -<file role="src" name="vdbeapi.c"/> -<file role="src" name="vdbeaux.c"/> -<file role="src" name="vdbe.c"/> -<file role="src" name="vdbe.h"/> -<file role="src" name="vdbeInt.h"/> -<file role="src" name="vdbemem.c"/> -<file role="src" name="where.c"/> -</dir> - -<dir name="tool"> -<file role="src" name="diffdb.c"/> -<file role="src" name="lemon.c"/> -<file role="src" name="lempar.c"/> -<file role="src" name="memleak2.awk"/> -<file role="src" name="memleak3.tcl"/> -<file role="src" name="memleak.awk"/> -<file role="src" name="mkkeywordhash.c"/> -<file role="src" name="mkopts.tcl"/> -<file role="src" name="opcodeDoc.awk"/> -<file role="src" name="report1.txt"/> -<file role="src" name="showdb.c"/> -<file role="src" name="showjournal.c"/> -<file role="src" name="spaceanal.tcl"/> -<file role="src" name="space_used.tcl"/> -<file role="src" name="speedtest2.tcl"/> -<file role="src" name="speedtest.tcl"/> -</dir> - - </dir> - - </filelist> - <deps> - <dep type="php" rel="ge" version="5.0.3"/> - <dep type="ext" rel="ge" name="pdo" version="0.9"/> - </deps> - </release> -</package> -<!-- vim: se ts=2 sw=2 et: --> diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c deleted file mode 100644 index 8142cde489666..0000000000000 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_sqlite.h" -#include "php_pdo_sqlite_int.h" -#include "zend_exceptions.h" - -#define PHP_PDO_SQLITE_MODULE_VERSION "0.9" - -/* {{{ pdo_sqlite_functions[] */ -function_entry pdo_sqlite_functions[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pdo_sqlite_deps - */ -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep pdo_sqlite_deps[] = { - ZEND_MOD_REQUIRED("pdo") - {NULL, NULL, NULL} -}; -#endif -/* }}} */ - -/* {{{ pdo_sqlite_module_entry - */ -zend_module_entry pdo_sqlite_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - pdo_sqlite_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "pdo_sqlite", - pdo_sqlite_functions, - PHP_MINIT(pdo_sqlite), - PHP_MSHUTDOWN(pdo_sqlite), - NULL, - NULL, - PHP_MINFO(pdo_sqlite), - PHP_PDO_SQLITE_MODULE_VERSION, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_SQLITE -ZEND_GET_MODULE(pdo_sqlite) -#endif - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(pdo_sqlite) -{ - return php_pdo_register_driver(&pdo_sqlite_driver); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(pdo_sqlite) -{ - php_pdo_unregister_driver(&pdo_sqlite_driver); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pdo_sqlite) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "PDO Driver for SQLite 3.x", "enabled"); - php_info_print_table_row(2, "PECL Module version", -#if PDO_SQLITE_BUNDLED - "(bundled) " -#endif - PHP_PDO_SQLITE_MODULE_VERSION - " $Id$"); - php_info_print_table_row(2, "SQLite Library", sqlite3_libversion()); - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h deleted file mode 100644 index c280096584d32..0000000000000 --- a/ext/pdo_sqlite/php_pdo_sqlite.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#ifndef PHP_PDO_SQLITE_H -#define PHP_PDO_SQLITE_H - -extern zend_module_entry pdo_sqlite_module_entry; -#define phpext_pdo_sqlite_ptr &pdo_sqlite_module_entry - -#ifdef PHP_WIN32 -#define PHP_PDO_SQLITE_API __declspec(dllexport) -#else -#define PHP_PDO_SQLITE_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_sqlite); -PHP_MSHUTDOWN_FUNCTION(pdo_sqlite); -PHP_RINIT_FUNCTION(pdo_sqlite); -PHP_RSHUTDOWN_FUNCTION(pdo_sqlite); -PHP_MINFO_FUNCTION(pdo_sqlite); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlite) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(pdo_sqlite) -*/ - -/* In every utility function you add that needs to use variables - in php_pdo_sqlite_globals, call TSRMLS_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as PDO_SQLITE_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define PDO_SQLITE_G(v) TSRMG(pdo_sqlite_globals_id, zend_pdo_sqlite_globals *, v) -#else -#define PDO_SQLITE_G(v) (pdo_sqlite_globals.v) -#endif - -#endif /* PHP_PDO_SQLITE_H */ - diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h deleted file mode 100644 index 94b0d28c628db..0000000000000 --- a/ext/pdo_sqlite/php_pdo_sqlite_int.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_SQLITE_INT_H -#define PHP_PDO_SQLITE_INT_H - -#include <sqlite3.h> - -typedef struct { - const char *file; - int line; - unsigned int errcode; - char *errmsg; -} pdo_sqlite_error_info; - -struct pdo_sqlite_fci { - zend_fcall_info fci; - zend_fcall_info_cache fcc; -}; - -struct pdo_sqlite_func { - struct pdo_sqlite_func *next; - - zval *func, *step, *fini; - int argc; - const char *funcname; - - /* accelerated callback references */ - struct pdo_sqlite_fci afunc, astep, afini; -}; - -typedef struct { - sqlite3 *db; - pdo_sqlite_error_info einfo; - struct pdo_sqlite_func *funcs; -} pdo_sqlite_db_handle; - -typedef struct { - pdo_sqlite_db_handle *H; - sqlite3_stmt *stmt; - unsigned pre_fetched:1; - unsigned done:1; -} pdo_sqlite_stmt; - -extern pdo_driver_t pdo_sqlite_driver; - -extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC); -#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC) - -extern struct pdo_stmt_methods sqlite_stmt_methods; -#endif diff --git a/ext/pdo_sqlite/post-bundle.sh b/ext/pdo_sqlite/post-bundle.sh deleted file mode 100755 index e60cc85e86f4b..0000000000000 --- a/ext/pdo_sqlite/post-bundle.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Run this script after updating the bundled sqlite library - -cc -o sqlite/tool/lemon sqlite/tool/lemon.c -./sqlite/tool/lemon sqlite/src/parse.y -cat sqlite/src/parse.h sqlite/src/vdbe.c | awk -f sqlite/mkopcodeh.awk > sqlite/src/opcodes.h -sort -n +2 sqlite/src/opcodes.h | awk -f sqlite/mkopcodec.awk > sqlite/src/opcodes.c -cc -o sqlite/tool/mkkeywordhash sqlite/tool/mkkeywordhash.c -./sqlite/tool/mkkeywordhash > sqlite/src/keywordhash.h diff --git a/ext/pdo_sqlite/sqlite/Makefile.in b/ext/pdo_sqlite/sqlite/Makefile.in deleted file mode 100644 index db47144225141..0000000000000 --- a/ext/pdo_sqlite/sqlite/Makefile.in +++ /dev/null @@ -1,660 +0,0 @@ -#!/usr/make -# -# Makefile for SQLITE -# -# This makefile is suppose to be configured automatically using the -# autoconf. But if that does not work for you, you can configure -# the makefile manually. Just set the parameters below to values that -# work well for your system. -# -# If the configure script does not work out-of-the-box, you might -# be able to get it to work by giving it some hints. See the comment -# at the beginning of configure.in for additional information. -# - -# The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. -# -TOP = @srcdir@ - -# C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -BCC = @BUILD_CC@ @BUILD_CFLAGS@ - -# C Compile and options for use in building executables that -# will run on the target platform. (BCC and TCC are usually the -# same unless your are cross-compiling.) -# -TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src - -# Define -DNDEBUG to compile without debugging (i.e., for production usage) -# Omitting the define will cause extra debugging code to be inserted and -# includes extra comments when "EXPLAIN stmt" is used. -# -TCC += @TARGET_DEBUG@ - -# Compiler options needed for programs that use the TCL library. -# -TCC += @TCL_INCLUDE_SPEC@ - -# The library that programs using TCL must link against. -# -LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@ - -# Compiler options needed for programs that use the readline() library. -# -READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@ - -# The library that programs using readline() must link against. -# -LIBREADLINE = @TARGET_READLINE_LIBS@ - -# Should the database engine be compiled threadsafe -# -TCC += -DTHREADSAFE=@THREADSAFE@ - -# The pthreads library if needed -# -LIBPTHREAD=@TARGET_THREAD_LIB@ - -# Flags controlling use of the in memory btree implementation -# -# TEMP_STORE is 0 to force temporary tables to be in a file, 1 to -# default to file, 2 to default to memory, and 3 to force temporary -# tables to always be in memory. -# -TEMP_STORE = -DTEMP_STORE=@TEMP_STORE@ - -# Version numbers and release number for the SQLite being compiled. -# -VERSION = @VERSION@ -VERSION_NUMBER = @VERSION_NUMBER@ -RELEASE = @RELEASE@ - -# Filename extensions -# -BEXE = @BUILD_EXEEXT@ -TEXE = @TARGET_EXEEXT@ - -# The following variable is "1" if the configure script was able to locate -# the tclConfig.sh file. It is an empty string otherwise. When this -# variable is "1", the TCL extension library (libtclsqlite3.so) is built -# and installed. -# -HAVE_TCL = @HAVE_TCL@ - -# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib" -# -SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ - -# The directory into which to store package information for - -# Some standard variables and programs -# -prefix = @prefix@ -exec_prefix = @exec_prefix@ -libdir = @libdir@ -INSTALL = @INSTALL@ -LIBTOOL = ./libtool -ALLOWRELEASE = @ALLOWRELEASE@ - -# libtool compile/link/install -LTCOMPILE = $(LIBTOOL) --mode=compile $(TCC) -LTLINK = $(LIBTOOL) --mode=link $(TCC) -LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) - -# You should not have to change anything below this line -############################################################################### - -OPTS += -DSQLITE_OMIT_CURSOR # Cursors do not work at this time -TCC += -DSQLITE_OMIT_CURSOR - -# Object files for the SQLite library. -# -LIBOBJ = alter.lo analyze.lo attach.lo auth.lo btree.lo build.lo \ - callback.lo complete.lo date.lo \ - delete.lo expr.lo func.lo hash.lo insert.lo \ - main.lo opcodes.lo os_unix.lo os_win.lo \ - pager.lo parse.lo pragma.lo prepare.lo printf.lo random.lo \ - select.lo table.lo tokenize.lo trigger.lo update.lo \ - util.lo vacuum.lo \ - vdbe.lo vdbeapi.lo vdbeaux.lo vdbefifo.lo vdbemem.lo \ - where.lo utf.lo legacy.lo - -# All of the source code files. -# -SRC = \ - $(TOP)/src/alter.c \ - $(TOP)/src/analyze.c \ - $(TOP)/src/attach.c \ - $(TOP)/src/auth.c \ - $(TOP)/src/btree.c \ - $(TOP)/src/btree.h \ - $(TOP)/src/build.c \ - $(TOP)/src/callback.c \ - $(TOP)/src/complete.c \ - $(TOP)/src/date.c \ - $(TOP)/src/delete.c \ - $(TOP)/src/expr.c \ - $(TOP)/src/func.c \ - $(TOP)/src/hash.c \ - $(TOP)/src/hash.h \ - $(TOP)/src/insert.c \ - $(TOP)/src/legacy.c \ - $(TOP)/src/main.c \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c \ - $(TOP)/src/pager.h \ - $(TOP)/src/parse.y \ - $(TOP)/src/pragma.c \ - $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/random.c \ - $(TOP)/src/select.c \ - $(TOP)/src/shell.c \ - $(TOP)/src/sqlite.h.in \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/table.c \ - $(TOP)/src/tclsqlite.c \ - $(TOP)/src/tokenize.c \ - $(TOP)/src/trigger.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/update.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vacuum.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeapi.c \ - $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbefifo.c \ - $(TOP)/src/vdbemem.c \ - $(TOP)/src/vdbeInt.h \ - $(TOP)/src/where.c - -# Source code to the test files. -# -TESTSRC = \ - $(TOP)/src/btree.c \ - $(TOP)/src/date.c \ - $(TOP)/src/func.c \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c \ - $(TOP)/src/pragma.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/test1.c \ - $(TOP)/src/test2.c \ - $(TOP)/src/test3.c \ - $(TOP)/src/test4.c \ - $(TOP)/src/test5.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/md5.c \ - $(TOP)/src/where.c - -# Header files used by all library source files. -# -HDR = \ - sqlite3.h \ - $(TOP)/src/btree.h \ - $(TOP)/src/hash.h \ - opcodes.h \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/os_unix.h \ - $(TOP)/src/os_win.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/vdbe.h \ - parse.h - -# Header files used by the VDBE submodule -# -VDBEHDR = \ - $(HDR) \ - $(TOP)/src/vdbeInt.h - -# This is the default Makefile target. The objects listed here -# are what get build when you type just "make" with no arguments. -# -all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) - -Makefile: $(TOP)/Makefile.in - ./config.status - -# Generate the file "last_change" which contains the date of change -# of the most recently modified source code file -# -last_change: $(SRC) - cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \ - | awk '{print $$5,$$6}' >last_change - -libsqlite3.la: $(LIBOBJ) - $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \ - ${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8" - -libtclsqlite3.la: tclsqlite.lo libsqlite3.la - $(LTLINK) -o libtclsqlite3.la tclsqlite.lo \ - $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \ - -rpath $(libdir)/sqlite \ - -version-info "8:6:8" - -sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h - $(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \ - -o sqlite3 $(TOP)/src/shell.c libsqlite3.la $(LIBREADLINE) - -# This target creates a directory named "tsrc" and fills it with -# copies of all of the C source code and header files needed to -# build on the target system. Some of the C source code and header -# files are automatically generated. This target takes care of -# all that automatic generation. -# -target_source: $(SRC) parse.c opcodes.c keywordhash.h $(VDBEHDR) - rm -rf tsrc - mkdir -p tsrc - cp $(SRC) $(VDBEHDR) tsrc - rm tsrc/sqlite.h.in tsrc/parse.y - cp parse.c opcodes.c keywordhash.h tsrc - cp $(TOP)/sqlite3.def tsrc - -# Rules to build the LEMON compiler generator -# -lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c - $(BCC) -o lemon $(TOP)/tool/lemon.c - cp $(TOP)/tool/lempar.c . - - -# Rules to build individual files -# -alter.lo: $(TOP)/src/alter.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/alter.c - -analyze.lo: $(TOP)/src/analyze.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/analyze.c - -attach.lo: $(TOP)/src/attach.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/attach.c - -auth.lo: $(TOP)/src/auth.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/auth.c - -btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h - $(LTCOMPILE) -c $(TOP)/src/btree.c - -build.lo: $(TOP)/src/build.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/build.c - -callback.lo: $(TOP)/src/callback.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/callback.c - -complete.lo: $(TOP)/src/complete.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/complete.c - -date.lo: $(TOP)/src/date.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/date.c - -delete.lo: $(TOP)/src/delete.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/delete.c - -expr.lo: $(TOP)/src/expr.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/expr.c - -func.lo: $(TOP)/src/func.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/func.c - -hash.lo: $(TOP)/src/hash.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/hash.c - -insert.lo: $(TOP)/src/insert.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/insert.c - -legacy.lo: $(TOP)/src/legacy.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/legacy.c - -main.lo: $(TOP)/src/main.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c - -pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h - $(LTCOMPILE) -c $(TOP)/src/pager.c - -opcodes.lo: opcodes.c - $(LTCOMPILE) -c opcodes.c - -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - sort -n -b +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c - -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk - cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h - -os_unix.lo: $(TOP)/src/os_unix.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/os_unix.c - -os_win.lo: $(TOP)/src/os_win.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/os_win.c - -parse.lo: parse.c $(HDR) - $(LTCOMPILE) -c parse.c - -parse.h: parse.c - -parse.c: $(TOP)/src/parse.y lemon$(BEXE) - cp $(TOP)/src/parse.y . - ./lemon $(OPTS) parse.y - -pragma.lo: $(TOP)/src/pragma.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/pragma.c - -prepare.lo: $(TOP)/src/prepare.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c - -printf.lo: $(TOP)/src/printf.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/printf.c - -random.lo: $(TOP)/src/random.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/random.c - -select.lo: $(TOP)/src/select.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/select.c - -sqlite3.h: $(TOP)/src/sqlite.h.in - sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \ - sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h - -table.lo: $(TOP)/src/table.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/table.c - -tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/tclsqlite.c - -tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR) - $(LTCOMPILE) -c $(TOP)/src/tokenize.c - -keywordhash.h: $(TOP)/tool/mkkeywordhash.c - $(BCC) -o mkkeywordhash$(BEXE) $(OPTS) $(TOP)/tool/mkkeywordhash.c - ./mkkeywordhash$(BEXE) >keywordhash.h - -trigger.lo: $(TOP)/src/trigger.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/trigger.c - -update.lo: $(TOP)/src/update.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/update.c - -utf.lo: $(TOP)/src/utf.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/utf.c - -util.lo: $(TOP)/src/util.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/util.c - -vacuum.lo: $(TOP)/src/vacuum.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/vacuum.c - -vdbe.lo: $(TOP)/src/vdbe.c $(VDBEHDR) - $(LTCOMPILE) -c $(TOP)/src/vdbe.c - -vdbeapi.lo: $(TOP)/src/vdbeapi.c $(VDBEHDR) - $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c - -vdbeaux.lo: $(TOP)/src/vdbeaux.c $(VDBEHDR) - $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c - -vdbefifo.lo: $(TOP)/src/vdbefifo.c $(VDBEHDR) - $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c - -vdbemem.lo: $(TOP)/src/vdbemem.c $(VDBEHDR) - $(LTCOMPILE) -c $(TOP)/src/vdbemem.c - -where.lo: $(TOP)/src/where.c $(HDR) - $(LTCOMPILE) -c $(TOP)/src/where.c - -tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR) - $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c - -tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR) - $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c - -tclsqlite3: tclsqlite-shell.lo libsqlite3.la - $(LTLINK) -o tclsqlite3 tclsqlite-shell.lo \ - libsqlite3.la $(LIBTCL) - -testfixture$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC) - $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 $(TEMP_STORE) \ - -o testfixture $(TESTSRC) $(TOP)/src/tclsqlite.c \ - libsqlite3.la $(LIBTCL) - -crashtest$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC) $(TOP)/src/os_test.c - $(LTLINK) -DOS_TEST=1 -DTCLSH=1 -DSQLITE_TEST=1 \ - -o crashtest \ - $(TESTSRC) $(TOP)/src/os_test.c $(TOP)/src/tclsqlite.c \ - libsqlite3.la $(LIBTCL) - - - -fulltest: testfixture$(TEXE) sqlite3$(TEXE) crashtest$(TEXE) - ./testfixture $(TOP)/test/all.test - -test: testfixture$(TEXE) sqlite3$(TEXE) - ./testfixture $(TOP)/test/quick.test - -sqlite3_analyzer$(TEXE): $(TOP)/src/tclsqlite.c libtclsqlite3.la \ - $(TESTSRC) $(TOP)/tool/spaceanal.tcl - sed \ - -e '/^#/d' \ - -e 's,\\,\\\\,g' \ - -e 's,",\\",g' \ - -e 's,^,",' \ - -e 's,$$,\\n",' \ - $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h - $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 $(TEMP_STORE)\ - -o sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \ - libtclsqlite3.la $(LIBTCL) - -# Rules used to build documentation -# -arch.html: $(TOP)/www/arch.tcl - tclsh $(TOP)/www/arch.tcl >arch.html - -arch2.gif: $(TOP)/www/arch2.gif - cp $(TOP)/www/arch2.gif . - -autoinc.html: $(TOP)/www/autoinc.tcl - tclsh $(TOP)/www/autoinc.tcl >autoinc.html - -c_interface.html: $(TOP)/www/c_interface.tcl - tclsh $(TOP)/www/c_interface.tcl >c_interface.html - -capi3.html: $(TOP)/www/capi3.tcl - tclsh $(TOP)/www/capi3.tcl >capi3.html - -capi3ref.html: $(TOP)/www/capi3ref.tcl - tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html - -changes.html: $(TOP)/www/changes.tcl - tclsh $(TOP)/www/changes.tcl >changes.html - -compile.html: $(TOP)/www/compile.tcl - tclsh $(TOP)/www/compile.tcl >compile.html - -copyright.html: $(TOP)/www/copyright.tcl - tclsh $(TOP)/www/copyright.tcl >copyright.html - -copyright-release.html: $(TOP)/www/copyright-release.html - cp $(TOP)/www/copyright-release.html . - -copyright-release.pdf: $(TOP)/www/copyright-release.pdf - cp $(TOP)/www/copyright-release.pdf . - -common.tcl: $(TOP)/www/common.tcl - cp $(TOP)/www/common.tcl . - -conflict.html: $(TOP)/www/conflict.tcl - tclsh $(TOP)/www/conflict.tcl >conflict.html - -datatypes.html: $(TOP)/www/datatypes.tcl - tclsh $(TOP)/www/datatypes.tcl >datatypes.html - -datatype3.html: $(TOP)/www/datatype3.tcl - tclsh $(TOP)/www/datatype3.tcl >datatype3.html - -docs.html: $(TOP)/www/docs.tcl - tclsh $(TOP)/www/docs.tcl >docs.html - -download.html: $(TOP)/www/download.tcl - mkdir -p doc - tclsh $(TOP)/www/download.tcl >download.html - -faq.html: $(TOP)/www/faq.tcl - tclsh $(TOP)/www/faq.tcl >faq.html - -fileformat.html: $(TOP)/www/fileformat.tcl - tclsh $(TOP)/www/fileformat.tcl >fileformat.html - -formatchng.html: $(TOP)/www/formatchng.tcl - tclsh $(TOP)/www/formatchng.tcl >formatchng.html - -index.html: $(TOP)/www/index.tcl last_change - tclsh $(TOP)/www/index.tcl >index.html - -lang.html: $(TOP)/www/lang.tcl - tclsh $(TOP)/www/lang.tcl >lang.html - -pragma.html: $(TOP)/www/pragma.tcl - tclsh $(TOP)/www/pragma.tcl >pragma.html - -lockingv3.html: $(TOP)/www/lockingv3.tcl - tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html - -oldnews.html: $(TOP)/www/oldnews.tcl - tclsh $(TOP)/www/oldnews.tcl >oldnews.html - -omitted.html: $(TOP)/www/omitted.tcl - tclsh $(TOP)/www/omitted.tcl >omitted.html - -opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c - tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html - -mingw.html: $(TOP)/www/mingw.tcl - tclsh $(TOP)/www/mingw.tcl >mingw.html - -nulls.html: $(TOP)/www/nulls.tcl - tclsh $(TOP)/www/nulls.tcl >nulls.html - -quickstart.html: $(TOP)/www/quickstart.tcl - tclsh $(TOP)/www/quickstart.tcl >quickstart.html - -speed.html: $(TOP)/www/speed.tcl - tclsh $(TOP)/www/speed.tcl >speed.html - -sqlite.gif: $(TOP)/art/SQLite.gif - cp $(TOP)/art/SQLite.gif sqlite.gif - -sqlite.html: $(TOP)/www/sqlite.tcl - tclsh $(TOP)/www/sqlite.tcl >sqlite.html - -support.html: $(TOP)/www/support.tcl - tclsh $(TOP)/www/support.tcl >support.html - -tclsqlite.html: $(TOP)/www/tclsqlite.tcl - tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html - -vdbe.html: $(TOP)/www/vdbe.tcl - tclsh $(TOP)/www/vdbe.tcl >vdbe.html - -version3.html: $(TOP)/www/version3.tcl - tclsh $(TOP)/www/version3.tcl >version3.html - - -# Files to be published on the website. -# -DOC = \ - arch.html \ - arch2.gif \ - autoinc.html \ - c_interface.html \ - capi3.html \ - capi3ref.html \ - changes.html \ - compile.html \ - copyright.html \ - copyright-release.html \ - copyright-release.pdf \ - conflict.html \ - datatypes.html \ - datatype3.html \ - docs.html \ - download.html \ - faq.html \ - fileformat.html \ - formatchng.html \ - index.html \ - lang.html \ - lockingv3.html \ - mingw.html \ - nulls.html \ - oldnews.html \ - omitted.html \ - opcode.html \ - pragma.html \ - quickstart.html \ - speed.html \ - sqlite.gif \ - sqlite.html \ - support.html \ - tclsqlite.html \ - vdbe.html \ - version3.html - -doc: common.tcl $(DOC) - mkdir -p doc - mv $(DOC) doc - -install: sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install} - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir) - $(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin - $(LTINSTALL) sqlite3 $(DESTDIR)$(exec_prefix)/bin - $(INSTALL) -d $(DESTDIR)$(prefix)/include - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(prefix)/include - $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig; - $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig; - -tcl_install: libtclsqlite3.la - tclsh $(TOP)/tclinstaller.tcl $(VERSION) - -clean: - rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la - rm -f sqlite3.h opcodes.* - rm -rf .libs .deps - rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz - rm -f mkkeywordhash$(BEXE) keywordhash.h - rm -f $(PUBLISH) - rm -f *.da *.bb *.bbg gmon.out - rm -f testfixture$(TEXE) test.db - rm -rf doc - rm -f common.tcl - rm -f sqlite3.dll sqlite3.lib - -# -# Windows section; all this funky .dll stuff ;-) -# -dll: sqlite3.dll - -REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o) - -sqlite3.dll: $(LIBOBJ) $(TOP)/sqlite3.def - dllwrap --dllname sqlite3.dll --def $(TOP)/sqlite3.def $(REAL_LIBOBJ) - strip sqlite3.dll - -#target for dll import libraries -implib: sqlite3.lib - -#make Borland C++ and/or Microsoft VC import library for the dll -# ignore any errors (usually due to missing programs) -sqlite3.lib: sqlite3.dll - -impdef -a sqlite3.def sqlite3.dll - -implib sqlite3.lib sqlite3.def - -lib /machine:i386 /def:$(TOP)/sqlite3.def - -distclean: clean - rm -f config.log config.status libtool Makefile config.h diff --git a/ext/pdo_sqlite/sqlite/Makefile.linux-gcc b/ext/pdo_sqlite/sqlite/Makefile.linux-gcc deleted file mode 100644 index 202f4a1ee2523..0000000000000 --- a/ext/pdo_sqlite/sqlite/Makefile.linux-gcc +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/make -# -# Makefile for SQLITE -# -# This is a template makefile for SQLite. Most people prefer to -# use the autoconf generated "configure" script to generate the -# makefile automatically. But that does not work for everybody -# and in every situation. If you are having problems with the -# "configure" script, you might want to try this makefile as an -# alternative. Create a copy of this file, edit the parameters -# below and type "make". -# - -#### The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. -# -TOP = ../sqlite - -#### C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -BCC = gcc -g -O2 -#BCC = /opt/ancic/bin/c89 -0 - -#### If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -#USLEEP = -USLEEP = -DHAVE_USLEEP=1 - -#### If you want the SQLite library to be safe for use within a -# multi-threaded program, then define the following macro -# appropriately: -# -#THREADSAFE = -DTHREADSAFE=1 -THREADSAFE = -DTHREADSAFE=0 - -#### Specify any extra linker options needed to make the library -# thread safe -# -#THREADLIB = -lpthread -THREADLIB = - -#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 -# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all -# malloc()s and free()s in order to track down memory leaks. -# -# SQLite uses some expensive assert() statements in the inner loop. -# You can make the library go almost twice as fast if you compile -# with -DNDEBUG=1 -# -#OPTS = -DSQLITE_DEBUG=2 -#OPTS = -DSQLITE_DEBUG=1 -#OPTS = -OPTS = -DNDEBUG=1 - -#### The suffix to add to executable files. ".exe" for windows. -# Nothing for unix. -# -#EXE = .exe -EXE = - -#### C Compile and options for use in building executables that -# will run on the target platform. This is usually the same -# as BCC, unless you are cross-compiling. -# -TCC = gcc -O6 -#TCC = gcc -g -O0 -Wall -#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage -#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 -#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive - -#### Tools used to build a static library. -# -AR = ar cr -#AR = /opt/mingw/bin/i386-mingw32-ar cr -RANLIB = ranlib -#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib - -#### Extra compiler options needed for programs that use the TCL library. -# -#TCL_FLAGS = -#TCL_FLAGS = -DSTATIC_BUILD=1 -TCL_FLAGS = -I/home/drh/tcltk/8.4linux -#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1 -#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - -#### Linker options needed to link against the TCL library. -# -#LIBTCL = -ltcl -lm -ldl -LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl -#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt -#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - -#### Compiler options needed for programs that use the readline() library. -# -READLINE_FLAGS = -#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline - -#### Linker options needed by programs using readline() must link against. -# -LIBREADLINE = -#LIBREADLINE = -static -lreadline -ltermcap - -#### Should the database engine assume text is coded as UTF-8 or iso8859? -# -# ENCODING = UTF8 -ENCODING = ISO8859 - -# You should not have to change anything below this line -############################################################################### -include $(TOP)/main.mk diff --git a/ext/pdo_sqlite/sqlite/README b/ext/pdo_sqlite/sqlite/README deleted file mode 100644 index 6e4f392054fc0..0000000000000 --- a/ext/pdo_sqlite/sqlite/README +++ /dev/null @@ -1,35 +0,0 @@ -This directory contains source code to - - SQLite: An Embeddable SQL Database Engine - -To compile the project, first create a directory in which to place -the build products. It is recommended, but not required, that the -build directory be separate from the source directory. Cd into the -build directory and then from the build directory run the configure -script found at the root of the source tree. Then run "make". - -For example: - - tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite" - mkdir bld ;# Build will occur in a sibling directory - cd bld ;# Change to the build directory - ../sqlite/configure ;# Run the configure script - make ;# Run the makefile. - make install ;# (Optional) Install the build products - -The configure script uses autoconf 2.50 and libtool. If the configure -script does not work out for you, there is a generic makefile named -"Makefile.linux-gcc" in the top directory of the source tree that you -can copy and edit to suite your needs. Comments on the generic makefile -show what changes are needed. - -The linux binaries on the website are created using the generic makefile, -not the configure script. The configure script is unmaintained. (You -can volunteer to take over maintenance of the configure script, if you want!) -The windows binaries on the website are created using MinGW32 configured -as a cross-compiler running under Linux. For details, see the ./publish.sh -script at the top-level of the source tree. - -Contacts: - - http://www.sqlite.org/ diff --git a/ext/pdo_sqlite/sqlite/VERSION b/ext/pdo_sqlite/sqlite/VERSION deleted file mode 100644 index 406ebcbd95f04..0000000000000 --- a/ext/pdo_sqlite/sqlite/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.2.7 diff --git a/ext/pdo_sqlite/sqlite/aclocal.m4 b/ext/pdo_sqlite/sqlite/aclocal.m4 deleted file mode 100644 index 852eb3134b705..0000000000000 --- a/ext/pdo_sqlite/sqlite/aclocal.m4 +++ /dev/null @@ -1,5913 +0,0 @@ -# generated automatically by aclocal 1.8.2 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 47 AC_PROG_LIBTOOL -# Debian $Rev: 192 $ - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -[$]* -EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - testring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring") >/dev/null 2>&1 && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -[#line __oline__ "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf` - sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -])# AC_PROG_LD - - -# AC_PROG_LD_GNU -# -------------- -AC_DEFUN([AC_PROG_LD_GNU], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac]) -with_gnu_ld=$lt_cv_prog_gnu_ld -])# AC_PROG_LD_GNU - - -# AC_PROG_LD_RELOAD_FLAG -# ---------------------- -# find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], - lt_cv_ld_reload_flag, - [lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -])# AC_PROG_LD_RELOAD_FLAG - - -# AC_DEPLIBS_CHECK_METHOD -# ----------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - darwin* | rhapsody*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext <<EOF -int a; -void foo (void) { a = 0; } -EOF -],[$1],[CXX],[cat > conftest.$ac_ext <<EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -EOF -],[$1],[F77],[cat > conftest.$ac_ext <<EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -EOF -],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -EOF -]) -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then - _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then - _LT_AC_TAGVAR(predep_objects, $1)="$p" - else - _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then - _LT_AC_TAGVAR(postdep_objects, $1)="$p" - else - _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$rm -f confest.$objext - -case " $_LT_AC_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac -])# AC_LIBTOOL_POSTDEP_PREDEP - -# AC_LIBTOOL_LANG_F77_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) -AC_DEFUN([_LT_AC_LANG_F77_CONFIG], -[AC_REQUIRE([AC_PROG_F77]) -AC_LANG_PUSH(Fortran 77) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$G77" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP - - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_F77_CONFIG - - -# AC_LIBTOOL_LANG_GCJ_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) -AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], -[AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_GCJ_CONFIG - - -# AC_LIBTOOL_LANG_RC_CONFIG -# -------------------------- -# Ensure that the configuration vars for the Windows resource compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) -AC_DEFUN([_LT_AC_LANG_RC_CONFIG], -[AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_RC_CONFIG - - -# AC_LIBTOOL_CONFIG([TAGNAME]) -# ---------------------------- -# If TAGNAME is not passed, then create an initial libtool script -# with a default configuration from the untagged config vars. Otherwise -# add code to config.status for appending the configuration named by -# TAGNAME from the matching tagged config vars. -AC_DEFUN([AC_LIBTOOL_CONFIG], -[# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - _LT_AC_TAGVAR(compiler, $1) \ - _LT_AC_TAGVAR(CC, $1) \ - _LT_AC_TAGVAR(LD, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ - _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ - _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ - _LT_AC_TAGVAR(old_archive_cmds, $1) \ - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ - _LT_AC_TAGVAR(predep_objects, $1) \ - _LT_AC_TAGVAR(postdep_objects, $1) \ - _LT_AC_TAGVAR(predeps, $1) \ - _LT_AC_TAGVAR(postdeps, $1) \ - _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ - _LT_AC_TAGVAR(archive_cmds, $1) \ - _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ - _LT_AC_TAGVAR(postinstall_cmds, $1) \ - _LT_AC_TAGVAR(postuninstall_cmds, $1) \ - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ - _LT_AC_TAGVAR(allow_undefined_flag, $1) \ - _LT_AC_TAGVAR(no_undefined_flag, $1) \ - _LT_AC_TAGVAR(export_symbols_cmds, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ - _LT_AC_TAGVAR(hardcode_automatic, $1) \ - _LT_AC_TAGVAR(module_cmds, $1) \ - _LT_AC_TAGVAR(module_expsym_cmds, $1) \ - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ - _LT_AC_TAGVAR(exclude_expsyms, $1) \ - _LT_AC_TAGVAR(include_expsyms, $1); do - - case $var in - _LT_AC_TAGVAR(old_archive_cmds, $1) | \ - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ - _LT_AC_TAGVAR(archive_cmds, $1) | \ - _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ - _LT_AC_TAGVAR(module_cmds, $1) | \ - _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ - _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\[$]0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` - ;; - esac - -ifelse([$1], [], - [cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - AC_MSG_NOTICE([creating $ofile])], - [cfgfile="$ofile"]) - - cat <<__EOF__ >> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | knetbsd*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - linux*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi4*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include <windows.h> -# #undef WIN32_LEAN_AND_MEAN -# #include <stdio.h> -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include <cygwin/cygwin_dll.h> -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED -]) -AC_MSG_RESULT([$SED]) -]) - diff --git a/ext/pdo_sqlite/sqlite/config.guess b/ext/pdo_sqlite/sqlite/config.guess deleted file mode 100644 index e8c6fc0c33c53..0000000000000 --- a/ext/pdo_sqlite/sqlite/config.guess +++ /dev/null @@ -1,1432 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2004-01-05' - -# This file 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pegasos:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; - *:DRAGONFLY:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - ftp://ftp.gnu.org/pub/gnu/config/ - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/ext/pdo_sqlite/sqlite/config.sub b/ext/pdo_sqlite/sqlite/config.sub deleted file mode 100644 index 463186dbfd6bf..0000000000000 --- a/ext/pdo_sqlite/sqlite/config.sub +++ /dev/null @@ -1,1537 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2004-01-05' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/ext/pdo_sqlite/sqlite/configure b/ext/pdo_sqlite/sqlite/configure deleted file mode 100755 index 11e3c9c51bec0..0000000000000 --- a/ext/pdo_sqlite/sqlite/configure +++ /dev/null @@ -1,21326 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="src/sqlite.h.in" -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#if HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#if STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# if HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#if HAVE_STRINGS_H -# include <strings.h> -#endif -#if HAVE_INTTYPES_H -# include <inttypes.h> -#else -# if HAVE_STDINT_H -# include <stdint.h> -# endif -#endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE TARGET_THREAD_LIB ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG LIBOBJS LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP -ac_env_F77_set=${F77+set} -ac_env_F77_value=$F77 -ac_cv_env_F77_set=${F77+set} -ac_cv_env_F77_value=$F77 -ac_env_FFLAGS_set=${FFLAGS+set} -ac_env_FFLAGS_value=$FFLAGS -ac_cv_env_FFLAGS_set=${FFLAGS+set} -ac_cv_env_FFLAGS_value=$FFLAGS - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shared[=PKGS] - build shared libraries [default=yes] - --enable-static[=PKGS] - build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-threadsafe Support threadsafe operation - --enable-releasemode Support libtool link to release mode - --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) - --disable-tcl do not build TCL extension - --enable-debug enable debugging & verbose explain - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] - include additional configurations [automatic] - --with-hints=FILE Read configuration options from FILE - --with-tcl=DIR directory containing tcl configuration (tclConfig.sh) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have - headers in a nonstandard directory <include dir> - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - -# The following RCS revision string applies to configure.in -# $Revision$ - -######### -# Programs needed -# -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi; - -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi; - -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi; - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include <stdlib.h> -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED - -fi - -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 -NM="$lt_cv_path_NM" - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 3058 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -esac - -need_locks="$enable_libtool_lock" - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include <stdlib.h> -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_F77" && break -done - - F77=$ac_ct_F77 -fi - - -# Provide some information about the compiler. -echo "$as_me:4521:" \ - "checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - testring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring") >/dev/null 2>&1 && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris* | sysv5*) - symcode='[BDRT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -EOF - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 -else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi - -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 -objdir=$lt_cv_objdir - - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# -# Check for any special shared library compilation flags. -# -lt_prog_cc_shlib= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - lt_prog_cc_shlib='-belf' - ;; - esac -fi -if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} - if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : - else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} - lt_cv_prog_cc_can_build_shared=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_prog_compiler_static" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5555: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:5559: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - sco3.2v5*) - lt_prog_compiler_pic='-Kpic' - lt_prog_compiler_static='-dn' - ;; - - solaris*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5788: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:5792: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 - -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5848: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:5852: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - linux*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds="$tmp_archive_cmds" - fi - else - ld_shlibs=no - fi - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi4*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes ; then - archive_cmds_need_lc=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - 10.*) - allow_undefined_flag='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='-all_load $convenience' - link_all_deplibs=yes - else - ld_shlibs=no - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 -test "$ld_shlibs" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` - sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var " || \ - test "X$hardcode_automatic"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 8032 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 8130 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - -# Report which librarie types wil actually be built -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - darwin* | rhapsody*) - if test "$GCC" = yes; then - archive_cmds_need_lc=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - 10.*) - allow_undefined_flag='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='-all_load $convenience' - link_all_deplibs=yes - else - ld_shlibs=no - fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - -# Check whether --with-tags or --without-tags was given. -if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_CXX=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX=' ' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs_CXX=no - fi - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes; then - archive_cmds_need_lc_CXX=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='-flat_namespace -undefined suppress' - ;; - 10.*) - allow_undefined_flag_CXX='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='-all_load $convenience' - link_all_deplibs_CXX=yes - else - ld_shlibs_CXX=no - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd12*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - hardcode_libdir_separator_CXX=: - ;; - ia64*) - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - *) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - archive_cmds_need_lc_CXX=no - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sco*) - archive_cmds_need_lc_CXX=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.0-5 | solaris2.0-5.*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - archive_cmds_need_lc_CXX=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <<EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -EOF - -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | knetbsd*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10309: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:10313: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10369: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:10373: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` - sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var CXX" || \ - test "X$hardcode_automatic_CXX"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 - -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 11730 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 11828 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -test "$ld_shlibs_F77" = no && can_build_shared=no - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - sco3.2v5*) - lt_prog_compiler_pic_F77='-Kpic' - lt_prog_compiler_static_F77='-dn' - ;; - - solaris*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12655: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:12659: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12715: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:12719: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - lt_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - linux*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds_F77="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds_F77="$tmp_archive_cmds" - fi - else - ld_shlibs_F77=no - fi - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_F77=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77=' ' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi4*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes ; then - archive_cmds_need_lc_F77=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='-flat_namespace -undefined suppress' - ;; - 10.*) - allow_undefined_flag_F77='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='-all_load $convenience' - link_all_deplibs_F77=yes - else - ld_shlibs_F77=no - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - ia64*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - *) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - sco3.2v5*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs_F77=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_F77='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv5*) - no_undefined_flag_F77=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_F77= - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 -test "$ld_shlibs_F77" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` - sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var F77" || \ - test "X$hardcode_automatic_F77"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 - -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14749: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14753: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - sco3.2v5*) - lt_prog_compiler_pic_GCJ='-Kpic' - lt_prog_compiler_static_GCJ='-dn' - ;; - - solaris*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14982: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14986: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15042: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:15046: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - lt_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - linux*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds_GCJ="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds_GCJ="$tmp_archive_cmds" - fi - else - ld_shlibs_GCJ=no - fi - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_GCJ=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ=' ' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi4*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes ; then - archive_cmds_need_lc_GCJ=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='-all_load $convenience' - link_all_deplibs_GCJ=yes - else - ld_shlibs_GCJ=no - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - ia64*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - *) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - sco3.2v5*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs_GCJ=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv5*) - no_undefined_flag_GCJ=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_GCJ= - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` - sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var GCJ" || \ - test "X$hardcode_automatic_GCJ"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 - -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 17226 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -#line 17324 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - RC) - - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -######### -# Set up an appropriate program prefix -# -if test "$program_prefix" = "NONE"; then - program_prefix="" -fi - - -VERSION=`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'` -echo "Version set to $VERSION" - -RELEASE=`cat $srcdir/VERSION` -echo "Release set to $RELEASE" - -VERSION_NUMBER=`cat $srcdir/VERSION \ - | sed 's/[^0-9]/ /g' \ - | awk '{printf "%d%03d%03d",$1,$2,$3}'` -echo "Version number set to $VERSION_NUMBER" - - -######### -# Check to see if the --with-hints=FILE option is used. If there is none, -# then check for a files named "$host.hints" and ../$hosts.hints where -# $host is the hostname of the build system. If still no hints are -# found, try looking in $system.hints and ../$system.hints where -# $system is the result of uname -s. -# - -# Check whether --with-hints or --without-hints was given. -if test "${with_hints+set}" = set; then - withval="$with_hints" - hints=$withval -fi; -if test "$hints" = ""; then - host=`hostname | sed 's/\..*//'` - if test -r $host.hints; then - hints=$host.hints - else - if test -r ../$host.hints; then - hints=../$host.hints - fi - fi -fi -if test "$hints" = ""; then - sys=`uname -s` - if test -r $sys.hints; then - hints=$sys.hints - else - if test -r ../$sys.hints; then - hints=../$sys.hints - fi - fi -fi -if test "$hints" != ""; then - echo "$as_me:$LINENO: result: reading hints from $hints" >&5 -echo "${ECHO_T}reading hints from $hints" >&6 - . $hints -fi - -######### -# Locate a compiler for the build machine. This compiler should -# generate command-line programs that run on the build machine. -# -default_build_cflags="-g" -if test "$config_BUILD_CC" = ""; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include <stdlib.h> -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - if test "$cross_compiling" = "yes"; then - { { echo "$as_me:$LINENO: error: unable to find a compiler for building build tools" >&5 -echo "$as_me: error: unable to find a compiler for building build tools" >&2;} - { (exit 1); exit 1; }; } - fi - BUILD_CC=$CC - default_build_cflags=$CFLAGS -else - BUILD_CC=$config_BUILD_CC - echo "$as_me:$LINENO: checking host compiler" >&5 -echo $ECHO_N "checking host compiler... $ECHO_C" >&6 - CC=$BUILD_CC - echo "$as_me:$LINENO: result: $BUILD_CC" >&5 -echo "${ECHO_T}$BUILD_CC" >&6 -fi -echo "$as_me:$LINENO: checking switches for the host compiler" >&5 -echo $ECHO_N "checking switches for the host compiler... $ECHO_C" >&6 -if test "$config_BUILD_CFLAGS" != ""; then - CFLAGS=$config_BUILD_CFLAGS - BUILD_CFLAGS=$config_BUILD_CFLAGS -else - BUILD_CFLAGS=$default_build_cflags -fi -echo "$as_me:$LINENO: result: $BUILD_CFLAGS" >&5 -echo "${ECHO_T}$BUILD_CFLAGS" >&6 -if test "$config_BUILD_LIBS" != ""; then - BUILD_LIBS=$config_BUILD_LIBS -fi - - - - -########## -# Locate a compiler that converts C code into *.o files that run on -# the target machine. -# -echo "$as_me:$LINENO: checking target compiler" >&5 -echo $ECHO_N "checking target compiler... $ECHO_C" >&6 -if test "$config_TARGET_CC" != ""; then - TARGET_CC=$config_TARGET_CC -else - TARGET_CC=$BUILD_CC -fi -echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6 -echo "$as_me:$LINENO: checking switches on the target compiler" >&5 -echo $ECHO_N "checking switches on the target compiler... $ECHO_C" >&6 -if test "$config_TARGET_CFLAGS" != ""; then - TARGET_CFLAGS=$config_TARGET_CFLAGS -else - TARGET_CFLAGS=$BUILD_CFLAGS -fi -echo "$as_me:$LINENO: result: $TARGET_CFLAGS" >&5 -echo "${ECHO_T}$TARGET_CFLAGS" >&6 -echo "$as_me:$LINENO: checking target linker" >&5 -echo $ECHO_N "checking target linker... $ECHO_C" >&6 -if test "$config_TARGET_LINK" = ""; then - TARGET_LINK=$TARGET_CC -else - TARGET_LINK=$config_TARGET_LINK -fi -echo "$as_me:$LINENO: result: $TARGET_LINK" >&5 -echo "${ECHO_T}$TARGET_LINK" >&6 -echo "$as_me:$LINENO: checking switches on the target compiler" >&5 -echo $ECHO_N "checking switches on the target compiler... $ECHO_C" >&6 -if test "$config_TARGET_TFLAGS" != ""; then - TARGET_TFLAGS=$config_TARGET_TFLAGS -else - TARGET_TFLAGS=$BUILD_CFLAGS -fi -if test "$config_TARGET_RANLIB" != ""; then - TARGET_RANLIB=$config_TARGET_RANLIB -else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - TARGET_RANLIB=$RANLIB -fi -if test "$config_TARGET_AR" != ""; then - TARGET_AR=$config_TARGET_AR -else - TARGET_AR='ar cr' -fi -echo "$as_me:$LINENO: result: $TARGET_TFLAGS" >&5 -echo "${ECHO_T}$TARGET_TFLAGS" >&6 - - - - - - - -# Set the $cross variable if we are cross-compiling. Make -# it 0 if we are not. -# -echo "$as_me:$LINENO: checking if host and target compilers are the same" >&5 -echo $ECHO_N "checking if host and target compilers are the same... $ECHO_C" >&6 -if test "$BUILD_CC" = "$TARGET_CC"; then - cross=0 - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - cross=1 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -########## -# Do we want to support multithreaded use of sqlite -# -# Check whether --enable-threadsafe or --disable-threadsafe was given. -if test "${enable_threadsafe+set}" = set; then - enableval="$enable_threadsafe" - -else - enable_threadsafe=no -fi; -echo "$as_me:$LINENO: checking whether to support threadsafe operation" >&5 -echo $ECHO_N "checking whether to support threadsafe operation... $ECHO_C" >&6 -if test "$enable_threadsafe" = "no"; then - THREADSAFE=0 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -else - THREADSAFE=1 - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -fi - - -if test "$THREADSAFE" = "1"; then - LIBS="" - -echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_create (); -int -main () -{ -pthread_create (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_create=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_create=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 -if test $ac_cv_lib_pthread_pthread_create = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - - TARGET_THREAD_LIB="$LIBS" - LIBS="" -else - TARGET_THREAD_LIB="" -fi - - -########## -# Do we want to support release -# -# Check whether --enable-releasemode or --disable-releasemode was given. -if test "${enable_releasemode+set}" = set; then - enableval="$enable_releasemode" - -else - enable_releasemode=no -fi; -echo "$as_me:$LINENO: checking whether to support shared library linked as release mode or not" >&5 -echo $ECHO_N "checking whether to support shared library linked as release mode or not... $ECHO_C" >&6 -if test "$enable_releasemode" = "no"; then - ALLOWRELEASE="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -else - ALLOWRELEASE="-release `cat VERSION`" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -fi - - -########## -# Do we want temporary databases in memory -# -# Check whether --enable-tempstore or --disable-tempstore was given. -if test "${enable_tempstore+set}" = set; then - enableval="$enable_tempstore" - -else - enable_tempstore=yes -fi; -echo "$as_me:$LINENO: checking whether to use an in-ram database for temporary tables" >&5 -echo $ECHO_N "checking whether to use an in-ram database for temporary tables... $ECHO_C" >&6 -case "$enable_tempstore" in - never ) - TEMP_STORE=0 - echo "$as_me:$LINENO: result: never" >&5 -echo "${ECHO_T}never" >&6 - ;; - no ) - TEMP_STORE=1 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - always ) - TEMP_STORE=3 - echo "$as_me:$LINENO: result: always" >&5 -echo "${ECHO_T}always" >&6 - ;; - * ) - TEMP_STORE=2 - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - ;; -esac - - - -########### -# Lots of things are different if we are compiling for Windows using -# the CYGWIN environment. So check for that special case and handle -# things accordingly. -# -echo "$as_me:$LINENO: checking if executables have the .exe suffix" >&5 -echo $ECHO_N "checking if executables have the .exe suffix... $ECHO_C" >&6 -if test "$config_BUILD_EXEEXT" = ".exe"; then - CYGWIN=yes - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: unknown" >&5 -echo "${ECHO_T}unknown" >&6 -fi -if test "$CYGWIN" != "yes"; then - -case $host_os in - *cygwin* ) CYGWIN=yes;; - * ) CYGWIN=no;; -esac - -fi -if test "$CYGWIN" = "yes"; then - BUILD_EXEEXT=.exe -else - BUILD_EXEEXT=$EXEEXT -fi -if test "$cross" = "0"; then - TARGET_EXEEXT=$BUILD_EXEEXT -else - TARGET_EXEEXT=$config_TARGET_EXEEXT -fi -if test "$TARGET_EXEEXT" = ".exe"; then - OS_UNIX=0 - OS_WIN=1 - tclsubdir=win - TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1" -else - OS_UNIX=1 - OS_WIN=0 - tclsubdir=unix - TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1" -fi - - - - - - -########## -# Extract generic linker options from the environment. -# -if test "$config_TARGET_LIBS" != ""; then - TARGET_LIBS=$config_TARGET_LIBS -else - TARGET_LIBS="" -fi - - -########## -# Figure out all the parameters needed to compile against Tcl. -# -# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG -# macros in the in the tcl.m4 file of the standard TCL distribution. -# Those macros could not be used directly since we have to make some -# minor changes to accomodate systems that do not have TCL installed. -# -# Check whether --enable-tcl or --disable-tcl was given. -if test "${enable_tcl+set}" = set; then - enableval="$enable_tcl" - use_tcl=$enableval -else - use_tcl=yes -fi; -if test "${use_tcl}" = "yes" ; then - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tclconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - `ls -d ${libdir} 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - use_tcl=no - { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - { echo "$as_me:$LINENO: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&5 -echo "$as_me: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&2;} - { echo "$as_me:$LINENO: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&5 -echo "$as_me: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&2;} - else - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 -echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 - - echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . $TCL_BIN_DIR/tclConfig.sh - else - echo "$as_me:$LINENO: result: file not found" >&5 -echo "${ECHO_T}file not found" >&6 - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - fi -fi -if test "${use_tcl}" = "no" ; then - HAVE_TCL="" -else - HAVE_TCL=1 -fi - - -########## -# Figure out what C libraries are required to compile programs -# that use "readline()" library. -# -if test "$config_TARGET_READLINE_LIBS" != ""; then - TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS" -else - CC=$TARGET_CC - LIBS="" - echo "$as_me:$LINENO: checking for library containing tgetent" >&5 -echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6 -if test "${ac_cv_search_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_tgetent=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); -int -main () -{ -tgetent (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_tgetent="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_tgetent" = no; then - for ac_lib in readline ncurses curses termcap; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); -int -main () -{ -tgetent (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_tgetent="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5 -echo "${ECHO_T}$ac_cv_search_tgetent" >&6 -if test "$ac_cv_search_tgetent" != no; then - test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS" - -fi - - -echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 -echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 -if test "${ac_cv_lib_readline_readline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char readline (); -int -main () -{ -readline (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_readline_readline=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_readline_readline=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 -if test $ac_cv_lib_readline_readline = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBREADLINE 1 -_ACEOF - - LIBS="-lreadline $LIBS" - -fi - - TARGET_READLINE_LIBS="$LIBS" -fi - - -########## -# Figure out where to get the READLINE header files. -# -echo "$as_me:$LINENO: checking readline header files" >&5 -echo $ECHO_N "checking readline header files... $ECHO_C" >&6 -found=no -if test "$config_TARGET_READLINE_INC" != ""; then - TARGET_READLINE_INC=$config_TARGET_READLINE_INC - found=yes -fi -if test "$found" = "yes"; then - echo "$as_me:$LINENO: result: $TARGET_READLINE_INC" >&5 -echo "${ECHO_T}$TARGET_READLINE_INC" >&6 -else - echo "$as_me:$LINENO: result: not specified: still searching..." >&5 -echo "${ECHO_T}not specified: still searching..." >&6 - if test "${ac_cv_header_readline_h+set}" = set; then - echo "$as_me:$LINENO: checking for readline.h" >&5 -echo $ECHO_N "checking for readline.h... $ECHO_C" >&6 -if test "${ac_cv_header_readline_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 -echo "${ECHO_T}$ac_cv_header_readline_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking readline.h usability" >&5 -echo $ECHO_N "checking readline.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <readline.h> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking readline.h presence" >&5 -echo $ECHO_N "checking readline.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <readline.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: readline.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: readline.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: readline.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: readline.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: readline.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: readline.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: readline.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: readline.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for readline.h" >&5 -echo $ECHO_N "checking for readline.h... $ECHO_C" >&6 -if test "${ac_cv_header_readline_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_readline_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 -echo "${ECHO_T}$ac_cv_header_readline_h" >&6 - -fi -if test $ac_cv_header_readline_h = yes; then - found=yes -fi - - -fi -if test "$found" = "no"; then - for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do - as_ac_File=`echo "ac_cv_file_$dir/include/readline.h" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $dir/include/readline.h" >&5 -echo $ECHO_N "checking for $dir/include/readline.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } -if test -r "$dir/include/readline.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - found=yes -fi - - if test "$found" = "yes"; then - TARGET_READLINE_INC="-I$dir/include" - break - fi - as_ac_File=`echo "ac_cv_file_$dir/include/readline/readline.h" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $dir/include/readline/readline.h" >&5 -echo $ECHO_N "checking for $dir/include/readline/readline.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } -if test -r "$dir/include/readline/readline.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - found=yes -fi - - if test "$found" = "yes"; then - TARGET_READLINE_INC="-I$dir/include/readline" - break - fi - done -fi -if test "$found" = "yes"; then - if test "$TARGET_READLINE_LIBS" = ""; then - TARGET_HAVE_READLINE=0 - else - TARGET_HAVE_READLINE=1 - fi -else - TARGET_HAVE_READLINE=0 -fi - - - -######### -# check for debug enabled -# Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - use_debug=$enableval -else - use_debug=no -fi; -if test "${use_debug}" = "yes" ; then - TARGET_DEBUG="" -else - TARGET_DEBUG="-DNDEBUG" -fi - - -######### -# Figure out whether or not we have a "usleep()" function. -# -echo "$as_me:$LINENO: checking for usleep" >&5 -echo $ECHO_N "checking for usleep... $ECHO_C" >&6 -if test "${ac_cv_func_usleep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define usleep to an innocuous variant, in case <limits.h> declares usleep. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define usleep innocuous_usleep - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char usleep (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef usleep - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char usleep (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_usleep) || defined (__stub___usleep) -choke me -#else -char (*f) () = usleep; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != usleep; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_usleep=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_usleep=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_usleep" >&5 -echo "${ECHO_T}$ac_cv_func_usleep" >&6 -if test $ac_cv_func_usleep = yes; then - TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1" -fi - - -######### -# Generate the output files. -# - ac_config_files="$ac_config_files Makefile sqlite3.pc" -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to <bug-autoconf@gnu.org>." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "sqlite3.pc" ) CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@EGREP@,$EGREP,;t t -s,@LN_S@,$LN_S,;t t -s,@ECHO@,$ECHO,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@CPP@,$CPP,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@F77@,$F77,;t t -s,@FFLAGS@,$FFLAGS,;t t -s,@ac_ct_F77@,$ac_ct_F77,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@program_prefix@,$program_prefix,;t t -s,@VERSION@,$VERSION,;t t -s,@RELEASE@,$RELEASE,;t t -s,@VERSION_NUMBER@,$VERSION_NUMBER,;t t -s,@BUILD_CC@,$BUILD_CC,;t t -s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t -s,@BUILD_LIBS@,$BUILD_LIBS,;t t -s,@TARGET_CC@,$TARGET_CC,;t t -s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t -s,@TARGET_LINK@,$TARGET_LINK,;t t -s,@TARGET_LFLAGS@,$TARGET_LFLAGS,;t t -s,@TARGET_RANLIB@,$TARGET_RANLIB,;t t -s,@TARGET_AR@,$TARGET_AR,;t t -s,@THREADSAFE@,$THREADSAFE,;t t -s,@TARGET_THREAD_LIB@,$TARGET_THREAD_LIB,;t t -s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t -s,@TEMP_STORE@,$TEMP_STORE,;t t -s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t -s,@OS_UNIX@,$OS_UNIX,;t t -s,@OS_WIN@,$OS_WIN,;t t -s,@TARGET_EXEEXT@,$TARGET_EXEEXT,;t t -s,@TARGET_LIBS@,$TARGET_LIBS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@TCL_INCLUDE_SPEC@,$TCL_INCLUDE_SPEC,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@HAVE_TCL@,$HAVE_TCL,;t t -s,@TARGET_READLINE_LIBS@,$TARGET_READLINE_LIBS,;t t -s,@TARGET_READLINE_INC@,$TARGET_READLINE_INC,;t t -s,@TARGET_HAVE_READLINE@,$TARGET_HAVE_READLINE,;t t -s,@TARGET_DEBUG@,$TARGET_DEBUG,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/ext/pdo_sqlite/sqlite/configure.ac b/ext/pdo_sqlite/sqlite/configure.ac deleted file mode 100644 index 3682bf82107f3..0000000000000 --- a/ext/pdo_sqlite/sqlite/configure.ac +++ /dev/null @@ -1,616 +0,0 @@ -# -# The build process allows for using a cross-compiler. But the default -# action is to target the same platform that we are running on. The -# configure script needs to discover the following properties of the -# build and target systems: -# -# srcdir -# -# The is the name of the directory that contains the -# "configure" shell script. All source files are -# located relative to this directory. -# -# bindir -# -# The name of the directory where executables should be -# written by the "install" target of the makefile. -# -# program_prefix -# -# Add this prefix to the names of all executables that run -# on the target machine. Default: "" -# -# ENABLE_SHARED -# -# True if shared libraries should be generated. -# -# BUILD_CC -# -# The name of a command that is used to convert C -# source files into executables that run on the build -# platform. -# -# BUILD_CFLAGS -# -# Switches that the build compiler needs in order to construct -# command-line programs. -# -# BUILD_LIBS -# -# Libraries that the build compiler needs in order to construct -# command-line programs. -# -# BUILD_EXEEXT -# -# The filename extension for executables on the build -# platform. "" for Unix and ".exe" for Windows. -# -# TARGET_CC -# -# The name of a command that runs on the build platform -# and converts C source files into *.o files for the -# target platform. In other words, the cross-compiler. -# -# TARGET_CFLAGS -# -# Switches that the target compiler needs to turn C source files -# into *.o files. Do not include TARGET_TCL_INC in this list. -# Makefiles might add additional switches such as "-I.". -# -# TCL_* -# -# Lots of values are read in from the tclConfig.sh script, -# if that script is available. This values are used for -# constructing and installing the TCL extension. -# -# TARGET_READLINE_LIBS -# -# This is the library directives passed to the target linker -# that cause the executable to link against the readline library. -# This might be a switch like "-lreadline" or pathnames of library -# file like "../../src/libreadline.a". -# -# TARGET_READLINE_INC -# -# This variables define the directory that contain header -# files for the readline library. If the compiler is able -# to find <readline.h> on its own, then this can be blank. -# -# TARGET_LINK -# -# The name of the linker that combines *.o files generated -# by TARGET_CC into executables for the target platform. -# -# TARGET_LIBS -# -# Additional libraries or other switch that the target linker needs -# to build an executable on the target. Do not include -# on this list any libraries in TARGET_TCL_LIBS and -# TARGET_READLINE_LIBS, etc. -# -# TARGET_EXEEXT -# -# The filename extension for executables on the -# target platform. "" for Unix and ".exe" for windows. -# -# The generated configure script will make an attempt to guess -# at all of the above parameters. You can override any of -# the guesses by setting the environment variable named -# "config_AAAA" where "AAAA" is the name of the parameter -# described above. (Exception: srcdir cannot be set this way.) -# If you have a file that sets one or more of these environment -# variables, you can invoke configure as follows: -# -# configure --with-hints=FILE -# -# where FILE is the name of the file that sets the environment -# variables. FILE should be an absolute pathname. -# -# This configure.in file is easy to reuse on other projects. Just -# change the argument to AC_INIT(). And disable any features that -# you don't need (for example BLT) by erasing or commenting out -# the corresponding code. -# -AC_INIT(src/sqlite.h.in) - -dnl Put the RCS revision string after AC_INIT so that it will also -dnl show in in configure. -# The following RCS revision string applies to configure.in -# $Revision$ - -######### -# Programs needed -# -AC_PROG_LIBTOOL -AC_PROG_INSTALL - -######### -# Set up an appropriate program prefix -# -if test "$program_prefix" = "NONE"; then - program_prefix="" -fi -AC_SUBST(program_prefix) - -VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] -echo "Version set to $VERSION" -AC_SUBST(VERSION) -RELEASE=`cat $srcdir/VERSION` -echo "Release set to $RELEASE" -AC_SUBST(RELEASE) -VERSION_NUMBER=[`cat $srcdir/VERSION \ - | sed 's/[^0-9]/ /g' \ - | awk '{printf "%d%03d%03d",$1,$2,$3}'`] -echo "Version number set to $VERSION_NUMBER" -AC_SUBST(VERSION_NUMBER) - -######### -# Check to see if the --with-hints=FILE option is used. If there is none, -# then check for a files named "$host.hints" and ../$hosts.hints where -# $host is the hostname of the build system. If still no hints are -# found, try looking in $system.hints and ../$system.hints where -# $system is the result of uname -s. -# -AC_ARG_WITH(hints, - [ --with-hints=FILE Read configuration options from FILE], - hints=$withval) -if test "$hints" = ""; then - host=`hostname | sed 's/\..*//'` - if test -r $host.hints; then - hints=$host.hints - else - if test -r ../$host.hints; then - hints=../$host.hints - fi - fi -fi -if test "$hints" = ""; then - sys=`uname -s` - if test -r $sys.hints; then - hints=$sys.hints - else - if test -r ../$sys.hints; then - hints=../$sys.hints - fi - fi -fi -if test "$hints" != ""; then - AC_MSG_RESULT(reading hints from $hints) - . $hints -fi - -######### -# Locate a compiler for the build machine. This compiler should -# generate command-line programs that run on the build machine. -# -default_build_cflags="-g" -if test "$config_BUILD_CC" = ""; then - AC_PROG_CC - if test "$cross_compiling" = "yes"; then - AC_MSG_ERROR([unable to find a compiler for building build tools]) - fi - BUILD_CC=$CC - default_build_cflags=$CFLAGS -else - BUILD_CC=$config_BUILD_CC - AC_MSG_CHECKING([host compiler]) - CC=$BUILD_CC - AC_MSG_RESULT($BUILD_CC) -fi -AC_MSG_CHECKING([switches for the host compiler]) -if test "$config_BUILD_CFLAGS" != ""; then - CFLAGS=$config_BUILD_CFLAGS - BUILD_CFLAGS=$config_BUILD_CFLAGS -else - BUILD_CFLAGS=$default_build_cflags -fi -AC_MSG_RESULT($BUILD_CFLAGS) -if test "$config_BUILD_LIBS" != ""; then - BUILD_LIBS=$config_BUILD_LIBS -fi -AC_SUBST(BUILD_CC) -AC_SUBST(BUILD_CFLAGS) -AC_SUBST(BUILD_LIBS) - -########## -# Locate a compiler that converts C code into *.o files that run on -# the target machine. -# -AC_MSG_CHECKING([target compiler]) -if test "$config_TARGET_CC" != ""; then - TARGET_CC=$config_TARGET_CC -else - TARGET_CC=$BUILD_CC -fi -AC_MSG_RESULT($TARGET_CC) -AC_MSG_CHECKING([switches on the target compiler]) -if test "$config_TARGET_CFLAGS" != ""; then - TARGET_CFLAGS=$config_TARGET_CFLAGS -else - TARGET_CFLAGS=$BUILD_CFLAGS -fi -AC_MSG_RESULT($TARGET_CFLAGS) -AC_MSG_CHECKING([target linker]) -if test "$config_TARGET_LINK" = ""; then - TARGET_LINK=$TARGET_CC -else - TARGET_LINK=$config_TARGET_LINK -fi -AC_MSG_RESULT($TARGET_LINK) -AC_MSG_CHECKING([switches on the target compiler]) -if test "$config_TARGET_TFLAGS" != ""; then - TARGET_TFLAGS=$config_TARGET_TFLAGS -else - TARGET_TFLAGS=$BUILD_CFLAGS -fi -if test "$config_TARGET_RANLIB" != ""; then - TARGET_RANLIB=$config_TARGET_RANLIB -else - AC_PROG_RANLIB - TARGET_RANLIB=$RANLIB -fi -if test "$config_TARGET_AR" != ""; then - TARGET_AR=$config_TARGET_AR -else - TARGET_AR='ar cr' -fi -AC_MSG_RESULT($TARGET_TFLAGS) -AC_SUBST(TARGET_CC) -AC_SUBST(TARGET_CFLAGS) -AC_SUBST(TARGET_LINK) -AC_SUBST(TARGET_LFLAGS) -AC_SUBST(TARGET_RANLIB) -AC_SUBST(TARGET_AR) - -# Set the $cross variable if we are cross-compiling. Make -# it 0 if we are not. -# -AC_MSG_CHECKING([if host and target compilers are the same]) -if test "$BUILD_CC" = "$TARGET_CC"; then - cross=0 - AC_MSG_RESULT(yes) -else - cross=1 - AC_MSG_RESULT(no) -fi - -########## -# Do we want to support multithreaded use of sqlite -# -AC_ARG_ENABLE(threadsafe, -[ --enable-threadsafe Support threadsafe operation],,enable_threadsafe=no) -AC_MSG_CHECKING([whether to support threadsafe operation]) -if test "$enable_threadsafe" = "no"; then - THREADSAFE=0 - AC_MSG_RESULT([no]) -else - THREADSAFE=1 - AC_MSG_RESULT([yes]) -fi -AC_SUBST(THREADSAFE) - -if test "$THREADSAFE" = "1"; then - LIBS="" - AC_CHECK_LIB(pthread, pthread_create) - TARGET_THREAD_LIB="$LIBS" - LIBS="" -else - TARGET_THREAD_LIB="" -fi -AC_SUBST(TARGET_THREAD_LIB) - -########## -# Do we want to support release -# -AC_ARG_ENABLE(releasemode, -[ --enable-releasemode Support libtool link to release mode],,enable_releasemode=no) -AC_MSG_CHECKING([whether to support shared library linked as release mode or not]) -if test "$enable_releasemode" = "no"; then - ALLOWRELEASE="" - AC_MSG_RESULT([no]) -else - ALLOWRELEASE="-release `cat VERSION`" - AC_MSG_RESULT([yes]) -fi -AC_SUBST(ALLOWRELEASE) - -########## -# Do we want temporary databases in memory -# -AC_ARG_ENABLE(tempstore, -[ --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always)],,enable_tempstore=yes) -AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) -case "$enable_tempstore" in - never ) - TEMP_STORE=0 - AC_MSG_RESULT([never]) - ;; - no ) - TEMP_STORE=1 - AC_MSG_RESULT([no]) - ;; - always ) - TEMP_STORE=3 - AC_MSG_RESULT([always]) - ;; - * ) - TEMP_STORE=2 - AC_MSG_RESULT([yes]) - ;; -esac - -AC_SUBST(TEMP_STORE) - -########### -# Lots of things are different if we are compiling for Windows using -# the CYGWIN environment. So check for that special case and handle -# things accordingly. -# -AC_MSG_CHECKING([if executables have the .exe suffix]) -if test "$config_BUILD_EXEEXT" = ".exe"; then - CYGWIN=yes - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(unknown) -fi -if test "$CYGWIN" != "yes"; then - AC_CYGWIN -fi -if test "$CYGWIN" = "yes"; then - BUILD_EXEEXT=.exe -else - BUILD_EXEEXT=$EXEEXT -fi -if test "$cross" = "0"; then - TARGET_EXEEXT=$BUILD_EXEEXT -else - TARGET_EXEEXT=$config_TARGET_EXEEXT -fi -if test "$TARGET_EXEEXT" = ".exe"; then - OS_UNIX=0 - OS_WIN=1 - tclsubdir=win - TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1" -else - OS_UNIX=1 - OS_WIN=0 - tclsubdir=unix - TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1" -fi - -AC_SUBST(BUILD_EXEEXT) -AC_SUBST(OS_UNIX) -AC_SUBST(OS_WIN) -AC_SUBST(TARGET_EXEEXT) - -########## -# Extract generic linker options from the environment. -# -if test "$config_TARGET_LIBS" != ""; then - TARGET_LIBS=$config_TARGET_LIBS -else - TARGET_LIBS="" -fi -AC_SUBST(TARGET_LIBS) - -########## -# Figure out all the parameters needed to compile against Tcl. -# -# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG -# macros in the in the tcl.m4 file of the standard TCL distribution. -# Those macros could not be used directly since we have to make some -# minor changes to accomodate systems that do not have TCL installed. -# -AC_ARG_ENABLE(tcl, [ --disable-tcl do not build TCL extension], - [use_tcl=$enableval],[use_tcl=yes]) -if test "${use_tcl}" = "yes" ; then - AC_ARG_WITH(tcl, [ --with-tcl=DIR directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - `ls -d ${libdir} 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - use_tcl=no - AC_MSG_WARN(Can't find Tcl configuration definitions) - AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***) - AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***) - else - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) - - AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $TCL_BIN_DIR/tclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_INCLUDE_SPEC) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - fi -fi -if test "${use_tcl}" = "no" ; then - HAVE_TCL="" -else - HAVE_TCL=1 -fi -AC_SUBST(HAVE_TCL) - -########## -# Figure out what C libraries are required to compile programs -# that use "readline()" library. -# -if test "$config_TARGET_READLINE_LIBS" != ""; then - TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS" -else - CC=$TARGET_CC - LIBS="" - AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap]) - AC_CHECK_LIB([readline], [readline]) - TARGET_READLINE_LIBS="$LIBS" -fi -AC_SUBST(TARGET_READLINE_LIBS) - -########## -# Figure out where to get the READLINE header files. -# -AC_MSG_CHECKING([readline header files]) -found=no -if test "$config_TARGET_READLINE_INC" != ""; then - TARGET_READLINE_INC=$config_TARGET_READLINE_INC - found=yes -fi -if test "$found" = "yes"; then - AC_MSG_RESULT($TARGET_READLINE_INC) -else - AC_MSG_RESULT(not specified: still searching...) - AC_CHECK_HEADER(readline.h, [found=yes]) -fi -if test "$found" = "no"; then - for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do - AC_CHECK_FILE($dir/include/readline.h, found=yes) - if test "$found" = "yes"; then - TARGET_READLINE_INC="-I$dir/include" - break - fi - AC_CHECK_FILE($dir/include/readline/readline.h, found=yes) - if test "$found" = "yes"; then - TARGET_READLINE_INC="-I$dir/include/readline" - break - fi - done -fi -if test "$found" = "yes"; then - if test "$TARGET_READLINE_LIBS" = ""; then - TARGET_HAVE_READLINE=0 - else - TARGET_HAVE_READLINE=1 - fi -else - TARGET_HAVE_READLINE=0 -fi -AC_SUBST(TARGET_READLINE_INC) -AC_SUBST(TARGET_HAVE_READLINE) - -######### -# check for debug enabled -AC_ARG_ENABLE(debug, [ --enable-debug enable debugging & verbose explain], - [use_debug=$enableval],[use_debug=no]) -if test "${use_debug}" = "yes" ; then - TARGET_DEBUG="" -else - TARGET_DEBUG="-DNDEBUG" -fi -AC_SUBST(TARGET_DEBUG) - -######### -# Figure out whether or not we have a "usleep()" function. -# -AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"]) - -######### -# Generate the output files. -# -AC_OUTPUT([ -Makefile -sqlite3.pc -]) diff --git a/ext/pdo_sqlite/sqlite/install-sh b/ext/pdo_sqlite/sqlite/install-sh deleted file mode 100755 index e9de23842dcd4..0000000000000 --- a/ext/pdo_sqlite/sqlite/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/ext/pdo_sqlite/sqlite/ltmain.sh b/ext/pdo_sqlite/sqlite/ltmain.sh deleted file mode 100644 index 4b9f9405393be..0000000000000 --- a/ext/pdo_sqlite/sqlite/ltmain.sh +++ /dev/null @@ -1,6399 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# The name of this program. -progname=`$echo "$0" | ${SED} 's%^.*/%%'` -modename="$progname" - -# Constants. -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.2 -TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08) Debian$Rev: 192 $" - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -# test EBCDIC or ASCII -case `echo A|tr A '\301'` in - A) # EBCDIC based system - SP2NL="tr '\100' '\n'" - NL2SP="tr '\r\n' '\100\100'" - ;; - *) # Assume ASCII based system - SP2NL="tr '\040' '\012'" - NL2SP="tr '\015\012' '\040\040'" - ;; -esac - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi - -# Make sure IFS has a sensible default -: ${IFS=" -"} - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -win32_libid () { - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - -# End of Shell function definitions -##################################### - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2003 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit 0 - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" - done - exit 0 - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) prevopt="--tag" prev=tag ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case "$arg_mode" in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit 1 - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base compile - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case "$base_compile " in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - $echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T <<EOF -# $libobj - a libtool object file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -EOF - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $srcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $srcfile" - fi - - if test ! -d "${xdir}$objdir"; then - $show "$mkdir ${xdir}$objdir" - $run $mkdir ${xdir}$objdir - status=$? - if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $status - fi - fi - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - $run $rm "$lobj" "$output_obj" - - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object='$objdir/$objname' - -EOF - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - else - # No PIC object so indicate it doesn't exist in the libtool - # object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object=none - -EOF - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $srcfile" - else - command="$base_compile $srcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$obj" "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object='$objname' - -EOF - else - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object=none - -EOF - fi - - $run $mv "${libobj}T" "${libobj}" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args="$nonopt" - base_compile="$nonopt $@" - compile_command="$nonopt" - finalize_command="$nonopt" - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base link - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case $base_compile in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in $compile_command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit 1 - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # gcc -m* arguments should be passed to the linker via $compiler_flags - # in order to pass architecture information to the linker - # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo - # but this is not reliable with gcc because gcc may use -mfoo to - # select a different linker, different libraries, etc, while - # -Wl,-mfoo simply passes -mfoo to the linker. - -m*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplcations in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit 1 - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - if test "$deplibs_check_method" != pass_all; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against it, someone - # is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$deplibs $depdepl" ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$deplibs $path" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit 1 - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $revision in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $age in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` - deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $rm conftest - $LTCC -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which I believe you do not have" - $echo "*** because a test_compile did reveal that the linker did not use it for" - $echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - $rm conftest - $LTCC -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because a test_compile did reveal that the linker did not use this one" - $echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - $echo - $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" - $echo "*** library that it depends on before this library will be fully" - $echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$save_output-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$save_output-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$save_output-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadale object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit 0 - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 </dev/null >/dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit 0 - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case $0 in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${output}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 - - cat > $cwrappersource <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "/bin/sh $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. -*/ -EOF - cat >> $cwrappersource<<"EOF" -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -char * basename (const char *name); -char * fnqualify(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup ((char *) basename (argv[0])); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <<EOF - newargz[0] = "$SHELL"; -EOF - - cat >> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; -EOF - - cat >> $cwrappersource <<EOF - execv("$SHELL",newargz); -EOF - - cat >> $cwrappersource <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -char * -basename (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return (char *) base; -} - -char * -fnqualify(const char *path) -{ - size_t size; - char *p; - char tmp[LT_PATHMAX + 1]; - - assert(path != NULL); - - /* Is it qualified already? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); -#endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); - - /* prepend the current directory */ - /* doesn't handle '~' */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - # GNU ar 2.10+ was changed to match POSIX; thus no paths are - # encoded into archives. This makes 'ar r' malfunction in - # this piecewise linking case whenever conflicting object - # names appear in distinct ar calls; check, warn and compensate. - if (for obj in $save_oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 - $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 - AR_FLAGS=cq - fi - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit 1 - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit 1 - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs' - else - exit 0 - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit 0 - - $echo "----------------------------------------------------------------------" - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit 1 -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to <bug-libtool@gnu.org>." - exit 0 - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/ext/pdo_sqlite/sqlite/main.mk b/ext/pdo_sqlite/sqlite/main.mk deleted file mode 100644 index d931e281aed43..0000000000000 --- a/ext/pdo_sqlite/sqlite/main.mk +++ /dev/null @@ -1,565 +0,0 @@ -############################################################################### -# The following macros should be defined before this script is -# invoked: -# -# TOP The toplevel directory of the source tree. This is the -# directory that contains this "Makefile.in" and the -# "configure.in" script. -# -# BCC C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -# USLEEP If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -# THREADSAFE If you want the SQLite library to be safe for use within a -# multi-threaded program, then define the following macro -# appropriately: -# -# THREADLIB Specify any extra linker options needed to make the library -# thread safe -# -# OPTS Extra compiler command-line options. -# -# EXE The suffix to add to executable files. ".exe" for windows -# and "" for Unix. -# -# TCC C Compiler and options for use in building executables that -# will run on the target platform. This is usually the same -# as BCC, unless you are cross-compiling. -# -# AR Tools used to build a static library. -# RANLIB -# -# TCL_FLAGS Extra compiler options needed for programs that use the -# TCL library. -# -# LIBTCL Linker options needed to link against the TCL library. -# -# READLINE_FLAGS Compiler options needed for programs that use the -# readline() library. -# -# LIBREADLINE Linker options needed by programs using readline() must -# link against. -# -# ENCODING "UTF8" or "ISO8859" -# -# Once the macros above are defined, the rest of this make script will -# build the SQLite library and testing tools. -################################################################################ - -# This is how we compile -# -TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src - -# Object files for the SQLite library. -# -LIBOBJ+= alter.o analyze.o attach.o auth.o btree.o build.o \ - callback.o complete.o date.o delete.o \ - expr.o func.o hash.o insert.o \ - main.o opcodes.o os_unix.o os_win.o \ - pager.o parse.o pragma.o prepare.o printf.o random.o \ - select.o table.o tclsqlite.o tokenize.o trigger.o \ - update.o util.o vacuum.o \ - vdbe.o vdbeapi.o vdbeaux.o vdbefifo.o vdbemem.o \ - where.o utf.o legacy.o - -# All of the source code files. -# -SRC = \ - $(TOP)/src/alter.c \ - $(TOP)/src/analyze.c \ - $(TOP)/src/attach.c \ - $(TOP)/src/auth.c \ - $(TOP)/src/btree.c \ - $(TOP)/src/btree.h \ - $(TOP)/src/build.c \ - $(TOP)/src/callback.c \ - $(TOP)/src/complete.c \ - $(TOP)/src/date.c \ - $(TOP)/src/delete.c \ - $(TOP)/src/expr.c \ - $(TOP)/src/func.c \ - $(TOP)/src/hash.c \ - $(TOP)/src/hash.h \ - $(TOP)/src/insert.c \ - $(TOP)/src/legacy.c \ - $(TOP)/src/main.c \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c \ - $(TOP)/src/pager.h \ - $(TOP)/src/parse.y \ - $(TOP)/src/pragma.c \ - $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/random.c \ - $(TOP)/src/select.c \ - $(TOP)/src/shell.c \ - $(TOP)/src/sqlite.h.in \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/table.c \ - $(TOP)/src/tclsqlite.c \ - $(TOP)/src/tokenize.c \ - $(TOP)/src/trigger.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/update.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vacuum.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeapi.c \ - $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbefifo.c \ - $(TOP)/src/vdbemem.c \ - $(TOP)/src/vdbeInt.h \ - $(TOP)/src/where.c - -# Source code to the test files. -# -TESTSRC = \ - $(TOP)/src/btree.c \ - $(TOP)/src/date.c \ - $(TOP)/src/func.c \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c \ - $(TOP)/src/pragma.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/test1.c \ - $(TOP)/src/test2.c \ - $(TOP)/src/test3.c \ - $(TOP)/src/test4.c \ - $(TOP)/src/test5.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/md5.c \ - $(TOP)/src/where.c - -# Header files used by all library source files. -# -HDR = \ - sqlite3.h \ - $(TOP)/src/btree.h \ - $(TOP)/src/hash.h \ - opcodes.h \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/os_unix.h \ - $(TOP)/src/os_win.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/vdbe.h \ - parse.h - -# Header files used by the VDBE submodule -# -VDBEHDR = \ - $(HDR) \ - $(TOP)/src/vdbeInt.h - -# This is the default Makefile target. The objects listed here -# are what get build when you type just "make" with no arguments. -# -all: sqlite3.h libsqlite3.a sqlite3$(EXE) - -# Generate the file "last_change" which contains the date of change -# of the most recently modified source code file -# -last_change: $(SRC) - cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \ - | awk '{print $$5,$$6}' >last_change - -libsqlite3.a: $(LIBOBJ) - $(AR) libsqlite3.a $(LIBOBJ) - $(RANLIB) libsqlite3.a - -sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h - $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(TOP)/src/shell.c \ - libsqlite3.a $(LIBREADLINE) $(THREADLIB) - -objects: $(LIBOBJ_ORIG) - -# This target creates a directory named "tsrc" and fills it with -# copies of all of the C source code and header files needed to -# build on the target system. Some of the C source code and header -# files are automatically generated. This target takes care of -# all that automatic generation. -# -target_source: $(SRC) $(VDBEHDR) opcodes.c keywordhash.h - rm -rf tsrc - mkdir tsrc - cp $(SRC) $(VDBEHDR) tsrc - rm tsrc/sqlite.h.in tsrc/parse.y - cp parse.c opcodes.c keywordhash.h tsrc - cp $(TOP)/sqlite3.def tsrc - -# Rules to build the LEMON compiler generator -# -lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c - $(BCC) -o lemon $(TOP)/tool/lemon.c - cp $(TOP)/tool/lempar.c . - -# Rules to build individual files -# -alter.o: $(TOP)/src/alter.c $(HDR) - $(TCCX) -c $(TOP)/src/alter.c - -analyze.o: $(TOP)/src/analyze.c $(HDR) - $(TCCX) -c $(TOP)/src/analyze.c - -attach.o: $(TOP)/src/attach.c $(HDR) - $(TCCX) -c $(TOP)/src/attach.c - -auth.o: $(TOP)/src/auth.c $(HDR) - $(TCCX) -c $(TOP)/src/auth.c - -btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h - $(TCCX) -c $(TOP)/src/btree.c - -build.o: $(TOP)/src/build.c $(HDR) - $(TCCX) -c $(TOP)/src/build.c - -callback.o: $(TOP)/src/callback.c $(HDR) - $(TCCX) -c $(TOP)/src/callback.c - -complete.o: $(TOP)/src/complete.c $(HDR) - $(TCCX) -c $(TOP)/src/complete.c - -date.o: $(TOP)/src/date.c $(HDR) - $(TCCX) -c $(TOP)/src/date.c - -delete.o: $(TOP)/src/delete.c $(HDR) - $(TCCX) -c $(TOP)/src/delete.c - -expr.o: $(TOP)/src/expr.c $(HDR) - $(TCCX) -c $(TOP)/src/expr.c - -func.o: $(TOP)/src/func.c $(HDR) - $(TCCX) -c $(TOP)/src/func.c - -hash.o: $(TOP)/src/hash.c $(HDR) - $(TCCX) -c $(TOP)/src/hash.c - -insert.o: $(TOP)/src/insert.c $(HDR) - $(TCCX) -c $(TOP)/src/insert.c - -legacy.o: $(TOP)/src/legacy.c $(HDR) - $(TCCX) -c $(TOP)/src/legacy.c - -main.o: $(TOP)/src/main.c $(HDR) - $(TCCX) -c $(TOP)/src/main.c - -pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h - $(TCCX) -c $(TOP)/src/pager.c - -opcodes.o: opcodes.c - $(TCCX) -c opcodes.c - -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - sort -n -b +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c - -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk - cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h - -os_unix.o: $(TOP)/src/os_unix.c $(HDR) - $(TCCX) -c $(TOP)/src/os_unix.c - -os_win.o: $(TOP)/src/os_win.c $(HDR) - $(TCCX) -c $(TOP)/src/os_win.c - -parse.o: parse.c $(HDR) - $(TCCX) -c parse.c - -parse.h: parse.c - -parse.c: $(TOP)/src/parse.y lemon - cp $(TOP)/src/parse.y . - ./lemon $(OPTS) parse.y - -pragma.o: $(TOP)/src/pragma.c $(HDR) - $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/pragma.c - -prepare.o: $(TOP)/src/prepare.c $(HDR) - $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/prepare.c - -printf.o: $(TOP)/src/printf.c $(HDR) - $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/printf.c - -random.o: $(TOP)/src/random.c $(HDR) - $(TCCX) -c $(TOP)/src/random.c - -select.o: $(TOP)/src/select.c $(HDR) - $(TCCX) -c $(TOP)/src/select.c - -sqlite3.h: $(TOP)/src/sqlite.h.in - sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \ - -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | awk '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \ - $(TOP)/src/sqlite.h.in >sqlite3.h - -table.o: $(TOP)/src/table.c $(HDR) - $(TCCX) -c $(TOP)/src/table.c - -tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR) - $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c - -tokenize.o: $(TOP)/src/tokenize.c keywordhash.h $(HDR) - $(TCCX) -c $(TOP)/src/tokenize.c - -keywordhash.h: $(TOP)/tool/mkkeywordhash.c - $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c - ./mkkeywordhash >keywordhash.h - -trigger.o: $(TOP)/src/trigger.c $(HDR) - $(TCCX) -c $(TOP)/src/trigger.c - -update.o: $(TOP)/src/update.c $(HDR) - $(TCCX) -c $(TOP)/src/update.c - -utf.o: $(TOP)/src/utf.c $(HDR) - $(TCCX) -c $(TOP)/src/utf.c - -util.o: $(TOP)/src/util.c $(HDR) - $(TCCX) -c $(TOP)/src/util.c - -vacuum.o: $(TOP)/src/vacuum.c $(HDR) - $(TCCX) -c $(TOP)/src/vacuum.c - -vdbe.o: $(TOP)/src/vdbe.c $(VDBEHDR) - $(TCCX) -c $(TOP)/src/vdbe.c - -vdbeapi.o: $(TOP)/src/vdbeapi.c $(VDBEHDR) - $(TCCX) -c $(TOP)/src/vdbeapi.c - -vdbeaux.o: $(TOP)/src/vdbeaux.c $(VDBEHDR) - $(TCCX) -c $(TOP)/src/vdbeaux.c - -vdbefifo.o: $(TOP)/src/vdbefifo.c $(VDBEHDR) - $(TCCX) -c $(TOP)/src/vdbefifo.c - -vdbemem.o: $(TOP)/src/vdbemem.c $(VDBEHDR) - $(TCCX) -c $(TOP)/src/vdbemem.c - -where.o: $(TOP)/src/where.c $(HDR) - $(TCCX) -c $(TOP)/src/where.c - -# Rules for building test programs and for running tests -# -tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a - $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \ - $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB) - -testfixture$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) - $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture$(EXE) \ - $(TESTSRC) $(TOP)/src/tclsqlite.c \ - libsqlite3.a $(LIBTCL) $(THREADLIB) - -crashtest: $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) $(TOP)/src/os_test.c - $(TCCX) $(TCL_FLAGS) -DOS_TEST=1 -DTCLSH=1 -DSQLITE_TEST=1 \ - -o crashtest \ - $(TESTSRC) $(TOP)/src/os_test.c $(TOP)/src/tclsqlite.c \ - libsqlite3.a $(LIBTCL) $(THREADLIB) - -fulltest: testfixture$(EXE) sqlite3$(EXE) crashtest - ./testfixture$(EXE) $(TOP)/test/all.test - -test: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/quick.test - -sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) \ - $(TOP)/tool/spaceanal.tcl - sed \ - -e '/^#/d' \ - -e 's,\\,\\\\,g' \ - -e 's,",\\",g' \ - -e 's,^,",' \ - -e 's,$$,\\n",' \ - $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h - $(TCCX) $(TCL_FLAGS) -DTCLSH=2 -DSQLITE_TEST=1 -o \ - sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \ - libsqlite3.a $(LIBTCL) $(THREADLIB) - -# Rules used to build documentation -# -arch.html: $(TOP)/www/arch.tcl - tclsh $(TOP)/www/arch.tcl >arch.html - -arch.png: $(TOP)/www/arch.png - cp $(TOP)/www/arch.png . - -arch2.gif: $(TOP)/www/arch2.gif - cp $(TOP)/www/arch2.gif . - -autoinc.html: $(TOP)/www/autoinc.tcl - tclsh $(TOP)/www/autoinc.tcl >autoinc.html - -c_interface.html: $(TOP)/www/c_interface.tcl - tclsh $(TOP)/www/c_interface.tcl >c_interface.html - -capi3.html: $(TOP)/www/capi3.tcl - tclsh $(TOP)/www/capi3.tcl >capi3.html - -capi3ref.html: $(TOP)/www/capi3ref.tcl - tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html - -changes.html: $(TOP)/www/changes.tcl - tclsh $(TOP)/www/changes.tcl >changes.html - -compile.html: $(TOP)/www/compile.tcl - tclsh $(TOP)/www/compile.tcl >compile.html - -copyright.html: $(TOP)/www/copyright.tcl - tclsh $(TOP)/www/copyright.tcl >copyright.html - -copyright-release.html: $(TOP)/www/copyright-release.html - cp $(TOP)/www/copyright-release.html . - -copyright-release.pdf: $(TOP)/www/copyright-release.pdf - cp $(TOP)/www/copyright-release.pdf . - -common.tcl: $(TOP)/www/common.tcl - cp $(TOP)/www/common.tcl . - -conflict.html: $(TOP)/www/conflict.tcl - tclsh $(TOP)/www/conflict.tcl >conflict.html - -datatypes.html: $(TOP)/www/datatypes.tcl - tclsh $(TOP)/www/datatypes.tcl >datatypes.html - -datatype3.html: $(TOP)/www/datatype3.tcl - tclsh $(TOP)/www/datatype3.tcl >datatype3.html - -different.html: $(TOP)/www/different.tcl - tclsh $(TOP)/www/different.tcl >different.html - -docs.html: $(TOP)/www/docs.tcl - tclsh $(TOP)/www/docs.tcl >docs.html - -download.html: $(TOP)/www/download.tcl - mkdir -p doc - tclsh $(TOP)/www/download.tcl >download.html - -faq.html: $(TOP)/www/faq.tcl - tclsh $(TOP)/www/faq.tcl >faq.html - -fileformat.html: $(TOP)/www/fileformat.tcl - tclsh $(TOP)/www/fileformat.tcl >fileformat.html - -formatchng.html: $(TOP)/www/formatchng.tcl - tclsh $(TOP)/www/formatchng.tcl >formatchng.html - -index.html: $(TOP)/www/index.tcl last_change - tclsh $(TOP)/www/index.tcl >index.html - -lang.html: $(TOP)/www/lang.tcl - tclsh $(TOP)/www/lang.tcl doc >lang.html - -pragma.html: $(TOP)/www/pragma.tcl - tclsh $(TOP)/www/pragma.tcl >pragma.html - -lockingv3.html: $(TOP)/www/lockingv3.tcl - tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html - -oldnews.html: $(TOP)/www/oldnews.tcl - tclsh $(TOP)/www/oldnews.tcl >oldnews.html - -omitted.html: $(TOP)/www/omitted.tcl - tclsh $(TOP)/www/omitted.tcl >omitted.html - -opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c - tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html - -mingw.html: $(TOP)/www/mingw.tcl - tclsh $(TOP)/www/mingw.tcl >mingw.html - -nulls.html: $(TOP)/www/nulls.tcl - tclsh $(TOP)/www/nulls.tcl >nulls.html - -quickstart.html: $(TOP)/www/quickstart.tcl - tclsh $(TOP)/www/quickstart.tcl >quickstart.html - -speed.html: $(TOP)/www/speed.tcl - tclsh $(TOP)/www/speed.tcl >speed.html - -sqlite.gif: $(TOP)/art/SQLite.gif - cp $(TOP)/art/SQLite.gif sqlite.gif - -sqlite.html: $(TOP)/www/sqlite.tcl - tclsh $(TOP)/www/sqlite.tcl >sqlite.html - -support.html: $(TOP)/www/support.tcl - tclsh $(TOP)/www/support.tcl >support.html - -tclsqlite.html: $(TOP)/www/tclsqlite.tcl - tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html - -vdbe.html: $(TOP)/www/vdbe.tcl - tclsh $(TOP)/www/vdbe.tcl >vdbe.html - -version3.html: $(TOP)/www/version3.tcl - tclsh $(TOP)/www/version3.tcl >version3.html - -whentouse.html: $(TOP)/www/whentouse.tcl - tclsh $(TOP)/www/whentouse.tcl >whentouse.html - - -# Files to be published on the website. -# -DOC = \ - arch.html \ - arch.png \ - arch2.gif \ - autoinc.html \ - c_interface.html \ - capi3.html \ - capi3ref.html \ - changes.html \ - compile.html \ - copyright.html \ - copyright-release.html \ - copyright-release.pdf \ - conflict.html \ - datatypes.html \ - datatype3.html \ - different.html \ - docs.html \ - download.html \ - faq.html \ - fileformat.html \ - formatchng.html \ - index.html \ - lang.html \ - lockingv3.html \ - mingw.html \ - nulls.html \ - oldnews.html \ - omitted.html \ - opcode.html \ - pragma.html \ - quickstart.html \ - speed.html \ - sqlite.gif \ - sqlite.html \ - support.html \ - tclsqlite.html \ - vdbe.html \ - version3.html \ - whentouse.html - -doc: common.tcl $(DOC) - mkdir -p doc - mv $(DOC) doc - -# Standard install and cleanup targets -# -install: sqlite3 libsqlite3.a sqlite3.h - mv sqlite3 /usr/bin - mv libsqlite3.a /usr/lib - mv sqlite3.h /usr/include - -clean: - rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.* crashtest - rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h - rm -f $(PUBLISH) - rm -f *.da *.bb *.bbg gmon.out - rm -rf tsrc diff --git a/ext/pdo_sqlite/sqlite/mkdll.sh b/ext/pdo_sqlite/sqlite/mkdll.sh deleted file mode 100644 index 1ad5f83326f24..0000000000000 --- a/ext/pdo_sqlite/sqlite/mkdll.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# This script is used to compile SQLite into a DLL. -# -# Two separate DLLs are generated. "sqlite3.dll" is the core -# library. "tclsqlite3.dll" contains the TCL bindings and is the -# library that is loaded into TCL in order to run SQLite. -# -make target_source -cd tsrc -PATH=$PATH:/opt/mingw/bin -TCLDIR=/home/drh/tcltk/846/win/846win -TCLSTUBLIB=$TCLDIR/libtcl84stub.a -OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DTHREADSAFE=1' -CC="i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR" -rm shell.c -for i in *.c; do - CMD="$CC -c $i" - echo $CMD - $CMD -done -echo 'EXPORTS' >tclsqlite3.def -echo 'Tclsqlite3_Init' >>tclsqlite3.def -echo 'Tclsqlite_Init' >>tclsqlite3.def -echo 'Sqlite3_Init' >>tclsqlite3.def -echo 'Sqlite_Init' >>tclsqlite3.def -i386-mingw32msvc-dllwrap \ - --def tclsqlite3.def -v --export-all \ - --driver-name i386-mingw32msvc-gcc \ - --dlltool-name i386-mingw32msvc-dlltool \ - --as i386-mingw32msvc-as \ - --target i386-mingw32 \ - -dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB -i386-mingw32msvc-strip tclsqlite3.dll -rm tclsqlite.o -i386-mingw32msvc-dllwrap \ - --def sqlite3.def -v --export-all \ - --driver-name i386-mingw32msvc-gcc \ - --dlltool-name i386-mingw32msvc-dlltool \ - --as i386-mingw32msvc-as \ - --target i386-mingw32 \ - -dllname sqlite3.dll -lmsvcrt *.o -i386-mingw32msvc-strip sqlite3.dll -cd .. diff --git a/ext/pdo_sqlite/sqlite/mkopcodec.awk b/ext/pdo_sqlite/sqlite/mkopcodec.awk deleted file mode 100644 index bf6bfbeb37064..0000000000000 --- a/ext/pdo_sqlite/sqlite/mkopcodec.awk +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/awk -f -# -# This AWK script scans the opcodes.h file (which is itself generated by -# another awk script) and uses the information gleaned to create the -# opcodes.c source file. -# -# Opcodes.c contains strings which are the symbolic names for the various -# opcodes used by the VDBE. These strings are used when disassembling a -# VDBE program during tracing or as a result of the EXPLAIN keyword. -# -BEGIN { - print "/* Automatically generated. Do not edit */" - print "/* See the mkopcodec.awk script for details. */" - printf "#if !defined(SQLITE_OMIT_EXPLAIN)" - printf " || !defined(NDEBUG)" - printf " || defined(VDBE_PROFILE)" - print " || defined(SQLITE_DEBUG)" - print "const char *const sqlite3OpcodeNames[] = { \"?\"," -} -/define OP_/ { - sub("OP_","",$2) - i++ - printf " /* %3d */ \"%s\",\n", $3, $2 -} -END { - print "};" - print "#endif" -} diff --git a/ext/pdo_sqlite/sqlite/mkopcodeh.awk b/ext/pdo_sqlite/sqlite/mkopcodeh.awk deleted file mode 100644 index a258194ca8310..0000000000000 --- a/ext/pdo_sqlite/sqlite/mkopcodeh.awk +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/awk -f -# -# Generate the file opcodes.h. -# -# This AWK script scans a concatenation of the parse.h output file from the -# parser and the vdbe.c source file in order to generate the opcodes numbers -# for all opcodes. -# -# The lines of the vdbe.c that we are interested in are of the form: -# -# case OP_aaaa: /* same as TK_bbbbb */ -# -# The TK_ comment is optional. If it is present, then the value assigned to -# the OP_ is the same as the TK_ value. If missing, the OP_ value is assigned -# a small integer that is different from every other OP_ value. -# -# We go to the trouble of making some OP_ value the same as TK_ values -# as an optimization. During parsing, things like expression operators -# are coded with TK_ values such as TK_ADD, TK_DIVIDE, and so forth. Later -# during code generation, we need to generate corresponding opcodes like -# OP_Add and OP_Divide. By making TK_ADD==OP_Add and TK_DIVIDE==OP_Divide, -# code to translation from one to the other is avoided. This makes the -# code generator run (infinitesimally) faster and more importantly it makes -# the total library smaller. -# - - -# Remember the TK_ values from the parse.h file -/^#define TK_/ { - tk[$2] = $3 -} - -# Scan for "case OP_aaaa:" lines in the vdbe.c file -/^case OP_/ { - name = $2 - gsub(/:/,"",name) - gsub("\r","",name) - op[name] = -1 - for(i=3; i<NF; i++){ - if($i=="same" && $(i+1)=="as"){ - sym = $(i+2) - sub(/,/,"",sym) - op[name] = tk[sym] - used[op[name]] = 1 - sameas[op[name]] = sym - } - if($i=="no-push"){ - nopush[name] = 1 - } - } -} - -# Assign numbers to all opcodes and output the result. -END { - cnt = 0 - max = 0 - print "/* Automatically generated. Do not edit */" - print "/* See the mkopcodeh.awk script for details */" - for(name in op){ - if( op[name]<0 ){ - cnt++ - while( used[cnt] ) cnt++ - op[name] = cnt - } - used[op[name]] = 1; - if( op[name]>max ) max = op[name] - printf "#define %-25s %15d", name, op[name] - if( sameas[op[name]] ) { - printf " /* same as %-12s*/", sameas[op[name]] - } - printf "\n" - - } - seenUnused = 0; - for(i=1; i<max; i++){ - if( !used[i] ){ - if( !seenUnused ){ - printf "\n/* The following opcode values are never used */\n" - seenUnused = 1 - } - printf "#define %-25s %15d\n", sprintf( "OP_NotUsed_%-3d", i ), i - } - } - - # Generate the 10 16-bit bitmasks used by function opcodeUsesStack() - # in vdbeaux.c. See comments in that function for details. - # - nopush[0] = 0 # 0..15 - nopush[1] = 0 # 16..31 - nopush[2] = 0 # 32..47 - nopush[3] = 0 # 48..63 - nopush[4] = 0 # 64..79 - nopush[5] = 0 # 80..95 - nopush[6] = 0 # 96..111 - nopush[7] = 0 # 112..127 - nopush[8] = 0 # 128..143 - nopush[9] = 0 # 144..159 - for(name in op){ - if( nopush[name] ){ - n = op[name] - j = n%16 - i = ((n - j)/16) - nopush[i] = nopush[i] + (2^j) - } - } - printf "\n" - for(i=0; i<10; i++){ - printf "#define NOPUSH_MASK_%d %d\n", i, nopush[i] - } -} diff --git a/ext/pdo_sqlite/sqlite/mkso.sh b/ext/pdo_sqlite/sqlite/mkso.sh deleted file mode 100644 index b26382c99a6b0..0000000000000 --- a/ext/pdo_sqlite/sqlite/mkso.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# This script is used to compile SQLite into a shared library on Linux. -# -# Two separate shared libraries are generated. "sqlite3.so" is the core -# library. "tclsqlite3.so" contains the TCL bindings and is the -# library that is loaded into TCL in order to run SQLite. -# -make target_source -cd tsrc -rm shell.c -TCLDIR=/home/drh/tcltk/846/linux/846linux -TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a -OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1' -for i in *.c; do - if test $i != 'keywordhash.c'; then - CMD="cc -fPIC $OPTS -O2 -I. -I$TCLDIR -c $i" - echo $CMD - $CMD - fi -done -echo gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so -gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so -strip tclsqlite3.so -rm tclsqlite.c tclsqlite.o -echo gcc -shared *.o -o sqlite3.so -gcc -shared *.o -o sqlite3.so -strip sqlite3.so -cd .. diff --git a/ext/pdo_sqlite/sqlite/publish.sh b/ext/pdo_sqlite/sqlite/publish.sh deleted file mode 100644 index 0a61d90ed2fdf..0000000000000 --- a/ext/pdo_sqlite/sqlite/publish.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -# This script is used to compile SQLite and all its documentation and -# ship everything up to the SQLite website. This script will only work -# on the system "zadok" at the Hwaci offices. But others might find -# the script useful as an example. -# - -# Set srcdir to the name of the directory that contains the publish.sh -# script. -# -srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'` - -# Get the makefile. -# -cp $srcdir/Makefile.linux-gcc ./Makefile -chmod +x $srcdir/install-sh - -# Get the current version number - needed to help build filenames -# -VERS=`cat $srcdir/VERSION` -VERSW=`sed 's/\./_/g' $srcdir/VERSION` - -# Start by building an sqlite shell for linux. -# -make clean -make sqlite3 -strip sqlite3 -mv sqlite3 sqlite3-$VERS.bin -gzip sqlite3-$VERS.bin -mv sqlite3-$VERS.bin.gz doc - -# Build a source archive useful for windows. -# -make target_source -cd tsrc -zip ../doc/sqlite-source-$VERSW.zip * -cd .. - -# Build the sqlite.so and tclsqlite.so shared libraries -# under Linux -# -. $srcdir/mkso.sh -cd tsrc -mv tclsqlite3.so tclsqlite-$VERS.so -gzip tclsqlite-$VERS.so -mv tclsqlite-$VERS.so.gz ../doc -mv sqlite3.so sqlite-$VERS.so -gzip sqlite-$VERS.so -mv sqlite-$VERS.so.gz ../doc -cd .. - -# Build the tclsqlite3.dll and sqlite3.dll shared libraries. -# -. $srcdir/mkdll.sh -cd tsrc -echo zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll -zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll -echo zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def -zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def -cd .. - -# Build the sqlite.exe executable for windows. -# -make target_source -cd tsrc -rm tclsqlite.c -OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1' -i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR *.c -o sqlite3.exe -zip ../doc/sqlite-$VERSW.zip sqlite3.exe -cd .. - -# Construct a tarball of the source tree -# -ORIGIN=`pwd` -cd $srcdir -cd .. -mv sqlite sqlite-$VERS -EXCLUDE=`find sqlite-$VERS -print | grep CVS | sed 's,^, --exclude ,'` -tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS -mv sqlite-$VERS sqlite -cd $ORIGIN - -# -# Build RPMS (binary) and Source RPM -# - -# Make sure we are properly setup to build RPMs -# -echo "%HOME %{expand:%%(cd; pwd)}" > $HOME/.rpmmacros -echo "%_topdir %{HOME}/rpm" >> $HOME/.rpmmacros -mkdir $HOME/rpm -mkdir $HOME/rpm/BUILD -mkdir $HOME/rpm/SOURCES -mkdir $HOME/rpm/RPMS -mkdir $HOME/rpm/SRPMS -mkdir $HOME/rpm/SPECS - -# create the spec file from the template -sed s/SQLITE_VERSION/$VERS/g $srcdir/spec.template > $HOME/rpm/SPECS/sqlite.spec - -# copy the source tarball to the rpm directory -cp doc/sqlite-$VERS.tar.gz $HOME/rpm/SOURCES/. - -# build all the rpms -rpm -ba $HOME/rpm/SPECS/sqlite.spec >& rpm-$vers.log - -# copy the RPMs into the build directory. -mv $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm doc -mv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc - -# Build the website -# -#cp $srcdir/../historical/* doc -make doc diff --git a/ext/pdo_sqlite/sqlite/spec.template b/ext/pdo_sqlite/sqlite/spec.template deleted file mode 100644 index 24c5eaebb83eb..0000000000000 --- a/ext/pdo_sqlite/sqlite/spec.template +++ /dev/null @@ -1,62 +0,0 @@ -%define name sqlite -%define version SQLITE_VERSION -%define release 1 - -Name: %{name} -Summary: SQLite is a C library that implements an embeddable SQL database engine -Version: %{version} -Release: %{release} -Source: %{name}-%{version}.tar.gz -Group: System/Libraries -URL: http://www.hwaci.com/sw/sqlite/ -License: Public Domain -BuildRoot: %{_tmppath}/%{name}-%{version}-root - -%description -SQLite is a C library that implements an embeddable SQL database engine. -Programs that link with the SQLite library can have SQL database access -without running a separate RDBMS process. The distribution comes with a -standalone command-line access program (sqlite) that can be used to -administer an SQLite database and which serves as an example of how to -use the SQLite library. - -%package -n %{name}-devel -Summary: Header files and libraries for developing apps which will use sqlite -Group: Development/C -Requires: %{name} = %{version}-%{release} - -%description -n %{name}-devel -The sqlite-devel package contains the header files and libraries needed -to develop programs that use the sqlite database library. - -%prep -%setup -q -n %{name} - -%build -CFLAGS="%optflags -DNDEBUG=1" CXXFLAGS="%optflags -DNDEBUG=1" ./configure --prefix=%{_prefix} - -make -make doc - -%install -install -d $RPM_BUILD_ROOT/%{_prefix} -install -d $RPM_BUILD_ROOT/%{_prefix}/bin -install -d $RPM_BUILD_ROOT/%{_prefix}/include -install -d $RPM_BUILD_ROOT/%{_prefix}/lib -make install prefix=$RPM_BUILD_ROOT/%{_prefix} - -%clean -rm -fr $RPM_BUILD_ROOT - -%files -%defattr(-, root, root) -%{_libdir}/*.so* -%{_bindir}/* - -%files -n %{name}-devel -%defattr(-, root, root) -%{_libdir}/pkgconfig/sqlite3.pc -%{_libdir}/*.a -%{_libdir}/*.la -%{_includedir}/* -%doc doc/* diff --git a/ext/pdo_sqlite/sqlite/sqlite.1 b/ext/pdo_sqlite/sqlite/sqlite.1 deleted file mode 100644 index e35358ec61730..0000000000000 --- a/ext/pdo_sqlite/sqlite/sqlite.1 +++ /dev/null @@ -1,203 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH SQLITE 1 "Mon Apr 15 23:49:17 2002" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp <n> insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -sqlite \- A command line interface for SQLite -.SH SYNOPSIS -.B sqlite -.RI [ options ] " filename " [ SQL ] -.SS SUMMARY -.PP -sqlite is a terminal-based front-end to the SQLite library. It enables -you to type in queries interactively, issue them to SQLite and see the -results. Alternatively, you can specify SQL code on the command-line. In -addition it provides a number of meta-commands. - -.SH DESCRIPTION -This manual page documents briefly the -.B sqlite -command. -This manual page was written for the Debian GNU/Linux distribution -because the original program does not have a manual page. -.SS GETTING STARTED -.PP -To start the sqlite program, just type "sqlite" followed by the name -the file that holds the SQLite database. If the file does not exist, a -new one is created automatically. The sqlite program will then prompt -you to enter SQL. Type in SQL statements (terminated by a semicolon), -press "Enter" and the SQL will be executed. - -For example, to create a new SQLite database named "ex1" with a single -table named "tbl1", you might do this: -.sp -.nf -$ sqlite ex1 -SQLite version 2.0.0 -Enter ".help" for instructions -sqlite> create table tbl1(one varchar(10), two smallint); -sqlite> insert into tbl1 values('hello!',10); -sqlite> insert into tbl1 values('goodbye', 20); -sqlite> select * from tbl1; -hello!|10 -goodbye|20 -sqlite> -.sp -.fi - -.SS SQLITE META-COMMANDS -.PP -Most of the time, sqlite just reads lines of input and passes them on -to the SQLite library for execution. But if an input line begins with -a dot ("."), then that line is intercepted and interpreted by the -sqlite program itself. These "dot commands" are typically used to -change the output format of queries, or to execute certain prepackaged -query statements. - -For a listing of the available dot commands, you can enter ".help" at -any time. For example: -.sp -.nf -.cc | -sqlite> .help -.dump ?TABLE? ... Dump the database in an text format -.echo ON|OFF Turn command echo on or off -.exit Exit this program -.explain ON|OFF Turn output mode suitable for EXPLAIN on or off. - "off" will revert to the output mode that was - previously in effect -.header(s) ON|OFF Turn display of headers on or off -.help Show this message -.indices TABLE Show names of all indices on TABLE -.mode MODE Set mode to one of "line(s)", "column(s)", - "insert", "list", or "html" -.mode insert TABLE Generate SQL insert statements for TABLE -.nullvalue STRING Print STRING instead of nothing for NULL data -.output FILENAME Send output to FILENAME -.output stdout Send output to the screen -.prompt MAIN CONTINUE Replace the standard prompts - "sqlite > " and " ...> " - with the strings MAIN and CONTINUE - CONTINUE is optional. -.quit Exit this program -.read FILENAME Execute SQL in FILENAME -.reindex ?TABLE? Rebuild indices -.schema ?TABLE? Show the CREATE statements -.separator STRING Change separator string for "list" mode -.show Show the current values for the following: - .echo - .explain - .mode - .nullvalue - .output - .separator - .width -.tables ?PATTERN? List names of tables matching a pattern -.timeout MS Try opening locked tables for MS milliseconds -.width NUM NUM ... Set column widths for "column" mode -sqlite> -|cc . -.sp -.fi - -.SH OPTIONS -The program has the following options: -.TP -.BI \-init\ file -Read in and process 'file', which contains "dot commands". -You can use this file to initialize display settings. -.TP -.B \-html -Set output mode to HTML. -.TP -.B \-list -Set output mode to 'list'. -.TP -.B \-line -Set output mode to 'line'. -.TP -.B \-column -Set output mode to 'column'. -.TP -.BI \-separator\ separator -Specify which output field separator for 'list' mode to use. -Default is '|'. -.TP -.BI \-nullvalue\ string -When a null is encountered, print 'string'. Default is no string. -.TP -.B \-[no]header -Turn headers on or off. Default is off. -.TP -.B \-echo -Print commands before execution. - - -.SH OUTPUT MODE -The SQLite program has different output modes, which define the way -the output (from queries) is formatted. - -In 'list' mode, which is the default, one record per line is output, -each field separated by the separator specified with the -\fB-separator\fP option or \fB.separator\fP command. - -In 'line' mode, each column is output on its own line, records are -separated by blank lines. - -In HTML mode, an XHTML table is generated. - -In 'column' mode, one record per line is output, aligned neatly in colums. - -.SH INIT FILE -sqlite can be initialized using resource files. These can be combined with -command line arguments to set up sqlite exactly the way you want it. -Initialization proceeds as follows: - -o The defaults of - -.sp -.nf -.cc | -mode = LIST -separator = "|" -main prompt = "sqlite> " -continue prompt = " ...> " -|cc . -.sp -.fi - -are established. - -o If a file .sqliterc can be found in the user's home directory, it is -read and processed. It should only contain "dot commands". If the -file is not found or cannot be read, processing continues without -notification. - -o If a file is specified on the command line with the -init option, it -is processed in the same manner as .sqliterc - -o All other command line options are processed - -o The database is opened and you are now ready to begin. - -.SH SEE ALSO -http://www.hwaci.com/sw/sqlite/ -.br -The sqlite-doc package -.SH AUTHOR -This manual page was originally written by Andreas Rottmann -<rotty@debian.org>, for the Debian GNU/Linux system (but may be used -by others). diff --git a/ext/pdo_sqlite/sqlite/sqlite.pc.in b/ext/pdo_sqlite/sqlite/sqlite.pc.in deleted file mode 100644 index 16ed41c3d92db..0000000000000 --- a/ext/pdo_sqlite/sqlite/sqlite.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -# Package Information for pkg-config - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: SQLite -Description: SQL database engine -Version: @VERSION@ -Libs: -L${libdir} -lsqlite -Cflags: -I${includedir} diff --git a/ext/pdo_sqlite/sqlite/sqlite3.def b/ext/pdo_sqlite/sqlite/sqlite3.def deleted file mode 100644 index c57ca6897308c..0000000000000 --- a/ext/pdo_sqlite/sqlite/sqlite3.def +++ /dev/null @@ -1,97 +0,0 @@ -EXPORTS -sqlite3_aggregate_context -sqlite3_aggregate_count -sqlite3_bind_blob -sqlite3_bind_double -sqlite3_bind_int -sqlite3_bind_int64 -sqlite3_bind_null -sqlite3_bind_parameter_count -sqlite3_bind_parameter_index -sqlite3_bind_parameter_name -sqlite3_bind_text -sqlite3_bind_text16 -sqlite3_busy_handler -sqlite3_busy_timeout -sqlite3_changes -sqlite3_close -sqlite3_collation_needed -sqlite3_collation_needed16 -sqlite3_column_blob -sqlite3_column_bytes -sqlite3_column_bytes16 -sqlite3_column_count -sqlite3_column_decltype -sqlite3_column_decltype16 -sqlite3_column_double -sqlite3_column_int -sqlite3_column_int64 -sqlite3_column_name -sqlite3_column_name16 -sqlite3_column_text -sqlite3_column_text16 -sqlite3_column_type -sqlite3_commit_hook -sqlite3_complete -sqlite3_complete16 -sqlite3_create_collation -sqlite3_create_collation16 -sqlite3_create_function -sqlite3_create_function16 -sqlite3_data_count -sqlite3_db_handle -sqlite3_errcode -sqlite3_errmsg -sqlite3_errmsg16 -sqlite3_exec -sqlite3_expired -sqlite3_finalize -sqlite3_free -sqlite3_free_table -sqlite3_get_autocommit -sqlite3_get_auxdata -sqlite3_get_table -sqlite3_global_recover -sqlite3_interrupt -sqlite3_last_insert_rowid -sqlite3_libversion -sqlite3_libversion_number -sqlite3_mprintf -sqlite3_open -sqlite3_open16 -sqlite3_prepare -sqlite3_prepare16 -sqlite3_progress_handler -sqlite3_reset -sqlite3_result_blob -sqlite3_result_double -sqlite3_result_error -sqlite3_result_error16 -sqlite3_result_int -sqlite3_result_int64 -sqlite3_result_null -sqlite3_result_text -sqlite3_result_text16 -sqlite3_result_text16be -sqlite3_result_text16le -sqlite3_result_value -sqlite3_set_authorizer -sqlite3_set_auxdata -sqlite3_snprintf -sqlite3_step -sqlite3_total_changes -sqlite3_trace -sqlite3_transfer_bindings -sqlite3_user_data -sqlite3_value_blob -sqlite3_value_bytes -sqlite3_value_bytes16 -sqlite3_value_double -sqlite3_value_int -sqlite3_value_int64 -sqlite3_value_text -sqlite3_value_text16 -sqlite3_value_text16be -sqlite3_value_text16le -sqlite3_value_type -sqlite3_vmprintf diff --git a/ext/pdo_sqlite/sqlite/sqlite3.pc.in b/ext/pdo_sqlite/sqlite/sqlite3.pc.in deleted file mode 100644 index 13d80a0b20a62..0000000000000 --- a/ext/pdo_sqlite/sqlite/sqlite3.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -# Package Information for pkg-config - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: SQLite -Description: SQL database engine -Version: @VERSION@ -Libs: -L${libdir} -lsqlite3 -Cflags: -I${includedir} diff --git a/ext/pdo_sqlite/sqlite/src/alter.c b/ext/pdo_sqlite/sqlite/src/alter.c deleted file mode 100644 index ada0769b5ddcd..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/alter.c +++ /dev/null @@ -1,557 +0,0 @@ -/* -** 2005 February 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that used to generate VDBE code -** that implements the ALTER TABLE command. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <ctype.h> - -/* -** The code in this file only exists if we are not omitting the -** ALTER TABLE logic from the build. -*/ -#ifndef SQLITE_OMIT_ALTERTABLE - - -/* -** This function is used by SQL generated to implement the -** ALTER TABLE command. The first argument is the text of a CREATE TABLE or -** CREATE INDEX command. The second is a table name. The table name in -** the CREATE TABLE or CREATE INDEX statement is replaced with the second -** argument and the result returned. Examples: -** -** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def') -** -> 'CREATE TABLE def(a, b, c)' -** -** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def') -** -> 'CREATE INDEX i ON def(a, b, c)' -*/ -static void renameTableFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - unsigned char const *zSql = sqlite3_value_text(argv[0]); - unsigned char const *zTableName = sqlite3_value_text(argv[1]); - - int token; - Token tname; - char const *zCsr = zSql; - int len = 0; - char *zRet; - - /* The principle used to locate the table name in the CREATE TABLE - ** statement is that the table name is the first token that is immediatedly - ** followed by a left parenthesis - TK_LP. - */ - if( zSql ){ - do { - /* Store the token that zCsr points to in tname. */ - tname.z = zCsr; - tname.n = len; - - /* Advance zCsr to the next token. Store that token type in 'token', - ** and it's length in 'len' (to be used next iteration of this loop). - */ - do { - zCsr += len; - len = sqlite3GetToken(zCsr, &token); - } while( token==TK_SPACE ); - assert( len>0 ); - } while( token!=TK_LP ); - - zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql, - zTableName, tname.z+tname.n); - sqlite3_result_text(context, zRet, -1, sqlite3FreeX); - } -} - -#ifndef SQLITE_OMIT_TRIGGER -/* This function is used by SQL generated to implement the ALTER TABLE -** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER -** statement. The second is a table name. The table name in the CREATE -** TRIGGER statement is replaced with the second argument and the result -** returned. This is analagous to renameTableFunc() above, except for CREATE -** TRIGGER, not CREATE INDEX and CREATE TABLE. -*/ -static void renameTriggerFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - unsigned char const *zSql = sqlite3_value_text(argv[0]); - unsigned char const *zTableName = sqlite3_value_text(argv[1]); - - int token; - Token tname; - int dist = 3; - char const *zCsr = zSql; - int len = 0; - char *zRet; - - /* The principle used to locate the table name in the CREATE TRIGGER - ** statement is that the table name is the first token that is immediatedly - ** preceded by either TK_ON or TK_DOT and immediatedly followed by one - ** of TK_WHEN, TK_BEGIN or TK_FOR. - */ - if( zSql ){ - do { - /* Store the token that zCsr points to in tname. */ - tname.z = zCsr; - tname.n = len; - - /* Advance zCsr to the next token. Store that token type in 'token', - ** and it's length in 'len' (to be used next iteration of this loop). - */ - do { - zCsr += len; - len = sqlite3GetToken(zCsr, &token); - }while( token==TK_SPACE ); - assert( len>0 ); - - /* Variable 'dist' stores the number of tokens read since the most - ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN - ** token is read and 'dist' equals 2, the condition stated above - ** to be met. - ** - ** Note that ON cannot be a database, table or column name, so - ** there is no need to worry about syntax like - ** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc. - */ - dist++; - if( token==TK_DOT || token==TK_ON ){ - dist = 0; - } - } while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); - - /* Variable tname now contains the token that is the old table-name - ** in the CREATE TRIGGER statement. - */ - zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql, - zTableName, tname.z+tname.n); - sqlite3_result_text(context, zRet, -1, sqlite3FreeX); - } -} -#endif /* !SQLITE_OMIT_TRIGGER */ - -/* -** Register built-in functions used to help implement ALTER TABLE -*/ -void sqlite3AlterFunctions(sqlite3 *db){ - static const struct { - char *zName; - signed char nArg; - void (*xFunc)(sqlite3_context*,int,sqlite3_value **); - } aFuncs[] = { - { "sqlite_rename_table", 2, renameTableFunc}, -#ifndef SQLITE_OMIT_TRIGGER - { "sqlite_rename_trigger", 2, renameTriggerFunc}, -#endif - }; - int i; - - for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ - sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg, - SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0); - } -} - -/* -** Generate the text of a WHERE expression which can be used to select all -** temporary triggers on table pTab from the sqlite_temp_master table. If -** table pTab has no temporary triggers, or is itself stored in the -** temporary database, NULL is returned. -*/ -static char *whereTempTriggers(Parse *pParse, Table *pTab){ - Trigger *pTrig; - char *zWhere = 0; - char *tmp = 0; - if( pTab->iDb!=1 ){ - for( pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext ){ - if( pTrig->iDb==1 ){ - if( !zWhere ){ - zWhere = sqlite3MPrintf("name=%Q", pTrig->name); - }else{ - tmp = zWhere; - zWhere = sqlite3MPrintf("%s OR name=%Q", zWhere, pTrig->name); - sqliteFree(tmp); - } - } - } - } - return zWhere; -} - -/* -** Generate code to drop and reload the internal representation of table -** pTab from the database, including triggers and temporary triggers. -** Argument zName is the name of the table in the database schema at -** the time the generated code is executed. This can be different from -** pTab->zName if this function is being called to code part of an -** "ALTER TABLE RENAME TO" statement. -*/ -static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ - Vdbe *v; - char *zWhere; - int iDb; -#ifndef SQLITE_OMIT_TRIGGER - Trigger *pTrig; -#endif - - v = sqlite3GetVdbe(pParse); - if( !v ) return; - iDb = pTab->iDb; - -#ifndef SQLITE_OMIT_TRIGGER - /* Drop any table triggers from the internal schema. */ - for(pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext){ - assert( pTrig->iDb==iDb || pTrig->iDb==1 ); - sqlite3VdbeOp3(v, OP_DropTrigger, pTrig->iDb, 0, pTrig->name, 0); - } -#endif - - /* Drop the table and index from the internal schema */ - sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0); - - /* Reload the table, index and permanent trigger schemas. */ - zWhere = sqlite3MPrintf("tbl_name=%Q", zName); - if( !zWhere ) return; - sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, zWhere, P3_DYNAMIC); - -#ifndef SQLITE_OMIT_TRIGGER - /* Now, if the table is not stored in the temp database, reload any temp - ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. - */ - if( (zWhere=whereTempTriggers(pParse, pTab)) ){ - sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC); - } -#endif -} - -/* -** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" -** command. -*/ -void sqlite3AlterRenameTable( - Parse *pParse, /* Parser context. */ - SrcList *pSrc, /* The table to rename. */ - Token *pName /* The new table name. */ -){ - int iDb; /* Database that contains the table */ - char *zDb; /* Name of database iDb */ - Table *pTab; /* Table being renamed */ - char *zName = 0; /* NULL-terminated version of pName */ - sqlite3 *db = pParse->db; /* Database connection */ - Vdbe *v; -#ifndef SQLITE_OMIT_TRIGGER - char *zWhere = 0; /* Where clause to locate temp triggers */ -#endif - - if( sqlite3_malloc_failed ) goto exit_rename_table; - assert( pSrc->nSrc==1 ); - - pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase); - if( !pTab ) goto exit_rename_table; - iDb = pTab->iDb; - zDb = db->aDb[iDb].zName; - - /* Get a NULL terminated version of the new table name. */ - zName = sqlite3NameFromToken(pName); - if( !zName ) goto exit_rename_table; - - /* Check that a table or index named 'zName' does not already exist - ** in database iDb. If so, this is an error. - */ - if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ - sqlite3ErrorMsg(pParse, - "there is already another table or index with this name: %s", zName); - goto exit_rename_table; - } - - /* Make sure it is not a system table being altered, or a reserved name - ** that the table is being renamed to. - */ - if( strlen(pTab->zName)>6 && 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) ){ - sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName); - goto exit_rename_table; - } - if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ - goto exit_rename_table; - } - -#ifndef SQLITE_OMIT_AUTHORIZATION - /* Invoke the authorization callback. */ - if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ - goto exit_rename_table; - } -#endif - - /* Begin a transaction and code the VerifyCookie for database iDb. - ** Then modify the schema cookie (since the ALTER TABLE modifies the - ** schema). - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ){ - goto exit_rename_table; - } - sqlite3BeginWriteOperation(pParse, 0, iDb); - sqlite3ChangeCookie(db, v, iDb); - - /* Modify the sqlite_master table to use the new table name. */ - sqlite3NestedParse(pParse, - "UPDATE %Q.%s SET " -#ifdef SQLITE_OMIT_TRIGGER - "sql = sqlite_rename_table(sql, %Q), " -#else - "sql = CASE " - "WHEN type = 'trigger' THEN sqlite_rename_trigger(sql, %Q)" - "ELSE sqlite_rename_table(sql, %Q) END, " -#endif - "tbl_name = %Q, " - "name = CASE " - "WHEN type='table' THEN %Q " - "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " - "'sqlite_autoindex_' || %Q || substr(name, %d+18,10) " - "ELSE name END " - "WHERE tbl_name=%Q AND " - "(type='table' OR type='index' OR type='trigger');", - zDb, SCHEMA_TABLE(iDb), zName, zName, zName, -#ifndef SQLITE_OMIT_TRIGGER - zName, -#endif - zName, strlen(pTab->zName), pTab->zName - ); - -#ifndef SQLITE_OMIT_AUTOINCREMENT - /* If the sqlite_sequence table exists in this database, then update - ** it with the new table name. - */ - if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ - sqlite3NestedParse(pParse, - "UPDATE %Q.sqlite_sequence set name = %Q WHERE name = %Q", - zDb, zName, pTab->zName); - } -#endif - -#ifndef SQLITE_OMIT_TRIGGER - /* If there are TEMP triggers on this table, modify the sqlite_temp_master - ** table. Don't do this if the table being ALTERed is itself located in - ** the temp database. - */ - if( (zWhere=whereTempTriggers(pParse, pTab)) ){ - sqlite3NestedParse(pParse, - "UPDATE sqlite_temp_master SET " - "sql = sqlite_rename_trigger(sql, %Q), " - "tbl_name = %Q " - "WHERE %s;", zName, zName, zWhere); - sqliteFree(zWhere); - } -#endif - - /* Drop and reload the internal table schema. */ - reloadTableSchema(pParse, pTab, zName); - -exit_rename_table: - sqlite3SrcListDelete(pSrc); - sqliteFree(zName); -} - - -/* -** This function is called after an "ALTER TABLE ... ADD" statement -** has been parsed. Argument pColDef contains the text of the new -** column definition. -** -** The Table structure pParse->pNewTable was extended to include -** the new column during parsing. -*/ -void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ - Table *pNew; /* Copy of pParse->pNewTable */ - Table *pTab; /* Table being altered */ - int iDb; /* Database number */ - const char *zDb; /* Database name */ - const char *zTab; /* Table name */ - char *zCol; /* Null-terminated column definition */ - Column *pCol; /* The new column */ - Expr *pDflt; /* Default value for the new column */ - Vdbe *v; - - if( pParse->nErr ) return; - pNew = pParse->pNewTable; - assert( pNew ); - - iDb = pNew->iDb; - zDb = pParse->db->aDb[iDb].zName; - zTab = pNew->zName; - pCol = &pNew->aCol[pNew->nCol-1]; - pDflt = pCol->pDflt; - pTab = sqlite3FindTable(pParse->db, zTab, zDb); - assert( pTab ); - - /* If the default value for the new column was specified with a - ** literal NULL, then set pDflt to 0. This simplifies checking - ** for an SQL NULL default below. - */ - if( pDflt && pDflt->op==TK_NULL ){ - pDflt = 0; - } - - /* Check that the new column is not specified as PRIMARY KEY or UNIQUE. - ** If there is a NOT NULL constraint, then the default value for the - ** column must not be NULL. - */ - if( pCol->isPrimKey ){ - sqlite3ErrorMsg(pParse, "Cannot add a PRIMARY KEY column"); - return; - } - if( pNew->pIndex ){ - sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column"); - return; - } - if( pCol->notNull && !pDflt ){ - sqlite3ErrorMsg(pParse, - "Cannot add a NOT NULL column with default value NULL"); - return; - } - - /* Ensure the default expression is something that sqlite3ValueFromExpr() - ** can handle (i.e. not CURRENT_TIME etc.) - */ - if( pDflt ){ - sqlite3_value *pVal; - if( sqlite3ValueFromExpr(pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal) ){ - /* malloc() has failed */ - return; - } - if( !pVal ){ - sqlite3ErrorMsg(pParse, "Cannot add a column with non-constant default"); - return; - } - sqlite3ValueFree(pVal); - } - - /* Modify the CREATE TABLE statement. */ - zCol = sqliteStrNDup(pColDef->z, pColDef->n); - if( zCol ){ - char *zEnd = &zCol[pColDef->n-1]; - while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){ - *zEnd-- = '\0'; - } - sqlite3NestedParse(pParse, - "UPDATE %Q.%s SET " - "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d,length(sql)) " - "WHERE type = 'table' AND name = %Q", - zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1, - zTab - ); - sqliteFree(zCol); - } - - /* If the default value of the new column is NULL, then set the file - ** format to 2. If the default value of the new column is not NULL, - ** the file format becomes 3. - */ - if( (v=sqlite3GetVdbe(pParse)) ){ - int f = (pDflt?3:2); - - /* Only set the file format to $f if it is currently less than $f. */ - sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1); - sqlite3VdbeAddOp(v, OP_Integer, f, 0); - sqlite3VdbeAddOp(v, OP_Ge, 0, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Integer, f, 0); - sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1); - } - - /* Reload the schema of the modified table. */ - reloadTableSchema(pParse, pTab, pTab->zName); -} - - -/* -** This function is called by the parser after the table-name in -** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument -** pSrc is the full-name of the table being altered. -** -** This routine makes a (partial) copy of the Table structure -** for the table being altered and sets Parse.pNewTable to point -** to it. Routines called by the parser as the column definition -** is parsed (i.e. sqlite3AddColumn()) add the new Column data to -** the copy. The copy of the Table structure is deleted by tokenize.c -** after parsing is finished. -** -** Routine sqlite3AlterFinishAddColumn() will be called to complete -** coding the "ALTER TABLE ... ADD" statement. -*/ -void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){ - Table *pNew; - Table *pTab; - Vdbe *v; - int iDb; - int i; - int nAlloc; - - - /* Look up the table being altered. */ - assert( pParse->pNewTable==0 ); - if( sqlite3_malloc_failed ) goto exit_begin_add_column; - pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase); - if( !pTab ) goto exit_begin_add_column; - - /* Make sure this is not an attempt to ALTER a view. */ - if( pTab->pSelect ){ - sqlite3ErrorMsg(pParse, "Cannot add a column to a view"); - goto exit_begin_add_column; - } - - assert( pTab->addColOffset>0 ); - iDb = pTab->iDb; - - /* Put a copy of the Table struct in Parse.pNewTable for the - ** sqlite3AddColumn() function and friends to modify. - */ - pNew = (Table *)sqliteMalloc(sizeof(Table)); - if( !pNew ) goto exit_begin_add_column; - pParse->pNewTable = pNew; - pNew->nRef = 1; - pNew->nCol = pTab->nCol; - assert( pNew->nCol>0 ); - nAlloc = (((pNew->nCol-1)/8)*8)+8; - assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 ); - pNew->aCol = (Column *)sqliteMalloc(sizeof(Column)*nAlloc); - pNew->zName = sqliteStrDup(pTab->zName); - if( !pNew->aCol || !pNew->zName ){ - goto exit_begin_add_column; - } - memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol); - for(i=0; i<pNew->nCol; i++){ - Column *pCol = &pNew->aCol[i]; - pCol->zName = sqliteStrDup(pCol->zName); - pCol->zType = 0; - pCol->pDflt = 0; - } - pNew->iDb = iDb; - pNew->addColOffset = pTab->addColOffset; - pNew->nRef = 1; - - /* Begin a transaction and increment the schema cookie. */ - sqlite3BeginWriteOperation(pParse, 0, iDb); - v = sqlite3GetVdbe(pParse); - if( !v ) goto exit_begin_add_column; - sqlite3ChangeCookie(pParse->db, v, iDb); - -exit_begin_add_column: - sqlite3SrcListDelete(pSrc); - return; -} -#endif /* SQLITE_ALTER_TABLE */ diff --git a/ext/pdo_sqlite/sqlite/src/analyze.c b/ext/pdo_sqlite/sqlite/src/analyze.c deleted file mode 100644 index a6c92e9f6fe4f..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/analyze.c +++ /dev/null @@ -1,386 +0,0 @@ -/* -** 2005 July 8 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code associated with the ANALYZE command. -** -** @(#) $Id$ -*/ -#ifndef SQLITE_OMIT_ANALYZE -#include "sqliteInt.h" - -/* -** This routine generates code that opens the sqlite_stat1 table on cursor -** iStatCur. -** -** If the sqlite_stat1 tables does not previously exist, it is created. -** If it does previously exist, all entires associated with table zWhere -** are removed. If zWhere==0 then all entries are removed. -*/ -static void openStatTable( - Parse *pParse, /* Parsing context */ - int iDb, /* The database we are looking in */ - int iStatCur, /* Open the sqlite_stat1 table on this cursor */ - const char *zWhere /* Delete entries associated with this table */ -){ - sqlite3 *db = pParse->db; - Db *pDb; - int iRootPage; - Table *pStat; - Vdbe *v = sqlite3GetVdbe(pParse); - - pDb = &db->aDb[iDb]; - if( (pStat = sqlite3FindTable(db, "sqlite_stat1", pDb->zName))==0 ){ - /* The sqlite_stat1 tables does not exist. Create it. - ** Note that a side-effect of the CREATE TABLE statement is to leave - ** the rootpage of the new table on the top of the stack. This is - ** important because the OpenWrite opcode below will be needing it. */ - sqlite3NestedParse(pParse, - "CREATE TABLE %Q.sqlite_stat1(tbl,idx,stat)", - pDb->zName - ); - iRootPage = 0; /* Cause rootpage to be taken from top of stack */ - }else if( zWhere ){ - /* The sqlite_stat1 table exists. Delete all entries associated with - ** the table zWhere. */ - sqlite3NestedParse(pParse, - "DELETE FROM %Q.sqlite_stat1 WHERE tbl=%Q", - pDb->zName, zWhere - ); - iRootPage = pStat->tnum; - }else{ - /* The sqlite_stat1 table already exists. Delete all rows. */ - iRootPage = pStat->tnum; - sqlite3VdbeAddOp(v, OP_Clear, pStat->tnum, iDb); - } - - /* Open the sqlite_stat1 table for writing. - */ - sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, iStatCur, iRootPage); - sqlite3VdbeAddOp(v, OP_SetNumColumns, iStatCur, 3); -} - -/* -** Generate code to do an analysis of all indices associated with -** a single table. -*/ -static void analyzeOneTable( - Parse *pParse, /* Parser context */ - Table *pTab, /* Table whose indices are to be analyzed */ - int iStatCur, /* Cursor that writes to the sqlite_stat1 table */ - int iMem /* Available memory locations begin here */ -){ - Index *pIdx; /* An index to being analyzed */ - int iIdxCur; /* Cursor number for index being analyzed */ - int nCol; /* Number of columns in the index */ - Vdbe *v; /* The virtual machine being built up */ - int i; /* Loop counter */ - int topOfLoop; /* The top of the loop */ - int endOfLoop; /* The end of the loop */ - int addr; /* The address of an instruction */ - - v = sqlite3GetVdbe(pParse); - if( pTab==0 || pTab->pIndex==0 ){ - /* Do no analysis for tables that have no indices */ - return; - } - -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0, - pParse->db->aDb[pTab->iDb].zName ) ){ - return; - } -#endif - - iIdxCur = pParse->nTab; - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - /* Open a cursor to the index to be analyzed - */ - sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - VdbeComment((v, "# %s", pIdx->zName)); - sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIdx->tnum, - (char*)&pIdx->keyInfo, P3_KEYINFO); - nCol = pIdx->nColumn; - if( iMem+nCol*2>=pParse->nMem ){ - pParse->nMem = iMem+nCol*2+1; - } - sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, nCol+1); - - /* Memory cells are used as follows: - ** - ** mem[iMem]: The total number of rows in the table. - ** mem[iMem+1]: Number of distinct values in column 1 - ** ... - ** mem[iMem+nCol]: Number of distinct values in column N - ** mem[iMem+nCol+1] Last observed value of column 1 - ** ... - ** mem[iMem+nCol+nCol]: Last observed value of column N - ** - ** Cells iMem through iMem+nCol are initialized to 0. The others - ** are initialized to NULL. - */ - for(i=0; i<=nCol; i++){ - sqlite3VdbeAddOp(v, OP_MemInt, 0, iMem+i); - } - for(i=0; i<nCol; i++){ - sqlite3VdbeAddOp(v, OP_MemNull, iMem+nCol+i+1, 0); - } - - /* Do the analysis. - */ - endOfLoop = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, endOfLoop); - topOfLoop = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_MemIncr, iMem, 0); - for(i=0; i<nCol; i++){ - sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i); - sqlite3VdbeAddOp(v, OP_MemLoad, iMem+nCol+i+1, 0); - sqlite3VdbeAddOp(v, OP_Ne, 0x100, 0); - } - sqlite3VdbeAddOp(v, OP_Goto, 0, endOfLoop); - for(i=0; i<nCol; i++){ - addr = sqlite3VdbeAddOp(v, OP_MemIncr, iMem+i+1, 0); - sqlite3VdbeChangeP2(v, topOfLoop + 3*i + 3, addr); - sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i); - sqlite3VdbeAddOp(v, OP_MemStore, iMem+nCol+i+1, 1); - } - sqlite3VdbeResolveLabel(v, endOfLoop); - sqlite3VdbeAddOp(v, OP_Next, iIdxCur, topOfLoop); - sqlite3VdbeAddOp(v, OP_Close, iIdxCur, 0); - - /* Store the results. - ** - ** The result is a single row of the sqlite_stmt1 table. The first - ** two columns are the names of the table and index. The third column - ** is a string composed of a list of integer statistics about the - ** index. The first integer in the list is the total number of entires - ** in the index. There is one additional integer in the list for each - ** column of the table. This additional integer is a guess of how many - ** rows of the table the index will select. If D is the count of distinct - ** values and K is the total number of rows, then the integer is computed - ** as: - ** - ** I = (K+D-1)/D - ** - ** If K==0 then no entry is made into the sqlite_stat1 table. - ** If K>0 then it is always the case the D>0 so division by zero - ** is never possible. - */ - sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); - addr = sqlite3VdbeAddOp(v, OP_IfNot, 0, 0); - sqlite3VdbeAddOp(v, OP_NewRowid, iStatCur, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0); - sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, " ", 0); - for(i=0; i<nCol; i++){ - sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); - sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0); - sqlite3VdbeAddOp(v, OP_Add, 0, 0); - sqlite3VdbeAddOp(v, OP_AddImm, -1, 0); - sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0); - sqlite3VdbeAddOp(v, OP_Divide, 0, 0); - if( i==nCol-1 ){ - sqlite3VdbeAddOp(v, OP_Concat, nCol*2-1, 0); - }else{ - sqlite3VdbeAddOp(v, OP_Dup, 1, 0); - } - } - sqlite3VdbeOp3(v, OP_MakeRecord, 3, 0, "ttt", 0); - sqlite3VdbeAddOp(v, OP_Insert, iStatCur, 0); - sqlite3VdbeJumpHere(v, addr); - } -} - -/* -** Generate code that will cause the most recent index analysis to -** be laoded into internal hash tables where is can be used. -*/ -static void loadAnalysis(Parse *pParse, int iDb){ - Vdbe *v = sqlite3GetVdbe(pParse); - sqlite3VdbeAddOp(v, OP_LoadAnalysis, iDb, 0); -} - -/* -** Generate code that will do an analysis of an entire database -*/ -static void analyzeDatabase(Parse *pParse, int iDb){ - sqlite3 *db = pParse->db; - HashElem *k; - int iStatCur; - int iMem; - - sqlite3BeginWriteOperation(pParse, 0, iDb); - iStatCur = pParse->nTab++; - openStatTable(pParse, iDb, iStatCur, 0); - iMem = pParse->nMem; - for(k=sqliteHashFirst(&db->aDb[iDb].tblHash); k; k=sqliteHashNext(k)){ - Table *pTab = (Table*)sqliteHashData(k); - analyzeOneTable(pParse, pTab, iStatCur, iMem); - } - loadAnalysis(pParse, iDb); -} - -/* -** Generate code that will do an analysis of a single table in -** a database. -*/ -static void analyzeTable(Parse *pParse, Table *pTab){ - int iDb; - int iStatCur; - - assert( pTab!=0 ); - iDb = pTab->iDb; - sqlite3BeginWriteOperation(pParse, 0, iDb); - iStatCur = pParse->nTab++; - openStatTable(pParse, iDb, iStatCur, pTab->zName); - analyzeOneTable(pParse, pTab, iStatCur, pParse->nMem); - loadAnalysis(pParse, iDb); -} - -/* -** Generate code for the ANALYZE command. The parser calls this routine -** when it recognizes an ANALYZE command. -** -** ANALYZE -- 1 -** ANALYZE <database> -- 2 -** ANALYZE ?<database>.?<tablename> -- 3 -** -** Form 1 causes all indices in all attached databases to be analyzed. -** Form 2 analyzes all indices the single database named. -** Form 3 analyzes all indices associated with the named table. -*/ -void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){ - sqlite3 *db = pParse->db; - int iDb; - int i; - char *z, *zDb; - Table *pTab; - Token *pTableName; - - /* Read the database schema. If an error occurs, leave an error message - ** and code in pParse and return NULL. */ - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - return; - } - - if( pName1==0 ){ - /* Form 1: Analyze everything */ - for(i=0; i<db->nDb; i++){ - if( i==1 ) continue; /* Do not analyze the TEMP database */ - analyzeDatabase(pParse, i); - } - }else if( pName2==0 || pName2->n==0 ){ - /* Form 2: Analyze the database or table named */ - iDb = sqlite3FindDb(db, pName1); - if( iDb>=0 ){ - analyzeDatabase(pParse, iDb); - }else{ - z = sqlite3NameFromToken(pName1); - pTab = sqlite3LocateTable(pParse, z, 0); - sqliteFree(z); - if( pTab ){ - analyzeTable(pParse, pTab); - } - } - }else{ - /* Form 3: Analyze the fully qualified table name */ - iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pTableName); - if( iDb>=0 ){ - zDb = db->aDb[iDb].zName; - z = sqlite3NameFromToken(pTableName); - pTab = sqlite3LocateTable(pParse, z, zDb); - sqliteFree(z); - if( pTab ){ - analyzeTable(pParse, pTab); - } - } - } -} - -/* -** Used to pass information from the analyzer reader through to the -** callback routine. -*/ -typedef struct analysisInfo analysisInfo; -struct analysisInfo { - sqlite3 *db; - const char *zDatabase; -}; - -/* -** This callback is invoked once for each index when reading the -** sqlite_stat1 table. -** -** argv[0] = name of the index -** argv[1] = results of analysis - on integer for each column -*/ -static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){ - analysisInfo *pInfo = (analysisInfo*)pData; - Index *pIndex; - int i, c; - unsigned int v; - const char *z; - - assert( argc==2 ); - if( argv==0 || argv[0]==0 || argv[1]==0 ){ - return 0; - } - pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase); - if( pIndex==0 ){ - return 0; - } - z = argv[1]; - for(i=0; *z && i<=pIndex->nColumn; i++){ - v = 0; - while( (c=z[0])>='0' && c<='9' ){ - v = v*10 + c - '0'; - z++; - } - pIndex->aiRowEst[i] = v; - if( *z==' ' ) z++; - } - return 0; -} - -/* -** Load the content of the sqlite_stat1 table into the index hash tables. -*/ -void sqlite3AnalysisLoad(sqlite3 *db, int iDb){ - analysisInfo sInfo; - HashElem *i; - char *zSql; - - /* Clear any prior statistics */ - for(i=sqliteHashFirst(&db->aDb[iDb].idxHash); i; i=sqliteHashNext(i)){ - Index *pIdx = sqliteHashData(i); - sqlite3DefaultRowEst(pIdx); - } - - /* Check to make sure the sqlite_stat1 table existss */ - sInfo.db = db; - sInfo.zDatabase = db->aDb[iDb].zName; - if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)==0 ){ - return; - } - - - /* Load new statistics out of the sqlite_stat1 table */ - zSql = sqlite3MPrintf("SELECT idx, stat FROM %Q.sqlite_stat1", - sInfo.zDatabase); - sqlite3SafetyOff(db); - sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0); - sqlite3SafetyOn(db); - sqliteFree(zSql); -} - - -#endif /* SQLITE_OMIT_ANALYZE */ diff --git a/ext/pdo_sqlite/sqlite/src/attach.c b/ext/pdo_sqlite/sqlite/src/attach.c deleted file mode 100644 index 46b653e975092..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/attach.c +++ /dev/null @@ -1,352 +0,0 @@ -/* -** 2003 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the ATTACH and DETACH commands. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** This routine is called by the parser to process an ATTACH statement: -** -** ATTACH DATABASE filename AS dbname -** -** The pFilename and pDbname arguments are the tokens that define the -** filename and dbname in the ATTACH statement. -*/ -void sqlite3Attach( - Parse *pParse, /* The parser context */ - Token *pFilename, /* Name of database file */ - Token *pDbname, /* Name of the database to use internally */ - int keyType, /* 0: no key. 1: TEXT, 2: BLOB */ - Token *pKey /* Text of the key for keytype 1 and 2 */ -){ - Db *aNew; - int rc, i; - char *zFile = 0; - char *zName = 0; - sqlite3 *db; - Vdbe *v; - - v = sqlite3GetVdbe(pParse); - if( !v ) return; - sqlite3VdbeAddOp(v, OP_Expire, 1, 0); - sqlite3VdbeAddOp(v, OP_Halt, 0, 0); - if( pParse->explain ) return; - db = pParse->db; - if( db->nDb>=MAX_ATTACHED+2 ){ - sqlite3ErrorMsg(pParse, "too many attached databases - max %d", - MAX_ATTACHED); - pParse->rc = SQLITE_ERROR; - return; - } - - if( !db->autoCommit ){ - sqlite3ErrorMsg(pParse, "cannot ATTACH database within transaction"); - pParse->rc = SQLITE_ERROR; - return; - } - - zFile = sqlite3NameFromToken(pFilename); - if( zFile==0 ){ - goto attach_end; - } -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqlite3AuthCheck(pParse, SQLITE_ATTACH, zFile, 0, 0)!=SQLITE_OK ){ - goto attach_end; - } -#endif /* SQLITE_OMIT_AUTHORIZATION */ - - zName = sqlite3NameFromToken(pDbname); - if( zName==0 ){ - goto attach_end; - } - for(i=0; i<db->nDb; i++){ - char *z = db->aDb[i].zName; - if( z && sqlite3StrICmp(z, zName)==0 ){ - sqlite3ErrorMsg(pParse, "database %s is already in use", zName); - pParse->rc = SQLITE_ERROR; - goto attach_end; - } - } - - if( db->aDb==db->aDbStatic ){ - aNew = sqliteMalloc( sizeof(db->aDb[0])*3 ); - if( aNew==0 ){ - goto attach_end; - } - memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2); - }else{ - aNew = sqliteRealloc(db->aDb, sizeof(db->aDb[0])*(db->nDb+1) ); - if( aNew==0 ){ - goto attach_end; - } - } - db->aDb = aNew; - aNew = &db->aDb[db->nDb++]; - memset(aNew, 0, sizeof(*aNew)); - sqlite3HashInit(&aNew->tblHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&aNew->idxHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&aNew->trigHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&aNew->aFKey, SQLITE_HASH_STRING, 1); - aNew->zName = zName; - zName = 0; - aNew->safety_level = 3; - rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt); - if( rc ){ - sqlite3ErrorMsg(pParse, "unable to open database: %s", zFile); - } -#if SQLITE_HAS_CODEC - { - extern int sqlite3CodecAttach(sqlite3*, int, void*, int); - char *zKey; - int nKey; - if( keyType==0 ){ - /* No key specified. Use the key from the main database */ - extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); - sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); - }else if( keyType==1 ){ - /* Key specified as text */ - zKey = sqlite3NameFromToken(pKey); - nKey = strlen(zKey); - }else{ - /* Key specified as a BLOB */ - char *zTemp; - assert( keyType==2 ); - pKey->z++; - pKey->n--; - zTemp = sqlite3NameFromToken(pKey); - zKey = sqlite3HexToBlob(zTemp); - sqliteFree(zTemp); - } - sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); - if( keyType ){ - sqliteFree(zKey); - } - } -#endif - db->flags &= ~SQLITE_Initialized; - if( pParse->nErr==0 && rc==SQLITE_OK ){ - rc = sqlite3ReadSchema(pParse); - } - if( rc ){ - int i = db->nDb - 1; - assert( i>=2 ); - if( db->aDb[i].pBt ){ - sqlite3BtreeClose(db->aDb[i].pBt); - db->aDb[i].pBt = 0; - } - sqlite3ResetInternalSchema(db, 0); - assert( pParse->nErr>0 ); /* Always set by sqlite3ReadSchema() */ - if( pParse->rc==SQLITE_OK ){ - pParse->rc = SQLITE_ERROR; - } - } - -attach_end: - sqliteFree(zFile); - sqliteFree(zName); -} - -/* -** This routine is called by the parser to process a DETACH statement: -** -** DETACH DATABASE dbname -** -** The pDbname argument is the name of the database in the DETACH statement. -*/ -void sqlite3Detach(Parse *pParse, Token *pDbname){ - int i; - sqlite3 *db; - Vdbe *v; - Db *pDb = 0; - char *zName; - - v = sqlite3GetVdbe(pParse); - if( !v ) return; - sqlite3VdbeAddOp(v, OP_Expire, 0, 0); - sqlite3VdbeAddOp(v, OP_Halt, 0, 0); - if( pParse->explain ) return; - db = pParse->db; - zName = sqlite3NameFromToken(pDbname); - if( zName==0 ) return; - for(i=0; i<db->nDb; i++){ - pDb = &db->aDb[i]; - if( pDb->pBt==0 ) continue; - if( sqlite3StrICmp(pDb->zName, zName)==0 ) break; - } - if( i>=db->nDb ){ - sqlite3ErrorMsg(pParse, "no such database: %z", zName); - return; - } - if( i<2 ){ - sqlite3ErrorMsg(pParse, "cannot detach database %z", zName); - return; - } - sqliteFree(zName); - if( !db->autoCommit ){ - sqlite3ErrorMsg(pParse, "cannot DETACH database within transaction"); - pParse->rc = SQLITE_ERROR; - return; - } -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqlite3AuthCheck(pParse,SQLITE_DETACH,db->aDb[i].zName,0,0)!=SQLITE_OK ){ - return; - } -#endif /* SQLITE_OMIT_AUTHORIZATION */ - sqlite3BtreeClose(pDb->pBt); - pDb->pBt = 0; - sqlite3ResetInternalSchema(db, 0); -} - -/* -** Initialize a DbFixer structure. This routine must be called prior -** to passing the structure to one of the sqliteFixAAAA() routines below. -** -** The return value indicates whether or not fixation is required. TRUE -** means we do need to fix the database references, FALSE means we do not. -*/ -int sqlite3FixInit( - DbFixer *pFix, /* The fixer to be initialized */ - Parse *pParse, /* Error messages will be written here */ - int iDb, /* This is the database that must be used */ - const char *zType, /* "view", "trigger", or "index" */ - const Token *pName /* Name of the view, trigger, or index */ -){ - sqlite3 *db; - - if( iDb<0 || iDb==1 ) return 0; - db = pParse->db; - assert( db->nDb>iDb ); - pFix->pParse = pParse; - pFix->zDb = db->aDb[iDb].zName; - pFix->zType = zType; - pFix->pName = pName; - return 1; -} - -/* -** The following set of routines walk through the parse tree and assign -** a specific database to all table references where the database name -** was left unspecified in the original SQL statement. The pFix structure -** must have been initialized by a prior call to sqlite3FixInit(). -** -** These routines are used to make sure that an index, trigger, or -** view in one database does not refer to objects in a different database. -** (Exception: indices, triggers, and views in the TEMP database are -** allowed to refer to anything.) If a reference is explicitly made -** to an object in a different database, an error message is added to -** pParse->zErrMsg and these routines return non-zero. If everything -** checks out, these routines return 0. -*/ -int sqlite3FixSrcList( - DbFixer *pFix, /* Context of the fixation */ - SrcList *pList /* The Source list to check and modify */ -){ - int i; - const char *zDb; - struct SrcList_item *pItem; - - if( pList==0 ) return 0; - zDb = pFix->zDb; - for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){ - if( pItem->zDatabase==0 ){ - pItem->zDatabase = sqliteStrDup(zDb); - }else if( sqlite3StrICmp(pItem->zDatabase,zDb)!=0 ){ - sqlite3ErrorMsg(pFix->pParse, - "%s %T cannot reference objects in database %s", - pFix->zType, pFix->pName, pItem->zDatabase); - return 1; - } -#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) - if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1; - if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1; -#endif - } - return 0; -} -#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) -int sqlite3FixSelect( - DbFixer *pFix, /* Context of the fixation */ - Select *pSelect /* The SELECT statement to be fixed to one database */ -){ - while( pSelect ){ - if( sqlite3FixExprList(pFix, pSelect->pEList) ){ - return 1; - } - if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){ - return 1; - } - if( sqlite3FixExpr(pFix, pSelect->pWhere) ){ - return 1; - } - if( sqlite3FixExpr(pFix, pSelect->pHaving) ){ - return 1; - } - pSelect = pSelect->pPrior; - } - return 0; -} -int sqlite3FixExpr( - DbFixer *pFix, /* Context of the fixation */ - Expr *pExpr /* The expression to be fixed to one database */ -){ - while( pExpr ){ - if( sqlite3FixSelect(pFix, pExpr->pSelect) ){ - return 1; - } - if( sqlite3FixExprList(pFix, pExpr->pList) ){ - return 1; - } - if( sqlite3FixExpr(pFix, pExpr->pRight) ){ - return 1; - } - pExpr = pExpr->pLeft; - } - return 0; -} -int sqlite3FixExprList( - DbFixer *pFix, /* Context of the fixation */ - ExprList *pList /* The expression to be fixed to one database */ -){ - int i; - struct ExprList_item *pItem; - if( pList==0 ) return 0; - for(i=0, pItem=pList->a; i<pList->nExpr; i++, pItem++){ - if( sqlite3FixExpr(pFix, pItem->pExpr) ){ - return 1; - } - } - return 0; -} -#endif - -#ifndef SQLITE_OMIT_TRIGGER -int sqlite3FixTriggerStep( - DbFixer *pFix, /* Context of the fixation */ - TriggerStep *pStep /* The trigger step be fixed to one database */ -){ - while( pStep ){ - if( sqlite3FixSelect(pFix, pStep->pSelect) ){ - return 1; - } - if( sqlite3FixExpr(pFix, pStep->pWhere) ){ - return 1; - } - if( sqlite3FixExprList(pFix, pStep->pExprList) ){ - return 1; - } - pStep = pStep->pNext; - } - return 0; -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/auth.c b/ext/pdo_sqlite/sqlite/src/auth.c deleted file mode 100644 index 693baa2c895be..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/auth.c +++ /dev/null @@ -1,225 +0,0 @@ -/* -** 2003 January 11 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the sqlite3_set_authorizer() -** API. This facility is an optional feature of the library. Embedded -** systems that do not need this facility may omit it by recompiling -** the library with -DSQLITE_OMIT_AUTHORIZATION=1 -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** All of the code in this file may be omitted by defining a single -** macro. -*/ -#ifndef SQLITE_OMIT_AUTHORIZATION - -/* -** Set or clear the access authorization function. -** -** The access authorization function is be called during the compilation -** phase to verify that the user has read and/or write access permission on -** various fields of the database. The first argument to the auth function -** is a copy of the 3rd argument to this routine. The second argument -** to the auth function is one of these constants: -** -** SQLITE_CREATE_INDEX -** SQLITE_CREATE_TABLE -** SQLITE_CREATE_TEMP_INDEX -** SQLITE_CREATE_TEMP_TABLE -** SQLITE_CREATE_TEMP_TRIGGER -** SQLITE_CREATE_TEMP_VIEW -** SQLITE_CREATE_TRIGGER -** SQLITE_CREATE_VIEW -** SQLITE_DELETE -** SQLITE_DROP_INDEX -** SQLITE_DROP_TABLE -** SQLITE_DROP_TEMP_INDEX -** SQLITE_DROP_TEMP_TABLE -** SQLITE_DROP_TEMP_TRIGGER -** SQLITE_DROP_TEMP_VIEW -** SQLITE_DROP_TRIGGER -** SQLITE_DROP_VIEW -** SQLITE_INSERT -** SQLITE_PRAGMA -** SQLITE_READ -** SQLITE_SELECT -** SQLITE_TRANSACTION -** SQLITE_UPDATE -** -** The third and fourth arguments to the auth function are the name of -** the table and the column that are being accessed. The auth function -** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If -** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY -** means that the SQL statement will never-run - the sqlite3_exec() call -** will return with an error. SQLITE_IGNORE means that the SQL statement -** should run but attempts to read the specified column will return NULL -** and attempts to write the column will be ignored. -** -** Setting the auth function to NULL disables this hook. The default -** setting of the auth function is NULL. -*/ -int sqlite3_set_authorizer( - sqlite3 *db, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), - void *pArg -){ - db->xAuth = xAuth; - db->pAuthArg = pArg; - sqlite3ExpirePreparedStatements(db); - return SQLITE_OK; -} - -/* -** Write an error message into pParse->zErrMsg that explains that the -** user-supplied authorization function returned an illegal value. -*/ -static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ - sqlite3ErrorMsg(pParse, "illegal return value (%d) from the " - "authorization function - should be SQLITE_OK, SQLITE_IGNORE, " - "or SQLITE_DENY", rc); - pParse->rc = SQLITE_ERROR; -} - -/* -** The pExpr should be a TK_COLUMN expression. The table referred to -** is in pTabList or else it is the NEW or OLD table of a trigger. -** Check to see if it is OK to read this particular column. -** -** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN -** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, -** then generate an error. -*/ -void sqlite3AuthRead( - Parse *pParse, /* The parser context */ - Expr *pExpr, /* The expression to check authorization on */ - SrcList *pTabList /* All table that pExpr might refer to */ -){ - sqlite3 *db = pParse->db; - int rc; - Table *pTab; /* The table being read */ - const char *zCol; /* Name of the column of the table */ - int iSrc; /* Index in pTabList->a[] of table being read */ - const char *zDBase; /* Name of database being accessed */ - TriggerStack *pStack; /* The stack of current triggers */ - - if( db->xAuth==0 ) return; - if( pExpr->op==TK_AS ) return; - assert( pExpr->op==TK_COLUMN ); - for(iSrc=0; pTabList && iSrc<pTabList->nSrc; iSrc++){ - if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break; - } - if( iSrc>=0 && pTabList && iSrc<pTabList->nSrc ){ - pTab = pTabList->a[iSrc].pTab; - }else if( (pStack = pParse->trigStack)!=0 ){ - /* This must be an attempt to read the NEW or OLD pseudo-tables - ** of a trigger. - */ - assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx ); - pTab = pStack->pTab; - }else{ - return; - } - if( pTab==0 ) return; - if( pExpr->iColumn>=0 ){ - assert( pExpr->iColumn<pTab->nCol ); - zCol = pTab->aCol[pExpr->iColumn].zName; - }else if( pTab->iPKey>=0 ){ - assert( pTab->iPKey<pTab->nCol ); - zCol = pTab->aCol[pTab->iPKey].zName; - }else{ - zCol = "ROWID"; - } - assert( pExpr->iDb<db->nDb ); - zDBase = db->aDb[pExpr->iDb].zName; - rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase, - pParse->zAuthContext); - if( rc==SQLITE_IGNORE ){ - pExpr->op = TK_NULL; - }else if( rc==SQLITE_DENY ){ - if( db->nDb>2 || pExpr->iDb!=0 ){ - sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited", - zDBase, pTab->zName, zCol); - }else{ - sqlite3ErrorMsg(pParse, "access to %s.%s is prohibited",pTab->zName,zCol); - } - pParse->rc = SQLITE_AUTH; - }else if( rc!=SQLITE_OK ){ - sqliteAuthBadReturnCode(pParse, rc); - } -} - -/* -** Do an authorization check using the code and arguments given. Return -** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY -** is returned, then the error count and error message in pParse are -** modified appropriately. -*/ -int sqlite3AuthCheck( - Parse *pParse, - int code, - const char *zArg1, - const char *zArg2, - const char *zArg3 -){ - sqlite3 *db = pParse->db; - int rc; - - /* Don't do any authorization checks if the database is initialising. */ - if( db->init.busy ){ - return SQLITE_OK; - } - - if( db->xAuth==0 ){ - return SQLITE_OK; - } - rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext); - if( rc==SQLITE_DENY ){ - sqlite3ErrorMsg(pParse, "not authorized"); - pParse->rc = SQLITE_AUTH; - }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ - rc = SQLITE_DENY; - sqliteAuthBadReturnCode(pParse, rc); - } - return rc; -} - -/* -** Push an authorization context. After this routine is called, the -** zArg3 argument to authorization callbacks will be zContext until -** popped. Or if pParse==0, this routine is a no-op. -*/ -void sqlite3AuthContextPush( - Parse *pParse, - AuthContext *pContext, - const char *zContext -){ - pContext->pParse = pParse; - if( pParse ){ - pContext->zAuthContext = pParse->zAuthContext; - pParse->zAuthContext = zContext; - } -} - -/* -** Pop an authorization context that was previously pushed -** by sqlite3AuthContextPush -*/ -void sqlite3AuthContextPop(AuthContext *pContext){ - if( pContext->pParse ){ - pContext->pParse->zAuthContext = pContext->zAuthContext; - pContext->pParse = 0; - } -} - -#endif /* SQLITE_OMIT_AUTHORIZATION */ diff --git a/ext/pdo_sqlite/sqlite/src/btree.c b/ext/pdo_sqlite/sqlite/src/btree.c deleted file mode 100644 index f1ef6a2a4c946..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/btree.c +++ /dev/null @@ -1,5833 +0,0 @@ -/* -** 2004 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** $Id$ -** -** This file implements a external (disk-based) database using BTrees. -** For a detailed discussion of BTrees, refer to -** -** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: -** "Sorting And Searching", pages 473-480. Addison-Wesley -** Publishing Company, Reading, Massachusetts. -** -** The basic idea is that each page of the file contains N database -** entries and N+1 pointers to subpages. -** -** ---------------------------------------------------------------- -** | Ptr(0) | Key(0) | Ptr(1) | Key(1) | ... | Key(N) | Ptr(N+1) | -** ---------------------------------------------------------------- -** -** All of the keys on the page that Ptr(0) points to have values less -** than Key(0). All of the keys on page Ptr(1) and its subpages have -** values greater than Key(0) and less than Key(1). All of the keys -** on Ptr(N+1) and its subpages have values greater than Key(N). And -** so forth. -** -** Finding a particular key requires reading O(log(M)) pages from the -** disk where M is the number of entries in the tree. -** -** In this implementation, a single file can hold one or more separate -** BTrees. Each BTree is identified by the index of its root page. The -** key and data for any entry are combined to form the "payload". A -** fixed amount of payload can be carried directly on the database -** page. If the payload is larger than the preset amount then surplus -** bytes are stored on overflow pages. The payload for an entry -** and the preceding pointer are combined to form a "Cell". Each -** page has a small header which contains the Ptr(N+1) pointer and other -** information such as the size of key and data. -** -** FORMAT DETAILS -** -** The file is divided into pages. The first page is called page 1, -** the second is page 2, and so forth. A page number of zero indicates -** "no such page". The page size can be anything between 512 and 65536. -** Each page can be either a btree page, a freelist page or an overflow -** page. -** -** The first page is always a btree page. The first 100 bytes of the first -** page contain a special header (the "file header") that describes the file. -** The format of the file header is as follows: -** -** OFFSET SIZE DESCRIPTION -** 0 16 Header string: "SQLite format 3\000" -** 16 2 Page size in bytes. -** 18 1 File format write version -** 19 1 File format read version -** 20 1 Bytes of unused space at the end of each page -** 21 1 Max embedded payload fraction -** 22 1 Min embedded payload fraction -** 23 1 Min leaf payload fraction -** 24 4 File change counter -** 28 4 Reserved for future use -** 32 4 First freelist page -** 36 4 Number of freelist pages in the file -** 40 60 15 4-byte meta values passed to higher layers -** -** All of the integer values are big-endian (most significant byte first). -** -** The file change counter is incremented when the database is changed more -** than once within the same second. This counter, together with the -** modification time of the file, allows other processes to know -** when the file has changed and thus when they need to flush their -** cache. -** -** The max embedded payload fraction is the amount of the total usable -** space in a page that can be consumed by a single cell for standard -** B-tree (non-LEAFDATA) tables. A value of 255 means 100%. The default -** is to limit the maximum cell size so that at least 4 cells will fit -** on one page. Thus the default max embedded payload fraction is 64. -** -** If the payload for a cell is larger than the max payload, then extra -** payload is spilled to overflow pages. Once an overflow page is allocated, -** as many bytes as possible are moved into the overflow pages without letting -** the cell size drop below the min embedded payload fraction. -** -** The min leaf payload fraction is like the min embedded payload fraction -** except that it applies to leaf nodes in a LEAFDATA tree. The maximum -** payload fraction for a LEAFDATA tree is always 100% (or 255) and it -** not specified in the header. -** -** Each btree pages is divided into three sections: The header, the -** cell pointer array, and the cell area area. Page 1 also has a 100-byte -** file header that occurs before the page header. -** -** |----------------| -** | file header | 100 bytes. Page 1 only. -** |----------------| -** | page header | 8 bytes for leaves. 12 bytes for interior nodes -** |----------------| -** | cell pointer | | 2 bytes per cell. Sorted order. -** | array | | Grows downward -** | | v -** |----------------| -** | unallocated | -** | space | -** |----------------| ^ Grows upwards -** | cell content | | Arbitrary order interspersed with freeblocks. -** | area | | and free space fragments. -** |----------------| -** -** The page headers looks like this: -** -** OFFSET SIZE DESCRIPTION -** 0 1 Flags. 1: intkey, 2: zerodata, 4: leafdata, 8: leaf -** 1 2 byte offset to the first freeblock -** 3 2 number of cells on this page -** 5 2 first byte of the cell content area -** 7 1 number of fragmented free bytes -** 8 4 Right child (the Ptr(N+1) value). Omitted on leaves. -** -** The flags define the format of this btree page. The leaf flag means that -** this page has no children. The zerodata flag means that this page carries -** only keys and no data. The intkey flag means that the key is a integer -** which is stored in the key size entry of the cell header rather than in -** the payload area. -** -** The cell pointer array begins on the first byte after the page header. -** The cell pointer array contains zero or more 2-byte numbers which are -** offsets from the beginning of the page to the cell content in the cell -** content area. The cell pointers occur in sorted order. The system strives -** to keep free space after the last cell pointer so that new cells can -** be easily added without having to defragment the page. -** -** Cell content is stored at the very end of the page and grows toward the -** beginning of the page. -** -** Unused space within the cell content area is collected into a linked list of -** freeblocks. Each freeblock is at least 4 bytes in size. The byte offset -** to the first freeblock is given in the header. Freeblocks occur in -** increasing order. Because a freeblock must be at least 4 bytes in size, -** any group of 3 or fewer unused bytes in the cell content area cannot -** exist on the freeblock chain. A group of 3 or fewer free bytes is called -** a fragment. The total number of bytes in all fragments is recorded. -** in the page header at offset 7. -** -** SIZE DESCRIPTION -** 2 Byte offset of the next freeblock -** 2 Bytes in this freeblock -** -** Cells are of variable length. Cells are stored in the cell content area at -** the end of the page. Pointers to the cells are in the cell pointer array -** that immediately follows the page header. Cells is not necessarily -** contiguous or in order, but cell pointers are contiguous and in order. -** -** Cell content makes use of variable length integers. A variable -** length integer is 1 to 9 bytes where the lower 7 bits of each -** byte are used. The integer consists of all bytes that have bit 8 set and -** the first byte with bit 8 clear. The most significant byte of the integer -** appears first. A variable-length integer may not be more than 9 bytes long. -** As a special case, all 8 bytes of the 9th byte are used as data. This -** allows a 64-bit integer to be encoded in 9 bytes. -** -** 0x00 becomes 0x00000000 -** 0x7f becomes 0x0000007f -** 0x81 0x00 becomes 0x00000080 -** 0x82 0x00 becomes 0x00000100 -** 0x80 0x7f becomes 0x0000007f -** 0x8a 0x91 0xd1 0xac 0x78 becomes 0x12345678 -** 0x81 0x81 0x81 0x81 0x01 becomes 0x10204081 -** -** Variable length integers are used for rowids and to hold the number of -** bytes of key and data in a btree cell. -** -** The content of a cell looks like this: -** -** SIZE DESCRIPTION -** 4 Page number of the left child. Omitted if leaf flag is set. -** var Number of bytes of data. Omitted if the zerodata flag is set. -** var Number of bytes of key. Or the key itself if intkey flag is set. -** * Payload -** 4 First page of the overflow chain. Omitted if no overflow -** -** Overflow pages form a linked list. Each page except the last is completely -** filled with data (pagesize - 4 bytes). The last page can have as little -** as 1 byte of data. -** -** SIZE DESCRIPTION -** 4 Page number of next overflow page -** * Data -** -** Freelist pages come in two subtypes: trunk pages and leaf pages. The -** file header points to first in a linked list of trunk page. Each trunk -** page points to multiple leaf pages. The content of a leaf page is -** unspecified. A trunk page looks like this: -** -** SIZE DESCRIPTION -** 4 Page number of next trunk page -** 4 Number of leaf pointers on this page -** * zero or more pages numbers of leaves -*/ -#include "sqliteInt.h" -#include "pager.h" -#include "btree.h" -#include "os.h" -#include <assert.h> - -/* Round up a number to the next larger multiple of 8. This is used -** to force 8-byte alignment on 64-bit architectures. -*/ -#define ROUND8(x) ((x+7)&~7) - - -/* The following value is the maximum cell size assuming a maximum page -** size give above. -*/ -#define MX_CELL_SIZE(pBt) (pBt->pageSize-8) - -/* The maximum number of cells on a single page of the database. This -** assumes a minimum cell size of 3 bytes. Such small cells will be -** exceedingly rare, but they are possible. -*/ -#define MX_CELL(pBt) ((pBt->pageSize-8)/3) - -/* Forward declarations */ -typedef struct MemPage MemPage; - -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. -*/ -#ifndef SQLITE_FILE_HEADER /* 123456789 123456 */ -# define SQLITE_FILE_HEADER "SQLite format 3" -#endif -static const char zMagicHeader[] = SQLITE_FILE_HEADER; - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of every BTree page. -*/ -#define PTF_INTKEY 0x01 -#define PTF_ZERODATA 0x02 -#define PTF_LEAFDATA 0x04 -#define PTF_LEAF 0x08 - -/* -** As each page of the file is loaded into memory, an instance of the following -** structure is appended and initialized to zero. This structure stores -** information about the page that is decoded from the raw file page. -** -** The pParent field points back to the parent page. This allows us to -** walk up the BTree from any leaf to the root. Care must be taken to -** unref() the parent page pointer when this page is no longer referenced. -** The pageDestructor() routine handles that chore. -*/ -struct MemPage { - u8 isInit; /* True if previously initialized. MUST BE FIRST! */ - u8 idxShift; /* True if Cell indices have changed */ - u8 nOverflow; /* Number of overflow cell bodies in aCell[] */ - u8 intKey; /* True if intkey flag is set */ - u8 leaf; /* True if leaf flag is set */ - u8 zeroData; /* True if table stores keys only */ - u8 leafData; /* True if tables stores data on leaves only */ - u8 hasData; /* True if this page stores data */ - u8 hdrOffset; /* 100 for page 1. 0 otherwise */ - u8 childPtrSize; /* 0 if leaf==1. 4 if leaf==0 */ - u16 maxLocal; /* Copy of Btree.maxLocal or Btree.maxLeaf */ - u16 minLocal; /* Copy of Btree.minLocal or Btree.minLeaf */ - u16 cellOffset; /* Index in aData of first cell pointer */ - u16 idxParent; /* Index in parent of this node */ - u16 nFree; /* Number of free bytes on the page */ - u16 nCell; /* Number of cells on this page, local and ovfl */ - struct _OvflCell { /* Cells that will not fit on aData[] */ - u8 *pCell; /* Pointers to the body of the overflow cell */ - u16 idx; /* Insert this cell before idx-th non-overflow cell */ - } aOvfl[5]; - struct Btree *pBt; /* Pointer back to BTree structure */ - u8 *aData; /* Pointer back to the start of the page */ - Pgno pgno; /* Page number for this page */ - MemPage *pParent; /* The parent of this page. NULL for root */ -}; - -/* -** The in-memory image of a disk page has the auxiliary information appended -** to the end. EXTRA_SIZE is the number of bytes of space needed to hold -** that extra information. -*/ -#define EXTRA_SIZE sizeof(MemPage) - -/* -** Everything we need to know about an open database -*/ -struct Btree { - Pager *pPager; /* The page cache */ - BtCursor *pCursor; /* A list of all open cursors */ - MemPage *pPage1; /* First page of the database */ - u8 inTrans; /* True if a transaction is in progress */ - u8 inStmt; /* True if we are in a statement subtransaction */ - u8 readOnly; /* True if the underlying file is readonly */ - u8 maxEmbedFrac; /* Maximum payload as % of total page size */ - u8 minEmbedFrac; /* Minimum payload as % of total page size */ - u8 minLeafFrac; /* Minimum leaf payload as % of total page size */ - u8 pageSizeFixed; /* True if the page size can no longer be changed */ -#ifndef SQLITE_OMIT_AUTOVACUUM - u8 autoVacuum; /* True if database supports auto-vacuum */ -#endif - u16 pageSize; /* Total number of bytes on a page */ - u16 usableSize; /* Number of usable bytes on each page */ - int maxLocal; /* Maximum local payload in non-LEAFDATA tables */ - int minLocal; /* Minimum local payload in non-LEAFDATA tables */ - int maxLeaf; /* Maximum local payload in a LEAFDATA table */ - int minLeaf; /* Minimum local payload in a LEAFDATA table */ - BusyHandler *pBusyHandler; /* Callback for when there is lock contention */ -}; -typedef Btree Bt; - -/* -** Btree.inTrans may take one of the following values. -*/ -#define TRANS_NONE 0 -#define TRANS_READ 1 -#define TRANS_WRITE 2 - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. -*/ -typedef struct CellInfo CellInfo; -struct CellInfo { - u8 *pCell; /* Pointer to the start of cell content */ - i64 nKey; /* The key for INTKEY tables, or number of bytes in key */ - u32 nData; /* Number of bytes of data */ - u16 nHeader; /* Size of the cell content header in bytes */ - u16 nLocal; /* Amount of payload held locally */ - u16 iOverflow; /* Offset to overflow page number. Zero if no overflow */ - u16 nSize; /* Size of the cell content on the main b-tree page */ -}; - -/* -** A cursor is a pointer to a particular entry in the BTree. -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -*/ -struct BtCursor { - Btree *pBt; /* The Btree to which this cursor belongs */ - BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ - int (*xCompare)(void*,int,const void*,int,const void*); /* Key comp func */ - void *pArg; /* First arg to xCompare() */ - Pgno pgnoRoot; /* The root page of this tree */ - MemPage *pPage; /* Page that contains the entry */ - int idx; /* Index of the entry in pPage->aCell[] */ - CellInfo info; /* A parse of the cell we are pointing at */ - u8 wrFlag; /* True if writable */ - u8 isValid; /* TRUE if points to a valid entry */ -}; - -/* -** The TRACE macro will print high-level status information about the -** btree operation when the global variable sqlite3_btree_trace is -** enabled. -*/ -#if SQLITE_TEST -# define TRACE(X) if( sqlite3_btree_trace )\ - { sqlite3DebugPrintf X; fflush(stdout); } -#else -# define TRACE(X) -#endif -int sqlite3_btree_trace=0; /* True to enable tracing */ - -/* -** Forward declaration -*/ -static int checkReadLocks(Btree*,Pgno,BtCursor*); - -/* -** Read or write a two- and four-byte big-endian integer values. -*/ -static u32 get2byte(unsigned char *p){ - return (p[0]<<8) | p[1]; -} -static u32 get4byte(unsigned char *p){ - return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]; -} -static void put2byte(unsigned char *p, u32 v){ - p[0] = v>>8; - p[1] = v; -} -static void put4byte(unsigned char *p, u32 v){ - p[0] = v>>24; - p[1] = v>>16; - p[2] = v>>8; - p[3] = v; -} - -/* -** Routines to read and write variable-length integers. These used to -** be defined locally, but now we use the varint routines in the util.c -** file. -*/ -#define getVarint sqlite3GetVarint -#define getVarint32 sqlite3GetVarint32 -#define putVarint sqlite3PutVarint - -/* The database page the PENDING_BYTE occupies. This page is never used. -** TODO: This macro is very similary to PAGER_MJ_PGNO() in pager.c. They -** should possibly be consolidated (presumably in pager.h). -*/ -#define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1) - -#ifndef SQLITE_OMIT_AUTOVACUUM -/* -** These macros define the location of the pointer-map entry for a -** database page. The first argument to each is the number of usable -** bytes on each page of the database (often 1024). The second is the -** page number to look up in the pointer map. -** -** PTRMAP_PAGENO returns the database page number of the pointer-map -** page that stores the required pointer. PTRMAP_PTROFFSET returns -** the offset of the requested map entry. -** -** If the pgno argument passed to PTRMAP_PAGENO is a pointer-map page, -** then pgno is returned. So (pgno==PTRMAP_PAGENO(pgsz, pgno)) can be -** used to test if pgno is a pointer-map page. PTRMAP_ISPAGE implements -** this test. -*/ -#define PTRMAP_PAGENO(pgsz, pgno) (((pgno-2)/(pgsz/5+1))*(pgsz/5+1)+2) -#define PTRMAP_PTROFFSET(pgsz, pgno) (((pgno-2)%(pgsz/5+1)-1)*5) -#define PTRMAP_ISPAGE(pgsz, pgno) (PTRMAP_PAGENO(pgsz,pgno)==pgno) - -/* -** The pointer map is a lookup table that identifies the parent page for -** each child page in the database file. The parent page is the page that -** contains a pointer to the child. Every page in the database contains -** 0 or 1 parent pages. (In this context 'database page' refers -** to any page that is not part of the pointer map itself.) Each pointer map -** entry consists of a single byte 'type' and a 4 byte parent page number. -** The PTRMAP_XXX identifiers below are the valid types. -** -** The purpose of the pointer map is to facility moving pages from one -** position in the file to another as part of autovacuum. When a page -** is moved, the pointer in its parent must be updated to point to the -** new location. The pointer map is used to locate the parent page quickly. -** -** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not -** used in this case. -** -** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number -** is not used in this case. -** -** PTRMAP_OVERFLOW1: The database page is the first page in a list of -** overflow pages. The page number identifies the page that -** contains the cell with a pointer to this overflow page. -** -** PTRMAP_OVERFLOW2: The database page is the second or later page in a list of -** overflow pages. The page-number identifies the previous -** page in the overflow page list. -** -** PTRMAP_BTREE: The database page is a non-root btree page. The page number -** identifies the parent page in the btree. -*/ -#define PTRMAP_ROOTPAGE 1 -#define PTRMAP_FREEPAGE 2 -#define PTRMAP_OVERFLOW1 3 -#define PTRMAP_OVERFLOW2 4 -#define PTRMAP_BTREE 5 - -/* -** Write an entry into the pointer map. -** -** This routine updates the pointer map entry for page number 'key' -** so that it maps to type 'eType' and parent page number 'pgno'. -** An error code is returned if something goes wrong, otherwise SQLITE_OK. -*/ -static int ptrmapPut(Btree *pBt, Pgno key, u8 eType, Pgno parent){ - u8 *pPtrmap; /* The pointer map page */ - Pgno iPtrmap; /* The pointer map page number */ - int offset; /* Offset in pointer map page */ - int rc; - - assert( pBt->autoVacuum ); - if( key==0 ){ - return SQLITE_CORRUPT_BKPT; - } - iPtrmap = PTRMAP_PAGENO(pBt->usableSize, key); - rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap); - if( rc!=SQLITE_OK ){ - return rc; - } - offset = PTRMAP_PTROFFSET(pBt->usableSize, key); - - if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){ - TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent)); - rc = sqlite3pager_write(pPtrmap); - if( rc==SQLITE_OK ){ - pPtrmap[offset] = eType; - put4byte(&pPtrmap[offset+1], parent); - } - } - - sqlite3pager_unref(pPtrmap); - return rc; -} - -/* -** Read an entry from the pointer map. -** -** This routine retrieves the pointer map entry for page 'key', writing -** the type and parent page number to *pEType and *pPgno respectively. -** An error code is returned if something goes wrong, otherwise SQLITE_OK. -*/ -static int ptrmapGet(Btree *pBt, Pgno key, u8 *pEType, Pgno *pPgno){ - int iPtrmap; /* Pointer map page index */ - u8 *pPtrmap; /* Pointer map page data */ - int offset; /* Offset of entry in pointer map */ - int rc; - - iPtrmap = PTRMAP_PAGENO(pBt->usableSize, key); - rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap); - if( rc!=0 ){ - return rc; - } - - offset = PTRMAP_PTROFFSET(pBt->usableSize, key); - if( pEType ) *pEType = pPtrmap[offset]; - if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]); - - sqlite3pager_unref(pPtrmap); - if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_BKPT; - return SQLITE_OK; -} - -#endif /* SQLITE_OMIT_AUTOVACUUM */ - -/* -** Given a btree page and a cell index (0 means the first cell on -** the page, 1 means the second cell, and so forth) return a pointer -** to the cell content. -** -** This routine works only for pages that do not contain overflow cells. -*/ -static u8 *findCell(MemPage *pPage, int iCell){ - u8 *data = pPage->aData; - assert( iCell>=0 ); - assert( iCell<get2byte(&data[pPage->hdrOffset+3]) ); - return data + get2byte(&data[pPage->cellOffset+2*iCell]); -} - -/* -** This a more complex version of findCell() that works for -** pages that do contain overflow cells. See insert -*/ -static u8 *findOverflowCell(MemPage *pPage, int iCell){ - int i; - for(i=pPage->nOverflow-1; i>=0; i--){ - int k; - struct _OvflCell *pOvfl; - pOvfl = &pPage->aOvfl[i]; - k = pOvfl->idx; - if( k<=iCell ){ - if( k==iCell ){ - return pOvfl->pCell; - } - iCell--; - } - } - return findCell(pPage, iCell); -} - -/* -** Parse a cell content block and fill in the CellInfo structure. There -** are two versions of this function. parseCell() takes a cell index -** as the second argument and parseCellPtr() takes a pointer to the -** body of the cell as its second argument. -*/ -static void parseCellPtr( - MemPage *pPage, /* Page containing the cell */ - u8 *pCell, /* Pointer to the cell text. */ - CellInfo *pInfo /* Fill in this structure */ -){ - int n; /* Number bytes in cell content header */ - u32 nPayload; /* Number of bytes of cell payload */ - - pInfo->pCell = pCell; - assert( pPage->leaf==0 || pPage->leaf==1 ); - n = pPage->childPtrSize; - assert( n==4-4*pPage->leaf ); - if( pPage->hasData ){ - n += getVarint32(&pCell[n], &nPayload); - }else{ - nPayload = 0; - } - n += getVarint(&pCell[n], (u64 *)&pInfo->nKey); - pInfo->nHeader = n; - pInfo->nData = nPayload; - if( !pPage->intKey ){ - nPayload += pInfo->nKey; - } - if( nPayload<=pPage->maxLocal ){ - /* This is the (easy) common case where the entire payload fits - ** on the local page. No overflow is required. - */ - int nSize; /* Total size of cell content in bytes */ - pInfo->nLocal = nPayload; - pInfo->iOverflow = 0; - nSize = nPayload + n; - if( nSize<4 ){ - nSize = 4; /* Minimum cell size is 4 */ - } - pInfo->nSize = nSize; - }else{ - /* If the payload will not fit completely on the local page, we have - ** to decide how much to store locally and how much to spill onto - ** overflow pages. The strategy is to minimize the amount of unused - ** space on overflow pages while keeping the amount of local storage - ** in between minLocal and maxLocal. - ** - ** Warning: changing the way overflow payload is distributed in any - ** way will result in an incompatible file format. - */ - int minLocal; /* Minimum amount of payload held locally */ - int maxLocal; /* Maximum amount of payload held locally */ - int surplus; /* Overflow payload available for local storage */ - - minLocal = pPage->minLocal; - maxLocal = pPage->maxLocal; - surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize - 4); - if( surplus <= maxLocal ){ - pInfo->nLocal = surplus; - }else{ - pInfo->nLocal = minLocal; - } - pInfo->iOverflow = pInfo->nLocal + n; - pInfo->nSize = pInfo->iOverflow + 4; - } -} -static void parseCell( - MemPage *pPage, /* Page containing the cell */ - int iCell, /* The cell index. First cell is 0 */ - CellInfo *pInfo /* Fill in this structure */ -){ - parseCellPtr(pPage, findCell(pPage, iCell), pInfo); -} - -/* -** Compute the total number of bytes that a Cell needs in the cell -** data area of the btree-page. The return number includes the cell -** data header and the local payload, but not any overflow page or -** the space used by the cell pointer. -*/ -#ifndef NDEBUG -static int cellSize(MemPage *pPage, int iCell){ - CellInfo info; - parseCell(pPage, iCell, &info); - return info.nSize; -} -#endif -static int cellSizePtr(MemPage *pPage, u8 *pCell){ - CellInfo info; - parseCellPtr(pPage, pCell, &info); - return info.nSize; -} - -#ifndef SQLITE_OMIT_AUTOVACUUM -/* -** If the cell pCell, part of page pPage contains a pointer -** to an overflow page, insert an entry into the pointer-map -** for the overflow page. -*/ -static int ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell){ - if( pCell ){ - CellInfo info; - parseCellPtr(pPage, pCell, &info); - if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){ - Pgno ovfl = get4byte(&pCell[info.iOverflow]); - return ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno); - } - } - return SQLITE_OK; -} -/* -** If the cell with index iCell on page pPage contains a pointer -** to an overflow page, insert an entry into the pointer-map -** for the overflow page. -*/ -static int ptrmapPutOvfl(MemPage *pPage, int iCell){ - u8 *pCell; - pCell = findOverflowCell(pPage, iCell); - return ptrmapPutOvflPtr(pPage, pCell); -} -#endif - - -/* -** Do sanity checking on a page. Throw an exception if anything is -** not right. -** -** This routine is used for internal error checking only. It is omitted -** from most builds. -*/ -#if defined(BTREE_DEBUG) && !defined(NDEBUG) && 0 -static void _pageIntegrity(MemPage *pPage){ - int usableSize; - u8 *data; - int i, j, idx, c, pc, hdr, nFree; - int cellOffset; - int nCell, cellLimit; - u8 *used; - - used = sqliteMallocRaw( pPage->pBt->pageSize ); - if( used==0 ) return; - usableSize = pPage->pBt->usableSize; - assert( pPage->aData==&((unsigned char*)pPage)[-pPage->pBt->pageSize] ); - hdr = pPage->hdrOffset; - assert( hdr==(pPage->pgno==1 ? 100 : 0) ); - assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) ); - c = pPage->aData[hdr]; - if( pPage->isInit ){ - assert( pPage->leaf == ((c & PTF_LEAF)!=0) ); - assert( pPage->zeroData == ((c & PTF_ZERODATA)!=0) ); - assert( pPage->leafData == ((c & PTF_LEAFDATA)!=0) ); - assert( pPage->intKey == ((c & (PTF_INTKEY|PTF_LEAFDATA))!=0) ); - assert( pPage->hasData == - !(pPage->zeroData || (!pPage->leaf && pPage->leafData)) ); - assert( pPage->cellOffset==pPage->hdrOffset+12-4*pPage->leaf ); - assert( pPage->nCell = get2byte(&pPage->aData[hdr+3]) ); - } - data = pPage->aData; - memset(used, 0, usableSize); - for(i=0; i<hdr+10-pPage->leaf*4; i++) used[i] = 1; - nFree = 0; - pc = get2byte(&data[hdr+1]); - while( pc ){ - int size; - assert( pc>0 && pc<usableSize-4 ); - size = get2byte(&data[pc+2]); - assert( pc+size<=usableSize ); - nFree += size; - for(i=pc; i<pc+size; i++){ - assert( used[i]==0 ); - used[i] = 1; - } - pc = get2byte(&data[pc]); - } - idx = 0; - nCell = get2byte(&data[hdr+3]); - cellLimit = get2byte(&data[hdr+5]); - assert( pPage->isInit==0 - || pPage->nFree==nFree+data[hdr+7]+cellLimit-(cellOffset+2*nCell) ); - cellOffset = pPage->cellOffset; - for(i=0; i<nCell; i++){ - int size; - pc = get2byte(&data[cellOffset+2*i]); - assert( pc>0 && pc<usableSize-4 ); - size = cellSize(pPage, &data[pc]); - assert( pc+size<=usableSize ); - for(j=pc; j<pc+size; j++){ - assert( used[j]==0 ); - used[j] = 1; - } - } - for(i=cellOffset+2*nCell; i<cellimit; i++){ - assert( used[i]==0 ); - used[i] = 1; - } - nFree = 0; - for(i=0; i<usableSize; i++){ - assert( used[i]<=1 ); - if( used[i]==0 ) nFree++; - } - assert( nFree==data[hdr+7] ); - sqliteFree(used); -} -#define pageIntegrity(X) _pageIntegrity(X) -#else -# define pageIntegrity(X) -#endif - -/* -** Defragment the page given. All Cells are moved to the -** beginning of the page and all free space is collected -** into one big FreeBlk at the end of the page. -*/ -static int defragmentPage(MemPage *pPage){ - int i; /* Loop counter */ - int pc; /* Address of a i-th cell */ - int addr; /* Offset of first byte after cell pointer array */ - int hdr; /* Offset to the page header */ - int size; /* Size of a cell */ - int usableSize; /* Number of usable bytes on a page */ - int cellOffset; /* Offset to the cell pointer array */ - int brk; /* Offset to the cell content area */ - int nCell; /* Number of cells on the page */ - unsigned char *data; /* The page data */ - unsigned char *temp; /* Temp area for cell content */ - - assert( sqlite3pager_iswriteable(pPage->aData) ); - assert( pPage->pBt!=0 ); - assert( pPage->pBt->usableSize <= SQLITE_MAX_PAGE_SIZE ); - assert( pPage->nOverflow==0 ); - temp = sqliteMalloc( pPage->pBt->pageSize ); - if( temp==0 ) return SQLITE_NOMEM; - data = pPage->aData; - hdr = pPage->hdrOffset; - cellOffset = pPage->cellOffset; - nCell = pPage->nCell; - assert( nCell==get2byte(&data[hdr+3]) ); - usableSize = pPage->pBt->usableSize; - brk = get2byte(&data[hdr+5]); - memcpy(&temp[brk], &data[brk], usableSize - brk); - brk = usableSize; - for(i=0; i<nCell; i++){ - u8 *pAddr; /* The i-th cell pointer */ - pAddr = &data[cellOffset + i*2]; - pc = get2byte(pAddr); - assert( pc<pPage->pBt->usableSize ); - size = cellSizePtr(pPage, &temp[pc]); - brk -= size; - memcpy(&data[brk], &temp[pc], size); - put2byte(pAddr, brk); - } - assert( brk>=cellOffset+2*nCell ); - put2byte(&data[hdr+5], brk); - data[hdr+1] = 0; - data[hdr+2] = 0; - data[hdr+7] = 0; - addr = cellOffset+2*nCell; - memset(&data[addr], 0, brk-addr); - sqliteFree(temp); - return SQLITE_OK; -} - -/* -** Allocate nByte bytes of space on a page. -** -** Return the index into pPage->aData[] of the first byte of -** the new allocation. Or return 0 if there is not enough free -** space on the page to satisfy the allocation request. -** -** If the page contains nBytes of free space but does not contain -** nBytes of contiguous free space, then this routine automatically -** calls defragementPage() to consolidate all free space before -** allocating the new chunk. -*/ -static int allocateSpace(MemPage *pPage, int nByte){ - int addr, pc, hdr; - int size; - int nFrag; - int top; - int nCell; - int cellOffset; - unsigned char *data; - - data = pPage->aData; - assert( sqlite3pager_iswriteable(data) ); - assert( pPage->pBt ); - if( nByte<4 ) nByte = 4; - if( pPage->nFree<nByte || pPage->nOverflow>0 ) return 0; - pPage->nFree -= nByte; - hdr = pPage->hdrOffset; - - nFrag = data[hdr+7]; - if( nFrag<60 ){ - /* Search the freelist looking for a slot big enough to satisfy the - ** space request. */ - addr = hdr+1; - while( (pc = get2byte(&data[addr]))>0 ){ - size = get2byte(&data[pc+2]); - if( size>=nByte ){ - if( size<nByte+4 ){ - memcpy(&data[addr], &data[pc], 2); - data[hdr+7] = nFrag + size - nByte; - return pc; - }else{ - put2byte(&data[pc+2], size-nByte); - return pc + size - nByte; - } - } - addr = pc; - } - } - - /* Allocate memory from the gap in between the cell pointer array - ** and the cell content area. - */ - top = get2byte(&data[hdr+5]); - nCell = get2byte(&data[hdr+3]); - cellOffset = pPage->cellOffset; - if( nFrag>=60 || cellOffset + 2*nCell > top - nByte ){ - if( defragmentPage(pPage) ) return 0; - top = get2byte(&data[hdr+5]); - } - top -= nByte; - assert( cellOffset + 2*nCell <= top ); - put2byte(&data[hdr+5], top); - return top; -} - -/* -** Return a section of the pPage->aData to the freelist. -** The first byte of the new free block is pPage->aDisk[start] -** and the size of the block is "size" bytes. -** -** Most of the effort here is involved in coalesing adjacent -** free blocks into a single big free block. -*/ -static void freeSpace(MemPage *pPage, int start, int size){ - int addr, pbegin, hdr; - unsigned char *data = pPage->aData; - - assert( pPage->pBt!=0 ); - assert( sqlite3pager_iswriteable(data) ); - assert( start>=pPage->hdrOffset+6+(pPage->leaf?0:4) ); - assert( (start + size)<=pPage->pBt->usableSize ); - if( size<4 ) size = 4; - - /* Add the space back into the linked list of freeblocks */ - hdr = pPage->hdrOffset; - addr = hdr + 1; - while( (pbegin = get2byte(&data[addr]))<start && pbegin>0 ){ - assert( pbegin<=pPage->pBt->usableSize-4 ); - assert( pbegin>addr ); - addr = pbegin; - } - assert( pbegin<=pPage->pBt->usableSize-4 ); - assert( pbegin>addr || pbegin==0 ); - put2byte(&data[addr], start); - put2byte(&data[start], pbegin); - put2byte(&data[start+2], size); - pPage->nFree += size; - - /* Coalesce adjacent free blocks */ - addr = pPage->hdrOffset + 1; - while( (pbegin = get2byte(&data[addr]))>0 ){ - int pnext, psize; - assert( pbegin>addr ); - assert( pbegin<=pPage->pBt->usableSize-4 ); - pnext = get2byte(&data[pbegin]); - psize = get2byte(&data[pbegin+2]); - if( pbegin + psize + 3 >= pnext && pnext>0 ){ - int frag = pnext - (pbegin+psize); - assert( frag<=data[pPage->hdrOffset+7] ); - data[pPage->hdrOffset+7] -= frag; - put2byte(&data[pbegin], get2byte(&data[pnext])); - put2byte(&data[pbegin+2], pnext+get2byte(&data[pnext+2])-pbegin); - }else{ - addr = pbegin; - } - } - - /* If the cell content area begins with a freeblock, remove it. */ - if( data[hdr+1]==data[hdr+5] && data[hdr+2]==data[hdr+6] ){ - int top; - pbegin = get2byte(&data[hdr+1]); - memcpy(&data[hdr+1], &data[pbegin], 2); - top = get2byte(&data[hdr+5]); - put2byte(&data[hdr+5], top + get2byte(&data[pbegin+2])); - } -} - -/* -** Decode the flags byte (the first byte of the header) for a page -** and initialize fields of the MemPage structure accordingly. -*/ -static void decodeFlags(MemPage *pPage, int flagByte){ - Btree *pBt; /* A copy of pPage->pBt */ - - assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) ); - pPage->intKey = (flagByte & (PTF_INTKEY|PTF_LEAFDATA))!=0; - pPage->zeroData = (flagByte & PTF_ZERODATA)!=0; - pPage->leaf = (flagByte & PTF_LEAF)!=0; - pPage->childPtrSize = 4*(pPage->leaf==0); - pBt = pPage->pBt; - if( flagByte & PTF_LEAFDATA ){ - pPage->leafData = 1; - pPage->maxLocal = pBt->maxLeaf; - pPage->minLocal = pBt->minLeaf; - }else{ - pPage->leafData = 0; - pPage->maxLocal = pBt->maxLocal; - pPage->minLocal = pBt->minLocal; - } - pPage->hasData = !(pPage->zeroData || (!pPage->leaf && pPage->leafData)); -} - -/* -** Initialize the auxiliary information for a disk block. -** -** The pParent parameter must be a pointer to the MemPage which -** is the parent of the page being initialized. The root of a -** BTree has no parent and so for that page, pParent==NULL. -** -** Return SQLITE_OK on success. If we see that the page does -** not contain a well-formed database page, then return -** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not -** guarantee that the page is well-formed. It only shows that -** we failed to detect any corruption. -*/ -static int initPage( - MemPage *pPage, /* The page to be initialized */ - MemPage *pParent /* The parent. Might be NULL */ -){ - int pc; /* Address of a freeblock within pPage->aData[] */ - int hdr; /* Offset to beginning of page header */ - u8 *data; /* Equal to pPage->aData */ - Btree *pBt; /* The main btree structure */ - int usableSize; /* Amount of usable space on each page */ - int cellOffset; /* Offset from start of page to first cell pointer */ - int nFree; /* Number of unused bytes on the page */ - int top; /* First byte of the cell content area */ - - pBt = pPage->pBt; - assert( pBt!=0 ); - assert( pParent==0 || pParent->pBt==pBt ); - assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) ); - assert( pPage->aData == &((unsigned char*)pPage)[-pBt->pageSize] ); - if( pPage->pParent!=pParent && (pPage->pParent!=0 || pPage->isInit) ){ - /* The parent page should never change unless the file is corrupt */ - return SQLITE_CORRUPT_BKPT; - } - if( pPage->isInit ) return SQLITE_OK; - if( pPage->pParent==0 && pParent!=0 ){ - pPage->pParent = pParent; - sqlite3pager_ref(pParent->aData); - } - hdr = pPage->hdrOffset; - data = pPage->aData; - decodeFlags(pPage, data[hdr]); - pPage->nOverflow = 0; - pPage->idxShift = 0; - usableSize = pBt->usableSize; - pPage->cellOffset = cellOffset = hdr + 12 - 4*pPage->leaf; - top = get2byte(&data[hdr+5]); - pPage->nCell = get2byte(&data[hdr+3]); - if( pPage->nCell>MX_CELL(pBt) ){ - /* To many cells for a single page. The page must be corrupt */ - return SQLITE_CORRUPT_BKPT; - } - if( pPage->nCell==0 && pParent!=0 && pParent->pgno!=1 ){ - /* All pages must have at least one cell, except for root pages */ - return SQLITE_CORRUPT_BKPT; - } - - /* Compute the total free space on the page */ - pc = get2byte(&data[hdr+1]); - nFree = data[hdr+7] + top - (cellOffset + 2*pPage->nCell); - while( pc>0 ){ - int next, size; - if( pc>usableSize-4 ){ - /* Free block is off the page */ - return SQLITE_CORRUPT_BKPT; - } - next = get2byte(&data[pc]); - size = get2byte(&data[pc+2]); - if( next>0 && next<=pc+size+3 ){ - /* Free blocks must be in accending order */ - return SQLITE_CORRUPT_BKPT; - } - nFree += size; - pc = next; - } - pPage->nFree = nFree; - if( nFree>=usableSize ){ - /* Free space cannot exceed total page size */ - return SQLITE_CORRUPT_BKPT; - } - - pPage->isInit = 1; - pageIntegrity(pPage); - return SQLITE_OK; -} - -/* -** Set up a raw page so that it looks like a database page holding -** no entries. -*/ -static void zeroPage(MemPage *pPage, int flags){ - unsigned char *data = pPage->aData; - Btree *pBt = pPage->pBt; - int hdr = pPage->hdrOffset; - int first; - - assert( sqlite3pager_pagenumber(data)==pPage->pgno ); - assert( &data[pBt->pageSize] == (unsigned char*)pPage ); - assert( sqlite3pager_iswriteable(data) ); - memset(&data[hdr], 0, pBt->usableSize - hdr); - data[hdr] = flags; - first = hdr + 8 + 4*((flags&PTF_LEAF)==0); - memset(&data[hdr+1], 0, 4); - data[hdr+7] = 0; - put2byte(&data[hdr+5], pBt->usableSize); - pPage->nFree = pBt->usableSize - first; - decodeFlags(pPage, flags); - pPage->hdrOffset = hdr; - pPage->cellOffset = first; - pPage->nOverflow = 0; - pPage->idxShift = 0; - pPage->nCell = 0; - pPage->isInit = 1; - pageIntegrity(pPage); -} - -/* -** Get a page from the pager. Initialize the MemPage.pBt and -** MemPage.aData elements if needed. -*/ -static int getPage(Btree *pBt, Pgno pgno, MemPage **ppPage){ - int rc; - unsigned char *aData; - MemPage *pPage; - rc = sqlite3pager_get(pBt->pPager, pgno, (void**)&aData); - if( rc ) return rc; - pPage = (MemPage*)&aData[pBt->pageSize]; - pPage->aData = aData; - pPage->pBt = pBt; - pPage->pgno = pgno; - pPage->hdrOffset = pPage->pgno==1 ? 100 : 0; - *ppPage = pPage; - return SQLITE_OK; -} - -/* -** Get a page from the pager and initialize it. This routine -** is just a convenience wrapper around separate calls to -** getPage() and initPage(). -*/ -static int getAndInitPage( - Btree *pBt, /* The database file */ - Pgno pgno, /* Number of the page to get */ - MemPage **ppPage, /* Write the page pointer here */ - MemPage *pParent /* Parent of the page */ -){ - int rc; - if( pgno==0 ){ - return SQLITE_CORRUPT_BKPT; - } - rc = getPage(pBt, pgno, ppPage); - if( rc==SQLITE_OK && (*ppPage)->isInit==0 ){ - rc = initPage(*ppPage, pParent); - } - return rc; -} - -/* -** Release a MemPage. This should be called once for each prior -** call to getPage. -*/ -static void releasePage(MemPage *pPage){ - if( pPage ){ - assert( pPage->aData ); - assert( pPage->pBt ); - assert( &pPage->aData[pPage->pBt->pageSize]==(unsigned char*)pPage ); - sqlite3pager_unref(pPage->aData); - } -} - -/* -** This routine is called when the reference count for a page -** reaches zero. We need to unref the pParent pointer when that -** happens. -*/ -static void pageDestructor(void *pData, int pageSize){ - MemPage *pPage; - assert( (pageSize & 7)==0 ); - pPage = (MemPage*)&((char*)pData)[pageSize]; - if( pPage->pParent ){ - MemPage *pParent = pPage->pParent; - pPage->pParent = 0; - releasePage(pParent); - } - pPage->isInit = 0; -} - -/* -** During a rollback, when the pager reloads information into the cache -** so that the cache is restored to its original state at the start of -** the transaction, for each page restored this routine is called. -** -** This routine needs to reset the extra data section at the end of the -** page to agree with the restored data. -*/ -static void pageReinit(void *pData, int pageSize){ - MemPage *pPage; - assert( (pageSize & 7)==0 ); - pPage = (MemPage*)&((char*)pData)[pageSize]; - if( pPage->isInit ){ - pPage->isInit = 0; - initPage(pPage, pPage->pParent); - } -} - -/* -** Open a database file. -** -** zFilename is the name of the database file. If zFilename is NULL -** a new database with a random name is created. This randomly named -** database file will be deleted when sqlite3BtreeClose() is called. -*/ -int sqlite3BtreeOpen( - const char *zFilename, /* Name of the file containing the BTree database */ - Btree **ppBtree, /* Pointer to new Btree object written here */ - int flags /* Options */ -){ - Btree *pBt; - int rc; - int nReserve; - unsigned char zDbHeader[100]; - - /* - ** The following asserts make sure that structures used by the btree are - ** the right size. This is to guard against size changes that result - ** when compiling on a different architecture. - */ - assert( sizeof(i64)==8 ); - assert( sizeof(u64)==8 ); - assert( sizeof(u32)==4 ); - assert( sizeof(u16)==2 ); - assert( sizeof(Pgno)==4 ); - - pBt = sqliteMalloc( sizeof(*pBt) ); - if( pBt==0 ){ - *ppBtree = 0; - return SQLITE_NOMEM; - } - rc = sqlite3pager_open(&pBt->pPager, zFilename, EXTRA_SIZE, flags); - if( rc!=SQLITE_OK ){ - if( pBt->pPager ) sqlite3pager_close(pBt->pPager); - sqliteFree(pBt); - *ppBtree = 0; - return rc; - } - sqlite3pager_set_destructor(pBt->pPager, pageDestructor); - sqlite3pager_set_reiniter(pBt->pPager, pageReinit); - pBt->pCursor = 0; - pBt->pPage1 = 0; - pBt->readOnly = sqlite3pager_isreadonly(pBt->pPager); - sqlite3pager_read_fileheader(pBt->pPager, sizeof(zDbHeader), zDbHeader); - pBt->pageSize = get2byte(&zDbHeader[16]); - if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE - || ((pBt->pageSize-1)&pBt->pageSize)!=0 ){ - pBt->pageSize = SQLITE_DEFAULT_PAGE_SIZE; - pBt->maxEmbedFrac = 64; /* 25% */ - pBt->minEmbedFrac = 32; /* 12.5% */ - pBt->minLeafFrac = 32; /* 12.5% */ -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If the magic name ":memory:" will create an in-memory database, then - ** do not set the auto-vacuum flag, even if SQLITE_DEFAULT_AUTOVACUUM - ** is true. On the other hand, if SQLITE_OMIT_MEMORYDB has been defined, - ** then ":memory:" is just a regular file-name. Respect the auto-vacuum - ** default in this case. - */ -#ifndef SQLITE_OMIT_MEMORYDB - if( zFilename && strcmp(zFilename,":memory:") ){ -#else - if( zFilename ){ -#endif - pBt->autoVacuum = SQLITE_DEFAULT_AUTOVACUUM; - } -#endif - nReserve = 0; - }else{ - nReserve = zDbHeader[20]; - pBt->maxEmbedFrac = zDbHeader[21]; - pBt->minEmbedFrac = zDbHeader[22]; - pBt->minLeafFrac = zDbHeader[23]; - pBt->pageSizeFixed = 1; -#ifndef SQLITE_OMIT_AUTOVACUUM - pBt->autoVacuum = (get4byte(&zDbHeader[36 + 4*4])?1:0); -#endif - } - pBt->usableSize = pBt->pageSize - nReserve; - assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */ - sqlite3pager_set_pagesize(pBt->pPager, pBt->pageSize); - *ppBtree = pBt; - return SQLITE_OK; -} - -/* -** Close an open database and invalidate all cursors. -*/ -int sqlite3BtreeClose(Btree *pBt){ - while( pBt->pCursor ){ - sqlite3BtreeCloseCursor(pBt->pCursor); - } - sqlite3pager_close(pBt->pPager); - sqliteFree(pBt); - return SQLITE_OK; -} - -/* -** Change the busy handler callback function. -*/ -int sqlite3BtreeSetBusyHandler(Btree *pBt, BusyHandler *pHandler){ - pBt->pBusyHandler = pHandler; - sqlite3pager_set_busyhandler(pBt->pPager, pHandler); - return SQLITE_OK; -} - -/* -** Change the limit on the number of pages allowed in the cache. -** -** The maximum number of cache pages is set to the absolute -** value of mxPage. If mxPage is negative, the pager will -** operate asynchronously - it will not stop to do fsync()s -** to insure data is written to the disk surface before -** continuing. Transactions still work if synchronous is off, -** and the database cannot be corrupted if this program -** crashes. But if the operating system crashes or there is -** an abrupt power failure when synchronous is off, the database -** could be left in an inconsistent and unrecoverable state. -** Synchronous is on by default so database corruption is not -** normally a worry. -*/ -int sqlite3BtreeSetCacheSize(Btree *pBt, int mxPage){ - sqlite3pager_set_cachesize(pBt->pPager, mxPage); - return SQLITE_OK; -} - -/* -** Change the way data is synced to disk in order to increase or decrease -** how well the database resists damage due to OS crashes and power -** failures. Level 1 is the same as asynchronous (no syncs() occur and -** there is a high probability of damage) Level 2 is the default. There -** is a very low but non-zero probability of damage. Level 3 reduces the -** probability of damage to near zero but with a write performance reduction. -*/ -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -int sqlite3BtreeSetSafetyLevel(Btree *pBt, int level){ - sqlite3pager_set_safety_level(pBt->pPager, level); - return SQLITE_OK; -} -#endif - -/* -** Return TRUE if the given btree is set to safety level 1. In other -** words, return TRUE if no sync() occurs on the disk files. -*/ -int sqlite3BtreeSyncDisabled(Btree *pBt){ - assert( pBt && pBt->pPager ); - return sqlite3pager_nosync(pBt->pPager); -} - -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) -/* -** Change the default pages size and the number of reserved bytes per page. -** -** The page size must be a power of 2 between 512 and 65536. If the page -** size supplied does not meet this constraint then the page size is not -** changed. -** -** Page sizes are constrained to be a power of two so that the region -** of the database file used for locking (beginning at PENDING_BYTE, -** the first byte past the 1GB boundary, 0x40000000) needs to occur -** at the beginning of a page. -** -** If parameter nReserve is less than zero, then the number of reserved -** bytes per page is left unchanged. -*/ -int sqlite3BtreeSetPageSize(Btree *pBt, int pageSize, int nReserve){ - if( pBt->pageSizeFixed ){ - return SQLITE_READONLY; - } - if( nReserve<0 ){ - nReserve = pBt->pageSize - pBt->usableSize; - } - if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && - ((pageSize-1)&pageSize)==0 ){ - assert( (pageSize & 7)==0 ); - pBt->pageSize = sqlite3pager_set_pagesize(pBt->pPager, pageSize); - } - pBt->usableSize = pBt->pageSize - nReserve; - return SQLITE_OK; -} - -/* -** Return the currently defined page size -*/ -int sqlite3BtreeGetPageSize(Btree *pBt){ - return pBt->pageSize; -} -int sqlite3BtreeGetReserve(Btree *pBt){ - return pBt->pageSize - pBt->usableSize; -} -#endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */ - -/* -** Change the 'auto-vacuum' property of the database. If the 'autoVacuum' -** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it -** is disabled. The default value for the auto-vacuum property is -** determined by the SQLITE_DEFAULT_AUTOVACUUM macro. -*/ -int sqlite3BtreeSetAutoVacuum(Btree *pBt, int autoVacuum){ -#ifdef SQLITE_OMIT_AUTOVACUUM - return SQLITE_READONLY; -#else - if( pBt->pageSizeFixed ){ - return SQLITE_READONLY; - } - pBt->autoVacuum = (autoVacuum?1:0); - return SQLITE_OK; -#endif -} - -/* -** Return the value of the 'auto-vacuum' property. If auto-vacuum is -** enabled 1 is returned. Otherwise 0. -*/ -int sqlite3BtreeGetAutoVacuum(Btree *pBt){ -#ifdef SQLITE_OMIT_AUTOVACUUM - return 0; -#else - return pBt->autoVacuum; -#endif -} - - -/* -** Get a reference to pPage1 of the database file. This will -** also acquire a readlock on that file. -** -** SQLITE_OK is returned on success. If the file is not a -** well-formed database file, then SQLITE_CORRUPT is returned. -** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM -** is returned if we run out of memory. SQLITE_PROTOCOL is returned -** if there is a locking protocol violation. -*/ -static int lockBtree(Btree *pBt){ - int rc, pageSize; - MemPage *pPage1; - if( pBt->pPage1 ) return SQLITE_OK; - rc = getPage(pBt, 1, &pPage1); - if( rc!=SQLITE_OK ) return rc; - - - /* Do some checking to help insure the file we opened really is - ** a valid database file. - */ - rc = SQLITE_NOTADB; - if( sqlite3pager_pagecount(pBt->pPager)>0 ){ - u8 *page1 = pPage1->aData; - if( memcmp(page1, zMagicHeader, 16)!=0 ){ - goto page1_init_failed; - } - if( page1[18]>1 || page1[19]>1 ){ - goto page1_init_failed; - } - pageSize = get2byte(&page1[16]); - if( ((pageSize-1)&pageSize)!=0 ){ - goto page1_init_failed; - } - assert( (pageSize & 7)==0 ); - pBt->pageSize = pageSize; - pBt->usableSize = pageSize - page1[20]; - if( pBt->usableSize<500 ){ - goto page1_init_failed; - } - pBt->maxEmbedFrac = page1[21]; - pBt->minEmbedFrac = page1[22]; - pBt->minLeafFrac = page1[23]; -#ifndef SQLITE_OMIT_AUTOVACUUM - pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0); -#endif - } - - /* maxLocal is the maximum amount of payload to store locally for - ** a cell. Make sure it is small enough so that at least minFanout - ** cells can will fit on one page. We assume a 10-byte page header. - ** Besides the payload, the cell must store: - ** 2-byte pointer to the cell - ** 4-byte child pointer - ** 9-byte nKey value - ** 4-byte nData value - ** 4-byte overflow page pointer - ** So a cell consists of a 2-byte poiner, a header which is as much as - ** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow - ** page pointer. - */ - pBt->maxLocal = (pBt->usableSize-12)*pBt->maxEmbedFrac/255 - 23; - pBt->minLocal = (pBt->usableSize-12)*pBt->minEmbedFrac/255 - 23; - pBt->maxLeaf = pBt->usableSize - 35; - pBt->minLeaf = (pBt->usableSize-12)*pBt->minLeafFrac/255 - 23; - if( pBt->minLocal>pBt->maxLocal || pBt->maxLocal<0 ){ - goto page1_init_failed; - } - assert( pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt) ); - pBt->pPage1 = pPage1; - return SQLITE_OK; - -page1_init_failed: - releasePage(pPage1); - pBt->pPage1 = 0; - return rc; -} - -/* -** This routine works like lockBtree() except that it also invokes the -** busy callback if there is lock contention. -*/ -static int lockBtreeWithRetry(Btree *pBt){ - int rc = SQLITE_OK; - if( pBt->inTrans==TRANS_NONE ){ - rc = sqlite3BtreeBeginTrans(pBt, 0); - pBt->inTrans = TRANS_NONE; - } - return rc; -} - - -/* -** If there are no outstanding cursors and we are not in the middle -** of a transaction but there is a read lock on the database, then -** this routine unrefs the first page of the database file which -** has the effect of releasing the read lock. -** -** If there are any outstanding cursors, this routine is a no-op. -** -** If there is a transaction in progress, this routine is a no-op. -*/ -static void unlockBtreeIfUnused(Btree *pBt){ - if( pBt->inTrans==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){ - if( pBt->pPage1->aData==0 ){ - MemPage *pPage = pBt->pPage1; - pPage->aData = &((char*)pPage)[-pBt->pageSize]; - pPage->pBt = pBt; - pPage->pgno = 1; - } - releasePage(pBt->pPage1); - pBt->pPage1 = 0; - pBt->inStmt = 0; - } -} - -/* -** Create a new database by initializing the first page of the -** file. -*/ -static int newDatabase(Btree *pBt){ - MemPage *pP1; - unsigned char *data; - int rc; - if( sqlite3pager_pagecount(pBt->pPager)>0 ) return SQLITE_OK; - pP1 = pBt->pPage1; - assert( pP1!=0 ); - data = pP1->aData; - rc = sqlite3pager_write(data); - if( rc ) return rc; - memcpy(data, zMagicHeader, sizeof(zMagicHeader)); - assert( sizeof(zMagicHeader)==16 ); - put2byte(&data[16], pBt->pageSize); - data[18] = 1; - data[19] = 1; - data[20] = pBt->pageSize - pBt->usableSize; - data[21] = pBt->maxEmbedFrac; - data[22] = pBt->minEmbedFrac; - data[23] = pBt->minLeafFrac; - memset(&data[24], 0, 100-24); - zeroPage(pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA ); - pBt->pageSizeFixed = 1; -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - put4byte(&data[36 + 4*4], 1); - } -#endif - return SQLITE_OK; -} - -/* -** Attempt to start a new transaction. A write-transaction -** is started if the second argument is nonzero, otherwise a read- -** transaction. If the second argument is 2 or more and exclusive -** transaction is started, meaning that no other process is allowed -** to access the database. A preexisting transaction may not be -** upgraded to exclusive by calling this routine a second time - the -** exclusivity flag only works for a new transaction. -** -** A write-transaction must be started before attempting any -** changes to the database. None of the following routines -** will work unless a transaction is started first: -** -** sqlite3BtreeCreateTable() -** sqlite3BtreeCreateIndex() -** sqlite3BtreeClearTable() -** sqlite3BtreeDropTable() -** sqlite3BtreeInsert() -** sqlite3BtreeDelete() -** sqlite3BtreeUpdateMeta() -** -** If an initial attempt to acquire the lock fails because of lock contention -** and the database was previously unlocked, then invoke the busy handler -** if there is one. But if there was previously a read-lock, do not -** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is -** returned when there is already a read-lock in order to avoid a deadlock. -** -** Suppose there are two processes A and B. A has a read lock and B has -** a reserved lock. B tries to promote to exclusive but is blocked because -** of A's read lock. A tries to promote to reserved but is blocked by B. -** One or the other of the two processes must give way or there can be -** no progress. By returning SQLITE_BUSY and not invoking the busy callback -** when A already has a read lock, we encourage A to give up and let B -** proceed. -*/ -int sqlite3BtreeBeginTrans(Btree *pBt, int wrflag){ - int rc = SQLITE_OK; - - /* If the btree is already in a write-transaction, or it - ** is already in a read-transaction and a read-transaction - ** is requested, this is a no-op. - */ - if( pBt->inTrans==TRANS_WRITE || (pBt->inTrans==TRANS_READ && !wrflag) ){ - return SQLITE_OK; - } - - /* Write transactions are not possible on a read-only database */ - if( pBt->readOnly && wrflag ){ - return SQLITE_READONLY; - } - - do { - if( pBt->pPage1==0 ){ - rc = lockBtree(pBt); - } - - if( rc==SQLITE_OK && wrflag ){ - rc = sqlite3pager_begin(pBt->pPage1->aData, wrflag>1); - if( rc==SQLITE_OK ){ - rc = newDatabase(pBt); - } - } - - if( rc==SQLITE_OK ){ - pBt->inTrans = (wrflag?TRANS_WRITE:TRANS_READ); - if( wrflag ) pBt->inStmt = 0; - }else{ - unlockBtreeIfUnused(pBt); - } - }while( rc==SQLITE_BUSY && pBt->inTrans==TRANS_NONE && - sqlite3InvokeBusyHandler(pBt->pBusyHandler) ); - return rc; -} - -#ifndef SQLITE_OMIT_AUTOVACUUM - -/* -** Set the pointer-map entries for all children of page pPage. Also, if -** pPage contains cells that point to overflow pages, set the pointer -** map entries for the overflow pages as well. -*/ -static int setChildPtrmaps(MemPage *pPage){ - int i; /* Counter variable */ - int nCell; /* Number of cells in page pPage */ - int rc = SQLITE_OK; /* Return code */ - Btree *pBt = pPage->pBt; - int isInitOrig = pPage->isInit; - Pgno pgno = pPage->pgno; - - initPage(pPage, 0); - nCell = pPage->nCell; - - for(i=0; i<nCell; i++){ - u8 *pCell = findCell(pPage, i); - - rc = ptrmapPutOvflPtr(pPage, pCell); - if( rc!=SQLITE_OK ){ - goto set_child_ptrmaps_out; - } - - if( !pPage->leaf ){ - Pgno childPgno = get4byte(pCell); - rc = ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno); - if( rc!=SQLITE_OK ) goto set_child_ptrmaps_out; - } - } - - if( !pPage->leaf ){ - Pgno childPgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); - rc = ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno); - } - -set_child_ptrmaps_out: - pPage->isInit = isInitOrig; - return rc; -} - -/* -** Somewhere on pPage, which is guarenteed to be a btree page, not an overflow -** page, is a pointer to page iFrom. Modify this pointer so that it points to -** iTo. Parameter eType describes the type of pointer to be modified, as -** follows: -** -** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child -** page of pPage. -** -** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow -** page pointed to by one of the cells on pPage. -** -** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next -** overflow page in the list. -*/ -static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ - if( eType==PTRMAP_OVERFLOW2 ){ - /* The pointer is always the first 4 bytes of the page in this case. */ - if( get4byte(pPage->aData)!=iFrom ){ - return SQLITE_CORRUPT_BKPT; - } - put4byte(pPage->aData, iTo); - }else{ - int isInitOrig = pPage->isInit; - int i; - int nCell; - - initPage(pPage, 0); - nCell = pPage->nCell; - - for(i=0; i<nCell; i++){ - u8 *pCell = findCell(pPage, i); - if( eType==PTRMAP_OVERFLOW1 ){ - CellInfo info; - parseCellPtr(pPage, pCell, &info); - if( info.iOverflow ){ - if( iFrom==get4byte(&pCell[info.iOverflow]) ){ - put4byte(&pCell[info.iOverflow], iTo); - break; - } - } - }else{ - if( get4byte(pCell)==iFrom ){ - put4byte(pCell, iTo); - break; - } - } - } - - if( i==nCell ){ - if( eType!=PTRMAP_BTREE || - get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){ - return SQLITE_CORRUPT_BKPT; - } - put4byte(&pPage->aData[pPage->hdrOffset+8], iTo); - } - - pPage->isInit = isInitOrig; - } - return SQLITE_OK; -} - - -/* -** Move the open database page pDbPage to location iFreePage in the -** database. The pDbPage reference remains valid. -*/ -static int relocatePage( - Btree *pBt, /* Btree */ - MemPage *pDbPage, /* Open page to move */ - u8 eType, /* Pointer map 'type' entry for pDbPage */ - Pgno iPtrPage, /* Pointer map 'page-no' entry for pDbPage */ - Pgno iFreePage /* The location to move pDbPage to */ -){ - MemPage *pPtrPage; /* The page that contains a pointer to pDbPage */ - Pgno iDbPage = pDbPage->pgno; - Pager *pPager = pBt->pPager; - int rc; - - assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || - eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ); - - /* Move page iDbPage from it's current location to page number iFreePage */ - TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n", - iDbPage, iFreePage, iPtrPage, eType)); - rc = sqlite3pager_movepage(pPager, pDbPage->aData, iFreePage); - if( rc!=SQLITE_OK ){ - return rc; - } - pDbPage->pgno = iFreePage; - - /* If pDbPage was a btree-page, then it may have child pages and/or cells - ** that point to overflow pages. The pointer map entries for all these - ** pages need to be changed. - ** - ** If pDbPage is an overflow page, then the first 4 bytes may store a - ** pointer to a subsequent overflow page. If this is the case, then - ** the pointer map needs to be updated for the subsequent overflow page. - */ - if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){ - rc = setChildPtrmaps(pDbPage); - if( rc!=SQLITE_OK ){ - return rc; - } - }else{ - Pgno nextOvfl = get4byte(pDbPage->aData); - if( nextOvfl!=0 ){ - rc = ptrmapPut(pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage); - if( rc!=SQLITE_OK ){ - return rc; - } - } - } - - /* Fix the database pointer on page iPtrPage that pointed at iDbPage so - ** that it points at iFreePage. Also fix the pointer map entry for - ** iPtrPage. - */ - if( eType!=PTRMAP_ROOTPAGE ){ - rc = getPage(pBt, iPtrPage, &pPtrPage); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = sqlite3pager_write(pPtrPage->aData); - if( rc!=SQLITE_OK ){ - releasePage(pPtrPage); - return rc; - } - rc = modifyPagePointer(pPtrPage, iDbPage, iFreePage, eType); - releasePage(pPtrPage); - if( rc==SQLITE_OK ){ - rc = ptrmapPut(pBt, iFreePage, eType, iPtrPage); - } - } - return rc; -} - -/* Forward declaration required by autoVacuumCommit(). */ -static int allocatePage(Btree *, MemPage **, Pgno *, Pgno, u8); - -/* -** This routine is called prior to sqlite3pager_commit when a transaction -** is commited for an auto-vacuum database. -*/ -static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){ - Pager *pPager = pBt->pPager; - Pgno nFreeList; /* Number of pages remaining on the free-list. */ - int nPtrMap; /* Number of pointer-map pages deallocated */ - Pgno origSize; /* Pages in the database file */ - Pgno finSize; /* Pages in the database file after truncation */ - int rc; /* Return code */ - u8 eType; - int pgsz = pBt->pageSize; /* Page size for this database */ - Pgno iDbPage; /* The database page to move */ - MemPage *pDbMemPage = 0; /* "" */ - Pgno iPtrPage; /* The page that contains a pointer to iDbPage */ - Pgno iFreePage; /* The free-list page to move iDbPage to */ - MemPage *pFreeMemPage = 0; /* "" */ - -#ifndef NDEBUG - int nRef = *sqlite3pager_stats(pPager); -#endif - - assert( pBt->autoVacuum ); - if( PTRMAP_ISPAGE(pgsz, sqlite3pager_pagecount(pPager)) ){ - return SQLITE_CORRUPT_BKPT; - } - - /* Figure out how many free-pages are in the database. If there are no - ** free pages, then auto-vacuum is a no-op. - */ - nFreeList = get4byte(&pBt->pPage1->aData[36]); - if( nFreeList==0 ){ - *nTrunc = 0; - return SQLITE_OK; - } - - origSize = sqlite3pager_pagecount(pPager); - nPtrMap = (nFreeList-origSize+PTRMAP_PAGENO(pgsz, origSize)+pgsz/5)/(pgsz/5); - finSize = origSize - nFreeList - nPtrMap; - if( origSize>=PENDING_BYTE_PAGE(pBt) && finSize<=PENDING_BYTE_PAGE(pBt) ){ - finSize--; - if( PTRMAP_ISPAGE(pBt->usableSize, finSize) ){ - finSize--; - } - } - TRACE(("AUTOVACUUM: Begin (db size %d->%d)\n", origSize, finSize)); - - /* Variable 'finSize' will be the size of the file in pages after - ** the auto-vacuum has completed (the current file size minus the number - ** of pages on the free list). Loop through the pages that lie beyond - ** this mark, and if they are not already on the free list, move them - ** to a free page earlier in the file (somewhere before finSize). - */ - for( iDbPage=finSize+1; iDbPage<=origSize; iDbPage++ ){ - /* If iDbPage is a pointer map page, or the pending-byte page, skip it. */ - if( PTRMAP_ISPAGE(pgsz, iDbPage) || iDbPage==PENDING_BYTE_PAGE(pBt) ){ - continue; - } - - rc = ptrmapGet(pBt, iDbPage, &eType, &iPtrPage); - if( rc!=SQLITE_OK ) goto autovacuum_out; - if( eType==PTRMAP_ROOTPAGE ){ - rc = SQLITE_CORRUPT_BKPT; - goto autovacuum_out; - } - - /* If iDbPage is free, do not swap it. */ - if( eType==PTRMAP_FREEPAGE ){ - continue; - } - rc = getPage(pBt, iDbPage, &pDbMemPage); - if( rc!=SQLITE_OK ) goto autovacuum_out; - - /* Find the next page in the free-list that is not already at the end - ** of the file. A page can be pulled off the free list using the - ** allocatePage() routine. - */ - do{ - if( pFreeMemPage ){ - releasePage(pFreeMemPage); - pFreeMemPage = 0; - } - rc = allocatePage(pBt, &pFreeMemPage, &iFreePage, 0, 0); - if( rc!=SQLITE_OK ){ - releasePage(pDbMemPage); - goto autovacuum_out; - } - assert( iFreePage<=origSize ); - }while( iFreePage>finSize ); - releasePage(pFreeMemPage); - pFreeMemPage = 0; - - rc = relocatePage(pBt, pDbMemPage, eType, iPtrPage, iFreePage); - releasePage(pDbMemPage); - if( rc!=SQLITE_OK ) goto autovacuum_out; - } - - /* The entire free-list has been swapped to the end of the file. So - ** truncate the database file to finSize pages and consider the - ** free-list empty. - */ - rc = sqlite3pager_write(pBt->pPage1->aData); - if( rc!=SQLITE_OK ) goto autovacuum_out; - put4byte(&pBt->pPage1->aData[32], 0); - put4byte(&pBt->pPage1->aData[36], 0); - if( rc!=SQLITE_OK ) goto autovacuum_out; - *nTrunc = finSize; - -autovacuum_out: - assert( nRef==*sqlite3pager_stats(pPager) ); - if( rc!=SQLITE_OK ){ - sqlite3pager_rollback(pPager); - } - return rc; -} -#endif - -/* -** Commit the transaction currently in progress. -** -** This will release the write lock on the database file. If there -** are no active cursors, it also releases the read lock. -*/ -int sqlite3BtreeCommit(Btree *pBt){ - int rc = SQLITE_OK; - if( pBt->inTrans==TRANS_WRITE ){ - rc = sqlite3pager_commit(pBt->pPager); - } - pBt->inTrans = TRANS_NONE; - pBt->inStmt = 0; - unlockBtreeIfUnused(pBt); - return rc; -} - -#ifndef NDEBUG -/* -** Return the number of write-cursors open on this handle. This is for use -** in assert() expressions, so it is only compiled if NDEBUG is not -** defined. -*/ -static int countWriteCursors(Btree *pBt){ - BtCursor *pCur; - int r = 0; - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->wrFlag ) r++; - } - return r; -} -#endif - -#ifdef SQLITE_TEST -/* -** Print debugging information about all cursors to standard output. -*/ -void sqlite3BtreeCursorList(Btree *pBt){ - BtCursor *pCur; - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - MemPage *pPage = pCur->pPage; - char *zMode = pCur->wrFlag ? "rw" : "ro"; - sqlite3DebugPrintf("CURSOR %p rooted at %4d(%s) currently at %d.%d%s\n", - pCur, pCur->pgnoRoot, zMode, - pPage ? pPage->pgno : 0, pCur->idx, - pCur->isValid ? "" : " eof" - ); - } -} -#endif - -/* -** Rollback the transaction in progress. All cursors will be -** invalided by this operation. Any attempt to use a cursor -** that was open at the beginning of this operation will result -** in an error. -** -** This will release the write lock on the database file. If there -** are no active cursors, it also releases the read lock. -*/ -int sqlite3BtreeRollback(Btree *pBt){ - int rc = SQLITE_OK; - MemPage *pPage1; - if( pBt->inTrans==TRANS_WRITE ){ - rc = sqlite3pager_rollback(pBt->pPager); - /* The rollback may have destroyed the pPage1->aData value. So - ** call getPage() on page 1 again to make sure pPage1->aData is - ** set correctly. */ - if( getPage(pBt, 1, &pPage1)==SQLITE_OK ){ - releasePage(pPage1); - } - assert( countWriteCursors(pBt)==0 ); - } - pBt->inTrans = TRANS_NONE; - pBt->inStmt = 0; - unlockBtreeIfUnused(pBt); - return rc; -} - -/* -** Start a statement subtransaction. The subtransaction can -** can be rolled back independently of the main transaction. -** You must start a transaction before starting a subtransaction. -** The subtransaction is ended automatically if the main transaction -** commits or rolls back. -** -** Only one subtransaction may be active at a time. It is an error to try -** to start a new subtransaction if another subtransaction is already active. -** -** Statement subtransactions are used around individual SQL statements -** that are contained within a BEGIN...COMMIT block. If a constraint -** error occurs within the statement, the effect of that one statement -** can be rolled back without having to rollback the entire transaction. -*/ -int sqlite3BtreeBeginStmt(Btree *pBt){ - int rc; - if( (pBt->inTrans!=TRANS_WRITE) || pBt->inStmt ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - rc = pBt->readOnly ? SQLITE_OK : sqlite3pager_stmt_begin(pBt->pPager); - pBt->inStmt = 1; - return rc; -} - - -/* -** Commit the statment subtransaction currently in progress. If no -** subtransaction is active, this is a no-op. -*/ -int sqlite3BtreeCommitStmt(Btree *pBt){ - int rc; - if( pBt->inStmt && !pBt->readOnly ){ - rc = sqlite3pager_stmt_commit(pBt->pPager); - }else{ - rc = SQLITE_OK; - } - pBt->inStmt = 0; - return rc; -} - -/* -** Rollback the active statement subtransaction. If no subtransaction -** is active this routine is a no-op. -** -** All cursors will be invalidated by this operation. Any attempt -** to use a cursor that was open at the beginning of this operation -** will result in an error. -*/ -int sqlite3BtreeRollbackStmt(Btree *pBt){ - int rc; - if( pBt->inStmt==0 || pBt->readOnly ) return SQLITE_OK; - rc = sqlite3pager_stmt_rollback(pBt->pPager); - assert( countWriteCursors(pBt)==0 ); - pBt->inStmt = 0; - return rc; -} - -/* -** Default key comparison function to be used if no comparison function -** is specified on the sqlite3BtreeCursor() call. -*/ -static int dfltCompare( - void *NotUsed, /* User data is not used */ - int n1, const void *p1, /* First key to compare */ - int n2, const void *p2 /* Second key to compare */ -){ - int c; - c = memcmp(p1, p2, n1<n2 ? n1 : n2); - if( c==0 ){ - c = n1 - n2; - } - return c; -} - -/* -** Create a new cursor for the BTree whose root is on the page -** iTable. The act of acquiring a cursor gets a read lock on -** the database file. -** -** If wrFlag==0, then the cursor can only be used for reading. -** If wrFlag==1, then the cursor can be used for reading or for -** writing if other conditions for writing are also met. These -** are the conditions that must be met in order for writing to -** be allowed: -** -** 1: The cursor must have been opened with wrFlag==1 -** -** 2: No other cursors may be open with wrFlag==0 on the same table -** -** 3: The database must be writable (not on read-only media) -** -** 4: There must be an active transaction. -** -** Condition 2 warrants further discussion. If any cursor is opened -** on a table with wrFlag==0, that prevents all other cursors from -** writing to that table. This is a kind of "read-lock". When a cursor -** is opened with wrFlag==0 it is guaranteed that the table will not -** change as long as the cursor is open. This allows the cursor to -** do a sequential scan of the table without having to worry about -** entries being inserted or deleted during the scan. Cursors should -** be opened with wrFlag==0 only if this read-lock property is needed. -** That is to say, cursors should be opened with wrFlag==0 only if they -** intend to use the sqlite3BtreeNext() system call. All other cursors -** should be opened with wrFlag==1 even if they never really intend -** to write. -** -** No checking is done to make sure that page iTable really is the -** root page of a b-tree. If it is not, then the cursor acquired -** will not work correctly. -** -** The comparison function must be logically the same for every cursor -** on a particular table. Changing the comparison function will result -** in incorrect operations. If the comparison function is NULL, a -** default comparison function is used. The comparison function is -** always ignored for INTKEY tables. -*/ -int sqlite3BtreeCursor( - Btree *pBt, /* The btree */ - int iTable, /* Root page of table to open */ - int wrFlag, /* 1 to write. 0 read-only */ - int (*xCmp)(void*,int,const void*,int,const void*), /* Key Comparison func */ - void *pArg, /* First arg to xCompare() */ - BtCursor **ppCur /* Write new cursor here */ -){ - int rc; - BtCursor *pCur; - - *ppCur = 0; - if( wrFlag ){ - if( pBt->readOnly ){ - return SQLITE_READONLY; - } - if( checkReadLocks(pBt, iTable, 0) ){ - return SQLITE_LOCKED; - } - } - if( pBt->pPage1==0 ){ - rc = lockBtreeWithRetry(pBt); - if( rc!=SQLITE_OK ){ - return rc; - } - } - pCur = sqliteMallocRaw( sizeof(*pCur) ); - if( pCur==0 ){ - rc = SQLITE_NOMEM; - goto create_cursor_exception; - } - pCur->pgnoRoot = (Pgno)iTable; - pCur->pPage = 0; /* For exit-handler, in case getAndInitPage() fails. */ - if( iTable==1 && sqlite3pager_pagecount(pBt->pPager)==0 ){ - rc = SQLITE_EMPTY; - goto create_cursor_exception; - } - rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->pPage, 0); - if( rc!=SQLITE_OK ){ - goto create_cursor_exception; - } - pCur->xCompare = xCmp ? xCmp : dfltCompare; - pCur->pArg = pArg; - pCur->pBt = pBt; - pCur->wrFlag = wrFlag; - pCur->idx = 0; - memset(&pCur->info, 0, sizeof(pCur->info)); - pCur->pNext = pBt->pCursor; - if( pCur->pNext ){ - pCur->pNext->pPrev = pCur; - } - pCur->pPrev = 0; - pBt->pCursor = pCur; - pCur->isValid = 0; - *ppCur = pCur; - return SQLITE_OK; - -create_cursor_exception: - if( pCur ){ - releasePage(pCur->pPage); - sqliteFree(pCur); - } - unlockBtreeIfUnused(pBt); - return rc; -} - -#if 0 /* Not Used */ -/* -** Change the value of the comparison function used by a cursor. -*/ -void sqlite3BtreeSetCompare( - BtCursor *pCur, /* The cursor to whose comparison function is changed */ - int(*xCmp)(void*,int,const void*,int,const void*), /* New comparison func */ - void *pArg /* First argument to xCmp() */ -){ - pCur->xCompare = xCmp ? xCmp : dfltCompare; - pCur->pArg = pArg; -} -#endif - -/* -** Close a cursor. The read lock on the database file is released -** when the last cursor is closed. -*/ -int sqlite3BtreeCloseCursor(BtCursor *pCur){ - Btree *pBt = pCur->pBt; - if( pCur->pPrev ){ - pCur->pPrev->pNext = pCur->pNext; - }else{ - pBt->pCursor = pCur->pNext; - } - if( pCur->pNext ){ - pCur->pNext->pPrev = pCur->pPrev; - } - releasePage(pCur->pPage); - unlockBtreeIfUnused(pBt); - sqliteFree(pCur); - return SQLITE_OK; -} - -/* -** Make a temporary cursor by filling in the fields of pTempCur. -** The temporary cursor is not on the cursor list for the Btree. -*/ -static void getTempCursor(BtCursor *pCur, BtCursor *pTempCur){ - memcpy(pTempCur, pCur, sizeof(*pCur)); - pTempCur->pNext = 0; - pTempCur->pPrev = 0; - if( pTempCur->pPage ){ - sqlite3pager_ref(pTempCur->pPage->aData); - } -} - -/* -** Delete a temporary cursor such as was made by the CreateTemporaryCursor() -** function above. -*/ -static void releaseTempCursor(BtCursor *pCur){ - if( pCur->pPage ){ - sqlite3pager_unref(pCur->pPage->aData); - } -} - -/* -** Make sure the BtCursor.info field of the given cursor is valid. -** If it is not already valid, call parseCell() to fill it in. -** -** BtCursor.info is a cache of the information in the current cell. -** Using this cache reduces the number of calls to parseCell(). -*/ -static void getCellInfo(BtCursor *pCur){ - if( pCur->info.nSize==0 ){ - parseCell(pCur->pPage, pCur->idx, &pCur->info); - }else{ -#ifndef NDEBUG - CellInfo info; - memset(&info, 0, sizeof(info)); - parseCell(pCur->pPage, pCur->idx, &info); - assert( memcmp(&info, &pCur->info, sizeof(info))==0 ); -#endif - } -} - -/* -** Set *pSize to the size of the buffer needed to hold the value of -** the key for the current entry. If the cursor is not pointing -** to a valid entry, *pSize is set to 0. -** -** For a table with the INTKEY flag set, this routine returns the key -** itself, not the number of bytes in the key. -*/ -int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){ - if( !pCur->isValid ){ - *pSize = 0; - }else{ - getCellInfo(pCur); - *pSize = pCur->info.nKey; - } - return SQLITE_OK; -} - -/* -** Set *pSize to the number of bytes of data in the entry the -** cursor currently points to. Always return SQLITE_OK. -** Failure is not possible. If the cursor is not currently -** pointing to an entry (which can happen, for example, if -** the database is empty) then *pSize is set to 0. -*/ -int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){ - if( !pCur->isValid ){ - /* Not pointing at a valid entry - set *pSize to 0. */ - *pSize = 0; - }else{ - getCellInfo(pCur); - *pSize = pCur->info.nData; - } - return SQLITE_OK; -} - -/* -** Read payload information from the entry that the pCur cursor is -** pointing to. Begin reading the payload at "offset" and read -** a total of "amt" bytes. Put the result in zBuf. -** -** This routine does not make a distinction between key and data. -** It just reads bytes from the payload area. Data might appear -** on the main page or be scattered out on multiple overflow pages. -*/ -static int getPayload( - BtCursor *pCur, /* Cursor pointing to entry to read from */ - int offset, /* Begin reading this far into payload */ - int amt, /* Read this many bytes */ - unsigned char *pBuf, /* Write the bytes into this buffer */ - int skipKey /* offset begins at data if this is true */ -){ - unsigned char *aPayload; - Pgno nextPage; - int rc; - MemPage *pPage; - Btree *pBt; - int ovflSize; - u32 nKey; - - assert( pCur!=0 && pCur->pPage!=0 ); - assert( pCur->isValid ); - pBt = pCur->pBt; - pPage = pCur->pPage; - pageIntegrity(pPage); - assert( pCur->idx>=0 && pCur->idx<pPage->nCell ); - getCellInfo(pCur); - aPayload = pCur->info.pCell; - aPayload += pCur->info.nHeader; - if( pPage->intKey ){ - nKey = 0; - }else{ - nKey = pCur->info.nKey; - } - assert( offset>=0 ); - if( skipKey ){ - offset += nKey; - } - if( offset+amt > nKey+pCur->info.nData ){ - return SQLITE_ERROR; - } - if( offset<pCur->info.nLocal ){ - int a = amt; - if( a+offset>pCur->info.nLocal ){ - a = pCur->info.nLocal - offset; - } - memcpy(pBuf, &aPayload[offset], a); - if( a==amt ){ - return SQLITE_OK; - } - offset = 0; - pBuf += a; - amt -= a; - }else{ - offset -= pCur->info.nLocal; - } - ovflSize = pBt->usableSize - 4; - if( amt>0 ){ - nextPage = get4byte(&aPayload[pCur->info.nLocal]); - while( amt>0 && nextPage ){ - rc = sqlite3pager_get(pBt->pPager, nextPage, (void**)&aPayload); - if( rc!=0 ){ - return rc; - } - nextPage = get4byte(aPayload); - if( offset<ovflSize ){ - int a = amt; - if( a + offset > ovflSize ){ - a = ovflSize - offset; - } - memcpy(pBuf, &aPayload[offset+4], a); - offset = 0; - amt -= a; - pBuf += a; - }else{ - offset -= ovflSize; - } - sqlite3pager_unref(aPayload); - } - } - - if( amt>0 ){ - return SQLITE_CORRUPT_BKPT; - } - return SQLITE_OK; -} - -/* -** Read part of the key associated with cursor pCur. Exactly -** "amt" bytes will be transfered into pBuf[]. The transfer -** begins at "offset". -** -** Return SQLITE_OK on success or an error code if anything goes -** wrong. An error is returned if "offset+amt" is larger than -** the available payload. -*/ -int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ - assert( pCur->isValid ); - assert( pCur->pPage!=0 ); - if( pCur->pPage->intKey ){ - return SQLITE_CORRUPT_BKPT; - } - assert( pCur->pPage->intKey==0 ); - assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell ); - return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0); -} - -/* -** Read part of the data associated with cursor pCur. Exactly -** "amt" bytes will be transfered into pBuf[]. The transfer -** begins at "offset". -** -** Return SQLITE_OK on success or an error code if anything goes -** wrong. An error is returned if "offset+amt" is larger than -** the available payload. -*/ -int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ - assert( pCur->isValid ); - assert( pCur->pPage!=0 ); - assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell ); - return getPayload(pCur, offset, amt, pBuf, 1); -} - -/* -** Return a pointer to payload information from the entry that the -** pCur cursor is pointing to. The pointer is to the beginning of -** the key if skipKey==0 and it points to the beginning of data if -** skipKey==1. The number of bytes of available key/data is written -** into *pAmt. If *pAmt==0, then the value returned will not be -** a valid pointer. -** -** This routine is an optimization. It is common for the entire key -** and data to fit on the local page and for there to be no overflow -** pages. When that is so, this routine can be used to access the -** key and data without making a copy. If the key and/or data spills -** onto overflow pages, then getPayload() must be used to reassembly -** the key/data and copy it into a preallocated buffer. -** -** The pointer returned by this routine looks directly into the cached -** page of the database. The data might change or move the next time -** any btree routine is called. -*/ -static const unsigned char *fetchPayload( - BtCursor *pCur, /* Cursor pointing to entry to read from */ - int *pAmt, /* Write the number of available bytes here */ - int skipKey /* read beginning at data if this is true */ -){ - unsigned char *aPayload; - MemPage *pPage; - u32 nKey; - int nLocal; - - assert( pCur!=0 && pCur->pPage!=0 ); - assert( pCur->isValid ); - pPage = pCur->pPage; - pageIntegrity(pPage); - assert( pCur->idx>=0 && pCur->idx<pPage->nCell ); - getCellInfo(pCur); - aPayload = pCur->info.pCell; - aPayload += pCur->info.nHeader; - if( pPage->intKey ){ - nKey = 0; - }else{ - nKey = pCur->info.nKey; - } - if( skipKey ){ - aPayload += nKey; - nLocal = pCur->info.nLocal - nKey; - }else{ - nLocal = pCur->info.nLocal; - if( nLocal>nKey ){ - nLocal = nKey; - } - } - *pAmt = nLocal; - return aPayload; -} - - -/* -** For the entry that cursor pCur is point to, return as -** many bytes of the key or data as are available on the local -** b-tree page. Write the number of available bytes into *pAmt. -** -** The pointer returned is ephemeral. The key/data may move -** or be destroyed on the next call to any Btree routine. -** -** These routines is used to get quick access to key and data -** in the common case where no overflow pages are used. -*/ -const void *sqlite3BtreeKeyFetch(BtCursor *pCur, int *pAmt){ - return (const void*)fetchPayload(pCur, pAmt, 0); -} -const void *sqlite3BtreeDataFetch(BtCursor *pCur, int *pAmt){ - return (const void*)fetchPayload(pCur, pAmt, 1); -} - - -/* -** Move the cursor down to a new child page. The newPgno argument is the -** page number of the child page to move to. -*/ -static int moveToChild(BtCursor *pCur, u32 newPgno){ - int rc; - MemPage *pNewPage; - MemPage *pOldPage; - Btree *pBt = pCur->pBt; - - assert( pCur->isValid ); - rc = getAndInitPage(pBt, newPgno, &pNewPage, pCur->pPage); - if( rc ) return rc; - pageIntegrity(pNewPage); - pNewPage->idxParent = pCur->idx; - pOldPage = pCur->pPage; - pOldPage->idxShift = 0; - releasePage(pOldPage); - pCur->pPage = pNewPage; - pCur->idx = 0; - pCur->info.nSize = 0; - if( pNewPage->nCell<1 ){ - return SQLITE_CORRUPT_BKPT; - } - return SQLITE_OK; -} - -/* -** Return true if the page is the virtual root of its table. -** -** The virtual root page is the root page for most tables. But -** for the table rooted on page 1, sometime the real root page -** is empty except for the right-pointer. In such cases the -** virtual root page is the page that the right-pointer of page -** 1 is pointing to. -*/ -static int isRootPage(MemPage *pPage){ - MemPage *pParent = pPage->pParent; - if( pParent==0 ) return 1; - if( pParent->pgno>1 ) return 0; - if( get2byte(&pParent->aData[pParent->hdrOffset+3])==0 ) return 1; - return 0; -} - -/* -** Move the cursor up to the parent page. -** -** pCur->idx is set to the cell index that contains the pointer -** to the page we are coming from. If we are coming from the -** right-most child page then pCur->idx is set to one more than -** the largest cell index. -*/ -static void moveToParent(BtCursor *pCur){ - MemPage *pParent; - MemPage *pPage; - int idxParent; - - assert( pCur->isValid ); - pPage = pCur->pPage; - assert( pPage!=0 ); - assert( !isRootPage(pPage) ); - pageIntegrity(pPage); - pParent = pPage->pParent; - assert( pParent!=0 ); - pageIntegrity(pParent); - idxParent = pPage->idxParent; - sqlite3pager_ref(pParent->aData); - releasePage(pPage); - pCur->pPage = pParent; - pCur->info.nSize = 0; - assert( pParent->idxShift==0 ); - pCur->idx = idxParent; -} - -/* -** Move the cursor to the root page -*/ -static int moveToRoot(BtCursor *pCur){ - MemPage *pRoot; - int rc; - Btree *pBt = pCur->pBt; - - rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0); - if( rc ){ - pCur->isValid = 0; - return rc; - } - releasePage(pCur->pPage); - pageIntegrity(pRoot); - pCur->pPage = pRoot; - pCur->idx = 0; - pCur->info.nSize = 0; - if( pRoot->nCell==0 && !pRoot->leaf ){ - Pgno subpage; - assert( pRoot->pgno==1 ); - subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]); - assert( subpage>0 ); - pCur->isValid = 1; - rc = moveToChild(pCur, subpage); - } - pCur->isValid = pCur->pPage->nCell>0; - return rc; -} - -/* -** Move the cursor down to the left-most leaf entry beneath the -** entry to which it is currently pointing. -*/ -static int moveToLeftmost(BtCursor *pCur){ - Pgno pgno; - int rc; - MemPage *pPage; - - assert( pCur->isValid ); - while( !(pPage = pCur->pPage)->leaf ){ - assert( pCur->idx>=0 && pCur->idx<pPage->nCell ); - pgno = get4byte(findCell(pPage, pCur->idx)); - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - } - return SQLITE_OK; -} - -/* -** Move the cursor down to the right-most leaf entry beneath the -** page to which it is currently pointing. Notice the difference -** between moveToLeftmost() and moveToRightmost(). moveToLeftmost() -** finds the left-most entry beneath the *entry* whereas moveToRightmost() -** finds the right-most entry beneath the *page*. -*/ -static int moveToRightmost(BtCursor *pCur){ - Pgno pgno; - int rc; - MemPage *pPage; - - assert( pCur->isValid ); - while( !(pPage = pCur->pPage)->leaf ){ - pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); - pCur->idx = pPage->nCell; - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - } - pCur->idx = pPage->nCell - 1; - pCur->info.nSize = 0; - return SQLITE_OK; -} - -/* Move the cursor to the first entry in the table. Return SQLITE_OK -** on success. Set *pRes to 0 if the cursor actually points to something -** or set *pRes to 1 if the table is empty. -*/ -int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){ - int rc; - rc = moveToRoot(pCur); - if( rc ) return rc; - if( pCur->isValid==0 ){ - assert( pCur->pPage->nCell==0 ); - *pRes = 1; - return SQLITE_OK; - } - assert( pCur->pPage->nCell>0 ); - *pRes = 0; - rc = moveToLeftmost(pCur); - return rc; -} - -/* Move the cursor to the last entry in the table. Return SQLITE_OK -** on success. Set *pRes to 0 if the cursor actually points to something -** or set *pRes to 1 if the table is empty. -*/ -int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ - int rc; - rc = moveToRoot(pCur); - if( rc ) return rc; - if( pCur->isValid==0 ){ - assert( pCur->pPage->nCell==0 ); - *pRes = 1; - return SQLITE_OK; - } - assert( pCur->isValid ); - *pRes = 0; - rc = moveToRightmost(pCur); - return rc; -} - -/* Move the cursor so that it points to an entry near pKey/nKey. -** Return a success code. -** -** For INTKEY tables, only the nKey parameter is used. pKey is -** ignored. For other tables, nKey is the number of bytes of data -** in nKey. The comparison function specified when the cursor was -** created is used to compare keys. -** -** If an exact match is not found, then the cursor is always -** left pointing at a leaf page which would hold the entry if it -** were present. The cursor might point to an entry that comes -** before or after the key. -** -** The result of comparing the key with the entry to which the -** cursor is written to *pRes if pRes!=NULL. The meaning of -** this value is as follows: -** -** *pRes<0 The cursor is left pointing at an entry that -** is smaller than pKey or if the table is empty -** and the cursor is therefore left point to nothing. -** -** *pRes==0 The cursor is left pointing at an entry that -** exactly matches pKey. -** -** *pRes>0 The cursor is left pointing at an entry that -** is larger than pKey. -*/ -int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){ - int rc; - rc = moveToRoot(pCur); - if( rc ) return rc; - assert( pCur->pPage ); - assert( pCur->pPage->isInit ); - if( pCur->isValid==0 ){ - *pRes = -1; - assert( pCur->pPage->nCell==0 ); - return SQLITE_OK; - } - for(;;){ - int lwr, upr; - Pgno chldPg; - MemPage *pPage = pCur->pPage; - int c = -1; /* pRes return if table is empty must be -1 */ - lwr = 0; - upr = pPage->nCell-1; - if( !pPage->intKey && pKey==0 ){ - return SQLITE_CORRUPT_BKPT; - } - pageIntegrity(pPage); - while( lwr<=upr ){ - void *pCellKey; - i64 nCellKey; - pCur->idx = (lwr+upr)/2; - pCur->info.nSize = 0; - sqlite3BtreeKeySize(pCur, &nCellKey); - if( pPage->intKey ){ - if( nCellKey<nKey ){ - c = -1; - }else if( nCellKey>nKey ){ - c = +1; - }else{ - c = 0; - } - }else{ - int available; - pCellKey = (void *)fetchPayload(pCur, &available, 0); - if( available>=nCellKey ){ - c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey); - }else{ - pCellKey = sqliteMallocRaw( nCellKey ); - if( pCellKey==0 ) return SQLITE_NOMEM; - rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey); - c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey); - sqliteFree(pCellKey); - if( rc ) return rc; - } - } - if( c==0 ){ - if( pPage->leafData && !pPage->leaf ){ - lwr = pCur->idx; - upr = lwr - 1; - break; - }else{ - if( pRes ) *pRes = 0; - return SQLITE_OK; - } - } - if( c<0 ){ - lwr = pCur->idx+1; - }else{ - upr = pCur->idx-1; - } - } - assert( lwr==upr+1 ); - assert( pPage->isInit ); - if( pPage->leaf ){ - chldPg = 0; - }else if( lwr>=pPage->nCell ){ - chldPg = get4byte(&pPage->aData[pPage->hdrOffset+8]); - }else{ - chldPg = get4byte(findCell(pPage, lwr)); - } - if( chldPg==0 ){ - assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell ); - if( pRes ) *pRes = c; - return SQLITE_OK; - } - pCur->idx = lwr; - pCur->info.nSize = 0; - rc = moveToChild(pCur, chldPg); - if( rc ){ - return rc; - } - } - /* NOT REACHED */ -} - -/* -** Return TRUE if the cursor is not pointing at an entry of the table. -** -** TRUE will be returned after a call to sqlite3BtreeNext() moves -** past the last entry in the table or sqlite3BtreePrev() moves past -** the first entry. TRUE is also returned if the table is empty. -*/ -int sqlite3BtreeEof(BtCursor *pCur){ - return pCur->isValid==0; -} - -/* -** Advance the cursor to the next entry in the database. If -** successful then set *pRes=0. If the cursor -** was already pointing to the last entry in the database before -** this routine was called, then set *pRes=1. -*/ -int sqlite3BtreeNext(BtCursor *pCur, int *pRes){ - int rc; - MemPage *pPage = pCur->pPage; - - assert( pRes!=0 ); - if( pCur->isValid==0 ){ - *pRes = 1; - return SQLITE_OK; - } - assert( pPage->isInit ); - assert( pCur->idx<pPage->nCell ); - - pCur->idx++; - pCur->info.nSize = 0; - if( pCur->idx>=pPage->nCell ){ - if( !pPage->leaf ){ - rc = moveToChild(pCur, get4byte(&pPage->aData[pPage->hdrOffset+8])); - if( rc ) return rc; - rc = moveToLeftmost(pCur); - *pRes = 0; - return rc; - } - do{ - if( isRootPage(pPage) ){ - *pRes = 1; - pCur->isValid = 0; - return SQLITE_OK; - } - moveToParent(pCur); - pPage = pCur->pPage; - }while( pCur->idx>=pPage->nCell ); - *pRes = 0; - if( pPage->leafData ){ - rc = sqlite3BtreeNext(pCur, pRes); - }else{ - rc = SQLITE_OK; - } - return rc; - } - *pRes = 0; - if( pPage->leaf ){ - return SQLITE_OK; - } - rc = moveToLeftmost(pCur); - return rc; -} - -/* -** Step the cursor to the back to the previous entry in the database. If -** successful then set *pRes=0. If the cursor -** was already pointing to the first entry in the database before -** this routine was called, then set *pRes=1. -*/ -int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ - int rc; - Pgno pgno; - MemPage *pPage; - if( pCur->isValid==0 ){ - *pRes = 1; - return SQLITE_OK; - } - - pPage = pCur->pPage; - assert( pPage->isInit ); - assert( pCur->idx>=0 ); - if( !pPage->leaf ){ - pgno = get4byte( findCell(pPage, pCur->idx) ); - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - rc = moveToRightmost(pCur); - }else{ - while( pCur->idx==0 ){ - if( isRootPage(pPage) ){ - pCur->isValid = 0; - *pRes = 1; - return SQLITE_OK; - } - moveToParent(pCur); - pPage = pCur->pPage; - } - pCur->idx--; - pCur->info.nSize = 0; - if( pPage->leafData && !pPage->leaf ){ - rc = sqlite3BtreePrevious(pCur, pRes); - }else{ - rc = SQLITE_OK; - } - } - *pRes = 0; - return rc; -} - -/* -** Allocate a new page from the database file. -** -** The new page is marked as dirty. (In other words, sqlite3pager_write() -** has already been called on the new page.) The new page has also -** been referenced and the calling routine is responsible for calling -** sqlite3pager_unref() on the new page when it is done. -** -** SQLITE_OK is returned on success. Any other return value indicates -** an error. *ppPage and *pPgno are undefined in the event of an error. -** Do not invoke sqlite3pager_unref() on *ppPage if an error is returned. -** -** If the "nearby" parameter is not 0, then a (feeble) effort is made to -** locate a page close to the page number "nearby". This can be used in an -** attempt to keep related pages close to each other in the database file, -** which in turn can make database access faster. -** -** If the "exact" parameter is not 0, and the page-number nearby exists -** anywhere on the free-list, then it is guarenteed to be returned. This -** is only used by auto-vacuum databases when allocating a new table. -*/ -static int allocatePage( - Btree *pBt, - MemPage **ppPage, - Pgno *pPgno, - Pgno nearby, - u8 exact -){ - MemPage *pPage1; - int rc; - int n; /* Number of pages on the freelist */ - int k; /* Number of leaves on the trunk of the freelist */ - - pPage1 = pBt->pPage1; - n = get4byte(&pPage1->aData[36]); - if( n>0 ){ - /* There are pages on the freelist. Reuse one of those pages. */ - MemPage *pTrunk = 0; - Pgno iTrunk; - MemPage *pPrevTrunk = 0; - u8 searchList = 0; /* If the free-list must be searched for 'nearby' */ - - /* If the 'exact' parameter was true and a query of the pointer-map - ** shows that the page 'nearby' is somewhere on the free-list, then - ** the entire-list will be searched for that page. - */ -#ifndef SQLITE_OMIT_AUTOVACUUM - if( exact ){ - u8 eType; - assert( nearby>0 ); - assert( pBt->autoVacuum ); - rc = ptrmapGet(pBt, nearby, &eType, 0); - if( rc ) return rc; - if( eType==PTRMAP_FREEPAGE ){ - searchList = 1; - } - *pPgno = nearby; - } -#endif - - /* Decrement the free-list count by 1. Set iTrunk to the index of the - ** first free-list trunk page. iPrevTrunk is initially 1. - */ - rc = sqlite3pager_write(pPage1->aData); - if( rc ) return rc; - put4byte(&pPage1->aData[36], n-1); - - /* The code within this loop is run only once if the 'searchList' variable - ** is not true. Otherwise, it runs once for each trunk-page on the - ** free-list until the page 'nearby' is located. - */ - do { - pPrevTrunk = pTrunk; - if( pPrevTrunk ){ - iTrunk = get4byte(&pPrevTrunk->aData[0]); - }else{ - iTrunk = get4byte(&pPage1->aData[32]); - } - rc = getPage(pBt, iTrunk, &pTrunk); - if( rc ){ - releasePage(pPrevTrunk); - return rc; - } - - /* TODO: This should move to after the loop? */ - rc = sqlite3pager_write(pTrunk->aData); - if( rc ){ - releasePage(pTrunk); - releasePage(pPrevTrunk); - return rc; - } - - k = get4byte(&pTrunk->aData[4]); - if( k==0 && !searchList ){ - /* The trunk has no leaves and the list is not being searched. - ** So extract the trunk page itself and use it as the newly - ** allocated page */ - assert( pPrevTrunk==0 ); - *pPgno = iTrunk; - memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4); - *ppPage = pTrunk; - pTrunk = 0; - TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1)); - }else if( k>pBt->usableSize/4 - 8 ){ - /* Value of k is out of range. Database corruption */ - return SQLITE_CORRUPT_BKPT; -#ifndef SQLITE_OMIT_AUTOVACUUM - }else if( searchList && nearby==iTrunk ){ - /* The list is being searched and this trunk page is the page - ** to allocate, regardless of whether it has leaves. - */ - assert( *pPgno==iTrunk ); - *ppPage = pTrunk; - searchList = 0; - if( k==0 ){ - if( !pPrevTrunk ){ - memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4); - }else{ - memcpy(&pPrevTrunk->aData[0], &pTrunk->aData[0], 4); - } - }else{ - /* The trunk page is required by the caller but it contains - ** pointers to free-list leaves. The first leaf becomes a trunk - ** page in this case. - */ - MemPage *pNewTrunk; - Pgno iNewTrunk = get4byte(&pTrunk->aData[8]); - rc = getPage(pBt, iNewTrunk, &pNewTrunk); - if( rc!=SQLITE_OK ){ - releasePage(pTrunk); - releasePage(pPrevTrunk); - return rc; - } - rc = sqlite3pager_write(pNewTrunk->aData); - if( rc!=SQLITE_OK ){ - releasePage(pNewTrunk); - releasePage(pTrunk); - releasePage(pPrevTrunk); - return rc; - } - memcpy(&pNewTrunk->aData[0], &pTrunk->aData[0], 4); - put4byte(&pNewTrunk->aData[4], k-1); - memcpy(&pNewTrunk->aData[8], &pTrunk->aData[12], (k-1)*4); - if( !pPrevTrunk ){ - put4byte(&pPage1->aData[32], iNewTrunk); - }else{ - put4byte(&pPrevTrunk->aData[0], iNewTrunk); - } - releasePage(pNewTrunk); - } - pTrunk = 0; - TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1)); -#endif - }else{ - /* Extract a leaf from the trunk */ - int closest; - Pgno iPage; - unsigned char *aData = pTrunk->aData; - if( nearby>0 ){ - int i, dist; - closest = 0; - dist = get4byte(&aData[8]) - nearby; - if( dist<0 ) dist = -dist; - for(i=1; i<k; i++){ - int d2 = get4byte(&aData[8+i*4]) - nearby; - if( d2<0 ) d2 = -d2; - if( d2<dist ){ - closest = i; - dist = d2; - } - } - }else{ - closest = 0; - } - - iPage = get4byte(&aData[8+closest*4]); - if( !searchList || iPage==nearby ){ - *pPgno = iPage; - if( *pPgno>sqlite3pager_pagecount(pBt->pPager) ){ - /* Free page off the end of the file */ - return SQLITE_CORRUPT_BKPT; - } - TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d" - ": %d more free pages\n", - *pPgno, closest+1, k, pTrunk->pgno, n-1)); - if( closest<k-1 ){ - memcpy(&aData[8+closest*4], &aData[4+k*4], 4); - } - put4byte(&aData[4], k-1); - rc = getPage(pBt, *pPgno, ppPage); - if( rc==SQLITE_OK ){ - sqlite3pager_dont_rollback((*ppPage)->aData); - rc = sqlite3pager_write((*ppPage)->aData); - if( rc!=SQLITE_OK ){ - releasePage(*ppPage); - } - } - searchList = 0; - } - } - releasePage(pPrevTrunk); - }while( searchList ); - releasePage(pTrunk); - }else{ - /* There are no pages on the freelist, so create a new page at the - ** end of the file */ - *pPgno = sqlite3pager_pagecount(pBt->pPager) + 1; - -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt->usableSize, *pPgno) ){ - /* If *pPgno refers to a pointer-map page, allocate two new pages - ** at the end of the file instead of one. The first allocated page - ** becomes a new pointer-map page, the second is used by the caller. - */ - TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno)); - assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); - (*pPgno)++; - } -#endif - - assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); - rc = getPage(pBt, *pPgno, ppPage); - if( rc ) return rc; - rc = sqlite3pager_write((*ppPage)->aData); - if( rc!=SQLITE_OK ){ - releasePage(*ppPage); - } - TRACE(("ALLOCATE: %d from end of file\n", *pPgno)); - } - - assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); - return rc; -} - -/* -** Add a page of the database file to the freelist. -** -** sqlite3pager_unref() is NOT called for pPage. -*/ -static int freePage(MemPage *pPage){ - Btree *pBt = pPage->pBt; - MemPage *pPage1 = pBt->pPage1; - int rc, n, k; - - /* Prepare the page for freeing */ - assert( pPage->pgno>1 ); - pPage->isInit = 0; - releasePage(pPage->pParent); - pPage->pParent = 0; - - /* Increment the free page count on pPage1 */ - rc = sqlite3pager_write(pPage1->aData); - if( rc ) return rc; - n = get4byte(&pPage1->aData[36]); - put4byte(&pPage1->aData[36], n+1); - -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If the database supports auto-vacuum, write an entry in the pointer-map - ** to indicate that the page is free. - */ - if( pBt->autoVacuum ){ - rc = ptrmapPut(pBt, pPage->pgno, PTRMAP_FREEPAGE, 0); - if( rc ) return rc; - } -#endif - - if( n==0 ){ - /* This is the first free page */ - rc = sqlite3pager_write(pPage->aData); - if( rc ) return rc; - memset(pPage->aData, 0, 8); - put4byte(&pPage1->aData[32], pPage->pgno); - TRACE(("FREE-PAGE: %d first\n", pPage->pgno)); - }else{ - /* Other free pages already exist. Retrive the first trunk page - ** of the freelist and find out how many leaves it has. */ - MemPage *pTrunk; - rc = getPage(pBt, get4byte(&pPage1->aData[32]), &pTrunk); - if( rc ) return rc; - k = get4byte(&pTrunk->aData[4]); - if( k>=pBt->usableSize/4 - 8 ){ - /* The trunk is full. Turn the page being freed into a new - ** trunk page with no leaves. */ - rc = sqlite3pager_write(pPage->aData); - if( rc ) return rc; - put4byte(pPage->aData, pTrunk->pgno); - put4byte(&pPage->aData[4], 0); - put4byte(&pPage1->aData[32], pPage->pgno); - TRACE(("FREE-PAGE: %d new trunk page replacing %d\n", - pPage->pgno, pTrunk->pgno)); - }else{ - /* Add the newly freed page as a leaf on the current trunk */ - rc = sqlite3pager_write(pTrunk->aData); - if( rc ) return rc; - put4byte(&pTrunk->aData[4], k+1); - put4byte(&pTrunk->aData[8+k*4], pPage->pgno); - sqlite3pager_dont_write(pBt->pPager, pPage->pgno); - TRACE(("FREE-PAGE: %d leaf on trunk page %d\n",pPage->pgno,pTrunk->pgno)); - } - releasePage(pTrunk); - } - return rc; -} - -/* -** Free any overflow pages associated with the given Cell. -*/ -static int clearCell(MemPage *pPage, unsigned char *pCell){ - Btree *pBt = pPage->pBt; - CellInfo info; - Pgno ovflPgno; - int rc; - - parseCellPtr(pPage, pCell, &info); - if( info.iOverflow==0 ){ - return SQLITE_OK; /* No overflow pages. Return without doing anything */ - } - ovflPgno = get4byte(&pCell[info.iOverflow]); - while( ovflPgno!=0 ){ - MemPage *pOvfl; - if( ovflPgno>sqlite3pager_pagecount(pBt->pPager) ){ - return SQLITE_CORRUPT_BKPT; - } - rc = getPage(pBt, ovflPgno, &pOvfl); - if( rc ) return rc; - ovflPgno = get4byte(pOvfl->aData); - rc = freePage(pOvfl); - sqlite3pager_unref(pOvfl->aData); - if( rc ) return rc; - } - return SQLITE_OK; -} - -/* -** Create the byte sequence used to represent a cell on page pPage -** and write that byte sequence into pCell[]. Overflow pages are -** allocated and filled in as necessary. The calling procedure -** is responsible for making sure sufficient space has been allocated -** for pCell[]. -** -** Note that pCell does not necessary need to point to the pPage->aData -** area. pCell might point to some temporary storage. The cell will -** be constructed in this temporary area then copied into pPage->aData -** later. -*/ -static int fillInCell( - MemPage *pPage, /* The page that contains the cell */ - unsigned char *pCell, /* Complete text of the cell */ - const void *pKey, i64 nKey, /* The key */ - const void *pData,int nData, /* The data */ - int *pnSize /* Write cell size here */ -){ - int nPayload; - const u8 *pSrc; - int nSrc, n, rc; - int spaceLeft; - MemPage *pOvfl = 0; - MemPage *pToRelease = 0; - unsigned char *pPrior; - unsigned char *pPayload; - Btree *pBt = pPage->pBt; - Pgno pgnoOvfl = 0; - int nHeader; - CellInfo info; - - /* Fill in the header. */ - nHeader = 0; - if( !pPage->leaf ){ - nHeader += 4; - } - if( pPage->hasData ){ - nHeader += putVarint(&pCell[nHeader], nData); - }else{ - nData = 0; - } - nHeader += putVarint(&pCell[nHeader], *(u64*)&nKey); - parseCellPtr(pPage, pCell, &info); - assert( info.nHeader==nHeader ); - assert( info.nKey==nKey ); - assert( info.nData==nData ); - - /* Fill in the payload */ - nPayload = nData; - if( pPage->intKey ){ - pSrc = pData; - nSrc = nData; - nData = 0; - }else{ - nPayload += nKey; - pSrc = pKey; - nSrc = nKey; - } - *pnSize = info.nSize; - spaceLeft = info.nLocal; - pPayload = &pCell[nHeader]; - pPrior = &pCell[info.iOverflow]; - - while( nPayload>0 ){ - if( spaceLeft==0 ){ -#ifndef SQLITE_OMIT_AUTOVACUUM - Pgno pgnoPtrmap = pgnoOvfl; /* Overflow page pointer-map entry page */ -#endif - rc = allocatePage(pBt, &pOvfl, &pgnoOvfl, pgnoOvfl, 0); -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If the database supports auto-vacuum, and the second or subsequent - ** overflow page is being allocated, add an entry to the pointer-map - ** for that page now. The entry for the first overflow page will be - ** added later, by the insertCell() routine. - */ - if( pBt->autoVacuum && pgnoPtrmap!=0 && rc==SQLITE_OK ){ - rc = ptrmapPut(pBt, pgnoOvfl, PTRMAP_OVERFLOW2, pgnoPtrmap); - } -#endif - if( rc ){ - releasePage(pToRelease); - /* clearCell(pPage, pCell); */ - return rc; - } - put4byte(pPrior, pgnoOvfl); - releasePage(pToRelease); - pToRelease = pOvfl; - pPrior = pOvfl->aData; - put4byte(pPrior, 0); - pPayload = &pOvfl->aData[4]; - spaceLeft = pBt->usableSize - 4; - } - n = nPayload; - if( n>spaceLeft ) n = spaceLeft; - if( n>nSrc ) n = nSrc; - memcpy(pPayload, pSrc, n); - nPayload -= n; - pPayload += n; - pSrc += n; - nSrc -= n; - spaceLeft -= n; - if( nSrc==0 ){ - nSrc = nData; - pSrc = pData; - } - } - releasePage(pToRelease); - return SQLITE_OK; -} - -/* -** Change the MemPage.pParent pointer on the page whose number is -** given in the second argument so that MemPage.pParent holds the -** pointer in the third argument. -*/ -static int reparentPage(Btree *pBt, Pgno pgno, MemPage *pNewParent, int idx){ - MemPage *pThis; - unsigned char *aData; - - if( pgno==0 ) return SQLITE_OK; - assert( pBt->pPager!=0 ); - aData = sqlite3pager_lookup(pBt->pPager, pgno); - if( aData ){ - pThis = (MemPage*)&aData[pBt->pageSize]; - assert( pThis->aData==aData ); - if( pThis->isInit ){ - if( pThis->pParent!=pNewParent ){ - if( pThis->pParent ) sqlite3pager_unref(pThis->pParent->aData); - pThis->pParent = pNewParent; - if( pNewParent ) sqlite3pager_ref(pNewParent->aData); - } - pThis->idxParent = idx; - } - sqlite3pager_unref(aData); - } - -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - return ptrmapPut(pBt, pgno, PTRMAP_BTREE, pNewParent->pgno); - } -#endif - return SQLITE_OK; -} - - - -/* -** Change the pParent pointer of all children of pPage to point back -** to pPage. -** -** In other words, for every child of pPage, invoke reparentPage() -** to make sure that each child knows that pPage is its parent. -** -** This routine gets called after you memcpy() one page into -** another. -*/ -static int reparentChildPages(MemPage *pPage){ - int i; - Btree *pBt = pPage->pBt; - int rc = SQLITE_OK; - - if( pPage->leaf ) return SQLITE_OK; - - for(i=0; i<pPage->nCell; i++){ - u8 *pCell = findCell(pPage, i); - if( !pPage->leaf ){ - rc = reparentPage(pBt, get4byte(pCell), pPage, i); - if( rc!=SQLITE_OK ) return rc; - } - } - if( !pPage->leaf ){ - rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]), - pPage, i); - pPage->idxShift = 0; - } - return rc; -} - -/* -** Remove the i-th cell from pPage. This routine effects pPage only. -** The cell content is not freed or deallocated. It is assumed that -** the cell content has been copied someplace else. This routine just -** removes the reference to the cell from pPage. -** -** "sz" must be the number of bytes in the cell. -*/ -static void dropCell(MemPage *pPage, int idx, int sz){ - int i; /* Loop counter */ - int pc; /* Offset to cell content of cell being deleted */ - u8 *data; /* pPage->aData */ - u8 *ptr; /* Used to move bytes around within data[] */ - - assert( idx>=0 && idx<pPage->nCell ); - assert( sz==cellSize(pPage, idx) ); - assert( sqlite3pager_iswriteable(pPage->aData) ); - data = pPage->aData; - ptr = &data[pPage->cellOffset + 2*idx]; - pc = get2byte(ptr); - assert( pc>10 && pc+sz<=pPage->pBt->usableSize ); - freeSpace(pPage, pc, sz); - for(i=idx+1; i<pPage->nCell; i++, ptr+=2){ - ptr[0] = ptr[2]; - ptr[1] = ptr[3]; - } - pPage->nCell--; - put2byte(&data[pPage->hdrOffset+3], pPage->nCell); - pPage->nFree += 2; - pPage->idxShift = 1; -} - -/* -** Insert a new cell on pPage at cell index "i". pCell points to the -** content of the cell. -** -** If the cell content will fit on the page, then put it there. If it -** will not fit, then make a copy of the cell content into pTemp if -** pTemp is not null. Regardless of pTemp, allocate a new entry -** in pPage->aOvfl[] and make it point to the cell content (either -** in pTemp or the original pCell) and also record its index. -** Allocating a new entry in pPage->aCell[] implies that -** pPage->nOverflow is incremented. -** -** If nSkip is non-zero, then do not copy the first nSkip bytes of the -** cell. The caller will overwrite them after this function returns. If -** nSkip is non-zero, then pCell may not point to an invalid memory location -** (but pCell+nSkip is always valid). -*/ -static int insertCell( - MemPage *pPage, /* Page into which we are copying */ - int i, /* New cell becomes the i-th cell of the page */ - u8 *pCell, /* Content of the new cell */ - int sz, /* Bytes of content in pCell */ - u8 *pTemp, /* Temp storage space for pCell, if needed */ - u8 nSkip /* Do not write the first nSkip bytes of the cell */ -){ - int idx; /* Where to write new cell content in data[] */ - int j; /* Loop counter */ - int top; /* First byte of content for any cell in data[] */ - int end; /* First byte past the last cell pointer in data[] */ - int ins; /* Index in data[] where new cell pointer is inserted */ - int hdr; /* Offset into data[] of the page header */ - int cellOffset; /* Address of first cell pointer in data[] */ - u8 *data; /* The content of the whole page */ - u8 *ptr; /* Used for moving information around in data[] */ - - assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); - assert( sz==cellSizePtr(pPage, pCell) ); - assert( sqlite3pager_iswriteable(pPage->aData) ); - if( pPage->nOverflow || sz+2>pPage->nFree ){ - if( pTemp ){ - memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); - pCell = pTemp; - } - j = pPage->nOverflow++; - assert( j<sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0]) ); - pPage->aOvfl[j].pCell = pCell; - pPage->aOvfl[j].idx = i; - pPage->nFree = 0; - }else{ - data = pPage->aData; - hdr = pPage->hdrOffset; - top = get2byte(&data[hdr+5]); - cellOffset = pPage->cellOffset; - end = cellOffset + 2*pPage->nCell + 2; - ins = cellOffset + 2*i; - if( end > top - sz ){ - int rc = defragmentPage(pPage); - if( rc!=SQLITE_OK ) return rc; - top = get2byte(&data[hdr+5]); - assert( end + sz <= top ); - } - idx = allocateSpace(pPage, sz); - assert( idx>0 ); - assert( end <= get2byte(&data[hdr+5]) ); - pPage->nCell++; - pPage->nFree -= 2; - memcpy(&data[idx+nSkip], pCell+nSkip, sz-nSkip); - for(j=end-2, ptr=&data[j]; j>ins; j-=2, ptr-=2){ - ptr[0] = ptr[-2]; - ptr[1] = ptr[-1]; - } - put2byte(&data[ins], idx); - put2byte(&data[hdr+3], pPage->nCell); - pPage->idxShift = 1; - pageIntegrity(pPage); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pPage->pBt->autoVacuum ){ - /* The cell may contain a pointer to an overflow page. If so, write - ** the entry for the overflow page into the pointer map. - */ - CellInfo info; - parseCellPtr(pPage, pCell, &info); - if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){ - Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]); - int rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno); - if( rc!=SQLITE_OK ) return rc; - } - } -#endif - } - - return SQLITE_OK; -} - -/* -** Add a list of cells to a page. The page should be initially empty. -** The cells are guaranteed to fit on the page. -*/ -static void assemblePage( - MemPage *pPage, /* The page to be assemblied */ - int nCell, /* The number of cells to add to this page */ - u8 **apCell, /* Pointers to cell bodies */ - int *aSize /* Sizes of the cells */ -){ - int i; /* Loop counter */ - int totalSize; /* Total size of all cells */ - int hdr; /* Index of page header */ - int cellptr; /* Address of next cell pointer */ - int cellbody; /* Address of next cell body */ - u8 *data; /* Data for the page */ - - assert( pPage->nOverflow==0 ); - totalSize = 0; - for(i=0; i<nCell; i++){ - totalSize += aSize[i]; - } - assert( totalSize+2*nCell<=pPage->nFree ); - assert( pPage->nCell==0 ); - cellptr = pPage->cellOffset; - data = pPage->aData; - hdr = pPage->hdrOffset; - put2byte(&data[hdr+3], nCell); - if( nCell ){ - cellbody = allocateSpace(pPage, totalSize); - assert( cellbody>0 ); - assert( pPage->nFree >= 2*nCell ); - pPage->nFree -= 2*nCell; - for(i=0; i<nCell; i++){ - put2byte(&data[cellptr], cellbody); - memcpy(&data[cellbody], apCell[i], aSize[i]); - cellptr += 2; - cellbody += aSize[i]; - } - assert( cellbody==pPage->pBt->usableSize ); - } - pPage->nCell = nCell; -} - -/* -** The following parameters determine how many adjacent pages get involved -** in a balancing operation. NN is the number of neighbors on either side -** of the page that participate in the balancing operation. NB is the -** total number of pages that participate, including the target page and -** NN neighbors on either side. -** -** The minimum value of NN is 1 (of course). Increasing NN above 1 -** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance -** in exchange for a larger degradation in INSERT and UPDATE performance. -** The value of NN appears to give the best results overall. -*/ -#define NN 1 /* Number of neighbors on either side of pPage */ -#define NB (NN*2+1) /* Total pages involved in the balance */ - -/* Forward reference */ -static int balance(MemPage*, int); - -#ifndef SQLITE_OMIT_QUICKBALANCE -/* -** This version of balance() handles the common special case where -** a new entry is being inserted on the extreme right-end of the -** tree, in other words, when the new entry will become the largest -** entry in the tree. -** -** Instead of trying balance the 3 right-most leaf pages, just add -** a new page to the right-hand side and put the one new entry in -** that page. This leaves the right side of the tree somewhat -** unbalanced. But odds are that we will be inserting new entries -** at the end soon afterwards so the nearly empty page will quickly -** fill up. On average. -** -** pPage is the leaf page which is the right-most page in the tree. -** pParent is its parent. pPage must have a single overflow entry -** which is also the right-most entry on the page. -*/ -static int balance_quick(MemPage *pPage, MemPage *pParent){ - int rc; - MemPage *pNew; - Pgno pgnoNew; - u8 *pCell; - int szCell; - CellInfo info; - Btree *pBt = pPage->pBt; - int parentIdx = pParent->nCell; /* pParent new divider cell index */ - int parentSize; /* Size of new divider cell */ - u8 parentCell[64]; /* Space for the new divider cell */ - - /* Allocate a new page. Insert the overflow cell from pPage - ** into it. Then remove the overflow cell from pPage. - */ - rc = allocatePage(pBt, &pNew, &pgnoNew, 0, 0); - if( rc!=SQLITE_OK ){ - return rc; - } - pCell = pPage->aOvfl[0].pCell; - szCell = cellSizePtr(pPage, pCell); - zeroPage(pNew, pPage->aData[0]); - assemblePage(pNew, 1, &pCell, &szCell); - pPage->nOverflow = 0; - - /* Set the parent of the newly allocated page to pParent. */ - pNew->pParent = pParent; - sqlite3pager_ref(pParent->aData); - - /* pPage is currently the right-child of pParent. Change this - ** so that the right-child is the new page allocated above and - ** pPage is the next-to-right child. - */ - assert( pPage->nCell>0 ); - parseCellPtr(pPage, findCell(pPage, pPage->nCell-1), &info); - rc = fillInCell(pParent, parentCell, 0, info.nKey, 0, 0, &parentSize); - if( rc!=SQLITE_OK ){ - return rc; - } - assert( parentSize<64 ); - rc = insertCell(pParent, parentIdx, parentCell, parentSize, 0, 4); - if( rc!=SQLITE_OK ){ - return rc; - } - put4byte(findOverflowCell(pParent,parentIdx), pPage->pgno); - put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew); - -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If this is an auto-vacuum database, update the pointer map - ** with entries for the new page, and any pointer from the - ** cell on the page to an overflow page. - */ - if( pBt->autoVacuum ){ - rc = ptrmapPut(pBt, pgnoNew, PTRMAP_BTREE, pParent->pgno); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = ptrmapPutOvfl(pNew, 0); - if( rc!=SQLITE_OK ){ - return rc; - } - } -#endif - - /* Release the reference to the new page and balance the parent page, - ** in case the divider cell inserted caused it to become overfull. - */ - releasePage(pNew); - return balance(pParent, 0); -} -#endif /* SQLITE_OMIT_QUICKBALANCE */ - -/* -** The ISAUTOVACUUM macro is used within balance_nonroot() to determine -** if the database supports auto-vacuum or not. Because it is used -** within an expression that is an argument to another macro -** (sqliteMallocRaw), it is not possible to use conditional compilation. -** So, this macro is defined instead. -*/ -#ifndef SQLITE_OMIT_AUTOVACUUM -#define ISAUTOVACUUM (pBt->autoVacuum) -#else -#define ISAUTOVACUUM 0 -#endif - -/* -** This routine redistributes Cells on pPage and up to NN*2 siblings -** of pPage so that all pages have about the same amount of free space. -** Usually NN siblings on either side of pPage is used in the balancing, -** though more siblings might come from one side if pPage is the first -** or last child of its parent. If pPage has fewer than 2*NN siblings -** (something which can only happen if pPage is the root page or a -** child of root) then all available siblings participate in the balancing. -** -** The number of siblings of pPage might be increased or decreased by one or -** two in an effort to keep pages nearly full but not over full. The root page -** is special and is allowed to be nearly empty. If pPage is -** the root page, then the depth of the tree might be increased -** or decreased by one, as necessary, to keep the root page from being -** overfull or completely empty. -** -** Note that when this routine is called, some of the Cells on pPage -** might not actually be stored in pPage->aData[]. This can happen -** if the page is overfull. Part of the job of this routine is to -** make sure all Cells for pPage once again fit in pPage->aData[]. -** -** In the course of balancing the siblings of pPage, the parent of pPage -** might become overfull or underfull. If that happens, then this routine -** is called recursively on the parent. -** -** If this routine fails for any reason, it might leave the database -** in a corrupted state. So if this routine fails, the database should -** be rolled back. -*/ -static int balance_nonroot(MemPage *pPage){ - MemPage *pParent; /* The parent of pPage */ - Btree *pBt; /* The whole database */ - int nCell = 0; /* Number of cells in apCell[] */ - int nMaxCells = 0; /* Allocated size of apCell, szCell, aFrom. */ - int nOld; /* Number of pages in apOld[] */ - int nNew; /* Number of pages in apNew[] */ - int nDiv; /* Number of cells in apDiv[] */ - int i, j, k; /* Loop counters */ - int idx; /* Index of pPage in pParent->aCell[] */ - int nxDiv; /* Next divider slot in pParent->aCell[] */ - int rc; /* The return code */ - int leafCorrection; /* 4 if pPage is a leaf. 0 if not */ - int leafData; /* True if pPage is a leaf of a LEAFDATA tree */ - int usableSpace; /* Bytes in pPage beyond the header */ - int pageFlags; /* Value of pPage->aData[0] */ - int subtotal; /* Subtotal of bytes in cells on one page */ - int iSpace = 0; /* First unused byte of aSpace[] */ - MemPage *apOld[NB]; /* pPage and up to two siblings */ - Pgno pgnoOld[NB]; /* Page numbers for each page in apOld[] */ - MemPage *apCopy[NB]; /* Private copies of apOld[] pages */ - MemPage *apNew[NB+2]; /* pPage and up to NB siblings after balancing */ - Pgno pgnoNew[NB+2]; /* Page numbers for each page in apNew[] */ - int idxDiv[NB]; /* Indices of divider cells in pParent */ - u8 *apDiv[NB]; /* Divider cells in pParent */ - int cntNew[NB+2]; /* Index in aCell[] of cell after i-th page */ - int szNew[NB+2]; /* Combined size of cells place on i-th page */ - u8 **apCell = 0; /* All cells begin balanced */ - int *szCell; /* Local size of all cells in apCell[] */ - u8 *aCopy[NB]; /* Space for holding data of apCopy[] */ - u8 *aSpace; /* Space to hold copies of dividers cells */ -#ifndef SQLITE_OMIT_AUTOVACUUM - u8 *aFrom = 0; -#endif - - /* - ** Find the parent page. - */ - assert( pPage->isInit ); - assert( sqlite3pager_iswriteable(pPage->aData) ); - pBt = pPage->pBt; - pParent = pPage->pParent; - sqlite3pager_write(pParent->aData); - assert( pParent ); - TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno)); - -#ifndef SQLITE_OMIT_QUICKBALANCE - /* - ** A special case: If a new entry has just been inserted into a - ** table (that is, a btree with integer keys and all data at the leaves) - ** and the new entry is the right-most entry in the tree (it has the - ** largest key) then use the special balance_quick() routine for - ** balancing. balance_quick() is much faster and results in a tighter - ** packing of data in the common case. - */ - if( pPage->leaf && - pPage->intKey && - pPage->leafData && - pPage->nOverflow==1 && - pPage->aOvfl[0].idx==pPage->nCell && - pPage->pParent->pgno!=1 && - get4byte(&pParent->aData[pParent->hdrOffset+8])==pPage->pgno - ){ - /* - ** TODO: Check the siblings to the left of pPage. It may be that - ** they are not full and no new page is required. - */ - return balance_quick(pPage, pParent); - } -#endif - - /* - ** Find the cell in the parent page whose left child points back - ** to pPage. The "idx" variable is the index of that cell. If pPage - ** is the rightmost child of pParent then set idx to pParent->nCell - */ - if( pParent->idxShift ){ - Pgno pgno; - pgno = pPage->pgno; - assert( pgno==sqlite3pager_pagenumber(pPage->aData) ); - for(idx=0; idx<pParent->nCell; idx++){ - if( get4byte(findCell(pParent, idx))==pgno ){ - break; - } - } - assert( idx<pParent->nCell - || get4byte(&pParent->aData[pParent->hdrOffset+8])==pgno ); - }else{ - idx = pPage->idxParent; - } - - /* - ** Initialize variables so that it will be safe to jump - ** directly to balance_cleanup at any moment. - */ - nOld = nNew = 0; - sqlite3pager_ref(pParent->aData); - - /* - ** Find sibling pages to pPage and the cells in pParent that divide - ** the siblings. An attempt is made to find NN siblings on either - ** side of pPage. More siblings are taken from one side, however, if - ** pPage there are fewer than NN siblings on the other side. If pParent - ** has NB or fewer children then all children of pParent are taken. - */ - nxDiv = idx - NN; - if( nxDiv + NB > pParent->nCell ){ - nxDiv = pParent->nCell - NB + 1; - } - if( nxDiv<0 ){ - nxDiv = 0; - } - nDiv = 0; - for(i=0, k=nxDiv; i<NB; i++, k++){ - if( k<pParent->nCell ){ - idxDiv[i] = k; - apDiv[i] = findCell(pParent, k); - nDiv++; - assert( !pParent->leaf ); - pgnoOld[i] = get4byte(apDiv[i]); - }else if( k==pParent->nCell ){ - pgnoOld[i] = get4byte(&pParent->aData[pParent->hdrOffset+8]); - }else{ - break; - } - rc = getAndInitPage(pBt, pgnoOld[i], &apOld[i], pParent); - if( rc ) goto balance_cleanup; - apOld[i]->idxParent = k; - apCopy[i] = 0; - assert( i==nOld ); - nOld++; - nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; - } - - /* Make nMaxCells a multiple of 2 in order to preserve 8-byte - ** alignment */ - nMaxCells = (nMaxCells + 1)&~1; - - /* - ** Allocate space for memory structures - */ - apCell = sqliteMallocRaw( - nMaxCells*sizeof(u8*) /* apCell */ - + nMaxCells*sizeof(int) /* szCell */ - + ROUND8(sizeof(MemPage))*NB /* aCopy */ - + pBt->pageSize*(5+NB) /* aSpace */ - + (ISAUTOVACUUM ? nMaxCells : 0) /* aFrom */ - ); - if( apCell==0 ){ - rc = SQLITE_NOMEM; - goto balance_cleanup; - } - szCell = (int*)&apCell[nMaxCells]; - aCopy[0] = (u8*)&szCell[nMaxCells]; - assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ - for(i=1; i<NB; i++){ - aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))]; - assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ - } - aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))]; - assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - aFrom = &aSpace[5*pBt->pageSize]; - } -#endif - - /* - ** Make copies of the content of pPage and its siblings into aOld[]. - ** The rest of this function will use data from the copies rather - ** that the original pages since the original pages will be in the - ** process of being overwritten. - */ - for(i=0; i<nOld; i++){ - MemPage *p = apCopy[i] = (MemPage*)&aCopy[i][pBt->pageSize]; - p->aData = &((u8*)p)[-pBt->pageSize]; - memcpy(p->aData, apOld[i]->aData, pBt->pageSize + sizeof(MemPage)); - /* The memcpy() above changes the value of p->aData so we have to - ** set it again. */ - p->aData = &((u8*)p)[-pBt->pageSize]; - } - - /* - ** Load pointers to all cells on sibling pages and the divider cells - ** into the local apCell[] array. Make copies of the divider cells - ** into space obtained form aSpace[] and remove the the divider Cells - ** from pParent. - ** - ** If the siblings are on leaf pages, then the child pointers of the - ** divider cells are stripped from the cells before they are copied - ** into aSpace[]. In this way, all cells in apCell[] are without - ** child pointers. If siblings are not leaves, then all cell in - ** apCell[] include child pointers. Either way, all cells in apCell[] - ** are alike. - ** - ** leafCorrection: 4 if pPage is a leaf. 0 if pPage is not a leaf. - ** leafData: 1 if pPage holds key+data and pParent holds only keys. - */ - nCell = 0; - leafCorrection = pPage->leaf*4; - leafData = pPage->leafData && pPage->leaf; - for(i=0; i<nOld; i++){ - MemPage *pOld = apCopy[i]; - int limit = pOld->nCell+pOld->nOverflow; - for(j=0; j<limit; j++){ - assert( nCell<nMaxCells ); - apCell[nCell] = findOverflowCell(pOld, j); - szCell[nCell] = cellSizePtr(pOld, apCell[nCell]); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - int a; - aFrom[nCell] = i; - for(a=0; a<pOld->nOverflow; a++){ - if( pOld->aOvfl[a].pCell==apCell[nCell] ){ - aFrom[nCell] = 0xFF; - break; - } - } - } -#endif - nCell++; - } - if( i<nOld-1 ){ - int sz = cellSizePtr(pParent, apDiv[i]); - if( leafData ){ - /* With the LEAFDATA flag, pParent cells hold only INTKEYs that - ** are duplicates of keys on the child pages. We need to remove - ** the divider cells from pParent, but the dividers cells are not - ** added to apCell[] because they are duplicates of child cells. - */ - dropCell(pParent, nxDiv, sz); - }else{ - u8 *pTemp; - assert( nCell<nMaxCells ); - szCell[nCell] = sz; - pTemp = &aSpace[iSpace]; - iSpace += sz; - assert( iSpace<=pBt->pageSize*5 ); - memcpy(pTemp, apDiv[i], sz); - apCell[nCell] = pTemp+leafCorrection; -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - aFrom[nCell] = 0xFF; - } -#endif - dropCell(pParent, nxDiv, sz); - szCell[nCell] -= leafCorrection; - assert( get4byte(pTemp)==pgnoOld[i] ); - if( !pOld->leaf ){ - assert( leafCorrection==0 ); - /* The right pointer of the child page pOld becomes the left - ** pointer of the divider cell */ - memcpy(apCell[nCell], &pOld->aData[pOld->hdrOffset+8], 4); - }else{ - assert( leafCorrection==4 ); - } - nCell++; - } - } - } - - /* - ** Figure out the number of pages needed to hold all nCell cells. - ** Store this number in "k". Also compute szNew[] which is the total - ** size of all cells on the i-th page and cntNew[] which is the index - ** in apCell[] of the cell that divides page i from page i+1. - ** cntNew[k] should equal nCell. - ** - ** Values computed by this block: - ** - ** k: The total number of sibling pages - ** szNew[i]: Spaced used on the i-th sibling page. - ** cntNew[i]: Index in apCell[] and szCell[] for the first cell to - ** the right of the i-th sibling page. - ** usableSpace: Number of bytes of space available on each sibling. - ** - */ - usableSpace = pBt->usableSize - 12 + leafCorrection; - for(subtotal=k=i=0; i<nCell; i++){ - assert( i<nMaxCells ); - subtotal += szCell[i] + 2; - if( subtotal > usableSpace ){ - szNew[k] = subtotal - szCell[i]; - cntNew[k] = i; - if( leafData ){ i--; } - subtotal = 0; - k++; - } - } - szNew[k] = subtotal; - cntNew[k] = nCell; - k++; - - /* - ** The packing computed by the previous block is biased toward the siblings - ** on the left side. The left siblings are always nearly full, while the - ** right-most sibling might be nearly empty. This block of code attempts - ** to adjust the packing of siblings to get a better balance. - ** - ** This adjustment is more than an optimization. The packing above might - ** be so out of balance as to be illegal. For example, the right-most - ** sibling might be completely empty. This adjustment is not optional. - */ - for(i=k-1; i>0; i--){ - int szRight = szNew[i]; /* Size of sibling on the right */ - int szLeft = szNew[i-1]; /* Size of sibling on the left */ - int r; /* Index of right-most cell in left sibling */ - int d; /* Index of first cell to the left of right sibling */ - - r = cntNew[i-1] - 1; - d = r + 1 - leafData; - assert( d<nMaxCells ); - assert( r<nMaxCells ); - while( szRight==0 || szRight+szCell[d]+2<=szLeft-(szCell[r]+2) ){ - szRight += szCell[d] + 2; - szLeft -= szCell[r] + 2; - cntNew[i-1]--; - r = cntNew[i-1] - 1; - d = r + 1 - leafData; - } - szNew[i] = szRight; - szNew[i-1] = szLeft; - } - - /* Either we found one or more cells (cntnew[0])>0) or we are the - ** a virtual root page. A virtual root page is when the real root - ** page is page 1 and we are the only child of that page. - */ - assert( cntNew[0]>0 || (pParent->pgno==1 && pParent->nCell==0) ); - - /* - ** Allocate k new pages. Reuse old pages where possible. - */ - assert( pPage->pgno>1 ); - pageFlags = pPage->aData[0]; - for(i=0; i<k; i++){ - MemPage *pNew; - if( i<nOld ){ - pNew = apNew[i] = apOld[i]; - pgnoNew[i] = pgnoOld[i]; - apOld[i] = 0; - rc = sqlite3pager_write(pNew->aData); - if( rc ) goto balance_cleanup; - }else{ - rc = allocatePage(pBt, &pNew, &pgnoNew[i], pgnoNew[i-1], 0); - if( rc ) goto balance_cleanup; - apNew[i] = pNew; - } - nNew++; - zeroPage(pNew, pageFlags); - } - - /* Free any old pages that were not reused as new pages. - */ - while( i<nOld ){ - rc = freePage(apOld[i]); - if( rc ) goto balance_cleanup; - releasePage(apOld[i]); - apOld[i] = 0; - i++; - } - - /* - ** Put the new pages in accending order. This helps to - ** keep entries in the disk file in order so that a scan - ** of the table is a linear scan through the file. That - ** in turn helps the operating system to deliver pages - ** from the disk more rapidly. - ** - ** An O(n^2) insertion sort algorithm is used, but since - ** n is never more than NB (a small constant), that should - ** not be a problem. - ** - ** When NB==3, this one optimization makes the database - ** about 25% faster for large insertions and deletions. - */ - for(i=0; i<k-1; i++){ - int minV = pgnoNew[i]; - int minI = i; - for(j=i+1; j<k; j++){ - if( pgnoNew[j]<(unsigned)minV ){ - minI = j; - minV = pgnoNew[j]; - } - } - if( minI>i ){ - int t; - MemPage *pT; - t = pgnoNew[i]; - pT = apNew[i]; - pgnoNew[i] = pgnoNew[minI]; - apNew[i] = apNew[minI]; - pgnoNew[minI] = t; - apNew[minI] = pT; - } - } - TRACE(("BALANCE: old: %d %d %d new: %d(%d) %d(%d) %d(%d) %d(%d) %d(%d)\n", - pgnoOld[0], - nOld>=2 ? pgnoOld[1] : 0, - nOld>=3 ? pgnoOld[2] : 0, - pgnoNew[0], szNew[0], - nNew>=2 ? pgnoNew[1] : 0, nNew>=2 ? szNew[1] : 0, - nNew>=3 ? pgnoNew[2] : 0, nNew>=3 ? szNew[2] : 0, - nNew>=4 ? pgnoNew[3] : 0, nNew>=4 ? szNew[3] : 0, - nNew>=5 ? pgnoNew[4] : 0, nNew>=5 ? szNew[4] : 0)); - - /* - ** Evenly distribute the data in apCell[] across the new pages. - ** Insert divider cells into pParent as necessary. - */ - j = 0; - for(i=0; i<nNew; i++){ - /* Assemble the new sibling page. */ - MemPage *pNew = apNew[i]; - assert( j<nMaxCells ); - assert( pNew->pgno==pgnoNew[i] ); - assemblePage(pNew, cntNew[i]-j, &apCell[j], &szCell[j]); - assert( pNew->nCell>0 || (nNew==1 && cntNew[0]==0) ); - assert( pNew->nOverflow==0 ); - -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If this is an auto-vacuum database, update the pointer map entries - ** that point to the siblings that were rearranged. These can be: left - ** children of cells, the right-child of the page, or overflow pages - ** pointed to by cells. - */ - if( pBt->autoVacuum ){ - for(k=j; k<cntNew[i]; k++){ - assert( k<nMaxCells ); - if( aFrom[k]==0xFF || apCopy[aFrom[k]]->pgno!=pNew->pgno ){ - rc = ptrmapPutOvfl(pNew, k-j); - if( rc!=SQLITE_OK ){ - goto balance_cleanup; - } - } - } - } -#endif - - j = cntNew[i]; - - /* If the sibling page assembled above was not the right-most sibling, - ** insert a divider cell into the parent page. - */ - if( i<nNew-1 && j<nCell ){ - u8 *pCell; - u8 *pTemp; - int sz; - - assert( j<nMaxCells ); - pCell = apCell[j]; - sz = szCell[j] + leafCorrection; - if( !pNew->leaf ){ - memcpy(&pNew->aData[8], pCell, 4); - pTemp = 0; - }else if( leafData ){ - /* If the tree is a leaf-data tree, and the siblings are leaves, - ** then there is no divider cell in apCell[]. Instead, the divider - ** cell consists of the integer key for the right-most cell of - ** the sibling-page assembled above only. - */ - CellInfo info; - j--; - parseCellPtr(pNew, apCell[j], &info); - pCell = &aSpace[iSpace]; - fillInCell(pParent, pCell, 0, info.nKey, 0, 0, &sz); - iSpace += sz; - assert( iSpace<=pBt->pageSize*5 ); - pTemp = 0; - }else{ - pCell -= 4; - pTemp = &aSpace[iSpace]; - iSpace += sz; - assert( iSpace<=pBt->pageSize*5 ); - } - rc = insertCell(pParent, nxDiv, pCell, sz, pTemp, 4); - if( rc!=SQLITE_OK ) goto balance_cleanup; - put4byte(findOverflowCell(pParent,nxDiv), pNew->pgno); -#ifndef SQLITE_OMIT_AUTOVACUUM - /* If this is an auto-vacuum database, and not a leaf-data tree, - ** then update the pointer map with an entry for the overflow page - ** that the cell just inserted points to (if any). - */ - if( pBt->autoVacuum && !leafData ){ - rc = ptrmapPutOvfl(pParent, nxDiv); - if( rc!=SQLITE_OK ){ - goto balance_cleanup; - } - } -#endif - j++; - nxDiv++; - } - } - assert( j==nCell ); - if( (pageFlags & PTF_LEAF)==0 ){ - memcpy(&apNew[nNew-1]->aData[8], &apCopy[nOld-1]->aData[8], 4); - } - if( nxDiv==pParent->nCell+pParent->nOverflow ){ - /* Right-most sibling is the right-most child of pParent */ - put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew[nNew-1]); - }else{ - /* Right-most sibling is the left child of the first entry in pParent - ** past the right-most divider entry */ - put4byte(findOverflowCell(pParent, nxDiv), pgnoNew[nNew-1]); - } - - /* - ** Reparent children of all cells. - */ - for(i=0; i<nNew; i++){ - rc = reparentChildPages(apNew[i]); - if( rc!=SQLITE_OK ) goto balance_cleanup; - } - rc = reparentChildPages(pParent); - if( rc!=SQLITE_OK ) goto balance_cleanup; - - /* - ** Balance the parent page. Note that the current page (pPage) might - ** have been added to the freelist so it might no longer be initialized. - ** But the parent page will always be initialized. - */ - assert( pParent->isInit ); - /* assert( pPage->isInit ); // No! pPage might have been added to freelist */ - /* pageIntegrity(pPage); // No! pPage might have been added to freelist */ - rc = balance(pParent, 0); - - /* - ** Cleanup before returning. - */ -balance_cleanup: - sqliteFree(apCell); - for(i=0; i<nOld; i++){ - releasePage(apOld[i]); - } - for(i=0; i<nNew; i++){ - releasePage(apNew[i]); - } - releasePage(pParent); - TRACE(("BALANCE: finished with %d: old=%d new=%d cells=%d\n", - pPage->pgno, nOld, nNew, nCell)); - return rc; -} - -/* -** This routine is called for the root page of a btree when the root -** page contains no cells. This is an opportunity to make the tree -** shallower by one level. -*/ -static int balance_shallower(MemPage *pPage){ - MemPage *pChild; /* The only child page of pPage */ - Pgno pgnoChild; /* Page number for pChild */ - int rc = SQLITE_OK; /* Return code from subprocedures */ - Btree *pBt; /* The main BTree structure */ - int mxCellPerPage; /* Maximum number of cells per page */ - u8 **apCell; /* All cells from pages being balanced */ - int *szCell; /* Local size of all cells */ - - assert( pPage->pParent==0 ); - assert( pPage->nCell==0 ); - pBt = pPage->pBt; - mxCellPerPage = MX_CELL(pBt); - apCell = sqliteMallocRaw( mxCellPerPage*(sizeof(u8*)+sizeof(int)) ); - if( apCell==0 ) return SQLITE_NOMEM; - szCell = (int*)&apCell[mxCellPerPage]; - if( pPage->leaf ){ - /* The table is completely empty */ - TRACE(("BALANCE: empty table %d\n", pPage->pgno)); - }else{ - /* The root page is empty but has one child. Transfer the - ** information from that one child into the root page if it - ** will fit. This reduces the depth of the tree by one. - ** - ** If the root page is page 1, it has less space available than - ** its child (due to the 100 byte header that occurs at the beginning - ** of the database fle), so it might not be able to hold all of the - ** information currently contained in the child. If this is the - ** case, then do not do the transfer. Leave page 1 empty except - ** for the right-pointer to the child page. The child page becomes - ** the virtual root of the tree. - */ - pgnoChild = get4byte(&pPage->aData[pPage->hdrOffset+8]); - assert( pgnoChild>0 ); - assert( pgnoChild<=sqlite3pager_pagecount(pPage->pBt->pPager) ); - rc = getPage(pPage->pBt, pgnoChild, &pChild); - if( rc ) goto end_shallow_balance; - if( pPage->pgno==1 ){ - rc = initPage(pChild, pPage); - if( rc ) goto end_shallow_balance; - assert( pChild->nOverflow==0 ); - if( pChild->nFree>=100 ){ - /* The child information will fit on the root page, so do the - ** copy */ - int i; - zeroPage(pPage, pChild->aData[0]); - for(i=0; i<pChild->nCell; i++){ - apCell[i] = findCell(pChild,i); - szCell[i] = cellSizePtr(pChild, apCell[i]); - } - assemblePage(pPage, pChild->nCell, apCell, szCell); - /* Copy the right-pointer of the child to the parent. */ - put4byte(&pPage->aData[pPage->hdrOffset+8], - get4byte(&pChild->aData[pChild->hdrOffset+8])); - freePage(pChild); - TRACE(("BALANCE: child %d transfer to page 1\n", pChild->pgno)); - }else{ - /* The child has more information that will fit on the root. - ** The tree is already balanced. Do nothing. */ - TRACE(("BALANCE: child %d will not fit on page 1\n", pChild->pgno)); - } - }else{ - memcpy(pPage->aData, pChild->aData, pPage->pBt->usableSize); - pPage->isInit = 0; - pPage->pParent = 0; - rc = initPage(pPage, 0); - assert( rc==SQLITE_OK ); - freePage(pChild); - TRACE(("BALANCE: transfer child %d into root %d\n", - pChild->pgno, pPage->pgno)); - } - rc = reparentChildPages(pPage); - assert( pPage->nOverflow==0 ); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - int i; - for(i=0; i<pPage->nCell; i++){ - rc = ptrmapPutOvfl(pPage, i); - if( rc!=SQLITE_OK ){ - goto end_shallow_balance; - } - } - } -#endif - if( rc!=SQLITE_OK ) goto end_shallow_balance; - releasePage(pChild); - } -end_shallow_balance: - sqliteFree(apCell); - return rc; -} - - -/* -** The root page is overfull -** -** When this happens, Create a new child page and copy the -** contents of the root into the child. Then make the root -** page an empty page with rightChild pointing to the new -** child. Finally, call balance_internal() on the new child -** to cause it to split. -*/ -static int balance_deeper(MemPage *pPage){ - int rc; /* Return value from subprocedures */ - MemPage *pChild; /* Pointer to a new child page */ - Pgno pgnoChild; /* Page number of the new child page */ - Btree *pBt; /* The BTree */ - int usableSize; /* Total usable size of a page */ - u8 *data; /* Content of the parent page */ - u8 *cdata; /* Content of the child page */ - int hdr; /* Offset to page header in parent */ - int brk; /* Offset to content of first cell in parent */ - - assert( pPage->pParent==0 ); - assert( pPage->nOverflow>0 ); - pBt = pPage->pBt; - rc = allocatePage(pBt, &pChild, &pgnoChild, pPage->pgno, 0); - if( rc ) return rc; - assert( sqlite3pager_iswriteable(pChild->aData) ); - usableSize = pBt->usableSize; - data = pPage->aData; - hdr = pPage->hdrOffset; - brk = get2byte(&data[hdr+5]); - cdata = pChild->aData; - memcpy(cdata, &data[hdr], pPage->cellOffset+2*pPage->nCell-hdr); - memcpy(&cdata[brk], &data[brk], usableSize-brk); - assert( pChild->isInit==0 ); - rc = initPage(pChild, pPage); - if( rc ) goto balancedeeper_out; - memcpy(pChild->aOvfl, pPage->aOvfl, pPage->nOverflow*sizeof(pPage->aOvfl[0])); - pChild->nOverflow = pPage->nOverflow; - if( pChild->nOverflow ){ - pChild->nFree = 0; - } - assert( pChild->nCell==pPage->nCell ); - zeroPage(pPage, pChild->aData[0] & ~PTF_LEAF); - put4byte(&pPage->aData[pPage->hdrOffset+8], pgnoChild); - TRACE(("BALANCE: copy root %d into %d\n", pPage->pgno, pChild->pgno)); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - int i; - rc = ptrmapPut(pBt, pChild->pgno, PTRMAP_BTREE, pPage->pgno); - if( rc ) goto balancedeeper_out; - for(i=0; i<pChild->nCell; i++){ - rc = ptrmapPutOvfl(pChild, i); - if( rc!=SQLITE_OK ){ - return rc; - } - } - } -#endif - rc = balance_nonroot(pChild); - -balancedeeper_out: - releasePage(pChild); - return rc; -} - -/* -** Decide if the page pPage needs to be balanced. If balancing is -** required, call the appropriate balancing routine. -*/ -static int balance(MemPage *pPage, int insert){ - int rc = SQLITE_OK; - if( pPage->pParent==0 ){ - if( pPage->nOverflow>0 ){ - rc = balance_deeper(pPage); - } - if( rc==SQLITE_OK && pPage->nCell==0 ){ - rc = balance_shallower(pPage); - } - }else{ - if( pPage->nOverflow>0 || - (!insert && pPage->nFree>pPage->pBt->usableSize*2/3) ){ - rc = balance_nonroot(pPage); - } - } - return rc; -} - -/* -** This routine checks all cursors that point to table pgnoRoot. -** If any of those cursors other than pExclude were opened with -** wrFlag==0 then this routine returns SQLITE_LOCKED. If all -** cursors that point to pgnoRoot were opened with wrFlag==1 -** then this routine returns SQLITE_OK. -** -** In addition to checking for read-locks (where a read-lock -** means a cursor opened with wrFlag==0) this routine also moves -** all cursors other than pExclude so that they are pointing to the -** first Cell on root page. This is necessary because an insert -** or delete might change the number of cells on a page or delete -** a page entirely and we do not want to leave any cursors -** pointing to non-existant pages or cells. -*/ -static int checkReadLocks(Btree *pBt, Pgno pgnoRoot, BtCursor *pExclude){ - BtCursor *p; - for(p=pBt->pCursor; p; p=p->pNext){ - if( p->pgnoRoot!=pgnoRoot || p==pExclude ) continue; - if( p->wrFlag==0 ) return SQLITE_LOCKED; - if( p->pPage->pgno!=p->pgnoRoot ){ - moveToRoot(p); - } - } - return SQLITE_OK; -} - -/* -** Insert a new record into the BTree. The key is given by (pKey,nKey) -** and the data is given by (pData,nData). The cursor is used only to -** define what table the record should be inserted into. The cursor -** is left pointing at a random location. -** -** For an INTKEY table, only the nKey value of the key is used. pKey is -** ignored. For a ZERODATA table, the pData and nData are both ignored. -*/ -int sqlite3BtreeInsert( - BtCursor *pCur, /* Insert data into the table of this cursor */ - const void *pKey, i64 nKey, /* The key of the new record */ - const void *pData, int nData /* The data of the new record */ -){ - int rc; - int loc; - int szNew; - MemPage *pPage; - Btree *pBt = pCur->pBt; - unsigned char *oldCell; - unsigned char *newCell = 0; - - if( pBt->inTrans!=TRANS_WRITE ){ - /* Must start a transaction before doing an insert */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( !pBt->readOnly ); - if( !pCur->wrFlag ){ - return SQLITE_PERM; /* Cursor not open for writing */ - } - if( checkReadLocks(pBt, pCur->pgnoRoot, pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc); - if( rc ) return rc; - pPage = pCur->pPage; - assert( pPage->intKey || nKey>=0 ); - assert( pPage->leaf || !pPage->leafData ); - TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n", - pCur->pgnoRoot, nKey, nData, pPage->pgno, - loc==0 ? "overwrite" : "new entry")); - assert( pPage->isInit ); - rc = sqlite3pager_write(pPage->aData); - if( rc ) return rc; - newCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) ); - if( newCell==0 ) return SQLITE_NOMEM; - rc = fillInCell(pPage, newCell, pKey, nKey, pData, nData, &szNew); - if( rc ) goto end_insert; - assert( szNew==cellSizePtr(pPage, newCell) ); - assert( szNew<=MX_CELL_SIZE(pBt) ); - if( loc==0 && pCur->isValid ){ - int szOld; - assert( pCur->idx>=0 && pCur->idx<pPage->nCell ); - oldCell = findCell(pPage, pCur->idx); - if( !pPage->leaf ){ - memcpy(newCell, oldCell, 4); - } - szOld = cellSizePtr(pPage, oldCell); - rc = clearCell(pPage, oldCell); - if( rc ) goto end_insert; - dropCell(pPage, pCur->idx, szOld); - }else if( loc<0 && pPage->nCell>0 ){ - assert( pPage->leaf ); - pCur->idx++; - pCur->info.nSize = 0; - }else{ - assert( pPage->leaf ); - } - rc = insertCell(pPage, pCur->idx, newCell, szNew, 0, 0); - if( rc!=SQLITE_OK ) goto end_insert; - rc = balance(pPage, 1); - /* sqlite3BtreePageDump(pCur->pBt, pCur->pgnoRoot, 1); */ - /* fflush(stdout); */ - if( rc==SQLITE_OK ){ - moveToRoot(pCur); - } -end_insert: - sqliteFree(newCell); - return rc; -} - -/* -** Delete the entry that the cursor is pointing to. The cursor -** is left pointing at a random location. -*/ -int sqlite3BtreeDelete(BtCursor *pCur){ - MemPage *pPage = pCur->pPage; - unsigned char *pCell; - int rc; - Pgno pgnoChild = 0; - Btree *pBt = pCur->pBt; - - assert( pPage->isInit ); - if( pBt->inTrans!=TRANS_WRITE ){ - /* Must start a transaction before doing a delete */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( !pBt->readOnly ); - if( pCur->idx >= pPage->nCell ){ - return SQLITE_ERROR; /* The cursor is not pointing to anything */ - } - if( !pCur->wrFlag ){ - return SQLITE_PERM; /* Did not open this cursor for writing */ - } - if( checkReadLocks(pBt, pCur->pgnoRoot, pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - rc = sqlite3pager_write(pPage->aData); - if( rc ) return rc; - - /* Locate the cell within it's page and leave pCell pointing to the - ** data. The clearCell() call frees any overflow pages associated with the - ** cell. The cell itself is still intact. - */ - pCell = findCell(pPage, pCur->idx); - if( !pPage->leaf ){ - pgnoChild = get4byte(pCell); - } - rc = clearCell(pPage, pCell); - if( rc ) return rc; - - if( !pPage->leaf ){ - /* - ** The entry we are about to delete is not a leaf so if we do not - ** do something we will leave a hole on an internal page. - ** We have to fill the hole by moving in a cell from a leaf. The - ** next Cell after the one to be deleted is guaranteed to exist and - ** to be a leaf so we can use it. - */ - BtCursor leafCur; - unsigned char *pNext; - int szNext; - int notUsed; - unsigned char *tempCell = 0; - assert( !pPage->leafData ); - getTempCursor(pCur, &leafCur); - rc = sqlite3BtreeNext(&leafCur, ¬Used); - if( rc!=SQLITE_OK ){ - if( rc!=SQLITE_NOMEM ){ - rc = SQLITE_CORRUPT_BKPT; - } - } - if( rc==SQLITE_OK ){ - rc = sqlite3pager_write(leafCur.pPage->aData); - } - if( rc==SQLITE_OK ){ - TRACE(("DELETE: table=%d delete internal from %d replace from leaf %d\n", - pCur->pgnoRoot, pPage->pgno, leafCur.pPage->pgno)); - dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell)); - pNext = findCell(leafCur.pPage, leafCur.idx); - szNext = cellSizePtr(leafCur.pPage, pNext); - assert( MX_CELL_SIZE(pBt)>=szNext+4 ); - tempCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) ); - if( tempCell==0 ){ - rc = SQLITE_NOMEM; - } - } - if( rc==SQLITE_OK ){ - rc = insertCell(pPage, pCur->idx, pNext-4, szNext+4, tempCell, 0); - } - if( rc==SQLITE_OK ){ - put4byte(findOverflowCell(pPage, pCur->idx), pgnoChild); - rc = balance(pPage, 0); - } - if( rc==SQLITE_OK ){ - dropCell(leafCur.pPage, leafCur.idx, szNext); - rc = balance(leafCur.pPage, 0); - } - sqliteFree(tempCell); - releaseTempCursor(&leafCur); - }else{ - TRACE(("DELETE: table=%d delete from leaf %d\n", - pCur->pgnoRoot, pPage->pgno)); - dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell)); - rc = balance(pPage, 0); - } - if( rc==SQLITE_OK ){ - moveToRoot(pCur); - } - return rc; -} - -/* -** Create a new BTree table. Write into *piTable the page -** number for the root page of the new table. -** -** The type of type is determined by the flags parameter. Only the -** following values of flags are currently in use. Other values for -** flags might not work: -** -** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys -** BTREE_ZERODATA Used for SQL indices -*/ -int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){ - MemPage *pRoot; - Pgno pgnoRoot; - int rc; - if( pBt->inTrans!=TRANS_WRITE ){ - /* Must start a transaction first */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( !pBt->readOnly ); - - /* It is illegal to create a table if any cursors are open on the - ** database. This is because in auto-vacuum mode the backend may - ** need to move a database page to make room for the new root-page. - ** If an open cursor was using the page a problem would occur. - */ - if( pBt->pCursor ){ - return SQLITE_LOCKED; - } - -#ifdef SQLITE_OMIT_AUTOVACUUM - rc = allocatePage(pBt, &pRoot, &pgnoRoot, 1, 0); - if( rc ) return rc; -#else - if( pBt->autoVacuum ){ - Pgno pgnoMove; /* Move a page here to make room for the root-page */ - MemPage *pPageMove; /* The page to move to. */ - - /* Read the value of meta[3] from the database to determine where the - ** root page of the new table should go. meta[3] is the largest root-page - ** created so far, so the new root-page is (meta[3]+1). - */ - rc = sqlite3BtreeGetMeta(pBt, 4, &pgnoRoot); - if( rc!=SQLITE_OK ) return rc; - pgnoRoot++; - - /* The new root-page may not be allocated on a pointer-map page, or the - ** PENDING_BYTE page. - */ - if( pgnoRoot==PTRMAP_PAGENO(pBt->usableSize, pgnoRoot) || - pgnoRoot==PENDING_BYTE_PAGE(pBt) ){ - pgnoRoot++; - } - assert( pgnoRoot>=3 ); - - /* Allocate a page. The page that currently resides at pgnoRoot will - ** be moved to the allocated page (unless the allocated page happens - ** to reside at pgnoRoot). - */ - rc = allocatePage(pBt, &pPageMove, &pgnoMove, pgnoRoot, 1); - if( rc!=SQLITE_OK ){ - return rc; - } - - if( pgnoMove!=pgnoRoot ){ - u8 eType; - Pgno iPtrPage; - - releasePage(pPageMove); - rc = getPage(pBt, pgnoRoot, &pRoot); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage); - if( rc!=SQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ - releasePage(pRoot); - return rc; - } - assert( eType!=PTRMAP_ROOTPAGE ); - assert( eType!=PTRMAP_FREEPAGE ); - rc = sqlite3pager_write(pRoot->aData); - if( rc!=SQLITE_OK ){ - releasePage(pRoot); - return rc; - } - rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove); - releasePage(pRoot); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = getPage(pBt, pgnoRoot, &pRoot); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = sqlite3pager_write(pRoot->aData); - if( rc!=SQLITE_OK ){ - releasePage(pRoot); - return rc; - } - }else{ - pRoot = pPageMove; - } - - /* Update the pointer-map and meta-data with the new root-page number. */ - rc = ptrmapPut(pBt, pgnoRoot, PTRMAP_ROOTPAGE, 0); - if( rc ){ - releasePage(pRoot); - return rc; - } - rc = sqlite3BtreeUpdateMeta(pBt, 4, pgnoRoot); - if( rc ){ - releasePage(pRoot); - return rc; - } - - }else{ - rc = allocatePage(pBt, &pRoot, &pgnoRoot, 1, 0); - if( rc ) return rc; - } -#endif - assert( sqlite3pager_iswriteable(pRoot->aData) ); - zeroPage(pRoot, flags | PTF_LEAF); - sqlite3pager_unref(pRoot->aData); - *piTable = (int)pgnoRoot; - return SQLITE_OK; -} - -/* -** Erase the given database page and all its children. Return -** the page to the freelist. -*/ -static int clearDatabasePage( - Btree *pBt, /* The BTree that contains the table */ - Pgno pgno, /* Page number to clear */ - MemPage *pParent, /* Parent page. NULL for the root */ - int freePageFlag /* Deallocate page if true */ -){ - MemPage *pPage = 0; - int rc; - unsigned char *pCell; - int i; - - if( pgno>sqlite3pager_pagecount(pBt->pPager) ){ - return SQLITE_CORRUPT_BKPT; - } - - rc = getAndInitPage(pBt, pgno, &pPage, pParent); - if( rc ) goto cleardatabasepage_out; - rc = sqlite3pager_write(pPage->aData); - if( rc ) goto cleardatabasepage_out; - for(i=0; i<pPage->nCell; i++){ - pCell = findCell(pPage, i); - if( !pPage->leaf ){ - rc = clearDatabasePage(pBt, get4byte(pCell), pPage->pParent, 1); - if( rc ) goto cleardatabasepage_out; - } - rc = clearCell(pPage, pCell); - if( rc ) goto cleardatabasepage_out; - } - if( !pPage->leaf ){ - rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), pPage->pParent, 1); - if( rc ) goto cleardatabasepage_out; - } - if( freePageFlag ){ - rc = freePage(pPage); - }else{ - zeroPage(pPage, pPage->aData[0] | PTF_LEAF); - } - -cleardatabasepage_out: - releasePage(pPage); - return rc; -} - -/* -** Delete all information from a single table in the database. iTable is -** the page number of the root of the table. After this routine returns, -** the root page is empty, but still exists. -** -** This routine will fail with SQLITE_LOCKED if there are any open -** read cursors on the table. Open write cursors are moved to the -** root of the table. -*/ -int sqlite3BtreeClearTable(Btree *pBt, int iTable){ - int rc; - BtCursor *pCur; - if( pBt->inTrans!=TRANS_WRITE ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->pgnoRoot==(Pgno)iTable ){ - if( pCur->wrFlag==0 ) return SQLITE_LOCKED; - moveToRoot(pCur); - } - } - rc = clearDatabasePage(pBt, (Pgno)iTable, 0, 0); - if( rc ){ - sqlite3BtreeRollback(pBt); - } - return rc; -} - -/* -** Erase all information in a table and add the root of the table to -** the freelist. Except, the root of the principle table (the one on -** page 1) is never added to the freelist. -** -** This routine will fail with SQLITE_LOCKED if there are any open -** cursors on the table. -** -** If AUTOVACUUM is enabled and the page at iTable is not the last -** root page in the database file, then the last root page -** in the database file is moved into the slot formerly occupied by -** iTable and that last slot formerly occupied by the last root page -** is added to the freelist instead of iTable. In this say, all -** root pages are kept at the beginning of the database file, which -** is necessary for AUTOVACUUM to work right. *piMoved is set to the -** page number that used to be the last root page in the file before -** the move. If no page gets moved, *piMoved is set to 0. -** The last root page is recorded in meta[3] and the value of -** meta[3] is updated by this procedure. -*/ -int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){ - int rc; - MemPage *pPage = 0; - - if( pBt->inTrans!=TRANS_WRITE ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - - /* It is illegal to drop a table if any cursors are open on the - ** database. This is because in auto-vacuum mode the backend may - ** need to move another root-page to fill a gap left by the deleted - ** root page. If an open cursor was using this page a problem would - ** occur. - */ - if( pBt->pCursor ){ - return SQLITE_LOCKED; - } - - rc = getPage(pBt, (Pgno)iTable, &pPage); - if( rc ) return rc; - rc = sqlite3BtreeClearTable(pBt, iTable); - if( rc ){ - releasePage(pPage); - return rc; - } - - *piMoved = 0; - - if( iTable>1 ){ -#ifdef SQLITE_OMIT_AUTOVACUUM - rc = freePage(pPage); - releasePage(pPage); -#else - if( pBt->autoVacuum ){ - Pgno maxRootPgno; - rc = sqlite3BtreeGetMeta(pBt, 4, &maxRootPgno); - if( rc!=SQLITE_OK ){ - releasePage(pPage); - return rc; - } - - if( iTable==maxRootPgno ){ - /* If the table being dropped is the table with the largest root-page - ** number in the database, put the root page on the free list. - */ - rc = freePage(pPage); - releasePage(pPage); - if( rc!=SQLITE_OK ){ - return rc; - } - }else{ - /* The table being dropped does not have the largest root-page - ** number in the database. So move the page that does into the - ** gap left by the deleted root-page. - */ - MemPage *pMove; - releasePage(pPage); - rc = getPage(pBt, maxRootPgno, &pMove); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = relocatePage(pBt, pMove, PTRMAP_ROOTPAGE, 0, iTable); - releasePage(pMove); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = getPage(pBt, maxRootPgno, &pMove); - if( rc!=SQLITE_OK ){ - return rc; - } - rc = freePage(pMove); - releasePage(pMove); - if( rc!=SQLITE_OK ){ - return rc; - } - *piMoved = maxRootPgno; - } - - /* Set the new 'max-root-page' value in the database header. This - ** is the old value less one, less one more if that happens to - ** be a root-page number, less one again if that is the - ** PENDING_BYTE_PAGE. - */ - maxRootPgno--; - if( maxRootPgno==PENDING_BYTE_PAGE(pBt) ){ - maxRootPgno--; - } - if( maxRootPgno==PTRMAP_PAGENO(pBt->usableSize, maxRootPgno) ){ - maxRootPgno--; - } - assert( maxRootPgno!=PENDING_BYTE_PAGE(pBt) ); - - rc = sqlite3BtreeUpdateMeta(pBt, 4, maxRootPgno); - }else{ - rc = freePage(pPage); - releasePage(pPage); - } -#endif - }else{ - /* If sqlite3BtreeDropTable was called on page 1. */ - zeroPage(pPage, PTF_INTKEY|PTF_LEAF ); - releasePage(pPage); - } - return rc; -} - - -/* -** Read the meta-information out of a database file. Meta[0] -** is the number of free pages currently in the database. Meta[1] -** through meta[15] are available for use by higher layers. Meta[0] -** is read-only, the others are read/write. -** -** The schema layer numbers meta values differently. At the schema -** layer (and the SetCookie and ReadCookie opcodes) the number of -** free pages is not visible. So Cookie[0] is the same as Meta[1]. -*/ -int sqlite3BtreeGetMeta(Btree *pBt, int idx, u32 *pMeta){ - int rc; - unsigned char *pP1; - - assert( idx>=0 && idx<=15 ); - rc = sqlite3pager_get(pBt->pPager, 1, (void**)&pP1); - if( rc ) return rc; - *pMeta = get4byte(&pP1[36 + idx*4]); - sqlite3pager_unref(pP1); - - /* If autovacuumed is disabled in this build but we are trying to - ** access an autovacuumed database, then make the database readonly. - */ -#ifdef SQLITE_OMIT_AUTOVACUUM - if( idx==4 && *pMeta>0 ) pBt->readOnly = 1; -#endif - - return SQLITE_OK; -} - -/* -** Write meta-information back into the database. Meta[0] is -** read-only and may not be written. -*/ -int sqlite3BtreeUpdateMeta(Btree *pBt, int idx, u32 iMeta){ - unsigned char *pP1; - int rc; - assert( idx>=1 && idx<=15 ); - if( pBt->inTrans!=TRANS_WRITE ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( pBt->pPage1!=0 ); - pP1 = pBt->pPage1->aData; - rc = sqlite3pager_write(pP1); - if( rc ) return rc; - put4byte(&pP1[36 + idx*4], iMeta); - return SQLITE_OK; -} - -/* -** Return the flag byte at the beginning of the page that the cursor -** is currently pointing to. -*/ -int sqlite3BtreeFlags(BtCursor *pCur){ - MemPage *pPage = pCur->pPage; - return pPage ? pPage->aData[pPage->hdrOffset] : 0; -} - -#ifdef SQLITE_DEBUG -/* -** Print a disassembly of the given page on standard output. This routine -** is used for debugging and testing only. -*/ -static int btreePageDump(Btree *pBt, int pgno, int recursive, MemPage *pParent){ - int rc; - MemPage *pPage; - int i, j, c; - int nFree; - u16 idx; - int hdr; - int nCell; - int isInit; - unsigned char *data; - char range[20]; - unsigned char payload[20]; - - rc = getPage(pBt, (Pgno)pgno, &pPage); - isInit = pPage->isInit; - if( pPage->isInit==0 ){ - initPage(pPage, pParent); - } - if( rc ){ - return rc; - } - hdr = pPage->hdrOffset; - data = pPage->aData; - c = data[hdr]; - pPage->intKey = (c & (PTF_INTKEY|PTF_LEAFDATA))!=0; - pPage->zeroData = (c & PTF_ZERODATA)!=0; - pPage->leafData = (c & PTF_LEAFDATA)!=0; - pPage->leaf = (c & PTF_LEAF)!=0; - pPage->hasData = !(pPage->zeroData || (!pPage->leaf && pPage->leafData)); - nCell = get2byte(&data[hdr+3]); - sqlite3DebugPrintf("PAGE %d: flags=0x%02x frag=%d parent=%d\n", pgno, - data[hdr], data[hdr+7], - (pPage->isInit && pPage->pParent) ? pPage->pParent->pgno : 0); - assert( hdr == (pgno==1 ? 100 : 0) ); - idx = hdr + 12 - pPage->leaf*4; - for(i=0; i<nCell; i++){ - CellInfo info; - Pgno child; - unsigned char *pCell; - int sz; - int addr; - - addr = get2byte(&data[idx + 2*i]); - pCell = &data[addr]; - parseCellPtr(pPage, pCell, &info); - sz = info.nSize; - sprintf(range,"%d..%d", addr, addr+sz-1); - if( pPage->leaf ){ - child = 0; - }else{ - child = get4byte(pCell); - } - sz = info.nData; - if( !pPage->intKey ) sz += info.nKey; - if( sz>sizeof(payload)-1 ) sz = sizeof(payload)-1; - memcpy(payload, &pCell[info.nHeader], sz); - for(j=0; j<sz; j++){ - if( payload[j]<0x20 || payload[j]>0x7f ) payload[j] = '.'; - } - payload[sz] = 0; - sqlite3DebugPrintf( - "cell %2d: i=%-10s chld=%-4d nk=%-4lld nd=%-4d payload=%s\n", - i, range, child, info.nKey, info.nData, payload - ); - } - if( !pPage->leaf ){ - sqlite3DebugPrintf("right_child: %d\n", get4byte(&data[hdr+8])); - } - nFree = 0; - i = 0; - idx = get2byte(&data[hdr+1]); - while( idx>0 && idx<pPage->pBt->usableSize ){ - int sz = get2byte(&data[idx+2]); - sprintf(range,"%d..%d", idx, idx+sz-1); - nFree += sz; - sqlite3DebugPrintf("freeblock %2d: i=%-10s size=%-4d total=%d\n", - i, range, sz, nFree); - idx = get2byte(&data[idx]); - i++; - } - if( idx!=0 ){ - sqlite3DebugPrintf("ERROR: next freeblock index out of range: %d\n", idx); - } - if( recursive && !pPage->leaf ){ - for(i=0; i<nCell; i++){ - unsigned char *pCell = findCell(pPage, i); - btreePageDump(pBt, get4byte(pCell), 1, pPage); - idx = get2byte(pCell); - } - btreePageDump(pBt, get4byte(&data[hdr+8]), 1, pPage); - } - pPage->isInit = isInit; - sqlite3pager_unref(data); - fflush(stdout); - return SQLITE_OK; -} -int sqlite3BtreePageDump(Btree *pBt, int pgno, int recursive){ - return btreePageDump(pBt, pgno, recursive, 0); -} -#endif - -#ifdef SQLITE_TEST -/* -** Fill aResult[] with information about the entry and page that the -** cursor is pointing to. -** -** aResult[0] = The page number -** aResult[1] = The entry number -** aResult[2] = Total number of entries on this page -** aResult[3] = Cell size (local payload + header) -** aResult[4] = Number of free bytes on this page -** aResult[5] = Number of free blocks on the page -** aResult[6] = Total payload size (local + overflow) -** aResult[7] = Header size in bytes -** aResult[8] = Local payload size -** aResult[9] = Parent page number -** -** This routine is used for testing and debugging only. -*/ -int sqlite3BtreeCursorInfo(BtCursor *pCur, int *aResult, int upCnt){ - int cnt, idx; - MemPage *pPage = pCur->pPage; - BtCursor tmpCur; - - pageIntegrity(pPage); - assert( pPage->isInit ); - getTempCursor(pCur, &tmpCur); - while( upCnt-- ){ - moveToParent(&tmpCur); - } - pPage = tmpCur.pPage; - pageIntegrity(pPage); - aResult[0] = sqlite3pager_pagenumber(pPage->aData); - assert( aResult[0]==pPage->pgno ); - aResult[1] = tmpCur.idx; - aResult[2] = pPage->nCell; - if( tmpCur.idx>=0 && tmpCur.idx<pPage->nCell ){ - getCellInfo(&tmpCur); - aResult[3] = tmpCur.info.nSize; - aResult[6] = tmpCur.info.nData; - aResult[7] = tmpCur.info.nHeader; - aResult[8] = tmpCur.info.nLocal; - }else{ - aResult[3] = 0; - aResult[6] = 0; - aResult[7] = 0; - aResult[8] = 0; - } - aResult[4] = pPage->nFree; - cnt = 0; - idx = get2byte(&pPage->aData[pPage->hdrOffset+1]); - while( idx>0 && idx<pPage->pBt->usableSize ){ - cnt++; - idx = get2byte(&pPage->aData[idx]); - } - aResult[5] = cnt; - if( pPage->pParent==0 || isRootPage(pPage) ){ - aResult[9] = 0; - }else{ - aResult[9] = pPage->pParent->pgno; - } - releaseTempCursor(&tmpCur); - return SQLITE_OK; -} -#endif - -/* -** Return the pager associated with a BTree. This routine is used for -** testing and debugging only. -*/ -Pager *sqlite3BtreePager(Btree *pBt){ - return pBt->pPager; -} - -/* -** This structure is passed around through all the sanity checking routines -** in order to keep track of some global state information. -*/ -typedef struct IntegrityCk IntegrityCk; -struct IntegrityCk { - Btree *pBt; /* The tree being checked out */ - Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ - int nPage; /* Number of pages in the database */ - int *anRef; /* Number of times each page is referenced */ - char *zErrMsg; /* An error message. NULL of no errors seen. */ -}; - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK -/* -** Append a message to the error message string. -*/ -static void checkAppendMsg( - IntegrityCk *pCheck, - char *zMsg1, - const char *zFormat, - ... -){ - va_list ap; - char *zMsg2; - va_start(ap, zFormat); - zMsg2 = sqlite3VMPrintf(zFormat, ap); - va_end(ap); - if( zMsg1==0 ) zMsg1 = ""; - if( pCheck->zErrMsg ){ - char *zOld = pCheck->zErrMsg; - pCheck->zErrMsg = 0; - sqlite3SetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0); - sqliteFree(zOld); - }else{ - sqlite3SetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0); - } - sqliteFree(zMsg2); -} -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK -/* -** Add 1 to the reference count for page iPage. If this is the second -** reference to the page, add an error message to pCheck->zErrMsg. -** Return 1 if there are 2 ore more references to the page and 0 if -** if this is the first reference to the page. -** -** Also check that the page number is in bounds. -*/ -static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){ - if( iPage==0 ) return 1; - if( iPage>pCheck->nPage || iPage<0 ){ - checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); - return 1; - } - if( pCheck->anRef[iPage]==1 ){ - checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); - return 1; - } - return (pCheck->anRef[iPage]++)>1; -} - -#ifndef SQLITE_OMIT_AUTOVACUUM -/* -** Check that the entry in the pointer-map for page iChild maps to -** page iParent, pointer type ptrType. If not, append an error message -** to pCheck. -*/ -static void checkPtrmap( - IntegrityCk *pCheck, /* Integrity check context */ - Pgno iChild, /* Child page number */ - u8 eType, /* Expected pointer map type */ - Pgno iParent, /* Expected pointer map parent page number */ - char *zContext /* Context description (used for error msg) */ -){ - int rc; - u8 ePtrmapType; - Pgno iPtrmapParent; - - rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent); - if( rc!=SQLITE_OK ){ - checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild); - return; - } - - if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ - checkAppendMsg(pCheck, zContext, - "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", - iChild, eType, iParent, ePtrmapType, iPtrmapParent); - } -} -#endif - -/* -** Check the integrity of the freelist or of an overflow page list. -** Verify that the number of pages on the list is N. -*/ -static void checkList( - IntegrityCk *pCheck, /* Integrity checking context */ - int isFreeList, /* True for a freelist. False for overflow page list */ - int iPage, /* Page number for first page in the list */ - int N, /* Expected number of pages in the list */ - char *zContext /* Context for error messages */ -){ - int i; - int expected = N; - int iFirst = iPage; - while( N-- > 0 ){ - unsigned char *pOvfl; - if( iPage<1 ){ - checkAppendMsg(pCheck, zContext, - "%d of %d pages missing from overflow list starting at %d", - N+1, expected, iFirst); - break; - } - if( checkRef(pCheck, iPage, zContext) ) break; - if( sqlite3pager_get(pCheck->pPager, (Pgno)iPage, (void**)&pOvfl) ){ - checkAppendMsg(pCheck, zContext, "failed to get page %d", iPage); - break; - } - if( isFreeList ){ - int n = get4byte(&pOvfl[4]); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pCheck->pBt->autoVacuum ){ - checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0, zContext); - } -#endif - if( n>pCheck->pBt->usableSize/4-8 ){ - checkAppendMsg(pCheck, zContext, - "freelist leaf count too big on page %d", iPage); - N--; - }else{ - for(i=0; i<n; i++){ - Pgno iFreePage = get4byte(&pOvfl[8+i*4]); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pCheck->pBt->autoVacuum ){ - checkPtrmap(pCheck, iFreePage, PTRMAP_FREEPAGE, 0, zContext); - } -#endif - checkRef(pCheck, iFreePage, zContext); - } - N -= n; - } - } -#ifndef SQLITE_OMIT_AUTOVACUUM - else{ - /* If this database supports auto-vacuum and iPage is not the last - ** page in this overflow list, check that the pointer-map entry for - ** the following page matches iPage. - */ - if( pCheck->pBt->autoVacuum && N>0 ){ - i = get4byte(pOvfl); - checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage, zContext); - } - } -#endif - iPage = get4byte(pOvfl); - sqlite3pager_unref(pOvfl); - } -} -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK -/* -** Do various sanity checks on a single page of a tree. Return -** the tree depth. Root pages return 0. Parents of root pages -** return 1, and so forth. -** -** These checks are done: -** -** 1. Make sure that cells and freeblocks do not overlap -** but combine to completely cover the page. -** NO 2. Make sure cell keys are in order. -** NO 3. Make sure no key is less than or equal to zLowerBound. -** NO 4. Make sure no key is greater than or equal to zUpperBound. -** 5. Check the integrity of overflow pages. -** 6. Recursively call checkTreePage on all children. -** 7. Verify that the depth of all children is the same. -** 8. Make sure this page is at least 33% full or else it is -** the root of the tree. -*/ -static int checkTreePage( - IntegrityCk *pCheck, /* Context for the sanity check */ - int iPage, /* Page number of the page to check */ - MemPage *pParent, /* Parent page */ - char *zParentContext, /* Parent context */ - char *zLowerBound, /* All keys should be greater than this, if not NULL */ - int nLower, /* Number of characters in zLowerBound */ - char *zUpperBound, /* All keys should be less than this, if not NULL */ - int nUpper /* Number of characters in zUpperBound */ -){ - MemPage *pPage; - int i, rc, depth, d2, pgno, cnt; - int hdr, cellStart; - int nCell; - u8 *data; - BtCursor cur; - Btree *pBt; - int usableSize; - char zContext[100]; - char *hit; - - sprintf(zContext, "Page %d: ", iPage); - - /* Check that the page exists - */ - cur.pBt = pBt = pCheck->pBt; - usableSize = pBt->usableSize; - if( iPage==0 ) return 0; - if( checkRef(pCheck, iPage, zParentContext) ) return 0; - if( (rc = getPage(pBt, (Pgno)iPage, &pPage))!=0 ){ - checkAppendMsg(pCheck, zContext, - "unable to get the page. error code=%d", rc); - return 0; - } - if( (rc = initPage(pPage, pParent))!=0 ){ - checkAppendMsg(pCheck, zContext, "initPage() returns error code %d", rc); - releasePage(pPage); - return 0; - } - - /* Check out all the cells. - */ - depth = 0; - cur.pPage = pPage; - for(i=0; i<pPage->nCell; i++){ - u8 *pCell; - int sz; - CellInfo info; - - /* Check payload overflow pages - */ - sprintf(zContext, "On tree page %d cell %d: ", iPage, i); - pCell = findCell(pPage,i); - parseCellPtr(pPage, pCell, &info); - sz = info.nData; - if( !pPage->intKey ) sz += info.nKey; - if( sz>info.nLocal ){ - int nPage = (sz - info.nLocal + usableSize - 5)/(usableSize - 4); - Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage, zContext); - } -#endif - checkList(pCheck, 0, pgnoOvfl, nPage, zContext); - } - - /* Check sanity of left child page. - */ - if( !pPage->leaf ){ - pgno = get4byte(pCell); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext); - } -#endif - d2 = checkTreePage(pCheck,pgno,pPage,zContext,0,0,0,0); - if( i>0 && d2!=depth ){ - checkAppendMsg(pCheck, zContext, "Child page depth differs"); - } - depth = d2; - } - } - if( !pPage->leaf ){ - pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); - sprintf(zContext, "On page %d at right child: ", iPage); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum ){ - checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0); - } -#endif - checkTreePage(pCheck, pgno, pPage, zContext,0,0,0,0); - } - - /* Check for complete coverage of the page - */ - data = pPage->aData; - hdr = pPage->hdrOffset; - hit = sqliteMalloc( usableSize ); - if( hit ){ - memset(hit, 1, get2byte(&data[hdr+5])); - nCell = get2byte(&data[hdr+3]); - cellStart = hdr + 12 - 4*pPage->leaf; - for(i=0; i<nCell; i++){ - int pc = get2byte(&data[cellStart+i*2]); - int size = cellSizePtr(pPage, &data[pc]); - int j; - if( (pc+size-1)>=usableSize || pc<0 ){ - checkAppendMsg(pCheck, 0, - "Corruption detected in cell %d on page %d",i,iPage,0); - }else{ - for(j=pc+size-1; j>=pc; j--) hit[j]++; - } - } - for(cnt=0, i=get2byte(&data[hdr+1]); i>0 && i<usableSize && cnt<10000; - cnt++){ - int size = get2byte(&data[i+2]); - int j; - if( (i+size-1)>=usableSize || i<0 ){ - checkAppendMsg(pCheck, 0, - "Corruption detected in cell %d on page %d",i,iPage,0); - }else{ - for(j=i+size-1; j>=i; j--) hit[j]++; - } - i = get2byte(&data[i]); - } - for(i=cnt=0; i<usableSize; i++){ - if( hit[i]==0 ){ - cnt++; - }else if( hit[i]>1 ){ - checkAppendMsg(pCheck, 0, - "Multiple uses for byte %d of page %d", i, iPage); - break; - } - } - if( cnt!=data[hdr+7] ){ - checkAppendMsg(pCheck, 0, - "Fragmented space is %d byte reported as %d on page %d", - cnt, data[hdr+7], iPage); - } - } - sqliteFree(hit); - - releasePage(pPage); - return depth+1; -} -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK -/* -** This routine does a complete check of the given BTree file. aRoot[] is -** an array of pages numbers were each page number is the root page of -** a table. nRoot is the number of entries in aRoot. -** -** If everything checks out, this routine returns NULL. If something is -** amiss, an error message is written into memory obtained from malloc() -** and a pointer to that error message is returned. The calling function -** is responsible for freeing the error message when it is done. -*/ -char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ - int i; - int nRef; - IntegrityCk sCheck; - - nRef = *sqlite3pager_stats(pBt->pPager); - if( lockBtreeWithRetry(pBt)!=SQLITE_OK ){ - return sqliteStrDup("Unable to acquire a read lock on the database"); - } - sCheck.pBt = pBt; - sCheck.pPager = pBt->pPager; - sCheck.nPage = sqlite3pager_pagecount(sCheck.pPager); - if( sCheck.nPage==0 ){ - unlockBtreeIfUnused(pBt); - return 0; - } - sCheck.anRef = sqliteMallocRaw( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) ); - if( !sCheck.anRef ){ - unlockBtreeIfUnused(pBt); - return sqlite3MPrintf("Unable to malloc %d bytes", - (sCheck.nPage+1)*sizeof(sCheck.anRef[0])); - } - for(i=0; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; } - i = PENDING_BYTE_PAGE(pBt); - if( i<=sCheck.nPage ){ - sCheck.anRef[i] = 1; - } - sCheck.zErrMsg = 0; - - /* Check the integrity of the freelist - */ - checkList(&sCheck, 1, get4byte(&pBt->pPage1->aData[32]), - get4byte(&pBt->pPage1->aData[36]), "Main freelist: "); - - /* Check all the tables. - */ - for(i=0; i<nRoot; i++){ - if( aRoot[i]==0 ) continue; -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum && aRoot[i]>1 ){ - checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0); - } -#endif - checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ", 0,0,0,0); - } - - /* Make sure every page in the file is referenced - */ - for(i=1; i<=sCheck.nPage; i++){ -#ifdef SQLITE_OMIT_AUTOVACUUM - if( sCheck.anRef[i]==0 ){ - checkAppendMsg(&sCheck, 0, "Page %d is never used", i); - } -#else - /* If the database supports auto-vacuum, make sure no tables contain - ** references to pointer-map pages. - */ - if( sCheck.anRef[i]==0 && - (PTRMAP_PAGENO(pBt->usableSize, i)!=i || !pBt->autoVacuum) ){ - checkAppendMsg(&sCheck, 0, "Page %d is never used", i); - } - if( sCheck.anRef[i]!=0 && - (PTRMAP_PAGENO(pBt->usableSize, i)==i && pBt->autoVacuum) ){ - checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); - } -#endif - } - - /* Make sure this analysis did not leave any unref() pages - */ - unlockBtreeIfUnused(pBt); - if( nRef != *sqlite3pager_stats(pBt->pPager) ){ - checkAppendMsg(&sCheck, 0, - "Outstanding page count goes from %d to %d during this analysis", - nRef, *sqlite3pager_stats(pBt->pPager) - ); - } - - /* Clean up and report errors. - */ - sqliteFree(sCheck.anRef); - return sCheck.zErrMsg; -} -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -/* -** Return the full pathname of the underlying database file. -*/ -const char *sqlite3BtreeGetFilename(Btree *pBt){ - assert( pBt->pPager!=0 ); - return sqlite3pager_filename(pBt->pPager); -} - -/* -** Return the pathname of the directory that contains the database file. -*/ -const char *sqlite3BtreeGetDirname(Btree *pBt){ - assert( pBt->pPager!=0 ); - return sqlite3pager_dirname(pBt->pPager); -} - -/* -** Return the pathname of the journal file for this database. The return -** value of this routine is the same regardless of whether the journal file -** has been created or not. -*/ -const char *sqlite3BtreeGetJournalname(Btree *pBt){ - assert( pBt->pPager!=0 ); - return sqlite3pager_journalname(pBt->pPager); -} - -#ifndef SQLITE_OMIT_VACUUM -/* -** Copy the complete content of pBtFrom into pBtTo. A transaction -** must be active for both files. -** -** The size of file pBtFrom may be reduced by this operation. -** If anything goes wrong, the transaction on pBtFrom is rolled back. -*/ -int sqlite3BtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){ - int rc = SQLITE_OK; - Pgno i, nPage, nToPage, iSkip; - - if( pBtTo->inTrans!=TRANS_WRITE || pBtFrom->inTrans!=TRANS_WRITE ){ - return SQLITE_ERROR; - } - if( pBtTo->pCursor ) return SQLITE_BUSY; - nToPage = sqlite3pager_pagecount(pBtTo->pPager); - nPage = sqlite3pager_pagecount(pBtFrom->pPager); - iSkip = PENDING_BYTE_PAGE(pBtTo); - for(i=1; rc==SQLITE_OK && i<=nPage; i++){ - void *pPage; - if( i==iSkip ) continue; - rc = sqlite3pager_get(pBtFrom->pPager, i, &pPage); - if( rc ) break; - rc = sqlite3pager_overwrite(pBtTo->pPager, i, pPage); - if( rc ) break; - sqlite3pager_unref(pPage); - } - for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){ - void *pPage; - if( i==iSkip ) continue; - rc = sqlite3pager_get(pBtTo->pPager, i, &pPage); - if( rc ) break; - rc = sqlite3pager_write(pPage); - sqlite3pager_unref(pPage); - sqlite3pager_dont_write(pBtTo->pPager, i); - } - if( !rc && nPage<nToPage ){ - rc = sqlite3pager_truncate(pBtTo->pPager, nPage); - } - if( rc ){ - sqlite3BtreeRollback(pBtTo); - } - return rc; -} -#endif /* SQLITE_OMIT_VACUUM */ - -/* -** Return non-zero if a transaction is active. -*/ -int sqlite3BtreeIsInTrans(Btree *pBt){ - return (pBt && (pBt->inTrans==TRANS_WRITE)); -} - -/* -** Return non-zero if a statement transaction is active. -*/ -int sqlite3BtreeIsInStmt(Btree *pBt){ - return (pBt && pBt->inStmt); -} - -/* -** This call is a no-op if no write-transaction is currently active on pBt. -** -** Otherwise, sync the database file for the btree pBt. zMaster points to -** the name of a master journal file that should be written into the -** individual journal file, or is NULL, indicating no master journal file -** (single database transaction). -** -** When this is called, the master journal should already have been -** created, populated with this journal pointer and synced to disk. -** -** Once this is routine has returned, the only thing required to commit -** the write-transaction for this database file is to delete the journal. -*/ -int sqlite3BtreeSync(Btree *pBt, const char *zMaster){ - if( pBt->inTrans==TRANS_WRITE ){ -#ifndef SQLITE_OMIT_AUTOVACUUM - Pgno nTrunc = 0; - if( pBt->autoVacuum ){ - int rc = autoVacuumCommit(pBt, &nTrunc); - if( rc!=SQLITE_OK ) return rc; - } - return sqlite3pager_sync(pBt->pPager, zMaster, nTrunc); -#endif - return sqlite3pager_sync(pBt->pPager, zMaster, 0); - } - return SQLITE_OK; -} - -#ifndef SQLITE_OMIT_GLOBALRECOVER -/* -** Reset the btree and underlying pager after a malloc() failure. Any -** transaction that was active when malloc() failed is rolled back. -*/ -int sqlite3BtreeReset(Btree *pBt){ - if( pBt->pCursor ) return SQLITE_BUSY; - pBt->inTrans = TRANS_NONE; - unlockBtreeIfUnused(pBt); - return sqlite3pager_reset(pBt->pPager); -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/btree.h b/ext/pdo_sqlite/sqlite/src/btree.h deleted file mode 100644 index 9d4401ac81851..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/btree.h +++ /dev/null @@ -1,144 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite B-Tree file -** subsystem. See comments in the source code for a detailed description -** of what each interface routine does. -** -** @(#) $Id$ -*/ -#ifndef _BTREE_H_ -#define _BTREE_H_ - -/* TODO: This definition is just included so other modules compile. It -** needs to be revisited. -*/ -#define SQLITE_N_BTREE_META 10 - -/* -** If defined as non-zero, auto-vacuum is enabled by default. Otherwise -** it must be turned on for each database using "PRAGMA auto_vacuum = 1". -*/ -#ifndef SQLITE_DEFAULT_AUTOVACUUM - #define SQLITE_DEFAULT_AUTOVACUUM 0 -#endif - -/* -** Forward declarations of structure -*/ -typedef struct Btree Btree; -typedef struct BtCursor BtCursor; - - -int sqlite3BtreeOpen( - const char *zFilename, /* Name of database file to open */ - Btree **, /* Return open Btree* here */ - int flags /* Flags */ -); - -/* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the -** following values. -** -** NOTE: These values must match the corresponding PAGER_ values in -** pager.h. -*/ -#define BTREE_OMIT_JOURNAL 1 /* Do not use journal. No argument */ -#define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */ -#define BTREE_MEMORY 4 /* In-memory DB. No argument */ - -int sqlite3BtreeClose(Btree*); -int sqlite3BtreeSetBusyHandler(Btree*,BusyHandler*); -int sqlite3BtreeSetCacheSize(Btree*,int); -int sqlite3BtreeSetSafetyLevel(Btree*,int); -int sqlite3BtreeSyncDisabled(Btree*); -int sqlite3BtreeSetPageSize(Btree*,int,int); -int sqlite3BtreeGetPageSize(Btree*); -int sqlite3BtreeGetReserve(Btree*); -int sqlite3BtreeSetAutoVacuum(Btree *, int); -int sqlite3BtreeGetAutoVacuum(Btree *); -int sqlite3BtreeBeginTrans(Btree*,int); -int sqlite3BtreeCommit(Btree*); -int sqlite3BtreeRollback(Btree*); -int sqlite3BtreeBeginStmt(Btree*); -int sqlite3BtreeCommitStmt(Btree*); -int sqlite3BtreeRollbackStmt(Btree*); -int sqlite3BtreeCreateTable(Btree*, int*, int flags); -int sqlite3BtreeIsInTrans(Btree*); -int sqlite3BtreeIsInStmt(Btree*); -int sqlite3BtreeSync(Btree*, const char *zMaster); -int sqlite3BtreeReset(Btree *); - -const char *sqlite3BtreeGetFilename(Btree *); -const char *sqlite3BtreeGetDirname(Btree *); -const char *sqlite3BtreeGetJournalname(Btree *); -int sqlite3BtreeCopyFile(Btree *, Btree *); - -/* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR -** of the following flags: -*/ -#define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */ -#define BTREE_ZERODATA 2 /* Table has keys only - no data */ -#define BTREE_LEAFDATA 4 /* Data stored in leaves only. Implies INTKEY */ - -int sqlite3BtreeDropTable(Btree*, int, int*); -int sqlite3BtreeClearTable(Btree*, int); -int sqlite3BtreeGetMeta(Btree*, int idx, u32 *pValue); -int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value); - -int sqlite3BtreeCursor( - Btree*, /* BTree containing table to open */ - int iTable, /* Index of root page */ - int wrFlag, /* 1 for writing. 0 for read-only */ - int(*)(void*,int,const void*,int,const void*), /* Key comparison function */ - void*, /* First argument to compare function */ - BtCursor **ppCursor /* Returned cursor */ -); - -void sqlite3BtreeSetCompare( - BtCursor *, - int(*)(void*,int,const void*,int,const void*), - void* -); - -int sqlite3BtreeCloseCursor(BtCursor*); -int sqlite3BtreeMoveto(BtCursor*, const void *pKey, i64 nKey, int *pRes); -int sqlite3BtreeDelete(BtCursor*); -int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey, - const void *pData, int nData); -int sqlite3BtreeFirst(BtCursor*, int *pRes); -int sqlite3BtreeLast(BtCursor*, int *pRes); -int sqlite3BtreeNext(BtCursor*, int *pRes); -int sqlite3BtreeEof(BtCursor*); -int sqlite3BtreeFlags(BtCursor*); -int sqlite3BtreePrevious(BtCursor*, int *pRes); -int sqlite3BtreeKeySize(BtCursor*, i64 *pSize); -int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*); -const void *sqlite3BtreeKeyFetch(BtCursor*, int *pAmt); -const void *sqlite3BtreeDataFetch(BtCursor*, int *pAmt); -int sqlite3BtreeDataSize(BtCursor*, u32 *pSize); -int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*); - -char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot); -struct Pager *sqlite3BtreePager(Btree*); - - -#ifdef SQLITE_TEST -int sqlite3BtreeCursorInfo(BtCursor*, int*, int); -void sqlite3BtreeCursorList(Btree*); -#endif - -#ifdef SQLITE_DEBUG -int sqlite3BtreePageDump(Btree*, int, int recursive); -#else -#define sqlite3BtreePageDump(X,Y,Z) SQLITE_OK -#endif - -#endif /* _BTREE_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/build.c b/ext/pdo_sqlite/sqlite/src/build.c deleted file mode 100644 index 537eede8c001a..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/build.c +++ /dev/null @@ -1,2938 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <ctype.h> - -/* -** This routine is called when a new SQL statement is beginning to -** be parsed. Initialize the pParse structure as needed. -*/ -void sqlite3BeginParse(Parse *pParse, int explainFlag){ - pParse->explain = explainFlag; - pParse->nVar = 0; -} - -/* -** This routine is called after a single SQL statement has been -** parsed and a VDBE program to execute that statement has been -** prepared. This routine puts the finishing touches on the -** VDBE program and resets the pParse structure for the next -** parse. -** -** Note that if an error occurred, it might be the case that -** no VDBE code was generated. -*/ -void sqlite3FinishCoding(Parse *pParse){ - sqlite3 *db; - Vdbe *v; - - if( sqlite3_malloc_failed ) return; - if( pParse->nested ) return; - if( !pParse->pVdbe ){ - if( pParse->rc==SQLITE_OK && pParse->nErr ){ - pParse->rc = SQLITE_ERROR; - } - return; - } - - /* Begin by generating some termination code at the end of the - ** vdbe program - */ - db = pParse->db; - v = sqlite3GetVdbe(pParse); - if( v ){ - sqlite3VdbeAddOp(v, OP_Halt, 0, 0); - - /* The cookie mask contains one bit for each database file open. - ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are - ** set for each database that is used. Generate code to start a - ** transaction on each used database and to verify the schema cookie - ** on each used database. - */ - if( pParse->cookieGoto>0 ){ - u32 mask; - int iDb; - sqlite3VdbeJumpHere(v, pParse->cookieGoto-1); - for(iDb=0, mask=1; iDb<db->nDb; mask<<=1, iDb++){ - if( (mask & pParse->cookieMask)==0 ) continue; - sqlite3VdbeAddOp(v, OP_Transaction, iDb, (mask & pParse->writeMask)!=0); - sqlite3VdbeAddOp(v, OP_VerifyCookie, iDb, pParse->cookieValue[iDb]); - } - sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->cookieGoto); - } - -#ifndef SQLITE_OMIT_TRACE - /* Add a No-op that contains the complete text of the compiled SQL - ** statement as its P3 argument. This does not change the functionality - ** of the program. - ** - ** This is used to implement sqlite3_trace(). - */ - sqlite3VdbeOp3(v, OP_Noop, 0, 0, pParse->zSql, pParse->zTail-pParse->zSql); -#endif /* SQLITE_OMIT_TRACE */ - } - - - /* Get the VDBE program ready for execution - */ - if( v && pParse->nErr==0 ){ - FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; - sqlite3VdbeTrace(v, trace); - sqlite3VdbeMakeReady(v, pParse->nVar, pParse->nMem+3, - pParse->nTab+3, pParse->explain); - pParse->rc = SQLITE_DONE; - pParse->colNamesSet = 0; - }else if( pParse->rc==SQLITE_OK ){ - pParse->rc = SQLITE_ERROR; - } - pParse->nTab = 0; - pParse->nMem = 0; - pParse->nSet = 0; - pParse->nVar = 0; - pParse->cookieMask = 0; - pParse->cookieGoto = 0; -} - -/* -** Run the parser and code generator recursively in order to generate -** code for the SQL statement given onto the end of the pParse context -** currently under construction. When the parser is run recursively -** this way, the final OP_Halt is not appended and other initialization -** and finalization steps are omitted because those are handling by the -** outermost parser. -** -** Not everything is nestable. This facility is designed to permit -** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use -** care if you decide to try to use this routine for some other purposes. -*/ -void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){ - va_list ap; - char *zSql; -# define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar)) - char saveBuf[SAVE_SZ]; - - if( pParse->nErr ) return; - assert( pParse->nested<10 ); /* Nesting should only be of limited depth */ - va_start(ap, zFormat); - zSql = sqlite3VMPrintf(zFormat, ap); - va_end(ap); - if( zSql==0 ){ - return; /* A malloc must have failed */ - } - pParse->nested++; - memcpy(saveBuf, &pParse->nVar, SAVE_SZ); - memset(&pParse->nVar, 0, SAVE_SZ); - sqlite3RunParser(pParse, zSql, 0); - sqliteFree(zSql); - memcpy(&pParse->nVar, saveBuf, SAVE_SZ); - pParse->nested--; -} - -/* -** Locate the in-memory structure that describes a particular database -** table given the name of that table and (optionally) the name of the -** database containing the table. Return NULL if not found. -** -** If zDatabase is 0, all databases are searched for the table and the -** first matching table is returned. (No checking for duplicate table -** names is done.) The search order is TEMP first, then MAIN, then any -** auxiliary databases added using the ATTACH command. -** -** See also sqlite3LocateTable(). -*/ -Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){ - Table *p = 0; - int i; - assert( zName!=0 ); - assert( (db->flags & SQLITE_Initialized) || db->init.busy ); - for(i=OMIT_TEMPDB; i<db->nDb; i++){ - int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; - p = sqlite3HashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1); - if( p ) break; - } - return p; -} - -/* -** Locate the in-memory structure that describes a particular database -** table given the name of that table and (optionally) the name of the -** database containing the table. Return NULL if not found. Also leave an -** error message in pParse->zErrMsg. -** -** The difference between this routine and sqlite3FindTable() is that this -** routine leaves an error message in pParse->zErrMsg where -** sqlite3FindTable() does not. -*/ -Table *sqlite3LocateTable(Parse *pParse, const char *zName, const char *zDbase){ - Table *p; - - /* Read the database schema. If an error occurs, leave an error message - ** and code in pParse and return NULL. */ - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - return 0; - } - - p = sqlite3FindTable(pParse->db, zName, zDbase); - if( p==0 ){ - if( zDbase ){ - sqlite3ErrorMsg(pParse, "no such table: %s.%s", zDbase, zName); - }else{ - sqlite3ErrorMsg(pParse, "no such table: %s", zName); - } - pParse->checkSchema = 1; - } - return p; -} - -/* -** Locate the in-memory structure that describes -** a particular index given the name of that index -** and the name of the database that contains the index. -** Return NULL if not found. -** -** If zDatabase is 0, all databases are searched for the -** table and the first matching index is returned. (No checking -** for duplicate index names is done.) The search order is -** TEMP first, then MAIN, then any auxiliary databases added -** using the ATTACH command. -*/ -Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){ - Index *p = 0; - int i; - assert( (db->flags & SQLITE_Initialized) || db->init.busy ); - for(i=OMIT_TEMPDB; i<db->nDb; i++){ - int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue; - p = sqlite3HashFind(&db->aDb[j].idxHash, zName, strlen(zName)+1); - if( p ) break; - } - return p; -} - -/* -** Reclaim the memory used by an index -*/ -static void freeIndex(Index *p){ - sqliteFree(p->zColAff); - sqliteFree(p); -} - -/* -** Remove the given index from the index hash table, and free -** its memory structures. -** -** The index is removed from the database hash tables but -** it is not unlinked from the Table that it indexes. -** Unlinking from the Table must be done by the calling function. -*/ -static void sqliteDeleteIndex(sqlite3 *db, Index *p){ - Index *pOld; - - assert( db!=0 && p->zName!=0 ); - pOld = sqlite3HashInsert(&db->aDb[p->iDb].idxHash, p->zName, - strlen(p->zName)+1, 0); - assert( pOld==0 || pOld==p ); - freeIndex(p); -} - -/* -** For the index called zIdxName which is found in the database iDb, -** unlike that index from its Table then remove the index from -** the index hash table and free all memory structures associated -** with the index. -*/ -void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){ - Index *pIndex; - int len; - - len = strlen(zIdxName); - pIndex = sqlite3HashInsert(&db->aDb[iDb].idxHash, zIdxName, len+1, 0); - if( pIndex ){ - if( pIndex->pTable->pIndex==pIndex ){ - pIndex->pTable->pIndex = pIndex->pNext; - }else{ - Index *p; - for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){} - if( p && p->pNext==pIndex ){ - p->pNext = pIndex->pNext; - } - } - freeIndex(pIndex); - } - db->flags |= SQLITE_InternChanges; -} - -/* -** Erase all schema information from the in-memory hash tables of -** a single database. This routine is called to reclaim memory -** before the database closes. It is also called during a rollback -** if there were schema changes during the transaction or if a -** schema-cookie mismatch occurs. -** -** If iDb<=0 then reset the internal schema tables for all database -** files. If iDb>=2 then reset the internal schema for only the -** single file indicated. -*/ -void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){ - HashElem *pElem; - Hash temp1; - Hash temp2; - int i, j; - - assert( iDb>=0 && iDb<db->nDb ); - db->flags &= ~SQLITE_Initialized; - for(i=iDb; i<db->nDb; i++){ - Db *pDb = &db->aDb[i]; - temp1 = pDb->tblHash; - temp2 = pDb->trigHash; - sqlite3HashInit(&pDb->trigHash, SQLITE_HASH_STRING, 0); - sqlite3HashClear(&pDb->aFKey); - sqlite3HashClear(&pDb->idxHash); - for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ - sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem)); - } - sqlite3HashClear(&temp2); - sqlite3HashInit(&pDb->tblHash, SQLITE_HASH_STRING, 0); - for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ - Table *pTab = sqliteHashData(pElem); - sqlite3DeleteTable(db, pTab); - } - sqlite3HashClear(&temp1); - pDb->pSeqTab = 0; - DbClearProperty(db, i, DB_SchemaLoaded); - if( iDb>0 ) return; - } - assert( iDb==0 ); - db->flags &= ~SQLITE_InternChanges; - - /* If one or more of the auxiliary database files has been closed, - ** then remove then from the auxiliary database list. We take the - ** opportunity to do this here since we have just deleted all of the - ** schema hash tables and therefore do not have to make any changes - ** to any of those tables. - */ - for(i=0; i<db->nDb; i++){ - struct Db *pDb = &db->aDb[i]; - if( pDb->pBt==0 ){ - if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); - pDb->pAux = 0; - } - } - for(i=j=2; i<db->nDb; i++){ - struct Db *pDb = &db->aDb[i]; - if( pDb->pBt==0 ){ - sqliteFree(pDb->zName); - pDb->zName = 0; - continue; - } - if( j<i ){ - db->aDb[j] = db->aDb[i]; - } - j++; - } - memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j])); - db->nDb = j; - if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ - memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0])); - sqliteFree(db->aDb); - db->aDb = db->aDbStatic; - } -} - -/* -** This routine is called whenever a rollback occurs. If there were -** schema changes during the transaction, then we have to reset the -** internal hash tables and reload them from disk. -*/ -void sqlite3RollbackInternalChanges(sqlite3 *db){ - if( db->flags & SQLITE_InternChanges ){ - sqlite3ResetInternalSchema(db, 0); - } -} - -/* -** This routine is called when a commit occurs. -*/ -void sqlite3CommitInternalChanges(sqlite3 *db){ - db->flags &= ~SQLITE_InternChanges; -} - -/* -** Clear the column names from a table or view. -*/ -static void sqliteResetColumnNames(Table *pTable){ - int i; - Column *pCol; - assert( pTable!=0 ); - if( (pCol = pTable->aCol)!=0 ){ - for(i=0; i<pTable->nCol; i++, pCol++){ - sqliteFree(pCol->zName); - sqlite3ExprDelete(pCol->pDflt); - sqliteFree(pCol->zType); - } - sqliteFree(pTable->aCol); - } - pTable->aCol = 0; - pTable->nCol = 0; -} - -/* -** Remove the memory data structures associated with the given -** Table. No changes are made to disk by this routine. -** -** This routine just deletes the data structure. It does not unlink -** the table data structure from the hash table. Nor does it remove -** foreign keys from the sqlite.aFKey hash table. But it does destroy -** memory structures of the indices and foreign keys associated with -** the table. -** -** Indices associated with the table are unlinked from the "db" -** data structure if db!=NULL. If db==NULL, indices attached to -** the table are deleted, but it is assumed they have already been -** unlinked. -*/ -void sqlite3DeleteTable(sqlite3 *db, Table *pTable){ - Index *pIndex, *pNext; - FKey *pFKey, *pNextFKey; - - if( pTable==0 ) return; - - /* Do not delete the table until the reference count reaches zero. */ - pTable->nRef--; - if( pTable->nRef>0 ){ - return; - } - assert( pTable->nRef==0 ); - - /* Delete all indices associated with this table - */ - for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ - pNext = pIndex->pNext; - assert( pIndex->iDb==pTable->iDb || (pTable->iDb==0 && pIndex->iDb==1) ); - sqliteDeleteIndex(db, pIndex); - } - -#ifndef SQLITE_OMIT_FOREIGN_KEY - /* Delete all foreign keys associated with this table. The keys - ** should have already been unlinked from the db->aFKey hash table - */ - for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ - pNextFKey = pFKey->pNextFrom; - assert( pTable->iDb<db->nDb ); - assert( sqlite3HashFind(&db->aDb[pTable->iDb].aFKey, - pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey ); - sqliteFree(pFKey); - } -#endif - - /* Delete the Table structure itself. - */ - sqliteResetColumnNames(pTable); - sqliteFree(pTable->zName); - sqliteFree(pTable->zColAff); - sqlite3SelectDelete(pTable->pSelect); - sqliteFree(pTable); -} - -/* -** Unlink the given table from the hash tables and the delete the -** table structure with all its indices and foreign keys. -*/ -void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){ - Table *p; - FKey *pF1, *pF2; - Db *pDb; - - assert( db!=0 ); - assert( iDb>=0 && iDb<db->nDb ); - assert( zTabName && zTabName[0] ); - pDb = &db->aDb[iDb]; - p = sqlite3HashInsert(&pDb->tblHash, zTabName, strlen(zTabName)+1, 0); - if( p ){ -#ifndef SQLITE_OMIT_FOREIGN_KEY - for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ - int nTo = strlen(pF1->zTo) + 1; - pF2 = sqlite3HashFind(&pDb->aFKey, pF1->zTo, nTo); - if( pF2==pF1 ){ - sqlite3HashInsert(&pDb->aFKey, pF1->zTo, nTo, pF1->pNextTo); - }else{ - while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } - if( pF2 ){ - pF2->pNextTo = pF1->pNextTo; - } - } - } -#endif - sqlite3DeleteTable(db, p); - } - db->flags |= SQLITE_InternChanges; -} - -/* -** Given a token, return a string that consists of the text of that -** token with any quotations removed. Space to hold the returned string -** is obtained from sqliteMalloc() and must be freed by the calling -** function. -** -** Tokens are often just pointers into the original SQL text and so -** are not \000 terminated and are not persistent. The returned string -** is \000 terminated and is persistent. -*/ -char *sqlite3NameFromToken(Token *pName){ - char *zName; - if( pName ){ - zName = sqliteStrNDup(pName->z, pName->n); - sqlite3Dequote(zName); - }else{ - zName = 0; - } - return zName; -} - -/* -** Open the sqlite_master table stored in database number iDb for -** writing. The table is opened using cursor 0. -*/ -void sqlite3OpenMasterTable(Vdbe *v, int iDb){ - sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, 0, MASTER_ROOT); - sqlite3VdbeAddOp(v, OP_SetNumColumns, 0, 5); /* sqlite_master has 5 columns */ -} - -/* -** The token *pName contains the name of a database (either "main" or -** "temp" or the name of an attached db). This routine returns the -** index of the named database in db->aDb[], or -1 if the named db -** does not exist. -*/ -int sqlite3FindDb(sqlite3 *db, Token *pName){ - int i = -1; /* Database number */ - int n; /* Number of characters in the name */ - Db *pDb; /* A database whose name space is being searched */ - char *zName; /* Name we are searching for */ - - zName = sqlite3NameFromToken(pName); - if( zName ){ - n = strlen(zName); - for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ - if( (!OMIT_TEMPDB || i!=1 ) && n==strlen(pDb->zName) && - 0==sqlite3StrICmp(pDb->zName, zName) ){ - break; - } - } - sqliteFree(zName); - } - return i; -} - -/* The table or view or trigger name is passed to this routine via tokens -** pName1 and pName2. If the table name was fully qualified, for example: -** -** CREATE TABLE xxx.yyy (...); -** -** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if -** the table name is not fully qualified, i.e.: -** -** CREATE TABLE yyy(...); -** -** Then pName1 is set to "yyy" and pName2 is "". -** -** This routine sets the *ppUnqual pointer to point at the token (pName1 or -** pName2) that stores the unqualified table name. The index of the -** database "xxx" is returned. -*/ -int sqlite3TwoPartName( - Parse *pParse, /* Parsing and code generating context */ - Token *pName1, /* The "xxx" in the name "xxx.yyy" or "xxx" */ - Token *pName2, /* The "yyy" in the name "xxx.yyy" */ - Token **pUnqual /* Write the unqualified object name here */ -){ - int iDb; /* Database holding the object */ - sqlite3 *db = pParse->db; - - if( pName2 && pName2->n>0 ){ - assert( !db->init.busy ); - *pUnqual = pName2; - iDb = sqlite3FindDb(db, pName1); - if( iDb<0 ){ - sqlite3ErrorMsg(pParse, "unknown database %T", pName1); - pParse->nErr++; - return -1; - } - }else{ - assert( db->init.iDb==0 || db->init.busy ); - iDb = db->init.iDb; - *pUnqual = pName1; - } - return iDb; -} - -/* -** This routine is used to check if the UTF-8 string zName is a legal -** unqualified name for a new schema object (table, index, view or -** trigger). All names are legal except those that begin with the string -** "sqlite_" (in upper, lower or mixed case). This portion of the namespace -** is reserved for internal use. -*/ -int sqlite3CheckObjectName(Parse *pParse, const char *zName){ - if( !pParse->db->init.busy && pParse->nested==0 - && (pParse->db->flags & SQLITE_WriteSchema)==0 - && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ - sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName); - return SQLITE_ERROR; - } - return SQLITE_OK; -} - -/* -** Begin constructing a new table representation in memory. This is -** the first of several action routines that get called in response -** to a CREATE TABLE statement. In particular, this routine is called -** after seeing tokens "CREATE" and "TABLE" and the table name. The -** pStart token is the CREATE and pName is the table name. The isTemp -** flag is true if the table should be stored in the auxiliary database -** file instead of in the main database file. This is normally the case -** when the "TEMP" or "TEMPORARY" keyword occurs in between -** CREATE and TABLE. -** -** The new table record is initialized and put in pParse->pNewTable. -** As more of the CREATE TABLE statement is parsed, additional action -** routines will be called to add more information to this record. -** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine -** is called to complete the construction of the new table record. -*/ -void sqlite3StartTable( - Parse *pParse, /* Parser context */ - Token *pStart, /* The "CREATE" token */ - Token *pName1, /* First part of the name of the table or view */ - Token *pName2, /* Second part of the name of the table or view */ - int isTemp, /* True if this is a TEMP table */ - int isView /* True if this is a VIEW */ -){ - Table *pTable; - char *zName = 0; /* The name of the new table */ - sqlite3 *db = pParse->db; - Vdbe *v; - int iDb; /* Database number to create the table in */ - Token *pName; /* Unqualified name of the table to create */ - - /* The table or view name to create is passed to this routine via tokens - ** pName1 and pName2. If the table name was fully qualified, for example: - ** - ** CREATE TABLE xxx.yyy (...); - ** - ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if - ** the table name is not fully qualified, i.e.: - ** - ** CREATE TABLE yyy(...); - ** - ** Then pName1 is set to "yyy" and pName2 is "". - ** - ** The call below sets the pName pointer to point at the token (pName1 or - ** pName2) that stores the unqualified table name. The variable iDb is - ** set to the index of the database that the table or view is to be - ** created in. - */ - iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); - if( iDb<0 ) return; - if( !OMIT_TEMPDB && isTemp && iDb>1 ){ - /* If creating a temp table, the name may not be qualified */ - sqlite3ErrorMsg(pParse, "temporary table name must be unqualified"); - return; - } - if( !OMIT_TEMPDB && isTemp ) iDb = 1; - - pParse->sNameToken = *pName; - zName = sqlite3NameFromToken(pName); - if( zName==0 ) return; - if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ - goto begin_table_error; - } - if( db->init.iDb==1 ) isTemp = 1; -#ifndef SQLITE_OMIT_AUTHORIZATION - assert( (isTemp & 1)==isTemp ); - { - int code; - char *zDb = db->aDb[iDb].zName; - if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ - goto begin_table_error; - } - if( isView ){ - if( !OMIT_TEMPDB && isTemp ){ - code = SQLITE_CREATE_TEMP_VIEW; - }else{ - code = SQLITE_CREATE_VIEW; - } - }else{ - if( !OMIT_TEMPDB && isTemp ){ - code = SQLITE_CREATE_TEMP_TABLE; - }else{ - code = SQLITE_CREATE_TABLE; - } - } - if( sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){ - goto begin_table_error; - } - } -#endif - - /* Make sure the new table name does not collide with an existing - ** index or table name in the same database. Issue an error message if - ** it does. - */ - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - goto begin_table_error; - } - pTable = sqlite3FindTable(db, zName, db->aDb[iDb].zName); - if( pTable ){ - sqlite3ErrorMsg(pParse, "table %T already exists", pName); - goto begin_table_error; - } - if( sqlite3FindIndex(db, zName, 0)!=0 && (iDb==0 || !db->init.busy) ){ - sqlite3ErrorMsg(pParse, "there is already an index named %s", zName); - goto begin_table_error; - } - pTable = sqliteMalloc( sizeof(Table) ); - if( pTable==0 ){ - pParse->rc = SQLITE_NOMEM; - pParse->nErr++; - goto begin_table_error; - } - pTable->zName = zName; - pTable->nCol = 0; - pTable->aCol = 0; - pTable->iPKey = -1; - pTable->pIndex = 0; - pTable->iDb = iDb; - pTable->nRef = 1; - if( pParse->pNewTable ) sqlite3DeleteTable(db, pParse->pNewTable); - pParse->pNewTable = pTable; - - /* If this is the magic sqlite_sequence table used by autoincrement, - ** then record a pointer to this table in the main database structure - ** so that INSERT can find the table easily. - */ -#ifndef SQLITE_OMIT_AUTOINCREMENT - if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){ - db->aDb[iDb].pSeqTab = pTable; - } -#endif - - /* Begin generating the code that will insert the table record into - ** the SQLITE_MASTER table. Note in particular that we must go ahead - ** and allocate the record number for the table entry now. Before any - ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause - ** indices to be created and the table record must come before the - ** indices. Hence, the record number for the table must be allocated - ** now. - */ - if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ - int lbl; - sqlite3BeginWriteOperation(pParse, 0, iDb); - - /* If the file format and encoding in the database have not been set, - ** set them now. - */ - sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1); /* file_format */ - lbl = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_If, 0, lbl); - sqlite3VdbeAddOp(v, OP_Integer, db->file_format, 0); - sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1); - sqlite3VdbeAddOp(v, OP_Integer, db->enc, 0); - sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 4); - sqlite3VdbeResolveLabel(v, lbl); - - /* This just creates a place-holder record in the sqlite_master table. - ** The record created does not contain anything yet. It will be replaced - ** by the real entry in code generated at sqlite3EndTable(). - ** - ** The rowid for the new entry is left on the top of the stack. - ** The rowid value is needed by the code that sqlite3EndTable will - ** generate. - */ -#ifndef SQLITE_OMIT_VIEW - if( isView ){ - sqlite3VdbeAddOp(v, OP_Integer, 0, 0); - }else -#endif - { - sqlite3VdbeAddOp(v, OP_CreateTable, iDb, 0); - } - sqlite3OpenMasterTable(v, iDb); - sqlite3VdbeAddOp(v, OP_NewRowid, 0, 0); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - sqlite3VdbeAddOp(v, OP_Insert, 0, 0); - sqlite3VdbeAddOp(v, OP_Close, 0, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - } - - /* Normal (non-error) return. */ - return; - - /* If an error occurs, we jump here */ -begin_table_error: - sqliteFree(zName); - return; -} - -/* -** This macro is used to compare two strings in a case-insensitive manner. -** It is slightly faster than calling sqlite3StrICmp() directly, but -** produces larger code. -** -** WARNING: This macro is not compatible with the strcmp() family. It -** returns true if the two strings are equal, otherwise false. -*/ -#define STRICMP(x, y) (\ -sqlite3UpperToLower[*(unsigned char *)(x)]== \ -sqlite3UpperToLower[*(unsigned char *)(y)] \ -&& sqlite3StrICmp((x)+1,(y)+1)==0 ) - -/* -** Add a new column to the table currently being constructed. -** -** The parser calls this routine once for each column declaration -** in a CREATE TABLE statement. sqlite3StartTable() gets called -** first to get things going. Then this routine is called for each -** column. -*/ -void sqlite3AddColumn(Parse *pParse, Token *pName){ - Table *p; - int i; - char *z; - Column *pCol; - if( (p = pParse->pNewTable)==0 ) return; - z = sqlite3NameFromToken(pName); - if( z==0 ) return; - for(i=0; i<p->nCol; i++){ - if( STRICMP(z, p->aCol[i].zName) ){ - sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); - sqliteFree(z); - return; - } - } - if( (p->nCol & 0x7)==0 ){ - Column *aNew; - aNew = sqliteRealloc( p->aCol, (p->nCol+8)*sizeof(p->aCol[0])); - if( aNew==0 ){ - sqliteFree(z); - return; - } - p->aCol = aNew; - } - pCol = &p->aCol[p->nCol]; - memset(pCol, 0, sizeof(p->aCol[0])); - pCol->zName = z; - - /* If there is no type specified, columns have the default affinity - ** 'NONE'. If there is a type specified, then sqlite3AddColumnType() will - ** be called next to set pCol->affinity correctly. - */ - pCol->affinity = SQLITE_AFF_NONE; - pCol->pColl = pParse->db->pDfltColl; - p->nCol++; -} - -/* -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. A "NOT NULL" constraint has -** been seen on a column. This routine sets the notNull flag on -** the column currently under construction. -*/ -void sqlite3AddNotNull(Parse *pParse, int onError){ - Table *p; - int i; - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - if( i>=0 ) p->aCol[i].notNull = onError; -} - -/* -** Scan the column type name zType (length nType) and return the -** associated affinity type. -** -** This routine does a case-independent search of zType for the -** substrings in the following table. If one of the substrings is -** found, the corresponding affinity is returned. If zType contains -** more than one of the substrings, entries toward the top of -** the table take priority. For example, if zType is 'BLOBINT', -** SQLITE_AFF_INTEGER is returned. -** -** Substring | Affinity -** -------------------------------- -** 'INT' | SQLITE_AFF_INTEGER -** 'CHAR' | SQLITE_AFF_TEXT -** 'CLOB' | SQLITE_AFF_TEXT -** 'TEXT' | SQLITE_AFF_TEXT -** 'BLOB' | SQLITE_AFF_NONE -** -** If none of the substrings in the above table are found, -** SQLITE_AFF_NUMERIC is returned. -*/ -char sqlite3AffinityType(const Token *pType){ - u32 h = 0; - char aff = SQLITE_AFF_NUMERIC; - const unsigned char *zIn = pType->z; - const unsigned char *zEnd = &pType->z[pType->n]; - - while( zIn!=zEnd ){ - h = (h<<8) + sqlite3UpperToLower[*zIn]; - zIn++; - if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */ - aff = SQLITE_AFF_TEXT; - }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */ - aff = SQLITE_AFF_TEXT; - }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */ - aff = SQLITE_AFF_TEXT; - }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */ - && aff==SQLITE_AFF_NUMERIC ){ - aff = SQLITE_AFF_NONE; - }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */ - aff = SQLITE_AFF_INTEGER; - break; - } - } - - return aff; -} - -/* -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. The pFirst token is the first -** token in the sequence of tokens that describe the type of the -** column currently under construction. pLast is the last token -** in the sequence. Use this information to construct a string -** that contains the typename of the column and store that string -** in zType. -*/ -void sqlite3AddColumnType(Parse *pParse, Token *pType){ - Table *p; - int i; - Column *pCol; - - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - if( i<0 ) return; - pCol = &p->aCol[i]; - sqliteFree(pCol->zType); - pCol->zType = sqlite3NameFromToken(pType); - pCol->affinity = sqlite3AffinityType(pType); -} - -/* -** The expression is the default value for the most recently added column -** of the table currently under construction. -** -** Default value expressions must be constant. Raise an exception if this -** is not the case. -** -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. -*/ -void sqlite3AddDefaultValue(Parse *pParse, Expr *pExpr){ - Table *p; - Column *pCol; - if( (p = pParse->pNewTable)!=0 ){ - pCol = &(p->aCol[p->nCol-1]); - if( !sqlite3ExprIsConstantOrFunction(pExpr) ){ - sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant", - pCol->zName); - }else{ - sqlite3ExprDelete(pCol->pDflt); - pCol->pDflt = sqlite3ExprDup(pExpr); - } - } - sqlite3ExprDelete(pExpr); -} - -/* -** Designate the PRIMARY KEY for the table. pList is a list of names -** of columns that form the primary key. If pList is NULL, then the -** most recently added column of the table is the primary key. -** -** A table can have at most one primary key. If the table already has -** a primary key (and this is the second primary key) then create an -** error. -** -** If the PRIMARY KEY is on a single column whose datatype is INTEGER, -** then we will try to use that column as the rowid. Set the Table.iPKey -** field of the table under construction to be the index of the -** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is -** no INTEGER PRIMARY KEY. -** -** If the key is not an INTEGER PRIMARY KEY, then create a unique -** index for the key. No index is created for INTEGER PRIMARY KEYs. -*/ -void sqlite3AddPrimaryKey( - Parse *pParse, /* Parsing context */ - ExprList *pList, /* List of field names to be indexed */ - int onError, /* What to do with a uniqueness conflict */ - int autoInc /* True if the AUTOINCREMENT keyword is present */ -){ - Table *pTab = pParse->pNewTable; - char *zType = 0; - int iCol = -1, i; - if( pTab==0 ) goto primary_key_exit; - if( pTab->hasPrimKey ){ - sqlite3ErrorMsg(pParse, - "table \"%s\" has more than one primary key", pTab->zName); - goto primary_key_exit; - } - pTab->hasPrimKey = 1; - if( pList==0 ){ - iCol = pTab->nCol - 1; - pTab->aCol[iCol].isPrimKey = 1; - }else{ - for(i=0; i<pList->nExpr; i++){ - for(iCol=0; iCol<pTab->nCol; iCol++){ - if( sqlite3StrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){ - break; - } - } - if( iCol<pTab->nCol ){ - pTab->aCol[iCol].isPrimKey = 1; - } - } - if( pList->nExpr>1 ) iCol = -1; - } - if( iCol>=0 && iCol<pTab->nCol ){ - zType = pTab->aCol[iCol].zType; - } - if( zType && sqlite3StrICmp(zType, "INTEGER")==0 ){ - pTab->iPKey = iCol; - pTab->keyConf = onError; - pTab->autoInc = autoInc; - }else if( autoInc ){ -#ifndef SQLITE_OMIT_AUTOINCREMENT - sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an " - "INTEGER PRIMARY KEY"); -#endif - }else{ - sqlite3CreateIndex(pParse, 0, 0, 0, pList, onError, 0, 0); - pList = 0; - } - -primary_key_exit: - sqlite3ExprListDelete(pList); - return; -} - -/* -** Set the collation function of the most recently parsed table column -** to the CollSeq given. -*/ -void sqlite3AddCollateType(Parse *pParse, const char *zType, int nType){ - Table *p; - Index *pIdx; - CollSeq *pColl; - int i; - - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - - pColl = sqlite3LocateCollSeq(pParse, zType, nType); - p->aCol[i].pColl = pColl; - - /* If the column is declared as "<name> PRIMARY KEY COLLATE <type>", - ** then an index may have been created on this column before the - ** collation type was added. Correct this if it is the case. - */ - for(pIdx = p->pIndex; pIdx; pIdx=pIdx->pNext){ - assert( pIdx->nColumn==1 ); - if( pIdx->aiColumn[0]==i ) pIdx->keyInfo.aColl[0] = pColl; - } -} - -/* -** Call sqlite3CheckCollSeq() for all collating sequences in an index, -** in order to verify that all the necessary collating sequences are -** loaded. -*/ -int sqlite3CheckIndexCollSeq(Parse *pParse, Index *pIdx){ - if( pIdx ){ - int i; - for(i=0; i<pIdx->nColumn; i++){ - if( sqlite3CheckCollSeq(pParse, pIdx->keyInfo.aColl[i]) ){ - return SQLITE_ERROR; - } - } - } - return SQLITE_OK; -} - -/* -** This function returns the collation sequence for database native text -** encoding identified by the string zName, length nName. -** -** If the requested collation sequence is not available, or not available -** in the database native encoding, the collation factory is invoked to -** request it. If the collation factory does not supply such a sequence, -** and the sequence is available in another text encoding, then that is -** returned instead. -** -** If no versions of the requested collations sequence are available, or -** another error occurs, NULL is returned and an error message written into -** pParse. -*/ -CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){ - sqlite3 *db = pParse->db; - u8 enc = db->enc; - u8 initbusy = db->init.busy; - - CollSeq *pColl = sqlite3FindCollSeq(db, enc, zName, nName, initbusy); - if( !initbusy && (!pColl || !pColl->xCmp) ){ - pColl = sqlite3GetCollSeq(db, pColl, zName, nName); - if( !pColl ){ - if( nName<0 ){ - nName = strlen(zName); - } - sqlite3ErrorMsg(pParse, "no such collation sequence: %.*s", nName, zName); - pColl = 0; - } - } - - return pColl; -} - - -/* -** Generate code that will increment the schema cookie. -** -** The schema cookie is used to determine when the schema for the -** database changes. After each schema change, the cookie value -** changes. When a process first reads the schema it records the -** cookie. Thereafter, whenever it goes to access the database, -** it checks the cookie to make sure the schema has not changed -** since it was last read. -** -** This plan is not completely bullet-proof. It is possible for -** the schema to change multiple times and for the cookie to be -** set back to prior value. But schema changes are infrequent -** and the probability of hitting the same cookie value is only -** 1 chance in 2^32. So we're safe enough. -*/ -void sqlite3ChangeCookie(sqlite3 *db, Vdbe *v, int iDb){ - sqlite3VdbeAddOp(v, OP_Integer, db->aDb[iDb].schema_cookie+1, 0); - sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 0); -} - -/* -** Measure the number of characters needed to output the given -** identifier. The number returned includes any quotes used -** but does not include the null terminator. -** -** The estimate is conservative. It might be larger that what is -** really needed. -*/ -static int identLength(const char *z){ - int n; - for(n=0; *z; n++, z++){ - if( *z=='"' ){ n++; } - } - return n + 2; -} - -/* -** Write an identifier onto the end of the given string. Add -** quote characters as needed. -*/ -static void identPut(char *z, int *pIdx, char *zSignedIdent){ - unsigned char *zIdent = (unsigned char*)zSignedIdent; - int i, j, needQuote; - i = *pIdx; - for(j=0; zIdent[j]; j++){ - if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; - } - needQuote = zIdent[j]!=0 || isdigit(zIdent[0]) - || sqlite3KeywordCode(zIdent, j)!=TK_ID; - if( needQuote ) z[i++] = '"'; - for(j=0; zIdent[j]; j++){ - z[i++] = zIdent[j]; - if( zIdent[j]=='"' ) z[i++] = '"'; - } - if( needQuote ) z[i++] = '"'; - z[i] = 0; - *pIdx = i; -} - -/* -** Generate a CREATE TABLE statement appropriate for the given -** table. Memory to hold the text of the statement is obtained -** from sqliteMalloc() and must be freed by the calling function. -*/ -static char *createTableStmt(Table *p){ - int i, k, n; - char *zStmt; - char *zSep, *zSep2, *zEnd, *z; - Column *pCol; - n = 0; - for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){ - n += identLength(pCol->zName); - z = pCol->zType; - if( z ){ - n += (strlen(z) + 1); - } - } - n += identLength(p->zName); - if( n<50 ){ - zSep = ""; - zSep2 = ","; - zEnd = ")"; - }else{ - zSep = "\n "; - zSep2 = ",\n "; - zEnd = "\n)"; - } - n += 35 + 6*p->nCol; - zStmt = sqliteMallocRaw( n ); - if( zStmt==0 ) return 0; - strcpy(zStmt, !OMIT_TEMPDB&&p->iDb==1 ? "CREATE TEMP TABLE ":"CREATE TABLE "); - k = strlen(zStmt); - identPut(zStmt, &k, p->zName); - zStmt[k++] = '('; - for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){ - strcpy(&zStmt[k], zSep); - k += strlen(&zStmt[k]); - zSep = zSep2; - identPut(zStmt, &k, pCol->zName); - if( (z = pCol->zType)!=0 ){ - zStmt[k++] = ' '; - strcpy(&zStmt[k], z); - k += strlen(z); - } - } - strcpy(&zStmt[k], zEnd); - return zStmt; -} - -/* -** This routine is called to report the final ")" that terminates -** a CREATE TABLE statement. -** -** The table structure that other action routines have been building -** is added to the internal hash tables, assuming no errors have -** occurred. -** -** An entry for the table is made in the master table on disk, unless -** this is a temporary table or db->init.busy==1. When db->init.busy==1 -** it means we are reading the sqlite_master table because we just -** connected to the database or because the sqlite_master table has -** recently changed, so the entry for this table already exists in -** the sqlite_master table. We do not want to create it again. -** -** If the pSelect argument is not NULL, it means that this routine -** was called to create a table generated from a -** "CREATE TABLE ... AS SELECT ..." statement. The column names of -** the new table will match the result set of the SELECT. -*/ -void sqlite3EndTable( - Parse *pParse, /* Parse context */ - Token *pCons, /* The ',' token after the last column defn. */ - Token *pEnd, /* The final ')' token in the CREATE TABLE */ - Select *pSelect /* Select from a "CREATE ... AS SELECT" */ -){ - Table *p; - sqlite3 *db = pParse->db; - - if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite3_malloc_failed ) return; - p = pParse->pNewTable; - if( p==0 ) return; - - assert( !db->init.busy || !pSelect ); - - /* If the db->init.busy is 1 it means we are reading the SQL off the - ** "sqlite_master" or "sqlite_temp_master" table on the disk. - ** So do not write to the disk again. Extract the root page number - ** for the table from the db->init.newTnum field. (The page number - ** should have been put there by the sqliteOpenCb routine.) - */ - if( db->init.busy ){ - p->tnum = db->init.newTnum; - } - - /* If not initializing, then create a record for the new table - ** in the SQLITE_MASTER table of the database. The record number - ** for the new table entry should already be on the stack. - ** - ** If this is a TEMPORARY table, write the entry into the auxiliary - ** file instead of into the main database file. - */ - if( !db->init.busy ){ - int n; - Vdbe *v; - char *zType; /* "view" or "table" */ - char *zType2; /* "VIEW" or "TABLE" */ - char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */ - - v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - - sqlite3VdbeAddOp(v, OP_Close, 0, 0); - - /* Create the rootpage for the new table and push it onto the stack. - ** A view has no rootpage, so just push a zero onto the stack for - ** views. Initialize zType at the same time. - */ - if( p->pSelect==0 ){ - /* A regular table */ - zType = "table"; - zType2 = "TABLE"; -#ifndef SQLITE_OMIT_VIEW - }else{ - /* A view */ - zType = "view"; - zType2 = "VIEW"; -#endif - } - - /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT - ** statement to populate the new table. The root-page number for the - ** new table is on the top of the vdbe stack. - ** - ** Once the SELECT has been coded by sqlite3Select(), it is in a - ** suitable state to query for the column names and types to be used - ** by the new table. - */ - if( pSelect ){ - Table *pSelTab; - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3VdbeAddOp(v, OP_Integer, p->iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, 1, 0); - pParse->nTab = 2; - sqlite3Select(pParse, pSelect, SRT_Table, 1, 0, 0, 0, 0); - sqlite3VdbeAddOp(v, OP_Close, 1, 0); - if( pParse->nErr==0 ){ - pSelTab = sqlite3ResultSetOfSelect(pParse, 0, pSelect); - if( pSelTab==0 ) return; - assert( p->aCol==0 ); - p->nCol = pSelTab->nCol; - p->aCol = pSelTab->aCol; - pSelTab->nCol = 0; - pSelTab->aCol = 0; - sqlite3DeleteTable(0, pSelTab); - } - } - - /* Compute the complete text of the CREATE statement */ - if( pSelect ){ - zStmt = createTableStmt(p); - }else{ - n = pEnd->z - pParse->sNameToken.z + 1; - zStmt = sqlite3MPrintf("CREATE %s %.*s", zType2, n, pParse->sNameToken.z); - } - - /* A slot for the record has already been allocated in the - ** SQLITE_MASTER table. We just need to update that slot with all - ** the information we've collected. The rowid for the preallocated - ** slot is the 2nd item on the stack. The top of the stack is the - ** root page for the new table (or a 0 if this is a view). - */ - sqlite3NestedParse(pParse, - "UPDATE %Q.%s " - "SET type='%s', name=%Q, tbl_name=%Q, rootpage=#0, sql=%Q " - "WHERE rowid=#1", - db->aDb[p->iDb].zName, SCHEMA_TABLE(p->iDb), - zType, - p->zName, - p->zName, - zStmt - ); - sqliteFree(zStmt); - sqlite3ChangeCookie(db, v, p->iDb); - -#ifndef SQLITE_OMIT_AUTOINCREMENT - /* Check to see if we need to create an sqlite_sequence table for - ** keeping track of autoincrement keys. - */ - if( p->autoInc ){ - Db *pDb = &db->aDb[p->iDb]; - if( pDb->pSeqTab==0 ){ - sqlite3NestedParse(pParse, - "CREATE TABLE %Q.sqlite_sequence(name,seq)", - pDb->zName - ); - } - } -#endif - - /* Reparse everything to update our internal data structures */ - sqlite3VdbeOp3(v, OP_ParseSchema, p->iDb, 0, - sqlite3MPrintf("tbl_name='%q'",p->zName), P3_DYNAMIC); - } - - - /* Add the table to the in-memory representation of the database. - */ - if( db->init.busy && pParse->nErr==0 ){ - Table *pOld; - FKey *pFKey; - Db *pDb = &db->aDb[p->iDb]; - pOld = sqlite3HashInsert(&pDb->tblHash, p->zName, strlen(p->zName)+1, p); - if( pOld ){ - assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ - return; - } -#ifndef SQLITE_OMIT_FOREIGN_KEY - for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ - int nTo = strlen(pFKey->zTo) + 1; - pFKey->pNextTo = sqlite3HashFind(&pDb->aFKey, pFKey->zTo, nTo); - sqlite3HashInsert(&pDb->aFKey, pFKey->zTo, nTo, pFKey); - } -#endif - pParse->pNewTable = 0; - db->nTable++; - db->flags |= SQLITE_InternChanges; - -#ifndef SQLITE_OMIT_ALTERTABLE - if( !p->pSelect ){ - assert( !pSelect && pCons && pEnd ); - if( pCons->z==0 ) pCons = pEnd; - p->addColOffset = 13 + (pCons->z - pParse->sNameToken.z); - } -#endif - } -} - -#ifndef SQLITE_OMIT_VIEW -/* -** The parser calls this routine in order to create a new VIEW -*/ -void sqlite3CreateView( - Parse *pParse, /* The parsing context */ - Token *pBegin, /* The CREATE token that begins the statement */ - Token *pName1, /* The token that holds the name of the view */ - Token *pName2, /* The token that holds the name of the view */ - Select *pSelect, /* A SELECT statement that will become the new view */ - int isTemp /* TRUE for a TEMPORARY view */ -){ - Table *p; - int n; - const unsigned char *z; - Token sEnd; - DbFixer sFix; - Token *pName; - - if( pParse->nVar>0 ){ - sqlite3ErrorMsg(pParse, "parameters are not allowed in views"); - sqlite3SelectDelete(pSelect); - return; - } - sqlite3StartTable(pParse, pBegin, pName1, pName2, isTemp, 1); - p = pParse->pNewTable; - if( p==0 || pParse->nErr ){ - sqlite3SelectDelete(pSelect); - return; - } - sqlite3TwoPartName(pParse, pName1, pName2, &pName); - if( sqlite3FixInit(&sFix, pParse, p->iDb, "view", pName) - && sqlite3FixSelect(&sFix, pSelect) - ){ - sqlite3SelectDelete(pSelect); - return; - } - - /* Make a copy of the entire SELECT statement that defines the view. - ** This will force all the Expr.token.z values to be dynamically - ** allocated rather than point to the input string - which means that - ** they will persist after the current sqlite3_exec() call returns. - */ - p->pSelect = sqlite3SelectDup(pSelect); - sqlite3SelectDelete(pSelect); - if( !pParse->db->init.busy ){ - sqlite3ViewGetColumnNames(pParse, p); - } - - /* Locate the end of the CREATE VIEW statement. Make sEnd point to - ** the end. - */ - sEnd = pParse->sLastToken; - if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ - sEnd.z += sEnd.n; - } - sEnd.n = 0; - n = sEnd.z - pBegin->z; - z = (const unsigned char*)pBegin->z; - while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } - sEnd.z = &z[n-1]; - sEnd.n = 1; - - /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ - sqlite3EndTable(pParse, 0, &sEnd, 0); - return; -} -#endif /* SQLITE_OMIT_VIEW */ - -#ifndef SQLITE_OMIT_VIEW -/* -** The Table structure pTable is really a VIEW. Fill in the names of -** the columns of the view in the pTable structure. Return the number -** of errors. If an error is seen leave an error message in pParse->zErrMsg. -*/ -int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ - Table *pSelTab; /* A fake table from which we get the result set */ - Select *pSel; /* Copy of the SELECT that implements the view */ - int nErr = 0; /* Number of errors encountered */ - int n; /* Temporarily holds the number of cursors assigned */ - - assert( pTable ); - - /* A positive nCol means the columns names for this view are - ** already known. - */ - if( pTable->nCol>0 ) return 0; - - /* A negative nCol is a special marker meaning that we are currently - ** trying to compute the column names. If we enter this routine with - ** a negative nCol, it means two or more views form a loop, like this: - ** - ** CREATE VIEW one AS SELECT * FROM two; - ** CREATE VIEW two AS SELECT * FROM one; - ** - ** Actually, this error is caught previously and so the following test - ** should always fail. But we will leave it in place just to be safe. - */ -#if 0 - if( pTable->nCol<0 ){ - sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName); - return 1; - } -#endif - assert( pTable->nCol>=0 ); - - /* If we get this far, it means we need to compute the table names. - ** Note that the call to sqlite3ResultSetOfSelect() will expand any - ** "*" elements in the results set of the view and will assign cursors - ** to the elements of the FROM clause. But we do not want these changes - ** to be permanent. So the computation is done on a copy of the SELECT - ** statement that defines the view. - */ - assert( pTable->pSelect ); - pSel = sqlite3SelectDup(pTable->pSelect); - n = pParse->nTab; - sqlite3SrcListAssignCursors(pParse, pSel->pSrc); - pTable->nCol = -1; - pSelTab = sqlite3ResultSetOfSelect(pParse, 0, pSel); - pParse->nTab = n; - if( pSelTab ){ - assert( pTable->aCol==0 ); - pTable->nCol = pSelTab->nCol; - pTable->aCol = pSelTab->aCol; - pSelTab->nCol = 0; - pSelTab->aCol = 0; - sqlite3DeleteTable(0, pSelTab); - DbSetProperty(pParse->db, pTable->iDb, DB_UnresetViews); - }else{ - pTable->nCol = 0; - nErr++; - } - sqlite3SelectDelete(pSel); - return nErr; -} -#endif /* SQLITE_OMIT_VIEW */ - -#ifndef SQLITE_OMIT_VIEW -/* -** Clear the column names from every VIEW in database idx. -*/ -static void sqliteViewResetAll(sqlite3 *db, int idx){ - HashElem *i; - if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; - for(i=sqliteHashFirst(&db->aDb[idx].tblHash); i; i=sqliteHashNext(i)){ - Table *pTab = sqliteHashData(i); - if( pTab->pSelect ){ - sqliteResetColumnNames(pTab); - } - } - DbClearProperty(db, idx, DB_UnresetViews); -} -#else -# define sqliteViewResetAll(A,B) -#endif /* SQLITE_OMIT_VIEW */ - -/* -** This function is called by the VDBE to adjust the internal schema -** used by SQLite when the btree layer moves a table root page. The -** root-page of a table or index in database iDb has changed from iFrom -** to iTo. -*/ -#ifndef SQLITE_OMIT_AUTOVACUUM -void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){ - HashElem *pElem; - - for(pElem=sqliteHashFirst(&pDb->tblHash); pElem; pElem=sqliteHashNext(pElem)){ - Table *pTab = sqliteHashData(pElem); - if( pTab->tnum==iFrom ){ - pTab->tnum = iTo; - return; - } - } - for(pElem=sqliteHashFirst(&pDb->idxHash); pElem; pElem=sqliteHashNext(pElem)){ - Index *pIdx = sqliteHashData(pElem); - if( pIdx->tnum==iFrom ){ - pIdx->tnum = iTo; - return; - } - } - assert(0); -} -#endif - -/* -** Write code to erase the table with root-page iTable from database iDb. -** Also write code to modify the sqlite_master table and internal schema -** if a root-page of another table is moved by the btree-layer whilst -** erasing iTable (this can happen with an auto-vacuum database). -*/ -static void destroyRootPage(Parse *pParse, int iTable, int iDb){ - Vdbe *v = sqlite3GetVdbe(pParse); - sqlite3VdbeAddOp(v, OP_Destroy, iTable, iDb); -#ifndef SQLITE_OMIT_AUTOVACUUM - /* OP_Destroy pushes an integer onto the stack. If this integer - ** is non-zero, then it is the root page number of a table moved to - ** location iTable. The following code modifies the sqlite_master table to - ** reflect this. - ** - ** The "#0" in the SQL is a special constant that means whatever value - ** is on the top of the stack. See sqlite3RegisterExpr(). - */ - sqlite3NestedParse(pParse, - "UPDATE %Q.%s SET rootpage=%d WHERE #0 AND rootpage=#0", - pParse->db->aDb[iDb].zName, SCHEMA_TABLE(iDb), iTable); -#endif -} - -/* -** Write VDBE code to erase table pTab and all associated indices on disk. -** Code to update the sqlite_master tables and internal schema definitions -** in case a root-page belonging to another table is moved by the btree layer -** is also added (this can happen with an auto-vacuum database). -*/ -static void destroyTable(Parse *pParse, Table *pTab){ -#ifdef SQLITE_OMIT_AUTOVACUUM - Index *pIdx; - destroyRootPage(pParse, pTab->tnum, pTab->iDb); - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - destroyRootPage(pParse, pIdx->tnum, pIdx->iDb); - } -#else - /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM - ** is not defined), then it is important to call OP_Destroy on the - ** table and index root-pages in order, starting with the numerically - ** largest root-page number. This guarantees that none of the root-pages - ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the - ** following were coded: - ** - ** OP_Destroy 4 0 - ** ... - ** OP_Destroy 5 0 - ** - ** and root page 5 happened to be the largest root-page number in the - ** database, then root page 5 would be moved to page 4 by the - ** "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit - ** a free-list page. - */ - int iTab = pTab->tnum; - int iDestroyed = 0; - - while( 1 ){ - Index *pIdx; - int iLargest = 0; - - if( iDestroyed==0 || iTab<iDestroyed ){ - iLargest = iTab; - } - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - int iIdx = pIdx->tnum; - assert( pIdx->iDb==pTab->iDb ); - if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){ - iLargest = iIdx; - } - } - if( iLargest==0 ) return; - destroyRootPage(pParse, iLargest, pTab->iDb); - iDestroyed = iLargest; - } -#endif -} - -/* -** This routine is called to do the work of a DROP TABLE statement. -** pName is the name of the table to be dropped. -*/ -void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){ - Table *pTab; - Vdbe *v; - sqlite3 *db = pParse->db; - int iDb; - - if( pParse->nErr || sqlite3_malloc_failed ) goto exit_drop_table; - assert( pName->nSrc==1 ); - pTab = sqlite3LocateTable(pParse, pName->a[0].zName, pName->a[0].zDatabase); - - if( pTab==0 ) goto exit_drop_table; - iDb = pTab->iDb; - assert( iDb>=0 && iDb<db->nDb ); -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code; - const char *zTab = SCHEMA_TABLE(pTab->iDb); - const char *zDb = db->aDb[pTab->iDb].zName; - if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ - goto exit_drop_table; - } - if( isView ){ - if( !OMIT_TEMPDB && iDb==1 ){ - code = SQLITE_DROP_TEMP_VIEW; - }else{ - code = SQLITE_DROP_VIEW; - } - }else{ - if( !OMIT_TEMPDB && iDb==1 ){ - code = SQLITE_DROP_TEMP_TABLE; - }else{ - code = SQLITE_DROP_TABLE; - } - } - if( sqlite3AuthCheck(pParse, code, pTab->zName, 0, zDb) ){ - goto exit_drop_table; - } - if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ - goto exit_drop_table; - } - } -#endif - if( pTab->readOnly || pTab==db->aDb[iDb].pSeqTab ){ - sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); - goto exit_drop_table; - } - -#ifndef SQLITE_OMIT_VIEW - /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used - ** on a table. - */ - if( isView && pTab->pSelect==0 ){ - sqlite3ErrorMsg(pParse, "use DROP TABLE to delete table %s", pTab->zName); - goto exit_drop_table; - } - if( !isView && pTab->pSelect ){ - sqlite3ErrorMsg(pParse, "use DROP VIEW to delete view %s", pTab->zName); - goto exit_drop_table; - } -#endif - - /* Generate code to remove the table from the master table - ** on disk. - */ - v = sqlite3GetVdbe(pParse); - if( v ){ - Trigger *pTrigger; - int iDb = pTab->iDb; - Db *pDb = &db->aDb[iDb]; - sqlite3BeginWriteOperation(pParse, 0, iDb); - - /* Drop all triggers associated with the table being dropped. Code - ** is generated to remove entries from sqlite_master and/or - ** sqlite_temp_master if required. - */ - pTrigger = pTab->pTrigger; - while( pTrigger ){ - assert( pTrigger->iDb==iDb || pTrigger->iDb==1 ); - sqlite3DropTriggerPtr(pParse, pTrigger, 1); - pTrigger = pTrigger->pNext; - } - -#ifndef SQLITE_OMIT_AUTOINCREMENT - /* Remove any entries of the sqlite_sequence table associated with - ** the table being dropped. This is done before the table is dropped - ** at the btree level, in case the sqlite_sequence table needs to - ** move as a result of the drop (can happen in auto-vacuum mode). - */ - if( pTab->autoInc ){ - sqlite3NestedParse(pParse, - "DELETE FROM %s.sqlite_sequence WHERE name=%Q", - pDb->zName, pTab->zName - ); - } -#endif - - /* Drop all SQLITE_MASTER table and index entries that refer to the - ** table. The program name loops through the master table and deletes - ** every row that refers to a table of the same name as the one being - ** dropped. Triggers are handled seperately because a trigger can be - ** created in the temp database that refers to a table in another - ** database. - */ - sqlite3NestedParse(pParse, - "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'", - pDb->zName, SCHEMA_TABLE(iDb), pTab->zName); - if( !isView ){ - destroyTable(pParse, pTab); - } - - /* Remove the table entry from SQLite's internal schema and modify - ** the schema cookie. - */ - sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0); - sqlite3ChangeCookie(db, v, iDb); - } - sqliteViewResetAll(db, iDb); - -exit_drop_table: - sqlite3SrcListDelete(pName); -} - -/* -** This routine is called to create a new foreign key on the table -** currently under construction. pFromCol determines which columns -** in the current table point to the foreign key. If pFromCol==0 then -** connect the key to the last column inserted. pTo is the name of -** the table referred to. pToCol is a list of tables in the other -** pTo table that the foreign key points to. flags contains all -** information about the conflict resolution algorithms specified -** in the ON DELETE, ON UPDATE and ON INSERT clauses. -** -** An FKey structure is created and added to the table currently -** under construction in the pParse->pNewTable field. The new FKey -** is not linked into db->aFKey at this point - that does not happen -** until sqlite3EndTable(). -** -** The foreign key is set for IMMEDIATE processing. A subsequent call -** to sqlite3DeferForeignKey() might change this to DEFERRED. -*/ -void sqlite3CreateForeignKey( - Parse *pParse, /* Parsing context */ - ExprList *pFromCol, /* Columns in this table that point to other table */ - Token *pTo, /* Name of the other table */ - ExprList *pToCol, /* Columns in the other table */ - int flags /* Conflict resolution algorithms. */ -){ -#ifndef SQLITE_OMIT_FOREIGN_KEY - FKey *pFKey = 0; - Table *p = pParse->pNewTable; - int nByte; - int i; - int nCol; - char *z; - - assert( pTo!=0 ); - if( p==0 || pParse->nErr ) goto fk_end; - if( pFromCol==0 ){ - int iCol = p->nCol-1; - if( iCol<0 ) goto fk_end; - if( pToCol && pToCol->nExpr!=1 ){ - sqlite3ErrorMsg(pParse, "foreign key on %s" - " should reference only one column of table %T", - p->aCol[iCol].zName, pTo); - goto fk_end; - } - nCol = 1; - }else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ - sqlite3ErrorMsg(pParse, - "number of columns in foreign key does not match the number of " - "columns in the referenced table"); - goto fk_end; - }else{ - nCol = pFromCol->nExpr; - } - nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1; - if( pToCol ){ - for(i=0; i<pToCol->nExpr; i++){ - nByte += strlen(pToCol->a[i].zName) + 1; - } - } - pFKey = sqliteMalloc( nByte ); - if( pFKey==0 ) goto fk_end; - pFKey->pFrom = p; - pFKey->pNextFrom = p->pFKey; - z = (char*)&pFKey[1]; - pFKey->aCol = (struct sColMap*)z; - z += sizeof(struct sColMap)*nCol; - pFKey->zTo = z; - memcpy(z, pTo->z, pTo->n); - z[pTo->n] = 0; - z += pTo->n+1; - pFKey->pNextTo = 0; - pFKey->nCol = nCol; - if( pFromCol==0 ){ - pFKey->aCol[0].iFrom = p->nCol-1; - }else{ - for(i=0; i<nCol; i++){ - int j; - for(j=0; j<p->nCol; j++){ - if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ - pFKey->aCol[i].iFrom = j; - break; - } - } - if( j>=p->nCol ){ - sqlite3ErrorMsg(pParse, - "unknown column \"%s\" in foreign key definition", - pFromCol->a[i].zName); - goto fk_end; - } - } - } - if( pToCol ){ - for(i=0; i<nCol; i++){ - int n = strlen(pToCol->a[i].zName); - pFKey->aCol[i].zCol = z; - memcpy(z, pToCol->a[i].zName, n); - z[n] = 0; - z += n+1; - } - } - pFKey->isDeferred = 0; - pFKey->deleteConf = flags & 0xff; - pFKey->updateConf = (flags >> 8 ) & 0xff; - pFKey->insertConf = (flags >> 16 ) & 0xff; - - /* Link the foreign key to the table as the last step. - */ - p->pFKey = pFKey; - pFKey = 0; - -fk_end: - sqliteFree(pFKey); -#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ - sqlite3ExprListDelete(pFromCol); - sqlite3ExprListDelete(pToCol); -} - -/* -** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED -** clause is seen as part of a foreign key definition. The isDeferred -** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. -** The behavior of the most recently created foreign key is adjusted -** accordingly. -*/ -void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){ -#ifndef SQLITE_OMIT_FOREIGN_KEY - Table *pTab; - FKey *pFKey; - if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; - pFKey->isDeferred = isDeferred; -#endif -} - -/* -** Generate code that will erase and refill index *pIdx. This is -** used to initialize a newly created index or to recompute the -** content of an index in response to a REINDEX command. -** -** if memRootPage is not negative, it means that the index is newly -** created. The memory cell specified by memRootPage contains the -** root page number of the index. If memRootPage is negative, then -** the index already exists and must be cleared before being refilled and -** the root page number of the index is taken from pIndex->tnum. -*/ -static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ - Table *pTab = pIndex->pTable; /* The table that is indexed */ - int iTab = pParse->nTab; /* Btree cursor used for pTab */ - int iIdx = pParse->nTab+1; /* Btree cursor used for pIndex */ - int addr1; /* Address of top of loop */ - int tnum; /* Root page of index */ - Vdbe *v; /* Generate code into this virtual machine */ - -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0, - pParse->db->aDb[pIndex->iDb].zName ) ){ - return; - } -#endif - - /* Ensure all the required collation sequences are available. This - ** routine will invoke the collation-needed callback if necessary (and - ** if one has been registered). - */ - if( sqlite3CheckIndexCollSeq(pParse, pIndex) ){ - return; - } - - v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - if( memRootPage>=0 ){ - sqlite3VdbeAddOp(v, OP_MemLoad, memRootPage, 0); - tnum = 0; - }else{ - tnum = pIndex->tnum; - sqlite3VdbeAddOp(v, OP_Clear, tnum, pIndex->iDb); - } - sqlite3VdbeAddOp(v, OP_Integer, pIndex->iDb, 0); - sqlite3VdbeOp3(v, OP_OpenWrite, iIdx, tnum, - (char*)&pIndex->keyInfo, P3_KEYINFO); - sqlite3OpenTableForReading(v, iTab, pTab); - addr1 = sqlite3VdbeAddOp(v, OP_Rewind, iTab, 0); - sqlite3GenerateIndexKey(v, pIndex, iTab); - if( pIndex->onError!=OE_None ){ - int curaddr = sqlite3VdbeCurrentAddr(v); - int addr2 = curaddr+4; - sqlite3VdbeChangeP2(v, curaddr-1, addr2); - sqlite3VdbeAddOp(v, OP_Rowid, iTab, 0); - sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); - sqlite3VdbeAddOp(v, OP_IsUnique, iIdx, addr2); - sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort, - "indexed columns are not unique", P3_STATIC); - assert( addr2==sqlite3VdbeCurrentAddr(v) ); - } - sqlite3VdbeAddOp(v, OP_IdxInsert, iIdx, 0); - sqlite3VdbeAddOp(v, OP_Next, iTab, addr1+1); - sqlite3VdbeJumpHere(v, addr1); - sqlite3VdbeAddOp(v, OP_Close, iTab, 0); - sqlite3VdbeAddOp(v, OP_Close, iIdx, 0); -} - -/* -** Create a new index for an SQL table. pName1.pName2 is the name of the index -** and pTblList is the name of the table that is to be indexed. Both will -** be NULL for a primary key or an index that is created to satisfy a -** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable -** as the table to be indexed. pParse->pNewTable is a table that is -** currently being constructed by a CREATE TABLE statement. -** -** pList is a list of columns to be indexed. pList will be NULL if this -** is a primary key or unique-constraint on the most recent column added -** to the table currently under construction. -*/ -void sqlite3CreateIndex( - Parse *pParse, /* All information about this parse */ - Token *pName1, /* First part of index name. May be NULL */ - Token *pName2, /* Second part of index name. May be NULL */ - SrcList *pTblName, /* Table to index. Use pParse->pNewTable if 0 */ - ExprList *pList, /* A list of columns to be indexed */ - int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */ - Token *pEnd /* The ")" that closes the CREATE INDEX statement */ -){ - Table *pTab = 0; /* Table to be indexed */ - Index *pIndex = 0; /* The index to be created */ - char *zName = 0; - int i, j; - Token nullId; /* Fake token for an empty ID list */ - DbFixer sFix; /* For assigning database names to pTable */ - sqlite3 *db = pParse->db; - - int iDb; /* Index of the database that is being written */ - Token *pName = 0; /* Unqualified name of the index to create */ - - if( pParse->nErr || sqlite3_malloc_failed ) goto exit_create_index; - - /* - ** Find the table that is to be indexed. Return early if not found. - */ - if( pTblName!=0 ){ - - /* Use the two-part index name to determine the database - ** to search for the table. 'Fix' the table name to this db - ** before looking up the table. - */ - assert( pName1 && pName2 ); - iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); - if( iDb<0 ) goto exit_create_index; - -#ifndef SQLITE_OMIT_TEMPDB - /* If the index name was unqualified, check if the the table - ** is a temp table. If so, set the database to 1. - */ - pTab = sqlite3SrcListLookup(pParse, pTblName); - if( pName2 && pName2->n==0 && pTab && pTab->iDb==1 ){ - iDb = 1; - } -#endif - - if( sqlite3FixInit(&sFix, pParse, iDb, "index", pName) && - sqlite3FixSrcList(&sFix, pTblName) - ){ - /* Because the parser constructs pTblName from a single identifier, - ** sqlite3FixSrcList can never fail. */ - assert(0); - } - pTab = sqlite3LocateTable(pParse, pTblName->a[0].zName, - pTblName->a[0].zDatabase); - if( !pTab ) goto exit_create_index; - assert( iDb==pTab->iDb ); - }else{ - assert( pName==0 ); - pTab = pParse->pNewTable; - iDb = pTab->iDb; - } - - if( pTab==0 || pParse->nErr ) goto exit_create_index; - if( pTab->readOnly ){ - sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName); - goto exit_create_index; - } -#ifndef SQLITE_OMIT_VIEW - if( pTab->pSelect ){ - sqlite3ErrorMsg(pParse, "views may not be indexed"); - goto exit_create_index; - } -#endif - - /* - ** Find the name of the index. Make sure there is not already another - ** index or table with the same name. - ** - ** Exception: If we are reading the names of permanent indices from the - ** sqlite_master table (because some other process changed the schema) and - ** one of the index names collides with the name of a temporary table or - ** index, then we will continue to process this index. - ** - ** If pName==0 it means that we are - ** dealing with a primary key or UNIQUE constraint. We have to invent our - ** own name. - */ - if( pName ){ - zName = sqlite3NameFromToken(pName); - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index; - if( zName==0 ) goto exit_create_index; - if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ - goto exit_create_index; - } - if( !db->init.busy ){ - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index; - if( sqlite3FindIndex(db, zName, db->aDb[iDb].zName)!=0 ){ - sqlite3ErrorMsg(pParse, "index %s already exists", zName); - goto exit_create_index; - } - if( sqlite3FindTable(db, zName, 0)!=0 ){ - sqlite3ErrorMsg(pParse, "there is already a table named %s", zName); - goto exit_create_index; - } - } - }else{ - char zBuf[30]; - int n; - Index *pLoop; - for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} - sprintf(zBuf,"_%d",n); - zName = 0; - sqlite3SetString(&zName, "sqlite_autoindex_", pTab->zName, zBuf, (char*)0); - if( zName==0 ) goto exit_create_index; - } - - /* Check for authorization to create an index. - */ -#ifndef SQLITE_OMIT_AUTHORIZATION - { - const char *zDb = db->aDb[iDb].zName; - if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ - goto exit_create_index; - } - i = SQLITE_CREATE_INDEX; - if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX; - if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){ - goto exit_create_index; - } - } -#endif - - /* If pList==0, it means this routine was called to make a primary - ** key out of the last column added to the table under construction. - ** So create a fake list to simulate this. - */ - if( pList==0 ){ - nullId.z = pTab->aCol[pTab->nCol-1].zName; - nullId.n = strlen(nullId.z); - pList = sqlite3ExprListAppend(0, 0, &nullId); - if( pList==0 ) goto exit_create_index; - } - - /* - ** Allocate the index structure. - */ - pIndex = sqliteMalloc( sizeof(Index) + strlen(zName) + 1 + sizeof(int) + - (sizeof(int)*2 + sizeof(CollSeq*))*pList->nExpr ); - if( sqlite3_malloc_failed ) goto exit_create_index; - pIndex->aiColumn = (int*)&pIndex->keyInfo.aColl[pList->nExpr]; - pIndex->aiRowEst = (unsigned*)&pIndex->aiColumn[pList->nExpr]; - pIndex->zName = (char*)&pIndex->aiRowEst[pList->nExpr+1]; - strcpy(pIndex->zName, zName); - pIndex->pTable = pTab; - pIndex->nColumn = pList->nExpr; - pIndex->onError = onError; - pIndex->autoIndex = pName==0; - pIndex->iDb = iDb; - - /* Scan the names of the columns of the table to be indexed and - ** load the column indices into the Index structure. Report an error - ** if any column is not found. - */ - for(i=0; i<pList->nExpr; i++){ - for(j=0; j<pTab->nCol; j++){ - if( sqlite3StrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break; - } - if( j>=pTab->nCol ){ - sqlite3ErrorMsg(pParse, "table %s has no column named %s", - pTab->zName, pList->a[i].zName); - goto exit_create_index; - } - pIndex->aiColumn[i] = j; - if( pList->a[i].pExpr ){ - assert( pList->a[i].pExpr->pColl ); - pIndex->keyInfo.aColl[i] = pList->a[i].pExpr->pColl; - }else{ - pIndex->keyInfo.aColl[i] = pTab->aCol[j].pColl; - } - assert( pIndex->keyInfo.aColl[i] ); - if( !db->init.busy && - sqlite3CheckCollSeq(pParse, pIndex->keyInfo.aColl[i]) - ){ - goto exit_create_index; - } - } - pIndex->keyInfo.nField = pList->nExpr; - sqlite3DefaultRowEst(pIndex); - - if( pTab==pParse->pNewTable ){ - /* This routine has been called to create an automatic index as a - ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or - ** a PRIMARY KEY or UNIQUE clause following the column definitions. - ** i.e. one of: - ** - ** CREATE TABLE t(x PRIMARY KEY, y); - ** CREATE TABLE t(x, y, UNIQUE(x, y)); - ** - ** Either way, check to see if the table already has such an index. If - ** so, don't bother creating this one. This only applies to - ** automatically created indices. Users can do as they wish with - ** explicit indices. - */ - Index *pIdx; - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - int k; - assert( pIdx->onError!=OE_None ); - assert( pIdx->autoIndex ); - assert( pIndex->onError!=OE_None ); - - if( pIdx->nColumn!=pIndex->nColumn ) continue; - for(k=0; k<pIdx->nColumn; k++){ - if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break; - if( pIdx->keyInfo.aColl[k]!=pIndex->keyInfo.aColl[k] ) break; - } - if( k==pIdx->nColumn ){ - if( pIdx->onError!=pIndex->onError ){ - /* This constraint creates the same index as a previous - ** constraint specified somewhere in the CREATE TABLE statement. - ** However the ON CONFLICT clauses are different. If both this - ** constraint and the previous equivalent constraint have explicit - ** ON CONFLICT clauses this is an error. Otherwise, use the - ** explicitly specified behaviour for the index. - */ - if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ - sqlite3ErrorMsg(pParse, - "conflicting ON CONFLICT clauses specified", 0); - } - if( pIdx->onError==OE_Default ){ - pIdx->onError = pIndex->onError; - } - } - goto exit_create_index; - } - } - } - - /* Link the new Index structure to its table and to the other - ** in-memory database structures. - */ - if( db->init.busy ){ - Index *p; - p = sqlite3HashInsert(&db->aDb[pIndex->iDb].idxHash, - pIndex->zName, strlen(pIndex->zName)+1, pIndex); - if( p ){ - assert( p==pIndex ); /* Malloc must have failed */ - goto exit_create_index; - } - db->flags |= SQLITE_InternChanges; - if( pTblName!=0 ){ - pIndex->tnum = db->init.newTnum; - } - } - - /* If the db->init.busy is 0 then create the index on disk. This - ** involves writing the index into the master table and filling in the - ** index with the current table contents. - ** - ** The db->init.busy is 0 when the user first enters a CREATE INDEX - ** command. db->init.busy is 1 when a database is opened and - ** CREATE INDEX statements are read out of the master table. In - ** the latter case the index already exists on disk, which is why - ** we don't want to recreate it. - ** - ** If pTblName==0 it means this index is generated as a primary key - ** or UNIQUE constraint of a CREATE TABLE statement. Since the table - ** has just been created, it contains no data and the index initialization - ** step can be skipped. - */ - else if( db->init.busy==0 ){ - Vdbe *v; - char *zStmt; - int iMem = pParse->nMem++; - - v = sqlite3GetVdbe(pParse); - if( v==0 ) goto exit_create_index; - - /* Create the rootpage for the index - */ - sqlite3BeginWriteOperation(pParse, 1, iDb); - sqlite3VdbeAddOp(v, OP_CreateIndex, iDb, 0); - sqlite3VdbeAddOp(v, OP_MemStore, iMem, 0); - - /* Gather the complete text of the CREATE INDEX statement into - ** the zStmt variable - */ - if( pStart && pEnd ){ - /* A named index with an explicit CREATE INDEX statement */ - zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s", - onError==OE_None ? "" : " UNIQUE", - pEnd->z - pName->z + 1, - pName->z); - }else{ - /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ - /* zStmt = sqlite3MPrintf(""); */ - zStmt = 0; - } - - /* Add an entry in sqlite_master for this index - */ - sqlite3NestedParse(pParse, - "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#0,%Q);", - db->aDb[iDb].zName, SCHEMA_TABLE(iDb), - pIndex->zName, - pTab->zName, - zStmt - ); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqliteFree(zStmt); - - /* Fill the index with data and reparse the schema. Code an OP_Expire - ** to invalidate all pre-compiled statements. - */ - if( pTblName ){ - sqlite3RefillIndex(pParse, pIndex, iMem); - sqlite3ChangeCookie(db, v, iDb); - sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, - sqlite3MPrintf("name='%q'", pIndex->zName), P3_DYNAMIC); - sqlite3VdbeAddOp(v, OP_Expire, 0, 0); - } - } - - /* When adding an index to the list of indices for a table, make - ** sure all indices labeled OE_Replace come after all those labeled - ** OE_Ignore. This is necessary for the correct operation of UPDATE - ** and INSERT. - */ - if( db->init.busy || pTblName==0 ){ - if( onError!=OE_Replace || pTab->pIndex==0 - || pTab->pIndex->onError==OE_Replace){ - pIndex->pNext = pTab->pIndex; - pTab->pIndex = pIndex; - }else{ - Index *pOther = pTab->pIndex; - while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ - pOther = pOther->pNext; - } - pIndex->pNext = pOther->pNext; - pOther->pNext = pIndex; - } - pIndex = 0; - } - - /* Clean up before exiting */ -exit_create_index: - if( pIndex ){ - freeIndex(pIndex); - } - sqlite3ExprListDelete(pList); - sqlite3SrcListDelete(pTblName); - sqliteFree(zName); - return; -} - -/* -** Fill the Index.aiRowEst[] array with default information - information -** to be used when we have not run the ANALYZE command. -** -** aiRowEst[0] is suppose to contain the number of elements in the index. -** Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the -** number of rows in the table that match any particular value of the -** first column of the index. aiRowEst[2] is an estimate of the number -** of rows that match any particular combiniation of the first 2 columns -** of the index. And so forth. It must always be the case that -* -** aiRowEst[N]<=aiRowEst[N-1] -** aiRowEst[N]>=1 -** -** Apart from that, we have little to go on besides intuition as to -** how aiRowEst[] should be initialized. The numbers generated here -** are based on typical values found in actual indices. -*/ -void sqlite3DefaultRowEst(Index *pIdx){ - unsigned *a = pIdx->aiRowEst; - int i; - assert( a!=0 ); - a[0] = 1000000; - for(i=pIdx->nColumn; i>=1; i--){ - a[i] = 10; - } - if( pIdx->onError!=OE_None ){ - a[pIdx->nColumn] = 1; - } -} - -/* -** This routine will drop an existing named index. This routine -** implements the DROP INDEX statement. -*/ -void sqlite3DropIndex(Parse *pParse, SrcList *pName){ - Index *pIndex; - Vdbe *v; - sqlite3 *db = pParse->db; - - if( pParse->nErr || sqlite3_malloc_failed ){ - goto exit_drop_index; - } - assert( pName->nSrc==1 ); - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - goto exit_drop_index; - } - pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase); - if( pIndex==0 ){ - sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0); - pParse->checkSchema = 1; - goto exit_drop_index; - } - if( pIndex->autoIndex ){ - sqlite3ErrorMsg(pParse, "index associated with UNIQUE " - "or PRIMARY KEY constraint cannot be dropped", 0); - goto exit_drop_index; - } -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code = SQLITE_DROP_INDEX; - Table *pTab = pIndex->pTable; - const char *zDb = db->aDb[pIndex->iDb].zName; - const char *zTab = SCHEMA_TABLE(pIndex->iDb); - if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ - goto exit_drop_index; - } - if( !OMIT_TEMPDB && pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX; - if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ - goto exit_drop_index; - } - } -#endif - - /* Generate code to remove the index and from the master table */ - v = sqlite3GetVdbe(pParse); - if( v ){ - int iDb = pIndex->iDb; - sqlite3NestedParse(pParse, - "DELETE FROM %Q.%s WHERE name=%Q", - db->aDb[iDb].zName, SCHEMA_TABLE(iDb), - pIndex->zName - ); - sqlite3ChangeCookie(db, v, iDb); - destroyRootPage(pParse, pIndex->tnum, iDb); - sqlite3VdbeOp3(v, OP_DropIndex, iDb, 0, pIndex->zName, 0); - } - -exit_drop_index: - sqlite3SrcListDelete(pName); -} - -/* -** ppArray points into a structure where there is an array pointer -** followed by two integers. The first integer is the -** number of elements in the structure array. The second integer -** is the number of allocated slots in the array. -** -** In other words, the structure looks something like this: -** -** struct Example1 { -** struct subElem *aEntry; -** int nEntry; -** int nAlloc; -** } -** -** The pnEntry parameter points to the equivalent of Example1.nEntry. -** -** This routine allocates a new slot in the array, zeros it out, -** and returns its index. If malloc fails a negative number is returned. -** -** szEntry is the sizeof of a single array entry. initSize is the -** number of array entries allocated on the initial allocation. -*/ -int sqlite3ArrayAllocate(void **ppArray, int szEntry, int initSize){ - char *p; - int *an = (int*)&ppArray[1]; - if( an[0]>=an[1] ){ - void *pNew; - int newSize; - newSize = an[1]*2 + initSize; - pNew = sqliteRealloc(*ppArray, newSize*szEntry); - if( pNew==0 ){ - return -1; - } - an[1] = newSize; - *ppArray = pNew; - } - p = *ppArray; - memset(&p[an[0]*szEntry], 0, szEntry); - return an[0]++; -} - -/* -** Append a new element to the given IdList. Create a new IdList if -** need be. -** -** A new IdList is returned, or NULL if malloc() fails. -*/ -IdList *sqlite3IdListAppend(IdList *pList, Token *pToken){ - int i; - if( pList==0 ){ - pList = sqliteMalloc( sizeof(IdList) ); - if( pList==0 ) return 0; - pList->nAlloc = 0; - } - i = sqlite3ArrayAllocate((void**)&pList->a, sizeof(pList->a[0]), 5); - if( i<0 ){ - sqlite3IdListDelete(pList); - return 0; - } - pList->a[i].zName = sqlite3NameFromToken(pToken); - return pList; -} - -/* -** Delete an IdList. -*/ -void sqlite3IdListDelete(IdList *pList){ - int i; - if( pList==0 ) return; - for(i=0; i<pList->nId; i++){ - sqliteFree(pList->a[i].zName); - } - sqliteFree(pList->a); - sqliteFree(pList); -} - -/* -** Return the index in pList of the identifier named zId. Return -1 -** if not found. -*/ -int sqlite3IdListIndex(IdList *pList, const char *zName){ - int i; - if( pList==0 ) return -1; - for(i=0; i<pList->nId; i++){ - if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i; - } - return -1; -} - -/* -** Append a new table name to the given SrcList. Create a new SrcList if -** need be. A new entry is created in the SrcList even if pToken is NULL. -** -** A new SrcList is returned, or NULL if malloc() fails. -** -** If pDatabase is not null, it means that the table has an optional -** database name prefix. Like this: "database.table". The pDatabase -** points to the table name and the pTable points to the database name. -** The SrcList.a[].zName field is filled with the table name which might -** come from pTable (if pDatabase is NULL) or from pDatabase. -** SrcList.a[].zDatabase is filled with the database name from pTable, -** or with NULL if no database is specified. -** -** In other words, if call like this: -** -** sqlite3SrcListAppend(A,B,0); -** -** Then B is a table name and the database name is unspecified. If called -** like this: -** -** sqlite3SrcListAppend(A,B,C); -** -** Then C is the table name and B is the database name. -*/ -SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){ - struct SrcList_item *pItem; - if( pList==0 ){ - pList = sqliteMalloc( sizeof(SrcList) ); - if( pList==0 ) return 0; - pList->nAlloc = 1; - } - if( pList->nSrc>=pList->nAlloc ){ - SrcList *pNew; - pList->nAlloc *= 2; - pNew = sqliteRealloc(pList, - sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) ); - if( pNew==0 ){ - sqlite3SrcListDelete(pList); - return 0; - } - pList = pNew; - } - pItem = &pList->a[pList->nSrc]; - memset(pItem, 0, sizeof(pList->a[0])); - if( pDatabase && pDatabase->z==0 ){ - pDatabase = 0; - } - if( pDatabase && pTable ){ - Token *pTemp = pDatabase; - pDatabase = pTable; - pTable = pTemp; - } - pItem->zName = sqlite3NameFromToken(pTable); - pItem->zDatabase = sqlite3NameFromToken(pDatabase); - pItem->iCursor = -1; - pList->nSrc++; - return pList; -} - -/* -** Assign cursors to all tables in a SrcList -*/ -void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){ - int i; - struct SrcList_item *pItem; - for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){ - if( pItem->iCursor>=0 ) break; - pItem->iCursor = pParse->nTab++; - if( pItem->pSelect ){ - sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc); - } - } -} - -/* -** Add an alias to the last identifier on the given identifier list. -*/ -void sqlite3SrcListAddAlias(SrcList *pList, Token *pToken){ - if( pList && pList->nSrc>0 ){ - pList->a[pList->nSrc-1].zAlias = sqlite3NameFromToken(pToken); - } -} - -/* -** Delete an entire SrcList including all its substructure. -*/ -void sqlite3SrcListDelete(SrcList *pList){ - int i; - struct SrcList_item *pItem; - if( pList==0 ) return; - for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){ - sqliteFree(pItem->zDatabase); - sqliteFree(pItem->zName); - sqliteFree(pItem->zAlias); - sqlite3DeleteTable(0, pItem->pTab); - sqlite3SelectDelete(pItem->pSelect); - sqlite3ExprDelete(pItem->pOn); - sqlite3IdListDelete(pItem->pUsing); - } - sqliteFree(pList); -} - -/* -** Begin a transaction -*/ -void sqlite3BeginTransaction(Parse *pParse, int type){ - sqlite3 *db; - Vdbe *v; - int i; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite3_malloc_failed ) return; - if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return; - - v = sqlite3GetVdbe(pParse); - if( !v ) return; - if( type!=TK_DEFERRED ){ - for(i=0; i<db->nDb; i++){ - sqlite3VdbeAddOp(v, OP_Transaction, i, (type==TK_EXCLUSIVE)+1); - } - } - sqlite3VdbeAddOp(v, OP_AutoCommit, 0, 0); -} - -/* -** Commit a transaction -*/ -void sqlite3CommitTransaction(Parse *pParse){ - sqlite3 *db; - Vdbe *v; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite3_malloc_failed ) return; - if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return; - - v = sqlite3GetVdbe(pParse); - if( v ){ - sqlite3VdbeAddOp(v, OP_AutoCommit, 1, 0); - } -} - -/* -** Rollback a transaction -*/ -void sqlite3RollbackTransaction(Parse *pParse){ - sqlite3 *db; - Vdbe *v; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite3_malloc_failed ) return; - if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return; - - v = sqlite3GetVdbe(pParse); - if( v ){ - sqlite3VdbeAddOp(v, OP_AutoCommit, 1, 1); - } -} - -/* -** Make sure the TEMP database is open and available for use. Return -** the number of errors. Leave any error messages in the pParse structure. -*/ -static int sqlite3OpenTempDatabase(Parse *pParse){ - sqlite3 *db = pParse->db; - if( db->aDb[1].pBt==0 && !pParse->explain ){ - int rc = sqlite3BtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt); - if( rc!=SQLITE_OK ){ - sqlite3ErrorMsg(pParse, "unable to open a temporary database " - "file for storing temporary tables"); - pParse->rc = rc; - return 1; - } - if( db->flags & !db->autoCommit ){ - rc = sqlite3BtreeBeginTrans(db->aDb[1].pBt, 1); - if( rc!=SQLITE_OK ){ - sqlite3ErrorMsg(pParse, "unable to get a write lock on " - "the temporary database file"); - pParse->rc = rc; - return 1; - } - } - } - return 0; -} - -/* -** Generate VDBE code that will verify the schema cookie and start -** a read-transaction for all named database files. -** -** It is important that all schema cookies be verified and all -** read transactions be started before anything else happens in -** the VDBE program. But this routine can be called after much other -** code has been generated. So here is what we do: -** -** The first time this routine is called, we code an OP_Goto that -** will jump to a subroutine at the end of the program. Then we -** record every database that needs its schema verified in the -** pParse->cookieMask field. Later, after all other code has been -** generated, the subroutine that does the cookie verifications and -** starts the transactions will be coded and the OP_Goto P2 value -** will be made to point to that subroutine. The generation of the -** cookie verification subroutine code happens in sqlite3FinishCoding(). -** -** If iDb<0 then code the OP_Goto only - don't set flag to verify the -** schema on any databases. This can be used to position the OP_Goto -** early in the code, before we know if any database tables will be used. -*/ -void sqlite3CodeVerifySchema(Parse *pParse, int iDb){ - sqlite3 *db; - Vdbe *v; - int mask; - - v = sqlite3GetVdbe(pParse); - if( v==0 ) return; /* This only happens if there was a prior error */ - db = pParse->db; - if( pParse->cookieGoto==0 ){ - pParse->cookieGoto = sqlite3VdbeAddOp(v, OP_Goto, 0, 0)+1; - } - if( iDb>=0 ){ - assert( iDb<db->nDb ); - assert( db->aDb[iDb].pBt!=0 || iDb==1 ); - assert( iDb<32 ); - mask = 1<<iDb; - if( (pParse->cookieMask & mask)==0 ){ - pParse->cookieMask |= mask; - pParse->cookieValue[iDb] = db->aDb[iDb].schema_cookie; - if( !OMIT_TEMPDB && iDb==1 ){ - sqlite3OpenTempDatabase(pParse); - } - } - } -} - -/* -** Generate VDBE code that prepares for doing an operation that -** might change the database. -** -** This routine starts a new transaction if we are not already within -** a transaction. If we are already within a transaction, then a checkpoint -** is set if the setStatement parameter is true. A checkpoint should -** be set for operations that might fail (due to a constraint) part of -** the way through and which will need to undo some writes without having to -** rollback the whole transaction. For operations where all constraints -** can be checked before any changes are made to the database, it is never -** necessary to undo a write and the checkpoint should not be set. -** -** Only database iDb and the temp database are made writable by this call. -** If iDb==0, then the main and temp databases are made writable. If -** iDb==1 then only the temp database is made writable. If iDb>1 then the -** specified auxiliary database and the temp database are made writable. -*/ -void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){ - Vdbe *v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - sqlite3CodeVerifySchema(pParse, iDb); - pParse->writeMask |= 1<<iDb; - if( setStatement && pParse->nested==0 ){ - sqlite3VdbeAddOp(v, OP_Statement, iDb, 0); - } - if( (OMIT_TEMPDB || iDb!=1) && pParse->db->aDb[1].pBt!=0 ){ - sqlite3BeginWriteOperation(pParse, setStatement, 1); - } -} - -/* -** Check to see if pIndex uses the collating sequence pColl. Return -** true if it does and false if it does not. -*/ -#ifndef SQLITE_OMIT_REINDEX -static int collationMatch(CollSeq *pColl, Index *pIndex){ - int n = pIndex->keyInfo.nField; - CollSeq **pp = pIndex->keyInfo.aColl; - while( n-- ){ - if( *pp==pColl ) return 1; - pp++; - } - return 0; -} -#endif - -/* -** Recompute all indices of pTab that use the collating sequence pColl. -** If pColl==0 then recompute all indices of pTab. -*/ -#ifndef SQLITE_OMIT_REINDEX -static void reindexTable(Parse *pParse, Table *pTab, CollSeq *pColl){ - Index *pIndex; /* An index associated with pTab */ - - for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ - if( pColl==0 || collationMatch(pColl,pIndex) ){ - sqlite3BeginWriteOperation(pParse, 0, pTab->iDb); - sqlite3RefillIndex(pParse, pIndex, -1); - } - } -} -#endif - -/* -** Recompute all indices of all tables in all databases where the -** indices use the collating sequence pColl. If pColl==0 then recompute -** all indices everywhere. -*/ -#ifndef SQLITE_OMIT_REINDEX -static void reindexDatabases(Parse *pParse, CollSeq *pColl){ - Db *pDb; /* A single database */ - int iDb; /* The database index number */ - sqlite3 *db = pParse->db; /* The database connection */ - HashElem *k; /* For looping over tables in pDb */ - Table *pTab; /* A table in the database */ - - for(iDb=0, pDb=db->aDb; iDb<db->nDb; iDb++, pDb++){ - if( pDb==0 ) continue; - for(k=sqliteHashFirst(&pDb->tblHash); k; k=sqliteHashNext(k)){ - pTab = (Table*)sqliteHashData(k); - reindexTable(pParse, pTab, pColl); - } - } -} -#endif - -/* -** Generate code for the REINDEX command. -** -** REINDEX -- 1 -** REINDEX <collation> -- 2 -** REINDEX ?<database>.?<tablename> -- 3 -** REINDEX ?<database>.?<indexname> -- 4 -** -** Form 1 causes all indices in all attached databases to be rebuilt. -** Form 2 rebuilds all indices in all databases that use the named -** collating function. Forms 3 and 4 rebuild the named index or all -** indices associated with the named table. -*/ -#ifndef SQLITE_OMIT_REINDEX -void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){ - CollSeq *pColl; /* Collating sequence to be reindexed, or NULL */ - char *z; /* Name of a table or index */ - const char *zDb; /* Name of the database */ - Table *pTab; /* A table in the database */ - Index *pIndex; /* An index associated with pTab */ - int iDb; /* The database index number */ - sqlite3 *db = pParse->db; /* The database connection */ - Token *pObjName; /* Name of the table or index to be reindexed */ - - /* Read the database schema. If an error occurs, leave an error message - ** and code in pParse and return NULL. */ - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - return; - } - - if( pName1==0 || pName1->z==0 ){ - reindexDatabases(pParse, 0); - return; - }else if( pName2==0 || pName2->z==0 ){ - pColl = sqlite3FindCollSeq(db, db->enc, pName1->z, pName1->n, 0); - if( pColl ){ - reindexDatabases(pParse, pColl); - return; - } - } - iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pObjName); - if( iDb<0 ) return; - z = sqlite3NameFromToken(pObjName); - zDb = db->aDb[iDb].zName; - pTab = sqlite3FindTable(db, z, zDb); - if( pTab ){ - reindexTable(pParse, pTab, 0); - sqliteFree(z); - return; - } - pIndex = sqlite3FindIndex(db, z, zDb); - sqliteFree(z); - if( pIndex ){ - sqlite3BeginWriteOperation(pParse, 0, iDb); - sqlite3RefillIndex(pParse, pIndex, -1); - return; - } - sqlite3ErrorMsg(pParse, "unable to identify the object to be reindexed"); -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/callback.c b/ext/pdo_sqlite/sqlite/src/callback.c deleted file mode 100644 index 2103c3f711575..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/callback.c +++ /dev/null @@ -1,305 +0,0 @@ -/* -** 2005 May 23 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** -** This file contains functions used to access the internal hash tables -** of user defined functions and collation sequences. -** -** $Id$ -*/ - -#include "sqliteInt.h" - -/* -** Invoke the 'collation needed' callback to request a collation sequence -** in the database text encoding of name zName, length nName. -** If the collation sequence -*/ -static void callCollNeeded(sqlite3 *db, const char *zName, int nName){ - assert( !db->xCollNeeded || !db->xCollNeeded16 ); - if( nName<0 ) nName = strlen(zName); - if( db->xCollNeeded ){ - char *zExternal = sqliteStrNDup(zName, nName); - if( !zExternal ) return; - db->xCollNeeded(db->pCollNeededArg, db, (int)db->enc, zExternal); - sqliteFree(zExternal); - } -#ifndef SQLITE_OMIT_UTF16 - if( db->xCollNeeded16 ){ - char const *zExternal; - sqlite3_value *pTmp = sqlite3GetTransientValue(db); - sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC); - zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE); - if( !zExternal ) return; - db->xCollNeeded16(db->pCollNeededArg, db, (int)db->enc, zExternal); - } -#endif -} - -/* -** This routine is called if the collation factory fails to deliver a -** collation function in the best encoding but there may be other versions -** of this collation function (for other text encodings) available. Use one -** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if -** possible. -*/ -static int synthCollSeq(sqlite3 *db, CollSeq *pColl){ - CollSeq *pColl2; - char *z = pColl->zName; - int n = strlen(z); - int i; - static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 }; - for(i=0; i<3; i++){ - pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, n, 0); - if( pColl2->xCmp!=0 ){ - memcpy(pColl, pColl2, sizeof(CollSeq)); - return SQLITE_OK; - } - } - return SQLITE_ERROR; -} - -/* -** This function is responsible for invoking the collation factory callback -** or substituting a collation sequence of a different encoding when the -** requested collation sequence is not available in the database native -** encoding. -** -** If it is not NULL, then pColl must point to the database native encoding -** collation sequence with name zName, length nName. -** -** The return value is either the collation sequence to be used in database -** db for collation type name zName, length nName, or NULL, if no collation -** sequence can be found. -*/ -CollSeq *sqlite3GetCollSeq( - sqlite3* db, - CollSeq *pColl, - const char *zName, - int nName -){ - CollSeq *p; - - p = pColl; - if( !p ){ - p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0); - } - if( !p || !p->xCmp ){ - /* No collation sequence of this type for this encoding is registered. - ** Call the collation factory to see if it can supply us with one. - */ - callCollNeeded(db, zName, nName); - p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0); - } - if( p && !p->xCmp && synthCollSeq(db, p) ){ - p = 0; - } - assert( !p || p->xCmp ); - return p; -} - -/* -** This routine is called on a collation sequence before it is used to -** check that it is defined. An undefined collation sequence exists when -** a database is loaded that contains references to collation sequences -** that have not been defined by sqlite3_create_collation() etc. -** -** If required, this routine calls the 'collation needed' callback to -** request a definition of the collating sequence. If this doesn't work, -** an equivalent collating sequence that uses a text encoding different -** from the main database is substituted, if one is available. -*/ -int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){ - if( pColl ){ - const char *zName = pColl->zName; - CollSeq *p = sqlite3GetCollSeq(pParse->db, pColl, zName, -1); - if( !p ){ - if( pParse->nErr==0 ){ - sqlite3ErrorMsg(pParse, "no such collation sequence: %s", zName); - } - pParse->nErr++; - return SQLITE_ERROR; - } - } - return SQLITE_OK; -} - - - -/* -** Locate and return an entry from the db.aCollSeq hash table. If the entry -** specified by zName and nName is not found and parameter 'create' is -** true, then create a new entry. Otherwise return NULL. -** -** Each pointer stored in the sqlite3.aCollSeq hash table contains an -** array of three CollSeq structures. The first is the collation sequence -** prefferred for UTF-8, the second UTF-16le, and the third UTF-16be. -** -** Stored immediately after the three collation sequences is a copy of -** the collation sequence name. A pointer to this string is stored in -** each collation sequence structure. -*/ -static CollSeq *findCollSeqEntry( - sqlite3 *db, - const char *zName, - int nName, - int create -){ - CollSeq *pColl; - if( nName<0 ) nName = strlen(zName); - pColl = sqlite3HashFind(&db->aCollSeq, zName, nName); - - if( 0==pColl && create ){ - pColl = sqliteMalloc( 3*sizeof(*pColl) + nName + 1 ); - if( pColl ){ - CollSeq *pDel = 0; - pColl[0].zName = (char*)&pColl[3]; - pColl[0].enc = SQLITE_UTF8; - pColl[1].zName = (char*)&pColl[3]; - pColl[1].enc = SQLITE_UTF16LE; - pColl[2].zName = (char*)&pColl[3]; - pColl[2].enc = SQLITE_UTF16BE; - memcpy(pColl[0].zName, zName, nName); - pColl[0].zName[nName] = 0; - pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, nName, pColl); - - /* If a malloc() failure occured in sqlite3HashInsert(), it will - ** return the pColl pointer to be deleted (because it wasn't added - ** to the hash table). - */ - assert( !pDel || (sqlite3_malloc_failed && pDel==pColl) ); - sqliteFree(pDel); - } - } - return pColl; -} - -/* -** Parameter zName points to a UTF-8 encoded string nName bytes long. -** Return the CollSeq* pointer for the collation sequence named zName -** for the encoding 'enc' from the database 'db'. -** -** If the entry specified is not found and 'create' is true, then create a -** new entry. Otherwise return NULL. -*/ -CollSeq *sqlite3FindCollSeq( - sqlite3 *db, - u8 enc, - const char *zName, - int nName, - int create -){ - CollSeq *pColl = findCollSeqEntry(db, zName, nName, create); - assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 ); - assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE ); - if( pColl ) pColl += enc-1; - return pColl; -} - -/* -** Locate a user function given a name, a number of arguments and a flag -** indicating whether the function prefers UTF-16 over UTF-8. Return a -** pointer to the FuncDef structure that defines that function, or return -** NULL if the function does not exist. -** -** If the createFlag argument is true, then a new (blank) FuncDef -** structure is created and liked into the "db" structure if a -** no matching function previously existed. When createFlag is true -** and the nArg parameter is -1, then only a function that accepts -** any number of arguments will be returned. -** -** If createFlag is false and nArg is -1, then the first valid -** function found is returned. A function is valid if either xFunc -** or xStep is non-zero. -** -** If createFlag is false, then a function with the required name and -** number of arguments may be returned even if the eTextRep flag does not -** match that requested. -*/ -FuncDef *sqlite3FindFunction( - sqlite3 *db, /* An open database */ - const char *zName, /* Name of the function. Not null-terminated */ - int nName, /* Number of characters in the name */ - int nArg, /* Number of arguments. -1 means any number */ - u8 enc, /* Preferred text encoding */ - int createFlag /* Create new entry if true and does not otherwise exist */ -){ - FuncDef *p; /* Iterator variable */ - FuncDef *pFirst; /* First function with this name */ - FuncDef *pBest = 0; /* Best match found so far */ - int bestmatch = 0; - - - assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); - if( nArg<-1 ) nArg = -1; - - pFirst = (FuncDef*)sqlite3HashFind(&db->aFunc, zName, nName); - for(p=pFirst; p; p=p->pNext){ - /* During the search for the best function definition, bestmatch is set - ** as follows to indicate the quality of the match with the definition - ** pointed to by pBest: - ** - ** 0: pBest is NULL. No match has been found. - ** 1: A variable arguments function that prefers UTF-8 when a UTF-16 - ** encoding is requested, or vice versa. - ** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is - ** requested, or vice versa. - ** 3: A variable arguments function using the same text encoding. - ** 4: A function with the exact number of arguments requested that - ** prefers UTF-8 when a UTF-16 encoding is requested, or vice versa. - ** 5: A function with the exact number of arguments requested that - ** prefers UTF-16LE when UTF-16BE is requested, or vice versa. - ** 6: An exact match. - ** - ** A larger value of 'matchqual' indicates a more desirable match. - */ - if( p->nArg==-1 || p->nArg==nArg || nArg==-1 ){ - int match = 1; /* Quality of this match */ - if( p->nArg==nArg || nArg==-1 ){ - match = 4; - } - if( enc==p->iPrefEnc ){ - match += 2; - } - else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) || - (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){ - match += 1; - } - - if( match>bestmatch ){ - pBest = p; - bestmatch = match; - } - } - } - - /* If the createFlag parameter is true, and the seach did not reveal an - ** exact match for the name, number of arguments and encoding, then add a - ** new entry to the hash table and return it. - */ - if( createFlag && bestmatch<6 && - (pBest = sqliteMalloc(sizeof(*pBest)+nName)) ){ - pBest->nArg = nArg; - pBest->pNext = pFirst; - pBest->iPrefEnc = enc; - memcpy(pBest->zName, zName, nName); - pBest->zName[nName] = 0; - if( pBest==sqlite3HashInsert(&db->aFunc,pBest->zName,nName,(void*)pBest) ){ - sqliteFree(pBest); - return 0; - } - } - - if( pBest && (pBest->xStep || pBest->xFunc || createFlag) ){ - return pBest; - } - return 0; -} diff --git a/ext/pdo_sqlite/sqlite/src/date.c b/ext/pdo_sqlite/sqlite/src/date.c deleted file mode 100644 index 7d398df489995..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/date.c +++ /dev/null @@ -1,996 +0,0 @@ -/* -** 2003 October 31 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement date and time -** functions for SQLite. -** -** There is only one exported symbol in this file - the function -** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. -** All other code has file scope. -** -** $Id$ -** -** NOTES: -** -** SQLite processes all times and dates as Julian Day numbers. The -** dates and times are stored as the number of days since noon -** in Greenwich on November 24, 4714 B.C. according to the Gregorian -** calendar system. -** -** 1970-01-01 00:00:00 is JD 2440587.5 -** 2000-01-01 00:00:00 is JD 2451544.5 -** -** This implemention requires years to be expressed as a 4-digit number -** which means that only dates between 0000-01-01 and 9999-12-31 can -** be represented, even though julian day numbers allow a much wider -** range of dates. -** -** The Gregorian calendar system is used for all dates and times, -** even those that predate the Gregorian calendar. Historians usually -** use the Julian calendar for dates prior to 1582-10-15 and for some -** dates afterwards, depending on locale. Beware of this difference. -** -** The conversion algorithms are implemented based on descriptions -** in the following text: -** -** Jean Meeus -** Astronomical Algorithms, 2nd Edition, 1998 -** ISBM 0-943396-61-1 -** Willmann-Bell, Inc -** Richmond, Virginia (USA) -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> -#include <stdlib.h> -#include <assert.h> -#include <time.h> - -#ifndef SQLITE_OMIT_DATETIME_FUNCS - -/* -** A structure for holding a single date and time. -*/ -typedef struct DateTime DateTime; -struct DateTime { - double rJD; /* The julian day number */ - int Y, M, D; /* Year, month, and day */ - int h, m; /* Hour and minutes */ - int tz; /* Timezone offset in minutes */ - double s; /* Seconds */ - char validYMD; /* True if Y,M,D are valid */ - char validHMS; /* True if h,m,s are valid */ - char validJD; /* True if rJD is valid */ - char validTZ; /* True if tz is valid */ -}; - - -/* -** Convert zDate into one or more integers. Additional arguments -** come in groups of 5 as follows: -** -** N number of digits in the integer -** min minimum allowed value of the integer -** max maximum allowed value of the integer -** nextC first character after the integer -** pVal where to write the integers value. -** -** Conversions continue until one with nextC==0 is encountered. -** The function returns the number of successful conversions. -*/ -static int getDigits(const char *zDate, ...){ - va_list ap; - int val; - int N; - int min; - int max; - int nextC; - int *pVal; - int cnt = 0; - va_start(ap, zDate); - do{ - N = va_arg(ap, int); - min = va_arg(ap, int); - max = va_arg(ap, int); - nextC = va_arg(ap, int); - pVal = va_arg(ap, int*); - val = 0; - while( N-- ){ - if( !isdigit(*(u8*)zDate) ){ - return cnt; - } - val = val*10 + *zDate - '0'; - zDate++; - } - if( val<min || val>max || (nextC!=0 && nextC!=*zDate) ){ - return cnt; - } - *pVal = val; - zDate++; - cnt++; - }while( nextC ); - return cnt; -} - -/* -** Read text from z[] and convert into a floating point number. Return -** the number of digits converted. -*/ -#define getValue sqlite3AtoF - -/* -** Parse a timezone extension on the end of a date-time. -** The extension is of the form: -** -** (+/-)HH:MM -** -** If the parse is successful, write the number of minutes -** of change in *pnMin and return 0. If a parser error occurs, -** return 0. -** -** A missing specifier is not considered an error. -*/ -static int parseTimezone(const char *zDate, DateTime *p){ - int sgn = 0; - int nHr, nMn; - while( isspace(*(u8*)zDate) ){ zDate++; } - p->tz = 0; - if( *zDate=='-' ){ - sgn = -1; - }else if( *zDate=='+' ){ - sgn = +1; - }else{ - return *zDate!=0; - } - zDate++; - if( getDigits(zDate, 2, 0, 14, ':', &nHr, 2, 0, 59, 0, &nMn)!=2 ){ - return 1; - } - zDate += 5; - p->tz = sgn*(nMn + nHr*60); - while( isspace(*(u8*)zDate) ){ zDate++; } - return *zDate!=0; -} - -/* -** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. -** The HH, MM, and SS must each be exactly 2 digits. The -** fractional seconds FFFF can be one or more digits. -** -** Return 1 if there is a parsing error and 0 on success. -*/ -static int parseHhMmSs(const char *zDate, DateTime *p){ - int h, m, s; - double ms = 0.0; - if( getDigits(zDate, 2, 0, 24, ':', &h, 2, 0, 59, 0, &m)!=2 ){ - return 1; - } - zDate += 5; - if( *zDate==':' ){ - zDate++; - if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){ - return 1; - } - zDate += 2; - if( *zDate=='.' && isdigit((u8)zDate[1]) ){ - double rScale = 1.0; - zDate++; - while( isdigit(*(u8*)zDate) ){ - ms = ms*10.0 + *zDate - '0'; - rScale *= 10.0; - zDate++; - } - ms /= rScale; - } - }else{ - s = 0; - } - p->validJD = 0; - p->validHMS = 1; - p->h = h; - p->m = m; - p->s = s + ms; - if( parseTimezone(zDate, p) ) return 1; - p->validTZ = p->tz!=0; - return 0; -} - -/* -** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume -** that the YYYY-MM-DD is according to the Gregorian calendar. -** -** Reference: Meeus page 61 -*/ -static void computeJD(DateTime *p){ - int Y, M, D, A, B, X1, X2; - - if( p->validJD ) return; - if( p->validYMD ){ - Y = p->Y; - M = p->M; - D = p->D; - }else{ - Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */ - M = 1; - D = 1; - } - if( M<=2 ){ - Y--; - M += 12; - } - A = Y/100; - B = 2 - A + (A/4); - X1 = 365.25*(Y+4716); - X2 = 30.6001*(M+1); - p->rJD = X1 + X2 + D + B - 1524.5; - p->validJD = 1; - p->validYMD = 0; - if( p->validHMS ){ - p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0; - if( p->validTZ ){ - p->rJD += p->tz*60/86400.0; - p->validHMS = 0; - p->validTZ = 0; - } - } -} - -/* -** Parse dates of the form -** -** YYYY-MM-DD HH:MM:SS.FFF -** YYYY-MM-DD HH:MM:SS -** YYYY-MM-DD HH:MM -** YYYY-MM-DD -** -** Write the result into the DateTime structure and return 0 -** on success and 1 if the input string is not a well-formed -** date. -*/ -static int parseYyyyMmDd(const char *zDate, DateTime *p){ - int Y, M, D, neg; - - if( zDate[0]=='-' ){ - zDate++; - neg = 1; - }else{ - neg = 0; - } - if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){ - return 1; - } - zDate += 10; - while( isspace(*(u8*)zDate) || 'T'==*(u8*)zDate ){ zDate++; } - if( parseHhMmSs(zDate, p)==0 ){ - /* We got the time */ - }else if( *zDate==0 ){ - p->validHMS = 0; - }else{ - return 1; - } - p->validJD = 0; - p->validYMD = 1; - p->Y = neg ? -Y : Y; - p->M = M; - p->D = D; - if( p->validTZ ){ - computeJD(p); - } - return 0; -} - -/* -** Attempt to parse the given string into a Julian Day Number. Return -** the number of errors. -** -** The following are acceptable forms for the input string: -** -** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM -** DDDD.DD -** now -** -** In the first form, the +/-HH:MM is always optional. The fractional -** seconds extension (the ".FFF") is optional. The seconds portion -** (":SS.FFF") is option. The year and date can be omitted as long -** as there is a time string. The time string can be omitted as long -** as there is a year and date. -*/ -static int parseDateOrTime(const char *zDate, DateTime *p){ - memset(p, 0, sizeof(*p)); - if( parseYyyyMmDd(zDate,p)==0 ){ - return 0; - }else if( parseHhMmSs(zDate, p)==0 ){ - return 0; - }else if( sqlite3StrICmp(zDate,"now")==0){ - double r; - sqlite3OsCurrentTime(&r); - p->rJD = r; - p->validJD = 1; - return 0; - }else if( sqlite3IsNumber(zDate, 0, SQLITE_UTF8) ){ - getValue(zDate, &p->rJD); - p->validJD = 1; - return 0; - } - return 1; -} - -/* -** Compute the Year, Month, and Day from the julian day number. -*/ -static void computeYMD(DateTime *p){ - int Z, A, B, C, D, E, X1; - if( p->validYMD ) return; - if( !p->validJD ){ - p->Y = 2000; - p->M = 1; - p->D = 1; - }else{ - Z = p->rJD + 0.5; - A = (Z - 1867216.25)/36524.25; - A = Z + 1 + A - (A/4); - B = A + 1524; - C = (B - 122.1)/365.25; - D = 365.25*C; - E = (B-D)/30.6001; - X1 = 30.6001*E; - p->D = B - D - X1; - p->M = E<14 ? E-1 : E-13; - p->Y = p->M>2 ? C - 4716 : C - 4715; - } - p->validYMD = 1; -} - -/* -** Compute the Hour, Minute, and Seconds from the julian day number. -*/ -static void computeHMS(DateTime *p){ - int Z, s; - if( p->validHMS ) return; - Z = p->rJD + 0.5; - s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5; - p->s = 0.001*s; - s = p->s; - p->s -= s; - p->h = s/3600; - s -= p->h*3600; - p->m = s/60; - p->s += s - p->m*60; - p->validHMS = 1; -} - -/* -** Compute both YMD and HMS -*/ -static void computeYMD_HMS(DateTime *p){ - computeYMD(p); - computeHMS(p); -} - -/* -** Clear the YMD and HMS and the TZ -*/ -static void clearYMD_HMS_TZ(DateTime *p){ - p->validYMD = 0; - p->validHMS = 0; - p->validTZ = 0; -} - -/* -** Compute the difference (in days) between localtime and UTC (a.k.a. GMT) -** for the time value p where p is in UTC. -*/ -static double localtimeOffset(DateTime *p){ - DateTime x, y; - time_t t; - struct tm *pTm; - x = *p; - computeYMD_HMS(&x); - if( x.Y<1971 || x.Y>=2038 ){ - x.Y = 2000; - x.M = 1; - x.D = 1; - x.h = 0; - x.m = 0; - x.s = 0.0; - } else { - int s = x.s + 0.5; - x.s = s; - } - x.tz = 0; - x.validJD = 0; - computeJD(&x); - t = (x.rJD-2440587.5)*86400.0 + 0.5; - sqlite3OsEnterMutex(); - pTm = localtime(&t); - y.Y = pTm->tm_year + 1900; - y.M = pTm->tm_mon + 1; - y.D = pTm->tm_mday; - y.h = pTm->tm_hour; - y.m = pTm->tm_min; - y.s = pTm->tm_sec; - sqlite3OsLeaveMutex(); - y.validYMD = 1; - y.validHMS = 1; - y.validJD = 0; - y.validTZ = 0; - computeJD(&y); - return y.rJD - x.rJD; -} - -/* -** Process a modifier to a date-time stamp. The modifiers are -** as follows: -** -** NNN days -** NNN hours -** NNN minutes -** NNN.NNNN seconds -** NNN months -** NNN years -** start of month -** start of year -** start of week -** start of day -** weekday N -** unixepoch -** localtime -** utc -** -** Return 0 on success and 1 if there is any kind of error. -*/ -static int parseModifier(const char *zMod, DateTime *p){ - int rc = 1; - int n; - double r; - char *z, zBuf[30]; - z = zBuf; - for(n=0; n<sizeof(zBuf)-1 && zMod[n]; n++){ - z[n] = tolower(zMod[n]); - } - z[n] = 0; - switch( z[0] ){ - case 'l': { - /* localtime - ** - ** Assuming the current time value is UTC (a.k.a. GMT), shift it to - ** show local time. - */ - if( strcmp(z, "localtime")==0 ){ - computeJD(p); - p->rJD += localtimeOffset(p); - clearYMD_HMS_TZ(p); - rc = 0; - } - break; - } - case 'u': { - /* - ** unixepoch - ** - ** Treat the current value of p->rJD as the number of - ** seconds since 1970. Convert to a real julian day number. - */ - if( strcmp(z, "unixepoch")==0 && p->validJD ){ - p->rJD = p->rJD/86400.0 + 2440587.5; - clearYMD_HMS_TZ(p); - rc = 0; - }else if( strcmp(z, "utc")==0 ){ - double c1; - computeJD(p); - c1 = localtimeOffset(p); - p->rJD -= c1; - clearYMD_HMS_TZ(p); - p->rJD += c1 - localtimeOffset(p); - rc = 0; - } - break; - } - case 'w': { - /* - ** weekday N - ** - ** Move the date to the same time on the next occurrence of - ** weekday N where 0==Sunday, 1==Monday, and so forth. If the - ** date is already on the appropriate weekday, this is a no-op. - */ - if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0 - && (n=r)==r && n>=0 && r<7 ){ - int Z; - computeYMD_HMS(p); - p->validTZ = 0; - p->validJD = 0; - computeJD(p); - Z = p->rJD + 1.5; - Z %= 7; - if( Z>n ) Z -= 7; - p->rJD += n - Z; - clearYMD_HMS_TZ(p); - rc = 0; - } - break; - } - case 's': { - /* - ** start of TTTTT - ** - ** Move the date backwards to the beginning of the current day, - ** or month or year. - */ - if( strncmp(z, "start of ", 9)!=0 ) break; - z += 9; - computeYMD(p); - p->validHMS = 1; - p->h = p->m = 0; - p->s = 0.0; - p->validTZ = 0; - p->validJD = 0; - if( strcmp(z,"month")==0 ){ - p->D = 1; - rc = 0; - }else if( strcmp(z,"year")==0 ){ - computeYMD(p); - p->M = 1; - p->D = 1; - rc = 0; - }else if( strcmp(z,"day")==0 ){ - rc = 0; - } - break; - } - case '+': - case '-': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': { - n = getValue(z, &r); - if( n<=0 ) break; - if( z[n]==':' ){ - /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the - ** specified number of hours, minutes, seconds, and fractional seconds - ** to the time. The ".FFF" may be omitted. The ":SS.FFF" may be - ** omitted. - */ - const char *z2 = z; - DateTime tx; - int day; - if( !isdigit(*(u8*)z2) ) z2++; - memset(&tx, 0, sizeof(tx)); - if( parseHhMmSs(z2, &tx) ) break; - computeJD(&tx); - tx.rJD -= 0.5; - day = (int)tx.rJD; - tx.rJD -= day; - if( z[0]=='-' ) tx.rJD = -tx.rJD; - computeJD(p); - clearYMD_HMS_TZ(p); - p->rJD += tx.rJD; - rc = 0; - break; - } - z += n; - while( isspace(*(u8*)z) ) z++; - n = strlen(z); - if( n>10 || n<3 ) break; - if( z[n-1]=='s' ){ z[n-1] = 0; n--; } - computeJD(p); - rc = 0; - if( n==3 && strcmp(z,"day")==0 ){ - p->rJD += r; - }else if( n==4 && strcmp(z,"hour")==0 ){ - p->rJD += r/24.0; - }else if( n==6 && strcmp(z,"minute")==0 ){ - p->rJD += r/(24.0*60.0); - }else if( n==6 && strcmp(z,"second")==0 ){ - p->rJD += r/(24.0*60.0*60.0); - }else if( n==5 && strcmp(z,"month")==0 ){ - int x, y; - computeYMD_HMS(p); - p->M += r; - x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; - p->Y += x; - p->M -= x*12; - p->validJD = 0; - computeJD(p); - y = r; - if( y!=r ){ - p->rJD += (r - y)*30.0; - } - }else if( n==4 && strcmp(z,"year")==0 ){ - computeYMD_HMS(p); - p->Y += r; - p->validJD = 0; - computeJD(p); - }else{ - rc = 1; - } - clearYMD_HMS_TZ(p); - break; - } - default: { - break; - } - } - return rc; -} - -/* -** Process time function arguments. argv[0] is a date-time stamp. -** argv[1] and following are modifiers. Parse them all and write -** the resulting time into the DateTime structure p. Return 0 -** on success and 1 if there are any errors. -*/ -static int isDate(int argc, sqlite3_value **argv, DateTime *p){ - int i; - if( argc==0 ) return 1; - if( SQLITE_NULL==sqlite3_value_type(argv[0]) || - parseDateOrTime(sqlite3_value_text(argv[0]), p) ) return 1; - for(i=1; i<argc; i++){ - if( SQLITE_NULL==sqlite3_value_type(argv[i]) || - parseModifier(sqlite3_value_text(argv[i]), p) ) return 1; - } - return 0; -} - - -/* -** The following routines implement the various date and time functions -** of SQLite. -*/ - -/* -** julianday( TIMESTRING, MOD, MOD, ...) -** -** Return the julian day number of the date specified in the arguments -*/ -static void juliandayFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - DateTime x; - if( isDate(argc, argv, &x)==0 ){ - computeJD(&x); - sqlite3_result_double(context, x.rJD); - } -} - -/* -** datetime( TIMESTRING, MOD, MOD, ...) -** -** Return YYYY-MM-DD HH:MM:SS -*/ -static void datetimeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - DateTime x; - if( isDate(argc, argv, &x)==0 ){ - char zBuf[100]; - computeYMD_HMS(&x); - sprintf(zBuf, "%04d-%02d-%02d %02d:%02d:%02d",x.Y, x.M, x.D, x.h, x.m, - (int)(x.s)); - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); - } -} - -/* -** time( TIMESTRING, MOD, MOD, ...) -** -** Return HH:MM:SS -*/ -static void timeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - DateTime x; - if( isDate(argc, argv, &x)==0 ){ - char zBuf[100]; - computeHMS(&x); - sprintf(zBuf, "%02d:%02d:%02d", x.h, x.m, (int)x.s); - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); - } -} - -/* -** date( TIMESTRING, MOD, MOD, ...) -** -** Return YYYY-MM-DD -*/ -static void dateFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - DateTime x; - if( isDate(argc, argv, &x)==0 ){ - char zBuf[100]; - computeYMD(&x); - sprintf(zBuf, "%04d-%02d-%02d", x.Y, x.M, x.D); - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); - } -} - -/* -** strftime( FORMAT, TIMESTRING, MOD, MOD, ...) -** -** Return a string described by FORMAT. Conversions as follows: -** -** %d day of month -** %f ** fractional seconds SS.SSS -** %H hour 00-24 -** %j day of year 000-366 -** %J ** Julian day number -** %m month 01-12 -** %M minute 00-59 -** %s seconds since 1970-01-01 -** %S seconds 00-59 -** %w day of week 0-6 sunday==0 -** %W week of year 00-53 -** %Y year 0000-9999 -** %% % -*/ -static void strftimeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - DateTime x; - int n, i, j; - char *z; - const char *zFmt = sqlite3_value_text(argv[0]); - char zBuf[100]; - if( zFmt==0 || isDate(argc-1, argv+1, &x) ) return; - for(i=0, n=1; zFmt[i]; i++, n++){ - if( zFmt[i]=='%' ){ - switch( zFmt[i+1] ){ - case 'd': - case 'H': - case 'm': - case 'M': - case 'S': - case 'W': - n++; - /* fall thru */ - case 'w': - case '%': - break; - case 'f': - n += 8; - break; - case 'j': - n += 3; - break; - case 'Y': - n += 8; - break; - case 's': - case 'J': - n += 50; - break; - default: - return; /* ERROR. return a NULL */ - } - i++; - } - } - if( n<sizeof(zBuf) ){ - z = zBuf; - }else{ - z = sqliteMalloc( n ); - if( z==0 ) return; - } - computeJD(&x); - computeYMD_HMS(&x); - for(i=j=0; zFmt[i]; i++){ - if( zFmt[i]!='%' ){ - z[j++] = zFmt[i]; - }else{ - i++; - switch( zFmt[i] ){ - case 'd': sprintf(&z[j],"%02d",x.D); j+=2; break; - case 'f': { - int s = x.s; - int ms = (x.s - s)*1000.0; - sprintf(&z[j],"%02d.%03d",s,ms); - j += strlen(&z[j]); - break; - } - case 'H': sprintf(&z[j],"%02d",x.h); j+=2; break; - case 'W': /* Fall thru */ - case 'j': { - int n; /* Number of days since 1st day of year */ - DateTime y = x; - y.validJD = 0; - y.M = 1; - y.D = 1; - computeJD(&y); - n = x.rJD - y.rJD; - if( zFmt[i]=='W' ){ - int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */ - wd = ((int)(x.rJD+0.5)) % 7; - sprintf(&z[j],"%02d",(n+7-wd)/7); - j += 2; - }else{ - sprintf(&z[j],"%03d",n+1); - j += 3; - } - break; - } - case 'J': sprintf(&z[j],"%.16g",x.rJD); j+=strlen(&z[j]); break; - case 'm': sprintf(&z[j],"%02d",x.M); j+=2; break; - case 'M': sprintf(&z[j],"%02d",x.m); j+=2; break; - case 's': { - sprintf(&z[j],"%d",(int)((x.rJD-2440587.5)*86400.0 + 0.5)); - j += strlen(&z[j]); - break; - } - case 'S': sprintf(&z[j],"%02d",(int)(x.s+0.5)); j+=2; break; - case 'w': z[j++] = (((int)(x.rJD+1.5)) % 7) + '0'; break; - case 'Y': sprintf(&z[j],"%04d",x.Y); j+=strlen(&z[j]); break; - case '%': z[j++] = '%'; break; - } - } - } - z[j] = 0; - sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT); - if( z!=zBuf ){ - sqliteFree(z); - } -} - -/* -** current_time() -** -** This function returns the same value as time('now'). -*/ -static void ctimeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - sqlite3_value *pVal = sqlite3ValueNew(); - if( pVal ){ - sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC); - timeFunc(context, 1, &pVal); - sqlite3ValueFree(pVal); - } -} - -/* -** current_date() -** -** This function returns the same value as date('now'). -*/ -static void cdateFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - sqlite3_value *pVal = sqlite3ValueNew(); - if( pVal ){ - sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC); - dateFunc(context, 1, &pVal); - sqlite3ValueFree(pVal); - } -} - -/* -** current_timestamp() -** -** This function returns the same value as datetime('now'). -*/ -static void ctimestampFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - sqlite3_value *pVal = sqlite3ValueNew(); - if( pVal ){ - sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC); - datetimeFunc(context, 1, &pVal); - sqlite3ValueFree(pVal); - } -} -#endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */ - -#ifdef SQLITE_OMIT_DATETIME_FUNCS -/* -** If the library is compiled to omit the full-scale date and time -** handling (to get a smaller binary), the following minimal version -** of the functions current_time(), current_date() and current_timestamp() -** are included instead. This is to support column declarations that -** include "DEFAULT CURRENT_TIME" etc. -** -** This function uses the C-library functions time(), gmtime() -** and strftime(). The format string to pass to strftime() is supplied -** as the user-data for the function. -*/ -static void currentTimeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - time_t t; - char *zFormat = (char *)sqlite3_user_data(context); - char zBuf[20]; - - time(&t); -#ifdef SQLITE_TEST - { - extern int sqlite3_current_time; /* See os_XXX.c */ - if( sqlite3_current_time ){ - t = sqlite3_current_time; - } - } -#endif - - sqlite3OsEnterMutex(); - strftime(zBuf, 20, zFormat, gmtime(&t)); - sqlite3OsLeaveMutex(); - - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); -} -#endif - -/* -** This function registered all of the above C functions as SQL -** functions. This should be the only routine in this file with -** external linkage. -*/ -void sqlite3RegisterDateTimeFunctions(sqlite3 *db){ -#ifndef SQLITE_OMIT_DATETIME_FUNCS - static const struct { - char *zName; - int nArg; - void (*xFunc)(sqlite3_context*,int,sqlite3_value**); - } aFuncs[] = { - { "julianday", -1, juliandayFunc }, - { "date", -1, dateFunc }, - { "time", -1, timeFunc }, - { "datetime", -1, datetimeFunc }, - { "strftime", -1, strftimeFunc }, - { "current_time", 0, ctimeFunc }, - { "current_timestamp", 0, ctimestampFunc }, - { "current_date", 0, cdateFunc }, - }; - int i; - - for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ - sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg, - SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0); - } -#else - static const struct { - char *zName; - char *zFormat; - } aFuncs[] = { - { "current_time", "%H:%M:%S" }, - { "current_date", "%Y-%m-%d" }, - { "current_timestamp", "%Y-%m-%d %H:%M:%S" } - }; - int i; - - for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ - sqlite3_create_function(db, aFuncs[i].zName, 0, SQLITE_UTF8, - aFuncs[i].zFormat, currentTimeFunc, 0, 0); - } -#endif -} diff --git a/ext/pdo_sqlite/sqlite/src/delete.c b/ext/pdo_sqlite/sqlite/src/delete.c deleted file mode 100644 index 7eb618b78fdb8..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/delete.c +++ /dev/null @@ -1,445 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** in order to generate code for DELETE FROM statements. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** Look up every table that is named in pSrc. If any table is not found, -** add an error message to pParse->zErrMsg and return NULL. If all tables -** are found, return a pointer to the last table. -*/ -Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){ - Table *pTab = 0; - int i; - struct SrcList_item *pItem; - for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){ - pTab = sqlite3LocateTable(pParse, pItem->zName, pItem->zDatabase); - sqlite3DeleteTable(pParse->db, pItem->pTab); - pItem->pTab = pTab; - if( pTab ){ - pTab->nRef++; - } - } - return pTab; -} - -/* -** Check to make sure the given table is writable. If it is not -** writable, generate an error message and return 1. If it is -** writable return 0; -*/ -int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ - if( pTab->readOnly && (pParse->db->flags & SQLITE_WriteSchema)==0 - && pParse->nested==0 ){ - sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName); - return 1; - } -#ifndef SQLITE_OMIT_VIEW - if( !viewOk && pTab->pSelect ){ - sqlite3ErrorMsg(pParse,"cannot modify %s because it is a view",pTab->zName); - return 1; - } -#endif - return 0; -} - -/* -** Generate code that will open a table for reading. -*/ -void sqlite3OpenTableForReading( - Vdbe *v, /* Generate code into this VDBE */ - int iCur, /* The cursor number of the table */ - Table *pTab /* The table to be opened */ -){ - sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0); - VdbeComment((v, "# %s", pTab->zName)); - sqlite3VdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum); - sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, pTab->nCol); -} - - -/* -** Generate code for a DELETE FROM statement. -** -** DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL; -** \________/ \________________/ -** pTabList pWhere -*/ -void sqlite3DeleteFrom( - Parse *pParse, /* The parser context */ - SrcList *pTabList, /* The table from which we should delete things */ - Expr *pWhere /* The WHERE clause. May be null */ -){ - Vdbe *v; /* The virtual database engine */ - Table *pTab; /* The table from which records will be deleted */ - const char *zDb; /* Name of database holding pTab */ - int end, addr = 0; /* A couple addresses of generated code */ - int i; /* Loop counter */ - WhereInfo *pWInfo; /* Information about the WHERE clause */ - Index *pIdx; /* For looping over indices of the table */ - int iCur; /* VDBE Cursor number for pTab */ - sqlite3 *db; /* Main database structure */ - AuthContext sContext; /* Authorization context */ - int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */ - NameContext sNC; /* Name context to resolve expressions in */ - -#ifndef SQLITE_OMIT_TRIGGER - int isView; /* True if attempting to delete from a view */ - int triggers_exist = 0; /* True if any triggers exist */ -#endif - - sContext.pParse = 0; - if( pParse->nErr || sqlite3_malloc_failed ){ - goto delete_from_cleanup; - } - db = pParse->db; - assert( pTabList->nSrc==1 ); - - /* Locate the table which we want to delete. This table has to be - ** put in an SrcList structure because some of the subroutines we - ** will be calling are designed to work with multiple tables and expect - ** an SrcList* parameter instead of just a Table* parameter. - */ - pTab = sqlite3SrcListLookup(pParse, pTabList); - if( pTab==0 ) goto delete_from_cleanup; - - /* Figure out if we have any triggers and if the table being - ** deleted from is a view - */ -#ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0); - isView = pTab->pSelect!=0; -#else -# define triggers_exist 0 -# define isView 0 -#endif -#ifdef SQLITE_OMIT_VIEW -# undef isView -# define isView 0 -#endif - - if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){ - goto delete_from_cleanup; - } - assert( pTab->iDb<db->nDb ); - zDb = db->aDb[pTab->iDb].zName; - if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ - goto delete_from_cleanup; - } - - /* If pTab is really a view, make sure it has been initialized. - */ - if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){ - goto delete_from_cleanup; - } - - /* Allocate a cursor used to store the old.* data for a trigger. - */ - if( triggers_exist ){ - oldIdx = pParse->nTab++; - } - - /* Resolve the column names in the WHERE clause. - */ - assert( pTabList->nSrc==1 ); - iCur = pTabList->a[0].iCursor = pParse->nTab++; - memset(&sNC, 0, sizeof(sNC)); - sNC.pParse = pParse; - sNC.pSrcList = pTabList; - if( sqlite3ExprResolveNames(&sNC, pWhere) ){ - goto delete_from_cleanup; - } - - /* Start the view context - */ - if( isView ){ - sqlite3AuthContextPush(pParse, &sContext, pTab->zName); - } - - /* Begin generating code. - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ){ - goto delete_from_cleanup; - } - if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); - sqlite3BeginWriteOperation(pParse, triggers_exist, pTab->iDb); - - /* If we are trying to delete from a view, realize that view into - ** a ephemeral table. - */ - if( isView ){ - Select *pView = sqlite3SelectDup(pTab->pSelect); - sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0); - sqlite3SelectDelete(pView); - } - - /* Initialize the counter of the number of rows deleted, if - ** we are counting rows. - */ - if( db->flags & SQLITE_CountRows ){ - sqlite3VdbeAddOp(v, OP_Integer, 0, 0); - } - - /* Special case: A DELETE without a WHERE clause deletes everything. - ** It is easier just to erase the whole table. Note, however, that - ** this means that the row change count will be incorrect. - */ - if( pWhere==0 && !triggers_exist ){ - if( db->flags & SQLITE_CountRows ){ - /* If counting rows deleted, just count the total number of - ** entries in the table. */ - int endOfLoop = sqlite3VdbeMakeLabel(v); - int addr; - if( !isView ){ - sqlite3OpenTableForReading(v, iCur, pTab); - } - sqlite3VdbeAddOp(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2); - addr = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); - sqlite3VdbeAddOp(v, OP_Next, iCur, addr); - sqlite3VdbeResolveLabel(v, endOfLoop); - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb); - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - sqlite3VdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb); - } - } - } - - /* The usual case: There is a WHERE clause so we have to scan through - ** the table and pick which records to delete. - */ - else{ - /* Ensure all required collation sequences are available. */ - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - if( sqlite3CheckIndexCollSeq(pParse, pIdx) ){ - goto delete_from_cleanup; - } - } - - /* Begin the database scan - */ - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0); - if( pWInfo==0 ) goto delete_from_cleanup; - - /* Remember the rowid of every item to be deleted. - */ - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0); - if( db->flags & SQLITE_CountRows ){ - sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); - } - - /* End the database scan loop. - */ - sqlite3WhereEnd(pWInfo); - - /* Open the pseudo-table used to store OLD if there are triggers. - */ - if( triggers_exist ){ - sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); - sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol); - } - - /* Delete every item whose key was written to the list during the - ** database scan. We have to delete items after the scan is complete - ** because deleting an item can change the scan order. - */ - end = sqlite3VdbeMakeLabel(v); - - /* This is the beginning of the delete loop when there are - ** row triggers. - */ - if( triggers_exist ){ - addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, end); - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3OpenTableForReading(v, iCur, pTab); - } - sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_RowData, iCur, 0); - sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0); - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - - (void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TRIGGER_BEFORE, pTab, - -1, oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, - addr); - } - - if( !isView ){ - /* Open cursors for the table we are deleting from and all its - ** indices. If there are row triggers, this happens inside the - ** OP_FifoRead loop because the cursor have to all be closed - ** before the trigger fires. If there are no row triggers, the - ** cursors are opened only once on the outside the loop. - */ - sqlite3OpenTableAndIndices(pParse, pTab, iCur, OP_OpenWrite); - - /* This is the beginning of the delete loop when there are no - ** row triggers */ - if( !triggers_exist ){ - addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, end); - } - - /* Delete the row */ - sqlite3GenerateRowDelete(db, v, pTab, iCur, pParse->nested==0); - } - - /* If there are row triggers, close all cursors then invoke - ** the AFTER triggers - */ - if( triggers_exist ){ - if( !isView ){ - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - sqlite3VdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); - } - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - (void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TRIGGER_AFTER, pTab, -1, - oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, - addr); - } - - /* End of the delete loop */ - sqlite3VdbeAddOp(v, OP_Goto, 0, addr); - sqlite3VdbeResolveLabel(v, end); - - /* Close the cursors after the loop if there are no row triggers */ - if( !triggers_exist ){ - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - sqlite3VdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); - } - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - } - - /* - ** Return the number of rows that were deleted. If this routine is - ** generating code because of a call to sqlite3NestedParse(), do not - ** invoke the callback function. - */ - if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){ - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "rows deleted", P3_STATIC); - } - -delete_from_cleanup: - sqlite3AuthContextPop(&sContext); - sqlite3SrcListDelete(pTabList); - sqlite3ExprDelete(pWhere); - return; -} - -/* -** This routine generates VDBE code that causes a single row of a -** single table to be deleted. -** -** The VDBE must be in a particular state when this routine is called. -** These are the requirements: -** -** 1. A read/write cursor pointing to pTab, the table containing the row -** to be deleted, must be opened as cursor number "base". -** -** 2. Read/write cursors for all indices of pTab must be open as -** cursor number base+i for the i-th index. -** -** 3. The record number of the row to be deleted must be on the top -** of the stack. -** -** This routine pops the top of the stack to remove the record number -** and then generates code to remove both the table record and all index -** entries that point to that record. -*/ -void sqlite3GenerateRowDelete( - sqlite3 *db, /* The database containing the index */ - Vdbe *v, /* Generate code into this VDBE */ - Table *pTab, /* Table containing the row to be deleted */ - int iCur, /* Cursor number for the table */ - int count /* Increment the row change counter */ -){ - int addr; - addr = sqlite3VdbeAddOp(v, OP_NotExists, iCur, 0); - sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, 0); - sqlite3VdbeAddOp(v, OP_Delete, iCur, (count?OPFLAG_NCHANGE:0)); - sqlite3VdbeJumpHere(v, addr); -} - -/* -** This routine generates VDBE code that causes the deletion of all -** index entries associated with a single row of a single table. -** -** The VDBE must be in a particular state when this routine is called. -** These are the requirements: -** -** 1. A read/write cursor pointing to pTab, the table containing the row -** to be deleted, must be opened as cursor number "iCur". -** -** 2. Read/write cursors for all indices of pTab must be open as -** cursor number iCur+i for the i-th index. -** -** 3. The "iCur" cursor must be pointing to the row that is to be -** deleted. -*/ -void sqlite3GenerateRowIndexDelete( - sqlite3 *db, /* The database containing the index */ - Vdbe *v, /* Generate code into this VDBE */ - Table *pTab, /* Table containing the row to be deleted */ - int iCur, /* Cursor number for the table */ - char *aIdxUsed /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */ -){ - int i; - Index *pIdx; - - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue; - sqlite3GenerateIndexKey(v, pIdx, iCur); - sqlite3VdbeAddOp(v, OP_IdxDelete, iCur+i, 0); - } -} - -/* -** Generate code that will assemble an index key and put it on the top -** of the tack. The key with be for index pIdx which is an index on pTab. -** iCur is the index of a cursor open on the pTab table and pointing to -** the entry that needs indexing. -*/ -void sqlite3GenerateIndexKey( - Vdbe *v, /* Generate code into this VDBE */ - Index *pIdx, /* The index for which to generate a key */ - int iCur /* Cursor number for the pIdx->pTable table */ -){ - int j; - Table *pTab = pIdx->pTable; - - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - for(j=0; j<pIdx->nColumn; j++){ - int idx = pIdx->aiColumn[j]; - if( idx==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_Dup, j, 0); - }else{ - sqlite3VdbeAddOp(v, OP_Column, iCur, idx); - sqlite3ColumnDefault(v, pTab, idx); - } - } - sqlite3VdbeAddOp(v, OP_MakeIdxRec, pIdx->nColumn, 0); - sqlite3IndexAffinityStr(v, pIdx); -} diff --git a/ext/pdo_sqlite/sqlite/src/experimental.c b/ext/pdo_sqlite/sqlite/src/experimental.c deleted file mode 100644 index ec40891a3aea8..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/experimental.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -** 2005 January 20 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are not a part of the official -** SQLite API. These routines are unsupported. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" - -/* -** Set all the parameters in the compiled SQL statement to NULL. -*/ -int sqlite3_clear_bindings(sqlite3_stmt *pStmt){ - int i; - int rc = SQLITE_OK; - for(i=1; rc==SQLITE_OK && i<=sqlite3_bind_parameter_count(pStmt); i++){ - rc = sqlite3_bind_null(pStmt, i); - } - return rc; -} - -/* -** Sleep for a little while. Return the amount of time slept. -*/ -int sqlite3_sleep(int ms){ - return sqlite3OsSleep(ms); -} diff --git a/ext/pdo_sqlite/sqlite/src/expr.c b/ext/pdo_sqlite/sqlite/src/expr.c deleted file mode 100644 index 1276fe9f6aa98..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/expr.c +++ /dev/null @@ -1,2253 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains routines used for analyzing expressions and -** for generating VDBE code that evaluates expressions in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <ctype.h> - -/* -** Return the 'affinity' of the expression pExpr if any. -** -** If pExpr is a column, a reference to a column via an 'AS' alias, -** or a sub-select with a column as the return value, then the -** affinity of that column is returned. Otherwise, 0x00 is returned, -** indicating no affinity for the expression. -** -** i.e. the WHERE clause expresssions in the following statements all -** have an affinity: -** -** CREATE TABLE t1(a); -** SELECT * FROM t1 WHERE a; -** SELECT a AS b FROM t1 WHERE b; -** SELECT * FROM t1 WHERE (select a from t1); -*/ -char sqlite3ExprAffinity(Expr *pExpr){ - int op = pExpr->op; - if( op==TK_AS ){ - return sqlite3ExprAffinity(pExpr->pLeft); - } - if( op==TK_SELECT ){ - return sqlite3ExprAffinity(pExpr->pSelect->pEList->a[0].pExpr); - } -#ifndef SQLITE_OMIT_CAST - if( op==TK_CAST ){ - return sqlite3AffinityType(&pExpr->token); - } -#endif - return pExpr->affinity; -} - -/* -** Return the default collation sequence for the expression pExpr. If -** there is no default collation type, return 0. -*/ -CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ - CollSeq *pColl = 0; - if( pExpr ){ - pColl = pExpr->pColl; - if( (pExpr->op==TK_AS || pExpr->op==TK_CAST) && !pColl ){ - return sqlite3ExprCollSeq(pParse, pExpr->pLeft); - } - } - if( sqlite3CheckCollSeq(pParse, pColl) ){ - pColl = 0; - } - return pColl; -} - -/* -** pExpr is an operand of a comparison operator. aff2 is the -** type affinity of the other operand. This routine returns the -** type affinity that should be used for the comparison operator. -*/ -char sqlite3CompareAffinity(Expr *pExpr, char aff2){ - char aff1 = sqlite3ExprAffinity(pExpr); - if( aff1 && aff2 ){ - /* Both sides of the comparison are columns. If one has numeric or - ** integer affinity, use that. Otherwise use no affinity. - */ - if( aff1==SQLITE_AFF_INTEGER || aff2==SQLITE_AFF_INTEGER ){ - return SQLITE_AFF_INTEGER; - }else if( aff1==SQLITE_AFF_NUMERIC || aff2==SQLITE_AFF_NUMERIC ){ - return SQLITE_AFF_NUMERIC; - }else{ - return SQLITE_AFF_NONE; - } - }else if( !aff1 && !aff2 ){ - /* Neither side of the comparison is a column. Compare the - ** results directly. - */ - /* return SQLITE_AFF_NUMERIC; // Ticket #805 */ - return SQLITE_AFF_NONE; - }else{ - /* One side is a column, the other is not. Use the columns affinity. */ - assert( aff1==0 || aff2==0 ); - return (aff1 + aff2); - } -} - -/* -** pExpr is a comparison operator. Return the type affinity that should -** be applied to both operands prior to doing the comparison. -*/ -static char comparisonAffinity(Expr *pExpr){ - char aff; - assert( pExpr->op==TK_EQ || pExpr->op==TK_IN || pExpr->op==TK_LT || - pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE || - pExpr->op==TK_NE ); - assert( pExpr->pLeft ); - aff = sqlite3ExprAffinity(pExpr->pLeft); - if( pExpr->pRight ){ - aff = sqlite3CompareAffinity(pExpr->pRight, aff); - } - else if( pExpr->pSelect ){ - aff = sqlite3CompareAffinity(pExpr->pSelect->pEList->a[0].pExpr, aff); - } - else if( !aff ){ - aff = SQLITE_AFF_NUMERIC; - } - return aff; -} - -/* -** pExpr is a comparison expression, eg. '=', '<', IN(...) etc. -** idx_affinity is the affinity of an indexed column. Return true -** if the index with affinity idx_affinity may be used to implement -** the comparison in pExpr. -*/ -int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){ - char aff = comparisonAffinity(pExpr); - return - (aff==SQLITE_AFF_NONE) || - (aff==SQLITE_AFF_NUMERIC && idx_affinity==SQLITE_AFF_INTEGER) || - (aff==SQLITE_AFF_INTEGER && idx_affinity==SQLITE_AFF_NUMERIC) || - (aff==idx_affinity); -} - -/* -** Return the P1 value that should be used for a binary comparison -** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2. -** If jumpIfNull is true, then set the low byte of the returned -** P1 value to tell the opcode to jump if either expression -** evaluates to NULL. -*/ -static int binaryCompareP1(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){ - char aff = sqlite3ExprAffinity(pExpr2); - return ((int)sqlite3CompareAffinity(pExpr1, aff))+(jumpIfNull?0x100:0); -} - -/* -** Return a pointer to the collation sequence that should be used by -** a binary comparison operator comparing pLeft and pRight. -** -** If the left hand expression has a collating sequence type, then it is -** used. Otherwise the collation sequence for the right hand expression -** is used, or the default (BINARY) if neither expression has a collating -** type. -*/ -static CollSeq* binaryCompareCollSeq(Parse *pParse, Expr *pLeft, Expr *pRight){ - CollSeq *pColl = sqlite3ExprCollSeq(pParse, pLeft); - if( !pColl ){ - pColl = sqlite3ExprCollSeq(pParse, pRight); - } - return pColl; -} - -/* -** Generate code for a comparison operator. -*/ -static int codeCompare( - Parse *pParse, /* The parsing (and code generating) context */ - Expr *pLeft, /* The left operand */ - Expr *pRight, /* The right operand */ - int opcode, /* The comparison opcode */ - int dest, /* Jump here if true. */ - int jumpIfNull /* If true, jump if either operand is NULL */ -){ - int p1 = binaryCompareP1(pLeft, pRight, jumpIfNull); - CollSeq *p3 = binaryCompareCollSeq(pParse, pLeft, pRight); - return sqlite3VdbeOp3(pParse->pVdbe, opcode, p1, dest, (void*)p3, P3_COLLSEQ); -} - -/* -** Construct a new expression node and return a pointer to it. Memory -** for this node is obtained from sqliteMalloc(). The calling function -** is responsible for making sure the node eventually gets freed. -*/ -Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){ - Expr *pNew; - pNew = sqliteMalloc( sizeof(Expr) ); - if( pNew==0 ){ - /* When malloc fails, delete pLeft and pRight. Expressions passed to - ** this function must always be allocated with sqlite3Expr() for this - ** reason. - */ - sqlite3ExprDelete(pLeft); - sqlite3ExprDelete(pRight); - return 0; - } - pNew->op = op; - pNew->pLeft = pLeft; - pNew->pRight = pRight; - pNew->iAgg = -1; - if( pToken ){ - assert( pToken->dyn==0 ); - pNew->span = pNew->token = *pToken; - }else if( pLeft && pRight ){ - sqlite3ExprSpan(pNew, &pLeft->span, &pRight->span); - } - return pNew; -} - -/* -** When doing a nested parse, you can include terms in an expression -** that look like this: #0 #1 #2 ... These terms refer to elements -** on the stack. "#0" means the top of the stack. -** "#1" means the next down on the stack. And so forth. -** -** This routine is called by the parser to deal with on of those terms. -** It immediately generates code to store the value in a memory location. -** The returns an expression that will code to extract the value from -** that memory location as needed. -*/ -Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){ - Vdbe *v = pParse->pVdbe; - Expr *p; - int depth; - if( pParse->nested==0 ){ - sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken); - return 0; - } - if( v==0 ) return 0; - p = sqlite3Expr(TK_REGISTER, 0, 0, pToken); - if( p==0 ){ - return 0; /* Malloc failed */ - } - depth = atoi(&pToken->z[1]); - p->iTable = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_Dup, depth, 0); - sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1); - return p; -} - -/* -** Join two expressions using an AND operator. If either expression is -** NULL, then just return the other expression. -*/ -Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){ - if( pLeft==0 ){ - return pRight; - }else if( pRight==0 ){ - return pLeft; - }else{ - return sqlite3Expr(TK_AND, pLeft, pRight, 0); - } -} - -/* -** Set the Expr.span field of the given expression to span all -** text between the two given tokens. -*/ -void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){ - assert( pRight!=0 ); - assert( pLeft!=0 ); - if( !sqlite3_malloc_failed && pRight->z && pLeft->z ){ - assert( pLeft->dyn==0 || pLeft->z[pLeft->n]==0 ); - if( pLeft->dyn==0 && pRight->dyn==0 ){ - pExpr->span.z = pLeft->z; - pExpr->span.n = pRight->n + (pRight->z - pLeft->z); - }else{ - pExpr->span.z = 0; - } - } -} - -/* -** Construct a new expression node for a function with multiple -** arguments. -*/ -Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){ - Expr *pNew; - pNew = sqliteMalloc( sizeof(Expr) ); - if( pNew==0 ){ - sqlite3ExprListDelete(pList); /* Avoid leaking memory when malloc fails */ - return 0; - } - pNew->op = TK_FUNCTION; - pNew->pList = pList; - if( pToken ){ - assert( pToken->dyn==0 ); - pNew->token = *pToken; - }else{ - pNew->token.z = 0; - } - pNew->span = pNew->token; - return pNew; -} - -/* -** Assign a variable number to an expression that encodes a wildcard -** in the original SQL statement. -** -** Wildcards consisting of a single "?" are assigned the next sequential -** variable number. -** -** Wildcards of the form "?nnn" are assigned the number "nnn". We make -** sure "nnn" is not too be to avoid a denial of service attack when -** the SQL statement comes from an external source. -** -** Wildcards of the form ":aaa" or "$aaa" are assigned the same number -** as the previous instance of the same wildcard. Or if this is the first -** instance of the wildcard, the next sequenial variable number is -** assigned. -*/ -void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ - Token *pToken; - if( pExpr==0 ) return; - pToken = &pExpr->token; - assert( pToken->n>=1 ); - assert( pToken->z!=0 ); - assert( pToken->z[0]!=0 ); - if( pToken->n==1 ){ - /* Wildcard of the form "?". Assign the next variable number */ - pExpr->iTable = ++pParse->nVar; - }else if( pToken->z[0]=='?' ){ - /* Wildcard of the form "?nnn". Convert "nnn" to an integer and - ** use it as the variable number */ - int i; - pExpr->iTable = i = atoi(&pToken->z[1]); - if( i<1 || i>SQLITE_MAX_VARIABLE_NUMBER ){ - sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d", - SQLITE_MAX_VARIABLE_NUMBER); - } - if( i>pParse->nVar ){ - pParse->nVar = i; - } - }else{ - /* Wildcards of the form ":aaa" or "$aaa". Reuse the same variable - ** number as the prior appearance of the same name, or if the name - ** has never appeared before, reuse the same variable number - */ - int i, n; - n = pToken->n; - for(i=0; i<pParse->nVarExpr; i++){ - Expr *pE; - if( (pE = pParse->apVarExpr[i])!=0 - && pE->token.n==n - && memcmp(pE->token.z, pToken->z, n)==0 ){ - pExpr->iTable = pE->iTable; - break; - } - } - if( i>=pParse->nVarExpr ){ - pExpr->iTable = ++pParse->nVar; - if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){ - pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10; - sqlite3ReallocOrFree((void**)&pParse->apVarExpr, - pParse->nVarExprAlloc*sizeof(pParse->apVarExpr[0]) ); - } - if( !sqlite3_malloc_failed ){ - assert( pParse->apVarExpr!=0 ); - pParse->apVarExpr[pParse->nVarExpr++] = pExpr; - } - } - } -} - -/* -** Recursively delete an expression tree. -*/ -void sqlite3ExprDelete(Expr *p){ - if( p==0 ) return; - if( p->span.dyn ) sqliteFree((char*)p->span.z); - if( p->token.dyn ) sqliteFree((char*)p->token.z); - sqlite3ExprDelete(p->pLeft); - sqlite3ExprDelete(p->pRight); - sqlite3ExprListDelete(p->pList); - sqlite3SelectDelete(p->pSelect); - sqliteFree(p); -} - -/* -** The Expr.token field might be a string literal that is quoted. -** If so, remove the quotation marks. -*/ -void sqlite3DequoteExpr(Expr *p){ - if( ExprHasAnyProperty(p, EP_Dequoted) ){ - return; - } - ExprSetProperty(p, EP_Dequoted); - if( p->token.dyn==0 ){ - sqlite3TokenCopy(&p->token, &p->token); - } - sqlite3Dequote((char*)p->token.z); -} - - -/* -** The following group of routines make deep copies of expressions, -** expression lists, ID lists, and select statements. The copies can -** be deleted (by being passed to their respective ...Delete() routines) -** without effecting the originals. -** -** The expression list, ID, and source lists return by sqlite3ExprListDup(), -** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded -** by subsequent calls to sqlite*ListAppend() routines. -** -** Any tables that the SrcList might point to are not duplicated. -*/ -Expr *sqlite3ExprDup(Expr *p){ - Expr *pNew; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*p) ); - if( pNew==0 ) return 0; - memcpy(pNew, p, sizeof(*pNew)); - if( p->token.z!=0 ){ - pNew->token.z = sqliteStrNDup(p->token.z, p->token.n); - pNew->token.dyn = 1; - }else{ - assert( pNew->token.z==0 ); - } - pNew->span.z = 0; - pNew->pLeft = sqlite3ExprDup(p->pLeft); - pNew->pRight = sqlite3ExprDup(p->pRight); - pNew->pList = sqlite3ExprListDup(p->pList); - pNew->pSelect = sqlite3SelectDup(p->pSelect); - pNew->pTab = p->pTab; - return pNew; -} -void sqlite3TokenCopy(Token *pTo, Token *pFrom){ - if( pTo->dyn ) sqliteFree((char*)pTo->z); - if( pFrom->z ){ - pTo->n = pFrom->n; - pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); - pTo->dyn = 1; - }else{ - pTo->z = 0; - } -} -ExprList *sqlite3ExprListDup(ExprList *p){ - ExprList *pNew; - struct ExprList_item *pItem, *pOldItem; - int i; - if( p==0 ) return 0; - pNew = sqliteMalloc( sizeof(*pNew) ); - if( pNew==0 ) return 0; - pNew->nExpr = pNew->nAlloc = p->nExpr; - pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) ); - if( pItem==0 ){ - sqliteFree(pNew); - return 0; - } - pOldItem = p->a; - for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){ - Expr *pNewExpr, *pOldExpr; - pItem->pExpr = pNewExpr = sqlite3ExprDup(pOldExpr = pOldItem->pExpr); - if( pOldExpr->span.z!=0 && pNewExpr ){ - /* Always make a copy of the span for top-level expressions in the - ** expression list. The logic in SELECT processing that determines - ** the names of columns in the result set needs this information */ - sqlite3TokenCopy(&pNewExpr->span, &pOldExpr->span); - } - assert( pNewExpr==0 || pNewExpr->span.z!=0 - || pOldExpr->span.z==0 || sqlite3_malloc_failed ); - pItem->zName = sqliteStrDup(pOldItem->zName); - pItem->sortOrder = pOldItem->sortOrder; - pItem->isAgg = pOldItem->isAgg; - pItem->done = 0; - } - return pNew; -} - -/* -** If cursors, triggers, views and subqueries are all omitted from -** the build, then none of the following routines, except for -** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes -** called with a NULL argument. -*/ -#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) \ - || !defined(SQLITE_OMIT_SUBQUERY) -SrcList *sqlite3SrcListDup(SrcList *p){ - SrcList *pNew; - int i; - int nByte; - if( p==0 ) return 0; - nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); - pNew = sqliteMallocRaw( nByte ); - if( pNew==0 ) return 0; - pNew->nSrc = pNew->nAlloc = p->nSrc; - for(i=0; i<p->nSrc; i++){ - struct SrcList_item *pNewItem = &pNew->a[i]; - struct SrcList_item *pOldItem = &p->a[i]; - Table *pTab; - pNewItem->zDatabase = sqliteStrDup(pOldItem->zDatabase); - pNewItem->zName = sqliteStrDup(pOldItem->zName); - pNewItem->zAlias = sqliteStrDup(pOldItem->zAlias); - pNewItem->jointype = pOldItem->jointype; - pNewItem->iCursor = pOldItem->iCursor; - pTab = pNewItem->pTab = pOldItem->pTab; - if( pTab ){ - pTab->nRef++; - } - pNewItem->pSelect = sqlite3SelectDup(pOldItem->pSelect); - pNewItem->pOn = sqlite3ExprDup(pOldItem->pOn); - pNewItem->pUsing = sqlite3IdListDup(pOldItem->pUsing); - pNewItem->colUsed = pOldItem->colUsed; - } - return pNew; -} -IdList *sqlite3IdListDup(IdList *p){ - IdList *pNew; - int i; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*pNew) ); - if( pNew==0 ) return 0; - pNew->nId = pNew->nAlloc = p->nId; - pNew->a = sqliteMallocRaw( p->nId*sizeof(p->a[0]) ); - if( pNew->a==0 ){ - sqliteFree(pNew); - return 0; - } - for(i=0; i<p->nId; i++){ - struct IdList_item *pNewItem = &pNew->a[i]; - struct IdList_item *pOldItem = &p->a[i]; - pNewItem->zName = sqliteStrDup(pOldItem->zName); - pNewItem->idx = pOldItem->idx; - } - return pNew; -} -Select *sqlite3SelectDup(Select *p){ - Select *pNew; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*p) ); - if( pNew==0 ) return 0; - pNew->isDistinct = p->isDistinct; - pNew->pEList = sqlite3ExprListDup(p->pEList); - pNew->pSrc = sqlite3SrcListDup(p->pSrc); - pNew->pWhere = sqlite3ExprDup(p->pWhere); - pNew->pGroupBy = sqlite3ExprListDup(p->pGroupBy); - pNew->pHaving = sqlite3ExprDup(p->pHaving); - pNew->pOrderBy = sqlite3ExprListDup(p->pOrderBy); - pNew->op = p->op; - pNew->pPrior = sqlite3SelectDup(p->pPrior); - pNew->pLimit = sqlite3ExprDup(p->pLimit); - pNew->pOffset = sqlite3ExprDup(p->pOffset); - pNew->iLimit = -1; - pNew->iOffset = -1; - pNew->isResolved = p->isResolved; - pNew->isAgg = p->isAgg; - pNew->usesVirt = 0; - pNew->disallowOrderBy = 0; - pNew->pRightmost = 0; - pNew->addrOpenVirt[0] = -1; - pNew->addrOpenVirt[1] = -1; - pNew->addrOpenVirt[2] = -1; - return pNew; -} -#else -Select *sqlite3SelectDup(Select *p){ - assert( p==0 ); - return 0; -} -#endif - - -/* -** Add a new element to the end of an expression list. If pList is -** initially NULL, then create a new expression list. -*/ -ExprList *sqlite3ExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){ - if( pList==0 ){ - pList = sqliteMalloc( sizeof(ExprList) ); - if( pList==0 ){ - goto no_mem; - } - assert( pList->nAlloc==0 ); - } - if( pList->nAlloc<=pList->nExpr ){ - struct ExprList_item *a; - int n = pList->nAlloc*2 + 4; - a = sqliteRealloc(pList->a, n*sizeof(pList->a[0])); - if( a==0 ){ - goto no_mem; - } - pList->a = a; - pList->nAlloc = n; - } - assert( pList->a!=0 ); - if( pExpr || pName ){ - struct ExprList_item *pItem = &pList->a[pList->nExpr++]; - memset(pItem, 0, sizeof(*pItem)); - pItem->zName = sqlite3NameFromToken(pName); - pItem->pExpr = pExpr; - } - return pList; - -no_mem: - /* Avoid leaking memory if malloc has failed. */ - sqlite3ExprDelete(pExpr); - sqlite3ExprListDelete(pList); - return 0; -} - -/* -** Delete an entire expression list. -*/ -void sqlite3ExprListDelete(ExprList *pList){ - int i; - struct ExprList_item *pItem; - if( pList==0 ) return; - assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); - assert( pList->nExpr<=pList->nAlloc ); - for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){ - sqlite3ExprDelete(pItem->pExpr); - sqliteFree(pItem->zName); - } - sqliteFree(pList->a); - sqliteFree(pList); -} - -/* -** Walk an expression tree. Call xFunc for each node visited. -** -** The return value from xFunc determines whether the tree walk continues. -** 0 means continue walking the tree. 1 means do not walk children -** of the current node but continue with siblings. 2 means abandon -** the tree walk completely. -** -** The return value from this routine is 1 to abandon the tree walk -** and 0 to continue. -** -** NOTICE: This routine does *not* descend into subqueries. -*/ -static int walkExprList(ExprList *, int (*)(void *, Expr*), void *); -static int walkExprTree(Expr *pExpr, int (*xFunc)(void*,Expr*), void *pArg){ - int rc; - if( pExpr==0 ) return 0; - rc = (*xFunc)(pArg, pExpr); - if( rc==0 ){ - if( walkExprTree(pExpr->pLeft, xFunc, pArg) ) return 1; - if( walkExprTree(pExpr->pRight, xFunc, pArg) ) return 1; - if( walkExprList(pExpr->pList, xFunc, pArg) ) return 1; - } - return rc>1; -} - -/* -** Call walkExprTree() for every expression in list p. -*/ -static int walkExprList(ExprList *p, int (*xFunc)(void *, Expr*), void *pArg){ - int i; - struct ExprList_item *pItem; - if( !p ) return 0; - for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){ - if( walkExprTree(pItem->pExpr, xFunc, pArg) ) return 1; - } - return 0; -} - -/* -** Call walkExprTree() for every expression in Select p, not including -** expressions that are part of sub-selects in any FROM clause or the LIMIT -** or OFFSET expressions.. -*/ -static int walkSelectExpr(Select *p, int (*xFunc)(void *, Expr*), void *pArg){ - walkExprList(p->pEList, xFunc, pArg); - walkExprTree(p->pWhere, xFunc, pArg); - walkExprList(p->pGroupBy, xFunc, pArg); - walkExprTree(p->pHaving, xFunc, pArg); - walkExprList(p->pOrderBy, xFunc, pArg); - return 0; -} - - -/* -** This routine is designed as an xFunc for walkExprTree(). -** -** pArg is really a pointer to an integer. If we can tell by looking -** at pExpr that the expression that contains pExpr is not a constant -** expression, then set *pArg to 0 and return 2 to abandon the tree walk. -** If pExpr does does not disqualify the expression from being a constant -** then do nothing. -** -** After walking the whole tree, if no nodes are found that disqualify -** the expression as constant, then we assume the whole expression -** is constant. See sqlite3ExprIsConstant() for additional information. -*/ -static int exprNodeIsConstant(void *pArg, Expr *pExpr){ - switch( pExpr->op ){ - /* Consider functions to be constant if all their arguments are constant - ** and *pArg==2 */ - case TK_FUNCTION: - if( *((int*)pArg)==2 ) return 0; - /* Fall through */ - case TK_ID: - case TK_COLUMN: - case TK_DOT: - case TK_AGG_FUNCTION: - case TK_AGG_COLUMN: -#ifndef SQLITE_OMIT_SUBQUERY - case TK_SELECT: - case TK_EXISTS: -#endif - *((int*)pArg) = 0; - return 2; - case TK_IN: - if( pExpr->pSelect ){ - *((int*)pArg) = 0; - return 2; - } - default: - return 0; - } -} - -/* -** Walk an expression tree. Return 1 if the expression is constant -** and 0 if it involves variables or function calls. -** -** For the purposes of this function, a double-quoted string (ex: "abc") -** is considered a variable but a single-quoted string (ex: 'abc') is -** a constant. -*/ -int sqlite3ExprIsConstant(Expr *p){ - int isConst = 1; - walkExprTree(p, exprNodeIsConstant, &isConst); - return isConst; -} - -/* -** Walk an expression tree. Return 1 if the expression is constant -** or a function call with constant arguments. Return and 0 if there -** are any variables. -** -** For the purposes of this function, a double-quoted string (ex: "abc") -** is considered a variable but a single-quoted string (ex: 'abc') is -** a constant. -*/ -int sqlite3ExprIsConstantOrFunction(Expr *p){ - int isConst = 2; - walkExprTree(p, exprNodeIsConstant, &isConst); - return isConst!=0; -} - -/* -** If the expression p codes a constant integer that is small enough -** to fit in a 32-bit integer, return 1 and put the value of the integer -** in *pValue. If the expression is not an integer or if it is too big -** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. -*/ -int sqlite3ExprIsInteger(Expr *p, int *pValue){ - switch( p->op ){ - case TK_INTEGER: { - if( sqlite3GetInt32(p->token.z, pValue) ){ - return 1; - } - break; - } - case TK_UPLUS: { - return sqlite3ExprIsInteger(p->pLeft, pValue); - } - case TK_UMINUS: { - int v; - if( sqlite3ExprIsInteger(p->pLeft, &v) ){ - *pValue = -v; - return 1; - } - break; - } - default: break; - } - return 0; -} - -/* -** Return TRUE if the given string is a row-id column name. -*/ -int sqlite3IsRowid(const char *z){ - if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1; - if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; - if( sqlite3StrICmp(z, "OID")==0 ) return 1; - return 0; -} - -/* -** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up -** that name in the set of source tables in pSrcList and make the pExpr -** expression node refer back to that source column. The following changes -** are made to pExpr: -** -** pExpr->iDb Set the index in db->aDb[] of the database holding -** the table. -** pExpr->iTable Set to the cursor number for the table obtained -** from pSrcList. -** pExpr->iColumn Set to the column number within the table. -** pExpr->op Set to TK_COLUMN. -** pExpr->pLeft Any expression this points to is deleted -** pExpr->pRight Any expression this points to is deleted. -** -** The pDbToken is the name of the database (the "X"). This value may be -** NULL meaning that name is of the form Y.Z or Z. Any available database -** can be used. The pTableToken is the name of the table (the "Y"). This -** value can be NULL if pDbToken is also NULL. If pTableToken is NULL it -** means that the form of the name is Z and that columns from any table -** can be used. -** -** If the name cannot be resolved unambiguously, leave an error message -** in pParse and return non-zero. Return zero on success. -*/ -static int lookupName( - Parse *pParse, /* The parsing context */ - Token *pDbToken, /* Name of the database containing table, or NULL */ - Token *pTableToken, /* Name of table containing column, or NULL */ - Token *pColumnToken, /* Name of the column. */ - NameContext *pNC, /* The name context used to resolve the name */ - Expr *pExpr /* Make this EXPR node point to the selected column */ -){ - char *zDb = 0; /* Name of the database. The "X" in X.Y.Z */ - char *zTab = 0; /* Name of the table. The "Y" in X.Y.Z or Y.Z */ - char *zCol = 0; /* Name of the column. The "Z" */ - int i, j; /* Loop counters */ - int cnt = 0; /* Number of matching column names */ - int cntTab = 0; /* Number of matching table names */ - sqlite3 *db = pParse->db; /* The database */ - struct SrcList_item *pItem; /* Use for looping over pSrcList items */ - struct SrcList_item *pMatch = 0; /* The matching pSrcList item */ - NameContext *pTopNC = pNC; /* First namecontext in the list */ - - assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */ - zDb = sqlite3NameFromToken(pDbToken); - zTab = sqlite3NameFromToken(pTableToken); - zCol = sqlite3NameFromToken(pColumnToken); - if( sqlite3_malloc_failed ){ - goto lookupname_end; - } - - pExpr->iTable = -1; - while( pNC && cnt==0 ){ - SrcList *pSrcList = pNC->pSrcList; - ExprList *pEList = pNC->pEList; - - /* assert( zTab==0 || pEList==0 ); */ - if( pSrcList ){ - for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){ - Table *pTab = pItem->pTab; - Column *pCol; - - if( pTab==0 ) continue; - assert( pTab->nCol>0 ); - if( zTab ){ - if( pItem->zAlias ){ - char *zTabName = pItem->zAlias; - if( sqlite3StrICmp(zTabName, zTab)!=0 ) continue; - }else{ - char *zTabName = pTab->zName; - if( zTabName==0 || sqlite3StrICmp(zTabName, zTab)!=0 ) continue; - if( zDb!=0 && sqlite3StrICmp(db->aDb[pTab->iDb].zName, zDb)!=0 ){ - continue; - } - } - } - if( 0==(cntTab++) ){ - pExpr->iTable = pItem->iCursor; - pExpr->iDb = pTab->iDb; - pMatch = pItem; - } - for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){ - if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ - IdList *pUsing; - cnt++; - pExpr->iTable = pItem->iCursor; - pMatch = pItem; - pExpr->iDb = pTab->iDb; - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - pExpr->iColumn = j==pTab->iPKey ? -1 : j; - pExpr->affinity = pTab->aCol[j].affinity; - pExpr->pColl = pTab->aCol[j].pColl; - if( pItem->jointype & JT_NATURAL ){ - /* If this match occurred in the left table of a natural join, - ** then skip the right table to avoid a duplicate match */ - pItem++; - i++; - } - if( (pUsing = pItem->pUsing)!=0 ){ - /* If this match occurs on a column that is in the USING clause - ** of a join, skip the search of the right table of the join - ** to avoid a duplicate match there. */ - int k; - for(k=0; k<pUsing->nId; k++){ - if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ){ - pItem++; - i++; - break; - } - } - } - break; - } - } - } - } - -#ifndef SQLITE_OMIT_TRIGGER - /* If we have not already resolved the name, then maybe - ** it is a new.* or old.* trigger argument reference - */ - if( zDb==0 && zTab!=0 && cnt==0 && pParse->trigStack!=0 ){ - TriggerStack *pTriggerStack = pParse->trigStack; - Table *pTab = 0; - if( pTriggerStack->newIdx != -1 && sqlite3StrICmp("new", zTab) == 0 ){ - pExpr->iTable = pTriggerStack->newIdx; - assert( pTriggerStack->pTab ); - pTab = pTriggerStack->pTab; - }else if( pTriggerStack->oldIdx != -1 && sqlite3StrICmp("old", zTab)==0 ){ - pExpr->iTable = pTriggerStack->oldIdx; - assert( pTriggerStack->pTab ); - pTab = pTriggerStack->pTab; - } - - if( pTab ){ - int j; - Column *pCol = pTab->aCol; - - pExpr->iDb = pTab->iDb; - cntTab++; - for(j=0; j < pTab->nCol; j++, pCol++) { - if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ - cnt++; - pExpr->iColumn = j==pTab->iPKey ? -1 : j; - pExpr->affinity = pTab->aCol[j].affinity; - pExpr->pColl = pTab->aCol[j].pColl; - pExpr->pTab = pTab; - break; - } - } - } - } -#endif /* !defined(SQLITE_OMIT_TRIGGER) */ - - /* - ** Perhaps the name is a reference to the ROWID - */ - if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){ - cnt = 1; - pExpr->iColumn = -1; - pExpr->affinity = SQLITE_AFF_INTEGER; - } - - /* - ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z - ** might refer to an result-set alias. This happens, for example, when - ** we are resolving names in the WHERE clause of the following command: - ** - ** SELECT a+b AS x FROM table WHERE x<10; - ** - ** In cases like this, replace pExpr with a copy of the expression that - ** forms the result set entry ("a+b" in the example) and return immediately. - ** Note that the expression in the result set should have already been - ** resolved by the time the WHERE clause is resolved. - */ - if( cnt==0 && pEList!=0 && zTab==0 ){ - for(j=0; j<pEList->nExpr; j++){ - char *zAs = pEList->a[j].zName; - if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ - assert( pExpr->pLeft==0 && pExpr->pRight==0 ); - pExpr->op = TK_AS; - pExpr->iColumn = j; - pExpr->pLeft = sqlite3ExprDup(pEList->a[j].pExpr); - cnt = 1; - assert( zTab==0 && zDb==0 ); - goto lookupname_end_2; - } - } - } - - /* Advance to the next name context. The loop will exit when either - ** we have a match (cnt>0) or when we run out of name contexts. - */ - if( cnt==0 ){ - pNC = pNC->pNext; - } - } - - /* - ** If X and Y are NULL (in other words if only the column name Z is - ** supplied) and the value of Z is enclosed in double-quotes, then - ** Z is a string literal if it doesn't match any column names. In that - ** case, we need to return right away and not make any changes to - ** pExpr. - ** - ** Because no reference was made to outer contexts, the pNC->nRef - ** fields are not changed in any context. - */ - if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){ - sqliteFree(zCol); - return 0; - } - - /* - ** cnt==0 means there was not match. cnt>1 means there were two or - ** more matches. Either way, we have an error. - */ - if( cnt!=1 ){ - char *z = 0; - char *zErr; - zErr = cnt==0 ? "no such column: %s" : "ambiguous column name: %s"; - if( zDb ){ - sqlite3SetString(&z, zDb, ".", zTab, ".", zCol, 0); - }else if( zTab ){ - sqlite3SetString(&z, zTab, ".", zCol, 0); - }else{ - z = sqliteStrDup(zCol); - } - sqlite3ErrorMsg(pParse, zErr, z); - sqliteFree(z); - pTopNC->nErr++; - } - - /* If a column from a table in pSrcList is referenced, then record - ** this fact in the pSrcList.a[].colUsed bitmask. Column 0 causes - ** bit 0 to be set. Column 1 sets bit 1. And so forth. If the - ** column number is greater than the number of bits in the bitmask - ** then set the high-order bit of the bitmask. - */ - if( pExpr->iColumn>=0 && pMatch!=0 ){ - int n = pExpr->iColumn; - if( n>=sizeof(Bitmask)*8 ){ - n = sizeof(Bitmask)*8-1; - } - assert( pMatch->iCursor==pExpr->iTable ); - pMatch->colUsed |= 1<<n; - } - -lookupname_end: - /* Clean up and return - */ - sqliteFree(zDb); - sqliteFree(zTab); - sqlite3ExprDelete(pExpr->pLeft); - pExpr->pLeft = 0; - sqlite3ExprDelete(pExpr->pRight); - pExpr->pRight = 0; - pExpr->op = TK_COLUMN; -lookupname_end_2: - sqliteFree(zCol); - if( cnt==1 ){ - assert( pNC!=0 ); - sqlite3AuthRead(pParse, pExpr, pNC->pSrcList); - if( pMatch && !pMatch->pSelect ){ - pExpr->pTab = pMatch->pTab; - } - /* Increment the nRef value on all name contexts from TopNC up to - ** the point where the name matched. */ - for(;;){ - assert( pTopNC!=0 ); - pTopNC->nRef++; - if( pTopNC==pNC ) break; - pTopNC = pTopNC->pNext; - } - return 0; - } else { - return 1; - } -} - -/* -** This routine is designed as an xFunc for walkExprTree(). -** -** Resolve symbolic names into TK_COLUMN operators for the current -** node in the expression tree. Return 0 to continue the search down -** the tree or 2 to abort the tree walk. -** -** This routine also does error checking and name resolution for -** function names. The operator for aggregate functions is changed -** to TK_AGG_FUNCTION. -*/ -static int nameResolverStep(void *pArg, Expr *pExpr){ - NameContext *pNC = (NameContext*)pArg; - SrcList *pSrcList; - Parse *pParse; - - if( pExpr==0 ) return 1; - assert( pNC!=0 ); - pSrcList = pNC->pSrcList; - pParse = pNC->pParse; - - if( ExprHasAnyProperty(pExpr, EP_Resolved) ) return 1; - ExprSetProperty(pExpr, EP_Resolved); -#ifndef NDEBUG - if( pSrcList ){ - int i; - for(i=0; i<pSrcList->nSrc; i++){ - assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab); - } - } -#endif - switch( pExpr->op ){ - /* Double-quoted strings (ex: "abc") are used as identifiers if - ** possible. Otherwise they remain as strings. Single-quoted - ** strings (ex: 'abc') are always string literals. - */ - case TK_STRING: { - if( pExpr->token.z[0]=='\'' ) break; - /* Fall thru into the TK_ID case if this is a double-quoted string */ - } - /* A lone identifier is the name of a column. - */ - case TK_ID: { - lookupName(pParse, 0, 0, &pExpr->token, pNC, pExpr); - return 1; - } - - /* A table name and column name: ID.ID - ** Or a database, table and column: ID.ID.ID - */ - case TK_DOT: { - Token *pColumn; - Token *pTable; - Token *pDb; - Expr *pRight; - - /* if( pSrcList==0 ) break; */ - pRight = pExpr->pRight; - if( pRight->op==TK_ID ){ - pDb = 0; - pTable = &pExpr->pLeft->token; - pColumn = &pRight->token; - }else{ - assert( pRight->op==TK_DOT ); - pDb = &pExpr->pLeft->token; - pTable = &pRight->pLeft->token; - pColumn = &pRight->pRight->token; - } - lookupName(pParse, pDb, pTable, pColumn, pNC, pExpr); - return 1; - } - - /* Resolve function names - */ - case TK_CONST_FUNC: - case TK_FUNCTION: { - ExprList *pList = pExpr->pList; /* The argument list */ - int n = pList ? pList->nExpr : 0; /* Number of arguments */ - int no_such_func = 0; /* True if no such function exists */ - int wrong_num_args = 0; /* True if wrong number of arguments */ - int is_agg = 0; /* True if is an aggregate function */ - int i; - int nId; /* Number of characters in function name */ - const char *zId; /* The function name. */ - FuncDef *pDef; /* Information about the function */ - int enc = pParse->db->enc; /* The database encoding */ - - zId = pExpr->token.z; - nId = pExpr->token.n; - pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); - if( pDef==0 ){ - pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0); - if( pDef==0 ){ - no_such_func = 1; - }else{ - wrong_num_args = 1; - } - }else{ - is_agg = pDef->xFunc==0; - } - if( is_agg && !pNC->allowAgg ){ - sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId); - pNC->nErr++; - is_agg = 0; - }else if( no_such_func ){ - sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId); - pNC->nErr++; - }else if( wrong_num_args ){ - sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()", - nId, zId); - pNC->nErr++; - } - if( is_agg ){ - pExpr->op = TK_AGG_FUNCTION; - pNC->hasAgg = 1; - } - if( is_agg ) pNC->allowAgg = 0; - for(i=0; pNC->nErr==0 && i<n; i++){ - walkExprTree(pList->a[i].pExpr, nameResolverStep, pNC); - } - if( is_agg ) pNC->allowAgg = 1; - /* FIX ME: Compute pExpr->affinity based on the expected return - ** type of the function - */ - return is_agg; - } -#ifndef SQLITE_OMIT_SUBQUERY - case TK_SELECT: - case TK_EXISTS: -#endif - case TK_IN: { - if( pExpr->pSelect ){ - int nRef = pNC->nRef; - sqlite3SelectResolve(pParse, pExpr->pSelect, pNC); - assert( pNC->nRef>=nRef ); - if( nRef!=pNC->nRef ){ - ExprSetProperty(pExpr, EP_VarSelect); - } - } - } - } - return 0; -} - -/* -** This routine walks an expression tree and resolves references to -** table columns. Nodes of the form ID.ID or ID resolve into an -** index to the table in the table list and a column offset. The -** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable -** value is changed to the index of the referenced table in pTabList -** plus the "base" value. The base value will ultimately become the -** VDBE cursor number for a cursor that is pointing into the referenced -** table. The Expr.iColumn value is changed to the index of the column -** of the referenced table. The Expr.iColumn value for the special -** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an -** alias for ROWID. -** -** Also resolve function names and check the functions for proper -** usage. Make sure all function names are recognized and all functions -** have the correct number of arguments. Leave an error message -** in pParse->zErrMsg if anything is amiss. Return the number of errors. -** -** If the expression contains aggregate functions then set the EP_Agg -** property on the expression. -*/ -int sqlite3ExprResolveNames( - NameContext *pNC, /* Namespace to resolve expressions in. */ - Expr *pExpr /* The expression to be analyzed. */ -){ - int savedHasAgg; - if( pExpr==0 ) return 0; - savedHasAgg = pNC->hasAgg; - pNC->hasAgg = 0; - walkExprTree(pExpr, nameResolverStep, pNC); - if( pNC->nErr>0 ){ - ExprSetProperty(pExpr, EP_Error); - } - if( pNC->hasAgg ){ - ExprSetProperty(pExpr, EP_Agg); - }else if( savedHasAgg ){ - pNC->hasAgg = 1; - } - return ExprHasProperty(pExpr, EP_Error); -} - -/* -** A pointer instance of this structure is used to pass information -** through walkExprTree into codeSubqueryStep(). -*/ -typedef struct QueryCoder QueryCoder; -struct QueryCoder { - Parse *pParse; /* The parsing context */ - NameContext *pNC; /* Namespace of first enclosing query */ -}; - - -/* -** Generate code for subqueries and IN operators. -** -** IN operators comes in two forms: -** -** expr IN (exprlist) -** and -** expr IN (SELECT ...) -** -** The first form is handled by creating a set holding the list -** of allowed values. The second form causes the SELECT to generate -** a temporary table. -*/ -#ifndef SQLITE_OMIT_SUBQUERY -void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ - int testAddr = 0; /* One-time test address */ - Vdbe *v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - - /* This code must be run in its entirety every time it is encountered - ** if any of the following is true: - ** - ** * The right-hand side is a correlated subquery - ** * The right-hand side is an expression list containing variables - ** * We are inside a trigger - ** - ** If all of the above are false, then we can run this code just once - ** save the results, and reuse the same result on subsequent invocations. - */ - if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->trigStack ){ - int mem = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemLoad, mem, 0); - testAddr = sqlite3VdbeAddOp(v, OP_If, 0, 0); - assert( testAddr>0 || sqlite3_malloc_failed ); - sqlite3VdbeAddOp(v, OP_MemInt, 1, mem); - } - - switch( pExpr->op ){ - case TK_IN: { - char affinity; - KeyInfo keyInfo; - int addr; /* Address of OP_OpenVirtual instruction */ - - affinity = sqlite3ExprAffinity(pExpr->pLeft); - - /* Whether this is an 'x IN(SELECT...)' or an 'x IN(<exprlist>)' - ** expression it is handled the same way. A virtual table is - ** filled with single-field index keys representing the results - ** from the SELECT or the <exprlist>. - ** - ** If the 'x' expression is a column value, or the SELECT... - ** statement returns a column value, then the affinity of that - ** column is used to build the index keys. If both 'x' and the - ** SELECT... statement are columns, then numeric affinity is used - ** if either column has NUMERIC or INTEGER affinity. If neither - ** 'x' nor the SELECT... statement are columns, then numeric affinity - ** is used. - */ - pExpr->iTable = pParse->nTab++; - addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, pExpr->iTable, 0); - memset(&keyInfo, 0, sizeof(keyInfo)); - keyInfo.nField = 1; - sqlite3VdbeAddOp(v, OP_SetNumColumns, pExpr->iTable, 1); - - if( pExpr->pSelect ){ - /* Case 1: expr IN (SELECT ...) - ** - ** Generate code to write the results of the select into the temporary - ** table allocated and opened above. - */ - int iParm = pExpr->iTable + (((int)affinity)<<16); - ExprList *pEList; - assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); - sqlite3Select(pParse, pExpr->pSelect, SRT_Set, iParm, 0, 0, 0, 0); - pEList = pExpr->pSelect->pEList; - if( pEList && pEList->nExpr>0 ){ - keyInfo.aColl[0] = binaryCompareCollSeq(pParse, pExpr->pLeft, - pEList->a[0].pExpr); - } - }else if( pExpr->pList ){ - /* Case 2: expr IN (exprlist) - ** - ** For each expression, build an index key from the evaluation and - ** store it in the temporary table. If <expr> is a column, then use - ** that columns affinity when building index keys. If <expr> is not - ** a column, use numeric affinity. - */ - int i; - ExprList *pList = pExpr->pList; - struct ExprList_item *pItem; - - if( !affinity ){ - affinity = SQLITE_AFF_NUMERIC; - } - keyInfo.aColl[0] = pExpr->pLeft->pColl; - - /* Loop through each expression in <exprlist>. */ - for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ - Expr *pE2 = pItem->pExpr; - - /* If the expression is not constant then we will need to - ** disable the test that was generated above that makes sure - ** this code only executes once. Because for a non-constant - ** expression we need to rerun this code each time. - */ - if( testAddr>0 && !sqlite3ExprIsConstant(pE2) ){ - VdbeOp *aOp = sqlite3VdbeGetOp(v, testAddr-1); - int i; - for(i=0; i<3; i++){ - aOp[i].opcode = OP_Noop; - } - testAddr = 0; - } - - /* Evaluate the expression and insert it into the temp table */ - sqlite3ExprCode(pParse, pE2); - sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1); - sqlite3VdbeAddOp(v, OP_IdxInsert, pExpr->iTable, 0); - } - } - sqlite3VdbeChangeP3(v, addr, (void *)&keyInfo, P3_KEYINFO); - break; - } - - case TK_EXISTS: - case TK_SELECT: { - /* This has to be a scalar SELECT. Generate code to put the - ** value of this select in a memory cell and record the number - ** of the memory cell in iColumn. - */ - int sop; - Select *pSel; - - pExpr->iColumn = pParse->nMem++; - pSel = pExpr->pSelect; - if( pExpr->op==TK_SELECT ){ - sop = SRT_Mem; - }else{ - static const Token one = { "1", 0, 1 }; - sop = SRT_Exists; - sqlite3ExprListDelete(pSel->pEList); - pSel->pEList = sqlite3ExprListAppend(0, - sqlite3Expr(TK_INTEGER, 0, 0, &one), 0); - } - sqlite3Select(pParse, pSel, sop, pExpr->iColumn, 0, 0, 0, 0); - break; - } - } - - if( testAddr ){ - sqlite3VdbeJumpHere(v, testAddr); - } - return; -} -#endif /* SQLITE_OMIT_SUBQUERY */ - -/* -** Generate an instruction that will put the integer describe by -** text z[0..n-1] on the stack. -*/ -static void codeInteger(Vdbe *v, const char *z, int n){ - int i; - if( sqlite3GetInt32(z, &i) ){ - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - }else if( sqlite3FitsIn64Bits(z) ){ - sqlite3VdbeOp3(v, OP_Int64, 0, 0, z, n); - }else{ - sqlite3VdbeOp3(v, OP_Real, 0, 0, z, n); - } -} - -/* -** Generate code into the current Vdbe to evaluate the given -** expression and leave the result on the top of stack. -** -** This code depends on the fact that certain token values (ex: TK_EQ) -** are the same as opcode values (ex: OP_Eq) that implement the corresponding -** operation. Special comments in vdbe.c and the mkopcodeh.awk script in -** the make process cause these values to align. Assert()s in the code -** below verify that the numbers are aligned correctly. -*/ -void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ - Vdbe *v = pParse->pVdbe; - int op; - if( v==0 ) return; - if( pExpr==0 ){ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - return; - } - op = pExpr->op; - switch( op ){ - case TK_AGG_COLUMN: { - AggInfo *pAggInfo = pExpr->pAggInfo; - struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; - if( !pAggInfo->directMode ){ - sqlite3VdbeAddOp(v, OP_MemLoad, pCol->iMem, 0); - break; - }else if( pAggInfo->useSortingIdx ){ - sqlite3VdbeAddOp(v, OP_Column, pAggInfo->sortingIdx, - pCol->iSorterColumn); - break; - } - /* Otherwise, fall thru into the TK_COLUMN case */ - } - case TK_COLUMN: { - if( pExpr->iColumn>=0 ){ - sqlite3VdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn); - sqlite3ColumnDefault(v, pExpr->pTab, pExpr->iColumn); - }else{ - sqlite3VdbeAddOp(v, OP_Rowid, pExpr->iTable, 0); - } - break; - } - case TK_INTEGER: { - codeInteger(v, pExpr->token.z, pExpr->token.n); - break; - } - case TK_FLOAT: - case TK_STRING: { - assert( TK_FLOAT==OP_Real ); - assert( TK_STRING==OP_String8 ); - sqlite3DequoteExpr(pExpr); - sqlite3VdbeOp3(v, op, 0, 0, pExpr->token.z, pExpr->token.n); - break; - } - case TK_NULL: { - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - break; - } -#ifndef SQLITE_OMIT_BLOB_LITERAL - case TK_BLOB: { - int n; - const char *z; - assert( TK_BLOB==OP_HexBlob ); - n = pExpr->token.n - 3; - z = pExpr->token.z + 2; - assert( n>=0 ); - if( n==0 ){ - z = ""; - } - sqlite3VdbeOp3(v, op, 0, 0, z, n); - break; - } -#endif - case TK_VARIABLE: { - sqlite3VdbeAddOp(v, OP_Variable, pExpr->iTable, 0); - if( pExpr->token.n>1 ){ - sqlite3VdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n); - } - break; - } - case TK_REGISTER: { - sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iTable, 0); - break; - } -#ifndef SQLITE_OMIT_CAST - case TK_CAST: { - /* Expressions of the form: CAST(pLeft AS token) */ - int aff, op; - sqlite3ExprCode(pParse, pExpr->pLeft); - aff = sqlite3AffinityType(&pExpr->token); - switch( aff ){ - case SQLITE_AFF_INTEGER: op = OP_ToInt; break; - case SQLITE_AFF_NUMERIC: op = OP_ToNumeric; break; - case SQLITE_AFF_TEXT: op = OP_ToText; break; - case SQLITE_AFF_NONE: op = OP_ToBlob; break; - } - sqlite3VdbeAddOp(v, op, 0, 0); - break; - } -#endif /* SQLITE_OMIT_CAST */ - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - assert( TK_LT==OP_Lt ); - assert( TK_LE==OP_Le ); - assert( TK_GT==OP_Gt ); - assert( TK_GE==OP_Ge ); - assert( TK_EQ==OP_Eq ); - assert( TK_NE==OP_Ne ); - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3ExprCode(pParse, pExpr->pRight); - codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, 0, 0); - break; - } - case TK_AND: - case TK_OR: - case TK_PLUS: - case TK_STAR: - case TK_MINUS: - case TK_REM: - case TK_BITAND: - case TK_BITOR: - case TK_SLASH: - case TK_LSHIFT: - case TK_RSHIFT: - case TK_CONCAT: { - assert( TK_AND==OP_And ); - assert( TK_OR==OP_Or ); - assert( TK_PLUS==OP_Add ); - assert( TK_MINUS==OP_Subtract ); - assert( TK_REM==OP_Remainder ); - assert( TK_BITAND==OP_BitAnd ); - assert( TK_BITOR==OP_BitOr ); - assert( TK_SLASH==OP_Divide ); - assert( TK_LSHIFT==OP_ShiftLeft ); - assert( TK_RSHIFT==OP_ShiftRight ); - assert( TK_CONCAT==OP_Concat ); - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3ExprCode(pParse, pExpr->pRight); - sqlite3VdbeAddOp(v, op, 0, 0); - break; - } - case TK_UMINUS: { - Expr *pLeft = pExpr->pLeft; - assert( pLeft ); - if( pLeft->op==TK_FLOAT || pLeft->op==TK_INTEGER ){ - Token *p = &pLeft->token; - char *z = sqliteMalloc( p->n + 2 ); - sprintf(z, "-%.*s", p->n, p->z); - if( pLeft->op==TK_FLOAT ){ - sqlite3VdbeOp3(v, OP_Real, 0, 0, z, p->n+1); - }else{ - codeInteger(v, z, p->n+1); - } - sqliteFree(z); - break; - } - /* Fall through into TK_NOT */ - } - case TK_BITNOT: - case TK_NOT: { - assert( TK_BITNOT==OP_BitNot ); - assert( TK_NOT==OP_Not ); - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3VdbeAddOp(v, op, 0, 0); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - int dest; - assert( TK_ISNULL==OP_IsNull ); - assert( TK_NOTNULL==OP_NotNull ); - sqlite3VdbeAddOp(v, OP_Integer, 1, 0); - sqlite3ExprCode(pParse, pExpr->pLeft); - dest = sqlite3VdbeCurrentAddr(v) + 2; - sqlite3VdbeAddOp(v, op, 1, dest); - sqlite3VdbeAddOp(v, OP_AddImm, -1, 0); - break; - } - case TK_AGG_FUNCTION: { - AggInfo *pInfo = pExpr->pAggInfo; - sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0); - break; - } - case TK_CONST_FUNC: - case TK_FUNCTION: { - ExprList *pList = pExpr->pList; - int nExpr = pList ? pList->nExpr : 0; - FuncDef *pDef; - int nId; - const char *zId; - int constMask = 0; - int i; - u8 enc = pParse->db->enc; - CollSeq *pColl = 0; - zId = pExpr->token.z; - nId = pExpr->token.n; - pDef = sqlite3FindFunction(pParse->db, zId, nId, nExpr, enc, 0); - assert( pDef!=0 ); - nExpr = sqlite3ExprCodeExprList(pParse, pList); - for(i=0; i<nExpr && i<32; i++){ - if( sqlite3ExprIsConstant(pList->a[i].pExpr) ){ - constMask |= (1<<i); - } - if( pDef->needCollSeq && !pColl ){ - pColl = sqlite3ExprCollSeq(pParse, pList->a[i].pExpr); - } - } - if( pDef->needCollSeq ){ - if( !pColl ) pColl = pParse->db->pDfltColl; - sqlite3VdbeOp3(v, OP_CollSeq, 0, 0, (char *)pColl, P3_COLLSEQ); - } - sqlite3VdbeOp3(v, OP_Function, constMask, nExpr, (char*)pDef, P3_FUNCDEF); - break; - } -#ifndef SQLITE_OMIT_SUBQUERY - case TK_EXISTS: - case TK_SELECT: { - sqlite3CodeSubselect(pParse, pExpr); - sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iColumn, 0); - VdbeComment((v, "# load subquery result")); - break; - } - case TK_IN: { - int addr; - char affinity; - sqlite3CodeSubselect(pParse, pExpr); - - /* Figure out the affinity to use to create a key from the results - ** of the expression. affinityStr stores a static string suitable for - ** P3 of OP_MakeRecord. - */ - affinity = comparisonAffinity(pExpr); - - sqlite3VdbeAddOp(v, OP_Integer, 1, 0); - - /* Code the <expr> from "<expr> IN (...)". The temporary table - ** pExpr->iTable contains the values that make up the (...) set. - */ - sqlite3ExprCode(pParse, pExpr->pLeft); - addr = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+4); /* addr + 0 */ - sqlite3VdbeAddOp(v, OP_Pop, 2, 0); - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, addr+7); - sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1); /* addr + 4 */ - sqlite3VdbeAddOp(v, OP_Found, pExpr->iTable, addr+7); - sqlite3VdbeAddOp(v, OP_AddImm, -1, 0); /* addr + 6 */ - - break; - } -#endif - case TK_BETWEEN: { - Expr *pLeft = pExpr->pLeft; - struct ExprList_item *pLItem = pExpr->pList->a; - Expr *pRight = pLItem->pExpr; - sqlite3ExprCode(pParse, pLeft); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3ExprCode(pParse, pRight); - codeCompare(pParse, pLeft, pRight, OP_Ge, 0, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - pLItem++; - pRight = pLItem->pExpr; - sqlite3ExprCode(pParse, pRight); - codeCompare(pParse, pLeft, pRight, OP_Le, 0, 0); - sqlite3VdbeAddOp(v, OP_And, 0, 0); - break; - } - case TK_UPLUS: - case TK_AS: { - sqlite3ExprCode(pParse, pExpr->pLeft); - break; - } - case TK_CASE: { - int expr_end_label; - int jumpInst; - int nExpr; - int i; - ExprList *pEList; - struct ExprList_item *aListelem; - - assert(pExpr->pList); - assert((pExpr->pList->nExpr % 2) == 0); - assert(pExpr->pList->nExpr > 0); - pEList = pExpr->pList; - aListelem = pEList->a; - nExpr = pEList->nExpr; - expr_end_label = sqlite3VdbeMakeLabel(v); - if( pExpr->pLeft ){ - sqlite3ExprCode(pParse, pExpr->pLeft); - } - for(i=0; i<nExpr; i=i+2){ - sqlite3ExprCode(pParse, aListelem[i].pExpr); - if( pExpr->pLeft ){ - sqlite3VdbeAddOp(v, OP_Dup, 1, 1); - jumpInst = codeCompare(pParse, pExpr->pLeft, aListelem[i].pExpr, - OP_Ne, 0, 1); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - }else{ - jumpInst = sqlite3VdbeAddOp(v, OP_IfNot, 1, 0); - } - sqlite3ExprCode(pParse, aListelem[i+1].pExpr); - sqlite3VdbeAddOp(v, OP_Goto, 0, expr_end_label); - sqlite3VdbeJumpHere(v, jumpInst); - } - if( pExpr->pLeft ){ - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - } - if( pExpr->pRight ){ - sqlite3ExprCode(pParse, pExpr->pRight); - }else{ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - } - sqlite3VdbeResolveLabel(v, expr_end_label); - break; - } -#ifndef SQLITE_OMIT_TRIGGER - case TK_RAISE: { - if( !pParse->trigStack ){ - sqlite3ErrorMsg(pParse, - "RAISE() may only be used within a trigger-program"); - return; - } - if( pExpr->iColumn!=OE_Ignore ){ - assert( pExpr->iColumn==OE_Rollback || - pExpr->iColumn == OE_Abort || - pExpr->iColumn == OE_Fail ); - sqlite3DequoteExpr(pExpr); - sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn, - pExpr->token.z, pExpr->token.n); - } else { - assert( pExpr->iColumn == OE_Ignore ); - sqlite3VdbeAddOp(v, OP_ContextPop, 0, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->trigStack->ignoreJump); - VdbeComment((v, "# raise(IGNORE)")); - } - } -#endif - break; - } -} - -#ifndef SQLITE_OMIT_TRIGGER -/* -** Generate code that evalutes the given expression and leaves the result -** on the stack. See also sqlite3ExprCode(). -** -** This routine might also cache the result and modify the pExpr tree -** so that it will make use of the cached result on subsequent evaluations -** rather than evaluate the whole expression again. Trivial expressions are -** not cached. If the expression is cached, its result is stored in a -** memory location. -*/ -void sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr){ - Vdbe *v = pParse->pVdbe; - int iMem; - int addr1, addr2; - if( v==0 ) return; - addr1 = sqlite3VdbeCurrentAddr(v); - sqlite3ExprCode(pParse, pExpr); - addr2 = sqlite3VdbeCurrentAddr(v); - if( addr2>addr1+1 || sqlite3VdbeGetOp(v, addr1)->opcode==OP_Function ){ - iMem = pExpr->iTable = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemStore, iMem, 0); - pExpr->op = TK_REGISTER; - } -} -#endif - -/* -** Generate code that pushes the value of every element of the given -** expression list onto the stack. -** -** Return the number of elements pushed onto the stack. -*/ -int sqlite3ExprCodeExprList( - Parse *pParse, /* Parsing context */ - ExprList *pList /* The expression list to be coded */ -){ - struct ExprList_item *pItem; - int i, n; - if( pList==0 ) return 0; - n = pList->nExpr; - for(pItem=pList->a, i=n; i>0; i--, pItem++){ - sqlite3ExprCode(pParse, pItem->pExpr); - } - return n; -} - -/* -** Generate code for a boolean expression such that a jump is made -** to the label "dest" if the expression is true but execution -** continues straight thru if the expression is false. -** -** If the expression evaluates to NULL (neither true nor false), then -** take the jump if the jumpIfNull flag is true. -** -** This code depends on the fact that certain token values (ex: TK_EQ) -** are the same as opcode values (ex: OP_Eq) that implement the corresponding -** operation. Special comments in vdbe.c and the mkopcodeh.awk script in -** the make process cause these values to align. Assert()s in the code -** below verify that the numbers are aligned correctly. -*/ -void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ - Vdbe *v = pParse->pVdbe; - int op = 0; - if( v==0 || pExpr==0 ) return; - op = pExpr->op; - switch( op ){ - case TK_AND: { - int d2 = sqlite3VdbeMakeLabel(v); - sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2, !jumpIfNull); - sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - sqlite3VdbeResolveLabel(v, d2); - break; - } - case TK_OR: { - sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); - sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - break; - } - case TK_NOT: { - sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); - break; - } - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - assert( TK_LT==OP_Lt ); - assert( TK_LE==OP_Le ); - assert( TK_GT==OP_Gt ); - assert( TK_GE==OP_Ge ); - assert( TK_EQ==OP_Eq ); - assert( TK_NE==OP_Ne ); - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3ExprCode(pParse, pExpr->pRight); - codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, dest, jumpIfNull); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - assert( TK_ISNULL==OP_IsNull ); - assert( TK_NOTNULL==OP_NotNull ); - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3VdbeAddOp(v, op, 1, dest); - break; - } - case TK_BETWEEN: { - /* The expression "x BETWEEN y AND z" is implemented as: - ** - ** 1 IF (x < y) GOTO 3 - ** 2 IF (x <= z) GOTO <dest> - ** 3 ... - */ - int addr; - Expr *pLeft = pExpr->pLeft; - Expr *pRight = pExpr->pList->a[0].pExpr; - sqlite3ExprCode(pParse, pLeft); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3ExprCode(pParse, pRight); - addr = codeCompare(pParse, pLeft, pRight, OP_Lt, 0, !jumpIfNull); - - pRight = pExpr->pList->a[1].pExpr; - sqlite3ExprCode(pParse, pRight); - codeCompare(pParse, pLeft, pRight, OP_Le, dest, jumpIfNull); - - sqlite3VdbeAddOp(v, OP_Integer, 0, 0); - sqlite3VdbeJumpHere(v, addr); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - break; - } - default: { - sqlite3ExprCode(pParse, pExpr); - sqlite3VdbeAddOp(v, OP_If, jumpIfNull, dest); - break; - } - } -} - -/* -** Generate code for a boolean expression such that a jump is made -** to the label "dest" if the expression is false but execution -** continues straight thru if the expression is true. -** -** If the expression evaluates to NULL (neither true nor false) then -** jump if jumpIfNull is true or fall through if jumpIfNull is false. -*/ -void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ - Vdbe *v = pParse->pVdbe; - int op = 0; - if( v==0 || pExpr==0 ) return; - - /* The value of pExpr->op and op are related as follows: - ** - ** pExpr->op op - ** --------- ---------- - ** TK_ISNULL OP_NotNull - ** TK_NOTNULL OP_IsNull - ** TK_NE OP_Eq - ** TK_EQ OP_Ne - ** TK_GT OP_Le - ** TK_LE OP_Gt - ** TK_GE OP_Lt - ** TK_LT OP_Ge - ** - ** For other values of pExpr->op, op is undefined and unused. - ** The value of TK_ and OP_ constants are arranged such that we - ** can compute the mapping above using the following expression. - ** Assert()s verify that the computation is correct. - */ - op = ((pExpr->op+(TK_ISNULL&1))^1)-(TK_ISNULL&1); - - /* Verify correct alignment of TK_ and OP_ constants - */ - assert( pExpr->op!=TK_ISNULL || op==OP_NotNull ); - assert( pExpr->op!=TK_NOTNULL || op==OP_IsNull ); - assert( pExpr->op!=TK_NE || op==OP_Eq ); - assert( pExpr->op!=TK_EQ || op==OP_Ne ); - assert( pExpr->op!=TK_LT || op==OP_Ge ); - assert( pExpr->op!=TK_LE || op==OP_Gt ); - assert( pExpr->op!=TK_GT || op==OP_Le ); - assert( pExpr->op!=TK_GE || op==OP_Lt ); - - switch( pExpr->op ){ - case TK_AND: { - sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); - sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - break; - } - case TK_OR: { - int d2 = sqlite3VdbeMakeLabel(v); - sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, !jumpIfNull); - sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - sqlite3VdbeResolveLabel(v, d2); - break; - } - case TK_NOT: { - sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); - break; - } - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3ExprCode(pParse, pExpr->pRight); - codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, dest, jumpIfNull); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - sqlite3ExprCode(pParse, pExpr->pLeft); - sqlite3VdbeAddOp(v, op, 1, dest); - break; - } - case TK_BETWEEN: { - /* The expression is "x BETWEEN y AND z". It is implemented as: - ** - ** 1 IF (x >= y) GOTO 3 - ** 2 GOTO <dest> - ** 3 IF (x > z) GOTO <dest> - */ - int addr; - Expr *pLeft = pExpr->pLeft; - Expr *pRight = pExpr->pList->a[0].pExpr; - sqlite3ExprCode(pParse, pLeft); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3ExprCode(pParse, pRight); - addr = sqlite3VdbeCurrentAddr(v); - codeCompare(pParse, pLeft, pRight, OP_Ge, addr+3, !jumpIfNull); - - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, dest); - pRight = pExpr->pList->a[1].pExpr; - sqlite3ExprCode(pParse, pRight); - codeCompare(pParse, pLeft, pRight, OP_Gt, dest, jumpIfNull); - break; - } - default: { - sqlite3ExprCode(pParse, pExpr); - sqlite3VdbeAddOp(v, OP_IfNot, jumpIfNull, dest); - break; - } - } -} - -/* -** Do a deep comparison of two expression trees. Return TRUE (non-zero) -** if they are identical and return FALSE if they differ in any way. -*/ -int sqlite3ExprCompare(Expr *pA, Expr *pB){ - int i; - if( pA==0 ){ - return pB==0; - }else if( pB==0 ){ - return 0; - } - if( pA->op!=pB->op ) return 0; - if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 0; - if( !sqlite3ExprCompare(pA->pLeft, pB->pLeft) ) return 0; - if( !sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 0; - if( pA->pList ){ - if( pB->pList==0 ) return 0; - if( pA->pList->nExpr!=pB->pList->nExpr ) return 0; - for(i=0; i<pA->pList->nExpr; i++){ - if( !sqlite3ExprCompare(pA->pList->a[i].pExpr, pB->pList->a[i].pExpr) ){ - return 0; - } - } - }else if( pB->pList ){ - return 0; - } - if( pA->pSelect || pB->pSelect ) return 0; - if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0; - if( pA->token.z ){ - if( pB->token.z==0 ) return 0; - if( pB->token.n!=pA->token.n ) return 0; - if( sqlite3StrNICmp(pA->token.z, pB->token.z, pB->token.n)!=0 ) return 0; - } - return 1; -} - - -/* -** Add a new element to the pAggInfo->aCol[] array. Return the index of -** the new element. Return a negative number if malloc fails. -*/ -static int addAggInfoColumn(AggInfo *pInfo){ - int i; - i = sqlite3ArrayAllocate((void**)&pInfo->aCol, sizeof(pInfo->aCol[0]), 3); - if( i<0 ){ - return -1; - } - return i; -} - -/* -** Add a new element to the pAggInfo->aFunc[] array. Return the index of -** the new element. Return a negative number if malloc fails. -*/ -static int addAggInfoFunc(AggInfo *pInfo){ - int i; - i = sqlite3ArrayAllocate((void**)&pInfo->aFunc, sizeof(pInfo->aFunc[0]), 2); - if( i<0 ){ - return -1; - } - return i; -} - -/* -** This is an xFunc for walkExprTree() used to implement -** sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates -** for additional information. -** -** This routine analyzes the aggregate function at pExpr. -*/ -static int analyzeAggregate(void *pArg, Expr *pExpr){ - int i; - NameContext *pNC = (NameContext *)pArg; - Parse *pParse = pNC->pParse; - SrcList *pSrcList = pNC->pSrcList; - AggInfo *pAggInfo = pNC->pAggInfo; - - - switch( pExpr->op ){ - case TK_COLUMN: { - /* Check to see if the column is in one of the tables in the FROM - ** clause of the aggregate query */ - if( pSrcList ){ - struct SrcList_item *pItem = pSrcList->a; - for(i=0; i<pSrcList->nSrc; i++, pItem++){ - struct AggInfo_col *pCol; - if( pExpr->iTable==pItem->iCursor ){ - /* If we reach this point, it means that pExpr refers to a table - ** that is in the FROM clause of the aggregate query. - ** - ** Make an entry for the column in pAggInfo->aCol[] if there - ** is not an entry there already. - */ - pCol = pAggInfo->aCol; - for(i=0; i<pAggInfo->nColumn; i++, pCol++){ - if( pCol->iTable==pExpr->iTable && - pCol->iColumn==pExpr->iColumn ){ - break; - } - } - if( i>=pAggInfo->nColumn && (i = addAggInfoColumn(pAggInfo))>=0 ){ - pCol = &pAggInfo->aCol[i]; - pCol->iTable = pExpr->iTable; - pCol->iColumn = pExpr->iColumn; - pCol->iMem = pParse->nMem++; - pCol->iSorterColumn = -1; - pCol->pExpr = pExpr; - if( pAggInfo->pGroupBy ){ - int j, n; - ExprList *pGB = pAggInfo->pGroupBy; - struct ExprList_item *pTerm = pGB->a; - n = pGB->nExpr; - for(j=0; j<n; j++, pTerm++){ - Expr *pE = pTerm->pExpr; - if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && - pE->iColumn==pExpr->iColumn ){ - pCol->iSorterColumn = j; - break; - } - } - } - if( pCol->iSorterColumn<0 ){ - pCol->iSorterColumn = pAggInfo->nSortingColumn++; - } - } - /* There is now an entry for pExpr in pAggInfo->aCol[] (either - ** because it was there before or because we just created it). - ** Convert the pExpr to be a TK_AGG_COLUMN referring to that - ** pAggInfo->aCol[] entry. - */ - pExpr->pAggInfo = pAggInfo; - pExpr->op = TK_AGG_COLUMN; - pExpr->iAgg = i; - break; - } /* endif pExpr->iTable==pItem->iCursor */ - } /* end loop over pSrcList */ - } - return 1; - } - case TK_AGG_FUNCTION: { - /* The pNC->nDepth==0 test causes aggregate functions in subqueries - ** to be ignored */ - if( pNC->nDepth==0 ){ - /* Check to see if pExpr is a duplicate of another aggregate - ** function that is already in the pAggInfo structure - */ - struct AggInfo_func *pItem = pAggInfo->aFunc; - for(i=0; i<pAggInfo->nFunc; i++, pItem++){ - if( sqlite3ExprCompare(pItem->pExpr, pExpr) ){ - break; - } - } - if( i>=pAggInfo->nFunc ){ - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - u8 enc = pParse->db->enc; - i = addAggInfoFunc(pAggInfo); - if( i>=0 ){ - pItem = &pAggInfo->aFunc[i]; - pItem->pExpr = pExpr; - pItem->iMem = pParse->nMem++; - pItem->pFunc = sqlite3FindFunction(pParse->db, - pExpr->token.z, pExpr->token.n, - pExpr->pList ? pExpr->pList->nExpr : 0, enc, 0); - if( pExpr->flags & EP_Distinct ){ - pItem->iDistinct = pParse->nTab++; - }else{ - pItem->iDistinct = -1; - } - } - } - /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry - */ - pExpr->iAgg = i; - pExpr->pAggInfo = pAggInfo; - return 1; - } - } - } - - /* Recursively walk subqueries looking for TK_COLUMN nodes that need - ** to be changed to TK_AGG_COLUMN. But increment nDepth so that - ** TK_AGG_FUNCTION nodes in subqueries will be unchanged. - */ - if( pExpr->pSelect ){ - pNC->nDepth++; - walkSelectExpr(pExpr->pSelect, analyzeAggregate, pNC); - pNC->nDepth--; - } - return 0; -} - -/* -** Analyze the given expression looking for aggregate functions and -** for variables that need to be added to the pParse->aAgg[] array. -** Make additional entries to the pParse->aAgg[] array as necessary. -** -** This routine should only be called after the expression has been -** analyzed by sqlite3ExprResolveNames(). -** -** If errors are seen, leave an error message in zErrMsg and return -** the number of errors. -*/ -int sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ - int nErr = pNC->pParse->nErr; - walkExprTree(pExpr, analyzeAggregate, pNC); - return pNC->pParse->nErr - nErr; -} - -/* -** Call sqlite3ExprAnalyzeAggregates() for every expression in an -** expression list. Return the number of errors. -** -** If an error is found, the analysis is cut short. -*/ -int sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){ - struct ExprList_item *pItem; - int i; - int nErr = 0; - if( pList ){ - for(pItem=pList->a, i=0; nErr==0 && i<pList->nExpr; i++, pItem++){ - nErr += sqlite3ExprAnalyzeAggregates(pNC, pItem->pExpr); - } - } - return nErr; -} diff --git a/ext/pdo_sqlite/sqlite/src/func.c b/ext/pdo_sqlite/sqlite/src/func.c deleted file mode 100644 index cdb674fa28cb9..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/func.c +++ /dev/null @@ -1,1118 +0,0 @@ -/* -** 2002 February 23 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement various SQL -** functions of SQLite. -** -** There is only one exported symbol in this file - the function -** sqliteRegisterBuildinFunctions() found at the bottom of the file. -** All other code has file scope. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <ctype.h> -#include <math.h> -#include <stdlib.h> -#include <assert.h> -#include "vdbeInt.h" -#include "os.h" - -/* -** Return the collating function associated with a function. -*/ -static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ - return context->pColl; -} - -/* -** Implementation of the non-aggregate min() and max() functions -*/ -static void minmaxFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int i; - int mask; /* 0 for min() or 0xffffffff for max() */ - int iBest; - CollSeq *pColl; - - if( argc==0 ) return; - mask = sqlite3_user_data(context)==0 ? 0 : -1; - pColl = sqlite3GetFuncCollSeq(context); - assert( pColl ); - assert( mask==-1 || mask==0 ); - iBest = 0; - if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; - for(i=1; i<argc; i++){ - if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return; - if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){ - iBest = i; - } - } - sqlite3_result_value(context, argv[iBest]); -} - -/* -** Return the type of the argument. -*/ -static void typeofFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - const char *z = 0; - switch( sqlite3_value_type(argv[0]) ){ - case SQLITE_NULL: z = "null"; break; - case SQLITE_INTEGER: z = "integer"; break; - case SQLITE_TEXT: z = "text"; break; - case SQLITE_FLOAT: z = "real"; break; - case SQLITE_BLOB: z = "blob"; break; - } - sqlite3_result_text(context, z, -1, SQLITE_STATIC); -} - - -/* -** Implementation of the length() function -*/ -static void lengthFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int len; - - assert( argc==1 ); - switch( sqlite3_value_type(argv[0]) ){ - case SQLITE_BLOB: - case SQLITE_INTEGER: - case SQLITE_FLOAT: { - sqlite3_result_int(context, sqlite3_value_bytes(argv[0])); - break; - } - case SQLITE_TEXT: { - const char *z = sqlite3_value_text(argv[0]); - for(len=0; *z; z++){ if( (0xc0&*z)!=0x80 ) len++; } - sqlite3_result_int(context, len); - break; - } - default: { - sqlite3_result_null(context); - break; - } - } -} - -/* -** Implementation of the abs() function -*/ -static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - assert( argc==1 ); - switch( sqlite3_value_type(argv[0]) ){ - case SQLITE_INTEGER: { - i64 iVal = sqlite3_value_int64(argv[0]); - if( iVal<0 ) iVal = iVal * -1; - sqlite3_result_int64(context, iVal); - break; - } - case SQLITE_NULL: { - sqlite3_result_null(context); - break; - } - default: { - double rVal = sqlite3_value_double(argv[0]); - if( rVal<0 ) rVal = rVal * -1.0; - sqlite3_result_double(context, rVal); - break; - } - } -} - -/* -** Implementation of the substr() function -*/ -static void substrFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - const char *z; - const char *z2; - int i; - int p1, p2, len; - - assert( argc==3 ); - z = sqlite3_value_text(argv[0]); - if( z==0 ) return; - p1 = sqlite3_value_int(argv[1]); - p2 = sqlite3_value_int(argv[2]); - for(len=0, z2=z; *z2; z2++){ if( (0xc0&*z2)!=0x80 ) len++; } - if( p1<0 ){ - p1 += len; - if( p1<0 ){ - p2 += p1; - p1 = 0; - } - }else if( p1>0 ){ - p1--; - } - if( p1+p2>len ){ - p2 = len-p1; - } - for(i=0; i<p1 && z[i]; i++){ - if( (z[i]&0xc0)==0x80 ) p1++; - } - while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p1++; } - for(; i<p1+p2 && z[i]; i++){ - if( (z[i]&0xc0)==0x80 ) p2++; - } - while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p2++; } - if( p2<0 ) p2 = 0; - sqlite3_result_text(context, &z[p1], p2, SQLITE_TRANSIENT); -} - -/* -** Implementation of the round() function -*/ -static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - int n = 0; - double r; - char zBuf[500]; /* larger than the %f representation of the largest double */ - assert( argc==1 || argc==2 ); - if( argc==2 ){ - if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return; - n = sqlite3_value_int(argv[1]); - if( n>30 ) n = 30; - if( n<0 ) n = 0; - } - if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; - r = sqlite3_value_double(argv[0]); - sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r); - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); -} - -/* -** Implementation of the upper() and lower() SQL functions. -*/ -static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - unsigned char *z; - int i; - if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; - z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); - if( z==0 ) return; - strcpy(z, sqlite3_value_text(argv[0])); - for(i=0; z[i]; i++){ - z[i] = toupper(z[i]); - } - sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT); - sqliteFree(z); -} -static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - unsigned char *z; - int i; - if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; - z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); - if( z==0 ) return; - strcpy(z, sqlite3_value_text(argv[0])); - for(i=0; z[i]; i++){ - z[i] = tolower(z[i]); - } - sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT); - sqliteFree(z); -} - -/* -** Implementation of the IFNULL(), NVL(), and COALESCE() functions. -** All three do the same thing. They return the first non-NULL -** argument. -*/ -static void ifnullFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int i; - for(i=0; i<argc; i++){ - if( SQLITE_NULL!=sqlite3_value_type(argv[i]) ){ - sqlite3_result_value(context, argv[i]); - break; - } - } -} - -/* -** Implementation of random(). Return a random integer. -*/ -static void randomFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int r; - sqlite3Randomness(sizeof(r), &r); - sqlite3_result_int(context, r); -} - -/* -** Implementation of the last_insert_rowid() SQL function. The return -** value is the same as the sqlite3_last_insert_rowid() API function. -*/ -static void last_insert_rowid( - sqlite3_context *context, - int arg, - sqlite3_value **argv -){ - sqlite3 *db = sqlite3_user_data(context); - sqlite3_result_int64(context, sqlite3_last_insert_rowid(db)); -} - -/* -** Implementation of the changes() SQL function. The return value is the -** same as the sqlite3_changes() API function. -*/ -static void changes( - sqlite3_context *context, - int arg, - sqlite3_value **argv -){ - sqlite3 *db = sqlite3_user_data(context); - sqlite3_result_int(context, sqlite3_changes(db)); -} - -/* -** Implementation of the total_changes() SQL function. The return value is -** the same as the sqlite3_total_changes() API function. -*/ -static void total_changes( - sqlite3_context *context, - int arg, - sqlite3_value **argv -){ - sqlite3 *db = sqlite3_user_data(context); - sqlite3_result_int(context, sqlite3_total_changes(db)); -} - -/* -** A structure defining how to do GLOB-style comparisons. -*/ -struct compareInfo { - u8 matchAll; - u8 matchOne; - u8 matchSet; - u8 noCase; -}; - -static const struct compareInfo globInfo = { '*', '?', '[', 0 }; -/* The correct SQL-92 behavior is for the LIKE operator to ignore -** case. Thus 'a' LIKE 'A' would be true. */ -static const struct compareInfo likeInfoNorm = { '%', '_', 0, 1 }; -/* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator -** is case sensitive causing 'a' LIKE 'A' to be false */ -static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 }; - -/* -** X is a pointer to the first byte of a UTF-8 character. Increment -** X so that it points to the next character. This only works right -** if X points to a well-formed UTF-8 string. -*/ -#define sqliteNextChar(X) while( (0xc0&*++(X))==0x80 ){} -#define sqliteCharVal(X) sqlite3ReadUtf8(X) - - -/* -** Compare two UTF-8 strings for equality where the first string can -** potentially be a "glob" expression. Return true (1) if they -** are the same and false (0) if they are different. -** -** Globbing rules: -** -** '*' Matches any sequence of zero or more characters. -** -** '?' Matches exactly one character. -** -** [...] Matches one character from the enclosed list of -** characters. -** -** [^...] Matches one character not in the enclosed list. -** -** With the [...] and [^...] matching, a ']' character can be included -** in the list by making it the first character after '[' or '^'. A -** range of characters can be specified using '-'. Example: -** "[a-z]" matches any single lower-case letter. To match a '-', make -** it the last character in the list. -** -** This routine is usually quick, but can be N**2 in the worst case. -** -** Hints: to match '*' or '?', put them in "[]". Like this: -** -** abc[*]xyz Matches "abc*xyz" only -*/ -static int patternCompare( - const u8 *zPattern, /* The glob pattern */ - const u8 *zString, /* The string to compare against the glob */ - const struct compareInfo *pInfo, /* Information about how to do the compare */ - const int esc /* The escape character */ -){ - register int c; - int invert; - int seen; - int c2; - u8 matchOne = pInfo->matchOne; - u8 matchAll = pInfo->matchAll; - u8 matchSet = pInfo->matchSet; - u8 noCase = pInfo->noCase; - int prevEscape = 0; /* True if the previous character was 'escape' */ - - while( (c = *zPattern)!=0 ){ - if( !prevEscape && c==matchAll ){ - while( (c=zPattern[1]) == matchAll || c == matchOne ){ - if( c==matchOne ){ - if( *zString==0 ) return 0; - sqliteNextChar(zString); - } - zPattern++; - } - if( c && esc && sqlite3ReadUtf8(&zPattern[1])==esc ){ - u8 const *zTemp = &zPattern[1]; - sqliteNextChar(zTemp); - c = *zTemp; - } - if( c==0 ) return 1; - if( c==matchSet ){ - assert( esc==0 ); /* This is GLOB, not LIKE */ - while( *zString && patternCompare(&zPattern[1],zString,pInfo,esc)==0 ){ - sqliteNextChar(zString); - } - return *zString!=0; - }else{ - while( (c2 = *zString)!=0 ){ - if( noCase ){ - c2 = sqlite3UpperToLower[c2]; - c = sqlite3UpperToLower[c]; - while( c2 != 0 && c2 != c ){ c2 = sqlite3UpperToLower[*++zString]; } - }else{ - while( c2 != 0 && c2 != c ){ c2 = *++zString; } - } - if( c2==0 ) return 0; - if( patternCompare(&zPattern[1],zString,pInfo,esc) ) return 1; - sqliteNextChar(zString); - } - return 0; - } - }else if( !prevEscape && c==matchOne ){ - if( *zString==0 ) return 0; - sqliteNextChar(zString); - zPattern++; - }else if( c==matchSet ){ - int prior_c = 0; - assert( esc==0 ); /* This only occurs for GLOB, not LIKE */ - seen = 0; - invert = 0; - c = sqliteCharVal(zString); - if( c==0 ) return 0; - c2 = *++zPattern; - if( c2=='^' ){ invert = 1; c2 = *++zPattern; } - if( c2==']' ){ - if( c==']' ) seen = 1; - c2 = *++zPattern; - } - while( (c2 = sqliteCharVal(zPattern))!=0 && c2!=']' ){ - if( c2=='-' && zPattern[1]!=']' && zPattern[1]!=0 && prior_c>0 ){ - zPattern++; - c2 = sqliteCharVal(zPattern); - if( c>=prior_c && c<=c2 ) seen = 1; - prior_c = 0; - }else if( c==c2 ){ - seen = 1; - prior_c = c2; - }else{ - prior_c = c2; - } - sqliteNextChar(zPattern); - } - if( c2==0 || (seen ^ invert)==0 ) return 0; - sqliteNextChar(zString); - zPattern++; - }else if( esc && !prevEscape && sqlite3ReadUtf8(zPattern)==esc){ - prevEscape = 1; - sqliteNextChar(zPattern); - }else{ - if( noCase ){ - if( sqlite3UpperToLower[c] != sqlite3UpperToLower[*zString] ) return 0; - }else{ - if( c != *zString ) return 0; - } - zPattern++; - zString++; - prevEscape = 0; - } - } - return *zString==0; -} - -/* -** Count the number of times that the LIKE operator (or GLOB which is -** just a variation of LIKE) gets called. This is used for testing -** only. -*/ -#ifdef SQLITE_TEST -int sqlite3_like_count = 0; -#endif - - -/* -** Implementation of the like() SQL function. This function implements -** the build-in LIKE operator. The first argument to the function is the -** pattern and the second argument is the string. So, the SQL statements: -** -** A LIKE B -** -** is implemented as like(B,A). -** -** This same function (with a different compareInfo structure) computes -** the GLOB operator. -*/ -static void likeFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - const unsigned char *zA = sqlite3_value_text(argv[0]); - const unsigned char *zB = sqlite3_value_text(argv[1]); - int escape = 0; - if( argc==3 ){ - /* The escape character string must consist of a single UTF-8 character. - ** Otherwise, return an error. - */ - const unsigned char *zEsc = sqlite3_value_text(argv[2]); - if( sqlite3utf8CharLen(zEsc, -1)!=1 ){ - sqlite3_result_error(context, - "ESCAPE expression must be a single character", -1); - return; - } - escape = sqlite3ReadUtf8(zEsc); - } - if( zA && zB ){ - struct compareInfo *pInfo = sqlite3_user_data(context); -#ifdef SQLITE_TEST - sqlite3_like_count++; -#endif - sqlite3_result_int(context, patternCompare(zA, zB, pInfo, escape)); - } -} - -/* -** Implementation of the NULLIF(x,y) function. The result is the first -** argument if the arguments are different. The result is NULL if the -** arguments are equal to each other. -*/ -static void nullifFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - CollSeq *pColl = sqlite3GetFuncCollSeq(context); - if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){ - sqlite3_result_value(context, argv[0]); - } -} - -/* -** Implementation of the VERSION(*) function. The result is the version -** of the SQLite library that is running. -*/ -static void versionFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC); -} - - -/* -** EXPERIMENTAL - This is not an official function. The interface may -** change. This function may disappear. Do not write code that depends -** on this function. -** -** Implementation of the QUOTE() function. This function takes a single -** argument. If the argument is numeric, the return value is the same as -** the argument. If the argument is NULL, the return value is the string -** "NULL". Otherwise, the argument is enclosed in single quotes with -** single-quote escapes. -*/ -static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - if( argc<1 ) return; - switch( sqlite3_value_type(argv[0]) ){ - case SQLITE_NULL: { - sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC); - break; - } - case SQLITE_INTEGER: - case SQLITE_FLOAT: { - sqlite3_result_value(context, argv[0]); - break; - } - case SQLITE_BLOB: { - static const char hexdigits[] = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' - }; - char *zText = 0; - int nBlob = sqlite3_value_bytes(argv[0]); - char const *zBlob = sqlite3_value_blob(argv[0]); - - zText = (char *)sqliteMalloc((2*nBlob)+4); - if( !zText ){ - sqlite3_result_error(context, "out of memory", -1); - }else{ - int i; - for(i=0; i<nBlob; i++){ - zText[(i*2)+2] = hexdigits[(zBlob[i]>>4)&0x0F]; - zText[(i*2)+3] = hexdigits[(zBlob[i])&0x0F]; - } - zText[(nBlob*2)+2] = '\''; - zText[(nBlob*2)+3] = '\0'; - zText[0] = 'X'; - zText[1] = '\''; - sqlite3_result_text(context, zText, -1, SQLITE_TRANSIENT); - sqliteFree(zText); - } - break; - } - case SQLITE_TEXT: { - int i,j,n; - const char *zArg = sqlite3_value_text(argv[0]); - char *z; - - for(i=n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; } - z = sqliteMalloc( i+n+3 ); - if( z==0 ) return; - z[0] = '\''; - for(i=0, j=1; zArg[i]; i++){ - z[j++] = zArg[i]; - if( zArg[i]=='\'' ){ - z[j++] = '\''; - } - } - z[j++] = '\''; - z[j] = 0; - sqlite3_result_text(context, z, j, SQLITE_TRANSIENT); - sqliteFree(z); - } - } -} - -#ifdef SQLITE_SOUNDEX -/* -** Compute the soundex encoding of a word. -*/ -static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - char zResult[8]; - const u8 *zIn; - int i, j; - static const unsigned char iCode[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0, - 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0, - 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0, - }; - assert( argc==1 ); - zIn = (u8*)sqlite3_value_text(argv[0]); - for(i=0; zIn[i] && !isalpha(zIn[i]); i++){} - if( zIn[i] ){ - zResult[0] = toupper(zIn[i]); - for(j=1; j<4 && zIn[i]; i++){ - int code = iCode[zIn[i]&0x7f]; - if( code>0 ){ - zResult[j++] = code + '0'; - } - } - while( j<4 ){ - zResult[j++] = '0'; - } - zResult[j] = 0; - sqlite3_result_text(context, zResult, 4, SQLITE_TRANSIENT); - }else{ - sqlite3_result_text(context, "?000", 4, SQLITE_STATIC); - } -} -#endif - -#ifdef SQLITE_TEST -/* -** This function generates a string of random characters. Used for -** generating test data. -*/ -static void randStr(sqlite3_context *context, int argc, sqlite3_value **argv){ - static const unsigned char zSrc[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789" - ".-!,:*^+=_|?/<> "; - int iMin, iMax, n, r, i; - unsigned char zBuf[1000]; - if( argc>=1 ){ - iMin = sqlite3_value_int(argv[0]); - if( iMin<0 ) iMin = 0; - if( iMin>=sizeof(zBuf) ) iMin = sizeof(zBuf)-1; - }else{ - iMin = 1; - } - if( argc>=2 ){ - iMax = sqlite3_value_int(argv[1]); - if( iMax<iMin ) iMax = iMin; - if( iMax>=sizeof(zBuf) ) iMax = sizeof(zBuf)-1; - }else{ - iMax = 50; - } - n = iMin; - if( iMax>iMin ){ - sqlite3Randomness(sizeof(r), &r); - r &= 0x7fffffff; - n += r%(iMax + 1 - iMin); - } - assert( n<sizeof(zBuf) ); - sqlite3Randomness(n, zBuf); - for(i=0; i<n; i++){ - zBuf[i] = zSrc[zBuf[i]%(sizeof(zSrc)-1)]; - } - zBuf[n] = 0; - sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT); -} -#endif /* SQLITE_TEST */ - -#ifdef SQLITE_TEST -/* -** The following two SQL functions are used to test returning a text -** result with a destructor. Function 'test_destructor' takes one argument -** and returns the same argument interpreted as TEXT. A destructor is -** passed with the sqlite3_result_text() call. -** -** SQL function 'test_destructor_count' returns the number of outstanding -** allocations made by 'test_destructor'; -** -** WARNING: Not threadsafe. -*/ -static int test_destructor_count_var = 0; -static void destructor(void *p){ - char *zVal = (char *)p; - assert(zVal); - zVal--; - sqliteFree(zVal); - test_destructor_count_var--; -} -static void test_destructor( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - char *zVal; - int len; - sqlite3 *db = sqlite3_user_data(pCtx); - - test_destructor_count_var++; - assert( nArg==1 ); - if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; - len = sqlite3ValueBytes(argv[0], db->enc); - zVal = sqliteMalloc(len+3); - zVal[len] = 0; - zVal[len-1] = 0; - assert( zVal ); - zVal++; - memcpy(zVal, sqlite3ValueText(argv[0], db->enc), len); - if( db->enc==SQLITE_UTF8 ){ - sqlite3_result_text(pCtx, zVal, -1, destructor); -#ifndef SQLITE_OMIT_UTF16 - }else if( db->enc==SQLITE_UTF16LE ){ - sqlite3_result_text16le(pCtx, zVal, -1, destructor); - }else{ - sqlite3_result_text16be(pCtx, zVal, -1, destructor); -#endif /* SQLITE_OMIT_UTF16 */ - } -} -static void test_destructor_count( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - sqlite3_result_int(pCtx, test_destructor_count_var); -} -#endif /* SQLITE_TEST */ - -#ifdef SQLITE_TEST -/* -** Routines for testing the sqlite3_get_auxdata() and sqlite3_set_auxdata() -** interface. -** -** The test_auxdata() SQL function attempts to register each of its arguments -** as auxiliary data. If there are no prior registrations of aux data for -** that argument (meaning the argument is not a constant or this is its first -** call) then the result for that argument is 0. If there is a prior -** registration, the result for that argument is 1. The overall result -** is the individual argument results separated by spaces. -*/ -static void free_test_auxdata(void *p) {sqliteFree(p);} -static void test_auxdata( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - int i; - char *zRet = sqliteMalloc(nArg*2); - if( !zRet ) return; - for(i=0; i<nArg; i++){ - char const *z = sqlite3_value_text(argv[i]); - if( z ){ - char *zAux = sqlite3_get_auxdata(pCtx, i); - if( zAux ){ - zRet[i*2] = '1'; - if( strcmp(zAux, z) ){ - sqlite3_result_error(pCtx, "Auxilary data corruption", -1); - return; - } - }else{ - zRet[i*2] = '0'; - zAux = sqliteStrDup(z); - sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata); - } - zRet[i*2+1] = ' '; - } - } - sqlite3_result_text(pCtx, zRet, 2*nArg-1, free_test_auxdata); -} -#endif /* SQLITE_TEST */ - -#ifdef SQLITE_TEST -/* -** A function to test error reporting from user functions. This function -** returns a copy of it's first argument as an error. -*/ -static void test_error( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - sqlite3_result_error(pCtx, sqlite3_value_text(argv[0]), 0); -} -#endif /* SQLITE_TEST */ - -/* -** An instance of the following structure holds the context of a -** sum() or avg() aggregate computation. -*/ -typedef struct SumCtx SumCtx; -struct SumCtx { - double sum; /* Sum of terms */ - int cnt; /* Number of elements summed */ - u8 seenFloat; /* True if there has been any floating point value */ -}; - -/* -** Routines used to compute the sum or average. -*/ -static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){ - SumCtx *p; - int type; - assert( argc==1 ); - p = sqlite3_aggregate_context(context, sizeof(*p)); - type = sqlite3_value_type(argv[0]); - if( p && type!=SQLITE_NULL ){ - p->sum += sqlite3_value_double(argv[0]); - p->cnt++; - if( type==SQLITE_FLOAT ){ - p->seenFloat = 1; - } - } -} -static void sumFinalize(sqlite3_context *context){ - SumCtx *p; - p = sqlite3_aggregate_context(context, 0); - if( p && p->cnt>0 ){ - if( p->seenFloat ){ - sqlite3_result_double(context, p->sum); - }else{ - sqlite3_result_int64(context, (i64)p->sum); - } - } -} -static void avgFinalize(sqlite3_context *context){ - SumCtx *p; - p = sqlite3_aggregate_context(context, 0); - if( p && p->cnt>0 ){ - sqlite3_result_double(context, p->sum/(double)p->cnt); - } -} - -/* -** An instance of the following structure holds the context of a -** variance or standard deviation computation. -*/ -typedef struct StdDevCtx StdDevCtx; -struct StdDevCtx { - double sum; /* Sum of terms */ - double sum2; /* Sum of the squares of terms */ - int cnt; /* Number of terms counted */ -}; - -/* -** The following structure keeps track of state information for the -** count() aggregate function. -*/ -typedef struct CountCtx CountCtx; -struct CountCtx { - int n; -}; - -/* -** Routines to implement the count() aggregate function. -*/ -static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){ - CountCtx *p; - p = sqlite3_aggregate_context(context, sizeof(*p)); - if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ - p->n++; - } -} -static void countFinalize(sqlite3_context *context){ - CountCtx *p; - p = sqlite3_aggregate_context(context, 0); - sqlite3_result_int(context, p ? p->n : 0); -} - -/* -** Routines to implement min() and max() aggregate functions. -*/ -static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv){ - Mem *pArg = (Mem *)argv[0]; - Mem *pBest; - - if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; - pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); - if( !pBest ) return; - - if( pBest->flags ){ - int max; - int cmp; - CollSeq *pColl = sqlite3GetFuncCollSeq(context); - /* This step function is used for both the min() and max() aggregates, - ** the only difference between the two being that the sense of the - ** comparison is inverted. For the max() aggregate, the - ** sqlite3_user_data() function returns (void *)-1. For min() it - ** returns (void *)db, where db is the sqlite3* database pointer. - ** Therefore the next statement sets variable 'max' to 1 for the max() - ** aggregate, or 0 for min(). - */ - max = ((sqlite3_user_data(context)==(void *)-1)?1:0); - cmp = sqlite3MemCompare(pBest, pArg, pColl); - if( (max && cmp<0) || (!max && cmp>0) ){ - sqlite3VdbeMemCopy(pBest, pArg); - } - }else{ - sqlite3VdbeMemCopy(pBest, pArg); - } -} -static void minMaxFinalize(sqlite3_context *context){ - sqlite3_value *pRes; - pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0); - if( pRes ){ - if( pRes->flags ){ - sqlite3_result_value(context, pRes); - } - sqlite3VdbeMemRelease(pRes); - } -} - - -/* -** This function registered all of the above C functions as SQL -** functions. This should be the only routine in this file with -** external linkage. -*/ -void sqlite3RegisterBuiltinFunctions(sqlite3 *db){ - static const struct { - char *zName; - signed char nArg; - u8 argType; /* 0: none. 1: db 2: (-1) */ - u8 eTextRep; /* 1: UTF-16. 0: UTF-8 */ - u8 needCollSeq; - void (*xFunc)(sqlite3_context*,int,sqlite3_value **); - } aFuncs[] = { - { "min", -1, 0, SQLITE_UTF8, 1, minmaxFunc }, - { "min", 0, 0, SQLITE_UTF8, 1, 0 }, - { "max", -1, 2, SQLITE_UTF8, 1, minmaxFunc }, - { "max", 0, 2, SQLITE_UTF8, 1, 0 }, - { "typeof", 1, 0, SQLITE_UTF8, 0, typeofFunc }, - { "length", 1, 0, SQLITE_UTF8, 0, lengthFunc }, - { "substr", 3, 0, SQLITE_UTF8, 0, substrFunc }, -#ifndef SQLITE_OMIT_UTF16 - { "substr", 3, 0, SQLITE_UTF16LE, 0, sqlite3utf16Substr }, -#endif - { "abs", 1, 0, SQLITE_UTF8, 0, absFunc }, - { "round", 1, 0, SQLITE_UTF8, 0, roundFunc }, - { "round", 2, 0, SQLITE_UTF8, 0, roundFunc }, - { "upper", 1, 0, SQLITE_UTF8, 0, upperFunc }, - { "lower", 1, 0, SQLITE_UTF8, 0, lowerFunc }, - { "coalesce", -1, 0, SQLITE_UTF8, 0, ifnullFunc }, - { "coalesce", 0, 0, SQLITE_UTF8, 0, 0 }, - { "coalesce", 1, 0, SQLITE_UTF8, 0, 0 }, - { "ifnull", 2, 0, SQLITE_UTF8, 1, ifnullFunc }, - { "random", -1, 0, SQLITE_UTF8, 0, randomFunc }, - { "nullif", 2, 0, SQLITE_UTF8, 1, nullifFunc }, - { "sqlite_version", 0, 0, SQLITE_UTF8, 0, versionFunc}, - { "quote", 1, 0, SQLITE_UTF8, 0, quoteFunc }, - { "last_insert_rowid", 0, 1, SQLITE_UTF8, 0, last_insert_rowid }, - { "changes", 0, 1, SQLITE_UTF8, 0, changes }, - { "total_changes", 0, 1, SQLITE_UTF8, 0, total_changes }, -#ifdef SQLITE_SOUNDEX - { "soundex", 1, 0, SQLITE_UTF8, 0, soundexFunc}, -#endif -#ifdef SQLITE_TEST - { "randstr", 2, 0, SQLITE_UTF8, 0, randStr }, - { "test_destructor", 1, 1, SQLITE_UTF8, 0, test_destructor}, - { "test_destructor_count", 0, 0, SQLITE_UTF8, 0, test_destructor_count}, - { "test_auxdata", -1, 0, SQLITE_UTF8, 0, test_auxdata}, - { "test_error", 1, 0, SQLITE_UTF8, 0, test_error}, -#endif - }; - static const struct { - char *zName; - signed char nArg; - u8 argType; - u8 needCollSeq; - void (*xStep)(sqlite3_context*,int,sqlite3_value**); - void (*xFinalize)(sqlite3_context*); - } aAggs[] = { - { "min", 1, 0, 1, minmaxStep, minMaxFinalize }, - { "max", 1, 2, 1, minmaxStep, minMaxFinalize }, - { "sum", 1, 0, 0, sumStep, sumFinalize }, - { "avg", 1, 0, 0, sumStep, avgFinalize }, - { "count", 0, 0, 0, countStep, countFinalize }, - { "count", 1, 0, 0, countStep, countFinalize }, - }; - int i; - - for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ - void *pArg = 0; - switch( aFuncs[i].argType ){ - case 1: pArg = db; break; - case 2: pArg = (void *)(-1); break; - } - sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg, - aFuncs[i].eTextRep, pArg, aFuncs[i].xFunc, 0, 0); - if( aFuncs[i].needCollSeq ){ - FuncDef *pFunc = sqlite3FindFunction(db, aFuncs[i].zName, - strlen(aFuncs[i].zName), aFuncs[i].nArg, aFuncs[i].eTextRep, 0); - if( pFunc && aFuncs[i].needCollSeq ){ - pFunc->needCollSeq = 1; - } - } - } -#ifndef SQLITE_OMIT_ALTERTABLE - sqlite3AlterFunctions(db); -#endif - for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){ - void *pArg = 0; - switch( aAggs[i].argType ){ - case 1: pArg = db; break; - case 2: pArg = (void *)(-1); break; - } - sqlite3_create_function(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8, - pArg, 0, aAggs[i].xStep, aAggs[i].xFinalize); - if( aAggs[i].needCollSeq ){ - FuncDef *pFunc = sqlite3FindFunction( db, aAggs[i].zName, - strlen(aAggs[i].zName), aAggs[i].nArg, SQLITE_UTF8, 0); - if( pFunc && aAggs[i].needCollSeq ){ - pFunc->needCollSeq = 1; - } - } - } - sqlite3RegisterDateTimeFunctions(db); -#ifdef SQLITE_SSE - sqlite3SseFunctions(db); -#endif -#ifdef SQLITE_CASE_SENSITIVE_LIKE - sqlite3RegisterLikeFunctions(db, 1); -#else - sqlite3RegisterLikeFunctions(db, 0); -#endif -} - -/* -** Set the LIKEOPT flag on the 2-argument function with the given name. -*/ -static void setLikeOptFlag(sqlite3 *db, const char *zName, int flagVal){ - FuncDef *pDef; - pDef = sqlite3FindFunction(db, zName, strlen(zName), 2, SQLITE_UTF8, 0); - if( pDef ){ - pDef->flags = flagVal; - } -} - -/* -** Register the built-in LIKE and GLOB functions. The caseSensitive -** parameter determines whether or not the LIKE operator is case -** sensitive. GLOB is always case sensitive. -*/ -void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){ - struct compareInfo *pInfo; - if( caseSensitive ){ - pInfo = (struct compareInfo*)&likeInfoAlt; - }else{ - pInfo = (struct compareInfo*)&likeInfoNorm; - } - sqlite3_create_function(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0); - sqlite3_create_function(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0); - sqlite3_create_function(db, "glob", 2, SQLITE_UTF8, - (struct compareInfo*)&globInfo, likeFunc, 0,0); - setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE); - setLikeOptFlag(db, "like", - caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE); -} - -/* -** pExpr points to an expression which implements a function. If -** it is appropriate to apply the LIKE optimization to that function -** then set aWc[0] through aWc[2] to the wildcard characters and -** return TRUE. If the function is not a LIKE-style function then -** return FALSE. -*/ -int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ - FuncDef *pDef; - if( pExpr->op!=TK_FUNCTION ){ - return 0; - } - if( pExpr->pList->nExpr!=2 ){ - return 0; - } - pDef = sqlite3FindFunction(db, pExpr->token.z, pExpr->token.n, 2, - SQLITE_UTF8, 0); - if( pDef==0 || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){ - return 0; - } - - /* The memcpy() statement assumes that the wildcard characters are - ** the first three statements in the compareInfo structure. The - ** asserts() that follow verify that assumption - */ - memcpy(aWc, pDef->pUserData, 3); - assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll ); - assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne ); - assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet ); - *pIsNocase = (pDef->flags & SQLITE_FUNC_CASE)==0; - return 1; -} diff --git a/ext/pdo_sqlite/sqlite/src/hash.c b/ext/pdo_sqlite/sqlite/src/hash.c deleted file mode 100644 index e01aae71630dc..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/hash.c +++ /dev/null @@ -1,387 +0,0 @@ -/* -** 2001 September 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the implementation of generic hash-tables -** used in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <assert.h> - -/* Turn bulk memory into a hash table object by initializing the -** fields of the Hash structure. -** -** "pNew" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER, -** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass -** determines what kind of key the hash table will use. "copyKey" is -** true if the hash table should make its own private copy of keys and -** false if it should just use the supplied pointer. CopyKey only makes -** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored -** for other key classes. -*/ -void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){ - assert( pNew!=0 ); - assert( keyClass>=SQLITE_HASH_STRING && keyClass<=SQLITE_HASH_BINARY ); - pNew->keyClass = keyClass; -#if 0 - if( keyClass==SQLITE_HASH_POINTER || keyClass==SQLITE_HASH_INT ) copyKey = 0; -#endif - pNew->copyKey = copyKey; - pNew->first = 0; - pNew->count = 0; - pNew->htsize = 0; - pNew->ht = 0; -} - -/* Remove all entries from a hash table. Reclaim all memory. -** Call this routine to delete a hash table or to reset a hash table -** to the empty state. -*/ -void sqlite3HashClear(Hash *pH){ - HashElem *elem; /* For looping over all elements of the table */ - - assert( pH!=0 ); - elem = pH->first; - pH->first = 0; - if( pH->ht ) sqliteFree(pH->ht); - pH->ht = 0; - pH->htsize = 0; - while( elem ){ - HashElem *next_elem = elem->next; - if( pH->copyKey && elem->pKey ){ - sqliteFree(elem->pKey); - } - sqliteFree(elem); - elem = next_elem; - } - pH->count = 0; -} - -#if 0 /* NOT USED */ -/* -** Hash and comparison functions when the mode is SQLITE_HASH_INT -*/ -static int intHash(const void *pKey, int nKey){ - return nKey ^ (nKey<<8) ^ (nKey>>8); -} -static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - return n2 - n1; -} -#endif - -#if 0 /* NOT USED */ -/* -** Hash and comparison functions when the mode is SQLITE_HASH_POINTER -*/ -static int ptrHash(const void *pKey, int nKey){ - uptr x = Addr(pKey); - return x ^ (x<<8) ^ (x>>8); -} -static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( pKey1==pKey2 ) return 0; - if( pKey1<pKey2 ) return -1; - return 1; -} -#endif - -/* -** Hash and comparison functions when the mode is SQLITE_HASH_STRING -*/ -static int strHash(const void *pKey, int nKey){ - const char *z = (const char *)pKey; - int h = 0; - if( nKey<=0 ) nKey = strlen(z); - while( nKey > 0 ){ - h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++]; - nKey--; - } - return h & 0x7fffffff; -} -static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( n1!=n2 ) return 1; - return sqlite3StrNICmp((const char*)pKey1,(const char*)pKey2,n1); -} - -/* -** Hash and comparison functions when the mode is SQLITE_HASH_BINARY -*/ -static int binHash(const void *pKey, int nKey){ - int h = 0; - const char *z = (const char *)pKey; - while( nKey-- > 0 ){ - h = (h<<3) ^ h ^ *(z++); - } - return h & 0x7fffffff; -} -static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( n1!=n2 ) return 1; - return memcmp(pKey1,pKey2,n1); -} - -/* -** Return a pointer to the appropriate hash function given the key class. -** -** The C syntax in this function definition may be unfamilar to some -** programmers, so we provide the following additional explanation: -** -** The name of the function is "hashFunction". The function takes a -** single parameter "keyClass". The return value of hashFunction() -** is a pointer to another function. Specifically, the return value -** of hashFunction() is a pointer to a function that takes two parameters -** with types "const void*" and "int" and returns an "int". -*/ -static int (*hashFunction(int keyClass))(const void*,int){ -#if 0 /* HASH_INT and HASH_POINTER are never used */ - switch( keyClass ){ - case SQLITE_HASH_INT: return &intHash; - case SQLITE_HASH_POINTER: return &ptrHash; - case SQLITE_HASH_STRING: return &strHash; - case SQLITE_HASH_BINARY: return &binHash;; - default: break; - } - return 0; -#else - if( keyClass==SQLITE_HASH_STRING ){ - return &strHash; - }else{ - assert( keyClass==SQLITE_HASH_BINARY ); - return &binHash; - } -#endif -} - -/* -** Return a pointer to the appropriate hash function given the key class. -** -** For help in interpreted the obscure C code in the function definition, -** see the header comment on the previous function. -*/ -static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ -#if 0 /* HASH_INT and HASH_POINTER are never used */ - switch( keyClass ){ - case SQLITE_HASH_INT: return &intCompare; - case SQLITE_HASH_POINTER: return &ptrCompare; - case SQLITE_HASH_STRING: return &strCompare; - case SQLITE_HASH_BINARY: return &binCompare; - default: break; - } - return 0; -#else - if( keyClass==SQLITE_HASH_STRING ){ - return &strCompare; - }else{ - assert( keyClass==SQLITE_HASH_BINARY ); - return &binCompare; - } -#endif -} - -/* Link an element into the hash table -*/ -static void insertElement( - Hash *pH, /* The complete hash table */ - struct _ht *pEntry, /* The entry into which pNew is inserted */ - HashElem *pNew /* The element to be inserted */ -){ - HashElem *pHead; /* First element already in pEntry */ - pHead = pEntry->chain; - if( pHead ){ - pNew->next = pHead; - pNew->prev = pHead->prev; - if( pHead->prev ){ pHead->prev->next = pNew; } - else { pH->first = pNew; } - pHead->prev = pNew; - }else{ - pNew->next = pH->first; - if( pH->first ){ pH->first->prev = pNew; } - pNew->prev = 0; - pH->first = pNew; - } - pEntry->count++; - pEntry->chain = pNew; -} - - -/* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail -** to resize if sqliteMalloc() fails. -*/ -static void rehash(Hash *pH, int new_size){ - struct _ht *new_ht; /* The new hash table */ - HashElem *elem, *next_elem; /* For looping over existing elements */ - int (*xHash)(const void*,int); /* The hash function */ - - assert( (new_size & (new_size-1))==0 ); - new_ht = (struct _ht *)sqliteMalloc( new_size*sizeof(struct _ht) ); - if( new_ht==0 ) return; - if( pH->ht ) sqliteFree(pH->ht); - pH->ht = new_ht; - pH->htsize = new_size; - xHash = hashFunction(pH->keyClass); - for(elem=pH->first, pH->first=0; elem; elem = next_elem){ - int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); - next_elem = elem->next; - insertElement(pH, &new_ht[h], elem); - } -} - -/* This function (for internal use only) locates an element in an -** hash table that matches the given key. The hash for this key has -** already been computed and is passed as the 4th parameter. -*/ -static HashElem *findElementGivenHash( - const Hash *pH, /* The pH to be searched */ - const void *pKey, /* The key we are searching for */ - int nKey, - int h /* The hash for this key. */ -){ - HashElem *elem; /* Used to loop thru the element list */ - int count; /* Number of elements left to test */ - int (*xCompare)(const void*,int,const void*,int); /* comparison function */ - - if( pH->ht ){ - struct _ht *pEntry = &pH->ht[h]; - elem = pEntry->chain; - count = pEntry->count; - xCompare = compareFunction(pH->keyClass); - while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ - return elem; - } - elem = elem->next; - } - } - return 0; -} - -/* Remove a single entry from the hash table given a pointer to that -** element and a hash on the element's key. -*/ -static void removeElementGivenHash( - Hash *pH, /* The pH containing "elem" */ - HashElem* elem, /* The element to be removed from the pH */ - int h /* Hash value for the element */ -){ - struct _ht *pEntry; - if( elem->prev ){ - elem->prev->next = elem->next; - }else{ - pH->first = elem->next; - } - if( elem->next ){ - elem->next->prev = elem->prev; - } - pEntry = &pH->ht[h]; - if( pEntry->chain==elem ){ - pEntry->chain = elem->next; - } - pEntry->count--; - if( pEntry->count<=0 ){ - pEntry->chain = 0; - } - if( pH->copyKey && elem->pKey ){ - sqliteFree(elem->pKey); - } - sqliteFree( elem ); - pH->count--; -} - -/* Attempt to locate an element of the hash table pH with a key -** that matches pKey,nKey. Return the data for this element if it is -** found, or NULL if there is no match. -*/ -void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){ - int h; /* A hash on key */ - HashElem *elem; /* The element that matches key */ - int (*xHash)(const void*,int); /* The hash function */ - - if( pH==0 || pH->ht==0 ) return 0; - xHash = hashFunction(pH->keyClass); - assert( xHash!=0 ); - h = (*xHash)(pKey,nKey); - assert( (pH->htsize & (pH->htsize-1))==0 ); - elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); - return elem ? elem->data : 0; -} - -/* Insert an element into the hash table pH. The key is pKey,nKey -** and the data is "data". -** -** If no element exists with a matching key, then a new -** element is created. A copy of the key is made if the copyKey -** flag is set. NULL is returned. -** -** If another element already exists with the same key, then the -** new data replaces the old data and the old data is returned. -** The key is not copied in this instance. If a malloc fails, then -** the new data is returned and the hash table is unchanged. -** -** If the "data" parameter to this function is NULL, then the -** element corresponding to "key" is removed from the hash table. -*/ -void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){ - int hraw; /* Raw hash value of the key */ - int h; /* the hash of the key modulo hash table size */ - HashElem *elem; /* Used to loop thru the element list */ - HashElem *new_elem; /* New element added to the pH */ - int (*xHash)(const void*,int); /* The hash function */ - - assert( pH!=0 ); - xHash = hashFunction(pH->keyClass); - assert( xHash!=0 ); - hraw = (*xHash)(pKey, nKey); - assert( (pH->htsize & (pH->htsize-1))==0 ); - h = hraw & (pH->htsize-1); - elem = findElementGivenHash(pH,pKey,nKey,h); - if( elem ){ - void *old_data = elem->data; - if( data==0 ){ - removeElementGivenHash(pH,elem,h); - }else{ - elem->data = data; - } - return old_data; - } - if( data==0 ) return 0; - new_elem = (HashElem*)sqliteMalloc( sizeof(HashElem) ); - if( new_elem==0 ) return data; - if( pH->copyKey && pKey!=0 ){ - new_elem->pKey = sqliteMallocRaw( nKey ); - if( new_elem->pKey==0 ){ - sqliteFree(new_elem); - return data; - } - memcpy((void*)new_elem->pKey, pKey, nKey); - }else{ - new_elem->pKey = (void*)pKey; - } - new_elem->nKey = nKey; - pH->count++; - if( pH->htsize==0 ){ - rehash(pH,8); - if( pH->htsize==0 ){ - pH->count = 0; - sqliteFree(new_elem); - return data; - } - } - if( pH->count > pH->htsize ){ - rehash(pH,pH->htsize*2); - } - assert( pH->htsize>0 ); - assert( (pH->htsize & (pH->htsize-1))==0 ); - h = hraw & (pH->htsize-1); - insertElement(pH, &pH->ht[h], new_elem); - new_elem->data = data; - return 0; -} diff --git a/ext/pdo_sqlite/sqlite/src/hash.h b/ext/pdo_sqlite/sqlite/src/hash.h deleted file mode 100644 index cf004ddc5389f..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/hash.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -** 2001 September 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the header file for the generic hash-table implemenation -** used in SQLite. -** -** $Id$ -*/ -#ifndef _SQLITE_HASH_H_ -#define _SQLITE_HASH_H_ - -/* Forward declarations of structures. */ -typedef struct Hash Hash; -typedef struct HashElem HashElem; - -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, many of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -*/ -struct Hash { - char keyClass; /* SQLITE_HASH_INT, _POINTER, _STRING, _BINARY */ - char copyKey; /* True if copy of key made on insert */ - int count; /* Number of entries in this table */ - HashElem *first; /* The first element of the array */ - int htsize; /* Number of buckets in the hash table */ - struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ - HashElem *chain; /* Pointer to first entry with this hash */ - } *ht; -}; - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. -*/ -struct HashElem { - HashElem *next, *prev; /* Next and previous elements in the table */ - void *data; /* Data associated with this element */ - void *pKey; int nKey; /* Key associated with this element */ -}; - -/* -** There are 4 different modes of operation for a hash table: -** -** SQLITE_HASH_INT nKey is used as the key and pKey is ignored. -** -** SQLITE_HASH_POINTER pKey is used as the key and nKey is ignored. -** -** SQLITE_HASH_STRING pKey points to a string that is nKey bytes long -** (including the null-terminator, if any). Case -** is ignored in comparisons. -** -** SQLITE_HASH_BINARY pKey points to binary data nKey bytes long. -** memcmp() is used to compare keys. -** -** A copy of the key is made for SQLITE_HASH_STRING and SQLITE_HASH_BINARY -** if the copyKey parameter to HashInit is 1. -*/ -/* #define SQLITE_HASH_INT 1 // NOT USED */ -/* #define SQLITE_HASH_POINTER 2 // NOT USED */ -#define SQLITE_HASH_STRING 3 -#define SQLITE_HASH_BINARY 4 - -/* -** Access routines. To delete, insert a NULL pointer. -*/ -void sqlite3HashInit(Hash*, int keytype, int copyKey); -void *sqlite3HashInsert(Hash*, const void *pKey, int nKey, void *pData); -void *sqlite3HashFind(const Hash*, const void *pKey, int nKey); -void sqlite3HashClear(Hash*); - -/* -** Macros for looping over all elements of a hash table. The idiom is -** like this: -** -** Hash h; -** HashElem *p; -** ... -** for(p=sqliteHashFirst(&h); p; p=sqliteHashNext(p)){ -** SomeStructure *pData = sqliteHashData(p); -** // do something with pData -** } -*/ -#define sqliteHashFirst(H) ((H)->first) -#define sqliteHashNext(E) ((E)->next) -#define sqliteHashData(E) ((E)->data) -#define sqliteHashKey(E) ((E)->pKey) -#define sqliteHashKeysize(E) ((E)->nKey) - -/* -** Number of entries in a hash table -*/ -#define sqliteHashCount(H) ((H)->count) - -#endif /* _SQLITE_HASH_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/insert.c b/ext/pdo_sqlite/sqlite/src/insert.c deleted file mode 100644 index 37f9f4ee57ea0..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/insert.c +++ /dev/null @@ -1,1107 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** to handle INSERT statements in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** Set P3 of the most recently inserted opcode to a column affinity -** string for index pIdx. A column affinity string has one character -** for each column in the table, according to the affinity of the column: -** -** Character Column affinity -** ------------------------------ -** 'n' NUMERIC -** 'i' INTEGER -** 't' TEXT -** 'o' NONE -*/ -void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){ - if( !pIdx->zColAff ){ - /* The first time a column affinity string for a particular index is - ** required, it is allocated and populated here. It is then stored as - ** a member of the Index structure for subsequent use. - ** - ** The column affinity string will eventually be deleted by - ** sqliteDeleteIndex() when the Index structure itself is cleaned - ** up. - */ - int n; - Table *pTab = pIdx->pTable; - pIdx->zColAff = (char *)sqliteMalloc(pIdx->nColumn+1); - if( !pIdx->zColAff ){ - return; - } - for(n=0; n<pIdx->nColumn; n++){ - pIdx->zColAff[n] = pTab->aCol[pIdx->aiColumn[n]].affinity; - } - pIdx->zColAff[pIdx->nColumn] = '\0'; - } - - sqlite3VdbeChangeP3(v, -1, pIdx->zColAff, 0); -} - -/* -** Set P3 of the most recently inserted opcode to a column affinity -** string for table pTab. A column affinity string has one character -** for each column indexed by the index, according to the affinity of the -** column: -** -** Character Column affinity -** ------------------------------ -** 'n' NUMERIC -** 'i' INTEGER -** 't' TEXT -** 'o' NONE -*/ -void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){ - /* The first time a column affinity string for a particular table - ** is required, it is allocated and populated here. It is then - ** stored as a member of the Table structure for subsequent use. - ** - ** The column affinity string will eventually be deleted by - ** sqlite3DeleteTable() when the Table structure itself is cleaned up. - */ - if( !pTab->zColAff ){ - char *zColAff; - int i; - - zColAff = (char *)sqliteMalloc(pTab->nCol+1); - if( !zColAff ){ - return; - } - - for(i=0; i<pTab->nCol; i++){ - zColAff[i] = pTab->aCol[i].affinity; - } - zColAff[pTab->nCol] = '\0'; - - pTab->zColAff = zColAff; - } - - sqlite3VdbeChangeP3(v, -1, pTab->zColAff, 0); -} - -/* -** Return non-zero if SELECT statement p opens the table with rootpage -** iTab in database iDb. This is used to see if a statement of the form -** "INSERT INTO <iDb, iTab> SELECT ..." can run without using temporary -** table for the results of the SELECT. -** -** No checking is done for sub-selects that are part of expressions. -*/ -static int selectReadsTable(Select *p, int iDb, int iTab){ - int i; - struct SrcList_item *pItem; - if( p->pSrc==0 ) return 0; - for(i=0, pItem=p->pSrc->a; i<p->pSrc->nSrc; i++, pItem++){ - if( pItem->pSelect ){ - if( selectReadsTable(pItem->pSelect, iDb, iTab) ) return 1; - }else{ - if( pItem->pTab->iDb==iDb && pItem->pTab->tnum==iTab ) return 1; - } - } - return 0; -} - -/* -** This routine is call to handle SQL of the following forms: -** -** insert into TABLE (IDLIST) values(EXPRLIST) -** insert into TABLE (IDLIST) select -** -** The IDLIST following the table name is always optional. If omitted, -** then a list of all columns for the table is substituted. The IDLIST -** appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted. -** -** The pList parameter holds EXPRLIST in the first form of the INSERT -** statement above, and pSelect is NULL. For the second form, pList is -** NULL and pSelect is a pointer to the select statement used to generate -** data for the insert. -** -** The code generated follows one of three templates. For a simple -** select with data coming from a VALUES clause, the code executes -** once straight down through. The template looks like this: -** -** open write cursor to <table> and its indices -** puts VALUES clause expressions onto the stack -** write the resulting record into <table> -** cleanup -** -** If the statement is of the form -** -** INSERT INTO <table> SELECT ... -** -** And the SELECT clause does not read from <table> at any time, then -** the generated code follows this template: -** -** goto B -** A: setup for the SELECT -** loop over the tables in the SELECT -** gosub C -** end loop -** cleanup after the SELECT -** goto D -** B: open write cursor to <table> and its indices -** goto A -** C: insert the select result into <table> -** return -** D: cleanup -** -** The third template is used if the insert statement takes its -** values from a SELECT but the data is being inserted into a table -** that is also read as part of the SELECT. In the third form, -** we have to use a intermediate table to store the results of -** the select. The template is like this: -** -** goto B -** A: setup for the SELECT -** loop over the tables in the SELECT -** gosub C -** end loop -** cleanup after the SELECT -** goto D -** C: insert the select result into the intermediate table -** return -** B: open a cursor to an intermediate table -** goto A -** D: open write cursor to <table> and its indices -** loop over the intermediate table -** transfer values form intermediate table into <table> -** end the loop -** cleanup -*/ -void sqlite3Insert( - Parse *pParse, /* Parser context */ - SrcList *pTabList, /* Name of table into which we are inserting */ - ExprList *pList, /* List of values to be inserted */ - Select *pSelect, /* A SELECT statement to use as the data source */ - IdList *pColumn, /* Column names corresponding to IDLIST. */ - int onError /* How to handle constraint errors */ -){ - Table *pTab; /* The table to insert into */ - char *zTab; /* Name of the table into which we are inserting */ - const char *zDb; /* Name of the database holding this table */ - int i, j, idx; /* Loop counters */ - Vdbe *v; /* Generate code into this virtual machine */ - Index *pIdx; /* For looping over indices of the table */ - int nColumn; /* Number of columns in the data */ - int base = 0; /* VDBE Cursor number for pTab */ - int iCont=0,iBreak=0; /* Beginning and end of the loop over srcTab */ - sqlite3 *db; /* The main database structure */ - int keyColumn = -1; /* Column that is the INTEGER PRIMARY KEY */ - int endOfLoop; /* Label for the end of the insertion loop */ - int useTempTable = 0; /* Store SELECT results in intermediate table */ - int srcTab = 0; /* Data comes from this temporary cursor if >=0 */ - int iSelectLoop = 0; /* Address of code that implements the SELECT */ - int iCleanup = 0; /* Address of the cleanup code */ - int iInsertBlock = 0; /* Address of the subroutine used to insert data */ - int iCntMem = 0; /* Memory cell used for the row counter */ - int newIdx = -1; /* Cursor for the NEW table */ - Db *pDb; /* The database containing table being inserted into */ - int counterMem = 0; /* Memory cell holding AUTOINCREMENT counter */ - -#ifndef SQLITE_OMIT_TRIGGER - int isView; /* True if attempting to insert into a view */ - int triggers_exist = 0; /* True if there are FOR EACH ROW triggers */ -#endif - -#ifndef SQLITE_OMIT_AUTOINCREMENT - int counterRowid; /* Memory cell holding rowid of autoinc counter */ -#endif - - if( pParse->nErr || sqlite3_malloc_failed ) goto insert_cleanup; - db = pParse->db; - - /* Locate the table into which we will be inserting new information. - */ - assert( pTabList->nSrc==1 ); - zTab = pTabList->a[0].zName; - if( zTab==0 ) goto insert_cleanup; - pTab = sqlite3SrcListLookup(pParse, pTabList); - if( pTab==0 ){ - goto insert_cleanup; - } - assert( pTab->iDb<db->nDb ); - pDb = &db->aDb[pTab->iDb]; - zDb = pDb->zName; - if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){ - goto insert_cleanup; - } - - /* Figure out if we have any triggers and if the table being - ** inserted into is a view - */ -#ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0); - isView = pTab->pSelect!=0; -#else -# define triggers_exist 0 -# define isView 0 -#endif -#ifdef SQLITE_OMIT_VIEW -# undef isView -# define isView 0 -#endif - - /* Ensure that: - * (a) the table is not read-only, - * (b) that if it is a view then ON INSERT triggers exist - */ - if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){ - goto insert_cleanup; - } - if( pTab==0 ) goto insert_cleanup; - - /* If pTab is really a view, make sure it has been initialized. - */ - if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){ - goto insert_cleanup; - } - - /* Ensure all required collation sequences are available. */ - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - if( sqlite3CheckIndexCollSeq(pParse, pIdx) ){ - goto insert_cleanup; - } - } - - /* Allocate a VDBE - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ) goto insert_cleanup; - if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); - sqlite3BeginWriteOperation(pParse, pSelect || triggers_exist, pTab->iDb); - - /* if there are row triggers, allocate a temp table for new.* references. */ - if( triggers_exist ){ - newIdx = pParse->nTab++; - } - -#ifndef SQLITE_OMIT_AUTOINCREMENT - /* If this is an AUTOINCREMENT table, look up the sequence number in the - ** sqlite_sequence table and store it in memory cell counterMem. Also - ** remember the rowid of the sqlite_sequence table entry in memory cell - ** counterRowid. - */ - if( pTab->autoInc ){ - int iCur = pParse->nTab; - int base = sqlite3VdbeCurrentAddr(v); - counterRowid = pParse->nMem++; - counterMem = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenRead, iCur, pDb->pSeqTab->tnum); - sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, 2); - sqlite3VdbeAddOp(v, OP_Rewind, iCur, base+13); - sqlite3VdbeAddOp(v, OP_Column, iCur, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0); - sqlite3VdbeAddOp(v, OP_Ne, 28417, base+12); - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_MemStore, counterRowid, 1); - sqlite3VdbeAddOp(v, OP_Column, iCur, 1); - sqlite3VdbeAddOp(v, OP_MemStore, counterMem, 1); - sqlite3VdbeAddOp(v, OP_Goto, 0, base+13); - sqlite3VdbeAddOp(v, OP_Next, iCur, base+4); - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } -#endif /* SQLITE_OMIT_AUTOINCREMENT */ - - /* Figure out how many columns of data are supplied. If the data - ** is coming from a SELECT statement, then this step also generates - ** all the code to implement the SELECT statement and invoke a subroutine - ** to process each row of the result. (Template 2.) If the SELECT - ** statement uses the the table that is being inserted into, then the - ** subroutine is also coded here. That subroutine stores the SELECT - ** results in a temporary table. (Template 3.) - */ - if( pSelect ){ - /* Data is coming from a SELECT. Generate code to implement that SELECT - */ - int rc, iInitCode; - iInitCode = sqlite3VdbeAddOp(v, OP_Goto, 0, 0); - iSelectLoop = sqlite3VdbeCurrentAddr(v); - iInsertBlock = sqlite3VdbeMakeLabel(v); - - /* Resolve the expressions in the SELECT statement and execute it. */ - rc = sqlite3Select(pParse, pSelect, SRT_Subroutine, iInsertBlock,0,0,0,0); - if( rc || pParse->nErr || sqlite3_malloc_failed ) goto insert_cleanup; - - iCleanup = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_Goto, 0, iCleanup); - assert( pSelect->pEList ); - nColumn = pSelect->pEList->nExpr; - - /* Set useTempTable to TRUE if the result of the SELECT statement - ** should be written into a temporary table. Set to FALSE if each - ** row of the SELECT can be written directly into the result table. - ** - ** A temp table must be used if the table being updated is also one - ** of the tables being read by the SELECT statement. Also use a - ** temp table in the case of row triggers. - */ - if( triggers_exist || selectReadsTable(pSelect, pTab->iDb, pTab->tnum) ){ - useTempTable = 1; - } - - if( useTempTable ){ - /* Generate the subroutine that SELECT calls to process each row of - ** the result. Store the result in a temporary table - */ - srcTab = pParse->nTab++; - sqlite3VdbeResolveLabel(v, iInsertBlock); - sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0); - sqlite3TableAffinityStr(v, pTab); - sqlite3VdbeAddOp(v, OP_NewRowid, srcTab, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - sqlite3VdbeAddOp(v, OP_Insert, srcTab, 0); - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - - /* The following code runs first because the GOTO at the very top - ** of the program jumps to it. Create the temporary table, then jump - ** back up and execute the SELECT code above. - */ - sqlite3VdbeJumpHere(v, iInitCode); - sqlite3VdbeAddOp(v, OP_OpenVirtual, srcTab, 0); - sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, nColumn); - sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop); - sqlite3VdbeResolveLabel(v, iCleanup); - }else{ - sqlite3VdbeJumpHere(v, iInitCode); - } - }else{ - /* This is the case if the data for the INSERT is coming from a VALUES - ** clause - */ - NameContext sNC; - memset(&sNC, 0, sizeof(sNC)); - sNC.pParse = pParse; - assert( pList!=0 ); - srcTab = -1; - useTempTable = 0; - assert( pList ); - nColumn = pList->nExpr; - for(i=0; i<nColumn; i++){ - if( sqlite3ExprResolveNames(&sNC, pList->a[i].pExpr) ){ - goto insert_cleanup; - } - } - } - - /* Make sure the number of columns in the source data matches the number - ** of columns to be inserted into the table. - */ - if( pColumn==0 && nColumn!=pTab->nCol ){ - sqlite3ErrorMsg(pParse, - "table %S has %d columns but %d values were supplied", - pTabList, 0, pTab->nCol, nColumn); - goto insert_cleanup; - } - if( pColumn!=0 && nColumn!=pColumn->nId ){ - sqlite3ErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId); - goto insert_cleanup; - } - - /* If the INSERT statement included an IDLIST term, then make sure - ** all elements of the IDLIST really are columns of the table and - ** remember the column indices. - ** - ** If the table has an INTEGER PRIMARY KEY column and that column - ** is named in the IDLIST, then record in the keyColumn variable - ** the index into IDLIST of the primary key column. keyColumn is - ** the index of the primary key as it appears in IDLIST, not as - ** is appears in the original table. (The index of the primary - ** key in the original table is pTab->iPKey.) - */ - if( pColumn ){ - for(i=0; i<pColumn->nId; i++){ - pColumn->a[i].idx = -1; - } - for(i=0; i<pColumn->nId; i++){ - for(j=0; j<pTab->nCol; j++){ - if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zName)==0 ){ - pColumn->a[i].idx = j; - if( j==pTab->iPKey ){ - keyColumn = i; - } - break; - } - } - if( j>=pTab->nCol ){ - if( sqlite3IsRowid(pColumn->a[i].zName) ){ - keyColumn = i; - }else{ - sqlite3ErrorMsg(pParse, "table %S has no column named %s", - pTabList, 0, pColumn->a[i].zName); - pParse->nErr++; - goto insert_cleanup; - } - } - } - } - - /* If there is no IDLIST term but the table has an integer primary - ** key, the set the keyColumn variable to the primary key column index - ** in the original table definition. - */ - if( pColumn==0 ){ - keyColumn = pTab->iPKey; - } - - /* Open the temp table for FOR EACH ROW triggers - */ - if( triggers_exist ){ - sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0); - sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol); - } - - /* Initialize the count of rows to be inserted - */ - if( db->flags & SQLITE_CountRows ){ - iCntMem = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemInt, 0, iCntMem); - } - - /* Open tables and indices if there are no row triggers */ - if( !triggers_exist ){ - base = pParse->nTab; - sqlite3OpenTableAndIndices(pParse, pTab, base, OP_OpenWrite); - } - - /* If the data source is a temporary table, then we have to create - ** a loop because there might be multiple rows of data. If the data - ** source is a subroutine call from the SELECT statement, then we need - ** to launch the SELECT statement processing. - */ - if( useTempTable ){ - iBreak = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_Rewind, srcTab, iBreak); - iCont = sqlite3VdbeCurrentAddr(v); - }else if( pSelect ){ - sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop); - sqlite3VdbeResolveLabel(v, iInsertBlock); - } - - /* Run the BEFORE and INSTEAD OF triggers, if there are any - */ - endOfLoop = sqlite3VdbeMakeLabel(v); - if( triggers_exist & TRIGGER_BEFORE ){ - - /* build the NEW.* reference row. Note that if there is an INTEGER - ** PRIMARY KEY into which a NULL is being inserted, that NULL will be - ** translated into a unique ID for the row. But on a BEFORE trigger, - ** we do not know what the unique ID will be (because the insert has - ** not happened yet) so we substitute a rowid of -1 - */ - if( keyColumn<0 ){ - sqlite3VdbeAddOp(v, OP_Integer, -1, 0); - }else if( useTempTable ){ - sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn); - }else{ - assert( pSelect==0 ); /* Otherwise useTempTable is true */ - sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr); - sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqlite3VdbeAddOp(v, OP_Integer, -1, 0); - sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); - } - - /* Create the new column data - */ - for(i=0; i<pTab->nCol; i++){ - if( pColumn==0 ){ - j = i; - }else{ - for(j=0; j<pColumn->nId; j++){ - if( pColumn->a[j].idx==i ) break; - } - } - if( pColumn && j>=pColumn->nId ){ - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt); - }else if( useTempTable ){ - sqlite3VdbeAddOp(v, OP_Column, srcTab, j); - }else{ - assert( pSelect==0 ); /* Otherwise useTempTable is true */ - sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr); - } - } - sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); - - /* If this is an INSERT on a view with an INSTEAD OF INSERT trigger, - ** do not attempt any conversions before assembling the record. - ** If this is a real table, attempt conversions as required by the - ** table column affinities. - */ - if( !isView ){ - sqlite3TableAffinityStr(v, pTab); - } - sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0); - - /* Fire BEFORE or INSTEAD OF triggers */ - if( sqlite3CodeRowTrigger(pParse, TK_INSERT, 0, TRIGGER_BEFORE, pTab, - newIdx, -1, onError, endOfLoop) ){ - goto insert_cleanup; - } - } - - /* If any triggers exists, the opening of tables and indices is deferred - ** until now. - */ - if( triggers_exist && !isView ){ - base = pParse->nTab; - sqlite3OpenTableAndIndices(pParse, pTab, base, OP_OpenWrite); - } - - /* Push the record number for the new entry onto the stack. The - ** record number is a randomly generate integer created by NewRowid - ** except when the table has an INTEGER PRIMARY KEY column, in which - ** case the record number is the same as that column. - */ - if( !isView ){ - if( keyColumn>=0 ){ - if( useTempTable ){ - sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn); - }else if( pSelect ){ - sqlite3VdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); - }else{ - sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr); - } - /* If the PRIMARY KEY expression is NULL, then use OP_NewRowid - ** to generate a unique primary key value. - */ - sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem); - sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); - }else{ - sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem); - } -#ifndef SQLITE_OMIT_AUTOINCREMENT - if( pTab->autoInc ){ - sqlite3VdbeAddOp(v, OP_MemMax, counterMem, 0); - } -#endif /* SQLITE_OMIT_AUTOINCREMENT */ - - /* Push onto the stack, data for all columns of the new entry, beginning - ** with the first column. - */ - for(i=0; i<pTab->nCol; i++){ - if( i==pTab->iPKey ){ - /* The value of the INTEGER PRIMARY KEY column is always a NULL. - ** Whenever this column is read, the record number will be substituted - ** in its place. So will fill this column with a NULL to avoid - ** taking up data space with information that will never be used. */ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - continue; - } - if( pColumn==0 ){ - j = i; - }else{ - for(j=0; j<pColumn->nId; j++){ - if( pColumn->a[j].idx==i ) break; - } - } - if( pColumn && j>=pColumn->nId ){ - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt); - }else if( useTempTable ){ - sqlite3VdbeAddOp(v, OP_Column, srcTab, j); - }else if( pSelect ){ - sqlite3VdbeAddOp(v, OP_Dup, i+nColumn-j, 1); - }else{ - sqlite3ExprCode(pParse, pList->a[j].pExpr); - } - } - - /* Generate code to check constraints and generate index keys and - ** do the insertion. - */ - sqlite3GenerateConstraintChecks(pParse, pTab, base, 0, keyColumn>=0, - 0, onError, endOfLoop); - sqlite3CompleteInsertion(pParse, pTab, base, 0,0,0, - (triggers_exist & TRIGGER_AFTER)!=0 ? newIdx : -1); - } - - /* Update the count of rows that are inserted - */ - if( (db->flags & SQLITE_CountRows)!=0 ){ - sqlite3VdbeAddOp(v, OP_MemIncr, iCntMem, 0); - } - - if( triggers_exist ){ - /* Close all tables opened */ - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Close, base, 0); - for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ - sqlite3VdbeAddOp(v, OP_Close, idx+base, 0); - } - } - - /* Code AFTER triggers */ - if( sqlite3CodeRowTrigger(pParse, TK_INSERT, 0, TRIGGER_AFTER, pTab, - newIdx, -1, onError, endOfLoop) ){ - goto insert_cleanup; - } - } - - /* The bottom of the loop, if the data source is a SELECT statement - */ - sqlite3VdbeResolveLabel(v, endOfLoop); - if( useTempTable ){ - sqlite3VdbeAddOp(v, OP_Next, srcTab, iCont); - sqlite3VdbeResolveLabel(v, iBreak); - sqlite3VdbeAddOp(v, OP_Close, srcTab, 0); - }else if( pSelect ){ - sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0); - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - sqlite3VdbeResolveLabel(v, iCleanup); - } - - if( !triggers_exist ){ - /* Close all tables opened */ - sqlite3VdbeAddOp(v, OP_Close, base, 0); - for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ - sqlite3VdbeAddOp(v, OP_Close, idx+base, 0); - } - } - -#ifndef SQLITE_OMIT_AUTOINCREMENT - /* Update the sqlite_sequence table by storing the content of the - ** counter value in memory counterMem back into the sqlite_sequence - ** table. - */ - if( pTab->autoInc ){ - int iCur = pParse->nTab; - int base = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, iCur, pDb->pSeqTab->tnum); - sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, 2); - sqlite3VdbeAddOp(v, OP_MemLoad, counterRowid, 0); - sqlite3VdbeAddOp(v, OP_NotNull, -1, base+7); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqlite3VdbeAddOp(v, OP_NewRowid, iCur, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0); - sqlite3VdbeAddOp(v, OP_MemLoad, counterMem, 0); - sqlite3VdbeAddOp(v, OP_MakeRecord, 2, 0); - sqlite3VdbeAddOp(v, OP_Insert, iCur, 0); - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } -#endif - - /* - ** Return the number of rows inserted. If this routine is - ** generating code because of a call to sqlite3NestedParse(), do not - ** invoke the callback function. - */ - if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){ - sqlite3VdbeAddOp(v, OP_MemLoad, iCntMem, 0); - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "rows inserted", P3_STATIC); - } - -insert_cleanup: - sqlite3SrcListDelete(pTabList); - sqlite3ExprListDelete(pList); - sqlite3SelectDelete(pSelect); - sqlite3IdListDelete(pColumn); -} - -/* -** Generate code to do a constraint check prior to an INSERT or an UPDATE. -** -** When this routine is called, the stack contains (from bottom to top) -** the following values: -** -** 1. The rowid of the row to be updated before the update. This -** value is omitted unless we are doing an UPDATE that involves a -** change to the record number. -** -** 2. The rowid of the row after the update. -** -** 3. The data in the first column of the entry after the update. -** -** i. Data from middle columns... -** -** N. The data in the last column of the entry after the update. -** -** The old rowid shown as entry (1) above is omitted unless both isUpdate -** and rowidChng are 1. isUpdate is true for UPDATEs and false for -** INSERTs and rowidChng is true if the record number is being changed. -** -** The code generated by this routine pushes additional entries onto -** the stack which are the keys for new index entries for the new record. -** The order of index keys is the same as the order of the indices on -** the pTable->pIndex list. A key is only created for index i if -** aIdxUsed!=0 and aIdxUsed[i]!=0. -** -** This routine also generates code to check constraints. NOT NULL, -** CHECK, and UNIQUE constraints are all checked. If a constraint fails, -** then the appropriate action is performed. There are five possible -** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE. -** -** Constraint type Action What Happens -** --------------- ---------- ---------------------------------------- -** any ROLLBACK The current transaction is rolled back and -** sqlite3_exec() returns immediately with a -** return code of SQLITE_CONSTRAINT. -** -** any ABORT Back out changes from the current command -** only (do not do a complete rollback) then -** cause sqlite3_exec() to return immediately -** with SQLITE_CONSTRAINT. -** -** any FAIL Sqlite_exec() returns immediately with a -** return code of SQLITE_CONSTRAINT. The -** transaction is not rolled back and any -** prior changes are retained. -** -** any IGNORE The record number and data is popped from -** the stack and there is an immediate jump -** to label ignoreDest. -** -** NOT NULL REPLACE The NULL value is replace by the default -** value for that column. If the default value -** is NULL, the action is the same as ABORT. -** -** UNIQUE REPLACE The other row that conflicts with the row -** being inserted is removed. -** -** CHECK REPLACE Illegal. The results in an exception. -** -** Which action to take is determined by the overrideError parameter. -** Or if overrideError==OE_Default, then the pParse->onError parameter -** is used. Or if pParse->onError==OE_Default then the onError value -** for the constraint is used. -** -** The calling routine must open a read/write cursor for pTab with -** cursor number "base". All indices of pTab must also have open -** read/write cursors with cursor number base+i for the i-th cursor. -** Except, if there is no possibility of a REPLACE action then -** cursors do not need to be open for indices where aIdxUsed[i]==0. -** -** If the isUpdate flag is true, it means that the "base" cursor is -** initially pointing to an entry that is being updated. The isUpdate -** flag causes extra code to be generated so that the "base" cursor -** is still pointing at the same entry after the routine returns. -** Without the isUpdate flag, the "base" cursor might be moved. -*/ -void sqlite3GenerateConstraintChecks( - Parse *pParse, /* The parser context */ - Table *pTab, /* the table into which we are inserting */ - int base, /* Index of a read/write cursor pointing at pTab */ - char *aIdxUsed, /* Which indices are used. NULL means all are used */ - int rowidChng, /* True if the record number will change */ - int isUpdate, /* True for UPDATE, False for INSERT */ - int overrideError, /* Override onError to this if not OE_Default */ - int ignoreDest /* Jump to this label on an OE_Ignore resolution */ -){ - int i; - Vdbe *v; - int nCol; - int onError; - int addr; - int extra; - int iCur; - Index *pIdx; - int seenReplace = 0; - int jumpInst1=0, jumpInst2; - int hasTwoRowids = (isUpdate && rowidChng); - - v = sqlite3GetVdbe(pParse); - assert( v!=0 ); - assert( pTab->pSelect==0 ); /* This table is not a VIEW */ - nCol = pTab->nCol; - - /* Test all NOT NULL constraints. - */ - for(i=0; i<nCol; i++){ - if( i==pTab->iPKey ){ - continue; - } - onError = pTab->aCol[i].notNull; - if( onError==OE_None ) continue; - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - if( onError==OE_Replace && pTab->aCol[i].pDflt==0 ){ - onError = OE_Abort; - } - sqlite3VdbeAddOp(v, OP_Dup, nCol-1-i, 1); - addr = sqlite3VdbeAddOp(v, OP_NotNull, 1, 0); - assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail - || onError==OE_Ignore || onError==OE_Replace ); - switch( onError ){ - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - char *zMsg = 0; - sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); - sqlite3SetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName, - " may not be NULL", (char*)0); - sqlite3VdbeChangeP3(v, -1, zMsg, P3_DYNAMIC); - break; - } - case OE_Ignore: { - sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - case OE_Replace: { - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt); - sqlite3VdbeAddOp(v, OP_Push, nCol-i, 0); - break; - } - } - sqlite3VdbeJumpHere(v, addr); - } - - /* Test all CHECK constraints - */ - /**** TBD ****/ - - /* If we have an INTEGER PRIMARY KEY, make sure the primary key - ** of the new record does not previously exist. Except, if this - ** is an UPDATE and the primary key is not changing, that is OK. - */ - if( rowidChng ){ - onError = pTab->keyConf; - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - - if( isUpdate ){ - sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1); - sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1); - jumpInst1 = sqlite3VdbeAddOp(v, OP_Eq, 0, 0); - } - sqlite3VdbeAddOp(v, OP_Dup, nCol, 1); - jumpInst2 = sqlite3VdbeAddOp(v, OP_NotExists, base, 0); - switch( onError ){ - default: { - onError = OE_Abort; - /* Fall thru into the next case */ - } - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, - "PRIMARY KEY must be unique", P3_STATIC); - break; - } - case OE_Replace: { - sqlite3GenerateRowIndexDelete(pParse->db, v, pTab, base, 0); - if( isUpdate ){ - sqlite3VdbeAddOp(v, OP_Dup, nCol+hasTwoRowids, 1); - sqlite3VdbeAddOp(v, OP_MoveGe, base, 0); - } - seenReplace = 1; - break; - } - case OE_Ignore: { - assert( seenReplace==0 ); - sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - } - sqlite3VdbeJumpHere(v, jumpInst2); - if( isUpdate ){ - sqlite3VdbeJumpHere(v, jumpInst1); - sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1); - sqlite3VdbeAddOp(v, OP_MoveGe, base, 0); - } - } - - /* Test all UNIQUE constraints by creating entries for each UNIQUE - ** index and making sure that duplicate entries do not already exist. - ** Add the new records to the indices as we go. - */ - extra = -1; - for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){ - if( aIdxUsed && aIdxUsed[iCur]==0 ) continue; /* Skip unused indices */ - extra++; - - /* Create a key for accessing the index entry */ - sqlite3VdbeAddOp(v, OP_Dup, nCol+extra, 1); - for(i=0; i<pIdx->nColumn; i++){ - int idx = pIdx->aiColumn[i]; - if( idx==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_Dup, i+extra+nCol+1, 1); - }else{ - sqlite3VdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1); - } - } - jumpInst1 = sqlite3VdbeAddOp(v, OP_MakeIdxRec, pIdx->nColumn, 0); - sqlite3IndexAffinityStr(v, pIdx); - - /* Find out what action to take in case there is an indexing conflict */ - onError = pIdx->onError; - if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */ - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - if( seenReplace ){ - if( onError==OE_Ignore ) onError = OE_Replace; - else if( onError==OE_Fail ) onError = OE_Abort; - } - - - /* Check to see if the new index entry will be unique */ - sqlite3VdbeAddOp(v, OP_Dup, extra+nCol+1+hasTwoRowids, 1); - jumpInst2 = sqlite3VdbeAddOp(v, OP_IsUnique, base+iCur+1, 0); - - /* Generate code that executes if the new index entry is not unique */ - assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail - || onError==OE_Ignore || onError==OE_Replace ); - switch( onError ){ - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - int j, n1, n2; - char zErrMsg[200]; - strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column "); - n1 = strlen(zErrMsg); - for(j=0; j<pIdx->nColumn && n1<sizeof(zErrMsg)-30; j++){ - char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; - n2 = strlen(zCol); - if( j>0 ){ - strcpy(&zErrMsg[n1], ", "); - n1 += 2; - } - if( n1+n2>sizeof(zErrMsg)-30 ){ - strcpy(&zErrMsg[n1], "..."); - n1 += 3; - break; - }else{ - strcpy(&zErrMsg[n1], zCol); - n1 += n2; - } - } - strcpy(&zErrMsg[n1], - pIdx->nColumn>1 ? " are not unique" : " is not unique"); - sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0); - break; - } - case OE_Ignore: { - assert( seenReplace==0 ); - sqlite3VdbeAddOp(v, OP_Pop, nCol+extra+3+hasTwoRowids, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - case OE_Replace: { - sqlite3GenerateRowDelete(pParse->db, v, pTab, base, 0); - if( isUpdate ){ - sqlite3VdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRowids, 1); - sqlite3VdbeAddOp(v, OP_MoveGe, base, 0); - } - seenReplace = 1; - break; - } - } -#if NULL_DISTINCT_FOR_UNIQUE - sqlite3VdbeJumpHere(v, jumpInst1); -#endif - sqlite3VdbeJumpHere(v, jumpInst2); - } -} - -/* -** This routine generates code to finish the INSERT or UPDATE operation -** that was started by a prior call to sqlite3GenerateConstraintChecks. -** The stack must contain keys for all active indices followed by data -** and the rowid for the new entry. This routine creates the new -** entries in all indices and in the main table. -** -** The arguments to this routine should be the same as the first six -** arguments to sqlite3GenerateConstraintChecks. -*/ -void sqlite3CompleteInsertion( - Parse *pParse, /* The parser context */ - Table *pTab, /* the table into which we are inserting */ - int base, /* Index of a read/write cursor pointing at pTab */ - char *aIdxUsed, /* Which indices are used. NULL means all are used */ - int rowidChng, /* True if the record number will change */ - int isUpdate, /* True for UPDATE, False for INSERT */ - int newIdx /* Index of NEW table for triggers. -1 if none */ -){ - int i; - Vdbe *v; - int nIdx; - Index *pIdx; - int pik_flags; - - v = sqlite3GetVdbe(pParse); - assert( v!=0 ); - assert( pTab->pSelect==0 ); /* This table is not a VIEW */ - for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){} - for(i=nIdx-1; i>=0; i--){ - if( aIdxUsed && aIdxUsed[i]==0 ) continue; - sqlite3VdbeAddOp(v, OP_IdxInsert, base+i+1, 0); - } - sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); - sqlite3TableAffinityStr(v, pTab); -#ifndef SQLITE_OMIT_TRIGGER - if( newIdx>=0 ){ - sqlite3VdbeAddOp(v, OP_Dup, 1, 0); - sqlite3VdbeAddOp(v, OP_Dup, 1, 0); - sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0); - } -#endif - if( pParse->nested ){ - pik_flags = 0; - }else{ - pik_flags = (OPFLAG_NCHANGE|(isUpdate?0:OPFLAG_LASTROWID)); - } - sqlite3VdbeAddOp(v, OP_Insert, base, pik_flags); - - if( isUpdate && rowidChng ){ - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - } -} - -/* -** Generate code that will open cursors for a table and for all -** indices of that table. The "base" parameter is the cursor number used -** for the table. Indices are opened on subsequent cursors. -*/ -void sqlite3OpenTableAndIndices( - Parse *pParse, /* Parsing context */ - Table *pTab, /* Table to be opened */ - int base, /* Cursor number assigned to the table */ - int op /* OP_OpenRead or OP_OpenWrite */ -){ - int i; - Index *pIdx; - Vdbe *v = sqlite3GetVdbe(pParse); - assert( v!=0 ); - sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0); - VdbeComment((v, "# %s", pTab->zName)); - sqlite3VdbeAddOp(v, op, base, pTab->tnum); - sqlite3VdbeAddOp(v, OP_SetNumColumns, base, pTab->nCol); - for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ - sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - VdbeComment((v, "# %s", pIdx->zName)); - sqlite3VdbeOp3(v, op, i+base, pIdx->tnum, - (char*)&pIdx->keyInfo, P3_KEYINFO); - } - if( pParse->nTab<=base+i ){ - pParse->nTab = base+i; - } -} diff --git a/ext/pdo_sqlite/sqlite/src/keywordhash.h b/ext/pdo_sqlite/sqlite/src/keywordhash.h deleted file mode 100644 index f825ba977c472..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/keywordhash.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Hash score: 156 */ -static int keywordCode(const char *z, int n){ - static const char zText[526] = - "ABORTABLEFTEMPORARYADDATABASELECTHENDEFAULTRANSACTIONATURALTER" - "AISEACHECKEYAFTEREFERENCESCAPELSEXCEPTRIGGEREGEXPLAINITIALLYANALYZE" - "XCLUSIVEXISTSTATEMENTANDEFERRABLEATTACHAVINGLOBEFOREIGNOREINDEX" - "AUTOINCREMENTBEGINNERENAMEBETWEENOTNULLIKEBYCASCADEFERREDELETE" - "CASECASTCOLLATECOLUMNCOMMITCONFLICTCONSTRAINTERSECTCREATECROSS" - "CURRENT_DATECURRENT_TIMESTAMPRAGMATCHDESCDETACHDISTINCTDROPRIMARY" - "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL" - "JOINORDEREPLACEOUTERESTRICTRIGHTROLLBACKROWHENUNIONUNIQUEUSING" - "VACUUMVALUESVIEWHERE"; - static const unsigned char aHash[127] = { - 91, 81, 104, 90, 0, 4, 0, 0, 111, 0, 77, 0, 0, - 94, 44, 0, 92, 0, 103, 106, 96, 0, 0, 10, 0, 0, - 110, 0, 107, 102, 0, 28, 48, 0, 41, 0, 0, 65, 71, - 0, 63, 19, 0, 0, 36, 83, 0, 105, 74, 0, 0, 33, - 0, 61, 37, 0, 8, 0, 112, 38, 12, 0, 78, 40, 25, - 66, 0, 0, 31, 82, 53, 30, 50, 20, 88, 0, 34, 0, - 75, 26, 0, 72, 0, 0, 0, 64, 47, 67, 22, 87, 29, - 69, 86, 0, 1, 0, 9, 100, 58, 18, 0, 109, 76, 98, - 54, 6, 85, 0, 0, 49, 93, 0, 101, 0, 70, 0, 0, - 15, 0, 113, 51, 56, 0, 2, 55, 0, 108, - }; - static const unsigned char aNext[113] = { - 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 11, 0, 0, 0, 0, 5, 13, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, - 0, 0, 16, 0, 23, 52, 0, 0, 0, 0, 45, 0, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 73, 42, 0, 0, 24, - 60, 21, 0, 80, 32, 68, 0, 0, 84, 46, 0, 0, 0, - 0, 0, 0, 0, 39, 95, 97, 0, 0, 99, 0, 14, 27, - 79, 0, 57, 89, 0, 35, 0, 62, 0, - }; - static const unsigned char aLen[113] = { - 5, 5, 4, 4, 9, 2, 3, 8, 2, 6, 4, 3, 7, - 11, 2, 7, 5, 5, 4, 5, 3, 5, 10, 6, 4, 6, - 7, 6, 7, 9, 3, 7, 9, 6, 9, 3, 10, 6, 6, - 4, 6, 3, 7, 6, 7, 5, 13, 2, 2, 5, 5, 6, - 7, 3, 7, 4, 4, 2, 7, 3, 8, 6, 4, 4, 7, - 6, 6, 8, 10, 9, 6, 5, 12, 12, 17, 6, 5, 4, - 6, 8, 2, 4, 7, 4, 5, 4, 4, 5, 6, 9, 6, - 7, 4, 2, 6, 3, 6, 4, 5, 7, 5, 8, 5, 8, - 3, 4, 5, 6, 5, 6, 6, 4, 5, - }; - static const unsigned short int aOffset[113] = { - 0, 4, 7, 10, 10, 14, 19, 21, 26, 27, 32, 34, 36, - 42, 51, 52, 57, 61, 65, 67, 71, 74, 78, 86, 91, 94, - 99, 105, 108, 113, 118, 122, 128, 136, 141, 150, 152, 162, 167, - 172, 175, 177, 177, 181, 185, 187, 192, 194, 196, 205, 208, 212, - 218, 224, 224, 227, 230, 234, 236, 237, 241, 248, 254, 258, 262, - 269, 275, 281, 289, 296, 305, 311, 316, 328, 328, 344, 348, 353, - 357, 363, 364, 371, 374, 381, 384, 389, 393, 397, 400, 406, 415, - 421, 428, 431, 431, 434, 437, 443, 447, 451, 458, 462, 470, 475, - 483, 485, 489, 494, 500, 505, 511, 517, 520, - }; - static const unsigned char aCode[113] = { - TK_ABORT, TK_TABLE, TK_JOIN_KW, TK_TEMP, TK_TEMP, - TK_OR, TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, - TK_THEN, TK_END, TK_DEFAULT, TK_TRANSACTION,TK_ON, - TK_JOIN_KW, TK_ALTER, TK_RAISE, TK_EACH, TK_CHECK, - TK_KEY, TK_AFTER, TK_REFERENCES, TK_ESCAPE, TK_ELSE, - TK_EXCEPT, TK_TRIGGER, TK_LIKE_KW, TK_EXPLAIN, TK_INITIALLY, - TK_ALL, TK_ANALYZE, TK_EXCLUSIVE, TK_EXISTS, TK_STATEMENT, - TK_AND, TK_DEFERRABLE, TK_ATTACH, TK_HAVING, TK_LIKE_KW, - TK_BEFORE, TK_FOR, TK_FOREIGN, TK_IGNORE, TK_REINDEX, - TK_INDEX, TK_AUTOINCR, TK_TO, TK_IN, TK_BEGIN, - TK_JOIN_KW, TK_RENAME, TK_BETWEEN, TK_NOT, TK_NOTNULL, - TK_NULL, TK_LIKE_KW, TK_BY, TK_CASCADE, TK_ASC, - TK_DEFERRED, TK_DELETE, TK_CASE, TK_CAST, TK_COLLATE, - TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_CONSTRAINT, TK_INTERSECT, - TK_CREATE, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW, TK_CTIME_KW, - TK_PRAGMA, TK_MATCH, TK_DESC, TK_DETACH, TK_DISTINCT, - TK_IS, TK_DROP, TK_PRIMARY, TK_FAIL, TK_LIMIT, - TK_FROM, TK_JOIN_KW, TK_GROUP, TK_UPDATE, TK_IMMEDIATE, - TK_INSERT, TK_INSTEAD, TK_INTO, TK_OF, TK_OFFSET, - TK_SET, TK_ISNULL, TK_JOIN, TK_ORDER, TK_REPLACE, - TK_JOIN_KW, TK_RESTRICT, TK_JOIN_KW, TK_ROLLBACK, TK_ROW, - TK_WHEN, TK_UNION, TK_UNIQUE, TK_USING, TK_VACUUM, - TK_VALUES, TK_VIEW, TK_WHERE, - }; - int h, i; - if( n<2 ) return TK_ID; - h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^ - (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^ - n) % 127; - for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){ - if( aLen[i]==n && sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){ - return aCode[i]; - } - } - return TK_ID; -} -int sqlite3KeywordCode(const char *z, int n){ - return keywordCode(z, n); -} diff --git a/ext/pdo_sqlite/sqlite/src/legacy.c b/ext/pdo_sqlite/sqlite/src/legacy.c deleted file mode 100644 index f575f1f0cef48..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/legacy.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Main file for the SQLite library. The routines in this file -** implement the programmer interface to the library. Routines in -** other files are for internal use by SQLite and should not be -** accessed by users of the library. -** -** $Id$ -*/ - -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> - -/* -** Execute SQL code. Return one of the SQLITE_ success/failure -** codes. Also write an error message into memory obtained from -** malloc() and make *pzErrMsg point to that message. -** -** If the SQL is a query, then for each row in the query result -** the xCallback() function is called. pArg becomes the first -** argument to xCallback(). If xCallback=NULL then no callback -** is invoked, even for queries. -*/ -int sqlite3_exec( - sqlite3 *db, /* The database on which the SQL executes */ - const char *zSql, /* The SQL to be executed */ - sqlite3_callback xCallback, /* Invoke this callback routine */ - void *pArg, /* First argument to xCallback() */ - char **pzErrMsg /* Write error messages here */ -){ - int rc = SQLITE_OK; - const char *zLeftover; - sqlite3_stmt *pStmt = 0; - char **azCols = 0; - - int nRetry = 0; - int nChange = 0; - int nCallback; - - if( zSql==0 ) return SQLITE_OK; - while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){ - int nCol; - char **azVals = 0; - - pStmt = 0; - rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover); - if( rc!=SQLITE_OK ){ - if( pStmt ) sqlite3_finalize(pStmt); - continue; - } - if( !pStmt ){ - /* this happens for a comment or white-space */ - zSql = zLeftover; - continue; - } - - db->nChange += nChange; - nCallback = 0; - - nCol = sqlite3_column_count(pStmt); - azCols = sqliteMalloc(2*nCol*sizeof(const char *)); - if( nCol && !azCols ){ - rc = SQLITE_NOMEM; - goto exec_out; - } - - while( 1 ){ - int i; - rc = sqlite3_step(pStmt); - - /* Invoke the callback function if required */ - if( xCallback && (SQLITE_ROW==rc || - (SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback)) ){ - if( 0==nCallback ){ - for(i=0; i<nCol; i++){ - azCols[i] = (char *)sqlite3_column_name(pStmt, i); - } - nCallback++; - } - if( rc==SQLITE_ROW ){ - azVals = &azCols[nCol]; - for(i=0; i<nCol; i++){ - azVals[i] = (char *)sqlite3_column_text(pStmt, i); - } - } - if( xCallback(pArg, nCol, azVals, azCols) ){ - rc = SQLITE_ABORT; - goto exec_out; - } - } - - if( rc!=SQLITE_ROW ){ - rc = sqlite3_finalize(pStmt); - pStmt = 0; - if( db->pVdbe==0 ){ - nChange = db->nChange; - } - if( rc!=SQLITE_SCHEMA ){ - nRetry = 0; - zSql = zLeftover; - while( isspace((unsigned char)zSql[0]) ) zSql++; - } - break; - } - } - - sqliteFree(azCols); - azCols = 0; - } - -exec_out: - if( pStmt ) sqlite3_finalize(pStmt); - if( azCols ) sqliteFree(azCols); - - if( sqlite3_malloc_failed ){ - rc = SQLITE_NOMEM; - } - if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){ - *pzErrMsg = malloc(1+strlen(sqlite3_errmsg(db))); - if( *pzErrMsg ){ - strcpy(*pzErrMsg, sqlite3_errmsg(db)); - } - }else if( pzErrMsg ){ - *pzErrMsg = 0; - } - - return rc; -} diff --git a/ext/pdo_sqlite/sqlite/src/main.c b/ext/pdo_sqlite/sqlite/src/main.c deleted file mode 100644 index c42df158e4b82..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/main.c +++ /dev/null @@ -1,1060 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Main file for the SQLite library. The routines in this file -** implement the programmer interface to the library. Routines in -** other files are for internal use by SQLite and should not be -** accessed by users of the library. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> - -/* -** The following constant value is used by the SQLITE_BIGENDIAN and -** SQLITE_LITTLEENDIAN macros. -*/ -const int sqlite3one = 1; - -#ifndef SQLITE_OMIT_GLOBALRECOVER -/* -** Linked list of all open database handles. This is used by the -** sqlite3_global_recover() function. Entries are added to the list -** by openDatabase() and removed by sqlite3_close(). -*/ -static sqlite3 *pDbList = 0; -#endif - -#ifndef SQLITE_OMIT_UTF16 -/* -** Return the transient sqlite3_value object used for encoding conversions -** during SQL compilation. -*/ -sqlite3_value *sqlite3GetTransientValue(sqlite3 *db){ - if( !db->pValue ){ - db->pValue = sqlite3ValueNew(); - } - return db->pValue; -} -#endif - -/* -** The version of the library -*/ -const char rcsid3[] = "@(#) \044Id: SQLite version " SQLITE_VERSION " $"; -const char sqlite3_version[] = SQLITE_VERSION; -const char *sqlite3_libversion(void){ return sqlite3_version; } -int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } - -/* -** This is the default collating function named "BINARY" which is always -** available. -*/ -static int binCollFunc( - void *NotUsed, - int nKey1, const void *pKey1, - int nKey2, const void *pKey2 -){ - int rc, n; - n = nKey1<nKey2 ? nKey1 : nKey2; - rc = memcmp(pKey1, pKey2, n); - if( rc==0 ){ - rc = nKey1 - nKey2; - } - return rc; -} - -/* -** Another built-in collating sequence: NOCASE. -** -** This collating sequence is intended to be used for "case independant -** comparison". SQLite's knowledge of upper and lower case equivalents -** extends only to the 26 characters used in the English language. -** -** At the moment there is only a UTF-8 implementation. -*/ -static int nocaseCollatingFunc( - void *NotUsed, - int nKey1, const void *pKey1, - int nKey2, const void *pKey2 -){ - int r = sqlite3StrNICmp( - (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2); - if( 0==r ){ - r = nKey1-nKey2; - } - return r; -} - -/* -** Return the ROWID of the most recent insert -*/ -sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){ - return db->lastRowid; -} - -/* -** Return the number of changes in the most recent call to sqlite3_exec(). -*/ -int sqlite3_changes(sqlite3 *db){ - return db->nChange; -} - -/* -** Return the number of changes since the database handle was opened. -*/ -int sqlite3_total_changes(sqlite3 *db){ - return db->nTotalChange; -} - -/* -** Close an existing SQLite database -*/ -int sqlite3_close(sqlite3 *db){ - HashElem *i; - int j; - - if( !db ){ - return SQLITE_OK; - } - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - -#ifdef SQLITE_SSE - sqlite3_finalize(db->pFetch); -#endif - - /* If there are any outstanding VMs, return SQLITE_BUSY. */ - if( db->pVdbe ){ - sqlite3Error(db, SQLITE_BUSY, - "Unable to close due to unfinalised statements"); - return SQLITE_BUSY; - } - assert( !sqlite3SafetyCheck(db) ); - - /* FIX ME: db->magic may be set to SQLITE_MAGIC_CLOSED if the database - ** cannot be opened for some reason. So this routine needs to run in - ** that case. But maybe there should be an extra magic value for the - ** "failed to open" state. - */ - if( db->magic!=SQLITE_MAGIC_CLOSED && sqlite3SafetyOn(db) ){ - /* printf("DID NOT CLOSE\n"); fflush(stdout); */ - return SQLITE_ERROR; - } - - for(j=0; j<db->nDb; j++){ - struct Db *pDb = &db->aDb[j]; - if( pDb->pBt ){ - sqlite3BtreeClose(pDb->pBt); - pDb->pBt = 0; - } - } - sqlite3ResetInternalSchema(db, 0); - assert( db->nDb<=2 ); - assert( db->aDb==db->aDbStatic ); - for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ - FuncDef *pFunc, *pNext; - for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){ - pNext = pFunc->pNext; - sqliteFree(pFunc); - } - } - - for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){ - CollSeq *pColl = (CollSeq *)sqliteHashData(i); - sqliteFree(pColl); - } - sqlite3HashClear(&db->aCollSeq); - - sqlite3HashClear(&db->aFunc); - sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */ - if( db->pValue ){ - sqlite3ValueFree(db->pValue); - } - if( db->pErr ){ - sqlite3ValueFree(db->pErr); - } - -#ifndef SQLITE_OMIT_GLOBALRECOVER - { - sqlite3 *pPrev; - sqlite3OsEnterMutex(); - pPrev = pDbList; - while( pPrev && pPrev->pNext!=db ){ - pPrev = pPrev->pNext; - } - if( pPrev ){ - pPrev->pNext = db->pNext; - }else{ - assert( pDbList==db ); - pDbList = db->pNext; - } - sqlite3OsLeaveMutex(); - } -#endif - - db->magic = SQLITE_MAGIC_ERROR; - sqliteFree(db); - return SQLITE_OK; -} - -/* -** Rollback all database files. -*/ -void sqlite3RollbackAll(sqlite3 *db){ - int i; - for(i=0; i<db->nDb; i++){ - if( db->aDb[i].pBt ){ - sqlite3BtreeRollback(db->aDb[i].pBt); - db->aDb[i].inTrans = 0; - } - } - sqlite3ResetInternalSchema(db, 0); -} - -/* -** Return a static string that describes the kind of error specified in the -** argument. -*/ -const char *sqlite3ErrStr(int rc){ - const char *z; - switch( rc ){ - case SQLITE_ROW: - case SQLITE_DONE: - case SQLITE_OK: z = "not an error"; break; - case SQLITE_ERROR: z = "SQL logic error or missing database"; break; - case SQLITE_PERM: z = "access permission denied"; break; - case SQLITE_ABORT: z = "callback requested query abort"; break; - case SQLITE_BUSY: z = "database is locked"; break; - case SQLITE_LOCKED: z = "database table is locked"; break; - case SQLITE_NOMEM: z = "out of memory"; break; - case SQLITE_READONLY: z = "attempt to write a readonly database"; break; - case SQLITE_INTERRUPT: z = "interrupted"; break; - case SQLITE_IOERR: z = "disk I/O error"; break; - case SQLITE_CORRUPT: z = "database disk image is malformed"; break; - case SQLITE_FULL: z = "database or disk is full"; break; - case SQLITE_CANTOPEN: z = "unable to open database file"; break; - case SQLITE_PROTOCOL: z = "database locking protocol failure"; break; - case SQLITE_EMPTY: z = "table contains no data"; break; - case SQLITE_SCHEMA: z = "database schema has changed"; break; - case SQLITE_CONSTRAINT: z = "constraint failed"; break; - case SQLITE_MISMATCH: z = "datatype mismatch"; break; - case SQLITE_MISUSE: z = "library routine called out of sequence";break; - case SQLITE_NOLFS: z = "kernel lacks large file support"; break; - case SQLITE_AUTH: z = "authorization denied"; break; - case SQLITE_FORMAT: z = "auxiliary database format error"; break; - case SQLITE_RANGE: z = "bind or column index out of range"; break; - case SQLITE_NOTADB: z = "file is encrypted or is not a database";break; - default: z = "unknown error"; break; - } - return z; -} - -/* -** This routine implements a busy callback that sleeps and tries -** again until a timeout value is reached. The timeout value is -** an integer number of milliseconds passed in as the first -** argument. -*/ -static int sqliteDefaultBusyCallback( - void *ptr, /* Database connection */ - int count /* Number of times table has been busy */ -){ -#if SQLITE_MIN_SLEEP_MS==1 - static const u8 delays[] = - { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; - static const u8 totals[] = - { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; -# define NDELAY (sizeof(delays)/sizeof(delays[0])) - int timeout = ((sqlite3 *)ptr)->busyTimeout; - int delay, prior; - - assert( count>=0 ); - if( count < NDELAY ){ - delay = delays[count]; - prior = totals[count]; - }else{ - delay = delays[NDELAY-1]; - prior = totals[NDELAY-1] + delay*(count-(NDELAY-1)); - } - if( prior + delay > timeout ){ - delay = timeout - prior; - if( delay<=0 ) return 0; - } - sqlite3OsSleep(delay); - return 1; -#else - int timeout = ((sqlite3 *)ptr)->busyTimeout; - if( (count+1)*1000 > timeout ){ - return 0; - } - sqlite3OsSleep(1000); - return 1; -#endif -} - -/* -** Invoke the given busy handler. -** -** This routine is called when an operation failed with a lock. -** If this routine returns non-zero, the lock is retried. If it -** returns 0, the operation aborts with an SQLITE_BUSY error. -*/ -int sqlite3InvokeBusyHandler(BusyHandler *p){ - int rc; - if( p==0 || p->xFunc==0 || p->nBusy<0 ) return 0; - rc = p->xFunc(p->pArg, p->nBusy); - if( rc==0 ){ - p->nBusy = -1; - }else{ - p->nBusy++; - } - return rc; -} - -/* -** This routine sets the busy callback for an Sqlite database to the -** given callback function with the given argument. -*/ -int sqlite3_busy_handler( - sqlite3 *db, - int (*xBusy)(void*,int), - void *pArg -){ - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - db->busyHandler.xFunc = xBusy; - db->busyHandler.pArg = pArg; - db->busyHandler.nBusy = 0; - return SQLITE_OK; -} - -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK -/* -** This routine sets the progress callback for an Sqlite database to the -** given callback function with the given argument. The progress callback will -** be invoked every nOps opcodes. -*/ -void sqlite3_progress_handler( - sqlite3 *db, - int nOps, - int (*xProgress)(void*), - void *pArg -){ - if( !sqlite3SafetyCheck(db) ){ - if( nOps>0 ){ - db->xProgress = xProgress; - db->nProgressOps = nOps; - db->pProgressArg = pArg; - }else{ - db->xProgress = 0; - db->nProgressOps = 0; - db->pProgressArg = 0; - } - } -} -#endif - - -/* -** This routine installs a default busy handler that waits for the -** specified number of milliseconds before returning 0. -*/ -int sqlite3_busy_timeout(sqlite3 *db, int ms){ - if( ms>0 ){ - db->busyTimeout = ms; - sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); - }else{ - sqlite3_busy_handler(db, 0, 0); - } - return SQLITE_OK; -} - -/* -** Cause any pending operation to stop at its earliest opportunity. -*/ -void sqlite3_interrupt(sqlite3 *db){ - if( !sqlite3SafetyCheck(db) ){ - db->flags |= SQLITE_Interrupt; - } -} - -/* -** Windows systems should call this routine to free memory that -** is returned in the in the errmsg parameter of sqlite3_open() when -** SQLite is a DLL. For some reason, it does not work to call free() -** directly. -** -** Note that we need to call free() not sqliteFree() here. -*/ -void sqlite3_free(char *p){ free(p); } - -/* -** Create new user functions. -*/ -int sqlite3_create_function( - sqlite3 *db, - const char *zFunctionName, - int nArg, - int enc, - void *pUserData, - void (*xFunc)(sqlite3_context*,int,sqlite3_value **), - void (*xStep)(sqlite3_context*,int,sqlite3_value **), - void (*xFinal)(sqlite3_context*) -){ - FuncDef *p; - int nName; - - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - if( zFunctionName==0 || - (xFunc && (xFinal || xStep)) || - (!xFunc && (xFinal && !xStep)) || - (!xFunc && (!xFinal && xStep)) || - (nArg<-1 || nArg>127) || - (255<(nName = strlen(zFunctionName))) ){ - return SQLITE_ERROR; - } - -#ifndef SQLITE_OMIT_UTF16 - /* If SQLITE_UTF16 is specified as the encoding type, transform this - ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the - ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. - ** - ** If SQLITE_ANY is specified, add three versions of the function - ** to the hash table. - */ - if( enc==SQLITE_UTF16 ){ - enc = SQLITE_UTF16NATIVE; - }else if( enc==SQLITE_ANY ){ - int rc; - rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF8, - pUserData, xFunc, xStep, xFinal); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF16LE, - pUserData, xFunc, xStep, xFinal); - if( rc!=SQLITE_OK ) return rc; - enc = SQLITE_UTF16BE; - } -#else - enc = SQLITE_UTF8; -#endif - - /* Check if an existing function is being overridden or deleted. If so, - ** and there are active VMs, then return SQLITE_BUSY. If a function - ** is being overridden/deleted but there are no active VMs, allow the - ** operation to continue but invalidate all precompiled statements. - */ - p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 0); - if( p && p->iPrefEnc==enc && p->nArg==nArg ){ - if( db->activeVdbeCnt ){ - sqlite3Error(db, SQLITE_BUSY, - "Unable to delete/modify user-function due to active statements"); - return SQLITE_BUSY; - }else{ - sqlite3ExpirePreparedStatements(db); - } - } - - p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 1); - if( p==0 ) return SQLITE_NOMEM; - p->flags = 0; - p->xFunc = xFunc; - p->xStep = xStep; - p->xFinalize = xFinal; - p->pUserData = pUserData; - return SQLITE_OK; -} -#ifndef SQLITE_OMIT_UTF16 -int sqlite3_create_function16( - sqlite3 *db, - const void *zFunctionName, - int nArg, - int eTextRep, - void *pUserData, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*) -){ - int rc; - char const *zFunc8; - sqlite3_value *pTmp; - - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - pTmp = sqlite3GetTransientValue(db); - sqlite3ValueSetStr(pTmp, -1, zFunctionName, SQLITE_UTF16NATIVE,SQLITE_STATIC); - zFunc8 = sqlite3ValueText(pTmp, SQLITE_UTF8); - - if( !zFunc8 ){ - return SQLITE_NOMEM; - } - rc = sqlite3_create_function(db, zFunc8, nArg, eTextRep, - pUserData, xFunc, xStep, xFinal); - return rc; -} -#endif - -#ifndef SQLITE_OMIT_TRACE -/* -** Register a trace function. The pArg from the previously registered trace -** is returned. -** -** A NULL trace function means that no tracing is executes. A non-NULL -** trace is a pointer to a function that is invoked at the start of each -** SQL statement. -*/ -void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){ - void *pOld = db->pTraceArg; - db->xTrace = xTrace; - db->pTraceArg = pArg; - return pOld; -} -/* -** Register a profile function. The pArg from the previously registered -** profile function is returned. -** -** A NULL profile function means that no profiling is executes. A non-NULL -** profile is a pointer to a function that is invoked at the conclusion of -** each SQL statement that is run. -*/ -void *sqlite3_profile( - sqlite3 *db, - void (*xProfile)(void*,const char*,sqlite_uint64), - void *pArg -){ - void *pOld = db->pProfileArg; - db->xProfile = xProfile; - db->pProfileArg = pArg; - return pOld; -} -#endif /* SQLITE_OMIT_TRACE */ - -/*** EXPERIMENTAL *** -** -** Register a function to be invoked when a transaction comments. -** If either function returns non-zero, then the commit becomes a -** rollback. -*/ -void *sqlite3_commit_hook( - sqlite3 *db, /* Attach the hook to this database */ - int (*xCallback)(void*), /* Function to invoke on each commit */ - void *pArg /* Argument to the function */ -){ - void *pOld = db->pCommitArg; - db->xCommitCallback = xCallback; - db->pCommitArg = pArg; - return pOld; -} - - -/* -** This routine is called to create a connection to a database BTree -** driver. If zFilename is the name of a file, then that file is -** opened and used. If zFilename is the magic name ":memory:" then -** the database is stored in memory (and is thus forgotten as soon as -** the connection is closed.) If zFilename is NULL then the database -** is a "virtual" database for transient use only and is deleted as -** soon as the connection is closed. -** -** A virtual database can be either a disk file (that is automatically -** deleted when the file is closed) or it an be held entirely in memory, -** depending on the values of the TEMP_STORE compile-time macro and the -** db->temp_store variable, according to the following chart: -** -** TEMP_STORE db->temp_store Location of temporary database -** ---------- -------------- ------------------------------ -** 0 any file -** 1 1 file -** 1 2 memory -** 1 0 file -** 2 1 file -** 2 2 memory -** 2 0 memory -** 3 any memory -*/ -int sqlite3BtreeFactory( - const sqlite3 *db, /* Main database when opening aux otherwise 0 */ - const char *zFilename, /* Name of the file containing the BTree database */ - int omitJournal, /* if TRUE then do not journal this file */ - int nCache, /* How many pages in the page cache */ - Btree **ppBtree /* Pointer to new Btree object written here */ -){ - int btree_flags = 0; - int rc; - - assert( ppBtree != 0); - if( omitJournal ){ - btree_flags |= BTREE_OMIT_JOURNAL; - } - if( db->flags & SQLITE_NoReadlock ){ - btree_flags |= BTREE_NO_READLOCK; - } - if( zFilename==0 ){ -#if TEMP_STORE==0 - /* Do nothing */ -#endif -#ifndef SQLITE_OMIT_MEMORYDB -#if TEMP_STORE==1 - if( db->temp_store==2 ) zFilename = ":memory:"; -#endif -#if TEMP_STORE==2 - if( db->temp_store!=1 ) zFilename = ":memory:"; -#endif -#if TEMP_STORE==3 - zFilename = ":memory:"; -#endif -#endif /* SQLITE_OMIT_MEMORYDB */ - } - - rc = sqlite3BtreeOpen(zFilename, ppBtree, btree_flags); - if( rc==SQLITE_OK ){ - sqlite3BtreeSetBusyHandler(*ppBtree, (void*)&db->busyHandler); - sqlite3BtreeSetCacheSize(*ppBtree, nCache); - } - return rc; -} - -/* -** Return UTF-8 encoded English language explanation of the most recent -** error. -*/ -const char *sqlite3_errmsg(sqlite3 *db){ - const char *z; - if( sqlite3_malloc_failed ){ - return sqlite3ErrStr(SQLITE_NOMEM); - } - if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){ - return sqlite3ErrStr(SQLITE_MISUSE); - } - z = sqlite3_value_text(db->pErr); - if( z==0 ){ - z = sqlite3ErrStr(db->errCode); - } - return z; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Return UTF-16 encoded English language explanation of the most recent -** error. -*/ -const void *sqlite3_errmsg16(sqlite3 *db){ - /* Because all the characters in the string are in the unicode - ** range 0x00-0xFF, if we pad the big-endian string with a - ** zero byte, we can obtain the little-endian string with - ** &big_endian[1]. - */ - static const char outOfMemBe[] = { - 0, 'o', 0, 'u', 0, 't', 0, ' ', - 0, 'o', 0, 'f', 0, ' ', - 0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0 - }; - static const char misuseBe [] = { - 0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ', - 0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ', - 0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ', - 0, 'o', 0, 'u', 0, 't', 0, ' ', - 0, 'o', 0, 'f', 0, ' ', - 0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0 - }; - - const void *z; - if( sqlite3_malloc_failed ){ - return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]); - } - if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){ - return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]); - } - z = sqlite3_value_text16(db->pErr); - if( z==0 ){ - sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode), - SQLITE_UTF8, SQLITE_STATIC); - z = sqlite3_value_text16(db->pErr); - } - return z; -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Return the most recent error code generated by an SQLite routine. -*/ -int sqlite3_errcode(sqlite3 *db){ - if( sqlite3_malloc_failed ){ - return SQLITE_NOMEM; - } - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - return db->errCode; -} - -/* -** This routine does the work of opening a database on behalf of -** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" -** is UTF-8 encoded. -*/ -static int openDatabase( - const char *zFilename, /* Database filename UTF-8 encoded */ - sqlite3 **ppDb /* OUT: Returned database handle */ -){ - sqlite3 *db; - int rc, i; - CollSeq *pColl; - - /* Allocate the sqlite data structure */ - db = sqliteMalloc( sizeof(sqlite3) ); - if( db==0 ) goto opendb_out; - db->priorNewRowid = 0; - db->magic = SQLITE_MAGIC_BUSY; - db->nDb = 2; - db->aDb = db->aDbStatic; - db->enc = SQLITE_UTF8; - db->autoCommit = 1; - db->flags |= SQLITE_ShortColNames; - sqlite3HashInit(&db->aFunc, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&db->aCollSeq, SQLITE_HASH_STRING, 0); - for(i=0; i<db->nDb; i++){ - sqlite3HashInit(&db->aDb[i].tblHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&db->aDb[i].idxHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&db->aDb[i].trigHash, SQLITE_HASH_STRING, 0); - sqlite3HashInit(&db->aDb[i].aFKey, SQLITE_HASH_STRING, 1); - } - - /* Add the default collation sequence BINARY. BINARY works for both UTF-8 - ** and UTF-16, so add a version for each to avoid any unnecessary - ** conversions. The only error that can occur here is a malloc() failure. - */ - if( sqlite3_create_collation(db, "BINARY", SQLITE_UTF8, 0,binCollFunc) || - sqlite3_create_collation(db, "BINARY", SQLITE_UTF16, 0,binCollFunc) || - !(db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0)) ){ - rc = db->errCode; - assert( rc!=SQLITE_OK ); - db->magic = SQLITE_MAGIC_CLOSED; - goto opendb_out; - } - - /* Also add a UTF-8 case-insensitive collation sequence. */ - sqlite3_create_collation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc); - - /* Set flags on the built-in collating sequences */ - db->pDfltColl->type = SQLITE_COLL_BINARY; - pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "NOCASE", 6, 0); - if( pColl ){ - pColl->type = SQLITE_COLL_NOCASE; - } - - /* Open the backend database driver */ - rc = sqlite3BtreeFactory(db, zFilename, 0, MAX_PAGES, &db->aDb[0].pBt); - if( rc!=SQLITE_OK ){ - sqlite3Error(db, rc, 0); - db->magic = SQLITE_MAGIC_CLOSED; - goto opendb_out; - } - - /* The default safety_level for the main database is 'full'; for the temp - ** database it is 'NONE'. This matches the pager layer defaults. - */ - db->aDb[0].zName = "main"; - db->aDb[0].safety_level = 3; -#ifndef SQLITE_OMIT_TEMPDB - db->aDb[1].zName = "temp"; - db->aDb[1].safety_level = 1; -#endif - - - /* Register all built-in functions, but do not attempt to read the - ** database schema yet. This is delayed until the first time the database - ** is accessed. - */ - sqlite3RegisterBuiltinFunctions(db); - sqlite3Error(db, SQLITE_OK, 0); - db->magic = SQLITE_MAGIC_OPEN; - -opendb_out: - if( sqlite3_errcode(db)==SQLITE_OK && sqlite3_malloc_failed ){ - sqlite3Error(db, SQLITE_NOMEM, 0); - } - *ppDb = db; -#ifndef SQLITE_OMIT_GLOBALRECOVER - if( db ){ - sqlite3OsEnterMutex(); - db->pNext = pDbList; - pDbList = db; - sqlite3OsLeaveMutex(); - } -#endif - return sqlite3_errcode(db); -} - -/* -** Open a new database handle. -*/ -int sqlite3_open( - const char *zFilename, - sqlite3 **ppDb -){ - return openDatabase(zFilename, ppDb); -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Open a new database handle. -*/ -int sqlite3_open16( - const void *zFilename, - sqlite3 **ppDb -){ - char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ - int rc = SQLITE_NOMEM; - sqlite3_value *pVal; - - assert( ppDb ); - *ppDb = 0; - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC); - zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8); - if( zFilename8 ){ - rc = openDatabase(zFilename8, ppDb); - if( rc==SQLITE_OK && *ppDb ){ - sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0); - } - } - if( pVal ){ - sqlite3ValueFree(pVal); - } - - return rc; -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** The following routine destroys a virtual machine that is created by -** the sqlite3_compile() routine. The integer returned is an SQLITE_ -** success/failure code that describes the result of executing the virtual -** machine. -** -** This routine sets the error code and string returned by -** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -*/ -int sqlite3_finalize(sqlite3_stmt *pStmt){ - int rc; - if( pStmt==0 ){ - rc = SQLITE_OK; - }else{ - rc = sqlite3VdbeFinalize((Vdbe*)pStmt); - } - return rc; -} - -/* -** Terminate the current execution of an SQL statement and reset it -** back to its starting state so that it can be reused. A success code from -** the prior execution is returned. -** -** This routine sets the error code and string returned by -** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -*/ -int sqlite3_reset(sqlite3_stmt *pStmt){ - int rc; - if( pStmt==0 ){ - rc = SQLITE_OK; - }else{ - rc = sqlite3VdbeReset((Vdbe*)pStmt); - sqlite3VdbeMakeReady((Vdbe*)pStmt, -1, 0, 0, 0); - } - return rc; -} - -/* -** Register a new collation sequence with the database handle db. -*/ -int sqlite3_create_collation( - sqlite3* db, - const char *zName, - int enc, - void* pCtx, - int(*xCompare)(void*,int,const void*,int,const void*) -){ - CollSeq *pColl; - int rc = SQLITE_OK; - - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - - /* If SQLITE_UTF16 is specified as the encoding type, transform this - ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the - ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. - */ - if( enc==SQLITE_UTF16 ){ - enc = SQLITE_UTF16NATIVE; - } - - if( enc!=SQLITE_UTF8 && enc!=SQLITE_UTF16LE && enc!=SQLITE_UTF16BE ){ - sqlite3Error(db, SQLITE_ERROR, - "Param 3 to sqlite3_create_collation() must be one of " - "SQLITE_UTF8, SQLITE_UTF16, SQLITE_UTF16LE or SQLITE_UTF16BE" - ); - return SQLITE_ERROR; - } - - /* Check if this call is removing or replacing an existing collation - ** sequence. If so, and there are active VMs, return busy. If there - ** are no active VMs, invalidate any pre-compiled statements. - */ - pColl = sqlite3FindCollSeq(db, (u8)enc, zName, strlen(zName), 0); - if( pColl && pColl->xCmp ){ - if( db->activeVdbeCnt ){ - sqlite3Error(db, SQLITE_BUSY, - "Unable to delete/modify collation sequence due to active statements"); - return SQLITE_BUSY; - } - sqlite3ExpirePreparedStatements(db); - } - - pColl = sqlite3FindCollSeq(db, (u8)enc, zName, strlen(zName), 1); - if( 0==pColl ){ - rc = SQLITE_NOMEM; - }else{ - pColl->xCmp = xCompare; - pColl->pUser = pCtx; - pColl->enc = enc; - } - sqlite3Error(db, rc, 0); - return rc; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Register a new collation sequence with the database handle db. -*/ -int sqlite3_create_collation16( - sqlite3* db, - const char *zName, - int enc, - void* pCtx, - int(*xCompare)(void*,int,const void*,int,const void*) -){ - char const *zName8; - sqlite3_value *pTmp; - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - pTmp = sqlite3GetTransientValue(db); - sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF16NATIVE, SQLITE_STATIC); - zName8 = sqlite3ValueText(pTmp, SQLITE_UTF8); - return sqlite3_create_collation(db, zName8, enc, pCtx, xCompare); -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Register a collation sequence factory callback with the database handle -** db. Replace any previously installed collation sequence factory. -*/ -int sqlite3_collation_needed( - sqlite3 *db, - void *pCollNeededArg, - void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) -){ - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - db->xCollNeeded = xCollNeeded; - db->xCollNeeded16 = 0; - db->pCollNeededArg = pCollNeededArg; - return SQLITE_OK; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Register a collation sequence factory callback with the database handle -** db. Replace any previously installed collation sequence factory. -*/ -int sqlite3_collation_needed16( - sqlite3 *db, - void *pCollNeededArg, - void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) -){ - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - db->xCollNeeded = 0; - db->xCollNeeded16 = xCollNeeded16; - db->pCollNeededArg = pCollNeededArg; - return SQLITE_OK; -} -#endif /* SQLITE_OMIT_UTF16 */ - -#ifndef SQLITE_OMIT_GLOBALRECOVER -/* -** This function is called to recover from a malloc failure that occured -** within SQLite. -** -** This function is *not* threadsafe. Calling this from within a threaded -** application when threads other than the caller have used SQLite is -** dangerous and will almost certainly result in malfunctions. -*/ -int sqlite3_global_recover(){ - int rc = SQLITE_OK; - - if( sqlite3_malloc_failed ){ - sqlite3 *db; - int i; - sqlite3_malloc_failed = 0; - for(db=pDbList; db; db=db->pNext ){ - sqlite3ExpirePreparedStatements(db); - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt && (rc=sqlite3BtreeReset(pBt)) ){ - goto recover_out; - } - } - db->autoCommit = 1; - } - } - -recover_out: - if( rc!=SQLITE_OK ){ - sqlite3_malloc_failed = 1; - } - return rc; -} -#endif - -/* -** Test to see whether or not the database connection is in autocommit -** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on -** by default. Autocommit is disabled by a BEGIN statement and reenabled -** by the next COMMIT or ROLLBACK. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite3_get_autocommit(sqlite3 *db){ - return db->autoCommit; -} - -#ifdef SQLITE_DEBUG -/* -** The following routine is subtituted for constant SQLITE_CORRUPT in -** debugging builds. This provides a way to set a breakpoint for when -** corruption is first detected. -*/ -int sqlite3Corrupt(void){ - return SQLITE_CORRUPT; -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/md5.c b/ext/pdo_sqlite/sqlite/src/md5.c deleted file mode 100644 index 32fcb6b68014c..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/md5.c +++ /dev/null @@ -1,387 +0,0 @@ -/* -** SQLite uses this code for testing only. It is not a part of -** the SQLite library. This file implements two new TCL commands -** "md5" and "md5file" that compute md5 checksums on arbitrary text -** and on complete files. These commands are used by the "testfixture" -** program to help verify the correct operation of the SQLite library. -** -** The original use of these TCL commands was to test the ROLLBACK -** feature of SQLite. First compute the MD5-checksum of the database. -** Then make some changes but rollback the changes rather than commit -** them. Compute a second MD5-checksum of the file and verify that the -** two checksums are the same. Such is the original use of this code. -** New uses may have been added since this comment was written. -*/ -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - */ -#include <tcl.h> -#include <string.h> -#include "sqlite3.h" - -/* - * If compiled on a machine that doesn't have a 32-bit integer, - * you just set "uint32" to the appropriate datatype for an - * unsigned 32-bit integer. For example: - * - * cc -Duint32='unsigned long' md5.c - * - */ -#ifndef uint32 -# define uint32 unsigned int -#endif - -struct Context { - uint32 buf[4]; - uint32 bits[2]; - unsigned char in[64]; -}; -typedef char MD5Context[88]; - -/* - * Note: this code is harmless on little-endian machines. - */ -static void byteReverse (unsigned char *buf, unsigned longs){ - uint32 t; - do { - t = (uint32)((unsigned)buf[3]<<8 | buf[2]) << 16 | - ((unsigned)buf[1]<<8 | buf[0]); - *(uint32 *)buf = t; - buf += 4; - } while (--longs); -} -/* The four core functions - F1 is optimized somewhat */ - -/* #define F1(x, y, z) (x & y | ~x & z) */ -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -/* This is the central step in the MD5 algorithm. */ -#define MD5STEP(f, w, x, y, z, data, s) \ - ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - */ -static void MD5Transform(uint32 buf[4], const uint32 in[16]){ - register uint32 a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ -static void MD5Init(MD5Context *pCtx){ - struct Context *ctx = (struct Context *)pCtx; - ctx->buf[0] = 0x67452301; - ctx->buf[1] = 0xefcdab89; - ctx->buf[2] = 0x98badcfe; - ctx->buf[3] = 0x10325476; - ctx->bits[0] = 0; - ctx->bits[1] = 0; -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -static -void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){ - struct Context *ctx = (struct Context *)pCtx; - uint32 t; - - /* Update bitcount */ - - t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((uint32)len << 3)) < t) - ctx->bits[1]++; /* Carry from low to high */ - ctx->bits[1] += len >> 29; - - t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ - - /* Handle any leading odd-sized chunks */ - - if ( t ) { - unsigned char *p = (unsigned char *)ctx->in + t; - - t = 64-t; - if (len < t) { - memcpy(p, buf, len); - return; - } - memcpy(p, buf, t); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32 *)ctx->in); - buf += t; - len -= t; - } - - /* Process data in 64-byte chunks */ - - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32 *)ctx->in); - buf += 64; - len -= 64; - } - - /* Handle any remaining bytes of data. */ - - memcpy(ctx->in, buf, len); -} - -/* - * Final wrapup - pad to 64-byte boundary with the bit pattern - * 1 0* (64-bit count of bits processed, MSB-first) - */ -static void MD5Final(unsigned char digest[16], MD5Context *pCtx){ - struct Context *ctx = (struct Context *)pCtx; - unsigned count; - unsigned char *p; - - /* Compute number of bytes mod 64 */ - count = (ctx->bits[0] >> 3) & 0x3F; - - /* Set the first char of padding to 0x80. This is safe since there is - always at least one byte free */ - p = ctx->in + count; - *p++ = 0x80; - - /* Bytes of padding needed to make 64 bytes */ - count = 64 - 1 - count; - - /* Pad out to 56 mod 64 */ - if (count < 8) { - /* Two lots of padding: Pad the first block to 64 bytes */ - memset(p, 0, count); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32 *)ctx->in); - - /* Now fill the next block with 56 bytes */ - memset(ctx->in, 0, 56); - } else { - /* Pad block to 56 bytes */ - memset(p, 0, count-8); - } - byteReverse(ctx->in, 14); - - /* Append length in bits and transform */ - ((uint32 *)ctx->in)[ 14 ] = ctx->bits[0]; - ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1]; - - MD5Transform(ctx->buf, (uint32 *)ctx->in); - byteReverse((unsigned char *)ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ -} - -/* -** Convert a digest into base-16. digest should be declared as -** "unsigned char digest[16]" in the calling function. The MD5 -** digest is stored in the first 16 bytes. zBuf should -** be "char zBuf[33]". -*/ -static void DigestToBase16(unsigned char *digest, char *zBuf){ - static char const zEncode[] = "0123456789abcdef"; - int i, j; - - for(j=i=0; i<16; i++){ - int a = digest[i]; - zBuf[j++] = zEncode[(a>>4)&0xf]; - zBuf[j++] = zEncode[a & 0xf]; - } - zBuf[j] = 0; -} - -/* -** A TCL command for md5. The argument is the text to be hashed. The -** Result is the hash in base64. -*/ -static int md5_cmd(void*cd, Tcl_Interp *interp, int argc, const char **argv){ - MD5Context ctx; - unsigned char digest[16]; - - if( argc!=2 ){ - Tcl_AppendResult(interp,"wrong # args: should be \"", argv[0], - " TEXT\"", 0); - return TCL_ERROR; - } - MD5Init(&ctx); - MD5Update(&ctx, (unsigned char*)argv[1], (unsigned)strlen(argv[1])); - MD5Final(digest, &ctx); - DigestToBase16(digest, interp->result); - return TCL_OK; -} - -/* -** A TCL command to take the md5 hash of a file. The argument is the -** name of the file. -*/ -static int md5file_cmd(void*cd, Tcl_Interp*interp, int argc, const char **argv){ - FILE *in; - MD5Context ctx; - unsigned char digest[16]; - char zBuf[10240]; - - if( argc!=2 ){ - Tcl_AppendResult(interp,"wrong # args: should be \"", argv[0], - " FILENAME\"", 0); - return TCL_ERROR; - } - in = fopen(argv[1],"rb"); - if( in==0 ){ - Tcl_AppendResult(interp,"unable to open file \"", argv[1], - "\" for reading", 0); - return TCL_ERROR; - } - MD5Init(&ctx); - for(;;){ - int n; - n = fread(zBuf, 1, sizeof(zBuf), in); - if( n<=0 ) break; - MD5Update(&ctx, (unsigned char*)zBuf, (unsigned)n); - } - fclose(in); - MD5Final(digest, &ctx); - DigestToBase16(digest, interp->result); - return TCL_OK; -} - -/* -** Register the two TCL commands above with the TCL interpreter. -*/ -int Md5_Init(Tcl_Interp *interp){ - Tcl_CreateCommand(interp, "md5", (Tcl_CmdProc*)md5_cmd, 0, 0); - Tcl_CreateCommand(interp, "md5file", (Tcl_CmdProc*)md5file_cmd, 0, 0); - return TCL_OK; -} - -/* -** During testing, the special md5sum() aggregate function is available. -** inside SQLite. The following routines implement that function. -*/ -static void md5step(sqlite3_context *context, int argc, sqlite3_value **argv){ - MD5Context *p; - int i; - if( argc<1 ) return; - p = sqlite3_aggregate_context(context, sizeof(*p)); - if( p==0 ) return; - if( sqlite3_aggregate_count(context)==1 ){ - MD5Init(p); - } - for(i=0; i<argc; i++){ - const char *zData = sqlite3_value_text(argv[i]); - if( zData ){ - MD5Update(p, zData, strlen(zData)); - } - } -} -static void md5finalize(sqlite3_context *context){ - MD5Context *p; - unsigned char digest[16]; - char zBuf[33]; - p = sqlite3_aggregate_context(context, sizeof(*p)); - MD5Final(digest,p); - DigestToBase16(digest, zBuf); - sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); -} -void Md5_Register(sqlite3 *db){ - sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0, - md5step, md5finalize); -} diff --git a/ext/pdo_sqlite/sqlite/src/opcodes.c b/ext/pdo_sqlite/sqlite/src/opcodes.c deleted file mode 100644 index 734d1a5409eaa..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/opcodes.c +++ /dev/null @@ -1,137 +0,0 @@ -/* Automatically generated. Do not edit */ -/* See the mkopcodec.awk script for details. */ -#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) -const char *const sqlite3OpcodeNames[] = { "?", - /* 1 */ "MemLoad", - /* 2 */ "Column", - /* 3 */ "SetCookie", - /* 4 */ "IfMemPos", - /* 5 */ "MoveGt", - /* 6 */ "AggFocus", - /* 7 */ "RowKey", - /* 8 */ "IdxRecno", - /* 9 */ "AggNext", - /* 10 */ "OpenWrite", - /* 11 */ "If", - /* 12 */ "PutStrKey", - /* 13 */ "Pop", - /* 14 */ "SortPut", - /* 15 */ "AggContextPush", - /* 16 */ "CollSeq", - /* 17 */ "OpenRead", - /* 18 */ "Expire", - /* 19 */ "SortReset", - /* 20 */ "AutoCommit", - /* 21 */ "Sort", - /* 22 */ "ListRewind", - /* 23 */ "IntegrityCk", - /* 24 */ "Function", - /* 25 */ "Noop", - /* 26 */ "Return", - /* 27 */ "Variable", - /* 28 */ "String", - /* 29 */ "ParseSchema", - /* 30 */ "PutIntKey", - /* 31 */ "AggFunc", - /* 32 */ "Close", - /* 33 */ "ListWrite", - /* 34 */ "CreateIndex", - /* 35 */ "IsUnique", - /* 36 */ "IdxIsNull", - /* 37 */ "NotFound", - /* 38 */ "MustBeInt", - /* 39 */ "Halt", - /* 40 */ "IdxLT", - /* 41 */ "AddImm", - /* 42 */ "Statement", - /* 43 */ "RowData", - /* 44 */ "MemMax", - /* 45 */ "Push", - /* 46 */ "KeyAsData", - /* 47 */ "NotExists", - /* 48 */ "OpenTemp", - /* 49 */ "MemIncr", - /* 50 */ "Gosub", - /* 51 */ "AggSet", - /* 52 */ "Integer", - /* 53 */ "SortNext", - /* 54 */ "Prev", - /* 55 */ "CreateTable", - /* 56 */ "Last", - /* 57 */ "ResetCount", - /* 58 */ "Callback", - /* 59 */ "ContextPush", - /* 60 */ "DropTrigger", - /* 61 */ "DropIndex", - /* 62 */ "FullKey", - /* 63 */ "IdxGE", - /* 64 */ "Or", - /* 65 */ "And", - /* 66 */ "Not", - /* 67 */ "IdxDelete", - /* 68 */ "Vacuum", - /* 69 */ "MoveLe", - /* 70 */ "IsNull", - /* 71 */ "NotNull", - /* 72 */ "Ne", - /* 73 */ "Eq", - /* 74 */ "Gt", - /* 75 */ "Le", - /* 76 */ "Lt", - /* 77 */ "Ge", - /* 78 */ "IfNot", - /* 79 */ "BitAnd", - /* 80 */ "BitOr", - /* 81 */ "ShiftLeft", - /* 82 */ "ShiftRight", - /* 83 */ "Add", - /* 84 */ "Subtract", - /* 85 */ "Multiply", - /* 86 */ "Divide", - /* 87 */ "Remainder", - /* 88 */ "Concat", - /* 89 */ "Negative", - /* 90 */ "DropTable", - /* 91 */ "BitNot", - /* 92 */ "String8", - /* 93 */ "MakeRecord", - /* 94 */ "Delete", - /* 95 */ "AggContextPop", - /* 96 */ "ListRead", - /* 97 */ "ListReset", - /* 98 */ "Dup", - /* 99 */ "Goto", - /* 100 */ "Clear", - /* 101 */ "IdxGT", - /* 102 */ "MoveLt", - /* 103 */ "VerifyCookie", - /* 104 */ "Pull", - /* 105 */ "SetNumColumns", - /* 106 */ "AbsValue", - /* 107 */ "Transaction", - /* 108 */ "AggGet", - /* 109 */ "ContextPop", - /* 110 */ "Next", - /* 111 */ "AggInit", - /* 112 */ "Distinct", - /* 113 */ "NewRecno", - /* 114 */ "AggReset", - /* 115 */ "Destroy", - /* 116 */ "ReadCookie", - /* 117 */ "ForceInt", - /* 118 */ "Recno", - /* 119 */ "OpenPseudo", - /* 120 */ "Blob", - /* 121 */ "MemStore", - /* 122 */ "Rewind", - /* 123 */ "MoveGe", - /* 124 */ "IdxPut", - /* 125 */ "Found", - /* 126 */ "NullRow", - /* 127 */ "NotUsed_127", - /* 128 */ "NotUsed_128", - /* 129 */ "NotUsed_129", - /* 130 */ "Real", - /* 131 */ "HexBlob", -}; -#endif diff --git a/ext/pdo_sqlite/sqlite/src/opcodes.h b/ext/pdo_sqlite/sqlite/src/opcodes.h deleted file mode 100644 index 4db3ec16399df..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/opcodes.h +++ /dev/null @@ -1,149 +0,0 @@ -/* Automatically generated. Do not edit */ -/* See the mkopcodeh.awk script for details */ -#define OP_MemLoad 1 -#define OP_HexBlob 134 /* same as TK_BLOB */ -#define OP_Column 2 -#define OP_SetCookie 3 -#define OP_IfMemPos 4 -#define OP_Real 133 /* same as TK_FLOAT */ -#define OP_Sequence 5 -#define OP_MoveGt 6 -#define OP_Ge 80 /* same as TK_GE */ -#define OP_RowKey 7 -#define OP_Eq 76 /* same as TK_EQ */ -#define OP_OpenWrite 8 -#define OP_NotNull 74 /* same as TK_NOTNULL */ -#define OP_If 9 -#define OP_ToInt 10 -#define OP_String8 95 /* same as TK_STRING */ -#define OP_Pop 11 -#define OP_CollSeq 12 -#define OP_OpenRead 13 -#define OP_Expire 14 -#define OP_AutoCommit 15 -#define OP_Gt 77 /* same as TK_GT */ -#define OP_IntegrityCk 16 -#define OP_Sort 17 -#define OP_Function 18 -#define OP_And 68 /* same as TK_AND */ -#define OP_Subtract 87 /* same as TK_MINUS */ -#define OP_Noop 19 -#define OP_Return 20 -#define OP_Remainder 90 /* same as TK_REM */ -#define OP_NewRowid 21 -#define OP_Multiply 88 /* same as TK_STAR */ -#define OP_Variable 22 -#define OP_String 23 -#define OP_ParseSchema 24 -#define OP_Close 25 -#define OP_CreateIndex 26 -#define OP_IsUnique 27 -#define OP_IdxIsNull 28 -#define OP_NotFound 29 -#define OP_Int64 30 -#define OP_MustBeInt 31 -#define OP_Halt 32 -#define OP_Rowid 33 -#define OP_IdxLT 34 -#define OP_AddImm 35 -#define OP_Statement 36 -#define OP_RowData 37 -#define OP_MemMax 38 -#define OP_Push 39 -#define OP_Or 67 /* same as TK_OR */ -#define OP_NotExists 40 -#define OP_MemIncr 41 -#define OP_Gosub 42 -#define OP_Divide 89 /* same as TK_SLASH */ -#define OP_Integer 43 -#define OP_ToNumeric 44 -#define OP_MemInt 45 -#define OP_Prev 46 -#define OP_Concat 91 /* same as TK_CONCAT */ -#define OP_BitAnd 82 /* same as TK_BITAND */ -#define OP_CreateTable 47 -#define OP_Last 48 -#define OP_IsNull 73 /* same as TK_ISNULL */ -#define OP_IdxRowid 49 -#define OP_MakeIdxRec 50 -#define OP_ShiftRight 85 /* same as TK_RSHIFT */ -#define OP_ResetCount 51 -#define OP_FifoWrite 52 -#define OP_Callback 53 -#define OP_ContextPush 54 -#define OP_DropTrigger 55 -#define OP_DropIndex 56 -#define OP_IdxGE 57 -#define OP_IdxDelete 58 -#define OP_Vacuum 59 -#define OP_MoveLe 60 -#define OP_IfNot 61 -#define OP_DropTable 62 -#define OP_MakeRecord 63 -#define OP_ToBlob 64 -#define OP_Delete 65 -#define OP_AggFinal 66 -#define OP_ShiftLeft 84 /* same as TK_LSHIFT */ -#define OP_Dup 70 -#define OP_Goto 71 -#define OP_FifoRead 72 -#define OP_Clear 81 -#define OP_IdxGT 93 -#define OP_MoveLt 96 -#define OP_Le 78 /* same as TK_LE */ -#define OP_VerifyCookie 97 -#define OP_AggStep 98 -#define OP_Pull 99 -#define OP_ToText 100 -#define OP_Not 69 /* same as TK_NOT */ -#define OP_SetNumColumns 101 -#define OP_AbsValue 102 -#define OP_Transaction 103 -#define OP_Negative 92 /* same as TK_UMINUS */ -#define OP_Ne 75 /* same as TK_NE */ -#define OP_ContextPop 104 -#define OP_BitOr 83 /* same as TK_BITOR */ -#define OP_Next 105 -#define OP_IdxInsert 106 -#define OP_Distinct 107 -#define OP_Lt 79 /* same as TK_LT */ -#define OP_Insert 108 -#define OP_Destroy 109 -#define OP_ReadCookie 110 -#define OP_ForceInt 111 -#define OP_LoadAnalysis 112 -#define OP_OpenVirtual 113 -#define OP_Explain 114 -#define OP_OpenPseudo 115 -#define OP_Null 116 -#define OP_Blob 117 -#define OP_Add 86 /* same as TK_PLUS */ -#define OP_MemStore 118 -#define OP_Rewind 119 -#define OP_MoveGe 120 -#define OP_BitNot 94 /* same as TK_BITNOT */ -#define OP_MemMove 121 -#define OP_MemNull 122 -#define OP_Found 123 -#define OP_NullRow 124 - -/* The following opcode values are never used */ -#define OP_NotUsed_125 125 -#define OP_NotUsed_126 126 -#define OP_NotUsed_127 127 -#define OP_NotUsed_128 128 -#define OP_NotUsed_129 129 -#define OP_NotUsed_130 130 -#define OP_NotUsed_131 131 -#define OP_NotUsed_132 132 - -#define NOPUSH_MASK_0 65368 -#define NOPUSH_MASK_1 47898 -#define NOPUSH_MASK_2 22493 -#define NOPUSH_MASK_3 32761 -#define NOPUSH_MASK_4 65215 -#define NOPUSH_MASK_5 30719 -#define NOPUSH_MASK_6 40895 -#define NOPUSH_MASK_7 6603 -#define NOPUSH_MASK_8 0 -#define NOPUSH_MASK_9 0 diff --git a/ext/pdo_sqlite/sqlite/src/os.h b/ext/pdo_sqlite/sqlite/src/os.h deleted file mode 100644 index a161d134a66db..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -** 2001 September 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file (together with is companion C source-code file -** "os.c") attempt to abstract the underlying operating system so that -** the SQLite library will work on both POSIX and windows systems. -*/ -#ifndef _SQLITE_OS_H_ -#define _SQLITE_OS_H_ - -/* -** Figure out if we are dealing with Unix, Windows or MacOS. -** -** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix. -** The MacOS build is designed to use CodeWarrior (tested with v8) -*/ -#if !defined(OS_UNIX) && !defined(OS_TEST) && !defined(OS_OTHER) -# define OS_OTHER 0 -# ifndef OS_WIN -# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) -# define OS_WIN 1 -# define OS_UNIX 0 -# else -# define OS_WIN 0 -# define OS_UNIX 1 -# endif -# else -# define OS_UNIX 0 -# endif -#else -# ifndef OS_WIN -# define OS_WIN 0 -# endif -#endif - -/* -** Invoke the appropriate operating-system specific header file. -*/ -#if OS_TEST -# include "os_test.h" -#endif -#if OS_UNIX -# include "os_unix.h" -#endif -#if OS_WIN -# include "os_win.h" -#endif - -/* os_other.c and os_other.h are not delivered with SQLite. These files -** are place-holders that can be filled in by third-party developers to -** implement backends to their on proprietary operating systems. -*/ -#if OS_OTHER -# include "os_other.h" -#endif - -/* If the SET_FULLSYNC macro is not defined above, then make it -** a no-op -*/ -#ifndef SET_FULLSYNC -# define SET_FULLSYNC(x,y) -#endif - -/* -** Temporary files are named starting with this prefix followed by 16 random -** alphanumeric characters, and no file extension. They are stored in the -** OS's standard temporary file directory, and are deleted prior to exit. -** If sqlite is being embedded in another program, you may wish to change the -** prefix to reflect your program's name, so that if your program exits -** prematurely, old temporary files can be easily identified. This can be done -** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line. -*/ -#ifndef TEMP_FILE_PREFIX -# define TEMP_FILE_PREFIX "sqlite_" -#endif - -/* -** The following values may be passed as the second argument to -** sqlite3OsLock(). The various locks exhibit the following semantics: -** -** SHARED: Any number of processes may hold a SHARED lock simultaneously. -** RESERVED: A single process may hold a RESERVED lock on a file at -** any time. Other processes may hold and obtain new SHARED locks. -** PENDING: A single process may hold a PENDING lock on a file at -** any one time. Existing SHARED locks may persist, but no new -** SHARED locks may be obtained by other processes. -** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks. -** -** PENDING_LOCK may not be passed directly to sqlite3OsLock(). Instead, a -** process that requests an EXCLUSIVE lock may actually obtain a PENDING -** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to -** sqlite3OsLock(). -*/ -#define NO_LOCK 0 -#define SHARED_LOCK 1 -#define RESERVED_LOCK 2 -#define PENDING_LOCK 3 -#define EXCLUSIVE_LOCK 4 - -/* -** File Locking Notes: (Mostly about windows but also some info for Unix) -** -** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because -** those functions are not available. So we use only LockFile() and -** UnlockFile(). -** -** LockFile() prevents not just writing but also reading by other processes. -** A SHARED_LOCK is obtained by locking a single randomly-chosen -** byte out of a specific range of bytes. The lock byte is obtained at -** random so two separate readers can probably access the file at the -** same time, unless they are unlucky and choose the same lock byte. -** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range. -** There can only be one writer. A RESERVED_LOCK is obtained by locking -** a single byte of the file that is designated as the reserved lock byte. -** A PENDING_LOCK is obtained by locking a designated byte different from -** the RESERVED_LOCK byte. -** -** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available, -** which means we can use reader/writer locks. When reader/writer locks -** are used, the lock is placed on the same range of bytes that is used -** for probabilistic locking in Win95/98/ME. Hence, the locking scheme -** will support two or more Win95 readers or two or more WinNT readers. -** But a single Win95 reader will lock out all WinNT readers and a single -** WinNT reader will lock out all other Win95 readers. -** -** The following #defines specify the range of bytes used for locking. -** SHARED_SIZE is the number of bytes available in the pool from which -** a random byte is selected for a shared lock. The pool of bytes for -** shared locks begins at SHARED_FIRST. -** -** These #defines are available in os.h so that Unix can use the same -** byte ranges for locking. This leaves open the possiblity of having -** clients on win95, winNT, and unix all talking to the same shared file -** and all locking correctly. To do so would require that samba (or whatever -** tool is being used for file sharing) implements locks correctly between -** windows and unix. I'm guessing that isn't likely to happen, but by -** using the same locking range we are at least open to the possibility. -** -** Locking in windows is manditory. For this reason, we cannot store -** actual data in the bytes used for locking. The pager never allocates -** the pages involved in locking therefore. SHARED_SIZE is selected so -** that all locks will fit on a single page even at the minimum page size. -** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE -** is set high so that we don't have to allocate an unused page except -** for very large databases. But one should test the page skipping logic -** by setting PENDING_BYTE low and running the entire regression suite. -** -** Changing the value of PENDING_BYTE results in a subtly incompatible -** file format. Depending on how it is changed, you might not notice -** the incompatibility right away, even running a full regression test. -** The default location of PENDING_BYTE is the first byte past the -** 1GB boundary. -** -*/ -#ifndef SQLITE_TEST -#define PENDING_BYTE 0x40000000 /* First byte past the 1GB boundary */ -#else -extern unsigned int sqlite3_pending_byte; -#define PENDING_BYTE sqlite3_pending_byte -#endif - -#define RESERVED_BYTE (PENDING_BYTE+1) -#define SHARED_FIRST (PENDING_BYTE+2) -#define SHARED_SIZE 510 - - -int sqlite3OsDelete(const char*); -int sqlite3OsFileExists(const char*); -int sqlite3OsOpenReadWrite(const char*, OsFile*, int*); -int sqlite3OsOpenExclusive(const char*, OsFile*, int); -int sqlite3OsOpenReadOnly(const char*, OsFile*); -int sqlite3OsOpenDirectory(const char*, OsFile*); -int sqlite3OsSyncDirectory(const char*); -int sqlite3OsTempFileName(char*); -int sqlite3OsIsDirWritable(char*); -int sqlite3OsClose(OsFile*); -int sqlite3OsRead(OsFile*, void*, int amt); -int sqlite3OsWrite(OsFile*, const void*, int amt); -int sqlite3OsSeek(OsFile*, i64 offset); -int sqlite3OsSync(OsFile*, int); -int sqlite3OsTruncate(OsFile*, i64 size); -int sqlite3OsFileSize(OsFile*, i64 *pSize); -char *sqlite3OsFullPathname(const char*); -int sqlite3OsLock(OsFile*, int); -int sqlite3OsUnlock(OsFile*, int); -int sqlite3OsCheckReservedLock(OsFile *id); - - -/* The interface for file I/O is above. Other miscellaneous functions -** are below */ - -int sqlite3OsRandomSeed(char*); -int sqlite3OsSleep(int ms); -int sqlite3OsCurrentTime(double*); -void sqlite3OsEnterMutex(void); -void sqlite3OsLeaveMutex(void); - -#endif /* _SQLITE_OS_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/os_common.h b/ext/pdo_sqlite/sqlite/src/os_common.h deleted file mode 100644 index b19ff059067ba..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_common.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains macros and a little bit of code that is common to -** all of the platform-specific files (os_*.c) and is #included into those -** files. -** -** This file should be #included by the os_*.c files only. It is not a -** general purpose header file. -*/ - -/* -** At least two bugs have slipped in because we changed the MEMORY_DEBUG -** macro to SQLITE_DEBUG and some older makefiles have not yet made the -** switch. The following code should catch this problem at compile-time. -*/ -#ifdef MEMORY_DEBUG -# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead." -#endif - - -/* - * When testing, this global variable stores the location of the - * pending-byte in the database file. - */ -#ifdef SQLITE_TEST -unsigned int sqlite3_pending_byte = 0x40000000; -#endif - -int sqlite3_os_trace = 0; -#ifdef SQLITE_DEBUG -static int last_page = 0; -#define SEEK(X) last_page=(X) -#define TRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X) -#define TRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y) -#define TRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z) -#define TRACE4(X,Y,Z,A) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z,A) -#define TRACE5(X,Y,Z,A,B) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z,A,B) -#define TRACE6(X,Y,Z,A,B,C) if(sqlite3_os_trace) sqlite3DebugPrintf(X,Y,Z,A,B,C) -#define TRACE7(X,Y,Z,A,B,C,D) \ - if(sqlite3_os_trace) sqlite3DebugPrintf(X,Y,Z,A,B,C,D) -#else -#define SEEK(X) -#define TRACE1(X) -#define TRACE2(X,Y) -#define TRACE3(X,Y,Z) -#define TRACE4(X,Y,Z,A) -#define TRACE5(X,Y,Z,A,B) -#define TRACE6(X,Y,Z,A,B,C) -#define TRACE7(X,Y,Z,A,B,C,D) -#endif - -/* -** Macros for performance tracing. Normally turned off. Only works -** on i486 hardware. -*/ -#ifdef SQLITE_PERFORMANCE_TRACE -__inline__ unsigned long long int hwtime(void){ - unsigned long long int x; - __asm__("rdtsc\n\t" - "mov %%edx, %%ecx\n\t" - :"=A" (x)); - return x; -} -static unsigned long long int g_start; -static unsigned int elapse; -#define TIMER_START g_start=hwtime() -#define TIMER_END elapse=hwtime()-g_start -#define TIMER_ELAPSED elapse -#else -#define TIMER_START -#define TIMER_END -#define TIMER_ELAPSED 0 -#endif - -/* -** If we compile with the SQLITE_TEST macro set, then the following block -** of code will give us the ability to simulate a disk I/O error. This -** is used for testing the I/O recovery logic. -*/ -#ifdef SQLITE_TEST -int sqlite3_io_error_pending = 0; -int sqlite3_diskfull_pending = 0; -int sqlite3_diskfull = 0; -#define SimulateIOError(A) \ - if( sqlite3_io_error_pending ) \ - if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); return A; } -static void local_ioerr(){ - sqlite3_io_error_pending = 0; /* Really just a place to set a breakpoint */ -} -#define SimulateDiskfullError \ - if( sqlite3_diskfull_pending ){ \ - if( sqlite3_diskfull_pending == 1 ){ \ - local_ioerr(); \ - sqlite3_diskfull = 1; \ - return SQLITE_FULL; \ - }else{ \ - sqlite3_diskfull_pending--; \ - } \ - } -#else -#define SimulateIOError(A) -#define SimulateDiskfullError -#endif - -/* -** When testing, keep a count of the number of open files. -*/ -#ifdef SQLITE_TEST -int sqlite3_open_file_count = 0; -#define OpenCounter(X) sqlite3_open_file_count+=(X) -#else -#define OpenCounter(X) -#endif diff --git a/ext/pdo_sqlite/sqlite/src/os_mac.c b/ext/pdo_sqlite/sqlite/src/os_mac.c deleted file mode 100644 index f84c168d4aaec..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_mac.c +++ /dev/null @@ -1,738 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains code that is specific classic mac. Mac OS X -** uses the os_unix.c file, not this one. -*/ -#include "sqliteInt.h" -#include "os.h" -#if OS_MAC /* This file used on classic mac only */ - -#include <extras.h> -#include <path2fss.h> -#include <TextUtils.h> -#include <FinderRegistry.h> -#include <Folders.h> -#include <Timer.h> -#include <OSUtils.h> - -/* -** Macros used to determine whether or not to use threads. -*/ -#if defined(THREADSAFE) && THREADSAFE -# include <Multiprocessing.h> -# define SQLITE_MACOS_MULTITASKING 1 -#endif - -/* -** Include code that is common to all os_*.c files -*/ -#include "os_common.h" - -/* -** Delete the named file -*/ -int sqlite3OsDelete(const char *zFilename){ - unlink(zFilename); - return SQLITE_OK; -} - -/* -** Return TRUE if the named file exists. -*/ -int sqlite3OsFileExists(const char *zFilename){ - return access(zFilename, 0)==0; -} - -/* -** Attempt to open a file for both reading and writing. If that -** fails, try opening it read-only. If the file does not exist, -** try to create it. -** -** On success, a handle for the open file is written to *id -** and *pReadonly is set to 0 if the file was opened for reading and -** writing or 1 if the file was opened read-only. The function returns -** SQLITE_OK. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id and *pReadonly unchanged. -*/ -int sqlite3OsOpenReadWrite( - const char *zFilename, - OsFile *id, - int *pReadonly -){ - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - if( __path2fss(zFilename, &fsSpec) != noErr ){ - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - } - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrShPerm, &(id->refNum)) != noErr ){ - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrPerm, &(id->refNum)) != noErr ){ - if (FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; - else - *pReadonly = 1; - } else - *pReadonly = 0; - } else - *pReadonly = 0; -# else - __path2fss(zFilename, &fsSpec); - if( !sqlite3OsFileExists(zFilename) ){ - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - } - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNum)) != noErr ){ - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ){ - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; - else - *pReadonly = 1; - } else - *pReadonly = 0; - } else - *pReadonly = 0; -# endif - if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ - id->refNumRF = -1; - } - id->locked = 0; - id->delOnClose = 0; - OpenCounter(+1); - return SQLITE_OK; -} - - -/* -** Attempt to open a new file for exclusive access by this process. -** The file will be opened for both reading and writing. To avoid -** a potential security problem, we do not allow the file to have -** previously existed. Nor do we allow the file to be a symbolic -** link. -** -** If delFlag is true, then make arrangements to automatically delete -** the file when it is closed. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - __path2fss(zFilename, &fsSpec); - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# else - __path2fss(zFilename, &fsSpec); - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# endif - id->refNumRF = -1; - id->locked = 0; - id->delOnClose = delFlag; - if (delFlag) - id->pathToDel = sqlite3OsFullPathname(zFilename); - OpenCounter(+1); - return SQLITE_OK; -} - -/* -** Attempt to open a new file for read-only access. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){ - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - if( __path2fss(zFilename, &fsSpec) != noErr ) - return SQLITE_CANTOPEN; - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# else - __path2fss(zFilename, &fsSpec); - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# endif - if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ - id->refNumRF = -1; - } - id->locked = 0; - id->delOnClose = 0; - OpenCounter(+1); - return SQLITE_OK; -} - -/* -** Attempt to open a file descriptor for the directory that contains a -** file. This file descriptor can be used to fsync() the directory -** in order to make sure the creation of a new file is actually written -** to disk. -** -** This routine is only meaningful for Unix. It is a no-op under -** windows since windows does not support hard links. -** -** On success, a handle for a previously open file is at *id is -** updated with the new directory file descriptor and SQLITE_OK is -** returned. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id unchanged. -*/ -int sqlite3OsOpenDirectory( - const char *zDirname, - OsFile *id -){ - return SQLITE_OK; -} - -/* -** Create a temporary file name in zBuf. zBuf must be big enough to -** hold at least SQLITE_TEMPNAME_SIZE characters. -*/ -int sqlite3OsTempFileName(char *zBuf){ - static char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789"; - int i, j; - char zTempPath[SQLITE_TEMPNAME_SIZE]; - char zdirName[32]; - CInfoPBRec infoRec; - Str31 dirName; - memset(&infoRec, 0, sizeof(infoRec)); - memset(zTempPath, 0, SQLITE_TEMPNAME_SIZE); - if( FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder, - &(infoRec.dirInfo.ioVRefNum), &(infoRec.dirInfo.ioDrParID)) == noErr ){ - infoRec.dirInfo.ioNamePtr = dirName; - do{ - infoRec.dirInfo.ioFDirIndex = -1; - infoRec.dirInfo.ioDrDirID = infoRec.dirInfo.ioDrParID; - if( PBGetCatInfoSync(&infoRec) == noErr ){ - CopyPascalStringToC(dirName, zdirName); - i = strlen(zdirName); - memmove(&(zTempPath[i+1]), zTempPath, strlen(zTempPath)); - strcpy(zTempPath, zdirName); - zTempPath[i] = ':'; - }else{ - *zTempPath = 0; - break; - } - } while( infoRec.dirInfo.ioDrDirID != fsRtDirID ); - } - if( *zTempPath == 0 ) - getcwd(zTempPath, SQLITE_TEMPNAME_SIZE-24); - for(;;){ - sprintf(zBuf, "%s"TEMP_FILE_PREFIX, zTempPath); - j = strlen(zBuf); - sqlite3Randomness(15, &zBuf[j]); - for(i=0; i<15; i++, j++){ - zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; - } - zBuf[j] = 0; - if( !sqlite3OsFileExists(zBuf) ) break; - } - return SQLITE_OK; -} - -/* -** Close a file. -*/ -int sqlite3OsClose(OsFile *id){ - if( id->refNumRF!=-1 ) - FSClose(id->refNumRF); -# ifdef _LARGE_FILE - FSCloseFork(id->refNum); -# else - FSClose(id->refNum); -# endif - if( id->delOnClose ){ - unlink(id->pathToDel); - sqliteFree(id->pathToDel); - } - OpenCounter(-1); - return SQLITE_OK; -} - -/* -** Read data from a file into a buffer. Return SQLITE_OK if all -** bytes were read successfully and SQLITE_IOERR if anything goes -** wrong. -*/ -int sqlite3OsRead(OsFile *id, void *pBuf, int amt){ - int got; - SimulateIOError(SQLITE_IOERR); - TRACE2("READ %d\n", last_page); -# ifdef _LARGE_FILE - FSReadFork(id->refNum, fsAtMark, 0, (ByteCount)amt, pBuf, (ByteCount*)&got); -# else - got = amt; - FSRead(id->refNum, &got, pBuf); -# endif - if( got==amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -} - -/* -** Write data from a buffer into a file. Return SQLITE_OK on success -** or some other error code on failure. -*/ -int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){ - OSErr oserr; - int wrote = 0; - SimulateIOError(SQLITE_IOERR); - TRACE2("WRITE %d\n", last_page); - while( amt>0 ){ -# ifdef _LARGE_FILE - oserr = FSWriteFork(id->refNum, fsAtMark, 0, - (ByteCount)amt, pBuf, (ByteCount*)&wrote); -# else - wrote = amt; - oserr = FSWrite(id->refNum, &wrote, pBuf); -# endif - if( wrote == 0 || oserr != noErr) - break; - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - if( oserr != noErr || amt>wrote ){ - return SQLITE_FULL; - } - return SQLITE_OK; -} - -/* -** Move the read/write pointer in a file. -*/ -int sqlite3OsSeek(OsFile *id, off_t offset){ - off_t curSize; - SEEK(offset/1024 + 1); - if( sqlite3OsFileSize(id, &curSize) != SQLITE_OK ){ - return SQLITE_IOERR; - } - if( offset >= curSize ){ - if( sqlite3OsTruncate(id, offset+1) != SQLITE_OK ){ - return SQLITE_IOERR; - } - } -# ifdef _LARGE_FILE - if( FSSetForkPosition(id->refNum, fsFromStart, offset) != noErr ){ -# else - if( SetFPos(id->refNum, fsFromStart, offset) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -} - -/* -** Make sure all writes to a particular file are committed to disk. -** -** Under Unix, also make sure that the directory entry for the file -** has been created by fsync-ing the directory that contains the file. -** If we do not do this and we encounter a power failure, the directory -** entry for the journal might not exist after we reboot. The next -** SQLite to access the file will not know that the journal exists (because -** the directory entry for the journal was never created) and the transaction -** will not roll back - possibly leading to database corruption. -*/ -int sqlite3OsSync(OsFile *id){ -# ifdef _LARGE_FILE - if( FSFlushFork(id->refNum) != noErr ){ -# else - ParamBlockRec params; - memset(¶ms, 0, sizeof(ParamBlockRec)); - params.ioParam.ioRefNum = id->refNum; - if( PBFlushFileSync(¶ms) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -} - -/* -** Sync the directory zDirname. This is a no-op on operating systems other -** than UNIX. -*/ -int sqlite3OsSyncDirectory(const char *zDirname){ - SimulateIOError(SQLITE_IOERR); - return SQLITE_OK; -} - -/* -** Truncate an open file to a specified size -*/ -int sqlite3OsTruncate(OsFile *id, off_t nByte){ - SimulateIOError(SQLITE_IOERR); -# ifdef _LARGE_FILE - if( FSSetForkSize(id->refNum, fsFromStart, nByte) != noErr){ -# else - if( SetEOF(id->refNum, nByte) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -} - -/* -** Determine the current size of a file in bytes -*/ -int sqlite3OsFileSize(OsFile *id, off_t *pSize){ -# ifdef _LARGE_FILE - if( FSGetForkSize(id->refNum, pSize) != noErr){ -# else - if( GetEOF(id->refNum, pSize) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -} - -/* -** Windows file locking notes: [similar issues apply to MacOS] -** -** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because -** those functions are not available. So we use only LockFile() and -** UnlockFile(). -** -** LockFile() prevents not just writing but also reading by other processes. -** (This is a design error on the part of Windows, but there is nothing -** we can do about that.) So the region used for locking is at the -** end of the file where it is unlikely to ever interfere with an -** actual read attempt. -** -** A database read lock is obtained by locking a single randomly-chosen -** byte out of a specific range of bytes. The lock byte is obtained at -** random so two separate readers can probably access the file at the -** same time, unless they are unlucky and choose the same lock byte. -** A database write lock is obtained by locking all bytes in the range. -** There can only be one writer. -** -** A lock is obtained on the first byte of the lock range before acquiring -** either a read lock or a write lock. This prevents two processes from -** attempting to get a lock at a same time. The semantics of -** sqlite3OsReadLock() require that if there is already a write lock, that -** lock is converted into a read lock atomically. The lock on the first -** byte allows us to drop the old write lock and get the read lock without -** another process jumping into the middle and messing us up. The same -** argument applies to sqlite3OsWriteLock(). -** -** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available, -** which means we can use reader/writer locks. When reader writer locks -** are used, the lock is placed on the same range of bytes that is used -** for probabilistic locking in Win95/98/ME. Hence, the locking scheme -** will support two or more Win95 readers or two or more WinNT readers. -** But a single Win95 reader will lock out all WinNT readers and a single -** WinNT reader will lock out all other Win95 readers. -** -** Note: On MacOS we use the resource fork for locking. -** -** The following #defines specify the range of bytes used for locking. -** N_LOCKBYTE is the number of bytes available for doing the locking. -** The first byte used to hold the lock while the lock is changing does -** not count toward this number. FIRST_LOCKBYTE is the address of -** the first byte in the range of bytes used for locking. -*/ -#define N_LOCKBYTE 10239 -#define FIRST_LOCKBYTE (0x000fffff - N_LOCKBYTE) - -/* -** Change the status of the lock on the file "id" to be a readlock. -** If the file was write locked, then this reduces the lock to a read. -** If the file was read locked, then this acquires a new read lock. -** -** Return SQLITE_OK on success and SQLITE_BUSY on failure. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqlite3OsReadLock(OsFile *id){ - int rc; - if( id->locked>0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else{ - int lk; - OSErr res; - int cnt = 5; - ParamBlockRec params; - sqlite3Randomness(sizeof(lk), &lk); - lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ - UInt32 finalTicks; - Delay(1, &finalTicks); /* 1/60 sec */ - } - if( res == noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - PBUnlockRangeSync(¶ms); - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+lk; - params.ioParam.ioReqCount = 1; - res = PBLockRangeSync(¶ms); - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - } - if( res == noErr ){ - id->locked = lk; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -} - -/* -** Change the lock status to be an exclusive or write lock. Return -** SQLITE_OK on success and SQLITE_BUSY on a failure. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqlite3OsWriteLock(OsFile *id){ - int rc; - if( id->locked<0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else{ - OSErr res; - int cnt = 5; - ParamBlockRec params; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ - UInt32 finalTicks; - Delay(1, &finalTicks); /* 1/60 sec */ - } - if( res == noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE + id->locked; - params.ioParam.ioReqCount = 1; - if( id->locked==0 - || PBUnlockRangeSync(¶ms)==noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - res = PBLockRangeSync(¶ms); - }else{ - res = afpRangeNotLocked; - } - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - } - if( res == noErr ){ - id->locked = -1; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -} - -/* -** Unlock the given file descriptor. If the file descriptor was -** not previously locked, then this routine is a no-op. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqlite3OsUnlock(OsFile *id){ - int rc; - ParamBlockRec params; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - if( id->locked==0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else if( id->locked<0 ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - PBUnlockRangeSync(¶ms); - rc = SQLITE_OK; - id->locked = 0; - }else{ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+id->locked; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - rc = SQLITE_OK; - id->locked = 0; - } - return rc; -} - -/* -** Get information to seed the random number generator. The seed -** is written into the buffer zBuf[256]. The calling function must -** supply a sufficiently large buffer. -*/ -int sqlite3OsRandomSeed(char *zBuf){ - /* We have to initialize zBuf to prevent valgrind from reporting - ** errors. The reports issued by valgrind are incorrect - we would - ** prefer that the randomness be increased by making use of the - ** uninitialized space in zBuf - but valgrind errors tend to worry - ** some users. Rather than argue, it seems easier just to initialize - ** the whole array and silence valgrind, even if that means less randomness - ** in the random seed. - ** - ** When testing, initializing zBuf[] to zero is all we do. That means - ** that we always use the same random number sequence.* This makes the - ** tests repeatable. - */ - memset(zBuf, 0, 256); -#if !defined(SQLITE_TEST) - { - int pid; - Microseconds((UnsignedWide*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid)); - } -#endif - return SQLITE_OK; -} - -/* -** Sleep for a little while. Return the amount of time slept. -*/ -int sqlite3OsSleep(int ms){ - UInt32 finalTicks; - UInt32 ticks = (((UInt32)ms+16)*3)/50; /* 1/60 sec per tick */ - Delay(ticks, &finalTicks); - return (int)((ticks*50)/3); -} - -/* -** Static variables used for thread synchronization -*/ -static int inMutex = 0; -#ifdef SQLITE_MACOS_MULTITASKING - static MPCriticalRegionID criticalRegion; -#endif - -/* -** The following pair of routine implement mutual exclusion for -** multi-threaded processes. Only a single thread is allowed to -** executed code that is surrounded by EnterMutex() and LeaveMutex(). -** -** SQLite uses only a single Mutex. There is not much critical -** code and what little there is executes quickly and without blocking. -*/ -void sqlite3OsEnterMutex(){ -#ifdef SQLITE_MACOS_MULTITASKING - static volatile int notInit = 1; - if( notInit ){ - if( notInit == 2 ) /* as close as you can get to thread safe init */ - MPYield(); - else{ - notInit = 2; - MPCreateCriticalRegion(&criticalRegion); - notInit = 0; - } - } - MPEnterCriticalRegion(criticalRegion, kDurationForever); -#endif - assert( !inMutex ); - inMutex = 1; -} -void sqlite3OsLeaveMutex(){ - assert( inMutex ); - inMutex = 0; -#ifdef SQLITE_MACOS_MULTITASKING - MPExitCriticalRegion(criticalRegion); -#endif -} - -/* -** Turn a relative pathname into a full pathname. Return a pointer -** to the full pathname stored in space obtained from sqliteMalloc(). -** The calling function is responsible for freeing this space once it -** is no longer needed. -*/ -char *sqlite3OsFullPathname(const char *zRelative){ - char *zFull = 0; - if( zRelative[0]==':' ){ - char zBuf[_MAX_PATH+1]; - sqlite3SetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), - (char*)0); - }else{ - if( strchr(zRelative, ':') ){ - sqlite3SetString(&zFull, zRelative, (char*)0); - }else{ - char zBuf[_MAX_PATH+1]; - sqlite3SetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0); - } - } - return zFull; -} - -/* -** The following variable, if set to a non-zero value, becomes the result -** returned from sqlite3OsCurrentTime(). This is used for testing. -*/ -#ifdef SQLITE_TEST -int sqlite3_current_time = 0; -#endif - -/* -** Find the current time (in Universal Coordinated Time). Write the -** current time and date as a Julian Day number into *prNow and -** return 0. Return 1 if the time and date cannot be found. -*/ -int sqlite3OsCurrentTime(double *prNow){ - *prNow = 0.0; /**** FIX ME *****/ -#ifdef SQLITE_TEST - if( sqlite3_current_time ){ - *prNow = sqlite3_current_time/86400.0 + 2440587.5; - } -#endif - return 0; -} - -#endif /* OS_MAC */ diff --git a/ext/pdo_sqlite/sqlite/src/os_mac.h b/ext/pdo_sqlite/sqlite/src/os_mac.h deleted file mode 100644 index 5b60f81837183..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_mac.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file defines OS-specific features of classic Mac. -** OS X uses the os_unix.h file, not this one. -*/ -#ifndef _SQLITE_OS_MAC_H_ -#define _SQLITE_OS_MAC_H_ - - -#include <unistd.h> -#include <Files.h> -#define SQLITE_TEMPNAME_SIZE _MAX_PATH -#define SQLITE_MIN_SLEEP_MS 17 - -/* -** The OsFile structure is a operating-system independing representation -** of an open file handle. It is defined differently for each architecture. -** -** This is the definition for class Mac. -*/ -typedef struct OsFile OsFile; -struct OsFile { - SInt16 refNum; /* Data fork/file reference number */ - SInt16 refNumRF; /* Resource fork reference number (for locking) */ - int locked; /* 0: unlocked, <0: write lock, >0: read lock */ - int delOnClose; /* True if file is to be deleted on close */ - char *pathToDel; /* Name of file to delete on close */ -}; - - -#endif /* _SQLITE_OS_MAC_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/os_test.c b/ext/pdo_sqlite/sqlite/src/os_test.c deleted file mode 100644 index 9b1c0e206f7bb..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_test.c +++ /dev/null @@ -1,463 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains code that is specific to Unix systems. It is used -** for testing SQLite only. -*/ -#if OS_TEST /* This file is used for the test backend only */ -#include "sqliteInt.h" -#include "os.h" /* Must be first to enable large file support */ - -#define sqlite3OsOpenReadWrite sqlite3RealOpenReadWrite -#define sqlite3OsOpenExclusive sqlite3RealOpenExclusive -#define sqlite3OsOpenReadOnly sqlite3RealOpenReadOnly -#define sqlite3OsOpenDirectory sqlite3RealOpenDirectory -#define sqlite3OsClose sqlite3RealClose -#define sqlite3OsRead sqlite3RealRead -#define sqlite3OsWrite sqlite3RealWrite -#define sqlite3OsSeek sqlite3RealSeek -#define sqlite3OsSync sqlite3RealSync -#define sqlite3OsTruncate sqlite3RealTruncate -#define sqlite3OsFileSize sqlite3RealFileSize -#define sqlite3OsLock sqlite3RealLock -#define sqlite3OsUnlock sqlite3RealUnlock -#define sqlite3OsCheckReservedLock sqlite3RealCheckReservedLock - -#define OsFile OsRealFile -#define OS_UNIX 1 -#include "os_unix.c" -#undef OS_UNIX -#undef OsFile - -#undef sqlite3OsOpenReadWrite -#undef sqlite3OsOpenExclusive -#undef sqlite3OsOpenReadOnly -#undef sqlite3OsOpenDirectory -#undef sqlite3OsClose -#undef sqlite3OsRead -#undef sqlite3OsWrite -#undef sqlite3OsSeek -#undef sqlite3OsSync -#undef sqlite3OsTruncate -#undef sqlite3OsFileSize -#undef sqlite3OsLock -#undef sqlite3OsUnlock -#undef sqlite3OsCheckReservedLock - -#define BLOCKSIZE 512 -#define BLOCK_OFFSET(x) ((x) * BLOCKSIZE) - - -/* -** The following variables control when a simulated crash occurs. -** -** If iCrashDelay is non-zero, then zCrashFile contains (full path) name of -** a file that SQLite will call sqlite3OsSync() on. Each time this happens -** iCrashDelay is decremented. If iCrashDelay is zero after being -** decremented, a "crash" occurs during the sync() operation. -** -** In other words, a crash occurs the iCrashDelay'th time zCrashFile is -** synced. -*/ -static int iCrashDelay = 0; -char zCrashFile[256]; - -/* -** Set the value of the two crash parameters. -*/ -void sqlite3SetCrashParams(int iDelay, char const *zFile){ - sqlite3OsEnterMutex(); - assert( strlen(zFile)<256 ); - strcpy(zCrashFile, zFile); - iCrashDelay = iDelay; - sqlite3OsLeaveMutex(); -} - -/* -** File zPath is being sync()ed. Return non-zero if this should -** cause a crash. -*/ -static int crashRequired(char const *zPath){ - int r; - int n; - sqlite3OsEnterMutex(); - n = strlen(zCrashFile); - if( zCrashFile[n-1]=='*' ){ - n--; - }else if( strlen(zPath)>n ){ - n = strlen(zPath); - } - r = 0; - if( iCrashDelay>0 && strncmp(zPath, zCrashFile, n)==0 ){ - iCrashDelay--; - if( iCrashDelay<=0 ){ - r = 1; - } - } - sqlite3OsLeaveMutex(); - return r; -} - - -static OsTestFile *pAllFiles = 0; - -/* -** Initialise the os_test.c specific fields of pFile. -*/ -static void initFile(OsFile *id, char const *zName){ - OsTestFile *pFile = (OsTestFile *) - sqliteMalloc(sizeof(OsTestFile) + strlen(zName)+1); - pFile->nMaxWrite = 0; - pFile->nBlk = 0; - pFile->apBlk = 0; - pFile->zName = (char *)(&pFile[1]); - strcpy(pFile->zName, zName); - *id = pFile; - pFile->pNext = pAllFiles; - pAllFiles = pFile; -} - -/* -** Undo the work done by initFile. Delete the OsTestFile structure -** and unlink the structure from the pAllFiles list. -*/ -static void closeFile(OsFile *id){ - OsTestFile *pFile = *id; - if( pFile==pAllFiles ){ - pAllFiles = pFile->pNext; - }else{ - OsTestFile *p; - for(p=pAllFiles; p->pNext!=pFile; p=p->pNext ){ - assert( p ); - } - p->pNext = pFile->pNext; - } - sqliteFree(pFile); - *id = 0; -} - -/* -** Return the current seek offset from the start of the file. This -** is unix-only code. -*/ -static i64 osTell(OsTestFile *pFile){ - return lseek(pFile->fd.h, 0, SEEK_CUR); -} - -/* -** Load block 'blk' into the cache of pFile. -*/ -static int cacheBlock(OsTestFile *pFile, int blk){ - if( blk>=pFile->nBlk ){ - int n = ((pFile->nBlk * 2) + 100 + blk); - /* if( pFile->nBlk==0 ){ printf("DIRTY %s\n", pFile->zName); } */ - pFile->apBlk = (u8 **)sqliteRealloc(pFile->apBlk, n * sizeof(u8*)); - if( !pFile->apBlk ) return SQLITE_NOMEM; - memset(&pFile->apBlk[pFile->nBlk], 0, (n - pFile->nBlk)*sizeof(u8*)); - pFile->nBlk = n; - } - - if( !pFile->apBlk[blk] ){ - i64 filesize; - int rc; - - u8 *p = sqliteMalloc(BLOCKSIZE); - if( !p ) return SQLITE_NOMEM; - pFile->apBlk[blk] = p; - - rc = sqlite3RealFileSize(&pFile->fd, &filesize); - if( rc!=SQLITE_OK ) return rc; - - if( BLOCK_OFFSET(blk)<filesize ){ - int len = BLOCKSIZE; - rc = sqlite3RealSeek(&pFile->fd, blk*BLOCKSIZE); - if( BLOCK_OFFSET(blk+1)>filesize ){ - len = filesize - BLOCK_OFFSET(blk); - } - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3RealRead(&pFile->fd, p, len); - if( rc!=SQLITE_OK ) return rc; - } - } - - return SQLITE_OK; -} - -/* #define TRACE_WRITECACHE */ - -/* -** Write the cache of pFile to disk. If crash is non-zero, randomly -** skip blocks when writing. The cache is deleted before returning. -*/ -static int writeCache2(OsTestFile *pFile, int crash){ - int i; - int nMax = pFile->nMaxWrite; - i64 offset; - int rc = SQLITE_OK; - - offset = osTell(pFile); - for(i=0; i<pFile->nBlk; i++){ - u8 *p = pFile->apBlk[i]; - if( p ){ - int skip = 0; - int trash = 0; - if( crash ){ - char random; - sqlite3Randomness(1, &random); - if( random & 0x01 ){ - if( random & 0x02 ){ - trash = 1; -#ifdef TRACE_WRITECACHE -printf("Trashing block %d of %s\n", i, pFile->zName); -#endif - }else{ - skip = 1; -#ifdef TRACE_WRITECACHE -printf("Skiping block %d of %s\n", i, pFile->zName); -#endif - } - }else{ -#ifdef TRACE_WRITECACHE -printf("Writing block %d of %s\n", i, pFile->zName); -#endif - } - } - if( rc==SQLITE_OK ){ - rc = sqlite3RealSeek(&pFile->fd, BLOCK_OFFSET(i)); - } - if( rc==SQLITE_OK && !skip ){ - int len = BLOCKSIZE; - if( BLOCK_OFFSET(i+1)>nMax ){ - len = nMax-BLOCK_OFFSET(i); - } - if( len>0 ){ - if( trash ){ - sqlite3Randomness(len, p); - } - rc = sqlite3RealWrite(&pFile->fd, p, len); - } - } - sqliteFree(p); - } - } - sqliteFree(pFile->apBlk); - pFile->nBlk = 0; - pFile->apBlk = 0; - pFile->nMaxWrite = 0; - - if( rc==SQLITE_OK ){ - rc = sqlite3RealSeek(&pFile->fd, offset); - } - return rc; -} - -/* -** Write the cache to disk. -*/ -static int writeCache(OsTestFile *pFile){ - if( pFile->apBlk ){ - int c = crashRequired(pFile->zName); - if( c ){ - OsTestFile *p; -#ifdef TRACE_WRITECACHE - printf("\nCrash during sync of %s\n", pFile->zName); -#endif - for(p=pAllFiles; p; p=p->pNext){ - writeCache2(p, 1); - } - exit(-1); - }else{ - return writeCache2(pFile, 0); - } - } - return SQLITE_OK; -} - -/* -** Close the file. -*/ -int sqlite3OsClose(OsFile *id){ - if( !(*id) ) return SQLITE_OK; - if( (*id)->fd.isOpen ){ - /* printf("CLOSE %s (%d blocks)\n", (*id)->zName, (*id)->nBlk); */ - writeCache(*id); - sqlite3RealClose(&(*id)->fd); - } - closeFile(id); - return SQLITE_OK; -} - -int sqlite3OsRead(OsFile *id, void *pBuf, int amt){ - i64 offset; /* The current offset from the start of the file */ - i64 end; /* The byte just past the last byte read */ - int blk; /* Block number the read starts on */ - int i; - u8 *zCsr; - int rc = SQLITE_OK; - OsTestFile *pFile = *id; - - offset = osTell(pFile); - end = offset+amt; - blk = (offset/BLOCKSIZE); - - zCsr = (u8 *)pBuf; - for(i=blk; i*BLOCKSIZE<end; i++){ - int off = 0; - int len = 0; - - - if( BLOCK_OFFSET(i) < offset ){ - off = offset-BLOCK_OFFSET(i); - } - len = BLOCKSIZE - off; - if( BLOCK_OFFSET(i+1) > end ){ - len = len - (BLOCK_OFFSET(i+1)-end); - } - - if( i<pFile->nBlk && pFile->apBlk[i]){ - u8 *pBlk = pFile->apBlk[i]; - memcpy(zCsr, &pBlk[off], len); - }else{ - rc = sqlite3RealSeek(&pFile->fd, BLOCK_OFFSET(i) + off); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3RealRead(&pFile->fd, zCsr, len); - if( rc!=SQLITE_OK ) return rc; - } - - zCsr += len; - } - assert( zCsr==&((u8 *)pBuf)[amt] ); - - rc = sqlite3RealSeek(&pFile->fd, end); - return rc; -} - -int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){ - i64 offset; /* The current offset from the start of the file */ - i64 end; /* The byte just past the last byte written */ - int blk; /* Block number the write starts on */ - int i; - const u8 *zCsr; - int rc = SQLITE_OK; - OsTestFile *pFile = *id; - - offset = osTell(pFile); - end = offset+amt; - blk = (offset/BLOCKSIZE); - - zCsr = (u8 *)pBuf; - for(i=blk; i*BLOCKSIZE<end; i++){ - u8 *pBlk; - int off = 0; - int len = 0; - - /* Make sure the block is in the cache */ - rc = cacheBlock(pFile, i); - if( rc!=SQLITE_OK ) return rc; - - /* Write into the cache */ - pBlk = pFile->apBlk[i]; - assert( pBlk ); - - if( BLOCK_OFFSET(i) < offset ){ - off = offset-BLOCK_OFFSET(i); - } - len = BLOCKSIZE - off; - if( BLOCK_OFFSET(i+1) > end ){ - len = len - (BLOCK_OFFSET(i+1)-end); - } - memcpy(&pBlk[off], zCsr, len); - zCsr += len; - } - if( pFile->nMaxWrite<end ){ - pFile->nMaxWrite = end; - } - assert( zCsr==&((u8 *)pBuf)[amt] ); - - rc = sqlite3RealSeek(&pFile->fd, end); - return rc; -} - -/* -** Sync the file. First flush the write-cache to disk, then call the -** real sync() function. -*/ -int sqlite3OsSync(OsFile *id, int dataOnly){ - int rc; - /* printf("SYNC %s (%d blocks)\n", (*id)->zName, (*id)->nBlk); */ - rc = writeCache(*id); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3RealSync(&(*id)->fd, dataOnly); - return rc; -} - -/* -** Truncate the file. Set the internal OsFile.nMaxWrite variable to the new -** file size to ensure that nothing in the write-cache past this point -** is written to disk. -*/ -int sqlite3OsTruncate(OsFile *id, i64 nByte){ - (*id)->nMaxWrite = nByte; - return sqlite3RealTruncate(&(*id)->fd, nByte); -} - -/* -** Return the size of the file. If the cache contains a write that extended -** the file, then return this size instead of the on-disk size. -*/ -int sqlite3OsFileSize(OsFile *id, i64 *pSize){ - int rc = sqlite3RealFileSize(&(*id)->fd, pSize); - if( rc==SQLITE_OK && pSize && *pSize<(*id)->nMaxWrite ){ - *pSize = (*id)->nMaxWrite; - } - return rc; -} - -/* -** The three functions used to open files. All that is required is to -** initialise the os_test.c specific fields and then call the corresponding -** os_unix.c function to really open the file. -*/ -int sqlite3OsOpenReadWrite(const char *zFilename, OsFile *id, int *pReadonly){ - initFile(id, zFilename); - return sqlite3RealOpenReadWrite(zFilename, &(*id)->fd, pReadonly); -} -int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ - initFile(id, zFilename); - return sqlite3RealOpenExclusive(zFilename, &(*id)->fd, delFlag); -} -int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){ - initFile(id, zFilename); - return sqlite3RealOpenReadOnly(zFilename, &(*id)->fd); -} - -/* -** These six function calls are passed straight through to the os_unix.c -** backend. -*/ -int sqlite3OsSeek(OsFile *id, i64 offset){ - return sqlite3RealSeek(&(*id)->fd, offset); -} -int sqlite3OsCheckReservedLock(OsFile *id){ - return sqlite3RealCheckReservedLock(&(*id)->fd); -} -int sqlite3OsLock(OsFile *id, int locktype){ - return sqlite3RealLock(&(*id)->fd, locktype); -} -int sqlite3OsUnlock(OsFile *id, int locktype){ - return sqlite3RealUnlock(&(*id)->fd, locktype); -} -int sqlite3OsOpenDirectory(const char *zDirname, OsFile *id){ - return sqlite3RealOpenDirectory(zDirname, &(*id)->fd); -} - -#endif /* OS_TEST */ diff --git a/ext/pdo_sqlite/sqlite/src/os_test.h b/ext/pdo_sqlite/sqlite/src/os_test.h deleted file mode 100644 index dc0a04aae2123..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_test.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -*/ -#ifndef _SQLITE_OS_TEST_H_ -#define _SQLITE_OS_TEST_H_ - -#define OsFile OsRealFile -#define OS_UNIX 1 -#include "os_unix.h" -#undef OS_UNIX -#undef OsFile -#undef SET_FULLSYNC - -/* Include sqliteInt.h now to get the type u8. */ -#include "sqliteInt.h" - -typedef struct OsTestFile* OsFile; -typedef struct OsTestFile OsTestFile; -struct OsTestFile { - u8 **apBlk; /* Array of blocks that have been written to. */ - int nBlk; /* Size of apBlock. */ - int nMaxWrite; /* Largest offset written to. */ - char *zName; /* File name */ - OsRealFile fd; - OsTestFile *pNext; -}; - -void sqlite3SetCrashParams(int iDelay, char const *zFile); - -#endif /* _SQLITE_OS_UNIX_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/os_unix.c b/ext/pdo_sqlite/sqlite/src/os_unix.c deleted file mode 100644 index f4e09b5364b4f..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_unix.c +++ /dev/null @@ -1,1460 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains code that is specific to Unix systems. -*/ -#include "sqliteInt.h" -#include "os.h" -#if OS_UNIX /* This file is used on unix only */ - - -#include <time.h> -#include <sys/time.h> -#include <errno.h> -#include <unistd.h> - -/* -** Do not include any of the File I/O interface procedures if the -** SQLITE_OMIT_DISKIO macro is defined (indicating that there database -** will be in-memory only) -*/ -#ifndef SQLITE_OMIT_DISKIO - - -/* -** Define various macros that are missing from some systems. -*/ -#ifndef O_LARGEFILE -# define O_LARGEFILE 0 -#endif -#ifdef SQLITE_DISABLE_LFS -# undef O_LARGEFILE -# define O_LARGEFILE 0 -#endif -#ifndef O_NOFOLLOW -# define O_NOFOLLOW 0 -#endif -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -/* -** The DJGPP compiler environment looks mostly like Unix, but it -** lacks the fcntl() system call. So redefine fcntl() to be something -** that always succeeds. This means that locking does not occur under -** DJGPP. But its DOS - what did you expect? -*/ -#ifdef __DJGPP__ -# define fcntl(A,B,C) 0 -#endif - -/* -** Include code that is common to all os_*.c files -*/ -#include "os_common.h" - -/* -** The threadid macro resolves to the thread-id or to 0. Used for -** testing and debugging only. -*/ -#ifdef SQLITE_UNIX_THREADS -#define threadid pthread_self() -#else -#define threadid 0 -#endif - -/* -** Set or check the OsFile.tid field. This field is set when an OsFile -** is first opened. All subsequent uses of the OsFile verify that the -** same thread is operating on the OsFile. Some operating systems do -** not allow locks to be overridden by other threads and that restriction -** means that sqlite3* database handles cannot be moved from one thread -** to another. This logic makes sure a user does not try to do that -** by mistake. -*/ -#ifdef SQLITE_UNIX_THREADS -# define SET_THREADID(X) X->tid = pthread_self() -# define CHECK_THREADID(X) (!pthread_equal(X->tid, pthread_self())) -#else -# define SET_THREADID(X) -# define CHECK_THREADID(X) 0 -#endif - -/* -** Here is the dirt on POSIX advisory locks: ANSI STD 1003.1 (1996) -** section 6.5.2.2 lines 483 through 490 specify that when a process -** sets or clears a lock, that operation overrides any prior locks set -** by the same process. It does not explicitly say so, but this implies -** that it overrides locks set by the same process using a different -** file descriptor. Consider this test case: -** -** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644); -** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); -** -** Suppose ./file1 and ./file2 are really the same file (because -** one is a hard or symbolic link to the other) then if you set -** an exclusive lock on fd1, then try to get an exclusive lock -** on fd2, it works. I would have expected the second lock to -** fail since there was already a lock on the file due to fd1. -** But not so. Since both locks came from the same process, the -** second overrides the first, even though they were on different -** file descriptors opened on different file names. -** -** Bummer. If you ask me, this is broken. Badly broken. It means -** that we cannot use POSIX locks to synchronize file access among -** competing threads of the same process. POSIX locks will work fine -** to synchronize access for threads in separate processes, but not -** threads within the same process. -** -** To work around the problem, SQLite has to manage file locks internally -** on its own. Whenever a new database is opened, we have to find the -** specific inode of the database file (the inode is determined by the -** st_dev and st_ino fields of the stat structure that fstat() fills in) -** and check for locks already existing on that inode. When locks are -** created or removed, we have to look at our own internal record of the -** locks to see if another thread has previously set a lock on that same -** inode. -** -** The OsFile structure for POSIX is no longer just an integer file -** descriptor. It is now a structure that holds the integer file -** descriptor and a pointer to a structure that describes the internal -** locks on the corresponding inode. There is one locking structure -** per inode, so if the same inode is opened twice, both OsFile structures -** point to the same locking structure. The locking structure keeps -** a reference count (so we will know when to delete it) and a "cnt" -** field that tells us its internal lock status. cnt==0 means the -** file is unlocked. cnt==-1 means the file has an exclusive lock. -** cnt>0 means there are cnt shared locks on the file. -** -** Any attempt to lock or unlock a file first checks the locking -** structure. The fcntl() system call is only invoked to set a -** POSIX lock if the internal lock structure transitions between -** a locked and an unlocked state. -** -** 2004-Jan-11: -** More recent discoveries about POSIX advisory locks. (The more -** I discover, the more I realize the a POSIX advisory locks are -** an abomination.) -** -** If you close a file descriptor that points to a file that has locks, -** all locks on that file that are owned by the current process are -** released. To work around this problem, each OsFile structure contains -** a pointer to an openCnt structure. There is one openCnt structure -** per open inode, which means that multiple OsFiles can point to a single -** openCnt. When an attempt is made to close an OsFile, if there are -** other OsFiles open on the same inode that are holding locks, the call -** to close() the file descriptor is deferred until all of the locks clear. -** The openCnt structure keeps a list of file descriptors that need to -** be closed and that list is walked (and cleared) when the last lock -** clears. -** -** First, under Linux threads, because each thread has a separate -** process ID, lock operations in one thread do not override locks -** to the same file in other threads. Linux threads behave like -** separate processes in this respect. But, if you close a file -** descriptor in linux threads, all locks are cleared, even locks -** on other threads and even though the other threads have different -** process IDs. Linux threads is inconsistent in this respect. -** (I'm beginning to think that linux threads is an abomination too.) -** The consequence of this all is that the hash table for the lockInfo -** structure has to include the process id as part of its key because -** locks in different threads are treated as distinct. But the -** openCnt structure should not include the process id in its -** key because close() clears lock on all threads, not just the current -** thread. Were it not for this goofiness in linux threads, we could -** combine the lockInfo and openCnt structures into a single structure. -** -** 2004-Jun-28: -** On some versions of linux, threads can override each others locks. -** On others not. Sometimes you can change the behavior on the same -** system by setting the LD_ASSUME_KERNEL environment variable. The -** POSIX standard is silent as to which behavior is correct, as far -** as I can tell, so other versions of unix might show the same -** inconsistency. There is no little doubt in my mind that posix -** advisory locks and linux threads are profoundly broken. -** -** To work around the inconsistencies, we have to test at runtime -** whether or not threads can override each others locks. This test -** is run once, the first time any lock is attempted. A static -** variable is set to record the results of this test for future -** use. -*/ - -/* -** An instance of the following structure serves as the key used -** to locate a particular lockInfo structure given its inode. -** -** If threads cannot override each others locks, then we set the -** lockKey.tid field to the thread ID. If threads can override -** each others locks then tid is always set to zero. tid is also -** set to zero if we compile without threading support. -*/ -struct lockKey { - dev_t dev; /* Device number */ - ino_t ino; /* Inode number */ -#ifdef SQLITE_UNIX_THREADS - pthread_t tid; /* Thread ID or zero if threads cannot override each other */ -#endif -}; - -/* -** An instance of the following structure is allocated for each open -** inode on each thread with a different process ID. (Threads have -** different process IDs on linux, but not on most other unixes.) -** -** A single inode can have multiple file descriptors, so each OsFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of OsFiles pointing to it. -*/ -struct lockInfo { - struct lockKey key; /* The lookup key */ - int cnt; /* Number of SHARED locks held */ - int locktype; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ - int nRef; /* Number of pointers to this structure */ -}; - -/* -** An instance of the following structure serves as the key used -** to locate a particular openCnt structure given its inode. This -** is the same as the lockKey except that the thread ID is omitted. -*/ -struct openKey { - dev_t dev; /* Device number */ - ino_t ino; /* Inode number */ -}; - -/* -** An instance of the following structure is allocated for each open -** inode. This structure keeps track of the number of locks on that -** inode. If a close is attempted against an inode that is holding -** locks, the close is deferred until all locks clear by adding the -** file descriptor to be closed to the pending list. -*/ -struct openCnt { - struct openKey key; /* The lookup key */ - int nRef; /* Number of pointers to this structure */ - int nLock; /* Number of outstanding locks */ - int nPending; /* Number of pending close() operations */ - int *aPending; /* Malloced space holding fd's awaiting a close() */ -}; - -/* -** These hash table maps inodes and process IDs into lockInfo and openCnt -** structures. Access to these hash tables must be protected by a mutex. -*/ -static Hash lockHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; -static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; - - -#ifdef SQLITE_UNIX_THREADS -/* -** This variable records whether or not threads can override each others -** locks. -** -** 0: No. Threads cannot override each others locks. -** 1: Yes. Threads can override each others locks. -** -1: We don't know yet. -*/ -static int threadsOverrideEachOthersLocks = -1; - -/* -** This structure holds information passed into individual test -** threads by the testThreadLockingBehavior() routine. -*/ -struct threadTestData { - int fd; /* File to be locked */ - struct flock lock; /* The locking operation */ - int result; /* Result of the locking operation */ -}; - -#ifdef SQLITE_LOCK_TRACE -/* -** Print out information about all locking operations. -** -** This routine is used for troubleshooting locks on multithreaded -** platforms. Enable by compiling with the -DSQLITE_LOCK_TRACE -** command-line option on the compiler. This code is normally -** turnned off. -*/ -static int lockTrace(int fd, int op, struct flock *p){ - char *zOpName, *zType; - int s; - int savedErrno; - if( op==F_GETLK ){ - zOpName = "GETLK"; - }else if( op==F_SETLK ){ - zOpName = "SETLK"; - }else{ - s = fcntl(fd, op, p); - sqlite3DebugPrintf("fcntl unknown %d %d %d\n", fd, op, s); - return s; - } - if( p->l_type==F_RDLCK ){ - zType = "RDLCK"; - }else if( p->l_type==F_WRLCK ){ - zType = "WRLCK"; - }else if( p->l_type==F_UNLCK ){ - zType = "UNLCK"; - }else{ - assert( 0 ); - } - assert( p->l_whence==SEEK_SET ); - s = fcntl(fd, op, p); - savedErrno = errno; - sqlite3DebugPrintf("fcntl %d %d %s %s %d %d %d %d\n", - threadid, fd, zOpName, zType, (int)p->l_start, (int)p->l_len, - (int)p->l_pid, s); - if( s && op==F_SETLK && (p->l_type==F_RDLCK || p->l_type==F_WRLCK) ){ - struct flock l2; - l2 = *p; - fcntl(fd, F_GETLK, &l2); - if( l2.l_type==F_RDLCK ){ - zType = "RDLCK"; - }else if( l2.l_type==F_WRLCK ){ - zType = "WRLCK"; - }else if( l2.l_type==F_UNLCK ){ - zType = "UNLCK"; - }else{ - assert( 0 ); - } - sqlite3DebugPrintf("fcntl-failure-reason: %s %d %d %d\n", - zType, (int)l2.l_start, (int)l2.l_len, (int)l2.l_pid); - } - errno = savedErrno; - return s; -} -#define fcntl lockTrace -#endif /* SQLITE_LOCK_TRACE */ - -/* -** The testThreadLockingBehavior() routine launches two separate -** threads on this routine. This routine attempts to lock a file -** descriptor then returns. The success or failure of that attempt -** allows the testThreadLockingBehavior() procedure to determine -** whether or not threads can override each others locks. -*/ -static void *threadLockingTest(void *pArg){ - struct threadTestData *pData = (struct threadTestData*)pArg; - pData->result = fcntl(pData->fd, F_SETLK, &pData->lock); - return pArg; -} - -/* -** This procedure attempts to determine whether or not threads -** can override each others locks then sets the -** threadsOverrideEachOthersLocks variable appropriately. -*/ -static void testThreadLockingBehavior(fd_orig){ - int fd; - struct threadTestData d[2]; - pthread_t t[2]; - - fd = dup(fd_orig); - if( fd<0 ) return; - memset(d, 0, sizeof(d)); - d[0].fd = fd; - d[0].lock.l_type = F_RDLCK; - d[0].lock.l_len = 1; - d[0].lock.l_start = 0; - d[0].lock.l_whence = SEEK_SET; - d[1] = d[0]; - d[1].lock.l_type = F_WRLCK; - pthread_create(&t[0], 0, threadLockingTest, &d[0]); - pthread_create(&t[1], 0, threadLockingTest, &d[1]); - pthread_join(t[0], 0); - pthread_join(t[1], 0); - close(fd); - threadsOverrideEachOthersLocks = d[0].result==0 && d[1].result==0; -} -#endif /* SQLITE_UNIX_THREADS */ - -/* -** Release a lockInfo structure previously allocated by findLockInfo(). -*/ -static void releaseLockInfo(struct lockInfo *pLock){ - pLock->nRef--; - if( pLock->nRef==0 ){ - sqlite3HashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0); - sqliteFree(pLock); - } -} - -/* -** Release a openCnt structure previously allocated by findLockInfo(). -*/ -static void releaseOpenCnt(struct openCnt *pOpen){ - pOpen->nRef--; - if( pOpen->nRef==0 ){ - sqlite3HashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0); - sqliteFree(pOpen->aPending); - sqliteFree(pOpen); - } -} - -/* -** Given a file descriptor, locate lockInfo and openCnt structures that -** describes that file descriptor. Create a new ones if necessary. The -** return values might be unset if an error occurs. -** -** Return the number of errors. -*/ -static int findLockInfo( - int fd, /* The file descriptor used in the key */ - struct lockInfo **ppLock, /* Return the lockInfo structure here */ - struct openCnt **ppOpen /* Return the openCnt structure here */ -){ - int rc; - struct lockKey key1; - struct openKey key2; - struct stat statbuf; - struct lockInfo *pLock; - struct openCnt *pOpen; - rc = fstat(fd, &statbuf); - if( rc!=0 ) return 1; - memset(&key1, 0, sizeof(key1)); - key1.dev = statbuf.st_dev; - key1.ino = statbuf.st_ino; -#ifdef SQLITE_UNIX_THREADS - if( threadsOverrideEachOthersLocks<0 ){ - testThreadLockingBehavior(fd); - } - key1.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self(); -#endif - memset(&key2, 0, sizeof(key2)); - key2.dev = statbuf.st_dev; - key2.ino = statbuf.st_ino; - pLock = (struct lockInfo*)sqlite3HashFind(&lockHash, &key1, sizeof(key1)); - if( pLock==0 ){ - struct lockInfo *pOld; - pLock = sqliteMallocRaw( sizeof(*pLock) ); - if( pLock==0 ) return 1; - pLock->key = key1; - pLock->nRef = 1; - pLock->cnt = 0; - pLock->locktype = 0; - pOld = sqlite3HashInsert(&lockHash, &pLock->key, sizeof(key1), pLock); - if( pOld!=0 ){ - assert( pOld==pLock ); - sqliteFree(pLock); - return 1; - } - }else{ - pLock->nRef++; - } - *ppLock = pLock; - pOpen = (struct openCnt*)sqlite3HashFind(&openHash, &key2, sizeof(key2)); - if( pOpen==0 ){ - struct openCnt *pOld; - pOpen = sqliteMallocRaw( sizeof(*pOpen) ); - if( pOpen==0 ){ - releaseLockInfo(pLock); - return 1; - } - pOpen->key = key2; - pOpen->nRef = 1; - pOpen->nLock = 0; - pOpen->nPending = 0; - pOpen->aPending = 0; - pOld = sqlite3HashInsert(&openHash, &pOpen->key, sizeof(key2), pOpen); - if( pOld!=0 ){ - assert( pOld==pOpen ); - sqliteFree(pOpen); - releaseLockInfo(pLock); - return 1; - } - }else{ - pOpen->nRef++; - } - *ppOpen = pOpen; - return 0; -} - -/* -** Delete the named file -*/ -int sqlite3OsDelete(const char *zFilename){ - unlink(zFilename); - return SQLITE_OK; -} - -/* -** Return TRUE if the named file exists. -*/ -int sqlite3OsFileExists(const char *zFilename){ - return access(zFilename, 0)==0; -} - -/* -** Attempt to open a file for both reading and writing. If that -** fails, try opening it read-only. If the file does not exist, -** try to create it. -** -** On success, a handle for the open file is written to *id -** and *pReadonly is set to 0 if the file was opened for reading and -** writing or 1 if the file was opened read-only. The function returns -** SQLITE_OK. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id and *pReadonly unchanged. -*/ -int sqlite3OsOpenReadWrite( - const char *zFilename, - OsFile *id, - int *pReadonly -){ - int rc; - assert( !id->isOpen ); - id->dirfd = -1; - SET_THREADID(id); - id->h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, - SQLITE_DEFAULT_FILE_PERMISSIONS); - if( id->h<0 ){ -#ifdef EISDIR - if( errno==EISDIR ){ - return SQLITE_CANTOPEN; - } -#endif - id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); - if( id->h<0 ){ - return SQLITE_CANTOPEN; - } - *pReadonly = 1; - }else{ - *pReadonly = 0; - } - sqlite3OsEnterMutex(); - rc = findLockInfo(id->h, &id->pLock, &id->pOpen); - sqlite3OsLeaveMutex(); - if( rc ){ - close(id->h); - return SQLITE_NOMEM; - } - id->locktype = 0; - id->isOpen = 1; - TRACE3("OPEN %-3d %s\n", id->h, zFilename); - OpenCounter(+1); - return SQLITE_OK; -} - - -/* -** Attempt to open a new file for exclusive access by this process. -** The file will be opened for both reading and writing. To avoid -** a potential security problem, we do not allow the file to have -** previously existed. Nor do we allow the file to be a symbolic -** link. -** -** If delFlag is true, then make arrangements to automatically delete -** the file when it is closed. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ - int rc; - assert( !id->isOpen ); - if( access(zFilename, 0)==0 ){ - return SQLITE_CANTOPEN; - } - SET_THREADID(id); - id->dirfd = -1; - id->h = open(zFilename, - O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY, - SQLITE_DEFAULT_FILE_PERMISSIONS); - if( id->h<0 ){ - return SQLITE_CANTOPEN; - } - sqlite3OsEnterMutex(); - rc = findLockInfo(id->h, &id->pLock, &id->pOpen); - sqlite3OsLeaveMutex(); - if( rc ){ - close(id->h); - unlink(zFilename); - return SQLITE_NOMEM; - } - id->locktype = 0; - id->isOpen = 1; - if( delFlag ){ - unlink(zFilename); - } - TRACE3("OPEN-EX %-3d %s\n", id->h, zFilename); - OpenCounter(+1); - return SQLITE_OK; -} - -/* -** Attempt to open a new file for read-only access. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){ - int rc; - assert( !id->isOpen ); - SET_THREADID(id); - id->dirfd = -1; - id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); - if( id->h<0 ){ - return SQLITE_CANTOPEN; - } - sqlite3OsEnterMutex(); - rc = findLockInfo(id->h, &id->pLock, &id->pOpen); - sqlite3OsLeaveMutex(); - if( rc ){ - close(id->h); - return SQLITE_NOMEM; - } - id->locktype = 0; - id->isOpen = 1; - TRACE3("OPEN-RO %-3d %s\n", id->h, zFilename); - OpenCounter(+1); - return SQLITE_OK; -} - -/* -** Attempt to open a file descriptor for the directory that contains a -** file. This file descriptor can be used to fsync() the directory -** in order to make sure the creation of a new file is actually written -** to disk. -** -** This routine is only meaningful for Unix. It is a no-op under -** windows since windows does not support hard links. -** -** On success, a handle for a previously open file is at *id is -** updated with the new directory file descriptor and SQLITE_OK is -** returned. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id unchanged. -*/ -int sqlite3OsOpenDirectory( - const char *zDirname, - OsFile *id -){ - if( !id->isOpen ){ - /* Do not open the directory if the corresponding file is not already - ** open. */ - return SQLITE_CANTOPEN; - } - SET_THREADID(id); - assert( id->dirfd<0 ); - id->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0); - if( id->dirfd<0 ){ - return SQLITE_CANTOPEN; - } - TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname); - return SQLITE_OK; -} - -/* -** If the following global variable points to a string which is the -** name of a directory, then that directory will be used to store -** temporary files. -*/ -char *sqlite3_temp_directory = 0; - -/* -** Create a temporary file name in zBuf. zBuf must be big enough to -** hold at least SQLITE_TEMPNAME_SIZE characters. -*/ -int sqlite3OsTempFileName(char *zBuf){ - static const char *azDirs[] = { - 0, - "/var/tmp", - "/usr/tmp", - "/tmp", - ".", - }; - static const unsigned char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789"; - int i, j; - struct stat buf; - const char *zDir = "."; - azDirs[0] = sqlite3_temp_directory; - for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){ - if( azDirs[i]==0 ) continue; - if( stat(azDirs[i], &buf) ) continue; - if( !S_ISDIR(buf.st_mode) ) continue; - if( access(azDirs[i], 07) ) continue; - zDir = azDirs[i]; - break; - } - do{ - sprintf(zBuf, "%s/"TEMP_FILE_PREFIX, zDir); - j = strlen(zBuf); - sqlite3Randomness(15, &zBuf[j]); - for(i=0; i<15; i++, j++){ - zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; - } - zBuf[j] = 0; - }while( access(zBuf,0)==0 ); - return SQLITE_OK; -} - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -/* -** Check that a given pathname is a directory and is writable -** -*/ -int sqlite3OsIsDirWritable(char *zBuf){ - struct stat buf; - if( zBuf==0 ) return 0; - if( zBuf[0]==0 ) return 0; - if( stat(zBuf, &buf) ) return 0; - if( !S_ISDIR(buf.st_mode) ) return 0; - if( access(zBuf, 07) ) return 0; - return 1; -} -#endif /* SQLITE_OMIT_PAGER_PRAGMAS */ - -/* -** Read data from a file into a buffer. Return SQLITE_OK if all -** bytes were read successfully and SQLITE_IOERR if anything goes -** wrong. -*/ -int sqlite3OsRead(OsFile *id, void *pBuf, int amt){ - int got; - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - TIMER_START; - got = read(id->h, pBuf, amt); - TIMER_END; - TRACE5("READ %-3d %5d %7d %d\n", id->h, got, last_page, TIMER_ELAPSED); - SEEK(0); - /* if( got<0 ) got = 0; */ - if( got==amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -} - -/* -** Write data from a buffer into a file. Return SQLITE_OK on success -** or some other error code on failure. -*/ -int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){ - int wrote = 0; - assert( id->isOpen ); - assert( amt>0 ); - SimulateIOError(SQLITE_IOERR); - SimulateDiskfullError; - TIMER_START; - while( amt>0 && (wrote = write(id->h, pBuf, amt))>0 ){ - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - TIMER_END; - TRACE5("WRITE %-3d %5d %7d %d\n", id->h, wrote, last_page, TIMER_ELAPSED); - SEEK(0); - if( amt>0 ){ - return SQLITE_FULL; - } - return SQLITE_OK; -} - -/* -** Move the read/write pointer in a file. -*/ -int sqlite3OsSeek(OsFile *id, i64 offset){ - assert( id->isOpen ); - SEEK(offset/1024 + 1); -#ifdef SQLITE_TEST - if( offset ) SimulateDiskfullError -#endif - lseek(id->h, offset, SEEK_SET); - return SQLITE_OK; -} - -#ifdef SQLITE_TEST -/* -** Count the number of fullsyncs and normal syncs. This is used to test -** that syncs and fullsyncs are occuring at the right times. -*/ -int sqlite3_sync_count = 0; -int sqlite3_fullsync_count = 0; -#endif - - -/* -** The fsync() system call does not work as advertised on many -** unix systems. The following procedure is an attempt to make -** it work better. -** -** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful -** for testing when we want to run through the test suite quickly. -** You are strongly advised *not* to deploy with SQLITE_NO_SYNC -** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash -** or power failure will likely corrupt the database file. -*/ -static int full_fsync(int fd, int fullSync, int dataOnly){ - int rc; - - /* Record the number of times that we do a normal fsync() and - ** FULLSYNC. This is used during testing to verify that this procedure - ** gets called with the correct arguments. - */ -#ifdef SQLITE_TEST - if( fullSync ) sqlite3_fullsync_count++; - sqlite3_sync_count++; -#endif - - /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a - ** no-op - */ -#ifdef SQLITE_NO_SYNC - rc = SQLITE_OK; -#else - -#ifdef F_FULLFSYNC - if( fullSync ){ - rc = fcntl(fd, F_FULLFSYNC, 0); - }else{ - rc = 1; - } - /* If the FULLSYNC failed, try to do a normal fsync() */ - if( rc ) rc = fsync(fd); - -#else /* if !defined(F_FULLSYNC) */ -#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0 - if( dataOnly ){ - rc = fdatasync(fd); - }else -#endif /* _POSIX_SYNCHRONIZED_IO > 0 */ - { - rc = fsync(fd); - } -#endif /* defined(F_FULLFSYNC) */ -#endif /* defined(SQLITE_NO_SYNC) */ - - return rc; -} - -/* -** Make sure all writes to a particular file are committed to disk. -** -** If dataOnly==0 then both the file itself and its metadata (file -** size, access time, etc) are synced. If dataOnly!=0 then only the -** file data is synced. -** -** Under Unix, also make sure that the directory entry for the file -** has been created by fsync-ing the directory that contains the file. -** If we do not do this and we encounter a power failure, the directory -** entry for the journal might not exist after we reboot. The next -** SQLite to access the file will not know that the journal exists (because -** the directory entry for the journal was never created) and the transaction -** will not roll back - possibly leading to database corruption. -*/ -int sqlite3OsSync(OsFile *id, int dataOnly){ - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - TRACE2("SYNC %-3d\n", id->h); - if( full_fsync(id->h, id->fullSync, dataOnly) ){ - return SQLITE_IOERR; - } - if( id->dirfd>=0 ){ - TRACE2("DIRSYNC %-3d\n", id->dirfd); - full_fsync(id->dirfd, id->fullSync, 0); - close(id->dirfd); /* Only need to sync once, so close the directory */ - id->dirfd = -1; /* when we are done. */ - } - return SQLITE_OK; -} - -/* -** Sync the directory zDirname. This is a no-op on operating systems other -** than UNIX. -** -** This is used to make sure the master journal file has truely been deleted -** before making changes to individual journals on a multi-database commit. -** The F_FULLFSYNC option is not needed here. -*/ -int sqlite3OsSyncDirectory(const char *zDirname){ - int fd; - int r; - SimulateIOError(SQLITE_IOERR); - fd = open(zDirname, O_RDONLY|O_BINARY, 0); - TRACE3("DIRSYNC %-3d (%s)\n", fd, zDirname); - if( fd<0 ){ - return SQLITE_CANTOPEN; - } - r = fsync(fd); - close(fd); - return ((r==0)?SQLITE_OK:SQLITE_IOERR); -} - -/* -** Truncate an open file to a specified size -*/ -int sqlite3OsTruncate(OsFile *id, i64 nByte){ - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - return ftruncate(id->h, nByte)==0 ? SQLITE_OK : SQLITE_IOERR; -} - -/* -** Determine the current size of a file in bytes -*/ -int sqlite3OsFileSize(OsFile *id, i64 *pSize){ - struct stat buf; - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - if( fstat(id->h, &buf)!=0 ){ - return SQLITE_IOERR; - } - *pSize = buf.st_size; - return SQLITE_OK; -} - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, return -** non-zero. If the file is unlocked or holds only SHARED locks, then -** return zero. -*/ -int sqlite3OsCheckReservedLock(OsFile *id){ - int r = 0; - - assert( id->isOpen ); - if( CHECK_THREADID(id) ) return SQLITE_MISUSE; - sqlite3OsEnterMutex(); /* Needed because id->pLock is shared across threads */ - - /* Check if a thread in this process holds such a lock */ - if( id->pLock->locktype>SHARED_LOCK ){ - r = 1; - } - - /* Otherwise see if some other process holds it. - */ - if( !r ){ - struct flock lock; - lock.l_whence = SEEK_SET; - lock.l_start = RESERVED_BYTE; - lock.l_len = 1; - lock.l_type = F_WRLCK; - fcntl(id->h, F_GETLK, &lock); - if( lock.l_type!=F_UNLCK ){ - r = 1; - } - } - - sqlite3OsLeaveMutex(); - TRACE3("TEST WR-LOCK %d %d\n", id->h, r); - - return r; -} - -#ifdef SQLITE_DEBUG -/* -** Helper function for printing out trace information from debugging -** binaries. This returns the string represetation of the supplied -** integer lock-type. -*/ -static const char * locktypeName(int locktype){ - switch( locktype ){ - case NO_LOCK: return "NONE"; - case SHARED_LOCK: return "SHARED"; - case RESERVED_LOCK: return "RESERVED"; - case PENDING_LOCK: return "PENDING"; - case EXCLUSIVE_LOCK: return "EXCLUSIVE"; - } - return "ERROR"; -} -#endif - -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -*/ -int sqlite3OsLock(OsFile *id, int locktype){ - /* The following describes the implementation of the various locks and - ** lock transitions in terms of the POSIX advisory shared and exclusive - ** lock primitives (called read-locks and write-locks below, to avoid - ** confusion with SQLite lock names). The algorithms are complicated - ** slightly in order to be compatible with windows systems simultaneously - ** accessing the same database file, in case that is ever required. - ** - ** Symbols defined in os.h indentify the 'pending byte' and the 'reserved - ** byte', each single bytes at well known offsets, and the 'shared byte - ** range', a range of 510 bytes at a well known offset. - ** - ** To obtain a SHARED lock, a read-lock is obtained on the 'pending - ** byte'. If this is successful, a random byte from the 'shared byte - ** range' is read-locked and the lock on the 'pending byte' released. - ** - ** A process may only obtain a RESERVED lock after it has a SHARED lock. - ** A RESERVED lock is implemented by grabbing a write-lock on the - ** 'reserved byte'. - ** - ** A process may only obtain a PENDING lock after it has obtained a - ** SHARED lock. A PENDING lock is implemented by obtaining a write-lock - ** on the 'pending byte'. This ensures that no new SHARED locks can be - ** obtained, but existing SHARED locks are allowed to persist. A process - ** does not have to obtain a RESERVED lock on the way to a PENDING lock. - ** This property is used by the algorithm for rolling back a journal file - ** after a crash. - ** - ** An EXCLUSIVE lock, obtained after a PENDING lock is held, is - ** implemented by obtaining a write-lock on the entire 'shared byte - ** range'. Since all other locks require a read-lock on one of the bytes - ** within this range, this ensures that no other locks are held on the - ** database. - ** - ** The reason a single byte cannot be used instead of the 'shared byte - ** range' is that some versions of windows do not support read-locks. By - ** locking a random byte from a range, concurrent SHARED locks may exist - ** even if the locking primitive used is always a write-lock. - */ - int rc = SQLITE_OK; - struct lockInfo *pLock = id->pLock; - struct flock lock; - int s; - - assert( id->isOpen ); - TRACE7("LOCK %d %s was %s(%s,%d) pid=%d\n", id->h, locktypeName(locktype), - locktypeName(id->locktype), locktypeName(pLock->locktype), pLock->cnt - ,getpid() ); - if( CHECK_THREADID(id) ) return SQLITE_MISUSE; - - /* If there is already a lock of this type or more restrictive on the - ** OsFile, do nothing. Don't use the end_lock: exit path, as - ** sqlite3OsEnterMutex() hasn't been called yet. - */ - if( id->locktype>=locktype ){ - TRACE3("LOCK %d %s ok (already held)\n", id->h, locktypeName(locktype)); - return SQLITE_OK; - } - - /* Make sure the locking sequence is correct - */ - assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK ); - assert( locktype!=PENDING_LOCK ); - assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK ); - - /* This mutex is needed because id->pLock is shared across threads - */ - sqlite3OsEnterMutex(); - - /* If some thread using this PID has a lock via a different OsFile* - ** handle that precludes the requested lock, return BUSY. - */ - if( (id->locktype!=pLock->locktype && - (pLock->locktype>=PENDING_LOCK || locktype>SHARED_LOCK)) - ){ - rc = SQLITE_BUSY; - goto end_lock; - } - - /* If a SHARED lock is requested, and some thread using this PID already - ** has a SHARED or RESERVED lock, then increment reference counts and - ** return SQLITE_OK. - */ - if( locktype==SHARED_LOCK && - (pLock->locktype==SHARED_LOCK || pLock->locktype==RESERVED_LOCK) ){ - assert( locktype==SHARED_LOCK ); - assert( id->locktype==0 ); - assert( pLock->cnt>0 ); - id->locktype = SHARED_LOCK; - pLock->cnt++; - id->pOpen->nLock++; - goto end_lock; - } - - lock.l_len = 1L; - - lock.l_whence = SEEK_SET; - - /* A PENDING lock is needed before acquiring a SHARED lock and before - ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will - ** be released. - */ - if( locktype==SHARED_LOCK - || (locktype==EXCLUSIVE_LOCK && id->locktype<PENDING_LOCK) - ){ - lock.l_type = (locktype==SHARED_LOCK?F_RDLCK:F_WRLCK); - lock.l_start = PENDING_BYTE; - s = fcntl(id->h, F_SETLK, &lock); - if( s ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - goto end_lock; - } - } - - - /* If control gets to this point, then actually go ahead and make - ** operating system calls for the specified lock. - */ - if( locktype==SHARED_LOCK ){ - assert( pLock->cnt==0 ); - assert( pLock->locktype==0 ); - - /* Now get the read-lock */ - lock.l_start = SHARED_FIRST; - lock.l_len = SHARED_SIZE; - s = fcntl(id->h, F_SETLK, &lock); - - /* Drop the temporary PENDING lock */ - lock.l_start = PENDING_BYTE; - lock.l_len = 1L; - lock.l_type = F_UNLCK; - if( fcntl(id->h, F_SETLK, &lock)!=0 ){ - rc = SQLITE_IOERR; /* This should never happen */ - goto end_lock; - } - if( s ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - }else{ - id->locktype = SHARED_LOCK; - id->pOpen->nLock++; - pLock->cnt = 1; - } - }else if( locktype==EXCLUSIVE_LOCK && pLock->cnt>1 ){ - /* We are trying for an exclusive lock but another thread in this - ** same process is still holding a shared lock. */ - rc = SQLITE_BUSY; - }else{ - /* The request was for a RESERVED or EXCLUSIVE lock. It is - ** assumed that there is a SHARED or greater lock on the file - ** already. - */ - assert( 0!=id->locktype ); - lock.l_type = F_WRLCK; - switch( locktype ){ - case RESERVED_LOCK: - lock.l_start = RESERVED_BYTE; - break; - case EXCLUSIVE_LOCK: - lock.l_start = SHARED_FIRST; - lock.l_len = SHARED_SIZE; - break; - default: - assert(0); - } - s = fcntl(id->h, F_SETLK, &lock); - if( s ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - } - } - - if( rc==SQLITE_OK ){ - id->locktype = locktype; - pLock->locktype = locktype; - }else if( locktype==EXCLUSIVE_LOCK ){ - id->locktype = PENDING_LOCK; - pLock->locktype = PENDING_LOCK; - } - -end_lock: - sqlite3OsLeaveMutex(); - TRACE4("LOCK %d %s %s\n", id->h, locktypeName(locktype), - rc==SQLITE_OK ? "ok" : "failed"); - return rc; -} - -/* -** Lower the locking level on file descriptor id to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -** -** It is not possible for this routine to fail if the second argument -** is NO_LOCK. If the second argument is SHARED_LOCK, this routine -** might return SQLITE_IOERR instead of SQLITE_OK. -*/ -int sqlite3OsUnlock(OsFile *id, int locktype){ - struct lockInfo *pLock; - struct flock lock; - int rc = SQLITE_OK; - - assert( id->isOpen ); - TRACE7("UNLOCK %d %d was %d(%d,%d) pid=%d\n", id->h, locktype, id->locktype, - id->pLock->locktype, id->pLock->cnt, getpid()); - if( CHECK_THREADID(id) ) return SQLITE_MISUSE; - - assert( locktype<=SHARED_LOCK ); - if( id->locktype<=locktype ){ - return SQLITE_OK; - } - sqlite3OsEnterMutex(); - pLock = id->pLock; - assert( pLock->cnt!=0 ); - if( id->locktype>SHARED_LOCK ){ - assert( pLock->locktype==id->locktype ); - if( locktype==SHARED_LOCK ){ - lock.l_type = F_RDLCK; - lock.l_whence = SEEK_SET; - lock.l_start = SHARED_FIRST; - lock.l_len = SHARED_SIZE; - if( fcntl(id->h, F_SETLK, &lock)!=0 ){ - /* This should never happen */ - rc = SQLITE_IOERR; - } - } - lock.l_type = F_UNLCK; - lock.l_whence = SEEK_SET; - lock.l_start = PENDING_BYTE; - lock.l_len = 2L; assert( PENDING_BYTE+1==RESERVED_BYTE ); - if( fcntl(id->h, F_SETLK, &lock)==0 ){ - pLock->locktype = SHARED_LOCK; - }else{ - rc = SQLITE_IOERR; /* This should never happen */ - } - } - if( locktype==NO_LOCK ){ - struct openCnt *pOpen; - - /* Decrement the shared lock counter. Release the lock using an - ** OS call only when all threads in this same process have released - ** the lock. - */ - pLock->cnt--; - if( pLock->cnt==0 ){ - lock.l_type = F_UNLCK; - lock.l_whence = SEEK_SET; - lock.l_start = lock.l_len = 0L; - if( fcntl(id->h, F_SETLK, &lock)==0 ){ - pLock->locktype = NO_LOCK; - }else{ - rc = SQLITE_IOERR; /* This should never happen */ - } - } - - /* Decrement the count of locks against this same file. When the - ** count reaches zero, close any other file descriptors whose close - ** was deferred because of outstanding locks. - */ - pOpen = id->pOpen; - pOpen->nLock--; - assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 && pOpen->nPending>0 ){ - int i; - for(i=0; i<pOpen->nPending; i++){ - close(pOpen->aPending[i]); - } - sqliteFree(pOpen->aPending); - pOpen->nPending = 0; - pOpen->aPending = 0; - } - } - sqlite3OsLeaveMutex(); - id->locktype = locktype; - return rc; -} - -/* -** Close a file. -*/ -int sqlite3OsClose(OsFile *id){ - if( !id->isOpen ) return SQLITE_OK; - if( CHECK_THREADID(id) ) return SQLITE_MISUSE; - sqlite3OsUnlock(id, NO_LOCK); - if( id->dirfd>=0 ) close(id->dirfd); - id->dirfd = -1; - sqlite3OsEnterMutex(); - if( id->pOpen->nLock ){ - /* If there are outstanding locks, do not actually close the file just - ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->aPending. It will be automatically closed when - ** the last lock is cleared. - */ - int *aNew; - struct openCnt *pOpen = id->pOpen; - aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) ); - if( aNew==0 ){ - /* If a malloc fails, just leak the file descriptor */ - }else{ - pOpen->aPending = aNew; - pOpen->aPending[pOpen->nPending] = id->h; - pOpen->nPending++; - } - }else{ - /* There are no outstanding locks so we can close the file immediately */ - close(id->h); - } - releaseLockInfo(id->pLock); - releaseOpenCnt(id->pOpen); - sqlite3OsLeaveMutex(); - id->isOpen = 0; - TRACE2("CLOSE %-3d\n", id->h); - OpenCounter(-1); - return SQLITE_OK; -} - -/* -** Turn a relative pathname into a full pathname. Return a pointer -** to the full pathname stored in space obtained from sqliteMalloc(). -** The calling function is responsible for freeing this space once it -** is no longer needed. -*/ -char *sqlite3OsFullPathname(const char *zRelative){ - char *zFull = 0; - if( zRelative[0]=='/' ){ - sqlite3SetString(&zFull, zRelative, (char*)0); - }else{ - char *zBuf = sqliteMalloc(5000); - if( zBuf==0 ){ - return 0; - } - zBuf[0] = 0; - sqlite3SetString(&zFull, getcwd(zBuf, 5000), "/", zRelative, - (char*)0); - sqliteFree(zBuf); - } - return zFull; -} - - -#endif /* SQLITE_OMIT_DISKIO */ -/*************************************************************************** -** Everything above deals with file I/O. Everything that follows deals -** with other miscellanous aspects of the operating system interface -****************************************************************************/ - - -/* -** Get information to seed the random number generator. The seed -** is written into the buffer zBuf[256]. The calling function must -** supply a sufficiently large buffer. -*/ -int sqlite3OsRandomSeed(char *zBuf){ - /* We have to initialize zBuf to prevent valgrind from reporting - ** errors. The reports issued by valgrind are incorrect - we would - ** prefer that the randomness be increased by making use of the - ** uninitialized space in zBuf - but valgrind errors tend to worry - ** some users. Rather than argue, it seems easier just to initialize - ** the whole array and silence valgrind, even if that means less randomness - ** in the random seed. - ** - ** When testing, initializing zBuf[] to zero is all we do. That means - ** that we always use the same random number sequence.* This makes the - ** tests repeatable. - */ - memset(zBuf, 0, 256); -#if !defined(SQLITE_TEST) - { - int pid, fd; - fd = open("/dev/urandom", O_RDONLY); - if( fd<0 ){ - time((time_t*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); - }else{ - read(fd, zBuf, 256); - close(fd); - } - } -#endif - return SQLITE_OK; -} - -/* -** Sleep for a little while. Return the amount of time slept. -*/ -int sqlite3OsSleep(int ms){ -#if defined(HAVE_USLEEP) && HAVE_USLEEP - usleep(ms*1000); - return ms; -#else - sleep((ms+999)/1000); - return 1000*((ms+999)/1000); -#endif -} - -/* -** Static variables used for thread synchronization -*/ -static int inMutex = 0; -#ifdef SQLITE_UNIX_THREADS -static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -#endif - -/* -** The following pair of routine implement mutual exclusion for -** multi-threaded processes. Only a single thread is allowed to -** executed code that is surrounded by EnterMutex() and LeaveMutex(). -** -** SQLite uses only a single Mutex. There is not much critical -** code and what little there is executes quickly and without blocking. -*/ -void sqlite3OsEnterMutex(){ -#ifdef SQLITE_UNIX_THREADS - pthread_mutex_lock(&mutex); -#endif - assert( !inMutex ); - inMutex = 1; -} -void sqlite3OsLeaveMutex(){ - assert( inMutex ); - inMutex = 0; -#ifdef SQLITE_UNIX_THREADS - pthread_mutex_unlock(&mutex); -#endif -} - -/* -** The following variable, if set to a non-zero value, becomes the result -** returned from sqlite3OsCurrentTime(). This is used for testing. -*/ -#ifdef SQLITE_TEST -int sqlite3_current_time = 0; -#endif - -/* -** Find the current time (in Universal Coordinated Time). Write the -** current time and date as a Julian Day number into *prNow and -** return 0. Return 1 if the time and date cannot be found. -*/ -int sqlite3OsCurrentTime(double *prNow){ -#ifdef NO_GETTOD - time_t t; - time(&t); - *prNow = t/86400.0 + 2440587.5; -#else - struct timeval sNow; - struct timezone sTz; /* Not used */ - gettimeofday(&sNow, &sTz); - *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_usec/86400000000.0; -#endif -#ifdef SQLITE_TEST - if( sqlite3_current_time ){ - *prNow = sqlite3_current_time/86400.0 + 2440587.5; - } -#endif - return 0; -} - -#endif /* OS_UNIX */ diff --git a/ext/pdo_sqlite/sqlite/src/os_unix.h b/ext/pdo_sqlite/sqlite/src/os_unix.h deleted file mode 100644 index 5fdfc2ff4ce17..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_unix.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file defined OS-specific features for Unix. -*/ -#ifndef _SQLITE_OS_UNIX_H_ -#define _SQLITE_OS_UNIX_H_ - -/* -** Helpful hint: To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE -** to the compiler command line. -*/ - -/* -** These #defines should enable >2GB file support on Posix if the -** underlying operating system supports it. If the OS lacks -** large file support, or if the OS is windows, these should be no-ops. -** -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch -** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: RedHat 7.2) but you want your code to work -** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 -** without this option, LFS is enable. But LFS does not exist in the kernel -** in RedHat 6.0, so the code won't work. Hence, for maximum binary -** portability you should omit LFS. -** -** Similar is true for MacOS. LFS is only supported on MacOS 9 and later. -*/ -#ifndef SQLITE_DISABLE_LFS -# define _LARGE_FILE 1 -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# define _LARGEFILE_SOURCE 1 -#endif - -/* -** standard include files. -*/ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> - -/* -** Macros used to determine whether or not to use threads. The -** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for -** Posix threads and SQLITE_W32_THREADS is defined if we are -** synchronizing using Win32 threads. -*/ -#if defined(THREADSAFE) && THREADSAFE -# include <pthread.h> -# define SQLITE_UNIX_THREADS 1 -#endif - -/* -** The OsFile structure is a operating-system independing representation -** of an open file handle. It is defined differently for each architecture. -** -** This is the definition for Unix. -** -** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK, -** PENDING_LOCK or EXCLUSIVE_LOCK. -*/ -typedef struct OsFile OsFile; -struct OsFile { - struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */ - struct openCnt *pOpen; /* Info about all open fd's on this inode */ - struct lockInfo *pLock; /* Info about locks on this inode */ - int h; /* The file descriptor */ - unsigned char locktype; /* The type of lock held on this fd */ - unsigned char isOpen; /* True if needs to be closed */ - unsigned char fullSync; /* Use F_FULLSYNC if available */ - int dirfd; /* File descriptor for the directory */ -#ifdef SQLITE_UNIX_THREADS - pthread_t tid; /* The thread authorized to use this OsFile */ -#endif -}; - -/* -** A macro to set the OsFile.fullSync flag, if it exists. -*/ -#define SET_FULLSYNC(x,y) ((x).fullSync = (y)) - -/* -** Maximum number of characters in a temporary file name -*/ -#define SQLITE_TEMPNAME_SIZE 200 - -/* -** Minimum interval supported by sqlite3OsSleep(). -*/ -#if defined(HAVE_USLEEP) && HAVE_USLEEP -# define SQLITE_MIN_SLEEP_MS 1 -#else -# define SQLITE_MIN_SLEEP_MS 1000 -#endif - -/* -** Default permissions when creating a new file -*/ -#ifndef SQLITE_DEFAULT_FILE_PERMISSIONS -# define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 -#endif - - -#endif /* _SQLITE_OS_UNIX_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/os_win.c b/ext/pdo_sqlite/sqlite/src/os_win.c deleted file mode 100644 index ad874ae63354b..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_win.c +++ /dev/null @@ -1,940 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains code that is specific to windows. -*/ -#include "sqliteInt.h" -#include "os.h" -#if OS_WIN /* This file is used for windows only */ - -#include <winbase.h> - -#ifdef __CYGWIN__ -# include <sys/cygwin.h> -#endif - -/* -** Macros used to determine whether or not to use threads. -*/ -#if defined(THREADSAFE) && THREADSAFE -# define SQLITE_W32_THREADS 1 -#endif - -/* -** Include code that is common to all os_*.c files -*/ -#include "os_common.h" - -/* -** Do not include any of the File I/O interface procedures if the -** SQLITE_OMIT_DISKIO macro is defined (indicating that there database -** will be in-memory only) -*/ -#ifndef SQLITE_OMIT_DISKIO - -/* -** The following variable is (normally) set once and never changes -** thereafter. It records whether the operating system is Win95 -** or WinNT. -** -** 0: Operating system unknown. -** 1: Operating system is Win95. -** 2: Operating system is WinNT. -** -** In order to facilitate testing on a WinNT system, the test fixture -** can manually set this value to 1 to emulate Win98 behavior. -*/ -int sqlite3_os_type = 0; - -/* -** Return true (non-zero) if we are running under WinNT, Win2K or WinXP. -** Return false (zero) for Win95, Win98, or WinME. -** -** Here is an interesting observation: Win95, Win98, and WinME lack -** the LockFileEx() API. But we can still statically link against that -** API as long as we don't call it win running Win95/98/ME. A call to -** this routine is used to determine if the host is Win95/98/ME or -** WinNT/2K/XP so that we will know whether or not we can safely call -** the LockFileEx() API. -*/ -static int isNT(void){ - if( sqlite3_os_type==0 ){ - OSVERSIONINFO sInfo; - sInfo.dwOSVersionInfoSize = sizeof(sInfo); - GetVersionEx(&sInfo); - sqlite3_os_type = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; - } - return sqlite3_os_type==2; -} - -/* -** Convert a UTF-8 string to UTF-32. Space to hold the returned string -** is obtained from sqliteMalloc. -*/ -static WCHAR *utf8ToUnicode(const char *zFilename){ - int nByte; - WCHAR *zWideFilename; - - if( !isNT() ){ - return 0; - } - nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR); - zWideFilename = sqliteMalloc( nByte*sizeof(zWideFilename[0]) ); - if( zWideFilename==0 ){ - return 0; - } - nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nByte); - if( nByte==0 ){ - sqliteFree(zWideFilename); - zWideFilename = 0; - } - return zWideFilename; -} - -/* -** Convert UTF-32 to UTF-8. Space to hold the returned string is -** obtained from sqliteMalloc(). -*/ -static char *unicodeToUtf8(const WCHAR *zWideFilename){ - int nByte; - char *zFilename; - - nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, 0, 0, 0, 0); - zFilename = sqliteMalloc( nByte ); - if( zFilename==0 ){ - return 0; - } - nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, zFilename, nByte, - 0, 0); - if( nByte == 0 ){ - sqliteFree(zFilename); - zFilename = 0; - } - return zFilename; -} - - -/* -** Delete the named file -*/ -int sqlite3OsDelete(const char *zFilename){ - WCHAR *zWide = utf8ToUnicode(zFilename); - if( zWide ){ - DeleteFileW(zWide); - sqliteFree(zWide); - }else{ - DeleteFileA(zFilename); - } - TRACE2("DELETE \"%s\"\n", zFilename); - return SQLITE_OK; -} - -/* -** Return TRUE if the named file exists. -*/ -int sqlite3OsFileExists(const char *zFilename){ - int exists = 0; - WCHAR *zWide = utf8ToUnicode(zFilename); - if( zWide ){ - exists = GetFileAttributesW(zWide) != 0xffffffff; - sqliteFree(zWide); - }else{ - exists = GetFileAttributesA(zFilename) != 0xffffffff; - } - return exists; -} - -/* -** Attempt to open a file for both reading and writing. If that -** fails, try opening it read-only. If the file does not exist, -** try to create it. -** -** On success, a handle for the open file is written to *id -** and *pReadonly is set to 0 if the file was opened for reading and -** writing or 1 if the file was opened read-only. The function returns -** SQLITE_OK. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id and *pReadonly unchanged. -*/ -int sqlite3OsOpenReadWrite( - const char *zFilename, - OsFile *id, - int *pReadonly -){ - HANDLE h; - WCHAR *zWide = utf8ToUnicode(zFilename); - assert( !id->isOpen ); - if( zWide ){ - h = CreateFileW(zWide, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - h = CreateFileW(zWide, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - sqliteFree(zWide); - return SQLITE_CANTOPEN; - } - *pReadonly = 1; - }else{ - *pReadonly = 0; - } - sqliteFree(zWide); - }else{ - h = CreateFileA(zFilename, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - h = CreateFileA(zFilename, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - *pReadonly = 1; - }else{ - *pReadonly = 0; - } - } - id->h = h; - id->locktype = NO_LOCK; - id->sharedLockByte = 0; - id->isOpen = 1; - OpenCounter(+1); - TRACE3("OPEN R/W %d \"%s\"\n", h, zFilename); - return SQLITE_OK; -} - - -/* -** Attempt to open a new file for exclusive access by this process. -** The file will be opened for both reading and writing. To avoid -** a potential security problem, we do not allow the file to have -** previously existed. Nor do we allow the file to be a symbolic -** link. -** -** If delFlag is true, then make arrangements to automatically delete -** the file when it is closed. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ - HANDLE h; - int fileflags; - WCHAR *zWide = utf8ToUnicode(zFilename); - assert( !id->isOpen ); - if( delFlag ){ - fileflags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_RANDOM_ACCESS - | FILE_FLAG_DELETE_ON_CLOSE; - }else{ - fileflags = FILE_FLAG_RANDOM_ACCESS; - } - if( zWide ){ - h = CreateFileW(zWide, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - CREATE_ALWAYS, - fileflags, - NULL - ); - sqliteFree(zWide); - }else{ - h = CreateFileA(zFilename, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - CREATE_ALWAYS, - fileflags, - NULL - ); - } - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - id->h = h; - id->locktype = NO_LOCK; - id->sharedLockByte = 0; - id->isOpen = 1; - OpenCounter(+1); - TRACE3("OPEN EX %d \"%s\"\n", h, zFilename); - return SQLITE_OK; -} - -/* -** Attempt to open a new file for read-only access. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){ - HANDLE h; - WCHAR *zWide = utf8ToUnicode(zFilename); - assert( !id->isOpen ); - if( zWide ){ - h = CreateFileW(zWide, - GENERIC_READ, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - sqliteFree(zWide); - }else{ - h = CreateFileA(zFilename, - GENERIC_READ, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - } - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - id->h = h; - id->locktype = NO_LOCK; - id->sharedLockByte = 0; - id->isOpen = 1; - OpenCounter(+1); - TRACE3("OPEN RO %d \"%s\"\n", h, zFilename); - return SQLITE_OK; -} - -/* -** Attempt to open a file descriptor for the directory that contains a -** file. This file descriptor can be used to fsync() the directory -** in order to make sure the creation of a new file is actually written -** to disk. -** -** This routine is only meaningful for Unix. It is a no-op under -** windows since windows does not support hard links. -** -** On success, a handle for a previously open file is at *id is -** updated with the new directory file descriptor and SQLITE_OK is -** returned. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id unchanged. -*/ -int sqlite3OsOpenDirectory( - const char *zDirname, - OsFile *id -){ - return SQLITE_OK; -} - -/* -** If the following global variable points to a string which is the -** name of a directory, then that directory will be used to store -** temporary files. -*/ -char *sqlite3_temp_directory = 0; - -/* -** Create a temporary file name in zBuf. zBuf must be big enough to -** hold at least SQLITE_TEMPNAME_SIZE characters. -*/ -int sqlite3OsTempFileName(char *zBuf){ - static char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789"; - int i, j; - char zTempPath[SQLITE_TEMPNAME_SIZE]; - if( sqlite3_temp_directory ){ - strncpy(zTempPath, sqlite3_temp_directory, SQLITE_TEMPNAME_SIZE-30); - zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0; - }else if( isNT() ){ - char *zMulti; - WCHAR zWidePath[SQLITE_TEMPNAME_SIZE]; - GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath); - zMulti = unicodeToUtf8(zWidePath); - if( zMulti ){ - strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30); - zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0; - sqliteFree(zMulti); - } - }else{ - GetTempPathA(SQLITE_TEMPNAME_SIZE-30, zTempPath); - } - for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){} - zTempPath[i] = 0; - for(;;){ - sprintf(zBuf, "%s\\"TEMP_FILE_PREFIX, zTempPath); - j = strlen(zBuf); - sqlite3Randomness(15, &zBuf[j]); - for(i=0; i<15; i++, j++){ - zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; - } - zBuf[j] = 0; - if( !sqlite3OsFileExists(zBuf) ) break; - } - TRACE2("TEMP FILENAME: %s\n", zBuf); - return SQLITE_OK; -} - -/* -** Close a file. -*/ -int sqlite3OsClose(OsFile *id){ - if( id->isOpen ){ - TRACE2("CLOSE %d\n", id->h); - CloseHandle(id->h); - OpenCounter(-1); - id->isOpen = 0; - } - return SQLITE_OK; -} - -/* -** Read data from a file into a buffer. Return SQLITE_OK if all -** bytes were read successfully and SQLITE_IOERR if anything goes -** wrong. -*/ -int sqlite3OsRead(OsFile *id, void *pBuf, int amt){ - DWORD got; - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - TRACE3("READ %d lock=%d\n", id->h, id->locktype); - if( !ReadFile(id->h, pBuf, amt, &got, 0) ){ - got = 0; - } - if( got==(DWORD)amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -} - -/* -** Write data from a buffer into a file. Return SQLITE_OK on success -** or some other error code on failure. -*/ -int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){ - int rc = 0; - DWORD wrote; - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - SimulateDiskfullError; - TRACE3("WRITE %d lock=%d\n", id->h, id->locktype); - assert( amt>0 ); - while( amt>0 && (rc = WriteFile(id->h, pBuf, amt, &wrote, 0))!=0 && wrote>0 ){ - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - if( !rc || amt>(int)wrote ){ - return SQLITE_FULL; - } - return SQLITE_OK; -} - -/* -** Some microsoft compilers lack this definition. -*/ -#ifndef INVALID_SET_FILE_POINTER -# define INVALID_SET_FILE_POINTER ((DWORD)-1) -#endif - -/* -** Move the read/write pointer in a file. -*/ -int sqlite3OsSeek(OsFile *id, i64 offset){ - LONG upperBits = offset>>32; - LONG lowerBits = offset & 0xffffffff; - DWORD rc; - assert( id->isOpen ); -#ifdef SQLITE_TEST - if( offset ) SimulateDiskfullError -#endif - SEEK(offset/1024 + 1); - rc = SetFilePointer(id->h, lowerBits, &upperBits, FILE_BEGIN); - TRACE3("SEEK %d %lld\n", id->h, offset); - if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){ - return SQLITE_FULL; - } - return SQLITE_OK; -} - -/* -** Make sure all writes to a particular file are committed to disk. -*/ -int sqlite3OsSync(OsFile *id, int dataOnly){ - assert( id->isOpen ); - TRACE3("SYNC %d lock=%d\n", id->h, id->locktype); - if( FlushFileBuffers(id->h) ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -} - -/* -** Sync the directory zDirname. This is a no-op on operating systems other -** than UNIX. -*/ -int sqlite3OsSyncDirectory(const char *zDirname){ - SimulateIOError(SQLITE_IOERR); - return SQLITE_OK; -} - -/* -** Truncate an open file to a specified size -*/ -int sqlite3OsTruncate(OsFile *id, i64 nByte){ - LONG upperBits = nByte>>32; - assert( id->isOpen ); - TRACE3("TRUNCATE %d %lld\n", id->h, nByte); - SimulateIOError(SQLITE_IOERR); - SetFilePointer(id->h, nByte, &upperBits, FILE_BEGIN); - SetEndOfFile(id->h); - return SQLITE_OK; -} - -/* -** Determine the current size of a file in bytes -*/ -int sqlite3OsFileSize(OsFile *id, i64 *pSize){ - DWORD upperBits, lowerBits; - assert( id->isOpen ); - SimulateIOError(SQLITE_IOERR); - lowerBits = GetFileSize(id->h, &upperBits); - *pSize = (((i64)upperBits)<<32) + lowerBits; - return SQLITE_OK; -} - -/* -** Acquire a reader lock. -** Different API routines are called depending on whether or not this -** is Win95 or WinNT. -*/ -static int getReadLock(OsFile *id){ - int res; - if( isNT() ){ - OVERLAPPED ovlp; - ovlp.Offset = SHARED_FIRST; - ovlp.OffsetHigh = 0; - ovlp.hEvent = 0; - res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, 0, SHARED_SIZE,0,&ovlp); - }else{ - int lk; - sqlite3Randomness(sizeof(lk), &lk); - id->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); - res = LockFile(id->h, SHARED_FIRST+id->sharedLockByte, 0, 1, 0); - } - return res; -} - -/* -** Undo a readlock -*/ -static int unlockReadLock(OsFile *id){ - int res; - if( isNT() ){ - res = UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0); - }else{ - res = UnlockFile(id->h, SHARED_FIRST + id->sharedLockByte, 0, 1, 0); - } - return res; -} - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -/* -** Check that a given pathname is a directory and is writable -** -*/ -int sqlite3OsIsDirWritable(char *zDirname){ - int fileAttr; - WCHAR *zWide; - if( zDirname==0 ) return 0; - if( !isNT() && strlen(zDirname)>MAX_PATH ) return 0; - zWide = utf8ToUnicode(zDirname); - if( zWide ){ - fileAttr = GetFileAttributesW(zWide); - sqliteFree(zWide); - }else{ - fileAttr = GetFileAttributesA(zDirname); - } - if( fileAttr == 0xffffffff ) return 0; - if( (fileAttr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY ){ - return 0; - } - return 1; -} -#endif /* SQLITE_OMIT_PAGER_PRAGMAS */ - -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** This routine will only increase a lock. The sqlite3OsUnlock() routine -** erases all locks at once and returns us immediately to locking level 0. -** It is not possible to lower the locking level one step at a time. You -** must go straight to locking level 0. -*/ -int sqlite3OsLock(OsFile *id, int locktype){ - int rc = SQLITE_OK; /* Return code from subroutines */ - int res = 1; /* Result of a windows lock call */ - int newLocktype; /* Set id->locktype to this value before exiting */ - int gotPendingLock = 0;/* True if we acquired a PENDING lock this time */ - - assert( id->isOpen ); - TRACE5("LOCK %d %d was %d(%d)\n", - id->h, locktype, id->locktype, id->sharedLockByte); - - /* If there is already a lock of this type or more restrictive on the - ** OsFile, do nothing. Don't use the end_lock: exit path, as - ** sqlite3OsEnterMutex() hasn't been called yet. - */ - if( id->locktype>=locktype ){ - return SQLITE_OK; - } - - /* Make sure the locking sequence is correct - */ - assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK ); - assert( locktype!=PENDING_LOCK ); - assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK ); - - /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or - ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of - ** the PENDING_LOCK byte is temporary. - */ - newLocktype = id->locktype; - if( id->locktype==NO_LOCK - || (locktype==EXCLUSIVE_LOCK && id->locktype==RESERVED_LOCK) - ){ - int cnt = 3; - while( cnt-->0 && (res = LockFile(id->h, PENDING_BYTE, 0, 1, 0))==0 ){ - /* Try 3 times to get the pending lock. The pending lock might be - ** held by another reader process who will release it momentarily. - */ - TRACE2("could not get a PENDING lock. cnt=%d\n", cnt); - Sleep(1); - } - gotPendingLock = res; - } - - /* Acquire a shared lock - */ - if( locktype==SHARED_LOCK && res ){ - assert( id->locktype==NO_LOCK ); - res = getReadLock(id); - if( res ){ - newLocktype = SHARED_LOCK; - } - } - - /* Acquire a RESERVED lock - */ - if( locktype==RESERVED_LOCK && res ){ - assert( id->locktype==SHARED_LOCK ); - res = LockFile(id->h, RESERVED_BYTE, 0, 1, 0); - if( res ){ - newLocktype = RESERVED_LOCK; - } - } - - /* Acquire a PENDING lock - */ - if( locktype==EXCLUSIVE_LOCK && res ){ - newLocktype = PENDING_LOCK; - gotPendingLock = 0; - } - - /* Acquire an EXCLUSIVE lock - */ - if( locktype==EXCLUSIVE_LOCK && res ){ - assert( id->locktype>=SHARED_LOCK ); - res = unlockReadLock(id); - TRACE2("unreadlock = %d\n", res); - res = LockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0); - if( res ){ - newLocktype = EXCLUSIVE_LOCK; - }else{ - TRACE2("error-code = %d\n", GetLastError()); - } - } - - /* If we are holding a PENDING lock that ought to be released, then - ** release it now. - */ - if( gotPendingLock && locktype==SHARED_LOCK ){ - UnlockFile(id->h, PENDING_BYTE, 0, 1, 0); - } - - /* Update the state of the lock has held in the file descriptor then - ** return the appropriate result code. - */ - if( res ){ - rc = SQLITE_OK; - }else{ - TRACE4("LOCK FAILED %d trying for %d but got %d\n", id->h, - locktype, newLocktype); - rc = SQLITE_BUSY; - } - id->locktype = newLocktype; - return rc; -} - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, return -** non-zero, otherwise zero. -*/ -int sqlite3OsCheckReservedLock(OsFile *id){ - int rc; - assert( id->isOpen ); - if( id->locktype>=RESERVED_LOCK ){ - rc = 1; - TRACE3("TEST WR-LOCK %d %d (local)\n", id->h, rc); - }else{ - rc = LockFile(id->h, RESERVED_BYTE, 0, 1, 0); - if( rc ){ - UnlockFile(id->h, RESERVED_BYTE, 0, 1, 0); - } - rc = !rc; - TRACE3("TEST WR-LOCK %d %d (remote)\n", id->h, rc); - } - return rc; -} - -/* -** Lower the locking level on file descriptor id to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -** -** It is not possible for this routine to fail if the second argument -** is NO_LOCK. If the second argument is SHARED_LOCK then this routine -** might return SQLITE_IOERR; -*/ -int sqlite3OsUnlock(OsFile *id, int locktype){ - int type; - int rc = SQLITE_OK; - assert( id->isOpen ); - assert( locktype<=SHARED_LOCK ); - TRACE5("UNLOCK %d to %d was %d(%d)\n", id->h, locktype, - id->locktype, id->sharedLockByte); - type = id->locktype; - if( type>=EXCLUSIVE_LOCK ){ - UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0); - if( locktype==SHARED_LOCK && !getReadLock(id) ){ - /* This should never happen. We should always be able to - ** reacquire the read lock */ - rc = SQLITE_IOERR; - } - } - if( type>=RESERVED_LOCK ){ - UnlockFile(id->h, RESERVED_BYTE, 0, 1, 0); - } - if( locktype==NO_LOCK && type>=SHARED_LOCK ){ - unlockReadLock(id); - } - if( type>=PENDING_LOCK ){ - UnlockFile(id->h, PENDING_BYTE, 0, 1, 0); - } - id->locktype = locktype; - return rc; -} - -/* -** Turn a relative pathname into a full pathname. Return a pointer -** to the full pathname stored in space obtained from sqliteMalloc(). -** The calling function is responsible for freeing this space once it -** is no longer needed. -*/ -char *sqlite3OsFullPathname(const char *zRelative){ - char *zNotUsed; - char *zFull; - WCHAR *zWide; - int nByte; -#ifdef __CYGWIN__ - nByte = strlen(zRelative) + MAX_PATH + 1001; - zFull = sqliteMalloc( nByte ); - if( zFull==0 ) return 0; - if( cygwin_conv_to_full_win32_path(zRelative, zFull) ) return 0; -#else - zWide = utf8ToUnicode(zRelative); - if( zWide ){ - WCHAR *zTemp, *zNotUsedW; - nByte = GetFullPathNameW(zWide, 0, 0, &zNotUsedW) + 1; - zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) ); - if( zTemp==0 ) return 0; - GetFullPathNameW(zWide, nByte, zTemp, &zNotUsedW); - sqliteFree(zWide); - zFull = unicodeToUtf8(zTemp); - sqliteFree(zTemp); - }else{ - nByte = GetFullPathNameA(zRelative, 0, 0, &zNotUsed) + 1; - zFull = sqliteMalloc( nByte*sizeof(zFull[0]) ); - if( zFull==0 ) return 0; - GetFullPathNameA(zRelative, nByte, zFull, &zNotUsed); - } -#endif - return zFull; -} - -#endif /* SQLITE_OMIT_DISKIO */ -/*************************************************************************** -** Everything above deals with file I/O. Everything that follows deals -** with other miscellanous aspects of the operating system interface -****************************************************************************/ - -/* -** Get information to seed the random number generator. The seed -** is written into the buffer zBuf[256]. The calling function must -** supply a sufficiently large buffer. -*/ -int sqlite3OsRandomSeed(char *zBuf){ - /* We have to initialize zBuf to prevent valgrind from reporting - ** errors. The reports issued by valgrind are incorrect - we would - ** prefer that the randomness be increased by making use of the - ** uninitialized space in zBuf - but valgrind errors tend to worry - ** some users. Rather than argue, it seems easier just to initialize - ** the whole array and silence valgrind, even if that means less randomness - ** in the random seed. - ** - ** When testing, initializing zBuf[] to zero is all we do. That means - ** that we always use the same random number sequence.* This makes the - ** tests repeatable. - */ - memset(zBuf, 0, 256); - GetSystemTime((LPSYSTEMTIME)zBuf); - return SQLITE_OK; -} - -/* -** Sleep for a little while. Return the amount of time slept. -*/ -int sqlite3OsSleep(int ms){ - Sleep(ms); - return ms; -} - -/* -** Static variables used for thread synchronization -*/ -static int inMutex = 0; -#ifdef SQLITE_W32_THREADS - static CRITICAL_SECTION cs; -#endif - -/* -** The following pair of routine implement mutual exclusion for -** multi-threaded processes. Only a single thread is allowed to -** executed code that is surrounded by EnterMutex() and LeaveMutex(). -** -** SQLite uses only a single Mutex. There is not much critical -** code and what little there is executes quickly and without blocking. -*/ -void sqlite3OsEnterMutex(){ -#ifdef SQLITE_W32_THREADS - static int isInit = 0; - while( !isInit ){ - static long lock = 0; - if( InterlockedIncrement(&lock)==1 ){ - InitializeCriticalSection(&cs); - isInit = 1; - }else{ - Sleep(1); - } - } - EnterCriticalSection(&cs); -#endif - assert( !inMutex ); - inMutex = 1; -} -void sqlite3OsLeaveMutex(){ - assert( inMutex ); - inMutex = 0; -#ifdef SQLITE_W32_THREADS - LeaveCriticalSection(&cs); -#endif -} - -/* -** The following variable, if set to a non-zero value, becomes the result -** returned from sqlite3OsCurrentTime(). This is used for testing. -*/ -#ifdef SQLITE_TEST -int sqlite3_current_time = 0; -#endif - -/* -** Find the current time (in Universal Coordinated Time). Write the -** current time and date as a Julian Day number into *prNow and -** return 0. Return 1 if the time and date cannot be found. -*/ -int sqlite3OsCurrentTime(double *prNow){ - FILETIME ft; - /* FILETIME structure is a 64-bit value representing the number of - 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). - */ - double now; - GetSystemTimeAsFileTime( &ft ); - now = ((double)ft.dwHighDateTime) * 4294967296.0; - *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5; -#ifdef SQLITE_TEST - if( sqlite3_current_time ){ - *prNow = sqlite3_current_time/86400.0 + 2440587.5; - } -#endif - return 0; -} - -#endif /* OS_WIN */ diff --git a/ext/pdo_sqlite/sqlite/src/os_win.h b/ext/pdo_sqlite/sqlite/src/os_win.h deleted file mode 100644 index baf937b211bf4..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/os_win.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -** 2004 May 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file defines OS-specific features for Win32 -*/ -#ifndef _SQLITE_OS_WIN_H_ -#define _SQLITE_OS_WIN_H_ - -#include <windows.h> -#include <winbase.h> - -/* -** The OsFile structure is a operating-system independing representation -** of an open file handle. It is defined differently for each architecture. -** -** This is the definition for Win32. -*/ -typedef struct OsFile OsFile; -struct OsFile { - HANDLE h; /* Handle for accessing the file */ - unsigned char locktype; /* Type of lock currently held on this file */ - unsigned char isOpen; /* True if needs to be closed */ - short sharedLockByte; /* Randomly chosen byte used as a shared lock */ -}; - - -#define SQLITE_TEMPNAME_SIZE (MAX_PATH+50) -#define SQLITE_MIN_SLEEP_MS 1 - - -#endif /* _SQLITE_OS_WIN_H_ */ diff --git a/ext/pdo_sqlite/sqlite/src/pager.c b/ext/pdo_sqlite/sqlite/src/pager.c deleted file mode 100644 index 1edfbb4e7e1fc..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/pager.c +++ /dev/null @@ -1,3634 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the implementation of the page cache subsystem or "pager". -** -** The pager is used to access a database disk file. It implements -** atomic commit and rollback through the use of a journal file that -** is separate from the database file. The pager also implements file -** locking to prevent two processes from writing the same database -** file simultaneously, or one process from reading the database while -** another is writing. -** -** @(#) $Id$ -*/ -#ifndef SQLITE_OMIT_DISKIO -#include "sqliteInt.h" -#include "os.h" -#include "pager.h" -#include <assert.h> -#include <string.h> - -/* -** Macros for troubleshooting. Normally turned off -*/ -#if 0 -#define TRACE1(X) sqlite3DebugPrintf(X) -#define TRACE2(X,Y) sqlite3DebugPrintf(X,Y) -#define TRACE3(X,Y,Z) sqlite3DebugPrintf(X,Y,Z) -#define TRACE4(X,Y,Z,W) sqlite3DebugPrintf(X,Y,Z,W) -#define TRACE5(X,Y,Z,W,V) sqlite3DebugPrintf(X,Y,Z,W,V) -#else -#define TRACE1(X) -#define TRACE2(X,Y) -#define TRACE3(X,Y,Z) -#define TRACE4(X,Y,Z,W) -#define TRACE5(X,Y,Z,W,V) -#endif - -/* -** The following two macros are used within the TRACEX() macros above -** to print out file-descriptors. They are required so that tracing -** can be turned on when using both the regular os_unix.c and os_test.c -** backends. -** -** PAGERID() takes a pointer to a Pager struct as it's argument. The -** associated file-descriptor is returned. FILEHANDLEID() takes an OsFile -** struct as it's argument. -*/ -#ifdef OS_TEST -#define PAGERID(p) (p->fd->fd.h) -#define FILEHANDLEID(fd) (fd->fd.h) -#else -#define PAGERID(p) (p->fd.h) -#define FILEHANDLEID(fd) (fd.h) -#endif - -/* -** The page cache as a whole is always in one of the following -** states: -** -** PAGER_UNLOCK The page cache is not currently reading or -** writing the database file. There is no -** data held in memory. This is the initial -** state. -** -** PAGER_SHARED The page cache is reading the database. -** Writing is not permitted. There can be -** multiple readers accessing the same database -** file at the same time. -** -** PAGER_RESERVED This process has reserved the database for writing -** but has not yet made any changes. Only one process -** at a time can reserve the database. The original -** database file has not been modified so other -** processes may still be reading the on-disk -** database file. -** -** PAGER_EXCLUSIVE The page cache is writing the database. -** Access is exclusive. No other processes or -** threads can be reading or writing while one -** process is writing. -** -** PAGER_SYNCED The pager moves to this state from PAGER_EXCLUSIVE -** after all dirty pages have been written to the -** database file and the file has been synced to -** disk. All that remains to do is to remove the -** journal file and the transaction will be -** committed. -** -** The page cache comes up in PAGER_UNLOCK. The first time a -** sqlite3pager_get() occurs, the state transitions to PAGER_SHARED. -** After all pages have been released using sqlite_page_unref(), -** the state transitions back to PAGER_UNLOCK. The first time -** that sqlite3pager_write() is called, the state transitions to -** PAGER_RESERVED. (Note that sqlite_page_write() can only be -** called on an outstanding page which means that the pager must -** be in PAGER_SHARED before it transitions to PAGER_RESERVED.) -** The transition to PAGER_EXCLUSIVE occurs when before any changes -** are made to the database file. After an sqlite3pager_rollback() -** or sqlite_pager_commit(), the state goes back to PAGER_SHARED. -*/ -#define PAGER_UNLOCK 0 -#define PAGER_SHARED 1 /* same as SHARED_LOCK */ -#define PAGER_RESERVED 2 /* same as RESERVED_LOCK */ -#define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */ -#define PAGER_SYNCED 5 - -/* -** If the SQLITE_BUSY_RESERVED_LOCK macro is set to true at compile-time, -** then failed attempts to get a reserved lock will invoke the busy callback. -** This is off by default. To see why, consider the following scenario: -** -** Suppose thread A already has a shared lock and wants a reserved lock. -** Thread B already has a reserved lock and wants an exclusive lock. If -** both threads are using their busy callbacks, it might be a long time -** be for one of the threads give up and allows the other to proceed. -** But if the thread trying to get the reserved lock gives up quickly -** (if it never invokes its busy callback) then the contention will be -** resolved quickly. -*/ -#ifndef SQLITE_BUSY_RESERVED_LOCK -# define SQLITE_BUSY_RESERVED_LOCK 0 -#endif - -/* -** This macro rounds values up so that if the value is an address it -** is guaranteed to be an address that is aligned to an 8-byte boundary. -*/ -#define FORCE_ALIGNMENT(X) (((X)+7)&~7) - -/* -** Each in-memory image of a page begins with the following header. -** This header is only visible to this pager module. The client -** code that calls pager sees only the data that follows the header. -** -** Client code should call sqlite3pager_write() on a page prior to making -** any modifications to that page. The first time sqlite3pager_write() -** is called, the original page contents are written into the rollback -** journal and PgHdr.inJournal and PgHdr.needSync are set. Later, once -** the journal page has made it onto the disk surface, PgHdr.needSync -** is cleared. The modified page cannot be written back into the original -** database file until the journal pages has been synced to disk and the -** PgHdr.needSync has been cleared. -** -** The PgHdr.dirty flag is set when sqlite3pager_write() is called and -** is cleared again when the page content is written back to the original -** database file. -*/ -typedef struct PgHdr PgHdr; -struct PgHdr { - Pager *pPager; /* The pager to which this page belongs */ - Pgno pgno; /* The page number for this page */ - PgHdr *pNextHash, *pPrevHash; /* Hash collision chain for PgHdr.pgno */ - PgHdr *pNextFree, *pPrevFree; /* Freelist of pages where nRef==0 */ - PgHdr *pNextAll; /* A list of all pages */ - PgHdr *pNextStmt, *pPrevStmt; /* List of pages in the statement journal */ - u8 inJournal; /* TRUE if has been written to journal */ - u8 inStmt; /* TRUE if in the statement subjournal */ - u8 dirty; /* TRUE if we need to write back changes */ - u8 needSync; /* Sync journal before writing this page */ - u8 alwaysRollback; /* Disable dont_rollback() for this page */ - short int nRef; /* Number of users of this page */ - PgHdr *pDirty; /* Dirty pages sorted by PgHdr.pgno */ -#ifdef SQLITE_CHECK_PAGES - u32 pageHash; -#endif - /* pPager->pageSize bytes of page data follow this header */ - /* Pager.nExtra bytes of local data follow the page data */ -}; - -/* -** For an in-memory only database, some extra information is recorded about -** each page so that changes can be rolled back. (Journal files are not -** used for in-memory databases.) The following information is added to -** the end of every EXTRA block for in-memory databases. -** -** This information could have been added directly to the PgHdr structure. -** But then it would take up an extra 8 bytes of storage on every PgHdr -** even for disk-based databases. Splitting it out saves 8 bytes. This -** is only a savings of 0.8% but those percentages add up. -*/ -typedef struct PgHistory PgHistory; -struct PgHistory { - u8 *pOrig; /* Original page text. Restore to this on a full rollback */ - u8 *pStmt; /* Text as it was at the beginning of the current statement */ -}; - -/* -** A macro used for invoking the codec if there is one -*/ -#ifdef SQLITE_HAS_CODEC -# define CODEC(P,D,N,X) if( P->xCodec ){ P->xCodec(P->pCodecArg,D,N,X); } -#else -# define CODEC(P,D,N,X) -#endif - -/* -** Convert a pointer to a PgHdr into a pointer to its data -** and back again. -*/ -#define PGHDR_TO_DATA(P) ((void*)(&(P)[1])) -#define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1]) -#define PGHDR_TO_EXTRA(G,P) ((void*)&((char*)(&(G)[1]))[(P)->pageSize]) -#define PGHDR_TO_HIST(P,PGR) \ - ((PgHistory*)&((char*)(&(P)[1]))[(PGR)->pageSize+(PGR)->nExtra]) - -/* -** How big to make the hash table used for locating in-memory pages -** by page number. This macro looks a little silly, but is evaluated -** at compile-time, not run-time (at least for gcc this is true). -*/ -#define N_PG_HASH (\ - (MAX_PAGES>1024)?2048: \ - (MAX_PAGES>512)?1024: \ - (MAX_PAGES>256)?512: \ - (MAX_PAGES>128)?256: \ - (MAX_PAGES>64)?128:64 \ -) - -/* -** Hash a page number -*/ -#define pager_hash(PN) ((PN)&(N_PG_HASH-1)) - -/* -** A open page cache is an instance of the following structure. -*/ -struct Pager { - u8 journalOpen; /* True if journal file descriptors is valid */ - u8 journalStarted; /* True if header of journal is synced */ - u8 useJournal; /* Use a rollback journal on this file */ - u8 noReadlock; /* Do not bother to obtain readlocks */ - u8 stmtOpen; /* True if the statement subjournal is open */ - u8 stmtInUse; /* True we are in a statement subtransaction */ - u8 stmtAutoopen; /* Open stmt journal when main journal is opened*/ - u8 noSync; /* Do not sync the journal if true */ - u8 fullSync; /* Do extra syncs of the journal for robustness */ - u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */ - u8 errMask; /* One of several kinds of errors */ - u8 tempFile; /* zFilename is a temporary file */ - u8 readOnly; /* True for a read-only database */ - u8 needSync; /* True if an fsync() is needed on the journal */ - u8 dirtyCache; /* True if cached pages have changed */ - u8 alwaysRollback; /* Disable dont_rollback() for all pages */ - u8 memDb; /* True to inhibit all file I/O */ - u8 setMaster; /* True if a m-j name has been written to jrnl */ - int dbSize; /* Number of pages in the file */ - int origDbSize; /* dbSize before the current change */ - int stmtSize; /* Size of database (in pages) at stmt_begin() */ - int nRec; /* Number of pages written to the journal */ - u32 cksumInit; /* Quasi-random value added to every checksum */ - int stmtNRec; /* Number of records in stmt subjournal */ - int nExtra; /* Add this many bytes to each in-memory page */ - int pageSize; /* Number of bytes in a page */ - int nPage; /* Total number of in-memory pages */ - int nMaxPage; /* High water mark of nPage */ - int nRef; /* Number of in-memory pages with PgHdr.nRef>0 */ - int mxPage; /* Maximum number of pages to hold in cache */ - u8 *aInJournal; /* One bit for each page in the database file */ - u8 *aInStmt; /* One bit for each page in the database */ - char *zFilename; /* Name of the database file */ - char *zJournal; /* Name of the journal file */ - char *zDirectory; /* Directory hold database and journal files */ - OsFile fd, jfd; /* File descriptors for database and journal */ - OsFile stfd; /* File descriptor for the statement subjournal*/ - BusyHandler *pBusyHandler; /* Pointer to sqlite.busyHandler */ - PgHdr *pFirst, *pLast; /* List of free pages */ - PgHdr *pFirstSynced; /* First free page with PgHdr.needSync==0 */ - PgHdr *pAll; /* List of all pages */ - PgHdr *pStmt; /* List of pages in the statement subjournal */ - i64 journalOff; /* Current byte offset in the journal file */ - i64 journalHdr; /* Byte offset to previous journal header */ - i64 stmtHdrOff; /* First journal header written this statement */ - i64 stmtCksum; /* cksumInit when statement was started */ - i64 stmtJSize; /* Size of journal at stmt_begin() */ - int sectorSize; /* Assumed sector size during rollback */ -#ifdef SQLITE_TEST - int nHit, nMiss, nOvfl; /* Cache hits, missing, and LRU overflows */ - int nRead,nWrite; /* Database pages read/written */ -#endif - void (*xDestructor)(void*,int); /* Call this routine when freeing pages */ - void (*xReiniter)(void*,int); /* Call this routine when reloading pages */ - void (*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ - void *pCodecArg; /* First argument to xCodec() */ - PgHdr *aHash[N_PG_HASH]; /* Hash table to map page number to PgHdr */ -}; - -/* -** If SQLITE_TEST is defined then increment the variable given in -** the argument -*/ -#ifdef SQLITE_TEST -# define TEST_INCR(x) x++ -#else -# define TEST_INCR(x) -#endif - -/* -** These are bits that can be set in Pager.errMask. -*/ -#define PAGER_ERR_FULL 0x01 /* a write() failed */ -#define PAGER_ERR_MEM 0x02 /* malloc() failed */ -#define PAGER_ERR_LOCK 0x04 /* error in the locking protocol */ -#define PAGER_ERR_CORRUPT 0x08 /* database or journal corruption */ -#define PAGER_ERR_DISK 0x10 /* general disk I/O error - bad hard drive? */ - -/* -** Journal files begin with the following magic string. The data -** was obtained from /dev/random. It is used only as a sanity check. -** -** Since version 2.8.0, the journal format contains additional sanity -** checking information. If the power fails while the journal is begin -** written, semi-random garbage data might appear in the journal -** file after power is restored. If an attempt is then made -** to roll the journal back, the database could be corrupted. The additional -** sanity checking data is an attempt to discover the garbage in the -** journal and ignore it. -** -** The sanity checking information for the new journal format consists -** of a 32-bit checksum on each page of data. The checksum covers both -** the page number and the pPager->pageSize bytes of data for the page. -** This cksum is initialized to a 32-bit random value that appears in the -** journal file right after the header. The random initializer is important, -** because garbage data that appears at the end of a journal is likely -** data that was once in other files that have now been deleted. If the -** garbage data came from an obsolete journal file, the checksums might -** be correct. But by initializing the checksum to random value which -** is different for every journal, we minimize that risk. -*/ -static const unsigned char aJournalMagic[] = { - 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd7, -}; - -/* -** The size of the header and of each page in the journal is determined -** by the following macros. -*/ -#define JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8) - -/* -** The journal header size for this pager. In the future, this could be -** set to some value read from the disk controller. The important -** characteristic is that it is the same size as a disk sector. -*/ -#define JOURNAL_HDR_SZ(pPager) (pPager->sectorSize) - -/* -** The macro MEMDB is true if we are dealing with an in-memory database. -** We do this as a macro so that if the SQLITE_OMIT_MEMORYDB macro is set, -** the value of MEMDB will be a constant and the compiler will optimize -** out code that would never execute. -*/ -#ifdef SQLITE_OMIT_MEMORYDB -# define MEMDB 0 -#else -# define MEMDB pPager->memDb -#endif - -/* -** The default size of a disk sector -*/ -#define PAGER_SECTOR_SIZE 512 - -/* -** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is -** reserved for working around a windows/posix incompatibility). It is -** used in the journal to signify that the remainder of the journal file -** is devoted to storing a master journal name - there are no more pages to -** roll back. See comments for function writeMasterJournal() for details. -*/ -/* #define PAGER_MJ_PGNO(x) (PENDING_BYTE/((x)->pageSize)) */ -#define PAGER_MJ_PGNO(x) ((PENDING_BYTE/((x)->pageSize))+1) - -/* -** The maximum legal page number is (2^31 - 1). -*/ -#define PAGER_MAX_PGNO 2147483647 - -/* -** Enable reference count tracking (for debugging) here: -*/ -#ifdef SQLITE_DEBUG - int pager3_refinfo_enable = 0; - static void pager_refinfo(PgHdr *p){ - static int cnt = 0; - if( !pager3_refinfo_enable ) return; - sqlite3DebugPrintf( - "REFCNT: %4d addr=%p nRef=%d\n", - p->pgno, PGHDR_TO_DATA(p), p->nRef - ); - cnt++; /* Something to set a breakpoint on */ - } -# define REFINFO(X) pager_refinfo(X) -#else -# define REFINFO(X) -#endif - -/* -** Read a 32-bit integer from the given file descriptor. Store the integer -** that is read in *pRes. Return SQLITE_OK if everything worked, or an -** error code is something goes wrong. -** -** All values are stored on disk as big-endian. -*/ -static int read32bits(OsFile *fd, u32 *pRes){ - u32 res; - int rc; - rc = sqlite3OsRead(fd, &res, sizeof(res)); - if( rc==SQLITE_OK ){ - unsigned char ac[4]; - memcpy(ac, &res, 4); - res = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3]; - } - *pRes = res; - return rc; -} - -/* -** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK -** on success or an error code is something goes wrong. -*/ -static int write32bits(OsFile *fd, u32 val){ - unsigned char ac[4]; - ac[0] = (val>>24) & 0xff; - ac[1] = (val>>16) & 0xff; - ac[2] = (val>>8) & 0xff; - ac[3] = val & 0xff; - return sqlite3OsWrite(fd, ac, 4); -} - -/* -** Write the 32-bit integer 'val' into the page identified by page header -** 'p' at offset 'offset'. -*/ -static void store32bits(u32 val, PgHdr *p, int offset){ - unsigned char *ac; - ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset]; - ac[0] = (val>>24) & 0xff; - ac[1] = (val>>16) & 0xff; - ac[2] = (val>>8) & 0xff; - ac[3] = val & 0xff; -} - -/* -** Read a 32-bit integer at offset 'offset' from the page identified by -** page header 'p'. -*/ -static u32 retrieve32bits(PgHdr *p, int offset){ - unsigned char *ac; - ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset]; - return (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3]; -} - - -/* -** Convert the bits in the pPager->errMask into an approprate -** return code. -*/ -static int pager_errcode(Pager *pPager){ - int rc = SQLITE_OK; - if( pPager->errMask & PAGER_ERR_LOCK ) rc = SQLITE_PROTOCOL; - if( pPager->errMask & PAGER_ERR_DISK ) rc = SQLITE_IOERR; - if( pPager->errMask & PAGER_ERR_FULL ) rc = SQLITE_FULL; - if( pPager->errMask & PAGER_ERR_MEM ) rc = SQLITE_NOMEM; - if( pPager->errMask & PAGER_ERR_CORRUPT ) rc = SQLITE_CORRUPT; - return rc; -} - -#ifdef SQLITE_CHECK_PAGES -/* -** Return a 32-bit hash of the page data for pPage. -*/ -static u32 pager_pagehash(PgHdr *pPage){ - u32 hash = 0; - int i; - unsigned char *pData = (unsigned char *)PGHDR_TO_DATA(pPage); - for(i=0; i<pPage->pPager->pageSize; i++){ - hash = (hash+i)^pData[i]; - } - return hash; -} - -/* -** The CHECK_PAGE macro takes a PgHdr* as an argument. If SQLITE_CHECK_PAGES -** is defined, and NDEBUG is not defined, an assert() statement checks -** that the page is either dirty or still matches the calculated page-hash. -*/ -#define CHECK_PAGE(x) checkPage(x) -static void checkPage(PgHdr *pPg){ - Pager *pPager = pPg->pPager; - assert( !pPg->pageHash || pPager->errMask || MEMDB || pPg->dirty || - pPg->pageHash==pager_pagehash(pPg) ); -} - -#else -#define CHECK_PAGE(x) -#endif - -/* -** When this is called the journal file for pager pPager must be open. -** The master journal file name is read from the end of the file and -** written into memory obtained from sqliteMalloc(). *pzMaster is -** set to point at the memory and SQLITE_OK returned. The caller must -** sqliteFree() *pzMaster. -** -** If no master journal file name is present *pzMaster is set to 0 and -** SQLITE_OK returned. -*/ -static int readMasterJournal(OsFile *pJrnl, char **pzMaster){ - int rc; - u32 len; - i64 szJ; - u32 cksum; - int i; - unsigned char aMagic[8]; /* A buffer to hold the magic header */ - - *pzMaster = 0; - - rc = sqlite3OsFileSize(pJrnl, &szJ); - if( rc!=SQLITE_OK || szJ<16 ) return rc; - - rc = sqlite3OsSeek(pJrnl, szJ-16); - if( rc!=SQLITE_OK ) return rc; - - rc = read32bits(pJrnl, &len); - if( rc!=SQLITE_OK ) return rc; - - rc = read32bits(pJrnl, &cksum); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3OsRead(pJrnl, aMagic, 8); - if( rc!=SQLITE_OK || memcmp(aMagic, aJournalMagic, 8) ) return rc; - - rc = sqlite3OsSeek(pJrnl, szJ-16-len); - if( rc!=SQLITE_OK ) return rc; - - *pzMaster = (char *)sqliteMalloc(len+1); - if( !*pzMaster ){ - return SQLITE_NOMEM; - } - rc = sqlite3OsRead(pJrnl, *pzMaster, len); - if( rc!=SQLITE_OK ){ - sqliteFree(*pzMaster); - *pzMaster = 0; - return rc; - } - - /* See if the checksum matches the master journal name */ - for(i=0; i<len; i++){ - cksum -= (*pzMaster)[i]; - } - if( cksum ){ - /* If the checksum doesn't add up, then one or more of the disk sectors - ** containing the master journal filename is corrupted. This means - ** definitely roll back, so just return SQLITE_OK and report a (nul) - ** master-journal filename. - */ - sqliteFree(*pzMaster); - *pzMaster = 0; - }else{ - (*pzMaster)[len] = '\0'; - } - - return SQLITE_OK; -} - -/* -** Seek the journal file descriptor to the next sector boundary where a -** journal header may be read or written. Pager.journalOff is updated with -** the new seek offset. -** -** i.e for a sector size of 512: -** -** Input Offset Output Offset -** --------------------------------------- -** 0 0 -** 512 512 -** 100 512 -** 2000 2048 -** -*/ -static int seekJournalHdr(Pager *pPager){ - i64 offset = 0; - i64 c = pPager->journalOff; - if( c ){ - offset = ((c-1)/JOURNAL_HDR_SZ(pPager) + 1) * JOURNAL_HDR_SZ(pPager); - } - assert( offset%JOURNAL_HDR_SZ(pPager)==0 ); - assert( offset>=c ); - assert( (offset-c)<JOURNAL_HDR_SZ(pPager) ); - pPager->journalOff = offset; - return sqlite3OsSeek(&pPager->jfd, pPager->journalOff); -} - -/* -** The journal file must be open when this routine is called. A journal -** header (JOURNAL_HDR_SZ bytes) is written into the journal file at the -** current location. -** -** The format for the journal header is as follows: -** - 8 bytes: Magic identifying journal format. -** - 4 bytes: Number of records in journal, or -1 no-sync mode is on. -** - 4 bytes: Random number used for page hash. -** - 4 bytes: Initial database page count. -** - 4 bytes: Sector size used by the process that wrote this journal. -** -** Followed by (JOURNAL_HDR_SZ - 24) bytes of unused space. -*/ -static int writeJournalHdr(Pager *pPager){ - - int rc = seekJournalHdr(pPager); - if( rc ) return rc; - - pPager->journalHdr = pPager->journalOff; - if( pPager->stmtHdrOff==0 ){ - pPager->stmtHdrOff = pPager->journalHdr; - } - pPager->journalOff += JOURNAL_HDR_SZ(pPager); - - /* FIX ME: - ** - ** Possibly for a pager not in no-sync mode, the journal magic should not - ** be written until nRec is filled in as part of next syncJournal(). - ** - ** Actually maybe the whole journal header should be delayed until that - ** point. Think about this. - */ - rc = sqlite3OsWrite(&pPager->jfd, aJournalMagic, sizeof(aJournalMagic)); - - if( rc==SQLITE_OK ){ - /* The nRec Field. 0xFFFFFFFF for no-sync journals. */ - rc = write32bits(&pPager->jfd, pPager->noSync ? 0xffffffff : 0); - } - if( rc==SQLITE_OK ){ - /* The random check-hash initialiser */ - sqlite3Randomness(sizeof(pPager->cksumInit), &pPager->cksumInit); - rc = write32bits(&pPager->jfd, pPager->cksumInit); - } - if( rc==SQLITE_OK ){ - /* The initial database size */ - rc = write32bits(&pPager->jfd, pPager->dbSize); - } - if( rc==SQLITE_OK ){ - /* The assumed sector size for this process */ - rc = write32bits(&pPager->jfd, pPager->sectorSize); - } - - /* The journal header has been written successfully. Seek the journal - ** file descriptor to the end of the journal header sector. - */ - if( rc==SQLITE_OK ){ - rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff-1); - if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(&pPager->jfd, "\000", 1); - } - } - return rc; -} - -/* -** The journal file must be open when this is called. A journal header file -** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal -** file. See comments above function writeJournalHdr() for a description of -** the journal header format. -** -** If the header is read successfully, *nRec is set to the number of -** page records following this header and *dbSize is set to the size of the -** database before the transaction began, in pages. Also, pPager->cksumInit -** is set to the value read from the journal header. SQLITE_OK is returned -** in this case. -** -** If the journal header file appears to be corrupted, SQLITE_DONE is -** returned and *nRec and *dbSize are not set. If JOURNAL_HDR_SZ bytes -** cannot be read from the journal file an error code is returned. -*/ -static int readJournalHdr( - Pager *pPager, - i64 journalSize, - u32 *pNRec, - u32 *pDbSize -){ - int rc; - unsigned char aMagic[8]; /* A buffer to hold the magic header */ - - rc = seekJournalHdr(pPager); - if( rc ) return rc; - - if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){ - return SQLITE_DONE; - } - - rc = sqlite3OsRead(&pPager->jfd, aMagic, sizeof(aMagic)); - if( rc ) return rc; - - if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){ - return SQLITE_DONE; - } - - rc = read32bits(&pPager->jfd, pNRec); - if( rc ) return rc; - - rc = read32bits(&pPager->jfd, &pPager->cksumInit); - if( rc ) return rc; - - rc = read32bits(&pPager->jfd, pDbSize); - if( rc ) return rc; - - /* Update the assumed sector-size to match the value used by - ** the process that created this journal. If this journal was - ** created by a process other than this one, then this routine - ** is being called from within pager_playback(). The local value - ** of Pager.sectorSize is restored at the end of that routine. - */ - rc = read32bits(&pPager->jfd, (u32 *)&pPager->sectorSize); - if( rc ) return rc; - - pPager->journalOff += JOURNAL_HDR_SZ(pPager); - rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff); - return rc; -} - - -/* -** Write the supplied master journal name into the journal file for pager -** pPager at the current location. The master journal name must be the last -** thing written to a journal file. If the pager is in full-sync mode, the -** journal file descriptor is advanced to the next sector boundary before -** anything is written. The format is: -** -** + 4 bytes: PAGER_MJ_PGNO. -** + N bytes: length of master journal name. -** + 4 bytes: N -** + 4 bytes: Master journal name checksum. -** + 8 bytes: aJournalMagic[]. -** -** The master journal page checksum is the sum of the bytes in the master -** journal name. -*/ -static int writeMasterJournal(Pager *pPager, const char *zMaster){ - int rc; - int len; - int i; - u32 cksum = 0; - - if( !zMaster || pPager->setMaster) return SQLITE_OK; - pPager->setMaster = 1; - - len = strlen(zMaster); - for(i=0; i<len; i++){ - cksum += zMaster[i]; - } - - /* If in full-sync mode, advance to the next disk sector before writing - ** the master journal name. This is in case the previous page written to - ** the journal has already been synced. - */ - if( pPager->fullSync ){ - rc = seekJournalHdr(pPager); - if( rc!=SQLITE_OK ) return rc; - } - pPager->journalOff += (len+20); - - rc = write32bits(&pPager->jfd, PAGER_MJ_PGNO(pPager)); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3OsWrite(&pPager->jfd, zMaster, len); - if( rc!=SQLITE_OK ) return rc; - - rc = write32bits(&pPager->jfd, len); - if( rc!=SQLITE_OK ) return rc; - - rc = write32bits(&pPager->jfd, cksum); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3OsWrite(&pPager->jfd, aJournalMagic, sizeof(aJournalMagic)); - pPager->needSync = !pPager->noSync; - return rc; -} - -/* -** Add or remove a page from the list of all pages that are in the -** statement journal. -** -** The Pager keeps a separate list of pages that are currently in -** the statement journal. This helps the sqlite3pager_stmt_commit() -** routine run MUCH faster for the common case where there are many -** pages in memory but only a few are in the statement journal. -*/ -static void page_add_to_stmt_list(PgHdr *pPg){ - Pager *pPager = pPg->pPager; - if( pPg->inStmt ) return; - assert( pPg->pPrevStmt==0 && pPg->pNextStmt==0 ); - pPg->pPrevStmt = 0; - if( pPager->pStmt ){ - pPager->pStmt->pPrevStmt = pPg; - } - pPg->pNextStmt = pPager->pStmt; - pPager->pStmt = pPg; - pPg->inStmt = 1; -} -static void page_remove_from_stmt_list(PgHdr *pPg){ - if( !pPg->inStmt ) return; - if( pPg->pPrevStmt ){ - assert( pPg->pPrevStmt->pNextStmt==pPg ); - pPg->pPrevStmt->pNextStmt = pPg->pNextStmt; - }else{ - assert( pPg->pPager->pStmt==pPg ); - pPg->pPager->pStmt = pPg->pNextStmt; - } - if( pPg->pNextStmt ){ - assert( pPg->pNextStmt->pPrevStmt==pPg ); - pPg->pNextStmt->pPrevStmt = pPg->pPrevStmt; - } - pPg->pNextStmt = 0; - pPg->pPrevStmt = 0; - pPg->inStmt = 0; -} - -/* -** Find a page in the hash table given its page number. Return -** a pointer to the page or NULL if not found. -*/ -static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ - PgHdr *p = pPager->aHash[pager_hash(pgno)]; - while( p && p->pgno!=pgno ){ - p = p->pNextHash; - } - return p; -} - -/* -** Unlock the database and clear the in-memory cache. This routine -** sets the state of the pager back to what it was when it was first -** opened. Any outstanding pages are invalidated and subsequent attempts -** to access those pages will likely result in a coredump. -*/ -static void pager_reset(Pager *pPager){ - PgHdr *pPg, *pNext; - if( pPager->errMask ) return; - for(pPg=pPager->pAll; pPg; pPg=pNext){ - pNext = pPg->pNextAll; - sqliteFree(pPg); - } - pPager->pFirst = 0; - pPager->pFirstSynced = 0; - pPager->pLast = 0; - pPager->pAll = 0; - memset(pPager->aHash, 0, sizeof(pPager->aHash)); - pPager->nPage = 0; - if( pPager->state>=PAGER_RESERVED ){ - sqlite3pager_rollback(pPager); - } - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - pPager->state = PAGER_UNLOCK; - pPager->dbSize = -1; - pPager->nRef = 0; - assert( pPager->journalOpen==0 ); -} - -/* -** This function is used to reset the pager after a malloc() failure. This -** doesn't work with in-memory databases. If a malloc() fails when an -** in-memory database is in use it is not possible to recover. -** -** If a transaction or statement transaction is active, it is rolled back. -** -** It is an error to call this function if any pages are in use. -*/ -#ifndef SQLITE_OMIT_GLOBALRECOVER -int sqlite3pager_reset(Pager *pPager){ - if( pPager ){ - if( pPager->nRef || MEMDB ){ - return SQLITE_ERROR; - } - pPager->errMask &= ~(PAGER_ERR_MEM); - pager_reset(pPager); - } - return SQLITE_OK; -} -#endif - - -/* -** When this routine is called, the pager has the journal file open and -** a RESERVED or EXCLUSIVE lock on the database. This routine releases -** the database lock and acquires a SHARED lock in its place. The journal -** file is deleted and closed. -** -** TODO: Consider keeping the journal file open for temporary databases. -** This might give a performance improvement on windows where opening -** a file is an expensive operation. -*/ -static int pager_unwritelock(Pager *pPager){ - PgHdr *pPg; - int rc; - assert( !MEMDB ); - if( pPager->state<PAGER_RESERVED ){ - return SQLITE_OK; - } - sqlite3pager_stmt_commit(pPager); - if( pPager->stmtOpen ){ - sqlite3OsClose(&pPager->stfd); - pPager->stmtOpen = 0; - } - if( pPager->journalOpen ){ - sqlite3OsClose(&pPager->jfd); - pPager->journalOpen = 0; - sqlite3OsDelete(pPager->zJournal); - sqliteFree( pPager->aInJournal ); - pPager->aInJournal = 0; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - pPg->inJournal = 0; - pPg->dirty = 0; - pPg->needSync = 0; -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - } - pPager->dirtyCache = 0; - pPager->nRec = 0; - }else{ - assert( pPager->aInJournal==0 ); - assert( pPager->dirtyCache==0 || pPager->useJournal==0 ); - } - rc = sqlite3OsUnlock(&pPager->fd, SHARED_LOCK); - pPager->state = PAGER_SHARED; - pPager->origDbSize = 0; - pPager->setMaster = 0; - return rc; -} - -/* -** Compute and return a checksum for the page of data. -** -** This is not a real checksum. It is really just the sum of the -** random initial value and the page number. We experimented with -** a checksum of the entire data, but that was found to be too slow. -** -** Note that the page number is stored at the beginning of data and -** the checksum is stored at the end. This is important. If journal -** corruption occurs due to a power failure, the most likely scenario -** is that one end or the other of the record will be changed. It is -** much less likely that the two ends of the journal record will be -** correct and the middle be corrupt. Thus, this "checksum" scheme, -** though fast and simple, catches the mostly likely kind of corruption. -** -** FIX ME: Consider adding every 200th (or so) byte of the data to the -** checksum. That way if a single page spans 3 or more disk sectors and -** only the middle sector is corrupt, we will still have a reasonable -** chance of failing the checksum and thus detecting the problem. -*/ -static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){ - u32 cksum = pPager->cksumInit; - int i = pPager->pageSize-200; - while( i>0 ){ - cksum += aData[i]; - i -= 200; - } - return cksum; -} - -/* -** Read a single page from the journal file opened on file descriptor -** jfd. Playback this one page. -** -** If useCksum==0 it means this journal does not use checksums. Checksums -** are not used in statement journals because statement journals do not -** need to survive power failures. -*/ -static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){ - int rc; - PgHdr *pPg; /* An existing page in the cache */ - Pgno pgno; /* The page number of a page in journal */ - u32 cksum; /* Checksum used for sanity checking */ - u8 aData[SQLITE_MAX_PAGE_SIZE]; /* Temp storage for a page */ - - /* useCksum should be true for the main journal and false for - ** statement journals. Verify that this is always the case - */ - assert( jfd == (useCksum ? &pPager->jfd : &pPager->stfd) ); - - - rc = read32bits(jfd, &pgno); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3OsRead(jfd, &aData, pPager->pageSize); - if( rc!=SQLITE_OK ) return rc; - pPager->journalOff += pPager->pageSize + 4; - - /* Sanity checking on the page. This is more important that I originally - ** thought. If a power failure occurs while the journal is being written, - ** it could cause invalid data to be written into the journal. We need to - ** detect this invalid data (with high probability) and ignore it. - */ - if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ - return SQLITE_DONE; - } - if( pgno>(unsigned)pPager->dbSize ){ - return SQLITE_OK; - } - if( useCksum ){ - rc = read32bits(jfd, &cksum); - if( rc ) return rc; - pPager->journalOff += 4; - if( pager_cksum(pPager, pgno, aData)!=cksum ){ - return SQLITE_DONE; - } - } - - assert( pPager->state==PAGER_RESERVED || pPager->state>=PAGER_EXCLUSIVE ); - - /* If the pager is in RESERVED state, then there must be a copy of this - ** page in the pager cache. In this case just update the pager cache, - ** not the database file. The page is left marked dirty in this case. - ** - ** If in EXCLUSIVE state, then we update the pager cache if it exists - ** and the main file. The page is then marked not dirty. - ** - ** Ticket #1171: The statement journal might contain page content that is - ** different from the page content at the start of the transaction. - ** This occurs when a page is changed prior to the start of a statement - ** then changed again within the statement. When rolling back such a - ** statement we must not write to the original database unless we know - ** for certain that original page contents are in the main rollback - ** journal. Otherwise, if a full ROLLBACK occurs after the statement - ** rollback the full ROLLBACK will not restore the page to its original - ** content. Two conditions must be met before writing to the database - ** files. (1) the database must be locked. (2) we know that the original - ** page content is in the main journal either because the page is not in - ** cache or else it is marked as needSync==0. - */ - pPg = pager_lookup(pPager, pgno); - assert( pPager->state>=PAGER_EXCLUSIVE || pPg!=0 ); - TRACE3("PLAYBACK %d page %d\n", PAGERID(pPager), pgno); - if( pPager->state>=PAGER_EXCLUSIVE && (pPg==0 || pPg->needSync==0) ){ - rc = sqlite3OsSeek(&pPager->fd, (pgno-1)*(i64)pPager->pageSize); - if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(&pPager->fd, aData, pPager->pageSize); - } - if( pPg ) pPg->dirty = 0; - } - if( pPg ){ - /* No page should ever be explicitly rolled back that is in use, except - ** for page 1 which is held in use in order to keep the lock on the - ** database active. However such a page may be rolled back as a result - ** of an internal error resulting in an automatic call to - ** sqlite3pager_rollback(). - */ - void *pData; - /* assert( pPg->nRef==0 || pPg->pgno==1 ); */ - pData = PGHDR_TO_DATA(pPg); - memcpy(pData, aData, pPager->pageSize); - if( pPager->xDestructor ){ /*** FIX ME: Should this be xReinit? ***/ - pPager->xDestructor(pData, pPager->pageSize); - } -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - CODEC(pPager, pData, pPg->pgno, 3); - } - return rc; -} - -/* -** Parameter zMaster is the name of a master journal file. A single journal -** file that referred to the master journal file has just been rolled back. -** This routine checks if it is possible to delete the master journal file, -** and does so if it is. -** -** The master journal file contains the names of all child journals. -** To tell if a master journal can be deleted, check to each of the -** children. If all children are either missing or do not refer to -** a different master journal, then this master journal can be deleted. -*/ -static int pager_delmaster(const char *zMaster){ - int rc; - int master_open = 0; - OsFile master; - char *zMasterJournal = 0; /* Contents of master journal file */ - i64 nMasterJournal; /* Size of master journal file */ - - /* Open the master journal file exclusively in case some other process - ** is running this routine also. Not that it makes too much difference. - */ - memset(&master, 0, sizeof(master)); - rc = sqlite3OsOpenReadOnly(zMaster, &master); - if( rc!=SQLITE_OK ) goto delmaster_out; - master_open = 1; - rc = sqlite3OsFileSize(&master, &nMasterJournal); - if( rc!=SQLITE_OK ) goto delmaster_out; - - if( nMasterJournal>0 ){ - char *zJournal; - char *zMasterPtr = 0; - - /* Load the entire master journal file into space obtained from - ** sqliteMalloc() and pointed to by zMasterJournal. - */ - zMasterJournal = (char *)sqliteMalloc(nMasterJournal); - if( !zMasterJournal ){ - rc = SQLITE_NOMEM; - goto delmaster_out; - } - rc = sqlite3OsRead(&master, zMasterJournal, nMasterJournal); - if( rc!=SQLITE_OK ) goto delmaster_out; - - zJournal = zMasterJournal; - while( (zJournal-zMasterJournal)<nMasterJournal ){ - if( sqlite3OsFileExists(zJournal) ){ - /* One of the journals pointed to by the master journal exists. - ** Open it and check if it points at the master journal. If - ** so, return without deleting the master journal file. - */ - OsFile journal; - int c; - - memset(&journal, 0, sizeof(journal)); - rc = sqlite3OsOpenReadOnly(zJournal, &journal); - if( rc!=SQLITE_OK ){ - goto delmaster_out; - } - - rc = readMasterJournal(&journal, &zMasterPtr); - sqlite3OsClose(&journal); - if( rc!=SQLITE_OK ){ - goto delmaster_out; - } - - c = zMasterPtr!=0 && strcmp(zMasterPtr, zMaster)==0; - sqliteFree(zMasterPtr); - if( c ){ - /* We have a match. Do not delete the master journal file. */ - goto delmaster_out; - } - } - zJournal += (strlen(zJournal)+1); - } - } - - sqlite3OsDelete(zMaster); - -delmaster_out: - if( zMasterJournal ){ - sqliteFree(zMasterJournal); - } - if( master_open ){ - sqlite3OsClose(&master); - } - return rc; -} - -/* -** Make every page in the cache agree with what is on disk. In other words, -** reread the disk to reset the state of the cache. -** -** This routine is called after a rollback in which some of the dirty cache -** pages had never been written out to disk. We need to roll back the -** cache content and the easiest way to do that is to reread the old content -** back from the disk. -*/ -static int pager_reload_cache(Pager *pPager){ - PgHdr *pPg; - int rc = SQLITE_OK; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - char zBuf[SQLITE_MAX_PAGE_SIZE]; - if( !pPg->dirty ) continue; - if( (int)pPg->pgno <= pPager->origDbSize ){ - rc = sqlite3OsSeek(&pPager->fd, pPager->pageSize*(i64)(pPg->pgno-1)); - if( rc==SQLITE_OK ){ - rc = sqlite3OsRead(&pPager->fd, zBuf, pPager->pageSize); - } - TRACE3("REFETCH %d page %d\n", PAGERID(pPager), pPg->pgno); - if( rc ) break; - CODEC(pPager, zBuf, pPg->pgno, 2); - }else{ - memset(zBuf, 0, pPager->pageSize); - } - if( pPg->nRef==0 || memcmp(zBuf, PGHDR_TO_DATA(pPg), pPager->pageSize) ){ - memcpy(PGHDR_TO_DATA(pPg), zBuf, pPager->pageSize); - if( pPager->xReiniter ){ - pPager->xReiniter(PGHDR_TO_DATA(pPg), pPager->pageSize); - }else{ - memset(PGHDR_TO_EXTRA(pPg, pPager), 0, pPager->nExtra); - } - } - pPg->needSync = 0; - pPg->dirty = 0; -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - } - return rc; -} - -/* -** Truncate the main file of the given pager to the number of pages -** indicated. -*/ -static int pager_truncate(Pager *pPager, int nPage){ - assert( pPager->state>=PAGER_EXCLUSIVE ); - return sqlite3OsTruncate(&pPager->fd, pPager->pageSize*(i64)nPage); -} - -/* -** Playback the journal and thus restore the database file to -** the state it was in before we started making changes. -** -** The journal file format is as follows: -** -** (1) 8 byte prefix. A copy of aJournalMagic[]. -** (2) 4 byte big-endian integer which is the number of valid page records -** in the journal. If this value is 0xffffffff, then compute the -** number of page records from the journal size. -** (3) 4 byte big-endian integer which is the initial value for the -** sanity checksum. -** (4) 4 byte integer which is the number of pages to truncate the -** database to during a rollback. -** (5) 4 byte integer which is the number of bytes in the master journal -** name. The value may be zero (indicate that there is no master -** journal.) -** (6) N bytes of the master journal name. The name will be nul-terminated -** and might be shorter than the value read from (5). If the first byte -** of the name is \000 then there is no master journal. The master -** journal name is stored in UTF-8. -** (7) Zero or more pages instances, each as follows: -** + 4 byte page number. -** + pPager->pageSize bytes of data. -** + 4 byte checksum -** -** When we speak of the journal header, we mean the first 6 items above. -** Each entry in the journal is an instance of the 7th item. -** -** Call the value from the second bullet "nRec". nRec is the number of -** valid page entries in the journal. In most cases, you can compute the -** value of nRec from the size of the journal file. But if a power -** failure occurred while the journal was being written, it could be the -** case that the size of the journal file had already been increased but -** the extra entries had not yet made it safely to disk. In such a case, -** the value of nRec computed from the file size would be too large. For -** that reason, we always use the nRec value in the header. -** -** If the nRec value is 0xffffffff it means that nRec should be computed -** from the file size. This value is used when the user selects the -** no-sync option for the journal. A power failure could lead to corruption -** in this case. But for things like temporary table (which will be -** deleted when the power is restored) we don't care. -** -** If the file opened as the journal file is not a well-formed -** journal file then all pages up to the first corrupted page are rolled -** back (or no pages if the journal header is corrupted). The journal file -** is then deleted and SQLITE_OK returned, just as if no corruption had -** been encountered. -** -** If an I/O or malloc() error occurs, the journal-file is not deleted -** and an error code is returned. -*/ -static int pager_playback(Pager *pPager){ - i64 szJ; /* Size of the journal file in bytes */ - u32 nRec; /* Number of Records in the journal */ - int i; /* Loop counter */ - Pgno mxPg = 0; /* Size of the original file in pages */ - int rc; /* Result code of a subroutine */ - char *zMaster = 0; /* Name of master journal file if any */ - - /* Figure out how many records are in the journal. Abort early if - ** the journal is empty. - */ - assert( pPager->journalOpen ); - rc = sqlite3OsFileSize(&pPager->jfd, &szJ); - if( rc!=SQLITE_OK ){ - goto end_playback; - } - - /* Read the master journal name from the journal, if it is present. - ** If a master journal file name is specified, but the file is not - ** present on disk, then the journal is not hot and does not need to be - ** played back. - */ - rc = readMasterJournal(&pPager->jfd, &zMaster); - assert( rc!=SQLITE_DONE ); - if( rc!=SQLITE_OK || (zMaster && !sqlite3OsFileExists(zMaster)) ){ - sqliteFree(zMaster); - zMaster = 0; - if( rc==SQLITE_DONE ) rc = SQLITE_OK; - goto end_playback; - } - sqlite3OsSeek(&pPager->jfd, 0); - pPager->journalOff = 0; - - /* This loop terminates either when the readJournalHdr() call returns - ** SQLITE_DONE or an IO error occurs. */ - while( 1 ){ - - /* Read the next journal header from the journal file. If there are - ** not enough bytes left in the journal file for a complete header, or - ** it is corrupted, then a process must of failed while writing it. - ** This indicates nothing more needs to be rolled back. - */ - rc = readJournalHdr(pPager, szJ, &nRec, &mxPg); - if( rc!=SQLITE_OK ){ - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - } - goto end_playback; - } - - /* If nRec is 0xffffffff, then this journal was created by a process - ** working in no-sync mode. This means that the rest of the journal - ** file consists of pages, there are no more journal headers. Compute - ** the value of nRec based on this assumption. - */ - if( nRec==0xffffffff ){ - assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ); - nRec = (szJ - JOURNAL_HDR_SZ(pPager))/JOURNAL_PG_SZ(pPager); - } - - /* If this is the first header read from the journal, truncate the - ** database file back to it's original size. - */ - if( pPager->state>=PAGER_EXCLUSIVE && - pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){ - assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg ); - rc = pager_truncate(pPager, mxPg); - if( rc!=SQLITE_OK ){ - goto end_playback; - } - pPager->dbSize = mxPg; - } - - /* rc = sqlite3OsSeek(&pPager->jfd, JOURNAL_HDR_SZ(pPager)); */ - if( rc!=SQLITE_OK ) goto end_playback; - - /* Copy original pages out of the journal and back into the database file. - */ - for(i=0; i<nRec; i++){ - rc = pager_playback_one_page(pPager, &pPager->jfd, 1); - if( rc!=SQLITE_OK ){ - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - pPager->journalOff = szJ; - break; - }else{ - goto end_playback; - } - } - } - } - - /* Pages that have been written to the journal but never synced - ** where not restored by the loop above. We have to restore those - ** pages by reading them back from the original database. - */ - assert( rc==SQLITE_OK ); - pager_reload_cache(pPager); - -end_playback: - if( rc==SQLITE_OK ){ - rc = pager_unwritelock(pPager); - } - if( zMaster ){ - /* If there was a master journal and this routine will return true, - ** see if it is possible to delete the master journal. - */ - if( rc==SQLITE_OK ){ - rc = pager_delmaster(zMaster); - } - sqliteFree(zMaster); - } - - /* The Pager.sectorSize variable may have been updated while rolling - ** back a journal created by a process with a different PAGER_SECTOR_SIZE - ** value. Reset it to the correct value for this process. - */ - pPager->sectorSize = PAGER_SECTOR_SIZE; - return rc; -} - -/* -** Playback the statement journal. -** -** This is similar to playing back the transaction journal but with -** a few extra twists. -** -** (1) The number of pages in the database file at the start of -** the statement is stored in pPager->stmtSize, not in the -** journal file itself. -** -** (2) In addition to playing back the statement journal, also -** playback all pages of the transaction journal beginning -** at offset pPager->stmtJSize. -*/ -static int pager_stmt_playback(Pager *pPager){ - i64 szJ; /* Size of the full journal */ - i64 hdrOff; - int nRec; /* Number of Records */ - int i; /* Loop counter */ - int rc; - - szJ = pPager->journalOff; -#ifndef NDEBUG - { - i64 os_szJ; - rc = sqlite3OsFileSize(&pPager->jfd, &os_szJ); - if( rc!=SQLITE_OK ) return rc; - assert( szJ==os_szJ ); - } -#endif - - /* Set hdrOff to be the offset to the first journal header written - ** this statement transaction, or the end of the file if no journal - ** header was written. - */ - hdrOff = pPager->stmtHdrOff; - assert( pPager->fullSync || !hdrOff ); - if( !hdrOff ){ - hdrOff = szJ; - } - - /* Truncate the database back to its original size. - */ - if( pPager->state>=PAGER_EXCLUSIVE ){ - rc = pager_truncate(pPager, pPager->stmtSize); - } - pPager->dbSize = pPager->stmtSize; - - /* Figure out how many records are in the statement journal. - */ - assert( pPager->stmtInUse && pPager->journalOpen ); - sqlite3OsSeek(&pPager->stfd, 0); - nRec = pPager->stmtNRec; - - /* Copy original pages out of the statement journal and back into the - ** database file. Note that the statement journal omits checksums from - ** each record since power-failure recovery is not important to statement - ** journals. - */ - for(i=nRec-1; i>=0; i--){ - rc = pager_playback_one_page(pPager, &pPager->stfd, 0); - assert( rc!=SQLITE_DONE ); - if( rc!=SQLITE_OK ) goto end_stmt_playback; - } - - /* Now roll some pages back from the transaction journal. Pager.stmtJSize - ** was the size of the journal file when this statement was started, so - ** everything after that needs to be rolled back, either into the - ** database, the memory cache, or both. - ** - ** If it is not zero, then Pager.stmtHdrOff is the offset to the start - ** of the first journal header written during this statement transaction. - */ - rc = sqlite3OsSeek(&pPager->jfd, pPager->stmtJSize); - if( rc!=SQLITE_OK ){ - goto end_stmt_playback; - } - pPager->journalOff = pPager->stmtJSize; - pPager->cksumInit = pPager->stmtCksum; - assert( JOURNAL_HDR_SZ(pPager)<(pPager->pageSize+8) ); - while( pPager->journalOff <= (hdrOff-(pPager->pageSize+8)) ){ - rc = pager_playback_one_page(pPager, &pPager->jfd, 1); - assert( rc!=SQLITE_DONE ); - if( rc!=SQLITE_OK ) goto end_stmt_playback; - } - - while( pPager->journalOff < szJ ){ - u32 nRec; - u32 dummy; - rc = readJournalHdr(pPager, szJ, &nRec, &dummy); - if( rc!=SQLITE_OK ){ - assert( rc!=SQLITE_DONE ); - goto end_stmt_playback; - } - if( nRec==0 ){ - nRec = (szJ - pPager->journalOff) / (pPager->pageSize+8); - } - for(i=nRec-1; i>=0 && pPager->journalOff < szJ; i--){ - rc = pager_playback_one_page(pPager, &pPager->jfd, 1); - assert( rc!=SQLITE_DONE ); - if( rc!=SQLITE_OK ) goto end_stmt_playback; - } - } - - pPager->journalOff = szJ; - -end_stmt_playback: - if( rc!=SQLITE_OK ){ - pPager->errMask |= PAGER_ERR_CORRUPT; - rc = SQLITE_CORRUPT; - }else{ - pPager->journalOff = szJ; - /* pager_reload_cache(pPager); */ - } - return rc; -} - -/* -** Change the maximum number of in-memory pages that are allowed. -*/ -void sqlite3pager_set_cachesize(Pager *pPager, int mxPage){ - if( mxPage>10 ){ - pPager->mxPage = mxPage; - }else{ - pPager->mxPage = 10; - } -} - -/* -** Adjust the robustness of the database to damage due to OS crashes -** or power failures by changing the number of syncs()s when writing -** the rollback journal. There are three levels: -** -** OFF sqlite3OsSync() is never called. This is the default -** for temporary and transient files. -** -** NORMAL The journal is synced once before writes begin on the -** database. This is normally adequate protection, but -** it is theoretically possible, though very unlikely, -** that an inopertune power failure could leave the journal -** in a state which would cause damage to the database -** when it is rolled back. -** -** FULL The journal is synced twice before writes begin on the -** database (with some additional information - the nRec field -** of the journal header - being written in between the two -** syncs). If we assume that writing a -** single disk sector is atomic, then this mode provides -** assurance that the journal will not be corrupted to the -** point of causing damage to the database during rollback. -** -** Numeric values associated with these states are OFF==1, NORMAL=2, -** and FULL=3. -*/ -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -void sqlite3pager_set_safety_level(Pager *pPager, int level){ - pPager->noSync = level==1 || pPager->tempFile; - pPager->fullSync = level==3 && !pPager->tempFile; - if( pPager->noSync ) pPager->needSync = 0; -} -#endif - -/* -** The following global variable is incremented whenever the library -** attempts to open a temporary file. This information is used for -** testing and analysis only. -*/ -int sqlite3_opentemp_count = 0; - -/* -** Open a temporary file. Write the name of the file into zFile -** (zFile must be at least SQLITE_TEMPNAME_SIZE bytes long.) Write -** the file descriptor into *fd. Return SQLITE_OK on success or some -** other error code if we fail. -** -** The OS will automatically delete the temporary file when it is -** closed. -*/ -static int sqlite3pager_opentemp(char *zFile, OsFile *fd){ - int cnt = 8; - int rc; - sqlite3_opentemp_count++; /* Used for testing and analysis only */ - do{ - cnt--; - sqlite3OsTempFileName(zFile); - rc = sqlite3OsOpenExclusive(zFile, fd, 1); - }while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM ); - return rc; -} - -/* -** Create a new page cache and put a pointer to the page cache in *ppPager. -** The file to be cached need not exist. The file is not locked until -** the first call to sqlite3pager_get() and is only held open until the -** last page is released using sqlite3pager_unref(). -** -** If zFilename is NULL then a randomly-named temporary file is created -** and used as the file to be cached. The file will be deleted -** automatically when it is closed. -** -** If zFilename is ":memory:" then all information is held in cache. -** It is never written to disk. This can be used to implement an -** in-memory database. -*/ -int sqlite3pager_open( - Pager **ppPager, /* Return the Pager structure here */ - const char *zFilename, /* Name of the database file to open */ - int nExtra, /* Extra bytes append to each in-memory page */ - int flags /* flags controlling this file */ -){ - Pager *pPager; - char *zFullPathname = 0; - int nameLen; - OsFile fd; - int rc = SQLITE_OK; - int i; - int tempFile = 0; - int memDb = 0; - int readOnly = 0; - int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; - int noReadlock = (flags & PAGER_NO_READLOCK)!=0; - char zTemp[SQLITE_TEMPNAME_SIZE]; - - *ppPager = 0; - memset(&fd, 0, sizeof(fd)); - if( sqlite3_malloc_failed ){ - return SQLITE_NOMEM; - } - if( zFilename && zFilename[0] ){ -#ifndef SQLITE_OMIT_MEMORYDB - if( strcmp(zFilename,":memory:")==0 ){ - memDb = 1; - zFullPathname = sqliteStrDup(""); - rc = SQLITE_OK; - }else -#endif - { - zFullPathname = sqlite3OsFullPathname(zFilename); - if( zFullPathname ){ - rc = sqlite3OsOpenReadWrite(zFullPathname, &fd, &readOnly); - } - } - }else{ - rc = sqlite3pager_opentemp(zTemp, &fd); - zFilename = zTemp; - zFullPathname = sqlite3OsFullPathname(zFilename); - if( rc==SQLITE_OK ){ - tempFile = 1; - } - } - if( !zFullPathname ){ - sqlite3OsClose(&fd); - return SQLITE_NOMEM; - } - if( rc!=SQLITE_OK ){ - sqlite3OsClose(&fd); - sqliteFree(zFullPathname); - return rc; - } - nameLen = strlen(zFullPathname); - pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 ); - if( pPager==0 ){ - sqlite3OsClose(&fd); - sqliteFree(zFullPathname); - return SQLITE_NOMEM; - } - TRACE3("OPEN %d %s\n", FILEHANDLEID(fd), zFullPathname); - pPager->zFilename = (char*)&pPager[1]; - pPager->zDirectory = &pPager->zFilename[nameLen+1]; - pPager->zJournal = &pPager->zDirectory[nameLen+1]; - strcpy(pPager->zFilename, zFullPathname); - strcpy(pPager->zDirectory, zFullPathname); - for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){} - if( i>0 ) pPager->zDirectory[i-1] = 0; - strcpy(pPager->zJournal, zFullPathname); - sqliteFree(zFullPathname); - strcpy(&pPager->zJournal[nameLen], "-journal"); - pPager->fd = fd; -#if OS_UNIX - pPager->fd.pPager = pPager; -#endif - pPager->journalOpen = 0; - pPager->useJournal = useJournal && !memDb; - pPager->noReadlock = noReadlock && readOnly; - pPager->stmtOpen = 0; - pPager->stmtInUse = 0; - pPager->nRef = 0; - pPager->dbSize = memDb-1; - pPager->pageSize = SQLITE_DEFAULT_PAGE_SIZE; - pPager->stmtSize = 0; - pPager->stmtJSize = 0; - pPager->nPage = 0; - pPager->nMaxPage = 0; - pPager->mxPage = 100; - pPager->state = PAGER_UNLOCK; - pPager->errMask = 0; - pPager->tempFile = tempFile; - pPager->memDb = memDb; - pPager->readOnly = readOnly; - pPager->needSync = 0; - pPager->noSync = pPager->tempFile || !useJournal; - pPager->fullSync = (pPager->noSync?0:1); - pPager->pFirst = 0; - pPager->pFirstSynced = 0; - pPager->pLast = 0; - pPager->nExtra = FORCE_ALIGNMENT(nExtra); - pPager->sectorSize = PAGER_SECTOR_SIZE; - pPager->pBusyHandler = 0; - memset(pPager->aHash, 0, sizeof(pPager->aHash)); - *ppPager = pPager; - return SQLITE_OK; -} - -/* -** Set the busy handler function. -*/ -void sqlite3pager_set_busyhandler(Pager *pPager, BusyHandler *pBusyHandler){ - pPager->pBusyHandler = pBusyHandler; -} - -/* -** Set the destructor for this pager. If not NULL, the destructor is called -** when the reference count on each page reaches zero. The destructor can -** be used to clean up information in the extra segment appended to each page. -** -** The destructor is not called as a result sqlite3pager_close(). -** Destructors are only called by sqlite3pager_unref(). -*/ -void sqlite3pager_set_destructor(Pager *pPager, void (*xDesc)(void*,int)){ - pPager->xDestructor = xDesc; -} - -/* -** Set the reinitializer for this pager. If not NULL, the reinitializer -** is called when the content of a page in cache is restored to its original -** value as a result of a rollback. The callback gives higher-level code -** an opportunity to restore the EXTRA section to agree with the restored -** page data. -*/ -void sqlite3pager_set_reiniter(Pager *pPager, void (*xReinit)(void*,int)){ - pPager->xReiniter = xReinit; -} - -/* -** Set the page size. Return the new size. If the suggest new page -** size is inappropriate, then an alternative page size is selected -** and returned. -*/ -int sqlite3pager_set_pagesize(Pager *pPager, int pageSize){ - assert( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE ); - if( !pPager->memDb ){ - pPager->pageSize = pageSize; - } - return pPager->pageSize; -} - -/* -** Read the first N bytes from the beginning of the file into memory -** that pDest points to. No error checking is done. -*/ -void sqlite3pager_read_fileheader(Pager *pPager, int N, unsigned char *pDest){ - memset(pDest, 0, N); - if( MEMDB==0 ){ - sqlite3OsSeek(&pPager->fd, 0); - sqlite3OsRead(&pPager->fd, pDest, N); - } -} - -/* -** Return the total number of pages in the disk file associated with -** pPager. -** -** If the PENDING_BYTE lies on the page directly after the end of the -** file, then consider this page part of the file too. For example, if -** PENDING_BYTE is byte 4096 (the first byte of page 5) and the size of the -** file is 4096 bytes, 5 is returned instead of 4. -*/ -int sqlite3pager_pagecount(Pager *pPager){ - i64 n; - assert( pPager!=0 ); - if( pPager->dbSize>=0 ){ - n = pPager->dbSize; - } else { - if( sqlite3OsFileSize(&pPager->fd, &n)!=SQLITE_OK ){ - pPager->errMask |= PAGER_ERR_DISK; - return 0; - } - if( n>0 && n<pPager->pageSize ){ - n = 1; - }else{ - n /= pPager->pageSize; - } - if( pPager->state!=PAGER_UNLOCK ){ - pPager->dbSize = n; - } - } - if( n==(PENDING_BYTE/pPager->pageSize) ){ - n++; - } - return n; -} - -/* -** Forward declaration -*/ -static int syncJournal(Pager*); - - -/* -** Unlink pPg from it's hash chain. Also set the page number to 0 to indicate -** that the page is not part of any hash chain. This is required because the -** sqlite3pager_movepage() routine can leave a page in the -** pNextFree/pPrevFree list that is not a part of any hash-chain. -*/ -static void unlinkHashChain(Pager *pPager, PgHdr *pPg){ - if( pPg->pgno==0 ){ - /* If the page number is zero, then this page is not in any hash chain. */ - return; - } - if( pPg->pNextHash ){ - pPg->pNextHash->pPrevHash = pPg->pPrevHash; - } - if( pPg->pPrevHash ){ - assert( pPager->aHash[pager_hash(pPg->pgno)]!=pPg ); - pPg->pPrevHash->pNextHash = pPg->pNextHash; - }else{ - int h = pager_hash(pPg->pgno); - assert( pPager->aHash[h]==pPg ); - pPager->aHash[h] = pPg->pNextHash; - } - - pPg->pgno = 0; - pPg->pNextHash = pPg->pPrevHash = 0; -} - -/* -** Unlink a page from the free list (the list of all pages where nRef==0) -** and from its hash collision chain. -*/ -static void unlinkPage(PgHdr *pPg){ - Pager *pPager = pPg->pPager; - - /* Keep the pFirstSynced pointer pointing at the first synchronized page */ - if( pPg==pPager->pFirstSynced ){ - PgHdr *p = pPg->pNextFree; - while( p && p->needSync ){ p = p->pNextFree; } - pPager->pFirstSynced = p; - } - - /* Unlink from the freelist */ - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg->pNextFree; - }else{ - assert( pPager->pFirst==pPg ); - pPager->pFirst = pPg->pNextFree; - } - if( pPg->pNextFree ){ - pPg->pNextFree->pPrevFree = pPg->pPrevFree; - }else{ - assert( pPager->pLast==pPg ); - pPager->pLast = pPg->pPrevFree; - } - pPg->pNextFree = pPg->pPrevFree = 0; - - /* Unlink from the pgno hash table */ - unlinkHashChain(pPager, pPg); -} - -#ifndef SQLITE_OMIT_MEMORYDB -/* -** This routine is used to truncate an in-memory database. Delete -** all pages whose pgno is larger than pPager->dbSize and is unreferenced. -** Referenced pages larger than pPager->dbSize are zeroed. -*/ -static void memoryTruncate(Pager *pPager){ - PgHdr *pPg; - PgHdr **ppPg; - int dbSize = pPager->dbSize; - - ppPg = &pPager->pAll; - while( (pPg = *ppPg)!=0 ){ - if( pPg->pgno<=dbSize ){ - ppPg = &pPg->pNextAll; - }else if( pPg->nRef>0 ){ - memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize); - ppPg = &pPg->pNextAll; - }else{ - *ppPg = pPg->pNextAll; - unlinkPage(pPg); - sqliteFree(pPg); - pPager->nPage--; - } - } -} -#else -#define memoryTruncate(p) -#endif - -/* -** Try to obtain a lock on a file. Invoke the busy callback if the lock -** is currently not available. Repeat until the busy callback returns -** false or until the lock succeeds. -** -** Return SQLITE_OK on success and an error code if we cannot obtain -** the lock. -*/ -static int pager_wait_on_lock(Pager *pPager, int locktype){ - int rc; - assert( PAGER_SHARED==SHARED_LOCK ); - assert( PAGER_RESERVED==RESERVED_LOCK ); - assert( PAGER_EXCLUSIVE==EXCLUSIVE_LOCK ); - if( pPager->state>=locktype ){ - rc = SQLITE_OK; - }else{ - do { - rc = sqlite3OsLock(&pPager->fd, locktype); - }while( rc==SQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) ); - if( rc==SQLITE_OK ){ - pPager->state = locktype; - } - } - return rc; -} - -/* -** Truncate the file to the number of pages specified. -*/ -int sqlite3pager_truncate(Pager *pPager, Pgno nPage){ - int rc; - sqlite3pager_pagecount(pPager); - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - return rc; - } - if( nPage>=(unsigned)pPager->dbSize ){ - return SQLITE_OK; - } - if( MEMDB ){ - pPager->dbSize = nPage; - memoryTruncate(pPager); - return SQLITE_OK; - } - rc = syncJournal(pPager); - if( rc!=SQLITE_OK ){ - return rc; - } - - /* Get an exclusive lock on the database before truncating. */ - rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); - if( rc!=SQLITE_OK ){ - return rc; - } - - rc = pager_truncate(pPager, nPage); - if( rc==SQLITE_OK ){ - pPager->dbSize = nPage; - } - return rc; -} - -/* -** Shutdown the page cache. Free all memory and close all files. -** -** If a transaction was in progress when this routine is called, that -** transaction is rolled back. All outstanding pages are invalidated -** and their memory is freed. Any attempt to use a page associated -** with this page cache after this function returns will likely -** result in a coredump. -*/ -int sqlite3pager_close(Pager *pPager){ - PgHdr *pPg, *pNext; - switch( pPager->state ){ - case PAGER_RESERVED: - case PAGER_SYNCED: - case PAGER_EXCLUSIVE: { - /* We ignore any IO errors that occur during the rollback - ** operation. So disable IO error simulation so that testing - ** works more easily. - */ -#if defined(SQLITE_TEST) && (defined(OS_UNIX) || defined(OS_WIN)) - extern int sqlite3_io_error_pending; - int ioerr_cnt = sqlite3_io_error_pending; - sqlite3_io_error_pending = -1; -#endif - sqlite3pager_rollback(pPager); -#if defined(SQLITE_TEST) && (defined(OS_UNIX) || defined(OS_WIN)) - sqlite3_io_error_pending = ioerr_cnt; -#endif - if( !MEMDB ){ - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - } - assert( pPager->errMask || pPager->journalOpen==0 ); - break; - } - case PAGER_SHARED: { - if( !MEMDB ){ - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - } - break; - } - default: { - /* Do nothing */ - break; - } - } - for(pPg=pPager->pAll; pPg; pPg=pNext){ -#ifndef NDEBUG - if( MEMDB ){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - assert( !pPg->alwaysRollback ); - assert( !pHist->pOrig ); - assert( !pHist->pStmt ); - } -#endif - pNext = pPg->pNextAll; - sqliteFree(pPg); - } - TRACE2("CLOSE %d\n", PAGERID(pPager)); - assert( pPager->errMask || (pPager->journalOpen==0 && pPager->stmtOpen==0) ); - if( pPager->journalOpen ){ - sqlite3OsClose(&pPager->jfd); - } - sqliteFree(pPager->aInJournal); - if( pPager->stmtOpen ){ - sqlite3OsClose(&pPager->stfd); - } - sqlite3OsClose(&pPager->fd); - /* Temp files are automatically deleted by the OS - ** if( pPager->tempFile ){ - ** sqlite3OsDelete(pPager->zFilename); - ** } - */ - - sqliteFree(pPager); - return SQLITE_OK; -} - -/* -** Return the page number for the given page data. -*/ -Pgno sqlite3pager_pagenumber(void *pData){ - PgHdr *p = DATA_TO_PGHDR(pData); - return p->pgno; -} - -/* -** The page_ref() function increments the reference count for a page. -** If the page is currently on the freelist (the reference count is zero) then -** remove it from the freelist. -** -** For non-test systems, page_ref() is a macro that calls _page_ref() -** online of the reference count is zero. For test systems, page_ref() -** is a real function so that we can set breakpoints and trace it. -*/ -static void _page_ref(PgHdr *pPg){ - if( pPg->nRef==0 ){ - /* The page is currently on the freelist. Remove it. */ - if( pPg==pPg->pPager->pFirstSynced ){ - PgHdr *p = pPg->pNextFree; - while( p && p->needSync ){ p = p->pNextFree; } - pPg->pPager->pFirstSynced = p; - } - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg->pNextFree; - }else{ - pPg->pPager->pFirst = pPg->pNextFree; - } - if( pPg->pNextFree ){ - pPg->pNextFree->pPrevFree = pPg->pPrevFree; - }else{ - pPg->pPager->pLast = pPg->pPrevFree; - } - pPg->pPager->nRef++; - } - pPg->nRef++; - REFINFO(pPg); -} -#ifdef SQLITE_DEBUG - static void page_ref(PgHdr *pPg){ - if( pPg->nRef==0 ){ - _page_ref(pPg); - }else{ - pPg->nRef++; - REFINFO(pPg); - } - } -#else -# define page_ref(P) ((P)->nRef==0?_page_ref(P):(void)(P)->nRef++) -#endif - -/* -** Increment the reference count for a page. The input pointer is -** a reference to the page data. -*/ -int sqlite3pager_ref(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - page_ref(pPg); - return SQLITE_OK; -} - -/* -** Sync the journal. In other words, make sure all the pages that have -** been written to the journal have actually reached the surface of the -** disk. It is not safe to modify the original database file until after -** the journal has been synced. If the original database is modified before -** the journal is synced and a power failure occurs, the unsynced journal -** data would be lost and we would be unable to completely rollback the -** database changes. Database corruption would occur. -** -** This routine also updates the nRec field in the header of the journal. -** (See comments on the pager_playback() routine for additional information.) -** If the sync mode is FULL, two syncs will occur. First the whole journal -** is synced, then the nRec field is updated, then a second sync occurs. -** -** For temporary databases, we do not care if we are able to rollback -** after a power failure, so sync occurs. -** -** This routine clears the needSync field of every page current held in -** memory. -*/ -static int syncJournal(Pager *pPager){ - PgHdr *pPg; - int rc = SQLITE_OK; - - /* Sync the journal before modifying the main database - ** (assuming there is a journal and it needs to be synced.) - */ - if( pPager->needSync ){ - if( !pPager->tempFile ){ - assert( pPager->journalOpen ); - /* assert( !pPager->noSync ); // noSync might be set if synchronous - ** was turned off after the transaction was started. Ticket #615 */ -#ifndef NDEBUG - { - /* Make sure the pPager->nRec counter we are keeping agrees - ** with the nRec computed from the size of the journal file. - */ - i64 jSz; - rc = sqlite3OsFileSize(&pPager->jfd, &jSz); - if( rc!=0 ) return rc; - assert( pPager->journalOff==jSz ); - } -#endif - { - /* Write the nRec value into the journal file header. If in - ** full-synchronous mode, sync the journal first. This ensures that - ** all data has really hit the disk before nRec is updated to mark - ** it as a candidate for rollback. - */ - if( pPager->fullSync ){ - TRACE2("SYNC journal of %d\n", PAGERID(pPager)); - rc = sqlite3OsSync(&pPager->jfd, 0); - if( rc!=0 ) return rc; - } - rc = sqlite3OsSeek(&pPager->jfd, - pPager->journalHdr + sizeof(aJournalMagic)); - if( rc ) return rc; - rc = write32bits(&pPager->jfd, pPager->nRec); - if( rc ) return rc; - - rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff); - if( rc ) return rc; - } - TRACE2("SYNC journal of %d\n", PAGERID(pPager)); - rc = sqlite3OsSync(&pPager->jfd, pPager->fullSync); - if( rc!=0 ) return rc; - pPager->journalStarted = 1; - } - pPager->needSync = 0; - - /* Erase the needSync flag from every page. - */ - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - pPg->needSync = 0; - } - pPager->pFirstSynced = pPager->pFirst; - } - -#ifndef NDEBUG - /* If the Pager.needSync flag is clear then the PgHdr.needSync - ** flag must also be clear for all pages. Verify that this - ** invariant is true. - */ - else{ - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - assert( pPg->needSync==0 ); - } - assert( pPager->pFirstSynced==pPager->pFirst ); - } -#endif - - return rc; -} - -/* -** Given a list of pages (connected by the PgHdr.pDirty pointer) write -** every one of those pages out to the database file and mark them all -** as clean. -*/ -static int pager_write_pagelist(PgHdr *pList){ - Pager *pPager; - int rc; - - if( pList==0 ) return SQLITE_OK; - pPager = pList->pPager; - - /* At this point there may be either a RESERVED or EXCLUSIVE lock on the - ** database file. If there is already an EXCLUSIVE lock, the following - ** calls to sqlite3OsLock() are no-ops. - ** - ** Moving the lock from RESERVED to EXCLUSIVE actually involves going - ** through an intermediate state PENDING. A PENDING lock prevents new - ** readers from attaching to the database but is unsufficient for us to - ** write. The idea of a PENDING lock is to prevent new readers from - ** coming in while we wait for existing readers to clear. - ** - ** While the pager is in the RESERVED state, the original database file - ** is unchanged and we can rollback without having to playback the - ** journal into the original database file. Once we transition to - ** EXCLUSIVE, it means the database file has been changed and any rollback - ** will require a journal playback. - */ - rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); - if( rc!=SQLITE_OK ){ - return rc; - } - - while( pList ){ - assert( pList->dirty ); - rc = sqlite3OsSeek(&pPager->fd, (pList->pgno-1)*(i64)pPager->pageSize); - if( rc ) return rc; - /* If there are dirty pages in the page cache with page numbers greater - ** than Pager.dbSize, this means sqlite3pager_truncate() was called to - ** make the file smaller (presumably by auto-vacuum code). Do not write - ** any such pages to the file. - */ - if( pList->pgno<=pPager->dbSize ){ - CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6); - TRACE3("STORE %d page %d\n", PAGERID(pPager), pList->pgno); - rc = sqlite3OsWrite(&pPager->fd, PGHDR_TO_DATA(pList), pPager->pageSize); - CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 0); - TEST_INCR(pPager->nWrite); - } -#ifndef NDEBUG - else{ - TRACE3("NOSTORE %d page %d\n", PAGERID(pPager), pList->pgno); - } -#endif - if( rc ) return rc; - pList->dirty = 0; -#ifdef SQLITE_CHECK_PAGES - pList->pageHash = pager_pagehash(pList); -#endif - pList = pList->pDirty; - } - return SQLITE_OK; -} - -/* -** Collect every dirty page into a dirty list and -** return a pointer to the head of that list. All pages are -** collected even if they are still in use. -*/ -static PgHdr *pager_get_all_dirty_pages(Pager *pPager){ - PgHdr *p, *pList; - pList = 0; - for(p=pPager->pAll; p; p=p->pNextAll){ - if( p->dirty ){ - p->pDirty = pList; - pList = p; - } - } - return pList; -} - -/* -** Return TRUE if there is a hot journal on the given pager. -** A hot journal is one that needs to be played back. -** -** If the current size of the database file is 0 but a journal file -** exists, that is probably an old journal left over from a prior -** database with the same name. Just delete the journal. -*/ -static int hasHotJournal(Pager *pPager){ - if( !pPager->useJournal ) return 0; - if( !sqlite3OsFileExists(pPager->zJournal) ) return 0; - if( sqlite3OsCheckReservedLock(&pPager->fd) ) return 0; - if( sqlite3pager_pagecount(pPager)==0 ){ - sqlite3OsDelete(pPager->zJournal); - return 0; - }else{ - return 1; - } -} - -/* -** Acquire a page. -** -** A read lock on the disk file is obtained when the first page is acquired. -** This read lock is dropped when the last page is released. -** -** A _get works for any page number greater than 0. If the database -** file is smaller than the requested page, then no actual disk -** read occurs and the memory image of the page is initialized to -** all zeros. The extra data appended to a page is always initialized -** to zeros the first time a page is loaded into memory. -** -** The acquisition might fail for several reasons. In all cases, -** an appropriate error code is returned and *ppPage is set to NULL. -** -** See also sqlite3pager_lookup(). Both this routine and _lookup() attempt -** to find a page in the in-memory cache first. If the page is not already -** in memory, this routine goes to disk to read it in whereas _lookup() -** just returns 0. This routine acquires a read-lock the first time it -** has to go to disk, and could also playback an old journal if necessary. -** Since _lookup() never goes to disk, it never has to deal with locks -** or journal files. -*/ -int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){ - PgHdr *pPg; - int rc; - - /* The maximum page number is 2^31. Return SQLITE_CORRUPT if a page - ** number greater than this, or zero, is requested. - */ - if( pgno>PAGER_MAX_PGNO || pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ - return SQLITE_CORRUPT_BKPT; - } - - /* Make sure we have not hit any critical errors. - */ - assert( pPager!=0 ); - *ppPage = 0; - if( pPager->errMask & ~(PAGER_ERR_FULL) ){ - return pager_errcode(pPager); - } - - /* If this is the first page accessed, then get a SHARED lock - ** on the database file. - */ - if( pPager->nRef==0 && !MEMDB ){ - if( !pPager->noReadlock ){ - rc = pager_wait_on_lock(pPager, SHARED_LOCK); - if( rc!=SQLITE_OK ){ - return rc; - } - } - - /* If a journal file exists, and there is no RESERVED lock on the - ** database file, then it either needs to be played back or deleted. - */ - if( hasHotJournal(pPager) ){ - int rc; - - /* Get an EXCLUSIVE lock on the database file. At this point it is - ** important that a RESERVED lock is not obtained on the way to the - ** EXCLUSIVE lock. If it were, another process might open the - ** database file, detect the RESERVED lock, and conclude that the - ** database is safe to read while this process is still rolling it - ** back. - ** - ** Because the intermediate RESERVED lock is not requested, the - ** second process will get to this point in the code and fail to - ** obtain it's own EXCLUSIVE lock on the database file. - */ - rc = sqlite3OsLock(&pPager->fd, EXCLUSIVE_LOCK); - if( rc!=SQLITE_OK ){ - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - pPager->state = PAGER_UNLOCK; - return rc; - } - pPager->state = PAGER_EXCLUSIVE; - - /* Open the journal for reading only. Return SQLITE_BUSY if - ** we are unable to open the journal file. - ** - ** The journal file does not need to be locked itself. The - ** journal file is never open unless the main database file holds - ** a write lock, so there is never any chance of two or more - ** processes opening the journal at the same time. - */ - rc = sqlite3OsOpenReadOnly(pPager->zJournal, &pPager->jfd); - if( rc!=SQLITE_OK ){ - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - pPager->state = PAGER_UNLOCK; - return SQLITE_BUSY; - } - pPager->journalOpen = 1; - pPager->journalStarted = 0; - pPager->journalOff = 0; - pPager->setMaster = 0; - pPager->journalHdr = 0; - - /* Playback and delete the journal. Drop the database write - ** lock and reacquire the read lock. - */ - rc = pager_playback(pPager); - if( rc!=SQLITE_OK ){ - return rc; - } - } - pPg = 0; - }else{ - /* Search for page in cache */ - pPg = pager_lookup(pPager, pgno); - if( MEMDB && pPager->state==PAGER_UNLOCK ){ - pPager->state = PAGER_SHARED; - } - } - if( pPg==0 ){ - /* The requested page is not in the page cache. */ - int h; - TEST_INCR(pPager->nMiss); - if( pPager->nPage<pPager->mxPage || pPager->pFirst==0 || MEMDB ){ - /* Create a new page */ - pPg = sqliteMallocRaw( sizeof(*pPg) + pPager->pageSize - + sizeof(u32) + pPager->nExtra - + MEMDB*sizeof(PgHistory) ); - if( pPg==0 ){ - pPager->errMask |= PAGER_ERR_MEM; - return SQLITE_NOMEM; - } - memset(pPg, 0, sizeof(*pPg)); - if( MEMDB ){ - memset(PGHDR_TO_HIST(pPg, pPager), 0, sizeof(PgHistory)); - } - pPg->pPager = pPager; - pPg->pNextAll = pPager->pAll; - pPager->pAll = pPg; - pPager->nPage++; - if( pPager->nPage>pPager->nMaxPage ){ - assert( pPager->nMaxPage==(pPager->nPage-1) ); - pPager->nMaxPage++; - } - }else{ - /* Find a page to recycle. Try to locate a page that does not - ** require us to do an fsync() on the journal. - */ - pPg = pPager->pFirstSynced; - - /* If we could not find a page that does not require an fsync() - ** on the journal file then fsync the journal file. This is a - ** very slow operation, so we work hard to avoid it. But sometimes - ** it can't be helped. - */ - if( pPg==0 ){ - int rc = syncJournal(pPager); - if( rc!=0 ){ - sqlite3pager_rollback(pPager); - return SQLITE_IOERR; - } - if( pPager->fullSync ){ - /* If in full-sync mode, write a new journal header into the - ** journal file. This is done to avoid ever modifying a journal - ** header that is involved in the rollback of pages that have - ** already been written to the database (in case the header is - ** trashed when the nRec field is updated). - */ - pPager->nRec = 0; - assert( pPager->journalOff > 0 ); - rc = writeJournalHdr(pPager); - if( rc!=0 ){ - sqlite3pager_rollback(pPager); - return SQLITE_IOERR; - } - } - pPg = pPager->pFirst; - } - assert( pPg->nRef==0 ); - - /* Write the page to the database file if it is dirty. - */ - if( pPg->dirty ){ - assert( pPg->needSync==0 ); - pPg->pDirty = 0; - rc = pager_write_pagelist( pPg ); - if( rc!=SQLITE_OK ){ - sqlite3pager_rollback(pPager); - return SQLITE_IOERR; - } - } - assert( pPg->dirty==0 ); - - /* If the page we are recycling is marked as alwaysRollback, then - ** set the global alwaysRollback flag, thus disabling the - ** sqlite_dont_rollback() optimization for the rest of this transaction. - ** It is necessary to do this because the page marked alwaysRollback - ** might be reloaded at a later time but at that point we won't remember - ** that is was marked alwaysRollback. This means that all pages must - ** be marked as alwaysRollback from here on out. - */ - if( pPg->alwaysRollback ){ - pPager->alwaysRollback = 1; - } - - /* Unlink the old page from the free list and the hash table - */ - unlinkPage(pPg); - TEST_INCR(pPager->nOvfl); - } - pPg->pgno = pgno; - if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){ - sqlite3CheckMemory(pPager->aInJournal, pgno/8); - assert( pPager->journalOpen ); - pPg->inJournal = (pPager->aInJournal[pgno/8] & (1<<(pgno&7)))!=0; - pPg->needSync = 0; - }else{ - pPg->inJournal = 0; - pPg->needSync = 0; - } - if( pPager->aInStmt && (int)pgno<=pPager->stmtSize - && (pPager->aInStmt[pgno/8] & (1<<(pgno&7)))!=0 ){ - page_add_to_stmt_list(pPg); - }else{ - page_remove_from_stmt_list(pPg); - } - pPg->dirty = 0; - pPg->nRef = 1; - REFINFO(pPg); - pPager->nRef++; - h = pager_hash(pgno); - pPg->pNextHash = pPager->aHash[h]; - pPager->aHash[h] = pPg; - if( pPg->pNextHash ){ - assert( pPg->pNextHash->pPrevHash==0 ); - pPg->pNextHash->pPrevHash = pPg; - } - if( pPager->nExtra>0 ){ - memset(PGHDR_TO_EXTRA(pPg, pPager), 0, pPager->nExtra); - } - if( pPager->errMask!=0 ){ - sqlite3pager_unref(PGHDR_TO_DATA(pPg)); - rc = pager_errcode(pPager); - return rc; - } - if( sqlite3pager_pagecount(pPager)<(int)pgno ){ - memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize); - }else{ - int rc; - assert( MEMDB==0 ); - rc = sqlite3OsSeek(&pPager->fd, (pgno-1)*(i64)pPager->pageSize); - if( rc==SQLITE_OK ){ - rc = sqlite3OsRead(&pPager->fd, PGHDR_TO_DATA(pPg), pPager->pageSize); - } - TRACE3("FETCH %d page %d\n", PAGERID(pPager), pPg->pgno); - CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); - if( rc!=SQLITE_OK ){ - i64 fileSize; - if( sqlite3OsFileSize(&pPager->fd,&fileSize)!=SQLITE_OK - || fileSize>=pgno*pPager->pageSize ){ - sqlite3pager_unref(PGHDR_TO_DATA(pPg)); - return rc; - }else{ - memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize); - } - }else{ - TEST_INCR(pPager->nRead); - } - } -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - }else{ - /* The requested page is in the page cache. */ - TEST_INCR(pPager->nHit); - page_ref(pPg); - } - *ppPage = PGHDR_TO_DATA(pPg); - return SQLITE_OK; -} - -/* -** Acquire a page if it is already in the in-memory cache. Do -** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. -** -** See also sqlite3pager_get(). The difference between this routine -** and sqlite3pager_get() is that _get() will go to the disk and read -** in the page if the page is not already in cache. This routine -** returns NULL if the page is not in cache or if a disk I/O error -** has ever happened. -*/ -void *sqlite3pager_lookup(Pager *pPager, Pgno pgno){ - PgHdr *pPg; - - assert( pPager!=0 ); - assert( pgno!=0 ); - if( pPager->errMask & ~(PAGER_ERR_FULL) ){ - return 0; - } - pPg = pager_lookup(pPager, pgno); - if( pPg==0 ) return 0; - page_ref(pPg); - return PGHDR_TO_DATA(pPg); -} - -/* -** Release a page. -** -** If the number of references to the page drop to zero, then the -** page is added to the LRU list. When all references to all pages -** are released, a rollback occurs and the lock on the database is -** removed. -*/ -int sqlite3pager_unref(void *pData){ - PgHdr *pPg; - - /* Decrement the reference count for this page - */ - pPg = DATA_TO_PGHDR(pData); - assert( pPg->nRef>0 ); - pPg->nRef--; - REFINFO(pPg); - - CHECK_PAGE(pPg); - - /* When the number of references to a page reach 0, call the - ** destructor and add the page to the freelist. - */ - if( pPg->nRef==0 ){ - Pager *pPager; - pPager = pPg->pPager; - pPg->pNextFree = 0; - pPg->pPrevFree = pPager->pLast; - pPager->pLast = pPg; - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg; - }else{ - pPager->pFirst = pPg; - } - if( pPg->needSync==0 && pPager->pFirstSynced==0 ){ - pPager->pFirstSynced = pPg; - } - if( pPager->xDestructor ){ - pPager->xDestructor(pData, pPager->pageSize); - } - - /* When all pages reach the freelist, drop the read lock from - ** the database file. - */ - pPager->nRef--; - assert( pPager->nRef>=0 ); - if( pPager->nRef==0 && !MEMDB ){ - pager_reset(pPager); - } - } - return SQLITE_OK; -} - -/* -** Create a journal file for pPager. There should already be a RESERVED -** or EXCLUSIVE lock on the database file when this routine is called. -** -** Return SQLITE_OK if everything. Return an error code and release the -** write lock if anything goes wrong. -*/ -static int pager_open_journal(Pager *pPager){ - int rc; - assert( !MEMDB ); - assert( pPager->state>=PAGER_RESERVED ); - assert( pPager->journalOpen==0 ); - assert( pPager->useJournal ); - assert( pPager->aInJournal==0 ); - sqlite3pager_pagecount(pPager); - pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 ); - if( pPager->aInJournal==0 ){ - rc = SQLITE_NOMEM; - goto failed_to_open_journal; - } - rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile); - pPager->journalOff = 0; - pPager->setMaster = 0; - pPager->journalHdr = 0; - if( rc!=SQLITE_OK ){ - goto failed_to_open_journal; - } - SET_FULLSYNC(pPager->jfd, pPager->fullSync); - SET_FULLSYNC(pPager->fd, pPager->fullSync); - sqlite3OsOpenDirectory(pPager->zDirectory, &pPager->jfd); - pPager->journalOpen = 1; - pPager->journalStarted = 0; - pPager->needSync = 0; - pPager->alwaysRollback = 0; - pPager->nRec = 0; - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - goto failed_to_open_journal; - } - pPager->origDbSize = pPager->dbSize; - - rc = writeJournalHdr(pPager); - - if( pPager->stmtAutoopen && rc==SQLITE_OK ){ - rc = sqlite3pager_stmt_begin(pPager); - } - if( rc!=SQLITE_OK ){ - rc = pager_unwritelock(pPager); - if( rc==SQLITE_OK ){ - rc = SQLITE_FULL; - } - } - return rc; - -failed_to_open_journal: - sqliteFree(pPager->aInJournal); - pPager->aInJournal = 0; - sqlite3OsUnlock(&pPager->fd, NO_LOCK); - pPager->state = PAGER_UNLOCK; - return rc; -} - -/* -** Acquire a write-lock on the database. The lock is removed when -** the any of the following happen: -** -** * sqlite3pager_commit() is called. -** * sqlite3pager_rollback() is called. -** * sqlite3pager_close() is called. -** * sqlite3pager_unref() is called to on every outstanding page. -** -** The first parameter to this routine is a pointer to any open page of the -** database file. Nothing changes about the page - it is used merely to -** acquire a pointer to the Pager structure and as proof that there is -** already a read-lock on the database. -** -** The second parameter indicates how much space in bytes to reserve for a -** master journal file-name at the start of the journal when it is created. -** -** A journal file is opened if this is not a temporary file. For temporary -** files, the opening of the journal file is deferred until there is an -** actual need to write to the journal. -** -** If the database is already reserved for writing, this routine is a no-op. -** -** If exFlag is true, go ahead and get an EXCLUSIVE lock on the file -** immediately instead of waiting until we try to flush the cache. The -** exFlag is ignored if a transaction is already active. -*/ -int sqlite3pager_begin(void *pData, int exFlag){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - int rc = SQLITE_OK; - assert( pPg->nRef>0 ); - assert( pPager->state!=PAGER_UNLOCK ); - if( pPager->state==PAGER_SHARED ){ - assert( pPager->aInJournal==0 ); - if( MEMDB ){ - pPager->state = PAGER_EXCLUSIVE; - pPager->origDbSize = pPager->dbSize; - }else{ - rc = sqlite3OsLock(&pPager->fd, RESERVED_LOCK); - if( rc==SQLITE_OK ){ - pPager->state = PAGER_RESERVED; - if( exFlag ){ - rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); - } - } - if( rc!=SQLITE_OK ){ - return rc; - } - pPager->dirtyCache = 0; - TRACE2("TRANSACTION %d\n", PAGERID(pPager)); - if( pPager->useJournal && !pPager->tempFile ){ - rc = pager_open_journal(pPager); - } - } - } - return rc; -} - -/* -** Mark a data page as writeable. The page is written into the journal -** if it is not there already. This routine must be called before making -** changes to a page. -** -** The first time this routine is called, the pager creates a new -** journal and acquires a RESERVED lock on the database. If the RESERVED -** lock could not be acquired, this routine returns SQLITE_BUSY. The -** calling routine must check for that return value and be careful not to -** change any page data until this routine returns SQLITE_OK. -** -** If the journal file could not be written because the disk is full, -** then this routine returns SQLITE_FULL and does an immediate rollback. -** All subsequent write attempts also return SQLITE_FULL until there -** is a call to sqlite3pager_commit() or sqlite3pager_rollback() to -** reset. -*/ -int sqlite3pager_write(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - int rc = SQLITE_OK; - - /* Check for errors - */ - if( pPager->errMask ){ - return pager_errcode(pPager); - } - if( pPager->readOnly ){ - return SQLITE_PERM; - } - - assert( !pPager->setMaster ); - - CHECK_PAGE(pPg); - - /* Mark the page as dirty. If the page has already been written - ** to the journal then we can return right away. - */ - pPg->dirty = 1; - if( pPg->inJournal && (pPg->inStmt || pPager->stmtInUse==0) ){ - pPager->dirtyCache = 1; - }else{ - - /* If we get this far, it means that the page needs to be - ** written to the transaction journal or the ckeckpoint journal - ** or both. - ** - ** First check to see that the transaction journal exists and - ** create it if it does not. - */ - assert( pPager->state!=PAGER_UNLOCK ); - rc = sqlite3pager_begin(pData, 0); - if( rc!=SQLITE_OK ){ - return rc; - } - assert( pPager->state>=PAGER_RESERVED ); - if( !pPager->journalOpen && pPager->useJournal ){ - rc = pager_open_journal(pPager); - if( rc!=SQLITE_OK ) return rc; - } - assert( pPager->journalOpen || !pPager->useJournal ); - pPager->dirtyCache = 1; - - /* The transaction journal now exists and we have a RESERVED or an - ** EXCLUSIVE lock on the main database file. Write the current page to - ** the transaction journal if it is not there already. - */ - if( !pPg->inJournal && (pPager->useJournal || MEMDB) ){ - if( (int)pPg->pgno <= pPager->origDbSize ){ - int szPg; - u32 saved; - if( MEMDB ){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - TRACE3("JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); - assert( pHist->pOrig==0 ); - pHist->pOrig = sqliteMallocRaw( pPager->pageSize ); - if( pHist->pOrig ){ - memcpy(pHist->pOrig, PGHDR_TO_DATA(pPg), pPager->pageSize); - } - }else{ - u32 cksum; - /* We should never write to the journal file the page that - ** contains the database locks. The following assert verifies - ** that we do not. */ - assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); - CODEC(pPager, pData, pPg->pgno, 7); - cksum = pager_cksum(pPager, pPg->pgno, pData); - saved = *(u32*)PGHDR_TO_EXTRA(pPg, pPager); - store32bits(cksum, pPg, pPager->pageSize); - szPg = pPager->pageSize+8; - store32bits(pPg->pgno, pPg, -4); - rc = sqlite3OsWrite(&pPager->jfd, &((char*)pData)[-4], szPg); - pPager->journalOff += szPg; - TRACE4("JOURNAL %d page %d needSync=%d\n", - PAGERID(pPager), pPg->pgno, pPg->needSync); - CODEC(pPager, pData, pPg->pgno, 0); - *(u32*)PGHDR_TO_EXTRA(pPg, pPager) = saved; - if( rc!=SQLITE_OK ){ - sqlite3pager_rollback(pPager); - pPager->errMask |= PAGER_ERR_FULL; - return rc; - } - pPager->nRec++; - assert( pPager->aInJournal!=0 ); - pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); - pPg->needSync = !pPager->noSync; - if( pPager->stmtInUse ){ - pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_stmt_list(pPg); - } - } - }else{ - pPg->needSync = !pPager->journalStarted && !pPager->noSync; - TRACE4("APPEND %d page %d needSync=%d\n", - PAGERID(pPager), pPg->pgno, pPg->needSync); - } - if( pPg->needSync ){ - pPager->needSync = 1; - } - pPg->inJournal = 1; - } - - /* If the statement journal is open and the page is not in it, - ** then write the current page to the statement journal. Note that - ** the statement journal format differs from the standard journal format - ** in that it omits the checksums and the header. - */ - if( pPager->stmtInUse && !pPg->inStmt && (int)pPg->pgno<=pPager->stmtSize ){ - assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); - if( MEMDB ){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - assert( pHist->pStmt==0 ); - pHist->pStmt = sqliteMallocRaw( pPager->pageSize ); - if( pHist->pStmt ){ - memcpy(pHist->pStmt, PGHDR_TO_DATA(pPg), pPager->pageSize); - } - TRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); - }else{ - store32bits(pPg->pgno, pPg, -4); - CODEC(pPager, pData, pPg->pgno, 7); - rc = sqlite3OsWrite(&pPager->stfd,((char*)pData)-4, pPager->pageSize+4); - TRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); - CODEC(pPager, pData, pPg->pgno, 0); - if( rc!=SQLITE_OK ){ - sqlite3pager_rollback(pPager); - pPager->errMask |= PAGER_ERR_FULL; - return rc; - } - pPager->stmtNRec++; - assert( pPager->aInStmt!=0 ); - pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - } - page_add_to_stmt_list(pPg); - } - } - - /* Update the database size and return. - */ - if( pPager->dbSize<(int)pPg->pgno ){ - pPager->dbSize = pPg->pgno; - if( !MEMDB && pPager->dbSize==PENDING_BYTE/pPager->pageSize ){ - pPager->dbSize++; - } - } - return rc; -} - -/* -** Return TRUE if the page given in the argument was previously passed -** to sqlite3pager_write(). In other words, return TRUE if it is ok -** to change the content of the page. -*/ -int sqlite3pager_iswriteable(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - return pPg->dirty; -} - -#ifndef SQLITE_OMIT_VACUUM -/* -** Replace the content of a single page with the information in the third -** argument. -*/ -int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void *pData){ - void *pPage; - int rc; - - rc = sqlite3pager_get(pPager, pgno, &pPage); - if( rc==SQLITE_OK ){ - rc = sqlite3pager_write(pPage); - if( rc==SQLITE_OK ){ - memcpy(pPage, pData, pPager->pageSize); - } - sqlite3pager_unref(pPage); - } - return rc; -} -#endif - -/* -** A call to this routine tells the pager that it is not necessary to -** write the information on page "pgno" back to the disk, even though -** that page might be marked as dirty. -** -** The overlying software layer calls this routine when all of the data -** on the given page is unused. The pager marks the page as clean so -** that it does not get written to disk. -** -** Tests show that this optimization, together with the -** sqlite3pager_dont_rollback() below, more than double the speed -** of large INSERT operations and quadruple the speed of large DELETEs. -** -** When this routine is called, set the alwaysRollback flag to true. -** Subsequent calls to sqlite3pager_dont_rollback() for the same page -** will thereafter be ignored. This is necessary to avoid a problem -** where a page with data is added to the freelist during one part of -** a transaction then removed from the freelist during a later part -** of the same transaction and reused for some other purpose. When it -** is first added to the freelist, this routine is called. When reused, -** the dont_rollback() routine is called. But because the page contains -** critical data, we still need to be sure it gets rolled back in spite -** of the dont_rollback() call. -*/ -void sqlite3pager_dont_write(Pager *pPager, Pgno pgno){ - PgHdr *pPg; - - if( MEMDB ) return; - - pPg = pager_lookup(pPager, pgno); - pPg->alwaysRollback = 1; - if( pPg && pPg->dirty ){ - if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSize<pPager->dbSize ){ - /* If this pages is the last page in the file and the file has grown - ** during the current transaction, then do NOT mark the page as clean. - ** When the database file grows, we must make sure that the last page - ** gets written at least once so that the disk file will be the correct - ** size. If you do not write this page and the size of the file - ** on the disk ends up being too small, that can lead to database - ** corruption during the next transaction. - */ - }else{ - TRACE3("DONT_WRITE page %d of %d\n", pgno, PAGERID(pPager)); - pPg->dirty = 0; -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - } - } -} - -/* -** A call to this routine tells the pager that if a rollback occurs, -** it is not necessary to restore the data on the given page. This -** means that the pager does not have to record the given page in the -** rollback journal. -*/ -void sqlite3pager_dont_rollback(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - - if( pPager->state!=PAGER_EXCLUSIVE || pPager->journalOpen==0 ) return; - if( pPg->alwaysRollback || pPager->alwaysRollback || MEMDB ) return; - if( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ){ - assert( pPager->aInJournal!=0 ); - pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); - pPg->inJournal = 1; - if( pPager->stmtInUse ){ - pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_stmt_list(pPg); - } - TRACE3("DONT_ROLLBACK page %d of %d\n", pPg->pgno, PAGERID(pPager)); - } - if( pPager->stmtInUse && !pPg->inStmt && (int)pPg->pgno<=pPager->stmtSize ){ - assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); - assert( pPager->aInStmt!=0 ); - pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_stmt_list(pPg); - } -} - - -#ifndef SQLITE_OMIT_MEMORYDB -/* -** Clear a PgHistory block -*/ -static void clearHistory(PgHistory *pHist){ - sqliteFree(pHist->pOrig); - sqliteFree(pHist->pStmt); - pHist->pOrig = 0; - pHist->pStmt = 0; -} -#else -#define clearHistory(x) -#endif - -/* -** Commit all changes to the database and release the write lock. -** -** If the commit fails for any reason, a rollback attempt is made -** and an error code is returned. If the commit worked, SQLITE_OK -** is returned. -*/ -int sqlite3pager_commit(Pager *pPager){ - int rc; - PgHdr *pPg; - - if( pPager->errMask==PAGER_ERR_FULL ){ - rc = sqlite3pager_rollback(pPager); - if( rc==SQLITE_OK ){ - rc = SQLITE_FULL; - } - return rc; - } - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - return rc; - } - if( pPager->state<PAGER_RESERVED ){ - return SQLITE_ERROR; - } - TRACE2("COMMIT %d\n", PAGERID(pPager)); - if( MEMDB ){ - pPg = pager_get_all_dirty_pages(pPager); - while( pPg ){ - clearHistory(PGHDR_TO_HIST(pPg, pPager)); - pPg->dirty = 0; - pPg->inJournal = 0; - pPg->inStmt = 0; - pPg->pPrevStmt = pPg->pNextStmt = 0; - pPg = pPg->pDirty; - } -#ifndef NDEBUG - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - assert( !pPg->alwaysRollback ); - assert( !pHist->pOrig ); - assert( !pHist->pStmt ); - } -#endif - pPager->pStmt = 0; - pPager->state = PAGER_SHARED; - return SQLITE_OK; - } - if( pPager->dirtyCache==0 ){ - /* Exit early (without doing the time-consuming sqlite3OsSync() calls) - ** if there have been no changes to the database file. */ - assert( pPager->needSync==0 ); - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - } - assert( pPager->journalOpen ); - rc = sqlite3pager_sync(pPager, 0, 0); - if( rc!=SQLITE_OK ){ - goto commit_abort; - } - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - - /* Jump here if anything goes wrong during the commit process. - */ -commit_abort: - sqlite3pager_rollback(pPager); - return rc; -} - -/* -** Rollback all changes. The database falls back to PAGER_SHARED mode. -** All in-memory cache pages revert to their original data contents. -** The journal is deleted. -** -** This routine cannot fail unless some other process is not following -** the correct locking protocol (SQLITE_PROTOCOL) or unless some other -** process is writing trash into the journal file (SQLITE_CORRUPT) or -** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error -** codes are returned for all these occasions. Otherwise, -** SQLITE_OK is returned. -*/ -int sqlite3pager_rollback(Pager *pPager){ - int rc; - TRACE2("ROLLBACK %d\n", PAGERID(pPager)); - if( MEMDB ){ - PgHdr *p; - for(p=pPager->pAll; p; p=p->pNextAll){ - PgHistory *pHist; - assert( !p->alwaysRollback ); - if( !p->dirty ){ - assert( !((PgHistory *)PGHDR_TO_HIST(p, pPager))->pOrig ); - assert( !((PgHistory *)PGHDR_TO_HIST(p, pPager))->pStmt ); - continue; - } - - pHist = PGHDR_TO_HIST(p, pPager); - if( pHist->pOrig ){ - memcpy(PGHDR_TO_DATA(p), pHist->pOrig, pPager->pageSize); - TRACE3("ROLLBACK-PAGE %d of %d\n", p->pgno, PAGERID(pPager)); - }else{ - TRACE3("PAGE %d is clean on %d\n", p->pgno, PAGERID(pPager)); - } - clearHistory(pHist); - p->dirty = 0; - p->inJournal = 0; - p->inStmt = 0; - p->pPrevStmt = p->pNextStmt = 0; - - if( pPager->xReiniter ){ - pPager->xReiniter(PGHDR_TO_DATA(p), pPager->pageSize); - } - - } - pPager->pStmt = 0; - pPager->dbSize = pPager->origDbSize; - memoryTruncate(pPager); - pPager->stmtInUse = 0; - pPager->state = PAGER_SHARED; - return SQLITE_OK; - } - - if( !pPager->dirtyCache || !pPager->journalOpen ){ - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - } - - if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){ - if( pPager->state>=PAGER_EXCLUSIVE ){ - pager_playback(pPager); - } - return pager_errcode(pPager); - } - if( pPager->state==PAGER_RESERVED ){ - int rc2; - rc = pager_reload_cache(pPager); - rc2 = pager_unwritelock(pPager); - if( rc==SQLITE_OK ){ - rc = rc2; - } - }else{ - rc = pager_playback(pPager); - } - if( rc!=SQLITE_OK ){ - rc = SQLITE_CORRUPT_BKPT; - pPager->errMask |= PAGER_ERR_CORRUPT; - } - pPager->dbSize = -1; - return rc; -} - -/* -** Return TRUE if the database file is opened read-only. Return FALSE -** if the database is (in theory) writable. -*/ -int sqlite3pager_isreadonly(Pager *pPager){ - return pPager->readOnly; -} - -/* -** This routine is used for testing and analysis only. -*/ -int *sqlite3pager_stats(Pager *pPager){ - static int a[11]; - a[0] = pPager->nRef; - a[1] = pPager->nPage; - a[2] = pPager->mxPage; - a[3] = pPager->dbSize; - a[4] = pPager->state; - a[5] = pPager->errMask; -#ifdef SQLITE_TEST - a[6] = pPager->nHit; - a[7] = pPager->nMiss; - a[8] = pPager->nOvfl; - a[9] = pPager->nRead; - a[10] = pPager->nWrite; -#endif - return a; -} - -/* -** Set the statement rollback point. -** -** This routine should be called with the transaction journal already -** open. A new statement journal is created that can be used to rollback -** changes of a single SQL command within a larger transaction. -*/ -int sqlite3pager_stmt_begin(Pager *pPager){ - int rc; - char zTemp[SQLITE_TEMPNAME_SIZE]; - assert( !pPager->stmtInUse ); - assert( pPager->dbSize>=0 ); - TRACE2("STMT-BEGIN %d\n", PAGERID(pPager)); - if( MEMDB ){ - pPager->stmtInUse = 1; - pPager->stmtSize = pPager->dbSize; - return SQLITE_OK; - } - if( !pPager->journalOpen ){ - pPager->stmtAutoopen = 1; - return SQLITE_OK; - } - assert( pPager->journalOpen ); - pPager->aInStmt = sqliteMalloc( pPager->dbSize/8 + 1 ); - if( pPager->aInStmt==0 ){ - sqlite3OsLock(&pPager->fd, SHARED_LOCK); - return SQLITE_NOMEM; - } -#ifndef NDEBUG - rc = sqlite3OsFileSize(&pPager->jfd, &pPager->stmtJSize); - if( rc ) goto stmt_begin_failed; - assert( pPager->stmtJSize == pPager->journalOff ); -#endif - pPager->stmtJSize = pPager->journalOff; - pPager->stmtSize = pPager->dbSize; - pPager->stmtHdrOff = 0; - pPager->stmtCksum = pPager->cksumInit; - if( !pPager->stmtOpen ){ - rc = sqlite3pager_opentemp(zTemp, &pPager->stfd); - if( rc ) goto stmt_begin_failed; - pPager->stmtOpen = 1; - pPager->stmtNRec = 0; - } - pPager->stmtInUse = 1; - return SQLITE_OK; - -stmt_begin_failed: - if( pPager->aInStmt ){ - sqliteFree(pPager->aInStmt); - pPager->aInStmt = 0; - } - return rc; -} - -/* -** Commit a statement. -*/ -int sqlite3pager_stmt_commit(Pager *pPager){ - if( pPager->stmtInUse ){ - PgHdr *pPg, *pNext; - TRACE2("STMT-COMMIT %d\n", PAGERID(pPager)); - if( !MEMDB ){ - sqlite3OsSeek(&pPager->stfd, 0); - /* sqlite3OsTruncate(&pPager->stfd, 0); */ - sqliteFree( pPager->aInStmt ); - pPager->aInStmt = 0; - } - for(pPg=pPager->pStmt; pPg; pPg=pNext){ - pNext = pPg->pNextStmt; - assert( pPg->inStmt ); - pPg->inStmt = 0; - pPg->pPrevStmt = pPg->pNextStmt = 0; - if( MEMDB ){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - sqliteFree(pHist->pStmt); - pHist->pStmt = 0; - } - } - pPager->stmtNRec = 0; - pPager->stmtInUse = 0; - pPager->pStmt = 0; - } - pPager->stmtAutoopen = 0; - return SQLITE_OK; -} - -/* -** Rollback a statement. -*/ -int sqlite3pager_stmt_rollback(Pager *pPager){ - int rc; - if( pPager->stmtInUse ){ - TRACE2("STMT-ROLLBACK %d\n", PAGERID(pPager)); - if( MEMDB ){ - PgHdr *pPg; - for(pPg=pPager->pStmt; pPg; pPg=pPg->pNextStmt){ - PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager); - if( pHist->pStmt ){ - memcpy(PGHDR_TO_DATA(pPg), pHist->pStmt, pPager->pageSize); - sqliteFree(pHist->pStmt); - pHist->pStmt = 0; - } - } - pPager->dbSize = pPager->stmtSize; - memoryTruncate(pPager); - rc = SQLITE_OK; - }else{ - rc = pager_stmt_playback(pPager); - } - sqlite3pager_stmt_commit(pPager); - }else{ - rc = SQLITE_OK; - } - pPager->stmtAutoopen = 0; - return rc; -} - -/* -** Return the full pathname of the database file. -*/ -const char *sqlite3pager_filename(Pager *pPager){ - return pPager->zFilename; -} - -/* -** Return the directory of the database file. -*/ -const char *sqlite3pager_dirname(Pager *pPager){ - return pPager->zDirectory; -} - -/* -** Return the full pathname of the journal file. -*/ -const char *sqlite3pager_journalname(Pager *pPager){ - return pPager->zJournal; -} - -/* -** Return true if fsync() calls are disabled for this pager. Return FALSE -** if fsync()s are executed normally. -*/ -int sqlite3pager_nosync(Pager *pPager){ - return pPager->noSync; -} - -/* -** Set the codec for this pager -*/ -void sqlite3pager_set_codec( - Pager *pPager, - void (*xCodec)(void*,void*,Pgno,int), - void *pCodecArg -){ - pPager->xCodec = xCodec; - pPager->pCodecArg = pCodecArg; -} - -/* -** This routine is called to increment the database file change-counter, -** stored at byte 24 of the pager file. -*/ -static int pager_incr_changecounter(Pager *pPager){ - void *pPage; - PgHdr *pPgHdr; - u32 change_counter; - int rc; - - /* Open page 1 of the file for writing. */ - rc = sqlite3pager_get(pPager, 1, &pPage); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3pager_write(pPage); - if( rc!=SQLITE_OK ) return rc; - - /* Read the current value at byte 24. */ - pPgHdr = DATA_TO_PGHDR(pPage); - change_counter = retrieve32bits(pPgHdr, 24); - - /* Increment the value just read and write it back to byte 24. */ - change_counter++; - store32bits(change_counter, pPgHdr, 24); - - /* Release the page reference. */ - sqlite3pager_unref(pPage); - return SQLITE_OK; -} - -/* -** Sync the database file for the pager pPager. zMaster points to the name -** of a master journal file that should be written into the individual -** journal file. zMaster may be NULL, which is interpreted as no master -** journal (a single database transaction). -** -** This routine ensures that the journal is synced, all dirty pages written -** to the database file and the database file synced. The only thing that -** remains to commit the transaction is to delete the journal file (or -** master journal file if specified). -** -** Note that if zMaster==NULL, this does not overwrite a previous value -** passed to an sqlite3pager_sync() call. -** -** If parameter nTrunc is non-zero, then the pager file is truncated to -** nTrunc pages (this is used by auto-vacuum databases). -*/ -int sqlite3pager_sync(Pager *pPager, const char *zMaster, Pgno nTrunc){ - int rc = SQLITE_OK; - - TRACE4("DATABASE SYNC: File=%s zMaster=%s nTrunc=%d\n", - pPager->zFilename, zMaster, nTrunc); - - /* If this is an in-memory db, or no pages have been written to, or this - ** function has already been called, it is a no-op. - */ - if( pPager->state!=PAGER_SYNCED && !MEMDB && pPager->dirtyCache ){ - PgHdr *pPg; - assert( pPager->journalOpen ); - - /* If a master journal file name has already been written to the - ** journal file, then no sync is required. This happens when it is - ** written, then the process fails to upgrade from a RESERVED to an - ** EXCLUSIVE lock. The next time the process tries to commit the - ** transaction the m-j name will have already been written. - */ - if( !pPager->setMaster ){ - rc = pager_incr_changecounter(pPager); - if( rc!=SQLITE_OK ) goto sync_exit; -#ifndef SQLITE_OMIT_AUTOVACUUM - if( nTrunc!=0 ){ - /* If this transaction has made the database smaller, then all pages - ** being discarded by the truncation must be written to the journal - ** file. - */ - Pgno i; - void *pPage; - int iSkip = PAGER_MJ_PGNO(pPager); - for( i=nTrunc+1; i<=pPager->origDbSize; i++ ){ - if( !(pPager->aInJournal[i/8] & (1<<(i&7))) && i!=iSkip ){ - rc = sqlite3pager_get(pPager, i, &pPage); - if( rc!=SQLITE_OK ) goto sync_exit; - rc = sqlite3pager_write(pPage); - sqlite3pager_unref(pPage); - if( rc!=SQLITE_OK ) goto sync_exit; - } - } - } -#endif - rc = writeMasterJournal(pPager, zMaster); - if( rc!=SQLITE_OK ) goto sync_exit; - rc = syncJournal(pPager); - if( rc!=SQLITE_OK ) goto sync_exit; - } - -#ifndef SQLITE_OMIT_AUTOVACUUM - if( nTrunc!=0 ){ - rc = sqlite3pager_truncate(pPager, nTrunc); - if( rc!=SQLITE_OK ) goto sync_exit; - } -#endif - - /* Write all dirty pages to the database file */ - pPg = pager_get_all_dirty_pages(pPager); - rc = pager_write_pagelist(pPg); - if( rc!=SQLITE_OK ) goto sync_exit; - - /* Sync the database file. */ - if( !pPager->noSync ){ - rc = sqlite3OsSync(&pPager->fd, 0); - } - - pPager->state = PAGER_SYNCED; - } - -sync_exit: - return rc; -} - -#ifndef SQLITE_OMIT_AUTOVACUUM -/* -** Move the page identified by pData to location pgno in the file. -** -** There must be no references to the current page pgno. If current page -** pgno is not already in the rollback journal, it is not written there by -** by this routine. The same applies to the page pData refers to on entry to -** this routine. -** -** References to the page refered to by pData remain valid. Updating any -** meta-data associated with page pData (i.e. data stored in the nExtra bytes -** allocated along with the page) is the responsibility of the caller. -** -** A transaction must be active when this routine is called. It used to be -** required that a statement transaction was not active, but this restriction -** has been removed (CREATE INDEX needs to move a page when a statement -** transaction is active). -*/ -int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - PgHdr *pPgOld; - int h; - Pgno needSyncPgno = 0; - - assert( pPg->nRef>0 ); - - TRACE5("MOVE %d page %d (needSync=%d) moves to %d\n", - PAGERID(pPager), pPg->pgno, pPg->needSync, pgno); - - if( pPg->needSync ){ - needSyncPgno = pPg->pgno; - assert( pPg->inJournal ); - assert( pPg->dirty ); - assert( pPager->needSync ); - } - - /* Unlink pPg from it's hash-chain */ - unlinkHashChain(pPager, pPg); - - /* If the cache contains a page with page-number pgno, remove it - ** from it's hash chain. Also, if the PgHdr.needSync was set for - ** page pgno before the 'move' operation, it needs to be retained - ** for the page moved there. - */ - pPgOld = pager_lookup(pPager, pgno); - if( pPgOld ){ - assert( pPgOld->nRef==0 ); - unlinkHashChain(pPager, pPgOld); - pPgOld->dirty = 0; - if( pPgOld->needSync ){ - assert( pPgOld->inJournal ); - pPg->inJournal = 1; - pPg->needSync = 1; - assert( pPager->needSync ); - } - } - - /* Change the page number for pPg and insert it into the new hash-chain. */ - pPg->pgno = pgno; - h = pager_hash(pgno); - if( pPager->aHash[h] ){ - assert( pPager->aHash[h]->pPrevHash==0 ); - pPager->aHash[h]->pPrevHash = pPg; - } - pPg->pNextHash = pPager->aHash[h]; - pPager->aHash[h] = pPg; - pPg->pPrevHash = 0; - - pPg->dirty = 1; - pPager->dirtyCache = 1; - - if( needSyncPgno ){ - /* If needSyncPgno is non-zero, then the journal file needs to be - ** sync()ed before any data is written to database file page needSyncPgno. - ** Currently, no such page exists in the page-cache and the - ** Pager.aInJournal bit has been set. This needs to be remedied by loading - ** the page into the pager-cache and setting the PgHdr.needSync flag. - ** - ** The sqlite3pager_get() call may cause the journal to sync. So make - ** sure the Pager.needSync flag is set too. - */ - int rc; - void *pNeedSync; - assert( pPager->needSync ); - rc = sqlite3pager_get(pPager, needSyncPgno, &pNeedSync); - if( rc!=SQLITE_OK ) return rc; - pPager->needSync = 1; - DATA_TO_PGHDR(pNeedSync)->needSync = 1; - DATA_TO_PGHDR(pNeedSync)->inJournal = 1; - DATA_TO_PGHDR(pNeedSync)->dirty = 1; - sqlite3pager_unref(pNeedSync); - } - - return SQLITE_OK; -} -#endif - -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) -/* -** Return the current state of the file lock for the given pager. -** The return value is one of NO_LOCK, SHARED_LOCK, RESERVED_LOCK, -** PENDING_LOCK, or EXCLUSIVE_LOCK. -*/ -int sqlite3pager_lockstate(Pager *pPager){ -#ifdef OS_TEST - return pPager->fd->fd.locktype; -#else - return pPager->fd.locktype; -#endif -} -#endif - -#ifdef SQLITE_DEBUG -/* -** Print a listing of all referenced pages and their ref count. -*/ -void sqlite3pager_refdump(Pager *pPager){ - PgHdr *pPg; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - if( pPg->nRef<=0 ) continue; - sqlite3DebugPrintf("PAGE %3d addr=%p nRef=%d\n", - pPg->pgno, PGHDR_TO_DATA(pPg), pPg->nRef); - } -} -#endif - -#endif /* SQLITE_OMIT_DISKIO */ diff --git a/ext/pdo_sqlite/sqlite/src/pager.h b/ext/pdo_sqlite/sqlite/src/pager.h deleted file mode 100644 index feba78a7adc4b..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/pager.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. The page cache subsystem reads and writes a file a page -** at a time and provides a journal for rollback. -** -** @(#) $Id$ -*/ - -/* -** The default size of a database page. -*/ -#ifndef SQLITE_DEFAULT_PAGE_SIZE -# define SQLITE_DEFAULT_PAGE_SIZE 1024 -#endif - -/* Maximum page size. The upper bound on this value is 32768. This a limit -** imposed by necessity of storing the value in a 2-byte unsigned integer -** and the fact that the page size must be a power of 2. -** -** This value is used to initialize certain arrays on the stack at -** various places in the code. On embedded machines where stack space -** is limited and the flexibility of having large pages is not needed, -** it makes good sense to reduce the maximum page size to something more -** reasonable, like 1024. -*/ -#ifndef SQLITE_MAX_PAGE_SIZE -# define SQLITE_MAX_PAGE_SIZE 32768 -#endif - -/* -** Maximum number of pages in one database. -*/ -#define SQLITE_MAX_PAGE 1073741823 - -/* -** The type used to represent a page number. The first page in a file -** is called page 1. 0 is used to represent "not a page". -*/ -typedef unsigned int Pgno; - -/* -** Each open file is managed by a separate instance of the "Pager" structure. -*/ -typedef struct Pager Pager; - -/* -** Allowed values for the flags parameter to sqlite3pager_open(). -** -** NOTE: This values must match the corresponding BTREE_ values in btree.h. -*/ -#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ -#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ - - -/* -** See source code comments for a detailed description of the following -** routines: -*/ -int sqlite3pager_open(Pager **ppPager, const char *zFilename, - int nExtra, int flags); -void sqlite3pager_set_busyhandler(Pager*, BusyHandler *pBusyHandler); -void sqlite3pager_set_destructor(Pager*, void(*)(void*,int)); -void sqlite3pager_set_reiniter(Pager*, void(*)(void*,int)); -int sqlite3pager_set_pagesize(Pager*, int); -void sqlite3pager_read_fileheader(Pager*, int, unsigned char*); -void sqlite3pager_set_cachesize(Pager*, int); -int sqlite3pager_close(Pager *pPager); -int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage); -void *sqlite3pager_lookup(Pager *pPager, Pgno pgno); -int sqlite3pager_ref(void*); -int sqlite3pager_unref(void*); -Pgno sqlite3pager_pagenumber(void*); -int sqlite3pager_write(void*); -int sqlite3pager_iswriteable(void*); -int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void*); -int sqlite3pager_pagecount(Pager*); -int sqlite3pager_truncate(Pager*,Pgno); -int sqlite3pager_begin(void*, int exFlag); -int sqlite3pager_commit(Pager*); -int sqlite3pager_sync(Pager*,const char *zMaster, Pgno); -int sqlite3pager_rollback(Pager*); -int sqlite3pager_isreadonly(Pager*); -int sqlite3pager_stmt_begin(Pager*); -int sqlite3pager_stmt_commit(Pager*); -int sqlite3pager_stmt_rollback(Pager*); -void sqlite3pager_dont_rollback(void*); -void sqlite3pager_dont_write(Pager*, Pgno); -int *sqlite3pager_stats(Pager*); -void sqlite3pager_set_safety_level(Pager*,int); -const char *sqlite3pager_filename(Pager*); -const char *sqlite3pager_dirname(Pager*); -const char *sqlite3pager_journalname(Pager*); -int sqlite3pager_nosync(Pager*); -int sqlite3pager_rename(Pager*, const char *zNewName); -void sqlite3pager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*); -int sqlite3pager_movepage(Pager*,void*,Pgno); -int sqlite3pager_reset(Pager*); - -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) -int sqlite3pager_lockstate(Pager*); -#endif - -#ifdef SQLITE_TEST -void sqlite3pager_refdump(Pager*); -int pager3_refinfo_enable; -#endif diff --git a/ext/pdo_sqlite/sqlite/src/parse.c b/ext/pdo_sqlite/sqlite/src/parse.c deleted file mode 100644 index 8fe3ccde63fd3..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/parse.c +++ /dev/null @@ -1,3449 +0,0 @@ -/* Driver template for the LEMON parser generator. -** The author disclaims copyright to this source code. -*/ -/* First off, code is include which follows the "include" declaration -** in the input file. */ -#include <stdio.h> -#line 51 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" - -#include "sqliteInt.h" -#include "parse.h" - -/* -** An instance of this structure holds information about the -** LIMIT clause of a SELECT statement. -*/ -struct LimitVal { - Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ - Expr *pOffset; /* The OFFSET expression. NULL if there is none */ -}; - -/* -** An instance of this structure is used to store the LIKE, -** GLOB, NOT LIKE, and NOT GLOB operators. -*/ -struct LikeOp { - Token operator; /* "like" or "glob" or "regexp" */ - int not; /* True if the NOT keyword is present */ -}; - -/* -** An instance of the following structure describes the event of a -** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, -** TK_DELETE, or TK_INSTEAD. If the event is of the form -** -** UPDATE ON (a,b,c) -** -** Then the "b" IdList records the list "a,b,c". -*/ -struct TrigEvent { int a; IdList * b; }; - -/* -** An instance of this structure holds the ATTACH key and the key type. -*/ -struct AttachKey { int type; Token key; }; - -#line 48 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" -/* Next is all token values, in a form suitable for use by makeheaders. -** This section will be null unless lemon is run with the -m switch. -*/ -/* -** These constants (all generated automatically by the parser generator) -** specify the various kinds of tokens (terminals) that the parser -** understands. -** -** Each symbol here is a terminal symbol in the grammar. -*/ -/* Make sure the INTERFACE macro is defined. -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/* The next thing included is series of defines which control -** various aspects of the generated parser. -** YYCODETYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 terminals -** and nonterminals. "int" is used otherwise. -** YYNOCODE is a number of type YYCODETYPE which corresponds -** to no legal terminal or nonterminal number. This -** number is used to fill in empty slots of the hash -** table. -** YYFALLBACK If defined, this indicates that one or more tokens -** have fall-back values which should be used if the -** original value of the token will not parse. -** YYACTIONTYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 rules and -** states combined. "int" is used otherwise. -** sqlite3ParserTOKENTYPE is the data type used for minor tokens given -** directly to the parser from the tokenizer. -** YYMINORTYPE is the data type used for all minor tokens. -** This is typically a union of many types, one of -** which is sqlite3ParserTOKENTYPE. The entry in the union -** for base tokens is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. -** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument -** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument -** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser -** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -*/ -#define YYCODETYPE unsigned char -#define YYNOCODE 247 -#define YYACTIONTYPE unsigned short int -#define sqlite3ParserTOKENTYPE Token -typedef union { - sqlite3ParserTOKENTYPE yy0; - struct TrigEvent yy30; - Expr* yy62; - SrcList* yy151; - Token yy198; - struct LimitVal yy220; - struct LikeOp yy222; - IdList* yy240; - int yy280; - struct {int value; int mask;} yy359; - TriggerStep* yy360; - struct AttachKey yy361; - Select* yy375; - ExprList* yy418; - int yy493; -} YYMINORTYPE; -#define YYSTACKDEPTH 100 -#define sqlite3ParserARG_SDECL Parse *pParse; -#define sqlite3ParserARG_PDECL ,Parse *pParse -#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse -#define sqlite3ParserARG_STORE yypParser->pParse = pParse -#define YYNSTATE 581 -#define YYNRULE 311 -#define YYERRORSYMBOL 146 -#define YYERRSYMDT yy493 -#define YYFALLBACK 1 -#define YY_NO_ACTION (YYNSTATE+YYNRULE+2) -#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) -#define YY_ERROR_ACTION (YYNSTATE+YYNRULE) - -/* Next are that tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N < YYNSTATE Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. -** -** N == YYNSTATE+YYNRULE A syntax error has occurred. -** -** N == YYNSTATE+YYNRULE+1 The parser accepts its input. -** -** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as -** -** yy_action[ yy_shift_ofst[S] + X ] -** -** If the index value yy_shift_ofst[S]+X is out of range or if the value -** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] -** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table -** and that yy_default[S] should be used instead. -** -** The formula above is for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -*/ -static const YYACTIONTYPE yy_action[] = { - /* 0 */ 286, 584, 113, 140, 142, 138, 144, 581, 150, 152, - /* 10 */ 154, 156, 158, 160, 162, 164, 166, 168, 3, 577, - /* 20 */ 740, 170, 178, 150, 152, 154, 156, 158, 160, 162, - /* 30 */ 164, 166, 168, 158, 160, 162, 164, 166, 168, 135, - /* 40 */ 97, 171, 181, 186, 191, 180, 185, 146, 148, 140, - /* 50 */ 142, 138, 144, 51, 150, 152, 154, 156, 158, 160, - /* 60 */ 162, 164, 166, 168, 16, 17, 18, 114, 7, 248, - /* 70 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, - /* 80 */ 13, 37, 362, 40, 59, 67, 69, 326, 357, 170, - /* 90 */ 6, 5, 331, 95, 364, 359, 25, 374, 258, 893, - /* 100 */ 1, 580, 514, 13, 4, 575, 33, 135, 97, 171, - /* 110 */ 181, 186, 191, 180, 185, 146, 148, 140, 142, 138, - /* 120 */ 144, 9, 150, 152, 154, 156, 158, 160, 162, 164, - /* 130 */ 166, 168, 374, 136, 592, 80, 112, 99, 269, 34, - /* 140 */ 32, 33, 132, 373, 115, 14, 15, 378, 333, 99, - /* 150 */ 380, 387, 392, 13, 367, 370, 194, 170, 78, 500, - /* 160 */ 525, 315, 395, 369, 375, 408, 10, 98, 14, 15, - /* 170 */ 78, 200, 286, 864, 113, 135, 97, 171, 181, 186, - /* 180 */ 191, 180, 185, 146, 148, 140, 142, 138, 144, 80, - /* 190 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, - /* 200 */ 104, 105, 106, 661, 496, 376, 374, 170, 467, 13, - /* 210 */ 2, 28, 237, 4, 409, 33, 3, 577, 14, 15, - /* 220 */ 51, 132, 133, 115, 241, 135, 97, 171, 181, 186, - /* 230 */ 191, 180, 185, 146, 148, 140, 142, 138, 144, 114, - /* 240 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, - /* 250 */ 40, 59, 67, 69, 326, 357, 136, 44, 45, 501, - /* 260 */ 473, 463, 359, 36, 361, 130, 128, 660, 275, 31, - /* 270 */ 84, 99, 356, 378, 14, 15, 380, 387, 392, 52, - /* 280 */ 170, 117, 122, 123, 113, 541, 369, 643, 395, 348, - /* 290 */ 98, 54, 78, 200, 302, 57, 58, 819, 135, 97, - /* 300 */ 171, 181, 186, 191, 180, 185, 146, 148, 140, 142, - /* 310 */ 138, 144, 861, 150, 152, 154, 156, 158, 160, 162, - /* 320 */ 164, 166, 168, 104, 105, 106, 817, 80, 48, 316, - /* 330 */ 162, 164, 166, 168, 319, 277, 12, 49, 99, 303, - /* 340 */ 283, 818, 99, 124, 304, 99, 241, 172, 593, 114, - /* 350 */ 50, 193, 46, 378, 170, 13, 380, 387, 392, 78, - /* 360 */ 260, 276, 47, 78, 200, 64, 78, 260, 395, 174, - /* 370 */ 175, 221, 135, 97, 171, 181, 186, 191, 180, 185, - /* 380 */ 146, 148, 140, 142, 138, 144, 199, 150, 152, 154, - /* 390 */ 156, 158, 160, 162, 164, 166, 168, 173, 252, 261, - /* 400 */ 120, 122, 123, 212, 170, 268, 254, 130, 128, 288, - /* 410 */ 590, 176, 246, 187, 192, 414, 195, 241, 197, 198, - /* 420 */ 14, 15, 135, 97, 171, 181, 186, 191, 180, 185, - /* 430 */ 146, 148, 140, 142, 138, 144, 433, 150, 152, 154, - /* 440 */ 156, 158, 160, 162, 164, 166, 168, 311, 99, 707, - /* 450 */ 99, 422, 708, 417, 275, 81, 318, 598, 99, 219, - /* 460 */ 13, 231, 124, 13, 176, 48, 187, 192, 20, 78, - /* 470 */ 317, 78, 214, 195, 49, 197, 198, 462, 170, 78, - /* 480 */ 200, 116, 27, 13, 410, 113, 591, 50, 80, 225, - /* 490 */ 195, 11, 197, 198, 506, 235, 135, 97, 171, 181, - /* 500 */ 186, 191, 180, 185, 146, 148, 140, 142, 138, 144, - /* 510 */ 80, 150, 152, 154, 156, 158, 160, 162, 164, 166, - /* 520 */ 168, 277, 215, 324, 606, 14, 15, 301, 14, 15, - /* 530 */ 512, 13, 508, 240, 196, 486, 195, 685, 197, 198, - /* 540 */ 22, 834, 445, 331, 462, 170, 444, 276, 14, 15, - /* 550 */ 114, 468, 278, 394, 599, 280, 470, 288, 446, 680, - /* 560 */ 13, 321, 404, 135, 97, 171, 181, 186, 191, 180, - /* 570 */ 185, 146, 148, 140, 142, 138, 144, 80, 150, 152, - /* 580 */ 154, 156, 158, 160, 162, 164, 166, 168, 74, 99, - /* 590 */ 540, 366, 73, 99, 352, 289, 14, 15, 176, 333, - /* 600 */ 187, 192, 486, 869, 359, 273, 283, 542, 543, 867, - /* 610 */ 78, 500, 510, 170, 78, 323, 682, 176, 472, 187, - /* 620 */ 192, 746, 118, 470, 119, 14, 15, 195, 346, 197, - /* 630 */ 198, 135, 97, 171, 181, 186, 191, 180, 185, 146, - /* 640 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156, - /* 650 */ 158, 160, 162, 164, 166, 168, 532, 334, 341, 343, - /* 660 */ 841, 39, 195, 170, 197, 198, 78, 94, 124, 356, - /* 670 */ 271, 353, 439, 441, 440, 544, 883, 428, 72, 862, - /* 680 */ 288, 135, 97, 171, 181, 186, 191, 180, 185, 146, - /* 690 */ 148, 140, 142, 138, 144, 13, 150, 152, 154, 156, - /* 700 */ 158, 160, 162, 164, 166, 168, 195, 99, 197, 198, - /* 710 */ 406, 330, 195, 170, 197, 198, 568, 405, 306, 195, - /* 720 */ 42, 197, 198, 65, 195, 539, 197, 198, 78, 96, - /* 730 */ 66, 135, 97, 171, 181, 186, 191, 180, 185, 146, - /* 740 */ 148, 140, 142, 138, 144, 885, 150, 152, 154, 156, - /* 750 */ 158, 160, 162, 164, 166, 168, 99, 740, 99, 298, - /* 760 */ 14, 15, 272, 170, 13, 74, 572, 86, 600, 73, - /* 770 */ 126, 127, 614, 709, 309, 478, 24, 78, 247, 78, - /* 780 */ 111, 135, 97, 171, 181, 186, 191, 180, 185, 146, - /* 790 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156, - /* 800 */ 158, 160, 162, 164, 166, 168, 99, 238, 113, 239, - /* 810 */ 295, 26, 296, 170, 338, 337, 78, 137, 294, 320, - /* 820 */ 347, 239, 348, 390, 211, 348, 30, 78, 139, 14, - /* 830 */ 15, 135, 189, 171, 181, 186, 191, 180, 185, 146, - /* 840 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156, - /* 850 */ 158, 160, 162, 164, 166, 168, 99, 80, 99, 372, - /* 860 */ 399, 442, 348, 170, 298, 243, 78, 141, 363, 601, - /* 870 */ 428, 437, 438, 114, 411, 269, 605, 78, 143, 78, - /* 880 */ 145, 448, 97, 171, 181, 186, 191, 180, 185, 146, - /* 890 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156, - /* 900 */ 158, 160, 162, 164, 166, 168, 99, 80, 99, 430, - /* 910 */ 99, 296, 555, 170, 413, 856, 78, 147, 672, 457, - /* 920 */ 352, 348, 298, 443, 465, 45, 35, 78, 149, 78, - /* 930 */ 151, 78, 153, 171, 181, 186, 191, 180, 185, 146, - /* 940 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156, - /* 950 */ 158, 160, 162, 164, 166, 168, 99, 459, 99, 29, - /* 960 */ 79, 464, 183, 483, 71, 339, 78, 155, 709, 421, - /* 970 */ 428, 79, 109, 99, 491, 71, 296, 78, 157, 78, - /* 980 */ 159, 490, 243, 109, 99, 340, 99, 449, 857, 223, - /* 990 */ 99, 460, 182, 709, 78, 161, 99, 349, 827, 136, - /* 1000 */ 223, 99, 80, 201, 99, 78, 163, 78, 165, 507, - /* 1010 */ 136, 78, 167, 42, 201, 38, 493, 78, 169, 569, - /* 1020 */ 207, 205, 78, 177, 674, 78, 179, 477, 203, 76, - /* 1030 */ 77, 207, 205, 98, 99, 84, 99, 42, 336, 203, - /* 1040 */ 76, 77, 99, 43, 98, 41, 428, 79, 494, 80, - /* 1050 */ 428, 71, 84, 99, 352, 78, 188, 78, 190, 109, - /* 1060 */ 499, 428, 497, 78, 202, 60, 104, 105, 106, 107, - /* 1070 */ 108, 209, 213, 99, 78, 204, 223, 104, 105, 106, - /* 1080 */ 107, 108, 209, 213, 820, 509, 136, 53, 383, 511, - /* 1090 */ 201, 99, 56, 61, 78, 206, 55, 428, 428, 889, - /* 1100 */ 513, 99, 243, 99, 352, 99, 79, 207, 205, 312, - /* 1110 */ 71, 99, 78, 208, 483, 203, 76, 77, 109, 533, - /* 1120 */ 98, 497, 78, 220, 78, 222, 78, 232, 84, 99, - /* 1130 */ 428, 353, 78, 234, 352, 223, 517, 521, 389, 99, - /* 1140 */ 62, 530, 99, 64, 63, 136, 68, 529, 70, 201, - /* 1150 */ 78, 236, 352, 104, 105, 106, 107, 108, 209, 213, - /* 1160 */ 78, 249, 99, 78, 265, 877, 207, 205, 398, 527, - /* 1170 */ 99, 615, 616, 313, 203, 76, 77, 99, 523, 98, - /* 1180 */ 80, 353, 8, 78, 270, 99, 456, 19, 21, 23, - /* 1190 */ 412, 78, 300, 75, 78, 310, 82, 84, 78, 365, - /* 1200 */ 563, 83, 547, 99, 87, 553, 78, 393, 85, 557, - /* 1210 */ 99, 353, 104, 105, 106, 107, 108, 209, 213, 99, - /* 1220 */ 269, 536, 99, 467, 78, 434, 88, 266, 534, 353, - /* 1230 */ 560, 78, 481, 566, 264, 89, 250, 90, 93, 91, - /* 1240 */ 78, 485, 101, 78, 498, 92, 100, 102, 103, 110, - /* 1250 */ 131, 121, 134, 125, 129, 168, 184, 242, 686, 687, - /* 1260 */ 688, 210, 233, 218, 224, 216, 227, 226, 217, 229, - /* 1270 */ 228, 230, 243, 251, 515, 519, 463, 245, 253, 244, - /* 1280 */ 505, 257, 255, 256, 258, 84, 259, 262, 263, 239, - /* 1290 */ 267, 279, 274, 281, 282, 299, 285, 292, 284, 287, - /* 1300 */ 290, 293, 297, 305, 314, 291, 307, 322, 308, 325, - /* 1310 */ 327, 345, 329, 328, 332, 350, 354, 330, 358, 335, - /* 1320 */ 342, 379, 381, 382, 344, 351, 368, 385, 355, 371, - /* 1330 */ 388, 360, 396, 397, 400, 401, 415, 54, 416, 386, - /* 1340 */ 384, 391, 418, 402, 407, 419, 377, 420, 423, 424, - /* 1350 */ 403, 426, 425, 427, 429, 435, 431, 849, 436, 854, - /* 1360 */ 432, 855, 450, 447, 451, 452, 454, 453, 825, 455, - /* 1370 */ 458, 826, 469, 461, 466, 747, 748, 848, 471, 464, - /* 1380 */ 863, 480, 474, 475, 476, 482, 865, 479, 487, 484, - /* 1390 */ 489, 488, 492, 866, 495, 868, 504, 679, 502, 681, - /* 1400 */ 833, 875, 518, 503, 516, 739, 520, 524, 522, 742, - /* 1410 */ 745, 531, 526, 835, 535, 528, 538, 537, 836, 837, - /* 1420 */ 838, 839, 545, 546, 840, 550, 876, 556, 551, 878, - /* 1430 */ 548, 549, 554, 879, 559, 882, 884, 562, 886, 561, - /* 1440 */ 552, 558, 564, 567, 570, 565, 571, 887, 576, 574, - /* 1450 */ 573, 888, 578, 559, 559, 579, -}; -static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 28, 11, 30, 77, 78, 79, 80, 0, 82, 83, - /* 10 */ 84, 85, 86, 87, 88, 89, 90, 91, 11, 12, - /* 20 */ 11, 49, 81, 82, 83, 84, 85, 86, 87, 88, - /* 30 */ 89, 90, 91, 86, 87, 88, 89, 90, 91, 67, - /* 40 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 50 */ 78, 79, 80, 69, 82, 83, 84, 85, 86, 87, - /* 60 */ 88, 89, 90, 91, 17, 18, 19, 95, 11, 29, - /* 70 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 80 */ 30, 97, 98, 99, 100, 101, 102, 103, 104, 49, - /* 90 */ 150, 151, 50, 53, 26, 111, 156, 155, 30, 147, - /* 100 */ 148, 149, 162, 30, 152, 163, 164, 67, 68, 69, - /* 110 */ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - /* 120 */ 80, 153, 82, 83, 84, 85, 86, 87, 88, 89, - /* 130 */ 90, 91, 155, 65, 11, 195, 28, 155, 129, 165, - /* 140 */ 163, 164, 168, 169, 170, 95, 96, 97, 106, 155, - /* 150 */ 100, 101, 102, 30, 86, 87, 162, 49, 176, 177, - /* 160 */ 220, 88, 112, 95, 187, 188, 154, 99, 95, 96, - /* 170 */ 176, 177, 28, 21, 30, 67, 68, 69, 70, 71, - /* 180 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 195, - /* 190 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 200 */ 132, 133, 134, 27, 222, 29, 155, 49, 56, 30, - /* 210 */ 149, 160, 218, 152, 163, 164, 11, 12, 95, 96, - /* 220 */ 69, 168, 169, 170, 230, 67, 68, 69, 70, 71, - /* 230 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 95, - /* 240 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 250 */ 99, 100, 101, 102, 103, 104, 65, 192, 193, 107, - /* 260 */ 108, 109, 111, 174, 175, 86, 87, 27, 29, 29, - /* 270 */ 118, 155, 183, 97, 95, 96, 100, 101, 102, 99, - /* 280 */ 49, 171, 172, 173, 30, 106, 95, 27, 112, 29, - /* 290 */ 99, 111, 176, 177, 162, 17, 18, 139, 67, 68, - /* 300 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 310 */ 79, 80, 15, 82, 83, 84, 85, 86, 87, 88, - /* 320 */ 89, 90, 91, 132, 133, 134, 21, 195, 22, 27, - /* 330 */ 88, 89, 90, 91, 218, 96, 155, 31, 155, 207, - /* 340 */ 208, 21, 155, 233, 212, 155, 230, 49, 11, 95, - /* 350 */ 44, 26, 46, 97, 49, 30, 100, 101, 102, 176, - /* 360 */ 177, 122, 56, 176, 177, 105, 176, 177, 112, 71, - /* 370 */ 72, 140, 67, 68, 69, 70, 71, 72, 73, 74, - /* 380 */ 75, 76, 77, 78, 79, 80, 27, 82, 83, 84, - /* 390 */ 85, 86, 87, 88, 89, 90, 91, 99, 215, 216, - /* 400 */ 171, 172, 173, 27, 49, 218, 216, 86, 87, 168, - /* 410 */ 11, 223, 224, 225, 226, 24, 114, 230, 116, 117, - /* 420 */ 95, 96, 67, 68, 69, 70, 71, 72, 73, 74, - /* 430 */ 75, 76, 77, 78, 79, 80, 139, 82, 83, 84, - /* 440 */ 85, 86, 87, 88, 89, 90, 91, 206, 155, 27, - /* 450 */ 155, 60, 27, 62, 29, 162, 27, 11, 155, 139, - /* 460 */ 30, 141, 233, 30, 223, 22, 225, 226, 154, 176, - /* 470 */ 177, 176, 177, 114, 31, 116, 117, 162, 49, 176, - /* 480 */ 177, 26, 26, 30, 28, 30, 11, 44, 195, 46, - /* 490 */ 114, 16, 116, 117, 24, 140, 67, 68, 69, 70, - /* 500 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 510 */ 195, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 520 */ 91, 96, 227, 27, 11, 95, 96, 26, 95, 96, - /* 530 */ 60, 30, 62, 230, 115, 220, 114, 118, 116, 117, - /* 540 */ 154, 11, 32, 50, 162, 49, 36, 122, 95, 96, - /* 550 */ 95, 236, 122, 178, 11, 122, 241, 168, 48, 11, - /* 560 */ 30, 88, 69, 67, 68, 69, 70, 71, 72, 73, - /* 570 */ 74, 75, 76, 77, 78, 79, 80, 195, 82, 83, - /* 580 */ 84, 85, 86, 87, 88, 89, 90, 91, 115, 155, - /* 590 */ 155, 27, 119, 155, 155, 206, 95, 96, 223, 106, - /* 600 */ 225, 226, 220, 11, 111, 207, 208, 172, 173, 11, - /* 610 */ 176, 177, 142, 49, 176, 177, 11, 223, 236, 225, - /* 620 */ 226, 11, 27, 241, 29, 95, 96, 114, 189, 116, - /* 630 */ 117, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 640 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85, - /* 650 */ 86, 87, 88, 89, 90, 91, 222, 107, 108, 109, - /* 660 */ 11, 175, 114, 49, 116, 117, 176, 177, 233, 183, - /* 670 */ 29, 232, 107, 108, 109, 26, 11, 155, 26, 15, - /* 680 */ 168, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 690 */ 76, 77, 78, 79, 80, 30, 82, 83, 84, 85, - /* 700 */ 86, 87, 88, 89, 90, 91, 114, 155, 116, 117, - /* 710 */ 183, 184, 114, 49, 116, 117, 194, 190, 206, 114, - /* 720 */ 106, 116, 117, 34, 114, 76, 116, 117, 176, 177, - /* 730 */ 41, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 740 */ 76, 77, 78, 79, 80, 11, 82, 83, 84, 85, - /* 750 */ 86, 87, 88, 89, 90, 91, 155, 11, 155, 155, - /* 760 */ 95, 96, 121, 49, 30, 115, 244, 198, 11, 119, - /* 770 */ 132, 133, 120, 28, 205, 29, 154, 176, 177, 176, - /* 780 */ 177, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 790 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85, - /* 800 */ 86, 87, 88, 89, 90, 91, 155, 27, 30, 29, - /* 810 */ 27, 157, 29, 49, 98, 99, 176, 177, 214, 27, - /* 820 */ 27, 29, 29, 27, 162, 29, 27, 176, 177, 95, - /* 830 */ 96, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 840 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85, - /* 850 */ 86, 87, 88, 89, 90, 91, 155, 195, 155, 167, - /* 860 */ 27, 52, 29, 49, 155, 120, 176, 177, 176, 11, - /* 870 */ 155, 58, 59, 95, 162, 129, 11, 176, 177, 176, - /* 880 */ 177, 25, 68, 69, 70, 71, 72, 73, 74, 75, - /* 890 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85, - /* 900 */ 86, 87, 88, 89, 90, 91, 155, 195, 155, 194, - /* 910 */ 155, 29, 134, 49, 158, 106, 176, 177, 11, 27, - /* 920 */ 155, 29, 155, 214, 192, 193, 166, 176, 177, 176, - /* 930 */ 177, 176, 177, 69, 70, 71, 72, 73, 74, 75, - /* 940 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85, - /* 950 */ 86, 87, 88, 89, 90, 91, 155, 101, 155, 161, - /* 960 */ 26, 67, 69, 155, 30, 37, 176, 177, 106, 162, - /* 970 */ 155, 26, 38, 155, 27, 30, 29, 176, 177, 176, - /* 980 */ 177, 214, 120, 38, 155, 57, 155, 231, 106, 55, - /* 990 */ 155, 235, 99, 11, 176, 177, 155, 232, 142, 65, - /* 1000 */ 55, 155, 195, 69, 155, 176, 177, 176, 177, 194, - /* 1010 */ 65, 176, 177, 106, 69, 155, 162, 176, 177, 64, - /* 1020 */ 86, 87, 176, 177, 130, 176, 177, 219, 94, 95, - /* 1030 */ 96, 86, 87, 99, 155, 118, 155, 106, 110, 94, - /* 1040 */ 95, 96, 155, 39, 99, 178, 155, 26, 131, 195, - /* 1050 */ 155, 30, 118, 155, 155, 176, 177, 176, 177, 38, - /* 1060 */ 27, 155, 29, 176, 177, 51, 132, 133, 134, 135, - /* 1070 */ 136, 137, 138, 155, 176, 177, 55, 132, 133, 134, - /* 1080 */ 135, 136, 137, 138, 139, 194, 65, 178, 189, 194, - /* 1090 */ 69, 155, 47, 179, 176, 177, 186, 155, 155, 144, - /* 1100 */ 194, 155, 120, 155, 155, 155, 26, 86, 87, 88, - /* 1110 */ 30, 155, 176, 177, 155, 94, 95, 96, 38, 27, - /* 1120 */ 99, 29, 176, 177, 176, 177, 176, 177, 118, 155, - /* 1130 */ 155, 232, 176, 177, 155, 55, 194, 194, 189, 155, - /* 1140 */ 178, 131, 155, 105, 180, 65, 178, 162, 26, 69, - /* 1150 */ 176, 177, 155, 132, 133, 134, 135, 136, 137, 138, - /* 1160 */ 176, 177, 155, 176, 177, 11, 86, 87, 189, 194, - /* 1170 */ 155, 120, 120, 155, 94, 95, 96, 155, 219, 99, - /* 1180 */ 195, 232, 15, 176, 177, 155, 189, 20, 21, 22, - /* 1190 */ 23, 176, 177, 197, 176, 177, 196, 118, 176, 177, - /* 1200 */ 33, 195, 35, 155, 199, 51, 176, 177, 197, 42, - /* 1210 */ 155, 232, 132, 133, 134, 135, 136, 137, 138, 155, - /* 1220 */ 129, 54, 155, 56, 176, 177, 200, 126, 61, 232, - /* 1230 */ 63, 176, 177, 66, 127, 201, 124, 202, 128, 203, - /* 1240 */ 176, 177, 155, 176, 177, 204, 120, 120, 155, 26, - /* 1250 */ 168, 27, 27, 234, 234, 91, 99, 155, 118, 118, - /* 1260 */ 118, 26, 139, 21, 26, 228, 193, 27, 229, 155, - /* 1270 */ 29, 27, 120, 125, 107, 108, 109, 159, 29, 155, - /* 1280 */ 113, 104, 217, 179, 30, 118, 167, 217, 179, 29, - /* 1290 */ 125, 155, 209, 155, 122, 106, 159, 123, 155, 155, - /* 1300 */ 210, 26, 155, 27, 120, 211, 210, 27, 211, 178, - /* 1310 */ 155, 26, 182, 181, 155, 217, 217, 184, 167, 185, - /* 1320 */ 185, 155, 51, 26, 185, 179, 176, 27, 179, 176, - /* 1330 */ 26, 186, 51, 26, 103, 155, 155, 111, 159, 178, - /* 1340 */ 180, 178, 155, 181, 188, 159, 188, 28, 155, 159, - /* 1350 */ 182, 238, 237, 106, 159, 45, 239, 15, 43, 106, - /* 1360 */ 240, 106, 142, 52, 155, 159, 155, 106, 11, 26, - /* 1370 */ 178, 142, 21, 15, 191, 130, 130, 11, 11, 67, - /* 1380 */ 21, 76, 191, 155, 110, 200, 11, 155, 130, 76, - /* 1390 */ 26, 155, 221, 11, 26, 11, 200, 11, 121, 11, - /* 1400 */ 11, 11, 200, 155, 121, 11, 191, 200, 110, 11, - /* 1410 */ 11, 26, 130, 11, 155, 221, 159, 155, 11, 11, - /* 1420 */ 11, 11, 155, 27, 11, 28, 11, 40, 155, 11, - /* 1430 */ 242, 168, 168, 11, 155, 11, 11, 159, 11, 155, - /* 1440 */ 243, 242, 155, 24, 143, 159, 155, 11, 145, 245, - /* 1450 */ 144, 11, 13, 246, 246, 14, -}; -#define YY_SHIFT_USE_DFLT (-75) -static const short yy_shift_ofst[] = { - /* 0 */ 205, 7, -75, -75, 1167, -10, 57, -75, 47, 475, - /* 10 */ 399, 123, 337, -75, -75, -75, -75, -75, -75, 475, - /* 20 */ 446, 475, 543, 475, 757, 456, 858, 453, 240, 799, - /* 30 */ 865, 50, -75, 254, -75, -16, -75, 453, 151, -75, - /* 40 */ 931, -75, 1004, 306, -75, -75, -75, -75, -75, -75, - /* 50 */ -75, 180, 931, -75, 1045, -75, 278, -75, -75, 1014, - /* 60 */ 689, 931, 1038, -75, -75, -75, -75, 931, -75, 1122, - /* 70 */ 1080, 652, 473, -75, -75, 1080, 1051, 1052, -75, 934, - /* 80 */ -75, 302, 1079, -75, 650, -75, 641, 1091, 1101, 1107, - /* 90 */ 1112, 1110, -75, 1080, 40, 1080, 714, 1080, -75, 1126, - /* 100 */ 453, 1127, 453, -75, -75, -75, -75, -75, -75, 1223, - /* 110 */ 1080, 108, 254, -75, -75, 455, 321, 595, -75, 321, - /* 120 */ 1224, -75, -75, -75, 638, -75, -75, -75, 638, -75, - /* 130 */ -75, -75, -75, 1225, -75, 1080, -75, 814, 1080, -12, - /* 140 */ 1080, -12, 1080, -12, 1080, -12, 1080, -74, 1080, -74, - /* 150 */ 1080, -53, 1080, -53, 1080, -53, 1080, -53, 1080, 242, - /* 160 */ 1080, 242, 1080, 1164, 1080, 1164, 1080, 1164, 1080, -75, - /* 170 */ -75, 298, -75, -75, -75, -75, 1080, -59, 1080, -12, - /* 180 */ -75, 893, -75, 1157, -75, -75, -75, 1080, 764, 1080, - /* 190 */ -74, -75, 325, 934, 359, 419, 1140, 1141, 1142, -75, - /* 200 */ 714, 1080, 864, 1080, -75, 1080, -75, 1080, -75, 1235, - /* 210 */ 1079, 376, -75, 945, 158, 1123, 320, 1242, -75, 1080, - /* 220 */ 231, 1080, 714, 1238, 443, 1240, -75, 1241, 453, 1244, - /* 230 */ -75, 1080, 305, 1080, 355, 1080, 714, 780, -75, 1080, - /* 240 */ -75, -75, 1152, 453, -75, -75, -75, 864, 1080, 714, - /* 250 */ 1148, 1080, 1249, 1080, 1177, 689, -75, 1254, -75, -75, - /* 260 */ 714, 1177, 689, -75, 1080, 714, 1165, 1080, 1260, 1080, - /* 270 */ 714, -75, -75, 239, -75, -75, -75, 430, -75, 433, - /* 280 */ -75, 1172, -75, 501, 1152, 144, 453, -75, -75, 1189, - /* 290 */ 1174, -75, 1275, 453, 783, -75, 453, -75, -75, 1080, - /* 300 */ 714, 1079, 422, 425, 1276, 144, 1189, 1174, -75, 1021, - /* 310 */ -28, -75, -75, 1184, 73, -75, -75, 429, -75, 792, - /* 320 */ -75, 1280, -75, 496, 931, -75, 453, 1285, -75, 42, - /* 330 */ -75, 453, -75, 550, 928, -75, 716, -75, -75, -75, - /* 340 */ -75, 928, -75, 928, -75, 453, 793, -75, 453, 1177, - /* 350 */ 689, -75, -75, 1177, 689, -75, -75, 1254, -75, 1045, - /* 360 */ -75, -75, 68, -75, 1080, 564, -75, 191, -75, -75, - /* 370 */ 191, -75, -75, -75, -75, 176, 256, -75, 453, -75, - /* 380 */ 1271, 1297, 453, 260, 1300, 931, -75, 1304, 453, 796, - /* 390 */ 931, -75, 1080, 614, -75, 1281, 1307, 453, 833, 1231, - /* 400 */ 453, 1285, -75, 493, 1226, -75, -75, -75, -75, -75, - /* 410 */ 1079, 513, 856, 391, 453, 1152, -75, 453, 745, 1319, - /* 420 */ 1079, 548, 453, 1152, 510, 565, 1247, 453, 1152, -75, - /* 430 */ 1310, 297, 1342, 1080, 664, 1315, 813, -75, -75, 1253, - /* 440 */ 1255, 809, 453, 882, -75, -75, 1311, -75, -75, 1220, - /* 450 */ 453, 862, 1261, 453, 1343, 453, 892, 907, 1357, 1229, - /* 460 */ 1358, 152, 592, 894, 306, -75, 1245, 1246, 1351, 1366, - /* 470 */ 1367, 152, 1359, 1312, 453, 1274, 453, 746, 453, 1305, - /* 480 */ 1080, 714, 1375, 1313, 1080, 714, 1258, 453, 1364, 453, - /* 490 */ 947, -75, 917, 598, 1368, 1080, 1033, 1080, 714, 1382, - /* 500 */ 714, 1277, 453, 9, 1384, 470, 453, 1386, 453, 1388, - /* 510 */ 453, 1389, 453, 1390, 605, 1283, 453, 9, 1394, 1312, - /* 520 */ 453, 1298, 453, 746, 1398, 1282, 453, 1364, 1010, 610, - /* 530 */ 1385, 1080, 1092, 1399, 530, 1402, 453, 1152, 649, 179, - /* 540 */ 1407, 1408, 1409, 1410, 453, 1396, 1413, 1387, 254, 1397, - /* 550 */ 453, 1154, 1415, 778, 1418, 1422, -75, 1387, 453, 1424, - /* 560 */ 665, 982, 1425, 734, 982, 1427, 1419, 453, 955, 1301, - /* 570 */ 453, 1436, 1306, 1303, 453, 1440, -75, 1439, 1441, -75, - /* 580 */ -75, -}; -#define YY_REDUCE_USE_DFLT (-61) -static const short yy_reduce_ofst[] = { - /* 0 */ -48, 61, -61, -61, -60, -61, -61, -61, -32, 12, - /* 10 */ -61, 181, -61, -61, -61, -61, -61, -61, -61, 314, - /* 20 */ -61, 386, -61, 622, -61, 654, -61, 51, 798, -61, - /* 30 */ -61, -23, -61, -26, 760, 89, -61, 860, 486, -61, - /* 40 */ 867, -61, -61, 65, -61, -61, -61, -61, -61, -61, - /* 50 */ -61, -61, 909, -61, 910, -61, -61, -61, -61, -61, - /* 60 */ 914, 962, 964, -61, -61, -61, -61, 968, -61, -61, - /* 70 */ 438, -61, 996, -61, -61, 116, -61, -61, -61, 293, - /* 80 */ -61, 1000, 1006, -61, 1011, 569, 1005, 1026, 1034, 1035, - /* 90 */ 1036, 1041, -61, 490, 394, 552, 394, 601, -61, -61, - /* 100 */ 1087, -61, 1093, -61, -61, -61, -61, -61, -61, -61, - /* 110 */ 603, 394, 53, -61, -61, 1082, 110, -61, -61, 229, - /* 120 */ -61, -61, -61, -61, 1019, -61, -61, -61, 1020, -61, - /* 130 */ -61, -61, -61, -61, -61, 640, -61, 394, 651, 394, - /* 140 */ 690, 394, 701, 394, 703, 394, 740, 394, 751, 394, - /* 150 */ 753, 394, 755, 394, 790, 394, 801, 394, 803, 394, - /* 160 */ 818, 394, 829, 394, 831, 394, 835, 394, 841, 394, - /* 170 */ -61, -61, -61, -61, -61, -61, 846, 188, 849, 394, - /* 180 */ -61, -61, -61, -61, -61, -61, -61, 879, 394, 881, - /* 190 */ 394, -61, 1102, -6, 1000, -61, -61, -61, -61, -61, - /* 200 */ 394, 887, 394, 898, 394, 918, 394, 936, 394, -61, - /* 210 */ 662, 1000, -61, 295, 394, 1037, 1039, -61, -61, 946, - /* 220 */ 394, 948, 394, -61, 1073, -61, -61, -61, 1114, -61, - /* 230 */ -61, 950, 394, 956, 394, 974, 394, -61, -61, 303, - /* 240 */ -61, -61, 1118, 1124, -61, -61, -61, 394, 984, 394, - /* 250 */ -61, 183, -61, 190, 1065, 1104, -61, 1119, -61, -61, - /* 260 */ 394, 1070, 1109, -61, 987, 394, -61, 187, -61, 1007, - /* 270 */ 394, -61, 398, 1083, -61, -61, -61, 1136, -61, 1138, - /* 280 */ -61, -61, -61, 1143, 1137, 389, 1144, -61, -61, 1090, - /* 290 */ 1094, -61, -61, 604, -61, -61, 1147, -61, -61, 1015, - /* 300 */ 394, 132, 1000, 1083, -61, 512, 1096, 1097, -61, 1018, - /* 310 */ 241, -61, -61, -61, 1087, -61, -61, 394, -61, -61, - /* 320 */ -61, -61, -61, 394, 1131, -61, 1155, 1132, 1130, 1133, - /* 330 */ -61, 1159, -61, -61, 1134, -61, -61, -61, -61, -61, - /* 340 */ -61, 1135, -61, 1139, -61, 439, -61, -61, 765, 1098, - /* 350 */ 1146, -61, -61, 1099, 1149, -61, -61, 1151, -61, 1145, - /* 360 */ -61, -61, 692, -61, 1022, 394, -61, 1150, -61, -61, - /* 370 */ 1153, -61, -61, -61, -61, 1156, 1158, -61, 1166, -61, - /* 380 */ -61, -61, 899, 1160, -61, 1161, -61, -61, 949, -61, - /* 390 */ 1163, -61, 1030, 375, -61, -61, -61, 979, -61, -61, - /* 400 */ 1180, 1162, 1168, 527, -61, -61, -61, -61, -61, -61, - /* 410 */ 712, 1000, 756, -61, 1181, 1179, -61, 1187, 1186, -61, - /* 420 */ 807, 1000, 1193, 1190, 1115, 1113, -61, 715, 1195, -61, - /* 430 */ 1117, 1120, -61, 1048, 394, -61, -61, -61, -61, -61, - /* 440 */ -61, -61, 709, -61, -61, -61, -61, -61, -61, -61, - /* 450 */ 1209, 1206, -61, 1211, -61, 997, -61, 1192, -61, -61, - /* 460 */ -61, 315, 1000, 1183, 732, -61, -61, -61, -61, -61, - /* 470 */ -61, 382, -61, 1191, 1228, -61, 808, 1185, 1232, -61, - /* 480 */ 1055, 394, -61, -61, 1064, 394, -61, 1236, 1171, 767, - /* 490 */ -61, -61, 854, 1000, -61, -18, -61, 1067, 394, -61, - /* 500 */ 394, -61, 1248, 1196, -61, -61, 815, -61, 891, -61, - /* 510 */ 895, -61, 906, -61, 1000, -61, 942, 1202, -61, 1215, - /* 520 */ 943, -61, 959, 1207, -61, -61, 975, 1194, 985, 1000, - /* 530 */ -61, 434, -61, -61, 1259, -61, 1262, 1257, -61, 435, - /* 540 */ -61, -61, -61, -61, 1267, -61, -61, 1188, 1263, -61, - /* 550 */ 1273, 1197, -61, 1264, -61, -61, -61, 1199, 1279, -61, - /* 560 */ 1284, 1278, -61, 1287, 1286, -61, -61, 522, -61, -61, - /* 570 */ 1291, -61, -61, 1204, -58, -61, -61, -61, -61, -61, - /* 580 */ -61, -}; -static const YYACTIONTYPE yy_default[] = { - /* 0 */ 587, 587, 582, 585, 892, 892, 892, 586, 594, 892, - /* 10 */ 892, 892, 892, 614, 615, 616, 595, 596, 597, 892, - /* 20 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, - /* 30 */ 892, 892, 607, 617, 627, 609, 626, 892, 892, 628, - /* 40 */ 672, 635, 892, 892, 673, 676, 677, 678, 872, 873, - /* 50 */ 874, 892, 672, 636, 657, 655, 892, 658, 659, 892, - /* 60 */ 728, 672, 643, 637, 644, 726, 727, 672, 638, 892, - /* 70 */ 892, 758, 692, 690, 691, 824, 764, 759, 755, 892, - /* 80 */ 683, 892, 892, 684, 692, 694, 701, 740, 731, 733, - /* 90 */ 721, 735, 689, 892, 736, 892, 737, 892, 757, 892, - /* 100 */ 892, 760, 892, 761, 762, 763, 765, 766, 767, 892, - /* 110 */ 892, 892, 892, 612, 613, 619, 847, 892, 620, 847, - /* 120 */ 892, 621, 624, 625, 892, 842, 844, 845, 892, 843, - /* 130 */ 846, 623, 622, 892, 768, 892, 771, 773, 892, 774, - /* 140 */ 892, 775, 892, 776, 892, 777, 892, 778, 892, 779, - /* 150 */ 892, 780, 892, 781, 892, 782, 892, 783, 892, 784, - /* 160 */ 892, 785, 892, 786, 892, 787, 892, 788, 892, 789, - /* 170 */ 790, 892, 791, 798, 805, 808, 892, 793, 892, 792, - /* 180 */ 795, 892, 796, 892, 799, 797, 804, 892, 892, 892, - /* 190 */ 806, 807, 892, 824, 892, 892, 892, 892, 892, 811, - /* 200 */ 823, 892, 800, 892, 801, 892, 802, 892, 803, 892, - /* 210 */ 892, 892, 813, 892, 892, 892, 892, 892, 814, 892, - /* 220 */ 892, 892, 815, 892, 892, 892, 870, 892, 892, 892, - /* 230 */ 871, 892, 892, 892, 892, 892, 816, 892, 809, 824, - /* 240 */ 821, 822, 709, 892, 710, 812, 794, 772, 892, 738, - /* 250 */ 892, 892, 722, 892, 729, 728, 723, 892, 611, 730, - /* 260 */ 725, 729, 728, 724, 892, 734, 892, 824, 732, 892, - /* 270 */ 741, 693, 704, 702, 703, 712, 713, 892, 714, 892, - /* 280 */ 715, 892, 716, 892, 709, 700, 892, 698, 699, 718, - /* 290 */ 720, 705, 892, 892, 892, 719, 892, 753, 754, 892, - /* 300 */ 717, 704, 892, 892, 892, 700, 718, 720, 706, 892, - /* 310 */ 700, 695, 696, 892, 892, 697, 810, 892, 756, 892, - /* 320 */ 769, 892, 770, 892, 672, 639, 892, 828, 645, 640, - /* 330 */ 646, 892, 647, 892, 892, 648, 892, 651, 652, 653, - /* 340 */ 654, 892, 649, 892, 650, 892, 892, 829, 892, 729, - /* 350 */ 728, 830, 832, 729, 728, 831, 641, 892, 642, 657, - /* 360 */ 656, 629, 892, 630, 892, 892, 631, 892, 632, 764, - /* 370 */ 892, 633, 634, 618, 610, 892, 892, 662, 892, 665, - /* 380 */ 892, 892, 892, 892, 892, 672, 666, 892, 892, 892, - /* 390 */ 672, 667, 892, 672, 668, 892, 892, 892, 892, 892, - /* 400 */ 892, 828, 645, 670, 892, 669, 671, 663, 664, 608, - /* 410 */ 892, 892, 604, 892, 892, 709, 602, 892, 892, 892, - /* 420 */ 892, 892, 892, 709, 853, 892, 892, 892, 709, 711, - /* 430 */ 858, 892, 892, 892, 892, 892, 892, 859, 860, 892, - /* 440 */ 892, 892, 892, 892, 850, 851, 892, 852, 603, 892, - /* 450 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, - /* 460 */ 892, 892, 892, 892, 892, 675, 892, 892, 892, 892, - /* 470 */ 892, 892, 892, 674, 892, 892, 892, 892, 892, 892, - /* 480 */ 892, 743, 892, 892, 892, 744, 892, 892, 751, 892, - /* 490 */ 892, 752, 892, 892, 892, 892, 892, 892, 749, 892, - /* 500 */ 750, 892, 892, 892, 892, 892, 892, 892, 892, 892, - /* 510 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 674, - /* 520 */ 892, 892, 892, 892, 892, 892, 892, 751, 892, 892, - /* 530 */ 892, 892, 892, 892, 892, 892, 892, 709, 892, 847, - /* 540 */ 892, 892, 892, 892, 892, 892, 892, 881, 892, 892, - /* 550 */ 892, 892, 892, 892, 892, 892, 880, 881, 892, 892, - /* 560 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, - /* 570 */ 892, 892, 892, 890, 892, 892, 891, 588, 892, 589, - /* 580 */ 583, -}; -#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0])) - -/* The next table maps tokens into fallback tokens. If a construct -** like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammer, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { - 0, /* $ => nothing */ - 0, /* END_OF_FILE => nothing */ - 0, /* ILLEGAL => nothing */ - 0, /* SPACE => nothing */ - 0, /* UNCLOSED_STRING => nothing */ - 0, /* COMMENT => nothing */ - 0, /* FUNCTION => nothing */ - 0, /* COLUMN => nothing */ - 0, /* AGG_FUNCTION => nothing */ - 0, /* AGG_COLUMN => nothing */ - 0, /* CONST_FUNC => nothing */ - 0, /* SEMI => nothing */ - 30, /* EXPLAIN => ID */ - 30, /* QUERY => ID */ - 30, /* PLAN => ID */ - 30, /* BEGIN => ID */ - 0, /* TRANSACTION => nothing */ - 30, /* DEFERRED => ID */ - 30, /* IMMEDIATE => ID */ - 30, /* EXCLUSIVE => ID */ - 0, /* COMMIT => nothing */ - 30, /* END => ID */ - 0, /* ROLLBACK => nothing */ - 0, /* CREATE => nothing */ - 0, /* TABLE => nothing */ - 30, /* TEMP => ID */ - 0, /* LP => nothing */ - 0, /* RP => nothing */ - 0, /* AS => nothing */ - 0, /* COMMA => nothing */ - 0, /* ID => nothing */ - 30, /* ABORT => ID */ - 30, /* AFTER => ID */ - 30, /* ANALYZE => ID */ - 30, /* ASC => ID */ - 30, /* ATTACH => ID */ - 30, /* BEFORE => ID */ - 30, /* CASCADE => ID */ - 30, /* CAST => ID */ - 30, /* CONFLICT => ID */ - 30, /* DATABASE => ID */ - 30, /* DESC => ID */ - 30, /* DETACH => ID */ - 30, /* EACH => ID */ - 30, /* FAIL => ID */ - 30, /* FOR => ID */ - 30, /* IGNORE => ID */ - 30, /* INITIALLY => ID */ - 30, /* INSTEAD => ID */ - 30, /* LIKE_KW => ID */ - 30, /* MATCH => ID */ - 30, /* KEY => ID */ - 30, /* OF => ID */ - 30, /* OFFSET => ID */ - 30, /* PRAGMA => ID */ - 30, /* RAISE => ID */ - 30, /* REPLACE => ID */ - 30, /* RESTRICT => ID */ - 30, /* ROW => ID */ - 30, /* STATEMENT => ID */ - 30, /* TRIGGER => ID */ - 30, /* VACUUM => ID */ - 30, /* VIEW => ID */ - 30, /* REINDEX => ID */ - 30, /* RENAME => ID */ - 30, /* CTIME_KW => ID */ - 30, /* ALTER => ID */ - 0, /* OR => nothing */ - 0, /* AND => nothing */ - 0, /* NOT => nothing */ - 0, /* IS => nothing */ - 0, /* BETWEEN => nothing */ - 0, /* IN => nothing */ - 0, /* ISNULL => nothing */ - 0, /* NOTNULL => nothing */ - 0, /* NE => nothing */ - 0, /* EQ => nothing */ - 0, /* GT => nothing */ - 0, /* LE => nothing */ - 0, /* LT => nothing */ - 0, /* GE => nothing */ - 0, /* ESCAPE => nothing */ - 0, /* BITAND => nothing */ - 0, /* BITOR => nothing */ - 0, /* LSHIFT => nothing */ - 0, /* RSHIFT => nothing */ - 0, /* PLUS => nothing */ - 0, /* MINUS => nothing */ - 0, /* STAR => nothing */ - 0, /* SLASH => nothing */ - 0, /* REM => nothing */ - 0, /* CONCAT => nothing */ - 0, /* UMINUS => nothing */ - 0, /* UPLUS => nothing */ - 0, /* BITNOT => nothing */ - 0, /* STRING => nothing */ - 0, /* JOIN_KW => nothing */ - 0, /* CONSTRAINT => nothing */ - 0, /* DEFAULT => nothing */ - 0, /* NULL => nothing */ - 0, /* PRIMARY => nothing */ - 0, /* UNIQUE => nothing */ - 0, /* CHECK => nothing */ - 0, /* REFERENCES => nothing */ - 0, /* COLLATE => nothing */ - 0, /* AUTOINCR => nothing */ - 0, /* ON => nothing */ - 0, /* DELETE => nothing */ - 0, /* UPDATE => nothing */ - 0, /* INSERT => nothing */ - 0, /* SET => nothing */ - 0, /* DEFERRABLE => nothing */ - 0, /* FOREIGN => nothing */ - 0, /* DROP => nothing */ - 0, /* UNION => nothing */ - 0, /* ALL => nothing */ - 0, /* INTERSECT => nothing */ - 0, /* EXCEPT => nothing */ - 0, /* SELECT => nothing */ - 0, /* DISTINCT => nothing */ - 0, /* DOT => nothing */ - 0, /* FROM => nothing */ - 0, /* JOIN => nothing */ - 0, /* USING => nothing */ - 0, /* ORDER => nothing */ - 0, /* BY => nothing */ - 0, /* GROUP => nothing */ - 0, /* HAVING => nothing */ - 0, /* LIMIT => nothing */ - 0, /* WHERE => nothing */ - 0, /* INTO => nothing */ - 0, /* VALUES => nothing */ - 0, /* INTEGER => nothing */ - 0, /* FLOAT => nothing */ - 0, /* BLOB => nothing */ - 0, /* REGISTER => nothing */ - 0, /* VARIABLE => nothing */ - 0, /* EXISTS => nothing */ - 0, /* CASE => nothing */ - 0, /* WHEN => nothing */ - 0, /* THEN => nothing */ - 0, /* ELSE => nothing */ - 0, /* INDEX => nothing */ - 0, /* TO => nothing */ - 0, /* ADD => nothing */ - 0, /* COLUMNKW => nothing */ -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -*/ -struct yyStackEntry { - int stateno; /* The state-number */ - int major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - int yyidx; /* Index of top element in stack */ - int yyerrcnt; /* Shifts left before out of the error */ - sqlite3ParserARG_SDECL /* A place to hold %extra_argument */ - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include <stdio.h> -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -** <ul> -** <li> A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -** <li> A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -** </ul> -** -** Outputs: -** None. -*/ -void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { - "$", "END_OF_FILE", "ILLEGAL", "SPACE", - "UNCLOSED_STRING", "COMMENT", "FUNCTION", "COLUMN", - "AGG_FUNCTION", "AGG_COLUMN", "CONST_FUNC", "SEMI", - "EXPLAIN", "QUERY", "PLAN", "BEGIN", - "TRANSACTION", "DEFERRED", "IMMEDIATE", "EXCLUSIVE", - "COMMIT", "END", "ROLLBACK", "CREATE", - "TABLE", "TEMP", "LP", "RP", - "AS", "COMMA", "ID", "ABORT", - "AFTER", "ANALYZE", "ASC", "ATTACH", - "BEFORE", "CASCADE", "CAST", "CONFLICT", - "DATABASE", "DESC", "DETACH", "EACH", - "FAIL", "FOR", "IGNORE", "INITIALLY", - "INSTEAD", "LIKE_KW", "MATCH", "KEY", - "OF", "OFFSET", "PRAGMA", "RAISE", - "REPLACE", "RESTRICT", "ROW", "STATEMENT", - "TRIGGER", "VACUUM", "VIEW", "REINDEX", - "RENAME", "CTIME_KW", "ALTER", "OR", - "AND", "NOT", "IS", "BETWEEN", - "IN", "ISNULL", "NOTNULL", "NE", - "EQ", "GT", "LE", "LT", - "GE", "ESCAPE", "BITAND", "BITOR", - "LSHIFT", "RSHIFT", "PLUS", "MINUS", - "STAR", "SLASH", "REM", "CONCAT", - "UMINUS", "UPLUS", "BITNOT", "STRING", - "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL", - "PRIMARY", "UNIQUE", "CHECK", "REFERENCES", - "COLLATE", "AUTOINCR", "ON", "DELETE", - "UPDATE", "INSERT", "SET", "DEFERRABLE", - "FOREIGN", "DROP", "UNION", "ALL", - "INTERSECT", "EXCEPT", "SELECT", "DISTINCT", - "DOT", "FROM", "JOIN", "USING", - "ORDER", "BY", "GROUP", "HAVING", - "LIMIT", "WHERE", "INTO", "VALUES", - "INTEGER", "FLOAT", "BLOB", "REGISTER", - "VARIABLE", "EXISTS", "CASE", "WHEN", - "THEN", "ELSE", "INDEX", "TO", - "ADD", "COLUMNKW", "error", "input", - "cmdlist", "ecmd", "cmdx", "cmd", - "explain", "transtype", "trans_opt", "nm", - "create_table", "create_table_args", "temp", "dbnm", - "columnlist", "conslist_opt", "select", "column", - "columnid", "type", "carglist", "id", - "ids", "typetoken", "typename", "signed", - "plus_num", "minus_num", "carg", "ccons", - "term", "expr", "onconf", "sortorder", - "autoinc", "idxlist_opt", "refargs", "defer_subclause", - "refarg", "refact", "init_deferred_pred_opt", "conslist", - "tcons", "idxlist", "defer_subclause_opt", "orconf", - "resolvetype", "raisetype", "fullname", "oneselect", - "multiselect_op", "distinct", "selcollist", "from", - "where_opt", "groupby_opt", "having_opt", "orderby_opt", - "limit_opt", "sclp", "as", "seltablist", - "stl_prefix", "joinop", "on_opt", "using_opt", - "seltablist_paren", "joinop2", "inscollist", "sortlist", - "sortitem", "collate", "exprlist", "setlist", - "insert_cmd", "inscollist_opt", "itemlist", "likeop", - "escape", "between_op", "in_op", "case_operand", - "case_exprlist", "case_else", "expritem", "uniqueflag", - "idxitem", "plus_opt", "number", "trigger_decl", - "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", - "when_clause", "trigger_cmd", "database_kw_opt", "key_opt", - "add_column_fullname", "kwcolumn_opt", -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { - /* 0 */ "input ::= cmdlist", - /* 1 */ "cmdlist ::= cmdlist ecmd", - /* 2 */ "cmdlist ::= ecmd", - /* 3 */ "cmdx ::= cmd", - /* 4 */ "ecmd ::= SEMI", - /* 5 */ "ecmd ::= explain cmdx SEMI", - /* 6 */ "explain ::=", - /* 7 */ "explain ::= EXPLAIN", - /* 8 */ "explain ::= EXPLAIN QUERY PLAN", - /* 9 */ "cmd ::= BEGIN transtype trans_opt", - /* 10 */ "trans_opt ::=", - /* 11 */ "trans_opt ::= TRANSACTION", - /* 12 */ "trans_opt ::= TRANSACTION nm", - /* 13 */ "transtype ::=", - /* 14 */ "transtype ::= DEFERRED", - /* 15 */ "transtype ::= IMMEDIATE", - /* 16 */ "transtype ::= EXCLUSIVE", - /* 17 */ "cmd ::= COMMIT trans_opt", - /* 18 */ "cmd ::= END trans_opt", - /* 19 */ "cmd ::= ROLLBACK trans_opt", - /* 20 */ "cmd ::= create_table create_table_args", - /* 21 */ "create_table ::= CREATE temp TABLE nm dbnm", - /* 22 */ "temp ::= TEMP", - /* 23 */ "temp ::=", - /* 24 */ "create_table_args ::= LP columnlist conslist_opt RP", - /* 25 */ "create_table_args ::= AS select", - /* 26 */ "columnlist ::= columnlist COMMA column", - /* 27 */ "columnlist ::= column", - /* 28 */ "column ::= columnid type carglist", - /* 29 */ "columnid ::= nm", - /* 30 */ "id ::= ID", - /* 31 */ "ids ::= ID", - /* 32 */ "ids ::= STRING", - /* 33 */ "nm ::= ID", - /* 34 */ "nm ::= STRING", - /* 35 */ "nm ::= JOIN_KW", - /* 36 */ "type ::=", - /* 37 */ "type ::= typetoken", - /* 38 */ "typetoken ::= typename", - /* 39 */ "typetoken ::= typename LP signed RP", - /* 40 */ "typetoken ::= typename LP signed COMMA signed RP", - /* 41 */ "typename ::= ids", - /* 42 */ "typename ::= typename ids", - /* 43 */ "signed ::= plus_num", - /* 44 */ "signed ::= minus_num", - /* 45 */ "carglist ::= carglist carg", - /* 46 */ "carglist ::=", - /* 47 */ "carg ::= CONSTRAINT nm ccons", - /* 48 */ "carg ::= ccons", - /* 49 */ "carg ::= DEFAULT term", - /* 50 */ "carg ::= DEFAULT LP expr RP", - /* 51 */ "carg ::= DEFAULT PLUS term", - /* 52 */ "carg ::= DEFAULT MINUS term", - /* 53 */ "carg ::= DEFAULT id", - /* 54 */ "ccons ::= NULL onconf", - /* 55 */ "ccons ::= NOT NULL onconf", - /* 56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", - /* 57 */ "ccons ::= UNIQUE onconf", - /* 58 */ "ccons ::= CHECK LP expr RP onconf", - /* 59 */ "ccons ::= REFERENCES nm idxlist_opt refargs", - /* 60 */ "ccons ::= defer_subclause", - /* 61 */ "ccons ::= COLLATE id", - /* 62 */ "autoinc ::=", - /* 63 */ "autoinc ::= AUTOINCR", - /* 64 */ "refargs ::=", - /* 65 */ "refargs ::= refargs refarg", - /* 66 */ "refarg ::= MATCH nm", - /* 67 */ "refarg ::= ON DELETE refact", - /* 68 */ "refarg ::= ON UPDATE refact", - /* 69 */ "refarg ::= ON INSERT refact", - /* 70 */ "refact ::= SET NULL", - /* 71 */ "refact ::= SET DEFAULT", - /* 72 */ "refact ::= CASCADE", - /* 73 */ "refact ::= RESTRICT", - /* 74 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", - /* 75 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", - /* 76 */ "init_deferred_pred_opt ::=", - /* 77 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", - /* 78 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", - /* 79 */ "conslist_opt ::=", - /* 80 */ "conslist_opt ::= COMMA conslist", - /* 81 */ "conslist ::= conslist COMMA tcons", - /* 82 */ "conslist ::= conslist tcons", - /* 83 */ "conslist ::= tcons", - /* 84 */ "tcons ::= CONSTRAINT nm", - /* 85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", - /* 86 */ "tcons ::= UNIQUE LP idxlist RP onconf", - /* 87 */ "tcons ::= CHECK expr onconf", - /* 88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", - /* 89 */ "defer_subclause_opt ::=", - /* 90 */ "defer_subclause_opt ::= defer_subclause", - /* 91 */ "onconf ::=", - /* 92 */ "onconf ::= ON CONFLICT resolvetype", - /* 93 */ "orconf ::=", - /* 94 */ "orconf ::= OR resolvetype", - /* 95 */ "resolvetype ::= raisetype", - /* 96 */ "resolvetype ::= IGNORE", - /* 97 */ "resolvetype ::= REPLACE", - /* 98 */ "cmd ::= DROP TABLE fullname", - /* 99 */ "cmd ::= CREATE temp VIEW nm dbnm AS select", - /* 100 */ "cmd ::= DROP VIEW fullname", - /* 101 */ "cmd ::= select", - /* 102 */ "select ::= oneselect", - /* 103 */ "select ::= select multiselect_op oneselect", - /* 104 */ "multiselect_op ::= UNION", - /* 105 */ "multiselect_op ::= UNION ALL", - /* 106 */ "multiselect_op ::= INTERSECT", - /* 107 */ "multiselect_op ::= EXCEPT", - /* 108 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", - /* 109 */ "distinct ::= DISTINCT", - /* 110 */ "distinct ::= ALL", - /* 111 */ "distinct ::=", - /* 112 */ "sclp ::= selcollist COMMA", - /* 113 */ "sclp ::=", - /* 114 */ "selcollist ::= sclp expr as", - /* 115 */ "selcollist ::= sclp STAR", - /* 116 */ "selcollist ::= sclp nm DOT STAR", - /* 117 */ "as ::= AS nm", - /* 118 */ "as ::= ids", - /* 119 */ "as ::=", - /* 120 */ "from ::=", - /* 121 */ "from ::= FROM seltablist", - /* 122 */ "stl_prefix ::= seltablist joinop", - /* 123 */ "stl_prefix ::=", - /* 124 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt", - /* 125 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt", - /* 126 */ "seltablist_paren ::= select", - /* 127 */ "seltablist_paren ::= seltablist", - /* 128 */ "dbnm ::=", - /* 129 */ "dbnm ::= DOT nm", - /* 130 */ "fullname ::= nm dbnm", - /* 131 */ "joinop ::= COMMA", - /* 132 */ "joinop ::= JOIN", - /* 133 */ "joinop ::= JOIN_KW JOIN", - /* 134 */ "joinop ::= JOIN_KW nm JOIN", - /* 135 */ "joinop ::= JOIN_KW nm nm JOIN", - /* 136 */ "on_opt ::= ON expr", - /* 137 */ "on_opt ::=", - /* 138 */ "using_opt ::= USING LP inscollist RP", - /* 139 */ "using_opt ::=", - /* 140 */ "orderby_opt ::=", - /* 141 */ "orderby_opt ::= ORDER BY sortlist", - /* 142 */ "sortlist ::= sortlist COMMA sortitem collate sortorder", - /* 143 */ "sortlist ::= sortitem collate sortorder", - /* 144 */ "sortitem ::= expr", - /* 145 */ "sortorder ::= ASC", - /* 146 */ "sortorder ::= DESC", - /* 147 */ "sortorder ::=", - /* 148 */ "collate ::=", - /* 149 */ "collate ::= COLLATE id", - /* 150 */ "groupby_opt ::=", - /* 151 */ "groupby_opt ::= GROUP BY exprlist", - /* 152 */ "having_opt ::=", - /* 153 */ "having_opt ::= HAVING expr", - /* 154 */ "limit_opt ::=", - /* 155 */ "limit_opt ::= LIMIT expr", - /* 156 */ "limit_opt ::= LIMIT expr OFFSET expr", - /* 157 */ "limit_opt ::= LIMIT expr COMMA expr", - /* 158 */ "cmd ::= DELETE FROM fullname where_opt", - /* 159 */ "where_opt ::=", - /* 160 */ "where_opt ::= WHERE expr", - /* 161 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt", - /* 162 */ "setlist ::= setlist COMMA nm EQ expr", - /* 163 */ "setlist ::= nm EQ expr", - /* 164 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", - /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", - /* 166 */ "insert_cmd ::= INSERT orconf", - /* 167 */ "insert_cmd ::= REPLACE", - /* 168 */ "itemlist ::= itemlist COMMA expr", - /* 169 */ "itemlist ::= expr", - /* 170 */ "inscollist_opt ::=", - /* 171 */ "inscollist_opt ::= LP inscollist RP", - /* 172 */ "inscollist ::= inscollist COMMA nm", - /* 173 */ "inscollist ::= nm", - /* 174 */ "expr ::= term", - /* 175 */ "expr ::= LP expr RP", - /* 176 */ "term ::= NULL", - /* 177 */ "expr ::= ID", - /* 178 */ "expr ::= JOIN_KW", - /* 179 */ "expr ::= nm DOT nm", - /* 180 */ "expr ::= nm DOT nm DOT nm", - /* 181 */ "term ::= INTEGER", - /* 182 */ "term ::= FLOAT", - /* 183 */ "term ::= STRING", - /* 184 */ "term ::= BLOB", - /* 185 */ "expr ::= REGISTER", - /* 186 */ "expr ::= VARIABLE", - /* 187 */ "expr ::= CAST LP expr AS typetoken RP", - /* 188 */ "expr ::= ID LP distinct exprlist RP", - /* 189 */ "expr ::= ID LP STAR RP", - /* 190 */ "term ::= CTIME_KW", - /* 191 */ "expr ::= expr AND expr", - /* 192 */ "expr ::= expr OR expr", - /* 193 */ "expr ::= expr LT expr", - /* 194 */ "expr ::= expr GT expr", - /* 195 */ "expr ::= expr LE expr", - /* 196 */ "expr ::= expr GE expr", - /* 197 */ "expr ::= expr NE expr", - /* 198 */ "expr ::= expr EQ expr", - /* 199 */ "expr ::= expr BITAND expr", - /* 200 */ "expr ::= expr BITOR expr", - /* 201 */ "expr ::= expr LSHIFT expr", - /* 202 */ "expr ::= expr RSHIFT expr", - /* 203 */ "expr ::= expr PLUS expr", - /* 204 */ "expr ::= expr MINUS expr", - /* 205 */ "expr ::= expr STAR expr", - /* 206 */ "expr ::= expr SLASH expr", - /* 207 */ "expr ::= expr REM expr", - /* 208 */ "expr ::= expr CONCAT expr", - /* 209 */ "likeop ::= LIKE_KW", - /* 210 */ "likeop ::= NOT LIKE_KW", - /* 211 */ "escape ::= ESCAPE expr", - /* 212 */ "escape ::=", - /* 213 */ "expr ::= expr likeop expr escape", - /* 214 */ "expr ::= expr ISNULL", - /* 215 */ "expr ::= expr IS NULL", - /* 216 */ "expr ::= expr NOTNULL", - /* 217 */ "expr ::= expr NOT NULL", - /* 218 */ "expr ::= expr IS NOT NULL", - /* 219 */ "expr ::= NOT expr", - /* 220 */ "expr ::= BITNOT expr", - /* 221 */ "expr ::= MINUS expr", - /* 222 */ "expr ::= PLUS expr", - /* 223 */ "between_op ::= BETWEEN", - /* 224 */ "between_op ::= NOT BETWEEN", - /* 225 */ "expr ::= expr between_op expr AND expr", - /* 226 */ "in_op ::= IN", - /* 227 */ "in_op ::= NOT IN", - /* 228 */ "expr ::= expr in_op LP exprlist RP", - /* 229 */ "expr ::= LP select RP", - /* 230 */ "expr ::= expr in_op LP select RP", - /* 231 */ "expr ::= expr in_op nm dbnm", - /* 232 */ "expr ::= EXISTS LP select RP", - /* 233 */ "expr ::= CASE case_operand case_exprlist case_else END", - /* 234 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", - /* 235 */ "case_exprlist ::= WHEN expr THEN expr", - /* 236 */ "case_else ::= ELSE expr", - /* 237 */ "case_else ::=", - /* 238 */ "case_operand ::= expr", - /* 239 */ "case_operand ::=", - /* 240 */ "exprlist ::= exprlist COMMA expritem", - /* 241 */ "exprlist ::= expritem", - /* 242 */ "expritem ::= expr", - /* 243 */ "expritem ::=", - /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf", - /* 245 */ "uniqueflag ::= UNIQUE", - /* 246 */ "uniqueflag ::=", - /* 247 */ "idxlist_opt ::=", - /* 248 */ "idxlist_opt ::= LP idxlist RP", - /* 249 */ "idxlist ::= idxlist COMMA idxitem collate sortorder", - /* 250 */ "idxlist ::= idxitem collate sortorder", - /* 251 */ "idxitem ::= nm", - /* 252 */ "cmd ::= DROP INDEX fullname", - /* 253 */ "cmd ::= VACUUM", - /* 254 */ "cmd ::= VACUUM nm", - /* 255 */ "cmd ::= PRAGMA nm dbnm EQ nm", - /* 256 */ "cmd ::= PRAGMA nm dbnm EQ ON", - /* 257 */ "cmd ::= PRAGMA nm dbnm EQ plus_num", - /* 258 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", - /* 259 */ "cmd ::= PRAGMA nm dbnm LP nm RP", - /* 260 */ "cmd ::= PRAGMA nm dbnm", - /* 261 */ "plus_num ::= plus_opt number", - /* 262 */ "minus_num ::= MINUS number", - /* 263 */ "number ::= INTEGER", - /* 264 */ "number ::= FLOAT", - /* 265 */ "plus_opt ::= PLUS", - /* 266 */ "plus_opt ::=", - /* 267 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", - /* 268 */ "trigger_decl ::= temp TRIGGER nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", - /* 269 */ "trigger_time ::= BEFORE", - /* 270 */ "trigger_time ::= AFTER", - /* 271 */ "trigger_time ::= INSTEAD OF", - /* 272 */ "trigger_time ::=", - /* 273 */ "trigger_event ::= DELETE", - /* 274 */ "trigger_event ::= INSERT", - /* 275 */ "trigger_event ::= UPDATE", - /* 276 */ "trigger_event ::= UPDATE OF inscollist", - /* 277 */ "foreach_clause ::=", - /* 278 */ "foreach_clause ::= FOR EACH ROW", - /* 279 */ "foreach_clause ::= FOR EACH STATEMENT", - /* 280 */ "when_clause ::=", - /* 281 */ "when_clause ::= WHEN expr", - /* 282 */ "trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list", - /* 283 */ "trigger_cmd_list ::=", - /* 284 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", - /* 285 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", - /* 286 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", - /* 287 */ "trigger_cmd ::= DELETE FROM nm where_opt", - /* 288 */ "trigger_cmd ::= select", - /* 289 */ "expr ::= RAISE LP IGNORE RP", - /* 290 */ "expr ::= RAISE LP raisetype COMMA nm RP", - /* 291 */ "raisetype ::= ROLLBACK", - /* 292 */ "raisetype ::= ABORT", - /* 293 */ "raisetype ::= FAIL", - /* 294 */ "cmd ::= DROP TRIGGER fullname", - /* 295 */ "cmd ::= ATTACH database_kw_opt ids AS nm key_opt", - /* 296 */ "key_opt ::=", - /* 297 */ "key_opt ::= KEY ids", - /* 298 */ "key_opt ::= KEY BLOB", - /* 299 */ "database_kw_opt ::= DATABASE", - /* 300 */ "database_kw_opt ::=", - /* 301 */ "cmd ::= DETACH database_kw_opt nm", - /* 302 */ "cmd ::= REINDEX", - /* 303 */ "cmd ::= REINDEX nm dbnm", - /* 304 */ "cmd ::= ANALYZE", - /* 305 */ "cmd ::= ANALYZE nm dbnm", - /* 306 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", - /* 307 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", - /* 308 */ "add_column_fullname ::= fullname", - /* 309 */ "kwcolumn_opt ::=", - /* 310 */ "kwcolumn_opt ::= COLUMNKW", -}; -#endif /* NDEBUG */ - -/* -** This function returns the symbolic name associated with a token -** value. -*/ -const char *sqlite3ParserTokenName(int tokenType){ -#ifndef NDEBUG - if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ - return yyTokenName[tokenType]; - }else{ - return "Unknown"; - } -#else - return ""; -#endif -} - -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to sqlite3Parser and sqlite3ParserFree. -*/ -void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); - if( pParser ){ - pParser->yyidx = -1; - } - return pParser; -} - -/* The following function deletes the value associated with a -** symbol. The symbol can be either a terminal or nonterminal. -** "yymajor" is the symbol code, and "yypminor" is a pointer to -** the value. -*/ -static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are not used - ** inside the C code. - */ - case 162: - case 195: - case 212: -#line 370 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3SelectDelete((yypminor->yy375));} -#line 1332 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 176: - case 177: - case 200: - case 202: - case 210: - case 216: - case 230: -#line 629 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3ExprDelete((yypminor->yy62));} -#line 1343 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 181: - case 189: - case 198: - case 201: - case 203: - case 205: - case 215: - case 218: - case 219: - case 222: - case 228: -#line 876 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3ExprListDelete((yypminor->yy418));} -#line 1358 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 194: - case 199: - case 207: - case 208: -#line 499 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3SrcListDelete((yypminor->yy151));} -#line 1366 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 204: -#line 561 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3ExprDelete((yypminor->yy220).pLimit); - sqlite3ExprDelete((yypminor->yy220).pOffset); -} -#line 1374 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 211: - case 214: - case 221: -#line 517 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3IdListDelete((yypminor->yy240));} -#line 1381 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 236: - case 241: -#line 969 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3DeleteTriggerStep((yypminor->yy360));} -#line 1387 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 238: -#line 953 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3IdListDelete((yypminor->yy30).b);} -#line 1392 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -** -** Return the major token number for the symbol popped. -*/ -static int yy_pop_parser_stack(yyParser *pParser){ - YYCODETYPE yymajor; - yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; - - if( pParser->yyidx<0 ) return 0; -#ifndef NDEBUG - if( yyTraceFILE && pParser->yyidx>=0 ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yymajor = yytos->major; - yy_destructor( yymajor, &yytos->minor); - pParser->yyidx--; - return yymajor; -} - -/* -** Deallocate and destroy a parser. Destructors are all called for -** all stack elements before shutting the parser down. -** -** Inputs: -** <ul> -** <li> A pointer to the parser. This should be a pointer -** obtained from sqlite3ParserAlloc. -** <li> A pointer to a function used to reclaim memory obtained -** from malloc. -** </ul> -*/ -void sqlite3ParserFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ - yyParser *pParser = (yyParser*)p; - if( pParser==0 ) return; - while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); - (*freeProc)((void*)pParser); -} - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_shift_action( - yyParser *pParser, /* The parser */ - int iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yystack[pParser->yyidx].stateno; - - /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */ - i = yy_shift_ofst[stateno]; - if( i==YY_SHIFT_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - int iFallback; /* Fallback token */ - if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) - && (iFallback = yyFallback[iLookAhead])!=0 ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - return yy_find_shift_action(pParser, iFallback); - } -#endif - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - int iLookAhead /* The look-ahead token */ -){ - int i; - /* int stateno = pParser->yystack[pParser->yyidx].stateno; */ - - i = yy_reduce_ofst[stateno]; - if( i==YY_REDUCE_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yyidx++; - if( yypParser->yyidx>=YYSTACKDEPTH ){ - sqlite3ParserARG_FETCH; - yypParser->yyidx--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ - sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ - return; - } - yytos = &yypParser->yystack[yypParser->yyidx]; - yytos->stateno = yyNewState; - yytos->major = yyMajor; - yytos->minor = *yypMinor; -#ifndef NDEBUG - if( yyTraceFILE && yypParser->yyidx>0 ){ - int i; - fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); - fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); - for(i=1; i<=yypParser->yyidx; i++) - fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); - fprintf(yyTraceFILE,"\n"); - } -#endif -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - unsigned char nrhs; /* Number of right-hand side symbols in the rule */ -} yyRuleInfo[] = { - { 147, 1 }, - { 148, 2 }, - { 148, 1 }, - { 150, 1 }, - { 149, 1 }, - { 149, 3 }, - { 152, 0 }, - { 152, 1 }, - { 152, 3 }, - { 151, 3 }, - { 154, 0 }, - { 154, 1 }, - { 154, 2 }, - { 153, 0 }, - { 153, 1 }, - { 153, 1 }, - { 153, 1 }, - { 151, 2 }, - { 151, 2 }, - { 151, 2 }, - { 151, 2 }, - { 156, 5 }, - { 158, 1 }, - { 158, 0 }, - { 157, 4 }, - { 157, 2 }, - { 160, 3 }, - { 160, 1 }, - { 163, 3 }, - { 164, 1 }, - { 167, 1 }, - { 168, 1 }, - { 168, 1 }, - { 155, 1 }, - { 155, 1 }, - { 155, 1 }, - { 165, 0 }, - { 165, 1 }, - { 169, 1 }, - { 169, 4 }, - { 169, 6 }, - { 170, 1 }, - { 170, 2 }, - { 171, 1 }, - { 171, 1 }, - { 166, 2 }, - { 166, 0 }, - { 174, 3 }, - { 174, 1 }, - { 174, 2 }, - { 174, 4 }, - { 174, 3 }, - { 174, 3 }, - { 174, 2 }, - { 175, 2 }, - { 175, 3 }, - { 175, 5 }, - { 175, 2 }, - { 175, 5 }, - { 175, 4 }, - { 175, 1 }, - { 175, 2 }, - { 180, 0 }, - { 180, 1 }, - { 182, 0 }, - { 182, 2 }, - { 184, 2 }, - { 184, 3 }, - { 184, 3 }, - { 184, 3 }, - { 185, 2 }, - { 185, 2 }, - { 185, 1 }, - { 185, 1 }, - { 183, 3 }, - { 183, 2 }, - { 186, 0 }, - { 186, 2 }, - { 186, 2 }, - { 161, 0 }, - { 161, 2 }, - { 187, 3 }, - { 187, 2 }, - { 187, 1 }, - { 188, 2 }, - { 188, 7 }, - { 188, 5 }, - { 188, 3 }, - { 188, 10 }, - { 190, 0 }, - { 190, 1 }, - { 178, 0 }, - { 178, 3 }, - { 191, 0 }, - { 191, 2 }, - { 192, 1 }, - { 192, 1 }, - { 192, 1 }, - { 151, 3 }, - { 151, 7 }, - { 151, 3 }, - { 151, 1 }, - { 162, 1 }, - { 162, 3 }, - { 196, 1 }, - { 196, 2 }, - { 196, 1 }, - { 196, 1 }, - { 195, 9 }, - { 197, 1 }, - { 197, 1 }, - { 197, 0 }, - { 205, 2 }, - { 205, 0 }, - { 198, 3 }, - { 198, 2 }, - { 198, 4 }, - { 206, 2 }, - { 206, 1 }, - { 206, 0 }, - { 199, 0 }, - { 199, 2 }, - { 208, 2 }, - { 208, 0 }, - { 207, 6 }, - { 207, 7 }, - { 212, 1 }, - { 212, 1 }, - { 159, 0 }, - { 159, 2 }, - { 194, 2 }, - { 209, 1 }, - { 209, 1 }, - { 209, 2 }, - { 209, 3 }, - { 209, 4 }, - { 210, 2 }, - { 210, 0 }, - { 211, 4 }, - { 211, 0 }, - { 203, 0 }, - { 203, 3 }, - { 215, 5 }, - { 215, 3 }, - { 216, 1 }, - { 179, 1 }, - { 179, 1 }, - { 179, 0 }, - { 217, 0 }, - { 217, 2 }, - { 201, 0 }, - { 201, 3 }, - { 202, 0 }, - { 202, 2 }, - { 204, 0 }, - { 204, 2 }, - { 204, 4 }, - { 204, 4 }, - { 151, 4 }, - { 200, 0 }, - { 200, 2 }, - { 151, 6 }, - { 219, 5 }, - { 219, 3 }, - { 151, 8 }, - { 151, 5 }, - { 220, 2 }, - { 220, 1 }, - { 222, 3 }, - { 222, 1 }, - { 221, 0 }, - { 221, 3 }, - { 214, 3 }, - { 214, 1 }, - { 177, 1 }, - { 177, 3 }, - { 176, 1 }, - { 177, 1 }, - { 177, 1 }, - { 177, 3 }, - { 177, 5 }, - { 176, 1 }, - { 176, 1 }, - { 176, 1 }, - { 176, 1 }, - { 177, 1 }, - { 177, 1 }, - { 177, 6 }, - { 177, 5 }, - { 177, 4 }, - { 176, 1 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 177, 3 }, - { 223, 1 }, - { 223, 2 }, - { 224, 2 }, - { 224, 0 }, - { 177, 4 }, - { 177, 2 }, - { 177, 3 }, - { 177, 2 }, - { 177, 3 }, - { 177, 4 }, - { 177, 2 }, - { 177, 2 }, - { 177, 2 }, - { 177, 2 }, - { 225, 1 }, - { 225, 2 }, - { 177, 5 }, - { 226, 1 }, - { 226, 2 }, - { 177, 5 }, - { 177, 3 }, - { 177, 5 }, - { 177, 4 }, - { 177, 4 }, - { 177, 5 }, - { 228, 5 }, - { 228, 4 }, - { 229, 2 }, - { 229, 0 }, - { 227, 1 }, - { 227, 0 }, - { 218, 3 }, - { 218, 1 }, - { 230, 1 }, - { 230, 0 }, - { 151, 11 }, - { 231, 1 }, - { 231, 0 }, - { 181, 0 }, - { 181, 3 }, - { 189, 5 }, - { 189, 3 }, - { 232, 1 }, - { 151, 3 }, - { 151, 1 }, - { 151, 2 }, - { 151, 5 }, - { 151, 5 }, - { 151, 5 }, - { 151, 5 }, - { 151, 6 }, - { 151, 3 }, - { 172, 2 }, - { 173, 2 }, - { 234, 1 }, - { 234, 1 }, - { 233, 1 }, - { 233, 0 }, - { 151, 5 }, - { 235, 10 }, - { 237, 1 }, - { 237, 1 }, - { 237, 2 }, - { 237, 0 }, - { 238, 1 }, - { 238, 1 }, - { 238, 1 }, - { 238, 3 }, - { 239, 0 }, - { 239, 3 }, - { 239, 3 }, - { 240, 0 }, - { 240, 2 }, - { 236, 3 }, - { 236, 0 }, - { 241, 6 }, - { 241, 8 }, - { 241, 5 }, - { 241, 4 }, - { 241, 1 }, - { 177, 4 }, - { 177, 6 }, - { 193, 1 }, - { 193, 1 }, - { 193, 1 }, - { 151, 3 }, - { 151, 6 }, - { 243, 0 }, - { 243, 2 }, - { 243, 2 }, - { 242, 1 }, - { 242, 0 }, - { 151, 3 }, - { 151, 1 }, - { 151, 3 }, - { 151, 1 }, - { 151, 3 }, - { 151, 6 }, - { 151, 6 }, - { 244, 1 }, - { 245, 0 }, - { 245, 1 }, -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - int yyruleno /* Number of the rule by which to reduce */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - sqlite3ParserARG_FETCH; - yymsp = &yypParser->yystack[yypParser->yyidx]; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno>=0 - && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ - fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, - yyRuleName[yyruleno]); - } -#endif /* NDEBUG */ - -#ifndef NDEBUG - /* Silence complaints from purify about yygotominor being uninitialized - ** in some cases when it is copied into the stack after the following - ** switch. yygotominor is uninitialized when a rule reduces that does - ** not set the value of its left-hand side nonterminal. Leaving the - ** value of the nonterminal uninitialized is utterly harmless as long - ** as the value is never used. So really the only thing this code - ** accomplishes is to quieten purify. - */ - memset(&yygotominor, 0, sizeof(yygotominor)); -#endif - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line <lineno> <grammarfile> - ** { ... } // User supplied code - ** #line <lineno> <thisfile> - ** break; - */ - case 3: -#line 102 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ sqlite3FinishCoding(pParse); } -#line 1930 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 6: -#line 105 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ sqlite3BeginParse(pParse, 0); } -#line 1935 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 7: -#line 107 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ sqlite3BeginParse(pParse, 1); } -#line 1940 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 8: -#line 108 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ sqlite3BeginParse(pParse, 2); } -#line 1945 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 9: -#line 114 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy280);} -#line 1950 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 13: -#line 119 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = TK_DEFERRED;} -#line 1955 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 14: - case 15: - case 16: - case 104: - case 106: - case 107: -#line 120 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = yymsp[0].major;} -#line 1965 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 17: - case 18: -#line 123 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3CommitTransaction(pParse);} -#line 1971 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 19: -#line 125 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3RollbackTransaction(pParse);} -#line 1976 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 21: -#line 130 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3StartTable(pParse,&yymsp[-4].minor.yy0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198,yymsp[-3].minor.yy280,0); -} -#line 1983 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 22: - case 63: - case 77: - case 109: - case 224: - case 227: -#line 135 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = 1;} -#line 1993 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 23: - case 62: - case 76: - case 78: - case 89: - case 110: - case 111: - case 223: - case 226: -#line 137 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = 0;} -#line 2006 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 24: -#line 138 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3EndTable(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy0,0); -} -#line 2013 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 25: -#line 141 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy375); - sqlite3SelectDelete(yymsp[0].minor.yy375); -} -#line 2021 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 28: -#line 153 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy198.z = yymsp[-2].minor.yy198.z; - yygotominor.yy198.n = (pParse->sLastToken.z-yymsp[-2].minor.yy198.z) + pParse->sLastToken.n; -} -#line 2029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 29: -#line 157 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3AddColumn(pParse,&yymsp[0].minor.yy198); - yygotominor.yy198 = yymsp[0].minor.yy198; -} -#line 2037 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 263: - case 264: -#line 167 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198 = yymsp[0].minor.yy0;} -#line 2049 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 37: -#line 227 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy198);} -#line 2054 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 38: - case 41: - case 117: - case 118: - case 129: - case 149: - case 251: - case 261: - case 262: -#line 228 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198 = yymsp[0].minor.yy198;} -#line 2067 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 39: -#line 229 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy198.z = yymsp[-3].minor.yy198.z; - yygotominor.yy198.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy198.z; -} -#line 2075 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 40: -#line 233 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy198.z = yymsp[-5].minor.yy198.z; - yygotominor.yy198.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy198.z; -} -#line 2083 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 42: -#line 239 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198.z=yymsp[-1].minor.yy198.z; yygotominor.yy198.n=yymsp[0].minor.yy198.n+(yymsp[0].minor.yy198.z-yymsp[-1].minor.yy198.z);} -#line 2088 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 43: -#line 241 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = atoi(yymsp[0].minor.yy198.z); } -#line 2093 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 44: -#line 242 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = -atoi(yymsp[0].minor.yy198.z); } -#line 2098 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 49: - case 51: -#line 251 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy62);} -#line 2104 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 50: -#line 252 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy62);} -#line 2109 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 52: -#line 254 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *p = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy62, 0, 0); - sqlite3AddDefaultValue(pParse,p); -} -#line 2117 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 53: -#line 258 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *p = sqlite3Expr(TK_STRING, 0, 0, &yymsp[0].minor.yy198); - sqlite3AddDefaultValue(pParse,p); -} -#line 2125 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 55: -#line 267 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddNotNull(pParse, yymsp[0].minor.yy280);} -#line 2130 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 56: -#line 269 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy280,yymsp[0].minor.yy280);} -#line 2135 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 57: -#line 270 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy280,0,0);} -#line 2140 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 58: -#line 271 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3ExprDelete(yymsp[-2].minor.yy62);} -#line 2145 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 59: -#line 273 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy198,yymsp[-1].minor.yy418,yymsp[0].minor.yy280);} -#line 2150 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 60: -#line 274 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy280);} -#line 2155 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 61: -#line 275 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddCollateType(pParse, yymsp[0].minor.yy198.z, yymsp[0].minor.yy198.n);} -#line 2160 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 64: -#line 288 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = OE_Restrict * 0x010101; } -#line 2165 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 65: -#line 289 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = (yymsp[-1].minor.yy280 & yymsp[0].minor.yy359.mask) | yymsp[0].minor.yy359.value; } -#line 2170 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 66: -#line 291 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy359.value = 0; yygotominor.yy359.mask = 0x000000; } -#line 2175 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 67: -#line 292 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy359.value = yymsp[0].minor.yy280; yygotominor.yy359.mask = 0x0000ff; } -#line 2180 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 68: -#line 293 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy359.value = yymsp[0].minor.yy280<<8; yygotominor.yy359.mask = 0x00ff00; } -#line 2185 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 69: -#line 294 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy359.value = yymsp[0].minor.yy280<<16; yygotominor.yy359.mask = 0xff0000; } -#line 2190 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 70: -#line 296 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = OE_SetNull; } -#line 2195 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 71: -#line 297 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = OE_SetDflt; } -#line 2200 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 72: -#line 298 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = OE_Cascade; } -#line 2205 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 73: -#line 299 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = OE_Restrict; } -#line 2210 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 74: - case 75: - case 90: - case 92: - case 94: - case 95: - case 166: -#line 301 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = yymsp[0].minor.yy280;} -#line 2221 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 79: -#line 311 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198.n = 0; yygotominor.yy198.z = 0;} -#line 2226 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 80: -#line 312 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198 = yymsp[-1].minor.yy0;} -#line 2231 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 85: -#line 318 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy418,yymsp[0].minor.yy280,yymsp[-2].minor.yy280);} -#line 2236 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 86: -#line 320 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy418,yymsp[0].minor.yy280,0,0);} -#line 2241 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 88: -#line 323 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy418, &yymsp[-3].minor.yy198, yymsp[-2].minor.yy418, yymsp[-1].minor.yy280); - sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy280); -} -#line 2249 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 91: - case 93: -#line 337 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Default;} -#line 2255 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 96: -#line 342 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Ignore;} -#line 2260 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 97: - case 167: -#line 343 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Replace;} -#line 2266 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 98: -#line 347 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3DropTable(pParse, yymsp[0].minor.yy151, 0); -} -#line 2273 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 99: -#line 354 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3CreateView(pParse, &yymsp[-6].minor.yy0, &yymsp[-3].minor.yy198, &yymsp[-2].minor.yy198, yymsp[0].minor.yy375, yymsp[-5].minor.yy280); -} -#line 2280 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 100: -#line 357 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3DropTable(pParse, yymsp[0].minor.yy151, 1); -} -#line 2287 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 101: -#line 364 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3Select(pParse, yymsp[0].minor.yy375, SRT_Callback, 0, 0, 0, 0, 0); - sqlite3SelectDelete(yymsp[0].minor.yy375); -} -#line 2295 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 102: - case 126: -#line 374 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy375 = yymsp[0].minor.yy375;} -#line 2301 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 103: -#line 376 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - if( yymsp[0].minor.yy375 ){ - yymsp[0].minor.yy375->op = yymsp[-1].minor.yy280; - yymsp[0].minor.yy375->pPrior = yymsp[-2].minor.yy375; - } - yygotominor.yy375 = yymsp[0].minor.yy375; -} -#line 2312 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 105: -#line 385 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = TK_ALL;} -#line 2317 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 108: -#line 390 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy375 = sqlite3SelectNew(yymsp[-6].minor.yy418,yymsp[-5].minor.yy151,yymsp[-4].minor.yy62,yymsp[-3].minor.yy418,yymsp[-2].minor.yy62,yymsp[-1].minor.yy418,yymsp[-7].minor.yy280,yymsp[0].minor.yy220.pLimit,yymsp[0].minor.yy220.pOffset); -} -#line 2324 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 112: - case 248: -#line 411 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = yymsp[-1].minor.yy418;} -#line 2330 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 113: - case 140: - case 150: - case 247: -#line 412 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = 0;} -#line 2338 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 114: -#line 413 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-2].minor.yy418,yymsp[-1].minor.yy62,yymsp[0].minor.yy198.n?&yymsp[0].minor.yy198:0); -} -#line 2345 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 115: -#line 416 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-1].minor.yy418, sqlite3Expr(TK_ALL, 0, 0, 0), 0); -} -#line 2352 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 116: -#line 419 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *pRight = sqlite3Expr(TK_ALL, 0, 0, 0); - Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198); - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-3].minor.yy418, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0); -} -#line 2361 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 119: -#line 431 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198.n = 0;} -#line 2366 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 120: -#line 443 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy151 = sqliteMalloc(sizeof(*yygotominor.yy151));} -#line 2371 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 121: -#line 444 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy151 = yymsp[0].minor.yy151;} -#line 2376 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 122: -#line 449 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy151 = yymsp[-1].minor.yy151; - if( yygotominor.yy151 && yygotominor.yy151->nSrc>0 ) yygotominor.yy151->a[yygotominor.yy151->nSrc-1].jointype = yymsp[0].minor.yy280; -} -#line 2384 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 123: -#line 453 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy151 = 0;} -#line 2389 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 124: -#line 454 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy151 = sqlite3SrcListAppend(yymsp[-5].minor.yy151,&yymsp[-4].minor.yy198,&yymsp[-3].minor.yy198); - if( yymsp[-2].minor.yy198.n ) sqlite3SrcListAddAlias(yygotominor.yy151,&yymsp[-2].minor.yy198); - if( yymsp[-1].minor.yy62 ){ - if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pOn = yymsp[-1].minor.yy62; } - else { sqlite3ExprDelete(yymsp[-1].minor.yy62); } - } - if( yymsp[0].minor.yy240 ){ - if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pUsing = yymsp[0].minor.yy240; } - else { sqlite3IdListDelete(yymsp[0].minor.yy240); } - } -} -#line 2405 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 125: -#line 468 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy151 = sqlite3SrcListAppend(yymsp[-6].minor.yy151,0,0); - yygotominor.yy151->a[yygotominor.yy151->nSrc-1].pSelect = yymsp[-4].minor.yy375; - if( yymsp[-2].minor.yy198.n ) sqlite3SrcListAddAlias(yygotominor.yy151,&yymsp[-2].minor.yy198); - if( yymsp[-1].minor.yy62 ){ - if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pOn = yymsp[-1].minor.yy62; } - else { sqlite3ExprDelete(yymsp[-1].minor.yy62); } - } - if( yymsp[0].minor.yy240 ){ - if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pUsing = yymsp[0].minor.yy240; } - else { sqlite3IdListDelete(yymsp[0].minor.yy240); } - } - } -#line 2422 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 127: -#line 489 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy375 = sqlite3SelectNew(0,yymsp[0].minor.yy151,0,0,0,0,0,0,0); - } -#line 2429 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 128: -#line 495 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198.z=0; yygotominor.yy198.n=0;} -#line 2434 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 130: -#line 500 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy151 = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198);} -#line 2439 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 131: - case 132: -#line 504 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = JT_INNER; } -#line 2445 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 133: -#line 506 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } -#line 2450 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 134: -#line 507 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy198,0); } -#line 2455 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 135: -#line 509 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy198,&yymsp[-1].minor.yy198); } -#line 2460 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 136: - case 144: - case 153: - case 160: - case 174: - case 211: - case 236: - case 238: - case 242: -#line 513 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = yymsp[0].minor.yy62;} -#line 2473 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 137: - case 152: - case 159: - case 212: - case 237: - case 239: - case 243: -#line 514 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = 0;} -#line 2484 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 138: - case 171: -#line 518 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy240 = yymsp[-1].minor.yy240;} -#line 2490 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 139: - case 170: -#line 519 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy240 = 0;} -#line 2496 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 141: - case 151: -#line 530 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = yymsp[0].minor.yy418;} -#line 2502 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 142: -#line 531 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418,yymsp[-2].minor.yy62,yymsp[-1].minor.yy198.n>0?&yymsp[-1].minor.yy198:0); - if( yygotominor.yy418 ) yygotominor.yy418->a[yygotominor.yy418->nExpr-1].sortOrder = yymsp[0].minor.yy280; -} -#line 2510 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 143: -#line 535 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[-2].minor.yy62,yymsp[-1].minor.yy198.n>0?&yymsp[-1].minor.yy198:0); - if( yygotominor.yy418 && yygotominor.yy418->a ) yygotominor.yy418->a[0].sortOrder = yymsp[0].minor.yy280; -} -#line 2518 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 145: - case 147: -#line 544 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = SQLITE_SO_ASC;} -#line 2524 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 146: -#line 545 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = SQLITE_SO_DESC;} -#line 2529 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 148: -#line 547 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy198.z = 0; yygotominor.yy198.n = 0;} -#line 2534 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 154: -#line 565 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy220.pLimit = 0; yygotominor.yy220.pOffset = 0;} -#line 2539 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 155: -#line 566 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy220.pLimit = yymsp[0].minor.yy62; yygotominor.yy220.pOffset = 0;} -#line 2544 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 156: -#line 568 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy220.pLimit = yymsp[-2].minor.yy62; yygotominor.yy220.pOffset = yymsp[0].minor.yy62;} -#line 2549 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 157: -#line 570 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy220.pOffset = yymsp[-2].minor.yy62; yygotominor.yy220.pLimit = yymsp[0].minor.yy62;} -#line 2554 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 158: -#line 574 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy151,yymsp[0].minor.yy62);} -#line 2559 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 161: -#line 585 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Update(pParse,yymsp[-3].minor.yy151,yymsp[-1].minor.yy418,yymsp[0].minor.yy62,yymsp[-4].minor.yy280);} -#line 2564 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 162: -#line 591 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);} -#line 2569 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 163: -#line 592 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);} -#line 2574 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 164: -#line 598 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Insert(pParse, yymsp[-5].minor.yy151, yymsp[-1].minor.yy418, 0, yymsp[-4].minor.yy240, yymsp[-7].minor.yy280);} -#line 2579 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 165: -#line 600 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Insert(pParse, yymsp[-2].minor.yy151, 0, yymsp[0].minor.yy375, yymsp[-1].minor.yy240, yymsp[-4].minor.yy280);} -#line 2584 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 168: - case 240: -#line 610 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-2].minor.yy418,yymsp[0].minor.yy62,0);} -#line 2590 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 169: - case 241: -#line 611 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,0);} -#line 2596 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 172: -#line 620 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy240 = sqlite3IdListAppend(yymsp[-2].minor.yy240,&yymsp[0].minor.yy198);} -#line 2601 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 173: -#line 621 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy240 = sqlite3IdListAppend(0,&yymsp[0].minor.yy198);} -#line 2606 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 175: -#line 632 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = yymsp[-1].minor.yy62; sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } -#line 2611 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 176: - case 181: - case 182: - case 183: - case 184: -#line 633 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = sqlite3Expr(yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);} -#line 2620 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 177: - case 178: -#line 634 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} -#line 2626 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 179: -#line 636 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198); - Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy198); - yygotominor.yy62 = sqlite3Expr(TK_DOT, temp1, temp2, 0); -} -#line 2635 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 180: -#line 641 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-4].minor.yy198); - Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198); - Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy198); - Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0); - yygotominor.yy62 = sqlite3Expr(TK_DOT, temp1, temp4, 0); -} -#line 2646 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 185: -#line 652 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);} -#line 2651 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 186: -#line 653 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Token *pToken = &yymsp[0].minor.yy0; - Expr *pExpr = yygotominor.yy62 = sqlite3Expr(TK_VARIABLE, 0, 0, pToken); - sqlite3ExprAssignVarNumber(pParse, pExpr); -} -#line 2660 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 187: -#line 659 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_CAST, yymsp[-3].minor.yy62, 0, &yymsp[-1].minor.yy198); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); -} -#line 2668 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 188: -#line 664 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3ExprFunction(yymsp[-1].minor.yy418, &yymsp[-4].minor.yy0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); - if( yymsp[-2].minor.yy280 ){ - yygotominor.yy62->flags |= EP_Distinct; - } -} -#line 2679 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 189: -#line 671 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3ExprFunction(0, &yymsp[-3].minor.yy0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); -} -#line 2687 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 190: -#line 675 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are - ** treated as functions that return constants */ - yygotominor.yy62 = sqlite3ExprFunction(0,&yymsp[0].minor.yy0); - if( yygotominor.yy62 ) yygotominor.yy62->op = TK_CONST_FUNC; -} -#line 2697 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 191: - case 192: - case 193: - case 194: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 201: - case 202: - case 203: - case 204: - case 205: - case 206: - case 207: - case 208: -#line 681 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy62 = sqlite3Expr(yymsp[-1].major, yymsp[-2].minor.yy62, yymsp[0].minor.yy62, 0);} -#line 2719 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 209: -#line 700 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 0;} -#line 2724 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 210: -#line 701 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 1;} -#line 2729 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 213: -#line 705 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - ExprList *pList = sqlite3ExprListAppend(0, yymsp[-1].minor.yy62, 0); - pList = sqlite3ExprListAppend(pList, yymsp[-3].minor.yy62, 0); - if( yymsp[0].minor.yy62 ){ - pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy62, 0); - } - yygotominor.yy62 = sqlite3ExprFunction(pList, &yymsp[-2].minor.yy222.operator); - if( yymsp[-2].minor.yy222.not ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62, &yymsp[-3].minor.yy62->span, &yymsp[-1].minor.yy62->span); -} -#line 2743 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 214: -#line 716 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_ISNULL, yymsp[-1].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy62->span,&yymsp[0].minor.yy0); -} -#line 2751 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 215: -#line 720 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_ISNULL, yymsp[-2].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy62->span,&yymsp[0].minor.yy0); -} -#line 2759 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 216: -#line 724 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-1].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy62->span,&yymsp[0].minor.yy0); -} -#line 2767 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 217: -#line 728 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-2].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy62->span,&yymsp[0].minor.yy0); -} -#line 2775 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 218: -#line 732 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-3].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy62->span,&yymsp[0].minor.yy0); -} -#line 2783 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 219: - case 220: -#line 736 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(yymsp[-1].major, yymsp[0].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span); -} -#line 2792 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 221: -#line 744 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span); -} -#line 2800 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 222: -#line 748 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_UPLUS, yymsp[0].minor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span); -} -#line 2808 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 225: -#line 755 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - ExprList *pList = sqlite3ExprListAppend(0, yymsp[-2].minor.yy62, 0); - pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy62, 0); - yygotominor.yy62 = sqlite3Expr(TK_BETWEEN, yymsp[-4].minor.yy62, 0, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pList = pList; - }else{ - sqlite3ExprListDelete(pList); - } - if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy62->span); -} -#line 2824 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 228: -#line 771 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy62, 0, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pList = yymsp[-1].minor.yy418; - }else{ - sqlite3ExprListDelete(yymsp[-1].minor.yy418); - } - if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy0); - } -#line 2838 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 229: -#line 781 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_SELECT, 0, 0, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pSelect = yymsp[-1].minor.yy375; - }else{ - sqlite3SelectDelete(yymsp[-1].minor.yy375); - } - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); - } -#line 2851 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 230: -#line 790 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy62, 0, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pSelect = yymsp[-1].minor.yy375; - }else{ - sqlite3SelectDelete(yymsp[-1].minor.yy375); - } - if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy0); - } -#line 2865 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 231: -#line 800 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - SrcList *pSrc = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198); - yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-3].minor.yy62, 0, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pSelect = sqlite3SelectNew(0,pSrc,0,0,0,0,0,0,0); - }else{ - sqlite3SrcListDelete(pSrc); - } - if( yymsp[-2].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0); - sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy62->span,yymsp[0].minor.yy198.z?&yymsp[0].minor.yy198:&yymsp[-1].minor.yy198); - } -#line 2880 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 232: -#line 811 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *p = yygotominor.yy62 = sqlite3Expr(TK_EXISTS, 0, 0, 0); - if( p ){ - p->pSelect = yymsp[-1].minor.yy375; - sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); - }else{ - sqlite3SelectDelete(yymsp[-1].minor.yy375); - } - } -#line 2893 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 233: -#line 823 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_CASE, yymsp[-3].minor.yy62, yymsp[-1].minor.yy62, 0); - if( yygotominor.yy62 ){ - yygotominor.yy62->pList = yymsp[-2].minor.yy418; - }else{ - sqlite3ExprListDelete(yymsp[-2].minor.yy418); - } - sqlite3ExprSpan(yygotominor.yy62, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); -} -#line 2906 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 234: -#line 834 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418, yymsp[-2].minor.yy62, 0); - yygotominor.yy418 = sqlite3ExprListAppend(yygotominor.yy418, yymsp[0].minor.yy62, 0); -} -#line 2914 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 235: -#line 838 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy418 = sqlite3ExprListAppend(0, yymsp[-2].minor.yy62, 0); - yygotominor.yy418 = sqlite3ExprListAppend(yygotominor.yy418, yymsp[0].minor.yy62, 0); -} -#line 2922 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 244: -#line 863 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - if( yymsp[-9].minor.yy280!=OE_None ) yymsp[-9].minor.yy280 = yymsp[0].minor.yy280; - if( yymsp[-9].minor.yy280==OE_Default) yymsp[-9].minor.yy280 = OE_Abort; - sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy198, &yymsp[-6].minor.yy198, sqlite3SrcListAppend(0,&yymsp[-4].minor.yy198,0),yymsp[-2].minor.yy418,yymsp[-9].minor.yy280, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0); -} -#line 2931 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 245: - case 292: -#line 870 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Abort;} -#line 2937 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 246: -#line 871 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_None;} -#line 2942 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 249: -#line 881 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *p = 0; - if( yymsp[-1].minor.yy198.n>0 ){ - p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, yymsp[-1].minor.yy198.z, yymsp[-1].minor.yy198.n); - } - yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418, p, &yymsp[-2].minor.yy198); -} -#line 2954 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 250: -#line 889 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Expr *p = 0; - if( yymsp[-1].minor.yy198.n>0 ){ - p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, yymsp[-1].minor.yy198.z, yymsp[-1].minor.yy198.n); - } - yygotominor.yy418 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy198); -} -#line 2966 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 252: -#line 902 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3DropIndex(pParse, yymsp[0].minor.yy151);} -#line 2971 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 253: - case 254: -#line 906 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Vacuum(pParse,0);} -#line 2977 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 255: - case 257: -#line 912 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,0);} -#line 2983 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 256: -#line 913 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy0,0);} -#line 2988 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 258: -#line 915 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,1); -} -#line 2995 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 259: -#line 918 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Pragma(pParse,&yymsp[-4].minor.yy198,&yymsp[-3].minor.yy198,&yymsp[-1].minor.yy198,0);} -#line 3000 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 260: -#line 919 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Pragma(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198,0,0);} -#line 3005 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 267: -#line 932 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - Token all; - all.z = yymsp[-3].minor.yy198.z; - all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy198.z) + yymsp[0].minor.yy0.n; - sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy360, &all); -} -#line 3015 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 268: -#line 941 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy198, &yymsp[-6].minor.yy198, yymsp[-5].minor.yy280, yymsp[-4].minor.yy30.a, yymsp[-4].minor.yy30.b, yymsp[-2].minor.yy151, yymsp[-1].minor.yy280, yymsp[0].minor.yy62, yymsp[-9].minor.yy280); - yygotominor.yy198 = (yymsp[-6].minor.yy198.n==0?yymsp[-7].minor.yy198:yymsp[-6].minor.yy198); -} -#line 3023 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 269: - case 272: -#line 947 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = TK_BEFORE; } -#line 3029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 270: -#line 948 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = TK_AFTER; } -#line 3034 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 271: -#line 949 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = TK_INSTEAD;} -#line 3039 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 273: - case 274: - case 275: -#line 954 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy30.a = yymsp[0].major; yygotominor.yy30.b = 0;} -#line 3046 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 276: -#line 957 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy30.a = TK_UPDATE; yygotominor.yy30.b = yymsp[0].minor.yy240;} -#line 3051 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 277: - case 278: -#line 960 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = TK_ROW; } -#line 3057 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 279: -#line 962 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy280 = TK_STATEMENT; } -#line 3062 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 280: -#line 965 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy62 = 0; } -#line 3067 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 281: -#line 966 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy62 = yymsp[0].minor.yy62; } -#line 3072 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 282: -#line 970 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yymsp[-2].minor.yy360->pNext = yymsp[0].minor.yy360; - yygotominor.yy360 = yymsp[-2].minor.yy360; -} -#line 3080 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 283: -#line 974 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy360 = 0; } -#line 3085 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 284: -#line 980 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy360 = sqlite3TriggerUpdateStep(&yymsp[-3].minor.yy198, yymsp[-1].minor.yy418, yymsp[0].minor.yy62, yymsp[-4].minor.yy280); } -#line 3090 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 285: -#line 985 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy360 = sqlite3TriggerInsertStep(&yymsp[-5].minor.yy198, yymsp[-4].minor.yy240, yymsp[-1].minor.yy418, 0, yymsp[-7].minor.yy280);} -#line 3095 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 286: -#line 988 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy360 = sqlite3TriggerInsertStep(&yymsp[-2].minor.yy198, yymsp[-1].minor.yy240, 0, yymsp[0].minor.yy375, yymsp[-4].minor.yy280);} -#line 3100 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 287: -#line 992 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy360 = sqlite3TriggerDeleteStep(&yymsp[-1].minor.yy198, yymsp[0].minor.yy62);} -#line 3105 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 288: -#line 995 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy360 = sqlite3TriggerSelectStep(yymsp[0].minor.yy375); } -#line 3110 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 289: -#line 998 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_RAISE, 0, 0, 0); - yygotominor.yy62->iColumn = OE_Ignore; - sqlite3ExprSpan(yygotominor.yy62, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3119 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 290: -#line 1003 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - yygotominor.yy62 = sqlite3Expr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy198); - yygotominor.yy62->iColumn = yymsp[-3].minor.yy280; - sqlite3ExprSpan(yygotominor.yy62, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3128 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 291: -#line 1011 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Rollback;} -#line 3133 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 293: -#line 1013 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{yygotominor.yy280 = OE_Fail;} -#line 3138 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 294: -#line 1018 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3DropTrigger(pParse,yymsp[0].minor.yy151); -} -#line 3145 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 295: -#line 1024 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3Attach(pParse, &yymsp[-3].minor.yy198, &yymsp[-1].minor.yy198, yymsp[0].minor.yy361.type, &yymsp[0].minor.yy361.key); -} -#line 3152 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 296: -#line 1028 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy361.type = 0; } -#line 3157 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 297: -#line 1029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy361.type=1; yygotominor.yy361.key = yymsp[0].minor.yy198; } -#line 3162 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 298: -#line 1030 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ yygotominor.yy361.type=2; yygotominor.yy361.key = yymsp[0].minor.yy0; } -#line 3167 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 301: -#line 1036 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3Detach(pParse, &yymsp[0].minor.yy198); -} -#line 3174 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 302: -#line 1042 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Reindex(pParse, 0, 0);} -#line 3179 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 303: -#line 1043 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Reindex(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);} -#line 3184 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 304: -#line 1048 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Analyze(pParse, 0, 0);} -#line 3189 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 305: -#line 1049 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{sqlite3Analyze(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);} -#line 3194 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 306: -#line 1054 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy151,&yymsp[0].minor.yy198); -} -#line 3201 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 307: -#line 1057 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy198); -} -#line 3208 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - case 308: -#line 1060 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" -{ - sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy151); -} -#line 3215 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - break; - }; - yygoto = yyRuleInfo[yyruleno].lhs; - yysize = yyRuleInfo[yyruleno].nrhs; - yypParser->yyidx -= yysize; - yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); - if( yyact < YYNSTATE ){ -#ifdef NDEBUG - /* If we are not debugging and the reduce action popped at least - ** one element off the stack, then we can push the new element back - ** onto the stack here, and skip the stack overflow test in yy_shift(). - ** That gives a significant speed improvement. */ - if( yysize ){ - yypParser->yyidx++; - yymsp -= yysize-1; - yymsp->stateno = yyact; - yymsp->major = yygoto; - yymsp->minor = yygotominor; - }else -#endif - { - yy_shift(yypParser,yyact,yygoto,&yygotominor); - } - }else if( yyact == YYNSTATE + YYNRULE + 1 ){ - yy_accept(yypParser); - } -} - -/* -** The following code executes when the parse fails -*/ -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - sqlite3ParserARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ - sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - YYMINORTYPE yyminor /* The minor type of the error token */ -){ - sqlite3ParserARG_FETCH; -#define TOKEN (yyminor.yy0) -#line 34 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y" - - if( pParse->zErrMsg==0 ){ - if( TOKEN.z[0] ){ - sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); - }else{ - sqlite3ErrorMsg(pParse, "incomplete SQL statement"); - } - } -#line 3282 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c" - sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - sqlite3ParserARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ - sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "sqlite3ParserAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -** <ul> -** <li> A pointer to the parser (an opaque structure.) -** <li> The major token number. -** <li> The minor token number. -** <li> An option argument of a grammar-specified type. -** </ul> -** -** Outputs: -** None. -*/ -void sqlite3Parser( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - sqlite3ParserTOKENTYPE yyminor /* The value for the token */ - sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - int yyact; /* The parser action. */ - int yyendofinput; /* True if we are at the end of input */ - int yyerrorhit = 0; /* True if yymajor has invoked an error */ - yyParser *yypParser; /* The parser */ - - /* (re)initialize the parser, if necessary */ - yypParser = (yyParser*)yyp; - if( yypParser->yyidx<0 ){ - /* if( yymajor==0 ) return; // not sure why this was here... */ - yypParser->yyidx = 0; - yypParser->yyerrcnt = -1; - yypParser->yystack[0].stateno = 0; - yypParser->yystack[0].major = 0; - } - yyminorunion.yy0 = yyminor; - yyendofinput = (yymajor==0); - sqlite3ParserARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,yymajor); - if( yyact<YYNSTATE ){ - yy_shift(yypParser,yyact,yymajor,&yyminorunion); - yypParser->yyerrcnt--; - if( yyendofinput && yypParser->yyidx>=0 ){ - yymajor = 0; - }else{ - yymajor = YYNOCODE; - } - }else if( yyact < YYNSTATE + YYNRULE ){ - yy_reduce(yypParser,yyact-YYNSTATE); - }else if( yyact == YY_ERROR_ACTION ){ - int yymx; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yymx = yypParser->yystack[yypParser->yyidx].major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yymajor,&yyminorunion); - yymajor = YYNOCODE; - }else{ - while( - yypParser->yyidx >= 0 && - yymx != YYERRORSYMBOL && - (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yyidx < 0 || yymajor==0 ){ - yy_destructor(yymajor,&yyminorunion); - yy_parse_failed(yypParser); - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - YYMINORTYPE u2; - u2.YYERRSYMDT = 0; - yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yypParser->yyerrcnt = 3; - yy_destructor(yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); - } - yymajor = YYNOCODE; -#endif - }else{ - yy_accept(yypParser); - yymajor = YYNOCODE; - } - }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); - return; -} diff --git a/ext/pdo_sqlite/sqlite/src/parse.h b/ext/pdo_sqlite/sqlite/src/parse.h deleted file mode 100644 index fcedda58962a4..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/parse.h +++ /dev/null @@ -1,145 +0,0 @@ -#define TK_END_OF_FILE 1 -#define TK_ILLEGAL 2 -#define TK_SPACE 3 -#define TK_UNCLOSED_STRING 4 -#define TK_COMMENT 5 -#define TK_FUNCTION 6 -#define TK_COLUMN 7 -#define TK_AGG_FUNCTION 8 -#define TK_AGG_COLUMN 9 -#define TK_CONST_FUNC 10 -#define TK_SEMI 11 -#define TK_EXPLAIN 12 -#define TK_QUERY 13 -#define TK_PLAN 14 -#define TK_BEGIN 15 -#define TK_TRANSACTION 16 -#define TK_DEFERRED 17 -#define TK_IMMEDIATE 18 -#define TK_EXCLUSIVE 19 -#define TK_COMMIT 20 -#define TK_END 21 -#define TK_ROLLBACK 22 -#define TK_CREATE 23 -#define TK_TABLE 24 -#define TK_TEMP 25 -#define TK_LP 26 -#define TK_RP 27 -#define TK_AS 28 -#define TK_COMMA 29 -#define TK_ID 30 -#define TK_ABORT 31 -#define TK_AFTER 32 -#define TK_ANALYZE 33 -#define TK_ASC 34 -#define TK_ATTACH 35 -#define TK_BEFORE 36 -#define TK_CASCADE 37 -#define TK_CAST 38 -#define TK_CONFLICT 39 -#define TK_DATABASE 40 -#define TK_DESC 41 -#define TK_DETACH 42 -#define TK_EACH 43 -#define TK_FAIL 44 -#define TK_FOR 45 -#define TK_IGNORE 46 -#define TK_INITIALLY 47 -#define TK_INSTEAD 48 -#define TK_LIKE_KW 49 -#define TK_MATCH 50 -#define TK_KEY 51 -#define TK_OF 52 -#define TK_OFFSET 53 -#define TK_PRAGMA 54 -#define TK_RAISE 55 -#define TK_REPLACE 56 -#define TK_RESTRICT 57 -#define TK_ROW 58 -#define TK_STATEMENT 59 -#define TK_TRIGGER 60 -#define TK_VACUUM 61 -#define TK_VIEW 62 -#define TK_REINDEX 63 -#define TK_RENAME 64 -#define TK_CTIME_KW 65 -#define TK_ALTER 66 -#define TK_OR 67 -#define TK_AND 68 -#define TK_NOT 69 -#define TK_IS 70 -#define TK_BETWEEN 71 -#define TK_IN 72 -#define TK_ISNULL 73 -#define TK_NOTNULL 74 -#define TK_NE 75 -#define TK_EQ 76 -#define TK_GT 77 -#define TK_LE 78 -#define TK_LT 79 -#define TK_GE 80 -#define TK_ESCAPE 81 -#define TK_BITAND 82 -#define TK_BITOR 83 -#define TK_LSHIFT 84 -#define TK_RSHIFT 85 -#define TK_PLUS 86 -#define TK_MINUS 87 -#define TK_STAR 88 -#define TK_SLASH 89 -#define TK_REM 90 -#define TK_CONCAT 91 -#define TK_UMINUS 92 -#define TK_UPLUS 93 -#define TK_BITNOT 94 -#define TK_STRING 95 -#define TK_JOIN_KW 96 -#define TK_CONSTRAINT 97 -#define TK_DEFAULT 98 -#define TK_NULL 99 -#define TK_PRIMARY 100 -#define TK_UNIQUE 101 -#define TK_CHECK 102 -#define TK_REFERENCES 103 -#define TK_COLLATE 104 -#define TK_AUTOINCR 105 -#define TK_ON 106 -#define TK_DELETE 107 -#define TK_UPDATE 108 -#define TK_INSERT 109 -#define TK_SET 110 -#define TK_DEFERRABLE 111 -#define TK_FOREIGN 112 -#define TK_DROP 113 -#define TK_UNION 114 -#define TK_ALL 115 -#define TK_INTERSECT 116 -#define TK_EXCEPT 117 -#define TK_SELECT 118 -#define TK_DISTINCT 119 -#define TK_DOT 120 -#define TK_FROM 121 -#define TK_JOIN 122 -#define TK_USING 123 -#define TK_ORDER 124 -#define TK_BY 125 -#define TK_GROUP 126 -#define TK_HAVING 127 -#define TK_LIMIT 128 -#define TK_WHERE 129 -#define TK_INTO 130 -#define TK_VALUES 131 -#define TK_INTEGER 132 -#define TK_FLOAT 133 -#define TK_BLOB 134 -#define TK_REGISTER 135 -#define TK_VARIABLE 136 -#define TK_EXISTS 137 -#define TK_CASE 138 -#define TK_WHEN 139 -#define TK_THEN 140 -#define TK_ELSE 141 -#define TK_INDEX 142 -#define TK_TO 143 -#define TK_ADD 144 -#define TK_COLUMNKW 145 diff --git a/ext/pdo_sqlite/sqlite/src/parse.y b/ext/pdo_sqlite/sqlite/src/parse.y deleted file mode 100644 index 1f16c20a8cfc2..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/parse.y +++ /dev/null @@ -1,1065 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains SQLite's grammar for SQL. Process this file -** using the lemon parser generator to generate C code that runs -** the parser. Lemon will also generate a header file containing -** numeric codes for all of the tokens. -** -** @(#) $Id$ -*/ - -// All token codes are small integers with #defines that begin with "TK_" -%token_prefix TK_ - -// The type of the data attached to each token is Token. This is also the -// default type for non-terminals. -// -%token_type {Token} -%default_type {Token} - -// The generated parser function takes a 4th argument as follows: -%extra_argument {Parse *pParse} - -// This code runs whenever there is a syntax error -// -%syntax_error { - if( pParse->zErrMsg==0 ){ - if( TOKEN.z[0] ){ - sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); - }else{ - sqlite3ErrorMsg(pParse, "incomplete SQL statement"); - } - } -} - -// The name of the generated procedure that implements the parser -// is as follows: -%name sqlite3Parser - -// The following text is included near the beginning of the C source -// code file that implements the parser. -// -%include { -#include "sqliteInt.h" -#include "parse.h" - -/* -** An instance of this structure holds information about the -** LIMIT clause of a SELECT statement. -*/ -struct LimitVal { - Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ - Expr *pOffset; /* The OFFSET expression. NULL if there is none */ -}; - -/* -** An instance of this structure is used to store the LIKE, -** GLOB, NOT LIKE, and NOT GLOB operators. -*/ -struct LikeOp { - Token operator; /* "like" or "glob" or "regexp" */ - int not; /* True if the NOT keyword is present */ -}; - -/* -** An instance of the following structure describes the event of a -** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, -** TK_DELETE, or TK_INSTEAD. If the event is of the form -** -** UPDATE ON (a,b,c) -** -** Then the "b" IdList records the list "a,b,c". -*/ -struct TrigEvent { int a; IdList * b; }; - -/* -** An instance of this structure holds the ATTACH key and the key type. -*/ -struct AttachKey { int type; Token key; }; - -} // end %include - -// These are extra tokens used by the lexer but never seen by the -// parser. We put them in a rule so that the parser generator will -// add them to the parse.h output file. -// -%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION - COLUMN AGG_FUNCTION AGG_COLUMN CONST_FUNC. - -// Input is a single SQL command -input ::= cmdlist. -cmdlist ::= cmdlist ecmd. -cmdlist ::= ecmd. -cmdx ::= cmd. { sqlite3FinishCoding(pParse); } -ecmd ::= SEMI. -ecmd ::= explain cmdx SEMI. -explain ::= . { sqlite3BeginParse(pParse, 0); } -%ifndef SQLITE_OMIT_EXPLAIN -explain ::= EXPLAIN. { sqlite3BeginParse(pParse, 1); } -explain ::= EXPLAIN QUERY PLAN. { sqlite3BeginParse(pParse, 2); } -%endif - -///////////////////// Begin and end transactions. //////////////////////////// -// - -cmd ::= BEGIN transtype(Y) trans_opt. {sqlite3BeginTransaction(pParse, Y);} -trans_opt ::= . -trans_opt ::= TRANSACTION. -trans_opt ::= TRANSACTION nm. -%type transtype {int} -transtype(A) ::= . {A = TK_DEFERRED;} -transtype(A) ::= DEFERRED(X). {A = @X;} -transtype(A) ::= IMMEDIATE(X). {A = @X;} -transtype(A) ::= EXCLUSIVE(X). {A = @X;} -cmd ::= COMMIT trans_opt. {sqlite3CommitTransaction(pParse);} -cmd ::= END trans_opt. {sqlite3CommitTransaction(pParse);} -cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);} - -///////////////////// The CREATE TABLE statement //////////////////////////// -// -cmd ::= create_table create_table_args. -create_table ::= CREATE(X) temp(T) TABLE nm(Y) dbnm(Z). { - sqlite3StartTable(pParse,&X,&Y,&Z,T,0); -} -%type temp {int} -%ifndef SQLITE_OMIT_TEMPDB -temp(A) ::= TEMP. {A = 1;} -%endif -temp(A) ::= . {A = 0;} -create_table_args ::= LP columnlist conslist_opt(X) RP(Y). { - sqlite3EndTable(pParse,&X,&Y,0); -} -create_table_args ::= AS select(S). { - sqlite3EndTable(pParse,0,0,S); - sqlite3SelectDelete(S); -} -columnlist ::= columnlist COMMA column. -columnlist ::= column. - -// A "column" is a complete description of a single column in a -// CREATE TABLE statement. This includes the column name, its -// datatype, and other keywords such as PRIMARY KEY, UNIQUE, REFERENCES, -// NOT NULL and so forth. -// -column(A) ::= columnid(X) type carglist. { - A.z = X.z; - A.n = (pParse->sLastToken.z-X.z) + pParse->sLastToken.n; -} -columnid(A) ::= nm(X). { - sqlite3AddColumn(pParse,&X); - A = X; -} - - -// An IDENTIFIER can be a generic identifier, or one of several -// keywords. Any non-standard keyword can also be an identifier. -// -%type id {Token} -id(A) ::= ID(X). {A = X;} - -// The following directive causes tokens ABORT, AFTER, ASC, etc. to -// fallback to ID if they will not parse as their original value. -// This obviates the need for the "id" nonterminal. -// -%fallback ID - ABORT AFTER ANALYZE ASC ATTACH BEFORE BEGIN CASCADE CAST CONFLICT - DATABASE DEFERRED DESC DETACH EACH END EXCLUSIVE EXPLAIN FAIL FOR - IGNORE IMMEDIATE INITIALLY INSTEAD LIKE_KW MATCH PLAN QUERY KEY - OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT - TEMP TRIGGER VACUUM VIEW -%ifdef SQLITE_OMIT_COMPOUND_SELECT - EXCEPT INTERSECT UNION -%endif - REINDEX RENAME CTIME_KW ALTER - . - -// Define operator precedence early so that this is the first occurance -// of the operator tokens in the grammer. Keeping the operators together -// causes them to be assigned integer values that are close together, -// which keeps parser tables smaller. -// -// The token values assigned to these symbols is determined by the order -// in which lemon first sees them. It must be the case that ISNULL/NOTNULL, -// NE/EQ, GT/LE, and GE/LT are separated by only a single value. See -// the sqlite3ExprIfFalse() routine for additional information on this -// constraint. -// -%left OR. -%left AND. -%right NOT. -%left IS LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ. -%left GT LE LT GE. -%right ESCAPE. -%left BITAND BITOR LSHIFT RSHIFT. -%left PLUS MINUS. -%left STAR SLASH REM. -%left CONCAT. -%right UMINUS UPLUS BITNOT. - -// And "ids" is an identifer-or-string. -// -%type ids {Token} -ids(A) ::= ID(X). {A = X;} -ids(A) ::= STRING(X). {A = X;} - -// The name of a column or table can be any of the following: -// -%type nm {Token} -nm(A) ::= ID(X). {A = X;} -nm(A) ::= STRING(X). {A = X;} -nm(A) ::= JOIN_KW(X). {A = X;} - -// A typetoken is really one or more tokens that form a type name such -// as can be found after the column name in a CREATE TABLE statement. -// Multiple tokens are concatenated to form the value of the typetoken. -// -%type typetoken {Token} -type ::= . -type ::= typetoken(X). {sqlite3AddColumnType(pParse,&X);} -typetoken(A) ::= typename(X). {A = X;} -typetoken(A) ::= typename(X) LP signed RP(Y). { - A.z = X.z; - A.n = &Y.z[Y.n] - X.z; -} -typetoken(A) ::= typename(X) LP signed COMMA signed RP(Y). { - A.z = X.z; - A.n = &Y.z[Y.n] - X.z; -} -%type typename {Token} -typename(A) ::= ids(X). {A = X;} -typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=Y.n+(Y.z-X.z);} -%type signed {int} -signed(A) ::= plus_num(X). { A = atoi(X.z); } -signed(A) ::= minus_num(X). { A = -atoi(X.z); } - -// "carglist" is a list of additional constraints that come after the -// column name and column type in a CREATE TABLE statement. -// -carglist ::= carglist carg. -carglist ::= . -carg ::= CONSTRAINT nm ccons. -carg ::= ccons. -carg ::= DEFAULT term(X). {sqlite3AddDefaultValue(pParse,X);} -carg ::= DEFAULT LP expr(X) RP. {sqlite3AddDefaultValue(pParse,X);} -carg ::= DEFAULT PLUS term(X). {sqlite3AddDefaultValue(pParse,X);} -carg ::= DEFAULT MINUS term(X). { - Expr *p = sqlite3Expr(TK_UMINUS, X, 0, 0); - sqlite3AddDefaultValue(pParse,p); -} -carg ::= DEFAULT id(X). { - Expr *p = sqlite3Expr(TK_STRING, 0, 0, &X); - sqlite3AddDefaultValue(pParse,p); -} - -// In addition to the type name, we also care about the primary key and -// UNIQUE constraints. -// -ccons ::= NULL onconf. -ccons ::= NOT NULL onconf(R). {sqlite3AddNotNull(pParse, R);} -ccons ::= PRIMARY KEY sortorder onconf(R) autoinc(I). - {sqlite3AddPrimaryKey(pParse,0,R,I);} -ccons ::= UNIQUE onconf(R). {sqlite3CreateIndex(pParse,0,0,0,0,R,0,0);} -ccons ::= CHECK LP expr(X) RP onconf. {sqlite3ExprDelete(X);} -ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R). - {sqlite3CreateForeignKey(pParse,0,&T,TA,R);} -ccons ::= defer_subclause(D). {sqlite3DeferForeignKey(pParse,D);} -ccons ::= COLLATE id(C). {sqlite3AddCollateType(pParse, C.z, C.n);} - -// The optional AUTOINCREMENT keyword -%type autoinc {int} -autoinc(X) ::= . {X = 0;} -autoinc(X) ::= AUTOINCR. {X = 1;} - -// The next group of rules parses the arguments to a REFERENCES clause -// that determine if the referential integrity checking is deferred or -// or immediate and which determine what action to take if a ref-integ -// check fails. -// -%type refargs {int} -refargs(A) ::= . { A = OE_Restrict * 0x010101; } -refargs(A) ::= refargs(X) refarg(Y). { A = (X & Y.mask) | Y.value; } -%type refarg {struct {int value; int mask;}} -refarg(A) ::= MATCH nm. { A.value = 0; A.mask = 0x000000; } -refarg(A) ::= ON DELETE refact(X). { A.value = X; A.mask = 0x0000ff; } -refarg(A) ::= ON UPDATE refact(X). { A.value = X<<8; A.mask = 0x00ff00; } -refarg(A) ::= ON INSERT refact(X). { A.value = X<<16; A.mask = 0xff0000; } -%type refact {int} -refact(A) ::= SET NULL. { A = OE_SetNull; } -refact(A) ::= SET DEFAULT. { A = OE_SetDflt; } -refact(A) ::= CASCADE. { A = OE_Cascade; } -refact(A) ::= RESTRICT. { A = OE_Restrict; } -%type defer_subclause {int} -defer_subclause(A) ::= NOT DEFERRABLE init_deferred_pred_opt(X). {A = X;} -defer_subclause(A) ::= DEFERRABLE init_deferred_pred_opt(X). {A = X;} -%type init_deferred_pred_opt {int} -init_deferred_pred_opt(A) ::= . {A = 0;} -init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;} -init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;} - -// For the time being, the only constraint we care about is the primary -// key and UNIQUE. Both create indices. -// -conslist_opt(A) ::= . {A.n = 0; A.z = 0;} -conslist_opt(A) ::= COMMA(X) conslist. {A = X;} -conslist ::= conslist COMMA tcons. -conslist ::= conslist tcons. -conslist ::= tcons. -tcons ::= CONSTRAINT nm. -tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R). - {sqlite3AddPrimaryKey(pParse,X,R,I);} -tcons ::= UNIQUE LP idxlist(X) RP onconf(R). - {sqlite3CreateIndex(pParse,0,0,0,X,R,0,0);} -tcons ::= CHECK expr onconf. -tcons ::= FOREIGN KEY LP idxlist(FA) RP - REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). { - sqlite3CreateForeignKey(pParse, FA, &T, TA, R); - sqlite3DeferForeignKey(pParse, D); -} -%type defer_subclause_opt {int} -defer_subclause_opt(A) ::= . {A = 0;} -defer_subclause_opt(A) ::= defer_subclause(X). {A = X;} - -// The following is a non-standard extension that allows us to declare the -// default behavior when there is a constraint conflict. -// -%type onconf {int} -%type orconf {int} -%type resolvetype {int} -onconf(A) ::= . {A = OE_Default;} -onconf(A) ::= ON CONFLICT resolvetype(X). {A = X;} -orconf(A) ::= . {A = OE_Default;} -orconf(A) ::= OR resolvetype(X). {A = X;} -resolvetype(A) ::= raisetype(X). {A = X;} -resolvetype(A) ::= IGNORE. {A = OE_Ignore;} -resolvetype(A) ::= REPLACE. {A = OE_Replace;} - -////////////////////////// The DROP TABLE ///////////////////////////////////// -// -cmd ::= DROP TABLE fullname(X). { - sqlite3DropTable(pParse, X, 0); -} - -///////////////////// The CREATE VIEW statement ///////////////////////////// -// -%ifndef SQLITE_OMIT_VIEW -cmd ::= CREATE(X) temp(T) VIEW nm(Y) dbnm(Z) AS select(S). { - sqlite3CreateView(pParse, &X, &Y, &Z, S, T); -} -cmd ::= DROP VIEW fullname(X). { - sqlite3DropTable(pParse, X, 1); -} -%endif // SQLITE_OMIT_VIEW - -//////////////////////// The SELECT statement ///////////////////////////////// -// -cmd ::= select(X). { - sqlite3Select(pParse, X, SRT_Callback, 0, 0, 0, 0, 0); - sqlite3SelectDelete(X); -} - -%type select {Select*} -%destructor select {sqlite3SelectDelete($$);} -%type oneselect {Select*} -%destructor oneselect {sqlite3SelectDelete($$);} - -select(A) ::= oneselect(X). {A = X;} -%ifndef SQLITE_OMIT_COMPOUND_SELECT -select(A) ::= select(X) multiselect_op(Y) oneselect(Z). { - if( Z ){ - Z->op = Y; - Z->pPrior = X; - } - A = Z; -} -%type multiselect_op {int} -multiselect_op(A) ::= UNION(OP). {A = @OP;} -multiselect_op(A) ::= UNION ALL. {A = TK_ALL;} -multiselect_op(A) ::= INTERSECT(OP). {A = @OP;} -multiselect_op(A) ::= EXCEPT(OP). {A = @OP;} -%endif // SQLITE_OMIT_COMPOUND_SELECT -oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y) - groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). { - A = sqlite3SelectNew(W,X,Y,P,Q,Z,D,L.pLimit,L.pOffset); -} - -// The "distinct" nonterminal is true (1) if the DISTINCT keyword is -// present and false (0) if it is not. -// -%type distinct {int} -distinct(A) ::= DISTINCT. {A = 1;} -distinct(A) ::= ALL. {A = 0;} -distinct(A) ::= . {A = 0;} - -// selcollist is a list of expressions that are to become the return -// values of the SELECT statement. The "*" in statements like -// "SELECT * FROM ..." is encoded as a special expression with an -// opcode of TK_ALL. -// -%type selcollist {ExprList*} -%destructor selcollist {sqlite3ExprListDelete($$);} -%type sclp {ExprList*} -%destructor sclp {sqlite3ExprListDelete($$);} -sclp(A) ::= selcollist(X) COMMA. {A = X;} -sclp(A) ::= . {A = 0;} -selcollist(A) ::= sclp(P) expr(X) as(Y). { - A = sqlite3ExprListAppend(P,X,Y.n?&Y:0); -} -selcollist(A) ::= sclp(P) STAR. { - A = sqlite3ExprListAppend(P, sqlite3Expr(TK_ALL, 0, 0, 0), 0); -} -selcollist(A) ::= sclp(P) nm(X) DOT STAR. { - Expr *pRight = sqlite3Expr(TK_ALL, 0, 0, 0); - Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, &X); - A = sqlite3ExprListAppend(P, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0); -} - -// An option "AS <id>" phrase that can follow one of the expressions that -// define the result set, or one of the tables in the FROM clause. -// -%type as {Token} -as(X) ::= AS nm(Y). {X = Y;} -as(X) ::= ids(Y). {X = Y;} -as(X) ::= . {X.n = 0;} - - -%type seltablist {SrcList*} -%destructor seltablist {sqlite3SrcListDelete($$);} -%type stl_prefix {SrcList*} -%destructor stl_prefix {sqlite3SrcListDelete($$);} -%type from {SrcList*} -%destructor from {sqlite3SrcListDelete($$);} - -// A complete FROM clause. -// -from(A) ::= . {A = sqliteMalloc(sizeof(*A));} -from(A) ::= FROM seltablist(X). {A = X;} - -// "seltablist" is a "Select Table List" - the content of the FROM clause -// in a SELECT statement. "stl_prefix" is a prefix of this list. -// -stl_prefix(A) ::= seltablist(X) joinop(Y). { - A = X; - if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = Y; -} -stl_prefix(A) ::= . {A = 0;} -seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). { - A = sqlite3SrcListAppend(X,&Y,&D); - if( Z.n ) sqlite3SrcListAddAlias(A,&Z); - if( N ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } - else { sqlite3ExprDelete(N); } - } - if( U ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } - else { sqlite3IdListDelete(U); } - } -} -%ifndef SQLITE_OMIT_SUBQUERY - seltablist(A) ::= stl_prefix(X) LP seltablist_paren(S) RP - as(Z) on_opt(N) using_opt(U). { - A = sqlite3SrcListAppend(X,0,0); - A->a[A->nSrc-1].pSelect = S; - if( Z.n ) sqlite3SrcListAddAlias(A,&Z); - if( N ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } - else { sqlite3ExprDelete(N); } - } - if( U ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } - else { sqlite3IdListDelete(U); } - } - } - - // A seltablist_paren nonterminal represents anything in a FROM that - // is contained inside parentheses. This can be either a subquery or - // a grouping of table and subqueries. - // - %type seltablist_paren {Select*} - %destructor seltablist_paren {sqlite3SelectDelete($$);} - seltablist_paren(A) ::= select(S). {A = S;} - seltablist_paren(A) ::= seltablist(F). { - A = sqlite3SelectNew(0,F,0,0,0,0,0,0,0); - } -%endif // SQLITE_OMIT_SUBQUERY - -%type dbnm {Token} -dbnm(A) ::= . {A.z=0; A.n=0;} -dbnm(A) ::= DOT nm(X). {A = X;} - -%type fullname {SrcList*} -%destructor fullname {sqlite3SrcListDelete($$);} -fullname(A) ::= nm(X) dbnm(Y). {A = sqlite3SrcListAppend(0,&X,&Y);} - -%type joinop {int} -%type joinop2 {int} -joinop(X) ::= COMMA. { X = JT_INNER; } -joinop(X) ::= JOIN. { X = JT_INNER; } -joinop(X) ::= JOIN_KW(A) JOIN. { X = sqlite3JoinType(pParse,&A,0,0); } -joinop(X) ::= JOIN_KW(A) nm(B) JOIN. { X = sqlite3JoinType(pParse,&A,&B,0); } -joinop(X) ::= JOIN_KW(A) nm(B) nm(C) JOIN. - { X = sqlite3JoinType(pParse,&A,&B,&C); } - -%type on_opt {Expr*} -%destructor on_opt {sqlite3ExprDelete($$);} -on_opt(N) ::= ON expr(E). {N = E;} -on_opt(N) ::= . {N = 0;} - -%type using_opt {IdList*} -%destructor using_opt {sqlite3IdListDelete($$);} -using_opt(U) ::= USING LP inscollist(L) RP. {U = L;} -using_opt(U) ::= . {U = 0;} - - -%type orderby_opt {ExprList*} -%destructor orderby_opt {sqlite3ExprListDelete($$);} -%type sortlist {ExprList*} -%destructor sortlist {sqlite3ExprListDelete($$);} -%type sortitem {Expr*} -%destructor sortitem {sqlite3ExprDelete($$);} - -orderby_opt(A) ::= . {A = 0;} -orderby_opt(A) ::= ORDER BY sortlist(X). {A = X;} -sortlist(A) ::= sortlist(X) COMMA sortitem(Y) collate(C) sortorder(Z). { - A = sqlite3ExprListAppend(X,Y,C.n>0?&C:0); - if( A ) A->a[A->nExpr-1].sortOrder = Z; -} -sortlist(A) ::= sortitem(Y) collate(C) sortorder(Z). { - A = sqlite3ExprListAppend(0,Y,C.n>0?&C:0); - if( A && A->a ) A->a[0].sortOrder = Z; -} -sortitem(A) ::= expr(X). {A = X;} - -%type sortorder {int} -%type collate {Token} - -sortorder(A) ::= ASC. {A = SQLITE_SO_ASC;} -sortorder(A) ::= DESC. {A = SQLITE_SO_DESC;} -sortorder(A) ::= . {A = SQLITE_SO_ASC;} -collate(C) ::= . {C.z = 0; C.n = 0;} -collate(C) ::= COLLATE id(X). {C = X;} - -%type groupby_opt {ExprList*} -%destructor groupby_opt {sqlite3ExprListDelete($$);} -groupby_opt(A) ::= . {A = 0;} -groupby_opt(A) ::= GROUP BY exprlist(X). {A = X;} - -%type having_opt {Expr*} -%destructor having_opt {sqlite3ExprDelete($$);} -having_opt(A) ::= . {A = 0;} -having_opt(A) ::= HAVING expr(X). {A = X;} - -%type limit_opt {struct LimitVal} -%destructor limit_opt { - sqlite3ExprDelete($$.pLimit); - sqlite3ExprDelete($$.pOffset); -} -limit_opt(A) ::= . {A.pLimit = 0; A.pOffset = 0;} -limit_opt(A) ::= LIMIT expr(X). {A.pLimit = X; A.pOffset = 0;} -limit_opt(A) ::= LIMIT expr(X) OFFSET expr(Y). - {A.pLimit = X; A.pOffset = Y;} -limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y). - {A.pOffset = X; A.pLimit = Y;} - -/////////////////////////// The DELETE statement ///////////////////////////// -// -cmd ::= DELETE FROM fullname(X) where_opt(Y). {sqlite3DeleteFrom(pParse,X,Y);} - -%type where_opt {Expr*} -%destructor where_opt {sqlite3ExprDelete($$);} - -where_opt(A) ::= . {A = 0;} -where_opt(A) ::= WHERE expr(X). {A = X;} - -////////////////////////// The UPDATE command //////////////////////////////// -// -cmd ::= UPDATE orconf(R) fullname(X) SET setlist(Y) where_opt(Z). - {sqlite3Update(pParse,X,Y,Z,R);} - -%type setlist {ExprList*} -%destructor setlist {sqlite3ExprListDelete($$);} - -setlist(A) ::= setlist(Z) COMMA nm(X) EQ expr(Y). - {A = sqlite3ExprListAppend(Z,Y,&X);} -setlist(A) ::= nm(X) EQ expr(Y). {A = sqlite3ExprListAppend(0,Y,&X);} - -////////////////////////// The INSERT command ///////////////////////////////// -// -cmd ::= insert_cmd(R) INTO fullname(X) inscollist_opt(F) - VALUES LP itemlist(Y) RP. - {sqlite3Insert(pParse, X, Y, 0, F, R);} -cmd ::= insert_cmd(R) INTO fullname(X) inscollist_opt(F) select(S). - {sqlite3Insert(pParse, X, 0, S, F, R);} - -%type insert_cmd {int} -insert_cmd(A) ::= INSERT orconf(R). {A = R;} -insert_cmd(A) ::= REPLACE. {A = OE_Replace;} - - -%type itemlist {ExprList*} -%destructor itemlist {sqlite3ExprListDelete($$);} - -itemlist(A) ::= itemlist(X) COMMA expr(Y). {A = sqlite3ExprListAppend(X,Y,0);} -itemlist(A) ::= expr(X). {A = sqlite3ExprListAppend(0,X,0);} - -%type inscollist_opt {IdList*} -%destructor inscollist_opt {sqlite3IdListDelete($$);} -%type inscollist {IdList*} -%destructor inscollist {sqlite3IdListDelete($$);} - -inscollist_opt(A) ::= . {A = 0;} -inscollist_opt(A) ::= LP inscollist(X) RP. {A = X;} -inscollist(A) ::= inscollist(X) COMMA nm(Y). {A = sqlite3IdListAppend(X,&Y);} -inscollist(A) ::= nm(Y). {A = sqlite3IdListAppend(0,&Y);} - -/////////////////////////// Expression Processing ///////////////////////////// -// - -%type expr {Expr*} -%destructor expr {sqlite3ExprDelete($$);} -%type term {Expr*} -%destructor term {sqlite3ExprDelete($$);} - -expr(A) ::= term(X). {A = X;} -expr(A) ::= LP(B) expr(X) RP(E). {A = X; sqlite3ExprSpan(A,&B,&E); } -term(A) ::= NULL(X). {A = sqlite3Expr(@X, 0, 0, &X);} -expr(A) ::= ID(X). {A = sqlite3Expr(TK_ID, 0, 0, &X);} -expr(A) ::= JOIN_KW(X). {A = sqlite3Expr(TK_ID, 0, 0, &X);} -expr(A) ::= nm(X) DOT nm(Y). { - Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &X); - Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &Y); - A = sqlite3Expr(TK_DOT, temp1, temp2, 0); -} -expr(A) ::= nm(X) DOT nm(Y) DOT nm(Z). { - Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &X); - Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &Y); - Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &Z); - Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0); - A = sqlite3Expr(TK_DOT, temp1, temp4, 0); -} -term(A) ::= INTEGER(X). {A = sqlite3Expr(@X, 0, 0, &X);} -term(A) ::= FLOAT(X). {A = sqlite3Expr(@X, 0, 0, &X);} -term(A) ::= STRING(X). {A = sqlite3Expr(@X, 0, 0, &X);} -term(A) ::= BLOB(X). {A = sqlite3Expr(@X, 0, 0, &X);} -expr(A) ::= REGISTER(X). {A = sqlite3RegisterExpr(pParse, &X);} -expr(A) ::= VARIABLE(X). { - Token *pToken = &X; - Expr *pExpr = A = sqlite3Expr(TK_VARIABLE, 0, 0, pToken); - sqlite3ExprAssignVarNumber(pParse, pExpr); -} -%ifndef SQLITE_OMIT_CAST -expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). { - A = sqlite3Expr(TK_CAST, E, 0, &T); - sqlite3ExprSpan(A,&X,&Y); -} -%endif // SQLITE_OMIT_CAST -expr(A) ::= ID(X) LP distinct(D) exprlist(Y) RP(E). { - A = sqlite3ExprFunction(Y, &X); - sqlite3ExprSpan(A,&X,&E); - if( D ){ - A->flags |= EP_Distinct; - } -} -expr(A) ::= ID(X) LP STAR RP(E). { - A = sqlite3ExprFunction(0, &X); - sqlite3ExprSpan(A,&X,&E); -} -term(A) ::= CTIME_KW(OP). { - /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are - ** treated as functions that return constants */ - A = sqlite3ExprFunction(0,&OP); - if( A ) A->op = TK_CONST_FUNC; -} -expr(A) ::= expr(X) AND(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) OR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) LT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) GT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) LE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) GE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) NE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) EQ(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) BITAND(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) BITOR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) LSHIFT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) RSHIFT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) PLUS(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) MINUS(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) STAR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) SLASH(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) REM(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -expr(A) ::= expr(X) CONCAT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);} -%type likeop {struct LikeOp} -likeop(A) ::= LIKE_KW(X). {A.operator = X; A.not = 0;} -likeop(A) ::= NOT LIKE_KW(X). {A.operator = X; A.not = 1;} -%type escape {Expr*} -escape(X) ::= ESCAPE expr(A). [ESCAPE] {X = A;} -escape(X) ::= . [ESCAPE] {X = 0;} -expr(A) ::= expr(X) likeop(OP) expr(Y) escape(E). [LIKE_KW] { - ExprList *pList = sqlite3ExprListAppend(0, Y, 0); - pList = sqlite3ExprListAppend(pList, X, 0); - if( E ){ - pList = sqlite3ExprListAppend(pList, E, 0); - } - A = sqlite3ExprFunction(pList, &OP.operator); - if( OP.not ) A = sqlite3Expr(TK_NOT, A, 0, 0); - sqlite3ExprSpan(A, &X->span, &Y->span); -} - -expr(A) ::= expr(X) ISNULL(E). { - A = sqlite3Expr(TK_ISNULL, X, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IS NULL(E). { - A = sqlite3Expr(TK_ISNULL, X, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOTNULL(E). { - A = sqlite3Expr(TK_NOTNULL, X, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOT NULL(E). { - A = sqlite3Expr(TK_NOTNULL, X, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IS NOT NULL(E). { - A = sqlite3Expr(TK_NOTNULL, X, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); -} -expr(A) ::= NOT(B) expr(X). { - A = sqlite3Expr(@B, X, 0, 0); - sqlite3ExprSpan(A,&B,&X->span); -} -expr(A) ::= BITNOT(B) expr(X). { - A = sqlite3Expr(@B, X, 0, 0); - sqlite3ExprSpan(A,&B,&X->span); -} -expr(A) ::= MINUS(B) expr(X). [UMINUS] { - A = sqlite3Expr(TK_UMINUS, X, 0, 0); - sqlite3ExprSpan(A,&B,&X->span); -} -expr(A) ::= PLUS(B) expr(X). [UPLUS] { - A = sqlite3Expr(TK_UPLUS, X, 0, 0); - sqlite3ExprSpan(A,&B,&X->span); -} -%type between_op {int} -between_op(A) ::= BETWEEN. {A = 0;} -between_op(A) ::= NOT BETWEEN. {A = 1;} -expr(A) ::= expr(W) between_op(N) expr(X) AND expr(Y). [BETWEEN] { - ExprList *pList = sqlite3ExprListAppend(0, X, 0); - pList = sqlite3ExprListAppend(pList, Y, 0); - A = sqlite3Expr(TK_BETWEEN, W, 0, 0); - if( A ){ - A->pList = pList; - }else{ - sqlite3ExprListDelete(pList); - } - if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0); - sqlite3ExprSpan(A,&W->span,&Y->span); -} -%ifndef SQLITE_OMIT_SUBQUERY - %type in_op {int} - in_op(A) ::= IN. {A = 0;} - in_op(A) ::= NOT IN. {A = 1;} - expr(A) ::= expr(X) in_op(N) LP exprlist(Y) RP(E). [IN] { - A = sqlite3Expr(TK_IN, X, 0, 0); - if( A ){ - A->pList = Y; - }else{ - sqlite3ExprListDelete(Y); - } - if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); - } - expr(A) ::= LP(B) select(X) RP(E). { - A = sqlite3Expr(TK_SELECT, 0, 0, 0); - if( A ){ - A->pSelect = X; - }else{ - sqlite3SelectDelete(X); - } - sqlite3ExprSpan(A,&B,&E); - } - expr(A) ::= expr(X) in_op(N) LP select(Y) RP(E). [IN] { - A = sqlite3Expr(TK_IN, X, 0, 0); - if( A ){ - A->pSelect = Y; - }else{ - sqlite3SelectDelete(Y); - } - if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0); - sqlite3ExprSpan(A,&X->span,&E); - } - expr(A) ::= expr(X) in_op(N) nm(Y) dbnm(Z). [IN] { - SrcList *pSrc = sqlite3SrcListAppend(0,&Y,&Z); - A = sqlite3Expr(TK_IN, X, 0, 0); - if( A ){ - A->pSelect = sqlite3SelectNew(0,pSrc,0,0,0,0,0,0,0); - }else{ - sqlite3SrcListDelete(pSrc); - } - if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0); - sqlite3ExprSpan(A,&X->span,Z.z?&Z:&Y); - } - expr(A) ::= EXISTS(B) LP select(Y) RP(E). { - Expr *p = A = sqlite3Expr(TK_EXISTS, 0, 0, 0); - if( p ){ - p->pSelect = Y; - sqlite3ExprSpan(p,&B,&E); - }else{ - sqlite3SelectDelete(Y); - } - } -%endif // SQLITE_OMIT_SUBQUERY - -/* CASE expressions */ -expr(A) ::= CASE(C) case_operand(X) case_exprlist(Y) case_else(Z) END(E). { - A = sqlite3Expr(TK_CASE, X, Z, 0); - if( A ){ - A->pList = Y; - }else{ - sqlite3ExprListDelete(Y); - } - sqlite3ExprSpan(A, &C, &E); -} -%type case_exprlist {ExprList*} -%destructor case_exprlist {sqlite3ExprListDelete($$);} -case_exprlist(A) ::= case_exprlist(X) WHEN expr(Y) THEN expr(Z). { - A = sqlite3ExprListAppend(X, Y, 0); - A = sqlite3ExprListAppend(A, Z, 0); -} -case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). { - A = sqlite3ExprListAppend(0, Y, 0); - A = sqlite3ExprListAppend(A, Z, 0); -} -%type case_else {Expr*} -case_else(A) ::= ELSE expr(X). {A = X;} -case_else(A) ::= . {A = 0;} -%type case_operand {Expr*} -case_operand(A) ::= expr(X). {A = X;} -case_operand(A) ::= . {A = 0;} - -%type exprlist {ExprList*} -%destructor exprlist {sqlite3ExprListDelete($$);} -%type expritem {Expr*} -%destructor expritem {sqlite3ExprDelete($$);} - -exprlist(A) ::= exprlist(X) COMMA expritem(Y). - {A = sqlite3ExprListAppend(X,Y,0);} -exprlist(A) ::= expritem(X). {A = sqlite3ExprListAppend(0,X,0);} -expritem(A) ::= expr(X). {A = X;} -expritem(A) ::= . {A = 0;} - -///////////////////////////// The CREATE INDEX command /////////////////////// -// -cmd ::= CREATE(S) uniqueflag(U) INDEX nm(X) dbnm(D) - ON nm(Y) LP idxlist(Z) RP(E) onconf(R). { - if( U!=OE_None ) U = R; - if( U==OE_Default) U = OE_Abort; - sqlite3CreateIndex(pParse, &X, &D, sqlite3SrcListAppend(0,&Y,0),Z,U, &S, &E); -} - -%type uniqueflag {int} -uniqueflag(A) ::= UNIQUE. {A = OE_Abort;} -uniqueflag(A) ::= . {A = OE_None;} - -%type idxlist {ExprList*} -%destructor idxlist {sqlite3ExprListDelete($$);} -%type idxlist_opt {ExprList*} -%destructor idxlist_opt {sqlite3ExprListDelete($$);} -%type idxitem {Token} - -idxlist_opt(A) ::= . {A = 0;} -idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} -idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder. { - Expr *p = 0; - if( C.n>0 ){ - p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n); - } - A = sqlite3ExprListAppend(X, p, &Y); -} -idxlist(A) ::= idxitem(Y) collate(C) sortorder. { - Expr *p = 0; - if( C.n>0 ){ - p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n); - } - A = sqlite3ExprListAppend(0, p, &Y); -} -idxitem(A) ::= nm(X). {A = X;} - - -///////////////////////////// The DROP INDEX command ///////////////////////// -// -cmd ::= DROP INDEX fullname(X). {sqlite3DropIndex(pParse, X);} - -///////////////////////////// The VACUUM command ///////////////////////////// -// -cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);} -cmd ::= VACUUM nm. {sqlite3Vacuum(pParse,0);} - -///////////////////////////// The PRAGMA command ///////////////////////////// -// -%ifndef SQLITE_OMIT_PRAGMA -cmd ::= PRAGMA nm(X) dbnm(Z) EQ nm(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);} -cmd ::= PRAGMA nm(X) dbnm(Z) EQ ON(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);} -cmd ::= PRAGMA nm(X) dbnm(Z) EQ plus_num(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);} -cmd ::= PRAGMA nm(X) dbnm(Z) EQ minus_num(Y). { - sqlite3Pragma(pParse,&X,&Z,&Y,1); -} -cmd ::= PRAGMA nm(X) dbnm(Z) LP nm(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,0);} -cmd ::= PRAGMA nm(X) dbnm(Z). {sqlite3Pragma(pParse,&X,&Z,0,0);} -%endif // SQLITE_OMIT_PRAGMA -plus_num(A) ::= plus_opt number(X). {A = X;} -minus_num(A) ::= MINUS number(X). {A = X;} -number(A) ::= INTEGER(X). {A = X;} -number(A) ::= FLOAT(X). {A = X;} -plus_opt ::= PLUS. -plus_opt ::= . - -//////////////////////////// The CREATE TRIGGER command ///////////////////// - -%ifndef SQLITE_OMIT_TRIGGER - -cmd ::= CREATE trigger_decl(A) BEGIN trigger_cmd_list(S) END(Z). { - Token all; - all.z = A.z; - all.n = (Z.z - A.z) + Z.n; - sqlite3FinishTrigger(pParse, S, &all); -} - -trigger_decl(A) ::= temp(T) TRIGGER nm(B) dbnm(Z) trigger_time(C) - trigger_event(D) - ON fullname(E) foreach_clause(F) when_clause(G). { - sqlite3BeginTrigger(pParse, &B, &Z, C, D.a, D.b, E, F, G, T); - A = (Z.n==0?B:Z); -} - -%type trigger_time {int} -trigger_time(A) ::= BEFORE. { A = TK_BEFORE; } -trigger_time(A) ::= AFTER. { A = TK_AFTER; } -trigger_time(A) ::= INSTEAD OF. { A = TK_INSTEAD;} -trigger_time(A) ::= . { A = TK_BEFORE; } - -%type trigger_event {struct TrigEvent} -%destructor trigger_event {sqlite3IdListDelete($$.b);} -trigger_event(A) ::= DELETE(OP). {A.a = @OP; A.b = 0;} -trigger_event(A) ::= INSERT(OP). {A.a = @OP; A.b = 0;} -trigger_event(A) ::= UPDATE(OP). {A.a = @OP; A.b = 0;} -trigger_event(A) ::= UPDATE OF inscollist(X). {A.a = TK_UPDATE; A.b = X;} - -%type foreach_clause {int} -foreach_clause(A) ::= . { A = TK_ROW; } -foreach_clause(A) ::= FOR EACH ROW. { A = TK_ROW; } -foreach_clause(A) ::= FOR EACH STATEMENT. { A = TK_STATEMENT; } - -%type when_clause {Expr*} -when_clause(A) ::= . { A = 0; } -when_clause(A) ::= WHEN expr(X). { A = X; } - -%type trigger_cmd_list {TriggerStep*} -%destructor trigger_cmd_list {sqlite3DeleteTriggerStep($$);} -trigger_cmd_list(A) ::= trigger_cmd(X) SEMI trigger_cmd_list(Y). { - X->pNext = Y; - A = X; -} -trigger_cmd_list(A) ::= . { A = 0; } - -%type trigger_cmd {TriggerStep*} -%destructor trigger_cmd {sqlite3DeleteTriggerStep($$);} -// UPDATE -trigger_cmd(A) ::= UPDATE orconf(R) nm(X) SET setlist(Y) where_opt(Z). - { A = sqlite3TriggerUpdateStep(&X, Y, Z, R); } - -// INSERT -trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) - VALUES LP itemlist(Y) RP. - {A = sqlite3TriggerInsertStep(&X, F, Y, 0, R);} - -trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) select(S). - {A = sqlite3TriggerInsertStep(&X, F, 0, S, R);} - -// DELETE -trigger_cmd(A) ::= DELETE FROM nm(X) where_opt(Y). - {A = sqlite3TriggerDeleteStep(&X, Y);} - -// SELECT -trigger_cmd(A) ::= select(X). {A = sqlite3TriggerSelectStep(X); } - -// The special RAISE expression that may occur in trigger programs -expr(A) ::= RAISE(X) LP IGNORE RP(Y). { - A = sqlite3Expr(TK_RAISE, 0, 0, 0); - A->iColumn = OE_Ignore; - sqlite3ExprSpan(A, &X, &Y); -} -expr(A) ::= RAISE(X) LP raisetype(T) COMMA nm(Z) RP(Y). { - A = sqlite3Expr(TK_RAISE, 0, 0, &Z); - A->iColumn = T; - sqlite3ExprSpan(A, &X, &Y); -} -%endif // !SQLITE_OMIT_TRIGGER - -%type raisetype {int} -raisetype(A) ::= ROLLBACK. {A = OE_Rollback;} -raisetype(A) ::= ABORT. {A = OE_Abort;} -raisetype(A) ::= FAIL. {A = OE_Fail;} - - -//////////////////////// DROP TRIGGER statement ////////////////////////////// -%ifndef SQLITE_OMIT_TRIGGER -cmd ::= DROP TRIGGER fullname(X). { - sqlite3DropTrigger(pParse,X); -} -%endif // !SQLITE_OMIT_TRIGGER - -//////////////////////// ATTACH DATABASE file AS name ///////////////////////// -cmd ::= ATTACH database_kw_opt ids(F) AS nm(D) key_opt(K). { - sqlite3Attach(pParse, &F, &D, K.type, &K.key); -} -%type key_opt {struct AttachKey} -key_opt(A) ::= . { A.type = 0; } -key_opt(A) ::= KEY ids(X). { A.type=1; A.key = X; } -key_opt(A) ::= KEY BLOB(X). { A.type=2; A.key = X; } - -database_kw_opt ::= DATABASE. -database_kw_opt ::= . - -//////////////////////// DETACH DATABASE name ///////////////////////////////// -cmd ::= DETACH database_kw_opt nm(D). { - sqlite3Detach(pParse, &D); -} - -////////////////////////// REINDEX collation ////////////////////////////////// -%ifndef SQLITE_OMIT_REINDEX -cmd ::= REINDEX. {sqlite3Reindex(pParse, 0, 0);} -cmd ::= REINDEX nm(X) dbnm(Y). {sqlite3Reindex(pParse, &X, &Y);} -%endif - -/////////////////////////////////// ANALYZE /////////////////////////////////// -%ifndef SQLITE_OMIT_ANALYZE -cmd ::= ANALYZE. {sqlite3Analyze(pParse, 0, 0);} -cmd ::= ANALYZE nm(X) dbnm(Y). {sqlite3Analyze(pParse, &X, &Y);} -%endif - -//////////////////////// ALTER TABLE table ... //////////////////////////////// -%ifndef SQLITE_OMIT_ALTERTABLE -cmd ::= ALTER TABLE fullname(X) RENAME TO nm(Z). { - sqlite3AlterRenameTable(pParse,X,&Z); -} -cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column(Y). { - sqlite3AlterFinishAddColumn(pParse, &Y); -} -add_column_fullname ::= fullname(X). { - sqlite3AlterBeginAddColumn(pParse, X); -} -kwcolumn_opt ::= . -kwcolumn_opt ::= COLUMNKW. -%endif diff --git a/ext/pdo_sqlite/sqlite/src/pragma.c b/ext/pdo_sqlite/sqlite/src/pragma.c deleted file mode 100644 index e366401d260f2..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/pragma.c +++ /dev/null @@ -1,935 +0,0 @@ -/* -** 2003 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the PRAGMA command. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> - -/* Ignore this whole file if pragmas are disabled -*/ -#if !defined(SQLITE_OMIT_PRAGMA) && !defined(SQLITE_OMIT_PARSER) - -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) -# include "pager.h" -# include "btree.h" -#endif - -/* -** Interpret the given string as a safety level. Return 0 for OFF, -** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or -** unrecognized string argument. -** -** Note that the values returned are one less that the values that -** should be passed into sqlite3BtreeSetSafetyLevel(). The is done -** to support legacy SQL code. The safety level used to be boolean -** and older scripts may have used numbers 0 for OFF and 1 for ON. -*/ -static int getSafetyLevel(const u8 *z){ - /* 123456789 123456789 */ - static const char zText[] = "onoffalseyestruefull"; - static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; - static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; - static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; - int i, n; - if( isdigit(*z) ){ - return atoi(z); - } - n = strlen(z); - for(i=0; i<sizeof(iLength); i++){ - if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){ - return iValue[i]; - } - } - return 1; -} - -/* -** Interpret the given string as a boolean value. -*/ -static int getBoolean(const u8 *z){ - return getSafetyLevel(z)&1; -} - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -/* -** Interpret the given string as a temp db location. Return 1 for file -** backed temporary databases, 2 for the Red-Black tree in memory database -** and 0 to use the compile-time default. -*/ -static int getTempStore(const char *z){ - if( z[0]>='0' && z[0]<='2' ){ - return z[0] - '0'; - }else if( sqlite3StrICmp(z, "file")==0 ){ - return 1; - }else if( sqlite3StrICmp(z, "memory")==0 ){ - return 2; - }else{ - return 0; - } -} -#endif /* SQLITE_PAGER_PRAGMAS */ - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -/* -** Invalidate temp storage, either when the temp storage is changed -** from default, or when 'file' and the temp_store_directory has changed -*/ -static int invalidateTempStorage(Parse *pParse){ - sqlite3 *db = pParse->db; - if( db->aDb[1].pBt!=0 ){ - if( db->flags & SQLITE_InTrans ){ - sqlite3ErrorMsg(pParse, "temporary storage cannot be changed " - "from within a transaction"); - return SQLITE_ERROR; - } - sqlite3BtreeClose(db->aDb[1].pBt); - db->aDb[1].pBt = 0; - sqlite3ResetInternalSchema(db, 0); - } - return SQLITE_OK; -} -#endif /* SQLITE_PAGER_PRAGMAS */ - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS -/* -** If the TEMP database is open, close it and mark the database schema -** as needing reloading. This must be done when using the TEMP_STORE -** or DEFAULT_TEMP_STORE pragmas. -*/ -static int changeTempStorage(Parse *pParse, const char *zStorageType){ - int ts = getTempStore(zStorageType); - sqlite3 *db = pParse->db; - if( db->temp_store==ts ) return SQLITE_OK; - if( invalidateTempStorage( pParse ) != SQLITE_OK ){ - return SQLITE_ERROR; - } - db->temp_store = ts; - return SQLITE_OK; -} -#endif /* SQLITE_PAGER_PRAGMAS */ - -/* -** Generate code to return a single integer value. -*/ -static void returnSingleInt(Parse *pParse, const char *zLabel, int value){ - Vdbe *v = sqlite3GetVdbe(pParse); - sqlite3VdbeAddOp(v, OP_Integer, value, 0); - if( pParse->explain==0 ){ - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, zLabel, P3_STATIC); - } - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); -} - -#ifndef SQLITE_OMIT_FLAG_PRAGMAS -/* -** Check to see if zRight and zLeft refer to a pragma that queries -** or changes one of the flags in db->flags. Return 1 if so and 0 if not. -** Also, implement the pragma. -*/ -static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ - static const struct sPragmaType { - const char *zName; /* Name of the pragma */ - int mask; /* Mask for the db->flags value */ - } aPragma[] = { - { "vdbe_trace", SQLITE_VdbeTrace }, - { "sql_trace", SQLITE_SqlTrace }, - { "vdbe_listing", SQLITE_VdbeListing }, - { "full_column_names", SQLITE_FullColNames }, - { "short_column_names", SQLITE_ShortColNames }, - { "count_changes", SQLITE_CountRows }, - { "empty_result_callbacks", SQLITE_NullCallback }, - /* The following is VERY experimental */ - { "writable_schema", SQLITE_WriteSchema }, - { "omit_readlock", SQLITE_NoReadlock }, - }; - int i; - const struct sPragmaType *p; - for(i=0, p=aPragma; i<sizeof(aPragma)/sizeof(aPragma[0]); i++, p++){ - if( sqlite3StrICmp(zLeft, p->zName)==0 ){ - sqlite3 *db = pParse->db; - Vdbe *v; - v = sqlite3GetVdbe(pParse); - if( v ){ - if( zRight==0 ){ - returnSingleInt(pParse, p->zName, (db->flags & p->mask)!=0 ); - }else{ - if( getBoolean(zRight) ){ - db->flags |= p->mask; - }else{ - db->flags &= ~p->mask; - } - } - /* If one of these pragmas is executed, any prepared statements - ** need to be recompiled. - */ - sqlite3VdbeAddOp(v, OP_Expire, 0, 0); - } - return 1; - } - } - return 0; -} -#endif /* SQLITE_OMIT_FLAG_PRAGMAS */ - -/* -** Process a pragma statement. -** -** Pragmas are of this form: -** -** PRAGMA [database.]id [= value] -** -** The identifier might also be a string. The value is a string, and -** identifier, or a number. If minusFlag is true, then the value is -** a number that was preceded by a minus sign. -** -** If the left side is "database.id" then pId1 is the database name -** and pId2 is the id. If the left side is just "id" then pId1 is the -** id and pId2 is any empty string. -*/ -void sqlite3Pragma( - Parse *pParse, - Token *pId1, /* First part of [database.]id field */ - Token *pId2, /* Second part of [database.]id field, or NULL */ - Token *pValue, /* Token for <value>, or NULL */ - int minusFlag /* True if a '-' sign preceded <value> */ -){ - char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */ - char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */ - const char *zDb = 0; /* The database name */ - Token *pId; /* Pointer to <id> token */ - int iDb; /* Database index for <database> */ - sqlite3 *db = pParse->db; - Db *pDb; - Vdbe *v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - - /* Interpret the [database.] part of the pragma statement. iDb is the - ** index of the database this pragma is being applied to in db.aDb[]. */ - iDb = sqlite3TwoPartName(pParse, pId1, pId2, &pId); - if( iDb<0 ) return; - pDb = &db->aDb[iDb]; - - zLeft = sqlite3NameFromToken(pId); - if( !zLeft ) return; - if( minusFlag ){ - zRight = sqlite3MPrintf("-%T", pValue); - }else{ - zRight = sqlite3NameFromToken(pValue); - } - - zDb = ((iDb>0)?pDb->zName:0); - if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ - goto pragma_out; - } - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS - /* - ** PRAGMA [database.]default_cache_size - ** PRAGMA [database.]default_cache_size=N - ** - ** The first form reports the current persistent setting for the - ** page cache size. The value returned is the maximum number of - ** pages in the page cache. The second form sets both the current - ** page cache size value and the persistent page cache size value - ** stored in the database file. - ** - ** The default cache size is stored in meta-value 2 of page 1 of the - ** database file. The cache size is actually the absolute value of - ** this memory location. The sign of meta-value 2 determines the - ** synchronous setting. A negative value means synchronous is off - ** and a positive value means synchronous is on. - */ - if( sqlite3StrICmp(zLeft,"default_cache_size")==0 ){ - static const VdbeOpList getCacheSize[] = { - { OP_ReadCookie, 0, 2, 0}, /* 0 */ - { OP_AbsValue, 0, 0, 0}, - { OP_Dup, 0, 0, 0}, - { OP_Integer, 0, 0, 0}, - { OP_Ne, 0, 6, 0}, - { OP_Integer, 0, 0, 0}, /* 5 */ - { OP_Callback, 1, 0, 0}, - }; - int addr; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - if( !zRight ){ - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "cache_size", P3_STATIC); - addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); - sqlite3VdbeChangeP1(v, addr, iDb); - sqlite3VdbeChangeP1(v, addr+5, MAX_PAGES); - }else{ - int size = atoi(zRight); - if( size<0 ) size = -size; - sqlite3BeginWriteOperation(pParse, 0, iDb); - sqlite3VdbeAddOp(v, OP_Integer, size, 0); - sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 2); - addr = sqlite3VdbeAddOp(v, OP_Integer, 0, 0); - sqlite3VdbeAddOp(v, OP_Ge, 0, addr+3); - sqlite3VdbeAddOp(v, OP_Negative, 0, 0); - sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 2); - pDb->cache_size = size; - sqlite3BtreeSetCacheSize(pDb->pBt, pDb->cache_size); - } - }else - - /* - ** PRAGMA [database.]page_size - ** PRAGMA [database.]page_size=N - ** - ** The first form reports the current setting for the - ** database page size in bytes. The second form sets the - ** database page size value. The value can only be set if - ** the database has not yet been created. - */ - if( sqlite3StrICmp(zLeft,"page_size")==0 ){ - Btree *pBt = pDb->pBt; - if( !zRight ){ - int size = pBt ? sqlite3BtreeGetPageSize(pBt) : 0; - returnSingleInt(pParse, "page_size", size); - }else{ - sqlite3BtreeSetPageSize(pBt, atoi(zRight), -1); - } - }else -#endif /* SQLITE_OMIT_PAGER_PRAGMAS */ - - /* - ** PRAGMA [database.]auto_vacuum - ** PRAGMA [database.]auto_vacuum=N - ** - ** Get or set the (boolean) value of the database 'auto-vacuum' parameter. - */ -#ifndef SQLITE_OMIT_AUTOVACUUM - if( sqlite3StrICmp(zLeft,"auto_vacuum")==0 ){ - Btree *pBt = pDb->pBt; - if( !zRight ){ - int auto_vacuum = - pBt ? sqlite3BtreeGetAutoVacuum(pBt) : SQLITE_DEFAULT_AUTOVACUUM; - returnSingleInt(pParse, "auto_vacuum", auto_vacuum); - }else{ - sqlite3BtreeSetAutoVacuum(pBt, getBoolean(zRight)); - } - }else -#endif - -#ifndef SQLITE_OMIT_PAGER_PRAGMAS - /* - ** PRAGMA [database.]cache_size - ** PRAGMA [database.]cache_size=N - ** - ** The first form reports the current local setting for the - ** page cache size. The local setting can be different from - ** the persistent cache size value that is stored in the database - ** file itself. The value returned is the maximum number of - ** pages in the page cache. The second form sets the local - ** page cache size value. It does not change the persistent - ** cache size stored on the disk so the cache size will revert - ** to its default value when the database is closed and reopened. - ** N should be a positive integer. - */ - if( sqlite3StrICmp(zLeft,"cache_size")==0 ){ - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - if( !zRight ){ - returnSingleInt(pParse, "cache_size", pDb->cache_size); - }else{ - int size = atoi(zRight); - if( size<0 ) size = -size; - pDb->cache_size = size; - sqlite3BtreeSetCacheSize(pDb->pBt, pDb->cache_size); - } - }else - - /* - ** PRAGMA temp_store - ** PRAGMA temp_store = "default"|"memory"|"file" - ** - ** Return or set the local value of the temp_store flag. Changing - ** the local value does not make changes to the disk file and the default - ** value will be restored the next time the database is opened. - ** - ** Note that it is possible for the library compile-time options to - ** override this setting - */ - if( sqlite3StrICmp(zLeft, "temp_store")==0 ){ - if( !zRight ){ - returnSingleInt(pParse, "temp_store", db->temp_store); - }else{ - changeTempStorage(pParse, zRight); - } - }else - - /* - ** PRAGMA temp_store_directory - ** PRAGMA temp_store_directory = ""|"directory_name" - ** - ** Return or set the local value of the temp_store_directory flag. Changing - ** the value sets a specific directory to be used for temporary files. - ** Setting to a null string reverts to the default temporary directory search. - ** If temporary directory is changed, then invalidateTempStorage. - ** - */ - if( sqlite3StrICmp(zLeft, "temp_store_directory")==0 ){ - if( !zRight ){ - if( sqlite3_temp_directory ){ - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "temp_store_directory", P3_STATIC); - sqlite3VdbeOp3(v, OP_String8, 0, 0, sqlite3_temp_directory, 0); - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - } - }else{ - if( zRight[0] && !sqlite3OsIsDirWritable(zRight) ){ - sqlite3ErrorMsg(pParse, "not a writable directory"); - goto pragma_out; - } - if( TEMP_STORE==0 - || (TEMP_STORE==1 && db->temp_store<=1) - || (TEMP_STORE==2 && db->temp_store==1) - ){ - invalidateTempStorage(pParse); - } - sqliteFree(sqlite3_temp_directory); - if( zRight[0] ){ - sqlite3_temp_directory = zRight; - zRight = 0; - }else{ - sqlite3_temp_directory = 0; - } - } - }else - - /* - ** PRAGMA [database.]synchronous - ** PRAGMA [database.]synchronous=OFF|ON|NORMAL|FULL - ** - ** Return or set the local value of the synchronous flag. Changing - ** the local value does not make changes to the disk file and the - ** default value will be restored the next time the database is - ** opened. - */ - if( sqlite3StrICmp(zLeft,"synchronous")==0 ){ - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - if( !zRight ){ - returnSingleInt(pParse, "synchronous", pDb->safety_level-1); - }else{ - if( !db->autoCommit ){ - sqlite3ErrorMsg(pParse, - "Safety level may not be changed inside a transaction"); - }else{ - pDb->safety_level = getSafetyLevel(zRight)+1; - sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level); - } - } - }else -#endif /* SQLITE_OMIT_PAGER_PRAGMAS */ - -#ifndef SQLITE_OMIT_FLAG_PRAGMAS - if( flagPragma(pParse, zLeft, zRight) ){ - /* The flagPragma() subroutine also generates any necessary code - ** there is nothing more to do here */ - }else -#endif /* SQLITE_OMIT_FLAG_PRAGMAS */ - -#ifndef SQLITE_OMIT_SCHEMA_PRAGMAS - /* - ** PRAGMA table_info(<table>) - ** - ** Return a single row for each column of the named table. The columns of - ** the returned data set are: - ** - ** cid: Column id (numbered from left to right, starting at 0) - ** name: Column name - ** type: Column declaration type. - ** notnull: True if 'NOT NULL' is part of column declaration - ** dflt_value: The default value for the column, if any. - */ - if( sqlite3StrICmp(zLeft, "table_info")==0 && zRight ){ - Table *pTab; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - pTab = sqlite3FindTable(db, zRight, zDb); - if( pTab ){ - int i; - sqlite3VdbeSetNumCols(v, 6); - sqlite3VdbeSetColName(v, 0, "cid", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "name", P3_STATIC); - sqlite3VdbeSetColName(v, 2, "type", P3_STATIC); - sqlite3VdbeSetColName(v, 3, "notnull", P3_STATIC); - sqlite3VdbeSetColName(v, 4, "dflt_value", P3_STATIC); - sqlite3VdbeSetColName(v, 5, "pk", P3_STATIC); - sqlite3ViewGetColumnNames(pParse, pTab); - for(i=0; i<pTab->nCol; i++){ - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zName, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, - pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0); - sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0); - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt); - sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0); - sqlite3VdbeAddOp(v, OP_Callback, 6, 0); - } - } - }else - - if( sqlite3StrICmp(zLeft, "index_info")==0 && zRight ){ - Index *pIdx; - Table *pTab; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - pIdx = sqlite3FindIndex(db, zRight, zDb); - if( pIdx ){ - int i; - pTab = pIdx->pTable; - sqlite3VdbeSetNumCols(v, 3); - sqlite3VdbeSetColName(v, 0, "seqno", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "cid", P3_STATIC); - sqlite3VdbeSetColName(v, 2, "name", P3_STATIC); - for(i=0; i<pIdx->nColumn; i++){ - int cnum = pIdx->aiColumn[i]; - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeAddOp(v, OP_Integer, cnum, 0); - assert( pTab->nCol>cnum ); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[cnum].zName, 0); - sqlite3VdbeAddOp(v, OP_Callback, 3, 0); - } - } - }else - - if( sqlite3StrICmp(zLeft, "index_list")==0 && zRight ){ - Index *pIdx; - Table *pTab; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - pTab = sqlite3FindTable(db, zRight, zDb); - if( pTab ){ - v = sqlite3GetVdbe(pParse); - pIdx = pTab->pIndex; - if( pIdx ){ - int i = 0; - sqlite3VdbeSetNumCols(v, 3); - sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "name", P3_STATIC); - sqlite3VdbeSetColName(v, 2, "unique", P3_STATIC); - while(pIdx){ - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0); - sqlite3VdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0); - sqlite3VdbeAddOp(v, OP_Callback, 3, 0); - ++i; - pIdx = pIdx->pNext; - } - } - } - }else - - if( sqlite3StrICmp(zLeft, "database_list")==0 ){ - int i; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - sqlite3VdbeSetNumCols(v, 3); - sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "name", P3_STATIC); - sqlite3VdbeSetColName(v, 2, "file", P3_STATIC); - for(i=0; i<db->nDb; i++){ - if( db->aDb[i].pBt==0 ) continue; - assert( db->aDb[i].zName!=0 ); - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, db->aDb[i].zName, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, - sqlite3BtreeGetFilename(db->aDb[i].pBt), 0); - sqlite3VdbeAddOp(v, OP_Callback, 3, 0); - } - }else - - if( sqlite3StrICmp(zLeft, "collation_list")==0 ){ - int i = 0; - HashElem *p; - sqlite3VdbeSetNumCols(v, 2); - sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "name", P3_STATIC); - for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){ - CollSeq *pColl = (CollSeq *)sqliteHashData(p); - sqlite3VdbeAddOp(v, OP_Integer, i++, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pColl->zName, 0); - sqlite3VdbeAddOp(v, OP_Callback, 2, 0); - } - }else -#endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */ - -#ifndef SQLITE_OMIT_FOREIGN_KEY - if( sqlite3StrICmp(zLeft, "foreign_key_list")==0 && zRight ){ - FKey *pFK; - Table *pTab; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - pTab = sqlite3FindTable(db, zRight, zDb); - if( pTab ){ - v = sqlite3GetVdbe(pParse); - pFK = pTab->pFKey; - if( pFK ){ - int i = 0; - sqlite3VdbeSetNumCols(v, 5); - sqlite3VdbeSetColName(v, 0, "id", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "seq", P3_STATIC); - sqlite3VdbeSetColName(v, 2, "table", P3_STATIC); - sqlite3VdbeSetColName(v, 3, "from", P3_STATIC); - sqlite3VdbeSetColName(v, 4, "to", P3_STATIC); - while(pFK){ - int j; - for(j=0; j<pFK->nCol; j++){ - char *zCol = pFK->aCol[j].zCol; - sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeAddOp(v, OP_Integer, j, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, pFK->zTo, 0); - sqlite3VdbeOp3(v, OP_String8, 0, 0, - pTab->aCol[pFK->aCol[j].iFrom].zName, 0); - sqlite3VdbeOp3(v, zCol ? OP_String8 : OP_Null, 0, 0, zCol, 0); - sqlite3VdbeAddOp(v, OP_Callback, 5, 0); - } - ++i; - pFK = pFK->pNextFrom; - } - } - } - }else -#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ - -#ifndef NDEBUG - if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ - extern void sqlite3ParserTrace(FILE*, char *); - if( zRight ){ - if( getBoolean(zRight) ){ - sqlite3ParserTrace(stderr, "parser: "); - }else{ - sqlite3ParserTrace(0, 0); - } - } - }else -#endif - - /* Reinstall the LIKE and GLOB functions. The variant of LIKE - ** used will be case sensitive or not depending on the RHS. - */ - if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){ - if( zRight ){ - sqlite3RegisterLikeFunctions(db, getBoolean(zRight)); - } - }else - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK - if( sqlite3StrICmp(zLeft, "integrity_check")==0 ){ - int i, j, addr; - - /* Code that appears at the end of the integrity check. If no error - ** messages have been generated, output OK. Otherwise output the - ** error message - */ - static const VdbeOpList endCode[] = { - { OP_MemLoad, 0, 0, 0}, - { OP_Integer, 0, 0, 0}, - { OP_Ne, 0, 0, 0}, /* 2 */ - { OP_String8, 0, 0, "ok"}, - { OP_Callback, 1, 0, 0}, - }; - - /* Initialize the VDBE program */ - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "integrity_check", P3_STATIC); - sqlite3VdbeAddOp(v, OP_MemInt, 0, 0); /* Initialize error count to 0 */ - - /* Do an integrity check on each database file */ - for(i=0; i<db->nDb; i++){ - HashElem *x; - int cnt = 0; - - if( OMIT_TEMPDB && i==1 ) continue; - - sqlite3CodeVerifySchema(pParse, i); - - /* Do an integrity check of the B-Tree - */ - for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ - Table *pTab = sqliteHashData(x); - Index *pIdx; - sqlite3VdbeAddOp(v, OP_Integer, pTab->tnum, 0); - cnt++; - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - if( sqlite3CheckIndexCollSeq(pParse, pIdx) ) goto pragma_out; - sqlite3VdbeAddOp(v, OP_Integer, pIdx->tnum, 0); - cnt++; - } - } - assert( cnt>0 ); - sqlite3VdbeAddOp(v, OP_IntegrityCk, cnt, i); - sqlite3VdbeAddOp(v, OP_Dup, 0, 1); - addr = sqlite3VdbeOp3(v, OP_String8, 0, 0, "ok", P3_STATIC); - sqlite3VdbeAddOp(v, OP_Eq, 0, addr+6); - sqlite3VdbeOp3(v, OP_String8, 0, 0, - sqlite3MPrintf("*** in database %s ***\n", db->aDb[i].zName), - P3_DYNAMIC); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - sqlite3VdbeAddOp(v, OP_Concat, 0, 1); - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - - /* Make sure all the indices are constructed correctly. - */ - sqlite3CodeVerifySchema(pParse, i); - for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ - Table *pTab = sqliteHashData(x); - Index *pIdx; - int loopTop; - - if( pTab->pIndex==0 ) continue; - sqlite3OpenTableAndIndices(pParse, pTab, 1, OP_OpenRead); - sqlite3VdbeAddOp(v, OP_MemInt, 0, 1); - loopTop = sqlite3VdbeAddOp(v, OP_Rewind, 1, 0); - sqlite3VdbeAddOp(v, OP_MemIncr, 1, 0); - for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - int jmp2; - static const VdbeOpList idxErr[] = { - { OP_MemIncr, 0, 0, 0}, - { OP_String8, 0, 0, "rowid "}, - { OP_Rowid, 1, 0, 0}, - { OP_String8, 0, 0, " missing from index "}, - { OP_String8, 0, 0, 0}, /* 4 */ - { OP_Concat, 2, 0, 0}, - { OP_Callback, 1, 0, 0}, - }; - sqlite3GenerateIndexKey(v, pIdx, 1); - jmp2 = sqlite3VdbeAddOp(v, OP_Found, j+2, 0); - addr = sqlite3VdbeAddOpList(v, ArraySize(idxErr), idxErr); - sqlite3VdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC); - sqlite3VdbeJumpHere(v, jmp2); - } - sqlite3VdbeAddOp(v, OP_Next, 1, loopTop+1); - sqlite3VdbeJumpHere(v, loopTop); - for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - static const VdbeOpList cntIdx[] = { - { OP_MemInt, 0, 2, 0}, - { OP_Rewind, 0, 0, 0}, /* 1 */ - { OP_MemIncr, 2, 0, 0}, - { OP_Next, 0, 0, 0}, /* 3 */ - { OP_MemLoad, 1, 0, 0}, - { OP_MemLoad, 2, 0, 0}, - { OP_Eq, 0, 0, 0}, /* 6 */ - { OP_MemIncr, 0, 0, 0}, - { OP_String8, 0, 0, "wrong # of entries in index "}, - { OP_String8, 0, 0, 0}, /* 9 */ - { OP_Concat, 0, 0, 0}, - { OP_Callback, 1, 0, 0}, - }; - if( pIdx->tnum==0 ) continue; - addr = sqlite3VdbeAddOpList(v, ArraySize(cntIdx), cntIdx); - sqlite3VdbeChangeP1(v, addr+1, j+2); - sqlite3VdbeChangeP2(v, addr+1, addr+4); - sqlite3VdbeChangeP1(v, addr+3, j+2); - sqlite3VdbeChangeP2(v, addr+3, addr+2); - sqlite3VdbeJumpHere(v, addr+6); - sqlite3VdbeChangeP3(v, addr+9, pIdx->zName, P3_STATIC); - } - } - } - addr = sqlite3VdbeAddOpList(v, ArraySize(endCode), endCode); - sqlite3VdbeJumpHere(v, addr+2); - }else -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -#ifndef SQLITE_OMIT_UTF16 - /* - ** PRAGMA encoding - ** PRAGMA encoding = "utf-8"|"utf-16"|"utf-16le"|"utf-16be" - ** - ** In it's first form, this pragma returns the encoding of the main - ** database. If the database is not initialized, it is initialized now. - ** - ** The second form of this pragma is a no-op if the main database file - ** has not already been initialized. In this case it sets the default - ** encoding that will be used for the main database file if a new file - ** is created. If an existing main database file is opened, then the - ** default text encoding for the existing database is used. - ** - ** In all cases new databases created using the ATTACH command are - ** created to use the same default text encoding as the main database. If - ** the main database has not been initialized and/or created when ATTACH - ** is executed, this is done before the ATTACH operation. - ** - ** In the second form this pragma sets the text encoding to be used in - ** new database files created using this database handle. It is only - ** useful if invoked immediately after the main database i - */ - if( sqlite3StrICmp(zLeft, "encoding")==0 ){ - static struct EncName { - char *zName; - u8 enc; - } encnames[] = { - { "UTF-8", SQLITE_UTF8 }, - { "UTF8", SQLITE_UTF8 }, - { "UTF-16le", SQLITE_UTF16LE }, - { "UTF16le", SQLITE_UTF16LE }, - { "UTF-16be", SQLITE_UTF16BE }, - { "UTF16be", SQLITE_UTF16BE }, - { "UTF-16", 0 /* Filled in at run-time */ }, - { "UTF16", 0 /* Filled in at run-time */ }, - { 0, 0 } - }; - struct EncName *pEnc; - encnames[6].enc = encnames[7].enc = SQLITE_UTF16NATIVE; - if( !zRight ){ /* "PRAGMA encoding" */ - if( sqlite3ReadSchema(pParse) ) goto pragma_out; - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "encoding", P3_STATIC); - sqlite3VdbeAddOp(v, OP_String8, 0, 0); - for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ - if( pEnc->enc==pParse->db->enc ){ - sqlite3VdbeChangeP3(v, -1, pEnc->zName, P3_STATIC); - break; - } - } - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - }else{ /* "PRAGMA encoding = XXX" */ - /* Only change the value of sqlite.enc if the database handle is not - ** initialized. If the main database exists, the new sqlite.enc value - ** will be overwritten when the schema is next loaded. If it does not - ** already exists, it will be created to use the new encoding value. - */ - if( !(pParse->db->flags&SQLITE_Initialized) ){ - for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ - if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ - pParse->db->enc = pEnc->enc; - break; - } - } - if( !pEnc->zName ){ - sqlite3ErrorMsg(pParse, "unsupported encoding: %s", zRight); - } - } - } - }else -#endif /* SQLITE_OMIT_UTF16 */ - -#ifndef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS - /* - ** PRAGMA [database.]schema_version - ** PRAGMA [database.]schema_version = <integer> - ** - ** PRAGMA [database.]user_version - ** PRAGMA [database.]user_version = <integer> - ** - ** The pragma's schema_version and user_version are used to set or get - ** the value of the schema-version and user-version, respectively. Both - ** the schema-version and the user-version are 32-bit signed integers - ** stored in the database header. - ** - ** The schema-cookie is usually only manipulated internally by SQLite. It - ** is incremented by SQLite whenever the database schema is modified (by - ** creating or dropping a table or index). The schema version is used by - ** SQLite each time a query is executed to ensure that the internal cache - ** of the schema used when compiling the SQL query matches the schema of - ** the database against which the compiled query is actually executed. - ** Subverting this mechanism by using "PRAGMA schema_version" to modify - ** the schema-version is potentially dangerous and may lead to program - ** crashes or database corruption. Use with caution! - ** - ** The user-version is not used internally by SQLite. It may be used by - ** applications for any purpose. - */ - if( sqlite3StrICmp(zLeft, "schema_version")==0 || - sqlite3StrICmp(zLeft, "user_version")==0 ){ - - int iCookie; /* Cookie index. 0 for schema-cookie, 6 for user-cookie. */ - if( zLeft[0]=='s' || zLeft[0]=='S' ){ - iCookie = 0; - }else{ - iCookie = 5; - } - - if( zRight ){ - /* Write the specified cookie value */ - static const VdbeOpList setCookie[] = { - { OP_Transaction, 0, 1, 0}, /* 0 */ - { OP_Integer, 0, 0, 0}, /* 1 */ - { OP_SetCookie, 0, 0, 0}, /* 2 */ - }; - int addr = sqlite3VdbeAddOpList(v, ArraySize(setCookie), setCookie); - sqlite3VdbeChangeP1(v, addr, iDb); - sqlite3VdbeChangeP1(v, addr+1, atoi(zRight)); - sqlite3VdbeChangeP1(v, addr+2, iDb); - sqlite3VdbeChangeP2(v, addr+2, iCookie); - }else{ - /* Read the specified cookie value */ - static const VdbeOpList readCookie[] = { - { OP_ReadCookie, 0, 0, 0}, /* 0 */ - { OP_Callback, 1, 0, 0} - }; - int addr = sqlite3VdbeAddOpList(v, ArraySize(readCookie), readCookie); - sqlite3VdbeChangeP1(v, addr, iDb); - sqlite3VdbeChangeP2(v, addr, iCookie); - sqlite3VdbeSetNumCols(v, 1); - } - } -#endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ - -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) - /* - ** Report the current state of file logs for all databases - */ - if( sqlite3StrICmp(zLeft, "lock_status")==0 ){ - static const char *const azLockName[] = { - "unlocked", "shared", "reserved", "pending", "exclusive" - }; - int i; - Vdbe *v = sqlite3GetVdbe(pParse); - sqlite3VdbeSetNumCols(v, 2); - sqlite3VdbeSetColName(v, 0, "database", P3_STATIC); - sqlite3VdbeSetColName(v, 1, "status", P3_STATIC); - for(i=0; i<db->nDb; i++){ - Btree *pBt; - Pager *pPager; - if( db->aDb[i].zName==0 ) continue; - sqlite3VdbeOp3(v, OP_String8, 0, 0, db->aDb[i].zName, P3_STATIC); - pBt = db->aDb[i].pBt; - if( pBt==0 || (pPager = sqlite3BtreePager(pBt))==0 ){ - sqlite3VdbeOp3(v, OP_String8, 0, 0, "closed", P3_STATIC); - }else{ - int j = sqlite3pager_lockstate(pPager); - sqlite3VdbeOp3(v, OP_String8, 0, 0, - (j>=0 && j<=4) ? azLockName[j] : "unknown", P3_STATIC); - } - sqlite3VdbeAddOp(v, OP_Callback, 2, 0); - } - }else -#endif - -#ifdef SQLITE_SSE - /* - ** Check to see if the sqlite_statements table exists. Create it - ** if it does not. - */ - if( sqlite3StrICmp(zLeft, "create_sqlite_statement_table")==0 ){ - extern int sqlite3CreateStatementsTable(Parse*); - sqlite3CreateStatementsTable(pParse); - }else -#endif - - {} - - if( v ){ - /* Code an OP_Expire at the end of each PRAGMA program to cause - ** the VDBE implementing the pragma to expire. Most (all?) pragmas - ** are only valid for a single execution. - */ - sqlite3VdbeAddOp(v, OP_Expire, 1, 0); - } -pragma_out: - sqliteFree(zLeft); - sqliteFree(zRight); -} - -#endif /* SQLITE_OMIT_PRAGMA || SQLITE_OMIT_PARSER */ diff --git a/ext/pdo_sqlite/sqlite/src/prepare.c b/ext/pdo_sqlite/sqlite/src/prepare.c deleted file mode 100644 index ad7c71278916b..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/prepare.c +++ /dev/null @@ -1,540 +0,0 @@ -/* -** 2005 May 25 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_prepare() -** interface, and routines that contribute to loading the database schema -** from disk. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> - -/* -** Fill the InitData structure with an error message that indicates -** that the database is corrupt. -*/ -static void corruptSchema(InitData *pData, const char *zExtra){ - if( !sqlite3_malloc_failed ){ - sqlite3SetString(pData->pzErrMsg, "malformed database schema", - zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); - } -} - -/* -** This is the callback routine for the code that initializes the -** database. See sqlite3Init() below for additional information. -** This routine is also called from the OP_ParseSchema opcode of the VDBE. -** -** Each callback contains the following information: -** -** argv[0] = name of thing being created -** argv[1] = root page number for table or index. NULL for trigger or view. -** argv[2] = SQL text for the CREATE statement. -** argv[3] = "1" for temporary files, "0" for main database, "2" or more -** for auxiliary database files. -** -*/ -int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){ - InitData *pData = (InitData*)pInit; - sqlite3 *db = pData->db; - int iDb; - - assert( argc==4 ); - if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ - if( argv[1]==0 || argv[3]==0 ){ - corruptSchema(pData, 0); - return 1; - } - iDb = atoi(argv[3]); - assert( iDb>=0 && iDb<db->nDb ); - if( argv[2] && argv[2][0] ){ - /* Call the parser to process a CREATE TABLE, INDEX or VIEW. - ** But because db->init.busy is set to 1, no VDBE code is generated - ** or executed. All the parser does is build the internal data - ** structures that describe the table, index, or view. - */ - char *zErr; - int rc; - assert( db->init.busy ); - db->init.iDb = iDb; - db->init.newTnum = atoi(argv[1]); - rc = sqlite3_exec(db, argv[2], 0, 0, &zErr); - db->init.iDb = 0; - if( SQLITE_OK!=rc ){ - corruptSchema(pData, zErr); - sqlite3_free(zErr); - return rc; - } - }else{ - /* If the SQL column is blank it means this is an index that - ** was created to be the PRIMARY KEY or to fulfill a UNIQUE - ** constraint for a CREATE TABLE. The index should have already - ** been created when we processed the CREATE TABLE. All we have - ** to do here is record the root page number for that index. - */ - Index *pIndex; - pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zName); - if( pIndex==0 || pIndex->tnum!=0 ){ - /* This can occur if there exists an index on a TEMP table which - ** has the same name as another index on a permanent index. Since - ** the permanent table is hidden by the TEMP table, we can also - ** safely ignore the index on the permanent table. - */ - /* Do Nothing */; - }else{ - pIndex->tnum = atoi(argv[1]); - } - } - return 0; -} - -/* -** Attempt to read the database schema and initialize internal -** data structures for a single database file. The index of the -** database file is given by iDb. iDb==0 is used for the main -** database. iDb==1 should never be used. iDb>=2 is used for -** auxiliary databases. Return one of the SQLITE_ error codes to -** indicate success or failure. -*/ -static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ - int rc; - BtCursor *curMain; - int size; - Table *pTab; - char const *azArg[5]; - char zDbNum[30]; - int meta[10]; - InitData initData; - char const *zMasterSchema; - char const *zMasterName = SCHEMA_TABLE(iDb); - - /* - ** The master database table has a structure like this - */ - static const char master_schema[] = - "CREATE TABLE sqlite_master(\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")" - ; -#ifndef SQLITE_OMIT_TEMPDB - static const char temp_master_schema[] = - "CREATE TEMP TABLE sqlite_temp_master(\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")" - ; -#else - #define temp_master_schema 0 -#endif - - assert( iDb>=0 && iDb<db->nDb ); - - /* zMasterSchema and zInitScript are set to point at the master schema - ** and initialisation script appropriate for the database being - ** initialised. zMasterName is the name of the master table. - */ - if( !OMIT_TEMPDB && iDb==1 ){ - zMasterSchema = temp_master_schema; - }else{ - zMasterSchema = master_schema; - } - zMasterName = SCHEMA_TABLE(iDb); - - /* Construct the schema tables. */ - sqlite3SafetyOff(db); - azArg[0] = zMasterName; - azArg[1] = "1"; - azArg[2] = zMasterSchema; - sprintf(zDbNum, "%d", iDb); - azArg[3] = zDbNum; - azArg[4] = 0; - initData.db = db; - initData.pzErrMsg = pzErrMsg; - rc = sqlite3InitCallback(&initData, 4, (char **)azArg, 0); - if( rc!=SQLITE_OK ){ - sqlite3SafetyOn(db); - return rc; - } - pTab = sqlite3FindTable(db, zMasterName, db->aDb[iDb].zName); - if( pTab ){ - pTab->readOnly = 1; - } - sqlite3SafetyOn(db); - - /* Create a cursor to hold the database open - */ - if( db->aDb[iDb].pBt==0 ){ - if( !OMIT_TEMPDB && iDb==1 ) DbSetProperty(db, 1, DB_SchemaLoaded); - return SQLITE_OK; - } - rc = sqlite3BtreeCursor(db->aDb[iDb].pBt, MASTER_ROOT, 0, 0, 0, &curMain); - if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){ - sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0); - return rc; - } - - /* Get the database meta information. - ** - ** Meta values are as follows: - ** meta[0] Schema cookie. Changes with each schema change. - ** meta[1] File format of schema layer. - ** meta[2] Size of the page cache. - ** meta[3] Use freelist if 0. Autovacuum if greater than zero. - ** meta[4] Db text encoding. 1:UTF-8 3:UTF-16 LE 4:UTF-16 BE - ** meta[5] The user cookie. Used by the application. - ** meta[6] - ** meta[7] - ** meta[8] - ** meta[9] - ** - ** Note: The hash defined SQLITE_UTF* symbols in sqliteInt.h correspond to - ** the possible values of meta[4]. - */ - if( rc==SQLITE_OK ){ - int i; - for(i=0; rc==SQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){ - rc = sqlite3BtreeGetMeta(db->aDb[iDb].pBt, i+1, (u32 *)&meta[i]); - } - if( rc ){ - sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0); - sqlite3BtreeCloseCursor(curMain); - return rc; - } - }else{ - memset(meta, 0, sizeof(meta)); - } - db->aDb[iDb].schema_cookie = meta[0]; - - /* If opening a non-empty database, check the text encoding. For the - ** main database, set sqlite3.enc to the encoding of the main database. - ** For an attached db, it is an error if the encoding is not the same - ** as sqlite3.enc. - */ - if( meta[4] ){ /* text encoding */ - if( iDb==0 ){ - /* If opening the main database, set db->enc. */ - db->enc = (u8)meta[4]; - db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0); - }else{ - /* If opening an attached database, the encoding much match db->enc */ - if( meta[4]!=db->enc ){ - sqlite3BtreeCloseCursor(curMain); - sqlite3SetString(pzErrMsg, "attached databases must use the same" - " text encoding as main database", (char*)0); - return SQLITE_ERROR; - } - } - } - - size = meta[2]; - if( size==0 ){ size = MAX_PAGES; } - db->aDb[iDb].cache_size = size; - - if( iDb==0 ){ - db->file_format = meta[1]; - if( db->file_format==0 ){ - /* This happens if the database was initially empty */ - db->file_format = 1; - } - - if( db->file_format==2 || db->file_format==3 ){ - /* File format 2 is treated exactly as file format 1. New - ** databases are created with file format 1. - */ - db->file_format = 1; - } - } - - /* - ** file_format==1 Version 3.0.0. - ** file_format==2 Version 3.1.3. - ** file_format==3 Version 3.1.4. - ** - ** Version 3.0 can only use files with file_format==1. Version 3.1.3 - ** can read and write files with file_format==1 or file_format==2. - ** Version 3.1.4 can read and write file formats 1, 2 and 3. - */ - if( meta[1]>3 ){ - sqlite3BtreeCloseCursor(curMain); - sqlite3SetString(pzErrMsg, "unsupported file format", (char*)0); - return SQLITE_ERROR; - } - - sqlite3BtreeSetCacheSize(db->aDb[iDb].pBt, db->aDb[iDb].cache_size); - - /* Read the schema information out of the schema tables - */ - assert( db->init.busy ); - if( rc==SQLITE_EMPTY ){ - /* For an empty database, there is nothing to read */ - rc = SQLITE_OK; - }else{ - char *zSql; - zSql = sqlite3MPrintf( - "SELECT name, rootpage, sql, '%s' FROM '%q'.%s", - zDbNum, db->aDb[iDb].zName, zMasterName); - sqlite3SafetyOff(db); - rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0); - sqlite3SafetyOn(db); - sqliteFree(zSql); -#ifndef SQLITE_OMIT_ANALYZE - if( rc==SQLITE_OK ){ - sqlite3AnalysisLoad(db, iDb); - } -#endif - sqlite3BtreeCloseCursor(curMain); - } - if( sqlite3_malloc_failed ){ - sqlite3SetString(pzErrMsg, "out of memory", (char*)0); - rc = SQLITE_NOMEM; - sqlite3ResetInternalSchema(db, 0); - } - if( rc==SQLITE_OK ){ - DbSetProperty(db, iDb, DB_SchemaLoaded); - }else{ - sqlite3ResetInternalSchema(db, iDb); - } - return rc; -} - -/* -** Initialize all database files - the main database file, the file -** used to store temporary tables, and any additional database files -** created using ATTACH statements. Return a success code. If an -** error occurs, write an error message into *pzErrMsg. -** -** After the database is initialized, the SQLITE_Initialized -** bit is set in the flags field of the sqlite structure. -*/ -int sqlite3Init(sqlite3 *db, char **pzErrMsg){ - int i, rc; - - if( db->init.busy ) return SQLITE_OK; - assert( (db->flags & SQLITE_Initialized)==0 ); - rc = SQLITE_OK; - db->init.busy = 1; - for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ - if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; - rc = sqlite3InitOne(db, i, pzErrMsg); - if( rc ){ - sqlite3ResetInternalSchema(db, i); - } - } - - /* Once all the other databases have been initialised, load the schema - ** for the TEMP database. This is loaded last, as the TEMP database - ** schema may contain references to objects in other databases. - */ -#ifndef SQLITE_OMIT_TEMPDB - if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ - rc = sqlite3InitOne(db, 1, pzErrMsg); - if( rc ){ - sqlite3ResetInternalSchema(db, 1); - } - } -#endif - - db->init.busy = 0; - if( rc==SQLITE_OK ){ - db->flags |= SQLITE_Initialized; - sqlite3CommitInternalChanges(db); - } - - if( rc!=SQLITE_OK ){ - db->flags &= ~SQLITE_Initialized; - } - return rc; -} - -/* -** This routine is a no-op if the database schema is already initialised. -** Otherwise, the schema is loaded. An error code is returned. -*/ -int sqlite3ReadSchema(Parse *pParse){ - int rc = SQLITE_OK; - sqlite3 *db = pParse->db; - if( !db->init.busy ){ - if( (db->flags & SQLITE_Initialized)==0 ){ - rc = sqlite3Init(db, &pParse->zErrMsg); - } - } - assert( rc!=SQLITE_OK || (db->flags & SQLITE_Initialized) || db->init.busy ); - if( rc!=SQLITE_OK ){ - pParse->rc = rc; - pParse->nErr++; - } - return rc; -} - - -/* -** Check schema cookies in all databases. If any cookie is out -** of date, return 0. If all schema cookies are current, return 1. -*/ -static int schemaIsValid(sqlite3 *db){ - int iDb; - int rc; - BtCursor *curTemp; - int cookie; - int allOk = 1; - - for(iDb=0; allOk && iDb<db->nDb; iDb++){ - Btree *pBt; - pBt = db->aDb[iDb].pBt; - if( pBt==0 ) continue; - rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, 0, &curTemp); - if( rc==SQLITE_OK ){ - rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&cookie); - if( rc==SQLITE_OK && cookie!=db->aDb[iDb].schema_cookie ){ - allOk = 0; - } - sqlite3BtreeCloseCursor(curTemp); - } - } - return allOk; -} - -/* -** Compile the UTF-8 encoded SQL statement zSql into a statement handle. -*/ -int sqlite3_prepare( - sqlite3 *db, /* Database handle. */ - const char *zSql, /* UTF-8 encoded SQL statement. */ - int nBytes, /* Length of zSql in bytes. */ - sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ - const char** pzTail /* OUT: End of parsed string */ -){ - Parse sParse; - char *zErrMsg = 0; - int rc = SQLITE_OK; - - if( sqlite3_malloc_failed ){ - return SQLITE_NOMEM; - } - - assert( ppStmt ); - *ppStmt = 0; - if( sqlite3SafetyOn(db) ){ - return SQLITE_MISUSE; - } - - memset(&sParse, 0, sizeof(sParse)); - sParse.db = db; - sqlite3RunParser(&sParse, zSql, &zErrMsg); - - if( sqlite3_malloc_failed ){ - rc = SQLITE_NOMEM; - sqlite3RollbackAll(db); - sqlite3ResetInternalSchema(db, 0); - db->flags &= ~SQLITE_InTrans; - goto prepare_out; - } - if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; - if( sParse.rc!=SQLITE_OK && sParse.checkSchema && !schemaIsValid(db) ){ - sParse.rc = SQLITE_SCHEMA; - } - if( sParse.rc==SQLITE_SCHEMA ){ - sqlite3ResetInternalSchema(db, 0); - } - if( pzTail ) *pzTail = sParse.zTail; - rc = sParse.rc; - -#ifndef SQLITE_OMIT_EXPLAIN - if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ - if( sParse.explain==2 ){ - sqlite3VdbeSetNumCols(sParse.pVdbe, 3); - sqlite3VdbeSetColName(sParse.pVdbe, 0, "order", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 1, "from", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 2, "detail", P3_STATIC); - }else{ - sqlite3VdbeSetNumCols(sParse.pVdbe, 5); - sqlite3VdbeSetColName(sParse.pVdbe, 0, "addr", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 1, "opcode", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 2, "p1", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 3, "p2", P3_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 4, "p3", P3_STATIC); - } - } -#endif - -prepare_out: - if( sqlite3SafetyOff(db) ){ - rc = SQLITE_MISUSE; - } - if( rc==SQLITE_OK ){ - *ppStmt = (sqlite3_stmt*)sParse.pVdbe; - }else if( sParse.pVdbe ){ - sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe); - } - - if( zErrMsg ){ - sqlite3Error(db, rc, "%s", zErrMsg); - sqliteFree(zErrMsg); - }else{ - sqlite3Error(db, rc, 0); - } - return rc; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Compile the UTF-16 encoded SQL statement zSql into a statement handle. -*/ -int sqlite3_prepare16( - sqlite3 *db, /* Database handle. */ - const void *zSql, /* UTF-8 encoded SQL statement. */ - int nBytes, /* Length of zSql in bytes. */ - sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ - const void **pzTail /* OUT: End of parsed string */ -){ - /* This function currently works by first transforming the UTF-16 - ** encoded string to UTF-8, then invoking sqlite3_prepare(). The - ** tricky bit is figuring out the pointer to return in *pzTail. - */ - char const *zSql8 = 0; - char const *zTail8 = 0; - int rc; - sqlite3_value *pTmp; - - if( sqlite3SafetyCheck(db) ){ - return SQLITE_MISUSE; - } - pTmp = sqlite3GetTransientValue(db); - sqlite3ValueSetStr(pTmp, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC); - zSql8 = sqlite3ValueText(pTmp, SQLITE_UTF8); - if( !zSql8 ){ - sqlite3Error(db, SQLITE_NOMEM, 0); - return SQLITE_NOMEM; - } - rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8); - - if( zTail8 && pzTail ){ - /* If sqlite3_prepare returns a tail pointer, we calculate the - ** equivalent pointer into the UTF-16 string by counting the unicode - ** characters between zSql8 and zTail8, and then returning a pointer - ** the same number of characters into the UTF-16 string. - */ - int chars_parsed = sqlite3utf8CharLen(zSql8, zTail8-zSql8); - *pzTail = (u8 *)zSql + sqlite3utf16ByteLen(zSql, chars_parsed); - } - - return rc; -} -#endif /* SQLITE_OMIT_UTF16 */ diff --git a/ext/pdo_sqlite/sqlite/src/printf.c b/ext/pdo_sqlite/sqlite/src/printf.c deleted file mode 100644 index a669eb8d44d34..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/printf.c +++ /dev/null @@ -1,866 +0,0 @@ -/* -** The "printf" code that follows dates from the 1980's. It is in -** the public domain. The original comments are included here for -** completeness. They are very out-of-date but might be useful as -** an historical reference. Most of the "enhancements" have been backed -** out so that the functionality is now the same as standard printf(). -** -************************************************************************** -** -** The following modules is an enhanced replacement for the "printf" subroutines -** found in the standard C library. The following enhancements are -** supported: -** -** + Additional functions. The standard set of "printf" functions -** includes printf, fprintf, sprintf, vprintf, vfprintf, and -** vsprintf. This module adds the following: -** -** * snprintf -- Works like sprintf, but has an extra argument -** which is the size of the buffer written to. -** -** * mprintf -- Similar to sprintf. Writes output to memory -** obtained from malloc. -** -** * xprintf -- Calls a function to dispose of output. -** -** * nprintf -- No output, but returns the number of characters -** that would have been output by printf. -** -** * A v- version (ex: vsnprintf) of every function is also -** supplied. -** -** + A few extensions to the formatting notation are supported: -** -** * The "=" flag (similar to "-") causes the output to be -** be centered in the appropriately sized field. -** -** * The %b field outputs an integer in binary notation. -** -** * The %c field now accepts a precision. The character output -** is repeated by the number of times the precision specifies. -** -** * The %' field works like %c, but takes as its character the -** next character of the format string, instead of the next -** argument. For example, printf("%.78'-") prints 78 minus -** signs, the same as printf("%.78c",'-'). -** -** + When compiled using GCC on a SPARC, this version of printf is -** faster than the library printf for SUN OS 4.1. -** -** + All functions are fully reentrant. -** -*/ -#include "sqliteInt.h" - -/* -** Conversion types fall into various categories as defined by the -** following enumeration. -*/ -#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */ -#define etFLOAT 2 /* Floating point. %f */ -#define etEXP 3 /* Exponentional notation. %e and %E */ -#define etGENERIC 4 /* Floating or exponential, depending on exponent. %g */ -#define etSIZE 5 /* Return number of characters processed so far. %n */ -#define etSTRING 6 /* Strings. %s */ -#define etDYNSTRING 7 /* Dynamically allocated strings. %z */ -#define etPERCENT 8 /* Percent symbol. %% */ -#define etCHARX 9 /* Characters. %c */ -#define etERROR 10 /* Used to indicate no such conversion type */ -/* The rest are extensions, not normally found in printf() */ -#define etCHARLIT 11 /* Literal characters. %' */ -#define etSQLESCAPE 12 /* Strings with '\'' doubled. %q */ -#define etSQLESCAPE2 13 /* Strings with '\'' doubled and enclosed in '', - NULL pointers replaced by SQL NULL. %Q */ -#define etTOKEN 14 /* a pointer to a Token structure */ -#define etSRCLIST 15 /* a pointer to a SrcList */ -#define etPOINTER 16 /* The %p conversion */ - - -/* -** An "etByte" is an 8-bit unsigned value. -*/ -typedef unsigned char etByte; - -/* -** Each builtin conversion character (ex: the 'd' in "%d") is described -** by an instance of the following structure -*/ -typedef struct et_info { /* Information about each format field */ - char fmttype; /* The format field code letter */ - etByte base; /* The base for radix conversion */ - etByte flags; /* One or more of FLAG_ constants below */ - etByte type; /* Conversion paradigm */ - etByte charset; /* Offset into aDigits[] of the digits string */ - etByte prefix; /* Offset into aPrefix[] of the prefix string */ -} et_info; - -/* -** Allowed values for et_info.flags -*/ -#define FLAG_SIGNED 1 /* True if the value to convert is signed */ -#define FLAG_INTERN 2 /* True if for internal use only */ -#define FLAG_STRING 4 /* Allow infinity precision */ - - -/* -** The following table is searched linearly, so it is good to put the -** most frequently used conversion types first. -*/ -static const char aDigits[] = "0123456789ABCDEF0123456789abcdef"; -static const char aPrefix[] = "-x0\000X0"; -static const et_info fmtinfo[] = { - { 'd', 10, 1, etRADIX, 0, 0 }, - { 's', 0, 4, etSTRING, 0, 0 }, - { 'g', 0, 1, etGENERIC, 30, 0 }, - { 'z', 0, 6, etDYNSTRING, 0, 0 }, - { 'q', 0, 4, etSQLESCAPE, 0, 0 }, - { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, - { 'c', 0, 0, etCHARX, 0, 0 }, - { 'o', 8, 0, etRADIX, 0, 2 }, - { 'u', 10, 0, etRADIX, 0, 0 }, - { 'x', 16, 0, etRADIX, 16, 1 }, - { 'X', 16, 0, etRADIX, 0, 4 }, - { 'f', 0, 1, etFLOAT, 0, 0 }, - { 'e', 0, 1, etEXP, 30, 0 }, - { 'E', 0, 1, etEXP, 14, 0 }, - { 'G', 0, 1, etGENERIC, 14, 0 }, - { 'i', 10, 1, etRADIX, 0, 0 }, - { 'n', 0, 0, etSIZE, 0, 0 }, - { '%', 0, 0, etPERCENT, 0, 0 }, - { 'p', 16, 0, etPOINTER, 0, 1 }, - { 'T', 0, 2, etTOKEN, 0, 0 }, - { 'S', 0, 2, etSRCLIST, 0, 0 }, -}; -#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) - -/* -** If NOFLOATINGPOINT is defined, then none of the floating point -** conversions will work. -*/ -#ifndef etNOFLOATINGPOINT -/* -** "*val" is a double such that 0.1 <= *val < 10.0 -** Return the ascii code for the leading digit of *val, then -** multiply "*val" by 10.0 to renormalize. -** -** Example: -** input: *val = 3.14159 -** output: *val = 1.4159 function return = '3' -** -** The counter *cnt is incremented each time. After counter exceeds -** 16 (the number of significant digits in a 64-bit float) '0' is -** always returned. -*/ -static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ - int digit; - LONGDOUBLE_TYPE d; - if( (*cnt)++ >= 16 ) return '0'; - digit = (int)*val; - d = digit; - digit += '0'; - *val = (*val - d)*10.0; - return digit; -} -#endif - -/* -** On machines with a small stack size, you can redefine the -** SQLITE_PRINT_BUF_SIZE to be less than 350. But beware - for -** smaller values some %f conversions may go into an infinite loop. -*/ -#ifndef SQLITE_PRINT_BUF_SIZE -# define SQLITE_PRINT_BUF_SIZE 350 -#endif -#define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */ - -/* -** The root program. All variations call this core. -** -** INPUTS: -** func This is a pointer to a function taking three arguments -** 1. A pointer to anything. Same as the "arg" parameter. -** 2. A pointer to the list of characters to be output -** (Note, this list is NOT null terminated.) -** 3. An integer number of characters to be output. -** (Note: This number might be zero.) -** -** arg This is the pointer to anything which will be passed as the -** first argument to "func". Use it for whatever you like. -** -** fmt This is the format string, as in the usual print. -** -** ap This is a pointer to a list of arguments. Same as in -** vfprint. -** -** OUTPUTS: -** The return value is the total number of characters sent to -** the function "func". Returns -1 on a error. -** -** Note that the order in which automatic variables are declared below -** seems to make a big difference in determining how fast this beast -** will run. -*/ -static int vxprintf( - void (*func)(void*,const char*,int), /* Consumer of text */ - void *arg, /* First argument to the consumer */ - int useExtended, /* Allow extended %-conversions */ - const char *fmt, /* Format string */ - va_list ap /* arguments */ -){ - int c; /* Next character in the format string */ - char *bufpt; /* Pointer to the conversion buffer */ - int precision; /* Precision of the current field */ - int length; /* Length of the field */ - int idx; /* A general purpose loop counter */ - int count; /* Total number of characters output */ - int width; /* Width of the current field */ - etByte flag_leftjustify; /* True if "-" flag is present */ - etByte flag_plussign; /* True if "+" flag is present */ - etByte flag_blanksign; /* True if " " flag is present */ - etByte flag_alternateform; /* True if "#" flag is present */ - etByte flag_altform2; /* True if "!" flag is present */ - etByte flag_zeropad; /* True if field width constant starts with zero */ - etByte flag_long; /* True if "l" flag is present */ - etByte flag_longlong; /* True if the "ll" flag is present */ - etByte done; /* Loop termination flag */ - UINT64_TYPE longvalue; /* Value for integer types */ - LONGDOUBLE_TYPE realvalue; /* Value for real types */ - const et_info *infop; /* Pointer to the appropriate info structure */ - char buf[etBUFSIZE]; /* Conversion buffer */ - char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ - etByte errorflag = 0; /* True if an error is encountered */ - etByte xtype; /* Conversion paradigm */ - char *zExtra; /* Extra memory used for etTCLESCAPE conversions */ - static const char spaces[] = - " "; -#define etSPACESIZE (sizeof(spaces)-1) -#ifndef etNOFLOATINGPOINT - int exp, e2; /* exponent of real numbers */ - double rounder; /* Used for rounding floating point values */ - etByte flag_dp; /* True if decimal point should be shown */ - etByte flag_rtz; /* True if trailing zeros should be removed */ - etByte flag_exp; /* True to force display of the exponent */ - int nsd; /* Number of significant digits returned */ -#endif - - func(arg,"",0); - count = length = 0; - bufpt = 0; - for(; (c=(*fmt))!=0; ++fmt){ - if( c!='%' ){ - int amt; - bufpt = (char *)fmt; - amt = 1; - while( (c=(*++fmt))!='%' && c!=0 ) amt++; - (*func)(arg,bufpt,amt); - count += amt; - if( c==0 ) break; - } - if( (c=(*++fmt))==0 ){ - errorflag = 1; - (*func)(arg,"%",1); - count++; - break; - } - /* Find out what flags are present */ - flag_leftjustify = flag_plussign = flag_blanksign = - flag_alternateform = flag_altform2 = flag_zeropad = 0; - done = 0; - do{ - switch( c ){ - case '-': flag_leftjustify = 1; break; - case '+': flag_plussign = 1; break; - case ' ': flag_blanksign = 1; break; - case '#': flag_alternateform = 1; break; - case '!': flag_altform2 = 1; break; - case '0': flag_zeropad = 1; break; - default: done = 1; break; - } - }while( !done && (c=(*++fmt))!=0 ); - /* Get the field width */ - width = 0; - if( c=='*' ){ - width = va_arg(ap,int); - if( width<0 ){ - flag_leftjustify = 1; - width = -width; - } - c = *++fmt; - }else{ - while( c>='0' && c<='9' ){ - width = width*10 + c - '0'; - c = *++fmt; - } - } - if( width > etBUFSIZE-10 ){ - width = etBUFSIZE-10; - } - /* Get the precision */ - if( c=='.' ){ - precision = 0; - c = *++fmt; - if( c=='*' ){ - precision = va_arg(ap,int); - if( precision<0 ) precision = -precision; - c = *++fmt; - }else{ - while( c>='0' && c<='9' ){ - precision = precision*10 + c - '0'; - c = *++fmt; - } - } - }else{ - precision = -1; - } - /* Get the conversion type modifier */ - if( c=='l' ){ - flag_long = 1; - c = *++fmt; - if( c=='l' ){ - flag_longlong = 1; - c = *++fmt; - }else{ - flag_longlong = 0; - } - }else{ - flag_long = flag_longlong = 0; - } - /* Fetch the info entry for the field */ - infop = 0; - xtype = etERROR; - for(idx=0; idx<etNINFO; idx++){ - if( c==fmtinfo[idx].fmttype ){ - infop = &fmtinfo[idx]; - if( useExtended || (infop->flags & FLAG_INTERN)==0 ){ - xtype = infop->type; - } - break; - } - } - zExtra = 0; - - /* Limit the precision to prevent overflowing buf[] during conversion */ - if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){ - precision = etBUFSIZE-40; - } - - /* - ** At this point, variables are initialized as follows: - ** - ** flag_alternateform TRUE if a '#' is present. - ** flag_altform2 TRUE if a '!' is present. - ** flag_plussign TRUE if a '+' is present. - ** flag_leftjustify TRUE if a '-' is present or if the - ** field width was negative. - ** flag_zeropad TRUE if the width began with 0. - ** flag_long TRUE if the letter 'l' (ell) prefixed - ** the conversion character. - ** flag_longlong TRUE if the letter 'll' (ell ell) prefixed - ** the conversion character. - ** flag_blanksign TRUE if a ' ' is present. - ** width The specified field width. This is - ** always non-negative. Zero is the default. - ** precision The specified precision. The default - ** is -1. - ** xtype The class of the conversion. - ** infop Pointer to the appropriate info struct. - */ - switch( xtype ){ - case etPOINTER: - flag_longlong = sizeof(char*)==sizeof(i64); - flag_long = sizeof(char*)==sizeof(long int); - /* Fall through into the next case */ - case etRADIX: - if( infop->flags & FLAG_SIGNED ){ - i64 v; - if( flag_longlong ) v = va_arg(ap,i64); - else if( flag_long ) v = va_arg(ap,long int); - else v = va_arg(ap,int); - if( v<0 ){ - longvalue = -v; - prefix = '-'; - }else{ - longvalue = v; - if( flag_plussign ) prefix = '+'; - else if( flag_blanksign ) prefix = ' '; - else prefix = 0; - } - }else{ - if( flag_longlong ) longvalue = va_arg(ap,u64); - else if( flag_long ) longvalue = va_arg(ap,unsigned long int); - else longvalue = va_arg(ap,unsigned int); - prefix = 0; - } - if( longvalue==0 ) flag_alternateform = 0; - if( flag_zeropad && precision<width-(prefix!=0) ){ - precision = width-(prefix!=0); - } - bufpt = &buf[etBUFSIZE-1]; - { - register const char *cset; /* Use registers for speed */ - register int base; - cset = &aDigits[infop->charset]; - base = infop->base; - do{ /* Convert to ascii */ - *(--bufpt) = cset[longvalue%base]; - longvalue = longvalue/base; - }while( longvalue>0 ); - } - length = &buf[etBUFSIZE-1]-bufpt; - for(idx=precision-length; idx>0; idx--){ - *(--bufpt) = '0'; /* Zero pad */ - } - if( prefix ) *(--bufpt) = prefix; /* Add sign */ - if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ - const char *pre; - char x; - pre = &aPrefix[infop->prefix]; - if( *bufpt!=pre[0] ){ - for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; - } - } - length = &buf[etBUFSIZE-1]-bufpt; - break; - case etFLOAT: - case etEXP: - case etGENERIC: - realvalue = va_arg(ap,double); -#ifndef etNOFLOATINGPOINT - if( precision<0 ) precision = 6; /* Set default precision */ - if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10; - if( realvalue<0.0 ){ - realvalue = -realvalue; - prefix = '-'; - }else{ - if( flag_plussign ) prefix = '+'; - else if( flag_blanksign ) prefix = ' '; - else prefix = 0; - } - if( xtype==etGENERIC && precision>0 ) precision--; -#if 0 - /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ - for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); -#else - /* It makes more sense to use 0.5 */ - for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1); -#endif - if( xtype==etFLOAT ) realvalue += rounder; - /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ - exp = 0; - if( realvalue>0.0 ){ - while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; } - while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; } - while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; } - while( realvalue<1e-8 && exp>=-350 ){ realvalue *= 1e8; exp-=8; } - while( realvalue<1.0 && exp>=-350 ){ realvalue *= 10.0; exp--; } - if( exp>350 || exp<-350 ){ - bufpt = "NaN"; - length = 3; - break; - } - } - bufpt = buf; - /* - ** If the field type is etGENERIC, then convert to either etEXP - ** or etFLOAT, as appropriate. - */ - flag_exp = xtype==etEXP; - if( xtype!=etFLOAT ){ - realvalue += rounder; - if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } - } - if( xtype==etGENERIC ){ - flag_rtz = !flag_alternateform; - if( exp<-4 || exp>precision ){ - xtype = etEXP; - }else{ - precision = precision - exp; - xtype = etFLOAT; - } - }else{ - flag_rtz = 0; - } - if( xtype==etEXP ){ - e2 = 0; - }else{ - e2 = exp; - } - nsd = 0; - flag_dp = (precision>0) | flag_alternateform | flag_altform2; - /* The sign in front of the number */ - if( prefix ){ - *(bufpt++) = prefix; - } - /* Digits prior to the decimal point */ - if( e2<0 ){ - *(bufpt++) = '0'; - }else{ - for(; e2>=0; e2--){ - *(bufpt++) = et_getdigit(&realvalue,&nsd); - } - } - /* The decimal point */ - if( flag_dp ){ - *(bufpt++) = '.'; - } - /* "0" digits after the decimal point but before the first - ** significant digit of the number */ - for(e2++; e2<0 && precision>0; precision--, e2++){ - *(bufpt++) = '0'; - } - /* Significant digits after the decimal point */ - while( (precision--)>0 ){ - *(bufpt++) = et_getdigit(&realvalue,&nsd); - } - /* Remove trailing zeros and the "." if no digits follow the "." */ - if( flag_rtz && flag_dp ){ - while( bufpt[-1]=='0' ) *(--bufpt) = 0; - assert( bufpt>buf ); - if( bufpt[-1]=='.' ){ - if( flag_altform2 ){ - *(bufpt++) = '0'; - }else{ - *(--bufpt) = 0; - } - } - } - /* Add the "eNNN" suffix */ - if( flag_exp || (xtype==etEXP && exp) ){ - *(bufpt++) = aDigits[infop->charset]; - if( exp<0 ){ - *(bufpt++) = '-'; exp = -exp; - }else{ - *(bufpt++) = '+'; - } - if( exp>=100 ){ - *(bufpt++) = (exp/100)+'0'; /* 100's digit */ - exp %= 100; - } - *(bufpt++) = exp/10+'0'; /* 10's digit */ - *(bufpt++) = exp%10+'0'; /* 1's digit */ - } - *bufpt = 0; - - /* The converted number is in buf[] and zero terminated. Output it. - ** Note that the number is in the usual order, not reversed as with - ** integer conversions. */ - length = bufpt-buf; - bufpt = buf; - - /* Special case: Add leading zeros if the flag_zeropad flag is - ** set and we are not left justified */ - if( flag_zeropad && !flag_leftjustify && length < width){ - int i; - int nPad = width - length; - for(i=width; i>=nPad; i--){ - bufpt[i] = bufpt[i-nPad]; - } - i = prefix!=0; - while( nPad-- ) bufpt[i++] = '0'; - length = width; - } -#endif - break; - case etSIZE: - *(va_arg(ap,int*)) = count; - length = width = 0; - break; - case etPERCENT: - buf[0] = '%'; - bufpt = buf; - length = 1; - break; - case etCHARLIT: - case etCHARX: - c = buf[0] = (xtype==etCHARX ? va_arg(ap,int) : *++fmt); - if( precision>=0 ){ - for(idx=1; idx<precision; idx++) buf[idx] = c; - length = precision; - }else{ - length =1; - } - bufpt = buf; - break; - case etSTRING: - case etDYNSTRING: - bufpt = va_arg(ap,char*); - if( bufpt==0 ){ - bufpt = ""; - }else if( xtype==etDYNSTRING ){ - zExtra = bufpt; - } - length = strlen(bufpt); - if( precision>=0 && precision<length ) length = precision; - break; - case etSQLESCAPE: - case etSQLESCAPE2: { - int i, j, n, c, isnull; - int needQuote; - char *arg = va_arg(ap,char*); - isnull = arg==0; - if( isnull ) arg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); - for(i=n=0; (c=arg[i])!=0; i++){ - if( c=='\'' ) n++; - } - needQuote = !isnull && xtype==etSQLESCAPE2; - n += i + 1 + needQuote*2; - if( n>etBUFSIZE ){ - bufpt = zExtra = sqliteMalloc( n ); - if( bufpt==0 ) return -1; - }else{ - bufpt = buf; - } - j = 0; - if( needQuote ) bufpt[j++] = '\''; - for(i=0; (c=arg[i])!=0; i++){ - bufpt[j++] = c; - if( c=='\'' ) bufpt[j++] = c; - } - if( needQuote ) bufpt[j++] = '\''; - bufpt[j] = 0; - length = j; - if( precision>=0 && precision<length ) length = precision; - break; - } - case etTOKEN: { - Token *pToken = va_arg(ap, Token*); - if( pToken && pToken->z ){ - (*func)(arg, pToken->z, pToken->n); - } - length = width = 0; - break; - } - case etSRCLIST: { - SrcList *pSrc = va_arg(ap, SrcList*); - int k = va_arg(ap, int); - struct SrcList_item *pItem = &pSrc->a[k]; - assert( k>=0 && k<pSrc->nSrc ); - if( pItem->zDatabase && pItem->zDatabase[0] ){ - (*func)(arg, pItem->zDatabase, strlen(pItem->zDatabase)); - (*func)(arg, ".", 1); - } - (*func)(arg, pItem->zName, strlen(pItem->zName)); - length = width = 0; - break; - } - case etERROR: - buf[0] = '%'; - buf[1] = c; - errorflag = 0; - idx = 1+(c!=0); - (*func)(arg,"%",idx); - count += idx; - if( c==0 ) fmt--; - break; - }/* End switch over the format type */ - /* - ** The text of the conversion is pointed to by "bufpt" and is - ** "length" characters long. The field width is "width". Do - ** the output. - */ - if( !flag_leftjustify ){ - register int nspace; - nspace = width-length; - if( nspace>0 ){ - count += nspace; - while( nspace>=etSPACESIZE ){ - (*func)(arg,spaces,etSPACESIZE); - nspace -= etSPACESIZE; - } - if( nspace>0 ) (*func)(arg,spaces,nspace); - } - } - if( length>0 ){ - (*func)(arg,bufpt,length); - count += length; - } - if( flag_leftjustify ){ - register int nspace; - nspace = width-length; - if( nspace>0 ){ - count += nspace; - while( nspace>=etSPACESIZE ){ - (*func)(arg,spaces,etSPACESIZE); - nspace -= etSPACESIZE; - } - if( nspace>0 ) (*func)(arg,spaces,nspace); - } - } - if( zExtra ){ - sqliteFree(zExtra); - } - }/* End for loop over the format string */ - return errorflag ? -1 : count; -} /* End of function */ - - -/* This structure is used to store state information about the -** write to memory that is currently in progress. -*/ -struct sgMprintf { - char *zBase; /* A base allocation */ - char *zText; /* The string collected so far */ - int nChar; /* Length of the string so far */ - int nTotal; /* Output size if unconstrained */ - int nAlloc; /* Amount of space allocated in zText */ - void *(*xRealloc)(void*,int); /* Function used to realloc memory */ -}; - -/* -** This function implements the callback from vxprintf. -** -** This routine add nNewChar characters of text in zNewText to -** the sgMprintf structure pointed to by "arg". -*/ -static void mout(void *arg, const char *zNewText, int nNewChar){ - struct sgMprintf *pM = (struct sgMprintf*)arg; - pM->nTotal += nNewChar; - if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ - if( pM->xRealloc==0 ){ - nNewChar = pM->nAlloc - pM->nChar - 1; - }else{ - pM->nAlloc = pM->nChar + nNewChar*2 + 1; - if( pM->zText==pM->zBase ){ - pM->zText = pM->xRealloc(0, pM->nAlloc); - if( pM->zText && pM->nChar ){ - memcpy(pM->zText, pM->zBase, pM->nChar); - } - }else{ - char *zNew; - zNew = pM->xRealloc(pM->zText, pM->nAlloc); - if( zNew ){ - pM->zText = zNew; - } - } - } - } - if( pM->zText ){ - if( nNewChar>0 ){ - memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); - pM->nChar += nNewChar; - } - pM->zText[pM->nChar] = 0; - } -} - -/* -** This routine is a wrapper around xprintf() that invokes mout() as -** the consumer. -*/ -static char *base_vprintf( - void *(*xRealloc)(void*,int), /* Routine to realloc memory. May be NULL */ - int useInternal, /* Use internal %-conversions if true */ - char *zInitBuf, /* Initially write here, before mallocing */ - int nInitBuf, /* Size of zInitBuf[] */ - const char *zFormat, /* format string */ - va_list ap /* arguments */ -){ - struct sgMprintf sM; - sM.zBase = sM.zText = zInitBuf; - sM.nChar = sM.nTotal = 0; - sM.nAlloc = nInitBuf; - sM.xRealloc = xRealloc; - vxprintf(mout, &sM, useInternal, zFormat, ap); - if( xRealloc ){ - if( sM.zText==sM.zBase ){ - sM.zText = xRealloc(0, sM.nChar+1); - if( sM.zText ){ - memcpy(sM.zText, sM.zBase, sM.nChar+1); - } - }else if( sM.nAlloc>sM.nChar+10 ){ - char *zNew = xRealloc(sM.zText, sM.nChar+1); - if( zNew ){ - sM.zText = zNew; - } - } - } - return sM.zText; -} - -/* -** Realloc that is a real function, not a macro. -*/ -static void *printf_realloc(void *old, int size){ - return sqliteRealloc(old,size); -} - -/* -** Print into memory obtained from sqliteMalloc(). Use the internal -** %-conversion extensions. -*/ -char *sqlite3VMPrintf(const char *zFormat, va_list ap){ - char zBase[SQLITE_PRINT_BUF_SIZE]; - return base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); -} - -/* -** Print into memory obtained from sqliteMalloc(). Use the internal -** %-conversion extensions. -*/ -char *sqlite3MPrintf(const char *zFormat, ...){ - va_list ap; - char *z; - char zBase[SQLITE_PRINT_BUF_SIZE]; - va_start(ap, zFormat); - z = base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); - va_end(ap); - return z; -} - -/* -** Print into memory obtained from malloc(). Do not use the internal -** %-conversion extensions. This routine is for use by external users. -*/ -char *sqlite3_mprintf(const char *zFormat, ...){ - va_list ap; - char *z; - char zBuf[200]; - - va_start(ap,zFormat); - z = base_vprintf((void*(*)(void*,int))realloc, 0, - zBuf, sizeof(zBuf), zFormat, ap); - va_end(ap); - return z; -} - -/* This is the varargs version of sqlite3_mprintf. -*/ -char *sqlite3_vmprintf(const char *zFormat, va_list ap){ - char zBuf[200]; - return base_vprintf((void*(*)(void*,int))realloc, 0, - zBuf, sizeof(zBuf), zFormat, ap); -} - -/* -** sqlite3_snprintf() works like snprintf() except that it ignores the -** current locale settings. This is important for SQLite because we -** are not able to use a "," as the decimal point in place of "." as -** specified by some locales. -*/ -char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ - char *z; - va_list ap; - - va_start(ap,zFormat); - z = base_vprintf(0, 0, zBuf, n, zFormat, ap); - va_end(ap); - return z; -} - -#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) -/* -** A version of printf() that understands %lld. Used for debugging. -** The printf() built into some versions of windows does not understand %lld -** and segfaults if you give it a long long int. -*/ -void sqlite3DebugPrintf(const char *zFormat, ...){ - extern int getpid(void); - va_list ap; - char zBuf[500]; - va_start(ap, zFormat); - base_vprintf(0, 0, zBuf, sizeof(zBuf), zFormat, ap); - va_end(ap); - fprintf(stdout,"%d: %s", getpid(), zBuf); - fflush(stdout); -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/random.c b/ext/pdo_sqlite/sqlite/src/random.c deleted file mode 100644 index 51d5d72e77827..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/random.c +++ /dev/null @@ -1,100 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code to implement a pseudo-random number -** generator (PRNG) for SQLite. -** -** Random numbers are used by some of the database backends in order -** to generate random integer keys for tables or random filenames. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" - - -/* -** Get a single 8-bit random value from the RC4 PRNG. The Mutex -** must be held while executing this routine. -** -** Why not just use a library random generator like lrand48() for this? -** Because the OP_NewRowid opcode in the VDBE depends on having a very -** good source of random numbers. The lrand48() library function may -** well be good enough. But maybe not. Or maybe lrand48() has some -** subtle problems on some systems that could cause problems. It is hard -** to know. To minimize the risk of problems due to bad lrand48() -** implementations, SQLite uses this random number generator based -** on RC4, which we know works very well. -** -** (Later): Actually, OP_NewRowid does not depend on a good source of -** randomness any more. But we will leave this code in all the same. -*/ -static int randomByte(){ - unsigned char t; - - /* All threads share a single random number generator. - ** This structure is the current state of the generator. - */ - static struct { - unsigned char isInit; /* True if initialized */ - unsigned char i, j; /* State variables */ - unsigned char s[256]; /* State variables */ - } prng; - - /* Initialize the state of the random number generator once, - ** the first time this routine is called. The seed value does - ** not need to contain a lot of randomness since we are not - ** trying to do secure encryption or anything like that... - ** - ** Nothing in this file or anywhere else in SQLite does any kind of - ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random - ** number generator) not as an encryption device. - */ - if( !prng.isInit ){ - int i; - char k[256]; - prng.j = 0; - prng.i = 0; - sqlite3OsRandomSeed(k); - for(i=0; i<256; i++){ - prng.s[i] = i; - } - for(i=0; i<256; i++){ - prng.j += prng.s[i] + k[i]; - t = prng.s[prng.j]; - prng.s[prng.j] = prng.s[i]; - prng.s[i] = t; - } - prng.isInit = 1; - } - - /* Generate and return single random byte - */ - prng.i++; - t = prng.s[prng.i]; - prng.j += t; - prng.s[prng.i] = prng.s[prng.j]; - prng.s[prng.j] = t; - t += prng.s[prng.i]; - return prng.s[t]; -} - -/* -** Return N random bytes. -*/ -void sqlite3Randomness(int N, void *pBuf){ - unsigned char *zBuf = pBuf; - sqlite3OsEnterMutex(); - while( N-- ){ - *(zBuf++) = randomByte(); - } - sqlite3OsLeaveMutex(); -} diff --git a/ext/pdo_sqlite/sqlite/src/select.c b/ext/pdo_sqlite/sqlite/src/select.c deleted file mode 100644 index 8a51208d79c61..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/select.c +++ /dev/null @@ -1,3127 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** to handle SELECT statements in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" - - -/* -** Allocate a new Select structure and return a pointer to that -** structure. -*/ -Select *sqlite3SelectNew( - ExprList *pEList, /* which columns to include in the result */ - SrcList *pSrc, /* the FROM clause -- which tables to scan */ - Expr *pWhere, /* the WHERE clause */ - ExprList *pGroupBy, /* the GROUP BY clause */ - Expr *pHaving, /* the HAVING clause */ - ExprList *pOrderBy, /* the ORDER BY clause */ - int isDistinct, /* true if the DISTINCT keyword is present */ - Expr *pLimit, /* LIMIT value. NULL means not used */ - Expr *pOffset /* OFFSET value. NULL means no offset */ -){ - Select *pNew; - pNew = sqliteMalloc( sizeof(*pNew) ); - assert( !pOffset || pLimit ); /* Can't have OFFSET without LIMIT. */ - if( pNew==0 ){ - sqlite3ExprListDelete(pEList); - sqlite3SrcListDelete(pSrc); - sqlite3ExprDelete(pWhere); - sqlite3ExprListDelete(pGroupBy); - sqlite3ExprDelete(pHaving); - sqlite3ExprListDelete(pOrderBy); - sqlite3ExprDelete(pLimit); - sqlite3ExprDelete(pOffset); - }else{ - if( pEList==0 ){ - pEList = sqlite3ExprListAppend(0, sqlite3Expr(TK_ALL,0,0,0), 0); - } - pNew->pEList = pEList; - pNew->pSrc = pSrc; - pNew->pWhere = pWhere; - pNew->pGroupBy = pGroupBy; - pNew->pHaving = pHaving; - pNew->pOrderBy = pOrderBy; - pNew->isDistinct = isDistinct; - pNew->op = TK_SELECT; - pNew->pLimit = pLimit; - pNew->pOffset = pOffset; - pNew->iLimit = -1; - pNew->iOffset = -1; - pNew->addrOpenVirt[0] = -1; - pNew->addrOpenVirt[1] = -1; - pNew->addrOpenVirt[2] = -1; - } - return pNew; -} - -/* -** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the -** type of join. Return an integer constant that expresses that type -** in terms of the following bit values: -** -** JT_INNER -** JT_CROSS -** JT_OUTER -** JT_NATURAL -** JT_LEFT -** JT_RIGHT -** -** A full outer join is the combination of JT_LEFT and JT_RIGHT. -** -** If an illegal or unsupported join type is seen, then still return -** a join type, but put an error in the pParse structure. -*/ -int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ - int jointype = 0; - Token *apAll[3]; - Token *p; - static const struct { - const char zKeyword[8]; - u8 nChar; - u8 code; - } keywords[] = { - { "natural", 7, JT_NATURAL }, - { "left", 4, JT_LEFT|JT_OUTER }, - { "right", 5, JT_RIGHT|JT_OUTER }, - { "full", 4, JT_LEFT|JT_RIGHT|JT_OUTER }, - { "outer", 5, JT_OUTER }, - { "inner", 5, JT_INNER }, - { "cross", 5, JT_INNER|JT_CROSS }, - }; - int i, j; - apAll[0] = pA; - apAll[1] = pB; - apAll[2] = pC; - for(i=0; i<3 && apAll[i]; i++){ - p = apAll[i]; - for(j=0; j<sizeof(keywords)/sizeof(keywords[0]); j++){ - if( p->n==keywords[j].nChar - && sqlite3StrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){ - jointype |= keywords[j].code; - break; - } - } - if( j>=sizeof(keywords)/sizeof(keywords[0]) ){ - jointype |= JT_ERROR; - break; - } - } - if( - (jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) || - (jointype & JT_ERROR)!=0 - ){ - const char *zSp1 = " "; - const char *zSp2 = " "; - if( pB==0 ){ zSp1++; } - if( pC==0 ){ zSp2++; } - sqlite3ErrorMsg(pParse, "unknown or unsupported join type: " - "%T%s%T%s%T", pA, zSp1, pB, zSp2, pC); - jointype = JT_INNER; - }else if( jointype & JT_RIGHT ){ - sqlite3ErrorMsg(pParse, - "RIGHT and FULL OUTER JOINs are not currently supported"); - jointype = JT_INNER; - } - return jointype; -} - -/* -** Return the index of a column in a table. Return -1 if the column -** is not contained in the table. -*/ -static int columnIndex(Table *pTab, const char *zCol){ - int i; - for(i=0; i<pTab->nCol; i++){ - if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i; - } - return -1; -} - -/* -** Set the value of a token to a '\000'-terminated string. -*/ -static void setToken(Token *p, const char *z){ - p->z = z; - p->n = strlen(z); - p->dyn = 0; -} - -/* -** Create an expression node for an identifier with the name of zName -*/ -static Expr *createIdExpr(const char *zName){ - Token dummy; - setToken(&dummy, zName); - return sqlite3Expr(TK_ID, 0, 0, &dummy); -} - - -/* -** Add a term to the WHERE expression in *ppExpr that requires the -** zCol column to be equal in the two tables pTab1 and pTab2. -*/ -static void addWhereTerm( - const char *zCol, /* Name of the column */ - const Table *pTab1, /* First table */ - const char *zAlias1, /* Alias for first table. May be NULL */ - const Table *pTab2, /* Second table */ - const char *zAlias2, /* Alias for second table. May be NULL */ - int iRightJoinTable, /* VDBE cursor for the right table */ - Expr **ppExpr /* Add the equality term to this expression */ -){ - Expr *pE1a, *pE1b, *pE1c; - Expr *pE2a, *pE2b, *pE2c; - Expr *pE; - - pE1a = createIdExpr(zCol); - pE2a = createIdExpr(zCol); - if( zAlias1==0 ){ - zAlias1 = pTab1->zName; - } - pE1b = createIdExpr(zAlias1); - if( zAlias2==0 ){ - zAlias2 = pTab2->zName; - } - pE2b = createIdExpr(zAlias2); - pE1c = sqlite3Expr(TK_DOT, pE1b, pE1a, 0); - pE2c = sqlite3Expr(TK_DOT, pE2b, pE2a, 0); - pE = sqlite3Expr(TK_EQ, pE1c, pE2c, 0); - ExprSetProperty(pE, EP_FromJoin); - pE->iRightJoinTable = iRightJoinTable; - *ppExpr = sqlite3ExprAnd(*ppExpr, pE); -} - -/* -** Set the EP_FromJoin property on all terms of the given expression. -** And set the Expr.iRightJoinTable to iTable for every term in the -** expression. -** -** The EP_FromJoin property is used on terms of an expression to tell -** the LEFT OUTER JOIN processing logic that this term is part of the -** join restriction specified in the ON or USING clause and not a part -** of the more general WHERE clause. These terms are moved over to the -** WHERE clause during join processing but we need to remember that they -** originated in the ON or USING clause. -** -** The Expr.iRightJoinTable tells the WHERE clause processing that the -** expression depends on table iRightJoinTable even if that table is not -** explicitly mentioned in the expression. That information is needed -** for cases like this: -** -** SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5 -** -** The where clause needs to defer the handling of the t1.x=5 -** term until after the t2 loop of the join. In that way, a -** NULL t2 row will be inserted whenever t1.x!=5. If we do not -** defer the handling of t1.x=5, it will be processed immediately -** after the t1 loop and rows with t1.x!=5 will never appear in -** the output, which is incorrect. -*/ -static void setJoinExpr(Expr *p, int iTable){ - while( p ){ - ExprSetProperty(p, EP_FromJoin); - p->iRightJoinTable = iTable; - setJoinExpr(p->pLeft, iTable); - p = p->pRight; - } -} - -/* -** This routine processes the join information for a SELECT statement. -** ON and USING clauses are converted into extra terms of the WHERE clause. -** NATURAL joins also create extra WHERE clause terms. -** -** The terms of a FROM clause are contained in the Select.pSrc structure. -** The left most table is the first entry in Select.pSrc. The right-most -** table is the last entry. The join operator is held in the entry to -** the left. Thus entry 0 contains the join operator for the join between -** entries 0 and 1. Any ON or USING clauses associated with the join are -** also attached to the left entry. -** -** This routine returns the number of errors encountered. -*/ -static int sqliteProcessJoin(Parse *pParse, Select *p){ - SrcList *pSrc; /* All tables in the FROM clause */ - int i, j; /* Loop counters */ - struct SrcList_item *pLeft; /* Left table being joined */ - struct SrcList_item *pRight; /* Right table being joined */ - - pSrc = p->pSrc; - pLeft = &pSrc->a[0]; - pRight = &pLeft[1]; - for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){ - Table *pLeftTab = pLeft->pTab; - Table *pRightTab = pRight->pTab; - - if( pLeftTab==0 || pRightTab==0 ) continue; - - /* When the NATURAL keyword is present, add WHERE clause terms for - ** every column that the two tables have in common. - */ - if( pLeft->jointype & JT_NATURAL ){ - if( pLeft->pOn || pLeft->pUsing ){ - sqlite3ErrorMsg(pParse, "a NATURAL join may not have " - "an ON or USING clause", 0); - return 1; - } - for(j=0; j<pLeftTab->nCol; j++){ - char *zName = pLeftTab->aCol[j].zName; - if( columnIndex(pRightTab, zName)>=0 ){ - addWhereTerm(zName, pLeftTab, pLeft->zAlias, - pRightTab, pRight->zAlias, - pRight->iCursor, &p->pWhere); - - } - } - } - - /* Disallow both ON and USING clauses in the same join - */ - if( pLeft->pOn && pLeft->pUsing ){ - sqlite3ErrorMsg(pParse, "cannot have both ON and USING " - "clauses in the same join"); - return 1; - } - - /* Add the ON clause to the end of the WHERE clause, connected by - ** an AND operator. - */ - if( pLeft->pOn ){ - setJoinExpr(pLeft->pOn, pRight->iCursor); - p->pWhere = sqlite3ExprAnd(p->pWhere, pLeft->pOn); - pLeft->pOn = 0; - } - - /* Create extra terms on the WHERE clause for each column named - ** in the USING clause. Example: If the two tables to be joined are - ** A and B and the USING clause names X, Y, and Z, then add this - ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z - ** Report an error if any column mentioned in the USING clause is - ** not contained in both tables to be joined. - */ - if( pLeft->pUsing ){ - IdList *pList = pLeft->pUsing; - for(j=0; j<pList->nId; j++){ - char *zName = pList->a[j].zName; - if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){ - sqlite3ErrorMsg(pParse, "cannot join using column %s - column " - "not present in both tables", zName); - return 1; - } - addWhereTerm(zName, pLeftTab, pLeft->zAlias, - pRightTab, pRight->zAlias, - pRight->iCursor, &p->pWhere); - } - } - } - return 0; -} - -/* -** Delete the given Select structure and all of its substructures. -*/ -void sqlite3SelectDelete(Select *p){ - if( p==0 ) return; - sqlite3ExprListDelete(p->pEList); - sqlite3SrcListDelete(p->pSrc); - sqlite3ExprDelete(p->pWhere); - sqlite3ExprListDelete(p->pGroupBy); - sqlite3ExprDelete(p->pHaving); - sqlite3ExprListDelete(p->pOrderBy); - sqlite3SelectDelete(p->pPrior); - sqlite3ExprDelete(p->pLimit); - sqlite3ExprDelete(p->pOffset); - sqliteFree(p); -} - -/* -** Insert code into "v" that will push the record on the top of the -** stack into the sorter. -*/ -static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){ - sqlite3ExprCodeExprList(pParse, pOrderBy); - sqlite3VdbeAddOp(v, OP_Sequence, pOrderBy->iECursor, 0); - sqlite3VdbeAddOp(v, OP_Pull, pOrderBy->nExpr + 1, 0); - sqlite3VdbeAddOp(v, OP_MakeRecord, pOrderBy->nExpr + 2, 0); - sqlite3VdbeAddOp(v, OP_IdxInsert, pOrderBy->iECursor, 0); -} - -/* -** Add code to implement the OFFSET and LIMIT -*/ -static void codeLimiter( - Vdbe *v, /* Generate code into this VM */ - Select *p, /* The SELECT statement being coded */ - int iContinue, /* Jump here to skip the current record */ - int iBreak, /* Jump here to end the loop */ - int nPop /* Number of times to pop stack when jumping */ -){ - if( p->iOffset>=0 && iContinue!=0 ){ - int addr = sqlite3VdbeCurrentAddr(v) + 3; - if( nPop>0 ) addr++; - sqlite3VdbeAddOp(v, OP_MemIncr, p->iOffset, 0); - sqlite3VdbeAddOp(v, OP_IfMemPos, p->iOffset, addr); - if( nPop>0 ){ - sqlite3VdbeAddOp(v, OP_Pop, nPop, 0); - } - sqlite3VdbeAddOp(v, OP_Goto, 0, iContinue); - VdbeComment((v, "# skip OFFSET records")); - } - if( p->iLimit>=0 && iBreak!=0 ){ - sqlite3VdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak); - VdbeComment((v, "# exit when LIMIT reached")); - } -} - -/* -** Add code that will check to make sure the top N elements of the -** stack are distinct. iTab is a sorting index that holds previously -** seen combinations of the N values. A new entry is made in iTab -** if the current N values are new. -** -** A jump to addrRepeat is made and the K values are popped from the -** stack if the top N elements are not distinct. -*/ -static void codeDistinct( - Vdbe *v, /* Generate code into this VM */ - int iTab, /* A sorting index used to test for distinctness */ - int addrRepeat, /* Jump to here if not distinct */ - int N, /* The top N elements of the stack must be distinct */ - int K /* Pop K elements from the stack if indistinct */ -){ -#if NULL_ALWAYS_DISTINCT - sqlite3VdbeAddOp(v, OP_IsNull, -N, sqlite3VdbeCurrentAddr(v)+6); -#endif - sqlite3VdbeAddOp(v, OP_MakeRecord, -N, 0); - sqlite3VdbeAddOp(v, OP_Distinct, iTab, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Pop, K, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, addrRepeat); - VdbeComment((v, "# skip indistinct records")); - sqlite3VdbeAddOp(v, OP_IdxInsert, iTab, 0); -} - - -/* -** This routine generates the code for the inside of the inner loop -** of a SELECT. -** -** If srcTab and nColumn are both zero, then the pEList expressions -** are evaluated in order to get the data for this row. If nColumn>0 -** then data is pulled from srcTab and pEList is used only to get the -** datatypes for each column. -*/ -static int selectInnerLoop( - Parse *pParse, /* The parser context */ - Select *p, /* The complete select statement being coded */ - ExprList *pEList, /* List of values being extracted */ - int srcTab, /* Pull data from this table */ - int nColumn, /* Number of columns in the source table */ - ExprList *pOrderBy, /* If not NULL, sort results using this key */ - int distinct, /* If >=0, make sure results are distinct */ - int eDest, /* How to dispose of the results */ - int iParm, /* An argument to the disposal method */ - int iContinue, /* Jump here to continue with next row */ - int iBreak, /* Jump here to break out of the inner loop */ - char *aff /* affinity string if eDest is SRT_Union */ -){ - Vdbe *v = pParse->pVdbe; - int i; - int hasDistinct; /* True if the DISTINCT keyword is present */ - - if( v==0 ) return 0; - assert( pEList!=0 ); - - /* If there was a LIMIT clause on the SELECT statement, then do the check - ** to see if this row should be output. - */ - hasDistinct = distinct>=0 && pEList && pEList->nExpr>0; - if( pOrderBy==0 && !hasDistinct ){ - codeLimiter(v, p, iContinue, iBreak, 0); - } - - /* Pull the requested columns. - */ - if( nColumn>0 ){ - for(i=0; i<nColumn; i++){ - sqlite3VdbeAddOp(v, OP_Column, srcTab, i); - } - }else{ - nColumn = pEList->nExpr; - sqlite3ExprCodeExprList(pParse, pEList); - } - - /* If the DISTINCT keyword was present on the SELECT statement - ** and this row has been seen before, then do not make this row - ** part of the result. - */ - if( hasDistinct ){ - int n = pEList->nExpr; - codeDistinct(v, distinct, iContinue, n, n+1); - if( pOrderBy==0 ){ - codeLimiter(v, p, iContinue, iBreak, nColumn); - } - } - - switch( eDest ){ - /* In this mode, write each query result to the key of the temporary - ** table iParm. - */ -#ifndef SQLITE_OMIT_COMPOUND_SELECT - case SRT_Union: { - sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); - if( aff ){ - sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC); - } - sqlite3VdbeAddOp(v, OP_IdxInsert, iParm, 0); - break; - } - - /* Construct a record from the query result, but instead of - ** saving that record, use it as a key to delete elements from - ** the temporary table iParm. - */ - case SRT_Except: { - int addr; - addr = sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); - sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC); - sqlite3VdbeAddOp(v, OP_NotFound, iParm, addr+3); - sqlite3VdbeAddOp(v, OP_Delete, iParm, 0); - break; - } -#endif - - /* Store the result as data using a unique key. - */ - case SRT_Table: - case SRT_VirtualTab: { - sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0); - if( pOrderBy ){ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - sqlite3VdbeAddOp(v, OP_Insert, iParm, 0); - } - break; - } - -#ifndef SQLITE_OMIT_SUBQUERY - /* If we are creating a set for an "expr IN (SELECT ...)" construct, - ** then there should be a single item on the stack. Write this - ** item into the set table with bogus data. - */ - case SRT_Set: { - int addr1 = sqlite3VdbeCurrentAddr(v); - int addr2; - - assert( nColumn==1 ); - sqlite3VdbeAddOp(v, OP_NotNull, -1, addr1+3); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0); - if( pOrderBy ){ - /* At first glance you would think we could optimize out the - ** ORDER BY in this case since the order of entries in the set - ** does not matter. But there might be a LIMIT clause, in which - ** case the order does matter */ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - char aff = (iParm>>16)&0xFF; - aff = sqlite3CompareAffinity(pEList->a[0].pExpr, aff); - sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &aff, 1); - sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0); - } - sqlite3VdbeJumpHere(v, addr2); - break; - } - - /* If this is a scalar select that is part of an expression, then - ** store the results in the appropriate memory cell and break out - ** of the scan loop. - */ - case SRT_Exists: - case SRT_Mem: { - assert( nColumn==1 ); - if( pOrderBy ){ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1); - sqlite3VdbeAddOp(v, OP_Goto, 0, iBreak); - } - break; - } -#endif /* #ifndef SQLITE_OMIT_SUBQUERY */ - - /* Send the data to the callback function or to a subroutine. In the - ** case of a subroutine, the subroutine itself is responsible for - ** popping the data from the stack. - */ - case SRT_Subroutine: - case SRT_Callback: { - if( pOrderBy ){ - sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0); - pushOntoSorter(pParse, v, pOrderBy); - }else if( eDest==SRT_Subroutine ){ - sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm); - }else{ - sqlite3VdbeAddOp(v, OP_Callback, nColumn, 0); - } - break; - } - -#if !defined(SQLITE_OMIT_TRIGGER) - /* Discard the results. This is used for SELECT statements inside - ** the body of a TRIGGER. The purpose of such selects is to call - ** user-defined functions that have side effects. We do not care - ** about the actual results of the select. - */ - default: { - assert( eDest==SRT_Discard ); - sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0); - break; - } -#endif - } - return 0; -} - -/* -** Given an expression list, generate a KeyInfo structure that records -** the collating sequence for each expression in that expression list. -** -** If the ExprList is an ORDER BY or GROUP BY clause then the resulting -** KeyInfo structure is appropriate for initializing a virtual index to -** implement that clause. If the ExprList is the result set of a SELECT -** then the KeyInfo structure is appropriate for initializing a virtual -** index to implement a DISTINCT test. -** -** Space to hold the KeyInfo structure is obtain from malloc. The calling -** function is responsible for seeing that this structure is eventually -** freed. Add the KeyInfo structure to the P3 field of an opcode using -** P3_KEYINFO_HANDOFF is the usual way of dealing with this. -*/ -static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){ - sqlite3 *db = pParse->db; - int nExpr; - KeyInfo *pInfo; - struct ExprList_item *pItem; - int i; - - nExpr = pList->nExpr; - pInfo = sqliteMalloc( sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) ); - if( pInfo ){ - pInfo->aSortOrder = (char*)&pInfo->aColl[nExpr]; - pInfo->nField = nExpr; - pInfo->enc = db->enc; - for(i=0, pItem=pList->a; i<nExpr; i++, pItem++){ - CollSeq *pColl; - pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); - if( !pColl ){ - pColl = db->pDfltColl; - } - pInfo->aColl[i] = pColl; - pInfo->aSortOrder[i] = pItem->sortOrder; - } - } - return pInfo; -} - - -/* -** If the inner loop was generated using a non-null pOrderBy argument, -** then the results were placed in a sorter. After the loop is terminated -** we need to run the sorter and output the results. The following -** routine generates the code needed to do that. -*/ -static void generateSortTail( - Parse *pParse, /* The parsing context */ - Select *p, /* The SELECT statement */ - Vdbe *v, /* Generate code into this VDBE */ - int nColumn, /* Number of columns of data */ - int eDest, /* Write the sorted results here */ - int iParm /* Optional parameter associated with eDest */ -){ - int brk = sqlite3VdbeMakeLabel(v); - int cont = sqlite3VdbeMakeLabel(v); - int addr; - int iTab; - ExprList *pOrderBy = p->pOrderBy; - - iTab = pOrderBy->iECursor; - addr = 1 + sqlite3VdbeAddOp(v, OP_Sort, iTab, brk); - codeLimiter(v, p, cont, brk, 0); - sqlite3VdbeAddOp(v, OP_Column, iTab, pOrderBy->nExpr + 1); - switch( eDest ){ - case SRT_Table: - case SRT_VirtualTab: { - sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - sqlite3VdbeAddOp(v, OP_Insert, iParm, 0); - break; - } -#ifndef SQLITE_OMIT_SUBQUERY - case SRT_Set: { - assert( nColumn==1 ); - sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Pop, 1, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, "n", P3_STATIC); - sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0); - break; - } - case SRT_Exists: - case SRT_Mem: { - assert( nColumn==1 ); - sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1); - sqlite3VdbeAddOp(v, OP_Goto, 0, brk); - break; - } -#endif - case SRT_Callback: - case SRT_Subroutine: { - int i; - sqlite3VdbeAddOp(v, OP_Integer, p->pEList->nExpr, 0); - sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - for(i=0; i<nColumn; i++){ - sqlite3VdbeAddOp(v, OP_Column, -1-i, i); - } - if( eDest==SRT_Callback ){ - sqlite3VdbeAddOp(v, OP_Callback, nColumn, 0); - }else{ - sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm); - } - sqlite3VdbeAddOp(v, OP_Pop, 2, 0); - break; - } - default: { - /* Do nothing */ - break; - } - } - sqlite3VdbeResolveLabel(v, cont); - sqlite3VdbeAddOp(v, OP_Next, iTab, addr); - sqlite3VdbeResolveLabel(v, brk); -} - -/* -** Return a pointer to a string containing the 'declaration type' of the -** expression pExpr. The string may be treated as static by the caller. -** -** If the declaration type is the exact datatype definition extracted from -** the original CREATE TABLE statement if the expression is a column. -** -** The declaration type for an expression is either TEXT, NUMERIC or ANY. -** The declaration type for a ROWID field is INTEGER. -*/ -static const char *columnType(NameContext *pNC, Expr *pExpr){ - char const *zType; - int j; - if( pExpr==0 || pNC->pSrcList==0 ) return 0; - - /* The TK_AS operator can only occur in ORDER BY, GROUP BY, HAVING, - ** and LIMIT clauses. But pExpr originates in the result set of a - ** SELECT. So pExpr can never contain an AS operator. - */ - assert( pExpr->op!=TK_AS ); - - switch( pExpr->op ){ - case TK_COLUMN: { - Table *pTab = 0; - int iCol = pExpr->iColumn; - while( pNC && !pTab ){ - SrcList *pTabList = pNC->pSrcList; - for(j=0;j<pTabList->nSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); - if( j<pTabList->nSrc ){ - pTab = pTabList->a[j].pTab; - }else{ - pNC = pNC->pNext; - } - } - if( pTab==0 ){ - /* FIX ME: - ** This can occurs if you have something like "SELECT new.x;" inside - ** a trigger. In other words, if you reference the special "new" - ** table in the result set of a select. We do not have a good way - ** to find the actual table type, so call it "TEXT". This is really - ** something of a bug, but I do not know how to fix it. - ** - ** This code does not produce the correct answer - it just prevents - ** a segfault. See ticket #1229. - */ - zType = "TEXT"; - break; - } - assert( pTab ); - if( iCol<0 ) iCol = pTab->iPKey; - assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); - if( iCol<0 ){ - zType = "INTEGER"; - }else{ - zType = pTab->aCol[iCol].zType; - } - break; - } -#ifndef SQLITE_OMIT_SUBQUERY - case TK_SELECT: { - NameContext sNC; - Select *pS = pExpr->pSelect; - sNC.pSrcList = pExpr->pSelect->pSrc; - sNC.pNext = pNC; - zType = columnType(&sNC, pS->pEList->a[0].pExpr); - break; - } -#endif - default: - zType = 0; - } - - return zType; -} - -/* -** Generate code that will tell the VDBE the declaration types of columns -** in the result set. -*/ -static void generateColumnTypes( - Parse *pParse, /* Parser context */ - SrcList *pTabList, /* List of tables */ - ExprList *pEList /* Expressions defining the result set */ -){ - Vdbe *v = pParse->pVdbe; - int i; - NameContext sNC; - sNC.pSrcList = pTabList; - for(i=0; i<pEList->nExpr; i++){ - Expr *p = pEList->a[i].pExpr; - const char *zType = columnType(&sNC, p); - if( zType==0 ) continue; - /* The vdbe must make it's own copy of the column-type, in case the - ** schema is reset before this virtual machine is deleted. - */ - sqlite3VdbeSetColName(v, i+pEList->nExpr, zType, strlen(zType)); - } -} - -/* -** Generate code that will tell the VDBE the names of columns -** in the result set. This information is used to provide the -** azCol[] values in the callback. -*/ -static void generateColumnNames( - Parse *pParse, /* Parser context */ - SrcList *pTabList, /* List of tables */ - ExprList *pEList /* Expressions defining the result set */ -){ - Vdbe *v = pParse->pVdbe; - int i, j; - sqlite3 *db = pParse->db; - int fullNames, shortNames; - -#ifndef SQLITE_OMIT_EXPLAIN - /* If this is an EXPLAIN, skip this step */ - if( pParse->explain ){ - return; - } -#endif - - assert( v!=0 ); - if( pParse->colNamesSet || v==0 || sqlite3_malloc_failed ) return; - pParse->colNamesSet = 1; - fullNames = (db->flags & SQLITE_FullColNames)!=0; - shortNames = (db->flags & SQLITE_ShortColNames)!=0; - sqlite3VdbeSetNumCols(v, pEList->nExpr); - for(i=0; i<pEList->nExpr; i++){ - Expr *p; - p = pEList->a[i].pExpr; - if( p==0 ) continue; - if( pEList->a[i].zName ){ - char *zName = pEList->a[i].zName; - sqlite3VdbeSetColName(v, i, zName, strlen(zName)); - continue; - } - if( p->op==TK_COLUMN && pTabList ){ - Table *pTab; - char *zCol; - int iCol = p->iColumn; - for(j=0; j<pTabList->nSrc && pTabList->a[j].iCursor!=p->iTable; j++){} - assert( j<pTabList->nSrc ); - pTab = pTabList->a[j].pTab; - if( iCol<0 ) iCol = pTab->iPKey; - assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); - if( iCol<0 ){ - zCol = "rowid"; - }else{ - zCol = pTab->aCol[iCol].zName; - } - if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){ - sqlite3VdbeSetColName(v, i, p->span.z, p->span.n); - }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){ - char *zName = 0; - char *zTab; - - zTab = pTabList->a[j].zAlias; - if( fullNames || zTab==0 ) zTab = pTab->zName; - sqlite3SetString(&zName, zTab, ".", zCol, 0); - sqlite3VdbeSetColName(v, i, zName, P3_DYNAMIC); - }else{ - sqlite3VdbeSetColName(v, i, zCol, strlen(zCol)); - } - }else if( p->span.z && p->span.z[0] ){ - sqlite3VdbeSetColName(v, i, p->span.z, p->span.n); - /* sqlite3VdbeCompressSpace(v, addr); */ - }else{ - char zName[30]; - assert( p->op!=TK_COLUMN || pTabList==0 ); - sprintf(zName, "column%d", i+1); - sqlite3VdbeSetColName(v, i, zName, 0); - } - } - generateColumnTypes(pParse, pTabList, pEList); -} - -#ifndef SQLITE_OMIT_COMPOUND_SELECT -/* -** Name of the connection operator, used for error messages. -*/ -static const char *selectOpName(int id){ - char *z; - switch( id ){ - case TK_ALL: z = "UNION ALL"; break; - case TK_INTERSECT: z = "INTERSECT"; break; - case TK_EXCEPT: z = "EXCEPT"; break; - default: z = "UNION"; break; - } - return z; -} -#endif /* SQLITE_OMIT_COMPOUND_SELECT */ - -/* -** Forward declaration -*/ -static int prepSelectStmt(Parse*, Select*); - -/* -** Given a SELECT statement, generate a Table structure that describes -** the result set of that SELECT. -*/ -Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){ - Table *pTab; - int i, j; - ExprList *pEList; - Column *aCol, *pCol; - - if( prepSelectStmt(pParse, pSelect) ){ - return 0; - } - if( sqlite3SelectResolve(pParse, pSelect, 0) ){ - return 0; - } - pTab = sqliteMalloc( sizeof(Table) ); - if( pTab==0 ){ - return 0; - } - pTab->nRef = 1; - pTab->zName = zTabName ? sqliteStrDup(zTabName) : 0; - pEList = pSelect->pEList; - pTab->nCol = pEList->nExpr; - assert( pTab->nCol>0 ); - pTab->aCol = aCol = sqliteMalloc( sizeof(pTab->aCol[0])*pTab->nCol ); - for(i=0, pCol=aCol; i<pTab->nCol; i++, pCol++){ - Expr *p, *pR; - char *zType; - char *zName; - char *zBasename; - int cnt; - NameContext sNC; - - /* Get an appropriate name for the column - */ - p = pEList->a[i].pExpr; - assert( p->pRight==0 || p->pRight->token.z==0 || p->pRight->token.z[0]!=0 ); - if( (zName = pEList->a[i].zName)!=0 ){ - /* If the column contains an "AS <name>" phrase, use <name> as the name */ - zName = sqliteStrDup(zName); - }else if( p->op==TK_DOT - && (pR=p->pRight)!=0 && pR->token.z && pR->token.z[0] ){ - /* For columns of the from A.B use B as the name */ - zName = sqlite3MPrintf("%T", &pR->token); - }else if( p->span.z && p->span.z[0] ){ - /* Use the original text of the column expression as its name */ - zName = sqlite3MPrintf("%T", &p->span); - }else{ - /* If all else fails, make up a name */ - zName = sqlite3MPrintf("column%d", i+1); - } - sqlite3Dequote(zName); - if( sqlite3_malloc_failed ){ - sqliteFree(zName); - sqlite3DeleteTable(0, pTab); - return 0; - } - - /* Make sure the column name is unique. If the name is not unique, - ** append a integer to the name so that it becomes unique. - */ - zBasename = zName; - for(j=cnt=0; j<i; j++){ - if( sqlite3StrICmp(aCol[j].zName, zName)==0 ){ - zName = sqlite3MPrintf("%s:%d", zBasename, ++cnt); - j = -1; - if( zName==0 ) break; - } - } - if( zBasename!=zName ){ - sqliteFree(zBasename); - } - pCol->zName = zName; - - /* Get the typename, type affinity, and collating sequence for the - ** column. - */ - memset(&sNC, 0, sizeof(sNC)); - sNC.pSrcList = pSelect->pSrc; - zType = sqliteStrDup(columnType(&sNC, p)); - pCol->zType = zType; - pCol->affinity = sqlite3ExprAffinity(p); - pCol->pColl = sqlite3ExprCollSeq(pParse, p); - if( !pCol->pColl ){ - pCol->pColl = pParse->db->pDfltColl; - } - } - pTab->iPKey = -1; - return pTab; -} - -/* -** Prepare a SELECT statement for processing by doing the following -** things: -** -** (1) Make sure VDBE cursor numbers have been assigned to every -** element of the FROM clause. -** -** (2) Fill in the pTabList->a[].pTab fields in the SrcList that -** defines FROM clause. When views appear in the FROM clause, -** fill pTabList->a[].pSelect with a copy of the SELECT statement -** that implements the view. A copy is made of the view's SELECT -** statement so that we can freely modify or delete that statement -** without worrying about messing up the presistent representation -** of the view. -** -** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword -** on joins and the ON and USING clause of joins. -** -** (4) Scan the list of columns in the result set (pEList) looking -** for instances of the "*" operator or the TABLE.* operator. -** If found, expand each "*" to be every column in every table -** and TABLE.* to be every column in TABLE. -** -** Return 0 on success. If there are problems, leave an error message -** in pParse and return non-zero. -*/ -static int prepSelectStmt(Parse *pParse, Select *p){ - int i, j, k, rc; - SrcList *pTabList; - ExprList *pEList; - Table *pTab; - struct SrcList_item *pFrom; - - if( p==0 || p->pSrc==0 || sqlite3_malloc_failed ) return 1; - pTabList = p->pSrc; - pEList = p->pEList; - - /* Make sure cursor numbers have been assigned to all entries in - ** the FROM clause of the SELECT statement. - */ - sqlite3SrcListAssignCursors(pParse, p->pSrc); - - /* Look up every table named in the FROM clause of the select. If - ** an entry of the FROM clause is a subquery instead of a table or view, - ** then create a transient table structure to describe the subquery. - */ - for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){ - if( pFrom->pTab!=0 ){ - /* This statement has already been prepared. There is no need - ** to go further. */ - assert( i==0 ); - return 0; - } - if( pFrom->zName==0 ){ -#ifndef SQLITE_OMIT_SUBQUERY - /* A sub-query in the FROM clause of a SELECT */ - assert( pFrom->pSelect!=0 ); - if( pFrom->zAlias==0 ){ - pFrom->zAlias = - sqlite3MPrintf("sqlite_subquery_%p_", (void*)pFrom->pSelect); - } - assert( pFrom->pTab==0 ); - pFrom->pTab = pTab = - sqlite3ResultSetOfSelect(pParse, pFrom->zAlias, pFrom->pSelect); - if( pTab==0 ){ - return 1; - } - /* The isTransient flag indicates that the Table structure has been - ** dynamically allocated and may be freed at any time. In other words, - ** pTab is not pointing to a persistent table structure that defines - ** part of the schema. */ - pTab->isTransient = 1; -#endif - }else{ - /* An ordinary table or view name in the FROM clause */ - assert( pFrom->pTab==0 ); - pFrom->pTab = pTab = - sqlite3LocateTable(pParse,pFrom->zName,pFrom->zDatabase); - if( pTab==0 ){ - return 1; - } - pTab->nRef++; -#ifndef SQLITE_OMIT_VIEW - if( pTab->pSelect ){ - /* We reach here if the named table is a really a view */ - if( sqlite3ViewGetColumnNames(pParse, pTab) ){ - return 1; - } - /* If pFrom->pSelect!=0 it means we are dealing with a - ** view within a view. The SELECT structure has already been - ** copied by the outer view so we can skip the copy step here - ** in the inner view. - */ - if( pFrom->pSelect==0 ){ - pFrom->pSelect = sqlite3SelectDup(pTab->pSelect); - } - } -#endif - } - } - - /* Process NATURAL keywords, and ON and USING clauses of joins. - */ - if( sqliteProcessJoin(pParse, p) ) return 1; - - /* For every "*" that occurs in the column list, insert the names of - ** all columns in all tables. And for every TABLE.* insert the names - ** of all columns in TABLE. The parser inserted a special expression - ** with the TK_ALL operator for each "*" that it found in the column list. - ** The following code just has to locate the TK_ALL expressions and expand - ** each one to the list of all columns in all tables. - ** - ** The first loop just checks to see if there are any "*" operators - ** that need expanding. - */ - for(k=0; k<pEList->nExpr; k++){ - Expr *pE = pEList->a[k].pExpr; - if( pE->op==TK_ALL ) break; - if( pE->op==TK_DOT && pE->pRight && pE->pRight->op==TK_ALL - && pE->pLeft && pE->pLeft->op==TK_ID ) break; - } - rc = 0; - if( k<pEList->nExpr ){ - /* - ** If we get here it means the result set contains one or more "*" - ** operators that need to be expanded. Loop through each expression - ** in the result set and expand them one by one. - */ - struct ExprList_item *a = pEList->a; - ExprList *pNew = 0; - int flags = pParse->db->flags; - int longNames = (flags & SQLITE_FullColNames)!=0 && - (flags & SQLITE_ShortColNames)==0; - - for(k=0; k<pEList->nExpr; k++){ - Expr *pE = a[k].pExpr; - if( pE->op!=TK_ALL && - (pE->op!=TK_DOT || pE->pRight==0 || pE->pRight->op!=TK_ALL) ){ - /* This particular expression does not need to be expanded. - */ - pNew = sqlite3ExprListAppend(pNew, a[k].pExpr, 0); - pNew->a[pNew->nExpr-1].zName = a[k].zName; - a[k].pExpr = 0; - a[k].zName = 0; - }else{ - /* This expression is a "*" or a "TABLE.*" and needs to be - ** expanded. */ - int tableSeen = 0; /* Set to 1 when TABLE matches */ - char *zTName; /* text of name of TABLE */ - if( pE->op==TK_DOT && pE->pLeft ){ - zTName = sqlite3NameFromToken(&pE->pLeft->token); - }else{ - zTName = 0; - } - for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){ - Table *pTab = pFrom->pTab; - char *zTabName = pFrom->zAlias; - if( zTabName==0 || zTabName[0]==0 ){ - zTabName = pTab->zName; - } - if( zTName && (zTabName==0 || zTabName[0]==0 || - sqlite3StrICmp(zTName, zTabName)!=0) ){ - continue; - } - tableSeen = 1; - for(j=0; j<pTab->nCol; j++){ - Expr *pExpr, *pLeft, *pRight; - char *zName = pTab->aCol[j].zName; - - if( i>0 ){ - struct SrcList_item *pLeft = &pTabList->a[i-1]; - if( (pLeft->jointype & JT_NATURAL)!=0 && - columnIndex(pLeft->pTab, zName)>=0 ){ - /* In a NATURAL join, omit the join columns from the - ** table on the right */ - continue; - } - if( sqlite3IdListIndex(pLeft->pUsing, zName)>=0 ){ - /* In a join with a USING clause, omit columns in the - ** using clause from the table on the right. */ - continue; - } - } - pRight = sqlite3Expr(TK_ID, 0, 0, 0); - if( pRight==0 ) break; - setToken(&pRight->token, zName); - if( zTabName && (longNames || pTabList->nSrc>1) ){ - pLeft = sqlite3Expr(TK_ID, 0, 0, 0); - pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0); - if( pExpr==0 ) break; - setToken(&pLeft->token, zTabName); - setToken(&pExpr->span, sqlite3MPrintf("%s.%s", zTabName, zName)); - pExpr->span.dyn = 1; - pExpr->token.z = 0; - pExpr->token.n = 0; - pExpr->token.dyn = 0; - }else{ - pExpr = pRight; - pExpr->span = pExpr->token; - } - if( longNames ){ - pNew = sqlite3ExprListAppend(pNew, pExpr, &pExpr->span); - }else{ - pNew = sqlite3ExprListAppend(pNew, pExpr, &pRight->token); - } - } - } - if( !tableSeen ){ - if( zTName ){ - sqlite3ErrorMsg(pParse, "no such table: %s", zTName); - }else{ - sqlite3ErrorMsg(pParse, "no tables specified"); - } - rc = 1; - } - sqliteFree(zTName); - } - } - sqlite3ExprListDelete(pEList); - p->pEList = pNew; - } - return rc; -} - -#ifndef SQLITE_OMIT_COMPOUND_SELECT -/* -** This routine associates entries in an ORDER BY expression list with -** columns in a result. For each ORDER BY expression, the opcode of -** the top-level node is changed to TK_COLUMN and the iColumn value of -** the top-level node is filled in with column number and the iTable -** value of the top-level node is filled with iTable parameter. -** -** If there are prior SELECT clauses, they are processed first. A match -** in an earlier SELECT takes precedence over a later SELECT. -** -** Any entry that does not match is flagged as an error. The number -** of errors is returned. -*/ -static int matchOrderbyToColumn( - Parse *pParse, /* A place to leave error messages */ - Select *pSelect, /* Match to result columns of this SELECT */ - ExprList *pOrderBy, /* The ORDER BY values to match against columns */ - int iTable, /* Insert this value in iTable */ - int mustComplete /* If TRUE all ORDER BYs must match */ -){ - int nErr = 0; - int i, j; - ExprList *pEList; - - if( pSelect==0 || pOrderBy==0 ) return 1; - if( mustComplete ){ - for(i=0; i<pOrderBy->nExpr; i++){ pOrderBy->a[i].done = 0; } - } - if( prepSelectStmt(pParse, pSelect) ){ - return 1; - } - if( pSelect->pPrior ){ - if( matchOrderbyToColumn(pParse, pSelect->pPrior, pOrderBy, iTable, 0) ){ - return 1; - } - } - pEList = pSelect->pEList; - for(i=0; i<pOrderBy->nExpr; i++){ - Expr *pE = pOrderBy->a[i].pExpr; - int iCol = -1; - if( pOrderBy->a[i].done ) continue; - if( sqlite3ExprIsInteger(pE, &iCol) ){ - if( iCol<=0 || iCol>pEList->nExpr ){ - sqlite3ErrorMsg(pParse, - "ORDER BY position %d should be between 1 and %d", - iCol, pEList->nExpr); - nErr++; - break; - } - if( !mustComplete ) continue; - iCol--; - } - for(j=0; iCol<0 && j<pEList->nExpr; j++){ - if( pEList->a[j].zName && (pE->op==TK_ID || pE->op==TK_STRING) ){ - char *zName, *zLabel; - zName = pEList->a[j].zName; - zLabel = sqlite3NameFromToken(&pE->token); - assert( zLabel!=0 ); - if( sqlite3StrICmp(zName, zLabel)==0 ){ - iCol = j; - } - sqliteFree(zLabel); - } - if( iCol<0 && sqlite3ExprCompare(pE, pEList->a[j].pExpr) ){ - iCol = j; - } - } - if( iCol>=0 ){ - pE->op = TK_COLUMN; - pE->iColumn = iCol; - pE->iTable = iTable; - pE->iAgg = -1; - pOrderBy->a[i].done = 1; - } - if( iCol<0 && mustComplete ){ - sqlite3ErrorMsg(pParse, - "ORDER BY term number %d does not match any result column", i+1); - nErr++; - break; - } - } - return nErr; -} -#endif /* #ifndef SQLITE_OMIT_COMPOUND_SELECT */ - -/* -** Get a VDBE for the given parser context. Create a new one if necessary. -** If an error occurs, return NULL and leave a message in pParse. -*/ -Vdbe *sqlite3GetVdbe(Parse *pParse){ - Vdbe *v = pParse->pVdbe; - if( v==0 ){ - v = pParse->pVdbe = sqlite3VdbeCreate(pParse->db); - } - return v; -} - -/* -** Compute the iLimit and iOffset fields of the SELECT based on the -** pLimit and pOffset expressions. nLimit and nOffset hold the expressions -** that appear in the original SQL statement after the LIMIT and OFFSET -** keywords. Or NULL if those keywords are omitted. iLimit and iOffset -** are the integer memory register numbers for counters used to compute -** the limit and offset. If there is no limit and/or offset, then -** iLimit and iOffset are negative. -** -** This routine changes the values if iLimit and iOffset only if -** a limit or offset is defined by nLimit and nOffset. iLimit and -** iOffset should have been preset to appropriate default values -** (usually but not always -1) prior to calling this routine. -** Only if nLimit>=0 or nOffset>0 do the limit registers get -** redefined. The UNION ALL operator uses this property to force -** the reuse of the same limit and offset registers across multiple -** SELECT statements. -*/ -static void computeLimitRegisters(Parse *pParse, Select *p){ - /* - ** "LIMIT -1" always shows all rows. There is some - ** contraversy about what the correct behavior should be. - ** The current implementation interprets "LIMIT 0" to mean - ** no rows. - */ - if( p->pLimit ){ - int iMem = pParse->nMem++; - Vdbe *v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - sqlite3ExprCode(pParse, p->pLimit); - sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); - sqlite3VdbeAddOp(v, OP_Negative, 0, 0); - sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1); - VdbeComment((v, "# LIMIT counter")); - p->iLimit = iMem; - } - if( p->pOffset ){ - int iMem = pParse->nMem++; - Vdbe *v = sqlite3GetVdbe(pParse); - if( v==0 ) return; - sqlite3ExprCode(pParse, p->pOffset); - sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); - sqlite3VdbeAddOp(v, OP_Negative, 0, 0); - sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1); - VdbeComment((v, "# OFFSET counter")); - p->iOffset = iMem; - } -} - -/* -** Allocate a virtual index to use for sorting. -*/ -static void createSortingIndex(Parse *pParse, Select *p, ExprList *pOrderBy){ - if( pOrderBy ){ - int addr; - assert( pOrderBy->iECursor==0 ); - pOrderBy->iECursor = pParse->nTab++; - addr = sqlite3VdbeAddOp(pParse->pVdbe, OP_OpenVirtual, - pOrderBy->iECursor, pOrderBy->nExpr+1); - assert( p->addrOpenVirt[2] == -1 ); - p->addrOpenVirt[2] = addr; - } -} - -/* -** The opcode at addr is an OP_OpenVirtual that created a sorting -** index tha we ended up not needing. This routine changes that -** opcode to OP_Noop. -*/ -static void uncreateSortingIndex(Parse *pParse, int addr){ - Vdbe *v = pParse->pVdbe; - VdbeOp *pOp = sqlite3VdbeGetOp(v, addr); - sqlite3VdbeChangeP3(v, addr, 0, 0); - pOp->opcode = OP_Noop; - pOp->p1 = 0; - pOp->p2 = 0; -} - -#ifndef SQLITE_OMIT_COMPOUND_SELECT -/* -** Return the appropriate collating sequence for the iCol-th column of -** the result set for the compound-select statement "p". Return NULL if -** the column has no default collating sequence. -** -** The collating sequence for the compound select is taken from the -** left-most term of the select that has a collating sequence. -*/ -static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){ - CollSeq *pRet; - if( p->pPrior ){ - pRet = multiSelectCollSeq(pParse, p->pPrior, iCol); - }else{ - pRet = 0; - } - if( pRet==0 ){ - pRet = sqlite3ExprCollSeq(pParse, p->pEList->a[iCol].pExpr); - } - return pRet; -} -#endif /* SQLITE_OMIT_COMPOUND_SELECT */ - -#ifndef SQLITE_OMIT_COMPOUND_SELECT -/* -** This routine is called to process a query that is really the union -** or intersection of two or more separate queries. -** -** "p" points to the right-most of the two queries. the query on the -** left is p->pPrior. The left query could also be a compound query -** in which case this routine will be called recursively. -** -** The results of the total query are to be written into a destination -** of type eDest with parameter iParm. -** -** Example 1: Consider a three-way compound SQL statement. -** -** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3 -** -** This statement is parsed up as follows: -** -** SELECT c FROM t3 -** | -** `-----> SELECT b FROM t2 -** | -** `------> SELECT a FROM t1 -** -** The arrows in the diagram above represent the Select.pPrior pointer. -** So if this routine is called with p equal to the t3 query, then -** pPrior will be the t2 query. p->op will be TK_UNION in this case. -** -** Notice that because of the way SQLite parses compound SELECTs, the -** individual selects always group from left to right. -*/ -static int multiSelect( - Parse *pParse, /* Parsing context */ - Select *p, /* The right-most of SELECTs to be coded */ - int eDest, /* \___ Store query results as specified */ - int iParm, /* / by these two parameters. */ - char *aff /* If eDest is SRT_Union, the affinity string */ -){ - int rc = SQLITE_OK; /* Success code from a subroutine */ - Select *pPrior; /* Another SELECT immediately to our left */ - Vdbe *v; /* Generate code to this VDBE */ - int nCol; /* Number of columns in the result set */ - ExprList *pOrderBy; /* The ORDER BY clause on p */ - int aSetP2[2]; /* Set P2 value of these op to number of columns */ - int nSetP2 = 0; /* Number of slots in aSetP2[] used */ - - /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only - ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT. - */ - if( p==0 || p->pPrior==0 ){ - rc = 1; - goto multi_select_end; - } - pPrior = p->pPrior; - assert( pPrior->pRightmost!=pPrior ); - assert( pPrior->pRightmost==p->pRightmost ); - if( pPrior->pOrderBy ){ - sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before", - selectOpName(p->op)); - rc = 1; - goto multi_select_end; - } - if( pPrior->pLimit ){ - sqlite3ErrorMsg(pParse,"LIMIT clause should come after %s not before", - selectOpName(p->op)); - rc = 1; - goto multi_select_end; - } - - /* Make sure we have a valid query engine. If not, create a new one. - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ){ - rc = 1; - goto multi_select_end; - } - - /* Create the destination temporary table if necessary - */ - if( eDest==SRT_VirtualTab ){ - assert( p->pEList ); - assert( nSetP2<sizeof(aSetP2)/sizeof(aSetP2[0]) ); - aSetP2[nSetP2++] = sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 0); - eDest = SRT_Table; - } - - /* Generate code for the left and right SELECT statements. - */ - pOrderBy = p->pOrderBy; - switch( p->op ){ - case TK_ALL: { - if( pOrderBy==0 ){ - assert( !pPrior->pLimit ); - pPrior->pLimit = p->pLimit; - pPrior->pOffset = p->pOffset; - rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0, aff); - if( rc ){ - goto multi_select_end; - } - p->pPrior = 0; - p->iLimit = pPrior->iLimit; - p->iOffset = pPrior->iOffset; - p->pLimit = 0; - p->pOffset = 0; - rc = sqlite3Select(pParse, p, eDest, iParm, 0, 0, 0, aff); - p->pPrior = pPrior; - if( rc ){ - goto multi_select_end; - } - break; - } - /* For UNION ALL ... ORDER BY fall through to the next case */ - } - case TK_EXCEPT: - case TK_UNION: { - int unionTab; /* Cursor number of the temporary table holding result */ - int op = 0; /* One of the SRT_ operations to apply to self */ - int priorOp; /* The SRT_ operation to apply to prior selects */ - Expr *pLimit, *pOffset; /* Saved values of p->nLimit and p->nOffset */ - int addr; - - priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union; - if( eDest==priorOp && pOrderBy==0 && !p->pLimit && !p->pOffset ){ - /* We can reuse a temporary table generated by a SELECT to our - ** right. - */ - unionTab = iParm; - }else{ - /* We will need to create our own temporary table to hold the - ** intermediate results. - */ - unionTab = pParse->nTab++; - if( pOrderBy && matchOrderbyToColumn(pParse, p, pOrderBy, unionTab,1) ){ - rc = 1; - goto multi_select_end; - } - addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, unionTab, 0); - if( priorOp==SRT_Table ){ - assert( nSetP2<sizeof(aSetP2)/sizeof(aSetP2[0]) ); - aSetP2[nSetP2++] = addr; - }else{ - assert( p->addrOpenVirt[0] == -1 ); - p->addrOpenVirt[0] = addr; - p->pRightmost->usesVirt = 1; - } - createSortingIndex(pParse, p, pOrderBy); - assert( p->pEList ); - } - - /* Code the SELECT statements to our left - */ - assert( !pPrior->pOrderBy ); - rc = sqlite3Select(pParse, pPrior, priorOp, unionTab, 0, 0, 0, aff); - if( rc ){ - goto multi_select_end; - } - - /* Code the current SELECT statement - */ - switch( p->op ){ - case TK_EXCEPT: op = SRT_Except; break; - case TK_UNION: op = SRT_Union; break; - case TK_ALL: op = SRT_Table; break; - } - p->pPrior = 0; - p->pOrderBy = 0; - p->disallowOrderBy = pOrderBy!=0; - pLimit = p->pLimit; - p->pLimit = 0; - pOffset = p->pOffset; - p->pOffset = 0; - rc = sqlite3Select(pParse, p, op, unionTab, 0, 0, 0, aff); - p->pPrior = pPrior; - p->pOrderBy = pOrderBy; - sqlite3ExprDelete(p->pLimit); - p->pLimit = pLimit; - p->pOffset = pOffset; - p->iLimit = -1; - p->iOffset = -1; - if( rc ){ - goto multi_select_end; - } - - - /* Convert the data in the temporary table into whatever form - ** it is that we currently need. - */ - if( eDest!=priorOp || unionTab!=iParm ){ - int iCont, iBreak, iStart; - assert( p->pEList ); - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, 0, p->pEList); - } - iBreak = sqlite3VdbeMakeLabel(v); - iCont = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_Rewind, unionTab, iBreak); - computeLimitRegisters(pParse, p); - iStart = sqlite3VdbeCurrentAddr(v); - rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr, - pOrderBy, -1, eDest, iParm, - iCont, iBreak, 0); - if( rc ){ - rc = 1; - goto multi_select_end; - } - sqlite3VdbeResolveLabel(v, iCont); - sqlite3VdbeAddOp(v, OP_Next, unionTab, iStart); - sqlite3VdbeResolveLabel(v, iBreak); - sqlite3VdbeAddOp(v, OP_Close, unionTab, 0); - } - break; - } - case TK_INTERSECT: { - int tab1, tab2; - int iCont, iBreak, iStart; - Expr *pLimit, *pOffset; - int addr; - - /* INTERSECT is different from the others since it requires - ** two temporary tables. Hence it has its own case. Begin - ** by allocating the tables we will need. - */ - tab1 = pParse->nTab++; - tab2 = pParse->nTab++; - if( pOrderBy && matchOrderbyToColumn(pParse,p,pOrderBy,tab1,1) ){ - rc = 1; - goto multi_select_end; - } - createSortingIndex(pParse, p, pOrderBy); - - addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab1, 0); - assert( p->addrOpenVirt[0] == -1 ); - p->addrOpenVirt[0] = addr; - p->pRightmost->usesVirt = 1; - assert( p->pEList ); - - /* Code the SELECTs to our left into temporary table "tab1". - */ - rc = sqlite3Select(pParse, pPrior, SRT_Union, tab1, 0, 0, 0, aff); - if( rc ){ - goto multi_select_end; - } - - /* Code the current SELECT into temporary table "tab2" - */ - addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab2, 0); - assert( p->addrOpenVirt[1] == -1 ); - p->addrOpenVirt[1] = addr; - p->pPrior = 0; - pLimit = p->pLimit; - p->pLimit = 0; - pOffset = p->pOffset; - p->pOffset = 0; - rc = sqlite3Select(pParse, p, SRT_Union, tab2, 0, 0, 0, aff); - p->pPrior = pPrior; - sqlite3ExprDelete(p->pLimit); - p->pLimit = pLimit; - p->pOffset = pOffset; - if( rc ){ - goto multi_select_end; - } - - /* Generate code to take the intersection of the two temporary - ** tables. - */ - assert( p->pEList ); - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, 0, p->pEList); - } - iBreak = sqlite3VdbeMakeLabel(v); - iCont = sqlite3VdbeMakeLabel(v); - sqlite3VdbeAddOp(v, OP_Rewind, tab1, iBreak); - computeLimitRegisters(pParse, p); - iStart = sqlite3VdbeAddOp(v, OP_RowKey, tab1, 0); - sqlite3VdbeAddOp(v, OP_NotFound, tab2, iCont); - rc = selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr, - pOrderBy, -1, eDest, iParm, - iCont, iBreak, 0); - if( rc ){ - rc = 1; - goto multi_select_end; - } - sqlite3VdbeResolveLabel(v, iCont); - sqlite3VdbeAddOp(v, OP_Next, tab1, iStart); - sqlite3VdbeResolveLabel(v, iBreak); - sqlite3VdbeAddOp(v, OP_Close, tab2, 0); - sqlite3VdbeAddOp(v, OP_Close, tab1, 0); - break; - } - } - - /* Make sure all SELECTs in the statement have the same number of elements - ** in their result sets. - */ - assert( p->pEList && pPrior->pEList ); - if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ - sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - rc = 1; - goto multi_select_end; - } - - /* Set the number of columns in temporary tables - */ - nCol = p->pEList->nExpr; - while( nSetP2 ){ - sqlite3VdbeChangeP2(v, aSetP2[--nSetP2], nCol); - } - - /* Compute collating sequences used by either the ORDER BY clause or - ** by any temporary tables needed to implement the compound select. - ** Attach the KeyInfo structure to all temporary tables. Invoke the - ** ORDER BY processing if there is an ORDER BY clause. - ** - ** This section is run by the right-most SELECT statement only. - ** SELECT statements to the left always skip this part. The right-most - ** SELECT might also skip this part if it has no ORDER BY clause and - ** no temp tables are required. - */ - if( pOrderBy || p->usesVirt ){ - int i; /* Loop counter */ - KeyInfo *pKeyInfo; /* Collating sequence for the result set */ - Select *pLoop; /* For looping through SELECT statements */ - CollSeq **apColl; - CollSeq **aCopy; - - assert( p->pRightmost==p ); - pKeyInfo = sqliteMalloc(sizeof(*pKeyInfo)+nCol*2*sizeof(CollSeq*) + nCol); - if( !pKeyInfo ){ - rc = SQLITE_NOMEM; - goto multi_select_end; - } - - pKeyInfo->enc = pParse->db->enc; - pKeyInfo->nField = nCol; - - for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){ - *apColl = multiSelectCollSeq(pParse, p, i); - if( 0==*apColl ){ - *apColl = pParse->db->pDfltColl; - } - } - - for(pLoop=p; pLoop; pLoop=pLoop->pPrior){ - for(i=0; i<2; i++){ - int addr = pLoop->addrOpenVirt[i]; - if( addr<0 ){ - /* If [0] is unused then [1] is also unused. So we can - ** always safely abort as soon as the first unused slot is found */ - assert( pLoop->addrOpenVirt[1]<0 ); - break; - } - sqlite3VdbeChangeP2(v, addr, nCol); - sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO); - } - } - - if( pOrderBy ){ - struct ExprList_item *pOTerm = pOrderBy->a; - int nExpr = pOrderBy->nExpr; - int addr; - u8 *pSortOrder; - - aCopy = (CollSeq**)&pKeyInfo[1]; - pSortOrder = pKeyInfo->aSortOrder = (u8*)&aCopy[nExpr]; - memcpy(aCopy, pKeyInfo->aColl, nCol*sizeof(CollSeq*)); - apColl = pKeyInfo->aColl; - for(i=0; i<pOrderBy->nExpr; i++, pOTerm++, apColl++, pSortOrder++){ - Expr *pExpr = pOTerm->pExpr; - char *zName = pOTerm->zName; - assert( pExpr->op==TK_COLUMN && pExpr->iColumn<nCol ); - if( zName ){ - *apColl = sqlite3LocateCollSeq(pParse, zName, -1); - }else{ - *apColl = aCopy[pExpr->iColumn]; - } - *pSortOrder = pOTerm->sortOrder; - } - assert( p->pRightmost==p ); - assert( p->addrOpenVirt[2]>=0 ); - addr = p->addrOpenVirt[2]; - sqlite3VdbeChangeP2(v, addr, p->pEList->nExpr+2); - pKeyInfo->nField = pOrderBy->nExpr; - sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF); - pKeyInfo = 0; - generateSortTail(pParse, p, v, p->pEList->nExpr, eDest, iParm); - } - - sqliteFree(pKeyInfo); - } - -multi_select_end: - return rc; -} -#endif /* SQLITE_OMIT_COMPOUND_SELECT */ - -#ifndef SQLITE_OMIT_VIEW -/* -** Scan through the expression pExpr. Replace every reference to -** a column in table number iTable with a copy of the iColumn-th -** entry in pEList. (But leave references to the ROWID column -** unchanged.) -** -** This routine is part of the flattening procedure. A subquery -** whose result set is defined by pEList appears as entry in the -** FROM clause of a SELECT such that the VDBE cursor assigned to that -** FORM clause entry is iTable. This routine make the necessary -** changes to pExpr so that it refers directly to the source table -** of the subquery rather the result set of the subquery. -*/ -static void substExprList(ExprList*,int,ExprList*); /* Forward Decl */ -static void substSelect(Select *, int, ExprList *); /* Forward Decl */ -static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){ - if( pExpr==0 ) return; - if( pExpr->op==TK_COLUMN && pExpr->iTable==iTable ){ - if( pExpr->iColumn<0 ){ - pExpr->op = TK_NULL; - }else{ - Expr *pNew; - assert( pEList!=0 && pExpr->iColumn<pEList->nExpr ); - assert( pExpr->pLeft==0 && pExpr->pRight==0 && pExpr->pList==0 ); - pNew = pEList->a[pExpr->iColumn].pExpr; - assert( pNew!=0 ); - pExpr->op = pNew->op; - assert( pExpr->pLeft==0 ); - pExpr->pLeft = sqlite3ExprDup(pNew->pLeft); - assert( pExpr->pRight==0 ); - pExpr->pRight = sqlite3ExprDup(pNew->pRight); - assert( pExpr->pList==0 ); - pExpr->pList = sqlite3ExprListDup(pNew->pList); - pExpr->iTable = pNew->iTable; - pExpr->iColumn = pNew->iColumn; - pExpr->iAgg = pNew->iAgg; - sqlite3TokenCopy(&pExpr->token, &pNew->token); - sqlite3TokenCopy(&pExpr->span, &pNew->span); - pExpr->pSelect = sqlite3SelectDup(pNew->pSelect); - pExpr->flags = pNew->flags; - } - }else{ - substExpr(pExpr->pLeft, iTable, pEList); - substExpr(pExpr->pRight, iTable, pEList); - substSelect(pExpr->pSelect, iTable, pEList); - substExprList(pExpr->pList, iTable, pEList); - } -} -static void substExprList(ExprList *pList, int iTable, ExprList *pEList){ - int i; - if( pList==0 ) return; - for(i=0; i<pList->nExpr; i++){ - substExpr(pList->a[i].pExpr, iTable, pEList); - } -} -static void substSelect(Select *p, int iTable, ExprList *pEList){ - if( !p ) return; - substExprList(p->pEList, iTable, pEList); - substExprList(p->pGroupBy, iTable, pEList); - substExprList(p->pOrderBy, iTable, pEList); - substExpr(p->pHaving, iTable, pEList); - substExpr(p->pWhere, iTable, pEList); -} -#endif /* !defined(SQLITE_OMIT_VIEW) */ - -#ifndef SQLITE_OMIT_VIEW -/* -** This routine attempts to flatten subqueries in order to speed -** execution. It returns 1 if it makes changes and 0 if no flattening -** occurs. -** -** To understand the concept of flattening, consider the following -** query: -** -** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5 -** -** The default way of implementing this query is to execute the -** subquery first and store the results in a temporary table, then -** run the outer query on that temporary table. This requires two -** passes over the data. Furthermore, because the temporary table -** has no indices, the WHERE clause on the outer query cannot be -** optimized. -** -** This routine attempts to rewrite queries such as the above into -** a single flat select, like this: -** -** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 -** -** The code generated for this simpification gives the same result -** but only has to scan the data once. And because indices might -** exist on the table t1, a complete scan of the data might be -** avoided. -** -** Flattening is only attempted if all of the following are true: -** -** (1) The subquery and the outer query do not both use aggregates. -** -** (2) The subquery is not an aggregate or the outer query is not a join. -** -** (3) The subquery is not the right operand of a left outer join, or -** the subquery is not itself a join. (Ticket #306) -** -** (4) The subquery is not DISTINCT or the outer query is not a join. -** -** (5) The subquery is not DISTINCT or the outer query does not use -** aggregates. -** -** (6) The subquery does not use aggregates or the outer query is not -** DISTINCT. -** -** (7) The subquery has a FROM clause. -** -** (8) The subquery does not use LIMIT or the outer query is not a join. -** -** (9) The subquery does not use LIMIT or the outer query does not use -** aggregates. -** -** (10) The subquery does not use aggregates or the outer query does not -** use LIMIT. -** -** (11) The subquery and the outer query do not both have ORDER BY clauses. -** -** (12) The subquery is not the right term of a LEFT OUTER JOIN or the -** subquery has no WHERE clause. (added by ticket #350) -** -** In this routine, the "p" parameter is a pointer to the outer query. -** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query -** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. -** -** If flattening is not attempted, this routine is a no-op and returns 0. -** If flattening is attempted this routine returns 1. -** -** All of the expression analysis must occur on both the outer query and -** the subquery before this routine runs. -*/ -static int flattenSubquery( - Parse *pParse, /* The parsing context */ - Select *p, /* The parent or outer SELECT statement */ - int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ - int isAgg, /* True if outer SELECT uses aggregate functions */ - int subqueryIsAgg /* True if the subquery uses aggregate functions */ -){ - Select *pSub; /* The inner query or "subquery" */ - SrcList *pSrc; /* The FROM clause of the outer query */ - SrcList *pSubSrc; /* The FROM clause of the subquery */ - ExprList *pList; /* The result set of the outer query */ - int iParent; /* VDBE cursor number of the pSub result set temp table */ - int i; /* Loop counter */ - Expr *pWhere; /* The WHERE clause */ - struct SrcList_item *pSubitem; /* The subquery */ - - /* Check to see if flattening is permitted. Return 0 if not. - */ - if( p==0 ) return 0; - pSrc = p->pSrc; - assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc ); - pSubitem = &pSrc->a[iFrom]; - pSub = pSubitem->pSelect; - assert( pSub!=0 ); - if( isAgg && subqueryIsAgg ) return 0; - if( subqueryIsAgg && pSrc->nSrc>1 ) return 0; - pSubSrc = pSub->pSrc; - assert( pSubSrc ); - if( (pSub->pLimit && p->pLimit) || pSub->pOffset || - (pSub->pLimit && isAgg) ) return 0; - if( pSubSrc->nSrc==0 ) return 0; - if( pSub->isDistinct && (pSrc->nSrc>1 || isAgg) ){ - return 0; - } - if( p->isDistinct && subqueryIsAgg ) return 0; - if( (p->disallowOrderBy || p->pOrderBy) && pSub->pOrderBy ) return 0; - - /* Restriction 3: If the subquery is a join, make sure the subquery is - ** not used as the right operand of an outer join. Examples of why this - ** is not allowed: - ** - ** t1 LEFT OUTER JOIN (t2 JOIN t3) - ** - ** If we flatten the above, we would get - ** - ** (t1 LEFT OUTER JOIN t2) JOIN t3 - ** - ** which is not at all the same thing. - */ - if( pSubSrc->nSrc>1 && iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 ){ - return 0; - } - - /* Restriction 12: If the subquery is the right operand of a left outer - ** join, make sure the subquery has no WHERE clause. - ** An examples of why this is not allowed: - ** - ** t1 LEFT OUTER JOIN (SELECT * FROM t2 WHERE t2.x>0) - ** - ** If we flatten the above, we would get - ** - ** (t1 LEFT OUTER JOIN t2) WHERE t2.x>0 - ** - ** But the t2.x>0 test will always fail on a NULL row of t2, which - ** effectively converts the OUTER JOIN into an INNER JOIN. - */ - if( iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 - && pSub->pWhere!=0 ){ - return 0; - } - - /* If we reach this point, it means flattening is permitted for the - ** iFrom-th entry of the FROM clause in the outer query. - */ - - /* Move all of the FROM elements of the subquery into the - ** the FROM clause of the outer query. Before doing this, remember - ** the cursor number for the original outer query FROM element in - ** iParent. The iParent cursor will never be used. Subsequent code - ** will scan expressions looking for iParent references and replace - ** those references with expressions that resolve to the subquery FROM - ** elements we are now copying in. - */ - iParent = pSubitem->iCursor; - { - int nSubSrc = pSubSrc->nSrc; - int jointype = pSubitem->jointype; - - sqlite3DeleteTable(0, pSubitem->pTab); - sqliteFree(pSubitem->zDatabase); - sqliteFree(pSubitem->zName); - sqliteFree(pSubitem->zAlias); - if( nSubSrc>1 ){ - int extra = nSubSrc - 1; - for(i=1; i<nSubSrc; i++){ - pSrc = sqlite3SrcListAppend(pSrc, 0, 0); - } - p->pSrc = pSrc; - for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){ - pSrc->a[i] = pSrc->a[i-extra]; - } - } - for(i=0; i<nSubSrc; i++){ - pSrc->a[i+iFrom] = pSubSrc->a[i]; - memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); - } - pSrc->a[iFrom+nSubSrc-1].jointype = jointype; - } - - /* Now begin substituting subquery result set expressions for - ** references to the iParent in the outer query. - ** - ** Example: - ** - ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; - ** \ \_____________ subquery __________/ / - ** \_____________________ outer query ______________________________/ - ** - ** We look at every expression in the outer query and every place we see - ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - */ - substExprList(p->pEList, iParent, pSub->pEList); - pList = p->pEList; - for(i=0; i<pList->nExpr; i++){ - Expr *pExpr; - if( pList->a[i].zName==0 && (pExpr = pList->a[i].pExpr)->span.z!=0 ){ - pList->a[i].zName = sqliteStrNDup(pExpr->span.z, pExpr->span.n); - } - } - if( isAgg ){ - substExprList(p->pGroupBy, iParent, pSub->pEList); - substExpr(p->pHaving, iParent, pSub->pEList); - } - if( pSub->pOrderBy ){ - assert( p->pOrderBy==0 ); - p->pOrderBy = pSub->pOrderBy; - pSub->pOrderBy = 0; - }else if( p->pOrderBy ){ - substExprList(p->pOrderBy, iParent, pSub->pEList); - } - if( pSub->pWhere ){ - pWhere = sqlite3ExprDup(pSub->pWhere); - }else{ - pWhere = 0; - } - if( subqueryIsAgg ){ - assert( p->pHaving==0 ); - p->pHaving = p->pWhere; - p->pWhere = pWhere; - substExpr(p->pHaving, iParent, pSub->pEList); - p->pHaving = sqlite3ExprAnd(p->pHaving, sqlite3ExprDup(pSub->pHaving)); - assert( p->pGroupBy==0 ); - p->pGroupBy = sqlite3ExprListDup(pSub->pGroupBy); - }else{ - substExpr(p->pWhere, iParent, pSub->pEList); - p->pWhere = sqlite3ExprAnd(p->pWhere, pWhere); - } - - /* The flattened query is distinct if either the inner or the - ** outer query is distinct. - */ - p->isDistinct = p->isDistinct || pSub->isDistinct; - - /* - ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; - */ - if( pSub->pLimit ){ - p->pLimit = pSub->pLimit; - pSub->pLimit = 0; - } - - /* Finially, delete what is left of the subquery and return - ** success. - */ - sqlite3SelectDelete(pSub); - return 1; -} -#endif /* SQLITE_OMIT_VIEW */ - -/* -** Analyze the SELECT statement passed in as an argument to see if it -** is a simple min() or max() query. If it is and this query can be -** satisfied using a single seek to the beginning or end of an index, -** then generate the code for this SELECT and return 1. If this is not a -** simple min() or max() query, then return 0; -** -** A simply min() or max() query looks like this: -** -** SELECT min(a) FROM table; -** SELECT max(a) FROM table; -** -** The query may have only a single table in its FROM argument. There -** can be no GROUP BY or HAVING or WHERE clauses. The result set must -** be the min() or max() of a single column of the table. The column -** in the min() or max() function must be indexed. -** -** The parameters to this routine are the same as for sqlite3Select(). -** See the header comment on that routine for additional information. -*/ -static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ - Expr *pExpr; - int iCol; - Table *pTab; - Index *pIdx; - int base; - Vdbe *v; - int seekOp; - int cont; - ExprList *pEList, *pList, eList; - struct ExprList_item eListItem; - SrcList *pSrc; - - /* Check to see if this query is a simple min() or max() query. Return - ** zero if it is not. - */ - if( p->pGroupBy || p->pHaving || p->pWhere ) return 0; - pSrc = p->pSrc; - if( pSrc->nSrc!=1 ) return 0; - pEList = p->pEList; - if( pEList->nExpr!=1 ) return 0; - pExpr = pEList->a[0].pExpr; - if( pExpr->op!=TK_AGG_FUNCTION ) return 0; - pList = pExpr->pList; - if( pList==0 || pList->nExpr!=1 ) return 0; - if( pExpr->token.n!=3 ) return 0; - if( sqlite3StrNICmp(pExpr->token.z,"min",3)==0 ){ - seekOp = OP_Rewind; - }else if( sqlite3StrNICmp(pExpr->token.z,"max",3)==0 ){ - seekOp = OP_Last; - }else{ - return 0; - } - pExpr = pList->a[0].pExpr; - if( pExpr->op!=TK_COLUMN ) return 0; - iCol = pExpr->iColumn; - pTab = pSrc->a[0].pTab; - - /* If we get to here, it means the query is of the correct form. - ** Check to make sure we have an index and make pIdx point to the - ** appropriate index. If the min() or max() is on an INTEGER PRIMARY - ** key column, no index is necessary so set pIdx to NULL. If no - ** usable index is found, return 0. - */ - if( iCol<0 ){ - pIdx = 0; - }else{ - CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr); - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - assert( pIdx->nColumn>=1 ); - if( pIdx->aiColumn[0]==iCol && pIdx->keyInfo.aColl[0]==pColl ) break; - } - if( pIdx==0 ) return 0; - } - - /* Identify column types if we will be using the callback. This - ** step is skipped if the output is going to a table or a memory cell. - ** The column names have already been generated in the calling function. - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ) return 0; - - /* If the output is destined for a temporary table, open that table. - */ - if( eDest==SRT_VirtualTab ){ - sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 1); - } - - /* Generating code to find the min or the max. Basically all we have - ** to do is find the first or the last entry in the chosen index. If - ** the min() or max() is on the INTEGER PRIMARY KEY, then find the first - ** or last entry in the main table. - */ - sqlite3CodeVerifySchema(pParse, pTab->iDb); - base = pSrc->a[0].iCursor; - computeLimitRegisters(pParse, p); - if( pSrc->a[0].pSelect==0 ){ - sqlite3OpenTableForReading(v, base, pTab); - } - cont = sqlite3VdbeMakeLabel(v); - if( pIdx==0 ){ - sqlite3VdbeAddOp(v, seekOp, base, 0); - }else{ - /* Even though the cursor used to open the index here is closed - ** as soon as a single value has been read from it, allocate it - ** using (pParse->nTab++) to prevent the cursor id from being - ** reused. This is important for statements of the form - ** "INSERT INTO x SELECT max() FROM x". - */ - int iIdx; - iIdx = pParse->nTab++; - sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - sqlite3VdbeOp3(v, OP_OpenRead, iIdx, pIdx->tnum, - (char*)&pIdx->keyInfo, P3_KEYINFO); - if( seekOp==OP_Rewind ){ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - sqlite3VdbeAddOp(v, OP_MakeRecord, 1, 0); - seekOp = OP_MoveGt; - } - sqlite3VdbeAddOp(v, seekOp, iIdx, 0); - sqlite3VdbeAddOp(v, OP_IdxRowid, iIdx, 0); - sqlite3VdbeAddOp(v, OP_Close, iIdx, 0); - sqlite3VdbeAddOp(v, OP_MoveGe, base, 0); - } - eList.nExpr = 1; - memset(&eListItem, 0, sizeof(eListItem)); - eList.a = &eListItem; - eList.a[0].pExpr = pExpr; - selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, cont, cont, 0); - sqlite3VdbeResolveLabel(v, cont); - sqlite3VdbeAddOp(v, OP_Close, base, 0); - - return 1; -} - -/* -** Analyze and ORDER BY or GROUP BY clause in a SELECT statement. Return -** the number of errors seen. -** -** An ORDER BY or GROUP BY is a list of expressions. If any expression -** is an integer constant, then that expression is replaced by the -** corresponding entry in the result set. -*/ -static int processOrderGroupBy( - NameContext *pNC, /* Name context of the SELECT statement. */ - ExprList *pOrderBy, /* The ORDER BY or GROUP BY clause to be processed */ - const char *zType /* Either "ORDER" or "GROUP", as appropriate */ -){ - int i; - ExprList *pEList = pNC->pEList; /* The result set of the SELECT */ - Parse *pParse = pNC->pParse; /* The result set of the SELECT */ - assert( pEList ); - - if( pOrderBy==0 ) return 0; - for(i=0; i<pOrderBy->nExpr; i++){ - int iCol; - Expr *pE = pOrderBy->a[i].pExpr; - if( sqlite3ExprIsInteger(pE, &iCol) ){ - if( iCol>0 && iCol<=pEList->nExpr ){ - sqlite3ExprDelete(pE); - pE = pOrderBy->a[i].pExpr = sqlite3ExprDup(pEList->a[iCol-1].pExpr); - }else{ - sqlite3ErrorMsg(pParse, - "%s BY column number %d out of range - should be " - "between 1 and %d", zType, iCol, pEList->nExpr); - return 1; - } - } - if( sqlite3ExprResolveNames(pNC, pE) ){ - return 1; - } - if( sqlite3ExprIsConstant(pE) ){ - sqlite3ErrorMsg(pParse, - "%s BY terms must not be non-integer constants", zType); - return 1; - } - } - return 0; -} - -/* -** This routine resolves any names used in the result set of the -** supplied SELECT statement. If the SELECT statement being resolved -** is a sub-select, then pOuterNC is a pointer to the NameContext -** of the parent SELECT. -*/ -int sqlite3SelectResolve( - Parse *pParse, /* The parser context */ - Select *p, /* The SELECT statement being coded. */ - NameContext *pOuterNC /* The outer name context. May be NULL. */ -){ - ExprList *pEList; /* Result set. */ - int i; /* For-loop variable used in multiple places */ - NameContext sNC; /* Local name-context */ - ExprList *pGroupBy; /* The group by clause */ - - /* If this routine has run before, return immediately. */ - if( p->isResolved ){ - assert( !pOuterNC ); - return SQLITE_OK; - } - p->isResolved = 1; - - /* If there have already been errors, do nothing. */ - if( pParse->nErr>0 ){ - return SQLITE_ERROR; - } - - /* Prepare the select statement. This call will allocate all cursors - ** required to handle the tables and subqueries in the FROM clause. - */ - if( prepSelectStmt(pParse, p) ){ - return SQLITE_ERROR; - } - - /* Resolve the expressions in the LIMIT and OFFSET clauses. These - ** are not allowed to refer to any names, so pass an empty NameContext. - */ - sNC.pParse = pParse; - sNC.hasAgg = 0; - sNC.nErr = 0; - sNC.nRef = 0; - sNC.pEList = 0; - sNC.allowAgg = 0; - sNC.pSrcList = 0; - sNC.pNext = 0; - if( sqlite3ExprResolveNames(&sNC, p->pLimit) || - sqlite3ExprResolveNames(&sNC, p->pOffset) ){ - return SQLITE_ERROR; - } - - /* Set up the local name-context to pass to ExprResolveNames() to - ** resolve the expression-list. - */ - sNC.allowAgg = 1; - sNC.pSrcList = p->pSrc; - sNC.pNext = pOuterNC; - - /* Resolve names in the result set. */ - pEList = p->pEList; - if( !pEList ) return SQLITE_ERROR; - for(i=0; i<pEList->nExpr; i++){ - Expr *pX = pEList->a[i].pExpr; - if( sqlite3ExprResolveNames(&sNC, pX) ){ - return SQLITE_ERROR; - } - } - - /* If there are no aggregate functions in the result-set, and no GROUP BY - ** expression, do not allow aggregates in any of the other expressions. - */ - assert( !p->isAgg ); - pGroupBy = p->pGroupBy; - if( pGroupBy || sNC.hasAgg ){ - p->isAgg = 1; - }else{ - sNC.allowAgg = 0; - } - - /* If a HAVING clause is present, then there must be a GROUP BY clause. - */ - if( p->pHaving && !pGroupBy ){ - sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING"); - return SQLITE_ERROR; - } - - /* Add the expression list to the name-context before parsing the - ** other expressions in the SELECT statement. This is so that - ** expressions in the WHERE clause (etc.) can refer to expressions by - ** aliases in the result set. - ** - ** Minor point: If this is the case, then the expression will be - ** re-evaluated for each reference to it. - */ - sNC.pEList = p->pEList; - if( sqlite3ExprResolveNames(&sNC, p->pWhere) || - sqlite3ExprResolveNames(&sNC, p->pHaving) || - processOrderGroupBy(&sNC, p->pOrderBy, "ORDER") || - processOrderGroupBy(&sNC, pGroupBy, "GROUP") - ){ - return SQLITE_ERROR; - } - - /* Make sure the GROUP BY clause does not contain aggregate functions. - */ - if( pGroupBy ){ - struct ExprList_item *pItem; - - for(i=0, pItem=pGroupBy->a; i<pGroupBy->nExpr; i++, pItem++){ - if( ExprHasProperty(pItem->pExpr, EP_Agg) ){ - sqlite3ErrorMsg(pParse, "aggregate functions are not allowed in " - "the GROUP BY clause"); - return SQLITE_ERROR; - } - } - } - - return SQLITE_OK; -} - -/* -** Reset the aggregate accumulator. -** -** The aggregate accumulator is a set of memory cells that hold -** intermediate results while calculating an aggregate. This -** routine simply stores NULLs in all of those memory cells. -*/ -static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){ - Vdbe *v = pParse->pVdbe; - int i; - struct AggInfo_func *pFunc; - if( pAggInfo->nFunc+pAggInfo->nColumn==0 ){ - return; - } - for(i=0; i<pAggInfo->nColumn; i++){ - sqlite3VdbeAddOp(v, OP_MemNull, pAggInfo->aCol[i].iMem, 0); - } - for(pFunc=pAggInfo->aFunc, i=0; i<pAggInfo->nFunc; i++, pFunc++){ - sqlite3VdbeAddOp(v, OP_MemNull, pFunc->iMem, 0); - if( pFunc->iDistinct>=0 ){ - Expr *pE = pFunc->pExpr; - if( pE->pList==0 || pE->pList->nExpr!=1 ){ - sqlite3ErrorMsg(pParse, "DISTINCT in aggregate must be followed " - "by an expression"); - pFunc->iDistinct = -1; - }else{ - KeyInfo *pKeyInfo = keyInfoFromExprList(pParse, pE->pList); - sqlite3VdbeOp3(v, OP_OpenVirtual, pFunc->iDistinct, 0, - (char*)pKeyInfo, P3_KEYINFO_HANDOFF); - } - } - } -} - -/* -** Invoke the OP_AggFinalize opcode for every aggregate function -** in the AggInfo structure. -*/ -static void finalizeAggFunctions(Parse *pParse, AggInfo *pAggInfo){ - Vdbe *v = pParse->pVdbe; - int i; - struct AggInfo_func *pF; - for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ - ExprList *pList = pF->pExpr->pList; - sqlite3VdbeOp3(v, OP_AggFinal, pF->iMem, pList ? pList->nExpr : 0, - (void*)pF->pFunc, P3_FUNCDEF); - } -} - -/* -** Update the accumulator memory cells for an aggregate based on -** the current cursor position. -*/ -static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ - Vdbe *v = pParse->pVdbe; - int i; - struct AggInfo_func *pF; - struct AggInfo_col *pC; - - pAggInfo->directMode = 1; - for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ - int nArg; - int addrNext = 0; - ExprList *pList = pF->pExpr->pList; - if( pList ){ - nArg = pList->nExpr; - sqlite3ExprCodeExprList(pParse, pList); - }else{ - nArg = 0; - } - if( pF->iDistinct>=0 ){ - addrNext = sqlite3VdbeMakeLabel(v); - assert( nArg==1 ); - codeDistinct(v, pF->iDistinct, addrNext, 1, 2); - } - if( pF->pFunc->needCollSeq ){ - CollSeq *pColl = 0; - struct ExprList_item *pItem; - int j; - for(j=0, pItem=pList->a; !pColl && j<pList->nExpr; j++, pItem++){ - pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); - } - if( !pColl ){ - pColl = pParse->db->pDfltColl; - } - sqlite3VdbeOp3(v, OP_CollSeq, 0, 0, (char *)pColl, P3_COLLSEQ); - } - sqlite3VdbeOp3(v, OP_AggStep, pF->iMem, nArg, (void*)pF->pFunc, P3_FUNCDEF); - if( addrNext ){ - sqlite3VdbeResolveLabel(v, addrNext); - } - } - for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){ - sqlite3ExprCode(pParse, pC->pExpr); - sqlite3VdbeAddOp(v, OP_MemStore, pC->iMem, 1); - } - pAggInfo->directMode = 0; -} - - -/* -** Generate code for the given SELECT statement. -** -** The results are distributed in various ways depending on the -** value of eDest and iParm. -** -** eDest Value Result -** ------------ ------------------------------------------- -** SRT_Callback Invoke the callback for each row of the result. -** -** SRT_Mem Store first result in memory cell iParm -** -** SRT_Set Store results as keys of table iParm. -** -** SRT_Union Store results as a key in a temporary table iParm -** -** SRT_Except Remove results from the temporary table iParm. -** -** SRT_Table Store results in temporary table iParm -** -** The table above is incomplete. Additional eDist value have be added -** since this comment was written. See the selectInnerLoop() function for -** a complete listing of the allowed values of eDest and their meanings. -** -** This routine returns the number of errors. If any errors are -** encountered, then an appropriate error message is left in -** pParse->zErrMsg. -** -** This routine does NOT free the Select structure passed in. The -** calling function needs to do that. -** -** The pParent, parentTab, and *pParentAgg fields are filled in if this -** SELECT is a subquery. This routine may try to combine this SELECT -** with its parent to form a single flat query. In so doing, it might -** change the parent query from a non-aggregate to an aggregate query. -** For that reason, the pParentAgg flag is passed as a pointer, so it -** can be changed. -** -** Example 1: The meaning of the pParent parameter. -** -** SELECT * FROM t1 JOIN (SELECT x, count(*) FROM t2) JOIN t3; -** \ \_______ subquery _______/ / -** \ / -** \____________________ outer query ___________________/ -** -** This routine is called for the outer query first. For that call, -** pParent will be NULL. During the processing of the outer query, this -** routine is called recursively to handle the subquery. For the recursive -** call, pParent will point to the outer query. Because the subquery is -** the second element in a three-way join, the parentTab parameter will -** be 1 (the 2nd value of a 0-indexed array.) -*/ -int sqlite3Select( - Parse *pParse, /* The parser context */ - Select *p, /* The SELECT statement being coded. */ - int eDest, /* How to dispose of the results */ - int iParm, /* A parameter used by the eDest disposal method */ - Select *pParent, /* Another SELECT for which this is a sub-query */ - int parentTab, /* Index in pParent->pSrc of this query */ - int *pParentAgg, /* True if pParent uses aggregate functions */ - char *aff /* If eDest is SRT_Union, the affinity string */ -){ - int i, j; /* Loop counters */ - WhereInfo *pWInfo; /* Return from sqlite3WhereBegin() */ - Vdbe *v; /* The virtual machine under construction */ - int isAgg; /* True for select lists like "count(*)" */ - ExprList *pEList; /* List of columns to extract. */ - SrcList *pTabList; /* List of tables to select from */ - Expr *pWhere; /* The WHERE clause. May be NULL */ - ExprList *pOrderBy; /* The ORDER BY clause. May be NULL */ - ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ - Expr *pHaving; /* The HAVING clause. May be NULL */ - int isDistinct; /* True if the DISTINCT keyword is present */ - int distinct; /* Table to use for the distinct set */ - int rc = 1; /* Value to return from this function */ - int addrSortIndex; /* Address of an OP_OpenVirtual instruction */ - AggInfo sAggInfo; /* Information used by aggregate queries */ - - if( sqlite3_malloc_failed || pParse->nErr || p==0 ) return 1; - if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; - memset(&sAggInfo, 0, sizeof(sAggInfo)); - -#ifndef SQLITE_OMIT_COMPOUND_SELECT - /* If there is are a sequence of queries, do the earlier ones first. - */ - if( p->pPrior ){ - if( p->pRightmost==0 ){ - Select *pLoop; - for(pLoop=p; pLoop; pLoop=pLoop->pPrior){ - pLoop->pRightmost = p; - } - } - return multiSelect(pParse, p, eDest, iParm, aff); - } -#endif - - pOrderBy = p->pOrderBy; - if( IgnorableOrderby(eDest) ){ - p->pOrderBy = 0; - } - if( sqlite3SelectResolve(pParse, p, 0) ){ - goto select_end; - } - p->pOrderBy = pOrderBy; - - /* Make local copies of the parameters for this query. - */ - pTabList = p->pSrc; - pWhere = p->pWhere; - pGroupBy = p->pGroupBy; - pHaving = p->pHaving; - isAgg = p->isAgg; - isDistinct = p->isDistinct; - pEList = p->pEList; - if( pEList==0 ) goto select_end; - - /* - ** Do not even attempt to generate any code if we have already seen - ** errors before this routine starts. - */ - if( pParse->nErr>0 ) goto select_end; - - /* If writing to memory or generating a set - ** only a single column may be output. - */ - assert( eDest!=SRT_Exists || pEList->nExpr==1 ); -#ifndef SQLITE_OMIT_SUBQUERY - if( (eDest==SRT_Mem || eDest==SRT_Set) && pEList->nExpr>1 ){ - sqlite3ErrorMsg(pParse, "only a single result allowed for " - "a SELECT that is part of an expression"); - goto select_end; - } -#endif - - /* ORDER BY is ignored for some destinations. - */ - if( IgnorableOrderby(eDest) ){ - pOrderBy = 0; - } - - /* Begin generating code. - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ) goto select_end; - - /* Identify column names if we will be using them in a callback. This - ** step is skipped if the output is going to some other destination. - */ - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, pTabList, pEList); - } - - /* Generate code for all sub-queries in the FROM clause - */ -#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) - for(i=0; i<pTabList->nSrc; i++){ - const char *zSavedAuthContext = 0; - int needRestoreContext; - struct SrcList_item *pItem = &pTabList->a[i]; - - if( pItem->pSelect==0 ) continue; - if( pItem->zName!=0 ){ - zSavedAuthContext = pParse->zAuthContext; - pParse->zAuthContext = pItem->zName; - needRestoreContext = 1; - }else{ - needRestoreContext = 0; - } - sqlite3Select(pParse, pItem->pSelect, SRT_VirtualTab, - pItem->iCursor, p, i, &isAgg, 0); - if( needRestoreContext ){ - pParse->zAuthContext = zSavedAuthContext; - } - pTabList = p->pSrc; - pWhere = p->pWhere; - if( !IgnorableOrderby(eDest) ){ - pOrderBy = p->pOrderBy; - } - pGroupBy = p->pGroupBy; - pHaving = p->pHaving; - isDistinct = p->isDistinct; - } -#endif - - /* Check for the special case of a min() or max() function by itself - ** in the result set. - */ - if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){ - rc = 0; - goto select_end; - } - - /* Check to see if this is a subquery that can be "flattened" into its parent. - ** If flattening is a possiblity, do so and return immediately. - */ -#ifndef SQLITE_OMIT_VIEW - if( pParent && pParentAgg && - flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){ - if( isAgg ) *pParentAgg = 1; - goto select_end; - } -#endif - - /* If there is an ORDER BY clause, resolve any collation sequences - ** names that have been explicitly specified and create a sorting index. - ** - ** This sorting index might end up being unused if the data can be - ** extracted in pre-sorted order. If that is the case, then the - ** OP_OpenVirtual instruction will be changed to an OP_Noop once - ** we figure out that the sorting index is not needed. The addrSortIndex - ** variable is used to facilitate that change. - */ - if( pOrderBy ){ - struct ExprList_item *pTerm; - KeyInfo *pKeyInfo; - for(i=0, pTerm=pOrderBy->a; i<pOrderBy->nExpr; i++, pTerm++){ - if( pTerm->zName ){ - pTerm->pExpr->pColl = sqlite3LocateCollSeq(pParse, pTerm->zName, -1); - } - } - if( pParse->nErr ){ - goto select_end; - } - pKeyInfo = keyInfoFromExprList(pParse, pOrderBy); - pOrderBy->iECursor = pParse->nTab++; - p->addrOpenVirt[2] = addrSortIndex = - sqlite3VdbeOp3(v, OP_OpenVirtual, pOrderBy->iECursor, pOrderBy->nExpr+2, - (char*)pKeyInfo, P3_KEYINFO_HANDOFF); - }else{ - addrSortIndex = -1; - } - - /* Set the limiter. - */ - computeLimitRegisters(pParse, p); - - /* If the output is destined for a temporary table, open that table. - */ - if( eDest==SRT_VirtualTab ){ - sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, pEList->nExpr); - } - - - /* Initialize the memory cell to NULL for SRT_Mem or 0 for SRT_Exists - */ - if( eDest==SRT_Mem ){ - sqlite3VdbeAddOp(v, OP_MemNull, iParm, 0); - }else if( eDest==SRT_Exists ){ - sqlite3VdbeAddOp(v, OP_MemInt, 0, iParm); - } - - /* Open a virtual index to use for the distinct set. - */ - if( isDistinct ){ - KeyInfo *pKeyInfo; - distinct = pParse->nTab++; - pKeyInfo = keyInfoFromExprList(pParse, p->pEList); - sqlite3VdbeOp3(v, OP_OpenVirtual, distinct, 0, - (char*)pKeyInfo, P3_KEYINFO_HANDOFF); - }else{ - distinct = -1; - } - - /* Aggregate and non-aggregate queries are handled differently */ - if( !isAgg && pGroupBy==0 ){ - /* This case is for non-aggregate queries - ** Begin the database scan - */ - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pOrderBy); - if( pWInfo==0 ) goto select_end; - - /* If sorting index that was created by a prior OP_OpenVirtual - ** instruction ended up not being needed, then change the OP_OpenVirtual - ** into an OP_Noop. - */ - if( addrSortIndex>=0 && pOrderBy==0 ){ - uncreateSortingIndex(pParse, addrSortIndex); - p->addrOpenVirt[2] = -1; - } - - /* Use the standard inner loop - */ - if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest, - iParm, pWInfo->iContinue, pWInfo->iBreak, aff) ){ - goto select_end; - } - - /* End the database scan loop. - */ - sqlite3WhereEnd(pWInfo); - }else{ - /* This is the processing for aggregate queries */ - NameContext sNC; /* Name context for processing aggregate information */ - int iAMem; /* First Mem address for storing current GROUP BY */ - int iBMem; /* First Mem address for previous GROUP BY */ - int iUseFlag; /* Mem address holding flag indicating that at least - ** one row of the input to the aggregator has been - ** processed */ - int iAbortFlag; /* Mem address which causes query abort if positive */ - int groupBySort; /* Rows come from source in GROUP BY order */ - - - /* The following variables hold addresses or labels for parts of the - ** virtual machine program we are putting together */ - int addrOutputRow; /* Start of subroutine that outputs a result row */ - int addrSetAbort; /* Set the abort flag and return */ - int addrInitializeLoop; /* Start of code that initializes the input loop */ - int addrTopOfLoop; /* Top of the input loop */ - int addrGroupByChange; /* Code that runs when any GROUP BY term changes */ - int addrProcessRow; /* Code to process a single input row */ - int addrEnd; /* End of all processing */ - int addrSortingIdx; /* The OP_OpenVirtual for the sorting index */ - int addrReset; /* Subroutine for resetting the accumulator */ - - addrEnd = sqlite3VdbeMakeLabel(v); - - /* Convert TK_COLUMN nodes into TK_AGG_COLUMN and make entries in - ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the - ** SELECT statement. - */ - memset(&sNC, 0, sizeof(sNC)); - sNC.pParse = pParse; - sNC.pSrcList = pTabList; - sNC.pAggInfo = &sAggInfo; - sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr+1 : 0; - sAggInfo.pGroupBy = pGroupBy; - if( sqlite3ExprAnalyzeAggList(&sNC, pEList) ){ - goto select_end; - } - if( sqlite3ExprAnalyzeAggList(&sNC, pOrderBy) ){ - goto select_end; - } - if( pHaving && sqlite3ExprAnalyzeAggregates(&sNC, pHaving) ){ - goto select_end; - } - sAggInfo.nAccumulator = sAggInfo.nColumn; - for(i=0; i<sAggInfo.nFunc; i++){ - if( sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->pList) ){ - goto select_end; - } - } - if( sqlite3_malloc_failed ) goto select_end; - - /* Processing for aggregates with GROUP BY is very different and - ** much more complex tha aggregates without a GROUP BY. - */ - if( pGroupBy ){ - KeyInfo *pKeyInfo; /* Keying information for the group by clause */ - - /* Create labels that we will be needing - */ - - addrInitializeLoop = sqlite3VdbeMakeLabel(v); - addrGroupByChange = sqlite3VdbeMakeLabel(v); - addrProcessRow = sqlite3VdbeMakeLabel(v); - - /* If there is a GROUP BY clause we might need a sorting index to - ** implement it. Allocate that sorting index now. If it turns out - ** that we do not need it after all, the OpenVirtual instruction - ** will be converted into a Noop. - */ - sAggInfo.sortingIdx = pParse->nTab++; - pKeyInfo = keyInfoFromExprList(pParse, pGroupBy); - addrSortingIdx = - sqlite3VdbeOp3(v, OP_OpenVirtual, sAggInfo.sortingIdx, - sAggInfo.nSortingColumn, - (char*)pKeyInfo, P3_KEYINFO_HANDOFF); - - /* Initialize memory locations used by GROUP BY aggregate processing - */ - iUseFlag = pParse->nMem++; - iAbortFlag = pParse->nMem++; - iAMem = pParse->nMem; - pParse->nMem += pGroupBy->nExpr; - iBMem = pParse->nMem; - pParse->nMem += pGroupBy->nExpr; - sqlite3VdbeAddOp(v, OP_MemInt, 0, iAbortFlag); - VdbeComment((v, "# clear abort flag")); - sqlite3VdbeAddOp(v, OP_MemInt, 0, iUseFlag); - VdbeComment((v, "# indicate accumulator empty")); - sqlite3VdbeAddOp(v, OP_Goto, 0, addrInitializeLoop); - - /* Generate a subroutine that outputs a single row of the result - ** set. This subroutine first looks at the iUseFlag. If iUseFlag - ** is less than or equal to zero, the subroutine is a no-op. If - ** the processing calls for the query to abort, this subroutine - ** increments the iAbortFlag memory location before returning in - ** order to signal the caller to abort. - */ - addrSetAbort = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_MemInt, 1, iAbortFlag); - VdbeComment((v, "# set abort flag")); - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - addrOutputRow = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_IfMemPos, iUseFlag, addrOutputRow+2); - VdbeComment((v, "# Groupby result generator entry point")); - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - finalizeAggFunctions(pParse, &sAggInfo); - if( pHaving ){ - sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, 1); - } - rc = selectInnerLoop(pParse, p, p->pEList, 0, 0, pOrderBy, - distinct, eDest, iParm, - addrOutputRow+1, addrSetAbort, aff); - if( rc ){ - goto select_end; - } - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - VdbeComment((v, "# end groupby result generator")); - - /* Generate a subroutine that will reset the group-by accumulator - */ - addrReset = sqlite3VdbeCurrentAddr(v); - resetAccumulator(pParse, &sAggInfo); - sqlite3VdbeAddOp(v, OP_Return, 0, 0); - - /* Begin a loop that will extract all source rows in GROUP BY order. - ** This might involve two separate loops with an OP_Sort in between, or - ** it might be a single loop that uses an index to extract information - ** in the right order to begin with. - */ - sqlite3VdbeResolveLabel(v, addrInitializeLoop); - sqlite3VdbeAddOp(v, OP_Gosub, 0, addrReset); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pGroupBy); - if( pWInfo==0 ) goto select_end; - if( pGroupBy==0 ){ - /* The optimizer is able to deliver rows in group by order so - ** we do not have to sort. The OP_OpenVirtual table will be - ** cancelled later because we still need to use the pKeyInfo - */ - pGroupBy = p->pGroupBy; - groupBySort = 0; - }else{ - /* Rows are coming out in undetermined order. We have to push - ** each row into a sorting index, terminate the first loop, - ** then loop over the sorting index in order to get the output - ** in sorted order - */ - groupBySort = 1; - sqlite3ExprCodeExprList(pParse, pGroupBy); - sqlite3VdbeAddOp(v, OP_Sequence, sAggInfo.sortingIdx, 0); - j = pGroupBy->nExpr+1; - for(i=0; i<sAggInfo.nColumn; i++){ - struct AggInfo_col *pCol = &sAggInfo.aCol[i]; - if( pCol->iSorterColumn<j ) continue; - if( pCol->iColumn<0 ){ - sqlite3VdbeAddOp(v, OP_Rowid, pCol->iTable, 0); - }else{ - sqlite3VdbeAddOp(v, OP_Column, pCol->iTable, pCol->iColumn); - } - j++; - } - sqlite3VdbeAddOp(v, OP_MakeRecord, j, 0); - sqlite3VdbeAddOp(v, OP_IdxInsert, sAggInfo.sortingIdx, 0); - sqlite3WhereEnd(pWInfo); - sqlite3VdbeAddOp(v, OP_Sort, sAggInfo.sortingIdx, addrEnd); - VdbeComment((v, "# GROUP BY sort")); - sAggInfo.useSortingIdx = 1; - } - - /* Evaluate the current GROUP BY terms and store in b0, b1, b2... - ** (b0 is memory location iBMem+0, b1 is iBMem+1, and so forth) - ** Then compare the current GROUP BY terms against the GROUP BY terms - ** from the previous row currently stored in a0, a1, a2... - */ - addrTopOfLoop = sqlite3VdbeCurrentAddr(v); - for(j=0; j<pGroupBy->nExpr; j++){ - if( groupBySort ){ - sqlite3VdbeAddOp(v, OP_Column, sAggInfo.sortingIdx, j); - }else{ - sAggInfo.directMode = 1; - sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr); - } - sqlite3VdbeAddOp(v, OP_MemStore, iBMem+j, j<pGroupBy->nExpr-1); - } - for(j=pGroupBy->nExpr-1; j>=0; j--){ - if( j<pGroupBy->nExpr-1 ){ - sqlite3VdbeAddOp(v, OP_MemLoad, iBMem+j, 0); - } - sqlite3VdbeAddOp(v, OP_MemLoad, iAMem+j, 0); - if( j==0 ){ - sqlite3VdbeAddOp(v, OP_Eq, 0x200, addrProcessRow); - }else{ - sqlite3VdbeAddOp(v, OP_Ne, 0x200, addrGroupByChange); - } - sqlite3VdbeChangeP3(v, -1, (void*)pKeyInfo->aColl[j], P3_COLLSEQ); - } - - /* Generate code that runs whenever the GROUP BY changes. - ** Change in the GROUP BY are detected by the previous code - ** block. If there were no changes, this block is skipped. - ** - ** This code copies current group by terms in b0,b1,b2,... - ** over to a0,a1,a2. It then calls the output subroutine - ** and resets the aggregate accumulator registers in preparation - ** for the next GROUP BY batch. - */ - sqlite3VdbeResolveLabel(v, addrGroupByChange); - for(j=0; j<pGroupBy->nExpr; j++){ - sqlite3VdbeAddOp(v, OP_MemMove, iAMem+j, iBMem+j); - } - sqlite3VdbeAddOp(v, OP_Gosub, 0, addrOutputRow); - VdbeComment((v, "# output one row")); - sqlite3VdbeAddOp(v, OP_IfMemPos, iAbortFlag, addrEnd); - VdbeComment((v, "# check abort flag")); - sqlite3VdbeAddOp(v, OP_Gosub, 0, addrReset); - VdbeComment((v, "# reset accumulator")); - - /* Update the aggregate accumulators based on the content of - ** the current row - */ - sqlite3VdbeResolveLabel(v, addrProcessRow); - updateAccumulator(pParse, &sAggInfo); - sqlite3VdbeAddOp(v, OP_MemInt, 1, iUseFlag); - VdbeComment((v, "# indicate data in accumulator")); - - /* End of the loop - */ - if( groupBySort ){ - sqlite3VdbeAddOp(v, OP_Next, sAggInfo.sortingIdx, addrTopOfLoop); - }else{ - sqlite3WhereEnd(pWInfo); - uncreateSortingIndex(pParse, addrSortingIdx); - } - - /* Output the final row of result - */ - sqlite3VdbeAddOp(v, OP_Gosub, 0, addrOutputRow); - VdbeComment((v, "# output final row")); - - } /* endif pGroupBy */ - else { - /* This case runs if the aggregate has no GROUP BY clause. The - ** processing is much simpler since there is only a single row - ** of output. - */ - resetAccumulator(pParse, &sAggInfo); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0); - if( pWInfo==0 ) goto select_end; - updateAccumulator(pParse, &sAggInfo); - sqlite3WhereEnd(pWInfo); - finalizeAggFunctions(pParse, &sAggInfo); - pOrderBy = 0; - if( pHaving ){ - sqlite3ExprIfFalse(pParse, pHaving, addrEnd, 1); - } - selectInnerLoop(pParse, p, p->pEList, 0, 0, 0, -1, - eDest, iParm, addrEnd, addrEnd, aff); - } - sqlite3VdbeResolveLabel(v, addrEnd); - - } /* endif aggregate query */ - - /* If there is an ORDER BY clause, then we need to sort the results - ** and send them to the callback one by one. - */ - if( pOrderBy ){ - generateSortTail(pParse, p, v, pEList->nExpr, eDest, iParm); - } - -#ifndef SQLITE_OMIT_SUBQUERY - /* If this was a subquery, we have now converted the subquery into a - ** temporary table. So delete the subquery structure from the parent - ** to prevent this subquery from being evaluated again and to force the - ** the use of the temporary table. - */ - if( pParent ){ - assert( pParent->pSrc->nSrc>parentTab ); - assert( pParent->pSrc->a[parentTab].pSelect==p ); - sqlite3SelectDelete(p); - pParent->pSrc->a[parentTab].pSelect = 0; - } -#endif - - /* The SELECT was successfully coded. Set the return code to 0 - ** to indicate no errors. - */ - rc = 0; - - /* Control jumps to here if an error is encountered above, or upon - ** successful coding of the SELECT. - */ -select_end: - sqliteFree(sAggInfo.aCol); - sqliteFree(sAggInfo.aFunc); - return rc; -} diff --git a/ext/pdo_sqlite/sqlite/src/shell.c b/ext/pdo_sqlite/sqlite/src/shell.c deleted file mode 100644 index 61ff2482d5b4d..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/shell.c +++ /dev/null @@ -1,1813 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code to implement the "sqlite" command line -** utility for accessing SQLite databases. -** -** $Id$ -*/ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <assert.h> -#include "sqlite3.h" -#include <ctype.h> - -#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__) -# include <signal.h> -# include <pwd.h> -# include <unistd.h> -# include <sys/types.h> -#endif - -#ifdef __MACOS__ -# include <console.h> -# include <signal.h> -# include <unistd.h> -# include <extras.h> -# include <Files.h> -# include <Folders.h> -#endif - -#if defined(HAVE_READLINE) && HAVE_READLINE==1 -# include <readline/readline.h> -# include <readline/history.h> -#else -# define readline(p) local_getline(p,stdin) -# define add_history(X) -# define read_history(X) -# define write_history(X) -# define stifle_history(X) -#endif - -/* Make sure isatty() has a prototype. -*/ -extern int isatty(); - -/* -** The following is the open SQLite database. We make a pointer -** to this database a static variable so that it can be accessed -** by the SIGINT handler to interrupt database processing. -*/ -static sqlite3 *db = 0; - -/* -** True if an interrupt (Control-C) has been received. -*/ -static int seenInterrupt = 0; - -/* -** This is the name of our program. It is set in main(), used -** in a number of other places, mostly for error messages. -*/ -static char *Argv0; - -/* -** Prompt strings. Initialized in main. Settable with -** .prompt main continue -*/ -static char mainPrompt[20]; /* First line prompt. default: "sqlite> "*/ -static char continuePrompt[20]; /* Continuation prompt. default: " ...> " */ - - -/* -** Determines if a string is a number of not. -*/ -static int isNumber(const unsigned char *z, int *realnum){ - if( *z=='-' || *z=='+' ) z++; - if( !isdigit(*z) ){ - return 0; - } - z++; - if( realnum ) *realnum = 0; - while( isdigit(*z) ){ z++; } - if( *z=='.' ){ - z++; - if( !isdigit(*z) ) return 0; - while( isdigit(*z) ){ z++; } - if( realnum ) *realnum = 1; - } - if( *z=='e' || *z=='E' ){ - z++; - if( *z=='+' || *z=='-' ) z++; - if( !isdigit(*z) ) return 0; - while( isdigit(*z) ){ z++; } - if( realnum ) *realnum = 1; - } - return *z==0; -} - -/* -** A global char* and an SQL function to access its current value -** from within an SQL statement. This program used to use the -** sqlite_exec_printf() API to substitue a string into an SQL statement. -** The correct way to do this with sqlite3 is to use the bind API, but -** since the shell is built around the callback paradigm it would be a lot -** of work. Instead just use this hack, which is quite harmless. -*/ -static const char *zShellStatic = 0; -static void shellstaticFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - assert( 0==argc ); - assert( zShellStatic ); - sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC); -} - - -/* -** This routine reads a line of text from FILE in, stores -** the text in memory obtained from malloc() and returns a pointer -** to the text. NULL is returned at end of file, or if malloc() -** fails. -** -** The interface is like "readline" but no command-line editing -** is done. -*/ -static char *local_getline(char *zPrompt, FILE *in){ - char *zLine; - int nLine; - int n; - int eol; - - if( zPrompt && *zPrompt ){ - printf("%s",zPrompt); - fflush(stdout); - } - nLine = 100; - zLine = malloc( nLine ); - if( zLine==0 ) return 0; - n = 0; - eol = 0; - while( !eol ){ - if( n+100>nLine ){ - nLine = nLine*2 + 100; - zLine = realloc(zLine, nLine); - if( zLine==0 ) return 0; - } - if( fgets(&zLine[n], nLine - n, in)==0 ){ - if( n==0 ){ - free(zLine); - return 0; - } - zLine[n] = 0; - eol = 1; - break; - } - while( zLine[n] ){ n++; } - if( n>0 && zLine[n-1]=='\n' ){ - n--; - zLine[n] = 0; - eol = 1; - } - } - zLine = realloc( zLine, n+1 ); - return zLine; -} - -/* -** Retrieve a single line of input text. "isatty" is true if text -** is coming from a terminal. In that case, we issue a prompt and -** attempt to use "readline" for command-line editing. If "isatty" -** is false, use "local_getline" instead of "readline" and issue no prompt. -** -** zPrior is a string of prior text retrieved. If not the empty -** string, then issue a continuation prompt. -*/ -static char *one_input_line(const char *zPrior, FILE *in){ - char *zPrompt; - char *zResult; - if( in!=0 ){ - return local_getline(0, in); - } - if( zPrior && zPrior[0] ){ - zPrompt = continuePrompt; - }else{ - zPrompt = mainPrompt; - } - zResult = readline(zPrompt); -#if defined(HAVE_READLINE) && HAVE_READLINE==1 - if( zResult ) add_history(zResult); -#endif - return zResult; -} - -struct previous_mode_data { - int valid; /* Is there legit data in here? */ - int mode; - int showHeader; - int colWidth[100]; -}; -/* -** An pointer to an instance of this structure is passed from -** the main program to the callback. This is used to communicate -** state and mode information. -*/ -struct callback_data { - sqlite3 *db; /* The database */ - int echoOn; /* True to echo input commands */ - int cnt; /* Number of records displayed so far */ - FILE *out; /* Write results here */ - int mode; /* An output mode setting */ - int showHeader; /* True to show column names in List or Column mode */ - char *zDestTable; /* Name of destination table when MODE_Insert */ - char separator[20]; /* Separator character for MODE_List */ - int colWidth[100]; /* Requested width of each column when in column mode*/ - int actualWidth[100]; /* Actual width of each column */ - char nullvalue[20]; /* The text to print when a NULL comes back from - ** the database */ - struct previous_mode_data explainPrev; - /* Holds the mode information just before - ** .explain ON */ - char outfile[FILENAME_MAX]; /* Filename for *out */ - const char *zDbFilename; /* name of the database file */ - char *zKey; /* Encryption key */ -}; - -/* -** These are the allowed modes. -*/ -#define MODE_Line 0 /* One column per line. Blank line between records */ -#define MODE_Column 1 /* One record per line in neat columns */ -#define MODE_List 2 /* One record per line with a separator */ -#define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */ -#define MODE_Html 4 /* Generate an XHTML table */ -#define MODE_Insert 5 /* Generate SQL "insert" statements */ -#define MODE_Tcl 6 /* Generate ANSI-C or TCL quoted elements */ -#define MODE_Csv 7 /* Quote strings, numbers are plain */ -#define MODE_NUM_OF 8 /* The number of modes (not a mode itself) */ - -char *modeDescr[MODE_NUM_OF] = { - "line", - "column", - "list", - "semi", - "html", - "insert", - "tcl", - "csv", -}; - -/* -** Number of elements in an array -*/ -#define ArraySize(X) (sizeof(X)/sizeof(X[0])) - -/* -** Output the given string as a quoted string using SQL quoting conventions. -*/ -static void output_quoted_string(FILE *out, const char *z){ - int i; - int nSingle = 0; - for(i=0; z[i]; i++){ - if( z[i]=='\'' ) nSingle++; - } - if( nSingle==0 ){ - fprintf(out,"'%s'",z); - }else{ - fprintf(out,"'"); - while( *z ){ - for(i=0; z[i] && z[i]!='\''; i++){} - if( i==0 ){ - fprintf(out,"''"); - z++; - }else if( z[i]=='\'' ){ - fprintf(out,"%.*s''",i,z); - z += i+1; - }else{ - fprintf(out,"%s",z); - break; - } - } - fprintf(out,"'"); - } -} - -/* -** Output the given string as a quoted according to C or TCL quoting rules. -*/ -static void output_c_string(FILE *out, const char *z){ - unsigned int c; - fputc('"', out); - while( (c = *(z++))!=0 ){ - if( c=='\\' ){ - fputc(c, out); - fputc(c, out); - }else if( c=='\t' ){ - fputc('\\', out); - fputc('t', out); - }else if( c=='\n' ){ - fputc('\\', out); - fputc('n', out); - }else if( c=='\r' ){ - fputc('\\', out); - fputc('r', out); - }else if( !isprint(c) ){ - fprintf(out, "\\%03o", c&0xff); - }else{ - fputc(c, out); - } - } - fputc('"', out); -} - -/* -** Output the given string with characters that are special to -** HTML escaped. -*/ -static void output_html_string(FILE *out, const char *z){ - int i; - while( *z ){ - for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){} - if( i>0 ){ - fprintf(out,"%.*s",i,z); - } - if( z[i]=='<' ){ - fprintf(out,"<"); - }else if( z[i]=='&' ){ - fprintf(out,"&"); - }else{ - break; - } - z += i + 1; - } -} - -/* -** Output a single term of CSV. Actually, p->separator is used for -** the separator, which may or may not be a comma. p->nullvalue is -** the null value. Strings are quoted using ANSI-C rules. Numbers -** appear outside of quotes. -*/ -static void output_csv(struct callback_data *p, const char *z, int bSep){ - if( z==0 ){ - fprintf(p->out,"%s",p->nullvalue); - }else if( isNumber(z, 0) ){ - fprintf(p->out,"%s",z); - }else{ - output_c_string(p->out, z); - } - if( bSep ){ - fprintf(p->out, p->separator); - } -} - -#ifdef SIGINT -/* -** This routine runs when the user presses Ctrl-C -*/ -static void interrupt_handler(int NotUsed){ - seenInterrupt = 1; - if( db ) sqlite3_interrupt(db); -} -#endif - -/* -** This is the callback routine that the SQLite library -** invokes for each row of a query result. -*/ -static int callback(void *pArg, int nArg, char **azArg, char **azCol){ - int i; - struct callback_data *p = (struct callback_data*)pArg; - switch( p->mode ){ - case MODE_Line: { - int w = 5; - if( azArg==0 ) break; - for(i=0; i<nArg; i++){ - int len = strlen(azCol[i]); - if( len>w ) w = len; - } - if( p->cnt++>0 ) fprintf(p->out,"\n"); - for(i=0; i<nArg; i++){ - fprintf(p->out,"%*s = %s\n", w, azCol[i], - azArg[i] ? azArg[i] : p->nullvalue); - } - break; - } - case MODE_Column: { - if( p->cnt++==0 ){ - for(i=0; i<nArg; i++){ - int w, n; - if( i<ArraySize(p->colWidth) ){ - w = p->colWidth[i]; - }else{ - w = 0; - } - if( w<=0 ){ - w = strlen(azCol[i] ? azCol[i] : ""); - if( w<10 ) w = 10; - n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue); - if( w<n ) w = n; - } - if( i<ArraySize(p->actualWidth) ){ - p->actualWidth[i] = w; - } - if( p->showHeader ){ - fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); - } - } - if( p->showHeader ){ - for(i=0; i<nArg; i++){ - int w; - if( i<ArraySize(p->actualWidth) ){ - w = p->actualWidth[i]; - }else{ - w = 10; - } - fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------" - "----------------------------------------------------------", - i==nArg-1 ? "\n": " "); - } - } - } - if( azArg==0 ) break; - for(i=0; i<nArg; i++){ - int w; - if( i<ArraySize(p->actualWidth) ){ - w = p->actualWidth[i]; - }else{ - w = 10; - } - fprintf(p->out,"%-*.*s%s",w,w, - azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); - } - break; - } - case MODE_Semi: - case MODE_List: { - if( p->cnt++==0 && p->showHeader ){ - for(i=0; i<nArg; i++){ - fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator); - } - } - if( azArg==0 ) break; - for(i=0; i<nArg; i++){ - char *z = azArg[i]; - if( z==0 ) z = p->nullvalue; - fprintf(p->out, "%s", z); - if( i<nArg-1 ){ - fprintf(p->out, "%s", p->separator); - }else if( p->mode==MODE_Semi ){ - fprintf(p->out, ";\n"); - }else{ - fprintf(p->out, "\n"); - } - } - break; - } - case MODE_Html: { - if( p->cnt++==0 && p->showHeader ){ - fprintf(p->out,"<TR>"); - for(i=0; i<nArg; i++){ - fprintf(p->out,"<TH>%s</TH>",azCol[i]); - } - fprintf(p->out,"</TR>\n"); - } - if( azArg==0 ) break; - fprintf(p->out,"<TR>"); - for(i=0; i<nArg; i++){ - fprintf(p->out,"<TD>"); - output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); - fprintf(p->out,"</TD>\n"); - } - fprintf(p->out,"</TR>\n"); - break; - } - case MODE_Tcl: { - if( p->cnt++==0 && p->showHeader ){ - for(i=0; i<nArg; i++){ - output_c_string(p->out,azCol[i]); - fprintf(p->out, "%s", p->separator); - } - fprintf(p->out,"\n"); - } - if( azArg==0 ) break; - for(i=0; i<nArg; i++){ - output_c_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); - fprintf(p->out, "%s", p->separator); - } - fprintf(p->out,"\n"); - break; - } - case MODE_Csv: { - if( p->cnt++==0 && p->showHeader ){ - for(i=0; i<nArg; i++){ - output_csv(p, azCol[i], i<nArg-1); - } - fprintf(p->out,"\n"); - } - if( azArg==0 ) break; - for(i=0; i<nArg; i++){ - output_csv(p, azArg[i], i<nArg-1); - } - fprintf(p->out,"\n"); - break; - } - case MODE_Insert: { - if( azArg==0 ) break; - fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable); - for(i=0; i<nArg; i++){ - char *zSep = i>0 ? ",": ""; - if( azArg[i]==0 ){ - fprintf(p->out,"%sNULL",zSep); - }else if( isNumber(azArg[i], 0) ){ - fprintf(p->out,"%s%s",zSep, azArg[i]); - }else{ - if( zSep[0] ) fprintf(p->out,"%s",zSep); - output_quoted_string(p->out, azArg[i]); - } - } - fprintf(p->out,");\n"); - break; - } - } - return 0; -} - -/* -** Set the destination table field of the callback_data structure to -** the name of the table given. Escape any quote characters in the -** table name. -*/ -static void set_table_name(struct callback_data *p, const char *zName){ - int i, n; - int needQuote; - char *z; - - if( p->zDestTable ){ - free(p->zDestTable); - p->zDestTable = 0; - } - if( zName==0 ) return; - needQuote = !isalpha((unsigned char)*zName) && *zName!='_'; - for(i=n=0; zName[i]; i++, n++){ - if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ){ - needQuote = 1; - if( zName[i]=='\'' ) n++; - } - } - if( needQuote ) n += 2; - z = p->zDestTable = malloc( n+1 ); - if( z==0 ){ - fprintf(stderr,"Out of memory!\n"); - exit(1); - } - n = 0; - if( needQuote ) z[n++] = '\''; - for(i=0; zName[i]; i++){ - z[n++] = zName[i]; - if( zName[i]=='\'' ) z[n++] = '\''; - } - if( needQuote ) z[n++] = '\''; - z[n] = 0; -} - -/* zIn is either a pointer to a NULL-terminated string in memory obtained -** from malloc(), or a NULL pointer. The string pointed to by zAppend is -** added to zIn, and the result returned in memory obtained from malloc(). -** zIn, if it was not NULL, is freed. -** -** If the third argument, quote, is not '\0', then it is used as a -** quote character for zAppend. -*/ -static char * appendText(char *zIn, char const *zAppend, char quote){ - int len; - int i; - int nAppend = strlen(zAppend); - int nIn = (zIn?strlen(zIn):0); - - len = nAppend+nIn+1; - if( quote ){ - len += 2; - for(i=0; i<nAppend; i++){ - if( zAppend[i]==quote ) len++; - } - } - - zIn = (char *)realloc(zIn, len); - if( !zIn ){ - return 0; - } - - if( quote ){ - char *zCsr = &zIn[nIn]; - *zCsr++ = quote; - for(i=0; i<nAppend; i++){ - *zCsr++ = zAppend[i]; - if( zAppend[i]==quote ) *zCsr++ = quote; - } - *zCsr++ = quote; - *zCsr++ = '\0'; - assert( (zCsr-zIn)==len ); - }else{ - memcpy(&zIn[nIn], zAppend, nAppend); - zIn[len-1] = '\0'; - } - - return zIn; -} - - -/* -** Execute a query statement that has a single result column. Print -** that result column on a line by itself with a semicolon terminator. -*/ -static int run_table_dump_query(FILE *out, sqlite3 *db, const char *zSelect){ - sqlite3_stmt *pSelect; - int rc; - rc = sqlite3_prepare(db, zSelect, -1, &pSelect, 0); - if( rc!=SQLITE_OK || !pSelect ){ - return rc; - } - rc = sqlite3_step(pSelect); - while( rc==SQLITE_ROW ){ - fprintf(out, "%s;\n", sqlite3_column_text(pSelect, 0)); - rc = sqlite3_step(pSelect); - } - return sqlite3_finalize(pSelect); -} - - -/* -** This is a different callback routine used for dumping the database. -** Each row received by this callback consists of a table name, -** the table type ("index" or "table") and SQL to create the table. -** This routine should print text sufficient to recreate the table. -*/ -static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ - int rc; - const char *zTable; - const char *zType; - const char *zSql; - struct callback_data *p = (struct callback_data *)pArg; - - if( nArg!=3 ) return 1; - zTable = azArg[0]; - zType = azArg[1]; - zSql = azArg[2]; - - if( strcmp(zTable, "sqlite_sequence")==0 ){ - fprintf(p->out, "DELETE FROM sqlite_sequence;\n"); - }else if( strcmp(zTable, "sqlite_stat1")==0 ){ - fprintf(p->out, "ANALYZE sqlite_master;\n"); - }else if( strncmp(zTable, "sqlite_", 7)==0 ){ - return 0; - }else{ - fprintf(p->out, "%s;\n", zSql); - } - - if( strcmp(zType, "table")==0 ){ - sqlite3_stmt *pTableInfo = 0; - char *zSelect = 0; - char *zTableInfo = 0; - char *zTmp = 0; - - zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0); - zTableInfo = appendText(zTableInfo, zTable, '"'); - zTableInfo = appendText(zTableInfo, ");", 0); - - rc = sqlite3_prepare(p->db, zTableInfo, -1, &pTableInfo, 0); - if( zTableInfo ) free(zTableInfo); - if( rc!=SQLITE_OK || !pTableInfo ){ - return 1; - } - - zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); - zTmp = appendText(zTmp, zTable, '"'); - if( zTmp ){ - zSelect = appendText(zSelect, zTmp, '\''); - } - zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); - rc = sqlite3_step(pTableInfo); - while( rc==SQLITE_ROW ){ - zSelect = appendText(zSelect, "quote(", 0); - zSelect = appendText(zSelect, sqlite3_column_text(pTableInfo, 1), '"'); - rc = sqlite3_step(pTableInfo); - if( rc==SQLITE_ROW ){ - zSelect = appendText(zSelect, ") || ', ' || ", 0); - }else{ - zSelect = appendText(zSelect, ") ", 0); - } - } - rc = sqlite3_finalize(pTableInfo); - if( rc!=SQLITE_OK ){ - if( zSelect ) free(zSelect); - return 1; - } - zSelect = appendText(zSelect, "|| ')' FROM ", 0); - zSelect = appendText(zSelect, zTable, '"'); - - rc = run_table_dump_query(p->out, p->db, zSelect); - if( rc==SQLITE_CORRUPT ){ - zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0); - rc = run_table_dump_query(p->out, p->db, zSelect); - } - if( zSelect ) free(zSelect); - if( rc!=SQLITE_OK ){ - return 1; - } - } - return 0; -} - -/* -** Run zQuery. Update dump_callback() as the callback routine. -** If we get a SQLITE_CORRUPT error, rerun the query after appending -** "ORDER BY rowid DESC" to the end. -*/ -static int run_schema_dump_query( - struct callback_data *p, - const char *zQuery, - char **pzErrMsg -){ - int rc; - rc = sqlite3_exec(p->db, zQuery, dump_callback, p, pzErrMsg); - if( rc==SQLITE_CORRUPT ){ - char *zQ2; - int len = strlen(zQuery); - if( pzErrMsg ) sqlite3_free(*pzErrMsg); - zQ2 = malloc( len+100 ); - if( zQ2==0 ) return rc; - sprintf(zQ2, "%s ORDER BY rowid DESC", zQuery); - rc = sqlite3_exec(p->db, zQ2, dump_callback, p, pzErrMsg); - free(zQ2); - } - return rc; -} - -/* -** Text of a help message -*/ -static char zHelp[] = - ".databases List names and files of attached databases\n" - ".dump ?TABLE? ... Dump the database in an SQL text format\n" - ".echo ON|OFF Turn command echo on or off\n" - ".exit Exit this program\n" - ".explain ON|OFF Turn output mode suitable for EXPLAIN on or off.\n" - ".header(s) ON|OFF Turn display of headers on or off\n" - ".help Show this message\n" - ".import FILE TABLE Import data from FILE into TABLE\n" - ".indices TABLE Show names of all indices on TABLE\n" - ".mode MODE ?TABLE? Set output mode where MODE is one of:\n" - " csv Comma-separated values\n" - " column Left-aligned columns. (See .width)\n" - " html HTML <table> code\n" - " insert SQL insert statements for TABLE\n" - " line One value per line\n" - " list Values delimited by .separator string\n" - " tabs Tab-separated values\n" - " tcl TCL list elements\n" - ".nullvalue STRING Print STRING in place of NULL values\n" - ".output FILENAME Send output to FILENAME\n" - ".output stdout Send output to the screen\n" - ".prompt MAIN CONTINUE Replace the standard prompts\n" - ".quit Exit this program\n" - ".read FILENAME Execute SQL in FILENAME\n" -#ifdef SQLITE_HAS_CODEC - ".rekey OLD NEW NEW Change the encryption key\n" -#endif - ".schema ?TABLE? Show the CREATE statements\n" - ".separator STRING Change separator used by output mode and .import\n" - ".show Show the current values for various settings\n" - ".tables ?PATTERN? List names of tables matching a LIKE pattern\n" - ".timeout MS Try opening locked tables for MS milliseconds\n" - ".width NUM NUM ... Set column widths for \"column\" mode\n" -; - -/* Forward reference */ -static void process_input(struct callback_data *p, FILE *in); - -/* -** Make sure the database is open. If it is not, then open it. If -** the database fails to open, print an error message and exit. -*/ -static void open_db(struct callback_data *p){ - if( p->db==0 ){ - sqlite3_open(p->zDbFilename, &p->db); - db = p->db; -#ifdef SQLITE_HAS_CODEC - sqlite3_key(p->db, p->zKey, p->zKey ? strlen(p->zKey) : 0); -#endif - sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0, - shellstaticFunc, 0, 0); - if( SQLITE_OK!=sqlite3_errcode(db) ){ - fprintf(stderr,"Unable to open database \"%s\": %s\n", - p->zDbFilename, sqlite3_errmsg(db)); - exit(1); - } - } -} - -/* -** Do C-language style dequoting. -** -** \t -> tab -** \n -> newline -** \r -> carriage return -** \NNN -> ascii character NNN in octal -** \\ -> backslash -*/ -static void resolve_backslashes(char *z){ - int i, j, c; - for(i=j=0; (c = z[i])!=0; i++, j++){ - if( c=='\\' ){ - c = z[++i]; - if( c=='n' ){ - c = '\n'; - }else if( c=='t' ){ - c = '\t'; - }else if( c=='r' ){ - c = '\r'; - }else if( c>='0' && c<='7' ){ - c =- '0'; - if( z[i+1]>='0' && z[i+1]<='7' ){ - i++; - c = (c<<3) + z[i] - '0'; - if( z[i+1]>='0' && z[i+1]<='7' ){ - i++; - c = (c<<3) + z[i] - '0'; - } - } - } - } - z[j] = c; - } - z[j] = 0; -} - -/* -** If an input line begins with "." then invoke this routine to -** process that line. -** -** Return 1 to exit and 0 to continue. -*/ -static int do_meta_command(char *zLine, struct callback_data *p){ - int i = 1; - int nArg = 0; - int n, c; - int rc = 0; - char *azArg[50]; - - /* Parse the input line into tokens. - */ - while( zLine[i] && nArg<ArraySize(azArg) ){ - while( isspace((unsigned char)zLine[i]) ){ i++; } - if( zLine[i]==0 ) break; - if( zLine[i]=='\'' || zLine[i]=='"' ){ - int delim = zLine[i++]; - azArg[nArg++] = &zLine[i]; - while( zLine[i] && zLine[i]!=delim ){ i++; } - if( zLine[i]==delim ){ - zLine[i++] = 0; - } - if( delim=='"' ) resolve_backslashes(azArg[nArg-1]); - }else{ - azArg[nArg++] = &zLine[i]; - while( zLine[i] && !isspace((unsigned char)zLine[i]) ){ i++; } - if( zLine[i] ) zLine[i++] = 0; - resolve_backslashes(azArg[nArg-1]); - } - } - - /* Process the input line. - */ - if( nArg==0 ) return rc; - n = strlen(azArg[0]); - c = azArg[0][0]; - if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - struct callback_data data; - char *zErrMsg = 0; - open_db(p); - memcpy(&data, p, sizeof(data)); - data.showHeader = 1; - data.mode = MODE_Column; - data.colWidth[0] = 3; - data.colWidth[1] = 15; - data.colWidth[2] = 58; - data.cnt = 0; - sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg); - if( zErrMsg ){ - fprintf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - } - }else - - if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){ - char *zErrMsg = 0; - open_db(p); - fprintf(p->out, "BEGIN TRANSACTION;\n"); - if( nArg==1 ){ - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE sql NOT NULL AND type=='table'", 0 - ); - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE sql NOT NULL AND type!='table' AND type!='meta'", 0 - ); - }else{ - int i; - for(i=1; i<nArg; i++){ - zShellStatic = azArg[i]; - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE tbl_name LIKE shellstatic() AND type=='table'" - " AND sql NOT NULL", 0); - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE tbl_name LIKE shellstatic() AND type!='table'" - " AND type!='meta' AND sql NOT NULL", 0); - zShellStatic = 0; - } - } - if( zErrMsg ){ - fprintf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - }else{ - fprintf(p->out, "COMMIT;\n"); - } - }else - - if( c=='e' && strncmp(azArg[0], "echo", n)==0 && nArg>1 ){ - int j; - char *z = azArg[1]; - int val = atoi(azArg[1]); - for(j=0; z[j]; j++){ - z[j] = tolower((unsigned char)z[j]); - } - if( strcmp(z,"on")==0 ){ - val = 1; - }else if( strcmp(z,"yes")==0 ){ - val = 1; - } - p->echoOn = val; - }else - - if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){ - rc = 1; - }else - - if( c=='e' && strncmp(azArg[0], "explain", n)==0 ){ - int j; - static char zOne[] = "1"; - char *z = nArg>=2 ? azArg[1] : zOne; - int val = atoi(z); - for(j=0; z[j]; j++){ - z[j] = tolower((unsigned char)z[j]); - } - if( strcmp(z,"on")==0 ){ - val = 1; - }else if( strcmp(z,"yes")==0 ){ - val = 1; - } - if(val == 1) { - if(!p->explainPrev.valid) { - p->explainPrev.valid = 1; - p->explainPrev.mode = p->mode; - p->explainPrev.showHeader = p->showHeader; - memcpy(p->explainPrev.colWidth,p->colWidth,sizeof(p->colWidth)); - } - /* We could put this code under the !p->explainValid - ** condition so that it does not execute if we are already in - ** explain mode. However, always executing it allows us an easy - ** was to reset to explain mode in case the user previously - ** did an .explain followed by a .width, .mode or .header - ** command. - */ - p->mode = MODE_Column; - p->showHeader = 1; - memset(p->colWidth,0,ArraySize(p->colWidth)); - p->colWidth[0] = 4; - p->colWidth[1] = 14; - p->colWidth[2] = 10; - p->colWidth[3] = 10; - p->colWidth[4] = 33; - }else if (p->explainPrev.valid) { - p->explainPrev.valid = 0; - p->mode = p->explainPrev.mode; - p->showHeader = p->explainPrev.showHeader; - memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); - } - }else - - if( c=='h' && (strncmp(azArg[0], "header", n)==0 - || - strncmp(azArg[0], "headers", n)==0 )&& nArg>1 ){ - int j; - char *z = azArg[1]; - int val = atoi(azArg[1]); - for(j=0; z[j]; j++){ - z[j] = tolower((unsigned char)z[j]); - } - if( strcmp(z,"on")==0 ){ - val = 1; - }else if( strcmp(z,"yes")==0 ){ - val = 1; - } - p->showHeader = val; - }else - - if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ - fprintf(stderr,zHelp); - }else - - if( c=='i' && strncmp(azArg[0], "import", n)==0 && nArg>=3 ){ - char *zTable = azArg[2]; /* Insert data into this table */ - char *zFile = azArg[1]; /* The file from which to extract data */ - sqlite3_stmt *pStmt; /* A statement */ - int rc; /* Result code */ - int nCol; /* Number of columns in the table */ - int nByte; /* Number of bytes in an SQL string */ - int i, j; /* Loop counters */ - int nSep; /* Number of bytes in p->separator[] */ - char *zSql; /* An SQL statement */ - char *zLine; /* A single line of input from the file */ - char **azCol; /* zLine[] broken up into columns */ - char *zCommit; /* How to commit changes */ - FILE *in; /* The input file */ - int lineno = 0; /* Line number of input file */ - - nSep = strlen(p->separator); - if( nSep==0 ){ - fprintf(stderr, "non-null separator required for import\n"); - return 0; - } - zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable); - if( zSql==0 ) return 0; - nByte = strlen(zSql); - rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0); - sqlite3_free(zSql); - if( rc ){ - fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); - nCol = 0; - }else{ - nCol = sqlite3_column_count(pStmt); - } - sqlite3_finalize(pStmt); - if( nCol==0 ) return 0; - zSql = malloc( nByte + 20 + nCol*2 ); - if( zSql==0 ) return 0; - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable); - j = strlen(zSql); - for(i=1; i<nCol; i++){ - zSql[j++] = ','; - zSql[j++] = '?'; - } - zSql[j++] = ')'; - zSql[j] = 0; - rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0); - free(zSql); - if( rc ){ - fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); - sqlite3_finalize(pStmt); - return 0; - } - in = fopen(zFile, "rb"); - if( in==0 ){ - fprintf(stderr, "cannot open file: %s\n", zFile); - sqlite3_finalize(pStmt); - return 0; - } - azCol = malloc( sizeof(azCol[0])*(nCol+1) ); - if( azCol==0 ) return 0; - sqlite3_exec(p->db, "BEGIN", 0, 0, 0); - zCommit = "COMMIT"; - while( (zLine = local_getline(0, in))!=0 ){ - char *z; - i = 0; - lineno++; - azCol[0] = zLine; - for(i=0, z=zLine; *z && *z!='\n' && *z!='\r'; z++){ - if( *z==p->separator[0] && strncmp(z, p->separator, nSep)==0 ){ - *z = 0; - i++; - if( i<nCol ){ - azCol[i] = &z[nSep]; - z += nSep-1; - } - } - } - *z = 0; - if( i+1!=nCol ){ - fprintf(stderr,"%s line %d: expected %d columns of data but found %d\n", - zFile, lineno, nCol, i+1); - zCommit = "ROLLBACK"; - break; - } - for(i=0; i<nCol; i++){ - sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC); - } - sqlite3_step(pStmt); - rc = sqlite3_reset(pStmt); - free(zLine); - if( rc!=SQLITE_OK ){ - fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); - zCommit = "ROLLBACK"; - break; - } - } - free(azCol); - fclose(in); - sqlite3_finalize(pStmt); - sqlite3_exec(p->db, zCommit, 0, 0, 0); - }else - - if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){ - struct callback_data data; - char *zErrMsg = 0; - open_db(p); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.mode = MODE_List; - zShellStatic = azArg[1]; - sqlite3_exec(p->db, - "SELECT name FROM sqlite_master " - "WHERE type='index' AND tbl_name LIKE shellstatic() " - "UNION ALL " - "SELECT name FROM sqlite_temp_master " - "WHERE type='index' AND tbl_name LIKE shellstatic() " - "ORDER BY 1", - callback, &data, &zErrMsg - ); - zShellStatic = 0; - if( zErrMsg ){ - fprintf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - } - }else - - if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg>=2 ){ - int n2 = strlen(azArg[1]); - if( strncmp(azArg[1],"line",n2)==0 - || - strncmp(azArg[1],"lines",n2)==0 ){ - p->mode = MODE_Line; - }else if( strncmp(azArg[1],"column",n2)==0 - || - strncmp(azArg[1],"columns",n2)==0 ){ - p->mode = MODE_Column; - }else if( strncmp(azArg[1],"list",n2)==0 ){ - p->mode = MODE_List; - }else if( strncmp(azArg[1],"html",n2)==0 ){ - p->mode = MODE_Html; - }else if( strncmp(azArg[1],"tcl",n2)==0 ){ - p->mode = MODE_Tcl; - }else if( strncmp(azArg[1],"csv",n2)==0 ){ - p->mode = MODE_Csv; - strcpy(p->separator, ","); - }else if( strncmp(azArg[1],"tabs",n2)==0 ){ - p->mode = MODE_List; - strcpy(p->separator, "\t"); - }else if( strncmp(azArg[1],"insert",n2)==0 ){ - p->mode = MODE_Insert; - if( nArg>=3 ){ - set_table_name(p, azArg[2]); - }else{ - set_table_name(p, "table"); - } - }else { - fprintf(stderr,"mode should be on of: " - "column csv html insert line list tabs tcl\n"); - } - }else - - if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 && nArg==2 ) { - sprintf(p->nullvalue, "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); - }else - - if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){ - if( p->out!=stdout ){ - fclose(p->out); - } - if( strcmp(azArg[1],"stdout")==0 ){ - p->out = stdout; - strcpy(p->outfile,"stdout"); - }else{ - p->out = fopen(azArg[1], "wb"); - if( p->out==0 ){ - fprintf(stderr,"can't write to \"%s\"\n", azArg[1]); - p->out = stdout; - } else { - strcpy(p->outfile,azArg[1]); - } - } - }else - - if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){ - if( nArg >= 2) { - strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1); - } - if( nArg >= 3) { - strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1); - } - }else - - if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){ - rc = 1; - }else - - if( c=='r' && strncmp(azArg[0], "read", n)==0 && nArg==2 ){ - FILE *alt = fopen(azArg[1], "rb"); - if( alt==0 ){ - fprintf(stderr,"can't open \"%s\"\n", azArg[1]); - }else{ - process_input(p, alt); - fclose(alt); - } - }else - -#ifdef SQLITE_HAS_CODEC - if( c=='r' && strncmp(azArg[0],"rekey", n)==0 && nArg==4 ){ - char *zOld = p->zKey; - if( zOld==0 ) zOld = ""; - if( strcmp(azArg[1],zOld) ){ - fprintf(stderr,"old key is incorrect\n"); - }else if( strcmp(azArg[2], azArg[3]) ){ - fprintf(stderr,"2nd copy of new key does not match the 1st\n"); - }else{ - sqlite3_free(p->zKey); - p->zKey = sqlite3_mprintf("%s", azArg[2]); - sqlite3_rekey(p->db, p->zKey, strlen(p->zKey)); - } - }else -#endif - - if( c=='s' && strncmp(azArg[0], "schema", n)==0 ){ - struct callback_data data; - char *zErrMsg = 0; - open_db(p); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.mode = MODE_Semi; - if( nArg>1 ){ - int i; - for(i=0; azArg[1][i]; i++) azArg[1][i] = tolower(azArg[1][i]); - if( strcmp(azArg[1],"sqlite_master")==0 ){ - char *new_argv[2], *new_colv[2]; - new_argv[0] = "CREATE TABLE sqlite_master (\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")"; - new_argv[1] = 0; - new_colv[0] = "sql"; - new_colv[1] = 0; - callback(&data, 1, new_argv, new_colv); - }else if( strcmp(azArg[1],"sqlite_temp_master")==0 ){ - char *new_argv[2], *new_colv[2]; - new_argv[0] = "CREATE TEMP TABLE sqlite_temp_master (\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")"; - new_argv[1] = 0; - new_colv[0] = "sql"; - new_colv[1] = 0; - callback(&data, 1, new_argv, new_colv); - }else{ - zShellStatic = azArg[1]; - sqlite3_exec(p->db, - "SELECT sql FROM " - " (SELECT * FROM sqlite_master UNION ALL" - " SELECT * FROM sqlite_temp_master) " - "WHERE tbl_name LIKE shellstatic() AND type!='meta' AND sql NOTNULL " - "ORDER BY substr(type,2,1), name", - callback, &data, &zErrMsg); - zShellStatic = 0; - } - }else{ - sqlite3_exec(p->db, - "SELECT sql FROM " - " (SELECT * FROM sqlite_master UNION ALL" - " SELECT * FROM sqlite_temp_master) " - "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" - "ORDER BY substr(type,2,1), name", - callback, &data, &zErrMsg - ); - } - if( zErrMsg ){ - fprintf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - } - }else - - if( c=='s' && strncmp(azArg[0], "separator", n)==0 && nArg==2 ){ - sprintf(p->separator, "%.*s", (int)ArraySize(p->separator)-1, azArg[1]); - }else - - if( c=='s' && strncmp(azArg[0], "show", n)==0){ - int i; - fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); - fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); - fprintf(p->out,"%9.9s: ", "nullvalue"); - output_c_string(p->out, p->nullvalue); - fprintf(p->out, "\n"); - fprintf(p->out,"%9.9s: %s\n","output", - strlen(p->outfile) ? p->outfile : "stdout"); - fprintf(p->out,"%9.9s: ", "separator"); - output_c_string(p->out, p->separator); - fprintf(p->out, "\n"); - fprintf(p->out,"%9.9s: ","width"); - for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { - fprintf(p->out,"%d ",p->colWidth[i]); - } - fprintf(p->out,"\n"); - }else - - if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 ){ - char **azResult; - int nRow, rc; - char *zErrMsg; - open_db(p); - if( nArg==1 ){ - rc = sqlite3_get_table(p->db, - "SELECT name FROM sqlite_master " - "WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'" - "UNION ALL " - "SELECT name FROM sqlite_temp_master " - "WHERE type IN ('table','view') " - "ORDER BY 1", - &azResult, &nRow, 0, &zErrMsg - ); - }else{ - zShellStatic = azArg[1]; - rc = sqlite3_get_table(p->db, - "SELECT name FROM sqlite_master " - "WHERE type IN ('table','view') AND name LIKE '%'||shellstatic()||'%' " - "UNION ALL " - "SELECT name FROM sqlite_temp_master " - "WHERE type IN ('table','view') AND name LIKE '%'||shellstatic()||'%' " - "ORDER BY 1", - &azResult, &nRow, 0, &zErrMsg - ); - zShellStatic = 0; - } - if( zErrMsg ){ - fprintf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - } - if( rc==SQLITE_OK ){ - int len, maxlen = 0; - int i, j; - int nPrintCol, nPrintRow; - for(i=1; i<=nRow; i++){ - if( azResult[i]==0 ) continue; - len = strlen(azResult[i]); - if( len>maxlen ) maxlen = len; - } - nPrintCol = 80/(maxlen+2); - if( nPrintCol<1 ) nPrintCol = 1; - nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; - for(i=0; i<nPrintRow; i++){ - for(j=i+1; j<=nRow; j+=nPrintRow){ - char *zSp = j<=nPrintRow ? "" : " "; - printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); - } - printf("\n"); - } - } - sqlite3_free_table(azResult); - }else - - if( c=='t' && n>1 && strncmp(azArg[0], "timeout", n)==0 && nArg>=2 ){ - open_db(p); - sqlite3_busy_timeout(p->db, atoi(azArg[1])); - }else - - if( c=='w' && strncmp(azArg[0], "width", n)==0 ){ - int j; - for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){ - p->colWidth[j-1] = atoi(azArg[j]); - } - }else - - { - fprintf(stderr, "unknown command or invalid arguments: " - " \"%s\". Enter \".help\" for help\n", azArg[0]); - } - - return rc; -} - -/* -** Return TRUE if the last non-whitespace character in z[] is a semicolon. -** z[] is N characters long. -*/ -static int _ends_with_semicolon(const char *z, int N){ - while( N>0 && isspace((unsigned char)z[N-1]) ){ N--; } - return N>0 && z[N-1]==';'; -} - -/* -** Test to see if a line consists entirely of whitespace. -*/ -static int _all_whitespace(const char *z){ - for(; *z; z++){ - if( isspace(*(unsigned char*)z) ) continue; - if( *z=='/' && z[1]=='*' ){ - z += 2; - while( *z && (*z!='*' || z[1]!='/') ){ z++; } - if( *z==0 ) return 0; - z++; - continue; - } - if( *z=='-' && z[1]=='-' ){ - z += 2; - while( *z && *z!='\n' ){ z++; } - if( *z==0 ) return 1; - continue; - } - return 0; - } - return 1; -} - -/* -** Return TRUE if the line typed in is an SQL command terminator other -** than a semi-colon. The SQL Server style "go" command is understood -** as is the Oracle "/". -*/ -static int _is_command_terminator(const char *zLine){ - while( isspace(*(unsigned char*)zLine) ){ zLine++; }; - if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1; /* Oracle */ - if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o' - && _all_whitespace(&zLine[2]) ){ - return 1; /* SQL Server */ - } - return 0; -} - -/* -** Read input from *in and process it. If *in==0 then input -** is interactive - the user is typing it it. Otherwise, input -** is coming from a file or device. A prompt is issued and history -** is saved only if input is interactive. An interrupt signal will -** cause this routine to exit immediately, unless input is interactive. -*/ -static void process_input(struct callback_data *p, FILE *in){ - char *zLine; - char *zSql = 0; - int nSql = 0; - char *zErrMsg; - int rc; - while( fflush(p->out), (zLine = one_input_line(zSql, in))!=0 ){ - if( seenInterrupt ){ - if( in!=0 ) break; - seenInterrupt = 0; - } - if( p->echoOn ) printf("%s\n", zLine); - if( (zSql==0 || zSql[0]==0) && _all_whitespace(zLine) ) continue; - if( zLine && zLine[0]=='.' && nSql==0 ){ - int rc = do_meta_command(zLine, p); - free(zLine); - if( rc ) break; - continue; - } - if( _is_command_terminator(zLine) ){ - strcpy(zLine,";"); - } - if( zSql==0 ){ - int i; - for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){} - if( zLine[i]!=0 ){ - nSql = strlen(zLine); - zSql = malloc( nSql+1 ); - strcpy(zSql, zLine); - } - }else{ - int len = strlen(zLine); - zSql = realloc( zSql, nSql + len + 2 ); - if( zSql==0 ){ - fprintf(stderr,"%s: out of memory!\n", Argv0); - exit(1); - } - strcpy(&zSql[nSql++], "\n"); - strcpy(&zSql[nSql], zLine); - nSql += len; - } - free(zLine); - if( zSql && _ends_with_semicolon(zSql, nSql) && sqlite3_complete(zSql) ){ - p->cnt = 0; - open_db(p); - rc = sqlite3_exec(p->db, zSql, callback, p, &zErrMsg); - if( rc || zErrMsg ){ - if( in!=0 && !p->echoOn ) printf("%s\n",zSql); - if( zErrMsg!=0 ){ - printf("SQL error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - zErrMsg = 0; - }else{ - printf("SQL error: %s\n", sqlite3_errmsg(p->db)); - } - } - free(zSql); - zSql = 0; - nSql = 0; - } - } - if( zSql ){ - if( !_all_whitespace(zSql) ) printf("Incomplete SQL: %s\n", zSql); - free(zSql); - } -} - -/* -** Return a pathname which is the user's home directory. A -** 0 return indicates an error of some kind. Space to hold the -** resulting string is obtained from malloc(). The calling -** function should free the result. -*/ -static char *find_home_dir(void){ - char *home_dir = NULL; - -#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__) - struct passwd *pwent; - uid_t uid = getuid(); - if( (pwent=getpwuid(uid)) != NULL) { - home_dir = pwent->pw_dir; - } -#endif - -#ifdef __MACOS__ - char home_path[_MAX_PATH+1]; - home_dir = getcwd(home_path, _MAX_PATH); -#endif - - if (!home_dir) { - home_dir = getenv("HOME"); - if (!home_dir) { - home_dir = getenv("HOMEPATH"); /* Windows? */ - } - } - -#if defined(_WIN32) || defined(WIN32) - if (!home_dir) { - home_dir = "c:"; - } -#endif - - if( home_dir ){ - char *z = malloc( strlen(home_dir)+1 ); - if( z ) strcpy(z, home_dir); - home_dir = z; - } - - return home_dir; -} - -/* -** Read input from the file given by sqliterc_override. Or if that -** parameter is NULL, take input from ~/.sqliterc -*/ -static void process_sqliterc( - struct callback_data *p, /* Configuration data */ - const char *sqliterc_override /* Name of config file. NULL to use default */ -){ - char *home_dir = NULL; - const char *sqliterc = sqliterc_override; - char *zBuf; - FILE *in = NULL; - - if (sqliterc == NULL) { - home_dir = find_home_dir(); - if( home_dir==0 ){ - fprintf(stderr,"%s: cannot locate your home directory!\n", Argv0); - return; - } - zBuf = malloc(strlen(home_dir) + 15); - if( zBuf==0 ){ - fprintf(stderr,"%s: out of memory!\n", Argv0); - exit(1); - } - sprintf(zBuf,"%s/.sqliterc",home_dir); - free(home_dir); - sqliterc = (const char*)zBuf; - } - in = fopen(sqliterc,"rb"); - if( in ){ - if( isatty(fileno(stdout)) ){ - printf("Loading resources from %s\n",sqliterc); - } - process_input(p,in); - fclose(in); - } - return; -} - -/* -** Show available command line options -*/ -static const char zOptions[] = - " -init filename read/process named file\n" - " -echo print commands before execution\n" - " -[no]header turn headers on or off\n" - " -column set output mode to 'column'\n" - " -html set output mode to HTML\n" -#ifdef SQLITE_HAS_CODEC - " -key KEY encryption key\n" -#endif - " -line set output mode to 'line'\n" - " -list set output mode to 'list'\n" - " -separator 'x' set output field separator (|)\n" - " -nullvalue 'text' set text string for NULL values\n" - " -version show SQLite version\n" - " -help show this text, also show dot-commands\n" -; -static void usage(int showDetail){ - fprintf(stderr, "Usage: %s [OPTIONS] FILENAME [SQL]\n", Argv0); - if( showDetail ){ - fprintf(stderr, "Options are:\n%s", zOptions); - }else{ - fprintf(stderr, "Use the -help option for additional information\n"); - } - exit(1); -} - -/* -** Initialize the state information in data -*/ -void main_init(struct callback_data *data) { - memset(data, 0, sizeof(*data)); - data->mode = MODE_List; - strcpy(data->separator,"|"); - data->showHeader = 0; - strcpy(mainPrompt,"sqlite> "); - strcpy(continuePrompt," ...> "); -} - -int main(int argc, char **argv){ - char *zErrMsg = 0; - struct callback_data data; - const char *zInitFile = 0; - char *zFirstCmd = 0; - int i; - -#ifdef __MACOS__ - argc = ccommand(&argv); -#endif - - Argv0 = argv[0]; - main_init(&data); - - /* Make sure we have a valid signal handler early, before anything - ** else is done. - */ -#ifdef SIGINT - signal(SIGINT, interrupt_handler); -#endif - - /* Do an initial pass through the command-line argument to locate - ** the name of the database file, the name of the initialization file, - ** and the first command to execute. - */ - for(i=1; i<argc-1; i++){ - if( argv[i][0]!='-' ) break; - if( strcmp(argv[i],"-separator")==0 || strcmp(argv[i],"-nullvalue")==0 ){ - i++; - }else if( strcmp(argv[i],"-init")==0 ){ - i++; - zInitFile = argv[i]; - }else if( strcmp(argv[i],"-key")==0 ){ - i++; - data.zKey = sqlite3_mprintf("%s",argv[i]); - } - } - if( i<argc ){ - data.zDbFilename = argv[i++]; - }else{ -#ifndef SQLITE_OMIT_MEMORYDB - data.zDbFilename = ":memory:"; -#else - data.zDbFilename = 0; -#endif - } - if( i<argc ){ - zFirstCmd = argv[i++]; - } - data.out = stdout; - -#ifdef SQLITE_OMIT_MEMORYDB - if( data.zDbFilename==0 ){ - fprintf(stderr,"%s: no database filename specified\n", argv[0]); - exit(1); - } -#endif - - /* Go ahead and open the database file if it already exists. If the - ** file does not exist, delay opening it. This prevents empty database - ** files from being created if a user mistypes the database name argument - ** to the sqlite command-line tool. - */ - if( access(data.zDbFilename, 0)==0 ){ - open_db(&data); - } - - /* Process the initialization file if there is one. If no -init option - ** is given on the command line, look for a file named ~/.sqliterc and - ** try to process it. - */ - process_sqliterc(&data,zInitFile); - - /* Make a second pass through the command-line argument and set - ** options. This second pass is delayed until after the initialization - ** file is processed so that the command-line arguments will override - ** settings in the initialization file. - */ - for(i=1; i<argc && argv[i][0]=='-'; i++){ - char *z = argv[i]; - if( strcmp(z,"-init")==0 || strcmp(z,"-key")==0 ){ - i++; - }else if( strcmp(z,"-html")==0 ){ - data.mode = MODE_Html; - }else if( strcmp(z,"-list")==0 ){ - data.mode = MODE_List; - }else if( strcmp(z,"-line")==0 ){ - data.mode = MODE_Line; - }else if( strcmp(z,"-column")==0 ){ - data.mode = MODE_Column; - }else if( strcmp(z,"-separator")==0 ){ - i++; - sprintf(data.separator,"%.*s",(int)sizeof(data.separator)-1,argv[i]); - }else if( strcmp(z,"-nullvalue")==0 ){ - i++; - sprintf(data.nullvalue,"%.*s",(int)sizeof(data.nullvalue)-1,argv[i]); - }else if( strcmp(z,"-header")==0 ){ - data.showHeader = 1; - }else if( strcmp(z,"-noheader")==0 ){ - data.showHeader = 0; - }else if( strcmp(z,"-echo")==0 ){ - data.echoOn = 1; - }else if( strcmp(z,"-version")==0 ){ - printf("%s\n", sqlite3_libversion()); - return 1; - }else if( strcmp(z,"-help")==0 ){ - usage(1); - }else{ - fprintf(stderr,"%s: unknown option: %s\n", Argv0, z); - fprintf(stderr,"Use -help for a list of options.\n"); - return 1; - } - } - - if( zFirstCmd ){ - /* Run just the command that follows the database name - */ - if( zFirstCmd[0]=='.' ){ - do_meta_command(zFirstCmd, &data); - exit(0); - }else{ - int rc; - open_db(&data); - rc = sqlite3_exec(data.db, zFirstCmd, callback, &data, &zErrMsg); - if( rc!=0 && zErrMsg!=0 ){ - fprintf(stderr,"SQL error: %s\n", zErrMsg); - exit(1); - } - } - }else{ - /* Run commands received from standard input - */ - if( isatty(fileno(stdout)) && isatty(fileno(stdin)) ){ - char *zHome; - char *zHistory = 0; - printf( - "SQLite version %s\n" - "Enter \".help\" for instructions\n", - sqlite3_libversion() - ); - zHome = find_home_dir(); - if( zHome && (zHistory = malloc(strlen(zHome)+20))!=0 ){ - sprintf(zHistory,"%s/.sqlite_history", zHome); - } -#if defined(HAVE_READLINE) && HAVE_READLINE==1 - if( zHistory ) read_history(zHistory); -#endif - process_input(&data, 0); - if( zHistory ){ - stifle_history(100); - write_history(zHistory); - } - }else{ - process_input(&data, stdin); - } - } - set_table_name(&data, 0); - if( db ) sqlite3_close(db); - return 0; -} diff --git a/ext/pdo_sqlite/sqlite/src/sqlite.h.in b/ext/pdo_sqlite/sqlite/src/sqlite.h.in deleted file mode 100644 index 6b2dd551d6584..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/sqlite.h.in +++ /dev/null @@ -1,1275 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the SQLite library -** presents to client programs. -** -** @(#) $Id$ -*/ -#ifndef _SQLITE3_H_ -#define _SQLITE3_H_ -#include <stdarg.h> /* Needed for the definition of va_list */ - -/* -** Make sure we can call this stuff from C++. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/* -** The version of the SQLite library. -*/ -#ifdef SQLITE_VERSION -# undef SQLITE_VERSION -#endif -#define SQLITE_VERSION "--VERS--" - -/* -** The format of the version string is "X.Y.Z<trailing string>", where -** X is the major version number, Y is the minor version number and Z -** is the release number. The trailing string is often "alpha" or "beta". -** For example "3.1.1beta". -** -** The SQLITE_VERSION_NUMBER is an integer with the value -** (X*100000 + Y*1000 + Z). For example, for version "3.1.1beta", -** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using -** version 3.1.1 or greater at compile time, programs may use the test -** (SQLITE_VERSION_NUMBER>=3001001). -*/ -#ifdef SQLITE_VERSION_NUMBER -# undef SQLITE_VERSION_NUMBER -#endif -#define SQLITE_VERSION_NUMBER --VERSION-NUMBER-- - -/* -** The version string is also compiled into the library so that a program -** can check to make sure that the lib*.a file and the *.h file are from -** the same version. The sqlite3_libversion() function returns a pointer -** to the sqlite3_version variable - useful in DLLs which cannot access -** global variables. -*/ -extern const char sqlite3_version[]; -const char *sqlite3_libversion(void); - -/* -** Return the value of the SQLITE_VERSION_NUMBER macro when the -** library was compiled. -*/ -int sqlite3_libversion_number(void); - -/* -** Each open sqlite database is represented by an instance of the -** following opaque structure. -*/ -typedef struct sqlite3 sqlite3; - - -/* -** Some compilers do not support the "long long" datatype. So we have -** to do a typedef that for 64-bit integers that depends on what compiler -** is being used. -*/ -#if defined(_MSC_VER) || defined(__BORLANDC__) - typedef __int64 sqlite_int64; - typedef unsigned __int64 sqlite_uint64; -#else - typedef long long int sqlite_int64; - typedef unsigned long long int sqlite_uint64; -#endif - - -/* -** A function to close the database. -** -** Call this function with a pointer to a structure that was previously -** returned from sqlite3_open() and the corresponding database will by closed. -** -** All SQL statements prepared using sqlite3_prepare() or -** sqlite3_prepare16() must be deallocated using sqlite3_finalize() before -** this routine is called. Otherwise, SQLITE_BUSY is returned and the -** database connection remains open. -*/ -int sqlite3_close(sqlite3 *); - -/* -** The type for a callback function. -*/ -typedef int (*sqlite3_callback)(void*,int,char**, char**); - -/* -** A function to executes one or more statements of SQL. -** -** If one or more of the SQL statements are queries, then -** the callback function specified by the 3rd parameter is -** invoked once for each row of the query result. This callback -** should normally return 0. If the callback returns a non-zero -** value then the query is aborted, all subsequent SQL statements -** are skipped and the sqlite3_exec() function returns the SQLITE_ABORT. -** -** The 4th parameter is an arbitrary pointer that is passed -** to the callback function as its first parameter. -** -** The 2nd parameter to the callback function is the number of -** columns in the query result. The 3rd parameter to the callback -** is an array of strings holding the values for each column. -** The 4th parameter to the callback is an array of strings holding -** the names of each column. -** -** The callback function may be NULL, even for queries. A NULL -** callback is not an error. It just means that no callback -** will be invoked. -** -** If an error occurs while parsing or evaluating the SQL (but -** not while executing the callback) then an appropriate error -** message is written into memory obtained from malloc() and -** *errmsg is made to point to that message. The calling function -** is responsible for freeing the memory that holds the error -** message. Use sqlite3_free() for this. If errmsg==NULL, -** then no error message is ever written. -** -** The return value is is SQLITE_OK if there are no errors and -** some other return code if there is an error. The particular -** return value depends on the type of error. -** -** If the query could not be executed because a database file is -** locked or busy, then this function returns SQLITE_BUSY. (This -** behavior can be modified somewhat using the sqlite3_busy_handler() -** and sqlite3_busy_timeout() functions below.) -*/ -int sqlite3_exec( - sqlite3*, /* An open database */ - const char *sql, /* SQL to be executed */ - sqlite3_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg /* Error msg written here */ -); - -/* -** Return values for sqlite3_exec() and sqlite3_step() -*/ -#define SQLITE_OK 0 /* Successful result */ -#define SQLITE_ERROR 1 /* SQL error or missing database */ -#define SQLITE_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */ -#define SQLITE_PERM 3 /* Access permission denied */ -#define SQLITE_ABORT 4 /* Callback routine requested an abort */ -#define SQLITE_BUSY 5 /* The database file is locked */ -#define SQLITE_LOCKED 6 /* A table in the database is locked */ -#define SQLITE_NOMEM 7 /* A malloc() failed */ -#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ -#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ -#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ -#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ -#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */ -#define SQLITE_FULL 13 /* Insertion failed because database is full */ -#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ -#define SQLITE_EMPTY 16 /* Database is empty */ -#define SQLITE_SCHEMA 17 /* The database schema changed */ -#define SQLITE_TOOBIG 18 /* NOT USED. Too much data for one row */ -#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */ -#define SQLITE_MISMATCH 20 /* Data type mismatch */ -#define SQLITE_MISUSE 21 /* Library used incorrectly */ -#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ -#define SQLITE_AUTH 23 /* Authorization denied */ -#define SQLITE_FORMAT 24 /* Auxiliary database format error */ -#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ -#define SQLITE_NOTADB 26 /* File opened that is not a database file */ -#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */ -#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */ - -/* -** Each entry in an SQLite table has a unique integer key. (The key is -** the value of the INTEGER PRIMARY KEY column if there is such a column, -** otherwise the key is generated at random. The unique key is always -** available as the ROWID, OID, or _ROWID_ column.) The following routine -** returns the integer key of the most recent insert in the database. -** -** This function is similar to the mysql_insert_id() function from MySQL. -*/ -sqlite_int64 sqlite3_last_insert_rowid(sqlite3*); - -/* -** This function returns the number of database rows that were changed -** (or inserted or deleted) by the most recent called sqlite3_exec(). -** -** All changes are counted, even if they were later undone by a -** ROLLBACK or ABORT. Except, changes associated with creating and -** dropping tables are not counted. -** -** If a callback invokes sqlite3_exec() recursively, then the changes -** in the inner, recursive call are counted together with the changes -** in the outer call. -** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements form the table.) Because of -** this optimization, the change count for "DELETE FROM table" will be -** zero regardless of the number of elements that were originally in the -** table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. -*/ -int sqlite3_changes(sqlite3*); - -/* -** This function returns the number of database rows that have been -** modified by INSERT, UPDATE or DELETE statements since the database handle -** was opened. This includes UPDATE, INSERT and DELETE statements executed -** as part of trigger programs. All changes are counted as soon as the -** statement that makes them is completed (when the statement handle is -** passed to sqlite3_reset() or sqlite_finalise()). -** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements form the table.) Because of -** this optimization, the change count for "DELETE FROM table" will be -** zero regardless of the number of elements that were originally in the -** table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. -*/ -int sqlite3_total_changes(sqlite3*); - -/* This function causes any pending database operation to abort and -** return at its earliest opportunity. This routine is typically -** called in response to a user action such as pressing "Cancel" -** or Ctrl-C where the user wants a long query operation to halt -** immediately. -*/ -void sqlite3_interrupt(sqlite3*); - - -/* These functions return true if the given input string comprises -** one or more complete SQL statements. For the sqlite3_complete() call, -** the parameter must be a nul-terminated UTF-8 string. For -** sqlite3_complete16(), a nul-terminated machine byte order UTF-16 string -** is required. -** -** The algorithm is simple. If the last token other than spaces -** and comments is a semicolon, then return true. otherwise return -** false. -*/ -int sqlite3_complete(const char *sql); -int sqlite3_complete16(const void *sql); - -/* -** This routine identifies a callback function that is invoked -** whenever an attempt is made to open a database table that is -** currently locked by another process or thread. If the busy callback -** is NULL, then sqlite3_exec() returns SQLITE_BUSY immediately if -** it finds a locked table. If the busy callback is not NULL, then -** sqlite3_exec() invokes the callback with three arguments. The -** second argument is the name of the locked table and the third -** argument is the number of times the table has been busy. If the -** busy callback returns 0, then sqlite3_exec() immediately returns -** SQLITE_BUSY. If the callback returns non-zero, then sqlite3_exec() -** tries to open the table again and the cycle repeats. -** -** The default busy callback is NULL. -** -** Sqlite is re-entrant, so the busy handler may start a new query. -** (It is not clear why anyone would every want to do this, but it -** is allowed, in theory.) But the busy handler may not close the -** database. Closing the database from a busy handler will delete -** data structures out from under the executing query and will -** probably result in a coredump. -*/ -int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); - -/* -** This routine sets a busy handler that sleeps for a while when a -** table is locked. The handler will sleep multiple times until -** at least "ms" milleseconds of sleeping have been done. After -** "ms" milleseconds of sleeping, the handler returns 0 which -** causes sqlite3_exec() to return SQLITE_BUSY. -** -** Calling this routine with an argument less than or equal to zero -** turns off all busy handlers. -*/ -int sqlite3_busy_timeout(sqlite3*, int ms); - -/* -** This next routine is really just a wrapper around sqlite3_exec(). -** Instead of invoking a user-supplied callback for each row of the -** result, this routine remembers each row of the result in memory -** obtained from malloc(), then returns all of the result after the -** query has finished. -** -** As an example, suppose the query result where this table: -** -** Name | Age -** ----------------------- -** Alice | 43 -** Bob | 28 -** Cindy | 21 -** -** If the 3rd argument were &azResult then after the function returns -** azResult will contain the following data: -** -** azResult[0] = "Name"; -** azResult[1] = "Age"; -** azResult[2] = "Alice"; -** azResult[3] = "43"; -** azResult[4] = "Bob"; -** azResult[5] = "28"; -** azResult[6] = "Cindy"; -** azResult[7] = "21"; -** -** Notice that there is an extra row of data containing the column -** headers. But the *nrow return value is still 3. *ncolumn is -** set to 2. In general, the number of values inserted into azResult -** will be ((*nrow) + 1)*(*ncolumn). -** -** After the calling function has finished using the result, it should -** pass the result data pointer to sqlite3_free_table() in order to -** release the memory that was malloc-ed. Because of the way the -** malloc() happens, the calling function must not try to call -** free() directly. Only sqlite3_free_table() is able to release -** the memory properly and safely. -** -** The return value of this routine is the same as from sqlite3_exec(). -*/ -int sqlite3_get_table( - sqlite3*, /* An open database */ - const char *sql, /* SQL to be executed */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg /* Error msg written here */ -); - -/* -** Call this routine to free the memory that sqlite3_get_table() allocated. -*/ -void sqlite3_free_table(char **result); - -/* -** The following routines are variants of the "sprintf()" from the -** standard C library. The resulting string is written into memory -** obtained from malloc() so that there is never a possiblity of buffer -** overflow. These routines also implement some additional formatting -** options that are useful for constructing SQL statements. -** -** The strings returned by these routines should be freed by calling -** sqlite3_free(). -** -** All of the usual printf formatting options apply. In addition, there -** is a "%q" option. %q works like %s in that it substitutes a null-terminated -** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' -** character it escapes that character and allows it to be inserted into -** the string. -** -** For example, so some string variable contains text as follows: -** -** char *zText = "It's a happy day!"; -** -** We can use this text in an SQL statement as follows: -** -** char *z = sqlite3_mprintf("INSERT INTO TABLES('%q')", zText); -** sqlite3_exec(db, z, callback1, 0, 0); -** sqlite3_free(z); -** -** Because the %q format string is used, the '\'' character in zText -** is escaped and the SQL generated is as follows: -** -** INSERT INTO table1 VALUES('It''s a happy day!') -** -** This is correct. Had we used %s instead of %q, the generated SQL -** would have looked like this: -** -** INSERT INTO table1 VALUES('It's a happy day!'); -** -** This second example is an SQL syntax error. As a general rule you -** should always use %q instead of %s when inserting text into a string -** literal. -*/ -char *sqlite3_mprintf(const char*,...); -char *sqlite3_vmprintf(const char*, va_list); -void sqlite3_free(char *z); -char *sqlite3_snprintf(int,char*,const char*, ...); - -#ifndef SQLITE_OMIT_AUTHORIZATION -/* -** This routine registers a callback with the SQLite library. The -** callback is invoked (at compile-time, not at run-time) for each -** attempt to access a column of a table in the database. The callback -** returns SQLITE_OK if access is allowed, SQLITE_DENY if the entire -** SQL statement should be aborted with an error and SQLITE_IGNORE -** if the column should be treated as a NULL value. -*/ -int sqlite3_set_authorizer( - sqlite3*, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), - void *pUserData -); -#endif - -/* -** The second parameter to the access authorization function above will -** be one of the values below. These values signify what kind of operation -** is to be authorized. The 3rd and 4th parameters to the authorization -** function will be parameters or NULL depending on which of the following -** codes is used as the second parameter. The 5th parameter is the name -** of the database ("main", "temp", etc.) if applicable. The 6th parameter -** is the name of the inner-most trigger or view that is responsible for -** the access attempt or NULL if this access attempt is directly from -** input SQL code. -** -** Arg-3 Arg-4 -*/ -#define SQLITE_COPY 0 /* Table Name File Name */ -#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ -#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ -#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ -#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ -#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ -#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ -#define SQLITE_DELETE 9 /* Table Name NULL */ -#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ -#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ -#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ -#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ -#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ -#define SQLITE_DROP_VIEW 17 /* View Name NULL */ -#define SQLITE_INSERT 18 /* Table Name NULL */ -#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ -#define SQLITE_READ 20 /* Table Name Column Name */ -#define SQLITE_SELECT 21 /* NULL NULL */ -#define SQLITE_TRANSACTION 22 /* NULL NULL */ -#define SQLITE_UPDATE 23 /* Table Name Column Name */ -#define SQLITE_ATTACH 24 /* Filename NULL */ -#define SQLITE_DETACH 25 /* Database Name NULL */ -#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ -#define SQLITE_REINDEX 27 /* Index Name NULL */ -#define SQLITE_ANALYZE 28 /* Table Name NULL */ - - -/* -** The return value of the authorization function should be one of the -** following constants: -*/ -/* #define SQLITE_OK 0 // Allow access (This is actually defined above) */ -#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ -#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ - -/* -** Register a function for tracing SQL command evaluation. The function -** registered by sqlite3_trace() is invoked at the first sqlite3_step() -** for the evaluation of an SQL statement. The function registered by -** sqlite3_profile() runs at the end of each SQL statement and includes -** information on how long that statement ran. -** -** The sqlite3_profile() API is currently considered experimental and -** is subject to change. -*/ -void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*); -void *sqlite3_profile(sqlite3*, - void(*xProfile)(void*,const char*,sqlite_uint64), void*); - -/* -** This routine configures a callback function - the progress callback - that -** is invoked periodically during long running calls to sqlite3_exec(), -** sqlite3_step() and sqlite3_get_table(). An example use for this API is to -** keep a GUI updated during a large query. -** -** The progress callback is invoked once for every N virtual machine opcodes, -** where N is the second argument to this function. The progress callback -** itself is identified by the third argument to this function. The fourth -** argument to this function is a void pointer passed to the progress callback -** function each time it is invoked. -** -** If a call to sqlite3_exec(), sqlite3_step() or sqlite3_get_table() results -** in less than N opcodes being executed, then the progress callback is not -** invoked. -** -** To remove the progress callback altogether, pass NULL as the third -** argument to this function. -** -** If the progress callback returns a result other than 0, then the current -** query is immediately terminated and any database changes rolled back. If the -** query was part of a larger transaction, then the transaction is not rolled -** back and remains active. The sqlite3_exec() call returns SQLITE_ABORT. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); - -/* -** Register a callback function to be invoked whenever a new transaction -** is committed. The pArg argument is passed through to the callback. -** callback. If the callback function returns non-zero, then the commit -** is converted into a rollback. -** -** If another function was previously registered, its pArg value is returned. -** Otherwise NULL is returned. -** -** Registering a NULL function disables the callback. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); - -/* -** Open the sqlite database file "filename". The "filename" is UTF-8 -** encoded for sqlite3_open() and UTF-16 encoded in the native byte order -** for sqlite3_open16(). An sqlite3* handle is returned in *ppDb, even -** if an error occurs. If the database is opened (or created) successfully, -** then SQLITE_OK is returned. Otherwise an error code is returned. The -** sqlite3_errmsg() or sqlite3_errmsg16() routines can be used to obtain -** an English language description of the error. -** -** If the database file does not exist, then a new database is created. -** The encoding for the database is UTF-8 if sqlite3_open() is called and -** UTF-16 if sqlite3_open16 is used. -** -** Whether or not an error occurs when it is opened, resources associated -** with the sqlite3* handle should be released by passing it to -** sqlite3_close() when it is no longer required. -*/ -int sqlite3_open( - const char *filename, /* Database filename (UTF-8) */ - sqlite3 **ppDb /* OUT: SQLite db handle */ -); -int sqlite3_open16( - const void *filename, /* Database filename (UTF-16) */ - sqlite3 **ppDb /* OUT: SQLite db handle */ -); - -/* -** Return the error code for the most recent sqlite3_* API call associated -** with sqlite3 handle 'db'. SQLITE_OK is returned if the most recent -** API call was successful. -** -** Calls to many sqlite3_* functions set the error code and string returned -** by sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16() -** (overwriting the previous values). Note that calls to sqlite3_errcode(), -** sqlite3_errmsg() and sqlite3_errmsg16() themselves do not affect the -** results of future invocations. -** -** Assuming no other intervening sqlite3_* API calls are made, the error -** code returned by this function is associated with the same error as -** the strings returned by sqlite3_errmsg() and sqlite3_errmsg16(). -*/ -int sqlite3_errcode(sqlite3 *db); - -/* -** Return a pointer to a UTF-8 encoded string describing in english the -** error condition for the most recent sqlite3_* API call. The returned -** string is always terminated by an 0x00 byte. -** -** The string "not an error" is returned when the most recent API call was -** successful. -*/ -const char *sqlite3_errmsg(sqlite3*); - -/* -** Return a pointer to a UTF-16 native byte order encoded string describing -** in english the error condition for the most recent sqlite3_* API call. -** The returned string is always terminated by a pair of 0x00 bytes. -** -** The string "not an error" is returned when the most recent API call was -** successful. -*/ -const void *sqlite3_errmsg16(sqlite3*); - -/* -** An instance of the following opaque structure is used to represent -** a compiled SQL statment. -*/ -typedef struct sqlite3_stmt sqlite3_stmt; - -/* -** To execute an SQL query, it must first be compiled into a byte-code -** program using one of the following routines. The only difference between -** them is that the second argument, specifying the SQL statement to -** compile, is assumed to be encoded in UTF-8 for the sqlite3_prepare() -** function and UTF-16 for sqlite3_prepare16(). -** -** The first parameter "db" is an SQLite database handle. The second -** parameter "zSql" is the statement to be compiled, encoded as either -** UTF-8 or UTF-16 (see above). If the next parameter, "nBytes", is less -** than zero, then zSql is read up to the first nul terminator. If -** "nBytes" is not less than zero, then it is the length of the string zSql -** in bytes (not characters). -** -** *pzTail is made to point to the first byte past the end of the first -** SQL statement in zSql. This routine only compiles the first statement -** in zSql, so *pzTail is left pointing to what remains uncompiled. -** -** *ppStmt is left pointing to a compiled SQL statement that can be -** executed using sqlite3_step(). Or if there is an error, *ppStmt may be -** set to NULL. If the input text contained no SQL (if the input is and -** empty string or a comment) then *ppStmt is set to NULL. -** -** On success, SQLITE_OK is returned. Otherwise an error code is returned. -*/ -int sqlite3_prepare( - sqlite3 *db, /* Database handle */ - const char *zSql, /* SQL statement, UTF-8 encoded */ - int nBytes, /* Length of zSql in bytes. */ - sqlite3_stmt **ppStmt, /* OUT: Statement handle */ - const char **pzTail /* OUT: Pointer to unused portion of zSql */ -); -int sqlite3_prepare16( - sqlite3 *db, /* Database handle */ - const void *zSql, /* SQL statement, UTF-16 encoded */ - int nBytes, /* Length of zSql in bytes. */ - sqlite3_stmt **ppStmt, /* OUT: Statement handle */ - const void **pzTail /* OUT: Pointer to unused portion of zSql */ -); - -/* -** Pointers to the following two opaque structures are used to communicate -** with the implementations of user-defined functions. -*/ -typedef struct sqlite3_context sqlite3_context; -typedef struct Mem sqlite3_value; - -/* -** In the SQL strings input to sqlite3_prepare() and sqlite3_prepare16(), -** one or more literals can be replace by parameters "?" or ":AAA" or -** "$VVV" where AAA is an identifer and VVV is a variable name according -** to the syntax rules of the TCL programming language. -** The value of these parameters (also called "host parameter names") can -** be set using the routines listed below. -** -** In every case, the first parameter is a pointer to the sqlite3_stmt -** structure returned from sqlite3_prepare(). The second parameter is the -** index of the parameter. The first parameter as an index of 1. For -** named parameters (":AAA" or "$VVV") you can use -** sqlite3_bind_parameter_index() to get the correct index value given -** the parameters name. If the same named parameter occurs more than -** once, it is assigned the same index each time. -** -** The fifth parameter to sqlite3_bind_blob(), sqlite3_bind_text(), and -** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or -** text after SQLite has finished with it. If the fifth argument is the -** special value SQLITE_STATIC, then the library assumes that the information -** is in static, unmanaged space and does not need to be freed. If the -** fifth argument has the value SQLITE_TRANSIENT, then SQLite makes its -** own private copy of the data. -** -** The sqlite3_bind_* routine must be called before sqlite3_step() after -** an sqlite3_prepare() or sqlite3_reset(). Unbound parameterss are -** interpreted as NULL. -*/ -int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); -int sqlite3_bind_double(sqlite3_stmt*, int, double); -int sqlite3_bind_int(sqlite3_stmt*, int, int); -int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64); -int sqlite3_bind_null(sqlite3_stmt*, int); -int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); -int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); -int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); - -/* -** Return the number of parameters in a compiled SQL statement. This -** routine was added to support DBD::SQLite. -*/ -int sqlite3_bind_parameter_count(sqlite3_stmt*); - -/* -** Return the name of the i-th parameter. Ordinary parameters "?" are -** nameless and a NULL is returned. For parameters of the form :AAA or -** $VVV the complete text of the parameter name is returned, including -** the initial ":" or "$". NULL is returned if the index is out of range. -*/ -const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); - -/* -** Return the index of a parameter with the given name. The name -** must match exactly. If no parameter with the given name is found, -** return 0. -*/ -int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); - -/* -** Set all the parameters in the compiled SQL statement to NULL. -*/ -int sqlite3_clear_bindings(sqlite3_stmt*); - -/* -** Return the number of columns in the result set returned by the compiled -** SQL statement. This routine returns 0 if pStmt is an SQL statement -** that does not return data (for example an UPDATE). -*/ -int sqlite3_column_count(sqlite3_stmt *pStmt); - -/* -** The first parameter is a compiled SQL statement. This function returns -** the column heading for the Nth column of that statement, where N is the -** second function parameter. The string returned is UTF-8 for -** sqlite3_column_name() and UTF-16 for sqlite3_column_name16(). -*/ -const char *sqlite3_column_name(sqlite3_stmt*,int); -const void *sqlite3_column_name16(sqlite3_stmt*,int); - -/* -** The first parameter is a compiled SQL statement. If this statement -** is a SELECT statement, the Nth column of the returned result set -** of the SELECT is a table column then the declared type of the table -** column is returned. If the Nth column of the result set is not at table -** column, then a NULL pointer is returned. The returned string is always -** UTF-8 encoded. For example, in the database schema: -** -** CREATE TABLE t1(c1 VARIANT); -** -** And the following statement compiled: -** -** SELECT c1 + 1, 0 FROM t1; -** -** Then this routine would return the string "VARIANT" for the second -** result column (i==1), and a NULL pointer for the first result column -** (i==0). -*/ -const char *sqlite3_column_decltype(sqlite3_stmt *, int i); - -/* -** The first parameter is a compiled SQL statement. If this statement -** is a SELECT statement, the Nth column of the returned result set -** of the SELECT is a table column then the declared type of the table -** column is returned. If the Nth column of the result set is not at table -** column, then a NULL pointer is returned. The returned string is always -** UTF-16 encoded. For example, in the database schema: -** -** CREATE TABLE t1(c1 INTEGER); -** -** And the following statement compiled: -** -** SELECT c1 + 1, 0 FROM t1; -** -** Then this routine would return the string "INTEGER" for the second -** result column (i==1), and a NULL pointer for the first result column -** (i==0). -*/ -const void *sqlite3_column_decltype16(sqlite3_stmt*,int); - -/* -** After an SQL query has been compiled with a call to either -** sqlite3_prepare() or sqlite3_prepare16(), then this function must be -** called one or more times to execute the statement. -** -** The return value will be either SQLITE_BUSY, SQLITE_DONE, -** SQLITE_ROW, SQLITE_ERROR, or SQLITE_MISUSE. -** -** SQLITE_BUSY means that the database engine attempted to open -** a locked database and there is no busy callback registered. -** Call sqlite3_step() again to retry the open. -** -** SQLITE_DONE means that the statement has finished executing -** successfully. sqlite3_step() should not be called again on this virtual -** machine. -** -** If the SQL statement being executed returns any data, then -** SQLITE_ROW is returned each time a new row of data is ready -** for processing by the caller. The values may be accessed using -** the sqlite3_column_*() functions described below. sqlite3_step() -** is called again to retrieve the next row of data. -** -** SQLITE_ERROR means that a run-time error (such as a constraint -** violation) has occurred. sqlite3_step() should not be called again on -** the VM. More information may be found by calling sqlite3_errmsg(). -** -** SQLITE_MISUSE means that the this routine was called inappropriately. -** Perhaps it was called on a virtual machine that had already been -** finalized or on one that had previously returned SQLITE_ERROR or -** SQLITE_DONE. Or it could be the case the the same database connection -** is being used simulataneously by two or more threads. -*/ -int sqlite3_step(sqlite3_stmt*); - -/* -** Return the number of values in the current row of the result set. -** -** After a call to sqlite3_step() that returns SQLITE_ROW, this routine -** will return the same value as the sqlite3_column_count() function. -** After sqlite3_step() has returned an SQLITE_DONE, SQLITE_BUSY or -** error code, or before sqlite3_step() has been called on a -** compiled SQL statement, this routine returns zero. -*/ -int sqlite3_data_count(sqlite3_stmt *pStmt); - -/* -** Values are stored in the database in one of the following fundamental -** types. -*/ -#define SQLITE_INTEGER 1 -#define SQLITE_FLOAT 2 -/* #define SQLITE_TEXT 3 // See below */ -#define SQLITE_BLOB 4 -#define SQLITE_NULL 5 - -/* -** SQLite version 2 defines SQLITE_TEXT differently. To allow both -** version 2 and version 3 to be included, undefine them both if a -** conflict is seen. Define SQLITE3_TEXT to be the version 3 value. -*/ -#ifdef SQLITE_TEXT -# undef SQLITE_TEXT -#else -# define SQLITE_TEXT 3 -#endif -#define SQLITE3_TEXT 3 - -/* -** The next group of routines returns information about the information -** in a single column of the current result row of a query. In every -** case the first parameter is a pointer to the SQL statement that is being -** executed (the sqlite_stmt* that was returned from sqlite3_prepare()) and -** the second argument is the index of the column for which information -** should be returned. iCol is zero-indexed. The left-most column as an -** index of 0. -** -** If the SQL statement is not currently point to a valid row, or if the -** the colulmn index is out of range, the result is undefined. -** -** These routines attempt to convert the value where appropriate. For -** example, if the internal representation is FLOAT and a text result -** is requested, sprintf() is used internally to do the conversion -** automatically. The following table details the conversions that -** are applied: -** -** Internal Type Requested Type Conversion -** ------------- -------------- -------------------------- -** NULL INTEGER Result is 0 -** NULL FLOAT Result is 0.0 -** NULL TEXT Result is an empty string -** NULL BLOB Result is a zero-length BLOB -** INTEGER FLOAT Convert from integer to float -** INTEGER TEXT ASCII rendering of the integer -** INTEGER BLOB Same as for INTEGER->TEXT -** FLOAT INTEGER Convert from float to integer -** FLOAT TEXT ASCII rendering of the float -** FLOAT BLOB Same as FLOAT->TEXT -** TEXT INTEGER Use atoi() -** TEXT FLOAT Use atof() -** TEXT BLOB No change -** BLOB INTEGER Convert to TEXT then use atoi() -** BLOB FLOAT Convert to TEXT then use atof() -** BLOB TEXT Add a \000 terminator if needed -** -** The following access routines are provided: -** -** _type() Return the datatype of the result. This is one of -** SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB, -** or SQLITE_NULL. -** _blob() Return the value of a BLOB. -** _bytes() Return the number of bytes in a BLOB value or the number -** of bytes in a TEXT value represented as UTF-8. The \000 -** terminator is included in the byte count for TEXT values. -** _bytes16() Return the number of bytes in a BLOB value or the number -** of bytes in a TEXT value represented as UTF-16. The \u0000 -** terminator is included in the byte count for TEXT values. -** _double() Return a FLOAT value. -** _int() Return an INTEGER value in the host computer's native -** integer representation. This might be either a 32- or 64-bit -** integer depending on the host. -** _int64() Return an INTEGER value as a 64-bit signed integer. -** _text() Return the value as UTF-8 text. -** _text16() Return the value as UTF-16 text. -*/ -const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); -int sqlite3_column_bytes(sqlite3_stmt*, int iCol); -int sqlite3_column_bytes16(sqlite3_stmt*, int iCol); -double sqlite3_column_double(sqlite3_stmt*, int iCol); -int sqlite3_column_int(sqlite3_stmt*, int iCol); -sqlite_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); -const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); -const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); -int sqlite3_column_type(sqlite3_stmt*, int iCol); - -/* -** The sqlite3_finalize() function is called to delete a compiled -** SQL statement obtained by a previous call to sqlite3_prepare() -** or sqlite3_prepare16(). If the statement was executed successfully, or -** not executed at all, then SQLITE_OK is returned. If execution of the -** statement failed then an error code is returned. -** -** This routine can be called at any point during the execution of the -** virtual machine. If the virtual machine has not completed execution -** when this routine is called, that is like encountering an error or -** an interrupt. (See sqlite3_interrupt().) Incomplete updates may be -** rolled back and transactions cancelled, depending on the circumstances, -** and the result code returned will be SQLITE_ABORT. -*/ -int sqlite3_finalize(sqlite3_stmt *pStmt); - -/* -** The sqlite3_reset() function is called to reset a compiled SQL -** statement obtained by a previous call to sqlite3_prepare() or -** sqlite3_prepare16() back to it's initial state, ready to be re-executed. -** Any SQL statement variables that had values bound to them using -** the sqlite3_bind_*() API retain their values. -*/ -int sqlite3_reset(sqlite3_stmt *pStmt); - -/* -** The following two functions are used to add user functions or aggregates -** implemented in C to the SQL langauge interpreted by SQLite. The -** difference only between the two is that the second parameter, the -** name of the (scalar) function or aggregate, is encoded in UTF-8 for -** sqlite3_create_function() and UTF-16 for sqlite3_create_function16(). -** -** The first argument is the database handle that the new function or -** aggregate is to be added to. If a single program uses more than one -** database handle internally, then user functions or aggregates must -** be added individually to each database handle with which they will be -** used. -** -** The third parameter is the number of arguments that the function or -** aggregate takes. If this parameter is negative, then the function or -** aggregate may take any number of arguments. -** -** The fourth parameter is one of SQLITE_UTF* values defined below, -** indicating the encoding that the function is most likely to handle -** values in. This does not change the behaviour of the programming -** interface. However, if two versions of the same function are registered -** with different encoding values, SQLite invokes the version likely to -** minimize conversions between text encodings. -** -** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are -** pointers to user implemented C functions that implement the user -** function or aggregate. A scalar function requires an implementation of -** the xFunc callback only, NULL pointers should be passed as the xStep -** and xFinal parameters. An aggregate function requires an implementation -** of xStep and xFinal, but NULL should be passed for xFunc. To delete an -** existing user function or aggregate, pass NULL for all three function -** callback. Specifying an inconstent set of callback values, such as an -** xFunc and an xFinal, or an xStep but no xFinal, SQLITE_ERROR is -** returned. -*/ -int sqlite3_create_function( - sqlite3 *, - const char *zFunctionName, - int nArg, - int eTextRep, - void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*) -); -int sqlite3_create_function16( - sqlite3*, - const void *zFunctionName, - int nArg, - int eTextRep, - void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*) -); - -/* -** The next routine returns the number of calls to xStep for a particular -** aggregate function instance. The current call to xStep counts so this -** routine always returns at least 1. -*/ -int sqlite3_aggregate_count(sqlite3_context*); - -/* -** The next group of routines returns information about parameters to -** a user-defined function. Function implementations use these routines -** to access their parameters. These routines are the same as the -** sqlite3_column_* routines except that these routines take a single -** sqlite3_value* pointer instead of an sqlite3_stmt* and an integer -** column number. -*/ -const void *sqlite3_value_blob(sqlite3_value*); -int sqlite3_value_bytes(sqlite3_value*); -int sqlite3_value_bytes16(sqlite3_value*); -double sqlite3_value_double(sqlite3_value*); -int sqlite3_value_int(sqlite3_value*); -sqlite_int64 sqlite3_value_int64(sqlite3_value*); -const unsigned char *sqlite3_value_text(sqlite3_value*); -const void *sqlite3_value_text16(sqlite3_value*); -const void *sqlite3_value_text16le(sqlite3_value*); -const void *sqlite3_value_text16be(sqlite3_value*); -int sqlite3_value_type(sqlite3_value*); - -/* -** Aggregate functions use the following routine to allocate -** a structure for storing their state. The first time this routine -** is called for a particular aggregate, a new structure of size nBytes -** is allocated, zeroed, and returned. On subsequent calls (for the -** same aggregate instance) the same buffer is returned. The implementation -** of the aggregate can use the returned buffer to accumulate data. -** -** The buffer allocated is freed automatically by SQLite. -*/ -void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); - -/* -** The pUserData parameter to the sqlite3_create_function() -** routine used to register user functions is available to -** the implementation of the function using this call. -*/ -void *sqlite3_user_data(sqlite3_context*); - -/* -** The following two functions may be used by scalar user functions to -** associate meta-data with argument values. If the same value is passed to -** multiple invocations of the user-function during query execution, under -** some circumstances the associated meta-data may be preserved. This may -** be used, for example, to add a regular-expression matching scalar -** function. The compiled version of the regular expression is stored as -** meta-data associated with the SQL value passed as the regular expression -** pattern. -** -** Calling sqlite3_get_auxdata() returns a pointer to the meta data -** associated with the Nth argument value to the current user function -** call, where N is the second parameter. If no meta-data has been set for -** that value, then a NULL pointer is returned. -** -** The sqlite3_set_auxdata() is used to associate meta data with a user -** function argument. The third parameter is a pointer to the meta data -** to be associated with the Nth user function argument value. The fourth -** parameter specifies a 'delete function' that will be called on the meta -** data pointer to release it when it is no longer required. If the delete -** function pointer is NULL, it is not invoked. -** -** In practice, meta-data is preserved between function calls for -** expressions that are constant at compile time. This includes literal -** values and SQL variables. -*/ -void *sqlite3_get_auxdata(sqlite3_context*, int); -void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*)); - - -/* -** These are special value for the destructor that is passed in as the -** final argument to routines like sqlite3_result_blob(). If the destructor -** argument is SQLITE_STATIC, it means that the content pointer is constant -** and will never change. It does not need to be destroyed. The -** SQLITE_TRANSIENT value means that the content will likely change in -** the near future and that SQLite should make its own private copy of -** the content before returning. -*/ -#define SQLITE_STATIC ((void(*)(void *))0) -#define SQLITE_TRANSIENT ((void(*)(void *))-1) - -/* -** User-defined functions invoke the following routines in order to -** set their return value. -*/ -void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); -void sqlite3_result_double(sqlite3_context*, double); -void sqlite3_result_error(sqlite3_context*, const char*, int); -void sqlite3_result_error16(sqlite3_context*, const void*, int); -void sqlite3_result_int(sqlite3_context*, int); -void sqlite3_result_int64(sqlite3_context*, sqlite_int64); -void sqlite3_result_null(sqlite3_context*); -void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); -void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); -void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); -void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); -void sqlite3_result_value(sqlite3_context*, sqlite3_value*); - -/* -** These are the allowed values for the eTextRep argument to -** sqlite3_create_collation and sqlite3_create_function. -*/ -#define SQLITE_UTF8 1 -#define SQLITE_UTF16LE 2 -#define SQLITE_UTF16BE 3 -#define SQLITE_UTF16 4 /* Use native byte order */ -#define SQLITE_ANY 5 /* sqlite3_create_function only */ - -/* -** These two functions are used to add new collation sequences to the -** sqlite3 handle specified as the first argument. -** -** The name of the new collation sequence is specified as a UTF-8 string -** for sqlite3_create_collation() and a UTF-16 string for -** sqlite3_create_collation16(). In both cases the name is passed as the -** second function argument. -** -** The third argument must be one of the constants SQLITE_UTF8, -** SQLITE_UTF16LE or SQLITE_UTF16BE, indicating that the user-supplied -** routine expects to be passed pointers to strings encoded using UTF-8, -** UTF-16 little-endian or UTF-16 big-endian respectively. -** -** A pointer to the user supplied routine must be passed as the fifth -** argument. If it is NULL, this is the same as deleting the collation -** sequence (so that SQLite cannot call it anymore). Each time the user -** supplied function is invoked, it is passed a copy of the void* passed as -** the fourth argument to sqlite3_create_collation() or -** sqlite3_create_collation16() as its first parameter. -** -** The remaining arguments to the user-supplied routine are two strings, -** each represented by a [length, data] pair and encoded in the encoding -** that was passed as the third argument when the collation sequence was -** registered. The user routine should return negative, zero or positive if -** the first string is less than, equal to, or greater than the second -** string. i.e. (STRING1 - STRING2). -*/ -int sqlite3_create_collation( - sqlite3*, - const char *zName, - int eTextRep, - void*, - int(*xCompare)(void*,int,const void*,int,const void*) -); -int sqlite3_create_collation16( - sqlite3*, - const char *zName, - int eTextRep, - void*, - int(*xCompare)(void*,int,const void*,int,const void*) -); - -/* -** To avoid having to register all collation sequences before a database -** can be used, a single callback function may be registered with the -** database handle to be called whenever an undefined collation sequence is -** required. -** -** If the function is registered using the sqlite3_collation_needed() API, -** then it is passed the names of undefined collation sequences as strings -** encoded in UTF-8. If sqlite3_collation_needed16() is used, the names -** are passed as UTF-16 in machine native byte order. A call to either -** function replaces any existing callback. -** -** When the user-function is invoked, the first argument passed is a copy -** of the second argument to sqlite3_collation_needed() or -** sqlite3_collation_needed16(). The second argument is the database -** handle. The third argument is one of SQLITE_UTF8, SQLITE_UTF16BE or -** SQLITE_UTF16LE, indicating the most desirable form of the collation -** sequence function required. The fourth parameter is the name of the -** required collation sequence. -** -** The collation sequence is returned to SQLite by a collation-needed -** callback using the sqlite3_create_collation() or -** sqlite3_create_collation16() APIs, described above. -*/ -int sqlite3_collation_needed( - sqlite3*, - void*, - void(*)(void*,sqlite3*,int eTextRep,const char*) -); -int sqlite3_collation_needed16( - sqlite3*, - void*, - void(*)(void*,sqlite3*,int eTextRep,const void*) -); - -/* -** Specify the key for an encrypted database. This routine should be -** called right after sqlite3_open(). -** -** The code to implement this API is not available in the public release -** of SQLite. -*/ -int sqlite3_key( - sqlite3 *db, /* Database to be rekeyed */ - const void *pKey, int nKey /* The key */ -); - -/* -** Change the key on an open database. If the current database is not -** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the -** database is decrypted. -** -** The code to implement this API is not available in the public release -** of SQLite. -*/ -int sqlite3_rekey( - sqlite3 *db, /* Database to be rekeyed */ - const void *pKey, int nKey /* The new key */ -); - -/* -** Sleep for a little while. The second parameter is the number of -** miliseconds to sleep for. -** -** If the operating system does not support sleep requests with -** milisecond time resolution, then the time will be rounded up to -** the nearest second. The number of miliseconds of sleep actually -** requested from the operating system is returned. -*/ -int sqlite3_sleep(int); - -/* -** Return TRUE (non-zero) if the statement supplied as an argument needs -** to be recompiled. A statement needs to be recompiled whenever the -** execution environment changes in a way that would alter the program -** that sqlite3_prepare() generates. For example, if new functions or -** collating sequences are registered or if an authorizer function is -** added or changed. -** -*/ -int sqlite3_expired(sqlite3_stmt*); - -/* -** Move all bindings from the first prepared statement over to the second. -** This routine is useful, for example, if the first prepared statement -** fails with an SQLITE_SCHEMA error. The same SQL can be prepared into -** the second prepared statement then all of the bindings transfered over -** to the second statement before the first statement is finalized. -*/ -int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); - -/* -** If the following global variable is made to point to a -** string which is the name of a directory, then all temporary files -** created by SQLite will be placed in that directory. If this variable -** is NULL pointer, then SQLite does a search for an appropriate temporary -** file directory. -** -** Once sqlite3_open() has been called, changing this variable will invalidate -** the current temporary database, if any. -*/ -extern char *sqlite3_temp_directory; - -/* -** This function is called to recover from a malloc() failure that occured -** within the SQLite library. Normally, after a single malloc() fails the -** library refuses to function (all major calls return SQLITE_NOMEM). -** This function restores the library state so that it can be used again. -** -** All existing statements (sqlite3_stmt pointers) must be finalized or -** reset before this call is made. Otherwise, SQLITE_BUSY is returned. -** If any in-memory databases are in use, either as a main or TEMP -** database, SQLITE_ERROR is returned. In either of these cases, the -** library is not reset and remains unusable. -** -** This function is *not* threadsafe. Calling this from within a threaded -** application when threads other than the caller have used SQLite is -** dangerous and will almost certainly result in malfunctions. -** -** This functionality can be omitted from a build by defining the -** SQLITE_OMIT_GLOBALRECOVER at compile time. -*/ -int sqlite3_global_recover(); - -/* -** Test to see whether or not the database connection is in autocommit -** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on -** by default. Autocommit is disabled by a BEGIN statement and reenabled -** by the next COMMIT or ROLLBACK. -*/ -int sqlite3_get_autocommit(sqlite3*); - -/* -** Return the sqlite3* database handle to which the prepared statement given -** in the argument belongs. This is the same database handle that was -** the first argument to the sqlite3_prepare() that was used to create -** the statement in the first place. -*/ -sqlite3 *sqlite3_db_handle(sqlite3_stmt*); - -#ifdef __cplusplus -} /* End of the 'extern "C"' block */ -#endif -#endif diff --git a/ext/pdo_sqlite/sqlite/src/sqliteInt.h b/ext/pdo_sqlite/sqlite/src/sqliteInt.h deleted file mode 100644 index 1635369c4a7b2..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/sqliteInt.h +++ /dev/null @@ -1,1664 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Internal interface definitions for SQLite. -** -** @(#) $Id$ -*/ -#ifndef _SQLITEINT_H_ -#define _SQLITEINT_H_ - -/* -** Many people are failing to set -DNDEBUG=1 when compiling SQLite. -** Setting NDEBUG makes the code smaller and run faster. So the following -** lines are added to automatically set NDEBUG unless the -DSQLITE_DEBUG=1 -** option is set. Thus NDEBUG becomes an opt-in rather than an opt-out -** feature. -*/ -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) -# define NDEBUG 1 -#endif - -/* -** These #defines should enable >2GB file support on Posix if the -** underlying operating system supports it. If the OS lacks -** large file support, or if the OS is windows, these should be no-ops. -** -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch -** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: RedHat 7.2) but you want your code to work -** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 -** without this option, LFS is enable. But LFS does not exist in the kernel -** in RedHat 6.0, so the code won't work. Hence, for maximum binary -** portability you should omit LFS. -** -** Similar is true for MacOS. LFS is only supported on MacOS 9 and later. -*/ -#ifndef SQLITE_DISABLE_LFS -# define _LARGE_FILE 1 -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# define _LARGEFILE_SOURCE 1 -#endif - -#include "sqlite3.h" -#include "hash.h" -#include "parse.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <stddef.h> - -/* -** The maximum number of in-memory pages to use for the main database -** table and for temporary tables. Internally, the MAX_PAGES and -** TEMP_PAGES macros are used. To override the default values at -** compilation time, the SQLITE_DEFAULT_CACHE_SIZE and -** SQLITE_DEFAULT_TEMP_CACHE_SIZE macros should be set. -*/ -#ifdef SQLITE_DEFAULT_CACHE_SIZE -# define MAX_PAGES SQLITE_DEFAULT_CACHE_SIZE -#else -# define MAX_PAGES 2000 -#endif -#ifdef SQLITE_DEFAULT_TEMP_CACHE_SIZE -# define TEMP_PAGES SQLITE_DEFAULT_TEMP_CACHE_SIZE -#else -# define TEMP_PAGES 500 -#endif - -/* -** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0 -** afterward. Having this macro allows us to cause the C compiler -** to omit code used by TEMP tables without messy #ifndef statements. -*/ -#ifdef SQLITE_OMIT_TEMPDB -#define OMIT_TEMPDB 1 -#else -#define OMIT_TEMPDB 0 -#endif - -/* -** If the following macro is set to 1, then NULL values are considered -** distinct for the SELECT DISTINCT statement and for UNION or EXCEPT -** compound queries. No other SQL database engine (among those tested) -** works this way except for OCELOT. But the SQL92 spec implies that -** this is how things should work. -** -** If the following macro is set to 0, then NULLs are indistinct for -** SELECT DISTINCT and for UNION. -*/ -#define NULL_ALWAYS_DISTINCT 0 - -/* -** If the following macro is set to 1, then NULL values are considered -** distinct when determining whether or not two entries are the same -** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL, -** OCELOT, and Firebird all work. The SQL92 spec explicitly says this -** is the way things are suppose to work. -** -** If the following macro is set to 0, the NULLs are indistinct for -** a UNIQUE index. In this mode, you can only have a single NULL entry -** for a column declared UNIQUE. This is the way Informix and SQL Server -** work. -*/ -#define NULL_DISTINCT_FOR_UNIQUE 1 - -/* -** The maximum number of attached databases. This must be at least 2 -** in order to support the main database file (0) and the file used to -** hold temporary tables (1). And it must be less than 32 because -** we use a bitmask of databases with a u32 in places (for example -** the Parse.cookieMask field). -*/ -#define MAX_ATTACHED 10 - -/* -** The maximum value of a ?nnn wildcard that the parser will accept. -*/ -#define SQLITE_MAX_VARIABLE_NUMBER 999 - -/* -** When building SQLite for embedded systems where memory is scarce, -** you can define one or more of the following macros to omit extra -** features of the library and thus keep the size of the library to -** a minimum. -*/ -/* #define SQLITE_OMIT_AUTHORIZATION 1 */ -/* #define SQLITE_OMIT_MEMORYDB 1 */ -/* #define SQLITE_OMIT_VACUUM 1 */ -/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */ -/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */ -/* #define SQLITE_OMIT_AUTOVACUUM */ -/* #define SQLITE_OMIT_ALTERTABLE */ - -/* -** Provide a default value for TEMP_STORE in case it is not specified -** on the command-line -*/ -#ifndef TEMP_STORE -# define TEMP_STORE 1 -#endif - -/* -** GCC does not define the offsetof() macro so we'll have to do it -** ourselves. -*/ -#ifndef offsetof -#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD)) -#endif - -/* -** Integers of known sizes. These typedefs might change for architectures -** where the sizes very. Preprocessor macros are available so that the -** types can be conveniently redefined at compile-type. Like this: -** -** cc '-DUINTPTR_TYPE=long long int' ... -*/ -#ifndef UINT64_TYPE -# if defined(_MSC_VER) || defined(__BORLANDC__) -# define UINT64_TYPE unsigned __int64 -# else -# define UINT64_TYPE unsigned long long int -# endif -#endif -#ifndef UINT32_TYPE -# define UINT32_TYPE unsigned int -#endif -#ifndef UINT16_TYPE -# define UINT16_TYPE unsigned short int -#endif -#ifndef INT16_TYPE -# define INT16_TYPE short int -#endif -#ifndef UINT8_TYPE -# define UINT8_TYPE unsigned char -#endif -#ifndef INT8_TYPE -# define INT8_TYPE signed char -#endif -#ifndef LONGDOUBLE_TYPE -# define LONGDOUBLE_TYPE long double -#endif -typedef sqlite_int64 i64; /* 8-byte signed integer */ -typedef UINT64_TYPE u64; /* 8-byte unsigned integer */ -typedef UINT32_TYPE u32; /* 4-byte unsigned integer */ -typedef UINT16_TYPE u16; /* 2-byte unsigned integer */ -typedef INT16_TYPE i16; /* 2-byte signed integer */ -typedef UINT8_TYPE u8; /* 1-byte unsigned integer */ -typedef UINT8_TYPE i8; /* 1-byte signed integer */ - -/* -** Macros to determine whether the machine is big or little endian, -** evaluated at runtime. -*/ -extern const int sqlite3one; -#define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0) -#define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1) - -/* -** An instance of the following structure is used to store the busy-handler -** callback for a given sqlite handle. -** -** The sqlite.busyHandler member of the sqlite struct contains the busy -** callback for the database handle. Each pager opened via the sqlite -** handle is passed a pointer to sqlite.busyHandler. The busy-handler -** callback is currently invoked only from within pager.c. -*/ -typedef struct BusyHandler BusyHandler; -struct BusyHandler { - int (*xFunc)(void *,int); /* The busy callback */ - void *pArg; /* First arg to busy callback */ - int nBusy; /* Incremented with each busy call */ -}; - -/* -** Defer sourcing vdbe.h and btree.h until after the "u8" and -** "BusyHandler typedefs. -*/ -#include "vdbe.h" -#include "btree.h" - -/* -** This macro casts a pointer to an integer. Useful for doing -** pointer arithmetic. -*/ -#define Addr(X) ((uptr)X) - -/* -** If memory allocation problems are found, recompile with -** -** -DSQLITE_DEBUG=1 -** -** to enable some sanity checking on malloc() and free(). To -** check for memory leaks, recompile with -** -** -DSQLITE_DEBUG=2 -** -** and a line of text will be written to standard error for -** each malloc() and free(). This output can be analyzed -** by an AWK script to determine if there are any leaks. -*/ -#ifdef SQLITE_MEMDEBUG -# define sqliteMalloc(X) sqlite3Malloc_(X,1,__FILE__,__LINE__) -# define sqliteMallocRaw(X) sqlite3Malloc_(X,0,__FILE__,__LINE__) -# define sqliteFree(X) sqlite3Free_(X,__FILE__,__LINE__) -# define sqliteRealloc(X,Y) sqlite3Realloc_(X,Y,__FILE__,__LINE__) -# define sqliteStrDup(X) sqlite3StrDup_(X,__FILE__,__LINE__) -# define sqliteStrNDup(X,Y) sqlite3StrNDup_(X,Y,__FILE__,__LINE__) -#else -# define sqliteFree sqlite3FreeX -# define sqliteMalloc sqlite3Malloc -# define sqliteMallocRaw sqlite3MallocRaw -# define sqliteRealloc sqlite3Realloc -# define sqliteStrDup sqlite3StrDup -# define sqliteStrNDup sqlite3StrNDup -#endif - -/* -** This variable gets set if malloc() ever fails. After it gets set, -** the SQLite library shuts down permanently. -*/ -extern int sqlite3_malloc_failed; - -/* -** The following global variables are used for testing and debugging -** only. They only work if SQLITE_DEBUG is defined. -*/ -#ifdef SQLITE_MEMDEBUG -extern int sqlite3_nMalloc; /* Number of sqliteMalloc() calls */ -extern int sqlite3_nFree; /* Number of sqliteFree() calls */ -extern int sqlite3_iMallocFail; /* Fail sqliteMalloc() after this many calls */ -extern int sqlite3_iMallocReset; /* Set iMallocFail to this when it reaches 0 */ -#endif - -/* -** Name of the master database table. The master database table -** is a special table that holds the names and attributes of all -** user tables and indices. -*/ -#define MASTER_NAME "sqlite_master" -#define TEMP_MASTER_NAME "sqlite_temp_master" - -/* -** The root-page of the master database table. -*/ -#define MASTER_ROOT 1 - -/* -** The name of the schema table. -*/ -#define SCHEMA_TABLE(x) ((!OMIT_TEMPDB)&&(x==1)?TEMP_MASTER_NAME:MASTER_NAME) - -/* -** A convenience macro that returns the number of elements in -** an array. -*/ -#define ArraySize(X) (sizeof(X)/sizeof(X[0])) - -/* -** Forward references to structures -*/ -typedef struct AggInfo AggInfo; -typedef struct AuthContext AuthContext; -typedef struct CollSeq CollSeq; -typedef struct Column Column; -typedef struct Db Db; -typedef struct Expr Expr; -typedef struct ExprList ExprList; -typedef struct FKey FKey; -typedef struct FuncDef FuncDef; -typedef struct IdList IdList; -typedef struct Index Index; -typedef struct KeyClass KeyClass; -typedef struct KeyInfo KeyInfo; -typedef struct NameContext NameContext; -typedef struct Parse Parse; -typedef struct Select Select; -typedef struct SrcList SrcList; -typedef struct Table Table; -typedef struct Token Token; -typedef struct TriggerStack TriggerStack; -typedef struct TriggerStep TriggerStep; -typedef struct Trigger Trigger; -typedef struct WhereInfo WhereInfo; -typedef struct WhereLevel WhereLevel; - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. -*/ -struct Db { - char *zName; /* Name of this database */ - Btree *pBt; /* The B*Tree structure for this database file */ - int schema_cookie; /* Database schema version number for this file */ - Hash tblHash; /* All tables indexed by name */ - Hash idxHash; /* All (named) indices indexed by name */ - Hash trigHash; /* All triggers indexed by name */ - Hash aFKey; /* Foreign keys indexed by to-table */ - u16 flags; /* Flags associated with this database */ - u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */ - u8 safety_level; /* How aggressive at synching data to disk */ - int cache_size; /* Number of pages to use in the cache */ - Table *pSeqTab; /* The sqlite_sequence table used by AUTOINCREMENT */ - void *pAux; /* Auxiliary data. Usually NULL */ - void (*xFreeAux)(void*); /* Routine to free pAux */ -}; - -/* -** These macros can be used to test, set, or clear bits in the -** Db.flags field. -*/ -#define DbHasProperty(D,I,P) (((D)->aDb[I].flags&(P))==(P)) -#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].flags&(P))!=0) -#define DbSetProperty(D,I,P) (D)->aDb[I].flags|=(P) -#define DbClearProperty(D,I,P) (D)->aDb[I].flags&=~(P) - -/* -** Allowed values for the DB.flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. -*/ -#define DB_SchemaLoaded 0x0001 /* The schema has been loaded */ -#define DB_UnresetViews 0x0002 /* Some views have defined column names */ - -#define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE) - -/* -** Each database is an instance of the following structure. -** -** The sqlite.lastRowid records the last insert rowid generated by an -** insert statement. Inserts on views do not affect its value. Each -** trigger has its own context, so that lastRowid can be updated inside -** triggers as usual. The previous value will be restored once the trigger -** exits. Upon entering a before or instead of trigger, lastRowid is no -** longer (since after version 2.8.12) reset to -1. -** -** The sqlite.nChange does not count changes within triggers and keeps no -** context. It is reset at start of sqlite3_exec. -** The sqlite.lsChange represents the number of changes made by the last -** insert, update, or delete statement. It remains constant throughout the -** length of a statement and is then updated by OP_SetCounts. It keeps a -** context stack just like lastRowid so that the count of changes -** within a trigger is not seen outside the trigger. Changes to views do not -** affect the value of lsChange. -** The sqlite.csChange keeps track of the number of current changes (since -** the last statement) and is used to update sqlite_lsChange. -** -** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16 -** store the most recent error code and, if applicable, string. The -** internal function sqlite3Error() is used to set these variables -** consistently. -*/ -struct sqlite3 { - int nDb; /* Number of backends currently in use */ - Db *aDb; /* All backends */ - int flags; /* Miscellanous flags. See below */ - int errCode; /* Most recent error code (SQLITE_*) */ - u8 enc; /* Text encoding for this database. */ - u8 autoCommit; /* The auto-commit flag. */ - u8 file_format; /* What file format version is this database? */ - u8 temp_store; /* 1: file 2: memory 0: default */ - int nTable; /* Number of tables in the database */ - CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ - i64 lastRowid; /* ROWID of most recent insert (see above) */ - i64 priorNewRowid; /* Last randomly generated ROWID */ - int magic; /* Magic number for detect library misuse */ - int nChange; /* Value returned by sqlite3_changes() */ - int nTotalChange; /* Value returned by sqlite3_total_changes() */ - struct sqlite3InitInfo { /* Information used during initialization */ - int iDb; /* When back is being initialized */ - int newTnum; /* Rootpage of table being initialized */ - u8 busy; /* TRUE if currently initializing */ - } init; - struct Vdbe *pVdbe; /* List of active virtual machines */ - int activeVdbeCnt; /* Number of vdbes currently executing */ - void (*xTrace)(void*,const char*); /* Trace function */ - void *pTraceArg; /* Argument to the trace function */ - void (*xProfile)(void*,const char*,u64); /* Profiling function */ - void *pProfileArg; /* Argument to profile function */ - void *pCommitArg; /* Argument to xCommitCallback() */ - int (*xCommitCallback)(void*);/* Invoked at every commit. */ - void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*); - void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*); - void *pCollNeededArg; - sqlite3_value *pValue; /* Value used for transient conversions */ - sqlite3_value *pErr; /* Most recent error message */ - char *zErrMsg; /* Most recent error message (UTF-8 encoded) */ - char *zErrMsg16; /* Most recent error message (UTF-16 encoded) */ -#ifndef SQLITE_OMIT_AUTHORIZATION - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); - /* Access authorization function */ - void *pAuthArg; /* 1st argument to the access auth function */ -#endif -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - int (*xProgress)(void *); /* The progress callback */ - void *pProgressArg; /* Argument to the progress callback */ - int nProgressOps; /* Number of opcodes for progress callback */ -#endif -#ifndef SQLITE_OMIT_GLOBALRECOVER - sqlite3 *pNext; /* Linked list of open db handles. */ -#endif - Hash aFunc; /* All functions that can be in SQL exprs */ - Hash aCollSeq; /* All collating sequences */ - BusyHandler busyHandler; /* Busy callback */ - int busyTimeout; /* Busy handler timeout, in msec */ - Db aDbStatic[2]; /* Static space for the 2 default backends */ -#ifdef SQLITE_SSE - sqlite3_stmt *pFetch; /* Used by SSE to fetch stored statements */ -#endif -}; - -/* -** Possible values for the sqlite.flags and or Db.flags fields. -** -** On sqlite.flags, the SQLITE_InTrans value means that we have -** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement -** transaction is active on that particular database file. -*/ -#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ -#define SQLITE_Initialized 0x00000002 /* True after initialization */ -#define SQLITE_Interrupt 0x00000004 /* Cancel current operation */ -#define SQLITE_InTrans 0x00000008 /* True if in a transaction */ -#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */ -#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */ -#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */ -#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */ - /* DELETE, or UPDATE and return */ - /* the count using a callback. */ -#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */ - /* result set is empty */ -#define SQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */ -#define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */ -#define SQLITE_WriteSchema 0x00000800 /* OK to update SQLITE_MASTER */ -#define SQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when - ** accessing read-only databases */ - -/* -** Possible values for the sqlite.magic field. -** The numbers are obtained at random and have no special meaning, other -** than being distinct from one another. -*/ -#define SQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */ -#define SQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */ -#define SQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */ -#define SQLITE_MAGIC_ERROR 0xb5357930 /* An SQLITE_MISUSE error occurred */ - -/* -** Each SQL function is defined by an instance of the following -** structure. A pointer to this structure is stored in the sqlite.aFunc -** hash table. When multiple functions have the same name, the hash table -** points to a linked list of these structures. -*/ -struct FuncDef { - i16 nArg; /* Number of arguments. -1 means unlimited */ - u8 iPrefEnc; /* Preferred text encoding (SQLITE_UTF8, 16LE, 16BE) */ - u8 needCollSeq; /* True if sqlite3GetFuncCollSeq() might be called */ - u8 flags; /* Some combination of SQLITE_FUNC_* */ - void *pUserData; /* User data parameter */ - FuncDef *pNext; /* Next function with same name */ - void (*xFunc)(sqlite3_context*,int,sqlite3_value**); /* Regular function */ - void (*xStep)(sqlite3_context*,int,sqlite3_value**); /* Aggregate step */ - void (*xFinalize)(sqlite3_context*); /* Aggregate finializer */ - char zName[1]; /* SQL name of the function. MUST BE LAST */ -}; - -/* -** Possible values for FuncDef.flags -*/ -#define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ -#define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ - -/* -** information about each column of an SQL table is held in an instance -** of this structure. -*/ -struct Column { - char *zName; /* Name of this column */ - Expr *pDflt; /* Default value of this column */ - char *zType; /* Data type for this column */ - CollSeq *pColl; /* Collating sequence. If NULL, use the default */ - u8 notNull; /* True if there is a NOT NULL constraint */ - u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */ - char affinity; /* One of the SQLITE_AFF_... values */ -}; - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** There may two seperate implementations of the collation function, one -** that processes text in UTF-8 encoding (CollSeq.xCmp) and another that -** processes text encoded in UTF-16 (CollSeq.xCmp16), using the machine -** native byte order. When a collation sequence is invoked, SQLite selects -** the version that will require the least expensive encoding -** transalations, if any. -** -** The CollSeq.pUser member variable is an extra parameter that passed in -** as the first argument to the UTF-8 comparison function, xCmp. -** CollSeq.pUser16 is the equivalent for the UTF-16 comparison function, -** xCmp16. -** -** If both CollSeq.xCmp and CollSeq.xCmp16 are NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. -*/ -struct CollSeq { - char *zName; /* Name of the collating sequence, UTF-8 encoded */ - u8 enc; /* Text encoding handled by xCmp() */ - u8 type; /* One of the SQLITE_COLL_... values below */ - void *pUser; /* First argument to xCmp() */ - int (*xCmp)(void*,int, const void*, int, const void*); -}; - -/* -** Allowed values of CollSeq flags: -*/ -#define SQLITE_COLL_BINARY 1 /* The default memcmp() collating sequence */ -#define SQLITE_COLL_NOCASE 2 /* The built-in NOCASE collating sequence */ -#define SQLITE_COLL_REVERSE 3 /* The built-in REVERSE collating sequence */ -#define SQLITE_COLL_USER 0 /* Any other user-defined collating sequence */ - -/* -** A sort order can be either ASC or DESC. -*/ -#define SQLITE_SO_ASC 0 /* Sort in ascending order */ -#define SQLITE_SO_DESC 1 /* Sort in ascending order */ - -/* -** Column affinity types. -*/ -#define SQLITE_AFF_INTEGER 'i' -#define SQLITE_AFF_NUMERIC 'n' -#define SQLITE_AFF_TEXT 't' -#define SQLITE_AFF_NONE 'o' - - -/* -** Each SQL table is represented in memory by an instance of the -** following structure. -** -** Table.zName is the name of the table. The case of the original -** CREATE TABLE statement is stored, but case is not significant for -** comparisons. -** -** Table.nCol is the number of columns in this table. Table.aCol is a -** pointer to an array of Column structures, one for each column. -** -** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of -** the column that is that key. Otherwise Table.iPKey is negative. Note -** that the datatype of the PRIMARY KEY must be INTEGER for this field to -** be set. An INTEGER PRIMARY KEY is used as the rowid for each row of -** the table. If a table has no INTEGER PRIMARY KEY, then a random rowid -** is generated for each row of the table. Table.hasPrimKey is true if -** the table has any PRIMARY KEY, INTEGER or otherwise. -** -** Table.tnum is the page number for the root BTree page of the table in the -** database file. If Table.iDb is the index of the database table backend -** in sqlite.aDb[]. 0 is for the main database and 1 is for the file that -** holds temporary tables and indices. If Table.isTransient -** is true, then the table is stored in a file that is automatically deleted -** when the VDBE cursor to the table is closed. In this case Table.tnum -** refers VDBE cursor number that holds the table open, not to the root -** page number. Transient tables are used to hold the results of a -** sub-query that appears instead of a real table name in the FROM clause -** of a SELECT statement. -*/ -struct Table { - char *zName; /* Name of the table */ - int nCol; /* Number of columns in this table */ - Column *aCol; /* Information about each column */ - int iPKey; /* If not less then 0, use aCol[iPKey] as the primary key */ - Index *pIndex; /* List of SQL indexes on this table. */ - int tnum; /* Root BTree node for this table (see note above) */ - Select *pSelect; /* NULL for tables. Points to definition if a view. */ - u8 readOnly; /* True if this table should not be written by the user */ - u8 iDb; /* Index into sqlite.aDb[] of the backend for this table */ - u8 isTransient; /* True if automatically deleted when VDBE finishes */ - u8 hasPrimKey; /* True if there exists a primary key */ - u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ - u8 autoInc; /* True if the integer primary key is autoincrement */ - int nRef; /* Number of pointers to this Table */ - Trigger *pTrigger; /* List of SQL triggers on this table */ - FKey *pFKey; /* Linked list of all foreign keys in this table */ - char *zColAff; /* String defining the affinity of each column */ -#ifndef SQLITE_OMIT_ALTERTABLE - int addColOffset; /* Offset in CREATE TABLE statement to add a new column */ -#endif -}; - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existance of the to-table is not checked -** until an attempt is made to insert data into the from-table. -** -** The sqlite.aFKey hash table stores pointers to this structure -** given the name of a to-table. For each to-table, all foreign keys -** associated with that table are on a linked list using the FKey.pNextTo -** field. -*/ -struct FKey { - Table *pFrom; /* The table that constains the REFERENCES clause */ - FKey *pNextFrom; /* Next foreign key in pFrom */ - char *zTo; /* Name of table that the key points to */ - FKey *pNextTo; /* Next foreign key that points to zTo */ - int nCol; /* Number of columns in this key */ - struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ - int iFrom; /* Index of column in pFrom */ - char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */ - } *aCol; /* One entry for each of nCol column s */ - u8 isDeferred; /* True if constraint checking is deferred till COMMIT */ - u8 updateConf; /* How to resolve conflicts that occur on UPDATE */ - u8 deleteConf; /* How to resolve conflicts that occur on DELETE */ - u8 insertConf; /* How to resolve conflicts that occur on INSERT */ -}; - -/* -** SQLite supports many different ways to resolve a contraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** -** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The following symbolic values are used to record which type -** of action to take. -*/ -#define OE_None 0 /* There is no constraint to check */ -#define OE_Rollback 1 /* Fail the operation and rollback the transaction */ -#define OE_Abort 2 /* Back out changes but do no rollback transaction */ -#define OE_Fail 3 /* Stop the operation but leave all prior changes */ -#define OE_Ignore 4 /* Ignore the error. Do not do the INSERT or UPDATE */ -#define OE_Replace 5 /* Delete existing record, then do INSERT or UPDATE */ - -#define OE_Restrict 6 /* OE_Abort for IMMEDIATE, OE_Rollback for DEFERRED */ -#define OE_SetNull 7 /* Set the foreign key value to NULL */ -#define OE_SetDflt 8 /* Set the foreign key value to its default */ -#define OE_Cascade 9 /* Cascade the changes */ - -#define OE_Default 99 /* Do whatever the default action is */ - - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** If the KeyInfo.incrKey value is true and the comparison would -** otherwise be equal, then return a result as if the second key -** were larger. -*/ -struct KeyInfo { - u8 enc; /* Text encoding - one of the TEXT_Utf* values */ - u8 incrKey; /* Increase 2nd key by epsilon before comparison */ - int nField; /* Number of entries in aColl[] */ - u8 *aSortOrder; /* If defined an aSortOrder[i] is true, sort DESC */ - CollSeq *aColl[1]; /* Collating sequence for each term of the key */ -}; - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicate the which conflict resolution -** algorithm to employ whenever an attempt is made to insert a non-unique -** element. -*/ -struct Index { - char *zName; /* Name of this index */ - int nColumn; /* Number of columns in the table used by this index */ - int *aiColumn; /* Which columns are used by this index. 1st is 0 */ - unsigned *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ - Table *pTable; /* The SQL table being indexed */ - int tnum; /* Page containing root of this index in database file */ - u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ - u8 iDb; /* Index in sqlite.aDb[] of where this index is stored */ - char *zColAff; /* String defining the affinity of each column */ - Index *pNext; /* The next index associated with the same table */ - KeyInfo keyInfo; /* Info on how to order keys. MUST BE LAST */ -}; - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** Note if Token.z==0 then Token.dyn and Token.n are undefined and -** may contain random values. Do not make any assuptions about Token.dyn -** and Token.n when Token.z==0. -*/ -struct Token { - const unsigned char *z; /* Text of the token. Not NULL-terminated! */ - unsigned dyn : 1; /* True for malloced memory, false for static */ - unsigned n : 31; /* Number of characters in this token */ -}; - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iColumn field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. -*/ -struct AggInfo { - u8 directMode; /* Direct rendering mode means take data directly - ** from source tables rather than from accumulators */ - u8 useSortingIdx; /* In direct mode, reference the sorting index rather - ** than the source table */ - int sortingIdx; /* Cursor number of the sorting index */ - ExprList *pGroupBy; /* The group by clause */ - int nSortingColumn; /* Number of columns in the sorting index */ - struct AggInfo_col { /* For each column used in source tables */ - int iTable; /* Cursor number of the source table */ - int iColumn; /* Column number within the source table */ - int iSorterColumn; /* Column number in the sorting index */ - int iMem; /* Memory location that acts as accumulator */ - Expr *pExpr; /* The original expression */ - } *aCol; - int nColumn; /* Number of used entries in aCol[] */ - int nColumnAlloc; /* Number of slots allocated for aCol[] */ - int nAccumulator; /* Number of columns that show through to the output. - ** Additional columns are used only as parameters to - ** aggregate functions */ - struct AggInfo_func { /* For each aggregate function */ - Expr *pExpr; /* Expression encoding the function */ - FuncDef *pFunc; /* The aggregate function implementation */ - int iMem; /* Memory location that acts as accumulator */ - int iDistinct; /* Virtual table used to enforce DISTINCT */ - } *aFunc; - int nFunc; /* Number of entries in aFunc[] */ - int nFuncAlloc; /* Number of slots allocated for aFunc[] */ -}; - -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** Expr.pRight and Expr.pLeft are subexpressions. Expr.pList is a list -** of argument if the expression is a function. -** -** Expr.token is the operator token for this node. For some expressions -** that have subexpressions, Expr.token can be the complete text that gave -** rise to the Expr. In the latter case, the token is marked as being -** a compound token. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is a function, the Expr.iTable is an integer code -** representing which function. If the expression is an unbound variable -** marker (a question mark character '?' in the original SQL) then the -** Expr.iTable holds the index number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** The Expr.pSelect field points to a SELECT statement. The SELECT might -** be the right operand of an IN operator. Or, if a scalar SELECT appears -** in an expression the opcode is TK_SELECT and Expr.pSelect is the only -** operand. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -*/ -struct Expr { - u8 op; /* Operation performed by this node */ - char affinity; /* The affinity of the column or 0 if not a column */ - u8 iDb; /* Database referenced by this expression */ - u8 flags; /* Various flags. See below */ - CollSeq *pColl; /* The collation type of the column or 0 */ - Expr *pLeft, *pRight; /* Left and right subnodes */ - ExprList *pList; /* A list of expressions used as function arguments - ** or in "<expr> IN (<expr-list)" */ - Token token; /* An operand token */ - Token span; /* Complete text of the expression */ - int iTable, iColumn; /* When op==TK_COLUMN, then this expr node means the - ** iColumn-th field of the iTable-th table. */ - AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ - int iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ - int iRightJoinTable; /* If EP_FromJoin, the right table of the join */ - Select *pSelect; /* When the expression is a sub-select. Also the - ** right side of "<expr> IN (<select>)" */ - Table *pTab; /* Table for OP_Column expressions. */ -}; - -/* -** The following are the meanings of bits in the Expr.flags field. -*/ -#define EP_FromJoin 0x01 /* Originated in ON or USING clause of a join */ -#define EP_Agg 0x02 /* Contains one or more aggregate functions */ -#define EP_Resolved 0x04 /* IDs have been resolved to COLUMNs */ -#define EP_Error 0x08 /* Expression contains one or more errors */ -#define EP_Distinct 0x10 /* Aggregate function with DISTINCT keyword */ -#define EP_VarSelect 0x20 /* pSelect is correlated, not constant */ -#define EP_Dequoted 0x40 /* True if the string has been dequoted */ - -/* -** These macros can be used to test, set, or clear bits in the -** Expr.flags field. -*/ -#define ExprHasProperty(E,P) (((E)->flags&(P))==(P)) -#define ExprHasAnyProperty(E,P) (((E)->flags&(P))!=0) -#define ExprSetProperty(E,P) (E)->flags|=(P) -#define ExprClearProperty(E,P) (E)->flags&=~(P) - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -*/ -struct ExprList { - int nExpr; /* Number of expressions on the list */ - int nAlloc; /* Number of entries allocated below */ - int iECursor; /* VDBE Cursor associated with this ExprList */ - struct ExprList_item { - Expr *pExpr; /* The list of expressions */ - char *zName; /* Token associated with this expression */ - u8 sortOrder; /* 1 for DESC or 0 for ASC */ - u8 isAgg; /* True if this is an aggregate like count(*) */ - u8 done; /* A flag to indicate when processing is finished */ - } *a; /* One entry for each expression */ -}; - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. -*/ -struct IdList { - struct IdList_item { - char *zName; /* Name of the identifier */ - int idx; /* Index in some Table.aCol[] of a column named zName */ - } *a; - int nId; /* Number of identifiers on the list */ - int nAlloc; /* Number of entries allocated for a[] below */ -}; - -/* -** The bitmask datatype defined below is used for various optimizations. -*/ -typedef unsigned int Bitmask; - -/* -** The following structure describes the FROM clause of a SELECT statement. -** Each table or subquery in the FROM clause is a separate element of -** the SrcList.a[] array. -** -** With the addition of multiple database support, the following structure -** can also be used to describe a particular table such as the table that -** is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL, -** such a table must be a simple name: ID. But in SQLite, the table can -** now be identified by a database name, a dot, then the table name: ID.ID. -*/ -struct SrcList { - i16 nSrc; /* Number of tables or subqueries in the FROM clause */ - i16 nAlloc; /* Number of entries allocated in a[] below */ - struct SrcList_item { - char *zDatabase; /* Name of database holding this table */ - char *zName; /* Name of the table */ - char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */ - Table *pTab; /* An SQL table corresponding to zName */ - Select *pSelect; /* A SELECT statement used in place of a table name */ - u8 jointype; /* Type of join between this table and the next */ - i16 iCursor; /* The VDBE cursor number used to access this table */ - Expr *pOn; /* The ON clause of a join */ - IdList *pUsing; /* The USING clause of a join */ - Bitmask colUsed; /* Bit N (1<<N) set if column N or pTab is used */ - } a[1]; /* One entry for each identifier on the list */ -}; - -/* -** Permitted values of the SrcList.a.jointype field -*/ -#define JT_INNER 0x0001 /* Any kind of inner or cross join */ -#define JT_CROSS 0x0002 /* Explicit use of the CROSS keyword */ -#define JT_NATURAL 0x0004 /* True for a "natural" join */ -#define JT_LEFT 0x0008 /* Left outer join */ -#define JT_RIGHT 0x0010 /* Right outer join */ -#define JT_OUTER 0x0020 /* The "OUTER" keyword is present */ -#define JT_ERROR 0x0040 /* unknown or unsupported join type */ - -/* -** For each nested loop in a WHERE clause implementation, the WhereInfo -** structure contains a single instance of this structure. This structure -** is intended to be private the the where.c module and should not be -** access or modified by other modules. -*/ -struct WhereLevel { - int iFrom; /* Which entry in the FROM clause */ - int flags; /* Flags associated with this level */ - int iMem; /* First memory cell used by this level */ - int iLeftJoin; /* Memory cell used to implement LEFT OUTER JOIN */ - Index *pIdx; /* Index used. NULL if no index */ - int iTabCur; /* The VDBE cursor used to access the table */ - int iIdxCur; /* The VDBE cursor used to acesss pIdx */ - int brk; /* Jump here to break out of the loop */ - int cont; /* Jump here to continue with the next loop cycle */ - int top; /* First instruction of interior of the loop */ - int op, p1, p2; /* Opcode used to terminate the loop */ - int nEq; /* Number of == or IN constraints on this loop */ - int nIn; /* Number of IN operators constraining this loop */ - int *aInLoop; /* Loop terminators for IN operators */ -}; - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -*/ -struct WhereInfo { - Parse *pParse; - SrcList *pTabList; /* List of tables in the join */ - int iTop; /* The very beginning of the WHERE loop */ - int iContinue; /* Jump here to continue with next record */ - int iBreak; /* Jump here to break out of the loop */ - int nLevel; /* Number of nested loop */ - WhereLevel a[1]; /* Information about each nest loop in the WHERE */ -}; - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. -*/ -struct NameContext { - Parse *pParse; /* The parser */ - SrcList *pSrcList; /* One or more tables used to resolve names */ - ExprList *pEList; /* Optional list of named expressions */ - int nRef; /* Number of names resolved by this context */ - int nErr; /* Number of errors encountered while resolving names */ - u8 allowAgg; /* Aggregate functions allowed here */ - u8 hasAgg; /* True if aggregates are seen */ - int nDepth; /* Depth of subquery recursion. 1 for no recursion */ - AggInfo *pAggInfo; /* Information about aggregates at this level */ - NameContext *pNext; /* Next outer name context. NULL for outermost */ -}; - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** nLimit is set to -1 if there is no LIMIT clause. nOffset is set to 0. -** If there is a LIMIT clause, the parser sets nLimit to the value of the -** limit and nOffset to the value of the offset (or 0 if there is not -** offset). But later on, nLimit and nOffset become the memory locations -** in the VDBE that record the limit and offset counters. -** -** addrOpenVirt[] entries contain the address of OP_OpenVirtual opcodes. -** These addresses must be stored so that we can go back and fill in -** the P3_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenVirtual instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenVirt[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenVirt[2] contains collating -** sequences for the ORDER BY clause. -*/ -struct Select { - ExprList *pEList; /* The fields of the result */ - u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ - u8 isDistinct; /* True if the DISTINCT keyword is present */ - u8 isResolved; /* True once sqlite3SelectResolve() has run. */ - u8 isAgg; /* True if this is an aggregate query */ - u8 usesVirt; /* True if uses an OpenVirtual opcode */ - u8 disallowOrderBy; /* Do not allow an ORDER BY to be attached if TRUE */ - SrcList *pSrc; /* The FROM clause */ - Expr *pWhere; /* The WHERE clause */ - ExprList *pGroupBy; /* The GROUP BY clause */ - Expr *pHaving; /* The HAVING clause */ - ExprList *pOrderBy; /* The ORDER BY clause */ - Select *pPrior; /* Prior select in a compound select statement */ - Select *pRightmost; /* Right-most select in a compound select statement */ - Expr *pLimit; /* LIMIT expression. NULL means not used. */ - Expr *pOffset; /* OFFSET expression. NULL means not used. */ - int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ - int addrOpenVirt[3]; /* OP_OpenVirtual opcodes related to this select */ -}; - -/* -** The results of a select can be distributed in several ways. -*/ -#define SRT_Union 1 /* Store result as keys in an index */ -#define SRT_Except 2 /* Remove result from a UNION index */ -#define SRT_Discard 3 /* Do not save the results anywhere */ - -/* The ORDER BY clause is ignored for all of the above */ -#define IgnorableOrderby(X) (X<=SRT_Discard) - -#define SRT_Callback 4 /* Invoke a callback with each row of result */ -#define SRT_Mem 5 /* Store result in a memory cell */ -#define SRT_Set 6 /* Store non-null results as keys in an index */ -#define SRT_Table 7 /* Store result as data with an automatic rowid */ -#define SRT_VirtualTab 8 /* Create virtual table and store like SRT_Table */ -#define SRT_Subroutine 9 /* Call a subroutine to handle results */ -#define SRT_Exists 10 /* Put 0 or 1 in a memory cell */ - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -*/ -struct Parse { - sqlite3 *db; /* The main database structure */ - int rc; /* Return code from execution */ - char *zErrMsg; /* An error message */ - Vdbe *pVdbe; /* An engine for executing database bytecode */ - u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ - u8 nameClash; /* A permanent table name clashes with temp table name */ - u8 checkSchema; /* Causes schema cookie check after an error */ - u8 nested; /* Number of nested calls to the parser/code generator */ - int nErr; /* Number of errors seen */ - int nTab; /* Number of previously allocated VDBE cursors */ - int nMem; /* Number of memory cells used so far */ - int nSet; /* Number of sets used so far */ - u32 writeMask; /* Start a write transaction on these databases */ - u32 cookieMask; /* Bitmask of schema verified databases */ - int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ - int cookieValue[MAX_ATTACHED+2]; /* Values of cookies to verify */ - - /* Above is constant between recursions. Below is reset before and after - ** each recursion */ - - int nVar; /* Number of '?' variables seen in the SQL so far */ - int nVarExpr; /* Number of used slots in apVarExpr[] */ - int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */ - Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */ - u8 explain; /* True if the EXPLAIN flag is found on the query */ - Token sErrToken; /* The token at which the error occurred */ - Token sNameToken; /* Token with unqualified schema object name */ - Token sLastToken; /* The last token parsed */ - const char *zSql; /* All SQL text */ - const char *zTail; /* All SQL text past the last semicolon parsed */ - Table *pNewTable; /* A table being constructed by CREATE TABLE */ - Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ - TriggerStack *trigStack; /* Trigger actions being coded */ - const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ -}; - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. -*/ -struct AuthContext { - const char *zAuthContext; /* Put saved Parse.zAuthContext here */ - Parse *pParse; /* The Parse structure */ -}; - -/* -** Bitfield flags for P2 value in OP_Insert and OP_Delete -*/ -#define OPFLAG_NCHANGE 1 /* Set to update db->nChange */ -#define OPFLAG_LASTROWID 2 /* Set to update db->lastRowid */ - -/* - * Each trigger present in the database schema is stored as an instance of - * struct Trigger. - * - * Pointers to instances of struct Trigger are stored in two ways. - * 1. In the "trigHash" hash table (part of the sqlite3* that represents the - * database). This allows Trigger structures to be retrieved by name. - * 2. All triggers associated with a single table form a linked list, using the - * pNext member of struct Trigger. A pointer to the first element of the - * linked list is stored as the "pTrigger" member of the associated - * struct Table. - * - * The "step_list" member points to the first element of a linked list - * containing the SQL statements specified as the trigger program. - */ -struct Trigger { - char *name; /* The name of the trigger */ - char *table; /* The table or view to which the trigger applies */ - u8 iDb; /* Database containing this trigger */ - u8 iTabDb; /* Database containing Trigger.table */ - u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT */ - u8 tr_tm; /* One of TRIGGER_BEFORE, TRIGGER_AFTER */ - Expr *pWhen; /* The WHEN clause of the expresion (may be NULL) */ - IdList *pColumns; /* If this is an UPDATE OF <column-list> trigger, - the <column-list> is stored here */ - int foreach; /* One of TK_ROW or TK_STATEMENT */ - Token nameToken; /* Token containing zName. Use during parsing only */ - - TriggerStep *step_list; /* Link list of trigger program steps */ - Trigger *pNext; /* Next trigger associated with the table */ -}; - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. -*/ -#define TRIGGER_BEFORE 1 -#define TRIGGER_AFTER 2 - -/* - * An instance of struct TriggerStep is used to store a single SQL statement - * that is a part of a trigger-program. - * - * Instances of struct TriggerStep are stored in a singly linked list (linked - * using the "pNext" member) referenced by the "step_list" member of the - * associated struct Trigger instance. The first element of the linked list is - * the first step of the trigger-program. - * - * The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or - * "SELECT" statement. The meanings of the other members is determined by the - * value of "op" as follows: - * - * (op == TK_INSERT) - * orconf -> stores the ON CONFLICT algorithm - * pSelect -> If this is an INSERT INTO ... SELECT ... statement, then - * this stores a pointer to the SELECT statement. Otherwise NULL. - * target -> A token holding the name of the table to insert into. - * pExprList -> If this is an INSERT INTO ... VALUES ... statement, then - * this stores values to be inserted. Otherwise NULL. - * pIdList -> If this is an INSERT INTO ... (<column-names>) VALUES ... - * statement, then this stores the column-names to be - * inserted into. - * - * (op == TK_DELETE) - * target -> A token holding the name of the table to delete from. - * pWhere -> The WHERE clause of the DELETE statement if one is specified. - * Otherwise NULL. - * - * (op == TK_UPDATE) - * target -> A token holding the name of the table to update rows of. - * pWhere -> The WHERE clause of the UPDATE statement if one is specified. - * Otherwise NULL. - * pExprList -> A list of the columns to update and the expressions to update - * them to. See sqlite3Update() documentation of "pChanges" - * argument. - * - */ -struct TriggerStep { - int op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */ - int orconf; /* OE_Rollback etc. */ - Trigger *pTrig; /* The trigger that this step is a part of */ - - Select *pSelect; /* Valid for SELECT and sometimes - INSERT steps (when pExprList == 0) */ - Token target; /* Valid for DELETE, UPDATE, INSERT steps */ - Expr *pWhere; /* Valid for DELETE, UPDATE steps */ - ExprList *pExprList; /* Valid for UPDATE statements and sometimes - INSERT steps (when pSelect == 0) */ - IdList *pIdList; /* Valid for INSERT statements only */ - - TriggerStep * pNext; /* Next in the link-list */ -}; - -/* - * An instance of struct TriggerStack stores information required during code - * generation of a single trigger program. While the trigger program is being - * coded, its associated TriggerStack instance is pointed to by the - * "pTriggerStack" member of the Parse structure. - * - * The pTab member points to the table that triggers are being coded on. The - * newIdx member contains the index of the vdbe cursor that points at the temp - * table that stores the new.* references. If new.* references are not valid - * for the trigger being coded (for example an ON DELETE trigger), then newIdx - * is set to -1. The oldIdx member is analogous to newIdx, for old.* references. - * - * The ON CONFLICT policy to be used for the trigger program steps is stored - * as the orconf member. If this is OE_Default, then the ON CONFLICT clause - * specified for individual triggers steps is used. - * - * struct TriggerStack has a "pNext" member, to allow linked lists to be - * constructed. When coding nested triggers (triggers fired by other triggers) - * each nested trigger stores its parent trigger's TriggerStack as the "pNext" - * pointer. Once the nested trigger has been coded, the pNext value is restored - * to the pTriggerStack member of the Parse stucture and coding of the parent - * trigger continues. - * - * Before a nested trigger is coded, the linked list pointed to by the - * pTriggerStack is scanned to ensure that the trigger is not about to be coded - * recursively. If this condition is detected, the nested trigger is not coded. - */ -struct TriggerStack { - Table *pTab; /* Table that triggers are currently being coded on */ - int newIdx; /* Index of vdbe cursor to "new" temp table */ - int oldIdx; /* Index of vdbe cursor to "old" temp table */ - int orconf; /* Current orconf policy */ - int ignoreJump; /* where to jump to for a RAISE(IGNORE) */ - Trigger *pTrigger; /* The trigger currently being coded */ - TriggerStack *pNext; /* Next trigger down on the trigger stack */ -}; - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. -*/ -typedef struct DbFixer DbFixer; -struct DbFixer { - Parse *pParse; /* The parsing context. Error messages written here */ - const char *zDb; /* Make sure all objects are contained in this database */ - const char *zType; /* Type of the container - used for error messages */ - const Token *pName; /* Name of the container - used for error messages */ -}; - -/* -** A pointer to this structure is used to communicate information -** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. -*/ -typedef struct { - sqlite3 *db; /* The database being initialized */ - char **pzErrMsg; /* Error message stored here */ -} InitData; - -/* - * This global flag is set for performance testing of triggers. When it is set - * SQLite will perform the overhead of building new and old trigger references - * even when no triggers exist - */ -extern int sqlite3_always_code_trigger_setup; - -/* -** The SQLITE_CORRUPT_BKPT macro can be either a constant (for production -** builds) or a function call (for debugging). If it is a function call, -** it allows the operator to set a breakpoint at the spot where database -** corruption is first detected. -*/ -#ifdef SQLITE_DEBUG - extern int sqlite3Corrupt(void); -# define SQLITE_CORRUPT_BKPT sqlite3Corrupt() -#else -# define SQLITE_CORRUPT_BKPT SQLITE_CORRUPT -#endif - -/* -** Internal function prototypes -*/ -int sqlite3StrICmp(const char *, const char *); -int sqlite3StrNICmp(const char *, const char *, int); -int sqlite3HashNoCase(const char *, int); -int sqlite3IsNumber(const char*, int*, u8); -int sqlite3Compare(const char *, const char *); -int sqlite3SortCompare(const char *, const char *); -void sqlite3RealToSortable(double r, char *); -#ifdef SQLITE_MEMDEBUG - void *sqlite3Malloc_(int,int,char*,int); - void sqlite3Free_(void*,char*,int); - void *sqlite3Realloc_(void*,int,char*,int); - char *sqlite3StrDup_(const char*,char*,int); - char *sqlite3StrNDup_(const char*, int,char*,int); - void sqlite3CheckMemory(void*,int); -#else - void *sqlite3Malloc(int); - void *sqlite3MallocRaw(int); - void sqlite3Free(void*); - void *sqlite3Realloc(void*,int); - char *sqlite3StrDup(const char*); - char *sqlite3StrNDup(const char*, int); -# define sqlite3CheckMemory(a,b) -# define sqlite3MallocX sqlite3Malloc -#endif -void sqlite3ReallocOrFree(void**,int); -void sqlite3FreeX(void*); -void *sqlite3MallocX(int); -char *sqlite3MPrintf(const char*, ...); -char *sqlite3VMPrintf(const char*, va_list); -void sqlite3DebugPrintf(const char*, ...); -void *sqlite3TextToPtr(const char*); -void sqlite3SetString(char **, ...); -void sqlite3ErrorMsg(Parse*, const char*, ...); -void sqlite3Dequote(char*); -void sqlite3DequoteExpr(Expr*); -int sqlite3KeywordCode(const char*, int); -int sqlite3RunParser(Parse*, const char*, char **); -void sqlite3FinishCoding(Parse*); -Expr *sqlite3Expr(int, Expr*, Expr*, const Token*); -Expr *sqlite3RegisterExpr(Parse*,Token*); -Expr *sqlite3ExprAnd(Expr*, Expr*); -void sqlite3ExprSpan(Expr*,Token*,Token*); -Expr *sqlite3ExprFunction(ExprList*, Token*); -void sqlite3ExprAssignVarNumber(Parse*, Expr*); -void sqlite3ExprDelete(Expr*); -ExprList *sqlite3ExprListAppend(ExprList*,Expr*,Token*); -void sqlite3ExprListDelete(ExprList*); -int sqlite3Init(sqlite3*, char**); -int sqlite3InitCallback(void*, int, char**, char**); -void sqlite3Pragma(Parse*,Token*,Token*,Token*,int); -void sqlite3ResetInternalSchema(sqlite3*, int); -void sqlite3BeginParse(Parse*,int); -void sqlite3RollbackInternalChanges(sqlite3*); -void sqlite3CommitInternalChanges(sqlite3*); -Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*); -void sqlite3OpenMasterTable(Vdbe *v, int); -void sqlite3StartTable(Parse*,Token*,Token*,Token*,int,int); -void sqlite3AddColumn(Parse*,Token*); -void sqlite3AddNotNull(Parse*, int); -void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int); -void sqlite3AddColumnType(Parse*,Token*); -void sqlite3AddDefaultValue(Parse*,Expr*); -void sqlite3AddCollateType(Parse*, const char*, int); -void sqlite3EndTable(Parse*,Token*,Token*,Select*); - -#ifndef SQLITE_OMIT_VIEW - void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int); - int sqlite3ViewGetColumnNames(Parse*,Table*); -#else -# define sqlite3ViewGetColumnNames(A,B) 0 -#endif - -void sqlite3DropTable(Parse*, SrcList*, int); -void sqlite3DeleteTable(sqlite3*, Table*); -void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int); -int sqlite3ArrayAllocate(void**,int,int); -IdList *sqlite3IdListAppend(IdList*, Token*); -int sqlite3IdListIndex(IdList*,const char*); -SrcList *sqlite3SrcListAppend(SrcList*, Token*, Token*); -void sqlite3SrcListAddAlias(SrcList*, Token*); -void sqlite3SrcListAssignCursors(Parse*, SrcList*); -void sqlite3IdListDelete(IdList*); -void sqlite3SrcListDelete(SrcList*); -void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*, - Token*); -void sqlite3DropIndex(Parse*, SrcList*); -void sqlite3AddKeyType(Vdbe*, ExprList*); -void sqlite3AddIdxKeyType(Vdbe*, Index*); -int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff); -Select *sqlite3SelectNew(ExprList*,SrcList*,Expr*,ExprList*,Expr*,ExprList*, - int,Expr*,Expr*); -void sqlite3SelectDelete(Select*); -void sqlite3SelectUnbind(Select*); -Table *sqlite3SrcListLookup(Parse*, SrcList*); -int sqlite3IsReadOnly(Parse*, Table*, int); -void sqlite3OpenTableForReading(Vdbe*, int iCur, Table*); -void sqlite3OpenTable(Vdbe*, int iCur, Table*, int); -void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); -void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); -WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**); -void sqlite3WhereEnd(WhereInfo*); -void sqlite3ExprCode(Parse*, Expr*); -void sqlite3ExprCodeAndCache(Parse*, Expr*); -int sqlite3ExprCodeExprList(Parse*, ExprList*); -void sqlite3ExprIfTrue(Parse*, Expr*, int, int); -void sqlite3ExprIfFalse(Parse*, Expr*, int, int); -void sqlite3NextedParse(Parse*, const char*, ...); -Table *sqlite3FindTable(sqlite3*,const char*, const char*); -Table *sqlite3LocateTable(Parse*,const char*, const char*); -Index *sqlite3FindIndex(sqlite3*,const char*, const char*); -void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*); -void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*); -void sqlite3Vacuum(Parse*, Token*); -int sqlite3RunVacuum(char**, sqlite3*); -char *sqlite3NameFromToken(Token*); -int sqlite3ExprCheck(Parse*, Expr*, int, int*); -int sqlite3ExprCompare(Expr*, Expr*); -int sqliteFuncId(Token*); -int sqlite3ExprResolveNames(NameContext *, Expr *); -int sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); -int sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); -Vdbe *sqlite3GetVdbe(Parse*); -void sqlite3Randomness(int, void*); -void sqlite3RollbackAll(sqlite3*); -void sqlite3CodeVerifySchema(Parse*, int); -void sqlite3BeginTransaction(Parse*, int); -void sqlite3CommitTransaction(Parse*); -void sqlite3RollbackTransaction(Parse*); -int sqlite3ExprIsConstant(Expr*); -int sqlite3ExprIsConstantOrFunction(Expr*); -int sqlite3ExprIsInteger(Expr*, int*); -int sqlite3IsRowid(const char*); -void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int); -void sqlite3GenerateRowIndexDelete(sqlite3*, Vdbe*, Table*, int, char*); -void sqlite3GenerateIndexKey(Vdbe*, Index*, int); -void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int); -void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int); -void sqlite3OpenTableAndIndices(Parse*, Table*, int, int); -void sqlite3BeginWriteOperation(Parse*, int, int); -Expr *sqlite3ExprDup(Expr*); -void sqlite3TokenCopy(Token*, Token*); -ExprList *sqlite3ExprListDup(ExprList*); -SrcList *sqlite3SrcListDup(SrcList*); -IdList *sqlite3IdListDup(IdList*); -Select *sqlite3SelectDup(Select*); -FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int); -void sqlite3RegisterBuiltinFunctions(sqlite3*); -void sqlite3RegisterDateTimeFunctions(sqlite3*); -int sqlite3SafetyOn(sqlite3*); -int sqlite3SafetyOff(sqlite3*); -int sqlite3SafetyCheck(sqlite3*); -void sqlite3ChangeCookie(sqlite3*, Vdbe*, int); - -#ifndef SQLITE_OMIT_TRIGGER - void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*, - int,Expr*,int); - void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*); - void sqlite3DropTrigger(Parse*, SrcList*); - void sqlite3DropTriggerPtr(Parse*, Trigger*, int); - int sqlite3TriggersExist(Parse*, Table*, int, ExprList*); - int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int, - int, int); - void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*); - void sqlite3DeleteTriggerStep(TriggerStep*); - TriggerStep *sqlite3TriggerSelectStep(Select*); - TriggerStep *sqlite3TriggerInsertStep(Token*, IdList*, ExprList*,Select*,int); - TriggerStep *sqlite3TriggerUpdateStep(Token*, ExprList*, Expr*, int); - TriggerStep *sqlite3TriggerDeleteStep(Token*, Expr*); - void sqlite3DeleteTrigger(Trigger*); - void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*); -#else -# define sqlite3TriggersExist(A,B,C,D,E,F) 0 -# define sqlite3DeleteTrigger(A) -# define sqlite3DropTriggerPtr(A,B,C) -# define sqlite3UnlinkAndDeleteTrigger(A,B,C) -# define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I) 0 -#endif - -int sqlite3JoinType(Parse*, Token*, Token*, Token*); -void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int); -void sqlite3DeferForeignKey(Parse*, int); -#ifndef SQLITE_OMIT_AUTHORIZATION - void sqlite3AuthRead(Parse*,Expr*,SrcList*); - int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*); - void sqlite3AuthContextPush(Parse*, AuthContext*, const char*); - void sqlite3AuthContextPop(AuthContext*); -#else -# define sqlite3AuthRead(a,b,c) -# define sqlite3AuthCheck(a,b,c,d,e) SQLITE_OK -# define sqlite3AuthContextPush(a,b,c) -# define sqlite3AuthContextPop(a) ((void)(a)) -#endif -void sqlite3Attach(Parse*, Token*, Token*, int, Token*); -void sqlite3Detach(Parse*, Token*); -int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename, - int omitJournal, int nCache, Btree **ppBtree); -int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*); -int sqlite3FixSrcList(DbFixer*, SrcList*); -int sqlite3FixSelect(DbFixer*, Select*); -int sqlite3FixExpr(DbFixer*, Expr*); -int sqlite3FixExprList(DbFixer*, ExprList*); -int sqlite3FixTriggerStep(DbFixer*, TriggerStep*); -int sqlite3AtoF(const char *z, double*); -char *sqlite3_snprintf(int,char*,const char*,...); -int sqlite3GetInt32(const char *, int*); -int sqlite3FitsIn64Bits(const char *); -int sqlite3utf16ByteLen(const void *pData, int nChar); -int sqlite3utf8CharLen(const char *pData, int nByte); -int sqlite3ReadUtf8(const unsigned char *); -int sqlite3PutVarint(unsigned char *, u64); -int sqlite3GetVarint(const unsigned char *, u64 *); -int sqlite3GetVarint32(const unsigned char *, u32 *); -int sqlite3VarintLen(u64 v); -void sqlite3IndexAffinityStr(Vdbe *, Index *); -void sqlite3TableAffinityStr(Vdbe *, Table *); -char sqlite3CompareAffinity(Expr *pExpr, char aff2); -int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity); -char sqlite3ExprAffinity(Expr *pExpr); -int sqlite3atoi64(const char*, i64*); -void sqlite3Error(sqlite3*, int, const char*,...); -void *sqlite3HexToBlob(const char *z); -int sqlite3TwoPartName(Parse *, Token *, Token *, Token **); -const char *sqlite3ErrStr(int); -int sqlite3ReadUniChar(const char *zStr, int *pOffset, u8 *pEnc, int fold); -int sqlite3ReadSchema(Parse *pParse); -CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char *,int,int); -CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName); -CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); -int sqlite3CheckCollSeq(Parse *, CollSeq *); -int sqlite3CheckIndexCollSeq(Parse *, Index *); -int sqlite3CheckObjectName(Parse *, const char *); -void sqlite3VdbeSetChanges(sqlite3 *, int); -void sqlite3utf16Substr(sqlite3_context *,int,sqlite3_value **); - -const void *sqlite3ValueText(sqlite3_value*, u8); -int sqlite3ValueBytes(sqlite3_value*, u8); -void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); -void sqlite3ValueFree(sqlite3_value*); -sqlite3_value *sqlite3ValueNew(void); -sqlite3_value *sqlite3GetTransientValue(sqlite3*db); -int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **); -void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); -extern const unsigned char sqlite3UpperToLower[]; -void sqlite3RootPageMoved(Db*, int, int); -void sqlite3Reindex(Parse*, Token*, Token*); -void sqlite3AlterFunctions(sqlite3*); -void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); -int sqlite3GetToken(const unsigned char *, int *); -void sqlite3NestedParse(Parse*, const char*, ...); -void sqlite3ExpirePreparedStatements(sqlite3*); -void sqlite3CodeSubselect(Parse *, Expr *); -int sqlite3SelectResolve(Parse *, Select *, NameContext *); -void sqlite3ColumnDefault(Vdbe *, Table *, int); -void sqlite3AlterFinishAddColumn(Parse *, Token *); -void sqlite3AlterBeginAddColumn(Parse *, SrcList *); -const char *sqlite3TestErrorName(int); -CollSeq *sqlite3GetCollSeq(sqlite3*, CollSeq *, const char *, int); -char sqlite3AffinityType(const Token*); -void sqlite3Analyze(Parse*, Token*, Token*); -int sqlite3InvokeBusyHandler(BusyHandler*); -int sqlite3FindDb(sqlite3*, Token*); -void sqlite3AnalysisLoad(sqlite3*,int iDB); -void sqlite3DefaultRowEst(Index*); -void sqlite3RegisterLikeFunctions(sqlite3*, int); -int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*); - -#ifdef SQLITE_SSE -#include "sseInt.h" -#endif - -#endif diff --git a/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h b/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h deleted file mode 100644 index 3903ffe95e598..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "config.w32.h" -#if ZTS -# define THREADSAFE 1 -#endif -#if !ZEND_DEBUG && !defined(NDEBUG) -# define NDEBUG -#endif -#define SQLITE_PTR_SZ 4 \ No newline at end of file diff --git a/ext/pdo_sqlite/sqlite/src/table.c b/ext/pdo_sqlite/sqlite/src/table.c deleted file mode 100644 index d4ef2c8a78b2e..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/table.c +++ /dev/null @@ -1,195 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the sqlite3_get_table() and sqlite3_free_table() -** interface routines. These are just wrappers around the main -** interface routine of sqlite3_exec(). -** -** These routines are in a separate files so that they will not be linked -** if they are not used. -*/ -#include <stdlib.h> -#include <string.h> -#include "sqliteInt.h" - -/* -** This structure is used to pass data from sqlite3_get_table() through -** to the callback function is uses to build the result. -*/ -typedef struct TabResult { - char **azResult; - char *zErrMsg; - int nResult; - int nAlloc; - int nRow; - int nColumn; - int nData; - int rc; -} TabResult; - -/* -** This routine is called once for each row in the result table. Its job -** is to fill in the TabResult structure appropriately, allocating new -** memory as necessary. -*/ -static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){ - TabResult *p = (TabResult*)pArg; - int need; - int i; - char *z; - - /* Make sure there is enough space in p->azResult to hold everything - ** we need to remember from this invocation of the callback. - */ - if( p->nRow==0 && argv!=0 ){ - need = nCol*2; - }else{ - need = nCol; - } - if( p->nData + need >= p->nAlloc ){ - char **azNew; - p->nAlloc = p->nAlloc*2 + need + 1; - azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc ); - if( azNew==0 ) goto malloc_failed; - p->azResult = azNew; - } - - /* If this is the first row, then generate an extra row containing - ** the names of all columns. - */ - if( p->nRow==0 ){ - p->nColumn = nCol; - for(i=0; i<nCol; i++){ - if( colv[i]==0 ){ - z = 0; - }else{ - z = malloc( strlen(colv[i])+1 ); - if( z==0 ) goto malloc_failed; - strcpy(z, colv[i]); - } - p->azResult[p->nData++] = z; - } - }else if( p->nColumn!=nCol ){ - sqlite3SetString(&p->zErrMsg, - "sqlite3_get_table() called with two or more incompatible queries", - (char*)0); - p->rc = SQLITE_ERROR; - return 1; - } - - /* Copy over the row data - */ - if( argv!=0 ){ - for(i=0; i<nCol; i++){ - if( argv[i]==0 ){ - z = 0; - }else{ - z = malloc( strlen(argv[i])+1 ); - if( z==0 ) goto malloc_failed; - strcpy(z, argv[i]); - } - p->azResult[p->nData++] = z; - } - p->nRow++; - } - return 0; - -malloc_failed: - p->rc = SQLITE_NOMEM; - return 1; -} - -/* -** Query the database. But instead of invoking a callback for each row, -** malloc() for space to hold the result and return the entire results -** at the conclusion of the call. -** -** The result that is written to ***pazResult is held in memory obtained -** from malloc(). But the caller cannot free this memory directly. -** Instead, the entire table should be passed to sqlite3_free_table() when -** the calling procedure is finished using it. -*/ -int sqlite3_get_table( - sqlite3 *db, /* The database on which the SQL executes */ - const char *zSql, /* The SQL to be executed */ - char ***pazResult, /* Write the result table here */ - int *pnRow, /* Write the number of rows in the result here */ - int *pnColumn, /* Write the number of columns of result here */ - char **pzErrMsg /* Write error messages here */ -){ - int rc; - TabResult res; - if( pazResult==0 ){ return SQLITE_ERROR; } - *pazResult = 0; - if( pnColumn ) *pnColumn = 0; - if( pnRow ) *pnRow = 0; - res.zErrMsg = 0; - res.nResult = 0; - res.nRow = 0; - res.nColumn = 0; - res.nData = 1; - res.nAlloc = 20; - res.rc = SQLITE_OK; - res.azResult = malloc( sizeof(char*)*res.nAlloc ); - if( res.azResult==0 ) return SQLITE_NOMEM; - res.azResult[0] = 0; - rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg); - if( res.azResult ){ - res.azResult[0] = (char*)res.nData; - } - if( rc==SQLITE_ABORT ){ - sqlite3_free_table(&res.azResult[1]); - if( res.zErrMsg ){ - if( pzErrMsg ){ - free(*pzErrMsg); - *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg); - } - sqliteFree(res.zErrMsg); - } - db->errCode = res.rc; - return res.rc; - } - sqliteFree(res.zErrMsg); - if( rc!=SQLITE_OK ){ - sqlite3_free_table(&res.azResult[1]); - return rc; - } - if( res.nAlloc>res.nData ){ - char **azNew; - azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) ); - if( azNew==0 ){ - sqlite3_free_table(&res.azResult[1]); - return SQLITE_NOMEM; - } - res.nAlloc = res.nData+1; - res.azResult = azNew; - } - *pazResult = &res.azResult[1]; - if( pnColumn ) *pnColumn = res.nColumn; - if( pnRow ) *pnRow = res.nRow; - return rc; -} - -/* -** This routine frees the space the sqlite3_get_table() malloced. -*/ -void sqlite3_free_table( - char **azResult /* Result returned from from sqlite3_get_table() */ -){ - if( azResult ){ - int i, n; - azResult--; - if( azResult==0 ) return; - n = (int)azResult[0]; - for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); } - free(azResult); - } -} diff --git a/ext/pdo_sqlite/sqlite/src/tclsqlite.c b/ext/pdo_sqlite/sqlite/src/tclsqlite.c deleted file mode 100644 index 9a8b823b7e76c..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/tclsqlite.c +++ /dev/null @@ -1,2079 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** A TCL Interface to SQLite -** -** $Id$ -*/ -#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ - -#include "sqliteInt.h" -#include "hash.h" -#include "tcl.h" -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <ctype.h> - -#define NUM_PREPARED_STMTS 10 -#define MAX_PREPARED_STMTS 100 - -/* -** If TCL uses UTF-8 and SQLite is configured to use iso8859, then we -** have to do a translation when going between the two. Set the -** UTF_TRANSLATION_NEEDED macro to indicate that we need to do -** this translation. -*/ -#if defined(TCL_UTF_MAX) && !defined(SQLITE_UTF8) -# define UTF_TRANSLATION_NEEDED 1 -#endif - -/* -** New SQL functions can be created as TCL scripts. Each such function -** is described by an instance of the following structure. -*/ -typedef struct SqlFunc SqlFunc; -struct SqlFunc { - Tcl_Interp *interp; /* The TCL interpret to execute the function */ - Tcl_Obj *pScript; /* The Tcl_Obj representation of the script */ - int useEvalObjv; /* True if it is safe to use Tcl_EvalObjv */ - char *zName; /* Name of this function */ - SqlFunc *pNext; /* Next function on the list of them all */ -}; - -/* -** New collation sequences function can be created as TCL scripts. Each such -** function is described by an instance of the following structure. -*/ -typedef struct SqlCollate SqlCollate; -struct SqlCollate { - Tcl_Interp *interp; /* The TCL interpret to execute the function */ - char *zScript; /* The script to be run */ - SqlCollate *pNext; /* Next function on the list of them all */ -}; - -/* -** Prepared statements are cached for faster execution. Each prepared -** statement is described by an instance of the following structure. -*/ -typedef struct SqlPreparedStmt SqlPreparedStmt; -struct SqlPreparedStmt { - SqlPreparedStmt *pNext; /* Next in linked list */ - SqlPreparedStmt *pPrev; /* Previous on the list */ - sqlite3_stmt *pStmt; /* The prepared statement */ - int nSql; /* chars in zSql[] */ - char zSql[1]; /* Text of the SQL statement */ -}; - -/* -** There is one instance of this structure for each SQLite database -** that has been opened by the SQLite TCL interface. -*/ -typedef struct SqliteDb SqliteDb; -struct SqliteDb { - sqlite3 *db; /* The "real" database structure */ - Tcl_Interp *interp; /* The interpreter used for this database */ - char *zBusy; /* The busy callback routine */ - char *zCommit; /* The commit hook callback routine */ - char *zTrace; /* The trace callback routine */ - char *zProfile; /* The profile callback routine */ - char *zProgress; /* The progress callback routine */ - char *zAuth; /* The authorization callback routine */ - char *zNull; /* Text to substitute for an SQL NULL value */ - SqlFunc *pFunc; /* List of SQL functions */ - SqlCollate *pCollate; /* List of SQL collation functions */ - int rc; /* Return code of most recent sqlite3_exec() */ - Tcl_Obj *pCollateNeeded; /* Collation needed script */ - SqlPreparedStmt *stmtList; /* List of prepared statements*/ - SqlPreparedStmt *stmtLast; /* Last statement in the list */ - int maxStmt; /* The next maximum number of stmtList */ - int nStmt; /* Number of statements in stmtList */ -}; - -/* -** Look at the script prefix in pCmd. We will be executing this script -** after first appending one or more arguments. This routine analyzes -** the script to see if it is safe to use Tcl_EvalObjv() on the script -** rather than the more general Tcl_EvalEx(). Tcl_EvalObjv() is much -** faster. -** -** Scripts that are safe to use with Tcl_EvalObjv() consists of a -** command name followed by zero or more arguments with no [...] or $ -** or {...} or ; to be seen anywhere. Most callback scripts consist -** of just a single procedure name and they meet this requirement. -*/ -static int safeToUseEvalObjv(Tcl_Interp *interp, Tcl_Obj *pCmd){ - /* We could try to do something with Tcl_Parse(). But we will instead - ** just do a search for forbidden characters. If any of the forbidden - ** characters appear in pCmd, we will report the string as unsafe. - */ - const char *z; - int n; - z = Tcl_GetStringFromObj(pCmd, &n); - while( n-- > 0 ){ - int c = *(z++); - if( c=='$' || c=='[' || c==';' ) return 0; - } - return 1; -} - -/* -** Find an SqlFunc structure with the given name. Or create a new -** one if an existing one cannot be found. Return a pointer to the -** structure. -*/ -static SqlFunc *findSqlFunc(SqliteDb *pDb, const char *zName){ - SqlFunc *p, *pNew; - int i; - pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + strlen(zName) + 1 ); - pNew->zName = (char*)&pNew[1]; - for(i=0; zName[i]; i++){ pNew->zName[i] = tolower(zName[i]); } - pNew->zName[i] = 0; - for(p=pDb->pFunc; p; p=p->pNext){ - if( strcmp(p->zName, pNew->zName)==0 ){ - Tcl_Free((char*)pNew); - return p; - } - } - pNew->interp = pDb->interp; - pNew->pScript = 0; - pNew->pNext = pDb->pFunc; - pDb->pFunc = pNew; - return pNew; -} - -/* -** Finalize and free a list of prepared statements -*/ -static void flushStmtCache( SqliteDb *pDb ){ - SqlPreparedStmt *pPreStmt; - - while( pDb->stmtList ){ - sqlite3_finalize( pDb->stmtList->pStmt ); - pPreStmt = pDb->stmtList; - pDb->stmtList = pDb->stmtList->pNext; - Tcl_Free( (char*)pPreStmt ); - } - pDb->nStmt = 0; - pDb->stmtLast = 0; -} - -/* -** TCL calls this procedure when an sqlite3 database command is -** deleted. -*/ -static void DbDeleteCmd(void *db){ - SqliteDb *pDb = (SqliteDb*)db; - flushStmtCache(pDb); - sqlite3_close(pDb->db); - while( pDb->pFunc ){ - SqlFunc *pFunc = pDb->pFunc; - pDb->pFunc = pFunc->pNext; - Tcl_DecrRefCount(pFunc->pScript); - Tcl_Free((char*)pFunc); - } - while( pDb->pCollate ){ - SqlCollate *pCollate = pDb->pCollate; - pDb->pCollate = pCollate->pNext; - Tcl_Free((char*)pCollate); - } - if( pDb->zBusy ){ - Tcl_Free(pDb->zBusy); - } - if( pDb->zTrace ){ - Tcl_Free(pDb->zTrace); - } - if( pDb->zProfile ){ - Tcl_Free(pDb->zProfile); - } - if( pDb->zAuth ){ - Tcl_Free(pDb->zAuth); - } - if( pDb->zNull ){ - Tcl_Free(pDb->zNull); - } - Tcl_Free((char*)pDb); -} - -/* -** This routine is called when a database file is locked while trying -** to execute SQL. -*/ -static int DbBusyHandler(void *cd, int nTries){ - SqliteDb *pDb = (SqliteDb*)cd; - int rc; - char zVal[30]; - - sprintf(zVal, "%d", nTries); - rc = Tcl_VarEval(pDb->interp, pDb->zBusy, " ", zVal, (char*)0); - if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){ - return 0; - } - return 1; -} - -/* -** This routine is invoked as the 'progress callback' for the database. -*/ -static int DbProgressHandler(void *cd){ - SqliteDb *pDb = (SqliteDb*)cd; - int rc; - - assert( pDb->zProgress ); - rc = Tcl_Eval(pDb->interp, pDb->zProgress); - if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){ - return 1; - } - return 0; -} - -/* -** This routine is called by the SQLite trace handler whenever a new -** block of SQL is executed. The TCL script in pDb->zTrace is executed. -*/ -static void DbTraceHandler(void *cd, const char *zSql){ - SqliteDb *pDb = (SqliteDb*)cd; - Tcl_DString str; - - Tcl_DStringInit(&str); - Tcl_DStringAppend(&str, pDb->zTrace, -1); - Tcl_DStringAppendElement(&str, zSql); - Tcl_Eval(pDb->interp, Tcl_DStringValue(&str)); - Tcl_DStringFree(&str); - Tcl_ResetResult(pDb->interp); -} - -/* -** This routine is called by the SQLite profile handler after a statement -** SQL has executed. The TCL script in pDb->zProfile is evaluated. -*/ -static void DbProfileHandler(void *cd, const char *zSql, sqlite_uint64 tm){ - SqliteDb *pDb = (SqliteDb*)cd; - Tcl_DString str; - char zTm[100]; - - sqlite3_snprintf(sizeof(zTm)-1, zTm, "%lld", tm); - Tcl_DStringInit(&str); - Tcl_DStringAppend(&str, pDb->zProfile, -1); - Tcl_DStringAppendElement(&str, zSql); - Tcl_DStringAppendElement(&str, zTm); - Tcl_Eval(pDb->interp, Tcl_DStringValue(&str)); - Tcl_DStringFree(&str); - Tcl_ResetResult(pDb->interp); -} - -/* -** This routine is called when a transaction is committed. The -** TCL script in pDb->zCommit is executed. If it returns non-zero or -** if it throws an exception, the transaction is rolled back instead -** of being committed. -*/ -static int DbCommitHandler(void *cd){ - SqliteDb *pDb = (SqliteDb*)cd; - int rc; - - rc = Tcl_Eval(pDb->interp, pDb->zCommit); - if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){ - return 1; - } - return 0; -} - -static void tclCollateNeeded( - void *pCtx, - sqlite3 *db, - int enc, - const char *zName -){ - SqliteDb *pDb = (SqliteDb *)pCtx; - Tcl_Obj *pScript = Tcl_DuplicateObj(pDb->pCollateNeeded); - Tcl_IncrRefCount(pScript); - Tcl_ListObjAppendElement(0, pScript, Tcl_NewStringObj(zName, -1)); - Tcl_EvalObjEx(pDb->interp, pScript, 0); - Tcl_DecrRefCount(pScript); -} - -/* -** This routine is called to evaluate an SQL collation function implemented -** using TCL script. -*/ -static int tclSqlCollate( - void *pCtx, - int nA, - const void *zA, - int nB, - const void *zB -){ - SqlCollate *p = (SqlCollate *)pCtx; - Tcl_Obj *pCmd; - - pCmd = Tcl_NewStringObj(p->zScript, -1); - Tcl_IncrRefCount(pCmd); - Tcl_ListObjAppendElement(p->interp, pCmd, Tcl_NewStringObj(zA, nA)); - Tcl_ListObjAppendElement(p->interp, pCmd, Tcl_NewStringObj(zB, nB)); - Tcl_EvalObjEx(p->interp, pCmd, TCL_EVAL_DIRECT); - Tcl_DecrRefCount(pCmd); - return (atoi(Tcl_GetStringResult(p->interp))); -} - -/* -** This routine is called to evaluate an SQL function implemented -** using TCL script. -*/ -static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){ - SqlFunc *p = sqlite3_user_data(context); - Tcl_Obj *pCmd; - int i; - int rc; - - if( argc==0 ){ - /* If there are no arguments to the function, call Tcl_EvalObjEx on the - ** script object directly. This allows the TCL compiler to generate - ** bytecode for the command on the first invocation and thus make - ** subsequent invocations much faster. */ - pCmd = p->pScript; - Tcl_IncrRefCount(pCmd); - rc = Tcl_EvalObjEx(p->interp, pCmd, 0); - Tcl_DecrRefCount(pCmd); - }else{ - /* If there are arguments to the function, make a shallow copy of the - ** script object, lappend the arguments, then evaluate the copy. - ** - ** By "shallow" copy, we mean a only the outer list Tcl_Obj is duplicated. - ** The new Tcl_Obj contains pointers to the original list elements. - ** That way, when Tcl_EvalObjv() is run and shimmers the first element - ** of the list to tclCmdNameType, that alternate representation will - ** be preserved and reused on the next invocation. - */ - Tcl_Obj **aArg; - int nArg; - if( Tcl_ListObjGetElements(p->interp, p->pScript, &nArg, &aArg) ){ - sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1); - return; - } - pCmd = Tcl_NewListObj(nArg, aArg); - Tcl_IncrRefCount(pCmd); - for(i=0; i<argc; i++){ - sqlite3_value *pIn = argv[i]; - Tcl_Obj *pVal; - - /* Set pVal to contain the i'th column of this row. */ - switch( sqlite3_value_type(pIn) ){ - case SQLITE_BLOB: { - int bytes = sqlite3_value_bytes(pIn); - pVal = Tcl_NewByteArrayObj(sqlite3_value_blob(pIn), bytes); - break; - } - case SQLITE_INTEGER: { - sqlite_int64 v = sqlite3_value_int64(pIn); - if( v>=-2147483647 && v<=2147483647 ){ - pVal = Tcl_NewIntObj(v); - }else{ - pVal = Tcl_NewWideIntObj(v); - } - break; - } - case SQLITE_FLOAT: { - double r = sqlite3_value_double(pIn); - pVal = Tcl_NewDoubleObj(r); - break; - } - case SQLITE_NULL: { - pVal = Tcl_NewStringObj("", 0); - break; - } - default: { - int bytes = sqlite3_value_bytes(pIn); - pVal = Tcl_NewStringObj(sqlite3_value_text(pIn), bytes); - break; - } - } - rc = Tcl_ListObjAppendElement(p->interp, pCmd, pVal); - if( rc ){ - Tcl_DecrRefCount(pCmd); - sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1); - return; - } - } - if( !p->useEvalObjv ){ - /* Tcl_EvalObjEx() will automatically call Tcl_EvalObjv() if pCmd - ** is a list without a string representation. To prevent this from - ** happening, make sure pCmd has a valid string representation */ - Tcl_GetString(pCmd); - } - rc = Tcl_EvalObjEx(p->interp, pCmd, TCL_EVAL_DIRECT); - Tcl_DecrRefCount(pCmd); - } - - if( rc && rc!=TCL_RETURN ){ - sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1); - }else{ - Tcl_Obj *pVar = Tcl_GetObjResult(p->interp); - int n; - u8 *data; - char *zType = pVar->typePtr ? pVar->typePtr->name : ""; - char c = zType[0]; - if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){ - /* Only return a BLOB type if the Tcl variable is a bytearray and - ** has no string representation. */ - data = Tcl_GetByteArrayFromObj(pVar, &n); - sqlite3_result_blob(context, data, n, SQLITE_TRANSIENT); - }else if( (c=='b' && strcmp(zType,"boolean")==0) || - (c=='i' && strcmp(zType,"int")==0) ){ - Tcl_GetIntFromObj(0, pVar, &n); - sqlite3_result_int(context, n); - }else if( c=='d' && strcmp(zType,"double")==0 ){ - double r; - Tcl_GetDoubleFromObj(0, pVar, &r); - sqlite3_result_double(context, r); - }else if( c=='w' && strcmp(zType,"wideInt")==0 ){ - Tcl_WideInt v; - Tcl_GetWideIntFromObj(0, pVar, &v); - sqlite3_result_int64(context, v); - }else{ - data = Tcl_GetStringFromObj(pVar, &n); - sqlite3_result_text(context, data, n, SQLITE_TRANSIENT); - } - } -} - -#ifndef SQLITE_OMIT_AUTHORIZATION -/* -** This is the authentication function. It appends the authentication -** type code and the two arguments to zCmd[] then invokes the result -** on the interpreter. The reply is examined to determine if the -** authentication fails or succeeds. -*/ -static int auth_callback( - void *pArg, - int code, - const char *zArg1, - const char *zArg2, - const char *zArg3, - const char *zArg4 -){ - char *zCode; - Tcl_DString str; - int rc; - const char *zReply; - SqliteDb *pDb = (SqliteDb*)pArg; - - switch( code ){ - case SQLITE_COPY : zCode="SQLITE_COPY"; break; - case SQLITE_CREATE_INDEX : zCode="SQLITE_CREATE_INDEX"; break; - case SQLITE_CREATE_TABLE : zCode="SQLITE_CREATE_TABLE"; break; - case SQLITE_CREATE_TEMP_INDEX : zCode="SQLITE_CREATE_TEMP_INDEX"; break; - case SQLITE_CREATE_TEMP_TABLE : zCode="SQLITE_CREATE_TEMP_TABLE"; break; - case SQLITE_CREATE_TEMP_TRIGGER: zCode="SQLITE_CREATE_TEMP_TRIGGER"; break; - case SQLITE_CREATE_TEMP_VIEW : zCode="SQLITE_CREATE_TEMP_VIEW"; break; - case SQLITE_CREATE_TRIGGER : zCode="SQLITE_CREATE_TRIGGER"; break; - case SQLITE_CREATE_VIEW : zCode="SQLITE_CREATE_VIEW"; break; - case SQLITE_DELETE : zCode="SQLITE_DELETE"; break; - case SQLITE_DROP_INDEX : zCode="SQLITE_DROP_INDEX"; break; - case SQLITE_DROP_TABLE : zCode="SQLITE_DROP_TABLE"; break; - case SQLITE_DROP_TEMP_INDEX : zCode="SQLITE_DROP_TEMP_INDEX"; break; - case SQLITE_DROP_TEMP_TABLE : zCode="SQLITE_DROP_TEMP_TABLE"; break; - case SQLITE_DROP_TEMP_TRIGGER : zCode="SQLITE_DROP_TEMP_TRIGGER"; break; - case SQLITE_DROP_TEMP_VIEW : zCode="SQLITE_DROP_TEMP_VIEW"; break; - case SQLITE_DROP_TRIGGER : zCode="SQLITE_DROP_TRIGGER"; break; - case SQLITE_DROP_VIEW : zCode="SQLITE_DROP_VIEW"; break; - case SQLITE_INSERT : zCode="SQLITE_INSERT"; break; - case SQLITE_PRAGMA : zCode="SQLITE_PRAGMA"; break; - case SQLITE_READ : zCode="SQLITE_READ"; break; - case SQLITE_SELECT : zCode="SQLITE_SELECT"; break; - case SQLITE_TRANSACTION : zCode="SQLITE_TRANSACTION"; break; - case SQLITE_UPDATE : zCode="SQLITE_UPDATE"; break; - case SQLITE_ATTACH : zCode="SQLITE_ATTACH"; break; - case SQLITE_DETACH : zCode="SQLITE_DETACH"; break; - case SQLITE_ALTER_TABLE : zCode="SQLITE_ALTER_TABLE"; break; - case SQLITE_REINDEX : zCode="SQLITE_REINDEX"; break; - case SQLITE_ANALYZE : zCode="SQLITE_ANALYZE"; break; - default : zCode="????"; break; - } - Tcl_DStringInit(&str); - Tcl_DStringAppend(&str, pDb->zAuth, -1); - Tcl_DStringAppendElement(&str, zCode); - Tcl_DStringAppendElement(&str, zArg1 ? zArg1 : ""); - Tcl_DStringAppendElement(&str, zArg2 ? zArg2 : ""); - Tcl_DStringAppendElement(&str, zArg3 ? zArg3 : ""); - Tcl_DStringAppendElement(&str, zArg4 ? zArg4 : ""); - rc = Tcl_GlobalEval(pDb->interp, Tcl_DStringValue(&str)); - Tcl_DStringFree(&str); - zReply = Tcl_GetStringResult(pDb->interp); - if( strcmp(zReply,"SQLITE_OK")==0 ){ - rc = SQLITE_OK; - }else if( strcmp(zReply,"SQLITE_DENY")==0 ){ - rc = SQLITE_DENY; - }else if( strcmp(zReply,"SQLITE_IGNORE")==0 ){ - rc = SQLITE_IGNORE; - }else{ - rc = 999; - } - return rc; -} -#endif /* SQLITE_OMIT_AUTHORIZATION */ - -/* -** zText is a pointer to text obtained via an sqlite3_result_text() -** or similar interface. This routine returns a Tcl string object, -** reference count set to 0, containing the text. If a translation -** between iso8859 and UTF-8 is required, it is preformed. -*/ -static Tcl_Obj *dbTextToObj(char const *zText){ - Tcl_Obj *pVal; -#ifdef UTF_TRANSLATION_NEEDED - Tcl_DString dCol; - Tcl_DStringInit(&dCol); - Tcl_ExternalToUtfDString(NULL, zText, -1, &dCol); - pVal = Tcl_NewStringObj(Tcl_DStringValue(&dCol), -1); - Tcl_DStringFree(&dCol); -#else - pVal = Tcl_NewStringObj(zText, -1); -#endif - return pVal; -} - -/* -** This routine reads a line of text from FILE in, stores -** the text in memory obtained from malloc() and returns a pointer -** to the text. NULL is returned at end of file, or if malloc() -** fails. -** -** The interface is like "readline" but no command-line editing -** is done. -** -** copied from shell.c from '.import' command -*/ -static char *local_getline(char *zPrompt, FILE *in){ - char *zLine; - int nLine; - int n; - int eol; - - nLine = 100; - zLine = malloc( nLine ); - if( zLine==0 ) return 0; - n = 0; - eol = 0; - while( !eol ){ - if( n+100>nLine ){ - nLine = nLine*2 + 100; - zLine = realloc(zLine, nLine); - if( zLine==0 ) return 0; - } - if( fgets(&zLine[n], nLine - n, in)==0 ){ - if( n==0 ){ - free(zLine); - return 0; - } - zLine[n] = 0; - eol = 1; - break; - } - while( zLine[n] ){ n++; } - if( n>0 && zLine[n-1]=='\n' ){ - n--; - zLine[n] = 0; - eol = 1; - } - } - zLine = realloc( zLine, n+1 ); - return zLine; -} - -/* -** The "sqlite" command below creates a new Tcl command for each -** connection it opens to an SQLite database. This routine is invoked -** whenever one of those connection-specific commands is executed -** in Tcl. For example, if you run Tcl code like this: -** -** sqlite3 db1 "my_database" -** db1 close -** -** The first command opens a connection to the "my_database" database -** and calls that connection "db1". The second command causes this -** subroutine to be invoked. -*/ -static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ - SqliteDb *pDb = (SqliteDb*)cd; - int choice; - int rc = TCL_OK; - static const char *DB_strs[] = { - "authorizer", "busy", "cache", - "changes", "close", "collate", - "collation_needed", "commit_hook", "complete", - "copy", "errorcode", "eval", - "function", "last_insert_rowid", "nullvalue", - "onecolumn", "profile", "progress", - "rekey", "timeout", "total_changes", - "trace", "transaction", "version", - 0 - }; - enum DB_enum { - DB_AUTHORIZER, DB_BUSY, DB_CACHE, - DB_CHANGES, DB_CLOSE, DB_COLLATE, - DB_COLLATION_NEEDED, DB_COMMIT_HOOK, DB_COMPLETE, - DB_COPY, DB_ERRORCODE, DB_EVAL, - DB_FUNCTION, DB_LAST_INSERT_ROWID,DB_NULLVALUE, - DB_ONECOLUMN, DB_PROFILE, DB_PROGRESS, - DB_REKEY, DB_TIMEOUT, DB_TOTAL_CHANGES, - DB_TRACE, DB_TRANSACTION, DB_VERSION - }; - /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */ - - if( objc<2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "SUBCOMMAND ..."); - return TCL_ERROR; - } - if( Tcl_GetIndexFromObj(interp, objv[1], DB_strs, "option", 0, &choice) ){ - return TCL_ERROR; - } - - switch( (enum DB_enum)choice ){ - - /* $db authorizer ?CALLBACK? - ** - ** Invoke the given callback to authorize each SQL operation as it is - ** compiled. 5 arguments are appended to the callback before it is - ** invoked: - ** - ** (1) The authorization type (ex: SQLITE_CREATE_TABLE, SQLITE_INSERT, ...) - ** (2) First descriptive name (depends on authorization type) - ** (3) Second descriptive name - ** (4) Name of the database (ex: "main", "temp") - ** (5) Name of trigger that is doing the access - ** - ** The callback should return on of the following strings: SQLITE_OK, - ** SQLITE_IGNORE, or SQLITE_DENY. Any other return value is an error. - ** - ** If this method is invoked with no arguments, the current authorization - ** callback string is returned. - */ - case DB_AUTHORIZER: { -#ifdef SQLITE_OMIT_AUTHORIZATION - Tcl_AppendResult(interp, "authorization not available in this build", 0); - return TCL_ERROR; -#else - if( objc>3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?"); - return TCL_ERROR; - }else if( objc==2 ){ - if( pDb->zAuth ){ - Tcl_AppendResult(interp, pDb->zAuth, 0); - } - }else{ - char *zAuth; - int len; - if( pDb->zAuth ){ - Tcl_Free(pDb->zAuth); - } - zAuth = Tcl_GetStringFromObj(objv[2], &len); - if( zAuth && len>0 ){ - pDb->zAuth = Tcl_Alloc( len + 1 ); - strcpy(pDb->zAuth, zAuth); - }else{ - pDb->zAuth = 0; - } - if( pDb->zAuth ){ - pDb->interp = interp; - sqlite3_set_authorizer(pDb->db, auth_callback, pDb); - }else{ - sqlite3_set_authorizer(pDb->db, 0, 0); - } - } -#endif - break; - } - - /* $db busy ?CALLBACK? - ** - ** Invoke the given callback if an SQL statement attempts to open - ** a locked database file. - */ - case DB_BUSY: { - if( objc>3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "CALLBACK"); - return TCL_ERROR; - }else if( objc==2 ){ - if( pDb->zBusy ){ - Tcl_AppendResult(interp, pDb->zBusy, 0); - } - }else{ - char *zBusy; - int len; - if( pDb->zBusy ){ - Tcl_Free(pDb->zBusy); - } - zBusy = Tcl_GetStringFromObj(objv[2], &len); - if( zBusy && len>0 ){ - pDb->zBusy = Tcl_Alloc( len + 1 ); - strcpy(pDb->zBusy, zBusy); - }else{ - pDb->zBusy = 0; - } - if( pDb->zBusy ){ - pDb->interp = interp; - sqlite3_busy_handler(pDb->db, DbBusyHandler, pDb); - }else{ - sqlite3_busy_handler(pDb->db, 0, 0); - } - } - break; - } - - /* $db cache flush - ** $db cache size n - ** - ** Flush the prepared statement cache, or set the maximum number of - ** cached statements. - */ - case DB_CACHE: { - char *subCmd; - int n; - - if( objc<=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "cache option ?arg?"); - return TCL_ERROR; - } - subCmd = Tcl_GetStringFromObj( objv[2], 0 ); - if( *subCmd=='f' && strcmp(subCmd,"flush")==0 ){ - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "flush"); - return TCL_ERROR; - }else{ - flushStmtCache( pDb ); - } - }else if( *subCmd=='s' && strcmp(subCmd,"size")==0 ){ - if( objc!=4 ){ - Tcl_WrongNumArgs(interp, 2, objv, "size n"); - return TCL_ERROR; - }else{ - if( TCL_ERROR==Tcl_GetIntFromObj(interp, objv[3], &n) ){ - Tcl_AppendResult( interp, "cannot convert \"", - Tcl_GetStringFromObj(objv[3],0), "\" to integer", 0); - return TCL_ERROR; - }else{ - if( n<0 ){ - flushStmtCache( pDb ); - n = 0; - }else if( n>MAX_PREPARED_STMTS ){ - n = MAX_PREPARED_STMTS; - } - pDb->maxStmt = n; - } - } - }else{ - Tcl_AppendResult( interp, "bad option \"", - Tcl_GetStringFromObj(objv[0],0), "\": must be flush or size", 0); - return TCL_ERROR; - } - break; - } - - /* $db changes - ** - ** Return the number of rows that were modified, inserted, or deleted by - ** the most recent INSERT, UPDATE or DELETE statement, not including - ** any changes made by trigger programs. - */ - case DB_CHANGES: { - Tcl_Obj *pResult; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 2, objv, ""); - return TCL_ERROR; - } - pResult = Tcl_GetObjResult(interp); - Tcl_SetIntObj(pResult, sqlite3_changes(pDb->db)); - break; - } - - /* $db close - ** - ** Shutdown the database - */ - case DB_CLOSE: { - Tcl_DeleteCommand(interp, Tcl_GetStringFromObj(objv[0], 0)); - break; - } - - /* - ** $db collate NAME SCRIPT - ** - ** Create a new SQL collation function called NAME. Whenever - ** that function is called, invoke SCRIPT to evaluate the function. - */ - case DB_COLLATE: { - SqlCollate *pCollate; - char *zName; - char *zScript; - int nScript; - if( objc!=4 ){ - Tcl_WrongNumArgs(interp, 2, objv, "NAME SCRIPT"); - return TCL_ERROR; - } - zName = Tcl_GetStringFromObj(objv[2], 0); - zScript = Tcl_GetStringFromObj(objv[3], &nScript); - pCollate = (SqlCollate*)Tcl_Alloc( sizeof(*pCollate) + nScript + 1 ); - if( pCollate==0 ) return TCL_ERROR; - pCollate->interp = interp; - pCollate->pNext = pDb->pCollate; - pCollate->zScript = (char*)&pCollate[1]; - pDb->pCollate = pCollate; - strcpy(pCollate->zScript, zScript); - if( sqlite3_create_collation(pDb->db, zName, SQLITE_UTF8, - pCollate, tclSqlCollate) ){ - Tcl_SetResult(interp, (char *)sqlite3_errmsg(pDb->db), TCL_VOLATILE); - return TCL_ERROR; - } - break; - } - - /* - ** $db collation_needed SCRIPT - ** - ** Create a new SQL collation function called NAME. Whenever - ** that function is called, invoke SCRIPT to evaluate the function. - */ - case DB_COLLATION_NEEDED: { - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "SCRIPT"); - return TCL_ERROR; - } - if( pDb->pCollateNeeded ){ - Tcl_DecrRefCount(pDb->pCollateNeeded); - } - pDb->pCollateNeeded = Tcl_DuplicateObj(objv[2]); - Tcl_IncrRefCount(pDb->pCollateNeeded); - sqlite3_collation_needed(pDb->db, pDb, tclCollateNeeded); - break; - } - - /* $db commit_hook ?CALLBACK? - ** - ** Invoke the given callback just before committing every SQL transaction. - ** If the callback throws an exception or returns non-zero, then the - ** transaction is aborted. If CALLBACK is an empty string, the callback - ** is disabled. - */ - case DB_COMMIT_HOOK: { - if( objc>3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?"); - return TCL_ERROR; - }else if( objc==2 ){ - if( pDb->zCommit ){ - Tcl_AppendResult(interp, pDb->zCommit, 0); - } - }else{ - char *zCommit; - int len; - if( pDb->zCommit ){ - Tcl_Free(pDb->zCommit); - } - zCommit = Tcl_GetStringFromObj(objv[2], &len); - if( zCommit && len>0 ){ - pDb->zCommit = Tcl_Alloc( len + 1 ); - strcpy(pDb->zCommit, zCommit); - }else{ - pDb->zCommit = 0; - } - if( pDb->zCommit ){ - pDb->interp = interp; - sqlite3_commit_hook(pDb->db, DbCommitHandler, pDb); - }else{ - sqlite3_commit_hook(pDb->db, 0, 0); - } - } - break; - } - - /* $db complete SQL - ** - ** Return TRUE if SQL is a complete SQL statement. Return FALSE if - ** additional lines of input are needed. This is similar to the - ** built-in "info complete" command of Tcl. - */ - case DB_COMPLETE: { -#ifndef SQLITE_OMIT_COMPLETE - Tcl_Obj *pResult; - int isComplete; - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "SQL"); - return TCL_ERROR; - } - isComplete = sqlite3_complete( Tcl_GetStringFromObj(objv[2], 0) ); - pResult = Tcl_GetObjResult(interp); - Tcl_SetBooleanObj(pResult, isComplete); -#endif - break; - } - - /* $db copy conflict-algorithm table filename ?SEPARATOR? ?NULLINDICATOR? - ** - ** Copy data into table from filename, optionally using SEPARATOR - ** as column separators. If a column contains a null string, or the - ** value of NULLINDICATOR, a NULL is inserted for the column. - ** conflict-algorithm is one of the sqlite conflict algorithms: - ** rollback, abort, fail, ignore, replace - ** On success, return the number of lines processed, not necessarily same - ** as 'db changes' due to conflict-algorithm selected. - ** - ** This code is basically an implementation/enhancement of - ** the sqlite3 shell.c ".import" command. - ** - ** This command usage is equivalent to the sqlite2.x COPY statement, - ** which imports file data into a table using the PostgreSQL COPY file format: - ** $db copy $conflit_algo $table_name $filename \t \\N - */ - case DB_COPY: { - char *zTable; /* Insert data into this table */ - char *zFile; /* The file from which to extract data */ - char *zConflict; /* The conflict algorithm to use */ - sqlite3_stmt *pStmt; /* A statement */ - int rc; /* Result code */ - int nCol; /* Number of columns in the table */ - int nByte; /* Number of bytes in an SQL string */ - int i, j; /* Loop counters */ - int nSep; /* Number of bytes in zSep[] */ - int nNull; /* Number of bytes in zNull[] */ - char *zSql; /* An SQL statement */ - char *zLine; /* A single line of input from the file */ - char **azCol; /* zLine[] broken up into columns */ - char *zCommit; /* How to commit changes */ - FILE *in; /* The input file */ - int lineno = 0; /* Line number of input file */ - char zLineNum[80]; /* Line number print buffer */ - Tcl_Obj *pResult; /* interp result */ - - char *zSep; - char *zNull; - if( objc<5 || objc>7 ){ - Tcl_WrongNumArgs(interp, 2, objv, - "CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?"); - return TCL_ERROR; - } - if( objc>=6 ){ - zSep = Tcl_GetStringFromObj(objv[5], 0); - }else{ - zSep = "\t"; - } - if( objc>=7 ){ - zNull = Tcl_GetStringFromObj(objv[6], 0); - }else{ - zNull = ""; - } - zConflict = Tcl_GetStringFromObj(objv[2], 0); - zTable = Tcl_GetStringFromObj(objv[3], 0); - zFile = Tcl_GetStringFromObj(objv[4], 0); - nSep = strlen(zSep); - nNull = strlen(zNull); - if( nSep==0 ){ - Tcl_AppendResult(interp, "Error: non-null separator required for copy", 0); - return TCL_ERROR; - } - if(sqlite3StrICmp(zConflict, "rollback") != 0 && - sqlite3StrICmp(zConflict, "abort" ) != 0 && - sqlite3StrICmp(zConflict, "fail" ) != 0 && - sqlite3StrICmp(zConflict, "ignore" ) != 0 && - sqlite3StrICmp(zConflict, "replace" ) != 0 ) { - Tcl_AppendResult(interp, "Error: \"", zConflict, - "\", conflict-algorithm must be one of: rollback, " - "abort, fail, ignore, or replace", 0); - return TCL_ERROR; - } - zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable); - if( zSql==0 ){ - Tcl_AppendResult(interp, "Error: no such table: ", zTable, 0); - return TCL_ERROR; - } - nByte = strlen(zSql); - rc = sqlite3_prepare(pDb->db, zSql, 0, &pStmt, 0); - sqlite3_free(zSql); - if( rc ){ - Tcl_AppendResult(interp, "Error: ", sqlite3_errmsg(pDb->db), 0); - nCol = 0; - }else{ - nCol = sqlite3_column_count(pStmt); - } - sqlite3_finalize(pStmt); - if( nCol==0 ) { - return TCL_ERROR; - } - zSql = malloc( nByte + 50 + nCol*2 ); - if( zSql==0 ) { - Tcl_AppendResult(interp, "Error: can't malloc()", 0); - return TCL_ERROR; - } - sqlite3_snprintf(nByte+50, zSql, "INSERT OR %q INTO '%q' VALUES(?", - zConflict, zTable); - j = strlen(zSql); - for(i=1; i<nCol; i++){ - zSql[j++] = ','; - zSql[j++] = '?'; - } - zSql[j++] = ')'; - zSql[j] = 0; - rc = sqlite3_prepare(pDb->db, zSql, 0, &pStmt, 0); - free(zSql); - if( rc ){ - Tcl_AppendResult(interp, "Error: ", sqlite3_errmsg(pDb->db), 0); - sqlite3_finalize(pStmt); - return TCL_ERROR; - } - in = fopen(zFile, "rb"); - if( in==0 ){ - Tcl_AppendResult(interp, "Error: cannot open file: ", zFile, NULL); - sqlite3_finalize(pStmt); - return TCL_ERROR; - } - azCol = malloc( sizeof(azCol[0])*(nCol+1) ); - if( azCol==0 ) { - Tcl_AppendResult(interp, "Error: can't malloc()", 0); - return TCL_ERROR; - } - sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0); - zCommit = "COMMIT"; - while( (zLine = local_getline(0, in))!=0 ){ - char *z; - i = 0; - lineno++; - azCol[0] = zLine; - for(i=0, z=zLine; *z; z++){ - if( *z==zSep[0] && strncmp(z, zSep, nSep)==0 ){ - *z = 0; - i++; - if( i<nCol ){ - azCol[i] = &z[nSep]; - z += nSep-1; - } - } - } - if( i+1!=nCol ){ - char *zErr; - zErr = malloc(200 + strlen(zFile)); - sprintf(zErr,"Error: %s line %d: expected %d columns of data but found %d", - zFile, lineno, nCol, i+1); - Tcl_AppendResult(interp, zErr, 0); - free(zErr); - zCommit = "ROLLBACK"; - break; - } - for(i=0; i<nCol; i++){ - /* check for null data, if so, bind as null */ - if ((nNull>0 && strcmp(azCol[i], zNull)==0) || strlen(azCol[i])==0) { - sqlite3_bind_null(pStmt, i+1); - }else{ - sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC); - } - } - sqlite3_step(pStmt); - rc = sqlite3_reset(pStmt); - free(zLine); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp,"Error: ", sqlite3_errmsg(pDb->db), 0); - zCommit = "ROLLBACK"; - break; - } - } - free(azCol); - fclose(in); - sqlite3_finalize(pStmt); - sqlite3_exec(pDb->db, zCommit, 0, 0, 0); - - if( zCommit[0] == 'C' ){ - /* success, set result as number of lines processed */ - pResult = Tcl_GetObjResult(interp); - Tcl_SetIntObj(pResult, lineno); - rc = TCL_OK; - }else{ - /* failure, append lineno where failed */ - sprintf(zLineNum,"%d",lineno); - Tcl_AppendResult(interp,", failed while processing line: ",zLineNum,0); - rc = TCL_ERROR; - } - break; - } - - /* - ** $db errorcode - ** - ** Return the numeric error code that was returned by the most recent - ** call to sqlite3_exec(). - */ - case DB_ERRORCODE: { - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_errcode(pDb->db))); - break; - } - - /* - ** $db eval $sql ?array? ?{ ...code... }? - ** $db onecolumn $sql - ** - ** The SQL statement in $sql is evaluated. For each row, the values are - ** placed in elements of the array named "array" and ...code... is executed. - ** If "array" and "code" are omitted, then no callback is every invoked. - ** If "array" is an empty string, then the values are placed in variables - ** that have the same name as the fields extracted by the query. - ** - ** The onecolumn method is the equivalent of: - ** lindex [$db eval $sql] 0 - */ - case DB_ONECOLUMN: - case DB_EVAL: { - char const *zSql; /* Next SQL statement to execute */ - char const *zLeft; /* What is left after first stmt in zSql */ - sqlite3_stmt *pStmt; /* Compiled SQL statment */ - Tcl_Obj *pArray; /* Name of array into which results are written */ - Tcl_Obj *pScript; /* Script to run for each result set */ - Tcl_Obj **apParm; /* Parameters that need a Tcl_DecrRefCount() */ - int nParm; /* Number of entries used in apParm[] */ - Tcl_Obj *aParm[10]; /* Static space for apParm[] in the common case */ - Tcl_Obj *pRet; /* Value to be returned */ - SqlPreparedStmt *pPreStmt; /* Pointer to a prepared statement */ - int rc2; - - if( choice==DB_ONECOLUMN ){ - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "SQL"); - return TCL_ERROR; - } - pRet = 0; - }else{ - if( objc<3 || objc>5 ){ - Tcl_WrongNumArgs(interp, 2, objv, "SQL ?ARRAY-NAME? ?SCRIPT?"); - return TCL_ERROR; - } - pRet = Tcl_NewObj(); - Tcl_IncrRefCount(pRet); - } - if( objc==3 ){ - pArray = pScript = 0; - }else if( objc==4 ){ - pArray = 0; - pScript = objv[3]; - }else{ - pArray = objv[3]; - if( Tcl_GetString(pArray)[0]==0 ) pArray = 0; - pScript = objv[4]; - } - - Tcl_IncrRefCount(objv[2]); - zSql = Tcl_GetStringFromObj(objv[2], 0); - while( rc==TCL_OK && zSql[0] ){ - int i; /* Loop counter */ - int nVar; /* Number of bind parameters in the pStmt */ - int nCol; /* Number of columns in the result set */ - Tcl_Obj **apColName = 0; /* Array of column names */ - int len; /* String length of zSql */ - - /* Try to find a SQL statement that has already been compiled and - ** which matches the next sequence of SQL. - */ - pStmt = 0; - pPreStmt = pDb->stmtList; - len = strlen(zSql); - if( pPreStmt && sqlite3_expired(pPreStmt->pStmt) ){ - flushStmtCache(pDb); - pPreStmt = 0; - } - for(; pPreStmt; pPreStmt=pPreStmt->pNext){ - int n = pPreStmt->nSql; - if( len>=n - && memcmp(pPreStmt->zSql, zSql, n)==0 - && (zSql[n]==0 || zSql[n-1]==';') - ){ - pStmt = pPreStmt->pStmt; - zLeft = &zSql[pPreStmt->nSql]; - - /* When a prepared statement is found, unlink it from the - ** cache list. It will later be added back to the beginning - ** of the cache list in order to implement LRU replacement. - */ - if( pPreStmt->pPrev ){ - pPreStmt->pPrev->pNext = pPreStmt->pNext; - }else{ - pDb->stmtList = pPreStmt->pNext; - } - if( pPreStmt->pNext ){ - pPreStmt->pNext->pPrev = pPreStmt->pPrev; - }else{ - pDb->stmtLast = pPreStmt->pPrev; - } - pDb->nStmt--; - break; - } - } - - /* If no prepared statement was found. Compile the SQL text - */ - if( pStmt==0 ){ - if( SQLITE_OK!=sqlite3_prepare(pDb->db, zSql, -1, &pStmt, &zLeft) ){ - Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db))); - rc = TCL_ERROR; - break; - } - if( pStmt==0 ){ - if( SQLITE_OK!=sqlite3_errcode(pDb->db) ){ - /* A compile-time error in the statement - */ - Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db))); - rc = TCL_ERROR; - break; - }else{ - /* The statement was a no-op. Continue to the next statement - ** in the SQL string. - */ - zSql = zLeft; - continue; - } - } - assert( pPreStmt==0 ); - } - - /* Bind values to parameters that begin with $ or : - */ - nVar = sqlite3_bind_parameter_count(pStmt); - nParm = 0; - if( nVar>sizeof(aParm)/sizeof(aParm[0]) ){ - apParm = (Tcl_Obj**)Tcl_Alloc(nVar*sizeof(apParm[0])); - }else{ - apParm = aParm; - } - for(i=1; i<=nVar; i++){ - const char *zVar = sqlite3_bind_parameter_name(pStmt, i); - if( zVar!=0 && (zVar[0]=='$' || zVar[0]==':') ){ - Tcl_Obj *pVar = Tcl_GetVar2Ex(interp, &zVar[1], 0, 0); - if( pVar ){ - int n; - u8 *data; - char *zType = pVar->typePtr ? pVar->typePtr->name : ""; - char c = zType[0]; - if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){ - /* Only load a BLOB type if the Tcl variable is a bytearray and - ** has no string representation. */ - data = Tcl_GetByteArrayFromObj(pVar, &n); - sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC); - Tcl_IncrRefCount(pVar); - apParm[nParm++] = pVar; - }else if( (c=='b' && strcmp(zType,"boolean")==0) || - (c=='i' && strcmp(zType,"int")==0) ){ - Tcl_GetIntFromObj(interp, pVar, &n); - sqlite3_bind_int(pStmt, i, n); - }else if( c=='d' && strcmp(zType,"double")==0 ){ - double r; - Tcl_GetDoubleFromObj(interp, pVar, &r); - sqlite3_bind_double(pStmt, i, r); - }else if( c=='w' && strcmp(zType,"wideInt")==0 ){ - Tcl_WideInt v; - Tcl_GetWideIntFromObj(interp, pVar, &v); - sqlite3_bind_int64(pStmt, i, v); - }else{ - data = Tcl_GetStringFromObj(pVar, &n); - sqlite3_bind_text(pStmt, i, data, n, SQLITE_STATIC); - Tcl_IncrRefCount(pVar); - apParm[nParm++] = pVar; - } - }else{ - sqlite3_bind_null( pStmt, i ); - } - } - } - - /* Compute column names */ - nCol = sqlite3_column_count(pStmt); - if( pScript ){ - apColName = (Tcl_Obj**)Tcl_Alloc( sizeof(Tcl_Obj*)*nCol ); - if( apColName==0 ) break; - for(i=0; i<nCol; i++){ - apColName[i] = dbTextToObj(sqlite3_column_name(pStmt,i)); - Tcl_IncrRefCount(apColName[i]); - } - } - - /* If results are being stored in an array variable, then create - ** the array(*) entry for that array - */ - if( pArray ){ - Tcl_Obj *pColList = Tcl_NewObj(); - Tcl_Obj *pStar = Tcl_NewStringObj("*", -1); - Tcl_IncrRefCount(pColList); - for(i=0; i<nCol; i++){ - Tcl_ListObjAppendElement(interp, pColList, apColName[i]); - } - Tcl_ObjSetVar2(interp, pArray, pStar, pColList,0); - Tcl_DecrRefCount(pColList); - Tcl_DecrRefCount(pStar); - } - - /* Execute the SQL - */ - while( rc==TCL_OK && pStmt && SQLITE_ROW==sqlite3_step(pStmt) ){ - for(i=0; i<nCol; i++){ - Tcl_Obj *pVal; - - /* Set pVal to contain the i'th column of this row. */ - switch( sqlite3_column_type(pStmt, i) ){ - case SQLITE_BLOB: { - int bytes = sqlite3_column_bytes(pStmt, i); - pVal = Tcl_NewByteArrayObj(sqlite3_column_blob(pStmt, i), bytes); - break; - } - case SQLITE_INTEGER: { - sqlite_int64 v = sqlite3_column_int64(pStmt, i); - if( v>=-2147483647 && v<=2147483647 ){ - pVal = Tcl_NewIntObj(v); - }else{ - pVal = Tcl_NewWideIntObj(v); - } - break; - } - case SQLITE_FLOAT: { - double r = sqlite3_column_double(pStmt, i); - pVal = Tcl_NewDoubleObj(r); - break; - } - case SQLITE_NULL: { - pVal = dbTextToObj(pDb->zNull); - break; - } - default: { - pVal = dbTextToObj(sqlite3_column_text(pStmt, i)); - break; - } - } - - if( pScript ){ - if( pArray==0 ){ - Tcl_ObjSetVar2(interp, apColName[i], 0, pVal, 0); - }else{ - Tcl_ObjSetVar2(interp, pArray, apColName[i], pVal, 0); - } - }else if( choice==DB_ONECOLUMN ){ - if( pRet==0 ){ - pRet = pVal; - Tcl_IncrRefCount(pRet); - } - rc = TCL_BREAK; - }else{ - Tcl_ListObjAppendElement(interp, pRet, pVal); - } - } - - if( pScript ){ - rc = Tcl_EvalObjEx(interp, pScript, 0); - if( rc==TCL_CONTINUE ){ - rc = TCL_OK; - } - } - } - if( rc==TCL_BREAK ){ - rc = TCL_OK; - } - - /* Free the column name objects */ - if( pScript ){ - for(i=0; i<nCol; i++){ - Tcl_DecrRefCount(apColName[i]); - } - Tcl_Free((char*)apColName); - } - - /* Free the bound string and blob parameters */ - for(i=0; i<nParm; i++){ - Tcl_DecrRefCount(apParm[i]); - } - if( apParm!=aParm ){ - Tcl_Free((char*)apParm); - } - - /* Reset the statement. If the result code is SQLITE_SCHEMA, then - ** flush the statement cache and try the statement again. - */ - rc2 = sqlite3_reset(pStmt); - if( SQLITE_SCHEMA==rc2 ){ - /* After a schema change, flush the cache and try to run the - ** statement again - */ - flushStmtCache( pDb ); - sqlite3_finalize(pStmt); - if( pPreStmt ) Tcl_Free((char*)pPreStmt); - continue; - }else if( SQLITE_OK!=rc2 ){ - /* If a run-time error occurs, report the error and stop reading - ** the SQL - */ - Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db))); - sqlite3_finalize(pStmt); - rc = TCL_ERROR; - if( pPreStmt ) Tcl_Free((char*)pPreStmt); - break; - }else if( pDb->maxStmt<=0 ){ - /* If the cache is turned off, deallocated the statement */ - if( pPreStmt ) Tcl_Free((char*)pPreStmt); - sqlite3_finalize(pStmt); - }else{ - /* Everything worked and the cache is operational. - ** Create a new SqlPreparedStmt structure if we need one. - ** (If we already have one we can just reuse it.) - */ - if( pPreStmt==0 ){ - len = zLeft - zSql; - pPreStmt = (SqlPreparedStmt*)Tcl_Alloc( sizeof(*pPreStmt) + len ); - if( pPreStmt==0 ) return TCL_ERROR; - pPreStmt->pStmt = pStmt; - pPreStmt->nSql = len; - memcpy(pPreStmt->zSql, zSql, len); - pPreStmt->zSql[len] = 0; - } - - /* Add the prepared statement to the beginning of the cache list - */ - pPreStmt->pNext = pDb->stmtList; - pPreStmt->pPrev = 0; - if( pDb->stmtList ){ - pDb->stmtList->pPrev = pPreStmt; - } - pDb->stmtList = pPreStmt; - if( pDb->stmtLast==0 ){ - assert( pDb->nStmt==0 ); - pDb->stmtLast = pPreStmt; - }else{ - assert( pDb->nStmt>0 ); - } - pDb->nStmt++; - - /* If we have too many statement in cache, remove the surplus from the - ** end of the cache list. - */ - while( pDb->nStmt>pDb->maxStmt ){ - sqlite3_finalize(pDb->stmtLast->pStmt); - pDb->stmtLast = pDb->stmtLast->pPrev; - Tcl_Free((char*)pDb->stmtLast->pNext); - pDb->stmtLast->pNext = 0; - pDb->nStmt--; - } - } - - /* Proceed to the next statement */ - zSql = zLeft; - } - Tcl_DecrRefCount(objv[2]); - - if( pRet ){ - if( rc==TCL_OK ){ - Tcl_SetObjResult(interp, pRet); - } - Tcl_DecrRefCount(pRet); - } - break; - } - - /* - ** $db function NAME SCRIPT - ** - ** Create a new SQL function called NAME. Whenever that function is - ** called, invoke SCRIPT to evaluate the function. - */ - case DB_FUNCTION: { - SqlFunc *pFunc; - Tcl_Obj *pScript; - char *zName; - if( objc!=4 ){ - Tcl_WrongNumArgs(interp, 2, objv, "NAME SCRIPT"); - return TCL_ERROR; - } - zName = Tcl_GetStringFromObj(objv[2], 0); - pScript = objv[3]; - pFunc = findSqlFunc(pDb, zName); - if( pFunc==0 ) return TCL_ERROR; - if( pFunc->pScript ){ - Tcl_DecrRefCount(pFunc->pScript); - } - pFunc->pScript = pScript; - Tcl_IncrRefCount(pScript); - pFunc->useEvalObjv = safeToUseEvalObjv(interp, pScript); - rc = sqlite3_create_function(pDb->db, zName, -1, SQLITE_UTF8, - pFunc, tclSqlFunc, 0, 0); - if( rc!=SQLITE_OK ){ - rc = TCL_ERROR; - Tcl_SetResult(interp, (char *)sqlite3_errmsg(pDb->db), TCL_VOLATILE); - }else{ - /* Must flush any cached statements */ - flushStmtCache( pDb ); - } - break; - } - - /* - ** $db nullvalue ?STRING? - ** - ** Change text used when a NULL comes back from the database. If ?STRING? - ** is not present, then the current string used for NULL is returned. - ** If STRING is present, then STRING is returned. - ** - */ - case DB_NULLVALUE: { - if( objc!=2 && objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "NULLVALUE"); - return TCL_ERROR; - } - if( objc==3 ){ - int len; - char *zNull = Tcl_GetStringFromObj(objv[2], &len); - if( pDb->zNull ){ - Tcl_Free(pDb->zNull); - } - if( zNull && len>0 ){ - pDb->zNull = Tcl_Alloc( len + 1 ); - strncpy(pDb->zNull, zNull, len); - pDb->zNull[len] = '\0'; - }else{ - pDb->zNull = 0; - } - } - Tcl_SetObjResult(interp, dbTextToObj(pDb->zNull)); - break; - } - - /* - ** $db last_insert_rowid - ** - ** Return an integer which is the ROWID for the most recent insert. - */ - case DB_LAST_INSERT_ROWID: { - Tcl_Obj *pResult; - int rowid; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 2, objv, ""); - return TCL_ERROR; - } - rowid = sqlite3_last_insert_rowid(pDb->db); - pResult = Tcl_GetObjResult(interp); - Tcl_SetIntObj(pResult, rowid); - break; - } - - /* - ** The DB_ONECOLUMN method is implemented together with DB_EVAL. - */ - - /* $db progress ?N CALLBACK? - ** - ** Invoke the given callback every N virtual machine opcodes while executing - ** queries. - */ - case DB_PROGRESS: { - if( objc==2 ){ - if( pDb->zProgress ){ - Tcl_AppendResult(interp, pDb->zProgress, 0); - } - }else if( objc==4 ){ - char *zProgress; - int len; - int N; - if( TCL_OK!=Tcl_GetIntFromObj(interp, objv[2], &N) ){ - return TCL_ERROR; - }; - if( pDb->zProgress ){ - Tcl_Free(pDb->zProgress); - } - zProgress = Tcl_GetStringFromObj(objv[3], &len); - if( zProgress && len>0 ){ - pDb->zProgress = Tcl_Alloc( len + 1 ); - strcpy(pDb->zProgress, zProgress); - }else{ - pDb->zProgress = 0; - } -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - if( pDb->zProgress ){ - pDb->interp = interp; - sqlite3_progress_handler(pDb->db, N, DbProgressHandler, pDb); - }else{ - sqlite3_progress_handler(pDb->db, 0, 0, 0); - } -#endif - }else{ - Tcl_WrongNumArgs(interp, 2, objv, "N CALLBACK"); - return TCL_ERROR; - } - break; - } - - /* $db profile ?CALLBACK? - ** - ** Make arrangements to invoke the CALLBACK routine after each SQL statement - ** that has run. The text of the SQL and the amount of elapse time are - ** appended to CALLBACK before the script is run. - */ - case DB_PROFILE: { - if( objc>3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?"); - return TCL_ERROR; - }else if( objc==2 ){ - if( pDb->zProfile ){ - Tcl_AppendResult(interp, pDb->zProfile, 0); - } - }else{ - char *zProfile; - int len; - if( pDb->zProfile ){ - Tcl_Free(pDb->zProfile); - } - zProfile = Tcl_GetStringFromObj(objv[2], &len); - if( zProfile && len>0 ){ - pDb->zProfile = Tcl_Alloc( len + 1 ); - strcpy(pDb->zProfile, zProfile); - }else{ - pDb->zProfile = 0; - } -#ifndef SQLITE_OMIT_TRACE - if( pDb->zProfile ){ - pDb->interp = interp; - sqlite3_profile(pDb->db, DbProfileHandler, pDb); - }else{ - sqlite3_profile(pDb->db, 0, 0); - } -#endif - } - break; - } - - /* - ** $db rekey KEY - ** - ** Change the encryption key on the currently open database. - */ - case DB_REKEY: { - int nKey; - void *pKey; - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "KEY"); - return TCL_ERROR; - } - pKey = Tcl_GetByteArrayFromObj(objv[2], &nKey); -#ifdef SQLITE_HAS_CODEC - rc = sqlite3_rekey(pDb->db, pKey, nKey); - if( rc ){ - Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0); - rc = TCL_ERROR; - } -#endif - break; - } - - /* - ** $db timeout MILLESECONDS - ** - ** Delay for the number of milliseconds specified when a file is locked. - */ - case DB_TIMEOUT: { - int ms; - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "MILLISECONDS"); - return TCL_ERROR; - } - if( Tcl_GetIntFromObj(interp, objv[2], &ms) ) return TCL_ERROR; - sqlite3_busy_timeout(pDb->db, ms); - break; - } - - /* - ** $db total_changes - ** - ** Return the number of rows that were modified, inserted, or deleted - ** since the database handle was created. - */ - case DB_TOTAL_CHANGES: { - Tcl_Obj *pResult; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 2, objv, ""); - return TCL_ERROR; - } - pResult = Tcl_GetObjResult(interp); - Tcl_SetIntObj(pResult, sqlite3_total_changes(pDb->db)); - break; - } - - /* $db trace ?CALLBACK? - ** - ** Make arrangements to invoke the CALLBACK routine for each SQL statement - ** that is executed. The text of the SQL is appended to CALLBACK before - ** it is executed. - */ - case DB_TRACE: { - if( objc>3 ){ - Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?"); - return TCL_ERROR; - }else if( objc==2 ){ - if( pDb->zTrace ){ - Tcl_AppendResult(interp, pDb->zTrace, 0); - } - }else{ - char *zTrace; - int len; - if( pDb->zTrace ){ - Tcl_Free(pDb->zTrace); - } - zTrace = Tcl_GetStringFromObj(objv[2], &len); - if( zTrace && len>0 ){ - pDb->zTrace = Tcl_Alloc( len + 1 ); - strcpy(pDb->zTrace, zTrace); - }else{ - pDb->zTrace = 0; - } -#ifndef SQLITE_OMIT_TRACE - if( pDb->zTrace ){ - pDb->interp = interp; - sqlite3_trace(pDb->db, DbTraceHandler, pDb); - }else{ - sqlite3_trace(pDb->db, 0, 0); - } -#endif - } - break; - } - - /* $db transaction [-deferred|-immediate|-exclusive] SCRIPT - ** - ** Start a new transaction (if we are not already in the midst of a - ** transaction) and execute the TCL script SCRIPT. After SCRIPT - ** completes, either commit the transaction or roll it back if SCRIPT - ** throws an exception. Or if no new transation was started, do nothing. - ** pass the exception on up the stack. - ** - ** This command was inspired by Dave Thomas's talk on Ruby at the - ** 2005 O'Reilly Open Source Convention (OSCON). - */ - case DB_TRANSACTION: { - int inTrans; - Tcl_Obj *pScript; - const char *zBegin = "BEGIN"; - if( objc!=3 && objc!=4 ){ - Tcl_WrongNumArgs(interp, 2, objv, "[TYPE] SCRIPT"); - return TCL_ERROR; - } - if( objc==3 ){ - pScript = objv[2]; - } else { - static const char *TTYPE_strs[] = { - "deferred", "exclusive", "immediate", 0 - }; - enum TTYPE_enum { - TTYPE_DEFERRED, TTYPE_EXCLUSIVE, TTYPE_IMMEDIATE - }; - int ttype; - if( Tcl_GetIndexFromObj(interp, objv[2], TTYPE_strs, "transaction type", - 0, &ttype) ){ - return TCL_ERROR; - } - switch( (enum TTYPE_enum)ttype ){ - case TTYPE_DEFERRED: /* no-op */; break; - case TTYPE_EXCLUSIVE: zBegin = "BEGIN EXCLUSIVE"; break; - case TTYPE_IMMEDIATE: zBegin = "BEGIN IMMEDIATE"; break; - } - pScript = objv[3]; - } - inTrans = !sqlite3_get_autocommit(pDb->db); - if( !inTrans ){ - sqlite3_exec(pDb->db, zBegin, 0, 0, 0); - } - rc = Tcl_EvalObjEx(interp, pScript, 0); - if( !inTrans ){ - const char *zEnd; - if( rc==TCL_ERROR ){ - zEnd = "ROLLBACK"; - } else { - zEnd = "COMMIT"; - } - sqlite3_exec(pDb->db, zEnd, 0, 0, 0); - } - break; - } - - /* $db version - ** - ** Return the version string for this database. - */ - case DB_VERSION: { - Tcl_SetResult(interp, (char *)sqlite3_libversion(), TCL_STATIC); - break; - } - - - } /* End of the SWITCH statement */ - return rc; -} - -/* -** sqlite3 DBNAME FILENAME ?MODE? ?-key KEY? -** -** This is the main Tcl command. When the "sqlite" Tcl command is -** invoked, this routine runs to process that command. -** -** The first argument, DBNAME, is an arbitrary name for a new -** database connection. This command creates a new command named -** DBNAME that is used to control that connection. The database -** connection is deleted when the DBNAME command is deleted. -** -** The second argument is the name of the directory that contains -** the sqlite database that is to be accessed. -** -** For testing purposes, we also support the following: -** -** sqlite3 -encoding -** -** Return the encoding used by LIKE and GLOB operators. Choices -** are UTF-8 and iso8859. -** -** sqlite3 -version -** -** Return the version number of the SQLite library. -** -** sqlite3 -tcl-uses-utf -** -** Return "1" if compiled with a Tcl uses UTF-8. Return "0" if -** not. Used by tests to make sure the library was compiled -** correctly. -*/ -static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ - SqliteDb *p; - void *pKey = 0; - int nKey = 0; - const char *zArg; - char *zErrMsg; - const char *zFile; - char zBuf[80]; - if( objc==2 ){ - zArg = Tcl_GetStringFromObj(objv[1], 0); - if( strcmp(zArg,"-version")==0 ){ - Tcl_AppendResult(interp,sqlite3_version,0); - return TCL_OK; - } - if( strcmp(zArg,"-has-codec")==0 ){ -#ifdef SQLITE_HAS_CODEC - Tcl_AppendResult(interp,"1",0); -#else - Tcl_AppendResult(interp,"0",0); -#endif - return TCL_OK; - } - if( strcmp(zArg,"-tcl-uses-utf")==0 ){ -#ifdef TCL_UTF_MAX - Tcl_AppendResult(interp,"1",0); -#else - Tcl_AppendResult(interp,"0",0); -#endif - return TCL_OK; - } - } - if( objc==5 || objc==6 ){ - zArg = Tcl_GetStringFromObj(objv[objc-2], 0); - if( strcmp(zArg,"-key")==0 ){ - pKey = Tcl_GetByteArrayFromObj(objv[objc-1], &nKey); - objc -= 2; - } - } - if( objc!=3 && objc!=4 ){ - Tcl_WrongNumArgs(interp, 1, objv, -#ifdef SQLITE_HAS_CODEC - "HANDLE FILENAME ?-key CODEC-KEY?" -#else - "HANDLE FILENAME ?MODE?" -#endif - ); - return TCL_ERROR; - } - zErrMsg = 0; - p = (SqliteDb*)Tcl_Alloc( sizeof(*p) ); - if( p==0 ){ - Tcl_SetResult(interp, "malloc failed", TCL_STATIC); - return TCL_ERROR; - } - memset(p, 0, sizeof(*p)); - zFile = Tcl_GetStringFromObj(objv[2], 0); - sqlite3_open(zFile, &p->db); - if( SQLITE_OK!=sqlite3_errcode(p->db) ){ - zErrMsg = strdup(sqlite3_errmsg(p->db)); - sqlite3_close(p->db); - p->db = 0; - } -#ifdef SQLITE_HAS_CODEC - sqlite3_key(p->db, pKey, nKey); -#endif - if( p->db==0 ){ - Tcl_SetResult(interp, zErrMsg, TCL_VOLATILE); - Tcl_Free((char*)p); - free(zErrMsg); - return TCL_ERROR; - } - p->maxStmt = NUM_PREPARED_STMTS; - zArg = Tcl_GetStringFromObj(objv[1], 0); - Tcl_CreateObjCommand(interp, zArg, DbObjCmd, (char*)p, DbDeleteCmd); - - /* The return value is the value of the sqlite* pointer - */ - sprintf(zBuf, "%p", p->db); - if( strncmp(zBuf,"0x",2) ){ - sprintf(zBuf, "0x%p", p->db); - } - Tcl_AppendResult(interp, zBuf, 0); - - /* If compiled with SQLITE_TEST turned on, then register the "md5sum" - ** SQL function. - */ -#ifdef SQLITE_TEST - { - extern void Md5_Register(sqlite3*); -#ifdef SQLITE_MEMDEBUG - int mallocfail = sqlite3_iMallocFail; - sqlite3_iMallocFail = 0; -#endif - Md5_Register(p->db); -#ifdef SQLITE_MEMDEBUG - sqlite3_iMallocFail = mallocfail; -#endif - } -#endif - p->interp = interp; - return TCL_OK; -} - -/* -** Provide a dummy Tcl_InitStubs if we are using this as a static -** library. -*/ -#ifndef USE_TCL_STUBS -# undef Tcl_InitStubs -# define Tcl_InitStubs(a,b,c) -#endif - -/* -** Initialize this module. -** -** This Tcl module contains only a single new Tcl command named "sqlite". -** (Hence there is no namespace. There is no point in using a namespace -** if the extension only supplies one new name!) The "sqlite" command is -** used to open a new SQLite database. See the DbMain() routine above -** for additional information. -*/ -int Sqlite3_Init(Tcl_Interp *interp){ - Tcl_InitStubs(interp, "8.4", 0); - Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); - Tcl_PkgProvide(interp, "sqlite3", "3.0"); - Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0); - Tcl_PkgProvide(interp, "sqlite", "3.0"); - return TCL_OK; -} -int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } -int Sqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; } -int Tclsqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; } - -#ifndef SQLITE_3_SUFFIX_ONLY -int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } -int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } -int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; } -int Tclsqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; } -#endif - -#ifdef TCLSH -/***************************************************************************** -** The code that follows is used to build standalone TCL interpreters -*/ - -/* -** If the macro TCLSH is one, then put in code this for the -** "main" routine that will initialize Tcl and take input from -** standard input. -*/ -#if TCLSH==1 -static char zMainloop[] = - "set line {}\n" - "while {![eof stdin]} {\n" - "if {$line!=\"\"} {\n" - "puts -nonewline \"> \"\n" - "} else {\n" - "puts -nonewline \"% \"\n" - "}\n" - "flush stdout\n" - "append line [gets stdin]\n" - "if {[info complete $line]} {\n" - "if {[catch {uplevel #0 $line} result]} {\n" - "puts stderr \"Error: $result\"\n" - "} elseif {$result!=\"\"} {\n" - "puts $result\n" - "}\n" - "set line {}\n" - "} else {\n" - "append line \\n\n" - "}\n" - "}\n" -; -#endif - -/* -** If the macro TCLSH is two, then get the main loop code out of -** the separate file "spaceanal_tcl.h". -*/ -#if TCLSH==2 -static char zMainloop[] = -#include "spaceanal_tcl.h" -; -#endif - -#define TCLSH_MAIN main /* Needed to fake out mktclapp */ -int TCLSH_MAIN(int argc, char **argv){ - Tcl_Interp *interp; - Tcl_FindExecutable(argv[0]); - interp = Tcl_CreateInterp(); - Sqlite3_Init(interp); -#ifdef SQLITE_TEST - { - extern int Sqlitetest1_Init(Tcl_Interp*); - extern int Sqlitetest2_Init(Tcl_Interp*); - extern int Sqlitetest3_Init(Tcl_Interp*); - extern int Sqlitetest4_Init(Tcl_Interp*); - extern int Sqlitetest5_Init(Tcl_Interp*); - extern int Md5_Init(Tcl_Interp*); - extern int Sqlitetestsse_Init(Tcl_Interp*); - - Sqlitetest1_Init(interp); - Sqlitetest2_Init(interp); - Sqlitetest3_Init(interp); - Sqlitetest4_Init(interp); - Sqlitetest5_Init(interp); - Md5_Init(interp); -#ifdef SQLITE_SSE - Sqlitetestsse_Init(interp); -#endif - } -#endif - if( argc>=2 || TCLSH==2 ){ - int i; - Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY); - Tcl_SetVar(interp,"argv", "", TCL_GLOBAL_ONLY); - for(i=3-TCLSH; i<argc; i++){ - Tcl_SetVar(interp, "argv", argv[i], - TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE); - } - if( TCLSH==1 && Tcl_EvalFile(interp, argv[1])!=TCL_OK ){ - const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if( zInfo==0 ) zInfo = interp->result; - fprintf(stderr,"%s: %s\n", *argv, zInfo); - return 1; - } - } - if( argc<=1 || TCLSH==2 ){ - Tcl_GlobalEval(interp, zMainloop); - } - return 0; -} -#endif /* TCLSH */ - -#endif /* !defined(NO_TCL) */ diff --git a/ext/pdo_sqlite/sqlite/src/test1.c b/ext/pdo_sqlite/sqlite/src/test1.c deleted file mode 100644 index ceac5cd6da032..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/test1.c +++ /dev/null @@ -1,3254 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Code for testing the printf() interface to SQLite. This code -** is not included in the SQLite library. It is used for automated -** testing of the SQLite library. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "tcl.h" -#include "os.h" -#include <stdlib.h> -#include <string.h> - -const char *sqlite3TestErrorName(int rc){ - const char *zName = 0; - switch( rc ){ - case SQLITE_OK: zName = "SQLITE_OK"; break; - case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; - case SQLITE_PERM: zName = "SQLITE_PERM"; break; - case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; - case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; - case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break; - case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; - case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; - case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; - case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; - case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; - case SQLITE_FULL: zName = "SQLITE_FULL"; break; - case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; - case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; - case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; - case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break; - case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; - case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; - case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break; - case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break; - case SQLITE_AUTH: zName = "SQLITE_AUTH"; break; - case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break; - case SQLITE_RANGE: zName = "SQLITE_RANGE"; break; - case SQLITE_ROW: zName = "SQLITE_ROW"; break; - case SQLITE_DONE: zName = "SQLITE_DONE"; break; - case SQLITE_NOTADB: zName = "SQLITE_NOTADB"; break; - default: zName = "SQLITE_Unknown"; break; - } - return zName; -} -#define errorName sqlite3TestErrorName - -/* -** Convert an sqlite3_stmt* into an sqlite3*. This depends on the -** fact that the sqlite3* is the first field in the Vdbe structure. -*/ -#define StmtToDb(X) sqlite3_db_handle(X) - -/* -** Check a return value to make sure it agrees with the results -** from sqlite3_errcode. -*/ -int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){ - if( rc!=SQLITE_MISUSE && rc!=SQLITE_OK && sqlite3_errcode(db)!=rc ){ - char zBuf[200]; - int r2 = sqlite3_errcode(db); - sprintf(zBuf, "error code %s (%d) does not match sqlite3_errcode %s (%d)", - errorName(rc), rc, errorName(r2), r2); - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, zBuf, 0); - return 1; - } - return 0; -} - -/* -** Decode a pointer to an sqlite3 object. -*/ -static int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb){ - *ppDb = (sqlite3*)sqlite3TextToPtr(zA); - return TCL_OK; -} - -/* -** Decode a pointer to an sqlite3_stmt object. -*/ -static int getStmtPointer( - Tcl_Interp *interp, - const char *zArg, - sqlite3_stmt **ppStmt -){ - *ppStmt = (sqlite3_stmt*)sqlite3TextToPtr(zArg); - return TCL_OK; -} - -/* -** Decode a pointer to an sqlite3_stmt object. -*/ -static int getFilePointer( - Tcl_Interp *interp, - const char *zArg, - OsFile **ppFile -){ - *ppFile = (OsFile*)sqlite3TextToPtr(zArg); - return TCL_OK; -} - -/* -** Generate a text representation of a pointer that can be understood -** by the getDbPointer and getVmPointer routines above. -** -** The problem is, on some machines (Solaris) if you do a printf with -** "%p" you cannot turn around and do a scanf with the same "%p" and -** get your pointer back. You have to prepend a "0x" before it will -** work. Or at least that is what is reported to me (drh). But this -** behavior varies from machine to machine. The solution used her is -** to test the string right after it is generated to see if it can be -** understood by scanf, and if not, try prepending an "0x" to see if -** that helps. If nothing works, a fatal error is generated. -*/ -static int makePointerStr(Tcl_Interp *interp, char *zPtr, void *p){ - sqlite3_snprintf(100, zPtr, "%p", p); - return TCL_OK; -} - -/* -** The callback routine for sqlite3_exec_printf(). -*/ -static int exec_printf_cb(void *pArg, int argc, char **argv, char **name){ - Tcl_DString *str = (Tcl_DString*)pArg; - int i; - - if( Tcl_DStringLength(str)==0 ){ - for(i=0; i<argc; i++){ - Tcl_DStringAppendElement(str, name[i] ? name[i] : "NULL"); - } - } - for(i=0; i<argc; i++){ - Tcl_DStringAppendElement(str, argv[i] ? argv[i] : "NULL"); - } - return 0; -} - -/* -** Usage: sqlite3_exec_printf DB FORMAT STRING -** -** Invoke the sqlite3_exec_printf() interface using the open database -** DB. The SQL is the string FORMAT. The format string should contain -** one %s or %q. STRING is the value inserted into %s or %q. -*/ -static int test_exec_printf( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - Tcl_DString str; - int rc; - char *zErr = 0; - char *zSql; - char zBuf[30]; - if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB FORMAT STRING", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - Tcl_DStringInit(&str); - zSql = sqlite3_mprintf(argv[2], argv[3]); - rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr); - sqlite3_free(zSql); - sprintf(zBuf, "%d", rc); - Tcl_AppendElement(interp, zBuf); - Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr); - Tcl_DStringFree(&str); - if( zErr ) free(zErr); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_z_test SEPARATOR ARG0 ARG1 ... -** -** Test the %z format of mprintf(). Use multiple mprintf() calls to -** concatenate arg0 through argn using separator as the separator. -** Return the result. -*/ -static int test_mprintf_z( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - char *zResult = 0; - int i; - - for(i=2; i<argc; i++){ - zResult = sqlite3MPrintf("%z%s%s", zResult, argv[1], argv[i]); - } - Tcl_AppendResult(interp, zResult, 0); - sqliteFree(zResult); - return TCL_OK; -} - -/* -** Usage: sqlite3_get_table_printf DB FORMAT STRING -** -** Invoke the sqlite3_get_table_printf() interface using the open database -** DB. The SQL is the string FORMAT. The format string should contain -** one %s or %q. STRING is the value inserted into %s or %q. -*/ -static int test_get_table_printf( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - Tcl_DString str; - int rc; - char *zErr = 0; - int nRow, nCol; - char **aResult; - int i; - char zBuf[30]; - char *zSql; - if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB FORMAT STRING", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - Tcl_DStringInit(&str); - zSql = sqlite3_mprintf(argv[2],argv[3]); - rc = sqlite3_get_table(db, zSql, &aResult, &nRow, &nCol, &zErr); - sqlite3_free(zSql); - sprintf(zBuf, "%d", rc); - Tcl_AppendElement(interp, zBuf); - if( rc==SQLITE_OK ){ - sprintf(zBuf, "%d", nRow); - Tcl_AppendElement(interp, zBuf); - sprintf(zBuf, "%d", nCol); - Tcl_AppendElement(interp, zBuf); - for(i=0; i<(nRow+1)*nCol; i++){ - Tcl_AppendElement(interp, aResult[i] ? aResult[i] : "NULL"); - } - }else{ - Tcl_AppendElement(interp, zErr); - } - sqlite3_free_table(aResult); - if( zErr ) free(zErr); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - - -/* -** Usage: sqlite3_last_insert_rowid DB -** -** Returns the integer ROWID of the most recent insert. -*/ -static int test_last_rowid( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - char zBuf[30]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - sprintf(zBuf, "%lld", sqlite3_last_insert_rowid(db)); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: sqlite3_key DB KEY -** -** Set the codec key. -*/ -static int test_key( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - const char *zKey; - int nKey; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - zKey = argv[2]; - nKey = strlen(zKey); -#ifdef SQLITE_HAS_CODEC - sqlite3_key(db, zKey, nKey); -#endif - return TCL_OK; -} - -/* -** Usage: sqlite3_rekey DB KEY -** -** Change the codec key. -*/ -static int test_rekey( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - const char *zKey; - int nKey; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - zKey = argv[2]; - nKey = strlen(zKey); -#ifdef SQLITE_HAS_CODEC - sqlite3_rekey(db, zKey, nKey); -#endif - return TCL_OK; -} - -/* -** Usage: sqlite3_close DB -** -** Closes the database opened by sqlite3_open. -*/ -static int sqlite_test_close( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_close(db); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_OK; -} - -/* -** Implementation of the x_coalesce() function. -** Return the first argument non-NULL argument. -*/ -static void ifnullFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - int i; - for(i=0; i<argc; i++){ - if( SQLITE_NULL!=sqlite3_value_type(argv[i]) ){ - sqlite3_result_text(context, sqlite3_value_text(argv[i]), -1, - SQLITE_TRANSIENT); - break; - } - } -} - -/* -** A structure into which to accumulate text. -*/ -struct dstr { - int nAlloc; /* Space allocated */ - int nUsed; /* Space used */ - char *z; /* The space */ -}; - -/* -** Append text to a dstr -*/ -static void dstrAppend(struct dstr *p, const char *z, int divider){ - int n = strlen(z); - if( p->nUsed + n + 2 > p->nAlloc ){ - char *zNew; - p->nAlloc = p->nAlloc*2 + n + 200; - zNew = sqliteRealloc(p->z, p->nAlloc); - if( zNew==0 ){ - sqliteFree(p->z); - memset(p, 0, sizeof(*p)); - return; - } - p->z = zNew; - } - if( divider && p->nUsed>0 ){ - p->z[p->nUsed++] = divider; - } - memcpy(&p->z[p->nUsed], z, n+1); - p->nUsed += n; -} - -/* -** Invoked for each callback from sqlite3ExecFunc -*/ -static int execFuncCallback(void *pData, int argc, char **argv, char **NotUsed){ - struct dstr *p = (struct dstr*)pData; - int i; - for(i=0; i<argc; i++){ - if( argv[i]==0 ){ - dstrAppend(p, "NULL", ' '); - }else{ - dstrAppend(p, argv[i], ' '); - } - } - return 0; -} - -/* -** Implementation of the x_sqlite_exec() function. This function takes -** a single argument and attempts to execute that argument as SQL code. -** This is illegal and should set the SQLITE_MISUSE flag on the database. -** -** 2004-Jan-07: We have changed this to make it legal to call sqlite3_exec() -** from within a function call. -** -** This routine simulates the effect of having two threads attempt to -** use the same database at the same time. -*/ -static void sqlite3ExecFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - struct dstr x; - memset(&x, 0, sizeof(x)); - sqlite3_exec((sqlite3*)sqlite3_user_data(context), - sqlite3_value_text(argv[0]), - execFuncCallback, &x, 0); - sqlite3_result_text(context, x.z, x.nUsed, SQLITE_TRANSIENT); - sqliteFree(x.z); -} - -/* -** Usage: sqlite_test_create_function DB -** -** Call the sqlite3_create_function API on the given database in order -** to create a function named "x_coalesce". This function does the same thing -** as the "coalesce" function. This function also registers an SQL function -** named "x_sqlite_exec" that invokes sqlite3_exec(). Invoking sqlite3_exec() -** in this way is illegal recursion and should raise an SQLITE_MISUSE error. -** The effect is similar to trying to use the same database connection from -** two threads at the same time. -** -** The original motivation for this routine was to be able to call the -** sqlite3_create_function function while a query is in progress in order -** to test the SQLITE_MISUSE detection logic. -*/ -static int test_create_function( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int rc; - sqlite3 *db; - extern void Md5_Register(sqlite3*); - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, "x_coalesce", -1, SQLITE_ANY, 0, - ifnullFunc, 0, 0); - -#ifndef SQLITE_OMIT_UTF16 - /* Use the sqlite3_create_function16() API here. Mainly for fun, but also - ** because it is not tested anywhere else. */ - if( rc==SQLITE_OK ){ - sqlite3_value *pVal; - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, "x_sqlite_exec", SQLITE_UTF8, SQLITE_STATIC); - rc = sqlite3_create_function16(db, - sqlite3ValueText(pVal, SQLITE_UTF16NATIVE), - 1, SQLITE_UTF16, db, sqlite3ExecFunc, 0, 0); - sqlite3ValueFree(pVal); - } -#endif - - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - Tcl_SetResult(interp, (char *)errorName(rc), 0); - return TCL_OK; -} - -/* -** Routines to implement the x_count() aggregate function. -*/ -typedef struct CountCtx CountCtx; -struct CountCtx { - int n; -}; -static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){ - CountCtx *p; - p = sqlite3_aggregate_context(context, sizeof(*p)); - if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0]) ) && p ){ - p->n++; - } -} -static void countFinalize(sqlite3_context *context){ - CountCtx *p; - p = sqlite3_aggregate_context(context, sizeof(*p)); - sqlite3_result_int(context, p ? p->n : 0); -} - -/* -** Usage: sqlite_test_create_aggregate DB -** -** Call the sqlite3_create_function API on the given database in order -** to create a function named "x_count". This function does the same thing -** as the "md5sum" function. -** -** The original motivation for this routine was to be able to call the -** sqlite3_create_aggregate function while a query is in progress in order -** to test the SQLITE_MISUSE detection logic. -*/ -static int test_create_aggregate( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME\"", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, "x_count", 0, SQLITE_UTF8, 0, 0, - countStep,countFinalize); - if( rc==SQLITE_OK ){ - sqlite3_create_function(db, "x_count", 1, SQLITE_UTF8, 0, 0, - countStep,countFinalize); - } - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - - - -/* -** Usage: sqlite3_mprintf_int FORMAT INTEGER INTEGER INTEGER -** -** Call mprintf with three integer arguments -*/ -static int sqlite3_mprintf_int( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int a[3], i; - char *z; - if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT INT INT INT\"", 0); - return TCL_ERROR; - } - for(i=2; i<5; i++){ - if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR; - } - z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** If zNum represents an integer that will fit in 64-bits, then set -** *pValue to that integer and return true. Otherwise return false. -*/ -static int sqlite3GetInt64(const char *zNum, i64 *pValue){ - if( sqlite3FitsIn64Bits(zNum) ){ - sqlite3atoi64(zNum, pValue); - return 1; - } - return 0; -} - -/* -** Usage: sqlite3_mprintf_int64 FORMAT INTEGER INTEGER INTEGER -** -** Call mprintf with three 64-bit integer arguments -*/ -static int sqlite3_mprintf_int64( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int i; - sqlite_int64 a[3]; - char *z; - if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT INT INT INT\"", 0); - return TCL_ERROR; - } - for(i=2; i<5; i++){ - if( !sqlite3GetInt64(argv[i], &a[i-2]) ){ - Tcl_AppendResult(interp, "argument is not a valid 64-bit integer", 0); - return TCL_ERROR; - } - } - z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_str FORMAT INTEGER INTEGER STRING -** -** Call mprintf with two integer arguments and one string argument -*/ -static int sqlite3_mprintf_str( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int a[3], i; - char *z; - if( argc<4 || argc>5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT INT INT ?STRING?\"", 0); - return TCL_ERROR; - } - for(i=2; i<4; i++){ - if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR; - } - z = sqlite3_mprintf(argv[1], a[0], a[1], argc>4 ? argv[4] : NULL); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_double FORMAT INTEGER INTEGER DOUBLE -** -** Call mprintf with two integer arguments and one double argument -*/ -static int sqlite3_mprintf_double( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int a[3], i; - double r; - char *z; - if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT INT INT DOUBLE\"", 0); - return TCL_ERROR; - } - for(i=2; i<4; i++){ - if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR; - } - if( Tcl_GetDouble(interp, argv[4], &r) ) return TCL_ERROR; - z = sqlite3_mprintf(argv[1], a[0], a[1], r); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_scaled FORMAT DOUBLE DOUBLE -** -** Call mprintf with a single double argument which is the product of the -** two arguments given above. This is used to generate overflow and underflow -** doubles to test that they are converted properly. -*/ -static int sqlite3_mprintf_scaled( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int i; - double r[2]; - char *z; - if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT DOUBLE DOUBLE\"", 0); - return TCL_ERROR; - } - for(i=2; i<4; i++){ - if( Tcl_GetDouble(interp, argv[i], &r[i-2]) ) return TCL_ERROR; - } - z = sqlite3_mprintf(argv[1], r[0]*r[1]); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_stronly FORMAT STRING -** -** Call mprintf with a single double argument which is the product of the -** two arguments given above. This is used to generate overflow and underflow -** doubles to test that they are converted properly. -*/ -static int sqlite3_mprintf_stronly( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - char *z; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT STRING\"", 0); - return TCL_ERROR; - } - z = sqlite3_mprintf(argv[1], argv[2]); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite3_mprintf_hexdouble FORMAT HEX -** -** Call mprintf with a single double argument which is derived from the -** hexadecimal encoding of an IEEE double. -*/ -static int sqlite3_mprintf_hexdouble( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - char *z; - double r; - unsigned x1, x2; - long long unsigned d; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FORMAT STRING\"", 0); - return TCL_ERROR; - } - if( sscanf(argv[2], "%08x%08x", &x2, &x1)!=2 ){ - Tcl_AppendResult(interp, "2nd argument should be 16-characters of hex", 0); - return TCL_ERROR; - } - d = x2; - d = (d<<32) + x1; - memcpy(&r, &d, sizeof(r)); - z = sqlite3_mprintf(argv[1], r); - Tcl_AppendResult(interp, z, 0); - sqlite3_free(z); - return TCL_OK; -} - -/* -** Usage: sqlite_malloc_fail N ?REPEAT-INTERVAL? -** -** Rig sqliteMalloc() to fail on the N-th call and every REPEAT-INTERVAL call -** after that. If REPEAT-INTERVAL is 0 or is omitted, then only a single -** malloc will fail. If REPEAT-INTERVAL is 1 then all mallocs after the -** first failure will continue to fail on every call. If REPEAT-INTERVAL is -** 2 then every other malloc will fail. And so forth. -** -** Turn off this mechanism and reset the sqlite3_malloc_failed variable is N==0. -*/ -#ifdef SQLITE_MEMDEBUG -static int sqlite_malloc_fail( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - int n; - int rep; - if( argc!=2 && argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " N\"", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR; - if( argc==3 ){ - if( Tcl_GetInt(interp, argv[2], &rep) ) return TCL_ERROR; - }else{ - rep = 0; - } - sqlite3_iMallocFail = n; - sqlite3_iMallocReset = rep; - sqlite3_malloc_failed = 0; - return TCL_OK; -} -#endif - -/* -** Usage: sqlite_malloc_stat -** -** Return the number of prior calls to sqliteMalloc() and sqliteFree(). -*/ -#ifdef SQLITE_MEMDEBUG -static int sqlite_malloc_stat( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - char zBuf[200]; - sprintf(zBuf, "%d %d %d", sqlite3_nMalloc, sqlite3_nFree, sqlite3_iMallocFail); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} -#endif - -/* -** Usage: sqlite_abort -** -** Shutdown the process immediately. This is not a clean shutdown. -** This command is used to test the recoverability of a database in -** the event of a program crash. -*/ -static int sqlite_abort( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - assert( interp==0 ); /* This will always fail */ - return TCL_OK; -} - -/* -** The following routine is a user-defined SQL function whose purpose -** is to test the sqlite_set_result() API. -*/ -static void testFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - while( argc>=2 ){ - const char *zArg0 = sqlite3_value_text(argv[0]); - if( zArg0 ){ - if( 0==sqlite3StrICmp(zArg0, "int") ){ - sqlite3_result_int(context, sqlite3_value_int(argv[1])); - }else if( sqlite3StrICmp(zArg0,"int64")==0 ){ - sqlite3_result_int64(context, sqlite3_value_int64(argv[1])); - }else if( sqlite3StrICmp(zArg0,"string")==0 ){ - sqlite3_result_text(context, sqlite3_value_text(argv[1]), -1, - SQLITE_TRANSIENT); - }else if( sqlite3StrICmp(zArg0,"double")==0 ){ - sqlite3_result_double(context, sqlite3_value_double(argv[1])); - }else if( sqlite3StrICmp(zArg0,"null")==0 ){ - sqlite3_result_null(context); - }else if( sqlite3StrICmp(zArg0,"value")==0 ){ - sqlite3_result_value(context, argv[sqlite3_value_int(argv[1])]); - }else{ - goto error_out; - } - }else{ - goto error_out; - } - argc -= 2; - argv += 2; - } - return; - -error_out: - sqlite3_result_error(context,"first argument should be one of: " - "int int64 string double null value", -1); -} - -/* -** Usage: sqlite_register_test_function DB NAME -** -** Register the test SQL function on the database DB under the name NAME. -*/ -static int test_register_func( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - int rc; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB FUNCTION-NAME", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, - testFunc, 0, 0); - if( rc!=0 ){ - Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0); - return TCL_ERROR; - } - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - -/* -** Usage: sqlite3_finalize STMT -** -** Finalize a statement handle. -*/ -static int test_finalize( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int rc; - sqlite3 *db; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - - if( pStmt ){ - db = StmtToDb(pStmt); - } - rc = sqlite3_finalize(pStmt); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - if( db && sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - -/* -** Usage: sqlite3_reset STMT -** -** Finalize a statement handle. -*/ -static int test_reset( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int rc; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - - rc = sqlite3_reset(pStmt); - if( pStmt && - sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - if( rc ){ - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: sqlite3_expired STMT -** -** Return TRUE if a recompilation of the statement is recommended. -*/ -static int test_expired( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - Tcl_SetObjResult(interp, Tcl_NewBooleanObj(sqlite3_expired(pStmt))); - return TCL_OK; -} - -/* -** Usage: sqlite3_transfer_bindings FROMSTMT TOSTMT -** -** Transfer all bindings from FROMSTMT over to TOSTMT -*/ -static int test_transfer_bind( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt1, *pStmt2; - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " FROM-STMT TO-STMT", 0); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt1)) return TCL_ERROR; - if( getStmtPointer(interp, Tcl_GetString(objv[2]), &pStmt2)) return TCL_ERROR; - Tcl_SetObjResult(interp, - Tcl_NewIntObj(sqlite3_transfer_bindings(pStmt1,pStmt2))); - return TCL_OK; -} - -/* -** Usage: sqlite3_changes DB -** -** Return the number of changes made to the database by the last SQL -** execution. -*/ -static int test_changes( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_changes(db))); - return TCL_OK; -} - -/* -** This is the "static_bind_value" that variables are bound to when -** the FLAG option of sqlite3_bind is "static" -*/ -static char *sqlite_static_bind_value = 0; - -/* -** Usage: sqlite3_bind VM IDX VALUE FLAGS -** -** Sets the value of the IDX-th occurance of "?" in the original SQL -** string. VALUE is the new value. If FLAGS=="null" then VALUE is -** ignored and the value is set to NULL. If FLAGS=="static" then -** the value is set to the value of a static variable named -** "sqlite_static_bind_value". If FLAGS=="normal" then a copy -** of the VALUE is made. -*/ -static int test_bind( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3_stmt *pStmt; - int rc; - int idx; - if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " VM IDX VALUE (null|static|normal)\"", 0); - return TCL_ERROR; - } - if( getStmtPointer(interp, argv[1], &pStmt) ) return TCL_ERROR; - if( Tcl_GetInt(interp, argv[2], &idx) ) return TCL_ERROR; - if( strcmp(argv[4],"null")==0 ){ - rc = sqlite3_bind_null(pStmt, idx); - }else if( strcmp(argv[4],"static")==0 ){ - rc = sqlite3_bind_text(pStmt, idx, sqlite_static_bind_value, -1, 0); - }else if( strcmp(argv[4],"normal")==0 ){ - rc = sqlite3_bind_text(pStmt, idx, argv[3], -1, SQLITE_TRANSIENT); - }else{ - Tcl_AppendResult(interp, "4th argument should be " - "\"null\" or \"static\" or \"normal\"", 0); - return TCL_ERROR; - } - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc ){ - char zBuf[50]; - sprintf(zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3ErrStr(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** Usage: add_test_collate <db ptr> <utf8> <utf16le> <utf16be> -** -** This function is used to test that SQLite selects the correct collation -** sequence callback when multiple versions (for different text encodings) -** are available. -** -** Calling this routine registers the collation sequence "test_collate" -** with database handle <db>. The second argument must be a list of three -** boolean values. If the first is true, then a version of test_collate is -** registered for UTF-8, if the second is true, a version is registered for -** UTF-16le, if the third is true, a UTF-16be version is available. -** Previous versions of test_collate are deleted. -** -** The collation sequence test_collate is implemented by calling the -** following TCL script: -** -** "test_collate <enc> <lhs> <rhs>" -** -** The <lhs> and <rhs> are the two values being compared, encoded in UTF-8. -** The <enc> parameter is the encoding of the collation function that -** SQLite selected to call. The TCL test script implements the -** "test_collate" proc. -** -** Note that this will only work with one intepreter at a time, as the -** interp pointer to use when evaluating the TCL script is stored in -** pTestCollateInterp. -*/ -static Tcl_Interp* pTestCollateInterp; -static int test_collate_func( - void *pCtx, - int nA, const void *zA, - int nB, const void *zB -){ - Tcl_Interp *i = pTestCollateInterp; - int encin = (int)pCtx; - int res; - int n; - - sqlite3_value *pVal; - Tcl_Obj *pX; - - pX = Tcl_NewStringObj("test_collate", -1); - Tcl_IncrRefCount(pX); - - switch( encin ){ - case SQLITE_UTF8: - Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-8",-1)); - break; - case SQLITE_UTF16LE: - Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-16LE",-1)); - break; - case SQLITE_UTF16BE: - Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-16BE",-1)); - break; - default: - assert(0); - } - - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, nA, zA, encin, SQLITE_STATIC); - n = sqlite3_value_bytes(pVal); - Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj(sqlite3_value_text(pVal),n)); - sqlite3ValueSetStr(pVal, nB, zB, encin, SQLITE_STATIC); - n = sqlite3_value_bytes(pVal); - Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj(sqlite3_value_text(pVal),n)); - sqlite3ValueFree(pVal); - - Tcl_EvalObjEx(i, pX, 0); - Tcl_DecrRefCount(pX); - Tcl_GetIntFromObj(i, Tcl_GetObjResult(i), &res); - return res; -} -static int test_collate( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - int val; - sqlite3_value *pVal; - int rc; - - if( objc!=5 ) goto bad_args; - pTestCollateInterp = interp; - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF8, - (void *)SQLITE_UTF8, val?test_collate_func:0); - if( rc==SQLITE_OK ){ - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF16LE, - (void *)SQLITE_UTF16LE, val?test_collate_func:0); - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR; - - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, "test_collate", SQLITE_UTF8, SQLITE_STATIC); - sqlite3_create_collation16(db, sqlite3ValueText(pVal, SQLITE_UTF16NATIVE), - SQLITE_UTF16BE, (void *)SQLITE_UTF16BE, val?test_collate_func:0); - sqlite3ValueFree(pVal); - } - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; - -bad_args: - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <DB> <utf8> <utf16le> <utf16be>", 0); - return TCL_ERROR; -} - -static void test_collate_needed_cb( - void *pCtx, - sqlite3 *db, - int eTextRep, - const void *notUsed -){ - int enc = db->enc; - sqlite3_create_collation( - db, "test_collate", db->enc, (void *)enc, test_collate_func); -} - -/* -** Usage: add_test_collate_needed DB -*/ -static int test_collate_needed( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - int rc; - - if( objc!=2 ) goto bad_args; - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - rc = sqlite3_collation_needed16(db, 0, test_collate_needed_cb); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; - -bad_args: - Tcl_WrongNumArgs(interp, 1, objv, "DB"); - return TCL_ERROR; -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Usage: add_test_function <db ptr> <utf8> <utf16le> <utf16be> -** -** This function is used to test that SQLite selects the correct user -** function callback when multiple versions (for different text encodings) -** are available. -** -** Calling this routine registers up to three versions of the user function -** "test_function" with database handle <db>. If the second argument is -** true, then a version of test_function is registered for UTF-8, if the -** third is true, a version is registered for UTF-16le, if the fourth is -** true, a UTF-16be version is available. Previous versions of -** test_function are deleted. -** -** The user function is implemented by calling the following TCL script: -** -** "test_function <enc> <arg>" -** -** Where <enc> is one of UTF-8, UTF-16LE or UTF16BE, and <arg> is the -** single argument passed to the SQL function. The value returned by -** the TCL script is used as the return value of the SQL function. It -** is passed to SQLite using UTF-16BE for a UTF-8 test_function(), UTF-8 -** for a UTF-16LE test_function(), and UTF-16LE for an implementation that -** prefers UTF-16BE. -*/ -#ifndef SQLITE_OMIT_UTF16 -static void test_function_utf8( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - Tcl_Interp *interp; - Tcl_Obj *pX; - sqlite3_value *pVal; - interp = (Tcl_Interp *)sqlite3_user_data(pCtx); - pX = Tcl_NewStringObj("test_function", -1); - Tcl_IncrRefCount(pX); - Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-8", -1)); - Tcl_ListObjAppendElement(interp, pX, - Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1)); - Tcl_EvalObjEx(interp, pX, 0); - Tcl_DecrRefCount(pX); - sqlite3_result_text(pCtx, Tcl_GetStringResult(interp), -1, SQLITE_TRANSIENT); - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), - SQLITE_UTF8, SQLITE_STATIC); - sqlite3_result_text16be(pCtx, sqlite3_value_text16be(pVal), - -1, SQLITE_TRANSIENT); - sqlite3ValueFree(pVal); -} -static void test_function_utf16le( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - Tcl_Interp *interp; - Tcl_Obj *pX; - sqlite3_value *pVal; - interp = (Tcl_Interp *)sqlite3_user_data(pCtx); - pX = Tcl_NewStringObj("test_function", -1); - Tcl_IncrRefCount(pX); - Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16LE", -1)); - Tcl_ListObjAppendElement(interp, pX, - Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1)); - Tcl_EvalObjEx(interp, pX, 0); - Tcl_DecrRefCount(pX); - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), - SQLITE_UTF8, SQLITE_STATIC); - sqlite3_result_text(pCtx,sqlite3_value_text(pVal),-1,SQLITE_TRANSIENT); - sqlite3ValueFree(pVal); -} -static void test_function_utf16be( - sqlite3_context *pCtx, - int nArg, - sqlite3_value **argv -){ - Tcl_Interp *interp; - Tcl_Obj *pX; - sqlite3_value *pVal; - interp = (Tcl_Interp *)sqlite3_user_data(pCtx); - pX = Tcl_NewStringObj("test_function", -1); - Tcl_IncrRefCount(pX); - Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16BE", -1)); - Tcl_ListObjAppendElement(interp, pX, - Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1)); - Tcl_EvalObjEx(interp, pX, 0); - Tcl_DecrRefCount(pX); - pVal = sqlite3ValueNew(); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), - SQLITE_UTF8, SQLITE_STATIC); - sqlite3_result_text16le(pCtx, sqlite3_value_text16le(pVal), - -1, SQLITE_TRANSIENT); - sqlite3ValueFree(pVal); -} -#endif /* SQLITE_OMIT_UTF16 */ -static int test_function( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3 *db; - int val; - - if( objc!=5 ) goto bad_args; - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR; - if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF8, - interp, test_function_utf8, 0, 0); - } - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR; - if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16LE, - interp, test_function_utf16le, 0, 0); - } - if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR; - if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16BE, - interp, test_function_utf16be, 0, 0); - } - - return TCL_OK; -bad_args: - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <DB> <utf8> <utf16le> <utf16be>", 0); -#endif /* SQLITE_OMIT_UTF16 */ - return TCL_ERROR; -} - -/* -** Usage: test_errstr <err code> -** -** Test that the english language string equivalents for sqlite error codes -** are sane. The parameter is an integer representing an sqlite error code. -** The result is a list of two elements, the string representation of the -** error code and the english language explanation. -*/ -static int test_errstr( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - char *zCode; - int i; - if( objc!=1 ){ - Tcl_WrongNumArgs(interp, 1, objv, "<error code>"); - } - - zCode = Tcl_GetString(objv[1]); - for(i=0; i<200; i++){ - if( 0==strcmp(errorName(i), zCode) ) break; - } - Tcl_SetResult(interp, (char *)sqlite3ErrStr(i), 0); - return TCL_OK; -} - -static int sqlite3_crashparams( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifdef OS_TEST - int delay; - if( objc!=3 ) goto bad_args; - if( Tcl_GetIntFromObj(interp, objv[1], &delay) ) return TCL_ERROR; - sqlite3SetCrashParams(delay, Tcl_GetString(objv[2])); -#endif - return TCL_OK; - -#ifdef OS_TEST -bad_args: - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), "<delay> <filename>", 0); - return TCL_ERROR; -#endif -} - - -/* -** Usage: breakpoint -** -** This routine exists for one purpose - to provide a place to put a -** breakpoint with GDB that can be triggered using TCL code. The use -** for this is when a particular test fails on (say) the 1485th iteration. -** In the TCL test script, we can add code like this: -** -** if {$i==1485} breakpoint -** -** Then run testfixture in the debugger and wait for the breakpoint to -** fire. Then additional breakpoints can be set to trace down the bug. -*/ -static int test_breakpoint( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - return TCL_OK; /* Do nothing */ -} - -/* -** Usage: sqlite3_bind_int STMT N VALUE -** -** Test the sqlite3_bind_int interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a 32-bit integer VALUE to that wildcard. -*/ -static int test_bind_int( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - int value; - int rc; - - if( objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[3], &value) ) return TCL_ERROR; - - rc = sqlite3_bind_int(pStmt, idx, value); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - - return TCL_OK; -} - - -/* -** Usage: sqlite3_bind_int64 STMT N VALUE -** -** Test the sqlite3_bind_int64 interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a 64-bit integer VALUE to that wildcard. -*/ -static int test_bind_int64( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - i64 value; - int rc; - - if( objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - if( Tcl_GetWideIntFromObj(interp, objv[3], &value) ) return TCL_ERROR; - - rc = sqlite3_bind_int64(pStmt, idx, value); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - - return TCL_OK; -} - - -/* -** Usage: sqlite3_bind_double STMT N VALUE -** -** Test the sqlite3_bind_double interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a 64-bit integer VALUE to that wildcard. -*/ -static int test_bind_double( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - double value; - int rc; - - if( objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - if( Tcl_GetDoubleFromObj(interp, objv[3], &value) ) return TCL_ERROR; - - rc = sqlite3_bind_double(pStmt, idx, value); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_null STMT N -** -** Test the sqlite3_bind_null interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a NULL to the wildcard. -*/ -static int test_bind_null( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - int rc; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - - rc = sqlite3_bind_null(pStmt, idx); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_text STMT N STRING BYTES -** -** Test the sqlite3_bind_text interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a UTF-8 string STRING to the wildcard. The string is BYTES bytes -** long. -*/ -static int test_bind_text( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - int bytes; - char *value; - int rc; - - if( objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - value = Tcl_GetString(objv[3]); - if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR; - - rc = sqlite3_bind_text(pStmt, idx, value, bytes, SQLITE_TRANSIENT); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3TestErrorName(rc), 0); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_text16 STMT N STRING BYTES -** -** Test the sqlite3_bind_text16 interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a UTF-16 string STRING to the wildcard. The string is BYTES bytes -** long. -*/ -static int test_bind_text16( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3_stmt *pStmt; - int idx; - int bytes; - char *value; - int rc; - - if( objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - value = Tcl_GetByteArrayFromObj(objv[3], 0); - if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR; - - rc = sqlite3_bind_text16(pStmt, idx, (void *)value, bytes, SQLITE_TRANSIENT); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - -#endif /* SQLITE_OMIT_UTF16 */ - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_blob STMT N DATA BYTES -** -** Test the sqlite3_bind_blob interface. STMT is a prepared statement. -** N is the index of a wildcard in the prepared statement. This command -** binds a BLOB to the wildcard. The BLOB is BYTES bytes in size. -*/ -static int test_bind_blob( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int idx; - int bytes; - char *value; - int rc; - - if( objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N DATA BYTES", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR; - value = Tcl_GetString(objv[3]); - if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR; - - rc = sqlite3_bind_blob(pStmt, idx, value, bytes, SQLITE_TRANSIENT); - if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; - if( rc!=SQLITE_OK ){ - return TCL_ERROR; - } - - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_parameter_count STMT -** -** Return the number of wildcards in the given statement. -*/ -static int test_bind_parameter_count( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "STMT"); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_bind_parameter_count(pStmt))); - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_parameter_name STMT N -** -** Return the name of the Nth wildcard. The first wildcard is 1. -** An empty string is returned if N is out of range or if the wildcard -** is nameless. -*/ -static int test_bind_parameter_name( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int i; - - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 1, objv, "STMT N"); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &i) ) return TCL_ERROR; - Tcl_SetObjResult(interp, - Tcl_NewStringObj(sqlite3_bind_parameter_name(pStmt,i),-1) - ); - return TCL_OK; -} - -/* -** Usage: sqlite3_bind_parameter_index STMT NAME -** -** Return the index of the wildcard called NAME. Return 0 if there is -** no such wildcard. -*/ -static int test_bind_parameter_index( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - - if( objc!=3 ){ - Tcl_WrongNumArgs(interp, 1, objv, "STMT NAME"); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - Tcl_SetObjResult(interp, - Tcl_NewIntObj( - sqlite3_bind_parameter_index(pStmt,Tcl_GetString(objv[2])) - ) - ); - return TCL_OK; -} - -/* -** Usage: sqlite3_clear_bindings STMT -** -*/ -#if 0 -static int test_clear_bindings( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "STMT"); - return TCL_ERROR; - } - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_clear_bindings(pStmt))); - return TCL_OK; -} -#endif - -/* -** Usage: sqlite3_errcode DB -** -** Return the string representation of the most recent sqlite3_* API -** error code. e.g. "SQLITE_ERROR". -*/ -static int test_errcode( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - Tcl_SetResult(interp, (char *)errorName(sqlite3_errcode(db)), 0); - return TCL_OK; -} - -/* -** Usage: test_errmsg DB -** -** Returns the UTF-8 representation of the error message string for the -** most recent sqlite3_* API call. -*/ -static int test_errmsg( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - const char *zErr; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - - zErr = sqlite3_errmsg(db); - Tcl_SetObjResult(interp, Tcl_NewStringObj(zErr, -1)); - return TCL_OK; -} - -/* -** Usage: test_errmsg16 DB -** -** Returns the UTF-16 representation of the error message string for the -** most recent sqlite3_* API call. This is a byte array object at the TCL -** level, and it includes the 0x00 0x00 terminator bytes at the end of the -** UTF-16 string. -*/ -static int test_errmsg16( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3 *db; - const void *zErr; - int bytes; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - - zErr = sqlite3_errmsg16(db); - bytes = sqlite3utf16ByteLen(zErr, -1); - Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(zErr, bytes)); -#endif /* SQLITE_OMIT_UTF16 */ - return TCL_OK; -} - -/* -** Usage: sqlite3_prepare DB sql bytes tailvar -** -** Compile up to <bytes> bytes of the supplied SQL string <sql> using -** database handle <DB>. The parameter <tailval> is the name of a global -** variable that is set to the unused portion of <sql> (if any). A -** STMT handle is returned. -*/ -static int test_prepare( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - const char *zSql; - int bytes; - const char *zTail = 0; - sqlite3_stmt *pStmt = 0; - char zBuf[50]; - int rc; - - if( objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - zSql = Tcl_GetString(objv[2]); - if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - - rc = sqlite3_prepare(db, zSql, bytes, &pStmt, &zTail); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( zTail ){ - if( bytes>=0 ){ - bytes = bytes - (zTail-zSql); - } - Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0); - } - if( rc!=SQLITE_OK ){ - assert( pStmt==0 ); - sprintf(zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); - return TCL_ERROR; - } - - if( pStmt ){ - if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); - } - return TCL_OK; -} - -/* -** Usage: sqlite3_prepare DB sql bytes tailvar -** -** Compile up to <bytes> bytes of the supplied SQL string <sql> using -** database handle <DB>. The parameter <tailval> is the name of a global -** variable that is set to the unused portion of <sql> (if any). A -** STMT handle is returned. -*/ -static int test_prepare16( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3 *db; - const void *zSql; - const void *zTail = 0; - Tcl_Obj *pTail = 0; - sqlite3_stmt *pStmt = 0; - char zBuf[50]; - int rc; - int bytes; /* The integer specified as arg 3 */ - int objlen; /* The byte-array length of arg 2 */ - - if( objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - zSql = Tcl_GetByteArrayFromObj(objv[2], &objlen); - if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - - rc = sqlite3_prepare16(db, zSql, bytes, &pStmt, &zTail); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( rc ){ - return TCL_ERROR; - } - - if( zTail ){ - objlen = objlen - ((u8 *)zTail-(u8 *)zSql); - }else{ - objlen = 0; - } - pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen); - Tcl_IncrRefCount(pTail); - Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0); - Tcl_DecrRefCount(pTail); - - if( pStmt ){ - if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - } - Tcl_AppendResult(interp, zBuf, 0); -#endif /* SQLITE_OMIT_UTF16 */ - return TCL_OK; -} - -/* -** Usage: sqlite3_open filename ?options-list? -*/ -static int test_open( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - const char *zFilename; - sqlite3 *db; - int rc; - char zBuf[100]; - - if( objc!=3 && objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filename options-list", 0); - return TCL_ERROR; - } - - zFilename = Tcl_GetString(objv[1]); - rc = sqlite3_open(zFilename, &db); - - if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: sqlite3_open16 filename options -*/ -static int test_open16( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - const void *zFilename; - sqlite3 *db; - int rc; - char zBuf[100]; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filename options-list", 0); - return TCL_ERROR; - } - - zFilename = Tcl_GetByteArrayFromObj(objv[1], 0); - rc = sqlite3_open16(zFilename, &db); - - if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); -#endif /* SQLITE_OMIT_UTF16 */ - return TCL_OK; -} - -/* -** Usage: sqlite3_complete16 <UTF-16 string> -** -** Return 1 if the supplied argument is a complete SQL statement, or zero -** otherwise. -*/ -static int test_complete16( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#if !defined(SQLITE_OMIT_COMPLETE) && !defined(SQLITE_OMIT_UTF16) - char *zBuf; - - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "<utf-16 sql>"); - return TCL_ERROR; - } - - zBuf = Tcl_GetByteArrayFromObj(objv[1], 0); - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_complete16(zBuf))); -#endif /* SQLITE_OMIT_COMPLETE && SQLITE_OMIT_UTF16 */ - return TCL_OK; -} - -/* -** Usage: sqlite3_step STMT -** -** Advance the statement to the next row. -*/ -static int test_step( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int rc; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - rc = sqlite3_step(pStmt); - - /* if( rc!=SQLITE_DONE && rc!=SQLITE_ROW ) return TCL_ERROR; */ - Tcl_SetResult(interp, (char *)errorName(rc), 0); - return TCL_OK; -} - -/* -** Usage: sqlite3_column_count STMT -** -** Return the number of columns returned by the sql statement STMT. -*/ -static int test_column_count( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_column_count(pStmt))); - return TCL_OK; -} - -/* -** Usage: sqlite3_column_type STMT column -** -** Return the type of the data in column 'column' of the current row. -*/ -static int test_column_type( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - int tp; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - tp = sqlite3_column_type(pStmt, col); - switch( tp ){ - case SQLITE_INTEGER: - Tcl_SetResult(interp, "INTEGER", TCL_STATIC); - break; - case SQLITE_NULL: - Tcl_SetResult(interp, "NULL", TCL_STATIC); - break; - case SQLITE_FLOAT: - Tcl_SetResult(interp, "FLOAT", TCL_STATIC); - break; - case SQLITE_TEXT: - Tcl_SetResult(interp, "TEXT", TCL_STATIC); - break; - case SQLITE_BLOB: - Tcl_SetResult(interp, "BLOB", TCL_STATIC); - break; - default: - assert(0); - } - - return TCL_OK; -} - -/* -** Usage: sqlite3_column_int64 STMT column -** -** Return the data in column 'column' of the current row cast as an -** wide (64-bit) integer. -*/ -static int test_column_int64( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - i64 iVal; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - iVal = sqlite3_column_int64(pStmt, col); - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iVal)); - return TCL_OK; -} - -/* -** Usage: sqlite3_column_blob STMT column -*/ -static int test_column_blob( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - - int len; - const void *pBlob; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - pBlob = sqlite3_column_blob(pStmt, col); - len = sqlite3_column_bytes(pStmt, col); - Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(pBlob, len)); - return TCL_OK; -} - -/* -** Usage: sqlite3_column_double STMT column -** -** Return the data in column 'column' of the current row cast as a double. -*/ -static int test_column_double( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - double rVal; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - rVal = sqlite3_column_double(pStmt, col); - Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rVal)); - return TCL_OK; -} - -/* -** Usage: sqlite3_data_count STMT -** -** Return the number of columns returned by the sql statement STMT. -*/ -static int test_data_count( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_data_count(pStmt))); - return TCL_OK; -} - -/* -** Usage: sqlite3_column_text STMT column -** -** Usage: sqlite3_column_decltype STMT column -** -** Usage: sqlite3_column_name STMT column -*/ -static int test_stmt_utf8( - void * clientData, /* Pointer to SQLite API function to be invoke */ - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - const char *(*xFunc)(sqlite3_stmt*, int) = clientData; - const char *zRet; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - zRet = xFunc(pStmt, col); - if( zRet ){ - Tcl_SetResult(interp, (char *)zRet, 0); - } - return TCL_OK; -} - -static int test_global_recover( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_GLOBALRECOVER - int rc; - if( objc!=1 ){ - Tcl_WrongNumArgs(interp, 1, objv, ""); - return TCL_ERROR; - } - rc = sqlite3_global_recover(); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); -#endif - return TCL_OK; -} - -/* -** Usage: sqlite3_column_text STMT column -** -** Usage: sqlite3_column_decltype STMT column -** -** Usage: sqlite3_column_name STMT column -*/ -static int test_stmt_utf16( - void * clientData, /* Pointer to SQLite API function to be invoked */ - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3_stmt *pStmt; - int col; - Tcl_Obj *pRet; - const void *zName16; - const void *(*xFunc)(sqlite3_stmt*, int) = clientData; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - zName16 = xFunc(pStmt, col); - if( zName16 ){ - pRet = Tcl_NewByteArrayObj(zName16, sqlite3utf16ByteLen(zName16, -1)+2); - Tcl_SetObjResult(interp, pRet); - } -#endif /* SQLITE_OMIT_UTF16 */ - - return TCL_OK; -} - -/* -** Usage: sqlite3_column_int STMT column -** -** Usage: sqlite3_column_bytes STMT column -** -** Usage: sqlite3_column_bytes16 STMT column -** -*/ -static int test_stmt_int( - void * clientData, /* Pointer to SQLite API function to be invoked */ - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3_stmt *pStmt; - int col; - int (*xFunc)(sqlite3_stmt*, int) = clientData; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); - return TCL_ERROR; - } - - if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR; - - Tcl_SetObjResult(interp, Tcl_NewIntObj(xFunc(pStmt, col))); - return TCL_OK; -} - -#ifndef SQLITE_OMIT_DISKIO -/* -** Usage: sqlite3OsOpenReadWrite <filename> -*/ -static int test_sqlite3OsOpenReadWrite( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - OsFile * pFile; - int rc; - int dummy; - char zBuf[100]; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filename", 0); - return TCL_ERROR; - } - - pFile = sqliteMalloc(sizeof(OsFile)); - rc = sqlite3OsOpenReadWrite(Tcl_GetString(objv[1]), pFile, &dummy); - if( rc!=SQLITE_OK ){ - sqliteFree(pFile); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_ERROR; - } - makePointerStr(interp, zBuf, pFile); - Tcl_SetResult(interp, zBuf, 0); - return TCL_ERROR; -} - -/* -** Usage: sqlite3OsClose <file handle> -*/ -static int test_sqlite3OsClose( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - OsFile * pFile; - int rc; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filehandle", 0); - return TCL_ERROR; - } - - if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){ - return TCL_ERROR; - } - rc = sqlite3OsClose(pFile); - if( rc!=SQLITE_OK ){ - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_ERROR; - } - sqliteFree(pFile); - return TCL_OK; -} - -/* -** Usage: sqlite3OsLock <file handle> <locktype> -*/ -static int test_sqlite3OsLock( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - OsFile * pFile; - int rc; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), - " filehandle (SHARED|RESERVED|PENDING|EXCLUSIVE)", 0); - return TCL_ERROR; - } - - if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){ - return TCL_ERROR; - } - - if( 0==strcmp("SHARED", Tcl_GetString(objv[2])) ){ - rc = sqlite3OsLock(pFile, SHARED_LOCK); - } - else if( 0==strcmp("RESERVED", Tcl_GetString(objv[2])) ){ - rc = sqlite3OsLock(pFile, RESERVED_LOCK); - } - else if( 0==strcmp("PENDING", Tcl_GetString(objv[2])) ){ - rc = sqlite3OsLock(pFile, PENDING_LOCK); - } - else if( 0==strcmp("EXCLUSIVE", Tcl_GetString(objv[2])) ){ - rc = sqlite3OsLock(pFile, EXCLUSIVE_LOCK); - }else{ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), - " filehandle (SHARED|RESERVED|PENDING|EXCLUSIVE)", 0); - return TCL_ERROR; - } - - if( rc!=SQLITE_OK ){ - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: sqlite3OsUnlock <file handle> -*/ -static int test_sqlite3OsUnlock( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - OsFile * pFile; - int rc; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filehandle", 0); - return TCL_ERROR; - } - - if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){ - return TCL_ERROR; - } - rc = sqlite3OsUnlock(pFile, NO_LOCK); - if( rc!=SQLITE_OK ){ - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: sqlite3OsTempFileName -*/ -static int test_sqlite3OsTempFileName( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - char zFile[SQLITE_TEMPNAME_SIZE]; - int rc; - - rc = sqlite3OsTempFileName(zFile); - if( rc!=SQLITE_OK ){ - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_ERROR; - } - Tcl_AppendResult(interp, zFile, 0); - return TCL_OK; -} -#endif - -/* -** Usage: sqlite_set_magic DB MAGIC-NUMBER -** -** Set the db->magic value. This is used to test error recovery logic. -*/ -static int sqlite_set_magic( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - sqlite3 *db; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB MAGIC", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - if( strcmp(argv[2], "SQLITE_MAGIC_OPEN")==0 ){ - db->magic = SQLITE_MAGIC_OPEN; - }else if( strcmp(argv[2], "SQLITE_MAGIC_CLOSED")==0 ){ - db->magic = SQLITE_MAGIC_CLOSED; - }else if( strcmp(argv[2], "SQLITE_MAGIC_BUSY")==0 ){ - db->magic = SQLITE_MAGIC_BUSY; - }else if( strcmp(argv[2], "SQLITE_MAGIC_ERROR")==0 ){ - db->magic = SQLITE_MAGIC_ERROR; - }else if( Tcl_GetInt(interp, argv[2], &db->magic) ){ - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: sqlite3_interrupt DB -** -** Trigger an interrupt on DB -*/ -static int test_interrupt( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - sqlite3 *db; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - sqlite3_interrupt(db); - return TCL_OK; -} - -static u8 *sqlite3_stack_baseline = 0; - -/* -** Fill the stack with a known bitpattern. -*/ -static void prepStack(void){ - int i; - u32 bigBuf[65536]; - for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef; - sqlite3_stack_baseline = (u8*)&bigBuf[65536]; -} - -/* -** Get the current stack depth. Used for debugging only. -*/ -u64 sqlite3StackDepth(void){ - u8 x; - return (u64)(sqlite3_stack_baseline - &x); -} - -/* -** Usage: sqlite3_stack_used DB SQL -** -** Try to measure the amount of stack space used by a call to sqlite3_exec -*/ -static int test_stack_used( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - sqlite3 *db; - int i; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB SQL", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - prepStack(); - sqlite3_exec(db, argv[2], 0, 0, 0); - for(i=65535; i>=0 && ((u32*)sqlite3_stack_baseline)[-i]==0xdeadbeef; i--){} - Tcl_SetObjResult(interp, Tcl_NewIntObj(i*4)); - return TCL_OK; -} - -/* -** Usage: sqlite_delete_function DB function-name -** -** Delete the user function 'function-name' from database handle DB. It -** is assumed that the user function was created as UTF8, any number of -** arguments (the way the TCL interface does it). -*/ -static int delete_function( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - int rc; - sqlite3 *db; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB function-name", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, 0, 0, 0); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_OK; -} - -/* -** Usage: sqlite_delete_collation DB collation-name -** -** Delete the collation sequence 'collation-name' from database handle -** DB. It is assumed that the collation sequence was created as UTF8 (the -** way the TCL interface does it). -*/ -static int delete_collation( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - int rc; - sqlite3 *db; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB function-name", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, argv[2], SQLITE_UTF8, 0, 0); - Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); - return TCL_OK; -} - -/* -** Usage: sqlite3_get_autocommit DB -** -** Return true if the database DB is currently in auto-commit mode. -** Return false if not. -*/ -static int get_autocommit( - void * clientData, - Tcl_Interp *interp, - int argc, - char **argv -){ - char zBuf[30]; - sqlite3 *db; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - sprintf(zBuf, "%d", sqlite3_get_autocommit(db)); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: tcl_variable_type VARIABLENAME -** -** Return the name of the internal representation for the -** value of the given variable. -*/ -static int tcl_variable_type( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - Tcl_Obj *pVar; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "VARIABLE"); - return TCL_ERROR; - } - pVar = Tcl_GetVar2Ex(interp, Tcl_GetString(objv[1]), 0, TCL_LEAVE_ERR_MSG); - if( pVar==0 ) return TCL_ERROR; - if( pVar->typePtr ){ - Tcl_SetObjResult(interp, Tcl_NewStringObj(pVar->typePtr->name, -1)); - } - return TCL_OK; -} - -/* -** This routine sets entries in the global ::sqlite_options() array variable -** according to the compile-time configuration of the database. Test -** procedures use this to determine when tests should be omitted. -*/ -static void set_options(Tcl_Interp *interp){ -#ifdef SQLITE_32BIT_ROWID - Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_CASE_SENSITIVE_LIKE - Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_ALTERTABLE - Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_ANALYZE - Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_AUTHORIZATION - Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_AUTOINCREMENT - Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_AUTOVACUUM - Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY); -#endif /* SQLITE_OMIT_AUTOVACUUM */ -#if !defined(SQLITE_DEFAULT_AUTOVACUUM) || SQLITE_DEFAULT_AUTOVACUUM==0 - Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","1",TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION - Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_BLOB_LITERAL - Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_CAST - Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_COMPLETE - Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_COMPOUND_SELECT - Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_CONFLICT_CLAUSE - Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_DATETIME_FUNCS - Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_DISKIO - Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_EXPLAIN - Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_FLOATING_POINT - Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_FOREIGN_KEY - Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_GLOBALRECOVER - Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_INTEGRITY_CHECK - Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION - Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_MEMORYDB - Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_OR_OPTIMIZATION - Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_PAGER_PRAGMAS - Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_PARSER - Tcl_SetVar2(interp, "sqlite_options", "parser", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "parser", "1", TCL_GLOBAL_ONLY); -#endif - -#if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS) - Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY); - Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_PROGRESS_CALLBACK - Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_REINDEX - Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS - Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS - Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_SUBQUERY - Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_TCL_VARIABLE - Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY); -#endif - -#if defined(THREADSAFE) && THREADSAFE - Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "1", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "0", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_TRACE - Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_TRIGGER - Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_TEMPDB - Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_UTF16 - Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_VACUUM - Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY); -#endif - -#ifdef SQLITE_OMIT_VIEW - Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY); -#endif -} - -/* -** Register commands with the TCL interpreter. -*/ -int Sqlitetest1_Init(Tcl_Interp *interp){ - extern int sqlite3_search_count; - extern int sqlite3_interrupt_count; - extern int sqlite3_open_file_count; - extern int sqlite3_sort_count; - extern int sqlite3_current_time; - static struct { - char *zName; - Tcl_CmdProc *xProc; - } aCmd[] = { - { "sqlite3_mprintf_int", (Tcl_CmdProc*)sqlite3_mprintf_int }, - { "sqlite3_mprintf_int64", (Tcl_CmdProc*)sqlite3_mprintf_int64 }, - { "sqlite3_mprintf_str", (Tcl_CmdProc*)sqlite3_mprintf_str }, - { "sqlite3_mprintf_stronly", (Tcl_CmdProc*)sqlite3_mprintf_stronly}, - { "sqlite3_mprintf_double", (Tcl_CmdProc*)sqlite3_mprintf_double }, - { "sqlite3_mprintf_scaled", (Tcl_CmdProc*)sqlite3_mprintf_scaled }, - { "sqlite3_mprintf_hexdouble", (Tcl_CmdProc*)sqlite3_mprintf_hexdouble}, - { "sqlite3_mprintf_z_test", (Tcl_CmdProc*)test_mprintf_z }, - { "sqlite3_last_insert_rowid", (Tcl_CmdProc*)test_last_rowid }, - { "sqlite3_exec_printf", (Tcl_CmdProc*)test_exec_printf }, - { "sqlite3_get_table_printf", (Tcl_CmdProc*)test_get_table_printf }, - { "sqlite3_close", (Tcl_CmdProc*)sqlite_test_close }, - { "sqlite3_create_function", (Tcl_CmdProc*)test_create_function }, - { "sqlite3_create_aggregate", (Tcl_CmdProc*)test_create_aggregate }, - { "sqlite_register_test_function", (Tcl_CmdProc*)test_register_func }, - { "sqlite_abort", (Tcl_CmdProc*)sqlite_abort }, -#ifdef SQLITE_MEMDEBUG - { "sqlite_malloc_fail", (Tcl_CmdProc*)sqlite_malloc_fail }, - { "sqlite_malloc_stat", (Tcl_CmdProc*)sqlite_malloc_stat }, -#endif - { "sqlite_bind", (Tcl_CmdProc*)test_bind }, - { "breakpoint", (Tcl_CmdProc*)test_breakpoint }, - { "sqlite3_key", (Tcl_CmdProc*)test_key }, - { "sqlite3_rekey", (Tcl_CmdProc*)test_rekey }, - { "sqlite_set_magic", (Tcl_CmdProc*)sqlite_set_magic }, - { "sqlite3_interrupt", (Tcl_CmdProc*)test_interrupt }, -#if 0 - { "sqlite3_sleep", (Tcl_CmdProc*)test_sleep }, -#endif - { "sqlite_delete_function", (Tcl_CmdProc*)delete_function }, - { "sqlite_delete_collation", (Tcl_CmdProc*)delete_collation }, - { "sqlite3_get_autocommit", (Tcl_CmdProc*)get_autocommit }, - { "sqlite3_stack_used", (Tcl_CmdProc*)test_stack_used }, - }; - static struct { - char *zName; - Tcl_ObjCmdProc *xProc; - void *clientData; - } aObjCmd[] = { - { "sqlite3_bind_int", test_bind_int, 0 }, - { "sqlite3_bind_int64", test_bind_int64, 0 }, - { "sqlite3_bind_double", test_bind_double, 0 }, - { "sqlite3_bind_null", test_bind_null ,0 }, - { "sqlite3_bind_text", test_bind_text ,0 }, - { "sqlite3_bind_text16", test_bind_text16 ,0 }, - { "sqlite3_bind_blob", test_bind_blob ,0 }, - { "sqlite3_bind_parameter_count", test_bind_parameter_count, 0}, - { "sqlite3_bind_parameter_name", test_bind_parameter_name, 0}, - { "sqlite3_bind_parameter_index", test_bind_parameter_index, 0}, -#if 0 - { "sqlite3_clear_bindings", test_clear_bindings, 0}, -#endif - { "sqlite3_errcode", test_errcode ,0 }, - { "sqlite3_errmsg", test_errmsg ,0 }, - { "sqlite3_errmsg16", test_errmsg16 ,0 }, - { "sqlite3_open", test_open ,0 }, - { "sqlite3_open16", test_open16 ,0 }, - { "sqlite3_complete16", test_complete16 ,0 }, - - { "sqlite3_prepare", test_prepare ,0 }, - { "sqlite3_prepare16", test_prepare16 ,0 }, - { "sqlite3_finalize", test_finalize ,0 }, - { "sqlite3_reset", test_reset ,0 }, - { "sqlite3_expired", test_expired ,0 }, - { "sqlite3_transfer_bindings", test_transfer_bind ,0 }, - { "sqlite3_changes", test_changes ,0 }, - { "sqlite3_step", test_step ,0 }, - - /* sqlite3_column_*() API */ - { "sqlite3_column_count", test_column_count ,0 }, - { "sqlite3_data_count", test_data_count ,0 }, - { "sqlite3_column_type", test_column_type ,0 }, - { "sqlite3_column_blob", test_column_blob ,0 }, - { "sqlite3_column_double", test_column_double ,0 }, - { "sqlite3_column_int64", test_column_int64 ,0 }, - { "sqlite3_column_text", test_stmt_utf8, sqlite3_column_text }, - { "sqlite3_column_decltype", test_stmt_utf8, sqlite3_column_decltype }, - { "sqlite3_column_name", test_stmt_utf8, sqlite3_column_name }, - { "sqlite3_column_int", test_stmt_int, sqlite3_column_int }, - { "sqlite3_column_bytes", test_stmt_int, sqlite3_column_bytes }, -#ifndef SQLITE_OMIT_UTF16 - { "sqlite3_column_bytes16", test_stmt_int, sqlite3_column_bytes16 }, - { "sqlite3_column_text16", test_stmt_utf16, sqlite3_column_text16 }, - { "sqlite3_column_decltype16", test_stmt_utf16, sqlite3_column_decltype16}, - { "sqlite3_column_name16", test_stmt_utf16, sqlite3_column_name16 }, -#endif - { "sqlite3_global_recover", test_global_recover, 0 }, - - /* Functions from os.h */ -#ifndef SQLITE_OMIT_DISKIO - { "sqlite3OsOpenReadWrite",test_sqlite3OsOpenReadWrite, 0 }, - { "sqlite3OsClose", test_sqlite3OsClose, 0 }, - { "sqlite3OsLock", test_sqlite3OsLock, 0 }, - { "sqlite3OsTempFileName", test_sqlite3OsTempFileName, 0 }, - - /* Custom test interfaces */ - { "sqlite3OsUnlock", test_sqlite3OsUnlock, 0 }, -#endif -#ifndef SQLITE_OMIT_UTF16 - { "add_test_collate", test_collate, 0 }, - { "add_test_collate_needed", test_collate_needed, 0 }, - { "add_test_function", test_function, 0 }, -#endif - { "sqlite3_crashparams", sqlite3_crashparams, 0 }, - { "sqlite3_test_errstr", test_errstr, 0 }, - { "tcl_variable_type", tcl_variable_type, 0 }, - }; - static int bitmask_size = sizeof(Bitmask)*8; - int i; - extern int sqlite3_os_trace; - extern int sqlite3_where_trace; - extern int sqlite3_sync_count, sqlite3_fullsync_count; - extern int sqlite3_opentemp_count; - extern int sqlite3_memUsed; - extern int sqlite3_memMax; - extern int sqlite3_like_count; -#if OS_WIN - extern int sqlite3_os_type; -#endif -#ifdef SQLITE_DEBUG - extern int sqlite3_vdbe_addop_trace; -#endif -#ifdef SQLITE_TEST - extern char sqlite3_query_plan[]; - static char *query_plan = sqlite3_query_plan; -#endif - - for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){ - Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); - } - for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){ - Tcl_CreateObjCommand(interp, aObjCmd[i].zName, - aObjCmd[i].xProc, aObjCmd[i].clientData, 0); - } - Tcl_LinkVar(interp, "sqlite_search_count", - (char*)&sqlite3_search_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_sort_count", - (char*)&sqlite3_sort_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_like_count", - (char*)&sqlite3_like_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_interrupt_count", - (char*)&sqlite3_interrupt_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_open_file_count", - (char*)&sqlite3_open_file_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_current_time", - (char*)&sqlite3_current_time, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_os_trace", - (char*)&sqlite3_os_trace, TCL_LINK_INT); -#if OS_WIN - Tcl_LinkVar(interp, "sqlite_os_type", - (char*)&sqlite3_os_type, TCL_LINK_INT); -#endif -#ifdef SQLITE_TEST - Tcl_LinkVar(interp, "sqlite_query_plan", - (char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY); -#endif -#ifdef SQLITE_DEBUG - Tcl_LinkVar(interp, "sqlite_addop_trace", - (char*)&sqlite3_vdbe_addop_trace, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_where_trace", - (char*)&sqlite3_where_trace, TCL_LINK_INT); -#endif -#ifdef SQLITE_MEMDEBUG - Tcl_LinkVar(interp, "sqlite_memused", - (char*)&sqlite3_memUsed, TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "sqlite_memmax", - (char*)&sqlite3_memMax, TCL_LINK_INT | TCL_LINK_READ_ONLY); -#endif -#ifndef SQLITE_OMIT_DISKIO - Tcl_LinkVar(interp, "sqlite_opentemp_count", - (char*)&sqlite3_opentemp_count, TCL_LINK_INT); -#endif - Tcl_LinkVar(interp, "sqlite_static_bind_value", - (char*)&sqlite_static_bind_value, TCL_LINK_STRING); - Tcl_LinkVar(interp, "sqlite_temp_directory", - (char*)&sqlite3_temp_directory, TCL_LINK_STRING); - Tcl_LinkVar(interp, "bitmask_size", - (char*)&bitmask_size, TCL_LINK_INT|TCL_LINK_READ_ONLY); -#if OS_UNIX - Tcl_LinkVar(interp, "sqlite_sync_count", - (char*)&sqlite3_sync_count, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_fullsync_count", - (char*)&sqlite3_fullsync_count, TCL_LINK_INT); -#endif /* OS_UNIX */ - set_options(interp); - return TCL_OK; -} diff --git a/ext/pdo_sqlite/sqlite/src/test2.c b/ext/pdo_sqlite/sqlite/src/test2.c deleted file mode 100644 index d4c5544b63703..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/test2.c +++ /dev/null @@ -1,604 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Code for testing the pager.c module in SQLite. This code -** is not included in the SQLite library. It is used for automated -** testing of the SQLite library. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include "pager.h" -#include "tcl.h" -#include <stdlib.h> -#include <string.h> - -/* -** Interpret an SQLite error number -*/ -static char *errorName(int rc){ - char *zName; - switch( rc ){ - case SQLITE_OK: zName = "SQLITE_OK"; break; - case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; - case SQLITE_PERM: zName = "SQLITE_PERM"; break; - case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; - case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; - case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; - case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; - case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; - case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; - case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; - case SQLITE_FULL: zName = "SQLITE_FULL"; break; - case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; - case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; - case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; - case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break; - case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; - case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; - case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break; - case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break; - default: zName = "SQLITE_Unknown"; break; - } - return zName; -} - -/* -** Page size and reserved size used for testing. -*/ -static int test_pagesize = 1024; - -/* -** Usage: pager_open FILENAME N-PAGE -** -** Open a new pager -*/ -static int pager_open( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int nPage; - int rc; - char zBuf[100]; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME N-PAGE\"", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[2], &nPage) ) return TCL_ERROR; - rc = sqlite3pager_open(&pPager, argv[1], 0, 0); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3pager_set_cachesize(pPager, nPage); - sqlite3pager_set_pagesize(pPager, test_pagesize); - sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPager); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: pager_close ID -** -** Close the given pager. -*/ -static int pager_close( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_close(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_rollback ID -** -** Rollback changes -*/ -static int pager_rollback( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_rollback(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_commit ID -** -** Commit all changes -*/ -static int pager_commit( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_commit(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_stmt_begin ID -** -** Start a new checkpoint. -*/ -static int pager_stmt_begin( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_stmt_begin(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_stmt_rollback ID -** -** Rollback changes to a checkpoint -*/ -static int pager_stmt_rollback( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_stmt_rollback(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_stmt_commit ID -** -** Commit changes to a checkpoint -*/ -static int pager_stmt_commit( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_stmt_commit(pPager); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: pager_stats ID -** -** Return pager statistics. -*/ -static int pager_stats( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int i, *a; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - a = sqlite3pager_stats(pPager); - for(i=0; i<9; i++){ - static char *zName[] = { - "ref", "page", "max", "size", "state", "err", - "hit", "miss", "ovfl", - }; - char zBuf[100]; - Tcl_AppendElement(interp, zName[i]); - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",a[i]); - Tcl_AppendElement(interp, zBuf); - } - return TCL_OK; -} - -/* -** Usage: pager_pagecount ID -** -** Return the size of the database file. -*/ -static int pager_pagecount( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - char zBuf[100]; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",sqlite3pager_pagecount(pPager)); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: page_get ID PGNO -** -** Return a pointer to a page from the database. -*/ -static int page_get( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - char zBuf[100]; - void *pPage; - int pgno; - int rc; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR; - rc = sqlite3pager_get(pPager, pgno, &pPage); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: page_lookup ID PGNO -** -** Return a pointer to a page if the page is already in cache. -** If not in cache, return an empty string. -*/ -static int page_lookup( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - char zBuf[100]; - void *pPage; - int pgno; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR; - pPage = sqlite3pager_lookup(pPager, pgno); - if( pPage ){ - sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage); - Tcl_AppendResult(interp, zBuf, 0); - } - return TCL_OK; -} - -/* -** Usage: pager_truncate ID PGNO -*/ -static int pager_truncate( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Pager *pPager; - int rc; - int pgno; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); - return TCL_ERROR; - } - pPager = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR; - rc = sqlite3pager_truncate(pPager, pgno); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - - -/* -** Usage: page_unref PAGE -** -** Drop a pointer to a page. -*/ -static int page_unref( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - void *pPage; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); - return TCL_ERROR; - } - pPage = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_unref(pPage); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: page_read PAGE -** -** Return the content of a page -*/ -static int page_read( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - char zBuf[100]; - void *pPage; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); - return TCL_ERROR; - } - pPage = sqlite3TextToPtr(argv[1]); - memcpy(zBuf, pPage, sizeof(zBuf)); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: page_number PAGE -** -** Return the page number for a page. -*/ -static int page_number( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - char zBuf[100]; - void *pPage; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); - return TCL_ERROR; - } - pPage = sqlite3TextToPtr(argv[1]); - sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3pager_pagenumber(pPage)); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: page_write PAGE DATA -** -** Write something into a page. -*/ -static int page_write( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - void *pPage; - int rc; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE DATA\"", 0); - return TCL_ERROR; - } - pPage = sqlite3TextToPtr(argv[1]); - rc = sqlite3pager_write(pPage); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - strncpy((char*)pPage, argv[2], test_pagesize-1); - ((char*)pPage)[test_pagesize-1] = 0; - return TCL_OK; -} - -#ifndef SQLITE_OMIT_DISKIO -/* -** Usage: fake_big_file N FILENAME -** -** Write a few bytes at the N megabyte point of FILENAME. This will -** create a large file. If the file was a valid SQLite database, then -** the next time the database is opened, SQLite will begin allocating -** new pages after N. If N is 2096 or bigger, this will test the -** ability of SQLite to write to large files. -*/ -static int fake_big_file( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int rc; - int n; - i64 offset; - OsFile fd; - int readOnly = 0; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " N-MEGABYTES FILE\"", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR; - memset(&fd, 0, sizeof(fd)); - rc = sqlite3OsOpenReadWrite(argv[2], &fd, &readOnly); - if( rc ){ - Tcl_AppendResult(interp, "open failed: ", errorName(rc), 0); - return TCL_ERROR; - } - offset = n; - offset *= 1024*1024; - rc = sqlite3OsSeek(&fd, offset); - if( rc ){ - Tcl_AppendResult(interp, "seek failed: ", errorName(rc), 0); - return TCL_ERROR; - } - rc = sqlite3OsWrite(&fd, "Hello, World!", 14); - sqlite3OsClose(&fd); - if( rc ){ - Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} -#endif - -/* -** Register commands with the TCL interpreter. -*/ -int Sqlitetest2_Init(Tcl_Interp *interp){ - extern int sqlite3_io_error_pending; - extern int sqlite3_diskfull_pending; - extern int sqlite3_diskfull; - static struct { - char *zName; - Tcl_CmdProc *xProc; - } aCmd[] = { - { "pager_open", (Tcl_CmdProc*)pager_open }, - { "pager_close", (Tcl_CmdProc*)pager_close }, - { "pager_commit", (Tcl_CmdProc*)pager_commit }, - { "pager_rollback", (Tcl_CmdProc*)pager_rollback }, - { "pager_stmt_begin", (Tcl_CmdProc*)pager_stmt_begin }, - { "pager_stmt_commit", (Tcl_CmdProc*)pager_stmt_commit }, - { "pager_stmt_rollback", (Tcl_CmdProc*)pager_stmt_rollback }, - { "pager_stats", (Tcl_CmdProc*)pager_stats }, - { "pager_pagecount", (Tcl_CmdProc*)pager_pagecount }, - { "page_get", (Tcl_CmdProc*)page_get }, - { "page_lookup", (Tcl_CmdProc*)page_lookup }, - { "page_unref", (Tcl_CmdProc*)page_unref }, - { "page_read", (Tcl_CmdProc*)page_read }, - { "page_write", (Tcl_CmdProc*)page_write }, - { "page_number", (Tcl_CmdProc*)page_number }, - { "pager_truncate", (Tcl_CmdProc*)pager_truncate }, -#ifndef SQLITE_OMIT_DISKIO - { "fake_big_file", (Tcl_CmdProc*)fake_big_file }, -#endif - }; - int i; - for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){ - Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); - } - Tcl_LinkVar(interp, "sqlite_io_error_pending", - (char*)&sqlite3_io_error_pending, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_diskfull_pending", - (char*)&sqlite3_diskfull_pending, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_diskfull", - (char*)&sqlite3_diskfull, TCL_LINK_INT); - Tcl_LinkVar(interp, "sqlite_pending_byte", - (char*)&sqlite3_pending_byte, TCL_LINK_INT); - Tcl_LinkVar(interp, "pager_pagesize", - (char*)&test_pagesize, TCL_LINK_INT); - return TCL_OK; -} diff --git a/ext/pdo_sqlite/sqlite/src/test3.c b/ext/pdo_sqlite/sqlite/src/test3.c deleted file mode 100644 index 6b973a14783b8..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/test3.c +++ /dev/null @@ -1,1458 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Code for testing the btree.c module in SQLite. This code -** is not included in the SQLite library. It is used for automated -** testing of the SQLite library. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "pager.h" -#include "btree.h" -#include "tcl.h" -#include <stdlib.h> -#include <string.h> - -/* -** Interpret an SQLite error number -*/ -static char *errorName(int rc){ - char *zName; - switch( rc ){ - case SQLITE_OK: zName = "SQLITE_OK"; break; - case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; - case SQLITE_PERM: zName = "SQLITE_PERM"; break; - case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; - case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; - case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; - case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; - case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; - case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; - case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; - case SQLITE_FULL: zName = "SQLITE_FULL"; break; - case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; - case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; - case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; - case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break; - default: zName = "SQLITE_Unknown"; break; - } - return zName; -} - -/* -** Usage: btree_open FILENAME NCACHE FLAGS -** -** Open a new database -*/ -static int btree_open( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc, nCache, flags; - char zBuf[100]; - if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME NCACHE FLAGS\"", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR; - if( Tcl_GetInt(interp, argv[3], &flags) ) return TCL_ERROR; - rc = sqlite3BtreeOpen(argv[1], &pBt, flags); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3BtreeSetCacheSize(pBt, nCache); - sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pBt); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: btree_close ID -** -** Close the given database. -*/ -static int btree_close( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeClose(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_begin_transaction ID -** -** Start a new transaction -*/ -static int btree_begin_transaction( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeBeginTrans(pBt, 1); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_rollback ID -** -** Rollback changes -*/ -static int btree_rollback( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeRollback(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_commit ID -** -** Commit all changes -*/ -static int btree_commit( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeCommit(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_begin_statement ID -** -** Start a new statement transaction -*/ -static int btree_begin_statement( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeBeginStmt(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_rollback_statement ID -** -** Rollback changes -*/ -static int btree_rollback_statement( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeRollbackStmt(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_commit_statement ID -** -** Commit all changes -*/ -static int btree_commit_statement( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeCommitStmt(pBt); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_create_table ID FLAGS -** -** Create a new table in the database -*/ -static int btree_create_table( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc, iTable, flags; - char zBuf[30]; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID FLAGS\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &flags) ) return TCL_ERROR; - rc = sqlite3BtreeCreateTable(pBt, &iTable, flags); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", iTable); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: btree_drop_table ID TABLENUM -** -** Delete an entire table from the database -*/ -static int btree_drop_table( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int iTable; - int rc; - int notUsed1; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID TABLENUM\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; - rc = sqlite3BtreeDropTable(pBt, iTable, ¬Used1); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_clear_table ID TABLENUM -** -** Remove all entries from the given table but keep the table around. -*/ -static int btree_clear_table( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int iTable; - int rc; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID TABLENUM\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; - rc = sqlite3BtreeClearTable(pBt, iTable); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_get_meta ID -** -** Return meta data -*/ -static int btree_get_meta( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - int i; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - for(i=0; i<SQLITE_N_BTREE_META; i++){ - char zBuf[30]; - unsigned int v; - rc = sqlite3BtreeGetMeta(pBt, i, &v); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",v); - Tcl_AppendElement(interp, zBuf); - } - return TCL_OK; -} - -/* -** Usage: btree_update_meta ID METADATA... -** -** Return meta data -*/ -static int btree_update_meta( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int rc; - int i; - int aMeta[SQLITE_N_BTREE_META]; - - if( argc!=2+SQLITE_N_BTREE_META ){ - char zBuf[30]; - sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",SQLITE_N_BTREE_META); - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - for(i=1; i<SQLITE_N_BTREE_META; i++){ - if( Tcl_GetInt(interp, argv[i+2], &aMeta[i]) ) return TCL_ERROR; - } - for(i=1; i<SQLITE_N_BTREE_META; i++){ - rc = sqlite3BtreeUpdateMeta(pBt, i, aMeta[i]); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - } - return TCL_OK; -} - -/* -** Usage: btree_page_dump ID PAGENUM -** -** Print a disassembly of a page on standard output -*/ -static int btree_page_dump( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int iPage; - int rc; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR; - rc = sqlite3BtreePageDump(pBt, iPage, 0); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_tree_dump ID PAGENUM -** -** Print a disassembly of a page and all its child pages on standard output -*/ -static int btree_tree_dump( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int iPage; - int rc; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR; - rc = sqlite3BtreePageDump(pBt, iPage, 1); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** Usage: btree_pager_stats ID -** -** Returns pager statistics -*/ -static int btree_pager_stats( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int i; - int *a; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - a = sqlite3pager_stats(sqlite3BtreePager(pBt)); - for(i=0; i<11; i++){ - static char *zName[] = { - "ref", "page", "max", "size", "state", "err", - "hit", "miss", "ovfl", "read", "write" - }; - char zBuf[100]; - Tcl_AppendElement(interp, zName[i]); - sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",a[i]); - Tcl_AppendElement(interp, zBuf); - } - return TCL_OK; -} - -/* -** Usage: btree_pager_ref_dump ID -** -** Print out all outstanding pages. -*/ -static int btree_pager_ref_dump( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); -#ifdef SQLITE_DEBUG - sqlite3pager_refdump(sqlite3BtreePager(pBt)); -#endif - return TCL_OK; -} - -/* -** Usage: btree_integrity_check ID ROOT ... -** -** Look through every page of the given BTree file to verify correct -** formatting and linkage. Return a line of text for each problem found. -** Return an empty string if everything worked. -*/ -static int btree_integrity_check( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int nRoot; - int *aRoot; - int i; - char *zResult; - - if( argc<3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID ROOT ...\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - nRoot = argc-2; - aRoot = malloc( sizeof(int)*(argc-2) ); - for(i=0; i<argc-2; i++){ - if( Tcl_GetInt(interp, argv[i+2], &aRoot[i]) ) return TCL_ERROR; - } -#ifndef SQLITE_OMIT_INTEGRITY_CHECK - zResult = sqlite3BtreeIntegrityCheck(pBt, aRoot, nRoot); -#else - zResult = 0; -#endif - if( zResult ){ - Tcl_AppendResult(interp, zResult, 0); - sqliteFree(zResult); - } - return TCL_OK; -} - -/* -** Usage: btree_cursor_list ID -** -** Print information about all cursors to standard output for debugging. -*/ -static int btree_cursor_list( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - sqlite3BtreeCursorList(pBt); - return SQLITE_OK; -} - -/* -** Usage: btree_cursor ID TABLENUM WRITEABLE -** -** Create a new cursor. Return the ID for the cursor. -*/ -static int btree_cursor( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - Btree *pBt; - int iTable; - BtCursor *pCur; - int rc; - int wrFlag; - char zBuf[30]; - - if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID TABLENUM WRITEABLE\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; - if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR; - rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, 0, &pCur); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pCur); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_close_cursor ID -** -** Close a cursor opened using btree_cursor. -*/ -static int btree_close_cursor( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeCloseCursor(pCur); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return SQLITE_OK; -} - -/* -** Usage: btree_move_to ID KEY -** -** Move the cursor to the entry with the given key. -*/ -static int btree_move_to( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int res; - char zBuf[20]; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID KEY\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){ - int iKey; - if( Tcl_GetInt(interp, argv[2], &iKey) ) return TCL_ERROR; - rc = sqlite3BtreeMoveto(pCur, 0, iKey, &res); - }else{ - rc = sqlite3BtreeMoveto(pCur, argv[2], strlen(argv[2]), &res); - } - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - if( res<0 ) res = -1; - if( res>0 ) res = 1; - sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_delete ID -** -** Delete the entry that the cursor is pointing to -*/ -static int btree_delete( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeDelete(pCur); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return SQLITE_OK; -} - -/* -** Usage: btree_insert ID KEY DATA -** -** Create a new entry with the given key and data. If an entry already -** exists with the same key the old entry is overwritten. -*/ -static int btree_insert( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - BtCursor *pCur; - int rc; - - if( objc!=4 ){ - Tcl_WrongNumArgs(interp, 1, objv, "ID KEY DATA"); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(Tcl_GetString(objv[1])); - if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){ - i64 iKey; - int len; - unsigned char *pBuf; - if( Tcl_GetWideIntFromObj(interp, objv[2], &iKey) ) return TCL_ERROR; - pBuf = Tcl_GetByteArrayFromObj(objv[3], &len); - rc = sqlite3BtreeInsert(pCur, 0, iKey, pBuf, len); - }else{ - int keylen; - int dlen; - unsigned char *pKBuf; - unsigned char *pDBuf; - pKBuf = Tcl_GetByteArrayFromObj(objv[2], &keylen); - pDBuf = Tcl_GetByteArrayFromObj(objv[3], &dlen); - rc = sqlite3BtreeInsert(pCur, pKBuf, keylen, pDBuf, dlen); - } - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - return SQLITE_OK; -} - -/* -** Usage: btree_next ID -** -** Move the cursor to the next entry in the table. Return 0 on success -** or 1 if the cursor was already on the last entry in the table or if -** the table is empty. -*/ -static int btree_next( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int res = 0; - char zBuf[100]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeNext(pCur, &res); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_prev ID -** -** Move the cursor to the previous entry in the table. Return 0 on -** success and 1 if the cursor was already on the first entry in -** the table or if the table was empty. -*/ -static int btree_prev( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int res = 0; - char zBuf[100]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreePrevious(pCur, &res); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_first ID -** -** Move the cursor to the first entry in the table. Return 0 if the -** cursor was left point to something and 1 if the table is empty. -*/ -static int btree_first( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int res = 0; - char zBuf[100]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeFirst(pCur, &res); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_last ID -** -** Move the cursor to the last entry in the table. Return 0 if the -** cursor was left point to something and 1 if the table is empty. -*/ -static int btree_last( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int res = 0; - char zBuf[100]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - rc = sqlite3BtreeLast(pCur, &res); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_eof ID -** -** Return TRUE if the given cursor is not pointing at a valid entry. -** Return FALSE if the cursor does point to a valid entry. -*/ -static int btree_eof( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - char zBuf[50]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", sqlite3BtreeEof(pCur)); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_keysize ID -** -** Return the number of bytes of key. For an INTKEY table, this -** returns the key itself. -*/ -static int btree_keysize( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - u64 n; - char zBuf[50]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - sqlite3BtreeKeySize(pCur, &n); - sqlite3_snprintf(sizeof(zBuf),zBuf, "%llu", n); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_key ID -** -** Return the key for the entry at which the cursor is pointing. -*/ -static int btree_key( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - u64 n; - char *zBuf; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - sqlite3BtreeKeySize(pCur, &n); - if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){ - char zBuf2[60]; - sqlite3_snprintf(sizeof(zBuf2),zBuf2, "%llu", n); - Tcl_AppendResult(interp, zBuf2, 0); - }else{ - zBuf = malloc( n+1 ); - rc = sqlite3BtreeKey(pCur, 0, n, zBuf); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - zBuf[n] = 0; - Tcl_AppendResult(interp, zBuf, 0); - free(zBuf); - } - return SQLITE_OK; -} - -/* -** Usage: btree_data ID ?N? -** -** Return the data for the entry at which the cursor is pointing. -*/ -static int btree_data( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - u32 n; - char *zBuf; - - if( argc!=2 && argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( argc==2 ){ - sqlite3BtreeDataSize(pCur, &n); - }else{ - n = atoi(argv[2]); - } - zBuf = malloc( n+1 ); - rc = sqlite3BtreeData(pCur, 0, n, zBuf); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - zBuf[n] = 0; - Tcl_AppendResult(interp, zBuf, 0); - free(zBuf); - return SQLITE_OK; -} - -/* -** Usage: btree_fetch_key ID AMT -** -** Use the sqlite3BtreeKeyFetch() routine to get AMT bytes of the key. -** If sqlite3BtreeKeyFetch() fails, return an empty string. -*/ -static int btree_fetch_key( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int n; - int amt; - u64 nKey; - const char *zBuf; - char zStatic[1000]; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID AMT\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; - sqlite3BtreeKeySize(pCur, &nKey); - zBuf = sqlite3BtreeKeyFetch(pCur, &amt); - if( zBuf && amt>=n ){ - assert( nKey<sizeof(zStatic) ); - if( n>0 ) nKey = n; - memcpy(zStatic, zBuf, (int)nKey); - zStatic[nKey] = 0; - Tcl_AppendResult(interp, zStatic, 0); - } - return TCL_OK; -} - -/* -** Usage: btree_fetch_data ID AMT -** -** Use the sqlite3BtreeDataFetch() routine to get AMT bytes of the key. -** If sqlite3BtreeDataFetch() fails, return an empty string. -*/ -static int btree_fetch_data( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int n; - int amt; - u32 nData; - const char *zBuf; - char zStatic[1000]; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID AMT\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; - sqlite3BtreeDataSize(pCur, &nData); - zBuf = sqlite3BtreeDataFetch(pCur, &amt); - if( zBuf && amt>=n ){ - assert( nData<sizeof(zStatic) ); - if( n>0 ) nData = n; - memcpy(zStatic, zBuf, (int)nData); - zStatic[nData] = 0; - Tcl_AppendResult(interp, zStatic, 0); - } - return TCL_OK; -} - -/* -** Usage: btree_payload_size ID -** -** Return the number of bytes of payload -*/ -static int btree_payload_size( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int n2; - u64 n1; - char zBuf[50]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){ - n1 = 0; - }else{ - sqlite3BtreeKeySize(pCur, &n1); - } - sqlite3BtreeDataSize(pCur, &n2); - sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", (int)(n1+n2)); - Tcl_AppendResult(interp, zBuf, 0); - return SQLITE_OK; -} - -/* -** Usage: btree_cursor_info ID ?UP-CNT? -** -** Return integers containing information about the entry the -** cursor is pointing to: -** -** aResult[0] = The page number -** aResult[1] = The entry number -** aResult[2] = Total number of entries on this page -** aResult[3] = Cell size (local payload + header) -** aResult[4] = Number of free bytes on this page -** aResult[5] = Number of free blocks on the page -** aResult[6] = Total payload size (local + overflow) -** aResult[7] = Header size in bytes -** aResult[8] = Local payload size -** aResult[9] = Parent page number -*/ -static int btree_cursor_info( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - BtCursor *pCur; - int rc; - int i, j; - int up; - int aResult[10]; - char zBuf[400]; - - if( argc!=2 && argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID ?UP-CNT?\"", 0); - return TCL_ERROR; - } - pCur = sqlite3TextToPtr(argv[1]); - if( argc==3 ){ - if( Tcl_GetInt(interp, argv[2], &up) ) return TCL_ERROR; - }else{ - up = 0; - } - rc = sqlite3BtreeCursorInfo(pCur, aResult, up); - if( rc ){ - Tcl_AppendResult(interp, errorName(rc), 0); - return TCL_ERROR; - } - j = 0; - for(i=0; i<sizeof(aResult)/sizeof(aResult[0]); i++){ - sqlite3_snprintf(40,&zBuf[j]," %d", aResult[i]); - j += strlen(&zBuf[j]); - } - Tcl_AppendResult(interp, &zBuf[1], 0); - return SQLITE_OK; -} - -/* -** The command is provided for the purpose of setting breakpoints. -** in regression test scripts. -** -** By setting a GDB breakpoint on this procedure and executing the -** btree_breakpoint command in a test script, we can stop GDB at -** the point in the script where the btree_breakpoint command is -** inserted. This is useful for debugging. -*/ -static int btree_breakpoint( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - return TCL_OK; -} - -/* -** usage: varint_test START MULTIPLIER COUNT INCREMENT -** -** This command tests the sqlite3PutVarint() and sqlite3GetVarint() -** routines, both for accuracy and for speed. -** -** An integer is written using PutVarint() and read back with -** GetVarint() and varified to be unchanged. This repeats COUNT -** times. The first integer is START*MULTIPLIER. Each iteration -** increases the integer by INCREMENT. -** -** This command returns nothing if it works. It returns an error message -** if something goes wrong. -*/ -static int btree_varint_test( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - u32 start, mult, count, incr; - u64 in, out; - int n1, n2, i, j; - unsigned char zBuf[100]; - if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " START MULTIPLIER COUNT INCREMENT\"", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[1], (int*)&start) ) return TCL_ERROR; - if( Tcl_GetInt(interp, argv[2], (int*)&mult) ) return TCL_ERROR; - if( Tcl_GetInt(interp, argv[3], (int*)&count) ) return TCL_ERROR; - if( Tcl_GetInt(interp, argv[4], (int*)&incr) ) return TCL_ERROR; - in = start; - in *= mult; - for(i=0; i<count; i++){ - char zErr[200]; - n1 = sqlite3PutVarint(zBuf, in); - if( n1>9 || n1<1 ){ - sprintf(zErr, "PutVarint returned %d - should be between 1 and 9", n1); - Tcl_AppendResult(interp, zErr, 0); - return TCL_ERROR; - } - n2 = sqlite3GetVarint(zBuf, &out); - if( n1!=n2 ){ - sprintf(zErr, "PutVarint returned %d and GetVarint returned %d", n1, n2); - Tcl_AppendResult(interp, zErr, 0); - return TCL_ERROR; - } - if( in!=out ){ - sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx", in, out); - Tcl_AppendResult(interp, zErr, 0); - return TCL_ERROR; - } - if( (in & 0xffffffff)==in ){ - u32 out32; - n2 = sqlite3GetVarint32(zBuf, &out32); - out = out32; - if( n1!=n2 ){ - sprintf(zErr, "PutVarint returned %d and GetVarint32 returned %d", - n1, n2); - Tcl_AppendResult(interp, zErr, 0); - return TCL_ERROR; - } - if( in!=out ){ - sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx from GetVarint32", - in, out); - Tcl_AppendResult(interp, zErr, 0); - return TCL_ERROR; - } - } - - /* In order to get realistic timings, run getVarint 19 more times. - ** This is because getVarint is called about 20 times more often - ** than putVarint. - */ - for(j=0; j<19; j++){ - sqlite3GetVarint(zBuf, &out); - } - in += incr; - } - return TCL_OK; -} - -/* -** usage: btree_from_db DB-HANDLE -** -** This command returns the btree handle for the main database associated -** with the database-handle passed as the argument. Example usage: -** -** sqlite3 db test.db -** set bt [btree_from_db db] -*/ -static int btree_from_db( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - char zBuf[100]; - Tcl_CmdInfo info; - sqlite3 *db; - Btree *pBt; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB-HANDLE\"", 0); - return TCL_ERROR; - } - - if( 1!=Tcl_GetCommandInfo(interp, argv[1], &info) ){ - Tcl_AppendResult(interp, "No such db-handle: \"", argv[1], "\"", 0); - return TCL_ERROR; - } - db = *((sqlite3 **)info.objClientData); - assert( db ); - - pBt = db->aDb[0].pBt; - sqlite3_snprintf(sizeof(zBuf), zBuf, "%p", pBt); - Tcl_SetResult(interp, zBuf, TCL_VOLATILE); - return TCL_OK; -} - - -/* -** usage: btree_set_cache_size ID NCACHE -** -** Set the size of the cache used by btree $ID. -*/ -static int btree_set_cache_size( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int nCache; - Btree *pBt; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " BT NCACHE\"", 0); - return TCL_ERROR; - } - pBt = sqlite3TextToPtr(argv[1]); - if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR; - sqlite3BtreeSetCacheSize(pBt, nCache); - return TCL_OK; -} - - -/* -** Register commands with the TCL interpreter. -*/ -int Sqlitetest3_Init(Tcl_Interp *interp){ - extern int sqlite3_btree_trace; - static struct { - char *zName; - Tcl_CmdProc *xProc; - } aCmd[] = { - { "btree_open", (Tcl_CmdProc*)btree_open }, - { "btree_close", (Tcl_CmdProc*)btree_close }, - { "btree_begin_transaction", (Tcl_CmdProc*)btree_begin_transaction }, - { "btree_commit", (Tcl_CmdProc*)btree_commit }, - { "btree_rollback", (Tcl_CmdProc*)btree_rollback }, - { "btree_create_table", (Tcl_CmdProc*)btree_create_table }, - { "btree_drop_table", (Tcl_CmdProc*)btree_drop_table }, - { "btree_clear_table", (Tcl_CmdProc*)btree_clear_table }, - { "btree_get_meta", (Tcl_CmdProc*)btree_get_meta }, - { "btree_update_meta", (Tcl_CmdProc*)btree_update_meta }, - { "btree_page_dump", (Tcl_CmdProc*)btree_page_dump }, - { "btree_tree_dump", (Tcl_CmdProc*)btree_tree_dump }, - { "btree_pager_stats", (Tcl_CmdProc*)btree_pager_stats }, - { "btree_pager_ref_dump", (Tcl_CmdProc*)btree_pager_ref_dump }, - { "btree_cursor", (Tcl_CmdProc*)btree_cursor }, - { "btree_close_cursor", (Tcl_CmdProc*)btree_close_cursor }, - { "btree_move_to", (Tcl_CmdProc*)btree_move_to }, - { "btree_delete", (Tcl_CmdProc*)btree_delete }, - { "btree_next", (Tcl_CmdProc*)btree_next }, - { "btree_prev", (Tcl_CmdProc*)btree_prev }, - { "btree_eof", (Tcl_CmdProc*)btree_eof }, - { "btree_keysize", (Tcl_CmdProc*)btree_keysize }, - { "btree_key", (Tcl_CmdProc*)btree_key }, - { "btree_data", (Tcl_CmdProc*)btree_data }, - { "btree_fetch_key", (Tcl_CmdProc*)btree_fetch_key }, - { "btree_fetch_data", (Tcl_CmdProc*)btree_fetch_data }, - { "btree_payload_size", (Tcl_CmdProc*)btree_payload_size }, - { "btree_first", (Tcl_CmdProc*)btree_first }, - { "btree_last", (Tcl_CmdProc*)btree_last }, - { "btree_cursor_info", (Tcl_CmdProc*)btree_cursor_info }, - { "btree_cursor_list", (Tcl_CmdProc*)btree_cursor_list }, - { "btree_integrity_check", (Tcl_CmdProc*)btree_integrity_check }, - { "btree_breakpoint", (Tcl_CmdProc*)btree_breakpoint }, - { "btree_varint_test", (Tcl_CmdProc*)btree_varint_test }, - { "btree_begin_statement", (Tcl_CmdProc*)btree_begin_statement }, - { "btree_commit_statement", (Tcl_CmdProc*)btree_commit_statement }, - { "btree_rollback_statement", (Tcl_CmdProc*)btree_rollback_statement }, - { "btree_from_db", (Tcl_CmdProc*)btree_from_db }, - { "btree_set_cache_size", (Tcl_CmdProc*)btree_set_cache_size }, - }; - int i; - - for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){ - Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); - } - Tcl_LinkVar(interp, "pager_refinfo_enable", (char*)&pager3_refinfo_enable, - TCL_LINK_INT); - Tcl_LinkVar(interp, "btree_trace", (char*)&sqlite3_btree_trace, - TCL_LINK_INT); - - /* The btree_insert command is implemented using the tcl 'object' - ** interface, not the string interface like the other commands in this - ** file. This is so binary data can be inserted into btree tables. - */ - Tcl_CreateObjCommand(interp, "btree_insert", btree_insert, 0, 0); - return TCL_OK; -} diff --git a/ext/pdo_sqlite/sqlite/src/test4.c b/ext/pdo_sqlite/sqlite/src/test4.c deleted file mode 100644 index 45991ba3a3fc9..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/test4.c +++ /dev/null @@ -1,647 +0,0 @@ -/* -** 2003 December 18 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Code for testing the the SQLite library in a multithreaded environment. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "tcl.h" -#include "os.h" -#if defined(OS_UNIX) && OS_UNIX==1 && defined(THREADSAFE) && THREADSAFE==1 -#include <stdlib.h> -#include <string.h> -#include <pthread.h> -#include <sched.h> -#include <ctype.h> - -/* -** Each thread is controlled by an instance of the following -** structure. -*/ -typedef struct Thread Thread; -struct Thread { - /* The first group of fields are writable by the master and read-only - ** to the thread. */ - char *zFilename; /* Name of database file */ - void (*xOp)(Thread*); /* next operation to do */ - char *zArg; /* argument usable by xOp */ - int opnum; /* Operation number */ - int busy; /* True if this thread is in use */ - - /* The next group of fields are writable by the thread but read-only to the - ** master. */ - int completed; /* Number of operations completed */ - sqlite3 *db; /* Open database */ - sqlite3_stmt *pStmt; /* Pending operation */ - char *zErr; /* operation error */ - char *zStaticErr; /* Static error message */ - int rc; /* operation return code */ - int argc; /* number of columns in result */ - const char *argv[100]; /* result columns */ - const char *colv[100]; /* result column names */ -}; - -/* -** There can be as many as 26 threads running at once. Each is named -** by a capital letter: A, B, C, ..., Y, Z. -*/ -#define N_THREAD 26 -static Thread threadset[N_THREAD]; - - -/* -** The main loop for a thread. Threads use busy waiting. -*/ -static void *thread_main(void *pArg){ - Thread *p = (Thread*)pArg; - if( p->db ){ - sqlite3_close(p->db); - } - sqlite3_open(p->zFilename, &p->db); - if( SQLITE_OK!=sqlite3_errcode(p->db) ){ - p->zErr = strdup(sqlite3_errmsg(p->db)); - sqlite3_close(p->db); - p->db = 0; - } - p->pStmt = 0; - p->completed = 1; - while( p->opnum<=p->completed ) sched_yield(); - while( p->xOp ){ - if( p->zErr && p->zErr!=p->zStaticErr ){ - sqlite3_free(p->zErr); - p->zErr = 0; - } - (*p->xOp)(p); - p->completed++; - while( p->opnum<=p->completed ) sched_yield(); - } - if( p->pStmt ){ - sqlite3_finalize(p->pStmt); - p->pStmt = 0; - } - if( p->db ){ - sqlite3_close(p->db); - p->db = 0; - } - if( p->zErr && p->zErr!=p->zStaticErr ){ - sqlite3_free(p->zErr); - p->zErr = 0; - } - p->completed++; - return 0; -} - -/* -** Get a thread ID which is an upper case letter. Return the index. -** If the argument is not a valid thread ID put an error message in -** the interpreter and return -1. -*/ -static int parse_thread_id(Tcl_Interp *interp, const char *zArg){ - if( zArg==0 || zArg[0]==0 || zArg[1]!=0 || !isupper((unsigned char)zArg[0]) ){ - Tcl_AppendResult(interp, "thread ID must be an upper case letter", 0); - return -1; - } - return zArg[0] - 'A'; -} - -/* -** Usage: thread_create NAME FILENAME -** -** NAME should be an upper case letter. Start the thread running with -** an open connection to the given database. -*/ -static int tcl_thread_create( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - pthread_t x; - int rc; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID FILENAME", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( threadset[i].busy ){ - Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0); - return TCL_ERROR; - } - threadset[i].busy = 1; - sqliteFree(threadset[i].zFilename); - threadset[i].zFilename = sqliteStrDup(argv[2]); - threadset[i].opnum = 1; - threadset[i].completed = 0; - rc = pthread_create(&x, 0, thread_main, &threadset[i]); - if( rc ){ - Tcl_AppendResult(interp, "failed to create the thread", 0); - sqliteFree(threadset[i].zFilename); - threadset[i].busy = 0; - return TCL_ERROR; - } - pthread_detach(x); - return TCL_OK; -} - -/* -** Wait for a thread to reach its idle state. -*/ -static void thread_wait(Thread *p){ - while( p->opnum>p->completed ) sched_yield(); -} - -/* -** Usage: thread_wait ID -** -** Wait on thread ID to reach its idle state. -*/ -static int tcl_thread_wait( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - return TCL_OK; -} - -/* -** Stop a thread. -*/ -static void stop_thread(Thread *p){ - thread_wait(p); - p->xOp = 0; - p->opnum++; - thread_wait(p); - sqliteFree(p->zArg); - p->zArg = 0; - sqliteFree(p->zFilename); - p->zFilename = 0; - p->busy = 0; -} - -/* -** Usage: thread_halt ID -** -** Cause a thread to shut itself down. Wait for the shutdown to be -** completed. If ID is "*" then stop all threads. -*/ -static int tcl_thread_halt( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); - return TCL_ERROR; - } - if( argv[1][0]=='*' && argv[1][1]==0 ){ - for(i=0; i<N_THREAD; i++){ - if( threadset[i].busy ) stop_thread(&threadset[i]); - } - }else{ - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - stop_thread(&threadset[i]); - } - return TCL_OK; -} - -/* -** Usage: thread_argc ID -** -** Wait on the most recent thread_step to complete, then return the -** number of columns in the result set. -*/ -static int tcl_thread_argc( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - char zBuf[100]; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - sprintf(zBuf, "%d", threadset[i].argc); - Tcl_AppendResult(interp, zBuf, 0); - return TCL_OK; -} - -/* -** Usage: thread_argv ID N -** -** Wait on the most recent thread_step to complete, then return the -** value of the N-th columns in the result set. -*/ -static int tcl_thread_argv( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - int n; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID N", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; - thread_wait(&threadset[i]); - if( n<0 || n>=threadset[i].argc ){ - Tcl_AppendResult(interp, "column number out of range", 0); - return TCL_ERROR; - } - Tcl_AppendResult(interp, threadset[i].argv[n], 0); - return TCL_OK; -} - -/* -** Usage: thread_colname ID N -** -** Wait on the most recent thread_step to complete, then return the -** name of the N-th columns in the result set. -*/ -static int tcl_thread_colname( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - int n; - - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID N", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; - thread_wait(&threadset[i]); - if( n<0 || n>=threadset[i].argc ){ - Tcl_AppendResult(interp, "column number out of range", 0); - return TCL_ERROR; - } - Tcl_AppendResult(interp, threadset[i].colv[n], 0); - return TCL_OK; -} - -/* -** Usage: thread_result ID -** -** Wait on the most recent operation to complete, then return the -** result code from that operation. -*/ -static int tcl_thread_result( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - const char *zName; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - switch( threadset[i].rc ){ - case SQLITE_OK: zName = "SQLITE_OK"; break; - case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; - case SQLITE_PERM: zName = "SQLITE_PERM"; break; - case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; - case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; - case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break; - case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; - case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; - case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; - case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; - case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; - case SQLITE_FULL: zName = "SQLITE_FULL"; break; - case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; - case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; - case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; - case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break; - case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; - case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; - case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break; - case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break; - case SQLITE_AUTH: zName = "SQLITE_AUTH"; break; - case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break; - case SQLITE_RANGE: zName = "SQLITE_RANGE"; break; - case SQLITE_ROW: zName = "SQLITE_ROW"; break; - case SQLITE_DONE: zName = "SQLITE_DONE"; break; - default: zName = "SQLITE_Unknown"; break; - } - Tcl_AppendResult(interp, zName, 0); - return TCL_OK; -} - -/* -** Usage: thread_error ID -** -** Wait on the most recent operation to complete, then return the -** error string. -*/ -static int tcl_thread_error( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - Tcl_AppendResult(interp, threadset[i].zErr, 0); - return TCL_OK; -} - -/* -** This procedure runs in the thread to compile an SQL statement. -*/ -static void do_compile(Thread *p){ - if( p->db==0 ){ - p->zErr = p->zStaticErr = "no database is open"; - p->rc = SQLITE_ERROR; - return; - } - if( p->pStmt ){ - sqlite3_finalize(p->pStmt); - p->pStmt = 0; - } - p->rc = sqlite3_prepare(p->db, p->zArg, -1, &p->pStmt, 0); -} - -/* -** Usage: thread_compile ID SQL -** -** Compile a new virtual machine. -*/ -static int tcl_thread_compile( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID SQL", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - threadset[i].xOp = do_compile; - sqliteFree(threadset[i].zArg); - threadset[i].zArg = sqliteStrDup(argv[2]); - threadset[i].opnum++; - return TCL_OK; -} - -/* -** This procedure runs in the thread to step the virtual machine. -*/ -static void do_step(Thread *p){ - int i; - if( p->pStmt==0 ){ - p->zErr = p->zStaticErr = "no virtual machine available"; - p->rc = SQLITE_ERROR; - return; - } - p->rc = sqlite3_step(p->pStmt); - if( p->rc==SQLITE_ROW ){ - p->argc = sqlite3_column_count(p->pStmt); - for(i=0; i<sqlite3_data_count(p->pStmt); i++){ - p->argv[i] = sqlite3_column_text(p->pStmt, i); - } - for(i=0; i<p->argc; i++){ - p->colv[i] = sqlite3_column_name(p->pStmt, i); - } - } -} - -/* -** Usage: thread_step ID -** -** Advance the virtual machine by one step -*/ -static int tcl_thread_step( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " IDL", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - threadset[i].xOp = do_step; - threadset[i].opnum++; - return TCL_OK; -} - -/* -** This procedure runs in the thread to finalize a virtual machine. -*/ -static void do_finalize(Thread *p){ - if( p->pStmt==0 ){ - p->zErr = p->zStaticErr = "no virtual machine available"; - p->rc = SQLITE_ERROR; - return; - } - p->rc = sqlite3_finalize(p->pStmt); - p->pStmt = 0; -} - -/* -** Usage: thread_finalize ID -** -** Finalize the virtual machine. -*/ -static int tcl_thread_finalize( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " IDL", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - threadset[i].xOp = do_finalize; - sqliteFree(threadset[i].zArg); - threadset[i].zArg = 0; - threadset[i].opnum++; - return TCL_OK; -} - -/* -** Usage: thread_swap ID ID -** -** Interchange the sqlite* pointer between two threads. -*/ -static int tcl_thread_swap( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int i, j; - sqlite3 *temp; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID1 ID2", 0); - return TCL_ERROR; - } - i = parse_thread_id(interp, argv[1]); - if( i<0 ) return TCL_ERROR; - if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[i]); - j = parse_thread_id(interp, argv[2]); - if( j<0 ) return TCL_ERROR; - if( !threadset[j].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); - return TCL_ERROR; - } - thread_wait(&threadset[j]); - temp = threadset[i].db; - threadset[i].db = threadset[j].db; - threadset[j].db = temp; - return TCL_OK; -} - -/* -** Register commands with the TCL interpreter. -*/ -int Sqlitetest4_Init(Tcl_Interp *interp){ - static struct { - char *zName; - Tcl_CmdProc *xProc; - } aCmd[] = { - { "thread_create", (Tcl_CmdProc*)tcl_thread_create }, - { "thread_wait", (Tcl_CmdProc*)tcl_thread_wait }, - { "thread_halt", (Tcl_CmdProc*)tcl_thread_halt }, - { "thread_argc", (Tcl_CmdProc*)tcl_thread_argc }, - { "thread_argv", (Tcl_CmdProc*)tcl_thread_argv }, - { "thread_colname", (Tcl_CmdProc*)tcl_thread_colname }, - { "thread_result", (Tcl_CmdProc*)tcl_thread_result }, - { "thread_error", (Tcl_CmdProc*)tcl_thread_error }, - { "thread_compile", (Tcl_CmdProc*)tcl_thread_compile }, - { "thread_step", (Tcl_CmdProc*)tcl_thread_step }, - { "thread_finalize", (Tcl_CmdProc*)tcl_thread_finalize }, - { "thread_swap", (Tcl_CmdProc*)tcl_thread_swap }, - }; - int i; - - for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){ - Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); - } - return TCL_OK; -} -#else -int Sqlitetest4_Init(Tcl_Interp *interp){ return TCL_OK; } -#endif /* OS_UNIX */ diff --git a/ext/pdo_sqlite/sqlite/src/test5.c b/ext/pdo_sqlite/sqlite/src/test5.c deleted file mode 100644 index 28f546f608f17..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/test5.c +++ /dev/null @@ -1,218 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Code for testing the utf.c module in SQLite. This code -** is not included in the SQLite library. It is used for automated -** testing of the SQLite library. Specifically, the code in this file -** is used for testing the SQLite routines for converting between -** the various supported unicode encodings. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "vdbeInt.h" -#include "os.h" /* to get SQLITE_BIGENDIAN */ -#include "tcl.h" -#include <stdlib.h> -#include <string.h> - -/* -** The first argument is a TCL UTF-8 string. Return the byte array -** object with the encoded representation of the string, including -** the NULL terminator. -*/ -static int binarize( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - int len; - char *bytes; - Tcl_Obj *pRet; - assert(objc==2); - - bytes = Tcl_GetStringFromObj(objv[1], &len); - pRet = Tcl_NewByteArrayObj(bytes, len+1); - Tcl_SetObjResult(interp, pRet); - return TCL_OK; -} - -/* -** Usage: test_value_overhead <repeat-count> <do-calls>. -** -** This routine is used to test the overhead of calls to -** sqlite3_value_text(), on a value that contains a UTF-8 string. The idea -** is to figure out whether or not it is a problem to use sqlite3_value -** structures with collation sequence functions. -** -** If <do-calls> is 0, then the calls to sqlite3_value_text() are not -** actually made. -*/ -static int test_value_overhead( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - int do_calls; - int repeat_count; - int i; - Mem val; - const char *zVal; - - if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " <repeat-count> <do-calls>", 0); - return TCL_ERROR; - } - - if( Tcl_GetIntFromObj(interp, objv[1], &repeat_count) ) return TCL_ERROR; - if( Tcl_GetIntFromObj(interp, objv[2], &do_calls) ) return TCL_ERROR; - - val.flags = MEM_Str|MEM_Term|MEM_Static; - val.z = "hello world"; - val.type = SQLITE_TEXT; - val.enc = SQLITE_UTF8; - - for(i=0; i<repeat_count; i++){ - if( do_calls ){ - zVal = sqlite3_value_text(&val); - } - } - - return TCL_OK; -} - -static u8 name_to_enc(Tcl_Interp *interp, Tcl_Obj *pObj){ - struct EncName { - char *zName; - u8 enc; - } encnames[] = { - { "UTF8", SQLITE_UTF8 }, - { "UTF16LE", SQLITE_UTF16LE }, - { "UTF16BE", SQLITE_UTF16BE }, - { "UTF16", SQLITE_UTF16NATIVE }, - { 0, 0 } - }; - struct EncName *pEnc; - char *z = Tcl_GetString(pObj); - for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ - if( 0==sqlite3StrICmp(z, pEnc->zName) ){ - break; - } - } - if( !pEnc->enc ){ - Tcl_AppendResult(interp, "No such encoding: ", z, 0); - } - return pEnc->enc; -} - -/* -** Usage: test_translate <string/blob> <from enc> <to enc> ?<transient>? -** -*/ -static int test_translate( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - u8 enc_from; - u8 enc_to; - sqlite3_value *pVal; - - char *z; - int len; - void (*xDel)(void *p) = SQLITE_STATIC; - - if( objc!=4 && objc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), - " <string/blob> <from enc> <to enc>", 0 - ); - return TCL_ERROR; - } - if( objc==5 ){ - xDel = sqlite3FreeX; - } - - enc_from = name_to_enc(interp, objv[2]); - if( !enc_from ) return TCL_ERROR; - enc_to = name_to_enc(interp, objv[3]); - if( !enc_to ) return TCL_ERROR; - - pVal = sqlite3ValueNew(); - - if( enc_from==SQLITE_UTF8 ){ - z = Tcl_GetString(objv[1]); - if( objc==5 ){ - z = sqliteStrDup(z); - } - sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel); - }else{ - z = Tcl_GetByteArrayFromObj(objv[1], &len); - if( objc==5 ){ - char *zTmp = z; - z = sqliteMalloc(len); - memcpy(z, zTmp, len); - } - sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel); - } - - z = (char *)sqlite3ValueText(pVal, enc_to); - len = sqlite3ValueBytes(pVal, enc_to) + (enc_to==SQLITE_UTF8?1:2); - Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(z, len)); - - sqlite3ValueFree(pVal); - - return TCL_OK; -} - -/* -** Usage: translate_selftest -** -** Call sqlite3utfSelfTest() to run the internal tests for unicode -** translation. If there is a problem an assert() will fail. -**/ -void sqlite3utfSelfTest(); -static int test_translate_selftest( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ -#ifndef SQLITE_OMIT_UTF16 - sqlite3utfSelfTest(); -#endif - return SQLITE_OK; -} - - -/* -** Register commands with the TCL interpreter. -*/ -int Sqlitetest5_Init(Tcl_Interp *interp){ - static struct { - char *zName; - Tcl_ObjCmdProc *xProc; - } aCmd[] = { - { "binarize", (Tcl_ObjCmdProc*)binarize }, - { "test_value_overhead", (Tcl_ObjCmdProc*)test_value_overhead }, - { "test_translate", (Tcl_ObjCmdProc*)test_translate }, - { "translate_selftest", (Tcl_ObjCmdProc*)test_translate_selftest}, - }; - int i; - for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){ - Tcl_CreateObjCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); - } - return SQLITE_OK; -} diff --git a/ext/pdo_sqlite/sqlite/src/tokenize.c b/ext/pdo_sqlite/sqlite/src/tokenize.c deleted file mode 100644 index 7346f5b54ca52..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/tokenize.c +++ /dev/null @@ -1,433 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** An tokenizer for SQL -** -** This file contains C code that splits an SQL input string up into -** individual tokens and sends those tokens one-by-one over to the -** parser for analysis. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> -#include <stdlib.h> - -/* -** The sqlite3KeywordCode function looks up an identifier to determine if -** it is a keyword. If it is a keyword, the token code of that keyword is -** returned. If the input is not a keyword, TK_ID is returned. -** -** The implementation of this routine was generated by a program, -** mkkeywordhash.h, located in the tool subdirectory of the distribution. -** The output of the mkkeywordhash.c program is written into a file -** named keywordhash.h and then included into this source file by -** the #include below. -*/ -#include "keywordhash.h" - - -/* -** If X is a character that can be used in an identifier and -** X&0x80==0 then sqlite3IsIdChar[X] will be 1. If X&0x80==0x80 then -** X is always an identifier character. (Hence all UTF-8 -** characters can be part of an identifier). sqlite3IsIdChar[X] will -** be 0 for every character in the lower 128 ASCII characters -** that cannot be used as part of an identifier. -** -** In this implementation, an identifier can be a string of -** alphabetic characters, digits, and "_" plus any character -** with the high-order bit set. The latter rule means that -** any sequence of UTF-8 characters or characters taken from -** an extended ISO8859 character set can form an identifier. -** -** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identfiers. But many SQL implementations do. -** SQLite will allow '$' in identifiers for compatibility. -** But the feature is undocumented. -*/ -const char sqlite3IsIdChar[] = { -/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ -}; - -#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsIdChar[c-0x20])) - -/* -** Return the length of the token that begins at z[0]. -** Store the token type in *tokenType before returning. -*/ -static int getToken(const unsigned char *z, int *tokenType){ - int i, c; - switch( *z ){ - case ' ': case '\t': case '\n': case '\f': case '\r': { - for(i=1; isspace(z[i]); i++){} - *tokenType = TK_SPACE; - return i; - } - case '-': { - if( z[1]=='-' ){ - for(i=2; (c=z[i])!=0 && c!='\n'; i++){} - *tokenType = TK_COMMENT; - return i; - } - *tokenType = TK_MINUS; - return 1; - } - case '(': { - *tokenType = TK_LP; - return 1; - } - case ')': { - *tokenType = TK_RP; - return 1; - } - case ';': { - *tokenType = TK_SEMI; - return 1; - } - case '+': { - *tokenType = TK_PLUS; - return 1; - } - case '*': { - *tokenType = TK_STAR; - return 1; - } - case '/': { - if( z[1]!='*' || z[2]==0 ){ - *tokenType = TK_SLASH; - return 1; - } - for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} - if( c ) i++; - *tokenType = TK_COMMENT; - return i; - } - case '%': { - *tokenType = TK_REM; - return 1; - } - case '=': { - *tokenType = TK_EQ; - return 1 + (z[1]=='='); - } - case '<': { - if( (c=z[1])=='=' ){ - *tokenType = TK_LE; - return 2; - }else if( c=='>' ){ - *tokenType = TK_NE; - return 2; - }else if( c=='<' ){ - *tokenType = TK_LSHIFT; - return 2; - }else{ - *tokenType = TK_LT; - return 1; - } - } - case '>': { - if( (c=z[1])=='=' ){ - *tokenType = TK_GE; - return 2; - }else if( c=='>' ){ - *tokenType = TK_RSHIFT; - return 2; - }else{ - *tokenType = TK_GT; - return 1; - } - } - case '!': { - if( z[1]!='=' ){ - *tokenType = TK_ILLEGAL; - return 2; - }else{ - *tokenType = TK_NE; - return 2; - } - } - case '|': { - if( z[1]!='|' ){ - *tokenType = TK_BITOR; - return 1; - }else{ - *tokenType = TK_CONCAT; - return 2; - } - } - case ',': { - *tokenType = TK_COMMA; - return 1; - } - case '&': { - *tokenType = TK_BITAND; - return 1; - } - case '~': { - *tokenType = TK_BITNOT; - return 1; - } - case '`': - case '\'': - case '"': { - int delim = z[0]; - for(i=1; (c=z[i])!=0; i++){ - if( c==delim ){ - if( z[i+1]==delim ){ - i++; - }else{ - break; - } - } - } - if( c ) i++; - *tokenType = TK_STRING; - return i; - } - case '.': { -#ifndef SQLITE_OMIT_FLOATING_POINT - if( !isdigit(z[1]) ) -#endif - { - *tokenType = TK_DOT; - return 1; - } - /* If the next character is a digit, this is a floating point - ** number that begins with ".". Fall thru into the next case */ - } - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': { - *tokenType = TK_INTEGER; - for(i=0; isdigit(z[i]); i++){} -#ifndef SQLITE_OMIT_FLOATING_POINT - if( z[i]=='.' ){ - i++; - while( isdigit(z[i]) ){ i++; } - *tokenType = TK_FLOAT; - } - if( (z[i]=='e' || z[i]=='E') && - ( isdigit(z[i+1]) - || ((z[i+1]=='+' || z[i+1]=='-') && isdigit(z[i+2])) - ) - ){ - i += 2; - while( isdigit(z[i]) ){ i++; } - *tokenType = TK_FLOAT; - } -#endif - return i; - } - case '[': { - for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} - *tokenType = TK_ID; - return i; - } - case '?': { - *tokenType = TK_VARIABLE; - for(i=1; isdigit(z[i]); i++){} - return i; - } - case '#': { - for(i=1; isdigit(z[i]); i++){} - if( i>1 ){ - /* Parameters of the form #NNN (where NNN is a number) are used - ** internally by sqlite3NestedParse. */ - *tokenType = TK_REGISTER; - return i; - } - /* Fall through into the next case if the '#' is not followed by - ** a digit. Try to match #AAAA where AAAA is a parameter name. */ - } -#ifndef SQLITE_OMIT_TCL_VARIABLE - case '$': -#endif - case ':': { - int n = 0; - *tokenType = TK_VARIABLE; - for(i=1; (c=z[i])!=0; i++){ - if( IdChar(c) ){ - n++; -#ifndef SQLITE_OMIT_TCL_VARIABLE - }else if( c=='(' && n>0 ){ - do{ - i++; - }while( (c=z[i])!=0 && !isspace(c) && c!=')' ); - if( c==')' ){ - i++; - }else{ - *tokenType = TK_ILLEGAL; - } - break; - }else if( c==':' && z[i+1]==':' ){ - i++; -#endif - }else{ - break; - } - } - if( n==0 ) *tokenType = TK_ILLEGAL; - return i; - } -#ifndef SQLITE_OMIT_BLOB_LITERAL - case 'x': case 'X': { - if( (c=z[1])=='\'' || c=='"' ){ - int delim = c; - *tokenType = TK_BLOB; - for(i=2; (c=z[i])!=0; i++){ - if( c==delim ){ - if( i%2 ) *tokenType = TK_ILLEGAL; - break; - } - if( !isxdigit(c) ){ - *tokenType = TK_ILLEGAL; - return i; - } - } - if( c ) i++; - return i; - } - /* Otherwise fall through to the next case */ - } -#endif - default: { - if( !IdChar(*z) ){ - break; - } - for(i=1; IdChar(z[i]); i++){} - *tokenType = keywordCode((char*)z, i); - return i; - } - } - *tokenType = TK_ILLEGAL; - return 1; -} -int sqlite3GetToken(const unsigned char *z, int *tokenType){ - return getToken(z, tokenType); -} - -/* -** Run the parser on the given SQL string. The parser structure is -** passed in. An SQLITE_ status code is returned. If an error occurs -** and pzErrMsg!=NULL then an error message might be written into -** memory obtained from malloc() and *pzErrMsg made to point to that -** error message. Or maybe not. -*/ -int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ - int nErr = 0; - int i; - void *pEngine; - int tokenType; - int lastTokenParsed = -1; - sqlite3 *db = pParse->db; - extern void *sqlite3ParserAlloc(void*(*)(int)); - extern void sqlite3ParserFree(void*, void(*)(void*)); - extern int sqlite3Parser(void*, int, Token, Parse*); - - db->flags &= ~SQLITE_Interrupt; - pParse->rc = SQLITE_OK; - i = 0; - pEngine = sqlite3ParserAlloc((void*(*)(int))sqlite3MallocX); - if( pEngine==0 ){ - sqlite3SetString(pzErrMsg, "out of memory", (char*)0); - return SQLITE_NOMEM; - } - assert( pParse->sLastToken.dyn==0 ); - assert( pParse->pNewTable==0 ); - assert( pParse->pNewTrigger==0 ); - assert( pParse->nVar==0 ); - assert( pParse->nVarExpr==0 ); - assert( pParse->nVarExprAlloc==0 ); - assert( pParse->apVarExpr==0 ); - pParse->zTail = pParse->zSql = zSql; - while( sqlite3_malloc_failed==0 && zSql[i]!=0 ){ - assert( i>=0 ); - pParse->sLastToken.z = &zSql[i]; - assert( pParse->sLastToken.dyn==0 ); - pParse->sLastToken.n = getToken((unsigned char*)&zSql[i],&tokenType); - i += pParse->sLastToken.n; - switch( tokenType ){ - case TK_SPACE: - case TK_COMMENT: { - if( (db->flags & SQLITE_Interrupt)!=0 ){ - pParse->rc = SQLITE_INTERRUPT; - sqlite3SetString(pzErrMsg, "interrupt", (char*)0); - goto abort_parse; - } - break; - } - case TK_ILLEGAL: { - if( pzErrMsg ){ - sqliteFree(*pzErrMsg); - *pzErrMsg = sqlite3MPrintf("unrecognized token: \"%T\"", - &pParse->sLastToken); - } - nErr++; - goto abort_parse; - } - case TK_SEMI: { - pParse->zTail = &zSql[i]; - /* Fall thru into the default case */ - } - default: { - sqlite3Parser(pEngine, tokenType, pParse->sLastToken, pParse); - lastTokenParsed = tokenType; - if( pParse->rc!=SQLITE_OK ){ - goto abort_parse; - } - break; - } - } - } -abort_parse: - if( zSql[i]==0 && nErr==0 && pParse->rc==SQLITE_OK ){ - if( lastTokenParsed!=TK_SEMI ){ - sqlite3Parser(pEngine, TK_SEMI, pParse->sLastToken, pParse); - pParse->zTail = &zSql[i]; - } - sqlite3Parser(pEngine, 0, pParse->sLastToken, pParse); - } - sqlite3ParserFree(pEngine, sqlite3FreeX); - if( sqlite3_malloc_failed ){ - pParse->rc = SQLITE_NOMEM; - } - if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){ - sqlite3SetString(&pParse->zErrMsg, sqlite3ErrStr(pParse->rc), - (char*)0); - } - if( pParse->zErrMsg ){ - if( pzErrMsg && *pzErrMsg==0 ){ - *pzErrMsg = pParse->zErrMsg; - }else{ - sqliteFree(pParse->zErrMsg); - } - pParse->zErrMsg = 0; - if( !nErr ) nErr++; - } - if( pParse->pVdbe && pParse->nErr>0 && pParse->nested==0 ){ - sqlite3VdbeDelete(pParse->pVdbe); - pParse->pVdbe = 0; - } - sqlite3DeleteTable(pParse->db, pParse->pNewTable); - sqlite3DeleteTrigger(pParse->pNewTrigger); - sqliteFree(pParse->apVarExpr); - if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){ - pParse->rc = SQLITE_ERROR; - } - return nErr; -} diff --git a/ext/pdo_sqlite/sqlite/src/trigger.c b/ext/pdo_sqlite/sqlite/src/trigger.c deleted file mode 100644 index 348dfdd572a5e..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/trigger.c +++ /dev/null @@ -1,803 +0,0 @@ -/* -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -* -*/ -#include "sqliteInt.h" -#include "vdbe.h" - -#ifndef SQLITE_OMIT_TRIGGER -/* -** Delete a linked list of TriggerStep structures. -*/ -void sqlite3DeleteTriggerStep(TriggerStep *pTriggerStep){ - while( pTriggerStep ){ - TriggerStep * pTmp = pTriggerStep; - pTriggerStep = pTriggerStep->pNext; - - if( pTmp->target.dyn ) sqliteFree((char*)pTmp->target.z); - sqlite3ExprDelete(pTmp->pWhere); - sqlite3ExprListDelete(pTmp->pExprList); - sqlite3SelectDelete(pTmp->pSelect); - sqlite3IdListDelete(pTmp->pIdList); - - sqliteFree(pTmp); - } -} - -/* -** This is called by the parser when it sees a CREATE TRIGGER statement -** up to the point of the BEGIN before the trigger actions. A Trigger -** structure is generated based on the information available and stored -** in pParse->pNewTrigger. After the trigger actions have been parsed, the -** sqlite3FinishTrigger() function is called to complete the trigger -** construction process. -*/ -void sqlite3BeginTrigger( - Parse *pParse, /* The parse context of the CREATE TRIGGER statement */ - Token *pName1, /* The name of the trigger */ - Token *pName2, /* The name of the trigger */ - int tr_tm, /* One of TK_BEFORE, TK_AFTER, TK_INSTEAD */ - int op, /* One of TK_INSERT, TK_UPDATE, TK_DELETE */ - IdList *pColumns, /* column list if this is an UPDATE OF trigger */ - SrcList *pTableName,/* The name of the table/view the trigger applies to */ - int foreach, /* One of TK_ROW or TK_STATEMENT */ - Expr *pWhen, /* WHEN clause */ - int isTemp /* True if the TEMPORARY keyword is present */ -){ - Trigger *pTrigger = 0; - Table *pTab; - char *zName = 0; /* Name of the trigger */ - sqlite3 *db = pParse->db; - int iDb; /* The database to store the trigger in */ - Token *pName; /* The unqualified db name */ - DbFixer sFix; - - if( isTemp ){ - /* If TEMP was specified, then the trigger name may not be qualified. */ - if( pName2 && pName2->n>0 ){ - sqlite3ErrorMsg(pParse, "temporary trigger may not have qualified name"); - goto trigger_cleanup; - } - iDb = 1; - pName = pName1; - }else{ - /* Figure out the db that the the trigger will be created in */ - iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); - if( iDb<0 ){ - goto trigger_cleanup; - } - } - - /* If the trigger name was unqualified, and the table is a temp table, - ** then set iDb to 1 to create the trigger in the temporary database. - ** If sqlite3SrcListLookup() returns 0, indicating the table does not - ** exist, the error is caught by the block below. - */ - if( !pTableName || sqlite3_malloc_failed ) goto trigger_cleanup; - pTab = sqlite3SrcListLookup(pParse, pTableName); - if( pName2->n==0 && pTab && pTab->iDb==1 ){ - iDb = 1; - } - - /* Ensure the table name matches database name and that the table exists */ - if( sqlite3_malloc_failed ) goto trigger_cleanup; - assert( pTableName->nSrc==1 ); - if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", pName) && - sqlite3FixSrcList(&sFix, pTableName) ){ - goto trigger_cleanup; - } - pTab = sqlite3SrcListLookup(pParse, pTableName); - if( !pTab ){ - /* The table does not exist. */ - goto trigger_cleanup; - } - - /* Check that the trigger name is not reserved and that no trigger of the - ** specified name exists */ - zName = sqlite3NameFromToken(pName); - if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ - goto trigger_cleanup; - } - if( sqlite3HashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){ - sqlite3ErrorMsg(pParse, "trigger %T already exists", pName); - goto trigger_cleanup; - } - - /* Do not create a trigger on a system table */ - if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ - sqlite3ErrorMsg(pParse, "cannot create trigger on system table"); - pParse->nErr++; - goto trigger_cleanup; - } - - /* INSTEAD of triggers are only for views and views only support INSTEAD - ** of triggers. - */ - if( pTab->pSelect && tr_tm!=TK_INSTEAD ){ - sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", - (tr_tm == TK_BEFORE)?"BEFORE":"AFTER", pTableName, 0); - goto trigger_cleanup; - } - if( !pTab->pSelect && tr_tm==TK_INSTEAD ){ - sqlite3ErrorMsg(pParse, "cannot create INSTEAD OF" - " trigger on table: %S", pTableName, 0); - goto trigger_cleanup; - } - -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code = SQLITE_CREATE_TRIGGER; - const char *zDb = db->aDb[pTab->iDb].zName; - const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb; - if( pTab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; - if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){ - goto trigger_cleanup; - } - if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(pTab->iDb),0,zDb)){ - goto trigger_cleanup; - } - } -#endif - - /* INSTEAD OF triggers can only appear on views and BEFORE triggers - ** cannot appear on views. So we might as well translate every - ** INSTEAD OF trigger into a BEFORE trigger. It simplifies code - ** elsewhere. - */ - if (tr_tm == TK_INSTEAD){ - tr_tm = TK_BEFORE; - } - - /* Build the Trigger object */ - pTrigger = (Trigger*)sqliteMalloc(sizeof(Trigger)); - if( pTrigger==0 ) goto trigger_cleanup; - pTrigger->name = zName; - zName = 0; - pTrigger->table = sqliteStrDup(pTableName->a[0].zName); - pTrigger->iDb = iDb; - pTrigger->iTabDb = pTab->iDb; - pTrigger->op = op; - pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER; - pTrigger->pWhen = sqlite3ExprDup(pWhen); - pTrigger->pColumns = sqlite3IdListDup(pColumns); - pTrigger->foreach = foreach; - sqlite3TokenCopy(&pTrigger->nameToken,pName); - assert( pParse->pNewTrigger==0 ); - pParse->pNewTrigger = pTrigger; - -trigger_cleanup: - sqliteFree(zName); - sqlite3SrcListDelete(pTableName); - sqlite3IdListDelete(pColumns); - sqlite3ExprDelete(pWhen); - if( !pParse->pNewTrigger ){ - sqlite3DeleteTrigger(pTrigger); - }else{ - assert( pParse->pNewTrigger==pTrigger ); - } -} - -/* -** This routine is called after all of the trigger actions have been parsed -** in order to complete the process of building the trigger. -*/ -void sqlite3FinishTrigger( - Parse *pParse, /* Parser context */ - TriggerStep *pStepList, /* The triggered program */ - Token *pAll /* Token that describes the complete CREATE TRIGGER */ -){ - Trigger *pTrig = 0; /* The trigger whose construction is finishing up */ - sqlite3 *db = pParse->db; /* The database */ - DbFixer sFix; - - pTrig = pParse->pNewTrigger; - pParse->pNewTrigger = 0; - if( pParse->nErr || pTrig==0 ) goto triggerfinish_cleanup; - pTrig->step_list = pStepList; - while( pStepList ){ - pStepList->pTrig = pTrig; - pStepList = pStepList->pNext; - } - if( sqlite3FixInit(&sFix, pParse, pTrig->iDb, "trigger", &pTrig->nameToken) - && sqlite3FixTriggerStep(&sFix, pTrig->step_list) ){ - goto triggerfinish_cleanup; - } - - /* if we are not initializing, and this trigger is not on a TEMP table, - ** build the sqlite_master entry - */ - if( !db->init.busy ){ - static const VdbeOpList insertTrig[] = { - { OP_NewRowid, 0, 0, 0 }, - { OP_String8, 0, 0, "trigger" }, - { OP_String8, 0, 0, 0 }, /* 2: trigger name */ - { OP_String8, 0, 0, 0 }, /* 3: table name */ - { OP_Integer, 0, 0, 0 }, - { OP_String8, 0, 0, "CREATE TRIGGER "}, - { OP_String8, 0, 0, 0 }, /* 6: SQL */ - { OP_Concat, 0, 0, 0 }, - { OP_MakeRecord, 5, 0, "tttit" }, - { OP_Insert, 0, 0, 0 }, - }; - int addr; - Vdbe *v; - - /* Make an entry in the sqlite_master table */ - v = sqlite3GetVdbe(pParse); - if( v==0 ) goto triggerfinish_cleanup; - sqlite3BeginWriteOperation(pParse, 0, pTrig->iDb); - sqlite3OpenMasterTable(v, pTrig->iDb); - addr = sqlite3VdbeAddOpList(v, ArraySize(insertTrig), insertTrig); - sqlite3VdbeChangeP3(v, addr+2, pTrig->name, 0); - sqlite3VdbeChangeP3(v, addr+3, pTrig->table, 0); - sqlite3VdbeChangeP3(v, addr+6, pAll->z, pAll->n); - sqlite3ChangeCookie(db, v, pTrig->iDb); - sqlite3VdbeAddOp(v, OP_Close, 0, 0); - sqlite3VdbeOp3(v, OP_ParseSchema, pTrig->iDb, 0, - sqlite3MPrintf("type='trigger' AND name='%q'", pTrig->name), P3_DYNAMIC); - } - - if( db->init.busy ){ - Table *pTab; - Trigger *pDel; - pDel = sqlite3HashInsert(&db->aDb[pTrig->iDb].trigHash, - pTrig->name, strlen(pTrig->name)+1, pTrig); - if( pDel ){ - assert( sqlite3_malloc_failed && pDel==pTrig ); - goto triggerfinish_cleanup; - } - pTab = sqlite3LocateTable(pParse,pTrig->table,db->aDb[pTrig->iTabDb].zName); - assert( pTab!=0 ); - pTrig->pNext = pTab->pTrigger; - pTab->pTrigger = pTrig; - pTrig = 0; - } - -triggerfinish_cleanup: - sqlite3DeleteTrigger(pTrig); - assert( !pParse->pNewTrigger ); - sqlite3DeleteTriggerStep(pStepList); -} - -/* -** Make a copy of all components of the given trigger step. This has -** the effect of copying all Expr.token.z values into memory obtained -** from sqliteMalloc(). As initially created, the Expr.token.z values -** all point to the input string that was fed to the parser. But that -** string is ephemeral - it will go away as soon as the sqlite3_exec() -** call that started the parser exits. This routine makes a persistent -** copy of all the Expr.token.z strings so that the TriggerStep structure -** will be valid even after the sqlite3_exec() call returns. -*/ -static void sqlitePersistTriggerStep(TriggerStep *p){ - if( p->target.z ){ - p->target.z = sqliteStrNDup(p->target.z, p->target.n); - p->target.dyn = 1; - } - if( p->pSelect ){ - Select *pNew = sqlite3SelectDup(p->pSelect); - sqlite3SelectDelete(p->pSelect); - p->pSelect = pNew; - } - if( p->pWhere ){ - Expr *pNew = sqlite3ExprDup(p->pWhere); - sqlite3ExprDelete(p->pWhere); - p->pWhere = pNew; - } - if( p->pExprList ){ - ExprList *pNew = sqlite3ExprListDup(p->pExprList); - sqlite3ExprListDelete(p->pExprList); - p->pExprList = pNew; - } - if( p->pIdList ){ - IdList *pNew = sqlite3IdListDup(p->pIdList); - sqlite3IdListDelete(p->pIdList); - p->pIdList = pNew; - } -} - -/* -** Turn a SELECT statement (that the pSelect parameter points to) into -** a trigger step. Return a pointer to a TriggerStep structure. -** -** The parser calls this routine when it finds a SELECT statement in -** body of a TRIGGER. -*/ -TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){ - TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep)); - if( pTriggerStep==0 ) return 0; - - pTriggerStep->op = TK_SELECT; - pTriggerStep->pSelect = pSelect; - pTriggerStep->orconf = OE_Default; - sqlitePersistTriggerStep(pTriggerStep); - - return pTriggerStep; -} - -/* -** Build a trigger step out of an INSERT statement. Return a pointer -** to the new trigger step. -** -** The parser calls this routine when it sees an INSERT inside the -** body of a trigger. -*/ -TriggerStep *sqlite3TriggerInsertStep( - Token *pTableName, /* Name of the table into which we insert */ - IdList *pColumn, /* List of columns in pTableName to insert into */ - ExprList *pEList, /* The VALUE clause: a list of values to be inserted */ - Select *pSelect, /* A SELECT statement that supplies values */ - int orconf /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */ -){ - TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep)); - - assert(pEList == 0 || pSelect == 0); - assert(pEList != 0 || pSelect != 0); - - if( pTriggerStep ){ - pTriggerStep->op = TK_INSERT; - pTriggerStep->pSelect = pSelect; - pTriggerStep->target = *pTableName; - pTriggerStep->pIdList = pColumn; - pTriggerStep->pExprList = pEList; - pTriggerStep->orconf = orconf; - sqlitePersistTriggerStep(pTriggerStep); - }else{ - sqlite3IdListDelete(pColumn); - sqlite3ExprListDelete(pEList); - sqlite3SelectDup(pSelect); - } - - return pTriggerStep; -} - -/* -** Construct a trigger step that implements an UPDATE statement and return -** a pointer to that trigger step. The parser calls this routine when it -** sees an UPDATE statement inside the body of a CREATE TRIGGER. -*/ -TriggerStep *sqlite3TriggerUpdateStep( - Token *pTableName, /* Name of the table to be updated */ - ExprList *pEList, /* The SET clause: list of column and new values */ - Expr *pWhere, /* The WHERE clause */ - int orconf /* The conflict algorithm. (OE_Abort, OE_Ignore, etc) */ -){ - TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep)); - if( pTriggerStep==0 ) return 0; - - pTriggerStep->op = TK_UPDATE; - pTriggerStep->target = *pTableName; - pTriggerStep->pExprList = pEList; - pTriggerStep->pWhere = pWhere; - pTriggerStep->orconf = orconf; - sqlitePersistTriggerStep(pTriggerStep); - - return pTriggerStep; -} - -/* -** Construct a trigger step that implements a DELETE statement and return -** a pointer to that trigger step. The parser calls this routine when it -** sees a DELETE statement inside the body of a CREATE TRIGGER. -*/ -TriggerStep *sqlite3TriggerDeleteStep(Token *pTableName, Expr *pWhere){ - TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep)); - if( pTriggerStep==0 ) return 0; - - pTriggerStep->op = TK_DELETE; - pTriggerStep->target = *pTableName; - pTriggerStep->pWhere = pWhere; - pTriggerStep->orconf = OE_Default; - sqlitePersistTriggerStep(pTriggerStep); - - return pTriggerStep; -} - -/* -** Recursively delete a Trigger structure -*/ -void sqlite3DeleteTrigger(Trigger *pTrigger){ - if( pTrigger==0 ) return; - sqlite3DeleteTriggerStep(pTrigger->step_list); - sqliteFree(pTrigger->name); - sqliteFree(pTrigger->table); - sqlite3ExprDelete(pTrigger->pWhen); - sqlite3IdListDelete(pTrigger->pColumns); - if( pTrigger->nameToken.dyn ) sqliteFree((char*)pTrigger->nameToken.z); - sqliteFree(pTrigger); -} - -/* -** This function is called to drop a trigger from the database schema. -** -** This may be called directly from the parser and therefore identifies -** the trigger by name. The sqlite3DropTriggerPtr() routine does the -** same job as this routine except it takes a pointer to the trigger -** instead of the trigger name. -**/ -void sqlite3DropTrigger(Parse *pParse, SrcList *pName){ - Trigger *pTrigger = 0; - int i; - const char *zDb; - const char *zName; - int nName; - sqlite3 *db = pParse->db; - - if( sqlite3_malloc_failed ) goto drop_trigger_cleanup; - if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ - goto drop_trigger_cleanup; - } - - assert( pName->nSrc==1 ); - zDb = pName->a[0].zDatabase; - zName = pName->a[0].zName; - nName = strlen(zName); - for(i=OMIT_TEMPDB; i<db->nDb; i++){ - int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDb && sqlite3StrICmp(db->aDb[j].zName, zDb) ) continue; - pTrigger = sqlite3HashFind(&(db->aDb[j].trigHash), zName, nName+1); - if( pTrigger ) break; - } - if( !pTrigger ){ - sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0); - goto drop_trigger_cleanup; - } - sqlite3DropTriggerPtr(pParse, pTrigger, 0); - -drop_trigger_cleanup: - sqlite3SrcListDelete(pName); -} - -/* -** Return a pointer to the Table structure for the table that a trigger -** is set on. -*/ -static Table *tableOfTrigger(sqlite3 *db, Trigger *pTrigger){ - return sqlite3FindTable(db,pTrigger->table,db->aDb[pTrigger->iTabDb].zName); -} - - -/* -** Drop a trigger given a pointer to that trigger. If nested is false, -** then also generate code to remove the trigger from the SQLITE_MASTER -** table. -*/ -void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){ - Table *pTable; - Vdbe *v; - sqlite3 *db = pParse->db; - int iDb; - - iDb = pTrigger->iDb; - assert( iDb>=0 && iDb<db->nDb ); - pTable = tableOfTrigger(db, pTrigger); - assert(pTable); - assert( pTable->iDb==iDb || iDb==1 ); -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code = SQLITE_DROP_TRIGGER; - const char *zDb = db->aDb[iDb].zName; - const char *zTab = SCHEMA_TABLE(iDb); - if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER; - if( sqlite3AuthCheck(pParse, code, pTrigger->name, pTable->zName, zDb) || - sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ - return; - } - } -#endif - - /* Generate code to destroy the database record of the trigger. - */ - if( pTable!=0 && (v = sqlite3GetVdbe(pParse))!=0 ){ - int base; - static const VdbeOpList dropTrigger[] = { - { OP_Rewind, 0, ADDR(9), 0}, - { OP_String8, 0, 0, 0}, /* 1 */ - { OP_Column, 0, 1, 0}, - { OP_Ne, 0, ADDR(8), 0}, - { OP_String8, 0, 0, "trigger"}, - { OP_Column, 0, 0, 0}, - { OP_Ne, 0, ADDR(8), 0}, - { OP_Delete, 0, 0, 0}, - { OP_Next, 0, ADDR(1), 0}, /* 8 */ - }; - - sqlite3BeginWriteOperation(pParse, 0, iDb); - sqlite3OpenMasterTable(v, iDb); - base = sqlite3VdbeAddOpList(v, ArraySize(dropTrigger), dropTrigger); - sqlite3VdbeChangeP3(v, base+1, pTrigger->name, 0); - sqlite3ChangeCookie(db, v, iDb); - sqlite3VdbeAddOp(v, OP_Close, 0, 0); - sqlite3VdbeOp3(v, OP_DropTrigger, iDb, 0, pTrigger->name, 0); - } -} - -/* -** Remove a trigger from the hash tables of the sqlite* pointer. -*/ -void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){ - Trigger *pTrigger; - int nName = strlen(zName); - pTrigger = sqlite3HashInsert(&(db->aDb[iDb].trigHash), zName, nName+1, 0); - if( pTrigger ){ - Table *pTable = tableOfTrigger(db, pTrigger); - assert( pTable!=0 ); - if( pTable->pTrigger == pTrigger ){ - pTable->pTrigger = pTrigger->pNext; - }else{ - Trigger *cc = pTable->pTrigger; - while( cc ){ - if( cc->pNext == pTrigger ){ - cc->pNext = cc->pNext->pNext; - break; - } - cc = cc->pNext; - } - assert(cc); - } - sqlite3DeleteTrigger(pTrigger); - db->flags |= SQLITE_InternChanges; - } -} - -/* -** pEList is the SET clause of an UPDATE statement. Each entry -** in pEList is of the format <id>=<expr>. If any of the entries -** in pEList have an <id> which matches an identifier in pIdList, -** then return TRUE. If pIdList==NULL, then it is considered a -** wildcard that matches anything. Likewise if pEList==NULL then -** it matches anything so always return true. Return false only -** if there is no match. -*/ -static int checkColumnOverLap(IdList *pIdList, ExprList *pEList){ - int e; - if( !pIdList || !pEList ) return 1; - for(e=0; e<pEList->nExpr; e++){ - if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; - } - return 0; -} - -/* -** Return a bit vector to indicate what kind of triggers exist for operation -** "op" on table pTab. If pChanges is not NULL then it is a list of columns -** that are being updated. Triggers only match if the ON clause of the -** trigger definition overlaps the set of columns being updated. -** -** The returned bit vector is some combination of TRIGGER_BEFORE and -** TRIGGER_AFTER. -*/ -int sqlite3TriggersExist( - Parse *pParse, /* Used to check for recursive triggers */ - Table *pTab, /* The table the contains the triggers */ - int op, /* one of TK_DELETE, TK_INSERT, TK_UPDATE */ - ExprList *pChanges /* Columns that change in an UPDATE statement */ -){ - Trigger *pTrigger = pTab->pTrigger; - int mask = 0; - - while( pTrigger ){ - if( pTrigger->op==op && checkColumnOverLap(pTrigger->pColumns, pChanges) ){ - TriggerStack *ss; - ss = pParse->trigStack; - while( ss && ss->pTrigger!=pTab->pTrigger ){ - ss = ss->pNext; - } - if( ss==0 ){ - mask |= pTrigger->tr_tm; - } - } - pTrigger = pTrigger->pNext; - } - return mask; -} - -/* -** Convert the pStep->target token into a SrcList and return a pointer -** to that SrcList. -** -** This routine adds a specific database name, if needed, to the target when -** forming the SrcList. This prevents a trigger in one database from -** referring to a target in another database. An exception is when the -** trigger is in TEMP in which case it can refer to any other database it -** wants. -*/ -static SrcList *targetSrcList( - Parse *pParse, /* The parsing context */ - TriggerStep *pStep /* The trigger containing the target token */ -){ - Token sDb; /* Dummy database name token */ - int iDb; /* Index of the database to use */ - SrcList *pSrc; /* SrcList to be returned */ - - iDb = pStep->pTrig->iDb; - if( iDb==0 || iDb>=2 ){ - assert( iDb<pParse->db->nDb ); - sDb.z = pParse->db->aDb[iDb].zName; - sDb.n = strlen(sDb.z); - pSrc = sqlite3SrcListAppend(0, &sDb, &pStep->target); - } else { - pSrc = sqlite3SrcListAppend(0, &pStep->target, 0); - } - return pSrc; -} - -/* -** Generate VDBE code for zero or more statements inside the body of a -** trigger. -*/ -static int codeTriggerProgram( - Parse *pParse, /* The parser context */ - TriggerStep *pStepList, /* List of statements inside the trigger body */ - int orconfin /* Conflict algorithm. (OE_Abort, etc) */ -){ - TriggerStep * pTriggerStep = pStepList; - int orconf; - Vdbe *v = pParse->pVdbe; - - assert( pTriggerStep!=0 ); - assert( v!=0 ); - sqlite3VdbeAddOp(v, OP_ContextPush, 0, 0); - VdbeComment((v, "# begin trigger %s", pStepList->pTrig->name)); - while( pTriggerStep ){ - orconf = (orconfin == OE_Default)?pTriggerStep->orconf:orconfin; - pParse->trigStack->orconf = orconf; - switch( pTriggerStep->op ){ - case TK_SELECT: { - Select * ss = sqlite3SelectDup(pTriggerStep->pSelect); - assert(ss); - assert(ss->pSrc); - sqlite3SelectResolve(pParse, ss, 0); - sqlite3Select(pParse, ss, SRT_Discard, 0, 0, 0, 0, 0); - sqlite3SelectDelete(ss); - break; - } - case TK_UPDATE: { - SrcList *pSrc; - pSrc = targetSrcList(pParse, pTriggerStep); - sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0); - sqlite3Update(pParse, pSrc, - sqlite3ExprListDup(pTriggerStep->pExprList), - sqlite3ExprDup(pTriggerStep->pWhere), orconf); - sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0); - break; - } - case TK_INSERT: { - SrcList *pSrc; - pSrc = targetSrcList(pParse, pTriggerStep); - sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0); - sqlite3Insert(pParse, pSrc, - sqlite3ExprListDup(pTriggerStep->pExprList), - sqlite3SelectDup(pTriggerStep->pSelect), - sqlite3IdListDup(pTriggerStep->pIdList), orconf); - sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0); - break; - } - case TK_DELETE: { - SrcList *pSrc; - sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0); - pSrc = targetSrcList(pParse, pTriggerStep); - sqlite3DeleteFrom(pParse, pSrc, sqlite3ExprDup(pTriggerStep->pWhere)); - sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0); - break; - } - default: - assert(0); - } - pTriggerStep = pTriggerStep->pNext; - } - sqlite3VdbeAddOp(v, OP_ContextPop, 0, 0); - VdbeComment((v, "# end trigger %s", pStepList->pTrig->name)); - - return 0; -} - -/* -** This is called to code FOR EACH ROW triggers. -** -** When the code that this function generates is executed, the following -** must be true: -** -** 1. No cursors may be open in the main database. (But newIdx and oldIdx -** can be indices of cursors in temporary tables. See below.) -** -** 2. If the triggers being coded are ON INSERT or ON UPDATE triggers, then -** a temporary vdbe cursor (index newIdx) must be open and pointing at -** a row containing values to be substituted for new.* expressions in the -** trigger program(s). -** -** 3. If the triggers being coded are ON DELETE or ON UPDATE triggers, then -** a temporary vdbe cursor (index oldIdx) must be open and pointing at -** a row containing values to be substituted for old.* expressions in the -** trigger program(s). -** -*/ -int sqlite3CodeRowTrigger( - Parse *pParse, /* Parse context */ - int op, /* One of TK_UPDATE, TK_INSERT, TK_DELETE */ - ExprList *pChanges, /* Changes list for any UPDATE OF triggers */ - int tr_tm, /* One of TRIGGER_BEFORE, TRIGGER_AFTER */ - Table *pTab, /* The table to code triggers from */ - int newIdx, /* The indice of the "new" row to access */ - int oldIdx, /* The indice of the "old" row to access */ - int orconf, /* ON CONFLICT policy */ - int ignoreJump /* Instruction to jump to for RAISE(IGNORE) */ -){ - Trigger *pTrigger; - TriggerStack *pStack; - TriggerStack trigStackEntry; - - assert(op == TK_UPDATE || op == TK_INSERT || op == TK_DELETE); - assert(tr_tm == TRIGGER_BEFORE || tr_tm == TRIGGER_AFTER ); - - assert(newIdx != -1 || oldIdx != -1); - - pTrigger = pTab->pTrigger; - while( pTrigger ){ - int fire_this = 0; - - /* determine whether we should code this trigger */ - if( pTrigger->op == op && pTrigger->tr_tm == tr_tm ){ - fire_this = 1; - for(pStack=pParse->trigStack; pStack; pStack=pStack->pNext){ - if( pStack->pTrigger==pTrigger ){ - fire_this = 0; - } - } - if( op == TK_UPDATE && pTrigger->pColumns && - !checkColumnOverLap(pTrigger->pColumns, pChanges) ){ - fire_this = 0; - } - } - - if( fire_this ){ - int endTrigger; - Expr * whenExpr; - AuthContext sContext; - NameContext sNC; - - memset(&sNC, 0, sizeof(sNC)); - sNC.pParse = pParse; - - /* Push an entry on to the trigger stack */ - trigStackEntry.pTrigger = pTrigger; - trigStackEntry.newIdx = newIdx; - trigStackEntry.oldIdx = oldIdx; - trigStackEntry.pTab = pTab; - trigStackEntry.pNext = pParse->trigStack; - trigStackEntry.ignoreJump = ignoreJump; - pParse->trigStack = &trigStackEntry; - sqlite3AuthContextPush(pParse, &sContext, pTrigger->name); - - /* code the WHEN clause */ - endTrigger = sqlite3VdbeMakeLabel(pParse->pVdbe); - whenExpr = sqlite3ExprDup(pTrigger->pWhen); - if( sqlite3ExprResolveNames(&sNC, whenExpr) ){ - pParse->trigStack = trigStackEntry.pNext; - sqlite3ExprDelete(whenExpr); - return 1; - } - sqlite3ExprIfFalse(pParse, whenExpr, endTrigger, 1); - sqlite3ExprDelete(whenExpr); - - codeTriggerProgram(pParse, pTrigger->step_list, orconf); - - /* Pop the entry off the trigger stack */ - pParse->trigStack = trigStackEntry.pNext; - sqlite3AuthContextPop(&sContext); - - sqlite3VdbeResolveLabel(pParse->pVdbe, endTrigger); - } - pTrigger = pTrigger->pNext; - } - return 0; -} -#endif /* !defined(SQLITE_OMIT_TRIGGER) */ diff --git a/ext/pdo_sqlite/sqlite/src/update.c b/ext/pdo_sqlite/sqlite/src/update.c deleted file mode 100644 index b6c6b8b1ed4b4..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/update.c +++ /dev/null @@ -1,506 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** to handle UPDATE statements. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** The most recently coded instruction was an OP_Column to retrieve column -** 'i' of table pTab. This routine sets the P3 parameter of the -** OP_Column to the default value, if any. -** -** The default value of a column is specified by a DEFAULT clause in the -** column definition. This was either supplied by the user when the table -** was created, or added later to the table definition by an ALTER TABLE -** command. If the latter, then the row-records in the table btree on disk -** may not contain a value for the column and the default value, taken -** from the P3 parameter of the OP_Column instruction, is returned instead. -** If the former, then all row-records are guaranteed to include a value -** for the column and the P3 value is not required. -** -** Column definitions created by an ALTER TABLE command may only have -** literal default values specified: a number, null or a string. (If a more -** complicated default expression value was provided, it is evaluated -** when the ALTER TABLE is executed and one of the literal values written -** into the sqlite_master table.) -** -** Therefore, the P3 parameter is only required if the default value for -** the column is a literal number, string or null. The sqlite3ValueFromExpr() -** function is capable of transforming these types of expressions into -** sqlite3_value objects. -*/ -void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ - if( pTab && !pTab->pSelect ){ - sqlite3_value *pValue; - u8 enc = sqlite3VdbeDb(v)->enc; - Column *pCol = &pTab->aCol[i]; - sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue); - if( pValue ){ - sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM); - }else{ - VdbeComment((v, "# %s.%s", pTab->zName, pCol->zName)); - } - } -} - -/* -** Process an UPDATE statement. -** -** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; -** \_______/ \________/ \______/ \________________/ -* onError pTabList pChanges pWhere -*/ -void sqlite3Update( - Parse *pParse, /* The parser context */ - SrcList *pTabList, /* The table in which we should change things */ - ExprList *pChanges, /* Things to be changed */ - Expr *pWhere, /* The WHERE clause. May be null */ - int onError /* How to handle constraint errors */ -){ - int i, j; /* Loop counters */ - Table *pTab; /* The table to be updated */ - int addr = 0; /* VDBE instruction address of the start of the loop */ - WhereInfo *pWInfo; /* Information about the WHERE clause */ - Vdbe *v; /* The virtual database engine */ - Index *pIdx; /* For looping over indices */ - int nIdx; /* Number of indices that need updating */ - int nIdxTotal; /* Total number of indices */ - int iCur; /* VDBE Cursor number of pTab */ - sqlite3 *db; /* The database structure */ - Index **apIdx = 0; /* An array of indices that need updating too */ - char *aIdxUsed = 0; /* aIdxUsed[i]==1 if the i-th index is used */ - int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the - ** an expression for the i-th column of the table. - ** aXRef[i]==-1 if the i-th column is not changed. */ - int chngRowid; /* True if the record number is being changed */ - Expr *pRowidExpr = 0; /* Expression defining the new record number */ - int openAll = 0; /* True if all indices need to be opened */ - AuthContext sContext; /* The authorization context */ - NameContext sNC; /* The name-context to resolve expressions in */ - -#ifndef SQLITE_OMIT_TRIGGER - int isView; /* Trying to update a view */ - int triggers_exist = 0; /* True if any row triggers exist */ -#endif - - int newIdx = -1; /* index of trigger "new" temp table */ - int oldIdx = -1; /* index of trigger "old" temp table */ - - sContext.pParse = 0; - if( pParse->nErr || sqlite3_malloc_failed ) goto update_cleanup; - db = pParse->db; - assert( pTabList->nSrc==1 ); - - /* Locate the table which we want to update. - */ - pTab = sqlite3SrcListLookup(pParse, pTabList); - if( pTab==0 ) goto update_cleanup; - - /* Figure out if we have any triggers and if the table being - ** updated is a view - */ -#ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges); - isView = pTab->pSelect!=0; -#else -# define triggers_exist 0 -# define isView 0 -#endif -#ifdef SQLITE_OMIT_VIEW -# undef isView -# define isView 0 -#endif - - if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){ - goto update_cleanup; - } - if( isView ){ - if( sqlite3ViewGetColumnNames(pParse, pTab) ){ - goto update_cleanup; - } - } - aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol ); - if( aXRef==0 ) goto update_cleanup; - for(i=0; i<pTab->nCol; i++) aXRef[i] = -1; - - /* If there are FOR EACH ROW triggers, allocate cursors for the - ** special OLD and NEW tables - */ - if( triggers_exist ){ - newIdx = pParse->nTab++; - oldIdx = pParse->nTab++; - } - - /* Allocate a cursors for the main database table and for all indices. - ** The index cursors might not be used, but if they are used they - ** need to occur right after the database cursor. So go ahead and - ** allocate enough space, just in case. - */ - pTabList->a[0].iCursor = iCur = pParse->nTab++; - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - pParse->nTab++; - } - - /* Initialize the name-context */ - memset(&sNC, 0, sizeof(sNC)); - sNC.pParse = pParse; - sNC.pSrcList = pTabList; - - /* Resolve the column names in all the expressions of the - ** of the UPDATE statement. Also find the column index - ** for each column to be updated in the pChanges array. For each - ** column to be updated, make sure we have authorization to change - ** that column. - */ - chngRowid = 0; - for(i=0; i<pChanges->nExpr; i++){ - if( sqlite3ExprResolveNames(&sNC, pChanges->a[i].pExpr) ){ - goto update_cleanup; - } - for(j=0; j<pTab->nCol; j++){ - if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ - if( j==pTab->iPKey ){ - chngRowid = 1; - pRowidExpr = pChanges->a[i].pExpr; - } - aXRef[j] = i; - break; - } - } - if( j>=pTab->nCol ){ - if( sqlite3IsRowid(pChanges->a[i].zName) ){ - chngRowid = 1; - pRowidExpr = pChanges->a[i].pExpr; - }else{ - sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); - goto update_cleanup; - } - } -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int rc; - rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName, - pTab->aCol[j].zName, db->aDb[pTab->iDb].zName); - if( rc==SQLITE_DENY ){ - goto update_cleanup; - }else if( rc==SQLITE_IGNORE ){ - aXRef[j] = -1; - } - } -#endif - } - - /* Allocate memory for the array apIdx[] and fill it with pointers to every - ** index that needs to be updated. Indices only need updating if their - ** key includes one of the columns named in pChanges or if the record - ** number of the original table entry is changing. - */ - for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){ - if( chngRowid ){ - i = 0; - }else { - for(i=0; i<pIdx->nColumn; i++){ - if( aXRef[pIdx->aiColumn[i]]>=0 ) break; - } - } - if( i<pIdx->nColumn ) nIdx++; - } - if( nIdxTotal>0 ){ - apIdx = sqliteMallocRaw( sizeof(Index*) * nIdx + nIdxTotal ); - if( apIdx==0 ) goto update_cleanup; - aIdxUsed = (char*)&apIdx[nIdx]; - } - for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - if( chngRowid ){ - i = 0; - }else{ - for(i=0; i<pIdx->nColumn; i++){ - if( aXRef[pIdx->aiColumn[i]]>=0 ) break; - } - } - if( i<pIdx->nColumn ){ - if( sqlite3CheckIndexCollSeq(pParse, pIdx) ) goto update_cleanup; - apIdx[nIdx++] = pIdx; - aIdxUsed[j] = 1; - }else{ - aIdxUsed[j] = 0; - } - } - - /* Resolve the column names in all the expressions in the - ** WHERE clause. - */ - if( sqlite3ExprResolveNames(&sNC, pWhere) ){ - goto update_cleanup; - } - - /* Start the view context - */ - if( isView ){ - sqlite3AuthContextPush(pParse, &sContext, pTab->zName); - } - - /* Begin generating code. - */ - v = sqlite3GetVdbe(pParse); - if( v==0 ) goto update_cleanup; - if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); - sqlite3BeginWriteOperation(pParse, 1, pTab->iDb); - - /* If we are trying to update a view, realize that view into - ** a ephemeral table. - */ - if( isView ){ - Select *pView; - pView = sqlite3SelectDup(pTab->pSelect); - sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0); - sqlite3SelectDelete(pView); - } - - /* Begin the database scan - */ - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0); - if( pWInfo==0 ) goto update_cleanup; - - /* Remember the index of every item to be updated. - */ - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0); - - /* End the database scan loop. - */ - sqlite3WhereEnd(pWInfo); - - /* Initialize the count of updated rows - */ - if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ - sqlite3VdbeAddOp(v, OP_Integer, 0, 0); - } - - if( triggers_exist ){ - /* Create pseudo-tables for NEW and OLD - */ - sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); - sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol); - sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0); - sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol); - - /* The top of the update loop for when there are triggers. - */ - addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); - - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - /* Open a cursor and make it point to the record that is - ** being updated. - */ - sqlite3OpenTableForReading(v, iCur, pTab); - } - sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); - - /* Generate the OLD table - */ - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_RowData, iCur, 0); - sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0); - - /* Generate the NEW table - */ - if( chngRowid ){ - sqlite3ExprCodeAndCache(pParse, pRowidExpr); - }else{ - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - } - for(i=0; i<pTab->nCol; i++){ - if( i==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - continue; - } - j = aXRef[i]; - if( j<0 ){ - sqlite3VdbeAddOp(v, OP_Column, iCur, i); - sqlite3ColumnDefault(v, pTab, i); - }else{ - sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr); - } - } - sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); - if( !isView ){ - sqlite3TableAffinityStr(v, pTab); - } - if( pParse->nErr ) goto update_cleanup; - sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0); - if( !isView ){ - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - - /* Fire the BEFORE and INSTEAD OF triggers - */ - if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, - newIdx, oldIdx, onError, addr) ){ - goto update_cleanup; - } - } - - if( !isView ){ - /* - ** Open every index that needs updating. Note that if any - ** index could potentially invoke a REPLACE conflict resolution - ** action, then we need to open all indices because we might need - ** to be deleting some records. - */ - sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, iCur, pTab->tnum); - sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, pTab->nCol); - if( onError==OE_Replace ){ - openAll = 1; - }else{ - openAll = 0; - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - if( pIdx->onError==OE_Replace ){ - openAll = 1; - break; - } - } - } - for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ - if( openAll || aIdxUsed[i] ){ - sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - sqlite3VdbeOp3(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, - (char*)&pIdx->keyInfo, P3_KEYINFO); - assert( pParse->nTab>iCur+i+1 ); - } - } - - /* Loop over every record that needs updating. We have to load - ** the old data for each record to be updated because some columns - ** might not change and we will need to copy the old value. - ** Also, the old data is needed to delete the old index entires. - ** So make the cursor point at the old record. - */ - if( !triggers_exist ){ - addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - } - sqlite3VdbeAddOp(v, OP_NotExists, iCur, addr); - - /* If the record number will change, push the record number as it - ** will be after the update. (The old record number is currently - ** on top of the stack.) - */ - if( chngRowid ){ - sqlite3ExprCode(pParse, pRowidExpr); - sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); - } - - /* Compute new data for this record. - */ - for(i=0; i<pTab->nCol; i++){ - if( i==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_Null, 0, 0); - continue; - } - j = aXRef[i]; - if( j<0 ){ - sqlite3VdbeAddOp(v, OP_Column, iCur, i); - sqlite3ColumnDefault(v, pTab, i); - }else{ - sqlite3ExprCode(pParse, pChanges->a[j].pExpr); - } - } - - /* Do constraint checks - */ - sqlite3GenerateConstraintChecks(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, - onError, addr); - - /* Delete the old indices for the current record. - */ - sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed); - - /* If changing the record number, delete the old record. - */ - if( chngRowid ){ - sqlite3VdbeAddOp(v, OP_Delete, iCur, 0); - } - - /* Create the new index entries and the new record. - */ - sqlite3CompleteInsertion(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, -1); - } - - /* Increment the row counter - */ - if( db->flags & SQLITE_CountRows && !pParse->trigStack){ - sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); - } - - /* If there are triggers, close all the cursors after each iteration - ** through the loop. The fire the after triggers. - */ - if( triggers_exist ){ - if( !isView ){ - for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ - if( openAll || aIdxUsed[i] ) - sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); - } - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - } - if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab, - newIdx, oldIdx, onError, addr) ){ - goto update_cleanup; - } - } - - /* Repeat the above with the next record to be updated, until - ** all record selected by the WHERE clause have been updated. - */ - sqlite3VdbeAddOp(v, OP_Goto, 0, addr); - sqlite3VdbeJumpHere(v, addr); - - /* Close all tables if there were no FOR EACH ROW triggers */ - if( !triggers_exist ){ - for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ - if( openAll || aIdxUsed[i] ){ - sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); - } - } - sqlite3VdbeAddOp(v, OP_Close, iCur, 0); - }else{ - sqlite3VdbeAddOp(v, OP_Close, newIdx, 0); - sqlite3VdbeAddOp(v, OP_Close, oldIdx, 0); - } - - /* - ** Return the number of rows that were changed. If this routine is - ** generating code because of a call to sqlite3NestedParse(), do not - ** invoke the callback function. - */ - if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){ - sqlite3VdbeAddOp(v, OP_Callback, 1, 0); - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, "rows updated", P3_STATIC); - } - -update_cleanup: - sqlite3AuthContextPop(&sContext); - sqliteFree(apIdx); - sqliteFree(aXRef); - sqlite3SrcListDelete(pTabList); - sqlite3ExprListDelete(pChanges); - sqlite3ExprDelete(pWhere); - return; -} diff --git a/ext/pdo_sqlite/sqlite/src/utf.c b/ext/pdo_sqlite/sqlite/src/utf.c deleted file mode 100644 index a96b36c6db98a..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/utf.c +++ /dev/null @@ -1,570 +0,0 @@ -/* -** 2004 April 13 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains routines used to translate between UTF-8, -** UTF-16, UTF-16BE, and UTF-16LE. -** -** $Id$ -** -** Notes on UTF-8: -** -** Byte-0 Byte-1 Byte-2 Byte-3 Value -** 0xxxxxxx 00000000 00000000 0xxxxxxx -** 110yyyyy 10xxxxxx 00000000 00000yyy yyxxxxxx -** 1110zzzz 10yyyyyy 10xxxxxx 00000000 zzzzyyyy yyxxxxxx -** 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx 000uuuuu zzzzyyyy yyxxxxxx -** -** -** Notes on UTF-16: (with wwww+1==uuuuu) -** -** Word-0 Word-1 Value -** 110110ww wwzzzzyy 110111yy yyxxxxxx 000uuuuu zzzzyyyy yyxxxxxx -** zzzzyyyy yyxxxxxx 00000000 zzzzyyyy yyxxxxxx -** -** -** BOM or Byte Order Mark: -** 0xff 0xfe little-endian utf-16 follows -** 0xfe 0xff big-endian utf-16 follows -** -** -** Handling of malformed strings: -** -** SQLite accepts and processes malformed strings without an error wherever -** possible. However this is not possible when converting between UTF-8 and -** UTF-16. -** -** When converting malformed UTF-8 strings to UTF-16, one instance of the -** replacement character U+FFFD for each byte that cannot be interpeted as -** part of a valid unicode character. -** -** When converting malformed UTF-16 strings to UTF-8, one instance of the -** replacement character U+FFFD for each pair of bytes that cannot be -** interpeted as part of a valid unicode character. -** -** This file contains the following public routines: -** -** sqlite3VdbeMemTranslate() - Translate the encoding used by a Mem* string. -** sqlite3VdbeMemHandleBom() - Handle byte-order-marks in UTF16 Mem* strings. -** sqlite3utf16ByteLen() - Calculate byte-length of a void* UTF16 string. -** sqlite3utf8CharLen() - Calculate char-length of a char* UTF8 string. -** sqlite3utf8LikeCompare() - Do a LIKE match given two UTF8 char* strings. -** -*/ -#include "sqliteInt.h" -#include <assert.h> -#include "vdbeInt.h" - -/* -** This table maps from the first byte of a UTF-8 character to the number -** of trailing bytes expected. A value '255' indicates that the table key -** is not a legal first byte for a UTF-8 character. -*/ -static const u8 xtra_utf8_bytes[256] = { -/* 0xxxxxxx */ -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* 10wwwwww */ -255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - -/* 110yyyyy */ -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - -/* 1110zzzz */ -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - -/* 11110yyy */ -3, 3, 3, 3, 3, 3, 3, 3, 255, 255, 255, 255, 255, 255, 255, 255, -}; - -/* -** This table maps from the number of trailing bytes in a UTF-8 character -** to an integer constant that is effectively calculated for each character -** read by a naive implementation of a UTF-8 character reader. The code -** in the READ_UTF8 macro explains things best. -*/ -static const int xtra_utf8_bits[4] = { -0, -12416, /* (0xC0 << 6) + (0x80) */ -925824, /* (0xE0 << 12) + (0x80 << 6) + (0x80) */ -63447168 /* (0xF0 << 18) + (0x80 << 12) + (0x80 << 6) + 0x80 */ -}; - -#define READ_UTF8(zIn, c) { \ - int xtra; \ - c = *(zIn)++; \ - xtra = xtra_utf8_bytes[c]; \ - switch( xtra ){ \ - case 255: c = (int)0xFFFD; break; \ - case 3: c = (c<<6) + *(zIn)++; \ - case 2: c = (c<<6) + *(zIn)++; \ - case 1: c = (c<<6) + *(zIn)++; \ - c -= xtra_utf8_bits[xtra]; \ - } \ -} -int sqlite3ReadUtf8(const unsigned char *z){ - int c; - READ_UTF8(z, c); - return c; -} - -#define SKIP_UTF8(zIn) { \ - zIn += (xtra_utf8_bytes[*(u8 *)zIn] + 1); \ -} - -#define WRITE_UTF8(zOut, c) { \ - if( c<0x00080 ){ \ - *zOut++ = (c&0xFF); \ - } \ - else if( c<0x00800 ){ \ - *zOut++ = 0xC0 + ((c>>6)&0x1F); \ - *zOut++ = 0x80 + (c & 0x3F); \ - } \ - else if( c<0x10000 ){ \ - *zOut++ = 0xE0 + ((c>>12)&0x0F); \ - *zOut++ = 0x80 + ((c>>6) & 0x3F); \ - *zOut++ = 0x80 + (c & 0x3F); \ - }else{ \ - *zOut++ = 0xF0 + ((c>>18) & 0x07); \ - *zOut++ = 0x80 + ((c>>12) & 0x3F); \ - *zOut++ = 0x80 + ((c>>6) & 0x3F); \ - *zOut++ = 0x80 + (c & 0x3F); \ - } \ -} - -#define WRITE_UTF16LE(zOut, c) { \ - if( c<=0xFFFF ){ \ - *zOut++ = (c&0x00FF); \ - *zOut++ = ((c>>8)&0x00FF); \ - }else{ \ - *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ - *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ - *zOut++ = (c&0x00FF); \ - *zOut++ = (0x00DC + ((c>>8)&0x03)); \ - } \ -} - -#define WRITE_UTF16BE(zOut, c) { \ - if( c<=0xFFFF ){ \ - *zOut++ = ((c>>8)&0x00FF); \ - *zOut++ = (c&0x00FF); \ - }else{ \ - *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ - *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ - *zOut++ = (0x00DC + ((c>>8)&0x03)); \ - *zOut++ = (c&0x00FF); \ - } \ -} - -#define READ_UTF16LE(zIn, c){ \ - c = (*zIn++); \ - c += ((*zIn++)<<8); \ - if( c>=0xD800 && c<=0xE000 ){ \ - int c2 = (*zIn++); \ - c2 += ((*zIn++)<<8); \ - c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ - } \ -} - -#define READ_UTF16BE(zIn, c){ \ - c = ((*zIn++)<<8); \ - c += (*zIn++); \ - if( c>=0xD800 && c<=0xE000 ){ \ - int c2 = ((*zIn++)<<8); \ - c2 += (*zIn++); \ - c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ - } \ -} - -#define SKIP_UTF16BE(zIn){ \ - if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){ \ - zIn += 4; \ - }else{ \ - zIn += 2; \ - } \ -} -#define SKIP_UTF16LE(zIn){ \ - zIn++; \ - if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){ \ - zIn += 3; \ - }else{ \ - zIn += 1; \ - } \ -} - -#define RSKIP_UTF16LE(zIn){ \ - if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){ \ - zIn -= 4; \ - }else{ \ - zIn -= 2; \ - } \ -} -#define RSKIP_UTF16BE(zIn){ \ - zIn--; \ - if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){ \ - zIn -= 3; \ - }else{ \ - zIn -= 1; \ - } \ -} - -/* -** If the TRANSLATE_TRACE macro is defined, the value of each Mem is -** printed on stderr on the way into and out of sqlite3VdbeMemTranslate(). -*/ -/* #define TRANSLATE_TRACE 1 */ - -#ifndef SQLITE_OMIT_UTF16 -/* -** This routine transforms the internal text encoding used by pMem to -** desiredEnc. It is an error if the string is already of the desired -** encoding, or if *pMem does not contain a string value. -*/ -int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){ - unsigned char zShort[NBFS]; /* Temporary short output buffer */ - int len; /* Maximum length of output string in bytes */ - unsigned char *zOut; /* Output buffer */ - unsigned char *zIn; /* Input iterator */ - unsigned char *zTerm; /* End of input */ - unsigned char *z; /* Output iterator */ - int c; - - assert( pMem->flags&MEM_Str ); - assert( pMem->enc!=desiredEnc ); - assert( pMem->enc!=0 ); - assert( pMem->n>=0 ); - -#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) - { - char zBuf[100]; - sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100); - fprintf(stderr, "INPUT: %s\n", zBuf); - } -#endif - - /* If the translation is between UTF-16 little and big endian, then - ** all that is required is to swap the byte order. This case is handled - ** differently from the others. - */ - if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){ - u8 temp; - int rc; - rc = sqlite3VdbeMemMakeWriteable(pMem); - if( rc!=SQLITE_OK ){ - assert( rc==SQLITE_NOMEM ); - return SQLITE_NOMEM; - } - zIn = pMem->z; - zTerm = &zIn[pMem->n]; - while( zIn<zTerm ){ - temp = *zIn; - *zIn = *(zIn+1); - zIn++; - *zIn++ = temp; - } - pMem->enc = desiredEnc; - goto translate_out; - } - - /* Set len to the maximum number of bytes required in the output buffer. */ - if( desiredEnc==SQLITE_UTF8 ){ - /* When converting from UTF-16, the maximum growth results from - ** translating a 2-byte character to a 3-byte UTF-8 character (i.e. - ** code-point 0xFFFC). A single byte is required for the output string - ** nul-terminator. - */ - len = (pMem->n/2) * 3 + 1; - }else{ - /* When converting from UTF-8 to UTF-16 the maximum growth is caused - ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16 - ** character. Two bytes are required in the output buffer for the - ** nul-terminator. - */ - len = pMem->n * 2 + 2; - } - - /* Set zIn to point at the start of the input buffer and zTerm to point 1 - ** byte past the end. - ** - ** Variable zOut is set to point at the output buffer. This may be space - ** obtained from malloc(), or Mem.zShort, if it large enough and not in - ** use, or the zShort array on the stack (see above). - */ - zIn = pMem->z; - zTerm = &zIn[pMem->n]; - if( len>NBFS ){ - zOut = sqliteMallocRaw(len); - if( !zOut ) return SQLITE_NOMEM; - }else{ - zOut = zShort; - } - z = zOut; - - if( pMem->enc==SQLITE_UTF8 ){ - if( desiredEnc==SQLITE_UTF16LE ){ - /* UTF-8 -> UTF-16 Little-endian */ - while( zIn<zTerm ){ - READ_UTF8(zIn, c); - WRITE_UTF16LE(z, c); - } - }else{ - assert( desiredEnc==SQLITE_UTF16BE ); - /* UTF-8 -> UTF-16 Big-endian */ - while( zIn<zTerm ){ - READ_UTF8(zIn, c); - WRITE_UTF16BE(z, c); - } - } - pMem->n = z - zOut; - *z++ = 0; - }else{ - assert( desiredEnc==SQLITE_UTF8 ); - if( pMem->enc==SQLITE_UTF16LE ){ - /* UTF-16 Little-endian -> UTF-8 */ - while( zIn<zTerm ){ - READ_UTF16LE(zIn, c); - WRITE_UTF8(z, c); - } - }else{ - /* UTF-16 Little-endian -> UTF-8 */ - while( zIn<zTerm ){ - READ_UTF16BE(zIn, c); - WRITE_UTF8(z, c); - } - } - pMem->n = z - zOut; - } - *z = 0; - assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len ); - - sqlite3VdbeMemRelease(pMem); - pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short); - pMem->enc = desiredEnc; - if( zOut==zShort ){ - memcpy(pMem->zShort, zOut, len); - zOut = pMem->zShort; - pMem->flags |= (MEM_Term|MEM_Short); - }else{ - pMem->flags |= (MEM_Term|MEM_Dyn); - } - pMem->z = zOut; - -translate_out: -#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) - { - char zBuf[100]; - sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100); - fprintf(stderr, "OUTPUT: %s\n", zBuf); - } -#endif - return SQLITE_OK; -} - -/* -** This routine checks for a byte-order mark at the beginning of the -** UTF-16 string stored in *pMem. If one is present, it is removed and -** the encoding of the Mem adjusted. This routine does not do any -** byte-swapping, it just sets Mem.enc appropriately. -** -** The allocation (static, dynamic etc.) and encoding of the Mem may be -** changed by this function. -*/ -int sqlite3VdbeMemHandleBom(Mem *pMem){ - int rc = SQLITE_OK; - u8 bom = 0; - - if( pMem->n<0 || pMem->n>1 ){ - u8 b1 = *(u8 *)pMem->z; - u8 b2 = *(((u8 *)pMem->z) + 1); - if( b1==0xFE && b2==0xFF ){ - bom = SQLITE_UTF16BE; - } - if( b1==0xFF && b2==0xFE ){ - bom = SQLITE_UTF16LE; - } - } - - if( bom ){ - /* This function is called as soon as a string is stored in a Mem*, - ** from within sqlite3VdbeMemSetStr(). At that point it is not possible - ** for the string to be stored in Mem.zShort, or for it to be stored - ** in dynamic memory with no destructor. - */ - assert( !(pMem->flags&MEM_Short) ); - assert( !(pMem->flags&MEM_Dyn) || pMem->xDel ); - if( pMem->flags & MEM_Dyn ){ - void (*xDel)(void*) = pMem->xDel; - char *z = pMem->z; - pMem->z = 0; - pMem->xDel = 0; - rc = sqlite3VdbeMemSetStr(pMem, &z[2], pMem->n-2, bom, SQLITE_TRANSIENT); - xDel(z); - }else{ - rc = sqlite3VdbeMemSetStr(pMem, &pMem->z[2], pMem->n-2, bom, - SQLITE_TRANSIENT); - } - } - return rc; -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** pZ is a UTF-8 encoded unicode string. If nByte is less than zero, -** return the number of unicode characters in pZ up to (but not including) -** the first 0x00 byte. If nByte is not less than zero, return the -** number of unicode characters in the first nByte of pZ (or up to -** the first 0x00, whichever comes first). -*/ -int sqlite3utf8CharLen(const char *z, int nByte){ - int r = 0; - const char *zTerm; - if( nByte>=0 ){ - zTerm = &z[nByte]; - }else{ - zTerm = (const char *)(-1); - } - assert( z<=zTerm ); - while( *z!=0 && z<zTerm ){ - SKIP_UTF8(z); - r++; - } - return r; -} - -#ifndef SQLITE_OMIT_UTF16 -/* -** pZ is a UTF-16 encoded unicode string. If nChar is less than zero, -** return the number of bytes up to (but not including), the first pair -** of consecutive 0x00 bytes in pZ. If nChar is not less than zero, -** then return the number of bytes in the first nChar unicode characters -** in pZ (or up until the first pair of 0x00 bytes, whichever comes first). -*/ -int sqlite3utf16ByteLen(const void *zIn, int nChar){ - int c = 1; - char const *z = zIn; - int n = 0; - if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){ - while( c && ((nChar<0) || n<nChar) ){ - READ_UTF16BE(z, c); - n++; - } - }else{ - while( c && ((nChar<0) || n<nChar) ){ - READ_UTF16LE(z, c); - n++; - } - } - return (z-(char const *)zIn)-((c==0)?2:0); -} - -/* -** UTF-16 implementation of the substr() -*/ -void sqlite3utf16Substr( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int y, z; - unsigned char const *zStr; - unsigned char const *zStrEnd; - unsigned char const *zStart; - unsigned char const *zEnd; - int i; - - zStr = (unsigned char const *)sqlite3_value_text16(argv[0]); - zStrEnd = &zStr[sqlite3_value_bytes16(argv[0])]; - y = sqlite3_value_int(argv[1]); - z = sqlite3_value_int(argv[2]); - - if( y>0 ){ - y = y-1; - zStart = zStr; - if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){ - for(i=0; i<y && zStart<zStrEnd; i++) SKIP_UTF16BE(zStart); - }else{ - for(i=0; i<y && zStart<zStrEnd; i++) SKIP_UTF16LE(zStart); - } - }else{ - zStart = zStrEnd; - if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){ - for(i=y; i<0 && zStart>zStr; i++) RSKIP_UTF16BE(zStart); - }else{ - for(i=y; i<0 && zStart>zStr; i++) RSKIP_UTF16LE(zStart); - } - for(; i<0; i++) z -= 1; - } - - zEnd = zStart; - if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){ - for(i=0; i<z && zEnd<zStrEnd; i++) SKIP_UTF16BE(zEnd); - }else{ - for(i=0; i<z && zEnd<zStrEnd; i++) SKIP_UTF16LE(zEnd); - } - - sqlite3_result_text16(context, zStart, zEnd-zStart, SQLITE_TRANSIENT); -} - -#if defined(SQLITE_TEST) -/* -** This routine is called from the TCL test function "translate_selftest". -** It checks that the primitives for serializing and deserializing -** characters in each encoding are inverses of each other. -*/ -void sqlite3utfSelfTest(){ - int i; - unsigned char zBuf[20]; - unsigned char *z; - int n; - int c; - - for(i=0; i<0x00110000; i++){ - z = zBuf; - WRITE_UTF8(z, i); - n = z-zBuf; - z = zBuf; - READ_UTF8(z, c); - assert( c==i ); - assert( (z-zBuf)==n ); - } - for(i=0; i<0x00110000; i++){ - if( i>=0xD800 && i<=0xE000 ) continue; - z = zBuf; - WRITE_UTF16LE(z, i); - n = z-zBuf; - z = zBuf; - READ_UTF16LE(z, c); - assert( c==i ); - assert( (z-zBuf)==n ); - } - for(i=0; i<0x00110000; i++){ - if( i>=0xD800 && i<=0xE000 ) continue; - z = zBuf; - WRITE_UTF16BE(z, i); - n = z-zBuf; - z = zBuf; - READ_UTF16BE(z, c); - assert( c==i ); - assert( (z-zBuf)==n ); - } -} -#endif /* SQLITE_TEST */ -#endif /* SQLITE_OMIT_UTF16 */ diff --git a/ext/pdo_sqlite/sqlite/src/util.c b/ext/pdo_sqlite/sqlite/src/util.c deleted file mode 100644 index de716d9820cdf..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/util.c +++ /dev/null @@ -1,1005 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Utility functions used throughout sqlite. -** -** This file contains functions for allocating memory, comparing -** strings, and stuff like that. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include <stdarg.h> -#include <ctype.h> - -#if SQLITE_MEMDEBUG>2 && defined(__GLIBC__) -#include <execinfo.h> -void print_stack_trace(){ - void *bt[30]; - int i; - int n = backtrace(bt, 30); - - fprintf(stderr, "STACK: "); - for(i=0; i<n;i++){ - fprintf(stderr, "%p ", bt[i]); - } - fprintf(stderr, "\n"); -} -#else -#define print_stack_trace() -#endif - -/* -** If malloc() ever fails, this global variable gets set to 1. -** This causes the library to abort and never again function. -*/ -int sqlite3_malloc_failed = 0; - -/* -** If SQLITE_MEMDEBUG is defined, then use versions of malloc() and -** free() that track memory usage and check for buffer overruns. -*/ -#ifdef SQLITE_MEMDEBUG - -/* -** For keeping track of the number of mallocs and frees. This -** is used to check for memory leaks. The iMallocFail and iMallocReset -** values are used to simulate malloc() failures during testing in -** order to verify that the library correctly handles an out-of-memory -** condition. -*/ -int sqlite3_nMalloc; /* Number of sqliteMalloc() calls */ -int sqlite3_nFree; /* Number of sqliteFree() calls */ -int sqlite3_memUsed; /* Total memory obtained from malloc */ -int sqlite3_memMax; /* Mem usage high-water mark */ -int sqlite3_iMallocFail; /* Fail sqliteMalloc() after this many calls */ -int sqlite3_iMallocReset = -1; /* When iMallocFail reaches 0, set to this */ -#if SQLITE_MEMDEBUG>1 -static int memcnt = 0; -#endif - -/* -** Number of 32-bit guard words. This should probably be a multiple of -** 2 since on 64-bit machines we want the value returned by sqliteMalloc() -** to be 8-byte aligned. -*/ -#define N_GUARD 2 - -/* -** Check for a simulated memory allocation failure. Return true if -** the failure should be simulated. Return false to proceed as normal. -*/ -static int simulatedMallocFailure(int n, char *zFile, int line){ - if( sqlite3_iMallocFail>=0 ){ - sqlite3_iMallocFail--; - if( sqlite3_iMallocFail==0 ){ - sqlite3_malloc_failed++; -#if SQLITE_MEMDEBUG>1 - fprintf(stderr,"**** failed to allocate %d bytes at %s:%d\n", - n, zFile,line); -#endif - sqlite3_iMallocFail = sqlite3_iMallocReset; - return 1; - } - } - return 0; -} - -/* -** Allocate new memory and set it to zero. Return NULL if -** no memory is available. -*/ -void *sqlite3Malloc_(int n, int bZero, char *zFile, int line){ - void *p; - int *pi; - int i, k; - if( n==0 ){ - return 0; - } - if( simulatedMallocFailure(n, zFile, line) ){ - return 0; - } - sqlite3_memUsed += n; - if( sqlite3_memMax<sqlite3_memUsed ) sqlite3_memMax = sqlite3_memUsed; - k = (n+sizeof(int)-1)/sizeof(int); - pi = malloc( (N_GUARD*2+1+k)*sizeof(int)); - if( pi==0 ){ - if( n>0 ) sqlite3_malloc_failed++; - return 0; - } - sqlite3_nMalloc++; - for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122; - pi[N_GUARD] = n; - for(i=0; i<N_GUARD; i++) pi[k+1+N_GUARD+i] = 0xdead3344; - p = &pi[N_GUARD+1]; - memset(p, bZero==0, n); -#if SQLITE_MEMDEBUG>1 - print_stack_trace(); - fprintf(stderr,"%06d malloc %d bytes at 0x%x from %s:%d\n", - ++memcnt, n, (int)p, zFile,line); -#endif - return p; -} - -/* -** This version of malloc is always a real function, never a macro -*/ -void *sqlite3MallocX(int n){ - return sqlite3Malloc_(n, 0, __FILE__, __LINE__); -} - -/* -** Check to see if the given pointer was obtained from sqliteMalloc() -** and is able to hold at least N bytes. Raise an exception if this -** is not the case. -** -** This routine is used for testing purposes only. -*/ -void sqlite3CheckMemory(void *p, int N){ - int *pi = p; - int n, i, k; - pi -= N_GUARD+1; - for(i=0; i<N_GUARD; i++){ - assert( pi[i]==0xdead1122 ); - } - n = pi[N_GUARD]; - assert( N>=0 && N<n ); - k = (n+sizeof(int)-1)/sizeof(int); - for(i=0; i<N_GUARD; i++){ - assert( pi[k+N_GUARD+1+i]==0xdead3344 ); - } -} - -/* -** Free memory previously obtained from sqliteMalloc() -*/ -void sqlite3Free_(void *p, char *zFile, int line){ - if( p ){ - int *pi, i, k, n; - pi = p; - pi -= N_GUARD+1; - sqlite3_nFree++; - for(i=0; i<N_GUARD; i++){ - if( pi[i]!=0xdead1122 ){ - fprintf(stderr,"Low-end memory corruption at 0x%x\n", (int)p); - return; - } - } - n = pi[N_GUARD]; - sqlite3_memUsed -= n; - k = (n+sizeof(int)-1)/sizeof(int); - for(i=0; i<N_GUARD; i++){ - if( pi[k+N_GUARD+1+i]!=0xdead3344 ){ - fprintf(stderr,"High-end memory corruption at 0x%x\n", (int)p); - return; - } - } - memset(pi, 0xff, (k+N_GUARD*2+1)*sizeof(int)); -#if SQLITE_MEMDEBUG>1 - fprintf(stderr,"%06d free %d bytes at 0x%x from %s:%d\n", - ++memcnt, n, (int)p, zFile,line); -#endif - free(pi); - } -} - -/* -** Resize a prior allocation. If p==0, then this routine -** works just like sqliteMalloc(). If n==0, then this routine -** works just like sqliteFree(). -*/ -void *sqlite3Realloc_(void *oldP, int n, char *zFile, int line){ - int *oldPi, *pi, i, k, oldN, oldK; - void *p; - if( oldP==0 ){ - return sqlite3Malloc_(n,1,zFile,line); - } - if( n==0 ){ - sqlite3Free_(oldP,zFile,line); - return 0; - } - if( simulatedMallocFailure(n, zFile, line) ){ - return 0; - } - oldPi = oldP; - oldPi -= N_GUARD+1; - if( oldPi[0]!=0xdead1122 ){ - fprintf(stderr,"Low-end memory corruption in realloc at 0x%x\n", (int)oldP); - return 0; - } - oldN = oldPi[N_GUARD]; - sqlite3_memUsed -= oldN; - oldK = (oldN+sizeof(int)-1)/sizeof(int); - for(i=0; i<N_GUARD; i++){ - if( oldPi[oldK+N_GUARD+1+i]!=0xdead3344 ){ - fprintf(stderr,"High-end memory corruption in realloc at 0x%x\n", - (int)oldP); - return 0; - } - } - k = (n + sizeof(int) - 1)/sizeof(int); - pi = malloc( (k+N_GUARD*2+1)*sizeof(int) ); - if( pi==0 ){ - if( n>0 ) sqlite3_malloc_failed++; - return 0; - } - for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122; - pi[N_GUARD] = n; - sqlite3_memUsed += n; - if( sqlite3_memMax<sqlite3_memUsed ) sqlite3_memMax = sqlite3_memUsed; - for(i=0; i<N_GUARD; i++) pi[k+N_GUARD+1+i] = 0xdead3344; - p = &pi[N_GUARD+1]; - memcpy(p, oldP, n>oldN ? oldN : n); - if( n>oldN ){ - memset(&((char*)p)[oldN], 0x55, n-oldN); - } - memset(oldPi, 0xab, (oldK+N_GUARD+2)*sizeof(int)); - free(oldPi); -#if SQLITE_MEMDEBUG>1 - print_stack_trace(); - fprintf(stderr,"%06d realloc %d to %d bytes at 0x%x to 0x%x at %s:%d\n", - ++memcnt, oldN, n, (int)oldP, (int)p, zFile, line); -#endif - return p; -} - -/* -** Make a copy of a string in memory obtained from sqliteMalloc() -*/ -char *sqlite3StrDup_(const char *z, char *zFile, int line){ - char *zNew; - if( z==0 ) return 0; - zNew = sqlite3Malloc_(strlen(z)+1, 0, zFile, line); - if( zNew ) strcpy(zNew, z); - return zNew; -} -char *sqlite3StrNDup_(const char *z, int n, char *zFile, int line){ - char *zNew; - if( z==0 ) return 0; - zNew = sqlite3Malloc_(n+1, 0, zFile, line); - if( zNew ){ - memcpy(zNew, z, n); - zNew[n] = 0; - } - return zNew; -} - -/* -** A version of sqliteFree that is always a function, not a macro. -*/ -void sqlite3FreeX(void *p){ - sqliteFree(p); -} -#endif /* SQLITE_MEMDEBUG */ - -/* -** The following versions of malloc() and free() are for use in a -** normal build. -*/ -#if !defined(SQLITE_MEMDEBUG) - -/* -** Allocate new memory and set it to zero. Return NULL if -** no memory is available. See also sqliteMallocRaw(). -*/ -void *sqlite3Malloc(int n){ - void *p; - if( n==0 ) return 0; - if( (p = malloc(n))==0 ){ - if( n>0 ) sqlite3_malloc_failed++; - }else{ - memset(p, 0, n); - } - return p; -} - -/* -** Allocate new memory but do not set it to zero. Return NULL if -** no memory is available. See also sqliteMalloc(). -*/ -void *sqlite3MallocRaw(int n){ - void *p; - if( n==0 ) return 0; - if( (p = malloc(n))==0 ){ - if( n>0 ) sqlite3_malloc_failed++; - } - return p; -} - -/* -** Free memory previously obtained from sqliteMalloc() -*/ -void sqlite3FreeX(void *p){ - if( p ){ - free(p); - } -} - -/* -** Resize a prior allocation. If p==0, then this routine -** works just like sqliteMalloc(). If n==0, then this routine -** works just like sqliteFree(). -*/ -void *sqlite3Realloc(void *p, int n){ - void *p2; - if( p==0 ){ - return sqliteMalloc(n); - } - if( n==0 ){ - sqliteFree(p); - return 0; - } - p2 = realloc(p, n); - if( p2==0 ){ - if( n>0 ) sqlite3_malloc_failed++; - } - return p2; -} - -/* -** Make a copy of a string in memory obtained from sqliteMalloc() -*/ -char *sqlite3StrDup(const char *z){ - char *zNew; - if( z==0 ) return 0; - zNew = sqliteMallocRaw(strlen(z)+1); - if( zNew ) strcpy(zNew, z); - return zNew; -} -char *sqlite3StrNDup(const char *z, int n){ - char *zNew; - if( z==0 ) return 0; - zNew = sqliteMallocRaw(n+1); - if( zNew ){ - memcpy(zNew, z, n); - zNew[n] = 0; - } - return zNew; -} -#endif /* !defined(SQLITE_MEMDEBUG) */ - -/* -** Reallocate a buffer to a different size. This is similar to -** sqliteRealloc() except that if the allocation fails the buffer -** is freed. -*/ -void sqlite3ReallocOrFree(void **ppBuf, int newSize){ - void *pNew = sqliteRealloc(*ppBuf, newSize); - if( pNew==0 ){ - sqliteFree(*ppBuf); - } - *ppBuf = pNew; -} - -/* -** Create a string from the 2nd and subsequent arguments (up to the -** first NULL argument), store the string in memory obtained from -** sqliteMalloc() and make the pointer indicated by the 1st argument -** point to that string. The 1st argument must either be NULL or -** point to memory obtained from sqliteMalloc(). -*/ -void sqlite3SetString(char **pz, ...){ - va_list ap; - int nByte; - const char *z; - char *zResult; - - if( pz==0 ) return; - nByte = 1; - va_start(ap, pz); - while( (z = va_arg(ap, const char*))!=0 ){ - nByte += strlen(z); - } - va_end(ap); - sqliteFree(*pz); - *pz = zResult = sqliteMallocRaw( nByte ); - if( zResult==0 ){ - return; - } - *zResult = 0; - va_start(ap, pz); - while( (z = va_arg(ap, const char*))!=0 ){ - strcpy(zResult, z); - zResult += strlen(zResult); - } - va_end(ap); -#ifdef SQLITE_MEMDEBUG -#if SQLITE_MEMDEBUG>1 - fprintf(stderr,"string at 0x%x is %s\n", (int)*pz, *pz); -#endif -#endif -} - -/* -** Set the most recent error code and error string for the sqlite -** handle "db". The error code is set to "err_code". -** -** If it is not NULL, string zFormat specifies the format of the -** error string in the style of the printf functions: The following -** format characters are allowed: -** -** %s Insert a string -** %z A string that should be freed after use -** %d Insert an integer -** %T Insert a token -** %S Insert the first element of a SrcList -** -** zFormat and any string tokens that follow it are assumed to be -** encoded in UTF-8. -** -** To clear the most recent error for sqlite handle "db", sqlite3Error -** should be called with err_code set to SQLITE_OK and zFormat set -** to NULL. -*/ -void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){ - if( db && (db->pErr || (db->pErr = sqlite3ValueNew())) ){ - db->errCode = err_code; - if( zFormat ){ - char *z; - va_list ap; - va_start(ap, zFormat); - z = sqlite3VMPrintf(zFormat, ap); - va_end(ap); - sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, sqlite3FreeX); - }else{ - sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC); - } - } -} - -/* -** Add an error message to pParse->zErrMsg and increment pParse->nErr. -** The following formatting characters are allowed: -** -** %s Insert a string -** %z A string that should be freed after use -** %d Insert an integer -** %T Insert a token -** %S Insert the first element of a SrcList -** -** This function should be used to report any error that occurs whilst -** compiling an SQL statement (i.e. within sqlite3_prepare()). The -** last thing the sqlite3_prepare() function does is copy the error -** stored by this function into the database handle using sqlite3Error(). -** Function sqlite3Error() should be used during statement execution -** (sqlite3_step() etc.). -*/ -void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ - va_list ap; - pParse->nErr++; - sqliteFree(pParse->zErrMsg); - va_start(ap, zFormat); - pParse->zErrMsg = sqlite3VMPrintf(zFormat, ap); - va_end(ap); -} - -/* -** Convert an SQL-style quoted string into a normal string by removing -** the quote characters. The conversion is done in-place. If the -** input does not begin with a quote character, then this routine -** is a no-op. -** -** 2002-Feb-14: This routine is extended to remove MS-Access style -** brackets from around identifers. For example: "[a-b-c]" becomes -** "a-b-c". -*/ -void sqlite3Dequote(char *z){ - int quote; - int i, j; - if( z==0 ) return; - quote = z[0]; - switch( quote ){ - case '\'': break; - case '"': break; - case '`': break; /* For MySQL compatibility */ - case '[': quote = ']'; break; /* For MS SqlServer compatibility */ - default: return; - } - for(i=1, j=0; z[i]; i++){ - if( z[i]==quote ){ - if( z[i+1]==quote ){ - z[j++] = quote; - i++; - }else{ - z[j++] = 0; - break; - } - }else{ - z[j++] = z[i]; - } - } -} - -/* An array to map all upper-case characters into their corresponding -** lower-case character. -*/ -const unsigned char sqlite3UpperToLower[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121, - 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107, - 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125, - 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161, - 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179, - 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197, - 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215, - 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233, - 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251, - 252,253,254,255 -}; -#define UpperToLower sqlite3UpperToLower - -/* -** Some systems have stricmp(). Others have strcasecmp(). Because -** there is no consistency, we will define our own. -*/ -int sqlite3StrICmp(const char *zLeft, const char *zRight){ - register unsigned char *a, *b; - a = (unsigned char *)zLeft; - b = (unsigned char *)zRight; - while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } - return UpperToLower[*a] - UpperToLower[*b]; -} -int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){ - register unsigned char *a, *b; - a = (unsigned char *)zLeft; - b = (unsigned char *)zRight; - while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } - return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b]; -} - -/* -** Return TRUE if z is a pure numeric string. Return FALSE if the -** string contains any character which is not part of a number. If -** the string is numeric and contains the '.' character, set *realnum -** to TRUE (otherwise FALSE). -** -** An empty string is considered non-numeric. -*/ -int sqlite3IsNumber(const char *z, int *realnum, u8 enc){ - int incr = (enc==SQLITE_UTF8?1:2); - if( enc==SQLITE_UTF16BE ) z++; - if( *z=='-' || *z=='+' ) z += incr; - if( !isdigit(*(u8*)z) ){ - return 0; - } - z += incr; - if( realnum ) *realnum = 0; - while( isdigit(*(u8*)z) ){ z += incr; } - if( *z=='.' ){ - z += incr; - if( !isdigit(*(u8*)z) ) return 0; - while( isdigit(*(u8*)z) ){ z += incr; } - if( realnum ) *realnum = 1; - } - if( *z=='e' || *z=='E' ){ - z += incr; - if( *z=='+' || *z=='-' ) z += incr; - if( !isdigit(*(u8*)z) ) return 0; - while( isdigit(*(u8*)z) ){ z += incr; } - if( realnum ) *realnum = 1; - } - return *z==0; -} - -/* -** The string z[] is an ascii representation of a real number. -** Convert this string to a double. -** -** This routine assumes that z[] really is a valid number. If it -** is not, the result is undefined. -** -** This routine is used instead of the library atof() function because -** the library atof() might want to use "," as the decimal point instead -** of "." depending on how locale is set. But that would cause problems -** for SQL. So this routine always uses "." regardless of locale. -*/ -int sqlite3AtoF(const char *z, double *pResult){ - int sign = 1; - const char *zBegin = z; - LONGDOUBLE_TYPE v1 = 0.0; - if( *z=='-' ){ - sign = -1; - z++; - }else if( *z=='+' ){ - z++; - } - while( isdigit(*(u8*)z) ){ - v1 = v1*10.0 + (*z - '0'); - z++; - } - if( *z=='.' ){ - LONGDOUBLE_TYPE divisor = 1.0; - z++; - while( isdigit(*(u8*)z) ){ - v1 = v1*10.0 + (*z - '0'); - divisor *= 10.0; - z++; - } - v1 /= divisor; - } - if( *z=='e' || *z=='E' ){ - int esign = 1; - int eval = 0; - LONGDOUBLE_TYPE scale = 1.0; - z++; - if( *z=='-' ){ - esign = -1; - z++; - }else if( *z=='+' ){ - z++; - } - while( isdigit(*(u8*)z) ){ - eval = eval*10 + *z - '0'; - z++; - } - while( eval>=64 ){ scale *= 1.0e+64; eval -= 64; } - while( eval>=16 ){ scale *= 1.0e+16; eval -= 16; } - while( eval>=4 ){ scale *= 1.0e+4; eval -= 4; } - while( eval>=1 ){ scale *= 1.0e+1; eval -= 1; } - if( esign<0 ){ - v1 /= scale; - }else{ - v1 *= scale; - } - } - *pResult = sign<0 ? -v1 : v1; - return z - zBegin; -} - -/* -** Return TRUE if zNum is a 64-bit signed integer and write -** the value of the integer into *pNum. If zNum is not an integer -** or is an integer that is too large to be expressed with 64 bits, -** then return false. If n>0 and the integer is string is not -** exactly n bytes long, return false. -** -** When this routine was originally written it dealt with only -** 32-bit numbers. At that time, it was much faster than the -** atoi() library routine in RedHat 7.2. -*/ -int sqlite3atoi64(const char *zNum, i64 *pNum){ - i64 v = 0; - int neg; - int i, c; - if( *zNum=='-' ){ - neg = 1; - zNum++; - }else if( *zNum=='+' ){ - neg = 0; - zNum++; - }else{ - neg = 0; - } - for(i=0; (c=zNum[i])>='0' && c<='9'; i++){ - v = v*10 + c - '0'; - } - *pNum = neg ? -v : v; - return c==0 && i>0 && - (i<19 || (i==19 && memcmp(zNum,"9223372036854775807",19)<=0)); -} - -/* -** The string zNum represents an integer. There might be some other -** information following the integer too, but that part is ignored. -** If the integer that the prefix of zNum represents will fit in a -** 32-bit signed integer, return TRUE. Otherwise return FALSE. -** -** This routine returns FALSE for the string -2147483648 even that -** that number will in fact fit in a 32-bit integer. But positive -** 2147483648 will not fit in 32 bits. So it seems safer to return -** false. -*/ -static int sqlite3FitsIn32Bits(const char *zNum){ - int i, c; - if( *zNum=='-' || *zNum=='+' ) zNum++; - for(i=0; (c=zNum[i])>='0' && c<='9'; i++){} - return i<10 || (i==10 && memcmp(zNum,"2147483647",10)<=0); -} - -/* -** If zNum represents an integer that will fit in 32-bits, then set -** *pValue to that integer and return true. Otherwise return false. -*/ -int sqlite3GetInt32(const char *zNum, int *pValue){ - if( sqlite3FitsIn32Bits(zNum) ){ - *pValue = atoi(zNum); - return 1; - } - return 0; -} - -/* -** The string zNum represents an integer. There might be some other -** information following the integer too, but that part is ignored. -** If the integer that the prefix of zNum represents will fit in a -** 64-bit signed integer, return TRUE. Otherwise return FALSE. -** -** This routine returns FALSE for the string -9223372036854775808 even that -** that number will, in theory fit in a 64-bit integer. Positive -** 9223373036854775808 will not fit in 64 bits. So it seems safer to return -** false. -*/ -int sqlite3FitsIn64Bits(const char *zNum){ - int i, c; - if( *zNum=='-' || *zNum=='+' ) zNum++; - for(i=0; (c=zNum[i])>='0' && c<='9'; i++){} - return i<19 || (i==19 && memcmp(zNum,"9223372036854775807",19)<=0); -} - - -/* -** Change the sqlite.magic from SQLITE_MAGIC_OPEN to SQLITE_MAGIC_BUSY. -** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN -** when this routine is called. -** -** This routine is a attempt to detect if two threads use the -** same sqlite* pointer at the same time. There is a race -** condition so it is possible that the error is not detected. -** But usually the problem will be seen. The result will be an -** error which can be used to debug the application that is -** using SQLite incorrectly. -** -** Ticket #202: If db->magic is not a valid open value, take care not -** to modify the db structure at all. It could be that db is a stale -** pointer. In other words, it could be that there has been a prior -** call to sqlite3_close(db) and db has been deallocated. And we do -** not want to write into deallocated memory. -*/ -int sqlite3SafetyOn(sqlite3 *db){ - if( db->magic==SQLITE_MAGIC_OPEN ){ - db->magic = SQLITE_MAGIC_BUSY; - return 0; - }else if( db->magic==SQLITE_MAGIC_BUSY ){ - db->magic = SQLITE_MAGIC_ERROR; - db->flags |= SQLITE_Interrupt; - } - return 1; -} - -/* -** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN. -** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY -** when this routine is called. -*/ -int sqlite3SafetyOff(sqlite3 *db){ - if( db->magic==SQLITE_MAGIC_BUSY ){ - db->magic = SQLITE_MAGIC_OPEN; - return 0; - }else if( db->magic==SQLITE_MAGIC_OPEN ){ - db->magic = SQLITE_MAGIC_ERROR; - db->flags |= SQLITE_Interrupt; - } - return 1; -} - -/* -** Check to make sure we have a valid db pointer. This test is not -** foolproof but it does provide some measure of protection against -** misuse of the interface such as passing in db pointers that are -** NULL or which have been previously closed. If this routine returns -** TRUE it means that the db pointer is invalid and should not be -** dereferenced for any reason. The calling function should invoke -** SQLITE_MISUSE immediately. -*/ -int sqlite3SafetyCheck(sqlite3 *db){ - int magic; - if( db==0 ) return 1; - magic = db->magic; - if( magic!=SQLITE_MAGIC_CLOSED && - magic!=SQLITE_MAGIC_OPEN && - magic!=SQLITE_MAGIC_BUSY ) return 1; - return 0; -} - -/* -** The variable-length integer encoding is as follows: -** -** KEY: -** A = 0xxxxxxx 7 bits of data and one flag bit -** B = 1xxxxxxx 7 bits of data and one flag bit -** C = xxxxxxxx 8 bits of data -** -** 7 bits - A -** 14 bits - BA -** 21 bits - BBA -** 28 bits - BBBA -** 35 bits - BBBBA -** 42 bits - BBBBBA -** 49 bits - BBBBBBA -** 56 bits - BBBBBBBA -** 64 bits - BBBBBBBBC -*/ - -/* -** Write a 64-bit variable-length integer to memory starting at p[0]. -** The length of data write will be between 1 and 9 bytes. The number -** of bytes written is returned. -** -** A variable-length integer consists of the lower 7 bits of each byte -** for all bytes that have the 8th bit set and one byte with the 8th -** bit clear. Except, if we get to the 9th byte, it stores the full -** 8 bits and is the last byte. -*/ -int sqlite3PutVarint(unsigned char *p, u64 v){ - int i, j, n; - u8 buf[10]; - if( v & (((u64)0xff000000)<<32) ){ - p[8] = v; - v >>= 8; - for(i=7; i>=0; i--){ - p[i] = (v & 0x7f) | 0x80; - v >>= 7; - } - return 9; - } - n = 0; - do{ - buf[n++] = (v & 0x7f) | 0x80; - v >>= 7; - }while( v!=0 ); - buf[0] &= 0x7f; - assert( n<=9 ); - for(i=0, j=n-1; j>=0; j--, i++){ - p[i] = buf[j]; - } - return n; -} - -/* -** Read a 64-bit variable-length integer from memory starting at p[0]. -** Return the number of bytes read. The value is stored in *v. -*/ -int sqlite3GetVarint(const unsigned char *p, u64 *v){ - u32 x; - u64 x64; - int n; - unsigned char c; - if( ((c = p[0]) & 0x80)==0 ){ - *v = c; - return 1; - } - x = c & 0x7f; - if( ((c = p[1]) & 0x80)==0 ){ - *v = (x<<7) | c; - return 2; - } - x = (x<<7) | (c&0x7f); - if( ((c = p[2]) & 0x80)==0 ){ - *v = (x<<7) | c; - return 3; - } - x = (x<<7) | (c&0x7f); - if( ((c = p[3]) & 0x80)==0 ){ - *v = (x<<7) | c; - return 4; - } - x64 = (x<<7) | (c&0x7f); - n = 4; - do{ - c = p[n++]; - if( n==9 ){ - x64 = (x64<<8) | c; - break; - } - x64 = (x64<<7) | (c&0x7f); - }while( (c & 0x80)!=0 ); - *v = x64; - return n; -} - -/* -** Read a 32-bit variable-length integer from memory starting at p[0]. -** Return the number of bytes read. The value is stored in *v. -*/ -int sqlite3GetVarint32(const unsigned char *p, u32 *v){ - u32 x; - int n; - unsigned char c; - if( ((signed char*)p)[0]>=0 ){ - *v = p[0]; - return 1; - } - x = p[0] & 0x7f; - if( ((signed char*)p)[1]>=0 ){ - *v = (x<<7) | p[1]; - return 2; - } - x = (x<<7) | (p[1] & 0x7f); - n = 2; - do{ - x = (x<<7) | ((c = p[n++])&0x7f); - }while( (c & 0x80)!=0 && n<9 ); - *v = x; - return n; -} - -/* -** Return the number of bytes that will be needed to store the given -** 64-bit integer. -*/ -int sqlite3VarintLen(u64 v){ - int i = 0; - do{ - i++; - v >>= 7; - }while( v!=0 && i<9 ); - return i; -} - -#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) \ - || defined(SQLITE_TEST) -/* -** Translate a single byte of Hex into an integer. -*/ -static int hexToInt(int h){ - if( h>='0' && h<='9' ){ - return h - '0'; - }else if( h>='a' && h<='f' ){ - return h - 'a' + 10; - }else{ - assert( h>='A' && h<='F' ); - return h - 'A' + 10; - } -} -#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC || SQLITE_TEST */ - -#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) -/* -** Convert a BLOB literal of the form "x'hhhhhh'" into its binary -** value. Return a pointer to its binary value. Space to hold the -** binary value has been obtained from malloc and must be freed by -** the calling routine. -*/ -void *sqlite3HexToBlob(const char *z){ - char *zBlob; - int i; - int n = strlen(z); - if( n%2 ) return 0; - - zBlob = (char *)sqliteMalloc(n/2); - for(i=0; i<n; i+=2){ - zBlob[i/2] = (hexToInt(z[i])<<4) | hexToInt(z[i+1]); - } - return zBlob; -} -#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */ - -#if defined(SQLITE_TEST) -/* -** Convert text generated by the "%p" conversion format back into -** a pointer. -*/ -void *sqlite3TextToPtr(const char *z){ - void *p; - u64 v; - u32 v2; - if( z[0]=='0' && z[1]=='x' ){ - z += 2; - } - v = 0; - while( *z ){ - v = (v<<4) + hexToInt(*z); - z++; - } - if( sizeof(p)==sizeof(v) ){ - p = *(void**)&v; - }else{ - assert( sizeof(p)==sizeof(v2) ); - v2 = (u32)v; - p = *(void**)&v2; - } - return p; -} -#endif diff --git a/ext/pdo_sqlite/sqlite/src/vacuum.c b/ext/pdo_sqlite/sqlite/src/vacuum.c deleted file mode 100644 index 8254528d9d2fa..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vacuum.c +++ /dev/null @@ -1,310 +0,0 @@ -/* -** 2003 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the VACUUM command. -** -** Most of the code in this file may be omitted by defining the -** SQLITE_OMIT_VACUUM macro. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" - -#ifndef SQLITE_OMIT_VACUUM -/* -** Generate a random name of 20 character in length. -*/ -static void randomName(unsigned char *zBuf){ - static const unsigned char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "0123456789"; - int i; - sqlite3Randomness(20, zBuf); - for(i=0; i<20; i++){ - zBuf[i] = zChars[ zBuf[i]%(sizeof(zChars)-1) ]; - } -} - -/* -** Execute zSql on database db. Return an error code. -*/ -static int execSql(sqlite3 *db, const char *zSql){ - sqlite3_stmt *pStmt; - if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){ - return sqlite3_errcode(db); - } - while( SQLITE_ROW==sqlite3_step(pStmt) ); - return sqlite3_finalize(pStmt); -} - -/* -** Execute zSql on database db. The statement returns exactly -** one column. Execute this as SQL on the same database. -*/ -static int execExecSql(sqlite3 *db, const char *zSql){ - sqlite3_stmt *pStmt; - int rc; - - rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); - if( rc!=SQLITE_OK ) return rc; - - while( SQLITE_ROW==sqlite3_step(pStmt) ){ - rc = execSql(db, sqlite3_column_text(pStmt, 0)); - if( rc!=SQLITE_OK ){ - sqlite3_finalize(pStmt); - return rc; - } - } - - return sqlite3_finalize(pStmt); -} - -#endif - -/* -** The non-standard VACUUM command is used to clean up the database, -** collapse free space, etc. It is modelled after the VACUUM command -** in PostgreSQL. -** -** In version 1.0.x of SQLite, the VACUUM command would call -** gdbm_reorganize() on all the database tables. But beginning -** with 2.0.0, SQLite no longer uses GDBM so this command has -** become a no-op. -*/ -void sqlite3Vacuum(Parse *pParse, Token *pTableName){ - Vdbe *v = sqlite3GetVdbe(pParse); - if( v ){ - sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0); - } - return; -} - -/* -** This routine implements the OP_Vacuum opcode of the VDBE. -*/ -int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ - int rc = SQLITE_OK; /* Return code from service routines */ -#ifndef SQLITE_OMIT_VACUUM - const char *zFilename; /* full pathname of the database file */ - int nFilename; /* number of characters in zFilename[] */ - char *zTemp = 0; /* a temporary file in same directory as zFilename */ - Btree *pMain; /* The database being vacuumed */ - Btree *pTemp; - char *zSql = 0; - int writeschema_flag; /* Saved value of the write-schema flag */ - - /* Save the current value of the write-schema flag before setting it. */ - writeschema_flag = db->flags&SQLITE_WriteSchema; - db->flags |= SQLITE_WriteSchema; - - if( !db->autoCommit ){ - sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction", - (char*)0); - rc = SQLITE_ERROR; - goto end_of_vacuum; - } - - /* Get the full pathname of the database file and create a - ** temporary filename in the same directory as the original file. - */ - pMain = db->aDb[0].pBt; - zFilename = sqlite3BtreeGetFilename(pMain); - assert( zFilename ); - if( zFilename[0]=='\0' ){ - /* The in-memory database. Do nothing. Return directly to avoid causing - ** an error trying to DETACH the vacuum_db (which never got attached) - ** in the exit-handler. - */ - return SQLITE_OK; - } - nFilename = strlen(zFilename); - zTemp = sqliteMalloc( nFilename+100 ); - if( zTemp==0 ){ - rc = SQLITE_NOMEM; - goto end_of_vacuum; - } - strcpy(zTemp, zFilename); - - /* The randomName() procedure in the following loop uses an excellent - ** source of randomness to generate a name from a space of 1.3e+31 - ** possibilities. So unless the directory already contains on the order - ** of 1.3e+31 files, the probability that the following loop will - ** run more than once or twice is vanishingly small. We are certain - ** enough that this loop will always terminate (and terminate quickly) - ** that we don't even bother to set a maximum loop count. - */ - do { - zTemp[nFilename] = '-'; - randomName((unsigned char*)&zTemp[nFilename+1]); - } while( sqlite3OsFileExists(zTemp) ); - - /* Attach the temporary database as 'vacuum_db'. The synchronous pragma - ** can be set to 'off' for this file, as it is not recovered if a crash - ** occurs anyway. The integrity of the database is maintained by a - ** (possibly synchronous) transaction opened on the main database before - ** sqlite3BtreeCopyFile() is called. - ** - ** An optimisation would be to use a non-journaled pager. - */ - zSql = sqlite3MPrintf("ATTACH '%q' AS vacuum_db;", zTemp); - if( !zSql ){ - rc = SQLITE_NOMEM; - goto end_of_vacuum; - } - rc = execSql(db, zSql); - sqliteFree(zSql); - zSql = 0; - if( rc!=SQLITE_OK ) goto end_of_vacuum; - assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); - pTemp = db->aDb[db->nDb-1].pBt; - sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), - sqlite3BtreeGetReserve(pMain)); - assert( sqlite3BtreeGetPageSize(pTemp)==sqlite3BtreeGetPageSize(pMain) ); - execSql(db, "PRAGMA vacuum_db.synchronous=OFF"); - -#ifndef SQLITE_OMIT_AUTOVACUUM - sqlite3BtreeSetAutoVacuum(pTemp, sqlite3BtreeGetAutoVacuum(pMain)); -#endif - - /* Begin a transaction */ - rc = execSql(db, "BEGIN;"); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - /* Query the schema of the main database. Create a mirror schema - ** in the temporary database. - */ - rc = execExecSql(db, - "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14,100000000) " - " FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'"); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, - "SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14,100000000)" - " FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' "); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, - "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21,100000000) " - " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'"); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, - "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) " - " FROM sqlite_master WHERE type='view'" - ); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - /* Loop through the tables in the main database. For each, do - ** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy - ** the contents to the temporary database. - */ - rc = execExecSql(db, - "SELECT 'INSERT INTO vacuum_db.' || quote(name) " - "|| ' SELECT * FROM ' || quote(name) || ';'" - "FROM sqlite_master " - "WHERE type = 'table' AND name!='sqlite_sequence';" - ); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - /* Copy over the sequence table - */ - rc = execExecSql(db, - "SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' " - "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' " - ); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, - "SELECT 'INSERT INTO vacuum_db.' || quote(name) " - "|| ' SELECT * FROM ' || quote(name) || ';' " - "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';" - ); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - - /* Copy the triggers from the main database to the temporary database. - ** This was deferred before in case the triggers interfered with copying - ** the data. It's possible the indices should be deferred until this - ** point also. - */ - rc = execExecSql(db, - "SELECT 'CREATE TRIGGER vacuum_db.' || substr(sql, 16, 1000000) " - "FROM sqlite_master WHERE type='trigger'" - ); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - - /* At this point, unless the main db was completely empty, there is now a - ** transaction open on the vacuum database, but not on the main database. - ** Open a btree level transaction on the main database. This allows a - ** call to sqlite3BtreeCopyFile(). The main database btree level - ** transaction is then committed, so the SQL level never knows it was - ** opened for writing. This way, the SQL transaction used to create the - ** temporary database never needs to be committed. - */ - if( sqlite3BtreeIsInTrans(pTemp) ){ - u32 meta; - int i; - - /* This array determines which meta meta values are preserved in the - ** vacuum. Even entries are the meta value number and odd entries - ** are an increment to apply to the meta value after the vacuum. - ** The increment is used to increase the schema cookie so that other - ** connections to the same database will know to reread the schema. - */ - static const unsigned char aCopy[] = { - 1, 1, /* Add one to the old schema cookie */ - 3, 0, /* Preserve the default page cache size */ - 5, 0, /* Preserve the default text encoding */ - 6, 0, /* Preserve the user version */ - }; - - assert( 0==sqlite3BtreeIsInTrans(pMain) ); - rc = sqlite3BtreeBeginTrans(pMain, 1); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - /* Copy Btree meta values */ - for(i=0; i<sizeof(aCopy)/sizeof(aCopy[0]); i+=2){ - rc = sqlite3BtreeGetMeta(pMain, aCopy[i], &meta); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = sqlite3BtreeUpdateMeta(pTemp, aCopy[i], meta+aCopy[i+1]); - } - - rc = sqlite3BtreeCopyFile(pMain, pTemp); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = sqlite3BtreeCommit(pMain); - } - -end_of_vacuum: - /* Restore the original value of the write-schema flag. */ - db->flags &= ~SQLITE_WriteSchema; - db->flags |= writeschema_flag; - - /* Currently there is an SQL level transaction open on the vacuum - ** database. No locks are held on any other files (since the main file - ** was committed at the btree level). So it safe to end the transaction - ** by manually setting the autoCommit flag to true and detaching the - ** vacuum database. The vacuum_db journal file is deleted when the pager - ** is closed by the DETACH. - */ - db->autoCommit = 1; - if( rc==SQLITE_OK ){ - rc = execSql(db, "DETACH vacuum_db;"); - }else{ - execSql(db, "DETACH vacuum_db;"); - } - if( zTemp ){ - sqlite3OsDelete(zTemp); - sqliteFree(zTemp); - } - if( zSql ) sqliteFree( zSql ); - sqlite3ResetInternalSchema(db, 0); -#endif - - return rc; -} diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.c b/ext/pdo_sqlite/sqlite/src/vdbe.c deleted file mode 100644 index a3c3cd11f087e..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbe.c +++ /dev/null @@ -1,4432 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** The code in this file implements execution method of the -** Virtual Database Engine (VDBE). A separate file ("vdbeaux.c") -** handles housekeeping details such as creating and deleting -** VDBE instances. This file is solely interested in executing -** the VDBE program. -** -** In the external interface, an "sqlite3_stmt*" is an opaque pointer -** to a VDBE. -** -** The SQL parser generates a program which is then executed by -** the VDBE to do the work of the SQL statement. VDBE programs are -** similar in form to assembly language. The program consists of -** a linear sequence of operations. Each operation has an opcode -** and 3 operands. Operands P1 and P2 are integers. Operand P3 -** is a null-terminated string. The P2 operand must be non-negative. -** Opcodes will typically ignore one or more operands. Many opcodes -** ignore all three operands. -** -** Computation results are stored on a stack. Each entry on the -** stack is either an integer, a null-terminated string, a floating point -** number, or the SQL "NULL" value. An inplicit conversion from one -** type to the other occurs as necessary. -** -** Most of the code in this file is taken up by the sqlite3VdbeExec() -** function which does the work of interpreting a VDBE program. -** But other routines are also provided to help in building up -** a program instruction by instruction. -** -** Various scripts scan this source file in order to generate HTML -** documentation, headers files, or other derived files. The formatting -** of the code in this file is, therefore, important. See other comments -** in this file for details. If in doubt, do not deviate from existing -** commenting and indentation practices when changing or adding code. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> -#include "vdbeInt.h" - -/* -** The following global variable is incremented every time a cursor -** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test -** procedures use this information to make sure that indices are -** working correctly. This variable has no function other than to -** help verify the correct operation of the library. -*/ -int sqlite3_search_count = 0; - -/* -** When this global variable is positive, it gets decremented once before -** each instruction in the VDBE. When reaches zero, the SQLITE_Interrupt -** of the db.flags field is set in order to simulate and interrupt. -** -** This facility is used for testing purposes only. It does not function -** in an ordinary build. -*/ -int sqlite3_interrupt_count = 0; - -/* -** The next global variable is incremented each type the OP_Sort opcode -** is executed. The test procedures use this information to make sure that -** sorting is occurring or not occuring at appropriate times. This variable -** has no function other than to help verify the correct operation of the -** library. -*/ -int sqlite3_sort_count = 0; - -/* -** Release the memory associated with the given stack level. This -** leaves the Mem.flags field in an inconsistent state. -*/ -#define Release(P) if((P)->flags&MEM_Dyn){ sqlite3VdbeMemRelease(P); } - -/* -** Convert the given stack entity into a string if it isn't one -** already. Return non-zero if a malloc() fails. -*/ -#define Stringify(P, enc) \ - if(((P)->flags&(MEM_Str|MEM_Blob))==0 && sqlite3VdbeMemStringify(P,enc)) \ - { goto no_mem; } - -/* -** Convert the given stack entity into a string that has been obtained -** from sqliteMalloc(). This is different from Stringify() above in that -** Stringify() will use the NBFS bytes of static string space if the string -** will fit but this routine always mallocs for space. -** Return non-zero if we run out of memory. -*/ -#define Dynamicify(P,enc) sqlite3VdbeMemDynamicify(P) - - -/* -** An ephemeral string value (signified by the MEM_Ephem flag) contains -** a pointer to a dynamically allocated string where some other entity -** is responsible for deallocating that string. Because the stack entry -** does not control the string, it might be deleted without the stack -** entry knowing it. -** -** This routine converts an ephemeral string into a dynamically allocated -** string that the stack entry itself controls. In other words, it -** converts an MEM_Ephem string into an MEM_Dyn string. -*/ -#define Deephemeralize(P) \ - if( ((P)->flags&MEM_Ephem)!=0 \ - && sqlite3VdbeMemMakeWriteable(P) ){ goto no_mem;} - -/* -** Convert the given stack entity into a integer if it isn't one -** already. -** -** Any prior string or real representation is invalidated. -** NULLs are converted into 0. -*/ -#define Integerify(P) sqlite3VdbeMemIntegerify(P) - -/* -** Convert P so that it has type MEM_Real. -** -** Any prior string or integer representation is invalidated. -** NULLs are converted into 0.0. -*/ -#define Realify(P) sqlite3VdbeMemRealify(P) - -/* -** Argument pMem points at a memory cell that will be passed to a -** user-defined function or returned to the user as the result of a query. -** The second argument, 'db_enc' is the text encoding used by the vdbe for -** stack variables. This routine sets the pMem->enc and pMem->type -** variables used by the sqlite3_value_*() routines. -*/ -#define storeTypeInfo(A,B) _storeTypeInfo(A) -static void _storeTypeInfo(Mem *pMem){ - int flags = pMem->flags; - if( flags & MEM_Null ){ - pMem->type = SQLITE_NULL; - } - else if( flags & MEM_Int ){ - pMem->type = SQLITE_INTEGER; - } - else if( flags & MEM_Real ){ - pMem->type = SQLITE_FLOAT; - } - else if( flags & MEM_Str ){ - pMem->type = SQLITE_TEXT; - }else{ - pMem->type = SQLITE_BLOB; - } -} - -/* -** Pop the stack N times. -*/ -static void popStack(Mem **ppTos, int N){ - Mem *pTos = *ppTos; - while( N>0 ){ - N--; - Release(pTos); - pTos--; - } - *ppTos = pTos; -} - -/* -** Allocate cursor number iCur. Return a pointer to it. Return NULL -** if we run out of memory. -*/ -static Cursor *allocateCursor(Vdbe *p, int iCur){ - Cursor *pCx; - assert( iCur<p->nCursor ); - if( p->apCsr[iCur] ){ - sqlite3VdbeFreeCursor(p->apCsr[iCur]); - } - p->apCsr[iCur] = pCx = sqliteMalloc( sizeof(Cursor) ); - return pCx; -} - -/* -** Apply any conversion required by the supplied column affinity to -** memory cell pRec. affinity may be one of: -** -** SQLITE_AFF_NUMERIC -** SQLITE_AFF_TEXT -** SQLITE_AFF_NONE -** SQLITE_AFF_INTEGER -** -*/ -static void applyAffinity(Mem *pRec, char affinity, u8 enc){ - if( affinity==SQLITE_AFF_NONE ){ - /* do nothing */ - }else if( affinity==SQLITE_AFF_TEXT ){ - /* Only attempt the conversion to TEXT if there is an integer or real - ** representation (blob and NULL do not get converted) but no string - ** representation. - */ - if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){ - sqlite3VdbeMemStringify(pRec, enc); - } - pRec->flags &= ~(MEM_Real|MEM_Int); - }else{ - if( 0==(pRec->flags&(MEM_Real|MEM_Int)) ){ - /* pRec does not have a valid integer or real representation. - ** Attempt a conversion if pRec has a string representation and - ** it looks like a number. - */ - int realnum; - sqlite3VdbeMemNulTerminate(pRec); - if( pRec->flags&MEM_Str && sqlite3IsNumber(pRec->z, &realnum, enc) ){ - if( realnum ){ - Realify(pRec); - }else{ - Integerify(pRec); - } - } - } - - if( affinity==SQLITE_AFF_INTEGER ){ - /* For INTEGER affinity, try to convert a real value to an int */ - if( (pRec->flags&MEM_Real) && !(pRec->flags&MEM_Int) ){ - pRec->i = pRec->r; - if( ((double)pRec->i)==pRec->r ){ - pRec->flags |= MEM_Int; - } - } - } - } -} - -/* -** Exported version of applyAffinity(). This one works on sqlite3_value*, -** not the internal Mem* type. -*/ -void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){ - applyAffinity((Mem *)pVal, affinity, enc); -} - -#ifdef SQLITE_DEBUG -/* -** Write a nice string representation of the contents of cell pMem -** into buffer zBuf, length nBuf. -*/ -void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){ - char *zCsr = zBuf; - int f = pMem->flags; - - static const char *const encnames[] = {"(X)", "(8)", "(16LE)", "(16BE)"}; - - if( f&MEM_Blob ){ - int i; - char c; - if( f & MEM_Dyn ){ - c = 'z'; - assert( (f & (MEM_Static|MEM_Ephem))==0 ); - }else if( f & MEM_Static ){ - c = 't'; - assert( (f & (MEM_Dyn|MEM_Ephem))==0 ); - }else if( f & MEM_Ephem ){ - c = 'e'; - assert( (f & (MEM_Static|MEM_Dyn))==0 ); - }else{ - c = 's'; - } - - zCsr += sprintf(zCsr, "%c", c); - zCsr += sprintf(zCsr, "%d[", pMem->n); - for(i=0; i<16 && i<pMem->n; i++){ - zCsr += sprintf(zCsr, "%02X ", ((int)pMem->z[i] & 0xFF)); - } - for(i=0; i<16 && i<pMem->n; i++){ - char z = pMem->z[i]; - if( z<32 || z>126 ) *zCsr++ = '.'; - else *zCsr++ = z; - } - - zCsr += sprintf(zCsr, "]"); - *zCsr = '\0'; - }else if( f & MEM_Str ){ - int j, k; - zBuf[0] = ' '; - if( f & MEM_Dyn ){ - zBuf[1] = 'z'; - assert( (f & (MEM_Static|MEM_Ephem))==0 ); - }else if( f & MEM_Static ){ - zBuf[1] = 't'; - assert( (f & (MEM_Dyn|MEM_Ephem))==0 ); - }else if( f & MEM_Ephem ){ - zBuf[1] = 'e'; - assert( (f & (MEM_Static|MEM_Dyn))==0 ); - }else{ - zBuf[1] = 's'; - } - k = 2; - k += sprintf(&zBuf[k], "%d", pMem->n); - zBuf[k++] = '['; - for(j=0; j<15 && j<pMem->n; j++){ - u8 c = pMem->z[j]; - if( c>=0x20 && c<0x7f ){ - zBuf[k++] = c; - }else{ - zBuf[k++] = '.'; - } - } - zBuf[k++] = ']'; - k += sprintf(&zBuf[k], encnames[pMem->enc]); - zBuf[k++] = 0; - } -} -#endif - - -#ifdef VDBE_PROFILE -/* -** The following routine only works on pentium-class processors. -** It uses the RDTSC opcode to read the cycle count value out of the -** processor and returns that value. This can be used for high-res -** profiling. -*/ -__inline__ unsigned long long int hwtime(void){ - unsigned long long int x; - __asm__("rdtsc\n\t" - "mov %%edx, %%ecx\n\t" - :"=A" (x)); - return x; -} -#endif - -/* -** The CHECK_FOR_INTERRUPT macro defined here looks to see if the -** sqlite3_interrupt() routine has been called. If it has been, then -** processing of the VDBE program is interrupted. -** -** This macro added to every instruction that does a jump in order to -** implement a loop. This test used to be on every single instruction, -** but that meant we more testing that we needed. By only testing the -** flag on jump instructions, we get a (small) speed improvement. -*/ -#define CHECK_FOR_INTERRUPT \ - if( db->flags & SQLITE_Interrupt ) goto abort_due_to_interrupt; - - -/* -** Execute as much of a VDBE program as we can then return. -** -** sqlite3VdbeMakeReady() must be called before this routine in order to -** close the program with a final OP_Halt and to set up the callbacks -** and the error message pointer. -** -** Whenever a row or result data is available, this routine will either -** invoke the result callback (if there is one) or return with -** SQLITE_ROW. -** -** If an attempt is made to open a locked database, then this routine -** will either invoke the busy callback (if there is one) or it will -** return SQLITE_BUSY. -** -** If an error occurs, an error message is written to memory obtained -** from sqliteMalloc() and p->zErrMsg is made to point to that memory. -** The error code is stored in p->rc and this routine returns SQLITE_ERROR. -** -** If the callback ever returns non-zero, then the program exits -** immediately. There will be no error message but the p->rc field is -** set to SQLITE_ABORT and this routine will return SQLITE_ERROR. -** -** A memory allocation error causes p->rc to be set to SQLITE_NOMEM and this -** routine to return SQLITE_ERROR. -** -** Other fatal errors return SQLITE_ERROR. -** -** After this routine has finished, sqlite3VdbeFinalize() should be -** used to clean up the mess that was left behind. -*/ -int sqlite3VdbeExec( - Vdbe *p /* The VDBE */ -){ - int pc; /* The program counter */ - Op *pOp; /* Current operation */ - int rc = SQLITE_OK; /* Value to return */ - sqlite3 *db = p->db; /* The database */ - Mem *pTos; /* Top entry in the operand stack */ -#ifdef VDBE_PROFILE - unsigned long long start; /* CPU clock count at start of opcode */ - int origPc; /* Program counter at start of opcode */ -#endif -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - int nProgressOps = 0; /* Opcodes executed since progress callback. */ -#endif -#ifndef NDEBUG - Mem *pStackLimit; -#endif - - if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE; - assert( db->magic==SQLITE_MAGIC_BUSY ); - assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY ); - p->rc = SQLITE_OK; - assert( p->explain==0 ); - pTos = p->pTos; - if( sqlite3_malloc_failed ) goto no_mem; - if( p->popStack ){ - popStack(&pTos, p->popStack); - p->popStack = 0; - } - p->resOnStack = 0; - db->busyHandler.nBusy = 0; - CHECK_FOR_INTERRUPT; - for(pc=p->pc; rc==SQLITE_OK; pc++){ - assert( pc>=0 && pc<p->nOp ); - assert( pTos<=&p->aStack[pc] ); - if( sqlite3_malloc_failed ) goto no_mem; -#ifdef VDBE_PROFILE - origPc = pc; - start = hwtime(); -#endif - pOp = &p->aOp[pc]; - - /* Only allow tracing if SQLITE_DEBUG is defined. - */ -#ifdef SQLITE_DEBUG - if( p->trace ){ - if( pc==0 ){ - printf("VDBE Execution Trace:\n"); - sqlite3VdbePrintSql(p); - } - sqlite3VdbePrintOp(p->trace, pc, pOp); - } - if( p->trace==0 && pc==0 && sqlite3OsFileExists("vdbe_sqltrace") ){ - sqlite3VdbePrintSql(p); - } -#endif - - - /* Check to see if we need to simulate an interrupt. This only happens - ** if we have a special test build. - */ -#ifdef SQLITE_TEST - if( sqlite3_interrupt_count>0 ){ - sqlite3_interrupt_count--; - if( sqlite3_interrupt_count==0 ){ - sqlite3_interrupt(db); - } - } -#endif - -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - /* Call the progress callback if it is configured and the required number - ** of VDBE ops have been executed (either since this invocation of - ** sqlite3VdbeExec() or since last time the progress callback was called). - ** If the progress callback returns non-zero, exit the virtual machine with - ** a return code SQLITE_ABORT. - */ - if( db->xProgress ){ - if( db->nProgressOps==nProgressOps ){ - if( db->xProgress(db->pProgressArg)!=0 ){ - rc = SQLITE_ABORT; - continue; /* skip to the next iteration of the for loop */ - } - nProgressOps = 0; - } - nProgressOps++; - } -#endif - -#ifndef NDEBUG - /* This is to check that the return value of static function - ** opcodeNoPush() (see vdbeaux.c) returns values that match the - ** implementation of the virtual machine in this file. If - ** opcodeNoPush() returns non-zero, then the stack is guarenteed - ** not to grow when the opcode is executed. If it returns zero, then - ** the stack may grow by at most 1. - ** - ** The global wrapper function sqlite3VdbeOpcodeUsesStack() is not - ** available if NDEBUG is defined at build time. - */ - pStackLimit = pTos; - if( !sqlite3VdbeOpcodeNoPush(pOp->opcode) ){ - pStackLimit++; - } -#endif - - switch( pOp->opcode ){ - -/***************************************************************************** -** What follows is a massive switch statement where each case implements a -** separate instruction in the virtual machine. If we follow the usual -** indentation conventions, each case should be indented by 6 spaces. But -** that is a lot of wasted space on the left margin. So the code within -** the switch statement will break with convention and be flush-left. Another -** big comment (similar to this one) will mark the point in the code where -** we transition back to normal indentation. -** -** The formatting of each case is important. The makefile for SQLite -** generates two C files "opcodes.h" and "opcodes.c" by scanning this -** file looking for lines that begin with "case OP_". The opcodes.h files -** will be filled with #defines that give unique integer values to each -** opcode and the opcodes.c file is filled with an array of strings where -** each string is the symbolic name for the corresponding opcode. If the -** case statement is followed by a comment of the form "/# same as ... #/" -** that comment is used to determine the particular value of the opcode. -** -** If a comment on the same line as the "case OP_" construction contains -** the word "no-push", then the opcode is guarenteed not to grow the -** vdbe stack when it is executed. See function opcode() in -** vdbeaux.c for details. -** -** Documentation about VDBE opcodes is generated by scanning this file -** for lines of that contain "Opcode:". That line and all subsequent -** comment lines are used in the generation of the opcode.html documentation -** file. -** -** SUMMARY: -** -** Formatting is important to scripts that scan this file. -** Do not deviate from the formatting style currently in use. -** -*****************************************************************************/ - -/* Opcode: Goto * P2 * -** -** An unconditional jump to address P2. -** The next instruction executed will be -** the one at index P2 from the beginning of -** the program. -*/ -case OP_Goto: { /* no-push */ - CHECK_FOR_INTERRUPT; - pc = pOp->p2 - 1; - break; -} - -/* Opcode: Gosub * P2 * -** -** Push the current address plus 1 onto the return address stack -** and then jump to address P2. -** -** The return address stack is of limited depth. If too many -** OP_Gosub operations occur without intervening OP_Returns, then -** the return address stack will fill up and processing will abort -** with a fatal error. -*/ -case OP_Gosub: { /* no-push */ - assert( p->returnDepth<sizeof(p->returnStack)/sizeof(p->returnStack[0]) ); - p->returnStack[p->returnDepth++] = pc+1; - pc = pOp->p2 - 1; - break; -} - -/* Opcode: Return * * * -** -** Jump immediately to the next instruction after the last unreturned -** OP_Gosub. If an OP_Return has occurred for all OP_Gosubs, then -** processing aborts with a fatal error. -*/ -case OP_Return: { /* no-push */ - assert( p->returnDepth>0 ); - p->returnDepth--; - pc = p->returnStack[p->returnDepth] - 1; - break; -} - -/* Opcode: Halt P1 P2 P3 -** -** Exit immediately. All open cursors, Fifos, etc are closed -** automatically. -** -** P1 is the result code returned by sqlite3_exec(), sqlite3_reset(), -** or sqlite3_finalize(). For a normal halt, this should be SQLITE_OK (0). -** For errors, it can be some other value. If P1!=0 then P2 will determine -** whether or not to rollback the current transaction. Do not rollback -** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort, -** then back out all changes that have occurred during this execution of the -** VDBE, but do not rollback the transaction. -** -** If P3 is not null then it is an error message string. -** -** There is an implied "Halt 0 0 0" instruction inserted at the very end of -** every program. So a jump past the last instruction of the program -** is the same as executing Halt. -*/ -case OP_Halt: { /* no-push */ - p->pTos = pTos; - p->rc = pOp->p1; - p->pc = pc; - p->errorAction = pOp->p2; - if( pOp->p3 ){ - sqlite3SetString(&p->zErrMsg, pOp->p3, (char*)0); - } - rc = sqlite3VdbeHalt(p); - assert( rc==SQLITE_BUSY || rc==SQLITE_OK ); - if( rc==SQLITE_BUSY ){ - p->rc = SQLITE_BUSY; - return SQLITE_BUSY; - } - return p->rc ? SQLITE_ERROR : SQLITE_DONE; -} - -/* Opcode: Integer P1 * * -** -** The 32-bit integer value P1 is pushed onto the stack. -*/ -case OP_Integer: { - pTos++; - pTos->flags = MEM_Int; - pTos->i = pOp->p1; - break; -} - -/* Opcode: Int64 * * P3 -** -** P3 is a string representation of an integer. Convert that integer -** to a 64-bit value and push it onto the stack. -*/ -case OP_Int64: { - pTos++; - assert( pOp->p3!=0 ); - pTos->flags = MEM_Str|MEM_Static|MEM_Term; - pTos->z = pOp->p3; - pTos->n = strlen(pTos->z); - pTos->enc = SQLITE_UTF8; - pTos->i = sqlite3VdbeIntValue(pTos); - pTos->flags |= MEM_Int; - break; -} - -/* Opcode: Real * * P3 -** -** The string value P3 is converted to a real and pushed on to the stack. -*/ -case OP_Real: { /* same as TK_FLOAT, */ - pTos++; - pTos->flags = MEM_Str|MEM_Static|MEM_Term; - pTos->z = pOp->p3; - pTos->n = strlen(pTos->z); - pTos->enc = SQLITE_UTF8; - pTos->r = sqlite3VdbeRealValue(pTos); - pTos->flags |= MEM_Real; - sqlite3VdbeChangeEncoding(pTos, db->enc); - break; -} - -/* Opcode: String8 * * P3 -** -** P3 points to a nul terminated UTF-8 string. This opcode is transformed -** into an OP_String before it is executed for the first time. -*/ -case OP_String8: { /* same as TK_STRING */ -#ifndef SQLITE_OMIT_UTF16 - pOp->opcode = OP_String; - - assert( pOp->p3!=0 ); - if( db->enc!=SQLITE_UTF8 ){ - pTos++; - sqlite3VdbeMemSetStr(pTos, pOp->p3, -1, SQLITE_UTF8, SQLITE_STATIC); - if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pTos, db->enc) ) goto no_mem; - if( SQLITE_OK!=sqlite3VdbeMemDynamicify(pTos) ) goto no_mem; - pTos->flags &= ~(MEM_Dyn); - pTos->flags |= MEM_Static; - if( pOp->p3type==P3_DYNAMIC ){ - sqliteFree(pOp->p3); - } - pOp->p3type = P3_DYNAMIC; - pOp->p3 = pTos->z; - break; - } -#endif - /* Otherwise fall through to the next case, OP_String */ -} - -/* Opcode: String * * P3 -** -** The string value P3 is pushed onto the stack. If P3==0 then a -** NULL is pushed onto the stack. P3 is assumed to be a nul terminated -** string encoded with the database native encoding. -*/ -case OP_String: { - pTos++; - assert( pOp->p3!=0 ); - pTos->flags = MEM_Str|MEM_Static|MEM_Term; - pTos->z = pOp->p3; -#ifndef SQLITE_OMIT_UTF16 - if( db->enc==SQLITE_UTF8 ){ - pTos->n = strlen(pTos->z); - }else{ - pTos->n = sqlite3utf16ByteLen(pTos->z, -1); - } -#else - assert( db->enc==SQLITE_UTF8 ); - pTos->n = strlen(pTos->z); -#endif - pTos->enc = db->enc; - break; -} - -/* Opcode: Null * * * -** -** Push a NULL onto the stack. -*/ -case OP_Null: { - pTos++; - pTos->flags = MEM_Null; - pTos->n = 0; - break; -} - - -#ifndef SQLITE_OMIT_BLOB_LITERAL -/* Opcode: HexBlob * * P3 -** -** P3 is an UTF-8 SQL hex encoding of a blob. The blob is pushed onto the -** vdbe stack. -** -** The first time this instruction executes, in transforms itself into a -** 'Blob' opcode with a binary blob as P3. -*/ -case OP_HexBlob: { /* same as TK_BLOB */ - pOp->opcode = OP_Blob; - pOp->p1 = strlen(pOp->p3)/2; - if( pOp->p1 ){ - char *zBlob = sqlite3HexToBlob(pOp->p3); - if( !zBlob ) goto no_mem; - if( pOp->p3type==P3_DYNAMIC ){ - sqliteFree(pOp->p3); - } - pOp->p3 = zBlob; - pOp->p3type = P3_DYNAMIC; - }else{ - if( pOp->p3type==P3_DYNAMIC ){ - sqliteFree(pOp->p3); - } - pOp->p3type = P3_STATIC; - pOp->p3 = ""; - } - - /* Fall through to the next case, OP_Blob. */ -} - -/* Opcode: Blob P1 * P3 -** -** P3 points to a blob of data P1 bytes long. Push this -** value onto the stack. This instruction is not coded directly -** by the compiler. Instead, the compiler layer specifies -** an OP_HexBlob opcode, with the hex string representation of -** the blob as P3. This opcode is transformed to an OP_Blob -** the first time it is executed. -*/ -case OP_Blob: { - pTos++; - sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0); - break; -} -#endif /* SQLITE_OMIT_BLOB_LITERAL */ - -/* Opcode: Variable P1 * * -** -** Push the value of variable P1 onto the stack. A variable is -** an unknown in the original SQL string as handed to sqlite3_compile(). -** Any occurance of the '?' character in the original SQL is considered -** a variable. Variables in the SQL string are number from left to -** right beginning with 1. The values of variables are set using the -** sqlite3_bind() API. -*/ -case OP_Variable: { - int j = pOp->p1 - 1; - assert( j>=0 && j<p->nVar ); - - pTos++; - sqlite3VdbeMemShallowCopy(pTos, &p->aVar[j], MEM_Static); - break; -} - -/* Opcode: Pop P1 * * -** -** P1 elements are popped off of the top of stack and discarded. -*/ -case OP_Pop: { /* no-push */ - assert( pOp->p1>=0 ); - popStack(&pTos, pOp->p1); - assert( pTos>=&p->aStack[-1] ); - break; -} - -/* Opcode: Dup P1 P2 * -** -** A copy of the P1-th element of the stack -** is made and pushed onto the top of the stack. -** The top of the stack is element 0. So the -** instruction "Dup 0 0 0" will make a copy of the -** top of the stack. -** -** If the content of the P1-th element is a dynamically -** allocated string, then a new copy of that string -** is made if P2==0. If P2!=0, then just a pointer -** to the string is copied. -** -** Also see the Pull instruction. -*/ -case OP_Dup: { - Mem *pFrom = &pTos[-pOp->p1]; - assert( pFrom<=pTos && pFrom>=p->aStack ); - pTos++; - sqlite3VdbeMemShallowCopy(pTos, pFrom, MEM_Ephem); - if( pOp->p2 ){ - Deephemeralize(pTos); - } - break; -} - -/* Opcode: Pull P1 * * -** -** The P1-th element is removed from its current location on -** the stack and pushed back on top of the stack. The -** top of the stack is element 0, so "Pull 0 0 0" is -** a no-op. "Pull 1 0 0" swaps the top two elements of -** the stack. -** -** See also the Dup instruction. -*/ -case OP_Pull: { /* no-push */ - Mem *pFrom = &pTos[-pOp->p1]; - int i; - Mem ts; - - ts = *pFrom; - Deephemeralize(pTos); - for(i=0; i<pOp->p1; i++, pFrom++){ - Deephemeralize(&pFrom[1]); - assert( (pFrom->flags & MEM_Ephem)==0 ); - *pFrom = pFrom[1]; - if( pFrom->flags & MEM_Short ){ - assert( pFrom->flags & (MEM_Str|MEM_Blob) ); - assert( pFrom->z==pFrom[1].zShort ); - pFrom->z = pFrom->zShort; - } - } - *pTos = ts; - if( pTos->flags & MEM_Short ){ - assert( pTos->flags & (MEM_Str|MEM_Blob) ); - assert( pTos->z==pTos[-pOp->p1].zShort ); - pTos->z = pTos->zShort; - } - break; -} - -/* Opcode: Push P1 * * -** -** Overwrite the value of the P1-th element down on the -** stack (P1==0 is the top of the stack) with the value -** of the top of the stack. Then pop the top of the stack. -*/ -case OP_Push: { /* no-push */ - Mem *pTo = &pTos[-pOp->p1]; - - assert( pTo>=p->aStack ); - sqlite3VdbeMemMove(pTo, pTos); - pTos--; - break; -} - -/* Opcode: Callback P1 * * -** -** Pop P1 values off the stack and form them into an array. Then -** invoke the callback function using the newly formed array as the -** 3rd parameter. -*/ -case OP_Callback: { /* no-push */ - int i; - assert( p->nResColumn==pOp->p1 ); - - for(i=0; i<pOp->p1; i++){ - Mem *pVal = &pTos[0-i]; - sqlite3VdbeMemNulTerminate(pVal); - storeTypeInfo(pVal, db->enc); - } - - p->resOnStack = 1; - p->nCallback++; - p->popStack = pOp->p1; - p->pc = pc + 1; - p->pTos = pTos; - return SQLITE_ROW; -} - -/* Opcode: Concat P1 P2 * -** -** Look at the first P1+2 elements of the stack. Append them all -** together with the lowest element first. The original P1+2 elements -** are popped from the stack if P2==0 and retained if P2==1. If -** any element of the stack is NULL, then the result is NULL. -** -** When P1==1, this routine makes a copy of the top stack element -** into memory obtained from sqliteMalloc(). -*/ -case OP_Concat: { /* same as TK_CONCAT */ - char *zNew; - int nByte; - int nField; - int i, j; - Mem *pTerm; - - /* Loop through the stack elements to see how long the result will be. */ - nField = pOp->p1 + 2; - pTerm = &pTos[1-nField]; - nByte = 0; - for(i=0; i<nField; i++, pTerm++){ - assert( pOp->p2==0 || (pTerm->flags&MEM_Str) ); - if( pTerm->flags&MEM_Null ){ - nByte = -1; - break; - } - Stringify(pTerm, db->enc); - nByte += pTerm->n; - } - - if( nByte<0 ){ - /* If nByte is less than zero, then there is a NULL value on the stack. - ** In this case just pop the values off the stack (if required) and - ** push on a NULL. - */ - if( pOp->p2==0 ){ - popStack(&pTos, nField); - } - pTos++; - pTos->flags = MEM_Null; - }else{ - /* Otherwise malloc() space for the result and concatenate all the - ** stack values. - */ - zNew = sqliteMallocRaw( nByte+2 ); - if( zNew==0 ) goto no_mem; - j = 0; - pTerm = &pTos[1-nField]; - for(i=j=0; i<nField; i++, pTerm++){ - int n = pTerm->n; - assert( pTerm->flags & (MEM_Str|MEM_Blob) ); - memcpy(&zNew[j], pTerm->z, n); - j += n; - } - zNew[j] = 0; - zNew[j+1] = 0; - assert( j==nByte ); - - if( pOp->p2==0 ){ - popStack(&pTos, nField); - } - pTos++; - pTos->n = j; - pTos->flags = MEM_Str|MEM_Dyn|MEM_Term; - pTos->xDel = 0; - pTos->enc = db->enc; - pTos->z = zNew; - } - break; -} - -/* Opcode: Add * * * -** -** Pop the top two elements from the stack, add them together, -** and push the result back onto the stack. If either element -** is a string then it is converted to a double using the atof() -** function before the addition. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: Multiply * * * -** -** Pop the top two elements from the stack, multiply them together, -** and push the result back onto the stack. If either element -** is a string then it is converted to a double using the atof() -** function before the multiplication. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: Subtract * * * -** -** Pop the top two elements from the stack, subtract the -** first (what was on top of the stack) from the second (the -** next on stack) -** and push the result back onto the stack. If either element -** is a string then it is converted to a double using the atof() -** function before the subtraction. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: Divide * * * -** -** Pop the top two elements from the stack, divide the -** first (what was on top of the stack) from the second (the -** next on stack) -** and push the result back onto the stack. If either element -** is a string then it is converted to a double using the atof() -** function before the division. Division by zero returns NULL. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: Remainder * * * -** -** Pop the top two elements from the stack, divide the -** first (what was on top of the stack) from the second (the -** next on stack) -** and push the remainder after division onto the stack. If either element -** is a string then it is converted to a double using the atof() -** function before the division. Division by zero returns NULL. -** If either operand is NULL, the result is NULL. -*/ -case OP_Add: /* same as TK_PLUS, no-push */ -case OP_Subtract: /* same as TK_MINUS, no-push */ -case OP_Multiply: /* same as TK_STAR, no-push */ -case OP_Divide: /* same as TK_SLASH, no-push */ -case OP_Remainder: { /* same as TK_REM, no-push */ - Mem *pNos = &pTos[-1]; - assert( pNos>=p->aStack ); - if( ((pTos->flags | pNos->flags) & MEM_Null)!=0 ){ - Release(pTos); - pTos--; - Release(pTos); - pTos->flags = MEM_Null; - }else if( (pTos->flags & pNos->flags & MEM_Int)==MEM_Int ){ - i64 a, b; - a = pTos->i; - b = pNos->i; - switch( pOp->opcode ){ - case OP_Add: b += a; break; - case OP_Subtract: b -= a; break; - case OP_Multiply: b *= a; break; - case OP_Divide: { - if( a==0 ) goto divide_by_zero; - b /= a; - break; - } - default: { - if( a==0 ) goto divide_by_zero; - b %= a; - break; - } - } - Release(pTos); - pTos--; - Release(pTos); - pTos->i = b; - pTos->flags = MEM_Int; - }else{ - double a, b; - a = sqlite3VdbeRealValue(pTos); - b = sqlite3VdbeRealValue(pNos); - switch( pOp->opcode ){ - case OP_Add: b += a; break; - case OP_Subtract: b -= a; break; - case OP_Multiply: b *= a; break; - case OP_Divide: { - if( a==0.0 ) goto divide_by_zero; - b /= a; - break; - } - default: { - int ia = (int)a; - int ib = (int)b; - if( ia==0.0 ) goto divide_by_zero; - b = ib % ia; - break; - } - } - Release(pTos); - pTos--; - Release(pTos); - pTos->r = b; - pTos->flags = MEM_Real; - } - break; - -divide_by_zero: - Release(pTos); - pTos--; - Release(pTos); - pTos->flags = MEM_Null; - break; -} - -/* Opcode: CollSeq * * P3 -** -** P3 is a pointer to a CollSeq struct. If the next call to a user function -** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will -** be returned. This is used by the built-in min(), max() and nullif() -** functions. -** -** The interface used by the implementation of the aforementioned functions -** to retrieve the collation sequence set by this opcode is not available -** publicly, only to user functions defined in func.c. -*/ -case OP_CollSeq: { /* no-push */ - assert( pOp->p3type==P3_COLLSEQ ); - break; -} - -/* Opcode: Function P1 P2 P3 -** -** Invoke a user function (P3 is a pointer to a Function structure that -** defines the function) with P2 arguments taken from the stack. Pop all -** arguments from the stack and push back the result. -** -** P1 is a 32-bit bitmask indicating whether or not each argument to the -** function was determined to be constant at compile time. If the first -** argument was constant then bit 0 of P1 is set. This is used to determine -** whether meta data associated with a user function argument using the -** sqlite3_set_auxdata() API may be safely retained until the next -** invocation of this opcode. -** -** See also: AggStep and AggFinal -*/ -case OP_Function: { - int i; - Mem *pArg; - sqlite3_context ctx; - sqlite3_value **apVal; - int n = pOp->p2; - - apVal = p->apArg; - assert( apVal || n==0 ); - - pArg = &pTos[1-n]; - for(i=0; i<n; i++, pArg++){ - apVal[i] = pArg; - storeTypeInfo(pArg, db->enc); - } - - assert( pOp->p3type==P3_FUNCDEF || pOp->p3type==P3_VDBEFUNC ); - if( pOp->p3type==P3_FUNCDEF ){ - ctx.pFunc = (FuncDef*)pOp->p3; - ctx.pVdbeFunc = 0; - }else{ - ctx.pVdbeFunc = (VdbeFunc*)pOp->p3; - ctx.pFunc = ctx.pVdbeFunc->pFunc; - } - - ctx.s.flags = MEM_Null; - ctx.s.z = 0; - ctx.s.xDel = 0; - ctx.isError = 0; - if( ctx.pFunc->needCollSeq ){ - assert( pOp>p->aOp ); - assert( pOp[-1].p3type==P3_COLLSEQ ); - assert( pOp[-1].opcode==OP_CollSeq ); - ctx.pColl = (CollSeq *)pOp[-1].p3; - } - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; - (*ctx.pFunc->xFunc)(&ctx, n, apVal); - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; - if( sqlite3_malloc_failed ) goto no_mem; - popStack(&pTos, n); - - /* If any auxilary data functions have been called by this user function, - ** immediately call the destructor for any non-static values. - */ - if( ctx.pVdbeFunc ){ - sqlite3VdbeDeleteAuxData(ctx.pVdbeFunc, pOp->p1); - pOp->p3 = (char *)ctx.pVdbeFunc; - pOp->p3type = P3_VDBEFUNC; - } - - /* Copy the result of the function to the top of the stack */ - sqlite3VdbeChangeEncoding(&ctx.s, db->enc); - pTos++; - pTos->flags = 0; - sqlite3VdbeMemMove(pTos, &ctx.s); - - /* If the function returned an error, throw an exception */ - if( ctx.isError ){ - if( !(pTos->flags&MEM_Str) ){ - sqlite3SetString(&p->zErrMsg, "user function error", (char*)0); - }else{ - sqlite3SetString(&p->zErrMsg, sqlite3_value_text(pTos), (char*)0); - sqlite3VdbeChangeEncoding(pTos, db->enc); - } - rc = SQLITE_ERROR; - } - break; -} - -/* Opcode: BitAnd * * * -** -** Pop the top two elements from the stack. Convert both elements -** to integers. Push back onto the stack the bit-wise AND of the -** two elements. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: BitOr * * * -** -** Pop the top two elements from the stack. Convert both elements -** to integers. Push back onto the stack the bit-wise OR of the -** two elements. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: ShiftLeft * * * -** -** Pop the top two elements from the stack. Convert both elements -** to integers. Push back onto the stack the second element shifted -** left by N bits where N is the top element on the stack. -** If either operand is NULL, the result is NULL. -*/ -/* Opcode: ShiftRight * * * -** -** Pop the top two elements from the stack. Convert both elements -** to integers. Push back onto the stack the second element shifted -** right by N bits where N is the top element on the stack. -** If either operand is NULL, the result is NULL. -*/ -case OP_BitAnd: /* same as TK_BITAND, no-push */ -case OP_BitOr: /* same as TK_BITOR, no-push */ -case OP_ShiftLeft: /* same as TK_LSHIFT, no-push */ -case OP_ShiftRight: { /* same as TK_RSHIFT, no-push */ - Mem *pNos = &pTos[-1]; - int a, b; - - assert( pNos>=p->aStack ); - if( (pTos->flags | pNos->flags) & MEM_Null ){ - popStack(&pTos, 2); - pTos++; - pTos->flags = MEM_Null; - break; - } - a = sqlite3VdbeIntValue(pNos); - b = sqlite3VdbeIntValue(pTos); - switch( pOp->opcode ){ - case OP_BitAnd: a &= b; break; - case OP_BitOr: a |= b; break; - case OP_ShiftLeft: a <<= b; break; - case OP_ShiftRight: a >>= b; break; - default: /* CANT HAPPEN */ break; - } - Release(pTos); - pTos--; - Release(pTos); - pTos->i = a; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: AddImm P1 * * -** -** Add the value P1 to whatever is on top of the stack. The result -** is always an integer. -** -** To force the top of the stack to be an integer, just add 0. -*/ -case OP_AddImm: { /* no-push */ - assert( pTos>=p->aStack ); - Integerify(pTos); - pTos->i += pOp->p1; - break; -} - -/* Opcode: ForceInt P1 P2 * -** -** Convert the top of the stack into an integer. If the current top of -** the stack is not numeric (meaning that is is a NULL or a string that -** does not look like an integer or floating point number) then pop the -** stack and jump to P2. If the top of the stack is numeric then -** convert it into the least integer that is greater than or equal to its -** current value if P1==0, or to the least integer that is strictly -** greater than its current value if P1==1. -*/ -case OP_ForceInt: { /* no-push */ - i64 v; - assert( pTos>=p->aStack ); - applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc); - if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){ - Release(pTos); - pTos--; - pc = pOp->p2 - 1; - break; - } - if( pTos->flags & MEM_Int ){ - v = pTos->i + (pOp->p1!=0); - }else{ - Realify(pTos); - v = (int)pTos->r; - if( pTos->r>(double)v ) v++; - if( pOp->p1 && pTos->r==(double)v ) v++; - } - Release(pTos); - pTos->i = v; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: MustBeInt P1 P2 * -** -** Force the top of the stack to be an integer. If the top of the -** stack is not an integer and cannot be converted into an integer -** with out data loss, then jump immediately to P2, or if P2==0 -** raise an SQLITE_MISMATCH exception. -** -** If the top of the stack is not an integer and P2 is not zero and -** P1 is 1, then the stack is popped. In all other cases, the depth -** of the stack is unchanged. -*/ -case OP_MustBeInt: { /* no-push */ - assert( pTos>=p->aStack ); - applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc); - if( (pTos->flags & MEM_Int)==0 ){ - if( pOp->p2==0 ){ - rc = SQLITE_MISMATCH; - goto abort_due_to_error; - }else{ - if( pOp->p1 ) popStack(&pTos, 1); - pc = pOp->p2 - 1; - } - }else{ - Release(pTos); - pTos->flags = MEM_Int; - } - break; -} - -#ifndef SQLITE_OMIT_CAST -/* Opcode: ToInt * * * -** -** Force the value on the top of the stack to be an integer. If -** The value is currently a real number, drop its fractional part. -** If the value is text or blob, try to convert it to an integer using the -** equivalent of atoi() and store 0 if no such conversion is possible. -** -** A NULL value is not changed by this routine. It remains NULL. -*/ -case OP_ToInt: { /* no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; - assert( MEM_Str==(MEM_Blob>>3) ); - pTos->flags |= (pTos->flags&MEM_Blob)>>3; - applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc); - sqlite3VdbeMemIntegerify(pTos); - break; -} - -/* Opcode: ToNumeric * * * -** -** Force the value on the top of the stack to be numeric (either an -** integer or a floating-point number. -** If the value is text or blob, try to convert it to an using the -** equivalent of atoi() or atof() and store 0 if no such conversion -** is possible. -** -** A NULL value is not changed by this routine. It remains NULL. -*/ -case OP_ToNumeric: { /* no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; - assert( MEM_Str==(MEM_Blob>>3) ); - pTos->flags |= (pTos->flags&MEM_Blob)>>3; - applyAffinity(pTos, SQLITE_AFF_NUMERIC, db->enc); - if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){ - sqlite3VdbeMemRealify(pTos); - }else{ - sqlite3VdbeMemRelease(pTos); - } - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos->flags &= (MEM_Int|MEM_Real); - break; -} - -/* Opcode: ToText * * * -** -** Force the value on the top of the stack to be text. -** If the value is numeric, convert it to an using the -** equivalent of printf(). Blob values are unchanged and -** are afterwards simply interpreted as text. -** -** A NULL value is not changed by this routine. It remains NULL. -*/ -case OP_ToText: { /* no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; - assert( MEM_Str==(MEM_Blob>>3) ); - pTos->flags |= (pTos->flags&MEM_Blob)>>3; - applyAffinity(pTos, SQLITE_AFF_TEXT, db->enc); - assert( pTos->flags & MEM_Str ); - pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Blob); - break; -} - -/* Opcode: ToBlob * * * -** -** Force the value on the top of the stack to be a BLOB. -** If the value is numeric, convert it to a string first. -** Strings are simply reinterpreted as blobs with no change -** to the underlying data. -** -** A NULL value is not changed by this routine. It remains NULL. -*/ -case OP_ToBlob: { /* no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; - if( (pTos->flags & MEM_Blob)==0 ){ - applyAffinity(pTos, SQLITE_AFF_TEXT, db->enc); - assert( pTos->flags & MEM_Str ); - pTos->flags |= MEM_Blob; - } - pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Str); - break; -} -#endif /* SQLITE_OMIT_CAST */ - -/* Opcode: Eq P1 P2 P3 -** -** Pop the top two elements from the stack. If they are equal, then -** jump to instruction P2. Otherwise, continue to the next instruction. -** -** If the 0x100 bit of P1 is true and either operand is NULL then take the -** jump. If the 0x100 bit of P1 is clear then fall thru if either operand -** is NULL. -** -** If the 0x200 bit of P1 is set and either operand is NULL then -** both operands are converted to integers prior to comparison. -** NULL operands are converted to zero and non-NULL operands are -** converted to 1. Thus, for example, with 0x200 set, NULL==NULL is true -** whereas it would normally be NULL. Similarly, NULL==123 is false when -** 0x200 is set but is NULL when the 0x200 bit of P1 is clear. -** -** The least significant byte of P1 (mask 0xff) must be an affinity character - -** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values -** according to the affinity before the comparison is made. If the byte is -** 0x00, then numeric affinity is used. -** -** Once any conversions have taken place, and neither value is NULL, -** the values are compared. If both values are blobs, or both are text, -** then memcmp() is used to determine the results of the comparison. If -** both values are numeric, then a numeric comparison is used. If the -** two values are of different types, then they are inequal. -** -** If P2 is zero, do not jump. Instead, push an integer 1 onto the -** stack if the jump would have been taken, or a 0 if not. Push a -** NULL if either operand was NULL. -** -** If P3 is not NULL it is a pointer to a collating sequence (a CollSeq -** structure) that defines how to compare text. -*/ -/* Opcode: Ne P1 P2 P3 -** -** This works just like the Eq opcode except that the jump is taken if -** the operands from the stack are not equal. See the Eq opcode for -** additional information. -*/ -/* Opcode: Lt P1 P2 P3 -** -** This works just like the Eq opcode except that the jump is taken if -** the 2nd element down on the stack is less than the top of the stack. -** See the Eq opcode for additional information. -*/ -/* Opcode: Le P1 P2 P3 -** -** This works just like the Eq opcode except that the jump is taken if -** the 2nd element down on the stack is less than or equal to the -** top of the stack. See the Eq opcode for additional information. -*/ -/* Opcode: Gt P1 P2 P3 -** -** This works just like the Eq opcode except that the jump is taken if -** the 2nd element down on the stack is greater than the top of the stack. -** See the Eq opcode for additional information. -*/ -/* Opcode: Ge P1 P2 P3 -** -** This works just like the Eq opcode except that the jump is taken if -** the 2nd element down on the stack is greater than or equal to the -** top of the stack. See the Eq opcode for additional information. -*/ -case OP_Eq: /* same as TK_EQ, no-push */ -case OP_Ne: /* same as TK_NE, no-push */ -case OP_Lt: /* same as TK_LT, no-push */ -case OP_Le: /* same as TK_LE, no-push */ -case OP_Gt: /* same as TK_GT, no-push */ -case OP_Ge: { /* same as TK_GE, no-push */ - Mem *pNos; - int flags; - int res; - char affinity; - - pNos = &pTos[-1]; - flags = pTos->flags|pNos->flags; - - /* If either value is a NULL P2 is not zero, take the jump if the least - ** significant byte of P1 is true. If P2 is zero, then push a NULL onto - ** the stack. - */ - if( flags&MEM_Null ){ - if( (pOp->p1 & 0x200)!=0 ){ - /* The 0x200 bit of P1 means, roughly "do not treat NULL as the - ** magic SQL value it normally is - treat it as if it were another - ** integer". - ** - ** With 0x200 set, if either operand is NULL then both operands - ** are converted to integers prior to being passed down into the - ** normal comparison logic below. NULL operands are converted to - ** zero and non-NULL operands are converted to 1. Thus, for example, - ** with 0x200 set, NULL==NULL is true whereas it would normally - ** be NULL. Similarly, NULL!=123 is true. - */ - sqlite3VdbeMemSetInt64(pTos, (pTos->flags & MEM_Null)==0); - sqlite3VdbeMemSetInt64(pNos, (pNos->flags & MEM_Null)==0); - }else{ - /* If the 0x200 bit of P1 is clear and either operand is NULL then - ** the result is always NULL. The jump is taken if the 0x100 bit - ** of P1 is set. - */ - popStack(&pTos, 2); - if( pOp->p2 ){ - if( pOp->p1 & 0x100 ){ - pc = pOp->p2-1; - } - }else{ - pTos++; - pTos->flags = MEM_Null; - } - break; - } - } - - affinity = pOp->p1 & 0xFF; - if( affinity ){ - applyAffinity(pNos, affinity, db->enc); - applyAffinity(pTos, affinity, db->enc); - } - - assert( pOp->p3type==P3_COLLSEQ || pOp->p3==0 ); - res = sqlite3MemCompare(pNos, pTos, (CollSeq*)pOp->p3); - switch( pOp->opcode ){ - case OP_Eq: res = res==0; break; - case OP_Ne: res = res!=0; break; - case OP_Lt: res = res<0; break; - case OP_Le: res = res<=0; break; - case OP_Gt: res = res>0; break; - default: res = res>=0; break; - } - - popStack(&pTos, 2); - if( pOp->p2 ){ - if( res ){ - pc = pOp->p2-1; - } - }else{ - pTos++; - pTos->flags = MEM_Int; - pTos->i = res; - } - break; -} - -/* Opcode: And * * * -** -** Pop two values off the stack. Take the logical AND of the -** two values and push the resulting boolean value back onto the -** stack. -*/ -/* Opcode: Or * * * -** -** Pop two values off the stack. Take the logical OR of the -** two values and push the resulting boolean value back onto the -** stack. -*/ -case OP_And: /* same as TK_AND, no-push */ -case OP_Or: { /* same as TK_OR, no-push */ - Mem *pNos = &pTos[-1]; - int v1, v2; /* 0==TRUE, 1==FALSE, 2==UNKNOWN or NULL */ - - assert( pNos>=p->aStack ); - if( pTos->flags & MEM_Null ){ - v1 = 2; - }else{ - Integerify(pTos); - v1 = pTos->i==0; - } - if( pNos->flags & MEM_Null ){ - v2 = 2; - }else{ - Integerify(pNos); - v2 = pNos->i==0; - } - if( pOp->opcode==OP_And ){ - static const unsigned char and_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 }; - v1 = and_logic[v1*3+v2]; - }else{ - static const unsigned char or_logic[] = { 0, 0, 0, 0, 1, 2, 0, 2, 2 }; - v1 = or_logic[v1*3+v2]; - } - popStack(&pTos, 2); - pTos++; - if( v1==2 ){ - pTos->flags = MEM_Null; - }else{ - pTos->i = v1==0; - pTos->flags = MEM_Int; - } - break; -} - -/* Opcode: Negative * * * -** -** Treat the top of the stack as a numeric quantity. Replace it -** with its additive inverse. If the top of the stack is NULL -** its value is unchanged. -*/ -/* Opcode: AbsValue * * * -** -** Treat the top of the stack as a numeric quantity. Replace it -** with its absolute value. If the top of the stack is NULL -** its value is unchanged. -*/ -case OP_Negative: /* same as TK_UMINUS, no-push */ -case OP_AbsValue: { - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Real ){ - Release(pTos); - if( pOp->opcode==OP_Negative || pTos->r<0.0 ){ - pTos->r = -pTos->r; - } - pTos->flags = MEM_Real; - }else if( pTos->flags & MEM_Int ){ - Release(pTos); - if( pOp->opcode==OP_Negative || pTos->i<0 ){ - pTos->i = -pTos->i; - } - pTos->flags = MEM_Int; - }else if( pTos->flags & MEM_Null ){ - /* Do nothing */ - }else{ - Realify(pTos); - if( pOp->opcode==OP_Negative || pTos->r<0.0 ){ - pTos->r = -pTos->r; - } - pTos->flags = MEM_Real; - } - break; -} - -/* Opcode: Not * * * -** -** Interpret the top of the stack as a boolean value. Replace it -** with its complement. If the top of the stack is NULL its value -** is unchanged. -*/ -case OP_Not: { /* same as TK_NOT, no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */ - Integerify(pTos); - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos->i = !pTos->i; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: BitNot * * * -** -** Interpret the top of the stack as an value. Replace it -** with its ones-complement. If the top of the stack is NULL its -** value is unchanged. -*/ -case OP_BitNot: { /* same as TK_BITNOT, no-push */ - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */ - Integerify(pTos); - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos->i = ~pTos->i; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: Noop * * * -** -** Do nothing. This instruction is often useful as a jump -** destination. -*/ -/* -** The magic Explain opcode are only inserted when explain==2 (which -** is to say when the EXPLAIN QUERY PLAN syntax is used.) -** This opcode records information from the optimizer. It is the -** the same as a no-op. This opcodesnever appears in a real VM program. -*/ -case OP_Explain: -case OP_Noop: { /* no-push */ - break; -} - -/* Opcode: If P1 P2 * -** -** Pop a single boolean from the stack. If the boolean popped is -** true, then jump to p2. Otherwise continue to the next instruction. -** An integer is false if zero and true otherwise. A string is -** false if it has zero length and true otherwise. -** -** If the value popped of the stack is NULL, then take the jump if P1 -** is true and fall through if P1 is false. -*/ -/* Opcode: IfNot P1 P2 * -** -** Pop a single boolean from the stack. If the boolean popped is -** false, then jump to p2. Otherwise continue to the next instruction. -** An integer is false if zero and true otherwise. A string is -** false if it has zero length and true otherwise. -** -** If the value popped of the stack is NULL, then take the jump if P1 -** is true and fall through if P1 is false. -*/ -case OP_If: /* no-push */ -case OP_IfNot: { /* no-push */ - int c; - assert( pTos>=p->aStack ); - if( pTos->flags & MEM_Null ){ - c = pOp->p1; - }else{ -#ifdef SQLITE_OMIT_FLOATING_POINT - c = sqlite3VdbeIntValue(pTos); -#else - c = sqlite3VdbeRealValue(pTos)!=0.0; -#endif - if( pOp->opcode==OP_IfNot ) c = !c; - } - Release(pTos); - pTos--; - if( c ) pc = pOp->p2-1; - break; -} - -/* Opcode: IsNull P1 P2 * -** -** If any of the top abs(P1) values on the stack are NULL, then jump -** to P2. Pop the stack P1 times if P1>0. If P1<0 leave the stack -** unchanged. -*/ -case OP_IsNull: { /* same as TK_ISNULL, no-push */ - int i, cnt; - Mem *pTerm; - cnt = pOp->p1; - if( cnt<0 ) cnt = -cnt; - pTerm = &pTos[1-cnt]; - assert( pTerm>=p->aStack ); - for(i=0; i<cnt; i++, pTerm++){ - if( pTerm->flags & MEM_Null ){ - pc = pOp->p2-1; - break; - } - } - if( pOp->p1>0 ) popStack(&pTos, cnt); - break; -} - -/* Opcode: NotNull P1 P2 * -** -** Jump to P2 if the top P1 values on the stack are all not NULL. Pop the -** stack if P1 times if P1 is greater than zero. If P1 is less than -** zero then leave the stack unchanged. -*/ -case OP_NotNull: { /* same as TK_NOTNULL, no-push */ - int i, cnt; - cnt = pOp->p1; - if( cnt<0 ) cnt = -cnt; - assert( &pTos[1-cnt] >= p->aStack ); - for(i=0; i<cnt && (pTos[1+i-cnt].flags & MEM_Null)==0; i++){} - if( i>=cnt ) pc = pOp->p2-1; - if( pOp->p1>0 ) popStack(&pTos, cnt); - break; -} - -/* Opcode: SetNumColumns P1 P2 * -** -** Before the OP_Column opcode can be executed on a cursor, this -** opcode must be called to set the number of fields in the table. -** -** This opcode sets the number of columns for cursor P1 to P2. -** -** If OP_KeyAsData is to be applied to cursor P1, it must be executed -** before this op-code. -*/ -case OP_SetNumColumns: { /* no-push */ - Cursor *pC; - assert( (pOp->p1)<p->nCursor ); - assert( p->apCsr[pOp->p1]!=0 ); - pC = p->apCsr[pOp->p1]; - pC->nField = pOp->p2; - break; -} - -/* Opcode: Column P1 P2 P3 -** -** Interpret the data that cursor P1 points to as a structure built using -** the MakeRecord instruction. (See the MakeRecord opcode for additional -** information about the format of the data.) Push onto the stack the value -** of the P2-th column contained in the data. If there are less that (P2+1) -** values in the record, push a NULL onto the stack. -** -** If the KeyAsData opcode has previously executed on this cursor, then the -** field might be extracted from the key rather than the data. -** -** If P1 is negative, then the record is stored on the stack rather than in -** a table. For P1==-1, the top of the stack is used. For P1==-2, the -** next on the stack is used. And so forth. The value pushed is always -** just a pointer into the record which is stored further down on the -** stack. The column value is not copied. The number of columns in the -** record is stored on the stack just above the record itself. -** -** If the column contains fewer than P2 fields, then push a NULL. Or -** if P3 is of type P3_MEM, then push the P3 value. The P3 value will -** be default value for a column that has been added using the ALTER TABLE -** ADD COLUMN command. If P3 is an ordinary string, just push a NULL. -** When P3 is a string it is really just a comment describing the value -** to be pushed, not a default value. -*/ -case OP_Column: { - u32 payloadSize; /* Number of bytes in the record */ - int p1 = pOp->p1; /* P1 value of the opcode */ - int p2 = pOp->p2; /* column number to retrieve */ - Cursor *pC = 0; /* The VDBE cursor */ - char *zRec; /* Pointer to complete record-data */ - BtCursor *pCrsr; /* The BTree cursor */ - u32 *aType; /* aType[i] holds the numeric type of the i-th column */ - u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */ - u32 nField; /* number of fields in the record */ - u32 szHdr; /* Number of bytes in the record header */ - int len; /* The length of the serialized data for the column */ - int offset = 0; /* Offset into the data */ - int idx; /* Index into the header */ - int i; /* Loop counter */ - char *zData; /* Part of the record being decoded */ - Mem sMem; /* For storing the record being decoded */ - - sMem.flags = 0; - assert( p1<p->nCursor ); - pTos++; - pTos->flags = MEM_Null; - - /* This block sets the variable payloadSize to be the total number of - ** bytes in the record. - ** - ** zRec is set to be the complete text of the record if it is available. - ** The complete record text is always available for pseudo-tables and - ** when we are decoded a record from the stack. If the record is stored - ** in a cursor, the complete record text might be available in the - ** pC->aRow cache. Or it might not be. If the data is unavailable, - ** zRec is set to NULL. - ** - ** We also compute the number of columns in the record. For cursors, - ** the number of columns is stored in the Cursor.nField element. For - ** records on the stack, the next entry down on the stack is an integer - ** which is the number of records. - */ - assert( p1<0 || p->apCsr[p1]!=0 ); - if( p1<0 ){ - /* Take the record off of the stack */ - Mem *pRec = &pTos[p1]; - Mem *pCnt = &pRec[-1]; - assert( pRec>=p->aStack ); - assert( pRec->flags & MEM_Blob ); - payloadSize = pRec->n; - zRec = pRec->z; - assert( pCnt>=p->aStack ); - assert( pCnt->flags & MEM_Int ); - nField = pCnt->i; - pCrsr = 0; - }else if( (pC = p->apCsr[p1])->pCursor!=0 ){ - /* The record is stored in a B-Tree */ - rc = sqlite3VdbeCursorMoveto(pC); - if( rc ) goto abort_due_to_error; - zRec = 0; - pCrsr = pC->pCursor; - if( pC->nullRow ){ - payloadSize = 0; - }else if( pC->cacheValid ){ - payloadSize = pC->payloadSize; - zRec = pC->aRow; - }else if( pC->isIndex ){ - i64 payloadSize64; - sqlite3BtreeKeySize(pCrsr, &payloadSize64); - payloadSize = payloadSize64; - }else{ - sqlite3BtreeDataSize(pCrsr, &payloadSize); - } - nField = pC->nField; -#ifndef SQLITE_OMIT_TRIGGER - }else if( pC->pseudoTable ){ - /* The record is the sole entry of a pseudo-table */ - payloadSize = pC->nData; - zRec = pC->pData; - pC->cacheValid = 0; - assert( payloadSize==0 || zRec!=0 ); - nField = pC->nField; - pCrsr = 0; -#endif - }else{ - zRec = 0; - payloadSize = 0; - pCrsr = 0; - nField = 0; - } - - /* If payloadSize is 0, then just push a NULL onto the stack. */ - if( payloadSize==0 ){ - pTos->flags = MEM_Null; - break; - } - - assert( p2<nField ); - - /* Read and parse the table header. Store the results of the parse - ** into the record header cache fields of the cursor. - */ - if( pC && pC->cacheValid ){ - aType = pC->aType; - aOffset = pC->aOffset; - }else{ - int avail; /* Number of bytes of available data */ - if( pC && pC->aType ){ - aType = pC->aType; - }else{ - aType = sqliteMallocRaw( 2*nField*sizeof(aType) ); - } - aOffset = &aType[nField]; - if( aType==0 ){ - goto no_mem; - } - - /* Figure out how many bytes are in the header */ - if( zRec ){ - zData = zRec; - }else{ - if( pC->isIndex ){ - zData = (char*)sqlite3BtreeKeyFetch(pCrsr, &avail); - }else{ - zData = (char*)sqlite3BtreeDataFetch(pCrsr, &avail); - } - /* If KeyFetch()/DataFetch() managed to get the entire payload, - ** save the payload in the pC->aRow cache. That will save us from - ** having to make additional calls to fetch the content portion of - ** the record. - */ - if( avail>=payloadSize ){ - zRec = pC->aRow = zData; - }else{ - pC->aRow = 0; - } - } - idx = sqlite3GetVarint32(zData, &szHdr); - - - /* The KeyFetch() or DataFetch() above are fast and will get the entire - ** record header in most cases. But they will fail to get the complete - ** record header if the record header does not fit on a single page - ** in the B-Tree. When that happens, use sqlite3VdbeMemFromBtree() to - ** acquire the complete header text. - */ - if( !zRec && avail<szHdr ){ - rc = sqlite3VdbeMemFromBtree(pCrsr, 0, szHdr, pC->isIndex, &sMem); - if( rc!=SQLITE_OK ){ - goto op_column_out; - } - zData = sMem.z; - } - - /* Scan the header and use it to fill in the aType[] and aOffset[] - ** arrays. aType[i] will contain the type integer for the i-th - ** column and aOffset[i] will contain the offset from the beginning - ** of the record to the start of the data for the i-th column - */ - offset = szHdr; - assert( offset>0 ); - i = 0; - while( idx<szHdr && i<nField && offset<=payloadSize ){ - aOffset[i] = offset; - idx += sqlite3GetVarint32(&zData[idx], &aType[i]); - offset += sqlite3VdbeSerialTypeLen(aType[i]); - i++; - } - Release(&sMem); - sMem.flags = MEM_Null; - - /* If i is less that nField, then there are less fields in this - ** record than SetNumColumns indicated there are columns in the - ** table. Set the offset for any extra columns not present in - ** the record to 0. This tells code below to push a NULL onto the - ** stack instead of deserializing a value from the record. - */ - while( i<nField ){ - aOffset[i++] = 0; - } - - /* The header should end at the start of data and the data should - ** end at last byte of the record. If this is not the case then - ** we are dealing with a malformed record. - */ - if( idx!=szHdr || offset!=payloadSize ){ - rc = SQLITE_CORRUPT_BKPT; - goto op_column_out; - } - - /* Remember all aType and aColumn information if we have a cursor - ** to remember it in. */ - if( pC ){ - pC->payloadSize = payloadSize; - pC->aType = aType; - pC->aOffset = aOffset; - pC->cacheValid = 1; - } - } - - /* Get the column information. If aOffset[p2] is non-zero, then - ** deserialize the value from the record. If aOffset[p2] is zero, - ** then there are not enough fields in the record to satisfy the - ** request. In this case, set the value NULL or to P3 if P3 is - ** a pointer to a Mem object. - */ - if( aOffset[p2] ){ - assert( rc==SQLITE_OK ); - if( zRec ){ - zData = &zRec[aOffset[p2]]; - }else{ - len = sqlite3VdbeSerialTypeLen(aType[p2]); - rc = sqlite3VdbeMemFromBtree(pCrsr, aOffset[p2], len, pC->isIndex,&sMem); - if( rc!=SQLITE_OK ){ - goto op_column_out; - } - zData = sMem.z; - } - sqlite3VdbeSerialGet(zData, aType[p2], pTos); - pTos->enc = db->enc; - }else{ - if( pOp->p3type==P3_MEM ){ - sqlite3VdbeMemShallowCopy(pTos, (Mem *)(pOp->p3), MEM_Static); - }else{ - pTos->flags = MEM_Null; - } - } - - /* If we dynamically allocated space to hold the data (in the - ** sqlite3VdbeMemFromBtree() call above) then transfer control of that - ** dynamically allocated space over to the pTos structure rather. - ** This prevents a memory copy. - */ - if( (sMem.flags & MEM_Dyn)!=0 ){ - assert( pTos->flags & MEM_Ephem ); - assert( pTos->flags & (MEM_Str|MEM_Blob) ); - assert( pTos->z==sMem.z ); - assert( sMem.flags & MEM_Term ); - pTos->flags &= ~MEM_Ephem; - pTos->flags |= MEM_Dyn|MEM_Term; - } - - /* pTos->z might be pointing to sMem.zShort[]. Fix that so that we - ** can abandon sMem */ - rc = sqlite3VdbeMemMakeWriteable(pTos); - -op_column_out: - /* Release the aType[] memory if we are not dealing with cursor */ - if( !pC || !pC->aType ){ - sqliteFree(aType); - } - break; -} - -/* Opcode: MakeRecord P1 P2 P3 -** -** Convert the top abs(P1) entries of the stack into a single entry -** suitable for use as a data record in a database table or as a key -** in an index. The details of the format are irrelavant as long as -** the OP_Column opcode can decode the record later and as long as the -** sqlite3VdbeRecordCompare function will correctly compare two encoded -** records. Refer to source code comments for the details of the record -** format. -** -** The original stack entries are popped from the stack if P1>0 but -** remain on the stack if P1<0. -** -** If P2 is not zero and one or more of the entries are NULL, then jump -** to the address given by P2. This feature can be used to skip a -** uniqueness test on indices. -** -** P3 may be a string that is P1 characters long. The nth character of the -** string indicates the column affinity that should be used for the nth -** field of the index key (i.e. the first character of P3 corresponds to the -** lowest element on the stack). -** -** The mapping from character to affinity is as follows: -** 'n' = NUMERIC. -** 'i' = INTEGER. -** 't' = TEXT. -** 'o' = NONE. -** -** If P3 is NULL then all index fields have the affinity NONE. -** -** See also OP_MakeIdxRec -*/ -/* Opcode: MakeRecordI P1 P2 P3 -** -** This opcode works just OP_MakeRecord except that it reads an extra -** integer from the stack (thus reading a total of abs(P1+1) entries) -** and appends that extra integer to the end of the record as a varint. -** This results in an index key. -*/ -case OP_MakeIdxRec: -case OP_MakeRecord: { - /* Assuming the record contains N fields, the record format looks - ** like this: - ** - ** ------------------------------------------------------------------------ - ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 | - ** ------------------------------------------------------------------------ - ** - ** Data(0) is taken from the lowest element of the stack and data(N-1) is - ** the top of the stack. - ** - ** Each type field is a varint representing the serial type of the - ** corresponding data element (see sqlite3VdbeSerialType()). The - ** hdr-size field is also a varint which is the offset from the beginning - ** of the record to data0. - */ - unsigned char *zNewRecord; - unsigned char *zCsr; - Mem *pRec; - Mem *pRowid = 0; - int nData = 0; /* Number of bytes of data space */ - int nHdr = 0; /* Number of bytes of header space */ - int nByte = 0; /* Space required for this record */ - int nVarint; /* Number of bytes in a varint */ - u32 serial_type; /* Type field */ - int containsNull = 0; /* True if any of the data fields are NULL */ - char zTemp[NBFS]; /* Space to hold small records */ - Mem *pData0; - - int leaveOnStack; /* If true, leave the entries on the stack */ - int nField; /* Number of fields in the record */ - int jumpIfNull; /* Jump here if non-zero and any entries are NULL. */ - int addRowid; /* True to append a rowid column at the end */ - char *zAffinity; /* The affinity string for the record */ - - leaveOnStack = ((pOp->p1<0)?1:0); - nField = pOp->p1 * (leaveOnStack?-1:1); - jumpIfNull = pOp->p2; - addRowid = pOp->opcode==OP_MakeIdxRec; - zAffinity = pOp->p3; - - pData0 = &pTos[1-nField]; - assert( pData0>=p->aStack ); - containsNull = 0; - - /* Loop through the elements that will make up the record to figure - ** out how much space is required for the new record. - */ - for(pRec=pData0; pRec<=pTos; pRec++){ - if( zAffinity ){ - applyAffinity(pRec, zAffinity[pRec-pData0], db->enc); - } - if( pRec->flags&MEM_Null ){ - containsNull = 1; - } - serial_type = sqlite3VdbeSerialType(pRec); - nData += sqlite3VdbeSerialTypeLen(serial_type); - nHdr += sqlite3VarintLen(serial_type); - } - - /* If we have to append a varint rowid to this record, set 'rowid' - ** to the value of the rowid and increase nByte by the amount of space - ** required to store it and the 0x00 seperator byte. - */ - if( addRowid ){ - pRowid = &pTos[0-nField]; - assert( pRowid>=p->aStack ); - Integerify(pRowid); - serial_type = sqlite3VdbeSerialType(pRowid); - nData += sqlite3VdbeSerialTypeLen(serial_type); - nHdr += sqlite3VarintLen(serial_type); - } - - /* Add the initial header varint and total the size */ - nHdr += nVarint = sqlite3VarintLen(nHdr); - if( nVarint<sqlite3VarintLen(nHdr) ){ - nHdr++; - } - nByte = nHdr+nData; - - /* Allocate space for the new record. */ - if( nByte>sizeof(zTemp) ){ - zNewRecord = sqliteMallocRaw(nByte); - if( !zNewRecord ){ - goto no_mem; - } - }else{ - zNewRecord = zTemp; - } - - /* Write the record */ - zCsr = zNewRecord; - zCsr += sqlite3PutVarint(zCsr, nHdr); - for(pRec=pData0; pRec<=pTos; pRec++){ - serial_type = sqlite3VdbeSerialType(pRec); - zCsr += sqlite3PutVarint(zCsr, serial_type); /* serial type */ - } - if( addRowid ){ - zCsr += sqlite3PutVarint(zCsr, sqlite3VdbeSerialType(pRowid)); - } - for(pRec=pData0; pRec<=pTos; pRec++){ - zCsr += sqlite3VdbeSerialPut(zCsr, pRec); /* serial data */ - } - if( addRowid ){ - zCsr += sqlite3VdbeSerialPut(zCsr, pRowid); - } - assert( zCsr==(zNewRecord+nByte) ); - - /* Pop entries off the stack if required. Push the new record on. */ - if( !leaveOnStack ){ - popStack(&pTos, nField+addRowid); - } - pTos++; - pTos->n = nByte; - if( nByte<=sizeof(zTemp) ){ - assert( zNewRecord==(unsigned char *)zTemp ); - pTos->z = pTos->zShort; - memcpy(pTos->zShort, zTemp, nByte); - pTos->flags = MEM_Blob | MEM_Short; - }else{ - assert( zNewRecord!=(unsigned char *)zTemp ); - pTos->z = zNewRecord; - pTos->flags = MEM_Blob | MEM_Dyn; - pTos->xDel = 0; - } - pTos->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */ - - /* If a NULL was encountered and jumpIfNull is non-zero, take the jump. */ - if( jumpIfNull && containsNull ){ - pc = jumpIfNull - 1; - } - break; -} - -/* Opcode: Statement P1 * * -** -** Begin an individual statement transaction which is part of a larger -** BEGIN..COMMIT transaction. This is needed so that the statement -** can be rolled back after an error without having to roll back the -** entire transaction. The statement transaction will automatically -** commit when the VDBE halts. -** -** The statement is begun on the database file with index P1. The main -** database file has an index of 0 and the file used for temporary tables -** has an index of 1. -*/ -case OP_Statement: { /* no-push */ - int i = pOp->p1; - Btree *pBt; - if( i>=0 && i<db->nDb && (pBt = db->aDb[i].pBt) && !(db->autoCommit) ){ - assert( sqlite3BtreeIsInTrans(pBt) ); - if( !sqlite3BtreeIsInStmt(pBt) ){ - rc = sqlite3BtreeBeginStmt(pBt); - } - } - break; -} - -/* Opcode: AutoCommit P1 P2 * -** -** Set the database auto-commit flag to P1 (1 or 0). If P2 is true, roll -** back any currently active btree transactions. If there are any active -** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails. -** -** This instruction causes the VM to halt. -*/ -case OP_AutoCommit: { /* no-push */ - u8 i = pOp->p1; - u8 rollback = pOp->p2; - - assert( i==1 || i==0 ); - assert( i==1 || rollback==0 ); - - assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */ - - if( db->activeVdbeCnt>1 && i && !db->autoCommit ){ - /* If this instruction implements a COMMIT or ROLLBACK, other VMs are - ** still running, and a transaction is active, return an error indicating - ** that the other VMs must complete first. - */ - sqlite3SetString(&p->zErrMsg, "cannot ", rollback?"rollback":"commit", - " transaction - SQL statements in progress", 0); - rc = SQLITE_ERROR; - }else if( i!=db->autoCommit ){ - db->autoCommit = i; - if( pOp->p2 ){ - assert( i==1 ); - sqlite3RollbackAll(db); - }else if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ - p->pTos = pTos; - p->pc = pc; - db->autoCommit = 1-i; - p->rc = SQLITE_BUSY; - return SQLITE_BUSY; - } - return SQLITE_DONE; - }else{ - sqlite3SetString(&p->zErrMsg, - (!i)?"cannot start a transaction within a transaction":( - (rollback)?"cannot rollback - no transaction is active": - "cannot commit - no transaction is active"), 0); - - rc = SQLITE_ERROR; - } - break; -} - -/* Opcode: Transaction P1 P2 * -** -** Begin a transaction. The transaction ends when a Commit or Rollback -** opcode is encountered. Depending on the ON CONFLICT setting, the -** transaction might also be rolled back if an error is encountered. -** -** P1 is the index of the database file on which the transaction is -** started. Index 0 is the main database file and index 1 is the -** file used for temporary tables. -** -** If P2 is non-zero, then a write-transaction is started. A RESERVED lock is -** obtained on the database file when a write-transaction is started. No -** other process can start another write transaction while this transaction is -** underway. Starting a write transaction also creates a rollback journal. A -** write transaction must be started before any changes can be made to the -** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained -** on the file. -** -** If P2 is zero, then a read-lock is obtained on the database file. -*/ -case OP_Transaction: { /* no-push */ - int i = pOp->p1; - Btree *pBt; - - assert( i>=0 && i<db->nDb ); - pBt = db->aDb[i].pBt; - - if( pBt ){ - rc = sqlite3BtreeBeginTrans(pBt, pOp->p2); - if( rc==SQLITE_BUSY ){ - p->pc = pc; - p->rc = SQLITE_BUSY; - p->pTos = pTos; - return SQLITE_BUSY; - } - if( rc!=SQLITE_OK && rc!=SQLITE_READONLY /* && rc!=SQLITE_BUSY */ ){ - goto abort_due_to_error; - } - } - break; -} - -/* Opcode: ReadCookie P1 P2 * -** -** Read cookie number P2 from database P1 and push it onto the stack. -** P2==0 is the schema version. P2==1 is the database format. -** P2==2 is the recommended pager cache size, and so forth. P1==0 is -** the main database file and P1==1 is the database file used to store -** temporary tables. -** -** There must be a read-lock on the database (either a transaction -** must be started or there must be an open cursor) before -** executing this instruction. -*/ -case OP_ReadCookie: { - int iMeta; - assert( pOp->p2<SQLITE_N_BTREE_META ); - assert( pOp->p1>=0 && pOp->p1<db->nDb ); - assert( db->aDb[pOp->p1].pBt!=0 ); - /* The indexing of meta values at the schema layer is off by one from - ** the indexing in the btree layer. The btree considers meta[0] to - ** be the number of free pages in the database (a read-only value) - ** and meta[1] to be the schema cookie. The schema layer considers - ** meta[1] to be the schema cookie. So we have to shift the index - ** by one in the following statement. - */ - rc = sqlite3BtreeGetMeta(db->aDb[pOp->p1].pBt, 1 + pOp->p2, (u32 *)&iMeta); - pTos++; - pTos->i = iMeta; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: SetCookie P1 P2 * -** -** Write the top of the stack into cookie number P2 of database P1. -** P2==0 is the schema version. P2==1 is the database format. -** P2==2 is the recommended pager cache size, and so forth. P1==0 is -** the main database file and P1==1 is the database file used to store -** temporary tables. -** -** A transaction must be started before executing this opcode. -*/ -case OP_SetCookie: { /* no-push */ - Db *pDb; - assert( pOp->p2<SQLITE_N_BTREE_META ); - assert( pOp->p1>=0 && pOp->p1<db->nDb ); - pDb = &db->aDb[pOp->p1]; - assert( pDb->pBt!=0 ); - assert( pTos>=p->aStack ); - Integerify(pTos); - /* See note about index shifting on OP_ReadCookie */ - rc = sqlite3BtreeUpdateMeta(pDb->pBt, 1+pOp->p2, (int)pTos->i); - if( pOp->p2==0 ){ - /* When the schema cookie changes, record the new cookie internally */ - pDb->schema_cookie = pTos->i; - db->flags |= SQLITE_InternChanges; - } - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - break; -} - -/* Opcode: VerifyCookie P1 P2 * -** -** Check the value of global database parameter number 0 (the -** schema version) and make sure it is equal to P2. -** P1 is the database number which is 0 for the main database file -** and 1 for the file holding temporary tables and some higher number -** for auxiliary databases. -** -** The cookie changes its value whenever the database schema changes. -** This operation is used to detect when that the cookie has changed -** and that the current process needs to reread the schema. -** -** Either a transaction needs to have been started or an OP_Open needs -** to be executed (to establish a read lock) before this opcode is -** invoked. -*/ -case OP_VerifyCookie: { /* no-push */ - int iMeta; - Btree *pBt; - assert( pOp->p1>=0 && pOp->p1<db->nDb ); - pBt = db->aDb[pOp->p1].pBt; - if( pBt ){ - rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&iMeta); - }else{ - rc = SQLITE_OK; - iMeta = 0; - } - if( rc==SQLITE_OK && iMeta!=pOp->p2 ){ - sqlite3SetString(&p->zErrMsg, "database schema has changed", (char*)0); - rc = SQLITE_SCHEMA; - } - break; -} - -/* Opcode: OpenRead P1 P2 P3 -** -** Open a read-only cursor for the database table whose root page is -** P2 in a database file. The database file is determined by an -** integer from the top of the stack. 0 means the main database and -** 1 means the database used for temporary tables. Give the new -** cursor an identifier of P1. The P1 values need not be contiguous -** but all P1 values should be small integers. It is an error for -** P1 to be negative. -** -** If P2==0 then take the root page number from the next of the stack. -** -** There will be a read lock on the database whenever there is an -** open cursor. If the database was unlocked prior to this instruction -** then a read lock is acquired as part of this instruction. A read -** lock allows other processes to read the database but prohibits -** any other process from modifying the database. The read lock is -** released when all cursors are closed. If this instruction attempts -** to get a read lock but fails, the script terminates with an -** SQLITE_BUSY error code. -** -** The P3 value is a pointer to a KeyInfo structure that defines the -** content and collating sequence of indices. P3 is NULL for cursors -** that are not pointing to indices. -** -** See also OpenWrite. -*/ -/* Opcode: OpenWrite P1 P2 P3 -** -** Open a read/write cursor named P1 on the table or index whose root -** page is P2. If P2==0 then take the root page number from the stack. -** -** The P3 value is a pointer to a KeyInfo structure that defines the -** content and collating sequence of indices. P3 is NULL for cursors -** that are not pointing to indices. -** -** This instruction works just like OpenRead except that it opens the cursor -** in read/write mode. For a given table, there can be one or more read-only -** cursors or a single read/write cursor but not both. -** -** See also OpenRead. -*/ -case OP_OpenRead: /* no-push */ -case OP_OpenWrite: { /* no-push */ - int i = pOp->p1; - int p2 = pOp->p2; - int wrFlag; - Btree *pX; - int iDb; - Cursor *pCur; - - assert( pTos>=p->aStack ); - Integerify(pTos); - iDb = pTos->i; - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - assert( iDb>=0 && iDb<db->nDb ); - pX = db->aDb[iDb].pBt; - assert( pX!=0 ); - wrFlag = pOp->opcode==OP_OpenWrite; - if( p2<=0 ){ - assert( pTos>=p->aStack ); - Integerify(pTos); - p2 = pTos->i; - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - assert( p2>=2 ); - } - assert( i>=0 ); - pCur = allocateCursor(p, i); - if( pCur==0 ) goto no_mem; - pCur->nullRow = 1; - if( pX==0 ) break; - /* We always provide a key comparison function. If the table being - ** opened is of type INTKEY, the comparision function will be ignored. */ - rc = sqlite3BtreeCursor(pX, p2, wrFlag, - sqlite3VdbeRecordCompare, pOp->p3, - &pCur->pCursor); - if( pOp->p3type==P3_KEYINFO ){ - pCur->pKeyInfo = (KeyInfo*)pOp->p3; - pCur->pIncrKey = &pCur->pKeyInfo->incrKey; - pCur->pKeyInfo->enc = p->db->enc; - }else{ - pCur->pKeyInfo = 0; - pCur->pIncrKey = &pCur->bogusIncrKey; - } - switch( rc ){ - case SQLITE_BUSY: { - p->pc = pc; - p->rc = SQLITE_BUSY; - p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */ - return SQLITE_BUSY; - } - case SQLITE_OK: { - int flags = sqlite3BtreeFlags(pCur->pCursor); - /* Sanity checking. Only the lower four bits of the flags byte should - ** be used. Bit 3 (mask 0x08) is unpreditable. The lower 3 bits - ** (mask 0x07) should be either 5 (intkey+leafdata for tables) or - ** 2 (zerodata for indices). If these conditions are not met it can - ** only mean that we are dealing with a corrupt database file - */ - if( (flags & 0xf0)!=0 || ((flags & 0x07)!=5 && (flags & 0x07)!=2) ){ - rc = SQLITE_CORRUPT_BKPT; - goto abort_due_to_error; - } - pCur->isTable = (flags & BTREE_INTKEY)!=0; - pCur->isIndex = (flags & BTREE_ZERODATA)!=0; - /* If P3==0 it means we are expected to open a table. If P3!=0 then - ** we expect to be opening an index. If this is not what happened, - ** then the database is corrupt - */ - if( (pCur->isTable && pOp->p3type==P3_KEYINFO) - || (pCur->isIndex && pOp->p3type!=P3_KEYINFO) ){ - rc = SQLITE_CORRUPT_BKPT; - goto abort_due_to_error; - } - break; - } - case SQLITE_EMPTY: { - pCur->isTable = pOp->p3type!=P3_KEYINFO; - pCur->isIndex = !pCur->isTable; - rc = SQLITE_OK; - break; - } - default: { - goto abort_due_to_error; - } - } - break; -} - -/* Opcode: OpenVirtual P1 P2 P3 -** -** Open a new cursor P1 to a transient or virtual table. -** The cursor is always opened read/write even if -** the main database is read-only. The transient or virtual -** table is deleted automatically when the cursor is closed. -** -** P2 is the number of columns in the virtual table. -** The cursor points to a BTree table if P3==0 and to a BTree index -** if P3 is not 0. If P3 is not NULL, it points to a KeyInfo structure -** that defines the format of keys in the index. -*/ -case OP_OpenVirtual: { /* no-push */ - int i = pOp->p1; - Cursor *pCx; - assert( i>=0 ); - pCx = allocateCursor(p, i); - if( pCx==0 ) goto no_mem; - pCx->nullRow = 1; - rc = sqlite3BtreeFactory(db, 0, 1, TEMP_PAGES, &pCx->pBt); - if( rc==SQLITE_OK ){ - rc = sqlite3BtreeBeginTrans(pCx->pBt, 1); - } - if( rc==SQLITE_OK ){ - /* If a transient index is required, create it by calling - ** sqlite3BtreeCreateTable() with the BTREE_ZERODATA flag before - ** opening it. If a transient table is required, just use the - ** automatically created table with root-page 1 (an INTKEY table). - */ - if( pOp->p3 ){ - int pgno; - assert( pOp->p3type==P3_KEYINFO ); - rc = sqlite3BtreeCreateTable(pCx->pBt, &pgno, BTREE_ZERODATA); - if( rc==SQLITE_OK ){ - assert( pgno==MASTER_ROOT+1 ); - rc = sqlite3BtreeCursor(pCx->pBt, pgno, 1, sqlite3VdbeRecordCompare, - pOp->p3, &pCx->pCursor); - pCx->pKeyInfo = (KeyInfo*)pOp->p3; - pCx->pKeyInfo->enc = p->db->enc; - pCx->pIncrKey = &pCx->pKeyInfo->incrKey; - } - pCx->isTable = 0; - }else{ - rc = sqlite3BtreeCursor(pCx->pBt, MASTER_ROOT, 1, 0, 0, &pCx->pCursor); - pCx->isTable = 1; - pCx->pIncrKey = &pCx->bogusIncrKey; - } - } - pCx->nField = pOp->p2; - pCx->isIndex = !pCx->isTable; - break; -} - -#ifndef SQLITE_OMIT_TRIGGER -/* Opcode: OpenPseudo P1 * * -** -** Open a new cursor that points to a fake table that contains a single -** row of data. Any attempt to write a second row of data causes the -** first row to be deleted. All data is deleted when the cursor is -** closed. -** -** A pseudo-table created by this opcode is useful for holding the -** NEW or OLD tables in a trigger. -*/ -case OP_OpenPseudo: { /* no-push */ - int i = pOp->p1; - Cursor *pCx; - assert( i>=0 ); - pCx = allocateCursor(p, i); - if( pCx==0 ) goto no_mem; - pCx->nullRow = 1; - pCx->pseudoTable = 1; - pCx->pIncrKey = &pCx->bogusIncrKey; - pCx->isTable = 1; - pCx->isIndex = 0; - break; -} -#endif - -/* Opcode: Close P1 * * -** -** Close a cursor previously opened as P1. If P1 is not -** currently open, this instruction is a no-op. -*/ -case OP_Close: { /* no-push */ - int i = pOp->p1; - if( i>=0 && i<p->nCursor ){ - sqlite3VdbeFreeCursor(p->apCsr[i]); - p->apCsr[i] = 0; - } - break; -} - -/* Opcode: MoveGe P1 P2 * -** -** Pop the top of the stack and use its value as a key. Reposition -** cursor P1 so that it points to the smallest entry that is greater -** than or equal to the key that was popped ffrom the stack. -** If there are no records greater than or equal to the key and P2 -** is not zero, then jump to P2. -** -** See also: Found, NotFound, Distinct, MoveLt, MoveGt, MoveLe -*/ -/* Opcode: MoveGt P1 P2 * -** -** Pop the top of the stack and use its value as a key. Reposition -** cursor P1 so that it points to the smallest entry that is greater -** than the key from the stack. -** If there are no records greater than the key and P2 is not zero, -** then jump to P2. -** -** See also: Found, NotFound, Distinct, MoveLt, MoveGe, MoveLe -*/ -/* Opcode: MoveLt P1 P2 * -** -** Pop the top of the stack and use its value as a key. Reposition -** cursor P1 so that it points to the largest entry that is less -** than the key from the stack. -** If there are no records less than the key and P2 is not zero, -** then jump to P2. -** -** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLe -*/ -/* Opcode: MoveLe P1 P2 * -** -** Pop the top of the stack and use its value as a key. Reposition -** cursor P1 so that it points to the largest entry that is less than -** or equal to the key that was popped from the stack. -** If there are no records less than or eqal to the key and P2 is not zero, -** then jump to P2. -** -** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLt -*/ -case OP_MoveLt: /* no-push */ -case OP_MoveLe: /* no-push */ -case OP_MoveGe: /* no-push */ -case OP_MoveGt: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - if( pC->pCursor!=0 ){ - int res, oc; - oc = pOp->opcode; - pC->nullRow = 0; - *pC->pIncrKey = oc==OP_MoveGt || oc==OP_MoveLe; - if( pC->isTable ){ - i64 iKey; - Integerify(pTos); - iKey = intToKey(pTos->i); - if( pOp->p2==0 && pOp->opcode==OP_MoveGe ){ - pC->movetoTarget = iKey; - pC->deferredMoveto = 1; - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - break; - } - rc = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)iKey, &res); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - pC->lastRowid = pTos->i; - pC->rowidIsValid = res==0; - }else{ - Stringify(pTos, db->enc); - rc = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - pC->rowidIsValid = 0; - } - pC->deferredMoveto = 0; - pC->cacheValid = 0; - *pC->pIncrKey = 0; - sqlite3_search_count++; - if( oc==OP_MoveGe || oc==OP_MoveGt ){ - if( res<0 ){ - rc = sqlite3BtreeNext(pC->pCursor, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - pC->rowidIsValid = 0; - }else{ - res = 0; - } - }else{ - assert( oc==OP_MoveLt || oc==OP_MoveLe ); - if( res>=0 ){ - rc = sqlite3BtreePrevious(pC->pCursor, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - pC->rowidIsValid = 0; - }else{ - /* res might be negative because the table is empty. Check to - ** see if this is the case. - */ - res = sqlite3BtreeEof(pC->pCursor); - } - } - if( res ){ - if( pOp->p2>0 ){ - pc = pOp->p2 - 1; - }else{ - pC->nullRow = 1; - } - } - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: Distinct P1 P2 * -** -** Use the top of the stack as a record created using MakeRecord. P1 is a -** cursor on a table that declared as an index. If that table contains an -** entry that matches the top of the stack fall thru. If the top of the stack -** matches no entry in P1 then jump to P2. -** -** The cursor is left pointing at the matching entry if it exists. The -** record on the top of the stack is not popped. -** -** This instruction is similar to NotFound except that this operation -** does not pop the key from the stack. -** -** The instruction is used to implement the DISTINCT operator on SELECT -** statements. The P1 table is not a true index but rather a record of -** all results that have produced so far. -** -** See also: Found, NotFound, MoveTo, IsUnique, NotExists -*/ -/* Opcode: Found P1 P2 * -** -** Top of the stack holds a blob constructed by MakeRecord. P1 is an index. -** If an entry that matches the top of the stack exists in P1 then -** jump to P2. If the top of the stack does not match any entry in P1 -** then fall thru. The P1 cursor is left pointing at the matching entry -** if it exists. The blob is popped off the top of the stack. -** -** This instruction is used to implement the IN operator where the -** left-hand side is a SELECT statement. P1 is not a true index but -** is instead a temporary index that holds the results of the SELECT -** statement. This instruction just checks to see if the left-hand side -** of the IN operator (stored on the top of the stack) exists in the -** result of the SELECT statement. -** -** See also: Distinct, NotFound, MoveTo, IsUnique, NotExists -*/ -/* Opcode: NotFound P1 P2 * -** -** The top of the stack holds a blob constructed by MakeRecord. P1 is -** an index. If no entry exists in P1 that matches the blob then jump -** to P1. If an entry does existing, fall through. The cursor is left -** pointing to the entry that matches. The blob is popped from the stack. -** -** The difference between this operation and Distinct is that -** Distinct does not pop the key from the stack. -** -** See also: Distinct, Found, MoveTo, NotExists, IsUnique -*/ -case OP_Distinct: /* no-push */ -case OP_NotFound: /* no-push */ -case OP_Found: { /* no-push */ - int i = pOp->p1; - int alreadyExists = 0; - Cursor *pC; - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - if( (pC = p->apCsr[i])->pCursor!=0 ){ - int res, rx; - assert( pC->isTable==0 ); - Stringify(pTos, db->enc); - rx = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res); - alreadyExists = rx==SQLITE_OK && res==0; - pC->deferredMoveto = 0; - pC->cacheValid = 0; - } - if( pOp->opcode==OP_Found ){ - if( alreadyExists ) pc = pOp->p2 - 1; - }else{ - if( !alreadyExists ) pc = pOp->p2 - 1; - } - if( pOp->opcode!=OP_Distinct ){ - Release(pTos); - pTos--; - } - break; -} - -/* Opcode: IsUnique P1 P2 * -** -** The top of the stack is an integer record number. Call this -** record number R. The next on the stack is an index key created -** using MakeIdxKey. Call it K. This instruction pops R from the -** stack but it leaves K unchanged. -** -** P1 is an index. So it has no data and its key consists of a -** record generated by OP_MakeRecord where the last field is the -** rowid of the entry that the index refers to. -** -** This instruction asks if there is an entry in P1 where the -** fields matches K but the rowid is different from R. -** If there is no such entry, then there is an immediate -** jump to P2. If any entry does exist where the index string -** matches K but the record number is not R, then the record -** number for that entry is pushed onto the stack and control -** falls through to the next instruction. -** -** See also: Distinct, NotFound, NotExists, Found -*/ -case OP_IsUnique: { /* no-push */ - int i = pOp->p1; - Mem *pNos = &pTos[-1]; - Cursor *pCx; - BtCursor *pCrsr; - i64 R; - - /* Pop the value R off the top of the stack - */ - assert( pNos>=p->aStack ); - Integerify(pTos); - R = pTos->i; - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - assert( i>=0 && i<=p->nCursor ); - pCx = p->apCsr[i]; - assert( pCx!=0 ); - pCrsr = pCx->pCursor; - if( pCrsr!=0 ){ - int res, rc; - i64 v; /* The record number on the P1 entry that matches K */ - char *zKey; /* The value of K */ - int nKey; /* Number of bytes in K */ - int len; /* Number of bytes in K without the rowid at the end */ - int szRowid; /* Size of the rowid column at the end of zKey */ - - /* Make sure K is a string and make zKey point to K - */ - Stringify(pNos, db->enc); - zKey = pNos->z; - nKey = pNos->n; - - szRowid = sqlite3VdbeIdxRowidLen(nKey, zKey); - len = nKey-szRowid; - - /* Search for an entry in P1 where all but the last four bytes match K. - ** If there is no such entry, jump immediately to P2. - */ - assert( pCx->deferredMoveto==0 ); - pCx->cacheValid = 0; - rc = sqlite3BtreeMoveto(pCrsr, zKey, len, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - if( res<0 ){ - rc = sqlite3BtreeNext(pCrsr, &res); - if( res ){ - pc = pOp->p2 - 1; - break; - } - } - rc = sqlite3VdbeIdxKeyCompare(pCx, len, zKey, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - if( res>0 ){ - pc = pOp->p2 - 1; - break; - } - - /* At this point, pCrsr is pointing to an entry in P1 where all but - ** the final entry (the rowid) matches K. Check to see if the - ** final rowid column is different from R. If it equals R then jump - ** immediately to P2. - */ - rc = sqlite3VdbeIdxRowid(pCrsr, &v); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - if( v==R ){ - pc = pOp->p2 - 1; - break; - } - - /* The final varint of the key is different from R. Push it onto - ** the stack. (The record number of an entry that violates a UNIQUE - ** constraint.) - */ - pTos++; - pTos->i = v; - pTos->flags = MEM_Int; - } - break; -} - -/* Opcode: NotExists P1 P2 * -** -** Use the top of the stack as a integer key. If a record with that key -** does not exist in table of P1, then jump to P2. If the record -** does exist, then fall thru. The cursor is left pointing to the -** record if it exists. The integer key is popped from the stack. -** -** The difference between this operation and NotFound is that this -** operation assumes the key is an integer and that P1 is a table whereas -** NotFound assumes key is a blob constructed from MakeRecord and -** P1 is an index. -** -** See also: Distinct, Found, MoveTo, NotFound, IsUnique -*/ -case OP_NotExists: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - BtCursor *pCrsr; - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ - int res; - u64 iKey; - assert( pTos->flags & MEM_Int ); - assert( p->apCsr[i]->isTable ); - iKey = intToKey(pTos->i); - rc = sqlite3BtreeMoveto(pCrsr, 0, iKey, &res); - pC->lastRowid = pTos->i; - pC->rowidIsValid = res==0; - pC->nullRow = 0; - pC->cacheValid = 0; - if( res!=0 ){ - pc = pOp->p2 - 1; - pC->rowidIsValid = 0; - } - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: Sequence P1 * * -** -** Push an integer onto the stack which is the next available -** sequence number for cursor P1. The sequence number on the -** cursor is incremented after the push. -*/ -case OP_Sequence: { - int i = pOp->p1; - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - pTos++; - pTos->i = p->apCsr[i]->seqCount++; - pTos->flags = MEM_Int; - break; -} - - -/* Opcode: NewRowid P1 P2 * -** -** Get a new integer record number (a.k.a "rowid") used as the key to a table. -** The record number is not previously used as a key in the database -** table that cursor P1 points to. The new record number is pushed -** onto the stack. -** -** If P2>0 then P2 is a memory cell that holds the largest previously -** generated record number. No new record numbers are allowed to be less -** than this value. When this value reaches its maximum, a SQLITE_FULL -** error is generated. The P2 memory cell is updated with the generated -** record number. This P2 mechanism is used to help implement the -** AUTOINCREMENT feature. -*/ -case OP_NewRowid: { - int i = pOp->p1; - i64 v = 0; - Cursor *pC; - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - if( (pC = p->apCsr[i])->pCursor==0 ){ - /* The zero initialization above is all that is needed */ - }else{ - /* The next rowid or record number (different terms for the same - ** thing) is obtained in a two-step algorithm. - ** - ** First we attempt to find the largest existing rowid and add one - ** to that. But if the largest existing rowid is already the maximum - ** positive integer, we have to fall through to the second - ** probabilistic algorithm - ** - ** The second algorithm is to select a rowid at random and see if - ** it already exists in the table. If it does not exist, we have - ** succeeded. If the random rowid does exist, we select a new one - ** and try again, up to 1000 times. - ** - ** For a table with less than 2 billion entries, the probability - ** of not finding a unused rowid is about 1.0e-300. This is a - ** non-zero probability, but it is still vanishingly small and should - ** never cause a problem. You are much, much more likely to have a - ** hardware failure than for this algorithm to fail. - ** - ** The analysis in the previous paragraph assumes that you have a good - ** source of random numbers. Is a library function like lrand48() - ** good enough? Maybe. Maybe not. It's hard to know whether there - ** might be subtle bugs is some implementations of lrand48() that - ** could cause problems. To avoid uncertainty, SQLite uses its own - ** random number generator based on the RC4 algorithm. - ** - ** To promote locality of reference for repetitive inserts, the - ** first few attempts at chosing a random rowid pick values just a little - ** larger than the previous rowid. This has been shown experimentally - ** to double the speed of the COPY operation. - */ - int res, rx=SQLITE_OK, cnt; - i64 x; - cnt = 0; - if( (sqlite3BtreeFlags(pC->pCursor)&(BTREE_INTKEY|BTREE_ZERODATA)) != - BTREE_INTKEY ){ - rc = SQLITE_CORRUPT_BKPT; - goto abort_due_to_error; - } - assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_INTKEY)!=0 ); - assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_ZERODATA)==0 ); - -#ifdef SQLITE_32BIT_ROWID -# define MAX_ROWID 0x7fffffff -#else - /* Some compilers complain about constants of the form 0x7fffffffffffffff. - ** Others complain about 0x7ffffffffffffffffLL. The following macro seems - ** to provide the constant while making all compilers happy. - */ -# define MAX_ROWID ( (((u64)0x7fffffff)<<32) | (u64)0xffffffff ) -#endif - - if( !pC->useRandomRowid ){ - if( pC->nextRowidValid ){ - v = pC->nextRowid; - }else{ - rx = sqlite3BtreeLast(pC->pCursor, &res); - if( res ){ - v = 1; - }else{ - sqlite3BtreeKeySize(pC->pCursor, &v); - v = keyToInt(v); - if( v==MAX_ROWID ){ - pC->useRandomRowid = 1; - }else{ - v++; - } - } - } - -#ifndef SQLITE_OMIT_AUTOINCREMENT - if( pOp->p2 ){ - Mem *pMem; - assert( pOp->p2>0 && pOp->p2<p->nMem ); /* P2 is a valid memory cell */ - pMem = &p->aMem[pOp->p2]; - Integerify(pMem); - assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P2) holds an integer */ - if( pMem->i==MAX_ROWID || pC->useRandomRowid ){ - rc = SQLITE_FULL; - goto abort_due_to_error; - } - if( v<pMem->i+1 ){ - v = pMem->i + 1; - } - pMem->i = v; - } -#endif - - if( v<MAX_ROWID ){ - pC->nextRowidValid = 1; - pC->nextRowid = v+1; - }else{ - pC->nextRowidValid = 0; - } - } - if( pC->useRandomRowid ){ - assert( pOp->p2==0 ); /* SQLITE_FULL must have occurred prior to this */ - v = db->priorNewRowid; - cnt = 0; - do{ - if( v==0 || cnt>2 ){ - sqlite3Randomness(sizeof(v), &v); - if( cnt<5 ) v &= 0xffffff; - }else{ - unsigned char r; - sqlite3Randomness(1, &r); - v += r + 1; - } - if( v==0 ) continue; - x = intToKey(v); - rx = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)x, &res); - cnt++; - }while( cnt<1000 && rx==SQLITE_OK && res==0 ); - db->priorNewRowid = v; - if( rx==SQLITE_OK && res==0 ){ - rc = SQLITE_FULL; - goto abort_due_to_error; - } - } - pC->rowidIsValid = 0; - pC->deferredMoveto = 0; - pC->cacheValid = 0; - } - pTos++; - pTos->i = v; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: Insert P1 P2 * -** -** Write an entry into the table of cursor P1. A new entry is -** created if it doesn't already exist or the data for an existing -** entry is overwritten. The data is the value on the top of the -** stack. The key is the next value down on the stack. The key must -** be an integer. The stack is popped twice by this instruction. -** -** If the OPFLAG_NCHANGE flag of P2 is set, then the row change count is -** incremented (otherwise not). If the OPFLAG_LASTROWID flag of P2 is set, -** then rowid is stored for subsequent return by the -** sqlite3_last_insert_rowid() function (otherwise it's unmodified). -** -** This instruction only works on tables. The equivalent instruction -** for indices is OP_IdxInsert. -*/ -case OP_Insert: { /* no-push */ - Mem *pNos = &pTos[-1]; - int i = pOp->p1; - Cursor *pC; - assert( pNos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - if( ((pC = p->apCsr[i])->pCursor!=0 || pC->pseudoTable) ){ - i64 iKey; /* The integer ROWID or key for the record to be inserted */ - - assert( pNos->flags & MEM_Int ); - assert( pC->isTable ); - iKey = intToKey(pNos->i); - - if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++; - if( pOp->p2 & OPFLAG_LASTROWID ) db->lastRowid = pNos->i; - if( pC->nextRowidValid && pTos->i>=pC->nextRowid ){ - pC->nextRowidValid = 0; - } - if( pTos->flags & MEM_Null ){ - pTos->z = 0; - pTos->n = 0; - }else{ - assert( pTos->flags & (MEM_Blob|MEM_Str) ); - } -#ifndef SQLITE_OMIT_TRIGGER - if( pC->pseudoTable ){ - sqliteFree(pC->pData); - pC->iKey = iKey; - pC->nData = pTos->n; - if( pTos->flags & MEM_Dyn ){ - pC->pData = pTos->z; - pTos->flags = MEM_Null; - }else{ - pC->pData = sqliteMallocRaw( pC->nData+2 ); - if( !pC->pData ) goto no_mem; - memcpy(pC->pData, pTos->z, pC->nData); - pC->pData[pC->nData] = 0; - pC->pData[pC->nData+1] = 0; - } - pC->nullRow = 0; - }else{ -#endif - rc = sqlite3BtreeInsert(pC->pCursor, 0, iKey, pTos->z, pTos->n); -#ifndef SQLITE_OMIT_TRIGGER - } -#endif - - pC->rowidIsValid = 0; - pC->deferredMoveto = 0; - pC->cacheValid = 0; - } - popStack(&pTos, 2); - break; -} - -/* Opcode: Delete P1 P2 * -** -** Delete the record at which the P1 cursor is currently pointing. -** -** The cursor will be left pointing at either the next or the previous -** record in the table. If it is left pointing at the next record, then -** the next Next instruction will be a no-op. Hence it is OK to delete -** a record from within an Next loop. -** -** If the OPFLAG_NCHANGE flag of P2 is set, then the row change count is -** incremented (otherwise not). -** -** If P1 is a pseudo-table, then this instruction is a no-op. -*/ -case OP_Delete: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - if( pC->pCursor!=0 ){ - rc = sqlite3VdbeCursorMoveto(pC); - if( rc ) goto abort_due_to_error; - rc = sqlite3BtreeDelete(pC->pCursor); - pC->nextRowidValid = 0; - pC->cacheValid = 0; - } - if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++; - break; -} - -/* Opcode: ResetCount P1 * * -** -** This opcode resets the VMs internal change counter to 0. If P1 is true, -** then the value of the change counter is copied to the database handle -** change counter (returned by subsequent calls to sqlite3_changes()) -** before it is reset. This is used by trigger programs. -*/ -case OP_ResetCount: { /* no-push */ - if( pOp->p1 ){ - sqlite3VdbeSetChanges(db, p->nChange); - } - p->nChange = 0; - break; -} - -/* Opcode: RowData P1 * * -** -** Push onto the stack the complete row data for cursor P1. -** There is no interpretation of the data. It is just copied -** onto the stack exactly as it is found in the database file. -** -** If the cursor is not pointing to a valid row, a NULL is pushed -** onto the stack. -*/ -/* Opcode: RowKey P1 * * -** -** Push onto the stack the complete row key for cursor P1. -** There is no interpretation of the key. It is just copied -** onto the stack exactly as it is found in the database file. -** -** If the cursor is not pointing to a valid row, a NULL is pushed -** onto the stack. -*/ -case OP_RowKey: -case OP_RowData: { - int i = pOp->p1; - Cursor *pC; - u32 n; - - /* Note that RowKey and RowData are really exactly the same instruction */ - pTos++; - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC->isTable || pOp->opcode==OP_RowKey ); - assert( pC->isIndex || pOp->opcode==OP_RowData ); - assert( pC!=0 ); - if( pC->nullRow ){ - pTos->flags = MEM_Null; - }else if( pC->pCursor!=0 ){ - BtCursor *pCrsr = pC->pCursor; - rc = sqlite3VdbeCursorMoveto(pC); - if( rc ) goto abort_due_to_error; - if( pC->nullRow ){ - pTos->flags = MEM_Null; - break; - }else if( pC->isIndex ){ - i64 n64; - assert( !pC->isTable ); - sqlite3BtreeKeySize(pCrsr, &n64); - n = n64; - }else{ - sqlite3BtreeDataSize(pCrsr, &n); - } - pTos->n = n; - if( n<=NBFS ){ - pTos->flags = MEM_Blob | MEM_Short; - pTos->z = pTos->zShort; - }else{ - char *z = sqliteMallocRaw( n ); - if( z==0 ) goto no_mem; - pTos->flags = MEM_Blob | MEM_Dyn; - pTos->xDel = 0; - pTos->z = z; - } - if( pC->isIndex ){ - sqlite3BtreeKey(pCrsr, 0, n, pTos->z); - }else{ - sqlite3BtreeData(pCrsr, 0, n, pTos->z); - } -#ifndef SQLITE_OMIT_TRIGGER - }else if( pC->pseudoTable ){ - pTos->n = pC->nData; - pTos->z = pC->pData; - pTos->flags = MEM_Blob|MEM_Ephem; -#endif - }else{ - pTos->flags = MEM_Null; - } - pTos->enc = SQLITE_UTF8; /* In case the blob is ever cast to text */ - break; -} - -/* Opcode: Rowid P1 * * -** -** Push onto the stack an integer which is the key of the table entry that -** P1 is currently point to. -*/ -case OP_Rowid: { - int i = pOp->p1; - Cursor *pC; - i64 v; - - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - rc = sqlite3VdbeCursorMoveto(pC); - if( rc ) goto abort_due_to_error; - pTos++; - if( pC->rowidIsValid ){ - v = pC->lastRowid; - }else if( pC->pseudoTable ){ - v = keyToInt(pC->iKey); - }else if( pC->nullRow || pC->pCursor==0 ){ - pTos->flags = MEM_Null; - break; - }else{ - assert( pC->pCursor!=0 ); - sqlite3BtreeKeySize(pC->pCursor, &v); - v = keyToInt(v); - } - pTos->i = v; - pTos->flags = MEM_Int; - break; -} - -/* Opcode: NullRow P1 * * -** -** Move the cursor P1 to a null row. Any OP_Column operations -** that occur while the cursor is on the null row will always push -** a NULL onto the stack. -*/ -case OP_NullRow: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - pC->nullRow = 1; - pC->rowidIsValid = 0; - break; -} - -/* Opcode: Last P1 P2 * -** -** The next use of the Rowid or Column or Next instruction for P1 -** will refer to the last entry in the database table or index. -** If the table or index is empty and P2>0, then jump immediately to P2. -** If P2 is 0 or if the table or index is not empty, fall through -** to the following instruction. -*/ -case OP_Last: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - BtCursor *pCrsr; - - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - if( (pCrsr = pC->pCursor)!=0 ){ - int res; - rc = sqlite3BtreeLast(pCrsr, &res); - pC->nullRow = res; - pC->deferredMoveto = 0; - pC->cacheValid = 0; - if( res && pOp->p2>0 ){ - pc = pOp->p2 - 1; - } - }else{ - pC->nullRow = 0; - } - break; -} - - -/* Opcode: Sort P1 P2 * -** -** This opcode does exactly the same thing as OP_Rewind except that -** it increments an undocumented global variable used for testing. -** -** Sorting is accomplished by writing records into a sorting index, -** then rewinding that index and playing it back from beginning to -** end. We use the OP_Sort opcode instead of OP_Rewind to do the -** rewinding so that the global variable will be incremented and -** regression tests can determine whether or not the optimizer is -** correctly optimizing out sorts. -*/ -case OP_Sort: { /* no-push */ - sqlite3_sort_count++; - sqlite3_search_count--; - /* Fall through into OP_Rewind */ -} -/* Opcode: Rewind P1 P2 * -** -** The next use of the Rowid or Column or Next instruction for P1 -** will refer to the first entry in the database table or index. -** If the table or index is empty and P2>0, then jump immediately to P2. -** If P2 is 0 or if the table or index is not empty, fall through -** to the following instruction. -*/ -case OP_Rewind: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - BtCursor *pCrsr; - int res; - - assert( i>=0 && i<p->nCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - if( (pCrsr = pC->pCursor)!=0 ){ - rc = sqlite3BtreeFirst(pCrsr, &res); - pC->atFirst = res==0; - pC->deferredMoveto = 0; - pC->cacheValid = 0; - }else{ - res = 1; - } - pC->nullRow = res; - if( res && pOp->p2>0 ){ - pc = pOp->p2 - 1; - } - break; -} - -/* Opcode: Next P1 P2 * -** -** Advance cursor P1 so that it points to the next key/data pair in its -** table or index. If there are no more key/value pairs then fall through -** to the following instruction. But if the cursor advance was successful, -** jump immediately to P2. -** -** See also: Prev -*/ -/* Opcode: Prev P1 P2 * -** -** Back up cursor P1 so that it points to the previous key/data pair in its -** table or index. If there is no previous key/value pairs then fall through -** to the following instruction. But if the cursor backup was successful, -** jump immediately to P2. -*/ -case OP_Prev: /* no-push */ -case OP_Next: { /* no-push */ - Cursor *pC; - BtCursor *pCrsr; - - CHECK_FOR_INTERRUPT; - assert( pOp->p1>=0 && pOp->p1<p->nCursor ); - pC = p->apCsr[pOp->p1]; - assert( pC!=0 ); - if( (pCrsr = pC->pCursor)!=0 ){ - int res; - if( pC->nullRow ){ - res = 1; - }else{ - assert( pC->deferredMoveto==0 ); - rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) : - sqlite3BtreePrevious(pCrsr, &res); - pC->nullRow = res; - pC->cacheValid = 0; - } - if( res==0 ){ - pc = pOp->p2 - 1; - sqlite3_search_count++; - } - }else{ - pC->nullRow = 1; - } - pC->rowidIsValid = 0; - break; -} - -/* Opcode: IdxInsert P1 * * -** -** The top of the stack holds a SQL index key made using the -** MakeIdxKey instruction. This opcode writes that key into the -** index P1. Data for the entry is nil. -** -** This instruction only works for indices. The equivalent instruction -** for tables is OP_Insert. -*/ -case OP_IdxInsert: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - BtCursor *pCrsr; - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - assert( pTos->flags & MEM_Blob ); - assert( pOp->p2==0 ); - if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ - int nKey = pTos->n; - const char *zKey = pTos->z; - assert( pC->isTable==0 ); - rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0); - assert( pC->deferredMoveto==0 ); - pC->cacheValid = 0; - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: IdxDelete P1 * * -** -** The top of the stack is an index key built using the MakeIdxKey opcode. -** This opcode removes that entry from the index. -*/ -case OP_IdxDelete: { /* no-push */ - int i = pOp->p1; - Cursor *pC; - BtCursor *pCrsr; - assert( pTos>=p->aStack ); - assert( pTos->flags & MEM_Blob ); - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ - int rx, res; - rx = sqlite3BtreeMoveto(pCrsr, pTos->z, pTos->n, &res); - if( rx==SQLITE_OK && res==0 ){ - rc = sqlite3BtreeDelete(pCrsr); - } - assert( pC->deferredMoveto==0 ); - pC->cacheValid = 0; - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: IdxRowid P1 * * -** -** Push onto the stack an integer which is the last entry in the record at -** the end of the index key pointed to by cursor P1. This integer should be -** the rowid of the table entry to which this index entry points. -** -** See also: Rowid, MakeIdxKey. -*/ -case OP_IdxRowid: { - int i = pOp->p1; - BtCursor *pCrsr; - Cursor *pC; - - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - pTos++; - pTos->flags = MEM_Null; - if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ - i64 rowid; - - assert( pC->deferredMoveto==0 ); - assert( pC->isTable==0 ); - if( pC->nullRow ){ - pTos->flags = MEM_Null; - }else{ - rc = sqlite3VdbeIdxRowid(pCrsr, &rowid); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - pTos->flags = MEM_Int; - pTos->i = rowid; - } - } - break; -} - -/* Opcode: IdxGT P1 P2 * -** -** The top of the stack is an index entry that omits the ROWID. Compare -** the top of stack against the index that P1 is currently pointing to. -** Ignore the ROWID on the P1 index. -** -** The top of the stack might have fewer columns that P1. -** -** If the P1 index entry is greater than the top of the stack -** then jump to P2. Otherwise fall through to the next instruction. -** In either case, the stack is popped once. -*/ -/* Opcode: IdxGE P1 P2 P3 -** -** The top of the stack is an index entry that omits the ROWID. Compare -** the top of stack against the index that P1 is currently pointing to. -** Ignore the ROWID on the P1 index. -** -** If the P1 index entry is greater than or equal to the top of the stack -** then jump to P2. Otherwise fall through to the next instruction. -** In either case, the stack is popped once. -** -** If P3 is the "+" string (or any other non-NULL string) then the -** index taken from the top of the stack is temporarily increased by -** an epsilon prior to the comparison. This make the opcode work -** like IdxGT except that if the key from the stack is a prefix of -** the key in the cursor, the result is false whereas it would be -** true with IdxGT. -*/ -/* Opcode: IdxLT P1 P2 P3 -** -** The top of the stack is an index entry that omits the ROWID. Compare -** the top of stack against the index that P1 is currently pointing to. -** Ignore the ROWID on the P1 index. -** -** If the P1 index entry is less than the top of the stack -** then jump to P2. Otherwise fall through to the next instruction. -** In either case, the stack is popped once. -** -** If P3 is the "+" string (or any other non-NULL string) then the -** index taken from the top of the stack is temporarily increased by -** an epsilon prior to the comparison. This makes the opcode work -** like IdxLE. -*/ -case OP_IdxLT: /* no-push */ -case OP_IdxGT: /* no-push */ -case OP_IdxGE: { /* no-push */ - int i= pOp->p1; - Cursor *pC; - - assert( i>=0 && i<p->nCursor ); - assert( p->apCsr[i]!=0 ); - assert( pTos>=p->aStack ); - if( (pC = p->apCsr[i])->pCursor!=0 ){ - int res, rc; - - assert( pTos->flags & MEM_Blob ); /* Created using OP_Make*Key */ - Stringify(pTos, db->enc); - assert( pC->deferredMoveto==0 ); - *pC->pIncrKey = pOp->p3!=0; - assert( pOp->p3==0 || pOp->opcode!=OP_IdxGT ); - rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, pTos->z, &res); - *pC->pIncrKey = 0; - if( rc!=SQLITE_OK ){ - break; - } - if( pOp->opcode==OP_IdxLT ){ - res = -res; - }else if( pOp->opcode==OP_IdxGE ){ - res++; - } - if( res>0 ){ - pc = pOp->p2 - 1 ; - } - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: IdxIsNull P1 P2 * -** -** The top of the stack contains an index entry such as might be generated -** by the MakeIdxKey opcode. This routine looks at the first P1 fields of -** that key. If any of the first P1 fields are NULL, then a jump is made -** to address P2. Otherwise we fall straight through. -** -** The index entry is always popped from the stack. -*/ -case OP_IdxIsNull: { /* no-push */ - int i = pOp->p1; - int k, n; - const char *z; - u32 serial_type; - - assert( pTos>=p->aStack ); - assert( pTos->flags & MEM_Blob ); - z = pTos->z; - n = pTos->n; - k = sqlite3GetVarint32(z, &serial_type); - for(; k<n && i>0; i--){ - k += sqlite3GetVarint32(&z[k], &serial_type); - if( serial_type==0 ){ /* Serial type 0 is a NULL */ - pc = pOp->p2-1; - break; - } - } - Release(pTos); - pTos--; - break; -} - -/* Opcode: Destroy P1 P2 * -** -** Delete an entire database table or index whose root page in the database -** file is given by P1. -** -** The table being destroyed is in the main database file if P2==0. If -** P2==1 then the table to be clear is in the auxiliary database file -** that is used to store tables create using CREATE TEMPORARY TABLE. -** -** If AUTOVACUUM is enabled then it is possible that another root page -** might be moved into the newly deleted root page in order to keep all -** root pages contiguous at the beginning of the database. The former -** value of the root page that moved - its value before the move occurred - -** is pushed onto the stack. If no page movement was required (because -** the table being dropped was already the last one in the database) then -** a zero is pushed onto the stack. If AUTOVACUUM is disabled -** then a zero is pushed onto the stack. -** -** See also: Clear -*/ -case OP_Destroy: { - int iMoved; - if( db->activeVdbeCnt>1 ){ - rc = SQLITE_LOCKED; - }else{ - assert( db->activeVdbeCnt==1 ); - rc = sqlite3BtreeDropTable(db->aDb[pOp->p2].pBt, pOp->p1, &iMoved); - pTos++; - pTos->flags = MEM_Int; - pTos->i = iMoved; - #ifndef SQLITE_OMIT_AUTOVACUUM - if( rc==SQLITE_OK && iMoved!=0 ){ - sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1); - } - #endif - } - break; -} - -/* Opcode: Clear P1 P2 * -** -** Delete all contents of the database table or index whose root page -** in the database file is given by P1. But, unlike Destroy, do not -** remove the table or index from the database file. -** -** The table being clear is in the main database file if P2==0. If -** P2==1 then the table to be clear is in the auxiliary database file -** that is used to store tables create using CREATE TEMPORARY TABLE. -** -** See also: Destroy -*/ -case OP_Clear: { /* no-push */ - rc = sqlite3BtreeClearTable(db->aDb[pOp->p2].pBt, pOp->p1); - break; -} - -/* Opcode: CreateTable P1 * * -** -** Allocate a new table in the main database file if P2==0 or in the -** auxiliary database file if P2==1. Push the page number -** for the root page of the new table onto the stack. -** -** The difference between a table and an index is this: A table must -** have a 4-byte integer key and can have arbitrary data. An index -** has an arbitrary key but no data. -** -** See also: CreateIndex -*/ -/* Opcode: CreateIndex P1 * * -** -** Allocate a new index in the main database file if P2==0 or in the -** auxiliary database file if P2==1. Push the page number of the -** root page of the new index onto the stack. -** -** See documentation on OP_CreateTable for additional information. -*/ -case OP_CreateIndex: -case OP_CreateTable: { - int pgno; - int flags; - Db *pDb; - assert( pOp->p1>=0 && pOp->p1<db->nDb ); - pDb = &db->aDb[pOp->p1]; - assert( pDb->pBt!=0 ); - if( pOp->opcode==OP_CreateTable ){ - /* flags = BTREE_INTKEY; */ - flags = BTREE_LEAFDATA|BTREE_INTKEY; - }else{ - flags = BTREE_ZERODATA; - } - rc = sqlite3BtreeCreateTable(pDb->pBt, &pgno, flags); - pTos++; - if( rc==SQLITE_OK ){ - pTos->i = pgno; - pTos->flags = MEM_Int; - }else{ - pTos->flags = MEM_Null; - } - break; -} - -/* Opcode: ParseSchema P1 * P3 -** -** Read and parse all entries from the SQLITE_MASTER table of database P1 -** that match the WHERE clause P3. -** -** This opcode invokes the parser to create a new virtual machine, -** then runs the new virtual machine. It is thus a reentrant opcode. -*/ -case OP_ParseSchema: { /* no-push */ - char *zSql; - int iDb = pOp->p1; - const char *zMaster; - InitData initData; - - assert( iDb>=0 && iDb<db->nDb ); - if( !DbHasProperty(db, iDb, DB_SchemaLoaded) ) break; - zMaster = SCHEMA_TABLE(iDb); - initData.db = db; - initData.pzErrMsg = &p->zErrMsg; - zSql = sqlite3MPrintf( - "SELECT name, rootpage, sql, %d FROM '%q'.%s WHERE %s", - pOp->p1, db->aDb[iDb].zName, zMaster, pOp->p3); - if( zSql==0 ) goto no_mem; - sqlite3SafetyOff(db); - assert( db->init.busy==0 ); - db->init.busy = 1; - rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0); - db->init.busy = 0; - sqlite3SafetyOn(db); - sqliteFree(zSql); - break; -} - -#ifndef SQLITE_OMIT_ANALYZE -/* Opcode: LoadAnalysis P1 * * -** -** Read the sqlite_stat1 table for database P1 and load the content -** of that table into the internal index hash table. This will cause -** the analysis to be used when preparing all subsequent queries. -*/ -case OP_LoadAnalysis: { /* no-push */ - int iDb = pOp->p1; - assert( iDb>=0 && iDb<db->nDb ); - sqlite3AnalysisLoad(db, iDb); - break; -} -#endif /* SQLITE_OMIT_ANALYZE */ - -/* Opcode: DropTable P1 * P3 -** -** Remove the internal (in-memory) data structures that describe -** the table named P3 in database P1. This is called after a table -** is dropped in order to keep the internal representation of the -** schema consistent with what is on disk. -*/ -case OP_DropTable: { /* no-push */ - sqlite3UnlinkAndDeleteTable(db, pOp->p1, pOp->p3); - break; -} - -/* Opcode: DropIndex P1 * P3 -** -** Remove the internal (in-memory) data structures that describe -** the index named P3 in database P1. This is called after an index -** is dropped in order to keep the internal representation of the -** schema consistent with what is on disk. -*/ -case OP_DropIndex: { /* no-push */ - sqlite3UnlinkAndDeleteIndex(db, pOp->p1, pOp->p3); - break; -} - -/* Opcode: DropTrigger P1 * P3 -** -** Remove the internal (in-memory) data structures that describe -** the trigger named P3 in database P1. This is called after a trigger -** is dropped in order to keep the internal representation of the -** schema consistent with what is on disk. -*/ -case OP_DropTrigger: { /* no-push */ - sqlite3UnlinkAndDeleteTrigger(db, pOp->p1, pOp->p3); - break; -} - - -#ifndef SQLITE_OMIT_INTEGRITY_CHECK -/* Opcode: IntegrityCk * P2 * -** -** Do an analysis of the currently open database. Push onto the -** stack the text of an error message describing any problems. -** If there are no errors, push a "ok" onto the stack. -** -** The root page numbers of all tables in the database are integer -** values on the stack. This opcode pulls as many integers as it -** can off of the stack and uses those numbers as the root pages. -** -** If P2 is not zero, the check is done on the auxiliary database -** file, not the main database file. -** -** This opcode is used for testing purposes only. -*/ -case OP_IntegrityCk: { - int nRoot; - int *aRoot; - int j; - char *z; - - for(nRoot=0; &pTos[-nRoot]>=p->aStack; nRoot++){ - if( (pTos[-nRoot].flags & MEM_Int)==0 ) break; - } - assert( nRoot>0 ); - aRoot = sqliteMallocRaw( sizeof(int*)*(nRoot+1) ); - if( aRoot==0 ) goto no_mem; - for(j=0; j<nRoot; j++){ - Mem *pMem = &pTos[-j]; - aRoot[j] = pMem->i; - } - aRoot[j] = 0; - popStack(&pTos, nRoot); - pTos++; - z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p2].pBt, aRoot, nRoot); - if( z==0 || z[0]==0 ){ - if( z ) sqliteFree(z); - pTos->z = "ok"; - pTos->n = 2; - pTos->flags = MEM_Str | MEM_Static | MEM_Term; - }else{ - pTos->z = z; - pTos->n = strlen(z); - pTos->flags = MEM_Str | MEM_Dyn | MEM_Term; - pTos->xDel = 0; - } - pTos->enc = SQLITE_UTF8; - sqlite3VdbeChangeEncoding(pTos, db->enc); - sqliteFree(aRoot); - break; -} -#endif /* SQLITE_OMIT_INTEGRITY_CHECK */ - -/* Opcode: FifoWrite * * * -** -** Write the integer on the top of the stack -** into the Fifo. -*/ -case OP_FifoWrite: { /* no-push */ - assert( pTos>=p->aStack ); - Integerify(pTos); - sqlite3VdbeFifoPush(&p->sFifo, pTos->i); - assert( (pTos->flags & MEM_Dyn)==0 ); - pTos--; - break; -} - -/* Opcode: FifoRead * P2 * -** -** Attempt to read a single integer from the Fifo -** and push it onto the stack. If the Fifo is empty -** push nothing but instead jump to P2. -*/ -case OP_FifoRead: { - i64 v; - CHECK_FOR_INTERRUPT; - if( sqlite3VdbeFifoPop(&p->sFifo, &v)==SQLITE_DONE ){ - pc = pOp->p2 - 1; - }else{ - pTos++; - pTos->i = v; - pTos->flags = MEM_Int; - } - break; -} - -#ifndef SQLITE_OMIT_TRIGGER -/* Opcode: ContextPush * * * -** -** Save the current Vdbe context such that it can be restored by a ContextPop -** opcode. The context stores the last insert row id, the last statement change -** count, and the current statement change count. -*/ -case OP_ContextPush: { /* no-push */ - int i = p->contextStackTop++; - Context *pContext; - - assert( i>=0 ); - /* FIX ME: This should be allocated as part of the vdbe at compile-time */ - if( i>=p->contextStackDepth ){ - p->contextStackDepth = i+1; - sqlite3ReallocOrFree((void**)&p->contextStack, sizeof(Context)*(i+1)); - if( p->contextStack==0 ) goto no_mem; - } - pContext = &p->contextStack[i]; - pContext->lastRowid = db->lastRowid; - pContext->nChange = p->nChange; - pContext->sFifo = p->sFifo; - sqlite3VdbeFifoInit(&p->sFifo); - break; -} - -/* Opcode: ContextPop * * * -** -** Restore the Vdbe context to the state it was in when contextPush was last -** executed. The context stores the last insert row id, the last statement -** change count, and the current statement change count. -*/ -case OP_ContextPop: { /* no-push */ - Context *pContext = &p->contextStack[--p->contextStackTop]; - assert( p->contextStackTop>=0 ); - db->lastRowid = pContext->lastRowid; - p->nChange = pContext->nChange; - sqlite3VdbeFifoClear(&p->sFifo); - p->sFifo = pContext->sFifo; - break; -} -#endif /* #ifndef SQLITE_OMIT_TRIGGER */ - -/* Opcode: MemStore P1 P2 * -** -** Write the top of the stack into memory location P1. -** P1 should be a small integer since space is allocated -** for all memory locations between 0 and P1 inclusive. -** -** After the data is stored in the memory location, the -** stack is popped once if P2 is 1. If P2 is zero, then -** the original data remains on the stack. -*/ -case OP_MemStore: { /* no-push */ - assert( pTos>=p->aStack ); - assert( pOp->p1>=0 && pOp->p1<p->nMem ); - rc = sqlite3VdbeMemMove(&p->aMem[pOp->p1], pTos); - pTos--; - - /* If P2 is 0 then fall thru to the next opcode, OP_MemLoad, that will - ** restore the top of the stack to its original value. - */ - if( pOp->p2 ){ - break; - } -} -/* Opcode: MemLoad P1 * * -** -** Push a copy of the value in memory location P1 onto the stack. -** -** If the value is a string, then the value pushed is a pointer to -** the string that is stored in the memory location. If the memory -** location is subsequently changed (using OP_MemStore) then the -** value pushed onto the stack will change too. -*/ -case OP_MemLoad: { - int i = pOp->p1; - assert( i>=0 && i<p->nMem ); - pTos++; - sqlite3VdbeMemShallowCopy(pTos, &p->aMem[i], MEM_Ephem); - break; -} - -#ifndef SQLITE_OMIT_AUTOINCREMENT -/* Opcode: MemMax P1 * * -** -** Set the value of memory cell P1 to the maximum of its current value -** and the value on the top of the stack. The stack is unchanged. -** -** This instruction throws an error if the memory cell is not initially -** an integer. -*/ -case OP_MemMax: { /* no-push */ - int i = pOp->p1; - Mem *pMem; - assert( pTos>=p->aStack ); - assert( i>=0 && i<p->nMem ); - pMem = &p->aMem[i]; - Integerify(pMem); - Integerify(pTos); - if( pMem->i<pTos->i){ - pMem->i = pTos->i; - } - break; -} -#endif /* SQLITE_OMIT_AUTOINCREMENT */ - -/* Opcode: MemIncr P1 P2 * -** -** Increment the integer valued memory cell P1 by 1. If P2 is not zero -** and the result after the increment is exactly 1, then jump -** to P2. -** -** This instruction throws an error if the memory cell is not initially -** an integer. -*/ -case OP_MemIncr: { /* no-push */ - int i = pOp->p1; - Mem *pMem; - assert( i>=0 && i<p->nMem ); - pMem = &p->aMem[i]; - assert( pMem->flags==MEM_Int ); - pMem->i++; - if( pOp->p2>0 && pMem->i==1 ){ - pc = pOp->p2 - 1; - } - break; -} - -/* Opcode: IfMemPos P1 P2 * -** -** If the value of memory cell P1 is 1 or greater, jump to P2. This -** opcode assumes that memory cell P1 holds an integer value. -*/ -case OP_IfMemPos: { /* no-push */ - int i = pOp->p1; - Mem *pMem; - assert( i>=0 && i<p->nMem ); - pMem = &p->aMem[i]; - assert( pMem->flags==MEM_Int ); - if( pMem->i>0 ){ - pc = pOp->p2 - 1; - } - break; -} - -/* Opcode: MemNull P1 * * -** -** Store a NULL in memory cell P1 -*/ -case OP_MemNull: { - assert( pOp->p1>=0 && pOp->p1<p->nMem ); - sqlite3VdbeMemSetNull(&p->aMem[pOp->p1]); - break; -} - -/* Opcode: MemInt P1 P2 * -** -** Store the integer value P1 in memory cell P2. -*/ -case OP_MemInt: { - assert( pOp->p2>=0 && pOp->p2<p->nMem ); - sqlite3VdbeMemSetInt64(&p->aMem[pOp->p2], pOp->p1); - break; -} - -/* Opcode: MemMove P1 P2 * -** -** Move the content of memory cell P2 over to memory cell P1. -** Any prior content of P1 is erased. Memory cell P2 is left -** containing a NULL. -*/ -case OP_MemMove: { - assert( pOp->p1>=0 && pOp->p1<p->nMem ); - assert( pOp->p2>=0 && pOp->p2<p->nMem ); - rc = sqlite3VdbeMemMove(&p->aMem[pOp->p1], &p->aMem[pOp->p2]); - break; -} - -/* Opcode: AggStep P1 P2 P3 -** -** Execute the step function for an aggregate. The -** function has P2 arguments. P3 is a pointer to the FuncDef -** structure that specifies the function. Use memory location -** P1 as the accumulator. -** -** The P2 arguments are popped from the stack. -*/ -case OP_AggStep: { /* no-push */ - int n = pOp->p2; - int i; - Mem *pMem, *pRec; - sqlite3_context ctx; - sqlite3_value **apVal; - - assert( n>=0 ); - pRec = &pTos[1-n]; - assert( pRec>=p->aStack ); - apVal = p->apArg; - assert( apVal || n==0 ); - for(i=0; i<n; i++, pRec++){ - apVal[i] = pRec; - storeTypeInfo(pRec, db->enc); - } - ctx.pFunc = (FuncDef*)pOp->p3; - assert( pOp->p1>=0 && pOp->p1<p->nMem ); - ctx.pMem = pMem = &p->aMem[pOp->p1]; - pMem->n++; - ctx.isError = 0; - ctx.pColl = 0; - if( ctx.pFunc->needCollSeq ){ - assert( pOp>p->aOp ); - assert( pOp[-1].p3type==P3_COLLSEQ ); - assert( pOp[-1].opcode==OP_CollSeq ); - ctx.pColl = (CollSeq *)pOp[-1].p3; - } - (ctx.pFunc->xStep)(&ctx, n, apVal); - popStack(&pTos, n); - if( ctx.isError ){ - rc = SQLITE_ERROR; - } - break; -} - -/* Opcode: AggFinal P1 P2 P3 -** -** Execute the finalizer function for an aggregate. P1 is -** the memory location that is the accumulator for the aggregate. -** -** P2 is the number of arguments that the step function takes and -** P3 is a pointer to the FuncDef for this function. The P2 -** argument is not used by this opcode. It is only there to disambiguate -** functions that can take varying numbers of arguments. The -** P3 argument is only needed for the degenerate case where -** the step function was not previously called. -*/ -case OP_AggFinal: { /* no-push */ - Mem *pMem; - assert( pOp->p1>=0 && pOp->p1<p->nMem ); - pMem = &p->aMem[pOp->p1]; - assert( (pMem->flags & ~(MEM_Null|MEM_Agg))==0 ); - sqlite3VdbeMemFinalize(pMem, (FuncDef*)pOp->p3); - break; -} - - -/* Opcode: Vacuum * * * -** -** Vacuum the entire database. This opcode will cause other virtual -** machines to be created and run. It may not be called from within -** a transaction. -*/ -case OP_Vacuum: { /* no-push */ - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; - rc = sqlite3RunVacuum(&p->zErrMsg, db); - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; - break; -} - -/* Opcode: Expire P1 * * -** -** Cause precompiled statements to become expired. An expired statement -** fails with an error code of SQLITE_SCHEMA if it is ever executed -** (via sqlite3_step()). -** -** If P1 is 0, then all SQL statements become expired. If P1 is non-zero, -** then only the currently executing statement is affected. -*/ -case OP_Expire: { /* no-push */ - if( !pOp->p1 ){ - sqlite3ExpirePreparedStatements(db); - }else{ - p->expired = 1; - } - break; -} - - -/* An other opcode is illegal... -*/ -default: { - assert( 0 ); - break; -} - -/***************************************************************************** -** The cases of the switch statement above this line should all be indented -** by 6 spaces. But the left-most 6 spaces have been removed to improve the -** readability. From this point on down, the normal indentation rules are -** restored. -*****************************************************************************/ - } - - /* Make sure the stack limit was not exceeded */ - assert( pTos<=pStackLimit ); - -#ifdef VDBE_PROFILE - { - long long elapse = hwtime() - start; - pOp->cycles += elapse; - pOp->cnt++; -#if 0 - fprintf(stdout, "%10lld ", elapse); - sqlite3VdbePrintOp(stdout, origPc, &p->aOp[origPc]); -#endif - } -#endif - - /* The following code adds nothing to the actual functionality - ** of the program. It is only here for testing and debugging. - ** On the other hand, it does burn CPU cycles every time through - ** the evaluator loop. So we can leave it out when NDEBUG is defined. - */ -#ifndef NDEBUG - /* Sanity checking on the top element of the stack */ - if( pTos>=p->aStack ){ - sqlite3VdbeMemSanity(pTos, db->enc); - } - assert( pc>=-1 && pc<p->nOp ); -#ifdef SQLITE_DEBUG - /* Code for tracing the vdbe stack. */ - if( p->trace && pTos>=p->aStack ){ - int i; - fprintf(p->trace, "Stack:"); - for(i=0; i>-5 && &pTos[i]>=p->aStack; i--){ - if( pTos[i].flags & MEM_Null ){ - fprintf(p->trace, " NULL"); - }else if( (pTos[i].flags & (MEM_Int|MEM_Str))==(MEM_Int|MEM_Str) ){ - fprintf(p->trace, " si:%lld", pTos[i].i); - }else if( pTos[i].flags & MEM_Int ){ - fprintf(p->trace, " i:%lld", pTos[i].i); - }else if( pTos[i].flags & MEM_Real ){ - fprintf(p->trace, " r:%g", pTos[i].r); - }else{ - char zBuf[100]; - sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf, 100); - fprintf(p->trace, " "); - fprintf(p->trace, "%s", zBuf); - } - } - if( rc!=0 ) fprintf(p->trace," rc=%d",rc); - fprintf(p->trace,"\n"); - } -#endif /* SQLITE_DEBUG */ -#endif /* NDEBUG */ - } /* The end of the for(;;) loop the loops through opcodes */ - - /* If we reach this point, it means that execution is finished. - */ -vdbe_halt: - if( rc ){ - p->rc = rc; - rc = SQLITE_ERROR; - }else{ - rc = SQLITE_DONE; - } - sqlite3VdbeHalt(p); - p->pTos = pTos; - return rc; - - /* Jump to here if a malloc() fails. It's hard to get a malloc() - ** to fail on a modern VM computer, so this code is untested. - */ -no_mem: - sqlite3SetString(&p->zErrMsg, "out of memory", (char*)0); - rc = SQLITE_NOMEM; - goto vdbe_halt; - - /* Jump to here for an SQLITE_MISUSE error. - */ -abort_due_to_misuse: - rc = SQLITE_MISUSE; - /* Fall thru into abort_due_to_error */ - - /* Jump to here for any other kind of fatal error. The "rc" variable - ** should hold the error number. - */ -abort_due_to_error: - if( p->zErrMsg==0 ){ - if( sqlite3_malloc_failed ) rc = SQLITE_NOMEM; - sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0); - } - goto vdbe_halt; - - /* Jump to here if the sqlite3_interrupt() API sets the interrupt - ** flag. - */ -abort_due_to_interrupt: - assert( db->flags & SQLITE_Interrupt ); - db->flags &= ~SQLITE_Interrupt; - if( db->magic!=SQLITE_MAGIC_BUSY ){ - rc = SQLITE_MISUSE; - }else{ - rc = SQLITE_INTERRUPT; - } - p->rc = rc; - sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0); - goto vdbe_halt; -} diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.h b/ext/pdo_sqlite/sqlite/src/vdbe.h deleted file mode 100644 index 06932503fcbd2..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbe.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Header file for the Virtual DataBase Engine (VDBE) -** -** This header defines the interface to the virtual database engine -** or VDBE. The VDBE implements an abstract machine that runs a -** simple program to access and modify the underlying database. -** -** $Id$ -*/ -#ifndef _SQLITE_VDBE_H_ -#define _SQLITE_VDBE_H_ -#include <stdio.h> - -/* -** A single VDBE is an opaque structure named "Vdbe". Only routines -** in the source file sqliteVdbe.c are allowed to see the insides -** of this structure. -*/ -typedef struct Vdbe Vdbe; - -/* -** A single instruction of the virtual machine has an opcode -** and as many as three operands. The instruction is recorded -** as an instance of the following structure: -*/ -struct VdbeOp { - u8 opcode; /* What operation to perform */ - int p1; /* First operand */ - int p2; /* Second parameter (often the jump destination) */ - char *p3; /* Third parameter */ - int p3type; /* One of the P3_xxx constants defined below */ -#ifdef VDBE_PROFILE - int cnt; /* Number of times this instruction was executed */ - long long cycles; /* Total time spend executing this instruction */ -#endif -}; -typedef struct VdbeOp VdbeOp; - -/* -** A smaller version of VdbeOp used for the VdbeAddOpList() function because -** it takes up less space. -*/ -struct VdbeOpList { - u8 opcode; /* What operation to perform */ - signed char p1; /* First operand */ - short int p2; /* Second parameter (often the jump destination) */ - char *p3; /* Third parameter */ -}; -typedef struct VdbeOpList VdbeOpList; - -/* -** Allowed values of VdbeOp.p3type -*/ -#define P3_NOTUSED 0 /* The P3 parameter is not used */ -#define P3_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ -#define P3_STATIC (-2) /* Pointer to a static string */ -#define P3_COLLSEQ (-4) /* P3 is a pointer to a CollSeq structure */ -#define P3_FUNCDEF (-5) /* P3 is a pointer to a FuncDef structure */ -#define P3_KEYINFO (-6) /* P3 is a pointer to a KeyInfo structure */ -#define P3_VDBEFUNC (-7) /* P3 is a pointer to a VdbeFunc structure */ -#define P3_MEM (-8) /* P3 is a pointer to a Mem* structure */ - -/* When adding a P3 argument using P3_KEYINFO, a copy of the KeyInfo structure -** is made. That copy is freed when the Vdbe is finalized. But if the -** argument is P3_KEYINFO_HANDOFF, the passed in pointer is used. It still -** gets freed when the Vdbe is finalized so it still should be obtained -** from a single sqliteMalloc(). But no copy is made and the calling -** function should *not* try to free the KeyInfo. -*/ -#define P3_KEYINFO_HANDOFF (-9) - -/* -** The following macro converts a relative address in the p2 field -** of a VdbeOp structure into a negative number so that -** sqlite3VdbeAddOpList() knows that the address is relative. Calling -** the macro again restores the address. -*/ -#define ADDR(X) (-1-(X)) - -/* -** The makefile scans the vdbe.c source file and creates the "opcodes.h" -** header file that defines a number for each opcode used by the VDBE. -*/ -#include "opcodes.h" - -/* -** Prototypes for the VDBE interface. See comments on the implementation -** for a description of what each of these routines does. -*/ -Vdbe *sqlite3VdbeCreate(sqlite3*); -void sqlite3VdbeCreateCallback(Vdbe*, int*); -int sqlite3VdbeAddOp(Vdbe*,int,int,int); -int sqlite3VdbeOp3(Vdbe*,int,int,int,const char *zP3,int); -int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp); -void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1); -void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); -void sqlite3VdbeJumpHere(Vdbe*, int addr); -void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N); -VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); -int sqlite3VdbeMakeLabel(Vdbe*); -void sqlite3VdbeDelete(Vdbe*); -void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int); -int sqlite3VdbeFinalize(Vdbe*); -void sqlite3VdbeResolveLabel(Vdbe*, int); -int sqlite3VdbeCurrentAddr(Vdbe*); -void sqlite3VdbeTrace(Vdbe*,FILE*); -int sqlite3VdbeReset(Vdbe*); -int sqliteVdbeSetVariables(Vdbe*,int,const char**); -void sqlite3VdbeSetNumCols(Vdbe*,int); -int sqlite3VdbeSetColName(Vdbe*, int, const char *, int); -void sqlite3VdbeCountChanges(Vdbe*); -sqlite3 *sqlite3VdbeDb(Vdbe*); - -#ifndef NDEBUG - void sqlite3VdbeComment(Vdbe*, const char*, ...); -# define VdbeComment(X) sqlite3VdbeComment X -#else -# define VdbeComment(X) -#endif - -#endif diff --git a/ext/pdo_sqlite/sqlite/src/vdbeInt.h b/ext/pdo_sqlite/sqlite/src/vdbeInt.h deleted file mode 100644 index 1746ee561f2b6..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbeInt.h +++ /dev/null @@ -1,377 +0,0 @@ -/* -** 2003 September 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the header file for information that is private to the -** VDBE. This information used to all be at the top of the single -** source code file "vdbe.c". When that file became too big (over -** 6000 lines long) it was split up into several smaller files and -** this header information was factored out. -*/ - -/* -** intToKey() and keyToInt() used to transform the rowid. But with -** the latest versions of the design they are no-ops. -*/ -#define keyToInt(X) (X) -#define intToKey(X) (X) - -/* -** The makefile scans the vdbe.c source file and creates the following -** array of string constants which are the names of all VDBE opcodes. This -** array is defined in a separate source code file named opcode.c which is -** automatically generated by the makefile. -*/ -extern char *sqlite3OpcodeNames[]; - -/* -** SQL is translated into a sequence of instructions to be -** executed by a virtual machine. Each instruction is an instance -** of the following structure. -*/ -typedef struct VdbeOp Op; - -/* -** Boolean values -*/ -typedef unsigned char Bool; - -/* -** A cursor is a pointer into a single BTree within a database file. -** The cursor can seek to a BTree entry with a particular key, or -** loop over all entries of the Btree. You can also insert new BTree -** entries or retrieve the key or data from the entry that the cursor -** is currently pointing to. -** -** Every cursor that the virtual machine has open is represented by an -** instance of the following structure. -** -** If the Cursor.isTriggerRow flag is set it means that this cursor is -** really a single row that represents the NEW or OLD pseudo-table of -** a row trigger. The data for the row is stored in Cursor.pData and -** the rowid is in Cursor.iKey. -*/ -struct Cursor { - BtCursor *pCursor; /* The cursor structure of the backend */ - i64 lastRowid; /* Last rowid from a Next or NextIdx operation */ - i64 nextRowid; /* Next rowid returned by OP_NewRowid */ - Bool zeroed; /* True if zeroed out and ready for reuse */ - Bool rowidIsValid; /* True if lastRowid is valid */ - Bool atFirst; /* True if pointing to first entry */ - Bool useRandomRowid; /* Generate new record numbers semi-randomly */ - Bool nullRow; /* True if pointing to a row with no data */ - Bool nextRowidValid; /* True if the nextRowid field is valid */ - Bool pseudoTable; /* This is a NEW or OLD pseudo-tables of a trigger */ - Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */ - Bool isTable; /* True if a table requiring integer keys */ - Bool isIndex; /* True if an index containing keys only - no data */ - u8 bogusIncrKey; /* Something for pIncrKey to point to if pKeyInfo==0 */ - i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */ - Btree *pBt; /* Separate file holding temporary table */ - int nData; /* Number of bytes in pData */ - char *pData; /* Data for a NEW or OLD pseudo-table */ - i64 iKey; /* Key for the NEW or OLD pseudo-table row */ - u8 *pIncrKey; /* Pointer to pKeyInfo->incrKey */ - KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */ - int nField; /* Number of fields in the header */ - i64 seqCount; /* Sequence counter */ - - /* Cached information about the header for the data record that the - ** cursor is currently pointing to. Only valid if cacheValid is true. - ** zRow might point to (ephemeral) data for the current row, or it might - ** be NULL. */ - Bool cacheValid; /* True if the cache is valid */ - int payloadSize; /* Total number of bytes in the record */ - u32 *aType; /* Type values for all entries in the record */ - u32 *aOffset; /* Cached offsets to the start of each columns data */ - u8 *aRow; /* Data for the current row, if all on one page */ -}; -typedef struct Cursor Cursor; - -/* -** Number of bytes of string storage space available to each stack -** layer without having to malloc. NBFS is short for Number of Bytes -** For Strings. -*/ -#define NBFS 32 - -/* -** Internally, the vdbe manipulates nearly all SQL values as Mem -** structures. Each Mem struct may cache multiple representations (string, -** integer etc.) of the same value. A value (and therefore Mem structure) -** has the following properties: -** -** Each value has a manifest type. The manifest type of the value stored -** in a Mem struct is returned by the MemType(Mem*) macro. The type is -** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or -** SQLITE_BLOB. -*/ -struct Mem { - i64 i; /* Integer value. Or FuncDef* when flags==MEM_Agg */ - double r; /* Real value */ - char *z; /* String or BLOB value */ - int n; /* Number of characters in string value, including '\0' */ - u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */ - u8 type; /* One of MEM_Null, MEM_Str, etc. */ - u8 enc; /* TEXT_Utf8, TEXT_Utf16le, or TEXT_Utf16be */ - void (*xDel)(void *); /* If not null, call this function to delete Mem.z */ - char zShort[NBFS]; /* Space for short strings */ -}; -typedef struct Mem Mem; - -/* One or more of the following flags are set to indicate the validOK -** representations of the value stored in the Mem struct. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** No other flags may be set in this case. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. -** -** Multiple of these values can appear in Mem.flags. But only one -** at a time can appear in Mem.type. -*/ -#define MEM_Null 0x0001 /* Value is NULL */ -#define MEM_Str 0x0002 /* Value is a string */ -#define MEM_Int 0x0004 /* Value is an integer */ -#define MEM_Real 0x0008 /* Value is a real number */ -#define MEM_Blob 0x0010 /* Value is a BLOB */ - -/* Whenever Mem contains a valid string or blob representation, one of -** the following flags must be set to determine the memory management -** policy for Mem.z. The MEM_Term flag tells us whether or not the -** string is \000 or \u0000 terminated -*/ -#define MEM_Term 0x0020 /* String rep is nul terminated */ -#define MEM_Dyn 0x0040 /* Need to call sqliteFree() on Mem.z */ -#define MEM_Static 0x0080 /* Mem.z points to a static string */ -#define MEM_Ephem 0x0100 /* Mem.z points to an ephemeral string */ -#define MEM_Short 0x0200 /* Mem.z points to Mem.zShort */ -#define MEM_Agg 0x0400 /* Mem.z points to an agg function context */ - - -/* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains -** additional information about auxiliary information bound to arguments -** of the function. This is used to implement the sqlite3_get_auxdata() -** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data -** that can be associated with a constant argument to a function. This -** allows functions such as "regexp" to compile their constant regular -** expression argument once and reused the compiled code for multiple -** invocations. -*/ -struct VdbeFunc { - FuncDef *pFunc; /* The definition of the function */ - int nAux; /* Number of entries allocated for apAux[] */ - struct AuxData { - void *pAux; /* Aux data for the i-th argument */ - void (*xDelete)(void *); /* Destructor for the aux data */ - } apAux[1]; /* One slot for each function argument */ -}; -typedef struct VdbeFunc VdbeFunc; - -/* -** The "context" argument for a installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. -*/ -struct sqlite3_context { - FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ - VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ - Mem s; /* The return value is stored here */ - Mem *pMem; /* Memory cell used to store aggregate context */ - u8 isError; /* Set to true for an error */ - CollSeq *pColl; /* Collating sequence */ -}; - -/* -** A Set structure is used for quick testing to see if a value -** is part of a small set. Sets are used to implement code like -** this: -** x.y IN ('hi','hoo','hum') -*/ -typedef struct Set Set; -struct Set { - Hash hash; /* A set is just a hash table */ - HashElem *prev; /* Previously accessed hash elemen */ -}; - -/* -** A FifoPage structure holds a single page of valves. Pages are arranged -** in a list. -*/ -typedef struct FifoPage FifoPage; -struct FifoPage { - int nSlot; /* Number of entries aSlot[] */ - int iWrite; /* Push the next value into this entry in aSlot[] */ - int iRead; /* Read the next value from this entry in aSlot[] */ - FifoPage *pNext; /* Next page in the fifo */ - i64 aSlot[1]; /* One or more slots for rowid values */ -}; - -/* -** The Fifo structure is typedef-ed in vdbeInt.h. But the implementation -** of that structure is private to this file. -** -** The Fifo structure describes the entire fifo. -*/ -typedef struct Fifo Fifo; -struct Fifo { - int nEntry; /* Total number of entries */ - FifoPage *pFirst; /* First page on the list */ - FifoPage *pLast; /* Last page on the list */ -}; - -/* -** A Context stores the last insert rowid, the last statement change count, -** and the current statement change count (i.e. changes since last statement). -** The current keylist is also stored in the context. -** Elements of Context structure type make up the ContextStack, which is -** updated by the ContextPush and ContextPop opcodes (used by triggers). -** The context is pushed before executing a trigger a popped when the -** trigger finishes. -*/ -typedef struct Context Context; -struct Context { - int lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ - int nChange; /* Statement changes (Vdbe.nChanges) */ - Fifo sFifo; /* Records that will participate in a DELETE or UPDATE */ -}; - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile() -** is really a pointer to an instance of this structure. -*/ -struct Vdbe { - sqlite3 *db; /* The whole database */ - Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ - FILE *trace; /* Write an execution trace here, if not NULL */ - int nOp; /* Number of instructions in the program */ - int nOpAlloc; /* Number of slots allocated for aOp[] */ - Op *aOp; /* Space to hold the virtual machine's program */ - int nLabel; /* Number of labels used */ - int nLabelAlloc; /* Number of slots allocated in aLabel[] */ - int *aLabel; /* Space to hold the labels */ - Mem *aStack; /* The operand stack, except string values */ - Mem *pTos; /* Top entry in the operand stack */ - Mem **apArg; /* Arguments to currently executing user function */ - Mem *aColName; /* Column names to return */ - int nCursor; /* Number of slots in apCsr[] */ - Cursor **apCsr; /* One element of this array for each open cursor */ - int nVar; /* Number of entries in aVar[] */ - Mem *aVar; /* Values for the OP_Variable opcode. */ - char **azVar; /* Name of variables */ - int okVar; /* True if azVar[] has been initialized */ - int magic; /* Magic number for sanity checking */ - int nMem; /* Number of memory locations currently allocated */ - Mem *aMem; /* The memory locations */ - int nCallback; /* Number of callbacks invoked so far */ - Fifo sFifo; /* A list of ROWIDs */ - int contextStackTop; /* Index of top element in the context stack */ - int contextStackDepth; /* The size of the "context" stack */ - Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/ - int pc; /* The program counter */ - int rc; /* Value to return */ - unsigned uniqueCnt; /* Used by OP_MakeRecord when P2!=0 */ - int errorAction; /* Recovery action to do in case of an error */ - int inTempTrans; /* True if temp database is transactioned */ - int returnStack[100]; /* Return address stack for OP_Gosub & OP_Return */ - int returnDepth; /* Next unused element in returnStack[] */ - int nResColumn; /* Number of columns in one row of the result set */ - char **azResColumn; /* Values for one row of result */ - int popStack; /* Pop the stack this much on entry to VdbeExec() */ - char *zErrMsg; /* Error message written here */ - u8 resOnStack; /* True if there are result values on the stack */ - u8 explain; /* True if EXPLAIN present on SQL command */ - u8 changeCntOn; /* True to update the change-counter */ - u8 aborted; /* True if ROLLBACK in another VM causes an abort */ - u8 expired; /* True if the VM needs to be recompiled */ - int nChange; /* Number of db changes made since last reset */ - i64 startTime; /* Time when query started - used for profiling */ -}; - -/* -** The following are allowed values for Vdbe.magic -*/ -#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */ -#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */ -#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */ -#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */ - -/* -** Function prototypes -*/ -void sqlite3VdbeFreeCursor(Cursor*); -void sqliteVdbePopStack(Vdbe*,int); -int sqlite3VdbeCursorMoveto(Cursor*); -#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) -void sqlite3VdbePrintOp(FILE*, int, Op*); -#endif -#ifdef SQLITE_DEBUG -void sqlite3VdbePrintSql(Vdbe*); -#endif -int sqlite3VdbeSerialTypeLen(u32); -u32 sqlite3VdbeSerialType(Mem*); -int sqlite3VdbeSerialPut(unsigned char*, Mem*); -int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); -void sqlite3VdbeDeleteAuxData(VdbeFunc*, int); - -int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); -int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*); -int sqlite3VdbeIdxRowid(BtCursor *, i64 *); -int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); -int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*); -int sqlite3VdbeIdxRowidLen(int,const u8*); -int sqlite3VdbeExec(Vdbe*); -int sqlite3VdbeList(Vdbe*); -int sqlite3VdbeHalt(Vdbe*); -int sqlite3VdbeChangeEncoding(Mem *, int); -int sqlite3VdbeMemCopy(Mem*, const Mem*); -void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int); -int sqlite3VdbeMemMove(Mem*, Mem*); -int sqlite3VdbeMemNulTerminate(Mem*); -int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*)); -void sqlite3VdbeMemSetInt64(Mem*, i64); -void sqlite3VdbeMemSetDouble(Mem*, double); -void sqlite3VdbeMemSetNull(Mem*); -int sqlite3VdbeMemMakeWriteable(Mem*); -int sqlite3VdbeMemDynamicify(Mem*); -int sqlite3VdbeMemStringify(Mem*, int); -i64 sqlite3VdbeIntValue(Mem*); -int sqlite3VdbeMemIntegerify(Mem*); -double sqlite3VdbeRealValue(Mem*); -int sqlite3VdbeMemRealify(Mem*); -int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*); -void sqlite3VdbeMemRelease(Mem *p); -void sqlite3VdbeMemFinalize(Mem*, FuncDef*); -#ifndef NDEBUG -void sqlite3VdbeMemSanity(Mem*, u8); -int sqlite3VdbeOpcodeNoPush(u8); -#endif -int sqlite3VdbeMemTranslate(Mem*, u8); -void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf); -int sqlite3VdbeMemHandleBom(Mem *pMem); -void sqlite3VdbeFifoInit(Fifo*); -int sqlite3VdbeFifoPush(Fifo*, i64); -int sqlite3VdbeFifoPop(Fifo*, i64*); -void sqlite3VdbeFifoClear(Fifo*); diff --git a/ext/pdo_sqlite/sqlite/src/vdbeapi.c b/ext/pdo_sqlite/sqlite/src/vdbeapi.c deleted file mode 100644 index 2fd54f38e3ee7..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbeapi.c +++ /dev/null @@ -1,737 +0,0 @@ -/* -** 2004 May 26 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** -** This file contains code use to implement APIs that are part of the -** VDBE. -*/ -#include "sqliteInt.h" -#include "vdbeInt.h" -#include "os.h" - -/* -** Return TRUE (non-zero) of the statement supplied as an argument needs -** to be recompiled. A statement needs to be recompiled whenever the -** execution environment changes in a way that would alter the program -** that sqlite3_prepare() generates. For example, if new functions or -** collating sequences are registered or if an authorizer function is -** added or changed. -*/ -int sqlite3_expired(sqlite3_stmt *pStmt){ - Vdbe *p = (Vdbe*)pStmt; - return p==0 || p->expired; -} - -/**************************** sqlite3_value_ ******************************* -** The following routines extract information from a Mem or sqlite3_value -** structure. -*/ -const void *sqlite3_value_blob(sqlite3_value *pVal){ - Mem *p = (Mem*)pVal; - if( p->flags & (MEM_Blob|MEM_Str) ){ - return p->z; - }else{ - return sqlite3_value_text(pVal); - } -} -int sqlite3_value_bytes(sqlite3_value *pVal){ - return sqlite3ValueBytes(pVal, SQLITE_UTF8); -} -int sqlite3_value_bytes16(sqlite3_value *pVal){ - return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE); -} -double sqlite3_value_double(sqlite3_value *pVal){ - return sqlite3VdbeRealValue((Mem*)pVal); -} -int sqlite3_value_int(sqlite3_value *pVal){ - return sqlite3VdbeIntValue((Mem*)pVal); -} -sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){ - return sqlite3VdbeIntValue((Mem*)pVal); -} -const unsigned char *sqlite3_value_text(sqlite3_value *pVal){ - return (const char *)sqlite3ValueText(pVal, SQLITE_UTF8); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_value_text16(sqlite3_value* pVal){ - return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE); -} -const void *sqlite3_value_text16be(sqlite3_value *pVal){ - return sqlite3ValueText(pVal, SQLITE_UTF16BE); -} -const void *sqlite3_value_text16le(sqlite3_value *pVal){ - return sqlite3ValueText(pVal, SQLITE_UTF16LE); -} -#endif /* SQLITE_OMIT_UTF16 */ -int sqlite3_value_type(sqlite3_value* pVal){ - return pVal->type; -} - -/**************************** sqlite3_result_ ******************************* -** The following routines are used by user-defined functions to specify -** the function result. -*/ -void sqlite3_result_blob( - sqlite3_context *pCtx, - const void *z, - int n, - void (*xDel)(void *) -){ - assert( n>=0 ); - sqlite3VdbeMemSetStr(&pCtx->s, z, n, 0, xDel); -} -void sqlite3_result_double(sqlite3_context *pCtx, double rVal){ - sqlite3VdbeMemSetDouble(&pCtx->s, rVal); -} -void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ - pCtx->isError = 1; - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT); -} -void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ - pCtx->isError = 1; - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT); -} -void sqlite3_result_int(sqlite3_context *pCtx, int iVal){ - sqlite3VdbeMemSetInt64(&pCtx->s, (i64)iVal); -} -void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ - sqlite3VdbeMemSetInt64(&pCtx->s, iVal); -} -void sqlite3_result_null(sqlite3_context *pCtx){ - sqlite3VdbeMemSetNull(&pCtx->s); -} -void sqlite3_result_text( - sqlite3_context *pCtx, - const char *z, - int n, - void (*xDel)(void *) -){ - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, xDel); -} -#ifndef SQLITE_OMIT_UTF16 -void sqlite3_result_text16( - sqlite3_context *pCtx, - const void *z, - int n, - void (*xDel)(void *) -){ - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, xDel); -} -void sqlite3_result_text16be( - sqlite3_context *pCtx, - const void *z, - int n, - void (*xDel)(void *) -){ - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16BE, xDel); -} -void sqlite3_result_text16le( - sqlite3_context *pCtx, - const void *z, - int n, - void (*xDel)(void *) -){ - sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16LE, xDel); -} -#endif /* SQLITE_OMIT_UTF16 */ -void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ - sqlite3VdbeMemCopy(&pCtx->s, pValue); -} - - -/* -** Execute the statement pStmt, either until a row of data is ready, the -** statement is completely executed or an error occurs. -*/ -int sqlite3_step(sqlite3_stmt *pStmt){ - Vdbe *p = (Vdbe*)pStmt; - sqlite3 *db; - int rc; - - if( p==0 || p->magic!=VDBE_MAGIC_RUN ){ - return SQLITE_MISUSE; - } - if( p->aborted ){ - return SQLITE_ABORT; - } - if( p->pc<=0 && p->expired ){ - if( p->rc==SQLITE_OK ){ - p->rc = SQLITE_SCHEMA; - } - return SQLITE_ERROR; - } - db = p->db; - if( sqlite3SafetyOn(db) ){ - p->rc = SQLITE_MISUSE; - return SQLITE_MISUSE; - } - if( p->pc<0 ){ -#ifndef SQLITE_OMIT_TRACE - /* Invoke the trace callback if there is one - */ - if( db->xTrace && !db->init.busy ){ - assert( p->nOp>0 ); - assert( p->aOp[p->nOp-1].opcode==OP_Noop ); - assert( p->aOp[p->nOp-1].p3!=0 ); - assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC ); - sqlite3SafetyOff(db); - db->xTrace(db->pTraceArg, p->aOp[p->nOp-1].p3); - if( sqlite3SafetyOn(db) ){ - p->rc = SQLITE_MISUSE; - return SQLITE_MISUSE; - } - } - if( db->xProfile && !db->init.busy ){ - double rNow; - sqlite3OsCurrentTime(&rNow); - p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0; - } -#endif - - /* Print a copy of SQL as it is executed if the SQL_TRACE pragma is turned - ** on in debugging mode. - */ -#ifdef SQLITE_DEBUG - if( (db->flags & SQLITE_SqlTrace)!=0 ){ - sqlite3DebugPrintf("SQL-trace: %s\n", p->aOp[p->nOp-1].p3); - } -#endif /* SQLITE_DEBUG */ - - db->activeVdbeCnt++; - p->pc = 0; - } -#ifndef SQLITE_OMIT_EXPLAIN - if( p->explain ){ - rc = sqlite3VdbeList(p); - }else -#endif /* SQLITE_OMIT_EXPLAIN */ - { - rc = sqlite3VdbeExec(p); - } - - if( sqlite3SafetyOff(db) ){ - rc = SQLITE_MISUSE; - } - -#ifndef SQLITE_OMIT_TRACE - /* Invoke the profile callback if there is one - */ - if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy ){ - double rNow; - u64 elapseTime; - - sqlite3OsCurrentTime(&rNow); - elapseTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0 - p->startTime; - assert( p->nOp>0 ); - assert( p->aOp[p->nOp-1].opcode==OP_Noop ); - assert( p->aOp[p->nOp-1].p3!=0 ); - assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC ); - db->xProfile(db->pProfileArg, p->aOp[p->nOp-1].p3, elapseTime); - } -#endif - - sqlite3Error(p->db, rc, p->zErrMsg ? "%s" : 0, p->zErrMsg); - return rc; -} - -/* -** Extract the user data from a sqlite3_context structure and return a -** pointer to it. -*/ -void *sqlite3_user_data(sqlite3_context *p){ - assert( p && p->pFunc ); - return p->pFunc->pUserData; -} - -/* -** Allocate or return the aggregate context for a user function. A new -** context is allocated on the first call. Subsequent calls return the -** same context that was returned on prior calls. -*/ -void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ - Mem *pMem = p->pMem; - assert( p && p->pFunc && p->pFunc->xStep ); - if( (pMem->flags & MEM_Agg)==0 ){ - if( nByte==0 ){ - assert( pMem->flags==MEM_Null ); - pMem->z = 0; - }else{ - pMem->flags = MEM_Agg; - pMem->xDel = sqlite3FreeX; - *(FuncDef**)&pMem->i = p->pFunc; - if( nByte<=NBFS ){ - pMem->z = pMem->zShort; - memset(pMem->z, 0, nByte); - }else{ - pMem->z = sqliteMalloc( nByte ); - } - } - } - return (void*)pMem->z; -} - -/* -** Return the auxilary data pointer, if any, for the iArg'th argument to -** the user-function defined by pCtx. -*/ -void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ - VdbeFunc *pVdbeFunc = pCtx->pVdbeFunc; - if( !pVdbeFunc || iArg>=pVdbeFunc->nAux || iArg<0 ){ - return 0; - } - return pVdbeFunc->apAux[iArg].pAux; -} - -/* -** Set the auxilary data pointer and delete function, for the iArg'th -** argument to the user-function defined by pCtx. Any previous value is -** deleted by calling the delete function specified when it was set. -*/ -void sqlite3_set_auxdata( - sqlite3_context *pCtx, - int iArg, - void *pAux, - void (*xDelete)(void*) -){ - struct AuxData *pAuxData; - VdbeFunc *pVdbeFunc; - if( iArg<0 ) return; - - pVdbeFunc = pCtx->pVdbeFunc; - if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){ - int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg; - pVdbeFunc = sqliteRealloc(pVdbeFunc, nMalloc); - if( !pVdbeFunc ) return; - pCtx->pVdbeFunc = pVdbeFunc; - memset(&pVdbeFunc->apAux[pVdbeFunc->nAux], 0, - sizeof(struct AuxData)*(iArg+1-pVdbeFunc->nAux)); - pVdbeFunc->nAux = iArg+1; - pVdbeFunc->pFunc = pCtx->pFunc; - } - - pAuxData = &pVdbeFunc->apAux[iArg]; - if( pAuxData->pAux && pAuxData->xDelete ){ - pAuxData->xDelete(pAuxData->pAux); - } - pAuxData->pAux = pAux; - pAuxData->xDelete = xDelete; -} - -/* -** Return the number of times the Step function of a aggregate has been -** called. -** -** This routine is defined here in vdbe.c because it depends on knowing -** the internals of the sqlite3_context structure which is only defined in -** this source file. -*/ -int sqlite3_aggregate_count(sqlite3_context *p){ - assert( p && p->pFunc && p->pFunc->xStep ); - return p->pMem->n; -} - -/* -** Return the number of columns in the result set for the statement pStmt. -*/ -int sqlite3_column_count(sqlite3_stmt *pStmt){ - Vdbe *pVm = (Vdbe *)pStmt; - return pVm ? pVm->nResColumn : 0; -} - -/* -** Return the number of values available from the current row of the -** currently executing statement pStmt. -*/ -int sqlite3_data_count(sqlite3_stmt *pStmt){ - Vdbe *pVm = (Vdbe *)pStmt; - if( pVm==0 || !pVm->resOnStack ) return 0; - return pVm->nResColumn; -} - - -/* -** Check to see if column iCol of the given statement is valid. If -** it is, return a pointer to the Mem for the value of that column. -** If iCol is not valid, return a pointer to a Mem which has a value -** of NULL. -*/ -static Mem *columnMem(sqlite3_stmt *pStmt, int i){ - Vdbe *pVm = (Vdbe *)pStmt; - int vals = sqlite3_data_count(pStmt); - if( i>=vals || i<0 ){ - static Mem nullMem; - if( nullMem.flags==0 ){ nullMem.flags = MEM_Null; } - sqlite3Error(pVm->db, SQLITE_RANGE, 0); - return &nullMem; - } - return &pVm->pTos[(1-vals)+i]; -} - -/**************************** sqlite3_column_ ******************************* -** The following routines are used to access elements of the current row -** in the result set. -*/ -const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_blob( columnMem(pStmt,i) ); -} -int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_bytes( columnMem(pStmt,i) ); -} -int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_bytes16( columnMem(pStmt,i) ); -} -double sqlite3_column_double(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_double( columnMem(pStmt,i) ); -} -int sqlite3_column_int(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_int( columnMem(pStmt,i) ); -} -sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_int64( columnMem(pStmt,i) ); -} -const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_text( columnMem(pStmt,i) ); -} -#if 0 -sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){ - return columnMem(pStmt, i); -} -#endif -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_text16( columnMem(pStmt,i) ); -} -#endif /* SQLITE_OMIT_UTF16 */ -int sqlite3_column_type(sqlite3_stmt *pStmt, int i){ - return sqlite3_value_type( columnMem(pStmt,i) ); -} - -/* -** Convert the N-th element of pStmt->pColName[] into a string using -** xFunc() then return that string. If N is out of range, return 0. -** -** There are up to 5 names for each column. useType determines which -** name is returned. Here are the names: -** -** 0 The column name as it should be displayed for output -** 1 The datatype name for the column -** 2 The name of the database that the column derives from -** 3 The name of the table that the column derives from -** 4 The name of the table column that the result column derives from -** -** If the result is not a simple column reference (if it is an expression -** or a constant) then useTypes 2, 3, and 4 return NULL. -*/ -static const void *columnName( - sqlite3_stmt *pStmt, - int N, - const void *(*xFunc)(Mem*), - int useType -){ - Vdbe *p = (Vdbe *)pStmt; - int n = sqlite3_column_count(pStmt); - - if( p==0 || N>=n || N<0 ){ - return 0; - } - N += useType*n; - return xFunc(&p->aColName[N]); -} - - -/* -** Return the name of the Nth column of the result set returned by SQL -** statement pStmt. -*/ -const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 0); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 0); -} -#endif - -/* -** Return the column declaration type (if applicable) of the 'i'th column -** of the result set of SQL statement pStmt. -*/ -const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 1); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 1); -} -#endif /* SQLITE_OMIT_UTF16 */ - -#if !defined(SQLITE_OMIT_ORIGIN_NAMES) && 0 -/* -** Return the name of the database from which a result column derives. -** NULL is returned if the result column is an expression or constant or -** anything else which is not an unabiguous reference to a database column. -*/ -const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 2); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 2); -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Return the name of the table from which a result column derives. -** NULL is returned if the result column is an expression or constant or -** anything else which is not an unabiguous reference to a database column. -*/ -const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 3); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 3); -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Return the name of the table column from which a result column derives. -** NULL is returned if the result column is an expression or constant or -** anything else which is not an unabiguous reference to a database column. -*/ -const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 4); -} -#ifndef SQLITE_OMIT_UTF16 -const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ - return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 4); -} -#endif /* SQLITE_OMIT_UTF16 */ -#endif /* SQLITE_OMIT_ORIGIN_NAMES */ - - - - -/******************************* sqlite3_bind_ *************************** -** -** Routines used to attach values to wildcards in a compiled SQL statement. -*/ -/* -** Unbind the value bound to variable i in virtual machine p. This is the -** the same as binding a NULL value to the column. If the "i" parameter is -** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK. -** -** The error code stored in database p->db is overwritten with the return -** value in any case. -*/ -static int vdbeUnbind(Vdbe *p, int i){ - Mem *pVar; - if( p==0 || p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ - if( p ) sqlite3Error(p->db, SQLITE_MISUSE, 0); - return SQLITE_MISUSE; - } - if( i<1 || i>p->nVar ){ - sqlite3Error(p->db, SQLITE_RANGE, 0); - return SQLITE_RANGE; - } - i--; - pVar = &p->aVar[i]; - sqlite3VdbeMemRelease(pVar); - pVar->flags = MEM_Null; - sqlite3Error(p->db, SQLITE_OK, 0); - return SQLITE_OK; -} - -/* -** Bind a text or BLOB value. -*/ -static int bindText( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, - void (*xDel)(void*), - int encoding -){ - Vdbe *p = (Vdbe *)pStmt; - Mem *pVar; - int rc; - - rc = vdbeUnbind(p, i); - if( rc || zData==0 ){ - return rc; - } - pVar = &p->aVar[i-1]; - rc = sqlite3VdbeMemSetStr(pVar, zData, nData, encoding, xDel); - if( rc ){ - return rc; - } - if( rc==SQLITE_OK && encoding!=0 ){ - rc = sqlite3VdbeChangeEncoding(pVar, p->db->enc); - } - return rc; -} - - -/* -** Bind a blob value to an SQL statement variable. -*/ -int sqlite3_bind_blob( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, - void (*xDel)(void*) -){ - return bindText(pStmt, i, zData, nData, xDel, 0); -} -int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ - int rc; - Vdbe *p = (Vdbe *)pStmt; - rc = vdbeUnbind(p, i); - if( rc==SQLITE_OK ){ - sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue); - } - return rc; -} -int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ - return sqlite3_bind_int64(p, i, (i64)iValue); -} -int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ - int rc; - Vdbe *p = (Vdbe *)pStmt; - rc = vdbeUnbind(p, i); - if( rc==SQLITE_OK ){ - sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue); - } - return rc; -} -int sqlite3_bind_null(sqlite3_stmt* p, int i){ - return vdbeUnbind((Vdbe *)p, i); -} -int sqlite3_bind_text( - sqlite3_stmt *pStmt, - int i, - const char *zData, - int nData, - void (*xDel)(void*) -){ - return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); -} -#ifndef SQLITE_OMIT_UTF16 -int sqlite3_bind_text16( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, - void (*xDel)(void*) -){ - return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); -} -#endif /* SQLITE_OMIT_UTF16 */ - -/* -** Return the number of wildcards that can be potentially bound to. -** This routine is added to support DBD::SQLite. -*/ -int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ - Vdbe *p = (Vdbe*)pStmt; - return p ? p->nVar : 0; -} - -/* -** Create a mapping from variable numbers to variable names -** in the Vdbe.azVar[] array, if such a mapping does not already -** exist. -*/ -static void createVarMap(Vdbe *p){ - if( !p->okVar ){ - int j; - Op *pOp; - for(j=0, pOp=p->aOp; j<p->nOp; j++, pOp++){ - if( pOp->opcode==OP_Variable ){ - assert( pOp->p1>0 && pOp->p1<=p->nVar ); - p->azVar[pOp->p1-1] = pOp->p3; - } - } - p->okVar = 1; - } -} - -/* -** Return the name of a wildcard parameter. Return NULL if the index -** is out of range or if the wildcard is unnamed. -** -** The result is always UTF-8. -*/ -const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ - Vdbe *p = (Vdbe*)pStmt; - if( p==0 || i<1 || i>p->nVar ){ - return 0; - } - createVarMap(p); - return p->azVar[i-1]; -} - -/* -** Given a wildcard parameter name, return the index of the variable -** with that name. If there is no variable with the given name, -** return 0. -*/ -int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ - Vdbe *p = (Vdbe*)pStmt; - int i; - if( p==0 ){ - return 0; - } - createVarMap(p); - if( zName ){ - for(i=0; i<p->nVar; i++){ - const char *z = p->azVar[i]; - if( z && strcmp(z,zName)==0 ){ - return i+1; - } - } - } - return 0; -} - -/* -** Transfer all bindings from the first statement over to the second. -** If the two statements contain a different number of bindings, then -** an SQLITE_ERROR is returned. -*/ -int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ - Vdbe *pFrom = (Vdbe*)pFromStmt; - Vdbe *pTo = (Vdbe*)pToStmt; - int i, rc = SQLITE_OK; - if( (pFrom->magic!=VDBE_MAGIC_RUN && pFrom->magic!=VDBE_MAGIC_HALT) - || (pTo->magic!=VDBE_MAGIC_RUN && pTo->magic!=VDBE_MAGIC_HALT) ){ - return SQLITE_MISUSE; - } - if( pFrom->nVar!=pTo->nVar ){ - return SQLITE_ERROR; - } - for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){ - rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]); - } - return rc; -} - -/* -** Return the sqlite3* database handle to which the prepared statement given -** in the argument belongs. This is the same database handle that was -** the first argument to the sqlite3_prepare() that was used to create -** the statement in the first place. -*/ -sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){ - return pStmt ? ((Vdbe*)pStmt)->db : 0; -} diff --git a/ext/pdo_sqlite/sqlite/src/vdbeaux.c b/ext/pdo_sqlite/sqlite/src/vdbeaux.c deleted file mode 100644 index cba9c096d6182..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbeaux.c +++ /dev/null @@ -1,1819 +0,0 @@ -/* -** 2003 September 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used for creating, destroying, and populating -** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior -** to version 2.8.7, all this code was combined into the vdbe.c source file. -** But that file was getting too big so this subroutines were split out. -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> -#include "vdbeInt.h" - - -/* -** When debugging the code generator in a symbolic debugger, one can -** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed -** as they are added to the instruction stream. -*/ -#ifdef SQLITE_DEBUG -int sqlite3_vdbe_addop_trace = 0; -#endif - - -/* -** Create a new virtual database engine. -*/ -Vdbe *sqlite3VdbeCreate(sqlite3 *db){ - Vdbe *p; - p = sqliteMalloc( sizeof(Vdbe) ); - if( p==0 ) return 0; - p->db = db; - if( db->pVdbe ){ - db->pVdbe->pPrev = p; - } - p->pNext = db->pVdbe; - p->pPrev = 0; - db->pVdbe = p; - p->magic = VDBE_MAGIC_INIT; - return p; -} - -/* -** Turn tracing on or off -*/ -void sqlite3VdbeTrace(Vdbe *p, FILE *trace){ - p->trace = trace; -} - -/* -** Resize the Vdbe.aOp array so that it contains at least N -** elements. If the Vdbe is in VDBE_MAGIC_RUN state, then -** the Vdbe.aOp array will be sized to contain exactly N -** elements. -*/ -static void resizeOpArray(Vdbe *p, int N){ - int runMode = p->magic==VDBE_MAGIC_RUN; - if( runMode || p->nOpAlloc<N ){ - VdbeOp *pNew; - int nNew = N + 100*(!runMode); - int oldSize = p->nOpAlloc; - pNew = sqliteRealloc(p->aOp, nNew*sizeof(Op)); - if( pNew ){ - p->nOpAlloc = nNew; - p->aOp = pNew; - if( nNew>oldSize ){ - memset(&p->aOp[oldSize], 0, (nNew-oldSize)*sizeof(Op)); - } - } - } -} - -/* -** Add a new instruction to the list of instructions current in the -** VDBE. Return the address of the new instruction. -** -** Parameters: -** -** p Pointer to the VDBE -** -** op The opcode for this instruction -** -** p1, p2 First two of the three possible operands. -** -** Use the sqlite3VdbeResolveLabel() function to fix an address and -** the sqlite3VdbeChangeP3() function to change the value of the P3 -** operand. -*/ -int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){ - int i; - VdbeOp *pOp; - - i = p->nOp; - p->nOp++; - assert( p->magic==VDBE_MAGIC_INIT ); - resizeOpArray(p, i+1); - if( sqlite3_malloc_failed ){ - return 0; - } - pOp = &p->aOp[i]; - pOp->opcode = op; - pOp->p1 = p1; - pOp->p2 = p2; - pOp->p3 = 0; - pOp->p3type = P3_NOTUSED; - p->expired = 0; -#ifdef SQLITE_DEBUG - if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); -#endif - return i; -} - -/* -** Add an opcode that includes the p3 value. -*/ -int sqlite3VdbeOp3(Vdbe *p, int op, int p1, int p2, const char *zP3,int p3type){ - int addr = sqlite3VdbeAddOp(p, op, p1, p2); - sqlite3VdbeChangeP3(p, addr, zP3, p3type); - return addr; -} - -/* -** Create a new symbolic label for an instruction that has yet to be -** coded. The symbolic label is really just a negative number. The -** label can be used as the P2 value of an operation. Later, when -** the label is resolved to a specific address, the VDBE will scan -** through its operation list and change all values of P2 which match -** the label into the resolved address. -** -** The VDBE knows that a P2 value is a label because labels are -** always negative and P2 values are suppose to be non-negative. -** Hence, a negative P2 value is a label that has yet to be resolved. -** -** Zero is returned if a malloc() fails. -*/ -int sqlite3VdbeMakeLabel(Vdbe *p){ - int i; - i = p->nLabel++; - assert( p->magic==VDBE_MAGIC_INIT ); - if( i>=p->nLabelAlloc ){ - p->nLabelAlloc = p->nLabelAlloc*2 + 10; - sqlite3ReallocOrFree((void**)&p->aLabel, - p->nLabelAlloc*sizeof(p->aLabel[0])); - } - if( p->aLabel ){ - p->aLabel[i] = -1; - } - return -1-i; -} - -/* -** Resolve label "x" to be the address of the next instruction to -** be inserted. The parameter "x" must have been obtained from -** a prior call to sqlite3VdbeMakeLabel(). -*/ -void sqlite3VdbeResolveLabel(Vdbe *p, int x){ - int j = -1-x; - assert( p->magic==VDBE_MAGIC_INIT ); - assert( j>=0 && j<p->nLabel ); - if( p->aLabel ){ - p->aLabel[j] = p->nOp; - } -} - -/* -** Return non-zero if opcode 'op' is guarenteed not to push more values -** onto the VDBE stack than it pops off. -*/ -static int opcodeNoPush(u8 op){ - /* The 10 NOPUSH_MASK_n constants are defined in the automatically - ** generated header file opcodes.h. Each is a 16-bit bitmask, one - ** bit corresponding to each opcode implemented by the virtual - ** machine in vdbe.c. The bit is true if the word "no-push" appears - ** in a comment on the same line as the "case OP_XXX:" in - ** sqlite3VdbeExec() in vdbe.c. - ** - ** If the bit is true, then the corresponding opcode is guarenteed not - ** to grow the stack when it is executed. Otherwise, it may grow the - ** stack by at most one entry. - ** - ** NOPUSH_MASK_0 corresponds to opcodes 0 to 15. NOPUSH_MASK_1 contains - ** one bit for opcodes 16 to 31, and so on. - ** - ** 16-bit bitmasks (rather than 32-bit) are specified in opcodes.h - ** because the file is generated by an awk program. Awk manipulates - ** all numbers as floating-point and we don't want to risk a rounding - ** error if someone builds with an awk that uses (for example) 32-bit - ** IEEE floats. - */ - static const u32 masks[5] = { - NOPUSH_MASK_0 + (NOPUSH_MASK_1<<16), - NOPUSH_MASK_2 + (NOPUSH_MASK_3<<16), - NOPUSH_MASK_4 + (NOPUSH_MASK_5<<16), - NOPUSH_MASK_6 + (NOPUSH_MASK_7<<16), - NOPUSH_MASK_8 + (NOPUSH_MASK_9<<16) - }; - return (masks[op>>5] & (1<<(op&0x1F))); -} - -#ifndef NDEBUG -int sqlite3VdbeOpcodeNoPush(u8 op){ - return opcodeNoPush(op); -} -#endif - -/* -** Loop through the program looking for P2 values that are negative. -** Each such value is a label. Resolve the label by setting the P2 -** value to its correct non-zero value. -** -** This routine is called once after all opcodes have been inserted. -** -** Variable *pMaxFuncArgs is set to the maximum value of any P2 argument -** to an OP_Function or OP_AggStep opcode. This is used by -** sqlite3VdbeMakeReady() to size the Vdbe.apArg[] array. -** -** The integer *pMaxStack is set to the maximum number of vdbe stack -** entries that static analysis reveals this program might need. -** -** This routine also does the following optimization: It scans for -** Halt instructions where P1==SQLITE_CONSTRAINT or P2==OE_Abort or for -** IdxInsert instructions where P2!=0. If no such instruction is -** found, then every Statement instruction is changed to a Noop. In -** this way, we avoid creating the statement journal file unnecessarily. -*/ -static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){ - int i; - int nMaxArgs = 0; - int nMaxStack = p->nOp; - Op *pOp; - int *aLabel = p->aLabel; - int doesStatementRollback = 0; - int hasStatementBegin = 0; - for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ - u8 opcode = pOp->opcode; - - if( opcode==OP_Function || opcode==OP_AggStep ){ - if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; - }else if( opcode==OP_Halt ){ - if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){ - doesStatementRollback = 1; - } - }else if( opcode==OP_IdxInsert ){ - if( pOp->p2 ){ - doesStatementRollback = 1; - } - }else if( opcode==OP_Statement ){ - hasStatementBegin = 1; - } - - if( opcodeNoPush(opcode) ){ - nMaxStack--; - } - - if( pOp->p2>=0 ) continue; - assert( -1-pOp->p2<p->nLabel ); - pOp->p2 = aLabel[-1-pOp->p2]; - } - sqliteFree(p->aLabel); - p->aLabel = 0; - - *pMaxFuncArgs = nMaxArgs; - *pMaxStack = nMaxStack; - - /* If we never rollback a statement transaction, then statement - ** transactions are not needed. So change every OP_Statement - ** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive() - ** which can be expensive on some platforms. - */ - if( hasStatementBegin && !doesStatementRollback ){ - for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ - if( pOp->opcode==OP_Statement ){ - pOp->opcode = OP_Noop; - } - } - } -} - -/* -** Return the address of the next instruction to be inserted. -*/ -int sqlite3VdbeCurrentAddr(Vdbe *p){ - assert( p->magic==VDBE_MAGIC_INIT ); - return p->nOp; -} - -/* -** Add a whole list of operations to the operation stack. Return the -** address of the first operation added. -*/ -int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){ - int addr; - assert( p->magic==VDBE_MAGIC_INIT ); - resizeOpArray(p, p->nOp + nOp); - if( sqlite3_malloc_failed ){ - return 0; - } - addr = p->nOp; - if( nOp>0 ){ - int i; - VdbeOpList const *pIn = aOp; - for(i=0; i<nOp; i++, pIn++){ - int p2 = pIn->p2; - VdbeOp *pOut = &p->aOp[i+addr]; - pOut->opcode = pIn->opcode; - pOut->p1 = pIn->p1; - pOut->p2 = p2<0 ? addr + ADDR(p2) : p2; - pOut->p3 = pIn->p3; - pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED; -#ifdef SQLITE_DEBUG - if( sqlite3_vdbe_addop_trace ){ - sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]); - } -#endif - } - p->nOp += nOp; - } - return addr; -} - -/* -** Change the value of the P1 operand for a specific instruction. -** This routine is useful when a large program is loaded from a -** static array using sqlite3VdbeAddOpList but we want to make a -** few minor changes to the program. -*/ -void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){ - assert( p->magic==VDBE_MAGIC_INIT ); - if( p && addr>=0 && p->nOp>addr && p->aOp ){ - p->aOp[addr].p1 = val; - } -} - -/* -** Change the value of the P2 operand for a specific instruction. -** This routine is useful for setting a jump destination. -*/ -void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){ - assert( val>=0 ); - assert( p->magic==VDBE_MAGIC_INIT ); - if( p && addr>=0 && p->nOp>addr && p->aOp ){ - p->aOp[addr].p2 = val; - } -} - -/* -** Change teh P2 operand of instruction addr so that it points to -** the address of the next instruction to be coded. -*/ -void sqlite3VdbeJumpHere(Vdbe *p, int addr){ - sqlite3VdbeChangeP2(p, addr, p->nOp); -} - -/* -** Delete a P3 value if necessary. -*/ -static void freeP3(int p3type, void *p3){ - if( p3 ){ - switch( p3type ){ - case P3_DYNAMIC: - case P3_KEYINFO: - case P3_KEYINFO_HANDOFF: { - sqliteFree(p3); - break; - } - case P3_VDBEFUNC: { - VdbeFunc *pVdbeFunc = (VdbeFunc *)p3; - sqlite3VdbeDeleteAuxData(pVdbeFunc, 0); - sqliteFree(pVdbeFunc); - break; - } - case P3_MEM: { - sqlite3ValueFree((sqlite3_value*)p3); - break; - } - } - } -} - - -/* -** Change the value of the P3 operand for a specific instruction. -** This routine is useful when a large program is loaded from a -** static array using sqlite3VdbeAddOpList but we want to make a -** few minor changes to the program. -** -** If n>=0 then the P3 operand is dynamic, meaning that a copy of -** the string is made into memory obtained from sqliteMalloc(). -** A value of n==0 means copy bytes of zP3 up to and including the -** first null byte. If n>0 then copy n+1 bytes of zP3. -** -** If n==P3_KEYINFO it means that zP3 is a pointer to a KeyInfo structure. -** A copy is made of the KeyInfo structure into memory obtained from -** sqliteMalloc, to be freed when the Vdbe is finalized. -** n==P3_KEYINFO_HANDOFF indicates that zP3 points to a KeyInfo structure -** stored in memory that the caller has obtained from sqliteMalloc. The -** caller should not free the allocation, it will be freed when the Vdbe is -** finalized. -** -** Other values of n (P3_STATIC, P3_COLLSEQ etc.) indicate that zP3 points -** to a string or structure that is guaranteed to exist for the lifetime of -** the Vdbe. In these cases we can just copy the pointer. -** -** If addr<0 then change P3 on the most recently inserted instruction. -*/ -void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){ - Op *pOp; - assert( p->magic==VDBE_MAGIC_INIT ); - if( p==0 || p->aOp==0 ){ - freeP3(n, (void*)*(char**)&zP3); - return; - } - if( addr<0 || addr>=p->nOp ){ - addr = p->nOp - 1; - if( addr<0 ) return; - } - pOp = &p->aOp[addr]; - freeP3(pOp->p3type, pOp->p3); - pOp->p3 = 0; - if( zP3==0 ){ - pOp->p3 = 0; - pOp->p3type = P3_NOTUSED; - }else if( n==P3_KEYINFO ){ - KeyInfo *pKeyInfo; - int nField, nByte; - - /* KeyInfo structures that include an KeyInfo.aSortOrder are always - ** sent in using P3_KEYINFO_HANDOFF. The KeyInfo.aSortOrder array - ** is not duplicated when P3_KEYINFO is used. */ - /* assert( pKeyInfo->aSortOrder==0 ); */ - nField = ((KeyInfo*)zP3)->nField; - nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]); - pKeyInfo = sqliteMallocRaw( nByte ); - pOp->p3 = (char*)pKeyInfo; - if( pKeyInfo ){ - memcpy(pKeyInfo, zP3, nByte); - pOp->p3type = P3_KEYINFO; - }else{ - pOp->p3type = P3_NOTUSED; - } - }else if( n==P3_KEYINFO_HANDOFF ){ - pOp->p3 = (char*)zP3; - pOp->p3type = P3_KEYINFO; - }else if( n<0 ){ - pOp->p3 = (char*)zP3; - pOp->p3type = n; - }else{ - if( n==0 ) n = strlen(zP3); - pOp->p3 = sqliteStrNDup(zP3, n); - pOp->p3type = P3_DYNAMIC; - } -} - -#ifndef NDEBUG -/* -** Replace the P3 field of the most recently coded instruction with -** comment text. -*/ -void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){ - va_list ap; - assert( p->nOp>0 ); - assert( p->aOp==0 || p->aOp[p->nOp-1].p3==0 ); - va_start(ap, zFormat); - sqlite3VdbeChangeP3(p, -1, sqlite3VMPrintf(zFormat, ap), P3_DYNAMIC); - va_end(ap); -} -#endif - -/* -** Return the opcode for a given address. -*/ -VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){ - assert( p->magic==VDBE_MAGIC_INIT ); - assert( addr>=0 && addr<p->nOp ); - return &p->aOp[addr]; -} - -#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \ - || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) -/* -** Compute a string that describes the P3 parameter for an opcode. -** Use zTemp for any required temporary buffer space. -*/ -static char *displayP3(Op *pOp, char *zTemp, int nTemp){ - char *zP3; - assert( nTemp>=20 ); - switch( pOp->p3type ){ - case P3_KEYINFO: { - int i, j; - KeyInfo *pKeyInfo = (KeyInfo*)pOp->p3; - sprintf(zTemp, "keyinfo(%d", pKeyInfo->nField); - i = strlen(zTemp); - for(j=0; j<pKeyInfo->nField; j++){ - CollSeq *pColl = pKeyInfo->aColl[j]; - if( pColl ){ - int n = strlen(pColl->zName); - if( i+n>nTemp-6 ){ - strcpy(&zTemp[i],",..."); - break; - } - zTemp[i++] = ','; - if( pKeyInfo->aSortOrder && pKeyInfo->aSortOrder[j] ){ - zTemp[i++] = '-'; - } - strcpy(&zTemp[i], pColl->zName); - i += n; - }else if( i+4<nTemp-6 ){ - strcpy(&zTemp[i],",nil"); - i += 4; - } - } - zTemp[i++] = ')'; - zTemp[i] = 0; - assert( i<nTemp ); - zP3 = zTemp; - break; - } - case P3_COLLSEQ: { - CollSeq *pColl = (CollSeq*)pOp->p3; - sprintf(zTemp, "collseq(%.20s)", pColl->zName); - zP3 = zTemp; - break; - } - case P3_FUNCDEF: { - FuncDef *pDef = (FuncDef*)pOp->p3; - char zNum[30]; - sprintf(zTemp, "%.*s", nTemp, pDef->zName); - sprintf(zNum,"(%d)", pDef->nArg); - if( strlen(zTemp)+strlen(zNum)+1<=nTemp ){ - strcat(zTemp, zNum); - } - zP3 = zTemp; - break; - } - default: { - zP3 = pOp->p3; - if( zP3==0 || pOp->opcode==OP_Noop ){ - zP3 = ""; - } - } - } - return zP3; -} -#endif - - -#if defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) -/* -** Print a single opcode. This routine is used for debugging only. -*/ -void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){ - char *zP3; - char zPtr[50]; - static const char *zFormat1 = "%4d %-13s %4d %4d %s\n"; - if( pOut==0 ) pOut = stdout; - zP3 = displayP3(pOp, zPtr, sizeof(zPtr)); - fprintf(pOut, zFormat1, - pc, sqlite3OpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3); - fflush(pOut); -} -#endif - -/* -** Release an array of N Mem elements -*/ -static void releaseMemArray(Mem *p, int N){ - if( p ){ - while( N-->0 ){ - sqlite3VdbeMemRelease(p++); - } - } -} - -#ifndef SQLITE_OMIT_EXPLAIN -/* -** Give a listing of the program in the virtual machine. -** -** The interface is the same as sqlite3VdbeExec(). But instead of -** running the code, it invokes the callback once for each instruction. -** This feature is used to implement "EXPLAIN". -*/ -int sqlite3VdbeList( - Vdbe *p /* The VDBE */ -){ - sqlite3 *db = p->db; - int i; - int rc = SQLITE_OK; - - assert( p->explain ); - if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE; - assert( db->magic==SQLITE_MAGIC_BUSY ); - assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY ); - - /* Even though this opcode does not put dynamic strings onto the - ** the stack, they may become dynamic if the user calls - ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. - */ - if( p->pTos==&p->aStack[4] ){ - releaseMemArray(p->aStack, 5); - } - p->resOnStack = 0; - - do{ - i = p->pc++; - }while( i<p->nOp && p->explain==2 && p->aOp[i].opcode!=OP_Explain ); - if( i>=p->nOp ){ - p->rc = SQLITE_OK; - rc = SQLITE_DONE; - }else if( db->flags & SQLITE_Interrupt ){ - db->flags &= ~SQLITE_Interrupt; - p->rc = SQLITE_INTERRUPT; - rc = SQLITE_ERROR; - sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(p->rc), (char*)0); - }else{ - Op *pOp = &p->aOp[i]; - Mem *pMem = p->aStack; - pMem->flags = MEM_Int; - pMem->type = SQLITE_INTEGER; - pMem->i = i; /* Program counter */ - pMem++; - - pMem->flags = MEM_Static|MEM_Str|MEM_Term; - pMem->z = sqlite3OpcodeNames[pOp->opcode]; /* Opcode */ - pMem->n = strlen(pMem->z); - pMem->type = SQLITE_TEXT; - pMem->enc = SQLITE_UTF8; - pMem++; - - pMem->flags = MEM_Int; - pMem->i = pOp->p1; /* P1 */ - pMem->type = SQLITE_INTEGER; - pMem++; - - pMem->flags = MEM_Int; - pMem->i = pOp->p2; /* P2 */ - pMem->type = SQLITE_INTEGER; - pMem++; - - pMem->flags = MEM_Short|MEM_Str|MEM_Term; /* P3 */ - pMem->z = displayP3(pOp, pMem->zShort, sizeof(pMem->zShort)); - pMem->type = SQLITE_TEXT; - pMem->enc = SQLITE_UTF8; - - p->nResColumn = 5 - 2*(p->explain-1); - p->pTos = pMem; - p->rc = SQLITE_OK; - p->resOnStack = 1; - rc = SQLITE_ROW; - } - return rc; -} -#endif /* SQLITE_OMIT_EXPLAIN */ - -/* -** Print the SQL that was used to generate a VDBE program. -*/ -void sqlite3VdbePrintSql(Vdbe *p){ -#ifdef SQLITE_DEBUG - int nOp = p->nOp; - VdbeOp *pOp; - if( nOp<1 ) return; - pOp = &p->aOp[nOp-1]; - if( pOp->opcode==OP_Noop && pOp->p3!=0 ){ - const char *z = pOp->p3; - while( isspace(*(u8*)z) ) z++; - printf("SQL: [%s]\n", z); - } -#endif -} - -/* -** Prepare a virtual machine for execution. This involves things such -** as allocating stack space and initializing the program counter. -** After the VDBE has be prepped, it can be executed by one or more -** calls to sqlite3VdbeExec(). -** -** This is the only way to move a VDBE from VDBE_MAGIC_INIT to -** VDBE_MAGIC_RUN. -*/ -void sqlite3VdbeMakeReady( - Vdbe *p, /* The VDBE */ - int nVar, /* Number of '?' see in the SQL statement */ - int nMem, /* Number of memory cells to allocate */ - int nCursor, /* Number of cursors to allocate */ - int isExplain /* True if the EXPLAIN keywords is present */ -){ - int n; - - assert( p!=0 ); - assert( p->magic==VDBE_MAGIC_INIT ); - - /* There should be at least one opcode. - */ - assert( p->nOp>0 ); - - /* Set the magic to VDBE_MAGIC_RUN sooner rather than later. This - * is because the call to resizeOpArray() below may shrink the - * p->aOp[] array to save memory if called when in VDBE_MAGIC_RUN - * state. - */ - p->magic = VDBE_MAGIC_RUN; - - /* No instruction ever pushes more than a single element onto the - ** stack. And the stack never grows on successive executions of the - ** same loop. So the total number of instructions is an upper bound - ** on the maximum stack depth required. (Added later:) The - ** resolveP2Values() call computes a tighter upper bound on the - ** stack size. - ** - ** Allocation all the stack space we will ever need. - */ - if( p->aStack==0 ){ - int nArg; /* Maximum number of args passed to a user function. */ - int nStack; /* Maximum number of stack entries required */ - resolveP2Values(p, &nArg, &nStack); - resizeOpArray(p, p->nOp); - assert( nVar>=0 ); - assert( nStack<p->nOp ); - nStack = isExplain ? 10 : nStack; - p->aStack = sqliteMalloc( - nStack*sizeof(p->aStack[0]) /* aStack */ - + nArg*sizeof(Mem*) /* apArg */ - + nVar*sizeof(Mem) /* aVar */ - + nVar*sizeof(char*) /* azVar */ - + nMem*sizeof(Mem) /* aMem */ - + nCursor*sizeof(Cursor*) /* apCsr */ - ); - if( !sqlite3_malloc_failed ){ - p->aMem = &p->aStack[nStack]; - p->nMem = nMem; - p->aVar = &p->aMem[nMem]; - p->nVar = nVar; - p->okVar = 0; - p->apArg = (Mem**)&p->aVar[nVar]; - p->azVar = (char**)&p->apArg[nArg]; - p->apCsr = (Cursor**)&p->azVar[nVar]; - p->nCursor = nCursor; - for(n=0; n<nVar; n++){ - p->aVar[n].flags = MEM_Null; - } - } - } - for(n=0; n<p->nMem; n++){ - p->aMem[n].flags = MEM_Null; - } - -#ifdef SQLITE_DEBUG - if( (p->db->flags & SQLITE_VdbeListing)!=0 - || sqlite3OsFileExists("vdbe_explain") - ){ - int i; - printf("VDBE Program Listing:\n"); - sqlite3VdbePrintSql(p); - for(i=0; i<p->nOp; i++){ - sqlite3VdbePrintOp(stdout, i, &p->aOp[i]); - } - } - if( sqlite3OsFileExists("vdbe_trace") ){ - p->trace = stdout; - } -#endif - p->pTos = &p->aStack[-1]; - p->pc = -1; - p->rc = SQLITE_OK; - p->uniqueCnt = 0; - p->returnDepth = 0; - p->errorAction = OE_Abort; - p->popStack = 0; - p->explain |= isExplain; - p->magic = VDBE_MAGIC_RUN; - p->nChange = 0; -#ifdef VDBE_PROFILE - { - int i; - for(i=0; i<p->nOp; i++){ - p->aOp[i].cnt = 0; - p->aOp[i].cycles = 0; - } - } -#endif -} - -/* -** Close a cursor and release all the resources that cursor happens -** to hold. -*/ -void sqlite3VdbeFreeCursor(Cursor *pCx){ - if( pCx==0 ){ - return; - } - if( pCx->pCursor ){ - sqlite3BtreeCloseCursor(pCx->pCursor); - } - if( pCx->pBt ){ - sqlite3BtreeClose(pCx->pBt); - } - sqliteFree(pCx->pData); - sqliteFree(pCx->aType); - sqliteFree(pCx); -} - -/* -** Close all cursors -*/ -static void closeAllCursors(Vdbe *p){ - int i; - if( p->apCsr==0 ) return; - for(i=0; i<p->nCursor; i++){ - sqlite3VdbeFreeCursor(p->apCsr[i]); - p->apCsr[i] = 0; - } -} - -/* -** Clean up the VM after execution. -** -** This routine will automatically close any cursors, lists, and/or -** sorters that were left open. It also deletes the values of -** variables in the aVar[] array. -*/ -static void Cleanup(Vdbe *p){ - int i; - if( p->aStack ){ - releaseMemArray(p->aStack, 1 + (p->pTos - p->aStack)); - p->pTos = &p->aStack[-1]; - } - closeAllCursors(p); - releaseMemArray(p->aMem, p->nMem); - sqlite3VdbeFifoClear(&p->sFifo); - if( p->contextStack ){ - for(i=0; i<p->contextStackTop; i++){ - sqlite3VdbeFifoClear(&p->contextStack[i].sFifo); - } - sqliteFree(p->contextStack); - } - p->contextStack = 0; - p->contextStackDepth = 0; - p->contextStackTop = 0; - sqliteFree(p->zErrMsg); - p->zErrMsg = 0; -} - -/* -** Set the number of result columns that will be returned by this SQL -** statement. This is now set at compile time, rather than during -** execution of the vdbe program so that sqlite3_column_count() can -** be called on an SQL statement before sqlite3_step(). -*/ -void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){ - Mem *pColName; - int n; - assert( 0==p->nResColumn ); - p->nResColumn = nResColumn; - n = nResColumn*2; - p->aColName = pColName = (Mem*)sqliteMalloc( sizeof(Mem)*n ); - if( p->aColName==0 ) return; - while( n-- > 0 ){ - (pColName++)->flags = MEM_Null; - } -} - -/* -** Set the name of the idx'th column to be returned by the SQL statement. -** zName must be a pointer to a nul terminated string. -** -** This call must be made after a call to sqlite3VdbeSetNumCols(). -** -** If N==P3_STATIC it means that zName is a pointer to a constant static -** string and we can just copy the pointer. If it is P3_DYNAMIC, then -** the string is freed using sqliteFree() when the vdbe is finished with -** it. Otherwise, N bytes of zName are copied. -*/ -int sqlite3VdbeSetColName(Vdbe *p, int idx, const char *zName, int N){ - int rc; - Mem *pColName; - assert( idx<(2*p->nResColumn) ); - if( sqlite3_malloc_failed ) return SQLITE_NOMEM; - assert( p->aColName!=0 ); - pColName = &(p->aColName[idx]); - if( N==P3_DYNAMIC || N==P3_STATIC ){ - rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, SQLITE_STATIC); - }else{ - rc = sqlite3VdbeMemSetStr(pColName, zName, N, SQLITE_UTF8,SQLITE_TRANSIENT); - } - if( rc==SQLITE_OK && N==P3_DYNAMIC ){ - pColName->flags = (pColName->flags&(~MEM_Static))|MEM_Dyn; - pColName->xDel = 0; - } - return rc; -} - -/* -** A read or write transaction may or may not be active on database handle -** db. If a transaction is active, commit it. If there is a -** write-transaction spanning more than one database file, this routine -** takes care of the master journal trickery. -*/ -static int vdbeCommit(sqlite3 *db){ - int i; - int nTrans = 0; /* Number of databases with an active write-transaction */ - int rc = SQLITE_OK; - int needXcommit = 0; - - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt && sqlite3BtreeIsInTrans(pBt) ){ - needXcommit = 1; - if( i!=1 ) nTrans++; - } - } - - /* If there are any write-transactions at all, invoke the commit hook */ - if( needXcommit && db->xCommitCallback ){ - int rc; - sqlite3SafetyOff(db); - rc = db->xCommitCallback(db->pCommitArg); - sqlite3SafetyOn(db); - if( rc ){ - return SQLITE_CONSTRAINT; - } - } - - /* The simple case - no more than one database file (not counting the - ** TEMP database) has a transaction active. There is no need for the - ** master-journal. - ** - ** If the return value of sqlite3BtreeGetFilename() is a zero length - ** string, it means the main database is :memory:. In that case we do - ** not support atomic multi-file commits, so use the simple case then - ** too. - */ - if( 0==strlen(sqlite3BtreeGetFilename(db->aDb[0].pBt)) || nTrans<=1 ){ - for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt ){ - rc = sqlite3BtreeSync(pBt, 0); - } - } - - /* Do the commit only if all databases successfully synced */ - if( rc==SQLITE_OK ){ - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt ){ - sqlite3BtreeCommit(pBt); - } - } - } - } - - /* The complex case - There is a multi-file write-transaction active. - ** This requires a master journal file to ensure the transaction is - ** committed atomicly. - */ -#ifndef SQLITE_OMIT_DISKIO - else{ - int needSync = 0; - char *zMaster = 0; /* File-name for the master journal */ - char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt); - OsFile master; - - /* Select a master journal file name */ - do { - u32 random; - sqliteFree(zMaster); - sqlite3Randomness(sizeof(random), &random); - zMaster = sqlite3MPrintf("%s-mj%08X", zMainFile, random&0x7fffffff); - if( !zMaster ){ - return SQLITE_NOMEM; - } - }while( sqlite3OsFileExists(zMaster) ); - - /* Open the master journal. */ - memset(&master, 0, sizeof(master)); - rc = sqlite3OsOpenExclusive(zMaster, &master, 0); - if( rc!=SQLITE_OK ){ - sqliteFree(zMaster); - return rc; - } - - /* Write the name of each database file in the transaction into the new - ** master journal file. If an error occurs at this point close - ** and delete the master journal file. All the individual journal files - ** still have 'null' as the master journal pointer, so they will roll - ** back independently if a failure occurs. - */ - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( i==1 ) continue; /* Ignore the TEMP database */ - if( pBt && sqlite3BtreeIsInTrans(pBt) ){ - char const *zFile = sqlite3BtreeGetJournalname(pBt); - if( zFile[0]==0 ) continue; /* Ignore :memory: databases */ - if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){ - needSync = 1; - } - rc = sqlite3OsWrite(&master, zFile, strlen(zFile)+1); - if( rc!=SQLITE_OK ){ - sqlite3OsClose(&master); - sqlite3OsDelete(zMaster); - sqliteFree(zMaster); - return rc; - } - } - } - - - /* Sync the master journal file. Before doing this, open the directory - ** the master journal file is store in so that it gets synced too. - */ - zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt); - rc = sqlite3OsOpenDirectory(zMainFile, &master); - if( rc!=SQLITE_OK || - (needSync && (rc=sqlite3OsSync(&master,0))!=SQLITE_OK) ){ - sqlite3OsClose(&master); - sqlite3OsDelete(zMaster); - sqliteFree(zMaster); - return rc; - } - - /* Sync all the db files involved in the transaction. The same call - ** sets the master journal pointer in each individual journal. If - ** an error occurs here, do not delete the master journal file. - ** - ** If the error occurs during the first call to sqlite3BtreeSync(), - ** then there is a chance that the master journal file will be - ** orphaned. But we cannot delete it, in case the master journal - ** file name was written into the journal file before the failure - ** occured. - */ - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt && sqlite3BtreeIsInTrans(pBt) ){ - rc = sqlite3BtreeSync(pBt, zMaster); - if( rc!=SQLITE_OK ){ - sqlite3OsClose(&master); - sqliteFree(zMaster); - return rc; - } - } - } - sqlite3OsClose(&master); - - /* Delete the master journal file. This commits the transaction. After - ** doing this the directory is synced again before any individual - ** transaction files are deleted. - */ - rc = sqlite3OsDelete(zMaster); - assert( rc==SQLITE_OK ); - sqliteFree(zMaster); - zMaster = 0; - rc = sqlite3OsSyncDirectory(zMainFile); - if( rc!=SQLITE_OK ){ - /* This is not good. The master journal file has been deleted, but - ** the directory sync failed. There is no completely safe course of - ** action from here. The individual journals contain the name of the - ** master journal file, but there is no way of knowing if that - ** master journal exists now or if it will exist after the operating - ** system crash that may follow the fsync() failure. - */ - return rc; - } - - /* All files and directories have already been synced, so the following - ** calls to sqlite3BtreeCommit() are only closing files and deleting - ** journals. If something goes wrong while this is happening we don't - ** really care. The integrity of the transaction is already guaranteed, - ** but some stray 'cold' journals may be lying around. Returning an - ** error code won't help matters. - */ - for(i=0; i<db->nDb; i++){ - Btree *pBt = db->aDb[i].pBt; - if( pBt ){ - sqlite3BtreeCommit(pBt); - } - } - } -#endif - - return rc; -} - -/* -** Find every active VM other than pVdbe and change its status to -** aborted. This happens when one VM causes a rollback due to an -** ON CONFLICT ROLLBACK clause (for example). The other VMs must be -** aborted so that they do not have data rolled out from underneath -** them leading to a segfault. -*/ -static void abortOtherActiveVdbes(Vdbe *pVdbe){ - Vdbe *pOther; - for(pOther=pVdbe->db->pVdbe; pOther; pOther=pOther->pNext){ - if( pOther==pVdbe ) continue; - if( pOther->magic!=VDBE_MAGIC_RUN || pOther->pc<0 ) continue; - closeAllCursors(pOther); - pOther->aborted = 1; - } -} - -/* -** This routine checks that the sqlite3.activeVdbeCnt count variable -** matches the number of vdbe's in the list sqlite3.pVdbe that are -** currently active. An assertion fails if the two counts do not match. -** This is an internal self-check only - it is not an essential processing -** step. -** -** This is a no-op if NDEBUG is defined. -*/ -#ifndef NDEBUG -static void checkActiveVdbeCnt(sqlite3 *db){ - Vdbe *p; - int cnt = 0; - p = db->pVdbe; - while( p ){ - if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){ - cnt++; - } - p = p->pNext; - } - assert( cnt==db->activeVdbeCnt ); -} -#else -#define checkActiveVdbeCnt(x) -#endif - -/* -** This routine is called the when a VDBE tries to halt. If the VDBE -** has made changes and is in autocommit mode, then commit those -** changes. If a rollback is needed, then do the rollback. -** -** This routine is the only way to move the state of a VM from -** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. -** -** Return an error code. If the commit could not complete because of -** lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it -** means the close did not happen and needs to be repeated. -*/ -int sqlite3VdbeHalt(Vdbe *p){ - sqlite3 *db = p->db; - int i; - int (*xFunc)(Btree *pBt) = 0; /* Function to call on each btree backend */ - - if( p->magic!=VDBE_MAGIC_RUN ){ - /* Already halted. Nothing to do. */ - assert( p->magic==VDBE_MAGIC_HALT ); - return SQLITE_OK; - } - closeAllCursors(p); - checkActiveVdbeCnt(db); - if( p->pc<0 ){ - /* No commit or rollback needed if the program never started */ - }else if( db->autoCommit && db->activeVdbeCnt==1 ){ - if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ - /* The auto-commit flag is true, there are no other active queries - ** using this handle and the vdbe program was successful or hit an - ** 'OR FAIL' constraint. This means a commit is required. - */ - int rc = vdbeCommit(db); - if( rc==SQLITE_BUSY ){ - return SQLITE_BUSY; - }else if( rc!=SQLITE_OK ){ - p->rc = rc; - xFunc = sqlite3BtreeRollback; - } - }else{ - xFunc = sqlite3BtreeRollback; - } - }else{ - if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ - xFunc = sqlite3BtreeCommitStmt; - }else if( p->errorAction==OE_Abort ){ - xFunc = sqlite3BtreeRollbackStmt; - }else{ - xFunc = sqlite3BtreeRollback; - db->autoCommit = 1; - abortOtherActiveVdbes(p); - } - } - - /* If xFunc is not NULL, then it is one of sqlite3BtreeRollback, - ** sqlite3BtreeRollbackStmt or sqlite3BtreeCommitStmt. Call it once on - ** each backend. If an error occurs and the return code is still - ** SQLITE_OK, set the return code to the new error value. - */ - for(i=0; xFunc && i<db->nDb; i++){ - int rc; - Btree *pBt = db->aDb[i].pBt; - if( pBt ){ - rc = xFunc(pBt); - if( p->rc==SQLITE_OK ) p->rc = rc; - } - } - - /* If this was an INSERT, UPDATE or DELETE, set the change counter. */ - if( p->changeCntOn && p->pc>=0 ){ - if( !xFunc || xFunc==sqlite3BtreeCommitStmt ){ - sqlite3VdbeSetChanges(db, p->nChange); - }else{ - sqlite3VdbeSetChanges(db, 0); - } - p->nChange = 0; - } - - /* Rollback or commit any schema changes that occurred. */ - if( p->rc!=SQLITE_OK ){ - sqlite3RollbackInternalChanges(db); - }else if( db->flags & SQLITE_InternChanges ){ - sqlite3CommitInternalChanges(db); - } - - /* We have successfully halted and closed the VM. Record this fact. */ - if( p->pc>=0 ){ - db->activeVdbeCnt--; - } - p->magic = VDBE_MAGIC_HALT; - checkActiveVdbeCnt(db); - - return SQLITE_OK; -} - -/* -** Clean up a VDBE after execution but do not delete the VDBE just yet. -** Write any error messages into *pzErrMsg. Return the result code. -** -** After this routine is run, the VDBE should be ready to be executed -** again. -** -** To look at it another way, this routine resets the state of the -** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to -** VDBE_MAGIC_INIT. -*/ -int sqlite3VdbeReset(Vdbe *p){ - if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){ - sqlite3Error(p->db, SQLITE_MISUSE, 0); - return SQLITE_MISUSE; - } - - /* If the VM did not run to completion or if it encountered an - ** error, then it might not have been halted properly. So halt - ** it now. - */ - sqlite3VdbeHalt(p); - - /* If the VDBE has be run even partially, then transfer the error code - ** and error message from the VDBE into the main database structure. But - ** if the VDBE has just been set to run but has not actually executed any - ** instructions yet, leave the main database error information unchanged. - */ - if( p->pc>=0 ){ - if( p->zErrMsg ){ - sqlite3Error(p->db, p->rc, "%s", p->zErrMsg); - sqliteFree(p->zErrMsg); - p->zErrMsg = 0; - }else if( p->rc ){ - sqlite3Error(p->db, p->rc, 0); - }else{ - sqlite3Error(p->db, SQLITE_OK, 0); - } - }else if( p->rc && p->expired ){ - /* The expired flag was set on the VDBE before the first call - ** to sqlite3_step(). For consistency (since sqlite3_step() was - ** called), set the database error in this case as well. - */ - sqlite3Error(p->db, p->rc, 0); - } - - /* Reclaim all memory used by the VDBE - */ - Cleanup(p); - - /* Save profiling information from this VDBE run. - */ - assert( p->pTos<&p->aStack[p->pc<0?0:p->pc] || sqlite3_malloc_failed==1 ); -#ifdef VDBE_PROFILE - { - FILE *out = fopen("vdbe_profile.out", "a"); - if( out ){ - int i; - fprintf(out, "---- "); - for(i=0; i<p->nOp; i++){ - fprintf(out, "%02x", p->aOp[i].opcode); - } - fprintf(out, "\n"); - for(i=0; i<p->nOp; i++){ - fprintf(out, "%6d %10lld %8lld ", - p->aOp[i].cnt, - p->aOp[i].cycles, - p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0 - ); - sqlite3VdbePrintOp(out, i, &p->aOp[i]); - } - fclose(out); - } - } -#endif - p->magic = VDBE_MAGIC_INIT; - p->aborted = 0; - if( p->rc==SQLITE_SCHEMA ){ - sqlite3ResetInternalSchema(p->db, 0); - } - return p->rc; -} - -/* -** Clean up and delete a VDBE after execution. Return an integer which is -** the result code. Write any error message text into *pzErrMsg. -*/ -int sqlite3VdbeFinalize(Vdbe *p){ - int rc = SQLITE_OK; - - if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){ - rc = sqlite3VdbeReset(p); - }else if( p->magic!=VDBE_MAGIC_INIT ){ - return SQLITE_MISUSE; - } - sqlite3VdbeDelete(p); - return rc; -} - -/* -** Call the destructor for each auxdata entry in pVdbeFunc for which -** the corresponding bit in mask is clear. Auxdata entries beyond 31 -** are always destroyed. To destroy all auxdata entries, call this -** routine with mask==0. -*/ -void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){ - int i; - for(i=0; i<pVdbeFunc->nAux; i++){ - struct AuxData *pAux = &pVdbeFunc->apAux[i]; - if( (i>31 || !(mask&(1<<i))) && pAux->pAux ){ - if( pAux->xDelete ){ - pAux->xDelete(pAux->pAux); - } - pAux->pAux = 0; - } - } -} - -/* -** Delete an entire VDBE. -*/ -void sqlite3VdbeDelete(Vdbe *p){ - int i; - if( p==0 ) return; - Cleanup(p); - if( p->pPrev ){ - p->pPrev->pNext = p->pNext; - }else{ - assert( p->db->pVdbe==p ); - p->db->pVdbe = p->pNext; - } - if( p->pNext ){ - p->pNext->pPrev = p->pPrev; - } - if( p->aOp ){ - for(i=0; i<p->nOp; i++){ - Op *pOp = &p->aOp[i]; - freeP3(pOp->p3type, pOp->p3); - } - sqliteFree(p->aOp); - } - releaseMemArray(p->aVar, p->nVar); - sqliteFree(p->aLabel); - sqliteFree(p->aStack); - releaseMemArray(p->aColName, p->nResColumn*2); - sqliteFree(p->aColName); - p->magic = VDBE_MAGIC_DEAD; - sqliteFree(p); -} - -/* -** If a MoveTo operation is pending on the given cursor, then do that -** MoveTo now. Return an error code. If no MoveTo is pending, this -** routine does nothing and returns SQLITE_OK. -*/ -int sqlite3VdbeCursorMoveto(Cursor *p){ - if( p->deferredMoveto ){ - int res, rc; - extern int sqlite3_search_count; - assert( p->isTable ); - if( p->isTable ){ - rc = sqlite3BtreeMoveto(p->pCursor, 0, p->movetoTarget, &res); - }else{ - rc = sqlite3BtreeMoveto(p->pCursor,(char*)&p->movetoTarget, - sizeof(i64),&res); - } - if( rc ) return rc; - *p->pIncrKey = 0; - p->lastRowid = keyToInt(p->movetoTarget); - p->rowidIsValid = res==0; - if( res<0 ){ - rc = sqlite3BtreeNext(p->pCursor, &res); - if( rc ) return rc; - } - sqlite3_search_count++; - p->deferredMoveto = 0; - p->cacheValid = 0; - } - return SQLITE_OK; -} - -/* -** The following functions: -** -** sqlite3VdbeSerialType() -** sqlite3VdbeSerialTypeLen() -** sqlite3VdbeSerialRead() -** sqlite3VdbeSerialLen() -** sqlite3VdbeSerialWrite() -** -** encapsulate the code that serializes values for storage in SQLite -** data and index records. Each serialized value consists of a -** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned -** integer, stored as a varint. -** -** In an SQLite index record, the serial type is stored directly before -** the blob of data that it corresponds to. In a table record, all serial -** types are stored at the start of the record, and the blobs of data at -** the end. Hence these functions allow the caller to handle the -** serial-type and data blob seperately. -** -** The following table describes the various storage classes for data: -** -** serial type bytes of data type -** -------------- --------------- --------------- -** 0 0 NULL -** 1 1 signed integer -** 2 2 signed integer -** 3 3 signed integer -** 4 4 signed integer -** 5 6 signed integer -** 6 8 signed integer -** 7 8 IEEE float -** 8-11 reserved for expansion -** N>=12 and even (N-12)/2 BLOB -** N>=13 and odd (N-13)/2 text -** -*/ - -/* -** Return the serial-type for the value stored in pMem. -*/ -u32 sqlite3VdbeSerialType(Mem *pMem){ - int flags = pMem->flags; - - if( flags&MEM_Null ){ - return 0; - } - if( flags&MEM_Int ){ - /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */ -# define MAX_6BYTE ((((i64)0x00001000)<<32)-1) - i64 i = pMem->i; - u64 u = i<0 ? -i : i; - if( u<=127 ) return 1; - if( u<=32767 ) return 2; - if( u<=8388607 ) return 3; - if( u<=2147483647 ) return 4; - if( u<=MAX_6BYTE ) return 5; - return 6; - } - if( flags&MEM_Real ){ - return 7; - } - if( flags&MEM_Str ){ - int n = pMem->n; - assert( n>=0 ); - return ((n*2) + 13); - } - if( flags&MEM_Blob ){ - return (pMem->n*2 + 12); - } - return 0; -} - -/* -** Return the length of the data corresponding to the supplied serial-type. -*/ -int sqlite3VdbeSerialTypeLen(u32 serial_type){ - if( serial_type>=12 ){ - return (serial_type-12)/2; - }else{ - static const u8 aSize[] = { 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0 }; - return aSize[serial_type]; - } -} - -/* -** Write the serialized data blob for the value stored in pMem into -** buf. It is assumed that the caller has allocated sufficient space. -** Return the number of bytes written. -*/ -int sqlite3VdbeSerialPut(unsigned char *buf, Mem *pMem){ - u32 serial_type = sqlite3VdbeSerialType(pMem); - int len; - - /* NULL */ - if( serial_type==0 ){ - return 0; - } - - /* Integer and Real */ - if( serial_type<=7 ){ - u64 v; - int i; - if( serial_type==7 ){ - v = *(u64*)&pMem->r; - }else{ - v = *(u64*)&pMem->i; - } - len = i = sqlite3VdbeSerialTypeLen(serial_type); - while( i-- ){ - buf[i] = (v&0xFF); - v >>= 8; - } - return len; - } - - /* String or blob */ - assert( serial_type>=12 ); - len = sqlite3VdbeSerialTypeLen(serial_type); - memcpy(buf, pMem->z, len); - return len; -} - -/* -** Deserialize the data blob pointed to by buf as serial type serial_type -** and store the result in pMem. Return the number of bytes read. -*/ -int sqlite3VdbeSerialGet( - const unsigned char *buf, /* Buffer to deserialize from */ - u32 serial_type, /* Serial type to deserialize */ - Mem *pMem /* Memory cell to write value into */ -){ - switch( serial_type ){ - case 8: /* Reserved for future use */ - case 9: /* Reserved for future use */ - case 10: /* Reserved for future use */ - case 11: /* Reserved for future use */ - case 0: { /* NULL */ - pMem->flags = MEM_Null; - break; - } - case 1: { /* 1-byte signed integer */ - pMem->i = (signed char)buf[0]; - pMem->flags = MEM_Int; - return 1; - } - case 2: { /* 2-byte signed integer */ - pMem->i = (((signed char)buf[0])<<8) | buf[1]; - pMem->flags = MEM_Int; - return 2; - } - case 3: { /* 3-byte signed integer */ - pMem->i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2]; - pMem->flags = MEM_Int; - return 3; - } - case 4: { /* 4-byte signed integer */ - pMem->i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3]; - pMem->flags = MEM_Int; - return 4; - } - case 5: { /* 6-byte signed integer */ - u64 x = (((signed char)buf[0])<<8) | buf[1]; - u32 y = (buf[2]<<24) | (buf[3]<<16) | (buf[4]<<8) | buf[5]; - x = (x<<32) | y; - pMem->i = *(i64*)&x; - pMem->flags = MEM_Int; - return 6; - } - case 6: /* 8-byte signed integer */ - case 7: { /* IEEE floating point */ - u64 x; - u32 y; -#ifndef NDEBUG - /* Verify that integers and floating point values use the same - ** byte order. The byte order differs on some (broken) architectures. - */ - static const u64 t1 = ((u64)0x3ff00000)<<32; - assert( 1.0==*(double*)&t1 ); -#endif - - x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3]; - y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7]; - x = (x<<32) | y; - if( serial_type==6 ){ - pMem->i = *(i64*)&x; - pMem->flags = MEM_Int; - }else{ - pMem->r = *(double*)&x; - pMem->flags = MEM_Real; - } - return 8; - } - default: { - int len = (serial_type-12)/2; - pMem->z = (char *)buf; - pMem->n = len; - pMem->xDel = 0; - if( serial_type&0x01 ){ - pMem->flags = MEM_Str | MEM_Ephem; - }else{ - pMem->flags = MEM_Blob | MEM_Ephem; - } - return len; - } - } - return 0; -} - -/* -** This function compares the two table rows or index records specified by -** {nKey1, pKey1} and {nKey2, pKey2}, returning a negative, zero -** or positive integer if {nKey1, pKey1} is less than, equal to or -** greater than {nKey2, pKey2}. Both Key1 and Key2 must be byte strings -** composed by the OP_MakeRecord opcode of the VDBE. -*/ -int sqlite3VdbeRecordCompare( - void *userData, - int nKey1, const void *pKey1, - int nKey2, const void *pKey2 -){ - KeyInfo *pKeyInfo = (KeyInfo*)userData; - u32 d1, d2; /* Offset into aKey[] of next data element */ - u32 idx1, idx2; /* Offset into aKey[] of next header element */ - u32 szHdr1, szHdr2; /* Number of bytes in header */ - int i = 0; - int nField; - int rc = 0; - const unsigned char *aKey1 = (const unsigned char *)pKey1; - const unsigned char *aKey2 = (const unsigned char *)pKey2; - - Mem mem1; - Mem mem2; - mem1.enc = pKeyInfo->enc; - mem2.enc = pKeyInfo->enc; - - idx1 = sqlite3GetVarint32(pKey1, &szHdr1); - d1 = szHdr1; - idx2 = sqlite3GetVarint32(pKey2, &szHdr2); - d2 = szHdr2; - nField = pKeyInfo->nField; - while( idx1<szHdr1 && idx2<szHdr2 ){ - u32 serial_type1; - u32 serial_type2; - - /* Read the serial types for the next element in each key. */ - idx1 += sqlite3GetVarint32(&aKey1[idx1], &serial_type1); - if( d1>=nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break; - idx2 += sqlite3GetVarint32(&aKey2[idx2], &serial_type2); - if( d2>=nKey2 && sqlite3VdbeSerialTypeLen(serial_type2)>0 ) break; - - /* Assert that there is enough space left in each key for the blob of - ** data to go with the serial type just read. This assert may fail if - ** the file is corrupted. Then read the value from each key into mem1 - ** and mem2 respectively. - */ - d1 += sqlite3VdbeSerialGet(&aKey1[d1], serial_type1, &mem1); - d2 += sqlite3VdbeSerialGet(&aKey2[d2], serial_type2, &mem2); - - rc = sqlite3MemCompare(&mem1, &mem2, i<nField ? pKeyInfo->aColl[i] : 0); - if( mem1.flags & MEM_Dyn ) sqlite3VdbeMemRelease(&mem1); - if( mem2.flags & MEM_Dyn ) sqlite3VdbeMemRelease(&mem2); - if( rc!=0 ){ - break; - } - i++; - } - - /* One of the keys ran out of fields, but all the fields up to that point - ** were equal. If the incrKey flag is true, then the second key is - ** treated as larger. - */ - if( rc==0 ){ - if( pKeyInfo->incrKey ){ - rc = -1; - }else if( d1<nKey1 ){ - rc = 1; - }else if( d2<nKey2 ){ - rc = -1; - } - } - - if( pKeyInfo->aSortOrder && i<pKeyInfo->nField && pKeyInfo->aSortOrder[i] ){ - rc = -rc; - } - - return rc; -} - -/* -** The argument is an index entry composed using the OP_MakeRecord opcode. -** The last entry in this record should be an integer (specifically -** an integer rowid). This routine returns the number of bytes in -** that integer. -*/ -int sqlite3VdbeIdxRowidLen(int nKey, const u8 *aKey){ - u32 szHdr; /* Size of the header */ - u32 typeRowid; /* Serial type of the rowid */ - - sqlite3GetVarint32(aKey, &szHdr); - sqlite3GetVarint32(&aKey[szHdr-1], &typeRowid); - return sqlite3VdbeSerialTypeLen(typeRowid); -} - - -/* -** pCur points at an index entry created using the OP_MakeRecord opcode. -** Read the rowid (the last field in the record) and store it in *rowid. -** Return SQLITE_OK if everything works, or an error code otherwise. -*/ -int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){ - i64 nCellKey; - int rc; - u32 szHdr; /* Size of the header */ - u32 typeRowid; /* Serial type of the rowid */ - u32 lenRowid; /* Size of the rowid */ - Mem m, v; - - sqlite3BtreeKeySize(pCur, &nCellKey); - if( nCellKey<=0 ){ - return SQLITE_CORRUPT_BKPT; - } - rc = sqlite3VdbeMemFromBtree(pCur, 0, nCellKey, 1, &m); - if( rc ){ - return rc; - } - sqlite3GetVarint32(m.z, &szHdr); - sqlite3GetVarint32(&m.z[szHdr-1], &typeRowid); - lenRowid = sqlite3VdbeSerialTypeLen(typeRowid); - sqlite3VdbeSerialGet(&m.z[m.n-lenRowid], typeRowid, &v); - *rowid = v.i; - sqlite3VdbeMemRelease(&m); - return SQLITE_OK; -} - -/* -** Compare the key of the index entry that cursor pC is point to against -** the key string in pKey (of length nKey). Write into *pRes a number -** that is negative, zero, or positive if pC is less than, equal to, -** or greater than pKey. Return SQLITE_OK on success. -** -** pKey is either created without a rowid or is truncated so that it -** omits the rowid at the end. The rowid at the end of the index entry -** is ignored as well. -*/ -int sqlite3VdbeIdxKeyCompare( - Cursor *pC, /* The cursor to compare against */ - int nKey, const u8 *pKey, /* The key to compare */ - int *res /* Write the comparison result here */ -){ - i64 nCellKey; - int rc; - BtCursor *pCur = pC->pCursor; - int lenRowid; - Mem m; - - sqlite3BtreeKeySize(pCur, &nCellKey); - if( nCellKey<=0 ){ - *res = 0; - return SQLITE_OK; - } - rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, nCellKey, 1, &m); - if( rc ){ - return rc; - } - lenRowid = sqlite3VdbeIdxRowidLen(m.n, m.z); - *res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey); - sqlite3VdbeMemRelease(&m); - return SQLITE_OK; -} - -/* -** This routine sets the value to be returned by subsequent calls to -** sqlite3_changes() on the database handle 'db'. -*/ -void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){ - db->nChange = nChange; - db->nTotalChange += nChange; -} - -/* -** Set a flag in the vdbe to update the change counter when it is finalised -** or reset. -*/ -void sqlite3VdbeCountChanges(Vdbe *v){ - v->changeCntOn = 1; -} - -/* -** Mark every prepared statement associated with a database connection -** as expired. -** -** An expired statement means that recompilation of the statement is -** recommend. Statements expire when things happen that make their -** programs obsolete. Removing user-defined functions or collating -** sequences, or changing an authorization function are the types of -** things that make prepared statements obsolete. -*/ -void sqlite3ExpirePreparedStatements(sqlite3 *db){ - Vdbe *p; - for(p = db->pVdbe; p; p=p->pNext){ - p->expired = 1; - } -} - -/* -** Return the database associated with the Vdbe. -*/ -sqlite3 *sqlite3VdbeDb(Vdbe *v){ - return v->db; -} diff --git a/ext/pdo_sqlite/sqlite/src/vdbefifo.c b/ext/pdo_sqlite/sqlite/src/vdbefifo.c deleted file mode 100644 index 7ea6c050f9bbd..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbefifo.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -** 2005 June 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements a FIFO queue of rowids used for processing -** UPDATE and DELETE statements. -*/ -#include "sqliteInt.h" -#include "vdbeInt.h" - -/* -** Allocate a new FifoPage and return a pointer to it. Return NULL if -** we run out of memory. Leave space on the page for nEntry entries. -*/ -static FifoPage *allocatePage(int nEntry){ - FifoPage *pPage; - if( nEntry>32767 ){ - nEntry = 32767; - } - pPage = sqliteMallocRaw( sizeof(FifoPage) + sizeof(i64)*(nEntry-1) ); - if( pPage ){ - pPage->nSlot = nEntry; - pPage->iWrite = 0; - pPage->iRead = 0; - pPage->pNext = 0; - } - return pPage; -} - -/* -** Initialize a Fifo structure. -*/ -void sqlite3VdbeFifoInit(Fifo *pFifo){ - memset(pFifo, 0, sizeof(*pFifo)); -} - -/* -** Push a single 64-bit integer value into the Fifo. Return SQLITE_OK -** normally. SQLITE_NOMEM is returned if we are unable to allocate -** memory. -*/ -int sqlite3VdbeFifoPush(Fifo *pFifo, i64 val){ - FifoPage *pPage; - pPage = pFifo->pLast; - if( pPage==0 ){ - pPage = pFifo->pLast = pFifo->pFirst = allocatePage(20); - if( pPage==0 ){ - return SQLITE_NOMEM; - } - }else if( pPage->iWrite>=pPage->nSlot ){ - pPage->pNext = allocatePage(pFifo->nEntry); - if( pPage->pNext==0 ){ - return SQLITE_NOMEM; - } - pPage = pFifo->pLast = pPage->pNext; - } - pPage->aSlot[pPage->iWrite++] = val; - pFifo->nEntry++; - return SQLITE_OK; -} - -/* -** Extract a single 64-bit integer value from the Fifo. The integer -** extracted is the one least recently inserted. If the Fifo is empty -** return SQLITE_DONE. -*/ -int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){ - FifoPage *pPage; - if( pFifo->nEntry==0 ){ - return SQLITE_DONE; - } - assert( pFifo->nEntry>0 ); - pPage = pFifo->pFirst; - assert( pPage!=0 ); - assert( pPage->iWrite>pPage->iRead ); - assert( pPage->iWrite<=pPage->nSlot ); - assert( pPage->iRead<pPage->nSlot ); - assert( pPage->iRead>=0 ); - *pVal = pPage->aSlot[pPage->iRead++]; - pFifo->nEntry--; - if( pPage->iRead>=pPage->iWrite ){ - pFifo->pFirst = pPage->pNext; - sqliteFree(pPage); - if( pFifo->nEntry==0 ){ - assert( pFifo->pLast==pPage ); - pFifo->pLast = 0; - }else{ - assert( pFifo->pFirst!=0 ); - } - }else{ - assert( pFifo->nEntry>0 ); - } - return SQLITE_OK; -} - -/* -** Delete all information from a Fifo object. Free all memory held -** by the Fifo. -*/ -void sqlite3VdbeFifoClear(Fifo *pFifo){ - FifoPage *pPage, *pNextPage; - for(pPage=pFifo->pFirst; pPage; pPage=pNextPage){ - pNextPage = pPage->pNext; - sqliteFree(pPage); - } - sqlite3VdbeFifoInit(pFifo); -} diff --git a/ext/pdo_sqlite/sqlite/src/vdbemem.c b/ext/pdo_sqlite/sqlite/src/vdbemem.c deleted file mode 100644 index 0b7e193bec9a4..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/vdbemem.c +++ /dev/null @@ -1,840 +0,0 @@ -/* -** 2004 May 26 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** -** This file contains code use to manipulate "Mem" structure. A "Mem" -** stores a single value in the VDBE. Mem is an opaque structure visible -** only within the VDBE. Interface routines refer to a Mem using the -** name sqlite_value -*/ -#include "sqliteInt.h" -#include "os.h" -#include <ctype.h> -#include "vdbeInt.h" - -/* -** If pMem is an object with a valid string representation, this routine -** ensures the internal encoding for the string representation is -** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE. -** -** If pMem is not a string object, or the encoding of the string -** representation is already stored using the requested encoding, then this -** routine is a no-op. -** -** SQLITE_OK is returned if the conversion is successful (or not required). -** SQLITE_NOMEM may be returned if a malloc() fails during conversion -** between formats. -*/ -int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){ - int rc; - if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){ - return SQLITE_OK; - } -#ifdef SQLITE_OMIT_UTF16 - return SQLITE_ERROR; -#else - rc = sqlite3VdbeMemTranslate(pMem, desiredEnc); - if( rc==SQLITE_NOMEM ){ - sqlite3VdbeMemRelease(pMem); - pMem->flags = MEM_Null; - pMem->z = 0; - } - return rc; -#endif -} - -/* -** Make the given Mem object MEM_Dyn. -** -** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. -*/ -int sqlite3VdbeMemDynamicify(Mem *pMem){ - int n = pMem->n; - u8 *z; - if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){ - return SQLITE_OK; - } - assert( (pMem->flags & MEM_Dyn)==0 ); - assert( pMem->flags & (MEM_Str|MEM_Blob) ); - z = sqliteMallocRaw( n+2 ); - if( z==0 ){ - return SQLITE_NOMEM; - } - pMem->flags |= MEM_Dyn|MEM_Term; - pMem->xDel = 0; - memcpy(z, pMem->z, n ); - z[n] = 0; - z[n+1] = 0; - pMem->z = z; - pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short); - return SQLITE_OK; -} - -/* -** Make the given Mem object either MEM_Short or MEM_Dyn so that bytes -** of the Mem.z[] array can be modified. -** -** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. -*/ -int sqlite3VdbeMemMakeWriteable(Mem *pMem){ - int n; - u8 *z; - if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){ - return SQLITE_OK; - } - assert( (pMem->flags & MEM_Dyn)==0 ); - assert( pMem->flags & (MEM_Str|MEM_Blob) ); - if( (n = pMem->n)+2<sizeof(pMem->zShort) ){ - z = pMem->zShort; - pMem->flags |= MEM_Short|MEM_Term; - }else{ - z = sqliteMallocRaw( n+2 ); - if( z==0 ){ - return SQLITE_NOMEM; - } - pMem->flags |= MEM_Dyn|MEM_Term; - pMem->xDel = 0; - } - memcpy(z, pMem->z, n ); - z[n] = 0; - z[n+1] = 0; - pMem->z = z; - pMem->flags &= ~(MEM_Ephem|MEM_Static); - return SQLITE_OK; -} - -/* -** Make sure the given Mem is \u0000 terminated. -*/ -int sqlite3VdbeMemNulTerminate(Mem *pMem){ - /* In SQLite, a string without a nul terminator occurs when a string - ** is loaded from disk (in this case the memory management is ephemeral), - ** or when it is supplied by the user as a bound variable or function - ** return value. Therefore, the memory management of the string must be - ** either ephemeral, static or controlled by a user-supplied destructor. - */ - assert( - !(pMem->flags&MEM_Str) || /* it's not a string, or */ - (pMem->flags&MEM_Term) || /* it's nul term. already, or */ - (pMem->flags&(MEM_Ephem|MEM_Static)) || /* it's static or ephem, or */ - (pMem->flags&MEM_Dyn && pMem->xDel) /* external management */ - ); - if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){ - return SQLITE_OK; /* Nothing to do */ - } - - if( pMem->flags & (MEM_Static|MEM_Ephem) ){ - return sqlite3VdbeMemMakeWriteable(pMem); - }else{ - char *z = sqliteMalloc(pMem->n+2); - if( !z ) return SQLITE_NOMEM; - memcpy(z, pMem->z, pMem->n); - z[pMem->n] = 0; - z[pMem->n+1] = 0; - pMem->xDel(pMem->z); - pMem->xDel = 0; - pMem->z = z; - } - return SQLITE_OK; -} - -/* -** Add MEM_Str to the set of representations for the given Mem. Numbers -** are converted using sqlite3_snprintf(). Converting a BLOB to a string -** is a no-op. -** -** Existing representations MEM_Int and MEM_Real are *not* invalidated. -** -** A MEM_Null value will never be passed to this function. This function is -** used for converting values to text for returning to the user (i.e. via -** sqlite3_value_text()), or for ensuring that values to be used as btree -** keys are strings. In the former case a NULL pointer is returned the -** user and the later is an internal programming error. -*/ -int sqlite3VdbeMemStringify(Mem *pMem, int enc){ - int rc = SQLITE_OK; - int fg = pMem->flags; - u8 *z = pMem->zShort; - - assert( !(fg&(MEM_Str|MEM_Blob)) ); - assert( fg&(MEM_Int|MEM_Real) ); - - /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8 - ** string representation of the value. Then, if the required encoding - ** is UTF-16le or UTF-16be do a translation. - ** - ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16. - */ - if( fg & MEM_Real ){ - sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r); - }else{ - assert( fg & MEM_Int ); - sqlite3_snprintf(NBFS, z, "%lld", pMem->i); - } - pMem->n = strlen(z); - pMem->z = z; - pMem->enc = SQLITE_UTF8; - pMem->flags |= MEM_Str | MEM_Short | MEM_Term; - sqlite3VdbeChangeEncoding(pMem, enc); - return rc; -} - -/* -** Memory cell pMem contains the context of an aggregate function. -** This routine calls the finalize method for that function. The -** result of the aggregate is stored back into pMem. -*/ -void sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){ - if( pFunc && pFunc->xFinalize ){ - sqlite3_context ctx; - assert( (pMem->flags & MEM_Null)!=0 || pFunc==*(FuncDef**)&pMem->i ); - ctx.s.flags = MEM_Null; - ctx.s.z = pMem->zShort; - ctx.pMem = pMem; - ctx.pFunc = pFunc; - pFunc->xFinalize(&ctx); - if( pMem->z && pMem->z!=pMem->zShort ){ - sqliteFree( pMem->z ); - } - *pMem = ctx.s; - if( pMem->flags & MEM_Short ){ - pMem->z = pMem->zShort; - } - } -} - -/* -** Release any memory held by the Mem. This may leave the Mem in an -** inconsistent state, for example with (Mem.z==0) and -** (Mem.type==SQLITE_TEXT). -*/ -void sqlite3VdbeMemRelease(Mem *p){ - if( p->flags & (MEM_Dyn|MEM_Agg) ){ - if( p->xDel ){ - if( p->flags & MEM_Agg ){ - sqlite3VdbeMemFinalize(p, *(FuncDef**)&p->i); - assert( (p->flags & MEM_Agg)==0 ); - sqlite3VdbeMemRelease(p); - }else{ - p->xDel((void *)p->z); - } - }else{ - sqliteFree(p->z); - } - p->z = 0; - p->xDel = 0; - } -} - -/* -** Return some kind of integer value which is the best we can do -** at representing the value that *pMem describes as an integer. -** If pMem is an integer, then the value is exact. If pMem is -** a floating-point then the value returned is the integer part. -** If pMem is a string or blob, then we make an attempt to convert -** it into a integer and return that. If pMem is NULL, return 0. -** -** If pMem is a string, its encoding might be changed. -*/ -i64 sqlite3VdbeIntValue(Mem *pMem){ - int flags = pMem->flags; - if( flags & MEM_Int ){ - return pMem->i; - }else if( flags & MEM_Real ){ - return (i64)pMem->r; - }else if( flags & (MEM_Str|MEM_Blob) ){ - i64 value; - if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) - || sqlite3VdbeMemNulTerminate(pMem) ){ - return SQLITE_NOMEM; - } - assert( pMem->z ); - sqlite3atoi64(pMem->z, &value); - return value; - }else{ - return 0; - } -} - -/* -** Convert pMem to type integer. Invalidate any prior representations. -*/ -int sqlite3VdbeMemIntegerify(Mem *pMem){ - pMem->i = sqlite3VdbeIntValue(pMem); - sqlite3VdbeMemRelease(pMem); - pMem->flags = MEM_Int; - return SQLITE_OK; -} - -/* -** Return the best representation of pMem that we can get into a -** double. If pMem is already a double or an integer, return its -** value. If it is a string or blob, try to convert it to a double. -** If it is a NULL, return 0.0. -*/ -double sqlite3VdbeRealValue(Mem *pMem){ - if( pMem->flags & MEM_Real ){ - return pMem->r; - }else if( pMem->flags & MEM_Int ){ - return (double)pMem->i; - }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ - double val = 0.0; - if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) - || sqlite3VdbeMemNulTerminate(pMem) ){ - return SQLITE_NOMEM; - } - assert( pMem->z ); - sqlite3AtoF(pMem->z, &val); - return val; - }else{ - return 0.0; - } -} - -/* -** Convert pMem so that it is of type MEM_Real. Invalidate any -** prior representations. -*/ -int sqlite3VdbeMemRealify(Mem *pMem){ - pMem->r = sqlite3VdbeRealValue(pMem); - sqlite3VdbeMemRelease(pMem); - pMem->flags = MEM_Real; - return SQLITE_OK; -} - -/* -** Delete any previous value and set the value stored in *pMem to NULL. -*/ -void sqlite3VdbeMemSetNull(Mem *pMem){ - sqlite3VdbeMemRelease(pMem); - pMem->flags = MEM_Null; - pMem->type = SQLITE_NULL; - pMem->n = 0; -} - -/* -** Delete any previous value and set the value stored in *pMem to val, -** manifest type INTEGER. -*/ -void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){ - sqlite3VdbeMemRelease(pMem); - pMem->i = val; - pMem->flags = MEM_Int; - pMem->type = SQLITE_INTEGER; -} - -/* -** Delete any previous value and set the value stored in *pMem to val, -** manifest type REAL. -*/ -void sqlite3VdbeMemSetDouble(Mem *pMem, double val){ - sqlite3VdbeMemRelease(pMem); - pMem->r = val; - pMem->flags = MEM_Real; - pMem->type = SQLITE_FLOAT; -} - -/* -** Make an shallow copy of pFrom into pTo. Prior contents of -** pTo are overwritten. The pFrom->z field is not duplicated. If -** pFrom->z is used, then pTo->z points to the same thing as pFrom->z -** and flags gets srcType (either MEM_Ephem or MEM_Static). -*/ -void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ - memcpy(pTo, pFrom, sizeof(*pFrom)-sizeof(pFrom->zShort)); - pTo->xDel = 0; - if( pTo->flags & (MEM_Str|MEM_Blob) ){ - pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Short|MEM_Ephem); - assert( srcType==MEM_Ephem || srcType==MEM_Static ); - pTo->flags |= srcType; - } -} - -/* -** Make a full copy of pFrom into pTo. Prior contents of pTo are -** freed before the copy is made. -*/ -int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){ - int rc; - if( pTo->flags & MEM_Dyn ){ - sqlite3VdbeMemRelease(pTo); - } - sqlite3VdbeMemShallowCopy(pTo, pFrom, MEM_Ephem); - if( pTo->flags & MEM_Ephem ){ - rc = sqlite3VdbeMemMakeWriteable(pTo); - }else{ - rc = SQLITE_OK; - } - return rc; -} - -/* -** Transfer the contents of pFrom to pTo. Any existing value in pTo is -** freed. If pFrom contains ephemeral data, a copy is made. -** -** pFrom contains an SQL NULL when this routine returns. SQLITE_NOMEM -** might be returned if pFrom held ephemeral data and we were unable -** to allocate enough space to make a copy. -*/ -int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){ - int rc; - if( pTo->flags & MEM_Dyn ){ - sqlite3VdbeMemRelease(pTo); - } - memcpy(pTo, pFrom, sizeof(Mem)); - if( pFrom->flags & MEM_Short ){ - pTo->z = pTo->zShort; - } - pFrom->flags = MEM_Null; - pFrom->xDel = 0; - if( pTo->flags & MEM_Ephem ){ - rc = sqlite3VdbeMemMakeWriteable(pTo); - }else{ - rc = SQLITE_OK; - } - return rc; -} - -/* -** Change the value of a Mem to be a string or a BLOB. -*/ -int sqlite3VdbeMemSetStr( - Mem *pMem, /* Memory cell to set to string value */ - const char *z, /* String pointer */ - int n, /* Bytes in string, or negative */ - u8 enc, /* Encoding of z. 0 for BLOBs */ - void (*xDel)(void*) /* Destructor function */ -){ - sqlite3VdbeMemRelease(pMem); - if( !z ){ - pMem->flags = MEM_Null; - pMem->type = SQLITE_NULL; - return SQLITE_OK; - } - - pMem->z = (char *)z; - if( xDel==SQLITE_STATIC ){ - pMem->flags = MEM_Static; - }else if( xDel==SQLITE_TRANSIENT ){ - pMem->flags = MEM_Ephem; - }else{ - pMem->flags = MEM_Dyn; - pMem->xDel = xDel; - } - - pMem->enc = enc; - pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT; - pMem->n = n; - - assert( enc==0 || enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE - || enc==SQLITE_UTF16BE ); - switch( enc ){ - case 0: - pMem->flags |= MEM_Blob; - pMem->enc = SQLITE_UTF8; - break; - - case SQLITE_UTF8: - pMem->flags |= MEM_Str; - if( n<0 ){ - pMem->n = strlen(z); - pMem->flags |= MEM_Term; - } - break; - -#ifndef SQLITE_OMIT_UTF16 - case SQLITE_UTF16LE: - case SQLITE_UTF16BE: - pMem->flags |= MEM_Str; - if( pMem->n<0 ){ - pMem->n = sqlite3utf16ByteLen(pMem->z,-1); - pMem->flags |= MEM_Term; - } - if( sqlite3VdbeMemHandleBom(pMem) ){ - return SQLITE_NOMEM; - } -#endif /* SQLITE_OMIT_UTF16 */ - } - if( pMem->flags&MEM_Ephem ){ - return sqlite3VdbeMemMakeWriteable(pMem); - } - return SQLITE_OK; -} - -/* -** Compare the values contained by the two memory cells, returning -** negative, zero or positive if pMem1 is less than, equal to, or greater -** than pMem2. Sorting order is NULL's first, followed by numbers (integers -** and reals) sorted numerically, followed by text ordered by the collating -** sequence pColl and finally blob's ordered by memcmp(). -** -** Two NULL values are considered equal by this function. -*/ -int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ - int rc; - int f1, f2; - int combined_flags; - - /* Interchange pMem1 and pMem2 if the collating sequence specifies - ** DESC order. - */ - f1 = pMem1->flags; - f2 = pMem2->flags; - combined_flags = f1|f2; - - /* If one value is NULL, it is less than the other. If both values - ** are NULL, return 0. - */ - if( combined_flags&MEM_Null ){ - return (f2&MEM_Null) - (f1&MEM_Null); - } - - /* If one value is a number and the other is not, the number is less. - ** If both are numbers, compare as reals if one is a real, or as integers - ** if both values are integers. - */ - if( combined_flags&(MEM_Int|MEM_Real) ){ - if( !(f1&(MEM_Int|MEM_Real)) ){ - return 1; - } - if( !(f2&(MEM_Int|MEM_Real)) ){ - return -1; - } - if( (f1 & f2 & MEM_Int)==0 ){ - double r1, r2; - if( (f1&MEM_Real)==0 ){ - r1 = pMem1->i; - }else{ - r1 = pMem1->r; - } - if( (f2&MEM_Real)==0 ){ - r2 = pMem2->i; - }else{ - r2 = pMem2->r; - } - if( r1<r2 ) return -1; - if( r1>r2 ) return 1; - return 0; - }else{ - assert( f1&MEM_Int ); - assert( f2&MEM_Int ); - if( pMem1->i < pMem2->i ) return -1; - if( pMem1->i > pMem2->i ) return 1; - return 0; - } - } - - /* If one value is a string and the other is a blob, the string is less. - ** If both are strings, compare using the collating functions. - */ - if( combined_flags&MEM_Str ){ - if( (f1 & MEM_Str)==0 ){ - return 1; - } - if( (f2 & MEM_Str)==0 ){ - return -1; - } - - assert( pMem1->enc==pMem2->enc ); - assert( pMem1->enc==SQLITE_UTF8 || - pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE ); - - /* This assert may fail if the collation sequence is deleted after this - ** vdbe program is compiled. The documentation defines this as an - ** undefined condition. A crash is usual result. - */ - assert( !pColl || pColl->xCmp ); - - if( pColl ){ - if( pMem1->enc==pColl->enc ){ - return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z); - }else{ - u8 origEnc = pMem1->enc; - rc = pColl->xCmp( - pColl->pUser, - sqlite3ValueBytes((sqlite3_value*)pMem1, pColl->enc), - sqlite3ValueText((sqlite3_value*)pMem1, pColl->enc), - sqlite3ValueBytes((sqlite3_value*)pMem2, pColl->enc), - sqlite3ValueText((sqlite3_value*)pMem2, pColl->enc) - ); - sqlite3ValueBytes((sqlite3_value*)pMem1, origEnc); - sqlite3ValueText((sqlite3_value*)pMem1, origEnc); - sqlite3ValueBytes((sqlite3_value*)pMem2, origEnc); - sqlite3ValueText((sqlite3_value*)pMem2, origEnc); - return rc; - } - } - /* If a NULL pointer was passed as the collate function, fall through - ** to the blob case and use memcmp(). */ - } - - /* Both values must be blobs. Compare using memcmp(). */ - rc = memcmp(pMem1->z, pMem2->z, (pMem1->n>pMem2->n)?pMem2->n:pMem1->n); - if( rc==0 ){ - rc = pMem1->n - pMem2->n; - } - return rc; -} - -/* -** Move data out of a btree key or data field and into a Mem structure. -** The data or key is taken from the entry that pCur is currently pointing -** to. offset and amt determine what portion of the data or key to retrieve. -** key is true to get the key or false to get data. The result is written -** into the pMem element. -** -** The pMem structure is assumed to be uninitialized. Any prior content -** is overwritten without being freed. -** -** If this routine fails for any reason (malloc returns NULL or unable -** to read from the disk) then the pMem is left in an inconsistent state. -*/ -int sqlite3VdbeMemFromBtree( - BtCursor *pCur, /* Cursor pointing at record to retrieve. */ - int offset, /* Offset from the start of data to return bytes from. */ - int amt, /* Number of bytes to return. */ - int key, /* If true, retrieve from the btree key, not data. */ - Mem *pMem /* OUT: Return data in this Mem structure. */ -){ - char *zData; /* Data from the btree layer */ - int available; /* Number of bytes available on the local btree page */ - - if( key ){ - zData = (char *)sqlite3BtreeKeyFetch(pCur, &available); - }else{ - zData = (char *)sqlite3BtreeDataFetch(pCur, &available); - } - - pMem->n = amt; - if( offset+amt<=available ){ - pMem->z = &zData[offset]; - pMem->flags = MEM_Blob|MEM_Ephem; - }else{ - int rc; - if( amt>NBFS-2 ){ - zData = (char *)sqliteMallocRaw(amt+2); - if( !zData ){ - return SQLITE_NOMEM; - } - pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term; - pMem->xDel = 0; - }else{ - zData = &(pMem->zShort[0]); - pMem->flags = MEM_Blob|MEM_Short|MEM_Term; - } - pMem->z = zData; - pMem->enc = 0; - pMem->type = SQLITE_BLOB; - - if( key ){ - rc = sqlite3BtreeKey(pCur, offset, amt, zData); - }else{ - rc = sqlite3BtreeData(pCur, offset, amt, zData); - } - zData[amt] = 0; - zData[amt+1] = 0; - if( rc!=SQLITE_OK ){ - if( amt>NBFS-2 ){ - assert( zData!=pMem->zShort ); - assert( pMem->flags & MEM_Dyn ); - sqliteFree(zData); - } else { - assert( zData==pMem->zShort ); - assert( pMem->flags & MEM_Short ); - } - return rc; - } - } - - return SQLITE_OK; -} - -#ifndef NDEBUG -/* -** Perform various checks on the memory cell pMem. An assert() will -** fail if pMem is internally inconsistent. -*/ -void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){ - int flags = pMem->flags; - assert( flags!=0 ); /* Must define some type */ - if( pMem->flags & (MEM_Str|MEM_Blob) ){ - int x = pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short); - assert( x!=0 ); /* Strings must define a string subtype */ - assert( (x & (x-1))==0 ); /* Only one string subtype can be defined */ - assert( pMem->z!=0 ); /* Strings must have a value */ - /* Mem.z points to Mem.zShort iff the subtype is MEM_Short */ - assert( (pMem->flags & MEM_Short)==0 || pMem->z==pMem->zShort ); - assert( (pMem->flags & MEM_Short)!=0 || pMem->z!=pMem->zShort ); - /* No destructor unless there is MEM_Dyn */ - assert( pMem->xDel==0 || (pMem->flags & MEM_Dyn)!=0 ); - - if( (flags & MEM_Str) ){ - assert( pMem->enc==SQLITE_UTF8 || - pMem->enc==SQLITE_UTF16BE || - pMem->enc==SQLITE_UTF16LE - ); - /* If the string is UTF-8 encoded and nul terminated, then pMem->n - ** must be the length of the string. (Later:) If the database file - ** has been corrupted, '\000' characters might have been inserted - ** into the middle of the string. In that case, the strlen() might - ** be less. - */ - if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){ - assert( strlen(pMem->z)<=pMem->n ); - assert( pMem->z[pMem->n]==0 ); - } - } - }else{ - /* Cannot define a string subtype for non-string objects */ - assert( (pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short))==0 ); - assert( pMem->xDel==0 ); - } - /* MEM_Null excludes all other types */ - assert( (pMem->flags&(MEM_Str|MEM_Int|MEM_Real|MEM_Blob))==0 - || (pMem->flags&MEM_Null)==0 ); - /* If the MEM is both real and integer, the values are equal */ - assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) - || pMem->r==pMem->i ); -} -#endif - -/* This function is only available internally, it is not part of the -** external API. It works in a similar way to sqlite3_value_text(), -** except the data returned is in the encoding specified by the second -** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or -** SQLITE_UTF8. -*/ -const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ - if( !pVal ) return 0; - assert( enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE || enc==SQLITE_UTF8); - - if( pVal->flags&MEM_Null ){ - return 0; - } - if( pVal->flags&MEM_Str ){ - sqlite3VdbeChangeEncoding(pVal, enc); - }else if( !(pVal->flags&MEM_Blob) ){ - sqlite3VdbeMemStringify(pVal, enc); - } - return (const void *)(pVal->z); -} - -/* -** Create a new sqlite3_value object. -*/ -sqlite3_value* sqlite3ValueNew(void){ - Mem *p = sqliteMalloc(sizeof(*p)); - if( p ){ - p->flags = MEM_Null; - p->type = SQLITE_NULL; - } - return p; -} - -/* -** Create a new sqlite3_value object, containing the value of pExpr. -** -** This only works for very simple expressions that consist of one constant -** token (i.e. "5", "5.1", "NULL", "'a string'"). If the expression can -** be converted directly into a value, then the value is allocated and -** a pointer written to *ppVal. The caller is responsible for deallocating -** the value by passing it to sqlite3ValueFree() later on. If the expression -** cannot be converted to a value, then *ppVal is set to NULL. -*/ -int sqlite3ValueFromExpr( - Expr *pExpr, - u8 enc, - u8 affinity, - sqlite3_value **ppVal -){ - int op; - char *zVal = 0; - sqlite3_value *pVal = 0; - - if( !pExpr ){ - *ppVal = 0; - return SQLITE_OK; - } - op = pExpr->op; - - if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ - zVal = sqliteStrNDup(pExpr->token.z, pExpr->token.n); - pVal = sqlite3ValueNew(); - if( !zVal || !pVal ) goto no_mem; - sqlite3Dequote(zVal); - sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, sqlite3FreeX); - if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){ - sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc); - }else{ - sqlite3ValueApplyAffinity(pVal, affinity, enc); - } - }else if( op==TK_UMINUS ) { - if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){ - pVal->i = -1 * pVal->i; - pVal->r = -1.0 * pVal->r; - } - } -#ifndef SQLITE_OMIT_BLOB_LITERAL - else if( op==TK_BLOB ){ - int nVal; - pVal = sqlite3ValueNew(); - zVal = sqliteStrNDup(pExpr->token.z+1, pExpr->token.n-1); - if( !zVal || !pVal ) goto no_mem; - sqlite3Dequote(zVal); - nVal = strlen(zVal)/2; - sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(zVal), nVal, 0, sqlite3FreeX); - sqliteFree(zVal); - } -#endif - - *ppVal = pVal; - return SQLITE_OK; - -no_mem: - sqliteFree(zVal); - sqlite3ValueFree(pVal); - *ppVal = 0; - return SQLITE_NOMEM; -} - -/* -** Change the string value of an sqlite3_value object -*/ -void sqlite3ValueSetStr( - sqlite3_value *v, - int n, - const void *z, - u8 enc, - void (*xDel)(void*) -){ - if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel); -} - -/* -** Free an sqlite3_value object -*/ -void sqlite3ValueFree(sqlite3_value *v){ - if( !v ) return; - sqlite3ValueSetStr(v, 0, 0, SQLITE_UTF8, SQLITE_STATIC); - sqliteFree(v); -} - -/* -** Return the number of bytes in the sqlite3_value object assuming -** that it uses the encoding "enc" -*/ -int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){ - Mem *p = (Mem*)pVal; - if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){ - return p->n; - } - return 0; -} diff --git a/ext/pdo_sqlite/sqlite/src/where.c b/ext/pdo_sqlite/sqlite/src/where.c deleted file mode 100644 index d057acd0fe838..0000000000000 --- a/ext/pdo_sqlite/sqlite/src/where.c +++ /dev/null @@ -1,2052 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This module contains C code that generates VDBE code used to process -** the WHERE clause of SQL statements. This module is reponsible for -** generating the code that loops through a table looking for applicable -** rows. Indices are selected and used to speed the search when doing -** so is applicable. Because this module is responsible for selecting -** indices, you might also think of this module as the "query optimizer". -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** The number of bits in a Bitmask. "BMS" means "BitMask Size". -*/ -#define BMS (sizeof(Bitmask)*8) - -/* -** Determine the number of elements in an array. -*/ -#define ARRAYSIZE(X) (sizeof(X)/sizeof(X[0])) - -/* -** Trace output macros -*/ -#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) -int sqlite3_where_trace = 0; -# define TRACE(X) if(sqlite3_where_trace) sqlite3DebugPrintf X -#else -# define TRACE(X) -#endif - -/* Forward reference -*/ -typedef struct WhereClause WhereClause; - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by an AND operator. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X <op> <expr> -** -** where X is a column name and <op> is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.leftColumn record the -** cursor number and column number for X. WhereTerm.operator records -** the <op> using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single ExprMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The ExprMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -*/ -typedef struct WhereTerm WhereTerm; -struct WhereTerm { - Expr *pExpr; /* Pointer to the subexpression */ - i16 iParent; /* Disable pWC->a[iParent] when this term disabled */ - i16 leftCursor; /* Cursor number of X in "X <op> <expr>" */ - i16 leftColumn; /* Column number of X in "X <op> <expr>" */ - u16 operator; /* A WO_xx value describing <op> */ - u8 flags; /* Bit flags. See below */ - u8 nChild; /* Number of children that must disable us */ - WhereClause *pWC; /* The clause this term is part of */ - Bitmask prereqRight; /* Bitmask of tables used by pRight */ - Bitmask prereqAll; /* Bitmask of tables referenced by p */ -}; - -/* -** Allowed values of WhereTerm.flags -*/ -#define TERM_DYNAMIC 0x01 /* Need to call sqlite3ExprDelete(pExpr) */ -#define TERM_VIRTUAL 0x02 /* Added by the optimizer. Do not code */ -#define TERM_CODED 0x04 /* This term is already coded */ -#define TERM_COPIED 0x08 /* Has a child */ -#define TERM_OR_OK 0x10 /* Used during OR-clause processing */ - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -*/ -struct WhereClause { - Parse *pParse; /* The parser context */ - int nTerm; /* Number of terms */ - int nSlot; /* Number of entries in a[] */ - WhereTerm *a; /* Each a[] describes a term of the WHERE cluase */ - WhereTerm aStatic[10]; /* Initial static space for a[] */ -}; - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If ExprMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<<A. -** -** For example, if the WHERE clause expression used these VDBE -** cursors: 4, 5, 8, 29, 57, 73. Then the ExprMaskSet structure -** would map those cursor numbers into bits 0 through 5. -** -** Note that the mapping is not necessarily ordered. In the example -** above, the mapping might go like this: 4->3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. -*/ -typedef struct ExprMaskSet ExprMaskSet; -struct ExprMaskSet { - int n; /* Number of assigned cursor values */ - int ix[sizeof(Bitmask)*8]; /* Cursor assigned to each bit */ -}; - - -/* -** Bitmasks for the operators that indices are able to exploit. An -** OR-ed combination of these values can be used when searching for -** terms in the where clause. -*/ -#define WO_IN 1 -#define WO_EQ 2 -#define WO_LT (WO_EQ<<(TK_LT-TK_EQ)) -#define WO_LE (WO_EQ<<(TK_LE-TK_EQ)) -#define WO_GT (WO_EQ<<(TK_GT-TK_EQ)) -#define WO_GE (WO_EQ<<(TK_GE-TK_EQ)) - -/* -** Value for flags returned by bestIndex() -*/ -#define WHERE_ROWID_EQ 0x0001 /* rowid=EXPR or rowid IN (...) */ -#define WHERE_ROWID_RANGE 0x0002 /* rowid<EXPR and/or rowid>EXPR */ -#define WHERE_COLUMN_EQ 0x0010 /* x=EXPR or x IN (...) */ -#define WHERE_COLUMN_RANGE 0x0020 /* x<EXPR and/or x>EXPR */ -#define WHERE_COLUMN_IN 0x0040 /* x IN (...) */ -#define WHERE_TOP_LIMIT 0x0100 /* x<EXPR or x<=EXPR constraint */ -#define WHERE_BTM_LIMIT 0x0200 /* x>EXPR or x>=EXPR constraint */ -#define WHERE_IDX_ONLY 0x0800 /* Use index only - omit table */ -#define WHERE_ORDERBY 0x1000 /* Output will appear in correct order */ -#define WHERE_REVERSE 0x2000 /* Scan in reverse order */ -#define WHERE_UNIQUE 0x4000 /* Selects no more than one row */ - -/* -** Initialize a preallocated WhereClause structure. -*/ -static void whereClauseInit(WhereClause *pWC, Parse *pParse){ - pWC->pParse = pParse; - pWC->nTerm = 0; - pWC->nSlot = ARRAYSIZE(pWC->aStatic); - pWC->a = pWC->aStatic; -} - -/* -** Deallocate a WhereClause structure. The WhereClause structure -** itself is not freed. This routine is the inverse of whereClauseInit(). -*/ -static void whereClauseClear(WhereClause *pWC){ - int i; - WhereTerm *a; - for(i=pWC->nTerm-1, a=pWC->a; i>=0; i--, a++){ - if( a->flags & TERM_DYNAMIC ){ - sqlite3ExprDelete(a->pExpr); - } - } - if( pWC->a!=pWC->aStatic ){ - sqliteFree(pWC->a); - } -} - -/* -** Add a new entries to the WhereClause structure. Increase the allocated -** space as necessary. -** -** WARNING: This routine might reallocate the space used to store -** WhereTerms. All pointers to WhereTerms should be invalided after -** calling this routine. Such pointers may be reinitialized by referencing -** the pWC->a[] array. -*/ -static int whereClauseInsert(WhereClause *pWC, Expr *p, int flags){ - WhereTerm *pTerm; - int idx; - if( pWC->nTerm>=pWC->nSlot ){ - WhereTerm *pOld = pWC->a; - pWC->a = sqliteMalloc( sizeof(pWC->a[0])*pWC->nSlot*2 ); - if( pWC->a==0 ) return 0; - memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm); - if( pOld!=pWC->aStatic ){ - sqliteFree(pOld); - } - pWC->nSlot *= 2; - } - pTerm = &pWC->a[idx = pWC->nTerm]; - pWC->nTerm++; - pTerm->pExpr = p; - pTerm->flags = flags; - pTerm->pWC = pWC; - pTerm->iParent = -1; - return idx; -} - -/* -** This routine identifies subexpressions in the WHERE clause where -** each subexpression is separated by the AND operator or some other -** operator specified in the op parameter. The WhereClause structure -** is filled with pointers to subexpressions. For example: -** -** WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22) -** \________/ \_______________/ \________________/ -** slot[0] slot[1] slot[2] -** -** The original WHERE clause in pExpr is unaltered. All this routine -** does is make slot[] entries point to substructure within pExpr. -** -** In the previous sentence and in the diagram, "slot[]" refers to -** the WhereClause.a[] array. This array grows as needed to contain -** all terms of the WHERE clause. -*/ -static void whereSplit(WhereClause *pWC, Expr *pExpr, int op){ - if( pExpr==0 ) return; - if( pExpr->op!=op ){ - whereClauseInsert(pWC, pExpr, 0); - }else{ - whereSplit(pWC, pExpr->pLeft, op); - whereSplit(pWC, pExpr->pRight, op); - } -} - -/* -** Initialize an expression mask set -*/ -#define initMaskSet(P) memset(P, 0, sizeof(*P)) - -/* -** Return the bitmask for the given cursor number. Return 0 if -** iCursor is not in the set. -*/ -static Bitmask getMask(ExprMaskSet *pMaskSet, int iCursor){ - int i; - for(i=0; i<pMaskSet->n; i++){ - if( pMaskSet->ix[i]==iCursor ){ - return ((Bitmask)1)<<i; - } - } - return 0; -} - -/* -** Create a new mask for cursor iCursor. -** -** There is one cursor per table in the FROM clause. The number of -** tables in the FROM clause is limited by a test early in the -** sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[] -** array will never overflow. -*/ -static void createMask(ExprMaskSet *pMaskSet, int iCursor){ - assert( pMaskSet->n < ARRAYSIZE(pMaskSet->ix) ); - pMaskSet->ix[pMaskSet->n++] = iCursor; -} - -/* -** This routine walks (recursively) an expression tree and generates -** a bitmask indicating which tables are used in that expression -** tree. -** -** In order for this routine to work, the calling function must have -** previously invoked sqlite3ExprResolveNames() on the expression. See -** the header comment on that routine for additional information. -** The sqlite3ExprResolveNames() routines looks for column names and -** sets their opcodes to TK_COLUMN and their Expr.iTable fields to -** the VDBE cursor number of the table. This routine just has to -** translate the cursor numbers into bitmask values and OR all -** the bitmasks together. -*/ -static Bitmask exprListTableUsage(ExprMaskSet*, ExprList*); -static Bitmask exprSelectTableUsage(ExprMaskSet*, Select*); -static Bitmask exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){ - Bitmask mask = 0; - if( p==0 ) return 0; - if( p->op==TK_COLUMN ){ - mask = getMask(pMaskSet, p->iTable); - return mask; - } - mask = exprTableUsage(pMaskSet, p->pRight); - mask |= exprTableUsage(pMaskSet, p->pLeft); - mask |= exprListTableUsage(pMaskSet, p->pList); - mask |= exprSelectTableUsage(pMaskSet, p->pSelect); - return mask; -} -static Bitmask exprListTableUsage(ExprMaskSet *pMaskSet, ExprList *pList){ - int i; - Bitmask mask = 0; - if( pList ){ - for(i=0; i<pList->nExpr; i++){ - mask |= exprTableUsage(pMaskSet, pList->a[i].pExpr); - } - } - return mask; -} -static Bitmask exprSelectTableUsage(ExprMaskSet *pMaskSet, Select *pS){ - Bitmask mask; - if( pS==0 ){ - mask = 0; - }else{ - mask = exprListTableUsage(pMaskSet, pS->pEList); - mask |= exprListTableUsage(pMaskSet, pS->pGroupBy); - mask |= exprListTableUsage(pMaskSet, pS->pOrderBy); - mask |= exprTableUsage(pMaskSet, pS->pWhere); - mask |= exprTableUsage(pMaskSet, pS->pHaving); - } - return mask; -} - -/* -** Return TRUE if the given operator is one of the operators that is -** allowed for an indexable WHERE clause term. The allowed operators are -** "=", "<", ">", "<=", ">=", and "IN". -*/ -static int allowedOp(int op){ - assert( TK_GT>TK_EQ && TK_GT<TK_GE ); - assert( TK_LT>TK_EQ && TK_LT<TK_GE ); - assert( TK_LE>TK_EQ && TK_LE<TK_GE ); - assert( TK_GE==TK_EQ+4 ); - return op==TK_IN || (op>=TK_EQ && op<=TK_GE); -} - -/* -** Swap two objects of type T. -*/ -#define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} - -/* -** Commute a comparision operator. Expressions of the form "X op Y" -** are converted into "Y op X". -*/ -static void exprCommute(Expr *pExpr){ - assert( allowedOp(pExpr->op) && pExpr->op!=TK_IN ); - SWAP(CollSeq*,pExpr->pRight->pColl,pExpr->pLeft->pColl); - SWAP(Expr*,pExpr->pRight,pExpr->pLeft); - if( pExpr->op>=TK_GT ){ - assert( TK_LT==TK_GT+2 ); - assert( TK_GE==TK_LE+2 ); - assert( TK_GT>TK_EQ ); - assert( TK_GT<TK_LE ); - assert( pExpr->op>=TK_GT && pExpr->op<=TK_GE ); - pExpr->op = ((pExpr->op-TK_GT)^2)+TK_GT; - } -} - -/* -** Translate from TK_xx operator to WO_xx bitmask. -*/ -static int operatorMask(int op){ - int c; - assert( allowedOp(op) ); - if( op==TK_IN ){ - c = WO_IN; - }else{ - c = WO_EQ<<(op-TK_EQ); - } - assert( op!=TK_IN || c==WO_IN ); - assert( op!=TK_EQ || c==WO_EQ ); - assert( op!=TK_LT || c==WO_LT ); - assert( op!=TK_LE || c==WO_LE ); - assert( op!=TK_GT || c==WO_GT ); - assert( op!=TK_GE || c==WO_GE ); - return c; -} - -/* -** Search for a term in the WHERE clause that is of the form "X <op> <expr>" -** where X is a reference to the iColumn of table iCur and <op> is one of -** the WO_xx operator codes specified by the op parameter. -** Return a pointer to the term. Return 0 if not found. -*/ -static WhereTerm *findTerm( - WhereClause *pWC, /* The WHERE clause to be searched */ - int iCur, /* Cursor number of LHS */ - int iColumn, /* Column number of LHS */ - Bitmask notReady, /* RHS must not overlap with this mask */ - u16 op, /* Mask of WO_xx values describing operator */ - Index *pIdx /* Must be compatible with this index, if not NULL */ -){ - WhereTerm *pTerm; - int k; - for(pTerm=pWC->a, k=pWC->nTerm; k; k--, pTerm++){ - if( pTerm->leftCursor==iCur - && (pTerm->prereqRight & notReady)==0 - && pTerm->leftColumn==iColumn - && (pTerm->operator & op)!=0 - ){ - if( iCur>=0 && pIdx ){ - Expr *pX = pTerm->pExpr; - CollSeq *pColl; - char idxaff; - int k; - Parse *pParse = pWC->pParse; - - idxaff = pIdx->pTable->aCol[iColumn].affinity; - if( !sqlite3IndexAffinityOk(pX, idxaff) ) continue; - pColl = sqlite3ExprCollSeq(pParse, pX->pLeft); - if( !pColl ){ - if( pX->pRight ){ - pColl = sqlite3ExprCollSeq(pParse, pX->pRight); - } - if( !pColl ){ - pColl = pParse->db->pDfltColl; - } - } - for(k=0; k<pIdx->nColumn && pIdx->aiColumn[k]!=iColumn; k++){} - assert( k<pIdx->nColumn ); - if( pColl!=pIdx->keyInfo.aColl[k] ) continue; - } - return pTerm; - } - } - return 0; -} - -/* Forward reference */ -static void exprAnalyze(SrcList*, ExprMaskSet*, WhereClause*, int); - -/* -** Call exprAnalyze on all terms in a WHERE clause. -** -** -*/ -static void exprAnalyzeAll( - SrcList *pTabList, /* the FROM clause */ - ExprMaskSet *pMaskSet, /* table masks */ - WhereClause *pWC /* the WHERE clause to be analyzed */ -){ - int i; - for(i=pWC->nTerm-1; i>=0; i--){ - exprAnalyze(pTabList, pMaskSet, pWC, i); - } -} - -#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION -/* -** Check to see if the given expression is a LIKE or GLOB operator that -** can be optimized using inequality constraints. Return TRUE if it is -** so and false if not. -** -** In order for the operator to be optimizible, the RHS must be a string -** literal that does not begin with a wildcard. -*/ -static int isLikeOrGlob( - sqlite3 *db, /* The database */ - Expr *pExpr, /* Test this expression */ - int *pnPattern, /* Number of non-wildcard prefix characters */ - int *pisComplete /* True if the only wildcard is % in the last character */ -){ - const char *z; - Expr *pRight, *pLeft; - ExprList *pList; - int c, cnt; - int noCase; - char wc[3]; - CollSeq *pColl; - - if( !sqlite3IsLikeFunction(db, pExpr, &noCase, wc) ){ - return 0; - } - pList = pExpr->pList; - pRight = pList->a[0].pExpr; - if( pRight->op!=TK_STRING ){ - return 0; - } - pLeft = pList->a[1].pExpr; - if( pLeft->op!=TK_COLUMN ){ - return 0; - } - pColl = pLeft->pColl; - if( pColl==0 ){ - pColl = db->pDfltColl; - } - if( (pColl->type!=SQLITE_COLL_BINARY || noCase) && - (pColl->type!=SQLITE_COLL_NOCASE || !noCase) ){ - return 0; - } - sqlite3DequoteExpr(pRight); - z = pRight->token.z; - for(cnt=0; (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2]; cnt++){} - if( cnt==0 || 255==(u8)z[cnt] ){ - return 0; - } - *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0; - *pnPattern = cnt; - return 1; -} -#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */ - -/* -** The input to this routine is an WhereTerm structure with only the -** "pExpr" field filled in. The job of this routine is to analyze the -** subexpression and populate all the other fields of the WhereTerm -** structure. -** -** If the expression is of the form "<expr> <op> X" it gets commuted -** to the standard form of "X <op> <expr>". If the expression is of -** the form "X <op> Y" where both X and Y are columns, then the original -** expression is unchanged and a new virtual expression of the form -** "Y <op> X" is added to the WHERE clause and analyzed separately. -*/ -static void exprAnalyze( - SrcList *pSrc, /* the FROM clause */ - ExprMaskSet *pMaskSet, /* table masks */ - WhereClause *pWC, /* the WHERE clause */ - int idxTerm /* Index of the term to be analyzed */ -){ - WhereTerm *pTerm = &pWC->a[idxTerm]; - Expr *pExpr = pTerm->pExpr; - Bitmask prereqLeft; - Bitmask prereqAll; - int nPattern; - int isComplete; - - if( sqlite3_malloc_failed ) return; - prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft); - if( pExpr->op==TK_IN ){ - assert( pExpr->pRight==0 ); - pTerm->prereqRight = exprListTableUsage(pMaskSet, pExpr->pList) - | exprSelectTableUsage(pMaskSet, pExpr->pSelect); - }else{ - pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr->pRight); - } - prereqAll = exprTableUsage(pMaskSet, pExpr); - if( ExprHasProperty(pExpr, EP_FromJoin) ){ - prereqAll |= getMask(pMaskSet, pExpr->iRightJoinTable); - } - pTerm->prereqAll = prereqAll; - pTerm->leftCursor = -1; - pTerm->iParent = -1; - pTerm->operator = 0; - if( allowedOp(pExpr->op) && (pTerm->prereqRight & prereqLeft)==0 ){ - Expr *pLeft = pExpr->pLeft; - Expr *pRight = pExpr->pRight; - if( pLeft->op==TK_COLUMN ){ - pTerm->leftCursor = pLeft->iTable; - pTerm->leftColumn = pLeft->iColumn; - pTerm->operator = operatorMask(pExpr->op); - } - if( pRight && pRight->op==TK_COLUMN ){ - WhereTerm *pNew; - Expr *pDup; - if( pTerm->leftCursor>=0 ){ - int idxNew; - pDup = sqlite3ExprDup(pExpr); - idxNew = whereClauseInsert(pWC, pDup, TERM_VIRTUAL|TERM_DYNAMIC); - if( idxNew==0 ) return; - pNew = &pWC->a[idxNew]; - pNew->iParent = idxTerm; - pTerm = &pWC->a[idxTerm]; - pTerm->nChild = 1; - pTerm->flags |= TERM_COPIED; - }else{ - pDup = pExpr; - pNew = pTerm; - } - exprCommute(pDup); - pLeft = pDup->pLeft; - pNew->leftCursor = pLeft->iTable; - pNew->leftColumn = pLeft->iColumn; - pNew->prereqRight = prereqLeft; - pNew->prereqAll = prereqAll; - pNew->operator = operatorMask(pDup->op); - } - } - -#ifndef SQLITE_OMIT_BETWEEN_OPTIMIZATION - /* If a term is the BETWEEN operator, create two new virtual terms - ** that define the range that the BETWEEN implements. - */ - else if( pExpr->op==TK_BETWEEN ){ - ExprList *pList = pExpr->pList; - int i; - static const u8 ops[] = {TK_GE, TK_LE}; - assert( pList!=0 ); - assert( pList->nExpr==2 ); - for(i=0; i<2; i++){ - Expr *pNewExpr; - int idxNew; - pNewExpr = sqlite3Expr(ops[i], sqlite3ExprDup(pExpr->pLeft), - sqlite3ExprDup(pList->a[i].pExpr), 0); - idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); - exprAnalyze(pSrc, pMaskSet, pWC, idxNew); - pTerm = &pWC->a[idxTerm]; - pWC->a[idxNew].iParent = idxTerm; - } - pTerm->nChild = 2; - } -#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */ - -#ifndef SQLITE_OMIT_OR_OPTIMIZATION - /* Attempt to convert OR-connected terms into an IN operator so that - ** they can make use of indices. Example: - ** - ** x = expr1 OR expr2 = x OR x = expr3 - ** - ** is converted into - ** - ** x IN (expr1,expr2,expr3) - */ - else if( pExpr->op==TK_OR ){ - int ok; - int i, j; - int iColumn, iCursor; - WhereClause sOr; - WhereTerm *pOrTerm; - - assert( (pTerm->flags & TERM_DYNAMIC)==0 ); - whereClauseInit(&sOr, pWC->pParse); - whereSplit(&sOr, pExpr, TK_OR); - exprAnalyzeAll(pSrc, pMaskSet, &sOr); - assert( sOr.nTerm>0 ); - j = 0; - do{ - iColumn = sOr.a[j].leftColumn; - iCursor = sOr.a[j].leftCursor; - ok = iCursor>=0; - for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0 && ok; i--, pOrTerm++){ - if( pOrTerm->operator!=WO_EQ ){ - goto or_not_possible; - } - if( pOrTerm->leftCursor==iCursor && pOrTerm->leftColumn==iColumn ){ - pOrTerm->flags |= TERM_OR_OK; - }else if( (pOrTerm->flags & TERM_COPIED)!=0 || - ((pOrTerm->flags & TERM_VIRTUAL)!=0 && - (sOr.a[pOrTerm->iParent].flags & TERM_OR_OK)!=0) ){ - pOrTerm->flags &= ~TERM_OR_OK; - }else{ - ok = 0; - } - } - }while( !ok && (sOr.a[j++].flags & TERM_COPIED)!=0 && j<sOr.nTerm ); - if( ok ){ - ExprList *pList = 0; - Expr *pNew, *pDup; - for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0 && ok; i--, pOrTerm++){ - if( (pOrTerm->flags & TERM_OR_OK)==0 ) continue; - pDup = sqlite3ExprDup(pOrTerm->pExpr->pRight); - pList = sqlite3ExprListAppend(pList, pDup, 0); - } - pDup = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( pDup ){ - pDup->iTable = iCursor; - pDup->iColumn = iColumn; - } - pNew = sqlite3Expr(TK_IN, pDup, 0, 0); - if( pNew ){ - pNew->pList = pList; - }else{ - sqlite3ExprListDelete(pList); - } - pTerm->pExpr = pNew; - pTerm->flags |= TERM_DYNAMIC; - exprAnalyze(pSrc, pMaskSet, pWC, idxTerm); - pTerm = &pWC->a[idxTerm]; - } -or_not_possible: - whereClauseClear(&sOr); - } -#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ - -#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION - /* Add constraints to reduce the search space on a LIKE or GLOB - ** operator. - */ - if( isLikeOrGlob(pWC->pParse->db, pExpr, &nPattern, &isComplete) ){ - Expr *pLeft, *pRight; - Expr *pStr1, *pStr2; - Expr *pNewExpr1, *pNewExpr2; - int idxNew1, idxNew2; - - pLeft = pExpr->pList->a[1].pExpr; - pRight = pExpr->pList->a[0].pExpr; - pStr1 = sqlite3Expr(TK_STRING, 0, 0, 0); - if( pStr1 ){ - sqlite3TokenCopy(&pStr1->token, &pRight->token); - pStr1->token.n = nPattern; - } - pStr2 = sqlite3ExprDup(pStr1); - if( pStr2 ){ - assert( pStr2->token.dyn ); - ++*(u8*)&pStr2->token.z[nPattern-1]; - } - pNewExpr1 = sqlite3Expr(TK_GE, sqlite3ExprDup(pLeft), pStr1, 0); - idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC); - exprAnalyze(pSrc, pMaskSet, pWC, idxNew1); - pNewExpr2 = sqlite3Expr(TK_LT, sqlite3ExprDup(pLeft), pStr2, 0); - idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC); - exprAnalyze(pSrc, pMaskSet, pWC, idxNew2); - pTerm = &pWC->a[idxTerm]; - if( isComplete ){ - pWC->a[idxNew1].iParent = idxTerm; - pWC->a[idxNew2].iParent = idxTerm; - pTerm->nChild = 2; - } - } -#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */ -} - - -/* -** This routine decides if pIdx can be used to satisfy the ORDER BY -** clause. If it can, it returns 1. If pIdx cannot satisfy the -** ORDER BY clause, this routine returns 0. -** -** pOrderBy is an ORDER BY clause from a SELECT statement. pTab is the -** left-most table in the FROM clause of that same SELECT statement and -** the table has a cursor number of "base". pIdx is an index on pTab. -** -** nEqCol is the number of columns of pIdx that are used as equality -** constraints. Any of these columns may be missing from the ORDER BY -** clause and the match can still be a success. -** -** All terms of the ORDER BY that match against the index must be either -** ASC or DESC. (Terms of the ORDER BY clause past the end of a UNIQUE -** index do not need to satisfy this constraint.) The *pbRev value is -** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if -** the ORDER BY clause is all ASC. -*/ -static int isSortingIndex( - Parse *pParse, /* Parsing context */ - Index *pIdx, /* The index we are testing */ - Table *pTab, /* The table to be sorted */ - int base, /* Cursor number for pTab */ - ExprList *pOrderBy, /* The ORDER BY clause */ - int nEqCol, /* Number of index columns with == constraints */ - int *pbRev /* Set to 1 if ORDER BY is DESC */ -){ - int i, j; /* Loop counters */ - int sortOrder = SQLITE_SO_ASC; /* Which direction we are sorting */ - int nTerm; /* Number of ORDER BY terms */ - struct ExprList_item *pTerm; /* A term of the ORDER BY clause */ - sqlite3 *db = pParse->db; - - assert( pOrderBy!=0 ); - nTerm = pOrderBy->nExpr; - assert( nTerm>0 ); - - /* Match terms of the ORDER BY clause against columns of - ** the index. - */ - for(i=j=0, pTerm=pOrderBy->a; j<nTerm && i<pIdx->nColumn; i++){ - Expr *pExpr; /* The expression of the ORDER BY pTerm */ - CollSeq *pColl; /* The collating sequence of pExpr */ - - pExpr = pTerm->pExpr; - if( pExpr->op!=TK_COLUMN || pExpr->iTable!=base ){ - /* Can not use an index sort on anything that is not a column in the - ** left-most table of the FROM clause */ - return 0; - } - pColl = sqlite3ExprCollSeq(pParse, pExpr); - if( !pColl ) pColl = db->pDfltColl; - if( pExpr->iColumn!=pIdx->aiColumn[i] || pColl!=pIdx->keyInfo.aColl[i] ){ - /* Term j of the ORDER BY clause does not match column i of the index */ - if( i<nEqCol ){ - /* If an index column that is constrained by == fails to match an - ** ORDER BY term, that is OK. Just ignore that column of the index - */ - continue; - }else{ - /* If an index column fails to match and is not constrained by == - ** then the index cannot satisfy the ORDER BY constraint. - */ - return 0; - } - } - if( i>nEqCol ){ - if( pTerm->sortOrder!=sortOrder ){ - /* Indices can only be used if all ORDER BY terms past the - ** equality constraints are all either DESC or ASC. */ - return 0; - } - }else{ - sortOrder = pTerm->sortOrder; - } - j++; - pTerm++; - } - - /* The index can be used for sorting if all terms of the ORDER BY clause - ** are covered. - */ - if( j>=nTerm ){ - *pbRev = sortOrder==SQLITE_SO_DESC; - return 1; - } - return 0; -} - -/* -** Check table to see if the ORDER BY clause in pOrderBy can be satisfied -** by sorting in order of ROWID. Return true if so and set *pbRev to be -** true for reverse ROWID and false for forward ROWID order. -*/ -static int sortableByRowid( - int base, /* Cursor number for table to be sorted */ - ExprList *pOrderBy, /* The ORDER BY clause */ - int *pbRev /* Set to 1 if ORDER BY is DESC */ -){ - Expr *p; - - assert( pOrderBy!=0 ); - assert( pOrderBy->nExpr>0 ); - p = pOrderBy->a[0].pExpr; - if( pOrderBy->nExpr==1 && p->op==TK_COLUMN && p->iTable==base - && p->iColumn==-1 ){ - *pbRev = pOrderBy->a[0].sortOrder; - return 1; - } - return 0; -} - -/* -** Prepare a crude estimate of the logarithm of the input value. -** The results need not be exact. This is only used for estimating -** the total cost of performing operatings with O(logN) or O(NlogN) -** complexity. Because N is just a guess, it is no great tragedy if -** logN is a little off. -*/ -static double estLog(double N){ - double logN = 1.0; - double x = 10.0; - while( N>x ){ - logN += 1.0; - x *= 10; - } - return logN; -} - -/* -** Find the best index for accessing a particular table. Return a pointer -** to the index, flags that describe how the index should be used, the -** number of equality constraints, and the "cost" for this index. -** -** The lowest cost index wins. The cost is an estimate of the amount of -** CPU and disk I/O need to process the request using the selected index. -** Factors that influence cost include: -** -** * The estimated number of rows that will be retrieved. (The -** fewer the better.) -** -** * Whether or not sorting must occur. -** -** * Whether or not there must be separate lookups in the -** index and in the main table. -** -*/ -static double bestIndex( - Parse *pParse, /* The parsing context */ - WhereClause *pWC, /* The WHERE clause */ - struct SrcList_item *pSrc, /* The FROM clause term to search */ - Bitmask notReady, /* Mask of cursors that are not available */ - ExprList *pOrderBy, /* The order by clause */ - Index **ppIndex, /* Make *ppIndex point to the best index */ - int *pFlags, /* Put flags describing this choice in *pFlags */ - int *pnEq /* Put the number of == or IN constraints here */ -){ - WhereTerm *pTerm; - Index *bestIdx = 0; /* Index that gives the lowest cost */ - double lowestCost = 1.0e99; /* The cost of using bestIdx */ - int bestFlags = 0; /* Flags associated with bestIdx */ - int bestNEq = 0; /* Best value for nEq */ - int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */ - Index *pProbe; /* An index we are evaluating */ - int rev; /* True to scan in reverse order */ - int flags; /* Flags associated with pProbe */ - int nEq; /* Number of == or IN constraints */ - double cost; /* Cost of using pProbe */ - - TRACE(("bestIndex: tbl=%s notReady=%x\n", pSrc->pTab->zName, notReady)); - - /* Check for a rowid=EXPR or rowid IN (...) constraints - */ - pTerm = findTerm(pWC, iCur, -1, notReady, WO_EQ|WO_IN, 0); - if( pTerm ){ - Expr *pExpr; - *ppIndex = 0; - bestFlags = WHERE_ROWID_EQ; - if( pTerm->operator & WO_EQ ){ - /* Rowid== is always the best pick. Look no further. Because only - ** a single row is generated, output is always in sorted order */ - *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE; - *pnEq = 1; - TRACE(("... best is rowid\n")); - return 0.0; - }else if( (pExpr = pTerm->pExpr)->pList!=0 ){ - /* Rowid IN (LIST): cost is NlogN where N is the number of list - ** elements. */ - lowestCost = pExpr->pList->nExpr; - lowestCost *= estLog(lowestCost); - }else{ - /* Rowid IN (SELECT): cost is NlogN where N is the number of rows - ** in the result of the inner select. We have no way to estimate - ** that value so make a wild guess. */ - lowestCost = 200.0; - } - TRACE(("... rowid IN cost: %.9g\n", lowestCost)); - } - - /* Estimate the cost of a table scan. If we do not know how many - ** entries are in the table, use 1 million as a guess. - */ - pProbe = pSrc->pTab->pIndex; - cost = pProbe ? pProbe->aiRowEst[0] : 1000000.0; - TRACE(("... table scan base cost: %.9g\n", cost)); - flags = WHERE_ROWID_RANGE; - - /* Check for constraints on a range of rowids in a table scan. - */ - pTerm = findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE|WO_GT|WO_GE, 0); - if( pTerm ){ - if( findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE, 0) ){ - flags |= WHERE_TOP_LIMIT; - cost *= 0.333; /* Guess that rowid<EXPR eliminates two-thirds or rows */ - } - if( findTerm(pWC, iCur, -1, notReady, WO_GT|WO_GE, 0) ){ - flags |= WHERE_BTM_LIMIT; - cost *= 0.333; /* Guess that rowid>EXPR eliminates two-thirds of rows */ - } - TRACE(("... rowid range reduces cost to %.9g\n", cost)); - }else{ - flags = 0; - } - - /* If the table scan does not satisfy the ORDER BY clause, increase - ** the cost by NlogN to cover the expense of sorting. */ - if( pOrderBy ){ - if( sortableByRowid(iCur, pOrderBy, &rev) ){ - flags |= WHERE_ORDERBY|WHERE_ROWID_RANGE; - if( rev ){ - flags |= WHERE_REVERSE; - } - }else{ - cost += cost*estLog(cost); - TRACE(("... sorting increases cost to %.9g\n", cost)); - } - } - if( cost<lowestCost ){ - lowestCost = cost; - bestFlags = flags; - } - - /* Look at each index. - */ - for(; pProbe; pProbe=pProbe->pNext){ - int i; /* Loop counter */ - double inMultiplier = 1.0; - - TRACE(("... index %s:\n", pProbe->zName)); - - /* Count the number of columns in the index that are satisfied - ** by x=EXPR constraints or x IN (...) constraints. - */ - flags = 0; - for(i=0; i<pProbe->nColumn; i++){ - int j = pProbe->aiColumn[i]; - pTerm = findTerm(pWC, iCur, j, notReady, WO_EQ|WO_IN, pProbe); - if( pTerm==0 ) break; - flags |= WHERE_COLUMN_EQ; - if( pTerm->operator & WO_IN ){ - Expr *pExpr = pTerm->pExpr; - flags |= WHERE_COLUMN_IN; - if( pExpr->pSelect!=0 ){ - inMultiplier *= 100.0; - }else if( pExpr->pList!=0 ){ - inMultiplier *= pExpr->pList->nExpr + 1.0; - } - } - } - cost = pProbe->aiRowEst[i] * inMultiplier * estLog(inMultiplier); - nEq = i; - if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0 - && nEq==pProbe->nColumn ){ - flags |= WHERE_UNIQUE; - } - TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost)); - - /* Look for range constraints - */ - if( nEq<pProbe->nColumn ){ - int j = pProbe->aiColumn[nEq]; - pTerm = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pProbe); - if( pTerm ){ - flags |= WHERE_COLUMN_RANGE; - if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){ - flags |= WHERE_TOP_LIMIT; - cost *= 0.333; - } - if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){ - flags |= WHERE_BTM_LIMIT; - cost *= 0.333; - } - TRACE(("...... range reduces cost to %.9g\n", cost)); - } - } - - /* Add the additional cost of sorting if that is a factor. - */ - if( pOrderBy ){ - if( (flags & WHERE_COLUMN_IN)==0 && - isSortingIndex(pParse,pProbe,pSrc->pTab,iCur,pOrderBy,nEq,&rev) ){ - if( flags==0 ){ - flags = WHERE_COLUMN_RANGE; - } - flags |= WHERE_ORDERBY; - if( rev ){ - flags |= WHERE_REVERSE; - } - }else{ - cost += cost*estLog(cost); - TRACE(("...... orderby increases cost to %.9g\n", cost)); - } - } - - /* Check to see if we can get away with using just the index without - ** ever reading the table. If that is the case, then halve the - ** cost of this index. - */ - if( flags && pSrc->colUsed < (((Bitmask)1)<<(BMS-1)) ){ - Bitmask m = pSrc->colUsed; - int j; - for(j=0; j<pProbe->nColumn; j++){ - int x = pProbe->aiColumn[j]; - if( x<BMS-1 ){ - m &= ~(((Bitmask)1)<<x); - } - } - if( m==0 ){ - flags |= WHERE_IDX_ONLY; - cost *= 0.5; - TRACE(("...... idx-only reduces cost to %.9g\n", cost)); - } - } - - /* If this index has achieved the lowest cost so far, then use it. - */ - if( cost < lowestCost ){ - bestIdx = pProbe; - lowestCost = cost; - assert( flags!=0 ); - bestFlags = flags; - bestNEq = nEq; - } - } - - /* Report the best result - */ - *ppIndex = bestIdx; - TRACE(("best index is %s, cost=%.9g, flags=%x, nEq=%d\n", - bestIdx ? bestIdx->zName : "(none)", lowestCost, bestFlags, bestNEq)); - *pFlags = bestFlags; - *pnEq = bestNEq; - return lowestCost; -} - - -/* -** Disable a term in the WHERE clause. Except, do not disable the term -** if it controls a LEFT OUTER JOIN and it did not originate in the ON -** or USING clause of that join. -** -** Consider the term t2.z='ok' in the following queries: -** -** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok' -** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok' -** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok' -** -** The t2.z='ok' is disabled in the in (2) because it originates -** in the ON clause. The term is disabled in (3) because it is not part -** of a LEFT OUTER JOIN. In (1), the term is not disabled. -** -** Disabling a term causes that term to not be tested in the inner loop -** of the join. Disabling is an optimization. When terms are satisfied -** by indices, we disable them to prevent redundant tests in the inner -** loop. We would get the correct results if nothing were ever disabled, -** but joins might run a little slower. The trick is to disable as much -** as we can without disabling too much. If we disabled in (1), we'd get -** the wrong answer. See ticket #813. -*/ -static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ - if( pTerm - && (pTerm->flags & TERM_CODED)==0 - && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) - ){ - pTerm->flags |= TERM_CODED; - if( pTerm->iParent>=0 ){ - WhereTerm *pOther = &pTerm->pWC->a[pTerm->iParent]; - if( (--pOther->nChild)==0 ){ - disableTerm(pLevel, pOther); - } - } - } -} - -/* -** Generate code that builds a probe for an index. Details: -** -** * Check the top nColumn entries on the stack. If any -** of those entries are NULL, jump immediately to brk, -** which is the loop exit, since no index entry will match -** if any part of the key is NULL. -** -** * Construct a probe entry from the top nColumn entries in -** the stack with affinities appropriate for index pIdx. -*/ -static void buildIndexProbe(Vdbe *v, int nColumn, int brk, Index *pIdx){ - sqlite3VdbeAddOp(v, OP_NotNull, -nColumn, sqlite3VdbeCurrentAddr(v)+3); - sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0); - sqlite3VdbeAddOp(v, OP_Goto, 0, brk); - sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0); - sqlite3IndexAffinityStr(v, pIdx); -} - - -/* -** Generate code for a single equality term of the WHERE clause. An equality -** term can be either X=expr or X IN (...). pTerm is the term to be -** coded. -** -** The current value for the constraint is left on the top of the stack. -** -** For a constraint of the form X=expr, the expression is evaluated and its -** result is left on the stack. For constraints of the form X IN (...) -** this routine sets up a loop that will iterate over all values of X. -*/ -static void codeEqualityTerm( - Parse *pParse, /* The parsing context */ - WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ - int brk, /* Jump here to abandon the loop */ - WhereLevel *pLevel /* When level of the FROM clause we are working on */ -){ - Expr *pX = pTerm->pExpr; - if( pX->op!=TK_IN ){ - assert( pX->op==TK_EQ ); - sqlite3ExprCode(pParse, pX->pRight); -#ifndef SQLITE_OMIT_SUBQUERY - }else{ - int iTab; - int *aIn; - Vdbe *v = pParse->pVdbe; - - sqlite3CodeSubselect(pParse, pX); - iTab = pX->iTable; - sqlite3VdbeAddOp(v, OP_Rewind, iTab, brk); - VdbeComment((v, "# %.*s", pX->span.n, pX->span.z)); - pLevel->nIn++; - sqlite3ReallocOrFree((void**)&pLevel->aInLoop, - sizeof(pLevel->aInLoop[0])*3*pLevel->nIn); - aIn = pLevel->aInLoop; - if( aIn ){ - aIn += pLevel->nIn*3 - 3; - aIn[0] = OP_Next; - aIn[1] = iTab; - aIn[2] = sqlite3VdbeAddOp(v, OP_Column, iTab, 0); - }else{ - pLevel->nIn = 0; - } -#endif - } - disableTerm(pLevel, pTerm); -} - -/* -** Generate code that will evaluate all == and IN constraints for an -** index. The values for all constraints are left on the stack. -** -** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). -** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 -** The index has as many as three equality constraints, but in this -** example, the third "c" value is an inequality. So only two -** constraints are coded. This routine will generate code to evaluate -** a==5 and b IN (1,2,3). The current values for a and b will be left -** on the stack - a is the deepest and b the shallowest. -** -** In the example above nEq==2. But this subroutine works for any value -** of nEq including 0. If nEq==0, this routine is nearly a no-op. -** The only thing it does is allocate the pLevel->iMem memory cell. -** -** This routine always allocates at least one memory cell and puts -** the address of that memory cell in pLevel->iMem. The code that -** calls this routine will use pLevel->iMem to store the termination -** key value of the loop. If one or more IN operators appear, then -** this routine allocates an additional nEq memory cells for internal -** use. -*/ -static void codeAllEqualityTerms( - Parse *pParse, /* Parsing context */ - WhereLevel *pLevel, /* Which nested loop of the FROM we are coding */ - WhereClause *pWC, /* The WHERE clause */ - Bitmask notReady, /* Which parts of FROM have not yet been coded */ - int brk /* Jump here to end the loop */ -){ - int nEq = pLevel->nEq; /* The number of == or IN constraints to code */ - int termsInMem = 0; /* If true, store value in mem[] cells */ - Vdbe *v = pParse->pVdbe; /* The virtual machine under construction */ - Index *pIdx = pLevel->pIdx; /* The index being used for this loop */ - int iCur = pLevel->iTabCur; /* The cursor of the table */ - WhereTerm *pTerm; /* A single constraint term */ - int j; /* Loop counter */ - - /* Figure out how many memory cells we will need then allocate them. - ** We always need at least one used to store the loop terminator - ** value. If there are IN operators we'll need one for each == or - ** IN constraint. - */ - pLevel->iMem = pParse->nMem++; - if( pLevel->flags & WHERE_COLUMN_IN ){ - pParse->nMem += pLevel->nEq; - termsInMem = 1; - } - - /* Evaluate the equality constraints - */ - for(j=0; j<pIdx->nColumn; j++){ - int k = pIdx->aiColumn[j]; - pTerm = findTerm(pWC, iCur, k, notReady, WO_EQ|WO_IN, pIdx); - if( pTerm==0 ) break; - assert( (pTerm->flags & TERM_CODED)==0 ); - codeEqualityTerm(pParse, pTerm, brk, pLevel); - if( termsInMem ){ - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem+j+1, 1); - } - } - assert( j==nEq ); - - /* Make sure all the constraint values are on the top of the stack - */ - if( termsInMem ){ - for(j=0; j<nEq; j++){ - sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem+j+1, 0); - } - } -} - -#if defined(SQLITE_TEST) -/* -** The following variable holds a text description of query plan generated -** by the most recent call to sqlite3WhereBegin(). Each call to WhereBegin -** overwrites the previous. This information is used for testing and -** analysis only. -*/ -char sqlite3_query_plan[BMS*2*40]; /* Text of the join */ -static int nQPlan = 0; /* Next free slow in _query_plan[] */ - -#endif /* SQLITE_TEST */ - - - -/* -** Generate the beginning of the loop used for WHERE clause processing. -** The return value is a pointer to an opaque structure that contains -** information needed to terminate the loop. Later, the calling routine -** should invoke sqlite3WhereEnd() with the return value of this function -** in order to complete the WHERE clause processing. -** -** If an error occurs, this routine returns NULL. -** -** The basic idea is to do a nested loop, one loop for each table in -** the FROM clause of a select. (INSERT and UPDATE statements are the -** same as a SELECT with only a single table in the FROM clause.) For -** example, if the SQL is this: -** -** SELECT * FROM t1, t2, t3 WHERE ...; -** -** Then the code generated is conceptually like the following: -** -** foreach row1 in t1 do \ Code generated -** foreach row2 in t2 do |-- by sqlite3WhereBegin() -** foreach row3 in t3 do / -** ... -** end \ Code generated -** end |-- by sqlite3WhereEnd() -** end / -** -** Note that the loops might not be nested in the order in which they -** appear in the FROM clause if a different order is better able to make -** use of indices. Note also that when the IN operator appears in -** the WHERE clause, it might result in additional nested loops for -** scanning through all values on the right-hand side of the IN. -** -** There are Btree cursors associated with each table. t1 uses cursor -** number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor. -** And so forth. This routine generates code to open those VDBE cursors -** and sqlite3WhereEnd() generates the code to close them. -** -** The code that sqlite3WhereBegin() generates leaves the cursors named -** in pTabList pointing at their appropriate entries. The [...] code -** can use OP_Column and OP_Rowid opcodes on these cursors to extract -** data from the various tables of the loop. -** -** If the WHERE clause is empty, the foreach loops must each scan their -** entire tables. Thus a three-way join is an O(N^3) operation. But if -** the tables have indices and there are terms in the WHERE clause that -** refer to those indices, a complete table scan can be avoided and the -** code will run much faster. Most of the work of this routine is checking -** to see if there are indices that can be used to speed up the loop. -** -** Terms of the WHERE clause are also used to limit which rows actually -** make it to the "..." in the middle of the loop. After each "foreach", -** terms of the WHERE clause that use only terms in that loop and outer -** loops are evaluated and if false a jump is made around all subsequent -** inner loops (or around the "..." if the test occurs within the inner- -** most loop) -** -** OUTER JOINS -** -** An outer join of tables t1 and t2 is conceptally coded as follows: -** -** foreach row1 in t1 do -** flag = 0 -** foreach row2 in t2 do -** start: -** ... -** flag = 1 -** end -** if flag==0 then -** move the row2 cursor to a null row -** goto start -** fi -** end -** -** ORDER BY CLAUSE PROCESSING -** -** *ppOrderBy is a pointer to the ORDER BY clause of a SELECT statement, -** if there is one. If there is no ORDER BY clause or if this routine -** is called from an UPDATE or DELETE statement, then ppOrderBy is NULL. -** -** If an index can be used so that the natural output order of the table -** scan is correct for the ORDER BY clause, then that index is used and -** *ppOrderBy is set to NULL. This is an optimization that prevents an -** unnecessary sort of the result set if an index appropriate for the -** ORDER BY clause already exists. -** -** If the where clause loops cannot be arranged to provide the correct -** output order, then the *ppOrderBy is unchanged. -*/ -WhereInfo *sqlite3WhereBegin( - Parse *pParse, /* The parser context */ - SrcList *pTabList, /* A list of all tables to be scanned */ - Expr *pWhere, /* The WHERE clause */ - ExprList **ppOrderBy /* An ORDER BY clause, or NULL */ -){ - int i; /* Loop counter */ - WhereInfo *pWInfo; /* Will become the return value of this function */ - Vdbe *v = pParse->pVdbe; /* The virtual database engine */ - int brk, cont = 0; /* Addresses used during code generation */ - Bitmask notReady; /* Cursors that are not yet positioned */ - WhereTerm *pTerm; /* A single term in the WHERE clause */ - ExprMaskSet maskSet; /* The expression mask set */ - WhereClause wc; /* The WHERE clause is divided into these terms */ - struct SrcList_item *pTabItem; /* A single entry from pTabList */ - WhereLevel *pLevel; /* A single level in the pWInfo list */ - int iFrom; /* First unused FROM clause element */ - int andFlags; /* AND-ed combination of all wc.a[].flags */ - - /* The number of tables in the FROM clause is limited by the number of - ** bits in a Bitmask - */ - if( pTabList->nSrc>BMS ){ - sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS); - return 0; - } - - /* Split the WHERE clause into separate subexpressions where each - ** subexpression is separated by an AND operator. - */ - initMaskSet(&maskSet); - whereClauseInit(&wc, pParse); - whereSplit(&wc, pWhere, TK_AND); - - /* Allocate and initialize the WhereInfo structure that will become the - ** return value. - */ - pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel)); - if( sqlite3_malloc_failed ){ - goto whereBeginNoMem; - } - pWInfo->pParse = pParse; - pWInfo->pTabList = pTabList; - pWInfo->iBreak = sqlite3VdbeMakeLabel(v); - - /* Special case: a WHERE clause that is constant. Evaluate the - ** expression and either jump over all of the code or fall thru. - */ - if( pWhere && (pTabList->nSrc==0 || sqlite3ExprIsConstant(pWhere)) ){ - sqlite3ExprIfFalse(pParse, pWhere, pWInfo->iBreak, 1); - pWhere = 0; - } - - /* Analyze all of the subexpressions. Note that exprAnalyze() might - ** add new virtual terms onto the end of the WHERE clause. We do not - ** want to analyze these virtual terms, so start analyzing at the end - ** and work forward so that the added virtual terms are never processed. - */ - for(i=0; i<pTabList->nSrc; i++){ - createMask(&maskSet, pTabList->a[i].iCursor); - } - exprAnalyzeAll(pTabList, &maskSet, &wc); - if( sqlite3_malloc_failed ){ - goto whereBeginNoMem; - } - - /* Chose the best index to use for each table in the FROM clause. - ** - ** This loop fills in the following fields: - ** - ** pWInfo->a[].pIdx The index to use for this level of the loop. - ** pWInfo->a[].flags WHERE_xxx flags associated with pIdx - ** pWInfo->a[].nEq The number of == and IN constraints - ** pWInfo->a[].iFrom When term of the FROM clause is being coded - ** pWInfo->a[].iTabCur The VDBE cursor for the database table - ** pWInfo->a[].iIdxCur The VDBE cursor for the index - ** - ** This loop also figures out the nesting order of tables in the FROM - ** clause. - */ - notReady = ~(Bitmask)0; - pTabItem = pTabList->a; - pLevel = pWInfo->a; - andFlags = ~0; - TRACE(("*** Optimizer Start ***\n")); - for(i=iFrom=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){ - Index *pIdx; /* Index for FROM table at pTabItem */ - int flags; /* Flags asssociated with pIdx */ - int nEq; /* Number of == or IN constraints */ - double cost; /* The cost for pIdx */ - int j; /* For looping over FROM tables */ - Index *pBest = 0; /* The best index seen so far */ - int bestFlags = 0; /* Flags associated with pBest */ - int bestNEq = 0; /* nEq associated with pBest */ - double lowestCost = 1.0e99; /* Cost of the pBest */ - int bestJ; /* The value of j */ - Bitmask m; /* Bitmask value for j or bestJ */ - - for(j=iFrom, pTabItem=&pTabList->a[j]; j<pTabList->nSrc; j++, pTabItem++){ - m = getMask(&maskSet, pTabItem->iCursor); - if( (m & notReady)==0 ){ - if( j==iFrom ) iFrom++; - continue; - } - cost = bestIndex(pParse, &wc, pTabItem, notReady, - (i==0 && ppOrderBy) ? *ppOrderBy : 0, - &pIdx, &flags, &nEq); - if( cost<lowestCost ){ - lowestCost = cost; - pBest = pIdx; - bestFlags = flags; - bestNEq = nEq; - bestJ = j; - } - if( (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0 - || (j>0 && (pTabItem[-1].jointype & (JT_LEFT|JT_CROSS))!=0) - ){ - break; - } - } - TRACE(("*** Optimizer choose table %d for loop %d\n", bestJ, - pLevel-pWInfo->a)); - if( (bestFlags & WHERE_ORDERBY)!=0 ){ - *ppOrderBy = 0; - } - andFlags &= bestFlags; - pLevel->flags = bestFlags; - pLevel->pIdx = pBest; - pLevel->nEq = bestNEq; - pLevel->aInLoop = 0; - pLevel->nIn = 0; - if( pBest ){ - pLevel->iIdxCur = pParse->nTab++; - }else{ - pLevel->iIdxCur = -1; - } - notReady &= ~getMask(&maskSet, pTabList->a[bestJ].iCursor); - pLevel->iFrom = bestJ; - } - TRACE(("*** Optimizer Finished ***\n")); - - /* If the total query only selects a single row, then the ORDER BY - ** clause is irrelevant. - */ - if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){ - *ppOrderBy = 0; - } - - /* Open all tables in the pTabList and any indices selected for - ** searching those tables. - */ - sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */ - pLevel = pWInfo->a; - for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){ - Table *pTab; - Index *pIx; - int iIdxCur = pLevel->iIdxCur; - -#ifndef SQLITE_OMIT_EXPLAIN - if( pParse->explain==2 ){ - char *zMsg; - struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom]; - zMsg = sqlite3MPrintf("TABLE %s", pItem->zName); - if( pItem->zAlias ){ - zMsg = sqlite3MPrintf("%z AS %s", zMsg, pItem->zAlias); - } - if( (pIx = pLevel->pIdx)!=0 ){ - zMsg = sqlite3MPrintf("%z WITH INDEX %s", zMsg, pIx->zName); - } - sqlite3VdbeOp3(v, OP_Explain, i, pLevel->iFrom, zMsg, P3_DYNAMIC); - } -#endif /* SQLITE_OMIT_EXPLAIN */ - pTabItem = &pTabList->a[pLevel->iFrom]; - pTab = pTabItem->pTab; - if( pTab->isTransient || pTab->pSelect ) continue; - if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){ - sqlite3OpenTableForReading(v, pTabItem->iCursor, pTab); - } - pLevel->iTabCur = pTabItem->iCursor; - if( (pIx = pLevel->pIdx)!=0 ){ - sqlite3VdbeAddOp(v, OP_Integer, pIx->iDb, 0); - VdbeComment((v, "# %s", pIx->zName)); - sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIx->tnum, - (char*)&pIx->keyInfo, P3_KEYINFO); - } - if( (pLevel->flags & WHERE_IDX_ONLY)!=0 ){ - sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, pIx->nColumn+1); - } - sqlite3CodeVerifySchema(pParse, pTab->iDb); - } - pWInfo->iTop = sqlite3VdbeCurrentAddr(v); - - /* Generate the code to do the search. Each iteration of the for - ** loop below generates code for a single nested loop of the VM - ** program. - */ - notReady = ~(Bitmask)0; - for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){ - int j; - int iCur = pTabItem->iCursor; /* The VDBE cursor for the table */ - Index *pIdx; /* The index we will be using */ - int iIdxCur; /* The VDBE cursor for the index */ - int omitTable; /* True if we use the index only */ - int bRev; /* True if we need to scan in reverse order */ - - pTabItem = &pTabList->a[pLevel->iFrom]; - iCur = pTabItem->iCursor; - pIdx = pLevel->pIdx; - iIdxCur = pLevel->iIdxCur; - bRev = (pLevel->flags & WHERE_REVERSE)!=0; - omitTable = (pLevel->flags & WHERE_IDX_ONLY)!=0; - - /* Create labels for the "break" and "continue" instructions - ** for the current loop. Jump to brk to break out of a loop. - ** Jump to cont to go immediately to the next iteration of the - ** loop. - */ - brk = pLevel->brk = sqlite3VdbeMakeLabel(v); - cont = pLevel->cont = sqlite3VdbeMakeLabel(v); - - /* If this is the right table of a LEFT OUTER JOIN, allocate and - ** initialize a memory cell that records if this table matches any - ** row of the left table of the join. - */ - if( pLevel->iFrom>0 && (pTabItem[-1].jointype & JT_LEFT)!=0 ){ - if( !pParse->nMem ) pParse->nMem++; - pLevel->iLeftJoin = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemInt, 0, pLevel->iLeftJoin); - VdbeComment((v, "# init LEFT JOIN no-match flag")); - } - - if( pLevel->flags & WHERE_ROWID_EQ ){ - /* Case 1: We can directly reference a single row using an - ** equality comparison against the ROWID field. Or - ** we reference multiple rows using a "rowid IN (...)" - ** construct. - */ - pTerm = findTerm(&wc, iCur, -1, notReady, WO_EQ|WO_IN, 0); - assert( pTerm!=0 ); - assert( pTerm->pExpr!=0 ); - assert( pTerm->leftCursor==iCur ); - assert( omitTable==0 ); - codeEqualityTerm(pParse, pTerm, brk, pLevel); - sqlite3VdbeAddOp(v, OP_MustBeInt, 1, brk); - sqlite3VdbeAddOp(v, OP_NotExists, iCur, brk); - VdbeComment((v, "pk")); - pLevel->op = OP_Noop; - }else if( pLevel->flags & WHERE_ROWID_RANGE ){ - /* Case 2: We have an inequality comparison against the ROWID field. - */ - int testOp = OP_Noop; - int start; - WhereTerm *pStart, *pEnd; - - assert( omitTable==0 ); - pStart = findTerm(&wc, iCur, -1, notReady, WO_GT|WO_GE, 0); - pEnd = findTerm(&wc, iCur, -1, notReady, WO_LT|WO_LE, 0); - if( bRev ){ - pTerm = pStart; - pStart = pEnd; - pEnd = pTerm; - } - if( pStart ){ - Expr *pX; - pX = pStart->pExpr; - assert( pX!=0 ); - assert( pStart->leftCursor==iCur ); - sqlite3ExprCode(pParse, pX->pRight); - sqlite3VdbeAddOp(v, OP_ForceInt, pX->op==TK_LE || pX->op==TK_GT, brk); - sqlite3VdbeAddOp(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk); - VdbeComment((v, "pk")); - disableTerm(pLevel, pStart); - }else{ - sqlite3VdbeAddOp(v, bRev ? OP_Last : OP_Rewind, iCur, brk); - } - if( pEnd ){ - Expr *pX; - pX = pEnd->pExpr; - assert( pX!=0 ); - assert( pEnd->leftCursor==iCur ); - sqlite3ExprCode(pParse, pX->pRight); - pLevel->iMem = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1); - if( pX->op==TK_LT || pX->op==TK_GT ){ - testOp = bRev ? OP_Le : OP_Ge; - }else{ - testOp = bRev ? OP_Lt : OP_Gt; - } - disableTerm(pLevel, pEnd); - } - start = sqlite3VdbeCurrentAddr(v); - pLevel->op = bRev ? OP_Prev : OP_Next; - pLevel->p1 = iCur; - pLevel->p2 = start; - if( testOp!=OP_Noop ){ - sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); - sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); - sqlite3VdbeAddOp(v, testOp, 'n', brk); - } - }else if( pLevel->flags & WHERE_COLUMN_RANGE ){ - /* Case 3: The WHERE clause term that refers to the right-most - ** column of the index is an inequality. For example, if - ** the index is on (x,y,z) and the WHERE clause is of the - ** form "x=5 AND y<10" then this case is used. Only the - ** right-most column can be an inequality - the rest must - ** use the "==" and "IN" operators. - ** - ** This case is also used when there are no WHERE clause - ** constraints but an index is selected anyway, in order - ** to force the output order to conform to an ORDER BY. - */ - int start; - int nEq = pLevel->nEq; - int leFlag=0, geFlag=0; - int testOp; - int topLimit = (pLevel->flags & WHERE_TOP_LIMIT)!=0; - int btmLimit = (pLevel->flags & WHERE_BTM_LIMIT)!=0; - - /* Generate code to evaluate all constraint terms using == or IN - ** and level the values of those terms on the stack. - */ - codeAllEqualityTerms(pParse, pLevel, &wc, notReady, brk); - - /* Duplicate the equality term values because they will all be - ** used twice: once to make the termination key and once to make the - ** start key. - */ - for(j=0; j<nEq; j++){ - sqlite3VdbeAddOp(v, OP_Dup, nEq-1, 0); - } - - /* Generate the termination key. This is the key value that - ** will end the search. There is no termination key if there - ** are no equality terms and no "X<..." term. - ** - ** 2002-Dec-04: On a reverse-order scan, the so-called "termination" - ** key computed here really ends up being the start key. - */ - if( topLimit ){ - Expr *pX; - int k = pIdx->aiColumn[j]; - pTerm = findTerm(&wc, iCur, k, notReady, WO_LT|WO_LE, pIdx); - assert( pTerm!=0 ); - pX = pTerm->pExpr; - assert( (pTerm->flags & TERM_CODED)==0 ); - sqlite3ExprCode(pParse, pX->pRight); - leFlag = pX->op==TK_LE; - disableTerm(pLevel, pTerm); - testOp = OP_IdxGE; - }else{ - testOp = nEq>0 ? OP_IdxGE : OP_Noop; - leFlag = 1; - } - if( testOp!=OP_Noop ){ - int nCol = nEq + topLimit; - pLevel->iMem = pParse->nMem++; - buildIndexProbe(v, nCol, brk, pIdx); - if( bRev ){ - int op = leFlag ? OP_MoveLe : OP_MoveLt; - sqlite3VdbeAddOp(v, op, iIdxCur, brk); - }else{ - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1); - } - }else if( bRev ){ - sqlite3VdbeAddOp(v, OP_Last, iIdxCur, brk); - } - - /* Generate the start key. This is the key that defines the lower - ** bound on the search. There is no start key if there are no - ** equality terms and if there is no "X>..." term. In - ** that case, generate a "Rewind" instruction in place of the - ** start key search. - ** - ** 2002-Dec-04: In the case of a reverse-order search, the so-called - ** "start" key really ends up being used as the termination key. - */ - if( btmLimit ){ - Expr *pX; - int k = pIdx->aiColumn[j]; - pTerm = findTerm(&wc, iCur, k, notReady, WO_GT|WO_GE, pIdx); - assert( pTerm!=0 ); - pX = pTerm->pExpr; - assert( (pTerm->flags & TERM_CODED)==0 ); - sqlite3ExprCode(pParse, pX->pRight); - geFlag = pX->op==TK_GE; - disableTerm(pLevel, pTerm); - }else{ - geFlag = 1; - } - if( nEq>0 || btmLimit ){ - int nCol = nEq + btmLimit; - buildIndexProbe(v, nCol, brk, pIdx); - if( bRev ){ - pLevel->iMem = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1); - testOp = OP_IdxLT; - }else{ - int op = geFlag ? OP_MoveGe : OP_MoveGt; - sqlite3VdbeAddOp(v, op, iIdxCur, brk); - } - }else if( bRev ){ - testOp = OP_Noop; - }else{ - sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, brk); - } - - /* Generate the the top of the loop. If there is a termination - ** key we have to test for that key and abort at the top of the - ** loop. - */ - start = sqlite3VdbeCurrentAddr(v); - if( testOp!=OP_Noop ){ - sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); - sqlite3VdbeAddOp(v, testOp, iIdxCur, brk); - if( (leFlag && !bRev) || (!geFlag && bRev) ){ - sqlite3VdbeChangeP3(v, -1, "+", P3_STATIC); - } - } - sqlite3VdbeAddOp(v, OP_RowKey, iIdxCur, 0); - sqlite3VdbeAddOp(v, OP_IdxIsNull, nEq + topLimit, cont); - if( !omitTable ){ - sqlite3VdbeAddOp(v, OP_IdxRowid, iIdxCur, 0); - sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); - } - - /* Record the instruction used to terminate the loop. - */ - pLevel->op = bRev ? OP_Prev : OP_Next; - pLevel->p1 = iIdxCur; - pLevel->p2 = start; - }else if( pLevel->flags & WHERE_COLUMN_EQ ){ - /* Case 4: There is an index and all terms of the WHERE clause that - ** refer to the index using the "==" or "IN" operators. - */ - int start; - int nEq = pLevel->nEq; - - /* Generate code to evaluate all constraint terms using == or IN - ** and leave the values of those terms on the stack. - */ - codeAllEqualityTerms(pParse, pLevel, &wc, notReady, brk); - - /* Generate a single key that will be used to both start and terminate - ** the search - */ - buildIndexProbe(v, nEq, brk, pIdx); - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 0); - - /* Generate code (1) to move to the first matching element of the table. - ** Then generate code (2) that jumps to "brk" after the cursor is past - ** the last matching element of the table. The code (1) is executed - ** once to initialize the search, the code (2) is executed before each - ** iteration of the scan to see if the scan has finished. */ - if( bRev ){ - /* Scan in reverse order */ - sqlite3VdbeAddOp(v, OP_MoveLe, iIdxCur, brk); - start = sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); - sqlite3VdbeAddOp(v, OP_IdxLT, iIdxCur, brk); - pLevel->op = OP_Prev; - }else{ - /* Scan in the forward order */ - sqlite3VdbeAddOp(v, OP_MoveGe, iIdxCur, brk); - start = sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); - sqlite3VdbeOp3(v, OP_IdxGE, iIdxCur, brk, "+", P3_STATIC); - pLevel->op = OP_Next; - } - sqlite3VdbeAddOp(v, OP_RowKey, iIdxCur, 0); - sqlite3VdbeAddOp(v, OP_IdxIsNull, nEq, cont); - if( !omitTable ){ - sqlite3VdbeAddOp(v, OP_IdxRowid, iIdxCur, 0); - sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); - } - pLevel->p1 = iIdxCur; - pLevel->p2 = start; - }else{ - /* Case 5: There is no usable index. We must do a complete - ** scan of the entire table. - */ - assert( omitTable==0 ); - assert( bRev==0 ); - pLevel->op = OP_Next; - pLevel->p1 = iCur; - pLevel->p2 = 1 + sqlite3VdbeAddOp(v, OP_Rewind, iCur, brk); - } - notReady &= ~getMask(&maskSet, iCur); - - /* Insert code to test every subexpression that can be completely - ** computed using the current set of tables. - */ - for(pTerm=wc.a, j=wc.nTerm; j>0; j--, pTerm++){ - Expr *pE; - if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; - pE = pTerm->pExpr; - assert( pE!=0 ); - if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){ - continue; - } - sqlite3ExprIfFalse(pParse, pE, cont, 1); - pTerm->flags |= TERM_CODED; - } - - /* For a LEFT OUTER JOIN, generate code that will record the fact that - ** at least one row of the right table has matched the left table. - */ - if( pLevel->iLeftJoin ){ - pLevel->top = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp(v, OP_MemInt, 1, pLevel->iLeftJoin); - VdbeComment((v, "# record LEFT JOIN hit")); - for(pTerm=wc.a, j=0; j<wc.nTerm; j++, pTerm++){ - if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; - assert( pTerm->pExpr ); - sqlite3ExprIfFalse(pParse, pTerm->pExpr, cont, 1); - pTerm->flags |= TERM_CODED; - } - } - } - -#ifdef SQLITE_TEST /* For testing and debugging use only */ - /* Record in the query plan information about the current table - ** and the index used to access it (if any). If the table itself - ** is not used, its name is just '{}'. If no index is used - ** the index is listed as "{}". If the primary key is used the - ** index name is '*'. - */ - for(i=0; i<pTabList->nSrc; i++){ - char *z; - int n; - pLevel = &pWInfo->a[i]; - pTabItem = &pTabList->a[pLevel->iFrom]; - z = pTabItem->zAlias; - if( z==0 ) z = pTabItem->pTab->zName; - n = strlen(z); - if( n+nQPlan < sizeof(sqlite3_query_plan)-10 ){ - if( pLevel->flags & WHERE_IDX_ONLY ){ - strcpy(&sqlite3_query_plan[nQPlan], "{}"); - nQPlan += 2; - }else{ - strcpy(&sqlite3_query_plan[nQPlan], z); - nQPlan += n; - } - sqlite3_query_plan[nQPlan++] = ' '; - } - if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){ - strcpy(&sqlite3_query_plan[nQPlan], "* "); - nQPlan += 2; - }else if( pLevel->pIdx==0 ){ - strcpy(&sqlite3_query_plan[nQPlan], "{} "); - nQPlan += 3; - }else{ - n = strlen(pLevel->pIdx->zName); - if( n+nQPlan < sizeof(sqlite3_query_plan)-2 ){ - strcpy(&sqlite3_query_plan[nQPlan], pLevel->pIdx->zName); - nQPlan += n; - sqlite3_query_plan[nQPlan++] = ' '; - } - } - } - while( nQPlan>0 && sqlite3_query_plan[nQPlan-1]==' ' ){ - sqlite3_query_plan[--nQPlan] = 0; - } - sqlite3_query_plan[nQPlan] = 0; - nQPlan = 0; -#endif /* SQLITE_TEST // Testing and debugging use only */ - - /* Record the continuation address in the WhereInfo structure. Then - ** clean up and return. - */ - pWInfo->iContinue = cont; - whereClauseClear(&wc); - return pWInfo; - - /* Jump here if malloc fails */ -whereBeginNoMem: - whereClauseClear(&wc); - sqliteFree(pWInfo); - return 0; -} - -/* -** Generate the end of the WHERE loop. See comments on -** sqlite3WhereBegin() for additional information. -*/ -void sqlite3WhereEnd(WhereInfo *pWInfo){ - Vdbe *v = pWInfo->pParse->pVdbe; - int i; - WhereLevel *pLevel; - SrcList *pTabList = pWInfo->pTabList; - - /* Generate loop termination code. - */ - for(i=pTabList->nSrc-1; i>=0; i--){ - pLevel = &pWInfo->a[i]; - sqlite3VdbeResolveLabel(v, pLevel->cont); - if( pLevel->op!=OP_Noop ){ - sqlite3VdbeAddOp(v, pLevel->op, pLevel->p1, pLevel->p2); - } - sqlite3VdbeResolveLabel(v, pLevel->brk); - if( pLevel->nIn ){ - int *a; - int j; - for(j=pLevel->nIn, a=&pLevel->aInLoop[j*3-3]; j>0; j--, a-=3){ - sqlite3VdbeAddOp(v, a[0], a[1], a[2]); - } - sqliteFree(pLevel->aInLoop); - } - if( pLevel->iLeftJoin ){ - int addr; - addr = sqlite3VdbeAddOp(v, OP_IfMemPos, pLevel->iLeftJoin, 0); - sqlite3VdbeAddOp(v, OP_NullRow, pTabList->a[i].iCursor, 0); - if( pLevel->iIdxCur>=0 ){ - sqlite3VdbeAddOp(v, OP_NullRow, pLevel->iIdxCur, 0); - } - sqlite3VdbeAddOp(v, OP_Goto, 0, pLevel->top); - sqlite3VdbeJumpHere(v, addr); - } - } - - /* The "break" point is here, just past the end of the outer loop. - ** Set it. - */ - sqlite3VdbeResolveLabel(v, pWInfo->iBreak); - - /* Close all of the cursors that were opened by sqlite3WhereBegin. - */ - for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){ - struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom]; - Table *pTab = pTabItem->pTab; - assert( pTab!=0 ); - if( pTab->isTransient || pTab->pSelect ) continue; - if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){ - sqlite3VdbeAddOp(v, OP_Close, pTabItem->iCursor, 0); - } - if( pLevel->pIdx!=0 ){ - sqlite3VdbeAddOp(v, OP_Close, pLevel->iIdxCur, 0); - } - - /* Make cursor substitutions for cases where we want to use - ** just the index and never reference the table. - ** - ** Calls to the code generator in between sqlite3WhereBegin and - ** sqlite3WhereEnd will have created code that references the table - ** directly. This loop scans all that code looking for opcodes - ** that reference the table and converts them into opcodes that - ** reference the index. - */ - if( pLevel->flags & WHERE_IDX_ONLY ){ - int i, j, last; - VdbeOp *pOp; - Index *pIdx = pLevel->pIdx; - - assert( pIdx!=0 ); - pOp = sqlite3VdbeGetOp(v, pWInfo->iTop); - last = sqlite3VdbeCurrentAddr(v); - for(i=pWInfo->iTop; i<last; i++, pOp++){ - if( pOp->p1!=pLevel->iTabCur ) continue; - if( pOp->opcode==OP_Column ){ - pOp->p1 = pLevel->iIdxCur; - for(j=0; j<pIdx->nColumn; j++){ - if( pOp->p2==pIdx->aiColumn[j] ){ - pOp->p2 = j; - break; - } - } - }else if( pOp->opcode==OP_Rowid ){ - pOp->p1 = pLevel->iIdxCur; - pOp->opcode = OP_IdxRowid; - }else if( pOp->opcode==OP_NullRow ){ - pOp->opcode = OP_Noop; - } - } - } - } - - /* Final cleanup - */ - sqliteFree(pWInfo); - return; -} diff --git a/ext/pdo_sqlite/sqlite/tool/diffdb.c b/ext/pdo_sqlite/sqlite/tool/diffdb.c deleted file mode 100644 index 0537d38723e66..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/diffdb.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -** A utility for printing the differences between two SQLite database files. -*/ -#include <stdio.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <stdlib.h> - - -#define PAGESIZE 1024 -static int db1 = -1; -static int db2 = -1; - -int main(int argc, char **argv){ - int iPg; - unsigned char a1[PAGESIZE], a2[PAGESIZE]; - if( argc!=3 ){ - fprintf(stderr,"Usage: %s FILENAME FILENAME\n", argv[0]); - exit(1); - } - db1 = open(argv[1], O_RDONLY); - if( db1<0 ){ - fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]); - exit(1); - } - db2 = open(argv[2], O_RDONLY); - if( db2<0 ){ - fprintf(stderr,"%s: can't open %s\n", argv[0], argv[2]); - exit(1); - } - iPg = 1; - while( read(db1, a1, PAGESIZE)==PAGESIZE && read(db2,a2,PAGESIZE)==PAGESIZE ){ - if( memcmp(a1,a2,PAGESIZE) ){ - printf("Page %d\n", iPg); - } - iPg++; - } - printf("%d pages checked\n", iPg-1); - close(db1); - close(db2); -} diff --git a/ext/pdo_sqlite/sqlite/tool/lemon.c b/ext/pdo_sqlite/sqlite/tool/lemon.c deleted file mode 100644 index 8f6e87330a531..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/lemon.c +++ /dev/null @@ -1,4587 +0,0 @@ -/* -** This file contains all sources (including headers) to the LEMON -** LALR(1) parser generator. The sources have been combined into a -** single file to make it easy to include LEMON in the source tree -** and Makefile of another program. -** -** The author of this program disclaims copyright. -*/ -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> - -#ifndef __WIN32__ -# if defined(_WIN32) || defined(WIN32) -# define __WIN32__ -# endif -#endif - -/* #define PRIVATE static */ -#define PRIVATE - -#ifdef TEST -#define MAXRHS 5 /* Set low to exercise exception code */ -#else -#define MAXRHS 1000 -#endif - -char *msort(); -extern void *malloc(); - -/******** From the file "action.h" *************************************/ -struct action *Action_new(); -struct action *Action_sort(); - -/********* From the file "assert.h" ************************************/ -void myassert(); -#ifndef NDEBUG -# define assert(X) if(!(X))myassert(__FILE__,__LINE__) -#else -# define assert(X) -#endif - -/********** From the file "build.h" ************************************/ -void FindRulePrecedences(); -void FindFirstSets(); -void FindStates(); -void FindLinks(); -void FindFollowSets(); -void FindActions(); - -/********* From the file "configlist.h" *********************************/ -void Configlist_init(/* void */); -struct config *Configlist_add(/* struct rule *, int */); -struct config *Configlist_addbasis(/* struct rule *, int */); -void Configlist_closure(/* void */); -void Configlist_sort(/* void */); -void Configlist_sortbasis(/* void */); -struct config *Configlist_return(/* void */); -struct config *Configlist_basis(/* void */); -void Configlist_eat(/* struct config * */); -void Configlist_reset(/* void */); - -/********* From the file "error.h" ***************************************/ -void ErrorMsg(const char *, int,const char *, ...); - -/****** From the file "option.h" ******************************************/ -struct s_options { - enum { OPT_FLAG=1, OPT_INT, OPT_DBL, OPT_STR, - OPT_FFLAG, OPT_FINT, OPT_FDBL, OPT_FSTR} type; - char *label; - char *arg; - char *message; -}; -int OptInit(/* char**,struct s_options*,FILE* */); -int OptNArgs(/* void */); -char *OptArg(/* int */); -void OptErr(/* int */); -void OptPrint(/* void */); - -/******** From the file "parse.h" *****************************************/ -void Parse(/* struct lemon *lemp */); - -/********* From the file "plink.h" ***************************************/ -struct plink *Plink_new(/* void */); -void Plink_add(/* struct plink **, struct config * */); -void Plink_copy(/* struct plink **, struct plink * */); -void Plink_delete(/* struct plink * */); - -/********** From the file "report.h" *************************************/ -void Reprint(/* struct lemon * */); -void ReportOutput(/* struct lemon * */); -void ReportTable(/* struct lemon * */); -void ReportHeader(/* struct lemon * */); -void CompressTables(/* struct lemon * */); - -/********** From the file "set.h" ****************************************/ -void SetSize(/* int N */); /* All sets will be of size N */ -char *SetNew(/* void */); /* A new set for element 0..N */ -void SetFree(/* char* */); /* Deallocate a set */ - -int SetAdd(/* char*,int */); /* Add element to a set */ -int SetUnion(/* char *A,char *B */); /* A <- A U B, thru element N */ - -#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ - -/********** From the file "struct.h" *************************************/ -/* -** Principal data structures for the LEMON parser generator. -*/ - -typedef enum {B_FALSE=0, B_TRUE} Boolean; - -/* Symbols (terminals and nonterminals) of the grammar are stored -** in the following: */ -struct symbol { - char *name; /* Name of the symbol */ - int index; /* Index number for this symbol */ - enum { - TERMINAL, - NONTERMINAL - } type; /* Symbols are all either TERMINALS or NTs */ - struct rule *rule; /* Linked list of rules of this (if an NT) */ - struct symbol *fallback; /* fallback token in case this token doesn't parse */ - int prec; /* Precedence if defined (-1 otherwise) */ - enum e_assoc { - LEFT, - RIGHT, - NONE, - UNK - } assoc; /* Associativity if predecence is defined */ - char *firstset; /* First-set for all rules of this symbol */ - Boolean lambda; /* True if NT and can generate an empty string */ - char *destructor; /* Code which executes whenever this symbol is - ** popped from the stack during error processing */ - int destructorln; /* Line number of destructor code */ - char *datatype; /* The data type of information held by this - ** object. Only used if type==NONTERMINAL */ - int dtnum; /* The data type number. In the parser, the value - ** stack is a union. The .yy%d element of this - ** union is the correct data type for this object */ -}; - -/* Each production rule in the grammar is stored in the following -** structure. */ -struct rule { - struct symbol *lhs; /* Left-hand side of the rule */ - char *lhsalias; /* Alias for the LHS (NULL if none) */ - int ruleline; /* Line number for the rule */ - int nrhs; /* Number of RHS symbols */ - struct symbol **rhs; /* The RHS symbols */ - char **rhsalias; /* An alias for each RHS symbol (NULL if none) */ - int line; /* Line number at which code begins */ - char *code; /* The code executed when this rule is reduced */ - struct symbol *precsym; /* Precedence symbol for this rule */ - int index; /* An index number for this rule */ - Boolean canReduce; /* True if this rule is ever reduced */ - struct rule *nextlhs; /* Next rule with the same LHS */ - struct rule *next; /* Next rule in the global list */ -}; - -/* A configuration is a production rule of the grammar together with -** a mark (dot) showing how much of that rule has been processed so far. -** Configurations also contain a follow-set which is a list of terminal -** symbols which are allowed to immediately follow the end of the rule. -** Every configuration is recorded as an instance of the following: */ -struct config { - struct rule *rp; /* The rule upon which the configuration is based */ - int dot; /* The parse point */ - char *fws; /* Follow-set for this configuration only */ - struct plink *fplp; /* Follow-set forward propagation links */ - struct plink *bplp; /* Follow-set backwards propagation links */ - struct state *stp; /* Pointer to state which contains this */ - enum { - COMPLETE, /* The status is used during followset and */ - INCOMPLETE /* shift computations */ - } status; - struct config *next; /* Next configuration in the state */ - struct config *bp; /* The next basis configuration */ -}; - -/* Every shift or reduce operation is stored as one of the following */ -struct action { - struct symbol *sp; /* The look-ahead symbol */ - enum e_action { - SHIFT, - ACCEPT, - REDUCE, - ERROR, - CONFLICT, /* Was a reduce, but part of a conflict */ - SH_RESOLVED, /* Was a shift. Precedence resolved conflict */ - RD_RESOLVED, /* Was reduce. Precedence resolved conflict */ - NOT_USED /* Deleted by compression */ - } type; - union { - struct state *stp; /* The new state, if a shift */ - struct rule *rp; /* The rule, if a reduce */ - } x; - struct action *next; /* Next action for this state */ - struct action *collide; /* Next action with the same hash */ -}; - -/* Each state of the generated parser's finite state machine -** is encoded as an instance of the following structure. */ -struct state { - struct config *bp; /* The basis configurations for this state */ - struct config *cfp; /* All configurations in this set */ - int index; /* Sequencial number for this state */ - struct action *ap; /* Array of actions for this state */ - int nTknAct, nNtAct; /* Number of actions on terminals and nonterminals */ - int iTknOfst, iNtOfst; /* yy_action[] offset for terminals and nonterms */ - int iDflt; /* Default action */ -}; -#define NO_OFFSET (-2147483647) - -/* A followset propagation link indicates that the contents of one -** configuration followset should be propagated to another whenever -** the first changes. */ -struct plink { - struct config *cfp; /* The configuration to which linked */ - struct plink *next; /* The next propagate link */ -}; - -/* The state vector for the entire parser generator is recorded as -** follows. (LEMON uses no global variables and makes little use of -** static variables. Fields in the following structure can be thought -** of as begin global variables in the program.) */ -struct lemon { - struct state **sorted; /* Table of states sorted by state number */ - struct rule *rule; /* List of all rules */ - int nstate; /* Number of states */ - int nrule; /* Number of rules */ - int nsymbol; /* Number of terminal and nonterminal symbols */ - int nterminal; /* Number of terminal symbols */ - struct symbol **symbols; /* Sorted array of pointers to symbols */ - int errorcnt; /* Number of errors */ - struct symbol *errsym; /* The error symbol */ - char *name; /* Name of the generated parser */ - char *arg; /* Declaration of the 3th argument to parser */ - char *tokentype; /* Type of terminal symbols in the parser stack */ - char *vartype; /* The default type of non-terminal symbols */ - char *start; /* Name of the start symbol for the grammar */ - char *stacksize; /* Size of the parser stack */ - char *include; /* Code to put at the start of the C file */ - int includeln; /* Line number for start of include code */ - char *error; /* Code to execute when an error is seen */ - int errorln; /* Line number for start of error code */ - char *overflow; /* Code to execute on a stack overflow */ - int overflowln; /* Line number for start of overflow code */ - char *failure; /* Code to execute on parser failure */ - int failureln; /* Line number for start of failure code */ - char *accept; /* Code to execute when the parser excepts */ - int acceptln; /* Line number for the start of accept code */ - char *extracode; /* Code appended to the generated file */ - int extracodeln; /* Line number for the start of the extra code */ - char *tokendest; /* Code to execute to destroy token data */ - int tokendestln; /* Line number for token destroyer code */ - char *vardest; /* Code for the default non-terminal destructor */ - int vardestln; /* Line number for default non-term destructor code*/ - char *filename; /* Name of the input file */ - char *outname; /* Name of the current output file */ - char *tokenprefix; /* A prefix added to token names in the .h file */ - int nconflict; /* Number of parsing conflicts */ - int tablesize; /* Size of the parse tables */ - int basisflag; /* Print only basis configurations */ - int has_fallback; /* True if any %fallback is seen in the grammer */ - char *argv0; /* Name of the program */ -}; - -#define MemoryCheck(X) if((X)==0){ \ - extern void memory_error(); \ - memory_error(); \ -} - -/**************** From the file "table.h" *********************************/ -/* -** All code in this file has been automatically generated -** from a specification in the file -** "table.q" -** by the associative array code building program "aagen". -** Do not edit this file! Instead, edit the specification -** file, then rerun aagen. -*/ -/* -** Code for processing tables in the LEMON parser generator. -*/ - -/* Routines for handling a strings */ - -char *Strsafe(); - -void Strsafe_init(/* void */); -int Strsafe_insert(/* char * */); -char *Strsafe_find(/* char * */); - -/* Routines for handling symbols of the grammar */ - -struct symbol *Symbol_new(); -int Symbolcmpp(/* struct symbol **, struct symbol ** */); -void Symbol_init(/* void */); -int Symbol_insert(/* struct symbol *, char * */); -struct symbol *Symbol_find(/* char * */); -struct symbol *Symbol_Nth(/* int */); -int Symbol_count(/* */); -struct symbol **Symbol_arrayof(/* */); - -/* Routines to manage the state table */ - -int Configcmp(/* struct config *, struct config * */); -struct state *State_new(); -void State_init(/* void */); -int State_insert(/* struct state *, struct config * */); -struct state *State_find(/* struct config * */); -struct state **State_arrayof(/* */); - -/* Routines used for efficiency in Configlist_add */ - -void Configtable_init(/* void */); -int Configtable_insert(/* struct config * */); -struct config *Configtable_find(/* struct config * */); -void Configtable_clear(/* int(*)(struct config *) */); -/****************** From the file "action.c" *******************************/ -/* -** Routines processing parser actions in the LEMON parser generator. -*/ - -/* Allocate a new parser action */ -struct action *Action_new(){ - static struct action *freelist = 0; - struct action *new; - - if( freelist==0 ){ - int i; - int amt = 100; - freelist = (struct action *)malloc( sizeof(struct action)*amt ); - if( freelist==0 ){ - fprintf(stderr,"Unable to allocate memory for a new parser action."); - exit(1); - } - for(i=0; i<amt-1; i++) freelist[i].next = &freelist[i+1]; - freelist[amt-1].next = 0; - } - new = freelist; - freelist = freelist->next; - return new; -} - -/* Compare two actions */ -static int actioncmp(ap1,ap2) -struct action *ap1; -struct action *ap2; -{ - int rc; - rc = ap1->sp->index - ap2->sp->index; - if( rc==0 ) rc = (int)ap1->type - (int)ap2->type; - if( rc==0 ){ - assert( ap1->type==REDUCE || ap1->type==RD_RESOLVED || ap1->type==CONFLICT); - assert( ap2->type==REDUCE || ap2->type==RD_RESOLVED || ap2->type==CONFLICT); - rc = ap1->x.rp->index - ap2->x.rp->index; - } - return rc; -} - -/* Sort parser actions */ -struct action *Action_sort(ap) -struct action *ap; -{ - ap = (struct action *)msort((char *)ap,(char **)&ap->next,actioncmp); - return ap; -} - -void Action_add(app,type,sp,arg) -struct action **app; -enum e_action type; -struct symbol *sp; -char *arg; -{ - struct action *new; - new = Action_new(); - new->next = *app; - *app = new; - new->type = type; - new->sp = sp; - if( type==SHIFT ){ - new->x.stp = (struct state *)arg; - }else{ - new->x.rp = (struct rule *)arg; - } -} -/********************** New code to implement the "acttab" module ***********/ -/* -** This module implements routines use to construct the yy_action[] table. -*/ - -/* -** The state of the yy_action table under construction is an instance of -** the following structure -*/ -typedef struct acttab acttab; -struct acttab { - int nAction; /* Number of used slots in aAction[] */ - int nActionAlloc; /* Slots allocated for aAction[] */ - struct { - int lookahead; /* Value of the lookahead token */ - int action; /* Action to take on the given lookahead */ - } *aAction, /* The yy_action[] table under construction */ - *aLookahead; /* A single new transaction set */ - int mnLookahead; /* Minimum aLookahead[].lookahead */ - int mnAction; /* Action associated with mnLookahead */ - int mxLookahead; /* Maximum aLookahead[].lookahead */ - int nLookahead; /* Used slots in aLookahead[] */ - int nLookaheadAlloc; /* Slots allocated in aLookahead[] */ -}; - -/* Return the number of entries in the yy_action table */ -#define acttab_size(X) ((X)->nAction) - -/* The value for the N-th entry in yy_action */ -#define acttab_yyaction(X,N) ((X)->aAction[N].action) - -/* The value for the N-th entry in yy_lookahead */ -#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead) - -/* Free all memory associated with the given acttab */ -void acttab_free(acttab *p){ - free( p->aAction ); - free( p->aLookahead ); - free( p ); -} - -/* Allocate a new acttab structure */ -acttab *acttab_alloc(void){ - acttab *p = malloc( sizeof(*p) ); - if( p==0 ){ - fprintf(stderr,"Unable to allocate memory for a new acttab."); - exit(1); - } - memset(p, 0, sizeof(*p)); - return p; -} - -/* Add a new action to the current transaction set -*/ -void acttab_action(acttab *p, int lookahead, int action){ - if( p->nLookahead>=p->nLookaheadAlloc ){ - p->nLookaheadAlloc += 25; - p->aLookahead = realloc( p->aLookahead, - sizeof(p->aLookahead[0])*p->nLookaheadAlloc ); - if( p->aLookahead==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - } - if( p->nLookahead==0 ){ - p->mxLookahead = lookahead; - p->mnLookahead = lookahead; - p->mnAction = action; - }else{ - if( p->mxLookahead<lookahead ) p->mxLookahead = lookahead; - if( p->mnLookahead>lookahead ){ - p->mnLookahead = lookahead; - p->mnAction = action; - } - } - p->aLookahead[p->nLookahead].lookahead = lookahead; - p->aLookahead[p->nLookahead].action = action; - p->nLookahead++; -} - -/* -** Add the transaction set built up with prior calls to acttab_action() -** into the current action table. Then reset the transaction set back -** to an empty set in preparation for a new round of acttab_action() calls. -** -** Return the offset into the action table of the new transaction. -*/ -int acttab_insert(acttab *p){ - int i, j, k, n; - assert( p->nLookahead>0 ); - - /* Make sure we have enough space to hold the expanded action table - ** in the worst case. The worst case occurs if the transaction set - ** must be appended to the current action table - */ - n = p->mxLookahead + 1; - if( p->nAction + n >= p->nActionAlloc ){ - int oldAlloc = p->nActionAlloc; - p->nActionAlloc = p->nAction + n + p->nActionAlloc + 20; - p->aAction = realloc( p->aAction, - sizeof(p->aAction[0])*p->nActionAlloc); - if( p->aAction==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - for(i=oldAlloc; i<p->nActionAlloc; i++){ - p->aAction[i].lookahead = -1; - p->aAction[i].action = -1; - } - } - - /* Scan the existing action table looking for an offset where we can - ** insert the current transaction set. Fall out of the loop when that - ** offset is found. In the worst case, we fall out of the loop when - ** i reaches p->nAction, which means we append the new transaction set. - ** - ** i is the index in p->aAction[] where p->mnLookahead is inserted. - */ - for(i=0; i<p->nAction+p->mnLookahead; i++){ - if( p->aAction[i].lookahead<0 ){ - for(j=0; j<p->nLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - if( k<0 ) break; - if( p->aAction[k].lookahead>=0 ) break; - } - if( j<p->nLookahead ) continue; - for(j=0; j<p->nAction; j++){ - if( p->aAction[j].lookahead==j+p->mnLookahead-i ) break; - } - if( j==p->nAction ){ - break; /* Fits in empty slots */ - } - }else if( p->aAction[i].lookahead==p->mnLookahead ){ - if( p->aAction[i].action!=p->mnAction ) continue; - for(j=0; j<p->nLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - if( k<0 || k>=p->nAction ) break; - if( p->aLookahead[j].lookahead!=p->aAction[k].lookahead ) break; - if( p->aLookahead[j].action!=p->aAction[k].action ) break; - } - if( j<p->nLookahead ) continue; - n = 0; - for(j=0; j<p->nAction; j++){ - if( p->aAction[j].lookahead<0 ) continue; - if( p->aAction[j].lookahead==j+p->mnLookahead-i ) n++; - } - if( n==p->nLookahead ){ - break; /* Same as a prior transaction set */ - } - } - } - /* Insert transaction set at index i. */ - for(j=0; j<p->nLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - p->aAction[k] = p->aLookahead[j]; - if( k>=p->nAction ) p->nAction = k+1; - } - p->nLookahead = 0; - - /* Return the offset that is added to the lookahead in order to get the - ** index into yy_action of the action */ - return i - p->mnLookahead; -} - -/********************** From the file "assert.c" ****************************/ -/* -** A more efficient way of handling assertions. -*/ -void myassert(file,line) -char *file; -int line; -{ - fprintf(stderr,"Assertion failed on line %d of file \"%s\"\n",line,file); - exit(1); -} -/********************** From the file "build.c" *****************************/ -/* -** Routines to construction the finite state machine for the LEMON -** parser generator. -*/ - -/* Find a precedence symbol of every rule in the grammar. -** -** Those rules which have a precedence symbol coded in the input -** grammar using the "[symbol]" construct will already have the -** rp->precsym field filled. Other rules take as their precedence -** symbol the first RHS symbol with a defined precedence. If there -** are not RHS symbols with a defined precedence, the precedence -** symbol field is left blank. -*/ -void FindRulePrecedences(xp) -struct lemon *xp; -{ - struct rule *rp; - for(rp=xp->rule; rp; rp=rp->next){ - if( rp->precsym==0 ){ - int i; - for(i=0; i<rp->nrhs; i++){ - if( rp->rhs[i]->prec>=0 ){ - rp->precsym = rp->rhs[i]; - break; - } - } - } - } - return; -} - -/* Find all nonterminals which will generate the empty string. -** Then go back and compute the first sets of every nonterminal. -** The first set is the set of all terminal symbols which can begin -** a string generated by that nonterminal. -*/ -void FindFirstSets(lemp) -struct lemon *lemp; -{ - int i; - struct rule *rp; - int progress; - - for(i=0; i<lemp->nsymbol; i++){ - lemp->symbols[i]->lambda = B_FALSE; - } - for(i=lemp->nterminal; i<lemp->nsymbol; i++){ - lemp->symbols[i]->firstset = SetNew(); - } - - /* First compute all lambdas */ - do{ - progress = 0; - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->lhs->lambda ) continue; - for(i=0; i<rp->nrhs; i++){ - if( rp->rhs[i]->lambda==B_FALSE ) break; - } - if( i==rp->nrhs ){ - rp->lhs->lambda = B_TRUE; - progress = 1; - } - } - }while( progress ); - - /* Now compute all first sets */ - do{ - struct symbol *s1, *s2; - progress = 0; - for(rp=lemp->rule; rp; rp=rp->next){ - s1 = rp->lhs; - for(i=0; i<rp->nrhs; i++){ - s2 = rp->rhs[i]; - if( s2->type==TERMINAL ){ - progress += SetAdd(s1->firstset,s2->index); - break; - }else if( s1==s2 ){ - if( s1->lambda==B_FALSE ) break; - }else{ - progress += SetUnion(s1->firstset,s2->firstset); - if( s2->lambda==B_FALSE ) break; - } - } - } - }while( progress ); - return; -} - -/* Compute all LR(0) states for the grammar. Links -** are added to between some states so that the LR(1) follow sets -** can be computed later. -*/ -PRIVATE struct state *getstate(/* struct lemon * */); /* forward reference */ -void FindStates(lemp) -struct lemon *lemp; -{ - struct symbol *sp; - struct rule *rp; - - Configlist_init(); - - /* Find the start symbol */ - if( lemp->start ){ - sp = Symbol_find(lemp->start); - if( sp==0 ){ - ErrorMsg(lemp->filename,0, -"The specified start symbol \"%s\" is not \ -in a nonterminal of the grammar. \"%s\" will be used as the start \ -symbol instead.",lemp->start,lemp->rule->lhs->name); - lemp->errorcnt++; - sp = lemp->rule->lhs; - } - }else{ - sp = lemp->rule->lhs; - } - - /* Make sure the start symbol doesn't occur on the right-hand side of - ** any rule. Report an error if it does. (YACC would generate a new - ** start symbol in this case.) */ - for(rp=lemp->rule; rp; rp=rp->next){ - int i; - for(i=0; i<rp->nrhs; i++){ - if( rp->rhs[i]==sp ){ - ErrorMsg(lemp->filename,0, -"The start symbol \"%s\" occurs on the \ -right-hand side of a rule. This will result in a parser which \ -does not work properly.",sp->name); - lemp->errorcnt++; - } - } - } - - /* The basis configuration set for the first state - ** is all rules which have the start symbol as their - ** left-hand side */ - for(rp=sp->rule; rp; rp=rp->nextlhs){ - struct config *newcfp; - newcfp = Configlist_addbasis(rp,0); - SetAdd(newcfp->fws,0); - } - - /* Compute the first state. All other states will be - ** computed automatically during the computation of the first one. - ** The returned pointer to the first state is not used. */ - (void)getstate(lemp); - return; -} - -/* Return a pointer to a state which is described by the configuration -** list which has been built from calls to Configlist_add. -*/ -PRIVATE void buildshifts(/* struct lemon *, struct state * */); /* Forwd ref */ -PRIVATE struct state *getstate(lemp) -struct lemon *lemp; -{ - struct config *cfp, *bp; - struct state *stp; - - /* Extract the sorted basis of the new state. The basis was constructed - ** by prior calls to "Configlist_addbasis()". */ - Configlist_sortbasis(); - bp = Configlist_basis(); - - /* Get a state with the same basis */ - stp = State_find(bp); - if( stp ){ - /* A state with the same basis already exists! Copy all the follow-set - ** propagation links from the state under construction into the - ** preexisting state, then return a pointer to the preexisting state */ - struct config *x, *y; - for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){ - Plink_copy(&y->bplp,x->bplp); - Plink_delete(x->fplp); - x->fplp = x->bplp = 0; - } - cfp = Configlist_return(); - Configlist_eat(cfp); - }else{ - /* This really is a new state. Construct all the details */ - Configlist_closure(lemp); /* Compute the configuration closure */ - Configlist_sort(); /* Sort the configuration closure */ - cfp = Configlist_return(); /* Get a pointer to the config list */ - stp = State_new(); /* A new state structure */ - MemoryCheck(stp); - stp->bp = bp; /* Remember the configuration basis */ - stp->cfp = cfp; /* Remember the configuration closure */ - stp->index = lemp->nstate++; /* Every state gets a sequence number */ - stp->ap = 0; /* No actions, yet. */ - State_insert(stp,stp->bp); /* Add to the state table */ - buildshifts(lemp,stp); /* Recursively compute successor states */ - } - return stp; -} - -/* Construct all successor states to the given state. A "successor" -** state is any state which can be reached by a shift action. -*/ -PRIVATE void buildshifts(lemp,stp) -struct lemon *lemp; -struct state *stp; /* The state from which successors are computed */ -{ - struct config *cfp; /* For looping thru the config closure of "stp" */ - struct config *bcfp; /* For the inner loop on config closure of "stp" */ - struct config *new; /* */ - struct symbol *sp; /* Symbol following the dot in configuration "cfp" */ - struct symbol *bsp; /* Symbol following the dot in configuration "bcfp" */ - struct state *newstp; /* A pointer to a successor state */ - - /* Each configuration becomes complete after it contibutes to a successor - ** state. Initially, all configurations are incomplete */ - for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE; - - /* Loop through all configurations of the state "stp" */ - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */ - if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */ - Configlist_reset(); /* Reset the new config set */ - sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */ - - /* For every configuration in the state "stp" which has the symbol "sp" - ** following its dot, add the same configuration to the basis set under - ** construction but with the dot shifted one symbol to the right. */ - for(bcfp=cfp; bcfp; bcfp=bcfp->next){ - if( bcfp->status==COMPLETE ) continue; /* Already used */ - if( bcfp->dot>=bcfp->rp->nrhs ) continue; /* Can't shift this one */ - bsp = bcfp->rp->rhs[bcfp->dot]; /* Get symbol after dot */ - if( bsp!=sp ) continue; /* Must be same as for "cfp" */ - bcfp->status = COMPLETE; /* Mark this config as used */ - new = Configlist_addbasis(bcfp->rp,bcfp->dot+1); - Plink_add(&new->bplp,bcfp); - } - - /* Get a pointer to the state described by the basis configuration set - ** constructed in the preceding loop */ - newstp = getstate(lemp); - - /* The state "newstp" is reached from the state "stp" by a shift action - ** on the symbol "sp" */ - Action_add(&stp->ap,SHIFT,sp,(char *)newstp); - } -} - -/* -** Construct the propagation links -*/ -void FindLinks(lemp) -struct lemon *lemp; -{ - int i; - struct config *cfp, *other; - struct state *stp; - struct plink *plp; - - /* Housekeeping detail: - ** Add to every propagate link a pointer back to the state to - ** which the link is attached. */ - for(i=0; i<lemp->nstate; i++){ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - cfp->stp = stp; - } - } - - /* Convert all backlinks into forward links. Only the forward - ** links are used in the follow-set computation. */ - for(i=0; i<lemp->nstate; i++){ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - for(plp=cfp->bplp; plp; plp=plp->next){ - other = plp->cfp; - Plink_add(&other->fplp,cfp); - } - } - } -} - -/* Compute all followsets. -** -** A followset is the set of all symbols which can come immediately -** after a configuration. -*/ -void FindFollowSets(lemp) -struct lemon *lemp; -{ - int i; - struct config *cfp; - struct plink *plp; - int progress; - int change; - - for(i=0; i<lemp->nstate; i++){ - for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ - cfp->status = INCOMPLETE; - } - } - - do{ - progress = 0; - for(i=0; i<lemp->nstate; i++){ - for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ - if( cfp->status==COMPLETE ) continue; - for(plp=cfp->fplp; plp; plp=plp->next){ - change = SetUnion(plp->cfp->fws,cfp->fws); - if( change ){ - plp->cfp->status = INCOMPLETE; - progress = 1; - } - } - cfp->status = COMPLETE; - } - } - }while( progress ); -} - -static int resolve_conflict(); - -/* Compute the reduce actions, and resolve conflicts. -*/ -void FindActions(lemp) -struct lemon *lemp; -{ - int i,j; - struct config *cfp; - struct state *stp; - struct symbol *sp; - struct rule *rp; - - /* Add all of the reduce actions - ** A reduce action is added for each element of the followset of - ** a configuration which has its dot at the extreme right. - */ - for(i=0; i<lemp->nstate; i++){ /* Loop over all states */ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ - if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */ - for(j=0; j<lemp->nterminal; j++){ - if( SetFind(cfp->fws,j) ){ - /* Add a reduce action to the state "stp" which will reduce by the - ** rule "cfp->rp" if the lookahead symbol is "lemp->symbols[j]" */ - Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); - } - } - } - } - } - - /* Add the accepting token */ - if( lemp->start ){ - sp = Symbol_find(lemp->start); - if( sp==0 ) sp = lemp->rule->lhs; - }else{ - sp = lemp->rule->lhs; - } - /* Add to the first state (which is always the starting state of the - ** finite state machine) an action to ACCEPT if the lookahead is the - ** start nonterminal. */ - Action_add(&lemp->sorted[0]->ap,ACCEPT,sp,0); - - /* Resolve conflicts */ - for(i=0; i<lemp->nstate; i++){ - struct action *ap, *nap; - struct state *stp; - stp = lemp->sorted[i]; - assert( stp->ap ); - stp->ap = Action_sort(stp->ap); - for(ap=stp->ap; ap && ap->next; ap=ap->next){ - for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){ - /* The two actions "ap" and "nap" have the same lookahead. - ** Figure out which one should be used */ - lemp->nconflict += resolve_conflict(ap,nap,lemp->errsym); - } - } - } - - /* Report an error for each rule that can never be reduced. */ - for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = B_FALSE; - for(i=0; i<lemp->nstate; i++){ - struct action *ap; - for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){ - if( ap->type==REDUCE ) ap->x.rp->canReduce = B_TRUE; - } - } - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->canReduce ) continue; - ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n"); - lemp->errorcnt++; - } -} - -/* Resolve a conflict between the two given actions. If the -** conflict can't be resolve, return non-zero. -** -** NO LONGER TRUE: -** To resolve a conflict, first look to see if either action -** is on an error rule. In that case, take the action which -** is not associated with the error rule. If neither or both -** actions are associated with an error rule, then try to -** use precedence to resolve the conflict. -** -** If either action is a SHIFT, then it must be apx. This -** function won't work if apx->type==REDUCE and apy->type==SHIFT. -*/ -static int resolve_conflict(apx,apy,errsym) -struct action *apx; -struct action *apy; -struct symbol *errsym; /* The error symbol (if defined. NULL otherwise) */ -{ - struct symbol *spx, *spy; - int errcnt = 0; - assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */ - if( apx->type==SHIFT && apy->type==REDUCE ){ - spx = apx->sp; - spy = apy->x.rp->precsym; - if( spy==0 || spx->prec<0 || spy->prec<0 ){ - /* Not enough precedence information. */ - apy->type = CONFLICT; - errcnt++; - }else if( spx->prec>spy->prec ){ /* Lower precedence wins */ - apy->type = RD_RESOLVED; - }else if( spx->prec<spy->prec ){ - apx->type = SH_RESOLVED; - }else if( spx->prec==spy->prec && spx->assoc==RIGHT ){ /* Use operator */ - apy->type = RD_RESOLVED; /* associativity */ - }else if( spx->prec==spy->prec && spx->assoc==LEFT ){ /* to break tie */ - apx->type = SH_RESOLVED; - }else{ - assert( spx->prec==spy->prec && spx->assoc==NONE ); - apy->type = CONFLICT; - errcnt++; - } - }else if( apx->type==REDUCE && apy->type==REDUCE ){ - spx = apx->x.rp->precsym; - spy = apy->x.rp->precsym; - if( spx==0 || spy==0 || spx->prec<0 || - spy->prec<0 || spx->prec==spy->prec ){ - apy->type = CONFLICT; - errcnt++; - }else if( spx->prec>spy->prec ){ - apy->type = RD_RESOLVED; - }else if( spx->prec<spy->prec ){ - apx->type = RD_RESOLVED; - } - }else{ - assert( - apx->type==SH_RESOLVED || - apx->type==RD_RESOLVED || - apx->type==CONFLICT || - apy->type==SH_RESOLVED || - apy->type==RD_RESOLVED || - apy->type==CONFLICT - ); - /* The REDUCE/SHIFT case cannot happen because SHIFTs come before - ** REDUCEs on the list. If we reach this point it must be because - ** the parser conflict had already been resolved. */ - } - return errcnt; -} -/********************* From the file "configlist.c" *************************/ -/* -** Routines to processing a configuration list and building a state -** in the LEMON parser generator. -*/ - -static struct config *freelist = 0; /* List of free configurations */ -static struct config *current = 0; /* Top of list of configurations */ -static struct config **currentend = 0; /* Last on list of configs */ -static struct config *basis = 0; /* Top of list of basis configs */ -static struct config **basisend = 0; /* End of list of basis configs */ - -/* Return a pointer to a new configuration */ -PRIVATE struct config *newconfig(){ - struct config *new; - if( freelist==0 ){ - int i; - int amt = 3; - freelist = (struct config *)malloc( sizeof(struct config)*amt ); - if( freelist==0 ){ - fprintf(stderr,"Unable to allocate memory for a new configuration."); - exit(1); - } - for(i=0; i<amt-1; i++) freelist[i].next = &freelist[i+1]; - freelist[amt-1].next = 0; - } - new = freelist; - freelist = freelist->next; - return new; -} - -/* The configuration "old" is no longer used */ -PRIVATE void deleteconfig(old) -struct config *old; -{ - old->next = freelist; - freelist = old; -} - -/* Initialized the configuration list builder */ -void Configlist_init(){ - current = 0; - currentend = ¤t; - basis = 0; - basisend = &basis; - Configtable_init(); - return; -} - -/* Initialized the configuration list builder */ -void Configlist_reset(){ - current = 0; - currentend = ¤t; - basis = 0; - basisend = &basis; - Configtable_clear(0); - return; -} - -/* Add another configuration to the configuration list */ -struct config *Configlist_add(rp,dot) -struct rule *rp; /* The rule */ -int dot; /* Index into the RHS of the rule where the dot goes */ -{ - struct config *cfp, model; - - assert( currentend!=0 ); - model.rp = rp; - model.dot = dot; - cfp = Configtable_find(&model); - if( cfp==0 ){ - cfp = newconfig(); - cfp->rp = rp; - cfp->dot = dot; - cfp->fws = SetNew(); - cfp->stp = 0; - cfp->fplp = cfp->bplp = 0; - cfp->next = 0; - cfp->bp = 0; - *currentend = cfp; - currentend = &cfp->next; - Configtable_insert(cfp); - } - return cfp; -} - -/* Add a basis configuration to the configuration list */ -struct config *Configlist_addbasis(rp,dot) -struct rule *rp; -int dot; -{ - struct config *cfp, model; - - assert( basisend!=0 ); - assert( currentend!=0 ); - model.rp = rp; - model.dot = dot; - cfp = Configtable_find(&model); - if( cfp==0 ){ - cfp = newconfig(); - cfp->rp = rp; - cfp->dot = dot; - cfp->fws = SetNew(); - cfp->stp = 0; - cfp->fplp = cfp->bplp = 0; - cfp->next = 0; - cfp->bp = 0; - *currentend = cfp; - currentend = &cfp->next; - *basisend = cfp; - basisend = &cfp->bp; - Configtable_insert(cfp); - } - return cfp; -} - -/* Compute the closure of the configuration list */ -void Configlist_closure(lemp) -struct lemon *lemp; -{ - struct config *cfp, *newcfp; - struct rule *rp, *newrp; - struct symbol *sp, *xsp; - int i, dot; - - assert( currentend!=0 ); - for(cfp=current; cfp; cfp=cfp->next){ - rp = cfp->rp; - dot = cfp->dot; - if( dot>=rp->nrhs ) continue; - sp = rp->rhs[dot]; - if( sp->type==NONTERMINAL ){ - if( sp->rule==0 && sp!=lemp->errsym ){ - ErrorMsg(lemp->filename,rp->line,"Nonterminal \"%s\" has no rules.", - sp->name); - lemp->errorcnt++; - } - for(newrp=sp->rule; newrp; newrp=newrp->nextlhs){ - newcfp = Configlist_add(newrp,0); - for(i=dot+1; i<rp->nrhs; i++){ - xsp = rp->rhs[i]; - if( xsp->type==TERMINAL ){ - SetAdd(newcfp->fws,xsp->index); - break; - }else{ - SetUnion(newcfp->fws,xsp->firstset); - if( xsp->lambda==B_FALSE ) break; - } - } - if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp); - } - } - } - return; -} - -/* Sort the configuration list */ -void Configlist_sort(){ - current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp); - currentend = 0; - return; -} - -/* Sort the basis configuration list */ -void Configlist_sortbasis(){ - basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp); - basisend = 0; - return; -} - -/* Return a pointer to the head of the configuration list and -** reset the list */ -struct config *Configlist_return(){ - struct config *old; - old = current; - current = 0; - currentend = 0; - return old; -} - -/* Return a pointer to the head of the configuration list and -** reset the list */ -struct config *Configlist_basis(){ - struct config *old; - old = basis; - basis = 0; - basisend = 0; - return old; -} - -/* Free all elements of the given configuration list */ -void Configlist_eat(cfp) -struct config *cfp; -{ - struct config *nextcfp; - for(; cfp; cfp=nextcfp){ - nextcfp = cfp->next; - assert( cfp->fplp==0 ); - assert( cfp->bplp==0 ); - if( cfp->fws ) SetFree(cfp->fws); - deleteconfig(cfp); - } - return; -} -/***************** From the file "error.c" *********************************/ -/* -** Code for printing error message. -*/ - -/* Find a good place to break "msg" so that its length is at least "min" -** but no more than "max". Make the point as close to max as possible. -*/ -static int findbreak(msg,min,max) -char *msg; -int min; -int max; -{ - int i,spot; - char c; - for(i=spot=min; i<=max; i++){ - c = msg[i]; - if( c=='\t' ) msg[i] = ' '; - if( c=='\n' ){ msg[i] = ' '; spot = i; break; } - if( c==0 ){ spot = i; break; } - if( c=='-' && i<max-1 ) spot = i+1; - if( c==' ' ) spot = i; - } - return spot; -} - -/* -** The error message is split across multiple lines if necessary. The -** splits occur at a space, if there is a space available near the end -** of the line. -*/ -#define ERRMSGSIZE 10000 /* Hope this is big enough. No way to error check */ -#define LINEWIDTH 79 /* Max width of any output line */ -#define PREFIXLIMIT 30 /* Max width of the prefix on each line */ -void ErrorMsg(const char *filename, int lineno, const char *format, ...){ - char errmsg[ERRMSGSIZE]; - char prefix[PREFIXLIMIT+10]; - int errmsgsize; - int prefixsize; - int availablewidth; - va_list ap; - int end, restart, base; - - va_start(ap, format); - /* Prepare a prefix to be prepended to every output line */ - if( lineno>0 ){ - sprintf(prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno); - }else{ - sprintf(prefix,"%.*s: ",PREFIXLIMIT-10,filename); - } - prefixsize = strlen(prefix); - availablewidth = LINEWIDTH - prefixsize; - - /* Generate the error message */ - vsprintf(errmsg,format,ap); - va_end(ap); - errmsgsize = strlen(errmsg); - /* Remove trailing '\n's from the error message. */ - while( errmsgsize>0 && errmsg[errmsgsize-1]=='\n' ){ - errmsg[--errmsgsize] = 0; - } - - /* Print the error message */ - base = 0; - while( errmsg[base]!=0 ){ - end = restart = findbreak(&errmsg[base],0,availablewidth); - restart += base; - while( errmsg[restart]==' ' ) restart++; - fprintf(stdout,"%s%.*s\n",prefix,end,&errmsg[base]); - base = restart; - } -} -/**************** From the file "main.c" ************************************/ -/* -** Main program file for the LEMON parser generator. -*/ - -/* Report an out-of-memory condition and abort. This function -** is used mostly by the "MemoryCheck" macro in struct.h -*/ -void memory_error(){ - fprintf(stderr,"Out of memory. Aborting...\n"); - exit(1); -} - -static int nDefine = 0; /* Number of -D options on the command line */ -static char **azDefine = 0; /* Name of the -D macros */ - -/* This routine is called with the argument to each -D command-line option. -** Add the macro defined to the azDefine array. -*/ -static void handle_D_option(char *z){ - char **paz; - nDefine++; - azDefine = realloc(azDefine, sizeof(azDefine[0])*nDefine); - if( azDefine==0 ){ - fprintf(stderr,"out of memory\n"); - exit(1); - } - paz = &azDefine[nDefine-1]; - *paz = malloc( strlen(z)+1 ); - if( *paz==0 ){ - fprintf(stderr,"out of memory\n"); - exit(1); - } - strcpy(*paz, z); - for(z=*paz; *z && *z!='='; z++){} - *z = 0; -} - - -/* The main program. Parse the command line and do it... */ -int main(argc,argv) -int argc; -char **argv; -{ - static int version = 0; - static int rpflag = 0; - static int basisflag = 0; - static int compress = 0; - static int quiet = 0; - static int statistics = 0; - static int mhflag = 0; - static struct s_options options[] = { - {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, - {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, - {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, - {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, - {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file"}, - {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, - {OPT_FLAG, "s", (char*)&statistics, - "Print parser stats to standard output."}, - {OPT_FLAG, "x", (char*)&version, "Print the version number."}, - {OPT_FLAG,0,0,0} - }; - int i; - struct lemon lem; - - OptInit(argv,options,stderr); - if( version ){ - printf("Lemon version 1.0\n"); - exit(0); - } - if( OptNArgs()!=1 ){ - fprintf(stderr,"Exactly one filename argument is required.\n"); - exit(1); - } - lem.errorcnt = 0; - - /* Initialize the machine */ - Strsafe_init(); - Symbol_init(); - State_init(); - lem.argv0 = argv[0]; - lem.filename = OptArg(0); - lem.basisflag = basisflag; - lem.has_fallback = 0; - lem.nconflict = 0; - lem.name = lem.include = lem.arg = lem.tokentype = lem.start = 0; - lem.vartype = 0; - lem.stacksize = 0; - lem.error = lem.overflow = lem.failure = lem.accept = lem.tokendest = - lem.tokenprefix = lem.outname = lem.extracode = 0; - lem.vardest = 0; - lem.tablesize = 0; - Symbol_new("$"); - lem.errsym = Symbol_new("error"); - - /* Parse the input file */ - Parse(&lem); - if( lem.errorcnt ) exit(lem.errorcnt); - if( lem.rule==0 ){ - fprintf(stderr,"Empty grammar.\n"); - exit(1); - } - - /* Count and index the symbols of the grammar */ - lem.nsymbol = Symbol_count(); - Symbol_new("{default}"); - lem.symbols = Symbol_arrayof(); - for(i=0; i<=lem.nsymbol; i++) lem.symbols[i]->index = i; - qsort(lem.symbols,lem.nsymbol+1,sizeof(struct symbol*), - (int(*)())Symbolcmpp); - for(i=0; i<=lem.nsymbol; i++) lem.symbols[i]->index = i; - for(i=1; isupper(lem.symbols[i]->name[0]); i++); - lem.nterminal = i; - - /* Generate a reprint of the grammar, if requested on the command line */ - if( rpflag ){ - Reprint(&lem); - }else{ - /* Initialize the size for all follow and first sets */ - SetSize(lem.nterminal); - - /* Find the precedence for every production rule (that has one) */ - FindRulePrecedences(&lem); - - /* Compute the lambda-nonterminals and the first-sets for every - ** nonterminal */ - FindFirstSets(&lem); - - /* Compute all LR(0) states. Also record follow-set propagation - ** links so that the follow-set can be computed later */ - lem.nstate = 0; - FindStates(&lem); - lem.sorted = State_arrayof(); - - /* Tie up loose ends on the propagation links */ - FindLinks(&lem); - - /* Compute the follow set of every reducible configuration */ - FindFollowSets(&lem); - - /* Compute the action tables */ - FindActions(&lem); - - /* Compress the action tables */ - if( compress==0 ) CompressTables(&lem); - - /* Generate a report of the parser generated. (the "y.output" file) */ - if( !quiet ) ReportOutput(&lem); - - /* Generate the source code for the parser */ - ReportTable(&lem, mhflag); - - /* Produce a header file for use by the scanner. (This step is - ** omitted if the "-m" option is used because makeheaders will - ** generate the file for us.) */ - if( !mhflag ) ReportHeader(&lem); - } - if( statistics ){ - printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n", - lem.nterminal, lem.nsymbol - lem.nterminal, lem.nrule); - printf(" %d states, %d parser table entries, %d conflicts\n", - lem.nstate, lem.tablesize, lem.nconflict); - } - if( lem.nconflict ){ - fprintf(stderr,"%d parsing conflicts.\n",lem.nconflict); - } - exit(lem.errorcnt + lem.nconflict); - return (lem.errorcnt + lem.nconflict); -} -/******************** From the file "msort.c" *******************************/ -/* -** A generic merge-sort program. -** -** USAGE: -** Let "ptr" be a pointer to some structure which is at the head of -** a null-terminated list. Then to sort the list call: -** -** ptr = msort(ptr,&(ptr->next),cmpfnc); -** -** In the above, "cmpfnc" is a pointer to a function which compares -** two instances of the structure and returns an integer, as in -** strcmp. The second argument is a pointer to the pointer to the -** second element of the linked list. This address is used to compute -** the offset to the "next" field within the structure. The offset to -** the "next" field must be constant for all structures in the list. -** -** The function returns a new pointer which is the head of the list -** after sorting. -** -** ALGORITHM: -** Merge-sort. -*/ - -/* -** Return a pointer to the next structure in the linked list. -*/ -#define NEXT(A) (*(char**)(((unsigned long)A)+offset)) - -/* -** Inputs: -** a: A sorted, null-terminated linked list. (May be null). -** b: A sorted, null-terminated linked list. (May be null). -** cmp: A pointer to the comparison function. -** offset: Offset in the structure to the "next" field. -** -** Return Value: -** A pointer to the head of a sorted list containing the elements -** of both a and b. -** -** Side effects: -** The "next" pointers for elements in the lists a and b are -** changed. -*/ -static char *merge(a,b,cmp,offset) -char *a; -char *b; -int (*cmp)(); -int offset; -{ - char *ptr, *head; - - if( a==0 ){ - head = b; - }else if( b==0 ){ - head = a; - }else{ - if( (*cmp)(a,b)<0 ){ - ptr = a; - a = NEXT(a); - }else{ - ptr = b; - b = NEXT(b); - } - head = ptr; - while( a && b ){ - if( (*cmp)(a,b)<0 ){ - NEXT(ptr) = a; - ptr = a; - a = NEXT(a); - }else{ - NEXT(ptr) = b; - ptr = b; - b = NEXT(b); - } - } - if( a ) NEXT(ptr) = a; - else NEXT(ptr) = b; - } - return head; -} - -/* -** Inputs: -** list: Pointer to a singly-linked list of structures. -** next: Pointer to pointer to the second element of the list. -** cmp: A comparison function. -** -** Return Value: -** A pointer to the head of a sorted list containing the elements -** orginally in list. -** -** Side effects: -** The "next" pointers for elements in list are changed. -*/ -#define LISTSIZE 30 -char *msort(list,next,cmp) -char *list; -char **next; -int (*cmp)(); -{ - unsigned long offset; - char *ep; - char *set[LISTSIZE]; - int i; - offset = (unsigned long)next - (unsigned long)list; - for(i=0; i<LISTSIZE; i++) set[i] = 0; - while( list ){ - ep = list; - list = NEXT(list); - NEXT(ep) = 0; - for(i=0; i<LISTSIZE-1 && set[i]!=0; i++){ - ep = merge(ep,set[i],cmp,offset); - set[i] = 0; - } - set[i] = ep; - } - ep = 0; - for(i=0; i<LISTSIZE; i++) if( set[i] ) ep = merge(ep,set[i],cmp,offset); - return ep; -} -/************************ From the file "option.c" **************************/ -static char **argv; -static struct s_options *op; -static FILE *errstream; - -#define ISOPT(X) ((X)[0]=='-'||(X)[0]=='+'||strchr((X),'=')!=0) - -/* -** Print the command line with a carrot pointing to the k-th character -** of the n-th field. -*/ -static void errline(n,k,err) -int n; -int k; -FILE *err; -{ - int spcnt, i; - if( argv[0] ) fprintf(err,"%s",argv[0]); - spcnt = strlen(argv[0]) + 1; - for(i=1; i<n && argv[i]; i++){ - fprintf(err," %s",argv[i]); - spcnt += strlen(argv[i])+1; - } - spcnt += k; - for(; argv[i]; i++) fprintf(err," %s",argv[i]); - if( spcnt<20 ){ - fprintf(err,"\n%*s^-- here\n",spcnt,""); - }else{ - fprintf(err,"\n%*shere --^\n",spcnt-7,""); - } -} - -/* -** Return the index of the N-th non-switch argument. Return -1 -** if N is out of range. -*/ -static int argindex(n) -int n; -{ - int i; - int dashdash = 0; - if( argv!=0 && *argv!=0 ){ - for(i=1; argv[i]; i++){ - if( dashdash || !ISOPT(argv[i]) ){ - if( n==0 ) return i; - n--; - } - if( strcmp(argv[i],"--")==0 ) dashdash = 1; - } - } - return -1; -} - -static char emsg[] = "Command line syntax error: "; - -/* -** Process a flag command line argument. -*/ -static int handleflags(i,err) -int i; -FILE *err; -{ - int v; - int errcnt = 0; - int j; - for(j=0; op[j].label; j++){ - if( strncmp(&argv[i][1],op[j].label,strlen(op[j].label))==0 ) break; - } - v = argv[i][0]=='-' ? 1 : 0; - if( op[j].label==0 ){ - if( err ){ - fprintf(err,"%sundefined option.\n",emsg); - errline(i,1,err); - } - errcnt++; - }else if( op[j].type==OPT_FLAG ){ - *((int*)op[j].arg) = v; - }else if( op[j].type==OPT_FFLAG ){ - (*(void(*)())(op[j].arg))(v); - }else if( op[j].type==OPT_FSTR ){ - (*(void(*)())(op[j].arg))(&argv[i][2]); - }else{ - if( err ){ - fprintf(err,"%smissing argument on switch.\n",emsg); - errline(i,1,err); - } - errcnt++; - } - return errcnt; -} - -/* -** Process a command line switch which has an argument. -*/ -static int handleswitch(i,err) -int i; -FILE *err; -{ - int lv = 0; - double dv = 0.0; - char *sv = 0, *end; - char *cp; - int j; - int errcnt = 0; - cp = strchr(argv[i],'='); - *cp = 0; - for(j=0; op[j].label; j++){ - if( strcmp(argv[i],op[j].label)==0 ) break; - } - *cp = '='; - if( op[j].label==0 ){ - if( err ){ - fprintf(err,"%sundefined option.\n",emsg); - errline(i,0,err); - } - errcnt++; - }else{ - cp++; - switch( op[j].type ){ - case OPT_FLAG: - case OPT_FFLAG: - if( err ){ - fprintf(err,"%soption requires an argument.\n",emsg); - errline(i,0,err); - } - errcnt++; - break; - case OPT_DBL: - case OPT_FDBL: - dv = strtod(cp,&end); - if( *end ){ - if( err ){ - fprintf(err,"%sillegal character in floating-point argument.\n",emsg); - errline(i,((unsigned long)end)-(unsigned long)argv[i],err); - } - errcnt++; - } - break; - case OPT_INT: - case OPT_FINT: - lv = strtol(cp,&end,0); - if( *end ){ - if( err ){ - fprintf(err,"%sillegal character in integer argument.\n",emsg); - errline(i,((unsigned long)end)-(unsigned long)argv[i],err); - } - errcnt++; - } - break; - case OPT_STR: - case OPT_FSTR: - sv = cp; - break; - } - switch( op[j].type ){ - case OPT_FLAG: - case OPT_FFLAG: - break; - case OPT_DBL: - *(double*)(op[j].arg) = dv; - break; - case OPT_FDBL: - (*(void(*)())(op[j].arg))(dv); - break; - case OPT_INT: - *(int*)(op[j].arg) = lv; - break; - case OPT_FINT: - (*(void(*)())(op[j].arg))((int)lv); - break; - case OPT_STR: - *(char**)(op[j].arg) = sv; - break; - case OPT_FSTR: - (*(void(*)())(op[j].arg))(sv); - break; - } - } - return errcnt; -} - -int OptInit(a,o,err) -char **a; -struct s_options *o; -FILE *err; -{ - int errcnt = 0; - argv = a; - op = o; - errstream = err; - if( argv && *argv && op ){ - int i; - for(i=1; argv[i]; i++){ - if( argv[i][0]=='+' || argv[i][0]=='-' ){ - errcnt += handleflags(i,err); - }else if( strchr(argv[i],'=') ){ - errcnt += handleswitch(i,err); - } - } - } - if( errcnt>0 ){ - fprintf(err,"Valid command line options for \"%s\" are:\n",*a); - OptPrint(); - exit(1); - } - return 0; -} - -int OptNArgs(){ - int cnt = 0; - int dashdash = 0; - int i; - if( argv!=0 && argv[0]!=0 ){ - for(i=1; argv[i]; i++){ - if( dashdash || !ISOPT(argv[i]) ) cnt++; - if( strcmp(argv[i],"--")==0 ) dashdash = 1; - } - } - return cnt; -} - -char *OptArg(n) -int n; -{ - int i; - i = argindex(n); - return i>=0 ? argv[i] : 0; -} - -void OptErr(n) -int n; -{ - int i; - i = argindex(n); - if( i>=0 ) errline(i,0,errstream); -} - -void OptPrint(){ - int i; - int max, len; - max = 0; - for(i=0; op[i].label; i++){ - len = strlen(op[i].label) + 1; - switch( op[i].type ){ - case OPT_FLAG: - case OPT_FFLAG: - break; - case OPT_INT: - case OPT_FINT: - len += 9; /* length of "<integer>" */ - break; - case OPT_DBL: - case OPT_FDBL: - len += 6; /* length of "<real>" */ - break; - case OPT_STR: - case OPT_FSTR: - len += 8; /* length of "<string>" */ - break; - } - if( len>max ) max = len; - } - for(i=0; op[i].label; i++){ - switch( op[i].type ){ - case OPT_FLAG: - case OPT_FFLAG: - fprintf(errstream," -%-*s %s\n",max,op[i].label,op[i].message); - break; - case OPT_INT: - case OPT_FINT: - fprintf(errstream," %s=<integer>%*s %s\n",op[i].label, - (int)(max-strlen(op[i].label)-9),"",op[i].message); - break; - case OPT_DBL: - case OPT_FDBL: - fprintf(errstream," %s=<real>%*s %s\n",op[i].label, - (int)(max-strlen(op[i].label)-6),"",op[i].message); - break; - case OPT_STR: - case OPT_FSTR: - fprintf(errstream," %s=<string>%*s %s\n",op[i].label, - (int)(max-strlen(op[i].label)-8),"",op[i].message); - break; - } - } -} -/*********************** From the file "parse.c" ****************************/ -/* -** Input file parser for the LEMON parser generator. -*/ - -/* The state of the parser */ -struct pstate { - char *filename; /* Name of the input file */ - int tokenlineno; /* Linenumber at which current token starts */ - int errorcnt; /* Number of errors so far */ - char *tokenstart; /* Text of current token */ - struct lemon *gp; /* Global state vector */ - enum e_state { - INITIALIZE, - WAITING_FOR_DECL_OR_RULE, - WAITING_FOR_DECL_KEYWORD, - WAITING_FOR_DECL_ARG, - WAITING_FOR_PRECEDENCE_SYMBOL, - WAITING_FOR_ARROW, - IN_RHS, - LHS_ALIAS_1, - LHS_ALIAS_2, - LHS_ALIAS_3, - RHS_ALIAS_1, - RHS_ALIAS_2, - PRECEDENCE_MARK_1, - PRECEDENCE_MARK_2, - RESYNC_AFTER_RULE_ERROR, - RESYNC_AFTER_DECL_ERROR, - WAITING_FOR_DESTRUCTOR_SYMBOL, - WAITING_FOR_DATATYPE_SYMBOL, - WAITING_FOR_FALLBACK_ID - } state; /* The state of the parser */ - struct symbol *fallback; /* The fallback token */ - struct symbol *lhs; /* Left-hand side of current rule */ - char *lhsalias; /* Alias for the LHS */ - int nrhs; /* Number of right-hand side symbols seen */ - struct symbol *rhs[MAXRHS]; /* RHS symbols */ - char *alias[MAXRHS]; /* Aliases for each RHS symbol (or NULL) */ - struct rule *prevrule; /* Previous rule parsed */ - char *declkeyword; /* Keyword of a declaration */ - char **declargslot; /* Where the declaration argument should be put */ - int *decllnslot; /* Where the declaration linenumber is put */ - enum e_assoc declassoc; /* Assign this association to decl arguments */ - int preccounter; /* Assign this precedence to decl arguments */ - struct rule *firstrule; /* Pointer to first rule in the grammar */ - struct rule *lastrule; /* Pointer to the most recently parsed rule */ -}; - -/* Parse a single token */ -static void parseonetoken(psp) -struct pstate *psp; -{ - char *x; - x = Strsafe(psp->tokenstart); /* Save the token permanently */ -#if 0 - printf("%s:%d: Token=[%s] state=%d\n",psp->filename,psp->tokenlineno, - x,psp->state); -#endif - switch( psp->state ){ - case INITIALIZE: - psp->prevrule = 0; - psp->preccounter = 0; - psp->firstrule = psp->lastrule = 0; - psp->gp->nrule = 0; - /* Fall thru to next case */ - case WAITING_FOR_DECL_OR_RULE: - if( x[0]=='%' ){ - psp->state = WAITING_FOR_DECL_KEYWORD; - }else if( islower(x[0]) ){ - psp->lhs = Symbol_new(x); - psp->nrhs = 0; - psp->lhsalias = 0; - psp->state = WAITING_FOR_ARROW; - }else if( x[0]=='{' ){ - if( psp->prevrule==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"There is not prior rule opon which to attach the code \ -fragment which begins on this line."); - psp->errorcnt++; - }else if( psp->prevrule->code!=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"Code fragment beginning on this line is not the first \ -to follow the previous rule."); - psp->errorcnt++; - }else{ - psp->prevrule->line = psp->tokenlineno; - psp->prevrule->code = &x[1]; - } - }else if( x[0]=='[' ){ - psp->state = PRECEDENCE_MARK_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Token \"%s\" should be either \"%%\" or a nonterminal name.", - x); - psp->errorcnt++; - } - break; - case PRECEDENCE_MARK_1: - if( !isupper(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "The precedence symbol must be a terminal."); - psp->errorcnt++; - }else if( psp->prevrule==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "There is no prior rule to assign precedence \"[%s]\".",x); - psp->errorcnt++; - }else if( psp->prevrule->precsym!=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"Precedence mark on this line is not the first \ -to follow the previous rule."); - psp->errorcnt++; - }else{ - psp->prevrule->precsym = Symbol_new(x); - } - psp->state = PRECEDENCE_MARK_2; - break; - case PRECEDENCE_MARK_2: - if( x[0]!=']' ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \"]\" on precedence mark."); - psp->errorcnt++; - } - psp->state = WAITING_FOR_DECL_OR_RULE; - break; - case WAITING_FOR_ARROW: - if( x[0]==':' && x[1]==':' && x[2]=='=' ){ - psp->state = IN_RHS; - }else if( x[0]=='(' ){ - psp->state = LHS_ALIAS_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Expected to see a \":\" following the LHS symbol \"%s\".", - psp->lhs->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_1: - if( isalpha(x[0]) ){ - psp->lhsalias = x; - psp->state = LHS_ALIAS_2; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "\"%s\" is not a valid alias for the LHS \"%s\"\n", - x,psp->lhs->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_2: - if( x[0]==')' ){ - psp->state = LHS_ALIAS_3; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_3: - if( x[0]==':' && x[1]==':' && x[2]=='=' ){ - psp->state = IN_RHS; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \"->\" following: \"%s(%s)\".", - psp->lhs->name,psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case IN_RHS: - if( x[0]=='.' ){ - struct rule *rp; - rp = (struct rule *)malloc( sizeof(struct rule) + - sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs ); - if( rp==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Can't allocate enough memory for this rule."); - psp->errorcnt++; - psp->prevrule = 0; - }else{ - int i; - rp->ruleline = psp->tokenlineno; - rp->rhs = (struct symbol**)&rp[1]; - rp->rhsalias = (char**)&(rp->rhs[psp->nrhs]); - for(i=0; i<psp->nrhs; i++){ - rp->rhs[i] = psp->rhs[i]; - rp->rhsalias[i] = psp->alias[i]; - } - rp->lhs = psp->lhs; - rp->lhsalias = psp->lhsalias; - rp->nrhs = psp->nrhs; - rp->code = 0; - rp->precsym = 0; - rp->index = psp->gp->nrule++; - rp->nextlhs = rp->lhs->rule; - rp->lhs->rule = rp; - rp->next = 0; - if( psp->firstrule==0 ){ - psp->firstrule = psp->lastrule = rp; - }else{ - psp->lastrule->next = rp; - psp->lastrule = rp; - } - psp->prevrule = rp; - } - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( isalpha(x[0]) ){ - if( psp->nrhs>=MAXRHS ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Too many symbol on RHS or rule beginning at \"%s\".", - x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - }else{ - psp->rhs[psp->nrhs] = Symbol_new(x); - psp->alias[psp->nrhs] = 0; - psp->nrhs++; - } - }else if( x[0]=='(' && psp->nrhs>0 ){ - psp->state = RHS_ALIAS_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal character on RHS of rule: \"%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case RHS_ALIAS_1: - if( isalpha(x[0]) ){ - psp->alias[psp->nrhs-1] = x; - psp->state = RHS_ALIAS_2; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "\"%s\" is not a valid alias for the RHS symbol \"%s\"\n", - x,psp->rhs[psp->nrhs-1]->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case RHS_ALIAS_2: - if( x[0]==')' ){ - psp->state = IN_RHS; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case WAITING_FOR_DECL_KEYWORD: - if( isalpha(x[0]) ){ - psp->declkeyword = x; - psp->declargslot = 0; - psp->decllnslot = 0; - psp->state = WAITING_FOR_DECL_ARG; - if( strcmp(x,"name")==0 ){ - psp->declargslot = &(psp->gp->name); - }else if( strcmp(x,"include")==0 ){ - psp->declargslot = &(psp->gp->include); - psp->decllnslot = &psp->gp->includeln; - }else if( strcmp(x,"code")==0 ){ - psp->declargslot = &(psp->gp->extracode); - psp->decllnslot = &psp->gp->extracodeln; - }else if( strcmp(x,"token_destructor")==0 ){ - psp->declargslot = &psp->gp->tokendest; - psp->decllnslot = &psp->gp->tokendestln; - }else if( strcmp(x,"default_destructor")==0 ){ - psp->declargslot = &psp->gp->vardest; - psp->decllnslot = &psp->gp->vardestln; - }else if( strcmp(x,"token_prefix")==0 ){ - psp->declargslot = &psp->gp->tokenprefix; - }else if( strcmp(x,"syntax_error")==0 ){ - psp->declargslot = &(psp->gp->error); - psp->decllnslot = &psp->gp->errorln; - }else if( strcmp(x,"parse_accept")==0 ){ - psp->declargslot = &(psp->gp->accept); - psp->decllnslot = &psp->gp->acceptln; - }else if( strcmp(x,"parse_failure")==0 ){ - psp->declargslot = &(psp->gp->failure); - psp->decllnslot = &psp->gp->failureln; - }else if( strcmp(x,"stack_overflow")==0 ){ - psp->declargslot = &(psp->gp->overflow); - psp->decllnslot = &psp->gp->overflowln; - }else if( strcmp(x,"extra_argument")==0 ){ - psp->declargslot = &(psp->gp->arg); - }else if( strcmp(x,"token_type")==0 ){ - psp->declargslot = &(psp->gp->tokentype); - }else if( strcmp(x,"default_type")==0 ){ - psp->declargslot = &(psp->gp->vartype); - }else if( strcmp(x,"stack_size")==0 ){ - psp->declargslot = &(psp->gp->stacksize); - }else if( strcmp(x,"start_symbol")==0 ){ - psp->declargslot = &(psp->gp->start); - }else if( strcmp(x,"left")==0 ){ - psp->preccounter++; - psp->declassoc = LEFT; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"right")==0 ){ - psp->preccounter++; - psp->declassoc = RIGHT; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"nonassoc")==0 ){ - psp->preccounter++; - psp->declassoc = NONE; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"destructor")==0 ){ - psp->state = WAITING_FOR_DESTRUCTOR_SYMBOL; - }else if( strcmp(x,"type")==0 ){ - psp->state = WAITING_FOR_DATATYPE_SYMBOL; - }else if( strcmp(x,"fallback")==0 ){ - psp->fallback = 0; - psp->state = WAITING_FOR_FALLBACK_ID; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Unknown declaration keyword: \"%%%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal declaration keyword: \"%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - break; - case WAITING_FOR_DESTRUCTOR_SYMBOL: - if( !isalpha(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol name missing after %destructor keyword"); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - struct symbol *sp = Symbol_new(x); - psp->declargslot = &sp->destructor; - psp->decllnslot = &sp->destructorln; - psp->state = WAITING_FOR_DECL_ARG; - } - break; - case WAITING_FOR_DATATYPE_SYMBOL: - if( !isalpha(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol name missing after %destructor keyword"); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - struct symbol *sp = Symbol_new(x); - psp->declargslot = &sp->datatype; - psp->decllnslot = 0; - psp->state = WAITING_FOR_DECL_ARG; - } - break; - case WAITING_FOR_PRECEDENCE_SYMBOL: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( isupper(x[0]) ){ - struct symbol *sp; - sp = Symbol_new(x); - if( sp->prec>=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol \"%s\" has already be given a precedence.",x); - psp->errorcnt++; - }else{ - sp->prec = psp->preccounter; - sp->assoc = psp->declassoc; - } - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Can't assign a precedence to \"%s\".",x); - psp->errorcnt++; - } - break; - case WAITING_FOR_DECL_ARG: - if( (x[0]=='{' || x[0]=='\"' || isalnum(x[0])) ){ - if( *(psp->declargslot)!=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "The argument \"%s\" to declaration \"%%%s\" is not the first.", - x[0]=='\"' ? &x[1] : x,psp->declkeyword); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - *(psp->declargslot) = (x[0]=='\"' || x[0]=='{') ? &x[1] : x; - if( psp->decllnslot ) *psp->decllnslot = psp->tokenlineno; - psp->state = WAITING_FOR_DECL_OR_RULE; - } - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal argument to %%%s: %s",psp->declkeyword,x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - break; - case WAITING_FOR_FALLBACK_ID: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( !isupper(x[0]) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%fallback argument \"%s\" should be a token", x); - psp->errorcnt++; - }else{ - struct symbol *sp = Symbol_new(x); - if( psp->fallback==0 ){ - psp->fallback = sp; - }else if( sp->fallback ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "More than one fallback assigned to token %s", x); - psp->errorcnt++; - }else{ - sp->fallback = psp->fallback; - psp->gp->has_fallback = 1; - } - } - break; - case RESYNC_AFTER_RULE_ERROR: -/* if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; -** break; */ - case RESYNC_AFTER_DECL_ERROR: - if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; - if( x[0]=='%' ) psp->state = WAITING_FOR_DECL_KEYWORD; - break; - } -} - -/* Run the proprocessor over the input file text. The global variables -** azDefine[0] through azDefine[nDefine-1] contains the names of all defined -** macros. This routine looks for "%ifdef" and "%ifndef" and "%endif" and -** comments them out. Text in between is also commented out as appropriate. -*/ -static void preprocess_input(char *z){ - int i, j, k, n; - int exclude = 0; - int start; - int lineno = 1; - int start_lineno; - for(i=0; z[i]; i++){ - if( z[i]=='\n' ) lineno++; - if( z[i]!='%' || (i>0 && z[i-1]!='\n') ) continue; - if( strncmp(&z[i],"%endif",6)==0 && isspace(z[i+6]) ){ - if( exclude ){ - exclude--; - if( exclude==0 ){ - for(j=start; j<i; j++) if( z[j]!='\n' ) z[j] = ' '; - } - } - for(j=i; z[j] && z[j]!='\n'; j++) z[j] = ' '; - }else if( (strncmp(&z[i],"%ifdef",6)==0 && isspace(z[i+6])) - || (strncmp(&z[i],"%ifndef",7)==0 && isspace(z[i+7])) ){ - if( exclude ){ - exclude++; - }else{ - for(j=i+7; isspace(z[j]); j++){} - for(n=0; z[j+n] && !isspace(z[j+n]); n++){} - exclude = 1; - for(k=0; k<nDefine; k++){ - if( strncmp(azDefine[k],&z[j],n)==0 && strlen(azDefine[k])==n ){ - exclude = 0; - break; - } - } - if( z[i+3]=='n' ) exclude = !exclude; - if( exclude ){ - start = i; - start_lineno = lineno; - } - } - for(j=i; z[j] && z[j]!='\n'; j++) z[j] = ' '; - } - } - if( exclude ){ - fprintf(stderr,"unterminated %%ifdef starting on line %d\n", start_lineno); - exit(1); - } -} - -/* In spite of its name, this function is really a scanner. It read -** in the entire input file (all at once) then tokenizes it. Each -** token is passed to the function "parseonetoken" which builds all -** the appropriate data structures in the global state vector "gp". -*/ -void Parse(gp) -struct lemon *gp; -{ - struct pstate ps; - FILE *fp; - char *filebuf; - int filesize; - int lineno; - int c; - char *cp, *nextcp; - int startline = 0; - - ps.gp = gp; - ps.filename = gp->filename; - ps.errorcnt = 0; - ps.state = INITIALIZE; - - /* Begin by reading the input file */ - fp = fopen(ps.filename,"rb"); - if( fp==0 ){ - ErrorMsg(ps.filename,0,"Can't open this file for reading."); - gp->errorcnt++; - return; - } - fseek(fp,0,2); - filesize = ftell(fp); - rewind(fp); - filebuf = (char *)malloc( filesize+1 ); - if( filebuf==0 ){ - ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.", - filesize+1); - gp->errorcnt++; - return; - } - if( fread(filebuf,1,filesize,fp)!=filesize ){ - ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.", - filesize); - free(filebuf); - gp->errorcnt++; - return; - } - fclose(fp); - filebuf[filesize] = 0; - - /* Make an initial pass through the file to handle %ifdef and %ifndef */ - preprocess_input(filebuf); - - /* Now scan the text of the input file */ - lineno = 1; - for(cp=filebuf; (c= *cp)!=0; ){ - if( c=='\n' ) lineno++; /* Keep track of the line number */ - if( isspace(c) ){ cp++; continue; } /* Skip all white space */ - if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments */ - cp+=2; - while( (c= *cp)!=0 && c!='\n' ) cp++; - continue; - } - if( c=='/' && cp[1]=='*' ){ /* Skip C style comments */ - cp+=2; - while( (c= *cp)!=0 && (c!='/' || cp[-1]!='*') ){ - if( c=='\n' ) lineno++; - cp++; - } - if( c ) cp++; - continue; - } - ps.tokenstart = cp; /* Mark the beginning of the token */ - ps.tokenlineno = lineno; /* Linenumber on which token begins */ - if( c=='\"' ){ /* String literals */ - cp++; - while( (c= *cp)!=0 && c!='\"' ){ - if( c=='\n' ) lineno++; - cp++; - } - if( c==0 ){ - ErrorMsg(ps.filename,startline, -"String starting on this line is not terminated before the end of the file."); - ps.errorcnt++; - nextcp = cp; - }else{ - nextcp = cp+1; - } - }else if( c=='{' ){ /* A block of C code */ - int level; - cp++; - for(level=1; (c= *cp)!=0 && (level>1 || c!='}'); cp++){ - if( c=='\n' ) lineno++; - else if( c=='{' ) level++; - else if( c=='}' ) level--; - else if( c=='/' && cp[1]=='*' ){ /* Skip comments */ - int prevc; - cp = &cp[2]; - prevc = 0; - while( (c= *cp)!=0 && (c!='/' || prevc!='*') ){ - if( c=='\n' ) lineno++; - prevc = c; - cp++; - } - }else if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments too */ - cp = &cp[2]; - while( (c= *cp)!=0 && c!='\n' ) cp++; - if( c ) lineno++; - }else if( c=='\'' || c=='\"' ){ /* String a character literals */ - int startchar, prevc; - startchar = c; - prevc = 0; - for(cp++; (c= *cp)!=0 && (c!=startchar || prevc=='\\'); cp++){ - if( c=='\n' ) lineno++; - if( prevc=='\\' ) prevc = 0; - else prevc = c; - } - } - } - if( c==0 ){ - ErrorMsg(ps.filename,ps.tokenlineno, -"C code starting on this line is not terminated before the end of the file."); - ps.errorcnt++; - nextcp = cp; - }else{ - nextcp = cp+1; - } - }else if( isalnum(c) ){ /* Identifiers */ - while( (c= *cp)!=0 && (isalnum(c) || c=='_') ) cp++; - nextcp = cp; - }else if( c==':' && cp[1]==':' && cp[2]=='=' ){ /* The operator "::=" */ - cp += 3; - nextcp = cp; - }else{ /* All other (one character) operators */ - cp++; - nextcp = cp; - } - c = *cp; - *cp = 0; /* Null terminate the token */ - parseonetoken(&ps); /* Parse the token */ - *cp = c; /* Restore the buffer */ - cp = nextcp; - } - free(filebuf); /* Release the buffer after parsing */ - gp->rule = ps.firstrule; - gp->errorcnt = ps.errorcnt; -} -/*************************** From the file "plink.c" *********************/ -/* -** Routines processing configuration follow-set propagation links -** in the LEMON parser generator. -*/ -static struct plink *plink_freelist = 0; - -/* Allocate a new plink */ -struct plink *Plink_new(){ - struct plink *new; - - if( plink_freelist==0 ){ - int i; - int amt = 100; - plink_freelist = (struct plink *)malloc( sizeof(struct plink)*amt ); - if( plink_freelist==0 ){ - fprintf(stderr, - "Unable to allocate memory for a new follow-set propagation link.\n"); - exit(1); - } - for(i=0; i<amt-1; i++) plink_freelist[i].next = &plink_freelist[i+1]; - plink_freelist[amt-1].next = 0; - } - new = plink_freelist; - plink_freelist = plink_freelist->next; - return new; -} - -/* Add a plink to a plink list */ -void Plink_add(plpp,cfp) -struct plink **plpp; -struct config *cfp; -{ - struct plink *new; - new = Plink_new(); - new->next = *plpp; - *plpp = new; - new->cfp = cfp; -} - -/* Transfer every plink on the list "from" to the list "to" */ -void Plink_copy(to,from) -struct plink **to; -struct plink *from; -{ - struct plink *nextpl; - while( from ){ - nextpl = from->next; - from->next = *to; - *to = from; - from = nextpl; - } -} - -/* Delete every plink on the list */ -void Plink_delete(plp) -struct plink *plp; -{ - struct plink *nextpl; - - while( plp ){ - nextpl = plp->next; - plp->next = plink_freelist; - plink_freelist = plp; - plp = nextpl; - } -} -/*********************** From the file "report.c" **************************/ -/* -** Procedures for generating reports and tables in the LEMON parser generator. -*/ - -/* Generate a filename with the given suffix. Space to hold the -** name comes from malloc() and must be freed by the calling -** function. -*/ -PRIVATE char *file_makename(lemp,suffix) -struct lemon *lemp; -char *suffix; -{ - char *name; - char *cp; - - name = malloc( strlen(lemp->filename) + strlen(suffix) + 5 ); - if( name==0 ){ - fprintf(stderr,"Can't allocate space for a filename.\n"); - exit(1); - } - strcpy(name,lemp->filename); - cp = strrchr(name,'.'); - if( cp ) *cp = 0; - strcat(name,suffix); - return name; -} - -/* Open a file with a name based on the name of the input file, -** but with a different (specified) suffix, and return a pointer -** to the stream */ -PRIVATE FILE *file_open(lemp,suffix,mode) -struct lemon *lemp; -char *suffix; -char *mode; -{ - FILE *fp; - - if( lemp->outname ) free(lemp->outname); - lemp->outname = file_makename(lemp, suffix); - fp = fopen(lemp->outname,mode); - if( fp==0 && *mode=='w' ){ - fprintf(stderr,"Can't open file \"%s\".\n",lemp->outname); - lemp->errorcnt++; - return 0; - } - return fp; -} - -/* Duplicate the input file without comments and without actions -** on rules */ -void Reprint(lemp) -struct lemon *lemp; -{ - struct rule *rp; - struct symbol *sp; - int i, j, maxlen, len, ncolumns, skip; - printf("// Reprint of input file \"%s\".\n// Symbols:\n",lemp->filename); - maxlen = 10; - for(i=0; i<lemp->nsymbol; i++){ - sp = lemp->symbols[i]; - len = strlen(sp->name); - if( len>maxlen ) maxlen = len; - } - ncolumns = 76/(maxlen+5); - if( ncolumns<1 ) ncolumns = 1; - skip = (lemp->nsymbol + ncolumns - 1)/ncolumns; - for(i=0; i<skip; i++){ - printf("//"); - for(j=i; j<lemp->nsymbol; j+=skip){ - sp = lemp->symbols[j]; - assert( sp->index==j ); - printf(" %3d %-*.*s",j,maxlen,maxlen,sp->name); - } - printf("\n"); - } - for(rp=lemp->rule; rp; rp=rp->next){ - printf("%s",rp->lhs->name); -/* if( rp->lhsalias ) printf("(%s)",rp->lhsalias); */ - printf(" ::="); - for(i=0; i<rp->nrhs; i++){ - printf(" %s",rp->rhs[i]->name); -/* if( rp->rhsalias[i] ) printf("(%s)",rp->rhsalias[i]); */ - } - printf("."); - if( rp->precsym ) printf(" [%s]",rp->precsym->name); -/* if( rp->code ) printf("\n %s",rp->code); */ - printf("\n"); - } -} - -void ConfigPrint(fp,cfp) -FILE *fp; -struct config *cfp; -{ - struct rule *rp; - int i; - rp = cfp->rp; - fprintf(fp,"%s ::=",rp->lhs->name); - for(i=0; i<=rp->nrhs; i++){ - if( i==cfp->dot ) fprintf(fp," *"); - if( i==rp->nrhs ) break; - fprintf(fp," %s",rp->rhs[i]->name); - } -} - -/* #define TEST */ -#ifdef TEST -/* Print a set */ -PRIVATE void SetPrint(out,set,lemp) -FILE *out; -char *set; -struct lemon *lemp; -{ - int i; - char *spacer; - spacer = ""; - fprintf(out,"%12s[",""); - for(i=0; i<lemp->nterminal; i++){ - if( SetFind(set,i) ){ - fprintf(out,"%s%s",spacer,lemp->symbols[i]->name); - spacer = " "; - } - } - fprintf(out,"]\n"); -} - -/* Print a plink chain */ -PRIVATE void PlinkPrint(out,plp,tag) -FILE *out; -struct plink *plp; -char *tag; -{ - while( plp ){ - fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index); - ConfigPrint(out,plp->cfp); - fprintf(out,"\n"); - plp = plp->next; - } -} -#endif - -/* Print an action to the given file descriptor. Return FALSE if -** nothing was actually printed. -*/ -int PrintAction(struct action *ap, FILE *fp, int indent){ - int result = 1; - switch( ap->type ){ - case SHIFT: - fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->index); - break; - case REDUCE: - fprintf(fp,"%*s reduce %d",indent,ap->sp->name,ap->x.rp->index); - break; - case ACCEPT: - fprintf(fp,"%*s accept",indent,ap->sp->name); - break; - case ERROR: - fprintf(fp,"%*s error",indent,ap->sp->name); - break; - case CONFLICT: - fprintf(fp,"%*s reduce %-3d ** Parsing conflict **", - indent,ap->sp->name,ap->x.rp->index); - break; - case SH_RESOLVED: - case RD_RESOLVED: - case NOT_USED: - result = 0; - break; - } - return result; -} - -/* Generate the "y.output" log file */ -void ReportOutput(lemp) -struct lemon *lemp; -{ - int i; - struct state *stp; - struct config *cfp; - struct action *ap; - FILE *fp; - - fp = file_open(lemp,".out","wb"); - if( fp==0 ) return; - fprintf(fp," \b"); - for(i=0; i<lemp->nstate; i++){ - stp = lemp->sorted[i]; - fprintf(fp,"State %d:\n",stp->index); - if( lemp->basisflag ) cfp=stp->bp; - else cfp=stp->cfp; - while( cfp ){ - char buf[20]; - if( cfp->dot==cfp->rp->nrhs ){ - sprintf(buf,"(%d)",cfp->rp->index); - fprintf(fp," %5s ",buf); - }else{ - fprintf(fp," "); - } - ConfigPrint(fp,cfp); - fprintf(fp,"\n"); -#ifdef TEST - SetPrint(fp,cfp->fws,lemp); - PlinkPrint(fp,cfp->fplp,"To "); - PlinkPrint(fp,cfp->bplp,"From"); -#endif - if( lemp->basisflag ) cfp=cfp->bp; - else cfp=cfp->next; - } - fprintf(fp,"\n"); - for(ap=stp->ap; ap; ap=ap->next){ - if( PrintAction(ap,fp,30) ) fprintf(fp,"\n"); - } - fprintf(fp,"\n"); - } - fclose(fp); - return; -} - -/* Search for the file "name" which is in the same directory as -** the exacutable */ -PRIVATE char *pathsearch(argv0,name,modemask) -char *argv0; -char *name; -int modemask; -{ - char *pathlist; - char *path,*cp; - char c; - extern int access(); - -#ifdef __WIN32__ - cp = strrchr(argv0,'\\'); -#else - cp = strrchr(argv0,'/'); -#endif - if( cp ){ - c = *cp; - *cp = 0; - path = (char *)malloc( strlen(argv0) + strlen(name) + 2 ); - if( path ) sprintf(path,"%s/%s",argv0,name); - *cp = c; - }else{ - extern char *getenv(); - pathlist = getenv("PATH"); - if( pathlist==0 ) pathlist = ".:/bin:/usr/bin"; - path = (char *)malloc( strlen(pathlist)+strlen(name)+2 ); - if( path!=0 ){ - while( *pathlist ){ - cp = strchr(pathlist,':'); - if( cp==0 ) cp = &pathlist[strlen(pathlist)]; - c = *cp; - *cp = 0; - sprintf(path,"%s/%s",pathlist,name); - *cp = c; - if( c==0 ) pathlist = ""; - else pathlist = &cp[1]; - if( access(path,modemask)==0 ) break; - } - } - } - return path; -} - -/* Given an action, compute the integer value for that action -** which is to be put in the action table of the generated machine. -** Return negative if no action should be generated. -*/ -PRIVATE int compute_action(lemp,ap) -struct lemon *lemp; -struct action *ap; -{ - int act; - switch( ap->type ){ - case SHIFT: act = ap->x.stp->index; break; - case REDUCE: act = ap->x.rp->index + lemp->nstate; break; - case ERROR: act = lemp->nstate + lemp->nrule; break; - case ACCEPT: act = lemp->nstate + lemp->nrule + 1; break; - default: act = -1; break; - } - return act; -} - -#define LINESIZE 1000 -/* The next cluster of routines are for reading the template file -** and writing the results to the generated parser */ -/* The first function transfers data from "in" to "out" until -** a line is seen which begins with "%%". The line number is -** tracked. -** -** if name!=0, then any word that begin with "Parse" is changed to -** begin with *name instead. -*/ -PRIVATE void tplt_xfer(name,in,out,lineno) -char *name; -FILE *in; -FILE *out; -int *lineno; -{ - int i, iStart; - char line[LINESIZE]; - while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){ - (*lineno)++; - iStart = 0; - if( name ){ - for(i=0; line[i]; i++){ - if( line[i]=='P' && strncmp(&line[i],"Parse",5)==0 - && (i==0 || !isalpha(line[i-1])) - ){ - if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]); - fprintf(out,"%s",name); - i += 4; - iStart = i+1; - } - } - } - fprintf(out,"%s",&line[iStart]); - } -} - -/* The next function finds the template file and opens it, returning -** a pointer to the opened file. */ -PRIVATE FILE *tplt_open(lemp) -struct lemon *lemp; -{ - static char templatename[] = "lempar.c"; - char buf[1000]; - FILE *in; - char *tpltname; - char *cp; - - cp = strrchr(lemp->filename,'.'); - if( cp ){ - sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); - }else{ - sprintf(buf,"%s.lt",lemp->filename); - } - if( access(buf,004)==0 ){ - tpltname = buf; - }else if( access(templatename,004)==0 ){ - tpltname = templatename; - }else{ - tpltname = pathsearch(lemp->argv0,templatename,0); - } - if( tpltname==0 ){ - fprintf(stderr,"Can't find the parser driver template file \"%s\".\n", - templatename); - lemp->errorcnt++; - return 0; - } - in = fopen(tpltname,"rb"); - if( in==0 ){ - fprintf(stderr,"Can't open the template file \"%s\".\n",templatename); - lemp->errorcnt++; - return 0; - } - return in; -} - -/* Print a #line directive line to the output file. */ -PRIVATE void tplt_linedir(out,lineno,filename) -FILE *out; -int lineno; -char *filename; -{ - fprintf(out,"#line %d \"",lineno); - while( *filename ){ - if( *filename == '\\' ) putc('\\',out); - putc(*filename,out); - filename++; - } - fprintf(out,"\"\n"); -} - -/* Print a string to the file and keep the linenumber up to date */ -PRIVATE void tplt_print(out,lemp,str,strln,lineno) -FILE *out; -struct lemon *lemp; -char *str; -int strln; -int *lineno; -{ - if( str==0 ) return; - tplt_linedir(out,strln,lemp->filename); - (*lineno)++; - while( *str ){ - if( *str=='\n' ) (*lineno)++; - putc(*str,out); - str++; - } - if( str[-1]!='\n' ){ - putc('\n',out); - (*lineno)++; - } - tplt_linedir(out,*lineno+2,lemp->outname); - (*lineno)+=2; - return; -} - -/* -** The following routine emits code for the destructor for the -** symbol sp -*/ -void emit_destructor_code(out,sp,lemp,lineno) -FILE *out; -struct symbol *sp; -struct lemon *lemp; -int *lineno; -{ - char *cp = 0; - - int linecnt = 0; - if( sp->type==TERMINAL ){ - cp = lemp->tokendest; - if( cp==0 ) return; - tplt_linedir(out,lemp->tokendestln,lemp->filename); - fprintf(out,"{"); - }else if( sp->destructor ){ - cp = sp->destructor; - tplt_linedir(out,sp->destructorln,lemp->filename); - fprintf(out,"{"); - }else if( lemp->vardest ){ - cp = lemp->vardest; - if( cp==0 ) return; - tplt_linedir(out,lemp->vardestln,lemp->filename); - fprintf(out,"{"); - }else{ - assert( 0 ); /* Cannot happen */ - } - for(; *cp; cp++){ - if( *cp=='$' && cp[1]=='$' ){ - fprintf(out,"(yypminor->yy%d)",sp->dtnum); - cp++; - continue; - } - if( *cp=='\n' ) linecnt++; - fputc(*cp,out); - } - (*lineno) += 3 + linecnt; - fprintf(out,"}\n"); - tplt_linedir(out,*lineno,lemp->outname); - return; -} - -/* -** Return TRUE (non-zero) if the given symbol has a destructor. -*/ -int has_destructor(sp, lemp) -struct symbol *sp; -struct lemon *lemp; -{ - int ret; - if( sp->type==TERMINAL ){ - ret = lemp->tokendest!=0; - }else{ - ret = lemp->vardest!=0 || sp->destructor!=0; - } - return ret; -} - -/* -** Append text to a dynamically allocated string. If zText is 0 then -** reset the string to be empty again. Always return the complete text -** of the string (which is overwritten with each call). -** -** n bytes of zText are stored. If n==0 then all of zText up to the first -** \000 terminator is stored. zText can contain up to two instances of -** %d. The values of p1 and p2 are written into the first and second -** %d. -** -** If n==-1, then the previous character is overwritten. -*/ -PRIVATE char *append_str(char *zText, int n, int p1, int p2){ - static char *z = 0; - static int alloced = 0; - static int used = 0; - int c; - char zInt[40]; - - if( zText==0 ){ - used = 0; - return z; - } - if( n<=0 ){ - if( n<0 ){ - used += n; - assert( used>=0 ); - } - n = strlen(zText); - } - if( n+sizeof(zInt)*2+used >= alloced ){ - alloced = n + sizeof(zInt)*2 + used + 200; - z = realloc(z, alloced); - } - if( z==0 ) return ""; - while( n-- > 0 ){ - c = *(zText++); - if( c=='%' && zText[0]=='d' ){ - sprintf(zInt, "%d", p1); - p1 = p2; - strcpy(&z[used], zInt); - used += strlen(&z[used]); - zText++; - n--; - }else{ - z[used++] = c; - } - } - z[used] = 0; - return z; -} - -/* -** zCode is a string that is the action associated with a rule. Expand -** the symbols in this string so that the refer to elements of the parser -** stack. -*/ -PRIVATE void translate_code(struct lemon *lemp, struct rule *rp){ - char *cp, *xp; - int i; - char lhsused = 0; /* True if the LHS element has been used */ - char used[MAXRHS]; /* True for each RHS element which is used */ - - for(i=0; i<rp->nrhs; i++) used[i] = 0; - lhsused = 0; - - append_str(0,0,0,0); - for(cp=rp->code; *cp; cp++){ - if( isalpha(*cp) && (cp==rp->code || (!isalnum(cp[-1]) && cp[-1]!='_')) ){ - char saved; - for(xp= &cp[1]; isalnum(*xp) || *xp=='_'; xp++); - saved = *xp; - *xp = 0; - if( rp->lhsalias && strcmp(cp,rp->lhsalias)==0 ){ - append_str("yygotominor.yy%d",0,rp->lhs->dtnum,0); - cp = xp; - lhsused = 1; - }else{ - for(i=0; i<rp->nrhs; i++){ - if( rp->rhsalias[i] && strcmp(cp,rp->rhsalias[i])==0 ){ - if( cp!=rp->code && cp[-1]=='@' ){ - /* If the argument is of the form @X then substituted - ** the token number of X, not the value of X */ - append_str("yymsp[%d].major",-1,i-rp->nrhs+1,0); - }else{ - append_str("yymsp[%d].minor.yy%d",0, - i-rp->nrhs+1,rp->rhs[i]->dtnum); - } - cp = xp; - used[i] = 1; - break; - } - } - } - *xp = saved; - } - append_str(cp, 1, 0, 0); - } /* End loop */ - - /* Check to make sure the LHS has been used */ - if( rp->lhsalias && !lhsused ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label \"%s\" for \"%s(%s)\" is never used.", - rp->lhsalias,rp->lhs->name,rp->lhsalias); - lemp->errorcnt++; - } - - /* Generate destructor code for RHS symbols which are not used in the - ** reduce code */ - for(i=0; i<rp->nrhs; i++){ - if( rp->rhsalias[i] && !used[i] ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label %s for \"%s(%s)\" is never used.", - rp->rhsalias[i],rp->rhs[i]->name,rp->rhsalias[i]); - lemp->errorcnt++; - }else if( rp->rhsalias[i]==0 ){ - if( has_destructor(rp->rhs[i],lemp) ){ - append_str(" yy_destructor(%d,&yymsp[%d].minor);\n", 0, - rp->rhs[i]->index,i-rp->nrhs+1); - }else{ - /* No destructor defined for this term */ - } - } - } - cp = append_str(0,0,0,0); - rp->code = Strsafe(cp); -} - -/* -** Generate code which executes when the rule "rp" is reduced. Write -** the code to "out". Make sure lineno stays up-to-date. -*/ -PRIVATE void emit_code(out,rp,lemp,lineno) -FILE *out; -struct rule *rp; -struct lemon *lemp; -int *lineno; -{ - char *cp; - int linecnt = 0; - - /* Generate code to do the reduce action */ - if( rp->code ){ - tplt_linedir(out,rp->line,lemp->filename); - fprintf(out,"{%s",rp->code); - for(cp=rp->code; *cp; cp++){ - if( *cp=='\n' ) linecnt++; - } /* End loop */ - (*lineno) += 3 + linecnt; - fprintf(out,"}\n"); - tplt_linedir(out,*lineno,lemp->outname); - } /* End if( rp->code ) */ - - return; -} - -/* -** Print the definition of the union used for the parser's data stack. -** This union contains fields for every possible data type for tokens -** and nonterminals. In the process of computing and printing this -** union, also set the ".dtnum" field of every terminal and nonterminal -** symbol. -*/ -void print_stack_union(out,lemp,plineno,mhflag) -FILE *out; /* The output stream */ -struct lemon *lemp; /* The main info structure for this parser */ -int *plineno; /* Pointer to the line number */ -int mhflag; /* True if generating makeheaders output */ -{ - int lineno = *plineno; /* The line number of the output */ - char **types; /* A hash table of datatypes */ - int arraysize; /* Size of the "types" array */ - int maxdtlength; /* Maximum length of any ".datatype" field. */ - char *stddt; /* Standardized name for a datatype */ - int i,j; /* Loop counters */ - int hash; /* For hashing the name of a type */ - char *name; /* Name of the parser */ - - /* Allocate and initialize types[] and allocate stddt[] */ - arraysize = lemp->nsymbol * 2; - types = (char**)malloc( arraysize * sizeof(char*) ); - for(i=0; i<arraysize; i++) types[i] = 0; - maxdtlength = 0; - if( lemp->vartype ){ - maxdtlength = strlen(lemp->vartype); - } - for(i=0; i<lemp->nsymbol; i++){ - int len; - struct symbol *sp = lemp->symbols[i]; - if( sp->datatype==0 ) continue; - len = strlen(sp->datatype); - if( len>maxdtlength ) maxdtlength = len; - } - stddt = (char*)malloc( maxdtlength*2 + 1 ); - if( types==0 || stddt==0 ){ - fprintf(stderr,"Out of memory.\n"); - exit(1); - } - - /* Build a hash table of datatypes. The ".dtnum" field of each symbol - ** is filled in with the hash index plus 1. A ".dtnum" value of 0 is - ** used for terminal symbols. If there is no %default_type defined then - ** 0 is also used as the .dtnum value for nonterminals which do not specify - ** a datatype using the %type directive. - */ - for(i=0; i<lemp->nsymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - char *cp; - if( sp==lemp->errsym ){ - sp->dtnum = arraysize+1; - continue; - } - if( sp->type!=NONTERMINAL || (sp->datatype==0 && lemp->vartype==0) ){ - sp->dtnum = 0; - continue; - } - cp = sp->datatype; - if( cp==0 ) cp = lemp->vartype; - j = 0; - while( isspace(*cp) ) cp++; - while( *cp ) stddt[j++] = *cp++; - while( j>0 && isspace(stddt[j-1]) ) j--; - stddt[j] = 0; - hash = 0; - for(j=0; stddt[j]; j++){ - hash = hash*53 + stddt[j]; - } - hash = (hash & 0x7fffffff)%arraysize; - while( types[hash] ){ - if( strcmp(types[hash],stddt)==0 ){ - sp->dtnum = hash + 1; - break; - } - hash++; - if( hash>=arraysize ) hash = 0; - } - if( types[hash]==0 ){ - sp->dtnum = hash + 1; - types[hash] = (char*)malloc( strlen(stddt)+1 ); - if( types[hash]==0 ){ - fprintf(stderr,"Out of memory.\n"); - exit(1); - } - strcpy(types[hash],stddt); - } - } - - /* Print out the definition of YYTOKENTYPE and YYMINORTYPE */ - name = lemp->name ? lemp->name : "Parse"; - lineno = *plineno; - if( mhflag ){ fprintf(out,"#if INTERFACE\n"); lineno++; } - fprintf(out,"#define %sTOKENTYPE %s\n",name, - lemp->tokentype?lemp->tokentype:"void*"); lineno++; - if( mhflag ){ fprintf(out,"#endif\n"); lineno++; } - fprintf(out,"typedef union {\n"); lineno++; - fprintf(out," %sTOKENTYPE yy0;\n",name); lineno++; - for(i=0; i<arraysize; i++){ - if( types[i]==0 ) continue; - fprintf(out," %s yy%d;\n",types[i],i+1); lineno++; - free(types[i]); - } - fprintf(out," int yy%d;\n",lemp->errsym->dtnum); lineno++; - free(stddt); - free(types); - fprintf(out,"} YYMINORTYPE;\n"); lineno++; - *plineno = lineno; -} - -/* -** Return the name of a C datatype able to represent values between -** lwr and upr, inclusive. -*/ -static const char *minimum_size_type(int lwr, int upr){ - if( lwr>=0 ){ - if( upr<=255 ){ - return "unsigned char"; - }else if( upr<65535 ){ - return "unsigned short int"; - }else{ - return "unsigned int"; - } - }else if( lwr>=-127 && upr<=127 ){ - return "signed char"; - }else if( lwr>=-32767 && upr<32767 ){ - return "short"; - }else{ - return "int"; - } -} - -/* -** Each state contains a set of token transaction and a set of -** nonterminal transactions. Each of these sets makes an instance -** of the following structure. An array of these structures is used -** to order the creation of entries in the yy_action[] table. -*/ -struct axset { - struct state *stp; /* A pointer to a state */ - int isTkn; /* True to use tokens. False for non-terminals */ - int nAction; /* Number of actions */ -}; - -/* -** Compare to axset structures for sorting purposes -*/ -static int axset_compare(const void *a, const void *b){ - struct axset *p1 = (struct axset*)a; - struct axset *p2 = (struct axset*)b; - return p2->nAction - p1->nAction; -} - -/* Generate C source code for the parser */ -void ReportTable(lemp, mhflag) -struct lemon *lemp; -int mhflag; /* Output in makeheaders format if true */ -{ - FILE *out, *in; - char line[LINESIZE]; - int lineno; - struct state *stp; - struct action *ap; - struct rule *rp; - struct acttab *pActtab; - int i, j, n; - char *name; - int mnTknOfst, mxTknOfst; - int mnNtOfst, mxNtOfst; - struct axset *ax; - - in = tplt_open(lemp); - if( in==0 ) return; - out = file_open(lemp,".c","wb"); - if( out==0 ){ - fclose(in); - return; - } - lineno = 1; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the include code, if any */ - tplt_print(out,lemp,lemp->include,lemp->includeln,&lineno); - if( mhflag ){ - char *name = file_makename(lemp, ".h"); - fprintf(out,"#include \"%s\"\n", name); lineno++; - free(name); - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate #defines for all tokens */ - if( mhflag ){ - char *prefix; - fprintf(out,"#if INTERFACE\n"); lineno++; - if( lemp->tokenprefix ) prefix = lemp->tokenprefix; - else prefix = ""; - for(i=1; i<lemp->nterminal; i++){ - fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); - lineno++; - } - fprintf(out,"#endif\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the defines */ - fprintf(out,"#define YYCODETYPE %s\n", - minimum_size_type(0, lemp->nsymbol+5)); lineno++; - fprintf(out,"#define YYNOCODE %d\n",lemp->nsymbol+1); lineno++; - fprintf(out,"#define YYACTIONTYPE %s\n", - minimum_size_type(0, lemp->nstate+lemp->nrule+5)); lineno++; - print_stack_union(out,lemp,&lineno,mhflag); - if( lemp->stacksize ){ - if( atoi(lemp->stacksize)<=0 ){ - ErrorMsg(lemp->filename,0, -"Illegal stack size: [%s]. The stack size should be an integer constant.", - lemp->stacksize); - lemp->errorcnt++; - lemp->stacksize = "100"; - } - fprintf(out,"#define YYSTACKDEPTH %s\n",lemp->stacksize); lineno++; - }else{ - fprintf(out,"#define YYSTACKDEPTH 100\n"); lineno++; - } - if( mhflag ){ - fprintf(out,"#if INTERFACE\n"); lineno++; - } - name = lemp->name ? lemp->name : "Parse"; - if( lemp->arg && lemp->arg[0] ){ - int i; - i = strlen(lemp->arg); - while( i>=1 && isspace(lemp->arg[i-1]) ) i--; - while( i>=1 && (isalnum(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--; - fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg); lineno++; - fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg); lineno++; - fprintf(out,"#define %sARG_FETCH %s = yypParser->%s\n", - name,lemp->arg,&lemp->arg[i]); lineno++; - fprintf(out,"#define %sARG_STORE yypParser->%s = %s\n", - name,&lemp->arg[i],&lemp->arg[i]); lineno++; - }else{ - fprintf(out,"#define %sARG_SDECL\n",name); lineno++; - fprintf(out,"#define %sARG_PDECL\n",name); lineno++; - fprintf(out,"#define %sARG_FETCH\n",name); lineno++; - fprintf(out,"#define %sARG_STORE\n",name); lineno++; - } - if( mhflag ){ - fprintf(out,"#endif\n"); lineno++; - } - fprintf(out,"#define YYNSTATE %d\n",lemp->nstate); lineno++; - fprintf(out,"#define YYNRULE %d\n",lemp->nrule); lineno++; - fprintf(out,"#define YYERRORSYMBOL %d\n",lemp->errsym->index); lineno++; - fprintf(out,"#define YYERRSYMDT yy%d\n",lemp->errsym->dtnum); lineno++; - if( lemp->has_fallback ){ - fprintf(out,"#define YYFALLBACK 1\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the action table and its associates: - ** - ** yy_action[] A single table containing all actions. - ** yy_lookahead[] A table containing the lookahead for each entry in - ** yy_action. Used to detect hash collisions. - ** yy_shift_ofst[] For each state, the offset into yy_action for - ** shifting terminals. - ** yy_reduce_ofst[] For each state, the offset into yy_action for - ** shifting non-terminals after a reduce. - ** yy_default[] Default action for each state. - */ - - /* Compute the actions on all states and count them up */ - ax = malloc( sizeof(ax[0])*lemp->nstate*2 ); - if( ax==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - for(i=0; i<lemp->nstate; i++){ - stp = lemp->sorted[i]; - stp->nTknAct = stp->nNtAct = 0; - stp->iDflt = lemp->nstate + lemp->nrule; - stp->iTknOfst = NO_OFFSET; - stp->iNtOfst = NO_OFFSET; - for(ap=stp->ap; ap; ap=ap->next){ - if( compute_action(lemp,ap)>=0 ){ - if( ap->sp->index<lemp->nterminal ){ - stp->nTknAct++; - }else if( ap->sp->index<lemp->nsymbol ){ - stp->nNtAct++; - }else{ - stp->iDflt = compute_action(lemp, ap); - } - } - } - ax[i*2].stp = stp; - ax[i*2].isTkn = 1; - ax[i*2].nAction = stp->nTknAct; - ax[i*2+1].stp = stp; - ax[i*2+1].isTkn = 0; - ax[i*2+1].nAction = stp->nNtAct; - } - mxTknOfst = mnTknOfst = 0; - mxNtOfst = mnNtOfst = 0; - - /* Compute the action table. In order to try to keep the size of the - ** action table to a minimum, the heuristic of placing the largest action - ** sets first is used. - */ - qsort(ax, lemp->nstate*2, sizeof(ax[0]), axset_compare); - pActtab = acttab_alloc(); - for(i=0; i<lemp->nstate*2 && ax[i].nAction>0; i++){ - stp = ax[i].stp; - if( ax[i].isTkn ){ - for(ap=stp->ap; ap; ap=ap->next){ - int action; - if( ap->sp->index>=lemp->nterminal ) continue; - action = compute_action(lemp, ap); - if( action<0 ) continue; - acttab_action(pActtab, ap->sp->index, action); - } - stp->iTknOfst = acttab_insert(pActtab); - if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst; - if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst; - }else{ - for(ap=stp->ap; ap; ap=ap->next){ - int action; - if( ap->sp->index<lemp->nterminal ) continue; - if( ap->sp->index==lemp->nsymbol ) continue; - action = compute_action(lemp, ap); - if( action<0 ) continue; - acttab_action(pActtab, ap->sp->index, action); - } - stp->iNtOfst = acttab_insert(pActtab); - if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst; - if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst; - } - } - free(ax); - - /* Output the yy_action table */ - fprintf(out,"static const YYACTIONTYPE yy_action[] = {\n"); lineno++; - n = acttab_size(pActtab); - for(i=j=0; i<n; i++){ - int action = acttab_yyaction(pActtab, i); - if( action<0 ) action = lemp->nsymbol + lemp->nrule + 2; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", action); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_lookahead table */ - fprintf(out,"static const YYCODETYPE yy_lookahead[] = {\n"); lineno++; - for(i=j=0; i<n; i++){ - int la = acttab_yylookahead(pActtab, i); - if( la<0 ) la = lemp->nsymbol; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", la); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_shift_ofst[] table */ - fprintf(out, "#define YY_SHIFT_USE_DFLT (%d)\n", mnTknOfst-1); lineno++; - fprintf(out, "static const %s yy_shift_ofst[] = {\n", - minimum_size_type(mnTknOfst-1, mxTknOfst)); lineno++; - n = lemp->nstate; - for(i=j=0; i<n; i++){ - int ofst; - stp = lemp->sorted[i]; - ofst = stp->iTknOfst; - if( ofst==NO_OFFSET ) ofst = mnTknOfst - 1; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", ofst); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_reduce_ofst[] table */ - fprintf(out, "#define YY_REDUCE_USE_DFLT (%d)\n", mnNtOfst-1); lineno++; - fprintf(out, "static const %s yy_reduce_ofst[] = {\n", - minimum_size_type(mnNtOfst-1, mxNtOfst)); lineno++; - n = lemp->nstate; - for(i=j=0; i<n; i++){ - int ofst; - stp = lemp->sorted[i]; - ofst = stp->iNtOfst; - if( ofst==NO_OFFSET ) ofst = mnNtOfst - 1; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", ofst); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the default action table */ - fprintf(out, "static const YYACTIONTYPE yy_default[] = {\n"); lineno++; - n = lemp->nstate; - for(i=j=0; i<n; i++){ - stp = lemp->sorted[i]; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", stp->iDflt); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the table of fallback tokens. - */ - if( lemp->has_fallback ){ - for(i=0; i<lemp->nterminal; i++){ - struct symbol *p = lemp->symbols[i]; - if( p->fallback==0 ){ - fprintf(out, " 0, /* %10s => nothing */\n", p->name); - }else{ - fprintf(out, " %3d, /* %10s => %s */\n", p->fallback->index, - p->name, p->fallback->name); - } - lineno++; - } - } - tplt_xfer(lemp->name, in, out, &lineno); - - /* Generate a table containing the symbolic name of every symbol - */ - for(i=0; i<lemp->nsymbol; i++){ - sprintf(line,"\"%s\",",lemp->symbols[i]->name); - fprintf(out," %-15s",line); - if( (i&3)==3 ){ fprintf(out,"\n"); lineno++; } - } - if( (i&3)!=0 ){ fprintf(out,"\n"); lineno++; } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate a table containing a text string that describes every - ** rule in the rule set of the grammer. This information is used - ** when tracing REDUCE actions. - */ - for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ - assert( rp->index==i ); - fprintf(out," /* %3d */ \"%s ::=", i, rp->lhs->name); - for(j=0; j<rp->nrhs; j++) fprintf(out," %s",rp->rhs[j]->name); - fprintf(out,"\",\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes every time a symbol is popped from - ** the stack while processing errors or while destroying the parser. - ** (In other words, generate the %destructor actions) - */ - if( lemp->tokendest ){ - for(i=0; i<lemp->nsymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type!=TERMINAL ) continue; - fprintf(out," case %d:\n",sp->index); lineno++; - } - for(i=0; i<lemp->nsymbol && lemp->symbols[i]->type!=TERMINAL; i++); - if( i<lemp->nsymbol ){ - emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - } - if( lemp->vardest ){ - struct symbol *dflt_sp = 0; - for(i=0; i<lemp->nsymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type==TERMINAL || - sp->index<=0 || sp->destructor!=0 ) continue; - fprintf(out," case %d:\n",sp->index); lineno++; - dflt_sp = sp; - } - if( dflt_sp!=0 ){ - emit_destructor_code(out,dflt_sp,lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - } - for(i=0; i<lemp->nsymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue; - fprintf(out," case %d:\n",sp->index); lineno++; - - /* Combine duplicate destructors into a single case */ - for(j=i+1; j<lemp->nsymbol; j++){ - struct symbol *sp2 = lemp->symbols[j]; - if( sp2 && sp2->type!=TERMINAL && sp2->destructor - && sp2->dtnum==sp->dtnum - && strcmp(sp->destructor,sp2->destructor)==0 ){ - fprintf(out," case %d:\n",sp2->index); lineno++; - sp2->destructor = 0; - } - } - - emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes whenever the parser stack overflows */ - tplt_print(out,lemp,lemp->overflow,lemp->overflowln,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the table of rule information - ** - ** Note: This code depends on the fact that rules are number - ** sequentually beginning with 0. - */ - for(rp=lemp->rule; rp; rp=rp->next){ - fprintf(out," { %d, %d },\n",rp->lhs->index,rp->nrhs); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which execution during each REDUCE action */ - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->code ) translate_code(lemp, rp); - } - for(rp=lemp->rule; rp; rp=rp->next){ - struct rule *rp2; - if( rp->code==0 ) continue; - fprintf(out," case %d:\n",rp->index); lineno++; - for(rp2=rp->next; rp2; rp2=rp2->next){ - if( rp2->code==rp->code ){ - fprintf(out," case %d:\n",rp2->index); lineno++; - rp2->code = 0; - } - } - emit_code(out,rp,lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes if a parse fails */ - tplt_print(out,lemp,lemp->failure,lemp->failureln,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes when a syntax error occurs */ - tplt_print(out,lemp,lemp->error,lemp->errorln,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes when the parser accepts its input */ - tplt_print(out,lemp,lemp->accept,lemp->acceptln,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Append any addition code the user desires */ - tplt_print(out,lemp,lemp->extracode,lemp->extracodeln,&lineno); - - fclose(in); - fclose(out); - return; -} - -/* Generate a header file for the parser */ -void ReportHeader(lemp) -struct lemon *lemp; -{ - FILE *out, *in; - char *prefix; - char line[LINESIZE]; - char pattern[LINESIZE]; - int i; - - if( lemp->tokenprefix ) prefix = lemp->tokenprefix; - else prefix = ""; - in = file_open(lemp,".h","rb"); - if( in ){ - for(i=1; i<lemp->nterminal && fgets(line,LINESIZE,in); i++){ - sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); - if( strcmp(line,pattern) ) break; - } - fclose(in); - if( i==lemp->nterminal ){ - /* No change in the file. Don't rewrite it. */ - return; - } - } - out = file_open(lemp,".h","wb"); - if( out ){ - for(i=1; i<lemp->nterminal; i++){ - fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); - } - fclose(out); - } - return; -} - -/* Reduce the size of the action tables, if possible, by making use -** of defaults. -** -** In this version, we take the most frequent REDUCE action and make -** it the default. Only default a reduce if there are more than one. -*/ -void CompressTables(lemp) -struct lemon *lemp; -{ - struct state *stp; - struct action *ap, *ap2; - struct rule *rp, *rp2, *rbest; - int nbest, n; - int i; - - for(i=0; i<lemp->nstate; i++){ - stp = lemp->sorted[i]; - nbest = 0; - rbest = 0; - - for(ap=stp->ap; ap; ap=ap->next){ - if( ap->type!=REDUCE ) continue; - rp = ap->x.rp; - if( rp==rbest ) continue; - n = 1; - for(ap2=ap->next; ap2; ap2=ap2->next){ - if( ap2->type!=REDUCE ) continue; - rp2 = ap2->x.rp; - if( rp2==rbest ) continue; - if( rp2==rp ) n++; - } - if( n>nbest ){ - nbest = n; - rbest = rp; - } - } - - /* Do not make a default if the number of rules to default - ** is not at least 2 */ - if( nbest<2 ) continue; - - - /* Combine matching REDUCE actions into a single default */ - for(ap=stp->ap; ap; ap=ap->next){ - if( ap->type==REDUCE && ap->x.rp==rbest ) break; - } - assert( ap ); - ap->sp = Symbol_new("{default}"); - for(ap=ap->next; ap; ap=ap->next){ - if( ap->type==REDUCE && ap->x.rp==rbest ) ap->type = NOT_USED; - } - stp->ap = Action_sort(stp->ap); - } -} - -/***************** From the file "set.c" ************************************/ -/* -** Set manipulation routines for the LEMON parser generator. -*/ - -static int size = 0; - -/* Set the set size */ -void SetSize(n) -int n; -{ - size = n+1; -} - -/* Allocate a new set */ -char *SetNew(){ - char *s; - int i; - s = (char*)malloc( size ); - if( s==0 ){ - extern void memory_error(); - memory_error(); - } - for(i=0; i<size; i++) s[i] = 0; - return s; -} - -/* Deallocate a set */ -void SetFree(s) -char *s; -{ - free(s); -} - -/* Add a new element to the set. Return TRUE if the element was added -** and FALSE if it was already there. */ -int SetAdd(s,e) -char *s; -int e; -{ - int rv; - rv = s[e]; - s[e] = 1; - return !rv; -} - -/* Add every element of s2 to s1. Return TRUE if s1 changes. */ -int SetUnion(s1,s2) -char *s1; -char *s2; -{ - int i, progress; - progress = 0; - for(i=0; i<size; i++){ - if( s2[i]==0 ) continue; - if( s1[i]==0 ){ - progress = 1; - s1[i] = 1; - } - } - return progress; -} -/********************** From the file "table.c" ****************************/ -/* -** All code in this file has been automatically generated -** from a specification in the file -** "table.q" -** by the associative array code building program "aagen". -** Do not edit this file! Instead, edit the specification -** file, then rerun aagen. -*/ -/* -** Code for processing tables in the LEMON parser generator. -*/ - -PRIVATE int strhash(x) -char *x; -{ - int h = 0; - while( *x) h = h*13 + *(x++); - return h; -} - -/* Works like strdup, sort of. Save a string in malloced memory, but -** keep strings in a table so that the same string is not in more -** than one place. -*/ -char *Strsafe(y) -char *y; -{ - char *z; - - z = Strsafe_find(y); - if( z==0 && (z=malloc( strlen(y)+1 ))!=0 ){ - strcpy(z,y); - Strsafe_insert(z); - } - MemoryCheck(z); - return z; -} - -/* There is one instance of the following structure for each -** associative array of type "x1". -*/ -struct s_x1 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x1node *tbl; /* The data stored here */ - struct s_x1node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x1". -*/ -typedef struct s_x1node { - char *data; /* The data */ - struct s_x1node *next; /* Next entry with the same hash */ - struct s_x1node **from; /* Previous link */ -} x1node; - -/* There is only one instance of the array, which is the following */ -static struct s_x1 *x1a; - -/* Allocate a new associative array */ -void Strsafe_init(){ - if( x1a ) return; - x1a = (struct s_x1*)malloc( sizeof(struct s_x1) ); - if( x1a ){ - x1a->size = 1024; - x1a->count = 0; - x1a->tbl = (x1node*)malloc( - (sizeof(x1node) + sizeof(x1node*))*1024 ); - if( x1a->tbl==0 ){ - free(x1a); - x1a = 0; - }else{ - int i; - x1a->ht = (x1node**)&(x1a->tbl[1024]); - for(i=0; i<1024; i++) x1a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Strsafe_insert(data) -char *data; -{ - x1node *np; - int h; - int ph; - - if( x1a==0 ) return 0; - ph = strhash(data); - h = ph & (x1a->size-1); - np = x1a->ht[h]; - while( np ){ - if( strcmp(np->data,data)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x1a->count>=x1a->size ){ - /* Need to make the hash table bigger */ - int i,size; - struct s_x1 array; - array.size = size = x1a->size*2; - array.count = x1a->count; - array.tbl = (x1node*)malloc( - (sizeof(x1node) + sizeof(x1node*))*size ); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x1node**)&(array.tbl[size]); - for(i=0; i<size; i++) array.ht[i] = 0; - for(i=0; i<x1a->count; i++){ - x1node *oldnp, *newnp; - oldnp = &(x1a->tbl[i]); - h = strhash(oldnp->data) & (size-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x1a->tbl); - *x1a = array; - } - /* Insert the new data */ - h = ph & (x1a->size-1); - np = &(x1a->tbl[x1a->count++]); - np->data = data; - if( x1a->ht[h] ) x1a->ht[h]->from = &(np->next); - np->next = x1a->ht[h]; - x1a->ht[h] = np; - np->from = &(x1a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -char *Strsafe_find(key) -char *key; -{ - int h; - x1node *np; - - if( x1a==0 ) return 0; - h = strhash(key) & (x1a->size-1); - np = x1a->ht[h]; - while( np ){ - if( strcmp(np->data,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return a pointer to the (terminal or nonterminal) symbol "x". -** Create a new symbol if this is the first time "x" has been seen. -*/ -struct symbol *Symbol_new(x) -char *x; -{ - struct symbol *sp; - - sp = Symbol_find(x); - if( sp==0 ){ - sp = (struct symbol *)malloc( sizeof(struct symbol) ); - MemoryCheck(sp); - sp->name = Strsafe(x); - sp->type = isupper(*x) ? TERMINAL : NONTERMINAL; - sp->rule = 0; - sp->fallback = 0; - sp->prec = -1; - sp->assoc = UNK; - sp->firstset = 0; - sp->lambda = B_FALSE; - sp->destructor = 0; - sp->datatype = 0; - Symbol_insert(sp,sp->name); - } - return sp; -} - -/* Compare two symbols for working purposes -** -** Symbols that begin with upper case letters (terminals or tokens) -** must sort before symbols that begin with lower case letters -** (non-terminals). Other than that, the order does not matter. -** -** We find experimentally that leaving the symbols in their original -** order (the order they appeared in the grammar file) gives the -** smallest parser tables in SQLite. -*/ -int Symbolcmpp(struct symbol **a, struct symbol **b){ - int i1 = (**a).index + 10000000*((**a).name[0]>'Z'); - int i2 = (**b).index + 10000000*((**b).name[0]>'Z'); - return i1-i2; -} - -/* There is one instance of the following structure for each -** associative array of type "x2". -*/ -struct s_x2 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x2node *tbl; /* The data stored here */ - struct s_x2node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x2". -*/ -typedef struct s_x2node { - struct symbol *data; /* The data */ - char *key; /* The key */ - struct s_x2node *next; /* Next entry with the same hash */ - struct s_x2node **from; /* Previous link */ -} x2node; - -/* There is only one instance of the array, which is the following */ -static struct s_x2 *x2a; - -/* Allocate a new associative array */ -void Symbol_init(){ - if( x2a ) return; - x2a = (struct s_x2*)malloc( sizeof(struct s_x2) ); - if( x2a ){ - x2a->size = 128; - x2a->count = 0; - x2a->tbl = (x2node*)malloc( - (sizeof(x2node) + sizeof(x2node*))*128 ); - if( x2a->tbl==0 ){ - free(x2a); - x2a = 0; - }else{ - int i; - x2a->ht = (x2node**)&(x2a->tbl[128]); - for(i=0; i<128; i++) x2a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Symbol_insert(data,key) -struct symbol *data; -char *key; -{ - x2node *np; - int h; - int ph; - - if( x2a==0 ) return 0; - ph = strhash(key); - h = ph & (x2a->size-1); - np = x2a->ht[h]; - while( np ){ - if( strcmp(np->key,key)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x2a->count>=x2a->size ){ - /* Need to make the hash table bigger */ - int i,size; - struct s_x2 array; - array.size = size = x2a->size*2; - array.count = x2a->count; - array.tbl = (x2node*)malloc( - (sizeof(x2node) + sizeof(x2node*))*size ); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x2node**)&(array.tbl[size]); - for(i=0; i<size; i++) array.ht[i] = 0; - for(i=0; i<x2a->count; i++){ - x2node *oldnp, *newnp; - oldnp = &(x2a->tbl[i]); - h = strhash(oldnp->key) & (size-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->key = oldnp->key; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x2a->tbl); - *x2a = array; - } - /* Insert the new data */ - h = ph & (x2a->size-1); - np = &(x2a->tbl[x2a->count++]); - np->key = key; - np->data = data; - if( x2a->ht[h] ) x2a->ht[h]->from = &(np->next); - np->next = x2a->ht[h]; - x2a->ht[h] = np; - np->from = &(x2a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct symbol *Symbol_find(key) -char *key; -{ - int h; - x2node *np; - - if( x2a==0 ) return 0; - h = strhash(key) & (x2a->size-1); - np = x2a->ht[h]; - while( np ){ - if( strcmp(np->key,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return the n-th data. Return NULL if n is out of range. */ -struct symbol *Symbol_Nth(n) -int n; -{ - struct symbol *data; - if( x2a && n>0 && n<=x2a->count ){ - data = x2a->tbl[n-1].data; - }else{ - data = 0; - } - return data; -} - -/* Return the size of the array */ -int Symbol_count() -{ - return x2a ? x2a->count : 0; -} - -/* Return an array of pointers to all data in the table. -** The array is obtained from malloc. Return NULL if memory allocation -** problems, or if the array is empty. */ -struct symbol **Symbol_arrayof() -{ - struct symbol **array; - int i,size; - if( x2a==0 ) return 0; - size = x2a->count; - array = (struct symbol **)malloc( sizeof(struct symbol *)*size ); - if( array ){ - for(i=0; i<size; i++) array[i] = x2a->tbl[i].data; - } - return array; -} - -/* Compare two configurations */ -int Configcmp(a,b) -struct config *a; -struct config *b; -{ - int x; - x = a->rp->index - b->rp->index; - if( x==0 ) x = a->dot - b->dot; - return x; -} - -/* Compare two states */ -PRIVATE int statecmp(a,b) -struct config *a; -struct config *b; -{ - int rc; - for(rc=0; rc==0 && a && b; a=a->bp, b=b->bp){ - rc = a->rp->index - b->rp->index; - if( rc==0 ) rc = a->dot - b->dot; - } - if( rc==0 ){ - if( a ) rc = 1; - if( b ) rc = -1; - } - return rc; -} - -/* Hash a state */ -PRIVATE int statehash(a) -struct config *a; -{ - int h=0; - while( a ){ - h = h*571 + a->rp->index*37 + a->dot; - a = a->bp; - } - return h; -} - -/* Allocate a new state structure */ -struct state *State_new() -{ - struct state *new; - new = (struct state *)malloc( sizeof(struct state) ); - MemoryCheck(new); - return new; -} - -/* There is one instance of the following structure for each -** associative array of type "x3". -*/ -struct s_x3 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x3node *tbl; /* The data stored here */ - struct s_x3node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x3". -*/ -typedef struct s_x3node { - struct state *data; /* The data */ - struct config *key; /* The key */ - struct s_x3node *next; /* Next entry with the same hash */ - struct s_x3node **from; /* Previous link */ -} x3node; - -/* There is only one instance of the array, which is the following */ -static struct s_x3 *x3a; - -/* Allocate a new associative array */ -void State_init(){ - if( x3a ) return; - x3a = (struct s_x3*)malloc( sizeof(struct s_x3) ); - if( x3a ){ - x3a->size = 128; - x3a->count = 0; - x3a->tbl = (x3node*)malloc( - (sizeof(x3node) + sizeof(x3node*))*128 ); - if( x3a->tbl==0 ){ - free(x3a); - x3a = 0; - }else{ - int i; - x3a->ht = (x3node**)&(x3a->tbl[128]); - for(i=0; i<128; i++) x3a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int State_insert(data,key) -struct state *data; -struct config *key; -{ - x3node *np; - int h; - int ph; - - if( x3a==0 ) return 0; - ph = statehash(key); - h = ph & (x3a->size-1); - np = x3a->ht[h]; - while( np ){ - if( statecmp(np->key,key)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x3a->count>=x3a->size ){ - /* Need to make the hash table bigger */ - int i,size; - struct s_x3 array; - array.size = size = x3a->size*2; - array.count = x3a->count; - array.tbl = (x3node*)malloc( - (sizeof(x3node) + sizeof(x3node*))*size ); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x3node**)&(array.tbl[size]); - for(i=0; i<size; i++) array.ht[i] = 0; - for(i=0; i<x3a->count; i++){ - x3node *oldnp, *newnp; - oldnp = &(x3a->tbl[i]); - h = statehash(oldnp->key) & (size-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->key = oldnp->key; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x3a->tbl); - *x3a = array; - } - /* Insert the new data */ - h = ph & (x3a->size-1); - np = &(x3a->tbl[x3a->count++]); - np->key = key; - np->data = data; - if( x3a->ht[h] ) x3a->ht[h]->from = &(np->next); - np->next = x3a->ht[h]; - x3a->ht[h] = np; - np->from = &(x3a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct state *State_find(key) -struct config *key; -{ - int h; - x3node *np; - - if( x3a==0 ) return 0; - h = statehash(key) & (x3a->size-1); - np = x3a->ht[h]; - while( np ){ - if( statecmp(np->key,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return an array of pointers to all data in the table. -** The array is obtained from malloc. Return NULL if memory allocation -** problems, or if the array is empty. */ -struct state **State_arrayof() -{ - struct state **array; - int i,size; - if( x3a==0 ) return 0; - size = x3a->count; - array = (struct state **)malloc( sizeof(struct state *)*size ); - if( array ){ - for(i=0; i<size; i++) array[i] = x3a->tbl[i].data; - } - return array; -} - -/* Hash a configuration */ -PRIVATE int confighash(a) -struct config *a; -{ - int h=0; - h = h*571 + a->rp->index*37 + a->dot; - return h; -} - -/* There is one instance of the following structure for each -** associative array of type "x4". -*/ -struct s_x4 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x4node *tbl; /* The data stored here */ - struct s_x4node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x4". -*/ -typedef struct s_x4node { - struct config *data; /* The data */ - struct s_x4node *next; /* Next entry with the same hash */ - struct s_x4node **from; /* Previous link */ -} x4node; - -/* There is only one instance of the array, which is the following */ -static struct s_x4 *x4a; - -/* Allocate a new associative array */ -void Configtable_init(){ - if( x4a ) return; - x4a = (struct s_x4*)malloc( sizeof(struct s_x4) ); - if( x4a ){ - x4a->size = 64; - x4a->count = 0; - x4a->tbl = (x4node*)malloc( - (sizeof(x4node) + sizeof(x4node*))*64 ); - if( x4a->tbl==0 ){ - free(x4a); - x4a = 0; - }else{ - int i; - x4a->ht = (x4node**)&(x4a->tbl[64]); - for(i=0; i<64; i++) x4a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Configtable_insert(data) -struct config *data; -{ - x4node *np; - int h; - int ph; - - if( x4a==0 ) return 0; - ph = confighash(data); - h = ph & (x4a->size-1); - np = x4a->ht[h]; - while( np ){ - if( Configcmp(np->data,data)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x4a->count>=x4a->size ){ - /* Need to make the hash table bigger */ - int i,size; - struct s_x4 array; - array.size = size = x4a->size*2; - array.count = x4a->count; - array.tbl = (x4node*)malloc( - (sizeof(x4node) + sizeof(x4node*))*size ); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x4node**)&(array.tbl[size]); - for(i=0; i<size; i++) array.ht[i] = 0; - for(i=0; i<x4a->count; i++){ - x4node *oldnp, *newnp; - oldnp = &(x4a->tbl[i]); - h = confighash(oldnp->data) & (size-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x4a->tbl); - *x4a = array; - } - /* Insert the new data */ - h = ph & (x4a->size-1); - np = &(x4a->tbl[x4a->count++]); - np->data = data; - if( x4a->ht[h] ) x4a->ht[h]->from = &(np->next); - np->next = x4a->ht[h]; - x4a->ht[h] = np; - np->from = &(x4a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct config *Configtable_find(key) -struct config *key; -{ - int h; - x4node *np; - - if( x4a==0 ) return 0; - h = confighash(key) & (x4a->size-1); - np = x4a->ht[h]; - while( np ){ - if( Configcmp(np->data,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Remove all data from the table. Pass each data to the function "f" -** as it is removed. ("f" may be null to avoid this step.) */ -void Configtable_clear(f) -int(*f)(/* struct config * */); -{ - int i; - if( x4a==0 || x4a->count==0 ) return; - if( f ) for(i=0; i<x4a->count; i++) (*f)(x4a->tbl[i].data); - for(i=0; i<x4a->size; i++) x4a->ht[i] = 0; - x4a->count = 0; - return; -} diff --git a/ext/pdo_sqlite/sqlite/tool/lempar.c b/ext/pdo_sqlite/sqlite/tool/lempar.c deleted file mode 100644 index 57ec97f6a87c7..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/lempar.c +++ /dev/null @@ -1,714 +0,0 @@ -/* Driver template for the LEMON parser generator. -** The author disclaims copyright to this source code. -*/ -/* First off, code is include which follows the "include" declaration -** in the input file. */ -#include <stdio.h> -%% -/* Next is all token values, in a form suitable for use by makeheaders. -** This section will be null unless lemon is run with the -m switch. -*/ -/* -** These constants (all generated automatically by the parser generator) -** specify the various kinds of tokens (terminals) that the parser -** understands. -** -** Each symbol here is a terminal symbol in the grammar. -*/ -%% -/* Make sure the INTERFACE macro is defined. -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/* The next thing included is series of defines which control -** various aspects of the generated parser. -** YYCODETYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 terminals -** and nonterminals. "int" is used otherwise. -** YYNOCODE is a number of type YYCODETYPE which corresponds -** to no legal terminal or nonterminal number. This -** number is used to fill in empty slots of the hash -** table. -** YYFALLBACK If defined, this indicates that one or more tokens -** have fall-back values which should be used if the -** original value of the token will not parse. -** YYACTIONTYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 rules and -** states combined. "int" is used otherwise. -** ParseTOKENTYPE is the data type used for minor tokens given -** directly to the parser from the tokenizer. -** YYMINORTYPE is the data type used for all minor tokens. -** This is typically a union of many types, one of -** which is ParseTOKENTYPE. The entry in the union -** for base tokens is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. -** ParseARG_SDECL A static variable declaration for the %extra_argument -** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_STORE Code to store %extra_argument into yypParser -** ParseARG_FETCH Code to extract %extra_argument from yypParser -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -*/ -%% -#define YY_NO_ACTION (YYNSTATE+YYNRULE+2) -#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) -#define YY_ERROR_ACTION (YYNSTATE+YYNRULE) - -/* Next are that tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N < YYNSTATE Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. -** -** N == YYNSTATE+YYNRULE A syntax error has occurred. -** -** N == YYNSTATE+YYNRULE+1 The parser accepts its input. -** -** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as -** -** yy_action[ yy_shift_ofst[S] + X ] -** -** If the index value yy_shift_ofst[S]+X is out of range or if the value -** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] -** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table -** and that yy_default[S] should be used instead. -** -** The formula above is for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -*/ -%% -#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0])) - -/* The next table maps tokens into fallback tokens. If a construct -** like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammer, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { -%% -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -*/ -struct yyStackEntry { - int stateno; /* The state-number */ - int major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - int yyidx; /* Index of top element in stack */ - int yyerrcnt; /* Shifts left before out of the error */ - ParseARG_SDECL /* A place to hold %extra_argument */ - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include <stdio.h> -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -** <ul> -** <li> A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -** <li> A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -** </ul> -** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { -%% -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { -%% -}; -#endif /* NDEBUG */ - -/* -** This function returns the symbolic name associated with a token -** value. -*/ -const char *ParseTokenName(int tokenType){ -#ifndef NDEBUG - if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ - return yyTokenName[tokenType]; - }else{ - return "Unknown"; - } -#else - return ""; -#endif -} - -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(size_t)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); - if( pParser ){ - pParser->yyidx = -1; - } - return pParser; -} - -/* The following function deletes the value associated with a -** symbol. The symbol can be either a terminal or nonterminal. -** "yymajor" is the symbol code, and "yypminor" is a pointer to -** the value. -*/ -static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are not used - ** inside the C code. - */ -%% - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -** -** Return the major token number for the symbol popped. -*/ -static int yy_pop_parser_stack(yyParser *pParser){ - YYCODETYPE yymajor; - yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; - - if( pParser->yyidx<0 ) return 0; -#ifndef NDEBUG - if( yyTraceFILE && pParser->yyidx>=0 ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yymajor = yytos->major; - yy_destructor( yymajor, &yytos->minor); - pParser->yyidx--; - return yymajor; -} - -/* -** Deallocate and destroy a parser. Destructors are all called for -** all stack elements before shutting the parser down. -** -** Inputs: -** <ul> -** <li> A pointer to the parser. This should be a pointer -** obtained from ParseAlloc. -** <li> A pointer to a function used to reclaim memory obtained -** from malloc. -** </ul> -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ - yyParser *pParser = (yyParser*)p; - if( pParser==0 ) return; - while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); - (*freeProc)((void*)pParser); -} - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_shift_action( - yyParser *pParser, /* The parser */ - int iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yystack[pParser->yyidx].stateno; - - /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */ - i = yy_shift_ofst[stateno]; - if( i==YY_SHIFT_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - int iFallback; /* Fallback token */ - if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) - && (iFallback = yyFallback[iLookAhead])!=0 ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - return yy_find_shift_action(pParser, iFallback); - } -#endif - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - int iLookAhead /* The look-ahead token */ -){ - int i; - /* int stateno = pParser->yystack[pParser->yyidx].stateno; */ - - i = yy_reduce_ofst[stateno]; - if( i==YY_REDUCE_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yyidx++; - if( yypParser->yyidx>=YYSTACKDEPTH ){ - ParseARG_FETCH; - yypParser->yyidx--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ -%% - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ - return; - } - yytos = &yypParser->yystack[yypParser->yyidx]; - yytos->stateno = yyNewState; - yytos->major = yyMajor; - yytos->minor = *yypMinor; -#ifndef NDEBUG - if( yyTraceFILE && yypParser->yyidx>0 ){ - int i; - fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); - fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); - for(i=1; i<=yypParser->yyidx; i++) - fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); - fprintf(yyTraceFILE,"\n"); - } -#endif -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - unsigned char nrhs; /* Number of right-hand side symbols in the rule */ -} yyRuleInfo[] = { -%% -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - int yyruleno /* Number of the rule by which to reduce */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; - yymsp = &yypParser->yystack[yypParser->yyidx]; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno>=0 - && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ - fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, - yyRuleName[yyruleno]); - } -#endif /* NDEBUG */ - -#ifndef NDEBUG - /* Silence complaints from purify about yygotominor being uninitialized - ** in some cases when it is copied into the stack after the following - ** switch. yygotominor is uninitialized when a rule reduces that does - ** not set the value of its left-hand side nonterminal. Leaving the - ** value of the nonterminal uninitialized is utterly harmless as long - ** as the value is never used. So really the only thing this code - ** accomplishes is to quieten purify. - */ - memset(&yygotominor, 0, sizeof(yygotominor)); -#endif - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line <lineno> <grammarfile> - ** { ... } // User supplied code - ** #line <lineno> <thisfile> - ** break; - */ -%% - }; - yygoto = yyRuleInfo[yyruleno].lhs; - yysize = yyRuleInfo[yyruleno].nrhs; - yypParser->yyidx -= yysize; - yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); - if( yyact < YYNSTATE ){ -#ifdef NDEBUG - /* If we are not debugging and the reduce action popped at least - ** one element off the stack, then we can push the new element back - ** onto the stack here, and skip the stack overflow test in yy_shift(). - ** That gives a significant speed improvement. */ - if( yysize ){ - yypParser->yyidx++; - yymsp -= yysize-1; - yymsp->stateno = yyact; - yymsp->major = yygoto; - yymsp->minor = yygotominor; - }else -#endif - { - yy_shift(yypParser,yyact,yygoto,&yygotominor); - } - }else if( yyact == YYNSTATE + YYNRULE + 1 ){ - yy_accept(yypParser); - } -} - -/* -** The following code executes when the parse fails -*/ -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ -%% - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - YYMINORTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH; -#define TOKEN (yyminor.yy0) -%% - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ -%% - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -** <ul> -** <li> A pointer to the parser (an opaque structure.) -** <li> The major token number. -** <li> The minor token number. -** <li> An option argument of a grammar-specified type. -** </ul> -** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - int yyact; /* The parser action. */ - int yyendofinput; /* True if we are at the end of input */ - int yyerrorhit = 0; /* True if yymajor has invoked an error */ - yyParser *yypParser; /* The parser */ - - /* (re)initialize the parser, if necessary */ - yypParser = (yyParser*)yyp; - if( yypParser->yyidx<0 ){ - /* if( yymajor==0 ) return; // not sure why this was here... */ - yypParser->yyidx = 0; - yypParser->yyerrcnt = -1; - yypParser->yystack[0].stateno = 0; - yypParser->yystack[0].major = 0; - } - yyminorunion.yy0 = yyminor; - yyendofinput = (yymajor==0); - ParseARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,yymajor); - if( yyact<YYNSTATE ){ - yy_shift(yypParser,yyact,yymajor,&yyminorunion); - yypParser->yyerrcnt--; - if( yyendofinput && yypParser->yyidx>=0 ){ - yymajor = 0; - }else{ - yymajor = YYNOCODE; - } - }else if( yyact < YYNSTATE + YYNRULE ){ - yy_reduce(yypParser,yyact-YYNSTATE); - }else if( yyact == YY_ERROR_ACTION ){ - int yymx; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yymx = yypParser->yystack[yypParser->yyidx].major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yymajor,&yyminorunion); - yymajor = YYNOCODE; - }else{ - while( - yypParser->yyidx >= 0 && - yymx != YYERRORSYMBOL && - (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yyidx < 0 || yymajor==0 ){ - yy_destructor(yymajor,&yyminorunion); - yy_parse_failed(yypParser); - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - YYMINORTYPE u2; - u2.YYERRSYMDT = 0; - yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yypParser->yyerrcnt = 3; - yy_destructor(yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); - } - yymajor = YYNOCODE; -#endif - }else{ - yy_accept(yypParser); - yymajor = YYNOCODE; - } - }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); - return; -} diff --git a/ext/pdo_sqlite/sqlite/tool/memleak.awk b/ext/pdo_sqlite/sqlite/tool/memleak.awk deleted file mode 100644 index 928d3b69dc780..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/memleak.awk +++ /dev/null @@ -1,29 +0,0 @@ -# -# This script looks for memory leaks by analyzing the output of "sqlite" -# when compiled with the SQLITE_DEBUG=2 option. -# -/[0-9]+ malloc / { - mem[$6] = $0 -} -/[0-9]+ realloc / { - mem[$8] = ""; - mem[$10] = $0 -} -/[0-9]+ free / { - if (mem[$6]=="") { - print "*** free without a malloc at",$6 - } - mem[$6] = ""; - str[$6] = "" -} -/^string at / { - addr = $4 - sub("string at " addr " is ","") - str[addr] = $0 -} -END { - for(addr in mem){ - if( mem[addr]=="" ) continue - print mem[addr], str[addr] - } -} diff --git a/ext/pdo_sqlite/sqlite/tool/memleak2.awk b/ext/pdo_sqlite/sqlite/tool/memleak2.awk deleted file mode 100644 index 5d81b70d8db59..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/memleak2.awk +++ /dev/null @@ -1,29 +0,0 @@ -# This AWK script reads the output of testfixture when compiled for memory -# debugging. It generates SQL commands that can be fed into an sqlite -# instance to determine what memory is never freed. A typical usage would -# be as follows: -# -# make -f memleak.mk fulltest 2>mem.out -# awk -f ../sqlite/tool/memleak2.awk mem.out | ./sqlite :memory: -# -# The job performed by this script is the same as that done by memleak.awk. -# The difference is that this script uses much less memory when the size -# of the mem.out file is huge. -# -BEGIN { - print "CREATE TABLE mem(loc INTEGER PRIMARY KEY, src);" -} -/[0-9]+ malloc / { - print "INSERT INTO mem VALUES(" strtonum($6) ",'" $0 "');" -} -/[0-9]+ realloc / { - print "INSERT INTO mem VALUES(" strtonum($10) \ - ",(SELECT src FROM mem WHERE loc=" strtonum($8) "));" - print "DELETE FROM mem WHERE loc=" strtonum($8) ";" -} -/[0-9]+ free / { - print "DELETE FROM mem WHERE loc=" strtonum($6) ";" -} -END { - print "SELECT src FROM mem;" -} diff --git a/ext/pdo_sqlite/sqlite/tool/memleak3.tcl b/ext/pdo_sqlite/sqlite/tool/memleak3.tcl deleted file mode 100644 index 2e3f43bc13673..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/memleak3.tcl +++ /dev/null @@ -1,232 +0,0 @@ -#/bin/sh -# \ -exec `which tclsh` $0 "$@" -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -###################################################################### - -set doco " -This script is a tool to help track down memory leaks in the sqlite -library. The library must be compiled with the preprocessor symbol -SQLITE_MEMDEBUG set to at least 2. It must be set to 3 to enable stack -traces. - -To use, run the leaky application and save the standard error output. -Then, execute this program with the first argument the name of the -application binary (or interpreter) and the second argument the name of the -text file that contains the collected stderr output. - -If all goes well a summary of unfreed allocations is printed out. If the -GNU C library is in use and SQLITE_DEBUG is 3 or greater a stack trace is -printed out for each unmatched allocation. - -If the \"-r <n>\" option is passed, then the program stops and prints out -the state of the heap immediately after the <n>th call to malloc() or -realloc(). - -Example: - -$ ./testfixture ../sqlite/test/select1.test 2> memtrace.out -$ tclsh $argv0 ?-r <malloc-number>? ./testfixture memtrace.out -" - - -proc usage {} { - set prg [file tail $::argv0] - puts "Usage: $prg ?-r <malloc-number>? <binary file> <mem trace file>" - puts "" - puts [string trim $::doco] - exit -1 -} - -proc shift {listvar} { - upvar $listvar l - set ret [lindex $l 0] - set l [lrange $l 1 end] - return $ret -} - -# Argument handling. The following vars are set: -# -# $exe - the name of the executable (i.e. "testfixture" or "./sqlite3") -# $memfile - the name of the file containing the trace output. -# $report_at - The malloc number to stop and report at. Or -1 to read -# all of $memfile. -# -set report_at -1 -while {[llength $argv]>2} { - set arg [shift argv] - switch -- $arg { - "-r" { - set report_at [shift argv] - } - default { - usage - } - } -} -if {[llength $argv]!=2} usage -set exe [lindex $argv 0] -set memfile [lindex $argv 1] - -# If stack traces are enabled, the 'addr2line' program is called to -# translate a binary stack address into a human-readable form. -set addr2line addr2line - -# When the SQLITE_MEMDEBUG is set as described above, SQLite prints -# out a line for each malloc(), realloc() or free() call that the -# library makes. If SQLITE_MEMDEBUG is 3, then a stack trace is printed -# out before each malloc() and realloc() line. -# -# This program parses each line the SQLite library outputs and updates -# the following global Tcl variables to reflect the "current" state of -# the heap used by SQLite. -# -set nBytes 0 ;# Total number of bytes currently allocated. -set nMalloc 0 ;# Total number of malloc()/realloc() calls. -set nPeak 0 ;# Peak of nBytes. -set iPeak 0 ;# nMalloc when nPeak was set. -# -# More detailed state information is stored in the $memmap array. -# Each key in the memmap array is the address of a chunk of memory -# currently allocated from the heap. The value is a list of the -# following form -# -# {<number-of-bytes> <malloc id> <stack trace>} -# -array unset memmap - -proc process_input {input_file array_name} { - upvar $array_name mem - set input [open $input_file] - - set MALLOC {([[:digit:]]+) malloc ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)} - # set STACK {^[[:digit:]]+: STACK: (.*)$} - set STACK {^STACK: (.*)$} - set FREE {[[:digit:]]+ free ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)} - set REALLOC {([[:digit:]]+) realloc ([[:digit:]]+) to ([[:digit:]]+)} - append REALLOC { bytes at 0x([[:xdigit:]]+) to 0x([[:xdigit:]]+)} - - set stack "" - while { ![eof $input] } { - set line [gets $input] - if {[regexp $STACK $line dummy stack]} { - # Do nothing. The variable $stack now stores the hexadecimal stack dump - # for the next malloc() or realloc(). - - } elseif { [regexp $MALLOC $line dummy mallocid bytes addr] } { - # If this is a 'malloc' line, set an entry in the mem array. Each entry - # is a list of length three, the number of bytes allocated , the malloc - # number and the stack dump when it was allocated. - set mem($addr) [list $bytes "malloc $mallocid" $stack] - set stack "" - - # Increase the current heap usage - incr ::nBytes $bytes - - # Increase the number of malloc() calls - incr ::nMalloc - - if {$::nBytes > $::nPeak} { - set ::nPeak $::nBytes - set ::iPeak $::nMalloc - } - - } elseif { [regexp $FREE $line dummy bytes addr] } { - # If this is a 'free' line, remove the entry from the mem array. If the - # entry does not exist, or is the wrong number of bytes, announce a - # problem. This is more likely a bug in the regular expressions for - # this script than an SQLite defect. - if { [lindex $mem($addr) 0] != $bytes } { - error "byte count mismatch" - } - unset mem($addr) - - # Decrease the current heap usage - incr ::nBytes [expr -1 * $bytes] - - } elseif { [regexp $REALLOC $line dummy mallocid ob b oa a] } { - # "free" the old allocation in the internal model: - incr ::nBytes [expr -1 * $ob] - unset mem($oa); - - # "malloc" the new allocation - set mem($a) [list $b "realloc $mallocid" $stack] - incr ::nBytes $b - set stack "" - - # Increase the number of malloc() calls - incr ::nMalloc - - if {$::nBytes > $::nPeak} { - set ::nPeak $::nBytes - set ::iPeak $::nMalloc - } - - } else { - # puts "REJECT: $line" - } - - if {$::nMalloc==$::report_at} report - } - - close $input -} - -proc printstack {stack} { - set fcount 10 - if {[llength $stack]<10} { - set fcount [llength $stack] - } - foreach frame [lrange $stack 1 $fcount] { - foreach {f l} [split [exec $::addr2line -f --exe=$::exe $frame] \n] {} - puts [format "%-30s %s" $f $l] - } - if {[llength $stack]>0 } {puts ""} -} - -proc report {} { - - foreach key [array names ::memmap] { - set stack [lindex $::memmap($key) 2] - set bytes [lindex $::memmap($key) 0] - lappend summarymap($stack) $bytes - } - - foreach stack [array names summarymap] { - set allocs $summarymap($stack) - set sum 0 - foreach a $allocs { - incr sum $a - } - lappend sorted [list $sum $stack] - } - - set sorted [lsort -integer -index 0 $sorted] - foreach s $sorted { - set sum [lindex $s 0] - set stack [lindex $s 1] - set allocs $summarymap($stack) - puts "$sum bytes in [llength $allocs] chunks ($allocs)" - printstack $stack - } - - # Print out summary statistics - puts "Total allocations : $::nMalloc" - puts "Total outstanding allocations: [array size ::memmap]" - puts "Current heap usage : $::nBytes bytes" - puts "Peak heap usage : $::nPeak bytes (malloc #$::iPeak)" - - exit -} - -process_input $memfile memmap -report - - - diff --git a/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c b/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c deleted file mode 100644 index 58d4b9cb78a3c..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c +++ /dev/null @@ -1,501 +0,0 @@ -/* -** Compile and run this standalone program in order to generate code that -** implements a function that will translate alphabetic identifiers into -** parser token codes. -*/ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -/* -** All the keywords of the SQL language are stored as in a hash -** table composed of instances of the following structure. -*/ -typedef struct Keyword Keyword; -struct Keyword { - char *zName; /* The keyword name */ - char *zTokenType; /* Token value for this keyword */ - int mask; /* Code this keyword if non-zero */ - int id; /* Unique ID for this record */ - int hash; /* Hash on the keyword */ - int offset; /* Offset to start of name string */ - int len; /* Length of this keyword, not counting final \000 */ - int prefix; /* Number of characters in prefix */ - int iNext; /* Index in aKeywordTable[] of next with same hash */ - int substrId; /* Id to another keyword this keyword is embedded in */ - int substrOffset; /* Offset into substrId for start of this keyword */ -}; - -/* -** Define masks used to determine which keywords are allowed -*/ -#ifdef SQLITE_OMIT_ALTERTABLE -# define ALTER 0 -#else -# define ALTER 0x00000001 -#endif -#define ALWAYS 0x00000002 -#ifdef SQLITE_OMIT_ANALYZE -# define ANALYZE 0 -#else -# define ANALYZE 0x00000004 -#endif -#ifdef SQLITE_OMIT_ATTACH -# define ATTACH 0 -#else -# define ATTACH 0x00000008 -#endif -#ifdef SQLITE_OMIT_AUTOINCREMENT -# define AUTOINCR 0 -#else -# define AUTOINCR 0x00000010 -#endif -#ifdef SQLITE_OMIT_CAST -# define CAST 0 -#else -# define CAST 0x00000020 -#endif -#ifdef SQLITE_OMIT_COMPOUND_SELECT -# define COMPOUND 0 -#else -# define COMPOUND 0x00000040 -#endif -#ifdef SQLITE_OMIT_CONFLICT_CLAUSE -# define CONFLICT 0 -#else -# define CONFLICT 0x00000080 -#endif -#ifdef SQLITE_OMIT_EXPLAIN -# define EXPLAIN 0 -#else -# define EXPLAIN 0x00000100 -#endif -#ifdef SQLITE_OMIT_FOREIGN_KEY -# define FKEY 0 -#else -# define FKEY 0x00000200 -#endif -#ifdef SQLITE_OMIT_PRAGMA -# define PRAGMA 0 -#else -# define PRAGMA 0x00000400 -#endif -#ifdef SQLITE_OMIT_REINDEX -# define REINDEX 0 -#else -# define REINDEX 0x00000800 -#endif -#ifdef SQLITE_OMIT_SUBQUERY -# define SUBQUERY 0 -#else -# define SUBQUERY 0x00001000 -#endif -#ifdef SQLITE_OMIT_TRIGGER -# define TRIGGER 0 -#else -# define TRIGGER 0x00002000 -#endif -#ifdef SQLITE_OMIT_VACUUM -# define VACUUM 0 -#else -# define VACUUM 0x00004000 -#endif -#ifdef SQLITE_OMIT_VIEW -# define VIEW 0 -#else -# define VIEW 0x00008000 -#endif - - -/* -** These are the keywords -*/ -static Keyword aKeywordTable[] = { - { "ABORT", "TK_ABORT", CONFLICT|TRIGGER }, - { "ADD", "TK_ADD", ALTER }, - { "AFTER", "TK_AFTER", TRIGGER }, - { "ALL", "TK_ALL", ALWAYS }, - { "ALTER", "TK_ALTER", ALTER }, - { "ANALYZE", "TK_ANALYZE", ANALYZE }, - { "AND", "TK_AND", ALWAYS }, - { "AS", "TK_AS", ALWAYS }, - { "ASC", "TK_ASC", ALWAYS }, - { "ATTACH", "TK_ATTACH", ATTACH }, - { "AUTOINCREMENT", "TK_AUTOINCR", AUTOINCR }, - { "BEFORE", "TK_BEFORE", TRIGGER }, - { "BEGIN", "TK_BEGIN", ALWAYS }, - { "BETWEEN", "TK_BETWEEN", ALWAYS }, - { "BY", "TK_BY", ALWAYS }, - { "CASCADE", "TK_CASCADE", FKEY }, - { "CASE", "TK_CASE", ALWAYS }, - { "CAST", "TK_CAST", CAST }, - { "CHECK", "TK_CHECK", ALWAYS }, - { "COLLATE", "TK_COLLATE", ALWAYS }, - { "COLUMN", "TK_COLUMNKW", ALTER }, - { "COMMIT", "TK_COMMIT", ALWAYS }, - { "CONFLICT", "TK_CONFLICT", CONFLICT }, - { "CONSTRAINT", "TK_CONSTRAINT", ALWAYS }, - { "CREATE", "TK_CREATE", ALWAYS }, - { "CROSS", "TK_JOIN_KW", ALWAYS }, - { "CURRENT_DATE", "TK_CTIME_KW", ALWAYS }, - { "CURRENT_TIME", "TK_CTIME_KW", ALWAYS }, - { "CURRENT_TIMESTAMP","TK_CTIME_KW", ALWAYS }, - { "DATABASE", "TK_DATABASE", ATTACH }, - { "DEFAULT", "TK_DEFAULT", ALWAYS }, - { "DEFERRED", "TK_DEFERRED", ALWAYS }, - { "DEFERRABLE", "TK_DEFERRABLE", FKEY }, - { "DELETE", "TK_DELETE", ALWAYS }, - { "DESC", "TK_DESC", ALWAYS }, - { "DETACH", "TK_DETACH", ATTACH }, - { "DISTINCT", "TK_DISTINCT", ALWAYS }, - { "DROP", "TK_DROP", ALWAYS }, - { "END", "TK_END", ALWAYS }, - { "EACH", "TK_EACH", TRIGGER }, - { "ELSE", "TK_ELSE", ALWAYS }, - { "ESCAPE", "TK_ESCAPE", ALWAYS }, - { "EXCEPT", "TK_EXCEPT", COMPOUND }, - { "EXCLUSIVE", "TK_EXCLUSIVE", ALWAYS }, - { "EXISTS", "TK_EXISTS", SUBQUERY }, - { "EXPLAIN", "TK_EXPLAIN", EXPLAIN }, - { "FAIL", "TK_FAIL", CONFLICT|TRIGGER }, - { "FOR", "TK_FOR", TRIGGER }, - { "FOREIGN", "TK_FOREIGN", FKEY }, - { "FROM", "TK_FROM", ALWAYS }, - { "FULL", "TK_JOIN_KW", ALWAYS }, - { "GLOB", "TK_LIKE_KW", ALWAYS }, - { "GROUP", "TK_GROUP", ALWAYS }, - { "HAVING", "TK_HAVING", ALWAYS }, - { "IGNORE", "TK_IGNORE", CONFLICT|TRIGGER }, - { "IMMEDIATE", "TK_IMMEDIATE", ALWAYS }, - { "IN", "TK_IN", ALWAYS }, - { "INDEX", "TK_INDEX", ALWAYS }, - { "INITIALLY", "TK_INITIALLY", FKEY }, - { "INNER", "TK_JOIN_KW", ALWAYS }, - { "INSERT", "TK_INSERT", ALWAYS }, - { "INSTEAD", "TK_INSTEAD", TRIGGER }, - { "INTERSECT", "TK_INTERSECT", COMPOUND }, - { "INTO", "TK_INTO", ALWAYS }, - { "IS", "TK_IS", ALWAYS }, - { "ISNULL", "TK_ISNULL", ALWAYS }, - { "JOIN", "TK_JOIN", ALWAYS }, - { "KEY", "TK_KEY", ALWAYS }, - { "LEFT", "TK_JOIN_KW", ALWAYS }, - { "LIKE", "TK_LIKE_KW", ALWAYS }, - { "LIMIT", "TK_LIMIT", ALWAYS }, - { "MATCH", "TK_MATCH", ALWAYS }, - { "NATURAL", "TK_JOIN_KW", ALWAYS }, - { "NOT", "TK_NOT", ALWAYS }, - { "NOTNULL", "TK_NOTNULL", ALWAYS }, - { "NULL", "TK_NULL", ALWAYS }, - { "OF", "TK_OF", ALWAYS }, - { "OFFSET", "TK_OFFSET", ALWAYS }, - { "ON", "TK_ON", ALWAYS }, - { "OR", "TK_OR", ALWAYS }, - { "ORDER", "TK_ORDER", ALWAYS }, - { "OUTER", "TK_JOIN_KW", ALWAYS }, - { "PRAGMA", "TK_PRAGMA", PRAGMA }, - { "PRIMARY", "TK_PRIMARY", ALWAYS }, - { "RAISE", "TK_RAISE", TRIGGER }, - { "REFERENCES", "TK_REFERENCES", FKEY }, - { "REGEXP", "TK_LIKE_KW", ALWAYS }, - { "REINDEX", "TK_REINDEX", REINDEX }, - { "RENAME", "TK_RENAME", ALTER }, - { "REPLACE", "TK_REPLACE", CONFLICT }, - { "RESTRICT", "TK_RESTRICT", FKEY }, - { "RIGHT", "TK_JOIN_KW", ALWAYS }, - { "ROLLBACK", "TK_ROLLBACK", ALWAYS }, - { "ROW", "TK_ROW", TRIGGER }, - { "SELECT", "TK_SELECT", ALWAYS }, - { "SET", "TK_SET", ALWAYS }, - { "STATEMENT", "TK_STATEMENT", TRIGGER }, - { "TABLE", "TK_TABLE", ALWAYS }, - { "TEMP", "TK_TEMP", ALWAYS }, - { "TEMPORARY", "TK_TEMP", ALWAYS }, - { "THEN", "TK_THEN", ALWAYS }, - { "TO", "TK_TO", ALTER }, - { "TRANSACTION", "TK_TRANSACTION", ALWAYS }, - { "TRIGGER", "TK_TRIGGER", TRIGGER }, - { "UNION", "TK_UNION", COMPOUND }, - { "UNIQUE", "TK_UNIQUE", ALWAYS }, - { "UPDATE", "TK_UPDATE", ALWAYS }, - { "USING", "TK_USING", ALWAYS }, - { "VACUUM", "TK_VACUUM", VACUUM }, - { "VALUES", "TK_VALUES", ALWAYS }, - { "VIEW", "TK_VIEW", VIEW }, - { "WHEN", "TK_WHEN", ALWAYS }, - { "WHERE", "TK_WHERE", ALWAYS }, -}; - -/* Number of keywords */ -static int NKEYWORD = (sizeof(aKeywordTable)/sizeof(aKeywordTable[0])); - -/* An array to map all upper-case characters into their corresponding -** lower-case character. -*/ -const unsigned char sqlite3UpperToLower[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121, - 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107, - 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125, - 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161, - 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179, - 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197, - 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215, - 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233, - 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251, - 252,253,254,255 -}; -#define UpperToLower sqlite3UpperToLower - -/* -** Comparision function for two Keyword records -*/ -static int keywordCompare1(const void *a, const void *b){ - const Keyword *pA = (Keyword*)a; - const Keyword *pB = (Keyword*)b; - int n = pA->len - pB->len; - if( n==0 ){ - n = strcmp(pA->zName, pB->zName); - } - return n; -} -static int keywordCompare2(const void *a, const void *b){ - const Keyword *pA = (Keyword*)a; - const Keyword *pB = (Keyword*)b; - int n = strcmp(pA->zName, pB->zName); - return n; -} -static int keywordCompare3(const void *a, const void *b){ - const Keyword *pA = (Keyword*)a; - const Keyword *pB = (Keyword*)b; - int n = pA->offset - pB->offset; - return n; -} - -/* -** Return a KeywordTable entry with the given id -*/ -static Keyword *findById(int id){ - int i; - for(i=0; i<NKEYWORD; i++){ - if( aKeywordTable[i].id==id ) break; - } - return &aKeywordTable[i]; -} - -/* -** This routine does the work. The generated code is printed on standard -** output. -*/ -int main(int argc, char **argv){ - int i, j, k, h; - int bestSize, bestCount; - int count; - int nChar; - int aHash[1000]; /* 1000 is much bigger than NKEYWORD */ - - /* Remove entries from the list of keywords that have mask==0 */ - for(i=j=0; i<NKEYWORD; i++){ - if( aKeywordTable[i].mask==0 ) continue; - if( j<i ){ - aKeywordTable[j] = aKeywordTable[i]; - } - j++; - } - NKEYWORD = j; - - /* Fill in the lengths of strings and hashes for all entries. */ - for(i=0; i<NKEYWORD; i++){ - Keyword *p = &aKeywordTable[i]; - p->len = strlen(p->zName); - p->hash = (UpperToLower[p->zName[0]]*4) ^ - (UpperToLower[p->zName[p->len-1]]*3) ^ p->len; - p->id = i+1; - } - - /* Sort the table from shortest to longest keyword */ - qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare1); - - /* Look for short keywords embedded in longer keywords */ - for(i=NKEYWORD-2; i>=0; i--){ - Keyword *p = &aKeywordTable[i]; - for(j=NKEYWORD-1; j>i && p->substrId==0; j--){ - Keyword *pOther = &aKeywordTable[j]; - if( pOther->substrId ) continue; - if( pOther->len<=p->len ) continue; - for(k=0; k<=pOther->len-p->len; k++){ - if( memcmp(p->zName, &pOther->zName[k], p->len)==0 ){ - p->substrId = pOther->id; - p->substrOffset = k; - break; - } - } - } - } - - /* Sort the table into alphabetical order */ - qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare2); - - /* Fill in the offset for all entries */ - nChar = 0; - for(i=0; i<NKEYWORD; i++){ - Keyword *p = &aKeywordTable[i]; - if( p->offset>0 || p->substrId ) continue; - p->offset = nChar; - nChar += p->len; - for(k=p->len-1; k>=1; k--){ - for(j=i+1; j<NKEYWORD; j++){ - Keyword *pOther = &aKeywordTable[j]; - if( pOther->offset>0 || pOther->substrId ) continue; - if( pOther->len<=k ) continue; - if( memcmp(&p->zName[p->len-k], pOther->zName, k)==0 ){ - p = pOther; - p->offset = nChar - k; - nChar = p->offset + p->len; - p->zName += k; - p->len -= k; - p->prefix = k; - j = i; - k = p->len; - } - } - } - } - for(i=0; i<NKEYWORD; i++){ - Keyword *p = &aKeywordTable[i]; - if( p->substrId ){ - p->offset = findById(p->substrId)->offset + p->substrOffset; - } - } - - /* Sort the table by offset */ - qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare3); - - /* Figure out how big to make the hash table in order to minimize the - ** number of collisions */ - bestSize = NKEYWORD; - bestCount = NKEYWORD*NKEYWORD; - for(i=NKEYWORD/2; i<=2*NKEYWORD; i++){ - for(j=0; j<i; j++) aHash[j] = 0; - for(j=0; j<NKEYWORD; j++){ - h = aKeywordTable[j].hash % i; - aHash[h] *= 2; - aHash[h]++; - } - for(j=count=0; j<i; j++) count += aHash[j]; - if( count<bestCount ){ - bestCount = count; - bestSize = i; - } - } - - /* Compute the hash */ - for(i=0; i<bestSize; i++) aHash[i] = 0; - for(i=0; i<NKEYWORD; i++){ - h = aKeywordTable[i].hash % bestSize; - aKeywordTable[i].iNext = aHash[h]; - aHash[h] = i+1; - } - - /* Begin generating code */ - printf("/* Hash score: %d */\n", bestCount); - printf("static int keywordCode(const char *z, int n){\n"); - - printf(" static const char zText[%d] =\n", nChar+1); - for(i=j=0; i<NKEYWORD; i++){ - Keyword *p = &aKeywordTable[i]; - if( p->substrId ) continue; - if( j==0 ) printf(" \""); - printf("%s", p->zName); - j += p->len; - if( j>60 ){ - printf("\"\n"); - j = 0; - } - } - printf("%s;\n", j>0 ? "\"" : " "); - - printf(" static const unsigned char aHash[%d] = {\n", bestSize); - for(i=j=0; i<bestSize; i++){ - if( j==0 ) printf(" "); - printf(" %3d,", aHash[i]); - j++; - if( j>12 ){ - printf("\n"); - j = 0; - } - } - printf("%s };\n", j==0 ? "" : "\n"); - - printf(" static const unsigned char aNext[%d] = {\n", NKEYWORD); - for(i=j=0; i<NKEYWORD; i++){ - if( j==0 ) printf(" "); - printf(" %3d,", aKeywordTable[i].iNext); - j++; - if( j>12 ){ - printf("\n"); - j = 0; - } - } - printf("%s };\n", j==0 ? "" : "\n"); - - printf(" static const unsigned char aLen[%d] = {\n", NKEYWORD); - for(i=j=0; i<NKEYWORD; i++){ - if( j==0 ) printf(" "); - printf(" %3d,", aKeywordTable[i].len+aKeywordTable[i].prefix); - j++; - if( j>12 ){ - printf("\n"); - j = 0; - } - } - printf("%s };\n", j==0 ? "" : "\n"); - - printf(" static const unsigned short int aOffset[%d] = {\n", NKEYWORD); - for(i=j=0; i<NKEYWORD; i++){ - if( j==0 ) printf(" "); - printf(" %3d,", aKeywordTable[i].offset); - j++; - if( j>12 ){ - printf("\n"); - j = 0; - } - } - printf("%s };\n", j==0 ? "" : "\n"); - - printf(" static const unsigned char aCode[%d] = {\n", NKEYWORD); - for(i=j=0; i<NKEYWORD; i++){ - char *zToken = aKeywordTable[i].zTokenType; - if( j==0 ) printf(" "); - printf("%s,%*s", zToken, (int)(14-strlen(zToken)), ""); - j++; - if( j>=5 ){ - printf("\n"); - j = 0; - } - } - printf("%s };\n", j==0 ? "" : "\n"); - - printf(" int h, i;\n"); - printf(" if( n<2 ) return TK_ID;\n"); - printf(" h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^\n" - " (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^\n" - " n) %% %d;\n", bestSize); - printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n"); - printf(" if( aLen[i]==n &&" - " sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n"); - printf(" return aCode[i];\n"); - printf(" }\n"); - printf(" }\n"); - printf(" return TK_ID;\n"); - printf("}\n"); - printf("int sqlite3KeywordCode(const char *z, int n){\n"); - printf(" return keywordCode(z, n);\n"); - printf("}\n"); - - return 0; -} diff --git a/ext/pdo_sqlite/sqlite/tool/mkopts.tcl b/ext/pdo_sqlite/sqlite/tool/mkopts.tcl deleted file mode 100755 index e3ddcb9eeb378..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/mkopts.tcl +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/tclsh -# -# This script is used to generate the array of strings and the enum -# that appear at the beginning of the C code implementation of a -# a TCL command and that define the available subcommands for that -# TCL command. - -set prefix {} -while {![eof stdin]} { - set line [gets stdin] - if {$line==""} continue - regsub -all "\[ \t\n,\]+" [string trim $line] { } line - foreach token [split $line { }] { - if {![regexp {(([a-zA-Z]+)_)?([_a-zA-Z]+)} $token all px p2 name]} continue - lappend namelist [string tolower $name] - if {$px!=""} {set prefix $p2} - } -} - -puts " static const char *${prefix}_strs\[\] = \173" -set col 0 -proc put_item x { - global col - if {$col==0} {puts -nonewline " "} - if {$col<2} { - puts -nonewline [format " %-21s" $x] - incr col - } else { - puts $x - set col 0 - } -} -proc finalize {} { - global col - if {$col>0} {puts {}} - set col 0 -} - -foreach name [lsort $namelist] { - put_item \"$name\", -} -put_item 0 -finalize -puts " \175;" -puts " enum ${prefix}_enum \173" -foreach name [lsort $namelist] { - regsub -all {@} $name {} name - put_item ${prefix}_[string toupper $name], -} -finalize -puts " \175;" diff --git a/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk b/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk deleted file mode 100644 index 492010624fd77..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk +++ /dev/null @@ -1,23 +0,0 @@ -# -# Extract opcode documentation for sqliteVdbe.c and generate HTML -# -BEGIN { - print "<html><body bgcolor=white>" - print "<h1>SQLite Virtual Database Engine Opcodes</h1>" - print "<table>" -} -/ Opcode: /,/\*\// { - if( $2=="Opcode:" ){ - printf "<tr><td>%s %s %s %s</td>\n<td>\n", $3, $4, $5, $6 - }else if( $1=="*/" ){ - printf "</td></tr>\n" - }else if( NF>1 ){ - sub(/^ *\*\* /,"") - gsub(/</,"<") - gsub(/&/,"&") - print - } -} -END { - print "</table></body></html>" -} diff --git a/ext/pdo_sqlite/sqlite/tool/report1.txt b/ext/pdo_sqlite/sqlite/tool/report1.txt deleted file mode 100644 index 7820b8ccf68bf..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/report1.txt +++ /dev/null @@ -1,66 +0,0 @@ -The SQL database used for ACD contains 113 tables and indices implemented -in GDBM. The following are statistics on the sizes of keys and data -within these tables and indices. - -Entries: 962080 -Size: 45573853 -Avg Size: 48 -Key Size: 11045299 -Avg Key Size: 12 -Max Key Size: 99 - - - Size of key Cummulative - and data Instances Percentage ------------- ---------- ----------- - 0..8 266 0% - 9..12 5485 0% - 13..16 73633 8% - 17..24 180918 27% - 25..32 209823 48% - 33..40 148995 64% - 41..48 76304 72% - 49..56 14346 73% - 57..64 15725 75% - 65..80 44916 80% - 81..96 127815 93% - 97..112 34769 96% - 113..128 13314 98% - 129..144 8098 99% - 145..160 3355 99% - 161..176 1159 99% - 177..192 629 99% - 193..208 221 99% - 209..224 210 99% - 225..240 129 99% - 241..256 57 99% - 257..288 496 99% - 289..320 60 99% - 321..352 37 99% - 353..384 46 99% - 385..416 22 99% - 417..448 24 99% - 449..480 26 99% - 481..512 27 99% - 513..1024 471 99% - 1025..2048 389 99% - 2049..4096 182 99% - 4097..8192 74 99% - 8193..16384 34 99% -16385..32768 17 99% -32769..65536 5 99% -65537..131073 3 100% - - -This information is gathered to help design the new built-in -backend for sqlite 2.0. Note in particular that 99% of all -database entries have a combined key and data size of less than -144 bytes. So if a leaf node in the new database is able to -store 144 bytes of combined key and data, only 1% of the leaves -will require overflow pages. Furthermore, note that no key -is larger than 99 bytes, so if the key will never be on an -overflow page. - -The average combined size of key+data is 48. Add in 16 bytes of -overhead for a total of 64. That means that a 1K page will -store (on average) about 16 entries. diff --git a/ext/pdo_sqlite/sqlite/tool/showdb.c b/ext/pdo_sqlite/sqlite/tool/showdb.c deleted file mode 100644 index fe105c7bb2861..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/showdb.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -** A utility for printing all or part of an SQLite database file. -*/ -#include <stdio.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <stdlib.h> - - -static int pagesize = 1024; -static int db = -1; -static int mxPage = 0; - -static void out_of_memory(void){ - fprintf(stderr,"Out of memory...\n"); - exit(1); -} - -static print_page(int iPg){ - unsigned char *aData; - int i, j; - aData = malloc(pagesize); - if( aData==0 ) out_of_memory(); - lseek(db, (iPg-1)*pagesize, SEEK_SET); - read(db, aData, pagesize); - fprintf(stdout, "Page %d:\n", iPg); - for(i=0; i<pagesize; i += 16){ - fprintf(stdout, " %03x: ",i); - for(j=0; j<16; j++){ - fprintf(stdout,"%02x ", aData[i+j]); - } - for(j=0; j<16; j++){ - fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.'); - } - fprintf(stdout,"\n"); - } - free(aData); -} - -int main(int argc, char **argv){ - struct stat sbuf; - if( argc<2 ){ - fprintf(stderr,"Usage: %s FILENAME ?PAGE? ...\n", argv[0]); - exit(1); - } - db = open(argv[1], O_RDONLY); - if( db<0 ){ - fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]); - exit(1); - } - fstat(db, &sbuf); - mxPage = sbuf.st_size/pagesize + 1; - if( argc==2 ){ - int i; - for(i=1; i<=mxPage; i++) print_page(i); - }else{ - int i; - for(i=2; i<argc; i++){ - int iStart, iEnd; - char *zLeft; - iStart = strtol(argv[i], &zLeft, 0); - if( zLeft && strcmp(zLeft,"..end")==0 ){ - iEnd = mxPage; - }else if( zLeft && zLeft[0]=='.' && zLeft[1]=='.' ){ - iEnd = strtol(&zLeft[2], 0, 0); - }else{ - iEnd = iStart; - } - if( iStart<1 || iEnd<iStart || iEnd>mxPage ){ - fprintf(stderr, - "Page argument should be LOWER?..UPPER?. Range 1 to %d\n", - mxPage); - exit(1); - } - while( iStart<=iEnd ){ - print_page(iStart); - iStart++; - } - } - } - close(db); -} diff --git a/ext/pdo_sqlite/sqlite/tool/showjournal.c b/ext/pdo_sqlite/sqlite/tool/showjournal.c deleted file mode 100644 index ec93c9190522c..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/showjournal.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -** A utility for printing an SQLite database journal. -*/ -#include <stdio.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <stdlib.h> - - -static int pagesize = 1024; -static int db = -1; -static int mxPage = 0; - -static void out_of_memory(void){ - fprintf(stderr,"Out of memory...\n"); - exit(1); -} - -static print_page(int iPg){ - unsigned char *aData; - int i, j; - aData = malloc(pagesize); - if( aData==0 ) out_of_memory(); - read(db, aData, pagesize); - fprintf(stdout, "Page %d:\n", iPg); - for(i=0; i<pagesize; i += 16){ - fprintf(stdout, " %03x: ",i); - for(j=0; j<16; j++){ - fprintf(stdout,"%02x ", aData[i+j]); - } - for(j=0; j<16; j++){ - fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.'); - } - fprintf(stdout,"\n"); - } - free(aData); -} - -int main(int argc, char **argv){ - struct stat sbuf; - unsigned int u; - int rc; - unsigned char zBuf[10]; - unsigned char zBuf2[sizeof(u)]; - if( argc!=2 ){ - fprintf(stderr,"Usage: %s FILENAME\n", argv[0]); - exit(1); - } - db = open(argv[1], O_RDONLY); - if( db<0 ){ - fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]); - exit(1); - } - read(db, zBuf, 8); - if( zBuf[7]==0xd6 ){ - read(db, &u, sizeof(u)); - printf("Records in Journal: %u\n", u); - read(db, &u, sizeof(u)); - printf("Magic Number: 0x%08x\n", u); - } - read(db, zBuf2, sizeof(zBuf2)); - u = zBuf2[0]<<24 | zBuf2[1]<<16 | zBuf2[2]<<8 | zBuf2[3]; - printf("Database Size: %u\n", u); - while( read(db, zBuf2, sizeof(zBuf2))==sizeof(zBuf2) ){ - u = zBuf2[0]<<24 | zBuf2[1]<<16 | zBuf2[2]<<8 | zBuf2[3]; - print_page(u); - if( zBuf[7]==0xd6 ){ - read(db, &u, sizeof(u)); - printf("Checksum: 0x%08x\n", u); - } - } - close(db); -} diff --git a/ext/pdo_sqlite/sqlite/tool/space_used.tcl b/ext/pdo_sqlite/sqlite/tool/space_used.tcl deleted file mode 100644 index 2044aa38c5ecd..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/space_used.tcl +++ /dev/null @@ -1,111 +0,0 @@ -# Run this TCL script using "testfixture" in order get a report that shows -# how much disk space is used by a particular data to actually store data -# versus how much space is unused. -# - -# Get the name of the database to analyze -# -if {[llength $argv]!=1} { - puts stderr "Usage: $argv0 database-name" - exit 1 -} -set file_to_analyze [lindex $argv 0] - -# Open the database -# -sqlite db [lindex $argv 0] -set DB [btree_open [lindex $argv 0]] - -# Output the schema for the generated report -# -puts \ -{BEGIN; -CREATE TABLE space_used( - name clob, -- Name of a table or index in the database file - is_index boolean, -- TRUE if it is an index, false for a table - payload int, -- Total amount of data stored in this table or index - pri_pages int, -- Number of primary pages used - ovfl_pages int, -- Number of overflow pages used - pri_unused int, -- Number of unused bytes on primary pages - ovfl_unused int -- Number of unused bytes on overflow pages -);} - -# This query will be used to find the root page number for every index and -# table in the database. -# -set sql { - SELECT name, type, rootpage FROM sqlite_master - UNION ALL - SELECT 'sqlite_master', 'table', 2 - ORDER BY 1 -} - -# Initialize variables used for summary statistics. -# -set total_size 0 -set total_primary 0 -set total_overflow 0 -set total_unused_primary 0 -set total_unused_ovfl 0 - -# Analyze every table in the database, one at a time. -# -foreach {name type rootpage} [db eval $sql] { - set cursor [btree_cursor $DB $rootpage 0] - set go [btree_first $cursor] - set size 0 - catch {unset pg_used} - set unused_ovfl 0 - set n_overflow 0 - while {$go==0} { - set payload [btree_payload_size $cursor] - incr size $payload - set stat [btree_cursor_dump $cursor] - set pgno [lindex $stat 0] - set freebytes [lindex $stat 4] - set pg_used($pgno) $freebytes - if {$payload>238} { - set n [expr {($payload-238+1019)/1020}] - incr n_overflow $n - incr unused_ovfl [expr {$n*1020+238-$payload}] - } - set go [btree_next $cursor] - } - btree_close_cursor $cursor - set n_primary [llength [array names pg_used]] - set unused_primary 0 - foreach x [array names pg_used] {incr unused_primary $pg_used($x)} - regsub -all ' $name '' name - puts -nonewline "INSERT INTO space_used VALUES('$name'" - puts -nonewline ",[expr {$type=="index"}]" - puts ",$size,$n_primary,$n_overflow,$unused_primary,$unused_ovfl);" - incr total_size $size - incr total_primary $n_primary - incr total_overflow $n_overflow - incr total_unused_primary $unused_primary - incr total_unused_ovfl $unused_ovfl -} - -# Output summary statistics: -# -puts "-- Total payload size: $total_size" -puts "-- Total pages used: $total_primary primary and $total_overflow overflow" -set file_pgcnt [expr {[file size [lindex $argv 0]]/1024}] -puts -nonewline "-- Total unused bytes on primary pages: $total_unused_primary" -if {$total_primary>0} { - set upp [expr {$total_unused_primary/$total_primary}] - puts " (avg $upp bytes/page)" -} else { - puts "" -} -puts -nonewline "-- Total unused bytes on overflow pages: $total_unused_ovfl" -if {$total_overflow>0} { - set upp [expr {$total_unused_ovfl/$total_overflow}] - puts " (avg $upp bytes/page)" -} else { - puts "" -} -set n_free [expr {$file_pgcnt-$total_primary-$total_overflow}] -if {$n_free>0} {incr n_free -1} -puts "-- Total pages on freelist: $n_free" -puts "COMMIT;" diff --git a/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl b/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl deleted file mode 100644 index c9b8f92e25257..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl +++ /dev/null @@ -1,801 +0,0 @@ -# Run this TCL script using "testfixture" in order get a report that shows -# how much disk space is used by a particular data to actually store data -# versus how much space is unused. -# - -# Get the name of the database to analyze -# -#set argv $argv0 -if {[llength $argv]!=1} { - puts stderr "Usage: $argv0 database-name" - exit 1 -} -set file_to_analyze [lindex $argv 0] -if {![file exists $file_to_analyze]} { - puts stderr "No such file: $file_to_analyze" - exit 1 -} -if {![file readable $file_to_analyze]} { - puts stderr "File is not readable: $file_to_analyze" - exit 1 -} -if {[file size $file_to_analyze]<512} { - puts stderr "Empty or malformed database: $file_to_analyze" - exit 1 -} - -# Open the database -# -sqlite3 db [lindex $argv 0] -set DB [btree_open [lindex $argv 0] 1000 0] - -# In-memory database for collecting statistics. This script loops through -# the tables and indices in the database being analyzed, adding a row for each -# to an in-memory database (for which the schema is shown below). It then -# queries the in-memory db to produce the space-analysis report. -# -sqlite3 mem :memory: -set tabledef\ -{CREATE TABLE space_used( - name clob, -- Name of a table or index in the database file - tblname clob, -- Name of associated table - is_index boolean, -- TRUE if it is an index, false for a table - nentry int, -- Number of entries in the BTree - leaf_entries int, -- Number of leaf entries - payload int, -- Total amount of data stored in this table or index - ovfl_payload int, -- Total amount of data stored on overflow pages - ovfl_cnt int, -- Number of entries that use overflow - mx_payload int, -- Maximum payload size - int_pages int, -- Number of interior pages used - leaf_pages int, -- Number of leaf pages used - ovfl_pages int, -- Number of overflow pages used - int_unused int, -- Number of unused bytes on interior pages - leaf_unused int, -- Number of unused bytes on primary pages - ovfl_unused int -- Number of unused bytes on overflow pages -);} -mem eval $tabledef - -proc integerify {real} { - return [expr int($real)] -} -mem function int integerify - -# Quote a string for use in an SQL query. Examples: -# -# [quote {hello world}] == {'hello world'} -# [quote {hello world's}] == {'hello world''s'} -# -proc quote {txt} { - regsub -all ' $txt '' q - return '$q' -} - -# This proc is a wrapper around the btree_cursor_info command. The -# second argument is an open btree cursor returned by [btree_cursor]. -# The first argument is the name of an array variable that exists in -# the scope of the caller. If the third argument is non-zero, then -# info is returned for the page that lies $up entries upwards in the -# tree-structure. (i.e. $up==1 returns the parent page, $up==2 the -# grandparent etc.) -# -# The following entries in that array are filled in with information retrieved -# using [btree_cursor_info]: -# -# $arrayvar(page_no) = The page number -# $arrayvar(entry_no) = The entry number -# $arrayvar(page_entries) = Total number of entries on this page -# $arrayvar(cell_size) = Cell size (local payload + header) -# $arrayvar(page_freebytes) = Number of free bytes on this page -# $arrayvar(page_freeblocks) = Number of free blocks on the page -# $arrayvar(payload_bytes) = Total payload size (local + overflow) -# $arrayvar(header_bytes) = Header size in bytes -# $arrayvar(local_payload_bytes) = Local payload size -# $arrayvar(parent) = Parent page number -# -proc cursor_info {arrayvar csr {up 0}} { - upvar $arrayvar a - foreach [list a(page_no) \ - a(entry_no) \ - a(page_entries) \ - a(cell_size) \ - a(page_freebytes) \ - a(page_freeblocks) \ - a(payload_bytes) \ - a(header_bytes) \ - a(local_payload_bytes) \ - a(parent) ] [btree_cursor_info $csr $up] {} -} - -# Determine the page-size of the database. This global variable is used -# throughout the script. -# -set pageSize [db eval {PRAGMA page_size}] - -# Analyze every table in the database, one at a time. -# -# The following query returns the name and root-page of each table in the -# database, including the sqlite_master table. -# -set sql { - SELECT name, rootpage FROM sqlite_master WHERE type='table' - UNION ALL - SELECT 'sqlite_master', 1 - ORDER BY 1 -} -foreach {name rootpage} [db eval $sql] { - puts stderr "Analyzing table $name..." - - # Code below traverses the table being analyzed (table name $name), using the - # btree cursor $cursor. Statistics related to table $name are accumulated in - # the following variables: - # - set total_payload 0 ;# Payload space used by all entries - set total_ovfl 0 ;# Payload space on overflow pages - set unused_int 0 ;# Unused space on interior nodes - set unused_leaf 0 ;# Unused space on leaf nodes - set unused_ovfl 0 ;# Unused space on overflow pages - set cnt_ovfl 0 ;# Number of entries that use overflows - set cnt_leaf_entry 0 ;# Number of leaf entries - set cnt_int_entry 0 ;# Number of interor entries - set mx_payload 0 ;# Maximum payload size - set ovfl_pages 0 ;# Number of overflow pages used - set leaf_pages 0 ;# Number of leaf pages - set int_pages 0 ;# Number of interior pages - - # As the btree is traversed, the array variable $seen($pgno) is set to 1 - # the first time page $pgno is encountered. - # - catch {unset seen} - - # The following loop runs once for each entry in table $name. The table - # is traversed using the btree cursor stored in variable $csr - # - set csr [btree_cursor $DB $rootpage 0] - for {btree_first $csr} {![btree_eof $csr]} {btree_next $csr} { - incr cnt_leaf_entry - - # Retrieve information about the entry the btree-cursor points to into - # the array variable $ci (cursor info). - # - cursor_info ci $csr - - # Check if the payload of this entry is greater than the current - # $mx_payload statistic for the table. Also increase the $total_payload - # statistic. - # - if {$ci(payload_bytes)>$mx_payload} {set mx_payload $ci(payload_bytes)} - incr total_payload $ci(payload_bytes) - - # If this entry uses overflow pages, then update the $cnt_ovfl, - # $total_ovfl, $ovfl_pages and $unused_ovfl statistics. - # - set ovfl [expr {$ci(payload_bytes)-$ci(local_payload_bytes)}] - if {$ovfl} { - incr cnt_ovfl - incr total_ovfl $ovfl - set n [expr {int(ceil($ovfl/($pageSize-4.0)))}] - incr ovfl_pages $n - incr unused_ovfl [expr {$n*($pageSize-4) - $ovfl}] - } - - # If this is the first table entry analyzed for the page, then update - # the page-related statistics $leaf_pages and $unused_leaf. Also, if - # this page has a parent page that has not been analyzed, retrieve - # info for the parent and update statistics for it too. - # - if {![info exists seen($ci(page_no))]} { - set seen($ci(page_no)) 1 - incr leaf_pages - incr unused_leaf $ci(page_freebytes) - - # Now check if the page has a parent that has not been analyzed. If - # so, update the $int_pages, $cnt_int_entry and $unused_int statistics - # accordingly. Then check if the parent page has a parent that has - # not yet been analyzed etc. - # - # set parent $ci(parent_page_no) - for {set up 1} \ - {$ci(parent)!=0 && ![info exists seen($ci(parent))]} {incr up} \ - { - # Mark the parent as seen. - # - set seen($ci(parent)) 1 - - # Retrieve info for the parent and update statistics. - cursor_info ci $csr $up - incr int_pages - incr cnt_int_entry $ci(page_entries) - incr unused_int $ci(page_freebytes) - } - } - } - btree_close_cursor $csr - - # Handle the special case where a table contains no data. In this case - # all statistics are zero, except for the number of leaf pages (1) and - # the unused bytes on leaf pages ($pageSize - 8). - # - # An exception to the above is the sqlite_master table. If it is empty - # then all statistics are zero except for the number of leaf pages (1), - # and the number of unused bytes on leaf pages ($pageSize - 112). - # - if {[llength [array names seen]]==0} { - set leaf_pages 1 - if {$rootpage==1} { - set unused_leaf [expr {$pageSize-112}] - } else { - set unused_leaf [expr {$pageSize-8}] - } - } - - # Insert the statistics for the table analyzed into the in-memory database. - # - set sql "INSERT INTO space_used VALUES(" - append sql [quote $name] - append sql ",[quote $name]" - append sql ",0" - append sql ",[expr {$cnt_leaf_entry+$cnt_int_entry}]" - append sql ",$cnt_leaf_entry" - append sql ",$total_payload" - append sql ",$total_ovfl" - append sql ",$cnt_ovfl" - append sql ",$mx_payload" - append sql ",$int_pages" - append sql ",$leaf_pages" - append sql ",$ovfl_pages" - append sql ",$unused_int" - append sql ",$unused_leaf" - append sql ",$unused_ovfl" - append sql ); - mem eval $sql -} - -# Analyze every index in the database, one at a time. -# -# The query below returns the name, associated table and root-page number -# for every index in the database. -# -set sql { - SELECT name, tbl_name, rootpage FROM sqlite_master WHERE type='index' - ORDER BY 2, 1 -} -foreach {name tbl_name rootpage} [db eval $sql] { - puts stderr "Analyzing index $name of table $tbl_name..." - - # Code below traverses the index being analyzed (index name $name), using the - # btree cursor $cursor. Statistics related to index $name are accumulated in - # the following variables: - # - set total_payload 0 ;# Payload space used by all entries - set total_ovfl 0 ;# Payload space on overflow pages - set unused_leaf 0 ;# Unused space on leaf nodes - set unused_ovfl 0 ;# Unused space on overflow pages - set cnt_ovfl 0 ;# Number of entries that use overflows - set cnt_leaf_entry 0 ;# Number of leaf entries - set mx_payload 0 ;# Maximum payload size - set ovfl_pages 0 ;# Number of overflow pages used - set leaf_pages 0 ;# Number of leaf pages - - # As the btree is traversed, the array variable $seen($pgno) is set to 1 - # the first time page $pgno is encountered. - # - catch {unset seen} - - # The following loop runs once for each entry in index $name. The index - # is traversed using the btree cursor stored in variable $csr - # - set csr [btree_cursor $DB $rootpage 0] - for {btree_first $csr} {![btree_eof $csr]} {btree_next $csr} { - incr cnt_leaf_entry - - # Retrieve information about the entry the btree-cursor points to into - # the array variable $ci (cursor info). - # - cursor_info ci $csr - - # Check if the payload of this entry is greater than the current - # $mx_payload statistic for the table. Also increase the $total_payload - # statistic. - # - set payload [btree_keysize $csr] - if {$payload>$mx_payload} {set mx_payload $payload} - incr total_payload $payload - - # If this entry uses overflow pages, then update the $cnt_ovfl, - # $total_ovfl, $ovfl_pages and $unused_ovfl statistics. - # - set ovfl [expr {$payload-$ci(local_payload_bytes)}] - if {$ovfl} { - incr cnt_ovfl - incr total_ovfl $ovfl - set n [expr {int(ceil($ovfl/($pageSize-4.0)))}] - incr ovfl_pages $n - incr unused_ovfl [expr {$n*($pageSize-4) - $ovfl}] - } - - # If this is the first table entry analyzed for the page, then update - # the page-related statistics $leaf_pages and $unused_leaf. - # - if {![info exists seen($ci(page_no))]} { - set seen($ci(page_no)) 1 - incr leaf_pages - incr unused_leaf $ci(page_freebytes) - } - } - btree_close_cursor $csr - - # Handle the special case where a index contains no data. In this case - # all statistics are zero, except for the number of leaf pages (1) and - # the unused bytes on leaf pages ($pageSize - 8). - # - if {[llength [array names seen]]==0} { - set leaf_pages 1 - set unused_leaf [expr {$pageSize-8}] - } - - # Insert the statistics for the index analyzed into the in-memory database. - # - set sql "INSERT INTO space_used VALUES(" - append sql [quote $name] - append sql ",[quote $tbl_name]" - append sql ",1" - append sql ",$cnt_leaf_entry" - append sql ",$cnt_leaf_entry" - append sql ",$total_payload" - append sql ",$total_ovfl" - append sql ",$cnt_ovfl" - append sql ",$mx_payload" - append sql ",0" - append sql ",$leaf_pages" - append sql ",$ovfl_pages" - append sql ",0" - append sql ",$unused_leaf" - append sql ",$unused_ovfl" - append sql ); - mem eval $sql -} - -# Generate a single line of output in the statistics section of the -# report. -# -proc statline {title value {extra {}}} { - set len [string length $title] - set dots [string range {......................................} $len end] - set len [string length $value] - set sp2 [string range { } $len end] - if {$extra ne ""} { - set extra " $extra" - } - puts "$title$dots $value$sp2$extra" -} - -# Generate a formatted percentage value for $num/$denom -# -proc percent {num denom {of {}}} { - if {$denom==0.0} {return ""} - set v [expr {$num*100.0/$denom}] - set of {} - if {$v==100.0 || $v<0.001 || ($v>1.0 && $v<99.0)} { - return [format {%5.1f%% %s} $v $of] - } elseif {$v<0.1 || $v>99.9} { - return [format {%7.3f%% %s} $v $of] - } else { - return [format {%6.2f%% %s} $v $of] - } -} - -proc divide {num denom} { - if {$denom==0} {return 0.0} - return [format %.2f [expr double($num)/double($denom)]] -} - -# Generate a subreport that covers some subset of the database. -# the $where clause determines which subset to analyze. -# -proc subreport {title where} { - global pageSize file_pgcnt - - # Query the in-memory database for the sum of various statistics - # for the subset of tables/indices identified by the WHERE clause in - # $where. Note that even if the WHERE clause matches no rows, the - # following query returns exactly one row (because it is an aggregate). - # - # The results of the query are stored directly by SQLite into local - # variables (i.e. $nentry, $nleaf etc.). - # - mem eval " - SELECT - int(sum(nentry)) AS nentry, - int(sum(leaf_entries)) AS nleaf, - int(sum(payload)) AS payload, - int(sum(ovfl_payload)) AS ovfl_payload, - max(mx_payload) AS mx_payload, - int(sum(ovfl_cnt)) as ovfl_cnt, - int(sum(leaf_pages)) AS leaf_pages, - int(sum(int_pages)) AS int_pages, - int(sum(ovfl_pages)) AS ovfl_pages, - int(sum(leaf_unused)) AS leaf_unused, - int(sum(int_unused)) AS int_unused, - int(sum(ovfl_unused)) AS ovfl_unused - FROM space_used WHERE $where" {} {} - - # Output the sub-report title, nicely decorated with * characters. - # - puts "" - set len [string length $title] - set stars [string repeat * [expr 65-$len]] - puts "*** $title $stars" - puts "" - - # Calculate statistics and store the results in TCL variables, as follows: - # - # total_pages: Database pages consumed. - # total_pages_percent: Pages consumed as a percentage of the file. - # storage: Bytes consumed. - # payload_percent: Payload bytes used as a percentage of $storage. - # total_unused: Unused bytes on pages. - # avg_payload: Average payload per btree entry. - # avg_fanout: Average fanout for internal pages. - # avg_unused: Average unused bytes per btree entry. - # ovfl_cnt_percent: Percentage of btree entries that use overflow pages. - # - set total_pages [expr {$leaf_pages+$int_pages+$ovfl_pages}] - set total_pages_percent [percent $total_pages $file_pgcnt] - set storage [expr {$total_pages*$pageSize}] - set payload_percent [percent $payload $storage {of storage consumed}] - set total_unused [expr {$ovfl_unused+$int_unused+$leaf_unused}] - set avg_payload [divide $payload $nleaf] - set avg_unused [divide $total_unused $nleaf] - if {$int_pages>0} { - # TODO: Is this formula correct? - set nTab [mem eval " - SELECT count(*) FROM ( - SELECT DISTINCT tblname FROM space_used WHERE $where AND is_index=0 - ) - "] - set avg_fanout [mem eval " - SELECT (sum(leaf_pages+int_pages)-$nTab)/sum(int_pages) FROM space_used - WHERE $where AND is_index = 0 - "] - set avg_fanout [format %.2f $avg_fanout] - } - set ovfl_cnt_percent [percent $ovfl_cnt $nleaf {of all entries}] - - # Print out the sub-report statistics. - # - statline {Percentage of total database} $total_pages_percent - statline {Number of entries} $nleaf - statline {Bytes of storage consumed} $storage - statline {Bytes of payload} $payload $payload_percent - statline {Average payload per entry} $avg_payload - statline {Average unused bytes per entry} $avg_unused - if {[info exists avg_fanout]} { - statline {Average fanout} $avg_fanout - } - statline {Maximum payload per entry} $mx_payload - statline {Entries that use overflow} $ovfl_cnt $ovfl_cnt_percent - if {$int_pages>0} { - statline {Index pages used} $int_pages - } - statline {Primary pages used} $leaf_pages - statline {Overflow pages used} $ovfl_pages - statline {Total pages used} $total_pages - if {$int_unused>0} { - set int_unused_percent \ - [percent $int_unused [expr {$int_pages*$pageSize}] {of index space}] - statline "Unused bytes on index pages" $int_unused $int_unused_percent - } - statline "Unused bytes on primary pages" $leaf_unused \ - [percent $leaf_unused [expr {$leaf_pages*$pageSize}] {of primary space}] - statline "Unused bytes on overflow pages" $ovfl_unused \ - [percent $ovfl_unused [expr {$ovfl_pages*$pageSize}] {of overflow space}] - statline "Unused bytes on all pages" $total_unused \ - [percent $total_unused $storage {of all space}] - return 1 -} - -# Calculate the overhead in pages caused by auto-vacuum. -# -# This procedure calculates and returns the number of pages used by the -# auto-vacuum 'pointer-map'. If the database does not support auto-vacuum, -# then 0 is returned. The two arguments are the size of the database file in -# pages and the page size used by the database (in bytes). -proc autovacuum_overhead {filePages pageSize} { - - # Read the value of meta 4. If non-zero, then the database supports - # auto-vacuum. It would be possible to use "PRAGMA auto_vacuum" instead, - # but that would not work if the SQLITE_OMIT_PRAGMA macro was defined - # when the library was built. - set meta4 [lindex [btree_get_meta $::DB] 4] - - # If the database is not an auto-vacuum database or the file consists - # of one page only then there is no overhead for auto-vacuum. Return zero. - if {0==$meta4 || $filePages==1} { - return 0 - } - - # The number of entries on each pointer map page. The layout of the - # database file is one pointer-map page, followed by $ptrsPerPage other - # pages, followed by a pointer-map page etc. The first pointer-map page - # is the second page of the file overall. - set ptrsPerPage [expr double($pageSize/5)] - - # Return the number of pointer map pages in the database. - return [expr int(ceil( ($filePages-1.0)/($ptrsPerPage+1.0) ))] -} - - -# Calculate the summary statistics for the database and store the results -# in TCL variables. They are output below. Variables are as follows: -# -# pageSize: Size of each page in bytes. -# file_bytes: File size in bytes. -# file_pgcnt: Number of pages in the file. -# file_pgcnt2: Number of pages in the file (calculated). -# av_pgcnt: Pages consumed by the auto-vacuum pointer-map. -# av_percent: Percentage of the file consumed by auto-vacuum pointer-map. -# inuse_pgcnt: Data pages in the file. -# inuse_percent: Percentage of pages used to store data. -# free_pgcnt: Free pages calculated as (<total pages> - <in-use pages>) -# free_pgcnt2: Free pages in the file according to the file header. -# free_percent: Percentage of file consumed by free pages (calculated). -# free_percent2: Percentage of file consumed by free pages (header). -# ntable: Number of tables in the db. -# nindex: Number of indices in the db. -# nautoindex: Number of indices created automatically. -# nmanindex: Number of indices created manually. -# user_payload: Number of bytes of payload in table btrees -# (not including sqlite_master) -# user_percent: $user_payload as a percentage of total file size. - -set file_bytes [file size $file_to_analyze] -set file_pgcnt [expr {$file_bytes/$pageSize}] - -set av_pgcnt [autovacuum_overhead $file_pgcnt $pageSize] -set av_percent [percent $av_pgcnt $file_pgcnt] - -set sql {SELECT sum(leaf_pages+int_pages+ovfl_pages) FROM space_used} -set inuse_pgcnt [expr int([mem eval $sql])] -set inuse_percent [percent $inuse_pgcnt $file_pgcnt] - -set free_pgcnt [expr $file_pgcnt-$inuse_pgcnt-$av_pgcnt] -set free_percent [percent $free_pgcnt $file_pgcnt] -set free_pgcnt2 [lindex [btree_get_meta $DB] 0] -set free_percent2 [percent $free_pgcnt2 $file_pgcnt] - -set file_pgcnt2 [expr {$inuse_pgcnt+$free_pgcnt2+$av_pgcnt}] - -set ntable [db eval {SELECT count(*)+1 FROM sqlite_master WHERE type='table'}] -set nindex [db eval {SELECT count(*) FROM sqlite_master WHERE type='index'}] -set sql {SELECT count(*) FROM sqlite_master WHERE name LIKE 'sqlite_autoindex%'} -set nautoindex [db eval $sql] -set nmanindex [expr {$nindex-$nautoindex}] - -# set total_payload [mem eval "SELECT sum(payload) FROM space_used"] -set user_payload [mem one {SELECT int(sum(payload)) FROM space_used - WHERE NOT is_index AND name NOT LIKE 'sqlite_master'}] -set user_percent [percent $user_payload $file_bytes] - -# Output the summary statistics calculated above. -# -puts "/** Disk-Space Utilization Report For $file_to_analyze" -puts "*** As of [clock format [clock seconds] -format {%Y-%b-%d %H:%M:%S}]" -puts "" -statline {Page size in bytes} $pageSize -statline {Pages in the whole file (measured)} $file_pgcnt -statline {Pages in the whole file (calculated)} $file_pgcnt2 -statline {Pages that store data} $inuse_pgcnt $inuse_percent -statline {Pages on the freelist (per header)} $free_pgcnt2 $free_percent2 -statline {Pages on the freelist (calculated)} $free_pgcnt $free_percent -statline {Pages of auto-vacuum overhead} $av_pgcnt $av_percent -statline {Number of tables in the database} $ntable -statline {Number of indices} $nindex -statline {Number of named indices} $nmanindex -statline {Automatically generated indices} $nautoindex -statline {Size of the file in bytes} $file_bytes -statline {Bytes of user payload stored} $user_payload $user_percent - -# Output table rankings -# -puts "" -puts "*** Page counts for all tables with their indices ********************" -puts "" -mem eval {SELECT tblname, count(*) AS cnt, - int(sum(int_pages+leaf_pages+ovfl_pages)) AS size - FROM space_used GROUP BY tblname ORDER BY size+0 DESC, tblname} {} { - statline [string toupper $tblname] $size [percent $size $file_pgcnt] -} - -# Output subreports -# -if {$nindex>0} { - subreport {All tables and indices} 1 -} -subreport {All tables} {NOT is_index} -if {$nindex>0} { - subreport {All indices} {is_index} -} -foreach tbl [mem eval {SELECT name FROM space_used WHERE NOT is_index - ORDER BY name}] { - regsub ' $tbl '' qn - set name [string toupper $tbl] - set n [mem eval "SELECT count(*) FROM space_used WHERE tblname='$qn'"] - if {$n>1} { - subreport "Table $name and all its indices" "tblname='$qn'" - subreport "Table $name w/o any indices" "name='$qn'" - subreport "Indices of table $name" "tblname='$qn' AND is_index" - } else { - subreport "Table $name" "name='$qn'" - } -} - -# Output instructions on what the numbers above mean. -# -puts { -*** Definitions ****************************************************** - -Page size in bytes - - The number of bytes in a single page of the database file. - Usually 1024. - -Number of pages in the whole file -} -puts \ -" The number of $pageSize-byte pages that go into forming the complete - database" -puts \ -{ -Pages that store data - - The number of pages that store data, either as primary B*Tree pages or - as overflow pages. The number at the right is the data pages divided by - the total number of pages in the file. - -Pages on the freelist - - The number of pages that are not currently in use but are reserved for - future use. The percentage at the right is the number of freelist pages - divided by the total number of pages in the file. - -Pages of auto-vacuum overhead - - The number of pages that store data used by the database to facilitate - auto-vacuum. This is zero for databases that do not support auto-vacuum. - -Number of tables in the database - - The number of tables in the database, including the SQLITE_MASTER table - used to store schema information. - -Number of indices - - The total number of indices in the database. - -Number of named indices - - The number of indices created using an explicit CREATE INDEX statement. - -Automatically generated indices - - The number of indices used to implement PRIMARY KEY or UNIQUE constraints - on tables. - -Size of the file in bytes - - The total amount of disk space used by the entire database files. - -Bytes of user payload stored - - The total number of bytes of user payload stored in the database. The - schema information in the SQLITE_MASTER table is not counted when - computing this number. The percentage at the right shows the payload - divided by the total file size. - -Percentage of total database - - The amount of the complete database file that is devoted to storing - information described by this category. - -Number of entries - - The total number of B-Tree key/value pairs stored under this category. - -Bytes of storage consumed - - The total amount of disk space required to store all B-Tree entries - under this category. The is the total number of pages used times - the pages size. - -Bytes of payload - - The amount of payload stored under this category. Payload is the data - part of table entries and the key part of index entries. The percentage - at the right is the bytes of payload divided by the bytes of storage - consumed. - -Average payload per entry - - The average amount of payload on each entry. This is just the bytes of - payload divided by the number of entries. - -Average unused bytes per entry - - The average amount of free space remaining on all pages under this - category on a per-entry basis. This is the number of unused bytes on - all pages divided by the number of entries. - -Maximum payload per entry - - The largest payload size of any entry. - -Entries that use overflow - - The number of entries that user one or more overflow pages. - -Total pages used - - This is the number of pages used to hold all information in the current - category. This is the sum of index, primary, and overflow pages. - -Index pages used - - This is the number of pages in a table B-tree that hold only key (rowid) - information and no data. - -Primary pages used - - This is the number of B-tree pages that hold both key and data. - -Overflow pages used - - The total number of overflow pages used for this category. - -Unused bytes on index pages - - The total number of bytes of unused space on all index pages. The - percentage at the right is the number of unused bytes divided by the - total number of bytes on index pages. - -Unused bytes on primary pages - - The total number of bytes of unused space on all primary pages. The - percentage at the right is the number of unused bytes divided by the - total number of bytes on primary pages. - -Unused bytes on overflow pages - - The total number of bytes of unused space on all overflow pages. The - percentage at the right is the number of unused bytes divided by the - total number of bytes on overflow pages. - -Unused bytes on all pages - - The total number of bytes of unused space on all primary and overflow - pages. The percentage at the right is the number of unused bytes - divided by the total number of bytes. -} - -# Output a dump of the in-memory database. This can be used for more -# complex offline analysis. -# -puts "**********************************************************************" -puts "The entire text of this report can be sourced into any SQL database" -puts "engine for further analysis. All of the text above is an SQL comment." -puts "The data used to generate this report follows:" -puts "*/" -puts "BEGIN;" -puts $tabledef -unset -nocomplain x -mem eval {SELECT * FROM space_used} x { - puts -nonewline "INSERT INTO space_used VALUES" - set sep ( - foreach col $x(*) { - set v $x($col) - if {$v=="" || ![string is double $v]} {set v [quote $v]} - puts -nonewline $sep$v - set sep , - } - puts ");" -} -puts "COMMIT;" diff --git a/ext/pdo_sqlite/sqlite/tool/speedtest.tcl b/ext/pdo_sqlite/sqlite/tool/speedtest.tcl deleted file mode 100644 index ef39dc5461d8c..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/speedtest.tcl +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/tclsh -# -# Run this script using TCLSH to do a speed comparison between -# various versions of SQLite and PostgreSQL and MySQL -# - -# Run a test -# -set cnt 1 -proc runtest {title} { - global cnt - set sqlfile test$cnt.sql - puts "<h2>Test $cnt: $title</h2>" - incr cnt - set fd [open $sqlfile r] - set sql [string trim [read $fd [file size $sqlfile]]] - close $fd - set sx [split $sql \n] - set n [llength $sx] - if {$n>8} { - set sql {} - for {set i 0} {$i<3} {incr i} {append sql [lindex $sx $i]<br>\n} - append sql "<i>... [expr {$n-6}] lines omitted</i><br>\n" - for {set i [expr {$n-3}]} {$i<$n} {incr i} { - append sql [lindex $sx $i]<br>\n - } - } else { - regsub -all \n [string trim $sql] <br> sql - } - puts "<blockquote>" - puts "$sql" - puts "</blockquote><table border=0 cellpadding=0 cellspacing=0>" - set format {<tr><td>%s</td><td align="right">   %.3f</td></tr>} - set delay 1000 -# exec sync; after $delay; -# set t [time "exec psql drh <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format PostgreSQL: $t] - exec sync; after $delay; - set t [time "exec mysql -f drh <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format MySQL: $t] -# set t [time "exec ./sqlite232 s232.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.3.2:} $t] -# set t [time "exec ./sqlite-100 s100.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.4 (cache=100):} $t] - exec sync; after $delay; - set t [time "exec ./sqlite248 s2k.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4.8:} $t] - exec sync; after $delay; - set t [time "exec ./sqlite248 sns.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4.8 (nosync):} $t] - exec sync; after $delay; - set t [time "exec ./sqlite2412 s2kb.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4.12:} $t] - exec sync; after $delay; - set t [time "exec ./sqlite2412 snsb.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4.12 (nosync):} $t] -# set t [time "exec ./sqlite-t1 st1.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.4 (test):} $t] - puts "</table>" -} - -# Initialize the environment -# -expr srand(1) -catch {exec /bin/sh -c {rm -f s*.db}} -set fd [open clear.sql w] -puts $fd { - drop table t1; - drop table t2; -} -close $fd -catch {exec psql drh <clear.sql} -catch {exec mysql drh <clear.sql} -set fd [open 2kinit.sql w] -puts $fd { - PRAGMA default_cache_size=2000; - PRAGMA default_synchronous=on; -} -close $fd -exec ./sqlite248 s2k.db <2kinit.sql -exec ./sqlite2412 s2kb.db <2kinit.sql -set fd [open nosync-init.sql w] -puts $fd { - PRAGMA default_cache_size=2000; - PRAGMA default_synchronous=off; -} -close $fd -exec ./sqlite248 sns.db <nosync-init.sql -exec ./sqlite2412 snsb.db <nosync-init.sql -set ones {zero one two three four five six seven eight nine - ten eleven twelve thirteen fourteen fifteen sixteen seventeen - eighteen nineteen} -set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety} -proc number_name {n} { - if {$n>=1000} { - set txt "[number_name [expr {$n/1000}]] thousand" - set n [expr {$n%1000}] - } else { - set txt {} - } - if {$n>=100} { - append txt " [lindex $::ones [expr {$n/100}]] hundred" - set n [expr {$n%100}] - } - if {$n>=20} { - append txt " [lindex $::tens [expr {$n/10}]]" - set n [expr {$n%10}] - } - if {$n>0} { - append txt " [lindex $::ones $n]" - } - set txt [string trim $txt] - if {$txt==""} {set txt zero} - return $txt -} - - - -set fd [open test$cnt.sql w] -puts $fd "CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));" -for {set i 1} {$i<=1000} {incr i} { - set r [expr {int(rand()*100000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -close $fd -runtest {1000 INSERTs} - - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -puts $fd "CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t2 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - - -set fd [open test$cnt.sql w] -for {set i 0} {$i<100} {incr i} { - set lwr [expr {$i*100}] - set upr [expr {($i+10)*100}] - puts $fd "SELECT count(*), avg(b) FROM t2 WHERE b>=$lwr AND b<$upr;" -} -close $fd -runtest {100 SELECTs without an index} - - - -set fd [open test$cnt.sql w] -for {set i 1} {$i<=100} {incr i} { - puts $fd "SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%[number_name $i]%';" -} -close $fd -runtest {100 SELECTs on a string comparison} - - - -set fd [open test$cnt.sql w] -puts $fd {CREATE INDEX i2a ON t2(a);} -puts $fd {CREATE INDEX i2b ON t2(b);} -close $fd -runtest {Creating an index} - - - -set fd [open test$cnt.sql w] -for {set i 0} {$i<5000} {incr i} { - set lwr [expr {$i*100}] - set upr [expr {($i+1)*100}] - puts $fd "SELECT count(*), avg(b) FROM t2 WHERE b>=$lwr AND b<$upr;" -} -close $fd -runtest {5000 SELECTs with an index} - - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 0} {$i<1000} {incr i} { - set lwr [expr {$i*10}] - set upr [expr {($i+1)*10}] - puts $fd "UPDATE t1 SET b=b*2 WHERE a>=$lwr AND a<$upr;" -} -puts $fd "COMMIT;" -close $fd -runtest {1000 UPDATEs without an index} - - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "UPDATE t2 SET b=$r WHERE a=$i;" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 UPDATEs with an index} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "UPDATE t2 SET c='[number_name $r]' WHERE a=$i;" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 text UPDATEs with an index} - - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -puts $fd "INSERT INTO t1 SELECT * FROM t2;" -puts $fd "INSERT INTO t2 SELECT * FROM t1;" -puts $fd "COMMIT;" -close $fd -runtest {INSERTs from a SELECT} - - - -set fd [open test$cnt.sql w] -puts $fd {DELETE FROM t2 WHERE c LIKE '%fifty%';} -close $fd -runtest {DELETE without an index} - - - -set fd [open test$cnt.sql w] -puts $fd {DELETE FROM t2 WHERE a>10 AND a<20000;} -close $fd -runtest {DELETE with an index} - - - -set fd [open test$cnt.sql w] -puts $fd {INSERT INTO t2 SELECT * FROM t1;} -close $fd -runtest {A big INSERT after a big DELETE} - - - -set fd [open test$cnt.sql w] -puts $fd {BEGIN;} -puts $fd {DELETE FROM t1;} -for {set i 1} {$i<=3000} {incr i} { - set r [expr {int(rand()*100000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd {COMMIT;} -close $fd -runtest {A big DELETE followed by many small INSERTs} - - - -set fd [open test$cnt.sql w] -puts $fd {DROP TABLE t1;} -puts $fd {DROP TABLE t2;} -close $fd -runtest {DROP TABLE} diff --git a/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl b/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl deleted file mode 100644 index 4fd632d4c7c6e..0000000000000 --- a/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/tclsh -# -# Run this script using TCLSH to do a speed comparison between -# various versions of SQLite and PostgreSQL and MySQL -# - -# Run a test -# -set cnt 1 -proc runtest {title} { - global cnt - set sqlfile test$cnt.sql - puts "<h2>Test $cnt: $title</h2>" - incr cnt - set fd [open $sqlfile r] - set sql [string trim [read $fd [file size $sqlfile]]] - close $fd - set sx [split $sql \n] - set n [llength $sx] - if {$n>8} { - set sql {} - for {set i 0} {$i<3} {incr i} {append sql [lindex $sx $i]<br>\n} - append sql "<i>... [expr {$n-6}] lines omitted</i><br>\n" - for {set i [expr {$n-3}]} {$i<$n} {incr i} { - append sql [lindex $sx $i]<br>\n - } - } else { - regsub -all \n [string trim $sql] <br> sql - } - puts "<blockquote>" - puts "$sql" - puts "</blockquote><table border=0 cellpadding=0 cellspacing=0>" - set format {<tr><td>%s</td><td align="right">   %.3f</td></tr>} - set delay 1000 - exec sync; after $delay; - set t [time "exec psql drh <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format PostgreSQL: $t] - exec sync; after $delay; - set t [time "exec mysql -f drh <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format MySQL: $t] -# set t [time "exec ./sqlite232 s232.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.3.2:} $t] -# set t [time "exec ./sqlite-100 s100.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.4 (cache=100):} $t] - exec sync; after $delay; - set t [time "exec ./sqlite240 s2k.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4:} $t] - exec sync; after $delay; - set t [time "exec ./sqlite240 sns.db <$sqlfile" 1] - set t [expr {[lindex $t 0]/1000000.0}] - puts [format $format {SQLite 2.4 (nosync):} $t] -# set t [time "exec ./sqlite-t1 st1.db <$sqlfile" 1] -# set t [expr {[lindex $t 0]/1000000.0}] -# puts [format $format {SQLite 2.4 (test):} $t] - puts "</table>" -} - -# Initialize the environment -# -expr srand(1) -catch {exec /bin/sh -c {rm -f s*.db}} -set fd [open clear.sql w] -puts $fd { - drop table t1; - drop table t2; -} -close $fd -catch {exec psql drh <clear.sql} -catch {exec mysql drh <clear.sql} -set fd [open 2kinit.sql w] -puts $fd { - PRAGMA default_cache_size=2000; - PRAGMA default_synchronous=on; -} -close $fd -exec ./sqlite240 s2k.db <2kinit.sql -exec ./sqlite-t1 st1.db <2kinit.sql -set fd [open nosync-init.sql w] -puts $fd { - PRAGMA default_cache_size=2000; - PRAGMA default_synchronous=off; -} -close $fd -exec ./sqlite240 sns.db <nosync-init.sql -set ones {zero one two three four five six seven eight nine - ten eleven twelve thirteen fourteen fifteen sixteen seventeen - eighteen nineteen} -set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety} -proc number_name {n} { - if {$n>=1000} { - set txt "[number_name [expr {$n/1000}]] thousand" - set n [expr {$n%1000}] - } else { - set txt {} - } - if {$n>=100} { - append txt " [lindex $::ones [expr {$n/100}]] hundred" - set n [expr {$n%100}] - } - if {$n>=20} { - append txt " [lindex $::tens [expr {$n/10}]]" - set n [expr {$n%10}] - } - if {$n>0} { - append txt " [lindex $::ones $n]" - } - set txt [string trim $txt] - if {$txt==""} {set txt zero} - return $txt -} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -puts $fd "CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - -set fd [open test$cnt.sql w] -puts $fd "DELETE FROM t1;" -close $fd -runtest {DELETE everything} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - -set fd [open test$cnt.sql w] -puts $fd "DELETE FROM t1;" -close $fd -runtest {DELETE everything} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - -set fd [open test$cnt.sql w] -puts $fd "DELETE FROM t1;" -close $fd -runtest {DELETE everything} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - -set fd [open test$cnt.sql w] -puts $fd "DELETE FROM t1;" -close $fd -runtest {DELETE everything} - - -set fd [open test$cnt.sql w] -puts $fd "BEGIN;" -for {set i 1} {$i<=25000} {incr i} { - set r [expr {int(rand()*500000)}] - puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" -} -puts $fd "COMMIT;" -close $fd -runtest {25000 INSERTs in a transaction} - - -set fd [open test$cnt.sql w] -puts $fd "DELETE FROM t1;" -close $fd -runtest {DELETE everything} - - -set fd [open test$cnt.sql w] -puts $fd {DROP TABLE t1;} -close $fd -runtest {DROP TABLE} diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c deleted file mode 100644 index 7c004a7ebb0a7..0000000000000 --- a/ext/pdo_sqlite/sqlite_driver.c +++ /dev/null @@ -1,779 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_sqlite.h" -#include "php_pdo_sqlite_int.h" -#include "zend_exceptions.h" - -int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */ -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; - pdo_sqlite_error_info *einfo = &H->einfo; - - einfo->errcode = sqlite3_errcode(H->db); - einfo->file = file; - einfo->line = line; - - if (einfo->errcode != SQLITE_OK) { - einfo->errmsg = (char*)sqlite3_errmsg(H->db); - } else { /* no error */ - strcpy(*pdo_err, PDO_ERR_NONE); - return 0; - } - switch (einfo->errcode) { - case SQLITE_NOTFOUND: - strcpy(*pdo_err, "42S02"); - break; - - case SQLITE_INTERRUPT: - strcpy(*pdo_err, "01002"); - break; - - case SQLITE_NOLFS: - strcpy(*pdo_err, "HYC00"); - break; - - case SQLITE_TOOBIG: - strcpy(*pdo_err, "22001"); - break; - - case SQLITE_CONSTRAINT: - strcpy(*pdo_err, "23000"); - break; - - case SQLITE_ERROR: - default: - strcpy(*pdo_err, "HY000"); - break; - } - - if (!dbh->methods) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", - *pdo_err, einfo->errcode, einfo->errmsg); - } - - return einfo->errcode; -} -/* }}} */ - -static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - pdo_sqlite_error_info *einfo = &H->einfo; - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); - } - - return 1; -} - -static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC) -{ - struct pdo_sqlite_func *func; - - while (H->funcs) { - func = H->funcs; - H->funcs = func->next; - - if (H->db) { - /* delete the function from the handle */ - sqlite3_create_function(H->db, - func->funcname, - func->argc, - SQLITE_UTF8, - func, - NULL, NULL, NULL); - } - - efree((char*)func->funcname); - if (func->func) { - zval_ptr_dtor(&func->func); - } - if (func->step) { - zval_ptr_dtor(&func->step); - } - if (func->fini) { - zval_ptr_dtor(&func->fini); - } - efree(func); - } -} - -static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - - if (H) { - pdo_sqlite_cleanup_callbacks(H TSRMLS_CC); - if (H->db) { - sqlite3_close(H->db); - H->db = NULL; - } - pefree(H, dbh->is_persistent); - dbh->driver_data = NULL; - } - return 0; -} -/* }}} */ - -static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt)); - int i; - const char *tail; - - S->H = H; - stmt->driver_data = S; - stmt->methods = &sqlite_stmt_methods; - stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL|PDO_PLACEHOLDER_NAMED; - - if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) { - H->einfo.errcode = SQLITE_ERROR; - pdo_sqlite_error(dbh); - return 0; - } - - i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail); - if (i == SQLITE_OK) { - return 1; - } - - pdo_sqlite_error(dbh); - - return 0; -} - -static long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - char *errmsg = NULL; - - if (sqlite3_exec(H->db, sql, NULL, NULL, &errmsg) != SQLITE_OK) { - pdo_sqlite_error(dbh); - if (errmsg) - sqlite3_free(errmsg); - - return -1; - } else { - return sqlite3_changes(H->db); - } -} - -static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - char *id; - - id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db) TSRMLS_CC); - *len = strlen(id); - return id; -} - -/* NB: doesn't handle binary strings... use prepared stmts for that */ -static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) -{ - *quoted = safe_emalloc(2, unquotedlen, 3); - sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted); - *quotedlen = strlen(*quoted); - return 1; -} - -static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - char *errmsg = NULL; - - if (sqlite3_exec(H->db, "BEGIN", NULL, NULL, &errmsg) != SQLITE_OK) { - pdo_sqlite_error(dbh); - if (errmsg) - sqlite3_free(errmsg); - return 0; - } - return 1; -} - -static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - char *errmsg = NULL; - - if (sqlite3_exec(H->db, "COMMIT", NULL, NULL, &errmsg) != SQLITE_OK) { - pdo_sqlite_error(dbh); - if (errmsg) - sqlite3_free(errmsg); - return 0; - } - return 1; -} - -static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - char *errmsg = NULL; - - if (sqlite3_exec(H->db, "ROLLBACK", NULL, NULL, &errmsg) != SQLITE_OK) { - pdo_sqlite_error(dbh); - if (errmsg) - sqlite3_free(errmsg); - return 0; - } - return 1; -} - -static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) -{ - switch (attr) { - case PDO_ATTR_CLIENT_VERSION: - case PDO_ATTR_SERVER_VERSION: - ZVAL_STRING(return_value, (char *)sqlite3_libversion(), 1); - break; - - default: - return 0; - } - - return 1; -} - -static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_TIMEOUT: - convert_to_long(val); - sqlite3_busy_timeout(H->db, Z_LVAL_P(val) * 1000); - return 1; - } - return 0; -} - -static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, - int argc, sqlite3_value **argv, sqlite3_context *context, - int is_agg TSRMLS_DC) -{ - zval ***zargs = NULL; - zval *retval = NULL; - int i; - int ret; - int fake_argc; - zval **agg_context = NULL; - - if (is_agg) { - is_agg = 2; - } - - fake_argc = argc + is_agg; - - fc->fci.size = sizeof(fc->fci); - fc->fci.function_table = EG(function_table); - fc->fci.function_name = cb; - fc->fci.symbol_table = NULL; - fc->fci.object_pp = NULL; - fc->fci.retval_ptr_ptr = &retval; - fc->fci.param_count = fake_argc; - - /* build up the params */ - - if (fake_argc) { - zargs = (zval ***)safe_emalloc(fake_argc, sizeof(zval **), 0); - } - - if (is_agg) { - /* summon the aggregation context */ - agg_context = (zval**)sqlite3_aggregate_context(context, sizeof(zval*)); - if (!*agg_context) { - MAKE_STD_ZVAL(*agg_context); - ZVAL_NULL(*agg_context); - } - zargs[0] = agg_context; - - zargs[1] = emalloc(sizeof(zval*)); - MAKE_STD_ZVAL(*zargs[1]); - ZVAL_LONG(*zargs[1], sqlite3_aggregate_count(context)); - } - - for (i = 0; i < argc; i++) { - zargs[i + is_agg] = emalloc(sizeof(zval *)); - MAKE_STD_ZVAL(*zargs[i + is_agg]); - - /* get the value */ - switch (sqlite3_value_type(argv[i])) { - case SQLITE_INTEGER: - ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int(argv[i])); - break; - - case SQLITE_FLOAT: - ZVAL_DOUBLE(*zargs[i + is_agg], sqlite3_value_double(argv[i])); - break; - - case SQLITE_NULL: - ZVAL_NULL(*zargs[i + is_agg]); - break; - - case SQLITE_BLOB: - case SQLITE3_TEXT: - default: - ZVAL_STRINGL(*zargs[i + is_agg], (char*)sqlite3_value_text(argv[i]), - sqlite3_value_bytes(argv[i]), 1); - break; - } - } - - - fc->fci.params = zargs; - - - if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback"); - } - - /* clean up the params */ - if (argc) { - for (i = is_agg; i < argc; i++) { - zval_ptr_dtor(zargs[i]); - efree(zargs[i]); - } - if (is_agg) { - zval_ptr_dtor(zargs[1]); - efree(zargs[1]); - } - efree(zargs); - } - - if (!is_agg || !argv) { - /* only set the sqlite return value if we are a scalar function, - * or if we are finalizing an aggregate */ - if (retval) { - switch (Z_TYPE_P(retval)) { - case IS_LONG: - sqlite3_result_int(context, Z_LVAL_P(retval)); - break; - - case IS_NULL: - sqlite3_result_null(context); - break; - - case IS_DOUBLE: - sqlite3_result_double(context, Z_DVAL_P(retval)); - break; - - default: - convert_to_string_ex(&retval); - sqlite3_result_text(context, Z_STRVAL_P(retval), - Z_STRLEN_P(retval), SQLITE_TRANSIENT); - break; - } - } else { - sqlite3_result_error(context, "failed to invoke callback", 0); - } - - if (agg_context) { - zval_ptr_dtor(agg_context); - } - } else { - /* we're stepping in an aggregate; the return value goes into - * the context */ - if (agg_context) { - zval_ptr_dtor(agg_context); - } - if (retval) { - *agg_context = retval; - retval = NULL; - } else { - *agg_context = NULL; - } - } - - if (retval) { - zval_ptr_dtor(&retval); - } - - return ret; -} - -static void php_sqlite3_func_callback(sqlite3_context *context, int argc, - sqlite3_value **argv) -{ - struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context); - TSRMLS_FETCH(); - - do_callback(&func->afunc, func->func, argc, argv, context, 0 TSRMLS_CC); -} - -static void php_sqlite3_func_step_callback(sqlite3_context *context, int argc, - sqlite3_value **argv) -{ - struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context); - TSRMLS_FETCH(); - - do_callback(&func->astep, func->step, argc, argv, context, 1 TSRMLS_CC); -} - -static void php_sqlite3_func_final_callback(sqlite3_context *context) -{ - struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context); - TSRMLS_FETCH(); - - do_callback(&func->afini, func->fini, 0, NULL, context, 1 TSRMLS_CC); -} - -/* {{{ bool SQLite::sqliteCreateFunction(string name, mixed callback [, int argcount]) - Registers a UDF with the sqlite db handle */ -static PHP_METHOD(SQLite, sqliteCreateFunction) -{ - struct pdo_sqlite_func *func; - zval *callback; - char *func_name; - int func_name_len; - long argc = -1; -#ifdef IS_UNICODE - zval cbname; -#else - char *cbname; -#endif - pdo_dbh_t *dbh; - pdo_sqlite_db_handle *H; - int ret; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", - &func_name, &func_name_len, &callback, &argc)) { - RETURN_FALSE; - } - - dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - PDO_CONSTRUCT_CHECK; - - if (!zend_is_callable(callback, 0, &cbname)) { -#ifdef IS_UNICODE - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%R' is not callable", Z_TYPE(cbname), Z_UNIVAL(cbname)); - zval_dtor(&cbname); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname); - efree(cbname); -#endif - RETURN_FALSE; - } -#ifdef IS_UNICODE - zval_dtor(&cbname); -#else - efree(cbname); -#endif - - H = (pdo_sqlite_db_handle *)dbh->driver_data; - - func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func)); - - ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, - func, php_sqlite3_func_callback, NULL, NULL); - if (ret == SQLITE_OK) { - func->funcname = estrdup(func_name); - - MAKE_STD_ZVAL(func->func); - *(func->func) = *callback; - zval_copy_ctor(func->func); - - func->argc = argc; - - func->next = H->funcs; - H->funcs = func; - - RETURN_TRUE; - } - - efree(func); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ bool SQLite::sqliteCreateAggregate(string name, mixed step, mixed fini [, int argcount]) - Registers a UDF with the sqlite db handle */ - -/* The step function should have the prototype: - mixed step(mixed $context, int $rownumber, $value [, $value2 [, ...]]) - - $context will be null for the first row; on subsequent rows it will have - the value that was previously returned from the step function; you should - use this to maintain state for the aggregate. - - The fini function should have the prototype: - mixed fini(mixed $context, int $rownumber) - - $context will hold the return value from the very last call to the step function. - rownumber will hold the number of rows over which the aggregate was performed. - The return value of this function will be used as the return value for this - aggregate UDF. -*/ - -static PHP_METHOD(SQLite, sqliteCreateAggregate) -{ - struct pdo_sqlite_func *func; - zval *step_callback, *fini_callback; - char *func_name; - int func_name_len; - long argc = -1; -#ifdef IS_UNICODE - zval cbname; -#else - char *cbname; -#endif - pdo_dbh_t *dbh; - pdo_sqlite_db_handle *H; - int ret; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", - &func_name, &func_name_len, &step_callback, &fini_callback, &argc)) { - RETURN_FALSE; - } - - dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - PDO_CONSTRUCT_CHECK; - - if (!zend_is_callable(step_callback, 0, &cbname)) { -#ifdef IS_UNICODE - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%R' is not callable", Z_TYPE(cbname), Z_UNIVAL(cbname)); - zval_dtor(&cbname); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname); - efree(cbname); -#endif - RETURN_FALSE; - } -#ifdef IS_UNICODE - zval_dtor(&cbname); -#else - efree(cbname); -#endif - if (!zend_is_callable(fini_callback, 0, &cbname)) { -#ifdef IS_UNICODE - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%R' is not callable", Z_TYPE(cbname), Z_UNIVAL(cbname)); - zval_dtor(&cbname); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname); - efree(cbname); -#endif - RETURN_FALSE; - } -#ifdef IS_UNICODE - zval_dtor(&cbname); -#else - efree(cbname); -#endif - - H = (pdo_sqlite_db_handle *)dbh->driver_data; - - func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func)); - - ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, - func, NULL, php_sqlite3_func_step_callback, php_sqlite3_func_final_callback); - if (ret == SQLITE_OK) { - func->funcname = estrdup(func_name); - - MAKE_STD_ZVAL(func->step); - *(func->step) = *step_callback; - zval_copy_ctor(func->step); - - MAKE_STD_ZVAL(func->fini); - *(func->fini) = *fini_callback; - zval_copy_ctor(func->fini); - - func->argc = argc; - - func->next = H->funcs; - H->funcs = func; - - RETURN_TRUE; - } - - efree(func); - RETURN_FALSE; -} -/* }}} */ -static function_entry dbh_methods[] = { - PHP_ME(SQLite, sqliteCreateFunction, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SQLite, sqliteCreateAggregate, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC) -{ - switch (kind) { - case PDO_DBH_DRIVER_METHOD_KIND_DBH: - return dbh_methods; - - default: - return NULL; - } -} - -static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - /* unregister functions, so that they don't linger for the next - * request */ - if (H) { - pdo_sqlite_cleanup_callbacks(H TSRMLS_CC); - } -} - -static struct pdo_dbh_methods sqlite_methods = { - sqlite_handle_closer, - sqlite_handle_preparer, - sqlite_handle_doer, - sqlite_handle_quoter, - sqlite_handle_begin, - sqlite_handle_commit, - sqlite_handle_rollback, - pdo_sqlite_set_attr, - pdo_sqlite_last_insert_id, - pdo_sqlite_fetch_error_func, - pdo_sqlite_get_attribute, - NULL, /* check_liveness: not needed */ - get_driver_methods, - pdo_sqlite_request_shutdown -}; - -static char *make_filename_safe(const char *filename TSRMLS_DC) -{ - if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) { - char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); - - if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - efree(fullpath); - return NULL; - } - - if (php_check_open_basedir(fullpath TSRMLS_CC)) { - efree(fullpath); - return NULL; - } - return fullpath; - } - return estrdup(filename); -} - -static int authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, - const char *arg5, const char *arg6) -{ - char *filename; - switch (access_type) { - case SQLITE_COPY: { - TSRMLS_FETCH(); - filename = make_filename_safe(arg4 TSRMLS_CC); - if (!filename) { - return SQLITE_DENY; - } - efree(filename); - return SQLITE_OK; - } - - case SQLITE_ATTACH: { - TSRMLS_FETCH(); - filename = make_filename_safe(arg3 TSRMLS_CC); - if (!filename) { - return SQLITE_DENY; - } - efree(filename); - return SQLITE_OK; - } - - default: - /* access allowed */ - return SQLITE_OK; - } -} - -static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ -{ - pdo_sqlite_db_handle *H; - int i, ret = 0; - long timeout = 60; - char *filename; - - H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); - - H->einfo.errcode = 0; - H->einfo.errmsg = NULL; - dbh->driver_data = H; - - filename = make_filename_safe(dbh->data_source TSRMLS_CC); - - if (!filename) { - zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, - "safe_mode/open_basedir prohibits opening %s", - dbh->data_source); - goto cleanup; - } - - i = sqlite3_open(filename, &H->db); - efree(filename); - - if (i != SQLITE_OK) { - pdo_sqlite_error(dbh); - goto cleanup; - } - - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { - sqlite3_set_authorizer(H->db, authorizer, NULL); - } - - if (driver_options) { - timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout TSRMLS_CC); - } - sqlite3_busy_timeout(H->db, timeout * 1000); - - dbh->alloc_own_columns = 1; - dbh->max_escaped_char_length = 2; - - ret = 1; - -cleanup: - dbh->methods = &sqlite_methods; - - return ret; -} -/* }}} */ - -pdo_driver_t pdo_sqlite_driver = { - PDO_DRIVER_HEADER(sqlite), - pdo_sqlite_handle_factory -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c deleted file mode 100644 index dd52402030b74..0000000000000 --- a/ext/pdo_sqlite/sqlite_statement.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong <wez@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_sqlite.h" -#include "php_pdo_sqlite_int.h" - - -static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - - if (S->stmt) { - sqlite3_finalize(S->stmt); - S->stmt = NULL; - } - efree(S); - return 1; -} - -static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - - if (stmt->executed && !S->done) { - sqlite3_reset(S->stmt); - } - - S->done = 0; - switch (sqlite3_step(S->stmt)) { - case SQLITE_ROW: - S->pre_fetched = 1; - stmt->column_count = sqlite3_data_count(S->stmt); - return 1; - - case SQLITE_DONE: - stmt->column_count = sqlite3_column_count(S->stmt); - stmt->row_count = sqlite3_changes(S->H->db); - sqlite3_reset(S->stmt); - S->done = 1; - return 1; - - case SQLITE_ERROR: - case SQLITE_MISUSE: - case SQLITE_BUSY: - default: - pdo_sqlite_error_stmt(stmt); - return 0; - } -} - -static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, - enum pdo_param_event event_type TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - - switch (event_type) { - case PDO_PARAM_EVT_EXEC_PRE: - if (stmt->executed && !S->done) { - sqlite3_reset(S->stmt); - S->done = 1; - } - - if (param->is_param) { - - if (param->paramno == -1) { - param->paramno = sqlite3_bind_parameter_index(S->stmt, param->name) - 1; - } - - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_LOB: - case PDO_PARAM_STMT: - return 0; - - case PDO_PARAM_NULL: - if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) { - return 1; - } - pdo_sqlite_error_stmt(stmt); - return 0; - - case PDO_PARAM_STR: - default: - if (Z_TYPE_P(param->parameter) == IS_NULL) { - if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) { - return 1; - } - } else { - convert_to_string(param->parameter); - if(SQLITE_OK == sqlite3_bind_text(S->stmt, param->paramno + 1, - Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), - SQLITE_STATIC)) { - return 1; - } - } - pdo_sqlite_error_stmt(stmt); - return 0; - } - } - break; - - default: - ; - } - return 1; -} - -static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt, - enum pdo_fetch_orientation ori, long offset TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - int i; - if (!S->stmt) { - return 0; - } - if (S->pre_fetched) { - S->pre_fetched = 0; - return 1; - } - if (S->done) { - return 0; - } - i = sqlite3_step(S->stmt); - switch (i) { - case SQLITE_ROW: - return 1; - - case SQLITE_DONE: - S->done = 1; - sqlite3_reset(S->stmt); - return 0; - - default: - pdo_sqlite_error_stmt(stmt); - return 0; - } -} - -static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - - if(colno >= sqlite3_column_count(S->stmt)) { - /* error invalid column */ - pdo_sqlite_error_stmt(stmt); - return 0; - } - - stmt->columns[colno].name = estrdup(sqlite3_column_name(S->stmt, colno)); - stmt->columns[colno].namelen = strlen(stmt->columns[colno].name); - stmt->columns[colno].maxlen = 0xffffffff; - stmt->columns[colno].precision = 0; - - switch (sqlite3_column_type(S->stmt, colno)) { - case SQLITE_INTEGER: - case SQLITE_FLOAT: - case SQLITE3_TEXT: - case SQLITE_BLOB: - case SQLITE_NULL: - default: - stmt->columns[colno].param_type = PDO_PARAM_STR; - break; - } - - return 1; -} - -static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - if (!S->stmt) { - return 0; - } - if(colno >= sqlite3_data_count(S->stmt)) { - /* error invalid column */ - pdo_sqlite_error_stmt(stmt); - return 0; - } - switch (sqlite3_column_type(S->stmt, colno)) { - case SQLITE_NULL: - *ptr = NULL; - *len = 0; - return 1; - - case SQLITE_BLOB: - *ptr = (char*)sqlite3_column_blob(S->stmt, colno); - *len = sqlite3_column_bytes(S->stmt, colno); - return 1; - - case SQLITE3_TEXT: - *ptr = (char*)sqlite3_column_text(S->stmt, colno); - *len = sqlite3_column_bytes(S->stmt, colno); - if (*len) { - /* sqlite3.h says "the NUL terminator is included in the byte count - * for TEXT values" */ - *len--; - } - return 1; - - default: - *ptr = (char*)sqlite3_column_text(S->stmt, colno); - *len = sqlite3_column_bytes(S->stmt, colno); - return 1; - } -} - -static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - char *str; - zval *flags; - - if (!S->stmt) { - return FAILURE; - } - if(colno >= sqlite3_data_count(S->stmt)) { - /* error invalid column */ - pdo_sqlite_error_stmt(stmt); - return FAILURE; - } - - array_init(return_value); - MAKE_STD_ZVAL(flags); - array_init(flags); - - switch (sqlite3_column_type(S->stmt, colno)) { - case SQLITE_NULL: - add_assoc_string(return_value, "native_type", "null", 1); - break; - - case SQLITE_FLOAT: - add_assoc_string(return_value, "native_type", "double", 1); - break; - - case SQLITE_BLOB: - add_next_index_string(flags, "blob", 1); - case SQLITE_TEXT: - add_assoc_string(return_value, "native_type", "string", 1); - break; - - case SQLITE_INTEGER: - add_assoc_string(return_value, "native_type", "integer", 1); - break; - } - - str = (char*)sqlite3_column_decltype(S->stmt, colno); - if (str) { - add_assoc_string(return_value, "sqlite:decl_type", str, 1); - } - - add_assoc_zval(return_value, "flags", flags); - - return SUCCESS; -} - -static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) -{ - pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - sqlite3_reset(S->stmt); - return 1; -} - -struct pdo_stmt_methods sqlite_stmt_methods = { - pdo_sqlite_stmt_dtor, - pdo_sqlite_stmt_execute, - pdo_sqlite_stmt_fetch, - pdo_sqlite_stmt_describe, - pdo_sqlite_stmt_get_col, - pdo_sqlite_stmt_param_hook, - NULL, /* set_attr */ - NULL, /* get_attr */ - pdo_sqlite_stmt_col_meta, - NULL, /* next_rowset */ - pdo_sqlite_stmt_cursor_closer -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo_sqlite/tests/bug33841.phpt b/ext/pdo_sqlite/tests/bug33841.phpt deleted file mode 100644 index 936aebf98f2ae..0000000000000 --- a/ext/pdo_sqlite/tests/bug33841.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -PDO SQLite Bug #33841 (rowCount() does not work on prepared statements) ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; -?> ---FILE-- -<?php -require 'ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory('ext/pdo_sqlite/tests/common.phpt'); - -$db->exec('CREATE TABLE test (text)'); - -$stmt = $db->prepare("INSERT INTO test VALUES ( :text )"); -$stmt->bindParam(':text', $name); -$name = 'test1'; -var_dump($stmt->execute(), $stmt->rowCount()); - -$stmt = $db->prepare("UPDATE test SET text = :text "); -$stmt->bindParam(':text', $name); -$name = 'test2'; -var_dump($stmt->execute(), $stmt->rowCount()); - ---EXPECT-- -bool(true) -int(1) -bool(true) -int(1) diff --git a/ext/pdo_sqlite/tests/common.phpt b/ext/pdo_sqlite/tests/common.phpt deleted file mode 100644 index 65ea0c96f411a..0000000000000 --- a/ext/pdo_sqlite/tests/common.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -SQLite ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo_sqlite')) print 'skip'; ?> ---REDIRECTTEST-- -return array( - 'ENV' => array( - 'PDOTEST_DSN' => 'sqlite::memory:' - ), - 'TESTS' => 'ext/pdo/tests' - ); diff --git a/ext/pgsql/CREDITS b/ext/pgsql/CREDITS deleted file mode 100644 index 7930bc8b1e24f..0000000000000 --- a/ext/pgsql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -PostgreSQL -Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne diff --git a/ext/pgsql/README b/ext/pgsql/README deleted file mode 100644 index 2b4c412338d4b..0000000000000 --- a/ext/pgsql/README +++ /dev/null @@ -1,235 +0,0 @@ -==== About This Module === -PostgreSQL module provides access to PostgreSQL server from -PHP script. This module uses PostgreSQL C client lib called libpq. -It is important that you use libpq that is later than backend -(PostgreSQL Server) version. Otherwise, you may experience -strange problems. - -Please send e-mail to yohgaki@php.net if you have comments for -pgsql module. I appreciate your feedback. - -==== API Change === -Older PHP than 4.2.0, pg_loimport()/pg_loexport() connection -parameter as last parameter, not like other functions. From 4.2.0, -connection parameter became 1st parameter. Old syntax is preserved, -but it will raise NOTICE error message. - -pg_connect()/pg_pconnect() has obsolete multi parameter syntax. -This syntax will be deleted in 4.3.0 or later. - -Omitting connectin parameter is NOT recommended. Connection -parameter may be required for future PHP version. Specify connection -always if you don't want to rewrite code when it is changed. - -==== Function Name Change ==== -Function names are going to be changed to confirm coding -standard. MySQL module has been done this already. Function names will -be changed as follows. - -pg_errormessage -> pg_error_message -pg_cmdtuples -> pg_affected_rows -pg_fieldnum -> pg_field_num -and so on. Except pg_cmdtuples, under scores '_' will be added to -names. - -Older names will become aliases of new functions for backward -compatibility. - -Manual will be updated when this change is commited to CVS source. - -==== Configure Option Notes ==== -You cannot specify PostgreSQL source directly to build PostgreSQL -module with specific version. You need to install PostgreSQL -somewhere in your system to build PHP with PostgreSQL support. - -==== Note For PostgreSQL 7.2 ==== -I've tested upto 7.2.2. - -==== TODO List === -Make pg_convert() smater. - - Better regex - - User defiend type support -Support async connection. - -==== Experimental Functions ===== - -WARNING: API/behavior may be changed without notice. - -Async query can improve application performance -*significantly*. Please test and report any failure to -yohgaki@php.net - -There are some cases that async functions blocks process. Even if -process was blocked, functions work as expected. (except it blocks -process) These are cases that process is blocked. Refer to libpq -manual for details. Followings are common cases that async functions -are blocked. - - - If libpq is compile with USE_SSL, some async functions are - blocked. - - If libpq under Win32 is *NOT* compiled with - WIN32_NON_BLOCKING_CONNECTIONS, non-blocking connection will block. - -Async function may also block if you have not retrive result and -send or execute query. If there is result left on connection, -pg_send_query() will block until last query is completed. - -Garbages are cleaned when resource is cleaned up. There is no need to -clean up query result if it is not needed. - -Please refer to libpq manual or source for details. -These functions are *NOT* supposed to be documented, yet. -API may be changed. - -NOTE: These functions are added in PHP 4.2.0 unless they are mentioned. - -------------------------------------------------------------------- -bool pg_send_query(resource connection, string query) - -Sends async query to backend. Result may be retrieved with -pg_get_result(). It does not accept multiple query, but it accepts -multiple queries at once. Each result may be retrieved separately by -pg_get_result(). - --------------------------------------------------------------------- -bool pg_cancel_query(resource connection) - -Cancels currently executing async query already sent to PostgreSQL -server. This function is useful when user request time consuming query -to server. It cannot cancel query executed by pg_exec(), since -pg_exec() is a blocking function. - --------------------------------------------------------------------- -resource pg_get_result(resource conn) - -Gets pgsql query result resource. Returned value can be fed to -pg_result()/pg_fetch_*(). pg_get_result() may block if result is not -ready to be retrived. Use pg_is_busy() to check result is ready to be -retrieved or not. If multiple query is sent to backend, it may be -retrieved one by one using pg_get_result(). If there is no result left -in connection, it returns false. - --------------------------------------------------------------------- -bool pg_connection_busy(resource connection) - -Returns connections is executing query or not. - --------------------------------------------------------------------- -int pg_connection_status(resource connection) - -Gets connection status. It returns PGSQL_CONNECTION_OK or -PGSQL_CONNECTION_BAD. - --------------------------------------------------------------------- -bool pg_connection_reset(resource connection) - -Resets communication port to Postgresql server using the same -connection parameter. It's useful for error recovery. - --------------------------------------------------------------------- -string pg_result_error(resource result) - -Get error message associated with result - --------------------------------------------------------------------- -int pg_result_status(resource result) - -Get status of query result - --------------------------------------------------------------------- - - -Copy functions - --------------------------------------------------------------------- -mixed pg_copy_to(int connection_id, string table_name, - [, string delim [, string null_as]]) - -nt pg_copy_from(int connection_id, string table_name, array rows - [, string delim [, string null_as]]) - --------------------------------------------------------------------- - -Utility functions - --------------------------------------------------------------------- -string pg_escape_string(string data) -Escape string or binary for SQL statemen (7.2 or later) - - -string pg_escape_bytea(string data) -Escape string or binary for SQL statement (7.2 or later) - --------------------------------------------------------------------- - -Large Object Functions - --------------------------------------------------------------------- -int pg_lo_tell(resource large_object) -Returns current position of large object - --------------------------------------------------------------------- -bool pg_lo_lseek(resource large_object, int offset[, int whence]) -Seeks position of large object - --------------------------------------------------------------------- - -Notice message function - --------------------------------------------------------------------- - -string pg_last_notice(resource connection) -Returns the last notice set by the backend - -This function is fully implemed in only in current CVS version. -PHP 4.3.0 supposed to included fully implemented version. - -NOTE: Added in PHP 4.0.6, but there is bug in notice message handling -in PHP 4.0.6. Do no use 4.0.6 with pgsql module!! - --------------------------------------------------------------------- - -Utility functions (for PHP 4.3.0) - --------------------------------------------------------------------- -array pg_metadata(resource db, string table) - Get metadata - --------------------------------------------------------------------- -array pg_convert(resource db, string table, array values) - Check and convert values for PostgreSQL SQL statement - --------------------------------------------------------------------- -bool pg_insert(resource db, string table, array values[, bool convert[, bool async]]) - Insert values (filed=>value) to table - --------------------------------------------------------------------- -bool pg_update(resource db, string table, array fields, array ids[, bool convert[, bool async]]) - Update table using values (field=>value) and ids (id=>value) - --------------------------------------------------------------------- -bool pg_delete(resource db, string table, array ids[, bool convert[, bool async]]) - Delete records has ids (id=>value) - --------------------------------------------------------------------- -array pg_select(resource db, string table, array ids[, bool convert]) - Select records that has ids (id=>value) - --------------------------------------------------------------------- -array pg_get_notify([resource db[, notify]]) - Get notify message on the connection - --------------------------------------------------------------------- -string pg_unescape_bytea(string bytea_data) - Unescape bytea field data - --------------------------------------------------------------------- -bool pg_ping(resource db) - ping database connection and try to reset connection if it's - broken - -------------------------------------------------------------------- - -Again, experimental functions are subject to be changed without -notice. - diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 deleted file mode 100644 index 37f77c1930957..0000000000000 --- a/ext/pgsql/config.m4 +++ /dev/null @@ -1,103 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[ -]) - -PHP_ARG_WITH(pgsql,for PostgreSQL support, -[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL - base install directory or the path to pg_config]) - -if test "$PHP_PGSQL" != "no"; then - PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE) - - AC_MSG_CHECKING(for pg_config) - for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do - if test -x $i/pg_config; then - PG_CONFIG="$i/pg_config" - break; - fi - done - - if test -n "$PG_CONFIG"; then - AC_MSG_RESULT([$PG_CONFIG]) - PGSQL_INCLUDE=`$PG_CONFIG --includedir` - PGSQL_LIBDIR=`$PG_CONFIG --libdir` - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - else - AC_MSG_RESULT(not found) - if test "$PHP_PGSQL" = "yes"; then - PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" - else - PGSQL_SEARCH_PATHS=$PHP_PGSQL - fi - - for i in $PGSQL_SEARCH_PATHS; do - for j in include include/pgsql include/postgres include/postgresql ""; do - if test -r "$i/$j/libpq-fe.h"; then - PGSQL_INC_BASE=$i - PGSQL_INCLUDE=$i/$j - if test -r "$i/$j/pg_config.h"; then - AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) - fi - fi - done - - for j in lib $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do - if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then - PGSQL_LIBDIR=$i/$j - fi - done - done - fi - - if test -z "$PGSQL_INCLUDE"; then - AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_LIBDIR"; then - AC_MSG_ERROR(Cannot find libpq.so. Please specify correct PostgreSQL installation path) - fi - - if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then - AC_MSG_ERROR([Unable to find libpq anywhere under $withval]) - fi - - AC_DEFINE(HAVE_PGSQL,1,[Whether to build PostgreSQL support or not]) - old_LIBS=$LIBS - old_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR" - AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 or later])) - AC_CHECK_LIB(pq, PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.3.0 or later])) - AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows])) - AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL])) - AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 7.0.x or later])) - AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQexecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQprepare,AC_DEFINE(HAVE_PQPREPARE,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQexecPrepared,AC_DEFINE(HAVE_PQEXECPREPARED,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQsendQueryParams,AC_DEFINE(HAVE_PQSENDQUERYPARAMS,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQsendPrepare,AC_DEFINE(HAVE_PQSENDPREPARE,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQsendQueryPrepared,AC_DEFINE(HAVE_PQSENDQUERYPREPARED,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQputCopyData,AC_DEFINE(HAVE_PQPUTCOPYDATA,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQputCopyEnd,AC_DEFINE(HAVE_PQPUTCOPYEND,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQgetCopyData,AC_DEFINE(HAVE_PQGETCOPYDATA,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, PQsetErrorVerbosity,AC_DEFINE(HAVE_PQSETERRORVERBOSITY,1,[PostgreSQL 7.4 or later])) - AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte])) - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - - PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD) - PHP_SUBST(PGSQL_SHARED_LIBADD) - - PHP_ADD_INCLUDE($PGSQL_INCLUDE) - - PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared) -fi - - diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32 deleted file mode 100644 index 47c80ffebfe24..0000000000000 --- a/ext/pgsql/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pgsql", "PostgreSQL support", "no"); - -if (PHP_PGSQL != "no") { - if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) && - CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PGSQL)) { - EXTENSION("pgsql", "pgsql.c"); - AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library'); - ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA"); - } else { - WARNING("pgsql not enabled; libraries and headers not found"); - } -} diff --git a/ext/pgsql/mysql_users.php b/ext/pgsql/mysql_users.php deleted file mode 100644 index 65a2c33967539..0000000000000 --- a/ext/pgsql/mysql_users.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/* - * File: mysql_users.php - * Author: Yasuo Ohgaki <yohgaki@php.net> - * - * This file contains example user defined functions that does - * similar to MySQL functions. They can be implemented as module - * functions, but there won't be many users need them. - * - * Requires: PostgreSQL 7.2.x - */ - -/* - * mysql_list_dbs() - * - * This function should be needed, since PostgreSQL connection - * binds database. - */ -function pg_list_dbs($db) -{ - assert(is_resource($db)); - $query = ' -SELECT - d.datname as "Name", - u.usename as "Owner", - pg_encoding_to_char(d.encoding) as "Encoding" -FROM - pg_database d LEFT JOIN pg_user u ON d.datdba = u.usesysid -ORDER BY 1; -'; - return pg_query($db, $query); -} - - -/* - * mysql_list_tables() - */ -function pg_list_tables($db) -{ - assert(is_resource($db)); - $query = " -SELECT - c.relname as \"Name\", - CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' END as \"Type\", - u.usename as \"Owner\" -FROM - pg_class c LEFT JOIN pg_user u ON c.relowner = u.usesysid -WHERE - c.relkind IN ('r','v','S','') - AND c.relname !~ '^pg_' -ORDER BY 1; -"; - return pg_query($db, $query); -} - -/* - * mysql_list_fields() - * - * See also pg_meta_data(). It returns field defintion as array. - */ -function pg_list_fields($db, $table) -{ - assert(is_resource($db)); - $query = " -SELECT - a.attname, - format_type(a.atttypid, a.atttypmod), - a.attnotnull, - a.atthasdef, - a.attnum -FROM - pg_class c, - pg_attribute a -WHERE - c.relname = '".$table."' - AND a.attnum > 0 AND a.attrelid = c.oid -ORDER BY a.attnum; -"; - return pg_query($db, $query); -} - -?> diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c deleted file mode 100644 index a952bb385ae21..0000000000000 --- a/ext/pgsql/pgsql.c +++ /dev/null @@ -1,5706 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - | Jouni Ahto <jouni.ahto@exdec.fi> | - | Yasuo Ohgaki <yohgaki@php.net> | - | Youichi Iwakiri <yiwakiri@st.rim.or.jp> (pg_copy_*) | - | Chris Kings-Lynne <chriskl@php.net> (v3 protocol) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include <stdlib.h> - -#define PHP_PGSQL_PRIVATE 1 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define SMART_STR_PREALLOC 512 - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/php_smart_str.h" -#include "php_pgsql.h" -#include "php_globals.h" -#include "zend_exceptions.h" - -#if HAVE_PGSQL - -#ifndef InvalidOid -#define InvalidOid ((Oid) 0) -#endif - -#define PGSQL_ASSOC 1<<0 -#define PGSQL_NUM 1<<1 -#define PGSQL_BOTH (PGSQL_ASSOC|PGSQL_NUM) - -#define PGSQL_STATUS_LONG 1 -#define PGSQL_STATUS_STRING 2 - -#define PGSQL_MAX_LENGTH_OF_LONG 30 -#define PGSQL_MAX_LENGTH_OF_DOUBLE 60 - -#define PGSQL_RETURN_OID(oid) do { \ - if (oid > LONG_MAX) { \ - smart_str s = {0}; \ - smart_str_append_unsigned(&s, oid); \ - smart_str_0(&s); \ - RETURN_STRINGL(s.c, s.len, 0); \ - } \ - RETURN_LONG((long)oid); \ -} while(0) - - -#if HAVE_PQSETNONBLOCKING -#define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag) -#else -#define PQ_SETNONBLOCKING(pg_link, flag) 0 -#endif - -#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); } - -/* {{{ pgsql_functions[] - */ -function_entry pgsql_functions[] = { - /* connection functions */ - PHP_FE(pg_connect, NULL) - PHP_FE(pg_pconnect, NULL) - PHP_FE(pg_close, NULL) - PHP_FE(pg_connection_status, NULL) - PHP_FE(pg_connection_busy, NULL) - PHP_FE(pg_connection_reset, NULL) - PHP_FE(pg_host, NULL) - PHP_FE(pg_dbname, NULL) - PHP_FE(pg_port, NULL) - PHP_FE(pg_tty, NULL) - PHP_FE(pg_options, NULL) - PHP_FE(pg_version, NULL) - PHP_FE(pg_ping, NULL) -#if HAVE_PQPARAMETERSTATUS - PHP_FE(pg_parameter_status, NULL) -#endif -#if HAVE_PGTRANSACTIONSTATUS - PHP_FE(pg_transaction_status, NULL) -#endif - /* query functions */ - PHP_FE(pg_query, NULL) -#if HAVE_PQEXECPARAMS - PHP_FE(pg_query_params, NULL) -#endif -#if HAVE_PQPREPARE - PHP_FE(pg_prepare, NULL) -#endif -#if HAVE_PQEXECPREPARED - PHP_FE(pg_execute, NULL) -#endif - PHP_FE(pg_send_query, NULL) -#if HAVE_PQSENDQUERYPARAMS - PHP_FE(pg_send_query_params, NULL) -#endif -#if HAVE_PQSENDPREPARE - PHP_FE(pg_send_prepare, NULL) -#endif -#if HAVE_PQSENDQUERYPREPARED - PHP_FE(pg_send_execute, NULL) -#endif - PHP_FE(pg_cancel_query, NULL) - /* result functions */ - PHP_FE(pg_fetch_result, NULL) - PHP_FE(pg_fetch_row, NULL) - PHP_FE(pg_fetch_assoc, NULL) - PHP_FE(pg_fetch_array, NULL) - PHP_FE(pg_fetch_object, NULL) - PHP_FE(pg_fetch_all, NULL) - PHP_FE(pg_fetch_all_columns, NULL) -#if HAVE_PQCMDTUPLES - PHP_FE(pg_affected_rows,NULL) -#endif - PHP_FE(pg_get_result, NULL) - PHP_FE(pg_result_seek, NULL) - PHP_FE(pg_result_status,NULL) - PHP_FE(pg_free_result, NULL) - PHP_FE(pg_last_oid, NULL) - PHP_FE(pg_num_rows, NULL) - PHP_FE(pg_num_fields, NULL) - PHP_FE(pg_field_name, NULL) - PHP_FE(pg_field_num, NULL) - PHP_FE(pg_field_size, NULL) - PHP_FE(pg_field_type, NULL) - PHP_FE(pg_field_type_oid, NULL) - PHP_FE(pg_field_prtlen, NULL) - PHP_FE(pg_field_is_null,NULL) - /* async message function */ - PHP_FE(pg_get_notify, NULL) - PHP_FE(pg_get_pid, NULL) - /* error message functions */ - PHP_FE(pg_result_error, NULL) -#if HAVE_PQRESULTERRORFIELD - PHP_FE(pg_result_error_field, NULL) -#endif - PHP_FE(pg_last_error, NULL) - PHP_FE(pg_last_notice, NULL) - /* copy functions */ - PHP_FE(pg_put_line, NULL) - PHP_FE(pg_end_copy, NULL) - PHP_FE(pg_copy_to, NULL) - PHP_FE(pg_copy_from, NULL) - /* debug functions */ - PHP_FE(pg_trace, NULL) - PHP_FE(pg_untrace, NULL) - /* large object functions */ - PHP_FE(pg_lo_create, NULL) - PHP_FE(pg_lo_unlink, NULL) - PHP_FE(pg_lo_open, NULL) - PHP_FE(pg_lo_close, NULL) - PHP_FE(pg_lo_read, NULL) - PHP_FE(pg_lo_write, NULL) - PHP_FE(pg_lo_read_all, NULL) - PHP_FE(pg_lo_import, NULL) - PHP_FE(pg_lo_export, NULL) - PHP_FE(pg_lo_seek, NULL) - PHP_FE(pg_lo_tell, NULL) - /* utility functions */ -#if HAVE_PQESCAPE - PHP_FE(pg_escape_string,NULL) - PHP_FE(pg_escape_bytea, NULL) - PHP_FE(pg_unescape_bytea, NULL) -#endif -#if HAVE_PQSETERRORVERBOSITY - PHP_FE(pg_set_error_verbosity, NULL) -#endif -#if HAVE_PQCLIENTENCODING - PHP_FE(pg_client_encoding, NULL) - PHP_FE(pg_set_client_encoding, NULL) -#endif - /* misc function */ - PHP_FE(pg_meta_data, NULL) - PHP_FE(pg_convert, NULL) - PHP_FE(pg_insert, NULL) - PHP_FE(pg_update, NULL) - PHP_FE(pg_delete, NULL) - PHP_FE(pg_select, NULL) - /* aliases for downwards compatibility */ - PHP_FALIAS(pg_exec, pg_query, NULL) - PHP_FALIAS(pg_getlastoid, pg_last_oid, NULL) -#if HAVE_PQCMDTUPLES - PHP_FALIAS(pg_cmdtuples, pg_affected_rows, NULL) -#endif - PHP_FALIAS(pg_errormessage, pg_last_error, NULL) - PHP_FALIAS(pg_numrows, pg_num_rows, NULL) - PHP_FALIAS(pg_numfields, pg_num_fields, NULL) - PHP_FALIAS(pg_fieldname, pg_field_name, NULL) - PHP_FALIAS(pg_fieldsize, pg_field_size, NULL) - PHP_FALIAS(pg_fieldtype, pg_field_type, NULL) - PHP_FALIAS(pg_fieldnum, pg_field_num, NULL) - PHP_FALIAS(pg_fieldprtlen, pg_field_prtlen, NULL) - PHP_FALIAS(pg_fieldisnull, pg_field_is_null, NULL) - PHP_FALIAS(pg_freeresult, pg_free_result, NULL) - PHP_FALIAS(pg_result, pg_fetch_result, NULL) - PHP_FALIAS(pg_loreadall, pg_lo_read_all, NULL) - PHP_FALIAS(pg_locreate, pg_lo_create, NULL) - PHP_FALIAS(pg_lounlink, pg_lo_unlink, NULL) - PHP_FALIAS(pg_loopen, pg_lo_open, NULL) - PHP_FALIAS(pg_loclose, pg_lo_close, NULL) - PHP_FALIAS(pg_loread, pg_lo_read, NULL) - PHP_FALIAS(pg_lowrite, pg_lo_write, NULL) - PHP_FALIAS(pg_loimport, pg_lo_import, NULL) - PHP_FALIAS(pg_loexport, pg_lo_export, NULL) -#if HAVE_PQCLIENTENCODING - PHP_FALIAS(pg_clientencoding, pg_client_encoding, NULL) - PHP_FALIAS(pg_setclientencoding, pg_set_client_encoding, NULL) -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ pgsql_module_entry - */ -zend_module_entry pgsql_module_entry = { - STANDARD_MODULE_HEADER, - "pgsql", - pgsql_functions, - PHP_MINIT(pgsql), - PHP_MSHUTDOWN(pgsql), - PHP_RINIT(pgsql), - PHP_RSHUTDOWN(pgsql), - PHP_MINFO(pgsql), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PGSQL -ZEND_GET_MODULE(pgsql) -#endif - -static int le_link, le_plink, le_result, le_lofp, le_string; - -ZEND_DECLARE_MODULE_GLOBALS(pgsql); - -/* {{{ _php_pgsql_trim_message */ -static char * _php_pgsql_trim_message(const char *message, int *len) -{ - register int i = strlen(message)-1; - - if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') { - --i; - } - while (i>0 && (message[i] == '\r' || message[i] == '\n')) { - --i; - } - ++i; - if (len) { - *len = i; - } - return estrndup(message, i); -} -/* }}} */ - -/* {{{ _php_pgsql_trim_result */ -static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf) -{ - return *buf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); -} -/* }}} */ - -#define PQErrorMessageTrim(pgsql, buf) _php_pgsql_trim_result(pgsql, buf) - -#define PHP_PQ_ERROR(text, pgsql) { \ - char *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, text, msgbuf); \ - efree(msgbuf); \ -} \ - -/* {{{ php_pgsql_set_default_link - */ -static void php_pgsql_set_default_link(int id TSRMLS_DC) -{ - zend_list_addref(id); - - if (PGG(default_link) != -1) { - zend_list_delete(PGG(default_link)); - } - - PGG(default_link) = id; -} -/* }}} */ - -/* {{{ _close_pgsql_link - */ -static void _close_pgsql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PGconn *link = (PGconn *)rsrc->ptr; - PGresult *res; - - while ((res = PQgetResult(link))) { - PQclear(res); - } - PQfinish(link); - PGG(num_links)--; -} -/* }}} */ - -/* {{{ _close_pgsql_plink - */ -static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PGconn *link = (PGconn *)rsrc->ptr; - PGresult *res; - - while ((res = PQgetResult(link))) { - PQclear(res); - } - PQfinish(link); - PGG(num_persistent)--; - PGG(num_links)--; -} -/* }}} */ - -/* {{{ _php_pgsql_notice_handler - */ -static void _php_pgsql_notice_handler(void *resource_id, const char *message) -{ - php_pgsql_notice *notice; - - TSRMLS_FETCH(); - if (! PGG(ignore_notices)) { - notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice)); - notice->message = _php_pgsql_trim_message(message, ¬ice->len); - if (PGG(log_notices)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message); - } - zend_hash_index_update(&PGG(notices), *(int *)resource_id, (void **)¬ice, sizeof(php_pgsql_notice *), NULL); - } -} -/* }}} */ - -#define PHP_PGSQL_NOTICE_PTR_DTOR (void (*)(void *))_php_pgsql_notice_ptr_dtor - -/* {{{ _php_pgsql_notice_dtor - */ -static void _php_pgsql_notice_ptr_dtor(void **ptr) -{ - php_pgsql_notice *notice = (php_pgsql_notice *)*ptr; - if (notice) { - efree(notice->message); - efree(notice); - notice = NULL; - } -} -/* }}} */ - -/* {{{ _rollback_transactions - */ -static int _rollback_transactions(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PGconn *link; - PGresult *res; - int orig; - - if (Z_TYPE_P(rsrc) != le_plink) - return 0; - - link = (PGconn *) rsrc->ptr; - - if (PQ_SETNONBLOCKING(link, 0)) { - php_error_docref("ref.pgsql" TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - return -1; - } - - while ((res = PQgetResult(link))) { - PQclear(res); - } -#if HAVE_PGTRANSACTIONSTATUS && HAVE_PQPROTOCOLVERSION - if ((PQprotocolVersion(link) >= 3 && PQtransactionStatus(link) != PQTRANS_IDLE) || PQprotocolVersion(link) < 3) -#endif - { - orig = PGG(ignore_notices); - PGG(ignore_notices) = 1; -#if HAVE_PGTRANSACTIONSTATUS && HAVE_PQPROTOCOLVERSION - res = PQexec(link,"ROLLBACK;"); -#else - res = PQexec(link,"BEGIN;"); - PQclear(res); - res = PQexec(link,"ROLLBACK;"); -#endif - PQclear(res); - PGG(ignore_notices) = orig; - } - - return 0; -} -/* }}} */ - -/* {{{ _free_ptr - */ -static void _free_ptr(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - pgLofp *lofp = (pgLofp *)rsrc->ptr; - efree(lofp); -} -/* }}} */ - -/* {{{ _free_result - */ -static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr; - - PQclear(pg_result->result); - efree(pg_result); -} -/* }}} */ - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() -STD_PHP_INI_BOOLEAN( "pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_pgsql_globals, pgsql_globals) -STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_pgsql_globals, pgsql_globals, display_link_numbers) -STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_pgsql_globals, pgsql_globals, display_link_numbers) -STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateBool, auto_reset_persistent, zend_pgsql_globals, pgsql_globals) -STD_PHP_INI_BOOLEAN( "pgsql.ignore_notice", "0", PHP_INI_ALL, OnUpdateBool, ignore_notices, zend_pgsql_globals, pgsql_globals) -STD_PHP_INI_BOOLEAN( "pgsql.log_notice", "0", PHP_INI_ALL, OnUpdateBool, log_notices, zend_pgsql_globals, pgsql_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ php_pgsql_init_globals - */ -static void php_pgsql_init_globals(zend_pgsql_globals *pgsql_globals) -{ - memset(pgsql_globals, 0, sizeof(zend_pgsql_globals)); - /* Initilize notice message hash at MINIT only */ - zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pgsql) -{ - ZEND_INIT_MODULE_GLOBALS(pgsql, php_pgsql_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - le_link = zend_register_list_destructors_ex(_close_pgsql_link, NULL, "pgsql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_pgsql_plink, "pgsql link persistent", module_number); - le_result = zend_register_list_destructors_ex(_free_result, NULL, "pgsql result", module_number); - le_lofp = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql large object", module_number); - le_string = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql string", module_number); - /* For connection option */ - REGISTER_LONG_CONSTANT("PGSQL_CONNECT_FORCE_NEW", PGSQL_CONNECT_FORCE_NEW, CONST_CS | CONST_PERSISTENT); - /* For pg_fetch_array() */ - REGISTER_LONG_CONSTANT("PGSQL_ASSOC", PGSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_NUM", PGSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_BOTH", PGSQL_BOTH, CONST_CS | CONST_PERSISTENT); - /* For pg_connection_status() */ - REGISTER_LONG_CONSTANT("PGSQL_CONNECTION_BAD", CONNECTION_BAD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_CONNECTION_OK", CONNECTION_OK, CONST_CS | CONST_PERSISTENT); -#if HAVE_PGTRANSACTIONSTATUS - /* For pg_transaction_status() */ - REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_IDLE", PQTRANS_IDLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_ACTIVE", PQTRANS_ACTIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_INTRANS", PQTRANS_INTRANS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_INERROR", PQTRANS_INERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_UNKNOWN", PQTRANS_UNKNOWN, CONST_CS | CONST_PERSISTENT); -#endif -#if HAVE_PQSETERRORVERBOSITY - /* For pg_set_error_verbosity() */ - REGISTER_LONG_CONSTANT("PGSQL_ERRORS_TERSE", PQERRORS_TERSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_ERRORS_DEFAULT", PQERRORS_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_ERRORS_VERBOSE", PQERRORS_VERBOSE, CONST_CS | CONST_PERSISTENT); -#endif - /* For lo_seek() */ - REGISTER_LONG_CONSTANT("PGSQL_SEEK_SET", SEEK_SET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_SEEK_CUR", SEEK_CUR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_SEEK_END", SEEK_END, CONST_CS | CONST_PERSISTENT); - /* For pg_result_status() return value type */ - REGISTER_LONG_CONSTANT("PGSQL_STATUS_LONG", PGSQL_STATUS_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_STATUS_STRING", PGSQL_STATUS_STRING, CONST_CS | CONST_PERSISTENT); - /* For pg_result_status() return value */ - REGISTER_LONG_CONSTANT("PGSQL_EMPTY_QUERY", PGRES_EMPTY_QUERY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_COMMAND_OK", PGRES_COMMAND_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_TUPLES_OK", PGRES_TUPLES_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_COPY_OUT", PGRES_COPY_OUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_COPY_IN", PGRES_COPY_IN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_BAD_RESPONSE", PGRES_BAD_RESPONSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_NONFATAL_ERROR", PGRES_NONFATAL_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_FATAL_ERROR", PGRES_FATAL_ERROR, CONST_CS | CONST_PERSISTENT); -#if HAVE_PQRESULTERRORFIELD - /* For pg_result_error_field() field codes */ - REGISTER_LONG_CONSTANT("PGSQL_DIAG_SEVERITY", PG_DIAG_SEVERITY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_SQLSTATE", PG_DIAG_SQLSTATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_PRIMARY", PG_DIAG_MESSAGE_PRIMARY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_DETAIL", PG_DIAG_MESSAGE_DETAIL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_HINT", PG_DIAG_MESSAGE_HINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_STATEMENT_POSITION", PG_DIAG_STATEMENT_POSITION, CONST_CS | CONST_PERSISTENT); -#ifdef PG_DIAG_INTERNAL_POSITION - REGISTER_LONG_CONSTANT("PGSQL_DIAG_INTERNAL_POSITION", PG_DIAG_INTERNAL_POSITION, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef PG_DIAG_INTERNAL_QUERY - REGISTER_LONG_CONSTANT("PGSQL_DIAG_INTERNAL_QUERY", PG_DIAG_INTERNAL_QUERY, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("PGSQL_DIAG_CONTEXT", PG_DIAG_CONTEXT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FILE", PG_DIAG_SOURCE_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_LINE", PG_DIAG_SOURCE_LINE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FUNCTION", PG_DIAG_SOURCE_FUNCTION, CONST_CS | CONST_PERSISTENT); -#endif - /* pg_convert options */ - REGISTER_LONG_CONSTANT("PGSQL_CONV_IGNORE_DEFAULT", PGSQL_CONV_IGNORE_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_CONV_FORCE_NULL", PGSQL_CONV_FORCE_NULL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_CONV_IGNORE_NOT_NULL", PGSQL_CONV_IGNORE_NOT_NULL, CONST_CS | CONST_PERSISTENT); - /* pg_insert/update/delete/select options */ - REGISTER_LONG_CONSTANT("PGSQL_DML_NO_CONV", PGSQL_DML_NO_CONV, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DML_EXEC", PGSQL_DML_EXEC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DML_ASYNC", PGSQL_DML_ASYNC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PGSQL_DML_STRING", PGSQL_DML_STRING, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pgsql) -{ - UNREGISTER_INI_ENTRIES(); - zend_hash_destroy(&PGG(notices)); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(pgsql) -{ - PGG(default_link)=-1; - PGG(num_links) = PGG(num_persistent); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(pgsql) -{ - /* clean up notice messages */ - zend_hash_clean(&PGG(notices)); - /* clean up persistent connection */ - zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pgsql) -{ - char buf[256]; - - php_info_print_table_start(); - php_info_print_table_header(2, "PostgreSQL Support", "enabled"); -#if HAVE_PG_CONFIG_H - php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); -#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT - php_info_print_table_row(2, "Multibyte character support", "enabled"); -#else - php_info_print_table_row(2, "Multibyte character support", "disabled"); -#endif -#ifdef USE_SSL - php_info_print_table_row(2, "SSL support", "enabled"); -#else - php_info_print_table_row(2, "SSL support", "disabled"); -#endif -#endif /* HAVE_PG_CONFIG_H */ - sprintf(buf, "%ld", PGG(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - sprintf(buf, "%ld", PGG(num_links)); - php_info_print_table_row(2, "Active Links", buf); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - - -/* {{{ php_pgsql_do_connect - */ -static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *host=NULL,*port=NULL,*options=NULL,*tty=NULL,*dbname=NULL,*connstring=NULL; - PGconn *pgsql; - smart_str str = {0}; - zval **args[5]; - int i, connect_type = 0; - PGresult *pg_result; - - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 5 - || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { - WRONG_PARAM_COUNT; - } - - smart_str_appends(&str, "pgsql"); - - for (i = 0; i < ZEND_NUM_ARGS(); i++) { - convert_to_string_ex(args[i]); - smart_str_appendc(&str, '_'); - smart_str_appendl(&str, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); - } - - smart_str_0(&str); - - if (ZEND_NUM_ARGS() == 1) { /* new style, using connection string */ - connstring = Z_STRVAL_PP(args[0]); - } else if (ZEND_NUM_ARGS() == 2 ) { /* Safe to add conntype_option, since 2 args was illegal */ - connstring = Z_STRVAL_PP(args[0]); - convert_to_long_ex(args[1]); - connect_type = Z_LVAL_PP(args[1]); - } else { - host = Z_STRVAL_PP(args[0]); - port = Z_STRVAL_PP(args[1]); - dbname = Z_STRVAL_PP(args[ZEND_NUM_ARGS()-1]); - - switch (ZEND_NUM_ARGS()) { - case 5: - tty = Z_STRVAL_PP(args[3]); - /* fall through */ - case 4: - options = Z_STRVAL_PP(args[2]); - break; - } - } - - if (persistent && PGG(allow_persistent)) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), str.c, str.len+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - if (PGG(max_links)!=-1 && PGG(num_links)>=PGG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot create new link. Too many open links (%ld)", PGG(num_links)); - goto err; - } - if (PGG(max_persistent)!=-1 && PGG(num_persistent)>=PGG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot create new link. Too many open persistent links (%ld)", PGG(num_persistent)); - goto err; - } - - /* create the link */ - if (connstring) { - pgsql=PQconnectdb(connstring); - } else { - pgsql=PQsetdb(host,port,options,tty,dbname); - } - if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { - PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql) - if (pgsql) { - PQfinish(pgsql); - } - goto err; - } - - /* hash it up */ - Z_TYPE(new_le) = le_plink; - new_le.ptr = pgsql; - if (zend_hash_update(&EG(persistent_list), str.c, str.len+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { - goto err; - } - PGG(num_links)++; - PGG(num_persistent)++; - } else { /* we do */ - if (Z_TYPE_P(le) != le_plink) { - RETURN_FALSE; - } - /* ensure that the link did not die */ - if (PGG(auto_reset_persistent) & 1) { - /* need to send & get something from backend to - make sure we catch CONNECTION_BAD everytime */ - PGresult *pg_result; - pg_result = PQexec(le->ptr, "select 1"); - PQclear(pg_result); - } - if (PQstatus(le->ptr)==CONNECTION_BAD) { /* the link died */ - if (le->ptr == NULL) { - if (connstring) { - le->ptr=PQconnectdb(connstring); - } else { - le->ptr=PQsetdb(host,port,options,tty,dbname); - } - } - else { - PQreset(le->ptr); - } - if (le->ptr==NULL || PQstatus(le->ptr)==CONNECTION_BAD) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"PostgreSQL link lost, unable to reconnect"); - zend_hash_del(&EG(persistent_list),str.c,str.len+1); - goto err; - } - } - pgsql = (PGconn *) le->ptr; -#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS - if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 7.2) { -#else - if (atof(PG_VERSION) >= 7.2) { -#endif - pg_result = PQexec(pgsql, "RESET ALL;"); - PQclear(pg_result); - } - } - ZEND_REGISTER_RESOURCE(return_value, pgsql, le_plink); - } else { /* Non persistent connection */ - list_entry *index_ptr,new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual pgsql link sits. - * if it doesn't, open a new pgsql link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (!(connect_type & PGSQL_CONNECT_FORCE_NEW) - && zend_hash_find(&EG(regular_list),str.c,str.len+1,(void **) &index_ptr)==SUCCESS) { - int type,link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - Z_LVAL_P(return_value) = link; - zend_list_addref(link); - php_pgsql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - goto cleanup; - } else { - zend_hash_del(&EG(regular_list),str.c,str.len+1); - } - } - if (PGG(max_links)!=-1 && PGG(num_links)>=PGG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create new link. Too many open links (%ld)", PGG(num_links)); - goto err; - } - if (connstring) { - pgsql = PQconnectdb(connstring); - } else { - pgsql = PQsetdb(host,port,options,tty,dbname); - } - if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { - PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); - if (pgsql) { - PQfinish(pgsql); - } - goto err; - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, pgsql, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list),str.c,str.len+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { - goto err; - } - PGG(num_links)++; - } - /* set notice processer */ - if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) { - PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void *)&Z_RESVAL_P(return_value)); - } - php_pgsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); - -cleanup: - smart_str_free(&str); - return; - -err: - smart_str_free(&str); - RETURN_FALSE; -} -/* }}} */ - -#if 0 -/* {{{ php_pgsql_get_default_link - */ -static int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (PGG(default_link)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_pgsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); - } - return PGG(default_link); -} -/* }}} */ -#endif - -/* {{{ proto resource pg_connect(string connection_string[, int connect_type] | [string host, string port [, string options [, string tty,]]] string database) - Open a PostgreSQL connection */ -PHP_FUNCTION(pg_connect) -{ - php_pgsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} -/* }}} */ - -/* {{{ proto resource pg_pconnect(string connection_string | [string host, string port [, string options [, string tty,]]] string database) - Open a persistent PostgreSQL connection */ -PHP_FUNCTION(pg_pconnect) -{ - php_pgsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* {{{ proto bool pg_close([resource connection]) - Close a PostgreSQL connection */ -PHP_FUNCTION(pg_close) -{ - zval **pgsql_link = NULL; - int id; - PGconn *pgsql; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (id==-1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(pgsql_link)); - } - - if (id!=-1 - || (pgsql_link && Z_RESVAL_PP(pgsql_link)==PGG(default_link))) { - zend_list_delete(PGG(default_link)); - PGG(default_link) = -1; - } - - RETURN_TRUE; -} -/* }}} */ - - -#define PHP_PG_DBNAME 1 -#define PHP_PG_ERROR_MESSAGE 2 -#define PHP_PG_OPTIONS 3 -#define PHP_PG_PORT 4 -#define PHP_PG_TTY 5 -#define PHP_PG_HOST 6 -#define PHP_PG_VERSION 7 - -/* {{{ php_pgsql_get_link_info - */ -static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - char *msgbuf; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - switch(entry_type) { - case PHP_PG_DBNAME: - Z_STRVAL_P(return_value) = PQdb(pgsql); - break; - case PHP_PG_ERROR_MESSAGE: - RETURN_STRING(PQErrorMessageTrim(pgsql, &msgbuf), 0); - return; - case PHP_PG_OPTIONS: - Z_STRVAL_P(return_value) = PQoptions(pgsql); - break; - case PHP_PG_PORT: - Z_STRVAL_P(return_value) = PQport(pgsql); - break; - case PHP_PG_TTY: - Z_STRVAL_P(return_value) = PQtty(pgsql); - break; - case PHP_PG_HOST: - Z_STRVAL_P(return_value) = PQhost(pgsql); - break; - case PHP_PG_VERSION: - array_init(return_value); - add_assoc_string(return_value, "client", PG_VERSION, 1); -#if HAVE_PQPROTOCOLVERSION - add_assoc_long(return_value, "protocol", PQprotocolVersion(pgsql)); -#if HAVE_PQPARAMETERSTATUS - if (PQprotocolVersion(pgsql) >= 3) { - add_assoc_string(return_value, "server", (char*)PQparameterStatus(pgsql, "server_version"), 1); - } -#endif -#endif - return; - default: - RETURN_FALSE; - } - if (Z_STRVAL_P(return_value)) { - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_STRVAL_P(return_value) = (char *) estrdup(Z_STRVAL_P(return_value)); - } else { - Z_STRLEN_P(return_value) = 0; - Z_STRVAL_P(return_value) = (char *) estrdup(""); - } - Z_TYPE_P(return_value) = IS_STRING; -} -/* }}} */ - -/* {{{ proto string pg_dbname([resource connection]) - Get the database name */ -PHP_FUNCTION(pg_dbname) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_DBNAME); -} -/* }}} */ - -/* {{{ proto string pg_last_error([resource connection]) - Get the error message string */ -PHP_FUNCTION(pg_last_error) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_ERROR_MESSAGE); -} -/* }}} */ - -/* {{{ proto string pg_options([resource connection]) - Get the options associated with the connection */ -PHP_FUNCTION(pg_options) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_OPTIONS); -} -/* }}} */ - -/* {{{ proto int pg_port([resource connection]) - Return the port number associated with the connection */ -PHP_FUNCTION(pg_port) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_PORT); -} -/* }}} */ - -/* {{{ proto string pg_tty([resource connection]) - Return the tty name associated with the connection */ -PHP_FUNCTION(pg_tty) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_TTY); -} -/* }}} */ - -/* {{{ proto string pg_host([resource connection]) - Returns the host name associated with the connection */ -PHP_FUNCTION(pg_host) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_HOST); -} -/* }}} */ - -/* {{{ proto array pg_version([resource connection]) - Returns an array with client, protocol and server version (when available) */ -PHP_FUNCTION(pg_version) -{ - php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_VERSION); -} -/* }}} */ - -#if HAVE_PQPARAMETERSTATUS -/* {{{ proto string|false pg_parameter_status([resource connection,] string param_name) - Returns the value of a server parameter */ -PHP_FUNCTION(pg_parameter_status) -{ - zval *pgsql_link; - int id; - PGconn *pgsql; - char *param; - int len; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, ¶m, &len) == SUCCESS) { - id = -1; - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶m, &len) == SUCCESS) { - pgsql_link = NULL; - id = PGG(default_link); - } else { - RETURN_FALSE; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - param = (char*)PQparameterStatus(pgsql, param); - if (param) { - RETURN_STRING(param, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif - -/* {{{ proto bool pg_ping([resource connection]) - Ping database. If connection is bad, try to reconnect. */ -PHP_FUNCTION(pg_ping) -{ - zval *pgsql_link; - int id; - PGconn *pgsql; - PGresult *res; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == SUCCESS) { - id = -1; - } else { - pgsql_link = NULL; - id = PGG(default_link); - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - /* ping connection */ - res = PQexec(pgsql, "SELECT 1;"); - PQclear(res); - - /* check status. */ - if (PQstatus(pgsql) == CONNECTION_OK) - RETURN_TRUE; - - /* reset connection if it's broken */ - PQreset(pgsql); - if (PQstatus(pgsql) == CONNECTION_OK) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto resource pg_query([resource connection,] string query) - Execute a query */ -PHP_FUNCTION(pg_query) -{ - zval **query, **pgsql_link = NULL; - int id = -1; - int leftover = 0; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - pgsql_result_handle *pg_result; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &pgsql_link, &query)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(query); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); - RETURN_FALSE; - } - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); - } - pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query)); - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQclear(pgsql_result); - PQreset(pgsql); - pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query)); - } - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - switch (status) { - case PGRES_EMPTY_QUERY: - case PGRES_BAD_RESPONSE: - case PGRES_NONFATAL_ERROR: - case PGRES_FATAL_ERROR: - PHP_PQ_ERROR("Query failed: %s", pgsql); - PQclear(pgsql_result); - RETURN_FALSE; - break; - case PGRES_COMMAND_OK: /* successful command that did not return rows */ - default: - if (pgsql_result) { - pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); - pg_result->conn = pgsql; - pg_result->result = pgsql_result; - pg_result->row = 0; - ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result); - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - break; - } -} -/* }}} */ - -#if HAVE_PQEXECPARAMS || HAVE_PQEXECPREPARED || HAVE_PQSENDQUERYPARAMS || HAVE_PQSENDQUERYPREPARED -/* {{{ _php_pgsql_free_params */ -static void _php_pgsql_free_params(char **params, int num_params) -{ - if (num_params > 0) { - efree(params); - } -} -/* }}} */ -#endif - -#if HAVE_PQEXECPARAMS -/* {{{ proto resource pg_query_params([resource connection,] string query, array params) - Execute a query */ -PHP_FUNCTION(pg_query_params) -{ - zval **query, **pgsql_link = NULL; - zval **pv_param_arr, **tmp; - int id = -1; - int leftover = 0; - int num_params = 0; - char **params = NULL; - unsigned char otype; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - pgsql_result_handle *pg_result; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &query, &pv_param_arr)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 3: - if (zend_get_parameters_ex(3, &pgsql_link, &query, &pv_param_arr)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(query); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); - RETURN_FALSE; - } - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); - num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - for(i = 0; i < num_params; i++) { - if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - otype = (*tmp)->type; - convert_to_string(*tmp); - if (Z_TYPE_PP(tmp) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - if (otype == IS_NULL) { - params[i] = NULL; - } - else { - params[i] = Z_STRVAL_PP(tmp); - } - - zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr)); - } - } - - pgsql_result = PQexecParams(pgsql, Z_STRVAL_PP(query), num_params, - NULL, (const char * const *)params, NULL, NULL, 0); - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQclear(pgsql_result); - PQreset(pgsql); - pgsql_result = PQexecParams(pgsql, Z_STRVAL_PP(query), num_params, - NULL, (const char * const *)params, NULL, NULL, 0); - } - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - _php_pgsql_free_params(params, num_params); - - switch (status) { - case PGRES_EMPTY_QUERY: - case PGRES_BAD_RESPONSE: - case PGRES_NONFATAL_ERROR: - case PGRES_FATAL_ERROR: - PHP_PQ_ERROR("Query failed: %s", pgsql); - PQclear(pgsql_result); - RETURN_FALSE; - break; - case PGRES_COMMAND_OK: /* successful command that did not return rows */ - default: - if (pgsql_result) { - pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); - pg_result->conn = pgsql; - pg_result->result = pgsql_result; - pg_result->row = 0; - ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result); - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - break; - } -} -/* }}} */ -#endif - -#if HAVE_PQPREPARE -/* {{{ proto resource pg_prepare([resource connection,] string stmtname, string query) - Prepare a query for future execution */ -PHP_FUNCTION(pg_prepare) -{ - zval **query, **stmtname, **pgsql_link = NULL; - int id = -1; - int leftover = 0; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - pgsql_result_handle *pg_result; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &stmtname, &query)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 3: - if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &query)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(stmtname); - convert_to_string_ex(query); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); - RETURN_FALSE; - } - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); - } - pgsql_result = PQprepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL); - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQclear(pgsql_result); - PQreset(pgsql); - pgsql_result = PQprepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL); - } - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - switch (status) { - case PGRES_EMPTY_QUERY: - case PGRES_BAD_RESPONSE: - case PGRES_NONFATAL_ERROR: - case PGRES_FATAL_ERROR: - PHP_PQ_ERROR("Query failed: %s", pgsql); - PQclear(pgsql_result); - RETURN_FALSE; - break; - case PGRES_COMMAND_OK: /* successful command that did not return rows */ - default: - if (pgsql_result) { - pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); - pg_result->conn = pgsql; - pg_result->result = pgsql_result; - pg_result->row = 0; - ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result); - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - break; - } -} -/* }}} */ -#endif - -#if HAVE_PQEXECPREPARED -/* {{{ proto resource pg_execute([resource connection,] string stmtname, array params) - Execute a prepared query */ -PHP_FUNCTION(pg_execute) -{ - zval **stmtname, **pgsql_link = NULL; - zval **pv_param_arr, **tmp; - int id = -1; - int leftover = 0; - int num_params = 0; - char **params = NULL; - unsigned char otype; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - pgsql_result_handle *pg_result; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &stmtname, &pv_param_arr)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 3: - if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &pv_param_arr)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(stmtname); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); - RETURN_FALSE; - } - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); - num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - for(i = 0; i < num_params; i++) { - if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - otype = (*tmp)->type; - convert_to_string(*tmp); - if (Z_TYPE_PP(tmp) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - if (otype == IS_NULL) { - params[i] = NULL; - } - else { - params[i] = Z_STRVAL_PP(tmp); - } - - zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr)); - } - } - - pgsql_result = PQexecPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, - (const char * const *)params, NULL, NULL, 0); - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQclear(pgsql_result); - PQreset(pgsql); - pgsql_result = PQexecPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, - (const char * const *)params, NULL, NULL, 0); - } - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - _php_pgsql_free_params(params, num_params); - - switch (status) { - case PGRES_EMPTY_QUERY: - case PGRES_BAD_RESPONSE: - case PGRES_NONFATAL_ERROR: - case PGRES_FATAL_ERROR: - PHP_PQ_ERROR("Query failed: %s", pgsql); - PQclear(pgsql_result); - RETURN_FALSE; - break; - case PGRES_COMMAND_OK: /* successful command that did not return rows */ - default: - if (pgsql_result) { - pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); - pg_result->conn = pgsql; - pg_result->result = pgsql_result; - pg_result->row = 0; - ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result); - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - break; - } -} -/* }}} */ -#endif - -#define PHP_PG_NUM_ROWS 1 -#define PHP_PG_NUM_FIELDS 2 -#define PHP_PG_CMD_TUPLES 3 - -/* {{{ php_pgsql_get_result_info - */ -static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval **result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - - switch (entry_type) { - case PHP_PG_NUM_ROWS: - Z_LVAL_P(return_value) = PQntuples(pgsql_result); - break; - case PHP_PG_NUM_FIELDS: - Z_LVAL_P(return_value) = PQnfields(pgsql_result); - break; - case PHP_PG_CMD_TUPLES: -#if HAVE_PQCMDTUPLES - Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result)); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported under this build"); - Z_LVAL_P(return_value) = 0; -#endif - break; - default: - RETURN_FALSE; - } - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto int pg_num_rows(resource result) - Return the number of rows in the result */ -PHP_FUNCTION(pg_num_rows) -{ - php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_NUM_ROWS); -} -/* }}} */ - -/* {{{ proto int pg_num_fields(resource result) - Return the number of fields in the result */ -PHP_FUNCTION(pg_num_fields) -{ - php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_NUM_FIELDS); -} -/* }}} */ - -#if HAVE_PQCMDTUPLES -/* {{{ proto int pg_affected_rows(resource result) - Returns the number of affected tuples */ -PHP_FUNCTION(pg_affected_rows) -{ - php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_CMD_TUPLES); -} -/* }}} */ -#endif - -/* {{{ proto string pg_last_notice(resource connection) - Returns the last notice set by the backend */ -PHP_FUNCTION(pg_last_notice) -{ - zval *pgsql_link; - PGconn *pg_link; - int id = -1; - php_pgsql_notice **notice; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - return; - } - /* Just to check if user passed valid resoruce */ - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (zend_hash_index_find(&PGG(notices), Z_RESVAL_P(pgsql_link), (void **)¬ice) == FAILURE) { - RETURN_FALSE; - } - RETURN_STRINGL((*notice)->message, (*notice)->len, 1); -} -/* }}} */ - -/* {{{ get_field_name - */ -static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC) -{ - PGresult *result; - smart_str str = {0}; - list_entry *field_type; - char *ret=NULL; - - /* try to lookup the type in the resource list */ - smart_str_appends(&str, "pgsql_oid_"); - smart_str_append_unsigned(&str, oid); - smart_str_0(&str); - - if (zend_hash_find(list,str.c,str.len+1,(void **) &field_type)==SUCCESS) { - ret = estrdup((char *)field_type->ptr); - } else { /* hash all oid's */ - int i,num_rows; - int oid_offset,name_offset; - char *tmp_oid, *end_ptr, *tmp_name; - list_entry new_oid_entry; - - if ((result = PQexec(pgsql,"select oid,typname from pg_type")) == NULL || PQresultStatus(result) != PGRES_TUPLES_OK) { - if (result) { - PQclear(result); - } - smart_str_free(&str); - return STR_EMPTY_ALLOC(); - } - num_rows = PQntuples(result); - oid_offset = PQfnumber(result,"oid"); - name_offset = PQfnumber(result,"typname"); - - for (i=0; i<num_rows; i++) { - if ((tmp_oid = PQgetvalue(result,i,oid_offset))==NULL) { - continue; - } - - str.len = 0; - smart_str_appends(&str, "pgsql_oid_"); - smart_str_appends(&str, tmp_oid); - smart_str_0(&str); - - if ((tmp_name = PQgetvalue(result,i,name_offset))==NULL) { - continue; - } - Z_TYPE(new_oid_entry) = le_string; - new_oid_entry.ptr = estrdup(tmp_name); - zend_hash_update(list,str.c,str.len+1,(void *) &new_oid_entry, sizeof(list_entry), NULL); - if (!ret && strtoul(tmp_oid, &end_ptr, 10)==oid) { - ret = estrdup(tmp_name); - } - } - PQclear(result); - } - - smart_str_free(&str); - return ret; -} -/* }}} */ - -#define PHP_PG_FIELD_NAME 1 -#define PHP_PG_FIELD_SIZE 2 -#define PHP_PG_FIELD_TYPE 3 -#define PHP_PG_FIELD_TYPE_OID 4 - -/* {{{ php_pgsql_get_field_info - */ -static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval **result, **field; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - Oid oid; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - convert_to_long_ex(field); - - if (Z_LVAL_PP(field) < 0 || Z_LVAL_PP(field) >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified"); - RETURN_FALSE; - } - - switch (entry_type) { - case PHP_PG_FIELD_NAME: - Z_STRVAL_P(return_value) = PQfname(pgsql_result, Z_LVAL_PP(field)); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_STRVAL_P(return_value) = estrndup(Z_STRVAL_P(return_value),Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_PG_FIELD_SIZE: - Z_LVAL_P(return_value) = PQfsize(pgsql_result, Z_LVAL_PP(field)); - Z_TYPE_P(return_value) = IS_LONG; - break; - case PHP_PG_FIELD_TYPE: - Z_STRVAL_P(return_value) = get_field_name(pg_result->conn, PQftype(pgsql_result, Z_LVAL_PP(field)), &EG(regular_list) TSRMLS_CC); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case PHP_PG_FIELD_TYPE_OID: - - oid = PQftype(pgsql_result, Z_LVAL_PP(field)); - - if (oid > LONG_MAX) { - smart_str s = {0}; - smart_str_append_unsigned(&s, oid); - smart_str_0(&s); - Z_STRVAL_P(return_value) = s.c; - Z_STRLEN_P(return_value) = s.len; - Z_TYPE_P(return_value) = IS_STRING; - } - else - { - Z_LVAL_P(return_value) = (long)oid; - Z_TYPE_P(return_value) = IS_LONG; - } - break; - default: - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string pg_field_name(resource result, int field_number) - Returns the name of the field */ -PHP_FUNCTION(pg_field_name) -{ - php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_NAME); -} -/* }}} */ - -/* {{{ proto int pg_field_size(resource result, int field_number) - Returns the internal size of the field */ -PHP_FUNCTION(pg_field_size) -{ - php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_SIZE); -} -/* }}} */ - -/* {{{ proto string pg_field_type(resource result, int field_number) - Returns the type name for the given field */ -PHP_FUNCTION(pg_field_type) -{ - php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_TYPE); -} -/* }}} */ - - -/* {{{ proto string pg_field_type_oid(resource result, int field_number) - Returns the type oid for the given field */ -PHP_FUNCTION(pg_field_type_oid) -{ - php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_TYPE_OID); -} -/* }}} */ - -/* {{{ proto int pg_field_num(resource result, string field_name) - Returns the field number of the named field */ -PHP_FUNCTION(pg_field_num) -{ - zval **result, **field; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - - convert_to_string_ex(field); - Z_LVAL_P(return_value) = PQfnumber(pgsql_result, Z_STRVAL_PP(field)); - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto mixed pg_fetch_result(resource result, [int row_number,] mixed field_name) - Returns values from a result identifier */ -PHP_FUNCTION(pg_fetch_result) -{ - zval **result, **row, **field=NULL; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - int field_offset, pgsql_row; - - if ((ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &result, &row, &field)==FAILURE) && - (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result, &field)==FAILURE)) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - if (ZEND_NUM_ARGS() == 2) { - if (pg_result->row < 0) - pg_result->row = 0; - pgsql_row = pg_result->row; - if (pgsql_row >= PQntuples(pgsql_result)) { - RETURN_FALSE; - } - } else { - convert_to_long_ex(row); - pgsql_row = Z_LVAL_PP(row); - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on PostgreSQL result index %ld", - Z_LVAL_PP(row), Z_LVAL_PP(result)); - RETURN_FALSE; - } - } - switch(Z_TYPE_PP(field)) { - case IS_STRING: - field_offset = PQfnumber(pgsql_result, Z_STRVAL_PP(field)); - break; - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - break; - } - if (field_offset<0 || field_offset>=PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - - if (PQgetisnull(pgsql_result, pgsql_row, field_offset)) { - Z_TYPE_P(return_value) = IS_NULL; - } else { - Z_STRVAL_P(return_value) = PQgetvalue(pgsql_result, pgsql_row, field_offset); - Z_STRLEN_P(return_value) = (Z_STRVAL_P(return_value) ? strlen(Z_STRVAL_P(return_value)) : 0); - Z_STRVAL_P(return_value) = safe_estrndup(Z_STRVAL_P(return_value),Z_STRLEN_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } -} -/* }}} */ - -/* {{{ void php_pgsql_fetch_hash */ -static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, int into_object) -{ - zval *result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - int i, num_fields, pgsql_row, use_row; - long row = -1; - char *element, *field_name; - uint element_len; - zval *ctor_params = NULL; - zend_class_entry *ce = NULL; - - if (into_object) { - char *class_name; - int class_name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lsz", &result, &row, &class_name, &class_name_len, &ctor_params) == FAILURE) { - return; - } - if (ZEND_NUM_ARGS() < 3) { - ce = zend_standard_class_def; - } else { - ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - } - if (!ce) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); - return; - } - result_type = PGSQL_ASSOC; - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &result, &row, &result_type) == FAILURE) { - return; - } - } - use_row = ZEND_NUM_ARGS() > 1 && row != -1; - - if (!(result_type & PGSQL_BOTH)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - - if (use_row) { - pgsql_row = row; - pg_result->row = pgsql_row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on PostgreSQL result index %ld", - row, Z_LVAL_P(result)); - RETURN_FALSE; - } - } else { - /* If 2nd param is NULL, use internal row counter to access next row */ - pgsql_row = pg_result->row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - RETURN_FALSE; - } - pg_result->row++; - } - - array_init(return_value); - for (i = 0, num_fields = PQnfields(pgsql_result); i < num_fields; i++) { - if (PQgetisnull(pgsql_result, pgsql_row, i)) { - if (result_type & PGSQL_NUM) { - add_index_null(return_value, i); - } - if (result_type & PGSQL_ASSOC) { - field_name = PQfname(pgsql_result, i); - add_assoc_null(return_value, field_name); - } - } else { - element = PQgetvalue(pgsql_result, pgsql_row, i); - element_len = (element ? strlen(element) : 0); - if (element) { - char *data; - int data_len; - int should_copy=0; - - if (PG(magic_quotes_runtime)) { - data = php_addslashes(element, element_len, &data_len, 0 TSRMLS_CC); - } else { - data = safe_estrndup(element, element_len); - data_len = element_len; - } - - if (result_type & PGSQL_NUM) { - add_index_stringl(return_value, i, data, data_len, should_copy); - should_copy=1; - } - - if (result_type & PGSQL_ASSOC) { - field_name = PQfname(pgsql_result, i); - add_assoc_stringl(return_value, field_name, data, data_len, should_copy); - } - } - } - } - - if (into_object) { - zval dataset = *return_value; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *retval_ptr; - - object_and_properties_init(return_value, ce, NULL); - zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); - - if (ce->constructor) { - fci.size = sizeof(fci); - fci.function_table = &ce->function_table; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &return_value; - fci.retval_ptr_ptr = &retval_ptr; - if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { - if (Z_TYPE_P(ctor_params) == IS_ARRAY) { - HashTable *ht = Z_ARRVAL_P(ctor_params); - Bucket *p; - - fci.param_count = 0; - fci.params = emalloc(sizeof(zval*) * ht->nNumOfElements); - p = ht->pListHead; - while (p != NULL) { - fci.params[fci.param_count++] = (zval**)p->pData; - p = p->pListNext; - } - } else { - /* Two problems why we throw exceptions here: PHP is typeless - * and hence passing one argument that's not an array could be - * by mistake and the other way round is possible, too. The - * single value is an array. Also we'd have to make that one - * argument passed by reference. - */ - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); - return; - } - } else { - fci.param_count = 0; - fci.params = NULL; - } - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); - } else { - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - } - if (fci.params) { - efree(fci.params); - } - } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); - } - } -} -/* }}} */ - -/* {{{ proto array pg_fetch_row(resource result [, int row [, int result_type]]) - Get a row as an enumerated array */ -PHP_FUNCTION(pg_fetch_row) -{ - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_NUM, 0); -} -/* }}} */ - -/* {{{ proto array pg_fetch_assoc(resource result [, int row]) - Fetch a row as an assoc array */ -PHP_FUNCTION(pg_fetch_assoc) -{ - /* pg_fetch_assoc() is added from PHP 4.3.0. It should raise error, when - there is 3rd parameter */ - if (ZEND_NUM_ARGS() > 2) - WRONG_PARAM_COUNT; - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 0); -} -/* }}} */ - -/* {{{ proto array pg_fetch_array(resource result [, int row [, int result_type]]) - Fetch a row as an array */ -PHP_FUNCTION(pg_fetch_array) -{ - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_BOTH, 0); -} -/* }}} */ - -/* {{{ proto object pg_fetch_object(resource result [, int row [, string class_name [, NULL|array ctor_params]]]) - Fetch a row as an object */ -PHP_FUNCTION(pg_fetch_object) -{ - /* pg_fetch_object() allowed result_type used to be. 3rd parameter - must be allowed for compatibility */ - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 1); -} -/* }}} */ - -/* {{{ proto array pg_fetch_all(resource result) - Fetch all rows into array */ -PHP_FUNCTION(pg_fetch_all) -{ - zval *result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &result) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - array_init(return_value); - if (php_pgsql_result2array(pgsql_result, return_value TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number]) - Fetch all rows into array */ -PHP_FUNCTION(pg_fetch_all_columns) -{ - zval *result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - long colno=0; - int pg_numrows, pg_row; - size_t num_fields; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - - num_fields = PQnfields(pgsql_result); - if (colno >= num_fields || colno < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%ld'", colno); - RETURN_FALSE; - } - - array_init(return_value); - - if ((pg_numrows = PQntuples(pgsql_result)) <= 0) { - return; - } - - for (pg_row = 0; pg_row < pg_numrows; pg_row++) { - if (PQgetisnull(pgsql_result, pg_row, colno)) { - add_next_index_null(return_value); - } else { - add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); - } - } -} -/* }}} */ - -/* {{{ proto bool pg_result_seek(resource result, int offset) - Set internal row offset */ -PHP_FUNCTION(pg_result_seek) -{ - zval *result; - long row; - pgsql_result_handle *pg_result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - if (row < 0 || row >= PQntuples(pg_result->result)) { - RETURN_FALSE; - } - - /* seek to offset */ - pg_result->row = row; - RETURN_TRUE; -} -/* }}} */ - - -#define PHP_PG_DATA_LENGTH 1 -#define PHP_PG_DATA_ISNULL 2 - -/* {{{ php_pgsql_data_info - */ -static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval **result, **row, **field; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - int field_offset, pgsql_row; - - if ((ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &result, &row, &field)==FAILURE) && - (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result, &field)==FAILURE)) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - if (ZEND_NUM_ARGS() == 2) { - if (pg_result->row < 0) - pg_result->row = 0; - pgsql_row = pg_result->row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - RETURN_FALSE; - } - } else { - convert_to_long_ex(row); - pgsql_row = Z_LVAL_PP(row); - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on PostgreSQL result index %ld", - Z_LVAL_PP(row), Z_LVAL_PP(result)); - RETURN_FALSE; - } - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: - convert_to_string_ex(field); - field_offset = PQfnumber(pgsql_result, Z_STRVAL_PP(field)); - break; - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - break; - } - if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - - switch (entry_type) { - case PHP_PG_DATA_LENGTH: - Z_LVAL_P(return_value) = PQgetlength(pgsql_result, pgsql_row, field_offset); - break; - case PHP_PG_DATA_ISNULL: - Z_LVAL_P(return_value) = PQgetisnull(pgsql_result, pgsql_row, field_offset); - break; - } - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto int pg_field_prtlen(resource result, [int row,] mixed field_name_or_number) - Returns the printed length */ -PHP_FUNCTION(pg_field_prtlen) -{ - php_pgsql_data_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_DATA_LENGTH); -} -/* }}} */ - -/* {{{ proto int pg_field_is_null(resource result, [int row,] mixed field_name_or_number) - Test if a field is NULL */ -PHP_FUNCTION(pg_field_is_null) -{ - php_pgsql_data_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_DATA_ISNULL); -} -/* }}} */ - -/* {{{ proto bool pg_free_result(resource result) - Free result memory */ -PHP_FUNCTION(pg_free_result) -{ - zval **result; - pgsql_result_handle *pg_result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - if (Z_LVAL_PP(result) == 0) { - RETURN_FALSE; - } - zend_list_delete(Z_LVAL_PP(result)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string pg_last_oid(resource result) - Returns the last object identifier */ -PHP_FUNCTION(pg_last_oid) -{ - zval **result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; -#ifdef HAVE_PQOIDVALUE - Oid oid; -#endif - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result)==FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result); - pgsql_result = pg_result->result; -#ifdef HAVE_PQOIDVALUE - oid = PQoidValue(pgsql_result); - if (oid == InvalidOid) { - RETURN_FALSE; - } - PGSQL_RETURN_OID(oid); -#else - Z_STRVAL_P(return_value) = (char *) PQoidStatus(pgsql_result); - if (Z_STRVAL_P(return_value)) { - RETURN_STRING(Z_STRVAL_P(return_value), 1); - } - RETURN_STRING("", 1); -#endif -} -/* }}} */ - -/* {{{ proto bool pg_trace(string filename [, string mode [, resource connection]]) - Enable tracing a PostgreSQL connection */ -PHP_FUNCTION(pg_trace) -{ - zval **z_filename, **z_mode, **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - char *mode = "w"; - FILE *fp = NULL; - php_stream *stream; - id = PGG(default_link); - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &z_filename)==FAILURE) { - RETURN_FALSE; - } - CHECK_DEFAULT_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &z_filename, &z_mode)==FAILURE) { - RETURN_FALSE; - } - CHECK_DEFAULT_LINK(id); - convert_to_string_ex(z_mode); - mode = Z_STRVAL_PP(z_mode); - break; - case 3: - if (zend_get_parameters_ex(3, &z_filename, &z_mode, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(z_mode); - mode = Z_STRVAL_PP(z_mode); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - convert_to_string_ex(z_filename); - - stream = php_stream_open_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); - - if (!stream) { - RETURN_FALSE; - } - - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)fp, REPORT_ERRORS)) { - php_stream_close(stream); - RETURN_FALSE; - } - php_stream_auto_cleanup(stream); - PQtrace(pgsql, fp); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool pg_untrace([resource connection]) - Disable tracing of a PostgreSQL connection */ -PHP_FUNCTION(pg_untrace) -{ - zval **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - PQuntrace(pgsql); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int pg_lo_create([resource connection]) - Create a large object */ -PHP_FUNCTION(pg_lo_create) -{ - zval **pgsql_link = NULL; - PGconn *pgsql; - Oid pgsql_oid; - int id = -1; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - /* NOTE: Archive modes not supported until I get some more data. Don't think anybody's - using it anyway. I believe it's also somehow related to the 'time travel' feature of - PostgreSQL, that's on the list of features to be removed... Create modes not supported. - What's the use of an object that can be only written to, but not read from, and vice - versa? Beats me... And the access type (r/w) must be specified again when opening - the object, probably (?) overrides this. (Jouni) - */ - - if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object"); - RETURN_FALSE; - } - PGSQL_RETURN_OID(pgsql_oid); -} -/* }}} */ - -/* {{{ proto bool pg_lo_unlink([resource connection,] string large_object_oid) - Delete a large object */ -PHP_FUNCTION(pg_lo_unlink) -{ - zval *pgsql_link = NULL; - long oid_long; - char *oid_string, *end_ptr; - int oid_strlen; - PGconn *pgsql; - Oid oid; - int id = -1; - int argc = ZEND_NUM_ARGS(); - - /* accept string type since Oid type is unsigned int */ - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rs", &pgsql_link, &oid_string, &oid_strlen) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rl", &pgsql_link, &oid_long) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "s", &oid_string, &oid_strlen) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "l", &oid_long) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments"); - RETURN_FALSE; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (lo_unlink(pgsql, oid) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete PostgreSQL large object %u", oid); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto resource pg_lo_open([resource connection,] int large_object_oid, string mode) - Open a large object and return fd */ -PHP_FUNCTION(pg_lo_open) -{ - zval *pgsql_link = NULL; - long oid_long; - char *oid_string, *end_ptr, *mode_string; - int oid_strlen, mode_strlen; - PGconn *pgsql; - Oid oid; - int id = -1, pgsql_mode=0, pgsql_lofd; - int create=0; - pgLofp *pgsql_lofp; - int argc = ZEND_NUM_ARGS(); - - /* accept string type since Oid is unsigned int */ - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rss", &pgsql_link, &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "ss", &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments"); - RETURN_FALSE; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - /* r/w/+ is little bit more PHP-like than INV_READ/INV_WRITE and a lot of - faster to type. Unfortunately, doesn't behave the same way as fopen()... - (Jouni) - */ - - if (strchr(mode_string, 'r') == mode_string) { - pgsql_mode |= INV_READ; - if (strchr(mode_string, '+') == mode_string+1) { - pgsql_mode |= INV_WRITE; - } - } - if (strchr(mode_string, 'w') == mode_string) { - pgsql_mode |= INV_WRITE; - create = 1; - if (strchr(mode_string, '+') == mode_string+1) { - pgsql_mode |= INV_READ; - } - } - - pgsql_lofp = (pgLofp *) emalloc(sizeof(pgLofp)); - - if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { - if (create) { - if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { - efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object"); - RETURN_FALSE; - } else { - if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { - if (lo_unlink(pgsql, oid) == -1) { - efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Something is really messed up! Your database is badly corrupted in a way NOT related to PHP"); - RETURN_FALSE; - } - efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object"); - RETURN_FALSE; - } else { - pgsql_lofp->conn = pgsql; - pgsql_lofp->lofd = pgsql_lofd; - Z_LVAL_P(return_value) = zend_list_insert(pgsql_lofp, le_lofp); - Z_TYPE_P(return_value) = IS_LONG; - } - } - } else { - efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object"); - RETURN_FALSE; - } - } else { - pgsql_lofp->conn = pgsql; - pgsql_lofp->lofd = pgsql_lofd; - ZEND_REGISTER_RESOURCE(return_value, pgsql_lofp, le_lofp); - } -} -/* }}} */ - -/* {{{ proto bool pg_lo_close(resource large_object) - Close a large object */ -PHP_FUNCTION(pg_lo_close) -{ - zval **pgsql_lofp; - pgLofp *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &pgsql_lofp)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp); - - if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd); - RETVAL_FALSE; - } else { - RETVAL_TRUE; - } - - zend_list_delete(Z_RESVAL_PP(pgsql_lofp)); - return; -} -/* }}} */ - -#define PGSQL_LO_READ_BUF_SIZE 8192 - -/* {{{ proto string pg_lo_read(resource large_object [, int len]) - Read a large object */ -PHP_FUNCTION(pg_lo_read) -{ - zval **pgsql_id, **len; - int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes; - char *buf; - pgLofp *pgsql; - - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 2 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &pgsql_id, &len) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, "PostgreSQL large object", le_lofp); - - if (ZEND_NUM_ARGS() > 1) { - convert_to_long_ex(len); - buf_len = Z_LVAL_PP(len); - } - - buf = (char *) safe_emalloc(sizeof(char), (buf_len+1), 0); - if ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, buf, buf_len))<0) { - efree(buf); - RETURN_FALSE; - } - - buf[nbytes] = '\0'; - RETURN_STRINGL(buf, nbytes, 0); -} -/* }}} */ - -/* {{{ proto int pg_lo_write(resource large_object, string buf [, int len]) - Write a large object */ -PHP_FUNCTION(pg_lo_write) -{ - zval **pgsql_id, **str, **z_len; - int nbytes; - int len; - pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, &pgsql_id, &str, &z_len) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(str); - - if (argc > 2) { - convert_to_long_ex(z_len); - if (Z_LVAL_PP(z_len) > Z_STRLEN_PP(str)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %ld", - Z_STRLEN_PP(str), Z_LVAL_PP(z_len)); - RETURN_FALSE; - } - if (Z_LVAL_PP(z_len) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0, but %ld was specified", Z_LVAL_PP(z_len)); - RETURN_FALSE; - } - len = Z_LVAL_PP(z_len); - } - else { - len = Z_STRLEN_PP(str); - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, "PostgreSQL large object", le_lofp); - - if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, Z_STRVAL_PP(str), len)) == -1) { - RETURN_FALSE; - } - - RETURN_LONG(nbytes); -} -/* }}} */ - -/* {{{ proto int pg_lo_read_all(resource large_object) - Read a large object and send straight to browser */ -PHP_FUNCTION(pg_lo_read_all) -{ - zval **pgsql_id; - int tbytes; - volatile int nbytes; - char buf[PGSQL_LO_READ_BUF_SIZE]; - pgLofp *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &pgsql_id)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, "PostgreSQL large object", le_lofp); - - tbytes = 0; - while ((nbytes = lo_read((PGconn *)pgsql->conn, pgsql->lofd, buf, PGSQL_LO_READ_BUF_SIZE))>0) { - php_body_write(buf, nbytes TSRMLS_CC); - tbytes += nbytes; - } - RETURN_LONG(tbytes); -} -/* }}} */ - -/* {{{ proto int pg_lo_import([resource connection, ] string filename) - Import large object direct from filesystem */ -PHP_FUNCTION(pg_lo_import) -{ - zval *pgsql_link = NULL; - char *file_in; - int id = -1, name_len; - int argc = ZEND_NUM_ARGS(); - PGconn *pgsql; - Oid oid; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rs", &pgsql_link, &file_in, &name_len) == SUCCESS) { - ; - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "s", &file_in, &name_len) == SUCCESS) { - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "sr", &file_in, &name_len, &pgsql_link ) == SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used"); - } - else { - WRONG_PARAM_COUNT; - } - - if (PG(safe_mode) &&(!php_checkuid(file_in, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(file_in TSRMLS_CC)) { - RETURN_FALSE; - } - - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - oid = lo_import(pgsql, file_in); - - if (oid == InvalidOid) { - RETURN_FALSE; - } - PGSQL_RETURN_OID(oid); -} -/* }}} */ - -/* {{{ proto bool pg_lo_export([resource connection, ] int objoid, string filename) - Export large object direct to filesystem */ -PHP_FUNCTION(pg_lo_export) -{ - zval *pgsql_link = NULL; - char *file_out, *oid_string, *end_ptr; - int oid_strlen; - int id = -1, name_len; - long oid_long; - Oid oid; - PGconn *pgsql; - int argc = ZEND_NUM_ARGS(); - - /* allow string to handle large OID value correctly */ - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rls", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "rss", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "ls", &oid_long, &file_out, &name_len) == SUCCESS) { - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "ss", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "ssr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) { - oid = (Oid)strtoul(oid_string, &end_ptr, 10); - if ((oid_string+oid_strlen) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; - } - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, - "lsr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used"); - if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; - } - oid = (Oid)oid_long; - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 2 or 3 arguments"); - RETURN_FALSE; - } - - if (PG(safe_mode) &&(!php_checkuid(file_out, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(file_out TSRMLS_CC)) { - RETURN_FALSE; - } - - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (lo_export(pgsql, oid, file_out)) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool pg_lo_seek(resource large_object, int offset [, int whence]) - Seeks position of large object */ -PHP_FUNCTION(pg_lo_seek) -{ - zval *pgsql_id = NULL; - long offset = 0, whence = SEEK_CUR; - pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) { - return; - } - if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid whence parameter"); - return; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_lofp); - - if (lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence) > -1) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int pg_lo_tell(resource large_object) - Returns current position of large object */ -PHP_FUNCTION(pg_lo_tell) -{ - zval *pgsql_id = NULL; - int offset = 0; - pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "r", &pgsql_id) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_lofp); - - offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); - RETURN_LONG(offset); -} -/* }}} */ - -#if HAVE_PQSETERRORVERBOSITY -/* {{{ proto int pg_set_error_verbosity([resource connection,] int verbosity) - Set error verbosity */ -PHP_FUNCTION(pg_set_error_verbosity) -{ - zval **verbosity, **pgsql_link = NULL; - long val; - int id = -1; - PGconn *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &verbosity)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &pgsql_link, &verbosity)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_long_ex(verbosity); - val = Z_LVAL_PP(verbosity); - if (val & (PQERRORS_TERSE|PQERRORS_DEFAULT|PQERRORS_VERBOSE)) { - Z_LVAL_P(return_value) = PQsetErrorVerbosity(pgsql, val); - Z_TYPE_P(return_value) = IS_LONG; - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif - -#ifdef HAVE_PQCLIENTENCODING -/* {{{ proto int pg_set_client_encoding([resource connection,] string encoding) - Set client encoding */ -PHP_FUNCTION(pg_set_client_encoding) -{ - zval **encoding, **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &encoding)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &pgsql_link, &encoding)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(encoding); - Z_LVAL_P(return_value) = PQsetClientEncoding(pgsql, Z_STRVAL_PP(encoding)); - Z_TYPE_P(return_value) = IS_LONG; - -} -/* }}} */ - -/* {{{ proto string pg_client_encoding([resource connection]) - Get the current client encoding */ -PHP_FUNCTION(pg_client_encoding) -{ - zval **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - /* Just do the same as found in PostgreSQL sources... */ - -#ifndef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT -#define pg_encoding_to_char(x) "SQL_ASCII" -#endif - - Z_STRVAL_P(return_value) - = (char *) pg_encoding_to_char(PQclientEncoding(pgsql)); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_STRVAL_P(return_value) = (char *) estrdup(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; -} -/* }}} */ -#endif - -#if !HAVE_PQGETCOPYDATA -#define COPYBUFSIZ 8192 -#endif - -/* {{{ proto bool pg_end_copy([resource connection]) - Sync with backend. Completes the Copy command */ -PHP_FUNCTION(pg_end_copy) -{ - zval **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - int result = 0; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &pgsql_link)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - result = PQendcopy(pgsql); - - if (result!=0) { - PHP_PQ_ERROR("Query failed: %s", pgsql); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool pg_put_line([resource connection,] string query) - Send null-terminated string to backend server*/ -PHP_FUNCTION(pg_put_line) -{ - zval **query, **pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - int result = 0; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = PGG(default_link); - CHECK_DEFAULT_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &pgsql_link, &query)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(query); - result = PQputline(pgsql, Z_STRVAL_PP(query)); - if (result==EOF) { - PHP_PQ_ERROR("Query failed: %s", pgsql); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array pg_copy_to(resource connection, string table_name [, string delimiter [, string null_as]]) - Copy table to array */ -PHP_FUNCTION(pg_copy_to) -{ - zval *pgsql_link; - char *table_name, *pg_delim = NULL, *pg_null_as = NULL; - int table_name_len, pg_delim_len, pg_null_as_len; - char *query; - char *query_template = "COPY \"\" TO STDOUT DELIMITERS ':' WITH NULL AS ''"; - int id = -1; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - int copydone = 0; -#if !HAVE_PQGETCOPYDATA - char copybuf[COPYBUFSIZ]; -#endif - char *csv = (char *)NULL; - int ret; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rs|ss", - &pgsql_link, &table_name, &table_name_len, - &pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) { - return; - } - if (!pg_delim) { - pg_delim = "\t"; - } - if (!pg_null_as) { - pg_null_as = safe_estrdup("\\\\N"); - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - query = (char *)emalloc(strlen(query_template) + strlen(table_name) + strlen(pg_null_as) + 1); - sprintf(query, "COPY \"%s\" TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", - table_name, *pg_delim, pg_null_as); - - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - } - pgsql_result = PQexec(pgsql, query); - efree(pg_null_as); - efree(query); - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - switch (status) { - case PGRES_COPY_OUT: - if (pgsql_result) { - PQclear(pgsql_result); - array_init(return_value); -#if HAVE_PQGETCOPYDATA - while (!copydone) - { - ret = PQgetCopyData(pgsql, &csv, 0); - switch (ret) { - case -1: - copydone = 1; - break; - case 0: - case -2: - PHP_PQ_ERROR("getline failed: %s", pgsql); - RETURN_FALSE; - break; - default: - add_next_index_string(return_value, csv, 1); - PQfreemem(csv); - break; - } - } -#else - while (!copydone) - { - if ((ret = PQgetline(pgsql, copybuf, COPYBUFSIZ))) { - PHP_PQ_ERROR("getline failed: %s", pgsql); - RETURN_FALSE; - } - - if (copybuf[0] == '\\' && - copybuf[1] == '.' && - copybuf[2] == '\0') - { - copydone = 1; - } - else - { - if (csv == (char *)NULL) { - csv = estrdup(copybuf); - } else { - csv = (char *)erealloc(csv, strlen(csv) + sizeof(char)*(COPYBUFSIZ+1)); - strcat(csv, copybuf); - } - - switch (ret) - { - case EOF: - copydone = 1; - case 0: - add_next_index_string(return_value, csv, 1); - efree(csv); - csv = (char *)NULL; - break; - case 1: - break; - } - } - } - if (PQendcopy(pgsql)) { - PHP_PQ_ERROR("endcopy failed: %s", pgsql); - RETURN_FALSE; - } -#endif - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - } - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - break; - default: - PQclear(pgsql_result); - PHP_PQ_ERROR("Copy command failed: %s", pgsql); - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto bool pg_copy_from(resource connection, string table_name , array rows [, string delimiter [, string null_as]]) - Copy table from array */ -PHP_FUNCTION(pg_copy_from) -{ - zval *pgsql_link = NULL, *pg_rows; - zval **tmp; - char *table_name, *pg_delim = NULL, *pg_null_as = NULL; - int table_name_len, pg_delim_len, pg_null_as_len; - int pg_null_as_free = 0; - char *query; - char *query_template = "COPY \"\" FROM STDIN DELIMITERS ':' WITH NULL AS ''"; - HashPosition pos; - int id = -1; - PGconn *pgsql; - PGresult *pgsql_result; - ExecStatusType status; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rs/a|ss", - &pgsql_link, &table_name, &table_name_len, &pg_rows, - &pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) { - return; - } - if (!pg_delim) { - pg_delim = "\t"; - } - if (!pg_null_as) { - pg_null_as = safe_estrdup("\\\\N"); - pg_null_as_free = 1; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - query = (char *)emalloc(strlen(query_template) + strlen(table_name) + strlen(pg_null_as) + 1); - sprintf(query, "COPY \"%s\" FROM STDIN DELIMITERS '%c' WITH NULL AS '%s'", - table_name, *pg_delim, pg_null_as); - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - } - pgsql_result = PQexec(pgsql, query); - - if (pg_null_as_free) { - efree(pg_null_as); - } - efree(query); - - if (pgsql_result) { - status = PQresultStatus(pgsql_result); - } else { - status = (ExecStatusType) PQstatus(pgsql); - } - - switch (status) { - case PGRES_COPY_IN: - if (pgsql_result) { - int command_failed = 0; - PQclear(pgsql_result); - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(pg_rows), &pos); -#if HAVE_PQPUTCOPYDATA - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) { - convert_to_string_ex(tmp); - query = (char *)emalloc(Z_STRLEN_PP(tmp) +2); - strcpy(query, Z_STRVAL_PP(tmp)); - if(*(query+Z_STRLEN_PP(tmp)-1) != '\n') - strcat(query, "\n"); - if (PQputCopyData(pgsql, query, strlen(query)) != 1) { - efree(query); - PHP_PQ_ERROR("copy failed: %s", pgsql); - RETURN_FALSE; - } - efree(query); - zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos); - } - if (PQputCopyEnd(pgsql, NULL) != 1) { - PHP_PQ_ERROR("putcopyend failed: %s", pgsql); - RETURN_FALSE; - } -#else - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) { - convert_to_string_ex(tmp); - query = (char *)emalloc(Z_STRLEN_PP(tmp) +2); - strcpy(query, Z_STRVAL_PP(tmp)); - if(*(query+Z_STRLEN_PP(tmp)-1) != '\n') - strcat(query, "\n"); - if (PQputline(pgsql, query)==EOF) { - efree(query); - PHP_PQ_ERROR("copy failed: %s", pgsql); - RETURN_FALSE; - } - efree(query); - zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos); - } - if (PQputline(pgsql, "\\.\n") == EOF) { - PHP_PQ_ERROR("putline failed: %s", pgsql); - RETURN_FALSE; - } - if (PQendcopy(pgsql)) { - PHP_PQ_ERROR("endcopy failed: %s", pgsql); - RETURN_FALSE; - } -#endif - while ((pgsql_result = PQgetResult(pgsql))) { - if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) { - PHP_PQ_ERROR("Copy command failed: %s", pgsql); - command_failed = 1; - } - PQclear(pgsql_result); - } - if (command_failed) { - RETURN_FALSE; - } - } else { - PQclear(pgsql_result); - RETURN_FALSE; - } - RETURN_TRUE; - break; - default: - PQclear(pgsql_result); - PHP_PQ_ERROR("Copy command failed: %s", pgsql); - RETURN_FALSE; - break; - } -} -/* }}} */ - -#ifdef HAVE_PQESCAPE -/* {{{ proto string pg_escape_string(string data) - Escape string for text/char type */ -PHP_FUNCTION(pg_escape_string) -{ - char *from = NULL, *to = NULL; - int to_len; - int from_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &from, &from_len) == FAILURE) { - return; - } - - to = (char *)safe_emalloc(from_len, 2, 1); - to_len = (int)PQescapeString(to, from, from_len); - RETURN_STRINGL(to, to_len, 0); -} -/* }}} */ - -/* {{{ proto string pg_escape_bytea(string data) - Escape binary for bytea type */ -PHP_FUNCTION(pg_escape_bytea) -{ - char *from = NULL, *to = NULL; - size_t to_len; - int from_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &from, &from_len) == FAILURE) { - return; - } - - to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); - RETVAL_STRINGL(to, to_len-1, 1); /* to_len includes addtional '\0' */ - free(to); -} -/* }}} */ - -#if !HAVE_PQUNESCAPEBYTEA -/* PQunescapeBytea() from PostgreSQL 7.3 to provide bytea unescape feature to 7.2 users. - Renamed to php_pgsql_unescape_bytea() */ -/* - * PQunescapeBytea - converts the null terminated string representation - * of a bytea, strtext, into binary, filling a buffer. It returns a - * pointer to the buffer which is NULL on error, and the size of the - * buffer in retbuflen. The pointer may subsequently be used as an - * argument to the function free(3). It is the reverse of PQescapeBytea. - * - * The following transformations are reversed: - * '\0' == ASCII 0 == \000 - * '\'' == ASCII 39 == \' - * '\\' == ASCII 92 == \\ - * - * States: - * 0 normal 0->1->2->3->4 - * 1 \ 1->5 - * 2 \0 1->6 - * 3 \00 - * 4 \000 - * 5 \' - * 6 \\ - */ -static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *retbuflen) -{ - size_t buflen; - unsigned char *buffer, - *sp, - *bp; - unsigned int state = 0; - - if (strtext == NULL) - return NULL; - buflen = strlen(strtext); /* will shrink, also we discover if - * strtext */ - buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */ - for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++) - { - switch (state) - { - case 0: - if (*sp == '\\') - state = 1; - *bp = *sp; - break; - case 1: - if (*sp == '\'') /* state=5 */ - { /* replace \' with 39 */ - bp--; - *bp = '\''; - buflen--; - state = 0; - } - else if (*sp == '\\') /* state=6 */ - { /* replace \\ with 92 */ - bp--; - *bp = '\\'; - buflen--; - state = 0; - } - else - { - if (isdigit(*sp)) - state = 2; - else - state = 0; - *bp = *sp; - } - break; - case 2: - if (isdigit(*sp)) - state = 3; - else - state = 0; - *bp = *sp; - break; - case 3: - if (isdigit(*sp)) /* state=4 */ - { - unsigned char *start, *end, buf[4]; /* 000 + '\0' */ - - bp -= 3; - memcpy(buf, sp-2, 3); - buf[3] = '\0'; - start = buf; - *bp = (unsigned char)strtoul(start, (char **)&end, 8); - buflen -= 3; - state = 0; - } - else - { - *bp = *sp; - state = 0; - } - break; - } - } - buffer = erealloc(buffer, buflen+1); - buffer[buflen] = '\0'; - - *retbuflen = buflen; - return buffer; -} -#endif - -/* {{{ proto string pg_unescape_bytea(string data) - Unescape binary for bytea type */ -PHP_FUNCTION(pg_unescape_bytea) -{ - char *from = NULL, *to = NULL, *tmp = NULL; - size_t to_len; - int from_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &from, &from_len) == FAILURE) { - return; - } - -#if HAVE_PQUNESCAPEBYTEA - tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len); - to = estrndup(tmp, to_len); - PQfreemem(tmp); -#else - to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len); -#endif - if (!to) { - RETURN_FALSE; - } - RETVAL_STRINGL(to, to_len, 0); -} -/* }}} */ -#endif - -/* {{{ proto string pg_result_error(resource result) - Get error message associated with result */ -PHP_FUNCTION(pg_result_error) -{ - zval *result; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - char *err = NULL; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &result) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - if (!pgsql_result) { - RETURN_FALSE; - } - err = (char *)PQresultErrorMessage(pgsql_result); - RETURN_STRING(err,1); -} -/* }}} */ - -#if HAVE_PQRESULTERRORFIELD -/* {{{ proto string pg_result_error_field(resource result, int fieldcode) - Get error message field associated with result */ -PHP_FUNCTION(pg_result_error_field) -{ - zval *result; - long fieldcode; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - char *field = NULL; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl", - &result, &fieldcode) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - if (!pgsql_result) { - RETURN_FALSE; - } - if (fieldcode & (PG_DIAG_SEVERITY|PG_DIAG_SQLSTATE|PG_DIAG_MESSAGE_PRIMARY|PG_DIAG_MESSAGE_DETAIL - |PG_DIAG_MESSAGE_HINT|PG_DIAG_STATEMENT_POSITION -#if PG_DIAG_INTERNAL_POSITION - |PG_DIAG_INTERNAL_POSITION -#endif -#if PG_DIAG_INTERNAL_QUERY - |PG_DIAG_INTERNAL_QUERY -#endif - |PG_DIAG_CONTEXT|PG_DIAG_SOURCE_FILE|PG_DIAG_SOURCE_LINE - |PG_DIAG_SOURCE_FUNCTION)) { - field = (char *)PQresultErrorField(pgsql_result, fieldcode); - if (field == NULL) { - RETURN_NULL(); - } else { - RETURN_STRING(field, 1); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif - -/* {{{ proto int pg_connection_status(resource connnection) - Get connection status */ -PHP_FUNCTION(pg_connection_status) -{ - zval *pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - RETURN_LONG(PQstatus(pgsql)); -} - -/* }}} */ - -#if HAVE_PGTRANSACTIONSTATUS -/* {{{ proto int pg_transaction_status(resource connnection) - Get transaction status */ -PHP_FUNCTION(pg_transaction_status) -{ - zval *pgsql_link = NULL; - int id = -1; - PGconn *pgsql; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - RETURN_LONG(PQtransactionStatus(pgsql)); -} -#endif - -/* }}} */ - -/* {{{ proto bool pg_connection_reset(resource connection) - Reset connection (reconnect) */ -PHP_FUNCTION(pg_connection_reset) -{ - zval *pgsql_link; - int id = -1; - PGconn *pgsql; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - PQreset(pgsql); - if (PQstatus(pgsql) == CONNECTION_BAD) { - RETURN_FALSE; - } - RETURN_TRUE; -} - -/* }}} */ - -#define PHP_PG_ASYNC_IS_BUSY 1 -#define PHP_PG_ASYNC_REQUEST_CANCEL 2 - -/* {{{ php_pgsql_flush_query - */ -static int php_pgsql_flush_query(PGconn *pgsql TSRMLS_DC) -{ - PGresult *res; - int leftover = 0; - - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode"); - return -1; - } - while ((res = PQgetResult(pgsql))) { - PQclear(res); - leftover++; - } - PQ_SETNONBLOCKING(pgsql, 0); - return leftover; -} -/* }}} */ - -/* {{{ php_pgsql_do_async - */ -static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type) -{ - zval *pgsql_link; - int id = -1; - PGconn *pgsql; - PGresult *pgsql_result; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode"); - RETURN_FALSE; - } - switch(entry_type) { - case PHP_PG_ASYNC_IS_BUSY: - PQconsumeInput(pgsql); - Z_LVAL_P(return_value) = PQisBusy(pgsql); - Z_TYPE_P(return_value) = IS_LONG; - break; - case PHP_PG_ASYNC_REQUEST_CANCEL: - Z_LVAL_P(return_value) = PQrequestCancel(pgsql); - Z_TYPE_P(return_value) = IS_LONG; - while ((pgsql_result = PQgetResult(pgsql))) { - PQclear(pgsql_result); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "PostgreSQL module error, please report this error"); - break; - } - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - } - convert_to_boolean_ex(&return_value); -} -/* }}} */ - -/* {{{ proto bool pg_cancel_query(resource connection) - Cancel request */ -PHP_FUNCTION(pg_cancel_query) -{ - php_pgsql_do_async(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_ASYNC_REQUEST_CANCEL); -} -/* }}} */ - -/* {{{ proto bool pg_connection_busy(resource connection) - Get connection is busy or not */ -PHP_FUNCTION(pg_connection_busy) -{ - php_pgsql_do_async(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_ASYNC_IS_BUSY); -} -/* }}} */ - -/* {{{ proto bool pg_send_query(resource connection, string query) - Send asynchronous query */ -PHP_FUNCTION(pg_send_query) -{ - zval *pgsql_link; - char *query; - int len; - int id = -1; - PGconn *pgsql; - PGresult *res; - int leftover = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", - &pgsql_link, &query, &len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode"); - RETURN_FALSE; - } - while ((res = PQgetResult(pgsql))) { - PQclear(res); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE"); - } - if (!PQsendQuery(pgsql, query)) { - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQreset(pgsql); - } - if (!PQsendQuery(pgsql, query)) { - RETURN_FALSE; - } - } - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - } - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_PQSENDQUERYPARAMS -/* {{{ proto bool pg_send_query_params(resource connection, string query) - Send asynchronous parameterized query */ -PHP_FUNCTION(pg_send_query_params) -{ - zval **pgsql_link; - zval **pv_param_arr, **tmp; - int num_params = 0; - char **params = NULL; - unsigned char otype; - zval **query; - int id = -1; - PGconn *pgsql; - PGresult *res; - int leftover = 0; - - if (zend_get_parameters_ex(3, &pgsql_link, &query, &pv_param_arr) == FAILURE) { - return; - } - - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(query); - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode"); - RETURN_FALSE; - } - while ((res = PQgetResult(pgsql))) { - PQclear(res); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE"); - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); - num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - for(i = 0; i < num_params; i++) { - if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - otype = (*tmp)->type; - convert_to_string(*tmp); - if (Z_TYPE_PP(tmp) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - if (otype == IS_NULL) { - params[i] = NULL; - } - else { - params[i] = Z_STRVAL_PP(tmp); - } - - zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr)); - } - } - - if (!PQsendQueryParams(pgsql, Z_STRVAL_PP(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) { - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQreset(pgsql); - } - if (!PQsendQueryParams(pgsql, Z_STRVAL_PP(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) { - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - } - _php_pgsql_free_params(params, num_params); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if HAVE_PQSENDPREPARE -/* {{{ proto bool pg_send_prepare(resource connection, string stmtname, string query) - Asynchronously prepare a query for future execution */ -PHP_FUNCTION(pg_send_prepare) -{ - zval **pgsql_link; - zval **query, **stmtname; - int id = -1; - PGconn *pgsql; - PGresult *res; - int leftover = 0; - - if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &query) == FAILURE) { - return; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(stmtname); - convert_to_string_ex(query); - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode"); - RETURN_FALSE; - } - while ((res = PQgetResult(pgsql))) { - PQclear(res); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE"); - } - if (!PQsendPrepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL)) { - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQreset(pgsql); - } - if (!PQsendPrepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL)) { - RETURN_FALSE; - } - } - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if HAVE_PQSENDQUERYPREPARED -/* {{{ proto bool pg_send_execute(resource connection, string stmtname, array params) - Executes prevriously prepared stmtname asynchronously */ -PHP_FUNCTION(pg_send_execute) -{ - zval **pgsql_link; - zval **pv_param_arr, **tmp; - int num_params = 0; - char **params = NULL; - unsigned char otype; - zval **stmtname; - int id = -1; - PGconn *pgsql; - PGresult *res; - int leftover = 0; - - if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &pv_param_arr)==FAILURE) { - return; - } - if (pgsql_link == NULL && id == -1) { - RETURN_FALSE; - } - - if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - convert_to_string_ex(stmtname); - if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode"); - RETURN_FALSE; - } - while ((res = PQgetResult(pgsql))) { - PQclear(res); - leftover = 1; - } - if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE"); - } - - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); - num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - for(i = 0; i < num_params; i++) { - if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - otype = (*tmp)->type; - convert_to_string(*tmp); - if (Z_TYPE_PP(tmp) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - - if (otype == IS_NULL) { - params[i] = NULL; - } - else { - params[i] = Z_STRVAL_PP(tmp); - } - - zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr)); - } - } - - if (!PQsendQueryPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, (const char * const *)params, NULL, NULL, 0)) { - if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) { - PQreset(pgsql); - } - if (!PQsendQueryPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, (const char * const *)params, NULL, NULL, 0)) { - _php_pgsql_free_params(params, num_params); - RETURN_FALSE; - } - } - _php_pgsql_free_params(params, num_params); - if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto resource pg_get_result(resource connection) - Get asynchronous query result */ -PHP_FUNCTION(pg_get_result) -{ - zval *pgsql_link; - int id = -1; - PGconn *pgsql; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - pgsql_result = PQgetResult(pgsql); - if (!pgsql_result) { - /* no result */ - RETURN_FALSE; - } - pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); - pg_result->conn = pgsql; - pg_result->result = pgsql_result; - pg_result->row = 0; - ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result); -} -/* }}} */ - -/* {{{ proto mixed pg_result_status(resource result[, long result_type]) - Get status of query result */ -PHP_FUNCTION(pg_result_status) -{ - zval *result; - long result_type = PGSQL_STATUS_LONG; - ExecStatusType status; - PGresult *pgsql_result; - pgsql_result_handle *pg_result; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l", - &result, &result_type) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); - - pgsql_result = pg_result->result; - if (result_type == PGSQL_STATUS_LONG) { - status = PQresultStatus(pgsql_result); - RETURN_LONG((int)status); - } - else if (result_type == PGSQL_STATUS_STRING) { - RETURN_STRING(PQcmdStatus(pgsql_result), 1); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Optional 2nd parameter should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING"); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto array pg_get_notify([resource connection[, result_type]]) - Get asynchronous notification */ -PHP_FUNCTION(pg_get_notify) -{ - zval *pgsql_link; - int id = -1; - long result_type = PGSQL_ASSOC; - PGconn *pgsql; - PGnotify *pgsql_notify; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l", - &pgsql_link, &result_type) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (!(result_type & PGSQL_BOTH)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); - RETURN_FALSE; - } - - PQconsumeInput(pgsql); - pgsql_notify = PQnotifies(pgsql); - if (!pgsql_notify) { - /* no notify message */ - RETURN_FALSE; - } - array_init(return_value); - if (result_type & PGSQL_NUM) { - add_index_string(return_value, 0, pgsql_notify->relname, 1); - add_index_long(return_value, 1, pgsql_notify->be_pid); - } - if (result_type & PGSQL_ASSOC) { - add_assoc_string(return_value, "message", pgsql_notify->relname, 1); - add_assoc_long(return_value, "pid", pgsql_notify->be_pid); - } -} -/* }}} */ - -/* {{{ proto int pg_get_pid([resource connection) - Get backend(server) pid */ -PHP_FUNCTION(pg_get_pid) -{ - zval *pgsql_link; - int id = -1; - PGconn *pgsql; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - RETURN_LONG(PQbackendPID(pgsql)); -} -/* }}} */ - -/* {{{ php_pgsql_meta_data - * TODO: Add meta_data cache for better performance - */ -PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC) -{ - PGresult *pg_result; - char *tmp_name; - smart_str querystr = {0}; - int new_len; - int i, num_rows; - zval *elem; - - smart_str_appends(&querystr, - "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotNULL, a.atthasdef, a.attndims " - "FROM pg_class as c, pg_attribute a, pg_type t " - "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); - - tmp_name = php_addslashes((char *)table_name, strlen(table_name), &new_len, 0 TSRMLS_CC); - smart_str_appendl(&querystr, tmp_name, new_len); - efree(tmp_name); - - smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;"); - smart_str_0(&querystr); - - pg_result = PQexec(pg_link, querystr.c); - if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to query meta_data for '%s' table %s", table_name, querystr.c); - smart_str_free(&querystr); - PQclear(pg_result); - return FAILURE; - } - smart_str_free(&querystr); - - for (i = 0; i < num_rows; i++) { - char *name; - MAKE_STD_ZVAL(elem); - array_init(elem); - add_assoc_long(elem, "num", atoi(PQgetvalue(pg_result,i,1))); - add_assoc_string(elem, "type", PQgetvalue(pg_result,i,2), 1); - add_assoc_long(elem, "len", atoi(PQgetvalue(pg_result,i,3))); - if (!strcmp(PQgetvalue(pg_result,i,4), "t")) { - add_assoc_bool(elem, "not null", 1); - } - else { - add_assoc_bool(elem, "not null", 0); - } - if (!strcmp(PQgetvalue(pg_result,i,5), "t")) { - add_assoc_bool(elem, "has default", 1); - } - else { - add_assoc_bool(elem, "has default", 0); - } - add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); - name = PQgetvalue(pg_result,i,0); - add_assoc_zval(meta, name, elem); - } - PQclear(pg_result); - - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto array pg_meta_data(resource db, string table) - Get meta_data */ -PHP_FUNCTION(pg_meta_data) -{ - zval *pgsql_link; - char *table_name; - uint table_name_len; - PGconn *pgsql; - int id = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", - &pgsql_link, &table_name, &table_name_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - array_init(return_value); - if (php_pgsql_meta_data(pgsql, table_name, return_value TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); /* destroy array */ - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_pgsql_get_data_type - */ -static php_pgsql_data_type php_pgsql_get_data_type(const char *type_name, size_t len) -{ - /* This is stupid way to do. I'll fix it when I decied how to support - user defined types. (Yasuo) */ - - /* boolean */ - if (!strcmp(type_name, "bool")|| !strcmp(type_name, "boolean")) - return PG_BOOL; - /* object id */ - if (!strcmp(type_name, "oid")) - return PG_OID; - /* integer */ - if (!strcmp(type_name, "int2") || !strcmp(type_name, "smallint")) - return PG_INT2; - if (!strcmp(type_name, "int4") || !strcmp(type_name, "integer")) - return PG_INT4; - if (!strcmp(type_name, "int8") || !strcmp(type_name, "bigint")) - return PG_INT8; - /* real and other */ - if (!strcmp(type_name, "float4") || !strcmp(type_name, "real")) - return PG_FLOAT4; - if (!strcmp(type_name, "float8") || !strcmp(type_name, "double precision")) - return PG_FLOAT8; - if (!strcmp(type_name, "numeric")) - return PG_NUMERIC; - if (!strcmp(type_name, "money")) - return PG_MONEY; - /* character */ - if (!strcmp(type_name, "text")) - return PG_TEXT; - if (!strcmp(type_name, "bpchar") || !strcmp(type_name, "character")) - return PG_CHAR; - if (!strcmp(type_name, "varchar") || !strcmp(type_name, "character varying")) - return PG_VARCHAR; - /* time and interval */ - if (!strcmp(type_name, "abstime")) - return PG_UNIX_TIME; - if (!strcmp(type_name, "reltime")) - return PG_UNIX_TIME_INTERVAL; - if (!strcmp(type_name, "tinterval")) - return PG_UNIX_TIME_INTERVAL; - if (!strcmp(type_name, "date")) - return PG_DATE; - if (!strcmp(type_name, "time")) - return PG_TIME; - if (!strcmp(type_name, "time with time zone") || !strcmp(type_name, "timetz")) - return PG_TIME_WITH_TIMEZONE; - if (!strcmp(type_name, "timestamp without time zone") || !strcmp(type_name, "timestamp")) - return PG_TIMESTAMP; - if (!strcmp(type_name, "timestamp with time zone") || !strcmp(type_name, "timestamptz")) - return PG_TIMESTAMP_WITH_TIMEZONE; - if (!strcmp(type_name, "interval")) - return PG_INTERVAL; - /* binary */ - if (!strcmp(type_name, "bytea")) - return PG_BYTEA; - /* network */ - if (!strcmp(type_name, "cidr")) - return PG_CIDR; - if (!strcmp(type_name, "inet")) - return PG_INET; - if (!strcmp(type_name, "macaddr")) - return PG_MACADDR; - /* bit */ - if (!strcmp(type_name, "bit")) - return PG_BIT; - if (!strcmp(type_name, "bit varying")) - return PG_VARBIT; - /* geometric */ - if (!strcmp(type_name, "line")) - return PG_LINE; - if (!strcmp(type_name, "lseg")) - return PG_LSEG; - if (!strcmp(type_name, "box")) - return PG_BOX; - if (!strcmp(type_name, "path")) - return PG_PATH; - if (!strcmp(type_name, "point")) - return PG_POINT; - if (!strcmp(type_name, "polygon")) - return PG_POLYGON; - if (!strcmp(type_name, "circle")) - return PG_CIRCLE; - - return PG_UNKNOWN; -} -/* }}} */ - -/* {{{ php_pgsql_convert_match - * test field value with regular expression specified. - */ -static int php_pgsql_convert_match(const char *str, const char *regex , int icase TSRMLS_DC) -{ - regex_t re; - regmatch_t *subs; - int regopt = REG_EXTENDED; - int regerr, ret = SUCCESS; - - if (icase) { - regopt |= REG_ICASE; - } - - regerr = regcomp(&re, regex, regopt); - if (regerr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex"); - regfree(&re); - return FAILURE; - } - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t), re.re_nsub+1); - - regerr = regexec(&re, str, re.re_nsub+1, subs, 0); - if (regerr == REG_NOMATCH) { -#ifdef PHP_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex); -#endif - ret = FAILURE; - } - else if (regerr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot exec regex"); - ret = FAILURE; - } - regfree(&re); - efree(subs); - return ret; -} - -/* }}} */ - -/* {{{ php_pgsql_add_quote - * add quotes around string. - */ -static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) -{ - smart_str str = {0}; - - assert(Z_TYPE_P(src) == IS_STRING); - assert(should_free == 1 || should_free == 0); - - smart_str_appendc(&str, '\''); - smart_str_appendl(&str, Z_STRVAL_P(src), Z_STRLEN_P(src)); - smart_str_appendc(&str, '\''); - smart_str_0(&str); - - if (should_free) { - efree(Z_STRVAL_P(src)); - } - Z_STRVAL_P(src) = str.c; - Z_STRLEN_P(src) = str.len; - - return SUCCESS; -} -/* }}} */ - -#define PGSQL_CONV_CHECK_IGNORE() \ - if (!err && Z_TYPE_P(new_val) == IS_STRING && !strcmp(Z_STRVAL_P(new_val), "NULL")) { \ - /* if new_value is string "NULL" and field has default value, remove element to use default value */ \ - if (!(opt & PGSQL_CONV_IGNORE_DEFAULT) && Z_BVAL_PP(has_default)) { \ - zval_dtor(new_val); \ - FREE_ZVAL(new_val); \ - skip_field = 1; \ - } \ - /* raise error if it's not null and cannot be ignored */ \ - else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_BVAL_PP(not_null)) { \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field ); \ - err = 1; \ - } \ - } - -/* {{{ php_pgsql_convert - * check and convert array values (fieldname=>vlaue pair) for sql - */ -PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC) -{ - HashPosition pos; - char *field = NULL; - uint field_len = -1; - ulong num_idx = -1; - zval *meta, **def, **type, **not_null, **has_default, **val, *new_val; - int new_len, key_type, err = 0, skip_field; - - assert(pg_link != NULL); - assert(Z_TYPE_P(values) == IS_ARRAY); - assert(Z_TYPE_P(result) == IS_ARRAY); - assert(!(opt & ~PGSQL_CONV_OPTS)); - - if (!table_name) { - return FAILURE; - } - MAKE_STD_ZVAL(meta); - array_init(meta); - if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) { - zval_dtor(meta); - FREE_ZVAL(meta); - return FAILURE; - } - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&val, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos)) { - skip_field = 0; - - if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTANT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get array key type"); - err = 1; - } - if (!err && key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); - err = 1; - } - if (!err && key_type == HASH_KEY_NON_EXISTANT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); - err = 1; - } - if (!err && zend_hash_find(Z_ARRVAL_P(meta), field, field_len, (void **)&def) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid field name (%s) in values", field); - err = 1; - } - if (!err && zend_hash_find(Z_ARRVAL_PP(def), "type", sizeof("type"), (void **)&type) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'type'"); - err = 1; - } - if (!err && zend_hash_find(Z_ARRVAL_PP(def), "not null", sizeof("not null"), (void **)¬_null) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'not null'"); - err = 1; - } - if (!err && zend_hash_find(Z_ARRVAL_PP(def), "has default", sizeof("has default"), (void **)&has_default) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'"); - err = 1; - } - if (!err && (Z_TYPE_PP(val) == IS_ARRAY || - Z_TYPE_PP(val) == IS_OBJECT || - Z_TYPE_PP(val) == IS_CONSTANT_ARRAY)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values as field values"); - err = 1; - } - if (err) { - break; /* break out for() */ - } - MAKE_STD_ZVAL(new_val); - switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type))) - { - case PG_BOOL: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - if (!strcmp(Z_STRVAL_PP(val), "t") || !strcmp(Z_STRVAL_PP(val), "T") || - !strcmp(Z_STRVAL_PP(val), "y") || !strcmp(Z_STRVAL_PP(val), "Y") || - !strcmp(Z_STRVAL_PP(val), "true") || !strcmp(Z_STRVAL_PP(val), "True") || - !strcmp(Z_STRVAL_PP(val), "yes") || !strcmp(Z_STRVAL_PP(val), "Yes") || - !strcmp(Z_STRVAL_PP(val), "1")) { - ZVAL_STRING(new_val, "'t'", 1); - } - else if (!strcmp(Z_STRVAL_PP(val), "f") || !strcmp(Z_STRVAL_PP(val), "F") || - !strcmp(Z_STRVAL_PP(val), "n") || !strcmp(Z_STRVAL_PP(val), "N") || - !strcmp(Z_STRVAL_PP(val), "false") || !strcmp(Z_STRVAL_PP(val), "False") || - !strcmp(Z_STRVAL_PP(val), "no") || !strcmp(Z_STRVAL_PP(val), "No") || - !strcmp(Z_STRVAL_PP(val), "0")) { - ZVAL_STRING(new_val, "'f'", 1); - } - else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_PP(val), Z_STRVAL_PP(type), field); - err = 1; - } - } - break; - - case IS_LONG: - case IS_BOOL: - if (Z_LVAL_PP(val)) { - ZVAL_STRING(new_val, "'t'", 1); - } - else { - ZVAL_STRING(new_val, "'f'", 1); - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_OID: - case PG_INT2: - case PG_INT4: - case PG_INT8: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([+-]{0,1}[0-9]+)$", 0 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - } - } - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); - convert_to_long_ex(&new_val); - break; - - case IS_LONG: - ZVAL_LONG(new_val, Z_LVAL_PP(val)); - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for pgsql '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_NUMERIC: - case PG_MONEY: - case PG_FLOAT4: - case PG_FLOAT8: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([+-]{0,1}[0-9]+)|([+-]{0,1}[0-9]*[\\.][0-9]+)|([+-]{0,1}[0-9]+[\\.][0-9]*)$", 0 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - } - } - break; - - case IS_LONG: - ZVAL_LONG(new_val, Z_LVAL_PP(val)); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_TEXT: - case PG_CHAR: - case PG_VARCHAR: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - if (opt & PGSQL_CONV_FORCE_NULL) { - ZVAL_STRING(new_val, "NULL", 1); - } else { - ZVAL_STRING(new_val, "''", 1); - } - } - else { - Z_TYPE_P(new_val) = IS_STRING; -#if HAVE_PQESCAPE - { - char *tmp; - tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); - Z_STRLEN_P(new_val) = (int)PQescapeString(tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - Z_STRVAL_P(new_val) = tmp; - } -#else - Z_STRVAL_P(new_val) = php_addslashes(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); -#endif - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - break; - - case IS_LONG: - ZVAL_LONG(new_val, Z_LVAL_PP(val)); - convert_to_string_ex(&new_val); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); - convert_to_string_ex(&new_val); - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_UNIX_TIME: - case PG_UNIX_TIME_INTERVAL: - /* these are the actallay a integer */ - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: Better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^[0-9]+$", 0 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - convert_to_long_ex(&new_val); - } - } - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); - convert_to_long_ex(&new_val); - break; - - case IS_LONG: - ZVAL_LONG(new_val, Z_LVAL_PP(val)); - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_CIDR: - case PG_INET: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: Better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/[0-9]{1,2}){0,1}$", 0 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_TIME_WITH_TIMEZONE: - case PG_TIMESTAMP: - case PG_TIMESTAMP_WITH_TIMEZONE: - switch(Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_DATE: - switch(Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_TIME: - switch(Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); - } - break; - - case PG_INTERVAL: - switch(Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - - /* From the Postgres docs: - - interval values can be written with the following syntax: - [@] quantity unit [quantity unit...] [direction] - - Where: quantity is a number (possibly signed); unit is second, minute, hour, - day, week, month, year, decade, century, millennium, or abbreviations or - plurals of these units [note not *all* abbreviations] ; direction can be - ago or empty. The at sign (@) is optional noise. - - ... - - Quantities of days, hours, minutes, and seconds can be specified without explicit - unit markings. For example, '1 12:59:10' is read the same as '1 day 12 hours 59 min 10 - sec'. - */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), - "^(@?[ \\t]+)?(" - - /* Textual time units and their abbreviations: */ - "(([-+]?[ \\t]+)?" - "[0-9]+(\\.[0-9]*)?[ \\t]*" - "(millenniums|millennia|millennium|mil|mils|" - "centuries|century|cent|c|" - "decades|decade|dec|decs|" - "years|year|y|" - "months|month|mon|" - "weeks|week|w|" - "days|day|d|" - "hours|hour|hr|hrs|h|" - "minutes|minute|mins|min|m|" - "seconds|second|secs|sec|s))+|" - - /* Textual time units plus (dd)* hh[:mm[:ss]] */ - "((([-+]?[ \\t]+)?" - "[0-9]+(\\.[0-9]*)?[ \\t]*" - "(millenniums|millennia|millennium|mil|mils|" - "centuries|century|cent|c|" - "decades|decade|dec|decs|" - "years|year|y|" - "months|month|mon|" - "weeks|week|w|" - "days|day|d))+" - "([-+]?[ \\t]+" - "([0-9]+[ \\t]+)+" /* dd */ - "(([0-9]{1,2}:){0,2}[0-9]{0,2})" /* hh:[mm:[ss]] */ - ")?))" - "([ \\t]+ago)?$", - 1 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); - } - break; -#ifdef HAVE_PQESCAPE - case PG_BYTEA: - switch (Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - unsigned char *tmp; - size_t to_len; - tmp = PQescapeBytea(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); - Z_TYPE_P(new_val) = IS_STRING; - Z_STRLEN_P(new_val) = to_len-1; /* PQescapeBytea's to_len includes additional '\0' */ - Z_STRVAL_P(new_val) = emalloc(to_len); - memcpy(Z_STRVAL_P(new_val), tmp, to_len); - free(tmp); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - - } - break; - - case IS_LONG: - ZVAL_LONG(new_val, Z_LVAL_PP(val)); - convert_to_string_ex(&new_val); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); - convert_to_string_ex(&new_val); - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); - } - break; - -#endif - case PG_MACADDR: - switch(Z_TYPE_PP(val)) { - case IS_STRING: - if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, "NULL", 1); - } - else { - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1 TSRMLS_CC) == FAILURE) { - err = 1; - } - else { - ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); - php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - } - } - break; - - case IS_NULL: - ZVAL_STRING(new_val, "NULL", 1); - break; - - default: - err = 1; - } - PGSQL_CONV_CHECK_IGNORE(); - if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); - } - break; - - /* bit */ - case PG_BIT: - case PG_VARBIT: - /* geometric */ - case PG_LINE: - case PG_LSEG: - case PG_POINT: - case PG_BOX: - case PG_PATH: - case PG_POLYGON: - case PG_CIRCLE: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "PostgreSQL '%s' type (%s) is not supported", Z_STRVAL_PP(type), field); - err = 1; - break; - - case PG_UNKNOWN: - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or system data type '%s' for '%s'", Z_STRVAL_PP(type), field); - err = 1; - break; - } /* switch */ - - if (err) { - zval_dtor(new_val); - FREE_ZVAL(new_val); - break; /* break out for() */ - } - if (!skip_field) { - /* If field is NULL and HAS DEFAULT, should be skipped */ - field = php_addslashes(field, strlen(field), &new_len, 0 TSRMLS_CC); - add_assoc_zval(result, field, new_val); - efree(field); - } - } /* for */ - zval_dtor(meta); - FREE_ZVAL(meta); - - if (err) { - /* shouldn't destroy & free zval here */ - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - - -/* {{{ proto array pg_convert(resource db, string table, array values[, int options]) - Check and convert values for PostgreSQL SQL statement */ -PHP_FUNCTION(pg_convert) -{ - zval *pgsql_link, *values; - char *table_name; - int table_name_len; - ulong option = 0; - PGconn *pg_link; - int id = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) { - return; - } - if (option & ~PGSQL_CONV_OPTS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); - RETURN_FALSE; - } - if (!table_name_len) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Table name is invalid"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); - } - array_init(return_value); - if (php_pgsql_convert(pg_link, table_name, values, return_value, option TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - RETURN_FALSE; - } -} -/* }}} */ - -static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt TSRMLS_DC) -{ - if (opt & PGSQL_DML_ASYNC) { - if (PQsendQuery(pg_link, querystr->c)) { - return 0; - } - } - else { - PGresult *pg_result; - - pg_result = PQexec(pg_link, querystr->c); - if (PQresultStatus(pg_result) == expect) { - PQclear(pg_result); - return 0; - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr->c); - PQclear(pg_result); - } - } - - return -1; -} - -/* {{{ php_pgsql_insert - */ -PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, ulong opt, char **sql TSRMLS_DC) -{ - zval **val, *converted = NULL; - char buf[256]; - char *fld; - smart_str querystr = {0}; - int key_type, ret = FAILURE; - uint fld_len; - ulong num_idx; - HashPosition pos; - - assert(pg_link != NULL); - assert(table != NULL); - assert(Z_TYPE_P(var_array) == IS_ARRAY); - - if (zend_hash_num_elements(Z_ARRVAL_P(var_array)) == 0) { - return FAILURE; - } - - /* convert input array if needed */ - if (!(opt & PGSQL_DML_NO_CONV)) { - MAKE_STD_ZVAL(converted); - array_init(converted); - if (php_pgsql_convert(pg_link, table, var_array, converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) { - goto cleanup; - } - var_array = converted; - } - - smart_str_appends(&querystr, "INSERT INTO "); - smart_str_appends(&querystr, table); - smart_str_appends(&querystr, " ("); - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(var_array), &pos); - while ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(var_array), &fld, - &fld_len, &num_idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) { - if (key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted"); - goto cleanup; - } - smart_str_appendl(&querystr, fld, fld_len - 1); - smart_str_appendc(&querystr, ','); - zend_hash_move_forward_ex(Z_ARRVAL_P(var_array), &pos); - } - querystr.len--; - smart_str_appends(&querystr, ") VALUES ("); - - /* make values string */ - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(var_array), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(var_array), (void **)&val, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(var_array), &pos)) { - - /* we can avoid the key_type check here, because we tested it in the other loop */ - switch(Z_TYPE_PP(val)) { - case IS_STRING: - smart_str_appendl(&querystr, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - break; - case IS_LONG: - smart_str_append_long(&querystr, Z_LVAL_PP(val)); - break; - case IS_DOUBLE: - smart_str_appendl(&querystr, buf, snprintf(buf, sizeof(buf), "%f", Z_DVAL_PP(val))); - break; - default: - /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Report this error to php-dev@lists.php.net, type = %d", Z_TYPE_PP(val)); - goto cleanup; - break; - } - smart_str_appendc(&querystr, ','); - } - /* Remove the trailing "," */ - querystr.len--; - smart_str_appends(&querystr, ");"); - smart_str_0(&querystr); - - if ((opt & (PGSQL_DML_EXEC|PGSQL_DML_ASYNC)) && - do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == 0) { - ret = SUCCESS; - } - else if (opt & PGSQL_DML_STRING) { - ret = SUCCESS; - } - -cleanup: - if (!(opt & PGSQL_DML_NO_CONV)) { - zval_dtor(converted); - FREE_ZVAL(converted); - } - if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { - *sql = querystr.c; - } - else { - smart_str_free(&querystr); - } - return ret; -} -/* }}} */ - -/* {{{ proto mixed pg_insert(resource db, string table, array values[, int options]) - Insert values (filed=>value) to table */ -PHP_FUNCTION(pg_insert) -{ - zval *pgsql_link, *values; - char *table, *sql = NULL; - int table_len; - ulong option = PGSQL_DML_EXEC; - PGconn *pg_link; - int id = -1, argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l", - &pgsql_link, &table, &table_len, &values, &option) == FAILURE) { - return; - } - if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); - } - if (php_pgsql_insert(pg_link, table, values, option, &sql TSRMLS_CC) == FAILURE) { - RETURN_FALSE; - } - if (option & PGSQL_DML_STRING) { - RETURN_STRING(sql, 0); - } - RETURN_TRUE; -} -/* }}} */ - -static inline int build_assignment_string(smart_str *querystr, HashTable *ht, const char *pad, int pad_len TSRMLS_DC) -{ - HashPosition pos; - uint fld_len; - int key_type; - ulong num_idx; - char *fld; - char buf[256]; - zval **val; - - for (zend_hash_internal_pointer_reset_ex(ht, &pos); - zend_hash_get_current_data_ex(ht, (void **)&val, &pos) == SUCCESS; - zend_hash_move_forward_ex(ht, &pos)) { - key_type = zend_hash_get_current_key_ex(ht, &fld, &fld_len, &num_idx, 0, &pos); - if (key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted"); - return -1; - } - smart_str_appendl(querystr, fld, fld_len - 1); - smart_str_appendc(querystr, '='); - - switch(Z_TYPE_PP(val)) { - case IS_STRING: - smart_str_appendl(querystr, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - break; - case IS_LONG: - smart_str_append_long(querystr, Z_LVAL_PP(val)); - break; - case IS_DOUBLE: - smart_str_appendl(querystr, buf, sprintf(buf, "%f", Z_DVAL_PP(val))); - break; - default: - /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values other than NULL. Need to convert?"); - return -1; - } - smart_str_appendl(querystr, pad, pad_len); - } - querystr->len -= pad_len; - - return 0; -} - -/* {{{ php_pgsql_update - */ -PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, ulong opt, char **sql TSRMLS_DC) -{ - zval *var_converted = NULL, *ids_converted = NULL; - smart_str querystr = {0}; - int ret = FAILURE; - - assert(pg_link != NULL); - assert(table != NULL); - assert(Z_TYPE_P(var_array) == IS_ARRAY); - assert(Z_TYPE_P(ids_array) == IS_ARRAY); - assert(!(opt & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING))); - - if (zend_hash_num_elements(Z_ARRVAL_P(var_array)) == 0 - || zend_hash_num_elements(Z_ARRVAL_P(ids_array)) == 0) { - return FAILURE; - } - - if (!(opt & PGSQL_DML_NO_CONV)) { - MAKE_STD_ZVAL(var_converted); - array_init(var_converted); - if (php_pgsql_convert(pg_link, table, var_array, var_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) { - goto cleanup; - } - var_array = var_converted; - MAKE_STD_ZVAL(ids_converted); - array_init(ids_converted); - if (php_pgsql_convert(pg_link, table, ids_array, ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) { - goto cleanup; - } - ids_array = ids_converted; - } - - smart_str_appends(&querystr, "UPDATE "); - smart_str_appends(&querystr, table); - smart_str_appends(&querystr, " SET "); - - if (build_assignment_string(&querystr, Z_ARRVAL_P(var_array), ",", 1 TSRMLS_CC)) - goto cleanup; - - smart_str_appends(&querystr, " WHERE "); - - if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), " AND ", sizeof(" AND ")-1 TSRMLS_CC)) - goto cleanup; - - smart_str_appendc(&querystr, ';'); - smart_str_0(&querystr); - - if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) { - ret = SUCCESS; - } else if (opt & PGSQL_DML_STRING) { - ret = SUCCESS; - } - -cleanup: - if (var_converted) { - zval_dtor(var_converted); - FREE_ZVAL(var_converted); - } - if (ids_converted) { - zval_dtor(ids_converted); - FREE_ZVAL(ids_converted); - } - if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { - *sql = querystr.c; - } - else { - smart_str_free(&querystr); - } - return ret; -} -/* }}} */ - -/* {{{ proto mixed pg_update(resource db, string table, array fields, array ids[, int options]) - Update table using values (field=>value) and ids (id=>value) */ -PHP_FUNCTION(pg_update) -{ - zval *pgsql_link, *values, *ids; - char *table, *sql = NULL; - int table_len; - ulong option = PGSQL_DML_EXEC; - PGconn *pg_link; - int id = -1, argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rsaa|l", - &pgsql_link, &table, &table_len, &values, &ids, &option) == FAILURE) { - return; - } - if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); - } - if (php_pgsql_update(pg_link, table, values, ids, option, &sql TSRMLS_CC) == FAILURE) { - RETURN_FALSE; - } - if (option & PGSQL_DML_STRING) { - RETURN_STRING(sql, 0); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_pgsql_delete - */ -PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, ulong opt, char **sql TSRMLS_DC) -{ - zval *ids_converted = NULL; - smart_str querystr = {0}; - int ret = FAILURE; - - assert(pg_link != NULL); - assert(table != NULL); - assert(Z_TYPE_P(ids_array) == IS_ARRAY); - assert(!(opt & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_EXEC|PGSQL_DML_STRING))); - - if (zend_hash_num_elements(Z_ARRVAL_P(ids_array)) == 0) { - return FAILURE; - } - - if (!(opt & PGSQL_DML_NO_CONV)) { - MAKE_STD_ZVAL(ids_converted); - array_init(ids_converted); - if (php_pgsql_convert(pg_link, table, ids_array, ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) { - goto cleanup; - } - ids_array = ids_converted; - } - - smart_str_appends(&querystr, "DELETE FROM "); - smart_str_appends(&querystr, table); - smart_str_appends(&querystr, " WHERE "); - - if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), " AND ", sizeof(" AND ")-1 TSRMLS_CC)) - goto cleanup; - - smart_str_appendc(&querystr, ';'); - smart_str_0(&querystr); - - if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) { - ret = SUCCESS; - } else if (opt & PGSQL_DML_STRING) { - ret = SUCCESS; - } - -cleanup: - if (!(opt & PGSQL_DML_NO_CONV)) { - zval_dtor(ids_converted); - FREE_ZVAL(ids_converted); - } - if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { - *sql = estrdup(querystr.c); - } - else { - smart_str_free(&querystr); - } - return ret; -} -/* }}} */ - -/* {{{ proto mixed pg_delete(resource db, string table, array ids[, int options]) - Delete records has ids (id=>value) */ -PHP_FUNCTION(pg_delete) -{ - zval *pgsql_link, *ids; - char *table, *sql = NULL; - int table_len; - ulong option = PGSQL_DML_EXEC; - PGconn *pg_link; - int id = -1, argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l", - &pgsql_link, &table, &table_len, &ids, &option) == FAILURE) { - return; - } - if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); - } - if (php_pgsql_delete(pg_link, table, ids, option, &sql TSRMLS_CC) == FAILURE) { - RETURN_FALSE; - } - if (option & PGSQL_DML_STRING) { - RETURN_STRING(sql, 0); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_pgsql_result2array - */ -PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC) -{ - zval *row; - char *field_name, *element, *data; - size_t num_fields, element_len, data_len; - int pg_numrows, pg_row; - uint i; - assert(Z_TYPE_P(ret_array) == IS_ARRAY); - - if ((pg_numrows = PQntuples(pg_result)) <= 0) { - return FAILURE; - } - for (pg_row = 0; pg_row < pg_numrows; pg_row++) { - MAKE_STD_ZVAL(row); - array_init(row); - add_index_zval(ret_array, pg_row, row); - for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { - if (PQgetisnull(pg_result, pg_row, i)) { - field_name = PQfname(pg_result, i); - add_assoc_null(row, field_name); - } else { - element = PQgetvalue(pg_result, pg_row, i); - element_len = (element ? strlen(element) : 0); - if (element) { - if (PG(magic_quotes_runtime)) { - data = php_addslashes(element, element_len, &data_len, 0 TSRMLS_CC); - } else { - data = safe_estrndup(element, element_len); - data_len = element_len; - } - field_name = PQfname(pg_result, i); - add_assoc_stringl(row, field_name, data, data_len, 0); - } - } - } - } - return SUCCESS; -} -/* }}} */ - -/* {{{ php_pgsql_select - */ -PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, ulong opt, char **sql TSRMLS_DC) -{ - zval *ids_converted = NULL; - smart_str querystr = {0}; - int ret = FAILURE; - PGresult *pg_result; - - assert(pg_link != NULL); - assert(table != NULL); - assert(Z_TYPE_P(ids_array) == IS_ARRAY); - assert(Z_TYPE_P(ret_array) == IS_ARRAY); - assert(!(opt & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING))); - - if (zend_hash_num_elements(Z_ARRVAL_P(ids_array)) == 0) { - return FAILURE; - } - - if (!(opt & PGSQL_DML_NO_CONV)) { - MAKE_STD_ZVAL(ids_converted); - array_init(ids_converted); - if (php_pgsql_convert(pg_link, table, ids_array, ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) { - goto cleanup; - } - ids_array = ids_converted; - } - - smart_str_appends(&querystr, "SELECT * FROM "); - smart_str_appends(&querystr, table); - smart_str_appends(&querystr, " WHERE "); - - if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), " AND ", sizeof(" AND ")-1 TSRMLS_CC)) - goto cleanup; - - smart_str_appendc(&querystr, ';'); - smart_str_0(&querystr); - - pg_result = PQexec(pg_link, querystr.c); - if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { - ret = php_pgsql_result2array(pg_result, ret_array TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr.c); - } - PQclear(pg_result); - -cleanup: - if (!(opt & PGSQL_DML_NO_CONV)) { - zval_dtor(ids_converted); - FREE_ZVAL(ids_converted); - } - if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { - *sql = querystr.c; - } - else { - smart_str_free(&querystr); - } - return ret; -} -/* }}} */ - -/* {{{ proto mixed pg_select(resource db, string table, array ids[, int options]) - Select records that has ids (id=>value) */ -PHP_FUNCTION(pg_select) -{ - zval *pgsql_link, *ids; - char *table, *sql = NULL; - int table_len; - ulong option = PGSQL_DML_EXEC; - PGconn *pg_link; - int id = -1, argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l", - &pgsql_link, &table, &table_len, &ids, &option) == FAILURE) { - return; - } - if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - - if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); - } - array_init(return_value); - if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - RETURN_FALSE; - } - if (option & PGSQL_DML_STRING) { - zval_dtor(return_value); - RETURN_STRING(sql, 0); - } - return; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/pgsql/pgsql.dsp b/ext/pgsql/pgsql.dsp deleted file mode 100644 index 098469f36d4a5..0000000000000 --- a/ext/pgsql/pgsql.dsp +++ /dev/null @@ -1,167 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pgsql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=pgsql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pgsql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pgsql.mak" CFG="pgsql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pgsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pgsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pgsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pgsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pgsql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php5ts.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../../Release/pgsql.dll" /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "pgsql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"../../Debug/pgsql.dll" /pdbtype:sept - -!ELSEIF "$(CFG)" == "pgsql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\PostgreSQL\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "ZTS" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "ZTS" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php5ts.lib /nologo /dll /machine:I386 /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpq.lib php5ts.lib /nologo /dll /machine:I386 /out:"../../Release_TS/php_pgsql.dll" /libpath:"..\..\..\php_build\postgresql\src\interfaces\libpq\Release" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "pgsql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "ZTS" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libpq.lib /nologo /dll /debug /machine:I386 /out:"../../Debug_TS/pgsql.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "pgsql - Win32 Release" -# Name "pgsql - Win32 Debug" -# Name "pgsql - Win32 Release_TS" -# Name "pgsql - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\pgsql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_pgsql.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/pgsql/pgsql.mak b/ext/pgsql/pgsql.mak deleted file mode 100644 index 908056acfb155..0000000000000 --- a/ext/pgsql/pgsql.mak +++ /dev/null @@ -1,170 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = phppgsql -MODULE_DESC = "PHP 4.3 - PostgreSQL Extension" -VMAJ = 3 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# Build type defaults to 'release' -ifndef BUILD -BUILD = release -endif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = pgsql.c \ - start.c - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS += -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -DNEW_LIBC -DUSE_OLD_FUNCTIONS -C_FLAGS += -D__BIT_TYPES_DEFINED__ -DCOMPILE_DL_PGSQL=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include - - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics - C_FLAGS += -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - - -# Dependencies -MODULE = LibC \ - phplib \ - libpq -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp \ - @$(PROJECT_ROOT)/netware/libpq.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.d: %.c - @echo Building Dependencies for $(<F) - @$(CC) -M $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.cpp - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - -$(OBJ_DIR)/%.obj: %.c - @echo Compiling $?... - @$(CC) $< $(C_FLAGS) -o $@ - - -$(BINARY): $(OBJECTS) - @echo Import $(IMPORT) > $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h deleted file mode 100644 index 03a3fe8521cf5..0000000000000 --- a/ext/pgsql/php_pgsql.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski <zeev@zend.com> | - | Jouni Ahto <jouni.ahto@exdec.fi> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_PGSQL_H -#define PHP_PGSQL_H - -#if HAVE_PGSQL - -extern zend_module_entry pgsql_module_entry; -#define pgsql_module_ptr &pgsql_module_entry - -#ifdef PHP_PGSQL_PRIVATE -#undef SOCKET_SIZE_TYPE -#include <libpq-fe.h> - -#ifdef PHP_WIN32 -#define INV_WRITE 0x00020000 -#define INV_READ 0x00040000 -#undef PHP_PGSQL_API -#ifdef PGSQL_EXPORTS -#define PHP_PGSQL_API __declspec(dllexport) -#else -#define PHP_PGSQL_API __declspec(dllimport) -#endif -#else -#include <libpq/libpq-fs.h> -#define PHP_PGSQL_API /* nothing special */ -#endif - -#ifdef HAVE_PG_CONFIG_H -#include <pg_config.h> -#endif - -#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT -const char * pg_encoding_to_char(int encoding); -#endif - -PHP_MINIT_FUNCTION(pgsql); -PHP_MSHUTDOWN_FUNCTION(pgsql); -PHP_RINIT_FUNCTION(pgsql); -PHP_RSHUTDOWN_FUNCTION(pgsql); -PHP_MINFO_FUNCTION(pgsql); -/* connection functions */ -PHP_FUNCTION(pg_connect); -PHP_FUNCTION(pg_pconnect); -PHP_FUNCTION(pg_close); -PHP_FUNCTION(pg_connection_reset); -PHP_FUNCTION(pg_connection_status); -PHP_FUNCTION(pg_connection_busy); -PHP_FUNCTION(pg_host); -PHP_FUNCTION(pg_dbname); -PHP_FUNCTION(pg_port); -PHP_FUNCTION(pg_tty); -PHP_FUNCTION(pg_options); -PHP_FUNCTION(pg_version); -PHP_FUNCTION(pg_ping); -#if HAVE_PQPARAMETERSTATUS -PHP_FUNCTION(pg_parameter_status); -#endif -#if HAVE_PGTRANSACTIONSTATUS -PHP_FUNCTION(pg_transaction_status); -#endif -/* query functions */ -PHP_FUNCTION(pg_query); -#if HAVE_PQEXECPARAMS -PHP_FUNCTION(pg_query_params); -#endif -#if HAVE_PQPREPARE -PHP_FUNCTION(pg_prepare); -#endif -#if HAVE_PQEXECPREPARED -PHP_FUNCTION(pg_execute); -#endif -PHP_FUNCTION(pg_send_query); -#if HAVE_PQSENDQUERYPARAMS -PHP_FUNCTION(pg_send_query_params); -#endif -#if HAVE_PQSENDPREPARE -PHP_FUNCTION(pg_send_prepare); -#endif -#if HAVE_PQSENDQUERYPREPARED -PHP_FUNCTION(pg_send_execute); -#endif -PHP_FUNCTION(pg_cancel_query); -/* result functions */ -PHP_FUNCTION(pg_fetch_assoc); -PHP_FUNCTION(pg_fetch_array); -PHP_FUNCTION(pg_fetch_object); -PHP_FUNCTION(pg_fetch_result); -PHP_FUNCTION(pg_fetch_row); -PHP_FUNCTION(pg_fetch_all); -PHP_FUNCTION(pg_fetch_all_columns); -#if HAVE_PQCMDTUPLES -PHP_FUNCTION(pg_affected_rows); -#endif -PHP_FUNCTION(pg_get_result); -PHP_FUNCTION(pg_result_seek); -PHP_FUNCTION(pg_result_status); -PHP_FUNCTION(pg_free_result); -PHP_FUNCTION(pg_last_oid); -PHP_FUNCTION(pg_num_rows); -PHP_FUNCTION(pg_num_fields); -PHP_FUNCTION(pg_field_name); -PHP_FUNCTION(pg_field_num); -PHP_FUNCTION(pg_field_size); -PHP_FUNCTION(pg_field_type); -PHP_FUNCTION(pg_field_type_oid); -PHP_FUNCTION(pg_field_prtlen); -PHP_FUNCTION(pg_field_is_null); -/* async message functions */ -PHP_FUNCTION(pg_get_notify); -PHP_FUNCTION(pg_get_pid); -/* error message functions */ -PHP_FUNCTION(pg_result_error); -#if HAVE_PQRESULTERRORFIELD -PHP_FUNCTION(pg_result_error_field); -#endif -PHP_FUNCTION(pg_last_error); -PHP_FUNCTION(pg_last_notice); -/* copy functions */ -PHP_FUNCTION(pg_put_line); -PHP_FUNCTION(pg_end_copy); -PHP_FUNCTION(pg_copy_to); -PHP_FUNCTION(pg_copy_from); -/* large object functions */ -PHP_FUNCTION(pg_lo_create); -PHP_FUNCTION(pg_lo_unlink); -PHP_FUNCTION(pg_lo_open); -PHP_FUNCTION(pg_lo_close); -PHP_FUNCTION(pg_lo_read); -PHP_FUNCTION(pg_lo_write); -PHP_FUNCTION(pg_lo_read_all); -PHP_FUNCTION(pg_lo_import); -PHP_FUNCTION(pg_lo_export); -PHP_FUNCTION(pg_lo_seek); -PHP_FUNCTION(pg_lo_tell); - -/* debugging functions */ -PHP_FUNCTION(pg_trace); -PHP_FUNCTION(pg_untrace); - -/* utility functions */ -PHP_FUNCTION(pg_client_encoding); -PHP_FUNCTION(pg_set_client_encoding); -#if HAVE_PQSETERRORVERBOSITY -PHP_FUNCTION(pg_set_error_verbosity); -#endif -#if HAVE_PQESCAPE -PHP_FUNCTION(pg_escape_string); -PHP_FUNCTION(pg_escape_bytea); -PHP_FUNCTION(pg_unescape_bytea); -#endif - -/* misc functions */ -PHP_FUNCTION(pg_meta_data); -PHP_FUNCTION(pg_convert); -PHP_FUNCTION(pg_insert); -PHP_FUNCTION(pg_update); -PHP_FUNCTION(pg_delete); -PHP_FUNCTION(pg_select); - -/* connection options - ToDo: Add async connection option */ -#define PGSQL_CONNECT_FORCE_NEW (1<<1) -/* php_pgsql_convert options */ -#define PGSQL_CONV_IGNORE_DEFAULT (1<<1) /* Do not use DEAFULT value by removing field from returned array */ -#define PGSQL_CONV_FORCE_NULL (1<<2) /* Convert to NULL if string is null string */ -#define PGSQL_CONV_IGNORE_NOT_NULL (1<<3) /* Ignore NOT NULL constraints */ -#define PGSQL_CONV_OPTS (PGSQL_CONV_IGNORE_DEFAULT|PGSQL_CONV_FORCE_NULL|PGSQL_CONV_IGNORE_NOT_NULL) -/* php_pgsql_insert/update/select/delete options */ -#define PGSQL_DML_NO_CONV (1<<8) /* Do not call php_pgsql_convert() */ -#define PGSQL_DML_EXEC (1<<9) /* Execute query */ -#define PGSQL_DML_ASYNC (1<<10) /* Do async query */ -#define PGSQL_DML_STRING (1<<11) /* Return query string */ - -/* exported functions */ -PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, ulong opt, char **sql TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, ulong opt , char **sql TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, ulong opt, char **sql TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, ulong opt, char **sql TSRMLS_DC); -PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC); - -/* internal functions */ -static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent); -static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type); -static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type); -static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC); -static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type); -static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type); -static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type); - -typedef enum _php_pgsql_data_type { - /* boolean */ - PG_BOOL, - /* number */ - PG_OID, - PG_INT2, - PG_INT4, - PG_INT8, - PG_FLOAT4, - PG_FLOAT8, - PG_NUMERIC, - PG_MONEY, - /* character */ - PG_TEXT, - PG_CHAR, - PG_VARCHAR, - /* time and interval */ - PG_UNIX_TIME, - PG_UNIX_TIME_INTERVAL, - PG_DATE, - PG_TIME, - PG_TIME_WITH_TIMEZONE, - PG_TIMESTAMP, - PG_TIMESTAMP_WITH_TIMEZONE, - PG_INTERVAL, - /* binary */ - PG_BYTEA, - /* network */ - PG_CIDR, - PG_INET, - PG_MACADDR, - /* bit */ - PG_BIT, - PG_VARBIT, - /* geometoric */ - PG_LINE, - PG_LSEG, - PG_POINT, - PG_BOX, - PG_PATH, - PG_POLYGON, - PG_CIRCLE, - /* unkown and system */ - PG_UNKNOWN -} php_pgsql_data_type; - -typedef struct pgLofp { - PGconn *conn; - int lofd; -} pgLofp; - -typedef struct _php_pgsql_result_handle { - PGconn *conn; - PGresult *result; - int row; -} pgsql_result_handle; - -typedef struct _php_pgsql_notice { - char *message; - size_t len; -} php_pgsql_notice; - -ZEND_BEGIN_MODULE_GLOBALS(pgsql) - long default_link; /* default link when connection is omitted */ - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - long auto_reset_persistent; - int le_lofp,le_string; - int ignore_notices,log_notices; - HashTable notices; /* notice message for each connection */ -ZEND_END_MODULE_GLOBALS(pgsql) - -ZEND_EXTERN_MODULE_GLOBALS(pgsql) - -#ifdef ZTS -# define PGG(v) TSRMG(pgsql_globals_id, zend_pgsql_globals *, v) -#else -# define PGG(v) (pgsql_globals.v) -#endif - -#endif - -#else - -#define pgsql_module_ptr NULL - -#endif - -#define phpext_pgsql_ptr pgsql_module_ptr - -#endif /* PHP_PGSQL_H */ diff --git a/ext/pgsql/tests/01createdb.phpt b/ext/pgsql/tests/01createdb.phpt deleted file mode 100644 index 2ba6c61495d65..0000000000000 --- a/ext/pgsql/tests/01createdb.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -PostgreSQL create db ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// create test table - -include('config.inc'); - -$db = pg_connect($conn_str); -$res = @pg_query($db, "SELECT * FROM ".$table_name); -if (!@pg_num_rows($res)) -{ - @pg_query($db,$table_def); // Create table here - for ($i=0; $i < $num_test_record; $i++) { - pg_query($db,"INSERT INTO ".$table_name." VALUES ($i, 'ABC');"); - } -} -else { - echo pg_last_error()."\n"; -} - -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/02connection.phpt b/ext/pgsql/tests/02connection.phpt deleted file mode 100644 index 6288d0e1796ea..0000000000000 --- a/ext/pgsql/tests/02connection.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -PostgreSQL connection ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// connection function tests - -include('config.inc'); - -$db = pg_pconnect($conn_str); -var_dump($db); - -if (pg_connection_status($db) != PGSQL_CONNECTION_OK) -{ - echo "pg_connection_status() error\n"; -} -if (!pg_connection_reset($db)) -{ - echo "pg_connection_reset() error\n"; -} -if (pg_connection_busy($db)) -{ - echo "pg_connection_busy() error\n"; -} -if (function_exists('pg_transaction_status')) { - if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE) - { - echo "pg_transaction_status() error\n"; - } -} -if (!pg_host($db)) -{ - echo "pg_host() error\n"; -} -if (!pg_dbname($db)) -{ - echo "pg_dbname() error\n"; -} -if (!pg_port($db)) -{ - echo "pg_port() error\n"; -} -if (pg_tty($db)) -{ - echo "pg_tty() error\n"; -} -if (pg_options($db)) -{ - echo "pg_options() error\n"; -} - -pg_close($db); - -?> -===DONE=== ---EXPECTF-- -resource(%d) of type (pgsql link%s) -===DONE=== diff --git a/ext/pgsql/tests/03sync_query.phpt b/ext/pgsql/tests/03sync_query.phpt deleted file mode 100644 index afb6bb4475fb8..0000000000000 --- a/ext/pgsql/tests/03sync_query.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -PostgreSQL sync query ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$result = pg_query($db, "SELECT * FROM ".$table_name.";"); -if (!($rows = pg_num_rows($result))) -{ - echo "pg_num_row() error\n"; -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_array($result, $i, PGSQL_NUM); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_object($result); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_row($result, $i); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_result($result, $i, 0); -} - -pg_result_error($result); -if (function_exists('pg_result_error_field')) { - pg_result_error_field($result, PGSQL_DIAG_SEVERITY); - pg_result_error_field($result, PGSQL_DIAG_SQLSTATE); - pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY); - pg_result_error_field($result, PGSQL_DIAG_MESSAGE_DETAIL); - pg_result_error_field($result, PGSQL_DIAG_MESSAGE_HINT); - pg_result_error_field($result, PGSQL_DIAG_STATEMENT_POSITION); - if (defined('PGSQL_DIAG_INTERNAL_POSITION')) - { - pg_result_error_field($result, PGSQL_DIAG_INTERNAL_POSITION); - } - if (defined('PGSQL_DIAG_INTERNAL_QUERY')) - { - pg_result_error_field($result, PGSQL_DIAG_INTERNAL_QUERY); - } - pg_result_error_field($result, PGSQL_DIAG_CONTEXT); - pg_result_error_field($result, PGSQL_DIAG_SOURCE_FILE); - pg_result_error_field($result, PGSQL_DIAG_SOURCE_LINE); - pg_result_error_field($result, PGSQL_DIAG_SOURCE_FUNCTION); -} -pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";")); -pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";")); -pg_field_name($result, 0); -pg_field_num($result, $field_name); -pg_field_size($result, 0); -pg_field_type($result, 0); -pg_field_prtlen($result, 0); -pg_field_is_null($result, 0); - -$result = pg_query($db, "INSERT INTO ".$table_name." VALUES (9999, 'ABC');"); -pg_last_oid($result); - -pg_free_result($result); -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/04async_query.phpt b/ext/pgsql/tests/04async_query.phpt deleted file mode 100644 index 7711240a797cf..0000000000000 --- a/ext/pgsql/tests/04async_query.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -PostgreSQL async query ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -if (!pg_send_query($db, "SELECT * FROM ".$table_name.";")) { - echo "pg_send_query() error\n"; -} -while(pg_connection_busy($db)); // busy wait: intended -if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; -} -if (!($result = pg_get_result($db))) -{ - echo "pg_get_result() error\n"; -} - -if (!($rows = pg_num_rows($result))) { - echo "pg_num_rows() error\n"; -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_array($result, $i, PGSQL_NUM); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_object($result); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_row($result, $i); -} -for ($i=0; $i < $rows; $i++) -{ - pg_fetch_result($result, $i, 0); -} - -pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";")); -pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";")); -pg_field_name($result, 0); -pg_field_num($result, $field_name); -pg_field_size($result, 0); -pg_field_type($result, 0); -pg_field_prtlen($result, 0); -pg_field_is_null($result, 0); - -if (!pg_send_query($db, "INSERT INTO ".$table_name." VALUES (8888, 'GGG');")) -{ - echo "pg_send_query() error\n"; -} - -pg_last_oid($result); -pg_free_result($result); - - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt deleted file mode 100644 index a6f30195ae683..0000000000000 --- a/ext/pgsql/tests/05large_object.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -PostgreSQL large object ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -echo "create/write/close LO\n"; -pg_exec ($db, "begin"); -$oid = pg_lo_create ($db); -if (!$oid) echo ("pg_lo_create() error\n"); -$handle = pg_lo_open ($db, $oid, "w"); -if (!$handle) echo ("pg_lo_open() error\n"); -pg_lo_write ($handle, "large object data\n"); -pg_lo_close ($handle); -pg_exec ($db, "commit"); - -echo "open/read/tell/seek/close LO\n"; -pg_exec ($db, "begin"); -$handle = pg_lo_open ($db, $oid, "w"); -pg_lo_read($handle, 100); -pg_lo_tell($handle); -pg_lo_seek($handle, 2); -pg_lo_close($handle); -pg_exec ($db, "commit"); - -echo "open/read_all/close LO\n"; -pg_exec ($db, "begin"); -$handle = pg_lo_open ($db, $oid, "w"); -pg_lo_read_all($handle); -if (pg_last_error()) echo "pg_lo_read_all() error\n".pg_last_error(); -pg_lo_close($handle); -pg_exec ($db, "commit"); - -echo "unlink LO\n"; -pg_exec ($db, "begin"); -pg_lo_unlink($db, $oid) or print("pg_lo_unlink() error 1\n"); -pg_exec ($db, "commit"); - -// more pg_lo_unlink() tests -echo "Test without connection\n"; -pg_exec ($db, "begin"); -$oid = pg_lo_create ($db) or print("pg_lo_create() error\n"); -pg_lo_unlink($oid) or print("pg_lo_unlink() error 2\n"); -pg_exec ($db, "commit"); - -echo "Test with string oid value\n"; -pg_exec ($db, "begin"); -$oid = pg_lo_create ($db) or print("pg_lo_create() error\n"); -pg_lo_unlink($db, (string)$oid) or print("pg_lo_unlink() error 3\n"); -pg_exec ($db, "commit"); - -echo "import/export LO\n"; -$path = dirname(__FILE__) . '/'; -pg_query($db, 'begin'); -$oid = pg_lo_import($db, $path . 'php.gif'); -pg_query($db, 'commit'); -pg_query($db, 'begin'); -@unlink($path . 'php.gif.exported'); -pg_lo_export($oid, $path . 'php.gif.exported', $db); -if (!file_exists($path . 'php.gif.exported')) { - echo "Export failed\n"; -} -@unlink($path . 'php.gif.exported'); -pg_query($db, 'commit'); - -echo "OK"; -?> ---EXPECT-- -create/write/close LO -open/read/tell/seek/close LO -open/read_all/close LO -large object data -unlink LO -Test without connection -Test with string oid value -import/export LO -OK diff --git a/ext/pgsql/tests/06copy.phpt b/ext/pgsql/tests/06copy.phpt deleted file mode 100644 index bed783a6f8b6f..0000000000000 --- a/ext/pgsql/tests/06copy.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -PostgreSQL copy functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$rows = pg_copy_to($db, $table_name); - -pg_query($db, "DELETE FROM $table_name"); - -pg_copy_from($db, $table_name, $rows); - -echo "OK"; - -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/07optional.phpt b/ext/pgsql/tests/07optional.phpt deleted file mode 100644 index 9fa6f1633193d..0000000000000 --- a/ext/pgsql/tests/07optional.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -PostgreSQL optional functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// optional functions - -include('config.inc'); - -$db = pg_connect($conn_str); -$enc = pg_client_encoding($db); - -pg_set_client_encoding($db, $enc); - -if (function_exists('pg_set_error_verbosity')) { - pg_set_error_verbosity(PGSQL_ERRORS_TERSE); - pg_set_error_verbosity(PGSQL_ERRORS_DEFAULT); - pg_set_error_verbosity(PGSQL_ERRORS_VERBOSE); -} -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt deleted file mode 100644 index cf23b50e3a80f..0000000000000 --- a/ext/pgsql/tests/08escape.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -PostgreSQL escape functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include 'config.inc'; -define('FILE_NAME', dirname(__FILE__) . '/php.gif'); - -// pg_escape_string() test -$before = "ABC\\ABC\'"; -$expect = "ABC\\\\ABC\\'"; -$after = pg_escape_string($before); -if ($expect === $after) { - echo "pg_escape_string() is Ok\n"; -} -else { - echo "pg_escape_string() is NOT Ok\n"; - var_dump($before); - var_dump($after); - var_dump($expect); -} - -// pg_escape_bytea() test -$before = "ABC\\ABC"; -$expect = "ABC\\\\\\\\ABC"; -$after = pg_escape_bytea($before); -if ($expect === $after) { - echo "pg_escape_bytea() is Ok\n"; -} -else { - echo "pg_escape_byte() is NOT Ok\n"; - var_dump($before); - var_dump($after); - var_dump($expect); -} - -// Test using database -$data = file_get_contents(FILE_NAME); -$db = pg_connect($conn_str); - -// Insert binary to DB -$escaped_data = pg_escape_bytea($data); -pg_query("DELETE FROM ".$table_name." WHERE num = -9999;"); -$sql = "INSERT INTO ".$table_name." (num, bin) VALUES (-9999, CAST ('".$escaped_data."' AS BYTEA));"; -pg_query($db, $sql); - -// Retrieve binary from DB -$sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; -$result = pg_query($db, $sql); -$row = pg_fetch_array($result, 0, PGSQL_ASSOC); - -if ($data === pg_unescape_bytea($row['bin'])) { - echo "pg_escape_bytea() actually works with database\n"; -} -else { - echo "pg_escape_bytea() is broken\n"; -} - -?> ---EXPECT-- -pg_escape_string() is NOT Ok -string(9) "ABC\ABC\'" -string(12) "ABC\\ABC\\''" -string(10) "ABC\\ABC\'" -pg_escape_bytea() is Ok -pg_escape_bytea() actually works with database diff --git a/ext/pgsql/tests/09notice.phpt b/ext/pgsql/tests/09notice.phpt deleted file mode 100644 index ccb0c808230e1..0000000000000 --- a/ext/pgsql/tests/09notice.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -PostgreSQL notice function ---SKIPIF-- -<?php include("skipif.inc"); ?> ---INI-- -pgsql.log_notice=1 -pgsql.ignore_notices=0 ---FILE-- -<?php -include 'config.inc'; - -$db = pg_connect($conn_str); -pg_query($db, "BEGIN;"); -pg_query($db, "BEGIN;"); - -$msg = pg_last_notice($db); -if ($msg === FALSE) { - echo "Cannot find notice message in hash\n"; - var_dump($msg); -} -echo $msg."\n"; -echo "pg_last_notice() is Ok\n"; - -?> ---EXPECTF-- -Notice: pg_query(): %s already a transaction in progress in %s on line %d -%s already a transaction in progress -pg_last_notice() is Ok diff --git a/ext/pgsql/tests/10pg_convert.phpt b/ext/pgsql/tests/10pg_convert.phpt deleted file mode 100644 index b88b8e5798f37..0000000000000 --- a/ext/pgsql/tests/10pg_convert.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -PostgreSQL pg_convert() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); - -$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB'); -$converted = pg_convert($db, $table_name, $fields); - -var_dump($converted); -?> ---EXPECT-- -array(3) { - ["num"]=> - string(4) "1234" - ["str"]=> - string(5) "'AAA'" - ["bin"]=> - string(5) "'BBB'" -} diff --git a/ext/pgsql/tests/11pg_meta_data.phpt b/ext/pgsql/tests/11pg_meta_data.phpt deleted file mode 100644 index a7f8ed47fc5e6..0000000000000 --- a/ext/pgsql/tests/11pg_meta_data.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -PostgreSQL pg_metadata() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); - -$meta = pg_meta_data($db, $table_name); - -var_dump($meta); -?> ---EXPECT-- -array(3) { - ["num"]=> - array(6) { - ["num"]=> - int(1) - ["type"]=> - string(4) "int4" - ["len"]=> - int(4) - ["not null"]=> - bool(false) - ["has default"]=> - bool(false) - ["array dims"]=> - int(0) - } - ["str"]=> - array(6) { - ["num"]=> - int(2) - ["type"]=> - string(4) "text" - ["len"]=> - int(-1) - ["not null"]=> - bool(false) - ["has default"]=> - bool(false) - ["array dims"]=> - int(0) - } - ["bin"]=> - array(6) { - ["num"]=> - int(3) - ["type"]=> - string(5) "bytea" - ["len"]=> - int(-1) - ["not null"]=> - bool(false) - ["has default"]=> - bool(false) - ["array dims"]=> - int(0) - } -} diff --git a/ext/pgsql/tests/12pg_insert.phpt b/ext/pgsql/tests/12pg_insert.phpt deleted file mode 100644 index 8d98f220fdfb6..0000000000000 --- a/ext/pgsql/tests/12pg_insert.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PostgreSQL pg_insert() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); -$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB'); - -pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; -echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; - -echo "Ok\n"; -?> ---EXPECT-- -INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','BBB'); -Ok diff --git a/ext/pgsql/tests/13pg_select.phpt b/ext/pgsql/tests/13pg_select.phpt deleted file mode 100644 index 55e88db731c9b..0000000000000 --- a/ext/pgsql/tests/13pg_select.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -PostgreSQL pg_select() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); -$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ'); -$ids = array('num'=>'1234'); - -$res = pg_select($db, $table_name, $ids) or print "Error\n"; -var_dump($res); -echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; -echo "Ok\n"; - -?> ---EXPECT-- -array(1) { - [0]=> - array(3) { - ["num"]=> - string(4) "1234" - ["str"]=> - string(3) "AAA" - ["bin"]=> - string(3) "BBB" - } -} -SELECT * FROM php_pgsql_test WHERE num=1234; -Ok diff --git a/ext/pgsql/tests/14pg_update.phpt b/ext/pgsql/tests/14pg_update.phpt deleted file mode 100644 index ef8d7e49bd239..0000000000000 --- a/ext/pgsql/tests/14pg_update.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -PostgreSQL pg_update() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); -$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ'); -$ids = array('num'=>'1234'); - -pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n"; -echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; - -echo "Ok\n"; -?> ---EXPECT-- -UPDATE php_pgsql_test SET num=1234,str='ABC',bin='XYZ' WHERE num=1234; -Ok diff --git a/ext/pgsql/tests/15pg_delete.phpt b/ext/pgsql/tests/15pg_delete.phpt deleted file mode 100644 index e35f4ba78e6c3..0000000000000 --- a/ext/pgsql/tests/15pg_delete.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -PostgreSQL pg_delete() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); - -$fields = array('num'=>'1234', 'str'=>'XXX', 'bin'=>'YYY'); -$ids = array('num'=>'1234'); -if (!pg_delete($db, $table_name, $ids)) { - echo "Error\n"; -} -else { - echo "Ok\n"; -} -?> ---EXPECT-- -Ok diff --git a/ext/pgsql/tests/16pg_result_status.phpt b/ext/pgsql/tests/16pg_result_status.phpt deleted file mode 100644 index 268dc9fd64cf3..0000000000000 --- a/ext/pgsql/tests/16pg_result_status.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -PostgreSQL pg_result_status() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -include 'config.inc'; - -$db = pg_connect($conn_str); - -$sql = "SELECT * FROM ".$table_name." WHERE num = -2"; -$result = pg_query($db, "BEGIN;END"); - -echo pg_result_status($result)."\n"; -echo pg_result_status($result, PGSQL_STATUS_STRING)."\n"; -?> ---EXPECT-- -1 -COMMIT diff --git a/ext/pgsql/tests/17result.phpt b/ext/pgsql/tests/17result.phpt deleted file mode 100644 index c3f9959aa2e82..0000000000000 --- a/ext/pgsql/tests/17result.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -PostgreSQL pg_fetch_*() functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -$db = pg_connect($conn_str); - -$sql = "SELECT * FROM $table_name"; -$result = pg_query($db, $sql) or die('Cannot qeury db'); -$rows = pg_num_rows($result); - -var_dump(pg_result_seek($result, 1)); -var_dump(pg_fetch_object($result)); -var_dump(pg_fetch_array($result, 1)); -var_dump(pg_fetch_row($result, 1)); -var_dump(pg_fetch_assoc($result, 1)); -var_dump(pg_result_seek($result, 0)); - -echo "Ok\n"; -?> ---EXPECT-- -bool(true) -object(stdClass)#1 (3) { - ["num"]=> - string(1) "1" - ["str"]=> - string(3) "ABC" - ["bin"]=> - NULL -} -array(6) { - [0]=> - string(1) "1" - ["num"]=> - string(1) "1" - [1]=> - string(3) "ABC" - ["str"]=> - string(3) "ABC" - [2]=> - NULL - ["bin"]=> - NULL -} -array(3) { - [0]=> - string(1) "1" - [1]=> - string(3) "ABC" - [2]=> - NULL -} -array(3) { - ["num"]=> - string(1) "1" - ["str"]=> - string(3) "ABC" - ["bin"]=> - NULL -} -bool(true) -Ok diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt deleted file mode 100644 index 43f98c446725c..0000000000000 --- a/ext/pgsql/tests/18pg_escape_bytea.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -PostgreSQL pg_escape_bytea() functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// optional functions - -include('config.inc'); - -$image = file_get_contents(dirname(__FILE__) . '/php.gif'); -$esc_image = pg_escape_bytea($image); - -$db = pg_connect($conn_str); -pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); -$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); -$rows = pg_fetch_all($result); -$unesc_image = pg_unescape_bytea($rows[0]['bin']); - -if ($unesc_image !== $image) { - echo "NG"; -} -else { - echo "OK"; -} -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/19pg_ping.phpt b/ext/pgsql/tests/19pg_ping.phpt deleted file mode 100644 index 9059bde470f3e..0000000000000 --- a/ext/pgsql/tests/19pg_ping.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -PostgreSQL pg_ping() functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// optional functions - -include('config.inc'); - -$db = pg_connect($conn_str); -var_dump(pg_ping($db)); -?> ---EXPECT-- -bool(true) diff --git a/ext/pgsql/tests/20pg_get_pid.phpt b/ext/pgsql/tests/20pg_get_pid.phpt deleted file mode 100644 index 06cdfa8656326..0000000000000 --- a/ext/pgsql/tests/20pg_get_pid.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -PostgreSQL pg_get_pid() functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// optional functions - -include('config.inc'); - -$db = pg_connect($conn_str); -$pid = pg_get_pid($db); - -is_integer($pid) ? print 'OK' : print 'NG'; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/21pg_get_notify.phpt b/ext/pgsql/tests/21pg_get_notify.phpt deleted file mode 100644 index 9171fc01aa45b..0000000000000 --- a/ext/pgsql/tests/21pg_get_notify.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -PostgreSQL pg_get_notify() functions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// optional functions - -include('config.inc'); - -$db = pg_connect($conn_str); -pg_query($db, 'LISTEN test_msg'); -pg_query($db, 'NOTIFY test_msg'); - -$msg = pg_get_notify($db); - -isset($msg['message'],$msg['pid']) ? print 'OK' : print 'NG'; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/22pg_fetch_object.phpt b/ext/pgsql/tests/22pg_fetch_object.phpt deleted file mode 100755 index 4f2f5dc184210..0000000000000 --- a/ext/pgsql/tests/22pg_fetch_object.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -PostgreSQL pg_fetch_object() ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -error_reporting(E_ALL); - -include 'config.inc'; - -class test_class { - function __construct($arg1, $arg2) { - echo __METHOD__ . "($arg1,$arg2)\n"; - } -} - -$db = pg_connect($conn_str); - -$sql = "SELECT * FROM $table_name"; -$result = pg_query($db, $sql) or die('Cannot qeury db'); -$rows = pg_num_rows($result); - -var_dump(pg_fetch_object($result, NULL, 'test_class', array(1, 2))); - -echo "Ok\n"; -?> ---EXPECT-- -test_class::__construct(1,2) -object(test_class)#1 (3) { - ["num"]=> - string(1) "0" - ["str"]=> - string(3) "ABC" - ["bin"]=> - NULL -} -Ok diff --git a/ext/pgsql/tests/23sync_query_params.phpt b/ext/pgsql/tests/23sync_query_params.phpt deleted file mode 100644 index 6959cd75a7d6c..0000000000000 --- a/ext/pgsql/tests/23sync_query_params.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -PostgreSQL sync query params ---SKIPIF-- -<?php -include("skipif.inc"); -if (!function_exists('pg_query_params')) die('skip function pg_query_params() does not exist'); -?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$version = pg_version($db); -if ($version['protocol'] >= 3) { - $result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)); - if (!($rows = pg_num_rows($result))) - { - echo "pg_num_row() error\n"; - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_array($result, $i, PGSQL_NUM); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_object($result); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_row($result, $i); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_result($result, $i, 0); - } - - pg_result_error($result); - pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_field_name($result, 0); - pg_field_num($result, $field_name); - pg_field_size($result, 0); - pg_field_type($result, 0); - pg_field_prtlen($result, 0); - pg_field_is_null($result, 0); - - $result = pg_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")); - pg_last_oid($result); - - pg_free_result($result); -} -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/24sync_query_prepared.phpt b/ext/pgsql/tests/24sync_query_prepared.phpt deleted file mode 100644 index ea8f14661a0bd..0000000000000 --- a/ext/pgsql/tests/24sync_query_prepared.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -PostgreSQL sync prepared queries ---SKIPIF-- -<?php -include("skipif.inc"); -if (!function_exists('pg_prepare')) die('skip function pg_prepare() does not exist'); -?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$version = pg_version($db); -if ($version['protocol'] >= 3) { - $result = pg_prepare($db, "php_test", "SELECT * FROM ".$table_name." WHERE num > \$1;"); - pg_result_error($result); - pg_free_result($result); - $result = pg_execute($db, "php_test", array(100)); - if (!($rows = pg_num_rows($result))) - { - echo "pg_num_row() error\n"; - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_array($result, $i, PGSQL_NUM); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_object($result); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_row($result, $i); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_result($result, $i, 0); - } - - pg_result_error($result); - pg_num_rows(pg_execute($db, "php_test", array(100))); - pg_num_fields(pg_execute($db, "php_test", array(100))); - pg_field_name($result, 0); - pg_field_num($result, $field_name); - pg_field_size($result, 0); - pg_field_type($result, 0); - pg_field_prtlen($result, 0); - pg_field_is_null($result, 0); - - $result = pg_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);"); - pg_result_error($result); - pg_free_result($result); - $result = pg_execute($db, "php_test2", array(9999, "A'BC")); - pg_last_oid($result); - - pg_free_result($result); -} -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/25async_query_params.phpt b/ext/pgsql/tests/25async_query_params.phpt deleted file mode 100644 index 6e7dafe34b348..0000000000000 --- a/ext/pgsql/tests/25async_query_params.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -PostgreSQL async query params ---SKIPIF-- -<?php -include("skipif.inc"); -if (!function_exists('pg_send_query_params')) die('skip function pg_send_query_params() does not exist'); -?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$version = pg_version($db); -if ($version['protocol'] >= 3) { - if (!pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))) { - echo "pg_send_query_params() error\n"; - } - while(pg_connection_busy($db)); // busy wait: intended - if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; - } - if (!($result = pg_get_result($db))) - { - echo "pg_get_result() error\n"; - } - if (!($rows = pg_num_rows($result))) { - echo "pg_num_rows() error\n"; - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_array($result, $i, PGSQL_NUM); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_object($result); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_row($result, $i); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_result($result, $i, 0); - } - - pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_field_name($result, 0); - pg_field_num($result, $field_name); - pg_field_size($result, 0); - pg_field_type($result, 0); - pg_field_prtlen($result, 0); - pg_field_is_null($result, 0); - - if (!pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"))) - { - echo "pg_send_query_params() error\n"; - } - - pg_last_oid($result); - pg_free_result($result); -} -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/26async_query_prepared.phpt b/ext/pgsql/tests/26async_query_prepared.phpt deleted file mode 100644 index bda363b7501bc..0000000000000 --- a/ext/pgsql/tests/26async_query_prepared.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -PostgreSQL async prepared queries ---SKIPIF-- -<?php -include("skipif.inc"); -if (!function_exists('pg_send_prepare')) die('skip function pg_send_prepare() does not exist'); -?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); - -$version = pg_version($db); -if ($version['protocol'] >= 3) { - if (!pg_send_prepare($db, 'php_test', "SELECT * FROM ".$table_name." WHERE num > \$1;")) { - echo "pg_send_prepare() error\n"; - } - while(pg_connection_busy($db)); // busy wait: intended - if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; - } - if (!($result = pg_get_result($db))) - { - echo "pg_get_result() error\n"; - } - pg_free_result($result); - - if (!pg_send_execute($db, 'php_test', array(100))) { - echo "pg_send_execute() error\n"; - } - while(pg_connection_busy($db)); // busy wait: intended - if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; - } - if (!($result = pg_get_result($db))) - { - echo "pg_get_result() error\n"; - } - - if (!($rows = pg_num_rows($result))) { - echo "pg_num_rows() error\n"; - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_array($result, $i, PGSQL_NUM); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_object($result); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_row($result, $i); - } - for ($i=0; $i < $rows; $i++) - { - pg_fetch_result($result, $i, 0); - } - - pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); - pg_field_name($result, 0); - pg_field_num($result, $field_name); - pg_field_size($result, 0); - pg_field_type($result, 0); - pg_field_prtlen($result, 0); - pg_field_is_null($result, 0); - - if (!pg_send_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);")) - { - echo "pg_send_prepare() error\n"; - } - while(pg_connection_busy($db)); // busy wait: intended - if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; - } - if (!($result = pg_get_result($db))) - { - echo "pg_get_result() error\n"; - } - pg_free_result($result); - - if (!pg_send_execute($db, "php_test2", array(9999, "A'BC"))) - { - echo "pg_send_execute() error\n"; - } - while(pg_connection_busy($db)); // busy wait: intended - if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { - echo "pg_connection_status() error\n"; - } - if (!($result = pg_get_result($db))) - { - echo "pg_get_result() error\n"; - } - - pg_last_oid($result); - pg_free_result($result); -} -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/80_bug14383.phpt b/ext/pgsql/tests/80_bug14383.phpt deleted file mode 100644 index c60e11c19accf..0000000000000 --- a/ext/pgsql/tests/80_bug14383.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #14383 ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/../../dba/tests/skipif.inc'); -require_once('skipif.inc'); -?> ---FILE-- -<?php -require_once('config.inc'); - -$dbh = @pg_connect($conn_str); -if (!$dbh) { - die ("Could not connect to the server"); -} -pg_close($dbh); - -require_once(dirname(__FILE__).'/../../dba/tests/test.inc'); -require_once(dirname(__FILE__).'/../../dba/tests/dba_handler.inc'); - -?> ---EXPECTF-- -database handler: %s -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} \ No newline at end of file diff --git a/ext/pgsql/tests/80_bug24499.phpt b/ext/pgsql/tests/80_bug24499.phpt deleted file mode 100755 index ddb3c58a21029..0000000000000 --- a/ext/pgsql/tests/80_bug24499.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -Bug #24499 Notice: Undefined property: stdClass:: ---SKIPIF-- -<?php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('config.inc'); - -$dbh = @pg_connect($conn_str); -if (!$dbh) { - die ("Could not connect to the server"); -} - -@pg_query("DROP SEQUENCE id_id_seq"); -@pg_query("DROP TABLE id"); -pg_query("CREATE TABLE id (id SERIAL, t INT)"); - -for ($i=0; $i<4; $i++) { - pg_query("INSERT INTO id (t) VALUES ($i)"); -} - -class Id -{ - public $id; - - public function getId() - { - global $dbh; - - $q = pg_query($dbh, "SELECT id FROM id"); - print_r(pg_fetch_array($q)); - print_r(pg_fetch_array($q)); - $id = pg_fetch_object($q); - var_dump($id); - return $id->id; - } -} - -$id = new Id(); -var_dump($id->getId()); - -pg_close($dbh); - -echo "Done\n"; - -?> ---EXPECTF-- -Array -( - [0] => 1 - [id] => 1 -) -Array -( - [0] => 2 - [id] => 2 -) -object(stdClass)#%d (1) { - ["id"]=> - string(1) "3" -} -string(1) "3" -Done diff --git a/ext/pgsql/tests/80_bug27597.phpt b/ext/pgsql/tests/80_bug27597.phpt deleted file mode 100755 index aa04a4a225a09..0000000000000 --- a/ext/pgsql/tests/80_bug27597.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Bug #27597 pg_fetch_array not returning false ---SKIPIF-- -<?php -require_once('skipif.inc'); -?> ---FILE-- -<?php - -require_once('config.inc'); - -$dbh = @pg_connect($conn_str); -if (!$dbh) { - die ("Could not connect to the server"); -} - -@pg_query("DROP TABLE id"); -pg_query("CREATE TABLE id (id INT)"); - -for ($i=0; $i<4; $i++) { - pg_query("INSERT INTO id (id) VALUES ($i)"); -} - -function xi_fetch_array($res, $type = PGSQL_ASSOC) { - $a = pg_fetch_array($res, NULL, $type) ; - return $a ; -} - -$res = pg_query("SELECT * FROM id"); -$i = 0; // endless-loop protection -while($row = xi_fetch_array($res)) { - print_r($row); - if ($i++ > 4) { - echo "ENDLESS-LOOP"; - exit(1); - } -} - -pg_close($dbh); - -?> -===DONE=== ---EXPECTF-- -Array -( - [id] => 0 -) -Array -( - [id] => 1 -) -Array -( - [id] => 2 -) -Array -( - [id] => 3 -) -===DONE=== diff --git a/ext/pgsql/tests/80_bug32223.phpt b/ext/pgsql/tests/80_bug32223.phpt deleted file mode 100755 index a605fcc20b2b0..0000000000000 --- a/ext/pgsql/tests/80_bug32223.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Bug #32223 (weird behaviour of pg_last_notice) ---SKIPIF-- -<?php -require_once('skipif.inc'); - -@pg_query($conn, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'"); -$res = @pg_query($conn, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS ' -begin - RAISE NOTICE ''11111''; - return ''f''; -end; -' LANGUAGE plpgsql;"); -if (!$res) die('skip PLPGSQL not available'); -?> ---FILE-- -<?php - -require_once('config.inc'); - -$dbh = @pg_connect($conn_str); -if (!$dbh) { - die ("Could not connect to the server"); -} - -//@pg_query($dbh, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'"); -$res = pg_query($dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS ' -begin - RAISE NOTICE ''11111''; - return ''f''; -end; -' LANGUAGE plpgsql;"); - - -$res = pg_query($dbh, 'SELECT test_notice()'); -$row = pg_fetch_row($res, 0); -var_dump($row); -pg_free_result($res); -if ($row[0] == 'f') -{ - var_dump(pg_last_notice($dbh)); -} - -pg_close($dbh); - -?> -===DONE=== ---EXPECTF-- -array(1) { - [0]=> - string(1) "f" -} -string(14) "NOTICE: 11111" -===DONE=== diff --git a/ext/pgsql/tests/98old_api.phpt b/ext/pgsql/tests/98old_api.phpt deleted file mode 100644 index 2667e097e303b..0000000000000 --- a/ext/pgsql/tests/98old_api.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -PostgreSQL old api ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php - -include('config.inc'); - -$db = pg_connect($conn_str); -$result = pg_exec("SELECT * FROM ".$table_name); -pg_numrows($result); -pg_numfields($result); -pg_fieldname($result, 0); -pg_fieldsize($result, $field_name); -pg_fieldtype($result, 0); -pg_fieldprtlen($result, 0); -pg_fieldisnull($result, 0); - -pg_result($result,0,0); -$result = pg_exec("INSERT INTO ".$table_name." VALUES (7777, 'KKK')"); -$oid = pg_getlastoid($result); -pg_freeresult($result); -pg_errormessage(); -$result = pg_exec("UPDATE ".$table_name." SET str = 'QQQ' WHERE str like 'RGD';"); -pg_cmdtuples($result); - - - -echo "OK"; -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/9999dropdb.phpt b/ext/pgsql/tests/9999dropdb.phpt deleted file mode 100644 index c60eeda8d6c1b..0000000000000 --- a/ext/pgsql/tests/9999dropdb.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -PostgreSQL drop db ---SKIPIF-- -<?php include("skipif.inc"); ?> ---FILE-- -<?php -// drop test table - -include('config.inc'); - -$db = pg_connect($conn_str); -pg_query($db, "DROP TABLE ".$table_name); - -echo "OK"; - -?> ---EXPECT-- -OK diff --git a/ext/pgsql/tests/README b/ext/pgsql/tests/README deleted file mode 100644 index 1a29a34e64960..0000000000000 --- a/ext/pgsql/tests/README +++ /dev/null @@ -1,16 +0,0 @@ -Test scripts assumes: - - PostgreSQL server is installed locally - - there is a PostgreSQL account for the users running the test scripts - - there is database named "test" - -For instance, if your login name is 'testuser', you should have PostgreSQL -user account named 'testuser' and grant that user access to the database -'test'. - -If you have account and database, type "createdb test" from command prompt -to create the database to execute the test scripts. By executing the above -command as the same user running the tests you ensure that the user is -granted access to the database. - -If you find problems in PostgreSQL module, please mail to -intenals@lists.php.net, helly@php.net or yohgaki@php.net. diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc deleted file mode 100644 index 2b5f05a71dab9..0000000000000 --- a/ext/pgsql/tests/config.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php -// These vars are used to connect db and create test table. -// values can be set to meet your environment - -$conn_str = "host=localhost dbname=test"; // connection string -$table_name = "php_pgsql_test"; // test table that should be exist -$num_test_record = 1000; // Number of records to create - -$table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table -$field_name = "num"; // For pg_field_num() - -?> \ No newline at end of file diff --git a/ext/pgsql/tests/php.gif b/ext/pgsql/tests/php.gif deleted file mode 100644 index 7beda43fd4174..0000000000000 Binary files a/ext/pgsql/tests/php.gif and /dev/null differ diff --git a/ext/pgsql/tests/skipif.inc b/ext/pgsql/tests/skipif.inc deleted file mode 100644 index 043a0bd8d2031..0000000000000 --- a/ext/pgsql/tests/skipif.inc +++ /dev/null @@ -1,18 +0,0 @@ -<?php -// This script prints "skip" unless: -// * the pgsql extension is built-in or loadable, AND -// * there is a database called "test" accessible -// with no username/password, AND -// * we have create/drop privileges on the entire "test" -// database - -include("config.inc"); - -if (!extension_loaded("pgsql")) { - die("skip\n"); -} -$conn = @pg_connect($conn_str); -if (!is_resource($conn)) { - die("skip could not connect\n"); -} -?> \ No newline at end of file diff --git a/ext/posix/CREDITS b/ext/posix/CREDITS deleted file mode 100644 index c769635d91b1b..0000000000000 --- a/ext/posix/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Posix -Kristian Köhntopp diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 deleted file mode 100644 index 6b95375d8849d..0000000000000 --- a/ext/posix/config.m4 +++ /dev/null @@ -1,15 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions, -[ --disable-posix Disable POSIX-like functions], yes) - -if test "$PHP_POSIX" = "yes"; then - AC_DEFINE(HAVE_POSIX, 1, [whether to include POSIX-like functions]) - PHP_NEW_EXTENSION(posix, posix.c, $ext_shared) - - AC_CHECK_HEADERS(sys/mkdev.h) - - AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev) -fi diff --git a/ext/posix/package.xml b/ext/posix/package.xml deleted file mode 100644 index 1abe815c1fe1d..0000000000000 --- a/ext/posix/package.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>pcntl</name> - <summary>Process control functions</summary> - <maintainers> - <maintainer> - <user>???</user> - <name>Jason Greene</name> - <email>jason@inetgurus.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> -Process Control support in PHP implements the Unix style -of process creation, program execution, signal handling -and process termination. Process Control should not be -enabled within a webserver environment and unexpected -results may happen if any Process Control functions -are used within a webserver environment. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="doc" name="README"/> - <file role="src" name="config.m4"/> - <file role="src" name="pcntl.c"/> - <file role="src" name="php_pcntl.h"/> - <file role="src" name="php_signal.c"/> - <file role="src" name="php_signal.h"/> - <file role="test" name="test-pcntl.php"/> - <file role="test" name="tests/001.phpt"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> --> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h deleted file mode 100644 index 26a6c2a0719dd..0000000000000 --- a/ext/posix/php_posix.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kristian Koehntopp <kris@koehntopp.de> | - +----------------------------------------------------------------------+ - */ - - -/* $Id$ */ - -#ifndef PHP_POSIX_H -#define PHP_POSIX_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#if HAVE_POSIX -#ifndef DLEXPORT -#define DLEXPORT -#endif - -extern zend_module_entry posix_module_entry; -#define posix_module_ptr &posix_module_entry - -/* POSIX.1, 3.3 */ -PHP_FUNCTION(posix_kill); - -/* POSIX.1, 4.1 */ -PHP_FUNCTION(posix_getpid); -PHP_FUNCTION(posix_getppid); - -/* POSIX.1, 4.2 */ -PHP_FUNCTION(posix_getuid); -PHP_FUNCTION(posix_getgid); -PHP_FUNCTION(posix_geteuid); -PHP_FUNCTION(posix_getegid); -PHP_FUNCTION(posix_setuid); -PHP_FUNCTION(posix_setgid); -#ifdef HAVE_SETEUID -PHP_FUNCTION(posix_seteuid); -#endif -#ifdef HAVE_SETEGID -PHP_FUNCTION(posix_setegid); -#endif -#ifdef HAVE_GETGROUPS -PHP_FUNCTION(posix_getgroups); -#endif -#ifdef HAVE_GETLOGIN -PHP_FUNCTION(posix_getlogin); -#endif - -/* POSIX.1, 4.3 */ -PHP_FUNCTION(posix_getpgrp); -#ifdef HAVE_SETSID -PHP_FUNCTION(posix_setsid); -#endif -PHP_FUNCTION(posix_setpgid); -/* Non-Posix functions which are common */ -#ifdef HAVE_GETPGID -PHP_FUNCTION(posix_getpgid); -#endif -#ifdef HAVE_GETSID -PHP_FUNCTION(posix_getsid); -#endif - -/* POSIX.1, 4.4 */ -PHP_FUNCTION(posix_uname); -PHP_FUNCTION(posix_times); - -/* POSIX.1, 4.5 */ -#ifdef HAVE_CTERMID -PHP_FUNCTION(posix_ctermid); -#endif -PHP_FUNCTION(posix_ttyname); -PHP_FUNCTION(posix_isatty); - -/* POSIX.1, 5.2 */ -PHP_FUNCTION(posix_getcwd); - -/* POSIX.1, 5.4 */ -#ifdef HAVE_MKFIFO -PHP_FUNCTION(posix_mkfifo); -#endif -#ifdef HAVE_MKNOD -PHP_FUNCTION(posix_mknod); -#endif - -/* POSIX.1, 5.6 */ -PHP_FUNCTION(posix_access); - -/* POSIX.1, 9.2 */ -PHP_FUNCTION(posix_getgrnam); -PHP_FUNCTION(posix_getgrgid); -PHP_FUNCTION(posix_getpwnam); -PHP_FUNCTION(posix_getpwuid); - -#ifdef HAVE_GETRLIMIT -PHP_FUNCTION(posix_getrlimit); -#endif - -PHP_FUNCTION(posix_get_last_error); -PHP_FUNCTION(posix_strerror); - -ZEND_BEGIN_MODULE_GLOBALS(posix) - int last_error; -ZEND_END_MODULE_GLOBALS(posix) - -#ifdef ZTS -# define POSIX_G(v) TSRMG(posix_globals_id, zend_posix_globals *, v) -#else -# define POSIX_G(v) (posix_globals.v) -#endif - -#else - -#define posix_module_ptr NULL - -#endif - -#define phpext_posix_ptr posix_module_ptr - -#endif /* PHP_POSIX_H */ diff --git a/ext/posix/posix.c b/ext/posix/posix.c deleted file mode 100644 index 26b76cc4bffdb..0000000000000 --- a/ext/posix/posix.c +++ /dev/null @@ -1,1060 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kristian Koehntopp <kris@koehntopp.de> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include <unistd.h> -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "php_posix.h" - - -#if HAVE_POSIX - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -#include <sys/resource.h> -#include <sys/utsname.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <signal.h> -#include <sys/times.h> -#include <errno.h> -#include <grp.h> -#include <pwd.h> -#if HAVE_SYS_MKDEV_H -# include <sys/mkdev.h> -#endif - -ZEND_DECLARE_MODULE_GLOBALS(posix) - -/* {{{ posix_functions[] - */ -function_entry posix_functions[] = { - /* POSIX.1, 3.3 */ - PHP_FE(posix_kill, NULL) - - /* POSIX.1, 4.1 */ - PHP_FE(posix_getpid, NULL) - PHP_FE(posix_getppid, NULL) - - /* POSIX.1, 4.2 */ - PHP_FE(posix_getuid, NULL) - PHP_FE(posix_setuid, NULL) - PHP_FE(posix_geteuid, NULL) -#ifdef HAVE_SETEUID - PHP_FE(posix_seteuid, NULL) -#endif - PHP_FE(posix_getgid, NULL) - PHP_FE(posix_setgid, NULL) - PHP_FE(posix_getegid, NULL) -#ifdef HAVE_SETEGID - PHP_FE(posix_setegid, NULL) -#endif -#ifdef HAVE_GETGROUPS - PHP_FE(posix_getgroups, NULL) -#endif -#ifdef HAVE_GETLOGIN - PHP_FE(posix_getlogin, NULL) -#endif - - /* POSIX.1, 4.3 */ - PHP_FE(posix_getpgrp, NULL) -#ifdef HAVE_SETSID - PHP_FE(posix_setsid, NULL) -#endif - PHP_FE(posix_setpgid, NULL) - /* Non-Posix functions which are common */ -#ifdef HAVE_GETPGID - PHP_FE(posix_getpgid, NULL) -#endif /* HAVE_GETPGID */ -#ifdef HAVE_GETSID - PHP_FE(posix_getsid, NULL) -#endif /* HAVE_GETSID */ - - /* POSIX.1, 4.4 */ - PHP_FE(posix_uname, NULL) - - /* POSIX.1, 4.5 */ - PHP_FE(posix_times, NULL) - - /* POSIX.1, 4.7 */ -#ifdef HAVE_CTERMID - PHP_FE(posix_ctermid, NULL) -#endif - PHP_FE(posix_ttyname, NULL) - PHP_FE(posix_isatty, NULL) - - /* POSIX.1, 5.2 */ - PHP_FE(posix_getcwd, NULL) - - /* POSIX.1, 5.4 */ -#ifdef HAVE_MKFIFO - PHP_FE(posix_mkfifo, NULL) -#endif -#ifdef HAVE_MKNOD - PHP_FE(posix_mknod, NULL) -#endif - - /* POSIX.1, 5.6 */ - PHP_FE(posix_access, NULL) - /* POSIX.1, 9.2 */ - PHP_FE(posix_getgrnam, NULL) - PHP_FE(posix_getgrgid, NULL) - PHP_FE(posix_getpwnam, NULL) - PHP_FE(posix_getpwuid, NULL) - -#ifdef HAVE_GETRLIMIT - PHP_FE(posix_getrlimit, NULL) -#endif - - PHP_FE(posix_get_last_error, NULL) - PHP_FALIAS(posix_errno, posix_get_last_error, NULL) - PHP_FE(posix_strerror, NULL) - - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(posix) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_end(); -} -/* }}} */ - -static void php_posix_init_globals(zend_posix_globals *posix_globals TSRMLS_DC) -{ - posix_globals->last_error = 0; -} - -/* {{{ PHP_MINIT_FUNCTION(posix) - */ -static PHP_MINIT_FUNCTION(posix) -{ - ZEND_INIT_MODULE_GLOBALS(posix, php_posix_init_globals, NULL); - REGISTER_LONG_CONSTANT("POSIX_F_OK", F_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("POSIX_X_OK", X_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("POSIX_W_OK", W_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("POSIX_R_OK", R_OK, CONST_CS | CONST_PERSISTENT); -#ifdef S_IFREG - REGISTER_LONG_CONSTANT("POSIX_S_IFREG", S_IFREG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef S_IFCHR - REGISTER_LONG_CONSTANT("POSIX_S_IFCHR", S_IFCHR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef S_IFBLK - REGISTER_LONG_CONSTANT("POSIX_S_IFBLK", S_IFBLK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef S_IFIFO - REGISTER_LONG_CONSTANT("POSIX_S_IFIFO", S_IFIFO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef S_IFSOCK - REGISTER_LONG_CONSTANT("POSIX_S_IFSOCK", S_IFSOCK, CONST_CS | CONST_PERSISTENT); -#endif - - return SUCCESS; -} -/* }}} */ - -static PHP_MINFO_FUNCTION(posix); - -/* {{{ posix_module_entry - */ -zend_module_entry posix_module_entry = { - STANDARD_MODULE_HEADER, - "posix", - posix_functions, - PHP_MINIT(posix), - NULL, - NULL, - NULL, - PHP_MINFO(posix), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_POSIX -ZEND_GET_MODULE(posix) -#endif - -#define PHP_POSIX_NO_ARGS if (ZEND_NUM_ARGS()) return; - -#define PHP_POSIX_RETURN_LONG_FUNC(func_name) \ - PHP_POSIX_NO_ARGS \ - RETURN_LONG(func_name()); - -#define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \ - long val; \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) RETURN_FALSE; \ - if (func_name(val) < 0) { \ - POSIX_G(last_error) = errno; \ - RETURN_FALSE; \ - } \ - RETURN_TRUE; - -/* {{{ proto bool posix_kill(int pid, int sig) - Send a signal to a process (POSIX.1, 3.3.2) */ - -PHP_FUNCTION(posix_kill) -{ - long pid, sig; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) { - RETURN_FALSE; - } - - if (kill(pid, sig) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int posix_getpid(void) - Get the current process id (POSIX.1, 4.1.1) */ -PHP_FUNCTION(posix_getpid) -{ - PHP_POSIX_RETURN_LONG_FUNC(getpid); -} -/* }}} */ - -/* {{{ proto int posix_getppid(void) - Get the parent process id (POSIX.1, 4.1.1) */ -PHP_FUNCTION(posix_getppid) -{ - PHP_POSIX_RETURN_LONG_FUNC(getppid); -} -/* }}} */ - -/* {{{ proto int posix_getuid(void) - Get the current user id (POSIX.1, 4.2.1) */ -PHP_FUNCTION(posix_getuid) -{ - PHP_POSIX_RETURN_LONG_FUNC(getuid); -} -/* }}} */ - -/* {{{ proto int posix_getgid(void) - Get the current group id (POSIX.1, 4.2.1) */ -PHP_FUNCTION(posix_getgid) -{ - PHP_POSIX_RETURN_LONG_FUNC(getgid); -} -/* }}} */ - -/* {{{ proto int posix_geteuid(void) - Get the current effective user id (POSIX.1, 4.2.1) */ -PHP_FUNCTION(posix_geteuid) -{ - PHP_POSIX_RETURN_LONG_FUNC(geteuid); -} -/* }}} */ - -/* {{{ proto int posix_getegid(void) - Get the current effective group id (POSIX.1, 4.2.1) */ -PHP_FUNCTION(posix_getegid) -{ - PHP_POSIX_RETURN_LONG_FUNC(getegid); -} -/* }}} */ - -/* {{{ proto bool posix_setuid(long uid) - Set user id (POSIX.1, 4.2.2) */ -PHP_FUNCTION(posix_setuid) -{ - PHP_POSIX_SINGLE_ARG_FUNC(setuid); -} -/* }}} */ - -/* {{{ proto bool posix_setgid(int uid) - Set group id (POSIX.1, 4.2.2) */ -PHP_FUNCTION(posix_setgid) -{ - PHP_POSIX_SINGLE_ARG_FUNC(setgid); -} -/* }}} */ - -/* {{{ proto bool posix_seteuid(long uid) - Set effective user id */ -#ifdef HAVE_SETEUID -PHP_FUNCTION(posix_seteuid) -{ - PHP_POSIX_SINGLE_ARG_FUNC(seteuid); -} -#endif -/* }}} */ - -/* {{{ proto bool posix_setegid(long uid) - Set effective group id */ -#ifdef HAVE_SETEGID -PHP_FUNCTION(posix_setegid) -{ - PHP_POSIX_SINGLE_ARG_FUNC(setegid); -} -#endif -/* }}} */ - -/* {{{ proto array posix_getgroups(void) - Get supplementary group id's (POSIX.1, 4.2.3) */ -#ifdef HAVE_GETGROUPS -PHP_FUNCTION(posix_getgroups) -{ - gid_t gidlist[NGROUPS_MAX]; - int result; - int i; - - PHP_POSIX_NO_ARGS; - - if ((result = getgroups(NGROUPS_MAX, gidlist)) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - for (i=0; i<result; i++) { - add_next_index_long(return_value, gidlist[i]); - } -} -#endif -/* }}} */ - -/* {{{ proto string posix_getlogin(void) - Get user name (POSIX.1, 4.2.4) */ -#ifdef HAVE_GETLOGIN -PHP_FUNCTION(posix_getlogin) -{ - char *p; - - PHP_POSIX_NO_ARGS; - - if (NULL == (p = getlogin())) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_STRING(p, 1); -} -#endif -/* }}} */ - -/* {{{ proto int posix_getpgrp(void) - Get current process group id (POSIX.1, 4.3.1) */ -PHP_FUNCTION(posix_getpgrp) -{ - PHP_POSIX_RETURN_LONG_FUNC(getpgrp); -} -/* }}} */ - -/* {{{ proto int posix_setsid(void) - Create session and set process group id (POSIX.1, 4.3.2) */ -#ifdef HAVE_SETSID -PHP_FUNCTION(posix_setsid) -{ - PHP_POSIX_RETURN_LONG_FUNC(setsid); -} -#endif -/* }}} */ - -/* {{{ proto bool posix_setpgid(int pid, int pgid) - Set process group id for job control (POSIX.1, 4.3.3) */ -PHP_FUNCTION(posix_setpgid) -{ - long pid, pgid; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) { - RETURN_FALSE; - } - - if (setpgid(pid, pgid) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int posix_getpgid(void) - Get the process group id of the specified process (This is not a POSIX function, but a SVR4ism, so we compile conditionally) */ -#ifdef HAVE_GETPGID -PHP_FUNCTION(posix_getpgid) -{ - long val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) { - RETURN_FALSE; - } - - if ((val = getpgid(val)) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - RETURN_LONG(val); -} -#endif -/* }}} */ - -/* {{{ proto int posix_getsid(void) - Get process group id of session leader (This is not a POSIX function, but a SVR4ism, so be compile conditionally) */ -#ifdef HAVE_GETSID -PHP_FUNCTION(posix_getsid) -{ - long val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) { - RETURN_FALSE; - } - - if ((val = getsid(val)) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - RETURN_LONG(val); -} -#endif -/* }}} */ - -/* {{{ proto array posix_uname(void) - Get system name (POSIX.1, 4.4.1) */ -PHP_FUNCTION(posix_uname) -{ - struct utsname u; - - PHP_POSIX_NO_ARGS; - - if (uname(&u) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_string(return_value, "sysname", u.sysname, 1); - add_assoc_string(return_value, "nodename", u.nodename, 1); - add_assoc_string(return_value, "release", u.release, 1); - add_assoc_string(return_value, "version", u.version, 1); - add_assoc_string(return_value, "machine", u.machine, 1); -#ifdef _GNU_SOURCE - add_assoc_string(return_value, "domainname", u.domainname, 1); -#endif -} -/* }}} */ - -/* POSIX.1, 4.5.1 time() - Get System Time - already covered by PHP - */ - -/* {{{ proto array posix_times(void) - Get process times (POSIX.1, 4.5.2) */ -PHP_FUNCTION(posix_times) -{ - struct tms t; - clock_t ticks; - - PHP_POSIX_NO_ARGS; - - if((ticks = times(&t)) < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_long(return_value, "ticks", ticks); /* clock ticks */ - add_assoc_long(return_value, "utime", t.tms_utime); /* user time */ - add_assoc_long(return_value, "stime", t.tms_stime); /* system time */ - add_assoc_long(return_value, "cutime", t.tms_cutime); /* user time of children */ - add_assoc_long(return_value, "cstime", t.tms_cstime); /* system time of children */ -} -/* }}} */ - -/* POSIX.1, 4.6.1 getenv() - Environment Access - already covered by PHP -*/ - -/* {{{ proto string posix_ctermid(void) - Generate terminal path name (POSIX.1, 4.7.1) */ -#ifdef HAVE_CTERMID -PHP_FUNCTION(posix_ctermid) -{ - char buffer[L_ctermid]; - - PHP_POSIX_NO_ARGS; - - if (NULL == ctermid(buffer)) { - /* Found no documentation how the defined behaviour is when this - * function fails - */ - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_STRING(buffer, 1); -} -#endif -/* }}} */ - -/* Checks if the provides resource is a stream and if it provides a file descriptor */ -static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) -{ - php_stream *stream; - - php_stream_from_zval_no_verify(stream, &zfp); - - if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 1 to be a valid stream resource"); - return 0; - } - if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { - php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 0); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not use stream of type '%s'", - stream->ops->label); - return 0; - } - return 1; -} - -/* {{{ proto string posix_ttyname(int fd) - Determine terminal device name (POSIX.1, 4.7.2) */ -PHP_FUNCTION(posix_ttyname) -{ - zval *z_fd; - char *p; - int fd; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) { - RETURN_FALSE; - } - - switch (Z_TYPE_P(z_fd)) { - case IS_RESOURCE: - if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) { - RETURN_FALSE; - } - break; - default: - convert_to_long(z_fd); - fd = Z_LVAL_P(z_fd); - } - - if (NULL == (p = ttyname(fd))) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_STRING(p, 1); -} -/* }}} */ - -/* {{{ proto bool posix_isatty(int fd) - Determine if filedesc is a tty (POSIX.1, 4.7.1) */ -PHP_FUNCTION(posix_isatty) -{ - zval *z_fd; - int fd; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) { - RETURN_FALSE; - } - - switch (Z_TYPE_P(z_fd)) { - case IS_RESOURCE: - if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) { - RETURN_FALSE; - } - break; - default: - convert_to_long(z_fd); - fd = Z_LVAL_P(z_fd); - } - - if (isatty(fd)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* - POSIX.1, 4.8.1 sysconf() - TODO - POSIX.1, 5.7.1 pathconf(), fpathconf() - TODO - - POSIX.1, 5.1.2 opendir(), readdir(), rewinddir(), closedir() - POSIX.1, 5.2.1 chdir() - already supported by PHP - */ - -/* {{{ proto string posix_getcwd(void) - Get working directory pathname (POSIX.1, 5.2.2) */ -PHP_FUNCTION(posix_getcwd) -{ - char buffer[MAXPATHLEN]; - char *p; - - PHP_POSIX_NO_ARGS; - - p = VCWD_GETCWD(buffer, MAXPATHLEN); - if (!p) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_STRING(buffer, 1); -} -/* }}} */ - -/* - POSIX.1, 5.3.x open(), creat(), umask() - POSIX.1, 5.4.1 link() - already supported by PHP. - */ - -/* {{{ proto bool posix_mkfifo(string pathname, int mode) - Make a FIFO special file (POSIX.1, 5.4.2) */ -#ifdef HAVE_MKFIFO -PHP_FUNCTION(posix_mkfifo) -{ - char *path; - int path_len; - long mode; - int result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) { - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR))) { - RETURN_FALSE; - } - - result = mkfifo(path, mode); - if (result < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_TRUE; -} -#endif -/* }}} */ - -/* {{{ proto bool posix_mknod(string pathname, int mode [, int major [, int minor]]) - Make a special or ordinary file (POSIX.1) */ -#ifdef HAVE_MKNOD -PHP_FUNCTION(posix_mknod) -{ - char *path; - int path_len; - long mode; - long major, minor = 0; - int result; - dev_t php_dev; - - php_dev = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ll", &path, &path_len, - &mode, &major, &minor) == FAILURE) { - RETURN_FALSE; - } - - if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || - (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) { - RETURN_FALSE; - } - - if ((mode & S_IFCHR) || (mode & S_IFBLK)) { - if (major == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "expects argument 4 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK"); - RETURN_FALSE; - } else { -#if defined(HAVE_MAKEDEV) || defined(makedev) - php_dev = makedev(major, minor); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not create a block or character device, creating a normal file instead"); -#endif - } - } - - result = mknod(path, mode, php_dev); - if (result < 0) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_TRUE; -} -#endif -/* }}} */ - -/* Takes a pointer to posix group and a pointer to an already initialized ZVAL - * array container and fills the array with the posix group member data. */ -int php_posix_group_to_array(struct group *g, zval *array_group) { - zval *array_members; - int count; - - if (NULL == g) - return 0; - - if (array_group == NULL || Z_TYPE_P(array_group) != IS_ARRAY) - return 0; - - MAKE_STD_ZVAL(array_members); - array_init(array_members); - - add_assoc_string(array_group, "name", g->gr_name, 1); - add_assoc_string(array_group, "passwd", g->gr_passwd, 1); - for (count=0; g->gr_mem[count] != NULL; count++) { - add_next_index_string(array_members, g->gr_mem[count], 1); - } - zend_hash_update(Z_ARRVAL_P(array_group), "members", sizeof("members"), (void*)&array_members, sizeof(zval*), NULL); - add_assoc_long(array_group, "gid", g->gr_gid); - return 1; -} - -/* - POSIX.1, 5.5.1 unlink() - POSIX.1, 5.5.2 rmdir() - POSIX.1, 5.5.3 rename() - POSIX.1, 5.6.x stat(), chmod(), utime() already supported by PHP. -*/ - -/* {{{ proto bool posix_access(string file [, int mode]) - Determine accessibility of a file (POSIX.1 5.6.3) */ -PHP_FUNCTION(posix_access) -{ - long mode = 0; - int filename_len, ret; - char *filename, *path; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) { - RETURN_FALSE; - } - - path = expand_filepath(filename, NULL TSRMLS_CC); - - if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || - (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS)))) { - efree(path); - POSIX_G(last_error) = EPERM; - RETURN_FALSE; - } - - ret = access(path, mode); - efree(path); - - if (ret) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* - POSIX.1, 6.x most I/O functions already supported by PHP. - POSIX.1, 7.x tty functions, TODO - POSIX.1, 8.x interactions with other C language functions - POSIX.1, 9.x system database access -*/ - -/* {{{ proto array posix_getgrnam(string groupname) - Group database access (POSIX.1, 9.2.1) */ -PHP_FUNCTION(posix_getgrnam) -{ - char *name; - struct group *g; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - - if (NULL == (g = getgrnam(name))) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - if (!php_posix_group_to_array(g, return_value)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group to array"); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array posix_getgrgid(long gid) - Group database access (POSIX.1, 9.2.1) */ -PHP_FUNCTION(posix_getgrgid) -{ - long gid; - struct group *g; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) { - RETURN_FALSE; - } - - if (NULL == (g = getgrgid(gid))) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - if (!php_posix_group_to_array(g, return_value)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group struct to array"); - RETURN_FALSE; - } -} -/* }}} */ - -int php_posix_passwd_to_array(struct passwd *pw, zval *return_value) { - if (NULL == pw) - return 0; - if (NULL == return_value || Z_TYPE_P(return_value) != IS_ARRAY) - return 0; - - add_assoc_string(return_value, "name", pw->pw_name, 1); - add_assoc_string(return_value, "passwd", pw->pw_passwd, 1); - add_assoc_long (return_value, "uid", pw->pw_uid); - add_assoc_long (return_value, "gid", pw->pw_gid); - add_assoc_string(return_value, "gecos", pw->pw_gecos, 1); - add_assoc_string(return_value, "dir", pw->pw_dir, 1); - add_assoc_string(return_value, "shell", pw->pw_shell, 1); - return 1; -} - -/* {{{ proto array posix_getpwnam(string groupname) - User database access (POSIX.1, 9.2.2) */ -PHP_FUNCTION(posix_getpwnam) -{ - struct passwd *pw; - char *name; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - - if (NULL == (pw = getpwnam(name))) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - if (!php_posix_passwd_to_array(pw, return_value)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array"); - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ proto array posix_getpwuid(long uid) - User database access (POSIX.1, 9.2.2) */ -PHP_FUNCTION(posix_getpwuid) -{ - long uid; - struct passwd *pw; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) { - RETURN_FALSE; - } - - if (NULL == (pw = getpwuid(uid))) { - POSIX_G(last_error) = errno; - RETURN_FALSE; - } - - array_init(return_value); - - if (!php_posix_passwd_to_array(pw, return_value)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array"); - RETURN_FALSE; - } -} -/* }}} */ - - -#ifdef HAVE_GETRLIMIT - -#define UNLIMITED_STRING "unlimited" - -/* {{{ posix_addlimit - */ -static int posix_addlimit(int limit, char *name, zval *return_value TSRMLS_DC) { - int result; - struct rlimit rl; - char hard[80]; - char soft[80]; - - snprintf(hard, 80, "hard %s", name); - snprintf(soft, 80, "soft %s", name); - - result = getrlimit(limit, &rl); - if (result < 0) { - POSIX_G(last_error) = errno; - return FAILURE; - } - - if (rl.rlim_cur == RLIM_INFINITY) { - add_assoc_stringl(return_value, soft, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1, 1); - } else { - add_assoc_long(return_value, soft, rl.rlim_cur); - } - - if (rl.rlim_max == RLIM_INFINITY) { - add_assoc_stringl(return_value, hard, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1, 1); - } else { - add_assoc_long(return_value, hard, rl.rlim_max); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ limits[] - */ -struct limitlist { - int limit; - char *name; -} limits[] = { -#ifdef RLIMIT_CORE - { RLIMIT_CORE, "core" }, -#endif - -#ifdef RLIMIT_DATA - { RLIMIT_DATA, "data" }, -#endif - -#ifdef RLIMIT_STACK - { RLIMIT_STACK, "stack" }, -#endif - -#ifdef RLIMIT_VMEM - { RLIMIT_VMEM, "virtualmem" }, -#endif - -#ifdef RLIMIT_AS - { RLIMIT_AS, "totalmem" }, -#endif - -#ifdef RLIMIT_RSS - { RLIMIT_RSS, "rss" }, -#endif - -#ifdef RLIMIT_NPROC - { RLIMIT_NPROC, "maxproc" }, -#endif - -#ifdef RLIMIT_MEMLOCK - { RLIMIT_MEMLOCK, "memlock" }, -#endif - -#ifdef RLIMIT_CPU - { RLIMIT_CPU, "cpu" }, -#endif - -#ifdef RLIMIT_FSIZE - { RLIMIT_FSIZE, "filesize" }, -#endif - -#ifdef RLIMIT_NOFILE - { RLIMIT_NOFILE, "openfiles" }, -#endif - -#ifdef RLIMIT_OFILE - { RLIMIT_OFILE, "openfiles" }, -#endif - - { 0, NULL } -}; -/* }}} */ - - -/* {{{ proto array posix_getrlimit(void) - Get system resource consumption limits (This is not a POSIX function, but a BSDism and a SVR4ism. We compile conditionally) */ -PHP_FUNCTION(posix_getrlimit) -{ - struct limitlist *l = NULL; - - PHP_POSIX_NO_ARGS; - - array_init(return_value); - - for (l=limits; l->name; l++) { - if (posix_addlimit(l->limit, l->name, return_value TSRMLS_CC) == FAILURE) - RETURN_FALSE; - } -} -/* }}} */ - -#endif /* HAVE_GETRLIMIT */ - -/* {{{ proto int posix_get_last_error(void) - Retrieve the error number set by the last posix function which failed. */ -PHP_FUNCTION(posix_get_last_error) -{ - PHP_POSIX_NO_ARGS; - - RETURN_LONG(POSIX_G(last_error)); -} -/* }}} */ - -/* {{{ proto string posix_strerror(int errno) - Retrieve the system error message associated with the given errno. */ -PHP_FUNCTION(posix_strerror) -{ - long error; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) { - RETURN_FALSE; - } - - RETURN_STRING(strerror(error), 1); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/pspell/CREDITS b/ext/pspell/CREDITS deleted file mode 100644 index a7919d4b7c00d..0000000000000 --- a/ext/pspell/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Pspell -Vlad Krupin diff --git a/ext/pspell/README b/ext/pspell/README deleted file mode 100644 index 2e68a2cb9d333..0000000000000 --- a/ext/pspell/README +++ /dev/null @@ -1,51 +0,0 @@ -README file for pspell (spellchecker) module for PHP ----------------------------------------------------- - -The latest release of pspell is always available from - - http://aspell.net/ - -This module was developed and tested with aspell-.31.1 and pspell-.11.0.2, -although slightly earlier (and hopefully later) versions of those libraries -should work as well. - -General notes -------------- - -Please, note that somewhere around version .27.x (I believe) aspell stopped -working with the aspell module for php. This is due to the fact that the -author changed things around a bit, and suggested that people link to pspell -in the future rather than to aspell. That's exactly what this module is for. -It has the same basic functionality as aspell (and more features are being -added). I did not want to modify existing aspell module, because it would -break things for those who are using older aspell, or result in very ugly code. -Rather, I wrote a new module - pspell. - - -Building pspell on a Unix system --------------------------------- - -In order to use pspell, you need to have *both* aspell and pspell libraries -installed, and they have to be compatible with each other. Get the latest -release of both at the URL given above. - -I expect the libraries to be in /usr/local (that's the default when you -cofigure pspell and aspell with their 'configure' scripts woth no parameters). -If that location is different, please specify it in --with-pspell=PATH, where -PATH is the path you specified for pspell libraries. - -Notes on personalized dictionaries ----------------------------------- - -It is now possible to have personalized dictionaries with pspell. This is -achieved by opening a dictionary with pspell_new_personal() rather than -pspell_new() and specifying the custom dictionary as the first parameter. -The parameter probably should begin with '/' because otherwise it will -be relative to $HOME, which is probably set to "/root". This is probably not -what you want because you need write access for nobody to be able to write -to a dictionary. Once the dictionary is open, you can use -pspell_add_to_personal() to add words to the wordlist and finally -pspell_save_wordlist() to save it. - -Note that at this moment pspell_save_wordlist() will return TRUE, even if -there was an error. This will be changed once pspell library is fixed. \ No newline at end of file diff --git a/ext/pspell/config.m4 b/ext/pspell/config.m4 deleted file mode 100644 index 67e5b2760526d..0000000000000 --- a/ext/pspell/config.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(pspell,for PSPELL support, -[ --with-pspell[=DIR] Include PSPELL support. - GNU Aspell version 0.50.0 or higher required]) - -if test "$PHP_PSPELL" != "no"; then - PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared) - if test "$PHP_PSPELL" != "yes"; then - PSPELL_SEARCH_DIRS=$PHP_PSPELL - else - PSPELL_SEARCH_DIRS="/usr/local /usr" - fi - for i in $PSPELL_SEARCH_DIRS; do - if test -f $i/include/pspell/pspell.h; then - PSPELL_DIR=$i - PSPELL_INCDIR=$i/include/pspell - elif test -f $i/include/pspell.h; then - PSPELL_DIR=$i - PSPELL_INCDIR=$i/include - fi - done - - if test -z "$PSPELL_DIR"; then - AC_MSG_ERROR(Cannot find pspell) - fi - - PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR - - PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD) - - dnl Add -laspell to LIBS if it exists - PHP_CHECK_LIBRARY(aspell,new_aspell_config, - [ - PHP_ADD_LIBRARY_WITH_PATH(aspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD) - ], [], [ - -L$PSPELL_LIBDIR - ]) - - PHP_ADD_INCLUDE($PSPELL_INCDIR) - PHP_SUBST(PSPELL_SHARED_LIBADD) - AC_DEFINE(HAVE_PSPELL,1,[ ]) -fi diff --git a/ext/pspell/config.w32 b/ext/pspell/config.w32 deleted file mode 100644 index 741a4bc8f0e04..0000000000000 --- a/ext/pspell/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("pspell", "pspell/aspell (whatever it's called this month) support", "no"); - -if (PHP_PSPELL != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("pspell.h", "CFLAGS_PSPELL", PHP_PHP_BUILD + "\\include\\pspell;" + PHP_PSPELL) && - CHECK_LIB("aspell*.lib", "pspell", PHP_PSPELL)) { - EXTENSION('pspell', 'pspell.c'); - AC_DEFINE('HAVE_PSPELL', 1); - } else { - WARNING("pspell not enabled; libraries and headers not found"); - } -} - diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h deleted file mode 100644 index 8abd8c470ac55..0000000000000 --- a/ext/pspell/php_pspell.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Vlad Krupin <phpdevel@echospace.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _PSPELL_H -#define _PSPELL_H -#if HAVE_PSPELL -extern zend_module_entry pspell_module_entry; -#define pspell_module_ptr &pspell_module_entry - -PHP_MINIT_FUNCTION(pspell); -PHP_MINFO_FUNCTION(pspell); -PHP_FUNCTION(pspell_new); -PHP_FUNCTION(pspell_new_personal); -PHP_FUNCTION(pspell_new_config); -PHP_FUNCTION(pspell_check); -PHP_FUNCTION(pspell_suggest); -PHP_FUNCTION(pspell_store_replacement); -PHP_FUNCTION(pspell_add_to_personal); -PHP_FUNCTION(pspell_add_to_session); -PHP_FUNCTION(pspell_clear_session); -PHP_FUNCTION(pspell_save_wordlist); -PHP_FUNCTION(pspell_config_create); -PHP_FUNCTION(pspell_config_runtogether); -PHP_FUNCTION(pspell_config_mode); -PHP_FUNCTION(pspell_config_ignore); -PHP_FUNCTION(pspell_config_personal); -PHP_FUNCTION(pspell_config_dict_dir); -PHP_FUNCTION(pspell_config_data_dir); -PHP_FUNCTION(pspell_config_repl); -PHP_FUNCTION(pspell_config_save_repl); -#else -#define pspell_module_ptr NULL -#endif - -#define phpext_pspell_ptr pspell_module_ptr - -#endif /* _PSPELL_H */ diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c deleted file mode 100644 index b3376329631ca..0000000000000 --- a/ext/pspell/pspell.c +++ /dev/null @@ -1,900 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Vlad Krupin <phpdevel@echospace.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include <stdlib.h> -#include <ctype.h> -#include <stdio.h> - -#if HAVE_PSPELL - -/* this will enforce compatibility in .12 version (broken after .11.2) */ -#define USE_ORIGINAL_MANAGER_FUNCS - -#include "php_pspell.h" -#include <pspell.h> -#include "ext/standard/info.h" - -#define PSPELL_FAST 1L -#define PSPELL_NORMAL 2L -#define PSPELL_BAD_SPELLERS 3L -#define PSPELL_SPEED_MASK_INTERNAL 3L -#define PSPELL_RUN_TOGETHER 8L - -/* Largest ignored word can be 999 characters (this seems sane enough), - * and it takes 3 bytes to represent that (see pspell_config_ignore) - */ -#define PSPELL_LARGEST_WORD 3 - -/* {{{ pspell_functions[] - */ -function_entry pspell_functions[] = { - PHP_FE(pspell_new, NULL) - PHP_FE(pspell_new_personal, NULL) - PHP_FE(pspell_new_config, NULL) - PHP_FE(pspell_check, NULL) - PHP_FE(pspell_suggest, NULL) - PHP_FE(pspell_store_replacement, NULL) - PHP_FE(pspell_add_to_personal, NULL) - PHP_FE(pspell_add_to_session, NULL) - PHP_FE(pspell_clear_session, NULL) - PHP_FE(pspell_save_wordlist, NULL) - PHP_FE(pspell_config_create, NULL) - PHP_FE(pspell_config_runtogether, NULL) - PHP_FE(pspell_config_mode, NULL) - PHP_FE(pspell_config_ignore, NULL) - PHP_FE(pspell_config_personal, NULL) - PHP_FE(pspell_config_dict_dir, NULL) - PHP_FE(pspell_config_data_dir, NULL) - PHP_FE(pspell_config_repl, NULL) - PHP_FE(pspell_config_save_repl, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -static int le_pspell, le_pspell_config; - -zend_module_entry pspell_module_entry = { - STANDARD_MODULE_HEADER, - "pspell", pspell_functions, PHP_MINIT(pspell), NULL, NULL, NULL, PHP_MINFO(pspell), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_PSPELL -ZEND_GET_MODULE(pspell) -#endif - -static void php_pspell_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PspellManager *manager = (PspellManager *)rsrc->ptr; - - delete_pspell_manager(manager); -} - -static void php_pspell_close_config(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PspellConfig *config = (PspellConfig *)rsrc->ptr; - - delete_pspell_config(config); -} - -#define PSPELL_FETCH_CONFIG \ - convert_to_long_ex(conf); \ - config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type); \ - if (config == NULL || type != le_pspell_config) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(conf)); \ - RETURN_FALSE; \ - } \ - -#define PSPELL_FETCH_MANAGER \ - convert_to_long_ex(scin); \ - manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); \ - if (!manager || type != le_pspell) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin)); \ - RETURN_FALSE; \ - } \ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pspell) -{ - REGISTER_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("PSPELL_BAD_SPELLERS", PSPELL_BAD_SPELLERS, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("PSPELL_RUN_TOGETHER", PSPELL_RUN_TOGETHER, CONST_PERSISTENT | CONST_CS); - le_pspell = zend_register_list_destructors_ex(php_pspell_close, NULL, "pspell", module_number); - le_pspell_config = zend_register_list_destructors_ex(php_pspell_close_config, NULL, "pspell config", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ proto int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) - Load a dictionary */ -PHP_FUNCTION(pspell_new) -{ - zval **language,**spelling,**jargon,**encoding,**pmode; - long mode = 0L, speed = 0L; - int argc; - int ind; - -#ifdef PHP_WIN32 - TCHAR aspell_dir[200]; - TCHAR data_dir[220]; - TCHAR dict_dir[220]; - HKEY hkey; - DWORD dwType,dwLen; -#endif - - PspellCanHaveError *ret; - PspellManager *manager; - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 5 || zend_get_parameters_ex(argc,&language,&spelling,&jargon,&encoding,&pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - config = new_pspell_config(); - -#ifdef PHP_WIN32 - /* If aspell was installed using installer, we should have a key - * pointing to the location of the dictionaries - */ - if(0 == RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Aspell", &hkey)) { - RegQueryValueEx(hkey, "", NULL, &dwType, (LPBYTE)&aspell_dir, &dwLen); - RegCloseKey(hkey); - strcpy(data_dir, aspell_dir); - strcat(data_dir, "\\data"); - strcpy(dict_dir, aspell_dir); - strcat(dict_dir, "\\dict"); - - pspell_config_replace(config, "data-dir", data_dir); - pspell_config_replace(config, "dict-dir", dict_dir); - } -#endif - - convert_to_string_ex(language); - pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language)); - - if(argc > 1){ - convert_to_string_ex(spelling); - if(Z_STRLEN_PP(spelling) > 0){ - pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling)); - } - } - - if(argc > 2){ - convert_to_string_ex(jargon); - if(Z_STRLEN_PP(jargon) > 0){ - pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon)); - } - } - - if(argc > 3){ - convert_to_string_ex(encoding); - if(Z_STRLEN_PP(encoding) > 0){ - pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding)); - } - } - - if(argc > 4){ - convert_to_long_ex(pmode); - mode = Z_LVAL_PP(pmode); - speed = mode & PSPELL_SPEED_MASK_INTERNAL; - - /* First check what mode we want (how many suggestions) */ - if(speed == PSPELL_FAST){ - pspell_config_replace(config, "sug-mode", "fast"); - }else if(speed == PSPELL_NORMAL){ - pspell_config_replace(config, "sug-mode", "normal"); - }else if(speed == PSPELL_BAD_SPELLERS){ - pspell_config_replace(config, "sug-mode", "bad-spellers"); - } - - /* Then we see if run-together words should be treated as valid components */ - if(mode & PSPELL_RUN_TOGETHER){ - pspell_config_replace(config, "run-together", "true"); - } - } - - ret = new_pspell_manager(config); - delete_pspell_config(config); - - if(pspell_error_number(ret) != 0){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret)); - RETURN_FALSE; - } - - manager = to_pspell_manager(ret); - ind = zend_list_insert(manager, le_pspell); - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) - Load a dictionary with a personal wordlist*/ -PHP_FUNCTION(pspell_new_personal) -{ - zval **personal, **language,**spelling,**jargon,**encoding,**pmode; - long mode = 0L, speed = 0L; - int argc; - int ind; - -#ifdef PHP_WIN32 - TCHAR aspell_dir[200]; - TCHAR data_dir[220]; - TCHAR dict_dir[220]; - HKEY hkey; - DWORD dwType,dwLen; -#endif - - PspellCanHaveError *ret; - PspellManager *manager; - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 6 || zend_get_parameters_ex(argc,&personal,&language,&spelling,&jargon,&encoding,&pmode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - config = new_pspell_config(); - -#ifdef PHP_WIN32 - /* If aspell was installed using installer, we should have a key - * pointing to the location of the dictionaries - */ - if(0 == RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Aspell", &hkey)) { - RegQueryValueEx(hkey, "", NULL, &dwType, (LPBYTE)&aspell_dir, &dwLen); - RegCloseKey(hkey); - strcpy(data_dir, aspell_dir); - strcat(data_dir, "\\data"); - strcpy(dict_dir, aspell_dir); - strcat(dict_dir, "\\dict"); - - pspell_config_replace(config, "data-dir", data_dir); - pspell_config_replace(config, "dict-dir", dict_dir); - } -#endif - - convert_to_string_ex(personal); - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(personal), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(personal) TSRMLS_CC)) { - RETURN_FALSE; - } - - pspell_config_replace(config, "personal", Z_STRVAL_PP(personal)); - pspell_config_replace(config, "save-repl", "false"); - - convert_to_string_ex(language); - pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language)); - - if(argc > 2){ - convert_to_string_ex(spelling); - if(Z_STRLEN_PP(spelling) > 0){ - pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling)); - } - } - - if(argc > 3){ - convert_to_string_ex(jargon); - if(Z_STRLEN_PP(jargon) > 0){ - pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon)); - } - } - - if(argc > 4){ - convert_to_string_ex(encoding); - if(Z_STRLEN_PP(encoding) > 0){ - pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding)); - } - } - - if(argc > 5){ - convert_to_long_ex(pmode); - mode = Z_LVAL_PP(pmode); - speed = mode & PSPELL_SPEED_MASK_INTERNAL; - - /* First check what mode we want (how many suggestions) */ - if(speed == PSPELL_FAST){ - pspell_config_replace(config, "sug-mode", "fast"); - }else if(speed == PSPELL_NORMAL){ - pspell_config_replace(config, "sug-mode", "normal"); - }else if(speed == PSPELL_BAD_SPELLERS){ - pspell_config_replace(config, "sug-mode", "bad-spellers"); - } - - /* Then we see if run-together words should be treated as valid components */ - if(mode & PSPELL_RUN_TOGETHER){ - pspell_config_replace(config, "run-together", "true"); - } - } - - ret = new_pspell_manager(config); - delete_pspell_config(config); - - if(pspell_error_number(ret) != 0){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret)); - RETURN_FALSE; - } - - manager = to_pspell_manager(ret); - ind = zend_list_insert(manager, le_pspell); - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto int pspell_new_config(int config) - Load a dictionary based on the given config */ -PHP_FUNCTION(pspell_new_config) -{ - int type; - zval **conf; - int argc; - int ind; - - PspellCanHaveError *ret; - PspellManager *manager; - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 1 || zend_get_parameters_ex(argc,&conf) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - ret = new_pspell_manager(config); - - if(pspell_error_number(ret) != 0){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret)); - RETURN_FALSE; - } - - manager = to_pspell_manager(ret); - ind = zend_list_insert(manager, le_pspell); - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto bool pspell_check(int pspell, string word) - Returns true if word is valid */ -PHP_FUNCTION(pspell_check) -{ - int type; - zval **scin,**word; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(word); - - PSPELL_FETCH_MANAGER; - - if(pspell_manager_check(manager, Z_STRVAL_PP(word))){ - RETURN_TRUE; - }else{ - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array pspell_suggest(int pspell, string word) - Returns array of suggestions */ -PHP_FUNCTION(pspell_suggest) -{ - zval **scin, **word; - int argc; - PspellManager *manager; - int type; - const PspellWordList *wl; - const char *sug; - - argc = ZEND_NUM_ARGS(); - if(argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(word); - PSPELL_FETCH_MANAGER; - - array_init(return_value); - - wl = pspell_manager_suggest(manager, Z_STRVAL_PP(word)); - if(wl){ - PspellStringEmulation *els = pspell_word_list_elements(wl); - while((sug = pspell_string_emulation_next(els)) != 0){ - add_next_index_string(return_value,(char *)sug,1); - } - delete_pspell_string_emulation(els); - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL had a problem. details: %s ", pspell_manager_error_message(manager)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool pspell_store_replacement(int pspell, string misspell, string correct) - Notify the dictionary of a user-selected replacement */ -PHP_FUNCTION(pspell_store_replacement) -{ - int type; - zval **scin,**miss,**corr; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 3 || zend_get_parameters_ex(argc, &scin,&miss,&corr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(miss); - convert_to_string_ex(corr); - PSPELL_FETCH_MANAGER; - - pspell_manager_store_replacement(manager, Z_STRVAL_PP(miss), Z_STRVAL_PP(corr)); - if(pspell_manager_error_number(manager) == 0){ - RETURN_TRUE; - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool pspell_add_to_personal(int pspell, string word) - Adds a word to a personal list */ -PHP_FUNCTION(pspell_add_to_personal) -{ - int type; - zval **scin,**word; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(word); - PSPELL_FETCH_MANAGER; - - /*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/ - if(Z_STRLEN_PP(word) == 0){ - RETURN_FALSE; - } - - pspell_manager_add_to_personal(manager, Z_STRVAL_PP(word)); - if(pspell_manager_error_number(manager) == 0){ - RETURN_TRUE; - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool pspell_add_to_session(int pspell, string word) - Adds a word to the current session */ -PHP_FUNCTION(pspell_add_to_session) -{ - int type; - zval **scin,**word; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(word); - PSPELL_FETCH_MANAGER; - - /*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/ - if(Z_STRLEN_PP(word) == 0){ - RETURN_FALSE; - } - - pspell_manager_add_to_session(manager, Z_STRVAL_PP(word)); - if(pspell_manager_error_number(manager) == 0){ - RETURN_TRUE; - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool pspell_clear_session(int pspell) - Clears the current session */ -PHP_FUNCTION(pspell_clear_session) -{ - int type; - zval **scin; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 1 || zend_get_parameters_ex(argc, &scin) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_MANAGER; - - pspell_manager_clear_session(manager); - if(pspell_manager_error_number(manager) == 0){ - RETURN_TRUE; - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool pspell_save_wordlist(int pspell) - Saves the current (personal) wordlist */ -PHP_FUNCTION(pspell_save_wordlist) -{ - int type; - zval **scin; - PspellManager *manager; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 1 || zend_get_parameters_ex(argc, &scin) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_MANAGER; - - pspell_manager_save_all_word_lists(manager); - - if(pspell_manager_error_number(manager) == 0){ - RETURN_TRUE; - }else{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager)); - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ proto int pspell_config_create(string language [, string spelling [, string jargon [, string encoding]]]) - Create a new config to be used later to create a manager */ -PHP_FUNCTION(pspell_config_create) -{ - zval **language,**spelling,**jargon,**encoding; - int argc; - int ind; - - PspellConfig *config; - -#ifdef PHP_WIN32 - TCHAR aspell_dir[200]; - TCHAR data_dir[220]; - TCHAR dict_dir[220]; - HKEY hkey; - DWORD dwType,dwLen; -#endif - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 4 || zend_get_parameters_ex(argc,&language,&spelling,&jargon,&encoding) == FAILURE) { - WRONG_PARAM_COUNT; - } - - config = new_pspell_config(); - -#ifdef PHP_WIN32 - /* If aspell was installed using installer, we should have a key - * pointing to the location of the dictionaries - */ - if(0 == RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Aspell", &hkey)) { - RegQueryValueEx(hkey, "", NULL, &dwType, (LPBYTE)&aspell_dir, &dwLen); - RegCloseKey(hkey); - strcpy(data_dir, aspell_dir); - strcat(data_dir, "\\data"); - strcpy(dict_dir, aspell_dir); - strcat(dict_dir, "\\dict"); - - pspell_config_replace(config, "data-dir", data_dir); - pspell_config_replace(config, "dict-dir", dict_dir); - } -#endif - - convert_to_string_ex(language); - pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language)); - - if(argc > 1){ - convert_to_string_ex(spelling); - if(Z_STRLEN_PP(spelling) > 0){ - pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling)); - } - } - - if(argc > 2){ - convert_to_string_ex(jargon); - if(Z_STRLEN_PP(jargon) > 0){ - pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon)); - } - } - - if(argc > 3){ - convert_to_string_ex(encoding); - if(Z_STRLEN_PP(encoding) > 0){ - pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding)); - } - } - - /* By default I do not want to write anything anywhere because it'll try to write to $HOME - which is not what we want */ - pspell_config_replace(config, "save-repl", "false"); - - ind = zend_list_insert(config, le_pspell_config); - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto bool pspell_config_runtogether(int conf, bool runtogether) - Consider run-together words as valid components */ -PHP_FUNCTION(pspell_config_runtogether) -{ - int type; - zval **conf, **runtogether; - int argc; - - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc,&conf,&runtogether) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - convert_to_boolean_ex(runtogether); - pspell_config_replace(config, "run-together", Z_LVAL_PP(runtogether) ? "true" : "false"); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool pspell_config_mode(int conf, long mode) - Select mode for config (PSPELL_FAST, PSPELL_NORMAL or PSPELL_BAD_SPELLERS) */ -PHP_FUNCTION(pspell_config_mode) -{ - int type; - zval **conf, **mode; - int argc; - - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc,&conf,&mode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - convert_to_long_ex(mode); - - /* First check what mode we want (how many suggestions) */ - if(Z_LVAL_PP(mode) == PSPELL_FAST){ - pspell_config_replace(config, "sug-mode", "fast"); - }else if(Z_LVAL_PP(mode) == PSPELL_NORMAL){ - pspell_config_replace(config, "sug-mode", "normal"); - }else if(Z_LVAL_PP(mode) == PSPELL_BAD_SPELLERS){ - pspell_config_replace(config, "sug-mode", "bad-spellers"); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool pspell_config_ignore(int conf, int ignore) - Ignore words <= n chars */ -PHP_FUNCTION(pspell_config_ignore) -{ - int type; - zval **conf, **pignore; - int argc; - - int loc = PSPELL_LARGEST_WORD; - char ignore_str[PSPELL_LARGEST_WORD + 1]; - long ignore = 0L; - - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc,&conf,&pignore) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - convert_to_long_ex(pignore); - ignore = Z_LVAL_PP(pignore); - - /* The following is a very hackish way to convert a long to a string - (actually only the numbers 0-999 will get converted properly, but that should - be sufficient). If anyone knows of a better way to convert an integer to a string, - please, fix it.*/ - ignore_str[loc] = '\0'; - while(ignore > 0){ - if(loc == 0){ - break; - } - ignore_str[--loc] = '0' + (ignore % 10); - ignore /= 10; - } - if(ignore_str[loc] == '\0'){ - ignore_str[--loc] = '0'; - } - - pspell_config_replace(config, "ignore", &ignore_str[loc]); - RETURN_TRUE; -} -/* }}} */ - -static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option) -{ - int type; - zval **conf, **value; - int argc; - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &conf, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - convert_to_string_ex(value); - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(value), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(value) TSRMLS_CC)) { - RETURN_FALSE; - } - - pspell_config_replace(config, option, Z_STRVAL_PP(value)); - - RETURN_TRUE; -} - -/* {{{ proto bool pspell_config_personal(int conf, string personal) - Use a personal dictionary for this config */ -PHP_FUNCTION(pspell_config_personal) -{ - pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "personal"); -} -/* }}} */ - -/* {{{ proto bool pspell_config_dict_dir(int conf, string directory) - location of the main word list */ -PHP_FUNCTION(pspell_config_dict_dir) -{ - pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "dict-dir"); -} -/* }}} */ - -/* {{{ proto bool pspell_config_data_dir(int conf, string directory) - location of language data files */ -PHP_FUNCTION(pspell_config_data_dir) -{ - pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "data-dir"); -} -/* }}} */ - -/* {{{ proto bool pspell_config_repl(int conf, string repl) - Use a personal dictionary with replacement pairs for this config */ -PHP_FUNCTION(pspell_config_repl) -{ - int type; - zval **conf, **repl; - int argc; - - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc,&conf,&repl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - pspell_config_replace(config, "save-repl", "true"); - - convert_to_string_ex(repl); - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(repl), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(repl) TSRMLS_CC)) { - RETURN_FALSE; - } - - pspell_config_replace(config, "repl", Z_STRVAL_PP(repl)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool pspell_config_save_repl(int conf, bool save) - Save replacement pairs when personal list is saved for this config */ -PHP_FUNCTION(pspell_config_save_repl) -{ - int type; - zval **conf, **save; - int argc; - - PspellConfig *config; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc,&conf,&save) == FAILURE) { - WRONG_PARAM_COUNT; - } - - PSPELL_FETCH_CONFIG; - - convert_to_boolean_ex(save); - pspell_config_replace(config, "save-repl", Z_LVAL_PP(save) ? "true" : "false"); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(pspell) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "PSpell Support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/pspell/pspell.dsp b/ext/pspell/pspell.dsp deleted file mode 100644 index f310099d89a3e..0000000000000 --- a/ext/pspell/pspell.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pspell" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=pspell - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pspell.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pspell.mak" CFG="pspell - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pspell - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pspell - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pspell - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pspell___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "pspell___Win32_Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell." /D ZEND_DEBUG=1 /D "_DEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" -# ADD LINK32 php5ts_debug.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\aspell\lib" - -!ELSEIF "$(CFG)" == "pspell - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pspell___Win32_Release_TS" -# PROP BASE Intermediate_Dir "pspell___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell" /D ZEND_DEBUG=0 /D "NDEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_pspell.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\aspell\lib" - -!ENDIF - -# Begin Target - -# Name "pspell - Win32 Debug_TS" -# Name "pspell - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\pspell.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_pspell.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/pspell/tests/01pspell_basic.phpt b/ext/pspell/tests/01pspell_basic.phpt deleted file mode 100644 index 1cfb68448598b..0000000000000 --- a/ext/pspell/tests/01pspell_basic.phpt +++ /dev/null @@ -1,116 +0,0 @@ ---TEST-- -pspell basic tests (warning: may fail with pspell/aspell < GNU Aspell 0.50.3) ---SKIPIF-- -<?php - if (!extension_loaded("pspell")) print "skip"; - if (!@pspell_new ("en", "", "", "", (PSPELL_FAST|PSPELL_RUN_TOGETHER))) { - die("skip English dictionary is not available"); - } -?> ---FILE-- -<?php // $Id$ - -error_reporting(E_ALL); -$string = ""; -$string .= "I will not buy this record, it is scratched. "; -$string .= "Sorry "; -$string .= "I will not buy this record, it is scratched. "; -$string .= "Uh, no, no, no. This is a tobacconist's "; -$string .= "Ah! I will not buy this tobacconist's, it is scratched. "; -$string .= "No, no, no, no. Tobacco... um... cigarettes (holds up a pack). "; -$string .= "Ya! See-gar-ets! Ya! Uh... My hovercraft is full of eels. "; -$string .= "Sorry? "; -$string .= "My hovercraft (pantomimes puffing a cigarette)... is full of eels (pretends to strike a match). "; -$string .= "Ahh, matches!"; - -$pspell = pspell_new ("en", "", "", "", (PSPELL_FAST|PSPELL_RUN_TOGETHER)); -$array = explode(' ',preg_replace('/[^a-zA-Z0-9 ]/','',$string)); -for($i=0,$u=count($array);$i<$u;++$i) { - echo $array[$i].' : '; - if (!pspell_check($pspell, $array[$i])) { - echo "..false\n"; - echo "Possible spellings: " . join(',',pspell_suggest ($pspell, $array[$i])) . "\n"; - } else { - echo "true\n"; - } -} -?> ---EXPECTF-- -I : true -will : true -not : true -buy : true -this : true -record : true -it : true -is : true -scratched : true -Sorry : true -I : true -will : true -not : true -buy : true -this : true -record : true -it : true -is : true -scratched : true -Uh : true -no : true -no : true -no : true -This : true -is : true -a : true -tobacconists : true -Ah : true -I : true -will : true -not : true -buy : true -this : true -tobacconists : true -it : true -is : true -scratched : true -No : true -no : true -no : true -no : true -Tobacco : true -um : true -cigarettes : true -holds : true -up : true -a : true -pack : true -Ya : true -Seegarets : ..false -Possible spellings:%s,Regrets,%s,Cigarettes,%s -Ya : true -Uh : true -My : true -hovercraft : true -is : true -full : true -of : true -eels : true -Sorry : true -My : true -hovercraft : true -pantomimes : true -puffing : true -a : true -cigarette : true -is : true -full : true -of : true -eels : true -pretends : true -to : true -strike : true -a : true -match : true -Ahh : ..false -Possible spellings:%sAh,Aha,%s -matches : true diff --git a/ext/readline/CREDITS b/ext/readline/CREDITS deleted file mode 100644 index 02e44a44d4334..0000000000000 --- a/ext/readline/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Readline -Thies C. Arntzen diff --git a/ext/readline/README.libedit b/ext/readline/README.libedit deleted file mode 100644 index a19371056e4de..0000000000000 --- a/ext/readline/README.libedit +++ /dev/null @@ -1,4 +0,0 @@ -This library can be built with libedit - non-GPL drop-in readline replacement. -Libedit can be obtained from http://sourceforge.net/projects/libedit/ -It is taken from NetBSD (http://www.netbsd.org/) CVS repository and modified -to work as stand-alone library. diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 deleted file mode 100644 index 818eb27722d4c..0000000000000 --- a/ext/readline/config.m4 +++ /dev/null @@ -1,98 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(libedit,for libedit readline replacement, -[ --with-libedit[=DIR] Include libedit readline replacement (CLI/CGI only)]) - -PHP_ARG_WITH(readline,for readline support, -[ --with-readline[=DIR] Include readline support (CLI/CGI only)]) - -if test "$PHP_READLINE" != "no"; then - for i in $PHP_READLINE /usr/local /usr; do - test -f $i/include/readline/readline.h && READLINE_DIR=$i && break - done - - if test -z "$READLINE_DIR"; then - AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h) - fi - - PHP_ADD_INCLUDE($READLINE_DIR/include) - - PHP_READLINE_LIBS="" - AC_CHECK_LIB(ncurses, tgetent, - [ - PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) - PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses" - ],[ - AC_CHECK_LIB(termcap, tgetent, - [ - PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) - PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap" - ]) - ]) - - PHP_CHECK_LIBRARY(readline, readline, - [ - PHP_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD) - ], [ - AC_MSG_ERROR(readline library not found) - ], [ - -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS - ]) - - PHP_CHECK_LIBRARY(readline, rl_callback_read_char, - [ - AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ]) - ],[],[ - -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS - ]) - - PHP_CHECK_LIBRARY(history, add_history, - [ - PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD) - ], [ - AC_MSG_ERROR(history library required by readline not found) - ], [ - -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS - ]) - - PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) - PHP_SUBST(READLINE_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBREADLINE, 1, [ ]) - -elif test "$PHP_LIBEDIT" != "no"; then - - for i in $PHP_LIBEDIT /usr/local /usr; do - test -f $i/include/readline/readline.h && LIBEDIT_DIR=$i && break - done - - if test -z "$LIBEDIT_DIR"; then - AC_MSG_ERROR(Please reinstall libedit - I cannot find readline.h) - fi - - PHP_ADD_INCLUDE($LIBEDIT_DIR/include) - - AC_CHECK_LIB(ncurses, tgetent, - [ - PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) - ],[ - AC_CHECK_LIB(termcap, tgetent, - [ - PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) - ]) - ]) - - PHP_CHECK_LIBRARY(edit, readline, - [ - PHP_ADD_LIBRARY_WITH_PATH(edit, $LIBEDIT_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD) - ], [ - AC_MSG_ERROR(edit library required by readline not found) - ], [ - -L$READLINE_DIR/$PHP_LIBDIR - ]) - - PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) - PHP_SUBST(READLINE_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBEDIT, 1, [ ]) -fi diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h deleted file mode 100644 index fb4d62c2c509d..0000000000000 --- a/ext/readline/php_readline.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen <thies@thieso.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_READLINE_H -#define PHP_READLINE_H - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT -#ifdef ZTS -#warning Readline module will *NEVER* be thread-safe -#endif - -extern zend_module_entry readline_module_entry; -#define phpext_readline_ptr &readline_module_entry - -#else - -#define phpext_readline_ptr NULL - -#endif /* HAVE_LIBREADLINE */ - -#endif /* PHP_READLINE_H */ - diff --git a/ext/readline/readline.c b/ext/readline/readline.c deleted file mode 100644 index 8dbfb46157c86..0000000000000 --- a/ext/readline/readline.c +++ /dev/null @@ -1,574 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen <thies@thieso.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* {{{ includes & prototypes */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_readline.h" - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT - -#include <readline/readline.h> -#ifndef HAVE_LIBEDIT -#include <readline/history.h> -#endif - -PHP_FUNCTION(readline); -PHP_FUNCTION(readline_add_history); -PHP_FUNCTION(readline_info); -PHP_FUNCTION(readline_clear_history); -#ifndef HAVE_LIBEDIT -PHP_FUNCTION(readline_list_history); -#endif -PHP_FUNCTION(readline_read_history); -PHP_FUNCTION(readline_write_history); -PHP_FUNCTION(readline_completion_function); - -#if HAVE_RL_CALLBACK_READ_CHAR -PHP_FUNCTION(readline_callback_handler_install); -PHP_FUNCTION(readline_callback_read_char); -PHP_FUNCTION(readline_callback_handler_remove); -PHP_FUNCTION(readline_redisplay); -PHP_FUNCTION(readline_on_new_line); - -static zval *_prepped_callback = NULL; - -#endif - -static zval *_readline_completion = NULL; -static zval _readline_array; - -PHP_MINIT_FUNCTION(readline); -PHP_RSHUTDOWN_FUNCTION(readline); - -/* }}} */ -/* {{{ module stuff */ - -static zend_function_entry php_readline_functions[] = { - PHP_FE(readline, NULL) - PHP_FE(readline_info, NULL) - PHP_FE(readline_add_history, NULL) - PHP_FE(readline_clear_history, NULL) -#ifndef HAVE_LIBEDIT - PHP_FE(readline_list_history, NULL) -#endif - PHP_FE(readline_read_history, NULL) - PHP_FE(readline_write_history, NULL) - PHP_FE(readline_completion_function,NULL) -#if HAVE_RL_CALLBACK_READ_CHAR - PHP_FE(readline_callback_handler_install, NULL) - PHP_FE(readline_callback_read_char, NULL) - PHP_FE(readline_callback_handler_remove, NULL) - PHP_FE(readline_redisplay, NULL) - PHP_FE(readline_on_new_line, NULL) -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry readline_module_entry = { - STANDARD_MODULE_HEADER, - "readline", - php_readline_functions, - PHP_MINIT(readline), - NULL, - NULL, - PHP_RSHUTDOWN(readline), - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_READLINE -ZEND_GET_MODULE(readline) -#endif - -PHP_MINIT_FUNCTION(readline) -{ - using_history(); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(readline) -{ - if (_readline_completion) - FREE_ZVAL(_readline_completion); -#if HAVE_RL_CALLBACK_READ_CHAR - if (_prepped_callback) { - rl_callback_handler_remove(); - FREE_ZVAL(_prepped_callback); - _prepped_callback = 0; - } -#endif - - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto string readline([string prompt]) - Reads a line */ -PHP_FUNCTION(readline) -{ - char *prompt = NULL; - int prompt_len; - char *result; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &prompt, &prompt_len)) { - RETURN_FALSE; - } - - result = readline(prompt); - - if (! result) { - RETURN_FALSE; - } else { - RETVAL_STRING(result,1); - free(result); - } -} - -/* }}} */ - -/* {{{ proto mixed readline_info([string varname] [, string newvalue]) - Gets/sets various internal readline variables. */ - -#define SAFE_STRING(s) ((s)?(char*)(s):"") - -PHP_FUNCTION(readline_info) -{ - zval **what; - zval **value; - int oldval; - char *oldstr; - int ac = ZEND_NUM_ARGS(); - - if (ac < 0 || ac > 2 || zend_get_parameters_ex(ac, &what, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (ac == 0) { - array_init(return_value); - add_assoc_string(return_value,"line_buffer",SAFE_STRING(rl_line_buffer),1); - add_assoc_long(return_value,"point",rl_point); - add_assoc_long(return_value,"end",rl_end); -#ifdef HAVE_LIBREADLINE - add_assoc_long(return_value,"mark",rl_mark); - add_assoc_long(return_value,"done",rl_done); - add_assoc_long(return_value,"pending_input",rl_pending_input); - add_assoc_string(return_value,"prompt",SAFE_STRING(rl_prompt),1); - add_assoc_string(return_value,"terminal_name",(char *)SAFE_STRING(rl_terminal_name),1); -#endif -#if HAVE_ERASE_EMPTY_LINE - add_assoc_long(return_value,"erase_empty_line",rl_erase_empty_line); -#endif - add_assoc_string(return_value,"library_version",(char *)SAFE_STRING(rl_library_version),1); - add_assoc_string(return_value,"readline_name",(char *)SAFE_STRING(rl_readline_name),1); - } else { - convert_to_string_ex(what); - - if (! strcasecmp(Z_STRVAL_PP(what),"line_buffer")) { - oldstr = rl_line_buffer; - if (ac == 2) { - /* XXX if (rl_line_buffer) free(rl_line_buffer); */ - convert_to_string_ex(value); - rl_line_buffer = strdup(Z_STRVAL_PP(value)); - } - RETVAL_STRING(SAFE_STRING(oldstr),1); - } else if (! strcasecmp(Z_STRVAL_PP(what),"point")) { - RETVAL_LONG(rl_point); - } else if (! strcasecmp(Z_STRVAL_PP(what),"end")) { - RETVAL_LONG(rl_end); -#ifdef HAVE_LIBREADLINE - } else if (! strcasecmp(Z_STRVAL_PP(what),"mark")) { - RETVAL_LONG(rl_mark); - } else if (! strcasecmp(Z_STRVAL_PP(what),"done")) { - oldval = rl_done; - if (ac == 2) { - convert_to_long_ex(value); - rl_done = Z_LVAL_PP(value); - } - RETVAL_LONG(oldval); - } else if (! strcasecmp(Z_STRVAL_PP(what),"pending_input")) { - oldval = rl_pending_input; - if (ac == 2) { - convert_to_string_ex(value); - rl_pending_input = Z_STRVAL_PP(value)[0]; - } - RETVAL_LONG(oldval); - } else if (! strcasecmp(Z_STRVAL_PP(what),"prompt")) { - RETVAL_STRING(SAFE_STRING(rl_prompt),1); - } else if (! strcasecmp(Z_STRVAL_PP(what),"terminal_name")) { - RETVAL_STRING((char *)SAFE_STRING(rl_terminal_name),1); -#endif -#if HAVE_ERASE_EMPTY_LINE - } else if (! strcasecmp(Z_STRVAL_PP(what),"erase_empty_line")) { - oldval = rl_erase_empty_line; - if (ac == 2) { - convert_to_long_ex(value); - rl_erase_empty_line = Z_LVAL_PP(value); - } - RETVAL_LONG(oldval); -#endif - } else if (! strcasecmp(Z_STRVAL_PP(what),"library_version")) { - RETVAL_STRING((char *)SAFE_STRING(rl_library_version),1); - } else if (! strcasecmp(Z_STRVAL_PP(what),"readline_name")) { - oldstr = (char*)rl_readline_name; - if (ac == 2) { - /* XXX if (rl_readline_name) free(rl_readline_name); */ - convert_to_string_ex(value); - rl_readline_name = strdup(Z_STRVAL_PP(value));; - } - RETVAL_STRING(SAFE_STRING(oldstr),1); - } - } -} - -/* }}} */ -/* {{{ proto bool readline_add_history([string prompt]) - Adds a line to the history */ -PHP_FUNCTION(readline_add_history) -{ - pval **arg; - int ac = ZEND_NUM_ARGS(); - - if (ac != 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg); - - add_history(Z_STRVAL_PP(arg)); - - RETURN_TRUE; -} - -/* }}} */ -/* {{{ proto bool readline_clear_history(void) - Clears the history */ -PHP_FUNCTION(readline_clear_history) -{ - int ac = ZEND_NUM_ARGS(); - - if (ac != 0) { - WRONG_PARAM_COUNT; - } - - clear_history(); - - RETURN_TRUE; -} - -/* }}} */ -/* {{{ proto array readline_list_history(void) - Lists the history */ -#ifndef HAVE_LIBEDIT -PHP_FUNCTION(readline_list_history) -{ - HIST_ENTRY **history; - int ac = ZEND_NUM_ARGS(); - - if (ac) { - WRONG_PARAM_COUNT; - } - - history = history_list(); - - array_init(return_value); - - if (history) { - int i; - for (i = 0; history[i]; i++) { - add_next_index_string(return_value,history[i]->line,1); - } - } -} -#endif -/* }}} */ -/* {{{ proto bool readline_read_history([string filename] [, int from] [,int to]) - Reads the history */ -PHP_FUNCTION(readline_read_history) -{ - pval **arg; - char *filename = NULL; - int ac = ZEND_NUM_ARGS(); - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - /* XXX from & to NYI */ - - if (ac == 1) { - convert_to_string_ex(arg); - filename = Z_STRVAL_PP(arg); - } - - if (read_history(filename)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} - -/* }}} */ -/* {{{ proto bool readline_write_history([string filename]) - Writes the history */ -PHP_FUNCTION(readline_write_history) -{ - pval **arg; - char *filename = NULL; - int ac = ZEND_NUM_ARGS(); - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (ac == 1) { - convert_to_string_ex(arg); - filename = Z_STRVAL_PP(arg); - } - - if (write_history(filename)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} - -/* }}} */ -/* {{{ proto bool readline_completion_function(string funcname) - Readline completion function? */ - -static char *_readline_command_generator(char *text,int state) -{ - HashTable *myht = Z_ARRVAL(_readline_array); - zval **entry; - - if (! state) { - zend_hash_internal_pointer_reset(myht); - } - - while (zend_hash_get_current_data(myht, (void **)&entry) == SUCCESS) { - zend_hash_move_forward(myht); - - convert_to_string_ex(entry); - if (strncmp (Z_STRVAL_PP(entry), text, strlen(text)) == 0) { - return (strdup(Z_STRVAL_PP(entry))); - } - } - - return NULL; -} - -static zval *_readline_string_zval(const char *str) -{ - zval *ret; - int len; - - MAKE_STD_ZVAL(ret); - - if (str) { - len = strlen(str); - ZVAL_STRINGL(ret, (char*)str, len, 1); - } else { - ZVAL_NULL(ret); - } - - return ret; -} - -static zval *_readline_long_zval(long l) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - - Z_TYPE_P(ret) = IS_LONG; - Z_LVAL_P(ret) = l; - return ret; -} - -static char **_readline_completion_cb(const char *text, int start, int end) -{ - zval *params[3]; - int i; - char **matches = NULL; - TSRMLS_FETCH(); - - params[0]=_readline_string_zval(text); - params[1]=_readline_long_zval(start); - params[2]=_readline_long_zval(end); - - if (call_user_function(CG(function_table), NULL, _readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) { - if (Z_TYPE(_readline_array) == IS_ARRAY) { - if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) { - matches = completion_matches(text,_readline_command_generator); - } else { - matches = malloc(sizeof(char *) * 2); - matches[0] = strdup(""); - matches[1] = '\0'; - } - } - } - - for (i = 0; i < 3; i++) { - zval_ptr_dtor(¶ms[i]); - } - zval_dtor(&_readline_array); - - return matches; -} - -PHP_FUNCTION(readline_completion_function) -{ - zval *arg = NULL; - zval name; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg)) { - RETURN_FALSE; - } - - if (!zend_is_callable(arg, 0, &name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not callable", Z_TYPE(name), Z_UNIVAL(name)); - zval_dtor(&name); - RETURN_FALSE; - } - zval_dtor(&name); - - if (_readline_completion) - FREE_ZVAL(_readline_completion); - - MAKE_STD_ZVAL(_readline_completion); - *_readline_completion = *arg; - zval_copy_ctor(_readline_completion); - - rl_attempted_completion_function = _readline_completion_cb; - - RETURN_TRUE; -} - -/* }}} */ - -#if HAVE_RL_CALLBACK_READ_CHAR - -static void php_rl_callback_handler(char *the_line) -{ - zval *params[1]; - zval dummy; - TSRMLS_FETCH(); - - ZVAL_NULL(&dummy); - - params[0] = _readline_string_zval(the_line); - - call_user_function(CG(function_table), NULL, _prepped_callback, &dummy, 1, params TSRMLS_CC); - - zval_ptr_dtor(¶ms[0]); - zval_dtor(&dummy); -} - -/* {{{ proto void readline_callback_handler_install(string prompt, mixed callback) - Initializes the readline callback interface and terminal, prints the prompt and returns immediately */ -PHP_FUNCTION(readline_callback_handler_install) -{ - zval *callback; - zval name; - char *prompt; - int prompt_len; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &prompt, &prompt_len, &callback)) { - return; - } - - if (!zend_is_callable(callback, 0, &name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not callable", Z_TYPE(name), Z_UNIVAL(name)); - zval_dtor(&name); - RETURN_FALSE; - } - zval_dtor(&name); - - if (_prepped_callback) { - rl_callback_handler_remove(); - FREE_ZVAL(_prepped_callback); - } - - MAKE_STD_ZVAL(_prepped_callback); - *_prepped_callback = *callback; - zval_copy_ctor(_prepped_callback); - - rl_callback_handler_install(prompt, php_rl_callback_handler); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void readline_callback_read_char() - Informs the readline callback interface that a character is ready for input */ -PHP_FUNCTION(readline_callback_read_char) -{ - if (_prepped_callback) { - rl_callback_read_char(); - } -} -/* }}} */ - -/* {{{ proto bool readline_callback_handler_remove() - Removes a previously installed callback handler and restores terminal settings */ -PHP_FUNCTION(readline_callback_handler_remove) -{ - if (_prepped_callback) { - rl_callback_handler_remove(); - FREE_ZVAL(_prepped_callback); - _prepped_callback = 0; - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto void readline_redisplay(void) - Ask readline to redraw the display */ -PHP_FUNCTION(readline_redisplay) -{ - rl_redisplay(); -} -/* }}} */ - -/* {{{ proto void readline_on_new_line(void) - Inform readline that the cursor has moved to a new line */ -PHP_FUNCTION(readline_on_new_line) -{ - rl_on_new_line(); -} -/* }}} */ - -#endif - - -#endif /* HAVE_LIBREADLINE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/recode/CREDITS b/ext/recode/CREDITS deleted file mode 100644 index 2b07813086af0..0000000000000 --- a/ext/recode/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Recode -Kristian Köhntopp diff --git a/ext/recode/config.m4 b/ext/recode/config.m4 deleted file mode 100644 index 8df4cfc41a0fe..0000000000000 --- a/ext/recode/config.m4 +++ /dev/null @@ -1,64 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(recode,for recode support, -[ --with-recode[=DIR] Include recode support]) - -if test "$PHP_RECODE" != "no"; then - RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" - - for i in $RECODE_LIST; do - if test -f $i/include/recode.h; then - RECODE_DIR=$i - RECODE_INC=include - RECODE_LIB=$PHP_LIBDIR - fi - if test -f $i/include/recode/recode.h; then - RECODE_DIR=$i - RECODE_INC=include/recode - RECODE_LIB=$PHP_LIBDIR/recode - fi - if test -f $i/recode/include/recode.h; then - RECODE_DIR=$i/recode - RECODE_INC=include - RECODE_LIB=$PHP_LIBDIR - fi - test -n "$RECODE_DIR" && break - done - - if test -z "$RECODE_DIR"; then - AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.]) - fi - - PHP_CHECK_LIBRARY(recode, recode_format_table, - [ - PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) - ], [ - old_LDFLAGS=$LDFLAGS - old_LIBS=$LIBS - LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" - LIBS="$LIBS -lrecode" - AC_TRY_LINK( - [ -char *program_name; - ],[ -recode_format_table(); - ],[ - PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) - AC_DEFINE(HAVE_BROKEN_RECODE, 1, [Whether we have librecode 3.5]) - ],[ - AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) - ]) - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - ], [ - -L$RECODE_DIR/$RECODE_LIB - ]) - - AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) - PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) - PHP_SUBST(RECODE_SHARED_LIBADD) - AC_CHECK_HEADERS(stdbool.h) - PHP_NEW_EXTENSION(recode, recode.c, $ext_shared) -fi diff --git a/ext/recode/config9.m4 b/ext/recode/config9.m4 deleted file mode 100644 index 2065f6c6e9051..0000000000000 --- a/ext/recode/config9.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl Check for extensions with which Recode can not work -if test "$PHP_RECODE" != "no"; then - test "$PHP_IMAP" != "no" && recode_conflict="$recode_conflict imap" - test "$PHP_MYSQL" != "no" && recode_conflict="$recode_conflict mysql" - - if test -n "$recode_conflict"; then - AC_MSG_ERROR([recode extension can not be configured together with:$recode_conflict]) - fi -fi diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h deleted file mode 100644 index 64576a573d2ca..0000000000000 --- a/ext/recode/php_recode.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kristian Koehntopp <kris@koehntopp.de> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_RECODE_H -#define PHP_RECODE_H - -#if HAVE_LIBRECODE - -extern zend_module_entry recode_module_entry; -#define phpext_recode_ptr &recode_module_entry - -PHP_MINIT_FUNCTION(recode); -PHP_MSHUTDOWN_FUNCTION(recode); -PHP_MINFO_FUNCTION(recode); -PHP_FUNCTION(recode_string); -PHP_FUNCTION(recode_file); - -#else -#define phpext_recode_ptr NULL -#endif - -#endif /* PHP_RECODE_H */ diff --git a/ext/recode/recode.c b/ext/recode/recode.c deleted file mode 100644 index a076cae3332f8..0000000000000 --- a/ext/recode/recode.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kristian Koehntopp <kris@koehntopp.de> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes & prototypes */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_streams.h" - -#if HAVE_LIBRECODE - -/* For recode 3.5 */ -#if HAVE_BROKEN_RECODE -extern char *program_name; -char *program_name = "php"; -#endif - -#ifdef HAVE_STDBOOL_H -# include <stdbool.h> -#else - typedef enum {false = 0, true = 1} bool; -#endif - -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> -#include <recode.h> - -#include "php_recode.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" - -/* }}} */ - -ZEND_BEGIN_MODULE_GLOBALS(recode) - RECODE_OUTER outer; -ZEND_END_MODULE_GLOBALS(recode) - -#ifdef ZTS -# define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v) -#else -# define ReSG(v) (recode_globals.v) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(recode); - -/* {{{ module stuff */ -static zend_function_entry php_recode_functions[] = { - PHP_FE(recode_string, NULL) - PHP_FE(recode_file, NULL) - PHP_FALIAS(recode, recode_string, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry recode_module_entry = { - STANDARD_MODULE_HEADER, - "recode", - php_recode_functions, - PHP_MINIT(recode), - PHP_MSHUTDOWN(recode), - NULL, - NULL, - PHP_MINFO(recode), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_RECODE -ZEND_GET_MODULE(recode) -#endif - -static void php_recode_init_globals (zend_recode_globals *rg) -{ - rg->outer = NULL; -} - -PHP_MINIT_FUNCTION(recode) -{ - ZEND_INIT_MODULE_GLOBALS(recode, php_recode_init_globals, NULL); - - ReSG(outer) = recode_new_outer(false); - if (ReSG(outer) == NULL) { - return FAILURE; - } - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(recode) -{ - if (ReSG(outer)) { - recode_delete_outer(ReSG(outer)); - } - return SUCCESS; -} - -PHP_MINFO_FUNCTION(recode) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_end(); -} - -/* {{{ proto string recode_string(string request, string str) - Recode string str according to request string */ -PHP_FUNCTION(recode_string) -{ - RECODE_REQUEST request = NULL; - char *r = NULL; - int r_len = 0, r_alen = 0; - int req_len, str_len; - char *req, *str; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &req, &req_len, &str, &str_len) == FAILURE) { - return; - } - - request = recode_new_request(ReSG(outer)); - - if (request == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure"); - RETURN_FALSE; - } - - if (!recode_scan_request(request, req)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req); - goto error_exit; - } - - recode_buffer_to_buffer(request, str, str_len, &r, &r_len, &r_alen); - if (!r) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed."); -error_exit: - RETVAL_FALSE; - } else { - RETVAL_STRINGL(r, r_len, 1); - free(r); - } - - recode_delete_request(request); - - return; -} -/* }}} */ - -/* {{{ proto bool recode_file(string request, resource input, resource output) - Recode file input into file output according to request */ -PHP_FUNCTION(recode_file) -{ - RECODE_REQUEST request = NULL; - zval **req; - zval **input, **output; - php_stream *instream, *outstream; - FILE *in_fp, *out_fp; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { - WRONG_PARAM_COUNT; - } - - php_stream_from_zval(instream, input); - php_stream_from_zval(outstream, output); - - if (FAILURE == php_stream_cast(instream, PHP_STREAM_AS_STDIO, (void**)&in_fp, REPORT_ERRORS)) { - RETURN_FALSE; - } - - if (FAILURE == php_stream_cast(outstream, PHP_STREAM_AS_STDIO, (void**)&out_fp, REPORT_ERRORS)) { - RETURN_FALSE; - } - - convert_to_string_ex(req); - - request = recode_new_request(ReSG(outer)); - if (request == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure"); - RETURN_FALSE; - } - - if (!recode_scan_request(request, Z_STRVAL_PP(req))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req)); - goto error_exit; - } - - if (!recode_file_to_file(request, in_fp, out_fp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed."); - goto error_exit; - } - - recode_delete_request(request); - RETURN_TRUE; - -error_exit: - recode_delete_request(request); - RETURN_FALSE; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c deleted file mode 100644 index 588e44669cd89..0000000000000 --- a/ext/reflection/php_reflection.c +++ /dev/null @@ -1,4248 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Timm Friebe <thekid@thekid.de> | - | George Schlossnagle <george@omniti.com> | - | Andrei Zmievski <andrei@gravitonic.com> | - | Marcus Boerger <helly@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#include "zend.h" -#include "zend_API.h" -#include "zend_exceptions.h" -#include "zend_operators.h" -#include "zend_constants.h" -#include "zend_ini.h" -#include "zend_interfaces.h" - -/* Class entry pointers */ -ZEND_API zend_class_entry *reflector_ptr; -ZEND_API zend_class_entry *reflection_exception_ptr; -ZEND_API zend_class_entry *reflection_ptr; -ZEND_API zend_class_entry *reflection_function_ptr; -ZEND_API zend_class_entry *reflection_parameter_ptr; -ZEND_API zend_class_entry *reflection_class_ptr; -ZEND_API zend_class_entry *reflection_object_ptr; -ZEND_API zend_class_entry *reflection_method_ptr; -ZEND_API zend_class_entry *reflection_property_ptr; -ZEND_API zend_class_entry *reflection_extension_ptr; - -/* Method macros */ - -#define METHOD_NOTSTATIC(ce) \ - if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), U_CLASS_ENTRY(ce) TSRMLS_CC)) { \ - zend_error(E_ERROR, "%v() cannot be called statically", get_active_function_name(TSRMLS_C)); \ - return; \ - } \ - -#define METHOD_NOTSTATIC_NUMPARAMS(ce, c) METHOD_NOTSTATIC(ce) \ - if (ZEND_NUM_ARGS() > c) { \ - ZEND_WRONG_PARAM_COUNT(); \ - } \ - -/* Exception throwing macro */ -#define _DO_THROW(msg) \ - zend_throw_exception(U_CLASS_ENTRY(reflection_exception_ptr), msg, 0 TSRMLS_CC); \ - return; \ - -#define RETURN_ON_EXCEPTION \ - if (EG(exception) && Z_OBJCE_P(EG(exception)) == U_CLASS_ENTRY(reflection_exception_ptr)) { \ - return; \ - } - -#define GET_REFLECTION_OBJECT_PTR(target) \ - intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC); \ - if (intern == NULL || intern->ptr == NULL) { \ - RETURN_ON_EXCEPTION \ - zend_error(E_ERROR, "Internal error: Failed to retrieve the reflection object"); \ - } \ - target = intern->ptr; \ - -/* {{{ Smart string functions */ -typedef struct _string { - char *string; - int len; - int alloced; -} string; - -static void string_init(string *str) -{ - str->string = (char *) emalloc(1024); - str->len = 1; - str->alloced = 1024; - *str->string = '\0'; -} - -static string *string_printf(string *str, const char *format, ...) -{ - int len; - va_list arg; - char *s_tmp; - - va_start(arg, format); - len = zend_vspprintf(&s_tmp, 0, format, arg); - if (len) { - register int nlen = (str->len + len + (1024 - 1)) & ~(1024 - 1); - if (str->alloced < nlen) { - str->alloced = nlen; - str->string = erealloc(str->string, str->alloced); - } - memcpy(str->string + str->len - 1, s_tmp, len + 1); - str->len += len; - } - efree(s_tmp); - va_end(arg); - return str; -} - -static string *string_write(string *str, char *buf, int len) -{ - register int nlen = (str->len + len + (1024 - 1)) & ~(1024 - 1); - if (str->alloced < nlen) { - str->alloced = nlen; - str->string = erealloc(str->string, str->alloced); - } - memcpy(str->string + str->len - 1, buf, len); - str->len += len; - str->string[str->len - 1] = '\0'; - return str; -} - -static string *string_append(string *str, string *append) -{ - if (append->len > 1) { - string_write(str, append->string, append->len - 1); - } - return str; -} - -static void string_free(string *str) -{ - efree(str->string); - str->len = 0; - str->alloced = 0; - str->string = NULL; -} -/* }}} */ - -/* Struct for properties */ -typedef struct _property_reference { - zend_class_entry *ce; - zend_property_info *prop; -} property_reference; - -/* Struct for parameters */ -typedef struct _parameter_reference { - zend_uint offset; - zend_uint required; - struct _zend_arg_info *arg_info; - zend_function *fptr; -} parameter_reference; - -/* Struct for reflection objects */ -typedef struct { - zend_object zo; - void *ptr; - unsigned int free_ptr:1; - zval *obj; - zend_class_entry *ce; -} reflection_object; - -static zend_object_handlers reflection_object_handlers; - -static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) -{ - zval **value; - - if (zend_hash_find(Z_OBJPROP_P(object), name, name_len, (void **) &value) == FAILURE) { - RETURN_FALSE; - } - - *return_value = **value; - zval_copy_ctor(return_value); -} - -static void reflection_register_implement(zend_class_entry *class_entry, zend_class_entry *interface_entry TSRMLS_DC) -{ - zend_uint num_interfaces = ++class_entry->num_interfaces; - - class_entry->interfaces = (zend_class_entry **) realloc(class_entry->interfaces, sizeof(zend_class_entry *) * num_interfaces); - class_entry->interfaces[num_interfaces - 1] = interface_entry; -} - -static void reflection_free_objects_storage(void *object TSRMLS_DC) -{ - reflection_object *intern = (reflection_object *) object; - - if (intern->free_ptr && intern->ptr) { - efree(intern->ptr); - intern->ptr = NULL; - } - if (intern->obj) { - zval_ptr_dtor(&intern->obj); - } - zend_objects_free_object_storage(object TSRMLS_CC); -} - -static void reflection_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - reflection_object *intern = (reflection_object *) object; - reflection_object **intern_clone = (reflection_object **) object_clone; - - *intern_clone = emalloc(sizeof(reflection_object)); - (*intern_clone)->zo.ce = intern->zo.ce; - (*intern_clone)->zo.in_get = 0; - (*intern_clone)->zo.in_set = 0; - (*intern_clone)->zo.in_unset = 0; - (*intern_clone)->zo.in_isset = 0; - ALLOC_HASHTABLE((*intern_clone)->zo.properties); - (*intern_clone)->ptr = intern->ptr; - (*intern_clone)->free_ptr = intern->free_ptr; - (*intern_clone)->obj = intern->obj; - if (intern->obj) { - zval_add_ref(&intern->obj); - } -} - -static zend_object_value reflection_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zval tmp; - zend_object_value retval; - reflection_object *intern; - - intern = emalloc(sizeof(reflection_object)); - intern->zo.ce = class_type; - intern->zo.in_get = 0; - intern->zo.in_set = 0; - intern->zo.in_unset = 0; - intern->zo.in_isset = 0; - intern->ptr = NULL; - intern->obj = NULL; - intern->free_ptr = 0; - - ALLOC_HASHTABLE(intern->zo.properties); - zend_u_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - retval.handle = zend_objects_store_put(intern, NULL, reflection_free_objects_storage, reflection_objects_clone TSRMLS_CC); - retval.handlers = &reflection_object_handlers; - return retval; -} - -static zval * reflection_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; - return object; -} - -static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC); -static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char *indent TSRMLS_DC); -static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC); -static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC); -static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC); - -/* {{{ _class_string */ -static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC) -{ - int count, count_static_props = 0, count_static_funcs = 0, count_shadow_props = 0; - string sub_indent; - - string_init(&sub_indent); - string_printf(&sub_indent, "%s ", indent); - - /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) */ - if (ce->type == ZEND_USER_CLASS && ce->doc_comment) { - string_printf(str, "%s%s", indent, ce->doc_comment); - string_write(str, "\n", 1); - } - - if (obj) { - string_printf(str, "%sObject of class [ ", indent); - } else { - string_printf(str, "%s%s [ ", indent, (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : "Class"); - } - string_printf(str, (ce->type == ZEND_USER_CLASS) ? "<user" : "<internal"); - if (ce->module) { - string_printf(str, ":%s", ce->module->name); - } - string_printf(str, "> "); - if (ce->get_iterator != NULL) { - string_printf(str, "<iterateable> "); - } - if (ce->ce_flags & ZEND_ACC_INTERFACE) { - string_printf(str, "interface "); - } else { - if (ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - string_printf(str, "abstract "); - } - if (ce->ce_flags & ZEND_ACC_FINAL_CLASS) { - string_printf(str, "final "); - } - string_printf(str, "class "); - } - string_printf(str, "%v", ce->name); - if (ce->parent) { - string_printf(str, " extends %v", ce->parent->name); - } - - if (ce->num_interfaces) { - zend_uint i; - - string_printf(str, " implements %v", ce->interfaces[0]->name); - for (i = 1; i < ce->num_interfaces; ++i) { - string_printf(str, ", %v", ce->interfaces[i]->name); - } - } - string_printf(str, " ] {\n"); - - /* The information where a class is declared is only available for user classes */ - if (ce->type == ZEND_USER_CLASS) { - string_printf(str, "%s @@ %s %d-%d\n", indent, ce->filename, - ce->line_start, ce->line_end); - } - - /* Constants */ - if (&ce->constants_table) { - string_printf(str, "\n"); - count = zend_hash_num_elements(&ce->constants_table); - string_printf(str, "%s - Constants [%d] {\n", indent, count); - if (count > 0) { - HashPosition pos; - zval **value; - char *key; - uint key_len; - ulong num_index; - - zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->constants_table, (void **) &value, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_len, &num_index, 0, &pos); - - _const_string(str, key, *value, indent TSRMLS_CC); - zend_hash_move_forward_ex(&ce->constants_table, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - /* Static properties */ - if (&ce->properties_info) { - /* counting static properties */ - count = zend_hash_num_elements(&ce->properties_info); - if (count > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if(prop->flags & ZEND_ACC_SHADOW) { - count_shadow_props++; - } else if (prop->flags & ZEND_ACC_STATIC) { - count_static_props++; - } - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - - /* static properties */ - string_printf(str, "\n%s - Static properties [%d] {\n", indent, count_static_props); - if (count_static_props > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if ((prop->flags & ZEND_ACC_STATIC) && !(prop->flags & ZEND_ACC_SHADOW)) { - _property_string(str, prop, NULL, sub_indent.string TSRMLS_CC); - } - - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - /* Static methods */ - if (&ce->function_table) { - /* counting static properties */ - count = zend_hash_num_elements(&ce->function_table); - if (count > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - count_static_funcs++; - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } - - /* static properties */ - string_printf(str, "\n%s - Static methods [%d] {", indent, count_static_funcs); - if (count_static_funcs > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - string_printf(str, "\n"); - _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } else { - string_printf(str, "\n"); - } - string_printf(str, "%s }\n", indent); - } - - /* Default/Implicit properties */ - if (&ce->properties_info) { - count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; - string_printf(str, "\n%s - Properties [%d] {\n", indent, count); - if (count > 0) { - HashPosition pos; - zend_property_info *prop; - - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - - while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) { - if (!(prop->flags & (ZEND_ACC_STATIC|ZEND_ACC_SHADOW))) { - _property_string(str, prop, NULL, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->properties_info, &pos); - } - } - string_printf(str, "%s }\n", indent); - } - - if (obj && Z_OBJ_HT_P(obj)->get_properties) { - string dyn; - HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj TSRMLS_CC); - HashPosition pos; - zval **prop; - - string_init(&dyn); - count = 0; - - zend_hash_internal_pointer_reset_ex(properties, &pos); - - while (zend_hash_get_current_data_ex(properties, (void **) &prop, &pos) == SUCCESS) { - char *prop_name; - uint prop_name_size; - ulong index; - - if (zend_hash_get_current_key_ex(properties, &prop_name, &prop_name_size, &index, 1, &pos) == HASH_KEY_IS_STRING) { - if (prop_name_size && prop_name[0]) { /* skip all private and protected properties */ - if (!zend_hash_quick_exists(&ce->properties_info, prop_name, prop_name_size, zend_get_hash_value(prop_name, prop_name_size))) { - count++; - _property_string(&dyn, NULL, prop_name, sub_indent.string TSRMLS_CC); - } - } - efree(prop_name); - } - zend_hash_move_forward_ex(properties, &pos); - } - - string_printf(str, "\n%s - Dynamic properties [%d] {\n", indent, count); - string_append(str, &dyn); - string_printf(str, "%s }\n", indent); - string_free(&dyn); - } - - /* Non static methods */ - if (&ce->function_table) { - count = zend_hash_num_elements(&ce->function_table) - count_static_funcs; - string_printf(str, "\n%s - Methods [%d] {", indent, count); - if (count > 0) { - HashPosition pos; - zend_function *mptr; - - zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); - - while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (!(mptr->common.fn_flags & ZEND_ACC_STATIC)) { - string_printf(str, "\n"); - _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC); - } - zend_hash_move_forward_ex(&ce->function_table, &pos); - } - } else { - string_printf(str, "\n"); - } - string_printf(str, "%s }\n", indent); - } - - string_printf(str, "%s}\n", indent); - string_free(&sub_indent); -} -/* }}} */ - -/* {{{ _const_string */ -static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC) -{ - string_printf(str, "%s Constant [ %s %s ] { }\n", - indent, - zend_zval_type_name(value), - name); -} -/* }}} */ - -/* {{{ _get_recv_opcode */ -static zend_op* _get_recv_op(zend_op_array *op_array, zend_uint offset) -{ - zend_op *op = op_array->opcodes; - zend_op *end = op + op_array->last; - - ++offset; - while (op < end) { - if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) && - op->op1.u.constant.value.lval == offset) { - return op; - } - ++op; - } - return NULL; -} -/* }}} */ - -/* {{{ _parameter_string */ -static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, char* indent TSRMLS_DC) -{ - string_printf(str, "Parameter #%d [ ", offset); - if (offset >= required) { - string_printf(str, "<optional> "); - } else { - string_printf(str, "<required> "); - } - if (arg_info->class_name) { - string_printf(str, "%v ", arg_info->class_name); - if (arg_info->allow_null) { - string_printf(str, "or NULL "); - } - } else if (arg_info->array_type_hint) { - string_printf(str, "array "); - if (arg_info->allow_null) { - string_printf(str, "or NULL "); - } - } - if (arg_info->pass_by_reference) { - string_write(str, "&", sizeof("&")-1); - } - if (arg_info->name) { - string_printf(str, "$%v", arg_info->name); - } else { - string_printf(str, "$param%d", offset); - } - if (fptr->type == ZEND_USER_FUNCTION && offset >= required) { - zend_op *precv = _get_recv_op((zend_op_array*)fptr, offset); - if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2.op_type != IS_UNUSED) { - zval *zv, zv_copy; - int use_copy; - string_write(str, " = ", sizeof(" = ")-1); - ALLOC_ZVAL(zv); - *zv = precv->op2.u.constant; - zval_copy_ctor(zv); - INIT_PZVAL(zv); - zval_update_constant(&zv, (void*)1 TSRMLS_CC); - if (Z_TYPE_P(zv) == IS_BOOL) { - if (Z_LVAL_P(zv)) { - string_write(str, "true", sizeof("true")-1); - } else { - string_write(str, "false", sizeof("false")-1); - } - } else if (Z_TYPE_P(zv) == IS_NULL) { - string_write(str, "NULL", sizeof("NULL")-1); - } else if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_BINARY) { - if (Z_TYPE_P(zv) == IS_BINARY) { - string_write(str, "b'", sizeof("b")-1); - } - string_write(str, "'", sizeof("'")-1); - string_write(str, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 15)); - if (Z_STRLEN_P(zv) > 15) { - string_write(str, "...", sizeof("...")-1); - } - string_write(str, "'", sizeof("'")-1); - } else if (Z_TYPE_P(zv) == IS_UNICODE) { - string_write(str, "'", sizeof("'")-1); - zend_make_printable_zval(zv, &zv_copy, &use_copy); - string_write(str, Z_STRVAL(zv_copy), MIN(Z_STRLEN(zv_copy), 15)); - if (Z_STRLEN(zv_copy) > 15) { - string_write(str, "...", sizeof("...")-1); - } - string_write(str, "'", sizeof("'")-1); - if (use_copy) { - zval_dtor(&zv_copy); - } - } else { - zend_make_printable_zval(zv, &zv_copy, &use_copy); - string_write(str, Z_STRVAL(zv_copy), Z_STRLEN(zv_copy)); - if (use_copy) { - zval_dtor(&zv_copy); - } - } - zval_ptr_dtor(&zv); - } - } - string_write(str, " ]", sizeof(" ]")-1); -} -/* }}} */ - -/* {{{ _function_parameter_string */ -static void _function_parameter_string(string *str, zend_function *fptr, char* indent TSRMLS_DC) -{ - struct _zend_arg_info *arg_info = fptr->common.arg_info; - zend_uint i, required = fptr->common.required_num_args; - - if (!arg_info) { - return; - } - - string_printf(str, "\n"); - string_printf(str, "%s- Parameters [%d] {\n", indent, fptr->common.num_args); - for (i = 0; i < fptr->common.num_args; i++) { - string_printf(str, "%s ", indent); - _parameter_string(str, fptr, arg_info, i, required, indent TSRMLS_CC); - string_write(str, "\n", sizeof("\n")-1); - arg_info++; - } - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _function_string */ -static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC) -{ - string param_indent; - zend_function *overwrites; - char *lc_name; - unsigned int lc_name_len; - - /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) - * What's "wrong" is that any whitespace before the doc comment start is - * swallowed, leading to an unaligned comment. - */ - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { - string_printf(str, "%s%s\n", indent, fptr->op_array.doc_comment); - } - - string_printf(str, fptr->common.scope ? "%sMethod [ " : "%sFunction [ ", indent); - string_printf(str, (fptr->type == ZEND_USER_FUNCTION) ? "<user" : "<internal"); - if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function*)fptr)->module) { - string_printf(str, ":%s", ((zend_internal_function*)fptr)->module->name); - } - if (scope && fptr->common.scope) { - if (fptr->common.scope != scope) { - string_printf(str, ", inherits %v", fptr->common.scope->name); - } else if (fptr->common.scope->parent) { - lc_name = zend_u_str_case_fold(IS_STRING, fptr->common.function_name, strlen(fptr->common.function_name), 1, &lc_name_len); - if (zend_u_hash_find(&fptr->common.scope->parent->function_table, IS_STRING, lc_name, lc_name_len + 1, (void**) &overwrites) == SUCCESS) { - if (fptr->common.scope != overwrites->common.scope) { - string_printf(str, ", overwrites %v", overwrites->common.scope->name); - } - } - efree(lc_name); - } - } - if (fptr->common.prototype && fptr->common.prototype->common.scope) { - string_printf(str, ", prototype %v", fptr->common.prototype->common.scope->name); - } - if (fptr->common.fn_flags & ZEND_ACC_CTOR) { - string_printf(str, ", ctor"); - } - if (fptr->common.fn_flags & ZEND_ACC_DTOR) { - string_printf(str, ", dtor"); - } - string_printf(str, "> "); - - if (fptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - string_printf(str, "abstract "); - } - if (fptr->common.fn_flags & ZEND_ACC_FINAL) { - string_printf(str, "final "); - } - if (fptr->common.fn_flags & ZEND_ACC_STATIC) { - string_printf(str, "static "); - } - - /* These are mutually exclusive */ - switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - string_printf(str, "public "); - break; - case ZEND_ACC_PRIVATE: - string_printf(str, "private "); - break; - case ZEND_ACC_PROTECTED: - string_printf(str, "protected "); - break; - default: - string_printf(str, "<visibility error> "); - break; - } - - string_printf(str, fptr->common.scope ? "method " : "function "); - if (fptr->op_array.return_reference) { - string_printf(str, "&"); - } - string_printf(str, "%v ] {\n", fptr->common.function_name); - /* The information where a function is declared is only available for user classes */ - if (fptr->type == ZEND_USER_FUNCTION) { - string_printf(str, "%s @@ %s %d - %d\n", indent, - fptr->op_array.filename, - fptr->op_array.line_start, - fptr->op_array.line_end); - } - string_init(¶m_indent); - string_printf(¶m_indent, "%s ", indent); - _function_parameter_string(str, fptr, param_indent.string TSRMLS_CC); - string_free(¶m_indent); - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _property_string */ -static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC) -{ - char *class_name; - - string_printf(str, "%sProperty [ ", indent); - if (!prop) { - string_printf(str, "<dynamic> public $%s", prop_name); - } else { - if (!(prop->flags & ZEND_ACC_STATIC)) { - if (prop->flags & ZEND_ACC_IMPLICIT_PUBLIC) { - string_write(str, "<implicit> ", sizeof("<implicit> ") - 1); - } else { - string_write(str, "<default> ", sizeof("<default> ") - 1); - } - } - - /* These are mutually exclusive */ - switch (prop->flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - string_printf(str, "public "); - break; - case ZEND_ACC_PRIVATE: - string_printf(str, "private "); - break; - case ZEND_ACC_PROTECTED: - string_printf(str, "protected "); - break; - } - if(prop->flags & ZEND_ACC_STATIC) { - string_printf(str, "static "); - } - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, &class_name, &prop_name); - string_printf(str, "$%v", prop_name); - } - - string_printf(str, " ]\n"); -} -/* }}} */ - -static int _extension_ini_string(zend_ini_entry *ini_entry, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - int number = va_arg(args, int); - char *comma = ""; - - if (number == ini_entry->module_number) { - string_printf(str, " %sEntry [ %s <", indent, ini_entry->name); - if (ini_entry->modifiable & ZEND_INI_ALL) { - string_printf(str, "ALL"); - } else { - if (ini_entry->modifiable & ZEND_INI_USER) { - string_printf(str, "USER"); - comma = ","; - } - if (ini_entry->modifiable & ZEND_INI_PERDIR) { - string_printf(str, "%sPERDIR", comma); - comma = ","; - } - if (ini_entry->modifiable & ZEND_INI_SYSTEM) { - string_printf(str, "%sSYSTEM", comma); - } - } - - string_printf(str, "> ]\n"); - string_printf(str, " %s Current = '%s'\n", indent, ini_entry->value ? ini_entry->value : ""); - if (ini_entry->modified) { - string_printf(str, " %s Default = '%s'\n", indent, ini_entry->orig_value ? ini_entry->orig_value : ""); - } - string_printf(str, " %s}\n", indent); - } - return ZEND_HASH_APPLY_KEEP; -} - -static int _extension_class_string(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int *num_classes = va_arg(args, int*); - TSRMLS_FETCH(); - - if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) { - string_printf(str, "\n"); - _class_string(str, *pce, NULL, indent TSRMLS_CC); - (*num_classes)++; - } - return ZEND_HASH_APPLY_KEEP; -} - -static int _extension_const_string(zend_constant *constant, int num_args, va_list args, zend_hash_key *hash_key) -{ - string *str = va_arg(args, string *); - char *indent = va_arg(args, char *); - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int *num_classes = va_arg(args, int*); - - if (constant->module_number == module->module_number) { - TSRMLS_FETCH(); - _const_string(str, constant->name, &constant->value, indent TSRMLS_CC); - (*num_classes)++; - } - return ZEND_HASH_APPLY_KEEP; -} - -/* {{{ _extension_string */ -static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC) -{ - string_printf(str, "%sExtension [ ", indent); - if (module->type == MODULE_PERSISTENT) { - string_printf(str, "<persistent>"); - } - if (module->type == MODULE_TEMPORARY) { - string_printf(str, "<temporary>" ); - } - string_printf(str, " extension #%d %s version %s ] {\n", - module->module_number, module->name, - (module->version == NO_VERSION_YET) ? "<no_version>" : module->version); - - { - string str_ini; - string_init(&str_ini); - zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number); - if (str_ini.len > 1) { - string_printf(str, "\n - INI {\n"); - string_append(str, &str_ini); - string_printf(str, "%s }\n", indent); - } - string_free(&str_ini); - } - - { - string str_constants; - int num_constants = 0; - - string_init(&str_constants); - zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants TSRMLS_CC); - if (num_constants) { - string_printf(str, "\n - Constants [%d] {\n", num_constants); - string_append(str, &str_constants); - string_printf(str, "%s }\n", indent); - } - string_free(&str_constants); - } - - if (module->functions && module->functions->fname) { - zend_function *fptr; - zend_function_entry *func = module->functions; - - string_printf(str, "\n - Functions {\n"); - - /* Is there a better way of doing this? */ - while (func->fname) { - if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) { - zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - continue; - } - - _function_string(str, fptr, NULL, " " TSRMLS_CC); - func++; - } - string_printf(str, "%s }\n", indent); - } - - { - string str_classes; - string sub_indent; - int num_classes = 0; - - string_init(&sub_indent); - string_printf(&sub_indent, "%s ", indent); - string_init(&str_classes); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.string, module, &num_classes TSRMLS_CC); - if (num_classes) { - string_printf(str, "\n - Classes [%d] {", num_classes); - string_append(str, &str_classes); - string_printf(str, "%s }\n", indent); - } - string_free(&str_classes); - string_free(&sub_indent); - } - - string_printf(str, "%s}\n", indent); -} -/* }}} */ - -/* {{{ _function_check_flag */ -static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - RETURN_BOOL(mptr->common.fn_flags & mask); -} -/* }}} */ - -/* {{{ zend_reflection_class_factory */ -ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - - MAKE_STD_ZVAL(name); - ZVAL_TEXTL(name, ce->name, ce->name_length, 1); - reflection_instanciate(U_CLASS_ENTRY(reflection_class_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = ce; - intern->free_ptr = 0; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_extension_factory */ -static void reflection_extension_factory(zval *object, char *name_str TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - int name_len = strlen(name_str); - char *lcname; - struct _zend_module_entry *module; - - lcname = do_alloca(name_len + 1); - zend_str_tolower_copy(lcname, name_str, name_len); - if (zend_hash_find(&module_registry, lcname, name_len + 1, (void **)&module) == FAILURE) { - free_alloca(lcname); - return; - } - free_alloca(lcname); - - reflection_instanciate(U_CLASS_ENTRY(reflection_extension_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - MAKE_STD_ZVAL(name); - ZVAL_STRINGL(name, module->name, name_len, 1); - intern->ptr = module; - intern->free_ptr = 0; - intern->ce = NULL; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_parameter_factory */ -static void reflection_parameter_factory(zend_function *fptr, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, zval *object TSRMLS_DC) -{ - reflection_object *intern; - parameter_reference *reference; - zval *name; - - MAKE_STD_ZVAL(name); - if (arg_info->name) { - ZVAL_TEXTL(name, arg_info->name, arg_info->name_len, 1); - } else { - ZVAL_NULL(name); - } - reflection_instanciate(U_CLASS_ENTRY(reflection_parameter_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - reference = (parameter_reference*) emalloc(sizeof(parameter_reference)); - reference->arg_info = arg_info; - reference->offset = offset; - reference->required = required; - reference->fptr = fptr; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = fptr->common.scope; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_function_factory */ -static void reflection_function_factory(zend_function *function, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, function->common.function_name, 1); - - reflection_instanciate(U_CLASS_ENTRY(reflection_function_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = function; - intern->free_ptr = 0; - intern->ce = NULL; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_method_factory */ -static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - zval *classname; - - MAKE_STD_ZVAL(name); - MAKE_STD_ZVAL(classname); - ZVAL_TEXT(name, method->common.function_name, 1); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - reflection_instanciate(U_CLASS_ENTRY(reflection_method_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - intern->ptr = method; - intern->free_ptr = 0; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ reflection_property_factory */ -static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object TSRMLS_DC) -{ - reflection_object *intern; - zval *name; - zval *classname; - property_reference *reference; - char *class_name, *prop_name; - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, &class_name, &prop_name); - - if (!(prop->flags & ZEND_ACC_PRIVATE)) { - /* we have to seach the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce->parent; - zend_property_info *tmp_info; - - while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { - if (tmp_info->flags & ZEND_ACC_PRIVATE) { - /* private in super class => NOT the same property */ - break; - } - ce = tmp_ce; - prop = tmp_info; - tmp_ce = tmp_ce->parent; - } - } - - MAKE_STD_ZVAL(name); - MAKE_STD_ZVAL(classname); - ZVAL_TEXT(name, prop_name, 1); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - - reflection_instanciate(U_CLASS_ENTRY(reflection_property_ptr), object TSRMLS_CC); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - reference = (property_reference*) emalloc(sizeof(property_reference)); - reference->ce = ce; - reference->prop = prop; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = ce; - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ _reflection_export */ -static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_ptr, int ctor_argc) -{ - zval *reflector_ptr; - zval output, *output_ptr = &output; - zval *argument_ptr, *argument2_ptr; - zval *retval_ptr, **params[2]; - int result; - int return_output = 0; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval fname; - - if (ctor_argc == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &argument_ptr, &return_output) == FAILURE) { - return; - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) { - return; - } - } - - INIT_PZVAL(&output); - - /* Create object */ - MAKE_STD_ZVAL(reflector_ptr); - if (object_and_properties_init(reflector_ptr, ce_ptr, NULL) == FAILURE) { - _DO_THROW("Could not create reflector"); - } - - /* Call __construct() */ - params[0] = &argument_ptr; - params[1] = &argument2_ptr; - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &reflector_ptr; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = ctor_argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce_ptr->constructor; - fcc.calling_scope = ce_ptr; - fcc.object_pp = &reflector_ptr; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - if (EG(exception)) { - zval_ptr_dtor(&reflector_ptr); - return; - } - if (result == FAILURE) { - zval_ptr_dtor(&reflector_ptr); - _DO_THROW("Could not create reflector"); - } - - /* Call static reflection::export */ - ZVAL_BOOL(&output, return_output); - params[0] = &reflector_ptr; - params[1] = &output_ptr; - - ZVAL_STRINGL(&fname, "export", sizeof("export") - 1, 0); - fci.function_table = &U_CLASS_ENTRY(reflection_ptr)->function_table; - fci.function_name = &fname; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = params; - fci.no_separation = 1; - - result = zend_call_function(&fci, NULL TSRMLS_CC); - - if (result == FAILURE && EG(exception) == NULL) { - zval_ptr_dtor(&reflector_ptr); - zval_ptr_dtor(&retval_ptr); - _DO_THROW("Could not execute reflection::export()"); - } - - if (return_output) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } else { - zval_ptr_dtor(&retval_ptr); - } - - /* Destruct reflector which is no longer needed */ - zval_ptr_dtor(&reflector_ptr); -} -/* }}} */ - -/* {{{ Preventing __clone from being called */ -ZEND_METHOD(reflection, __clone) -{ - /* Should never be executable */ - _DO_THROW("Cannot clone object using __clone()"); -} -/* }}} */ - -/* {{{ proto public static mixed Reflection::export(Reflector r [, bool return]) - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection, export) -{ - zval *object, fname, *retval_ptr; - int result; - zend_bool return_output = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, U_CLASS_ENTRY(reflector_ptr), &return_output) == FAILURE) { - return; - } - - /* Invoke the __toString() method */ - ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1, 1); - result= call_user_function_ex(NULL, &object, &fname, &retval_ptr, 0, NULL, 0, NULL TSRMLS_CC); - zval_dtor(&fname); - - if (result == FAILURE) { - _DO_THROW("Invocation of method __toString() failed"); - /* Returns from this function */ - } - - if (!retval_ptr) { - zend_error(E_WARNING, "%v::__toString() did not return anything", Z_OBJCE_P(object)->name); - RETURN_FALSE; - } - - if (return_output) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } else { - /* No need for _r variant, return of __toString should always be a string */ - zend_print_zval(retval_ptr, 0); - zend_printf("\n"); - zval_ptr_dtor(&retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public static array Reflection::getModifierNames(int modifiers) - Returns an array of modifier names */ -ZEND_METHOD(reflection, getModifierNames) -{ - long modifiers; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &modifiers) == FAILURE) { - return; - } - - array_init(return_value); - - if (modifiers & (ZEND_ACC_ABSTRACT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - add_next_index_stringl(return_value, "abstract", sizeof("abstract")-1, 1); - } - if (modifiers & (ZEND_ACC_FINAL | ZEND_ACC_FINAL_CLASS)) { - add_next_index_stringl(return_value, "final", sizeof("final")-1, 1); - } - - /* These are mutually exclusive */ - switch (modifiers & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - add_next_index_stringl(return_value, "public", sizeof("public")-1, 1); - break; - case ZEND_ACC_PRIVATE: - add_next_index_stringl(return_value, "private", sizeof("private")-1, 1); - break; - case ZEND_ACC_PROTECTED: - add_next_index_stringl(return_value, "protected", sizeof("protected")-1, 1); - break; - } - - if (modifiers & ZEND_ACC_STATIC) { - add_next_index_stringl(return_value, "static", sizeof("static")-1, 1); - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionFunction::export(string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_function, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_function_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionFunction::__construct(string name) - Constructor. Throws an Exception in case the given function does not exist */ -ZEND_METHOD(reflection_function, __construct) -{ - zval *name; - zval *object; - unsigned int lcname_len; - char *lcname; - reflection_object *intern; - zend_function *fptr; - char *name_str; - int name_len; - zend_uchar type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name_str, &name_len, &type) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), type, lcname, lcname_len + 1, (void **)&fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Function %R() does not exist", type, name_str); - return; - } - efree(lcname); - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, fptr->common.function_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = fptr; - intern->free_ptr = 0; - intern->ce = NULL; -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_function, __toString) -{ - reflection_object *intern; - zend_function *fptr; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - string_init(&str); - _function_string(&str, fptr, intern->ce, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getName() - Returns this function's name */ -ZEND_METHOD(reflection, function_getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::isInternal() - Returns whether this is an internal function */ -ZEND_METHOD(reflection, function_isInternal) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::isUserDefined() - Returns whether this is an user-defined function */ -ZEND_METHOD(reflection_function, isUserDefined) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - RETURN_BOOL(fptr->type == ZEND_USER_FUNCTION); -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getFileName() - Returns the filename of the file this function was declared in */ -ZEND_METHOD(reflection_function, getFileName) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_STRING(fptr->op_array.filename, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionFunction::getStartLine() - Returns the line this function's declaration starts at */ -ZEND_METHOD(reflection_function, getStartLine) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_LONG(fptr->op_array.line_start); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionFunction::getEndLine() - Returns the line this function's declaration ends at */ -ZEND_METHOD(reflection_function, getEndLine) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION) { - RETURN_LONG(fptr->op_array.line_end); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public string ReflectionFunction::getDocComment() - Returns the doc comment for this function */ -ZEND_METHOD(reflection_function, getDocComment) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { - RETURN_STRINGL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public array ReflectionFunction::getStaticVariables() - Returns an associative array containing this function's static variables and their values */ -ZEND_METHOD(reflection_function, getStaticVariables) -{ - zval *tmp_copy; - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); - GET_REFLECTION_OBJECT_PTR(fptr); - - /* Return an empty array in case no static variables exist */ - array_init(return_value); - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) { - zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); - } -} -/* }}} */ - -/* {{{ proto public mixed ReflectionFunction::invoke(mixed* args) - Invokes the function */ -ZEND_METHOD(reflection_function, invoke) -{ - zval *retval_ptr; - zval ***params; - int result; - int argc = ZEND_NUM_ARGS(); - zend_fcall_info fci; - zend_fcall_info_cache fcc; - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = fptr; - fcc.calling_scope = EG(scope); - fcc.object_pp = NULL; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of function %v() failed", fptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -static int _zval_array_to_c_array(zval **arg, zval ****params TSRMLS_DC) /* {{{ */ -{ - *(*params)++ = arg; - return ZEND_HASH_APPLY_KEEP; -} /* }}} */ - -/* {{{ proto public mixed ReflectionFunction::invokeArgs(array args) - Invokes the function and pass its arguments as array. */ -ZEND_METHOD(reflection_function, invokeArgs) -{ - zval *retval_ptr; - zval ***params; - int result; - int argc; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - reflection_object *intern; - zend_function *fptr; - zval *param_array; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", ¶m_array) == FAILURE) { - return; - } - - argc = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - params = safe_emalloc(sizeof(zval **), argc, 0); - zend_hash_apply_with_argument(Z_ARRVAL_P(param_array), (apply_func_arg_t)_zval_array_to_c_array, ¶ms TSRMLS_CC); - params -= argc; - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = fptr; - fcc.calling_scope = EG(scope); - fcc.object_pp = NULL; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of function %v() failed", fptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::returnsReference() - Gets whether this function returns a reference */ -ZEND_METHOD(reflection_function, returnsReference) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_BOOL(fptr->op_array.return_reference); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::getNumberOfParameters() - Gets the number of required parameters */ -ZEND_METHOD(reflection_function, getNumberOfParameters) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_LONG(fptr->common.num_args); -} -/* }}} */ - -/* {{{ proto public bool ReflectionFunction::getNumberOfRequiredParameters() - Gets the number of required parameters */ -ZEND_METHOD(reflection_function, getNumberOfRequiredParameters) -{ - reflection_object *intern; - zend_function *fptr; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - RETURN_LONG(fptr->common.required_num_args); -} -/* }}} */ - -/* {{{ proto public ReflectionParameter[] ReflectionFunction::getParameters() - Returns an array of parameter objects for this function */ -ZEND_METHOD(reflection_function, getParameters) -{ - reflection_object *intern; - zend_function *fptr; - zend_uint i; - struct _zend_arg_info *arg_info; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - arg_info= fptr->common.arg_info; - - array_init(return_value); - for (i = 0; i < fptr->common.num_args; i++) { - zval *parameter; - - ALLOC_ZVAL(parameter); - reflection_parameter_factory(fptr, arg_info, i, fptr->common.required_num_args, parameter TSRMLS_CC); - add_next_index_zval(return_value, parameter); - - arg_info++; - } -} -/* }}} */ - -/* {{{ proto public ReflectionExtension|NULL ReflectionFunction::getExtension() - Returns NULL or the extension the function belongs to */ -ZEND_METHOD(reflection_function, getExtension) -{ - reflection_object *intern; - zend_function *fptr; - zend_internal_function *internal; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (fptr->type != ZEND_INTERNAL_FUNCTION) { - RETURN_NULL(); - } - - internal = (zend_internal_function *)fptr; - if (internal->module) { - reflection_extension_factory(return_value, internal->module->name TSRMLS_CC); - } else { - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto public string|false ReflectionFunction::getExtensionName() - Returns false or the name of the extension the function belongs to */ -ZEND_METHOD(reflection_function, getExtensionName) -{ - reflection_object *intern; - zend_function *fptr; - zend_internal_function *internal; - - METHOD_NOTSTATIC(reflection_function_ptr); - GET_REFLECTION_OBJECT_PTR(fptr); - - if (fptr->type != ZEND_INTERNAL_FUNCTION) { - RETURN_FALSE; - } - - internal = (zend_internal_function *)fptr; - if (internal->module) { - RETURN_STRING(internal->module->name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_parameter, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_parameter_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionParameter::__construct(mixed function, mixed parameter) - Constructor. Throws an Exception in case the given method does not exist */ -ZEND_METHOD(reflection_parameter, __construct) -{ - parameter_reference *ref; - zval *reference, *parameter; - zval *object; - zval *name; - reflection_object *intern; - zend_function *fptr; - struct _zend_arg_info *arg_info; - int position; - zend_class_entry *ce = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, ¶meter) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* First, find the function */ - switch (Z_TYPE_P(reference)) { - case IS_UNICODE: - case IS_STRING: { - unsigned int lcname_len; - char *lcname; - - convert_to_text_ex(&reference); - lcname = zend_u_str_case_fold(Z_TYPE_P(reference), Z_UNIVAL_P(reference), Z_UNILEN_P(reference), 1, &lcname_len); - if (zend_u_hash_find(EG(function_table), Z_TYPE_P(reference), lcname, lcname_len + 1, (void**) &fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Function %R() does not exist", Z_TYPE_P(reference), Z_UNIVAL_P(reference)); - return; - } - efree(lcname); - } - break; - - case IS_ARRAY: { - zval **classref; - zval **method; - zend_class_entry **pce; - unsigned int lcname_len; - char *lcname; - - if ((zend_hash_index_find(Z_ARRVAL_P(reference), 0, (void **) &classref) == FAILURE) - || (zend_hash_index_find(Z_ARRVAL_P(reference), 1, (void **) &method) == FAILURE)) { - _DO_THROW("Expected array($object, $method) or array($classname, $method)"); - /* returns out of this function */ - } - - if (Z_TYPE_PP(classref) == IS_OBJECT) { - ce = Z_OBJCE_PP(classref); - } else { - convert_to_text_ex(classref); - if (zend_u_lookup_class(Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_UNILEN_PP(classref), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %R does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref)); - return; - } - ce = *pce; - } - - convert_to_text_ex(method); - lcname = zend_u_str_case_fold(Z_TYPE_PP(method), Z_UNIVAL_PP(method), Z_UNILEN_PP(method), 1, &lcname_len); - if (zend_u_hash_find(&ce->function_table, Z_TYPE_PP(method), lcname, lcname_len + 1, (void **) &fptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %R::%R() does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_TYPE_PP(method), Z_UNIVAL_PP(method)); - return; - } - efree(lcname); - } - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an array(class, method)"); - /* returns out of this function */ - } - - /* Now, search for the parameter */ - arg_info = fptr->common.arg_info; - if (Z_TYPE_P(parameter) == IS_LONG) { - position= Z_LVAL_P(parameter); - if (position < 0 || (zend_uint)position >= fptr->common.num_args) { - _DO_THROW("The parameter specified by its offset could not be found"); - /* returns out of this function */ - } - } else { - zend_uint i; - - position= -1; - convert_to_string_ex(¶meter); - for (i = 0; i < fptr->common.num_args; i++) { - if (arg_info[i].name && strcmp(arg_info[i].name, Z_STRVAL_P(parameter)) == 0) { - position= i; - break; - } - } - if (position == -1) { - _DO_THROW("The parameter specified by its name could not be found"); - /* returns out of this function */ - } - } - - MAKE_STD_ZVAL(name); - if (arg_info[position].name) { - ZVAL_TEXTL(name, arg_info[position].name, arg_info[position].name_len, 1); - } else { - ZVAL_NULL(name); - } - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - - ref = (parameter_reference*) emalloc(sizeof(parameter_reference)); - ref->arg_info = &arg_info[position]; - ref->offset = (zend_uint)position; - ref->required = fptr->common.required_num_args; - ref->fptr = fptr; - intern->ptr = ref; - intern->free_ptr = 1; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionParameter::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_parameter, __toString) -{ - reflection_object *intern; - parameter_reference *param; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - string_init(&str); - _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionParameter::getName() - Returns this parameters's name */ -ZEND_METHOD(reflection_parameter, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionParameter::getClass() - Returns this parameters's class hint or NULL if there is none */ -ZEND_METHOD(reflection_parameter, getClass) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (!param->arg_info->class_name) { - RETURN_NULL(); - } else { - zend_class_entry **pce; - - if (zend_u_lookup_class_ex(UG(unicode)?IS_UNICODE:IS_STRING, param->arg_info->class_name, param->arg_info->class_name_len, 1, &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not exist", param->arg_info->class_name); - return; - } - zend_reflection_class_factory(*pce, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isArray() - Returns whether parameter MUST be an array */ -ZEND_METHOD(reflection_parameter, isArray) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->array_type_hint); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::allowsNull() - Returns whether NULL is allowed as this parameters's value */ -ZEND_METHOD(reflection_parameter, allowsNull) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->allow_null); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isPassedByReference() - Returns whether this parameters is passed to by reference */ -ZEND_METHOD(reflection_parameter, isPassedByReference) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->arg_info->pass_by_reference); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isOptional() - Returns whether this parameter is an optional parameter */ -ZEND_METHOD(reflection_parameter, isOptional) -{ - reflection_object *intern; - parameter_reference *param; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - RETVAL_BOOL(param->offset >= param->required); -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::isDefaultValueAvailable() - Returns whether the default value of this parameter is available */ -ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) -{ - reflection_object *intern; - parameter_reference *param; - zend_op *precv; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (param->fptr->type != ZEND_USER_FUNCTION) - { - RETURN_FALSE; - } - if (param->offset < param->required) { - RETURN_FALSE; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto public bool ReflectionParameter::getDefaultValue() - Returns the default value of this parameter or throws an exception */ -ZEND_METHOD(reflection_parameter, getDefaultValue) -{ - reflection_object *intern; - parameter_reference *param; - zend_op *precv; - zval *zv, zv_copy; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); - GET_REFLECTION_OBJECT_PTR(param); - - if (param->fptr->type != ZEND_USER_FUNCTION) - { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Cannot determine default value for internal functions"); - return; - } - if (param->offset < param->required) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Parameter is not optional"); - return; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Internal error"); - return; - } - - zv_copy = precv->op2.u.constant; - zv = &zv_copy; - zval_update_constant(&zv, (void*)0 TSRMLS_CC); - RETURN_ZVAL(zv, 1, 1); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_method, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_method_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionMethod::__construct(mixed class_or_method [, string name]) - Constructor. Throws an Exception in case the given method does not exist */ -ZEND_METHOD(reflection_method, __construct) -{ - zval *name, *classname; - zval *object; - reflection_object *intern; - unsigned int lcname_len; - char *lcname; - zend_class_entry **pce; - zend_class_entry *ce; - zend_function *mptr; - char *name_str, *tmp; - int name_len, tmp_len; - zval ztmp; - zend_uchar type; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zt", &classname, &name_str, &name_len, &type) == FAILURE) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) { - return; - } - if ((tmp = strstr(name_str, "::")) == NULL) { - return; - } - type = IS_STRING; - classname = &ztmp; - tmp_len = tmp - name_str; - ZVAL_STRINGL(classname, name_str, tmp_len, 1); - name_len = name_len - (tmp_len + 2); - name_str = tmp + 2; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* Find the class entry */ - switch (Z_TYPE_P(classname)) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not exist", Z_UNIVAL_P(classname)); - return; - } - ce = *pce; - break; - - case IS_OBJECT: - ce = Z_OBJCE_P(classname); - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an object"); - /* returns out of this function */ - } - - if (classname == &ztmp) { - zval_dtor(&ztmp); - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); - - lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len); - - if (zend_u_hash_find(&ce->function_table, type, lcname, lcname_len + 1, (void **) &mptr) == FAILURE) { - efree(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %v::%R() does not exist", ce->name, type, name_str); - return; - } - efree(lcname); - - MAKE_STD_ZVAL(name); - ZVAL_TEXT(name, mptr->common.function_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = mptr; - intern->free_ptr = 0; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionMethod::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_method, __toString) -{ - reflection_object *intern; - zend_function *mptr; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - string_init(&str); - _function_string(&str, mptr, intern->ce, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionMethod::invoke(mixed object, mixed* args) - Invokes the method. */ -ZEND_METHOD(reflection_method, invoke) -{ - zval *retval_ptr; - zval ***params; - zval **object_pp; - reflection_object *intern; - zend_function *mptr; - int argc = ZEND_NUM_ARGS(); - int result; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zend_class_entry *obj_ce; - - METHOD_NOTSTATIC(reflection_method_ptr); - - if (argc < 1) { - zend_error(E_WARNING, "Invoke() expects at least one parameter, none given"); - RETURN_FALSE; - } - - GET_REFLECTION_OBJECT_PTR(mptr); - - if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) || - (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke abstract method %v::%v()", - mptr->common.scope->name, mptr->common.function_name); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke %s method %v::%v() from scope %v", - mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", - mptr->common.scope->name, mptr->common.function_name, - Z_OBJCE_P(getThis())->name); - } - return; - } - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - /* In case this is a static method, we should'nt pass an object_pp - * (which is used as calling context aka $this). We can thus ignore the - * first parameter. - * - * Else, we verify that the given object is an instance of the class. - */ - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - object_pp = NULL; - obj_ce = NULL; - } else { - if ((Z_TYPE_PP(params[0]) != IS_OBJECT)) { - efree(params); - _DO_THROW("Non-object passed to Invoke()"); - /* Returns from this function */ - } - obj_ce = Z_OBJCE_PP(params[0]); - - if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) { - efree(params); - _DO_THROW("Given object is not an instance of the class this method was declared in"); - /* Returns from this function */ - } - - object_pp = params[0]; - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = object_pp; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc-1; - fci.params = params+1; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = mptr; - fcc.calling_scope = obj_ce; - fcc.object_pp = object_pp; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public mixed ReflectionMethod::invokeArgs(mixed object, array args) - Invokes the function and pass its arguments as array. */ -ZEND_METHOD(reflection_method, invokeArgs) -{ - zval *retval_ptr; - zval ***params; - zval *object; - reflection_object *intern; - zend_function *mptr; - int argc; - int result; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zend_class_entry *obj_ce; - zval *param_array; - - METHOD_NOTSTATIC(reflection_method_ptr); - - GET_REFLECTION_OBJECT_PTR(mptr); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, ¶m_array) == FAILURE) { - return; - } - - if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) || - (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke abstract method %v::%v", - mptr->common.scope->name, mptr->common.function_name); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke %s method %v::%v from scope %v", - mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", - mptr->common.scope->name, mptr->common.function_name, - Z_OBJCE_P(getThis())->name); - } - return; - } - - argc = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - params = safe_emalloc(sizeof(zval **), argc, 0); - zend_hash_apply_with_argument(Z_ARRVAL_P(param_array), (apply_func_arg_t)_zval_array_to_c_array, ¶ms TSRMLS_CC); - params -= argc; - - /* In case this is a static method, we should'nt pass an object_pp - * (which is used as calling context aka $this). We can thus ignore the - * first parameter. - * - * Else, we verify that the given object is an instance of the class. - */ - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { - object = NULL; - obj_ce = NULL; - } else { - if (!object) { - efree(params); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Trying to invoke non static method %v::%v without an object", - mptr->common.scope->name, mptr->common.function_name); - return; - } - - obj_ce = Z_OBJCE_P(object); - - if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) { - efree(params); - _DO_THROW("Given object is not an instance of the class this method was declared in"); - /* Returns from this function */ - } - } - - fci.size = sizeof(fci); - fci.function_table = NULL; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &object; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = mptr; - fcc.calling_scope = obj_ce; - fcc.object_pp = &object; - - result = zend_call_function(&fci, &fcc TSRMLS_CC); - - efree(params); - - if (result == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name); - return; - } - - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isFinal() - Returns whether this method is final */ -ZEND_METHOD(reflection_method, isFinal) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isAbstract() - Returns whether this method is abstract */ -ZEND_METHOD(reflection_method, isAbstract) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_ABSTRACT); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isPublic() - Returns whether this method is public */ -ZEND_METHOD(reflection_method, isPublic) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isPrivate() - Returns whether this method is private */ -ZEND_METHOD(reflection_method, isPrivate) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PRIVATE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isProtected() - Returns whether this method is protected */ -ZEND_METHOD(reflection_method, isProtected) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PROTECTED); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isStatic() - Returns whether this method is static */ -ZEND_METHOD(reflection_method, isStatic) -{ - _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_STATIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isConstructor() - Returns whether this method is the constructor */ -ZEND_METHOD(reflection_method, isConstructor) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - /* we need to check if the ctor is the ctor of the class level we we - * looking at since we might be looking at an inherited old style ctor - * defined in base class. */ - RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope); -} -/* }}} */ - -/* {{{ proto public bool ReflectionMethod::isDestructor() - Returns whether this method is static */ -ZEND_METHOD(reflection_method, isDestructor) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR); -} -/* }}} */ - -/* {{{ proto public int ReflectionMethod::getModifiers() - Returns a bitfield of the access modifiers for this method */ -ZEND_METHOD(reflection_method, getModifiers) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); - GET_REFLECTION_OBJECT_PTR(mptr); - - RETURN_LONG(mptr->common.fn_flags); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass() - Get the declaring class */ -ZEND_METHOD(reflection_method, getDeclaringClass) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC(reflection_method_ptr); - GET_REFLECTION_OBJECT_PTR(mptr); - - zend_reflection_class_factory(mptr->common.scope, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionMethod::getPrototype() - Get the prototype */ -ZEND_METHOD(reflection_method, getPrototype) -{ - reflection_object *intern; - zend_function *mptr; - - METHOD_NOTSTATIC(reflection_method_ptr); - GET_REFLECTION_OBJECT_PTR(mptr); - - if (!mptr->common.prototype) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %v::%v does not have a prototype", intern->ce->name, mptr->common.function_name); - return; - } - - reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionClass::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_class, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_class_ptr), 1); -} -/* }}} */ - -/* {{{ reflection_class_object_ctor */ -static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_object) -{ - zval *argument; - zval *object; - zval *classname; - reflection_object *intern; - zend_class_entry **ce; - - if (is_object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &argument) == FAILURE) { - return; - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &argument) == FAILURE) { - return; - } - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - if (Z_TYPE_P(argument) == IS_OBJECT) { - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL); - intern->ptr = Z_OBJCE_P(argument); - if (is_object) { - intern->obj = argument; - zval_add_ref(&argument); - } - } else { - convert_to_string_ex(&argument); - if (zend_u_lookup_class(Z_TYPE_P(argument), Z_UNIVAL_P(argument), Z_UNILEN_P(argument), &ce TSRMLS_CC) == FAILURE) { - if (!EG(exception)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", Z_TYPE_P(argument), Z_UNIVAL_P(argument)); - } - return; - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, (*ce)->name, (*ce)->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL); - - intern->ptr = *ce; - } - intern->free_ptr = 0; -} -/* }}} */ - -/* {{{ proto public ReflectionClass::__construct(mixed argument) throws ReflectionException - Constructor. Takes a string or an instance as an argument */ -ZEND_METHOD(reflection_class, __construct) -{ - reflection_class_object_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getStaticProperties() - Returns an associative array containing all static property values of the class */ -ZEND_METHOD(reflection_class, getStaticProperties) -{ - zval *tmp_copy; - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - - array_init(return_value); - zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionClass::getStaticPropertyValue(string name [, mixed default]) - Returns the value of a tsstic property */ -ZEND_METHOD(reflection_class, getStaticPropertyValue) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval **prop, *def_value = NULL; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|z", &name, &name_len, &name_type, &def_value) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - prop = zend_std_get_static_property(ce, name_type, name, name_len, 1 TSRMLS_CC); - if (!prop) { - if (def_value) { - RETURN_ZVAL(def_value, 1, 0); - } else { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not have a property named %R", ce->name, name_type, name); - } - return; - } else { - RETURN_ZVAL(*prop, 1, 0); - } -} -/* }}} */ - -/* {{{ proto public void ReflectionClass::setStaticPropertyValue($name, $value) - Sets the value of a static property */ -ZEND_METHOD(reflection_class, setStaticPropertyValue) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval **variable_ptr, *value; - int refcount; - zend_uchar is_ref; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tz", &name, &name_len, &name_type, &value) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - zend_update_class_constants(ce TSRMLS_CC); - variable_ptr = zend_std_get_static_property(ce, name_type, name, name_len, 1 TSRMLS_CC); - if (!variable_ptr) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %v does not have a property named %R", ce->name, name_type, name); - return; - } - refcount = (*variable_ptr)->refcount; - is_ref = (*variable_ptr)->is_ref; - zval_dtor(*variable_ptr); - **variable_ptr = *value; - zval_copy_ctor(*variable_ptr); - (*variable_ptr)->refcount = refcount; - (*variable_ptr)->is_ref = is_ref; - -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getDefaultProperties() - Returns an associative array containing copies of all default property values of the class */ -ZEND_METHOD(reflection_class, getDefaultProperties) -{ - reflection_object *intern; - zend_class_entry *ce; - int count; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - array_init(return_value); - - zend_update_class_constants(ce TSRMLS_CC); - - count = zend_hash_num_elements(&ce->default_properties); - if (count > 0) { - HashPosition pos; - zval **prop; - - zend_hash_internal_pointer_reset_ex(&ce->default_properties, &pos); - while (zend_hash_get_current_data_ex(&ce->default_properties, (void **) &prop, &pos) == SUCCESS) { - char *key, *class_name, *prop_name; - uint key_len; - ulong num_index; - zval *prop_copy; - - zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &num_index, 0, &pos); - zend_hash_move_forward_ex(&ce->default_properties, &pos); - zend_unmangle_property_name(key, &class_name, &prop_name); - if (class_name && class_name[0] != '*' && strcmp(class_name, ce->name)) { - /* filter privates from base classes */ - continue; - } - - /* copy: enforce read only access */ - ALLOC_ZVAL(prop_copy); - *prop_copy = **prop; - zval_copy_ctor(prop_copy); - INIT_PZVAL(prop_copy); - - add_assoc_zval(return_value, prop_name, prop_copy); - } - } -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_class, __toString) -{ - reflection_object *intern; - zend_class_entry *ce; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - string_init(&str); - _class_string(&str, ce, intern->obj, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getName() - Returns the class' name */ -ZEND_METHOD(reflection_class, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInternal() - Returns whether this class is an internal class */ -ZEND_METHOD(reflection_class, isInternal) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce->type == ZEND_INTERNAL_CLASS); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isUserDefined() - Returns whether this class is user-defined */ -ZEND_METHOD(reflection_class, isUserDefined) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce->type == ZEND_USER_CLASS); -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getFileName() - Returns the filename of the file this class was declared in */ -ZEND_METHOD(reflection_class, getFileName) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS) { - RETURN_STRING(ce->filename, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getStartLine() - Returns the line this class' declaration starts at */ -ZEND_METHOD(reflection_class, getStartLine) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_FUNCTION) { - RETURN_LONG(ce->line_start); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getEndLine() - Returns the line this class' declaration ends at */ -ZEND_METHOD(reflection_class, getEndLine) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS) { - RETURN_LONG(ce->line_end); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public string ReflectionClass::getDocComment() - Returns the doc comment for this class */ -ZEND_METHOD(reflection_class, getDocComment) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->type == ZEND_USER_CLASS && ce->doc_comment) { - RETURN_STRINGL(ce->doc_comment, ce->doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public ReflectionMethod ReflectionClass::getConstructor() - Returns the class' constructor if there is one, NULL otherwise */ -ZEND_METHOD(reflection_class, getConstructor) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->constructor) { - reflection_method_factory(ce, ce->constructor, return_value TSRMLS_CC); - } else { - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasMethod(string name) - Returns wether a method exists or not */ -ZEND_METHOD(reflection_class, hasMethod) -{ - reflection_object *intern; - zend_class_entry *ce; - unsigned int lc_name_len; - char *name, *lc_name; - int name_len; - zend_uchar type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - lc_name = zend_u_str_case_fold(type, name, name_len, 1, &lc_name_len); - if (zend_u_hash_exists(&ce->function_table, type, lc_name, lc_name_len + 1)) { - efree(lc_name); - RETURN_TRUE; - } else { - efree(lc_name); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public ReflectionMethod ReflectionClass::getMethod(string name) throws ReflectionException - Returns the class' method specified by its name */ -ZEND_METHOD(reflection_class, getMethod) -{ - reflection_object *intern; - zend_class_entry *ce; - zend_function *mptr; - unsigned int lc_name_len; - char *name, *lc_name; - int name_len; - zend_uchar type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - lc_name = zend_u_str_case_fold(type, name, name_len, 1, &lc_name_len); - if (zend_u_hash_find(&ce->function_table, type, lc_name, lc_name_len + 1, (void**) &mptr) == SUCCESS) { - reflection_method_factory(ce, mptr, return_value TSRMLS_CC); - efree(lc_name); - } else { - efree(lc_name); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Method %R does not exist", type, name); - return; - } -} -/* }}} */ - -/* {{{ _addmethod */ -static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC) -{ - zval *method; - zend_class_entry *ce = *va_arg(args, zend_class_entry**); - zval *retval = va_arg(args, zval*); - long filter = va_arg(args, long); - - if (mptr->common.fn_flags & filter) { - TSRMLS_FETCH(); - ALLOC_ZVAL(method); - reflection_method_factory(ce, mptr, method TSRMLS_CC); - add_next_index_zval(retval, method); - } - return 0; -} -/* }}} */ - -/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods() - Returns an array of this class' methods */ -ZEND_METHOD(reflection_class, getMethods) -{ - reflection_object *intern; - zend_class_entry *ce; - long filter = 0; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL | ZEND_ACC_STATIC; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - array_init(return_value); - zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod, 3, &ce, return_value, filter); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasProperty(string name) - Returns wether a property exists or not */ -ZEND_METHOD(reflection_class, hasProperty) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - zval *property; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_hash_exists(&ce->properties_info, name, name_len + 1)) { - RETURN_TRUE; - } else { - if (intern->obj && Z_OBJ_HANDLER_P(intern->obj, has_property)) - { - MAKE_STD_ZVAL(property); - ZVAL_STRINGL(property, name, name_len, 1); - if (Z_OBJ_HANDLER_P(intern->obj, has_property)(intern->obj, property, 2 TSRMLS_CC)) { - zval_ptr_dtor(&property); - RETURN_TRUE; - } - zval_ptr_dtor(&property); - } - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public ReflectionProperty ReflectionClass::getProperty(string name) throws ReflectionException - Returns the class' property specified by its name */ -ZEND_METHOD(reflection_class, getProperty) -{ - reflection_object *intern; - zend_class_entry *ce, **pce; - zend_property_info *property_info; - char *name, *tmp, *classname; - int name_len, classname_len; - zend_uchar name_type; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &name_type) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_u_hash_find(&ce->properties_info, name_type, name, name_len + 1, (void**) &property_info) == SUCCESS && (property_info->flags & ZEND_ACC_SHADOW) == 0) { - reflection_property_factory(ce, property_info, return_value TSRMLS_CC); - return; - } - if ((tmp = strstr(name, "::")) != NULL) { - classname_len = tmp - name; - classname = zend_str_tolower_dup(name, classname_len); - classname[classname_len] = '\0'; - name_len = name_len - (classname_len + 2); - name = tmp + 2; - - if (zend_u_lookup_class(name_type, classname, classname_len, &pce TSRMLS_CC) == FAILURE) { - if (!EG(exception)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", name_type, classname); - } - efree(classname); - return; - } - efree(classname); - - if (!instanceof_function(ce, *pce TSRMLS_CC)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Fully qualified property name %v::%R does not specify a base class of %v", (*pce)->name, name_type, name, ce->name); - return; - } - ce = *pce; - - if (zend_u_hash_find(&ce->properties_info, name_type, name, name_len + 1, (void**) &property_info) == SUCCESS && (property_info->flags & ZEND_ACC_SHADOW) == 0) { - reflection_property_factory(ce, property_info, return_value TSRMLS_CC); - return; - } - } - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Property %R does not exist", name_type, name); -} -/* }}} */ - -/* {{{ _addproperty */ -static int _addproperty(zend_property_info *pptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC) -{ - zval *property; - zend_class_entry *ce = *va_arg(args, zend_class_entry**); - zval *retval = va_arg(args, zval*); - long filter = va_arg(args, long); - - if (pptr->flags & ZEND_ACC_SHADOW) { - return 0; - } - - if (pptr->flags & filter) { - TSRMLS_FETCH(); - ALLOC_ZVAL(property); - reflection_property_factory(ce, pptr, property TSRMLS_CC); - add_next_index_zval(retval, property); - } - return 0; -} -/* }}} */ - -/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties() - Returns an array of this class' properties */ -ZEND_METHOD(reflection_class, getProperties) -{ - reflection_object *intern; - zend_class_entry *ce; - long filter = 0; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC; - } - - GET_REFLECTION_OBJECT_PTR(ce); - - array_init(return_value); - zend_hash_apply_with_arguments(&ce->properties_info, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::hasConstant(string name) - Returns wether a constant exists or not */ -ZEND_METHOD(reflection_class, hasConstant) -{ - reflection_object *intern; - zend_class_entry *ce; - char *name; - int name_len; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - if (zend_hash_exists(&ce->constants_table, name, name_len + 1)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public array ReflectionClass::getConstants() - Returns an associative array containing this class' constants and their values */ -ZEND_METHOD(reflection_class, getConstants) -{ - zval *tmp_copy; - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - array_init(return_value); - zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionClass::getConstant(string name) - Returns the class' constant specified by its name */ -ZEND_METHOD(reflection_class, getConstant) -{ - reflection_object *intern; - zend_class_entry *ce; - zval **value; - char *name; - int name_len; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - GET_REFLECTION_OBJECT_PTR(ce); - zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); - if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { - RETURN_FALSE; - } - *return_value = **value; - zval_copy_ctor(return_value); -} -/* }}} */ - -/* {{{ _class_check_flag */ -static void _class_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - RETVAL_BOOL(ce->ce_flags & mask); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInstantiable() - Returns whether this class is instantiable */ -ZEND_METHOD(reflection_class, isInstantiable) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS)) { - RETURN_FALSE; - } - - /* Basically, the class is instantiable. Though, if there is a constructor - * and it is not publicly accessible, it isn't! */ - if (!ce->constructor) { - RETURN_TRUE; - } - - RETURN_BOOL(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInterface() - Returns whether this is an interface or a class */ -ZEND_METHOD(reflection_class, isInterface) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_INTERFACE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isFinal() - Returns whether this class is final */ -ZEND_METHOD(reflection_class, isFinal) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL_CLASS); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isAbstract() - Returns whether this class is abstract */ -ZEND_METHOD(reflection_class, isAbstract) -{ - _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); -} -/* }}} */ - -/* {{{ proto public int ReflectionClass::getModifiers() - Returns a bitfield of the access modifiers for this class */ -ZEND_METHOD(reflection_class, getModifiers) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - RETURN_LONG(ce->ce_flags); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isInstance(stdclass object) - Returns whether the given object is an instance of this class */ -ZEND_METHOD(reflection_class, isInstance) -{ - reflection_object *intern; - zend_class_entry *ce; - zval *object; - - METHOD_NOTSTATIC(reflection_class_ptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) { - return; - } - GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(ce == Z_OBJCE_P(object)); -} -/* }}} */ - -/* {{{ proto public stdclass ReflectionClass::newInstance(mixed* args, ...) - Returns an instance of this class */ -ZEND_METHOD(reflection_class, newInstance) -{ - zval *retval_ptr; - reflection_object *intern; - zend_class_entry *ce; - int argc = ZEND_NUM_ARGS(); - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - object_init_ex(return_value, ce); - - /* Run the constructor if there is one */ - if (ce->constructor) { - zval ***params; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - - if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name); - return; - } - - params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { - efree(params); - RETURN_FALSE; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &return_value; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = argc; - fci.params = params; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - efree(params); - zval_ptr_dtor(&retval_ptr); - zend_error(E_WARNING, "Invocation of %v's constructor failed", ce->name); - RETURN_NULL(); - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - efree(params); - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass[] ReflectionClass::getInterfaces() - Returns an array of interfaces this class implements */ -ZEND_METHOD(reflection_class, getInterfaces) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - /* Return an empty array if this class implements no interfaces */ - array_init(return_value); - - if (ce->num_interfaces) { - zend_uint i; - - for (i=0; i < ce->num_interfaces; i++) { - zval *interface; - ALLOC_ZVAL(interface); - zend_reflection_class_factory(ce->interfaces[i], interface TSRMLS_CC); - add_assoc_zval_ex(return_value, ce->interfaces[i]->name, ce->interfaces[i]->name_length, interface); - } - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionClass::getParentClass() - Returns the class' parent class, or, if none exists, FALSE */ -ZEND_METHOD(reflection_class, getParentClass) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->parent) { - zend_reflection_class_factory(ce->parent, return_value TSRMLS_CC); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isSubclassOf(string|ReflectionClass class) - Returns whether this class is a subclass of another class */ -ZEND_METHOD(reflection_class, isSubclassOf) -{ - reflection_object *intern, *argument; - zend_class_entry *ce, **pce, *class_ce; - zval *class_name; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE) { - return; - } - - switch(class_name->type) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %R does not exist", Z_TYPE_P(class_name), Z_UNIVAL_P(class_name)); - return; - } - class_ce = *pce; - break; - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(class_name), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) { - argument = (reflection_object *) zend_object_store_get_object(class_name TSRMLS_CC); - if (argument == NULL || argument->ptr == NULL) { - zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ - } - class_ce = argument->ptr; - break; - } - /* no break */ - default: - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Parameter one must either be a string or a ReflectionClass object"); - return; - } - - - RETURN_BOOL(instanceof_function(ce, class_ce TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::implementsInterface(string|ReflectionClass interface_name) - Returns whether this class is a subclass of another class */ -ZEND_METHOD(reflection_class, implementsInterface) -{ - reflection_object *intern, *argument; - zend_class_entry *ce, *interface_ce, **pce; - zval *interface; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &interface) == FAILURE) { - return; - } - - switch(interface->type) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(interface), Z_UNIVAL_P(interface), Z_UNILEN_P(interface), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %R does not exist", Z_TYPE_P(interface), Z_UNIVAL_P(interface)); - return; - } - interface_ce = *pce; - break; - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(interface), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) { - argument = (reflection_object *) zend_object_store_get_object(interface TSRMLS_CC); - if (argument == NULL || argument->ptr == NULL) { - zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object"); - /* Bails out */ - } - interface_ce = argument->ptr; - break; - } - /* no break */ - default: - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Parameter one must either be a string or a ReflectionClass object"); - return; - } - - if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Interface %v is a Class", interface_ce->name); - return; - } - RETURN_BOOL(instanceof_function(ce, interface_ce TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto public bool ReflectionClass::isIterateable() - Returns whether this class is iterateable (can be used inside foreach) */ -ZEND_METHOD(reflection_class, isIterateable) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - RETURN_BOOL(ce->get_iterator != NULL); -} -/* }}} */ - -/* {{{ proto public ReflectionExtension|NULL ReflectionClass::getExtension() - Returns NULL or the extension the class belongs to */ -ZEND_METHOD(reflection_class, getExtension) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->module) { - reflection_extension_factory(return_value, ce->module->name TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto public string|false ReflectionClass::getExtensionName() - Returns false or the name of the extension the class belongs to */ -ZEND_METHOD(reflection_class, getExtensionName) -{ - reflection_object *intern; - zend_class_entry *ce; - - METHOD_NOTSTATIC(reflection_class_ptr); - GET_REFLECTION_OBJECT_PTR(ce); - - if (ce->module) { - RETURN_STRING(ce->module->name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionObject::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_object, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_object_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionObject::__construct(mixed argument) throws ReflectionException - Constructor. Takes an instance as an argument */ -ZEND_METHOD(reflection_object, __construct) -{ - reflection_class_object_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionProperty::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_property, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_property_ptr), 2); -} -/* }}} */ - -/* {{{ proto public ReflectionProperty::__construct(mixed class, string name) - Constructor. Throws an Exception in case the given property does not exist */ -ZEND_METHOD(reflection_property, __construct) -{ - zval *propname, *classname; - char *name_str, *class_name, *prop_name; - int name_len; - zval *object; - reflection_object *intern; - zend_class_entry **pce; - zend_class_entry *ce; - zend_property_info *property_info; - property_reference *reference; - zend_uchar name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zt", &classname, &name_str, &name_len, &name_type) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - - /* Find the class entry */ - switch (Z_TYPE_P(classname)) { - case IS_STRING: - case IS_UNICODE: - if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Class %R does not exist", Z_TYPE_P(classname), Z_UNIVAL_P(classname)); - return; - } - ce = *pce; - break; - - case IS_OBJECT: - ce = Z_OBJCE_P(classname); - break; - - default: - _DO_THROW("The parameter class is expected to be either a string or an object"); - /* returns out of this function */ - } - - if (zend_u_hash_find(&ce->properties_info, name_type, name_str, name_len + 1, (void **) &property_info) == FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Property %v::$%R does not exist", ce->name, name_type, name_str); - return; - } - - if (!(property_info->flags & ZEND_ACC_PRIVATE)) { - /* we have to seach the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce->parent; - zend_property_info *tmp_info; - - while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) { - if (tmp_info->flags & ZEND_ACC_PRIVATE) { - /* private in super class => NOT the same property */ - break; - } - ce = tmp_ce; - property_info = tmp_info; - tmp_ce = tmp_ce->parent; - } - } - - MAKE_STD_ZVAL(classname); - ZVAL_TEXTL(classname, ce->name, ce->name_length, 1); - zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); - - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, &class_name, &prop_name); - MAKE_STD_ZVAL(propname); - ZVAL_TEXT(propname, prop_name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL); - - reference = (property_reference*) emalloc(sizeof(property_reference)); - reference->ce = ce; - reference->prop = property_info; - intern->ptr = reference; - intern->free_ptr = 1; - intern->ce = ce; -} -/* }}} */ - -/* {{{ proto public string ReflectionProperty::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_property, __toString) -{ - reflection_object *intern; - property_reference *ref; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - string_init(&str); - _property_string(&str, ref->prop, NULL, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionProperty::getName() - Returns the class' name */ -ZEND_METHOD(reflection_property, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -static void _property_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - RETURN_BOOL(ref->prop->flags & mask); -} - -/* {{{ proto public bool ReflectionProperty::isPublic() - Returns whether this property is public */ -ZEND_METHOD(reflection_property, isPublic) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PUBLIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isPrivate() - Returns whether this property is private */ -ZEND_METHOD(reflection_property, isPrivate) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PRIVATE); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isProtected() - Returns whether this property is protected */ -ZEND_METHOD(reflection_property, isProtected) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_PROTECTED); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isStatic() - Returns whether this property is static */ -ZEND_METHOD(reflection_property, isStatic) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_STATIC); -} -/* }}} */ - -/* {{{ proto public bool ReflectionProperty::isDefault() - Returns whether this property is default (declared at compilation time). */ -ZEND_METHOD(reflection_property, isDefault) -{ - _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ~ZEND_ACC_IMPLICIT_PUBLIC); -} -/* }}} */ - -/* {{{ proto public int ReflectionProperty::getModifiers() - Returns a bitfield of the access modifiers for this property */ -ZEND_METHOD(reflection_property, getModifiers) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - - RETURN_LONG(ref->prop->flags); -} -/* }}} */ - -/* {{{ proto public mixed ReflectionProperty::getValue([stdclass object]) - Returns this property's value */ -ZEND_METHOD(reflection_property, getValue) -{ - reflection_object *intern; - property_reference *ref; - zval *object; - zval **member= NULL; - zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; - - METHOD_NOTSTATIC(reflection_property_ptr); - GET_REFLECTION_OBJECT_PTR(ref); - -#if MBO_0 - if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) { - _DO_THROW("Cannot access non-public member"); - /* Returns from this function */ - } -#endif - - if ((ref->prop->flags & ZEND_ACC_STATIC)) { - zend_update_class_constants(intern->ce TSRMLS_CC); - if (zend_u_hash_quick_find(intern->ce->static_members, utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) { - return; - } - if (zend_u_hash_quick_find(Z_OBJPROP_P(object), utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - } - - *return_value= **member; - zval_copy_ctor(return_value); - INIT_PZVAL(return_value); -} -/* }}} */ - -/* {{{ proto public void ReflectionProperty::setValue([stdclass object,] mixed value) - Sets this property's value */ -ZEND_METHOD(reflection_property, setValue) -{ - reflection_object *intern; - property_reference *ref; - zval **variable_ptr; - zval *object; - zval *value; - int setter_done = 0; - zval *tmp; - HashTable *prop_table; - zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; - - METHOD_NOTSTATIC(reflection_property_ptr); - GET_REFLECTION_OBJECT_PTR(ref); - - if (ref->prop->flags & ~(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)) { - _DO_THROW("Cannot access non-public member"); - /* Returns from this function */ - } - - if ((ref->prop->flags & ZEND_ACC_STATIC)) { - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &tmp, &value) == FAILURE) { - return; - } - } - zend_update_class_constants(intern->ce TSRMLS_CC); - prop_table = intern->ce->static_members; - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) { - return; - } - prop_table = Z_OBJPROP_P(object); - } - - if (zend_u_hash_quick_find(prop_table, utype, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &variable_ptr) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %v", ref->prop->name); - /* Bails out */ - } - if (*variable_ptr == value) { - setter_done = 1; - } else { - if (PZVAL_IS_REF(*variable_ptr)) { - zval_dtor(*variable_ptr); - (*variable_ptr)->type = value->type; - (*variable_ptr)->value = value->value; - if (value->refcount > 0) { - zval_copy_ctor(*variable_ptr); - } - setter_done = 1; - } - } - if (!setter_done) { - zval **foo; - - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - zend_u_hash_quick_update(prop_table, utype, ref->prop->name, ref->prop->name_length+1, ref->prop->h, &value, sizeof(zval *), (void **) &foo); - } -} -/* }}} */ - -/* {{{ proto public ReflectionClass ReflectionProperty::getDeclaringClass() - Get the declaring class */ -ZEND_METHOD(reflection_property, getDeclaringClass) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - - zend_reflection_class_factory(ref->ce, return_value TSRMLS_CC); -} - -/* {{{ proto public string ReflectionProperty::getDocComment() - Returns the doc comment for this property */ -ZEND_METHOD(reflection_property, getDocComment) -{ - reflection_object *intern; - property_reference *ref; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); - GET_REFLECTION_OBJECT_PTR(ref); - if (ref->prop->doc_comment) { - RETURN_STRINGL(ref->prop->doc_comment, ref->prop->doc_comment_len, 1); - } - RETURN_FALSE; -} -/* }}} */ -/* {{{ proto public static mixed ReflectionExtension::export(string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_extension, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_extension_ptr), 1); -} -/* }}} */ - -/* {{{ proto public ReflectionExtension::__construct(string name) - Constructor. Throws an Exception in case the given extension does not exist */ -ZEND_METHOD(reflection_extension, __construct) -{ - zval *name; - zval *object; - char *lcname; - reflection_object *intern; - zend_module_entry *module; - char *name_str; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) { - return; - } - - object = getThis(); - intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if (intern == NULL) { - return; - } - lcname = do_alloca(name_len + 1); - zend_str_tolower_copy(lcname, name_str, name_len); - if (zend_hash_find(&module_registry, lcname, name_len + 1, (void **)&module) == FAILURE) { - free_alloca(lcname); - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Extension %s does not exist", name_str); - return; - } - free_alloca(lcname); - MAKE_STD_ZVAL(name); - ZVAL_STRING(name, module->name, 1); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); - intern->ptr = module; - intern->free_ptr = 0; - intern->ce = NULL; -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::__toString() - Returns a string representation */ -ZEND_METHOD(reflection_extension, __toString) -{ - reflection_object *intern; - zend_module_entry *module; - string str; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - string_init(&str); - _extension_string(&str, module, "" TSRMLS_CC); - RETURN_STRINGL(str.string, str.len - 1, 0); -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::getName() - Returns this extension's name */ -ZEND_METHOD(reflection_extension, getName) -{ - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public string ReflectionExtension::getVersion() - Returns this extension's version */ -ZEND_METHOD(reflection_extension, getVersion) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - /* An extension does not necessarily have a version number */ - if (module->version == NO_VERSION_YET) { - RETURN_NULL(); - } else { - RETURN_STRING(module->version, 1); - } -} -/* }}} */ - -/* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions() - Returns an array of this extension's fuctions */ -ZEND_METHOD(reflection_extension, getFunctions) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - if (module->functions) { - zval *function; - zend_function *fptr; - zend_function_entry *func = module->functions; - - /* Is there a better way of doing this? */ - while (func->fname) { - if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) { - zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - continue; - } - - ALLOC_ZVAL(function); - reflection_function_factory(fptr, function TSRMLS_CC); - add_assoc_zval_ex(return_value, func->fname, strlen(func->fname)+1, function); - func++; - } - } -} -/* }}} */ - -static int _addconstant(zend_constant *constant, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *const_val; - zval *retval = va_arg(args, zval*); - int number = va_arg(args, int); - - if (number == constant->module_number) { - ALLOC_ZVAL(const_val); - *const_val = constant->value; - zval_copy_ctor(const_val); - INIT_PZVAL(const_val); - add_assoc_zval_ex(retval, constant->name, constant->name_len, const_val); - } - return 0; -} - -/* {{{ proto public array ReflectionExtension::getConstants() - Returns an associative array containing this extension's constants and their values */ -ZEND_METHOD(reflection_extension, getConstants) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _addconstant, 2, return_value, module->module_number); -} -/* }}} */ - -/* {{{ _addinientry */ -static int _addinientry(zend_ini_entry *ini_entry, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *retval = va_arg(args, zval*); - int number = va_arg(args, int); - - if (number == ini_entry->module_number) { - if (ini_entry->value) { - add_assoc_stringl(retval, ini_entry->name, ini_entry->value, ini_entry->value_length, 1); - } else { - add_assoc_null(retval, ini_entry->name); - } - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -/* {{{ proto public array ReflectionExtension::getINIEntries() - Returns an associative array containing this extension's INI entries and their values */ -ZEND_METHOD(reflection_extension, getINIEntries) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _addinientry, 2, return_value, module->module_number); -} -/* }}} */ - -/* {{{ add_extension_class */ -static int add_extension_class(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *class_array = va_arg(args, zval*), *zclass; - struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); - int add_reflection_class = va_arg(args, int); - - if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) { - TSRMLS_FETCH(); - if (add_reflection_class) { - ALLOC_ZVAL(zclass); - zend_reflection_class_factory(*pce, zclass TSRMLS_CC); - add_assoc_zval_ex(class_array, (*pce)->name, (*pce)->name_length + 1, zclass); - } else { - add_next_index_stringl(class_array, (*pce)->name, (*pce)->name_length, 1); - } - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -/* {{{ proto public ReflectionClass[] ReflectionExtension::getClasses() - Returns an array containing ReflectionClass objects for all classes of this extension */ -ZEND_METHOD(reflection_extension, getClasses) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto public array ReflectionExtension::getClassNames() - Returns an array containing all names of all classes of this extension */ -ZEND_METHOD(reflection_extension, getClassNames) -{ - reflection_object *intern; - zend_module_entry *module; - - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); - GET_REFLECTION_OBJECT_PTR(module); - - array_init(return_value); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ method tables */ -static zend_function_entry reflection_exception_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_functions[] = { - ZEND_ME(reflection, getModifierNames, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(reflection, export, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflector_functions[] = { - ZEND_FENTRY(export, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - ZEND_ABSTRACT_ME(reflector, __toString, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_function_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_function, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_function, __construct, NULL, 0) - ZEND_ME(reflection_function, __toString, NULL, 0) - ZEND_ME(reflection_function, isInternal, NULL, 0) - ZEND_ME(reflection_function, isUserDefined, NULL, 0) - ZEND_ME(reflection_function, getName, NULL, 0) - ZEND_ME(reflection_function, getFileName, NULL, 0) - ZEND_ME(reflection_function, getStartLine, NULL, 0) - ZEND_ME(reflection_function, getEndLine, NULL, 0) - ZEND_ME(reflection_function, getDocComment, NULL, 0) - ZEND_ME(reflection_function, getStaticVariables, NULL, 0) - ZEND_ME(reflection_function, invoke, NULL, 0) - ZEND_ME(reflection_function, invokeArgs, NULL, 0) - ZEND_ME(reflection_function, returnsReference, NULL, 0) - ZEND_ME(reflection_function, getParameters, NULL, 0) - ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0) - ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0) - ZEND_ME(reflection_function, getExtension, NULL, 0) - ZEND_ME(reflection_function, getExtensionName, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_method_functions[] = { - ZEND_ME(reflection_method, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_method, __construct, NULL, 0) - ZEND_ME(reflection_method, __toString, NULL, 0) - ZEND_ME(reflection_method, isPublic, NULL, 0) - ZEND_ME(reflection_method, isPrivate, NULL, 0) - ZEND_ME(reflection_method, isProtected, NULL, 0) - ZEND_ME(reflection_method, isAbstract, NULL, 0) - ZEND_ME(reflection_method, isFinal, NULL, 0) - ZEND_ME(reflection_method, isStatic, NULL, 0) - ZEND_ME(reflection_method, isConstructor, NULL, 0) - ZEND_ME(reflection_method, isDestructor, NULL, 0) - ZEND_ME(reflection_method, getModifiers, NULL, 0) - ZEND_ME(reflection_method, invoke, NULL, 0) - ZEND_ME(reflection_method, invokeArgs, NULL, 0) - ZEND_ME(reflection_method, getDeclaringClass, NULL, 0) - ZEND_ME(reflection_method, getPrototype, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_class_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_class, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_class, __construct, NULL, 0) - ZEND_ME(reflection_class, __toString, NULL, 0) - ZEND_ME(reflection_class, getName, NULL, 0) - ZEND_ME(reflection_class, isInternal, NULL, 0) - ZEND_ME(reflection_class, isUserDefined, NULL, 0) - ZEND_ME(reflection_class, isInstantiable, NULL, 0) - ZEND_ME(reflection_class, getFileName, NULL, 0) - ZEND_ME(reflection_class, getStartLine, NULL, 0) - ZEND_ME(reflection_class, getEndLine, NULL, 0) - ZEND_ME(reflection_class, getDocComment, NULL, 0) - ZEND_ME(reflection_class, getConstructor, NULL, 0) - ZEND_ME(reflection_class, hasMethod, NULL, 0) - ZEND_ME(reflection_class, getMethod, NULL, 0) - ZEND_ME(reflection_class, getMethods, NULL, 0) - ZEND_ME(reflection_class, hasProperty, NULL, 0) - ZEND_ME(reflection_class, getProperty, NULL, 0) - ZEND_ME(reflection_class, getProperties, NULL, 0) - ZEND_ME(reflection_class, hasConstant, NULL, 0) - ZEND_ME(reflection_class, getConstants, NULL, 0) - ZEND_ME(reflection_class, getConstant, NULL, 0) - ZEND_ME(reflection_class, getInterfaces, NULL, 0) - ZEND_ME(reflection_class, isInterface, NULL, 0) - ZEND_ME(reflection_class, isAbstract, NULL, 0) - ZEND_ME(reflection_class, isFinal, NULL, 0) - ZEND_ME(reflection_class, getModifiers, NULL, 0) - ZEND_ME(reflection_class, isInstance, NULL, 0) - ZEND_ME(reflection_class, newInstance, NULL, 0) - ZEND_ME(reflection_class, getParentClass, NULL, 0) - ZEND_ME(reflection_class, isSubclassOf, NULL, 0) - ZEND_ME(reflection_class, getStaticProperties, NULL, 0) - ZEND_ME(reflection_class, getStaticPropertyValue, NULL, 0) - ZEND_ME(reflection_class, setStaticPropertyValue, NULL, 0) - ZEND_ME(reflection_class, getDefaultProperties, NULL, 0) - ZEND_ME(reflection_class, isIterateable, NULL, 0) - ZEND_ME(reflection_class, implementsInterface, NULL, 0) - ZEND_ME(reflection_class, getExtension, NULL, 0) - ZEND_ME(reflection_class, getExtensionName, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_object_functions[] = { - ZEND_ME(reflection_object, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_object, __construct, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_property_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_property, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_property, __construct, NULL, 0) - ZEND_ME(reflection_property, __toString, NULL, 0) - ZEND_ME(reflection_property, getName, NULL, 0) - ZEND_ME(reflection_property, getValue, NULL, 0) - ZEND_ME(reflection_property, setValue, NULL, 0) - ZEND_ME(reflection_property, isPublic, NULL, 0) - ZEND_ME(reflection_property, isPrivate, NULL, 0) - ZEND_ME(reflection_property, isProtected, NULL, 0) - ZEND_ME(reflection_property, isStatic, NULL, 0) - ZEND_ME(reflection_property, isDefault, NULL, 0) - ZEND_ME(reflection_property, getModifiers, NULL, 0) - ZEND_ME(reflection_property, getDeclaringClass, NULL, 0) - ZEND_ME(reflection_property, getDocComment, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_parameter_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_parameter, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_parameter, __construct, NULL, 0) - ZEND_ME(reflection_parameter, __toString, NULL, 0) - ZEND_ME(reflection_parameter, getName, NULL, 0) - ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0) - ZEND_ME(reflection_parameter, getClass, NULL, 0) - ZEND_ME(reflection_parameter, isArray, NULL, 0) - ZEND_ME(reflection_parameter, allowsNull, NULL, 0) - ZEND_ME(reflection_parameter, isOptional, NULL, 0) - ZEND_ME(reflection_parameter, isDefaultValueAvailable, NULL, 0) - ZEND_ME(reflection_parameter, getDefaultValue, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry reflection_extension_functions[] = { - ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_extension, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_extension, __construct, NULL, 0) - ZEND_ME(reflection_extension, __toString, NULL, 0) - ZEND_ME(reflection_extension, getName, NULL, 0) - ZEND_ME(reflection_extension, getVersion, NULL, 0) - ZEND_ME(reflection_extension, getFunctions, NULL, 0) - ZEND_ME(reflection_extension, getConstants, NULL, 0) - ZEND_ME(reflection_extension, getINIEntries, NULL, 0) - ZEND_ME(reflection_extension, getClasses, NULL, 0) - ZEND_ME(reflection_extension, getClassNames, NULL, 0) - {NULL, NULL, NULL} -}; -/* }}} */ - -static zend_object_handlers *zend_std_obj_handlers; - -/* {{{ _reflection_write_property */ -static void _reflection_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - if ((Z_TYPE_P(member) == IS_STRING || Z_TYPE_P(member) == IS_UNICODE) - && zend_u_hash_exists(&Z_OBJCE_P(object)->default_properties, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1) - && (ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "name", sizeof("name")-1) || - ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "class", sizeof("class")-1))) - { - zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, - "Cannot set read-only property %v::$%R", Z_OBJCE_P(object)->name, Z_TYPE_P(member), Z_UNIVAL_P(member)); - } - else - { - zend_std_obj_handlers->write_property(object, member, value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ zend_register_reflection_api */ -ZEND_API void zend_register_reflection_api(TSRMLS_D) { - zend_class_entry _reflection_entry; - - zend_std_obj_handlers = zend_get_std_object_handlers(); - memcpy(&reflection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - reflection_object_handlers.clone_obj = NULL; - reflection_object_handlers.write_property = _reflection_write_property; - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions); - reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions); - reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "Reflector", reflector_functions); - reflector_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflector_ptr->ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_function_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_function_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_parameter_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_ptr, NULL TSRMLS_CC); - zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_class_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_class_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr, NULL TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_property_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_property_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions); - _reflection_entry.create_object = reflection_objects_new; - reflection_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); - reflection_register_implement(reflection_extension_ptr, reflector_ptr TSRMLS_CC); - zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - /* Property modifiers */ - REGISTER_MAIN_LONG_CONSTANT("P_STATIC", ZEND_ACC_STATIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PUBLIC", ZEND_ACC_PUBLIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PROTECTED", ZEND_ACC_PROTECTED, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("P_PRIVATE", ZEND_ACC_PRIVATE, CONST_PERSISTENT|CONST_CS); - - /* Method modifiers */ - REGISTER_MAIN_LONG_CONSTANT("M_STATIC", ZEND_ACC_STATIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PUBLIC", ZEND_ACC_PUBLIC, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PROTECTED", ZEND_ACC_PROTECTED, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_PRIVATE", ZEND_ACC_PRIVATE, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_ABSTRACT", ZEND_ACC_ABSTRACT, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("M_FINAL", ZEND_ACC_FINAL, CONST_PERSISTENT|CONST_CS); - - /* Class modifiers */ - REGISTER_MAIN_LONG_CONSTANT("C_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("C_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS, CONST_PERSISTENT|CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("C_FINAL", ZEND_ACC_FINAL_CLASS, CONST_PERSISTENT|CONST_CS); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h deleted file mode 100644 index 2f7415c73c5f3..0000000000000 --- a/ext/reflection/php_reflection.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2005 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: George Schlossnagle <george@omniti.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_REFLECTION_API_H -#define ZEND_REFLECTION_API_H - -BEGIN_EXTERN_C() - -/* Class entry pointers */ -extern ZEND_API zend_class_entry *reflector_ptr; -extern ZEND_API zend_class_entry *reflection_exception_ptr; -extern ZEND_API zend_class_entry *reflection_ptr; -extern ZEND_API zend_class_entry *reflection_function_ptr; -extern ZEND_API zend_class_entry *reflection_parameter_ptr; -extern ZEND_API zend_class_entry *reflection_class_ptr; -extern ZEND_API zend_class_entry *reflection_object_ptr; -extern ZEND_API zend_class_entry *reflection_method_ptr; -extern ZEND_API zend_class_entry *reflection_property_ptr; -extern ZEND_API zend_class_entry *reflection_extension_ptr; - -ZEND_API void zend_register_reflection_api(TSRMLS_D); -ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC); - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/reflection/tests/001.phpt b/ext/reflection/tests/001.phpt deleted file mode 100755 index f60d4dd884c37..0000000000000 --- a/ext/reflection/tests/001.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Reflection inheritance ---FILE-- -<?php - -class ReflectionClassEx extends ReflectionClass -{ - public $bla; - - function getMethodNames() - { - $res = array(); - foreach($this->getMethods() as $m) - { - $res[] = $m->class . '::' . $m->name; - } - return $res; - } -} - -$r = new ReflectionClassEx('ReflectionClassEx'); - -$exp = array ( - 'UMLClass::__clone', - 'UMLClass::export', - 'UMLClass::__construct', - 'UMLClass::__toString', - 'UMLClass::getName', - 'UMLClass::isInternal', - 'UMLClass::isUserDefined', - 'UMLClass::isInstantiable', - 'UMLClass::getFileName', - 'UMLClass::getStartLine', - 'UMLClass::getEndLine', - 'UMLClass::getDocComment', - 'UMLClass::getConstructor', - 'UMLClass::getMethod', - 'UMLClass::getMethods', - 'UMLClass::getProperty', - 'UMLClass::getProperties', - 'UMLClass::getConstants', - 'UMLClass::getConstant', - 'UMLClass::getInterfaces', - 'UMLClass::isInterface', - 'UMLClass::isAbstract', - 'UMLClass::isFinal', - 'UMLClass::getModifiers', - 'UMLClass::isInstance', - 'UMLClass::newInstance', - 'UMLClass::getParentClass', - 'UMLClass::isSubclassOf', - 'UMLClass::getStaticProperties', - 'UMLClass::getDefaultProperties', - 'UMLClass::isIterateable', - 'UMLClass::implementsInterface', - 'UMLClass::getExtension', - 'UMLClass::getExtensionName'); - -$miss = array(); - -$res = $r->getMethodNames(); - -foreach($exp as $m) -{ - if (!in_array($m, $exp)) - { - $miss[] = $m; - } -} - -var_dump($miss); - -$props = array_keys(get_class_vars('ReflectionClassEx')); -sort($props); -var_dump($props); -var_dump($r->name); -?> -===DONE=== ---EXPECT-- -array(0) { -} -array(2) { - [0]=> - string(3) "bla" - [1]=> - string(4) "name" -} -string(17) "ReflectionClassEx" -===DONE=== ---UEXPECT-- -array(0) { -} -array(2) { - [0]=> - unicode(3) "bla" - [1]=> - unicode(4) "name" -} -unicode(17) "ReflectionClassEx" -===DONE=== diff --git a/ext/reflection/tests/002.phpt b/ext/reflection/tests/002.phpt deleted file mode 100755 index 41c0373c20901..0000000000000 --- a/ext/reflection/tests/002.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Reflection properties are read only ---FILE-- -<?php - -class ReflectionMethodEx extends ReflectionMethod -{ - public $foo = "xyz"; - - function __construct($c,$m) - { - echo __METHOD__ . "\n"; - parent::__construct($c,$m); - } -} - -$r = new ReflectionMethodEx('ReflectionMethodEx','getName'); - -var_dump($r->class); -var_dump($r->name); -var_dump($r->foo); -@var_dump($r->bar); - -try -{ - $r->class = 'bullshit'; -} -catch(ReflectionException $e) -{ - echo $e->getMessage() . "\n"; -} -try -{ -$r->name = 'bullshit'; -} -catch(ReflectionException $e) -{ - echo $e->getMessage() . "\n"; -} - -$r->foo = 'bar'; -$r->bar = 'baz'; - -var_dump($r->class); -var_dump($r->name); -var_dump($r->foo); -var_dump($r->bar); - -?> -===DONE=== ---EXPECTF-- -ReflectionMethodEx::__construct -string(18) "ReflectionMethodEx" -string(7) "getName" -string(3) "xyz" -NULL -Cannot set read-only property ReflectionMethodEx::$class -Cannot set read-only property ReflectionMethodEx::$name -string(18) "ReflectionMethodEx" -string(7) "getName" -string(3) "bar" -string(3) "baz" -===DONE=== ---UEXPECTF-- -ReflectionMethodEx::__construct -unicode(18) "ReflectionMethodEx" -unicode(7) "getName" -unicode(3) "xyz" -NULL -Cannot set read-only property ReflectionMethodEx::$class -Cannot set read-only property ReflectionMethodEx::$name -unicode(18) "ReflectionMethodEx" -unicode(7) "getName" -unicode(3) "bar" -unicode(3) "baz" -===DONE=== diff --git a/ext/reflection/tests/003.phpt b/ext/reflection/tests/003.phpt deleted file mode 100755 index 660389255907c..0000000000000 --- a/ext/reflection/tests/003.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -invoke() with base class method ---FILE-- -<?php - -class Foo -{ - function Test() - { - echo __METHOD__ . "\n"; - } -} - -class Bar extends Foo -{ - function Test() - { - echo __METHOD__ . "\n"; - } -} - -$o = new Bar; -$r = new ReflectionMethod('Foo','Test'); - -$r->invoke($o); - -?> -===DONE=== ---EXPECT-- -Foo::Test -===DONE=== diff --git a/ext/reflection/tests/004.phpt b/ext/reflection/tests/004.phpt deleted file mode 100755 index c5a243be6fafd..0000000000000 --- a/ext/reflection/tests/004.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -invoke() with non object or null value ---FILE-- -<?php - -class a { - function a(){ - } -} -class b { -} - -$b = new b(); - -$a=new ReflectionClass("a"); -$m=$a->getMethod("a"); - -try { - $m->invoke(null); -} catch (ReflectionException $E) { - echo $E->getMessage()."\n"; -} - - -try { - $m->invoke($b); -} catch (ReflectionException $E) { - echo $E->getMessage()."\n"; -} - -$b = new a(); -try { - $m->invoke($b); -} catch (ReflectionException $E) { - echo $E->getMessage()."\n"; -} - -echo "===DONE===\n";?> ---EXPECT-- -Non-object passed to Invoke() -Given object is not an instance of the class this method was declared in -===DONE=== diff --git a/ext/reflection/tests/005.phpt b/ext/reflection/tests/005.phpt deleted file mode 100755 index 032775b34321f..0000000000000 --- a/ext/reflection/tests/005.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ReflectionMethod::getDocComment() uses wrong comment block ---FILE-- -<?php - -function strip_doc_comment($c) -{ - if (!strlen($c) || $c === false) return $c; - return trim(substr($c, 3, -2)); -} - -/** Comment for class A */ -class A -{ - /** Method A::bla() - */ - function bla() - { - } - - function foo() { - /** - * This is a valid comment inside a method - */ - } - - function bar() { - // I don't have a doc comment.... - } - - /** - * Comment for A::baz() - */ - function baz() { - } -} - -$r = new ReflectionClass('A'); -var_dump(strip_doc_comment($r->getDocComment())); - -foreach($r->getMethods() as $m) -{ - var_dump(strip_doc_comment($m->getDocComment())); -} - -?> -===DONE=== ---EXPECT-- -string(19) "Comment for class A" -string(15) "Method A::bla()" -bool(false) -bool(false) -string(22) "* Comment for A::baz()" -===DONE=== ---UEXPECT-- -unicode(19) "Comment for class A" -unicode(15) "Method A::bla()" -bool(false) -bool(false) -unicode(22) "* Comment for A::baz()" -===DONE=== diff --git a/ext/reflection/tests/006.phpt b/ext/reflection/tests/006.phpt deleted file mode 100755 index 4e76fa7336fed..0000000000000 --- a/ext/reflection/tests/006.phpt +++ /dev/null @@ -1,120 +0,0 @@ ---TEST-- -ReflectionClass::[gs]etStaticPropertyValue ---FILE-- -<?php - -/* ReflectionClass cannot touch protected or private static properties */ - -/* ReflectionClass cannot create or delete static properties */ - -Class Test -{ - static public $pub = 'pub'; - static protected $pro = 'pro'; - static private $pri = 'pri'; - - static function testing() - { - $ref = new ReflectionClass('Test'); - - foreach(array('pub', 'pro', 'pri') as $name) - { - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } - } - } -} - -Class TestDerived extends Test -{ -// static public $pub = 'pub'; -// static protected $pro = 'pro'; - static private $pri = 'pri'; - - static function testing() - { - $ref = new ReflectionClass('Test'); - - foreach(array('pub', 'pro', 'pri') as $name) - { - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } - } - } -} - -$ref = new ReflectionClass('Test'); - -foreach(array('pub', 'pro', 'pri') as $name) -{ - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } -} - -Test::testing(); -TestDerived::testing(); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -string(3) "pub" -string(3) "pub" -string(7) "updated" -EXCEPTION -EXCEPTION -string(7) "updated" -string(7) "updated" -string(7) "updated" -EXCEPTION -EXCEPTION -string(7) "updated" -string(7) "updated" -string(7) "updated" -EXCEPTION -EXCEPTION -===DONE=== ---UEXPECT-- -unicode(3) "pub" -unicode(3) "pub" -unicode(7) "updated" -EXCEPTION -EXCEPTION -unicode(7) "updated" -unicode(7) "updated" -unicode(7) "updated" -EXCEPTION -EXCEPTION -unicode(7) "updated" -unicode(7) "updated" -unicode(7) "updated" -EXCEPTION -EXCEPTION -===DONE=== diff --git a/ext/reflection/tests/bug26640.phpt b/ext/reflection/tests/bug26640.phpt deleted file mode 100755 index 2cbd0d23d4149..0000000000000 --- a/ext/reflection/tests/bug26640.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26640 (__autoload() not invoked by Reflection classes) ---FILE-- -<?php - -function __autoload($c) -{ - class autoload_class - { - public function __construct() - { - print "autoload success\n"; - } - } -} - -$a = new ReflectionClass('autoload_class'); - -if (is_object($a)) { - echo "OK\n"; -} - -?> ---EXPECT-- -OK diff --git a/ext/reflection/tests/bug26695.phpt b/ext/reflection/tests/bug26695.phpt deleted file mode 100755 index 2d2deb53426a7..0000000000000 --- a/ext/reflection/tests/bug26695.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #26695 (Reflection API does not recognize mixed-case class hints) ---FILE-- -<?php - -class Foo { -} - -class Bar { - function demo(foo $f) { - } -} - -$class = new ReflectionClass('bar'); -$methods = $class->getMethods(); -$params = $methods[0]->getParameters(); - -$class = $params[0]->getClass(); - -var_dump($class->getName()); -?> -===DONE=== ---EXPECT-- -string(3) "Foo" -===DONE=== ---UEXPECT-- -unicode(3) "Foo" -===DONE=== diff --git a/ext/reflection/tests/bug29268.phpt b/ext/reflection/tests/bug29268.phpt deleted file mode 100755 index d1f74f2e2b236..0000000000000 --- a/ext/reflection/tests/bug29268.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #29268 (__autoload() not called with reflectionProperty->getClass()) ---FILE-- -<?php -function __autoload($classname) { - echo "__autoload($classname)\n"; - eval("class $classname {}"); -} - -class B{ - public function doit(A $a){ - } -} - -$ref = new reflectionMethod('B','doit'); -$parameters = $ref->getParameters(); -foreach($parameters as $parameter){ - $class = $parameter->getClass(); - echo $class->name."\n"; -} -echo "ok\n"; -?> ---EXPECT-- -__autoload(A) -A -ok diff --git a/ext/reflection/tests/bug29523.phpt b/ext/reflection/tests/bug29523.phpt deleted file mode 100755 index 01c83c2a15ef1..0000000000000 --- a/ext/reflection/tests/bug29523.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #29523 (ReflectionParameter::isOptional() is incorrect) ---FILE-- -<?php - -class TestClass -{ -} - -function optionalTest(TestClass $a, TestClass $b, $c = 3) -{ -} - -$function = new ReflectionFunction('optionalTest'); -$numberOfNotOptionalParameters = 0; -$numberOfOptionalParameters = 0; -foreach($function->getParameters() as $parameter) -{ - var_dump($parameter->isOptional()); - if ($parameter->isOptional()) - { - ++$numberOfOptionalParameters; - } - else - { - ++$numberOfNotOptionalParameters; - } -} -var_dump($function->getNumberOfRequiredParameters()); -var_dump($numberOfNotOptionalParameters); - -?> ---EXPECT-- -bool(false) -bool(false) -bool(true) -int(2) -int(2) diff --git a/ext/reflection/tests/bug29828.phpt b/ext/reflection/tests/bug29828.phpt deleted file mode 100755 index b82be39f981af..0000000000000 --- a/ext/reflection/tests/bug29828.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #29828 (Interfaces no longer work) ---FILE-- -<?php - -interface Bla -{ - function bla(); -} - -class BlaMore implements Bla -{ - function bla() - { - echo "Hello\n"; - } -} - -$r = new ReflectionClass('BlaMore'); - -var_dump(count($r->getMethods())); -var_dump($r->getMethod('bla')->isConstructor()); -var_dump($r->getMethod('bla')->isAbstract()); - -$o=new BlaMore; -$o->bla(); - -?> -===DONE=== ---EXPECT-- -int(1) -bool(false) -bool(false) -Hello -===DONE=== diff --git a/ext/reflection/tests/bug30146.phpt b/ext/reflection/tests/bug30146.phpt deleted file mode 100755 index 4f48985dcc343..0000000000000 --- a/ext/reflection/tests/bug30146.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #30146 (ReflectionProperty->getValue() requires instance for static property) ---FILE-- -<?php -class test { - static public $a = 1; -} - -$r = new ReflectionProperty('test', 'a'); -var_dump($r->getValue(null)); - -$r->setValue(NULL, 2); -var_dump($r->getValue()); - -$r->setValue(3); -var_dump($r->getValue()); -?> -===DONE=== ---EXPECT-- -int(1) -int(2) -int(3) -===DONE=== \ No newline at end of file diff --git a/ext/reflection/tests/bug30148.phpt b/ext/reflection/tests/bug30148.phpt deleted file mode 100755 index c3bfd0611f938..0000000000000 --- a/ext/reflection/tests/bug30148.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #30148 (ReflectionMethod->isConstructor() fails for inherited classes) ---FILE-- -<?php - -class Root -{ - function Root() {} -} -class Base extends Root -{ - function __construct() {} -} -class Derived extends Base -{ -} -$a = new ReflectionMethod('Root','Root'); -$b = new ReflectionMethod('Base','Root'); -$c = new ReflectionMethod('Base','__construct'); -$d = new ReflectionMethod('Derived','Root'); -$e = new ReflectionMethod('Derived','__construct'); -var_dump($a->isConstructor()); -var_dump($b->isConstructor()); -var_dump($c->isConstructor()); -var_dump($d->isConstructor()); -var_dump($e->isConstructor()); -?> -===DONE=== ---EXPECT-- -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -===DONE=== \ No newline at end of file diff --git a/ext/reflection/tests/bug30209.phpt b/ext/reflection/tests/bug30209.phpt deleted file mode 100755 index 1f230d38b8280..0000000000000 --- a/ext/reflection/tests/bug30209.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #30209 (ReflectionClass::getMethod() lowercases attribute) ---FILE-- -<?php - -class Foo -{ - private $name = 'testBAR'; - - public function testBAR() - { - try - { - $class = new ReflectionClass($this); - var_dump($this->name); - $method = $class->getMethod($this->name); - var_dump($this->name); - } - - catch (Exception $e) {} - } -} - -$foo = new Foo; -$foo->testBAR(); -?> -===DONE=== ---EXPECTF-- -string(7) "testBAR" -string(7) "testBAR" -===DONE=== ---UEXPECTF-- -unicode(7) "testBAR" -unicode(7) "testBAR" -===DONE=== diff --git a/ext/reflection/tests/bug30856.phpt b/ext/reflection/tests/bug30856.phpt deleted file mode 100755 index 4eb3715943919..0000000000000 --- a/ext/reflection/tests/bug30856.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #30856 (ReflectionClass::getStaticProperties segfaults) ---FILE-- -<?php -class bogus { - const C = 'test'; - static $a = bogus::C; -} - -$class = new ReflectionClass('bogus'); - -var_dump($class->getStaticProperties()); -?> -===DONE=== ---EXPECT-- -array(1) { - ["a"]=> - string(4) "test" -} -===DONE=== ---UEXPECT-- -array(1) { - [u"a"]=> - unicode(4) "test" -} -===DONE=== diff --git a/ext/reflection/tests/bug30961.phpt b/ext/reflection/tests/bug30961.phpt deleted file mode 100755 index 92ba6d1ab221e..0000000000000 --- a/ext/reflection/tests/bug30961.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) ---FILE-- -<?php - class a - { - } - - class b extends a - { - } - - $ref1 = new ReflectionClass('a'); - $ref2 = new ReflectionClass('b'); - echo $ref1->getStartLine() . "\n"; - echo $ref2->getStartLine() . "\n"; -?> ---EXPECT-- -2 -6 diff --git a/ext/reflection/tests/bug31651.phpt b/ext/reflection/tests/bug31651.phpt deleted file mode 100755 index 60bee14e9f69e..0000000000000 --- a/ext/reflection/tests/bug31651.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) ---FILE-- -<?php - -class Test -{ - public $a = array('a' => 1); -} - -$ref = new ReflectionClass('Test'); - -print_r($ref->getDefaultProperties()); - -?> ---EXPECT-- -Array -( - [a] => Array - ( - [a] => 1 - ) - -) diff --git a/ext/reflection/tests/bug32981.phpt b/ext/reflection/tests/bug32981.phpt deleted file mode 100755 index 30a3e89d0a421..0000000000000 --- a/ext/reflection/tests/bug32981.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault) ---FILE-- -<?php - -class TestClass -{ - static function test() - { - static $enabled = true; - } -} - -$class = new ReflectionClass('TestClass'); -foreach ($class->getMethods() as $method) -{ - var_dump($method->getName()); - $arr_static_vars[] = $method->getStaticVariables(); -} - -var_dump($arr_static_vars); - -?> -===DONE=== ---EXPECT-- -string(4) "test" -array(1) { - [0]=> - array(1) { - ["enabled"]=> - bool(true) - } -} -===DONE=== ---UEXPECT-- -unicode(4) "test" -array(1) { - [0]=> - array(1) { - [u"enabled"]=> - bool(true) - } -} -===DONE=== diff --git a/ext/reflection/tests/bug33312.phpt b/ext/reflection/tests/bug33312.phpt deleted file mode 100755 index 0c38304094cb7..0000000000000 --- a/ext/reflection/tests/bug33312.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #33312 (ReflectionParameter methods do not work correctly) ---FILE-- -<?php -class Foo { - public function bar(Foo $foo, $bar = 'bar') { - } -} - -$class = new ReflectionClass('Foo'); -$method = $class->getMethod('bar'); - -foreach ($method->getParameters() as $parameter) { - if ($parameter->isDefaultValueAvailable()) { - print $parameter->getDefaultValue()."\n"; - } -} -?> ---EXPECT-- -bar diff --git a/ext/reflection/tests/bug33389.phpt b/ext/reflection/tests/bug33389.phpt deleted file mode 100755 index 36f7079e2db86..0000000000000 --- a/ext/reflection/tests/bug33389.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Bug #33389 (double free() when exporting a ReflectionClass) ---FILE-- -<?php -define ('foobar', 1); -class Test { - function foo1($arg=foobar) { - } - function foo2($arg=null) { - } - function foo3($arg=false) { - } - function foo4($arg='foo') { - } - function foo5($arg=1) { - } - function bar($arg) { - } - function foo() { - } -} -Reflection::export(new ReflectionClass('Test')); -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Class [ <user> class Test ] { - @@ %sbug33389.php 3-18 - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [7] { - Method [ <user> public method foo1 ] { - @@ %sbug33389.php 4 - 5 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 1 ] - } - } - - Method [ <user> public method foo2 ] { - @@ %sbug33389.php 6 - 7 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = NULL ] - } - } - - Method [ <user> public method foo3 ] { - @@ %sbug33389.php 8 - 9 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = false ] - } - } - - Method [ <user> public method foo4 ] { - @@ %sbug33389.php 10 - 11 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 'foo' ] - } - } - - Method [ <user> public method foo5 ] { - @@ %sbug33389.php 12 - 13 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 1 ] - } - } - - Method [ <user> public method bar ] { - @@ %sbug33389.php 14 - 15 - - - Parameters [1] { - Parameter #0 [ <required> $arg ] - } - } - - Method [ <user> public method foo ] { - @@ %sbug33389.php 16 - 17 - } - } -} - -===DONE=== diff --git a/ext/reflection/tests/exception.inc b/ext/reflection/tests/exception.inc deleted file mode 100644 index e40333996544f..0000000000000 --- a/ext/reflection/tests/exception.inc +++ /dev/null @@ -1,16 +0,0 @@ -<?php -class ReflectionExceptionEx extends ReflectionException { - function MyException($_errno, $_errmsg) { - $this->errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } -} -?> diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt deleted file mode 100755 index 3e0cff13e749a..0000000000000 --- a/ext/reflection/tests/parameters_001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Check for parameter being optional ---FILE-- -<?php - -class Test { - function func($x, $y = NULL){ - } -} - - -$f = new ReflectionMethod('Test', 'func'); -var_dump($f->getNumberOfParameters()); -var_dump($f->getNumberOfRequiredParameters()); - -$p = new ReflectionParameter(array('Test', 'func'), 'x'); -var_dump($p->isOptional()); - -$p = new ReflectionParameter(array('Test', 'func'), 'y'); -var_dump($p->isOptional()); - -try { - $p = new ReflectionParameter(array('Test', 'func'), 'z'); - var_dump($p->isOptional()); -} -catch (Exception $e) { - var_dump($e->getMessage()); -} - -?> -===DONE=== ---EXPECT-- -int(2) -int(1) -bool(false) -bool(true) -string(54) "The parameter specified by its name could not be found" -===DONE=== ---UEXPECT-- -int(2) -int(1) -bool(false) -bool(true) -unicode(54) "The parameter specified by its name could not be found" -===DONE=== diff --git a/ext/reflection/tests/property_exists.phpt b/ext/reflection/tests/property_exists.phpt deleted file mode 100755 index fa712dfdbe5af..0000000000000 --- a/ext/reflection/tests/property_exists.phpt +++ /dev/null @@ -1,222 +0,0 @@ ---TEST-- -ZE2 property_exists() ---FILE-- -<?php - -class A -{ - public $a = 1; - protected $b = 2; - private $c = 3; - - public $empty; - public $init = 1; - - function __toString() - { - return 'obj(' . get_class($this) . ')'; - } - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -class B extends A -{ - private $c = 4; - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -class C extends B -{ - private $d = 5; - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -$oA = new A; -$oA->e = 6; - -$oC = new C; - -$pc = array($oA, 'A', 'B', 'C', $oC); -$pr = array('a', 'b', 'c', 'd', 'e'); - -foreach($pc as $p1) { - if (is_object($p1)) { - $p1->test($p1, $pr); - } else { - $r = new ReflectionMethod($p1, 'test'); - $r->invoke(NULL, $p1, $pr); - } - echo "===GLOBAL===\n"; - foreach($pr as $p2) { - echo $p1, '::$' , $p2, "\n"; - var_dump(property_exists($p1, $p2)); - } -} - -echo "===PROBLEMS===\n"; -var_dump(property_exists(NULL, 'empty')); -var_dump(property_exists(25,'empty')); -var_dump(property_exists('','')); -var_dump(property_exists('A','')); -var_dump(property_exists('A','123')); -var_dump(property_exists('A','init')); -var_dump(property_exists('A','empty')); -var_dump(property_exists(new A, '')); -var_dump(property_exists(new A, '123')); -var_dump(property_exists(new A, 'init')); -var_dump(property_exists(new A, 'empty')); -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===A=== -obj(A)::$a -bool(true) -obj(A)::$b -bool(true) -obj(A)::$c -bool(true) -obj(A)::$d -bool(false) -obj(A)::$e -bool(true) -===GLOBAL=== -obj(A)::$a -bool(true) -obj(A)::$b -bool(false) -obj(A)::$c -bool(false) -obj(A)::$d -bool(false) -obj(A)::$e -bool(true) -===A=== -A::$a -bool(true) -A::$b -bool(true) -A::$c -bool(true) -A::$d -bool(false) -A::$e -bool(false) -===GLOBAL=== -A::$a -bool(true) -A::$b -bool(false) -A::$c -bool(false) -A::$d -bool(false) -A::$e -bool(false) -===B=== -B::$a -bool(true) -B::$b -bool(true) -B::$c -bool(true) -B::$d -bool(false) -B::$e -bool(false) -===GLOBAL=== -B::$a -bool(true) -B::$b -bool(false) -B::$c -bool(false) -B::$d -bool(false) -B::$e -bool(false) -===C=== -C::$a -bool(true) -C::$b -bool(true) -C::$c -bool(false) -C::$d -bool(true) -C::$e -bool(false) -===GLOBAL=== -C::$a -bool(true) -C::$b -bool(false) -C::$c -bool(false) -C::$d -bool(false) -C::$e -bool(false) -===C=== -obj(C)::$a -bool(true) -obj(C)::$b -bool(true) -obj(C)::$c -bool(false) -obj(C)::$d -bool(true) -obj(C)::$e -bool(false) -===GLOBAL=== -obj(C)::$a -bool(true) -obj(C)::$b -bool(false) -obj(C)::$c -bool(false) -obj(C)::$d -bool(false) -obj(C)::$e -bool(false) -===PROBLEMS=== - -Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists.php on line %d -NULL - -Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists.php on line %d -NULL -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -bool(false) -bool(false) -bool(true) -bool(true) -===DONE=== diff --git a/ext/reflection/tests/static_properties_002.phpt b/ext/reflection/tests/static_properties_002.phpt deleted file mode 100755 index 29b84a8e65974..0000000000000 --- a/ext/reflection/tests/static_properties_002.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -ZE2 Inheriting static properties ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class base { - static protected $prop = 2; - - static function show() { - echo __METHOD__ . '(' . self::$prop . ")\n"; - } - - static function inc() { - base::$prop++; - echo __METHOD__ . "()\n"; - } -} - -class derived extends base { - static public $prop; - - static function show() { - echo __METHOD__ . '(' . self::$prop . ")\n"; - } - - static function inc() { - derived::$prop++; - echo __METHOD__ . "()\n"; - } -} - -base::show(); -derived::show(); - -base::inc(); - -base::show(); -derived::show(); - -derived::inc(); - -base::show(); -derived::show(); - -$r = new ReflectionClass('derived'); -echo 'Number of properties: '. count($r->getStaticProperties()) . "\n"; - -echo "Done\n"; -?> ---EXPECTF-- -base::show(2) -derived::show(2) -base::inc() -base::show(3) -derived::show(3) -derived::inc() -base::show(4) -derived::show(4) -Number of properties: 1 -Done diff --git a/ext/session/CREDITS b/ext/session/CREDITS deleted file mode 100644 index 79659c7035335..0000000000000 --- a/ext/session/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sessions -Sascha Schumann, Andrei Zmievski diff --git a/ext/session/config.m4 b/ext/session/config.m4 deleted file mode 100644 index 93df332b40662..0000000000000 --- a/ext/session/config.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(session, whether to enable PHP sessions, -[ --disable-session Disable session support], yes) - -PHP_ARG_WITH(mm,for mm support, -[ --with-mm[=DIR] SESSION: Include mm support for session storage], no, no) - -if test "$PHP_SESSION" != "no"; then - PHP_PWRITE_TEST - PHP_PREAD_TEST - PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared) - PHP_SUBST(SESSION_SHARED_LIBADD) - PHP_INSTALL_HEADERS(ext/session, [php_session.h mod_files.h mod_user.h]) - AC_DEFINE(HAVE_PHP_SESSION,1,[ ]) -fi - -if test "$PHP_MM" != "no"; then - for i in $PHP_MM /usr/local /usr; do - test -f "$i/include/mm.h" && MM_DIR=$i && break - done - - if test -z "$MM_DIR" ; then - AC_MSG_ERROR(cannot find mm library) - fi - - PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/$PHP_LIBDIR, SESSION_SHARED_LIBADD) - PHP_ADD_INCLUDE($MM_DIR/include) - PHP_INSTALL_HEADERS([ext/session/mod_mm.h]) - AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm]) -fi diff --git a/ext/session/config.w32 b/ext/session/config.w32 deleted file mode 100644 index fd568f3c3e639..0000000000000 --- a/ext/session/config.w32 +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("session", "session support", "yes"); - -if (PHP_SESSION == "yes") { - EXTENSION("session", "session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */); - AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support"); -} - - diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c deleted file mode 100644 index 7847313fd921a..0000000000000 --- a/ext/session/mod_files.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include <sys/stat.h> -#include <sys/types.h> - -#if HAVE_SYS_FILE_H -#include <sys/file.h> -#endif - -#if HAVE_DIRENT_H -#include <dirent.h> -#endif - -#ifdef PHP_WIN32 -#include "win32/readdir.h" -#endif -#include <time.h> - -#include <fcntl.h> -#include <errno.h> - -#if HAVE_UNISTD_H -#include <unistd.h> -#endif - -#include "php_session.h" -#include "mod_files.h" -#include "ext/standard/flock_compat.h" -#include "php_open_temporary_file.h" - -#define FILE_PREFIX "sess_" - -typedef struct { - int fd; - char *lastkey; - char *basedir; - size_t basedir_len; - size_t dirdepth; - size_t st_size; - int filemode; -} ps_files; - -ps_module ps_mod_files = { - PS_MOD(files) -}; - -/* If you change the logic here, please also update the error message in - * ps_files_open() appropriately */ -static int ps_files_valid_key(const char *key) -{ - size_t len; - const char *p; - char c; - int ret = 1; - - for (p = key; (c = *p); p++) { - /* valid characters are a..z,A..Z,0..9 */ - if (!((c >= 'a' && c <= 'z') - || (c >= 'A' && c <= 'Z') - || (c >= '0' && c <= '9') - || c == ',' - || c == '-')) { - ret = 0; - break; - } - } - - len = p - key; - - if (len == 0) - ret = 0; - - return ret; -} - -static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const char *key) -{ - size_t key_len; - const char *p; - int i; - int n; - - key_len = strlen(key); - if (key_len <= data->dirdepth || buflen < - (strlen(data->basedir) + 2 * data->dirdepth + key_len + 5 + sizeof(FILE_PREFIX))) - return NULL; - p = key; - memcpy(buf, data->basedir, data->basedir_len); - n = data->basedir_len; - buf[n++] = PHP_DIR_SEPARATOR; - for (i = 0; i < (int)data->dirdepth; i++) { - buf[n++] = *p++; - buf[n++] = PHP_DIR_SEPARATOR; - } - memcpy(buf + n, FILE_PREFIX, sizeof(FILE_PREFIX) - 1); - n += sizeof(FILE_PREFIX) - 1; - memcpy(buf + n, key, key_len); - n += key_len; - buf[n] = '\0'; - - return buf; -} - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -static void ps_files_close(ps_files *data) -{ - if (data->fd != -1) { -#ifdef PHP_WIN32 - /* On Win32 locked files that are closed without being explicitly unlocked - will be unlocked only when "system resources become available". */ - flock(data->fd, LOCK_UN); -#endif - close(data->fd); - data->fd = -1; - } -} - -static void ps_files_open(ps_files *data, const char *key TSRMLS_DC) -{ - char buf[MAXPATHLEN]; - - if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) { - if (data->lastkey) { - efree(data->lastkey); - data->lastkey = NULL; - } - - ps_files_close(data); - - if (!ps_files_valid_key(key)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'"); - return; - } - if (!ps_files_path_create(buf, sizeof(buf), data, key)) - return; - - data->lastkey = estrdup(key); - - data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, - data->filemode); - - if (data->fd != -1) { - flock(data->fd, LOCK_EX); - -#ifdef F_SETFD -#ifndef FD_CLOEXEC -#define FD_CLOEXEC 1 -#endif - if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno); - } -#endif - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, - strerror(errno), errno); - } - } -} - -static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC) -{ - DIR *dir; - char dentry[sizeof(struct dirent) + MAXPATHLEN]; - struct dirent *entry = (struct dirent *) &dentry; - struct stat sbuf; - char buf[MAXPATHLEN]; - time_t now; - int nrdels = 0; - size_t dirname_len; - - dir = opendir(dirname); - if (!dir) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno); - return (0); - } - - time(&now); - - dirname_len = strlen(dirname); - - /* Prepare buffer (dirname never changes) */ - memcpy(buf, dirname, dirname_len); - buf[dirname_len] = PHP_DIR_SEPARATOR; - - while (php_readdir_r(dir, (struct dirent *) dentry, &entry) == 0 && entry) { - /* does the file start with our prefix? */ - if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) { - size_t entry_len; - - entry_len = strlen(entry->d_name); - /* does it fit into our buffer? */ - if (entry_len + dirname_len + 2 < MAXPATHLEN) { - /* create the full path.. */ - memcpy(buf + dirname_len + 1, entry->d_name, entry_len); - /* NUL terminate it and */ - buf[dirname_len + entry_len + 1] = '\0'; - /* check whether its last access was more than maxlifet ago */ - if (VCWD_STAT(buf, &sbuf) == 0 && -#ifdef NETWARE - (now - sbuf.st_mtime.tv_sec) > maxlifetime) { -#else - (now - sbuf.st_mtime) > maxlifetime) { -#endif - VCWD_UNLINK(buf); - nrdels++; - } - } - } - } - - closedir(dir); - - return (nrdels); -} - -#define PS_FILES_DATA ps_files *data = PS_GET_MOD_DATA() - -PS_OPEN_FUNC(files) -{ - ps_files *data; - const char *p, *last; - const char *argv[3]; - int argc = 0; - size_t dirdepth = 0; - int filemode = 0600; - - if (*save_path == '\0') { - /* if save path is an empty string, determine the temporary dir */ - save_path = php_get_temporary_directory(); - } - - /* split up input parameter */ - last = save_path; - p = strchr(save_path, ';'); - while (p) { - argv[argc++] = last; - last = ++p; - p = strchr(p, ';'); - if (argc > 1) break; - } - argv[argc++] = last; - - if (argc > 1) { - errno = 0; - dirdepth = (size_t) strtol(argv[0], NULL, 10); - if (errno == ERANGE) { - php_error(E_WARNING, - "The first parameter in session.save_path is invalid"); - return FAILURE; - } - } - - if (argc > 2) { - errno = 0; - filemode = strtol(argv[1], NULL, 8); - if (errno == ERANGE || filemode < 0 || filemode > 07777) { - php_error(E_WARNING, - "The second parameter in session.save_path is invalid"); - return FAILURE; - } - } - save_path = argv[argc - 1]; - - data = emalloc(sizeof(*data)); - memset(data, 0, sizeof(*data)); - - data->fd = -1; - data->dirdepth = dirdepth; - data->filemode = filemode; - data->basedir_len = strlen(save_path); - data->basedir = estrndup(save_path, data->basedir_len); - - PS_SET_MOD_DATA(data); - - return SUCCESS; -} - -PS_CLOSE_FUNC(files) -{ - PS_FILES_DATA; - - ps_files_close(data); - - if (data->lastkey) - efree(data->lastkey); - efree(data->basedir); - efree(data); - *mod_data = NULL; - - return SUCCESS; -} - -PS_READ_FUNC(files) -{ - long n; - struct stat sbuf; - PS_FILES_DATA; - - ps_files_open(data, key TSRMLS_CC); - if (data->fd < 0) - return FAILURE; - - if (fstat(data->fd, &sbuf)) - return FAILURE; - - data->st_size = *vallen = sbuf.st_size; - - if (sbuf.st_size == 0) { - *val = STR_EMPTY_ALLOC(); - return SUCCESS; - } - - *val = emalloc(sbuf.st_size); - -#if defined(HAVE_PREAD) - n = pread(data->fd, *val, sbuf.st_size, 0); -#else - lseek(data->fd, 0, SEEK_SET); - n = read(data->fd, *val, sbuf.st_size); -#endif - - if (n != sbuf.st_size) { - if (n == -1) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested"); - efree(*val); - return FAILURE; - } - - return SUCCESS; -} - -PS_WRITE_FUNC(files) -{ - long n; - PS_FILES_DATA; - - ps_files_open(data, key TSRMLS_CC); - if (data->fd < 0) - return FAILURE; - - /* - * truncate file, if the amount of new data is smaller than - * the existing data set. - */ - - if (vallen < (int)data->st_size) - ftruncate(data->fd, 0); - -#if defined(HAVE_PWRITE) - n = pwrite(data->fd, val, vallen, 0); -#else - lseek(data->fd, 0, SEEK_SET); - n = write(data->fd, val, vallen); -#endif - - if (n != vallen) { - if (n == -1) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested"); - return FAILURE; - } - - return SUCCESS; -} - -PS_DESTROY_FUNC(files) -{ - char buf[MAXPATHLEN]; - PS_FILES_DATA; - - if (!ps_files_path_create(buf, sizeof(buf), data, key)) - return FAILURE; - - ps_files_close(data); - - if (VCWD_UNLINK(buf) == -1) { - return FAILURE; - } - - return SUCCESS; -} - -PS_GC_FUNC(files) -{ - PS_FILES_DATA; - - /* we don't perform any cleanup, if dirdepth is larger than 0. - we return SUCCESS, since all cleanup should be handled by - an external entity (i.e. find -ctime x | xargs rm) */ - - if (data->dirdepth == 0) - *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime TSRMLS_CC); - - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h deleted file mode 100644 index 60f7dff7219bf..0000000000000 --- a/ext/session/mod_files.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef MOD_FILES_H -#define MOD_FILES_H - -extern ps_module ps_mod_files; -#define ps_files_ptr &ps_mod_files - -PS_FUNCS(files); - -#endif diff --git a/ext/session/mod_files.sh b/ext/session/mod_files.sh deleted file mode 100644 index 6d9d5d9497b3e..0000000000000 --- a/ext/session/mod_files.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh - -if test "$2" = ""; then - echo "usage: $0 basedir depth" - exit 1 -fi - -if test "$2" = "0"; then - exit 0 -fi - -hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f" -if test "$3" -a "$3" -ge "5"; then - hash_chars="$hash_chars g h i j k l m n o p q r s t u v" - if test "$3" -eq "6"; then - hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ," - fi -fi - -for i in $hash_chars; do - newpath="$1/$i" - mkdir $newpath || exit 1 - sh $0 $newpath `expr $2 - 1 $3` -done diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c deleted file mode 100644 index 5956f38963c22..0000000000000 --- a/ext/session/mod_mm.c +++ /dev/null @@ -1,437 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_LIBMM - -#include <unistd.h> -#include <mm.h> -#include <time.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <fcntl.h> - -#include "php_session.h" -#include "mod_mm.h" -#include "SAPI.h" - -#ifdef ZTS -# error mm is not thread-safe -#endif - -#define PS_MM_FILE "session_mm_" - -/* For php_uint32 */ -#include "ext/standard/basic_functions.h" - -/* - * this list holds all data associated with one session - */ - -typedef struct ps_sd { - struct ps_sd *next; - php_uint32 hv; /* hash value of key */ - time_t ctime; /* time of last change */ - void *data; - size_t datalen; /* amount of valid data */ - size_t alloclen; /* amount of allocated memory for data */ - char key[1]; /* inline key */ -} ps_sd; - -typedef struct { - MM *mm; - ps_sd **hash; - php_uint32 hash_max; - php_uint32 hash_cnt; - pid_t owner; -} ps_mm; - -static ps_mm *ps_mm_instance = NULL; - -#if 0 -#define ps_mm_debug(a) printf a -#else -#define ps_mm_debug(a) -#endif - -static inline php_uint32 ps_sd_hash(const char *data, int len) -{ - php_uint32 h; - const char *e = data + len; - - for (h = 2166136261U; data < e; ) { - h *= 16777619; - h ^= *data++; - } - - return h; -} - -static void hash_split(ps_mm *data) -{ - php_uint32 nmax; - ps_sd **nhash; - ps_sd **ohash, **ehash; - ps_sd *ps, *next; - - nmax = ((data->hash_max + 1) << 1) - 1; - nhash = mm_calloc(data->mm, nmax + 1, sizeof(*data->hash)); - - if (!nhash) { - /* no further memory to expand hash table */ - return; - } - - ehash = data->hash + data->hash_max + 1; - for (ohash = data->hash; ohash < ehash; ohash++) { - for (ps = *ohash; ps; ps = next) { - next = ps->next; - ps->next = nhash[ps->hv & nmax]; - nhash[ps->hv & nmax] = ps; - } - } - mm_free(data->mm, data->hash); - - data->hash = nhash; - data->hash_max = nmax; -} - -static ps_sd *ps_sd_new(ps_mm *data, const char *key) -{ - php_uint32 hv, slot; - ps_sd *sd; - int keylen; - - keylen = strlen(key); - - sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen); - if (!sd) { - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error()); - return NULL; - } - - hv = ps_sd_hash(key, keylen); - slot = hv & data->hash_max; - - sd->ctime = 0; - sd->hv = hv; - sd->data = NULL; - sd->alloclen = sd->datalen = 0; - - memcpy(sd->key, key, keylen + 1); - - sd->next = data->hash[slot]; - data->hash[slot] = sd; - - data->hash_cnt++; - - if (!sd->next) { - if (data->hash_cnt >= data->hash_max) - hash_split(data); - } - - ps_mm_debug(("inserting %s(%p) into slot %d\n", key, sd, slot)); - - return sd; -} - -static void ps_sd_destroy(ps_mm *data, ps_sd *sd) -{ - php_uint32 slot; - - slot = ps_sd_hash(sd->key, strlen(sd->key)) & data->hash_max; - - if (data->hash[slot] == sd) - data->hash[slot] = sd->next; - else { - ps_sd *prev; - - /* There must be some entry before the one we want to delete */ - for (prev = data->hash[slot]; prev->next != sd; prev = prev->next); - prev->next = sd->next; - } - - data->hash_cnt--; - if (sd->data) - mm_free(data->mm, sd->data); - mm_free(data->mm, sd); -} - -static ps_sd *ps_sd_lookup(ps_mm *data, const char *key, int rw) -{ - php_uint32 hv, slot; - ps_sd *ret, *prev; - - hv = ps_sd_hash(key, strlen(key)); - slot = hv & data->hash_max; - - for (prev = NULL, ret = data->hash[slot]; ret; prev = ret, ret = ret->next) - if (ret->hv == hv && !strcmp(ret->key, key)) - break; - - if (ret && rw && ret != data->hash[slot]) { - /* Move the entry to the top of the linked list */ - - if (prev) - prev->next = ret->next; - ret->next = data->hash[slot]; - data->hash[slot] = ret; - } - - ps_mm_debug(("lookup(%s): ret=%p,hv=%u,slot=%d\n", key, ret, hv, slot)); - - return ret; -} - -ps_module ps_mod_mm = { - PS_MOD(mm) -}; - -#define PS_MM_DATA ps_mm *data = PS_GET_MOD_DATA() - -static int ps_mm_initialize(ps_mm *data, const char *path) -{ - data->owner = getpid(); - data->mm = mm_create(0, path); - if (!data->mm) { - return FAILURE; - } - - data->hash_cnt = 0; - data->hash_max = 511; - data->hash = mm_calloc(data->mm, data->hash_max + 1, sizeof(ps_sd *)); - if (!data->hash) { - mm_destroy(data->mm); - return FAILURE; - } - - return SUCCESS; -} - -static void ps_mm_destroy(ps_mm *data) -{ - int h; - ps_sd *sd, *next; - - /* This function is called during each module shutdown, - but we must not release the shared memory pool, when - an Apache child dies! */ - if (data->owner != getpid()) return; - - for (h = 0; h < data->hash_max + 1; h++) - for (sd = data->hash[h]; sd; sd = next) { - next = sd->next; - ps_sd_destroy(data, sd); - } - - mm_free(data->mm, data->hash); - mm_destroy(data->mm); - free(data); -} - -PHP_MINIT_FUNCTION(ps_mm) -{ - int save_path_len = strlen(PS(save_path)); - int mod_name_len = strlen(sapi_module.name); - char *ps_mm_path, euid[30]; - int ret; - - ps_mm_instance = calloc(sizeof(*ps_mm_instance), 1); - if (!ps_mm_instance) - return FAILURE; - - if (!sprintf(euid,"%d", geteuid())) - return FAILURE; - - /* Directory + '/' + File + Module Name + Effective UID + \0 */ - ps_mm_path = emalloc(save_path_len+1+sizeof(PS_MM_FILE)+mod_name_len+strlen(euid)+1); - - memcpy(ps_mm_path, PS(save_path), save_path_len + 1); - if (save_path_len > 0 && ps_mm_path[save_path_len - 1] != DEFAULT_SLASH) { - ps_mm_path[save_path_len] = DEFAULT_SLASH; - ps_mm_path[save_path_len+1] = '\0'; - } - strcat(ps_mm_path, PS_MM_FILE); - strcat(ps_mm_path, sapi_module.name); - strcat(ps_mm_path, euid); - - ret = ps_mm_initialize(ps_mm_instance, ps_mm_path); - - efree(ps_mm_path); - - if (ret != SUCCESS) { - free(ps_mm_instance); - ps_mm_instance = NULL; - return FAILURE; - } - - php_session_register_module(&ps_mod_mm); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(ps_mm) -{ - if (ps_mm_instance) { - ps_mm_destroy(ps_mm_instance); - return SUCCESS; - } - return FAILURE; -} - -PS_OPEN_FUNC(mm) -{ - ps_mm_debug(("open: ps_mm_instance=%p\n", ps_mm_instance)); - - if (!ps_mm_instance) - return FAILURE; - - PS_SET_MOD_DATA(ps_mm_instance); - - return SUCCESS; -} - -PS_CLOSE_FUNC(mm) -{ - PS_SET_MOD_DATA(NULL); - - return SUCCESS; -} - -PS_READ_FUNC(mm) -{ - PS_MM_DATA; - ps_sd *sd; - int ret = FAILURE; - - mm_lock(data->mm, MM_LOCK_RD); - - sd = ps_sd_lookup(data, key, 0); - if (sd) { - *vallen = sd->datalen; - *val = emalloc(sd->datalen + 1); - memcpy(*val, sd->data, sd->datalen); - (*val)[sd->datalen] = '\0'; - ret = SUCCESS; - } - - mm_unlock(data->mm); - - return ret; -} - -PS_WRITE_FUNC(mm) -{ - PS_MM_DATA; - ps_sd *sd; - - mm_lock(data->mm, MM_LOCK_RW); - - sd = ps_sd_lookup(data, key, 1); - if (!sd) { - sd = ps_sd_new(data, key); - ps_mm_debug(("new entry for %s\n", key)); - } - - if (sd) { - if (vallen >= sd->alloclen) { - if (data->mm) - mm_free(data->mm, sd->data); - sd->alloclen = vallen + 1; - sd->data = mm_malloc(data->mm, sd->alloclen); - - if (!sd->data) { - ps_sd_destroy(data, sd); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot allocate new data segment"); - sd = NULL; - } - } - if (sd) { - sd->datalen = vallen; - memcpy(sd->data, val, vallen); - time(&sd->ctime); - } - } - - mm_unlock(data->mm); - - return sd ? SUCCESS : FAILURE; -} - -PS_DESTROY_FUNC(mm) -{ - PS_MM_DATA; - ps_sd *sd; - - mm_lock(data->mm, MM_LOCK_RW); - - sd = ps_sd_lookup(data, key, 0); - if (sd) - ps_sd_destroy(data, sd); - - mm_unlock(data->mm); - - return SUCCESS; -} - -PS_GC_FUNC(mm) -{ - PS_MM_DATA; - time_t limit; - ps_sd **ohash, **ehash; - ps_sd *sd, *next; - - *nrdels = 0; - ps_mm_debug(("gc\n")); - - time(&limit); - - limit -= maxlifetime; - - mm_lock(data->mm, MM_LOCK_RW); - - ehash = data->hash + data->hash_max + 1; - for (ohash = data->hash; ohash < ehash; ohash++) - for (sd = *ohash; sd; sd = next) { - next = sd->next; - if (sd->ctime < limit) { - ps_mm_debug(("purging %s\n", sd->key)); - ps_sd_destroy(data, sd); - (*nrdels)++; - } - } - - mm_unlock(data->mm); - - return SUCCESS; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h deleted file mode 100644 index c791a38895a82..0000000000000 --- a/ext/session/mod_mm.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef MOD_MM_H -#define MOD_MM_H - -#ifdef HAVE_LIBMM - -#include "php_session.h" - -PHP_MINIT_FUNCTION(ps_mm); -PHP_MSHUTDOWN_FUNCTION(ps_mm); - -extern ps_module ps_mod_mm; -#define ps_mm_ptr &ps_mod_mm - -PS_FUNCS(mm); - -#endif -#endif diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c deleted file mode 100644 index bd1be2bee4b8d..0000000000000 --- a/ext/session/mod_user.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_session.h" -#include "mod_user.h" - -ps_module ps_mod_user = { - PS_MOD(user) -}; - -#define SESS_ZVAL_LONG(val, a) \ -{ \ - MAKE_STD_ZVAL(a); \ - Z_TYPE_P(a) = IS_LONG; \ - Z_LVAL_P(a) = val; \ -} - -#define SESS_ZVAL_STRING(vl, a) \ -{ \ - int len = strlen(vl); \ - MAKE_STD_ZVAL(a); \ - Z_TYPE_P(a) = IS_STRING; \ - Z_STRLEN_P(a) = len; \ - Z_STRVAL_P(a) = estrndup(vl, len); \ -} - -#define SESS_ZVAL_STRINGN(vl, ln, a) \ -{ \ - MAKE_STD_ZVAL(a); \ - Z_TYPE_P(a) = IS_STRING; \ - Z_STRLEN_P(a) = ln; \ - Z_STRVAL_P(a) = estrndup(vl, ln); \ -} - - -static zval *ps_call_handler(zval *func, int argc, zval **argv TSRMLS_DC) -{ - int i; - zval *retval = NULL; - - MAKE_STD_ZVAL(retval); - if (call_user_function(EG(function_table), NULL, func, retval, - argc, argv TSRMLS_CC) == FAILURE) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - for (i = 0; i < argc; i++) { - zval_ptr_dtor(&argv[i]); - } - - return retval; -} - -#define STDVARS \ - zval *retval; \ - int ret = FAILURE; \ - ps_user *mdata = PS_GET_MOD_DATA(); \ - if (!mdata) \ - return FAILURE - -#define PSF(a) mdata->name.ps_##a - -#define FINISH \ - if (retval) { \ - convert_to_long(retval); \ - ret = Z_LVAL_P(retval); \ - zval_ptr_dtor(&retval); \ - } \ - return ret - -PS_OPEN_FUNC(user) -{ - zval *args[2]; - STDVARS; - - SESS_ZVAL_STRING(save_path, args[0]); - SESS_ZVAL_STRING(session_name, args[1]); - - retval = ps_call_handler(PSF(open), 2, args TSRMLS_CC); - - FINISH; -} - -PS_CLOSE_FUNC(user) -{ - int i; - STDVARS; - - retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); - - for (i = 0; i < 6; i++) - zval_ptr_dtor(&mdata->names[i]); - efree(mdata); - - PS_SET_MOD_DATA(NULL); - - FINISH; -} - -PS_READ_FUNC(user) -{ - zval *args[1]; - STDVARS; - - SESS_ZVAL_STRING(key, args[0]); - - retval = ps_call_handler(PSF(read), 1, args TSRMLS_CC); - - if (retval) { - if (Z_TYPE_P(retval) == IS_STRING) { - *val = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *vallen = Z_STRLEN_P(retval); - ret = SUCCESS; - } - zval_ptr_dtor(&retval); - } - - return ret; -} - -PS_WRITE_FUNC(user) -{ - zval *args[2]; - STDVARS; - - SESS_ZVAL_STRING(key, args[0]); - SESS_ZVAL_STRINGN(val, vallen, args[1]); - - retval = ps_call_handler(PSF(write), 2, args TSRMLS_CC); - - FINISH; -} - -PS_DESTROY_FUNC(user) -{ - zval *args[1]; - STDVARS; - - SESS_ZVAL_STRING(key, args[0]); - - retval = ps_call_handler(PSF(destroy), 1, args TSRMLS_CC); - - FINISH; -} - -PS_GC_FUNC(user) -{ - zval *args[1]; - STDVARS; - - SESS_ZVAL_LONG(maxlifetime, args[0]); - - retval = ps_call_handler(PSF(gc), 1, args TSRMLS_CC); - - FINISH; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h deleted file mode 100644 index c9e2edf67003e..0000000000000 --- a/ext/session/mod_user.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef MOD_USER_H -#define MOD_USER_H - -typedef union { - zval *names[6]; - struct { - zval *ps_open; - zval *ps_close; - zval *ps_read; - zval *ps_write; - zval *ps_destroy; - zval *ps_gc; - } name; -} ps_user; - -extern ps_module ps_mod_user; -#define ps_user_ptr &ps_mod_user - -PS_FUNCS(user); - -#endif diff --git a/ext/session/package.xml b/ext/session/package.xml deleted file mode 100644 index e176dc3d829ae..0000000000000 --- a/ext/session/package.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>session</name> - <summary>Session handling functions</summary> - <maintainers> - <maintainer> - <user>sascha</user> - <name>Sascha Schumann</name> - <email>sas@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>andrei</user> - <name>Andrei Zmievski</name> - <email>andrei@php.net</email> - <role>lead</role> - </maintainer> - </maintainers> - <description> -Session support in PHP consists of a way to preserve certain data -across subsequent accesses. This enables you to build more customized -applications and increase the appeal of your web site. - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="mod_files.c"/> - <file role="src" name="mod_files.h"/> - <file role="src" name="mod_files.sh"/> - <file role="src" name="mod_mm.c"/> - <file role="src" name="mod_mm.h"/> - <file role="src" name="mod_user.c"/> - <file role="src" name="mod_user.h"/> - <file role="src" name="php_session.h"/> - <file role="src" name="session.c"/> - <file role="test" name="tests/001.phpt"/> - <file role="test" name="tests/002.phpt"/> - <file role="test" name="tests/bug25745.phpt"/> - <file role="test" name="tests/001.phpt"/> - <file role="test" name="tests/002.phpt"/> - <file role="test" name="tests/003.phpt"/> - <file role="test" name="tests/004.phpt"/> - <file role="test" name="tests/005.phpt"/> - <file role="test" name="tests/006.phpt"/> - <file role="test" name="tests/007.phpt"/> - <file role="test" name="tests/008-php4.2.3.phpt"/> - <file role="test" name="tests/008.phpt"/> - <file role="test" name="tests/009.phpt"/> - <file role="test" name="tests/010.phpt"/> - <file role="test" name="tests/011.phpt"/> - <file role="test" name="tests/012.phpt"/> - <file role="test" name="tests/013.phpt"/> - <file role="test" name="tests/014.phpt"/> - <file role="test" name="tests/015.phpt"/> - <file role="test" name="tests/016.phpt"/> - <file role="test" name="tests/017.phpt"/> - <file role="test" name="tests/018.phpt"/> - <file role="test" name="tests/019.phpt"/> - <file role="test" name="tests/020.phpt"/> - <file role="test" name="tests/021.phpt"/> - <file role="test" name="tests/skipif.inc"/> - <file role="test" name="tests/bug26862.phpt"/> - <file role="test" name="tests/bug24592.phpt"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/session/php_session.h b/ext/session/php_session.h deleted file mode 100644 index b4deee507eaa0..0000000000000 --- a/ext/session/php_session.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_SESSION_H -#define PHP_SESSION_H - -#include "ext/standard/php_var.h" - -#define PHP_SESSION_API 20020330 - -#define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name TSRMLS_DC -#define PS_CLOSE_ARGS void **mod_data TSRMLS_DC -#define PS_READ_ARGS void **mod_data, const char *key, char **val, int *vallen TSRMLS_DC -#define PS_WRITE_ARGS void **mod_data, const char *key, const char *val, const int vallen TSRMLS_DC -#define PS_DESTROY_ARGS void **mod_data, const char *key TSRMLS_DC -#define PS_GC_ARGS void **mod_data, int maxlifetime, int *nrdels TSRMLS_DC -#define PS_CREATE_SID_ARGS void **mod_data, int *newlen TSRMLS_DC - -/* default create id function */ -PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS); - -typedef struct ps_module_struct { - const char *s_name; - int (*s_open)(PS_OPEN_ARGS); - int (*s_close)(PS_CLOSE_ARGS); - int (*s_read)(PS_READ_ARGS); - int (*s_write)(PS_WRITE_ARGS); - int (*s_destroy)(PS_DESTROY_ARGS); - int (*s_gc)(PS_GC_ARGS); - char *(*s_create_sid)(PS_CREATE_SID_ARGS); -} ps_module; - -#define PS_GET_MOD_DATA() *mod_data -#define PS_SET_MOD_DATA(a) *mod_data = (a) - -#define PS_OPEN_FUNC(x) int ps_open_##x(PS_OPEN_ARGS) -#define PS_CLOSE_FUNC(x) int ps_close_##x(PS_CLOSE_ARGS) -#define PS_READ_FUNC(x) int ps_read_##x(PS_READ_ARGS) -#define PS_WRITE_FUNC(x) int ps_write_##x(PS_WRITE_ARGS) -#define PS_DESTROY_FUNC(x) int ps_delete_##x(PS_DESTROY_ARGS) -#define PS_GC_FUNC(x) int ps_gc_##x(PS_GC_ARGS) -#define PS_CREATE_SID_FUNC(x) char *ps_create_sid_##x(PS_CREATE_SID_ARGS) - -#define PS_FUNCS(x) \ - PS_OPEN_FUNC(x); \ - PS_CLOSE_FUNC(x); \ - PS_READ_FUNC(x); \ - PS_WRITE_FUNC(x); \ - PS_DESTROY_FUNC(x); \ - PS_GC_FUNC(x); \ - PS_CREATE_SID_FUNC(x) - -#define PS_MOD(x) \ - #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ - ps_delete_##x, ps_gc_##x, php_session_create_id - -/* SID enabled module handler definitions */ -#define PS_FUNCS_SID(x) \ - PS_OPEN_FUNC(x); \ - PS_CLOSE_FUNC(x); \ - PS_READ_FUNC(x); \ - PS_WRITE_FUNC(x); \ - PS_DESTROY_FUNC(x); \ - PS_GC_FUNC(x); \ - PS_CREATE_SID_FUNC(x) - -#define PS_MOD_SID(x) \ - #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ - ps_delete_##x, ps_gc_##x, ps_create_sid_##x - -typedef enum { - php_session_disabled, - php_session_none, - php_session_active -} php_session_status; - -typedef struct _php_ps_globals { - char *save_path; - char *session_name; - char *id; - char *extern_referer_chk; - char *entropy_file; - char *cache_limiter; - long entropy_length; - long cookie_lifetime; - char *cookie_path; - char *cookie_domain; - zend_bool cookie_secure; - ps_module *mod; - void *mod_data; - php_session_status session_status; - long gc_probability; - long gc_divisor; - long gc_maxlifetime; - int module_number; - long cache_expire; - zend_bool bug_compat; /* Whether to behave like PHP 4.2 and earlier */ - zend_bool bug_compat_warn; /* Whether to warn about it */ - const struct ps_serializer_struct *serializer; - zval *http_session_vars; - zend_bool auto_start; - zend_bool use_cookies; - zend_bool use_only_cookies; - zend_bool use_trans_sid; /* contains the INI value of whether to use trans-sid */ - zend_bool apply_trans_sid; /* whether or not to enable trans-sid for the current request */ - - long hash_func; - long hash_bits_per_character; - int send_cookie; - int define_sid; -} php_ps_globals; - -typedef php_ps_globals zend_ps_globals; - -extern zend_module_entry session_module_entry; -#define phpext_session_ptr &session_module_entry - -PHP_FUNCTION(session_name); -PHP_FUNCTION(session_module_name); -PHP_FUNCTION(session_save_path); -PHP_FUNCTION(session_id); -PHP_FUNCTION(session_regenerate_id); -PHP_FUNCTION(session_decode); -PHP_FUNCTION(session_register); -PHP_FUNCTION(session_unregister); -PHP_FUNCTION(session_is_registered); -PHP_FUNCTION(session_encode); -PHP_FUNCTION(session_start); -PHP_FUNCTION(session_destroy); -PHP_FUNCTION(session_unset); -PHP_FUNCTION(session_set_save_handler); -PHP_FUNCTION(session_cache_expire); -PHP_FUNCTION(session_cache_limiter); -PHP_FUNCTION(session_set_cookie_params); -PHP_FUNCTION(session_get_cookie_params); -PHP_FUNCTION(session_write_close); - -#ifdef ZTS -#define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v) -#else -#define PS(v) (ps_globals.v) -#endif - -#define PS_SERIALIZER_ENCODE_ARGS char **newstr, int *newlen TSRMLS_DC -#define PS_SERIALIZER_DECODE_ARGS const char *val, int vallen TSRMLS_DC - -typedef struct ps_serializer_struct { - const char *name; - int (*encode)(PS_SERIALIZER_ENCODE_ARGS); - int (*decode)(PS_SERIALIZER_DECODE_ARGS); -} ps_serializer; - -#define PS_SERIALIZER_ENCODE_NAME(x) ps_srlzr_encode_##x -#define PS_SERIALIZER_DECODE_NAME(x) ps_srlzr_decode_##x - -#define PS_SERIALIZER_ENCODE_FUNC(x) \ - int PS_SERIALIZER_ENCODE_NAME(x)(PS_SERIALIZER_ENCODE_ARGS) -#define PS_SERIALIZER_DECODE_FUNC(x) \ - int PS_SERIALIZER_DECODE_NAME(x)(PS_SERIALIZER_DECODE_ARGS) - -#define PS_SERIALIZER_FUNCS(x) \ - PS_SERIALIZER_ENCODE_FUNC(x); \ - PS_SERIALIZER_DECODE_FUNC(x) - -#define PS_SERIALIZER_ENTRY(x) \ - { #x, PS_SERIALIZER_ENCODE_NAME(x), PS_SERIALIZER_DECODE_NAME(x) } - -PHPAPI void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC); - -void php_add_session_var(char *name, size_t namelen TSRMLS_DC); -void php_set_session_var(char *name, size_t namelen, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC); -int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC); - -PHPAPI int php_session_register_module(ps_module *); - -PHPAPI int php_session_register_serializer(const char *name, - int (*encode)(PS_SERIALIZER_ENCODE_ARGS), - int (*decode)(PS_SERIALIZER_DECODE_ARGS)); - -PHPAPI void php_session_set_id(char *id TSRMLS_DC); -PHPAPI void php_session_start(TSRMLS_D); - -#define PS_ADD_VARL(name,namelen) do { \ - php_add_session_var(name, namelen TSRMLS_CC); \ -} while (0) - -#define PS_ADD_VAR(name) PS_ADD_VARL(name, strlen(name)) - -#define PS_DEL_VARL(name,namelen) do { \ - if (PS(http_session_vars)) { \ - zend_hash_del(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1); \ - } \ -} while (0) - - -#define PS_ENCODE_VARS \ - char *key; \ - uint key_length; \ - ulong num_key; \ - zval **struc; - -#define PS_ENCODE_LOOP(code) do { \ - HashTable *_ht = Z_ARRVAL_P(PS(http_session_vars)); \ - \ - for (zend_hash_internal_pointer_reset(_ht); \ - zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL) == HASH_KEY_IS_STRING; \ - zend_hash_move_forward(_ht)) { \ - key_length--; \ - if (php_get_session_var(key, key_length, &struc TSRMLS_CC) == SUCCESS) { \ - code; \ - } \ - } \ - } while(0) - -PHPAPI ZEND_EXTERN_MODULE_GLOBALS(ps) - -void php_session_auto_start(void *data); -void php_session_shutdown(void *data); - -#endif diff --git a/ext/session/session.c b/ext/session/session.c deleted file mode 100644 index 34d7794d39e43..0000000000000 --- a/ext/session/session.c +++ /dev/null @@ -1,1929 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann <sascha@schumann.cx> | - | Andrei Zmievski <andrei@php.net> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#ifdef PHP_WIN32 -#include "win32/time.h" -#else -#include <sys/time.h> -#endif - -#include <sys/stat.h> -#include <fcntl.h> - -#include "php_ini.h" -#include "SAPI.h" -#include "php_session.h" -#include "ext/standard/md5.h" -#include "ext/standard/sha1.h" -#include "ext/standard/php_var.h" -#include "ext/standard/datetime.h" -#include "ext/standard/php_lcg.h" -#include "ext/standard/url_scanner_ex.h" -#include "ext/standard/php_rand.h" /* for RAND_MAX */ -#include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" - -#include "mod_files.h" -#include "mod_user.h" - -#ifdef HAVE_LIBMM -#include "mod_mm.h" -#endif - -/* {{{ session_functions[] - */ -function_entry session_functions[] = { - PHP_FE(session_name, NULL) - PHP_FE(session_module_name, NULL) - PHP_FE(session_save_path, NULL) - PHP_FE(session_id, NULL) - PHP_FE(session_regenerate_id, NULL) - PHP_FE(session_decode, NULL) - PHP_FE(session_register, NULL) - PHP_FE(session_unregister, NULL) - PHP_FE(session_is_registered, NULL) - PHP_FE(session_encode, NULL) - PHP_FE(session_start, NULL) - PHP_FE(session_destroy, NULL) - PHP_FE(session_unset, NULL) - PHP_FE(session_set_save_handler, NULL) - PHP_FE(session_cache_limiter, NULL) - PHP_FE(session_cache_expire, NULL) - PHP_FE(session_set_cookie_params, NULL) - PHP_FE(session_get_cookie_params, NULL) - PHP_FE(session_write_close, NULL) - PHP_FALIAS(session_commit, session_write_close, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps); - -static ps_module *_php_find_ps_module(char *name TSRMLS_DC); -static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC); - -#define SESSION_CHECK_ACTIVE_STATE \ - if (PS(session_status) == php_session_active) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); \ - return FAILURE; \ - } \ - -static PHP_INI_MH(OnUpdateSaveHandler) -{ - SESSION_CHECK_ACTIVE_STATE; - - PS(mod) = _php_find_ps_module(new_value TSRMLS_CC); - - if (PG(modules_activated) && !PS(mod)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find save handler %s", new_value); - return FAILURE; - } - - return SUCCESS; -} - -static PHP_INI_MH(OnUpdateTransSid) -{ - SESSION_CHECK_ACTIVE_STATE; - - if (!strncasecmp(new_value, "on", sizeof("on"))) { - PS(use_trans_sid) = (zend_bool) 1; - } else { - PS(use_trans_sid) = (zend_bool) atoi(new_value); - } - - return SUCCESS; -} - -static PHP_INI_MH(OnUpdateSerializer) -{ - SESSION_CHECK_ACTIVE_STATE; - - PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC); - - if (PG(modules_activated) && !PS(serializer)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find serialization handler %s", new_value); - return FAILURE; - } - - return SUCCESS; -} - -static PHP_INI_MH(OnUpdateSaveDir) -{ - /* Only do the safemode/open_basedir check at runtime */ - if (stage == PHP_INI_STAGE_RUNTIME) { - if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_ALLOW_ONLY_DIR))) { - return FAILURE; - } - - if (php_check_open_basedir(new_value TSRMLS_CC)) { - return FAILURE; - } - } - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - return SUCCESS; -} - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("session.bug_compat_42", "1", PHP_INI_ALL, OnUpdateBool, bug_compat, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1", PHP_INI_ALL, OnUpdateBool, bug_compat_warn, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals) - PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) - STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateLong, gc_probability, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateLong, gc_divisor, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateLong, gc_maxlifetime, php_ps_globals, ps_globals) - PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateSerializer) - STD_PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, OnUpdateLong, cookie_lifetime, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.cookie_path", "/", PHP_INI_ALL, OnUpdateString, cookie_path, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.cookie_domain", "", PHP_INI_ALL, OnUpdateString, cookie_domain, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.cookie_secure", "", PHP_INI_ALL, OnUpdateBool, cookie_secure, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_cookies, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.use_only_cookies", "0", PHP_INI_ALL, OnUpdateBool, use_only_cookies, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateString, extern_referer_chk, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, OnUpdateLong, entropy_length, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateString, cache_limiter, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateLong, cache_expire, php_ps_globals, ps_globals) - PHP_INI_ENTRY("session.use_trans_sid", "0", PHP_INI_ALL, OnUpdateTransSid) - STD_PHP_INI_ENTRY("session.hash_function", "0", PHP_INI_ALL, OnUpdateLong, hash_func, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.hash_bits_per_character", "4", PHP_INI_ALL, OnUpdateLong, hash_bits_per_character, php_ps_globals, ps_globals) - - /* Commented out until future discussion */ - /* PHP_INI_ENTRY("session.encode_sources", "globals,track", PHP_INI_ALL, NULL) */ -PHP_INI_END() -/* }}} */ - -PS_SERIALIZER_FUNCS(php); -PS_SERIALIZER_FUNCS(php_binary); - -#define MAX_SERIALIZERS 10 -#define PREDEFINED_SERIALIZERS 2 - -static ps_serializer ps_serializers[MAX_SERIALIZERS + 1] = { - PS_SERIALIZER_ENTRY(php), - PS_SERIALIZER_ENTRY(php_binary) -}; - -#define MAX_MODULES 10 -#define PREDEFINED_MODULES 2 - -static ps_module *ps_modules[MAX_MODULES + 1] = { - ps_files_ptr, - ps_user_ptr -}; - -#define IF_SESSION_VARS() \ - if (PS(http_session_vars) && PS(http_session_vars)->type == IS_ARRAY) - -PHPAPI int php_session_register_serializer(const char *name, - int (*encode)(PS_SERIALIZER_ENCODE_ARGS), - int (*decode)(PS_SERIALIZER_DECODE_ARGS)) -{ - int ret = -1; - int i; - - for (i = 0; i < MAX_SERIALIZERS; i++) { - if (ps_serializers[i].name == NULL) { - ps_serializers[i].name = name; - ps_serializers[i].encode = encode; - ps_serializers[i].decode = decode; - ps_serializers[i + 1].name = NULL; - ret = 0; - break; - } - } - - return ret; -} - -PHPAPI int php_session_register_module(ps_module *ptr) -{ - int ret = -1; - int i; - - for (i = 0; i < MAX_MODULES; i++) { - if (!ps_modules[i]) { - ps_modules[i] = ptr; - ret = 0; - break; - } - } - - return ret; -} - -PHP_MINIT_FUNCTION(session); -PHP_RINIT_FUNCTION(session); -PHP_MSHUTDOWN_FUNCTION(session); -PHP_RSHUTDOWN_FUNCTION(session); -PHP_MINFO_FUNCTION(session); - -static void php_rinit_session_globals(TSRMLS_D); -static void php_rshutdown_session_globals(TSRMLS_D); -static zend_bool php_session_destroy(TSRMLS_D); - -zend_module_entry session_module_entry = { - STANDARD_MODULE_HEADER, - "session", - session_functions, - PHP_MINIT(session), PHP_MSHUTDOWN(session), - PHP_RINIT(session), PHP_RSHUTDOWN(session), - PHP_MINFO(session), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_SESSION -ZEND_GET_MODULE(session) -#endif - -typedef struct { - char *name; - void (*func)(TSRMLS_D); -} php_session_cache_limiter_t; - -#define CACHE_LIMITER(name) _php_cache_limiter_##name -#define CACHE_LIMITER_FUNC(name) static void CACHE_LIMITER(name)(TSRMLS_D) -#define CACHE_LIMITER_ENTRY(name) { #name, CACHE_LIMITER(name) }, - -#define ADD_HEADER(a) sapi_add_header(a, strlen(a), 1); - -#define MAX_STR 512 - -void php_add_session_var(char *name, size_t namelen TSRMLS_DC) -{ - zval **sym_track = NULL; - - zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, - (void *) &sym_track); - - /* - * Set up a proper reference between $_SESSION["x"] and $x. - */ - - if (PG(register_globals)) { - zval **sym_global = NULL; - - zend_hash_find(&EG(symbol_table), name, namelen + 1, - (void *) &sym_global); - - if (sym_global == NULL && sym_track == NULL) { - zval *empty_var; - - ALLOC_INIT_ZVAL(empty_var); /* this sets refcount to 1 */ - empty_var->refcount = 0; /* our module does not maintain a ref */ - /* The next call will increase refcount by NR_OF_SYM_TABLES==2 */ - zend_set_hash_symbol(empty_var, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table)); - } else if (sym_global == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(sym_track); - zend_set_hash_symbol(*sym_track, name, namelen, 1, 1, &EG(symbol_table)); - } else if (sym_track == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(sym_global); - zend_set_hash_symbol(*sym_global, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars))); - } - } else { - if (sym_track == NULL) { - zval *empty_var; - - ALLOC_INIT_ZVAL(empty_var); - ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, empty_var, 1, 0); - } - } -} - -void php_set_session_var(char *name, size_t namelen, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC) -{ - if (PG(register_globals)) { - zval **old_symbol; - if (zend_hash_find(&EG(symbol_table),name,namelen+1,(void *)&old_symbol) == SUCCESS) { - - /* - * A global symbol with the same name exists already. That - * symbol might have been created by other means (e.g. $_GET). - * - * hash_update in zend_set_hash_symbol is not good, because - * it will leave referenced variables (such as local instances - * of a global variable) dangling. - * - * BTW: if you use register_globals references between - * session-vars won't work because of this very reason! - */ - - - REPLACE_ZVAL_VALUE(old_symbol,state_val,1); - - /* - * The following line will update the reference table used for - * unserialization. It is optional, because some storage - * formats may not be able to represent references. - */ - - if (var_hash) { - PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash,state_val,*old_symbol); - } - - zend_set_hash_symbol(*old_symbol, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars))); - } else { - zend_set_hash_symbol(state_val, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table)); - } - } else IF_SESSION_VARS() { - zend_set_hash_symbol(state_val, name, namelen, PZVAL_IS_REF(state_val), 1, Z_ARRVAL_P(PS(http_session_vars))); - } -} - -int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC) -{ - int ret = FAILURE; - - IF_SESSION_VARS() { - ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, - namelen+1, (void **) state_var); - - /* - * If register_globals is enabled, and - * if there is an entry for the slot in $_SESSION, and - * if that entry is still set to NULL, and - * if the global var exists, then - * we prefer the same key in the global sym table - */ - - if (PG(register_globals) && ret == SUCCESS - && Z_TYPE_PP(*state_var) == IS_NULL) { - zval **tmp; - - if (zend_hash_find(&EG(symbol_table), name, namelen + 1, - (void **) &tmp) == SUCCESS) { - *state_var = tmp; - } - } - } - - return ret; -} - -#define PS_BIN_NR_OF_BITS 8 -#define PS_BIN_UNDEF (1<<(PS_BIN_NR_OF_BITS-1)) -#define PS_BIN_MAX (PS_BIN_UNDEF-1) - -PS_SERIALIZER_ENCODE_FUNC(php_binary) -{ - smart_str buf = {0}; - php_serialize_data_t var_hash; - PS_ENCODE_VARS; - - PHP_VAR_SERIALIZE_INIT(var_hash); - - PS_ENCODE_LOOP( - if (key_length > PS_BIN_MAX) continue; - smart_str_appendc(&buf, (unsigned char) key_length); - smart_str_appendl(&buf, key, key_length); - - php_var_serialize(&buf, struc, &var_hash TSRMLS_CC); - } else { - if (key_length > PS_BIN_MAX) continue; - smart_str_appendc(&buf, (unsigned char) (key_length & PS_BIN_UNDEF)); - smart_str_appendl(&buf, key, key_length); - ); - - if (newlen) *newlen = buf.len; - *newstr = buf.c; - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - return SUCCESS; -} - -PS_SERIALIZER_DECODE_FUNC(php_binary) -{ - const char *p; - char *name; - const char *endptr = val + vallen; - zval *current; - int namelen; - int has_value; - php_unserialize_data_t var_hash; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - - for (p = val; p < endptr; ) { - namelen = *p & (~PS_BIN_UNDEF); - has_value = *p & PS_BIN_UNDEF ? 0 : 1; - - name = estrndup(p + 1, namelen); - - p += namelen + 1; - - if (has_value) { - ALLOC_INIT_ZVAL(current); - if (php_var_unserialize(¤t, (const unsigned char **) &p, endptr, &var_hash TSRMLS_CC)) { - php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); - } - zval_ptr_dtor(¤t); - } - PS_ADD_VARL(name, namelen); - efree(name); - } - - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - - return SUCCESS; -} - -#define PS_DELIMITER '|' -#define PS_UNDEF_MARKER '!' - -PS_SERIALIZER_ENCODE_FUNC(php) -{ - smart_str buf = {0}; - php_serialize_data_t var_hash; - PS_ENCODE_VARS; - - PHP_VAR_SERIALIZE_INIT(var_hash); - - PS_ENCODE_LOOP( - smart_str_appendl(&buf, key, (unsigned char) key_length); - if (memchr(key, PS_DELIMITER, key_length)) { - PHP_VAR_SERIALIZE_DESTROY(var_hash); - smart_str_free(&buf); - return FAILURE; - } - smart_str_appendc(&buf, PS_DELIMITER); - - php_var_serialize(&buf, struc, &var_hash TSRMLS_CC); - } else { - smart_str_appendc(&buf, PS_UNDEF_MARKER); - smart_str_appendl(&buf, key, key_length); - smart_str_appendc(&buf, PS_DELIMITER); - ); - - if (newlen) *newlen = buf.len; - *newstr = buf.c; - - PHP_VAR_SERIALIZE_DESTROY(var_hash); - return SUCCESS; -} - -PS_SERIALIZER_DECODE_FUNC(php) -{ - const char *p, *q; - char *name; - const char *endptr = val + vallen; - zval *current; - int namelen; - int has_value; - php_unserialize_data_t var_hash; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - - p = val; - - while (p < endptr) { - q = p; - while (*q != PS_DELIMITER) - if (++q >= endptr) goto break_outer_loop; - - if (p[0] == PS_UNDEF_MARKER) { - p++; - has_value = 0; - } else { - has_value = 1; - } - - namelen = q - p; - name = estrndup(p, namelen); - q++; - - if (has_value) { - ALLOC_INIT_ZVAL(current); - if (php_var_unserialize(¤t, (const unsigned char **) &q, endptr, &var_hash TSRMLS_CC)) { - php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); - } - zval_ptr_dtor(¤t); - } - PS_ADD_VARL(name, namelen); - efree(name); - - p = q; - } -break_outer_loop: - - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - - return SUCCESS; -} - -static void php_session_track_init(TSRMLS_D) -{ - zval *session_vars = NULL; - - /* Unconditionally destroy existing arrays -- possible dirty data */ - zend_delete_global_variable("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")-1 TSRMLS_CC); - zend_delete_global_variable("_SESSION", sizeof("_SESSION")-1 TSRMLS_CC); - - MAKE_STD_ZVAL(session_vars); - array_init(session_vars); - PS(http_session_vars) = session_vars; - - if (PG(register_long_arrays)) { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1); - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); - } - else { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 1, 0); - } -} - -static char *php_session_encode(int *newlen TSRMLS_DC) -{ - char *ret = NULL; - - IF_SESSION_VARS() { - if (!PS(serializer)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object."); - ret = NULL; - } - else if (PS(serializer)->encode(&ret, newlen TSRMLS_CC) == FAILURE) - ret = NULL; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session."); - } - - return ret; -} - -static void php_session_decode(const char *val, int vallen TSRMLS_DC) -{ - if (!PS(serializer)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object."); - return; - } - if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) { - php_session_destroy(TSRMLS_C); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed."); - } -} - - -/* - * Note that we cannot use the BASE64 alphabet here, because - * it contains "/" and "+": both are unacceptable for simple inclusion - * into URLs. - */ - -static char hexconvtab[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,-"; - -enum { - PS_HASH_FUNC_MD5, - PS_HASH_FUNC_SHA1 -}; - -/* returns a pointer to the byte after the last valid character in out */ -static char *bin_to_readable(char *in, size_t inlen, char *out, char nbits) -{ - unsigned char *p, *q; - unsigned short w; - int mask; - int have; - - p = in; - q = in + inlen; - - w = 0; - have = 0; - mask = (1 << nbits) - 1; - - while (1) { - if (have < nbits) { - if (p < q) { - w |= *p++ << have; - have += 8; - } else { - /* consumed everything? */ - if (have == 0) break; - /* No? We need a final round */ - have = nbits; - } - } - - /* consume nbits */ - *out++ = hexconvtab[w & mask]; - w >>= nbits; - have -= nbits; - } - - *out = '\0'; - return out; -} - -PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) -{ - PHP_MD5_CTX md5_context; - PHP_SHA1_CTX sha1_context; - unsigned char digest[21]; - int digest_len; - int j; - char *buf; - struct timeval tv; - zval **array; - zval **token; - char *remote_addr = NULL; - - gettimeofday(&tv, NULL); - - if (zend_hash_find(&EG(symbol_table), "_SERVER", - sizeof("_SERVER"), (void **) &array) == SUCCESS && - Z_TYPE_PP(array) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(array), "REMOTE_ADDR", - sizeof("REMOTE_ADDR"), (void **) &token) == SUCCESS) { - remote_addr = Z_STRVAL_PP(token); - } - - buf = emalloc(100); - - /* maximum 15+19+19+10 bytes */ - sprintf(buf, "%.15s%ld%ld%0.8f", remote_addr ? remote_addr : "", - tv.tv_sec, tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10); - - switch (PS(hash_func)) { - case PS_HASH_FUNC_MD5: - PHP_MD5Init(&md5_context); - PHP_MD5Update(&md5_context, buf, strlen(buf)); - digest_len = 16; - break; - case PS_HASH_FUNC_SHA1: - PHP_SHA1Init(&sha1_context); - PHP_SHA1Update(&sha1_context, buf, strlen(buf)); - digest_len = 20; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function"); - efree(buf); - return NULL; - } - - if (PS(entropy_length) > 0) { - int fd; - - fd = VCWD_OPEN(PS(entropy_file), O_RDONLY); - if (fd >= 0) { - unsigned char rbuf[2048]; - int n; - int to_read = PS(entropy_length); - - while (to_read > 0) { - n = read(fd, rbuf, MIN(to_read, sizeof(rbuf))); - if (n <= 0) break; - - switch (PS(hash_func)) { - case PS_HASH_FUNC_MD5: - PHP_MD5Update(&md5_context, rbuf, n); - break; - case PS_HASH_FUNC_SHA1: - PHP_SHA1Update(&sha1_context, rbuf, n); - break; - } - to_read -= n; - } - close(fd); - } - } - - switch (PS(hash_func)) { - case PS_HASH_FUNC_MD5: - PHP_MD5Final(digest, &md5_context); - break; - case PS_HASH_FUNC_SHA1: - PHP_SHA1Final(digest, &sha1_context); - break; - } - - if (PS(hash_bits_per_character) < 4 - || PS(hash_bits_per_character) > 6) { - PS(hash_bits_per_character) = 4; - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now"); - } - j = (int) (bin_to_readable(digest, digest_len, buf, PS(hash_bits_per_character)) - buf); - - if (newlen) - *newlen = j; - return buf; -} - -static void php_session_initialize(TSRMLS_D) -{ - char *val; - int vallen; - - if (!PS(mod)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "No storage module chosen - failed to initialize session."); - return; - } - - /* Open session handler first */ - if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path)); - return; - } - - /* If there is no ID, use session module to create one */ - if (!PS(id)) - PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); - - /* Read data */ - /* Question: if you create a SID here, should you also try to read data? - * I'm not sure, but while not doing so will remove one session operation - * it could prove usefull for those sites which wish to have "default" - * session information - */ - php_session_track_init(TSRMLS_C); - if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { - php_session_decode(val, vallen TSRMLS_CC); - efree(val); - } -} - -static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) -{ - char *str; - uint str_len; - ulong num_key; - int n; - zval **val; - int ret = 0; - - n = zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, 0, pos); - - switch (n) { - case HASH_KEY_IS_STRING: - if (zend_hash_find(&EG(symbol_table), str, str_len, - (void **) &val) == SUCCESS - && val && Z_TYPE_PP(val) != IS_NULL) { - ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, - (*val)->refcount + 1 , 1); - ret = 1; - } - break; - case HASH_KEY_IS_LONG: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The session bug compatibility code will not " - "try to locate the global variable $%lu due to its " - "numeric nature.", num_key); - break; - } - - return ret; -} - -static void php_session_save_current_state(TSRMLS_D) -{ - int ret = FAILURE; - - IF_SESSION_VARS() { - if (PS(bug_compat) && !PG(register_globals)) { - HashTable *ht = Z_ARRVAL_P(PS(http_session_vars)); - HashPosition pos; - zval **val; - int do_warn = 0; - - zend_hash_internal_pointer_reset_ex(ht, &pos); - - while (zend_hash_get_current_data_ex(ht, - (void **) &val, &pos) != FAILURE) { - if (Z_TYPE_PP(val) == IS_NULL) { - if (migrate_global(ht, &pos TSRMLS_CC)) - do_warn = 1; - } - zend_hash_move_forward_ex(ht, &pos); - } - - if (do_warn && PS(bug_compat_warn)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively."); - } - } - - if (PS(mod_data)) { - char *val; - int vallen; - - val = php_session_encode(&vallen TSRMLS_CC); - if (val) { - ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); - efree(val); - } else { - ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); - } - } - - if (ret == FAILURE) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please " - "verify that the current setting of session.save_path " - "is correct (%s)", - PS(mod)->s_name, - PS(save_path)); - } - - if (PS(mod_data)) - PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); -} - -static char *month_names[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -static char *week_days[] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" -}; - -static void strcpy_gmt(char *ubuf, time_t *when) -{ - char buf[MAX_STR]; - struct tm tm; - int n; - - php_gmtime_r(when, &tm); - - n = sprintf(buf, "%s, %02d %s %d %02d:%02d:%02d GMT", /* SAFE */ - week_days[tm.tm_wday], tm.tm_mday, - month_names[tm.tm_mon], tm.tm_year + 1900, - tm.tm_hour, tm.tm_min, - tm.tm_sec); - memcpy(ubuf, buf, n); - ubuf[n] = '\0'; -} - -static void last_modified(TSRMLS_D) -{ - const char *path; - struct stat sb; - char buf[MAX_STR + 1]; - - path = SG(request_info).path_translated; - if (path) { - if (VCWD_STAT(path, &sb) == -1) { - return; - } - -#define LAST_MODIFIED "Last-Modified: " - memcpy(buf, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1); -#ifdef NETWARE - strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &(sb.st_mtime.tv_sec)); -#else - strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime); -#endif - ADD_HEADER(buf); - } -} - -CACHE_LIMITER_FUNC(public) -{ - char buf[MAX_STR + 1]; - struct timeval tv; - time_t now; - - gettimeofday(&tv, NULL); - now = tv.tv_sec + PS(cache_expire) * 60; -#define EXPIRES "Expires: " - memcpy(buf, EXPIRES, sizeof(EXPIRES) - 1); - strcpy_gmt(buf + sizeof(EXPIRES) - 1, &now); - ADD_HEADER(buf); - - sprintf(buf, "Cache-Control: public, max-age=%ld", PS(cache_expire) * 60); /* SAFE */ - ADD_HEADER(buf); - - last_modified(TSRMLS_C); -} - -CACHE_LIMITER_FUNC(private_no_expire) -{ - char buf[MAX_STR + 1]; - - sprintf(buf, "Cache-Control: private, max-age=%ld, pre-check=%ld", PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */ - ADD_HEADER(buf); - - last_modified(TSRMLS_C); -} - -CACHE_LIMITER_FUNC(private) -{ - ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); - CACHE_LIMITER(private_no_expire)(TSRMLS_C); -} - -CACHE_LIMITER_FUNC(nocache) -{ - ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); - /* For HTTP/1.1 conforming clients and the rest (MSIE 5) */ - ADD_HEADER("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); - /* For HTTP/1.0 conforming clients */ - ADD_HEADER("Pragma: no-cache"); -} - -static php_session_cache_limiter_t php_session_cache_limiters[] = { - CACHE_LIMITER_ENTRY(public) - CACHE_LIMITER_ENTRY(private) - CACHE_LIMITER_ENTRY(private_no_expire) - CACHE_LIMITER_ENTRY(nocache) - {0} -}; - -static int php_session_cache_limiter(TSRMLS_D) -{ - php_session_cache_limiter_t *lim; - - if (PS(cache_limiter)[0] == '\0') return 0; - - if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(TSRMLS_C); - int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); - - if (output_start_filename) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", - output_start_filename, output_start_lineno); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent"); - } - return -2; - } - - for (lim = php_session_cache_limiters; lim->name; lim++) { - if (!strcasecmp(lim->name, PS(cache_limiter))) { - lim->func(TSRMLS_C); - return 0; - } - } - - return -1; -} - -#define COOKIE_SET_COOKIE "Set-Cookie: " -#define COOKIE_EXPIRES "; expires=" -#define COOKIE_PATH "; path=" -#define COOKIE_DOMAIN "; domain=" -#define COOKIE_SECURE "; secure" - -static void php_session_send_cookie(TSRMLS_D) -{ - smart_str ncookie = {0}; - char *date_fmt = NULL; - - if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(TSRMLS_C); - int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); - - if (output_start_filename) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", - output_start_filename, output_start_lineno); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent"); - } - return; - } - - smart_str_appends(&ncookie, COOKIE_SET_COOKIE); - smart_str_appends(&ncookie, PS(session_name)); - smart_str_appendc(&ncookie, '='); - smart_str_appends(&ncookie, PS(id)); - - if (PS(cookie_lifetime) > 0) { - struct timeval tv; - time_t t; - - gettimeofday(&tv, NULL); - t = tv.tv_sec + PS(cookie_lifetime); - - if (t > 0) { - date_fmt = php_std_date(t TSRMLS_CC); - smart_str_appends(&ncookie, COOKIE_EXPIRES); - smart_str_appends(&ncookie, date_fmt); - efree(date_fmt); - } - } - - if (PS(cookie_path)[0]) { - smart_str_appends(&ncookie, COOKIE_PATH); - smart_str_appends(&ncookie, PS(cookie_path)); - } - - if (PS(cookie_domain)[0]) { - smart_str_appends(&ncookie, COOKIE_DOMAIN); - smart_str_appends(&ncookie, PS(cookie_domain)); - } - - if (PS(cookie_secure)) { - smart_str_appends(&ncookie, COOKIE_SECURE); - } - - smart_str_0(&ncookie); - - sapi_add_header_ex(ncookie.c, ncookie.len, 0, 0 TSRMLS_CC); -} - -static ps_module *_php_find_ps_module(char *name TSRMLS_DC) -{ - ps_module *ret = NULL; - ps_module **mod; - int i; - - for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) - if (*mod && !strcasecmp(name, (*mod)->s_name)) { - ret = *mod; - break; - } - - return ret; -} - -static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) -{ - const ps_serializer *ret = NULL; - const ps_serializer *mod; - - for (mod = ps_serializers; mod->name; mod++) - if (!strcasecmp(name, mod->name)) { - ret = mod; - break; - } - - return ret; -} - -#define PPID2SID \ - convert_to_string((*ppid)); \ - PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid)) - -static void php_session_reset_id(TSRMLS_D) -{ - int module_number = PS(module_number); - - if (PS(use_cookies)) { - php_session_send_cookie(TSRMLS_C); - } - - /* if the SID constant exists, destroy it. */ - zend_hash_del(EG(zend_constants), "sid", sizeof("sid")); - - if (PS(define_sid)) { - smart_str var = {0}; - - smart_str_appends(&var, PS(session_name)); - smart_str_appendc(&var, '='); - smart_str_appends(&var, PS(id)); - smart_str_0(&var); - REGISTER_STRINGL_CONSTANT("SID", var.c, var.len, 0); - } else { - REGISTER_STRINGL_CONSTANT("SID", STR_EMPTY_ALLOC(), 0, 0); - } - - if (PS(apply_trans_sid)) { - php_url_scanner_reset_vars(TSRMLS_C); - php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id), strlen(PS(id)), 1 TSRMLS_CC); - } -} - -PHPAPI void php_session_start(TSRMLS_D) -{ - zval **ppid; - zval **data; - char *p; - int nrand; - int lensess; - - PS(apply_trans_sid) = PS(use_trans_sid); - - PS(define_sid) = 1; - PS(send_cookie) = 1; - if (PS(session_status) != php_session_none) { - - if (PS(session_status) == php_session_disabled) { - char *value; - - value = zend_ini_string("session.save_handler", sizeof("session.save_handler"), 0); - - if (value) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler %s", value); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find unknown save handler"); - } - return; - } - - php_error(E_NOTICE, "A session had already been started - ignoring session_start()"); - return; - } - - lensess = strlen(PS(session_name)); - - - /* - * Cookies are preferred, because initially - * cookie and get variables will be available. - */ - - if (!PS(id)) { - if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE", - sizeof("_COOKIE"), (void **) &data) == SUCCESS && - Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), - lensess + 1, (void **) &ppid) == SUCCESS) { - PPID2SID; - PS(apply_trans_sid) = 0; - PS(send_cookie) = 0; - PS(define_sid) = 0; - } - - if (!PS(use_only_cookies) && !PS(id) && - zend_hash_find(&EG(symbol_table), "_GET", - sizeof("_GET"), (void **) &data) == SUCCESS && - Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), - lensess + 1, (void **) &ppid) == SUCCESS) { - PPID2SID; - PS(send_cookie) = 0; - } - - if (!PS(use_only_cookies) && !PS(id) && - zend_hash_find(&EG(symbol_table), "_POST", - sizeof("_POST"), (void **) &data) == SUCCESS && - Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), - lensess + 1, (void **) &ppid) == SUCCESS) { - PPID2SID; - PS(send_cookie) = 0; - } - } - - /* check the REQUEST_URI symbol for a string of the form - '<session-name>=<session-id>' to allow URLs of the form - http://yoursite/<session-name>=<session-id>/script.php */ - - if (!PS(use_only_cookies) && !PS(id) && PG(http_globals)[TRACK_VARS_SERVER] && - zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", - sizeof("REQUEST_URI"), (void **) &data) == SUCCESS && - Z_TYPE_PP(data) == IS_STRING && - (p = strstr(Z_STRVAL_PP(data), PS(session_name))) && - p[lensess] == '=') { - char *q; - - p += lensess + 1; - if ((q = strpbrk(p, "/?\\"))) - PS(id) = estrndup(p, q - p); - } - - /* check whether the current request was referred to by - an external site which invalidates the previously found id */ - - if (PS(id) && - PS(extern_referer_chk)[0] != '\0' && - PG(http_globals)[TRACK_VARS_SERVER] && - zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_REFERER", - sizeof("HTTP_REFERER"), (void **) &data) == SUCCESS && - Z_TYPE_PP(data) == IS_STRING && - Z_STRLEN_PP(data) != 0 && - strstr(Z_STRVAL_PP(data), PS(extern_referer_chk)) == NULL) { - efree(PS(id)); - PS(id) = NULL; - PS(send_cookie) = 1; - if (PS(use_trans_sid)) - PS(apply_trans_sid) = 1; - } - - php_session_initialize(TSRMLS_C); - - if (!PS(use_cookies) && PS(send_cookie)) { - if (PS(use_trans_sid)) - PS(apply_trans_sid) = 1; - PS(send_cookie) = 0; - } - - php_session_reset_id(TSRMLS_C); - - PS(session_status) = php_session_active; - - php_session_cache_limiter(TSRMLS_C); - - if (PS(mod_data) && PS(gc_probability) > 0) { - int nrdels = -1; - - nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C)); - if (nrand < PS(gc_probability)) { - PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); -#if 0 - if (nrdels != -1) - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects", nrdels); -#endif - } - } -} - -static zend_bool php_session_destroy(TSRMLS_D) -{ - zend_bool retval = SUCCESS; - - if (PS(session_status) != php_session_active) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session"); - return FAILURE; - } - - if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { - retval = FAILURE; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed"); - } - - php_rshutdown_session_globals(TSRMLS_C); - php_rinit_session_globals(TSRMLS_C); - - return retval; -} - - -/* {{{ proto void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure]]]) - Set session cookie parameters */ -PHP_FUNCTION(session_set_cookie_params) -{ - zval **lifetime, **path, **domain, **secure; - - if (!PS(use_cookies)) - return; - - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 4 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &lifetime, &path, &domain, &secure) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(lifetime); - zend_alter_ini_entry("session.cookie_lifetime", sizeof("session.cookie_lifetime"), Z_STRVAL_PP(lifetime), Z_STRLEN_PP(lifetime), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - - if (ZEND_NUM_ARGS() > 1) { - convert_to_string_ex(path); - zend_alter_ini_entry("session.cookie_path", sizeof("session.cookie_path"), Z_STRVAL_PP(path), Z_STRLEN_PP(path), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - - if (ZEND_NUM_ARGS() > 2) { - convert_to_string_ex(domain); - zend_alter_ini_entry("session.cookie_domain", sizeof("session.cookie_domain"), Z_STRVAL_PP(domain), Z_STRLEN_PP(domain), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - if (ZEND_NUM_ARGS() > 3) { - convert_to_long_ex(secure); - zend_alter_ini_entry("session.cookie_secure", sizeof("session.cookie_secure"), Z_BVAL_PP(secure)?"1":"0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } - } - } -} -/* }}} */ - -/* {{{ proto array session_get_cookie_params(void) - Return the session cookie parameters */ -PHP_FUNCTION(session_get_cookie_params) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - add_assoc_long(return_value, "lifetime", PS(cookie_lifetime)); - add_assoc_string(return_value, "path", PS(cookie_path), 1); - add_assoc_string(return_value, "domain", PS(cookie_domain), 1); - add_assoc_bool(return_value, "secure", PS(cookie_secure)); -} -/* }}} */ - -/* {{{ proto string session_name([string newname]) - Return the current session name. If newname is given, the session name is replaced with newname */ -PHP_FUNCTION(session_name) -{ - zval **p_name; - int ac = ZEND_NUM_ARGS(); - char *old; - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) - WRONG_PARAM_COUNT; - - old = estrdup(PS(session_name)); - - if (ac == 1) { - convert_to_string_ex(p_name); - zend_alter_ini_entry("session.name", sizeof("session.name"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } - - RETVAL_STRING(old, 0); -} -/* }}} */ - -/* {{{ proto string session_module_name([string newname]) - Return the current module name used for accessing session data. If newname is given, the module name is replaced with newname */ -PHP_FUNCTION(session_module_name) -{ - zval **p_name; - int ac = ZEND_NUM_ARGS(); - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - /* Set return_value to current module name */ - if (PS(mod) && PS(mod)->s_name) { - RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0); - } else { - RETVAL_EMPTY_STRING(); - } - - if (ac == 1) { - convert_to_string_ex(p_name); - if (!_php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)", - Z_STRVAL_PP(p_name)); - RETURN_FALSE; - } - if (PS(mod_data)) { - PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); - } - PS(mod_data) = NULL; - - zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } -} -/* }}} */ - -/* {{{ proto void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc) - Sets user-level functions */ -PHP_FUNCTION(session_set_save_handler) -{ - zval **args[6]; - int i; - ps_user *mdata; - zval name; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) == FAILURE) - WRONG_PARAM_COUNT; - - if (PS(session_status) != php_session_none) - RETURN_FALSE; - - for (i = 0; i < 6; i++) { - if (!zend_is_callable(*args[i], 0, &name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1); - zval_dtor(&name); - RETURN_FALSE; - } - zval_dtor(&name); - } - - zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), "user", sizeof("user")-1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - - mdata = emalloc(sizeof(*mdata)); - - for (i = 0; i < 6; i++) { - ZVAL_ADDREF(*args[i]); - mdata->names[i] = *args[i]; - } - - PS(mod_data) = (void *) mdata; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string session_save_path([string newname]) - Return the current save path passed to module_name. If newname is given, the save path is replaced with newname */ -PHP_FUNCTION(session_save_path) -{ - zval **p_name; - int ac = ZEND_NUM_ARGS(); - char *old; - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) - WRONG_PARAM_COUNT; - - old = estrdup(PS(save_path)); - - if (ac == 1) { - convert_to_string_ex(p_name); - zend_alter_ini_entry("session.save_path", sizeof("session.save_path"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } - - RETVAL_STRING(old, 0); -} -/* }}} */ - -/* {{{ proto string session_id([string newid]) - Return the current session id. If newid is given, the session id is replaced with newid */ -PHP_FUNCTION(session_id) -{ - zval **p_name; - int ac = ZEND_NUM_ARGS(); - char *old; - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) - WRONG_PARAM_COUNT; - - if (PS(id)) { - old = estrdup(PS(id)); - } else { - old = STR_EMPTY_ALLOC(); - } - - if (ac == 1) { - convert_to_string_ex(p_name); - if (PS(id)) efree(PS(id)); - PS(id) = estrndup(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)); - } - - RETVAL_STRING(old, 0); -} -/* }}} */ - -/* {{{ proto bool session_regenerate_id([bool delete_old_session]) - Update the current session id with a newly generated one. If delete_old_session is set to true, remove the old session. */ -PHP_FUNCTION(session_regenerate_id) -{ - zend_bool del_ses = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &del_ses) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (PS(session_status) == php_session_active) { - if (PS(id)) { - if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed"); - RETURN_FALSE; - } - efree(PS(id)); - } - - PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); - - php_session_reset_id(TSRMLS_C); - - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string session_cache_limiter([string new_cache_limiter]) - Return the current cache limiter. If new_cache_limited is given, the current cache_limiter is replaced with new_cache_limiter */ -PHP_FUNCTION(session_cache_limiter) -{ - zval **p_cache_limiter; - int ac = ZEND_NUM_ARGS(); - char *old; - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_cache_limiter) == FAILURE) - WRONG_PARAM_COUNT; - - old = estrdup(PS(cache_limiter)); - - if (ac == 1) { - convert_to_string_ex(p_cache_limiter); - zend_alter_ini_entry("session.cache_limiter", sizeof("session.cache_limiter"), Z_STRVAL_PP(p_cache_limiter), Z_STRLEN_PP(p_cache_limiter), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } - - RETVAL_STRING(old, 0); -} -/* }}} */ - -/* {{{ proto int session_cache_expire([int new_cache_expire]) - Return the current cache expire. If new_cache_expire is given, the current cache_expire is replaced with new_cache_expire */ -PHP_FUNCTION(session_cache_expire) -{ - zval **p_cache_expire; - int ac = ZEND_NUM_ARGS(); - long old; - - old = PS(cache_expire); - - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_cache_expire) == FAILURE) - WRONG_PARAM_COUNT; - - if (ac == 1) { - convert_to_long_ex(p_cache_expire); - PS(cache_expire) = Z_LVAL_PP(p_cache_expire); - } - - RETVAL_LONG(old); -} -/* }}} */ - -/* {{{ static void php_register_var(zval** entry TSRMLS_DC) */ -static void php_register_var(zval** entry TSRMLS_DC) -{ - zval **value; - - if (Z_TYPE_PP(entry) == IS_ARRAY) { - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(entry)); - - while (zend_hash_get_current_data(Z_ARRVAL_PP(entry), (void**)&value) == SUCCESS) { - php_register_var(value TSRMLS_CC); - zend_hash_move_forward(Z_ARRVAL_PP(entry)); - } - } else { - convert_to_string_ex(entry); - - if ((strcmp(Z_STRVAL_PP(entry), "HTTP_SESSION_VARS") != 0) && - (strcmp(Z_STRVAL_PP(entry), "_SESSION") != 0)) { - PS_ADD_VARL(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry)); - } - } -} -/* }}} */ - -/* {{{ proto bool session_register(mixed var_names [, mixed ...]) - Adds varname(s) to the list of variables which are freezed at the session end */ -PHP_FUNCTION(session_register) -{ - zval ***args; - int argc = ZEND_NUM_ARGS(); - int i; - - if (argc <= 0) - RETURN_FALSE - else - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) { - php_session_start(TSRMLS_C); - } - - if (PS(session_status) == php_session_disabled) { - efree(args); - RETURN_FALSE; - } - - for (i = 0; i < argc; i++) { - if (Z_TYPE_PP(args[i]) == IS_ARRAY) - SEPARATE_ZVAL(args[i]); - php_register_var(args[i] TSRMLS_CC); - } - - efree(args); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool session_unregister(string varname) - Removes varname from the list of variables which are freezed at the session end */ -PHP_FUNCTION(session_unregister) -{ - zval **p_name; - int ac = ZEND_NUM_ARGS(); - - if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(p_name); - - PS_DEL_VARL(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool session_is_registered(string varname) - Checks if a variable is registered in session */ -PHP_FUNCTION(session_is_registered) -{ - zval **p_name; - zval *p_var; - int ac = ZEND_NUM_ARGS(); - - if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(p_name); - - if (PS(session_status) == php_session_none) - RETURN_FALSE; - - IF_SESSION_VARS() { - if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), - Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)+1, - (void **)&p_var) == SUCCESS) { - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string session_encode(void) - Serializes the current setup and returns the serialized representation */ -PHP_FUNCTION(session_encode) -{ - int len; - char *enc; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - enc = php_session_encode(&len TSRMLS_CC); - if (enc == NULL) { - RETURN_FALSE; - } - - RETVAL_STRINGL(enc, len, 0); -} -/* }}} */ - -/* {{{ proto bool session_decode(string data) - Deserializes data and reinitializes the variables */ -PHP_FUNCTION(session_decode) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (PS(session_status) == php_session_none) { - RETURN_FALSE; - } - - convert_to_string_ex(str); - - php_session_decode(Z_STRVAL_PP(str), Z_STRLEN_PP(str) TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool session_start(void) - Begin session - reinitializes freezed variables, registers browsers etc */ -PHP_FUNCTION(session_start) -{ - /* skipping check for non-zero args for performance reasons here ?*/ - php_session_start(TSRMLS_C); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool session_destroy(void) - Destroy the current session and all data associated with it */ -PHP_FUNCTION(session_destroy) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (php_session_destroy(TSRMLS_C) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto void session_unset(void) - Unset all registered variables */ -PHP_FUNCTION(session_unset) -{ - if (PS(session_status) == php_session_none) - RETURN_FALSE; - - IF_SESSION_VARS() { - HashTable *ht = Z_ARRVAL_P(PS(http_session_vars)); - - if (PG(register_globals)) { - uint str_len; - char *str; - ulong num_key; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(ht, &pos); - - while (zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, - 0, &pos) == HASH_KEY_IS_STRING) { - zend_delete_global_variable(str, str_len-1 TSRMLS_CC); - zend_hash_move_forward_ex(ht, &pos); - } - } - - /* Clean $_SESSION. */ - zend_hash_clean(ht); - } -} -/* }}} */ - -PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) -{ - if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) { - *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen TSRMLS_CC); - } -} - -static void php_rinit_session_globals(TSRMLS_D) -{ - PS(id) = NULL; - PS(session_status) = php_session_none; - PS(mod_data) = NULL; - PS(http_session_vars) = NULL; -} - -static void php_rshutdown_session_globals(TSRMLS_D) -{ - if (PS(mod_data)) { - zend_try { - PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); - } zend_end_try(); - } - if (PS(id)) { - efree(PS(id)); - } -} - - -PHP_RINIT_FUNCTION(session) -{ - php_rinit_session_globals(TSRMLS_C); - - if (PS(mod) == NULL) { - char *value; - - value = zend_ini_string("session.save_handler", sizeof("session.save_handler"), 0); - if (value) { - PS(mod) = _php_find_ps_module(value TSRMLS_CC); - } - - if (!PS(mod)) { - /* current status is unusable */ - PS(session_status) = php_session_disabled; - return SUCCESS; - } - } - - if (PS(auto_start)) { - php_session_start(TSRMLS_C); - } - - return SUCCESS; -} - -static void php_session_flush(TSRMLS_D) -{ - if (PS(session_status) == php_session_active) { - PS(session_status) = php_session_none; - zend_try { - php_session_save_current_state(TSRMLS_C); - } zend_end_try(); - } -} - -/* {{{ proto void session_write_close(void) - Write session data and end session */ -PHP_FUNCTION(session_write_close) -{ - php_session_flush(TSRMLS_C); -} - -PHP_RSHUTDOWN_FUNCTION(session) -{ - php_session_flush(TSRMLS_C); - php_rshutdown_session_globals(TSRMLS_C); - - return SUCCESS; -} -/* }}} */ - -static void php_minit_session_globals(php_ps_globals *ps_globals) -{ - ps_globals->save_path = NULL; - ps_globals->session_name = NULL; - ps_globals->id = NULL; - ps_globals->mod = NULL; - ps_globals->mod_data = NULL; - ps_globals->session_status = php_session_none; - ps_globals->http_session_vars = NULL; -} - -PHP_MINIT_FUNCTION(session) -{ -#ifdef ZTS - php_ps_globals *ps_globals; - - ts_allocate_id(&ps_globals_id, sizeof(php_ps_globals), (ts_allocate_ctor) php_minit_session_globals, NULL); - ps_globals = ts_resource(ps_globals_id); -#else - php_minit_session_globals(&ps_globals); -#endif - - zend_register_auto_global("_SESSION", sizeof("_SESSION")-1, NULL TSRMLS_CC); - - PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */ - - PS(session_status) = php_session_none; - REGISTER_INI_ENTRIES(); - -#ifdef HAVE_LIBMM - PHP_MINIT(ps_mm) (INIT_FUNC_ARGS_PASSTHRU); -#endif - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(session) -{ - UNREGISTER_INI_ENTRIES(); - -#ifdef HAVE_LIBMM - PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU); -#endif - - ps_serializers[PREDEFINED_SERIALIZERS].name = NULL; - memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *)); - - return SUCCESS; -} - - -PHP_MINFO_FUNCTION(session) -{ - ps_module **mod; - ps_serializer *ser; - smart_str save_handlers = {0}; - smart_str ser_handlers = {0}; - int i; - - /* Get save handlers */ - for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) { - if (*mod && (*mod)->s_name) { - smart_str_appends(&save_handlers, (*mod)->s_name); - smart_str_appendc(&save_handlers, ' '); - } - } - - /* Get serializer handlers */ - for (i = 0, ser = ps_serializers; i < MAX_SERIALIZERS; i++, ser++) { - if (ser && ser->name) { - smart_str_appends(&ser_handlers, ser->name); - smart_str_appendc(&ser_handlers, ' '); - } - } - - php_info_print_table_start(); - php_info_print_table_row(2, "Session Support", "enabled" ); - - if (save_handlers.c) { - smart_str_0(&save_handlers); - php_info_print_table_row(2, "Registered save handlers", save_handlers.c); - smart_str_free(&save_handlers); - } else { - php_info_print_table_row(2, "Registered save handlers", "none"); - } - - if (ser_handlers.c) { - smart_str_0(&ser_handlers); - php_info_print_table_row(2, "Registered serializer handlers", ser_handlers.c); - smart_str_free(&ser_handlers); - } else { - php_info_print_table_row(2, "Registered serializer handlers", "none"); - } - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt deleted file mode 100644 index 934987f1c99ba..0000000000000 --- a/ext/session/tests/001.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -session object serialization ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -class foo { - public $bar = "ok"; - - function method() { $this->yes = "done"; } -} - -$baz = new foo; -$baz->method(); - -$arr[3] = new foo; -$arr[3]->method(); - -session_register("baz"); -session_register("arr"); - -print session_encode()."\n"; - -session_destroy(); ---EXPECT-- -baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}} diff --git a/ext/session/tests/002.phpt b/ext/session/tests/002.phpt deleted file mode 100644 index 6fff01e7730eb..0000000000000 --- a/ext/session/tests/002.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -session_unset() without a initialized session ---SKIPIF-- -<?php include('skipif.inc'); ?> ---FILE-- -<?php -error_reporting(E_ALL); -session_unset(); -print "ok\n"; ---EXPECT-- -ok diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt deleted file mode 100644 index 9972358e1a1fc..0000000000000 --- a/ext/session/tests/003.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -session object deserialization ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -session_id("abtest"); -session_start(); -session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'); - -$baz->method(); -$arr[3]->method(); - -var_dump($baz); -var_dump($arr); -session_destroy(); ---EXPECT-- -object(foo)#1 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt deleted file mode 100644 index 2040476bc0e2b..0000000000000 --- a/ext/session/tests/004.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -session_set_save_handler test ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -class handler { - public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; - function open($save_path, $session_name) - { - print "OPEN: $session_name\n"; - return true; - } - function close() - { - return true; - } - function read($key) - { - print "READ: $key\n"; - return $GLOBALS["hnd"]->data; - } - - function write($key, $val) - { - print "WRITE: $key, $val\n"; - $GLOBALS["hnd"]->data = $val; - return true; - } - - function destroy($key) - { - print "DESTROY: $key\n"; - return true; - } - - function gc() { return true; } -} - -$hnd = new handler; - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); - -session_id("abtest"); -session_start(); -$baz->method(); -$arr[3]->method(); - -var_dump($baz); -var_dump($arr); - -session_write_close(); - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); -session_start(); - -var_dump($baz); -var_dump($arr); - -session_destroy(); -?> ---EXPECT-- -OPEN: PHPSESSID -READ: abtest -object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}} -OPEN: PHPSESSID -READ: abtest -object(foo)#4 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -DESTROY: abtest diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt deleted file mode 100644 index 5638376b9d59d..0000000000000 --- a/ext/session/tests/005.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -custom save handler, multiple session_start()s, complex data structure test. ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -class handler { - public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; - function open($save_path, $session_name) - { - print "OPEN: $session_name\n"; - return true; - } - function close() - { - print "CLOSE\n"; - return true; - } - function read($key) - { - print "READ: $key\n"; - return $GLOBALS["hnd"]->data; - } - - function write($key, $val) - { - print "WRITE: $key, $val\n"; - $GLOBALS["hnd"]->data = $val; - return true; - } - - function destroy($key) - { - print "DESTROY: $key\n"; - return true; - } - - function gc() { return true; } -} - -$hnd = new handler; - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); - -session_id("abtest"); -session_start(); -$baz->method(); -$arr[3]->method(); - -var_dump($baz); -var_dump($arr); - -session_write_close(); - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); -session_start(); -$baz->method(); -$arr[3]->method(); - - -$c = 123; -session_register("c"); -var_dump($baz); var_dump($arr); var_dump($c); - -session_write_close(); - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); -session_start(); -var_dump($baz); var_dump($arr); var_dump($c); - -session_destroy(); -?> ---EXPECT-- -OPEN: PHPSESSID -READ: abtest -object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}} -CLOSE -OPEN: PHPSESSID -READ: abtest -object(foo)#4 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) - } -} -int(123) -WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}}c|i:123; -CLOSE -OPEN: PHPSESSID -READ: abtest -object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) -} -array(1) { - [3]=> - object(foo)#4 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) - } -} -int(123) -DESTROY: abtest -CLOSE diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt deleted file mode 100644 index 40385bbe1e9f9..0000000000000 --- a/ext/session/tests/006.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -correct instantiation of references between variables in sessions ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); - -class a { - public $test = "hallo"; -} - -class b { - public $a; - function b(&$a) { - $this->a = &$a; - } -} - -$a = new a(); -$b = new b($a); - -echo "original values:\n"; -var_dump($a,$b); - -session_register("a"); -session_register("b"); -session_write_close(); - -session_unregister("a"); -session_unregister("b"); - -session_start(); - -echo "values after session:\n"; -var_dump($a,$b); -?> ---EXPECTF-- -original values: -object(a)#%d (1) { - ["test"]=> - string(5) "hallo" -} -object(b)#%d (1) { - ["a"]=> - &object(a)#%d (1) { - ["test"]=> - string(5) "hallo" - } -} -values after session: -object(a)#%d (1) { - ["test"]=> - string(5) "hallo" -} -object(b)#%d (1) { - ["a"]=> - &object(a)#%d (1) { - ["test"]=> - string(5) "hallo" - } -} diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt deleted file mode 100644 index 7ed74ea474836..0000000000000 --- a/ext/session/tests/007.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -bug compatibility: unset($c) with enabled register_globals ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -register_long_arrays=1 -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_register("c"); -unset($c); -$c = 3.14; -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECT-- -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt deleted file mode 100644 index 0057f2be4420c..0000000000000 --- a/ext/session/tests/008-php4.2.3.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -bug compatibility: global is used albeit register_globals=0 ---SKIPIF-- -<?php include('skipif.inc'); - if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3"); -?> ---INI-- -register_long_arrays=1 -session.use_cookies=0 -session.cache_limiter= -register_globals=0 -session.bug_compat_42=1 -session.bug_compat_warn=1 -track_errors=1 -log_errors=0 -html_errors=0 -display_errors=1 -error_reporting=2039; -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_register("c"); -var_dump($c); -unset($c); -$c = 3.14; -@session_write_close(); // this generates an E_WARNING which will be printed -// by $php_errormsg so we can use "@" here. ANY further message IS an error. -echo $php_errormsg."\n"; -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECTF-- -NULL -Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. -array(1) { - ["c"]=> - float(3.14) -} -NULL -array(1) { - ["c"]=> - float(3.14) -} diff --git a/ext/session/tests/008.phpt b/ext/session/tests/008.phpt deleted file mode 100644 index 044a6f2536eb3..0000000000000 --- a/ext/session/tests/008.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -bug compatibility: global is used albeit register_globals=0 ---SKIPIF-- -<?php include('skipif.inc'); - if (version_compare(PHP_VERSION,"4.2.3-dev", ">=")) die("skip this is for PHP < 4.2.3"); -?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=0 -session.bug_compat_42=1 -session.bug_compat_warn=0 ---FILE-- -<?php -error_reporting(E_ALL & ~E_NOTICE); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_register("c"); -var_dump($c); -unset($c); -$c = 3.14; -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECT-- -NULL -array(1) { - ["c"]=> - float(3.14) -} -NULL -array(1) { - ["c"]=> - float(3.14) -} diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt deleted file mode 100644 index 903b8be3a5e6e..0000000000000 --- a/ext/session/tests/009.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -unset($_SESSION["name"]); should work with register_globals=off ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -register_long_arrays=1 -session.use_cookies=0 -session.cache_limiter= -register_globals=0 -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_start(); -var_dump($HTTP_SESSION_VARS); -$HTTP_SESSION_VARS["name"] = "foo"; -var_dump($HTTP_SESSION_VARS); -session_write_close(); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($HTTP_SESSION_VARS["name"]); -var_dump($HTTP_SESSION_VARS); -session_write_close(); - -### Phase 4 final - -session_start(); -var_dump($HTTP_SESSION_VARS); -session_destroy(); -?> ---EXPECT-- -array(0) { -} -array(1) { - ["name"]=> - string(3) "foo" -} -array(1) { - ["name"]=> - string(3) "foo" -} -array(0) { -} -array(0) { -} diff --git a/ext/session/tests/010.phpt b/ext/session/tests/010.phpt deleted file mode 100644 index e1af8ce87f9fc..0000000000000 --- a/ext/session/tests/010.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -$session_array = explode(";", session_encode()); should not segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=0 -session.bug_compat_42=1 -session.bug_compat_warn=0 ---FILE-- -<?php -error_reporting(E_ALL); - -$session_array = explode(";", @session_encode()); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/011.phpt b/ext/session/tests/011.phpt deleted file mode 100644 index 6aaa6bd79751a..0000000000000 --- a/ext/session/tests/011.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -session_decode(); should not segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=0 -session.bug_compat_42=1 -session.bug_compat_warn=0 ---FILE-- -<?php -error_reporting(E_ALL); - -@session_decode("garbage data and no session started"); -@session_decode("userid|s:5:\"mazen\";chatRoom|s:1:\"1\";"); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt deleted file mode 100644 index a3d33d36022ff..0000000000000 --- a/ext/session/tests/012.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -registering $_SESSION should not segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -### Absurd example, value of $_SESSION does not matter - -session_id("abtest"); -session_start(); -session_register("_SESSION"); -$_SESSION = "kk"; - -session_write_close(); - -### Restart to test for $_SESSION brokenness - -session_start(); -$_SESSION = "kk"; -session_destroy(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt deleted file mode 100644 index 54ccaeddb70d5..0000000000000 --- a/ext/session/tests/013.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -redefining SID should not cause warnings ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -session_destroy(); -session_id("abtest2"); -session_start(); -session_destroy(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt deleted file mode 100644 index 4c5b14c697d7c..0000000000000 --- a/ext/session/tests/014.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -a script should not be able to modify session.use_trans_sid ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_trans_sid=1 -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.name=PHPSESSID -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); - -?> -<a href="/link"> -<?php -ini_set("session.use_trans_sid","0"); -?> -<a href="/link"> -<?php -ini_set("session.use_trans_sid","1"); -?> -<a href="/link"> -<?php -session_destroy(); -?> ---EXPECTF-- -<a href="/link?PHPSESSID=abtest"> - -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time. in %s on line %d -<a href="/link?PHPSESSID=abtest"> - -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time. in %s on line %d -<a href="/link?PHPSESSID=abtest"> diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt deleted file mode 100644 index e747e08fbd95a..0000000000000 --- a/ext/session/tests/015.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -use_trans_sid should not affect SID ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_trans_sid=1 -session.use_cookies=0 -session.cache_limiter= -arg_separator.output=& -session.name=PHPSESSID -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<a href="/link?<?php echo SID; ?>"> -<?php -session_destroy(); -?> ---EXPECT-- -<a href="/link?PHPSESSID=abtest&PHPSESSID=abtest"> diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt deleted file mode 100644 index 21cd0ec929bc2..0000000000000 --- a/ext/session/tests/016.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -invalid session.save_path should not cause a segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.save_path="123;:/really\\completely:::/invalid;;,23123;213" -session.use_cookies=0 -session.cache_limiter= -session.save_handler=files -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -@session_start(); -$HTTP_SESSION_VARS["test"] = 1; -@session_write_close(); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/017.phpt b/ext/session/tests/017.phpt deleted file mode 100644 index dbe53f5698f9b..0000000000000 --- a/ext/session/tests/017.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -setting $_SESSION before session_start() should not cause segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php - -error_reporting(E_ALL); - -class Kill { - function Kill() { - global $HTTP_SESSION_VARS; - session_start(); - } -} -$k = new Kill(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt deleted file mode 100644 index 3450d1e3f142a..0000000000000 --- a/ext/session/tests/018.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -rewriter correctly handles attribute names which contain dashes ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -session.name=PHPSESSID -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php> -<?php -session_destroy(); -?> ---EXPECT-- -<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php><input type="hidden" name="PHPSESSID" value="abtest" /> diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt deleted file mode 100644 index 2d819c67627e3..0000000000000 --- a/ext/session/tests/019.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -serializing references test case using globals ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php - -error_reporting(E_ALL); - -class TFoo { - public $c; - function TFoo($c) { - $this->c = $c; - } - function inc() { - $this->c++; - } -} - -session_id("abtest"); -session_start(); -session_register('o1', 'o2' ); - -$o1 = new TFoo(42); -$o2 =& $o1; - -session_write_close(); - -unset($o1); -unset($o2); - -session_start(); - -var_dump($_SESSION); - -$o1->inc(); -$o2->inc(); - -var_dump($_SESSION); - -session_destroy(); -?> ---EXPECTF-- -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } -} -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } -} diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt deleted file mode 100644 index 455c7f72046fe..0000000000000 --- a/ext/session/tests/020.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -rewriter uses arg_seperator.output for modifying URLs ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -arg_separator.output=& -session.name=PHPSESSID -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<a href="link.php?a=b"> -<?php -session_destroy(); -?> ---EXPECT-- -<a href="link.php?a=b&PHPSESSID=abtest"> diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt deleted file mode 100644 index 9d95b86d066af..0000000000000 --- a/ext/session/tests/021.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -rewriter handles form and fieldset tags correctly ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset=" -session.name=PHPSESSID -session.serialize_handler=php -session.save_handler=files ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form="); - -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form=fakeentry"); - -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,fieldset=,area=href,frame=src,input=src"); - -?> -<form> -<fieldset> -<?php - -session_destroy(); -?> ---EXPECT-- -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset><input type="hidden" name="PHPSESSID" value="abtest" /> -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset> -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset> -<form> -<fieldset><input type="hidden" name="PHPSESSID" value="abtest" /> diff --git a/ext/session/tests/bug24592.phpt b/ext/session/tests/bug24592.phpt deleted file mode 100644 index 2c749386e635f..0000000000000 --- a/ext/session/tests/bug24592.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #24592 (crash when multiple NULL values are being stored) ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -register_globals=0 -html_errors=0 -session.save_handler=files ---FILE-- -<?php -@session_start(); - -$foo = $_SESSION['foo']; -$bar = $_SESSION['bar']; - -var_dump($foo, $bar, $_SESSION); - -$_SESSION['foo'] = $foo; -$_SESSION['bar'] = $bar; - -var_dump($_SESSION); -?> ---EXPECTF-- -Notice: Undefined index: foo in %s on line %d - -Notice: Undefined index: bar in %s on line %d -NULL -NULL -array(0) { -} -array(2) { - ["foo"]=> - NULL - ["bar"]=> - NULL -} diff --git a/ext/session/tests/bug26862.phpt b/ext/session/tests/bug26862.phpt deleted file mode 100644 index 44e7418cd0958..0000000000000 --- a/ext/session/tests/bug26862.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #26862 (ob_flush() before output_reset_rewrite_vars() results in data loss) ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -register_globals=0 -html_errors=0 -session.use_trans_sid=0 -session.save_handler=files ---FILE-- -<?php -session_start(); -output_add_rewrite_var('var', 'value'); - -echo '<a href="file.php">link</a>'; - -ob_flush(); - -output_reset_rewrite_vars(); -echo '<a href="file.php">link</a>'; -?> ---EXPECT-- -<a href="file.php?var=value">link</a><a href="file.php">link</a> diff --git a/ext/session/tests/bug31454.phpt b/ext/session/tests/bug31454.phpt deleted file mode 100644 index 67f4f3b422651..0000000000000 --- a/ext/session/tests/bug31454.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -bug #31454 (session_set_save_handler crashes PHP when supplied non-existent object ref) ---SKIPIF-- -<?php include('skipif.inc'); ?> ---FILE-- -<?php - -session_set_save_handler( - array(&$arf, 'open'), - array(&$arf, 'close'), - array(&$arf, 'read'), - array(&$arf, 'write'), - array(&$arf, 'destroy'), - array(&$arf, 'gc')); - -echo "Done\n"; -?> ---EXPECTF-- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %sbug31454.php on line %d -Done diff --git a/ext/session/tests/skipif.inc b/ext/session/tests/skipif.inc deleted file mode 100644 index 6e3eae0862c42..0000000000000 --- a/ext/session/tests/skipif.inc +++ /dev/null @@ -1,25 +0,0 @@ -<?php -// This script prints "skip" if condition does not meet. -if (!extension_loaded("session") && ini_get("enable_dl")) { - $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; - @dl("session$dlext"); -} -if (!extension_loaded("session")) { - die("skip Session module not loaded"); -} -$save_path = ini_get("session.save_path"); -if ($save_path) { - if (!file_exists($save_path)) { - die("skip Session save_path doesn't exist"); - } - - if ($save_path && !@is_writable($save_path)) { - if (($p = strpos($save_path, ';')) !== false) { - $save_path = substr($save_path, ++$p); - } - if (!@is_writable($save_path)) { - die("skip\n"); - } - } -} -?> diff --git a/ext/shmop/CREDITS b/ext/shmop/CREDITS deleted file mode 100644 index caab89e208877..0000000000000 --- a/ext/shmop/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Shared Memory Operations -Slava Poliakov, Ilia Alshanetsky diff --git a/ext/shmop/README b/ext/shmop/README deleted file mode 100644 index 5ec15861b8489..0000000000000 --- a/ext/shmop/README +++ /dev/null @@ -1,69 +0,0 @@ -last update Jan 2, 2002 (hackie@prohost.org/ilia@prohost.org) - -Shared Memory Operations Extension to PHP - - While developing a search deamon we needed a php based front end - to communicate the deamon via SHM. PHP already had a shared memory - extention (sysvshm) written by Christian Cartus <cartus@atrior.de>, - unfortunatly this extention was designed with PHP only in mind and - offers high level features which are extremly bothersome for basic SHM - we had in mind. After spending a day trying to reverse engineer and figure - out the format of sysvshm we decided that it would be much easier to - add our own extention to php for simple SHM operations, we were right :)). - -the functions are: - -int shmop_open(int key, string flags, int mode, int size) - - key - the key of/for the shared memory block - flags - 4 flags are avalible - a for read only access (sets SHM_RDONLY) - w for read & write access - c create or open an existing segment (sets IPC_CREATE) - n create a new segment and fail if one already exists under same name (sets IPC_CREATE|IPC_EXCL) - (the n flag is mostly useful for security perpouses, so that you don't end up opening a faked segment - if someone guesses your key) - mode - acsess mode same as for a file (0644) for example - size - size of the block in bytes - - returns an indentifier - - -char shmop_read(int shmid, int start, int count) - - shmid - shmid from which to read - start - offset from which to start reading - count - how many bytes to read - - returns the data read - -int shmop_write(int shmid, string data, int offset) - - shmid - shmid from which to read - data - string to put into shared memory - offset - offset in shm to write from - - returns bytes written - -int shmop_size(int shmid) - - shmid - shmid for which to return the size - - returns the size in bytes of the shm segment - - -int shmop_delete(int shmid) - - marks the segment for deletion, the segment will be deleted when all processes mapping it will detach - - shmid - shmid which to mark for deletion - - returns 1 if all ok, zero on failure - -int shmop_close(int shmid) - - shmid - shmid which to close - - returns zero - - diff --git a/ext/shmop/config.m4 b/ext/shmop/config.m4 deleted file mode 100644 index 6c1709d71526a..0000000000000 --- a/ext/shmop/config.m4 +++ /dev/null @@ -1,8 +0,0 @@ -dnl $Id$ -PHP_ARG_ENABLE(shmop, whether to enable shmop support, -[ --enable-shmop Enable shmop support]) - -if test "$PHP_SHMOP" != "no"; then - AC_DEFINE(HAVE_SHMOP, 1, [ ]) - PHP_NEW_EXTENSION(shmop, shmop.c, $ext_shared) -fi diff --git a/ext/shmop/config.w32 b/ext/shmop/config.w32 deleted file mode 100644 index 9302184af66db..0000000000000 --- a/ext/shmop/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("shmop", "shmop support", "no"); - -if (PHP_SHMOP == "yes") { - EXTENSION("shmop", "shmop.c"); - AC_DEFINE('HAVE_SHMOP', 1, 'Have SHMOP support'); -} diff --git a/ext/shmop/package.xml b/ext/shmop/package.xml deleted file mode 100644 index b77ddd5be07d8..0000000000000 --- a/ext/shmop/package.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>shmop</name> - <summary>Portable shared memory access</summary> - <maintainers> - <maintainer> - <user>iliaa</user> - <name>Ilia Alshanetsky</name> - <email>ilia@prohost.org</email> - <role>lead</role> - </maintainer> - <maintainer> - <name>Slava Poliakov</name> - <email>hackie@prohost.org</email> - <role>developer</role> - </maintainer> - </maintainers> - <description> - Portable Shared Memory access - </description> - <license>PHP</license> - <release> - <state>stable</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="doc" name="README"/> - <file role="src" name="config.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="shmop.dsp"/> - <file role="src" name="shmop.c"/> - <file role="src" name="php_shmop.h"/> - <file role="test" name="tests/001.phpt"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h deleted file mode 100644 index 30db3196f00ed..0000000000000 --- a/ext/shmop/php_shmop.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Slava Poliakov <hackie@prohost.org> | - | Ilia Alshanetsky <ilia@prohost.org> | - +----------------------------------------------------------------------+ - */ -#ifndef PHP_SHMOP_H -#define PHP_SHMOP_H - -#if HAVE_SHMOP - -extern zend_module_entry shmop_module_entry; -#define phpext_shmop_ptr &shmop_module_entry - -#ifdef PHP_WIN32 -#define PHP_SHMOP_API __declspec(dllexport) -#else -#define PHP_SHMOP_API -#endif - -PHP_MINIT_FUNCTION(shmop); -PHP_MINFO_FUNCTION(shmop); - -PHP_FUNCTION(shmop_open); -PHP_FUNCTION(shmop_read); -PHP_FUNCTION(shmop_close); -PHP_FUNCTION(shmop_size); -PHP_FUNCTION(shmop_write); -PHP_FUNCTION(shmop_delete); - -#ifdef PHP_WIN32 -typedef int key_t; -#endif - -struct php_shmop -{ - int shmid; - key_t key; - int shmflg; - int shmatflg; - char *addr; - int size; -}; - -typedef struct { - int le_shmop; -} php_shmop_globals; - -#ifdef ZTS -#define SHMOPG(v) TSRMG(shmop_globals_id, php_shmop_globals *, v) -#else -#define SHMOPG(v) (shmop_globals.v) -#endif - -#else - -#define phpext_shmop_ptr NULL - -#endif - -#endif /* PHP_SHMOP_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c deleted file mode 100644 index 1a84e1edb9b27..0000000000000 --- a/ext/shmop/shmop.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Slava Poliakov <hackie@prohost.org> | - | Ilia Alshanetsky <ilia@prohost.org> | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_shmop.h" -# ifndef PHP_WIN32 -# include <sys/ipc.h> -# include <sys/shm.h> -#else -#include "tsrm_win32.h" -#endif - - -#if HAVE_SHMOP - -#include "ext/standard/info.h" - -#ifdef ZTS -int shmop_globals_id; -#else -php_shmop_globals shmop_globals; -#endif - -int shm_type; - -/* {{{ shmop_functions[] - */ -function_entry shmop_functions[] = { - PHP_FE(shmop_open, NULL) - PHP_FE(shmop_read, NULL) - PHP_FE(shmop_close, NULL) - PHP_FE(shmop_size, NULL) - PHP_FE(shmop_write, NULL) - PHP_FE(shmop_delete, NULL) - {NULL, NULL, NULL} /* Must be the last line in shmop_functions[] */ -}; -/* }}} */ - -/* {{{ shmop_module_entry - */ -zend_module_entry shmop_module_entry = { - STANDARD_MODULE_HEADER, - "shmop", - shmop_functions, - PHP_MINIT(shmop), - NULL, - NULL, - NULL, - PHP_MINFO(shmop), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SHMOP -ZEND_GET_MODULE(shmop) -#endif - -/* {{{ rsclean - */ -static void rsclean(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr; - - shmdt(shmop->addr); - efree(shmop); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(shmop) -{ - shm_type = zend_register_list_destructors_ex(rsclean, NULL, "shmop", module_number); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(shmop) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "shmop support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto int shmop_open (int key, string flags, int mode, int size) - gets and attaches a shared memory segment */ -PHP_FUNCTION(shmop_open) -{ - long key, mode, size; - struct php_shmop *shmop; - struct shmid_ds shm; - int rsid; - char *flags; - int flags_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (flags_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid flag", flags); - RETURN_FALSE; - } - - shmop = emalloc(sizeof(struct php_shmop)); - memset(shmop, 0, sizeof(struct php_shmop)); - - shmop->key = key; - shmop->shmflg |= mode; - - switch (flags[0]) - { - case 'a': - shmop->shmatflg |= SHM_RDONLY; - break; - case 'c': - shmop->shmflg |= IPC_CREAT; - shmop->size = size; - break; - case 'n': - shmop->shmflg |= (IPC_CREAT | IPC_EXCL); - shmop->size = size; - break; - case 'w': - /* noop - shm segment is being opened for read & write - will fail if segment does not exist - */ - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid access mode"); - goto err; - } - - shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg); - if (shmop->shmid == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach or create shared memory segment"); - goto err; - } - - if (shmctl(shmop->shmid, IPC_STAT, &shm)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get shared memory segment information"); - goto err; - } - - shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg); - if (shmop->addr == (char*) -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach to shared memory segment"); - goto err; - } - - shmop->size = shm.shm_segsz; - - rsid = zend_list_insert(shmop, shm_type); - RETURN_LONG(rsid); -err: - efree(shmop); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string shmop_read (int shmid, int start, int count) - reads from a shm segment */ -PHP_FUNCTION(shmop_read) -{ - long shmid, start, count; - struct php_shmop *shmop; - int type; - char *startaddr; - int bytes; - char *return_string; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &shmid, &start, &count) == FAILURE) { - WRONG_PARAM_COUNT; - } - - shmop = zend_list_find(shmid, &type); - - if (!shmop) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no shared memory segment with an id of [%lu]", shmid); - RETURN_FALSE; - } - - if (start < 0 || start > shmop->size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "start is out of range"); - RETURN_FALSE; - } - - if (start + count > shmop->size || count < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "count is out of range"); - RETURN_FALSE; - } - - startaddr = shmop->addr + start; - bytes = count ? count : shmop->size - start; - - return_string = emalloc(bytes+1); - memcpy(return_string, startaddr, bytes); - return_string[bytes] = 0; - - RETURN_STRINGL(return_string, bytes, 0); -} -/* }}} */ - -/* {{{ proto void shmop_close (int shmid) - closes a shared memory segment */ -PHP_FUNCTION(shmop_close) -{ - long shmid; - struct php_shmop *shmop; - int type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - shmop = zend_list_find(shmid, &type); - - if (!shmop) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no shared memory segment with an id of [%lu]", shmid); - RETURN_FALSE; - } - - zend_list_delete(shmid); -} -/* }}} */ - -/* {{{ proto int shmop_size (int shmid) - returns the shm size */ -PHP_FUNCTION(shmop_size) -{ - long shmid; - struct php_shmop *shmop; - int type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - shmop = zend_list_find(shmid, &type); - - if (!shmop) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no shared memory segment with an id of [%lu]", shmid); - RETURN_FALSE; - } - - RETURN_LONG(shmop->size); -} -/* }}} */ - -/* {{{ proto int shmop_write (int shmid, string data, int offset) - writes to a shared memory segment */ -PHP_FUNCTION(shmop_write) -{ - struct php_shmop *shmop; - int type; - int writesize; - long shmid, offset; - char *data; - int data_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsl", &shmid, &data, &data_len, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - shmop = zend_list_find(shmid, &type); - - if (!shmop) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no shared memory segment with an id of [%lu]", shmid); - RETURN_FALSE; - } - - if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "trying to write to a read only segment"); - RETURN_FALSE; - } - - if (offset < 0 || offset > shmop->size) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "offset out of range"); - RETURN_FALSE; - } - - writesize = (data_len < shmop->size - offset) ? data_len : shmop->size - offset; - memcpy(shmop->addr + offset, data, writesize); - - RETURN_LONG(writesize); -} -/* }}} */ - -/* {{{ proto bool shmop_delete (int shmid) - mark segment for deletion */ -PHP_FUNCTION(shmop_delete) -{ - long shmid; - struct php_shmop *shmop; - int type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - shmop = zend_list_find(shmid, &type); - - if (!shmop) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no shared memory segment with an id of [%lu]", shmid); - RETURN_FALSE; - } - - if (shmctl(shmop->shmid, IPC_RMID, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't mark segment for deletion (are you the owner?)"); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -#endif /* HAVE_SHMOP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/shmop/shmop.dsp b/ext/shmop/shmop.dsp deleted file mode 100644 index 848f0bdc91dde..0000000000000 --- a/ext/shmop/shmop.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="shmop" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=shmop - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "shmop.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "shmop.mak" CFG="shmop - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "shmop - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "shmop - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "shmop - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D "NDEBUG" /D "PHP_EXPORTS" /D "HAVE_SHMOP" /D COMPILE_DL_SHMOP=1 /D ZEND_DEBUG=0 /D "ZTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_shmop.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "shmop - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_DEBUG=1 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_EXPORTS" /D "COMPILE_DL_SHMOP" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SHMOP=1 /D ZTS=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_shmop.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "shmop - Win32 Release_TS" -# Name "shmop - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\shmop.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_shmop.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/shmop/tests/001.phpt b/ext/shmop/tests/001.phpt deleted file mode 100644 index fc293c82ec836..0000000000000 --- a/ext/shmop/tests/001.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -shmop extension test ---SKIPIF-- -<?php - if (!extension_loaded("shmop")) { - die("skip shmop() extension not available"); - } -?> ---FILE-- -<?php - $hex_shm_id = 0xff3; - $write_d1 = "test #1 of the shmop() extension"; - $write_d2 = "test #2 append data to shared memory segment"; - - echo "shm open for create: "; - $shm_id = shmop_open($hex_shm_id, "n", 0644, 1024); - if (!$shm_id) { - die("failed\n"); - } else { - echo "ok\n"; - } - - echo "shm size is: " . ($shm_size = shmop_size($shm_id)) . "\n"; - - echo "shm write test #1: "; - $written = shmop_write($shm_id, $write_d1, 0); - if ($written != strlen($write_d1)) { - echo "failed\n"; - } else { - echo "ok\n"; - } - - echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n"; - - shmop_close($shm_id); - - echo "shm open for read only: "; - $shm_id = shmop_open($hex_shm_id, "a", 0644, 1024); - if (!$shm_id) { - echo "failed\n"; - } else { - echo "ok\n"; - } - - echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n"; - - /* try to append data to the shared memory segment, this should fail */ - @shmop_write($shm_id, $write_d1, $written); - echo $php_errormsg . "\n"; - - shmop_close($shm_id); - - echo "shm open for read only: "; - $shm_id = shmop_open($hex_shm_id, "w", 0644, 1024); - if (!$shm_id) { - echo "failed\n"; - } else { - echo "ok\n"; - } - - echo "shm write test #1: "; - $written = shmop_write($shm_id, $write_d2, $written); - if ($written != strlen($write_d2)) { - die("failed\n"); - } else { - echo "ok\n"; - } - - echo "data in memory is: " . shmop_read($shm_id, 0, strlen($write_d1 . $write_d2)) . "\n"; - - echo "deletion of shm segment: "; - if (!shmop_delete($shm_id)) { - echo "failed\n"; - } else { - echo "ok\n"; - } - - shmop_close($shm_id); -?> ---EXPECT-- -shm open for create: ok -shm size is: 1024 -shm write test #1: ok -data in memory is: test #1 of the shmop() extension -shm open for read only: ok -data in memory is: test #1 of the shmop() extension -trying to write to a read only segment -shm open for read only: ok -shm write test #1: ok -data in memory is: test #1 of the shmop() extensiontest #2 append data to shared memory segment -deletion of shm segment: ok diff --git a/ext/simplexml/CREDITS b/ext/simplexml/CREDITS deleted file mode 100644 index bff168d767d98..0000000000000 --- a/ext/simplexml/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SimpleXML -Sterling Hughes, Marcus Boerger, Rob Richards diff --git a/ext/simplexml/README b/ext/simplexml/README deleted file mode 100755 index bb9240d1036f8..0000000000000 --- a/ext/simplexml/README +++ /dev/null @@ -1,34 +0,0 @@ -SimpleXML is meant to be an easy way to access XML data. - -SimpleXML objects follow four basic rules: - -1) properties denote element iterators -2) numeric indices denote elements -3) non numeric indices denote attributes -4) string conversion allows to access TEXT data - -When iterating properties then the extension always iterates over -all nodes with that element name. Thus method children() must be -called to iterate over subnodes. But also doing the following: -foreach ($obj->node_name as $elem) { - // do something with $elem -} -always results in iteration of 'node_name' elements. So no further -check is needed to distinguish the number of nodes of that type. - -When an elements TEXT data is being accessed through a property -then the result does not include the TEXT data of subelements. - -Known issues -============ - -Due to engine problems it is currently not possible to access -a subelement by index 0: $object->property[0]. - -TODO -==== - -At the moment property access to multiple elements of the same -name returns an array of SimpleXML objects. This should be an -object of a new type instead so that all kinds of linkage, -assignment and deleting would work. diff --git a/ext/simplexml/config.m4 b/ext/simplexml/config.m4 deleted file mode 100644 index 7bc864409e581..0000000000000 --- a/ext/simplexml/config.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension simplexml - -PHP_ARG_ENABLE(simplexml, whether to enable SimpleXML support, -[ --disable-simplexml Disable SimpleXML support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR SimpleXML: libxml2 install prefix], no, no) -fi - -if test "$PHP_SIMPLEXML" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([SimpleXML extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(SIMPLEXML_SHARED_LIBADD, [ - AC_DEFINE(HAVE_SIMPLEXML,1,[ ]) - PHP_NEW_EXTENSION(simplexml, simplexml.c, $ext_shared) - PHP_SUBST(SIMPLEXML_SHARED_LIBADD) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) - PHP_ADD_EXTENSION_DEP(simplexml, libxml) - PHP_ADD_EXTENSION_DEP(simplexml, spl, true) -fi diff --git a/ext/simplexml/config.w32 b/ext/simplexml/config.w32 deleted file mode 100644 index 26a87f1c145f9..0000000000000 --- a/ext/simplexml/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("simplexml", "Simple XML support", "yes"); - -if (PHP_SIMPLEXML == "yes" && PHP_LIBXML == "yes") { - EXTENSION("simplexml", "simplexml.c"); - AC_DEFINE("HAVE_SIMPLEXML", 1, "Simple XML support"); - if (!PHP_SIMPLEXML_SHARED) { - ADD_FLAG("CFLAGS_SIMPLEXML", "/D LIBXML_STATIC"); - } - ADD_EXTENSION_DEP('simplexml', 'libxml'); - ADD_EXTENSION_DEP('simplexml', 'spl', true); -} - - diff --git a/ext/simplexml/examples/book.php b/ext/simplexml/examples/book.php deleted file mode 100644 index 0416df861b4b2..0000000000000 --- a/ext/simplexml/examples/book.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -$books = simplexml_load_file('book.xml'); -//var_dump($books); -$books = $books->book; -foreach ($books as $book) { - echo "{$book->title} was written by {$book->author}\n"; -} -?> diff --git a/ext/simplexml/examples/book.xml b/ext/simplexml/examples/book.xml deleted file mode 100644 index ea40508e01b28..0000000000000 --- a/ext/simplexml/examples/book.xml +++ /dev/null @@ -1,10 +0,0 @@ -<books> - <book> - <title>The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/simplexml/examples/interop.php b/ext/simplexml/examples/interop.php deleted file mode 100644 index 9e38ec11104c0..0000000000000 --- a/ext/simplexml/examples/interop.php +++ /dev/null @@ -1,27 +0,0 @@ -load("book.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -print "As SimpleXML\n"; - -$s = simplexml_import_dom($dom); -$books = $s->book; -foreach ($books as $book) { - echo "{$book->title} was written by {$book->author}\n"; -} - -print "As DOM \n"; - -$dom = dom_import_simplexml($s); -$books = $dom->getElementsByTagName("book"); -foreach ($books as $book) { - $title = $book->getElementsByTagName("title"); - $author = $book->getElementsByTagName("author"); - echo $title[0]->firstChild->data . " was written by ". $author[0]->firstChild->data . "\n"; -} - - -?> diff --git a/ext/simplexml/examples/security.php b/ext/simplexml/examples/security.php deleted file mode 100644 index 17897b3fd778b..0000000000000 --- a/ext/simplexml/examples/security.php +++ /dev/null @@ -1,6 +0,0 @@ -id; -$s->id = 20; -$s->asXML('security.new.xml'); -?> diff --git a/ext/simplexml/examples/security.xml b/ext/simplexml/examples/security.xml deleted file mode 100644 index d954a023353af..0000000000000 --- a/ext/simplexml/examples/security.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 15 - diff --git a/ext/simplexml/examples/xpath.php b/ext/simplexml/examples/xpath.php deleted file mode 100644 index 8fcd9878ab583..0000000000000 --- a/ext/simplexml/examples/xpath.php +++ /dev/null @@ -1,9 +0,0 @@ -xpath("/books/book/title"); -foreach($xpath_result as $entry ) { - print "$entry \n"; -} - -?> diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h deleted file mode 100644 index fbfe827443395..0000000000000 --- a/ext/simplexml/php_simplexml.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SIMPLEXML_H -#define PHP_SIMPLEXML_H - -extern zend_module_entry simplexml_module_entry; -#define phpext_simplexml_ptr &simplexml_module_entry - -#ifdef PHP_WIN32 -#define PHP_SIMPLEXML_API __declspec(dllexport) -#else -#define PHP_SIMPLEXML_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include "ext/libxml/php_libxml.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -PHP_MINIT_FUNCTION(simplexml); -PHP_MSHUTDOWN_FUNCTION(simplexml); -#ifdef HAVE_SPL -PHP_RINIT_FUNCTION(simplexml); -#endif -PHP_MINFO_FUNCTION(simplexml); - -typedef struct { - zend_object zo; - php_libxml_node_ptr *node; - php_libxml_ref_obj *document; - HashTable *properties; - xmlXPathContextPtr xpath; - struct { - int itertype; - char *name; - char *nsprefix; - int type; - zval *data; - } iter; -} php_sxe_object; - -#define SXE_ITER_NONE 0 -#define SXE_ITER_ELEMENT 1 -#define SXE_ITER_CHILD 2 -#define SXE_ITER_ATTRLIST 3 - -#ifdef ZTS -#define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v) -#else -#define SIMPLEXML_G(v) (simplexml_globals.v) -#endif - -ZEND_API zend_class_entry *sxe_get_element_class_entry(TSRMLS_D); - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h deleted file mode 100755 index db97da074e1c3..0000000000000 --- a/ext/simplexml/php_simplexml_exports.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - | Marcus Boerger | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SIMPLEXML_EXPORTS_H -#define PHP_SIMPLEXML_EXPORTS_H - -#include "php_simplexml.h" - -#define SKIP_TEXT(__p) \ - if ((__p)->type == XML_TEXT_NODE) { \ - goto next_iter; \ - } - -#define GET_NODE(__s, __n) { \ - if ((__s)->node && (__s)->node->node) { \ - __n = (__s)->node->node; \ - } else { \ - __n = NULL; \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \ - } \ -} - -ZEND_API zend_object_value sxe_object_new(zend_class_entry *ce TSRMLS_DC); -/* {{{ php_sxe_fetch_object() - */ -static inline php_sxe_object * -php_sxe_fetch_object(zval *object TSRMLS_DC) -{ - return (php_sxe_object *) zend_object_store_get_object(object TSRMLS_CC); -} -/* }}} */ - -ZEND_API void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC); -ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC); - -typedef struct { - zend_object_iterator intern; - php_sxe_object *sxe; -} php_sxe_iterator; - -#endif /* PHP_SIMPLEXML_EXPORTS_H */ - -/** - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: t - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c deleted file mode 100644 index 980c33da50f5a..0000000000000 --- a/ext/simplexml/simplexml.c +++ /dev/null @@ -1,1788 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - | Marcus Boerger | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_SIMPLEXML - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "php_simplexml.h" -#include "php_simplexml_exports.h" -#include "zend_exceptions.h" -#include "zend_interfaces.h" -#ifdef HAVE_SPL -#include "ext/spl/spl_sxe.h" -#endif - -zend_class_entry *sxe_class_entry = NULL; - -ZEND_API zend_class_entry *sxe_get_element_class_entry(TSRMLS_D) -{ - return U_CLASS_ENTRY(sxe_class_entry); -} - -#define SXE_ME(func, arg_info, flags) PHP_ME(simplexml_element, func, arg_info, flags) - -#define SXE_METHOD(func) PHP_METHOD(simplexml_element, func) - -static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC); -static zend_object_value php_sxe_register_object(php_sxe_object * TSRMLS_DC); - -/* {{{ _node_as_zval() - */ -static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, int itertype, char *name, char *prefix TSRMLS_DC) -{ - php_sxe_object *subnode; - - subnode = php_sxe_object_new(sxe->zo.ce TSRMLS_CC); - subnode->document = sxe->document; - subnode->document->refcount++; - subnode->iter.type = itertype; - if (name) { - subnode->iter.name = xmlStrdup(name); - } - if (prefix) { - subnode->iter.nsprefix = xmlStrdup(prefix); - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC); - - value->type = IS_OBJECT; - value->value.obj = php_sxe_register_object(subnode TSRMLS_CC); -} -/* }}} */ - -#define APPEND_PREV_ELEMENT(__c, __v) \ - if ((__c) == 1) { \ - array_init(return_value); \ - add_next_index_zval(return_value, __v); \ - } - -#define APPEND_CUR_ELEMENT(__c, __v) \ - if (++(__c) > 1) { \ - add_next_index_zval(return_value, __v); \ - } - -#define GET_NODE(__s, __n) { \ - if ((__s)->node && (__s)->node->node) { \ - __n = (__s)->node->node; \ - } else { \ - __n = NULL; \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \ - } \ -} - -static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node TSRMLS_DC) { - php_sxe_object *intern; - xmlNodePtr retnode = NULL; - - if (sxe && sxe->iter.type != SXE_ITER_NONE) { - php_sxe_reset_iterator(sxe TSRMLS_CC); - if (sxe->iter.data) { - intern = (php_sxe_object *)zend_object_store_get_object(sxe->iter.data TSRMLS_CC); - GET_NODE(intern, retnode) - } - return retnode; - } else { - return node; - } -} - -/* {{{ match_ns() - */ -static inline int -match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) -{ - if (name == NULL && (node->ns == NULL || node->ns->prefix == NULL)) { - return 1; - } - - if (node->ns && !xmlStrcmp(node->ns->href, name)) { - return 1; - } - - return 0; -} -/* }}} */ - -/* {{{ sxe_get_element_node() - */ -static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, long offset, xmlNodePtr node) { - long nodendx = 0; - - if (sxe->iter.type == SXE_ITER_NONE) { - return NULL; - } - while (node && nodendx <= offset) { - SKIP_TEXT(node) - if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix)) { - if (sxe->iter.type == SXE_ITER_CHILD || ( - sxe->iter.type == SXE_ITER_ELEMENT && !xmlStrcmp(node->name, sxe->iter.name))) { - if (nodendx == offset) { - break; - } - nodendx++; - } - } -next_iter: - node = node->next; - } - - return node; -} -/* }}} */ - -/* {{{ sxe_prop_dim_read() - */ -static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, zend_bool attribs, zend_bool silent TSRMLS_DC) -{ - zval *return_value; - php_sxe_object *sxe; - char *name; - xmlNodePtr node; - xmlAttrPtr attr; - zval tmp_zv; - int nodendx = 0; - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - - if (Z_TYPE_P(member) == IS_LONG) { - if (sxe->iter.type != SXE_ITER_ATTRLIST) { - attribs = 0; - elements = 1; - } - } else { - if (Z_TYPE_P(member) != IS_STRING) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); - member = &tmp_zv; - convert_to_string(member); - } - } - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - - name = Z_STRVAL_P(member); - - GET_NODE(sxe, node); - - if (sxe->iter.type != SXE_ITER_CHILD && sxe->iter.type != SXE_ITER_ATTRLIST) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - - if (node) { - if (attribs) { - if (Z_TYPE_P(member) == IS_LONG && sxe->iter.type != SXE_ITER_ATTRLIST) { - attr = NULL; - } else { - attr = node->properties; - if (Z_TYPE_P(member) == IS_LONG) { - while (attr && nodendx <= Z_LVAL_P(member)) { - if (match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - if (nodendx == Z_LVAL_P(member)) { - _node_as_zval(sxe, (xmlNodePtr) attr, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC); - break; - } - nodendx++; - } - attr = attr->next; - } - } else { - while (attr) { - if (!xmlStrcmp(attr->name, name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - _node_as_zval(sxe, (xmlNodePtr) attr, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC); - break; - } - attr = attr->next; - } - } - } - } - - if (elements) { - if (!sxe->node) { - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL TSRMLS_CC); - } - if (Z_TYPE_P(member) == IS_LONG) { - if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node); - if (node) { - _node_as_zval(sxe, node, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC); - } - } else { - _node_as_zval(sxe, node, return_value, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix TSRMLS_CC); - } - } - } - - return_value->refcount = 0; - return_value->is_ref = 0; - - if (member == &tmp_zv) { - zval_dtor(&tmp_zv); - } - - return return_value; -} -/* }}} */ - -/* {{{ sxe_property_read() - */ -static zval * sxe_property_read(zval *object, zval *member, int type TSRMLS_DC) -{ - return sxe_prop_dim_read(object, member, 1, 0, type == BP_VAR_IS TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_dimension_read() - */ -static zval * sxe_dimension_read(zval *object, zval *offset, int type TSRMLS_DC) -{ - return sxe_prop_dim_read(object, offset, 0, 1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ change_node_zval() - */ -static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC) -{ - zval value_copy; - - switch (Z_TYPE_P(value)) { - case IS_LONG: - case IS_BOOL: - case IS_DOUBLE: - case IS_NULL: - case IS_UNICODE: - if (value->refcount > 1) { - value_copy = *value; - zval_copy_ctor(&value_copy); - value = &value_copy; - } - convert_to_string(value); - /* break missing intentionally */ - case IS_STRING: - case IS_BINARY: - xmlNodeSetContentLen(node, Z_STRVAL_P(value), Z_STRLEN_P(value)); - if (value == &value_copy) { - zval_dtor(value); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not possible to assign complex types to nodes"); - break; - } -} -/* }}} */ - -/* {{{ sxe_property_write() - */ -static void sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs TSRMLS_DC) -{ - php_sxe_object *sxe; - char *name; - xmlNodePtr node; - xmlNodePtr newnode = NULL; - xmlNodePtr tempnode; - xmlAttrPtr attr = NULL; - int counter = 0; - int is_attr = 0; - int nodendx = 0; - zval tmp_zv, trim_zv; - - if (!member) { - /* This happens when the user did: $sxe[] = $value - * and could also be E_PARSE, but we use this only during parsing - * and this is during runtime. - */ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute"); - return; - } - - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - - if (Z_TYPE_P(member) == IS_LONG) { - if (sxe->iter.type != SXE_ITER_ATTRLIST) { - attribs = 0; - elements = 1; - } - } else { - if (Z_TYPE_P(member) != IS_STRING) { - trim_zv = *member; - zval_copy_ctor(&trim_zv); - convert_to_string(&trim_zv); - php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, IS_STRING, &tmp_zv, 3 TSRMLS_CC); - zval_dtor(&trim_zv); - member = &tmp_zv; - } - - if (!Z_STRLEN_P(member)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element"); - if (member == &tmp_zv) { - zval_dtor(&tmp_zv); - } - return; - } - } - - name = Z_STRVAL_P(member); - - GET_NODE(sxe, node); - - if (sxe->iter.type != SXE_ITER_ATTRLIST) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - - if (node) { - if (attribs) { - attr = node->properties; - if (Z_TYPE_P(member) == IS_LONG) { - while (attr && nodendx <= Z_LVAL_P(member)) { - if (match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - if (nodendx == Z_LVAL_P(member)) { - is_attr = 1; - ++counter; - break; - } - nodendx++; - } - attr = attr->next; - } - } else { - while (attr) { - if (!xmlStrcmp(attr->name, name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - is_attr = 1; - ++counter; - break; - } - attr = attr->next; - } - } - - } - - if (elements) { - if (Z_TYPE_P(member) == IS_LONG) { - newnode = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node); - if (newnode) { - ++counter; - } - } else { - node = node->children; - while (node) { - SKIP_TEXT(node); - - if (!xmlStrcmp(node->name, name)) { - newnode = node; - ++counter; - } - -next_iter: - node = node->next; - } - } - } - - if (counter == 1) { - if (is_attr) { - newnode = (xmlNodePtr) attr; - } - while ((tempnode = (xmlNodePtr) newnode->children)) { - xmlUnlinkNode(tempnode); - php_libxml_node_free_resource((xmlNodePtr) tempnode TSRMLS_CC); - } - change_node_zval(newnode, value TSRMLS_CC); - } else if (counter > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)"); - } else { - if (attribs) { - switch (Z_TYPE_P(value)) { - case IS_LONG: - case IS_BOOL: - case IS_DOUBLE: - case IS_NULL: - case IS_UNICODE: - convert_to_string(value); - case IS_STRING: - case IS_BINARY: - newnode = (xmlNodePtr)xmlNewProp(node, name, Z_STRVAL_P(value)); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not yet possible to assign complex types to attributes"); - } - } - } - } - - if (member == &tmp_zv) { - zval_dtor(&tmp_zv); - } -} -/* }}} */ - -/* {{{ sxe_property_write() - */ -static void sxe_property_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - sxe_prop_dim_write(object, member, value, 1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_dimension_write() - */ -static void sxe_dimension_write(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - sxe_prop_dim_write(object, offset, value, 0, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_prop_dim_exists() - */ -static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs TSRMLS_DC) -{ - php_sxe_object *sxe; - char *name; - xmlNodePtr node; - xmlAttrPtr attr = NULL; - int exists = 0; - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - - name = Z_STRVAL_P(member); - - GET_NODE(sxe, node); - - if (Z_TYPE_P(member) == IS_LONG) { - if (sxe->iter.type != SXE_ITER_ATTRLIST) { - attribs = 0; - elements = 1; - if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - } - } - - if (sxe->iter.type != SXE_ITER_CHILD && sxe->iter.type != SXE_ITER_ATTRLIST) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - - if (node) { - if (attribs) { - attr = node->properties; - while (attr) { - if (!xmlStrcmp(attr->name, name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - exists = 1; - break; - } - - attr = attr->next; - } - } - - if (elements) { - if (Z_TYPE_P(member) == IS_LONG) { - if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - } - node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node); - } - else { - zval tmp_zv; - - if (Z_TYPE_P(member) != IS_STRING) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); - member = &tmp_zv; - convert_to_string(member); - } - node = node->children; - while (node) { - xmlNodePtr nnext; - nnext = node->next; - if (!xmlStrcmp(node->name, Z_STRVAL_P(member))) { - break; - } - node = nnext; - } - if (member == &tmp_zv) { - zval_dtor(&tmp_zv); - } - } - if (node) { - exists = 1; - } - } - } - - return exists; -} -/* }}} */ - -/* {{{ sxe_property_exists() - */ -static int sxe_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - return sxe_prop_dim_exists(object, member, check_empty, 1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_property_exists() - */ -static int sxe_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - return sxe_prop_dim_exists(object, member, check_empty, 0, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_prop_dim_delete() - */ -static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, zend_bool attribs TSRMLS_DC) -{ - php_sxe_object *sxe; - xmlNodePtr node; - xmlNodePtr nnext; - xmlAttrPtr attr; - xmlAttrPtr anext; - zval tmp_zv; - - if (Z_TYPE_P(member) != IS_STRING) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); - member = &tmp_zv; - convert_to_string(member); - } - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - if (node) { - if (attribs) { - attr = node->properties; - while (attr) { - anext = attr->next; - if (!xmlStrcmp(attr->name, Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) { - xmlUnlinkNode((xmlNodePtr) attr); - php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC); - break; - } - attr = anext; - } - } - - if (elements) { - node = node->children; - while (node) { - nnext = node->next; - - SKIP_TEXT(node); - - if (!xmlStrcmp(node->name, Z_STRVAL_P(member))) { - xmlUnlinkNode(node); - php_libxml_node_free_resource(node TSRMLS_CC); - } - -next_iter: - node = nnext; - } - } - } - - if (member == &tmp_zv) { - zval_dtor(&tmp_zv); - } -} -/* }}} */ - -/* {{{ sxe_property_delete() - */ -static void sxe_property_delete(zval *object, zval *member TSRMLS_DC) -{ - sxe_prop_dim_delete(object, member, 1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ sxe_dimension_unset() - */ -static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC) -{ - sxe_prop_dim_delete(object, offset, 0, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ _get_base_node_value() - */ -static void -_get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value, char *prefix TSRMLS_DC) -{ - php_sxe_object *subnode; - xmlChar *contents; - - MAKE_STD_ZVAL(*value); - - if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) { - contents = xmlNodeListGetString(node->doc, node->children, 1); - if (contents) { - ZVAL_STRING(*value, contents, 1); - xmlFree(contents); - } - } else { - subnode = php_sxe_object_new(sxe_ref->zo.ce TSRMLS_CC); - subnode->document = sxe_ref->document; - subnode->document->refcount++; - if (prefix) { - subnode->iter.nsprefix = xmlStrdup(prefix); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC); - - (*value)->type = IS_OBJECT; - (*value)->value.obj = php_sxe_register_object(subnode TSRMLS_CC); - /*zval_add_ref(value);*/ - } -} -/* }}} */ - -/* {{{ sxe_properties_get() - */ -static HashTable * -sxe_properties_get(zval *object TSRMLS_DC) -{ - zval **data_ptr; - zval *value; - zval *newptr; - HashTable *rv; - php_sxe_object *sxe; - char *name; - xmlNodePtr node; - ulong h; - int namelen; - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - - if (sxe->properties) { - zend_hash_clean(sxe->properties); - rv = sxe->properties; - } else { - ALLOC_HASHTABLE(rv); - zend_u_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); - sxe->properties = rv; - } - - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - if (node) { - if (node->type == XML_ATTRIBUTE_NODE) { - MAKE_STD_ZVAL(value); - ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), value, xmlNodeListGetString(node->doc, node->children, 1), 1); - zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL); - node = NULL; - } else { - node = node->children; - } - - while (node) { - if (node->children != NULL || node->prev != NULL || node->next != NULL) { - SKIP_TEXT(node); - } else { - if (node->type == XML_TEXT_NODE) { - MAKE_STD_ZVAL(value); - ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), value, xmlNodeListGetString(node->doc, node, 1), 1); - zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL); - goto next_iter; - } - } - - if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix))) { - goto next_iter; - } - - name = (char *) node->name; - if (!name) { - goto next_iter; - } else { - namelen = xmlStrlen(node->name) + 1; - } - - _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix TSRMLS_CC); - - h = zend_hash_func(name, namelen); - if (zend_hash_quick_find(rv, name, namelen, h, (void **) &data_ptr) == SUCCESS) { - if (Z_TYPE_PP(data_ptr) == IS_ARRAY) { - zend_hash_next_index_insert(Z_ARRVAL_PP(data_ptr), &value, sizeof(zval *), NULL); - } else { - MAKE_STD_ZVAL(newptr); - array_init(newptr); - - zval_add_ref(data_ptr); - zend_hash_next_index_insert(Z_ARRVAL_P(newptr), data_ptr, sizeof(zval *), NULL); - zend_hash_next_index_insert(Z_ARRVAL_P(newptr), &value, sizeof(zval *), NULL); - - zend_hash_quick_update(rv, name, namelen, h, &newptr, sizeof(zval *), NULL); - } - } else { - zend_hash_quick_update(rv, name, namelen, h, &value, sizeof(zval *), NULL); - } - -next_iter: - node = node->next; - } - } - - return rv; -} -/* }}} */ - -/* {{{ sxe_objects_compare() - */ -static int -sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - php_sxe_object *sxe1; - php_sxe_object *sxe2; - - sxe1 = php_sxe_fetch_object(object1 TSRMLS_CC); - sxe2 = php_sxe_fetch_object(object2 TSRMLS_CC); - - if (sxe1->node == NULL) { - if (sxe2->node) { - return 1; - } else if (sxe1->document->ptr == sxe2->document->ptr) { - return 0; - } - } else { - return !(sxe1->node == sxe2->node); - } - return 1; -} -/* }}} */ - -/* {{{ array SimpleXMLElement::xpath(string path) - Runs XPath query on the XML data */ -SXE_METHOD(xpath) -{ - php_sxe_object *sxe; - zval *value; - char *query; - int query_len; - int i; - int nsnbr = 0; - xmlNsPtr *ns = NULL; - xmlXPathObjectPtr retval; - xmlNodeSetPtr result; - xmlNodePtr nodeptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) { - return; - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - if (!sxe->xpath) { - sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr); - } - if (!sxe->node) { - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC); - } - - sxe->xpath->node = sxe->node->node; - - ns = xmlGetNsList((xmlDocPtr) sxe->document->ptr, (xmlNodePtr) sxe->node->node); - if (ns != NULL) { - while (ns[nsnbr] != NULL) { - nsnbr++; - } - } - - sxe->xpath->namespaces = ns; - sxe->xpath->nsNr = nsnbr; - - retval = xmlXPathEval(query, sxe->xpath); - if (ns != NULL) { - xmlFree(ns); - sxe->xpath->namespaces = NULL; - sxe->xpath->nsNr = 0; - } - - if (!retval) { - RETURN_FALSE; - } - - result = retval->nodesetval; - if (!result) { - xmlXPathFreeObject(retval); - RETURN_FALSE; - } - - array_init(return_value); - - for (i = 0; i < result->nodeNr; ++i) { - nodeptr = result->nodeTab[i]; - if (nodeptr->type == XML_TEXT_NODE || nodeptr->type == XML_ELEMENT_NODE || nodeptr->type == XML_ATTRIBUTE_NODE) { - MAKE_STD_ZVAL(value); - /** - * Detect the case where the last selector is text(), simplexml - * always accesses the text() child by default, therefore we assign - * to the parent node. - */ - if (nodeptr->type == XML_TEXT_NODE) { - _node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_NONE, NULL, NULL TSRMLS_CC); - } else { - _node_as_zval(sxe, nodeptr, value, SXE_ITER_NONE, NULL, NULL TSRMLS_CC); - } - - add_next_index_zval(return_value, value); - } - } - - xmlXPathFreeObject(retval); -} - -SXE_METHOD(registerXPathNamespace) -{ - php_sxe_object *sxe; - int prefix_len, ns_uri_len; - char *prefix, *ns_uri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - if (!sxe->xpath) { - sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr); - } - - if (xmlXPathRegisterNs(sxe->xpath, prefix, ns_uri) != 0) { - RETURN_FALSE - } - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto string SimpleXMLElement::asXML([string filename]) - Return a well-formed XML string based on SimpleXML element */ -SXE_METHOD(asXML) -{ - php_sxe_object *sxe; - xmlNodePtr node; - xmlOutputBufferPtr outbuf; - xmlChar *strval; - int strval_len; - char *filename; - int filename_len; - - if (ZEND_NUM_ARGS() > 1) { - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - RETURN_FALSE; - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - if (node) { - if (XML_DOCUMENT_NODE == node->parent->type) { - xmlSaveFile(filename, (xmlDocPtr) sxe->document->ptr); - } else { - outbuf = xmlOutputBufferCreateFilename(filename, NULL, 0); - - if (outbuf == NULL) { - RETURN_FALSE; - } - - xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 1, NULL); - xmlOutputBufferClose(outbuf); - RETURN_TRUE; - } - } else { - RETURN_FALSE; - } - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - if (node) { - if (XML_DOCUMENT_NODE == node->parent->type) { - xmlDocDumpMemory((xmlDocPtr) sxe->document->ptr, &strval, &strval_len); - } else { - /* Should we be passing encoding information instead of NULL? */ - outbuf = xmlAllocOutputBuffer(NULL); - - if (outbuf == NULL) { - RETURN_FALSE; - } - - xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 1, ((xmlDocPtr) sxe->document->ptr)->encoding); - xmlOutputBufferFlush(outbuf); - strval = xmlStrndup(outbuf->buffer->content, outbuf->buffer->use); - xmlOutputBufferClose(outbuf); - } - - RETVAL_STRINGL(strval, strlen(strval), 1); - xmlFree(strval); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto object SimpleXMLElement::children() - Finds children of given node */ -SXE_METHOD(children) -{ - php_sxe_object *sxe; - char *nsprefix = NULL; - int nsprefix_len; - xmlNodePtr node; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &nsprefix, &nsprefix_len) == FAILURE) { - return; - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, nsprefix TSRMLS_CC); - -} -/* }}} */ - -/* {{{ proto array SimpleXMLElement::attributes([string ns]) - Identifies an element's attributes */ -SXE_METHOD(attributes) -{ - php_sxe_object *sxe; - char *nsprefix = NULL; - int nsprefix_len; - xmlNodePtr node; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &nsprefix, &nsprefix_len) == FAILURE) { - return; - } - - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - - _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, nsprefix TSRMLS_CC); -} -/* }}} */ - -/* {{{ cast_object() - */ -static int -cast_object(zval *object, int type, char *contents TSRMLS_DC) -{ - if (contents) { - ZVAL_STRINGL(object, contents, strlen(contents), 1); - } else { - ZVAL_NULL(object); - } - object->refcount = 1; - object->is_ref = 0; - - switch (type) { - case IS_STRING: - convert_to_string(object); - break; - case IS_BINARY: - convert_to_binary(object); - break; - case IS_UNICODE: - convert_to_unicode(object); - break; - case IS_BOOL: - convert_to_boolean(object); - break; - case IS_LONG: - convert_to_long(object); - break; - case IS_DOUBLE: - convert_to_double(object); - break; - default: - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ sxe_object_cast() - */ -static int -sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - php_sxe_object *sxe; - char *contents = NULL; - xmlNodePtr node; - int rv; - - sxe = php_sxe_fetch_object(readobj TSRMLS_CC); - - if (sxe->iter.type != SXE_ITER_NONE) { - node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC); - if (node) { - contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1); - } - } else { - if (!sxe->node) { - if (sxe->document) { - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC); - } - } - - if (sxe->node && sxe->node->node) { - if (sxe->node->node->children) { - contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, sxe->node->node->children, 1); - } - } - } - - rv = cast_object(writeobj, type, contents TSRMLS_CC); - - if (contents) { - xmlFree(contents); - } - return rv; -} -/* }}} */ - -static zval *sxe_get_value(zval *z TSRMLS_DC) -{ - zval *retval; - - MAKE_STD_ZVAL(retval); - - if (sxe_object_cast(z, retval, IS_STRING TSRMLS_CC)==FAILURE) { - zend_error(E_ERROR, "Unable to cast node to string"); - /* FIXME: Should not be fatal */ - } - - retval->refcount = 0; - return retval; -} - - -static zend_object_handlers sxe_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - sxe_property_read, - sxe_property_write, - sxe_dimension_read, - sxe_dimension_write, - NULL, - sxe_get_value, /* get */ - NULL, - sxe_property_exists, - sxe_property_delete, - sxe_dimension_exists, - sxe_dimension_delete, - sxe_properties_get, - NULL, /* zend_get_std_object_handlers()->get_method,*/ - NULL, /* zend_get_std_object_handlers()->call_method,*/ - NULL, /* zend_get_std_object_handlers()->get_constructor, */ - NULL, /* zend_get_std_object_handlers()->get_class_entry,*/ - NULL, /* zend_get_std_object_handlers()->get_class_name,*/ - sxe_objects_compare, - sxe_object_cast, - NULL -}; - -static zend_object_handlers sxe_ze1_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - sxe_property_read, - sxe_property_write, - sxe_dimension_read, - sxe_dimension_write, - NULL, - sxe_get_value, /* get */ - NULL, - sxe_property_exists, - sxe_property_delete, - sxe_dimension_exists, - sxe_dimension_delete, - sxe_properties_get, - NULL, /* zend_get_std_object_handlers()->get_method,*/ - NULL, /* zend_get_std_object_handlers()->call_method,*/ - NULL, /* zend_get_std_object_handlers()->get_constructor, */ - NULL, /* zend_get_std_object_handlers()->get_class_entry,*/ - NULL, /* zend_get_std_object_handlers()->get_class_name,*/ - sxe_objects_compare, - sxe_object_cast, - NULL -}; - -static zend_object_value sxe_object_ze1_clone(zval *zobject TSRMLS_DC) -{ - php_error(E_ERROR, "Cannot clone object of class %v due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name); - /* Return zobject->value.obj just to satisfy compiler */ - /* FIXME: Should not be a fatal */ - return zobject->value.obj; -} - -/* {{{ sxe_object_clone() - */ -static void -sxe_object_clone(void *object, void **clone_ptr TSRMLS_DC) -{ - php_sxe_object *sxe = (php_sxe_object *) object; - php_sxe_object *clone; - xmlNodePtr nodep = NULL; - xmlDocPtr docp = NULL; - - clone = php_sxe_object_new(sxe->zo.ce TSRMLS_CC); - clone->document = sxe->document; - if (clone->document) { - clone->document->refcount++; - docp = clone->document->ptr; - } - if (sxe->node) { - nodep = xmlDocCopyNode(sxe->node->node, docp, 1); - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, NULL TSRMLS_CC); - - *clone_ptr = (void *) clone; -} -/* }}} */ - -/* {{{ sxe_object_dtor() - */ -static void sxe_object_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - /* dtor required to cleanup iterator related data properly */ - - php_sxe_object *sxe; - - sxe = (php_sxe_object *) object; - - if (sxe->iter.data) { - zval_ptr_dtor(&sxe->iter.data); - sxe->iter.data = NULL; - } - - if (sxe->iter.name) { - xmlFree(sxe->iter.name); - sxe->iter.name = NULL; - } - if (sxe->iter.nsprefix) { - xmlFree(sxe->iter.nsprefix); - sxe->iter.nsprefix = NULL; - } -} -/* }}} */ - -/* {{{ sxe_object_free_storage() - */ -static void sxe_object_free_storage(void *object TSRMLS_DC) -{ - php_sxe_object *sxe; - - sxe = (php_sxe_object *) object; - - zend_hash_destroy(sxe->zo.properties); - FREE_HASHTABLE(sxe->zo.properties); - - php_libxml_node_decrement_resource((php_libxml_node_object *)sxe TSRMLS_CC); - - if (sxe->xpath) { - xmlXPathFreeContext(sxe->xpath); - } - - if (sxe->properties) { - zend_hash_destroy(sxe->properties); - FREE_HASHTABLE(sxe->properties); - } - - efree(object); -} -/* }}} */ - -/* {{{ php_sxe_object_new() - */ -static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC) -{ - php_sxe_object *intern; - - intern = ecalloc(1, sizeof(php_sxe_object)); - intern->zo.ce = ce; - - intern->iter.type = SXE_ITER_NONE; - intern->iter.nsprefix = NULL; - intern->iter.name = NULL; - - ALLOC_HASHTABLE(intern->zo.properties); - zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - return intern; -} -/* }}} */ - -/* {{{ php_sxe_register_object - */ -static zend_object_value -php_sxe_register_object(php_sxe_object *intern TSRMLS_DC) -{ - zend_object_value rv; - - rv.handle = zend_objects_store_put(intern, sxe_object_dtor, (zend_objects_free_object_storage_t)sxe_object_free_storage, sxe_object_clone TSRMLS_CC); - if (EG(ze1_compatibility_mode)) { - rv.handlers = (zend_object_handlers *) &sxe_ze1_object_handlers; - } else { - rv.handlers = (zend_object_handlers *) &sxe_object_handlers; - } - - return rv; -} -/* }}} */ - -/* {{{ sxe_object_new() - */ -ZEND_API zend_object_value -sxe_object_new(zend_class_entry *ce TSRMLS_DC) -{ - php_sxe_object *intern; - - intern = php_sxe_object_new(ce TSRMLS_CC); - return php_sxe_register_object(intern TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto simplemxml_element simplexml_load_file(string filename [, string class_name [, int options]]) - Load a filename and return a simplexml_element object to allow for processing */ -PHP_FUNCTION(simplexml_load_file) -{ - php_sxe_object *sxe; - char *filename; - int filename_len; - xmlDocPtr docp; - char *classname = ""; - int classname_len = 0, options=0; - zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &filename, &filename_len, &classname, &classname_len, &options) == FAILURE) { - return; - } - -#if LIBXML_VERSION >= 20600 - docp = xmlReadFile(filename, NULL, options); -#else - docp = xmlParseFile(filename); -#endif - - if (! docp) { - RETURN_FALSE; - } - - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", classname); - } - ce = *pce; - } - - sxe = php_sxe_object_new(ce TSRMLS_CC); - php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC); - - return_value->type = IS_OBJECT; - return_value->value.obj = php_sxe_register_object(sxe TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto simplemxml_element simplexml_load_string(string data [, string class_name [, int options]]) - Load a string and return a simplexml_element object to allow for processing */ -PHP_FUNCTION(simplexml_load_string) -{ - php_sxe_object *sxe; - char *data; - int data_len; - xmlDocPtr docp; - char *classname = ""; - int classname_len = 0, options=0; - zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &data, &data_len, &classname, &classname_len, &options) == FAILURE) { - return; - } - -#if LIBXML_VERSION >= 20600 - docp = xmlReadMemory(data, data_len, NULL, NULL, options); -#else - docp = xmlParseMemory(data, data_len); -#endif - - if (! docp) { - RETURN_FALSE; - } - - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", classname); - } - ce = *pce; - } - - sxe = php_sxe_object_new(ce TSRMLS_CC); - php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC); - - return_value->type = IS_OBJECT; - return_value->value.obj = php_sxe_register_object(sxe TSRMLS_CC); -} -/* }}} */ - - -/* {{{ proto SimpleXMLElement::__construct() - SimpleXMLElement constructor */ -SXE_METHOD(__construct) -{ - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - char *data; - int data_len; - xmlDocPtr docp; - - php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - docp = xmlParseMemory(data, data_len); - if (!docp) { - ((php_libxml_node_object *)sxe)->document = NULL; - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "String could not be parsed as XML", 0 TSRMLS_CC); - return; - } - - php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC); -} -/* }}} */ - - -static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC); -static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC); -static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC); -static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); -static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC); -static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC); - -zend_object_iterator_funcs php_sxe_iterator_funcs = { - php_sxe_iterator_dtor, - php_sxe_iterator_valid, - php_sxe_iterator_current_data, - php_sxe_iterator_current_key, - php_sxe_iterator_move_forward, - php_sxe_iterator_rewind, -}; - -ZEND_API void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC) -{ - xmlNodePtr node; - char *prefix; - - if (sxe->iter.data) { - zval_ptr_dtor(&sxe->iter.data); - sxe->iter.data = NULL; - } - - GET_NODE(sxe, node) - - if (node) { - switch (sxe->iter.type) { - case SXE_ITER_ELEMENT: - case SXE_ITER_CHILD: - case SXE_ITER_NONE: - node = node->children; - break; - case SXE_ITER_ATTRLIST: - node = (xmlNodePtr) node->properties; - } - } - - prefix = sxe->iter.nsprefix; - - while (node) { - SKIP_TEXT(node); - if (sxe->iter.type != SXE_ITER_ATTRLIST && node->type == XML_ELEMENT_NODE) { - if (sxe->iter.type == SXE_ITER_ELEMENT) { - if (!xmlStrcmp(node->name, sxe->iter.name) && match_ns(sxe, node, prefix)) { - break; - } - } else { - if (match_ns(sxe, node, prefix)) { - break; - } - } - } else { - if (node->type == XML_ATTRIBUTE_NODE) { - if (match_ns(sxe, node, sxe->iter.nsprefix)) { - break; - } - } - } -next_iter: - node = node->next; - } - - if (node) { - ALLOC_INIT_ZVAL(sxe->iter.data); - _node_as_zval(sxe, node, sxe->iter.data, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC); - } -} - -zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - php_sxe_iterator *iterator = emalloc(sizeof(php_sxe_iterator)); - - object->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &php_sxe_iterator_funcs; - iterator->sxe = php_sxe_fetch_object(object TSRMLS_CC); - - return (zend_object_iterator*)iterator; -} - -static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - - /* cleanup handled in sxe_object_dtor as we dont always have an iterator wrapper */ - if (iterator->intern.data) { - zval_ptr_dtor((zval**)&iterator->intern.data); - } - - efree(iterator); -} - -static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) -{ - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - - return iterator->sxe->iter.data ? SUCCESS : FAILURE; -} - -static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - - *data = &iterator->sxe->iter.data; -} - -static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zval *curobj; - xmlNodePtr curnode = NULL; - php_sxe_object *intern; - int namelen; - - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - curobj = iterator->sxe->iter.data; - - intern = (php_sxe_object *)zend_object_store_get_object(curobj TSRMLS_CC); - if (intern != NULL && intern->node != NULL) { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; - } - - if (UG(unicode)) { - UErrorCode status = U_ZERO_ERROR; - int32_t u_len; - - namelen = xmlStrlen(curnode->name); - zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), (UChar**)str_key, &u_len, (char*)curnode->name, namelen, &status); - *str_key_len = u_len + 1; - return HASH_KEY_IS_UNICODE; - } else { - namelen = xmlStrlen(curnode->name); - *str_key = estrndup(curnode->name, namelen); - *str_key_len = namelen + 1; - return HASH_KEY_IS_STRING; - } -} - -ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) -{ - xmlNodePtr node = NULL; - php_sxe_object *intern; - char *prefix; - - if (sxe->iter.data) { - intern = (php_sxe_object *)zend_object_store_get_object(sxe->iter.data TSRMLS_CC); - GET_NODE(intern, node) - zval_ptr_dtor(&sxe->iter.data); - sxe->iter.data = NULL; - } - - if (node) { - node = node->next; - } - - prefix = sxe->iter.nsprefix; - - while (node) { - SKIP_TEXT(node); - - if (sxe->iter.type != SXE_ITER_ATTRLIST && node->type == XML_ELEMENT_NODE) { - if (sxe->iter.type == SXE_ITER_ELEMENT) { - if (!xmlStrcmp(node->name, sxe->iter.name) && match_ns(sxe, node, prefix)) { - break; - } - } else { - if (match_ns(sxe, node, prefix)) { - break; - } - } - } else { - if (node->type == XML_ATTRIBUTE_NODE) { - if (match_ns(sxe, node, sxe->iter.nsprefix)) { - break; - } - } - } -next_iter: - node = node->next; - } - - if (node) { - ALLOC_INIT_ZVAL(sxe->iter.data); - _node_as_zval(sxe, node, sxe->iter.data, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC); - } -} - -static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - php_sxe_move_forward_iterator(iterator->sxe TSRMLS_CC); -} - -static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC) -{ - php_sxe_object *sxe; - - php_sxe_iterator *iterator = (php_sxe_iterator *)iter; - sxe = iterator->sxe; - - php_sxe_reset_iterator(sxe TSRMLS_CC); -} - - -void *simplexml_export_node(zval *object TSRMLS_DC) -{ - php_sxe_object *sxe; - xmlNodePtr node; - - sxe = php_sxe_fetch_object(object TSRMLS_CC); - GET_NODE(sxe, node); - return php_sxe_get_first_node(sxe, node TSRMLS_CC); -} - -#ifdef HAVE_DOM -/* {{{ proto simplemxml_element simplexml_import_dom(domNode node [, string class_name]) - Get a simplexml_element object from dom to allow for processing */ -PHP_FUNCTION(simplexml_import_dom) -{ - php_sxe_object *sxe; - zval *node; - php_libxml_node_object *object; - xmlNodePtr nodep = NULL; - char *classname = ""; - int classname_len = 0; - zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|s", &node, &classname, &classname_len) == FAILURE) { - return; - } - - object = (php_libxml_node_object *)zend_object_store_get_object(node TSRMLS_CC); - - nodep = php_libxml_import_node(node TSRMLS_CC); - - if (nodep) { - if (nodep->doc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Imported Node must have associated Document"); - RETURN_NULL(); - } - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDocPtr) nodep); - } - } - - if (nodep && nodep->type == XML_ELEMENT_NODE) { - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", classname); - } - ce = *pce; - } - - sxe = php_sxe_object_new(ce TSRMLS_CC); - sxe->document = object->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep->doc TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, nodep, NULL TSRMLS_CC); - - return_value->type = IS_OBJECT; - return_value->value.obj = php_sxe_register_object(sxe TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import"); - RETVAL_NULL(); - } -} -/* }}} */ -#endif - -function_entry simplexml_functions[] = { - PHP_FE(simplexml_load_file, NULL) - PHP_FE(simplexml_load_string, NULL) -#ifdef HAVE_DOM - PHP_FE(simplexml_import_dom, NULL) -#endif - {NULL, NULL, NULL} -}; - -static zend_module_dep simplexml_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; - -zend_module_entry simplexml_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - simplexml_deps, - "SimpleXML", - simplexml_functions, - PHP_MINIT(simplexml), - PHP_MSHUTDOWN(simplexml), - NULL, - NULL, - PHP_MINFO(simplexml), - "0.1", - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_SIMPLEXML -ZEND_GET_MODULE(simplexml) -#endif - -/* the method table */ -/* each method can have its own parameters and visibility */ -static zend_function_entry sxe_functions[] = { - SXE_ME(__construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) /* must be called */ - SXE_ME(asXML, NULL, ZEND_ACC_PUBLIC) - SXE_ME(xpath, NULL, ZEND_ACC_PUBLIC) - SXE_ME(registerXPathNamespace, NULL, ZEND_ACC_PUBLIC) - SXE_ME(attributes, NULL, ZEND_ACC_PUBLIC) - SXE_ME(children, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION(simplexml) - */ -PHP_MINIT_FUNCTION(simplexml) -{ - zend_class_entry sxe; - - INIT_CLASS_ENTRY(sxe, "SimpleXMLElement", sxe_functions); - sxe.create_object = sxe_object_new; - sxe_class_entry = zend_register_internal_class(&sxe TSRMLS_CC); - sxe_class_entry->get_iterator = php_sxe_get_iterator; - sxe_class_entry->iterator_funcs.funcs = &php_sxe_iterator_funcs; - zend_class_implements(sxe_class_entry TSRMLS_CC, 1, zend_ce_traversable); - sxe_object_handlers.get_method = zend_get_std_object_handlers()->get_method; - sxe_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor; - sxe_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry; - sxe_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name; - - sxe_ze1_object_handlers.get_method = zend_get_std_object_handlers()->get_method; - sxe_ze1_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor; - sxe_ze1_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry; - sxe_ze1_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name; - sxe_ze1_object_handlers.clone_obj = sxe_object_ze1_clone; - -#ifdef HAVE_SPL - if (zend_get_module_started("spl") == SUCCESS) { - PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU); - } -#endif /* HAVE_SPL */ - - php_libxml_register_export(sxe_class_entry, simplexml_export_node); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION(simplexml) - */ -PHP_MSHUTDOWN_FUNCTION(simplexml) -{ - sxe_class_entry = NULL; - return SUCCESS; -} -/* }}} */ -/* {{{ PHP_MINFO_FUNCTION(simplexml) - */ -PHP_MINFO_FUNCTION(simplexml) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_row(2, "Schema support", -#ifdef LIBXML_SCHEMAS_ENABLED - "enabled"); -#else - "not available"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -#endif - -/** - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: t - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/simplexml/simplexml.dsp b/ext/simplexml/simplexml.dsp deleted file mode 100644 index 79df9187036a8..0000000000000 --- a/ext/simplexml/simplexml.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="simplexml" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=simplexml - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "simplexml.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "simplexml.mak" CFG="simplexml - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "simplexml - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "simplexml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "simplexml - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php\5d\extensions" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php5" /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php5\Debug_TS" - -!ELSEIF "$(CFG)" == "simplexml - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /I "..\..\..\php5\win32" /I "..\..\..\php5" /D ZTS=1 /D ZEND_DEBUG=0 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\..\php5\Release_TS" /libpath:"..\..\..\php5\Release_TS_Inline" - -!ENDIF - -# Begin Target - -# Name "simplexml - Win32 Debug_TS" -# Name "simplexml - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\simplexml.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_simplexml.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/simplexml/tests/001.phpt b/ext/simplexml/tests/001.phpt deleted file mode 100644 index cacc2d3066379..0000000000000 --- a/ext/simplexml/tests/001.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -SimpleXML: Simple document ---SKIPIF-- - ---FILE-- - ---EXPECT-- -SimpleXMLElement Object -( - [elem1] => SimpleXMLElement Object - ( - [comment] => SimpleXMLElement Object - ( - ) - - [elem2] => SimpleXMLElement Object - ( - [elem3] => SimpleXMLElement Object - ( - [elem4] => SimpleXMLElement Object - ( - [test] => SimpleXMLElement Object - ( - ) - - ) - - ) - - ) - - ) - -) ----Done--- diff --git a/ext/simplexml/tests/002.phpt b/ext/simplexml/tests/002.phpt deleted file mode 100644 index 95d644fe71423..0000000000000 --- a/ext/simplexml/tests/002.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -SimpleXML and clone ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml); - -$copy = clone $sxe; - -print_r($copy); - -echo "---Done---\n"; - -?> ---EXPECT-- -SimpleXMLElement Object -( - [elem1] => SimpleXMLElement Object - ( - [comment] => SimpleXMLElement Object - ( - ) - - [elem2] => SimpleXMLElement Object - ( - [elem3] => SimpleXMLElement Object - ( - [elem4] => SimpleXMLElement Object - ( - [test] => SimpleXMLElement Object - ( - ) - - ) - - ) - - ) - - ) - -) ----Done--- diff --git a/ext/simplexml/tests/003.phpt b/ext/simplexml/tests/003.phpt deleted file mode 100755 index 96aad372dac0d..0000000000000 --- a/ext/simplexml/tests/003.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -SimpleXML and Entities ---SKIPIF-- - ---FILE-- - - -]> - - Plain text. - - - - - &included-entity; - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml); - -print_r($sxe); - -echo "---Done---\n"; - -?> ---EXPECT-- -SimpleXMLElement Object -( - [elem1] => SimpleXMLElement Object - ( - [comment] => SimpleXMLElement Object - ( - ) - - [elem2] => SimpleXMLElement Object - ( - [elem3] => SimpleXMLElement Object - ( - [included-entity] => SimpleXMLElement Object - ( - [included-entity] => This is text included from an entity - ) - - [elem4] => SimpleXMLElement Object - ( - [test] => SimpleXMLElement Object - ( - ) - - ) - - ) - - ) - - ) - -) ----Done--- diff --git a/ext/simplexml/tests/004.phpt b/ext/simplexml/tests/004.phpt deleted file mode 100755 index 82a0d68980c9d..0000000000000 --- a/ext/simplexml/tests/004.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -SimpleXML and CDATA ---SKIPIF-- - ---FILE-- - - - - Plain text. - - - - - - - - - - - - -EOF -); - -print_r($sxe); - -$elem1 = $sxe->elem1; -$elem2 = $elem1->elem2; -var_dump(trim((string)$elem2)); - -?> -===DONE=== ---EXPECT-- -SimpleXMLElement Object -( - [elem1] => SimpleXMLElement Object - ( - [comment] => SimpleXMLElement Object - ( - ) - - [elem2] => SimpleXMLElement Object - ( - [elem3] => SimpleXMLElement Object - ( - [elem4] => SimpleXMLElement Object - ( - [test] => SimpleXMLElement Object - ( - ) - - ) - - ) - - ) - - ) - -) -string(11) "CDATA block" -===DONE=== ---UEXPECT-- -SimpleXMLElement Object -( - [elem1] => SimpleXMLElement Object - ( - [comment] => SimpleXMLElement Object - ( - ) - - [elem2] => SimpleXMLElement Object - ( - [elem3] => SimpleXMLElement Object - ( - [elem4] => SimpleXMLElement Object - ( - [test] => SimpleXMLElement Object - ( - ) - - ) - - ) - - ) - - ) - -) -unicode(11) "CDATA block" -===DONE=== diff --git a/ext/simplexml/tests/005.phpt b/ext/simplexml/tests/005.phpt deleted file mode 100755 index a2c3756f3e9c1..0000000000000 --- a/ext/simplexml/tests/005.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -SimpleXML and text data ---SKIPIF-- - ---FILE-- - - - - Plain text. - - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - -EOF -); - -var_dump(trim($sxe->elem1->elem2)); -var_dump(trim($sxe->elem1->elem2->elem3)); -var_dump(trim($sxe->elem1->elem2->elem3->elem4)); - -echo "---Done---\n"; - -?> ---EXPECT-- -string(28) "Here we have some text data." -string(19) "And here some more." -string(15) "Wow once again." ----Done--- ---UEXPECT-- -unicode(28) "Here we have some text data." -unicode(19) "And here some more." -unicode(15) "Wow once again." ----Done--- diff --git a/ext/simplexml/tests/006.phpt b/ext/simplexml/tests/006.phpt deleted file mode 100755 index 5b44c18a31131..0000000000000 --- a/ext/simplexml/tests/006.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -SimpleXML and foreach ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - Foo Bar - - - -EOF -); - -foreach($sxe as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===CLONE===\n"; - -foreach(clone $sxe as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===ELEMENT===\n"; - -foreach($sxe->elem11 as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===COMMENT===\n"; - -foreach($sxe->elem1 as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -?> -===DONE=== ---EXPECT-- -string(5) "elem1" -string(10) "Bla bla 1." -string(6) "elem11" -string(10) "Bla bla 2." -===CLONE=== -string(5) "elem1" -string(10) "Bla bla 1." -string(6) "elem11" -string(10) "Bla bla 2." -===ELEMENT=== -string(6) "elem11" -string(10) "Bla bla 2." -===COMMENT=== -string(5) "elem1" -string(10) "Bla bla 1." -===DONE=== ---UEXPECT-- -unicode(5) "elem1" -unicode(10) "Bla bla 1." -unicode(6) "elem11" -unicode(10) "Bla bla 2." -===CLONE=== -unicode(5) "elem1" -unicode(10) "Bla bla 1." -unicode(6) "elem11" -unicode(10) "Bla bla 2." -===ELEMENT=== -unicode(6) "elem11" -unicode(10) "Bla bla 2." -===COMMENT=== -unicode(5) "elem1" -unicode(10) "Bla bla 1." -===DONE=== diff --git a/ext/simplexml/tests/007.phpt b/ext/simplexml/tests/007.phpt deleted file mode 100755 index 754ecf6f55879..0000000000000 --- a/ext/simplexml/tests/007.phpt +++ /dev/null @@ -1,136 +0,0 @@ ---TEST-- -SimpleXML and attributes ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml); - -echo "===Property===\n"; -var_dump($sxe->elem1); -echo "===Array===\n"; -var_dump($sxe['id']); -var_dump($sxe->elem1['attr1']); -echo "===Set===\n"; -$sxe['id'] = "Changed1"; -var_dump($sxe['id']); -$sxe->elem1['attr1'] = 12; -var_dump($sxe->elem1['attr1']); -echo "===Unset===\n"; -unset($sxe['id']); -var_dump($sxe['id']); -unset($sxe->elem1['attr1']); -var_dump($sxe->elem1['attr1']); -echo "===Misc.===\n"; -$a = 4; -var_dump($a); -$dummy = $sxe->elem1[$a]; -var_dump($a); -?> -===Done=== ---EXPECTF-- -===Property=== -object(SimpleXMLElement)#%d (2) { - ["comment"]=> - object(SimpleXMLElement)#%d (0) { - } - ["elem2"]=> - object(SimpleXMLElement)#%d (1) { - ["elem3"]=> - object(SimpleXMLElement)#%d (1) { - ["elem4"]=> - object(SimpleXMLElement)#%d (1) { - ["test"]=> - object(SimpleXMLElement)#%d (0) { - } - } - } - } -} -===Array=== -object(SimpleXMLElement)#%d (1) { - [0]=> - string(5) "elem1" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(5) "first" -} -===Set=== -object(SimpleXMLElement)#%d (1) { - [0]=> - string(8) "Changed1" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "12" -} -===Unset=== -NULL -NULL -===Misc.=== -int(4) -int(4) -===Done=== ---UEXPECTF-- -===Property=== -object(SimpleXMLElement)#%d (2) { - [u"comment"]=> - object(SimpleXMLElement)#%d (0) { - } - [u"elem2"]=> - object(SimpleXMLElement)#%d (1) { - [u"elem3"]=> - object(SimpleXMLElement)#%d (1) { - [u"elem4"]=> - object(SimpleXMLElement)#%d (1) { - [u"test"]=> - object(SimpleXMLElement)#%d (0) { - } - } - } - } -} -===Array=== -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(5) "elem1" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(5) "first" -} -===Set=== -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(8) "Changed1" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "12" -} -===Unset=== -NULL -NULL -===Misc.=== -int(4) -int(4) -===Done=== diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt deleted file mode 100644 index 76b6ec8fe8d8c..0000000000000 --- a/ext/simplexml/tests/008.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -SimpleXML and XPath ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml); - -var_dump($sxe->xpath("elem1/elem2/elem3/elem4")); -var_dump($sxe->xpath("***")); -?> ---EXPECTF-- -array(1) { - [0]=> - object(SimpleXMLElement)#%d (1) { - ["test"]=> - object(SimpleXMLElement)#%d (0) { - } - } -} -bool(false) ---UEXPECTF-- -array(1) { - [0]=> - object(SimpleXMLElement)#%d (1) { - [u"test"]=> - object(SimpleXMLElement)#%d (0) { - } - } -} -bool(false) diff --git a/ext/simplexml/tests/009.phpt b/ext/simplexml/tests/009.phpt deleted file mode 100755 index 83f4629ce4883..0000000000000 --- a/ext/simplexml/tests/009.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -SimpleXML and foreach ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - -EOF -); -foreach($sxe->children() as $name=>$val) { - var_dump($name); - var_dump(get_class($val)); - var_dump(trim($val)); -} -?> -===DONE=== ---EXPECT-- -string(5) "elem1" -string(16) "SimpleXMLElement" -string(10) "Bla bla 1." -string(6) "elem11" -string(16) "SimpleXMLElement" -string(10) "Bla bla 2." -===DONE=== ---UEXPECT-- -unicode(5) "elem1" -unicode(16) "SimpleXMLElement" -unicode(10) "Bla bla 1." -unicode(6) "elem11" -unicode(16) "SimpleXMLElement" -unicode(10) "Bla bla 2." -===DONE=== diff --git a/ext/simplexml/tests/010.phpt b/ext/simplexml/tests/010.phpt deleted file mode 100644 index ea6c7fd079194..0000000000000 --- a/ext/simplexml/tests/010.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -SimpleXML: Simple Inheritance ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml, 'simplexml_inherited'); - -print_r($sxe); - -?> -===DONE=== ---EXPECT-- -simplexml_inherited Object -( - [elem1] => simplexml_inherited Object - ( - [comment] => simplexml_inherited Object - ( - ) - - [elem2] => simplexml_inherited Object - ( - [elem3] => simplexml_inherited Object - ( - [elem4] => simplexml_inherited Object - ( - [test] => simplexml_inherited Object - ( - ) - - ) - - ) - - ) - - ) - -) -===DONE=== diff --git a/ext/simplexml/tests/011.phpt b/ext/simplexml/tests/011.phpt deleted file mode 100755 index f48c9f1eecaa0..0000000000000 --- a/ext/simplexml/tests/011.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -SimpleXML and echo/print ---SKIPIF-- - ---FILE-- - - - bar - baz1 - baz2 - -EOF; - -$sxe = simplexml_load_string($xml); - -echo "===BAR===\n"; -echo $sxe->bar; -echo "\n"; - -echo "===BAZ===\n"; -echo $sxe->baz; -echo "\n"; - -echo "===BAZ0===\n"; -echo $sxe->baz[0]; -echo "\n"; - -echo "===BAZ1===\n"; -print $sxe->baz[1]; -echo "\n"; -?> -===DONE=== ---EXPECT-- -===BAR=== -bar -===BAZ=== -baz1 -===BAZ0=== -baz1 -===BAZ1=== -baz2 -===DONE=== diff --git a/ext/simplexml/tests/012.phpt b/ext/simplexml/tests/012.phpt deleted file mode 100755 index 79c01107fe876..0000000000000 --- a/ext/simplexml/tests/012.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -SimpleXML and Attribute creation ---SKIPIF-- - ---FILE-- - - -EOF; - -$sxe = simplexml_load_string($xml); - - -$sxe[""] = "warning"; -$sxe["attr"] = "value"; - -echo $sxe->asXML(); - -$sxe["attr"] = "new value"; - -echo $sxe->asXML(); - -$sxe[] = "error"; - -?> -===DONE=== ---EXPECTF-- - -Warning: main(): Cannot write or create unnamed attribute in %s012.php on line %d - - - - - -Fatal error: main(): Cannot create unnamed attribute in %s012.php on line %d diff --git a/ext/simplexml/tests/013.phpt b/ext/simplexml/tests/013.phpt deleted file mode 100755 index fbd80b0c446ef..0000000000000 --- a/ext/simplexml/tests/013.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SimpleXML and Split text content ---SKIPIF-- - ---FILE-- - -barbar -EOF; - -$sxe = simplexml_load_string($xml); - -var_dump((string)$sxe); - -?> -===DONE=== ---EXPECT-- -string(6) "barbar" -===DONE=== diff --git a/ext/simplexml/tests/014.phpt b/ext/simplexml/tests/014.phpt deleted file mode 100644 index ba5097598bcf7..0000000000000 --- a/ext/simplexml/tests/014.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -SimpleXML: adding/removing attributes (direct) ---SKIPIF-- - ---FILE-- - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person['name']); -var_dump($people->person['age']); -$person = $people->person; -$person['name'] = "XXX"; -var_dump($people->person['name']); -$people->person['age'] = 30; -var_dump($people->person['age']); -echo "---Unset:---\n"; -unset($people->person['age']); -echo "---Unset?---\n"; -var_dump($people->person['age']); -var_dump(isset($people->person['age'])); -$people->person['age'] = 30; -echo "---Unsupported---\n"; -var_dump($people->person['age']); -$people->person['age'] += 5; -var_dump($people->person['age']); -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "30" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "35" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "30" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "35" -} -===DONE=== diff --git a/ext/simplexml/tests/014a.phpt b/ext/simplexml/tests/014a.phpt deleted file mode 100755 index 59315f884e088..0000000000000 --- a/ext/simplexml/tests/014a.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -SimpleXML: adding/removing attributes (single) ---SKIPIF-- - ---FILE-- - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person[0]['name']); -var_dump($people->person[0]['age']); -$person = $people->person[0]; -$person['name'] = "XXX"; -var_dump($people->person[0]['name']); -$people->person[0]['age'] = 30; -var_dump($people->person[0]['age']); -echo "---Unset:---\n"; -unset($people->person[0]['age']); -echo "---Unset?---\n"; -var_dump($people->person[0]['age']); -var_dump(isset($people->person[0]['age'])); -echo "---Unsupported---\n"; -var_dump($people->person[0]['age']); -$people->person['age'] += 5; -var_dump($people->person[0]['age']); -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - string(1) "5" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(1) "5" -} -===DONE=== diff --git a/ext/simplexml/tests/014b.phpt b/ext/simplexml/tests/014b.phpt deleted file mode 100755 index 04bcb75224fa6..0000000000000 --- a/ext/simplexml/tests/014b.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -SimpleXML: adding/removing attributes (second) ---SKIPIF-- - ---FILE-- - - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person[0]['name']); -var_dump($people->person[1]['age']); -$person = $people->person[1]; -$person['name'] = "XXX"; -var_dump($people->person[1]['name']); -$people->person[1]['age'] = 30; -var_dump($people->person[1]['age']); -echo "---Unset:---\n"; -unset($people->person[1]['age']); -echo "---Unset?---\n"; -var_dump($people->person[1]['age']); -var_dump(isset($people->person[1]['age'])); -echo "---Unsupported---\n"; -$people->person[1]['age'] += 5; -var_dump($people->person[1]['age']); -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(1) "5" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -NULL -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "XXX" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(2) "30" -} ----Unset:--- ----Unset?--- -NULL -bool(false) ----Unsupported--- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(1) "5" -} -===DONE=== diff --git a/ext/simplexml/tests/015.phpt b/ext/simplexml/tests/015.phpt deleted file mode 100644 index aa827d72d8a13..0000000000000 --- a/ext/simplexml/tests/015.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -SimpleXML: accessing singular subnode as array ---SKIPIF-- - ---FILE-- - - - -EOF; - -$xml2 =<< - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person['name']); -var_dump($people->person[0]['name']); -//$people->person['name'] = "XXX"; -//var_dump($people->person['name']); -//var_dump($people->person[0]['name']); -//$people->person[0]['name'] = "YYY"; -//var_dump($people->person['name']); -//var_dump($people->person[0]['name']); -//unset($people->person[0]['name']); -//var_dump($people->person['name']); -//var_dump($people->person[0]['name']); -//var_dump(isset($people->person['name'])); -//var_dump(isset($people->person[0]['name'])); -$people = simplexml_load_string($xml2); -var_dump($people->person[0]['name']); -var_dump($people->person[1]['name']); -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Boe" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Boe" -} -===DONE=== diff --git a/ext/simplexml/tests/016.phpt b/ext/simplexml/tests/016.phpt deleted file mode 100644 index 87b9a0ef9826f..0000000000000 --- a/ext/simplexml/tests/016.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -SimpleXML: modifying attributes of singular subnode ---SKIPIF-- - ---FILE-- - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person['name']); -$people->person['name'] = $people->person['name'] . 'Foo'; -var_dump($people->person['name']); -$people->person['name'] .= 'Bar'; -var_dump($people->person['name']); - -echo "---[0]---\n"; - -$people = simplexml_load_string($xml); -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Foo'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Bar'; -var_dump($people->person[0]['name']); - -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(6) "JoeFoo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(9) "JoeFooBar" -} ----[0]--- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(6) "JoeFoo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(9) "JoeFooBar" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(6) "JoeFoo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(9) "JoeFooBar" -} ----[0]--- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Joe" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(6) "JoeFoo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(9) "JoeFooBar" -} -===DONE=== diff --git a/ext/simplexml/tests/016a.phpt b/ext/simplexml/tests/016a.phpt deleted file mode 100755 index aa9ad53064cb1..0000000000000 --- a/ext/simplexml/tests/016a.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -SimpleXML: concatenating attributes ---SKIPIF-- - ---FILE-- - - - -EOF; - -$people = simplexml_load_string($xml); -var_dump($people->person['name']); -$people->person['name'] .= 'Bar'; -var_dump($people->person['name']); - -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - string(3) "Foo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(6) "FooBar" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(3) "Foo" -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(6) "FooBar" -} -===DONE=== diff --git a/ext/simplexml/tests/017.phpt b/ext/simplexml/tests/017.phpt deleted file mode 100644 index 776b00c785440..0000000000000 --- a/ext/simplexml/tests/017.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -SimpleXML: iteration through subnodes ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -$xml1 =<< - - - - -EOF; - -function print_xml($xml) { - foreach($xml->children() as $person) { - echo "person: ".$person['name']."\n"; - foreach($person->children() as $child) { - echo " child: ".$child['name']."\n"; - } - } -} - -function print_xml2($xml) { - $persons = 2; - for ($i=0;$i<$persons;$i++) { - echo "person: ".$xml->person[$i]['name']."\n"; - $children = 2; - for ($j=0;$j<$children;$j++) { - echo " child: ".$xml->person[$i]->child[$j]['name']."\n"; - } - } -} - -echo "---11---\n"; -print_xml(simplexml_load_string($xml)); -echo "---12---\n"; -print_xml(simplexml_load_string($xml1)); -echo "---21---\n"; -print_xml2(simplexml_load_string($xml)); -echo "---22---\n"; -print_xml2(simplexml_load_string($xml1)); -?> -===DONE=== ---EXPECTF-- ----11--- -person: Joe - child: Ann - child: Marray -person: Boe - child: Joe - child: Ann ----12--- -person: Joe - child: Ann ----21--- -person: Joe - child: Ann - child: Marray -person: Boe - child: Joe - child: Ann ----22--- -person: Joe - child: Ann - child: -person: - -Notice: Trying to get property of non-object in %s017.php on line %d - child: - -Notice: Trying to get property of non-object in %s017.php on line %d - child: -===DONE=== diff --git a/ext/simplexml/tests/018.phpt b/ext/simplexml/tests/018.phpt deleted file mode 100644 index e5c810944e915..0000000000000 --- a/ext/simplexml/tests/018.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -SimpleXML: iteration through subnodes and attributes ---SKIPIF-- - ---FILE-- - - - Text1 - - Text2 - - Text3 - - - - - - -EOF; -$xml1 =<< - - - - -EOF; - -function traverse_xml($pad,$xml) { - foreach($xml->children() as $name => $node) { - echo $pad."<$name"; - foreach($node->attributes() as $attr => $value) { - echo " $attr=\"$value\""; - } - echo ">\n"; - traverse_xml($pad." ",$node); - echo $pad."\n"; - } -} - -traverse_xml("",simplexml_load_string($xml)); -echo "----------\n"; -traverse_xml("",simplexml_load_string($xml1)); -echo "---Done---\n"; -?> ---EXPECT-- - - - - - - - - - - - - ----------- - - - - ----Done--- \ No newline at end of file diff --git a/ext/simplexml/tests/019.phpt b/ext/simplexml/tests/019.phpt deleted file mode 100755 index 9376b93e8ef9c..0000000000000 --- a/ext/simplexml/tests/019.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -SimpleXML and foreach with children() ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - Foo Bar - - - -EOF -); - -foreach($sxe->children() as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===CLONE===\n"; - -foreach(clone $sxe->children() as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===ELEMENT===\n"; - -foreach($sxe->elem11->children() as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -echo "===COMMENT===\n"; - -foreach($sxe->elem1->children() as $name => $data) { - var_dump($name); - var_dump(trim($data)); -} - -?> -===DONE=== ---EXPECT-- -string(5) "elem1" -string(10) "Bla bla 1." -string(6) "elem11" -string(10) "Bla bla 2." -===CLONE=== -string(5) "elem1" -string(10) "Bla bla 1." -string(6) "elem11" -string(10) "Bla bla 2." -===ELEMENT=== -string(7) "elem111" -string(7) "Foo Bar" -===COMMENT=== -string(5) "elem2" -string(28) "Here we have some text data." -===DONE=== ---UEXPECT-- -unicode(5) "elem1" -unicode(10) "Bla bla 1." -unicode(6) "elem11" -unicode(10) "Bla bla 2." -===CLONE=== -unicode(5) "elem1" -unicode(10) "Bla bla 1." -unicode(6) "elem11" -unicode(10) "Bla bla 2." -===ELEMENT=== -unicode(7) "elem111" -unicode(7) "Foo Bar" -===COMMENT=== -unicode(5) "elem2" -unicode(28) "Here we have some text data." -===DONE=== diff --git a/ext/simplexml/tests/020.phpt b/ext/simplexml/tests/020.phpt deleted file mode 100755 index a2a328736cc9c..0000000000000 --- a/ext/simplexml/tests/020.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SimpleXML attribute compared to string ---SKIPIF-- - ---FILE-- -bar'); -print $doc->name["attr"]; -print "\n"; -if ($doc->name["attr"] == "foo") { - print "Works\n"; -} else { - print "Error\n"; -} -?> -===DONE=== ---EXPECT-- -foo -Works -===DONE=== diff --git a/ext/simplexml/tests/021.phpt b/ext/simplexml/tests/021.phpt deleted file mode 100644 index e58e26d6ee20c..0000000000000 --- a/ext/simplexml/tests/021.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SimpleXML element check ---SKIPIF-- - ---FILE-- -foo'); -if(!isset($doc->exists)) { - $ok *= 0; -} -if(isset($doc->doesnotexist)) { - $ok *= 0; -} -if ($ok) { - print "Works\n"; -} else { - print "Error\n"; -} -?> -===DONE=== ---EXPECT-- -Works -===DONE=== diff --git a/ext/simplexml/tests/022.phpt b/ext/simplexml/tests/022.phpt deleted file mode 100755 index 4a646205d5a23..0000000000000 --- a/ext/simplexml/tests/022.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SimpleXML and attributes inside foreach ---SKIPIF-- - ---FILE-- - - -EOF; - -$sxe = simplexml_load_string($xml); - -foreach($sxe->content->file as $file) -{ - var_dump($file); - var_dump($file['glob']); -} - -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (0) { -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(11) "slide_*.xml" -} -===DONE=== ---UEXPECTF-- -object(SimpleXMLElement)#%d (0) { -} -object(SimpleXMLElement)#%d (1) { - [0]=> - unicode(11) "slide_*.xml" -} -===DONE=== diff --git a/ext/simplexml/tests/023.phpt b/ext/simplexml/tests/023.phpt deleted file mode 100755 index dd6dde59d78a5..0000000000000 --- a/ext/simplexml/tests/023.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SimpleXML: Attributes with entities ---SKIPIF-- - ---FILE-- - - - - -]> - -EOF; - -$sxe = simplexml_load_string($xml); - -var_dump($sxe); -var_dump($sxe['attr']); -?> -===DONE=== ---EXPECTF-- -object(SimpleXMLElement)#%d (0) { -} -object(SimpleXMLElement)#%d (1) { - [0]=> - string(%d) "foo%sbar%sbaz" -} -===DONE=== diff --git a/ext/simplexml/tests/book.xml b/ext/simplexml/tests/book.xml deleted file mode 100644 index ea40508e01b28..0000000000000 --- a/ext/simplexml/tests/book.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/simplexml/tests/bug24392.phpt b/ext/simplexml/tests/bug24392.phpt deleted file mode 100644 index 0a462e577019c..0000000000000 --- a/ext/simplexml/tests/bug24392.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #24392 (empty namespaces causing confusion) ---SKIPIF-- - ---FILE-- -item as $item) { - echo $item->title . "\n"; -} -?> ---EXPECT-- -EU Parliament to Vote on New Patent Rules -Most Powerful Amateur Rocket in Canada -GF FX 5900 Ultra vs. ATi Radeon 9800 Pro -PHP 5 Beta 1 -Engaging with the OSS Community -Pure Math, Pure Joy -Windows Tech Writer Looks at Linux -US Cell Phone Users Discover SMS Spam -Verizon Sues Nextel For Espionage -Introduction to Debian diff --git a/ext/simplexml/tests/bug24392.xml b/ext/simplexml/tests/bug24392.xml deleted file mode 100644 index d669f1df41861..0000000000000 --- a/ext/simplexml/tests/bug24392.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - -Slashdot -http://slashdot.org/ -News for nerds, stuff that matters - - - -Slashdot -http://images.slashdot.org/topics/topicslashdot.gif -http://slashdot.org/ - - - -EU Parliament to Vote on New Patent Rules -http://slashdot.org/article.pl?sid=03/06/30/002211 - - - -Most Powerful Amateur Rocket in Canada -http://slashdot.org/article.pl?sid=03/06/29/2121211 - - - -GF FX 5900 Ultra vs. ATi Radeon 9800 Pro -http://slashdot.org/article.pl?sid=03/06/29/202218 - - - -PHP 5 Beta 1 -http://slashdot.org/article.pl?sid=03/06/29/1957253 - - - -Engaging with the OSS Community -http://slashdot.org/article.pl?sid=03/06/29/1913235 - - - -Pure Math, Pure Joy -http://slashdot.org/article.pl?sid=03/06/29/183258 - - - -Windows Tech Writer Looks at Linux -http://slashdot.org/article.pl?sid=03/06/29/1554201 - - - -US Cell Phone Users Discover SMS Spam -http://slashdot.org/article.pl?sid=03/06/29/1542249 - - - -Verizon Sues Nextel For Espionage -http://slashdot.org/article.pl?sid=03/06/29/1443230 - - - -Introduction to Debian -http://slashdot.org/article.pl?sid=03/06/29/1424213 - - - -Search Slashdot -Search Slashdot stories -query -http://slashdot.org/search.pl - - - \ No newline at end of file diff --git a/ext/simplexml/tests/bug25756.xsd b/ext/simplexml/tests/bug25756.xsd deleted file mode 100644 index 427b7a1a141d0..0000000000000 --- a/ext/simplexml/tests/bug25756.xsd +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/simplexml/tests/bug25756_1.xml b/ext/simplexml/tests/bug25756_1.xml deleted file mode 100644 index 33ab30be1020c..0000000000000 --- a/ext/simplexml/tests/bug25756_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - abc - 123 - - - def - 456 - - - diff --git a/ext/simplexml/tests/bug25756_2.xml b/ext/simplexml/tests/bug25756_2.xml deleted file mode 100644 index 53037ef769695..0000000000000 --- a/ext/simplexml/tests/bug25756_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - abc - abc - - - abc - 123 - - - diff --git a/ext/simplexml/tests/bug26976.phpt b/ext/simplexml/tests/bug26976.phpt deleted file mode 100644 index 657c229737d79..0000000000000 --- a/ext/simplexml/tests/bug26976.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #26976 (Can not access array elements using array indices) ---SKIPIF-- - ---FILE-- - - - a - b - c - d - -'); - -echo $root->child[0], "\n"; -echo $root->child[1], "\n"; -echo $root->child[2], "\n"; -echo $root->child[3], "\n"; - -?> ---EXPECT-- -a -b -c -d diff --git a/ext/simplexml/tests/bug27010.phpt b/ext/simplexml/tests/bug27010.phpt deleted file mode 100755 index 9ba9f7b6bd389..0000000000000 --- a/ext/simplexml/tests/bug27010.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -#27010: segfault and node text not displayed when returned from children() ---FILE-- - - Coffee - Tea - Cola - Juice - -EOF; - -$sxe = simplexml_load_string($xml); - -foreach ($sxe as $element_name => $element) { - print "$element_name is $element->name\n"; -} - -foreach ($sxe->children('http://www.example.com/hot') as $element_name => $element) { - print "$element_name is $element->name\n"; -} - -?> -===DONE=== ---EXPECT-- -drink is Cola -drink is Juice -drink is Coffee -drink is Tea -===DONE=== diff --git a/ext/simplexml/tests/profile01.phpt b/ext/simplexml/tests/profile01.phpt deleted file mode 100644 index 91b9544f66bc1..0000000000000 --- a/ext/simplexml/tests/profile01.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing a simple node ---SKIPIF-- - ---FILE-- - - - Hello - -'); - -echo $root->child; -echo "\n---Done---\n"; -?> ---EXPECT-- -Hello ----Done--- diff --git a/ext/simplexml/tests/profile02.phpt b/ext/simplexml/tests/profile02.phpt deleted file mode 100644 index 14b5bb86b28f4..0000000000000 --- a/ext/simplexml/tests/profile02.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing an array of subnodes ---SKIPIF-- - ---FILE-- - - - Hello - World - -'); - -foreach ($root->child as $child) { - echo "$child "; -} -echo "\n---Done---\n"; -?> ---EXPECT-- -Hello World ----Done--- diff --git a/ext/simplexml/tests/profile03.phpt b/ext/simplexml/tests/profile03.phpt deleted file mode 100644 index 14f1c5fe8886c..0000000000000 --- a/ext/simplexml/tests/profile03.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing an attribute ---SKIPIF-- - ---FILE-- - - - - -'); - -echo $root->child['attribute']; -echo "\n---Done---\n"; -?> ---EXPECT-- -Sample ----Done--- diff --git a/ext/simplexml/tests/profile04.phpt b/ext/simplexml/tests/profile04.phpt deleted file mode 100644 index 27714e992710b..0000000000000 --- a/ext/simplexml/tests/profile04.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing a namespaced element ---SKIPIF-- - ---FILE-- - - - Hello - -'); - -echo $root->children('reserved-ns')->child; -echo "\n---Done---\n"; -?> ---EXPECT-- -Hello ----Done--- diff --git a/ext/simplexml/tests/profile05.phpt b/ext/simplexml/tests/profile05.phpt deleted file mode 100644 index f69622118a1ae..0000000000000 --- a/ext/simplexml/tests/profile05.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing an aliased namespaced element ---SKIPIF-- - ---FILE-- - - - Hello - -'); - -echo $root->children('reserved')->child; -echo "\n---Done---\n"; -?> ---EXPECT-- ----Done--- diff --git a/ext/simplexml/tests/profile06.phpt b/ext/simplexml/tests/profile06.phpt deleted file mode 100644 index e519fa9d642c9..0000000000000 --- a/ext/simplexml/tests/profile06.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing a namespaced attribute ---SKIPIF-- - ---FILE-- - - - - -'); - -$attr = $root->child->attributes('reserved-ns'); -echo $attr['attribute']; -echo "\n---Done---\n"; -?> ---EXPECT-- -Sample ----Done--- diff --git a/ext/simplexml/tests/profile07.phpt b/ext/simplexml/tests/profile07.phpt deleted file mode 100644 index c8a426927439a..0000000000000 --- a/ext/simplexml/tests/profile07.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing an aliased namespaced attribute ---SKIPIF-- - ---FILE-- - - - - -'); - -$rsattr = $root->child->attributes('reserved'); -$myattr = $root->child->attributes('reserved-ns'); - -echo $rsattr['attribute']; -echo $myattr['attribute']; -echo "\n---Done---\n"; -?> ---EXPECT-- -Sample ----Done--- diff --git a/ext/simplexml/tests/profile08.phpt b/ext/simplexml/tests/profile08.phpt deleted file mode 100644 index bbb69b75a8c5c..0000000000000 --- a/ext/simplexml/tests/profile08.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing a namespaced attribute without a namespace ---SKIPIF-- - ---FILE-- - - - - -'); - -echo $root->child['attribute']; -echo "\n---Done---\n"; -?> ---EXPECT-- ----Done--- diff --git a/ext/simplexml/tests/profile09.phpt b/ext/simplexml/tests/profile09.phpt deleted file mode 100644 index 714572df1efb9..0000000000000 --- a/ext/simplexml/tests/profile09.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing a namespaced element without a namespace ---SKIPIF-- - ---FILE-- - - - Hello - -'); - -echo $root->child; -echo "\n---Done---\n"; -?> ---EXPECT-- - ----Done--- diff --git a/ext/simplexml/tests/profile10.phpt b/ext/simplexml/tests/profile10.phpt deleted file mode 100644 index 6ef7456c51ea2..0000000000000 --- a/ext/simplexml/tests/profile10.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing two attributes with the same name, but different namespaces ---SKIPIF-- - ---FILE-- - - - - -'); - -$rsattr = $root->child->attributes('reserved-ns'); -$spattr = $root->child->attributes('special-ns'); - -echo $rsattr['attribute']; -echo "\n"; -echo $spattr['attribute']; -echo "\n---Done---\n"; -?> ---EXPECT-- -Sample -Test ----Done--- diff --git a/ext/simplexml/tests/profile11.phpt b/ext/simplexml/tests/profile11.phpt deleted file mode 100644 index e68e6bd510ef9..0000000000000 --- a/ext/simplexml/tests/profile11.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SimpleXML [profile]: Accessing two elements with the same name, but different namespaces ---SKIPIF-- - ---FILE-- - - - Hello - World - -'); - -echo $root->children('reserved-ns')->child; -echo "\n"; -echo $root->children('special-ns')->child; -foreach ($root->child as $child) { - echo "$child\n"; -} -echo "\n---Done---\n"; -?> ---EXPECT-- -Hello -World ----Done--- diff --git a/ext/simplexml/tests/simplexml_import_dom.phpt b/ext/simplexml/tests/simplexml_import_dom.phpt deleted file mode 100755 index c66ba8f087b64..0000000000000 --- a/ext/simplexml/tests/simplexml_import_dom.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Interop: simplexml_import_dom ---SKIPIF-- - - ---FILE-- -load(dirname(__FILE__)."/book.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -$s = simplexml_import_dom($dom); -$books = $s->book; -foreach ($books as $book) { - echo "{$book->title} was written by {$book->author}\n"; -} -?> ---EXPECT-- -The Grapes of Wrath was written by John Steinbeck -The Pearl was written by John Steinbeck diff --git a/ext/simplexml/tests/sxe.dtd b/ext/simplexml/tests/sxe.dtd deleted file mode 100755 index 8a8dde4308a74..0000000000000 --- a/ext/simplexml/tests/sxe.dtd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/ext/simplexml/tests/sxe.ent b/ext/simplexml/tests/sxe.ent deleted file mode 100755 index 8f86465c2ab0e..0000000000000 --- a/ext/simplexml/tests/sxe.ent +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/simplexml/tests/sxe.xml b/ext/simplexml/tests/sxe.xml deleted file mode 100755 index 909b4e652c446..0000000000000 --- a/ext/simplexml/tests/sxe.xml +++ /dev/null @@ -1,17 +0,0 @@ - - -%incent; -]> - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/skeleton/CREDITS b/ext/skeleton/CREDITS deleted file mode 100644 index 58fc71019ae2e..0000000000000 --- a/ext/skeleton/CREDITS +++ /dev/null @@ -1 +0,0 @@ -extname \ No newline at end of file diff --git a/ext/skeleton/EXPERIMENTAL b/ext/skeleton/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ext/skeleton/create_stubs b/ext/skeleton/create_stubs deleted file mode 100755 index 61957289d0875..0000000000000 --- a/ext/skeleton/create_stubs +++ /dev/null @@ -1,289 +0,0 @@ -#!/usr/bin/awk -f - -function gobble(s, x) -{ - sub(/^ /, "", line) - match(line, "^" "(" s ")") - x = substr(line, 1, RLENGTH) - line = substr(line, RLENGTH+1) - return x -} - -function convert(i, j, t) -{ - type = argtypes[i,j] - name = argnames[i,j] - opt = optionals[i,j] - tabs = x = "" - - for (i = 0; i < t; i++) { tabs = tabs "\t" } - - if (type == "int" || type == "long") { - longs = longs "\tlong " name ";\n" - } else if (type == "bool" || type == "boolean") { - bools = bools "\tzend_bool " name ";\n" - } else if (type == "double" || type == "float") { - doubles = doubles "\tdouble " name ";\n" - } else if (type == "string") { - strings = strings "\tchar *" name " = NULL;\n" - ints = ints "\tint " name "_len;\n" - } else if (type == "array" || type == "object" || type == "mixed") { - zvals = zvals "\tzval *" name " = NULL;\n" - } else if (type == "resource" || type == "handle") { - zvals = zvals "\tzval *" name " = NULL;\n" - resources = resources "\tif (" name ") {\n" \ - "\t\tZEND_FETCH_RESOURCE(???, ???, " name ", " name "_id, \"???\", ???_rsrc_id);\n\t}\n" - ints = ints "\tint " name "_id = -1;\n" - } -} - -function comment(s) -{ - if (i_know_what_to_do_shut_up_i_dont_need_your_help_mode) { - return - } else { - return s - } -} - -BEGIN { - name = "[_A-Za-z][_A-Za-z0-9]*" - type = "int|long|double|float|string|bool|boolean|array|object|resource|handle|mixed|void" - spec = "l|l|d|d|s|b|b|a|o|r|r|z|" - num_funcs = 0 - -# create a map from type name to the spec - split(type, type_array, "\|") - split(spec, spec_array, "\|") - for (i in type_array) { - spec_map[type_array[i]] = spec_array[i] - } - - if (xml && xml != "yes") { - xmldoc = xml - } else { - xmldoc = extname "/" extname ".xml" - } - - - xmlhead = "\n" \ - "\n" \ - " \n" \ - " functions\n" \ - " \n\n" \ - " \n" \ - " &warn.experimental;\n" \ - " \n" \ - " \n" \ - " \n\n"; - - xmlfoot = " \n\n" \ - "\n" -} - -{ - args_max = args_min = optional = i = spec_opt = 0 - line = $0 - spec_str = "\"" - -## php extension must use lower case function names. -## this will translate any capitalized letter to lowercase -## and warn the user - if (match(func_name,"[A-Z]") != 0) { - printf("NOTICE: lower casing function name '%s'\n",func_name) - func_name = tolower(func_name) - } - func_type = gobble(type); - func_name = gobble(name); - - if (gobble("\\(")) { - if (gobble("\\[")) optional = 1 - while (arg_type = gobble(type)) { - arg_name = gobble(name) - if(arg_type == "void") { - args_max = 0; - args_min = 0; - break; - } else { - argtypes[num_funcs,args_max] = arg_type - argnames[num_funcs,args_max] = arg_name - - args_max++ - if (optional) { - if (!spec_opt) { - spec_str = spec_str "|" - spec_opt = 1 - } - optionals[num_funcs,i] = optional - } else { - args_min++ - } - spec_str = spec_str spec_map[arg_type] - - if (x = gobble("\\[")) { - optional++ - } - - y = gobble(",") - if (!x && y && optional) { - grouped_optional_param[num_funcs,i] = 1 - } - i++ - } - } - } - -# if (x = gobble("\\)")) { - gobble("\\]* *\\)") - sub(/^[ \t]+/, "", line) - fcomments[num_funcs] = line -# } - - spec_str = spec_str "\"" - - funcs[num_funcs] = func_name - types[num_funcs] = func_type - maxargs[num_funcs] = args_max - minargs[num_funcs] = args_min - specs[num_funcs] = spec_str - spec_opts[num_funcs] = spec_opt - - num_funcs++ -} - -END { - if (xml) print xmlhead > xmldoc - for (i = 0; i < num_funcs; i++) { - compareargc = maxargs[i] - minargs[i] - closefetch = fetchargs = zvals = xmlparams = funcvals = resources = handleargs = closeopts = "" - ints = longs = doubles = strings = bools = zvals = "" - - proto = "/* {{{ proto " types[i] " " funcs[i] "(" - - refid = funcs[i] - gsub(/_/, "-", refid) - xmlstr = " \n" \ - " \n" \ - " " funcs[i] "\n" \ - " " fcomments[i] "\n" \ - " \n" \ - " \n" \ - " Description\n" \ - " \n" \ - " \n" \ - " " types[i] " " funcs[i] "\n" - - if (maxargs[i]>0) { - fetchargs = "\tif (zend_parse_parameters(" - ints = ints "\tint argc = ZEND_NUM_ARGS();\n" - fetchargs = fetchargs "argc TSRMLS_CC, " specs[i] - } else { - fetchargs = fetchargs "\tif (ZEND_NUM_ARGS() != 0) {\n\t\tWRONG_PARAM_COUNT;\n\t}" - xmlparams = xmlparams " \n" - } - - for (j = 0; j < maxargs[i]; j++) { - - fetchargs = fetchargs ", " - - fetchargs = fetchargs "&" argnames[i,j] - if (argtypes[i,j] == "string") { - fetchargs = fetchargs ", &" argnames[i,j] "_len" - } - - xmlparams = xmlparams " " argtypes[i,j] - if (j > minargs[i]-1) { - if (!grouped_optional_param[i,j-1]) { - if (j > 0) proto = proto " " - proto = proto "[" - closeopts = closeopts "]" - } - xmlparams = xmlparams "\n " \ - argnames[i,j] \ - "\n \n" - } else { - xmlparams = xmlparams \ - " " \ - argnames[i,j] \ - "\n" - } - - if (j > 0) proto = proto ", " - proto = proto argtypes[i,j] " " argnames[i,j] - - convert(i, j, 1) - } - - proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i] ")\n{" - if (maxargs[i]>0) { - fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n" - } - funcvals = strings ints longs doubles bools zvals - xmlstr = xmlstr xmlparams \ - " \n" \ - " \n" \ - " &warn.experimental.func;\n" \ - " \n" \ - " &warn.undocumented.func;\n" \ - " \n" \ - " \n" \ - " \n" - - print proto > stubfile - if (funcvals) print funcvals > stubfile - if (fetchargs) print fetchargs > stubfile - if (resources) { - print resources > stubfile - if (!stubs) print "" > extname "/function_warning" - } - if (!i_know_what_to_do_shut_up_i_dont_need_your_help_mode) { - print "\tphp_error(E_WARNING, \"" funcs[i] ": not yet implemented\");" > stubfile - } - print "}\n/* }}} */\n" > stubfile - - if (stubs) { - h_stubs = h_stubs "PHP_FUNCTION(" funcs[i] ");\n" - c_stubs = c_stubs "\tPHP_FE(" funcs[i] ",\tNULL)\n" - } else { - print "PHP_FUNCTION(" funcs[i] ");" > extname "/function_declarations" - print "\tPHP_FE(" funcs[i] ",\tNULL)" > extname "/function_entries" - } - - if (xml) print xmlstr > xmldoc - } - - if (stubs) { - print "\n/* ----------------------------------------------------------- */\n" > stubfile - print c_stubs > stubfile - print "\n/* ----------------------------------------------------------- */\n" > stubfile - print h_stubs > stubfile - } - - if (xml) print xmlfoot > xmldoc -} - -# -# Local variables: -# tab-width: 2 -# c-basic-offset: 2 -# End: - diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h deleted file mode 100644 index 7508f4f97934f..0000000000000 --- a/ext/skeleton/php_skeleton.h +++ /dev/null @@ -1,56 +0,0 @@ -/* __header_here__ */ - -#ifndef PHP_EXTNAME_H -#define PHP_EXTNAME_H - -extern zend_module_entry extname_module_entry; -#define phpext_extname_ptr &extname_module_entry - -#ifdef PHP_WIN32 -#define PHP_EXTNAME_API __declspec(dllexport) -#else -#define PHP_EXTNAME_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(extname); -PHP_MSHUTDOWN_FUNCTION(extname); -PHP_RINIT_FUNCTION(extname); -PHP_RSHUTDOWN_FUNCTION(extname); -PHP_MINFO_FUNCTION(extname); - -PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ -/* __function_declarations_here__ */ - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(extname) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(extname) -*/ - -/* In every utility function you add that needs to use variables - in php_extname_globals, call TSRMLS_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as EXTNAME_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define EXTNAME_G(v) TSRMG(extname_globals_id, zend_extname_globals *, v) -#else -#define EXTNAME_G(v) (extname_globals.v) -#endif - -#endif /* PHP_EXTNAME_H */ - -/* __footer_here__ */ diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c deleted file mode 100644 index 021b76e789155..0000000000000 --- a/ext/skeleton/skeleton.c +++ /dev/null @@ -1,167 +0,0 @@ -/* __header_here__ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_extname.h" - -/* If you declare any globals in php_extname.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(extname) -*/ - -/* True global resources - no need for thread safety here */ -static int le_extname; - -/* {{{ extname_functions[] - * - * Every user visible function must have an entry in extname_functions[]. - */ -function_entry extname_functions[] = { - PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ - /* __function_entries_here__ */ - {NULL, NULL, NULL} /* Must be the last line in extname_functions[] */ -}; -/* }}} */ - -/* {{{ extname_module_entry - */ -zend_module_entry extname_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "extname", - extname_functions, - PHP_MINIT(extname), - PHP_MSHUTDOWN(extname), - PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(extname), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_EXTNAME -ZEND_GET_MODULE(extname) -#endif - -/* {{{ PHP_INI - */ -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("extname.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_extname_globals, extname_globals) - STD_PHP_INI_ENTRY("extname.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_extname_globals, extname_globals) -PHP_INI_END() -*/ -/* }}} */ - -/* {{{ php_extname_init_globals - */ -/* Uncomment this function if you have INI entries -static void php_extname_init_globals(zend_extname_globals *extname_globals) -{ - extname_globals->global_value = 0; - extname_globals->global_string = NULL; -} -*/ -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(extname) -{ - /* If you have INI entries, uncomment these lines - ZEND_INIT_MODULE_GLOBALS(extname, php_extname_init_globals, NULL); - REGISTER_INI_ENTRIES(); - */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(extname) -{ - /* uncomment this line if you have INI entries - UNREGISTER_INI_ENTRIES(); - */ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request start */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(extname) -{ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request end */ -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(extname) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(extname) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "extname support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - - -/* Remove the following function when you have succesfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - -/* Every user-visible function in PHP should document itself in the source */ -/* {{{ proto string confirm_extname_compiled(string arg) - Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_extname_compiled) -{ - char *arg = NULL; - int arg_len, len; - char string[256]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) { - return; - } - - len = sprintf(string, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg); - RETURN_STRINGL(string, len, 1); -} -/* }}} */ -/* The previous line is meant for vim and emacs, so it can correctly fold and - unfold functions in source code. See the corresponding marks just before - function definition, where the functions purpose is also documented. Please - follow this convention for the convenience of others editing your code. -*/ - -/* __function_stubs_here__ */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/skeleton/skeleton.dsp b/ext/skeleton/skeleton.dsp deleted file mode 100644 index c3c67c7e34c00..0000000000000 --- a/ext/skeleton/skeleton.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="extname" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=extname - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "extname.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "extname.mak" CFG="extname - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "extname - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "extname - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "extname - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "extname - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_extname.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "extname - Win32 Release_TS" -# Name "extname - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\extname.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_extname.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/skeleton/skeleton.php b/ext/skeleton/skeleton.php deleted file mode 100644 index 91db9d540881b..0000000000000 --- a/ext/skeleton/skeleton.php +++ /dev/null @@ -1,21 +0,0 @@ -"; - -if(!extension_loaded('extname')) { - dl('extname.' . PHP_SHLIB_SUFFIX); -} -$module = 'extname'; -$functions = get_extension_funcs($module); -echo "Functions available in the test extension:$br\n"; -foreach($functions as $func) { - echo $func."$br\n"; -} -echo "$br\n"; -$function = 'confirm_' . $module . '_compiled'; -if (extension_loaded($module)) { - $str = $function($module); -} else { - $str = "Module $module is not compiled into PHP"; -} -echo "$str\n"; -?> diff --git a/ext/skeleton/tests/001.phpt b/ext/skeleton/tests/001.phpt deleted file mode 100644 index a375577e1b6f1..0000000000000 --- a/ext/skeleton/tests/001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Check for extname presence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -extname extension is available diff --git a/ext/snmp/CREDITS b/ext/snmp/CREDITS deleted file mode 100644 index 2ff38dbe6d69a..0000000000000 --- a/ext/snmp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SNMP -Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4 deleted file mode 100644 index 5561c7dc70638..0000000000000 --- a/ext/snmp/config.m4 +++ /dev/null @@ -1,137 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(snmp,for SNMP support, -[ --with-snmp[=DIR] Include SNMP support]) - -PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP, -[ --with-openssl-dir[=DIR] SNMP: openssl install prefix], no, no) - -if test "$PHP_SNMP" != "no"; then - - dnl - dnl Try net-snmp first - dnl - if test "$PHP_SNMP" = "yes"; then - AC_PATH_PROG(SNMP_CONFIG,net-snmp-config,,[/usr/local/bin:$PATH]) - else - SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config" - fi - - if test -x "$SNMP_CONFIG"; then - SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs` - SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`" - SNMP_PREFIX=`$SNMP_CONFIG --prefix` - - if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then - PHP_ADD_INCLUDE(${SNMP_PREFIX}/include) - PHP_EVAL_LIBLINE($SNMP_LIBS, SNMP_SHARED_LIBADD) - AC_DEFINE(HAVE_NET_SNMP,1,[ ]) - SNMP_LIBNAME=netsnmp - else - AC_MSG_ERROR([Could not find the required paths. Please check your net-snmp installation.]) - fi - else - - dnl - dnl Try ucd-snmp if net-snmp test failed - dnl - - if test "$PHP_SNMP" = "yes"; then - for i in /usr/include /usr/local/include; do - test -f $i/snmp.h && SNMP_INCDIR=$i - test -f $i/ucd-snmp/snmp.h && SNMP_INCDIR=$i/ucd-snmp - test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp - test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp - done - for i in /usr /usr/snmp /usr/local /usr/local/snmp; do - test -f $i/lib/libsnmp.a -o -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i/lib - done - else - SNMP_INCDIR=$PHP_SNMP/include - test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp - SNMP_LIBDIR=$PHP_SNMP/lib - fi - - if test -z "$SNMP_INCDIR"; then - AC_MSG_ERROR(snmp.h not found. Check your SNMP installation.) - elif test -z "$SNMP_LIBDIR"; then - AC_MSG_ERROR(libsnmp not found. Check your SNMP installation.) - fi - - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$SNMP_INCDIR - AC_CHECK_HEADERS(default_store.h) - if test "$ac_cv_header_default_store_h" = "yes"; then - AC_MSG_CHECKING(for OpenSSL support in SNMP libraries) - AC_EGREP_CPP(yes,[ -#include -#if USE_OPENSSL - yes -#endif - ],[ - SNMP_SSL=yes - ],[ - SNMP_SSL=no - ]) - fi - CPPFLAGS=$old_CPPFLAGS - AC_MSG_RESULT($SNMP_SSL) - - if test "$SNMP_SSL" = "yes"; then - if test "$PHP_OPENSSL_DIR" != "no"; then - PHP_OPENSSL=$PHP_OPENSSL_DIR - fi - - if test "$PHP_OPENSSL" = "no"; then - AC_MSG_ERROR([The UCD-SNMP in this system is built with SSL support. - - Add --with-openssl-dir=DIR to your configure line.]) - else - PHP_SETUP_OPENSSL(SNMP_SHARED_LIBADD, [], [ - AC_MSG_ERROR([SNMP: OpenSSL check failed. Please check config.log for more information.]) - ]) - fi - fi - - AC_CHECK_LIB(kstat, kstat_read, [ PHP_ADD_LIBRARY(kstat,,SNMP_SHARED_LIBADD) ]) - PHP_ADD_INCLUDE($SNMP_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD) - SNMP_LIBNAME=snmp - fi - - dnl Check whether snmp_parse_oid() exists. - PHP_CHECK_LIBRARY($SNMP_LIBNAME, snmp_parse_oid, - [ - AC_DEFINE(HAVE_SNMP_PARSE_OID, 1, [ ]) - ], [], [ - $SNMP_SHARED_LIBADD - ]) - - dnl Test build. - PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp, - [ - AC_DEFINE(HAVE_SNMP,1,[ ]) - ], [ - AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more information.]) - ], [ - $SNMP_SHARED_LIBADD - ]) - - PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared) - PHP_SUBST(SNMP_SHARED_LIBADD) -fi - -AC_MSG_CHECKING(whether to enable UCD SNMP hack) -AC_ARG_ENABLE(ucd-snmp-hack, -[ --enable-ucd-snmp-hack SNMP: Enable UCD SNMP hack],[ - if test "$enableval" = "yes" ; then - AC_DEFINE(UCD_SNMP_HACK, 1, [ ]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) diff --git a/ext/snmp/config.w32 b/ext/snmp/config.w32 deleted file mode 100644 index 4bf6750d418ae..0000000000000 --- a/ext/snmp/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("snmp", "SNMP support", "no"); - -if (PHP_SNMP != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("snmp.h", "CFLAGS_SNMP", PHP_PHP_BUILD + "\\include\\ucd-snmp;" + PHP_PHP_BUILD + "\\include\\net-snmp;" + PHP_SNMP) && - CHECK_LIB("libsnmp.lib", "snmp", PHP_SNMP)) { - EXTENSION('snmp', 'snmp.c'); - - AC_DEFINE('HAVE_SNMP', 1); - - } else { - WARNING("snmp not enabled; libraries and headers not found"); - } -} - diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h deleted file mode 100644 index dcaa7d93580ee..0000000000000 --- a/ext/snmp/php_snmp.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Mike Jackson | - | Steven Lawrance | - | Harrie Hazewinkel | - | Johann Hanne | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SNMP_H -#define PHP_SNMP_H - -#if HAVE_SNMP - -#ifndef DLEXPORT -#define DLEXPORT -#endif - -extern zend_module_entry snmp_module_entry; -#define snmp_module_ptr &snmp_module_entry - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(snmp); -PHP_MSHUTDOWN_FUNCTION(snmp); -PHP_MINFO_FUNCTION(snmp); - -PHP_FUNCTION(snmpget); -PHP_FUNCTION(snmpgetnext); -PHP_FUNCTION(snmpwalk); -PHP_FUNCTION(snmprealwalk); -PHP_FUNCTION(snmp_get_quick_print); -PHP_FUNCTION(snmp_set_quick_print); -PHP_FUNCTION(snmp_set_enum_print); -PHP_FUNCTION(snmp_set_oid_numeric_print); -PHP_FUNCTION(snmpset); - -PHP_FUNCTION(snmp2_get); -PHP_FUNCTION(snmp2_getnext); -PHP_FUNCTION(snmp2_walk); -PHP_FUNCTION(snmp2_real_walk); -PHP_FUNCTION(snmp2_set); - -PHP_FUNCTION(snmp3_get); -PHP_FUNCTION(snmp3_getnext); -PHP_FUNCTION(snmp3_walk); -PHP_FUNCTION(snmp3_real_walk); -PHP_FUNCTION(snmp3_set); - -PHP_FUNCTION(snmp_set_valueretrieval); -PHP_FUNCTION(snmp_get_valueretrieval); - -PHP_FUNCTION(snmp_read_mib); - - -ZEND_BEGIN_MODULE_GLOBALS(snmp) - int valueretrieval; -ZEND_END_MODULE_GLOBALS(snmp) - -#ifdef ZTS -#define SNMP_G(v) TSRMG(snmp_globals_id, zend_snmp_globals *, v) -#else -#define SNMP_G(v) (snmp_globals.v) -#endif - -#else - -#define snmp_module_ptr NULL - -#endif /* HAVE_SNMP */ - -#define phpext_snmp_ptr snmp_module_ptr - -#endif /* PHP_SNMP_H */ diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c deleted file mode 100644 index 3106138e99da5..0000000000000 --- a/ext/snmp/snmp.c +++ /dev/null @@ -1,1189 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Mike Jackson | - | Steven Lawrance | - | Harrie Hazewinkel | - | Johann Hanne | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_snmp.h" - -#if HAVE_SNMP - -#include -#ifdef PHP_WIN32 -#include -#include -#include -#include "win32/time.h" -#elif defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#endif -#include -#include -#else -#include -#include -#include -#ifndef _OSD_POSIX -#include -#else -#include /* BS2000/OSD uses , not */ -#endif -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifndef __P -#ifdef __GNUC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifdef HAVE_NET_SNMP -#include -#include -#else -#ifdef HAVE_DEFAULT_STORE_H -#include "default_store.h" -#endif -#include "asn1.h" -#include "snmp_api.h" -#include "snmp_client.h" -#include "snmp_impl.h" -#include "snmp.h" -#include "snmpv3.h" -#include "keytools.h" -#include "parse.h" -#include "mib.h" -#ifndef PHP_WIN32 -/* this doesn't appear to be needed under win32 (perhaps at all) - * and the header file is not present in my UCD-SNMP headers */ -# include "version.h" -#endif -#include "transform_oids.h" -#endif -/* Ugly macro, since the length of OIDs in UCD-SNMP and NET-SNMP - * is different and this way the code is not full of 'ifdef's. - */ -#define OIDSIZE(p) (sizeof(p)/sizeof(oid)) - -/* For really old ucd-snmp versions.. */ -#ifndef HAVE_SNMP_PARSE_OID -#define snmp_parse_oid read_objid -#endif - -#define SNMP_VALUE_LIBRARY 0 -#define SNMP_VALUE_PLAIN 1 -#define SNMP_VALUE_OBJECT 2 - -ZEND_DECLARE_MODULE_GLOBALS(snmp) - -/* constant - can be shared among threads */ -static oid objid_mib[] = {1, 3, 6, 1, 2, 1}; - -/* {{{ snmp_functions[] - */ -function_entry snmp_functions[] = { - PHP_FE(snmpget, NULL) - PHP_FE(snmpgetnext, NULL) - PHP_FE(snmpwalk, NULL) - PHP_FE(snmprealwalk, NULL) - PHP_FALIAS(snmpwalkoid, snmprealwalk, NULL) - PHP_FE(snmp_get_quick_print, NULL) - PHP_FE(snmp_set_quick_print, NULL) -#ifdef HAVE_NET_SNMP - PHP_FE(snmp_set_enum_print, NULL) - PHP_FE(snmp_set_oid_numeric_print, NULL) -#endif - PHP_FE(snmpset, NULL) - - PHP_FE(snmp2_get, NULL) - PHP_FE(snmp2_getnext, NULL) - PHP_FE(snmp2_walk, NULL) - PHP_FE(snmp2_real_walk, NULL) - PHP_FE(snmp2_set, NULL) - - PHP_FE(snmp3_get, NULL) - PHP_FE(snmp3_getnext, NULL) - PHP_FE(snmp3_walk, NULL) - PHP_FE(snmp3_real_walk, NULL) - PHP_FE(snmp3_set, NULL) - PHP_FE(snmp_set_valueretrieval, NULL) - PHP_FE(snmp_get_valueretrieval, NULL) - - PHP_FE(snmp_read_mib, NULL) - {NULL,NULL,NULL} -}; -/* }}} */ - -#define SNMP_CMD_GET 1 -#define SNMP_CMD_GETNEXT 2 -#define SNMP_CMD_WALK 3 -#define SNMP_CMD_REALWALK 4 -#define SNMP_CMD_SET 11 - -/* {{{ snmp_module_entry - */ -zend_module_entry snmp_module_entry = { - STANDARD_MODULE_HEADER, - "snmp", - snmp_functions, - PHP_MINIT(snmp), - PHP_MSHUTDOWN(snmp), - NULL, - NULL, - PHP_MINFO(snmp), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SNMP -ZEND_GET_MODULE(snmp) -#endif - -/* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */ - -/* {{{ php_snmp_init_globals - */ -static void php_snmp_init_globals(zend_snmp_globals *snmp_globals) -{ - snmp_globals->valueretrieval = 0; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(snmp) -{ - init_snmp("snmpapp"); - -#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE - /* Prevent update of the snmpapp.conf file */ - netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1); -#endif - - ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL); - - REGISTER_LONG_CONSTANT("SNMP_VALUE_LIBRARY", SNMP_VALUE_LIBRARY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_VALUE_PLAIN", SNMP_VALUE_PLAIN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_VALUE_OBJECT", SNMP_VALUE_OBJECT, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SNMP_BIT_STR", ASN_BIT_STR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_OCTET_STR", ASN_OCTET_STR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_OPAQUE", ASN_OPAQUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_NULL", ASN_NULL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_OBJECT_ID", ASN_OBJECT_ID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_IPADDRESS", ASN_IPADDRESS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_COUNTER", ASN_GAUGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_UNSIGNED", ASN_UNSIGNED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_TIMETICKS", ASN_TIMETICKS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_UINTEGER", ASN_UINTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_INTEGER", ASN_INTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SNMP_COUNTER64", ASN_COUNTER64, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(snmp) -{ - snmp_shutdown("snmpapp"); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(snmp) -{ - php_info_print_table_start(); -#ifdef HAVE_NET_SNMP - php_info_print_table_row(2, "NET-SNMP Support", "enabled"); - php_info_print_table_row(2, "NET-SNMP Version", netsnmp_get_version()); -#else - php_info_print_table_row(2, "UCD-SNMP Support", "enabled"); - php_info_print_table_row(2, "UCD-SNMP Version", VersionInfo); -#endif - php_info_print_table_end(); -} -/* }}} */ - -static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC) -{ - zval *val; -#if I64CHARSZ > 2047 - char buf[I64CHARSZ + 1]; -#else - char buf[2048]; -#endif - - buf[0] = 0; - - if (SNMP_G(valueretrieval) == 0) { -#ifdef HAVE_NET_SNMP - snprint_value(buf, sizeof(buf), vars->name, vars->name_length, vars); -#else - sprint_value(buf,vars->name, vars->name_length, vars); -#endif - ZVAL_STRING(snmpval, buf, 1); - return; - } - - MAKE_STD_ZVAL(val); - - switch (vars->type) { - case ASN_BIT_STR: /* 0x03, asn1.h */ - ZVAL_STRINGL(val, vars->val.bitstring, vars->val_len, 1); - break; - - case ASN_OCTET_STR: /* 0x04, asn1.h */ - case ASN_OPAQUE: /* 0x44, snmp_impl.h */ - ZVAL_STRINGL(val, vars->val.string, vars->val_len, 1); - break; - - case ASN_NULL: /* 0x05, asn1.h */ - ZVAL_NULL(val); - break; - - case ASN_OBJECT_ID: /* 0x06, asn1.h */ -#ifdef HAVE_NET_SNMP - snprint_objid(buf, sizeof(buf), vars->val.objid, vars->val_len / sizeof(oid)); -#else - sprint_objid(buf, vars->val.objid, vars->val_len / sizeof(oid)); -#endif - - ZVAL_STRING(val, buf, 1); - break; - - case ASN_IPADDRESS: /* 0x40, snmp_impl.h */ - snprintf(buf, sizeof(buf)-1, "%d.%d.%d.%d", - (vars->val.string)[0], (vars->val.string)[1], - (vars->val.string)[2], (vars->val.string)[3]); - buf[sizeof(buf)-1]=0; - ZVAL_STRING(val, buf, 1); - break; - - case ASN_COUNTER: /* 0x41, snmp_impl.h */ - case ASN_GAUGE: /* 0x42, snmp_impl.h */ - /* ASN_UNSIGNED is the same as ASN_GAUGE */ - case ASN_TIMETICKS: /* 0x43, snmp_impl.h */ - case ASN_UINTEGER: /* 0x47, snmp_impl.h */ - snprintf(buf, sizeof(buf)-1, "%lu", *vars->val.integer); - buf[sizeof(buf)-1]=0; - ZVAL_STRING(val, buf, 1); - break; - - case ASN_INTEGER: /* 0x02, asn1.h */ - snprintf(buf, sizeof(buf)-1, "%ld", *vars->val.integer); - buf[sizeof(buf)-1]=0; - ZVAL_STRING(val, buf, 1); - break; - - case ASN_COUNTER64: /* 0x46, snmp_impl.h */ - printU64(buf, vars->val.counter64); - ZVAL_STRING(val, buf, 1); - break; - - default: - ZVAL_STRING(val, "Unknown value type", 1); - break; - } - - if (SNMP_G(valueretrieval) == 1) { - *snmpval = *val; - zval_copy_ctor(snmpval); - } else { - object_init(snmpval); - add_property_long(snmpval, "type", vars->type); - add_property_zval(snmpval, "value", val); - } -} - -/* {{{ php_snmp_internal -* -* Generic SNMP object fetcher (for all SNMP versions) -* -* st=SNMP_CMD_GET get - query an agent with SNMP-GET. -* st=SNMP_CMD_GETNEXT getnext - query an agent with SNMP-GETNEXT. -* st=SNMP_CMD_WALK walk - walk the mib and return a single dimensional array -* containing the values. -* st=SNMP_CMD_REALWALK realwalk() and walkoid() - walk the mib and return an -* array of oid,value pairs. -* st=SNMP_CMD_SET set() - query an agent and set a single value -* -*/ -static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, - struct snmp_session *session, - char *objid, - char type, - char* value) -{ - struct snmp_session *ss; - struct snmp_pdu *pdu=NULL, *response; - struct variable_list *vars; - oid name[MAX_NAME_LEN]; - size_t name_length; - oid root[MAX_NAME_LEN]; - size_t rootlen = 0; - int gotroot = 0; - int status, count; - char buf[2048]; - char buf2[2048]; - int keepwalking=1; - char *err; - zval *snmpval = NULL; - - if (st >= SNMP_CMD_WALK) { /* walk */ - rootlen = MAX_NAME_LEN; - if (strlen(objid)) { /* on a walk, an empty string means top of tree - no error */ - if (snmp_parse_oid(objid, root, &rootlen)) { - gotroot = 1; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object identifier: %s", objid); - } - } - - if (!gotroot) { - memmove((char *) root, (char *) objid_mib, sizeof(objid_mib)); - rootlen = sizeof(objid_mib) / sizeof(oid); - gotroot = 1; - } - } - - if ((ss = snmp_open(session)) == NULL) { - snmp_error(session, NULL, NULL, &err); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open snmp connection: %s", err); - free(err); - RETURN_FALSE; - } - - if (st >= SNMP_CMD_WALK) { - memmove((char *)name, (char *)root, rootlen * sizeof(oid)); - name_length = rootlen; - switch(st) { - case SNMP_CMD_WALK: - case SNMP_CMD_REALWALK: - array_init(return_value); - break; - default: - RETVAL_TRUE; - break; - } - } - - while (keepwalking) { - keepwalking = 0; - if ((st == SNMP_CMD_GET) || (st == SNMP_CMD_GETNEXT)) { - pdu = snmp_pdu_create((st == SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT); - name_length = MAX_OID_LEN; - if (!snmp_parse_oid(objid, name, &name_length)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object identifier: %s", objid); - snmp_close(ss); - RETURN_FALSE; - } - snmp_add_null_var(pdu, name, name_length); - } else if (st == SNMP_CMD_SET) { - pdu = snmp_pdu_create(SNMP_MSG_SET); - if (snmp_add_var(pdu, name, name_length, type, value)) { -#ifdef HAVE_NET_SNMP - snprint_objid(buf, sizeof(buf), name, name_length); -#else - sprint_objid(buf, name, name_length); -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not add variable: %s %c %s", buf, type, value); - snmp_close(ss); - RETURN_FALSE; - } - } else if (st >= SNMP_CMD_WALK) { - if (session->version == SNMP_VERSION_1) { - pdu = snmp_pdu_create(SNMP_MSG_GETNEXT); - } else { - pdu = snmp_pdu_create(SNMP_MSG_GETBULK); - pdu->non_repeaters = 0; - pdu->max_repetitions = 20; - } - snmp_add_null_var(pdu, name, name_length); - } - -retry: - status = snmp_synch_response(ss, pdu, &response); - if (status == STAT_SUCCESS) { - if (response->errstat == SNMP_ERR_NOERROR) { - for (vars = response->variables; vars; vars = vars->next_variable) { - if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET && - (vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { - continue; /* not part of this subtree */ - } - - if (st != SNMP_CMD_SET) { - MAKE_STD_ZVAL(snmpval); - php_snmp_getvalue(vars, snmpval TSRMLS_CC); - } - - if (st == SNMP_CMD_GET) { - *return_value = *snmpval; - zval_copy_ctor(return_value); - zval_ptr_dtor(&snmpval); - snmp_close(ss); - return; - } else if (st == SNMP_CMD_GETNEXT) { - *return_value = *snmpval; - zval_copy_ctor(return_value); - snmp_close(ss); - return; - } else if (st == SNMP_CMD_WALK) { - add_next_index_zval(return_value,snmpval); /* Add to returned array */ - } else if (st == SNMP_CMD_REALWALK) { -#ifdef HAVE_NET_SNMP - snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); -#else - sprint_objid(buf2, vars->name, vars->name_length); -#endif - add_assoc_zval(return_value,buf2,snmpval); - } - if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET) { - if (vars->type != SNMP_ENDOFMIBVIEW && - vars->type != SNMP_NOSUCHOBJECT && vars->type != SNMP_NOSUCHINSTANCE) { - memmove((char *)name, (char *)vars->name,vars->name_length * sizeof(oid)); - name_length = vars->name_length; - keepwalking = 1; - } - } - } - } else { - if (st != SNMP_CMD_WALK || response->errstat != SNMP_ERR_NOSUCHNAME) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in packet: %s", snmp_errstring(response->errstat)); - if (response->errstat == SNMP_ERR_NOSUCHNAME) { - for (count=1, vars = response->variables; vars && count != response->errindex; - vars = vars->next_variable, count++); - if (vars) { -#ifdef HAVE_NET_SNMP - snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); -#else - sprint_objid(buf,vars->name, vars->name_length); -#endif - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This name does not exist: %s",buf); - } - if (st == SNMP_CMD_GET) { - if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GET)) != NULL) { - goto retry; - } - } else if (st == SNMP_CMD_SET) { - if ((pdu = snmp_fix_pdu(response, SNMP_MSG_SET)) != NULL) { - goto retry; - } - } else if (st == SNMP_CMD_GETNEXT) { - if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GETNEXT)) != NULL) { - goto retry; - } - } else if (st >= SNMP_CMD_WALK) { /* Here we do walks. */ - if ((pdu = snmp_fix_pdu(response, ((session->version == SNMP_VERSION_1) - ? SNMP_MSG_GETNEXT - : SNMP_MSG_GETBULK))) != NULL) { - goto retry; - } - } - snmp_close(ss); - RETURN_FALSE; - } - } - } else if (status == STAT_TIMEOUT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No response from %s", session->peername); - if (st == SNMP_CMD_WALK || st == SNMP_CMD_REALWALK) { - zval_dtor(return_value); - } - snmp_close(ss); - RETURN_FALSE; - } else { /* status == STAT_ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred, quitting"); - if (st == SNMP_CMD_WALK || st == SNMP_CMD_REALWALK) { - zval_dtor(return_value); - } - snmp_close(ss); - RETURN_FALSE; - } - if (response) { - snmp_free_pdu(response); - } - } /* keepwalking */ - snmp_close(ss); -} -/* }}} */ - -/* {{{ php_snmp -* -* Generic community based SNMP handler for version 1 and 2. -* This function makes use of the internal SNMP object fetcher. -* The object fetcher is shared with SNMPv3. -* -* st=SNMP_CMD_GET get - query an agent with SNMP-GET. -* st=SNMP_CMD_GETNEXT getnext - query an agent with SNMP-GETNEXT. -* st=SNMP_CMD_WALK walk - walk the mib and return a single dimensional array -* containing the values. -* st=SNMP_CMD_REALWALK realwalk() and walkoid() - walk the mib and return an -* array of oid,value pairs. -* st=5-8 ** Reserved ** -* st=SNMP_CMD_SET set() - query an agent and set a single value -* -*/ -static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) -{ - zval **a1, **a2, **a3, **a4, **a5, **a6, **a7; - struct snmp_session session; - long timeout=SNMP_DEFAULT_TIMEOUT; - long retries=SNMP_DEFAULT_RETRIES; - int myargc = ZEND_NUM_ARGS(); - char type = (char) 0; - char *value = (char *) 0; - char hostname[MAX_NAME_LEN]; - int remote_port = 161; - char *pptr; - - if (myargc < 3 || myargc > 7 || - zend_get_parameters_ex(myargc, &a1, &a2, &a3, &a4, &a5, &a6, &a7) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(a1); - convert_to_string_ex(a2); - convert_to_string_ex(a3); - - if (st == SNMP_CMD_SET) { - if (myargc < 5) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(a4); - convert_to_string_ex(a5); - - if(myargc > 5) { - convert_to_long_ex(a6); - timeout = Z_LVAL_PP(a6); - } - - if(myargc > 6) { - convert_to_long_ex(a7); - retries = Z_LVAL_PP(a7); - } - - type = Z_STRVAL_PP(a4)[0]; - value = Z_STRVAL_PP(a5); - } else { - if(myargc > 3) { - convert_to_long_ex(a4); - timeout = Z_LVAL_PP(a4); - } - - if(myargc > 4) { - convert_to_long_ex(a5); - retries = Z_LVAL_PP(a5); - } - } - - snmp_sess_init(&session); - strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); - if ((pptr = strchr (hostname, ':'))) { - remote_port = strtol (pptr + 1, NULL, 0); - } - - session.peername = hostname; - session.remote_port = remote_port; - session.version = version; - /* - * FIXME: potential memory leak - * This is a workaround for an "artifact" (Mike Slifcak) - * in (at least) ucd-snmp 3.6.1 which frees - * memory it did not allocate - */ -#ifdef UCD_SNMP_HACK - session.community = (u_char *)strdup(Z_STRVAL_PP(a2)); /* memory freed by SNMP library, strdup NOT estrdup */ -#else - session.community = (u_char *)Z_STRVAL_PP(a2); -#endif - session.community_len = Z_STRLEN_PP(a2); - session.retries = retries; - session.timeout = timeout; - - session.authenticator = NULL; - - php_snmp_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, st, &session, Z_STRVAL_PP(a3), type, value); -} -/* }}} */ - -/* {{{ proto string snmpget(string host, string community, string object_id [, int timeout [, int retries]]) - Fetch a SNMP object */ -PHP_FUNCTION(snmpget) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GET, SNMP_VERSION_1); -} -/* }}} */ - -/* {{{ proto string snmpgetnext(string host, string community, string object_id [, int timeout [, int retries]]) - Fetch a SNMP object */ -PHP_FUNCTION(snmpgetnext) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GETNEXT, SNMP_VERSION_1); -} -/* }}} */ - -/* {{{ proto array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]]) - Return all objects under the specified object id */ -PHP_FUNCTION(snmpwalk) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_WALK, SNMP_VERSION_1); -} -/* }}} */ - -/* {{{ proto array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]]) - Return all objects including their respective object id withing the specified one */ -PHP_FUNCTION(snmprealwalk) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_REALWALK, SNMP_VERSION_1); -} -/* }}} */ - -/* {{{ proto bool snmp_get_quick_print(void) - Return the current status of quick_print */ -PHP_FUNCTION(snmp_get_quick_print) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - -#ifdef HAVE_NET_SNMP - RETURN_BOOL(netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)); -#else - RETURN_BOOL(snmp_get_quick_print()); -#endif -} -/* }}} */ - -/* {{{ proto void snmp_set_quick_print(int quick_print) - Return all objects including their respective object id withing the specified one */ -PHP_FUNCTION(snmp_set_quick_print) -{ - int argc = ZEND_NUM_ARGS(); - long a1; - - if (zend_parse_parameters(argc TSRMLS_CC, "l", &a1) == FAILURE) { - return; - } - -#ifdef HAVE_NET_SNMP - netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, (int) a1); -#else - snmp_set_quick_print((int)a1); -#endif -} -/* }}} */ - -#ifdef HAVE_NET_SNMP -/* {{{ proto void snmp_set_enum_print(int enum_print) - Return all values that are enums with their enum value instead of the raw integer */ -PHP_FUNCTION(snmp_set_enum_print) -{ - int argc = ZEND_NUM_ARGS(); - long a1; - - if (zend_parse_parameters(argc TSRMLS_CC, "l", &a1) == FAILURE) { - return; - } - - netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, (int) a1); -} -/* }}} */ - -/* {{{ proto void snmp_set_oid_numeric_print(int oid_numeric_print) - Return all objects including their respective object id withing the specified one */ -PHP_FUNCTION(snmp_set_oid_numeric_print) -{ - int argc = ZEND_NUM_ARGS(); - long a1; - - if (zend_parse_parameters(argc TSRMLS_CC, "l", &a1) == FAILURE) { - return; - } - if ((int) a1 != 0) { - netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, - NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, - NETSNMP_OID_OUTPUT_NUMERIC); - } -} -/* }}} */ -#endif - -/* {{{ proto int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]) - Set the value of a SNMP object */ -PHP_FUNCTION(snmpset) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_SET, SNMP_VERSION_1); -} -/* }}} */ - -/* {{{ int netsnmp_session_set_sec_name(struct snmp_session *s, char *name) - Set the security name in the snmpv3 session */ -static int netsnmp_session_set_sec_name(struct snmp_session *s, char *name) -{ - if ((s) && (name)) { - s->securityName = strdup(name); - s->securityNameLen = strlen(s->securityName); - return (0); - } - return (-1); -} -/* }}} */ - -/* {{{ int netsnmp_session_set_sec_level(struct snmp_session *s, char *level) - Set the security level in the snmpv3 session */ -static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level TSRMLS_DC) -{ - if ((s) && (level)) { - if (!strcasecmp(level, "noAuthNoPriv") || !strcasecmp(level, "nanp")) { - s->securityLevel = SNMP_SEC_LEVEL_NOAUTH; - return (0); - } else if (!strcasecmp(level, "authNoPriv") || !strcasecmp(level, "anp")) { - s->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV; - return (0); - } else if (!strcasecmp(level, "authPriv") || !strcasecmp(level, "ap")) { - s->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV; - return (0); - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", level); - } - return (-1); -} -/* }}} */ - -/* {{{ int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot) - Set the authentication protocol in the snmpv3 session */ -static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot TSRMLS_DC) -{ - if ((s) && (prot)) { - if (!strcasecmp(prot, "MD5")) { - s->securityAuthProto = usmHMACMD5AuthProtocol; - s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol); - return (0); - } else if (!strcasecmp(prot, "SHA")) { - s->securityAuthProto = usmHMACSHA1AuthProtocol; - s->securityAuthProtoLen = OIDSIZE(usmHMACSHA1AuthProtocol); - return (0); - } else if (strlen(prot)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid authentication protocol: %s", prot); - } - } - return (-1); -} -/* }}} */ - -/* {{{ int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) - Set the security protocol in the snmpv3 session */ -static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot TSRMLS_DC) -{ - if ((s) && (prot)) { - if (!strcasecmp(prot, "DES")) { - s->securityPrivProto = usmDESPrivProtocol; - s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol); - return (0); -#ifdef HAVE_AES - } else if (!strcasecmp(prot, "AES128") -#ifdef SNMP_VALIDATE_ERR -/* -* In Net-SNMP before 5.2, the following symbols exist: -* usmAES128PrivProtocol, usmAES192PrivProtocol, usmAES256PrivProtocol -* In an effort to be more standards-compliant, 5.2 removed the last two. -* As of 5.2, the symbols are: -* usmAESPrivProtocol, usmAES128PrivProtocol -* -* As we want this extension to compile on both versions, we use the latter -* symbol on purpose, as it's defined to be the same as the former. -*/ - || !strcasecmp(prot, "AES")) { - s->securityPrivProto = usmAES128PrivProtocol; - s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol); - return (0); -#else - ) { - s->securityPrivProto = usmAES128PrivProtocol; - s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol); - return (0); - } else if (!strcasecmp(prot, "AES192")) { - s->securityPrivProto = usmAES192PrivProtocol; - s->securityPrivProtoLen = OIDSIZE(usmAES192PrivProtocol); - return (0); - } else if (!strcasecmp(prot, "AES256")) { - s->securityPrivProto = usmAES256PrivProtocol; - s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol); - return (0); -#endif -#endif - } else if (strlen(prot)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid privacy protocol: %s", prot); - } - } - return (-1); -} -/* }}} */ - -/* {{{ int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass) - Make key from pass phrase in the snmpv3 session */ -static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRMLS_DC) -{ - /* - * make master key from pass phrases - */ - if ((s) && (pass) && strlen(pass)) { - s->securityAuthKeyLen = USM_AUTH_KU_LEN; - if (s->securityAuthProto == NULL) { - /* get .conf set default */ - const oid *def = get_default_authtype(&(s->securityAuthProtoLen)); - s->securityAuthProto = snmp_duplicate_objid(def, s->securityAuthProtoLen); - } - if (s->securityAuthProto == NULL) { - /* assume MD5 */ - s->securityAuthProto = - snmp_duplicate_objid(usmHMACMD5AuthProtocol, OIDSIZE(usmHMACMD5AuthProtocol)); - s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol); - } - if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen, - (u_char *) pass, strlen(pass), - s->securityAuthKey, &(s->securityAuthKeyLen)) != SNMPERR_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for authentication pass phrase"); - return (-2); - } - return (0); - } - return (-1); -} -/* }}} */ - -/* {{{ int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass) - Make key from pass phrase in the snmpv3 session */ -static int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass TSRMLS_DC) -{ - if ((s) && (pass) && strlen(pass)) { - s->securityPrivKeyLen = USM_PRIV_KU_LEN; - if (s->securityPrivProto == NULL) { - /* get .conf set default */ - const oid *def = get_default_privtype(&(s->securityPrivProtoLen)); - s->securityPrivProto = snmp_duplicate_objid(def, s->securityPrivProtoLen); - } - if (s->securityPrivProto == NULL) { - /* assume DES */ - s->securityPrivProto = snmp_duplicate_objid(usmDESPrivProtocol, - OIDSIZE(usmDESPrivProtocol)); - s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol); - } - if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen, - pass, strlen(pass), - s->securityPrivKey, &(s->securityPrivKeyLen)) != SNMPERR_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for privacy pass phrase"); - return (-2); - } - return (0); - } - return (-1); -} -/* }}} */ - -/* {{{ proto string snmp2_get(string host, string community, string object_id [, int timeout [, int retries]]) - Fetch a SNMP object */ -PHP_FUNCTION(snmp2_get) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GET, SNMP_VERSION_2c); -} -/* }}} */ - -/* {{{ proto string snmp2_getnext(string host, string community, string object_id [, int timeout [, int retries]]) - Fetch a SNMP object */ -PHP_FUNCTION(snmp2_getnext) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GETNEXT, SNMP_VERSION_2c); -} -/* }}} */ - -/* {{{ proto array snmp2_walk(string host, string community, string object_id [, int timeout [, int retries]]) - Return all objects under the specified object id */ -PHP_FUNCTION(snmp2_walk) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_WALK, SNMP_VERSION_2c); -} -/* }}} */ - -/* {{{ proto array snmp2_real_walk(string host, string community, string object_id [, int timeout [, int retries]]) - Return all objects including their respective object id withing the specified one */ -PHP_FUNCTION(snmp2_real_walk) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_REALWALK, SNMP_VERSION_2c); -} -/* }}} */ - -/* {{{ proto int snmp2_set(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]) - Set the value of a SNMP object */ -PHP_FUNCTION(snmp2_set) -{ - php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_SET, SNMP_VERSION_2c); -} -/* }}} */ - -/* {{{ proto void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) -* -* Generic SNMPv3 object fetcher -* From here is passed on the the common internal object fetcher. -* -* st=SNMP_CMD_GET snmp3_get() - query an agent and return a single value. -* st=SNMP_CMD_GETNEXT snmp3_getnext() - query an agent and return the next single value. -* st=SNMP_CMD_WALK snmp3_walk() - walk the mib and return a single dimensional array -* containing the values. -* st=SNMP_CMD_REALWALK snmp3_real_walk() - walk the mib and return an -* array of oid,value pairs. -* st=SNMP_CMD_SET snmp3_set() - query an agent and set a single value -* -*/ -static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) -{ - zval **a1, **a2, **a3, **a4, **a5, **a6, **a7, **a8, **a9, **a10, **a11, **a12; - struct snmp_session session; - long timeout=SNMP_DEFAULT_TIMEOUT; - long retries=SNMP_DEFAULT_RETRIES; - int myargc = ZEND_NUM_ARGS(); - char type = (char) 0; - char *value = (char *) 0; - char hostname[MAX_NAME_LEN]; - int remote_port = 161; - char *pptr; - - if (myargc < 8 || myargc > 12 || - zend_get_parameters_ex(myargc, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10, &a11, &a12) == FAILURE) { - WRONG_PARAM_COUNT; - } - - snmp_sess_init(&session); - /* This is all SNMPv3 */ - session.version = SNMP_VERSION_3; - - /* Reading the hostname and its optional non-default port number */ - convert_to_string_ex(a1); - strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); - if ((pptr = strchr (hostname, ':'))) { - remote_port = strtol (pptr + 1, NULL, 0); - } - session.peername = hostname; - session.remote_port = remote_port; - - /* Setting the security name. */ - convert_to_string_ex(a2); - if (netsnmp_session_set_sec_name(&session, Z_STRVAL_PP(a2))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could net set security name: %s", Z_STRVAL_PP(a2)); - RETURN_FALSE; - } - - /* Setting the security level. */ - convert_to_string_ex(a3); - if (netsnmp_session_set_sec_level(&session, Z_STRVAL_PP(a3) TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", Z_STRVAL_PP(a3)); - RETURN_FALSE; - } - - /* Setting the authentication protocol. */ - convert_to_string_ex(a4); - if (netsnmp_session_set_auth_protocol(&session, Z_STRVAL_PP(a4) TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid authentication protocol: %s", Z_STRVAL_PP(a4)); - RETURN_FALSE; - } - - /* Setting the authentication passphrase. */ - convert_to_string_ex(a5); - if (netsnmp_session_gen_auth_key(&session, Z_STRVAL_PP(a5) TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not generate key for authentication pass phrase: %s", Z_STRVAL_PP(a4)); - RETURN_FALSE; - } - - /* Setting the security protocol. */ - convert_to_string_ex(a6); - if (netsnmp_session_set_sec_protocol(&session, Z_STRVAL_PP(a6) TSRMLS_CC) && - (0 != strlen(Z_STRVAL_PP(a6)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security protocol: %s", Z_STRVAL_PP(a6)); - RETURN_FALSE; - } - - /* Setting the security protocol passphrase. */ - convert_to_string_ex(a7); - if (netsnmp_session_gen_sec_key(&session, Z_STRVAL_PP(a7) TSRMLS_CC) && - (0 != strlen(Z_STRVAL_PP(a7)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not generate key for security pass phrase: %s", Z_STRVAL_PP(a7)); - RETURN_FALSE; - } - - if (st == SNMP_CMD_SET) { - if (myargc < 10) { - WRONG_PARAM_COUNT; - } - if (myargc > 10) { - convert_to_long_ex(a11); - timeout = Z_LVAL_PP(a11); - } - if (myargc > 11) { - convert_to_long_ex(a12); - retries = Z_LVAL_PP(a12); - } - convert_to_string_ex(a9); - convert_to_string_ex(a10); - type = Z_STRVAL_PP(a9)[0]; - value = Z_STRVAL_PP(a10); - } else { - if (myargc > 8) { - convert_to_long_ex(a9); - timeout = Z_LVAL_PP(a9); - } - if (myargc > 9) { - convert_to_long_ex(a10); - retries = Z_LVAL_PP(a10); - } - } - - session.retries = retries; - session.timeout = timeout; - - php_snmp_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, st, &session, Z_STRVAL_PP(a8), type, value); -} -/* }}} */ - -/* {{{ proto int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]) - Fetch the value of a SNMP object */ -PHP_FUNCTION(snmp3_get) -{ - php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET); -} -/* }}} */ - -/* {{{ proto int snmp3_getnext(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]) - Fetch the value of a SNMP object */ -PHP_FUNCTION(snmp3_getnext) -{ - php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT); -} -/* }}} */ - -/* {{{ proto int snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]) - Fetch the value of a SNMP object */ -PHP_FUNCTION(snmp3_walk) -{ - php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK); -} -/* }}} */ - -/* {{{ proto int snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]) - Fetch the value of a SNMP object */ -PHP_FUNCTION(snmp3_real_walk) -{ - php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_REALWALK); -} -/* }}} */ - -/* {{{ proto int snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id, string type, mixed value [, int timeout [, int retries]]) - Fetch the value of a SNMP object */ -PHP_FUNCTION(snmp3_set) -{ - php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET); -} -/* }}} */ - -/* {{{ proto int snmp_set_valueretrieval(int method) - Specify the method how the SNMP values will be returned */ -PHP_FUNCTION(snmp_set_valueretrieval) -{ - zval **method; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &method) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(method); - - if ((Z_LVAL_PP(method) == SNMP_VALUE_LIBRARY) || - (Z_LVAL_PP(method) == SNMP_VALUE_PLAIN) || - (Z_LVAL_PP(method) == SNMP_VALUE_OBJECT)) { - SNMP_G(valueretrieval) = Z_LVAL_PP(method); - } -} -/* }}} */ - -/* {{{ proto int snmp_get_valueretrieval() - Return the method how the SNMP values will be returned */ -PHP_FUNCTION(snmp_get_valueretrieval) -{ - RETURN_LONG(SNMP_G(valueretrieval)); -} -/* }}} */ - -/* {{{ proto int snmp_read_mib(string filename) - Reads and parses a MIB file into the active MIB tree. */ -PHP_FUNCTION(snmp_read_mib) -{ - zval **filename; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - /* Prevent read_mib() from printing any errors. */ - snmp_disable_stderrlog(); - - if (!read_mib(Z_STRVAL_PP(filename))) { - char *error = strerror(errno); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading MIB file '%s': %s", Z_STRVAL_PP(filename), error); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/snmp/snmp.dsp b/ext/snmp/snmp.dsp deleted file mode 100644 index 3cc62338bdee1..0000000000000 --- a/ext/snmp/snmp.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="snmp" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=snmp - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "snmp.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "snmp.mak" CFG="snmp - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "snmp - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "snmp - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "snmp - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_snmp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "snmp - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_snmp.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "snmp - Win32 Release_TS" -# Name "snmp - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\snmp.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_snmp.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/snmp/winsnmp.c b/ext/snmp/winsnmp.c deleted file mode 100644 index f4332300a540d..0000000000000 --- a/ext/snmp/winsnmp.c +++ /dev/null @@ -1,249 +0,0 @@ -/* -Created from the snmputil sample in the Microsoft SDK for NT -*/ - -#include "php.h" -#if COMPILE_DL -#include "../phpdl.h" -#include "functions/dl.h" -#endif -#include "php_snmp.h" -#include - -#include -#include -#include - -#if HAVE_SNMP - -#include -#include - -/* {{{ snmp_functions[] - */ -function_entry snmp_functions[] = { - {"snmpget", php3_snmpget, NULL}, - {"snmpwalk", php3_snmpwalk, NULL}, - {NULL,NULL,NULL} -}; -/* }}} */ - -/* {{{ snmp_module_entry - */ -zend_module_entry snmp_module_entry = { - STANDARD_MODULE_HEADER, - "SNMP", - snmp_functions, - NULL, - NULL, - NULL, - NULL, - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#if COMPILE_DL -DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; } -#endif - -#define GET 1 -#define WALK 2 -#define GETNEXT 3 - -#define TIMEOUT 6000 /* milliseconds */ -#define RETRIES 3 - -/* {{{ _php_snmp - */ -void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) { - pval *a1, *a2, *a3; - INT operation; - LPSTR agent; - LPSTR community; - RFC1157VarBindList variableBindings; - LPSNMP_MGR_SESSION session; - - INT timeout = TIMEOUT; - INT retries = RETRIES; - - BYTE requestType; - AsnInteger errorStatus; - AsnInteger errorIndex; - AsnObjectIdentifier oid; - char *chkPtr = NULL; - - if (zend_get_parameters_ex(3, &a1, &a2, &a3) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(a1); - convert_to_string_ex(a2); - convert_to_string_ex(a3); - - agent=Z_STRVAL_PP(a1); - community=Z_STRVAL_PP(a2); - operation=st; - SnmpMgrStrToOid(Z_STRVAL_PP(a3), &oid); - -/* - I've limited this to only one oid, but we can create a - list of oid's here, and expand the function to take multiple - oid's -*/ - variableBindings.list->name = oid; - variableBindings.list->value.asnType = ASN_NULL; - variableBindings.len = 1; - -/* Establish a SNMP session to communicate with the remote agent. The - community, communications timeout, and communications retry count - for the session are also required. -*/ - if ((session = SnmpMgrOpen(agent, community, timeout, retries)) == NULL){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrOpen %d", GetLastError()); - } - - /* Determine and perform the requested operation.*/ - if (operation == GET || operation == GETNEXT){ - /* Get and GetNext are relatively simple operations to perform. - Simply initiate the request and process the result and/or - possible error conditions. */ - - if (operation == GET){ - requestType = ASN_RFC1157_GETREQUEST; - } else { - requestType = ASN_RFC1157_GETNEXTREQUEST; - } - - /* Request that the API carry out the desired operation.*/ - if (!SnmpMgrRequest(session, requestType, &variableBindings, - &errorStatus, &errorIndex)){ - /* The API is indicating an error. */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d", GetLastError()); - } else { - /* The API succeeded, errors may be indicated from the remote - agent. */ - if (errorStatus > 0){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error: errorStatus=%d, errorIndex=%d", - errorStatus, errorIndex); - } else { - /* Display the resulting variable bindings.*/ - UINT i; - char *str = NULL; - - for(i=0; i < variableBindings.len; i++) - { - SnmpMgrOidToStr(&variableBindings.list[i].name, &str); - php_printf("Variable = %s\n", str); - if (str) SNMP_free(str); - - php_printf("Value = "); - SnmpUtilPrintAsnAny(&variableBindings.list[i].value); - - php_printf("\n"); - } /* end for() */ - } - } - - /* Free the variable bindings that have been allocated.*/ - SnmpUtilVarBindListFree(&variableBindings); - } - else if (operation == WALK) - { - /* Walk is a common term used to indicate that all MIB variables - under a given OID are to be traversed and displayed. This is - a more complex operation requiring tests and looping in addition - to the steps for get/getnext above. */ - AsnObjectIdentifier root; - AsnObjectIdentifier tempOid; - - SnmpUtilOidCpy(&root, &variableBindings.list[0].name); - requestType = ASN_RFC1157_GETNEXTREQUEST; - - while(1) - { - if (!SnmpMgrRequest(session, requestType, &variableBindings, - &errorStatus, &errorIndex)){ - /* The API is indicating an error.*/ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d", GetLastError()); - break; - } - else - { - /* The API succeeded, errors may be indicated from the remote - agent. - Test for end of subtree or end of MIB. */ - if (errorStatus == SNMP_ERRORSTATUS_NOSUCHNAME || - SnmpUtilOidNCmp(&variableBindings.list[0].name, - &root, root.idLength)) - { - PUTS("End of MIB subtree.\n\n"); - break; - } - - /* Test for general error conditions or sucesss. */ - if (errorStatus > 0){ - php_error_docref(NULL TSRMLS_CC, E_ERROR,"Error: errorStatus=%d, errorIndex=%d", errorStatus, errorIndex); - break; - } - else - { - /* Display resulting variable binding for this iteration. */ - char *str = NULL; - - SnmpMgrOidToStr(&variableBindings.list[0].name, &str); - php_printf("Variable = %s\n", str); - if (str) SNMP_free(str); - - php_printf("Value = "); - SnmpUtilPrintAsnAny(&variableBindings.list[0].value); - - php_printf("\n"); - } - } /* end if () */ - /* Prepare for the next iteration. Make sure returned oid is - preserved and the returned value is freed. - */ - SnmpUtilOidCpy(&tempOid, &variableBindings.list[0].name); - SnmpUtilVarBindFree(&variableBindings.list[0]); - SnmpUtilOidCpy(&variableBindings.list[0].name, &tempOid); - variableBindings.list[0].value.asnType = ASN_NULL; - SnmpUtilOidFree(&tempOid); - } /* end while() */ - /* Free the variable bindings that have been allocated.*/ - SnmpUtilVarBindListFree(&variableBindings); - SnmpUtilOidFree(&root); - } /* end if (operation) */ - - - /* Close SNMP session with the remote agent.*/ - if (!SnmpMgrClose(session)){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrClose %d", GetLastError()); - } -} -/* }}} */ - -/* {{{ php3_snmpget - */ -DLEXPORT void php3_snmpget(INTERNAL_FUNCTION_PARAMETERS) { - _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* {{{ php3_snmpwalk - */ -DLEXPORT void php3_snmpwalk(INTERNAL_FUNCTION_PARAMETERS) { - _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/soap/CREDITS b/ext/soap/CREDITS deleted file mode 100644 index 83c9b1cc5c605..0000000000000 --- a/ext/soap/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SOAP -Brad Lafountain, Shane Caraveo, Dmitry Stogov diff --git a/ext/soap/TODO b/ext/soap/TODO deleted file mode 100644 index ad0b11c94833a..0000000000000 --- a/ext/soap/TODO +++ /dev/null @@ -1,98 +0,0 @@ -General -------- -- make sure soapserver.map(), soap_encode_to_xml() and soap_encode_to_zval() are really need -- reimplement SoapObject::__getfunctions() and SoapObject::__gettypes() - to return structures instead of strings -- error handling??? - -SOAP ----- -- SOAP routing -- root attribute (it is defined by SOAP 1.1, but not SOAP 1.2) -- make sure soap 1.1 and 1.2 are supported fully - -Encoding --------- -? full support for standard simple types ( - ? language, (pattern: "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*") - ? NMTOKEN, (pattern: "\c+") (\c: [a-zA-Z0-9.\-_:]) - ? NMTOKENS, (list: NMTOKEN, minLength: 1) - ? Name, (pattern: "\i\c*") (\i: [a-zA-Z_:] - ? NCName, (pattern: "[\i-[:]][\c-[:]]*") - ? ID, (base: NCName) - ? IDREF, (base: NCName) - ? IDREFS, (list: IDREF; minLength: 1) - ? ENTITY, (base: NCName) - ? ENTITIES, (list: ENTITY; minLength: 1) - ? duration) -? full support for standard date/time types ( - ? dateTime, - ? time, - ? date, - ? gYearMonth, - ? gYear, - ? gMonthDay, - ? gDay, - ? gMonth) -? full support for arrays - - SOAP 1.1 encoding of arrays with holes (partially transmitted and sparse arrays) - SOAP 1.2 doesn't support partially transmitted and sparse arrays -- references to external resources -? support for "nillable" and "nil" -? default values of -? provide schema 1999/2001 support??? -? make internal refrences for soap encoding (use seralization logic)??? -? provide user space overriding of serialization certin objects and types??? - -WSDL ----- -? server part support for "document" style encoding -? support for , -? -- parts attribute (with MIME/DIME binding) -- MIME binding -- DIME binding -- support for portType/operation parameterOrder attribute -- support for binding operation input/output name attribute (part of overloading) -- function/method overloading/redeclaration (test(int); test(string)) -- wsdl auto generation -- HTTP GET/POST binding -- SOAP security extension - -Schema ------- -- -? support for user defined simple types - ? restiction - ? enumeration - ? length (for string, anyURI, hexBinary, base64Binary and derived) list??? - ? minLength (for string, hexBinary, base64Binary and derived) list??? - ? maxLength (for string, hexBinary, base64Binary and derived) list??? - + whiteSpace (preserve, replace [#x9,#xA,#xD=>#x20], collapse [replace+?]) - - pattern - - minExclusive (for numeric, date types) - - minInclusive (for numeric, date types) - - maxExclusive (for numeric, date types) - - maxInclusive (for numeric, date types) - - totalDigits (for decimal) - - fractionDigits (for decimal) - ? union -? support for user defined complex types - ? full support for content model encoding/decoding - - - - - -Transport ---------- -? HTTP status codes -? HTTP chunked Transfer-Encoding -? support for HTTP compression (gzip,x-gzip,defalte) -- transport abstraction layer??? - -Interop Testing ---------------- -- more interop rounds/groups - -UDDI ----- -- ??? diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old deleted file mode 100644 index a1cc15c397ab6..0000000000000 --- a/ext/soap/TODO.old +++ /dev/null @@ -1,39 +0,0 @@ -TODO: -make sure soap 1.1 and 1.2 is supported fully -Better WSDL support Client and server (how much validation is needed here?) -UDDI?? -make internal refrences for soap encoding (use seralization logic) -add ini option for always soap_error_handler -provide user space overriding of serialization certin objects and types -serialization in general needs to be polished/finished... all xsd types -make perstistant objects and work with or without register_globals on -look to see if php-soap will work with out always_populate_raw_post_data on -see if client will work with ssl.. should be eaiser with php_streams -work on soap seralizer (php serialization) --work on a soap-service 'regiestry' and 'proxy' (apache soap style) --convert all string mainpulation to use smart_str -make the 'soap' packet abstract.. maybe incorperate xml-rpc -make the transport layer abstract.. what other transport layers are needed?... who uses smtp? what about jabber? -make $soap_object->data = 'text'; maybe invoke a set_*() and/or get_*() method -when using wsdls and function names are similar find the best match - void test(int); - void test(string); - maybe use the same alogrithim as ext/java. -investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up.. -provide schema 1999/2001 support.... -through memory leak testing -possible using shared memory for sdl caching... -api for clearing/checking sdl caching... -make php-soap work as a standalone server using php_streams and the new socket extension -http authication -proxy support -wsdl generation static and auto (.net style (http://server.com/soapserver.php?WSDL)) using phpdoc parsing engine -interpo testing... -BENCHMARKING...... lets prove how fast it is. -do some more work on website - -does this list stop... what exactly have i done? -im sure im forgetting 20 thousand more things.... - - - - brad diff --git a/ext/soap/config.m4 b/ext/soap/config.m4 deleted file mode 100644 index 8acad8dee371e..0000000000000 --- a/ext/soap/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension soap - -PHP_ARG_ENABLE(soap, whether to enable SOAP support, -[ --enable-soap Enable SOAP support]) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR SOAP: libxml2 install prefix], no, no) -fi - -if test "$PHP_SOAP" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([SOAP extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [ - AC_DEFINE(HAVE_SOAP,1,[ ]) - PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared) - PHP_SUBST(SOAP_SHARED_LIBADD) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/soap/config.w32 b/ext/soap/config.w32 deleted file mode 100644 index 048fd70ca1332..0000000000000 --- a/ext/soap/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("soap", "SOAP support", "no"); - -if (PHP_SOAP != "no" && PHP_LIBXML == "yes") { - EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c'); - AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support"); - - if (!PHP_SOAP_SHARED) { - ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC "); - } - ADD_EXTENSION_DEP('soap', 'libxml'); -} - diff --git a/ext/soap/interop/client_round2.php b/ext/soap/interop/client_round2.php deleted file mode 100644 index c1307472c4bf5..0000000000000 --- a/ext/soap/interop/client_round2.php +++ /dev/null @@ -1,113 +0,0 @@ - - - - - Round 2 Interop Client Tests - - - -Back to Interop Index
-

 

-getEndpoints($test); - echo "\n"; -} -function methodList($test,$sel_method) -{ - global $iop; - global $soap_tests; - - echo "\n"; -} - -function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL) -{ - global $PHP_SELF; - if (!$test) $test = 'base'; - echo "Round 2 '$test' Selected
\n"; - echo "Select endpoint and method to run:
\n"; - echo "
\n"; - echo "\n"; - endpointList($test, $endpoint); - methodList($test, $method); - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; -} - -function testSelectForm($selected_test = NULL) -{ - global $iop, $PHP_SELF; - echo "Select a Round 2 test case to run:
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; -} - -testSelectForm($_POST['test']); -endpointTestForm($_POST['test'],$_POST['endpoint'],$_POST['method'],$_POST['paramType'],$_POST['useWSDL']); - -if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists('method', $_POST)) { - // here we execute the orders - echo "

Calling {$_POST['method']} at {$_POST['endpoint']}

\n"; - echo "NOTE: wire's are slightly modified to display better in web browsers.
\n"; - - $iop->currentTest = $_POST['test']; // see $tests above - $iop->paramType = $_POST['paramType']; // 'php' or 'soapval' - $iop->useWSDL = $_POST['useWSDL']; // 1= do wsdl tests - $iop->numServers = 0; // 0 = all - $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint - $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method']; // test only this method - $iop->skipEndpointList = array(); // endpoints to skip - $iop->nosave = 0; // 1= disable saving results to database - // debug output - $iop->show = 0; - $iop->debug = 0; - $iop->showFaults = 0; // used in result table output - echo '
';
-    $iop->doTest();  // run a single set of tests using above options
-    echo '
'; -} -?> - - diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php deleted file mode 100644 index 588ee92888918..0000000000000 --- a/ext/soap/interop/client_round2_interop.php +++ /dev/null @@ -1,785 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id$ -// -require_once 'DB.php'; // PEAR/DB -require_once 'client_round2_params.php'; -require_once 'test.utility.php'; -require_once 'config.php'; - -error_reporting(E_ALL ^ E_NOTICE); - -class Interop_Client -{ - // database DNS - var $DSN = ""; - - var $baseURL = ""; - - // our central interop server, where we can get the list of endpoints - var $interopServer = "http://www.whitemesa.net/wsdl/interopInfo.wsdl"; - - // our local endpoint, will always get added to the database for all tests - var $localEndpoint; - - // specify testing - var $currentTest = 'base'; // see $tests above - var $paramType = 'php'; // 'php' or 'soapval' - var $useWSDL = 0; // 1= do wsdl tests - var $numServers = 0; // 0 = all - var $specificEndpoint = ''; // test only this endpoint - var $testMethod = ''; // test only this method - var $skipEndpointList = array(); // endpoints to skip - var $nosave = 0; - var $startAt = ''; // start in list at this endpoint - // debug output - var $show = 1; - var $debug = 0; - var $showFaults = 0; // used in result table output - - // PRIVATE VARIABLES - var $dbc = NULL; - var $totals = array(); - var $tests = array('base','GroupB', 'GroupC'); - var $paramTypes = array('php', 'soapval'); - var $endpoints = array(); - var $html = 1; - - function Interop_Client() { - global $interopConfig; - $this->DSN = $interopConfig['DSN']; - $this->baseURL = $interopConfig['baseURL']; - //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); - // set up the database connection - $this->dbc = DB::connect($this->DSN, true); - // if it errors out, just ignore it and rely on regular methods - if (DB::isError($this->dbc)) { - echo $this->dbc->getMessage(); - $this->dbc = NULL; - } - // set up local endpoint - $this->localEndpoint['base'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_base.php', - 'wsdlURL'=>$this->baseURL.'/interop.wsdl.php' - ); - $this->localEndpoint['GroupB'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_groupB.php', - 'wsdlURL'=>$this->baseURL.'/interopB.wsdl.php' - ); - $this->localEndpoint['GroupC'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_groupC.php', - 'wsdlURL'=>$this->baseURL.'/echoheadersvc.wsdl.php'); - } - - function _fetchEndpoints(&$soapclient, $test) { - $this->_getEndpoints($test, 1); - - // retreive endpoints from the endpoint server - $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/")); - if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) { - if ($this->html) print "
";
-            print $soapclient->wire."\n";
-            print_r($endpointArray);
-            if ($this->html) print "
"; - print "\n"; - return; - } - - // add our local endpoint - if ($this->localEndpoint[$test]) { - array_push($endpointArray, $this->localEndpoint[$test]); - } - - if (!$endpointArray) return; - - // reset the status to zero - $res = $this->dbc->query("update endpoints set status = 0 where class='$test'"); - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - // save new endpoints into database - foreach($endpointArray as $k => $v){ - if (array_key_exists($v->endpointName,$this->endpoints)) { - $res = $this->dbc->query("update endpoints set endpointURL='{$v->endpointURL}', wsdlURL='{$v->wsdlURL}', status=1 where id={$this->endpoints[$v->endpointName]['id']}"); - } else { - $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v->endpointName}','{$v->endpointURL}','{$v->wsdlURL}','$test')"); - } - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - } - } - - /** - * fetchEndpoints - * retreive endpoints interop server - * - * @return boolean result - * @access private - */ - function fetchEndpoints($test = NULL) { - // fetch from the interop server - try { - $soapclient = new SoapClient($this->interopServer); - if ($test) { - $this->_fetchEndpoints($soapclient, $test); - } else { - foreach ($this->tests as $test) { - $this->_fetchEndpoints($soapclient, $test); - } - $test = 'base'; - } - } catch (SoapFault $fault) { - if ($this->html) { - echo "
$fault
\n"; - } else { - echo "$fault\n"; - } - return NULL; - } - // retreive all endpoints now - $this->currentTest = $test; - $x = $this->_getEndpoints($test); - return $x; - } - - /** - * getEndpoints - * retreive endpoints from either database or interop server - * - * @param string base (see local var $tests) - * @param boolean all (if false, only get valid endpoints, status=1) - * @return boolean result - * @access private - */ - function getEndpoints($base = 'base', $all = 0) { - if (!$this->_getEndpoints($base, $all)) { - return $this->fetchEndpoints($base); - } - return TRUE; - } - - /** - * _getEndpoints - * retreive endpoints from database - * - * @param string base (see local var $tests) - * @param boolean all (if false, only get valid endpoints, status=1) - * @return boolean result - * @access private - */ - function _getEndpoints($base = "", $all = 0) { - $this->endpoints = array(); - - // build sql - $sql = "select * from endpoints "; - if ($base) { - $sql .= "where class='$base' "; - if (!$all) $sql .= "and status=1"; - } else - if (!$all) $sql .= "where status=1"; - $sql .= " order by endpointName"; - - - $db_ep = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); - if (DB::isError($db_ep)) { - echo $sql."\n"; - echo $db_ep->getMessage(); - return FALSE; - } - // rearange the array - foreach ($db_ep as $entry) { - $this->endpoints[$entry['endpointName']] = $entry; - } - - if (count($this->endpoints) > 0) { - $this->currentTest = $base; - return TRUE; - } - return FALSE; - } - - /** - * getResults - * retreive results from the database, stuff them into the endpoint array - * - * @access private - */ - function getResults($test = 'base', $type = 'php', $wsdl = 0) { - // be sure we have the right endpoints for this test result - $this->getEndpoints($test); - - // retreive the results and put them into the endpoint info - $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl"; - $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); - foreach ($results as $result) { - // find the endpoint - foreach ($this->endpoints as $epn => $epi) { - if ($epi['id'] == $result['endpoint']) { - // store the info - $this->endpoints[$epn]['methods'][$result['function']] = $result; - break; - } - } - } - } - - /** - * saveResults - * save the results of a method test into the database - * - * @access private - */ - function _saveResults($endpoint_id, &$soap_test) { - if ($this->nosave) return; - - $result = $soap_test->result; - $wire = $result['wire']; - if ($result['success']) { - $success = 'OK'; - $error = ''; - } else { - $success = $result['fault']->faultcode; - $pos = strpos($success,':'); - if ($pos !== false) { - $success = substr($success,$pos+1); - } - $error = $result['fault']->faultstring; - if (!$wire) $wire= $result['fault']->detail; - } - - $test_name = $soap_test->test_name; - - $sql = "delete from results where endpoint=$endpoint_id ". - "and class='$this->currentTest' and type='$this->paramType' ". - "and wsdl=$this->useWSDL and function=". - $this->dbc->quote($test_name); - #echo "\n".$sql; - $res = $this->dbc->query($sql); - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - - $sql = "insert into results (endpoint,stamp,class,type,wsdl,function,result,error,wire) ". - "values($endpoint_id,".time().",'$this->currentTest',". - "'$this->paramType',$this->useWSDL,". - $this->dbc->quote($test_name).",". - $this->dbc->quote($success).",". - $this->dbc->quote($error).",". - ($wire?$this->dbc->quote($wire):"''").")"; - #echo "\n".$sql; - $res = $this->dbc->query($sql); - - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - } - - /** - * decodeSoapval - * decodes a soap value to php type, used for test result comparisions - * - * @param SOAP_Value soapval - * @return mixed result - * @access public - */ - function decodeSoapval($soapval) - { - if (gettype($soapval) == "object" && - (strcasecmp(get_class($soapval),"SoapParam") == 0 || - strcasecmp(get_class($soapval),"SoapVar") == 0)) { - if (strcasecmp(get_class($soapval),"SoapParam") == 0) - $val = $soapval->param_data->enc_value; - else - $val = $soapval->enc_value; - } else { - $val = $soapval; - } - if (is_array($val)) { - foreach($val as $k => $v) { - if (gettype($v) == "object" && - (strcasecmp(get_class($soapval),"SoapParam") == 0 || - strcasecmp(get_class($soapval),"SoapVar") == 0)) { - $val[$k] = $this->decodeSoapval($v); - } - } - } - return $val; - } - - /** - * compareResult - * compare two php types for a match - * - * @param string expect - * @param string test_result - * @return boolean result - * @access public - */ - function compareResult($expect, $result, $type = NULL) - { - return compare($expect, $result); - } - - - /** - * doEndpointMethod - * run a method on an endpoint and store it's results to the database - * - * @param array endpoint_info - * @param SOAP_Test test - * @return boolean result - * @access public - */ - function doEndpointMethod(&$endpoint_info, &$soap_test) { - $ok = FALSE; - - // prepare a holder for the test results - $soap_test->result['class'] = $this->currentTest; - $soap_test->result['type'] = $this->paramType; - $soap_test->result['wsdl'] = $this->useWSDL; - - if ($this->useWSDL) { - if (array_key_exists('wsdlURL',$endpoint_info)) { - if (!array_key_exists('client',$endpoint_info)) { - try { - $endpoint_info['client'] = new SoapClient($endpoint_info['wsdlURL'], array("trace"=>1)); - } catch (SoapFault $ex) { - $endpoint_info['client']->wsdl->fault = $ex; - } - } - $soap =& $endpoint_info['client']; - - # XXX how do we determine a failure on retreiving/parsing wsdl? - if ($soap->wsdl->fault) { - $fault = $soap->wsdl->fault; - $soap_test->setResult(0,'WSDL', - $fault->faultstring."\n\n".$fault->detail, - $fault->faultstring, - $fault - ); - return FALSE; - } - } else { - $fault = new SoapFault('WSDL',"no WSDL defined for $endpoint"); - $soap_test->setResult(0,'WSDL', - $fault->faultstring, - $fault->faultstring, - $fault - ); - return FALSE; - } - $namespace = false; - $soapaction = false; - } else { - $namespace = $soapaction = 'http://soapinterop.org/'; - // hack to make tests work with MS SoapToolkit - // it's the only one that uses this soapaction, and breaks if - // it isn't right. Can't wait for soapaction to be fully depricated - if ($this->currentTest == 'base' && - strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) { - $soapaction = 'urn:soapinterop'; - } - if (!array_key_exists('client',$endpoint_info)) { - $endpoint_info['client'] = new SoapClient(null,array('location'=>$endpoint_info['endpointURL'],'uri'=>$soapaction,'trace'=>1)); - } - $soap = $endpoint_info['client']; - } -// // add headers to the test -// if ($soap_test->headers) { -// // $header is already a SOAP_Header class -// foreach ($soap_test->headers as $header) { -// $soap->addHeader($header); -// } -// } - // XXX no way to set encoding - // this lets us set UTF-8, US-ASCII or other - //$soap->setEncoding($soap_test->encoding); -try { - if ($this->useWSDL && !$soap_test->headers && !$soap_test->headers_expect) { - $args = ''; - foreach ($soap_test->method_params as $pname => $param) { - $arg = '$soap_test->method_params["'.$pname.'"]'; - $args .= $args?','.$arg:$arg; - } - $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');'); - } else { - if ($soap_test->headers || $soap_test->headers_expect) { - $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers); - } else { - $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace)); - } - } -} catch (SoapFault $ex) { - $return = $ex; -} - - if(!is_soap_fault($return)){ - if ($soap_test->expect !== NULL) { - $sent = $soap_test->expect; - } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { - reset($soap_test->method_params); - $sent = current($soap_test->method_params); - } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 0) { - $sent = null; - } else { - $sent = $soap_test->method_params; - } - - // compare header results - $headers_ok = TRUE; - if ($soap_test->headers || $soap_test->headers_expect) { - $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers); - } - - # we need to decode what we sent so we can compare! - $sent_d = $this->decodeSoapval($sent); - - $soap_test->result['sent'] = $sent; - $soap_test->result['return'] = $return; - - // compare the results with what we sent - - if ($soap_test->cmp_func !== NULL) { - $cmp_func = $soap_test->cmp_func; - $ok = $cmp_func($sent_d,$return); - } else { - $ok = $this->compareResult($sent_d,$return, $sent->type); - if (!$ok && $soap_test->expect) { - $ok = $this->compareResult($soap_test->expect,$return); - } - } - - // save the wire - $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". - "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n". - "EXPECTED:\n".var_dump_str($sent_d)."\n". - "RESULTL:\n".var_dump_str($return); - if ($soap_test->headers_expect) { - $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n". - "RESULT HEADERS:\n".var_dump_str($result_headers); - } - #print "Wire:".htmlentities($wire); - - if($ok){ - if (!$headers_ok) { - $fault = new SoapFault('HEADER','The returned result did not match what we expected to receive'); - $soap_test->setResult(0,$fault->faultcode, - $wire, - $fault->faultstring, - $fault - ); - } else { - $soap_test->setResult(1,'OK',$wire); - $success = TRUE; - } - } else { - $fault = new SoapFault('RESULT','The returned result did not match what we expected to receive'); - $soap_test->setResult(0,$fault->faultcode, - $wire, - $fault->faultstring, - $fault - ); - } - } else { - $fault = $return; - if ($soap_test->expect_fault) { - $ok = 1; - $res = 'OK'; - } else { - $ok = 0; - $res =$fault->faultcode; - $pos = strpos($res,':'); - if ($pos !== false) { - $res = substr($res,$pos+1); - } - } - // save the wire - $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". - "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n". - "RESULTL:\n".var_dump_str($return); - #print "Wire:".htmlentities($wire); - - $soap_test->setResult($ok,$res, $wire,$fault->faultstring, $fault); - - } - return $ok; - } - - - /** - * doTest - * run a single round of tests - * - * @access public - */ - function doTest() { - global $soap_tests; - // get endpoints for this test - $this->getEndpoints($this->currentTest); - #clear totals - $this->totals = array(); - - $i = 0; - foreach($this->endpoints as $endpoint => $endpoint_info){ - - // if we specify an endpoint, skip until we find it - if ($this->specificEndpoint && $endpoint != $this->specificEndpoint) continue; - if ($this->useWSDL && !$endpoint_info['endpointURL']) continue; - - $skipendpoint = FALSE; - $this->totals['servers']++; - #$endpoint_info['tests'] = array(); - - if ($this->show) { - print "Processing $endpoint at {$endpoint_info['endpointURL']}"; - if ($this->html) print "
\n"; else print "\n"; - } - - foreach($soap_tests[$this->currentTest] as $soap_test) { - //foreach(array_keys($method_params[$this->currentTest][$this->paramType]) as $method) - - // only run the type of test we're looking for (php or soapval) - if ($soap_test->type != $this->paramType) continue; - - // if we haven't reached our startpoint, skip - if ($this->startAt && $this->startAt != $endpoint_info['endpointName']) continue; - $this->startAt = ''; - - // if this is in our skip list, skip it - if (in_array($endpoint, $this->skipEndpointList)) { - $skipendpoint = TRUE; - $skipfault = new SoapFault('SKIP','endpoint skipped'); - $soap_test->setResult(0,$fault->faultcode, '', - $skipfault->faultstring, - $skipfault - ); - #$endpoint_info['tests'][] = &$soap_test; - #$soap_test->showTestResult($this->debug, $this->html); - #$this->_saveResults($endpoint_info['id'], $soap_test->method_name); - $soap_test->result = NULL; - continue; - } - - // if we're looking for a specific method, skip unless we have it - if ($this->testMethod && strcmp($this->testMethod,$soap_test->test_name) != 0) continue; - - // if we are skipping the rest of the tests (due to error) note a fault - if ($skipendpoint) { - $soap_test->setResult(0,$fault->faultcode, '', - $skipfault->faultstring, - $skipfault - ); - #$endpoint_info['tests'][] = &$soap_test; - $this->totals['fail']++; - } else { - // run the endpoint test - if ($this->doEndpointMethod($endpoint_info, $soap_test)) { - $this->totals['success']++; - } else { - $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP' - && strstr($soap_test->result['fault']->faultstring,'Connect Error'); - $skipfault = $soap_test->result['fault']; - $this->totals['fail']++; - } - #$endpoint_info['tests'][] = &$soap_test; - } - $soap_test->showTestResult($this->debug, $this->html); - $this->_saveResults($endpoint_info['id'], $soap_test); - $soap_test->result = NULL; - $this->totals['calls']++; - } - if ($this->numservers && ++$i >= $this->numservers) break; - } - } - - function doGroupTests() { - $dowsdl = array(0,1); - foreach($dowsdl as $usewsdl) { - $this->useWSDL = $usewsdl; - foreach($this->paramTypes as $ptype) { - // skip a pointless test - if ($usewsdl && $ptype == 'soapval') break; - $this->paramType = $ptype; - $this->doTest(); - } - } - } - - /** - * doTests - * go all out. This takes time. - * - * @access public - */ - function doTests() { - // the mother of all interop tests - $dowsdl = array(0,1); - foreach($this->tests as $test) { - $this->currentTest = $test; - foreach($dowsdl as $usewsdl) { - $this->useWSDL = $usewsdl; - foreach($this->paramTypes as $ptype) { - // skip a pointless test - if ($usewsdl && $ptype == 'soapval') break; - $this->paramType = $ptype; - $this->doTest(); - } - } - } - } - - // *********************************************************** - // output functions - - /** - * getResults - * retreive results from the database, stuff them into the endpoint array - * - * @access private - */ - function getMethodList($test = 'base') { - // retreive the results and put them into the endpoint info - $sql = "select distinct(function) from results where class='$test' order by function"; - $results = $this->dbc->getAll($sql); - $ar = array(); - foreach($results as $result) { - $ar[] = $result[0]; - } - return $ar; - } - - function outputTable() - { - $methods = $this->getMethodList($this->currentTest); - if (!$methods) return; - $this->getResults($this->currentTest,$this->paramType,$this->useWSDL); - - echo "Testing $this->currentTest "; - if ($this->useWSDL) echo "using WSDL "; - else echo "using Direct calls "; - echo "with $this->paramType values
\n"; - - // calculate totals for this table - $this->totals['success'] = 0; - $this->totals['fail'] = 0; - $this->totals['servers'] = 0; #count($this->endpoints); - foreach ($this->endpoints as $endpoint => $endpoint_info) { - if (count($endpoint_info['methods']) > 0) { - $this->totals['servers']++; - foreach ($methods as $method) { - $r = $endpoint_info['methods'][$method]['result']; - if ($r == 'OK') $this->totals['success']++; - else $this->totals['fail']++; - } - } else { - unset($this->endpoints[$endpoint]); - } - } - $this->totals['calls'] = count($methods) * $this->totals['servers']; - - echo "\n\nServers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}
\n"; - - echo "
\n"; - echo "\n"; - foreach ($methods as $method) { - $info = split(':', $method); - echo "\n"; - } - echo "\n"; - $faults = array(); - $fi = 0; - foreach ($this->endpoints as $endpoint => $endpoint_info) { - if (array_key_exists('wsdlURL',$endpoint_info)) { - echo "\n"; - } else { - echo "\n"; - } - foreach ($methods as $method) { - $id = $endpoint_info['methods'][$method]['id']; - $r = $endpoint_info['methods'][$method]['result']; - $e = $endpoint_info['methods'][$method]['error']; - if ($e) { - $faults[$fi++] = $e; - } - if ($r) { - echo "\n"; - } else { - echo "\n"; - } - } - echo "\n"; - } - echo "
Endpoint"; - foreach ($info as $m) { - $hi = split(',',$m); - echo ''.$hi[0]."
\n"; - if (count($hi) > 1) { - echo "  Actor=".($hi[1]?'Target':'Not Target')."
\n"; - echo "  MustUnderstand=$hi[2]
\n"; - } - } - echo "
$endpoint
$endpoint$runtested

\n"; - if ($this->showFaults && count($faults) > 0) { - echo "ERROR Details:
\n
    \n"; - # output more error detail - foreach ($faults as $fault) { - echo '
  • '.HTMLSpecialChars($fault)."
  • \n"; - } - } - echo "


\n"; - } - - function outputTables() { - // the mother of all interop tests - $dowsdl = array(0,1); - foreach($this->tests as $test) { - $this->currentTest = $test; - foreach($dowsdl as $usewsdl) { - $this->useWSDL = $usewsdl; - foreach($this->paramTypes as $ptype) { - // skip a pointless test - if ($usewsdl && $ptype == 'soapval') break; - $this->paramType = $ptype; - $this->outputTable(); - } - } - } - } - - function showWire($id) { - $results = $this->dbc->getAll("select * from results where id=$id",NULL, DB_FETCHMODE_ASSOC ); - #$wire = preg_replace("/>/",">\n",$results[0]['wire']); - $wire = $results[0]['wire']; - if ($this->html) print "
";
-        echo "\n".HTMLSpecialChars($wire);
-        if ($this->html) print "
"; - print "\n"; - } - -} - -?> \ No newline at end of file diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php deleted file mode 100644 index 04f9fd64a43ea..0000000000000 --- a/ext/soap/interop/client_round2_params.php +++ /dev/null @@ -1,622 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id$ -// - -define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor'); - -class SOAP_Test { - var $type = 'php'; - var $test_name = NULL; - var $method_name = NULL; - var $method_params = NULL; - var $cmp_func = NULL; - var $expect = NULL; - var $expect_fault = FALSE; - var $headers = NULL; - var $headers_expect = NULL; - var $result = array(); - var $show = 1; - var $debug = 0; - var $encoding = 'UTF-8'; - - function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) { - # XXX we have to do this to make php-soap happy with NULL params - if (!$params) $params = array(); - - if (strchr($methodname,'(')) { - preg_match('/(.*)\((.*)\)/',$methodname,$matches); - $this->test_name = $methodname; - $this->method_name = $matches[1]; - } else { - $this->test_name = $this->method_name = $methodname; - } - $this->method_params = $params; - if ($expect !== NULL) { - $this->expect = $expect; - } - if ($cmp_func !== NULL) { - $this->cmp_func = $cmp_func; - } - - // determine test type - if ($params) { - $v = array_values($params); - if (gettype($v[0]) == 'object' && - (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam')) - $this->type = 'soapval'; - } - } - - function setResult($ok, $result, $wire, $error = '', $fault = NULL) - { - $this->result['success'] = $ok; - $this->result['result'] = $result; - $this->result['error'] = $error; - $this->result['wire'] = $wire; - $this->result['fault'] = $fault; - } - - /** - * showMethodResult - * print simple output about a methods result - * - * @param array endpoint_info - * @param string method - * @access public - */ - function showTestResult($debug = 0, $html = 0) { - // debug output - if ($debug) $this->show = 1; - if ($debug) { - echo str_repeat("-",50).$html?"
\n":"\n"; - } - - echo "testing $this->test_name : "; - - if ($debug) { - print "method params: "; - print_r($this->params); - print "\n"; - } - - $ok = $this->result['success']; - if ($ok) { - if ($html) { - print "SUCCESS\n"; - } else { - print "SUCCESS\n"; - } - } else { - $fault = $this->result['fault']; - if ($fault) { - $res = $fault->faultcode; - $pos = strpos($res,':'); - if ($pos !== false) { - $res = substr($res,$pos+1); - } - if ($html) { - print "FAILED: [$res] {$fault->faultstring}\n"; - } else { - print "FAILED: [$res] {$fault->faultstring}\n"; - } - } else { - if ($html) { - print "FAILED: ".$this->result['result']."\n"; - } else { - print "FAILED: ".$this->result['result']."\n"; - } - } - } - if ($debug) { - if ($html) { - echo "
\n".htmlentities($this->result['wire'])."
\n"; - } else { - echo "\n".htmlentities($this->result['wire'])."\n"; - } - } - } -} - -# XXX I know this isn't quite right, need to deal with this better -function make_2d($x, $y) -{ - for ($_x = 0; $_x < $x; $_x++) { - for ($_y = 0; $_y < $y; $_y++) { - $a[$_x][$_y] = "x{$_x}y{$_y}"; - } - } - return $a; -} - -function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) { - return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name); -} - -class SOAPStruct { - var $varString; - var $varInt; - var $varFloat; - function SOAPStruct($s, $i, $f) { - $this->varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -//*********************************************************** -// Base echoString - -$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!')); -$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => '')); -$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL)); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING))); -//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f")); -//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f",XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n")); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING))); -$test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('áğ—ˆİ³’₧⅜áğ—áğ¸'))); -$test->encoding = 'UTF-8'; -$soap_tests['base'][] = $test; -$test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('áğ—ˆİ³’₧⅜áğ—áğ¸'),XSD_STRING))); -$test->encoding = 'UTF-8'; -$soap_tests['base'][] = $test; - -//*********************************************************** -// Base echoStringArray - -$soap_tests['base'][] = new SOAP_Test('echoStringArray', - array('inputStringArray' => array('good','bad'))); -$soap_tests['base'][] = new SOAP_Test('echoStringArray', - array('inputStringArray' => - soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', - array('inputStringArray' => array('good'))); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', - array('inputStringArray' => - soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -// empty array test -$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array())); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -# XXX NULL Arrays not supported -// null array test -$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL)); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -//*********************************************************** -// Base echoInteger -$x = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); -$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); -$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT))); - -//*********************************************************** -// Base echoIntegerArray - -$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2))); -$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', - array('inputIntegerArray' => - soap_value('inputIntegerArray', - array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)), - SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd"))); - -//*********************************************************** -// Base echoFloat - -$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23)); -$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT))); - -//*********************************************************** -// Base echoFloatArray - -$soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325))); -$soap_tests['base'][] = new SOAP_Test('echoFloatArray', - array('inputFloatArray' => - soap_value('inputFloatArray', - array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)), - SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd"))); -//*********************************************************** -// Base echoStruct - -$soapstruct = new SOAPStruct('arg',34,325.325); -# XXX no way to set a namespace!!! -$soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"); -$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct)); -$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct)); - -//*********************************************************** -// Base echoStructArray - -$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array( - $soapstruct,$soapstruct,$soapstruct))); -$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => - soap_value('inputStructArray',array( - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")), - SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"))); - - -//*********************************************************** -// Base echoVoid - -$soap_tests['base'][] = new SOAP_Test('echoVoid', NULL); -$test = new SOAP_Test('echoVoid', NULL); -$test->type = 'soapval'; -$soap_tests['base'][] = $test; - -//*********************************************************** -// Base echoBase64 - -$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E=')); -$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => - soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY))); - -//*********************************************************** -// Base echoHexBinary - -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare'); -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => - soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare'); - -//*********************************************************** -// Base echoDecimal - -# XXX test fails because php-soap incorrectly sets decimal to long rather than float -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890')); -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => - soap_value('inputDecimal','12345.67890',XSD_DECIMAL))); - -//*********************************************************** -// Base echoDate - -# php-soap doesn't handle datetime types properly yet -$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare'); -$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => - soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare'); - -//*********************************************************** -// Base echoBoolean - -# php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false. -$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => - soap_value('inputBoolean',TRUE,XSD_BOOLEAN))); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => - soap_value('inputBoolean',FALSE,XSD_BOOLEAN))); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => - soap_value('inputBoolean',1,XSD_BOOLEAN)),true); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => - soap_value('inputBoolean',0,XSD_BOOLEAN)),false); - - - -//*********************************************************** -// GROUP B - - -//*********************************************************** -// GroupB echoStructAsSimpleTypes - -$expect = array( - 'outputString'=>'arg', - 'outputInteger'=>34, - 'outputFloat'=>325.325 - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', - array('inputStruct' => (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - )), $expect); -$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', - array('inputStruct' => - soap_value('inputStruct', - (object)array('varString' => 'arg', - 'varInt' => 34, - 'varFloat' => 325.325 - ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect); - -//*********************************************************** -// GroupB echoSimpleTypesAsStruct - -$expect = - (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', - array( - 'inputString'=>'arg', - 'inputInteger'=>34, - 'inputFloat'=>325.325 - ), $expect); -$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', - array( - soap_value('inputString','arg', XSD_STRING), - soap_value('inputInteger',34, XSD_INT), - soap_value('inputFloat',325.325, XSD_FLOAT) - ), $expect); - -//*********************************************************** -// GroupB echo2DStringArray - -$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', - array('input2DStringArray' => make_2d(3,3))); - -$multidimarray = - soap_value('input2DStringArray', - array( - array('row0col0', 'row0col1', 'row0col2'), - array('row1col0', 'row1col1', 'row1col2') - ), SOAP_ENC_ARRAY - ); -//$multidimarray->options['flatten'] = TRUE; -$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', - array('input2DStringArray' => $multidimarray)); - -//*********************************************************** -// GroupB echoNestedStruct - -$strstr = (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varStruct' => (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - )); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', - array('inputStruct' => $strstr)); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', - array('inputStruct' => - soap_value('inputStruct', - (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varStruct' => new SoapVar((object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd") - ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd" - )),$strstr); - -//*********************************************************** -// GroupB echoNestedArray - -$arrstr = (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varArray' => array('red','blue','green') - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', - array('inputStruct' => $arrstr)); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', - array('inputStruct' => - soap_value('inputStruct', - (object)array('varString' => 'arg', - 'varInt' => 34, - 'varFloat' => 325.325, - 'varArray' => - new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd") - ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd" - )),$arrstr); - - -//*********************************************************** -// GROUP C header tests - -//*********************************************************** -// echoMeStringRequest - -// echoMeStringRequest with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint header destination, must understand, -// invalid namespace, should recieve a fault -$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); -$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -//*********************************************************** -// echoMeStructRequest - -// echoMeStructRequest with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 0, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 1, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -//*********************************************************** -// echoMeUnknown - -// echoMeUnknown with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; -?> diff --git a/ext/soap/interop/client_round2_results.php b/ext/soap/interop/client_round2_results.php deleted file mode 100644 index 52e89c3ded44c..0000000000000 --- a/ext/soap/interop/client_round2_results.php +++ /dev/null @@ -1,75 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id$ -// -require_once 'client_round2_interop.php'; -?> - - - - - - PHP SOAP Client Interop Test Results - - - -

PHP SOAP Client Interop Test Results: Round2

- -Back to Interop Index
-

 

- -showFaults = 1; - -if ($_GET['wire']) { - $iop->showWire($_GET['wire']); -} else { - $iop->getEndpoints(); - $iop->getResults(); - - if ($_GET['test']) { - $iop->currentTest = $_GET['test']; - $iop->useWSDL = $_GET['wsdl']?$_GET['wsdl']:0; - $iop->paramType = $_GET['type']?$_GET['type']:'php'; - $iop->outputTable(); - } else { - $iop->outputTables(); - } -} -?> - - diff --git a/ext/soap/interop/client_round2_run.php b/ext/soap/interop/client_round2_run.php deleted file mode 100644 index 1a1f9a8ea4ce8..0000000000000 --- a/ext/soap/interop/client_round2_run.php +++ /dev/null @@ -1,53 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id$ -// - -set_time_limit(0); -require_once 'client_round2_interop.php'; - -$iop = new Interop_Client(); -$iop->html = 0; - -// force a fetch of endpoints, this happens irregardless if no endpoints in database -$iop->fetchEndpoints(); - -// set some options -$iop->currentTest = 'GroupC'; // see $tests above -$iop->paramType = 'php'; // 'php' or 'soapval' -$iop->useWSDL = 1; // 1= do wsdl tests -$iop->numServers = 0; // 0 = all -//$iop->specificEndpoint = 'PHP ext/soap'; // test only this endpoint -//$iop->testMethod = 'echoString'; // test only this method - -// endpoints to skip -//$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0'); -$iop->startAt=''; -$iop->nosave = 0; // 1= disable saving results to database -// debug output -$iop->show = 1; -$iop->debug = 0; -$iop->showFaults = 0; // used in result table output - -$iop->doTest(); // run a single set of tests using above options -#$iop->doGroupTests(); // run a group of tests set in $currentTest -#$iop->doTests(); // run all tests, ignore above options -#$iop->outputTables(); -echo "done\n"; - -?> diff --git a/ext/soap/interop/config.php.dist b/ext/soap/interop/config.php.dist deleted file mode 100644 index afdeaf9f6cb1e..0000000000000 --- a/ext/soap/interop/config.php.dist +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/soap/interop/database_round2.sql b/ext/soap/interop/database_round2.sql deleted file mode 100644 index 6834b0eeaec7b..0000000000000 --- a/ext/soap/interop/database_round2.sql +++ /dev/null @@ -1,44 +0,0 @@ -# phpMyAdmin MySQL-Dump -# version 2.2.5 -# http://phpwizard.net/phpMyAdmin/ -# http://phpmyadmin.sourceforge.net/ (download page) -# -# Host: localhost -# Generation Time: Apr 08, 2002 at 08:32 PM -# Server version: 3.23.49 -# PHP Version: 4.1.1 -# Database : `interop` -# -------------------------------------------------------- - -# -# Table structure for table `endpoints` -# - -CREATE TABLE endpoints ( - id int(11) NOT NULL auto_increment, - endpointName varchar(50) NOT NULL default '', - endpointURL varchar(255) NOT NULL default '', - wsdlURL varchar(255) NOT NULL default '', - class varchar(20) NOT NULL default '', - status int(11) NOT NULL default '1', - PRIMARY KEY (id) -) TYPE=MyISAM; -# -------------------------------------------------------- - -# -# Table structure for table `results` -# - -CREATE TABLE results ( - id int(11) NOT NULL auto_increment, - endpoint int(11) NOT NULL default '0', - stamp int(11) NOT NULL default '0', - class varchar(10) NOT NULL default '', - type varchar(10) default NULL, - wsdl int(11) NOT NULL default '0', - function varchar(255) NOT NULL default '', - result varchar(25) NOT NULL default '', - error text, - wire text NOT NULL, - PRIMARY KEY (id) -) TYPE=MyISAM; diff --git a/ext/soap/interop/echoheadersvc.wsdl.php b/ext/soap/interop/echoheadersvc.wsdl.php deleted file mode 100644 index e7070242a3f62..0000000000000 --- a/ext/soap/interop/echoheadersvc.wsdl.php +++ /dev/null @@ -1,398 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_groupC.php"/> - - - - diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php deleted file mode 100644 index 1ae25d92f02ef..0000000000000 --- a/ext/soap/interop/index.php +++ /dev/null @@ -1,59 +0,0 @@ - - - - - PHP SOAP Interop - - - - -

PHP SOAP Interop

-

Welcome to the PHP SOAP Interop pages. These pages are set up for -SOAP Builder interop tests. You can find out more about the interop tests -at White Mesa.

-

Currently Round 2 base, Group B and Group C interop tests are enabled.

- -

Round 2 Interop Server

-Base WSDL:
-Group B WSDL:
-Group C WSDL:
- -

Interop Client

- -

Notes: Tests are done both "Direct" and with "WSDL". WSDL tests use the supplied interop WSDL -to run the tests against. The Direct method uses an internal prebuilt list of methods and parameters -for the test.

-

Tests are also run against two methods of generating method parameters. The first, 'php', attempts -to directly serialize PHP variables into soap values. The second method, 'soapval', uses a SoapParam and SoapVar -classes to define what the type of the value is.

- -

Client Test Interface

-

The client interface allows you to run the PHP SOAP -Client against a choosen interop server. Each run updates the results database below.

- -

Interop Client Test Results

-

This is a database of the current test results using PHP SOAP Clients against interop servers.

-

More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the -link in the result box. If we have an HTTP error -attempting to connect to the endpoint, we will mark all consecutive attempts as errors, and skip -testing that endpoint. This reduces the time it takes to run the tests if a server is unavailable.

- - - diff --git a/ext/soap/interop/interop.wsdl.php b/ext/soap/interop/interop.wsdl.php deleted file mode 100644 index 6ed2d17d66dfb..0000000000000 --- a/ext/soap/interop/interop.wsdl.php +++ /dev/null @@ -1,336 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_base.php"/> - - - - diff --git a/ext/soap/interop/interopB.wsdl.php b/ext/soap/interop/interopB.wsdl.php deleted file mode 100644 index 3113b1c2fed7d..0000000000000 --- a/ext/soap/interop/interopB.wsdl.php +++ /dev/null @@ -1,196 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_groupB.php"/> - - - - diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php deleted file mode 100644 index 50c98aa139a61..0000000000000 --- a/ext/soap/interop/server_round2_base.php +++ /dev/null @@ -1,105 +0,0 @@ - Port to PEAR and more | -// | Authors: Dietrich Ayala Original Author | -// +----------------------------------------------------------------------+ -// -// $Id$ -// - -class SOAP_Interop_Base { - - function echoString($inputString) - { - return $inputString; - } - - function echoStringArray($inputStringArray) - { - return $inputStringArray; - } - - - function echoInteger($inputInteger) - { - return $inputInteger; - } - - function echoIntegerArray($inputIntegerArray) - { - return $inputIntegerArray; - } - - function echoFloat($inputFloat) - { - return $inputFloat; - } - - function echoFloatArray($inputFloatArray) - { - return $inputFloatArray; - } - - function echoStruct($inputStruct) - { - return $inputStruct; - } - - function echoStructArray($inputStructArray) - { - return $inputStructArray; - } - - function echoVoid() - { - return NULL; - } - - function echoBase64($b_encoded) - { - return $b_encoded; - } - - function echoDate($timeInstant) - { - return $timeInstant; - } - - function echoHexBinary($hb) - { - return $hb; - } - - function echoDecimal($dec) - { - return $dec; - } - - function echoBoolean($boolean) - { - return $boolean; - } - - function echoMimeAttachment($stuff) - { - return new SOAP_Attachment('return','application/octet-stream',NULL,$stuff); - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); -$server->setClass("SOAP_Interop_Base"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php deleted file mode 100644 index a390a4c75af94..0000000000000 --- a/ext/soap/interop/server_round2_groupB.php +++ /dev/null @@ -1,58 +0,0 @@ - Port to PEAR and more | -// | Authors: Dietrich Ayala Original Author | -// +----------------------------------------------------------------------+ -// -// $Id$ -// - -class SOAP_Interop_GroupB { - - function echoStructAsSimpleTypes ($struct) - { - return array('outputString' => $struct->varString, - 'outputInteger' => $struct->varInt, - 'outputFloat' => $struct->varFloat); - } - - function echoSimpleTypesAsStruct($string, $int, $float) - { - return (object)array("varString" => $string, - "varInt" => $int, - "varFloat" => $float); - } - - function echoNestedStruct($struct) - { - return $struct; - } - - function echo2DStringArray($ary) - { - return $ary; - } - - function echoNestedArray($ary) - { - return $ary; - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); -$server->setClass("SOAP_Interop_GroupB"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php deleted file mode 100644 index 25241d0429e33..0000000000000 --- a/ext/soap/interop/server_round2_groupC.php +++ /dev/null @@ -1,43 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id$ -// - -class SOAP_Interop_GroupC { - var $method_namespace = 'http://soapinterop.org/echoheader/'; - - function echoMeStringRequest($string) - { - return new SoapHeader($this->method_namespace, "echoMeStringResponse", $string); - } - - function echoMeStructRequest($struct) - { - return new SoapHeader($this->method_namespace, "echoMeStructResponse", $struct); - } - - function echoVoid() - { - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"); -$server->setClass("SOAP_Interop_GroupC"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/interop/test.utility.php b/ext/soap/interop/test.utility.php deleted file mode 100644 index 5b1f699c9bef4..0000000000000 --- a/ext/soap/interop/test.utility.php +++ /dev/null @@ -1,143 +0,0 @@ -compare($e1, $e2) == 0; - $oj = false; - } - return $ok || $e1 == $e2 || strcasecmp(trim($e1), trim($e2)) == 0; -} - -function array_compare(&$ar1, &$ar2) { - if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE; - if (count($ar1) != count($ar2)) return FALSE; - foreach ($ar1 as $k => $v) { - if (!array_key_exists($k,$ar2)) return FALSE; - if (!compare($v,$ar2[$k])) return FALSE; - } - return TRUE; -} - -function object_compare(&$obj1, &$obj2) { - if (gettype($obj1) != 'object' || gettype($obj2) != 'object') return FALSE; -// if (class_name(obj1) != class_name(obj2)) return FALSE; - $ar1 = (array)$obj1; - $ar2 = (array)$obj2; - return array_compare($ar1,$ar2); -} - -function compare(&$x,&$y) { - $ok = 0; - $x_type = gettype($x); - $y_type = gettype($y); - if ($x_type == $y_type) { - if ($x_type == "array") { - $ok = array_compare($x, $y); - } else if ($x_type == "object") { - $ok = object_compare($x, $y); - } else if ($x_type == "double") { - $ok = number_compare($x, $y); -// } else if ($x_type == 'boolean') { -// $ok = boolean_compare($x, $y); - } else { - $ok = ($x == $y); -// $ok = string_compare($expect, $result); - } - } - return $ok; -} - - -function parseMessage($msg) -{ - # strip line endings - #$msg = preg_replace('/\r|\n/', ' ', $msg); - $response = new SOAP_Parser($msg); - if ($response->fault) { - return $response->fault->getFault(); - } - $return = $response->getResponse(); - $v = $response->decode($return); - if (gettype($v) == 'array' && count($v)==1) { - return array_shift($v); - } - return $v; -} - -function var_dump_str($var) { - ob_start(); - var_dump($var); - $res = ob_get_contents(); - ob_end_clean(); - return $res; -} - -?> \ No newline at end of file diff --git a/ext/soap/package.xml b/ext/soap/package.xml deleted file mode 100644 index e43fd36024dba..0000000000000 --- a/ext/soap/package.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - ext_soap - Provides SOAP Services - - Description of package.... - - beta - - - rodif_bl - Brad Lafountain - rodif_bl@yahoo.com - lead - - - shane - Shane Caraveo - shane@caraveo.com - lead - - - dmitry - Dmitry Stogov - dmitry@zend.com - lead - - - PHP - - 0.1 - 2002-07-07 - alpha - - - First offical PEAR/PECL release - - - - - CREDITS - EXPERIMENTAL - TODO - config.m4 - php_encoding.c - php_encoding.h - php_http.c - php_http.h - php_packet_soap.c - php_packet_soap.h - php_schema.c - php_schema.h - php_sdl.c - php_sdl.h - php_soap.h - php_soap.h - php_xml.c - php_xml.h - soap.c - php_soap.dsp - - - diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c deleted file mode 100644 index 92c031f471df6..0000000000000 --- a/ext/soap/php_encoding.c +++ /dev/null @@ -1,3224 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include - -#include "php_soap.h" -#include "ext/libxml/php_libxml.h" -#include "ext/standard/base64.h" -#include -#include "zend_strtod.h" - -/* zval type decode */ -static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_null(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data); - -static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -/* String encode */ -static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -/* Null encode */ -static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -/* Array encode */ -static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent); - -/* Datetime encode/decode */ -static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data); -static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data); - -static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -static zval *to_zval_any(encodeTypePtr type, xmlNodePtr data); -static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -/* Try and guess for non-wsdl clients and servers */ -static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data); -static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - -static int is_map(zval *array); -static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type TSRMLS_DC); - -static xmlNodePtr check_and_resolve_href(xmlNodePtr data); - -static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret); -static void set_ns_and_type_ex(xmlNodePtr node, char *ns, char *type); - -static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type); - -#define FIND_XML_NULL(xml,zval) \ - { \ - xmlAttrPtr null; \ - if (!xml) { \ - ZVAL_NULL(zval); \ - return zval; \ - } \ - if (xml->properties) { \ - null = get_attribute(xml->properties, "nil"); \ - if (null) { \ - ZVAL_NULL(zval); \ - return zval; \ - } \ - } \ - } - -#define FIND_ZVAL_NULL(zval, xml, style) \ -{ \ - if (!zval || Z_TYPE_P(zval) == IS_NULL) { \ - if (style == SOAP_ENCODED) {\ - xmlSetProp(xml, "xsi:nil", "true"); \ - } \ - return xml; \ - } \ -} - -encode defaultEncoding[] = { - {{UNKNOWN_TYPE, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}, - - {{IS_NULL, "nil", XSI_NAMESPACE, NULL}, to_zval_null, to_xml_null}, - {{IS_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{IS_LONG, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{IS_BOOL, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{IS_CONSTANT, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map}, - {{IS_CONSTANT_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, - {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map}, - {{IS_CONSTANT_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, - {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - - {{XSD_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - - {{XSD_DATETIME, XSD_DATETIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_datetime}, - {{XSD_TIME, XSD_TIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_time}, - {{XSD_DATE, XSD_DATE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_date}, - {{XSD_GYEARMONTH, XSD_GYEARMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyearmonth}, - {{XSD_GYEAR, XSD_GYEAR_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyear}, - {{XSD_GMONTHDAY, XSD_GMONTHDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonthday}, - {{XSD_GDAY, XSD_GDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gday}, - {{XSD_GMONTH, XSD_GMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonth}, - {{XSD_DURATION, XSD_DURATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_duration}, - - {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_hexbin, to_xml_hexbin}, - {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_base64, to_xml_base64}, - - {{XSD_LONG, XSD_LONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_SHORT, XSD_SHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_BYTE, XSD_BYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NONPOSITIVEINTEGER, XSD_NONPOSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_POSITIVEINTEGER, XSD_POSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NONNEGATIVEINTEGER, XSD_NONNEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NEGATIVEINTEGER, XSD_NEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDBYTE, XSD_UNSIGNEDBYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDSHORT, XSD_UNSIGNEDSHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDINT, XSD_UNSIGNEDINT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDLONG, XSD_UNSIGNEDLONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INTEGER, XSD_INTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - - {{XSD_ANYTYPE, XSD_ANYTYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert}, - {{XSD_UR_TYPE, XSD_UR_TYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert}, - {{XSD_ANYURI, XSD_ANYURI_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_QNAME, XSD_QNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NOTATION, XSD_NOTATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NORMALIZEDSTRING, XSD_NORMALIZEDSTRING_STRING, XSD_NAMESPACE, NULL}, to_zval_stringr, to_xml_string}, - {{XSD_TOKEN, XSD_TOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_LANGUAGE, XSD_LANGUAGE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NMTOKEN, XSD_NMTOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NMTOKENS, XSD_NMTOKENS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - {{XSD_NAME, XSD_NAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NCNAME, XSD_NCNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_ID, XSD_ID_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_IDREF, XSD_IDREF_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_IDREFS, XSD_IDREFS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - {{XSD_ENTITY, XSD_ENTITY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_ENTITIES, XSD_ENTITIES_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - - {{APACHE_MAP, APACHE_MAP_STRING, APACHE_NAMESPACE, NULL}, to_zval_map, to_xml_map}, - - {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, - {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, - - /* support some of the 1999 data types */ - {{XSD_STRING, XSD_STRING_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - - {{XSD_LONG, XSD_LONG_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INT, XSD_INT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_SHORT, XSD_SHORT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_BYTE, XSD_BYTE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_1999_TIMEINSTANT, XSD_1999_TIMEINSTANT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - - {{XSD_ANYXML, "", "", NULL}, to_zval_any, to_xml_any}, - - {{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert} -}; - -void whiteSpace_replace(char* str) -{ - while (*str != '\0') { - if (*str == '\x9' || *str == '\xA' || *str == '\xD') { - *str = ' '; - } - str++; - } -} - -void whiteSpace_collapse(char* str) -{ - char *pos; - char old; - - pos = str; - whiteSpace_replace(str); - while (*str == ' ') { - str++; - } - old = '\0'; - while (*str != '\0') { - if (*str != ' ' || old != ' ') { - *pos = *str; - pos++; - } - old = *str; - str++; - } - if (old == ' ') { - --pos; - } - *pos = '\0'; -} - -xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr node = NULL; - TSRMLS_FETCH(); - - /* Special handling of class SoapVar */ - if (data && - Z_TYPE_P(data) == IS_OBJECT && - Z_OBJCE_P(data) == soap_var_class_entry) { - zval **ztype, **zdata, **zns, **zstype, **zname, **znamens; - encodePtr enc = NULL; - HashTable *ht = Z_OBJPROP_P(data); - - if (zend_hash_find(ht, "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) { - soap_error0(E_ERROR, "Encoding: SoapVar hasn't 'enc_type' propery"); - } - - if (SOAP_GLOBAL(sdl)) { - if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) { - if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) { - enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype)); - } else { - enc = get_encoder(SOAP_GLOBAL(sdl), NULL, Z_STRVAL_PP(zstype)); - } - } - } - if (enc == NULL) { - enc = get_conversion(Z_LVAL_P(*ztype)); - } - if (enc == NULL) { - enc = encode; - } - - if (zend_hash_find(ht, "enc_value", sizeof("enc_value"), (void **)&zdata) == FAILURE) { - node = master_to_xml(enc, NULL, style, parent); - } else { - node = master_to_xml(enc, *zdata, style, parent); - } - - if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) { - if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) { - if (style == SOAP_LITERAL) { - encode_add_ns(node, XSI_NAMESPACE); - } - if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) { - set_ns_and_type_ex(node, Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype)); - } else { - set_ns_and_type_ex(node, NULL, Z_STRVAL_PP(zstype)); - } - } - } - - if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS) { - xmlNodeSetName(node, Z_STRVAL_PP(zname)); - } - if (zend_hash_find(ht, "enc_namens", sizeof("enc_namens"), (void **)&znamens) == SUCCESS) { - xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_PP(znamens)); - xmlSetNs(node, nsp); - } - } else { - if (encode == NULL) { - encode = get_conversion(UNKNOWN_TYPE); - } - if (encode->to_xml_before) { - data = encode->to_xml_before(&encode->details, data); - } - if (encode->to_xml) { - node = encode->to_xml(&encode->details, data, style, parent); - } - if (encode->to_xml_after) { - node = encode->to_xml_after(&encode->details, node, style); - } - } - return node; -} - -static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data) -{ - zval *ret = NULL; - - if (encode->to_zval_before) { - data = encode->to_zval_before(&encode->details, data, 0); - } - if (encode->to_zval) { - ret = encode->to_zval(&encode->details, data); - } - if (encode->to_zval_after) { - ret = encode->to_zval_after(&encode->details, ret); - } - return ret; -} - -zval *master_to_zval(encodePtr encode, xmlNodePtr data) -{ - TSRMLS_FETCH(); - data = check_and_resolve_href(data); - - if (encode == NULL) { - encode = get_conversion(UNKNOWN_TYPE); - } else { - /* Use xsi:type if it is defined */ - xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE); - - if (type_attr != NULL) { - encodePtr enc = get_encoder_from_prefix(SOAP_GLOBAL(sdl), data, type_attr->children->content); - - if (enc != NULL && enc != encode) { - encodePtr tmp = enc; - while (tmp && - tmp->details.sdl_type != NULL && - tmp->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX) { - if (enc == tmp->details.sdl_type->encode || - tmp == tmp->details.sdl_type->encode) { - enc = NULL; - break; - } - tmp = tmp->details.sdl_type->encode; - } - if (enc != NULL) { - encode = enc; - } - } - } - } - return master_to_zval_int(encode, data); -} - -#ifdef HAVE_PHP_DOMXML -zval *to_xml_before_user(encodeTypePtr type, zval *data) -{ - TSRMLS_FETCH(); - - if (type.map->map_functions.to_xml_before) { - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml_before, data, 1, &data TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_xml_before"); - } - } - return data; -} - -xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - zval *ret, **addr; - xmlNodePtr node; - TSRMLS_FETCH(); - - if (type.map->map_functions.to_xml) { - MAKE_STD_ZVAL(ret); - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml, ret, 1, &data TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_xml"); - } - - if (Z_TYPE_P(ret) != IS_OBJECT) { - soap_error0(E_ERROR, "Encoding: Error serializing object from to_xml_user"); - } - - if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) { - node = (xmlNodePtr)Z_LVAL_PP(addr); - node = xmlCopyNode(node, 1); - set_ns_and_type(node, type); - } - zval_ptr_dtor(&ret); - } - return node; -} - -xmlNodePtr to_xml_after_user(encodeTypePtr type, xmlNodePtr node, int style) -{ - zval *ret, *param, **addr; - int found; - TSRMLS_FETCH(); - - if (type.map->map_functions.to_xml_after) { - MAKE_STD_ZVAL(ret); - MAKE_STD_ZVAL(param); - param = php_domobject_new(node, &found, NULL TSRMLS_CC); - - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml_after, ret, 1, ¶m TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_xml_after"); - } - if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) { - node = (xmlNodePtr)Z_LVAL_PP(addr); - set_ns_and_type(node, type); - } - zval_ptr_dtor(&ret); - zval_ptr_dtor(¶m); - } - return node; -} - -xmlNodePtr to_zval_before_user(encodeTypePtr type, xmlNodePtr node, int style) -{ - zval *ret, *param, **addr; - int found; - TSRMLS_FETCH(); - - if (type.map->map_functions.to_zval_before) { - MAKE_STD_ZVAL(ret); - MAKE_STD_ZVAL(param); - param = php_domobject_new(node, &found, NULL TSRMLS_CC); - - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval_before, ret, 1, ¶m TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_zval_before"); - } - if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) { - node = (xmlNodePtr)Z_LVAL_PP(addr); - set_ns_and_type(node, type); - } - zval_ptr_dtor(&ret); - zval_ptr_dtor(¶m); - } - return node; -} - -zval *to_zval_user(encodeTypePtr type, xmlNodePtr node) -{ - zval *ret, *param; - int found; - TSRMLS_FETCH(); - - if (type.map->map_functions.to_zval) { - MAKE_STD_ZVAL(ret); - MAKE_STD_ZVAL(param); - param = php_domobject_new(node, &found, NULL TSRMLS_CC); - - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval, ret, 1, ¶m TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_zval"); - } - zval_ptr_dtor(¶m); - efree(param); - } - return ret; -} - -zval *to_zval_after_user(encodeTypePtr type, zval *data) -{ - TSRMLS_FETCH(); - - if (type.map->map_functions.to_zval_after) { - if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval_after, data, 1, &data TSRMLS_CC) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_zval_after"); - } - } - return data; -} -#endif - -/* TODO: get rid of "bogus".. ither by passing in the already created xmlnode or passing in the node name */ -/* String encode/decode */ -static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - TSRMLS_FETCH(); - - if (SOAP_GLOBAL(encoding) != NULL) { - xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content)); - xmlBufferPtr out = xmlBufferCreate(); - int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in); - - if (n >= 0) { - ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - xmlBufferFree(out); - xmlBufferFree(in); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { - ZVAL_STRING(ret, data->children->content, 1); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_EMPTY_STRING(ret); - } - return ret; -} - -static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - TSRMLS_FETCH(); - - whiteSpace_replace(data->children->content); - if (SOAP_GLOBAL(encoding) != NULL) { - xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content)); - xmlBufferPtr out = xmlBufferCreate(); - int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in); - - if (n >= 0) { - ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - xmlBufferFree(out); - xmlBufferFree(in); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { - ZVAL_STRING(ret, data->children->content, 1); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_EMPTY_STRING(ret); - } - return ret; -} - -static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - TSRMLS_FETCH(); - - whiteSpace_collapse(data->children->content); - if (SOAP_GLOBAL(encoding) != NULL) { - xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content)); - xmlBufferPtr out = xmlBufferCreate(); - int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in); - - if (n >= 0) { - ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - xmlBufferFree(out); - xmlBufferFree(in); - } else { - ZVAL_STRING(ret, data->children->content, 1); - } - } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { - ZVAL_STRING(ret, data->children->content, 1); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_EMPTY_STRING(ret); - } - return ret; -} - -static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - char *str; - int str_len; - - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - whiteSpace_collapse((char*)data->children->content); - str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len); - ZVAL_STRINGL(ret, str, str_len, 0); - } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { - str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len); - ZVAL_STRINGL(ret, str, str_len, 0); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_EMPTY_STRING(ret); - } - return ret; -} - -static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - unsigned char *str; - int str_len, i, j; - unsigned char c; - - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - whiteSpace_collapse((char*)data->children->content); - } else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - return ret; - } - str_len = strlen((char*)data->children->content) / 2; - str = emalloc(str_len+1); - for (i = j = 0; i < str_len; i++) { - c = data->children->content[j++]; - if (c >= '0' && c <= '9') { - str[i] = (c - '0') << 4; - } else if (c >= 'a' && c <= 'f') { - str[i] = (c - 'a' + 10) << 4; - } else if (c >= 'A' && c <= 'F') { - str[i] = (c - 'A' + 10) << 4; - } - c = data->children->content[j++]; - if (c >= '0' && c <= '9') { - str[i] |= c - '0'; - } else if (c >= 'a' && c <= 'f') { - str[i] |= c - 'a' + 10; - } else if (c >= 'A' && c <= 'F') { - str[i] |= c - 'A' + 10; - } - } - str[str_len] = '\0'; - ZVAL_STRINGL(ret, (char*)str, str_len, 0); - } else { - ZVAL_EMPTY_STRING(ret); - } - return ret; -} - -static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - char *str; - int new_len; - TSRMLS_FETCH(); - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - if (Z_TYPE_P(data) == IS_STRING) { - str = php_escape_html_entities(Z_STRVAL_P(data), Z_STRLEN_P(data), &new_len, 0, 0, NULL TSRMLS_CC); - } else { - zval tmp = *data; - - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - str = php_escape_html_entities(Z_STRVAL(tmp), Z_STRLEN(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - zval_dtor(&tmp); - } - - if (SOAP_GLOBAL(encoding) != NULL) { - xmlBufferPtr in = xmlBufferCreateStatic(str, new_len); - xmlBufferPtr out = xmlBufferCreate(); - int n = xmlCharEncInFunc(SOAP_GLOBAL(encoding), out, in); - - if (n >= 0) { - efree(str); - str = estrdup(xmlBufferContent(out)); - new_len = n; - } else if (!php_libxml_xmlCheckUTF8(str)) { - soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str); - } - xmlBufferFree(out); - xmlBufferFree(in); - } else if (!php_libxml_xmlCheckUTF8(str)) { - soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str); - } - - xmlNodeSetContentLen(ret, str, new_len); - efree(str); - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - unsigned char *str; - int str_len; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - if (Z_TYPE_P(data) == IS_STRING) { - str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len); - xmlNodeSetContentLen(ret, str, str_len); - efree(str); - } else { - zval tmp = *data; - - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len); - xmlNodeSetContentLen(ret, str, str_len); - efree(str); - zval_dtor(&tmp); - } - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - static char hexconvtab[] = "0123456789ABCDEF"; - xmlNodePtr ret; - unsigned char *str; - zval tmp; - int i, j; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - if (Z_TYPE_P(data) != IS_STRING) { - tmp = *data; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - data = &tmp; - } - str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1); - - for (i = j = 0; i < Z_STRLEN_P(data); i++) { - str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4]; - str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) & 15]; - } - str[j] = '\0'; - - xmlNodeSetContentLen(ret, str, Z_STRLEN_P(data) * 2 * sizeof(char)); - efree(str); - if (data == &tmp) { - zval_dtor(&tmp); - } - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - whiteSpace_collapse(data->children->content); - ZVAL_DOUBLE(ret, atof(data->children->content)); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_NULL(ret); - } - return ret; -} - -static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - whiteSpace_collapse(data->children->content); - errno = 0; - ret->value.lval = strtol(data->children->content, NULL, 0); - if (errno == ERANGE) { /* overflow */ - ret->value.dval = zend_strtod(data->children->content, NULL); - ret->type = IS_DOUBLE; - } else { - ret->type = IS_LONG; - } - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_NULL(ret); - } - return ret; -} - -static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - if (Z_TYPE_P(data) == IS_DOUBLE) { - char s[256]; - - sprintf(s, "%0.0f",floor(Z_DVAL_P(data))); - xmlNodeSetContent(ret, s); - } else { - zval tmp = *data; - - zval_copy_ctor(&tmp); - if (Z_TYPE(tmp) != IS_LONG) { - convert_to_long(&tmp); - } - convert_to_string(&tmp); - xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp)); - zval_dtor(&tmp); - } - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - zval tmp; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - tmp = *data; - zval_copy_ctor(&tmp); - if (Z_TYPE(tmp) != IS_DOUBLE) { - convert_to_double(&tmp); - } - convert_to_string(&tmp); - xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp)); - zval_dtor(&tmp); - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - - if (data && data->children) { - if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - whiteSpace_collapse(data->children->content); - if (stricmp(data->children->content,"true") == 0 || - stricmp(data->children->content,"t") == 0 || - strcmp(data->children->content,"1") == 0) { - ZVAL_BOOL(ret, 1); - } else { - ZVAL_BOOL(ret, 0); - } - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - } else { - ZVAL_NULL(ret); - } - return ret; -} - -static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - zval tmp; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - - if (Z_TYPE_P(data) != IS_BOOL) { - tmp = *data; - zval_copy_ctor(&tmp); - convert_to_boolean(data); - data = &tmp; - } - - if (data->value.lval == 1) { - xmlNodeSetContent(ret, "true"); - } else { - xmlNodeSetContent(ret, "false"); - } - - if (data == &tmp) { - zval_dtor(&tmp); - } - - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, type); - } - return ret; -} - -/* Null encode/decode */ -static zval *to_zval_null(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - ZVAL_NULL(ret); - return ret; -} - -static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - if (style == SOAP_ENCODED) { - xmlSetProp(ret, "xsi:nil", "true"); - } - return ret; -} - -static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC) -{ - zend_class_entry *old_scope; - - old_scope = EG(scope); - EG(scope) = Z_OBJCE_P(object); -#ifdef ZEND_ENGINE_2 - val->refcount--; -#endif - add_property_zval(object, name, val); - EG(scope) = old_scope; -} - -static zval* get_zval_property(zval* object, char* name TSRMLS_DC) -{ - if (Z_TYPE_P(object) == IS_OBJECT) { - zval member; - zval *data; - zend_class_entry *old_scope; - - ZVAL_STRING(&member, name, 0); - old_scope = EG(scope); - EG(scope) = Z_OBJCE_P(object); - data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS TSRMLS_CC); - if (data == EG(uninitialized_zval_ptr)) { - /* Hack for bug #32455 */ - zend_property_info *property_info; - - property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC); - EG(scope) = old_scope; - if (property_info && zend_hash_quick_exists(Z_OBJPROP_P(object), property_info->name, property_info->name_length+1, property_info->h)) { - return data; - } - return NULL; - } - EG(scope) = old_scope; - return data; - } else if (Z_TYPE_P(object) == IS_ARRAY) { - zval **data_ptr; - - if (zend_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) { - return *data_ptr; - } - } - return NULL; -} - -static void unset_zval_property(zval* object, char* name TSRMLS_DC) -{ - if (Z_TYPE_P(object) == IS_OBJECT) { - zval member; - zend_class_entry *old_scope; - - ZVAL_STRING(&member, name, 0); - old_scope = EG(scope); - EG(scope) = Z_OBJCE_P(object); - Z_OBJ_HT_P(object)->unset_property(object, &member TSRMLS_CC); - EG(scope) = old_scope; - } else if (Z_TYPE_P(object) == IS_ARRAY) { - zend_hash_del(Z_ARRVAL_P(object), name, strlen(name)+1); - } -} - -static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC) -{ - zval* any = NULL; - - while (node != NULL) { - if (get_zval_property(ret, (char*)node->name TSRMLS_CC) == NULL) { - zval* val = master_to_zval(get_conversion(XSD_ANYXML), node); - if (get_attribute_ex(node->properties,"type", XSI_NAMESPACE) == NULL && - Z_TYPE_P(val) == IS_STRING) { - while (node->next != NULL && - get_zval_property(ret, (char*)node->next->name TSRMLS_CC) == NULL && - get_attribute_ex(node->next->properties,"type", XSI_NAMESPACE) == NULL) { - zval* val2 = master_to_zval(get_conversion(XSD_ANYXML), node->next); - if (Z_TYPE_P(val2) != IS_STRING) { - break; - } - add_string_to_string(val, val, val2); - zval_ptr_dtor(&val2); - node = node->next; - } - } - if (any == NULL) { - any = val; - } else { - if (Z_TYPE_P(any) != IS_ARRAY) { - /* Convert into array */ - zval *arr; - - MAKE_STD_ZVAL(arr); - array_init(arr); - add_next_index_zval(arr, any); - any = arr; - } - /* Add array element */ - add_next_index_zval(any, val); - } - } - node = node->next; - } - if (any) { - set_zval_property(ret, "any", any TSRMLS_CC); - } -} - -static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl TSRMLS_DC) -{ - switch (model->kind) { - case XSD_CONTENT_ELEMENT: - if (model->u.element->name) { - xmlNodePtr node = get_node(data->children, model->u.element->name); - if (node) { - zval *val; - - if (node && node->children && node->children->content) { - if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); - } - val = master_to_zval(model->u.element->encode, node); - } else if (model->u.element->fixed) { - xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS"); - xmlNodeSetContent(dummy, model->u.element->fixed); - val = master_to_zval(model->u.element->encode, dummy); - xmlFreeNode(dummy); - } else if (model->u.element->def && !model->u.element->nillable) { - xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS"); - xmlNodeSetContent(dummy, model->u.element->def); - val = master_to_zval(model->u.element->encode, dummy); - xmlFreeNode(dummy); - } else { - val = master_to_zval(model->u.element->encode, node); - } - if ((node = get_node(node->next, model->u.element->name)) != NULL) { - zval *array; - - MAKE_STD_ZVAL(array); - array_init(array); - add_next_index_zval(array, val); - do { - if (node && node->children && node->children->content) { - if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); - } - val = master_to_zval(model->u.element->encode, node); - } else if (model->u.element->fixed) { - xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS"); - xmlNodeSetContent(dummy, model->u.element->fixed); - val = master_to_zval(model->u.element->encode, dummy); - xmlFreeNode(dummy); - } else if (model->u.element->def && !model->u.element->nillable) { - xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS"); - xmlNodeSetContent(dummy, model->u.element->def); - val = master_to_zval(model->u.element->encode, dummy); - xmlFreeNode(dummy); - } else { - val = master_to_zval(model->u.element->encode, node); - } - add_next_index_zval(array, val); - } while ((node = get_node(node->next, model->u.element->name)) != NULL); - val = array; - } - set_zval_property(ret, model->u.element->name, val TSRMLS_CC); - } - } - break; - case XSD_CONTENT_ALL: - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - HashPosition pos; - sdlContentModelPtr any = NULL; - - zend_hash_internal_pointer_reset_ex(model->u.content, &pos); - while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if ((*tmp)->kind == XSD_CONTENT_ANY) { - any = *tmp; - } else { - model_to_zval_object(ret, *tmp, data, sdl TSRMLS_CC); - } - zend_hash_move_forward_ex(model->u.content, &pos); - } - if (any) { - model_to_zval_any(ret, data->children TSRMLS_CC); - } - break; - } - case XSD_CONTENT_GROUP: - model_to_zval_object(ret, model->u.group->model, data, sdl TSRMLS_CC); - break; - default: - break; - } -} - -/* Struct encode/decode */ -static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - xmlNodePtr trav; - sdlPtr sdl; - sdlTypePtr sdlType = type->sdl_type; - zend_class_entry *ce; - zend_bool redo_any = 0; - TSRMLS_FETCH(); - - ce = ZEND_STANDARD_CLASS_DEF_PTR; - if (SOAP_GLOBAL(class_map) && type->type_str) { - zval **classname; - zend_class_entry *tmp; - - if (zend_hash_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str)+1, (void**)&classname) == SUCCESS && - Z_TYPE_PP(classname) == IS_STRING && - (tmp = zend_fetch_class(Z_STRVAL_PP(classname), Z_STRLEN_PP(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) { - ce = tmp; - } - } - sdl = SOAP_GLOBAL(sdl); - if (sdlType) { - if (sdlType->kind == XSD_TYPEKIND_RESTRICTION && - sdlType->encode && type != &sdlType->encode->details) { - encodePtr enc; - - enc = sdlType->encode; - while (enc && enc->details.sdl_type && - enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && - enc->details.sdl_type->kind != XSD_TYPEKIND_LIST && - enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - enc = enc->details.sdl_type->encode; - } - if (enc) { - zval *base; - - MAKE_STD_ZVAL(ret); - - object_init_ex(ret, ce); - base = master_to_zval_int(enc, data); - set_zval_property(ret, "_", base TSRMLS_CC); - } else { - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - object_init_ex(ret, ce); - } - } else if (sdlType->kind == XSD_TYPEKIND_EXTENSION && - sdlType->encode && - type != &sdlType->encode->details) { - if (sdlType->encode->details.sdl_type && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - ret = master_to_zval_int(sdlType->encode, data); - FIND_XML_NULL(data, ret); - if (get_zval_property(ret, "any" TSRMLS_CC) != NULL) { - unset_zval_property(ret, "any" TSRMLS_CC); - redo_any = 1; - } - } else { - zval *base; - - MAKE_STD_ZVAL(ret); - - object_init_ex(ret, ce); - base = master_to_zval_int(sdlType->encode, data); - set_zval_property(ret, "_", base TSRMLS_CC); - } - } else { - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - object_init_ex(ret, ce); - } - if (sdlType->model) { - model_to_zval_object(ret, sdlType->model, data, sdl TSRMLS_CC); - if (redo_any && get_zval_property(ret, "any" TSRMLS_CC) == NULL) { - model_to_zval_any(ret, data->children TSRMLS_CC); - } - } - if (sdlType->attributes) { - sdlAttributePtr *attr; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(sdlType->attributes, &pos); - while (zend_hash_get_current_data_ex(sdlType->attributes, (void**)&attr, &pos) == SUCCESS) { - if ((*attr)->name) { - xmlAttrPtr val = get_attribute(data->properties, (*attr)->name); - xmlChar *str_val = NULL; - - if (val && val->children && val->children->content) { - str_val = val->children->content; - if ((*attr)->fixed && strcmp((*attr)->fixed,str_val) != 0) { - soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, str_val); - } - } else if ((*attr)->fixed) { - str_val = (*attr)->fixed; - } else if ((*attr)->def) { - str_val = (*attr)->def; - } - if (str_val) { - xmlNodePtr dummy; - zval *data; - - dummy = xmlNewNode(NULL, "BOGUS"); - xmlNodeSetContent(dummy, str_val); - data = master_to_zval((*attr)->encode, dummy); - xmlFreeNode(dummy); - set_zval_property(ret, (*attr)->name, data TSRMLS_CC); - } - } - zend_hash_move_forward_ex(sdlType->attributes, &pos); - } - } - } else { - - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - object_init_ex(ret, ce); - - trav = data->children; - - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - zval *tmpVal; - zval *prop; - - tmpVal = master_to_zval(NULL, trav); - - prop = get_zval_property(ret, (char*)trav->name TSRMLS_CC); - if (!prop) { - set_zval_property(ret, (char*)trav->name, tmpVal TSRMLS_CC); - } else { - /* Property already exist - make array */ - if (Z_TYPE_P(prop) != IS_ARRAY) { - /* Convert into array */ - zval *arr; - - MAKE_STD_ZVAL(arr); - array_init(arr); - prop->refcount++; - add_next_index_zval(arr, prop); - set_zval_property(ret, (char*)trav->name, arr TSRMLS_CC); - prop = arr; - } - /* Add array element */ - add_next_index_zval(prop, tmpVal); - } - } - trav = trav->next; - } - } - return ret; -} - -static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict TSRMLS_DC) -{ - switch (model->kind) { - case XSD_CONTENT_ELEMENT: { - zval *data; - xmlNodePtr property; - encodePtr enc; - - data = get_zval_property(object, model->u.element->name TSRMLS_CC); - if (data) { - enc = model->u.element->encode; - if ((model->max_occurs == -1 || model->max_occurs > 1) && - Z_TYPE_P(data) == IS_ARRAY && - !is_map(data)) { - HashTable *ht = Z_ARRVAL_P(data); - zval **val; - - zend_hash_internal_pointer_reset(ht); - while (zend_hash_get_current_data(ht,(void**)&val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_NULL && model->u.element->nillable) { - property = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(node, property); - if (style == SOAP_ENCODED) { - xmlSetProp(property, "xsi:nil", "true"); - } else { - xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE); - xmlSetNsProp(property, xsi, "nil", "true"); - } - } else { - property = master_to_xml(enc, *val, style, node); - if (property->children && property->children->content && - model->u.element->fixed && strcmp(model->u.element->fixed,property->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); - } - } - xmlNodeSetName(property, model->u.element->name); - if (style == SOAP_LITERAL && - model->u.element->namens && - model->u.element->form == XSD_FORM_QUALIFIED) { - xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); - xmlSetNs(property, nsp); - } - zend_hash_move_forward(ht); - } - } else { - if (Z_TYPE_P(data) == IS_NULL && model->u.element->nillable) { - property = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(node, property); - if (style == SOAP_ENCODED) { - xmlSetProp(property, "xsi:nil", "true"); - } else { - xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE); - xmlSetNsProp(property, xsi, "nil", "true"); - } - } else { - property = master_to_xml(enc, data, style, node); - if (property->children && property->children->content && - model->u.element->fixed && strcmp(model->u.element->fixed,property->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); - } - } - xmlNodeSetName(property, model->u.element->name); - if (style == SOAP_LITERAL && - model->u.element->namens && - model->u.element->form == XSD_FORM_QUALIFIED) { - xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); - xmlSetNs(property, nsp); - } - } - return 1; - } else if (strict && model->u.element->nillable && model->min_occurs > 0) { - property = xmlNewNode(NULL,model->u.element->name); - xmlAddChild(node, property); - if (style == SOAP_ENCODED) { - xmlSetProp(property, "xsi:nil", "true"); - } else { - xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE); - xmlSetNsProp(property, xsi, "nil", "true"); - } - if (style == SOAP_LITERAL && - model->u.element->namens && - model->u.element->form == XSD_FORM_QUALIFIED) { - xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); - xmlSetNs(property, nsp); - } - return 1; - } else if (model->min_occurs == 0) { - return 2; - } else { - if (strict) { - soap_error1(E_ERROR, "Encoding: object hasn't '%s' property", model->u.element->name); - } - return 0; - } - break; - } - case XSD_CONTENT_ANY: { - zval *data; - xmlNodePtr property; - encodePtr enc; - - data = get_zval_property(object, "any" TSRMLS_CC); - if (data) { - enc = get_conversion(XSD_ANYXML); - if ((model->max_occurs == -1 || model->max_occurs > 1) && - Z_TYPE_P(data) == IS_ARRAY && - !is_map(data)) { - HashTable *ht = Z_ARRVAL_P(data); - zval **val; - - zend_hash_internal_pointer_reset(ht); - while (zend_hash_get_current_data(ht,(void**)&val) == SUCCESS) { - property = master_to_xml(enc, *val, style, node); - zend_hash_move_forward(ht); - } - } else { - property = master_to_xml(enc, data, style, node); - } - return 1; - } else if (model->min_occurs == 0) { - return 2; - } else { - if (strict) { - soap_error0(E_ERROR, "Encoding: object hasn't 'any' property"); - } - return 0; - } - break; - } - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: { - sdlContentModelPtr *tmp; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(model->u.content, &pos); - while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if (!model_to_xml_object(node, *tmp, object, style, model->min_occurs > 0 TSRMLS_CC)) { - return 0; - } - zend_hash_move_forward_ex(model->u.content, &pos); - } - return 1; - } - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - HashPosition pos; - int ret = 0; - - zend_hash_internal_pointer_reset_ex(model->u.content, &pos); - while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - int tmp_ret = model_to_xml_object(node, *tmp, object, style, 0 TSRMLS_CC); - if (tmp_ret == 1) { - return 1; - } else if (tmp_ret != 0) { - ret = 1; - } - zend_hash_move_forward_ex(model->u.content, &pos); - } - return ret; - } - case XSD_CONTENT_GROUP: { - return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC); - } - default: - break; - } - return 1; -} - -static sdlTypePtr model_array_element(sdlContentModelPtr model) -{ - switch (model->kind) { - case XSD_CONTENT_ELEMENT: { - if (model->max_occurs == -1 || model->max_occurs > 1) { - return model->u.element; - } else { - return NULL; - } - } - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - HashPosition pos; - - if (zend_hash_num_elements(model->u.content) != 1) { - return NULL; - } - zend_hash_internal_pointer_reset_ex(model->u.content, &pos); - zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos); - return model_array_element(*tmp); - } - case XSD_CONTENT_GROUP: { - return model_array_element(model->u.group->model); - } - default: - break; - } - return NULL; -} - -static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr xmlParam; - HashTable *prop; - int i; - sdlTypePtr sdlType = type->sdl_type; - TSRMLS_FETCH(); - - if (!data || Z_TYPE_P(data) == IS_NULL) { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - if (style == SOAP_ENCODED) { - xmlSetProp(xmlParam, "xsi:nil", "true"); - } - return xmlParam; - } - - if (sdlType) { - prop = NULL; - if (Z_TYPE_P(data) == IS_OBJECT) { - prop = Z_OBJPROP_P(data); - } else if (Z_TYPE_P(data) == IS_ARRAY) { - prop = Z_ARRVAL_P(data); - } - if (sdlType->kind == XSD_TYPEKIND_RESTRICTION && - sdlType->encode && type != &sdlType->encode->details) { - encodePtr enc; - - enc = sdlType->encode; - while (enc && enc->details.sdl_type && - enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && - enc->details.sdl_type->kind != XSD_TYPEKIND_LIST && - enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - enc = enc->details.sdl_type->encode; - } - if (enc) { - zval *tmp = get_zval_property(data, "_" TSRMLS_CC); - if (tmp) { - xmlParam = master_to_xml(enc, tmp, style, parent); - } else if (prop == NULL) { - xmlParam = master_to_xml(enc, data, style, parent); - } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - } - } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - } - } else if (sdlType->kind == XSD_TYPEKIND_EXTENSION && - sdlType->encode && type != &sdlType->encode->details) { - if (sdlType->encode->details.sdl_type && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST && - sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - xmlParam = master_to_xml(sdlType->encode, data, style, parent); - } else { - zval *tmp = get_zval_property(data, "_" TSRMLS_CC); - - if (tmp) { - xmlParam = master_to_xml(sdlType->encode, tmp, style, parent); - } else if (prop == NULL) { - xmlParam = master_to_xml(sdlType->encode, data, style, parent); - } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - } - } - } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - } - FIND_ZVAL_NULL(data, xmlParam, style); - - if (prop != NULL) { - sdlTypePtr array_el; - - if (Z_TYPE_P(data) == IS_ARRAY && - !is_map(data) && - sdlType->attributes == NULL && - sdlType->model != NULL && - (array_el = model_array_element(sdlType->model)) != NULL) { - zval **val; - - zend_hash_internal_pointer_reset(prop); - while (zend_hash_get_current_data(prop,(void**)&val) == SUCCESS) { - xmlNodePtr property; - if (Z_TYPE_PP(val) == IS_NULL && array_el->nillable) { - property = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(xmlParam, property); - if (style == SOAP_ENCODED) { - xmlSetProp(property, "xsi:nil", "true"); - } else { - xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE); - xmlSetNsProp(property, xsi, "nil", "true"); - } - } else { - property = master_to_xml(array_el->encode, *val, style, xmlParam); - } - xmlNodeSetName(property, array_el->name); - if (style == SOAP_LITERAL && - array_el->namens && - array_el->form == XSD_FORM_QUALIFIED) { - xmlNsPtr nsp = encode_add_ns(property, array_el->namens); - xmlSetNs(property, nsp); - } - zend_hash_move_forward(prop); - } - } else if (sdlType->model) { - model_to_xml_object(xmlParam, sdlType->model, data, style, 1 TSRMLS_CC); - } - if (sdlType->attributes) { - sdlAttributePtr *attr; - zval *zattr; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(sdlType->attributes, &pos); - while (zend_hash_get_current_data_ex(sdlType->attributes, (void**)&attr, &pos) == SUCCESS) { - if ((*attr)->name) { - zattr = get_zval_property(data, (*attr)->name TSRMLS_CC); - if (zattr) { - xmlNodePtr dummy; - - dummy = master_to_xml((*attr)->encode, zattr, SOAP_LITERAL, xmlParam); - if (dummy->children && dummy->children->content) { - if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content); - } - /* we need to handle xml: namespace specially, since it is - an implicit schema. Otherwise, use form. - */ - if ((*attr)->namens && - (!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) || - (*attr)->form == XSD_FORM_QUALIFIED)) { - xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens); - - xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content); - } else { - xmlSetProp(xmlParam, (*attr)->name, dummy->children->content); - } - } - xmlUnlinkNode(dummy); - xmlFreeNode(dummy); - } - } - zend_hash_move_forward_ex(sdlType->attributes, &pos); - } - } - } - if (style == SOAP_ENCODED) { - set_ns_and_type(xmlParam, type); - } - } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - FIND_ZVAL_NULL(data, xmlParam, style); - - prop = NULL; - if (Z_TYPE_P(data) == IS_OBJECT) { - prop = Z_OBJPROP_P(data); - } else if (Z_TYPE_P(data) == IS_ARRAY) { - prop = Z_ARRVAL_P(data); - } - if (prop != NULL) { - i = zend_hash_num_elements(prop); - zend_hash_internal_pointer_reset(prop); - - for (;i > 0;i--) { - xmlNodePtr property; - zval **zprop; - char *str_key; - ulong index; - int key_type; - - key_type = zend_hash_get_current_key(prop, &str_key, &index, FALSE); - zend_hash_get_current_data(prop, (void **)&zprop); - - property = master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam); - - if (key_type == HASH_KEY_IS_STRING) { - char *prop_name; - - if (Z_TYPE_P(data) == IS_OBJECT) { - char *class_name; - - zend_unmangle_property_name(str_key, &class_name, &prop_name); - } else { - prop_name = str_key; - } - if (prop_name) { - xmlNodeSetName(property, prop_name); - } - } - zend_hash_move_forward(prop); - } - } - if (style == SOAP_ENCODED) { - set_ns_and_type(xmlParam, type); - } - } - return xmlParam; -} - -/* Array encode/decode */ -static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - encodePtr enc = NULL; - - if (data && Z_TYPE_P(data) == IS_ARRAY) { - if (is_map(data)) { - enc = get_conversion(APACHE_MAP); - } else { - enc = get_conversion(SOAP_ENC_ARRAY); - } - } - if (!enc) { - enc = get_conversion(IS_NULL); - } - - return master_to_xml(enc, data, style, parent); -} - -static int calc_dimension_12(const char* str) -{ - int i = 0, flag = 0; - while (*str != '\0' && (*str < '0' || *str > '9') && (*str != '*')) { - str++; - } - if (*str == '*') { - i++; - str++; - } - while (*str != '\0') { - if (*str >= '0' && *str <= '9') { - if (flag == 0) { - i++; - flag = 1; - } - } else if (*str == '*') { - soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); - } else { - flag = 0; - } - str++; - } - return i; -} - -static int* get_position_12(int dimension, const char* str) -{ - int *pos; - int i = -1, flag = 0; - - pos = safe_emalloc(sizeof(int), dimension, 0); - memset(pos,0,sizeof(int)*dimension); - while (*str != '\0' && (*str < '0' || *str > '9') && (*str != '*')) { - str++; - } - if (*str == '*') { - str++; - i++; - } - while (*str != '\0') { - if (*str >= '0' && *str <= '9') { - if (flag == 0) { - i++; - flag = 1; - } - pos[i] = (pos[i]*10)+(*str-'0'); - } else if (*str == '*') { - soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); - } else { - flag = 0; - } - str++; - } - return pos; -} - -static int calc_dimension(const char* str) -{ - int i = 1; - while (*str != ']' && *str != '\0') { - if (*str == ',') { - i++; - } - str++; - } - return i; -} - -static void get_position_ex(int dimension, const char* str, int** pos) -{ - int i = 0; - - memset(*pos,0,sizeof(int)*dimension); - while (*str != ']' && *str != '\0' && i < dimension) { - if (*str >= '0' && *str <= '9') { - (*pos)[i] = ((*pos)[i]*10)+(*str-'0'); - } else if (*str == ',') { - i++; - } - str++; - } -} - -static int* get_position(int dimension, const char* str) -{ - int *pos; - - pos = safe_emalloc(sizeof(int), dimension, 0); - get_position_ex(dimension, str, &pos); - return pos; -} - -static void add_xml_array_elements(xmlNodePtr xmlParam, - sdlTypePtr type, - encodePtr enc, - xmlNsPtr ns, - int dimension , - int* dims, - zval* data, - int style) -{ - int j; - - if (data && Z_TYPE_P(data) == IS_ARRAY) { - zend_hash_internal_pointer_reset(data->value.ht); - for (j=0; jvalue.ht, (void **)&zdata) != SUCCESS) { - zdata = NULL; - } - if (dimension == 1) { - xmlNodePtr xparam; - - if (zdata) { - if (enc == NULL) { - xparam = master_to_xml(get_conversion((*zdata)->type), (*zdata), style, xmlParam); - } else { - xparam = master_to_xml(enc, (*zdata), style, xmlParam); - } - } else { - xparam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(xmlParam, xparam); - } - - if (type) { - xmlNodeSetName(xparam, type->name); - } else if (style == SOAP_LITERAL && enc && enc->details.type_str) { - xmlNodeSetName(xparam, enc->details.type_str); - xmlSetNs(xparam, ns); - } else { - xmlNodeSetName(xparam, "item"); - } - } else { - if (zdata) { - add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, *zdata, style); - } else { - add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style); - } - } - zend_hash_move_forward(data->value.ht); - } - } else { - for (j=0; jname); - } else if (style == SOAP_LITERAL && enc && enc->details.type_str) { - xmlNodeSetName(xparam, enc->details.type_str); - xmlSetNs(xparam, ns); - } else { - xmlNodeSetName(xparam, "item"); - } - } else { - add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style); - } - } - } -} - -static inline int array_num_elements(HashTable* ht) -{ - if (ht->pListTail && ht->pListTail->nKeyLength == 0) { - return ht->pListTail->h-1; - } - return 0; -} - -static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - sdlTypePtr sdl_type = type->sdl_type; - sdlTypePtr element_type = NULL; - smart_str array_type = {0}, array_size = {0}; - int i; - xmlNodePtr xmlParam; - encodePtr enc = NULL; - int dimension = 1; - int* dims; - int soap_version; - - TSRMLS_FETCH(); - - soap_version = SOAP_GLOBAL(soap_version); - - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - - FIND_ZVAL_NULL(data, xmlParam, style); - - if (Z_TYPE_P(data) == IS_ARRAY) { - sdlAttributePtr *arrayType; - sdlExtraAttributePtr *ext; - sdlTypePtr elementType; - - i = zend_hash_num_elements(Z_ARRVAL_P(data)); - - if (sdl_type && - sdl_type->attributes && - zend_hash_find(sdl_type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", - sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { - - char *value, *end; - zval** el; - - value = estrdup((*ext)->val); - end = strrchr(value,'['); - if (end) { - *end = '\0'; - end++; - dimension = calc_dimension(end); - } - if ((*ext)->ns != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, value); - get_type_str(xmlParam, (*ext)->ns, value, &array_type); - } else { - smart_str_appends(&array_type, value); - } - - dims = safe_emalloc(sizeof(int), dimension, 0); - dims[0] = i; - el = &data; - for (i = 1; i < dimension; i++) { - if (el != NULL && Z_TYPE_PP(el) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_PP(el)) > 0) { - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(el)); - zend_hash_get_current_data(Z_ARRVAL_PP(el), (void**)&el); - if (Z_TYPE_PP(el) == IS_ARRAY) { - dims[i] = zend_hash_num_elements(Z_ARRVAL_PP(el)); - } else { - dims[i] = 0; - } - } - } - - smart_str_append_long(&array_size, dims[0]); - for (i=1; iattributes && - zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", - sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":itemType"), (void **)&ext) == SUCCESS) { - if ((*ext)->ns != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, (*ext)->val); - get_type_str(xmlParam, (*ext)->ns, (*ext)->val, &array_type); - } else { - smart_str_appends(&array_type, (*ext)->val); - } - if (zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", - sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) { - dimension = calc_dimension_12((*ext)->val); - dims = get_position_12(dimension, (*ext)->val); - if (dims[0] == 0) {dims[0] = i;} - - smart_str_append_long(&array_size, dims[0]); - for (i=1; iattributes && - zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", - sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) { - dimension = calc_dimension_12((*ext)->val); - dims = get_position_12(dimension, (*ext)->val); - if (dims[0] == 0) {dims[0] = i;} - - smart_str_append_long(&array_size, dims[0]); - for (i=1; ielements && - zend_hash_num_elements(sdl_type->elements) == 1 && - (zend_hash_internal_pointer_reset(sdl_type->elements), - zend_hash_get_current_data(sdl_type->elements, (void**)&elementType) == SUCCESS) && - (elementType = *(sdlTypePtr*)elementType) != NULL && - elementType->encode && elementType->encode->details.type_str) { - element_type = elementType; - enc = elementType->encode; - get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type); - } else { - enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC); - } - } else if (sdl_type && sdl_type->elements && - zend_hash_num_elements(sdl_type->elements) == 1 && - (zend_hash_internal_pointer_reset(sdl_type->elements), - zend_hash_get_current_data(sdl_type->elements, (void**)&elementType) == SUCCESS) && - (elementType = *(sdlTypePtr*)elementType) != NULL && - elementType->encode && elementType->encode->details.type_str) { - - element_type = elementType; - enc = elementType->encode; - get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type); - - smart_str_append_long(&array_size, i); - - dims = safe_emalloc(sizeof(int), dimension, 0); - dims[0] = i; - } else { - - enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC); - smart_str_append_long(&array_size, i); - dims = safe_emalloc(sizeof(int), dimension, 0); - dims[0] = i; - } - - if (style == SOAP_ENCODED) { - if (soap_version == SOAP_1_1) { - smart_str_0(&array_type); - if (strcmp(array_type.c,"xsd:anyType") == 0) { - smart_str_free(&array_type); - smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1); - } - smart_str_appendc(&array_type, '['); - smart_str_append(&array_type, &array_size); - smart_str_appendc(&array_type, ']'); - smart_str_0(&array_type); - xmlSetProp(xmlParam, SOAP_1_1_ENC_NS_PREFIX":arrayType", array_type.c); - } else { - int i = 0; - while (i < array_size.len) { - if (array_size.c[i] == ',') {array_size.c[i] = ' ';} - ++i; - } - smart_str_0(&array_type); - smart_str_0(&array_size); - xmlSetProp(xmlParam, SOAP_1_2_ENC_NS_PREFIX":itemType", array_type.c); - xmlSetProp(xmlParam, SOAP_1_2_ENC_NS_PREFIX":arraySize", array_size.c); - } - } - smart_str_free(&array_type); - smart_str_free(&array_size); - - add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style); - efree(dims); - } - if (style == SOAP_ENCODED) { - set_ns_and_type(xmlParam, type); - } - return xmlParam; -} - -static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret; - xmlNodePtr trav; - encodePtr enc = NULL; - int dimension = 1; - int* dims = NULL; - int* pos = NULL; - xmlAttrPtr attr; - sdlPtr sdl; - sdlAttributePtr *arrayType; - sdlExtraAttributePtr *ext; - sdlTypePtr elementType; - - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - sdl = SOAP_GLOBAL(sdl); - - if (data && - (attr = get_attribute(data->properties,"arrayType")) && - attr->children && attr->children->content) { - char *type, *end, *ns; - xmlNsPtr nsptr; - - parse_namespace(attr->children->content, &type, &ns); - nsptr = xmlSearchNs(attr->doc, attr->parent, ns); - - end = strrchr(type,'['); - if (end) { - *end = '\0'; - dimension = calc_dimension(end+1); - dims = get_position(dimension, end+1); - } - if (nsptr != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type); - } - efree(type); - if (ns) {efree(ns);} - - } else if ((attr = get_attribute(data->properties,"itemType")) && - attr->children && - attr->children->content) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(attr->children->content, &type, &ns); - nsptr = xmlSearchNs(attr->doc, attr->parent, ns); - if (nsptr != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type); - } - efree(type); - if (ns) {efree(ns);} - - if ((attr = get_attribute(data->properties,"arraySize")) && - attr->children && attr->children->content) { - dimension = calc_dimension_12(attr->children->content); - dims = get_position_12(dimension, attr->children->content); - } else { - dims = emalloc(sizeof(int)); - *dims = 0; - } - - } else if ((attr = get_attribute(data->properties,"arraySize")) && - attr->children && attr->children->content) { - - dimension = calc_dimension_12(attr->children->content); - dims = get_position_12(dimension, attr->children->content); - - } else if (type->sdl_type != NULL && - type->sdl_type->attributes != NULL && - zend_hash_find(type->sdl_type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", - sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { - char *type, *end; - - type = estrdup((*ext)->val); - end = strrchr(type,'['); - if (end) { - *end = '\0'; - } - if ((*ext)->ns != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, type); - } - efree(type); - - dims = emalloc(sizeof(int)); - *dims = 0; - - } else if (type->sdl_type != NULL && - type->sdl_type->attributes != NULL && - zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", - sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":itemType"), (void **)&ext) == SUCCESS) { - - if ((*ext)->ns != NULL) { - enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, (*ext)->val); - } - - if (zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", - sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) { - dimension = calc_dimension_12((*ext)->val); - dims = get_position_12(dimension, (*ext)->val); - } else { - dims = emalloc(sizeof(int)); - *dims = 0; - } - } else if (type->sdl_type != NULL && - type->sdl_type->attributes != NULL && - zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", - sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), - (void **)&arrayType) == SUCCESS && - zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) { - - dimension = calc_dimension_12((*ext)->val); - dims = get_position_12(dimension, (*ext)->val); - if (type->sdl_type && type->sdl_type->elements && - zend_hash_num_elements(type->sdl_type->elements) == 1 && - (zend_hash_internal_pointer_reset(type->sdl_type->elements), - zend_hash_get_current_data(type->sdl_type->elements, (void**)&elementType) == SUCCESS) && - (elementType = *(sdlTypePtr*)elementType) != NULL && - elementType->encode) { - enc = elementType->encode; - } - } else if (type->sdl_type && type->sdl_type->elements && - zend_hash_num_elements(type->sdl_type->elements) == 1 && - (zend_hash_internal_pointer_reset(type->sdl_type->elements), - zend_hash_get_current_data(type->sdl_type->elements, (void**)&elementType) == SUCCESS) && - (elementType = *(sdlTypePtr*)elementType) != NULL && - elementType->encode) { - enc = elementType->encode; - } - if (dims == NULL) { - dimension = 1; - dims = emalloc(sizeof(int)); - *dims = 0; - } - pos = safe_emalloc(sizeof(int), dimension, 0); - memset(pos,0,sizeof(int)*dimension); - if (data && - (attr = get_attribute(data->properties,"offset")) && - attr->children && attr->children->content) { - char* tmp = strrchr(attr->children->content,'['); - - if (tmp == NULL) { - tmp = attr->children->content; - } - get_position_ex(dimension, tmp, &pos); - } - - array_init(ret); - trav = data->children; - while (trav) { - if (trav->type == XML_ELEMENT_NODE) { - int i; - zval *tmpVal, *ar; - xmlAttrPtr position = get_attribute(trav->properties,"position"); - - tmpVal = master_to_zval(enc, trav); - if (position != NULL && position->children && position->children->content) { - char* tmp = strrchr(position->children->content,'['); - if (tmp == NULL) { - tmp = position->children->content; - } - get_position_ex(dimension, tmp, &pos); - } - - /* Get/Create intermediate arrays for multidimensional arrays */ - i = 0; - ar = ret; - while (i < dimension-1) { - zval** ar2; - if (zend_hash_index_find(Z_ARRVAL_P(ar), pos[i], (void**)&ar2) == SUCCESS) { - ar = *ar2; - } else { - zval *tmpAr; - MAKE_STD_ZVAL(tmpAr); - array_init(tmpAr); - zend_hash_index_update(Z_ARRVAL_P(ar), pos[i], &tmpAr, sizeof(zval*), (void**)&ar2); - ar = *ar2; - } - i++; - } - zend_hash_index_update(Z_ARRVAL_P(ar), pos[i], &tmpVal, sizeof(zval *), NULL); - - /* Increment position */ - i = dimension; - while (i > 0) { - i--; - pos[i]++; - if (pos[i] >= dims[i]) { - if (i > 0) { - pos[i] = 0; - } else { - /* TODO: Array index overflow */ - } - } else { - break; - } - } - } - trav = trav->next; - } - efree(dims); - efree(pos); - return ret; -} - -/* Map encode/decode */ -static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr xmlParam; - int i; - - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - FIND_ZVAL_NULL(data, xmlParam, style); - - if (Z_TYPE_P(data) == IS_ARRAY) { - i = zend_hash_num_elements(Z_ARRVAL_P(data)); - zend_hash_internal_pointer_reset(data->value.ht); - for (;i > 0;i--) { - xmlNodePtr xparam, item; - xmlNodePtr key; - zval **temp_data; - char *key_val; - int int_val; - - zend_hash_get_current_data(data->value.ht, (void **)&temp_data); - if (Z_TYPE_PP(temp_data) != IS_NULL) { - item = xmlNewNode(NULL,"item"); - xmlAddChild(xmlParam, item); - key = xmlNewNode(NULL,"key"); - xmlAddChild(item,key); - if (zend_hash_get_current_key(data->value.ht, &key_val, (long *)&int_val, FALSE) == HASH_KEY_IS_STRING) { - if (style == SOAP_ENCODED) { - xmlSetProp(key, "xsi:type", "xsd:string"); - } - xmlNodeSetContent(key, key_val); - } else { - smart_str tmp = {0}; - smart_str_append_long(&tmp, int_val); - smart_str_0(&tmp); - - if (style == SOAP_ENCODED) { - xmlSetProp(key, "xsi:type", "xsd:int"); - } - xmlNodeSetContentLen(key, tmp.c, tmp.len); - - smart_str_free(&tmp); - } - - xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item); - - xmlNodeSetName(xparam, "value"); - } - zend_hash_move_forward(data->value.ht); - } - } - if (style == SOAP_ENCODED) { - set_ns_and_type(xmlParam, type); - } - - return xmlParam; -} - -static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data) -{ - zval *ret, *key, *value; - xmlNodePtr trav, item, xmlKey, xmlValue; - - MAKE_STD_ZVAL(ret); - FIND_XML_NULL(data, ret); - - if (data && data->children) { - array_init(ret); - trav = data->children; - - trav = data->children; - FOREACHNODE(trav, "item", item) { - xmlKey = get_node(item->children, "key"); - if (!xmlKey) { - soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing key"); - } - - xmlValue = get_node(item->children, "value"); - if (!xmlKey) { - soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing value"); - } - - key = master_to_zval(NULL, xmlKey); - value = master_to_zval(NULL, xmlValue); - - if (Z_TYPE_P(key) == IS_STRING) { - zend_hash_update(Z_ARRVAL_P(ret), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); - } else if (Z_TYPE_P(key) == IS_LONG) { - zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL_P(key), &value, sizeof(zval *), NULL); - } else { - soap_error0(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowd as keys"); - } - zval_ptr_dtor(&key); - } - ENDFOREACH(trav); - } else { - ZVAL_NULL(ret); - } - return ret; -} - -/* Unknown encode/decode */ -static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - encodePtr enc; - xmlNodePtr ret; - - if (data) { - enc = get_conversion(data->type); - } else { - enc = get_conversion(IS_NULL); - } - ret = master_to_xml(enc, data, style, parent); -/* - if (style == SOAP_LITERAL && SOAP_GLOBAL(sdl)) { - encode_add_ns(node, XSI_NAMESPACE); - set_ns_and_type(ret, &enc->details); - } -*/ - return ret; -} - -static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data) -{ - encodePtr enc = NULL; - xmlAttrPtr tmpattr; - char *type_name = NULL; - zval *ret; - TSRMLS_FETCH(); - - data = check_and_resolve_href(data); - - if (data == NULL) { - enc = get_conversion(IS_NULL); - } else if (data->properties && get_attribute_ex(data->properties, "nil", XSI_NAMESPACE)) { - enc = get_conversion(IS_NULL); - } else { - tmpattr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE); - if (tmpattr != NULL) { - type_name = tmpattr->children->content; - enc = get_encoder_from_prefix(SOAP_GLOBAL(sdl), data, tmpattr->children->content); - if (enc && type == &enc->details) { - enc = NULL; - } - if (enc != NULL) { - encodePtr tmp = enc; - while (tmp && - tmp->details.sdl_type != NULL && - tmp->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX) { - if (enc == tmp->details.sdl_type->encode || - tmp == tmp->details.sdl_type->encode) { - enc = NULL; - break; - } - tmp = tmp->details.sdl_type->encode; - } - } - } - - if (enc == NULL) { - /* Didn't have a type, totally guess here */ - /* Logic: has children = IS_OBJECT else IS_STRING */ - xmlNodePtr trav; - - if (get_attribute(data->properties, "arrayType") || - get_attribute(data->properties, "itemType") || - get_attribute(data->properties, "arraySize")) { - enc = get_conversion(SOAP_ENC_ARRAY); - } else { - enc = get_conversion(XSD_STRING); - trav = data->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - enc = get_conversion(SOAP_ENC_OBJECT); - break; - } - trav = trav->next; - } - } - } - } - ret = master_to_zval_int(enc, data); - if (SOAP_GLOBAL(sdl) && type_name && enc->details.sdl_type) { - zval* soapvar; - char *ns, *cptype; - xmlNsPtr nsptr; - - MAKE_STD_ZVAL(soapvar); - object_init_ex(soapvar, soap_var_class_entry); - add_property_long(soapvar, "enc_type", enc->details.type); -#ifdef ZEND_ENGINE_2 - ret->refcount--; -#endif - add_property_zval(soapvar, "enc_value", ret); - parse_namespace(type_name, &cptype, &ns); - nsptr = xmlSearchNs(data->doc, data, ns); - add_property_string(soapvar, "enc_stype", cptype, 1); - if (nsptr) { - add_property_string(soapvar, "enc_ns", (char*)nsptr->href, 1); - } - efree(cptype); - if (ns) {efree(ns);} - ret = soapvar; - } - return ret; -} - -/* Time encode/decode */ -static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent) -{ - /* logic hacked from ext/standard/datetime.c */ - struct tm *ta, tmbuf; - time_t timestamp; - int max_reallocs = 5; - size_t buf_len=64, real_len; - char *buf; - char tzbuf[8]; - - xmlNodePtr xmlParam; - - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - FIND_ZVAL_NULL(data, xmlParam, style); - - if (Z_TYPE_P(data) == IS_LONG) { - timestamp = Z_LVAL_P(data); - ta = php_localtime_r(×tamp, &tmbuf); - /*ta = php_gmtime_r(×tamp, &tmbuf);*/ - - buf = (char *) emalloc(buf_len); - while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) { - buf_len *= 2; - buf = (char *) erealloc(buf, buf_len); - if (!--max_reallocs) break; - } - - /* Time zone support */ -#ifdef HAVE_TM_GMTOFF - sprintf(tzbuf, "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); -#else -# ifdef __CYGWIN__ - sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); -# else - sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); -# endif -#endif - if (strcmp(tzbuf,"+00:00") == 0) { - strcpy(tzbuf,"Z"); - real_len++; - } else { - real_len += 6; - } - if (real_len >= buf_len) { - buf = (char *) erealloc(buf, real_len+1); - } - strcat(buf, tzbuf); - - xmlNodeSetContent(xmlParam, buf); - efree(buf); - } else if (Z_TYPE_P(data) == IS_STRING) { - xmlNodeSetContentLen(xmlParam, Z_STRVAL_P(data), Z_STRLEN_P(data)); - } - - if (style == SOAP_ENCODED) { - set_ns_and_type(xmlParam, type); - } - return xmlParam; -} - -static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - /* TODO: '-'?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?T([0-9]+H)?([0-9]+M)?([0-9]+S)? */ - return to_xml_string(type, data, style, parent); -} - -static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent); -} - -static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - /* TODO: microsecconds */ - return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent); -} - -static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent); -} - -static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "%Y-%m", style, parent); -} - -static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "%Y", style, parent); -} - -static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "--%m-%d", style, parent); -} - -static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "---%d", style, parent); -} - -static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - return to_xml_datetime_ex(type, data, "--%m--", style, parent); -} - -static zval* to_zval_list(encodeTypePtr enc, xmlNodePtr data) { - /*FIXME*/ - return to_zval_stringc(enc, data); -} - -static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) { - xmlNodePtr ret; - encodePtr list_enc = NULL; - - if (enc->sdl_type && enc->sdl_type->kind == XSD_TYPEKIND_LIST && enc->sdl_type->elements) { - sdlTypePtr *type; - - zend_hash_internal_pointer_reset(enc->sdl_type->elements); - if (zend_hash_get_current_data(enc->sdl_type->elements, (void**)&type) == SUCCESS) { - list_enc = (*type)->encode; - } - } - - ret = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, ret); - FIND_ZVAL_NULL(data, ret, style); - if (Z_TYPE_P(data) == IS_ARRAY) { - zval **tmp; - smart_str list = {0}; - HashTable *ht = Z_ARRVAL_P(data); - - zend_hash_internal_pointer_reset(ht); - while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) { - xmlNodePtr dummy = master_to_xml(list_enc, *tmp, SOAP_LITERAL, ret); - if (dummy && dummy->children && dummy->children->content) { - if (list.len != 0) { - smart_str_appendc(&list, ' '); - } - smart_str_appends(&list, dummy->children->content); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - xmlUnlinkNode(dummy); - xmlFreeNode(dummy); - zend_hash_move_forward(ht); - } - smart_str_0(&list); - xmlNodeSetContentLen(ret, list.c, list.len); - smart_str_free(&list); - } else { - zval tmp = *data; - char *str, *start, *next; - smart_str list = {0}; - - if (Z_TYPE_P(data) != IS_STRING) { - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - data = &tmp; - } - str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); - whiteSpace_collapse(str); - start = str; - while (start != NULL && *start != '\0') { - xmlNodePtr dummy; - zval dummy_zval; - - next = strchr(start,' '); - if (next != NULL) { - *next = '\0'; - next++; - } - ZVAL_STRING(&dummy_zval, start, 0); - dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret); - if (dummy && dummy->children && dummy->children->content) { - if (list.len != 0) { - smart_str_appendc(&list, ' '); - } - smart_str_appends(&list, dummy->children->content); - } else { - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); - } - xmlUnlinkNode(dummy); - xmlFreeNode(dummy); - - start = next; - } - smart_str_0(&list); - xmlNodeSetContentLen(ret, list.c, list.len); - smart_str_free(&list); - efree(str); - if (data == &tmp) {zval_dtor(&tmp);} - } - return ret; -} - -static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) { - /*FIXME: minLength=1 */ - return to_xml_list(enc,data,style, parent); -} - -static zval* to_zval_union(encodeTypePtr enc, xmlNodePtr data) { - /*FIXME*/ - return to_zval_list(enc, data); -} - -static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) { - /*FIXME*/ - return to_xml_list(enc,data,style, parent); -} - -static zval *to_zval_any(encodeTypePtr type, xmlNodePtr data) -{ - xmlBufferPtr buf; - zval *ret; - - buf = xmlBufferCreate(); - xmlNodeDump(buf, NULL, data, 0, 0); - MAKE_STD_ZVAL(ret); - ZVAL_STRING(ret, (char*)xmlBufferContent(buf), 1); - xmlBufferFree(buf); - return ret; -} - -static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) -{ - xmlNodePtr ret; - - if (Z_TYPE_P(data) == IS_STRING) { - ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data)); - } else { - zval tmp = *data; - - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data)); - zval_dtor(&tmp); - } - ret->name = xmlStringTextNoenc; - xmlAddChild(parent, ret); - - return ret; -} - -zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data) -{ - sdlTypePtr type; - - type = enc->sdl_type; - if (type == NULL) { - return guess_zval_convert(enc, data); - } -/*FIXME: restriction support - if (type && type->restrictions && - data && data->children && data->children->content) { - if (type->restrictions->whiteSpace && type->restrictions->whiteSpace->value) { - if (strcmp(type->restrictions->whiteSpace->value,"replace") == 0) { - whiteSpace_replace(data->children->content); - } else if (strcmp(type->restrictions->whiteSpace->value,"collapse") == 0) { - whiteSpace_collapse(data->children->content); - } - } - if (type->restrictions->enumeration) { - if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) { - soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content); - } - } - if (type->restrictions->minLength && - strlen(data->children->content) < type->restrictions->minLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'"); - } - if (type->restrictions->maxLength && - strlen(data->children->content) > type->restrictions->maxLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'"); - } - if (type->restrictions->length && - strlen(data->children->content) != type->restrictions->length->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); - } - } -*/ - switch (type->kind) { - case XSD_TYPEKIND_SIMPLE: - if (type->encode && enc != &type->encode->details) { - return master_to_zval_int(type->encode, data); - } else { - return guess_zval_convert(enc, data); - } - break; - case XSD_TYPEKIND_LIST: - return to_zval_list(enc, data); - case XSD_TYPEKIND_UNION: - return to_zval_union(enc, data); - case XSD_TYPEKIND_COMPLEX: - case XSD_TYPEKIND_RESTRICTION: - case XSD_TYPEKIND_EXTENSION: - if (type->encode && - (type->encode->details.type == IS_ARRAY || - type->encode->details.type == SOAP_ENC_ARRAY)) { - return to_zval_array(enc, data); - } - return to_zval_object(enc, data); - default: - soap_error0(E_ERROR, "Encoding: Internal Error"); - return guess_zval_convert(enc, data); - } -} - -xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) -{ - sdlTypePtr type; - xmlNodePtr ret = NULL; - - type = enc->sdl_type; - - if (type == NULL) { - ret = guess_xml_convert(enc, data, style, parent); - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, enc); - } - return ret; - } -/*FIXME: restriction support - if (type) { - if (type->restrictions && Z_TYPE_P(data) == IS_STRING) { - if (type->restrictions->enumeration) { - if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) { - soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); - } - } - if (type->restrictions->minLength && - Z_STRLEN_P(data) < type->restrictions->minLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'"); - } - if (type->restrictions->maxLength && - Z_STRLEN_P(data) > type->restrictions->maxLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'"); - } - if (type->restrictions->length && - Z_STRLEN_P(data) != type->restrictions->length->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); - } - } - } -*/ - switch(type->kind) { - case XSD_TYPEKIND_SIMPLE: - if (type->encode && enc != &type->encode->details) { - ret = master_to_xml(type->encode, data, style, parent); - } else { - ret = guess_xml_convert(enc, data, style, parent); - } - break; - case XSD_TYPEKIND_LIST: - ret = to_xml_list(enc, data, style, parent); - break; - case XSD_TYPEKIND_UNION: - ret = to_xml_union(enc, data, style, parent); - break; - case XSD_TYPEKIND_COMPLEX: - case XSD_TYPEKIND_RESTRICTION: - case XSD_TYPEKIND_EXTENSION: - if (type->encode && - (type->encode->details.type == IS_ARRAY || - type->encode->details.type == SOAP_ENC_ARRAY)) { - ret = to_xml_array(enc, data, style, parent); - } else { - ret = to_xml_object(enc, data, style, parent); - } - break; - default: - soap_error0(E_ERROR, "Encoding: Internal Error"); - break; - } - if (style == SOAP_ENCODED) { - set_ns_and_type(ret, enc); - } - return ret; -} - -static xmlNodePtr check_and_resolve_href(xmlNodePtr data) -{ - if (data && data->properties) { - xmlAttrPtr href; - - href = data->properties; - while (1) { - href = get_attribute(href, "href"); - if (href == NULL || href->ns == NULL) {break;} - href = href->next; - } - if (href) { - /* Internal href try and find node */ - if (href->children->content[0] == '#') { - xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", &href->children->content[1]); - if (!ret) { - soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); - } - return ret; - } else { - /* TODO: External href....? */ - soap_error1(E_ERROR, "Encoding: External reference '%s'", href->children->content); - } - } - /* SOAP 1.2 enc:id enc:ref */ - href = get_attribute_ex(data->properties, "ref", SOAP_1_2_ENC_NAMESPACE); - if (href) { - char* id; - xmlNodePtr ret; - - if (href->children->content[0] == '#') { - id = href->children->content+1; - } else { - id = href->children->content; - } - ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", id, SOAP_1_2_ENC_NAMESPACE); - if (!ret) { - soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); - } else if (ret == data) { - soap_error1(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content); - } - return ret; - } - } - return data; -} - -static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type) -{ - set_ns_and_type_ex(node, type->ns, type->type_str); -} - -static void set_ns_and_type_ex(xmlNodePtr node, char *ns, char *type) -{ - smart_str nstype = {0}; - get_type_str(node, ns, type, &nstype); - xmlSetProp(node, "xsi:type", nstype.c); - smart_str_free(&nstype); -} - -xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns) -{ - xmlNsPtr xmlns; - - if (ns == NULL) { - return NULL; - } - - xmlns = xmlSearchNsByHref(node->doc,node,ns); - if (xmlns == NULL) { - char* prefix; - TSRMLS_FETCH(); - - if (zend_hash_find(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns) + 1, (void **)&prefix) == SUCCESS) { - xmlns = xmlNewNs(node->doc->children,ns,prefix); - } else { - smart_str prefix = {0}; - int num = ++SOAP_GLOBAL(cur_uniq_ns); - - smart_str_appendl(&prefix, "ns", 2); - smart_str_append_long(&prefix, num); - smart_str_0(&prefix); - xmlns = xmlNewNs(node->doc->children,ns,prefix.c); - smart_str_free(&prefix); - } - } - return xmlns; -} - -void encode_reset_ns() -{ - TSRMLS_FETCH(); - SOAP_GLOBAL(cur_uniq_ns) = 0; -} - -encodePtr get_conversion(int encode) -{ - encodePtr *enc = NULL; - TSRMLS_FETCH(); - - if (zend_hash_index_find(&SOAP_GLOBAL(defEncIndex), encode, (void **)&enc) == FAILURE) { - if (SOAP_GLOBAL(overrides)) { - smart_str nscat = {0}; - - smart_str_appendl(&nscat, (*enc)->details.ns, strlen((*enc)->details.ns)); - smart_str_appendc(&nscat, ':'); - smart_str_appendl(&nscat, (*enc)->details.type_str, strlen((*enc)->details.type_str)); - smart_str_0(&nscat); - - if (zend_hash_find(SOAP_GLOBAL(overrides), nscat.c, nscat.len + 1, (void **)&enc) == FAILURE) { - smart_str_free(&nscat); - soap_error0(E_ERROR, "Encoding: Cannot find encoding"); - return NULL; - } else { - smart_str_free(&nscat); - return *enc; - } - } else { - soap_error0(E_ERROR, "Encoding: Cannot find encoding"); - return NULL; - } - } else { - return *enc; - } -} - -static int is_map(zval *array) -{ - int i, count = zend_hash_num_elements(Z_ARRVAL_P(array)); - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(array)); - for (i = 0;i < count;i++) { - if (zend_hash_get_current_key_type(Z_ARRVAL_P(array)) == HASH_KEY_IS_STRING) { - return TRUE; - } - zend_hash_move_forward(Z_ARRVAL_P(array)); - } - return FALSE; -} - -static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TSRMLS_DC) -{ - HashTable *ht; - int i, count, cur_type, prev_type, different; - zval **tmp; - char *prev_stype = NULL, *cur_stype = NULL, *prev_ns = NULL, *cur_ns = NULL; - - if (!array || Z_TYPE_P(array) != IS_ARRAY) { - smart_str_appendl(type, "xsd:anyType", 11); - return get_conversion(XSD_ANYTYPE); - } - - different = FALSE; - cur_type = prev_type = 0; - ht = HASH_OF(array); - count = zend_hash_num_elements(ht); - - zend_hash_internal_pointer_reset(ht); - for (i = 0;i < count;i++) { - zend_hash_get_current_data(ht, (void **)&tmp); - - if (Z_TYPE_PP(tmp) == IS_OBJECT && - Z_OBJCE_PP(tmp) == soap_var_class_entry) { - zval **ztype; - - if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) { - soap_error0(E_ERROR, "Encoding: SoapVar hasn't 'enc_type' property"); - } - cur_type = Z_LVAL_PP(ztype); - - if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_stype", sizeof("enc_stype"), (void **)&ztype) == SUCCESS) { - cur_stype = Z_STRVAL_PP(ztype); - } else { - cur_stype = NULL; - } - - if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_ns", sizeof("enc_ns"), (void **)&ztype) == SUCCESS) { - cur_ns = Z_STRVAL_PP(ztype); - } else { - cur_ns = NULL; - } - - } else if (Z_TYPE_PP(tmp) == IS_ARRAY && is_map(*tmp)) { - cur_type = APACHE_MAP; - cur_stype = NULL; - cur_ns = NULL; - } else { - cur_type = Z_TYPE_PP(tmp); - cur_stype = NULL; - cur_ns = NULL; - } - - if (i > 0) { - if ((cur_type != prev_type) || - (cur_stype != NULL && prev_stype != NULL && strcmp(cur_stype,prev_stype) != 0) || - (cur_stype == NULL && cur_stype != prev_stype) || - (cur_ns != NULL && prev_ns != NULL && strcmp(cur_ns,prev_ns) != 0) || - (cur_ns == NULL && cur_ns != prev_ns)) { - different = TRUE; - break; - } - } - - prev_type = cur_type; - prev_stype = cur_stype; - prev_ns = cur_ns; - zend_hash_move_forward(ht); - } - - if (different || count == 0) { - smart_str_appendl(type, "xsd:anyType", 11); - return get_conversion(XSD_ANYTYPE); - } else { - encodePtr enc; - - if (cur_stype != NULL) { - smart_str array_type = {0}; - - if (cur_ns) { - xmlNsPtr ns = encode_add_ns(node,cur_ns); - - smart_str_appends(type, ns->prefix); - smart_str_appendc(type, ':'); - smart_str_appends(&array_type, cur_ns); - smart_str_appendc(&array_type, ':'); - } - smart_str_appends(type, cur_stype); - smart_str_0(type); - smart_str_appends(&array_type, cur_stype); - smart_str_0(&array_type); - - enc = get_encoder_ex(SOAP_GLOBAL(sdl), array_type.c, array_type.len); - smart_str_free(&array_type); - return enc; - } else { - enc = get_conversion(cur_type); - get_type_str(node, enc->details.ns, enc->details.type_str, type); - return enc; - } - } -} - -static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret) -{ - TSRMLS_FETCH(); - - if (ns) { - xmlNsPtr xmlns; - if (SOAP_GLOBAL(soap_version) == SOAP_1_2 && - strcmp(ns,SOAP_1_1_ENC_NAMESPACE) == 0) { - ns = SOAP_1_2_ENC_NAMESPACE; - } else if (SOAP_GLOBAL(soap_version) == SOAP_1_1 && - strcmp(ns,SOAP_1_2_ENC_NAMESPACE) == 0) { - ns = SOAP_1_1_ENC_NAMESPACE; - } - xmlns = encode_add_ns(node,ns); - smart_str_appends(ret, xmlns->prefix); - smart_str_appendc(ret, ':'); - } - smart_str_appendl(ret, type, strlen(type)); - smart_str_0(ret); -} - -static void delete_mapping(void *data) -{ - soapMappingPtr map = (soapMappingPtr)data; - - if (map->ns) { - efree(map->ns); - } - if (map->ctype) { - efree(map->ctype); - } - - if (map->type == SOAP_MAP_FUNCTION) { - if (map->map_functions.to_xml_before) { - zval_ptr_dtor(&map->map_functions.to_xml_before); - } - if (map->map_functions.to_xml) { - zval_ptr_dtor(&map->map_functions.to_xml); - } - if (map->map_functions.to_xml_after) { - zval_ptr_dtor(&map->map_functions.to_xml_after); - } - if (map->map_functions.to_zval_before) { - zval_ptr_dtor(&map->map_functions.to_zval_before); - } - if (map->map_functions.to_zval) { - zval_ptr_dtor(&map->map_functions.to_zval); - } - if (map->map_functions.to_zval_after) { - zval_ptr_dtor(&map->map_functions.to_zval_after); - } - } - efree(map); -} - -void delete_encoder(void *encode) -{ - encodePtr t = *((encodePtr*)encode); - if (t->details.ns) { - efree(t->details.ns); - } - if (t->details.type_str) { - efree(t->details.type_str); - } - if (t->details.map) { - delete_mapping(t->details.map); - } - efree(t); -} diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h deleted file mode 100644 index b373c8b843117..0000000000000 --- a/ext/soap/php_encoding.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_ENCODING_H -#define PHP_ENCODING_H - -#define XSD_1999_NAMESPACE "http://www.w3.org/1999/XMLSchema" -#define XSD_1999_TIMEINSTANT 401 -#define XSD_1999_TIMEINSTANT_STRING "timeInstant" - -#define SOAP_1_1_ENV_NAMESPACE "http://schemas.xmlsoap.org/soap/envelope/" -#define SOAP_1_1_ENV_NS_PREFIX "SOAP-ENV" - -#define SOAP_1_2_ENV_NAMESPACE "http://www.w3.org/2003/05/soap-envelope" -#define SOAP_1_2_ENV_NS_PREFIX "env" - -#define SOAP_1_1_ENC_NAMESPACE "http://schemas.xmlsoap.org/soap/encoding/" -#define SOAP_1_1_ENC_NS_PREFIX "SOAP-ENC" - -#define SOAP_1_2_ENC_NAMESPACE "http://www.w3.org/2003/05/soap-encoding" -#define SOAP_1_2_ENC_NS_PREFIX "enc" - -#define SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema" -#define XSD_NAMESPACE "http://www.w3.org/2001/XMLSchema" -#define XSD_NS_PREFIX "xsd" -#define XSI_NAMESPACE "http://www.w3.org/2001/XMLSchema-instance" -#define XSI_NS_PREFIX "xsi" -#define XML_NAMESPACE "http://www.w3.org/XML/1998/namespace" -#define XML_NS_PREFIX "xml" - -#define XSD_STRING 101 -#define XSD_STRING_STRING "string" -#define XSD_BOOLEAN 102 -#define XSD_BOOLEAN_STRING "boolean" -#define XSD_DECIMAL 103 -#define XSD_DECIMAL_STRING "decimal" -#define XSD_FLOAT 104 -#define XSD_FLOAT_STRING "float" -#define XSD_DOUBLE 105 -#define XSD_DOUBLE_STRING "double" -#define XSD_DURATION 106 -#define XSD_DURATION_STRING "duration" -#define XSD_DATETIME 107 -#define XSD_DATETIME_STRING "dateTime" -#define XSD_TIME 108 -#define XSD_TIME_STRING "time" -#define XSD_DATE 109 -#define XSD_DATE_STRING "date" -#define XSD_GYEARMONTH 110 -#define XSD_GYEARMONTH_STRING "gYearMonth" -#define XSD_GYEAR 111 -#define XSD_GYEAR_STRING "gYear" -#define XSD_GMONTHDAY 112 -#define XSD_GMONTHDAY_STRING "gMonthDay" -#define XSD_GDAY 113 -#define XSD_GDAY_STRING "gDay" -#define XSD_GMONTH 114 -#define XSD_GMONTH_STRING "gMonth" -#define XSD_HEXBINARY 115 -#define XSD_HEXBINARY_STRING "hexBinary" -#define XSD_BASE64BINARY 116 -#define XSD_BASE64BINARY_STRING "base64Binary" -#define XSD_ANYURI 117 -#define XSD_ANYURI_STRING "anyURI" -#define XSD_QNAME 118 -#define XSD_QNAME_STRING "QName" -#define XSD_NOTATION 119 -#define XSD_NOTATION_STRING "NOTATION" -#define XSD_NORMALIZEDSTRING 120 -#define XSD_NORMALIZEDSTRING_STRING "normalizedString" -#define XSD_TOKEN 121 -#define XSD_TOKEN_STRING "token" -#define XSD_LANGUAGE 122 -#define XSD_LANGUAGE_STRING "language" -#define XSD_NMTOKEN 123 -#define XSD_NMTOKEN_STRING "NMTOKEN" -#define XSD_NAME 124 -#define XSD_NAME_STRING "Name" -#define XSD_NCNAME 125 -#define XSD_NCNAME_STRING "NCName" -#define XSD_ID 126 -#define XSD_ID_STRING "ID" -#define XSD_IDREF 127 -#define XSD_IDREF_STRING "IDREF" -#define XSD_IDREFS 128 -#define XSD_IDREFS_STRING "IDREFS" -#define XSD_ENTITY 129 -#define XSD_ENTITY_STRING "ENTITY" -#define XSD_ENTITIES 130 -#define XSD_ENTITIES_STRING "ENTITIES" -#define XSD_INTEGER 131 -#define XSD_INTEGER_STRING "integer" -#define XSD_NONPOSITIVEINTEGER 132 -#define XSD_NONPOSITIVEINTEGER_STRING "nonPositiveInteger" -#define XSD_NEGATIVEINTEGER 133 -#define XSD_NEGATIVEINTEGER_STRING "negativeInteger" -#define XSD_LONG 134 -#define XSD_LONG_STRING "long" -#define XSD_INT 135 -#define XSD_INT_STRING "int" -#define XSD_SHORT 136 -#define XSD_SHORT_STRING "short" -#define XSD_BYTE 137 -#define XSD_BYTE_STRING "byte" -#define XSD_NONNEGATIVEINTEGER 138 -#define XSD_NONNEGATIVEINTEGER_STRING "nonNegativeInteger" -#define XSD_UNSIGNEDLONG 139 -#define XSD_UNSIGNEDLONG_STRING "unsignedLong" -#define XSD_UNSIGNEDINT 140 -#define XSD_UNSIGNEDINT_STRING "unsignedInt" -#define XSD_UNSIGNEDSHORT 141 -#define XSD_UNSIGNEDSHORT_STRING "unsignedShort" -#define XSD_UNSIGNEDBYTE 142 -#define XSD_UNSIGNEDBYTE_STRING "unsignedByte" -#define XSD_POSITIVEINTEGER 143 -#define XSD_POSITIVEINTEGER_STRING "positiveInteger" -#define XSD_NMTOKENS 144 -#define XSD_NMTOKENS_STRING "NMTOKENS" -#define XSD_ANYTYPE 145 -#define XSD_ANYTYPE_STRING "anyType" -#define XSD_UR_TYPE 146 -#define XSD_UR_TYPE_STRING "ur-type" - -#define XSD_ANYXML 147 - -#define APACHE_NAMESPACE "http://xml.apache.org/xml-soap" -#define APACHE_MAP 200 -#define APACHE_MAP_STRING "Map" - -#define SOAP_ENC_ARRAY 300 -#define SOAP_ENC_ARRAY_STRING "Array" -#define SOAP_ENC_OBJECT 301 -#define SOAP_ENC_OBJECT_STRING "Struct" - -#define WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/" -#define WSDL_NS_PREFIX "wsdl" - -#define WSDL_SOAP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap/" -#define WSDL_SOAP12_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap12/" -#define RPC_SOAP12_NAMESPACE "http://www.w3.org/2003/05/soap-rpc" -#define RPC_SOAP12_NS_PREFIX "rpc" - -#define WSDL_HTTP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/http/" -#define WSDL_HTTP12_NAMESPACE "http://www.w3.org/2003/05/soap/bindings/HTTP/" -#define WSDL_HTTP_NS_PREFIX "http" - -#define WSDL_HTTP_TRANSPORT "http://schemas.xmlsoap.org/soap/http" - -#define WSDL_MIME_NAMESPACE "http://schemas.xmlsoap.org/wsdl/mime/" - -#define WSDL_DIME_NAMESPACE "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" -#define WSDL_DIME_OPEN "http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" -#define WSDL_DIME_CLOSED "http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" - -#define UNKNOWN_TYPE 999998 -#define END_KNOWN_TYPES 999999 - -struct _encodeType { - int type; - char *type_str; - char *ns; - sdlTypePtr sdl_type; - soapMappingPtr map; -}; - -struct _encode { - encodeType details; - zval *(*to_zval)(encodeTypePtr type, xmlNodePtr data); - xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); - - xmlNodePtr (*to_zval_before)(encodeTypePtr type, xmlNodePtr data, int style); - zval *(*to_zval_after)(encodeTypePtr type, zval *data); - - zval *(*to_xml_before)(encodeTypePtr type, zval *data); - xmlNodePtr (*to_xml_after)(encodeTypePtr type, xmlNodePtr data, int style); -}; - -/* Master functions all encode/decode should be called thur these functions */ -xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent); -zval *master_to_zval(encodePtr encode, xmlNodePtr data); - -#ifdef HAVE_PHP_DOMXML -/* user defined mapping */ -zval *to_xml_before_user(encodeTypePtr type, zval *data); -xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent); -xmlNodePtr to_xml_after_user(encodeTypePtr type, xmlNodePtr node, int style); -xmlNodePtr to_zval_before_user(encodeTypePtr type, xmlNodePtr node, int style); -zval *to_zval_user(encodeTypePtr type, xmlNodePtr node); -zval *to_zval_after_user(encodeTypePtr type, zval *data); -#endif - -void whiteSpace_replace(char* str); -void whiteSpace_collapse(char* str); - -xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent); -zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data); - -void encode_reset_ns(); -xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns); - -encodePtr get_conversion(int encode); - -void delete_encoder(void *handle); - -extern encode defaultEncoding[]; - -#endif diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c deleted file mode 100644 index 2718b3708aa96..0000000000000 --- a/ext/soap/php_http.c +++ /dev/null @@ -1,1246 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_soap.h" -#include "ext/standard/base64.h" -#include "ext/standard/md5.h" - -static char *get_http_header_value(char *headers, char *type); -static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC); -static int get_http_headers(php_stream *socketd,char **response, int *out_size TSRMLS_DC); - -#define smart_str_append_const(str, const) \ - smart_str_appendl(str,const,sizeof(const)-1) - -static int stream_alive(php_stream *stream TSRMLS_DC) -{ - int socket; - char buf; - - /* maybe better to use: - * php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL) - * here instead */ - - if (stream == NULL || stream->eof || php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void**)&socket, 0) != SUCCESS) { - return FALSE; - } - if (socket == -1) { - return FALSE; - } else { - if (php_pollfd_for_ms(socket, PHP_POLLREADABLE, 0) > 0) { - if (0 == recv(socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) { - return FALSE; - } - } - } - return TRUE; -} - -/* Proxy HTTP Authentication */ -void proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) -{ - zval **login, **password; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) { - char* buf; - int len; - smart_str auth = {0}; - - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); - smart_str_appendc(&auth, ':'); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); - } - smart_str_0(&auth); - buf = php_base64_encode(auth.c, auth.len, &len); - smart_str_append_const(soap_headers, "Proxy-Authorization: Basic "); - smart_str_appendl(soap_headers, buf, len); - smart_str_append_const(soap_headers, "\r\n"); - efree(buf); - smart_str_free(&auth); - } -} - -/* HTTP Authentication */ -void basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) -{ - zval **login, **password; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS && - !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) { - char* buf; - int len; - smart_str auth = {0}; - - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); - smart_str_appendc(&auth, ':'); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); - } - smart_str_0(&auth); - buf = php_base64_encode(auth.c, auth.len, &len); - smart_str_append_const(soap_headers, "Authorization: Basic "); - smart_str_appendl(soap_headers, buf, len); - smart_str_append_const(soap_headers, "\r\n"); - efree(buf); - smart_str_free(&auth); - } -} - -static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, int *use_proxy TSRMLS_DC) -{ - php_stream *stream; - zval **proxy_host, **proxy_port, **tmp; - char *host; - php_stream_context *context = NULL; - char *name; - long namelen; - int port; - int old_error_reporting; - struct timeval tv; - struct timeval *timeout = NULL; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS && - Z_TYPE_PP(proxy_host) == IS_STRING && - zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS && - Z_TYPE_PP(proxy_port) == IS_LONG) { - host = Z_STRVAL_PP(proxy_host); - port = Z_LVAL_PP(proxy_port); - *use_proxy = 1; - } else { - host = phpurl->host; - port = phpurl->port; - } - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_connection_timeout", sizeof("_connection_timeout"), (void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) > 0) { - tv.tv_sec = Z_LVAL_PP(tmp); - tv.tv_usec = 0; - timeout = &tv; - } - - old_error_reporting = EG(error_reporting); - EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE); - - if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr), - "_stream_context", sizeof("_stream_context"), (void**)&tmp)) { - context = php_stream_context_from_zval(*tmp, 0); - } - - namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port); - - stream = php_stream_xport_create(name, namelen, - ENFORCE_SAFE_MODE | REPORT_ERRORS, - STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, - NULL /*persistent_id*/, - timeout, - context, - NULL, NULL); - efree(name); - - /* SSL & proxy */ - if (stream && *use_proxy && use_ssl) { - smart_str soap_headers = {0}; - char *http_headers; - int http_header_size; - - smart_str_append_const(&soap_headers, "CONNECT "); - smart_str_appends(&soap_headers, phpurl->host); - smart_str_appendc(&soap_headers, ':'); - smart_str_append_unsigned(&soap_headers, phpurl->port); - smart_str_append_const(&soap_headers, " HTTP/1.1\r\n"); - proxy_authentication(this_ptr, &soap_headers TSRMLS_CC); - smart_str_append_const(&soap_headers, "\r\n"); - if (php_stream_write(stream, soap_headers.c, soap_headers.len) != soap_headers.len) { - php_stream_close(stream); - stream = NULL; - } - smart_str_free(&soap_headers); - - if (stream) { - if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC) || http_headers == NULL) { - php_stream_close(stream); - stream = NULL; - } - efree(http_headers); - } - /* enable SSL transport layer */ - if (stream) { - if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { - php_stream_close(stream); - stream = NULL; - } - } - } - - EG(error_reporting) = old_error_reporting; - return stream; -} - -static int in_domain(const char *host, const char *domain) -{ - if (domain[0] == '.') { - int l1 = strlen(host); - int l2 = strlen(domain); - if (l1 > l2) { - return strcmp(host+l1-l2,domain) == 0; - } else { - return 0; - } - } else { - return strcmp(host,domain) == 0; - } -} - -int make_http_soap_request(zval *this_ptr, - char *buf, - int buf_size, - char *location, - char *soapaction, - int soap_version, - char **buffer, - int *buffer_len TSRMLS_DC) -{ - char *request; - smart_str soap_headers = {0}; - int request_size, err; - php_url *phpurl = NULL; - php_stream *stream; - zval **trace, **tmp; - int use_proxy = 0; - int use_ssl; - char *http_headers, *http_body, *content_type, *http_version, *cookie_itt; - int http_header_size, http_body_size, http_close; - char *connection; - int http_1_1; - int http_status; - int content_type_xml = 0; - char *content_encoding; - zend_bool old_allow_url_fopen; - - if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) { - return FALSE; - } - - request = buf; - request_size = buf_size; - /* Compress request */ - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "compression", sizeof("compression"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { - int level = Z_LVAL_PP(tmp) & 0x0f; - int kind = Z_LVAL_PP(tmp) & SOAP_COMPRESSION_DEFLATE; - - if ((Z_LVAL_PP(tmp) & SOAP_COMPRESSION_ACCEPT) != 0) { - smart_str_append_const(&soap_headers,"Accept-Encoding: gzip, deflate\r\n"); - } - if (level > 0) { - zval func; - zval retval; - zval param1, param2, param3; - zval *params[3]; - int n; - - params[0] = ¶m1; - INIT_PZVAL(params[0]); - params[1] = ¶m2; - INIT_PZVAL(params[1]); - params[2] = ¶m3; - INIT_PZVAL(params[2]); - ZVAL_STRINGL(params[0], buf, buf_size, 0); - ZVAL_LONG(params[1], level); - if (kind == SOAP_COMPRESSION_DEFLATE) { - n = 2; - ZVAL_STRING(&func, "gzcompress", 0); - smart_str_append_const(&soap_headers,"Content-Encoding: deflate\r\n"); - } else { - n = 3; - ZVAL_STRING(&func, "gzencode", 0); - smart_str_append_const(&soap_headers,"Content-Encoding: gzip\r\n"); - ZVAL_LONG(params[2], 1); - } - if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS && - Z_TYPE(retval) == IS_STRING) { - request = Z_STRVAL(retval); - request_size = Z_STRLEN(retval); - } else { - if (request != buf) {efree(request);} - return FALSE; - } - } - } - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"), (void **)&tmp) == SUCCESS) { - php_stream_from_zval_no_verify(stream,tmp); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { - use_proxy = Z_LVAL_PP(tmp); - } - } else { - stream = NULL; - } - - if (location != NULL && location[0] != '\000') { - phpurl = php_url_parse(location); - } - -try_again: - if (phpurl == NULL || phpurl->host == NULL) { - if (phpurl != NULL) {php_url_free(phpurl);} - if (request != buf) {efree(request);} - add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL TSRMLS_CC); - return FALSE; - } - - use_ssl = 0; - if (phpurl->scheme != NULL && strcmp(phpurl->scheme, "https") == 0) { - use_ssl = 1; - } else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) { - php_url_free(phpurl); - if (request != buf) {efree(request);} - add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC); - return FALSE; - } - - old_allow_url_fopen = PG(allow_url_fopen); - PG(allow_url_fopen) = 1; - if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) { - php_url_free(phpurl); - if (request != buf) {efree(request);} - add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC); - PG(allow_url_fopen) = old_allow_url_fopen; - return FALSE; - } - - if (phpurl->port == 0) { - phpurl->port = use_ssl ? 443 : 80; - } - - /* Check if request to the same host */ - if (stream != NULL) { - php_url *orig; - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl"), (void **)&tmp) == SUCCESS && - (orig = (php_url *) zend_fetch_resource(tmp TSRMLS_CC, -1, "httpurl", NULL, 1, le_url)) != NULL && - ((use_proxy && !use_ssl) || - (((use_ssl && orig->scheme != NULL && strcmp(orig->scheme, "https") == 0) || - (!use_ssl && orig->scheme == NULL) || - (!use_ssl && strcmp(orig->scheme, "https") != 0)) && - strcmp(orig->host, phpurl->host) == 0 && - orig->port == phpurl->port))) { - } else { - php_stream_close(stream); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - stream = NULL; - use_proxy = 0; - } - } - - /* Check if keep-alive connection is still opened */ - if (stream != NULL && !stream_alive(stream TSRMLS_CC)) { - php_stream_close(stream); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - stream = NULL; - use_proxy = 0; - } - - if (!stream) { - stream = http_connect(this_ptr, phpurl, use_ssl, &use_proxy TSRMLS_CC); - if (stream) { - php_stream_auto_cleanup(stream); - add_property_resource(this_ptr, "httpsocket", php_stream_get_resource_id(stream)); - add_property_long(this_ptr, "_use_proxy", use_proxy); - } else { - php_url_free(phpurl); - if (request != buf) {efree(request);} - add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC); - PG(allow_url_fopen) = old_allow_url_fopen; - return FALSE; - } - } - PG(allow_url_fopen) = old_allow_url_fopen; - - if (stream) { - zval **cookies, **login, **password; - int ret = zend_list_insert(phpurl, le_url); - - add_property_resource(this_ptr, "httpurl", ret); - /*zend_list_addref(ret);*/ - - smart_str_append_const(&soap_headers, "POST "); - if (use_proxy && !use_ssl) { - smart_str_appends(&soap_headers, phpurl->scheme); - smart_str_append_const(&soap_headers, "://"); - smart_str_appends(&soap_headers, phpurl->host); - smart_str_appendc(&soap_headers, ':'); - smart_str_append_unsigned(&soap_headers, phpurl->port); - } - if (phpurl->path) { - smart_str_appends(&soap_headers, phpurl->path); - } - if (phpurl->query) { - smart_str_appendc(&soap_headers, '?'); - smart_str_appends(&soap_headers, phpurl->query); - } - if (phpurl->fragment) { - smart_str_appendc(&soap_headers, '#'); - smart_str_appends(&soap_headers, phpurl->fragment); - } - smart_str_append_const(&soap_headers, " HTTP/1.1\r\n" - "Host: "); - smart_str_appends(&soap_headers, phpurl->host); - if (phpurl->port != (use_ssl?443:80)) { - smart_str_appendc(&soap_headers, ':'); - smart_str_append_unsigned(&soap_headers, phpurl->port); - } - smart_str_append_const(&soap_headers, "\r\n" - "Connection: Keep-Alive\r\n" -/* - "Connection: close\r\n" - "Accept: text/html; text/xml; text/plain\r\n" -*/ - "User-Agent: PHP SOAP 0.1\r\n"); - if (soap_version == SOAP_1_2) { - smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8"); - if (soapaction) { - smart_str_append_const(&soap_headers,"; action=\""); - smart_str_appends(&soap_headers, soapaction); - smart_str_append_const(&soap_headers,"\""); - } - smart_str_append_const(&soap_headers,"\r\n"); - } else { - smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=utf-8\r\n"); - if (soapaction) { - smart_str_append_const(&soap_headers, "SOAPAction: \""); - smart_str_appends(&soap_headers, soapaction); - smart_str_append_const(&soap_headers, "\"\r\n"); - } - } - smart_str_append_const(&soap_headers,"Content-Length: "); - smart_str_append_long(&soap_headers, request_size); - smart_str_append_const(&soap_headers, "\r\n"); - - /* HTTP Authentication */ - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS && - Z_TYPE_PP(login) == IS_STRING) { - zval **digest; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"), (void **)&digest) == SUCCESS) { - if (Z_TYPE_PP(digest) == IS_ARRAY) { - char HA1[33], HA2[33], response[33], cnonce[33], nc[9]; - PHP_MD5_CTX md5ctx; - unsigned char hash[16]; - - PHP_MD5Init(&md5ctx); - sprintf(cnonce, "%d", rand()); - PHP_MD5Update(&md5ctx, cnonce, strlen(cnonce)); - PHP_MD5Final(hash, &md5ctx); - make_digest(cnonce, hash); - - if (zend_hash_find(Z_ARRVAL_PP(digest), "nc", sizeof("nc"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG) { - Z_LVAL_PP(tmp)++; - sprintf(nc, "%08ld", Z_LVAL_PP(tmp)); - } else { - add_assoc_long(*digest, "nc", 1); - strcpy(nc, "00000001"); - } - - PHP_MD5Init(&md5ctx); - PHP_MD5Update(&md5ctx, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); - PHP_MD5Update(&md5ctx, ":", 1); - if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - PHP_MD5Update(&md5ctx, ":", 1); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS && - Z_TYPE_PP(password) == IS_STRING) { - PHP_MD5Update(&md5ctx, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); - } - PHP_MD5Final(hash, &md5ctx); - make_digest(HA1, hash); - if (zend_hash_find(Z_ARRVAL_PP(digest), "algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING && - Z_STRLEN_PP(tmp) == sizeof("md5-sess")-1 && - stricmp(Z_STRVAL_PP(tmp), "md5-sess") == 0) { - PHP_MD5Init(&md5ctx); - PHP_MD5Update(&md5ctx, HA1, 32); - PHP_MD5Update(&md5ctx, ":", 1); - if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - PHP_MD5Update(&md5ctx, ":", 1); - PHP_MD5Update(&md5ctx, cnonce, 8); - PHP_MD5Final(hash, &md5ctx); - make_digest(HA1, hash); - } - - PHP_MD5Init(&md5ctx); - PHP_MD5Update(&md5ctx, "POST:", sizeof("POST:")-1); - if (phpurl->path) { - PHP_MD5Update(&md5ctx, phpurl->path, strlen(phpurl->path)); - } - if (phpurl->query) { - PHP_MD5Update(&md5ctx, "?", 1); - PHP_MD5Update(&md5ctx, phpurl->query, strlen(phpurl->query)); - } - - /* TODO: Support for qop="auth-int" */ -/* - if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING && - Z_STRLEN_PP(tmp) == sizeof("auth-int")-1 && - stricmp(Z_STRVAL_PP(tmp), "auth-int") == 0) { - PHP_MD5Update(&md5ctx, ":", 1); - PHP_MD5Update(&md5ctx, HEntity, HASHHEXLEN); - } -*/ - PHP_MD5Final(hash, &md5ctx); - make_digest(HA2, hash); - - PHP_MD5Init(&md5ctx); - PHP_MD5Update(&md5ctx, HA1, 32); - PHP_MD5Update(&md5ctx, ":", 1); - if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - PHP_MD5Update(&md5ctx, ":", 1); - if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, nc, 8); - PHP_MD5Update(&md5ctx, ":", 1); - PHP_MD5Update(&md5ctx, cnonce, 8); - PHP_MD5Update(&md5ctx, ":", 1); - /* TODO: Support for qop="auth-int" */ - PHP_MD5Update(&md5ctx, "auth", sizeof("auth")-1); - PHP_MD5Update(&md5ctx, ":", 1); - } - PHP_MD5Update(&md5ctx, HA2, 32); - PHP_MD5Final(hash, &md5ctx); - make_digest(response, hash); - - smart_str_append_const(&soap_headers, "Authorization: Digest username=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); - if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_append_const(&soap_headers, "\", realm=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_append_const(&soap_headers, "\", nonce=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - smart_str_append_const(&soap_headers, "\", uri=\""); - if (phpurl->path) { - smart_str_appends(&soap_headers, phpurl->path); - } - if (phpurl->query) { - smart_str_appendc(&soap_headers, '?'); - smart_str_appends(&soap_headers, phpurl->query); - } - if (phpurl->fragment) { - smart_str_appendc(&soap_headers, '#'); - smart_str_appends(&soap_headers, phpurl->fragment); - } - if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - /* TODO: Support for qop="auth-int" */ - smart_str_append_const(&soap_headers, "\", qop=\"auth"); - smart_str_append_const(&soap_headers, "\", nc=\""); - smart_str_appendl(&soap_headers, nc, 8); - smart_str_append_const(&soap_headers, "\", cnonce=\""); - smart_str_appendl(&soap_headers, cnonce, 8); - } - smart_str_append_const(&soap_headers, "\", response=\""); - smart_str_appendl(&soap_headers, response, 32); - if (zend_hash_find(Z_ARRVAL_PP(digest), "opaque", sizeof("opaque"), (void **)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_append_const(&soap_headers, "\", opaque=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - smart_str_append_const(&soap_headers, "\"\r\n"); - } - } else { - char* buf; - int len; - - smart_str auth = {0}; - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); - smart_str_appendc(&auth, ':'); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS && - Z_TYPE_PP(password) == IS_STRING) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); - } - smart_str_0(&auth); - buf = php_base64_encode(auth.c, auth.len, &len); - smart_str_append_const(&soap_headers, "Authorization: Basic "); - smart_str_appendl(&soap_headers, buf, len); - smart_str_append_const(&soap_headers, "\r\n"); - efree(buf); - smart_str_free(&auth); - } - } - - /* Proxy HTTP Authentication */ - if (use_proxy && !use_ssl) { - proxy_authentication(this_ptr, &soap_headers TSRMLS_CC); - } - - /* Send cookies along with request */ - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) { - zval **data; - char *key; - int i, n; - - n = zend_hash_num_elements(Z_ARRVAL_PP(cookies)); - if (n > 0) { - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(cookies)); - smart_str_append_const(&soap_headers, "Cookie: "); - for (i = 0; i < n; i++) { - zend_hash_get_current_data(Z_ARRVAL_PP(cookies), (void **)&data); - zend_hash_get_current_key(Z_ARRVAL_PP(cookies), &key, NULL, FALSE); - - if (Z_TYPE_PP(data) == IS_ARRAY) { - zval** value; - - if (zend_hash_index_find(Z_ARRVAL_PP(data), 0, (void**)&value) == SUCCESS && - Z_TYPE_PP(value) == IS_STRING) { - zval **tmp; - if ((zend_hash_index_find(Z_ARRVAL_PP(data), 1, (void**)&tmp) == FAILURE || - strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_PP(tmp),Z_STRLEN_PP(tmp)) == 0) && - (zend_hash_index_find(Z_ARRVAL_PP(data), 2, (void**)&tmp) == FAILURE || - in_domain(phpurl->host,Z_STRVAL_PP(tmp))) && - (use_ssl || zend_hash_index_find(Z_ARRVAL_PP(data), 3, (void**)&tmp) == FAILURE)) { - smart_str_appendl(&soap_headers, key, strlen(key)); - smart_str_appendc(&soap_headers, '='); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); - smart_str_appendc(&soap_headers, ';'); - } - } - } - zend_hash_move_forward(Z_ARRVAL_PP(cookies)); - } - smart_str_append_const(&soap_headers, "\r\n"); - } - } - smart_str_append_const(&soap_headers, "\r\n"); - smart_str_0(&soap_headers); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_request_headers", soap_headers.c, soap_headers.len, 1); - } - smart_str_appendl(&soap_headers, request, request_size); - smart_str_0(&soap_headers); - - err = php_stream_write(stream, soap_headers.c, soap_headers.len); - if (err != soap_headers.len) { - if (request != buf) {efree(request);} - smart_str_free(&soap_headers); - php_stream_close(stream); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL TSRMLS_CC); - return FALSE; - } - smart_str_free(&soap_headers); - - } else { - add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC); - return FALSE; - } - - do { - if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) { - if (http_headers) {efree(http_headers);} - if (request != buf) {efree(request);} - php_stream_close(stream); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC); - return FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size, 1); - } - - /* Check to see what HTTP status was sent */ - http_1_1 = 0; - http_status = 0; - http_version = get_http_header_value(http_headers,"HTTP/"); - if (http_version) { - char *tmp; - - if (!strncmp(http_version,"1.1", 3)) { - http_1_1 = 1; - } - - tmp = strstr(http_version," "); - if (tmp != NULL) { - tmp++; - http_status = atoi(tmp); - } - efree(http_version); - - /* Try and get headers again */ - if (http_status == 100) { - efree(http_headers); - } - } - } while (http_status == 100); - - /* Grab and send back every cookie */ - - /* Not going to worry about Path: because - we shouldn't be changing urls so path dont - matter too much - */ - cookie_itt = strstr(http_headers,"Set-Cookie: "); - while (cookie_itt) { - char *end_pos, *cookie; - char *eqpos, *sempos; - zval **cookies; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) { - zval *tmp_cookies; - MAKE_STD_ZVAL(tmp_cookies); - array_init(tmp_cookies); - zend_hash_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), &tmp_cookies, sizeof(zval *), (void **)&cookies); - } - - end_pos = strstr(cookie_itt,"\r\n"); - cookie = get_http_header_value(cookie_itt,"Set-Cookie: "); - - eqpos = strstr(cookie, "="); - sempos = strstr(cookie, ";"); - if (eqpos != NULL && (sempos == NULL || sempos > eqpos)) { - smart_str name = {0}; - int cookie_len; - zval *zcookie; - - if (sempos != NULL) { - cookie_len = sempos-(eqpos+1); - } else { - cookie_len = strlen(cookie)-(eqpos-cookie)-1; - } - - smart_str_appendl(&name, cookie, eqpos - cookie); - smart_str_0(&name); - - ALLOC_INIT_ZVAL(zcookie); - array_init(zcookie); - add_index_stringl(zcookie, 0, eqpos + 1, cookie_len, 1); - - if (sempos != NULL) { - char *options = cookie + cookie_len+1; - while (*options) { - while (*options == ' ') {options++;} - sempos = strstr(options, ";"); - if (strstr(options,"path=") == options) { - eqpos = options + sizeof("path=")-1; - add_index_stringl(zcookie, 1, eqpos, sempos?(sempos-eqpos):strlen(eqpos), 1); - } else if (strstr(options,"domain=") == options) { - eqpos = options + sizeof("domain=")-1; - add_index_stringl(zcookie, 2, eqpos, sempos?(sempos-eqpos):strlen(eqpos), 1); - } else if (strstr(options,"secure") == options) { - add_index_bool(zcookie, 3, 1); - } - if (sempos != NULL) { - options = sempos+1; - } else { - break; - } - } - } - if (!zend_hash_index_exists(Z_ARRVAL_P(zcookie), 1)) { - char *t = phpurl->path?phpurl->path:"/"; - char *c = strrchr(t, '/'); - if (c) { - add_index_stringl(zcookie, 1, t, c-t, 1); - } - } - if (!zend_hash_index_exists(Z_ARRVAL_P(zcookie), 2)) { - add_index_string(zcookie, 2, phpurl->host, 1); - } - - add_assoc_zval_ex(*cookies, name.c, name.len+1, zcookie); - smart_str_free(&name); - } - - cookie_itt = strstr(cookie_itt + sizeof("Set-Cookie: "), "Set-Cookie: "); - efree(cookie); - } - - if (!get_http_body(stream, !http_1_1, http_headers, &http_body, &http_body_size TSRMLS_CC)) { - if (request != buf) {efree(request);} - php_stream_close(stream); - efree(http_headers); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC); - return FALSE; - } - - if (request != buf) {efree(request);} - - /* See if the server requested a close */ - http_close = TRUE; - connection = get_http_header_value(http_headers,"Proxy-Connection: "); - if (connection) { - if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) { - http_close = FALSE; - } - efree(connection); -/* - } else if (http_1_1) { - http_close = FALSE; -*/ - } - connection = get_http_header_value(http_headers,"Connection: "); - if (connection) { - if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) { - http_close = FALSE; - } - efree(connection); -/* - } else if (http_1_1) { - http_close = FALSE; -*/ - } - - if (http_close) { - php_stream_close(stream); - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); - stream = NULL; - } - - /* Process HTTP status codes */ - if (http_status >= 300 && http_status < 400) { - char *loc; - - if ((loc = get_http_header_value(http_headers,"Location: ")) != NULL) { - php_url *new_url = php_url_parse(loc); - - if (new_url != NULL) { - efree(http_headers); - efree(http_body); - efree(loc); - if (new_url->scheme == NULL && new_url->path != NULL) { - new_url->scheme = estrdup(phpurl->scheme); - new_url->host = estrdup(phpurl->host); - new_url->port = phpurl->port; - if (new_url->path && new_url->path[0] != '/') { - char *t = phpurl->path?phpurl->path:"/"; - char *p = strrchr(t, '/'); - char *s = emalloc((p - t) + strlen(new_url->path) + 2); - - strncpy(s, t, (p - t) + 1); - s[(p - t) + 1] = 0; - strcat(s, new_url->path); - efree(new_url->path); - new_url->path = s; - } - } - phpurl = new_url; - - goto try_again; - } - } - } else if (http_status == 401) { - /* Digest authentication */ - zval **digest, **login, **password; - char *auth = get_http_header_value(http_headers, "WWW-Authenticate: "); - - if (auth && - strstr(auth, "Digest") == auth && - (zend_hash_find(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"), (void **)&digest) == FAILURE || - Z_TYPE_PP(digest) != IS_ARRAY) && - zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS && - Z_TYPE_PP(login) == IS_STRING && - zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS && - Z_TYPE_PP(password) == IS_STRING) { - char *s; - zval *digest = NULL; - - s = auth + sizeof("Digest")-1; - while (*s != '\0') { - char *name, *val; - while (*s == ' ') ++s; - name = s; - while (*s != '\0' && *s != '=') ++s; - if (*s == '=') { - *s = '\0'; - ++s; - if (*s == '"') { - ++s; - val = s; - while (*s != '\0' && *s != '"') ++s; - } else { - val = s; - while (*s != '\0' && *s != ' ' && *s != ',') ++s; - } - if (*s != '\0') { - if (*s != ',') { - *s = '\0'; - ++s; - while (*s != '\0' && *s != ',') ++s; - if (*s != '\0') ++s; - } else { - *s = '\0'; - ++s; - } - } - if (digest == NULL) { - ALLOC_INIT_ZVAL(digest); - array_init(digest); - } - add_assoc_string(digest, name, val ,1); - } - } - - if (digest != NULL) { - php_url *new_url = emalloc(sizeof(php_url)); - - digest->refcount--; - add_property_zval_ex(this_ptr, "_digest", sizeof("_digest"), digest TSRMLS_CC); - - *new_url = *phpurl; - if (phpurl->scheme) phpurl->scheme = estrdup(phpurl->scheme); - if (phpurl->user) phpurl->user = estrdup(phpurl->user); - if (phpurl->pass) phpurl->pass = estrdup(phpurl->pass); - if (phpurl->host) phpurl->host = estrdup(phpurl->host); - if (phpurl->path) phpurl->path = estrdup(phpurl->path); - if (phpurl->query) phpurl->query = estrdup(phpurl->query); - if (phpurl->fragment) phpurl->fragment = estrdup(phpurl->fragment); - phpurl = new_url; - - efree(auth); - efree(http_headers); - efree(http_body); - - goto try_again; - } - } - if (auth) efree(auth); - } - - /* Check and see if the server even sent a xml document */ - content_type = get_http_header_value(http_headers,"Content-Type: "); - if (content_type) { - char *pos = NULL; - int cmplen; - pos = strstr(content_type,";"); - if (pos != NULL) { - cmplen = pos - content_type; - } else { - cmplen = strlen(content_type); - } - if (strncmp(content_type, "text/xml", cmplen) == 0 || - strncmp(content_type, "application/soap+xml", cmplen) == 0) { - content_type_xml = 1; -/* - if (strncmp(http_body, "= 400) { - int error = 0; - - if (*buffer_len == 0) { - error = 1; - } else if (*buffer_len > 0) { - if (!content_type_xml) { - char *s = *buffer; - - while (*s != '\0' && *s < ' ') { - s++; - } - if (strncmp(s, "= 400 && http_status < 500) { - add_soap_fault(this_ptr, "HTTP", "Client Error", NULL, NULL TSRMLS_CC); - } else if (http_status == 500) { - add_soap_fault(this_ptr, "HTTP", "Internal Server Error", NULL, NULL TSRMLS_CC); - } else if (http_status >= 500 && http_status < 600) { - add_soap_fault(this_ptr, "HTTP", "Server Error", NULL, NULL TSRMLS_CC); - } else { - add_soap_fault(this_ptr, "HTTP", "Unsupported HTTP status code", NULL, NULL TSRMLS_CC); - } - return FALSE; - } - } - - return TRUE; -} - -static char *get_http_header_value(char *headers, char *type) -{ - char *pos, *tmp = NULL; - int typelen, headerslen; - - typelen = strlen(type); - headerslen = strlen(headers); - - /* header `titles' can be lower case, or any case combination, according - * to the various RFC's. */ - pos = headers; - do { - /* start of buffer or start of line */ - if (strncasecmp(pos, type, typelen) == 0) { - char *eol; - - /* match */ - tmp = pos + typelen; - eol = strstr(tmp, "\r\n"); - if (eol == NULL) { - eol = headers + headerslen; - } - return estrndup(tmp, eol - tmp); - } - - /* find next line */ - pos = strstr(pos, "\r\n"); - if (pos) { - pos += 2; - } - - } while (pos); - - return NULL; -} - -static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size TSRMLS_DC) -{ - char *header, *http_buf = NULL; - int header_close = close, header_chunked = 0, header_length = 0, http_buf_size = 0; - - if (!close) { - header = get_http_header_value(headers, "Connection: "); - if (header) { - if(!strncasecmp(header, "close", sizeof("close")-1)) header_close = 1; - efree(header); - } - } - header = get_http_header_value(headers, "Transfer-Encoding: "); - if (header) { - if(!strncasecmp(header, "chunked", sizeof("chunked")-1)) header_chunked = 1; - efree(header); - } - header = get_http_header_value(headers, "Content-Length: "); - if (header) { - header_length = atoi(header); - efree(header); - if (!header_length && !header_chunked) { - /* Empty response */ - http_buf = emalloc(1); - http_buf[0] = '\0'; - (*response) = http_buf; - (*out_size) = 0; - return TRUE; - } - } - - if (header_chunked) { - char done, chunk_size[10]; - - done = FALSE; - - while (!done) { - int buf_size = 0; - - php_stream_gets(stream, chunk_size, sizeof(chunk_size)); - if (sscanf(chunk_size, "%x", &buf_size) > 0 ) { - if (buf_size > 0) { - int len_size = 0; - - if (http_buf_size + buf_size + 1 < 0) { - efree(http_buf); - return FALSE; - } - http_buf = erealloc(http_buf, http_buf_size + buf_size + 1); - - while (len_size < buf_size) { - int len_read = php_stream_read(stream, http_buf + http_buf_size, buf_size - len_size); - if (len_read <= 0) { - /* Error or EOF */ - done = TRUE; - break; - } - len_size += len_read; - http_buf_size += len_read; - } - } - - /* Eat up '\r' '\n' */ - php_stream_getc(stream); - php_stream_getc(stream); - } else { - /* Somthing wrong in chunked encoding */ - if (http_buf) { - efree(http_buf); - } - return FALSE; - } - if (buf_size == 0) { - done = TRUE; - } - } - - if (http_buf == NULL) { - http_buf = emalloc(1); - } - - } else if (header_length) { - if (header_length < 0) { - return FALSE; - } - http_buf = emalloc(header_length + 1); - while (http_buf_size < header_length) { - int len_read = php_stream_read(stream, http_buf + http_buf_size, header_length - http_buf_size); - if (len_read <= 0) { - break; - } - http_buf_size += len_read; - } - } else if (header_close) { - do { - int len_read; - http_buf = erealloc(http_buf, http_buf_size + 4096 + 1); - len_read = php_stream_read(stream, http_buf + http_buf_size, 4096); - if (len_read > 0) { - http_buf_size += len_read; - } - } while(!php_stream_eof(stream)); - } else { - return FALSE; - } - - http_buf[http_buf_size] = '\0'; - (*response) = http_buf; - (*out_size) = http_buf_size; - return TRUE; -} - -static int get_http_headers(php_stream *stream, char **response, int *out_size TSRMLS_DC) -{ - int done = FALSE; - smart_str tmp_response = {0}; - char headerbuf[8192]; - - while (!done) { - if (!php_stream_gets(stream, headerbuf, sizeof(headerbuf))) { - break; - } - - if (strcmp(headerbuf, "\r\n") == 0) { - /* empty line marks end of headers */ - done = TRUE; - break; - } - - /* add header to collection */ - smart_str_appends(&tmp_response, headerbuf); - } - smart_str_0(&tmp_response); - (*response) = tmp_response.c; - (*out_size) = tmp_response.len; - return done; -} diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h deleted file mode 100644 index 97dcdc36c3b94..0000000000000 --- a/ext/soap/php_http.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_HTTP_H -#define PHP_HTTP_H - -int make_http_soap_request(zval *this_ptr, - char *request, - int request_size, - char *location, - char *soapaction, - int soap_version, - char **response, - int *response_len TSRMLS_DC); - -void proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC); -void basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC); -#endif diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c deleted file mode 100644 index da5983f1be819..0000000000000 --- a/ext/soap/php_packet_soap.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_soap.h" - -/* SOAP client calls this function to parse response from SOAP server */ -int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC) -{ - char* envelope_ns = NULL; - xmlDocPtr response; - xmlNodePtr trav, env, head, body, resp, cur, fault; - xmlAttrPtr attr; - int param_count = 0; - int soap_version = SOAP_1_1; - HashTable *hdrs = NULL; - - ZVAL_NULL(return_value); - - /* Response for one-way opearation */ - if (buffer_size == 0) { - return TRUE; - } - - /* Parse XML packet */ - response = soap_xmlParseMemory(buffer, buffer_size); - - if (!response) { - add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC); - return FALSE; - } - if (xmlGetIntSubset(response) != NULL) { - add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - - /* Get element */ - env = NULL; - trav = response->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_1_ENV_NAMESPACE)) { - env = trav; - envelope_ns = SOAP_1_1_ENV_NAMESPACE; - soap_version = SOAP_1_1; - } else if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_2_ENV_NAMESPACE)) { - env = trav; - envelope_ns = SOAP_1_2_ENV_NAMESPACE; - soap_version = SOAP_1_2; - } else { - add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - } - trav = trav->next; - } - if (env == NULL) { - add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - - attr = env->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (soap_version == SOAP_1_2) { - add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - } - attr = attr->next; - } - - /* Get
element */ - head = NULL; - trav = env->children; - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (trav != NULL && node_is_equal_ex(trav,"Header",envelope_ns)) { - head = trav; - trav = trav->next; - } - - /* Get element */ - body = NULL; - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (trav != NULL && node_is_equal_ex(trav,"Body",envelope_ns)) { - body = trav; - trav = trav->next; - } - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (body == NULL) { - add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - attr = body->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - if (soap_version == SOAP_1_2) { - add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (soap_version == SOAP_1_2) { - add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - } - attr = attr->next; - } - if (trav != NULL && soap_version == SOAP_1_2) { - add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - - if (head != NULL) { - attr = head->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (soap_version == SOAP_1_2) { - add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; - } - } - attr = attr->next; - } - } - - /* Check if contains element */ - fault = get_node_ex(body->children,"Fault",envelope_ns); - if (fault != NULL) { - char *faultcode = NULL, *faultstring = NULL, *faultactor = NULL; - zval *details = NULL; - xmlNodePtr tmp; - - if (soap_version == SOAP_1_1) { - tmp = get_node(fault->children,"faultcode"); - if (tmp != NULL && tmp->children != NULL) { - faultcode = tmp->children->content; - } - - tmp = get_node(fault->children,"faultstring"); - if (tmp != NULL && tmp->children != NULL) { - faultstring = tmp->children->content; - } - - tmp = get_node(fault->children,"faultactor"); - if (tmp != NULL && tmp->children != NULL) { - faultactor = tmp->children->content; - } - - tmp = get_node(fault->children,"detail"); - if (tmp != NULL) { - details = master_to_zval(NULL, tmp); - } - } else { - tmp = get_node(fault->children,"Code"); - if (tmp != NULL && tmp->children != NULL) { - tmp = get_node(tmp->children,"Value"); - if (tmp != NULL && tmp->children != NULL) { - faultcode = tmp->children->content; - } - } - - tmp = get_node(fault->children,"Reason"); - if (tmp != NULL && tmp->children != NULL) { - /* TODO: lang attribute */ - tmp = get_node(tmp->children,"Text"); - if (tmp != NULL && tmp->children != NULL) { - faultstring = tmp->children->content; - } - } - - tmp = get_node(fault->children,"Detail"); - if (tmp != NULL) { - details = master_to_zval(NULL, tmp); - } - } - add_soap_fault(this_ptr, faultcode, faultstring, faultactor, details TSRMLS_CC); -#ifdef ZEND_ENGINE_2 - if (details) { - details->refcount--; - } -#endif - xmlFreeDoc(response); - return FALSE; - } - - /* Parse content of element */ - array_init(return_value); - resp = body->children; - while (resp != NULL && resp->type != XML_ELEMENT_NODE) { - resp = resp->next; - } - if (resp != NULL) { - if (fn != NULL && fn->binding && fn->binding->bindingType == BINDING_SOAP) { - /* Function has WSDL description */ - sdlParamPtr *h_param, param = NULL; - xmlNodePtr val = NULL; - char *name, *ns = NULL; - zval* tmp; - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes; - int res_count; - - hdrs = fnb->output.headers; - - if (fn->responseParameters) { - res_count = zend_hash_num_elements(fn->responseParameters); - zend_hash_internal_pointer_reset(fn->responseParameters); - while (zend_hash_get_current_data(fn->responseParameters, (void **)&h_param) == SUCCESS) { - param = (*h_param); - if (fnb->style == SOAP_DOCUMENT) { - if (param->element) { - name = param->element->name; - ns = param->element->namens; -/* - name = param->encode->details.type_str; - ns = param->encode->details.ns; -*/ - } else { - name = param->paramName; - } - } else { - name = fn->responseName; - /* ns = ? */ - } - - /* Get value of parameter */ - cur = get_node_ex(resp, name, ns); - if (!cur) { - cur = get_node(resp, name); - /* TODO: produce warning invalid ns */ - } - if (!cur && fnb->style == SOAP_RPC) { - cur = resp; - } - if (cur) { - if (fnb->style == SOAP_DOCUMENT) { - val = cur; - } else { - val = get_node(cur->children, param->paramName); - if (res_count == 1) { - if (val == NULL) { - val = get_node(cur->children, "return"); - } - if (val == NULL) { - val = get_node(cur->children, "result"); - } - if (val == NULL && cur->children && cur->children->next == NULL) { - val = cur->children; - } - } - } - } - - if (!val) { - /* TODO: may be "nil" is not OK? */ - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); -/* - add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL TSRMLS_CC); - xmlFreeDoc(response); - return FALSE; -*/ - } else { - /* Decoding value of parameter */ - if (param != NULL) { - tmp = master_to_zval(param->encode, val); - } else { - tmp = master_to_zval(NULL, val); - } - } - add_assoc_zval(return_value, param->paramName, tmp); - - param_count++; - - zend_hash_move_forward(fn->responseParameters); - } - } - } else { - /* Function hasn't WSDL description */ - xmlNodePtr val; - val = resp->children; - while (val != NULL) { - while (val && val->type != XML_ELEMENT_NODE) { - val = val->next; - } - if (val != NULL) { - if (!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPACE)) { - zval *tmp; - - tmp = master_to_zval(NULL, val); - if (val->name) { - add_assoc_zval(return_value, (char*)val->name, tmp); - } else { - add_next_index_zval(return_value, tmp); - } - ++param_count; - } - val = val->next; - } - } - } - } - - if (Z_TYPE_P(return_value) == IS_ARRAY) { - if (param_count == 0) { - zval_dtor(return_value); - ZVAL_NULL(return_value); - } else if (param_count == 1) { - zval *tmp; - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(return_value)); - zend_hash_get_current_data(Z_ARRVAL_P(return_value), (void**)&tmp); - tmp = *(zval**)tmp; - tmp->refcount++; - zval_dtor(return_value); - *return_value = *tmp; - FREE_ZVAL(tmp); - } - } - - if (soap_headers && head) { - trav = head->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - encodePtr enc = NULL; - zval* val; - - if (hdrs) { - smart_str key = {0}; - sdlSoapBindingFunctionHeaderPtr *hdr; - - if (trav->ns) { - smart_str_appends(&key,trav->ns->href); - smart_str_appendc(&key,':'); - } - smart_str_appends(&key,trav->name); - smart_str_0(&key); - if (zend_hash_find(hdrs, key.c, key.len+1, (void**)&hdr) == SUCCESS) { - enc = (*hdr)->encode; - } - smart_str_free(&key); - } - val = master_to_zval(enc, trav); - add_assoc_zval(soap_headers, (char*)trav->name, val); - } - trav = trav->next; - } - } - - xmlFreeDoc(response); - return TRUE; -} diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h deleted file mode 100644 index e1ed78e2434fd..0000000000000 --- a/ext/soap/php_packet_soap.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_PACKET_SOAP_H -#define PHP_PACKET_SOAP_H - -int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC); - -#endif diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c deleted file mode 100644 index d6183ffc939b7..0000000000000 --- a/ext/soap/php_schema.c +++ /dev/null @@ -1,2444 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_soap.h" -#include "libxml/uri.h" - -static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type); -static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type); -static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type); -static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type); -static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type); -static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType); -static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type); -static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type); -static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type); -static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model); -static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx); -static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx); - -static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr); - -static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *valptr); - -static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type); - -static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type) -{ - smart_str nscat = {0}; - encodePtr enc, *enc_ptr; - - if (sdl->encoders == NULL) { - sdl->encoders = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); - } - smart_str_appends(&nscat, ns); - smart_str_appendc(&nscat, ':'); - smart_str_appends(&nscat, type); - smart_str_0(&nscat); - if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) { - enc = *enc_ptr; - if (enc->details.ns) { - efree(enc->details.ns); - } - if (enc->details.type_str) { - efree(enc->details.type_str); - } - } else { - enc_ptr = NULL; - enc = emalloc(sizeof(encode)); - } - memset(enc, 0, sizeof(encode)); - - enc->details.ns = estrdup(ns); - enc->details.type_str = estrdup(type); - enc->details.sdl_type = cur_type; - enc->to_xml = sdl_guess_convert_xml; - enc->to_zval = sdl_guess_convert_zval; - - if (enc_ptr == NULL) { - zend_hash_update(sdl->encoders, nscat.c, nscat.len + 1, &enc, sizeof(encodePtr), NULL); - } - smart_str_free(&nscat); - return enc; -} - -static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type) -{ - encodePtr enc = get_encoder(sdl, ns, type); - if (enc == NULL) { - enc = create_encoder(sdl, cur_type, ns, type); - } - return enc; -} - -static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) { - if (location != NULL && - !zend_hash_exists(&ctx->docs, location, strlen(location)+1)) { - xmlDocPtr doc; - xmlNodePtr schema; - xmlAttrPtr new_tns; - - doc = soap_xmlParseFile(location TSRMLS_CC); - if (doc == NULL) { - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); - } - schema = get_node(doc->children, "schema"); - if (schema == NULL) { - xmlFreeDoc(doc); - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); - } - new_tns = get_attribute(schema->properties, "targetNamespace"); - if (import) { - if (ns != NULL && (new_tns == NULL || strcmp(ns->children->content,new_tns->children->content) != 0)) { - xmlFreeDoc(doc); - soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, new_tns->children->content); - } - if (ns == NULL && new_tns != NULL) { - xmlFreeDoc(doc); - soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, new_tns->children->content); - } - } else { - new_tns = get_attribute(schema->properties, "targetNamespace"); - if (new_tns == NULL) { - if (tns != NULL) { - xmlSetProp(schema, "targetNamespace", tns->children->content); - } - } else if (tns != NULL && strcmp(tns->children->content,new_tns->children->content) != 0) { - xmlFreeDoc(doc); - soap_error1(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location); - } - } - zend_hash_add(&ctx->docs, location, strlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL); - load_schema(ctx, schema TSRMLS_CC); - } -} - -/* -2.6.1 xsi:type -2.6.2 xsi:nil -2.6.3 xsi:schemaLocation, xsi:noNamespaceSchemaLocation -*/ - -/* - - Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*) - -*/ -int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC) -{ - xmlNodePtr trav; - xmlAttrPtr tns; - - if (!ctx->sdl->types) { - ctx->sdl->types = emalloc(sizeof(HashTable)); - zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, 0); - } - if (!ctx->attributes) { - ctx->attributes = emalloc(sizeof(HashTable)); - zend_hash_init(ctx->attributes, 0, NULL, delete_attribute, 0); - } - if (!ctx->attributeGroups) { - ctx->attributeGroups = emalloc(sizeof(HashTable)); - zend_hash_init(ctx->attributeGroups, 0, NULL, delete_type, 0); - } - - tns = get_attribute(schema->properties, "targetNamespace"); - if (tns == NULL) { - tns = xmlSetProp(schema, "targetNamespace", ""); - xmlNewNs(schema, "", NULL); - } - - trav = schema->children; - while (trav != NULL) { - if (node_is_equal(trav,"include")) { - xmlAttrPtr location; - - location = get_attribute(trav->properties, "schemaLocation"); - if (location == NULL) { - soap_error0(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute"); - } else { - xmlChar *uri; - xmlChar *base = xmlNodeGetBase(trav->doc, trav); - - if (base == NULL) { - uri = xmlBuildURI(location->children->content, trav->doc->URL); - } else { - uri = xmlBuildURI(location->children->content, base); - xmlFree(base); - } - schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC); - xmlFree(uri); - } - - } else if (node_is_equal(trav,"redefine")) { - xmlAttrPtr location; - - location = get_attribute(trav->properties, "schemaLocation"); - if (location == NULL) { - soap_error0(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute"); - } else { - xmlChar *uri; - xmlChar *base = xmlNodeGetBase(trav->doc, trav); - - if (base == NULL) { - uri = xmlBuildURI(location->children->content, trav->doc->URL); - } else { - uri = xmlBuildURI(location->children->content, base); - xmlFree(base); - } - schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC); - xmlFree(uri); - /* TODO: support */ - } - - } else if (node_is_equal(trav,"import")) { - xmlAttrPtr ns, location; - xmlChar *uri = NULL; - - ns = get_attribute(trav->properties, "namespace"); - location = get_attribute(trav->properties, "schemaLocation"); - - if (ns != NULL && tns != NULL && strcmp(ns->children->content,tns->children->content) == 0) { - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content); - } - if (location) { - xmlChar *base = xmlNodeGetBase(trav->doc, trav); - - if (base == NULL) { - uri = xmlBuildURI(location->children->content, trav->doc->URL); - } else { - uri = xmlBuildURI(location->children->content, base); - xmlFree(base); - } - } - schema_load_file(ctx, ns, uri, tns, 1 TSRMLS_CC); - if (uri != NULL) {xmlFree(uri);} - } else if (node_is_equal(trav,"annotation")) { - /* TODO: support */ -/* annotation cleanup - xmlNodePtr tmp = trav; - trav = trav->next; - xmlUnlinkNode(tmp); - xmlFreeNode(tmp); - continue; -*/ - } else { - break; - } - trav = trav->next; - } - - while (trav != NULL) { - if (node_is_equal(trav,"simpleType")) { - schema_simpleType(ctx->sdl, tns, trav, NULL); - } else if (node_is_equal(trav,"complexType")) { - schema_complexType(ctx->sdl, tns, trav, NULL); - } else if (node_is_equal(trav,"group")) { - schema_group(ctx->sdl, tns, trav, NULL, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(ctx->sdl, tns, trav, NULL, ctx); - } else if (node_is_equal(trav,"element")) { - schema_element(ctx->sdl, tns, trav, NULL, NULL); - } else if (node_is_equal(trav,"attribute")) { - schema_attribute(ctx->sdl, tns, trav, NULL, ctx); - } else if (node_is_equal(trav,"notation")) { - /* TODO: support */ - } else if (node_is_equal(trav,"annotation")) { - /* TODO: support */ - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name); - } - trav = trav->next; - } - return TRUE; -} - -/* - - Content: (annotation?, (restriction | list | union)) - -*/ -static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr name, ns; - - ns = get_attribute(simpleType->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - - name = get_attribute(simpleType->properties, "name"); - if (cur_type != NULL) { - /* Anonymous type inside or */ - sdlTypePtr newType, *ptr; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - newType->kind = XSD_TYPEKIND_SIMPLE; - if (name != NULL) { - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - } else { - newType->name = estrdup(cur_type->name); - newType->namens = estrdup(cur_type->namens); - } - - zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); - - if (sdl->encoders == NULL) { - sdl->encoders = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); - } - cur_type->encode = emalloc(sizeof(encode)); - memset(cur_type->encode, 0, sizeof(encode)); - cur_type->encode->details.ns = estrdup(newType->namens); - cur_type->encode->details.type_str = estrdup(newType->name); - cur_type->encode->details.sdl_type = *ptr; - cur_type->encode->to_xml = sdl_guess_convert_xml; - cur_type->encode->to_zval = sdl_guess_convert_zval; - zend_hash_next_index_insert(sdl->encoders, &cur_type->encode, sizeof(encodePtr), NULL); - - cur_type =*ptr; - - } else if (name != NULL) { - sdlTypePtr newType, *ptr; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - newType->kind = XSD_TYPEKIND_SIMPLE; - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - - if (cur_type == NULL) { - zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); - } else { - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - zend_hash_update(cur_type->elements, newType->name, strlen(newType->name)+1, &newType, sizeof(sdlTypePtr), (void **)&ptr); - } - cur_type = (*ptr); - - create_encoder(sdl, cur_type, ns->children->content, name->children->content); - } else { - soap_error0(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute"); - } - - trav = simpleType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"restriction")) { - schema_restriction_simpleContent(sdl, tns, trav, cur_type, 1); - trav = trav->next; - } else if (node_is_equal(trav,"list")) { - cur_type->kind = XSD_TYPEKIND_LIST; - schema_list(sdl, tns, trav, cur_type); - trav = trav->next; - } else if (node_is_equal(trav,"union")) { - cur_type->kind = XSD_TYPEKIND_UNION; - schema_union(sdl, tns, trav, cur_type); - trav = trav->next; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); - } - } else { - soap_error0(E_ERROR, "Parsing Schema: expected , or in simpleType"); - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); - } - - return TRUE; -} - -/* - - Content: (annotation?, (simpleType?)) - -*/ -static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr itemType; - - itemType = get_attribute(listType->properties, "itemType"); - if (itemType != NULL) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(itemType->children->content, &type, &ns); - nsptr = xmlSearchNs(listType->doc, listType, ns); - if (nsptr != NULL) { - sdlTypePtr newType, *tmp; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - newType->name = estrdup(type); - newType->namens = estrdup(nsptr->href); - - newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type); - - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - } - - trav = listType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL && node_is_equal(trav,"simpleType")) { - sdlTypePtr newType, *tmp; - - if (itemType != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype"); - } - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - newType->name = estrdup("anonymous"); - newType->namens = estrdup(tns->children->content); - - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); - - schema_simpleType(sdl, tns, trav, newType); - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name); - } - return TRUE; -} - -/* - - Content: (annotation?, (simpleType*)) - -*/ -static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr memberTypes; - - memberTypes = get_attribute(unionType->properties, "memberTypes"); - if (memberTypes != NULL) { - char *str, *start, *end, *next; - char *type, *ns; - xmlNsPtr nsptr; - - str = estrdup(memberTypes->children->content); - whiteSpace_collapse(str); - start = str; - while (start != NULL && *start != '\0') { - end = strchr(start,' '); - if (end == NULL) { - next = NULL; - } else { - *end = '\0'; - next = end+1; - } - - parse_namespace(start, &type, &ns); - nsptr = xmlSearchNs(unionType->doc, unionType, ns); - if (nsptr != NULL) { - sdlTypePtr newType, *tmp; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - newType->name = estrdup(type); - newType->namens = estrdup(nsptr->href); - - newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type); - - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - - start = next; - } - efree(str); - } - - trav = unionType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"simpleType")) { - sdlTypePtr newType, *tmp; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - newType->name = estrdup("anonymous"); - newType->namens = estrdup(tns->children->content); - - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); - - schema_simpleType(sdl, tns, trav, newType); - - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); - } - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); - } - return TRUE; -} - -/* - - Content: (annotation?, (restriction | extension)) - -*/ -static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - - trav = simpCompType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav, "restriction")) { - cur_type->kind = XSD_TYPEKIND_RESTRICTION; - schema_restriction_simpleContent(sdl, tns, trav, cur_type, 0); - trav = trav->next; - } else if (node_is_equal(trav, "extension")) { - cur_type->kind = XSD_TYPEKIND_EXTENSION; - schema_extension_simpleContent(sdl, tns, trav, cur_type); - trav = trav->next; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); - } - } else { - soap_error0(E_ERROR, "Parsing Schema: expected or in simpleContent"); - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); - } - - return TRUE; -} - -/* -simpleType: - Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?) - -simpleContent: - Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?, ((attribute | attributeGroup)*, anyAttribute?)) - -*/ -static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType) -{ - xmlNodePtr trav; - xmlAttrPtr base; - - base = get_attribute(restType->properties, "base"); - if (base != NULL) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(base->children->content, &type, &ns); - nsptr = xmlSearchNs(restType->doc, restType, ns); - if (nsptr != NULL) { - cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - } else if (!simpleType) { - soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); - } - - if (cur_type->restrictions == NULL) { - cur_type->restrictions = emalloc(sizeof(sdlRestrictions)); - memset(cur_type->restrictions, 0, sizeof(sdlRestrictions)); - } - - trav = restType->children; - if (trav != NULL && node_is_equal(trav, "annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL && node_is_equal(trav, "simpleType")) { - schema_simpleType(sdl, tns, trav, cur_type); - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav, "minExclusive")) { - schema_restriction_var_int(trav, &cur_type->restrictions->minExclusive); - } else if (node_is_equal(trav, "minInclusive")) { - schema_restriction_var_int(trav, &cur_type->restrictions->minInclusive); - } else if (node_is_equal(trav, "maxExclusive")) { - schema_restriction_var_int(trav, &cur_type->restrictions->maxExclusive); - } else if (node_is_equal(trav, "maxInclusive")) { - schema_restriction_var_int(trav, &cur_type->restrictions->maxInclusive); - } else if (node_is_equal(trav, "totalDigits")) { - schema_restriction_var_int(trav, &cur_type->restrictions->totalDigits); - } else if (node_is_equal(trav, "fractionDigits")) { - schema_restriction_var_int(trav, &cur_type->restrictions->fractionDigits); - } else if (node_is_equal(trav, "length")) { - schema_restriction_var_int(trav, &cur_type->restrictions->length); - } else if (node_is_equal(trav, "minLength")) { - schema_restriction_var_int(trav, &cur_type->restrictions->minLength); - } else if (node_is_equal(trav, "maxLength")) { - schema_restriction_var_int(trav, &cur_type->restrictions->maxLength); - } else if (node_is_equal(trav, "whiteSpace")) { - schema_restriction_var_char(trav, &cur_type->restrictions->whiteSpace); - } else if (node_is_equal(trav, "pattern")) { - schema_restriction_var_char(trav, &cur_type->restrictions->pattern); - } else if (node_is_equal(trav, "enumeration")) { - sdlRestrictionCharPtr enumval = NULL; - - schema_restriction_var_char(trav, &enumval); - if (cur_type->restrictions->enumeration == NULL) { - cur_type->restrictions->enumeration = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, 0); - } - zend_hash_add(cur_type->restrictions->enumeration, enumval->value, strlen(enumval->value)+1, &enumval, sizeof(sdlRestrictionCharPtr), NULL); - } else { - break; - } - trav = trav->next; - } - if (!simpleType) { - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); - } - trav = trav->next; - } - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); - } - - return TRUE; -} - -/* - - Content: (annotation?, (group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)) - -*/ -static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type) -{ - xmlAttrPtr base; - xmlNodePtr trav; - - base = get_attribute(restType->properties, "base"); - if (base != NULL) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(base->children->content, &type, &ns); - nsptr = xmlSearchNs(restType->doc, restType, ns); - if (nsptr != NULL) { - cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - } else { - soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); - } - - trav = restType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"group")) { - schema_group(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"all")) { - schema_all(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"choice")) { - schema_choice(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"sequence")) { - schema_sequence(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } - } - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); - } - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); - } - - return TRUE; -} - -static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr) -{ - xmlAttrPtr fixed, value; - - if ((*valptr) == NULL) { - (*valptr) = emalloc(sizeof(sdlRestrictionInt)); - } - memset((*valptr), 0, sizeof(sdlRestrictionInt)); - - fixed = get_attribute(val->properties, "fixed"); - (*valptr)->fixed = FALSE; - if (fixed != NULL) { - if (!strncmp(fixed->children->content, "true", sizeof("true")) || - !strncmp(fixed->children->content, "1", sizeof("1"))) - (*valptr)->fixed = TRUE; - } - - value = get_attribute(val->properties, "value"); - if (value == NULL) { - soap_error0(E_ERROR, "Parsing Schema: missing restriction value"); - } - - (*valptr)->value = atoi(value->children->content); - - return TRUE; -} - -static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *valptr) -{ - xmlAttrPtr fixed, value; - - if ((*valptr) == NULL) { - (*valptr) = emalloc(sizeof(sdlRestrictionChar)); - } - memset((*valptr), 0, sizeof(sdlRestrictionChar)); - - fixed = get_attribute(val->properties, "fixed"); - (*valptr)->fixed = FALSE; - if (fixed != NULL) { - if (!strncmp(fixed->children->content, "true", sizeof("true")) || - !strncmp(fixed->children->content, "1", sizeof("1"))) { - (*valptr)->fixed = TRUE; - } - } - - value = get_attribute(val->properties, "value"); - if (value == NULL) { - soap_error0(E_ERROR, "Parsing Schema: missing restriction value"); - } - - (*valptr)->value = estrdup(value->children->content); - return TRUE; -} - -/* -From simpleContent (not supported): - - Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) - -*/ -static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr base; - - base = get_attribute(extType->properties, "base"); - if (base != NULL) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(base->children->content, &type, &ns); - nsptr = xmlSearchNs(extType->doc, extType, ns); - if (nsptr != NULL) { - cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - } else { - soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); - } - - trav = extType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); - } - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); - } - return TRUE; -} - -/* -From complexContent: - - Content: (annotation?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))) - -*/ -static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr base; - - base = get_attribute(extType->properties, "base"); - if (base != NULL) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(base->children->content, &type, &ns); - nsptr = xmlSearchNs(extType->doc, extType, ns); - if (nsptr != NULL) { - cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type); - } - if (type) {efree(type);} - if (ns) {efree(ns);} - } else { - soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); - } - - trav = extType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"group")) { - schema_group(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"all")) { - schema_all(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"choice")) { - schema_choice(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"sequence")) { - schema_sequence(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } - } - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); - } - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); - } - return TRUE; -} - -/* - - Content: (annotation?, element*) - -*/ -static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - xmlNodePtr trav; - xmlAttrPtr attr; - sdlContentModelPtr newModel; - - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_ALL; - newModel->u.content = emalloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); - if (model == NULL) { - cur_type->model = newModel; - } else { - zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL); - } - - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(all->properties, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - attr = get_attribute(all->properties, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - trav = all->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"element")) { - schema_element(sdl, tns, trav, cur_type, newModel); - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name); - } - trav = trav->next; - } - return TRUE; -} - -/* - - - Content: (annotation?) - -*/ -static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - xmlNodePtr trav; - xmlAttrPtr attr; - xmlAttrPtr ns, name, ref = NULL; - sdlContentModelPtr newModel; - - ns = get_attribute(groupType->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - - name = get_attribute(groupType->properties, "name"); - if (name == NULL) { - name = ref = get_attribute(groupType->properties, "ref"); - } - - if (name) { - smart_str key = {0}; - - if (ref) { - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(ref->children->content, &type, &ns); - nsptr = xmlSearchNs(groupType->doc, groupType, ns); - if (nsptr != NULL) { - smart_str_appends(&key, nsptr->href); - smart_str_appendc(&key, ':'); - } - smart_str_appends(&key, type); - smart_str_0(&key); - - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_GROUP_REF; - newModel->u.group_ref = estrdup(key.c); - - if (type) {efree(type);} - if (ns) {efree(ns);} - } else { - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_SEQUENCE; /* will be redefined */ - newModel->u.content = emalloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); - - smart_str_appends(&key, ns->children->content); - smart_str_appendc(&key, ':'); - smart_str_appends(&key, name->children->content); - smart_str_0(&key); - } - - if (cur_type == NULL) { - sdlTypePtr newType; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - if (sdl->groups == NULL) { - sdl->groups = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->groups, 0, NULL, delete_type, 0); - } - if (zend_hash_add(sdl->groups, key.c, key.len+1, (void**)&newType, sizeof(sdlTypePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing Schema: group '%s' already defined", key.c); - } - - cur_type = newType; - } - smart_str_free(&key); - - if (model == NULL) { - cur_type->model = newModel; - } else { - zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL); - } - } else { - soap_error0(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes"); - } - - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(groupType->properties, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - attr = get_attribute(groupType->properties, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - trav = groupType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"choice")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); - } - newModel->kind = XSD_CONTENT_CHOICE; - schema_choice(sdl, tns, trav, cur_type, newModel); - trav = trav->next; - } else if (node_is_equal(trav,"sequence")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); - } - newModel->kind = XSD_CONTENT_SEQUENCE; - schema_sequence(sdl, tns, trav, cur_type, newModel); - trav = trav->next; - } else if (node_is_equal(trav,"all")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); - } - newModel->kind = XSD_CONTENT_ALL; - schema_all(sdl, tns, trav, cur_type, newModel); - trav = trav->next; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); - } - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); - } - return TRUE; -} -/* - - Content: (annotation?, (element | group | choice | sequence | any)*) - -*/ -static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - xmlNodePtr trav; - xmlAttrPtr attr; - sdlContentModelPtr newModel; - - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_CHOICE; - newModel->u.content = emalloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); - if (model == NULL) { - cur_type->model = newModel; - } else { - zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL); - } - - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(choiceType->properties, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - attr = get_attribute(choiceType->properties, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - trav = choiceType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"element")) { - schema_element(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"group")) { - schema_group(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"choice")) { - schema_choice(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"sequence")) { - schema_sequence(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"any")) { - schema_any(sdl, tns, trav, cur_type, newModel); - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name); - } - trav = trav->next; - } - return TRUE; -} - -/* - - Content: (annotation?, (element | group | choice | sequence | any)*) - -*/ -static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - xmlNodePtr trav; - xmlAttrPtr attr; - sdlContentModelPtr newModel; - - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_SEQUENCE; - newModel->u.content = emalloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); - if (model == NULL) { - cur_type->model = newModel; - } else { - zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL); - } - - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(seqType->properties, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - attr = get_attribute(seqType->properties, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - trav = seqType->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"element")) { - schema_element(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"group")) { - schema_group(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"choice")) { - schema_choice(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"sequence")) { - schema_sequence(sdl, tns, trav, cur_type, newModel); - } else if (node_is_equal(trav,"any")) { - schema_any(sdl, tns, trav, cur_type, newModel); - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name); - } - trav = trav->next; - } - return TRUE; -} - -/* - - Content: (annotation?) - -*/ -static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr anyType, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - if (model != NULL) { - sdlContentModelPtr newModel; - xmlAttrPtr attr; - - newModel = emalloc(sizeof(sdlContentModel)); - newModel->kind = XSD_CONTENT_ANY; - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(anyType->properties, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - attr = get_attribute(anyType->properties, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL); - } - return TRUE; -} - -/* - - Content: (annotation?, (restriction | extension)) - -*/ -static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compCont, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - - trav = compCont->children; - if (trav != NULL && node_is_equal(trav,"annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav, "restriction")) { - cur_type->kind = XSD_TYPEKIND_RESTRICTION; - schema_restriction_complexContent(sdl, tns, trav, cur_type); - trav = trav->next; - } else if (node_is_equal(trav, "extension")) { - cur_type->kind = XSD_TYPEKIND_EXTENSION; - schema_extension_complexContent(sdl, tns, trav, cur_type); - trav = trav->next; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); - } - } else { - soap_error0(E_ERROR, "Parsing Schema: or expected in complexContent"); - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); - } - - return TRUE; -} - -/* - - Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))) - -*/ -static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type) -{ - xmlNodePtr trav; - xmlAttrPtr attrs, name, ns; - - attrs = compType->properties; - ns = get_attribute(attrs, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - - name = get_attribute(attrs, "name"); - if (cur_type != NULL) { - /* Anonymous type inside */ - sdlTypePtr newType, *ptr; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - newType->kind = XSD_TYPEKIND_COMPLEX; - if (name != NULL) { - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - } else { - newType->name = estrdup(cur_type->name); - newType->namens = estrdup(cur_type->namens); - } - - zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); - - if (sdl->encoders == NULL) { - sdl->encoders = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); - } - cur_type->encode = emalloc(sizeof(encode)); - memset(cur_type->encode, 0, sizeof(encode)); - cur_type->encode->details.ns = estrdup(newType->namens); - cur_type->encode->details.type_str = estrdup(newType->name); - cur_type->encode->details.sdl_type = *ptr; - cur_type->encode->to_xml = sdl_guess_convert_xml; - cur_type->encode->to_zval = sdl_guess_convert_zval; - zend_hash_next_index_insert(sdl->encoders, &cur_type->encode, sizeof(encodePtr), NULL); - - cur_type =*ptr; - - } else if (name) { - sdlTypePtr newType, *ptr; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - newType->kind = XSD_TYPEKIND_COMPLEX; - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - - zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); - - cur_type = (*ptr); - create_encoder(sdl, cur_type, ns->children->content, name->children->content); - } else { - soap_error0(E_ERROR, "Parsing Schema: complexType has no 'name' attribute"); - return FALSE; - } - - trav = compType->children; - if (trav != NULL && node_is_equal(trav, "annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"simpleContent")) { - schema_simpleContent(sdl, tns, trav, cur_type); - trav = trav->next; - } else if (node_is_equal(trav,"complexContent")) { - schema_complexContent(sdl, tns, trav, cur_type); - trav = trav->next; - } else { - if (node_is_equal(trav,"group")) { - schema_group(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"all")) { - schema_all(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"choice")) { - schema_choice(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } else if (node_is_equal(trav,"sequence")) { - schema_sequence(sdl, tns, trav, cur_type, NULL); - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); - } - trav = trav->next; - } - } - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); - } - return TRUE; -} -/* - - Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*)) - -*/ -static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model) -{ - xmlNodePtr trav; - xmlAttrPtr attrs, attr, ns, name, type, ref = NULL; - - attrs = element->properties; - ns = get_attribute(attrs, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - - name = get_attribute(attrs, "name"); - if (name == NULL) { - name = ref = get_attribute(attrs, "ref"); - } - - if (name) { - HashTable *addHash; - sdlTypePtr newType; - smart_str key = {0}; - - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - - if (ref) { - smart_str nscat = {0}; - char *type, *ns; - xmlNsPtr nsptr; - - parse_namespace(ref->children->content, &type, &ns); - nsptr = xmlSearchNs(element->doc, element, ns); - if (nsptr != NULL) { - smart_str_appends(&nscat, nsptr->href); - smart_str_appendc(&nscat, ':'); - newType->namens = estrdup(nsptr->href); - } - smart_str_appends(&nscat, type); - newType->name = estrdup(type); - smart_str_0(&nscat); - if (type) {efree(type);} - if (ns) {efree(ns);} - newType->ref = estrdup(nscat.c); - smart_str_free(&nscat); - } else { - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - } - - newType->nillable = FALSE; - - if (cur_type == NULL) { - if (sdl->elements == NULL) { - sdl->elements = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->elements, 0, NULL, delete_type, 0); - } - addHash = sdl->elements; - smart_str_appends(&key, newType->namens); - smart_str_appendc(&key, ':'); - smart_str_appends(&key, newType->name); - } else { - if (cur_type->elements == NULL) { - cur_type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); - } - addHash = cur_type->elements; - smart_str_appends(&key, newType->name); - } - - smart_str_0(&key); - if (zend_hash_add(addHash, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) { - if (cur_type == NULL) { - soap_error1(E_ERROR, "Parsing Schema: element '%s' already defined", key.c); - } else { - zend_hash_next_index_insert(addHash, &newType, sizeof(sdlTypePtr), NULL); - } - } - smart_str_free(&key); - - if (model != NULL) { - sdlContentModelPtr newModel = emalloc(sizeof(sdlContentModel)); - - newModel->kind = XSD_CONTENT_ELEMENT; - newModel->u.element = newType; - newModel->min_occurs = 1; - newModel->max_occurs = 1; - - attr = get_attribute(attrs, "maxOccurs"); - if (attr) { - if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) { - newModel->max_occurs = -1; - } else { - newModel->max_occurs = atoi(attr->children->content); - } - } - - attr = get_attribute(attrs, "minOccurs"); - if (attr) { - newModel->min_occurs = atoi(attr->children->content); - } - - zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL); - } - cur_type = newType; - } else { - soap_error0(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes"); - } - - /* nillable = boolean : false */ - attrs = element->properties; - attr = get_attribute(attrs, "nillable"); - if (attr) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes"); - } - if (!stricmp(attr->children->content, "true") || - !stricmp(attr->children->content, "1")) { - cur_type->nillable = TRUE; - } else { - cur_type->nillable = FALSE; - } - } else { - cur_type->nillable = FALSE; - } - - attr = get_attribute(attrs, "fixed"); - if (attr) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); - } - cur_type->fixed = estrdup(attr->children->content); - } - - attr = get_attribute(attrs, "default"); - if (attr) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); - } else if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); - } - cur_type->def = estrdup(attr->children->content); - } - - /* form */ - attr = get_attribute(attrs, "form"); - if (attr) { - if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) { - cur_type->form = XSD_FORM_QUALIFIED; - } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) { - cur_type->form = XSD_FORM_UNQUALIFIED; - } else { - cur_type->form = XSD_FORM_DEFAULT; - } - } else { - cur_type->form = XSD_FORM_DEFAULT; - } - if (cur_type->form == XSD_FORM_DEFAULT) { - xmlNodePtr parent = element->parent; - while (parent) { - if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { - xmlAttrPtr def; - def = get_attribute(parent->properties, "elementFormDefault"); - if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { - cur_type->form = XSD_FORM_UNQUALIFIED; - } else { - cur_type->form = XSD_FORM_QUALIFIED; - } - break; - } - parent = parent->parent; - } - if (parent == NULL) { - cur_type->form = XSD_FORM_UNQUALIFIED; - } - } - - /* type = QName */ - type = get_attribute(attrs, "type"); - if (type) { - char *cptype, *str_ns; - xmlNsPtr nsptr; - - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes"); - } - parse_namespace(type->children->content, &cptype, &str_ns); - nsptr = xmlSearchNs(element->doc, element, str_ns); - if (nsptr != NULL) { - cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype); - } - if (str_ns) {efree(str_ns);} - if (cptype) {efree(cptype);} - } - - trav = element->children; - if (trav != NULL && node_is_equal(trav, "annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"simpleType")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); - } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); - } - schema_simpleType(sdl, tns, trav, cur_type); - trav = trav->next; - } else if (node_is_equal(trav,"complexType")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); - } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); - } - schema_complexType(sdl, tns, trav, cur_type); - trav = trav->next; - } - } - while (trav != NULL) { - if (node_is_equal(trav,"unique")) { - /* TODO: support */ - } else if (node_is_equal(trav,"key")) { - /* TODO: support */ - } else if (node_is_equal(trav,"keyref")) { - /* TODO: support */ - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name); - } - trav = trav->next; - } - - return TRUE; -} - -/* - - Content: (annotation?, (simpleType?)) - -*/ -static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx) -{ - sdlAttributePtr newAttr; - xmlAttrPtr attr, name, ref = NULL, type = NULL; - xmlNodePtr trav; - - name = get_attribute(attrType->properties, "name"); - if (name == NULL) { - name = ref = get_attribute(attrType->properties, "ref"); - } - if (name) { - HashTable *addHash; - smart_str key = {0}; - - newAttr = emalloc(sizeof(sdlAttribute)); - memset(newAttr, 0, sizeof(sdlAttribute)); - - if (ref) { - char *attr_name, *ns; - xmlNsPtr nsptr; - - parse_namespace(ref->children->content, &attr_name, &ns); - nsptr = xmlSearchNs(attrType->doc, attrType, ns); - if (nsptr != NULL) { - smart_str_appends(&key, nsptr->href); - smart_str_appendc(&key, ':'); - newAttr->namens = estrdup(nsptr->href); - } - smart_str_appends(&key, attr_name); - smart_str_0(&key); - newAttr->ref = estrdup(key.c); - if (attr_name) {efree(attr_name);} - if (ns) {efree(ns);} - } else { - xmlAttrPtr ns; - - ns = get_attribute(attrType->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - if (ns != NULL) { - smart_str_appends(&key, ns->children->content); - smart_str_appendc(&key, ':'); - newAttr->namens = estrdup(ns->children->content); - } - smart_str_appends(&key, name->children->content); - smart_str_0(&key); - } - - if (cur_type == NULL) { - addHash = ctx->attributes; - } else { - if (cur_type->attributes == NULL) { - cur_type->attributes = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0); - } - addHash = cur_type->attributes; - } - - if (zend_hash_add(addHash, key.c, key.len + 1, &newAttr, sizeof(sdlAttributePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing Schema: attribute '%s' already defined", key.c); - } - smart_str_free(&key); - } else{ - soap_error0(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes"); - } - - /* type = QName */ - type = get_attribute(attrType->properties, "type"); - if (type) { - char *cptype, *str_ns; - xmlNsPtr nsptr; - - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes"); - } - parse_namespace(type->children->content, &cptype, &str_ns); - nsptr = xmlSearchNs(attrType->doc, attrType, str_ns); - if (nsptr != NULL) { - newAttr->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype); - } - if (str_ns) {efree(str_ns);} - if (cptype) {efree(cptype);} - } - - attr = attrType->properties; - while (attr != NULL) { - if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) { - newAttr->def = estrdup(attr->children->content); - } else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) { - newAttr->fixed = estrdup(attr->children->content); - } else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) { - if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) { - newAttr->form = XSD_FORM_QUALIFIED; - } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) { - newAttr->form = XSD_FORM_UNQUALIFIED; - } else { - newAttr->form = XSD_FORM_DEFAULT; - } - } else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) { - /* skip */ - } else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) { - newAttr->name = estrdup(attr->children->content); - } else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) { - /* already processed */ - } else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) { - /* already processed */ - } else if (attr_is_equal_ex(attr, "use", SCHEMA_NAMESPACE)) { - if (strncmp(attr->children->content,"prohibited",sizeof("prohibited")) == 0) { - newAttr->use = XSD_USE_PROHIBITED; - } else if (strncmp(attr->children->content,"required",sizeof("required")) == 0) { - newAttr->use = XSD_USE_REQUIRED; - } else if (strncmp(attr->children->content,"optional",sizeof("optional")) == 0) { - newAttr->use = XSD_USE_OPTIONAL; - } else { - newAttr->use = XSD_USE_DEFAULT; - } - } else { - xmlNsPtr nsPtr = attr_find_ns(attr); - - if (strncmp(nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) { - smart_str key2 = {0}; - sdlExtraAttributePtr ext; - xmlNsPtr nsptr; - char *value, *ns; - - ext = emalloc(sizeof(sdlExtraAttribute)); - memset(ext, 0, sizeof(sdlExtraAttribute)); - parse_namespace(attr->children->content, &value, &ns); - nsptr = xmlSearchNs(attr->doc, attr->parent, ns); - if (nsptr) { - ext->ns = estrdup(nsptr->href); - ext->val = estrdup(value); - } else { - ext->val = estrdup(attr->children->content); - } - if (ns) {efree(ns);} - efree(value); - - if (!newAttr->extraAttributes) { - newAttr->extraAttributes = emalloc(sizeof(HashTable)); - zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0); - } - - smart_str_appends(&key2, nsPtr->href); - smart_str_appendc(&key2, ':'); - smart_str_appends(&key2, attr->name); - smart_str_0(&key2); - zend_hash_add(newAttr->extraAttributes, key2.c, key2.len + 1, &ext, sizeof(sdlExtraAttributePtr), NULL); - smart_str_free(&key2); - } - } - attr = attr->next; - } - if (newAttr->form == XSD_FORM_DEFAULT) { - xmlNodePtr parent = attrType->parent; - while (parent) { - if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { - xmlAttrPtr def; - def = get_attribute(parent->properties, "attributeFormDefault"); - if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { - newAttr->form = XSD_FORM_UNQUALIFIED; - } else { - newAttr->form = XSD_FORM_QUALIFIED; - } - break; - } - parent = parent->parent; - } - if (parent == NULL) { - newAttr->form = XSD_FORM_UNQUALIFIED; - } - } - trav = attrType->children; - if (trav != NULL && node_is_equal(trav, "annotation")) { - /* TODO: support */ - trav = trav->next; - } - if (trav != NULL) { - if (node_is_equal(trav,"simpleType")) { - sdlTypePtr dummy_type; - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype"); - } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype"); - } - dummy_type = emalloc(sizeof(sdlType)); - memset(dummy_type, 0, sizeof(sdlType)); - dummy_type->name = estrdup("anonymous"); - dummy_type->namens = estrdup(tns->children->content); - schema_simpleType(sdl, tns, trav, dummy_type); - newAttr->encode = dummy_type->encode; - delete_type(&dummy_type); - trav = trav->next; - } - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name); - } - return TRUE; -} - -static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGroup, sdlTypePtr cur_type, sdlCtx *ctx) -{ - xmlNodePtr trav; - xmlAttrPtr name, ref = NULL; - - - name = get_attribute(attrGroup->properties, "name"); - if (name == NULL) { - name = ref = get_attribute(attrGroup->properties, "ref"); - } - if (name) { - if (cur_type == NULL) { - xmlAttrPtr ns; - sdlTypePtr newType; - smart_str key = {0}; - - ns = get_attribute(attrGroup->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - newType = emalloc(sizeof(sdlType)); - memset(newType, 0, sizeof(sdlType)); - newType->name = estrdup(name->children->content); - newType->namens = estrdup(ns->children->content); - - smart_str_appends(&key, newType->namens); - smart_str_appendc(&key, ':'); - smart_str_appends(&key, newType->name); - smart_str_0(&key); - - if (zend_hash_add(ctx->attributeGroups, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", key.c); - } - cur_type = newType; - smart_str_free(&key); - } else if (ref) { - sdlAttributePtr newAttr; - char *group_name, *ns; - smart_str key = {0}; - xmlNsPtr nsptr; - - if (cur_type->attributes == NULL) { - cur_type->attributes = emalloc(sizeof(HashTable)); - zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0); - } - newAttr = emalloc(sizeof(sdlAttribute)); - memset(newAttr, 0, sizeof(sdlAttribute)); - - parse_namespace(ref->children->content, &group_name, &ns); - nsptr = xmlSearchNs(attrGroup->doc, attrGroup, ns); - if (nsptr != NULL) { - smart_str_appends(&key, nsptr->href); - smart_str_appendc(&key, ':'); - } - smart_str_appends(&key, group_name); - smart_str_0(&key); - newAttr->ref = estrdup(key.c); - if (group_name) {efree(group_name);} - if (ns) {efree(ns);} - smart_str_free(&key); - - zend_hash_next_index_insert(cur_type->attributes, &newAttr, sizeof(sdlAttributePtr), NULL); - cur_type = NULL; - } - } else{ - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes"); - } - - trav = attrGroup->children; - if (trav != NULL && node_is_equal(trav, "annotation")) { - /* TODO: support */ - trav = trav->next; - } - while (trav != NULL) { - if (node_is_equal(trav,"attribute")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); - } - schema_attribute(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"attributeGroup")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); - } - schema_attributeGroup(sdl, tns, trav, cur_type, NULL); - } else if (node_is_equal(trav,"anyAttribute")) { - if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); - } - /* TODO: support */ - trav = trav->next; - break; - } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); - } - trav = trav->next; - } - if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); - } - return TRUE; -} - -static void copy_extra_attribute(void *attribute) -{ - sdlExtraAttributePtr *attr = (sdlExtraAttributePtr*)attribute; - sdlExtraAttributePtr new_attr; - - new_attr = emalloc(sizeof(sdlExtraAttribute)); - memcpy(new_attr, *attr, sizeof(sdlExtraAttribute)); - *attr = new_attr; - if (new_attr->ns) { - new_attr->ns = estrdup(new_attr->ns); - } - if (new_attr->val) { - new_attr->val = estrdup(new_attr->val); - } -} - -static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) -{ - sdlAttributePtr *tmp; - - if (attr->ref != NULL) { - if (ctx->attributes != NULL) { - if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { - schema_attribute_fixup(ctx, *tmp); - if ((*tmp)->name != NULL && attr->name == NULL) { - attr->name = estrdup((*tmp)->name); - } - if ((*tmp)->namens != NULL && attr->namens == NULL) { - attr->namens = estrdup((*tmp)->namens); - } - if ((*tmp)->def != NULL && attr->def == NULL) { - attr->def = estrdup((*tmp)->def); - } - if ((*tmp)->fixed != NULL && attr->fixed == NULL) { - attr->fixed = estrdup((*tmp)->fixed); - } - if (attr->form == XSD_FORM_DEFAULT) { - attr->form = (*tmp)->form; - } - if (attr->use == XSD_USE_DEFAULT) { - attr->use = (*tmp)->use; - } - if ((*tmp)->extraAttributes != NULL) { - xmlNodePtr node; - - attr->extraAttributes = emalloc(sizeof(HashTable)); - zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, 0); - zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); - } - attr->encode = (*tmp)->encode; - } - } - if (attr->name == NULL && attr->ref != NULL) { - char *name = strrchr(attr->ref, ':'); - if (*name) { - attr->name = estrdup(name+1); - } else{ - attr->name = estrdup(attr->ref); - } - } - efree(attr->ref); - attr->ref = NULL; - } -} - -static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashTable *ht) -{ - sdlTypePtr *tmp; - sdlAttributePtr *tmp_attr; - - if (attr->ref != NULL) { - if (ctx->attributeGroups != NULL) { - if (zend_hash_find(ctx->attributeGroups, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { - if ((*tmp)->attributes) { - zend_hash_internal_pointer_reset((*tmp)->attributes); - while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) { - if (zend_hash_get_current_key_type((*tmp)->attributes) == HASH_KEY_IS_STRING) { - char* key; - uint key_len; - sdlAttributePtr newAttr; - - schema_attribute_fixup(ctx,*tmp_attr); - - newAttr = emalloc(sizeof(sdlAttribute)); - memcpy(newAttr, *tmp_attr, sizeof(sdlAttribute)); - if (newAttr->def) {newAttr->def = estrdup(newAttr->def);} - if (newAttr->fixed) {newAttr->fixed = estrdup(newAttr->fixed);} - if (newAttr->namens) {newAttr->namens = estrdup(newAttr->namens);} - if (newAttr->name) {newAttr->name = estrdup(newAttr->name);} - if (newAttr->extraAttributes) { - xmlNodePtr node; - HashTable *ht = emalloc(sizeof(HashTable)); - zend_hash_init(ht, 0, NULL, delete_extra_attribute, 0); - zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); - newAttr->extraAttributes = ht; - } - - zend_hash_get_current_key_ex((*tmp)->attributes, &key, &key_len, NULL, 0, NULL); - zend_hash_add(ht, key, key_len, &newAttr, sizeof(sdlAttributePtr), NULL); - - zend_hash_move_forward((*tmp)->attributes); - } else { - ulong index; - - schema_attributegroup_fixup(ctx,*tmp_attr, ht); - zend_hash_get_current_key((*tmp)->attributes, NULL, &index, 0); - zend_hash_index_del((*tmp)->attributes, index); - } - } - } - } - } - efree(attr->ref); - attr->ref = NULL; - } -} - -static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model) -{ - switch (model->kind) { - case XSD_CONTENT_GROUP_REF: { - sdlTypePtr *tmp; - - if (ctx->sdl->groups && zend_hash_find(ctx->sdl->groups, model->u.group_ref, strlen(model->u.group_ref)+1, (void**)&tmp) == SUCCESS) { - schema_type_fixup(ctx,*tmp); - efree(model->u.group_ref); - model->kind = XSD_CONTENT_GROUP; - model->u.group = (*tmp); - } else { - soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute"); - } - break; - } - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - - zend_hash_internal_pointer_reset(model->u.content); - while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) { - schema_content_model_fixup(ctx, *tmp); - zend_hash_move_forward(model->u.content); - } - break; - } - default: - break; - } -} - -static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) -{ - sdlTypePtr *tmp; - sdlAttributePtr *attr; - - if (type->ref != NULL) { - if (ctx->sdl->elements != NULL) { - if (zend_hash_find(ctx->sdl->elements, type->ref, strlen(type->ref)+1, (void**)&tmp) == SUCCESS) { - type->kind = (*tmp)->kind; - type->encode = (*tmp)->encode; - if ((*tmp)->nillable) { - type->nillable = 1; - } - if ((*tmp)->fixed) { - type->fixed = estrdup((*tmp)->fixed); - } - if ((*tmp)->def) { - type->def = estrdup((*tmp)->def); - } - type->form = (*tmp)->form; - } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) { - type->encode = get_conversion(XSD_ANYXML); - } else { - soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute"); - } - } - efree(type->ref); - type->ref = NULL; - } - if (type->elements) { - zend_hash_internal_pointer_reset(type->elements); - while (zend_hash_get_current_data(type->elements,(void**)&tmp) == SUCCESS) { - schema_type_fixup(ctx,*tmp); - zend_hash_move_forward(type->elements); - } - } - if (type->model) { - schema_content_model_fixup(ctx, type->model); - } - if (type->attributes) { - zend_hash_internal_pointer_reset(type->attributes); - while (zend_hash_get_current_data(type->attributes,(void**)&attr) == SUCCESS) { - if (zend_hash_get_current_key_type(type->attributes) == HASH_KEY_IS_STRING) { - schema_attribute_fixup(ctx,*attr); - zend_hash_move_forward(type->attributes); - } else { - ulong index; - - schema_attributegroup_fixup(ctx,*attr,type->attributes); - zend_hash_get_current_key(type->attributes, NULL, &index, 0); - zend_hash_index_del(type->attributes, index); - } - } - } -} - -void schema_pass2(sdlCtx *ctx) -{ - sdlPtr sdl = ctx->sdl; - sdlAttributePtr *attr; - sdlTypePtr *type; - - if (ctx->attributes) { - zend_hash_internal_pointer_reset(ctx->attributes); - while (zend_hash_get_current_data(ctx->attributes,(void**)&attr) == SUCCESS) { - schema_attribute_fixup(ctx,*attr); - zend_hash_move_forward(ctx->attributes); - } - } - if (ctx->attributeGroups) { - zend_hash_internal_pointer_reset(ctx->attributeGroups); - while (zend_hash_get_current_data(ctx->attributeGroups,(void**)&type) == SUCCESS) { - schema_type_fixup(ctx,*type); - zend_hash_move_forward(ctx->attributeGroups); - } - } - if (sdl->elements) { - zend_hash_internal_pointer_reset(sdl->elements); - while (zend_hash_get_current_data(sdl->elements,(void**)&type) == SUCCESS) { - schema_type_fixup(ctx,*type); - zend_hash_move_forward(sdl->elements); - } - } - if (sdl->groups) { - zend_hash_internal_pointer_reset(sdl->groups); - while (zend_hash_get_current_data(sdl->groups,(void**)&type) == SUCCESS) { - schema_type_fixup(ctx,*type); - zend_hash_move_forward(sdl->groups); - } - } - if (sdl->types) { - zend_hash_internal_pointer_reset(sdl->types); - while (zend_hash_get_current_data(sdl->types,(void**)&type) == SUCCESS) { - schema_type_fixup(ctx,*type); - zend_hash_move_forward(sdl->types); - } - } - if (ctx->attributes) { - zend_hash_destroy(ctx->attributes); - efree(ctx->attributes); - } - if (ctx->attributeGroups) { - zend_hash_destroy(ctx->attributeGroups); - efree(ctx->attributeGroups); - } -} - -void delete_model(void *handle) -{ - sdlContentModelPtr tmp = *((sdlContentModelPtr*)handle); - switch (tmp->kind) { - case XSD_CONTENT_ELEMENT: - case XSD_CONTENT_GROUP: - break; - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: - zend_hash_destroy(tmp->u.content); - efree(tmp->u.content); - break; - case XSD_CONTENT_GROUP_REF: - efree(tmp->u.group_ref); - break; - default: - break; - } - efree(tmp); -} - -void delete_type(void *data) -{ - sdlTypePtr type = *((sdlTypePtr*)data); - if (type->name) { - efree(type->name); - } - if (type->namens) { - efree(type->namens); - } - if (type->def) { - efree(type->def); - } - if (type->fixed) { - efree(type->fixed); - } - if (type->elements) { - zend_hash_destroy(type->elements); - efree(type->elements); - } - if (type->attributes) { - zend_hash_destroy(type->attributes); - efree(type->attributes); - } - if (type->model) { - delete_model((void**)&type->model); - } - if (type->restrictions) { - delete_restriction_var_int(&type->restrictions->minExclusive); - delete_restriction_var_int(&type->restrictions->minInclusive); - delete_restriction_var_int(&type->restrictions->maxExclusive); - delete_restriction_var_int(&type->restrictions->maxInclusive); - delete_restriction_var_int(&type->restrictions->totalDigits); - delete_restriction_var_int(&type->restrictions->fractionDigits); - delete_restriction_var_int(&type->restrictions->length); - delete_restriction_var_int(&type->restrictions->minLength); - delete_restriction_var_int(&type->restrictions->maxLength); - delete_restriction_var_char(&type->restrictions->whiteSpace); - delete_restriction_var_char(&type->restrictions->pattern); - if (type->restrictions->enumeration) { - zend_hash_destroy(type->restrictions->enumeration); - efree(type->restrictions->enumeration); - } - efree(type->restrictions); - } - efree(type); -} - -void delete_extra_attribute(void *attribute) -{ - sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute); - - if (attr->ns) { - efree(attr->ns); - } - if (attr->val) { - efree(attr->val); - } - efree(attr); -} - -void delete_attribute(void *attribute) -{ - sdlAttributePtr attr = *((sdlAttributePtr*)attribute); - - if (attr->def) { - efree(attr->def); - } - if (attr->fixed) { - efree(attr->fixed); - } - if (attr->name) { - efree(attr->name); - } - if (attr->namens) { - efree(attr->namens); - } - if (attr->ref) { - efree(attr->ref); - } - if (attr->extraAttributes) { - zend_hash_destroy(attr->extraAttributes); - efree(attr->extraAttributes); - } - efree(attr); -} - -void delete_restriction_var_int(void *rvi) -{ - sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi); - if (ptr) { - efree(ptr); - } -} - -void delete_restriction_var_char(void *srvc) -{ - sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc); - if (ptr) { - if (ptr->value) { - efree(ptr->value); - } - efree(ptr); - } -} diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h deleted file mode 100644 index d1fed2bb95c8f..0000000000000 --- a/ext/soap/php_schema.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_SCHEMA_H -#define PHP_SCHEMA_H - -int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC); -void schema_pass2(sdlCtx *ctx); - -void delete_model(void *handle); -void delete_type(void *data); -void delete_extra_attribute(void *attribute); -void delete_attribute(void *attribute); -void delete_restriction_var_int(void *rvi); -void delete_restriction_var_char(void *srvc); -#endif diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c deleted file mode 100644 index 50055c5f20fd7..0000000000000 --- a/ext/soap/php_sdl.c +++ /dev/null @@ -1,2490 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_soap.h" -#include "ext/libxml/php_libxml.h" -#include "libxml/uri.h" - -#include "ext/standard/md5.h" -#include "tsrm_virtual_cwd.h" - -#include -#include -#include - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -static void delete_fault(void *fault); -static void delete_binding(void *binding); -static void delete_function(void *function); -static void delete_parameter(void *paramater); -static void delete_header(void *header); -static void delete_document(void *doc_ptr); - -encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const char *type) -{ - encodePtr enc = NULL; - xmlNsPtr nsptr; - char *ns, *cptype; - - parse_namespace(type, &cptype, &ns); - nsptr = xmlSearchNs(node->doc, node, ns); - if (nsptr != NULL) { - enc = get_encoder(sdl, nsptr->href, cptype); - if (enc == NULL) { - enc = get_encoder_ex(sdl, cptype, strlen(cptype)); - } - } else { - enc = get_encoder_ex(sdl, type, strlen(type)); - } - efree(cptype); - if (ns) {efree(ns);} - return enc; -} - -static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const char *type) -{ - sdlTypePtr ret = NULL; - - if (sdl->elements) { - xmlNsPtr nsptr; - char *ns, *cptype; - sdlTypePtr *sdl_type; - - parse_namespace(type, &cptype, &ns); - nsptr = xmlSearchNs(node->doc, node, ns); - if (nsptr != NULL) { - int ns_len = strlen(nsptr->href); - int type_len = strlen(cptype); - int len = ns_len + type_len + 1; - char *nscat = emalloc(len + 1); - - memcpy(nscat, nsptr->href, ns_len); - nscat[ns_len] = ':'; - memcpy(nscat+ns_len+1, cptype, type_len); - nscat[len] = '\0'; - - if (zend_hash_find(sdl->elements, nscat, len + 1, (void **)&sdl_type) == SUCCESS) { - ret = *sdl_type; - } else if (zend_hash_find(sdl->elements, (char*)type, type_len + 1, (void **)&sdl_type) == SUCCESS) { - ret = *sdl_type; - } - efree(nscat); - } else { - if (zend_hash_find(sdl->elements, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) { - ret = *sdl_type; - } - } - - efree(cptype); - if (ns) {efree(ns);} - } - return ret; -} - -encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type) -{ - encodePtr enc = NULL; - char *nscat; - int ns_len = strlen(ns); - int type_len = strlen(type); - int len = ns_len + type_len + 1; - - nscat = emalloc(len + 1); - memcpy(nscat, ns, ns_len); - nscat[ns_len] = ':'; - memcpy(nscat+ns_len+1, type, type_len); - nscat[len] = '\0'; - - enc = get_encoder_ex(sdl, nscat, len); - efree(nscat); - - if (enc == NULL && - ((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 && - memcmp(ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) || - (ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 && - memcmp(ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) { - ns_len = sizeof(XSD_NAMESPACE)-1; - len = ns_len + type_len + 1; - nscat = emalloc(len + 1); - memcpy(nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1); - nscat[ns_len] = ':'; - memcpy(nscat+ns_len+1, type, type_len); - nscat[len] = '\0'; - - enc = get_encoder_ex(sdl, nscat, len); - efree(nscat); - } - return enc; -} - -encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len) -{ - encodePtr *enc; - TSRMLS_FETCH(); - - if (zend_hash_find(&SOAP_GLOBAL(defEnc), (char*)nscat, len + 1, (void **)&enc) == SUCCESS) { - return (*enc); - } else if (sdl && sdl->encoders && zend_hash_find(sdl->encoders, (char*)nscat, len + 1, (void **)&enc) == SUCCESS) { - return (*enc); - } - return NULL; -} - -sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type) -{ - sdlBindingPtr *binding; - - if (sdl == NULL) { - return NULL; - } - - for (zend_hash_internal_pointer_reset(sdl->bindings); - zend_hash_get_current_data(sdl->bindings, (void **) &binding) == SUCCESS; - zend_hash_move_forward(sdl->bindings)) { - if ((*binding)->bindingType == type) { - return *binding; - } - } - return NULL; -} - -sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns) -{ - sdlBindingPtr binding = NULL; - smart_str key = {0}; - - smart_str_appends(&key, ns); - smart_str_appendc(&key, ':'); - smart_str_appends(&key, name); - smart_str_0(&key); - - zend_hash_find(sdl->bindings, key.c, key.len, (void **)&binding); - - smart_str_free(&key); - return binding; -} - -static int is_wsdl_element(xmlNodePtr node) -{ - if (node->ns && strcmp(node->ns->href,WSDL_NAMESPACE) != 0) { - xmlAttrPtr attr; - if ((attr = get_attribute_ex(node->properties, "required", WSDL_NAMESPACE)) != NULL && - attr->children && attr->children->content && - (strcmp(attr->children->content,"1") == 0 || - strcmp(attr->children->content,"true") == 0)) { - soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href); - } - return 0; - } - return 1; -} - -static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC) -{ - sdlPtr tmpsdl = ctx->sdl; - xmlDocPtr wsdl; - xmlNodePtr root, definitions, trav; - xmlAttrPtr targetNamespace; - - if (zend_hash_exists(&ctx->docs, struri, strlen(struri)+1)) { - return; - } - - wsdl = soap_xmlParseFile(struri TSRMLS_CC); - - if (!wsdl) { - soap_error1(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri); - } - - zend_hash_add(&ctx->docs, struri, strlen(struri)+1, (void**)&wsdl, sizeof(xmlDocPtr), NULL); - - root = wsdl->children; - definitions = get_node_ex(root, "definitions", WSDL_NAMESPACE); - if (!definitions) { - if (include) { - xmlNodePtr schema = get_node_ex(root, "schema", XSD_NAMESPACE); - if (schema) { - load_schema(ctx, schema TSRMLS_CC); - return; - } - } - soap_error1(E_ERROR, "Parsing WSDL: Couldn't find in '%s'", struri); - } - - if (!include) { - targetNamespace = get_attribute(definitions->properties, "targetNamespace"); - if (targetNamespace) { - tmpsdl->target_ns = estrdup(targetNamespace->children->content); - } - } - - trav = definitions->children; - while (trav != NULL) { - if (!is_wsdl_element(trav)) { - trav = trav->next; - continue; - } - if (node_is_equal(trav,"types")) { - /* TODO: Only one "types" is allowed */ - xmlNodePtr trav2 = trav->children; - - while (trav2 != NULL) { - if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) { - load_schema(ctx, trav2 TSRMLS_CC); - } else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name); - } - trav2 = trav2->next; - } - } else if (node_is_equal(trav,"import")) { - /* TODO: namespace ??? */ - xmlAttrPtr tmp = get_attribute(trav->properties, "location"); - if (tmp) { - xmlChar *uri; - xmlChar *base = xmlNodeGetBase(trav->doc, trav); - - if (base == NULL) { - uri = xmlBuildURI(tmp->children->content, trav->doc->URL); - } else { - uri = xmlBuildURI(tmp->children->content, base); - xmlFree(base); - } - load_wsdl_ex(this_ptr, uri, ctx, 1 TSRMLS_CC); - xmlFree(uri); - } - - } else if (node_is_equal(trav,"message")) { - xmlAttrPtr name = get_attribute(trav->properties, "name"); - if (name && name->children && name->children->content) { - if (zend_hash_add(&ctx->messages, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: hasn't name attribute"); - } - - } else if (node_is_equal(trav,"portType")) { - xmlAttrPtr name = get_attribute(trav->properties, "name"); - if (name && name->children && name->children->content) { - if (zend_hash_add(&ctx->portTypes, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: hasn't name attribute"); - } - - } else if (node_is_equal(trav,"binding")) { - xmlAttrPtr name = get_attribute(trav->properties, "name"); - if (name && name->children && name->children->content) { - if (zend_hash_add(&ctx->bindings, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: hasn't name attribute"); - } - - } else if (node_is_equal(trav,"service")) { - xmlAttrPtr name = get_attribute(trav->properties, "name"); - if (name && name->children && name->children->content) { - if (zend_hash_add(&ctx->services, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: hasn't name attribute"); - } - } else if (!node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - trav = trav->next; - } -} - -static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xmlNodePtr header, char* wsdl_soap_namespace, int fault) -{ - xmlAttrPtr tmp; - xmlNodePtr *message, part; - char *ctype; - sdlSoapBindingFunctionHeaderPtr h; - - tmp = get_attribute(header->properties, "message"); - if (!tmp) { - soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for
"); - } - - ctype = strrchr(tmp->children->content,':'); - if (ctype == NULL) { - ctype = tmp->children->content; - } else { - ++ctype; - } - if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&message) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", tmp->children->content); - } - - tmp = get_attribute(header->properties, "part"); - if (!tmp) { - soap_error0(E_ERROR, "Parsing WSDL: Missing part attribute for
"); - } - part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", tmp->children->content, NULL); - if (!part) { - soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in ", tmp->children->content); - } - - h = emalloc(sizeof(sdlSoapBindingFunctionHeader)); - memset(h, 0, sizeof(sdlSoapBindingFunctionHeader)); - h->name = estrdup(tmp->children->content); - - tmp = get_attribute(header->properties, "use"); - if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) { - h->use = SOAP_ENCODED; - } else { - h->use = SOAP_LITERAL; - } - - tmp = get_attribute(header->properties, "namespace"); - if (tmp) { - h->ns = estrdup(tmp->children->content); - } - - if (h->use == SOAP_ENCODED) { - tmp = get_attribute(header->properties, "encodingStyle"); - if (tmp) { - if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) { - h->encodingStyle = SOAP_ENCODING_1_1; - } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { - h->encodingStyle = SOAP_ENCODING_1_2; - } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); - } - } - - tmp = get_attribute(part->properties, "type"); - if (tmp != NULL) { - h->encode = get_encoder_from_prefix(ctx->sdl, part, tmp->children->content); - } else { - tmp = get_attribute(part->properties, "element"); - if (tmp != NULL) { - h->element = get_element(ctx->sdl, part, tmp->children->content); - if (h->element) { - h->encode = h->element->encode; - if (!h->ns && h->element->namens) { - h->ns = estrdup(h->element->namens); - } - } - if (h->element->name) { - efree(h->name); - h->name = estrdup(h->element->name); - } - } - } - if (!fault) { - xmlNodePtr trav = header->children; - while (trav != NULL) { - if (node_is_equal_ex(trav, "headerfault", wsdl_soap_namespace)) { - sdlSoapBindingFunctionHeaderPtr hf = wsdl_soap_binding_header(ctx, trav, wsdl_soap_namespace, 1); - smart_str key = {0}; - - if (h->headerfaults == NULL) { - h->headerfaults = emalloc(sizeof(HashTable)); - zend_hash_init(h->headerfaults, 0, NULL, delete_header, 0); - } - - if (hf->ns) { - smart_str_appends(&key,hf->ns); - smart_str_appendc(&key,':'); - } - smart_str_appends(&key,hf->name); - smart_str_0(&key); - if (zend_hash_add(h->headerfaults, key.c, key.len+1, (void**)&hf, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL) != SUCCESS) { - delete_header((void**)&hf); - } - smart_str_free(&key); - } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - trav = trav->next; - } - } - return h; -} - -static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap_namespace, sdlSoapBindingFunctionBody *binding, HashTable* params) -{ - xmlNodePtr body, trav; - xmlAttrPtr tmp; - - trav = node->children; - while (trav != NULL) { - if (node_is_equal_ex(trav, "body", wsdl_soap_namespace)) { - body = trav; - - tmp = get_attribute(body->properties, "use"); - if (tmp && !strncmp(tmp->children->content, "literal", sizeof("literal"))) { - binding->use = SOAP_LITERAL; - } else { - binding->use = SOAP_ENCODED; - } - - tmp = get_attribute(body->properties, "namespace"); - if (tmp) { - binding->ns = estrdup(tmp->children->content); - } - - tmp = get_attribute(body->properties, "parts"); - if (tmp) { - HashTable ht; - char *parts = tmp->children->content; - - /* Delete all parts those are not in the "parts" attribute */ - zend_hash_init(&ht, 0, NULL, delete_parameter, 0); - while (*parts) { - HashPosition pos; - sdlParamPtr *param; - int found = 0; - char *end; - - while (*parts == ' ') ++parts; - if (*parts == '\0') break; - end = strchr(parts, ' '); - if (end) *end = '\0'; - zend_hash_internal_pointer_reset_ex(params, &pos); - while (zend_hash_get_current_data_ex(params, (void **)¶m, &pos) != FAILURE) { - if ((*param)->paramName && - strcmp(parts, (*param)->paramName) == 0) { - sdlParamPtr x_param; - x_param = emalloc(sizeof(sdlParam)); - *x_param = **param; - (*param)->paramName = NULL; - zend_hash_next_index_insert(&ht, &x_param, sizeof(sdlParamPtr), NULL); - found = 1; - break; - } - zend_hash_move_forward_ex(params, &pos); - } - if (!found) { - soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in ", parts); - } - parts += strlen(parts); - if (end) *end = ' '; - } - zend_hash_destroy(params); - *params = ht; - } - - if (binding->use == SOAP_ENCODED) { - tmp = get_attribute(body->properties, "encodingStyle"); - if (tmp) { - if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) { - binding->encodingStyle = SOAP_ENCODING_1_1; - } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { - binding->encodingStyle = SOAP_ENCODING_1_2; - } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); - } - } - } else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) { - sdlSoapBindingFunctionHeaderPtr h = wsdl_soap_binding_header(ctx, trav, wsdl_soap_namespace, 0); - smart_str key = {0}; - - if (binding->headers == NULL) { - binding->headers = emalloc(sizeof(HashTable)); - zend_hash_init(binding->headers, 0, NULL, delete_header, 0); - } - - if (h->ns) { - smart_str_appends(&key,h->ns); - smart_str_appendc(&key,':'); - } - smart_str_appends(&key,h->name); - smart_str_0(&key); - if (zend_hash_add(binding->headers, key.c, key.len+1, (void**)&h, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL) != SUCCESS) { - delete_header((void**)&h); - } - smart_str_free(&key); - } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - trav = trav->next; - } -} - -static HashTable* wsdl_message(sdlCtx *ctx, char* message_name) -{ - xmlNodePtr trav, part, message = NULL, *tmp; - HashTable* parameters = NULL; - char *ctype; - - ctype = strrchr(message_name,':'); - if (ctype == NULL) { - ctype = message_name; - } else { - ++ctype; - } - if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", message_name); - } - message = *tmp; - - parameters = emalloc(sizeof(HashTable)); - zend_hash_init(parameters, 0, NULL, delete_parameter, 0); - - trav = message->children; - while (trav != NULL) { - xmlAttrPtr element, type, name; - sdlParamPtr param; - - if (trav->ns != NULL && strcmp(trav->ns->href,WSDL_NAMESPACE) != 0) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", trav->name); - } - if (node_is_equal(trav,"documentation")) { - trav = trav->next; - continue; - } - if (!node_is_equal(trav,"part")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - part = trav; - param = emalloc(sizeof(sdlParam)); - memset(param,0,sizeof(sdlParam)); - param->order = 0; - - name = get_attribute(part->properties, "name"); - if (name == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: No name associated with '%s'", message->name); - } - - param->paramName = estrdup(name->children->content); - - type = get_attribute(part->properties, "type"); - if (type != NULL) { - param->encode = get_encoder_from_prefix(ctx->sdl, part, type->children->content); - } else { - element = get_attribute(part->properties, "element"); - if (element != NULL) { - param->element = get_element(ctx->sdl, part, element->children->content); - if (param->element) { - param->encode = param->element->encode; - } - } - } - - zend_hash_next_index_insert(parameters, ¶m, sizeof(sdlParamPtr), NULL); - - trav = trav->next; - } - return parameters; -} - -static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC) -{ - sdlCtx ctx; - int i,n; - - memset(&ctx,0,sizeof(ctx)); - ctx.sdl = emalloc(sizeof(sdl)); - memset(ctx.sdl, 0, sizeof(sdl)); - ctx.sdl->source = estrdup(struri); - zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, 0); - - zend_hash_init(&ctx.docs, 0, NULL, delete_document, 0); - zend_hash_init(&ctx.messages, 0, NULL, NULL, 0); - zend_hash_init(&ctx.bindings, 0, NULL, NULL, 0); - zend_hash_init(&ctx.portTypes, 0, NULL, NULL, 0); - zend_hash_init(&ctx.services, 0, NULL, NULL, 0); - - load_wsdl_ex(this_ptr, struri,&ctx, 0 TSRMLS_CC); - schema_pass2(&ctx); - - n = zend_hash_num_elements(&ctx.services); - if (n > 0) { - zend_hash_internal_pointer_reset(&ctx.services); - for (i = 0; i < n; i++) { - xmlNodePtr *tmp, service; - xmlNodePtr trav, port; - - zend_hash_get_current_data(&ctx.services, (void **)&tmp); - service = *tmp; - - trav = service->children; - while (trav != NULL) { - xmlAttrPtr type, name, bindingAttr, location; - xmlNodePtr portType, operation; - xmlNodePtr address, binding, trav2; - char *ctype; - sdlBindingPtr tmpbinding; - char *wsdl_soap_namespace = NULL; - - if (!is_wsdl_element(trav) || node_is_equal(trav,"documentation")) { - trav = trav->next; - continue; - } - if (!node_is_equal(trav,"port")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - - port = trav; - - tmpbinding = emalloc(sizeof(sdlBinding)); - memset(tmpbinding, 0, sizeof(sdlBinding)); - - bindingAttr = get_attribute(port->properties, "binding"); - if (bindingAttr == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: No binding associated with "); - } - - /* find address and figure out binding type */ - address = NULL; - trav2 = port->children; - while (trav2 != NULL) { - if (node_is_equal(trav2,"address") && trav2->ns) { - if (!strncmp(trav2->ns->href, WSDL_SOAP11_NAMESPACE, sizeof(WSDL_SOAP11_NAMESPACE))) { - address = trav2; - wsdl_soap_namespace = WSDL_SOAP11_NAMESPACE; - tmpbinding->bindingType = BINDING_SOAP; - } else if (!strncmp(trav2->ns->href, WSDL_SOAP12_NAMESPACE, sizeof(WSDL_SOAP12_NAMESPACE))) { - address = trav2; - wsdl_soap_namespace = WSDL_SOAP12_NAMESPACE; - tmpbinding->bindingType = BINDING_SOAP; - } else if (!strncmp(trav2->ns->href, RPC_SOAP12_NAMESPACE, sizeof(RPC_SOAP12_NAMESPACE))) { - address = trav2; - wsdl_soap_namespace = RPC_SOAP12_NAMESPACE; - tmpbinding->bindingType = BINDING_SOAP; - } else if (!strncmp(trav2->ns->href, WSDL_HTTP11_NAMESPACE, sizeof(WSDL_HTTP11_NAMESPACE))) { - address = trav2; - tmpbinding->bindingType = BINDING_HTTP; - } else if (!strncmp(trav2->ns->href, WSDL_HTTP12_NAMESPACE, sizeof(WSDL_HTTP12_NAMESPACE))) { - address = trav2; - tmpbinding->bindingType = BINDING_HTTP; - } - } - if (trav2 != address && is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name); - } - trav2 = trav2->next; - } - if (!address) { - soap_error0(E_ERROR, "Parsing WSDL: No address associated with "); - } - - location = get_attribute(address->properties, "location"); - if (!location) { - soap_error0(E_ERROR, "Parsing WSDL: No location associated with "); - } - - tmpbinding->location = estrdup(location->children->content); - - ctype = strrchr(bindingAttr->children->content,':'); - if (ctype == NULL) { - ctype = bindingAttr->children->content; - } else { - ++ctype; - } - if (zend_hash_find(&ctx.bindings, ctype, strlen(ctype)+1, (void*)&tmp) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: No element with name '%s'", ctype); - } - binding = *tmp; - - if (tmpbinding->bindingType == BINDING_SOAP) { - sdlSoapBindingPtr soapBinding; - xmlNodePtr soapBindingNode; - xmlAttrPtr tmp; - - soapBinding = emalloc(sizeof(sdlSoapBinding)); - memset(soapBinding, 0, sizeof(sdlSoapBinding)); - soapBinding->style = SOAP_DOCUMENT; - - soapBindingNode = get_node_ex(binding->children, "binding", wsdl_soap_namespace); - if (soapBindingNode) { - tmp = get_attribute(soapBindingNode->properties, "style"); - if (tmp && !strncmp(tmp->children->content, "rpc", sizeof("rpc"))) { - soapBinding->style = SOAP_RPC; - } - - tmp = get_attribute(soapBindingNode->properties, "transport"); - if (tmp) { - if (strncmp(tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) { - soapBinding->transport = SOAP_TRANSPORT_HTTP; - } else { - soap_error1(E_ERROR, "Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content); - } - } - } - tmpbinding->bindingAttributes = (void *)soapBinding; - } - - name = get_attribute(binding->properties, "name"); - if (name == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); - } - tmpbinding->name = estrdup(name->children->content); - - type = get_attribute(binding->properties, "type"); - if (type == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); - } - - ctype = strrchr(type->children->content,':'); - if (ctype == NULL) { - ctype = type->children->content; - } else { - ++ctype; - } - if (zend_hash_find(&ctx.portTypes, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", name->children->content); - } - portType = *tmp; - - trav2 = binding->children; - while (trav2 != NULL) { - sdlFunctionPtr function; - xmlNodePtr input, output, fault, portTypeOperation, trav3; - xmlAttrPtr op_name, paramOrder; - - if ((tmpbinding->bindingType == BINDING_SOAP && - node_is_equal_ex(trav2, "binding", wsdl_soap_namespace)) || - !is_wsdl_element(trav2) || - node_is_equal(trav2,"documentation")) { - trav2 = trav2->next; - continue; - } - if (!node_is_equal(trav2,"operation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name); - } - - operation = trav2; - - op_name = get_attribute(operation->properties, "name"); - if (op_name == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); - } - - trav3 = operation->children; - while (trav3 != NULL) { - if (tmpbinding->bindingType == BINDING_SOAP && - node_is_equal_ex(trav3, "operation", wsdl_soap_namespace)) { - } else if (is_wsdl_element(trav3) && - !node_is_equal(trav3,"input") && - !node_is_equal(trav3,"output") && - !node_is_equal(trav3,"fault") && - !node_is_equal(trav3,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav3->name); - } - trav3 = trav3->next; - } - - portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", op_name->children->content, NULL); - if (portTypeOperation == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing / with name '%s'", op_name->children->content); - } - - function = emalloc(sizeof(sdlFunction)); - memset(function, 0, sizeof(sdlFunction)); - function->functionName = estrdup(op_name->children->content); - - if (tmpbinding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr soapFunctionBinding; - sdlSoapBindingPtr soapBinding; - xmlNodePtr soapOperation; - xmlAttrPtr tmp; - - soapFunctionBinding = emalloc(sizeof(sdlSoapBindingFunction)); - memset(soapFunctionBinding, 0, sizeof(sdlSoapBindingFunction)); - soapBinding = (sdlSoapBindingPtr)tmpbinding->bindingAttributes; - soapFunctionBinding->style = soapBinding->style; - - soapOperation = get_node_ex(operation->children, "operation", wsdl_soap_namespace); - if (soapOperation) { - tmp = get_attribute(soapOperation->properties, "soapAction"); - if (tmp) { - soapFunctionBinding->soapAction = estrdup(tmp->children->content); - } - - tmp = get_attribute(soapOperation->properties, "style"); - if (tmp) { - if (!strncmp(tmp->children->content, "rpc", sizeof("rpc"))) { - soapFunctionBinding->style = SOAP_RPC; - } else { - soapFunctionBinding->style = SOAP_DOCUMENT; - } - } else { - soapFunctionBinding->style = soapBinding->style; - } - } - - function->bindingAttributes = (void *)soapFunctionBinding; - } - - input = get_node_ex(portTypeOperation->children, "input", WSDL_NAMESPACE); - if (input != NULL) { - xmlAttrPtr message, name; - - message = get_attribute(input->properties, "message"); - if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); - } - function->requestParameters = wsdl_message(&ctx, message->children->content); - - name = get_attribute(input->properties, "name"); -/* FIXME - if (name != NULL) { - function->requestName = estrdup(name->children->content); - } else { -*/ - { - function->requestName = estrdup(function->functionName); - } - - if (tmpbinding->bindingType == BINDING_SOAP) { - input = get_node_ex(operation->children, "input", WSDL_NAMESPACE); - if (input != NULL) { - sdlSoapBindingFunctionPtr soapFunctionBinding = function->bindingAttributes; - wsdl_soap_binding_body(&ctx, input, wsdl_soap_namespace, &soapFunctionBinding->input, function->requestParameters); - } - } - } - - output = get_node_ex(portTypeOperation->children, "output", WSDL_NAMESPACE); - if (output != NULL) { - xmlAttrPtr message, name; - - message = get_attribute(output->properties, "message"); - if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); - } - function->responseParameters = wsdl_message(&ctx, message->children->content); - - name = get_attribute(output->properties, "name"); -/* FIXME - if (name != NULL) { - function->responseName = estrdup(name->children->content); - } else if (input == NULL) { - function->responseName = estrdup(function->functionName); - } else { -*/ - { - int len = strlen(function->functionName); - function->responseName = emalloc(len + sizeof("Response")); - memcpy(function->responseName, function->functionName, len); - memcpy(function->responseName+len, "Response", sizeof("Response")); - } - - if (tmpbinding->bindingType == BINDING_SOAP) { - output = get_node_ex(operation->children, "output", WSDL_NAMESPACE); - if (output != NULL) { - sdlSoapBindingFunctionPtr soapFunctionBinding = function->bindingAttributes; - wsdl_soap_binding_body(&ctx, output, wsdl_soap_namespace, &soapFunctionBinding->output, function->responseParameters); - } - } - } - - paramOrder = get_attribute(portTypeOperation->properties, "parameterOrder"); - if (paramOrder) { - /* FIXME: */ - } - - fault = portTypeOperation->children; - while (fault != NULL) { - if (node_is_equal_ex(fault, "fault", WSDL_NAMESPACE)) { - xmlAttrPtr message, name; - sdlFaultPtr f; - - name = get_attribute(fault->properties, "name"); - if (name == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); - } - message = get_attribute(fault->properties, "message"); - if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); - } - - f = emalloc(sizeof(sdlFault)); - memset(f, 0, sizeof(sdlFault)); - - f->name = estrdup(name->children->content); - f->details = wsdl_message(&ctx, message->children->content); - if (f->details == NULL || zend_hash_num_elements(f->details) > 1) { - soap_error1(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content); - } - - if (tmpbinding->bindingType == BINDING_SOAP) { - xmlNodePtr soap_fault = get_node_with_attribute_ex(operation->children, "fault", WSDL_NAMESPACE, "name", f->name, NULL); - if (soap_fault != NULL) { - xmlNodePtr trav = soap_fault->children; - while (trav != NULL) { - if (node_is_equal_ex(trav, "fault", wsdl_soap_namespace)) { - xmlAttrPtr tmp; - sdlSoapBindingFunctionFaultPtr binding; - - binding = f->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunctionFault)); - memset(f->bindingAttributes, 0, sizeof(sdlSoapBindingFunctionFault)); - - tmp = get_attribute(trav->properties, "use"); - if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) { - binding->use = SOAP_ENCODED; - } else { - binding->use = SOAP_LITERAL; - } - - tmp = get_attribute(trav->properties, "namespace"); - if (tmp) { - binding->ns = estrdup(tmp->children->content); - } - - if (binding->use == SOAP_ENCODED) { - tmp = get_attribute(trav->properties, "encodingStyle"); - if (tmp) { - if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) { - binding->encodingStyle = SOAP_ENCODING_1_1; - } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { - binding->encodingStyle = SOAP_ENCODING_1_2; - } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); - } - } - } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name); - } - trav = trav->next; - } - } - } - if (function->faults == NULL) { - function->faults = emalloc(sizeof(HashTable)); - zend_hash_init(function->faults, 0, NULL, delete_fault, 0); - } - if (zend_hash_add(function->faults, f->name, strlen(f->name)+1, (void**)&f, sizeof(sdlFaultPtr), NULL) != SUCCESS) { - soap_error2(E_ERROR, "Parsing WSDL: with name '%s' already defined in '%s'", f->name, op_name->children->content); - } - } - fault = fault->next; - } - - function->binding = tmpbinding; - - { - char *tmp = estrdup(function->functionName); - int len = strlen(tmp); - - if (zend_hash_add(&ctx.sdl->functions, php_strtolower(tmp, len), len+1, &function, sizeof(sdlFunctionPtr), NULL) != SUCCESS) { - zend_hash_next_index_insert(&ctx.sdl->functions, &function, sizeof(sdlFunctionPtr), NULL); - } - efree(tmp); - if (function->requestName != NULL && strcmp(function->requestName,function->functionName) != 0) { - if (ctx.sdl->requests == NULL) { - ctx.sdl->requests = emalloc(sizeof(HashTable)); - zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, 0); - } - tmp = estrdup(function->requestName); - len = strlen(tmp); - zend_hash_add(ctx.sdl->requests, php_strtolower(tmp, len), len+1, &function, sizeof(sdlFunctionPtr), NULL); - efree(tmp); - } - } - trav2 = trav2->next; - } - - if (!ctx.sdl->bindings) { - ctx.sdl->bindings = emalloc(sizeof(HashTable)); - zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, 0); - } - - zend_hash_add(ctx.sdl->bindings, tmpbinding->name, strlen(tmpbinding->name), &tmpbinding, sizeof(sdlBindingPtr), NULL); - trav= trav->next; - } - - zend_hash_move_forward(&ctx.services); - } - } else { - soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service"); - } - - zend_hash_destroy(&ctx.messages); - zend_hash_destroy(&ctx.bindings); - zend_hash_destroy(&ctx.portTypes); - zend_hash_destroy(&ctx.services); - zend_hash_destroy(&ctx.docs); - - return ctx.sdl; -} - -#define WSDL_CACHE_VERSION 0x0e - -#define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type); -#define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4; -#define WSDL_CACHE_GET_1(ret,type,buf) ret = (type)(**buf); (*buf)++; -#define WSDL_CACHE_GET_N(ret,n,buf) memcpy(ret,*buf,n); *buf += n; -#define WSDL_CACHE_SKIP(n,buf) *buf += n; - -#define WSDL_CACHE_PUT_INT(val,buf) smart_str_appendc(buf,val & 0xff); \ - smart_str_appendc(buf,(val >> 8) & 0xff); \ - smart_str_appendc(buf,(val >> 16) & 0xff); \ - smart_str_appendc(buf,(val >> 24) & 0xff); -#define WSDL_CACHE_PUT_1(val,buf) smart_str_appendc(buf,val); -#define WSDL_CACHE_PUT_N(val,n,buf) smart_str_appendl(buf,(char*)val,n); - -static char* sdl_deserialize_string(char **in) -{ - char *s; - int len; - - WSDL_CACHE_GET_INT(len, in); - if (len == 0x7fffffff) { - return NULL; - } else { - s = emalloc(len+1); - WSDL_CACHE_GET_N(s, len, in); - s[len] = '\0'; - return s; - } -} - -static void sdl_deserialize_key(HashTable* ht, void* data, char **in) -{ - int len; - - WSDL_CACHE_GET_INT(len, in); - if (len == 0) { - zend_hash_next_index_insert(ht, &data, sizeof(void*), NULL); - } else { - zend_hash_add(ht, *in, len, &data, sizeof(void*), NULL); - WSDL_CACHE_SKIP(len, in); - } -} - -static void sdl_deserialize_attribute(sdlAttributePtr attr, encodePtr *encoders, char **in) -{ - int i; - - attr->name = sdl_deserialize_string(in); - attr->namens = sdl_deserialize_string(in); - attr->ref = sdl_deserialize_string(in); - attr->def = sdl_deserialize_string(in); - attr->fixed = sdl_deserialize_string(in); - WSDL_CACHE_GET_1(attr->form, sdlForm, in); - WSDL_CACHE_GET_1(attr->use, sdlUse, in); - WSDL_CACHE_GET_INT(i, in); - attr->encode = encoders[i]; - WSDL_CACHE_GET_INT(i, in); - if (i > 0) { - attr->extraAttributes = emalloc(sizeof(HashTable)); - zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, 0); - while (i > 0) { - sdlExtraAttributePtr x = emalloc(sizeof(sdlExtraAttribute)); - sdl_deserialize_key(attr->extraAttributes, x, in); - x->ns = sdl_deserialize_string(in); - x->val = sdl_deserialize_string(in); - --i; - } - } -} - -static sdlRestrictionIntPtr sdl_deserialize_resriction_int(char **in) -{ - if (**in == 1) { - sdlRestrictionIntPtr x = emalloc(sizeof(sdlRestrictionInt)); - WSDL_CACHE_SKIP(1, in); - WSDL_CACHE_GET_INT(x->value, in); - WSDL_CACHE_GET_1(x->fixed, char, in); - return x; - } else { - WSDL_CACHE_SKIP(1, in); - return NULL; - } -} - -static sdlRestrictionCharPtr sdl_deserialize_resriction_char(char **in) -{ - if (**in == 1) { - sdlRestrictionCharPtr x = emalloc(sizeof(sdlRestrictionChar)); - WSDL_CACHE_SKIP(1, in); - x->value = sdl_deserialize_string(in); - WSDL_CACHE_GET_1(x->fixed, char, in); - return x; - } else { - WSDL_CACHE_SKIP(1, in); - return NULL; - } -} - -static sdlContentModelPtr sdl_deserialize_model(sdlTypePtr *types, sdlTypePtr *elements, char **in) -{ - int i; - sdlContentModelPtr model = emalloc(sizeof(sdlContentModel)); - - WSDL_CACHE_GET_1(model->kind, sdlContentKind, in); - WSDL_CACHE_GET_INT(model->min_occurs, in); - WSDL_CACHE_GET_INT(model->max_occurs, in); - switch (model->kind) { - case XSD_CONTENT_ELEMENT: - WSDL_CACHE_GET_INT(i, in); - model->u.element = elements[i]; - break; - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: - WSDL_CACHE_GET_INT(i, in); - model->u.content = emalloc(sizeof(HashTable)); - zend_hash_init(model->u.content, i, NULL, delete_model, 0); - while (i > 0) { - sdlContentModelPtr x = sdl_deserialize_model(types, elements, in); - zend_hash_next_index_insert(model->u.content,&x,sizeof(sdlContentModelPtr),NULL); - i--; - } - break; - case XSD_CONTENT_GROUP_REF: - model->u.group_ref = sdl_deserialize_string(in); - break; - case XSD_CONTENT_GROUP: - WSDL_CACHE_GET_INT(i, in); - model->u.group = types[i]; - break; - default: - break; - } - return model; -} - -static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr *encoders, char **in) -{ - int i; - sdlTypePtr *elements = NULL; - - WSDL_CACHE_GET_1(type->kind, sdlTypeKind, in); - type->name = sdl_deserialize_string(in); - type->namens = sdl_deserialize_string(in); - type->def = sdl_deserialize_string(in); - type->fixed = sdl_deserialize_string(in); - type->ref = sdl_deserialize_string(in); - WSDL_CACHE_GET_1(type->nillable, char, in); - WSDL_CACHE_GET_1(type->form, sdlForm, in); - - WSDL_CACHE_GET_INT(i, in); - type->encode = encoders[i]; - - if (**in == 1) { - WSDL_CACHE_SKIP(1, in); - type->restrictions = emalloc(sizeof(sdlRestrictions)); - /*memset(type->restrictions, 0, sizeof(sdlRestrictions));*/ - type->restrictions->minExclusive = sdl_deserialize_resriction_int(in); - type->restrictions->minInclusive = sdl_deserialize_resriction_int(in); - type->restrictions->maxExclusive = sdl_deserialize_resriction_int(in); - type->restrictions->maxInclusive = sdl_deserialize_resriction_int(in); - type->restrictions->totalDigits = sdl_deserialize_resriction_int(in); - type->restrictions->fractionDigits = sdl_deserialize_resriction_int(in); - type->restrictions->length = sdl_deserialize_resriction_int(in); - type->restrictions->minLength = sdl_deserialize_resriction_int(in); - type->restrictions->maxLength = sdl_deserialize_resriction_int(in); - type->restrictions->whiteSpace = sdl_deserialize_resriction_char(in); - type->restrictions->pattern = sdl_deserialize_resriction_char(in); - WSDL_CACHE_GET_INT(i, in); - if (i > 0) { - type->restrictions->enumeration = emalloc(sizeof(HashTable)); - zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, 0); - while (i > 0) { - sdlRestrictionCharPtr x = sdl_deserialize_resriction_char(in); - sdl_deserialize_key(type->restrictions->enumeration, x, in); - --i; - } - } else { - type->restrictions->enumeration = NULL; - } - } else { - WSDL_CACHE_SKIP(1, in); - } - - WSDL_CACHE_GET_INT(i, in); - if (i > 0) { - elements = emalloc((i+1) * sizeof(sdlTypePtr)); - elements[0] = NULL; - type->elements = emalloc(sizeof(HashTable)); - zend_hash_init(type->elements, i, NULL, delete_type, 0); - while (i > 0) { - sdlTypePtr t = emalloc(sizeof(sdlType)); - memset(t, 0, sizeof(sdlType)); - sdl_deserialize_key(type->elements, t, in); - sdl_deserialize_type(t, types, encoders, in); - elements[i] = t; - --i; - } - } - - WSDL_CACHE_GET_INT(i, in); - if (i > 0) { - type->attributes = emalloc(sizeof(HashTable)); - zend_hash_init(type->attributes, i, NULL, delete_attribute, 0); - while (i > 0) { - sdlAttributePtr attr = emalloc(sizeof(sdlAttribute)); - memset(attr, 0, sizeof(sdlAttribute)); - sdl_deserialize_key(type->attributes, attr, in); - sdl_deserialize_attribute(attr, encoders, in); - --i; - } - } - - if (**in != 0) { - WSDL_CACHE_SKIP(1, in); - type->model = sdl_deserialize_model(types, elements, in); - } else { - WSDL_CACHE_SKIP(1, in); - } - if (elements != NULL) { - efree(elements); - } -} - -static void sdl_deserialize_encoder(encodePtr enc, sdlTypePtr *types, char **in) -{ - int i; - - WSDL_CACHE_GET_INT(enc->details.type, in); - enc->details.type_str = sdl_deserialize_string(in); - enc->details.ns = sdl_deserialize_string(in); - WSDL_CACHE_GET_INT(i, in); - enc->details.sdl_type = types[i]; - enc->to_xml = sdl_guess_convert_xml; - enc->to_zval = sdl_guess_convert_zval; -} - -static void sdl_deserialize_soap_body(sdlSoapBindingFunctionBodyPtr body, encodePtr *encoders, sdlTypePtr *types, char **in) -{ - int i, j, n; - - WSDL_CACHE_GET_1(body->use, sdlEncodingUse, in); - if (body->use == SOAP_ENCODED) { - WSDL_CACHE_GET_1(body->encodingStyle, sdlRpcEncodingStyle, in); - } else { - body->encodingStyle = SOAP_ENCODING_DEFAULT; - } - body->ns = sdl_deserialize_string(in); - WSDL_CACHE_GET_INT(i, in); - if (i > 0) { - body->headers = emalloc(sizeof(HashTable)); - zend_hash_init(body->headers, i, NULL, delete_header, 0); - while (i > 0) { - sdlSoapBindingFunctionHeaderPtr tmp = emalloc(sizeof(sdlSoapBindingFunctionHeader)); - memset(tmp, 0, sizeof(sdlSoapBindingFunctionHeader)); - sdl_deserialize_key(body->headers, tmp, in); - WSDL_CACHE_GET_1(tmp->use, sdlEncodingUse, in); - if (tmp->use == SOAP_ENCODED) { - WSDL_CACHE_GET_1(tmp->encodingStyle, sdlRpcEncodingStyle, in); - } else { - tmp->encodingStyle = SOAP_ENCODING_DEFAULT; - } - tmp->name = sdl_deserialize_string(in); - tmp->ns = sdl_deserialize_string(in); - WSDL_CACHE_GET_INT(n, in); - tmp->encode = encoders[n]; - WSDL_CACHE_GET_INT(n, in); - tmp->element = types[n]; - --i; - WSDL_CACHE_GET_INT(j, in); - if (j > 0) { - tmp->headerfaults = emalloc(sizeof(HashTable)); - zend_hash_init(tmp->headerfaults, i, NULL, delete_header, 0); - while (j > 0) { - sdlSoapBindingFunctionHeaderPtr tmp2 = emalloc(sizeof(sdlSoapBindingFunctionHeader)); - memset(tmp2, 0, sizeof(sdlSoapBindingFunctionHeader)); - sdl_deserialize_key(tmp->headerfaults, tmp2, in); - WSDL_CACHE_GET_1(tmp2->use, sdlEncodingUse, in); - if (tmp2->use == SOAP_ENCODED) { - WSDL_CACHE_GET_1(tmp2->encodingStyle, sdlRpcEncodingStyle, in); - } else { - tmp2->encodingStyle = SOAP_ENCODING_DEFAULT; - } - tmp2->name = sdl_deserialize_string(in); - tmp2->ns = sdl_deserialize_string(in); - WSDL_CACHE_GET_INT(n, in); - tmp2->encode = encoders[n]; - WSDL_CACHE_GET_INT(n, in); - tmp2->element = types[n]; - --j; - } - } - } - } -} - -static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *types, char **in) -{ - int i, n; - HashTable *ht; - - WSDL_CACHE_GET_INT(i, in); - if (i == 0) {return NULL;} - ht = emalloc(sizeof(HashTable)); - zend_hash_init(ht, i, NULL, delete_parameter, 0); - while (i > 0) { - sdlParamPtr param = emalloc(sizeof(sdlParam)); - sdl_deserialize_key(ht, param, in); - param->paramName = sdl_deserialize_string(in); - WSDL_CACHE_GET_INT(param->order, in); - WSDL_CACHE_GET_INT(n, in); - param->encode = encoders[n]; - WSDL_CACHE_GET_INT(n, in); - param->element = types[n]; - --i; - } - return ht; -} - -static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) -{ - sdlPtr sdl; - time_t old_t; - int i, num_groups, num_types, num_elements, num_encoders, num_bindings, num_func; - sdlFunctionPtr *functions = NULL; - sdlBindingPtr *bindings; - sdlTypePtr *types; - encodePtr *encoders; - encodePtr enc; - - int f; - struct stat st; - char *in, *buf; - - f = open(fn, O_RDONLY|O_BINARY); - if (f < 0) { - return NULL; - } - if (fstat(f, &st) != 0) { - close(f); - return NULL; - } - buf = in = emalloc(st.st_size); - if (read(f, in, st.st_size) != st.st_size) { - close(f); - efree(in); - return NULL; - } - close(f); - - if (strncmp(in,"wsdl",4) != 0 || in[4] != WSDL_CACHE_VERSION || in[5] != '\0') { - unlink(fn); - efree(buf); - return NULL; - } - in += 6; - - WSDL_CACHE_GET(old_t, time_t, &in); - if (old_t < t) { - unlink(fn); - efree(buf); - return NULL; - } - - WSDL_CACHE_GET_INT(i, &in); - if (i == 0 && strncmp(in, uri, i) != 0) { - unlink(fn); - efree(buf); - return NULL; - } - WSDL_CACHE_SKIP(i, &in); - - sdl = emalloc(sizeof(*sdl)); - memset(sdl, 0, sizeof(*sdl)); - - sdl->source = sdl_deserialize_string(&in); - sdl->target_ns = sdl_deserialize_string(&in); - - WSDL_CACHE_GET_INT(num_groups, &in); - WSDL_CACHE_GET_INT(num_types, &in); - WSDL_CACHE_GET_INT(num_elements, &in); - WSDL_CACHE_GET_INT(num_encoders, &in); - - i = num_groups+num_types+num_elements; - types = emalloc((i+1)*sizeof(sdlTypePtr)); - types[0] = NULL; - while (i > 0) { - types[i] = emalloc(sizeof(sdlType)); - memset(types[i], 0, sizeof(sdlType)); - i--; - } - - i = num_encoders; - enc = defaultEncoding; - while (enc->details.type != END_KNOWN_TYPES) { - i++; enc++; - } - encoders = emalloc((i+1)*sizeof(encodePtr)); - i = num_encoders; - encoders[0] = NULL; - while (i > 0) { - encoders[i] = emalloc(sizeof(encode)); - memset(encoders[i], 0, sizeof(encode)); - i--; - } - i = num_encoders; - enc = defaultEncoding; - while (enc->details.type != END_KNOWN_TYPES) { - encoders[++i] = enc++; - } - - i = 1; - if (num_groups > 0) { - sdl->groups = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->groups, num_groups, NULL, delete_type, 0); - while (i < num_groups+1) { - sdl_deserialize_key(sdl->groups, types[i], &in); - sdl_deserialize_type(types[i], types, encoders, &in); - i++; - } - } - - if (num_types > 0) { - sdl->types = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->types, num_types, NULL, delete_type, 0); - while (i < num_groups+num_types+1) { - sdl_deserialize_key(sdl->types, types[i], &in); - sdl_deserialize_type(types[i], types, encoders, &in); - i++; - } - } - - if (num_elements > 0) { - sdl->elements = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->elements, num_elements, NULL, delete_type, 0); - while (i < num_groups+num_types+num_elements+1) { - sdl_deserialize_key(sdl->elements, types[i], &in); - sdl_deserialize_type(types[i], types, encoders, &in); - i++; - } - } - - i = 1; - if (num_encoders > 0) { - sdl->encoders = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, 0); - while (i < num_encoders+1) { - sdl_deserialize_key(sdl->encoders, encoders[i], &in); - sdl_deserialize_encoder(encoders[i], types, &in); - i++; - } - } - - /* deserialize bindings */ - WSDL_CACHE_GET_INT(num_bindings, &in); - bindings = emalloc(num_bindings*sizeof(sdlBindingPtr)); - if (num_bindings > 0) { - sdl->bindings = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, 0); - for (i = 0; i < num_bindings; i++) { - sdlBindingPtr binding = emalloc(sizeof(sdlBinding)); - memset(binding, 0, sizeof(sdlBinding)); - sdl_deserialize_key(sdl->bindings, binding, &in); - binding->name = sdl_deserialize_string(&in); - binding->location = sdl_deserialize_string(&in); - WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in); - if (binding->bindingType == BINDING_SOAP && *in != 0) { - sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding)); - WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in); - WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in); - } else { - WSDL_CACHE_SKIP(1,&in); - } - bindings[i] = binding; - } - } - - /* deserialize functions */ - WSDL_CACHE_GET_INT(num_func, &in); - zend_hash_init(&sdl->functions, num_func, NULL, delete_function, 0); - if (num_func > 0) { - functions = emalloc(num_func*sizeof(sdlFunctionPtr)); - for (i = 0; i < num_func; i++) { - int binding_num, num_faults; - sdlFunctionPtr func = emalloc(sizeof(sdlFunction)); - sdl_deserialize_key(&sdl->functions, func, &in); - func->functionName = sdl_deserialize_string(&in); - func->requestName = sdl_deserialize_string(&in); - func->responseName = sdl_deserialize_string(&in); - - WSDL_CACHE_GET_INT(binding_num, &in); - if (binding_num == 0) { - func->binding = NULL; - } else { - func->binding = bindings[binding_num-1]; - } - if (func->binding && func->binding->bindingType == BINDING_SOAP && *in != 0) { - sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction)); - memset(binding, 0, sizeof(sdlSoapBindingFunction)); - WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in); - binding->soapAction = sdl_deserialize_string(&in); - sdl_deserialize_soap_body(&binding->input, encoders, types, &in); - sdl_deserialize_soap_body(&binding->output, encoders, types, &in); - } else { - WSDL_CACHE_SKIP(1, &in); - func->bindingAttributes = NULL; - } - - func->requestParameters = sdl_deserialize_parameters(encoders, types, &in); - func->responseParameters = sdl_deserialize_parameters(encoders, types, &in); - - WSDL_CACHE_GET_INT(num_faults, &in); - if (num_faults > 0) { - int j; - - func->faults = emalloc(sizeof(HashTable)); - zend_hash_init(func->faults, num_faults, NULL, delete_fault, 0); - - for (j = 0; j < num_faults; j++) { - sdlFaultPtr fault = emalloc(sizeof(sdlFault)); - - sdl_deserialize_key(func->faults, fault, &in); - fault->name =sdl_deserialize_string(&in); - fault->details =sdl_deserialize_parameters(encoders, types, &in); - if (*in != 0) { - sdlSoapBindingFunctionFaultPtr binding = fault->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunctionFault)); - memset(binding, 0, sizeof(sdlSoapBindingFunctionFault)); - WSDL_CACHE_GET_1(binding->use,sdlEncodingUse,&in); - if (binding->use == SOAP_ENCODED) { - WSDL_CACHE_GET_1(binding->encodingStyle, sdlRpcEncodingStyle, &in); - } else { - binding->encodingStyle = SOAP_ENCODING_DEFAULT; - } - binding->ns = sdl_deserialize_string(&in); - } else { - WSDL_CACHE_SKIP(1, &in); - fault->bindingAttributes = NULL; - } - } - } else { - func->faults = NULL; - } - functions[i] = func; - } - } - - /* deserialize requests */ - WSDL_CACHE_GET_INT(i, &in); - if (i > 0) { - sdl->requests = emalloc(sizeof(HashTable)); - zend_hash_init(sdl->requests, i, NULL, NULL, 0); - while (i > 0) { - int function_num; - - WSDL_CACHE_GET_INT(function_num, &in); - sdl_deserialize_key(sdl->requests, functions[function_num-1], &in); - i--; - } - } - - if (functions) { - efree(functions); - } - efree(bindings); - efree(encoders); - efree(types); - efree(buf); - return sdl; -} - -static void sdl_serialize_string(const char *str, smart_str *out) -{ - int i; - - if (str) { - i = strlen(str); - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - WSDL_CACHE_PUT_N(str, i, out); - } - } else { - WSDL_CACHE_PUT_INT(0x7fffffff, out); - } -} - -static void sdl_serialize_key(HashTable *ht, smart_str *out) -{ - char *key; - uint key_len; - ulong index; - - if (zend_hash_get_current_key_ex(ht, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { - WSDL_CACHE_PUT_INT(key_len, out); - WSDL_CACHE_PUT_N(key, key_len, out); - } else { - WSDL_CACHE_PUT_INT(0, out); - } -} - -static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, smart_str *out) { - if (enc) { - int *encoder_num; - if (zend_hash_find(tmp_encoders, (char*)&enc, sizeof(enc), (void**)&encoder_num) == SUCCESS) { - WSDL_CACHE_PUT_INT(*encoder_num, out); - } else { - WSDL_CACHE_PUT_INT(0, out); - } - } else { - WSDL_CACHE_PUT_INT(0, out); - } -} - -static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_str *out) { - if (type) { - int *type_num; - if (zend_hash_find(tmp_types, (char*)&type, sizeof(type), (void**)&type_num) == SUCCESS) { - WSDL_CACHE_PUT_INT(*type_num, out); - } else { - WSDL_CACHE_PUT_INT(0, out); - } - } else { - WSDL_CACHE_PUT_INT(0,out); - } -} - -static void sdl_serialize_attribute(sdlAttributePtr attr, HashTable *tmp_encoders, smart_str *out) -{ - int i; - - sdl_serialize_string(attr->name, out); - sdl_serialize_string(attr->namens, out); - sdl_serialize_string(attr->ref, out); - sdl_serialize_string(attr->def, out); - sdl_serialize_string(attr->fixed, out); - WSDL_CACHE_PUT_1(attr->form, out); - WSDL_CACHE_PUT_1(attr->use, out); - sdl_serialize_encoder_ref(attr->encode, tmp_encoders, out); - if (attr->extraAttributes) { - i = zend_hash_num_elements(attr->extraAttributes); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlExtraAttributePtr *tmp; - zend_hash_internal_pointer_reset(attr->extraAttributes); - while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(attr->extraAttributes, out); - sdl_serialize_string((*tmp)->ns, out); - sdl_serialize_string((*tmp)->val, out); - zend_hash_move_forward(attr->extraAttributes); - } - } -} - -static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out) -{ - WSDL_CACHE_PUT_1(model->kind, out); - WSDL_CACHE_PUT_INT(model->min_occurs, out); - WSDL_CACHE_PUT_INT(model->max_occurs, out); - switch (model->kind) { - case XSD_CONTENT_ELEMENT: - sdl_serialize_type_ref(model->u.element, tmp_elements, out); - break; - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - int i = zend_hash_num_elements(model->u.content); - - WSDL_CACHE_PUT_INT(i, out); - zend_hash_internal_pointer_reset(model->u.content); - while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) { - sdl_serialize_model(*tmp, tmp_types, tmp_elements, out); - zend_hash_move_forward(model->u.content); - } - } - break; - case XSD_CONTENT_GROUP_REF: - sdl_serialize_string(model->u.group_ref,out); - break; - case XSD_CONTENT_GROUP: - sdl_serialize_type_ref(model->u.group, tmp_types, out); - break; - default: - break; - } -} - -static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out) -{ - if (x) { - WSDL_CACHE_PUT_1(1, out); - WSDL_CACHE_PUT_INT(x->value, out); - WSDL_CACHE_PUT_1(x->fixed, out); - } else { - WSDL_CACHE_PUT_1(0, out); - } -} - -static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *out) -{ - if (x) { - WSDL_CACHE_PUT_1(1, out); - sdl_serialize_string(x->value, out); - WSDL_CACHE_PUT_1(x->fixed, out); - } else { - WSDL_CACHE_PUT_1(0, out); - } -} - -static void sdl_serialize_type(sdlTypePtr type, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out) -{ - int i; - HashTable *tmp_elements = NULL; - - WSDL_CACHE_PUT_1(type->kind, out); - sdl_serialize_string(type->name, out); - sdl_serialize_string(type->namens, out); - sdl_serialize_string(type->def, out); - sdl_serialize_string(type->fixed, out); - sdl_serialize_string(type->ref, out); - WSDL_CACHE_PUT_1(type->nillable, out); - WSDL_CACHE_PUT_1(type->form, out); - sdl_serialize_encoder_ref(type->encode, tmp_encoders, out); - - if (type->restrictions) { - WSDL_CACHE_PUT_1(1, out); - sdl_serialize_resriction_int(type->restrictions->minExclusive,out); - sdl_serialize_resriction_int(type->restrictions->minInclusive,out); - sdl_serialize_resriction_int(type->restrictions->maxExclusive,out); - sdl_serialize_resriction_int(type->restrictions->maxInclusive,out); - sdl_serialize_resriction_int(type->restrictions->totalDigits,out); - sdl_serialize_resriction_int(type->restrictions->fractionDigits,out); - sdl_serialize_resriction_int(type->restrictions->length,out); - sdl_serialize_resriction_int(type->restrictions->minLength,out); - sdl_serialize_resriction_int(type->restrictions->maxLength,out); - sdl_serialize_resriction_char(type->restrictions->whiteSpace,out); - sdl_serialize_resriction_char(type->restrictions->pattern,out); - if (type->restrictions->enumeration) { - i = zend_hash_num_elements(type->restrictions->enumeration); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlRestrictionCharPtr *tmp; - - zend_hash_internal_pointer_reset(type->restrictions->enumeration); - while (zend_hash_get_current_data(type->restrictions->enumeration, (void**)&tmp) == SUCCESS) { - sdl_serialize_resriction_char(*tmp, out); - sdl_serialize_key(type->restrictions->enumeration, out); - zend_hash_move_forward(type->restrictions->enumeration); - } - } - } else { - WSDL_CACHE_PUT_1(0, out); - } - if (type->elements) { - i = zend_hash_num_elements(type->elements); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlTypePtr *tmp; - - tmp_elements = emalloc(sizeof(HashTable)); - zend_hash_init(tmp_elements, 0, NULL, NULL, 0); - - zend_hash_internal_pointer_reset(type->elements); - while (zend_hash_get_current_data(type->elements, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(type->elements, out); - sdl_serialize_type(*tmp, tmp_encoders, tmp_types, out); - zend_hash_add(tmp_elements, (char*)tmp, sizeof(*tmp), &i, sizeof(int), NULL); - i--; - zend_hash_move_forward(type->elements); - } - } - - if (type->attributes) { - i = zend_hash_num_elements(type->attributes); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlAttributePtr *tmp; - zend_hash_internal_pointer_reset(type->attributes); - while (zend_hash_get_current_data(type->attributes, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(type->attributes, out); - sdl_serialize_attribute(*tmp, tmp_encoders, out); - zend_hash_move_forward(type->attributes); - } - } - if (type->model) { - WSDL_CACHE_PUT_1(1, out); - sdl_serialize_model(type->model, tmp_types, tmp_elements, out); - } else { - WSDL_CACHE_PUT_1(0, out); - } - if (tmp_elements != NULL) { - zend_hash_destroy(tmp_elements); - efree(tmp_elements); - } -} - -static void sdl_serialize_encoder(encodePtr enc, HashTable *tmp_types, smart_str *out) -{ - WSDL_CACHE_PUT_INT(enc->details.type, out); - sdl_serialize_string(enc->details.type_str, out); - sdl_serialize_string(enc->details.ns, out); - sdl_serialize_type_ref(enc->details.sdl_type, tmp_types, out); -} - -static void sdl_serialize_parameters(HashTable *ht, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out) -{ - int i; - - if (ht) { - i = zend_hash_num_elements(ht); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlParamPtr *tmp; - - zend_hash_internal_pointer_reset(ht); - while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(ht, out); - sdl_serialize_string((*tmp)->paramName, out); - WSDL_CACHE_PUT_INT((*tmp)->order, out); - sdl_serialize_encoder_ref((*tmp)->encode, tmp_encoders, out); - sdl_serialize_type_ref((*tmp)->element, tmp_types, out); - zend_hash_move_forward(ht); - } - } -} - -static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out) -{ - int i, j; - - WSDL_CACHE_PUT_1(body->use, out); - if (body->use == SOAP_ENCODED) { - WSDL_CACHE_PUT_1(body->encodingStyle, out); - } - sdl_serialize_string(body->ns, out); - if (body->headers) { - i = zend_hash_num_elements(body->headers); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlSoapBindingFunctionHeaderPtr *tmp; - zend_hash_internal_pointer_reset(body->headers); - while (zend_hash_get_current_data(body->headers, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(body->headers, out); - WSDL_CACHE_PUT_1((*tmp)->use, out); - if ((*tmp)->use == SOAP_ENCODED) { - WSDL_CACHE_PUT_1((*tmp)->encodingStyle, out); - } - sdl_serialize_string((*tmp)->name, out); - sdl_serialize_string((*tmp)->ns, out); - sdl_serialize_encoder_ref((*tmp)->encode, tmp_encoders, out); - sdl_serialize_type_ref((*tmp)->element, tmp_types, out); - if ((*tmp)->headerfaults) { - j = zend_hash_num_elements((*tmp)->headerfaults); - } else { - j = 0; - } - WSDL_CACHE_PUT_INT(j, out); - if (j > 0) { - sdlSoapBindingFunctionHeaderPtr *tmp2; - zend_hash_internal_pointer_reset((*tmp)->headerfaults); - while (zend_hash_get_current_data((*tmp)->headerfaults, (void**)&tmp2) == SUCCESS) { - sdl_serialize_key((*tmp)->headerfaults, out); - WSDL_CACHE_PUT_1((*tmp2)->use, out); - if ((*tmp2)->use == SOAP_ENCODED) { - WSDL_CACHE_PUT_1((*tmp2)->encodingStyle, out); - } - sdl_serialize_string((*tmp2)->name, out); - sdl_serialize_string((*tmp2)->ns, out); - sdl_serialize_encoder_ref((*tmp2)->encode, tmp_encoders, out); - sdl_serialize_type_ref((*tmp2)->element, tmp_types, out); - zend_hash_move_forward((*tmp)->headerfaults); - } - } - zend_hash_move_forward(body->headers); - } - } -} - -static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl) -{ - smart_str buf = {0}; - smart_str *out = &buf; - int i; - int type_num = 1; - int encoder_num = 1; - int f; - encodePtr enc; - HashTable tmp_types; - HashTable tmp_encoders; - HashTable tmp_bindings; - HashTable tmp_functions; - -#ifdef ZEND_WIN32 - f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE); -#else - f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE|S_IROTH|S_IWOTH|S_IRGRP|S_IWGRP); -#endif - if (f < 0) {return;} - - zend_hash_init(&tmp_types, 0, NULL, NULL, 0); - zend_hash_init(&tmp_encoders, 0, NULL, NULL, 0); - zend_hash_init(&tmp_bindings, 0, NULL, NULL, 0); - zend_hash_init(&tmp_functions, 0, NULL, NULL, 0); - - WSDL_CACHE_PUT_N("wsdl", 4, out); - WSDL_CACHE_PUT_1(WSDL_CACHE_VERSION,out); - WSDL_CACHE_PUT_1(0,out); - WSDL_CACHE_PUT_N(&t, sizeof(t), out); - - sdl_serialize_string(uri, out); - sdl_serialize_string(sdl->source, out); - sdl_serialize_string(sdl->target_ns, out); - - if (sdl->groups) { - i = zend_hash_num_elements(sdl->groups); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlTypePtr *tmp; - - zend_hash_internal_pointer_reset(sdl->groups); - while (zend_hash_get_current_data(sdl->groups, (void**)&tmp) == SUCCESS) { - zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL); - ++type_num; - zend_hash_move_forward(sdl->groups); - } - } - - if (sdl->types) { - i = zend_hash_num_elements(sdl->types); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlTypePtr *tmp; - - zend_hash_internal_pointer_reset(sdl->types); - while (zend_hash_get_current_data(sdl->types, (void**)&tmp) == SUCCESS) { - zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL); - ++type_num; - zend_hash_move_forward(sdl->types); - } - } - - if (sdl->elements) { - i = zend_hash_num_elements(sdl->elements); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlTypePtr *tmp; - - zend_hash_internal_pointer_reset(sdl->elements); - while (zend_hash_get_current_data(sdl->elements, (void**)&tmp) == SUCCESS) { - zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL); - ++type_num; - zend_hash_move_forward(sdl->elements); - } - } - - if (sdl->encoders) { - i = zend_hash_num_elements(sdl->encoders); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - encodePtr *tmp; - - zend_hash_internal_pointer_reset(sdl->encoders); - while (zend_hash_get_current_data(sdl->encoders, (void**)&tmp) == SUCCESS) { - zend_hash_add(&tmp_encoders, (char*)tmp, sizeof(*tmp), (void**)&encoder_num, sizeof(encoder_num), NULL); - ++encoder_num; - zend_hash_move_forward(sdl->encoders); - } - } - enc = defaultEncoding; - while (enc->details.type != END_KNOWN_TYPES) { - zend_hash_add(&tmp_encoders, (char*)&enc, sizeof(encodePtr), (void**)&encoder_num, sizeof(encoder_num), NULL); - enc++; - ++encoder_num; - } - - if (sdl->groups) { - sdlTypePtr *tmp; - zend_hash_internal_pointer_reset(sdl->groups); - while (zend_hash_get_current_data(sdl->groups, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(sdl->groups, out); - sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out); - zend_hash_move_forward(sdl->groups); - } - } - - if (sdl->types) { - sdlTypePtr *tmp; - zend_hash_internal_pointer_reset(sdl->types); - while (zend_hash_get_current_data(sdl->types, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(sdl->types, out); - sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out); - zend_hash_move_forward(sdl->types); - } - } - - if (sdl->elements) { - sdlTypePtr *tmp; - zend_hash_internal_pointer_reset(sdl->elements); - while (zend_hash_get_current_data(sdl->elements, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(sdl->elements, out); - sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out); - zend_hash_move_forward(sdl->elements); - } - } - - if (sdl->encoders) { - encodePtr *tmp; - zend_hash_internal_pointer_reset(sdl->encoders); - while (zend_hash_get_current_data(sdl->encoders, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(sdl->encoders, out); - sdl_serialize_encoder(*tmp, &tmp_types, out); - zend_hash_move_forward(sdl->encoders); - } - } - - /* serialize bindings */ - if (sdl->bindings) { - i = zend_hash_num_elements(sdl->bindings); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlBindingPtr *tmp; - int binding_num = 1; - - zend_hash_internal_pointer_reset(sdl->bindings); - while (zend_hash_get_current_data(sdl->bindings, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(sdl->bindings, out); - sdl_serialize_string((*tmp)->name, out); - sdl_serialize_string((*tmp)->location, out); - WSDL_CACHE_PUT_1((*tmp)->bindingType,out); - if ((*tmp)->bindingType == BINDING_SOAP && (*tmp)->bindingAttributes != NULL) { - sdlSoapBindingPtr binding = (sdlSoapBindingPtr)(*tmp)->bindingAttributes; - WSDL_CACHE_PUT_1(binding->style, out); - WSDL_CACHE_PUT_1(binding->transport, out); - } else { - WSDL_CACHE_PUT_1(0,out); - } - - zend_hash_add(&tmp_bindings, (char*)tmp, sizeof(*tmp), (void**)&binding_num, sizeof(binding_num), NULL); - binding_num++; - zend_hash_move_forward(sdl->bindings); - } - } - - /* serialize functions */ - i = zend_hash_num_elements(&sdl->functions); - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlFunctionPtr *tmp; - int *binding_num; - int function_num = 1; - - zend_hash_internal_pointer_reset(&sdl->functions); - while (zend_hash_get_current_data(&sdl->functions, (void**)&tmp) == SUCCESS) { - sdl_serialize_key(&sdl->functions, out); - sdl_serialize_string((*tmp)->functionName, out); - sdl_serialize_string((*tmp)->requestName, out); - sdl_serialize_string((*tmp)->responseName, out); - - if ((*tmp)->binding == NULL || - zend_hash_find(&tmp_bindings,(char*)&(*tmp)->binding,sizeof((*tmp)->binding), (void**)&binding_num) != SUCCESS) { - } - WSDL_CACHE_PUT_INT(*binding_num, out); - if (binding_num >= 0) { - if ((*tmp)->binding->bindingType == BINDING_SOAP && (*tmp)->bindingAttributes != NULL) { - sdlSoapBindingFunctionPtr binding = (sdlSoapBindingFunctionPtr)(*tmp)->bindingAttributes; - WSDL_CACHE_PUT_1(binding->style, out); - sdl_serialize_string(binding->soapAction, out); - sdl_serialize_soap_body(&binding->input, &tmp_encoders, &tmp_types, out); - sdl_serialize_soap_body(&binding->output, &tmp_encoders, &tmp_types, out); - } else { - WSDL_CACHE_PUT_1(0,out); - } - } - sdl_serialize_parameters((*tmp)->requestParameters, &tmp_encoders, &tmp_types, out); - sdl_serialize_parameters((*tmp)->responseParameters, &tmp_encoders, &tmp_types, out); - - if ((*tmp)->faults) { - sdlFaultPtr *fault; - - WSDL_CACHE_PUT_INT(zend_hash_num_elements((*tmp)->faults), out); - - zend_hash_internal_pointer_reset((*tmp)->faults); - while (zend_hash_get_current_data((*tmp)->faults, (void**)&fault) == SUCCESS) { - sdl_serialize_key((*tmp)->faults, out); - sdl_serialize_string((*fault)->name, out); - sdl_serialize_parameters((*fault)->details, &tmp_encoders, &tmp_types, out); - if ((*tmp)->binding->bindingType == BINDING_SOAP && (*fault)->bindingAttributes != NULL) { - sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)(*fault)->bindingAttributes; - WSDL_CACHE_PUT_1(binding->use, out); - if (binding->use == SOAP_ENCODED) { - WSDL_CACHE_PUT_1(binding->encodingStyle, out); - } - sdl_serialize_string(binding->ns, out); - } else { - WSDL_CACHE_PUT_1(0, out); - } - zend_hash_move_forward((*tmp)->faults); - } - } else { - WSDL_CACHE_PUT_INT(0, out); - } - - zend_hash_add(&tmp_functions, (char*)tmp, sizeof(*tmp), (void**)&function_num, sizeof(function_num), NULL); - function_num++; - zend_hash_move_forward(&sdl->functions); - } - } - - /* serialize requests */ - if (sdl->requests) { - i = zend_hash_num_elements(sdl->requests); - } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i > 0) { - sdlFunctionPtr *tmp; - int *function_num; - - zend_hash_internal_pointer_reset(sdl->requests); - while (zend_hash_get_current_data(sdl->requests, (void**)&tmp) == SUCCESS) { - if (zend_hash_find(&tmp_functions, (char*)tmp, sizeof(*tmp), (void**)&function_num) != SUCCESS) { - } - WSDL_CACHE_PUT_INT(*function_num, out); - sdl_serialize_key(sdl->requests, out); - zend_hash_move_forward(sdl->requests); - } - } - - write(f, buf.c, buf.len); - close(f); - smart_str_free(&buf); - zend_hash_destroy(&tmp_functions); - zend_hash_destroy(&tmp_bindings); - zend_hash_destroy(&tmp_encoders); - zend_hash_destroy(&tmp_types); -} - -sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC) -{ - sdlPtr sdl = NULL; - char* old_error_code = SOAP_GLOBAL(error_code); - int uri_len; - php_stream_context *context=NULL; - zval **tmp, **proxy_host, **proxy_port, *orig_context, *new_context; - smart_str headers = {0}; - - if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr), - "_stream_context", sizeof("_stream_context"), (void**)&tmp)) { - context = php_stream_context_from_zval(*tmp, 0); - } - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS && - Z_TYPE_PP(proxy_host) == IS_STRING && - zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS && - Z_TYPE_PP(proxy_port) == IS_LONG) { - zval str_port, *str_proxy; - smart_str proxy = {0}; - str_port = **proxy_port; - zval_copy_ctor(&str_port); - convert_to_string(&str_port); - smart_str_appends(&proxy,"tcp://"); - smart_str_appends(&proxy,Z_STRVAL_PP(proxy_host)); - smart_str_appends(&proxy,":"); - smart_str_appends(&proxy,Z_STRVAL(str_port)); - smart_str_0(&proxy); - zval_dtor(&str_port); - MAKE_STD_ZVAL(str_proxy); - ZVAL_STRING(str_proxy, proxy.c, 1); - smart_str_free(&proxy); - - if (!context) { - context = php_stream_context_alloc(); - } - php_stream_context_set_option(context, "http", "proxy", str_proxy); - zval_ptr_dtor(&str_proxy); - - MAKE_STD_ZVAL(str_proxy); - ZVAL_BOOL(str_proxy, 1); - php_stream_context_set_option(context, "http", "request_fulluri", str_proxy); - zval_ptr_dtor(&str_proxy); - - proxy_authentication(this_ptr, &headers TSRMLS_CC); - } - - basic_authentication(this_ptr, &headers TSRMLS_CC); - - if (headers.len > 0) { - zval *str_headers; - - if (!context) { - context = php_stream_context_alloc(); - } - - smart_str_0(&headers); - MAKE_STD_ZVAL(str_headers); - ZVAL_STRING(str_headers, headers.c, 1); - php_stream_context_set_option(context, "http", "header", str_headers); - smart_str_free(&headers); - zval_ptr_dtor(&str_headers); - } - - if (context) { - MAKE_STD_ZVAL(new_context); - php_stream_context_to_zval(context, new_context); - orig_context = php_libxml_switch_context(new_context TSRMLS_CC); - } - - SOAP_GLOBAL(error_code) = "WSDL"; - - if (SOAP_GLOBAL(cache_enabled) && ((uri_len = strlen(uri)) < MAXPATHLEN)) { - char fn[MAXPATHLEN]; - - if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) { - strcpy(fn, uri); - } else if (VCWD_REALPATH(uri, fn) == NULL) { - sdl = load_wsdl(this_ptr, uri TSRMLS_CC); - } - if (sdl == NULL) { - char* key; - time_t t = time(0); - char md5str[33]; - PHP_MD5_CTX context; - unsigned char digest[16]; - int len = strlen(SOAP_GLOBAL(cache_dir)); - - md5str[0] = '\0'; - PHP_MD5Init(&context); - PHP_MD5Update(&context, fn, strlen(fn)); - PHP_MD5Final(digest, &context); - make_digest(md5str, digest); - key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str)); - memcpy(key,SOAP_GLOBAL(cache_dir),len); - memcpy(key+len,"/wsdl-",sizeof("/wsdl-")-1); - memcpy(key+len+sizeof("/wsdl-")-1,md5str,sizeof(md5str)); - - if ((sdl = get_sdl_from_cache(key, fn, t-SOAP_GLOBAL(cache_ttl))) == NULL) { - sdl = load_wsdl(this_ptr, fn TSRMLS_CC); - if (sdl != NULL) { - add_sdl_to_cache(key, fn, t, sdl); - } - } - efree(key); - } - } else { - sdl = load_wsdl(this_ptr, uri TSRMLS_CC); - } - - SOAP_GLOBAL(error_code) = old_error_code; - - if (context) { - php_libxml_switch_context(orig_context TSRMLS_CC); - zval_ptr_dtor(&new_context); - } - - return sdl; -} - -/* Deletes */ -void delete_sdl(void *handle) -{ - sdlPtr tmp = (sdlPtr)handle; - - zend_hash_destroy(&tmp->functions); - if (tmp->source) { - efree(tmp->source); - } - if (tmp->target_ns) { - efree(tmp->target_ns); - } - if (tmp->elements) { - zend_hash_destroy(tmp->elements); - efree(tmp->elements); - } - if (tmp->encoders) { - zend_hash_destroy(tmp->encoders); - efree(tmp->encoders); - } - if (tmp->types) { - zend_hash_destroy(tmp->types); - efree(tmp->types); - } - if (tmp->groups) { - zend_hash_destroy(tmp->groups); - efree(tmp->groups); - } - if (tmp->bindings) { - zend_hash_destroy(tmp->bindings); - efree(tmp->bindings); - } - if (tmp->requests) { - zend_hash_destroy(tmp->requests); - efree(tmp->requests); - } - efree(tmp); -} - -static void delete_binding(void *data) -{ - sdlBindingPtr binding = *((sdlBindingPtr*)data); - - if (binding->location) { - efree(binding->location); - } - if (binding->name) { - efree(binding->name); - } - - if (binding->bindingType == BINDING_SOAP) { - sdlSoapBindingPtr soapBind = binding->bindingAttributes; - if (soapBind) { - efree(soapBind); - } - } - efree(binding); -} - -static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody body) -{ - if (body.ns) { - efree(body.ns); - } - if (body.headers) { - zend_hash_destroy(body.headers); - efree(body.headers); - } -} - -static void delete_function(void *data) -{ - sdlFunctionPtr function = *((sdlFunctionPtr*)data); - - if (function->functionName) { - efree(function->functionName); - } - if (function->requestName) { - efree(function->requestName); - } - if (function->responseName) { - efree(function->responseName); - } - if (function->requestParameters) { - zend_hash_destroy(function->requestParameters); - efree(function->requestParameters); - } - if (function->responseParameters) { - zend_hash_destroy(function->responseParameters); - efree(function->responseParameters); - } - if (function->faults) { - zend_hash_destroy(function->faults); - efree(function->faults); - } - - if (function->bindingAttributes && - function->binding && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes; - if (soapFunction->soapAction) { - efree(soapFunction->soapAction); - } - delete_sdl_soap_binding_function_body(soapFunction->input); - delete_sdl_soap_binding_function_body(soapFunction->output); - efree(soapFunction); - } - efree(function); -} - -static void delete_parameter(void *data) -{ - sdlParamPtr param = *((sdlParamPtr*)data); - if (param->paramName) { - efree(param->paramName); - } - efree(param); -} - -static void delete_header(void *data) -{ - sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data); - if (hdr->name) { - efree(hdr->name); - } - if (hdr->ns) { - efree(hdr->ns); - } - if (hdr->headerfaults) { - zend_hash_destroy(hdr->headerfaults); - efree(hdr->headerfaults); - } - efree(hdr); -} - -static void delete_fault(void *data) -{ - sdlFaultPtr fault = *((sdlFaultPtr*)data); - if (fault->name) { - efree(fault->name); - } - if (fault->details) { - zend_hash_destroy(fault->details); - efree(fault->details); - } - if (fault->bindingAttributes) { - sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes; - - if (binding->ns) { - efree(binding->ns); - } - efree(fault->bindingAttributes); - } - efree(fault); -} - -static void delete_document(void *doc_ptr) -{ - xmlDocPtr doc = *((xmlDocPtr*)doc_ptr); - xmlFreeDoc(doc); -} diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h deleted file mode 100644 index 53329829f1582..0000000000000 --- a/ext/soap/php_sdl.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_SDL_H -#define PHP_SDL_H - -#define XSD_WHITESPACE_COLLAPSE 1 -#define XSD_WHITESPACE_PRESERVE 1 -#define XSD_WHITESPACE_REPLACE 1 - -typedef enum _sdlBindingType { - BINDING_SOAP = 1, - BINDING_HTTP = 2 -} sdlBindingType; - -typedef enum _sdlEncodingStyle { - SOAP_RPC = 1, - SOAP_DOCUMENT = 2 -} sdlEncodingStyle; - -typedef enum _sdlRpcEncodingStyle { - SOAP_ENCODING_DEFAULT = 0, - SOAP_ENCODING_1_1 = 1, - SOAP_ENCODING_1_2 = 2 -} sdlRpcEncodingStyle; - -typedef enum _sdlEncodingUse { - SOAP_ENCODED = 1, - SOAP_LITERAL = 2 -} sdlEncodingUse; - -typedef enum _sdlTransport { - SOAP_TRANSPORT_HTTP = 1 -} sdlTransport; - -struct _sdl { - HashTable functions; /* array of sdlFunction */ - HashTable *types; /* array of sdlTypesPtr */ - HashTable *elements; /* array of sdlTypesPtr */ - HashTable *encoders; /* array of encodePtr */ - HashTable *bindings; /* array of sdlBindings (key'd by name) */ - HashTable *requests; /* array of sdlFunction (references) */ - HashTable *groups; /* array of sdlTypesPtr */ - char *target_ns; - char *source; -}; - -typedef struct sdlCtx { - sdlPtr sdl; - - HashTable docs; /* array of xmlDocPtr */ - - HashTable messages; /* array of xmlNodePtr */ - HashTable bindings; /* array of xmlNodePtr */ - HashTable portTypes; /* array of xmlNodePtr */ - HashTable services; /* array of xmlNodePtr */ - - HashTable *attributes; /* array of sdlAttributePtr */ - HashTable *attributeGroups; /* array of sdlTypesPtr */ -} sdlCtx; - -struct _sdlBinding { - char *name; - char *location; - sdlBindingType bindingType; - void *bindingAttributes; /* sdlSoapBindingPtr */ -}; - -/* Soap Binding Specfic stuff */ -struct _sdlSoapBinding { - sdlEncodingStyle style; - sdlTransport transport; /* not implemented yet */ -}; - -typedef struct _sdlSoapBindingFunctionHeader { - char *name; - char *ns; - sdlEncodingUse use; - sdlTypePtr element; - encodePtr encode; - sdlRpcEncodingStyle encodingStyle; /* not implemented yet */ - HashTable *headerfaults; /* array of sdlSoapBindingFunctionHeaderPtr */ -} sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr; - -typedef struct _sdlSoapBindingFunctionFault { - char *ns; - sdlEncodingUse use; - sdlRpcEncodingStyle encodingStyle; /* not implemented yet */ -} sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr; - -struct _sdlSoapBindingFunctionBody { - char *ns; - sdlEncodingUse use; - sdlRpcEncodingStyle encodingStyle; /* not implemented yet */ - HashTable *headers; /* array of sdlSoapBindingFunctionHeaderPtr */ -}; - -struct _sdlSoapBindingFunction { - char *soapAction; - sdlEncodingStyle style; - - sdlSoapBindingFunctionBody input; - sdlSoapBindingFunctionBody output; -}; - -struct _sdlRestrictionInt { - int value; - char fixed; -}; - -struct _sdlRestrictionChar { - char *value; - char fixed; -}; - -struct _sdlRestrictions { - HashTable *enumeration; /* array of sdlRestrictionCharPtr */ - sdlRestrictionIntPtr minExclusive; - sdlRestrictionIntPtr minInclusive; - sdlRestrictionIntPtr maxExclusive; - sdlRestrictionIntPtr maxInclusive; - sdlRestrictionIntPtr totalDigits; - sdlRestrictionIntPtr fractionDigits; - sdlRestrictionIntPtr length; - sdlRestrictionIntPtr minLength; - sdlRestrictionIntPtr maxLength; - sdlRestrictionCharPtr whiteSpace; - sdlRestrictionCharPtr pattern; -}; - -typedef enum _sdlContentKind { - XSD_CONTENT_ELEMENT, - XSD_CONTENT_SEQUENCE, - XSD_CONTENT_ALL, - XSD_CONTENT_CHOICE, - XSD_CONTENT_GROUP_REF, - XSD_CONTENT_GROUP, - XSD_CONTENT_ANY -} sdlContentKind; - - -typedef struct _sdlContentModel sdlContentModel, *sdlContentModelPtr; - -struct _sdlContentModel { - sdlContentKind kind; - int min_occurs; - int max_occurs; - union { - sdlTypePtr element; /* pointer to element */ - sdlTypePtr group; /* pointer to group */ - HashTable *content; /* array of sdlContentModel for sequnce,all,choice*/ - char *group_ref; /* reference to group */ - } u; -}; - -typedef enum _sdlTypeKind { - XSD_TYPEKIND_SIMPLE, - XSD_TYPEKIND_LIST, - XSD_TYPEKIND_UNION, - XSD_TYPEKIND_COMPLEX, - XSD_TYPEKIND_RESTRICTION, - XSD_TYPEKIND_EXTENSION -} sdlTypeKind; - -typedef enum _sdlUse { - XSD_USE_DEFAULT, - XSD_USE_OPTIONAL, - XSD_USE_PROHIBITED, - XSD_USE_REQUIRED -} sdlUse; - -typedef enum _sdlForm { - XSD_FORM_DEFAULT, - XSD_FORM_QUALIFIED, - XSD_FORM_UNQUALIFIED -} sdlForm; - -struct _sdlType { - sdlTypeKind kind; - char *name; - char *namens; - char nillable; - HashTable *elements; /* array of sdlTypePtr */ - HashTable *attributes; /* array of sdlAttributePtr */ - sdlRestrictionsPtr restrictions; - encodePtr encode; - sdlContentModelPtr model; - char *def; - char *fixed; - char *ref; - sdlForm form; -}; - -struct _sdlParam { - int order; - sdlTypePtr element; - encodePtr encode; - char *paramName; -}; - -typedef struct _sdlFault { - char *name; - HashTable *details; /* array of sdlParamPtr */ - void *bindingAttributes; /* sdlSoapBindingFunctionFaultPtr */ -} sdlFault, *sdlFaultPtr; - -struct _sdlFunction { - char *functionName; - char *requestName; - char *responseName; - HashTable *requestParameters; /* array of sdlParamPtr */ - HashTable *responseParameters; /* array of sdlParamPtr (this should only be one) */ - struct _sdlBinding *binding; - void *bindingAttributes; /* sdlSoapBindingFunctionPtr */ - HashTable *faults; /* array of sdlFaultPtr */ -}; - -typedef struct _sdlExtraAttribute { - char *ns; - char *val; -} sdlExtraAttribute, *sdlExtraAttributePtr; - -struct _sdlAttribute { - char *name; - char *namens; - char *ref; - char *def; - char *fixed; - sdlForm form; - sdlUse use; - HashTable *extraAttributes; /* array of sdlExtraAttribute */ - encodePtr encode; -}; - -sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC); - -encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type); -encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type); -encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len); - -sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type); -sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns); - -void delete_sdl(void *handle); - -#endif diff --git a/ext/soap/php_soap.dsp b/ext/soap/php_soap.dsp deleted file mode 100644 index 4157c6332044a..0000000000000 --- a/ext/soap/php_soap.dsp +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php_soap" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php_soap - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php_soap.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php_soap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php_soap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php_soap - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTSWS" /D "PHP_SOAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=0 /D "COMPILE_DL_SOAP" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS" - -!ELSEIF "$(CFG)" == "php_soap - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Debug_TS/" /Fp"Debug_TS/soap.pch" /YX /Fo"Debug_TS/" /Fd"Debug_TS/" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_soap.dll" /pdbtype:sept /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none /incremental:no - -!ENDIF - -# Begin Target - -# Name "php_soap - Win32 Release_TS" -# Name "php_soap - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_encoding.c -# End Source File -# Begin Source File - -SOURCE=.\php_http.c -# End Source File -# Begin Source File - -SOURCE=.\php_packet_soap.c -# End Source File -# Begin Source File - -SOURCE=.\php_schema.c -# End Source File -# Begin Source File - -SOURCE=.\php_sdl.c -# End Source File -# Begin Source File - -SOURCE=.\php_xml.c -# End Source File -# Begin Source File - -SOURCE=.\soap.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_encoding.h -# End Source File -# Begin Source File - -SOURCE=.\php_http.h -# End Source File -# Begin Source File - -SOURCE=.\php_packet_soap.h -# End Source File -# Begin Source File - -SOURCE=.\php_schema.h -# End Source File -# Begin Source File - -SOURCE=.\php_sdl.h -# End Source File -# Begin Source File - -SOURCE=.\php_soap.h -# End Source File -# Begin Source File - -SOURCE=.\php_xml.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h deleted file mode 100644 index 552ef172ad0fe..0000000000000 --- a/ext/soap/php_soap.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_SOAP_H -#define PHP_SOAP_H - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/php_standard.h" -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) -#include "ext/session/php_session.h" -#endif -#include "ext/standard/php_smart_str.h" -#include "php_ini.h" -#include "SAPI.h" -#include -#include - -#ifdef HAVE_PHP_DOMXML -# include "ext/domxml/php_domxml.h" -#endif - -#ifndef PHP_HAVE_STREAMS -# error You lose - must be compiled against PHP 4.3.0 or later -#endif - -#ifndef PHP_WIN32 -# define TRUE 1 -# define FALSE 0 -# define stricmp strcasecmp -#endif - -extern int le_url; - -typedef struct _encodeType encodeType, *encodeTypePtr; -typedef struct _encode encode, *encodePtr; - -typedef struct _sdl sdl, *sdlPtr; -typedef struct _sdlRestrictionInt sdlRestrictionInt, *sdlRestrictionIntPtr; -typedef struct _sdlRestrictionChar sdlRestrictionChar, *sdlRestrictionCharPtr; -typedef struct _sdlRestrictions sdlRestrictions, *sdlRestrictionsPtr; -typedef struct _sdlType sdlType, *sdlTypePtr; -typedef struct _sdlParam sdlParam, *sdlParamPtr; -typedef struct _sdlFunction sdlFunction, *sdlFunctionPtr; -typedef struct _sdlAttribute sdlAttribute, *sdlAttributePtr; -typedef struct _sdlBinding sdlBinding, *sdlBindingPtr; -typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr; -typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr; -typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr; - -typedef struct _soapMapping soapMapping, *soapMappingPtr; -typedef struct _soapService soapService, *soapServicePtr; - -#include "php_xml.h" -#include "php_encoding.h" -#include "php_sdl.h" -#include "php_schema.h" -#include "php_http.h" -#include "php_packet_soap.h" - -struct _soapMapping { - char *ns; - char *ctype; - int type; - - struct _map_functions { - zval *to_xml_before; - zval *to_xml; - zval *to_xml_after; - zval *to_zval_before; - zval *to_zval; - zval *to_zval_after; - } map_functions; - - struct _map_class { - int type; - zend_class_entry *ce; - } map_class; -}; - -struct _soapService { - sdlPtr sdl; - - struct _soap_functions { - HashTable *ft; - int functions_all; - } soap_functions; - - struct _soap_class { - zend_class_entry *ce; - zval **argv; - int argc; - int persistance; - } soap_class; - - HashTable *mapping; - int version; - int type; - char *actor; - char *uri; - xmlCharEncodingHandlerPtr encoding; - HashTable *class_map; -}; - -#define SOAP_CLASS 1 -#define SOAP_FUNCTIONS 2 -#define SOAP_FUNCTIONS_ALL 999 - -#define SOAP_MAP_FUNCTION 1 -#define SOAP_MAP_CLASS 2 - -#define SOAP_PERSISTENCE_SESSION 1 -#define SOAP_PERSISTENCE_REQUEST 2 - -#define SOAP_1_1 1 -#define SOAP_1_2 2 - -#define SOAP_ACTOR_NEXT 1 -#define SOAP_ACTOR_NONE 2 -#define SOAP_ACTOR_UNLIMATERECEIVER 3 - -#define SOAP_1_1_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next" - -#define SOAP_1_2_ACTOR_NEXT "http://www.w3.org/2003/05/soap-envelope/role/next" -#define SOAP_1_2_ACTOR_NONE "http://www.w3.org/2003/05/soap-envelope/role/none" -#define SOAP_1_2_ACTOR_UNLIMATERECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" - -#define SOAP_COMPRESSION_ACCEPT 0x20 -#define SOAP_COMPRESSION_GZIP 0x00 -#define SOAP_COMPRESSION_DEFLATE 0x10 - -#define SOAP_AUTHENTICATION_BASIC 0 -#define SOAP_AUTHENTICATION_DIGEST 1 - -ZEND_BEGIN_MODULE_GLOBALS(soap) - HashTable defEncNs; /* mapping of default namespaces to prefixes */ - HashTable defEnc; - HashTable defEncIndex; - HashTable *overrides; - int cur_uniq_ns; - int soap_version; - sdlPtr sdl; - zend_bool use_soap_error_handler; - char* error_code; - zval* error_object; - zend_bool cache_enabled; - char* cache_dir; - long cache_ttl; - xmlCharEncodingHandlerPtr encoding; - HashTable *class_map; -ZEND_END_MODULE_GLOBALS(soap) - -#ifdef PHP_WIN32 -#define PHP_SOAP_API __declspec(dllexport) -#else -#define PHP_SOAP_API -#endif -#ifdef ZTS -#include "TSRM.h" -#endif - -extern zend_module_entry soap_module_entry; -#define soap_module_ptr &soap_module_entry -#define phpext_soap_ptr soap_module_ptr - -ZEND_EXTERN_MODULE_GLOBALS(soap) - -#ifdef ZTS -# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v) -#else -# define SOAP_GLOBAL(v) (soap_globals.v) -#endif - -extern zend_class_entry* soap_var_class_entry; - -zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC); - -#define soap_error0(severity, format) \ - php_error(severity, "SOAP-ERROR: " format) - -#define soap_error1(severity, format, param1) \ - php_error(severity, "SOAP-ERROR: " format, param1) - -#define soap_error2(severity, format, param1, param2) \ - php_error(severity, "SOAP-ERROR: " format, param1, param2) - -#define soap_error3(severity, format, param1, param2, param3) \ - php_error(severity, "SOAP-ERROR: " format, param1, param2, param3) - -#endif diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c deleted file mode 100644 index 73a3963190847..0000000000000 --- a/ext/soap/php_xml.c +++ /dev/null @@ -1,340 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_soap.h" -#include "libxml/parser.h" -#include "libxml/parserInternals.h" - -/* Channel libxml file io layer through the PHP streams subsystem. - * This allows use of ftps:// and https:// urls */ - -static int is_blank(const char* str) -{ - while (*str != '\0') { - if (*str != ' ' && *str != 0x9 && *str != 0xa && *str != 0xd) { - return 0; - } - str++; - } - return 1; -} - -/* removes all empty text, comments and other insignoficant nodes */ -static void cleanup_xml_node(xmlNodePtr node) -{ - xmlNodePtr trav; - xmlNodePtr del = NULL; - - trav = node->children; - while (trav != NULL) { - if (del != NULL) { - xmlUnlinkNode(del); - xmlFreeNode(del); - del = NULL; - } - if (trav->type == XML_TEXT_NODE) { - if (is_blank(trav->content)) { - del = trav; - } - } else if ((trav->type != XML_ELEMENT_NODE) && - (trav->type != XML_CDATA_SECTION_NODE)) { - del = trav; - } else if (trav->children != NULL) { - cleanup_xml_node(trav); - } - trav = trav->next; - } - if (del != NULL) { - xmlUnlinkNode(del); - xmlFreeNode(del); - } -} - -static void soap_ignorableWhitespace(void *ctx, const xmlChar *ch, int len) -{ -} - -static void soap_Comment(void *ctx, const xmlChar *value) -{ -} - -xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC) -{ - xmlParserCtxtPtr ctxt = NULL; - xmlDocPtr ret; - zend_bool old_allow_url_fopen; - -/* - xmlInitParser(); -*/ - - old_allow_url_fopen = PG(allow_url_fopen); - PG(allow_url_fopen) = 1; - ctxt = xmlCreateFileParserCtxt(filename); - PG(allow_url_fopen) = old_allow_url_fopen; - if (ctxt) { - ctxt->keepBlanks = 0; - ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; - ctxt->sax->comment = soap_Comment; - ctxt->sax->warning = NULL; - ctxt->sax->error = NULL; - /*ctxt->sax->fatalError = NULL;*/ - xmlParseDocument(ctxt); - if (ctxt->wellFormed) { - ret = ctxt->myDoc; - if (ret->URL == NULL && ctxt->directory != NULL) { - ret->URL = xmlStrdup(ctxt->directory); - } - } else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - xmlFreeParserCtxt(ctxt); - } else { - ret = NULL; - } - -/* - xmlCleanupParser(); -*/ - - if (ret) { - cleanup_xml_node((xmlNodePtr)ret); - } - return ret; -} - -xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) -{ - xmlParserCtxtPtr ctxt = NULL; - xmlDocPtr ret; - -/* - xmlInitParser(); -*/ - ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); - if (ctxt) { - ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; - ctxt->sax->comment = soap_Comment; - ctxt->sax->warning = NULL; - ctxt->sax->error = NULL; - /*ctxt->sax->fatalError = NULL;*/ - xmlParseDocument(ctxt); - if (ctxt->wellFormed) { - ret = ctxt->myDoc; - if (ret->URL == NULL && ctxt->directory != NULL) { - ret->URL = xmlStrdup(ctxt->directory); - } - } else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - xmlFreeParserCtxt(ctxt); - } else { - ret = NULL; - } - -/* - xmlCleanupParser(); -*/ - -/* - if (ret) { - cleanup_xml_node((xmlNodePtr)ret); - } -*/ - return ret; -} - -#ifndef ZEND_ENGINE_2 -int php_stream_xmlIO_match_wrapper(const char *filename) -{ - TSRMLS_FETCH(); - return php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ? 1 : 0; -} - -void *php_stream_xmlIO_open_wrapper(const char *filename) -{ - TSRMLS_FETCH(); - return php_stream_open_wrapper((char*)filename, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); -} - -int php_stream_xmlIO_read(void *context, char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_read((php_stream*)context, buffer, len); -} - -int php_stream_xmlIO_close(void *context) -{ - TSRMLS_FETCH(); - return php_stream_close((php_stream*)context); -} -#endif - -xmlNsPtr attr_find_ns(xmlAttrPtr node) -{ - if (node->ns) { - return node->ns; - } else if (node->parent->ns) { - return node->parent->ns; - } else { - return xmlSearchNs(node->doc, node->parent, NULL); - } -} - -xmlNsPtr node_find_ns(xmlNodePtr node) -{ - if (node->ns) { - return node->ns; - } else { - return xmlSearchNs(node->doc, node, NULL); - } -} - -int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns) -{ - if (name == NULL || strcmp(node->name, name) == 0) { - if (ns) { - xmlNsPtr nsPtr = attr_find_ns(node); - if (nsPtr) { - return (strcmp(nsPtr->href, ns) == 0); - } else { - return FALSE; - } - } - return TRUE; - } - return FALSE; -} - -int node_is_equal_ex(xmlNodePtr node, char *name, char *ns) -{ - if (name == NULL || strcmp(node->name, name) == 0) { - if (ns) { - xmlNsPtr nsPtr = node_find_ns(node); - if (nsPtr) { - return (strcmp(nsPtr->href, ns) == 0); - } else { - return FALSE; - } - } - return TRUE; - } - return FALSE; -} - - -xmlAttrPtr get_attribute_ex(xmlAttrPtr node, char *name, char *ns) -{ - while (node!=NULL) { - if (attr_is_equal_ex(node, name, ns)) { - return node; - } - node = node->next; - } - return NULL; -} - -xmlNodePtr get_node_ex(xmlNodePtr node, char *name, char *ns) -{ - while (node!=NULL) { - if (node_is_equal_ex(node, name, ns)) { - return node; - } - node = node->next; - } - return NULL; -} - -xmlNodePtr get_node_recurisve_ex(xmlNodePtr node, char *name, char *ns) -{ - while (node != NULL) { - if (node_is_equal_ex(node, name, ns)) { - return node; - } else if (node->children != NULL) { - xmlNodePtr tmp = get_node_recurisve_ex(node->children, name, ns); - if (tmp) { - return tmp; - } - } - node = node->next; - } - return NULL; -} - -xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns) -{ - xmlAttrPtr attr; - - while (node != NULL) { - if (name != NULL) { - node = get_node_ex(node, name, name_ns); - if (node==NULL) { - return NULL; - } - } - - attr = get_attribute_ex(node->properties, attribute, attr_ns); - if (attr != NULL && strcmp(attr->children->content, value) == 0) { - return node; - } - node = node->next; - } - return NULL; -} - -xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns) -{ - while (node != NULL) { - if (node_is_equal_ex(node, name, name_ns)) { - xmlAttrPtr attr = get_attribute_ex(node->properties, attribute, attr_ns); - if (attr != NULL && strcmp(attr->children->content, value) == 0) { - return node; - } - } - if (node->children != NULL) { - xmlNodePtr tmp = get_node_with_attribute_recursive_ex(node->children, name, name_ns, attribute, value, attr_ns); - if (tmp) { - return tmp; - } - } - node = node->next; - } - return NULL; -} - -int parse_namespace(const char *inval, char **value, char **namespace) -{ - char *found = strrchr(inval, ':'); - - if (found != NULL && found != inval) { - (*namespace) = estrndup(inval, found - inval); - (*value) = estrdup(++found); - } else { - (*value) = estrdup(inval); - (*namespace) = NULL; - } - - return FALSE; -} diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h deleted file mode 100644 index 7c4a282084b1f..0000000000000 --- a/ext/soap/php_xml.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef PHP_SOAP_XML_H -#define PHP_SOAP_XML_H - -#define get_attribute(node, name) get_attribute_ex(node, name, NULL) -#define get_node(node, name) get_node_ex(node, name, NULL) -#define get_node_recursive(node, name) get_node_recursive_ex(node, name, NULL) -#define get_node_with_attribute(node, name, attr, val) get_node_with_attribute_ex(node, name, NULL, attr, val, NULL) -#define get_node_with_attribute_recursive(node, name, attr, val) get_node_with_attribute_recursive_ex(node, name, NULL, attr, val, NULL) -#define node_is_equal(node, name) node_is_equal_ex(node, name, NULL) -#define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL) - -xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC); -xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size); - -xmlNsPtr attr_find_ns(xmlAttrPtr node); -xmlNsPtr node_find_ns(xmlNodePtr node); -int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns); -int node_is_equal_ex(xmlNodePtr node, char *name, char *ns); -xmlAttrPtr get_attribute_ex(xmlAttrPtr node,char *name, char *ns); -xmlNodePtr get_node_ex(xmlNodePtr node,char *name, char *ns); -xmlNodePtr get_node_recursive_ex(xmlNodePtr node,char *name, char *ns); -xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns); -xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns); -int parse_namespace(const char *inval,char **value,char **namespace); - -#ifndef ZEND_ENGINE_2 -int php_stream_xmlIO_match_wrapper(const char *filename); -void *php_stream_xmlIO_open_wrapper(const char *filename); -int php_stream_xmlIO_read(void *context, char *buffer, int len); -int php_stream_xmlIO_close(void *context); -#endif - -#define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i) -#define FOREACHATTRNODEEX(n,c,ns,i) \ - do { \ - if (n == NULL) { \ - break; \ - } \ - if (c) { \ - i = get_attribute_ex(n,c,ns); \ - } else { \ - i = n; \ - } \ - if (i != NULL) { \ - n = i; - -#define FOREACHNODE(n,c,i) FOREACHNODEEX(n,c,NULL,i) -#define FOREACHNODEEX(n,c,ns,i) \ - do { \ - if (n == NULL) { \ - break; \ - } \ - if (c) { \ - i = get_node_ex(n,c,NULL); \ - } else { \ - i = n; \ - } \ - if(i != NULL) { \ - n = i; - -#define ENDFOREACH(n) \ - } \ - } while ((n = n->next)); - -#endif diff --git a/ext/soap/readme.html b/ext/soap/readme.html deleted file mode 100644 index 98efff3c5343c..0000000000000 --- a/ext/soap/readme.html +++ /dev/null @@ -1,646 +0,0 @@ - - -PHP SOAP Manual - - - - -

PHP SOAP

-

Introduction

- - - -
Warning
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk. -
-

-SOAP extension can be used to write SOAP Servers and Clients. It supports -subsets of SOAP 1.1, -SOAP 1.2 and -WSDL 1.1 specifications. -

-
-

Requirements

-This extension makes use of the GNOME XML library. Download and install this library. You will need at least libxml-2.5.4. -
-

Installation

-This extension is only available if PHP was configured with --enable-soap. -
-

Runtime Configuration

-

The behaviour of these functions is affected by settings in php.ini.

- - - - - -
NameDefaultChangeable
soap.wsdl_cache_enabled"1"PHP_INI_ALL
soap.wsdl_cache_dir"/tmp"PHP_INI_ALL
soap.wsdl_cache_ttl86400PHP_INI_ALL
-

Here is a short explanation of the configuration directives.

-
-
soap.wsdl_cache_enabled (boolean)
-
enables or disables WSDL caching feature.
-
soap.wsdl_cache_dir (string)
-
sets the directory name where SOAP extension will put cache files
-
soap.wsdl_cache_ttl (integer)
-
(time to live) sets the number of second while cached file will be used instead of original one.
-
- - -
-

Predefined Constants

-The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantValueDescription
SOAP_1_1 (integer)1SOAP version - SOAP 1.1. Can be used as an option in SoapClient and SoapServer constructors.
SOAP_1_2 (integer)2SOAP version - SOAP 1.2. Can be used as an option in SoapClient and SoapServer constructors.
SOAP_FUNCTIONS_ALL (integer)999Allows to export all defined functions with SoapClient::addFunction
SOAP_PERSISTENCE_SESSION (integer)1Allows making class passed to SoapServer::setClass persistent for a PHP session.
SOAP_PERSISTENCE_REQUEST (integer)2Allows making class passed to SoapServer::setClass non-persistent for a PHP session.
SOAP_ENCODED (integer)1Can be passed as style option to SoapClient constructor in nonWSDL mode.
SOAP_LITERAL (integer)2Can be passed as style option to SoapClient constructor in nonWSDL mode.
SOAP_RPC (integer)1Can be passed as use option to SoapClient constructor in nonWSDL mode.
SOAP_DOCUMENT (integer)2Can be passed as use option to SoapClient constructor in nonWSDL mode.
SOAP_ACTOR_NEXT (integer)1Can be passed as actor to SoapHeader constructor.
SOAP_ACTOR_NONE (integer)2Can be passed as actor to SoapHeader constructor
SOAP_ACTOR_UNLIMATERECEIVER (integer)3Can be passed as actor to SoapHeader constructor
UNKNOWN_TYPE (integer)999998Encoding for unknown type. Can be passed to SoapVar constructor.
XSD_STRING (integer)101Encoding for standard XMLSchema string type. Can be passed to SoapVar constructor.
XSD_BOOLEAN (integer)102Encoding for standard XMLSchema boolen type. Can be passed to SoapVar constructor.
XSD_DECIMAL (integer)103Encoding for standard XMLSchema decimal type. Can be passed to SoapVar constructor.
XSD_FLOAT (integer)104Encoding for standard XMLSchema float type. Can be passed to SoapVar constructor.
XSD_DOUBLE (integer)105Encoding for standard XMLSchema double type. Can be passed to SoapVar constructor.
XSD_DURATION (integer)106Encoding for standard XMLSchema duration type. Can be passed to SoapVar constructor.
XSD_DATETIME (integer)107Encoding for standard XMLSchema dateTime type. Can be passed to SoapVar constructor.
XSD_TIME (integer)108Encoding for standard XMLSchema time type. Can be passed to SoapVar constructor.
XSD_DATE (integer)109Encoding for standard XMLSchema data type. Can be passed to SoapVar constructor.
XSD_GYEARMONTH (integer)110Encoding for standard XMLSchema gYearMonth type. Can be passed to SoapVar constructor.
XSD_GYEAR (integer)111Encoding for standard XMLSchema gYear type. Can be passed to SoapVar constructor.
XSD_GMONTHDAY (integer)112Encoding for standard XMLSchema gMonthDay type. Can be passed to SoapVar constructor.
XSD_GDAY (integer)113Encoding for standard XMLSchema gDay type. Can be passed to SoapVar constructor.
XSD_GMONTH (integer)114Encoding for standard XMLSchema gMonth type. Can be passed to SoapVar constructor.
XSD_HEXBINARY (integer)115Encoding for standard XMLSchema hexBinary type. Can be passed to SoapVar constructor.
XSD_BASE64BINARY (integer)116Encoding for standard XMLSchema base64Binary type. Can be passed to SoapVar constructor.
XSD_ANYURI (integer)117Encoding for standard XMLSchema anyURI type. Can be passed to SoapVar constructor.
XSD_QNAME (integer)118Encoding for standard XMLSchema QName type. Can be passed to SoapVar constructor.
XSD_NOTATION (integer)119Encoding for standard XMLSchema NOTATION type. Can be passed to SoapVar constructor.
XSD_NORMALIZEDSTRING (integer)120Encoding for standard XMLSchema normalizedString type. Can be passed to SoapVar constructor.
XSD_TOKEN (integer)121Encoding for standard XMLSchema token type. Can be passed to SoapVar constructor.
XSD_LANGUAGE (integer)122Encoding for standard XMLSchema language type. Can be passed to SoapVar constructor.
XSD_NMTOKEN (integer)123Encoding for standard XMLSchema NMTOKEN type. Can be passed to SoapVar constructor.
XSD_NAME (integer)124Encoding for standard XMLSchema Name type. Can be passed to SoapVar constructor.
XSD_NCNAME (integer)125Encoding for standard XMLSchema NCName type. Can be passed to SoapVar constructor.
XSD_ID (integer)126Encoding for standard XMLSchema ID type. Can be passed to SoapVar constructor.
XSD_IDREF (integer)127Encoding for standard XMLSchema IDREF type. Can be passed to SoapVar constructor.
XSD_IDREFS (integer)128Encoding for standard XMLSchema IDREFS type. Can be passed to SoapVar constructor.
XSD_ENTITY (integer)129Encoding for standard XMLSchema ENTITY type. Can be passed to SoapVar constructor.
XSD_ENTITIES (integer)130Encoding for standard XMLSchema ENTITIES type. Can be passed to SoapVar constructor.
XSD_INTEGER (integer)131Encoding for standard XMLSchema integer type. Can be passed to SoapVar constructor.
XSD_NONPOSITIVEINTEGER (integer)132Encoding for standard XMLSchema nonPositiveInteger type. Can be passed to SoapVar constructor.
XSD_NEGATIVEINTEGER (integer)133Encoding for standard XMLSchema negativeInteger type. Can be passed to SoapVar constructor.
XSD_LONG (integer)134Encoding for standard XMLSchema long type. Can be passed to SoapVar constructor.
XSD_INT (integer)135Encoding for standard XMLSchema int type. Can be passed to SoapVar constructor.
XSD_SHORT (integer)136Encoding for standard XMLSchema short type. Can be passed to SoapVar constructor.
XSD_BYTE (integer)137Encoding for standard XMLSchema byte type. Can be passed to SoapVar constructor.
XSD_NONNEGATIVEINTEGER (integer)138Encoding for standard XMLSchema nonNegativeInteger type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDLONG (integer)139Encoding for standard XMLSchema unsignedLong type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDINT (integer)140Encoding for standard XMLSchema unsignedInt type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDSHORT (integer)141Encoding for standard XMLSchema unsignedShort type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDBYTE (integer)142Encoding for standard XMLSchema unsignedByte type. Can be passed to SoapVar constructor.
XSD_POSITIVEINTEGER (integer)143Encoding for standard XMLSchema positiveInteger type. Can be passed to SoapVar constructor.
XSD_NMTOKENS (integer)144Encoding for standard XMLSchema NMTOKENS type. Can be passed to SoapVar constructor.
XSD_ANYTYPE (integer)145Encoding for standard XMLSchema anyType type. Can be passed to SoapVar constructor.
SOAP_ENC_ARRAY (integer)300Encoding for SOAP Array type. Can be passed to SoapVar constructor.
SOAP_ENC_OBJECT (integer)301Encoding for SOAP Struct type. Can be passed to SoapVar constructor.
XSD_1999_TIMEINSTANT (integer)401Encoding for old XMLSchema timeInstant type. Can be passed to SoapVar constructor.
XSD_NAMESPACE (string) The XML Schema namespace.
XSD_1999_NAMESPACE (string) The old XML Schema namespace.
-
-

Classes

-

List of classes

- - - - - - - -
SoapClient
SoapServer
SoapParam
SoapVar
SoapHeader
SoapFault
- -

SoapClient class

-A SOAP client, that allows calling remote methods on SOAP WebService over HTTP -or HTTPS. - - - - - - - -
SoapClient -- SoapClient constructor
__call -- calls a SOAP function
__getLastRequest -- returns last SOAP request
__getLastResponse -- returns last SOAP response
__getFunctions -- returns list of SOAP functions
__getTypes -- returns list of SOAP types
-
-

SoapServer class

-This class can be used to build SOAP WebServices, which can be accessed from -remote SOAP clients over HTTP or HTTPS. - - - - - - - -
SoapServer -- SoapServer constructor
addFunction -- adds one or several functions those will handle SOAP requests
setClass -- sets class which will handle SOAP requests
getFunctions -- returns list of defined functions
setPersistence -- sets persistence mode of SoapServer
handle -- handles a SOAP request
-
-

SoapParam class

-

-SoapParam is a special low-level class for naming parameters and return values -in nonWSDL mode. It is just a data holder and it has not any special method -except constructor. -

- - -
SoapParam -- SoapParam constructor
-
-

SoapVar classes

-

-SoapVar is a special low-level class for encoding parameters and return values -in nonWSDL mode. It is just a data holder and it has not any special method -except constructor. It is useful when you like to set type property in SOAP -request or response. -

- - -
SoapVar -- SoapVar constructor
-
-

SoapHeader class

-

-SoapHeader is a special low-level class for passing or returning SOAP headers. -It is just a data holder and it has not any special method except constructor. -

- - -
SoapHeader -- SoapHeader constructor
-
-

SoapFault class

-

-SoapFault is a special class that can be used for error reporting during -handling of SOAP request. It is derived form standard PHP Exception class, -so it can be used to throw exceptions in server side and to catch tham on -client side. -

- - -
SoapFault -- SoapFault constructor
-
- -

Table of Contents

- - - - - - - - - - - - - - - - - - -
is_soap_fault -- checks if SOAP call was failed
SoapClient::SoapClient -- SoapClient constructor
SoapClient::__call -- calls a SOAP function
SoapClient::__getLastRequest -- returns last SOAP request
SoapClient::__getLastResponse -- returns last SOAP response
SoapClient::__getFunctions -- returns list of SOAP functions
SoapClient::__getTypes -- returns list of SOAP types
SoapServer::SoapServer -- SoapServer constructor
SoapServer::addFunction -- adds one or several functions those will handle SOAP requests
SoapServer::setClass -- sets class which will handle SOAP requests
SoapServer::getFunctions -- returns list of defined functions
SoapServer::setPersistence -- sets persistence mode of SoapServer
SoapServer::handle -- handles a SOAP request
SoapParam::SoapParam -- SoapParam constructor
SoapVar::SoapVar -- SoapVar constructor
SoapHeader::SoapHeader -- SoapHeader constructor
SoapFault::SoapFault -- SoapFault constructor
- -
-

is_soap_fault

-

(PHP 5)

-

checks if SOAP call was failed

-

Description

-

bool is_soap_fault(mixed obj)

-

-This function is useful when you like to check if the SOAP call was failed, -but don't like to use exceptions. To use it you must create SoapClient object -with exceptions option set to zero or false. In this case SOAP method -will return a special SoapFault object which encapsulate the fault details -(faultcode, faultstring, faultactor and faultdetails). If exceptions is -not set then SOAP call will throw an exception on error.
-is_soap_fault() functions checks if the given parameter is a SoapFault object.
-

-

Example

-
-<?php
-    $client = SoapClient("some.wsdl",array("exceptions"=>0));
-    $result = $client->SomeFunction(...);
-    if (is_soap_fault($result)) {
-        trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faulstring})", E_ERROR);
-    }
-?>
-

Standard method that used by SOAP extension for error reporting is excptions.

-
-<?php
-    try {
-        $client = SoapClient("some.wsdl");
-        $result = $client->SomeFunction(...);
-    } catch (SoapFault $fault) {
-        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faulstring})", E_ERROR);
-    }
-?>
- - -

SoapClient::SoapClient

-

(PHP 5)

-

SoapClient constructor

-

Description

-

SoapClient(mixed wsdl [, array options])

-

-The constructor allows creating SoapClient objects in WSDL or nonWSDL mode. -The first case requires URI of WSDL file as first parameter and optional -options array. The second case requires NULL as first parameter and options -array with location and uri options set. Where location is -a URL to request and uri is a target namespace of the SOAP service. -style and use options has effect only on nonWSDL (in WSDL mode -they comes from WSDL file). soap_version option allows to work as SOAP 1.1 or -SOAP 1.2 client. -Some additional optional options allow using HTTP authentication (login -and password) and HTTP connection through proxy server (proxy_host, -proxy_port, proxy_login and proxy_password). -

-

Examples

-
-    $client = new SoapClient("some.wsdl");
-
-    $client = new SoapClient("some.wsdl",array('soap_version'   => SOAP_1_2));
-
-    $client = new SoapClient("some.wsdl",array('login'          => "some_name",
-                                               'password'       => "some_password"));
-
-    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
-                                               'proxy_port'     => 8080));
-
-    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
-                                               'proxy_port'     => 8080,
-                                               'proxy_login'    => "some_name",
-                                               'proxy_password' => "some_password"));
-
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/"));
-
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/",
-                                        'style'    => SOAP_DOCUMENT,
-                                        'use'      => SOAP_LITERAL));
-
- - -

SoapClient::__call

-

(PHP 5)

-

calls a SOAP function

-

Description

-

mixed __call(string function_name, array arguments, [array options [, mixed input_headers [, mixed &output_headers]]])

-

-This is a low level API function to make a SOAP call. Usually in WSDL mode -you can simple call SOAP functions as SoapClient methods. It is useful for -nonWSDL mode when 'soapaction' is unknown, 'uri' is differ form default or -when ypu like to send and/or receive SOAP Headers. To check if function call -is failed check the result with is_soap_fault() function.
-SOAP function may return one or several values. In the first case __call will -return just the value of output parameter, in the second it will return -array with named output parameters. -

-

Examples

-
-    $client = new SoapClient("some.wsdl");
-    $client->SomeFunction($a,$b,$c);
-    $client->__call("SomeFunction",array($a,$b,$c));
-    $client->__call("SomeFunction",array($a,$b,$c), NULL,
-                    new SoapHeader(...), $output_headers);
-
-
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/"));
-    $client->SomeFunction($a,$b,$c);
-    $client->__call("SomeFunction",array($a,$b,$c));
-    $client->__call("SomeFunction",array($a,$b,$c),
-                    array('soapaction' => 'some_action',
-                          'uri'        => 'some_uri'));
-
- - -

SoapClient::__getLastRequest

-

(PHP 5)

-

returns last SOAP request

-

Description

-

string __getLastRequest()

-

-This function works only with SoapClient which was created with trace option. -

-

Example

-
-<?php
-    $client = SoapClient("some.wsdl", array('trace'=>1));
-    $result = $client->SomeFunction(...);
-    echo "REQUEST:\n".$client->__getLastRequest()."\n";
-?>
-
- - -

SoapClient::__getLastResponse

-

(PHP 5)

-

returns last SOAP response

-

Description

-

string __getLastResponse()

-

-This function works only with SoapClient which was created with trace option. -

-

Example

-
-<?php
-    $client = SoapClient("some.wsdl", array('trace'=>1));
-    $result = $client->SomeFunction(...);
-    echo "RESPONSE:\n".$client->__getLastResponse()."\n";
-?>
-
- - -

SoapClient::__getFunctions

-

(PHP 5)

-

returns list of SOAP functions

-

Description

-

array __getFunctions()

-

-This function works only in WSDL mode. -

-

Example

-
-<?php
-    $client = SoapClient("some.wsdl");
-    var_dump($client->__getFunctions());
-?>
-
- - -

SoapClient::__getTypes

-

(PHP 5)

-

returns list of SOAP types

-

Description

-

array __getTypes()

-

-This function works only in WSDL mode. -

-

Example

-
-<?php
-    $client = SoapClient("some.wsdl");
-    var_dump($client->__getTypes());
-?>
-
- - -

SoapServer::SoapServer

-

(PHP 5)

-

SoapServer constructor

-

Description

-

SoapServer(mixed wsdl [, array options])

-It allows creating SoapServer objects in WSDL or nonWSDL mode. In the first -case wsdl must be set to URI of WSDL file. In the second wsdl -must be set to null and uti option must be set. Additional options -allow setting a default SOAP version (soap_version) and actor URI -(actor). - -

Examples

-
-    $server = new SoapServer("some.wsdl");
-
-    $server = new SoapServer("some.wsdl",array('soap_version'=>SOAP_1_2));
-
-    $server = new SoapServer("some.wsdl",array('actor'=>"http://example.org/ts-tests/C"));
-
-    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
-
- - -

SoapServer::addFunction

-

(PHP 5)

-

adds one or several functions those will handle SOAP requests

-

Description

-

void addFunction(mixed functions)

-Exports one or more functions for remote clients. To export one function pass -function name into functions parameter as string. To export several -functions pass an array of function names and to export all functions pass -a special constant SOAP_FUNCTIONS_ALL.
-Functions must receive all input arguments in the same order as defined -in WSDL file (They should not receive any output parameters as arguments) and -return one or more values. To return several values they must return array with -named output parameters. -

Examples

-
-    function func($inputString) {
-        return $inputString;
-    }
-    $server->addFunction("echoString");
-
-    function echoTwoStrings($inputString1, $inputString2) {
-        return array("outputString1"=>$inputString1,"outputString2"=>$inputString2);
-    }
-    $server->addFunction(array("echoString","echoTwoStrings"));
-
-    $server->addFunction(SOAP_FUNCTIONS_ALL);
-
- -
-

SoapServer::setClass

-

(PHP 5)

-

sets class which will handle SOAP requests

-

Description

-

void setClass(string class_name [, ...])

-Exports all methods from specified class. Additional parameters will be passed -to default class constructor during object creation. The object can be maiden -persistent across request for a given PHP session with -SoapServer::setPersistence method. -

Examples

-
-    $server->setClass("foo");
-
-    $server->setClass("foo", $arg1, $arg2);
-
- - -

SoapServer::getFunctions

-

(PHP 5)

-

returns list of defined functions

-

Description

-

array getFunctions()

- -
-

SoapServer::setPersistence

-

(PHP 5)

-

sets persistence mode of SoapServer

-

Description

-

void setPersistence(int mode)

-This function allows saving data between requests in PHP session. It works only -with server that exports functions form class (see -SoapServer:setCalss). -

Examples

-
-    $server->setpersistence(SOAP_PERSISTENCE_SESSION);
-
-    $server->setpersistence(SOAP_PERSISTENCE_REQUEST);
-
- - -

SoapServer::handle

-

(PHP 5)

-

handles a SOAP request

-

Description

-

void handle([string soap_envelope])

-It processes a SOAP request, call necessary functions, and send response back. -It assumes request in input parameter or in global $HTTP_RAW_POST_DATA PHP variable -if the argument is omitted. -

Example

-
-<?php
-    function test($x) {
-        return $x;
-    }
-
-    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
-    $server->addFunction("test");
-    $server->handle();
-?>
-
- - -

SoapParam::SoapParam

-

(PHP 5)

-

SoapParam constructor

-

Description

-

SoapParam(mixed data, string name)

-

-SoapParam is a special low-level class for naming parameters and return values -in nonWSDL mode. It is just a data holder and it has not any special method -except constructor. The constructor takes data to pass or return and -name. It is possible to pass parameter directly as PHP value, but in -this case it will be named as paramN and SOAP Service may not -understand it. -

-

Example

-
-<?php
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/"));
-    $client->SomeFunction(new SoapParam($a,"a"),
-                          new SoapParam($b,"b"),
-                          new SoapParam($c,"c"));
-?>
-
- - -

SoapVar::SoapVar

-

(PHP 5)

-

SoapVar constructor

-

Description

-

SoapVar(mixed data, int encoding [, string type [, string type_ns [, string name [, string name_ns]]]])

-

-SoapVar is a special low-level class for encoding parameters and return values -in nonWSDL mode. It is just a data holder and it has not any special method -except constructor. It is useful when you like to set type property in SOAP -request or response. The constructor takes data to pass or return, -encoding ID to encode it (see XSD_... constants) and as -option type name and namespace and value name and namespace. -

-

Example

-
-<?php
-    class SOAPStruct {
-    	function SOAPStruct($s, $i, $f) {
-    		$this->varString = $s;
-    		$this->varInt = $i;
-    		$this->varFloat = $f;
-    	}
-    }
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/"));
-    $struct = new SOAPStruct('arg',34,325.325);
-    $soapstruct = new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
-    $client->echoStruct(new SoapParam($soapstruct, "inputStruct"));
-?>
-
- - -

SoapHeader::SoapHeader

-

(PHP 5)

-

SoapHeader constructor

-

Description

-

SoapHeader(string name_ns, string name [, mixed data [, bool must_understand [, mixed actor]]])

-

-SoapHeader is a special low-level class for passing or returning SOAP headers. -It is just a data holder and it has not any special method except constructor. -It can be used in SoapClient::__call -method to pass SOAP header or in SOAP header handler to return header in SOAP -response. name_ns and name are namespace and name of the SOAP -header element. data is a SOAP header's content. It can be a PHP value -or SoapVar object. must_understand and actor are values for -mustUnderstand and actor attributes of this SOAP -Header element. -

-

Example

-
-<?php
-    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
-                                        'uri'      => "http://test-uri/"));
-    $client->__call("echoVoid",NULL,NULL,
-                    new SoapHeader('http://soapinterop.org/echoheader/',
-                                   'echoMeStringRequest',
-                                   'hello world'));
-?>
-
- - -

SoapFault::SoapFault

-

(PHP 5)

-

SoapFault constructor

-

Description

-

SoapFault(string faultcode, string faultstring [, string faultactor [, mixed details [, string faultname [, mixed headerfault]]]])

-This class is useful when you like to send SOAP fault response from PHP handler.
-faultcode, faultstring, faultactor and details are standard elements of SOAP Fault;
-faultname is an optional parameter that can be used to select proper fault encoding from WSDL.
-headerfault is an optional parameter that can be used during SOAP header handling to report error in response header. -

Example

-
-<?php
-    function test($x) {
-        return new SoapFault("Server","Some error message");
-    }
-
-    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
-    $server->addFunction("test");
-    $server->handle();
-?>
-
-

It is possible to use PHP exception mechanism to throw SOAP Fault.

-
-<?php
-    function test($x) {
-        throw new SoapFault("Server","Some error message");
-    }
-
-    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
-    $server->addFunction("test");
-    $server->handle();
-?>
-
- - \ No newline at end of file diff --git a/ext/soap/soap.c b/ext/soap/soap.c deleted file mode 100644 index be9a332fe1c76..0000000000000 --- a/ext/soap/soap.c +++ /dev/null @@ -1,4449 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Brad Lafountain | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "php_soap.h" -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) -#include "ext/session/php_session.h" -#endif -#ifdef ZEND_ENGINE_2 -# include "zend_exceptions.h" -#endif - -static int le_sdl = 0; -int le_url = 0; -static int le_service = 0; - -typedef struct _soapHeader { - sdlFunctionPtr function; - zval function_name; - int mustUnderstand; - int num_params; - zval **parameters; - zval retval; - sdlSoapBindingFunctionHeaderPtr hdr; - struct _soapHeader *next; -} soapHeader; - -/* Local functions */ -static void function_to_string(sdlFunctionPtr function, smart_str *buf); -static void type_to_string(sdlTypePtr type, smart_str *buf, int level); - -static void clear_soap_fault(zval *obj TSRMLS_DC); -static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC); -static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name TSRMLS_DC); -static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr TSRMLS_DC); - -static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int); -static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name); -static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr node); - -static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters[], int *version, soapHeader **headers TSRMLS_DC); -static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version TSRMLS_DC); -static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC); -static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent TSRMLS_DC); -static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC); - -static void delete_service(void *service); -static void delete_url(void *handle); - -#ifndef ZEND_ENGINE_2 -static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); -#endif - -static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args); - -#define SOAP_SERVER_BEGIN_CODE() \ - zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ - char* _old_error_code = SOAP_GLOBAL(error_code);\ - zval* _old_error_object = SOAP_GLOBAL(error_object);\ - int _old_soap_version = SOAP_GLOBAL(soap_version);\ - SOAP_GLOBAL(use_soap_error_handler) = 1;\ - SOAP_GLOBAL(error_code) = "Server";\ - SOAP_GLOBAL(error_object) = this_ptr; - -#define SOAP_SERVER_END_CODE() \ - SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ - SOAP_GLOBAL(error_code) = _old_error_code;\ - SOAP_GLOBAL(error_object) = _old_error_object;\ - SOAP_GLOBAL(soap_version) = _old_soap_version; - -#ifdef ZEND_ENGINE_2 -#define SOAP_CLIENT_BEGIN_CODE() \ - zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ - char* _old_error_code = SOAP_GLOBAL(error_code);\ - zval* _old_error_object = SOAP_GLOBAL(error_object);\ - int _old_soap_version = SOAP_GLOBAL(soap_version);\ - zend_bool _old_in_compilation = CG(in_compilation); \ - zend_bool _old_in_execution = EG(in_execution); \ - zend_execute_data *_old_current_execute_data = EG(current_execute_data); \ - int _bailout = 0;\ - SOAP_GLOBAL(use_soap_error_handler) = 1;\ - SOAP_GLOBAL(error_code) = "Client";\ - SOAP_GLOBAL(error_object) = this_ptr;\ - zend_try { - -#define SOAP_CLIENT_END_CODE() \ - } zend_catch {\ - CG(in_compilation) = _old_in_compilation; \ - EG(in_execution) = _old_in_execution; \ - EG(current_execute_data) = _old_current_execute_data; \ - if (EG(exception) == NULL || \ - Z_TYPE_P(EG(exception)) != IS_OBJECT || \ - !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\ - _bailout = 1;\ - }\ - } zend_end_try();\ - SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ - SOAP_GLOBAL(error_code) = _old_error_code;\ - SOAP_GLOBAL(error_object) = _old_error_object;\ - SOAP_GLOBAL(soap_version) = _old_soap_version;\ - if (_bailout) {\ - zend_bailout();\ - } -#else -#define SOAP_CLIENT_BEGIN_CODE() \ - zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ - char* _old_error_code = SOAP_GLOBAL(error_code);\ - zval* _old_error_object = SOAP_GLOBAL(error_object);\ - int _old_soap_version = SOAP_GLOBAL(soap_version);\ - SOAP_GLOBAL(use_soap_error_handler) = 1;\ - SOAP_GLOBAL(error_code) = "Client";\ - SOAP_GLOBAL(error_object) = this_ptr; - -#define SOAP_CLIENT_END_CODE() \ - SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ - SOAP_GLOBAL(error_code) = _old_error_code;\ - SOAP_GLOBAL(error_object) = _old_error_object;\ - SOAP_GLOBAL(soap_version) = _old_soap_version; -#endif - -#define HTTP_RAW_POST_DATA "HTTP_RAW_POST_DATA" - -#define ZERO_PARAM() \ - if (ZEND_NUM_ARGS() != 0) \ - WRONG_PARAM_COUNT; - -#define FETCH_THIS_SDL(ss) \ - { \ - zval **__tmp; \ - if(FIND_SDL_PROPERTY(this_ptr,__tmp) != FAILURE) { \ - FETCH_SDL_RES(ss,__tmp); \ - } else { \ - ss = NULL; \ - } \ - } - -#define FIND_SDL_PROPERTY(ss,tmp) zend_hash_find(Z_OBJPROP_P(ss), "sdl", sizeof("sdl"), (void **)&tmp) -#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp TSRMLS_CC, -1, "sdl", NULL, 1, le_sdl) - -#define FETCH_THIS_SERVICE(ss) \ - { \ - zval **tmp; \ - if (zend_hash_find(Z_OBJPROP_P(this_ptr),"service", sizeof("service"), (void **)&tmp) != FAILURE) { \ - ss = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service); \ - } else { \ - ss = NULL; \ - } \ - } - -static zend_class_entry* soap_class_entry; -static zend_class_entry* soap_server_class_entry; -static zend_class_entry* soap_fault_class_entry; -static zend_class_entry* soap_header_class_entry; -static zend_class_entry* soap_param_class_entry; -zend_class_entry* soap_var_class_entry; - -ZEND_DECLARE_MODULE_GLOBALS(soap) - -static void (*old_error_handler)(int, const char *, const uint, const char*, va_list); - -#ifdef va_copy -#define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \ -{ \ - va_list copy; \ - va_copy(copy, args); \ - old_error_handler(error_num, error_filename, error_lineno, format, copy); \ - va_end(copy); \ -} -#else -#define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \ -{ \ - old_error_handler(error_num, error_filename, error_lineno, format, args); \ -} -#endif - -#define PHP_SOAP_SERVER_CLASSNAME "SoapServer" -#define PHP_SOAP_CLIENT_CLASSNAME "SoapClient" -#define PHP_SOAP_VAR_CLASSNAME "SoapVar" -#define PHP_SOAP_FAULT_CLASSNAME "SoapFault" -#define PHP_SOAP_PARAM_CLASSNAME "SoapParam" -#define PHP_SOAP_HEADER_CLASSNAME "SoapHeader" - -PHP_RINIT_FUNCTION(soap); -PHP_MINIT_FUNCTION(soap); -PHP_MSHUTDOWN_FUNCTION(soap); -PHP_MINFO_FUNCTION(soap); - -#ifndef ZEND_ENGINE_2 -# ifndef PHP_METHOD -# define PHP_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_FN(classname##_##name)) -# define PHP_ME(classname, name, arg_info, flags) ZEND_NAMED_FE(name, ZEND_FN(classname##_##name), arg_info) -# endif - -static char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length) -{ - register unsigned char *str = (unsigned char*)source; - register unsigned char *result = (unsigned char*)dest; - register unsigned char *end = str + length; - - while (str < end) { - *result++ = tolower((int)*str++); - } - *result = *end; - - return dest; -} -#endif - -/* - Registry Functions - TODO: this! -*/ -PHP_FUNCTION(soap_encode_to_xml); -PHP_FUNCTION(soap_encode_to_zval); -PHP_FUNCTION(use_soap_error_handler); -PHP_FUNCTION(is_soap_fault); - - -/* Server Functions */ -PHP_METHOD(SoapServer, SoapServer); -PHP_METHOD(SoapServer, setClass); -PHP_METHOD(SoapServer, addFunction); -PHP_METHOD(SoapServer, getFunctions); -PHP_METHOD(SoapServer, handle); -PHP_METHOD(SoapServer, setPersistence); -PHP_METHOD(SoapServer, fault); -#ifdef HAVE_PHP_DOMXML -PHP_METHOD(PHP_SOAP_SERVER_CLASS, map); -#endif - -/* Client Functions */ -PHP_METHOD(SoapClient, SoapClient); -PHP_METHOD(SoapClient, __call); -PHP_METHOD(SoapClient, __getLastRequest); -PHP_METHOD(SoapClient, __getLastResponse); -PHP_METHOD(SoapClient, __getLastRequestHeaders); -PHP_METHOD(SoapClient, __getLastResponseHeaders); -PHP_METHOD(SoapClient, __getFunctions); -PHP_METHOD(SoapClient, __getTypes); -PHP_METHOD(SoapClient, __doRequest); -PHP_METHOD(SoapClient, __setCookie); -PHP_METHOD(SoapClient, __setLocation); -PHP_METHOD(SoapClient, __setSoapHeaders); - -/* SoapVar Functions */ -PHP_METHOD(SoapVar, SoapVar); - -/* SoapFault Functions */ -PHP_METHOD(SoapFault, SoapFault); -#ifdef ZEND_ENGINE_2 -PHP_METHOD(SoapFault, __toString); -#endif - -/* SoapParam Functions */ -PHP_METHOD(SoapParam, SoapParam); - -/* SoapHeader Functions */ -PHP_METHOD(SoapHeader, SoapHeader); - -#ifdef ZEND_ENGINE_2 -#define SOAP_CTOR(class_name, func_name, arginfo, flags) ZEND_FENTRY(__construct, ZEND_FN(class_name##_##func_name), arginfo, flags) -#else -#define SOAP_CTOR(class_name, func_name, arginfo, flags) PHP_ME(class_name, func_name, arginfo, flags) -#endif - -static zend_function_entry soap_functions[] = { -#ifdef HAVE_PHP_DOMXML - PHP_FE(soap_encode_to_xml, NULL) - PHP_FE(soap_encode_to_zval, NULL) -#endif - PHP_FE(use_soap_error_handler, NULL) - PHP_FE(is_soap_fault, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry soap_fault_functions[] = { - SOAP_CTOR(SoapFault, SoapFault, NULL, 0) -#ifdef ZEND_ENGINE_2 - PHP_ME(SoapFault, __toString, NULL, 0) -#endif - {NULL, NULL, NULL} -}; - -static zend_function_entry soap_server_functions[] = { - SOAP_CTOR(SoapServer, SoapServer, NULL, 0) - PHP_ME(SoapServer, setPersistence, NULL, 0) - PHP_ME(SoapServer, setClass, NULL, 0) - PHP_ME(SoapServer, addFunction, NULL, 0) - PHP_ME(SoapServer, getFunctions, NULL, 0) - PHP_ME(SoapServer, handle, NULL, 0) - PHP_ME(SoapServer, fault, NULL, 0) -#ifdef HAVE_PHP_DOMXML - PHP_ME(SoapServer, map, NULL, 0) -#endif - {NULL, NULL, NULL} -}; - -#ifdef ZEND_ENGINE_2 -ZEND_BEGIN_ARG_INFO(__call_args, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(__soap_call_args, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) -ZEND_END_ARG_INFO() -#else -unsigned char __call_args[] = { 2, BYREF_NONE, BYREF_NONE }; -unsigned char __soap_call_args[] = { 5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; -#endif - -static zend_function_entry soap_client_functions[] = { - SOAP_CTOR(SoapClient, SoapClient, NULL, 0) - PHP_ME(SoapClient, __call, __call_args, 0) -#ifdef ZEND_ENGINE_2 - ZEND_FENTRY(__soapCall, ZEND_FN(SoapClient___call), __soap_call_args, 0) -#else - ZEND_NAMED_FE(__soapCall, ZEND_FN(SoapClient___call), __soap_call_args) -#endif - PHP_ME(SoapClient, __getLastRequest, NULL, 0) - PHP_ME(SoapClient, __getLastResponse, NULL, 0) - PHP_ME(SoapClient, __getLastRequestHeaders, NULL, 0) - PHP_ME(SoapClient, __getLastResponseHeaders, NULL, 0) - PHP_ME(SoapClient, __getFunctions, NULL, 0) - PHP_ME(SoapClient, __getTypes, NULL, 0) - PHP_ME(SoapClient, __doRequest, NULL, 0) - PHP_ME(SoapClient, __setCookie, NULL, 0) - PHP_ME(SoapClient, __setLocation, NULL, 0) - PHP_ME(SoapClient, __setSoapHeaders, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry soap_var_functions[] = { - SOAP_CTOR(SoapVar, SoapVar, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry soap_param_functions[] = { - SOAP_CTOR(SoapParam, SoapParam, NULL, 0) - {NULL, NULL, NULL} -}; - -static zend_function_entry soap_header_functions[] = { - SOAP_CTOR(SoapHeader, SoapHeader, NULL, 0) - {NULL, NULL, NULL} -}; - -zend_module_entry soap_module_entry = { -#ifdef STANDARD_MODULE_HEADER - STANDARD_MODULE_HEADER, -#endif - "soap", - soap_functions, - PHP_MINIT(soap), - PHP_MSHUTDOWN(soap), - PHP_RINIT(soap), - NULL, - PHP_MINFO(soap), -#ifdef STANDARD_MODULE_HEADER - NO_VERSION_YET, -#endif - STANDARD_MODULE_PROPERTIES, -}; - -#ifdef COMPILE_DL_SOAP -ZEND_GET_MODULE(soap) -#endif - -PHP_INI_BEGIN() -STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool, - cache_enabled, zend_soap_globals, soap_globals) -STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateString, - cache_dir, zend_soap_globals, soap_globals) -#ifdef ZEND_ENGINE_2 -STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong, - cache_ttl, zend_soap_globals, soap_globals) -#else -STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateInt, - cache_ttl, zend_soap_globals, soap_globals) -#endif -PHP_INI_END() - -static HashTable defEnc, defEncIndex, defEncNs; - -static void php_soap_prepare_globals() -{ - int i; - encodePtr enc; - - zend_hash_init(&defEnc, 0, NULL, NULL, 1); - zend_hash_init(&defEncIndex, 0, NULL, NULL, 1); - zend_hash_init(&defEncNs, 0, NULL, NULL, 1); - - i = 0; - do { - enc = &defaultEncoding[i]; - - /* If has a ns and a str_type then index it */ - if (defaultEncoding[i].details.type_str) { - if (defaultEncoding[i].details.ns != NULL) { - char *ns_type; - ns_type = emalloc(strlen(defaultEncoding[i].details.ns) + strlen(defaultEncoding[i].details.type_str) + 2); - sprintf(ns_type, "%s:%s", defaultEncoding[i].details.ns, defaultEncoding[i].details.type_str); - zend_hash_add(&defEnc, ns_type, strlen(ns_type) + 1, &enc, sizeof(encodePtr), NULL); - efree(ns_type); - } else { - zend_hash_add(&defEnc, defaultEncoding[i].details.type_str, strlen(defaultEncoding[i].details.type_str) + 1, &enc, sizeof(encodePtr), NULL); - } - } - /* Index everything by number */ - if (!zend_hash_index_exists(&defEncIndex, defaultEncoding[i].details.type)) { - zend_hash_index_update(&defEncIndex, defaultEncoding[i].details.type, &enc, sizeof(encodePtr), NULL); - } - i++; - } while (defaultEncoding[i].details.type != END_KNOWN_TYPES); - - /* hash by namespace */ - zend_hash_add(&defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL); - zend_hash_add(&defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL); - zend_hash_add(&defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL); - zend_hash_add(&defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL); - zend_hash_add(&defEncNs, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL); - zend_hash_add(&defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL); -} - -static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC) -{ - soap_globals->defEnc = defEnc; - soap_globals->defEncIndex = defEncIndex; - soap_globals->defEncNs = defEncNs; - soap_globals->overrides = NULL; - soap_globals->use_soap_error_handler = 0; - soap_globals->error_code = NULL; - soap_globals->error_object = NULL; - soap_globals->sdl = NULL; - soap_globals->soap_version = SOAP_1_1; -} - -PHP_MSHUTDOWN_FUNCTION(soap) -{ - zend_error_cb = old_error_handler; - zend_hash_destroy(&SOAP_GLOBAL(defEnc)); - zend_hash_destroy(&SOAP_GLOBAL(defEncIndex)); - zend_hash_destroy(&SOAP_GLOBAL(defEncNs)); - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(soap) -{ - SOAP_GLOBAL(overrides) = NULL; - SOAP_GLOBAL(use_soap_error_handler) = 0; - SOAP_GLOBAL(error_code) = NULL; - SOAP_GLOBAL(error_object) = NULL; - SOAP_GLOBAL(sdl) = NULL; - SOAP_GLOBAL(soap_version) = SOAP_1_1; - SOAP_GLOBAL(encoding) = NULL; - SOAP_GLOBAL(class_map) = NULL; - return SUCCESS; -} - -PHP_MINIT_FUNCTION(soap) -{ - zend_class_entry ce; - - /* TODO: add ini entry for always use soap errors */ - php_soap_prepare_globals(); - ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL); - REGISTER_INI_ENTRIES(); - -#ifndef ZEND_ENGINE_2 - /* Enable php stream/wrapper support for libxml */ - xmlRegisterDefaultInputCallbacks(); - xmlRegisterInputCallbacks(php_stream_xmlIO_match_wrapper, php_stream_xmlIO_open_wrapper, - php_stream_xmlIO_read, php_stream_xmlIO_close); -#endif - - /* Register SoapClient class */ - /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated. - soap_call_function_handler should be of type struct _zend_function, not (*handle_function_call). - */ -#ifdef ZEND_ENGINE_2 - { - zend_internal_function fe; - - fe.type = ZEND_INTERNAL_FUNCTION; - fe.handler = ZEND_FN(SoapClient___call); - fe.function_name = NULL; - fe.scope = NULL; - fe.fn_flags = 0; - fe.prototype = NULL; - fe.num_args = 2; - fe.arg_info = NULL; - fe.pass_rest_by_reference = 0; - - INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions, - (zend_function *)&fe, NULL, NULL); - soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - } -#else - INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions, soap_call_function_handler, NULL, NULL); - soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC); -#endif - - /* Register SoapVar class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, soap_var_functions); - soap_var_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - /* Register SoapServer class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, soap_server_functions); - soap_server_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - /* Register SoapFault class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions); -#ifdef ZEND_ENGINE_2 - soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#else - soap_fault_class_entry = zend_register_internal_class(&ce TSRMLS_CC); -#endif - - /* Register SoapParam class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions); - soap_param_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, soap_header_functions); - soap_header_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - le_sdl = register_list_destructors(delete_sdl, NULL); - le_url = register_list_destructors(delete_url, NULL); - le_service = register_list_destructors(delete_service, NULL); - - REGISTER_LONG_CONSTANT("SOAP_1_1", SOAP_1_1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_1_2", SOAP_1_2, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_PERSISTENCE_SESSION", SOAP_PERSISTENCE_SESSION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_PERSISTENCE_REQUEST", SOAP_PERSISTENCE_REQUEST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_FUNCTIONS_ALL", SOAP_FUNCTIONS_ALL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_ENCODED", SOAP_ENCODED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_LITERAL", SOAP_LITERAL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_RPC", SOAP_RPC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_DOCUMENT", SOAP_DOCUMENT, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_ACTOR_NEXT", SOAP_ACTOR_NEXT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ACTOR_NONE", SOAP_ACTOR_NONE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ACTOR_UNLIMATERECEIVER", SOAP_ACTOR_UNLIMATERECEIVER, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_ACCEPT", SOAP_COMPRESSION_ACCEPT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_GZIP", SOAP_COMPRESSION_GZIP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_DEFLATE", SOAP_COMPRESSION_DEFLATE, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_BASIC", SOAP_AUTHENTICATION_BASIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_DIGEST", SOAP_AUTHENTICATION_DIGEST, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("UNKNOWN_TYPE", UNKNOWN_TYPE, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("XSD_STRING", XSD_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_BOOLEAN", XSD_BOOLEAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_DECIMAL", XSD_DECIMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_FLOAT", XSD_FLOAT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_DOUBLE", XSD_DOUBLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_DURATION", XSD_DURATION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_DATETIME", XSD_DATETIME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_TIME", XSD_TIME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_DATE", XSD_DATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_GYEARMONTH", XSD_GYEARMONTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_GYEAR", XSD_GYEAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_GMONTHDAY", XSD_GMONTHDAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_GDAY", XSD_GDAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_GMONTH", XSD_GMONTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_HEXBINARY", XSD_HEXBINARY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_BASE64BINARY", XSD_BASE64BINARY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ANYURI", XSD_ANYURI, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_QNAME", XSD_QNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NOTATION", XSD_NOTATION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NORMALIZEDSTRING", XSD_NORMALIZEDSTRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_TOKEN", XSD_TOKEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_LANGUAGE", XSD_LANGUAGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NMTOKEN", XSD_NMTOKEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NAME", XSD_NAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NCNAME", XSD_NCNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ID", XSD_ID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_IDREF", XSD_IDREF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_IDREFS", XSD_IDREFS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ENTITY", XSD_ENTITY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ENTITIES", XSD_ENTITIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_INTEGER", XSD_INTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NONPOSITIVEINTEGER", XSD_NONPOSITIVEINTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NEGATIVEINTEGER", XSD_NEGATIVEINTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_LONG", XSD_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_INT", XSD_INT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_SHORT", XSD_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_BYTE", XSD_BYTE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NONNEGATIVEINTEGER", XSD_NONNEGATIVEINTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_UNSIGNEDLONG", XSD_UNSIGNEDLONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_UNSIGNEDINT", XSD_UNSIGNEDINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_UNSIGNEDSHORT", XSD_UNSIGNEDSHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_UNSIGNEDBYTE", XSD_UNSIGNEDBYTE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_POSITIVEINTEGER", XSD_POSITIVEINTEGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_NMTOKENS", XSD_NMTOKENS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ANYXML", XSD_ANYXML, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("XSD_1999_TIMEINSTANT", XSD_1999_TIMEINSTANT, CONST_CS | CONST_PERSISTENT); - - REGISTER_STRING_CONSTANT("XSD_NAMESPACE", XSD_NAMESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("XSD_1999_NAMESPACE", XSD_1999_NAMESPACE, CONST_CS | CONST_PERSISTENT); - - old_error_handler = zend_error_cb; - zend_error_cb = soap_error_handler; - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(soap) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Soap Client", "enabled"); - php_info_print_table_row(2, "Soap Server", "enabled"); - php_info_print_table_end(); - DISPLAY_INI_ENTRIES(); -} - -#ifdef HAVE_PHP_DOMXML -PHP_FUNCTION(soap_encode_to_xml) -{ - zval *pzval, *ret; - encodePtr enc; - char *name; - int found, name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &name_len, &pzval) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - enc = get_conversion(Z_TYPE_P(pzval)); - ret = php_domobject_new(serialize_zval(pzval, NULL, name, SOAP_ENCODED), &found, NULL TSRMLS_CC); - *return_value = *ret; - zval_copy_ctor(return_value); - zval_ptr_dtor(&ret); -} - -PHP_FUNCTION(soap_encode_to_zval) -{ - zval *dom, **addr, *ret; - xmlNodePtr node; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &dom) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - if (zend_hash_index_find(Z_OBJPROP_P(dom), 1, (void **)&addr) == FAILURE) { - } - - node = (xmlNodePtr)Z_LVAL_PP(addr); - ret = master_to_zval(NULL, node); - *return_value = *ret; -} -#endif - -/* {{{ proto object SoapParam::SoapParam ( mixed data, string name) - SoapParam constructor */ -PHP_METHOD(SoapParam, SoapParam) -{ - zval *data; - char *name; - int name_length; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - if (name_length == 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid parameter name."); - } - -#ifndef ZEND_ENGINE_2 - zval_add_ref(&data); -#endif - add_property_stringl(this_ptr, "param_name", name, name_length, 1); - add_property_zval(this_ptr, "param_data", data); -} -/* }}} */ - - -/* {{{ proto object SoapHeader::SoapHeader ( string namespace, string name [, mixed data [, bool mustUnderstand [, mixed actor]]]) - SoapHeader constructor */ -PHP_METHOD(SoapHeader, SoapHeader) -{ - zval *data = NULL, *actor = NULL; - char *name, *ns; - int name_len, ns_len; - zend_bool must_understand = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - if (ns_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid namespace."); - } - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid header name."); - } - - add_property_stringl(this_ptr, "namespace", ns, ns_len, 1); - add_property_stringl(this_ptr, "name", name, name_len, 1); - if (data) { -#ifndef ZEND_ENGINE_2 - zval_add_ref(&data); -#endif - add_property_zval(this_ptr, "data", data); - } - add_property_bool(this_ptr, "mustUnderstand", must_understand); - if (actor == NULL) { - } else if (Z_TYPE_P(actor) == IS_LONG && - (Z_LVAL_P(actor) == SOAP_ACTOR_NEXT || - Z_LVAL_P(actor) == SOAP_ACTOR_NONE || - Z_LVAL_P(actor) == SOAP_ACTOR_UNLIMATERECEIVER)) { - add_property_long(this_ptr, "actor", Z_LVAL_P(actor)); - } else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) { - add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor), 1); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid actor."); - } -} - -/* {{{ proto object SoapFault::SoapFault ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, mixed headerfault]]]]) - SoapFault constructor */ -PHP_METHOD(SoapFault, SoapFault) -{ - char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *name = NULL, *fault_code_ns = NULL; - int fault_string_len, fault_code_len, fault_actor_len, name_len; - zval *code = NULL, *details = NULL, *headerfault = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z", - &code, - &fault_string, &fault_string_len, - &fault_actor, &fault_actor_len, - &details, &name, &name_len, &headerfault) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - if (Z_TYPE_P(code) == IS_NULL) { - } else if (Z_TYPE_P(code) == IS_STRING) { - fault_code = Z_STRVAL_P(code); - fault_code_len = Z_STRLEN_P(code); - } else if (Z_TYPE_P(code) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(code)) == 2) { - zval **t_ns, **t_code; - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(code)); - zend_hash_get_current_data(Z_ARRVAL_P(code), (void**)&t_ns); - zend_hash_move_forward(Z_ARRVAL_P(code)); - zend_hash_get_current_data(Z_ARRVAL_P(code), (void**)&t_code); - if (Z_TYPE_PP(t_ns) == IS_STRING && Z_TYPE_PP(t_code) == IS_STRING) { - fault_code_ns = Z_STRVAL_PP(t_ns); - fault_code = Z_STRVAL_PP(t_code); - fault_code_len = Z_STRLEN_PP(t_code); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid fault code."); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid fault code."); - } - if (fault_code != NULL && fault_code_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. Invalid fault code."); - } - if (name != NULL && name_len == 0) { - name = NULL; - } - - set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name TSRMLS_CC); - if (headerfault != NULL) { - add_property_zval(this_ptr, "headerfault", headerfault); - } -} -/* }}} */ - - -#ifdef ZEND_ENGINE_2 -/* {{{ proto object SoapFault::SoapFault ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, mixed headerfault]]]]) - SoapFault constructor */ -PHP_METHOD(SoapFault, __toString) -{ - zval *faultcode, *faultstring, *file, *line, *trace; - char *str; - int len; - zend_fcall_info fci; - zval fname; - - faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC); - faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1 TSRMLS_CC); - file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1 TSRMLS_CC); - line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1 TSRMLS_CC); - - ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1, 0); - - fci.size = sizeof(fci); - fci.function_table = &Z_OBJCE_P(getThis())->function_table; - fci.function_name = &fname; - fci.symbol_table = NULL; - fci.object_pp = &getThis(); - fci.retval_ptr_ptr = &trace; - fci.param_count = 0; - fci.params = NULL; - fci.no_separation = 1; - - zend_call_function(&fci, NULL TSRMLS_CC); - - len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s", - Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line), - Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n"); - - zval_ptr_dtor(&trace); - - RETURN_STRINGL(str, len, 0); -} -/* }}} */ -#endif - -/* {{{ proto object SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]]) - SoapVar constructor */ -PHP_METHOD(SoapVar, SoapVar) -{ - zval *data, *type; - char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL; - int stype_len, ns_len, name_len, namens_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - if (Z_TYPE_P(type) == IS_NULL) { - add_property_long(this_ptr, "enc_type", UNKNOWN_TYPE); - } else { - if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) { - add_property_long(this_ptr, "enc_type", Z_LVAL_P(type)); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid type ID"); - } - } - - if (data) { -#ifndef ZEND_ENGINE_2 - zval_add_ref(&data); -#endif - add_property_zval(this_ptr, "enc_value", data); - } - - if (stype && stype_len > 0) { - add_property_stringl(this_ptr, "enc_stype", stype, stype_len, 1); - } - if (ns && ns_len > 0) { - add_property_stringl(this_ptr, "enc_ns", ns, ns_len, 1); - } - if (name && name_len > 0) { - add_property_stringl(this_ptr, "enc_name", name, name_len, 1); - } - if (namens && namens_len > 0) { - add_property_stringl(this_ptr, "enc_namens", namens, namens_len, 1); - } -} -/* }}} */ - - -/* {{{ proto object SoapServer::SoapServer ( mixed wsdl [, array options]) - SoapServer constructor */ -PHP_METHOD(SoapServer, SoapServer) -{ - soapServicePtr service; - zval *wsdl, *options = NULL; - int ret; - int version = SOAP_1_1; - - SOAP_SERVER_BEGIN_CODE(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - if (Z_TYPE_P(wsdl) == IS_STRING) { - } else if (Z_TYPE_P(wsdl) == IS_NULL) { - wsdl = NULL; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - service = emalloc(sizeof(soapService)); - memset(service, 0, sizeof(soapService)); - - if (options != NULL) { - HashTable *ht = Z_ARRVAL_P(options); - zval **tmp; - - if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) == IS_LONG || - (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { - version = Z_LVAL_PP(tmp); - } - } - - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } else if (wsdl == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 'uri' option is required in nonWSDL mode."); - return; - } - - if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - - if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - xmlCharEncodingHandlerPtr encoding; - - encoding = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp)); - if (encoding == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. Invalid 'encoding' option - '%s'.", Z_STRVAL_PP(tmp)); - } else { - service->encoding = encoding; - } - } - - if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_ARRAY) { - zval *ztmp; - - ALLOC_HASHTABLE(service->class_map); - zend_hash_init(service->class_map, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(service->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *)); - } - - } else if (wsdl == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 'uri' option is required in nonWSDL mode."); - } - - service->version = version; - service->type = SOAP_FUNCTIONS; - service->soap_functions.functions_all = FALSE; - service->soap_functions.ft = emalloc(sizeof(HashTable)); - zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); - - if (wsdl) { - service->sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl) TSRMLS_CC); - if (service->uri == NULL) { - if (service->sdl->target_ns) { - service->uri = estrdup(service->sdl->target_ns); - } else { - /*FIXME*/ - service->uri = estrdup("http://unknown-uri/"); - } - } - } - - ret = zend_list_insert(service, le_service); - add_property_resource(this_ptr, "service", ret); - zend_list_addref(ret); - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -#define NULL_OR_STRING(zval) \ - (!zval || Z_TYPE_P(zval) == IS_NULL || Z_TYPE_P(zval) == IS_STRING) - -#define IS_VALID_FUNCTION(zval) \ - (zval && Z_TYPE_P(zval) != IS_NULL) - -#ifdef HAVE_PHP_DOMXML -PHP_FUNCTION(PHP_SOAP_SERVER_CLASS, map) -{ - char *type, *class_name; - zval *to_xml_before = NULL, *to_xml = NULL, *to_xml_after = NULL, - *to_zval_before = NULL, *to_zval = NULL, *to_zval_after = NULL; - int type_len, class_name_len; - char *ns, *ctype; - soapServicePtr service; - - SOAP_SERVER_BEGIN_CODE(); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sz|zzzzz", - &type, &type_len, &to_xml_before, &to_xml, &to_xml_after, &to_zval_before, &to_zval, - &to_zval_after) == SUCCESS && NULL_OR_STRING(to_xml_before) && NULL_OR_STRING(to_xml) && - NULL_OR_STRING(to_xml_after) && NULL_OR_STRING(to_zval_before) && NULL_OR_STRING(to_zval) && - NULL_OR_STRING(to_zval_after)) { - - soapMappingPtr map; - encodePtr enc, new_enc; - smart_str resloved_ns = {0}; - - FETCH_THIS_SERVICE(service); - - new_enc = emalloc(sizeof(encode)); - memset(new_enc, 0, sizeof(encode)); - - ctype = strrchr(type, ':'); - if (ctype) { - smart_str_appendl(&resloved_ns, type, ctype - type); - smart_str_0(&resloved_ns); - ctype++; - } else { - ns = NULL; - } - - if (ns) { - if (zend_hash_find(SOAP_GLOBAL(defEncPrefix), resloved_ns.c, resloved_ns.len + 1, &ns) == SUCCESS) { - enc = get_encoder(service->sdl, ns, ctype); - smart_str_free(&resloved_ns); - smart_str_appendl(&resloved_ns, ns, strlen(ns)); - smart_str_appendc(&resloved_ns, ':'); - smart_str_appendl(&resloved_ns, ctype, strlen(ctype)); - smart_str_0(&resloved_ns); - type = resloved_ns.c; - type_len = resloved_ns.len; - } else { - enc = get_encoder_ex(service->sdl, type); - } - } else { - enc = get_encoder_ex(service->sdl, type); - } - - new_enc->details.type = enc->details.type; - new_enc->details.ns = estrdup(enc->details.ns); - new_enc->details.type_str = estrdup(enc->details.type_str); - new_enc->details.sdl_type = enc->details.sdl_type; - new_enc->to_xml = enc->to_xml; - new_enc->to_zval = enc->to_zval; - new_enc->to_xml_before = enc->to_xml_before; - new_enc->to_zval_before = enc->to_zval_before; - new_enc->to_xml_after = enc->to_xml_after; - new_enc->to_zval_after = enc->to_zval_after; - - map = emalloc(sizeof(soapMapping)); - memset(map, 0, sizeof(soapMapping)); - - map->type = SOAP_MAP_FUNCTION; - if (IS_VALID_FUNCTION(to_xml_before)) { - zval_add_ref(&to_xml_before); - map->map_functions.to_xml_before = to_xml_before; - new_enc->to_xml_before = to_xml_before_user; - } - if (IS_VALID_FUNCTION(to_xml)) { - zval_add_ref(&to_xml); - map->map_functions.to_xml = to_xml; - new_enc->to_xml = to_xml_user; - } - if (IS_VALID_FUNCTION(to_xml_after)) { - zval_add_ref(&to_xml_after); - map->map_functions.to_xml_after = to_xml_after; - new_enc->to_xml_after = to_xml_after_user; - } - if (IS_VALID_FUNCTION(to_zval_before)) { - zval_add_ref(&to_zval_before); - map->map_functions.to_zval_before = to_zval_before; - new_enc->to_zval_before = to_zval_before_user; - } - if (IS_VALID_FUNCTION(to_zval)) { - zval_add_ref(&to_zval); - map->map_functions.to_zval = to_zval; - new_enc->to_zval = to_zval_user; - } - if (IS_VALID_FUNCTION(to_zval_after)) { - zval_add_ref(&to_zval_after); - map->map_functions.to_zval_after = to_zval_after; - new_enc->to_zval_after = to_zval_after_user; - } - - new_enc->details.map = map; - - if (!service->mapping) { - service->mapping = emalloc(sizeof(HashTable)); - zend_hash_init(service->mapping, 0, NULL, delete_encoder, 0); - } - zend_hash_update(service->mapping, type, type_len + 1, &new_enc, sizeof(encodePtr), NULL); - smart_str_free(&resloved_ns); - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &type, &type_len, &class_name, &class_name_len, &type) == SUCCESS) { - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } -} -#endif - - -/* {{{ proto object SoapServer::SoapServer ( mixed wsdl [, array options]) - Sets persistence mode of SoapServer */ -PHP_METHOD(SoapServer, setPersistence) -{ - soapServicePtr service; - long value; - - SOAP_SERVER_BEGIN_CODE(); - - FETCH_THIS_SERVICE(service); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) { - if (service->type == SOAP_CLASS) { - if (value == SOAP_PERSISTENCE_SESSION || - value == SOAP_PERSISTENCE_REQUEST) { - service->soap_class.persistance = value; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set persistence with bogus value (%ld)", value); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed"); - } - } - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -/* {{{ proto void SoapServer::setClass(string class_name [, mixed args]) - Sets class which will handle SOAP requests */ -PHP_METHOD(SoapServer, setClass) -{ - soapServicePtr service; -#ifdef ZEND_ENGINE_2 - zend_class_entry **ce; -#else - zend_class_entry *ce; -#endif - int found, argc; - zval ***argv; - - SOAP_SERVER_BEGIN_CODE(); - - FETCH_THIS_SERVICE(service); - - argc = ZEND_NUM_ARGS(); - argv = safe_emalloc(argc, sizeof(zval **), 0); - - if (argc < 1 || zend_get_parameters_array_ex(argc, argv) == FAILURE) { - efree(argv); - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(argv[0]) == IS_STRING) { -#ifdef ZEND_ENGINE_2 - found = zend_lookup_class(Z_STRVAL_PP(argv[0]), Z_STRLEN_PP(argv[0]), &ce TSRMLS_CC); -#else - char *class_name = estrdup(Z_STRVAL_PP(argv[0])); - found = zend_hash_find(EG(class_table), php_strtolower(class_name, Z_STRLEN_PP(argv[0])), Z_STRLEN_PP(argv[0]) + 1, (void **)&ce); - efree(class_name); -#endif - if (found != FAILURE) { - service->type = SOAP_CLASS; -#ifdef ZEND_ENGINE_2 - service->soap_class.ce = *ce; -#else - service->soap_class.ce = ce; -#endif - service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST; - service->soap_class.argc = argc - 1; - if (service->soap_class.argc > 0) { - int i; - service->soap_class.argv = safe_emalloc(sizeof(zval), service->soap_class.argc, 0); - for (i = 0;i < service->soap_class.argc;i++) { - service->soap_class.argv[i] = *(argv[i + 1]); - zval_add_ref(&service->soap_class.argv[i]); - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set a non existant class (%s)", Z_STRVAL_PP(argv[0])); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "You must pass in a string"); - } - - efree(argv); - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -/* {{{ proto array SoapServer::getFunctions(void) - Returns list of defined functions */ -PHP_METHOD(SoapServer, getFunctions) -{ - soapServicePtr service; - HashTable *ft = NULL; - - SOAP_SERVER_BEGIN_CODE(); - - ZERO_PARAM() - FETCH_THIS_SERVICE(service); - - array_init(return_value); - if (service->type == SOAP_CLASS) { - ft = &service->soap_class.ce->function_table; - } else if (service->soap_functions.functions_all == TRUE) { - ft = EG(function_table); - } else if (service->soap_functions.ft != NULL) { - zval **name; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(service->soap_functions.ft, &pos); - while (zend_hash_get_current_data_ex(service->soap_functions.ft, (void **)&name, &pos) != FAILURE) { - add_next_index_string(return_value, Z_STRVAL_PP(name), 1); - zend_hash_move_forward_ex(service->soap_functions.ft, &pos); - } - } - if (ft != NULL) { - zend_function *f; - HashPosition pos; - zend_hash_internal_pointer_reset_ex(ft, &pos); - while (zend_hash_get_current_data_ex(ft, (void **)&f, &pos) != FAILURE) { - if ((service->type != SOAP_CLASS) || (f->common.fn_flags & ZEND_ACC_PUBLIC)) { - add_next_index_string(return_value, f->common.function_name, 1); - } - zend_hash_move_forward_ex(ft, &pos); - } - } - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -/* {{{ proto void SoapServer::addFunction(mixed functions) - Adds one or several functions those will handle SOAP requests */ -PHP_METHOD(SoapServer, addFunction) -{ - soapServicePtr service; - zval *function_name, *function_copy; - HashPosition pos; - - SOAP_SERVER_BEGIN_CODE(); - - FETCH_THIS_SERVICE(service); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &function_name) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - /* TODO: could use zend_is_callable here */ - - if (function_name->type == IS_ARRAY) { - if (service->type == SOAP_FUNCTIONS) { - zval **tmp_function, *function_copy; - - if (service->soap_functions.ft == NULL) { - service->soap_functions.functions_all = FALSE; - service->soap_functions.ft = emalloc(sizeof(HashTable)); - zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(function_name), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(function_name), (void **)&tmp_function, &pos) != FAILURE) { - char *key; - int key_len; - zend_function *f; - - if (Z_TYPE_PP(tmp_function) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a function that isn't a string"); - } - - key_len = Z_STRLEN_PP(tmp_function); - key = emalloc(key_len + 1); - zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); - - if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function)); - } - - MAKE_STD_ZVAL(function_copy); - ZVAL_STRING(function_copy, f->common.function_name, 1); - zend_hash_update(service->soap_functions.ft, key, key_len+1, &function_copy, sizeof(zval *), NULL); - - efree(key); - zend_hash_move_forward_ex(Z_ARRVAL_P(function_name), &pos); - } - } - } else if (function_name->type == IS_STRING) { - char *key; - int key_len; - zend_function *f; - - key_len = Z_STRLEN_P(function_name); - key = emalloc(key_len + 1); - zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); - - if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name)); - } - if (service->soap_functions.ft == NULL) { - service->soap_functions.functions_all = FALSE; - service->soap_functions.ft = emalloc(sizeof(HashTable)); - zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - MAKE_STD_ZVAL(function_copy); - ZVAL_STRING(function_copy, f->common.function_name, 1); - zend_hash_update(service->soap_functions.ft, key, key_len+1, &function_copy, sizeof(zval *), NULL); - efree(key); - } else if (function_name->type == IS_LONG) { - if (Z_LVAL_P(function_name) == SOAP_FUNCTIONS_ALL) { - if (service->soap_functions.ft != NULL) { - zend_hash_destroy(service->soap_functions.ft); - efree(service->soap_functions.ft); - service->soap_functions.ft = NULL; - } - service->soap_functions.functions_all = TRUE; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid value passed"); - } - } - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -/* {{{ proto void SoapServer::handle ( [string soap_request]) - Handles a SOAP request */ -PHP_METHOD(SoapServer, handle) -{ - int soap_version, old_soap_version; - sdlPtr old_sdl = NULL; - soapServicePtr service; - xmlDocPtr doc_request=NULL, doc_return; - zval function_name, **params, **raw_post, *soap_obj, retval, **server_vars; - char *fn_name, cont_len[30]; - int num_params = 0, size, i, call_status = 0; - xmlChar *buf; - HashTable *function_table; - soapHeader *soap_headers; - sdlFunctionPtr function; - char *arg = NULL; - int arg_len; - xmlCharEncodingHandlerPtr old_encoding; - HashTable *old_class_map; - - SOAP_SERVER_BEGIN_CODE(); - - FETCH_THIS_SERVICE(service); - SOAP_GLOBAL(soap_version) = service->version; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - INIT_ZVAL(retval); - - if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&server_vars) == SUCCESS) { - zval **req_method, **query_string; - if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD", sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) { - if (!strcmp(Z_STRVAL_PP(req_method), "GET") && zend_hash_find(Z_ARRVAL_PP(server_vars), "QUERY_STRING", sizeof("QUERY_STRING"), (void **)&query_string) == SUCCESS) { - if (stricmp(Z_STRVAL_PP(query_string), "wsdl") == 0) { - if (service->sdl) { -/* - char *hdr = emalloc(sizeof("Location: ")+strlen(service->sdl->source)); - strcpy(hdr,"Location: "); - strcat(hdr,service->sdl->source); - sapi_add_header(hdr, sizeof("Location: ")+strlen(service->sdl->source)-1, 1); - efree(hdr); -*/ - zval readfile, readfile_ret, *param; - - INIT_ZVAL(readfile); - INIT_ZVAL(readfile_ret); - MAKE_STD_ZVAL(param); - - sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1); - ZVAL_STRING(param, service->sdl->source, 1); - ZVAL_STRING(&readfile, "readfile", 1); - if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, ¶m TSRMLS_CC) == FAILURE) { - soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL TSRMLS_CC); - } - - zval_ptr_dtor(¶m); - zval_dtor(&readfile); - zval_dtor(&readfile_ret); - - SOAP_SERVER_END_CODE(); - return; - } else { - soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC); -/* - sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1); - PUTS("\nuri); - PUTS("\">\n"); - PUTS(""); -*/ - SOAP_SERVER_END_CODE(); - return; - } - } - } - } - } - - if (php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_ERROR,"ob_start failed"); - } - - if (ZEND_NUM_ARGS() == 0) { - if (zend_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post)!=FAILURE - && ((*raw_post)->type==IS_STRING)) { - zval **server_vars, **encoding; - - if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && - Z_TYPE_PP(server_vars) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && - Z_TYPE_PP(encoding) == IS_STRING) { - zval func; - zval retval; - zval param; - zval *params[1]; - - if ((strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 || - strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0) && - zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) { - ZVAL_STRING(&func, "gzinflate", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post)+10, Z_STRLEN_PP(raw_post)-10, 0); - INIT_PZVAL(params[0]); - } else if (strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 && - zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) { - ZVAL_STRING(&func, "gzuncompress", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post), Z_STRLEN_PP(raw_post), 0); - INIT_PZVAL(params[0]); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR,"Request is compressed with unknown compression '%s'",Z_STRVAL_PP(encoding)); - } - if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS && - Z_TYPE(retval) == IS_STRING) { - doc_request = soap_xmlParseMemory(Z_STRVAL(retval),Z_STRLEN(retval)); - zval_dtor(&retval); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR,"Can't uncompress compressed request"); - } - } else { - doc_request = soap_xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post)); - } - } else { - if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&server_vars) == SUCCESS) { - zval **req_method; - if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD", sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) { - if (!strcmp(Z_STRVAL_PP(req_method), "POST")) { - if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file"); - } - } - } - } - soap_server_fault("Server", "Bad Request. Can't find HTTP_RAW_POST_DATA", NULL, NULL, NULL TSRMLS_CC); - return; - } - } else { - doc_request = soap_xmlParseMemory(arg,arg_len); - } - - if (doc_request == NULL) { - soap_server_fault("Client", "Bad Request", NULL, NULL, NULL TSRMLS_CC); - } - if (xmlGetIntSubset(doc_request) != NULL) { - xmlNodePtr env = get_node(doc_request->children,"Envelope"); - if (env && env->ns) { - if (strcmp(env->ns->href,SOAP_1_1_ENV_NAMESPACE) == 0) { - SOAP_GLOBAL(soap_version) = SOAP_1_1; - } else if (strcmp(env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) { - SOAP_GLOBAL(soap_version) = SOAP_1_2; - } - } - xmlFreeDoc(doc_request); - soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL TSRMLS_CC); - } - - old_sdl = SOAP_GLOBAL(sdl); - SOAP_GLOBAL(sdl) = service->sdl; - old_encoding = SOAP_GLOBAL(encoding); - SOAP_GLOBAL(encoding) = service->encoding; - old_class_map = SOAP_GLOBAL(class_map); - SOAP_GLOBAL(class_map) = service->class_map; - old_soap_version = SOAP_GLOBAL(soap_version); - function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, ¶ms, &soap_version, &soap_headers TSRMLS_CC); - xmlFreeDoc(doc_request); - - if (service->type == SOAP_CLASS) { - soap_obj = NULL; -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - /* If persistent then set soap_obj from from the previous created session (if available) */ - if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) { - zval **tmp_soap; - - if (PS(session_status) != php_session_active && - PS(session_status) != php_session_disabled) { - php_session_start(TSRMLS_C); - } - - /* Find the soap object and assign */ - if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS && - Z_TYPE_PP(tmp_soap) == IS_OBJECT && - Z_OBJCE_PP(tmp_soap) == service->soap_class.ce) { - soap_obj = *tmp_soap; - } - } -#endif - /* If new session or something wierd happned */ - if (soap_obj == NULL) { - zval *tmp_soap; - - MAKE_STD_ZVAL(tmp_soap); - object_init_ex(tmp_soap, service->soap_class.ce); - - /* Call constructor */ -#ifdef ZEND_ENGINE_2 - if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) { - zval c_ret, constructor; - - INIT_ZVAL(c_ret); - INIT_ZVAL(constructor); - - ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME, 1); - if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor"); - } - if (EG(exception)) { - if (Z_TYPE_P(EG(exception)) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { - soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); - } else { - zval_dtor(&constructor); - zval_dtor(&c_ret); - zval_ptr_dtor(&tmp_soap); - php_end_ob_buffer(0, 0 TSRMLS_CC); - goto fail; - } - } - zval_dtor(&constructor); - zval_dtor(&c_ret); - } else { -#else - { -#endif - int class_name_len = strlen(service->soap_class.ce->name); - char *class_name = emalloc(class_name_len+1); - - memcpy(class_name, service->soap_class.ce->name,class_name_len+1); - if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table, php_strtolower(class_name, class_name_len), class_name_len+1)) { - zval c_ret, constructor; - - INIT_ZVAL(c_ret); - INIT_ZVAL(constructor); - - ZVAL_STRING(&constructor, service->soap_class.ce->name, 1); - if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor"); - } -#ifdef ZEND_ENGINE_2 - if (EG(exception)) { - if (Z_TYPE_P(EG(exception)) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { - soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); - } else { - zval_dtor(&constructor); - zval_dtor(&c_ret); - efree(class_name); - zval_ptr_dtor(&tmp_soap); - php_end_ob_buffer(0, 0 TSRMLS_CC); - goto fail; - } - } -#endif - zval_dtor(&constructor); - zval_dtor(&c_ret); - } - efree(class_name); - } -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - /* If session then update session hash with new object */ - if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) { - zval **tmp_soap_pp; - if (zend_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) { - soap_obj = *tmp_soap_pp; - } - } else { - soap_obj = tmp_soap; - } -#else - soap_obj = tmp_soap; -#endif - - } -/* function_table = &(soap_obj->value.obj.ce->function_table);*/ - function_table = &((Z_OBJCE_P(soap_obj))->function_table); - } else { - if (service->soap_functions.functions_all == TRUE) { - function_table = EG(function_table); - } else { - function_table = service->soap_functions.ft; - } - } - - doc_return = NULL; - - /* Process soap headers */ - if (soap_headers != NULL) { - soapHeader *header = soap_headers; - while (header != NULL) { - soapHeader *h = header; - - header = header->next; - if (service->sdl && !h->function && !h->hdr) { - if (h->mustUnderstand) { - soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC); - } else { - continue; - } - } - - fn_name = estrndup(Z_STRVAL(h->function_name),Z_STRLEN(h->function_name)); - if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(h->function_name)), Z_STRLEN(h->function_name) + 1)) { - if (service->type == SOAP_CLASS) { - call_status = call_user_function(NULL, &soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC); - } else { - call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC); - } - if (call_status != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function '%s' call failed", Z_STRVAL(h->function_name)); - } - if (Z_TYPE(h->retval) == IS_OBJECT && - instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry TSRMLS_CC)) { - zval *headerfault = NULL, **tmp; - - if (zend_hash_find(Z_OBJPROP(h->retval), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) != IS_NULL) { - headerfault = *tmp; - } - soap_server_fault_ex(function, &h->retval, h TSRMLS_CC); -#ifdef ZEND_ENGINE_2 - } else if (EG(exception)) { - if (Z_TYPE_P(EG(exception)) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { - zval *headerfault = NULL, **tmp; - - if (zend_hash_find(Z_OBJPROP_P(EG(exception)), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) != IS_NULL) { - headerfault = *tmp; - } - soap_server_fault_ex(function, EG(exception), h TSRMLS_CC); - } else { - efree(fn_name); - if (soap_obj) {zval_ptr_dtor(&soap_obj);} - php_end_ob_buffer(0, 0 TSRMLS_CC); - goto fail; - } -#endif - } - } else if (h->mustUnderstand) { - soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC); - } - efree(fn_name); - } - } - - fn_name = estrndup(Z_STRVAL(function_name),Z_STRLEN(function_name)); - if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(function_name)), Z_STRLEN(function_name) + 1) || - (service->type == SOAP_CLASS && - zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) { - if (service->type == SOAP_CLASS) { - call_status = call_user_function(NULL, &soap_obj, &function_name, &retval, num_params, params TSRMLS_CC); -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) { - zval_ptr_dtor(&soap_obj); - } -#else - zval_ptr_dtor(&soap_obj); -#endif - } else { - call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params TSRMLS_CC); - } - } else { - php_error(E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name)); - } - efree(fn_name); - -#ifdef ZEND_ENGINE_2 - if (EG(exception)) { - if (Z_TYPE_P(EG(exception)) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { - soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); - } else { - if (soap_obj) {zval_ptr_dtor(&soap_obj);} - php_end_ob_buffer(0, 0 TSRMLS_CC); - goto fail; - } - } -#endif - if (call_status == SUCCESS) { - char *response_name; - - if (Z_TYPE(retval) == IS_OBJECT && - instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) { - soap_server_fault_ex(function, &retval, NULL TSRMLS_CC); - } - - if (function && function->responseName) { - response_name = estrdup(function->responseName); - } else { - response_name = emalloc(Z_STRLEN(function_name) + sizeof("Response")); - memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name)); - memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response")); - } - SOAP_GLOBAL(overrides) = service->mapping; - doc_return = serialize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version TSRMLS_CC); - SOAP_GLOBAL(overrides) = NULL; - efree(response_name); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function '%s' call failed", Z_STRVAL(function_name)); - } - - /* Flush buffer */ - php_end_ob_buffer(0, 0 TSRMLS_CC); - - if (doc_return) { - /* xmlDocDumpMemoryEnc(doc_return, &buf, &size, XML_CHAR_ENCODING_UTF8); */ - xmlDocDumpMemory(doc_return, &buf, &size); - - if (size == 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed"); - } - - sprintf(cont_len, "Content-Length: %d", size); - sapi_add_header(cont_len, strlen(cont_len), 1); - if (soap_version == SOAP_1_2) { - sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1); - } else { - sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1); - } - - xmlFreeDoc(doc_return); - php_write(buf, size TSRMLS_CC); - xmlFree(buf); - } else { - sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 Accepted")-1, 1); - sapi_add_header("Content-Length: 0", sizeof("Content-Length: 0")-1, 1); - } - -fail: - SOAP_GLOBAL(soap_version) = old_soap_version; - SOAP_GLOBAL(encoding) = old_encoding; - SOAP_GLOBAL(sdl) = old_sdl; - SOAP_GLOBAL(class_map) = old_class_map; - - /* Free soap headers */ - zval_dtor(&retval); - while (soap_headers != NULL) { - soapHeader *h = soap_headers; - int i; - - soap_headers = soap_headers->next; - i = h->num_params; - while (i > 0) { - zval_ptr_dtor(&h->parameters[--i]); - } - efree(h->parameters); - zval_dtor(&h->function_name); - zval_dtor(&h->retval); - efree(h); - } - - /* Free Memory */ - if (num_params > 0) { - for (i = 0; i < num_params;i++) { - zval_ptr_dtor(¶ms[i]); - } - efree(params); - } - zval_dtor(&function_name); - - SOAP_SERVER_END_CODE(); -} -/* }}} */ - - -/* {{{ proto SoapServer::fault - SoapServer::fault */ -PHP_METHOD(SoapServer, fault) -{ - char *code, *string, *actor=NULL, *name=NULL; - int code_len, string_len, actor_len, name_len; - zval* details = NULL; - - SOAP_SERVER_BEGIN_CODE(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs", - &code, &code_len, &string, &string_len, &actor, &actor_len, &details, - &name, &name_len) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - soap_server_fault(code, string, actor, details, name TSRMLS_CC); - SOAP_SERVER_END_CODE(); -} -/* }}} */ - -static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC) -{ - int soap_version; - xmlChar *buf, cont_len[30]; - int size; - xmlDocPtr doc_return; - - soap_version = SOAP_GLOBAL(soap_version); - - doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version TSRMLS_CC); - - xmlDocDumpMemory(doc_return, &buf, &size); - - /* - Want to return HTTP 500 but apache wants to over write - our fault code with their own handling... Figure this out later - */ - sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1); - sprintf(cont_len,"Content-Length: %d", size); - sapi_add_header(cont_len, strlen(cont_len), 1); - if (soap_version == SOAP_1_2) { - sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1); - } else { - sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1); - } - php_write(buf, size TSRMLS_CC); - - xmlFreeDoc(doc_return); - xmlFree(buf); - zend_clear_exception(TSRMLS_C); - zend_bailout(); -} - -static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name TSRMLS_DC) -{ - zval ret; - - INIT_ZVAL(ret); - - set_soap_fault(&ret, NULL, code, string, actor, details, name TSRMLS_CC); - /* TODO: Which function */ - soap_server_fault_ex(NULL, &ret, NULL TSRMLS_CC); -} - -static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args) -{ - zend_bool _old_in_compilation, _old_in_execution; - zend_execute_data *_old_current_execute_data; - TSRMLS_FETCH(); - - _old_in_compilation = CG(in_compilation); - _old_in_execution = EG(in_execution); - _old_current_execute_data = EG(current_execute_data); - - if (!SOAP_GLOBAL(use_soap_error_handler)) { - call_old_error_handler(error_num, error_filename, error_lineno, format, args); - return; - } - - if (SOAP_GLOBAL(error_object) && - Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_class_entry TSRMLS_CC)) { -#ifdef ZEND_ENGINE_2 - zval **tmp; - - if ((error_num == E_USER_ERROR || - error_num == E_COMPILE_ERROR || - error_num == E_CORE_ERROR || - error_num == E_ERROR || - error_num == E_PARSE) && - (zend_hash_find(Z_OBJPROP_P(SOAP_GLOBAL(error_object)), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS || - Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) { - zval *fault, *exception; - char* code = SOAP_GLOBAL(error_code); - char *buffer; - int buffer_len; - zval outbuf, outbuflen; - va_list argcopy; - int old = PG(display_errors); - - INIT_ZVAL(outbuf); - INIT_ZVAL(outbuflen); -#ifdef va_copy - va_copy(argcopy, args); - buffer_len = vspprintf(&buffer, 0, format, argcopy); - va_end(argcopy); -#else - buffer_len = vspprintf(&buffer, 0, format, args); -#endif - - if (code == NULL) { - code = "Client"; - } - fault = add_soap_fault(SOAP_GLOBAL(error_object), code, buffer, NULL, NULL TSRMLS_CC); - efree(buffer); - MAKE_STD_ZVAL(exception); - *exception = *fault; - zval_copy_ctor(exception); - INIT_PZVAL(exception); - zend_throw_exception_object(exception TSRMLS_CC); - - PG(display_errors) = 0; - zend_try { - call_old_error_handler(error_num, error_filename, error_lineno, format, args); - } zend_catch { - CG(in_compilation) = _old_in_compilation; - EG(in_execution) = _old_in_execution; - EG(current_execute_data) = _old_current_execute_data; - } zend_end_try(); - PG(display_errors) = old; - zend_bailout(); - } else { - call_old_error_handler(error_num, error_filename, error_lineno, format, args); - } -#else - call_old_error_handler(error_num, error_filename, error_lineno, format, args); -#endif - } else { - int old = PG(display_errors); - int fault = 0; - zval fault_obj; - va_list argcopy; - - if (error_num == E_USER_ERROR || - error_num == E_COMPILE_ERROR || - error_num == E_CORE_ERROR || - error_num == E_ERROR || - error_num == E_PARSE) { - - char* code = SOAP_GLOBAL(error_code); - char *buffer; - int buffer_len; - zval *outbuf = NULL; - zval outbuflen; - - INIT_ZVAL(outbuflen); - -#ifdef va_copy - va_copy(argcopy, args); - buffer_len = vspprintf(&buffer, 0, format, argcopy); - va_end(argcopy); -#else - buffer_len = vspprintf(&buffer, 0, format, args); -#endif - - if (code == NULL) { - code = "Server"; - } - /* Get output buffer and send as fault detials */ - if (php_ob_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_LVAL(outbuflen) != 0) { - ALLOC_INIT_ZVAL(outbuf); - php_ob_get_buffer(outbuf TSRMLS_CC); - } - php_end_ob_buffer(0, 0 TSRMLS_CC); - - INIT_ZVAL(fault_obj); - set_soap_fault(&fault_obj, NULL, code, buffer, NULL, outbuf, NULL TSRMLS_CC); - efree(buffer); - fault = 1; - } - - PG(display_errors) = 0; - zend_try { - call_old_error_handler(error_num, error_filename, error_lineno, format, args); - } zend_catch { - CG(in_compilation) = _old_in_compilation; - EG(in_execution) = _old_in_execution; - EG(current_execute_data) = _old_current_execute_data; - } zend_end_try(); - PG(display_errors) = old; - - if (fault) { - soap_server_fault_ex(NULL, &fault_obj, NULL TSRMLS_CC); - } - } -} - -PHP_FUNCTION(use_soap_error_handler) -{ - zend_bool handler = 1; - - ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler)); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &handler) == SUCCESS) { - SOAP_GLOBAL(use_soap_error_handler) = handler; - } -} - -PHP_FUNCTION(is_soap_fault) -{ - zval *fault; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS && - Z_TYPE_P(fault) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry TSRMLS_CC)) { - RETURN_TRUE; - } - RETURN_FALSE -} - -/* SoapClient functions */ - -/* {{{ proto object SoapClient::SoapClient ( mixed wsdl [, array options]) - SoapClient constructor */ -PHP_METHOD(SoapClient, SoapClient) -{ - - zval *wsdl; - zval *options = NULL; - int soap_version = SOAP_1_1; - php_stream_context *context = NULL; - - SOAP_CLIENT_BEGIN_CODE(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - return; - } - - if (Z_TYPE_P(wsdl) == IS_STRING) { - } else if (Z_TYPE_P(wsdl) != IS_NULL ) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "$wsdl must be string or null"); - return; - } else { - wsdl = NULL; - } - if (options != NULL) { - HashTable *ht = Z_ARRVAL_P(options); - zval **tmp; - - if (wsdl == NULL) { - /* Fetching non-WSDL mode options */ - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is requred in nonWSDL mode"); - return; - } - - if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && - (Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) { - add_property_long(this_ptr, "style", Z_LVAL_PP(tmp)); - } - - if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && - (Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) { - add_property_long(this_ptr, "use", Z_LVAL_PP(tmp)); - } - } - - if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_RESOURCE) { - context = php_stream_context_from_zval(*tmp, 1); - } - - if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } else if (wsdl == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is requred in nonWSDL mode"); - return; - } - - if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) == IS_LONG || - (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { - soap_version = Z_LVAL_PP(tmp); - } - } - if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && - Z_LVAL_PP(tmp) == SOAP_AUTHENTICATION_DIGEST) { - add_property_null(this_ptr, "_digest"); - } - } - if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG) { - add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp)); - } - if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - } - } - if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - if (!context) { - context = php_stream_context_alloc(); - } - php_stream_context_set_option(context, "ssl", "local_cert", *tmp); - if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - php_stream_context_set_option(context, "ssl", "passphrase", *tmp); - } - } - if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS && - (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && - Z_LVAL_PP(tmp) == 1) { - add_property_long(this_ptr, "trace", 1); - } -#ifdef ZEND_ENGINE_2 - if (zend_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS && - (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && - Z_LVAL_PP(tmp) == 0) { - add_property_bool(this_ptr, "_exceptions", 0); - } -#endif - if (zend_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && - zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate")) && - zend_hash_exists(EG(function_table), "gzdeflate", sizeof("gzdeflate")) && - zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")) && - zend_hash_exists(EG(function_table), "gzcompress", sizeof("gzcompress")) && - zend_hash_exists(EG(function_table), "gzencode", sizeof("gzencode"))) { - add_property_long(this_ptr, "compression", Z_LVAL_PP(tmp)); - } - if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - xmlCharEncodingHandlerPtr encoding; - - encoding = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp)); - if (encoding == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_PP(tmp)); - } else { - xmlCharEncCloseFunc(encoding); - add_property_stringl(this_ptr, "_encoding", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - } - if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_ARRAY) { - zval *class_map; - - MAKE_STD_ZVAL(class_map); - *class_map = **tmp; - zval_copy_ctor(class_map); -#ifdef ZEND_ENGINE_2 - class_map->refcount--; -#endif - add_property_zval(this_ptr, "_classmap", class_map); - } - - if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) > 0) { - add_property_long(this_ptr, "_connection_timeout", Z_LVAL_PP(tmp)); - } - - if (context) { - add_property_resource(this_ptr, "_stream_context", context->rsrc_id); - } - - } else if (wsdl == NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are requred in nonWSDL mode"); - return; - } - - add_property_long(this_ptr, "_soap_version", soap_version); - - if (wsdl) { - int old_soap_version, ret; - sdlPtr sdl; - - old_soap_version = SOAP_GLOBAL(soap_version); - SOAP_GLOBAL(soap_version) = soap_version; - - sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl) TSRMLS_CC); - ret = zend_list_insert(sdl, le_sdl); - - add_property_resource(this_ptr, "sdl", ret); - zend_list_addref(ret); - - SOAP_GLOBAL(soap_version) = old_soap_version; - } - - SOAP_CLIENT_END_CODE(); -} -/* }}} */ - -static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, zval *response TSRMLS_DC) -{ - int ret = TRUE; - char *buf; - int buf_size; - zval func, param0, param1, param2, param3; - zval *params[4]; - zval **trace; - zval **fault; - - INIT_ZVAL(*response); - - xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size); - if (!buf) { - add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL TSRMLS_CC); - return FALSE; - } - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_request", buf, buf_size, 1); - } - - INIT_ZVAL(func); - ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1,0); - INIT_ZVAL(param0); - params[0] = ¶m0; - ZVAL_STRINGL(params[0], buf, buf_size, 0); - INIT_ZVAL(param1); - params[1] = ¶m1; - if (location == NULL) { - ZVAL_NULL(params[1]); - } else { - ZVAL_STRING(params[1], location, 0); - } - INIT_ZVAL(param2); - params[2] = ¶m2; - if (action == NULL) { - ZVAL_NULL(params[2]); - } else { - ZVAL_STRING(params[2], action, 0); - } - INIT_ZVAL(param3); - params[3] = ¶m3; - ZVAL_LONG(params[3], version); - - if (call_user_function(NULL, &this_ptr, &func, response, 4, params TSRMLS_CC) != SUCCESS) { - add_soap_fault(this_ptr, "Client", "SoapSlient::__doRequest() failed", NULL, NULL TSRMLS_CC); - ret = FALSE; - } else if (Z_TYPE_P(response) != IS_STRING) { - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == FAILURE) { - add_soap_fault(this_ptr, "Client", "SoapSlient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC); - } - ret = FALSE; - } else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1); - } - xmlFree(buf); - if (ret && zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) { - return FALSE; - } - return ret; -} - -static void do_soap_call(zval* this_ptr, - char* function, - int function_len, - int arg_count, - zval** real_args, - zval* return_value, - char* location, - char* soap_action, - char* call_uri, - HashTable* soap_headers, - zval* output_headers - TSRMLS_DC) -{ - zval **tmp; - zval **trace; - sdlPtr sdl = NULL; - sdlPtr old_sdl = NULL; - sdlFunctionPtr fn; - xmlDocPtr request = NULL; - int ret = FALSE; - int soap_version; - zval response; - xmlCharEncodingHandlerPtr old_encoding; - HashTable *old_class_map; - - SOAP_CLIENT_BEGIN_CODE(); - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS - && Z_LVAL_PP(trace) > 0) { - zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response")); - } - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_soap_version", sizeof("_soap_version"), (void **) &tmp) == SUCCESS - && Z_LVAL_PP(tmp) == SOAP_1_2) { - soap_version = SOAP_1_2; - } else { - soap_version = SOAP_1_1; - } - - if (location == NULL) { - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "location", sizeof("location"),(void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - location = Z_STRVAL_PP(tmp); - } - } - - if (FIND_SDL_PROPERTY(this_ptr,tmp) != FAILURE) { - FETCH_SDL_RES(sdl,tmp); - } - - clear_soap_fault(this_ptr TSRMLS_CC); - - SOAP_GLOBAL(soap_version) = soap_version; - old_sdl = SOAP_GLOBAL(sdl); - SOAP_GLOBAL(sdl) = sdl; - old_encoding = SOAP_GLOBAL(encoding); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_encoding", sizeof("_encoding"), (void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - SOAP_GLOBAL(encoding) = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp)); - } else { - SOAP_GLOBAL(encoding) = NULL; - } - old_class_map = SOAP_GLOBAL(class_map); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_classmap", sizeof("_classmap"), (void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_ARRAY) { - SOAP_GLOBAL(class_map) = (*tmp)->value.ht; - } else { - SOAP_GLOBAL(class_map) = NULL; - } - - if (sdl != NULL) { - fn = get_function(sdl, function); - if (fn != NULL) { - sdlBindingPtr binding = fn->binding; - if (location == NULL) { - location = binding->location; - } - if (binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes; - request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC); - ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, &response TSRMLS_CC); - } else { - request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC); - ret = do_request(this_ptr, request, location, NULL, soap_version, &response TSRMLS_CC); - } - - xmlFreeDoc(request); - - if (ret && Z_TYPE(response) == IS_STRING) { - ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC); - } - - zval_dtor(&response); - - } else { - smart_str error = {0}; - smart_str_appends(&error,"Function (\""); - smart_str_appends(&error,function); - smart_str_appends(&error,"\") is not a valid method for this service"); - smart_str_0(&error); - add_soap_fault(this_ptr, "Client", error.c, NULL, NULL TSRMLS_CC); - smart_str_free(&error); - } - } else { - zval **uri; - smart_str action = {0}; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE) { - add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC); - } else if (location == NULL) { - add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC); - } else { - if (call_uri == NULL) { - call_uri = Z_STRVAL_PP(uri); - } - request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC); - - if (soap_action == NULL) { - smart_str_appends(&action, call_uri); - smart_str_appendc(&action, '#'); - smart_str_appends(&action, function); - } else { - smart_str_appends(&action, soap_action); - } - smart_str_0(&action); - - ret = do_request(this_ptr, request, location, action.c, soap_version, &response TSRMLS_CC); - - smart_str_free(&action); - xmlFreeDoc(request); - - if (ret && Z_TYPE(response) == IS_STRING) { - ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC); - } - - zval_dtor(&response); - } - } - - if (!ret) { - zval** fault; - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) { - *return_value = **fault; - zval_copy_ctor(return_value); - } else { - *return_value = *add_soap_fault(this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC); - zval_copy_ctor(return_value); - } - } else { - zval** fault; - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) { - *return_value = **fault; - zval_copy_ctor(return_value); - } - } -#ifdef ZEND_ENGINE_2 - if (Z_TYPE_P(return_value) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) && - (zend_hash_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS || - Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) { - zval *exception; - - MAKE_STD_ZVAL(exception); - *exception = *return_value; - zval_copy_ctor(exception); - INIT_PZVAL(exception); - zend_throw_exception_object(exception TSRMLS_CC); - } -#endif - if (SOAP_GLOBAL(encoding) != NULL) { - xmlCharEncCloseFunc(SOAP_GLOBAL(encoding)); - } - SOAP_GLOBAL(class_map) = old_class_map; - SOAP_GLOBAL(encoding) = old_encoding; - SOAP_GLOBAL(sdl) = old_sdl; - SOAP_CLIENT_END_CODE(); -} - -static void verify_soap_headers_array(HashTable *ht TSRMLS_DC) -{ - zval **tmp; - - zend_hash_internal_pointer_reset(ht); - while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) != IS_OBJECT || - Z_OBJCE_PP(tmp) != soap_header_class_entry) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header"); - } - zend_hash_move_forward(ht); - } -} - - -/* {{{ proto mixed SoapClient::__call ( string function_name [, array arguments [, array options [, array input_headers [, array output_headers]]]]) - Calls a SOAP function */ -PHP_METHOD(SoapClient, __call) -{ - char *function, *location=NULL, *soap_action = NULL, *uri = NULL; - int function_len, i = 0; - HashTable* soap_headers = NULL; - zval *options = NULL; - zval *headers = NULL; - zval *output_headers = NULL; - zval *args; - zval **real_args = NULL; - zval **param; - int arg_count; - zval **tmp; - zend_bool free_soap_headers; - - HashPosition pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|zzz", - &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - - if (options) { - if (Z_TYPE_P(options) == IS_ARRAY) { - HashTable *ht = Z_ARRVAL_P(options); - if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - location = Z_STRVAL_PP(tmp); - } - - if (zend_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - soap_action = Z_STRVAL_PP(tmp); - } - - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - soap_action = Z_STRVAL_PP(tmp); - } - } else if (Z_TYPE_P(options) != IS_NULL) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "first parameter must be string or null"); - } - } - - if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) { - } else if (Z_TYPE_P(headers) == IS_ARRAY) { - soap_headers = Z_ARRVAL_P(headers); - verify_soap_headers_array(soap_headers TSRMLS_CC); - free_soap_headers = 0; - } else if (Z_TYPE_P(headers) == IS_OBJECT && - Z_OBJCE_P(headers) == soap_header_class_entry) { - soap_headers = emalloc(sizeof(HashTable)); - zend_hash_init(soap_headers, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_next_index_insert(soap_headers, &headers, sizeof(zval*), NULL); - ZVAL_ADDREF(headers); - free_soap_headers = 1; - } else{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header"); - } - - /* Add default headers */ - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp)==SUCCESS) { - HashTable *default_headers = Z_ARRVAL_P(*tmp); - if (soap_headers) { - if (!free_soap_headers) { - HashTable *tmp = emalloc(sizeof(HashTable)); - zend_hash_init(tmp, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(tmp, soap_headers, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); - soap_headers = tmp; - free_soap_headers = 1; - } - zend_hash_internal_pointer_reset(default_headers); - while (zend_hash_get_current_data(default_headers, (void**)&tmp) == SUCCESS) { - ZVAL_ADDREF(*tmp); - zend_hash_next_index_insert(soap_headers, tmp, sizeof(zval *), NULL); - zend_hash_move_forward(default_headers); - } - } else { - soap_headers = Z_ARRVAL_P(*tmp); - free_soap_headers = 0; - } - } - - arg_count = zend_hash_num_elements(Z_ARRVAL_P(args)); - - if (arg_count > 0) { - real_args = safe_emalloc(sizeof(zval *), arg_count, 0); - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) ¶m, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) { - /*zval_add_ref(param);*/ - real_args[i++] = *param; - } - } - if (output_headers) { - array_init(output_headers); - } - do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC); - if (arg_count > 0) { - efree(real_args); - } - - if (soap_headers && free_soap_headers) { - zend_hash_destroy(soap_headers); - efree(soap_headers); - } -} -/* }}} */ - - -/* {{{ proto array SoapClient::__getFunctions ( void ) - Returns list of SOAP functions */ -PHP_METHOD(SoapClient, __getFunctions) -{ - sdlPtr sdl; - HashPosition pos; - - FETCH_THIS_SDL(sdl); - - if (sdl) { - smart_str buf = {0}; - sdlFunctionPtr *function; - - array_init(return_value); - zend_hash_internal_pointer_reset_ex(&sdl->functions, &pos); - while (zend_hash_get_current_data_ex(&sdl->functions, (void **)&function, &pos) != FAILURE) { - function_to_string((*function), &buf); - add_next_index_stringl(return_value, buf.c, buf.len, 1); - smart_str_free(&buf); - zend_hash_move_forward_ex(&sdl->functions, &pos); - } - } -} -/* }}} */ - - -/* {{{ proto array SoapClient::__getTypes ( void ) - Returns list of SOAP types */ -PHP_METHOD(SoapClient, __getTypes) -{ - sdlPtr sdl; - HashPosition pos; - - FETCH_THIS_SDL(sdl); - - if (sdl) { - sdlTypePtr *type; - smart_str buf = {0}; - - array_init(return_value); - if (sdl->types) { - zend_hash_internal_pointer_reset_ex(sdl->types, &pos); - while (zend_hash_get_current_data_ex(sdl->types, (void **)&type, &pos) != FAILURE) { - type_to_string((*type), &buf, 0); - add_next_index_stringl(return_value, buf.c, buf.len, 1); - zend_hash_move_forward_ex(sdl->types, &pos); - smart_str_free(&buf); - } - } - } -} -/* }}} */ - - -/* {{{ proto string SoapClient::__getLastRequest ( void ) - Returns last SOAP request */ -PHP_METHOD(SoapClient, __getLastRequest) -{ - zval **tmp; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - RETURN_NULL(); -} -/* }}} */ - - -/* {{{ proto object SoapClient::__getLastResponse ( void ) - Returns last SOAP response */ -PHP_METHOD(SoapClient, __getLastResponse) -{ - zval **tmp; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - RETURN_NULL(); -} -/* }}} */ - - -/* {{{ proto string SoapClient::__getLastRequestHeaders(void) - Returns last SOAP request headers */ -PHP_METHOD(SoapClient, __getLastRequestHeaders) -{ - zval **tmp; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request_headers", sizeof("__last_request_headers"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - RETURN_NULL(); -} -/* }}} */ - - -/* {{{ proto string SoapClient::__getLastResponseHeaders(void) - Returns last SOAP response headers */ -PHP_METHOD(SoapClient, __getLastResponseHeaders) -{ - zval **tmp; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response_headers", sizeof("__last_response_headers"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } - RETURN_NULL(); -} -/* }}} */ - - -/* {{{ proto string SoapClient::__doRequest() - SoapClient::__doRequest() */ -PHP_METHOD(SoapClient, __doRequest) -{ - char *buf, *location, *action; - int buf_size, location_size, action_size; - long version; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl", - &buf, &buf_size, - &location, &location_size, - &action, &action_size, - &version) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - } - if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, - &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC)) { - return_value->type = IS_STRING; - return; - } - RETURN_NULL(); -} -/* }}} */ - -/* {{{ proto void SoapClient::__setCookie(string name [, strung value]) - Sets cookie thet will sent with SOAP request. - The call to this function will effect all folowing calls of SOAP methods. - If value is not specified cookie is removed. */ -PHP_METHOD(SoapClient, __setCookie) -{ - char *name; - char *val = NULL; - int name_len, val_len; - zval **cookies; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", - &name, &name_len, &val, &val_len) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - RETURN_NULL(); - } - - if (val == NULL) { - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) { - zend_hash_del(Z_ARRVAL_PP(cookies), name, name_len+1); - } - } else { - zval *zcookie; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) { - zval *tmp_cookies; - - MAKE_STD_ZVAL(tmp_cookies); - array_init(tmp_cookies); - zend_hash_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), &tmp_cookies, sizeof(zval *), (void **)&cookies); - } - - ALLOC_INIT_ZVAL(zcookie); - array_init(zcookie); - add_index_stringl(zcookie, 0, val, val_len, 1); - add_assoc_zval_ex(*cookies, name, name_len+1, zcookie); - } -} -/* }}} */ - -/* {{{ proto void SoapClient::__setSoapHeaders(array SoapHeaders) - Sets SOAP headers for subsequent calls (replaces any previous - values). - If no value is specified, all of the headers are removed. */ -PHP_METHOD(SoapClient, __setSoapHeaders) -{ - zval *headers; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &headers) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - RETURN_NULL(); - } - - if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) { - zend_hash_del(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")); - } else if (Z_TYPE_P(headers) == IS_ARRAY || Z_TYPE_P(headers) == IS_OBJECT) { - zval *default_headers; - - verify_soap_headers_array(Z_ARRVAL_P(headers) TSRMLS_CC); - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &default_headers)==FAILURE) { - add_property_zval(this_ptr, "__default_headers", headers); - } - } else if (Z_TYPE_P(headers) == IS_OBJECT && - Z_OBJCE_P(headers) == soap_header_class_entry) { - zval *default_headers; - ALLOC_INIT_ZVAL(default_headers); - array_init(default_headers); - add_next_index_zval(default_headers, headers); - add_property_zval(this_ptr, "__default_headers", default_headers); - } else{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header"); - } - RETURN_TRUE; -} -/* }}} */ - - - -/* {{{ proto string SoapClient::__setLocation([string new_location]) - Sets the location option (the endpoint URL that will be touched by the - following SOAP requests). - If new_location is not specified or null then SoapClient will use endpoint - from WSDL file. - The function returns old value of location options. */ -PHP_METHOD(SoapClient, __setLocation) -{ - char *location = NULL; - int location_len; - zval **tmp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", - &location, &location_len) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters"); - RETURN_NULL(); - } - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "location", sizeof("location"),(void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - RETVAL_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - } else { - RETVAL_NULL(); - } - if (location && location_len) { - add_property_stringl(this_ptr, "location", location, location_len, 1); - } else { - zend_hash_del(Z_OBJPROP_P(this_ptr), "location", sizeof("location")); - } -} -/* }}} */ - -#ifndef ZEND_ENGINE_2 -static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) -{ - pval *object = property_reference->object; - zend_overloaded_element *function_name = (zend_overloaded_element *)property_reference->elements_list->tail->data; - char *function = Z_STRVAL(function_name->element); - zend_function *builtin_function; - - /* - Find if the function being called is already defined... - ( IMHO: zend should handle this functionality ) - */ - if (zend_hash_find(&Z_OBJCE_P(this_ptr)->function_table, function, Z_STRLEN(function_name->element) + 1, (void **) &builtin_function) == SUCCESS) { - builtin_function->internal_function.handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); - } else { - int arg_count = ZEND_NUM_ARGS(); - zval **arguments = (zval **) safe_emalloc(sizeof(zval *), arg_count, 0); - zval **soap_headers_p - HashTable *soap_headers; - - zend_get_parameters_array(ht, arg_count, arguments); - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_properties"), (void **) soap_headers_p)==SUCCESS - && Z_TYPE_P(soap_headers_p)==IS_ARRAY) { - soap_headers = Z_ARRVAL_P(soap_headers_p); - } else { - soap_headers = NULL; - } - do_soap_call(this_ptr, function, Z_STRLEN(function_name->element) + 1, arg_count, arguments, return_value, NULL, NULL, NULL, soap_headers, NULL TSRMLS_CC); - efree(arguments); - } - zval_dtor(&function_name->element); -} -#endif - -static void clear_soap_fault(zval *obj TSRMLS_DC) -{ - if (obj != NULL && obj->type == IS_OBJECT) { - zend_hash_del(Z_OBJPROP_P(obj), "__soap_fault", sizeof("__soap_fault")); - } -} - -zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC) -{ - zval *fault; - ALLOC_INIT_ZVAL(fault); - set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC); -#ifdef ZEND_ENGINE_2 - fault->refcount--; -#endif - add_property_zval(obj, "__soap_fault", fault); - return fault; -} - -static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC) -{ - if (Z_TYPE_P(obj) != IS_OBJECT) { - object_init_ex(obj, soap_fault_class_entry); - } - if (fault_string != NULL) { - add_property_string(obj, "faultstring", fault_string, 1); - } - if (fault_code != NULL) { - int soap_version = SOAP_GLOBAL(soap_version); - - if (fault_code_ns) { - add_property_string(obj, "faultcode", fault_code, 1); - add_property_string(obj, "faultcodens", fault_code_ns, 1); - } else { - if (soap_version == SOAP_1_1) { - add_property_string(obj, "faultcode", fault_code, 1); - if (strcmp(fault_code,"Client") == 0 || - strcmp(fault_code,"Server") == 0 || - strcmp(fault_code,"VersionMismatch") == 0 || - strcmp(fault_code,"MustUnderstand") == 0) { - add_property_string(obj, "faultcodens", SOAP_1_1_ENV_NAMESPACE, 1); - } - } else if (soap_version == SOAP_1_2) { - if (strcmp(fault_code,"Client") == 0) { - add_property_string(obj, "faultcode", "Sender", 1); - add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1); - } else if (strcmp(fault_code,"Server") == 0) { - add_property_string(obj, "faultcode", "Receiver", 1); - add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1); - } else if (strcmp(fault_code,"VersionMismatch") == 0 || - strcmp(fault_code,"MustUnderstand") == 0 || - strcmp(fault_code,"DataEncodingUnknown") == 0) { - add_property_string(obj, "faultcode", fault_code, 1); - add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1); - } else { - add_property_string(obj, "faultcode", fault_code, 1); - } - } - } - } - if (fault_actor != NULL) { - add_property_string(obj, "faultactor", fault_actor, 1); - } - if (fault_detail != NULL) { - add_property_zval(obj, "detail", fault_detail); - } - if (name != NULL) { - add_property_string(obj, "_name", name, 1); - } -} - -static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval ***parameters) -{ - int cur_param = 0,num_of_params = 0; - zval **tmp_parameters = NULL; - - if (function != NULL) { - sdlParamPtr *param; - xmlNodePtr val; - int use_names = 0; - - if (function->requestParameters == NULL) { - return; - } - num_of_params = zend_hash_num_elements(function->requestParameters); - zend_hash_internal_pointer_reset(function->requestParameters); - while (zend_hash_get_current_data(function->requestParameters, (void **)¶m) == SUCCESS) { - if (get_node(params, (*param)->paramName) != NULL) { - use_names = 1; - } - zend_hash_move_forward(function->requestParameters); - } - if (use_names) { - tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); - zend_hash_internal_pointer_reset(function->requestParameters); - while (zend_hash_get_current_data(function->requestParameters, (void **)¶m) == SUCCESS) { - val = get_node(params, (*param)->paramName); - if (!val) { - /* TODO: may be "nil" is not OK? */ - MAKE_STD_ZVAL(tmp_parameters[cur_param]); - ZVAL_NULL(tmp_parameters[cur_param]); - } else { - tmp_parameters[cur_param] = master_to_zval((*param)->encode, val); - } - cur_param++; - - zend_hash_move_forward(function->requestParameters); - } - (*parameters) = tmp_parameters; - (*num_params) = num_of_params; - return; - } - } - if (params) { - xmlNodePtr trav; - - num_of_params = 0; - trav = params; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - num_of_params++; - } - trav = trav->next; - } - if (num_of_params > 0) { - tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); - - trav = params; - while (trav != 0 && cur_param < num_of_params) { - if (trav->type == XML_ELEMENT_NODE) { - encodePtr enc; - sdlParamPtr *param = NULL; - if (function != NULL && - zend_hash_index_find(function->requestParameters, cur_param, (void **)¶m) == FAILURE) { - TSRMLS_FETCH(); - soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL TSRMLS_CC); - } - if (param == NULL) { - enc = NULL; - } else { - enc = (*param)->encode; - } - tmp_parameters[cur_param] = master_to_zval(enc, trav); - cur_param++; - } - trav = trav->next; - } - } - } - if (num_of_params > cur_param) { - TSRMLS_FETCH(); - soap_server_fault("Client","Missing parameter", NULL, NULL, NULL TSRMLS_CC); - } - (*parameters) = tmp_parameters; - (*num_params) = num_of_params; -} - -static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_name) -{ - sdlFunctionPtr function; - - function = get_function(sdl, func->name); - if (function && function->binding && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - if (fnb->style == SOAP_DOCUMENT) { - function = NULL; - } - } - if (sdl != NULL && function == NULL) { - function = get_doc_function(sdl, func); - } - - INIT_ZVAL(*function_name); - if (function != NULL) { - ZVAL_STRING(function_name, (char *)function->functionName, 1); - } else { - ZVAL_STRING(function_name, (char *)func->name, 1); - } - - return function; -} - -static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval ***parameters, int *version, soapHeader **headers TSRMLS_DC) -{ - char* envelope_ns = NULL; - xmlNodePtr trav,env,head,body,func; - xmlAttrPtr attr; - sdlFunctionPtr function; - - /* Get element */ - env = NULL; - trav = request->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_1_ENV_NAMESPACE)) { - env = trav; - *version = SOAP_1_1; - envelope_ns = SOAP_1_1_ENV_NAMESPACE; - SOAP_GLOBAL(soap_version) = SOAP_1_1; - } else if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_2_ENV_NAMESPACE)) { - env = trav; - *version = SOAP_1_2; - envelope_ns = SOAP_1_2_ENV_NAMESPACE; - SOAP_GLOBAL(soap_version) = SOAP_1_2; - } else { - soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL TSRMLS_CC); - } - } - trav = trav->next; - } - if (env == NULL) { - soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL TSRMLS_CC); - } - - attr = env->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC); - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (*version == SOAP_1_2) { - soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL TSRMLS_CC); - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC); - } - } - attr = attr->next; - } - - /* Get
element */ - head = NULL; - trav = env->children; - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (trav != NULL && node_is_equal_ex(trav,"Header",envelope_ns)) { - head = trav; - trav = trav->next; - } - - /* Get element */ - body = NULL; - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (trav != NULL && node_is_equal_ex(trav,"Body",envelope_ns)) { - body = trav; - trav = trav->next; - } - while (trav != NULL && trav->type != XML_ELEMENT_NODE) { - trav = trav->next; - } - if (body == NULL) { - soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL TSRMLS_CC); - } - attr = body->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - if (*version == SOAP_1_2) { - soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC); - } - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (*version == SOAP_1_2) { - soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL TSRMLS_CC); - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC); - } - } - attr = attr->next; - } - - if (trav != NULL && *version == SOAP_1_2) { - soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL TSRMLS_CC); - } - - func = NULL; - trav = body->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { -/* - if (func != NULL) { - soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL TSRMLS_CC); - } -*/ - func = trav; - break; /* FIXME: the rest of body is ignored */ - } - trav = trav->next; - } - if (func == NULL) { - function = get_doc_function(sdl, NULL); - if (function != NULL) { - INIT_ZVAL(*function_name); - ZVAL_STRING(function_name, (char *)function->functionName, 1); - } else { - soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL TSRMLS_CC); - } - } else { - if (*version == SOAP_1_1) { - attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE); - if (attr && strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC); - } - } else { - attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE); - if (attr && strcmp(attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) { - soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC); - } - } - function = find_function(sdl, func, function_name); - if (sdl != NULL && function == NULL) { - if (*version == SOAP_1_2) { - soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL TSRMLS_CC); - } else { - php_error(E_ERROR, "Procedure '%s' not present", func->name); - } - } - } - - *headers = NULL; - if (head) { - soapHeader *h, *last = NULL; - - attr = head->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC); - } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) { - if (*version == SOAP_1_2) { - soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL TSRMLS_CC); - } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC); - } - } - attr = attr->next; - } - trav = head->children; - while (trav != NULL) { - if (trav->type == XML_ELEMENT_NODE) { - xmlNodePtr hdr_func = trav; - xmlAttrPtr attr; - int mustUnderstand = 0; - - if (*version == SOAP_1_1) { - attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE); - if (attr && strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) { - soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC); - } - attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns); - if (attr != NULL) { - if (strcmp(attr->children->content,SOAP_1_1_ACTOR_NEXT) != 0 && - (actor == NULL || strcmp(attr->children->content,actor) != 0)) { - goto ignore_header; - } - } - } else if (*version == SOAP_1_2) { - attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE); - if (attr && strcmp(attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) { - soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC); - } - attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns); - if (attr != NULL) { - if (strcmp(attr->children->content,SOAP_1_2_ACTOR_UNLIMATERECEIVER) != 0 && - strcmp(attr->children->content,SOAP_1_2_ACTOR_NEXT) != 0 && - (actor == NULL || strcmp(attr->children->content,actor) != 0)) { - goto ignore_header; - } - } - } - attr = get_attribute_ex(hdr_func->properties,"mustUnderstand",envelope_ns); - if (attr) { - if (strcmp(attr->children->content,"1") == 0 || - strcmp(attr->children->content,"true") == 0) { - mustUnderstand = 1; - } else if (strcmp(attr->children->content,"0") == 0 || - strcmp(attr->children->content,"false") == 0) { - mustUnderstand = 0; - } else { - soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC); - } - } - h = emalloc(sizeof(soapHeader)); - memset(h, 0, sizeof(soapHeader)); - h->mustUnderstand = mustUnderstand; - h->function = find_function(sdl, hdr_func, &h->function_name); - if (!h->function && sdl && function && function->binding && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionHeaderPtr *hdr; - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - if (fnb->input.headers) { - smart_str key = {0}; - - if (hdr_func->ns) { - smart_str_appends(&key, hdr_func->ns->href); - smart_str_appendc(&key, ':'); - } - smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRLEN(h->function_name)); - smart_str_0(&key); - if (zend_hash_find(fnb->input.headers, key.c, key.len+1, (void**)&hdr) == SUCCESS) { - h->hdr = *hdr; - } - smart_str_free(&key); - } - } - if (h->hdr) { - h->num_params = 1; - h->parameters = emalloc(sizeof(zval*)); - h->parameters[0] = master_to_zval(h->hdr->encode, hdr_func); - } else { - if (h->function && h->function->binding && h->function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)h->function->bindingAttributes; - if (fnb->style == SOAP_RPC) { - hdr_func = hdr_func->children; - } - } - deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters); - } - INIT_ZVAL(h->retval); - if (last == NULL) { - *headers = h; - } else { - last->next = h; - } - last = h; - } -ignore_header: - trav = trav->next; - } - } - - if (function && function->binding && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - if (fnb->style == SOAP_RPC) { - func = func->children; - } - } else { - func = func->children; - } - deserialize_parameters(func, function, num_params, parameters); - return function; -} - -static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main TSRMLS_DC) -{ - xmlNodePtr method = NULL, param; - sdlParamPtr parameter = NULL; - int param_count; - int style, use; - xmlNsPtr ns = NULL; - - if (function != NULL && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - - style = fnb->style; - use = fnb->output.use; - if (style == SOAP_RPC) { - ns = encode_add_ns(body, fnb->output.ns); - if (function->responseName) { - method = xmlNewChild(body, ns, function->responseName, NULL); - } else if (function->responseParameters) { - method = xmlNewChild(body, ns, function->functionName, NULL); - } - } - } else { - style = main?SOAP_RPC:SOAP_DOCUMENT; - use = main?SOAP_ENCODED:SOAP_LITERAL; - if (style == SOAP_RPC) { - ns = encode_add_ns(body, uri); - method = xmlNewChild(body, ns, function_name, NULL); - } - } - - if (function != NULL) { - if (function->responseParameters) { - param_count = zend_hash_num_elements(function->responseParameters); - } else { - param_count = 0; - } - } else { - param_count = 1; - } - - if (param_count == 1) { - parameter = get_param(function, NULL, 0, TRUE); - - if (style == SOAP_RPC) { - xmlNode *rpc_result; - if (main && version == SOAP_1_2) { - xmlNs *rpc_ns = xmlNewNs(body, RPC_SOAP12_NAMESPACE, RPC_SOAP12_NS_PREFIX); - rpc_result = xmlNewChild(method, rpc_ns, "result", NULL); - param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC); - xmlNodeSetContent(rpc_result,param->name); - } else { - param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC); - } - } else { - param = serialize_parameter(parameter, ret, 0, "return", use, body TSRMLS_CC); - if (function && function->binding->bindingType == BINDING_SOAP) { - if (parameter && parameter->element) { - ns = encode_add_ns(param, parameter->element->namens); - xmlNodeSetName(param, parameter->element->name); - xmlSetNs(param, ns); - } - } else if (strcmp(param->name,"return") == 0) { - ns = encode_add_ns(param, uri); - xmlNodeSetName(param, function_name); - xmlSetNs(param, ns); - } - } - } else if (param_count > 1 && Z_TYPE_P(ret) == IS_ARRAY) { - HashPosition pos; - zval **data; - int i = 0; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(ret), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(ret), (void **)&data, &pos) != FAILURE) { - char *param_name = NULL; - int param_name_len; - long param_index = i; - - zend_hash_get_current_key_ex(Z_ARRVAL_P(ret), ¶m_name, ¶m_name_len, ¶m_index, 0, &pos); - parameter = get_param(function, param_name, param_index, TRUE); - if (style == SOAP_RPC) { - param = serialize_parameter(parameter, *data, i, param_name, use, method TSRMLS_CC); - } else { - param = serialize_parameter(parameter, *data, i, param_name, use, body TSRMLS_CC); - if (function && function->binding->bindingType == BINDING_SOAP) { - if (parameter && parameter->element) { - ns = encode_add_ns(param, parameter->element->namens); - xmlNodeSetName(param, parameter->element->name); - xmlSetNs(param, ns); - } - } - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(ret), &pos); - i++; - } - } - if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) { - xmlSetNsProp(method, body->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE); - } - return use; -} - -static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version TSRMLS_DC) -{ - xmlDocPtr doc; - xmlNodePtr envelope = NULL, body, param; - xmlNsPtr ns = NULL; - int use = SOAP_LITERAL; - xmlNodePtr head = NULL; - - encode_reset_ns(); - - doc = xmlNewDoc("1.0"); - doc->charset = XML_CHAR_ENCODING_UTF8; - doc->encoding = xmlStrdup((xmlChar*)"UTF-8"); - - if (version == SOAP_1_1) { - envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL); - ns = xmlNewNs(envelope, SOAP_1_1_ENV_NAMESPACE, SOAP_1_1_ENV_NS_PREFIX); - xmlSetNs(envelope,ns); - } else if (version == SOAP_1_2) { - envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL); - ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX); - xmlSetNs(envelope,ns); - } else { - soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC); - } - xmlDocSetRootElement(doc, envelope); - - if (Z_TYPE_P(ret) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry TSRMLS_CC)) { - char *detail_name; - HashTable* prop; - zval **tmp; - sdlFaultPtr fault = NULL; - char *fault_ns = NULL; - - prop = Z_OBJPROP_P(ret); - - if (headers && - zend_hash_find(prop, "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS) { - xmlNodePtr head; - encodePtr hdr_enc = NULL; - int hdr_use = SOAP_LITERAL; - zval *hdr_ret = *tmp; - char *hdr_ns = headers->hdr?headers->hdr->ns:NULL; - char *hdr_name = Z_STRVAL(headers->function_name); - - head = xmlNewChild(envelope, ns, "Header", NULL); - if (Z_TYPE_P(hdr_ret) == IS_OBJECT && - Z_OBJCE_P(hdr_ret) == soap_header_class_entry) { - HashTable* ht = Z_OBJPROP_P(hdr_ret); - zval **tmp; - sdlSoapBindingFunctionHeaderPtr *hdr; - smart_str key = {0}; - - if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - smart_str_appendc(&key, ':'); - hdr_ns = Z_STRVAL_PP(tmp); - } - if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - hdr_name = Z_STRVAL_PP(tmp); - } - smart_str_0(&key); - if (headers->hdr && headers->hdr->headerfaults && - zend_hash_find(headers->hdr->headerfaults, key.c, key.len+1, (void**)&hdr) == SUCCESS) { - hdr_enc = (*hdr)->encode; - hdr_use = (*hdr)->use; - } - smart_str_free(&key); - if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) { - hdr_ret = *tmp; - } else { - hdr_ret = NULL; - } - } - - if (headers->function) { - if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { - use = SOAP_ENCODED; - } - } else { - xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head); - if (hdr_name) { - xmlNodeSetName(xmlHdr,hdr_name); - } - if (hdr_ns) { - xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); - xmlSetNs(xmlHdr, nsptr); - } - } - } - - body = xmlNewChild(envelope, ns, "Body", NULL); - param = xmlNewChild(body, ns, "Fault", NULL); - - if (zend_hash_find(prop, "faultcodens", sizeof("faultcodens"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - fault_ns = Z_STRVAL_PP(tmp); - } - use = SOAP_LITERAL; - if (zend_hash_find(prop, "_name", sizeof("_name"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - sdlFaultPtr *tmp_fault; - if (function && function->faults && - zend_hash_find(function->faults, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)+1, (void**)&tmp_fault) == SUCCESS) { - fault = *tmp_fault; - if (function->binding && - function->binding->bindingType == BINDING_SOAP && - fault->bindingAttributes) { - sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes; - use = fb->use; - if (fault_ns == NULL) { - fault_ns = fb->ns; - } - } - } - } else if (function && function->faults && - zend_hash_num_elements(function->faults) == 1) { - - zend_hash_internal_pointer_reset(function->faults); - zend_hash_get_current_data(function->faults, (void**)&fault); - fault = *(sdlFaultPtr*)fault; - if (function->binding && - function->binding->bindingType == BINDING_SOAP && - fault->bindingAttributes) { - sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes; - use = fb->use; - if (fault_ns == NULL) { - fault_ns = fb->ns; - } - } - } - - if (fault_ns == NULL && - fault && - fault->details && - zend_hash_num_elements(fault->details) == 1) { - sdlParamPtr sparam; - - zend_hash_internal_pointer_reset(fault->details); - zend_hash_get_current_data(fault->details, (void**)&sparam); - sparam = *(sdlParamPtr*)sparam; - if (sparam->element) { - fault_ns = sparam->element->namens; - } - } - - if (version == SOAP_1_1) { - if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - int new_len; - xmlNodePtr node = xmlNewNode(NULL, "faultcode"); - char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - xmlAddChild(param, node); - if (fault_ns) { - xmlNsPtr nsptr = encode_add_ns(node, fault_ns); - xmlNodeSetContent(node, xmlBuildQName(str, nsptr->prefix, NULL, 0)); - } else { - xmlNodeSetContentLen(node, str, new_len); - } - efree(str); - } - if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) { - int new_len; - xmlNodePtr node = xmlNewNode(NULL, "faultstring"); - char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - xmlAddChild(param, node); - xmlNodeSetContentLen(node, str, new_len); - efree(str); - } - if (zend_hash_find(prop, "faultactor", sizeof("faultactor"), (void**)&tmp) == SUCCESS) { - int new_len; - xmlNodePtr node = xmlNewNode(NULL, "faultactor"); - char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - xmlAddChild(param, node); - xmlNodeSetContentLen(node, str, new_len); - efree(str); - } - detail_name = "detail"; - } else { - if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - int new_len; - xmlNodePtr node = xmlNewChild(param, ns, "Code", NULL); - char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - node = xmlNewChild(node, ns, "Value", NULL); - if (fault_ns) { - xmlNsPtr nsptr = encode_add_ns(node, fault_ns); - xmlNodeSetContent(node, xmlBuildQName(str, nsptr->prefix, NULL, 0)); - } else { - xmlNodeSetContentLen(node, str, new_len); - } - efree(str); - } - if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) { - int new_len; - xmlNodePtr node = xmlNewChild(param, ns, "Reason", NULL); - char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); - node = xmlNewChild(node, ns, "Text", NULL); - xmlNodeSetContentLen(node, str, new_len); - efree(str); - } - detail_name = SOAP_1_2_ENV_NS_PREFIX":Detail"; - } - if (fault && fault->details && zend_hash_num_elements(fault->details) == 1) { - xmlNodePtr node; - zval *detail = NULL; - sdlParamPtr sparam; - xmlNodePtr x; - - if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) != IS_NULL) { - detail = *tmp; - } - node = xmlNewNode(NULL, detail_name); - xmlAddChild(param, node); - - zend_hash_internal_pointer_reset(fault->details); - zend_hash_get_current_data(fault->details, (void**)&sparam); - sparam = *(sdlParamPtr*)sparam; - - if (detail && - Z_TYPE_P(detail) == IS_OBJECT && - sparam->element && - zend_hash_num_elements(Z_OBJPROP_P(detail)) == 1 && - zend_hash_find(Z_OBJPROP_P(detail), sparam->element->name, strlen(sparam->element->name)+1, (void**)&tmp) == SUCCESS) { - detail = *tmp; - } - - x = serialize_parameter(sparam, detail, 1, NULL, use, node TSRMLS_CC); - - if (function && - function->binding && - function->binding->bindingType == BINDING_SOAP && - function->bindingAttributes) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - if (fnb->style == SOAP_RPC && !sparam->element) { - if (fault->bindingAttributes) { - sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes; - if (fb->ns) { - xmlNsPtr ns = encode_add_ns(x, fb->ns); - xmlSetNs(x, ns); - } - } - } else { - if (sparam->element) { - xmlNsPtr ns = encode_add_ns(x, sparam->element->namens); - xmlNodeSetName(x, sparam->element->name); - xmlSetNs(x, ns); - } - } - } - if (use == SOAP_ENCODED && version == SOAP_1_2) { - xmlSetNsProp(x, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE); - } - } else if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) != IS_NULL) { - serialize_zval(*tmp, NULL, detail_name, use, param TSRMLS_CC); - } - } else { - - if (headers) { - soapHeader *h; - - head = xmlNewChild(envelope, ns, "Header", NULL); - h = headers; - while (h != NULL) { - if (Z_TYPE(h->retval) != IS_NULL) { - encodePtr hdr_enc = NULL; - int hdr_use = SOAP_LITERAL; - zval *hdr_ret = &h->retval; - char *hdr_ns = h->hdr?h->hdr->ns:NULL; - char *hdr_name = Z_STRVAL(h->function_name); - - - if (Z_TYPE(h->retval) == IS_OBJECT && - Z_OBJCE(h->retval) == soap_header_class_entry) { - HashTable* ht = Z_OBJPROP(h->retval); - zval **tmp; - sdlSoapBindingFunctionHeaderPtr *hdr; - smart_str key = {0}; - - if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - smart_str_appendc(&key, ':'); - hdr_ns = Z_STRVAL_PP(tmp); - } - if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - hdr_name = Z_STRVAL_PP(tmp); - } - smart_str_0(&key); - if (function && function->binding && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - - if (fnb->output.headers && - zend_hash_find(fnb->output.headers, key.c, key.len+1, (void**)&hdr) == SUCCESS) { - hdr_enc = (*hdr)->encode; - hdr_use = (*hdr)->use; - } - } - smart_str_free(&key); - if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) { - hdr_ret = *tmp; - } else { - hdr_ret = NULL; - } - } - - if (h->function) { - if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { - use = SOAP_ENCODED; - } - } else { - xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head); - if (hdr_name) { - xmlNodeSetName(xmlHdr,hdr_name); - } - if (hdr_ns) { - xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); - xmlSetNs(xmlHdr, nsptr); - } - } - } - h = h->next; - } - - if (head->children == NULL) { - xmlUnlinkNode(head); - xmlFreeNode(head); - } - } - - body = xmlNewChild(envelope, ns, "Body", NULL); - - if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) { - use = SOAP_ENCODED; - } - - } - - if (use == SOAP_ENCODED) { - xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX); - xmlNewNs(envelope, XSI_NAMESPACE, XSI_NS_PREFIX); - if (version == SOAP_1_1) { - xmlNewNs(envelope, SOAP_1_1_ENC_NAMESPACE, SOAP_1_1_ENC_NS_PREFIX); - xmlSetNsProp(envelope, envelope->ns, "encodingStyle", SOAP_1_1_ENC_NAMESPACE); - } else if (version == SOAP_1_2) { - xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX); - } - } - - if (function && function->responseName == NULL && - body->children == NULL && head == NULL) { - xmlFreeDoc(doc); - return NULL; - } - return doc; -} - -static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC) -{ - xmlDoc *doc; - xmlNodePtr envelope = NULL, body, method = NULL, head = NULL; - xmlNsPtr ns = NULL; - zval **zstyle, **zuse; - int i, style, use; - HashTable *hdrs = NULL; - - encode_reset_ns(); - - doc = xmlNewDoc("1.0"); - doc->encoding = xmlStrdup((xmlChar*)"UTF-8"); - doc->charset = XML_CHAR_ENCODING_UTF8; - if (version == SOAP_1_1) { - envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL); - ns = xmlNewNs(envelope, SOAP_1_1_ENV_NAMESPACE, SOAP_1_1_ENV_NS_PREFIX); - xmlSetNs(envelope,ns); - } else if (version == SOAP_1_2) { - envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL); - ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX); - xmlSetNs(envelope,ns); - } else { - soap_error0(E_ERROR, "Unknown SOAP version"); - } - xmlDocSetRootElement(doc, envelope); - - if (soap_headers) { - head = xmlNewChild(envelope, ns, "Header", NULL); - } - - body = xmlNewChild(envelope, ns, "Body", NULL); - - if (function && function->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; - - hdrs = fnb->input.headers; - style = fnb->style; - /*FIXME: how to pass method name if style is SOAP_DOCUMENT */ - /*style = SOAP_RPC;*/ - use = fnb->input.use; - if (style == SOAP_RPC) { - ns = encode_add_ns(body, fnb->input.ns); - if (function->requestName) { - method = xmlNewChild(body, ns, function->requestName, NULL); - } else { - method = xmlNewChild(body, ns, function->functionName, NULL); - } - } - } else { - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "style", sizeof("style"), (void **)&zstyle) == SUCCESS) { - style = Z_LVAL_PP(zstyle); - } else { - style = SOAP_RPC; - } - /*FIXME: how to pass method name if style is SOAP_DOCUMENT */ - /*style = SOAP_RPC;*/ - if (style == SOAP_RPC) { - ns = encode_add_ns(body, uri); - method = xmlNewChild(body, ns, function_name, NULL); - } - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS && - Z_LVAL_PP(zuse) == SOAP_LITERAL) { - use = SOAP_LITERAL; - } else { - use = SOAP_ENCODED; - } - } - - for (i = 0;i < arg_count;i++) { - xmlNodePtr param; - sdlParamPtr parameter = get_param(function, NULL, i, FALSE); - - if (style == SOAP_RPC) { - param = serialize_parameter(parameter, arguments[i], i, NULL, use, method TSRMLS_CC); - } else if (style == SOAP_DOCUMENT) { - param = serialize_parameter(parameter, arguments[i], i, NULL, use, body TSRMLS_CC); - if (function && function->binding->bindingType == BINDING_SOAP) { - if (parameter && parameter->element) { - ns = encode_add_ns(param, parameter->element->namens); - xmlNodeSetName(param, parameter->element->name); - xmlSetNs(param, ns); - } - } - } - } - - if (function && function->requestParameters) { - int n = zend_hash_num_elements(function->requestParameters); - - if (n > arg_count) { - for (i = arg_count; i < n; i++) { - xmlNodePtr param; - sdlParamPtr parameter = get_param(function, NULL, i, FALSE); - - if (style == SOAP_RPC) { - param = serialize_parameter(parameter, NULL, i, NULL, use, method TSRMLS_CC); - } else if (style == SOAP_DOCUMENT) { - param = serialize_parameter(parameter, NULL, i, NULL, use, body TSRMLS_CC); - if (function && function->binding->bindingType == BINDING_SOAP) { - if (parameter && parameter->element) { - ns = encode_add_ns(param, parameter->element->namens); - xmlNodeSetName(param, parameter->element->name); - xmlSetNs(param, ns); - } - } - } - } - } - } - - if (head) { - zval** header; - - zend_hash_internal_pointer_reset(soap_headers); - while (zend_hash_get_current_data(soap_headers,(void**)&header) == SUCCESS) { - HashTable *ht = Z_OBJPROP_PP(header); - zval **name, **ns, **tmp; - - if (zend_hash_find(ht, "name", sizeof("name"), (void**)&name) == SUCCESS && - Z_TYPE_PP(name) == IS_STRING && - zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&ns) == SUCCESS && - Z_TYPE_PP(ns) == IS_STRING) { - xmlNodePtr h; - xmlNsPtr nsptr; - int hdr_use = SOAP_LITERAL; - encodePtr enc = NULL; - - if (hdrs) { - smart_str key = {0}; - sdlSoapBindingFunctionHeaderPtr *hdr; - - smart_str_appendl(&key, Z_STRVAL_PP(ns), Z_STRLEN_PP(ns)); - smart_str_appendc(&key, ':'); - smart_str_appendl(&key, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - smart_str_0(&key); - if (zend_hash_find(hdrs, key.c, key.len+1,(void**)&hdr) == SUCCESS) { - hdr_use = (*hdr)->use; - enc = (*hdr)->encode; - if (hdr_use == SOAP_ENCODED) { - use = SOAP_ENCODED; - } - } - smart_str_free(&key); - } - - if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) { - h = master_to_xml(enc, *tmp, hdr_use, head); - xmlNodeSetName(h, Z_STRVAL_PP(name)); - } else { - h = xmlNewNode(NULL, Z_STRVAL_PP(name)); - xmlAddChild(head,h); - } - nsptr = encode_add_ns(h,Z_STRVAL_PP(ns)); - xmlSetNs(h, nsptr); - - if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { - if (version == SOAP_1_1) { - xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":mustUnderstand","1"); - } else { - xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":mustUnderstand","true"); - } - } - if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) == IS_STRING) { - if (version == SOAP_1_1) { - xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":actor",Z_STRVAL_PP(tmp)); - } else { - xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",Z_STRVAL_PP(tmp)); - } - } else if (Z_TYPE_PP(tmp) == IS_LONG) { - if (version == SOAP_1_1) { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":actor",SOAP_1_1_ACTOR_NEXT); - } - } else { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NEXT); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { - xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NONE); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { - xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_UNLIMATERECEIVER); - } - } - } - } - } - zend_hash_move_forward(soap_headers); - } - } - - if (use == SOAP_ENCODED) { - xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX); - xmlNewNs(envelope, XSI_NAMESPACE, XSI_NS_PREFIX); - if (version == SOAP_1_1) { - xmlNewNs(envelope, SOAP_1_1_ENC_NAMESPACE, SOAP_1_1_ENC_NS_PREFIX); - xmlSetNsProp(envelope, envelope->ns, "encodingStyle", SOAP_1_1_ENC_NAMESPACE); - } else if (version == SOAP_1_2) { - xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX); - if (method) { - xmlSetNsProp(method, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE); - } - } - } - - return doc; -} - -static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent TSRMLS_DC) -{ - char *paramName; - xmlNodePtr xmlParam; - char paramNameBuf[10]; - - if (param_val && - Z_TYPE_P(param_val) == IS_OBJECT && - Z_OBJCE_P(param_val) == soap_param_class_entry) { - zval **param_name; - zval **param_data; - - if (zend_hash_find(Z_OBJPROP_P(param_val), "param_name", sizeof("param_name"), (void **)¶m_name) == SUCCESS && - zend_hash_find(Z_OBJPROP_P(param_val), "param_data", sizeof("param_data"), (void **)¶m_data) == SUCCESS) { - param_val = *param_data; - name = Z_STRVAL_PP(param_name); - } - } - - if (param != NULL && param->paramName != NULL) { - paramName = param->paramName; - } else { - if (name == NULL) { - paramName = paramNameBuf; - sprintf(paramName,"param%d",index); - } else { - paramName = name; - } - } - - xmlParam = serialize_zval(param_val, param, paramName, style, parent TSRMLS_CC); - - return xmlParam; -} - -static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC) -{ - xmlNodePtr xmlParam; - encodePtr enc; - zval defval; - - if (param != NULL) { - enc = param->encode; - if (val == NULL) { - if (param->element) { - if (param->element->fixed) { - ZVAL_STRING(&defval, param->element->fixed, 0); - val = &defval; - } else if (param->element->def && !param->element->nillable) { - ZVAL_STRING(&defval, param->element->def, 0); - val = &defval; - } - } - } - } else { - enc = NULL; - } - xmlParam = master_to_xml(enc, val, style, parent); - if (!strcmp(xmlParam->name, "BOGUS")) { - xmlNodeSetName(xmlParam, paramName); - } - return xmlParam; -} - -static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int response) -{ - sdlParamPtr *tmp; - HashTable *ht; - - if (function == NULL) { - return NULL; - } - - if (response == FALSE) { - ht = function->requestParameters; - } else { - ht = function->responseParameters; - } - - if (ht == NULL) { - return NULL; - } - - if (param_name != NULL) { - if (zend_hash_find(ht, param_name, strlen(param_name), (void **)&tmp) != FAILURE) { - return *tmp; - } else { - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(ht, &pos); - while (zend_hash_get_current_data_ex(ht, (void **)&tmp, &pos) != FAILURE) { - if ((*tmp)->paramName && strcmp(param_name, (*tmp)->paramName) == 0) { - return *tmp; - } - zend_hash_move_forward_ex(ht, &pos); - } - } - } else { - if (zend_hash_index_find(ht, index, (void **)&tmp) != FAILURE) { - return (*tmp); - } - } - return NULL; -} - -static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name) -{ - sdlFunctionPtr *tmp; - - int len = strlen(function_name); - char *str = estrndup(function_name,len); - php_strtolower(str,len); - if (sdl != NULL) { - if (zend_hash_find(&sdl->functions, str, len+1, (void **)&tmp) != FAILURE) { - efree(str); - return (*tmp); - } else if (sdl->requests != NULL && zend_hash_find(sdl->requests, str, len+1, (void **)&tmp) != FAILURE) { - efree(str); - return (*tmp); - } - } - efree(str); - return NULL; -} - -static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr params) -{ - if (sdl) { - sdlFunctionPtr *tmp; - sdlParamPtr *param; - - zend_hash_internal_pointer_reset(&sdl->functions); - while (zend_hash_get_current_data(&sdl->functions, (void**)&tmp) == SUCCESS) { - if ((*tmp)->binding && (*tmp)->binding->bindingType == BINDING_SOAP) { - sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)(*tmp)->bindingAttributes; - if (fnb->style == SOAP_DOCUMENT) { - if (params == NULL) { - if ((*tmp)->requestParameters == NULL || - zend_hash_num_elements((*tmp)->requestParameters) == 0) { - return *tmp; - } - } else if ((*tmp)->requestParameters != NULL && - zend_hash_num_elements((*tmp)->requestParameters) > 0) { - int ok = 1; - xmlNodePtr node = params; - - zend_hash_internal_pointer_reset((*tmp)->requestParameters); - while (zend_hash_get_current_data((*tmp)->requestParameters, (void**)¶m) == SUCCESS) { - if ((*param)->element) { - if (strcmp((*param)->element->name,node->name) != 0) { - ok = 0; - break; - } - if ((*param)->element->namens != NULL && node->ns != NULL) { - if (strcmp((*param)->element->namens,node->ns->href) != 0) { - ok = 0; - break; - } - } else if ((void*)(*param)->element->namens != (void*)node->ns) { - ok = 0; - break; - } - } else if (strcmp((*param)->paramName,node->name) != 0) { - ok = 0; - break; - } - zend_hash_move_forward((*tmp)->requestParameters); - } - if (ok /*&& node == NULL*/) { - return (*tmp); - } - } - } - } - zend_hash_move_forward(&sdl->functions); - } - } - return NULL; -} - -static void function_to_string(sdlFunctionPtr function, smart_str *buf) -{ - int i = 0; - HashPosition pos; - sdlParamPtr *param; - - if (function->responseParameters && - zend_hash_num_elements(function->responseParameters) > 0) { - if (zend_hash_num_elements(function->responseParameters) == 1) { - zend_hash_internal_pointer_reset(function->responseParameters); - zend_hash_get_current_data(function->responseParameters, (void**)¶m); - if ((*param)->encode && (*param)->encode->details.type_str) { - smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str)); - smart_str_appendc(buf, ' '); - } else { - smart_str_appendl(buf, "UNKNOWN ", 8); - } - } else { - i = 0; - smart_str_appendl(buf, "list(", 5); - zend_hash_internal_pointer_reset_ex(function->responseParameters, &pos); - while (zend_hash_get_current_data_ex(function->responseParameters, (void **)¶m, &pos) != FAILURE) { - if (i > 0) { - smart_str_appendl(buf, ", ", 2); - } - if ((*param)->encode && (*param)->encode->details.type_str) { - smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str)); - } else { - smart_str_appendl(buf, "UNKNOWN", 7); - } - smart_str_appendl(buf, " $", 2); - smart_str_appendl(buf, (*param)->paramName, strlen((*param)->paramName)); - zend_hash_move_forward_ex(function->responseParameters, &pos); - i++; - } - smart_str_appendl(buf, ") ", 2); - } - } else { - smart_str_appendl(buf, "void ", 5); - } - - smart_str_appendl(buf, function->functionName, strlen(function->functionName)); - - smart_str_appendc(buf, '('); - if (function->requestParameters) { - i = 0; - zend_hash_internal_pointer_reset_ex(function->requestParameters, &pos); - while (zend_hash_get_current_data_ex(function->requestParameters, (void **)¶m, &pos) != FAILURE) { - if (i > 0) { - smart_str_appendl(buf, ", ", 2); - } - if ((*param)->encode && (*param)->encode->details.type_str) { - smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str)); - } else { - smart_str_appendl(buf, "UNKNOWN", 7); - } - smart_str_appendl(buf, " $", 2); - smart_str_appendl(buf, (*param)->paramName, strlen((*param)->paramName)); - zend_hash_move_forward_ex(function->requestParameters, &pos); - i++; - } - } - smart_str_appendc(buf, ')'); - smart_str_0(buf); -} - -static void model_to_string(sdlContentModelPtr model, smart_str *buf, int level) -{ - int i; - - switch (model->kind) { - case XSD_CONTENT_ELEMENT: - type_to_string(model->u.element, buf, level); - smart_str_appendl(buf, ";\n", 2); - break; - case XSD_CONTENT_ANY: - for (i = 0;i < level;i++) { - smart_str_appendc(buf, ' '); - } - smart_str_appendl(buf, " any;\n", sizeof(" any;\n")-1); - break; - case XSD_CONTENT_SEQUENCE: - case XSD_CONTENT_ALL: - case XSD_CONTENT_CHOICE: { - sdlContentModelPtr *tmp; - - zend_hash_internal_pointer_reset(model->u.content); - while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) { - model_to_string(*tmp, buf, level); - zend_hash_move_forward(model->u.content); - } - break; - } - case XSD_CONTENT_GROUP: - model_to_string(model->u.group->model, buf, level); - default: - break; - } -} - -static void type_to_string(sdlTypePtr type, smart_str *buf, int level) -{ - int i; - smart_str spaces = {0}; - HashPosition pos; - - for (i = 0;i < level;i++) { - smart_str_appendc(&spaces, ' '); - } - smart_str_appendl(buf, spaces.c, spaces.len); - - switch (type->kind) { - case XSD_TYPEKIND_SIMPLE: - case XSD_TYPEKIND_LIST: - case XSD_TYPEKIND_UNION: - if (type->encode) { - smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str)); - smart_str_appendc(buf, ' '); - } else { - smart_str_appendl(buf, "anyType ", sizeof("anyType ")-1); - } - smart_str_appendl(buf, type->name, strlen(type->name)); - break; - case XSD_TYPEKIND_COMPLEX: - case XSD_TYPEKIND_RESTRICTION: - case XSD_TYPEKIND_EXTENSION: - if (type->encode && - (type->encode->details.type == IS_ARRAY || - type->encode->details.type == SOAP_ENC_ARRAY)) { - sdlAttributePtr *attr; - sdlExtraAttributePtr *ext; - - if (type->attributes && - zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", - sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), - (void **)&attr) == SUCCESS && - zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { - char *end = strchr((*ext)->val, '['); - int len; - if (end == NULL) { - len = strlen((*ext)->val); - } else { - len = end-(*ext)->val; - } - if (len == 0) { - smart_str_appendl(buf, "anyType", sizeof("anyType")-1); - } else { - smart_str_appendl(buf, (*ext)->val, len); - } - smart_str_appendc(buf, ' '); - smart_str_appendl(buf, type->name, strlen(type->name)); - if (end != NULL) { - smart_str_appends(buf, end); - } - } else { - sdlTypePtr elementType; - if (type->attributes && - zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", - sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), - (void **)&attr) == SUCCESS && - zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { - smart_str_appends(buf, (*ext)->val); - smart_str_appendc(buf, ' '); - } else if (type->elements && - zend_hash_num_elements(type->elements) == 1 && - (zend_hash_internal_pointer_reset(type->elements), - zend_hash_get_current_data(type->elements, (void**)&elementType) == SUCCESS) && - (elementType = *(sdlTypePtr*)elementType) != NULL && - elementType->encode && elementType->encode->details.type_str) { - smart_str_appends(buf, elementType->encode->details.type_str); - smart_str_appendc(buf, ' '); - } else { - smart_str_appendl(buf, "anyType ", 8); - } - smart_str_appendl(buf, type->name, strlen(type->name)); - if (type->attributes && - zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", - sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), - (void **)&attr) == SUCCESS && - zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) { - smart_str_appendc(buf, '['); - smart_str_appends(buf, (*ext)->val); - smart_str_appendc(buf, ']'); - } else { - smart_str_appendl(buf, "[]", 2); - } - } - } else { - smart_str_appendl(buf, "struct ", 7); - smart_str_appendl(buf, type->name, strlen(type->name)); - smart_str_appendc(buf, ' '); - smart_str_appendl(buf, "{\n", 2); - if ((type->kind == XSD_TYPEKIND_RESTRICTION || - type->kind == XSD_TYPEKIND_EXTENSION) && type->encode) { - encodePtr enc = type->encode; - while (enc && enc->details.sdl_type && - enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && - enc->details.sdl_type->kind != XSD_TYPEKIND_LIST && - enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - enc = enc->details.sdl_type->encode; - } - if (enc) { - smart_str_appendl(buf, spaces.c, spaces.len); - smart_str_appendc(buf, ' '); - smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str)); - smart_str_appendl(buf, " _;\n", 4); - } - } - if (type->model) { - model_to_string(type->model, buf, level+1); - } - if (type->attributes) { - sdlAttributePtr *attr; - - zend_hash_internal_pointer_reset_ex(type->attributes, &pos); - while (zend_hash_get_current_data_ex(type->attributes, (void **)&attr, &pos) != FAILURE) { - smart_str_appendl(buf, spaces.c, spaces.len); - smart_str_appendc(buf, ' '); - if ((*attr)->encode && (*attr)->encode->details.type_str) { - smart_str_appends(buf, (*attr)->encode->details.type_str); - smart_str_appendc(buf, ' '); - } else { - smart_str_appendl(buf, "UNKNOWN ", 8); - } - smart_str_appends(buf, (*attr)->name); - smart_str_appendl(buf, ";\n", 2); - zend_hash_move_forward_ex(type->attributes, &pos); - } - } - smart_str_appendl(buf, spaces.c, spaces.len); - smart_str_appendc(buf, '}'); - } - break; - default: - break; - } - smart_str_free(&spaces); - smart_str_0(buf); -} - -static void delete_url(void *handle) -{ - php_url_free((php_url*)handle); -} - -static void delete_service(void *data) -{ - soapServicePtr service = (soapServicePtr)data; - - if (service->soap_functions.ft) { - zend_hash_destroy(service->soap_functions.ft); - efree(service->soap_functions.ft); - } - - if (service->mapping) { - zend_hash_destroy(service->mapping); - efree(service->mapping); - } - - if (service->soap_class.argc) { - int i; - for (i = 0; i < service->soap_class.argc;i++) { - zval_ptr_dtor(&service->soap_class.argv[i]); - } - efree(service->soap_class.argv); - } - - if (service->actor) { - efree(service->actor); - } - if (service->uri) { - efree(service->uri); - } - if (service->sdl) { - delete_sdl(service->sdl); - } - if (service->encoding) { - xmlCharEncCloseFunc(service->encoding); - } - if (service->class_map) { - zend_hash_destroy(service->class_map); - FREE_HASHTABLE(service->class_map); - } - efree(service); -} diff --git a/ext/soap/tests/bugs/bug27722.phpt b/ext/soap/tests/bugs/bug27722.phpt deleted file mode 100644 index 5df6adb816120..0000000000000 --- a/ext/soap/tests/bugs/bug27722.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #27722 (Segfault on schema without targetNamespace) ---SKIPIF-- - ---GET-- -wsdl ---FILE-- - ---EXPECT-- -ok \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug27722.wsdl b/ext/soap/tests/bugs/bug27722.wsdl deleted file mode 100644 index 51f11e6c0f1f5..0000000000000 --- a/ext/soap/tests/bugs/bug27722.wsdl +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - Purchase order schema for Example.com. - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug27742.phpt b/ext/soap/tests/bugs/bug27742.phpt deleted file mode 100644 index 1de856828ebbb..0000000000000 --- a/ext/soap/tests/bugs/bug27742.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #27742 (WDSL SOAP Parsing Schema bug) ---SKIPIF-- - ---GET-- -wsdl ---FILE-- - ---EXPECT-- -ok diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl deleted file mode 100644 index f38d911852335..0000000000000 --- a/ext/soap/tests/bugs/bug27742.wsdl +++ /dev/null @@ -1,854 +0,0 @@ - - - - - - - - ISO 8601 pattern used to denote program durations. Year, month and day are not relevent in our context and are omitted. - - - - - - - - ISO 8601 pattern for date+time information : YYYY-MM-DDThh:mm:ssZ - - - - - - - - ISO 8601 pattern for date: YYYY-MM-DD - - - - - - - - ISO 8601 pattern for time of day : hh:mm:ss - - - - - - - - MPAA standard ratings for a movie as defined in the movie and TV database schemas. - - - - - This is the way this rating is defined in the movies database schema. - - - - - This is the way this rating is defined in the TV database schema. - - - - - - - Films in the movie database that do not have any ratings associated with them are sometimes marked with this value. - - - - - This is the way films without any rating are defined in the movies database schema. - - - - - This is the way films without any rating are defined in the TV database schema. - - - - - - - - - - A Zap2it reviewer assigned rating for a given film. - - - - - - - - - - - - - - The roles that are currently defined for the production crew associated with a given film. - - - - - - - - - - - - - The standard genres that are used to classify films in the movies database schema. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The standard advisory messages that are associated with a movie shown on TV. - - - - - - - - - - - - - - - - - - - - The FCC standard ratings for TV programs (http://www.fcc.gov/vchip/#guidelines) - - - - - - - - - - - - - The standard color codes used to denote the color scheme used by a TV program (eg. Color, B & W ...). - - - - - Indicates that the program is begin telecast in Black and White. - - - - - Indicates that the program being telecast is in color. - - - - - Indicates that the program being telecast is a colorised version of the original program. - - - - - Indicates that the program being telecast is partly in color and partly in Black and White. - - - - - - - Common attributes that are applicable to all the root elements of the XML schemas developed to represent film data. - - - - The ZIP/Postal code for which the theatre list was generated. - - - - - The radius around the centroid of the ZIP/Postal code within which the films are located. A default value of 20 (miles for US customers and kilometres for non-US customers) will be used if the client making the request did not specify a radius. - - - - - The maximum number of film/theatre records that are included in the document. This number may be specified by the client making the request for the list of films/theatres/showtimes. - - - - - - A cast or production crew member for a film or TV show. - - - - - Describes the role of the crew member. Eg. Actor, Director ... - - - - - The given/first name of the crew member. The element name follows LDAP naming convention. TMS does not have given/first names for all cast/crew members. Hence this element is nillable. - - - - - The surname/last-name of the crew member. The element name follows LDAP naming convention. - - - - - - - Complex type that contains the attributes of an image. The only attribute available at present is its URI. - - - - - This element contains an absolute URI to an image associated with the film. - - - - - This element defines the width of the image associated with the film. This element is a place holder. The width attribute is not available at present. - - - - - This element defines the height of the image associated with the film. This element is a place holder. The height attribute is not available at present. - - - - - - - This complex type describes a generic address. - - - - - This element groups together the various street address parts for the entire address. - - - - - - This field contains each entry for the street address part of the entire address. - - - - - - - - This field contains the city for the address. - - - - - This field contains the name/code of the state for the address. - - - - - This field contains the ZIP/Postal code for the address. - - - - - This field contains the telephone number if available for the address. - - - - - This field contains the fax number if available for the address. - - - - - This field contains the mobile phone number if available for the address. - - - - - This field contains the email address if available for the address. - - - - - This field contains the country of the address. - - - - - - - Root element of the document. @IMPORTANT : All time and dates are specified in UTC ! - - - - - - - - - - - - - Date and time defining the start of the period covered by this XTVD document. - - - - - Date and time defining the end of the period covered by this XTVD document. - - - - - Version number of the schema used to build this document. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Collection of user selected station elements (across all lineups). - - - - - - Defines a TV broadcast station - each station is identified with an unique ID. - - - - - - Short name of the station (eg. CNN). - - - - - Long name of the station (eg. Cable News Network). - - - - - FCC channel number of a broadcast station. - - - - - Network, cable or broadcasting group with which the station is associated. - - - - - - ID string of the station. - - - - - - - - - - Collection of lineup elements selected by the user. - - - - - - Defines all the station that were selected for the given lineup. - - - - - - This element defines the mapping between one station and one channel number. As channel numbers may change over time, attributes to define a validity period for the mapping are available. - - - - - - Specifies the time(s) of day when the given station-channel mapping is in effect. - - - - - The time of day from which the station-channel mapping is effective. - - - - - The time of day until which the station-channel mapping is effective. - - - - - - - - Reference to a station. - - - - - Channel number associated to the station. - - - - - The major channel (the channel attribute) number is used to group all services associated with a broadcaster's NTSC brand, for example Channel 4. The minor channel number specifies a particular channel within that group. Zero (0) is reserved for the NTSC channel; all other values (1-999) are allowed for digital services. One common approach is to start with 1 and to continue numerically for different programming services. - - - - - Date from which the mapping is valid, according to the validity period of the whole XTVD document. @IMPORTANT : It is assumed that the change will occur at midnight. - - - - - Date untill which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight. - - - - - - - - Name given to the lineup. - - - - - Defines the type of the lineup (CABLE, SATELLITE, ...). - - - - - The name of the device associated with the headend. - - - - - The ZIP/Postal code for which the specified lineup was selected by the user. - - - - - - - - - - Contain all schedule records (across all selected lineups). - - - - - Sequence of schedule records. - - - - Describes a schedule entry. - - - - - - Designates which part, when a program is split into 2 or more viewings. - - - - - Designates which part, when a program is split into 2 or more viewings. - - - - - - - - - - Designates when a program is split into 2 or more parts for viewing. - - - - - - - - - - - - - Reference to a program ID. - - - - - Reference to a station ID. - - - - - Air date and time for the schedule. - - - - - Duration of the schedule. - - - - - Designates a program which has been aired previously. - - - - - The FCC standard ratings applied to TV shows. - - - - - Indicates whether the program has stereo sound or not. - - - - - Indicates whether the program has subtitles. - - - - - Indicates whether the program broadcast is HDTV compatible. - - - - - Indicates whether the program has closed captions. - - - - - - - - - - Contains all the program records that are referenced by the schedule records. - - - - - - Defines a program entry. - - - - - - Title of the program. - - - - - Subtitle of the program (episode title, game title, ...) - - - - - Word string that describes the program. - - - - - MPAA rating of the program (applies to movies only). - - - - - Star rating of the program (applies to movies only). - - - - - Actual length of the program. Not the same as schedule/@duration. Applies to movies only. - - - - - The year in which a feature film was released; YYYY format. Applies to movies only. - - - - - Distinguishes how a program was originally produced and/or distributed. - - - - - The series ID associated with episodic programs. For instance an episode with programId "EP5544720193" has a series ID "SH5544720000". The series ID may be used to group together all episodes for a given series. - - - - - Indicates whether the program is in black and white, colorized or color. Since most programs are in "Color" this element will be populated only if a program is not in "Color". - - - - - This element groups together all the advisories associated with the program. Advisories apply only to movies. - - - - - - An individual advisory message associated with the movie. - - - - - - - - - Unique ID of the program. - - - - - - - - - - Contains information about the personnel associated with each program record. - - - - - - This element groups together all the crew members associated with the given program. - - - - - - This element describes an individual production crew member associated with a program. - - - - - - - - - - - - Containes genre information where available for the program records. A program may have more than one genre with different relevence factors. - - - - - - This element groups together all the genres under which the specified program falls. - - - - - - This element groups together the different elements associated with each genre with which the program is associated. - - - - - - The genre that is associated with a specified program record. - - - - - A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified. - - - - - - - - - - - - - - - Standard lineup types. - - - - - - - - - - - - - A collection of messages that may be sent back by the server to the client. Messages are usually used by the server to notify the user of changes to their subscription caused by automatic changes in station's that are part of their subscription. For instance, messages are passed back if a lineup selected by the user is no-longer valid, if all the stations selected by the user has been removed as they are no longer valid ... - - - - - - An individual message that is passed back by the server. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug28751.phpt b/ext/soap/tests/bugs/bug28751.phpt deleted file mode 100644 index a37a2c15ebd1e..0000000000000 --- a/ext/soap/tests/bugs/bug28751.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #28751 (SoapServer does not call _autoload()) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->setClass("SoapServerActions"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/bugs/bug28969.phpt b/ext/soap/tests/bugs/bug28969.phpt deleted file mode 100644 index 6634888eac180..0000000000000 --- a/ext/soap/tests/bugs/bug28969.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #28969 (Wrong data encoding of special characters) ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('test'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$x = new LocalSoapClient(NULL,array('location'=>'test://', - 'uri'=>'http://testuri.org', - 'encoding'=>'ISO-8859-1')); -var_dump($x->test()); -echo "ok\n"; -?> ---EXPECT-- -string(3) "Ĥè" -ok diff --git a/ext/soap/tests/bugs/bug28985.phpt b/ext/soap/tests/bugs/bug28985.phpt deleted file mode 100644 index 291cce0cbb22f..0000000000000 --- a/ext/soap/tests/bugs/bug28985.phpt +++ /dev/null @@ -1,204 +0,0 @@ ---TEST-- -Bug #28985 (__getTypes() returning nothing on complex WSDL) ---SKIPIF-- - ---FILE-- -1)); -var_dump($client->__getTypes()); -?> ---EXPECT-- -array(42) { - [0]=> - string(100) "struct LoginMGDIS { - string iUserLogin; - string iUserId; - string iUserPassword; - string iProfilId; -}" - [1]=> - string(29) "struct LoginMGDISResponse { -}" - [2]=> - string(28) "struct GetIdentification { -}" - [3]=> - string(77) "struct GetIdentificationResponse { - ArrayOfAnyType GetIdentificationResult; -}" - [4]=> - string(43) "struct ArrayOfAnyType { - anyType anyType; -}" - [5]=> - string(37) "struct RollbackCurrentTransaction { -}" - [6]=> - string(45) "struct RollbackCurrentTransactionResponse { -}" - [7]=> - string(68) "struct GetListeProfil { - string iUserLogin; - string iUserPassword; -}" - [8]=> - string(86) "struct MGCodeLibelle { - string Code; - string Libelle; - boolean Defaut; - anyType Tag; -}" - [9]=> - string(61) "struct ArrayOfMGCodeLibelle { - MGCodeLibelle MGCodeLibelle; -}" - [10]=> - string(77) "struct GetListeProfilResponse { - ArrayOfMGCodeLibelle GetListeProfilResult; -}" - [11]=> - string(41) "struct GetListeValCodif { - string Code; -}" - [12]=> - string(43) "struct ArrayOfMGCodif { - MGCodif MGCodif; -}" - [13]=> - string(18) "struct MGCodif { -}" - [14]=> - string(75) "struct GetListeValCodifResponse { - ArrayOfMGCodif GetListeValCodifResult; -}" - [15]=> - string(39) "struct TestPhpSoap { - MGCodif entree; -}" - [16]=> - string(57) "struct TestPhpSoapResponse { - string TestPhpSoapResult; -}" - [17]=> - string(50) "struct GetListeCodif { - boolean iGetListeValeur; -}" - [18]=> - string(87) "struct MGCodifGrp { - string TypeCodif; - string LibCodif; - ArrayOfMGCodif ListeCodifs; -}" - [19]=> - string(52) "struct ArrayOfMGCodifGrp { - MGCodifGrp MGCodifGrp; -}" - [20]=> - string(72) "struct GetListeCodifResponse { - ArrayOfMGCodifGrp GetListeCodifResult; -}" - [21]=> - string(57) "struct DroitCreation { - string iObjet; - string iProfil; -}" - [22]=> - string(62) "struct DroitCreationResponse { - boolean DroitCreationResult; -}" - [23]=> - string(74) "struct ListeDroitCreation { - ArrayOfString iListeObjet; - string iProfil; -}" - [24]=> - string(40) "struct ArrayOfString { - string string; -}" - [25]=> - string(79) "struct ListeDroitCreationResponse { - ArrayOfAnyType ListeDroitCreationResult; -}" - [26]=> - string(87) "struct GetDroitsObjetProtege { - string iObjet; - string iProfil; - string iUtilisateur; -}" - [27]=> - string(154) "struct MGDroitsObjetProtege { - string LbUti; - string LbProf; - string LbServ; - string LbDir; - boolean isProtected; - ArrayOfMGDroitAcces ListeDroitsAcces; -}" - [28]=> - string(58) "struct ArrayOfMGDroitAcces { - MGDroitAcces MGDroitAcces; -}" - [29]=> - string(104) "struct MGDroitAcces { - string IdProfil; - boolean Lecture; - boolean Modification; - boolean Suppression; -}" - [30]=> - string(91) "struct GetDroitsObjetProtegeResponse { - MGDroitsObjetProtege GetDroitsObjetProtegeResult; -}" - [31]=> - string(76) "struct GetPrivileges { - string iIdSupport; - int iIdForme; - string iProfil; -}" - [32]=> - string(68) "struct GetPrivilegesResponse { - ArrayOfString GetPrivilegesResult; -}" - [33]=> - string(46) "struct GetLibelleProfil { - string iIdProfil; -}" - [34]=> - string(67) "struct GetLibelleProfilResponse { - string GetLibelleProfilResult; -}" - [35]=> - string(91) "struct GetValeurRecherche { - string iChampSource; - string iTable; - string iOrderByClause; -}" - [36]=> - string(78) "struct GetValeurRechercheResponse { - ArrayOfString GetValeurRechercheResult; -}" - [37]=> - string(128) "struct GetValeurRechercheWithClauseWhere { - string iChampSource; - string iTable; - string iClauseWhere; - string iOrderByClause; -}" - [38]=> - string(108) "struct GetValeurRechercheWithClauseWhereResponse { - ArrayOfString GetValeurRechercheWithClauseWhereResult; -}" - [39]=> - string(27) "struct GetEnvironnement { -}" - [40]=> - string(106) "struct MGEnvironnement { - string RepBureautique; - string RepBureautiqueImage; - string RepBureautiqueDoc; -}" - [41]=> - string(76) "struct GetEnvironnementResponse { - MGEnvironnement GetEnvironnementResult; -}" -} \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug28985.wsdl b/ext/soap/tests/bugs/bug28985.wsdl deleted file mode 100644 index ee528818bbe2c..0000000000000 --- a/ext/soap/tests/bugs/bug28985.wsdl +++ /dev/null @@ -1,683 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug29061.phpt b/ext/soap/tests/bugs/bug29061.phpt deleted file mode 100644 index 0bf8917fa5954..0000000000000 --- a/ext/soap/tests/bugs/bug29061.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #29061 (soap extension segfaults) ---SKIPIF-- - ---FILE-- -0)); -$client->getQuote("ibm"); -echo "ok\n"; -?> ---EXPECT-- -ok \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29061.wsdl b/ext/soap/tests/bugs/bug29061.wsdl deleted file mode 100644 index fb4d9aa3b5a4d..0000000000000 --- a/ext/soap/tests/bugs/bug29061.wsdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug29109.phpt b/ext/soap/tests/bugs/bug29109.phpt deleted file mode 100644 index 91d3ea265fe9e..0000000000000 --- a/ext/soap/tests/bugs/bug29109.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #29109 (Uncaught SoapFault exception: [WSDL] Out of memory) ---SKIPIF-- - ---FILE-- -__getFunctions()); -?> ---EXPECT-- -array(3) { - [0]=> - string(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)" - [1]=> - string(19) "string HelloWorld()" - [2]=> - string(19) "string HelloWorld()" -} \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29109.wsdl b/ext/soap/tests/bugs/bug29109.wsdl deleted file mode 100644 index 800cd2357dbf0..0000000000000 --- a/ext/soap/tests/bugs/bug29109.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug29236.phpt b/ext/soap/tests/bugs/bug29236.phpt deleted file mode 100644 index 4dbc302c171ce..0000000000000 --- a/ext/soap/tests/bugs/bug29236.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #29236 (memory error when wsdl-cache is enabled) ---SKIPIF-- - ---FILE-- -__getFunctions()); -?> ---EXPECT-- -array(4) { - [0]=> - string(59) "StartSessionResponse StartSession(StartSession $parameters)" - [1]=> - string(62) "VerifySessionResponse VerifySession(VerifySession $parameters)" - [2]=> - string(41) "LogoutResponse Logout(Logout $parameters)" - [3]=> - string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)" -} diff --git a/ext/soap/tests/bugs/bug29236.wsdl b/ext/soap/tests/bugs/bug29236.wsdl deleted file mode 100644 index d60a4871d4282..0000000000000 --- a/ext/soap/tests/bugs/bug29236.wsdl +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29795.phpt b/ext/soap/tests/bugs/bug29795.phpt deleted file mode 100644 index 52f8862fda123..0000000000000 --- a/ext/soap/tests/bugs/bug29795.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #29795 (SegFault with Soap and Amazon's Web Services) ---SKIPIF-- - ---FILE-- -3995USD -EOF; - } - -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); -$ar=$client->GetPrice(); -echo "o"; -$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); -$ar=$client->GetPrice(); -echo "k\n"; -?> ---EXPECT-- -ok diff --git a/ext/soap/tests/bugs/bug29795.wsdl b/ext/soap/tests/bugs/bug29795.wsdl deleted file mode 100644 index 5a4499da0d7c2..0000000000000 --- a/ext/soap/tests/bugs/bug29795.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug29830.phpt b/ext/soap/tests/bugs/bug29830.phpt deleted file mode 100644 index dc090f82cc155..0000000000000 --- a/ext/soap/tests/bugs/bug29830.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #29844 (SoapServer::setClass() should not export non-public methods) ---SKIPIF-- - ---FILE-- -"test://")); -$server->setClass('hello_world'); -$functions = $server->getFunctions(); -foreach($functions as $func) { - echo $func . "\n"; -} -?> ---EXPECT-- -hello diff --git a/ext/soap/tests/bugs/bug29839.phpt b/ext/soap/tests/bugs/bug29839.phpt deleted file mode 100644 index 25b4512a72c22..0000000000000 --- a/ext/soap/tests/bugs/bug29839.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #29839 incorrect convert (xml:lang to lang) ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('EchoString'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug29839.wsdl", array("trace"=>1)); -$client->EchoString(array("value"=>"hello","lang"=>"en")); -echo $client->__getLastRequest(); -echo $client->__getLastResponse(); -echo "ok\n"; -?> ---EXPECT-- - -hello - -hello -ok \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29839.wsdl b/ext/soap/tests/bugs/bug29839.wsdl deleted file mode 100644 index d8ccb9795476f..0000000000000 --- a/ext/soap/tests/bugs/bug29839.wsdl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug29844.phpt b/ext/soap/tests/bugs/bug29844.phpt deleted file mode 100644 index bef8335709f45..0000000000000 --- a/ext/soap/tests/bugs/bug29844.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #29844 (SOAP doesn't return the result of a valid SOAP request) ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->setClass('hello_world');; - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug29844.wsdl", array("trace"=>1)); -var_dump($client->hello('davey')); -?> ---EXPECT-- -string(11) "Hello davey" diff --git a/ext/soap/tests/bugs/bug29844.wsdl b/ext/soap/tests/bugs/bug29844.wsdl deleted file mode 100644 index b45aa3666f9b2..0000000000000 --- a/ext/soap/tests/bugs/bug29844.wsdl +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - Say Hello to Somebody - - - - - Say Goodbye to Somebody - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Say Hello to Somebody - - - - The greeting - - - - Say Goodbye to Somebody - - - - The goodbye - - diff --git a/ext/soap/tests/bugs/bug30045.phpt b/ext/soap/tests/bugs/bug30045.phpt deleted file mode 100644 index 753faf17554e2..0000000000000 --- a/ext/soap/tests/bugs/bug30045.phpt +++ /dev/null @@ -1,171 +0,0 @@ ---TEST-- -Bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests) ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('foo'); - } - - function __doRequest($request, $location, $action, $version) { - $xml = simplexml_load_string($request); - echo $xml->children("http://schemas.xmlsoap.org/soap/envelope/")->Body->children("http://test-uri")->children()->param1->asXML(),"\n"; - unset($xml); - - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - - return $response; - } - -} - -$soap = new LocalSoapClient(NULL, array("uri"=>"http://test-uri", "location"=>"test://")); - -function test($type, $num) { - global $soap; - try { - printf(" %0.0f\n ", $num); - $ret = $soap->foo($type, new SoapVar($num, $type)); - printf(" %0.0f\n", $num, $ret); - } catch (SoapFault $ex) { - var_dump($ex); - } -} -/* -echo "byte\n"; -//test(XSD_BYTE, -129); -test(XSD_BYTE, -128); -test(XSD_BYTE, 127); -//test(XSD_BYTE, 128); - -echo "\nshort\n"; -//test(XSD_SHORT, -32769); -test(XSD_SHORT, -32768); -test(XSD_SHORT, 32767); -//test(XSD_SHORT, 32768); - -echo "\nint\n"; -//test(XSD_INT, -2147483649); -test(XSD_INT, -2147483648); -test(XSD_INT, 2147483647); -//test(XSD_INT, 2147483648); - -echo "\nlong\n"; -//test(XSD_LONG, -9223372036854775809); -test(XSD_LONG, -9223372036854775808); -test(XSD_LONG, 9223372036854775807); -//test(XSD_LONG, 9223372036854775808); - -echo "\nunsignedByte\n"; -//test(XSD_UNSIGNEDBYTE, -1); -test(XSD_UNSIGNEDBYTE, 0); -test(XSD_UNSIGNEDBYTE, 255); -//test(XSD_UNSIGNEDBYTE, 256); - -echo "\nunsignedShort\n"; -//test(XSD_UNSIGNEDSHORT, -1); -test(XSD_UNSIGNEDSHORT, 0); -test(XSD_UNSIGNEDSHORT, 65535); -//test(XSD_UNSIGNEDSHORT, 65536); - -echo "\nunsignedInt\n"; -//test(XSD_UNSIGNEDINT, -1); -test(XSD_UNSIGNEDINT, 0); -test(XSD_UNSIGNEDINT, 4294967295); -//test(XSD_UNSIGNEDINT, 4294967296); - -echo "\nunsignedLong\n"; -//test(XSD_UNSIGNEDLONG, -1); -test(XSD_UNSIGNEDLONG, 0); -test(XSD_UNSIGNEDLONG, 18446744073709551615); -//test(XSD_UNSIGNEDLONG, 18446744073709551616); - -echo "\nnegativeInteger\n"; -test(XSD_NEGATIVEINTEGER, -18446744073709551616); -test(XSD_NEGATIVEINTEGER, -1); -//test(XSD_NEGATIVEINTEGER, 0); - -echo "\nnonPositiveInteger\n"; -test(XSD_NONPOSITIVEINTEGER, -18446744073709551616); -test(XSD_NONPOSITIVEINTEGER, 0); -//test(XSD_NONPOSITIVEINTEGER, 1); - -echo "\nnonNegativeInteger\n"; -//test(XSD_NONNEGATIVEINTEGER, -1); -test(XSD_NONNEGATIVEINTEGER, 0); -test(XSD_NONNEGATIVEINTEGER, 18446744073709551616); - -echo "\nPositiveInteger\n"; -//test(XSD_POSITIVEINTEGER, 0); -test(XSD_POSITIVEINTEGER, 1); -test(XSD_POSITIVEINTEGER, 18446744073709551616); - -echo "\ninteger\n"; -test(XSD_INTEGER, -18446744073709551616); -test(XSD_INTEGER, 18446744073709551616); -*/ -echo "long\n"; -test(XSD_LONG, 2147483647); -test(XSD_LONG, 2147483648); -test(XSD_LONG, 4294967296); -test(XSD_LONG, 8589934592); -test(XSD_LONG, 17179869184); - -echo "\nunsignedLong\n"; -test(XSD_UNSIGNEDLONG, 2147483647); -test(XSD_UNSIGNEDLONG, 2147483648); -test(XSD_UNSIGNEDLONG, 4294967296); -test(XSD_UNSIGNEDLONG, 8589934592); -test(XSD_UNSIGNEDLONG, 17179869184); - -?> ---EXPECT-- -long - 2147483647 - 2147483647 - 2147483647 - 2147483648 - 2147483648 - 2147483648 - 4294967296 - 4294967296 - 4294967296 - 8589934592 - 8589934592 - 8589934592 - 17179869184 - 17179869184 - 17179869184 - -unsignedLong - 2147483647 - 2147483647 - 2147483647 - 2147483648 - 2147483648 - 2147483648 - 4294967296 - 4294967296 - 4294967296 - 8589934592 - 8589934592 - 8589934592 - 17179869184 - 17179869184 - 17179869184 diff --git a/ext/soap/tests/bugs/bug30106.phpt b/ext/soap/tests/bugs/bug30106.phpt deleted file mode 100644 index dbc44f6f0d4b4..0000000000000 --- a/ext/soap/tests/bugs/bug30106.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Bug #30106 SOAP cannot not parse 'ref' element. Causes Uncaught SoapFault exception. ---SKIPIF-- - ---FILE-- -array( - "schema"=>"", - "any"=>"Hello World!Bye World!")); -} - -class LocalSoapClient extends SoapClient { - function __construct($wsdl, $options=array()) { - parent::__construct($wsdl, $options); - $this->server = new SoapServer($wsdl, $options); - $this->server->addFunction("getContinentList"); - } - - function __doRequest($request, $location, $action, $version) { - echo $request; - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - echo $response; - return $response; - } -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug30106.wsdl"); -var_dump($client->__getFunctions()); -var_dump($client->__getTypes()); -$x = $client->getContinentList(array("AFFILIATE_ID"=>1,"PASSWORD"=>"x")); -var_dump($x); -?> ---EXPECTF-- -array(1) { - [0]=> - string(71) "getContinentListResponse getContinentList(getContinentList $parameters)" -} -array(3) { - [0]=> - string(64) "struct getContinentList { - int AFFILIATE_ID; - string PASSWORD; -}" - [1]=> - string(83) "struct getContinentListResponse { - getContinentListResult getContinentListResult; -}" - [2]=> - string(66) "struct getContinentListResult { - schema; - any; -}" -} - -1x - -Hello World!Bye World! -object(stdClass)#%d (1) { - ["getContinentListResult"]=> - object(stdClass)#%d (2) { - ["schema"]=> - string(65) "" - ["any"]=> - string(48) "Hello World!Bye World!" - } -} diff --git a/ext/soap/tests/bugs/bug30106.wsdl b/ext/soap/tests/bugs/bug30106.wsdl deleted file mode 100644 index db1922da339da..0000000000000 --- a/ext/soap/tests/bugs/bug30106.wsdl +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug30175.phpt b/ext/soap/tests/bugs/bug30175.phpt deleted file mode 100644 index f5501ac9bdce5..0000000000000 --- a/ext/soap/tests/bugs/bug30175.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #30175 (SOAP results aren't parsed correctly) ---SKIPIF-- - ---INI-- -soap.wsdl_cache_enabled=0 ---FILE-- - - - - -blah blah some name field -This is a description. more blah blah blah -127.0.0.1 - - - -EOF; - } - -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug30175.wsdl"); -var_dump($client->qwebGetHostInfo()); -?> ---EXPECT-- -array(3) { - ["name"]=> - string(25) "blah blah some name field" - ["shortDescription"]=> - string(42) "This is a description. more blah blah blah" - ["ipAddress"]=> - string(9) "127.0.0.1" -} diff --git a/ext/soap/tests/bugs/bug30175.wsdl b/ext/soap/tests/bugs/bug30175.wsdl deleted file mode 100644 index f4cae2554e414..0000000000000 --- a/ext/soap/tests/bugs/bug30175.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Service definition of function ns1__qwebSquare - - - - - Service definition of function ns1__qwebStrlen - - - - - Service definition of function ns1__qwebGetHostInfo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Demo Qweb SOAP interface - - - - - - diff --git a/ext/soap/tests/bugs/bug30799.phpt b/ext/soap/tests/bugs/bug30799.phpt deleted file mode 100644 index 9fa0b12f0ecbd..0000000000000 --- a/ext/soap/tests/bugs/bug30799.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #30799 SoapServer doesn't handle private or protected properties ---SKIPIF-- - ---FILE-- -"test://", - "uri" => "test://", - "exceptions" => 0, - "trace" => 1 )); -$x->test(new foo()); -echo $x->__getLastRequest(); -echo "ok\n"; -?> ---EXPECT-- - -abc -ok diff --git a/ext/soap/tests/bugs/bug30928.phpt b/ext/soap/tests/bugs/bug30928.phpt deleted file mode 100644 index 45916f4a9f216..0000000000000 --- a/ext/soap/tests/bugs/bug30928.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #30928 When Using WSDL, SoapServer doesn't handle private or protected properties ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('test'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } -} - -$x = new LocalSoapClient(dirname(__FILE__)."/bug30928.wsdl", - array()); -var_dump($x->test(new foo())); - -$x = new LocalSoapClient(dirname(__FILE__)."/bug30928.wsdl", - array("classmap" => array('testType'=>'foo'))); -var_dump($x->test(new foo())); - -echo "ok\n"; -?> ---EXPECTF-- -object(stdClass)#4 (3) { - ["a"]=> - string(1) "a" - ["b"]=> - string(1) "b" - ["c"]=> - string(1) "c" -} -object(foo)#2 (3) { - ["a"]=> - string(1) "a" - ["b":"foo":private]=> - string(1) "b" - ["c":protected]=> - string(1) "c" -} -ok diff --git a/ext/soap/tests/bugs/bug30928.wsdl b/ext/soap/tests/bugs/bug30928.wsdl deleted file mode 100644 index 7ed34d31a211e..0000000000000 --- a/ext/soap/tests/bugs/bug30928.wsdl +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug30994.phpt b/ext/soap/tests/bugs/bug30994.phpt deleted file mode 100644 index 7e811bbbf9fd6..0000000000000 --- a/ext/soap/tests/bugs/bug30994.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #30994 SOAP server unable to handle request with references ---SKIPIF-- - ---FILE-- - - - - - - XXX - TASKTEST - - - - - - - - - ABCabc123 - 123456 - - - - -EOF; - -function bassCall() { - return "ok"; -} - -$x = new SoapServer(NULL, array("uri"=>"http://spock/kunta/kunta")); -$x->addFunction("bassCall"); -$x->handle(); -?> ---EXPECT-- - -ok diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt deleted file mode 100644 index fbad1cbd98d3b..0000000000000 --- a/ext/soap/tests/bugs/bug31422.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Bug #31422 No Error-Logging on SoapServer-Side ---SKIPIF-- - ---INI-- -log_errors=1 ---FILE-- -"http://testuri.org")); -$server->addfunction("Add"); - -$HTTP_RAW_POST_DATA = << - - - - 22 - 33 - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECTF-- -PHP Warning: fopen() expects at least 2 parameters, 0 given in %sbug31422.php on line %d -PHP Fatal error: Hello in %sbug31422.php on line %d - -SOAP-ENV:ServerHello diff --git a/ext/soap/tests/bugs/bug31695.phpt b/ext/soap/tests/bugs/bug31695.phpt deleted file mode 100644 index 770f5b4b6d588..0000000000000 --- a/ext/soap/tests/bugs/bug31695.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Bug #31695 Cannot redefine endpoint when using WSDL ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction("Test"); - } - - function __doRequest($request, $location, $action, $version) { - echo "$location\n"; - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl"); -$client->Test("str"); -$client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl", array("location"=>"test://1")); -$client->Test("str"); -$client->__soapCall("Test", - array("arg1"), - array("location"=>"test://2")); -$old = $client->__setLocation("test://3"); -echo "$old\n"; -$client->Test("str"); -$client->Test("str"); -$client->__setLocation($old); -$client->Test("str"); -$old = $client->__setLocation(); -$client->Test("str"); -$client->__setLocation($old); -$client->Test("str"); -$client->__setLocation(null); -$client->Test("str"); -var_dump($client->__setLocation()); -?> ---EXPECT-- -test://0 -test://1 -test://2 -test://1 -test://3 -test://3 -test://1 -test://0 -test://1 -test://0 -NULL diff --git a/ext/soap/tests/bugs/bug31695.wsdl b/ext/soap/tests/bugs/bug31695.wsdl deleted file mode 100644 index 5785cb07702a7..0000000000000 --- a/ext/soap/tests/bugs/bug31695.wsdl +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug31755.phpt b/ext/soap/tests/bugs/bug31755.phpt deleted file mode 100644 index e93e17daa67c1..0000000000000 --- a/ext/soap/tests/bugs/bug31755.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #31422 No Error-Logging on SoapServer-Side ---SKIPIF-- - ---FILE-- - 'http://localhost', -'uri' => 'myNS', 'exceptions' => false, 'trace' => true)); - -$header = new SOAPHeader(null, 'foo', 'bar'); - -$response= $client->__call('function', array(), null, $header); - -print $client->__getLastRequest(); -?> ---EXPECTF-- -Fatal error: SoapHeader::__construct(): Invalid parameters. Invalid namespace. in %sbug31755.php on line %d diff --git a/ext/soap/tests/bugs/bug32776.phpt b/ext/soap/tests/bugs/bug32776.phpt deleted file mode 100644 index b3c4ff0170f0c..0000000000000 --- a/ext/soap/tests/bugs/bug32776.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #32776 SOAP doesn't support one-way operations ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('test'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$x = new LocalSoapClient(dirname(__FILE__)."/bug32776.wsdl",array("trace"=>true,"exceptions"=>false)); -var_dump($x->test("Hello")); -var_dump($d); -var_dump($x->__getLastRequest()); -var_dump($x->__getLastResponse()); -echo "ok\n"; -?> ---EXPECT-- -NULL -string(5) "Hello" -string(459) " -Hello -" -string(0) "" -ok diff --git a/ext/soap/tests/bugs/bug32776.wsdl b/ext/soap/tests/bugs/bug32776.wsdl deleted file mode 100644 index 733901849e0d7..0000000000000 --- a/ext/soap/tests/bugs/bug32776.wsdl +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug32941.phpt b/ext/soap/tests/bugs/bug32941.phpt deleted file mode 100755 index 5fd17df18e06d..0000000000000 --- a/ext/soap/tests/bugs/bug32941.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #32941 (Sending structured exception kills a php) ---SKIPIF-- - ---FILE-- - - - - - soapenv:Server.userException - service.EchoServiceException - - - 105 - string param - - steckovic - - - - -EOF; - } -} - -ini_set("soap.wsdl_cache_enabled", 1); -$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0)); -$ahoj = $client->echoString('exception'); -$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0)); -$ahoj = $client->echoString('exception'); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/ext/soap/tests/bugs/bug32941.wsdl b/ext/soap/tests/bugs/bug32941.wsdl deleted file mode 100755 index 61fd13dcbc8b5..0000000000000 --- a/ext/soap/tests/bugs/bug32941.wsdl +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug34449.phpt b/ext/soap/tests/bugs/bug34449.phpt deleted file mode 100755 index 95cd4867d8794..0000000000000 --- a/ext/soap/tests/bugs/bug34449.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #34449 (ext/soap: XSD_ANYXML functionality not exposed) ---FILE-- -"; -$client = new TestSoapClient(null, array('location' => 'test://', 'uri' => 'test://')); -$client->AnyFunction(new SoapVar($my_xml, XSD_ANYXML)); -?> ---EXPECT-- - - diff --git a/ext/soap/tests/bugs/bug34453.phpt b/ext/soap/tests/bugs/bug34453.phpt deleted file mode 100755 index 7b6bba0253037..0000000000000 --- a/ext/soap/tests/bugs/bug34453.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #29839 incorrect convert (xml:lang to lang) ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('EchoString'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$client = new LocalSoapClient(dirname(__FILE__)."/bug34453.wsdl", array("trace"=>1)); -$client->EchoString(array("value"=>"hello","lang"=>"en")); -echo $client->__getLastRequest(); -echo $client->__getLastResponse(); -echo "ok\n"; -?> ---EXPECT-- - -hello - -hello -ok \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug34453.wsdl b/ext/soap/tests/bugs/bug34453.wsdl deleted file mode 100755 index 205e1c95b5b6f..0000000000000 --- a/ext/soap/tests/bugs/bug34453.wsdl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/bug34643.phpt b/ext/soap/tests/bugs/bug34643.phpt deleted file mode 100755 index d05f9bd7f5faf..0000000000000 --- a/ext/soap/tests/bugs/bug34643.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #34643 (wsdl default value) ---SKIPIF-- - ---INI-- -soap.wsdl_cache_enabled=0 ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->setClass('fp'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1)); -print_r($cl->__getFunctions()); -echo $cl->get_it("aaa")."\n"; -echo $cl->get_it()."\n"; -var_dump($cl->get_it(null)); -?> ---EXPECT-- -Array -( - [0] => string get_it(string $opt) -) -aaa -zzz -NULL diff --git a/ext/soap/tests/bugs/bug34643.wsdl b/ext/soap/tests/bugs/bug34643.wsdl deleted file mode 100755 index 24c3a50828d01..0000000000000 --- a/ext/soap/tests/bugs/bug34643.wsdl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/bugs/skipif.inc b/ext/soap/tests/bugs/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/bugs/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/bugs/xml.xsd b/ext/soap/tests/bugs/xml.xsd deleted file mode 100644 index abb844ac12012..0000000000000 --- a/ext/soap/tests/bugs/xml.xsd +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - In due course, we should install the relevant ISO 2- and 3-letter - codes as the enumerated possible values . . . - - - - - - - - - - - - - - - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. - - - - - - - - - - diff --git a/ext/soap/tests/bugs/xml2.xsd b/ext/soap/tests/bugs/xml2.xsd deleted file mode 100755 index a8e2185f1d394..0000000000000 --- a/ext/soap/tests/bugs/xml2.xsd +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. - - This schema document describes the XML namespace, in a form - suitable for import by other schema documents. - - Note that local names in this namespace are intended to be defined - only by the World Wide Web Consortium or its subgroups. The - following names are currently defined in this namespace and should - not be used with conflicting semantics by any Working Group, - specification, or document instance: - - base (as an attribute name): denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification. - - id (as an attribute name): denotes an attribute whose value - should be interpreted as if declared to be of type ID. - The xml:id specification is not yet a W3C Recommendation, - but this attribute is included here to facilitate experimentation - with the mechanisms it proposes. Note that it is _not_ included - in the specialAttrs attribute group. - - lang (as an attribute name): denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification. - - space (as an attribute name): denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification. - - Father (in any context at all): denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: - - In appreciation for his vision, leadership and dedication - the W3C XML Plenary on this 10th day of February, 2000 - reserves for Jon Bosak in perpetuity the XML name - xml:Father - - - - - This schema defines attributes and an attribute group - suitable for use by - schemas wishing to allow xml:base, xml:lang or xml:space attributes - on elements they define. - - To enable this, such a schema must import this schema - for the XML namespace, e.g. as follows: - <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" - schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> - - Subsequently, qualified reference to any of the attributes - or the group defined below will have the desired effect, e.g. - - <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> - - will define a type which will schema-validate an instance - element with any of those attributes - - - - In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2005/08/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself, or with the XML namespace itself. In other words, if the XML - Schema or XML namespaces change, the version of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2005/08/xml.xsd will not change. - - - - - - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. See - RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry - at http://www.iana.org/assignments/lang-tag-apps.htm for - further information. - - The union allows for the 'un-declaration' of xml:lang with - the empty string. - - - - - - - - - - - - - - - - - - - - - - - - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. - - - - - - See http://www.w3.org/TR/xml-id/ for - information about this attribute. - - - - - - - - - - diff --git a/ext/soap/tests/classmap.wsdl b/ext/soap/tests/classmap.wsdl deleted file mode 100644 index 7fcf596244fea..0000000000000 --- a/ext/soap/tests/classmap.wsdl +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/classmap001.phpt b/ext/soap/tests/classmap001.phpt deleted file mode 100644 index 1908ddd1ec33b..0000000000000 --- a/ext/soap/tests/classmap001.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -SOAP Classmap 1: SoapServer support for classmap ---SKIPIF-- - ---FILE-- - - - - - Blaat - aap - - - - -"; - -class test{ - function dotest(book $book){ - $classname=get_class($book); - return "Classname: ".$classname; - } -} - -class book{ - public $a="a"; - public $b="c"; - -} -$options=Array( - 'actor' =>'http://schema.nothing.com', - 'classmap' => array('book'=>'book', 'wsdltype2'=>'classname2') - ); - -$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options); -$server->setClass("test"); -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Classname: book -ok diff --git a/ext/soap/tests/classmap002.phpt b/ext/soap/tests/classmap002.phpt deleted file mode 100644 index e6f5af9913dbc..0000000000000 --- a/ext/soap/tests/classmap002.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -SOAP Classmap 2: SoapClient support for classmap ---SKIPIF-- - ---FILE-- - - - - Blaat - aap - - -EOF; - } -} - -class book{ - public $a="a"; - public $b="c"; - -} - -$options=Array( - 'actor' =>'http://schema.nothing.com', - 'classmap' => array('book'=>'book', 'wsdltype2'=>'classname2') - ); - -$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options); -$ret = $client->dotest2("???"); -var_dump($ret); -echo "ok\n"; -?> ---EXPECT-- -object(book)#2 (2) { - ["a"]=> - string(5) "Blaat" - ["b"]=> - string(3) "aap" -} -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt deleted file mode 100644 index f88cdddbf067f..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 001 (php/direct): echoString ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array("Hello World!"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World! - -Hello World! -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt deleted file mode 100644 index a25eea52c3ffe..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 001 (soap/direct): echoString ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(new SoapParam(new SoapVar("Hello World!",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World! - -Hello World! -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt deleted file mode 100644 index ea9dc86a18f6b..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World!"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World! - -Hello World! -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt deleted file mode 100644 index a5c62425dff2b..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 002 (php/direct): echoString(empty) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(""), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt deleted file mode 100644 index 3a256241a1b8a..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 002 (soap/direct): echoString(empty) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(new SoapParam(new SoapVar("",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt deleted file mode 100644 index 4761df605bb92..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 002 (php/wsdl): echoString(empty) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(""); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt deleted file mode 100644 index 66bc63113f6a2..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 003 (php/direct): echoString(NULL) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok \ No newline at end of file diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt deleted file mode 100644 index e2f4c790a67eb..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 003 (soap/direct): echoString(NULL) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(new SoapParam(new SoapVar(NULL,XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok \ No newline at end of file diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt deleted file mode 100644 index d76c28abfe11e..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 003 (php/wsdl): echoString(NULL) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(NULL); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok \ No newline at end of file diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt deleted file mode 100644 index cb56ce671963b..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 004 (php/direct): echoString(entities) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(">,<,&,\",',\\,\n"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - ->,<,&,",',\, - - ->,<,&,",',\, - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt deleted file mode 100644 index 20c899e7eb075..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 004 (soap/direct): echoString(entities) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(new SoapParam(new SoapVar(">,<,&,\",',\\,\n",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - ->,<,&,",',\, - - ->,<,&,",',\, - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt deleted file mode 100644 index 69b3afd955935..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 004 (php/wsdl): echoString(entities) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(">,<,&,\",',\\,\n"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - ->,<,&,",',\, - - ->,<,&,",',\, - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt deleted file mode 100644 index d8f91d328e2bc..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 005 (php/direct): echoString(utf-8) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(utf8_encode('áğ—ˆİ³’₧⅜áğ—áğ¸')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt deleted file mode 100644 index 116e14faac085..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 005 (soap/direct): echoString(utf-8) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString", array(new SoapParam(new SoapVar(utf8_encode('áğ—ˆİ³’₧⅜áğ—áğ¸'),XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt deleted file mode 100644 index 64f03df7b5fe4..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 005 (php/wsdl): echoString(utf-8) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(utf8_encode('áğ—ˆİ³’₧⅜áğ—áğ¸')); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ - -ĦÂğ—ƒÂˆƒÂ݃³ƒÂ’˘Â‚§˘Â…ÂœĦÂğ—ĦÂğ¸ -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt deleted file mode 100644 index f332a825b0cb8..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 006 (php/direct): echoStringArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array(array('good','bad')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -goodbad - -goodbad -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt deleted file mode 100644 index de822b2d1c333..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 006 (soap/direct): echoStringArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -goodbad - -goodbad -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt deleted file mode 100644 index 7844d4ac87140..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 006 (php/wsdl): echoStringArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array('good','bad')); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -goodbad - -goodbad -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt deleted file mode 100644 index ddf98793948b9..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 007 (php/direct): echoStringArray(one) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array(array('good')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -good - -good -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt deleted file mode 100644 index 778446a5c1e31..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 007 (soap/direct): echoStringArray(one) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -good - -good -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt deleted file mode 100644 index 89bf6ea5c027a..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 007 (php/wsdl): echoStringArray(one) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array('good')); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -good - -good -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt deleted file mode 100644 index b419a866db53f..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 008 (php/direct): echoStringArray(empty) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array(array()), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt deleted file mode 100644 index 2ee4b6de9c64f..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 008 (soap/direct): echoStringArray(empty) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt deleted file mode 100644 index 25de1542a6192..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 008 (php/wsdl): echoStringArray(empty) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array()); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt deleted file mode 100644 index 94a0983e56968..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 009 (php/direct): echoStringArray(NULL) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt deleted file mode 100644 index d2d9734fc0f95..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 009 (soap/direct): echoStringArray(NULL) ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt deleted file mode 100644 index daa8f5615e170..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 009 (php/wsdl): echoStringArray(NULL) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(NULL); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt deleted file mode 100644 index 9c2aa0ff4c3f4..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 010 (php/direct): echoInteger ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoInteger", array(34345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34345 - -34345 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt deleted file mode 100644 index 1f012cae9f34d..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 010 (soap/direct): echoInteger ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoInteger", array(new SoapParam(new soapVar(34345, XSD_INT), "inputInteger")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34345 - -34345 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt deleted file mode 100644 index b32d94f3648b1..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 010 (php/wsdl): echoInteger ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoInteger(34345); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34345 - -34345 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt deleted file mode 100644 index 7a6b1477e7a56..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 011 (php/direct): echoIntegerArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoIntegerArray", array(array(1,234324324,2)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12343243242 - -12343243242 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt deleted file mode 100644 index f892147593d2a..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 011 (soap/direct): echoIntegerArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoIntegerArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12343243242 - -12343243242 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt deleted file mode 100644 index 20686b249c3d1..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 011 (php/wsdl): echoIntegerArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoIntegerArray(array(1,234324324,2)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12343243242 - -12343243242 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt deleted file mode 100644 index 2da25b261c3e0..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 012 (php/direct): echoFloat ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoFloat", array(342.23), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -342.23 - -342.23 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt deleted file mode 100644 index bd62edd27a861..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 012 (soap/direct): echoFloat ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoFloat", array(new SoapParam(new SoapVar(342.23,XSD_FLOAT),"inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -342.23 - -342.23 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt deleted file mode 100644 index 05aad06c18e1c..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 012 (php/wsdl): echoFloat ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoFloat(342.23); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -342.23 - -342.23 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt deleted file mode 100644 index 815b4dffb7d6d..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 013 (php/direct): echoFloatArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoFloatArray", array(array(1.3223,34.2,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1.322334.2325.325 - -1.322334.2325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt deleted file mode 100644 index 72124be8abb00..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 013 (soap/direct): echoFloatArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoFloatArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1.322334.2325.325 - -1.322334.2325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt deleted file mode 100644 index e4291ab0d55e8..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 013 (php/wsdl): echoFloatArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoFloatArray(array(1.3223,34.2,325.325)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1.322334.2325.325 - -1.322334.2325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt deleted file mode 100644 index 107f953644c00..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 014 (php/direct): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStruct", array(new SOAPStruct('arg',34,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt deleted file mode 100644 index b15dc30d6d214..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 014 (soap/direct): echoStruct ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt deleted file mode 100644 index 8c0f29f2d63d5..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 014 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct(new SOAPStruct('arg',34,325.325)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt deleted file mode 100644 index 3162c26fdb06c..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 015 (php/direct): echoStructArray ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStructArray", array(array($struct,$struct)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325arg34325.325 - -arg34325.325arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt deleted file mode 100644 index 47a270b5c20f9..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 015 (soap/direct): echoStructArray ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -$struct = new SoapVar(array( - new SoapVar('arg', XSD_STRING, null, null, 'varString'), - new SoapVar('34', XSD_INT, null, null, 'varInt'), - new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat') - ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"); - -$param = new SoapParam(new SoapVar(array( - $struct, - $struct - ),SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"), "inputStructArray"); -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStructArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325arg34325.325 - -arg34325.325arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt deleted file mode 100644 index 3b7e61da70cb4..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 015 (php/wsdl): echoStructArray ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStructArray(array($struct,$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325arg34325.325 - -arg34325.325arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt deleted file mode 100644 index ab00416ea9240..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 016 (php/direct): echoVoid ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt deleted file mode 100644 index e64fde80725f9..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 016 (soap/direct): echoVoid ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt deleted file mode 100644 index b3647a594a4aa..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 016 (php/wsdl): echoVoid ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVoid(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt deleted file mode 100644 index 5f6b3c314304d..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 017 (php/direct): echoBase64 ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBase64", array('Nebraska'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Nebraska - -TmVicmFza2E= -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt deleted file mode 100644 index 3e3c6e12720d9..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 017 (soap/direct): echoBase64 ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBase64", array(new SoapParam(new SoapVar('Nebraska',XSD_BASE64BINARY),"inputBase64")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -TmVicmFza2E= - -TmVicmFza2E= -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt deleted file mode 100644 index 7471c371d9001..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 017 (php/wsdl): echoBase64 ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBase64('Nebraska'); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -TmVicmFza2E= - -TmVicmFza2E= -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt deleted file mode 100644 index 3738148c190e5..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 018 (php/direct): echoHexBinary ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoHexBinary", array('soapx4'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -soapx4 - -736F61707834 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt deleted file mode 100644 index a531069388c63..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 018 (soap/direct): echoHexBinary ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoHexBinary", array(new SoapParam(new SoapVar('soapx4',XSD_HEXBINARY),"inputHexBinary")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -736F61707834 - -736F61707834 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt deleted file mode 100644 index a118311df4e22..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 018 (php/wsdl): echoHexBinary ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoHexBinary('soapx4'); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -736F61707834 - -736F61707834 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt deleted file mode 100644 index a767301d67bd8..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 019 (php/direct): echoDecimal ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoDecimal", array('12345.67890'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12345.67890 - -12345.67890 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt deleted file mode 100644 index 56bea8b4e84e1..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 019 (soap/direct): echoDecimal ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoDecimal", array(new SoapParam(new SoapVar('12345.67890',XSD_DECIMAL), "inputDecimal")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12345.67890 - -12345.67890 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt deleted file mode 100644 index 3f561557b3142..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 019 (php/wsdl): echoDecimal ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDecimal('12345.67890'); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12345.67890 - -12345.67890 -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt deleted file mode 100644 index 4afe922e85bfe..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 020 (php/direct): echoDate ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoDate", array('2001-05-24T17:31:41Z'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2001-05-24T17:31:41Z - -2001-05-24T17:31:41Z -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt deleted file mode 100644 index 6ced7482adfaf..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 020 (soap/direct): echoDate ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoDate", array(new SoapParam(new SoapVar('2001-05-24T17:31:41Z', XSD_DATETIME), "inputDate")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2001-05-24T17:31:41Z - -2001-05-24T17:31:41Z -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt deleted file mode 100644 index 47d3a9d783223..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 020 (php/wsdl): echoDate ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDate('2001-05-24T17:31:41Z'); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2001-05-24T17:31:41Z - -2001-05-24T17:31:41Z -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt deleted file mode 100644 index 69edf346d9101..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 021 (php/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(true), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt deleted file mode 100644 index 8f2a66fc50bc2..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 021 (soap/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(true, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt deleted file mode 100644 index 1e4cb4ee25997..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 021 (php/wsdl): echoBoolean ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBoolean(true); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt deleted file mode 100644 index 07322b9876e19..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 022 (php/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(false), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -false - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt deleted file mode 100644 index 9f4309cc31b33..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 022 (soap/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(false, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -false - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt deleted file mode 100644 index 5add7e5e83f89..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 022 (php/wsdl): echoBoolean ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBoolean(false); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -false - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt deleted file mode 100644 index 65dcad2733eb2..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 023 (php/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(1), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1 - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt deleted file mode 100644 index 8985f38f4ac59..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 023 (soap/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(1, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt deleted file mode 100644 index ca4eff0fcbcf2..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 023 (php/wsdl): echoBoolean ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBoolean(1); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt deleted file mode 100644 index f55f095019db8..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 024 (php/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(0), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -0 - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt deleted file mode 100644 index f10e7629abf84..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 024 (soap/direct): echoBoolean ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(0, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -false - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt deleted file mode 100644 index 96187fbb030b5..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 base 024 (php/wsdl): echoBoolean ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBoolean(0); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_base.inc"); -echo "ok\n"; -?> ---EXPECT-- - -false - -false -ok diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.inc b/ext/soap/tests/interop/Round2/Base/round2_base.inc deleted file mode 100644 index b197f5bddde91..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/round2_base.inc +++ /dev/null @@ -1,80 +0,0 @@ -setClass("SOAP_Interop_Base"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.wsdl b/ext/soap/tests/interop/Round2/Base/round2_base.wsdl deleted file mode 100644 index c7c70319ddf7e..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/round2_base.wsdl +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round2/Base/skipif.inc b/ext/soap/tests/interop/Round2/Base/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round2/Base/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt deleted file mode 100644 index 5047a990e45ca..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 001 (php/direct): echoStructAsSimpleTypes ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStructAsSimpleTypes", array((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt deleted file mode 100644 index 9b6670772cf1f..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 001 (soap/direct): echoStructAsSimpleTypes ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoStructAsSimpleTypes", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt deleted file mode 100644 index 8fd43336a23de..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 001 (php/wsdl): echoStructAsSimpleTypes ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStructAsSimpleTypes((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt deleted file mode 100644 index 6ea475c3f084b..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 002 (php/direct): echoSimpleTypesAsStruct ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoSimpleTypesAsStruct", array("arg",34,34.345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt deleted file mode 100644 index 3fcf6de66b813..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 002 (soap/direct): echoSimpleTypesAsStruct ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoSimpleTypesAsStruct", array( - new SoapParam(new SoapVar("arg",XSD_STRING), "inputString"), - new SoapParam(new SoapVar(34,XSD_INT), "inputInteger"), - new SoapParam(new SoapVar(34.345,XSD_FLOAT), "inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt deleted file mode 100644 index 97fece7aab9db..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 002 (php/wsdl): echoSimpleTypesAsStruct ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoSimpleTypesAsStruct("arg",34,34.345); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3434.345 - -arg3434.345 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt deleted file mode 100644 index 80dff6d5be275..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 003 (php/direct): echo2DStringArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -row0col0row0col1row0col2row1col0row1col1row1col2 - -row0col0row0col1row0col2row1col0row1col1row1col2 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt deleted file mode 100644 index 5161144fee363..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 003 (soap/direct): echo2DStringArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -row0col0row0col1row0col2row1col0row1col1row1col2 - -row0col0row0col1row0col2row1col0row1col1row1col2 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt deleted file mode 100644 index 5d4ad0cfc65b3..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 003 (php/wsdl): echo2DStringArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echo2DStringArray($param); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -row0col0row0col1row0col2row1col0row1col1row1col2 - -row0col0row0col1row0col2row1col0row1col1row1col2 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt deleted file mode 100644 index fbeb9afd57f80..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 004 (php/direct): echoNestedStruct ---SKIPIF-- - ---FILE-- - "arg", - 'varInt' => 34, - 'varFloat' => 123.45, - 'varStruct' => (object)array( - 'varString' => "arg2", - 'varInt' => 342, - 'varFloat' => 123.452, - )); - -$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34123.45arg2342123.452 - -arg34123.45arg2342123.452 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt deleted file mode 100644 index ad18c2b432959..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 004 (soap/direct): echoNestedStruct ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34123.45arg2342123.452 - -arg34123.45arg2342123.452 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt deleted file mode 100644 index 4bbc51f1276da..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 004 (php/wsdl): echoNestedStruct ---SKIPIF-- - ---FILE-- - "arg", - 'varInt' => 34, - 'varFloat' => 123.45, - 'varStruct' => (object)array( - 'varString' => "arg2", - 'varInt' => 342, - 'varFloat' => 123.452, - )); - -$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoNestedStruct($param); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34123.45arg2342123.452 - -arg34123.45arg2342123.452 -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt deleted file mode 100644 index 61298389e3a32..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 005 (php/direct): echoNestedArray ---SKIPIF-- - ---FILE-- -'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varArray' => array('red','blue','green')); -$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325redbluegreen - -arg34325.325redbluegreen -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt deleted file mode 100644 index fcb599009384a..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 005 (soap/direct): echoNestedArray ---SKIPIF-- - ---FILE-- -"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325redbluegreen - -arg34325.325redbluegreen -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt deleted file mode 100644 index 206fca84e9826..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP Interop Round2 groupB 005 (php/wsdl): echoNestedArray ---SKIPIF-- - ---FILE-- -'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varArray' => array('red','blue','green')); -$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoNestedArray($param); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round2_groupB.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325redbluegreen - -arg34325.325redbluegreen -ok diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc deleted file mode 100644 index ef00e3bfd0a4d..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc +++ /dev/null @@ -1,37 +0,0 @@ - $struct->varString, - 'outputInteger' => $struct->varInt, - 'outputFloat' => $struct->varFloat); - } - - function echoSimpleTypesAsStruct($string, $int, $float) - { - return (object)array("varString" => $string, - "varInt" => $int, - "varFloat" => $float); - } - - function echoNestedStruct($struct) - { - return $struct; - } - - function echo2DStringArray($ary) - { - return $ary; - } - - function echoNestedArray($ary) - { - return $ary; - } -} - -$server = new SoapServer(dirname(__FILE__)."/round2_groupB.wsdl"); -$server->setClass("SOAP_Interop_GroupB"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl deleted file mode 100644 index 8fc2a1b119281..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round2/GroupB/skipif.inc b/ext/soap/tests/interop/Round2/GroupB/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round2/GroupB/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl deleted file mode 100644 index 26ab6dbdd1085..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl deleted file mode 100644 index 8a397bc0bb07a..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd deleted file mode 100644 index b35eded4f057a..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt deleted file mode 100644 index 4b37558d1c3b8..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Compound1 001 (php/wsdl): echoPerson ---SKIPIF-- - ---FILE-- -Age = $a; - $this->ID = $i; - $this->Name = $n; - $this->Male = $m; - } -} -$person = new Person(32,12345,'Shane',TRUE); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoPerson($person); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_compound1.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3212345 - -3212345 -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt deleted file mode 100644 index ab9a44ad7de98..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Compound1 002 (php/wsdl): echoDocument ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDocument("Test Document Here"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_compound1.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Test Document Here - -Test Document Here -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt deleted file mode 100644 index d8ccc8286c157..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Compound1 003 (php/wsdl): echoDocument ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDocument((object)array("_"=>"Test Document Here","ID"=>1)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_compound1.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Test Document Here - -Test Document Here -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt deleted file mode 100644 index 9aa448ce9e045..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Compound2 001 (php/wsdl): echoEmployee ---SKIPIF-- - ---FILE-- -Age = $a; - $this->ID = $i; - $this->Name = $n; - $this->Male = $m; - } -} -class Employee { - function Employee($person=NULL,$id=NULL,$salary=NULL) { - $this->person = $person; - $this->ID = $id; - $this->salary = $salary; - } -} -$person = new Person(32,12345,'Shane',TRUE); -$employee = new Employee($person,12345,1000000.00); - -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound2.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoEmployee($employee); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_compound2.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Shanetrue100000012345 - -Shanetrue100000012345 -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt deleted file mode 100644 index ed9fb50e743d3..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt deleted file mode 100644 index ec005444b712f..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit 002 (php/wsdl): echoStringArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -onetwothree - -onetwothree -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt deleted file mode 100644 index 36b26ceb3c563..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit 003 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -325.32534arg - -325.32534arg -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt deleted file mode 100644 index ecd6bf01ea74a..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit 004 (php/wsdl): echoVoid ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVoid(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt deleted file mode 100644 index fa5269ad7afd9..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit Parameters 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(array("param0"=>"Hello World")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclitparams.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt deleted file mode 100644 index be1b51b4d7ae8..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit Parameters 002 (php/wsdl): echoStringArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array("param0"=>array("one","two","three"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclitparams.inc"); -echo "ok\n"; -?> ---EXPECT-- - -onetwothree - -onetwothree -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt deleted file mode 100644 index da94cedde0efd..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit Parameters 003 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct(array("param0"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclitparams.inc"); -echo "ok\n"; -?> ---EXPECT-- - -325.32534arg - -325.32534arg -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt deleted file mode 100644 index fcad37659a2cd..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Doc Lit Parameters 004 (php/wsdl): echoVoid ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVoid(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_doclitparams.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt deleted file mode 100644 index 1f74fe6a4f023..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD EmptySA 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_emptysa.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt deleted file mode 100644 index 8c760cc92807e..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Import1 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_import1.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt deleted file mode 100644 index 53ac18bafd2a5..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Import2 001 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import2.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_import2.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt deleted file mode 100644 index 2a4d656076471..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Import3 001 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_import3.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt deleted file mode 100644 index b3e2d7b1219f3..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD Import3 002 (php/wsdl): echoStructArray ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStructArray(array($struct,$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_import3.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325arg34325.325 - -arg34325.325arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt deleted file mode 100644 index 3bc4b4e068a33..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD RPC Encoded 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt deleted file mode 100644 index a3fc99d27ef16..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD RPC Encoded 002 (php/wsdl): echoStringArray ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringArray(array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -onetwothree - -onetwothree -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt deleted file mode 100644 index 2ebd90b499068..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD RPC Encoded 003 (php/wsdl): echoStruct ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoStruct($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -325.32534arg - -325.32534arg -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt deleted file mode 100644 index 732dfcce3844c..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupD RPC Encoded 004 (php/wsdl): echoVoid ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVoid(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupD_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc deleted file mode 100644 index 0525b0b51a4e6..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc +++ /dev/null @@ -1,17 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl deleted file mode 100644 index 6a8f85182ed4f..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc deleted file mode 100644 index 81b96cdbffbeb..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc +++ /dev/null @@ -1,12 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl deleted file mode 100644 index e8b63e0157a6d..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc deleted file mode 100644 index 8ca0338f5f0aa..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc +++ /dev/null @@ -1,28 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl deleted file mode 100644 index 4febca899450f..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc deleted file mode 100644 index 2042cfc179e85..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc +++ /dev/null @@ -1,29 +0,0 @@ -$inputString->param0); - } - - function echoStringArray($inputStringArray) - { - return array("return"=>$inputStringArray->param0); - } - - function echoStruct($inputStruct) - { - return array("return"=>$inputStruct->param0); - } - - function echoVoid() - { - return NULL; - } - -} - -$server = new SoapServer(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl"); -$server->setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl deleted file mode 100644 index 9ecf1e170b42d..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc deleted file mode 100644 index b239c4543820c..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc +++ /dev/null @@ -1,14 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl deleted file mode 100644 index 09a09a4cd0ebd..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc deleted file mode 100644 index 2e56d1897a259..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc +++ /dev/null @@ -1,14 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl deleted file mode 100644 index d92883000ed81..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc deleted file mode 100644 index a0893c6b7ceef..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc +++ /dev/null @@ -1,14 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl deleted file mode 100644 index fc0f8ae7fa1c7..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl deleted file mode 100644 index fc0f8ae7fa1c7..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc deleted file mode 100644 index 398f97ecf3df5..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc +++ /dev/null @@ -1,19 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl deleted file mode 100644 index 3dd264208be4a..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc deleted file mode 100644 index 645ab3a61c48c..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc +++ /dev/null @@ -1,28 +0,0 @@ -setClass("SOAP_Interop_GroupD"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl deleted file mode 100644 index 5e24411a378db..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupD/skipif.inc b/ext/soap/tests/interop/Round3/GroupD/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupD/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt deleted file mode 100644 index 1221e05b5c530..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 001 (php/wsdl): echoLinkedList ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = new SOAPList('arg1',1,NULL); -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg1 - -1arg1 -object(stdClass)#5 (3) { - ["varInt"]=> - int(1) - ["varString"]=> - string(4) "arg1" - ["child"]=> - NULL -} -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt deleted file mode 100644 index a56b3fb62d047..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 002 (php/wsdl): echoLinkedList ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = new SOAPList('arg1',1, new SOAPList('arg2',2,NULL)); -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg12arg2 - -1arg12arg2 -object(stdClass)#6 (3) { - ["varInt"]=> - int(1) - ["varString"]=> - string(4) "arg1" - ["child"]=> - object(stdClass)#7 (3) { - ["varInt"]=> - int(2) - ["varString"]=> - string(4) "arg2" - ["child"]=> - NULL - } -} -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt deleted file mode 100644 index ce86f0f66e5aa..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 003 (php/wsdl): echoLinkedList ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL))); -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg12arg23arg3 - -1arg12arg23arg3 -object(stdClass)#7 (3) { - ["varInt"]=> - int(1) - ["varString"]=> - string(4) "arg1" - ["child"]=> - object(stdClass)#8 (3) { - ["varInt"]=> - int(2) - ["varString"]=> - string(4) "arg2" - ["child"]=> - object(stdClass)#9 (3) { - ["varInt"]=> - int(3) - ["varString"]=> - string(4) "arg3" - ["child"]=> - NULL - } - } -} -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt deleted file mode 100644 index 3fa8da4cd5391..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 004 (php/wsdl): echoLinkedList ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = NULL; -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -NULL -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt deleted file mode 100644 index e66bbb7a21655..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 005 (php/wsdl): echoLinkedList (cyclic) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL))); -$struct->child->child->child = $struct; -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg12arg23arg3 - -1arg12arg23arg3 -object(stdClass)#7 (3) { - ["varInt"]=> - int(1) - ["varString"]=> - string(4) "arg1" - ["child"]=> - object(stdClass)#8 (3) { - ["varInt"]=> - int(2) - ["varString"]=> - string(4) "arg2" - ["child"]=> - object(stdClass)#9 (3) { - ["varInt"]=> - int(3) - ["varString"]=> - string(4) "arg3" - ["child"]=> - NULL - } - } -} -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt deleted file mode 100644 index 49584874d7738..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupE List 006 (php/wsdl): echoLinkedList (cyclic) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->child = $c; - } -} -$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL))); -$struct->child->child->child = $struct->child; -$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoLinkedList($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupE_list.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg12arg23arg3 - -1arg12arg23arg3 -object(stdClass)#7 (3) { - ["varInt"]=> - int(1) - ["varString"]=> - string(4) "arg1" - ["child"]=> - object(stdClass)#8 (3) { - ["varInt"]=> - int(2) - ["varString"]=> - string(4) "arg2" - ["child"]=> - object(stdClass)#9 (3) { - ["varInt"]=> - int(3) - ["varString"]=> - string(4) "arg3" - ["child"]=> - NULL - } - } -} -ok diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc deleted file mode 100644 index 83454c0774439..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc +++ /dev/null @@ -1,17 +0,0 @@ -setClass("SOAP_Interop_GroupE"); -$server->handle(); -var_dump($d); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl deleted file mode 100644 index 49e6a8c4c32a0..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupE/skipif.inc b/ext/soap/tests/interop/Round3/GroupE/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupE/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt deleted file mode 100644 index ecfb3a19a357b..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Extensibility 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupF_ext.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt deleted file mode 100644 index 05abe3b86a7e2..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Extensibility Required 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -//$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -//include("round3_groupF_extreq.inc"); -echo "ok\n"; -?> ---EXPECTF-- -Fatal error: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %sr3_groupF_extreq_001w.php on line %d diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt deleted file mode 100644 index 958bdda738965..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Headers 001 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupF_headers.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt deleted file mode 100644 index b60957b20e347..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Headers 002 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -34,"string"=>"arg")); -$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString",array("Hello World"),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupF_headers.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt deleted file mode 100644 index 1426c07e8a1d2..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Headers 003 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -34,"string"=>"arg")); -$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString",array("Hello World"),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupF_headers.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34argHello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt deleted file mode 100644 index db99a7fd13a40..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP Interop Round3 GroupF Headers 004 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -34,"string"=>"arg1")), - new SoapHeader("http://soapinterop.org/xsd","Header2", array("int"=>43,"string"=>"arg2")) -); -$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoString",array("Hello World"),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round3_groupF_headers.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg13443arg2Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc deleted file mode 100644 index 44bc83bdce24d..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc +++ /dev/null @@ -1,14 +0,0 @@ -setClass("SOAP_Interop_GroupF"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl deleted file mode 100644 index 74ec01805152c..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl deleted file mode 100644 index 8dfd65ec98173..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc deleted file mode 100644 index ee65811197fea..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc +++ /dev/null @@ -1,22 +0,0 @@ -setClass("SOAP_Interop_GroupF"); -$server->handle(); -?> \ No newline at end of file diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl deleted file mode 100644 index d03fc32e395e5..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round3/GroupF/skipif.inc b/ext/soap/tests/interop/Round3/GroupF/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round3/GroupF/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc deleted file mode 100644 index c2a27186d7c42..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc +++ /dev/null @@ -1,33 +0,0 @@ -setClass("SOAP_Interop_GroupG"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl deleted file mode 100644 index f82216e6fe317..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc deleted file mode 100644 index 2f3c00aa1c466..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc +++ /dev/null @@ -1,33 +0,0 @@ -setClass("SOAP_Interop_GroupG"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl deleted file mode 100644 index d837da0c62fcd..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc deleted file mode 100644 index 8ed272ed1d4c9..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc +++ /dev/null @@ -1,25 +0,0 @@ -setClass("SOAP_Interop_GroupG"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl deleted file mode 100644 index c67172e8c6158..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc deleted file mode 100644 index 8ed272ed1d4c9..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc +++ /dev/null @@ -1,25 +0,0 @@ -setClass("SOAP_Interop_GroupG"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl deleted file mode 100644 index 30a56d12f6813..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupG/skipif.inc b/ext/soap/tests/interop/Round4/GroupG/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupG/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt deleted file mode 100644 index c95d3d1693db4..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 001 (php/wsdl): echoSOAPStructFault ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoSOAPStructFault($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -SOAP-ENV:ServerFault in response to 'echoSOAPStructFault'.arg34325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt deleted file mode 100644 index ce7d00b619f2b..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 002 (php/wsdl): echoBaseStructFault ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -$struct = new BaseStruct(new SOAPStruct("a1",11,12.345),11); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoBaseStructFault($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -a11112.34511 - -SOAP-ENV:ServerFault in response to 'echoBaseStructFault'.a11112.34511 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt deleted file mode 100644 index c9f31e00d8522..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 003 (php/wsdl): echoExtendedStructFault ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -$struct = new ExtendedStruct(new SOAPStruct("a1",11,12.345),12,"arg",-3,5); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoExtendedStructFault($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -a11112.34512arg-35 - -SOAP-ENV:ServerFault in response to 'echoExtendedStructFault'.a11112.34512arg-35 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt deleted file mode 100644 index 4c917b73ef201..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 004 (php/wsdl): echoMultipleFaults1(1) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg1',34,325.325); -$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 1, - "param1" => $s1, - "param2" => $s2)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg134325.325arg234325.32512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.arg134325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt deleted file mode 100644 index 1a50cfa4a0838..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 005 (php/wsdl): echoMultipleFaults1(2) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg1',34,325.325); -$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 2, - "param1" => $s1, - "param2" => $s2)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2arg134325.325arg234325.32512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.arg234325.32512 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt deleted file mode 100644 index 88302b817a15f..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 006 (php/wsdl): echoMultipleFaults1(3) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg1',34,325.325); -$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 3, - "param1" => $s1, - "param2" => $s2)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3arg134325.325arg234325.32512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.arg134325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt deleted file mode 100644 index 77f3b24d538e6..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 007 (php/wsdl): echoMultipleFaults2(1) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1); -$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5); -$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 1, - "param1" => $s1, - "param2" => $s2, - "param3" => $s3)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1s111.11s222.22arg-35s333.33arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.s111.11 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt deleted file mode 100644 index aebb9e9ef5bba..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 008 (php/wsdl): echoMultipleFaults2(2) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1); -$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5); -$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 2, - "param1" => $s1, - "param2" => $s2, - "param3" => $s3)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2s111.11s222.22arg-35s333.33arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.s222.22arg-35 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt deleted file mode 100644 index a27c2ad012530..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 009 (php/wsdl): echoMultipleFaults2(3) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1); -$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5); -$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 3, - "param1" => $s1, - "param2" => $s2, - "param3" => $s3)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3s111.11s222.22arg-35s333.33arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.s333.33arg-35true diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt deleted file mode 100644 index adf98fc2596d0..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex Doc Lit 010 (php/wsdl): echoMultipleFaults2(4) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->structMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1); -$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5); -$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 4, - "param1" => $s1, - "param2" => $s2, - "param3" => $s3)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -4s111.11s222.22arg-35s333.33arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.s111.11 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt deleted file mode 100644 index b42bae918ef16..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 001 (php/wsdl): echoSOAPStructFault ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPStruct('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoSOAPStructFault(array("soapStruct"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg34325.325 - -SOAP-ENV:ServerFault in response to 'echoSOAPStructFault'.arg34325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt deleted file mode 100644 index 7368213d1865b..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 002 (php/wsdl): echoBaseStructFault ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -$struct = new BaseStruct(12.345,12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoBaseStructFault($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12.34512 - -SOAP-ENV:ServerFault in response to 'echoBaseStructFault'.12.34512 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt deleted file mode 100644 index ee05b4c3fab8c..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 003 (php/wsdl): echoExtendedStructFault ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -$struct = new ExtendedStruct(12.345,12,"arg",-3,5); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoExtendedStructFault($struct); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12.34512arg-35 - -SOAP-ENV:ServerFault in response to 'echoExtendedStructFault'.12.34512arg-35 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt deleted file mode 100644 index 76202308fc266..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 004 (php/wsdl): echoMultipleFaults1(1) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->floatMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg',34,325.325); -$s2 = new BaseStruct(12.345,12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(1,$s1,$s2); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg34325.32512.34512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.arg34325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt deleted file mode 100644 index f4395d3b987ae..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 005 (php/wsdl): echoMultipleFaults1(2) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->floatMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg',34,325.325); -$s2 = new BaseStruct(12.345,12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(2,$s1,$s2); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2arg34325.32512.34512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.12.34512 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt deleted file mode 100644 index 1d41c296581b6..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 006 (php/wsdl): echoMultipleFaults1(3) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class BaseStruct { - function BaseStruct($f, $s) { - $this->floatMessage = $f; - $this->shortMessage = $s; - } -} -$s1 = new SOAPStruct('arg',34,325.325); -$s2 = new BaseStruct(12.345,12); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults1(3,$s1,$s2); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3arg34325.32512.34512 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.arg34325.325 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt deleted file mode 100644 index 1184b41e46f8b..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 007 (php/wsdl): echoMultipleFaults2(1) ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(12.345,1); -$s2 = new ExtendedStruct(12.345,2,"arg",-3,5); -$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(1,$s1,$s2,$s3); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -112.345112.3452arg-3512.3453arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.3451 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt deleted file mode 100644 index 0d0a800fa1954..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 008 (php/wsdl): echoMultipleFaults2(2) ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(12.345,1); -$s2 = new ExtendedStruct(12.345,2,"arg",-3,5); -$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(2,$s1,$s2,$s3); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -212.345112.3452arg-3512.3453arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.3452arg-35 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt deleted file mode 100644 index 21f643a569042..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 009 (php/wsdl): echoMultipleFaults2(3) ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(12.345,1); -$s2 = new ExtendedStruct(12.345,2,"arg",-3,5); -$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(3,$s1,$s2,$s3); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -312.345112.3452arg-3512.3453arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.3453arg-35true diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt deleted file mode 100644 index 7cf18fb366e21..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Complex RPC Enc 010 (php/wsdl): echoMultipleFaults2(4) ---SKIPIF-- - ---FILE-- -floatMessage = $f; - $this->shortMessage = $s; - } -} -class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); - $this->stringMessage = $x1; - $this->intMessage = $x2; - $this->anotherIntMessage = $x3; - } -} -class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); - $this->booleanMessage = $b; - } -} -$s1 = new BaseStruct(12.345,1); -$s2 = new ExtendedStruct(12.345,2,"arg",-3,5); -$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true); -$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoMultipleFaults2(4,$s1,$s2,$s3); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_complex_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -412.345112.3452arg-3512.3453arg-35true - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.3451 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt deleted file mode 100644 index ac473c88d7771..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 001 (php/wsdl): echoEmptyFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoEmptyFault(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - -SOAP-ENV:ServerFault in response to 'echoEmptyFault'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt deleted file mode 100644 index ff4014da3fc64..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 002 (php/wsdl): echoStringFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringFault("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -SOAP-ENV:ServerFault in response to 'echoStringFault'.Hello World diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt deleted file mode 100644 index 26c62476db1d3..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 003 (php/wsdl): echoIntArrayFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoIntArrayFault(array(34,12.345)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3412 - -SOAP-ENV:ServerFault in response to 'echoIntArrayFault'.3412 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt deleted file mode 100644 index 4abff69f66c36..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 004 (php/wsdl): echoMultipleFaults1(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 1, - "param1" => "Hello world", - "param2" => array(12.345,45,678))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt deleted file mode 100644 index b290e4da880c8..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 005 (php/wsdl): echoMultipleFaults1(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 2, - "param1" => "Hello world", - "param2" => array(12.345,45,678))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.Hello world diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt deleted file mode 100644 index d857dc3546c5e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 006 (php/wsdl): echoMultipleFaults1(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 3, - "param1" => "Hello world", - "param2" => array(12.345,45,678))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.12.34545678 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt deleted file mode 100644 index 02517c0039256..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 007 (php/wsdl): echoMultipleFaults1(4) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(array("whichFault" => 4, - "param1" => "Hello world", - "param2" => array(12.345,45,678))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -4Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt deleted file mode 100644 index 691ebda7be7d7..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 008 (php/wsdl): echoMultipleFaults2(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 1, - "param1" => "Hello world", - "param2" => 12.345, - "param3" => array("one","two","three"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1Hello world12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.345 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt deleted file mode 100644 index 2af8b01016690..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 009 (php/wsdl): echoMultipleFaults2(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 2, - "param1" => "Hello world", - "param2" => 12.345, - "param3" => array("one","two","three"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2Hello world12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.Hello world diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt deleted file mode 100644 index 594c444f2bf00..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 010 (php/wsdl): echoMultipleFaults2(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 3, - "param1" => "Hello world", - "param2" => 12.345, - "param3" => array("one","two","three"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3Hello world12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.onetwothree diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt deleted file mode 100644 index 21389c0b5f955..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 011 (php/wsdl): echoMultipleFaults2(4) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(array("whichFault" => 4, - "param1" => "Hello world", - "param2" => 12.345, - "param3" => array("one","two","three"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -4Hello world12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.345 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt deleted file mode 100644 index 3e2e41dd33d3c..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 012 (php/wsdl): echoMultipleFaults3(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(array("whichFault" => 1, - "param1" => "arg1", - "param2" => "arg2")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt deleted file mode 100644 index 8b847a85ec719..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 013 (php/wsdl): echoMultipleFaults3(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(array("whichFault" => 2, - "param1" => "arg1", - "param2" => "arg2")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg2 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt deleted file mode 100644 index 3a3e61a4644d6..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 014 (php/wsdl): echoMultipleFaults3(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(array("whichFault" => 3, - "param1" => "arg1", - "param2" => "arg2")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt deleted file mode 100644 index b831484d70df0..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 015 (php/wsdl): echoMultipleFaults4(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(array("whichFault" => 1, - "param1" => 162, - "param2" => 1)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -11621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.162 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt deleted file mode 100644 index cbf7f16f28b5d..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 016 (php/wsdl): echoMultipleFaults4(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(array("whichFault" => 2, - "param1" => 162, - "param2" => 1)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -21621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt deleted file mode 100644 index aa7e28527a275..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple Doc Lit 017 (php/wsdl): echoMultipleFaults4(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(array("whichFault" => 3, - "param1" => 162, - "param2" => 1)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_doclit.inc"); -echo "ok\n"; -?> ---EXPECT-- - -31621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.162 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt deleted file mode 100644 index 681883874760b..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 001 (php/wsdl): echoEmptyFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoEmptyFault(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - -SOAP-ENV:ServerFault in response to 'echoEmptyFault'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt deleted file mode 100644 index 20dad785f5f30..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 002 (php/wsdl): echoStringFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringFault("Hello World"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -SOAP-ENV:ServerFault in response to 'echoStringFault'.Hello World diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt deleted file mode 100644 index eb7638371c93a..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 003 (php/wsdl): echoIntArrayFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoIntArrayFault(array(34,12.345)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3412 - -SOAP-ENV:ServerFault in response to 'echoIntArrayFault'.3412 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt deleted file mode 100644 index c095b486d1241..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 004 (php/wsdl): echoMultipleFaults1(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(1,"Hello world",array(12.345,45,678)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt deleted file mode 100644 index e2c706bd0a7ed..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 005 (php/wsdl): echoMultipleFaults1(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(2,"Hello world",array(12.345,45,678)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.Hello world diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt deleted file mode 100644 index e4a397d8e1ea7..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 006 (php/wsdl): echoMultipleFaults1(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(3,"Hello world",array(12.345,45,678)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'.12.34545678 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt deleted file mode 100644 index b879fe3a3dfba..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 007 (php/wsdl): echoMultipleFaults1(4) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults1(4,"Hello world",array(12.345,45,678)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -4Hello world12.34545678 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults1'. diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt deleted file mode 100644 index 057ff4d54fc8d..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 008 (php/wsdl): echoMultipleFaults2(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(1, "Hello World", 12.345, array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1Hello World12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.345 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt deleted file mode 100644 index 18f1d8d23dff2..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 009 (php/wsdl): echoMultipleFaults2(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(2, "Hello World", 12.345, array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2Hello World12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.Hello World diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt deleted file mode 100644 index faca6c12255ea..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 010 (php/wsdl): echoMultipleFaults2(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(3, "Hello World", 12.345, array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3Hello World12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.onetwothree diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt deleted file mode 100644 index 5e93891589170..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 011 (php/wsdl): echoMultipleFaults2(4) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults2(4, "Hello World", 12.345, array("one","two","three")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -4Hello World12.345onetwothree - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults2'.12.345 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt deleted file mode 100644 index 073a2a0f797ce..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 012 (php/wsdl): echoMultipleFaults3(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(1,"arg1","arg2"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -1arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt deleted file mode 100644 index b0113ae34234e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 013 (php/wsdl): echoMultipleFaults3(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(2,"arg1","arg2"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg2 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt deleted file mode 100644 index ee5b4cb0e6a0e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 014 (php/wsdl): echoMultipleFaults3(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults3(3,"arg1","arg2"); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3arg1arg2 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults3'.arg1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt deleted file mode 100644 index 4a9cb4a81674c..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 015 (php/wsdl): echoMultipleFaults4(1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(1, 162, 1); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -11621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.162 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt deleted file mode 100644 index d8a47d009ad94..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 016 (php/wsdl): echoMultipleFaults4(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(2, 162, 1); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -21621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.1 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt deleted file mode 100644 index 5aaec3088f637..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH Simple RPC Enc 017 (php/wsdl): echoMultipleFaults4(3) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoMultipleFaults4(3, 162, 1); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_simple_rpcenc.inc"); -echo "ok\n"; -?> ---EXPECT-- - -31621 - -SOAP-ENV:ServerFault in response to 'echoMultipleFaults4'.162 diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt deleted file mode 100644 index d50637afe1857..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH SoapFault 001 (php/wsdl): echoVersionMismatchFault(SOAP 1.1) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVersionMismatchFault(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_soapfault.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt deleted file mode 100644 index f31cd7c6a5b82..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH SoapFault 002 (php/wsdl): echoVersionMismatchFault(SOAP 1.2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0,"soap_version"=>SOAP_1_2)); -$client->echoVersionMismatchFault(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_soapfault.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt deleted file mode 100644 index 398d70eb7c2ec..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH SoapFault 003 (php/wsdl): echoVersionMismatchFault(unknown version) ---SKIPIF-- - ---FILE-- - - -EOF; -echo $HTTP_RAW_POST_DATA."\n"; -include("round4_groupH_soapfault.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - -SOAP-ENV:VersionMismatchWrong Version diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt deleted file mode 100644 index 11069bc58e8d0..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupH SoapFault 004 (php/wsdl): echoMustUnderstandFault ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->__soapCall("echoVersionMismatchFault",array(), null, $hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupH_soapfault.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -SOAP-ENV:MustUnderstandHeader not understood diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc deleted file mode 100644 index 1c31aa3da08d0..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc +++ /dev/null @@ -1,38 +0,0 @@ -$input), "ComplexFault"); - } - - function echoBaseStructFault($input) { - return new SoapFault("Server", "Fault in response to 'echoBaseStructFault'.", null, $input, "ComplexFault"); - } - - function echoExtendedStructFault($input) { - return new SoapFault("Server", "Fault in response to 'echoExtendedStructFault'.", null, $input, "ComplexFault"); - } - - function echoMultipleFaults1($input) { - if ($input->whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "ComplexFault2"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, array("soapStruct"=>$input->param1), "ComplexFault1"); - } - } - - function echoMultipleFaults2($input) { - if ($input->whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "ComplexFault2"); - } else if ($input->whichFault == 3) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "ComplexFault3"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "ComplexFault1"); - } - } -} - -$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl"); -$server->setClass("SOAP_Interop_GroupH"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl deleted file mode 100644 index f1c383dc1db5f..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc deleted file mode 100644 index 6dec186474f1d..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc +++ /dev/null @@ -1,38 +0,0 @@ -$s1), "ComplexFault1"); - } - } - - function echoMultipleFaults2($which, $s1, $s2, $s3) { - if ($which == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s2, "ComplexFault2"); - } else if ($which == 3) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s3, "ComplexFault3"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s1, "ComplexFault1"); - } - } -} - -$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl"); -$server->setClass("SOAP_Interop_GroupH"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl deleted file mode 100644 index e78ca38ea541e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc deleted file mode 100644 index 6a04cfd2d94bc..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc +++ /dev/null @@ -1,56 +0,0 @@ -whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param1, "SimpleFault2"); - } else if ($input->whichFault == 3) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "SimpleFault3"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, null, "SimpleFault1"); - } - } - - function echoMultipleFaults2($input) { - if ($input->whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "SimpleFault1"); - } else if ($input->whichFault == 3) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "SimpleFault3"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "SimpleFault2"); - } - } - - function echoMultipleFaults3($input) { - if ($input->whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param2, "SimpleFault2"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param1, "SimpleFault1"); - } - } - - function echoMultipleFaults4($input) { - if ($input->whichFault == 2) { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param2, "SimpleFault2"); - } else { - return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param1, "SimpleFault1"); - } - } -} - -$server = new SoapServer(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl"); -$server->setClass("SOAP_Interop_GroupH"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl deleted file mode 100644 index 8f0d322173fb5..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc deleted file mode 100644 index 0b85a34f9977e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc +++ /dev/null @@ -1,56 +0,0 @@ -setClass("SOAP_Interop_GroupH"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl deleted file mode 100644 index 24f73fcb0eb24..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc deleted file mode 100644 index cf6c3741c6ce2..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc +++ /dev/null @@ -1,22 +0,0 @@ -setClass("SOAP_Interop_GroupH"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl deleted file mode 100644 index 4f49b8f1b2402..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/interop/Round4/GroupH/skipif.inc b/ext/soap/tests/interop/Round4/GroupH/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupH/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt deleted file mode 100644 index 2ed20e94b3e70..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 001 (php/wsdl): echoVoid ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoVoid(); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt deleted file mode 100644 index 27ff0fcc6bbac..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 002 (php/wsdl): echoInteger ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoInteger(array("inputInteger"=>22)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -22 - -22 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt deleted file mode 100644 index 29ea32c000506..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 003 (php/wsdl): echoFloat ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoFloat(array("inputFloat"=>12.345)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -12.345 - -12.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt deleted file mode 100644 index 3e765bbdc1a0f..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 004 (php/wsdl): echoString ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(array("inputString"=>"Hello World")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt deleted file mode 100644 index 6960190b65476..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 005 (php/wsdl): echoString(empty) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoString(array()); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt deleted file mode 100644 index c9d953407030e..0000000000000 Binary files a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt and /dev/null differ diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt deleted file mode 100644 index ddde658fb6fe5..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 007 (php/wsdl): echoDate ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDate(array("inputDate"=>"2002-12-22T21:41:17Z")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -2002-12-22T21:41:17Z - -2002-12-22T21:41:17Z -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt deleted file mode 100644 index 23dc33bdcde44..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 008 (php/wsdl): echoComplexType ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexType(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34arg325.325 - -34arg325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt deleted file mode 100644 index 9182029fbf87f..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 009 (php/wsdl): echoComplexType(minOccur=0) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -unset($struct->varString); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexType(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34325.325 - -34325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt deleted file mode 100644 index bb6e77f3f0cc5..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 010 (php/wsdl): echoIntegerMultiOccurs ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoIntegerMultiOccurs(array("inputIntegerMultiOccurs"=>array(22,29,36))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -222936 - -222936 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt deleted file mode 100644 index 4b268a7d4975a..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 011 (php/wsdl): echoFloatMultiOccurs ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoFloatMultiOccurs(array("inputFloatMultiOccurs"=>array(22.5,12.345))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -22.512.345 - -22.512.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt deleted file mode 100644 index c2c47f4c702d4..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 012 (php/wsdl): echoStringMultiOccurs ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1","arg2","arg3"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg1arg2arg3 - -arg1arg2arg3 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt deleted file mode 100644 index a42f79f867f0e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 013 (php/wsdl): echoStringMultiOccurs(nil) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1",NULL,"arg3"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg1arg3 - -arg1arg3 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt deleted file mode 100644 index 0da7004009d5e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 014 (php/wsdl): echoComplexTypeMultiOccurs(1) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,$struct,$struct))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34arg325.32534arg325.32534arg325.325 - -34arg325.32534arg325.32534arg325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt deleted file mode 100644 index 63f551448e126..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 015 (php/wsdl): echoComplexTypeMultiOccurs(nil) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,null,$struct))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34arg325.32534arg325.325 - -34arg325.32534arg325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt deleted file mode 100644 index a5f060cae13c0..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 016 (php/wsdl): echoDecimal ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoDecimal(array("inputDecimal"=>"123456789.123456789")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -123456789.123456789 - -123456789.123456789 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt deleted file mode 100644 index 08900ac5e598f..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 017 (php/wsdl): echoBoolean ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoBoolean(array("inputBoolean"=>true)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -true - -true -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt deleted file mode 100644 index 73b5b68ba807e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 018 (php/wsdl): echoHexBinary ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoHexBinary(array("inputHexBinary"=>"\x80\xFF\x00\x01\x7F")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -80FF00017F - -80FF00017F -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt deleted file mode 100644 index 4b81f6e674583..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 019 (php/wsdl): echoComplexTypeAsSimpleTypes ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34arg325.325 - -arg34325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt deleted file mode 100644 index afc8ece102992..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 020 (php/wsdl): echoComplexTypeAsSimpleTypes(minOccurs=0) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -unset($struct->varString); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34325.325 - -34325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt deleted file mode 100644 index cd92d5116a0e7..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 021 (php/wsdl): echoSimpleTypesAsComplexType ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34, - "inputFloat"=>12.345, - "inputString"=>"arg")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.345 - -34arg12.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt deleted file mode 100644 index cd408dfb4c527..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 022 (php/wsdl): echoSimpleTypesAsComplexType(minOccurs=0) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34, - "inputFloat"=>12.345)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3412.345 - -3412.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt deleted file mode 100644 index d960748ce8673..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 023 (php/wsdl): echoNestedComplexType ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -class SOAPComplexTypeComplexType { - function SOAPComplexTypeComplexType($s, $i, $f, $c) { - $this->varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - $this->varComplexType = $c; - } -} -$struct = new SOAPComplexTypeComplexType("arg",34,12.345,new SOAPComplexType("arg",43,54.321)); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoNestedComplexType(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.34543arg54.321 - -arg3412.34543arg54.321 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt deleted file mode 100644 index 4152b992c76bc..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 024 (php/wsdl): echoNestedComplexType(minOccurs=0) ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - $this->varComplexType = $c; - } -} -$struct = new SOAPComplexTypeComplexType("arg",34,12.345,NULL); -unset($struct->varComplexType); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoNestedComplexType(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.345 - -arg3412.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt deleted file mode 100644 index cba1d1c667143..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 025 (php/wsdl): echoNestedMultiOccurs ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - $this->varMultiOccurs = $c; - } -} -$struct = new SOAPMultiOccursComplexType("arg",34,12.345,array("red","green","blue")); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoNestedMultiOccurs(array("inputComplexType"=>$struct)); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.345redgreenblue - -arg3412.345redgreenblue -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt deleted file mode 100644 index 07e24f52c68d6..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 026 (php/wsdl): echoChoice ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoChoice(array("inputChoice"=>(object)array("name1"=>"Hello World"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt deleted file mode 100644 index e4a270a21c9d4..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 027 (php/wsdl): echoEnum ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoEnum(array("inputEnum"=>"bitTwo")); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -bitTwo - -bitTwo -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt deleted file mode 100644 index b9e13e2fb6b9e..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 028 (php/wsdl): echoAnyType ---SKIPIF-- - ---FILE-- -varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} -$struct = new SOAPComplexType('arg',34,325.325); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->echoAnyType(array('inputAnyType'=>new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPComplexType","http://soapinterop.org/xsd"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -34arg325.325 - -34arg325.325 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt deleted file mode 100644 index fad222179c0f6..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 029 (php/wsdl): echoAnyElement ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->echoAnyElement(array("inputAny"=>array("any"=>"Hello World"))); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt deleted file mode 100644 index d7f748743c3db..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 030 (php/wsdl): echoVoidSoapHeader(1) ---SKIPIF-- - ---FILE-- -"Hello World"), 1); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt deleted file mode 100644 index b4273bf54b4a7..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 031 (php/wsdl): echoVoidSoapHeader(2) ---SKIPIF-- - ---FILE-- -1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - - - - -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt deleted file mode 100644 index ffd18e3df3192..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 032 (php/wsdl): echoVoidSoapHeader(3) ---SKIPIF-- - ---FILE-- -34,"varString"=>"arg","varFloat"=>12.345), 1); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.345 - -arg3412.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt deleted file mode 100644 index 3c024fc0023d9..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 033 (php/wsdl): echoVoidSoapHeader(4) ---SKIPIF-- - ---FILE-- -34,"varFloat"=>12.345), 1); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -3412.345 - -3412.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt deleted file mode 100644 index d3cec8cda7149..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 034 (php/wsdl): echoVoidSoapHeader(5) ---SKIPIF-- - ---FILE-- -"Hello World"), 1, SOAP_ACTOR_NEXT); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -Hello World - -Hello World -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt deleted file mode 100644 index 6dc0b927ff885..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Interop Round4 GroupI XSD 035 (php/wsdl): echoVoidSoapHeader(6) ---SKIPIF-- - ---FILE-- -34,"varString"=>"arg","varFloat"=>12.345), 1, SOAP_ACTOR_NEXT); -$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0)); -$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr); -echo $client->__getlastrequest(); -$HTTP_RAW_POST_DATA = $client->__getlastrequest(); -include("round4_groupI_xsd.inc"); -echo "ok\n"; -?> ---EXPECT-- - -arg3412.345 - -arg3412.345 -ok diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc deleted file mode 100644 index 0c50f199e471d..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc +++ /dev/null @@ -1,198 +0,0 @@ -inputString)) { - return array("return"=>$inputString->inputString); - } else { - return $inputString; - } - } - - function echoInteger($inputInteger) - { - return array("return"=>$inputInteger->inputInteger); - } - - function echoFloat($inputFloat) - { - return array("return"=>$inputFloat->inputFloat); - } - - function echoVoid() - { - } - - function echoBase64($inputBase64) - { - if (isset($inputBase64->inputBase64)) { - return array("return"=>$inputBase64->inputBase64); - } else { - return $inputBase64; - } - } - - function echoDate($timeInstant) - { - return array("return"=>$timeInstant->inputDate); - } - - function echoComplexType($inputComplexType) - { - if (isset($inputComplexType->inputComplexType)) { - return array("return"=>$inputComplexType->inputComplexType); - } else { - return $inputComplexType; - } - } - - function echoIntegerMultiOccurs($input) - { - if (isset($input->inputIntegerMultiOccurs->int)) { - return array("return"=>$input->inputIntegerMultiOccurs->int); - } else { - return array(); - } - } - - function echoFloatMultiOccurs($input) - { - if (isset($input->inputFloatMultiOccurs->float)) { - return array("return"=>$input->inputFloatMultiOccurs->float); - } else { - return array(); - } - } - - function echoStringMultiOccurs($input) - { - if (isset($input->inputStringMultiOccurs->string)) { - return array("return"=>$input->inputStringMultiOccurs->string); - } else { - return array(); - } - } - - function echoComplexTypeMultiOccurs($input) - { - if (isset($input->inputComplexTypeMultiOccurs->SOAPComplexType)) { - return array("return"=>$input->inputComplexTypeMultiOccurs->SOAPComplexType); - } else { - return array(); - } - } - - function echoHexBinary($hb) - { - if (isset($hb->inputHexBinary)) { - return array("return"=>$hb->inputHexBinary); - } else { - return $hb; - } - } - - function echoDecimal($dec) - { - return array("return"=>$dec->inputDecimal); - } - - function echoBoolean($boolean) - { - return array("return"=>$boolean->inputBoolean); - } - - function echoComplexTypeAsSimpleTypes($input) - { - if (isset($input->inputComplexType)) { - $ret = array("outputInteger" => $input->inputComplexType->varInt, - "outputFloat" => $input->inputComplexType->varFloat); - if (isset($input->inputComplexType->varString)) { - $ret["outputString"] = $input->inputComplexType->varString; - } - return $ret; - } else { - return array(); - } - } - - function echoSimpleTypesAsComplexType($input) - { - $ret = array("varInt" => $input->inputInteger, - "varFloat" => $input->inputFloat); - if (isset($input->inputString)) { - $ret["varString"] = $input->inputString; - } - return array("return"=>$ret); - } - - function echoNestedComplexType($inputComplexType) - { - if (isset($inputComplexType->inputComplexType)) { - return array("return"=>$inputComplexType->inputComplexType); - } else { - return $inputComplexType; - } - } - - function echoNestedMultiOccurs($inputComplexType) - { - if (isset($inputComplexType->inputComplexType)) { - return array("return"=>$inputComplexType->inputComplexType); - } else { - return $inputComplexType; - } - } - - function echoChoice($input) - { - if (isset($input->inputChoice)) { - return array("return"=>$input->inputChoice); - } else { - return $input; - } - } - - function echoEnum($input) - { - return array("return"=>$input->inputEnum); - } - - function echoAnyType($input) - { - if (isset($input->inputAnyType)) { - return array("return"=>$input->inputAnyType); - } else { - return $input; - } - } - - function echoAnyElement($input) - { - if (isset($input->inputAny)) { - return array("return"=>$input->inputAny); - } else { - return $input; - } - } - - function echoVoidSoapHeader() - { - } - - function echoMeStringRequest($input) - { - return new SoapHeader("http://soapinterop.org/","echoMeStringResponse",$input); - } - - function echoMeComplexTypeRequest($input) - { - return new SoapHeader("http://soapinterop.org/","echoMeComplexTypeResponse",$input); - } - -} - -$server = new SoapServer(dirname(__FILE__)."/round4_groupI_xsd.wsdl"); -$server->setClass("SOAP_Interop_GroupI"); -$server->handle(); -?> diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl deleted file mode 100644 index b62084669bf6b..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl +++ /dev/null @@ -1,1113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments. - - - - - - - - \ No newline at end of file diff --git a/ext/soap/tests/interop/Round4/GroupI/skipif.inc b/ext/soap/tests/interop/Round4/GroupI/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/interop/Round4/GroupI/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/schema/schema001.phpt b/ext/soap/tests/schema/schema001.phpt deleted file mode 100644 index 9f2b7e5235d23..0000000000000 --- a/ext/soap/tests/schema/schema001.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 1: simpleType/restriction ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema002.phpt b/ext/soap/tests/schema/schema002.phpt deleted file mode 100644 index 41f3bbe3fa2ee..0000000000000 --- a/ext/soap/tests/schema/schema002.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP XML Schema 2: simpleType/restriction (reference to type) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema003.phpt b/ext/soap/tests/schema/schema003.phpt deleted file mode 100644 index 75991001e0c5f..0000000000000 --- a/ext/soap/tests/schema/schema003.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP XML Schema 3: simpleType/restriction (reference to type, that is not defined yet) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema004.phpt b/ext/soap/tests/schema/schema004.phpt deleted file mode 100644 index b851f76050365..0000000000000 --- a/ext/soap/tests/schema/schema004.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 4: simpleType/restriction (reference to undefined type) ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123.5 -string(5) "123.5" -ok \ No newline at end of file diff --git a/ext/soap/tests/schema/schema005.phpt b/ext/soap/tests/schema/schema005.phpt deleted file mode 100644 index 1db0c62f990ed..0000000000000 --- a/ext/soap/tests/schema/schema005.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 5: simpleType/restriction (inline type) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema006.phpt b/ext/soap/tests/schema/schema006.phpt deleted file mode 100644 index e41f27545b5fd..0000000000000 --- a/ext/soap/tests/schema/schema006.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP XML Schema 6: simpleType/restriction (referenced by ellement) ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'element="tns:testElement"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema007.phpt b/ext/soap/tests/schema/schema007.phpt deleted file mode 100644 index fd93c7aa8e451..0000000000000 --- a/ext/soap/tests/schema/schema007.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP XML Schema 7: simpleType/restriction (referenced by ellement) ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'element="tns:testElement"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok diff --git a/ext/soap/tests/schema/schema008.phpt b/ext/soap/tests/schema/schema008.phpt deleted file mode 100644 index 1c4005f690489..0000000000000 --- a/ext/soap/tests/schema/schema008.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 8: simpleType/restriction (anonymous, inside an ellement) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'element="tns:testElement"',123.5); -echo "ok"; -?> ---EXPECT-- - -123 -int(123) -ok - diff --git a/ext/soap/tests/schema/schema009.phpt b/ext/soap/tests/schema/schema009.phpt deleted file mode 100644 index 5198debd90473..0000000000000 --- a/ext/soap/tests/schema/schema009.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 9: simpleType/list (as string) ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',"one two"); -echo "ok"; -?> ---EXPECT-- - -one two -string(7) "one two" -ok diff --git a/ext/soap/tests/schema/schema010.phpt b/ext/soap/tests/schema/schema010.phpt deleted file mode 100644 index 6cea56ee487db..0000000000000 --- a/ext/soap/tests/schema/schema010.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 10: simpleType/list (as array) ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',array("one","two")); -echo "ok"; -?> ---EXPECT-- - -one two -string(7) "one two" -ok diff --git a/ext/soap/tests/schema/schema011.phpt b/ext/soap/tests/schema/schema011.phpt deleted file mode 100644 index c66f0f7a107d1..0000000000000 --- a/ext/soap/tests/schema/schema011.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 11: simpleType/list (inline type) (as string) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',"123 456.7"); -echo "ok"; -?> ---EXPECT-- - -123 456 -string(7) "123 456" -ok diff --git a/ext/soap/tests/schema/schema012.phpt b/ext/soap/tests/schema/schema012.phpt deleted file mode 100644 index 7ba25f9637284..0000000000000 --- a/ext/soap/tests/schema/schema012.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 12: simpleType/list (inline type) (as array) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,456.7)); -echo "ok"; -?> ---EXPECT-- - -123 456 -string(7) "123 456" -ok diff --git a/ext/soap/tests/schema/schema013.phpt b/ext/soap/tests/schema/schema013.phpt deleted file mode 100644 index ee2e114bd628e..0000000000000 --- a/ext/soap/tests/schema/schema013.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 13: simpleType/union ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',"str"); -echo "ok"; -?> ---EXPECT-- - -str -string(3) "str" -ok diff --git a/ext/soap/tests/schema/schema014.phpt b/ext/soap/tests/schema/schema014.phpt deleted file mode 100644 index 87edb3ad3040b..0000000000000 --- a/ext/soap/tests/schema/schema014.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP XML Schema 14: simpleType/union ---SKIPIF-- - ---FILE-- - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123.5 -string(5) "123.5" -ok diff --git a/ext/soap/tests/schema/schema015.phpt b/ext/soap/tests/schema/schema015.phpt deleted file mode 100644 index dc9a02d586948..0000000000000 --- a/ext/soap/tests/schema/schema015.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 15: simpleType/union (inline type) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',"str"); -echo "ok"; -?> ---EXPECT-- - -str -string(3) "str" -ok diff --git a/ext/soap/tests/schema/schema016.phpt b/ext/soap/tests/schema/schema016.phpt deleted file mode 100644 index 714fb59743e4f..0000000000000 --- a/ext/soap/tests/schema/schema016.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 16: simpleType/union (inline type) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123.5 -string(5) "123.5" -ok diff --git a/ext/soap/tests/schema/schema017.phpt b/ext/soap/tests/schema/schema017.phpt deleted file mode 100644 index 8b20483783588..0000000000000 --- a/ext/soap/tests/schema/schema017.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 17: union with list ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',123.5); -echo "ok"; -?> ---EXPECT-- - -123.5 -string(5) "123.5" -ok diff --git a/ext/soap/tests/schema/schema018.phpt b/ext/soap/tests/schema/schema018.phpt deleted file mode 100644 index f41e277aaa077..0000000000000 --- a/ext/soap/tests/schema/schema018.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 18: union with list ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',"123.5"); -echo "ok"; -?> ---EXPECT-- - -123.5 -string(5) "123.5" -ok diff --git a/ext/soap/tests/schema/schema019.phpt b/ext/soap/tests/schema/schema019.phpt deleted file mode 100644 index 73938772bf551..0000000000000 --- a/ext/soap/tests/schema/schema019.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 19: union with list ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',"123.5 456.7"); -echo "ok"; -?> ---EXPECT-- - -123.5 456.7 -string(11) "123.5 456.7" -ok diff --git a/ext/soap/tests/schema/schema020.phpt b/ext/soap/tests/schema/schema020.phpt deleted file mode 100644 index 899b773756ddf..0000000000000 --- a/ext/soap/tests/schema/schema020.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 20: union with list ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123.5,456.7)); -echo "ok"; -?> ---EXPECT-- - -123.5 456.7 -string(11) "123.5 456.7" -ok diff --git a/ext/soap/tests/schema/schema021.phpt b/ext/soap/tests/schema/schema021.phpt deleted file mode 100644 index 1400107f811bf..0000000000000 --- a/ext/soap/tests/schema/schema021.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 21: list of unions ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',"123 123.5 456.7 str"); -echo "ok"; -?> ---EXPECT-- - -123 123.5 456.7 str -string(19) "123 123.5 456.7 str" -ok diff --git a/ext/soap/tests/schema/schema022.phpt b/ext/soap/tests/schema/schema022.phpt deleted file mode 100644 index bfbb05c772b10..0000000000000 --- a/ext/soap/tests/schema/schema022.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 22: list of unions ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5,'str')); -echo "ok"; -?> ---EXPECT-- - -123 123.5 str -string(13) "123 123.5 str" -ok diff --git a/ext/soap/tests/schema/schema023.phpt b/ext/soap/tests/schema/schema023.phpt deleted file mode 100644 index 162a46e7f5f3c..0000000000000 --- a/ext/soap/tests/schema/schema023.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 23: SOAP 1.1 Array ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5)); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema024.phpt b/ext/soap/tests/schema/schema024.phpt deleted file mode 100644 index 628dfd73fd55f..0000000000000 --- a/ext/soap/tests/schema/schema024.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 24: SOAP 1.1 Array (second way) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5)); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema025.phpt b/ext/soap/tests/schema/schema025.phpt deleted file mode 100644 index f9c7af758680c..0000000000000 --- a/ext/soap/tests/schema/schema025.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 25: SOAP 1.2 Array ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5)); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema026.phpt b/ext/soap/tests/schema/schema026.phpt deleted file mode 100644 index a80215ed4fd88..0000000000000 --- a/ext/soap/tests/schema/schema026.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 26: SOAP 1.2 Array (second way) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5)); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema027.phpt b/ext/soap/tests/schema/schema027.phpt deleted file mode 100644 index 968b8562dbc53..0000000000000 --- a/ext/soap/tests/schema/schema027.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP XML Schema 27: SOAP 1.1 Multidimensional array ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(array(123),array(123.5))); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - array(1) { - [0]=> - int(123) - } - [1]=> - array(1) { - [0]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema028.phpt b/ext/soap/tests/schema/schema028.phpt deleted file mode 100644 index f86a875848c93..0000000000000 --- a/ext/soap/tests/schema/schema028.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP XML Schema 28: SOAP 1.2 Multidimensional array ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(array(123),array(123.5))); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - array(1) { - [0]=> - int(123) - } - [1]=> - array(1) { - [0]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema029.phpt b/ext/soap/tests/schema/schema029.phpt deleted file mode 100644 index 8ae0a3b12f506..0000000000000 --- a/ext/soap/tests/schema/schema029.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP XML Schema 29: SOAP 1.2 Multidimensional array (second way) ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(array(123),array(123.5))); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - array(1) { - [0]=> - int(123) - } - [1]=> - array(1) { - [0]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema030.phpt b/ext/soap/tests/schema/schema030.phpt deleted file mode 100644 index e468613916145..0000000000000 --- a/ext/soap/tests/schema/schema030.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 30: Structure (sequence) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123str -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["str"]=> - string(3) "str" -} -ok diff --git a/ext/soap/tests/schema/schema031.phpt b/ext/soap/tests/schema/schema031.phpt deleted file mode 100644 index 479abfee9d725..0000000000000 --- a/ext/soap/tests/schema/schema031.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 31: Structure (all) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123str -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["str"]=> - string(3) "str" -} -ok diff --git a/ext/soap/tests/schema/schema032.phpt b/ext/soap/tests/schema/schema032.phpt deleted file mode 100644 index 47b4af121cb76..0000000000000 --- a/ext/soap/tests/schema/schema032.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP XML Schema 32: Structure (choice) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (1) { - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema033.phpt b/ext/soap/tests/schema/schema033.phpt deleted file mode 100644 index b504bc077a3d6..0000000000000 --- a/ext/soap/tests/schema/schema033.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP XML Schema 33: Nested complex types ---SKIPIF-- - ---FILE-- - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"nest"=>array("int"=>123.5))); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["nest"]=> - object(stdClass)#%d (1) { - ["int"]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema034.phpt b/ext/soap/tests/schema/schema034.phpt deleted file mode 100644 index a83d6ea84648e..0000000000000 --- a/ext/soap/tests/schema/schema034.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP XML Schema 34: Nested complex types (element ref) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5))); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["testType2"]=> - object(stdClass)#%d (1) { - ["int"]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema035.phpt b/ext/soap/tests/schema/schema035.phpt deleted file mode 100644 index 8974ed00c5494..0000000000000 --- a/ext/soap/tests/schema/schema035.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP XML Schema 35: Nested complex types (element ref + anonymous type) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5))); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["testType2"]=> - object(stdClass)#%d (1) { - ["int"]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema036.phpt b/ext/soap/tests/schema/schema036.phpt deleted file mode 100644 index 9d6dac45343ae..0000000000000 --- a/ext/soap/tests/schema/schema036.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP XML Schema 36: Nested complex types (inline) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5))); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["testType2"]=> - object(stdClass)#%d (1) { - ["int"]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema037.phpt b/ext/soap/tests/schema/schema037.phpt deleted file mode 100644 index 4e59981fc9a50..0000000000000 --- a/ext/soap/tests/schema/schema037.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 37: Structure with attributes ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -str -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema038.phpt b/ext/soap/tests/schema/schema038.phpt deleted file mode 100644 index 2d37e89e0b536..0000000000000 --- a/ext/soap/tests/schema/schema038.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 38: Structure with attributes (ref) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -str -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema039.phpt b/ext/soap/tests/schema/schema039.phpt deleted file mode 100644 index 0b7ef5afc4627..0000000000000 --- a/ext/soap/tests/schema/schema039.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 39: Structure with attributes (attributeGroup) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -str -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema040.phpt b/ext/soap/tests/schema/schema040.phpt deleted file mode 100644 index f7ddc04546848..0000000000000 --- a/ext/soap/tests/schema/schema040.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP XML Schema 40: Structure with attributes (inline types) ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -str -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema041.phpt b/ext/soap/tests/schema/schema041.phpt deleted file mode 100644 index 1264cf5c90d74..0000000000000 --- a/ext/soap/tests/schema/schema041.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 41: Structure (group) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123str -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["str"]=> - string(3) "str" -} -ok diff --git a/ext/soap/tests/schema/schema042.phpt b/ext/soap/tests/schema/schema042.phpt deleted file mode 100644 index a8aa8857d9bf2..0000000000000 --- a/ext/soap/tests/schema/schema042.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 42: Extension of simple type ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (2) { - ["_"]=> - int(123) - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema043.phpt b/ext/soap/tests/schema/schema043.phpt deleted file mode 100644 index 08c29963634d1..0000000000000 --- a/ext/soap/tests/schema/schema043.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP XML Schema 43: Extension of simple type (2) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (3) { - ["_"]=> - int(123) - ["int"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema044.phpt b/ext/soap/tests/schema/schema044.phpt deleted file mode 100644 index 8fc0705518742..0000000000000 --- a/ext/soap/tests/schema/schema044.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 44: Restriction of simple type ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (2) { - ["_"]=> - int(123) - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema045.phpt b/ext/soap/tests/schema/schema045.phpt deleted file mode 100644 index 346a929d85b51..0000000000000 --- a/ext/soap/tests/schema/schema045.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP XML Schema 45: Restriction of simple type (2) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (2) { - ["_"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema046.phpt b/ext/soap/tests/schema/schema046.phpt deleted file mode 100644 index 3f9d03afadd74..0000000000000 --- a/ext/soap/tests/schema/schema046.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP XML Schema 46: Extension of complex type ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (3) { - ["_"]=> - int(123) - ["int"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema047.phpt b/ext/soap/tests/schema/schema047.phpt deleted file mode 100644 index 1265cfd3a3817..0000000000000 --- a/ext/soap/tests/schema/schema047.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SOAP XML Schema 47: Extension of complex type (2) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema048.phpt b/ext/soap/tests/schema/schema048.phpt deleted file mode 100644 index 98d4d4be44383..0000000000000 --- a/ext/soap/tests/schema/schema048.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP XML Schema 48: Restriction of complex type ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (2) { - ["_"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema049.phpt b/ext/soap/tests/schema/schema049.phpt deleted file mode 100644 index 7268a4b67a5ac..0000000000000 --- a/ext/soap/tests/schema/schema049.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP XML Schema 49: Restriction of complex type (2) ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (1) { - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema050.phpt b/ext/soap/tests/schema/schema050.phpt deleted file mode 100644 index 6c735125b7650..0000000000000 --- a/ext/soap/tests/schema/schema050.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 50: Array in complex type (maxOccurs > 1, one value) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema051.phpt b/ext/soap/tests/schema/schema051.phpt deleted file mode 100644 index 9636399814a9c..0000000000000 --- a/ext/soap/tests/schema/schema051.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP XML Schema 51: Array in complex type (maxOccurs > 1, array) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array(123.5,456.7))); -echo "ok"; -?> ---EXPECTF-- - -123123456 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["int2"]=> - array(2) { - [0]=> - int(123) - [1]=> - int(456) - } -} -ok diff --git a/ext/soap/tests/schema/schema052.phpt b/ext/soap/tests/schema/schema052.phpt deleted file mode 100644 index 8e7121ae2d0a6..0000000000000 --- a/ext/soap/tests/schema/schema052.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 52: Array in complex type (maxOccurs > 1, array with one value) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array(123.5))); -echo "ok"; -?> ---EXPECTF-- - -123123 -object(stdClass)#%d (2) { - ["int"]=> - int(123) - ["int2"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema053.phpt b/ext/soap/tests/schema/schema053.phpt deleted file mode 100644 index 8893bf5df3456..0000000000000 --- a/ext/soap/tests/schema/schema053.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP XML Schema 52: Array in complex type (maxOccurs > 1, empty array) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array())); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#%d (1) { - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema054.phpt b/ext/soap/tests/schema/schema054.phpt deleted file mode 100644 index fc5cb05761501..0000000000000 --- a/ext/soap/tests/schema/schema054.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP XML Schema 54: Apache Map ---SKIPIF-- - ---FILE-- -123,'b'=>123.5)); -echo "ok"; -?> ---EXPECT-- - -a123b123.5 -array(2) { - ["a"]=> - int(123) - ["b"]=> - float(123.5) -} -ok diff --git a/ext/soap/tests/schema/schema055.phpt b/ext/soap/tests/schema/schema055.phpt deleted file mode 100644 index 013cd92fd8f32..0000000000000 --- a/ext/soap/tests/schema/schema055.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP XML Schema 55: Apache Map (extension) ---SKIPIF-- - ---FILE-- - - - - - - -EOF; -test_schema($schema,'type="testType"',array('a'=>123,'b'=>123.5)); -echo "ok"; -?> ---EXPECT-- - -a123b123.5 -array(2) { - ["a"]=> - int(123) - ["b"]=> - float(123.5) -} -ok diff --git a/ext/soap/tests/schema/schema056.phpt b/ext/soap/tests/schema/schema056.phpt deleted file mode 100644 index 1ada78ea2a0b6..0000000000000 --- a/ext/soap/tests/schema/schema056.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 56: SOAP 1.1 Array (literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema057.phpt b/ext/soap/tests/schema/schema057.phpt deleted file mode 100644 index 1848b9c24aa34..0000000000000 --- a/ext/soap/tests/schema/schema057.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 57: SOAP 1.1 Array (second way, literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema058.phpt b/ext/soap/tests/schema/schema058.phpt deleted file mode 100644 index b96fc9fccaad0..0000000000000 --- a/ext/soap/tests/schema/schema058.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 58: SOAP 1.2 Array (literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema059.phpt b/ext/soap/tests/schema/schema059.phpt deleted file mode 100644 index 875bae986869e..0000000000000 --- a/ext/soap/tests/schema/schema059.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -SOAP XML Schema 59: SOAP 1.2 Array (second way, literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - int(123) - [1]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema060.phpt b/ext/soap/tests/schema/schema060.phpt deleted file mode 100644 index 4daa83c191b1a..0000000000000 --- a/ext/soap/tests/schema/schema060.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP XML Schema 60: SOAP 1.2 Multidimensional array (literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - array(1) { - [0]=> - int(123) - } - [1]=> - array(1) { - [0]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema061.phpt b/ext/soap/tests/schema/schema061.phpt deleted file mode 100644 index bbd2aa657978b..0000000000000 --- a/ext/soap/tests/schema/schema061.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SOAP XML Schema 61: SOAP 1.2 Multidimensional array (second way, literal encoding) ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)),'rpc','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -array(2) { - [0]=> - array(1) { - [0]=> - int(123) - } - [1]=> - array(1) { - [0]=> - int(123) - } -} -ok diff --git a/ext/soap/tests/schema/schema062.phpt b/ext/soap/tests/schema/schema062.phpt deleted file mode 100644 index 1dc51ef765415..0000000000000 --- a/ext/soap/tests/schema/schema062.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 62: NULL with attributes ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("_"=>NULL,"int"=>123.5)); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["_"]=> - NULL - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema063.phpt b/ext/soap/tests/schema/schema063.phpt deleted file mode 100644 index dd60422a27d29..0000000000000 --- a/ext/soap/tests/schema/schema063.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -SOAP XML Schema 63: standard unsignedLong type ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -4294967295 -%s(4294967295) -ok diff --git a/ext/soap/tests/schema/schema064.phpt b/ext/soap/tests/schema/schema064.phpt deleted file mode 100644 index 53e1b257be909..0000000000000 --- a/ext/soap/tests/schema/schema064.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -SOAP XML Schema 64: standard date/time types ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - -EOF; -$date = gmmktime(1,2,3,4,5,1976); -putenv('TZ=GMT'); -test_schema($schema,'type="tns:testType"',array( - 'dateTime' => $date, - 'time' => $date, - 'date' => $date, - 'gYearMonth' => $date, - 'gYear' => $date, - 'gMonthDay' => $date, - 'gDay' => $date, - 'gMonth' => $date -)); -echo "ok"; -?> ---EXPECTF-- - -1976-04-05T01:02:03Z1976-04-05Z1976-04Z1976Z--04-05Z---05Z--04--Z -object(stdClass)#%d (8) { - ["dateTime"]=> - string(20) "1976-04-05T01:02:03Z" - ["time"]=> - string(9) "01:02:03Z" - ["date"]=> - string(11) "1976-04-05Z" - ["gYearMonth"]=> - string(8) "1976-04Z" - ["gYear"]=> - string(5) "1976Z" - ["gMonthDay"]=> - string(8) "--04-05Z" - ["gDay"]=> - string(6) "---05Z" - ["gMonth"]=> - string(7) "--04--Z" -} -ok diff --git a/ext/soap/tests/schema/schema065.phpt b/ext/soap/tests/schema/schema065.phpt deleted file mode 100644 index e3f0d646dccd7..0000000000000 --- a/ext/soap/tests/schema/schema065.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP XML Schema 65: Attribute with default value ---SKIPIF-- - ---FILE-- - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str")); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(5) -} -ok diff --git a/ext/soap/tests/schema/schema066.phpt b/ext/soap/tests/schema/schema066.phpt deleted file mode 100644 index b2812719634b8..0000000000000 --- a/ext/soap/tests/schema/schema066.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP XML Schema 66: Attribute with fixed value (1) ---SKIPIF-- - ---FILE-- - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str")); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(5) -} -ok diff --git a/ext/soap/tests/schema/schema067.phpt b/ext/soap/tests/schema/schema067.phpt deleted file mode 100644 index 0e4000957a77c..0000000000000 --- a/ext/soap/tests/schema/schema067.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP XML Schema 67: Attribute with fixed value (2) ---SKIPIF-- - ---FILE-- - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>5)); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(5) -} -ok diff --git a/ext/soap/tests/schema/schema068.phpt b/ext/soap/tests/schema/schema068.phpt deleted file mode 100644 index 88fdac334fdb8..0000000000000 --- a/ext/soap/tests/schema/schema068.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SOAP XML Schema 68: Attribute with fixed value (3) ---SKIPIF-- - ---FILE-- - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>4)); -echo "ok"; -?> ---EXPECTF-- -Fatal error: SOAP-ERROR: Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %stest_schema.inc on line %d \ No newline at end of file diff --git a/ext/soap/tests/schema/schema069.phpt b/ext/soap/tests/schema/schema069.phpt deleted file mode 100644 index e4f733a1c07a6..0000000000000 --- a/ext/soap/tests/schema/schema069.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP XML Schema 69: Attribute with default value (reference) ---SKIPIF-- - ---FILE-- - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str")); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(5) -} -ok diff --git a/ext/soap/tests/schema/schema070.phpt b/ext/soap/tests/schema/schema070.phpt deleted file mode 100644 index af9abdc10f334..0000000000000 --- a/ext/soap/tests/schema/schema070.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 70: Attribute with default value (attributeGroup) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str")); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(5) -} -ok diff --git a/ext/soap/tests/schema/schema071.phpt b/ext/soap/tests/schema/schema071.phpt deleted file mode 100644 index 1991f7ad8ee92..0000000000000 --- a/ext/soap/tests/schema/schema071.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP XML Schema 71: SOAP 1.1 Array (document style) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -test_schema($schema,'type="tns:testType"',array(123,123.5),'document','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -ok diff --git a/ext/soap/tests/schema/schema072.phpt b/ext/soap/tests/schema/schema072.phpt deleted file mode 100644 index 89a0ed3597ecf..0000000000000 --- a/ext/soap/tests/schema/schema072.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP XML Schema 72: SOAP 1.1 Array (document style, element with inline type) ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOF; -test_schema($schema,'element="tns:testElement"',array(123,123.5),'document','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -ok diff --git a/ext/soap/tests/schema/schema073.phpt b/ext/soap/tests/schema/schema073.phpt deleted file mode 100644 index 22dd9e2604c1d..0000000000000 --- a/ext/soap/tests/schema/schema073.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP XML Schema 73: SOAP 1.1 Array (document style, element with type ref) ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -test_schema($schema,'element="tns:testElement"',array(123,123.5),'document','literal'); -echo "ok"; -?> ---EXPECT-- - -123123 -ok diff --git a/ext/soap/tests/schema/schema074.phpt b/ext/soap/tests/schema/schema074.phpt deleted file mode 100644 index 3dbba0cd251d7..0000000000000 --- a/ext/soap/tests/schema/schema074.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP XML Schema 74: Structure with attributes and qualified elements ---SKIPIF-- - ---FILE-- - - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5), "rpc", "encoded", 'attributeFormDefault="qualified"'); -echo "ok"; -?> ---EXPECTF-- - -str -object(stdClass)#%d (2) { - ["str"]=> - string(3) "str" - ["int"]=> - int(123) -} -ok diff --git a/ext/soap/tests/schema/schema075.phpt b/ext/soap/tests/schema/schema075.phpt deleted file mode 100644 index 2a84be9ce915a..0000000000000 --- a/ext/soap/tests/schema/schema075.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 75: Attributes form qualified/unqualified (attributeFormDefault="qualified") ---SKIPIF-- - ---FILE-- - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="qualified"'); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/schema076.phpt b/ext/soap/tests/schema/schema076.phpt deleted file mode 100644 index dfa7791fedcb4..0000000000000 --- a/ext/soap/tests/schema/schema076.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 76: Attributes form qualified/unqualified (attributeFormDefault="unqualified") ---SKIPIF-- - ---FILE-- - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="unqualified"'); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/schema077.phpt b/ext/soap/tests/schema/schema077.phpt deleted file mode 100644 index baf10449d6013..0000000000000 --- a/ext/soap/tests/schema/schema077.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP XML Schema 77: Attributes form qualified/unqualified (attributeFormDefault - default) ---SKIPIF-- - ---FILE-- - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded"); -echo "ok"; -?> ---EXPECTF-- - - -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/schema078.phpt b/ext/soap/tests/schema/schema078.phpt deleted file mode 100644 index a674270dff495..0000000000000 --- a/ext/soap/tests/schema/schema078.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP XML Schema 78: Element form qualified/unqualified (elementFormDefault="qualified") ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="qualified"'); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/schema079.phpt b/ext/soap/tests/schema/schema079.phpt deleted file mode 100644 index d7f2ab97c645f..0000000000000 --- a/ext/soap/tests/schema/schema079.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP XML Schema 79: Element form qualified/unqualified (elementFormDefault="unqualified") ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="unqualified"'); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/schema080.phpt b/ext/soap/tests/schema/schema080.phpt deleted file mode 100644 index 4accf551f114a..0000000000000 --- a/ext/soap/tests/schema/schema080.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP XML Schema 80: Element form qualified/unqualified (elementFormDefault - default) ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; - -test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal"); -echo "ok"; -?> ---EXPECTF-- - -123 -object(stdClass)#5 (3) { - ["int1"]=> - int(1) - ["int2"]=> - int(2) - ["int3"]=> - int(3) -} -ok diff --git a/ext/soap/tests/schema/skipif.inc b/ext/soap/tests/schema/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/schema/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/schema/test_schema.inc b/ext/soap/tests/schema/test_schema.inc deleted file mode 100644 index e1d4eeb5087ab..0000000000000 --- a/ext/soap/tests/schema/test_schema.inc +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - $schema - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; - - $fname = tempnam ("./", "wsdl"); - $f = fopen($fname,"w"); - fwrite($f,$wsdl); - fclose($f); - ini_set("soap.wsdl_cache_enabled",0); - $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0)); - $y = new SoapServer($fname); - $y->addfunction("test"); - unlink($fname); - - $x->test($param); - $xml = xml_parser_create(); - $req = $x->__getlastrequest(); - if ($style == "rpc") { - $HTTP_RAW_POST_DATA = $req; - ob_start(); - $y->handle(); - ob_end_clean(); - echo $req; - var_dump($val); - } else { - echo $req; - } -} -?> diff --git a/ext/soap/tests/server001.phpt b/ext/soap/tests/server001.phpt deleted file mode 100644 index 582759f06ff86..0000000000000 --- a/ext/soap/tests/server001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Server 1: new/addfunction/handle ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server002.phpt b/ext/soap/tests/server002.phpt deleted file mode 100644 index 8416f4fb08564..0000000000000 --- a/ext/soap/tests/server002.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP Server 2: function with parameters and result ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("Add"); - -$HTTP_RAW_POST_DATA = << - - - - 22 - 33 - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -55 -ok diff --git a/ext/soap/tests/server003.phpt b/ext/soap/tests/server003.phpt deleted file mode 100644 index d4a15e0d69852..0000000000000 --- a/ext/soap/tests/server003.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP Server 3: all functions ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction(SOAP_FUNCTIONS_ALL); - -$HTTP_RAW_POST_DATA = << - - - - Hello World - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -11 -ok diff --git a/ext/soap/tests/server004.phpt b/ext/soap/tests/server004.phpt deleted file mode 100644 index 5bfef4fcd4a32..0000000000000 --- a/ext/soap/tests/server004.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -SOAP Server 4: addfunctions ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction(array("Sub","Add")); - -$HTTP_RAW_POST_DATA = << - - - - 22 - 33 - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -55 -ok diff --git a/ext/soap/tests/server005.phpt b/ext/soap/tests/server005.phpt deleted file mode 100644 index 4aae3b2d9962e..0000000000000 --- a/ext/soap/tests/server005.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP Server 5: setclass ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->setclass("Foo"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server006.phpt b/ext/soap/tests/server006.phpt deleted file mode 100644 index f382d9f2f1898..0000000000000 --- a/ext/soap/tests/server006.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -SOAP Server 6: setclass with constructor ---SKIPIF-- - ---FILE-- -str = $str . " World"; - } - - function test() { - return $this->str; - } -} - -$server = new soapserver(null,array('uri'=>"http://testuri.org")); -$server->setclass("Foo","Hello"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server007.phpt b/ext/soap/tests/server007.phpt deleted file mode 100644 index 676aa56c44fb1..0000000000000 --- a/ext/soap/tests/server007.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP Server 7: addfunction and getfunctions ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction(array("Sub","Add")); -var_dump($server->getfunctions()); -echo "ok\n"; -?> ---EXPECT-- -array(2) { - [0]=> - string(3) "Sub" - [1]=> - string(3) "Add" -} -ok diff --git a/ext/soap/tests/server008.phpt b/ext/soap/tests/server008.phpt deleted file mode 100644 index 87fb69d25fa69..0000000000000 --- a/ext/soap/tests/server008.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP Server 8: setclass and getfunctions ---SKIPIF-- - ---FILE-- -str; - } -} - -$server = new soapserver(null,array('uri'=>"http://testuri.org")); -$server->setclass("Foo"); -var_dump($server->getfunctions()); -echo "ok\n"; -?> ---EXPECT-- -array(2) { - [0]=> - string(3) "Foo" - [1]=> - string(4) "test" -} -ok diff --git a/ext/soap/tests/server009.phpt b/ext/soap/tests/server009.phpt deleted file mode 100644 index 0a7b30f40c55a..0000000000000 --- a/ext/soap/tests/server009.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -SOAP Server 9: setclass and setpersistence(SOAP_PERSISTENCE_SESSION) ---SKIPIF-- - ---FILE-- -sum += $num; - } -} - -$server = new soapserver(null,array('uri'=>"http://testuri.org")); -$server->setclass("foo"); -$server->setpersistence(SOAP_PERSISTENCE_SESSION); - -ob_start(); -$HTTP_RAW_POST_DATA = << - - - - 5 - - - -EOF; -$server->handle(); -ob_clean(); - -$HTTP_RAW_POST_DATA = << - - - - 3 - - - -EOF; -$server->handle(); -ob_end_flush(); - -echo "ok\n"; -?> ---EXPECT-- - -8 -ok diff --git a/ext/soap/tests/server010.phpt b/ext/soap/tests/server010.phpt deleted file mode 100644 index 76cc1e6949eca..0000000000000 --- a/ext/soap/tests/server010.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -SOAP Server 10: setclass and setpersistence(SOAP_PERSISTENCE_REQUEST) ---SKIPIF-- - ---FILE-- -sum += $num; - } -} - -$server = new soapserver(null,array('uri'=>"http://testuri.org")); -$server->setclass("foo"); -$server->setpersistence(SOAP_PERSISTENCE_REQUEST); - - -ob_start(); -$HTTP_RAW_POST_DATA = << - - - - 5 - - - -EOF; -$server->handle(); -ob_clean(); - -$HTTP_RAW_POST_DATA = << - - - - 3 - - - -EOF; -$server->handle(); -ob_end_flush(); -echo "ok\n"; -?> ---EXPECT-- - -3 -ok diff --git a/ext/soap/tests/server011.phpt b/ext/soap/tests/server011.phpt deleted file mode 100644 index fb9aabe89c034..0000000000000 --- a/ext/soap/tests/server011.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP Server 11: bind ---SKIPIF-- - ---GET-- -wsdl ---FILE-- -handle(); -$wsdl = ob_get_contents(); -ob_end_clean(); -if ($wsdl == file_get_contents(dirname(__FILE__)."/test.wsdl")) { - echo "ok\n"; -} else { - echo "fail\n"; -} -?> ---EXPECT-- -ok diff --git a/ext/soap/tests/server012.phpt b/ext/soap/tests/server012.phpt deleted file mode 100644 index 9a41de9d50404..0000000000000 --- a/ext/soap/tests/server012.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP Server 12: WSDL generation ---SKIPIF-- - ---GET-- -WSDL ---FILE-- -"http://testuri.org")); -$server->addfunction("Add"); -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -SOAP-ENV:ServerWSDL generation is not supported yet diff --git a/ext/soap/tests/server013.phpt b/ext/soap/tests/server013.phpt deleted file mode 100644 index 4bb94c79c4c43..0000000000000 --- a/ext/soap/tests/server013.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -SOAP Server 13: array handling ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("Sum"); - -$HTTP_RAW_POST_DATA = << - - - - - 3 - 5 - - - - -EOF; -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -8 -ok diff --git a/ext/soap/tests/server014.phpt b/ext/soap/tests/server014.phpt deleted file mode 100644 index 73752648725d7..0000000000000 --- a/ext/soap/tests/server014.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP Server 14: fault ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("Add"); - -$HTTP_RAW_POST_DATA = << - - - - 22 - 33 - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -SOAP-ENV:ServerCall to undefined function undefined_function_x() diff --git a/ext/soap/tests/server015.phpt b/ext/soap/tests/server015.phpt deleted file mode 100644 index ea538e84eb4c7..0000000000000 --- a/ext/soap/tests/server015.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Server 15: passing request to handle() ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$envelope = << - - - - - -EOF; -$server->handle($envelope); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server016.phpt b/ext/soap/tests/server016.phpt deleted file mode 100644 index 77bce9fb38c31..0000000000000 --- a/ext/soap/tests/server016.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SOAP Server 16: user fault ---SKIPIF-- - ---FILE-- -fault("MyFault","My fault string"); -} - -$server = new soapserver(null,array('uri'=>"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -MyFaultMy fault string diff --git a/ext/soap/tests/server017.phpt b/ext/soap/tests/server017.phpt deleted file mode 100644 index 2f5dd6b6e722a..0000000000000 --- a/ext/soap/tests/server017.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Server 17: user fault (through return) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -MyFaultMy fault string diff --git a/ext/soap/tests/server018.phpt b/ext/soap/tests/server018.phpt deleted file mode 100644 index 724f0d884190e..0000000000000 --- a/ext/soap/tests/server018.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SOAP Server 18: user fault (through throw) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -MyFaultMy fault string diff --git a/ext/soap/tests/server019.phpt b/ext/soap/tests/server019.phpt deleted file mode 100644 index 4ad9c5ee852fa..0000000000000 --- a/ext/soap/tests/server019.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP Server 19: compressed request (gzip) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = gzencode(<< - - - - - -EOF -, 9, FORCE_GZIP); -$_SERVER['HTTP_CONTENT_ENCODING'] = "gzip"; -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server020.phpt b/ext/soap/tests/server020.phpt deleted file mode 100644 index bacbc57849915..0000000000000 --- a/ext/soap/tests/server020.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SOAP Server 20: compressed request (deflate) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = gzcompress(<< - - - - - -EOF -, 9); -$_SERVER['HTTP_CONTENT_ENCODING'] = "deflate"; -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server021.phpt b/ext/soap/tests/server021.phpt deleted file mode 100644 index 787e959fb36d6..0000000000000 --- a/ext/soap/tests/server021.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -SOAP Server 21: SoapServer::setClass and __call() ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->setclass("Foo"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -Hello World -ok diff --git a/ext/soap/tests/server022.phpt b/ext/soap/tests/server022.phpt deleted file mode 100755 index 7b74d8923f70e..0000000000000 --- a/ext/soap/tests/server022.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -SOAP Server 22: user fault (through throw of subclass) ---SKIPIF-- - ---FILE-- -"http://testuri.org")); -$server->addfunction("test"); - -$HTTP_RAW_POST_DATA = << - - - - - -EOF; - -$server->handle(); -echo "ok\n"; -?> ---EXPECT-- - -MyFaultMy fault string diff --git a/ext/soap/tests/skipif.inc b/ext/soap/tests/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/soap12/T01.phpt b/ext/soap/tests/soap12/T01.phpt deleted file mode 100644 index d584812d09825..0000000000000 --- a/ext/soap/tests/soap12/T01.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T01 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T02.phpt b/ext/soap/tests/soap12/T02.phpt deleted file mode 100644 index db2c260684a50..0000000000000 --- a/ext/soap/tests/soap12/T02.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T02 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T03.phpt b/ext/soap/tests/soap12/T03.phpt deleted file mode 100644 index 19c29dd3dd3e3..0000000000000 --- a/ext/soap/tests/soap12/T03.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T03 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T04.phpt b/ext/soap/tests/soap12/T04.phpt deleted file mode 100644 index 7445caedee6a1..0000000000000 --- a/ext/soap/tests/soap12/T04.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T04 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T05.phpt b/ext/soap/tests/soap12/T05.phpt deleted file mode 100644 index 187eb2ee83781..0000000000000 --- a/ext/soap/tests/soap12/T05.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T05 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T10.phpt b/ext/soap/tests/soap12/T10.phpt deleted file mode 100644 index 54186f6a0db28..0000000000000 --- a/ext/soap/tests/soap12/T10.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T10 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T11.phpt b/ext/soap/tests/soap12/T11.phpt deleted file mode 100644 index 3423d54329a4e..0000000000000 --- a/ext/soap/tests/soap12/T11.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T11 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T12.phpt b/ext/soap/tests/soap12/T12.phpt deleted file mode 100644 index c67917f0e3440..0000000000000 --- a/ext/soap/tests/soap12/T12.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T12 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:MustUnderstandHeader not understood diff --git a/ext/soap/tests/soap12/T13.phpt b/ext/soap/tests/soap12/T13.phpt deleted file mode 100644 index 95e1c8ad4ef7f..0000000000000 --- a/ext/soap/tests/soap12/T13.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T13 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:MustUnderstandHeader not understood diff --git a/ext/soap/tests/soap12/T14.phpt b/ext/soap/tests/soap12/T14.phpt deleted file mode 100644 index dbf4e1bab5107..0000000000000 --- a/ext/soap/tests/soap12/T14.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T14 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SendermustUnderstand value is not boolean diff --git a/ext/soap/tests/soap12/T15.phpt b/ext/soap/tests/soap12/T15.phpt deleted file mode 100644 index 546f94237f4dc..0000000000000 --- a/ext/soap/tests/soap12/T15.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T15 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T19.phpt b/ext/soap/tests/soap12/T19.phpt deleted file mode 100644 index 8ddb5b4f8b2d0..0000000000000 --- a/ext/soap/tests/soap12/T19.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T19 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T22.phpt b/ext/soap/tests/soap12/T22.phpt deleted file mode 100644 index 5844550ced671..0000000000000 --- a/ext/soap/tests/soap12/T22.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T22 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - foo - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foofoo -ok diff --git a/ext/soap/tests/soap12/T23.phpt b/ext/soap/tests/soap12/T23.phpt deleted file mode 100644 index c676fb176cfa2..0000000000000 --- a/ext/soap/tests/soap12/T23.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T23 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SendermustUnderstand value is not boolean diff --git a/ext/soap/tests/soap12/T24.phpt b/ext/soap/tests/soap12/T24.phpt deleted file mode 100644 index ebee3b764a4cb..0000000000000 --- a/ext/soap/tests/soap12/T24.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP 1.2: T24 echoOk ---SKIPIF-- - ---FILE-- - - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:VersionMismatchWrong Version diff --git a/ext/soap/tests/soap12/T25.phpt b/ext/soap/tests/soap12/T25.phpt deleted file mode 100644 index ac45e9c52ddd9..0000000000000 --- a/ext/soap/tests/soap12/T25.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T25 echoOk ---SKIPIF-- - ---FILE-- - - - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverDTD are not supported by SOAP diff --git a/ext/soap/tests/soap12/T26.phpt b/ext/soap/tests/soap12/T26.phpt deleted file mode 100644 index 53c8cec49507f..0000000000000 --- a/ext/soap/tests/soap12/T26.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -SOAP 1.2: T26 echoOk ---SKIPIF-- - ---FILE-- - - - - - foo - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T27.phpt b/ext/soap/tests/soap12/T27.phpt deleted file mode 100644 index 63711139942ef..0000000000000 --- a/ext/soap/tests/soap12/T27.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T27 echoStringArray ---SKIPIF-- - ---FILE-- - - - - - - - 1 - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverSOAP-ERROR: Encoding: Violation of encoding rules - diff --git a/ext/soap/tests/soap12/T28.phpt b/ext/soap/tests/soap12/T28.phpt deleted file mode 100644 index 6118b478d8a19..0000000000000 --- a/ext/soap/tests/soap12/T28.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T28 echoOk ---SKIPIF-- - ---FILE-- - - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SenderencodingStyle cannot be specified on the Body - diff --git a/ext/soap/tests/soap12/T29.phpt b/ext/soap/tests/soap12/T29.phpt deleted file mode 100644 index 3784da4030ac4..0000000000000 --- a/ext/soap/tests/soap12/T29.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T29 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T30.phpt b/ext/soap/tests/soap12/T30.phpt deleted file mode 100644 index c2e008ed4aa8a..0000000000000 --- a/ext/soap/tests/soap12/T30.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP 1.2: T30 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T31.phpt b/ext/soap/tests/soap12/T31.phpt deleted file mode 100644 index 56dc883a61eec..0000000000000 --- a/ext/soap/tests/soap12/T31.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T31 returnVoid ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok - diff --git a/ext/soap/tests/soap12/T32.phpt b/ext/soap/tests/soap12/T32.phpt deleted file mode 100644 index 8f77873f4c7fd..0000000000000 --- a/ext/soap/tests/soap12/T32.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T32 echoHeader ---SKIPIF-- - ---FILE-- - - - - foo - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T33.phpt b/ext/soap/tests/soap12/T33.phpt deleted file mode 100644 index 00ded875b5598..0000000000000 --- a/ext/soap/tests/soap12/T33.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SOAP 1.2: T33 nonexistentMethod ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -rpc:ProcedureNotPresentProcedure not present diff --git a/ext/soap/tests/soap12/T34.phpt b/ext/soap/tests/soap12/T34.phpt deleted file mode 100644 index 39e0095d43f41..0000000000000 --- a/ext/soap/tests/soap12/T34.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T34 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T35.phpt b/ext/soap/tests/soap12/T35.phpt deleted file mode 100644 index a736010ce0e01..0000000000000 --- a/ext/soap/tests/soap12/T35.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T35 unknownHdr ---SKIPIF-- - ---FILE-- - - - - - foo - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:MustUnderstandHeader not understood diff --git a/ext/soap/tests/soap12/T36.phpt b/ext/soap/tests/soap12/T36.phpt deleted file mode 100644 index d625813942cb2..0000000000000 --- a/ext/soap/tests/soap12/T36.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T36 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:MustUnderstandHeader not understood diff --git a/ext/soap/tests/soap12/T37.phpt b/ext/soap/tests/soap12/T37.phpt deleted file mode 100644 index cdce8a4429ddc..0000000000000 --- a/ext/soap/tests/soap12/T37.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T37 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok diff --git a/ext/soap/tests/soap12/T38_1.phpt b/ext/soap/tests/soap12/T38_1.phpt deleted file mode 100644 index 30007e55ef34e..0000000000000 --- a/ext/soap/tests/soap12/T38_1.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP 1.2: T38.1 doubleHdr ---SKIPIF-- - ---FILE-- - - - - foo - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T38_2.phpt b/ext/soap/tests/soap12/T38_2.phpt deleted file mode 100644 index efff2f4db3f7b..0000000000000 --- a/ext/soap/tests/soap12/T38_2.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP 1.2: T38.2 doubleHdr ---SKIPIF-- - ---FILE-- - - - - foo - bar - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foobar -ok diff --git a/ext/soap/tests/soap12/T39.phpt b/ext/soap/tests/soap12/T39.phpt deleted file mode 100644 index 2b29562aba976..0000000000000 --- a/ext/soap/tests/soap12/T39.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T39 unknownHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SendermustUnderstand value is not boolean diff --git a/ext/soap/tests/soap12/T40.phpt b/ext/soap/tests/soap12/T40.phpt deleted file mode 100644 index 27b4a21c47893..0000000000000 --- a/ext/soap/tests/soap12/T40.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP 1.2: T40 echoOK ---SKIPIF-- - ---FILE-- - - - - - foo - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - - -ok \ No newline at end of file diff --git a/ext/soap/tests/soap12/T41.phpt b/ext/soap/tests/soap12/T41.phpt deleted file mode 100644 index d57eead1e8c04..0000000000000 --- a/ext/soap/tests/soap12/T41.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP 1.2: T41 echoStruct ---SKIPIF-- - ---FILE-- - - - - - - 42 - 0.005 - hello world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world420.005 -ok diff --git a/ext/soap/tests/soap12/T42.phpt b/ext/soap/tests/soap12/T42.phpt deleted file mode 100644 index 7ce828135deaa..0000000000000 --- a/ext/soap/tests/soap12/T42.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -SOAP 1.2: T42 echoStructArray ---SKIPIF-- - ---FILE-- - - - - - - - 42 - 0.005 - hello world - - - 43 - 0.123 - bye world - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world420.005bye world430.123 -ok diff --git a/ext/soap/tests/soap12/T43.phpt b/ext/soap/tests/soap12/T43.phpt deleted file mode 100644 index 7dd631614462d..0000000000000 --- a/ext/soap/tests/soap12/T43.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -SOAP 1.2: T43 echoStructAsSimpleTypes ---SKIPIF-- - ---FILE-- - - - - - - 42 - 0.005 - hello world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -hello world420.005 -ok diff --git a/ext/soap/tests/soap12/T44.phpt b/ext/soap/tests/soap12/T44.phpt deleted file mode 100644 index 2264f105c8244..0000000000000 --- a/ext/soap/tests/soap12/T44.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP 1.2: T44 echoSimpleTypesAsStruct ---SKIPIF-- - ---FILE-- - - - - - 42 - 0.005 - hello world - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world420.005 -ok diff --git a/ext/soap/tests/soap12/T45.phpt b/ext/soap/tests/soap12/T45.phpt deleted file mode 100644 index 4bbcc818d4183..0000000000000 --- a/ext/soap/tests/soap12/T45.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SOAP 1.2: T45 echoNestedStruct ---SKIPIF-- - ---FILE-- - - - - - - 42 - 0.005 - hello world - - 99 - 5.5 - nested struct - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world420.005nested struct995.5 -ok diff --git a/ext/soap/tests/soap12/T46.phpt b/ext/soap/tests/soap12/T46.phpt deleted file mode 100644 index 9cbb4b16daf43..0000000000000 --- a/ext/soap/tests/soap12/T46.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP 1.2: T46 echoNestedArray ---SKIPIF-- - ---FILE-- - - - - - - 42 - 0.005 - hello world - - red - blue - green - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world420.005redbluegreen -ok diff --git a/ext/soap/tests/soap12/T47.phpt b/ext/soap/tests/soap12/T47.phpt deleted file mode 100644 index a9bb43e36820c..0000000000000 --- a/ext/soap/tests/soap12/T47.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T47 echoFloatArray ---SKIPIF-- - ---FILE-- - - - - - - 5.5 - 12999.9 - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return5.512999.9 -ok diff --git a/ext/soap/tests/soap12/T48.phpt b/ext/soap/tests/soap12/T48.phpt deleted file mode 100644 index 07ac4070aef48..0000000000000 --- a/ext/soap/tests/soap12/T48.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T48 echoStringArray ---SKIPIF-- - ---FILE-- - - - - - - hello - world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhelloworld -ok diff --git a/ext/soap/tests/soap12/T49.phpt b/ext/soap/tests/soap12/T49.phpt deleted file mode 100644 index c919e2b76ac11..0000000000000 --- a/ext/soap/tests/soap12/T49.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T49 echoStringArray ---SKIPIF-- - ---FILE-- - - - - - - hello - world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhelloworld -ok diff --git a/ext/soap/tests/soap12/T50.phpt b/ext/soap/tests/soap12/T50.phpt deleted file mode 100644 index 8e431e5aec460..0000000000000 --- a/ext/soap/tests/soap12/T50.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T50 echoIntegerArray ---SKIPIF-- - ---FILE-- - - - - - - 100 - 200 - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return100200 -ok diff --git a/ext/soap/tests/soap12/T51.phpt b/ext/soap/tests/soap12/T51.phpt deleted file mode 100644 index 97765763c1990..0000000000000 --- a/ext/soap/tests/soap12/T51.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP 1.2: T51 echoBase64 ---SKIPIF-- - ---FILE-- - - - - - - YUdWc2JHOGdkMjl5YkdRPQ== - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnYUdWc2JHOGdkMjl5YkdRPQ== -ok diff --git a/ext/soap/tests/soap12/T52.phpt b/ext/soap/tests/soap12/T52.phpt deleted file mode 100644 index 9d75fb9823506..0000000000000 --- a/ext/soap/tests/soap12/T52.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T52 echoBoolean ---SKIPIF-- - ---FILE-- - - - - - 1 - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returntrue -ok diff --git a/ext/soap/tests/soap12/T53.phpt b/ext/soap/tests/soap12/T53.phpt deleted file mode 100644 index c1c8fe63aaa59..0000000000000 --- a/ext/soap/tests/soap12/T53.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T53 echoDate ---SKIPIF-- - ---FILE-- - - - - - 1956-10-18T22:20:00-07:00 - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return1956-10-18T22:20:00-07:00 -ok diff --git a/ext/soap/tests/soap12/T54.phpt b/ext/soap/tests/soap12/T54.phpt deleted file mode 100644 index ba3ed35526986..0000000000000 --- a/ext/soap/tests/soap12/T54.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T54 echoDecimal ---SKIPIF-- - ---FILE-- - - - - - 123.45678901234567890 - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return123.45678901234567890 -ok diff --git a/ext/soap/tests/soap12/T55.phpt b/ext/soap/tests/soap12/T55.phpt deleted file mode 100644 index 1c12e504f2dd5..0000000000000 --- a/ext/soap/tests/soap12/T55.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T55 echoFloat ---SKIPIF-- - ---FILE-- - - - - - 0.005 - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return0.005 -ok diff --git a/ext/soap/tests/soap12/T56.phpt b/ext/soap/tests/soap12/T56.phpt deleted file mode 100644 index ca134270a3858..0000000000000 --- a/ext/soap/tests/soap12/T56.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SOAP 1.2: T56 echoString ---SKIPIF-- - ---FILE-- - - - - - - hello world - - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverSOAP-ERROR: Encoding: Unresolved reference '#data-2' - diff --git a/ext/soap/tests/soap12/T57.phpt b/ext/soap/tests/soap12/T57.phpt deleted file mode 100644 index ad3e9ef50f4aa..0000000000000 --- a/ext/soap/tests/soap12/T57.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP 1.2: T57 echoString ---SKIPIF-- - ---FILE-- - - - - - hello world - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world -ok diff --git a/ext/soap/tests/soap12/T58.phpt b/ext/soap/tests/soap12/T58.phpt deleted file mode 100644 index 1c3e8ba7f5916..0000000000000 --- a/ext/soap/tests/soap12/T58.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP 1.2: T58 echoIntegerArray ---SKIPIF-- - ---FILE-- - - - - - - 1 - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverSOAP-ERROR: Encoding: Violation of encoding rules - diff --git a/ext/soap/tests/soap12/T59.phpt b/ext/soap/tests/soap12/T59.phpt deleted file mode 100644 index 2ceef325bb29e..0000000000000 --- a/ext/soap/tests/soap12/T59.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP 1.2: T59 echoStringArray ---SKIPIF-- - ---FILE-- - - - - - - hello - world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverSOAP-ERROR: Encoding: Violation of id and ref information items '#data' diff --git a/ext/soap/tests/soap12/T60.phpt b/ext/soap/tests/soap12/T60.phpt deleted file mode 100644 index 234ef4ccd43ca..0000000000000 --- a/ext/soap/tests/soap12/T60.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SOAP 1.2: T60 countItems ---SKIPIF-- - ---FILE-- - - - - - - hello - world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -return2 -ok diff --git a/ext/soap/tests/soap12/T61.phpt b/ext/soap/tests/soap12/T61.phpt deleted file mode 100644 index b688a794ff07e..0000000000000 --- a/ext/soap/tests/soap12/T61.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP 1.2: T61 countItems ---SKIPIF-- - ---FILE-- - - - - - - hello - world - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverSOAP-ERROR: Encoding: '*' may only be first arraySize value in list diff --git a/ext/soap/tests/soap12/T63.phpt b/ext/soap/tests/soap12/T63.phpt deleted file mode 100644 index 8b7aa291a6ff7..0000000000000 --- a/ext/soap/tests/soap12/T63.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T63 validateCountryCode ---SKIPIF-- - ---FILE-- - - - - ABCD - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -Country code must be 2 letters.env:SenderNot a valid country code diff --git a/ext/soap/tests/soap12/T64.phpt b/ext/soap/tests/soap12/T64.phpt deleted file mode 100644 index 24e62ecb6b8c7..0000000000000 --- a/ext/soap/tests/soap12/T64.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T64 echoOk ---SKIPIF-- - ---FILE-- - - -]> - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverDTD are not supported by SOAP diff --git a/ext/soap/tests/soap12/T65.phpt b/ext/soap/tests/soap12/T65.phpt deleted file mode 100644 index cd96d4a82f875..0000000000000 --- a/ext/soap/tests/soap12/T65.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP 1.2: T65 echoOk ---SKIPIF-- - ---FILE-- - - - - -]> - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:ReceiverDTD are not supported by SOAP diff --git a/ext/soap/tests/soap12/T66.phpt b/ext/soap/tests/soap12/T66.phpt deleted file mode 100644 index cc7cc2e3e3b38..0000000000000 --- a/ext/soap/tests/soap12/T66.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T66 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T67.phpt b/ext/soap/tests/soap12/T67.phpt deleted file mode 100644 index ddc527a6ec3c9..0000000000000 --- a/ext/soap/tests/soap12/T67.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T67 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T68.phpt b/ext/soap/tests/soap12/T68.phpt deleted file mode 100644 index a7915196cbf74..0000000000000 --- a/ext/soap/tests/soap12/T68.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP 1.2: T68 echoOk ---SKIPIF-- - ---FILE-- - - - - - - foo - - - - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T69.phpt b/ext/soap/tests/soap12/T69.phpt deleted file mode 100644 index 0fb02dec0680c..0000000000000 --- a/ext/soap/tests/soap12/T69.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP 1.2: T69 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SenderBody must be present in a SOAP envelope diff --git a/ext/soap/tests/soap12/T70.phpt b/ext/soap/tests/soap12/T70.phpt deleted file mode 100644 index 3622c320e74be..0000000000000 --- a/ext/soap/tests/soap12/T70.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T70 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SenderA SOAP 1.2 envelope can contain only Header and Body diff --git a/ext/soap/tests/soap12/T71.phpt b/ext/soap/tests/soap12/T71.phpt deleted file mode 100644 index fdb5b8d46066d..0000000000000 --- a/ext/soap/tests/soap12/T71.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T71 echoOk ---SKIPIF-- - ---FILE-- - - - - - foo - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SenderA SOAP Envelope element cannot have non Namespace qualified attributes diff --git a/ext/soap/tests/soap12/T72.phpt b/ext/soap/tests/soap12/T72.phpt deleted file mode 100644 index b8f5060c6bc04..0000000000000 --- a/ext/soap/tests/soap12/T72.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SOAP 1.2: T72 echoOk ---SKIPIF-- - ---FILE-- - - - - - foo - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:SenderencodingStyle cannot be specified on the Envelope diff --git a/ext/soap/tests/soap12/T73.phpt b/ext/soap/tests/soap12/T73.phpt deleted file mode 100644 index 9143e58179d22..0000000000000 --- a/ext/soap/tests/soap12/T73.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SOAP 1.2: T73 echoString ---SKIPIF-- - ---FILE-- - - - - - hello world - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world -ok diff --git a/ext/soap/tests/soap12/T74.phpt b/ext/soap/tests/soap12/T74.phpt deleted file mode 100644 index 703e1870a629c..0000000000000 --- a/ext/soap/tests/soap12/T74.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP 1.2: T74 doubleHdr ---SKIPIF-- - ---FILE-- - - - - foo - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T75.phpt b/ext/soap/tests/soap12/T75.phpt deleted file mode 100644 index 3e2166d957b73..0000000000000 --- a/ext/soap/tests/soap12/T75.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -SOAP 1.2: T75 echoResolvedRef ---SKIPIF-- - ---FILE-- - - - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -http://example.org/today/new.xml -ok diff --git a/ext/soap/tests/soap12/T76_1.phpt b/ext/soap/tests/soap12/T76_1.phpt deleted file mode 100644 index e97c1797684aa..0000000000000 --- a/ext/soap/tests/soap12/T76_1.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T76.1 echoString ---SKIPIF-- - ---FILE-- - - - - - hello world - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world -ok diff --git a/ext/soap/tests/soap12/T76_2.phpt b/ext/soap/tests/soap12/T76_2.phpt deleted file mode 100644 index cc6ea0df9583f..0000000000000 --- a/ext/soap/tests/soap12/T76_2.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SOAP 1.2: T76.2 echoString ---SKIPIF-- - ---FILE-- - - - - - hello world - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnhello world -ok diff --git a/ext/soap/tests/soap12/T77_1.phpt b/ext/soap/tests/soap12/T77_1.phpt deleted file mode 100644 index d847b6cfd8842..0000000000000 --- a/ext/soap/tests/soap12/T77_1.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -SOAP 1.2: T77.1 isNil ---SKIPIF-- - ---FILE-- - - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returntrue -ok diff --git a/ext/soap/tests/soap12/T77_2.phpt b/ext/soap/tests/soap12/T77_2.phpt deleted file mode 100644 index c829b57892a31..0000000000000 --- a/ext/soap/tests/soap12/T77_2.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SOAP 1.2: T77.2 isNil ---SKIPIF-- - ---FILE-- - - - - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returntrue -ok diff --git a/ext/soap/tests/soap12/T77_3.phpt b/ext/soap/tests/soap12/T77_3.phpt deleted file mode 100644 index 0e1355a5a2814..0000000000000 --- a/ext/soap/tests/soap12/T77_3.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -SOAP 1.2: T77.3 isNul ---SKIPIF-- - ---FILE-- - - - - - - This is a string - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -returnfalse -ok diff --git a/ext/soap/tests/soap12/T78.phpt b/ext/soap/tests/soap12/T78.phpt deleted file mode 100644 index 63d13c7cae176..0000000000000 --- a/ext/soap/tests/soap12/T78.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -SOAP 1.2: T78 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -foo -ok diff --git a/ext/soap/tests/soap12/T80.phpt b/ext/soap/tests/soap12/T80.phpt deleted file mode 100644 index 1ac114ba3288e..0000000000000 --- a/ext/soap/tests/soap12/T80.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SOAP 1.2: T80 echoOk ---SKIPIF-- - ---FILE-- - - - - foo - - -EOF; -include "soap12-test.inc"; -?> ---EXPECT-- - -env:DataEncodingUnknownUnknown Data Encoding Style diff --git a/ext/soap/tests/soap12/skipif.inc b/ext/soap/tests/soap12/skipif.inc deleted file mode 100644 index fa8574e6a25c2..0000000000000 --- a/ext/soap/tests/soap12/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/soap/tests/soap12/soap12-test.inc b/ext/soap/tests/soap12/soap12-test.inc deleted file mode 100644 index 9774729d292ac..0000000000000 --- a/ext/soap/tests/soap12/soap12-test.inc +++ /dev/null @@ -1,130 +0,0 @@ - $struct->varString, - 'outputInteger' => $struct->varInt, - 'outputFloat' => $struct->varFloat); - } - - function echoSimpleTypesAsStruct($string, $int, $float) { - return (object)array("varString" => $string, - "varInt" => $int, - "varFloat" => $float); - } - - function echoNestedStruct($struct) { - return $struct; - } - - function echo2DStringArray($ary) { - return $ary; - } - - function echoNestedArray($ary) { - return $ary; - } - - function countItems($input) { - return count($input); - } - - function isNil($input) { - return is_null($input); - } - - function returnVoid() { - } - - function emptyBody() { - } - - function requiredHeader($x) { - $this->header = $x; - } - - function echoHeader() { - return $this->header; - } - - function echoResolvedRef($ref) { - return $ref->RelativeReference->base.$ref->RelativeReference->href; - } - - function validateCountryCode($code) { - if (strlen($code) != 2) { - return new SoapFault("Client", "Not a valid country code", NULL, NULL, NULL, new SoapHeader("http://example.org/ts-tests", "validateCountryCodeFault", "Country code must be 2 letters.")); - } else { - return "OK"; - } - } - -} - -$server = new soapserver(dirname(__FILE__)."/soap12-test.wsdl", array('soap_version'=>SOAP_1_2,'actor'=>"http://example.org/ts-tests/C")); -$server->setClass("Soap12test"); - -$server->handle(); -echo "ok\n"; -?> diff --git a/ext/soap/tests/soap12/soap12-test.wsdl b/ext/soap/tests/soap12/soap12-test.wsdl deleted file mode 100644 index d1679b475d84c..0000000000000 --- a/ext/soap/tests/soap12/soap12-test.wsdl +++ /dev/null @@ -1,771 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/test.wsdl b/ext/soap/tests/test.wsdl deleted file mode 100644 index 0740b7db6212a..0000000000000 --- a/ext/soap/tests/test.wsdl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/soap/tests/transport001.phpt b/ext/soap/tests/transport001.phpt deleted file mode 100644 index 9134d3d7fb89b..0000000000000 --- a/ext/soap/tests/transport001.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -SOAP Transport 1: Local transport using SoapClient::__doRequest ---SKIPIF-- - ---FILE-- -server = new SoapServer($wsdl, $options); - $this->server->addFunction('Add'); - } - - function __doRequest($request, $location, $action, $version) { - ob_start(); - $this->server->handle($request); - $response = ob_get_contents(); - ob_end_clean(); - return $response; - } - -} - -$x = new LocalSoapClient(NULL,array('location'=>'test://', - 'uri'=>'http://testuri.org')); -var_dump($x->Add(3,4)); -echo "ok\n"; -?> ---EXPECT-- -int(7) -ok diff --git a/ext/sockets/CREDITS b/ext/sockets/CREDITS deleted file mode 100644 index 2be7552d7990d..0000000000000 --- a/ext/sockets/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sockets -Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4 deleted file mode 100644 index e88b54ecda406..0000000000000 --- a/ext/sockets/config.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(sockets, whether to enable sockets support, -[ --enable-sockets Enable sockets support]) - -if test "$PHP_SOCKETS" != "no"; then - dnl Check for struct cmsghdr - AC_CACHE_CHECK([for struct cmsghdr], ac_cv_cmsghdr, - [ - AC_TRY_COMPILE([ -#include -#include ], [struct cmsghdr s; s], ac_cv_cmsghdr=yes, ac_cv_cmsghdr=no) - ]) - - if test "$ac_cv_cmsghdr" = yes; then - AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr]) - fi - - AC_CHECK_FUNCS([hstrerror]) - AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h errno.h]) - AC_TRY_COMPILE([ -#include -#include - ], [static struct msghdr tp; int n = (int) tp.msg_flags; return n],[], - [AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])] - ) - AC_DEFINE([HAVE_SOCKETS], 1, [ ]) - - PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared]) -fi - -PHP_CHECK_FUNC(gethostbyname2) - diff --git a/ext/sockets/config.w32 b/ext/sockets/config.w32 deleted file mode 100644 index 587b9a1b127ff..0000000000000 --- a/ext/sockets/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("sockets", "SOCKETS support", "no"); - -if (PHP_SOCKETS != "no") { - - if (CHECK_LIB("ws2_32.lib", "sockets", PHP_SOCKETS)) { - EXTENSION('sockets', 'sockets.c php_sockets_win.c'); - AC_DEFINE('HAVE_SOCKETS', 1); - } else { - WARNING("sockets not enabled; libraries and headers not found"); - } -} - diff --git a/ext/sockets/package.xml b/ext/sockets/package.xml deleted file mode 100644 index bd1ba3f99f139..0000000000000 --- a/ext/sockets/package.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - sockets - Socket functions - - - ??? - Chris Vandomelen - chrisv@b0rked.dhs.org - lead - - - sterling - Sterling Hughes - sterling@php.net - lead - - - jason - Jason Greene - jason@php.net - lead - - - ??? - Daniel Beulshausen - daniel@php4win.de - lead - - - -The socket extension implements a low-level interface to the socket -communication functions based on the popular BSD sockets, providing -the possibility to act as a socket server as well as a client. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h deleted file mode 100644 index 815f0e749ddaa..0000000000000 --- a/ext/sockets/php_sockets.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chris Vandomelen | - | Sterling Hughes | - | | - | WinSock: Daniel Beulshausen | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_SOCKETS_H -#define PHP_SOCKETS_H - -/* $Id$ */ - -#if HAVE_SOCKETS - -extern zend_module_entry sockets_module_entry; -#define phpext_sockets_ptr &sockets_module_entry - -#ifdef PHP_WIN32 -#define PHP_SOCKETS_API __declspec(dllexport) -#include -#else -#define PHP_SOCKETS_API -#if HAVE_SYS_SOCKET_H -#include -#endif -#endif - -PHP_MINIT_FUNCTION(sockets); -PHP_MINFO_FUNCTION(sockets); -PHP_RINIT_FUNCTION(sockets); -PHP_RSHUTDOWN_FUNCTION(sockets); - -PHP_FUNCTION(socket_select); -PHP_FUNCTION(socket_create_listen); -PHP_FUNCTION(socket_create_pair); -PHP_FUNCTION(socket_accept); -PHP_FUNCTION(socket_set_nonblock); -PHP_FUNCTION(socket_set_block); -PHP_FUNCTION(socket_listen); -PHP_FUNCTION(socket_close); -PHP_FUNCTION(socket_write); -PHP_FUNCTION(socket_read); -PHP_FUNCTION(socket_getsockname); -PHP_FUNCTION(socket_getpeername); -PHP_FUNCTION(socket_create); -PHP_FUNCTION(socket_connect); -PHP_FUNCTION(socket_strerror); -PHP_FUNCTION(socket_bind); -PHP_FUNCTION(socket_recv); -PHP_FUNCTION(socket_send); -PHP_FUNCTION(socket_recvfrom); -PHP_FUNCTION(socket_sendto); -PHP_FUNCTION(socket_get_option); -PHP_FUNCTION(socket_set_option); -PHP_FUNCTION(socket_shutdown); -PHP_FUNCTION(socket_last_error); -PHP_FUNCTION(socket_clear_error); - -#ifndef PHP_WIN32 -typedef int PHP_SOCKET; -#else -typedef SOCKET PHP_SOCKET; -#endif - -typedef struct { - PHP_SOCKET bsd_socket; - int type; - int error; -} php_socket; - -/* Prototypes */ -#ifdef ilia_0 /* not needed, only causes a compiler warning */ -static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSRMLS_DC); -static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la TSRMLS_DC); -static int php_read(int bsd_socket, void *buf, size_t maxlen, int flags); -static char *php_strerror(int error TSRMLS_DC); -#endif - -ZEND_BEGIN_MODULE_GLOBALS(sockets) - int last_error; - char *strerror_buf; -ZEND_END_MODULE_GLOBALS(sockets) - -#ifdef ZTS -#define SOCKETS_G(v) TSRMG(sockets_globals_id, zend_sockets_globals *, v) -#else -#define SOCKETS_G(v) (sockets_globals.v) -#endif - -#else -#define phpext_sockets_ptr NULL -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - diff --git a/ext/sockets/php_sockets_win.c b/ext/sockets/php_sockets_win.c deleted file mode 100644 index 82729630a5fdb..0000000000000 --- a/ext/sockets/php_sockets_win.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chris Vandomelen | - | Sterling Hughes | - | | - | WinSock: Daniel Beulshausen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef PHP_WIN32 - -#include -#include - -#include "php.h" -#include "php_sockets.h" -#include "php_sockets_win.h" - -int socketpair(int domain, int type, int protocol, SOCKET sock[2]) { - struct sockaddr_in address; - SOCKET redirect; - int size = sizeof(address); - - if(domain != AF_INET) { - set_errno(WSAENOPROTOOPT); - return -1; - } - - - sock[0] = socket(domain, type, protocol); - address.sin_addr.s_addr = INADDR_ANY; - address.sin_family = AF_INET; - address.sin_port = 0; - - bind(sock[0], (struct sockaddr*)&address, sizeof(address)); - if(getsockname(sock[0], (struct sockaddr *)&address, &size) != 0) { - - } - - listen(sock[0], 2); - sock[1] = socket(domain, type, protocol); - address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - - connect(sock[1], (struct sockaddr*)&address, sizeof(address)); - redirect = accept(sock[0],(struct sockaddr*)&address, &size); - - close(sock[0]); - sock[0] = redirect; - - if(sock[0] == INVALID_SOCKET ) { - close(sock[0]); - close(sock[1]); - set_errno(WSAECONNABORTED); - return -1; - } - - return 0; -} - -int inet_aton(const char *cp, struct in_addr *inp) { - inp->s_addr = inet_addr(cp); - - if (inp->s_addr == INADDR_NONE) { - return 0; - } - - return 1; -} - -int fcntl(int fd, int cmd, ...) { - va_list va; - int retval, io, mode; - - va_start(va, cmd); - - switch(cmd) { - case F_GETFL: - case F_SETFD: - case F_GETFD: - default: - retval = -1; - break; - - case F_SETFL: - io = va_arg(va, int); - mode = io == O_NONBLOCK ? 1 : 0; - retval = ioctlsocket(fd, io, &mode); - break; - } - - va_end(va); - return retval; -} -#endif diff --git a/ext/sockets/php_sockets_win.h b/ext/sockets/php_sockets_win.h deleted file mode 100644 index f0cf2c6703f8c..0000000000000 --- a/ext/sockets/php_sockets_win.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chris Vandomelen | - | Sterling Hughes | - | | - | WinSock: Daniel Beulshausen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef PHP_WIN32 - -#define F_SETFL 0 -#define F_GETFL 1 -#define F_SETFD 2 -#define F_GETFD 3 - -#define O_NONBLOCK FIONBIO - -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ECONNRESET WSAECONNRESET - -#ifdef errno -#undef errno -#endif - -#define errno WSAGetLastError() -#define h_errno WSAGetLastError() -#define set_errno(a) WSASetLastError(a) -#define close(a) closesocket(a) - -struct sockaddr_un { - short sun_family; - char sun_path[108]; -}; - -int socketpair(int domain, int type, int protocol, SOCKET sock[2]); -int inet_aton(const char *cp, struct in_addr *inp); -int fcntl(int fd, int cmd, ...); - -#endif diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c deleted file mode 100644 index 44a40a5e01166..0000000000000 --- a/ext/sockets/sockets.c +++ /dev/null @@ -1,1786 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chris Vandomelen | - | Sterling Hughes | - | Jason Greene | - | WinSock: Daniel Beulshausen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_SOCKETS - -#include "php_network.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifndef PHP_WIN32 -# include "php_sockets.h" -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# define IS_INVALID_SOCKET(a) (a->bsd_socket < 0) -# define set_errno(a) (errno = a) -#else /* windows */ -# include "php_sockets.h" -# include "php_sockets_win.h" -# define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(sockets) - -#ifndef MSG_WAITALL -#ifdef LINUX -#define MSG_WAITALL 0x00000100 -#else -#define MSG_WAITALL 0x00000000 -#endif -#endif - -#ifndef SUN_LEN -#define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) -#endif - -#ifndef PF_INET -#define PF_INET AF_INET -#endif - -static char *php_strerror(int error TSRMLS_DC); - -#define PHP_NORMAL_READ 0x0001 -#define PHP_BINARY_READ 0x0002 - -#define PHP_SOCKET_ERROR(socket,msg,errn) socket->error = errn; \ - SOCKETS_G(last_error) = errn; \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, errn, php_strerror(errn TSRMLS_CC)) - -static int le_socket; -#define le_socket_name "Socket" - -static - ZEND_BEGIN_ARG_INFO(first_through_third_args_force_ref, 0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(second_and_third_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(second_fifth_and_sixth_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -/* {{{ sockets_functions[] - */ -function_entry sockets_functions[] = { - PHP_FE(socket_select, first_through_third_args_force_ref) - PHP_FE(socket_create, NULL) - PHP_FE(socket_create_listen, NULL) - PHP_FE(socket_create_pair, fourth_arg_force_ref) - PHP_FE(socket_accept, NULL) - PHP_FE(socket_set_nonblock, NULL) - PHP_FE(socket_set_block, NULL) - PHP_FE(socket_listen, NULL) - PHP_FE(socket_close, NULL) - PHP_FE(socket_write, NULL) - PHP_FE(socket_read, NULL) - PHP_FE(socket_getsockname, second_and_third_args_force_ref) - PHP_FE(socket_getpeername, second_and_third_args_force_ref) - PHP_FE(socket_connect, NULL) - PHP_FE(socket_strerror, NULL) - PHP_FE(socket_bind, NULL) - PHP_FE(socket_recv, second_arg_force_ref) - PHP_FE(socket_send, NULL) - PHP_FE(socket_recvfrom, second_fifth_and_sixth_args_force_ref) - PHP_FE(socket_sendto, NULL) - PHP_FE(socket_get_option, NULL) - PHP_FE(socket_set_option, NULL) - PHP_FE(socket_shutdown, NULL) - PHP_FE(socket_last_error, NULL) - PHP_FE(socket_clear_error, NULL) - - /* for downwards compatability */ - PHP_FALIAS(socket_getopt, socket_get_option, NULL) - PHP_FALIAS(socket_setopt, socket_set_option, NULL) - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry sockets_module_entry = { - STANDARD_MODULE_HEADER, - "sockets", - sockets_functions, - PHP_MINIT(sockets), - NULL, - PHP_RINIT(sockets), - PHP_RSHUTDOWN(sockets), - PHP_MINFO(sockets), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_SOCKETS -ZEND_GET_MODULE(sockets) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* inet_ntop should be used instead of inet_ntoa */ -int inet_ntoa_lock = 0; - -static void php_destroy_socket(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_socket *php_sock = (php_socket *) rsrc->ptr; - - close(php_sock->bsd_socket); - efree(php_sock); -} - -static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSRMLS_DC) -{ - struct sockaddr_in la; - struct hostent *hp; - php_socket *sock = (php_socket*)emalloc(sizeof(php_socket)); - - *php_sock = sock; - -#ifndef PHP_WIN32 - if ((hp = gethostbyname("0.0.0.0")) == NULL) { -#else - if ((hp = gethostbyname("localhost")) == NULL) { -#endif - efree(sock); - return 0; - } - - memcpy((char *) &la.sin_addr, hp->h_addr, hp->h_length); - la.sin_family = hp->h_addrtype; - la.sin_port = htons((unsigned short) port); - - sock->bsd_socket = socket(PF_INET, SOCK_STREAM, 0); - - if (IS_INVALID_SOCKET(sock)) { - PHP_SOCKET_ERROR(sock, "unable to create listening socket", errno); - efree(sock); - return 0; - } - - sock->type = PF_INET; - - if (bind(sock->bsd_socket, (struct sockaddr *)&la, sizeof(la)) < 0) { - PHP_SOCKET_ERROR(sock, "unable to bind to given adress", errno); - close(sock->bsd_socket); - efree(sock); - return 0; - } - - if (listen(sock->bsd_socket, backlog) < 0) { - PHP_SOCKET_ERROR(sock, "unable to listen on socket", errno); - close(sock->bsd_socket); - efree(sock); - return 0; - } - - return 1; -} - -static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la TSRMLS_DC) -{ - socklen_t salen; - php_socket *out_sock = (php_socket*)emalloc(sizeof(php_socket)); - - *new_sock = out_sock; - salen = sizeof(*la); - - out_sock->bsd_socket = accept(in_sock->bsd_socket, la, &salen); - - if (IS_INVALID_SOCKET(out_sock)) { - PHP_SOCKET_ERROR(out_sock, "unable to accept incoming connection", errno); - efree(out_sock); - return 0; - } - - return 1; -} - -/* {{{ php_read -- wrapper around read() so that it only reads to a \r or \n. */ -static int php_read(int bsd_socket, void *buf, size_t maxlen, int flags) -{ - int m = 0; - size_t n = 0; - int no_read = 0; - int nonblock = 0; - char *t = (char *) buf; - - m = fcntl(bsd_socket, F_GETFL); - if (m < 0) { - return m; - } - - nonblock = (m & O_NONBLOCK); - m = 0; - - set_errno(0); - - *t = '\0'; - while (*t != '\n' && *t != '\r' && n < maxlen) { - if (m > 0) { - t++; - n++; - } else if (m == 0) { - no_read++; - if (nonblock && no_read >= 2) { - return n; - /* The first pass, m always is 0, so no_read becomes 1 - * in the first pass. no_read becomes 2 in the second pass, - * and if this is nonblocking, we should return.. */ - } - - if (no_read > 200) { - set_errno(ECONNRESET); - return -1; - } - } - - if (n < maxlen) { - m = recv(bsd_socket, (void *) t, 1, flags); - } - - if (errno != 0 && errno != ESPIPE && errno != EAGAIN) { - return -1; - } - - set_errno(0); - } - - if (n < maxlen) { - n++; - /* The only reasons it makes it to here is - * if '\n' or '\r' are encountered. So, increase - * the return by 1 to make up for the lack of the - * '\n' or '\r' in the count (since read() takes - * place at the end of the loop..) */ - } - - return n; -} -/* }}} */ - -static char *php_strerror(int error TSRMLS_DC) -{ - const char *buf; - -#ifndef PHP_WIN32 - if (error < -10000) { - error = -error - 10000; - -#ifdef HAVE_HSTRERROR - buf = hstrerror(error); -#else - { - if (SOCKETS_G(strerror_buf)) { - efree(SOCKETS_G(strerror_buf)); - } - - spprintf(&(SOCKETS_G(strerror_buf)), 0, "Host lookup error %d", error); - buf = SOCKETS_G(strerror_buf); - } -#endif - } else { - buf = strerror(error); - } -#else - { - LPTSTR tmp = NULL; - buf = NULL; - - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &tmp, 0, NULL)) { - - if (SOCKETS_G(strerror_buf)) { - efree(SOCKETS_G(strerror_buf)); - } - - SOCKETS_G(strerror_buf) = estrdup(tmp); - LocalFree(tmp); - - buf = SOCKETS_G(strerror_buf); - } - } -#endif - - return (buf ? (char *) buf : ""); -} - -#if HAVE_IPV6 -/* Sets addr by hostname, or by ip in string form (AF_INET6) */ -static int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC) -{ - struct in6_addr tmp; -#if HAVE_GETADDRINFO - struct addrinfo hints; - struct addrinfo *addrinfo = NULL; -#endif - - if (inet_pton(AF_INET6, string, &tmp)) { - memcpy(&(sin6->sin6_addr.s6_addr), &(tmp.s6_addr), sizeof(struct in6_addr)); - } else { -#if HAVE_GETADDRINFO - - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = PF_INET6; - getaddrinfo(string, NULL, &hints, &addrinfo); - if (!addrinfo) { -#ifdef PHP_WIN32 - PHP_SOCKET_ERROR(php_sock, "Host lookup failed", WSAGetLastError()); -#else - PHP_SOCKET_ERROR(php_sock, "Host lookup failed", (-10000 - h_errno)); -#endif - return 0; - } - if (addrinfo->ai_family != PF_INET6 || addrinfo->ai_addrlen != sizeof(struct sockaddr_in6)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET6 domain returned on AF_INET6 socket"); - freeaddrinfo(addrinfo); - return 0; - } - - memcpy(&(sin6->sin6_addr.s6_addr), ((struct sockaddr_in6*)(addrinfo->ai_addr))->sin6_addr.s6_addr, sizeof(struct in6_addr)); - freeaddrinfo(addrinfo); - -#else - /* No IPv6 specific hostname resolution is available on this system? */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: getaddrinfo() not available on this system."); - return 0; -#endif - - } - - return 1; -} -#endif - -/* Sets addr by hostname, or by ip in string form (AF_INET) */ -static int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock TSRMLS_DC) -{ - struct in_addr tmp; - struct hostent *host_entry; - - if (inet_aton(string, &tmp)) { - sin->sin_addr.s_addr = tmp.s_addr; - } else { - if (! (host_entry = gethostbyname(string))) { - /* Note: < -10000 indicates a host lookup error */ -#ifdef PHP_WIN32 - PHP_SOCKET_ERROR(php_sock, "Host lookup failed", WSAGetLastError()); -#else - PHP_SOCKET_ERROR(php_sock, "Host lookup failed", (-10000 - h_errno)); -#endif - return 0; - } - if (host_entry->h_addrtype != AF_INET) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET domain returned on AF_INET socket"); - return 0; - } - memcpy(&(sin->sin_addr.s_addr), host_entry->h_addr_list[0], host_entry->h_length); - } - - return 1; -} - -static void php_sockets_init_globals(zend_sockets_globals *sockets_globals TSRMLS_DC) -{ - sockets_globals->last_error = 0; - sockets_globals->strerror_buf = NULL; -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sockets) -{ - struct protoent *pe; - - ZEND_INIT_MODULE_GLOBALS(sockets, php_sockets_init_globals, NULL); - - le_socket = zend_register_list_destructors_ex(php_destroy_socket, NULL, le_socket_name, module_number); - - REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("AF_INET", AF_INET, CONST_CS | CONST_PERSISTENT); -#if HAVE_IPV6 - REGISTER_LONG_CONSTANT("AF_INET6", AF_INET6, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("SOCK_STREAM", SOCK_STREAM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOCK_DGRAM", SOCK_DGRAM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOCK_RAW", SOCK_RAW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOCK_SEQPACKET",SOCK_SEQPACKET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOCK_RDM", SOCK_RDM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSG_OOB", MSG_OOB, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSG_WAITALL", MSG_WAITALL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSG_PEEK", MSG_PEEK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("MSG_DONTROUTE", MSG_DONTROUTE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_DEBUG", SO_DEBUG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_REUSEADDR", SO_REUSEADDR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_KEEPALIVE", SO_KEEPALIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_DONTROUTE", SO_DONTROUTE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_LINGER", SO_LINGER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_BROADCAST", SO_BROADCAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_OOBINLINE", SO_OOBINLINE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_SNDBUF", SO_SNDBUF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_RCVBUF", SO_RCVBUF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_SNDLOWAT", SO_SNDLOWAT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_RCVLOWAT", SO_RCVLOWAT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_SNDTIMEO", SO_SNDTIMEO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_RCVTIMEO", SO_RCVTIMEO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_TYPE", SO_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SO_ERROR", SO_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOL_SOCKET", SOL_SOCKET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOMAXCONN", SOMAXCONN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_NORMAL_READ", PHP_NORMAL_READ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHP_BINARY_READ", PHP_BINARY_READ, CONST_CS | CONST_PERSISTENT); - -#ifndef WIN32 -# include "unix_socket_constants.h" -#else -# include "win32_socket_constants.h" -#endif - - if ((pe = getprotobyname("tcp"))) { - REGISTER_LONG_CONSTANT("SOL_TCP", pe->p_proto, CONST_CS | CONST_PERSISTENT); - } - - if ((pe = getprotobyname("udp"))) { - REGISTER_LONG_CONSTANT("SOL_UDP", pe->p_proto, CONST_CS | CONST_PERSISTENT); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(sockets) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Sockets Support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(sockets) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(sockets) -{ - if (SOCKETS_G(strerror_buf)) { - efree(SOCKETS_G(strerror_buf)); - SOCKETS_G(strerror_buf) = NULL; - } - - return SUCCESS; -} -/* }}} */ - -static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *max_fd TSRMLS_DC) -{ - zval **element; - php_socket *php_sock; - - if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0; - - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(sock_array)); - zend_hash_get_current_data(Z_ARRVAL_P(sock_array), (void **) &element) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(sock_array))) { - - php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket); - if (!php_sock) continue; /* If element is not a resource, skip it */ - - PHP_SAFE_FD_SET(php_sock->bsd_socket, fds); - if (php_sock->bsd_socket > *max_fd) { - *max_fd = php_sock->bsd_socket; - } - } - - return 1; -} - -static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) -{ - zval **element; - zval **dest_element; - php_socket *php_sock; - HashTable *new_hash; - - if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0; - - ALLOC_HASHTABLE(new_hash); - zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0); - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(sock_array)); - zend_hash_get_current_data(Z_ARRVAL_P(sock_array), (void **) &element) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(sock_array))) { - - php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket); - if (!php_sock) continue; /* If element is not a resource, skip it */ - - if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) { - /* Add fd to new array */ - zend_hash_next_index_insert(new_hash, (void *)element, sizeof(zval *), (void **)&dest_element); - if (dest_element) zval_add_ref(dest_element); - } - } - - /* Destroy old array, add new one */ - zend_hash_destroy(Z_ARRVAL_P(sock_array)); - efree(Z_ARRVAL_P(sock_array)); - - zend_hash_internal_pointer_reset(new_hash); - Z_ARRVAL_P(sock_array) = new_hash; - - return 1; -} - -/* {{{ proto int socket_select(array &read_fds, array &write_fds, &array except_fds, int tv_sec[, int tv_usec]) - Runs the select() system call on the sets mentioned with a timeout specified by tv_sec and tv_usec */ -PHP_FUNCTION(socket_select) -{ - zval *r_array, *w_array, *e_array, *sec; - struct timeval tv; - struct timeval *tv_p = NULL; - fd_set rfds, wfds, efds; - PHP_SOCKET max_fd = 0; - int retval, sets = 0; - long usec = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) - return; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_ZERO(&efds); - - if (r_array != NULL) sets += php_sock_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC); - if (w_array != NULL) sets += php_sock_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC); - if (e_array != NULL) sets += php_sock_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC); - - if (!sets) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no resource arrays were passed to select"); - RETURN_FALSE; - } - - PHP_SAFE_MAX_FD(max_fd, 0); /* someone needs to make this look more like stream_socket_select */ - - /* If seconds is not set to null, build the timeval, else we wait indefinitely */ - if (sec != NULL) { - zval tmp; - - if (Z_TYPE_P(sec) != IS_LONG) { - tmp = *sec; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - sec = &tmp; - } - - /* Solaris + BSD do not like microsecond values which are >= 1 sec */ - if (usec > 999999) { - tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); - tv.tv_usec = usec % 1000000; - } else { - tv.tv_sec = Z_LVAL_P(sec); - tv.tv_usec = usec; - } - - tv_p = &tv; - - if (sec == &tmp) { - zval_dtor(&tmp); - } - } - - retval = select(max_fd+1, &rfds, &wfds, &efds, tv_p); - - if (retval == -1) { - SOCKETS_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s", errno, php_strerror(errno TSRMLS_CC)); - RETURN_FALSE; - } - - if (r_array != NULL) php_sock_array_from_fd_set(r_array, &rfds TSRMLS_CC); - if (w_array != NULL) php_sock_array_from_fd_set(w_array, &wfds TSRMLS_CC); - if (e_array != NULL) php_sock_array_from_fd_set(e_array, &efds TSRMLS_CC); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto resource socket_create_listen(int port[, int backlog]) - Opens a socket on port to accept connections */ -PHP_FUNCTION(socket_create_listen) -{ - php_socket *php_sock; - long port, backlog = 128; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &port, &backlog) == FAILURE) - return; - - if (!php_open_listen_sock(&php_sock, port, backlog TSRMLS_CC)) { - RETURN_FALSE; - } - - php_sock->error = 0; - - ZEND_REGISTER_RESOURCE(return_value, php_sock, le_socket); -} -/* }}} */ - -/* {{{ proto resource socket_accept(resource socket) - Accepts a connection on the listening socket fd */ -PHP_FUNCTION(socket_accept) -{ - zval *arg1; - php_socket *php_sock, *new_sock; - struct sockaddr_in sa; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr *) &sa TSRMLS_CC)) { - RETURN_FALSE; - } - - new_sock->error = 0; - - ZEND_REGISTER_RESOURCE(return_value, new_sock, le_socket); -} -/* }}} */ - -/* {{{ proto bool socket_set_nonblock(resource socket) - Sets nonblocking mode on a socket resource */ -PHP_FUNCTION(socket_set_nonblock) -{ - zval *arg1; - php_socket *php_sock; - int flags; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - flags = fcntl(php_sock->bsd_socket, F_GETFL); - - /* Safely append non blocking to other flags unless the get fails. - * Note: This does not abort on failure becuse getfl will always fail - * under the current win32 code. */ - if (flags > -1) flags |= O_NONBLOCK; - else flags = O_NONBLOCK; - - if (fcntl(php_sock->bsd_socket, F_SETFL, flags) > -1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool socket_set_block(resource socket) - Sets blocking mode on a socket resource */ -PHP_FUNCTION(socket_set_block) -{ - zval *arg1; - php_socket *php_sock; - int flags; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - flags = fcntl(php_sock->bsd_socket, F_GETFL); - - /* Safely remove blocking from flags unless the get fails. - * Note: This does not abort on failure becuse getfl will always fail - * under the current win32 code. */ - if (flags > -1) flags &= ~O_NONBLOCK; - else flags = 0; - - if (fcntl(php_sock->bsd_socket, F_SETFL, flags) > -1) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool socket_listen(resource socket[, int backlog]) - Sets the maximum number of connections allowed to be waited for on the socket specified by fd */ -PHP_FUNCTION(socket_listen) -{ - zval *arg1; - php_socket *php_sock; - long backlog = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &backlog) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - if (listen(php_sock->bsd_socket, backlog) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to listen on socket", errno); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void socket_close(resource socket) - Closes a file descriptor */ -PHP_FUNCTION(socket_close) -{ - zval *arg1; - php_socket *php_sock; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - zend_list_delete(Z_RESVAL_P(arg1)); -} -/* }}} */ - -/* {{{ proto int socket_write(resource socket, string buf[, int length]) - Writes the buffer to the socket resource, length is optional */ -PHP_FUNCTION(socket_write) -{ - zval *arg1; - php_socket *php_sock; - int retval, str_len; - long length; - char *str; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - if (ZEND_NUM_ARGS() < 3) { - length = str_len; - } - -#ifndef PHP_WIN32 - retval = write(php_sock->bsd_socket, str, MIN(length, str_len)); -#else - retval = send(php_sock->bsd_socket, str, min(length, str_len), 0); -#endif - - if (retval < 0) { - PHP_SOCKET_ERROR(php_sock, "unable to write to socket", errno); - RETURN_FALSE; - } - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto string socket_read(resource socket, int length [, int type]) - Reads a maximum of length bytes from socket */ -PHP_FUNCTION(socket_read) -{ - zval *arg1; - php_socket *php_sock; - char *tmpbuf; - int retval; - long length, type = PHP_BINARY_READ; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE) - return; - - /* overflow check */ - if ((length + 1) < 2) { - RETURN_FALSE; - } - - tmpbuf = emalloc(length + 1); - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - if (type == PHP_NORMAL_READ) { - retval = php_read(php_sock->bsd_socket, tmpbuf, length, 0); - } else { - retval = recv(php_sock->bsd_socket, tmpbuf, length, 0); - } - - if (retval == -1) { - PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno); - efree(tmpbuf); - RETURN_FALSE; - } - - tmpbuf = erealloc(tmpbuf, retval + 1); - tmpbuf[retval] = '\0' ; - - RETURN_STRINGL(tmpbuf, retval, 0); -} -/* }}} */ - -/* {{{ proto bool socket_getsockname(resource socket, string &addr[, int &port]) - Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type. */ -PHP_FUNCTION(socket_getsockname) -{ - zval *arg1, *addr, *port = NULL; - php_sockaddr_storage sa_storage; - php_socket *php_sock; - struct sockaddr *sa; - struct sockaddr_in *sin; -#if HAVE_IPV6 - struct sockaddr_in6 *sin6; - char addr6[INET6_ADDRSTRLEN+1]; -#endif - struct sockaddr_un *s_un; - char *addr_string; - socklen_t salen = sizeof(php_sockaddr_storage); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|z", &arg1, &addr, &port) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - sa = (struct sockaddr *) &sa_storage; - - if (getsockname(php_sock->bsd_socket, sa, &salen) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket name", errno); - RETURN_FALSE; - } - - switch (sa->sa_family) { -#if HAVE_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6 *) sa; - inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN); - zval_dtor(addr); - ZVAL_STRING(addr, addr6, 1); - - if (port != NULL) { - zval_dtor(port); - ZVAL_LONG(port, htons(sin6->sin6_port)); - } - RETURN_TRUE; - break; -#endif - case AF_INET: - sin = (struct sockaddr_in *) sa; - while (inet_ntoa_lock == 1); - inet_ntoa_lock = 1; - addr_string = inet_ntoa(sin->sin_addr); - inet_ntoa_lock = 0; - - zval_dtor(addr); - ZVAL_STRING(addr, addr_string, 1); - - if (port != NULL) { - zval_dtor(port); - ZVAL_LONG(port, htons(sin->sin_port)); - } - RETURN_TRUE; - break; - - case AF_UNIX: - s_un = (struct sockaddr_un *) sa; - - zval_dtor(addr); - ZVAL_STRING(addr, s_un->sun_path, 1); - RETURN_TRUE; - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool socket_getpeername(resource socket, string &addr[, int &port]) - Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type. */ -PHP_FUNCTION(socket_getpeername) -{ - zval *arg1, *arg2, *arg3 = NULL; - php_sockaddr_storage sa_storage; - php_socket *php_sock; - struct sockaddr *sa; - struct sockaddr_in *sin; -#if HAVE_IPV6 - struct sockaddr_in6 *sin6; - char addr6[INET6_ADDRSTRLEN+1]; -#endif - struct sockaddr_un *s_un; - char *addr_string; - socklen_t salen = sizeof(php_sockaddr_storage); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|z", &arg1, &arg2, &arg3) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - sa = (struct sockaddr *) &sa_storage; - - if (getpeername(php_sock->bsd_socket, sa, &salen) < 0) { - PHP_SOCKET_ERROR(php_sock, "unable to retrieve peer name", errno); - RETURN_FALSE; - } - - switch (sa->sa_family) { -#if HAVE_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6 *) sa; - inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN); - zval_dtor(arg2); - ZVAL_STRING(arg2, addr6, 1); - - if (arg3 != NULL) { - zval_dtor(arg3); - ZVAL_LONG(arg3, htons(sin6->sin6_port)); - } - - RETURN_TRUE; - break; -#endif - case AF_INET: - sin = (struct sockaddr_in *) sa; - while (inet_ntoa_lock == 1); - inet_ntoa_lock = 1; - addr_string = inet_ntoa(sin->sin_addr); - inet_ntoa_lock = 0; - - zval_dtor(arg2); - ZVAL_STRING(arg2, addr_string, 1); - - if (arg3 != NULL) { - zval_dtor(arg3); - ZVAL_LONG(arg3, htons(sin->sin_port)); - } - - RETURN_TRUE; - break; - - case AF_UNIX: - s_un = (struct sockaddr_un *) sa; - - zval_dtor(arg2); - ZVAL_STRING(arg2, s_un->sun_path, 1); - RETURN_TRUE; - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource socket_create(int domain, int type, int protocol) - Creates an endpoint for communication in the domain specified by domain, of type specified by type */ -PHP_FUNCTION(socket_create) -{ - long arg1, arg2, arg3; - php_socket *php_sock = (php_socket*)emalloc(sizeof(php_socket)); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &arg1, &arg2, &arg3) == FAILURE) { - efree(php_sock); - return; - } - - if (arg1 != AF_UNIX -#if HAVE_IPV6 - && arg1 != AF_INET6 -#endif - && arg1 != AF_INET) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", arg1); - arg1 = AF_INET; - } - - if (arg2 > 10) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", arg2); - arg2 = SOCK_STREAM; - } - - php_sock->bsd_socket = socket(arg1, arg2, arg3); - php_sock->type = arg1; - - if (IS_INVALID_SOCKET(php_sock)) { - SOCKETS_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create socket [%d]: %s", errno, php_strerror(errno TSRMLS_CC)); - efree(php_sock); - RETURN_FALSE; - } - - php_sock->error = 0; - - ZEND_REGISTER_RESOURCE(return_value, php_sock, le_socket); -} -/* }}} */ - -/* {{{ proto bool socket_connect(resource socket, string addr [, int port]) - Opens a connection to addr:port on the socket specified by socket */ -PHP_FUNCTION(socket_connect) -{ - zval *arg1; - php_socket *php_sock; - struct sockaddr_in sin; -#if HAVE_IPV6 - struct sockaddr_in6 sin6; -#endif - struct sockaddr_un s_un; - char *addr; - int retval, addr_len; - long port; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - switch(php_sock->type) { -#if HAVE_IPV6 - case AF_INET6: - if (argc != 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET6 requires 3 arguments"); - RETURN_FALSE; - } - - sin6.sin6_family = AF_INET6; - sin6.sin6_port = htons((unsigned short int)port); - - if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = connect(php_sock->bsd_socket, (struct sockaddr *)&sin6, sizeof(struct sockaddr_in6)); - break; -#endif - case AF_INET: - if (argc != 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET requires 3 arguments"); - RETURN_FALSE; - } - - sin.sin_family = AF_INET; - sin.sin_port = htons((unsigned short int)port); - - if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = connect(php_sock->bsd_socket, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)); - break; - - case AF_UNIX: - s_un.sun_family = AF_UNIX; - snprintf(s_un.sun_path, 108, "%s", addr); - retval = connect(php_sock->bsd_socket, (struct sockaddr *) &s_un, SUN_LEN(&s_un)); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type); - RETURN_FALSE; - } - - if (retval != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to connect", errno); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string socket_strerror(int errno) - Returns a string describing an error */ -PHP_FUNCTION(socket_strerror) -{ - long arg1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg1) == FAILURE) - return; - - RETURN_STRING(php_strerror(arg1 TSRMLS_CC), 1); -} -/* }}} */ - -/* {{{ proto bool socket_bind(resource socket, string addr [, int port]) - Binds an open socket to a listening port, port is only specified in AF_INET family. */ -PHP_FUNCTION(socket_bind) -{ - zval *arg1; - php_sockaddr_storage sa_storage; - struct sockaddr *sock_type = (struct sockaddr*) &sa_storage; - php_socket *php_sock; - char *addr; - int addr_len; - long port = 0; - long retval = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - switch(php_sock->type) { - case AF_UNIX: - { - struct sockaddr_un *sa = (struct sockaddr_un *) sock_type; - memset(sa, 0, sizeof(sa_storage)); - sa->sun_family = AF_UNIX; - snprintf(sa->sun_path, 108, "%s", addr); - retval = bind(php_sock->bsd_socket, (struct sockaddr *) sa, SUN_LEN(sa)); - break; - } - - case AF_INET: - { - struct sockaddr_in *sa = (struct sockaddr_in *) sock_type; - - memset(sa, 0, sizeof(sa_storage)); /* Apparently, Mac OSX needs this */ - - sa->sin_family = AF_INET; - sa->sin_port = htons((unsigned short) port); - - if (! php_set_inet_addr(sa, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = bind(php_sock->bsd_socket, (struct sockaddr *)sa, sizeof(struct sockaddr_in)); - break; - } -#if HAVE_IPV6 - case AF_INET6: - { - struct sockaddr_in6 *sa = (struct sockaddr_in6 *) sock_type; - - memset(sa, 0, sizeof(sa_storage)); /* Apparently, Mac OSX needs this */ - - sa->sin6_family = AF_INET6; - sa->sin6_port = htons((unsigned short) port); - - if (! php_set_inet6_addr(sa, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = bind(php_sock->bsd_socket, (struct sockaddr *)sa, sizeof(struct sockaddr_in6)); - break; - } -#endif - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported socket type '%d', must be AF_UNIX, AF_INET, or AF_INET6", php_sock->type); - RETURN_FALSE; - } - - if (retval != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to bind address", errno); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int socket_recv(resource socket, string &buf, int len, int flags) - Receives data from a connected socket */ -PHP_FUNCTION(socket_recv) -{ - zval *php_sock_res, *buf; - char *recv_buf; - php_socket *php_sock; - int retval; - long len, flags; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzll", &php_sock_res, &buf, &len, &flags) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &php_sock_res, -1, le_socket_name, le_socket); - - /* overflow check */ - if ((len + 1) < 2) { - RETURN_FALSE; - } - - recv_buf = emalloc(len + 1); - memset(recv_buf, 0, len + 1); - - if ((retval = recv(php_sock->bsd_socket, recv_buf, len, flags)) < 1) { - efree(recv_buf); - - zval_dtor(buf); - Z_TYPE_P(buf) = IS_NULL; - } else { - recv_buf[retval] = '\0'; - - /* Rebuild buffer zval */ - zval_dtor(buf); - - Z_STRVAL_P(buf) = recv_buf; - Z_STRLEN_P(buf) = retval; - Z_TYPE_P(buf) = IS_STRING; - } - - if (retval == -1) { - PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno); - RETURN_FALSE; - } - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int socket_send(resource socket, string buf, int len, int flags) - Sends data to a connected socket */ -PHP_FUNCTION(socket_send) -{ - zval *arg1; - php_socket *php_sock; - int buf_len, retval; - long len, flags; - char *buf; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - retval = send(php_sock->bsd_socket, buf, (buf_len < len ? buf_len : len), flags); - - if (retval == -1) { - PHP_SOCKET_ERROR(php_sock, "unable to write to socket", errno); - RETURN_FALSE; - } - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int socket_recvfrom(resource socket, string &buf, int len, int flags, string &name [, int &port]) - Receives data from a socket, connected or not */ -PHP_FUNCTION(socket_recvfrom) -{ - zval *arg1, *arg2, *arg5, *arg6 = NULL; - php_socket *php_sock; - struct sockaddr_un s_un; - struct sockaddr_in sin; -#if HAVE_IPV6 - struct sockaddr_in6 sin6; - char addr6[INET6_ADDRSTRLEN]; -#endif - socklen_t slen; - int retval; - long arg3, arg4; - char *recv_buf, *address; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzllz|z", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - /* overflow check */ - if ((arg3 + 2) < 3) { - RETURN_FALSE; - } - - recv_buf = emalloc(arg3 + 2); - memset(recv_buf, 0, arg3 + 2); - - switch (php_sock->type) { - case AF_UNIX: - slen = sizeof(s_un); - s_un.sun_family = AF_UNIX; - retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&s_un, (socklen_t *)&slen); - - if (retval < 0) { - efree(recv_buf); - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); - RETURN_FALSE; - } - - zval_dtor(arg2); - zval_dtor(arg5); - - ZVAL_STRINGL(arg2, recv_buf, retval, 0); - ZVAL_STRING(arg5, s_un.sun_path, 1); - break; - - case AF_INET: - slen = sizeof(sin); - memset(&sin, 0, slen); - sin.sin_family = AF_INET; - - if (arg6 == NULL) { - WRONG_PARAM_COUNT; - } - - retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen); - - if (retval < 0) { - efree(recv_buf); - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); - RETURN_FALSE; - } - - zval_dtor(arg2); - zval_dtor(arg5); - zval_dtor(arg6); - - address = inet_ntoa(sin.sin_addr); - - ZVAL_STRINGL(arg2, recv_buf, retval, 0); - ZVAL_STRING(arg5, address ? address : "0.0.0.0", 1); - ZVAL_LONG(arg6, ntohs(sin.sin_port)); - break; -#if HAVE_IPV6 - case AF_INET6: - slen = sizeof(sin6); - memset(&sin6, 0, slen); - sin6.sin6_family = AF_INET6; - - if (arg6 == NULL) { - WRONG_PARAM_COUNT; - } - - retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen); - - if (retval < 0) { - efree(recv_buf); - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); - RETURN_FALSE; - } - - zval_dtor(arg2); - zval_dtor(arg5); - zval_dtor(arg6); - - inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN); - - ZVAL_STRINGL(arg2, recv_buf, retval, 0); - ZVAL_STRING(arg5, addr6 ? addr6 : "::", 1); - ZVAL_LONG(arg6, ntohs(sin6.sin6_port)); - break; -#endif - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type); - RETURN_FALSE; - } - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto int socket_sendto(resource socket, string buf, int len, int flags, string addr [, int port]) - Sends a message to a socket, whether it is connected or not */ -PHP_FUNCTION(socket_sendto) -{ - zval *arg1; - php_socket *php_sock; - struct sockaddr_un s_un; - struct sockaddr_in sin; -#if HAVE_IPV6 - struct sockaddr_in6 sin6; -#endif - int retval, buf_len, addr_len; - long len, flags, port = 0; - char *buf, *addr; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - - switch (php_sock->type) { - case AF_UNIX: - memset(&s_un, 0, sizeof(s_un)); - s_un.sun_family = AF_UNIX; - snprintf(s_un.sun_path, 108, "%s", addr); - - retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len, flags, (struct sockaddr *) &s_un, SUN_LEN(&s_un)); - break; - - case AF_INET: - if (argc != 6) { - WRONG_PARAM_COUNT; - } - - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_port = htons((unsigned short) port); - - if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len, flags, (struct sockaddr *) &sin, sizeof(sin)); - break; -#if HAVE_IPV6 - case AF_INET6: - if (argc != 6) { - WRONG_PARAM_COUNT; - } - - memset(&sin6, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_port = htons((unsigned short) port); - - if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) { - RETURN_FALSE; - } - - retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len, flags, (struct sockaddr *) &sin, sizeof(sin)); - break; -#endif - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type); - RETURN_FALSE; - } - - if (retval == -1) { - PHP_SOCKET_ERROR(php_sock, "unable to write to socket", errno); - RETURN_FALSE; - } - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ proto mixed socket_get_option(resource socket, int level, int optname) - Gets socket options for the socket */ -PHP_FUNCTION(socket_get_option) -{ - zval *arg1; - struct linger linger_val; - struct timeval tv; - socklen_t optlen; - php_socket *php_sock; - int other_val; - long level, optname; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1, &level, &optname) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - switch(optname) { - case SO_LINGER: - optlen = sizeof(linger_val); - - if (getsockopt(php_sock->bsd_socket, level, optname, (char*)&linger_val, &optlen) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno); - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_long(return_value, "l_onoff", linger_val.l_onoff); - add_assoc_long(return_value, "l_linger", linger_val.l_linger); - - break; - case SO_RCVTIMEO: - case SO_SNDTIMEO: - optlen = sizeof(tv); - - if (getsockopt(php_sock->bsd_socket, level, optname, (char*)&tv, &optlen) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno); - RETURN_FALSE; - } - - array_init(return_value); - - add_assoc_long(return_value, "sec", tv.tv_sec); - add_assoc_long(return_value, "usec", tv.tv_usec); - - break; - default: - optlen = sizeof(other_val); - - if (getsockopt(php_sock->bsd_socket, level, optname, (char*)&other_val, &optlen) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno); - RETURN_FALSE; - } - - RETURN_LONG(other_val); - break; - } -} -/* }}} */ - -/* {{{ proto bool socket_set_option(resource socket, int level, int optname, int|array optval) - Sets socket options for the socket */ -PHP_FUNCTION(socket_set_option) -{ - zval *arg1, *arg4; - struct linger lv; - struct timeval tv; - php_socket *php_sock; - int ov, optlen, retval; - long level, optname; - void *opt_ptr; - - HashTable *opt_ht; - zval **l_onoff, **l_linger; - zval **sec, **usec; - - /* key name constants */ - char *l_onoff_key = "l_onoff"; - char *l_linger_key = "l_linger"; - char *sec_key = "sec"; - char *usec_key = "usec"; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllz", &arg1, &level, &optname, &arg4) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket); - - set_errno(0); - - switch (optname) { - case SO_LINGER: - convert_to_array_ex(&arg4); - opt_ht = HASH_OF(arg4); - - if (zend_hash_find(opt_ht, l_onoff_key, strlen(l_onoff_key) + 1, (void **)&l_onoff) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key); - RETURN_FALSE; - } - if (zend_hash_find(opt_ht, l_linger_key, strlen(l_linger_key) + 1, (void **)&l_linger) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_linger_key); - RETURN_FALSE; - } - - convert_to_long_ex(l_onoff); - convert_to_long_ex(l_linger); - - lv.l_onoff = (unsigned short)Z_LVAL_PP(l_onoff); - lv.l_linger = (unsigned short)Z_LVAL_PP(l_linger); - - optlen = sizeof(lv); - opt_ptr = &lv; - break; - case SO_RCVTIMEO: - case SO_SNDTIMEO: - convert_to_array_ex(&arg4); - opt_ht = HASH_OF(arg4); - - if (zend_hash_find(opt_ht, sec_key, strlen(sec_key) + 1, (void **)&sec) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", sec_key); - RETURN_FALSE; - } - if (zend_hash_find(opt_ht, usec_key, strlen(usec_key) + 1, (void **)&usec) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", usec_key); - RETURN_FALSE; - } - - convert_to_long_ex(sec); - convert_to_long_ex(usec); - tv.tv_sec = Z_LVAL_PP(sec); - tv.tv_usec = Z_LVAL_PP(usec); - - optlen = sizeof(tv); - opt_ptr = &tv; - break; - default: - convert_to_long_ex(&arg4); - ov = Z_LVAL_P(arg4); - - optlen = sizeof(ov); - opt_ptr = &ov; - break; - } - - retval = setsockopt(php_sock->bsd_socket, level, optname, opt_ptr, optlen); - - if (retval != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to set socket option", errno); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array &fd) - Creates a pair of indistinguishable sockets and stores them in fds. */ -PHP_FUNCTION(socket_create_pair) -{ - zval *retval[2], *fds_array_zval; - php_socket *php_sock[2]; - PHP_SOCKET fds_array[2]; - long domain, type, protocol; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllz", &domain, &type, &protocol, &fds_array_zval) == FAILURE) - return; - - php_sock[0] = (php_socket*)emalloc(sizeof(php_socket)); - php_sock[1] = (php_socket*)emalloc(sizeof(php_socket)); - - if (domain != AF_INET -#if HAVE_IPV6 - && domain != AF_INET6 -#endif - && domain != AF_UNIX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", domain); - domain = AF_INET; - } - - if (type > 10) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", type); - type = SOCK_STREAM; - } - - if (socketpair(domain, type, protocol, fds_array) != 0) { - SOCKETS_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create socket pair [%d]: %s", errno, php_strerror(errno TSRMLS_CC)); - efree(php_sock[0]); - efree(php_sock[1]); - RETURN_FALSE; - } - - zval_dtor(fds_array_zval); - array_init(fds_array_zval); - - MAKE_STD_ZVAL(retval[0]); - MAKE_STD_ZVAL(retval[1]); - - php_sock[0]->bsd_socket = fds_array[0]; - php_sock[1]->bsd_socket = fds_array[1]; - php_sock[0]->type = domain; - php_sock[1]->type = domain; - php_sock[0]->error = 0; - php_sock[1]->error = 0; - - ZEND_REGISTER_RESOURCE(retval[0], php_sock[0], le_socket); - ZEND_REGISTER_RESOURCE(retval[1], php_sock[1], le_socket); - - add_index_zval(fds_array_zval, 0, retval[0]); - add_index_zval(fds_array_zval, 1, retval[1]); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool socket_shutdown(resource socket[, int how]) - Shuts down a socket for receiving, sending, or both. */ -PHP_FUNCTION(socket_shutdown) -{ - zval *arg1; - long how_shutdown = 2; - php_socket *php_sock; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &how_shutdown) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(php_sock, php_socket*, &arg1, -1, le_socket_name, le_socket); - - if (shutdown(php_sock->bsd_socket, how_shutdown) != 0) { - PHP_SOCKET_ERROR(php_sock, "unable to shutdown socket", errno); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int socket_last_error([resource socket]) - Returns the last socket error (either the last used or the provided socket resource) */ -PHP_FUNCTION(socket_last_error) -{ - zval *arg1 = NULL; - php_socket *php_sock; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) - return; - - if (arg1) { - ZEND_FETCH_RESOURCE(php_sock, php_socket*, &arg1, -1, le_socket_name, le_socket); - RETVAL_LONG(php_sock->error); - } else { - RETVAL_LONG(SOCKETS_G(last_error)); - } -} -/* }}} */ - -/* {{{ proto void socket_clear_error([resource socket]) - Clears the error on the socket or the last error code. */ -PHP_FUNCTION(socket_clear_error) -{ - zval *arg1 = NULL; - php_socket *php_sock; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) - return; - - if (arg1) { - ZEND_FETCH_RESOURCE(php_sock, php_socket*, &arg1, -1, le_socket_name, le_socket); - php_sock->error = 0; - } else { - SOCKETS_G(last_error) = 0; - } - - return; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/sockets/sockets.dsp b/ext/sockets/sockets.dsp deleted file mode 100644 index 961bab784d5dc..0000000000000 --- a/ext/sockets/sockets.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sockets" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=sockets - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sockets.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sockets.mak" CFG="sockets - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sockets - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "sockets - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sockets - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D HAVE_SOCKETS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sockets.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "sockets - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SOCKETS=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_sockets.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "sockets - Win32 Release_TS" -# Name "sockets - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_sockets_win.c -# End Source File -# Begin Source File - -SOURCE=.\sockets.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_sockets.h -# End Source File -# Begin Source File - -SOURCE=.\php_sockets_win.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/sockets/sockets.php b/ext/sockets/sockets.php deleted file mode 100644 index 3bb624cd57b94..0000000000000 --- a/ext/sockets/sockets.php +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/ext/sockets/tests/ipv4loop.phpt b/ext/sockets/tests/ipv4loop.phpt deleted file mode 100644 index 7c6c0db31ee43..0000000000000 --- a/ext/sockets/tests/ipv4loop.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -IPv4 Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/sockets/tests/ipv6loop.phpt b/ext/sockets/tests/ipv6loop.phpt deleted file mode 100644 index 1cd2148633660..0000000000000 --- a/ext/sockets/tests/ipv6loop.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -IPv6 Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h deleted file mode 100644 index 7081758593e28..0000000000000 --- a/ext/sockets/unix_socket_constants.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This file is to be included by sockets.c */ - -#ifdef EPERM - /* Operation not permitted */ - REGISTER_LONG_CONSTANT("SOCKET_EPERM", EPERM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOENT - /* No such file or directory */ - REGISTER_LONG_CONSTANT("SOCKET_ENOENT", ENOENT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EINTR - /* Interrupted system call */ - REGISTER_LONG_CONSTANT("SOCKET_EINTR", EINTR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EIO - /* I/O error */ - REGISTER_LONG_CONSTANT("SOCKET_EIO", EIO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENXIO - /* No such device or address */ - REGISTER_LONG_CONSTANT("SOCKET_ENXIO", ENXIO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef E2BIG - /* Arg list too long */ - REGISTER_LONG_CONSTANT("SOCKET_E2BIG", E2BIG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADF - /* Bad file number */ - REGISTER_LONG_CONSTANT("SOCKET_EBADF", EBADF, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EAGAIN - /* Try again */ - REGISTER_LONG_CONSTANT("SOCKET_EAGAIN", EAGAIN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOMEM - /* Out of memory */ - REGISTER_LONG_CONSTANT("SOCKET_ENOMEM", ENOMEM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EACCES - /* Permission denied */ - REGISTER_LONG_CONSTANT("SOCKET_EACCES", EACCES, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EFAULT - /* Bad address */ - REGISTER_LONG_CONSTANT("SOCKET_EFAULT", EFAULT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTBLK - /* Block device required */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTBLK", ENOTBLK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBUSY - /* Device or resource busy */ - REGISTER_LONG_CONSTANT("SOCKET_EBUSY", EBUSY, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EEXIST - /* File exists */ - REGISTER_LONG_CONSTANT("SOCKET_EEXIST", EEXIST, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EXDEV - /* Cross-device link */ - REGISTER_LONG_CONSTANT("SOCKET_EXDEV", EXDEV, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENODEV - /* No such device */ - REGISTER_LONG_CONSTANT("SOCKET_ENODEV", ENODEV, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTDIR - /* Not a directory */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTDIR", ENOTDIR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EISDIR - /* Is a directory */ - REGISTER_LONG_CONSTANT("SOCKET_EISDIR", EISDIR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EINVAL - /* Invalid argument */ - REGISTER_LONG_CONSTANT("SOCKET_EINVAL", EINVAL, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENFILE - /* File table overflow */ - REGISTER_LONG_CONSTANT("SOCKET_ENFILE", ENFILE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EMFILE - /* Too many open files */ - REGISTER_LONG_CONSTANT("SOCKET_EMFILE", EMFILE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTTY - /* Not a typewriter */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTTY", ENOTTY, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOSPC - /* No space left on device */ - REGISTER_LONG_CONSTANT("SOCKET_ENOSPC", ENOSPC, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ESPIPE - /* Illegal seek */ - REGISTER_LONG_CONSTANT("SOCKET_ESPIPE", ESPIPE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EROFS - /* Read-only file system */ - REGISTER_LONG_CONSTANT("SOCKET_EROFS", EROFS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EMLINK - /* Too many links */ - REGISTER_LONG_CONSTANT("SOCKET_EMLINK", EMLINK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EPIPE - /* Broken pipe */ - REGISTER_LONG_CONSTANT("SOCKET_EPIPE", EPIPE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENAMETOOLONG - /* File name too long */ - REGISTER_LONG_CONSTANT("SOCKET_ENAMETOOLONG", ENAMETOOLONG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOLCK - /* No record locks available */ - REGISTER_LONG_CONSTANT("SOCKET_ENOLCK", ENOLCK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOSYS - /* Function not implemented */ - REGISTER_LONG_CONSTANT("SOCKET_ENOSYS", ENOSYS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTEMPTY - /* Directory not empty */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTEMPTY", ENOTEMPTY, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ELOOP - /* Too many symbolic links encountered */ - REGISTER_LONG_CONSTANT("SOCKET_ELOOP", ELOOP, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EWOULDBLOCK - /* Operation would block */ - REGISTER_LONG_CONSTANT("SOCKET_EWOULDBLOCK", EWOULDBLOCK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOMSG - /* No message of desired type */ - REGISTER_LONG_CONSTANT("SOCKET_ENOMSG", ENOMSG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EIDRM - /* Identifier removed */ - REGISTER_LONG_CONSTANT("SOCKET_EIDRM", EIDRM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ECHRNG - /* Channel number out of range */ - REGISTER_LONG_CONSTANT("SOCKET_ECHRNG", ECHRNG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EL2NSYNC - /* Level 2 not synchronized */ - REGISTER_LONG_CONSTANT("SOCKET_EL2NSYNC", EL2NSYNC, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EL3HLT - /* Level 3 halted */ - REGISTER_LONG_CONSTANT("SOCKET_EL3HLT", EL3HLT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EL3RST - /* Level 3 reset */ - REGISTER_LONG_CONSTANT("SOCKET_EL3RST", EL3RST, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ELNRNG - /* Link number out of range */ - REGISTER_LONG_CONSTANT("SOCKET_ELNRNG", ELNRNG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EUNATCH - /* Protocol driver not attached */ - REGISTER_LONG_CONSTANT("SOCKET_EUNATCH", EUNATCH, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOCSI - /* No CSI structure available */ - REGISTER_LONG_CONSTANT("SOCKET_ENOCSI", ENOCSI, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EL2HLT - /* Level 2 halted */ - REGISTER_LONG_CONSTANT("SOCKET_EL2HLT", EL2HLT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADE - /* Invalid exchange */ - REGISTER_LONG_CONSTANT("SOCKET_EBADE", EBADE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADR - /* Invalid request descriptor */ - REGISTER_LONG_CONSTANT("SOCKET_EBADR", EBADR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EXFULL - /* Exchange full */ - REGISTER_LONG_CONSTANT("SOCKET_EXFULL", EXFULL, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOANO - /* No anode */ - REGISTER_LONG_CONSTANT("SOCKET_ENOANO", ENOANO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADRQC - /* Invalid request code */ - REGISTER_LONG_CONSTANT("SOCKET_EBADRQC", EBADRQC, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADSLT - /* Invalid slot */ - REGISTER_LONG_CONSTANT("SOCKET_EBADSLT", EBADSLT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOSTR - /* Device not a stream */ - REGISTER_LONG_CONSTANT("SOCKET_ENOSTR", ENOSTR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENODATA - /* No data available */ - REGISTER_LONG_CONSTANT("SOCKET_ENODATA", ENODATA, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ETIME - /* Timer expired */ - REGISTER_LONG_CONSTANT("SOCKET_ETIME", ETIME, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOSR - /* Out of streams resources */ - REGISTER_LONG_CONSTANT("SOCKET_ENOSR", ENOSR, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENONET - /* Machine is not on the network */ - REGISTER_LONG_CONSTANT("SOCKET_ENONET", ENONET, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EREMOTE - /* Object is remote */ - REGISTER_LONG_CONSTANT("SOCKET_EREMOTE", EREMOTE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOLINK - /* Link has been severed */ - REGISTER_LONG_CONSTANT("SOCKET_ENOLINK", ENOLINK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EADV - /* Advertise error */ - REGISTER_LONG_CONSTANT("SOCKET_EADV", EADV, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ESRMNT - /* Srmount error */ - REGISTER_LONG_CONSTANT("SOCKET_ESRMNT", ESRMNT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ECOMM - /* Communication error on send */ - REGISTER_LONG_CONSTANT("SOCKET_ECOMM", ECOMM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EPROTO - /* Protocol error */ - REGISTER_LONG_CONSTANT("SOCKET_EPROTO", EPROTO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EMULTIHOP - /* Multihop attempted */ - REGISTER_LONG_CONSTANT("SOCKET_EMULTIHOP", EMULTIHOP, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADMSG - /* Not a data message */ - REGISTER_LONG_CONSTANT("SOCKET_EBADMSG", EBADMSG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTUNIQ - /* Name not unique on network */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTUNIQ", ENOTUNIQ, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EBADFD - /* File descriptor in bad state */ - REGISTER_LONG_CONSTANT("SOCKET_EBADFD", EBADFD, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EREMCHG - /* Remote address changed */ - REGISTER_LONG_CONSTANT("SOCKET_EREMCHG", EREMCHG, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ERESTART - /* Interrupted system call should be restarted */ - REGISTER_LONG_CONSTANT("SOCKET_ERESTART", ERESTART, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ESTRPIPE - /* Streams pipe error */ - REGISTER_LONG_CONSTANT("SOCKET_ESTRPIPE", ESTRPIPE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EUSERS - /* Too many users */ - REGISTER_LONG_CONSTANT("SOCKET_EUSERS", EUSERS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTSOCK - /* Socket operation on non-socket */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTSOCK", ENOTSOCK, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EDESTADDRREQ - /* Destination address required */ - REGISTER_LONG_CONSTANT("SOCKET_EDESTADDRREQ", EDESTADDRREQ, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EMSGSIZE - /* Message too long */ - REGISTER_LONG_CONSTANT("SOCKET_EMSGSIZE", EMSGSIZE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EPROTOTYPE - /* Protocol wrong type for socket */ - REGISTER_LONG_CONSTANT("SOCKET_EPROTOTYPE", EPROTOTYPE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOPROTOOPT - /* Protocol not available */ - REGISTER_LONG_CONSTANT("SOCKET_ENOPROTOOPT", ENOPROTOOPT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EPROTONOSUPPORT - /* Protocol not supported */ - REGISTER_LONG_CONSTANT("SOCKET_EPROTONOSUPPORT", EPROTONOSUPPORT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ESOCKTNOSUPPORT - /* Socket type not supported */ - REGISTER_LONG_CONSTANT("SOCKET_ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EOPNOTSUPP - /* Operation not supported on transport endpoint */ - REGISTER_LONG_CONSTANT("SOCKET_EOPNOTSUPP", EOPNOTSUPP, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EPFNOSUPPORT - /* Protocol family not supported */ - REGISTER_LONG_CONSTANT("SOCKET_EPFNOSUPPORT", EPFNOSUPPORT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EAFNOSUPPORT - /* Address family not supported by protocol */ - REGISTER_LONG_CONSTANT("SOCKET_EAFNOSUPPORT", EAFNOSUPPORT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EADDRINUSE - /* Address already in use */ - REGISTER_LONG_CONSTANT("SOCKET_EADDRINUSE", EADDRINUSE, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EADDRNOTAVAIL - /* Cannot assign requested address */ - REGISTER_LONG_CONSTANT("SOCKET_EADDRNOTAVAIL", EADDRNOTAVAIL, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENETDOWN - /* Network is down */ - REGISTER_LONG_CONSTANT("SOCKET_ENETDOWN", ENETDOWN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENETUNREACH - /* Network is unreachable */ - REGISTER_LONG_CONSTANT("SOCKET_ENETUNREACH", ENETUNREACH, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENETRESET - /* Network dropped connection because of reset */ - REGISTER_LONG_CONSTANT("SOCKET_ENETRESET", ENETRESET, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ECONNABORTED - /* Software caused connection abort */ - REGISTER_LONG_CONSTANT("SOCKET_ECONNABORTED", ECONNABORTED, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ECONNRESET - /* Connection reset by peer */ - REGISTER_LONG_CONSTANT("SOCKET_ECONNRESET", ECONNRESET, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOBUFS - /* No buffer space available */ - REGISTER_LONG_CONSTANT("SOCKET_ENOBUFS", ENOBUFS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EISCONN - /* Transport endpoint is already connected */ - REGISTER_LONG_CONSTANT("SOCKET_EISCONN", EISCONN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOTCONN - /* Transport endpoint is not connected */ - REGISTER_LONG_CONSTANT("SOCKET_ENOTCONN", ENOTCONN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ESHUTDOWN - /* Cannot send after transport endpoint shutdown */ - REGISTER_LONG_CONSTANT("SOCKET_ESHUTDOWN", ESHUTDOWN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ETOOMANYREFS - /* Too many references: cannot splice */ - REGISTER_LONG_CONSTANT("SOCKET_ETOOMANYREFS", ETOOMANYREFS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ETIMEDOUT - /* Connection timed out */ - REGISTER_LONG_CONSTANT("SOCKET_ETIMEDOUT", ETIMEDOUT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ECONNREFUSED - /* Connection refused */ - REGISTER_LONG_CONSTANT("SOCKET_ECONNREFUSED", ECONNREFUSED, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EHOSTDOWN - /* Host is down */ - REGISTER_LONG_CONSTANT("SOCKET_EHOSTDOWN", EHOSTDOWN, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EHOSTUNREACH - /* No route to host */ - REGISTER_LONG_CONSTANT("SOCKET_EHOSTUNREACH", EHOSTUNREACH, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EALREADY - /* Operation already in progress */ - REGISTER_LONG_CONSTANT("SOCKET_EALREADY", EALREADY, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EINPROGRESS - /* Operation now in progress */ - REGISTER_LONG_CONSTANT("SOCKET_EINPROGRESS", EINPROGRESS, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EISNAM - /* Is a named type file */ - REGISTER_LONG_CONSTANT("SOCKET_EISNAM", EISNAM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EREMOTEIO - /* Remote I/O error */ - REGISTER_LONG_CONSTANT("SOCKET_EREMOTEIO", EREMOTEIO, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EDQUOT - /* Quota exceeded */ - REGISTER_LONG_CONSTANT("SOCKET_EDQUOT", EDQUOT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef ENOMEDIUM - /* No medium found */ - REGISTER_LONG_CONSTANT("SOCKET_ENOMEDIUM", ENOMEDIUM, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef EMEDIUMTYPE - /* Wrong medium type */ - REGISTER_LONG_CONSTANT("SOCKET_EMEDIUMTYPE", EMEDIUMTYPE, CONST_CS | CONST_PERSISTENT); -#endif diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h deleted file mode 100644 index 0a1363a5f7fec..0000000000000 --- a/ext/sockets/win32_socket_constants.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jason Greene | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This file is to be included by sockets.c */ - -REGISTER_LONG_CONSTANT("SOCKET_EINTR", WSAEINTR, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EBADF", WSAEBADF, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EACCES", WSAEACCES, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EFAULT", WSAEFAULT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EINVAL", WSAEINVAL, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EMFILE", WSAEMFILE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EWOULDBLOCK", WSAEWOULDBLOCK, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EINPROGRESS", WSAEINPROGRESS, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EALREADY", WSAEALREADY, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENOTSOCK", WSAENOTSOCK, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EDESTADDRREQ", WSAEDESTADDRREQ, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EMSGSIZE", WSAEMSGSIZE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EPROTOTYPE", WSAEPROTOTYPE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENOPROTOOPT", WSAENOPROTOOPT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EPROTONOSUPPORT", WSAEPROTONOSUPPORT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EOPNOTSUPP", WSAEOPNOTSUPP, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EPFNOSUPPORT", WSAEPFNOSUPPORT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EAFNOSUPPORT", WSAEAFNOSUPPORT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EADDRINUSE", WSAEADDRINUSE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EADDRNOTAVAIL", WSAEADDRNOTAVAIL, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENETDOWN", WSAENETDOWN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENETUNREACH", WSAENETUNREACH, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENETRESET", WSAENETRESET, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ECONNABORTED", WSAECONNABORTED, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ECONNRESET", WSAECONNRESET, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENOBUFS", WSAENOBUFS, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EISCONN", WSAEISCONN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENOTCONN", WSAENOTCONN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ESHUTDOWN", WSAESHUTDOWN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ETOOMANYREFS", WSAETOOMANYREFS, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ETIMEDOUT", WSAETIMEDOUT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ECONNREFUSED", WSAECONNREFUSED, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ELOOP", WSAELOOP, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENAMETOOLONG", WSAENAMETOOLONG, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EHOSTDOWN", WSAEHOSTDOWN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EHOSTUNREACH", WSAEHOSTUNREACH, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ENOTEMPTY", WSAENOTEMPTY, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EPROCLIM", WSAEPROCLIM, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EUSERS", WSAEUSERS, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EDQUOT", WSAEDQUOT, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_ESTALE", WSAESTALE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EREMOTE", WSAEREMOTE, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_EDISCON", WSAEDISCON, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_SYSNOTREADY", WSASYSNOTREADY, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_VERNOTSUPPORTED", WSAVERNOTSUPPORTED, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_NOTINITIALISED", WSANOTINITIALISED, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_HOST_NOT_FOUND", WSAHOST_NOT_FOUND, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_TRY_AGAIN", WSATRY_AGAIN, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_NO_RECOVERY", WSANO_RECOVERY, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_NO_DATA", WSANO_DATA, CONST_CS | CONST_PERSISTENT); -REGISTER_LONG_CONSTANT("SOCKET_NO_ADDRESS", WSANO_ADDRESS, CONST_CS | CONST_PERSISTENT); diff --git a/ext/spl/CREDITS b/ext/spl/CREDITS deleted file mode 100755 index 8710aac5500f4..0000000000000 --- a/ext/spl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SPL -Marcus Boerger diff --git a/ext/spl/README b/ext/spl/README deleted file mode 100755 index b2aeb596d096b..0000000000000 --- a/ext/spl/README +++ /dev/null @@ -1,7 +0,0 @@ -This is an extension that aims to implement some efficient data access -interfaces and classes. You'll find the classes documented using php -code in the file spl.php or in the corresponding .inc file in the examples -subdirectory. Based on the internal implementations or the files in the -examples subdirectory there are also some .php files to experiment with. - -For more information look at: http://php.net/~helly/php/ext/spl diff --git a/ext/spl/TODO b/ext/spl/TODO deleted file mode 100755 index 68b00da6a585a..0000000000000 --- a/ext/spl/TODO +++ /dev/null @@ -1,4 +0,0 @@ -This is the ToDo of ext/spl: - -Implement the classes/interfaces from the .inc files in -directory examples. \ No newline at end of file diff --git a/ext/spl/config.m4 b/ext/spl/config.m4 deleted file mode 100755 index 8f0b19084bb78..0000000000000 --- a/ext/spl/config.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension SPL - -PHP_ARG_ENABLE(spl, enable SPL suppport, -[ --disable-spl Disable Standard PHP Library], yes) - -if test "$PHP_SPL" != "no"; then - if test "$ext_shared" = "yes"; then - AC_MSG_ERROR(Cannot build SPL as a shared module) - fi - AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support]) - PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_sxe.c spl_exceptions.c spl_observer.c, $ext_shared) -fi diff --git a/ext/spl/config.w32 b/ext/spl/config.w32 deleted file mode 100644 index 931a6704c770b..0000000000000 --- a/ext/spl/config.w32 +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("spl", "SPL (Standard PHP Library) support", "yes"); - -if (PHP_SPL != "no") { - if (PHP_SPL_SHARED) { - ERROR("SPL cannot be compiled as a shared ext"); - } - EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_sxe.c spl_exceptions.c spl_observer.c"); - AC_DEFINE('HAVE_SPL', 1); -} diff --git a/ext/spl/doxygen.cfg b/ext/spl/doxygen.cfg deleted file mode 100755 index 1d79e40465f3f..0000000000000 --- a/ext/spl/doxygen.cfg +++ /dev/null @@ -1,217 +0,0 @@ -# Doxyfile 1.3.9.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = SPL-StandardPHPLibrary -PROJECT_NUMBER = -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = YES -BRIEF_MEMBER_DESC = NO -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = YES -INLINE_INHERITED_MEMB = YES -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = YES -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = YES -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = YES -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = spl.php \ - examples \ - internal -FILE_PATTERNS = *.inc \ - *.php -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 4 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = ../spl.chm -HHC_LOCATION = hhc.exe -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 1 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = YES -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1200 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/ext/spl/examples/autoload.inc b/ext/spl/examples/autoload.inc deleted file mode 100755 index 5871e7d63bae8..0000000000000 --- a/ext/spl/examples/autoload.inc +++ /dev/null @@ -1,50 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc deleted file mode 100644 index 4fa6b235c3173..0000000000000 --- a/ext/spl/examples/cachingrecursiveiterator.inc +++ /dev/null @@ -1,28 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/examples/class_tree.php b/ext/spl/examples/class_tree.php deleted file mode 100755 index c530112f47599..0000000000000 --- a/ext/spl/examples/class_tree.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * Simply specify the root class or interface to tree with parameter \. - */ - -if ($argc < 2) { - echo << - -Displays a graphical tree for the given . - - The class or interface for which to generate the tree graph. - - -EOF; - exit(1); -} - -if (!class_exists("RecursiveTreeIterator", false)) require_once("recursivetreeiterator.inc"); - -class SubClasses extends RecursiveArrayIterator -{ - function __construct($base, $check_interfaces = false) - { - foreach(get_declared_classes() as $cname) - { - $parent = get_parent_class($cname); - if (strcasecmp($parent, $base) == 0) - { - $this->offsetSet($cname, new SubClasses($cname)); - } - if ($check_interfaces) - { - if ($parent) - { - $parent_imp = class_implements($parent); - } - foreach(class_implements($cname) as $iname) - { - if (strcasecmp($iname, $base) == 0) - { - if (!$parent || !in_array($iname, $parent_imp)) - { - $this->offsetSet($cname, new SubClasses($cname)); - } - } - } - } - } - if ($check_interfaces) - { - foreach(get_declared_interfaces() as $cname) - { - foreach(class_implements($cname) as $iname) - { - if (strcasecmp($iname, $base) == 0) - { - $this->offsetSet($cname, new SubClasses($cname, true)); - } - } - } - } - $this->uksort('strnatcasecmp'); - } - - function current() - { - return parent::key(); - } -} - -$it = new RecursiveTreeIterator(new SubClasses($argv[1], true)); - -echo $argv[1]."\n"; -foreach($it as $c=>$v) -{ - echo "$v\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/dba_array.php b/ext/spl/examples/dba_array.php deleted file mode 100755 index 346ac1f2f7ae1..0000000000000 --- a/ext/spl/examples/dba_array.php +++ /dev/null @@ -1,52 +0,0 @@ - \ \ [\] - * - * If \ is specified then \ is set to \ in \. - * Else the value of \ is printed only. - * - * Note: configure with --enable-dba - */ - -if ($argc < 4) { - echo << [] - -If is specified then is set to in . -Else the value of is printed only. - - -EOF; - exit(1); -} - -if (!class_exists("DbaReader", false)) require_once("dbareader.inc"); - -try { - if ($argc > 2) { - $dba = new DbaArray($argv[1], $argv[2]); - if ($dba && $argc > 3) { - if ($argc > 4) { - $dba[$argv[3]] = $argv[4]; - } - var_dump(array('Index' => $argv[3], 'Value' => $dba[$argv[3]])); - } - unset($dba); - } - else - { - echo "Not enough parameters\n"; - exit(1); - } -} -catch (exception $err) { - var_dump($err); - exit(1); -} -?> \ No newline at end of file diff --git a/ext/spl/examples/dba_dump.php b/ext/spl/examples/dba_dump.php deleted file mode 100755 index 2c698d427a175..0000000000000 --- a/ext/spl/examples/dba_dump.php +++ /dev/null @@ -1,42 +0,0 @@ - \ [\] - * - * Show all groups in the ini file specified by \. - * The regular expression \ is used to filter the by setting name. - * - * Note: configure with --enable-dba - */ - -if ($argc < 3) { - echo << [] - -Show all groups in the ini file specified by . -The regular expression is used to filter the by setting name. - - -EOF; - exit(1); -} - -if (!class_exists("DbaReader", false)) require_once("dbareader.inc"); -if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc"); - -$db = new DbaReader($argv[1], $argv[2]); - -if ($argc>3) { - $db = new KeyFilter($db, $argv[3]); -} - -foreach($db as $key => $val) { - echo "'$key' => '$val'\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/dbaarray.inc b/ext/spl/examples/dbaarray.inc deleted file mode 100755 index fcd6bb378a3f7..0000000000000 --- a/ext/spl/examples/dbaarray.inc +++ /dev/null @@ -1,98 +0,0 @@ -db = dba_popen($file, "c", $handler); - if (!$this->db) { - throw new exception("Databse could not be opened"); - } - } - - /** - * Close database. - */ - function __destruct() - { - parent::__destruct(); - } - - /** - * Read an entry. - * - * @param $name key to read from - * @return value associated with $name - */ - function offsetGet($name) - { - $data = dba_fetch($name, $this->db); - if($data) { - if (ini_get('magic_quotes_runtime')) { - $data = stripslashes($data); - } - //return unserialize($data); - return $data; - } - else - { - return NULL; - } - } - - /** - * Set an entry. - * - * @param $name key to write to - * @param $value value to write - */ - function offsetSet($name, $value) - { - //dba_replace($name, serialize($value), $this->db); - dba_replace($name, $value, $this->db); - return $value; - } - - /** - * @return whether key $name exists. - */ - function offsetExists($name) - { - return dba_exists($name, $this->db); - } - - /** - * Delete a key/value pair. - * - * @param $name key to delete. - */ - function offsetUnset($name) - { - return dba_delete($name, $this->db); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/dbareader.inc b/ext/spl/examples/dbareader.inc deleted file mode 100755 index b09791239bea4..0000000000000 --- a/ext/spl/examples/dbareader.inc +++ /dev/null @@ -1,96 +0,0 @@ -db = dba_open($file, 'r', $handler)) { - throw new exception('Could not open file ' . $file); - } - } - - /** - * Close database. - */ - function __destruct() { - dba_close($this->db); - } - - /** - * Rewind to first element. - */ - function rewind() { - $this->key = dba_firstkey($this->db); - $this->fetch_data(); - } - - /** - * Move to next element. - * - * @return void - */ - function next() { - $this->key = dba_nextkey($this->db); - $this->fetch_data(); - } - - /** - * Fetches the current data if $key is valid - */ - private function fetch_data() { - if ($this->key !== false) { - $this->val = dba_fetch($this->key, $this->db); - } - } - - /** - * @return Current data. - */ - function current() { - return $this->val; - } - - /** - * @return Whether more elements are available. - */ - function valid() { - if ($this->db && $this->key !== false) { - return true; - } else { - return false; - } - } - - /** - * @return Current key. - */ - function key() { - return $this->key; - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/directoryfilterdots.inc b/ext/spl/examples/directoryfilterdots.inc deleted file mode 100755 index fceeda2a23435..0000000000000 --- a/ext/spl/examples/directoryfilterdots.inc +++ /dev/null @@ -1,45 +0,0 @@ -getInnerIterator()->isDot(); - } - - /** @return the current entries path name - */ - function key() - { - return $this->getInnerIterator()->getPathname(); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc deleted file mode 100644 index 0ba96085b348e..0000000000000 --- a/ext/spl/examples/directorygraphiterator.inc +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/examples/directorytree.inc b/ext/spl/examples/directorytree.inc deleted file mode 100755 index 7bd9c2c597d6c..0000000000000 --- a/ext/spl/examples/directorytree.inc +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/examples/directorytree.php b/ext/spl/examples/directorytree.php deleted file mode 100755 index dc26d6cc22e7f..0000000000000 --- a/ext/spl/examples/directorytree.php +++ /dev/null @@ -1,37 +0,0 @@ - [\ [\]] - * - * Simply specify the path to tree with parameter \. - */ - -if ($argc < 2) { - echo << - -Displays a graphical directory tree for the given . - - The directory for which to generate the directory tree graph. - - -EOF; - exit(1); -} - -if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc"); - -$length = $argc > 3 ? $argv[3] : -1; - -echo $argv[1]."\n"; -foreach(new LimitIterator(new DirectoryTreeIterator($argv[1]), @$argv[2], $length) as $key=>$file) { -//foreach(new DirectoryTreeIterator($argv[1]) as $file) { - echo $file . "\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/directorytree_size.php b/ext/spl/examples/directorytree_size.php deleted file mode 100755 index d703409c453ea..0000000000000 --- a/ext/spl/examples/directorytree_size.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Simply specify the path to tree with parameter \. - */ - -if ($argc < 2) { - echo << - -Displays a graphical directory tree for the given with size info for all -files. - - The directory for which to generate the directory tree graph. - - -EOF; - exit(1); -} - -if (!class_exists("RecursiveTreeIterator", false)) require_once("recursivetreeiterator.inc"); - -echo $argv[1]."\n"; -foreach(new RecursiveTreeIterator(new RecursiveDirectoryIterator($argv[1], RecursiveDirectoryIterator::NEW_CURRENT_AND_KEY), RecursiveTreeIterator::BYPASS_CURRENT) as $file => $fileinfo) { - echo $file . " (" . $fileinfo->getSize() . ")\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/directorytreeiterator.inc b/ext/spl/examples/directorytreeiterator.inc deleted file mode 100644 index 1966ce48d8b8e..0000000000000 --- a/ext/spl/examples/directorytreeiterator.inc +++ /dev/null @@ -1,47 +0,0 @@ -getDepth(); $l++) { - $tree .= $this->getSubIterator($l)->hasNext() ? '| ' : ' '; - } - return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-') - . $this->getSubIterator($l)->__toString(); - } - - /** Aggregates the inner iterator - */ - function __call($func, $params) - { - return call_user_func_array(array($this->getSubIterator(), $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/findfile.inc b/ext/spl/examples/findfile.inc deleted file mode 100755 index 05d525a3fbd6c..0000000000000 --- a/ext/spl/examples/findfile.inc +++ /dev/null @@ -1,65 +0,0 @@ -file = $file; - $list = split(';', $path); - if (count($list) <= 1) { - parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))); - } else { - $it = new AppendIterator(); - foreach($list as $path) { - $it->append(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))); - } - parent::__construct($it); - } - } - - /** @return whether the current file matches the given filename - */ - function accept() - { - return !strcmp($this->current(), $this->file); - } - - /** @return the filename to search for. - * @note This may be overloaded and contain a regular expression for an - * extended class that uses regular expressions to search. - */ - function getSearch() - { - return $this->file; - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/findfile.php b/ext/spl/examples/findfile.php deleted file mode 100755 index 60146cbffd0bf..0000000000000 --- a/ext/spl/examples/findfile.php +++ /dev/null @@ -1,33 +0,0 @@ - \ - * - * \ Path to search in. You can specify multiple paths by separating - * them with ';'. - * \ Filename to look for. - */ - -if ($argc < 3) { - echo << - -Find a specific file by name. - - Path to search in. - Filename to look for. - - -EOF; - exit(1); -} - -if (!class_exists("FindFile", false)) require_once("findfile.inc"); - -foreach(new FindFile($argv[1], $argv[2]) as $file) echo $file->getPathname()."\n"; -?> \ No newline at end of file diff --git a/ext/spl/examples/findregex.php b/ext/spl/examples/findregex.php deleted file mode 100755 index b43ee0cbbc169..0000000000000 --- a/ext/spl/examples/findregex.php +++ /dev/null @@ -1,36 +0,0 @@ - \ - * - * \ Path to search in. - * \ Filename to look for. - */ - -if ($argc < 3) { - echo << - -Find a specific file by name. - - Path to search in. - Regex for filenames to look for. - - -EOF; - exit(1); -} - -if (!class_exists("RegexFindFile", false)) require_once("regexfindfile.inc"); - -foreach(new RegexFindFile($argv[1], $argv[2]) as $file) -{ - echo $file->getPathname()."\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/ini_groups.php b/ext/spl/examples/ini_groups.php deleted file mode 100755 index 51369110962ac..0000000000000 --- a/ext/spl/examples/ini_groups.php +++ /dev/null @@ -1,41 +0,0 @@ - [\] - * - * Show all groups in the ini file specified by \. - * The regular expression \ is used to filter the result. - * - * Note: configure with --enable-dba - */ - -if ($argc < 2) { - echo << [] - -Show all groups in the ini file specified by . -The regular expression is used to filter the result. - - -EOF; - exit(1); -} - -if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc"); -if (!class_exists("IniGroups", false)) require_once("inigroups.inc"); - -$it = new IniGroups($argv[1]); -if ($argc>2) { - $it = new KeyFilter($it, $argv[2]); -} - -foreach($it as $group) { - echo "$group\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/inigroups.inc b/ext/spl/examples/inigroups.inc deleted file mode 100755 index 62cfa3e0296c4..0000000000000 --- a/ext/spl/examples/inigroups.inc +++ /dev/null @@ -1,54 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/examples/keyfilter.inc b/ext/spl/examples/keyfilter.inc deleted file mode 100755 index eaf6b77364dec..0000000000000 --- a/ext/spl/examples/keyfilter.inc +++ /dev/null @@ -1,64 +0,0 @@ -regex = $regex; - } - - /** \return whether the current key mathes the regular expression - */ - function accept() - { - return ereg($this->regex, $this->getInnerIterator()->key()); - } - - /** @return regular expression used as filter - */ - function getRegex() - { - return $this->regex; - } - - /** - * hidden __clone - */ - protected function __clone() - { - // disallow clone - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/nocvsdir.php b/ext/spl/examples/nocvsdir.php deleted file mode 100755 index 5ad57864b0de2..0000000000000 --- a/ext/spl/examples/nocvsdir.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * Simply specify the path to tree with parameter \. - */ - -if ($argc < 2) { - echo << - -Show the directory and all it's contents without any CVS directory in . - - The directory for which to generate the directory. - - -EOF; - exit(1); -} - -if (!class_exists("RecursiveFilterIterator")) require_once("recursivefilteriterator.inc"); - -class NoCvsDirectory extends RecursiveFilterIterator -{ - function accept() - { - return $this->getInnerIterator()->getFilename() != 'CVS'; - } -} - -$it = new RecursiveIteratorIterator(new NoCvsDirectory(new RecursiveDirectoryIterator($argv[1]))); - -foreach($it as $pathname => $file) -{ - echo $pathname."\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/recursivetreeiterator.inc b/ext/spl/examples/recursivetreeiterator.inc deleted file mode 100755 index 42d217fa767ed..0000000000000 --- a/ext/spl/examples/recursivetreeiterator.inc +++ /dev/null @@ -1,113 +0,0 @@ -rit_flags = $rit_flags; - } - - /** Prefix strings used in getPrefix() - * - * 0: prefix used to start elements - * 1: prefix used if $level < depth and hasNext($level) == true - * 2: prefix used if $level < depth and hasNext($level) == false - * 3: prefix used if $level == depth and hasNext($level) == true - * 4: prefix used if $level == depth and hasNext($level) == false - * 5: prefix used right in front of the current element - */ - public $prefix = array(0=>'', 1=>'| ', 2=>' ', 3=>'|-', 4=>'\-', 5=>''); - - /** @return string to place in front of current element - */ - function getPrefix() - { - $tree = ''; - for ($level = 0; $level < $this->getDepth(); $level++) - { - $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[1] : $this->prefix[2]; - } - $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[3] : $this->prefix[4]; - - return $this->prefix[0] . $tree . $this->prefix[5]; - } - - /** @return string presentation build for current element - */ - function getEntry() - { - return @(string)parent::current(); - } - - /** @return string to place after the current element - */ - function getPostfix() - { - return ''; - } - - /** @return the current element prefixed and postfixed - */ - function current() - { - if ($this->rit_flags & self::BYPASS_CURRENT) - { - return parent::current(); - } - else - { - return $this->getPrefix() . $this->getEntry() . $this->getPostfix(); - } - } - - /** @return the current key prefixed and postfixed - */ - function key() - { - if ($this->rit_flags & self::BYPASS_KEY) - { - return parent::key(); - } - else - { - return $this->getPrefix() . parent::key() . $this->getPostfix(); - } - } - - /** Aggregates the inner iterator - */ - function __call($func, $params) - { - return call_user_func_array(array($this->getSubIterator(), $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/regexfindfile.inc b/ext/spl/examples/regexfindfile.inc deleted file mode 100755 index d5dd7225360c3..0000000000000 --- a/ext/spl/examples/regexfindfile.inc +++ /dev/null @@ -1,40 +0,0 @@ -getSearch(), $this->current()); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/searchiterator.inc b/ext/spl/examples/searchiterator.inc deleted file mode 100755 index 944a4ac5a55c2..0000000000000 --- a/ext/spl/examples/searchiterator.inc +++ /dev/null @@ -1,58 +0,0 @@ -done = false; - } - - /** @return whether the current element is valid - * which can only happen once per iteration. - */ - function valid() - { - return !$this->done && parent::valid(); - } - - /** Do not move forward but instead mark as finished. - * @return void - */ - function next() - { - $this->done = true; - } - - /** Aggregates the inner iterator - */ - function __call($func, $params) - { - return call_user_func_array(array($this->getInnerIterator(), $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/tests/examples.inc b/ext/spl/examples/tests/examples.inc deleted file mode 100755 index feeba7db243de..0000000000000 --- a/ext/spl/examples/tests/examples.inc +++ /dev/null @@ -1,23 +0,0 @@ -append($path . '/' . strtolower($c) . '.inc'); - } - } -} - -$classes = array( -); - -foreach (new IncludeFiles(dirname(__FILE__). '/..', $classes) as $file) -{ - require_once($file); -} - -?> \ No newline at end of file diff --git a/ext/spl/examples/tree.php b/ext/spl/examples/tree.php deleted file mode 100755 index 5af36a673c027..0000000000000 --- a/ext/spl/examples/tree.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Simply specify the path to tree with parameter \. - */ - -// The following line only operates on classes which are converted to c already. -// But does not generate a graphical output. -//foreach(new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($argv[1])), 1) as $file) { - -if ($argc < 2) { - echo << - -Displays a graphical tree for the given . - - The directory for which to generate the tree graph. - - -EOF; - exit(1); -} - -if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc"); -if (!class_exists("DirectoryGraphIterator", false)) require_once("directorygraphiterator.inc"); - -echo $argv[1]."\n"; -foreach(new DirectoryGraphIterator($argv[1]) as $file) -{ - echo $file . "\n"; -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/appenditerator.inc b/ext/spl/internal/appenditerator.inc deleted file mode 100755 index 74f254d11e041..0000000000000 --- a/ext/spl/internal/appenditerator.inc +++ /dev/null @@ -1,122 +0,0 @@ -iterators = new ArrayIterator(); - } - - /** Append an Iterator - * @param $it Iterator to append - * - * If the current state is invalid but the appended iterator is valid - * the the AppendIterator itself becomes valid. However there will be no - * call to $it->rewind(). Also if the current state is invalid the inner - * ArrayIterator will be rewound und forwarded to the appended element. - */ - function append(Iterator $it) - { - $this->iterators->append($it); - } - - /** @return the current inner Iterator - */ - function getInnerIterator() - { - return $this->iterators->current(); - } - - /** Rewind to the first element of the first inner Iterator. - * @return void - */ - function rewind() - { - $this->iterators->rewind(); - if ($this->iterators->valid()) - { - $this->getInnerIterator()->rewind(); - } - } - - /** @return whether the current element is valid - */ - function valid() - { - return $this->iterators->valid() && $this->getInnerIterator()->valid(); - } - - /** @return the current value if it is valid or \c NULL - */ - function current() - { - /* Using $this->valid() would be exactly the same; it would omit - * the access to a non valid element in the inner iterator. Since - * the user didn't respect the valid() return value false this - * must be intended hence we go on. */ - return $this->iterators->valid() ? $this->getInnerIterator()->current() : NULL; - } - - /** @return the current key if it is valid or \c NULL - */ - function key() - { - return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL; - } - - /** Move to the next element. If this means to another Iterator that - * rewind that Iterator. - * @return void - */ - function next() - { - if (!$this->iterators->valid()) - { - return; /* done all */ - } - $this->getInnerIterator()->next(); - if ($this->getInnerIterator()->valid()) - { - return; /* found valid element in current inner iterator */ - } - $this->iterators->next(); - while ($this->iterators->valid()) - { - $this->getInnerIterator()->rewind(); - if ($this->getInnerIterator()->valid()) - { - return; /* found element as first elemet in another iterator */ - } - $this->iterators->next(); - } - } - - /** Aggregates the inner iterator - */ - function __call($func, $params) - { - return call_user_func_array(array($this->getInnerIterator(), $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/cachingiterator.inc b/ext/spl/internal/cachingiterator.inc deleted file mode 100755 index 1129793873f96..0000000000000 --- a/ext/spl/internal/cachingiterator.inc +++ /dev/null @@ -1,157 +0,0 @@ -it = $it; - $this->flags = $flags & (0x0000FFFF); - $this->next(); - } - - /** Rewind the Iterator - */ - function rewind() - { - $this->it->rewind(); - $this->next(); - } - - /** Forward to the next element - */ - function next() - { - if ($this->valid = $this->it->valid()) { - $this->current = $this->it->current(); - $this->key = $this->it->key(); - if ($this->flags & self::CALL_TOSTRING) { - if (is_object($this->current)) { - $this->strValue = $this->current->__toString(); - } else { - $this->strValue = (string)$this->current; - } - } - } else { - $this->current = NULL; - $this->key = NULL; - $this->strValue = NULL; - } - $this->it->next(); - } - - /** @return whether teh iterator is valid - */ - function valid() - { - return $this->valid; - } - - /** @return whether there is one more element - */ - function hasNext() - { - return $this->it->valid(); - } - - /** @return the current element - */ - function current() - { - return $this->current; - } - - /** @return the current key - */ - function key() - { - return $this->key; - } - - /** Aggregate the inner iterator - * - * @param func Name of method to invoke - * @param params Array of parameters to pass to method - */ - function __call($func, $params) - { - return call_user_func_array(array($this->it, $func), $params); - } - - /** @return the string represenatation that was generated for the current - * element - * @throw exception when CALL_TOSTRING was not specified in constructor - */ - function __toString() - { - if ($this->flags & self::TOSTRING_USE_KEY) - { - return $this->key; - } - else if ($this->flags & self::TOSTRING_USE_CURRENT) - { - return $this->current; - } - if (!$this->flags & self::CALL_TOSTRING) - { - throw new exception('CachingIterator does not fetch string value (see CachingIterator::__construct)'); - } - return $this->strValue; - } - - /** - * @return The inner iterator - */ - function getInnerIterator() - { - return $this->it; - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/emptyiterator.inc b/ext/spl/internal/emptyiterator.inc deleted file mode 100755 index 52e844dfe5842..0000000000000 --- a/ext/spl/internal/emptyiterator.inc +++ /dev/null @@ -1,62 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/internal/filteriterator.inc b/ext/spl/internal/filteriterator.inc deleted file mode 100755 index cc9c999a4041c..0000000000000 --- a/ext/spl/internal/filteriterator.inc +++ /dev/null @@ -1,129 +0,0 @@ -it = $it; - } - - /** - * Rewind the inner iterator. - */ - function rewind() { - $this->it->rewind(); - $this->fetch(); - } - - /** - * Accept function to decide whether an element of the inner iterator - * should be accessible through the Filteriterator. - * - * @return whether or not to expose the current element of the inner - * iterator. - */ - abstract function accept(); - - /** - * Fetch next element and store it. - * - * @return void - */ - protected function fetch() { - while ($this->it->valid()) { - if ($this->accept()) { - return; - } - $this->it->next(); - }; - } - - /** - * Move to next element - * - * @return void - */ - function next() { - $this->it->next(); - $this->fetch(); - } - - /** - * @return Whether more elements are available - */ - function valid() { - return $this->it->valid(); - } - - /** - * @return The current key - */ - function key() { - return $this->it->key(); - } - - /** - * @return The current value - */ - function current() { - return $this->it->current(); - } - - /** - * hidden __clone - */ - protected function __clone() { - // disallow clone - } - - /** - * @return The inner iterator - */ - function getInnerIterator() - { - return $this->it; - } - - /** Aggregate the inner iterator - * - * @param func Name of method to invoke - * @param params Array of parameters to pass to method - */ - function __call($func, $params) - { - return call_user_func_array(array($this->it, $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/infiniteiterator.inc b/ext/spl/internal/infiniteiterator.inc deleted file mode 100755 index 3d97b903b1c14..0000000000000 --- a/ext/spl/internal/infiniteiterator.inc +++ /dev/null @@ -1,48 +0,0 @@ -$key) - { - echo "$val=>$key\n"; - } - \endverbatim - */ -class InfiniteIterator extends IteratorIterator -{ - /** Move the inner Iterator forward to its next element or rewind it. - * @return void - */ - function next() - { - $this->getInnerIterator()->next(); - if (!$this->getInnerIterator()->valid()) - { - $this->getInnerIterator()->rewind(); - } - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/iteratoriterator.inc b/ext/spl/internal/iteratoriterator.inc deleted file mode 100755 index 147f93fadefb9..0000000000000 --- a/ext/spl/internal/iteratoriterator.inc +++ /dev/null @@ -1,121 +0,0 @@ -getIterator(); - } - if ($iterator instanceof Iterator) - { - $this->iterator = $iterator; - } - else - { - throw new Exception("Classes that only implement Traversable can be wrapped only after converting class IteratorItaerator into c code"); - } - } - - /** \return the inner iterator as passed to the constructor - */ - function getInnerIterator() - { - return $this->iterator; - } - - /** \return whether the iterator is valid - */ - function valid() - { - return $this->iterator->valid(); - } - - /** \return current key - */ - function key() - { - return $this->iterator->key(); - } - - /** \return current value - */ - function current() - { - return $this->iterator->current(); - } - - /** forward to next element - */ - function next() - { - return $this->iterator->next(); - } - - /** rewind to the first element - */ - function rewind() - { - return $this->iterator->rewind(); - } - - /** Aggregate the inner iterator - * - * @param func Name of method to invoke - * @param params Array of parameters to pass to method - */ - function __call($func, $params) - { - return call_user_func_array(array($this->it, $func), $params); - } - - /** The inner iterator must be private because when this class will be - * converted to c code it won't no longer be available. - */ - private $iterator; -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/limititerator.inc b/ext/spl/internal/limititerator.inc deleted file mode 100755 index 930ba535fadac..0000000000000 --- a/ext/spl/internal/limititerator.inc +++ /dev/null @@ -1,134 +0,0 @@ - 0'); - } - if ($count < 0 && $count != -1) { - throw new exception('Parameter count must either be -1 or a value greater than or equal to 0'); - } - $this->it = $it; - $this->offset = $offset; - $this->count = $count; - $this->pos = 0; - } - - /** Seek to specified position - * @param position offset to seek to (relative to beginning not offset - * specified in constructor). - * @throw exception when position is invalid - */ - function seek($position) { - if ($position < $this->offset) { - throw new exception('Cannot seek to '.$position.' which is below offset '.$this->offset); - } - if ($position > $this->offset + $this->count && $this->count != -1) { - throw new exception('Cannot seek to '.$position.' which is behind offset '.$this->offset.' plus count '.$this->count); - } - if ($this->it instanceof SeekableIterator) { - $this->it->seek($position); - $this->pos = $position; - } else { - while($this->pos < $position && $this->it->valid()) { - $this->next(); - } - } - } - - /** Rewind to offset specified in constructor - */ - function rewind() - { - $this->it->rewind(); - $this->pos = 0; - $this->seek($this->offset); - } - - /** @return whether iterator is valid - */ - function valid() { - return ($this->count == -1 || $this->pos < $this->offset + $this->count) - && $this->it->valid(); - } - - /** @return current key - */ - function key() { - return $this->it->key(); - } - - /** @return current element - */ - function current() { - return $this->it->current(); - } - - /** Forward to nect element - */ - function next() { - $this->it->next(); - $this->pos++; - } - - /** @return current position relative to zero (not to offset specified in - * constructor). - */ - function getPosition() { - return $this->pos; - } - - /** - * @return The inner iterator - */ - function getInnerIterator() - { - return $this->it; - } - - /** Aggregate the inner iterator - * - * @param func Name of method to invoke - * @param params Array of parameters to pass to method - */ - function __call($func, $params) - { - return call_user_func_array(array($this->it, $func), $params); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/norewinditerator.inc b/ext/spl/internal/norewinditerator.inc deleted file mode 100755 index 37cfcc3ead3d6..0000000000000 --- a/ext/spl/internal/norewinditerator.inc +++ /dev/null @@ -1,28 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/internal/outeriterator.inc b/ext/spl/internal/outeriterator.inc deleted file mode 100755 index dc7b11e05a0e1..0000000000000 --- a/ext/spl/internal/outeriterator.inc +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/internal/parentiterator.inc b/ext/spl/internal/parentiterator.inc deleted file mode 100755 index 70f0bee796b05..0000000000000 --- a/ext/spl/internal/parentiterator.inc +++ /dev/null @@ -1,46 +0,0 @@ -it->hasChildren(); - } - - /** @return the ParentIterator for the current elements children - */ - function getChildren() - { - return new ParentIterator($this->it->getChildren()); - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/recursivearrayiterator.inc b/ext/spl/internal/recursivearrayiterator.inc deleted file mode 100755 index e583c734b4164..0000000000000 --- a/ext/spl/internal/recursivearrayiterator.inc +++ /dev/null @@ -1,59 +0,0 @@ -current()); - } - - /** @return an iterator for the current elements children - * - * @note the returned iterator will be of the same class as $this - */ - function getChildren() - { - if ($this->current() instanceof self) - { - return $this->current(); - } - if (empty($this->ref)) - { - $this->ref = new ReflectionClass($this); - } - return $this->ref->newInstance($this->current()); - } - - private $ref; -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/recursivecachingiterator.inc b/ext/spl/internal/recursivecachingiterator.inc deleted file mode 100755 index 9b6ab7ab53d14..0000000000000 --- a/ext/spl/internal/recursivecachingiterator.inc +++ /dev/null @@ -1,99 +0,0 @@ -hasChildren = false; - $this->getChildren = NULL; - parent::rewind(); - } - - /** Forward to next element if necessary then an Iterator for the Children - * will be created. - */ - function next() - { - if ($this->hasChildren = $this->it->hasChildren()) - { - try - { - $child = $this->it->getChildren(); - if (!$this->ref) - { - $this->ref = new ReflectionClass($this); - } - $this->getChildren = $ref->newInstance($child, $this->flags); - } - catch(Exception $e) - { - if (!$this->flags & self::CATCH_GET_CHILD) - { - throw $e; - } - $this->hasChildren = false; - $this->getChildren = NULL; - } - } else - { - $this->getChildren = NULL; - } - parent::next(); - } - - private $ref; - - /** @return whether the current element has children - * @note The check whether the Iterator for the children can be created was - * already executed. Hence when flag CATCH_GET_CHILD was given in - * constructor this fucntion returns false so that getChildren does - * not try to access those children. - */ - function hasChildren() - { - return $this->hasChildren; - } - - /** @return An Iterator for the children - */ - function getChildren() - { - return $this->getChildren; - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/recursivefilteriterator.inc b/ext/spl/internal/recursivefilteriterator.inc deleted file mode 100755 index b651fb20ea959..0000000000000 --- a/ext/spl/internal/recursivefilteriterator.inc +++ /dev/null @@ -1,62 +0,0 @@ -getInnerIterator()->hasChildren(); - } - - /** @return an iterator for the current elements children - * - * @note the returned iterator will be of the same class as $this - */ - function getChildren() - { - if (empty($this->ref)) - { - $this->ref = new ReflectionClass($this); - } - return $this->ref->newInstance($this->getInnerIterator()->getChildren()); - } - - private $ref; -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/recursiveiterator.inc b/ext/spl/internal/recursiveiterator.inc deleted file mode 100755 index 640be25a1340d..0000000000000 --- a/ext/spl/internal/recursiveiterator.inc +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/internal/recursiveiteratoriterator.inc b/ext/spl/internal/recursiveiteratoriterator.inc deleted file mode 100755 index aa2a9db8e74f6..0000000000000 --- a/ext/spl/internal/recursiveiteratoriterator.inc +++ /dev/null @@ -1,269 +0,0 @@ -ait[0] = $it; - $this->mode = $mode; - $this->flags = $flags; - } - - /** Rewind to top iterator as set in constructor - */ - function rewind() - { - while ($this->level) { - unset($this->ait[$this->level--]); - $this->endChildren(); - } - $this->ait[0]->rewind(); - $this->ait[0]->recursed = false; - callNextElement(true); - } - - /** @return whether iterator is valid - */ - function valid() - { - $level = $this->level; - while ($level >= 0) { - $it = $this->ait[$level]; - if ($it->valid()) { - return true; - } - $level--; - $this->endChildren(); - } - return false; - } - - /** @return current key - */ - function key() - { - $it = $this->ait[$this->level]; - return $it->key(); - } - - /** @return current element - */ - function current() - { - $it = $this->ait[$this->level]; - return $it->current(); - } - - /** Forward to next element - */ - function next() - { - while ($this->level >= 0) { - $it = $this->ait[$this->level]; - if ($it->valid()) { - if (!$it->recursed && callHasChildren()) { - if ($this->max_depth == -1 || $this->max_depth > $this->level) { - $it->recursed = true; - try - { - $sub = callGetChildren(); - } - catch (Exception $e) - { - if (!($this->flags & self::CATCH_GET_CHILD)) - { - throw $e; - } - $it->next(); - continue; - } - $sub->recursed = false; - $sub->rewind(); - if ($sub->valid()) { - $this->ait[++$this->level] = $sub; - if (!$sub instanceof RecursiveIterator) { - throw new Exception(get_class($sub).'::getChildren() must return an object that implements RecursiveIterator'); - } - $this->beginChildren(); - return; - } - unset($sub); - } - else - { - /* do not recurse because of depth restriction */ - if ($this->flages & self::LEVAES_ONLY) - { - $it->next(); - continue; - } - else - { - return; // we want the parent - } - } - $it->next(); - $it->recursed = false; - if ($it->valid()) { - return; - } - $it->recursed = false; - } - } - else if ($this->level > 0) { - unset($this->ait[$this->level--]); - $it = $this->ait[$this->level]; - $this->endChildren(); - callNextElement(false); - } - } - callNextElement(true); - } - - /** @return Sub Iterator at given level or if unspecified the current sub - * Iterator - */ - function getSubIterator($level = NULL) - { - if (is_null($level)) { - $level = $this->level; - } - return @$this->ait[$level]; - } - - /** - * @return The inner iterator - */ - function getInnerIterator() - { - return $this->it; - } - - /** @return Current Depth (Number of parents) - */ - function getDepth() - { - return $this->level; - } - - /** @return whether current sub iterators current element has children - * @since PHP 5.1 - */ - function callHasChildren() - { - return $this->ait[$this->level]->hasChildren(); - } - - /** @return current sub iterators current children - * @since PHP 5.1 - */ - function callGetChildren() - { - return $this->ait[$this->level]->getChildren(); - } - - /** Called right after calling getChildren() and its rewind(). - * @since PHP 5.1 - */ - function beginChildren() - { - } - - /** Called after current child iterator is invalid and right before it - * gets destructed. - * @since PHP 5.1 - */ - function endChildren() - { - } - - private function callNextElement($after_move) - { - if ($this->valid()) - { - if ($after_move) - { - if (($this->mode == self::SELF_FIRST && $this->callHasChildren()) - $this->mode == self::LEAVES_ONLY) - $this->nextElement(); - } - else - { - $this->nextElement(); - } - } - } - - /** Called when the next element is available - */ - function nextElement(); - - /** @param max_depth new maximum allowed depth or -1 for any depth - */ - function setMaxDepth($max_depth = -1) - { - $max_depth = (int)$max_depth; - if ($max_depth < -1) { - throw new OutOfRangeException('Parameter max_depth must be >= -1'); - } - $this->max_depth = $max_depth; - } - - /** @return maximum allowed depth or false if any depth is allowed - */ - function getMaxDepth() - { - return $this->max_depth == -1 ? false : $this->max_depth; - } -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/seekableiterator.inc b/ext/spl/internal/seekableiterator.inc deleted file mode 100755 index c00d264a95276..0000000000000 --- a/ext/spl/internal/seekableiterator.inc +++ /dev/null @@ -1,48 +0,0 @@ -rewind(); - $position = 0; - while($position < $index && $this->valid()) { - $this->next(); - $position++; - } - if (!$this->valid()) { - throw new OutOfBoundsException('Invalid seek position'); - } - } - \endcode - */ - function seek($index); -} - -?> \ No newline at end of file diff --git a/ext/spl/internal/splfileobject.inc b/ext/spl/internal/splfileobject.inc deleted file mode 100755 index 66e0398d3ec66..0000000000000 --- a/ext/spl/internal/splfileobject.inc +++ /dev/null @@ -1,353 +0,0 @@ -fp = fopen($file_name, $open_mode, $use_include_path, $context); - if (!$this->fp) - { - throw new RuntimeException("Cannot open file $file_name"); - } - $this->fname = $file_name; - } - - /** - * @return the filename as specified in the constructor - */ - function getFilename() - { - return $this->fname; - } - - /** - * @return whether the end of the stream is reached - */ - function eof() - { - return eof($this->fp); - } - - /** increase current line number - * @return next line from stream - */ - function fgets() - { - $this->freeLine(); - $this->lnum++; - $buf = fgets($this->fp, $this->max_len); - - return $buf; - } - - /** - * @param delimiter character used as field separator - * @param enclosure end of - * @return array containing read data - */ - function fgetcsv($delimiter = ';', $enclosure = '') - { - $this->freeLine(); - $this->lnum++; - return fgetcsv($this->fp, $this->max_len, $delimiter, $enclosure); - } - - /** - * @param operation lock operation (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB) - * @retval $wouldblock whether the operation would block - */ - function flock($operation, &$wouldblock) - { - return flock($this->fp, $operation, $wouldblock); - } - - /** - * Flush current data - * @return success or failure - */ - function fflush() - { - return fflush($this->fp); - } - - /** - * @return current file position - */ - function ftell() - { - return ftell($this->fp); - } - - /** - * @param pos new file position - * @param whence seek method (SEEK_SET, SEEK_CUR, SEEK_END) - * @return Upon success, returns 0; otherwise, returns -1. Note that - * seeking past EOF is not considered an error. - */ - function fseek($pos, $whence = SEEK_SET) - { - return fseek($this->fp, $pos, $whence); - } - - /** - * @return next char from file - * @note a new line character does not increase $this->lnum - */ - function fgetc() - { - $this->freeLine(); - $c = fgetc($this->fp); - if ($c == '\n') { - $this->lnum++; - } - } - - /** Read and return remaining part of stream - * @return size of remaining part passed through - */ - function fpassthru() - { - return fpassthru($this->fp); - } - - /** Get a line from the file and strip HTML tags - * @param $allowable_tags tags to keep in the string - */ - function fgetss($allowable_tags = NULL) - { - return fgetss($this->fp, $allowable_tags); - } - - /** Scan the next line - * @param $format string specifying format to parse - */ - function fscanf($format /* , ... */) - { - $this->freeLine(); - $this->lnum++; - return fscanf($this->fp, $format /* , ... */); - } - - /** - * @param $str to write - * @param $length maximum line length to write - */ - function fwrite($str, $length = NULL) - { - return fwrite($this->fp, $length); - } - - /** - * @return array of file stat information - */ - function fstat() - { - return fstat($this->fp); - } - - /** - * @param $size new size to truncate file to - */ - function ftruncate($size) - { - return ftruncate($this->fp, $size); - } - - /** - * @param $flags new flag set - */ - function setFlags($flags) - { - $this->flags = $flags; - } - - /** - * @return current set of flags - */ - function getFlags() - { - return $this->flags; - } - - /** - * @param $max_len set the maximum line length read - */ - function setMaxLineLen($max_len) - { - $this->max_len = $max_len; - } - - /** - * @return current setting for max line - */ - function getMaxLineLen() - { - return $this->max_len; - } - - /** - * @return false - */ - function hasChildren() - { - return false; - } - - /** - * @return false - */ - function getChildren() - { - return NULL; - } - - /** - * Invalidate current line buffer and set line number to 0. - */ - function rewind() - { - $this->freeLine(); - $this->lnum = 0; - } - - /** - * @return whether more data can be read - */ - function valid() - { - return !$this->eof(); - } - - /** - * @note Fill current line buffer if not done yet. - * @return line buffer - */ - function current() - { - if (is_null($this->line)) - { - $this->line = getCurrentLine(); - } - return $this->line; - } - - /** - * @return line number - * @note fgetc() will increase the line number when reaing a new line char. - * This has the effect key() called on a read a new line will already - * return the increased line number. - * @note Line counting works as long as you only read the file and do not - * use fseek(). - */ - function key() - { - return $this->lnum; - } - - /** Invalidate current line buffer. - */ - function next() - { - $this->freeLine(); - } - - /** - * @return next line read from file and increase the line counter - */ - private function readLine() - { - if ($this->eof()) - { - $this->freeLine(); - throw new RuntimeException("Cannot read from file " . $this->fname); - } - if ($this->line) { - $this->lnum++; - } - $this->freeLine(); - $this->line = fgets($this->fp, $this->max_len); - return $this->line; - } - - /** - * Free the current line buffer and increment the line counter - */ - private function freeLine() - { - if ($this->line) { - $this->line = NULL; - } - } - - /* - * @note If you DO overload this function key() and current() will increment - * $this->lnum automatically. If not then function reaLine() will do - * that for you. - */ - function getCurrentLine() - { - $this->freeLine(); - if ($this->eof()) - { - throw new RuntimeException("Cannot read from file " . $this->fname); - } - $this->readLine(); - } - - /** - * @return current line - */ - function __toString() - { - return current(); - } - - /** - * @param $line_pos Seek to this line - */ - function seek($line_pos) - { - $this->rewind(); - while($this->lnum < $line_pos && !$this->eof()) - { - $this->getCurrentLine(); - } - } -} - -?> diff --git a/ext/spl/internal/splobjectstorage.inc b/ext/spl/internal/splobjectstorage.inc deleted file mode 100755 index 56690f499b330..0000000000000 --- a/ext/spl/internal/splobjectstorage.inc +++ /dev/null @@ -1,118 +0,0 @@ -storage); - } - - /** @return whether iterator is valid - */ - function valid() - { - return key($this->storage) !== false; - } - - /** @return current key - */ - function key() - { - return $this->index; - } - - /** @return current object - */ - function current() - { - return current($this->storage); - } - - /** Forward to next element - */ - function next() - { - next($this->storage); - $this->index++; - } - - /** @return number of objects in storage - */ - function count() - { - return count($this->storage); - } - - /** @param obj object to look for - * @return whether $obj is contained in storage - */ - function contains($obj) - { - if (is_object($obj)) - { - foreach($this->storage as $object) - { - if ($object === $obj) - { - return true; - } - } - } - return false; - } - - /** @param $obj new object to attach to storage if not yet contained - */ - function attach($obj) - { - if (is_object($obj) && !$this->contains($obj)) - { - $this->storage[] = $obj; - } - } - - /** @param $obj object to remove from storage - */ - function detach($obj) - { - if (is_object($obj)) - { - foreach($this->storage as $idx => $object) - { - if ($object === $obj) - { - unset($this->storage[$idx]); - $this->rewind(); - return; - } - } - } - } -} - -?> \ No newline at end of file diff --git a/ext/spl/package.xml b/ext/spl/package.xml deleted file mode 100755 index f99cd7ce41aef..0000000000000 --- a/ext/spl/package.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - SPL - Standard PHP Library - - - helly - Marcus Boerger - helly@php.net - lead - - - -SPL is a collection of interfaces and classes that are meant to solve -standard problems. - - PHP - - stable - 0.1-dev - TBA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c deleted file mode 100755 index 46e19bb8b0752..0000000000000 --- a/ext/spl/php_spl.c +++ /dev/null @@ -1,689 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H - #include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_array.h" -#include "spl_directory.h" -#include "spl_iterators.h" -#include "spl_sxe.h" -#include "spl_exceptions.h" -#include "spl_observer.h" -#include "zend_exceptions.h" -#include "zend_interfaces.h" - -#ifdef COMPILE_DL_SPL -ZEND_GET_MODULE(spl) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(spl) - -/* {{{ spl_functions_none - */ -function_entry spl_functions_none[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ spl_init_globals - */ -static void spl_init_globals(zend_spl_globals *spl_globals) -{ - spl_globals->autoload_extensions = NULL; - spl_globals->autoload_functions = NULL; -} -/* }}} */ - -static zend_class_entry * spl_find_ce_by_name(zend_uchar ztype, void *name, int len, zend_bool autoload TSRMLS_DC) -{ - zend_class_entry **ce; - int found; - - if (!autoload) { - char *lc_name; - - lc_name = zend_u_str_tolower_dup(ztype, name, len); - found = zend_u_hash_find(EG(class_table), ztype, lc_name, len +1, (void **) &ce); - efree(lc_name); - } else { - found = zend_u_lookup_class(ztype, name, len, &ce TSRMLS_CC); - } - if (found != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class %v does not exist%s", name, autoload ? " and could not be loaded" : ""); - return NULL; - } - - return *ce; -} - -/* {{{ array class_parents(object instance) - Return an array containing the names of all parent classes */ -PHP_FUNCTION(class_parents) -{ - zval *obj; - zend_class_entry *parent_class, *ce; - zend_bool autoload = 1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) { - RETURN_FALSE; - } - - if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_UNICODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected"); - RETURN_FALSE; - } - - if (Z_TYPE_P(obj) == IS_STRING || Z_TYPE_P(obj) == IS_UNICODE) { - if (NULL == (ce = spl_find_ce_by_name(Z_TYPE_P(obj), Z_UNIVAL_P(obj), Z_UNILEN_P(obj), autoload TSRMLS_CC))) { - RETURN_FALSE; - } - } else { - ce = Z_OBJCE_P(obj); - } - - array_init(return_value); - parent_class = ce->parent; - while (parent_class) { - spl_add_class_name(return_value, parent_class, 0, 0 TSRMLS_CC); - parent_class = parent_class->parent; - } -} -/* }}} */ - -/* {{{ proto array class_implements(mixed what [, bool autoload ]) - Return all classes and interfaces implemented by SPL */ -PHP_FUNCTION(class_implements) -{ - zval *obj; - zend_bool autoload = 1; - zend_class_entry *ce; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) { - RETURN_FALSE; - } - if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_UNICODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected"); - RETURN_FALSE; - } - - if (Z_TYPE_P(obj) == IS_STRING || Z_TYPE_P(obj) == IS_UNICODE) { - if (NULL == (ce = spl_find_ce_by_name(Z_TYPE_P(obj), Z_UNIVAL_P(obj), Z_UNILEN_P(obj), autoload TSRMLS_CC))) { - RETURN_FALSE; - } - } else { - ce = Z_OBJCE_P(obj); - } - - array_init(return_value); - spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE TSRMLS_CC); -} -/* }}} */ - -#define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \ - spl_add_classes(U_CLASS_ENTRY(spl_ce_ ## class_name), z_list, sub, allow, ce_flags TSRMLS_CC) - -#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \ - SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(ArrayIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(ArrayObject, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(BadFunctionCallException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(BadMethodCallException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(CachingIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(Countable, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(DirectoryIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(DomainException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(EmptyIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(FilterIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(InfiniteIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(InvalidArgumentException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(IteratorIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(LengthException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(LimitIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(LogicException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(NoRewindIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(OuterIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(OutOfBoundsException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(OutOfRangeException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(OverflowException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(ParentIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RangeException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveArrayIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveCachingIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveDirectoryIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveFilterIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveIteratorIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RecursiveRegExIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RegExIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(RuntimeException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SeekableIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SimpleXMLIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SplFileInfo, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SplFileObject, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SplObjectStorage, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SplObserver, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(SplSubject, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(UnderflowException, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(UnexpectedValueException, z_list, sub, allow, ce_flags); \ - -/* {{{ proto array spl_classes() - Return an array containing the names of all clsses and interfaces defined in SPL */ -PHP_FUNCTION(spl_classes) -{ - array_init(return_value); - - SPL_LIST_CLASSES(return_value, 0, 0, 0) -} -/* }}} */ - -int spl_autoload(const char *class_name, const char * lc_name, int class_name_len, const char * file_extension TSRMLS_DC) /* {{{ */ -{ - char *class_file; - int class_file_len; - int dummy = 1; - zend_file_handle file_handle; - zend_op_array *new_op_array; - zval *result = NULL; - - class_file_len = spprintf(&class_file, 0, "%s%s", lc_name, file_extension); - - if (zend_stream_open(class_file, &file_handle TSRMLS_CC) == SUCCESS) { - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(class_file, class_file_len); - } - if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - new_op_array = NULL; - zend_file_handle_dtor(&file_handle); - } - if (new_op_array) { - EG(return_value_ptr_ptr) = &result; - EG(active_op_array) = new_op_array; - - zend_execute(new_op_array TSRMLS_CC); - - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (!EG(exception)) { - if (EG(return_value_ptr_ptr)) { - zval_ptr_dtor(EG(return_value_ptr_ptr)); - } - } - - efree(class_file); - return zend_hash_exists(EG(class_table), (char*)lc_name, class_name_len+1); - } - } - efree(class_file); - return 0; -} /* }}} */ - -/* {{{ void spl_autoload(string class_name [, string file_extensions]) - Default implementation for __autoload() */ -PHP_FUNCTION(spl_autoload) -{ - char *class_name, *lc_name, *file_exts; - int class_name_len, file_exts_len, found = 0; - char *copy, *pos1, *pos2; - zval **original_return_value = EG(return_value_ptr_ptr); - zend_op **original_opline_ptr = EG(opline_ptr); - zend_op_array *original_active_op_array = EG(active_op_array); - zend_function_state *original_function_state_ptr = EG(function_state_ptr); - zval err_mode; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &class_name, &class_name_len, &file_exts, &file_exts_len) == FAILURE) { - RETURN_FALSE; - } - - ZVAL_LONG(&err_mode, EG(error_reporting)); - php_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - - copy = pos1 = estrdup(ZEND_NUM_ARGS() > 1 ? file_exts : SPL_G(autoload_extensions)); - lc_name = zend_str_tolower_dup(class_name, class_name_len); - while(pos1 && *pos1 && !EG(exception)) { - EG(return_value_ptr_ptr) = original_return_value; - EG(opline_ptr) = original_opline_ptr; - EG(active_op_array) = original_active_op_array; - EG(function_state_ptr) = original_function_state_ptr; - pos2 = strchr(pos1, ','); - if (pos2) *pos2 = '\0'; - if (spl_autoload(class_name, lc_name, class_name_len, pos1 TSRMLS_CC)) { - found = 1; - break; /* loaded */ - } - pos1 = pos2 ? pos2 + 1 : NULL; - } - efree(lc_name); - if (copy) { - efree(copy); - } - - if (!EG(error_reporting) && Z_LVAL(err_mode) != EG(error_reporting)) { - convert_to_string(&err_mode); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(err_mode), Z_STRLEN(err_mode), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(err_mode); - } - - EG(return_value_ptr_ptr) = original_return_value; - EG(opline_ptr) = original_opline_ptr; - EG(active_op_array) = original_active_op_array; - EG(function_state_ptr) = original_function_state_ptr; - - if (!found) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Class %s could not be loaded", class_name); - } -} /* }}} */ - -/* {{{ void string spl_autoload_extensions([string file_extensions]) - Register and return default file extensions for spl_autoload */ -PHP_FUNCTION(spl_autoload_extensions) -{ - char *file_exts; - int file_exts_len; - - if (ZEND_NUM_ARGS() > 0) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file_exts, &file_exts_len) == FAILURE) { - return; - } - - if (SPL_G(autoload_extensions)) { - efree(SPL_G(autoload_extensions)); - } - SPL_G(autoload_extensions) = estrdup(file_exts); - } - - RETURN_STRING(SPL_G(autoload_extensions), 1); -} /* }}} */ - -typedef struct { - zend_function *func_ptr; - zval *obj; - zend_class_entry *ce; -} autoload_func_info; - -static void autoload_func_info_dtor(autoload_func_info *alfi) -{ - if (alfi->obj) { - zval_ptr_dtor(&alfi->obj); - } -} - -/* {{{ void spl_autoload_call(string class_name) - Try all registerd autoload function to load the requested class */ -PHP_FUNCTION(spl_autoload_call) -{ - zval **class_name, *retval = NULL; - char *func_name, *lc_name; - int func_name_len; - long dummy; - HashPosition function_pos; - autoload_func_info *alfi; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name) == FAILURE || - Z_TYPE_PP(class_name) != (UG(unicode)?IS_UNICODE:IS_STRING)) { - return; - } - - if (SPL_G(autoload_functions)) { - lc_name = zend_u_str_tolower_dup(Z_TYPE_PP(class_name), Z_UNIVAL_PP(class_name), Z_UNILEN_PP(class_name)); - zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos); - while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS && !EG(exception)) { - zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos); - zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &alfi, &function_pos); - zend_call_method(alfi->obj ? &alfi->obj : NULL, alfi->ce, &alfi->func_ptr, func_name, func_name_len, &retval, 1, *class_name, NULL TSRMLS_CC); - if (retval) { - zval_ptr_dtor(&retval); - } - if (zend_u_hash_exists(EG(class_table), Z_TYPE_PP(class_name), lc_name, Z_UNILEN_PP(class_name)+1)) { - break; - } - zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos); - } - efree(lc_name); - } else { - /* do not use or overwrite &EG(autoload_func) here */ - zend_call_method_with_1_params(NULL, NULL, NULL, "spl_autoload", NULL, *class_name); - } -} /* }}} */ - -/* {{{ void spl_autoload_register([string autoload_function = "spl_autoload" [, throw = true]]) - Register given function as __autoload() implementation */ -PHP_FUNCTION(spl_autoload_register) -{ - zval zfunc_name; - char *func_name; - uint func_name_len; - char *lc_name = NULL; - zval *zcallable = NULL; - zend_bool do_throw = 1; - zend_function *spl_func_ptr; - autoload_func_info alfi; - zval **obj_ptr; - zend_uchar func_name_type; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|tb", &func_name, &func_name_len, &func_name_type, &do_throw) == FAILURE) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &zcallable, &do_throw) == FAILURE) { - return; - } - if (!zend_is_callable_ex(zcallable, 0, &zfunc_name, &alfi.ce, &alfi.func_ptr, &obj_ptr TSRMLS_CC)) { - if (do_throw) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Passed array does not specify a callable static method"); - } - zval_dtor(&zfunc_name); - return; - } else if (!obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) { - if (do_throw) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Passed array specifies a non static method but no object"); - } - zval_dtor(&zfunc_name); - return; - } - func_name_type = Z_TYPE(zfunc_name); - func_name_len = Z_UNILEN(zfunc_name); - lc_name = zend_u_str_tolower_dup(func_name_type, Z_UNIVAL(zfunc_name), func_name_len); - zval_dtor(&zfunc_name); - if (obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) { - alfi.obj = *obj_ptr; - alfi.obj->refcount++; - } else { - alfi.obj = NULL; - } - } else if (ZEND_NUM_ARGS()) { - lc_name = zend_u_str_tolower_dup(func_name_type, func_name, func_name_len); - - if ((func_name_len == sizeof("spl_autoload_call")-1) && - (ZEND_U_EQUAL(func_name_type, lc_name, func_name_len, "spl_autoload_call", sizeof("spl_autoload_call")-1))) { - if (do_throw) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered"); - } - efree(lc_name); - return; - } - - if (zend_u_hash_find(EG(function_table), func_name_type, lc_name, func_name_len+1, (void **) &alfi.func_ptr) == FAILURE) { - if (do_throw) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Function '%R' not found", func_name_type, func_name); - } - efree(lc_name); - return; - } - alfi.obj = NULL; - alfi.ce = NULL; - } - - if (ZEND_NUM_ARGS()) { - if (!SPL_G(autoload_functions)) { - ALLOC_HASHTABLE(SPL_G(autoload_functions)); - zend_u_hash_init(SPL_G(autoload_functions), 1, NULL, (dtor_func_t) autoload_func_info_dtor, 0, UG(unicode)); - } - - zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &spl_func_ptr); - - if (EG(autoload_func) == spl_func_ptr) { /* registered already, so we insert that first */ - autoload_func_info spl_alfi = {spl_func_ptr, NULL, NULL}; - zend_hash_add(SPL_G(autoload_functions), "spl_autoload", sizeof("spl_autoload"), &spl_alfi, sizeof(autoload_func_info), NULL); - } - - zend_u_hash_add(SPL_G(autoload_functions), func_name_type, lc_name, func_name_len+1, &alfi, sizeof(autoload_func_info), NULL); - - efree(lc_name); - } - - if (SPL_G(autoload_functions)) { - zend_hash_find(EG(function_table), "spl_autoload_call", sizeof("spl_autoload_call"), (void **) &EG(autoload_func)); - } else { - zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &EG(autoload_func)); - } -} /* }}} */ - -/* {{{ bool spl_autoload_unregister(string autoload_function) - Unregister given function as __autoload() implementation */ -PHP_FUNCTION(spl_autoload_unregister) -{ - char *func_name, *lc_name; - int func_name_len, success = FAILURE; - zend_function *spl_func_ptr; - zend_uchar func_name_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &func_name, &func_name_len, &func_name_type) == FAILURE) { - return; - } - - lc_name = zend_u_str_tolower_dup(func_name_type, func_name, func_name_len); - - if (SPL_G(autoload_functions)) { - if ((func_name_len == sizeof("spl_autoload_call")-1) && - (ZEND_U_EQUAL(func_name_type, lc_name, func_name_len, "spl_autoload_call", sizeof("spl_autoload_call")-1))) { - /* remove all */ - zend_hash_destroy(SPL_G(autoload_functions)); - FREE_HASHTABLE(SPL_G(autoload_functions)); - SPL_G(autoload_functions) = NULL; - EG(autoload_func) = NULL; - success = SUCCESS; - } else { - /* remove specific */ - success = zend_u_hash_del(SPL_G(autoload_functions), func_name_type, lc_name, func_name_len+1); - } - } else if ((func_name_len == sizeof("spl_autoload")-1) && - (ZEND_U_EQUAL(func_name_type, lc_name, func_name_len, "spl_autoload", sizeof("spl_autoload")-1))) { - /* register single spl_autoload() */ - zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &spl_func_ptr); - - if (EG(autoload_func) == spl_func_ptr) { - success = SUCCESS; - EG(autoload_func) = NULL; - } - } - - efree(lc_name); - - RETURN_BOOL(success == SUCCESS); -} /* }}} */ - -/* {{{ false|array spl_autoload_functions() - Return all registered __autoload() functionns */ -PHP_FUNCTION(spl_autoload_functions) -{ - zend_function *fptr, **func_ptr_ptr; - HashPosition function_pos; - - if (!EG(autoload_func)) { - if (zend_hash_find(EG(function_table), ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME), (void **) &fptr) == SUCCESS) { - array_init(return_value); - add_next_index_stringl(return_value, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 1); - return; - } - RETURN_FALSE; - } - - zend_hash_find(EG(function_table), "spl_autoload_call", sizeof("spl_autoload_call"), (void **) &fptr); - - if (EG(autoload_func) == fptr) { - array_init(return_value); - zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos); - while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS) { - zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &func_ptr_ptr, &function_pos); - if ((*func_ptr_ptr)->common.scope) { - zval *tmp; - MAKE_STD_ZVAL(tmp); - array_init(tmp); - - add_next_index_text(tmp, (*func_ptr_ptr)->common.scope->name, 1); - add_next_index_text(tmp, (*func_ptr_ptr)->common.function_name, 1); - add_next_index_zval(return_value, tmp); - } else - add_next_index_text(return_value, (*func_ptr_ptr)->common.function_name, 1); - - zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos); - } - return; - } - - array_init(return_value); - add_next_index_text(return_value, EG(autoload_func)->common.function_name, 1); -} /* }}} */ - -int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC) /* {{{ */ -{ - char *res; - - spprintf(&res, 0, "%s, %s", *list, Z_STRVAL_PP(entry)); - efree(*list); - *list = res; - return ZEND_HASH_APPLY_KEEP; -} /* }}} */ - -/* {{{ PHP_MINFO(spl) - */ -PHP_MINFO_FUNCTION(spl) -{ - zval list; - char *strg; - - php_info_print_table_start(); - php_info_print_table_header(2, "SPL support", "enabled"); - - INIT_PZVAL(&list); - array_init(&list); - SPL_LIST_CLASSES(&list, 0, 1, ZEND_ACC_INTERFACE) - strg = estrdup(""); - zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC); - zval_dtor(&list); - php_info_print_table_row(2, "Interfaces", strg + 2); - efree(strg); - - INIT_PZVAL(&list); - array_init(&list); - SPL_LIST_CLASSES(&list, 0, -1, ZEND_ACC_INTERFACE) - strg = estrdup(""); - zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC); - zval_dtor(&list); - php_info_print_table_row(2, "Classes", strg + 2); - efree(strg); - - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ spl_functions - */ -function_entry spl_functions[] = { - PHP_FE(spl_classes, NULL) - PHP_FE(spl_autoload, NULL) - PHP_FE(spl_autoload_extensions, NULL) - PHP_FE(spl_autoload_register, NULL) - PHP_FE(spl_autoload_unregister, NULL) - PHP_FE(spl_autoload_functions, NULL) - PHP_FE(spl_autoload_call, NULL) - PHP_FE(class_parents, NULL) - PHP_FE(class_implements, NULL) -#ifdef SPL_ITERATORS_H - PHP_FE(iterator_to_array, NULL) - PHP_FE(iterator_count, NULL) -#endif /* SPL_ITERATORS_H */ - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(spl) - */ -PHP_MINIT_FUNCTION(spl) -{ - ZEND_INIT_MODULE_GLOBALS(spl, spl_init_globals, NULL); - - PHP_MINIT(spl_iterators)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(spl_array)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(spl_directory)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(spl_exceptions)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(spl_observer)(INIT_FUNC_ARGS_PASSTHRU); - - return SUCCESS; -} -/* }}} */ - -PHP_RINIT_FUNCTION(spl) /* {{{ */ -{ - SPL_G(autoload_extensions) = estrndup(".inc,.php", sizeof(".inc,.php")-1); - SPL_G(autoload_functions) = NULL; - return SUCCESS; -} /* }}} */ - -PHP_RSHUTDOWN_FUNCTION(spl) /* {{{ */ -{ - if (SPL_G(autoload_extensions)) { - efree(SPL_G(autoload_extensions)); - SPL_G(autoload_extensions) = NULL; - } - if (SPL_G(autoload_functions)) { - zend_hash_destroy(SPL_G(autoload_functions)); - FREE_HASHTABLE(SPL_G(autoload_functions)); - SPL_G(autoload_functions) = NULL; - } - return SUCCESS; -} /* }}} */ - -#ifdef HAVE_SIMPLEXML -static zend_module_dep spl_deps[] = { - ZEND_MOD_REQUIRED("libxml") - ZEND_MOD_REQUIRED("simplexml") - {NULL, NULL, NULL} -}; -#endif - -/* {{{ spl_module_entry - */ -zend_module_entry spl_module_entry = { -#ifdef HAVE_SIMPLEXML - STANDARD_MODULE_HEADER_EX, NULL, - spl_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "SPL", - spl_functions, - PHP_MINIT(spl), - NULL, - PHP_RINIT(spl), - PHP_RSHUTDOWN(spl), - PHP_MINFO(spl), - "0.2", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h deleted file mode 100755 index e70931e470460..0000000000000 --- a/ext/spl/php_spl.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_SPL_H -#define PHP_SPL_H - -#include "php.h" -#include - -#if 0 -#define SPL_DEBUG(x) x -#else -#define SPL_DEBUG(x) -#endif - -extern zend_module_entry spl_module_entry; -#define phpext_spl_ptr &spl_module_entry - -#ifdef PHP_WIN32 -# ifdef SPL_EXPORTS -# define SPL_API __declspec(dllexport) -# elif defined(COMPILE_DL_SPL) -# define SPL_API __declspec(dllimport) -# else -# define SPL_API /* nothing */ -# endif -#else -# define SPL_API -#endif - -#if defined(PHP_WIN32) && !defined(COMPILE_DL_SPL) -#undef phpext_spl -#define phpext_spl NULL -#endif - -PHP_MINIT_FUNCTION(spl); -PHP_MSHUTDOWN_FUNCTION(spl); -PHP_RINIT_FUNCTION(spl); -PHP_RSHUTDOWN_FUNCTION(spl); -PHP_MINFO_FUNCTION(spl); - - -ZEND_BEGIN_MODULE_GLOBALS(spl) - char * autoload_extensions; - HashTable * autoload_functions; -ZEND_END_MODULE_GLOBALS(spl) - -#ifdef ZTS -# define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v) -extern int spl_globals_id; -#else -# define SPL_G(v) (spl_globals.v) -extern zend_spl_globals spl_globals; -#endif - -PHP_FUNCTION(spl_classes); -PHP_FUNCTION(class_parents); -PHP_FUNCTION(class_implements); - -#endif /* PHP_SPL_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl.php b/ext/spl/spl.php deleted file mode 100755 index 4841174224549..0000000000000 --- a/ext/spl/spl.php +++ /dev/null @@ -1,985 +0,0 @@ -Introducing PHP 5's Standard Library - * - Iterators in PHP5 - * - Advanced OOP with SPL in PHP 5 - * - The Standard PHP Library, Part 1 - * - The Standard PHP Library, Part 2 - * - SPL on PHP Wiki - * - Die Standard PHP Library (SPL) [german] - * - * Talks on SPL: - * - SPL for the masses [pps], [pdf] - * - From engine overloading to SPL [pps], [pdf] - * - Happy SPLing [pps], [pdf] - * - Debug session 1 [pps], [pdf] - * - Debug session 2 [pps], [pdf] - * - * You can download this documentation as a chm file - * here. - * - * (c) Marcus Boerger, 2003 - 2005 - */ - -/** @defgroup ZendEngine Zend engine classes - * - * The classes and interfaces in this group are contained in the c-code of - * PHP's Zend engine. - */ - -/** @defgroup SPL Internal classes - * - * The classes and interfaces in this group are contained in the c-code of - * ext/SPL. - */ - -/** @defgroup Examples Example classes - * - * The classes and interfaces in this group are contained as PHP code in the - * examples subdirectory of ext/SPL. Sooner or later they will be moved to - * c-code. - */ - -/** @ingroup ZendEngine - * @brief Basic Exception class. - * @since PHP 5.0 - */ -class Exception -{ - /** The exception message */ - protected $message; - - /** The string represenations as generated during construction */ - private $string; - - /** The code passed to the constructor */ - protected $code; - - /** The file name where the exception was instantiated */ - protected $file; - - /** The line number where the exception was instantiated */ - protected $line; - - /** The stack trace */ - private $trace; - - /** Prevent clone - */ - final private function __clone() {} - - /** Construct an exception - * - * @param $message Some text describing the exception - * @param $code Some code describing the exception - */ - function __construct($message = NULL, $code = 0) { - if (func_num_args()) { - $this->message = $message; - } - $this->code = $code; - $this->file = __FILE__; // of throw clause - $this->line = __LINE__; // of throw clause - $this->trace = debug_backtrace(); - $this->string = StringFormat($this); - } - - /** @return the message passed to the constructor - */ - final public function getMessage() - { - return $this->message; - } - - /** @return the code passed to the constructor - */ - final public function getCode() - { - return $this->code; - } - - /** @return the name of the file where the exception was thrown - */ - final public function getFile() - { - return $this->file; - } - - /** @return the line number where the exception was thrown - */ - final public function getLine() - { - return $this->line; - } - - /** @return the stack trace as array - */ - final public function getTrace() - { - return $this->trace; - } - - /** @return the stack trace as string - */ - final public function getTraceAsString() - { - } - - /** @return string represenation of exception - */ - public function __toString() - { - return $this->string; - } -} - -/** @ingroup SPL - * @brief Exception that represents error in the program logic. - * @since PHP 5.1 - * - * This kind of exceptions should directly leed to a fix in your code. - */ -class LogicException extends Exception -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a function call was illegal. - * @since PHP 5.1 - */ -class BadFunctionCallException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a method call was illegal. - * @since PHP 5.1 - */ -class BadMethodCallException extends BadFunctionCallException -{ -} - -/** @ingroup SPL - * @brief Exception that denotes a value not in the valid domain was used. - * @since PHP 5.1 - * - * This kind of exception should be used to inform about domain erors in - * mathematical sense. - * - * @see RangeException - */ -class DomainException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception that denotes invalid arguments were passed. - * @since PHP 5.1 - * - * @see UnexpectedValueException - */ -class InvalidArgumentException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when a parameter exceeds the allowed length. - * @since PHP 5.1 - * - * This can be used for strings length, array size, file size, number of - * elements read from an Iterator and so on. - */ -class LengthException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown when an illegal index was requested. - * @since PHP 5.1 - * - * This represents errors that should be detected at compile time. - * - * @see OutOfBoundsException - */ -class OutOfRangeException extends LogicException -{ -} - -/** @ingroup SPL - * @brief Exception thrown for errors that are only detectable at runtime. - * @since PHP 5.1 - */ -class RuntimeException extends Exception -{ -} - -/** @ingroup SPL - * @brief Exception thrown when an illegal index was requested. - * @since PHP 5.1 - * - * This represents errors that cannot be detected at compile time. - * - * @see OutOfRangeException - */ -class OutOfBoundsException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate arithmetic/buffer overflow. - * @since PHP 5.1 - */ -class OverflowException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate range errors during program execution. - * @since PHP 5.1 - * - * Normally this means there was an arithmetic error other than under/overflow. - * This is the runtime version of DomainException. - * - * @see DomainException - */ -class RangeException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate arithmetic/buffer underflow. - * @since PHP 5.1 - */ -class UnderflowException extends RuntimeException -{ -} - -/** @ingroup SPL - * @brief Exception thrown to indicate an unexpected value. - * @since PHP 5.1 - * - * Typically this happens when a function calls another function and espects - * the return value to be of a certain type or value not including arithmetic - * or buffer related errors. - * - * @see InvalidArgumentException - */ -class UnexpectedValueException extends RuntimeException -{ -} - -/** @ingroup ZendEngine - * @brief Interface to override array access of objects. - * @since PHP 5.0 - */ -interface ArrayAccess -{ - /** @param $offset to modify - * @param $value new value - */ - function offsetSet($offset, $value); - - /** @param $offset to retrieve - * @return value at given offset - */ - function offsetGet($offset); - - /** @param $offset to delete - */ - function offsetUnset($offset); - - /** @param $offset to check - * @return whether the offset exists. - */ - function offsetExists($offset); -} - -/** @ingroup ZendEngine - * @brief Interface to detect a class is traversable using foreach. - * @since PHP 5.0 - * - * Abstract base interface that cannot be implemented alone. Instead it - * must be implemented by either IteratorAggregate or Iterator. - * - * @note Internal classes that implement this interface can be used in a - * foreach construct and do not need to implement IteratorAggregate or - * Iterator. - * - * @note This is an engine internal interface which cannot be implemented - * in PHP scripts. Either IteratorAggregate or Iterator must be used - * instead. - */ -interface Traversable -{ -} - -/** @ingroup ZendEngine - * @brief Interface to create an external Iterator. - * @since PHP 5.0 - * - * @note This is an engine internal interface. - */ -interface IteratorAggregate extends Traversable -{ - /** @return an Iterator for the implementing object. - */ - function getIterator(); -} - -/** @ingroup ZendEngine - * @brief Basic iterator - * @since PHP 5.0 - * - * Interface for external iterators or objects that can be iterated - * themselves internally. - * - * @note This is an engine internal interface. - */ -interface Iterator extends Traversable -{ - /** Rewind the Iterator to the first element. - */ - function rewind(); - - /** Return the current element. - */ - function current(); - - /** Return the key of the current element. - */ - function key(); - - /** Move forward to next element. - */ - function next(); - - /** Check if there is a current element after calls to rewind() or next(). - */ - function valid(); -} - -/** @ingroup SPL - * @brief This Interface allows to hook into the global count() function. - * @since PHP 5.1 - */ -interface Countable -{ - /** @return the number the global function count() should show - */ - function count(); -} - -/** @ingroup ZendEngine - * @brief Interface for customized serializing - * @since 5.1 - * - * Classes that implement this interface no longer support __sleep() and - * __wakeup(). The method serialized is called whenever an instance needs to - * be serialized. This does not invoke __destruct() or has any other side - * effect unless programmed inside the method. When the data is unserialized - * the class is known and the appropriate unserialize() method is called as a - * constructor instead of calling __construct(). If you need to execute the - * standard constructor you may do so in the method. - */ -interface Serializable -{ - /** - * @return string representation of the instance - */ - function serialize(); - - /** - * @note This is a constructor - * - * @param $serialized data read from stream to construct the instance - */ - function unserialize($serialized); -} - -/** @ingroup SPL - * @brief An Array wrapper - * @since PHP 5.0 - * @version 1.2 - * - * This array wrapper allows to recursively iterate over Arrays and public - * Object properties. - * - * @see ArrayIterator - */ -class ArrayObject implements IteratorAggregate, ArrayAccess, Countable -{ - /** Properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) */ - const STD_PROP_LIST = 0x00000001; - /** Array indices can be accessed as properties in read/write */ - const ARRAY_AS_PROPS = 0x00000002; - - /** Construct a new array iterator from anything that has a hash table. - * That is any Array or Object. - * - * @param $array the array to use. - * @param $flags see setFlags(). - * @param $iterator_class class used in getIterator() - */ - function __construct($array, $flags = 0, $iterator_class = "ArrayIterator"); - - /** Set behavior flags. - * - * @param $flags bitmask as follows: - * 0 set: properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) - * 1 set: array indices can be accessed as properties in read/write - */ - function setFlags($flags); - - /** - * @ return current flags - */ - function getFlags(); - - /** Sort the entries by values. - */ - function asort(); - - /** Sort the entries by key. - */ - function ksort(); - - /** Sort the entries by values using user defined function. - */ - function uasort(mixed cmp_function); - - /** Sort the entries by key using user defined function. - */ - function uksort(mixed cmp_function); - - /** Sort the entries by values using "natural order" algorithm. - */ - function natsort(); - - /** Sort the entries by values using case insensitive "natural order" algorithm. - */ - function natcasesort(); - - /** - * @param $array new array or object - */ - function exchangeArray($array); - - /** @return the iterator which is an ArrayIterator object connected to - * this object. - */ - function getIterator(); - - /** @param $index offset to inspect - * @return whetehr offset $index esists - */ - function offsetExists($index); - - /** @param $index offset to return value for - * @return value at offset $index - */ - function offsetGet($index); - - /** @param $index index to set - * @param $newval new value to store at offset $index - */ - function offsetSet($index, $newval); - - /** @param $index offset to unset - */ - function offsetUnset($index); - - /** @param $value is appended as last element - * @warning this method cannot be called when the ArrayObject refers to - * an object. - */ - function append($value); - - /** @return a \b copy of the array - * @note when the ArrayObject refers to an object then this method - * returns an array of the public properties. - */ - function getArrayCopy(); - - /** @return the number of elements in the array or the number of public - * properties in the object. - */ - function count(); - - /* @param $iterator_class new class used in getIterator() - */ - function setIteratorClass($itertor_class); - - /* @return class used in getIterator() - */ - function getIteratorClass(); -} - -/** @ingroup SPL - * @brief An Array iterator - * @since PHP 5.0 - * @version 1.2 - * - * This iterator allows to unset and modify values and keys while iterating - * over Arrays and Objects. - * - * When you want to iterate over the same array multiple times you need to - * instanciate ArrayObject and let it create ArrayIterator instances that - * refer to it either by using foreach or by calling its getIterator() - * method manually. - */ -class ArrayIterator implements SeekableIterator, ArrayAccess, Countable -{ - /** Properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) */ - const STD_PROP_LIST = 0x00000001; - /** Array indices can be accessed as properties in read/write */ - const ARRAY_AS_PROPS = 0x00000002; - - /** Construct a new array iterator from anything that has a hash table. - * That is any Array or Object. - * - * @param $array the array to use. - * @param $flags see setFlags(). - */ - function __construct($array, $flags = 0); - - /** Set behavior flags. - * - * @param $flags bitmask as follows: - * 0 set: properties of the object have their normal functionality - * when accessed as list (var_dump, foreach, etc.) - * 1 set: array indices can be accessed as properties in read/write - */ - function setFlags($flags); - - /** - * @ return current flags - */ - function getFlags(); - - /** Sort the entries by values. - */ - function asort(); - - /** Sort the entries by key. - */ - function ksort(); - - /** Sort the entries by values using user defined function. - */ - function uasort(mixed cmp_function); - - /** Sort the entries by key using user defined function. - */ - function uksort(mixed cmp_function); - - /** Sort the entries by values using "natural order" algorithm. - */ - function natsort(); - - /** Sort the entries by values using case insensitive "natural order" algorithm. - */ - function natcasesort(); - - /** @param $index offset to inspect - * @return whetehr offset $index esists - */ - function offsetExists($index); - - /** @param $index offset to return value for - * @return value at offset $index - */ - function offsetGet($index); - - /** @param $index index to set - * @param $newval new value to store at offset $index - */ - function offsetSet($index, $newval); - - /** @param $index offset to unset - */ - function offsetUnset($index); - - /** @param $value is appended as last element - * @warning this method cannot be called when the ArrayIterator refers to - * an object. - */ - function append($value); - - /** @return a \b copy of the array - * @note when the ArrayIterator refers to an object then this method - * returns an array of the public properties. - */ - function getArrayCopy(); - - /** @param $position offset to seek to - * @throw OutOfBoundsException if $position is invalid - */ - function seek($position); - - /** @return the number of elements in the array or the number of public - * properties in the object. - */ - function count(); -} - -/** @ingroup SPL - * @brief File info class - * @since PHP 6.0 - */ -class SplFileInfo -{ - /** Construct a file info object - * - * @param $file_name path or file name - */ - function __construct($file_name); - - /** @return the path part only. - */ - function getPath(); - - /** @return the filename only. - */ - function getFilename(); - - /** @return SplFileInfo created for the file - */ - function getFileInfo(); - - /** @return The current entries path and file name. - */ - function getPathname(); - - /** @return SplFileInfo created for the path - */ - function getPathInfo(); - - /** @return The current entry's permissions. - */ - function getPerms(); - - /** @return The current entry's inode. - */ - function getInode(); - - /** @return The current entry's size in bytes . - */ - function getSize(); - - /** @return The current entry's owner name. - */ - function getOwner(); - - /** @return The current entry's group name. - */ - function getGroup(); - - /** @return The current entry's last access time. - */ - function getATime(); - - /** @return The current entry's last modification time. - */ - function getMTime(); - - /** @return The current entry's last change time. - */ - function getCTime(); - - /** @return The current entry's size in bytes . - */ - function getType(); - - /** @return Whether the current entry is writeable. - */ - function isWritable(); - - /** @return Whether the current entry is readable. - */ - function isReadable(); - - /** @return Whether the current entry is executable. - */ - function isExecutable(); - - /** @return Whether the current entry is . - */ - function isFile(); - - /** @return Whether the current entry is a directory. - */ - function isDir(); - - /** @return whether the current entry is a link. - */ - function isLink(); - - /** @return getPathname() - */ - function __toString(); - - /** Open the current file as a SplFileObject instance - * - * @param mode open mode - * @param use_include_path whether to search include paths (don't use) - * @param context resource context to pased to open function - * @throw RuntimeException if file cannot be opened (e.g. insufficient - * access rights). - * @return The opened file as a SplFileObject instance - * - * @see SplFileObject - * @see file() - */ - function openFile($mode = 'r', $use_include_path = false, $context = NULL); -} - -/** @ingroup SPL - * @brief Directory iterator - * @version 1.1 - * @since PHP 5.0 - */ -class DirectoryIterator extends SplFileInfo implements Iterator -{ - /** Construct a directory iterator from a path-string. - * - * @param $path directory to iterate. - */ - function __construct($path); - - /** @return index of entry - */ - function key(); - - /** @return $this - */ - function current(); - - /** @return Whether the current entry is either '.' or '..'. - */ - function isDot(); - - /** @return whether the current entry is a link. - */ - function isLink(); - - /** @return getFilename() - */ - function __toString(); -} - -/** @ingroup SPL - * @brief recursive directory iterator - * @version 1.1 - * @since PHP 5.0 - */ -class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveIterator -{ - const CURRENT_AS_FILEINFO 0x00000010; /* make RecursiveDirectoryTree::current() return SplFileInfo */ - const KEY_AS_FILENAME 0x00000020; /* make RecursiveDirectoryTree::key() return getFilename() */ - const NEW_CURRENT_AND_KEY 0x00000030; /* CURRENT_AS_FILEINFO + KEY_AS_FILENAME */ - - /** Construct a directory iterator from a path-string. - * - * @param $path directory to iterate. - */ - function __construct($path, $flags = 0); - - /** @return getPathname() or getFilename() depending on flags - */ - function key(); - - /** @return getFilename() or getFileInfo() depending on flags - */ - function current(); - - /** @return whether the current is a directory (not '.' or '..'). - */ - function hasChildren(); - - /** @return a RecursiveDirectoryIterator for the current entry. - */ - function getChildren(); - - /** @return sub path only (without main path) - */ - function getSubPath(); - - /** @return the current sub path - */ - function getSubPathname(); - - /** @return SplFileInfo created for the current sub path - */ - function getSubPathInfo(); - -} - -/** @ingroup SPL - * @brief recursive SimpleXML_Element iterator - * @since PHP 5.0 - * - * The SimpleXMLIterator implements the RecursiveIterator interface. This - * allows iteration over all elements using foreach or an appropriate while - * construct, just like SimpleXMLElement does. When using the foreach construct, - * you will also iterate over the subelements. For every element which - * has subelements, hasChildren() returns true. This will trigger a call to - * getChildren() which returns the iterator for that sub element. - */ -class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator -{ - /** @return whether the current node has sub nodes. - */ - function hasChildren(); - - /** @return a SimpleXMLIterator for the current node. - */ - function getChildren(); -} - -/** @ingroup SPL - * @brief Observer of the observer pattern - * @since PHP 5.1 - * - * For a detailed explanation see Observer pattern in - * - * Gamma, Helm, Johnson, Vlissides
- * Design Patterns - *
- */ -interface SplObserver -{ - /** Called from the subject (i.e. when it's value has changed). - * @param $subject the callee - */ - function update(SplSubject $subject); -} - -/** @ingroup SPL - * @brief Subject to the observer pattern - * @since PHP 5.1 - * @see Observer - */ -interface SplSubject -{ - /** @param $observer new observer to attach - */ - function attach(SplObserver $observer); - - /** @param $observer existing observer to detach - * @note a non attached observer shouldn't result in a warning or similar - */ - function detach(SplObserver $observer); - - /** Notify all observers - */ - function notify(); -} - -?> diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c deleted file mode 100755 index dabbd3e2780ae..0000000000000 --- a/ext/spl/spl_array.c +++ /dev/null @@ -1,1446 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_iterators.h" -#include "spl_array.h" -#include "spl_exceptions.h" - -zend_object_handlers spl_handler_ArrayObject; -PHPAPI zend_class_entry *spl_ce_ArrayObject; - -zend_object_handlers spl_handler_ArrayIterator; -PHPAPI zend_class_entry *spl_ce_ArrayIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator; - -PHPAPI zend_class_entry *spl_ce_Countable; - -#define SPL_ARRAY_STD_PROP_LIST 0x00000001 -#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002 -#define SPL_ARRAY_IS_REF 0x01000000 -#define SPL_ARRAY_IS_SELF 0x02000000 -#define SPL_ARRAY_USE_OTHER 0x04000000 -#define SPL_ARRAY_INT_MASK 0xFF000000 -#define SPL_ARRAY_CLONE_MASK 0x03000007 - -typedef struct _spl_array_object { - zend_object std; - zval *array; - zval *retval; - HashPosition pos; - int ar_flags; - int is_self; - zend_function * fptr_offset_get; - zend_function * fptr_offset_set; - zend_function * fptr_offset_has; - zend_function * fptr_offset_del; - zend_class_entry* ce_get_iterator; -} spl_array_object; - -static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) { - if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0)) { - spl_array_object *other = (spl_array_object*)zend_object_store_get_object(intern->array TSRMLS_CC); - return spl_array_get_hash_table(other, check_std_props TSRMLS_CC); - } else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) { - return intern->std.properties; - } else { - return HASH_OF(intern->array); - } -} - -SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */ -{ - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - Bucket *p; - -/* IS_CONSISTENT(ht);*/ - -/* HASH_PROTECT_RECURSION(ht);*/ - p = ht->pListHead; - while (p != NULL) { - if (p == intern->pos) { - return SUCCESS; - } - p = p->pListNext; - } -/* HASH_UNPROTECT_RECURSION(ht); */ - zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos); - return FAILURE; -} -/* }}} */ - -/* {{{ spl_array_object_free_storage */ -static void spl_array_object_free_storage(void *object TSRMLS_DC) -{ - spl_array_object *intern = (spl_array_object *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - zval_ptr_dtor(&intern->array); - zval_ptr_dtor(&intern->retval); - - efree(object); -} -/* }}} */ - -/* {{{ spl_array_object_new */ -static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig TSRMLS_DC) -{ - zend_object_value retval; - spl_array_object *intern; - zval *tmp; - zend_class_entry * parent = class_type; - int inherited = 0; - - intern = emalloc(sizeof(spl_array_object)); - memset(intern, 0, sizeof(spl_array_object)); - intern->std.ce = class_type; - *obj = intern; - ALLOC_INIT_ZVAL(intern->retval); - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - intern->ar_flags = 0; - if (orig) { - spl_array_object *other = (spl_array_object*)zend_object_store_get_object(orig TSRMLS_CC); - - intern->array = orig; - ZVAL_ADDREF(intern->array); - intern->ar_flags &= ~ SPL_ARRAY_CLONE_MASK; - intern->ar_flags |= (other->ar_flags & SPL_ARRAY_CLONE_MASK) | SPL_ARRAY_IS_REF | SPL_ARRAY_USE_OTHER; - } else { - MAKE_STD_ZVAL(intern->array); - array_init(intern->array); - intern->ar_flags &= ~SPL_ARRAY_IS_REF; - } - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_array_object_free_storage, NULL TSRMLS_CC); - while (parent) { - if (parent == U_CLASS_ENTRY(spl_ce_ArrayIterator)) { - retval.handlers = &spl_handler_ArrayIterator; - break; - } else if (parent == U_CLASS_ENTRY(spl_ce_ArrayObject)) { - retval.handlers = &spl_handler_ArrayObject; - break; - } - parent = parent->parent; - inherited = 1; - } - if (!parent) { /* this must never happen */ - php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or arrayIterator"); - } - if (inherited) { - zend_hash_find(&class_type->function_table, "offsetget", sizeof("offsetget"), (void **) &intern->fptr_offset_get); - if (intern->fptr_offset_get->common.scope == parent) { - intern->fptr_offset_get = NULL; - } - zend_hash_find(&class_type->function_table, "offsetset", sizeof("offsetset"), (void **) &intern->fptr_offset_set); - if (intern->fptr_offset_set->common.scope == parent) { - intern->fptr_offset_set = NULL; - } - zend_hash_find(&class_type->function_table, "offsetexists", sizeof("offsetexists"), (void **) &intern->fptr_offset_has); - if (intern->fptr_offset_has->common.scope == parent) { - intern->fptr_offset_has = NULL; - } - zend_hash_find(&class_type->function_table, "offsetunset", sizeof("offsetunset"), (void **) &intern->fptr_offset_del); - if (intern->fptr_offset_del->common.scope == parent) { - intern->fptr_offset_del = NULL; - } - } - intern->ce_get_iterator = U_CLASS_ENTRY(spl_ce_ArrayIterator); - zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos); - return retval; -} -/* }}} */ - -/* {{{ spl_array_object_new */ -static zend_object_value spl_array_object_new(zend_class_entry *class_type TSRMLS_DC) -{ - spl_array_object *tmp; - return spl_array_object_new_ex(class_type, &tmp, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ spl_array_object_clone */ -static zend_object_value spl_array_object_clone(zval *zobject TSRMLS_DC) -{ - zend_object_value new_obj_val; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - spl_array_object *intern; - - old_object = zend_objects_get_address(zobject TSRMLS_CC); - new_obj_val = spl_array_object_new_ex(old_object->ce, &intern, zobject TSRMLS_CC); - new_object = &intern->std; - - zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC); - - return new_obj_val; -} -/* }}} */ - -static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - zval **retval; - long index; - -/* We cannot get the pointer pointer so we don't allow it here for now - if (check_inherited && intern->fptr_offset_get) { - return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset); - }*/ - - switch(Z_TYPE_P(offset)) { - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - if (zend_u_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void **) &retval) == FAILURE) { - zend_error(E_NOTICE, "Undefined index: %R", Z_TYPE_P(offset), Z_STRVAL_P(offset)); - return &EG(uninitialized_zval_ptr); - } else { - return retval; - } - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index, (void **) &retval) == FAILURE) { - zend_error(E_NOTICE, "Undefined offset: %ld", Z_LVAL_P(offset)); - return &EG(uninitialized_zval_ptr); - } else { - return retval; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - return &EG(uninitialized_zval_ptr); - } -} /* }}} */ - -static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ -{ - if (check_inherited) { - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - if (intern->fptr_offset_get) { - zval *rv; - zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset); - zval_ptr_dtor(&intern->retval); - MAKE_STD_ZVAL(intern->retval); - ZVAL_ZVAL(intern->retval, rv, 1, 1); - return intern->retval; - } - } - return *spl_array_get_dimension_ptr_ptr(check_inherited, object, offset, type TSRMLS_CC); -} /* }}} */ - -static zval *spl_array_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ -{ - return spl_array_read_dimension_ex(1, object, offset, type TSRMLS_CC); -} /* }}} */ - -static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - long index; - int free_offset; - - if (check_inherited && intern->fptr_offset_set) { - if (!offset) { - ALLOC_INIT_ZVAL(offset); - free_offset = 1; - } else { - free_offset = 0; - } - zend_call_method_with_2_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_set, "offsetSet", NULL, offset, value); - if (free_offset) { - zval_ptr_dtor(&offset); - } - return; - } - - if (!offset) { - value->refcount++; - zend_hash_next_index_insert(spl_array_get_hash_table(intern, 0 TSRMLS_CC), (void**)&value, sizeof(void*), NULL); - return; - } - switch(Z_TYPE_P(offset)) { - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - if (*(char*)Z_UNIVAL_P(offset) == '\0') { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "An offset must not begin with \\0 or be empty", 0 TSRMLS_CC); - return; - } - value->refcount++; - zend_u_symtable_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void**)&value, sizeof(void*), NULL); - return; - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - value->refcount++; - zend_hash_index_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index, (void**)&value, sizeof(void*), NULL); - return; - case IS_NULL: - value->refcount++; - zend_hash_next_index_insert(spl_array_get_hash_table(intern, 0 TSRMLS_CC), (void**)&value, sizeof(void*), NULL); - return; - default: - zend_error(E_WARNING, "Illegal offset type"); - return; - } -} /* }}} */ - -static void spl_array_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */ -{ - spl_array_write_dimension_ex(1, object, offset, value TSRMLS_CC); -} /* }}} */ - -static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - long index; - - if (check_inherited && intern->fptr_offset_del) { - zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_del, "offsetUnset", NULL, offset); - return; - } - - switch(Z_TYPE_P(offset)) { - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - if (spl_array_get_hash_table(intern, 0 TSRMLS_CC) == &EG(symbol_table)) { - if (zend_u_delete_global_variable(Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset) TSRMLS_CC)) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); - } - } else { - if (zend_u_symtable_del(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1) == FAILURE) { - zend_error(E_NOTICE,"Undefined index: %R", Z_TYPE_P(offset), Z_UNIVAL_P(offset)); - } - } - break; - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_del(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index) == FAILURE) { - zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset)); - } - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - return; - } - spl_hash_verify_pos(intern TSRMLS_CC); /* call rewind on FAILURE */ -} /* }}} */ - -static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */ -{ - spl_array_unset_dimension_ex(1, object, offset TSRMLS_CC); -} /* }}} */ - -static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - long index; - zval *rv; - - if (check_inherited && intern->fptr_offset_has) { - zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset); - if (zend_is_true(rv)) { - zval_ptr_dtor(&rv); - return 1; - } - zval_ptr_dtor(&rv); - return 0; - } - - switch(Z_TYPE_P(offset)) { - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - return zend_u_symtable_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1); - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - if (offset->type == IS_DOUBLE) { - index = (long)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - return zend_hash_index_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index); - default: - zend_error(E_WARNING, "Illegal offset type"); - } - return 0; -} /* }}} */ - -static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ -{ - return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC); -} /* }}} */ - -/* {{{ proto bool ArrayObject::offsetExists(mixed $index) - proto bool ArrayIterator::offsetExists(mixed $index) - Returns whether the requested $index exists. */ -SPL_METHOD(Array, offsetExists) -{ - zval *index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { - return; - } - RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 1 TSRMLS_CC)); -} /* }}} */ - -/* {{{ proto bool ArrayObject::offsetGet(mixed $index) - proto bool ArrayIterator::offsetGet(mixed $index) - Returns the value at the specified $index. */ -SPL_METHOD(Array, offsetGet) -{ - zval *index, *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { - return; - } - value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R TSRMLS_CC); - RETURN_ZVAL(value, 1, 0); -} /* }}} */ - -/* {{{ proto void ArrayObject::offsetSet(mixed $index, mixed $newval) - proto void ArrayIterator::offsetSet(mixed $index, mixed $newval) - Sets the value at the specified $index to $newval. */ -SPL_METHOD(Array, offsetSet) -{ - zval *index, *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) == FAILURE) { - return; - } - spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC); -} /* }}} */ - - -void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if (Z_TYPE_P(intern->array) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %v::offsetSet() instead", Z_OBJCE_P(object)->name); - return; - } - - spl_array_write_dimension(object, NULL, append_value TSRMLS_CC); - if (!intern->pos) { - intern->pos = aht->pListTail; - } -} /* }}} */ - -/* {{{ proto void ArrayObject::append(mixed $newval) - proto void ArrayIterator::append(mixed $newval) - Appends the value (cannot be called for objects). */ -SPL_METHOD(Array, append) -{ - zval *value; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { - return; - } - spl_array_iterator_append(getThis(), value TSRMLS_CC); -} /* }}} */ - -/* {{{ proto void ArrayObject::offsetUnset(mixed $index) - proto void ArrayIterator::offsetUnset(mixed $index) - Unsets the value at the specified $index. */ -SPL_METHOD(Array, offsetUnset) -{ - zval *index; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { - return; - } - spl_array_unset_dimension_ex(0, getThis(), index TSRMLS_CC); -} /* }}} */ - -/* {{ proto array ArrayObject::getArrayCopy() - proto array ArrayIterator::getArrayCopy() - Return a copy of the contained array */ -SPL_METHOD(Array, getArrayCopy) -{ - zval *object = getThis(), *tmp; - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - array_init(return_value); - zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*)); -} /* }}} */ - -static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - return spl_array_get_hash_table(intern, 1 TSRMLS_CC); -} /* }}} */ - -static zval *spl_array_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) { - return spl_array_read_dimension(object, member, type TSRMLS_CC); - } - return std_object_handlers.read_property(object, member, type TSRMLS_CC); -} /* }}} */ - -static void spl_array_write_property(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) { - spl_array_write_dimension(object, member, value TSRMLS_CC); - return; - } - std_object_handlers.write_property(object, member, value TSRMLS_CC); -} /* }}} */ - -static zval **spl_array_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) { - return spl_array_get_dimension_ptr_ptr(1, object, member, 0 TSRMLS_CC); - } - return std_object_handlers.get_property_ptr_ptr(object, member TSRMLS_CC); -} /* }}} */ - -static int spl_array_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0) { - if (!std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) { - return spl_array_has_dimension(object, member, has_set_exists TSRMLS_CC); - } - return 0; /* if prop doesn't exist at all mode 0/1 cannot return 1 */ - } - return std_object_handlers.has_property(object, member, has_set_exists TSRMLS_CC); -} /* }}} */ - -static void spl_array_rewind(spl_array_object *intern TSRMLS_DC); - -static void spl_array_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0 - && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) { - spl_array_unset_dimension(object, member TSRMLS_CC); - spl_array_rewind(intern TSRMLS_CC); /* because deletion might invalidate position */ - return; - } - std_object_handlers.unset_property(object, member TSRMLS_CC); -} /* }}} */ - -static int spl_array_skip_protected(spl_array_object *intern TSRMLS_DC) /* {{{ */ -{ - char *string_key; - uint string_length; - ulong num_key; - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (Z_TYPE_P(intern->array) == IS_OBJECT) { - do { - if (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 0, &intern->pos) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) { - if (!string_length || - ((UG(unicode) && ((UChar*)string_key)[0]) || - (!UG(unicode) && string_key[0]))) { - return SUCCESS; - } - } else { - return SUCCESS; - } - if (zend_hash_has_more_elements_ex(aht, &intern->pos) != SUCCESS) { - return FAILURE; - } - zend_hash_move_forward_ex(aht, &intern->pos); - } while (1); - } - return FAILURE; -} -/* }}} */ - -static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */ -{ - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - return FAILURE; - } else { - zend_hash_move_forward_ex(aht, &intern->pos); - if (Z_TYPE_P(intern->array) == IS_OBJECT) { - return spl_array_skip_protected(intern TSRMLS_CC); - } else { - return zend_hash_has_more_elements_ex(aht, &intern->pos); - } - } -} /* }}} */ - -/* define an overloaded iterator structure */ -typedef struct { - zend_object_iterator intern; - spl_array_object *object; -} spl_array_it; - -static void spl_array_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - - zval_ptr_dtor((zval**)&iterator->intern.data); - - efree(iterator); -} -/* }}} */ - -static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - spl_array_object *object = iterator->object; - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and is no longer an array"); - return FAILURE; - } - - if (object->pos && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(object TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and internal position is no longer valid"); - return FAILURE; - } else { - return zend_hash_has_more_elements_ex(aht, &object->pos); - } -} -/* }}} */ - -static void spl_array_it_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - spl_array_object *object = iterator->object; - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); - - if (zend_hash_get_current_data_ex(aht, (void**)data, &object->pos) == FAILURE) { - *data = NULL; - } -} -/* }}} */ - -static int spl_array_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - spl_array_object *object = iterator->object; - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); - return HASH_KEY_NON_EXISTANT; - } - - if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(object TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and internal position is no longer valid"); - return HASH_KEY_NON_EXISTANT; - } - - return zend_hash_get_current_key_ex(aht, str_key, str_key_len, int_key, 1, &object->pos); -} -/* }}} */ - -static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - spl_array_object *object = iterator->object; - - HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); - return; - } - - if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(object TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid"); - } else { - spl_array_next(object TSRMLS_CC); - } -} -/* }}} */ - -static void spl_array_rewind(spl_array_object *intern TSRMLS_DC) /* {{{ */ -{ - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array"); - return; - } - - zend_hash_internal_pointer_reset_ex(aht, &intern->pos); - spl_array_skip_protected(intern TSRMLS_CC); -} -/* }}} */ - -static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = (spl_array_it *)iter; - spl_array_object *object = iterator->object; - - spl_array_rewind(object TSRMLS_CC); -} -/* }}} */ - -/* iterator handler table */ -zend_object_iterator_funcs spl_array_it_funcs = { - spl_array_it_dtor, - spl_array_it_valid, - spl_array_it_get_current_data, - spl_array_it_get_current_key, - spl_array_it_move_forward, - spl_array_it_rewind -}; - -zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) /* {{{ */ -{ - spl_array_it *iterator = emalloc(sizeof(spl_array_it)); - spl_array_object *array_object = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - object->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &spl_array_it_funcs; - iterator->object = array_object; - - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ proto void ArrayObject::__construct(array|object ar = array() [, int flags = 0 [, string iterator_class = "ArrayIterator"]]) - proto void ArrayIterator::__construct(array|object ar = array() [, int flags = 0]) - Cronstructs a new array iterator from a path. */ -SPL_METHOD(Array, __construct) -{ - zval *object = getThis(); - spl_array_object *intern; - zval *array; - long ar_flags = 0; - char *class_name; - int class_name_len; - zend_class_entry ** pce_get_iterator; - - if (ZEND_NUM_ARGS() == 0) { - return; /* nothing to do */ - } - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC); - - intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ls", &array, &ar_flags, &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - - if (ZEND_NUM_ARGS() > 2) { - if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - intern->ce_get_iterator = *pce_get_iterator; - } - - ar_flags &= ~SPL_ARRAY_INT_MASK; - - if (Z_TYPE_P(array) == IS_OBJECT && (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject || Z_OBJ_HT_P(array) == &spl_handler_ArrayIterator)) { - zval_ptr_dtor(&intern->array); - if (ZEND_NUM_ARGS() == 1) - { - spl_array_object *other = (spl_array_object*)zend_object_store_get_object(array TSRMLS_CC); - ar_flags = other->ar_flags & ~SPL_ARRAY_INT_MASK; - } - ar_flags |= SPL_ARRAY_USE_OTHER; - intern->array = array; - } else { - if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC); - return; - } - zval_ptr_dtor(&intern->array); - intern->array = array; - } - if (object == array) { - intern->ar_flags |= SPL_ARRAY_IS_SELF; - } else { - intern->ar_flags &= ~SPL_ARRAY_IS_SELF; - } - intern->ar_flags |= ar_flags; - ZVAL_ADDREF(intern->array); - if (Z_TYPE_P(array) == IS_OBJECT) { - zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties); - if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties) - || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name); - return; - } - } - - spl_array_rewind(intern TSRMLS_CC); - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto void ArrayObject::setIteratorClass(string iterator_class) - Set the class used in getIterator. */ -SPL_METHOD(Array, setIteratorClass) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - char *class_name; - int class_name_len; - zend_class_entry ** pce_get_iterator; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - - if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - intern->ce_get_iterator = *pce_get_iterator; -} -/* }}} */ - -/* {{{ proto string ArrayObject::getIteratorClass() - Get the class used in getIterator. */ -SPL_METHOD(Array, getIteratorClass) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - RETURN_TEXTL(intern->ce_get_iterator->name, intern->ce_get_iterator->name_length, 1); -} -/* }}} */ - -/* {{{ proto int ArrayObject::getFlags() - Get flags */ -SPL_METHOD(Array, getFlags) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - RETURN_LONG(intern->ar_flags & ~SPL_ARRAY_INT_MASK); -} -/* }}} */ - -/* {{{ proto void ArrayObject::setFlags(int flags) - Set flags */ -SPL_METHOD(Array, setFlags) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - long ar_flags = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) { - return; - } - - intern->ar_flags = (intern->ar_flags & SPL_ARRAY_INT_MASK) | (ar_flags & ~SPL_ARRAY_INT_MASK); -} -/* }}} */ - -/* {{{ proto Array|Object ArrayObject::exchangeArray(Array|Object ar = array()) - Replace the referenced array or object with a new one and return the old one (right now copy - to be changed) */ -SPL_METHOD(Array, exchangeArray) -{ - zval *object = getThis(), *tmp, **array; - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - array_init(return_value); - zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*)); - - if (ZEND_NUM_ARGS() > 1 || zend_get_parameters_ex(1, &array) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_PP(array) == IS_OBJECT && intern == (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC)) - { - zval_ptr_dtor(&intern->array); - array = &object; - intern->array = object; - } else if (Z_TYPE_PP(array) == IS_OBJECT && (Z_OBJ_HT_PP(array) == &spl_handler_ArrayObject || Z_OBJ_HT_PP(array) == &spl_handler_ArrayIterator)) { - spl_array_object *other = (spl_array_object*)zend_object_store_get_object(*array TSRMLS_CC); - zval_ptr_dtor(&intern->array); - intern->array = other->array; - } else { - if (Z_TYPE_PP(array) != IS_OBJECT && !HASH_OF(*array)) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC); - return; - } - zval_ptr_dtor(&intern->array); - intern->array = *array; - } - if (object == *array) { - intern->ar_flags |= SPL_ARRAY_IS_SELF; - } else { - intern->ar_flags &= ~SPL_ARRAY_IS_SELF; - } - ZVAL_ADDREF(intern->array); - - spl_array_rewind(intern TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto ArrayIterator ArrayObject::getIterator() - Create a new iterator from a ArrayObject instance */ -SPL_METHOD(Array, getIterator) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - spl_array_object *iterator; - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - return_value->type = IS_OBJECT; - return_value->value.obj = spl_array_object_new_ex(intern->ce_get_iterator, &iterator, object TSRMLS_CC); - return_value->refcount = 1; - return_value->is_ref = 1; -} -/* }}} */ - -/* {{{ proto void ArrayIterator::rewind() - Rewind array back to the start */ -SPL_METHOD(Array, rewind) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - - spl_array_rewind(intern TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto void ArrayIterator::seek(int $position) - Seek to position. */ -SPL_METHOD(Array, seek) -{ - long opos, position; - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - int result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) { - return; - } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - opos = position; - - if (position >= 0) { /* negative values are not supported */ - zend_hash_internal_pointer_reset_ex(aht, &intern->pos); - - while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS); - - if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - /* fail */ - } else { - if (zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) { - return; /* ok */ - } - } - } - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Seek position %ld is out of range", opos); -} /* }}} */ - -int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - HashPosition pos; - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - *count = 0; - return FAILURE; - } - - if (Z_TYPE_P(intern->array) == IS_OBJECT) { - /* We need to store the 'pos' since we'll modify it in the functions - * we're going to call and which do not support 'pos' as parameter. */ - pos = intern->pos; - *count = 0; - zend_hash_internal_pointer_reset_ex(aht, &intern->pos); - while(intern->pos && spl_array_next(intern TSRMLS_CC) == SUCCESS) { - (*count)++; - } - intern->pos = pos; - return SUCCESS; - } else { - *count = zend_hash_num_elements(aht); - return SUCCESS; - } -} /* }}} */ - -/* {{{ proto int ArrayObject::count() - proto int ArrayIterator::count() - Return the number of elements in the Iterator. */ -SPL_METHOD(Array, count) -{ - long count; - - spl_array_object_count_elements(getThis(), &count TSRMLS_CC); - RETURN_LONG(count); -} /* }}} */ - -static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) -{ - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - zval tmp, **arg; - - INIT_PZVAL(&tmp); - Z_TYPE(tmp) = IS_ARRAY; - Z_ARRVAL(tmp) = aht; - - if (use_arg) { - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Function expects exactly one argument", 0 TSRMLS_CC); - return; - } - zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 2, &tmp, *arg TSRMLS_CC); - } else { - zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 1, &tmp, NULL TSRMLS_CC); - } -} - -#define SPL_ARRAY_METHOD(cname, fname, use_arg) \ -SPL_METHOD(cname, fname) \ -{ \ - spl_array_method(INTERNAL_FUNCTION_PARAM_PASSTHRU, #fname, sizeof(#fname)-1, use_arg); \ -} - -/* {{{ proto int ArrayObject::asort() - proto int ArrayIterator::asort() - Sort the entries by values. */ -SPL_ARRAY_METHOD(Array, asort, 0) - -/* {{{ proto int ArrayObject::ksort() - proto int ArrayIterator::ksort() - Sort the entries by key. */ -SPL_ARRAY_METHOD(Array, ksort, 0) - -/* {{{ proto int ArrayObject::uasort(callback cmp_function) - proto int ArrayIterator::uasort(callback cmp_function) - Sort the entries by values user defined function. */ -SPL_ARRAY_METHOD(Array, uasort, 1) - -/* {{{ proto int ArrayObject::uksort(callback cmp_function) - proto int ArrayIterator::uksort(callback cmp_function) - Sort the entries by key using user defined function. */ -SPL_ARRAY_METHOD(Array, uksort, 1) - -/* {{{ proto int ArrayObject::natsort() - proto int ArrayIterator::natsort() - Sort the entries by values using "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natsort, 0) - -/* {{{ proto int ArrayObject::natcasesort() - proto int ArrayIterator::natcasesort() - Sort the entries by key using case insensitive "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natcasesort, 0) - -/* {{{ proto mixed|NULL ArrayIterator::current() - Return current array entry */ -SPL_METHOD(Array, current) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - zval **entry; - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - return; - } - - if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) { - return; - } - RETVAL_ZVAL(*entry, 1, 0); -} -/* }}} */ - -/* {{{ proto mixed|NULL ArrayIterator::key() - Return current array key */ -SPL_METHOD(Array, key) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - char *string_key; - uint string_length; - ulong num_key; - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - return; - } - - switch (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 1, &intern->pos)) { - case HASH_KEY_IS_STRING: - RETVAL_STRINGL(string_key, string_length - 1, 0); - break; - case HASH_KEY_IS_BINARY: - RETVAL_BINARYL(string_key, string_length - 1, 0); - break; - case HASH_KEY_IS_UNICODE: - RETVAL_UNICODEL((UChar*)string_key, string_length - 1, 0); - break; - case HASH_KEY_IS_LONG: - RETVAL_LONG(num_key); - break; - case HASH_KEY_NON_EXISTANT: - return; - } -} -/* }}} */ - -/* {{{ proto void ArrayIterator::next() - Move to next entry */ -SPL_METHOD(Array, next) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - spl_array_next(intern TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto bool ArrayIterator::valid() - Check whether array contains more entries */ -SPL_METHOD(Array, valid) -{ - zval *object = getThis(); - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - RETURN_FALSE; - } else { - RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS); - } -} -/* }}} */ - -/* {{{ proto bool RecursiveArrayIterator::hasChildren() - Check whether current element has children (e.g. is an array) */ -SPL_METHOD(Array, hasChildren) -{ - zval *object = getThis(), **entry; - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - RETURN_FALSE; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - RETURN_FALSE; - } - - if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) { - RETURN_FALSE; - } - - RETURN_BOOL(Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == IS_OBJECT); -} -/* }}} */ - -/* {{{ proto object RecursiveArrayIterator::getChildren() - Create a sub iterator for the current element (same class as $this) */ -SPL_METHOD(Array, getChildren) -{ - zval *object = getThis(), **entry; - spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - return; - } - - if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) { - return; - } - - if (Z_TYPE_PP(entry) == IS_OBJECT && instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) { - RETURN_ZVAL(*entry, 0, 0); - } - - spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, *entry TSRMLS_CC); -} -/* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0) - ZEND_ARG_INFO(0, array) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetGet, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetSet, 0, 0, 2) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, newval) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_append, 0) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_seek, 0) - ZEND_ARG_INFO(0, position) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_exchangeArray, 0) - ZEND_ARG_INFO(0, array) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_setFlags, 0) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_setIteratorClass, 0) - ZEND_ARG_INFO(0, iteratorClass) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_array_uXsort, 0) - ZEND_ARG_INFO(0, cmp_function ) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_ArrayObject[] = { - SPL_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetExists, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetUnset, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, append, arginfo_array_append, ZEND_ACC_PUBLIC) - SPL_ME(Array, getArrayCopy, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, getFlags, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, setFlags, arginfo_array_setFlags, ZEND_ACC_PUBLIC) - SPL_ME(Array, asort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, ksort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, uasort, arginfo_array_uXsort, ZEND_ACC_PUBLIC) - SPL_ME(Array, uksort, arginfo_array_uXsort, ZEND_ACC_PUBLIC) - SPL_ME(Array, natsort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, natcasesort, NULL, ZEND_ACC_PUBLIC) - /* ArrayObject specific */ - SPL_ME(Array, getIterator, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, exchangeArray, arginfo_array_exchangeArray, ZEND_ACC_PUBLIC) - SPL_ME(Array, setIteratorClass, arginfo_array_setIteratorClass, ZEND_ACC_PUBLIC) - SPL_ME(Array, getIteratorClass, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_funcs_ArrayIterator[] = { - SPL_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetExists, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC) - SPL_ME(Array, offsetUnset, arginfo_array_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(Array, append, arginfo_array_append, ZEND_ACC_PUBLIC) - SPL_ME(Array, getArrayCopy, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, getFlags, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, setFlags, arginfo_array_setFlags, ZEND_ACC_PUBLIC) - SPL_ME(Array, asort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, ksort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, uasort, arginfo_array_uXsort, ZEND_ACC_PUBLIC) - SPL_ME(Array, uksort, arginfo_array_uXsort, ZEND_ACC_PUBLIC) - SPL_ME(Array, natsort, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, natcasesort, NULL, ZEND_ACC_PUBLIC) - /* ArrayIterator specific */ - SPL_ME(Array, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, seek, arginfo_array_seek, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_funcs_RecursiveArrayIterator[] = { - SPL_ME(Array, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(Array, getChildren, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_funcs_Countable[] = { - SPL_ABSTRACT_ME(Countable, count, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION(spl_array) */ -PHP_MINIT_FUNCTION(spl_array) -{ - REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject); - REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate); - REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess); - memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - spl_handler_ArrayObject.clone_obj = spl_array_object_clone; - spl_handler_ArrayObject.read_dimension = spl_array_read_dimension; - spl_handler_ArrayObject.write_dimension = spl_array_write_dimension; - spl_handler_ArrayObject.unset_dimension = spl_array_unset_dimension; - spl_handler_ArrayObject.has_dimension = spl_array_has_dimension; - spl_handler_ArrayObject.count_elements = spl_array_object_count_elements; - - spl_handler_ArrayObject.get_properties = spl_array_get_properties; - spl_handler_ArrayObject.read_property = spl_array_read_property; - spl_handler_ArrayObject.write_property = spl_array_write_property; - spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr; - spl_handler_ArrayObject.has_property = spl_array_has_property; - spl_handler_ArrayObject.unset_property = spl_array_unset_property; - - REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator); - memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers)); - spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator; - - REGISTER_SPL_SUB_CLASS_EX(RecursiveArrayIterator, ArrayIterator, spl_array_object_new, spl_funcs_RecursiveArrayIterator); - REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator); - - REGISTER_SPL_INTERFACE(Countable); - - REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); - - REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST); - REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS); - - REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST); - REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS); - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h deleted file mode 100755 index 34dedc78dd418..0000000000000 --- a/ext/spl/spl_array.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_ARRAY_H -#define SPL_ARRAY_H - -#include "php.h" -#include "php_spl.h" - -extern PHPAPI zend_class_entry *spl_ce_ArrayObject; -extern PHPAPI zend_class_entry *spl_ce_ArrayIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator; -extern PHPAPI zend_class_entry *spl_ce_Countable; - -PHP_MINIT_FUNCTION(spl_array); - -extern void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC); - -#endif /* SPL_ARRAY_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c deleted file mode 100755 index 683367b3043b1..0000000000000 --- a/ext/spl/spl_directory.c +++ /dev/null @@ -1,1852 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" -#include "zend_compile.h" -#include "zend_exceptions.h" -#include "zend_interfaces.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_iterators.h" -#include "spl_directory.h" -#include "spl_exceptions.h" - -#include "php.h" -#include "fopen_wrappers.h" - -#include "ext/standard/basic_functions.h" -#include "ext/standard/php_filestat.h" - -/* declare the class handlers */ -static zend_object_handlers spl_filesystem_object_handlers; - -/* decalre the class entry */ -PHPAPI zend_class_entry *spl_ce_SplFileInfo; -PHPAPI zend_class_entry *spl_ce_DirectoryIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator; -PHPAPI zend_class_entry *spl_ce_SplFileObject; - -static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ -{ - if (intern->u.file.current_line) { - efree(intern->u.file.current_line); - intern->u.file.current_line = NULL; - } - if (intern->u.file.current_zval) { - zval_ptr_dtor(&intern->u.file.current_zval); - intern->u.file.current_zval = NULL; - } -} /* }}} */ - -static void spl_filesystem_object_free_storage(void *object TSRMLS_DC) /* {{{ */ -{ - spl_filesystem_object *intern = (spl_filesystem_object*)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - if (intern->path) { - efree(intern->path); - } - if (intern->file_name) { - efree(intern->file_name); - } - switch(intern->type) { - case SPL_FS_INFO: - break; - case SPL_FS_DIR: - if (intern->u.dir.dirp) { - php_stream_close(intern->u.dir.dirp); - } - if (intern->u.dir.sub_path) { - efree(intern->u.dir.sub_path); - } - break; - case SPL_FS_FILE: - if (intern->u.file.stream) { - if (intern->u.file.zcontext) { -/* zend_list_delref(Z_RESVAL_P(intern->zcontext));*/ - } - if (!intern->u.file.stream->is_persistent) { - php_stream_free(intern->u.file.stream, PHP_STREAM_FREE_CLOSE); - } else { - php_stream_free(intern->u.file.stream, PHP_STREAM_FREE_CLOSE_PERSISTENT); - } - if (intern->u.file.open_mode) { - efree(intern->u.file.open_mode); - } - } - spl_filesystem_file_free_line(intern TSRMLS_CC); - break; - } - efree(object); -} /* }}} */ - -/* {{{ spl_ce_dir_object_new */ -/* creates the object by - - allocating memory - - initializing the object members - - storing the object - - setting it's handlers - - called from - - clone - - new - */ -static zend_object_value spl_filesystem_object_new_ex(zend_class_entry *class_type, spl_filesystem_object **obj TSRMLS_DC) -{ - zend_object_value retval; - spl_filesystem_object *intern; - zval *tmp; - - intern = emalloc(sizeof(spl_filesystem_object)); - memset(intern, 0, sizeof(spl_filesystem_object)); - intern->std.ce = class_type; - /* intern->type = SPL_FS_INFO; done by set o */ - if (obj) *obj = intern; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_filesystem_object_free_storage, NULL TSRMLS_CC); - retval.handlers = &spl_filesystem_object_handlers; - return retval; -} -/* }}} */ - -/* {{{ spl_filesystem_object_new */ -/* See spl_filesystem_object_new_ex */ -static zend_object_value spl_filesystem_object_new(zend_class_entry *class_type TSRMLS_DC) -{ - return spl_filesystem_object_new_ex(class_type, NULL TSRMLS_CC); -} -/* }}} */ - -static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ -{ - if (!intern->file_name) { - switch (intern->type) { - case SPL_FS_INFO: - case SPL_FS_FILE: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized"); - break; - case SPL_FS_DIR: - intern->file_name_len = spprintf(&intern->file_name, 0, "%s/%s", intern->path, intern->u.dir.entry.d_name); - break; - } - } -} /* }}} */ - -/* {{{ spl_filesystem_dir_open */ -/* open a directory resource */ -static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TSRMLS_DC) -{ - intern->type = SPL_FS_DIR; - intern->path_len = strlen(path); - intern->u.dir.dirp = php_stream_opendir(path, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); - - if (intern->path_len && (path[intern->path_len-1] == '/' || path[intern->path_len-1] == '\\')) { - intern->path = estrndup(path, --intern->path_len); - } else { - intern->path = estrndup(path, intern->path_len); - } - intern->u.dir.index = 0; - - if (intern->u.dir.dirp == NULL) { - /* throw exception: should've been already happened */ - intern->u.dir.entry.d_name[0] = '\0'; - } else { - if (!php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { - intern->u.dir.entry.d_name[0] = '\0'; - } - } -} -/* }}} */ - -static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */ -{ - intern->type = SPL_FS_FILE; - intern->u.file.context = php_stream_context_from_zval(intern->u.file.zcontext, 0); - intern->u.file.stream = php_stream_open_wrapper_ex(intern->file_name, intern->u.file.open_mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, intern->u.file.context); - - if (intern->u.file.stream == NULL) { - if (!EG(exception)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot open file %s", intern->file_name); - } - intern->file_name = NULL; /* until here it is not a copy */ - intern->u.file.open_mode = NULL; - return FAILURE; - } - - if (intern->u.file.zcontext) { - zend_list_addref(Z_RESVAL_P(intern->u.file.zcontext)); - } - - intern->file_name = estrndup(intern->file_name, intern->file_name_len); - intern->u.file.open_mode = estrndup(intern->u.file.open_mode, intern->u.file.open_mode_len); - - /* avoid reference counting in debug mode, thus do it manually */ - ZVAL_RESOURCE(&intern->u.file.zresource, php_stream_get_resource_id(intern->u.file.stream)); - intern->u.file.zresource.refcount = 1; - - zend_hash_find(&intern->std.ce->function_table, "getcurrentline", sizeof("getcurrentline"), (void **) &intern->u.file.func_getCurr); - - return SUCCESS; -} /* }}} */ - -/* {{{ spl_filesystem_object_clone */ -/* Local zend_object_value creation (on stack) - Load the 'other' object - Create a new empty object (See spl_filesystem_object_new_ex) - Open the directory - Clone other members (properties) - */ -static zend_object_value spl_filesystem_object_clone(zval *zobject TSRMLS_DC) -{ - zend_object_value new_obj_val; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - spl_filesystem_object *intern; - spl_filesystem_object *source; - - old_object = zend_objects_get_address(zobject TSRMLS_CC); - source = (spl_filesystem_object*)old_object; - - new_obj_val = spl_filesystem_object_new_ex(old_object->ce, &intern TSRMLS_CC); - new_object = &intern->std; - - switch (source->type) { - case SPL_FS_INFO: - source->path_len = source->path_len; - source->path = estrndup(source->path, source->path_len); - intern->file_name_len = source->file_name_len; - intern->file_name = estrndup(source->file_name, intern->file_name_len); - break; - case SPL_FS_DIR: - spl_filesystem_dir_open(intern, source->path TSRMLS_CC); - break; - case SPL_FS_FILE: - php_error_docref(NULL TSRMLS_CC, E_ERROR, "An object of class %v cannot be cloned", old_object->ce->name); - break; - } - - zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC); - - return new_obj_val; -} -/* }}} */ - -void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, int len, int use_copy TSRMLS_DC) /* {{{ */ -{ - char *p1, *p2; - - intern->file_name = use_copy ? estrndup(path, len) : path; - intern->file_name_len = len; - - p1 = strrchr(path, '/'); - p2 = strrchr(path, '\\'); - if (p1 || p2) { - intern->path_len = (p1 > p2 ? p1 : p2) - path; - } else { - intern->path_len = 0; - } - intern->path = estrndup(path, intern->path_len); -} /* }}} */ - -static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zval *return_value TSRMLS_DC) /* {{{ */ -{ - spl_filesystem_object *intern; - - if (!file_path || !file_path_len) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path"); - if (file_path && !use_copy) - { - efree(file_path); - } - return NULL; - } - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC); - - return_value->value.obj = spl_filesystem_object_new_ex(spl_ce_SplFileInfo, &intern TSRMLS_CC); - Z_TYPE_P(return_value) = IS_OBJECT; - - spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC); - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - - return intern; -} /* }}} */ - -static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zval *return_value TSRMLS_DC) /* {{{ */ -{ - spl_filesystem_object *intern; - zend_bool use_include_path = 0; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC); - - switch (source->type) { - case SPL_FS_INFO: - case SPL_FS_FILE: - break; - case SPL_FS_DIR: - if (!source->u.dir.entry.d_name[0]) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Could not open file"); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - } - - switch (type) { - case SPL_FS_INFO: - return_value->value.obj = spl_filesystem_object_new_ex(spl_ce_SplFileInfo, &intern TSRMLS_CC); - Z_TYPE_P(return_value) = IS_OBJECT; - - spl_filesystem_object_get_file_name(source TSRMLS_CC); - intern->file_name = estrndup(source->file_name, source->file_name_len); - intern->file_name_len = source->file_name_len; - break; - case SPL_FS_FILE: - return_value->value.obj = spl_filesystem_object_new_ex(spl_ce_SplFileObject, &intern TSRMLS_CC); - Z_TYPE_P(return_value) = IS_OBJECT; - - spl_filesystem_object_get_file_name(source TSRMLS_CC); - intern->file_name = source->file_name; - intern->file_name_len = source->file_name_len; - - intern->u.file.open_mode = "r"; - intern->u.file.open_mode_len = 1; - - if (ht && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sbr", - &intern->u.file.open_mode, &intern->u.file.open_mode_len, - &use_include_path, &intern->u.file.zcontext) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - intern->u.file.open_mode = NULL; - zval_dtor(return_value); - Z_TYPE_P(return_value) = IS_NULL; - return NULL; - } - - if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zval_dtor(return_value); - Z_TYPE_P(return_value) = IS_NULL; - return NULL; - } - case SPL_FS_DIR: - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Operation not supported"); - return NULL; - } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; -} /* }}} */ - -/* {{{ proto void DirectoryIterator::__construct(string path [, int flags]) - Cronstructs a new dir iterator from a path. */ -/* php_set_error_handling() is used to throw exceptions in case - the constructor fails. Here we use this to ensure the object - has a valid directory resource. - - When the constructor gets called the object is already created - by the engine, so we must only call 'additional' initializations. - */ -SPL_METHOD(DirectoryIterator, __construct) -{ - spl_filesystem_object *intern; - char *path; - int len; - long flags = 0; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &len, &flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - - intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_filesystem_dir_open(intern, path TSRMLS_CC); - intern->u.dir.is_recursive = instanceof_function(intern->std.ce, U_CLASS_ENTRY(spl_ce_RecursiveDirectoryIterator) TSRMLS_CC) ? 1 : 0; - intern->flags = flags; - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto void DirectoryIterator::rewind() - Rewind dir back to the start */ -SPL_METHOD(DirectoryIterator, rewind) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->u.dir.index = 0; - if (intern->u.dir.dirp) { - php_stream_rewinddir(intern->u.dir.dirp); - } - if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { - intern->u.dir.entry.d_name[0] = '\0'; - } -} -/* }}} */ - -/* {{{ proto string DirectoryIterator::key() - Return current dir entry */ -SPL_METHOD(DirectoryIterator, key) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->u.dir.dirp) { - RETURN_LONG(intern->u.dir.index); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto DirectoryIterator DirectoryIterator::current() - Return this (needed for Iterator interface) */ -SPL_METHOD(DirectoryIterator, current) -{ - RETURN_ZVAL(getThis(), 1, 0); -} -/* }}} */ - -/* {{{ proto void DirectoryIterator::next() - Move to next entry */ -SPL_METHOD(DirectoryIterator, next) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->u.dir.index++; - if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { - intern->u.dir.entry.d_name[0] = '\0'; - } - if (intern->file_name) { - efree(intern->file_name); - intern->file_name = NULL; - } -} -/* }}} */ - -/* {{{ proto string DirectoryIterator::valid() - Check whether dir contains more entries */ -SPL_METHOD(DirectoryIterator, valid) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(intern->u.dir.entry.d_name[0] != '\0'); -} -/* }}} */ - -/* {{{ proto string SplFileInfo::getPath() - Return the path */ -SPL_METHOD(SplFileInfo, getPath) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_STRING(intern->path, 1); -} -/* }}} */ - -/* {{{ proto string SplFileInfo::getFilename() - Return filename only */ -SPL_METHOD(SplFileInfo, getFilename) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->path_len) { - RETURN_STRINGL(intern->file_name + intern->path_len + 1, intern->file_name_len - (intern->path_len + 1), 1); - } else { - RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); - } -} -/* }}} */ - -/* {{{ proto string DirectoryIterator::getFilename() - Return filename of current dir entry */ -SPL_METHOD(DirectoryIterator, getFilename) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_STRING(intern->u.dir.entry.d_name, 1); -} -/* }}} */ - -/* {{{ proto string SplFileInfo::getPathname() - Return path and filename */ -SPL_METHOD(SplFileInfo, getPathname) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - switch (intern->type) { - case SPL_FS_INFO: - case SPL_FS_FILE: - RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); - case SPL_FS_DIR: - if (intern->u.dir.entry.d_name[0]) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); - } - } - RETURN_BOOL(0); -} -/* }}} */ - -/* {{{ proto string RecursiveDirectoryIterator::key() - Return getPathname() or getFilename() depending on flags */ -SPL_METHOD(RecursiveDirectoryIterator, key) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->flags & SPL_FILE_DIR_KEY_AS_FILENAME) { - RETURN_STRING(intern->u.dir.entry.d_name, 1); - } else { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); - } -} -/* }}} */ - -/* {{{ proto string RecursiveDirectoryIterator::current() - Return getFilename() or getFileInfo() depending on flags */ -SPL_METHOD(RecursiveDirectoryIterator, current) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->flags & SPL_FILE_DIR_CURRENT_AS_FILEINFO) { - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, return_value TSRMLS_CC); - } else { - RETURN_STRING(intern->u.dir.entry.d_name, 1); - } -} -/* }}} */ - -/* {{{ proto bool DirectoryIterator::isDot() - Returns true if current entry is '.' or '..' */ -SPL_METHOD(DirectoryIterator, isDot) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(!strcmp(intern->u.dir.entry.d_name, ".") || !strcmp(intern->u.dir.entry.d_name, "..")); -} -/* }}} */ - -/* {{{ proto void SplFileInfo::__construct(string file_name) - Cronstructs a new SplFileInfo from a path. */ -/* php_set_error_handling() is used to throw exceptions in case - the constructor fails. Here we use this to ensure the object - has a valid directory resource. - - When the constructor gets called the object is already created - by the engine, so we must only call 'additional' initializations. - */ -SPL_METHOD(SplFileInfo, __construct) -{ - spl_filesystem_object *intern; - char *path; - int len; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - - intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC); - - /* intern->type = SPL_FS_INFO; already set */ - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ FileInfoFunction */ -#define FileInfoFunction(func_name, func_num) \ -SPL_METHOD(SplFileInfo, func_name) \ -{ \ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \ - \ - spl_filesystem_object_get_file_name(intern TSRMLS_CC); \ - php_stat(intern->file_name, intern->file_name_len, func_num, return_value TSRMLS_CC); \ -} -/* }}} */ - -/* {{{ proto int SplFileInfo::getPerms() - Get file permissions */ -FileInfoFunction(getPerms, FS_PERMS) -/* }}} */ - -/* {{{ proto int SplFileInfo::getInode() - Get file inode */ -FileInfoFunction(getInode, FS_INODE) -/* }}} */ - -/* {{{ proto int SplFileInfo::getSize() - Get file size */ -FileInfoFunction(getSize, FS_SIZE) -/* }}} */ - -/* {{{ proto int SplFileInfo::getOwner() - Get file owner */ -FileInfoFunction(getOwner, FS_OWNER) -/* }}} */ - -/* {{{ proto int SplFileInfo::getGroup() - Get file group */ -FileInfoFunction(getGroup, FS_GROUP) -/* }}} */ - -/* {{{ proto int SplFileInfo::getATime() - Get last access time of file */ -FileInfoFunction(getATime, FS_ATIME) -/* }}} */ - -/* {{{ proto int SplFileInfo::getMTime() - Get last modification time of file */ -FileInfoFunction(getMTime, FS_MTIME) -/* }}} */ - -/* {{{ proto int SplFileInfo::getCTime() - Get inode modification time of file */ -FileInfoFunction(getCTime, FS_CTIME) -/* }}} */ - -/* {{{ proto string SplFileInfo::getType() - Get file type */ -FileInfoFunction(getType, FS_TYPE) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isWritable() - Returns true if file can be written */ -FileInfoFunction(isWritable, FS_IS_W) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isReadable() - Returns true if file can be read */ -FileInfoFunction(isReadable, FS_IS_R) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isExecutable() - Returns true if file is executable */ -FileInfoFunction(isExecutable, FS_IS_X) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isFile() - Returns true if file is a regular file */ -FileInfoFunction(isFile, FS_IS_FILE) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isDir() - Returns true if file is directory */ -FileInfoFunction(isDir, FS_IS_DIR) -/* }}} */ - -/* {{{ proto bool SplFileInfo::isLink() - Returns true if file is symbolic link */ -FileInfoFunction(isLink, FS_IS_LINK) -/* }}} */ - -/* {{{ proto SplFileObject SplFileInfo::openFile([string mode = 'r' [, bool use_include_path [, resource context]]]) - Open the current file */ -SPL_METHOD(SplFileInfo, openFile) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_object_create_type(ht, intern, SPL_FS_FILE, return_value TSRMLS_CC); -} - -/* {{{ proto SplFileInfo SplFileInfo::getFileInfo() - Get/copy file info */ -SPL_METHOD(SplFileInfo, getFileInfo) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_object_create_type(ht, intern, SPL_FS_INFO, return_value TSRMLS_CC); -} - -/* {{{ proto SplFileInfo SplFileInfo::getPathInfo() - Get/copy file info */ -SPL_METHOD(SplFileInfo, getPathInfo) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_object_create_info(intern, intern->path, intern->path_len, 1, return_value TSRMLS_CC); -} - -/* {{{ proto void RecursiveDirectoryIterator::rewind() - Rewind dir back to the start */ -SPL_METHOD(RecursiveDirectoryIterator, rewind) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->u.dir.index = 0; - if (intern->u.dir.dirp) { - php_stream_rewinddir(intern->u.dir.dirp); - } - do { - if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { - intern->u.dir.entry.d_name[0] = '\0'; - } - } while (!strcmp(intern->u.dir.entry.d_name, ".") || !strcmp(intern->u.dir.entry.d_name, "..")); -} -/* }}} */ - -/* {{{ proto void RecursiveDirectoryIterator::next() - Move to next entry */ -SPL_METHOD(RecursiveDirectoryIterator, next) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->u.dir.index++; - do { - if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) { - intern->u.dir.entry.d_name[0] = '\0'; - } - } while (!strcmp(intern->u.dir.entry.d_name, ".") || !strcmp(intern->u.dir.entry.d_name, "..")); - if (intern->file_name) { - efree(intern->file_name); - intern->file_name = NULL; - } -} -/* }}} */ - -/* {{{ proto bool RecursiveDirectoryIterator::hasChildren([bool $allow_links = false]) - Returns whether current entry is a directory and not '.' or '..' */ -SPL_METHOD(RecursiveDirectoryIterator, hasChildren) -{ - zend_bool allow_links = 0; - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!strcmp(intern->u.dir.entry.d_name, ".") || !strcmp(intern->u.dir.entry.d_name, "..")) { - RETURN_BOOL(0); - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &allow_links) == FAILURE) { - return; - } - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - if (!allow_links) { - php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC); - if (zend_is_true(return_value)) { - RETURN_BOOL(0); - } - } - php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto RecursiveDirectoryIterator DirectoryIterator::getChildren() - Returns an iterator for the current entry if it is a directory */ -SPL_METHOD(RecursiveDirectoryIterator, getChildren) -{ - zval zpath; - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_filesystem_object *subdir; - - spl_filesystem_object_get_file_name(intern TSRMLS_CC); - - INIT_PZVAL(&zpath); - ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len, 0); - - spl_instantiate_arg_ex1(spl_ce_RecursiveDirectoryIterator, &return_value, 0, &zpath TSRMLS_CC); - - subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC); - if (subdir) { - if (intern->u.dir.sub_path && intern->u.dir.sub_path[0]) { - subdir->u.dir.sub_path_len = spprintf(&subdir->u.dir.sub_path, 0, "%s/%s", intern->u.dir.sub_path, intern->u.dir.entry.d_name); - } else { - subdir->u.dir.sub_path_len = strlen(intern->u.dir.entry.d_name); - subdir->u.dir.sub_path = estrndup(intern->u.dir.entry.d_name, subdir->u.dir.sub_path_len); - } - subdir->flags = intern->flags; - } -} -/* }}} */ - -/* {{{ proto void RecursiveDirectoryIterator::getSubPath() - Get sub path */ -SPL_METHOD(RecursiveDirectoryIterator, getSubPath) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->u.dir.sub_path) { - RETURN_STRINGL(intern->u.dir.sub_path, intern->u.dir.sub_path_len, 1); - } else { - RETURN_STRINGL("", 0, 1); - } -} -/* }}} */ - -/* {{{ proto void RecursiveDirectoryIterator::getSubPathname() - Get sub path and file name */ -SPL_METHOD(RecursiveDirectoryIterator, getSubPathname) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char *sub_name; - int len; - - if (intern->u.dir.sub_path) { - len = spprintf(&sub_name, 0, "%s/%s", intern->u.dir.sub_path, intern->u.dir.entry.d_name); - RETURN_STRINGL(sub_name, len, 0); - } else { - RETURN_STRING(intern->u.dir.entry.d_name, 1); - } -} -/* }}} */ - -/* {{{ proto SplFileInfo RecursiveDirectoryIterator::getSubPathInfo() - Create SplFileInfo for sub path */ -SPL_METHOD(RecursiveDirectoryIterator, getSubPathInfo) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char *sub_name; - int len; - - if (intern->u.dir.sub_path) { - len = spprintf(&sub_name, 0, "%s/%s", intern->u.dir.sub_path, intern->u.dir.entry.d_name); - spl_filesystem_object_create_info(intern, sub_name, len, 0, return_value TSRMLS_CC); - } else { - spl_filesystem_object_create_info(intern, intern->path, intern->path_len, 1, return_value TSRMLS_CC); - } -} -/* }}} */ - -/* define an overloaded iterator structure */ -typedef struct { - zend_object_iterator intern; - zval *current; - spl_filesystem_object *object; -} spl_filesystem_dir_it; - -/* forward declarations to the iterator handlers */ -static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC); -static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC); -static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC); -static int spl_filesystem_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); -static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC); -static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC); - -/* iterator handler table */ -zend_object_iterator_funcs spl_filesystem_dir_it_funcs = { - spl_filesystem_dir_it_dtor, - spl_filesystem_dir_it_valid, - spl_filesystem_dir_it_current_data, - spl_filesystem_dir_it_current_key, - spl_filesystem_dir_it_move_forward, - spl_filesystem_dir_it_rewind -}; - -/* {{{ spl_ce_dir_get_iterator */ -zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = emalloc(sizeof(spl_filesystem_dir_it)); - spl_filesystem_object *dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC); - - object->refcount += 2;; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &spl_filesystem_dir_it_funcs; - iterator->current = object; - iterator->object = dir_object; - - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ spl_filesystem_dir_it_dtor */ -static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - - zval_ptr_dtor(&iterator->current); - zval_ptr_dtor((zval**)&iterator->intern.data); - - efree(iterator); -} -/* }}} */ - -/* {{{ spl_filesystem_dir_it_valid */ -static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE; -} -/* }}} */ - - -/* {{{ spl_filesystem_dir_it_current_data */ -static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - - *data = &iterator->current; -} -/* }}} */ - -/* {{{ spl_filesystem_dir_it_current_key */ -static int spl_filesystem_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - *int_key = object->u.dir.index; - return HASH_KEY_IS_LONG; -} -/* }}} */ - -/* {{{ spl_filesystem_dir_it_move_forward */ -static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - object->u.dir.index++; - if (!object->u.dir.dirp || !php_stream_readdir(object->u.dir.dirp, &object->u.dir.entry)) { - object->u.dir.entry.d_name[0] = '\0'; - } - if (object->file_name) { - efree(object->file_name); - object->file_name = NULL; - } -} -/* }}} */ - -/* {{{ spl_filesystem_dir_it_rewind */ -static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - object->u.dir.index = 0; - if (object->u.dir.dirp) { - php_stream_rewinddir(object->u.dir.dirp); - } - if (!object->u.dir.dirp || !php_stream_readdir(object->u.dir.dirp, &object->u.dir.entry)) { - object->u.dir.entry.d_name[0] = '\0'; - } -} -/* }}} */ - -/* {{{ spl_filesystem_tree_it_dtor */ -static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - - if (iterator->current) { - zval_ptr_dtor(&iterator->current); - } - zval_ptr_dtor((zval**)&iterator->intern.data); - - efree(iterator); -} -/* }}} */ - -/* {{{ spl_filesystem_tree_it_current_data */ -static void spl_filesystem_tree_it_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - if (object->flags & SPL_FILE_DIR_CURRENT_AS_FILEINFO) { - if (!iterator->current) { - ALLOC_INIT_ZVAL(iterator->current); - spl_filesystem_object_get_file_name(object TSRMLS_CC); - spl_filesystem_object_create_type(0, object, SPL_FS_INFO, iterator->current TSRMLS_CC); - } - *data = &iterator->current; - } else { - *data = (zval**)&iterator->intern.data; - } -} -/* }}} */ - -/* {{{ spl_filesystem_tree_it_current_key */ -static int spl_filesystem_tree_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - if (object->flags & SPL_FILE_DIR_KEY_AS_FILENAME) { - *str_key_len = strlen(object->u.dir.entry.d_name) + 1; - *str_key = estrndup(object->u.dir.entry.d_name, *str_key_len - 1); - } else { - spl_filesystem_object_get_file_name(object TSRMLS_CC); - *str_key_len = object->file_name_len + 1; - *str_key = estrndup(object->file_name, object->file_name_len); - } - return HASH_KEY_IS_STRING; -} -/* }}} */ - -/* {{{ spl_filesystem_tree_it_move_forward */ -static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - object->u.dir.index++; - do { - if (!object->u.dir.dirp || !php_stream_readdir(object->u.dir.dirp, &object->u.dir.entry)) { - object->u.dir.entry.d_name[0] = '\0'; - } - } while (!strcmp(object->u.dir.entry.d_name, ".") || !strcmp(object->u.dir.entry.d_name, "..")); - if (object->file_name) { - efree(object->file_name); - object->file_name = NULL; - } - if (iterator->current) { - zval_ptr_dtor(&iterator->current); - iterator->current = NULL; - } -} -/* }}} */ - -/* {{{ spl_filesystem_tree_it_rewind */ -static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = (spl_filesystem_dir_it *)iter; - spl_filesystem_object *object = iterator->object; - - object->u.dir.index = 0; - if (object->u.dir.dirp) { - php_stream_rewinddir(object->u.dir.dirp); - } - do { - if (!object->u.dir.dirp || !php_stream_readdir(object->u.dir.dirp, &object->u.dir.entry)) { - object->u.dir.entry.d_name[0] = '\0'; - } - } while (!strcmp(object->u.dir.entry.d_name, ".") || !strcmp(object->u.dir.entry.d_name, "..")); - if (iterator->current) { - zval_ptr_dtor(&iterator->current); - iterator->current = NULL; - } -} -/* }}} */ - -/* iterator handler table */ -zend_object_iterator_funcs spl_filesystem_tree_it_funcs = { - spl_filesystem_tree_it_dtor, - spl_filesystem_dir_it_valid, - spl_filesystem_tree_it_current_data, - spl_filesystem_tree_it_current_key, - spl_filesystem_tree_it_move_forward, - spl_filesystem_tree_it_rewind -}; - -/* {{{ spl_ce_dir_get_iterator */ -zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - spl_filesystem_dir_it *iterator = emalloc(sizeof(spl_filesystem_dir_it)); - spl_filesystem_object *dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC); - - object->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &spl_filesystem_tree_it_funcs; - iterator->current = NULL; - iterator->object = dir_object; - - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ spl_filesystem_object_cast */ -static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(readobj TSRMLS_CC); - - if (type == IS_STRING) { - switch (intern->type) { - case SPL_FS_INFO: - case SPL_FS_FILE: - ZVAL_STRINGL(writeobj, intern->file_name, intern->file_name_len, 1); - return SUCCESS; - case SPL_FS_DIR: - ZVAL_STRING(writeobj, intern->u.dir.entry.d_name, 1); - return SUCCESS; - } - } - return FAILURE; -} -/* }}} */ - -/* declare method parameters */ -/* supply a name and default to call by parameter */ -static -ZEND_BEGIN_ARG_INFO(arginfo_info___construct, 0) - ZEND_ARG_INFO(0, file_name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_info_openFile, 0, 0, 0) - ZEND_ARG_INFO(0, open_mode) - ZEND_ARG_INFO(0, use_include_path) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO(); - -/* the method table */ -/* each method can have its own parameters and visibility */ -static zend_function_entry spl_filesystem_info_class_functions[] = { - SPL_ME(SplFileInfo, __construct, arginfo_info___construct, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getPath, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getFilename, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getPathname, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getPerms, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getInode, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getSize, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getOwner, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getGroup, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getATime, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getMTime, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getCTime, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getType, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isWritable, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isReadable, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isExecutable, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isFile, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isDir, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, isLink, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getFileInfo, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, getPathInfo, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileInfo, openFile, arginfo_info_openFile, ZEND_ACC_PUBLIC) - SPL_MA(SplFileInfo, __toString, SplFileInfo, getPathname, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0) - ZEND_ARG_INFO(0, path) -ZEND_END_ARG_INFO(); - -/* the method table */ -/* each method can have its own parameters and visibility */ -static zend_function_entry spl_filesystem_dir_class_functions[] = { - SPL_ME(DirectoryIterator, __construct, arginfo_dir___construct, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, getFilename, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, isDot, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(DirectoryIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_MA(DirectoryIterator, __toString, DirectoryIterator, getFilename, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_filesystem_tree_class_functions[] = { - SPL_ME(RecursiveDirectoryIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, getSubPath, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, getSubPathname,NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveDirectoryIterator, getSubPathInfo,NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ -{ - char *buf; - size_t line_len; - int len; - long line_add = (intern->u.file.current_line || intern->u.file.current_zval) ? 1 : 0; - - spl_filesystem_file_free_line(intern TSRMLS_CC); - - if (php_stream_eof(intern->u.file.stream)) { - if (!silent) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name); - } - return FAILURE; - } - - buf = php_stream_get_line(intern->u.file.stream, NULL, intern->u.file.max_line_len, &line_len); - - if (!buf) { - intern->u.file.current_line = estrdup(""); - intern->u.file.current_line_len = 0; - } else { - if (intern->flags & SPL_FILE_OBJECT_DROP_NEW_LINE) { - line_len = strcspn(buf, "\r\n"); - buf[line_len] = '\0'; - } - - if (PG(magic_quotes_runtime)) { - buf = php_addslashes(buf, line_len, &len, 1 TSRMLS_CC); - line_len = len; - } - - intern->u.file.current_line = buf; - intern->u.file.current_line_len = line_len; - } - intern->u.file.current_line_num += line_add; - - return SUCCESS; -} /* }}} */ - -static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ -{ - zval *retval; - - /* if overloaded call the function, otherwise do it directly */ - if (intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) { - if (php_stream_eof(intern->u.file.stream)) { - if (!silent) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name); - } - return FAILURE; - } - zend_call_method_with_0_params(&getThis(), Z_OBJCE_P(getThis()), &intern->u.file.func_getCurr, "getCurrentLine", &retval); - if (retval) { - if (intern->u.file.current_line || intern->u.file.current_zval) { - intern->u.file.current_line_num++; - } - spl_filesystem_file_free_line(intern TSRMLS_CC); - if (Z_TYPE_P(retval) == IS_STRING) { - intern->u.file.current_line = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - intern->u.file.current_line_len = Z_STRLEN_P(retval); - } else { - MAKE_STD_ZVAL(intern->u.file.current_zval); - ZVAL_ZVAL(intern->u.file.current_zval, retval, 1, 0); - } - zval_ptr_dtor(&retval); - return SUCCESS; - } else { - return FAILURE; - } - } else { - return spl_filesystem_file_read(intern, silent TSRMLS_CC); - } -} /* }}} */ - -static void spl_filesystem_file_rewind(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ -{ - if (-1 == php_stream_rewind(intern->u.file.stream)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name); - } else { - spl_filesystem_file_free_line(intern TSRMLS_CC); - intern->u.file.current_line_num = 0; - } -} /* }}} */ - -/* {{{ proto void SplFileObject::__construct(string filename [, string mode = 'r' [, bool use_include_path [, resource context]]]]) - Construct a new file reader */ -SPL_METHOD(SplFileObject, __construct) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zend_bool use_include_path = 0; - char *p1, *p2; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC); - - intern->u.file.open_mode = "r"; - intern->u.file.open_mode_len = 1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbr", - &intern->file_name, &intern->file_name_len, - &intern->u.file.open_mode, &intern->u.file.open_mode_len, - &use_include_path, &intern->u.file.zcontext) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - - spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC); - - p1 = strrchr(intern->file_name, '/'); - p2 = strrchr(intern->file_name, '\\'); - if (p1 || p2) { - intern->path_len = (p1 > p2 ? p1 : p2) - intern->file_name; - } else { - intern->path_len = 0; - } - intern->path = estrndup(intern->file_name, intern->path_len); - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} /* }}} */ - -/* {{{ proto void SplFileObject::rewind() - Rewind the file and read the first line */ -SPL_METHOD(SplFileObject, rewind) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_file_rewind(intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto string SplFileObject::getFilename() - Return the filename */ -SPL_METHOD(SplFileObject, getFilename) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); -} /* }}} */ - -/* {{{ proto void SplFileObject::eof() - Return whether end of file is reached */ -SPL_METHOD(SplFileObject, eof) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(php_stream_eof(intern->u.file.stream)); -} /* }}} */ - -/* {{{ proto void SplFileObject::valid() - Return !eof() */ -SPL_METHOD(SplFileObject, valid) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETVAL_BOOL(!php_stream_eof(intern->u.file.stream)); -} /* }}} */ - -/* {{{ proto string SplFileObject::fgets() - Rturn next line from file */ -SPL_METHOD(SplFileObject, fgets) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (spl_filesystem_file_read(intern, 0 TSRMLS_CC) == FAILURE) { - RETURN_FALSE; - } - RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len, 1); -} /* }}} */ - -/* {{{ proto string SplFileObject::current() - Return current line from file */ -SPL_METHOD(SplFileObject, current) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!intern->u.file.current_line) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); - } - if (intern->u.file.current_line) { - RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len, 1); - } else if (intern->u.file.current_zval) { - RETURN_ZVAL(intern->u.file.current_zval, 1, 0); - } - RETURN_FALSE; -} /* }}} */ - -/* {{{ proto int SplFileObject::key() - Return line number */ -SPL_METHOD(SplFileObject, key) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - -/* Do not read the next line to support correct counting with fgetc() - if (!intern->current_line) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); - } */ - RETURN_LONG(intern->u.file.current_line_num); -} /* }}} */ - -/* {{{ proto void SplFileObject::next() - Read next line */ -SPL_METHOD(SplFileObject, next) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_file_free_line(intern TSRMLS_CC); - intern->u.file.current_line_num++; -} /* }}} */ - -/* {{{ proto void SplFileObject::setFlags(int flags) - Set file handling flags */ -SPL_METHOD(SplFileObject, setFlags) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags); -} /* }}} */ - -/* {{{ proto int SplFileObject::getFlags() - Get file handling flags */ -SPL_METHOD(SplFileObject, getFlags) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(intern->flags); -} /* }}} */ - -/* {{{ proto void SplFileObject::setMaxLineLen(int max_len) - Set maximum line length */ -SPL_METHOD(SplFileObject, setMaxLineLen) -{ - long max_len; - - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) { - return; - } - - if (max_len < 0) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_DomainException), 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero"); - return; - } - - intern->u.file.max_line_len = max_len; -} /* }}} */ - -/* {{{ proto int SplFileObject::getMaxLineLen() - Get maximum line length */ -SPL_METHOD(SplFileObject, getMaxLineLen) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG((long)intern->u.file.max_line_len); -} /* }}} */ - -/* {{{ proto bool SplFileObject>>hasChildren() - Rturn false */ -SPL_METHOD(SplFileObject, hasChildren) -{ - RETURN_FALSE; -} /* }}} */ - -/* {{{ proto bool SplFileObject::getChildren() - Read NULL */ -SPL_METHOD(SplFileObject, getChildren) -{ - /* return NULL */ -} /* }}} */ - -static int spl_filesystem_file_call(INTERNAL_FUNCTION_PARAMETERS, spl_filesystem_object *intern, zend_function *func_ptr, zval *arg2) /* {{{ */ -{ - zend_fcall_info fci; - zend_fcall_info_cache fcic; - zval z_fname; - zval * zresource_ptr = &intern->u.file.zresource, *retval; - int result; - - zval ***params = (zval***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval**), (arg2 ? 2 : 1) * sizeof(zval**)); - - params[0] = &zresource_ptr; - - if (arg2) { - params[1] = &arg2; - } - - zend_get_parameters_array_ex(ZEND_NUM_ARGS(), params+(arg2 ? 2 : 1)); - - ZVAL_STRING(&z_fname, func_ptr->common.function_name, 0); - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.object_pp = NULL; - fci.function_name = &z_fname; - fci.retval_ptr_ptr = &retval; - fci.param_count = ZEND_NUM_ARGS() + (arg2 ? 2 : 1); - fci.params = params; - fci.no_separation = 1; - fci.symbol_table = NULL; - - fcic.initialized = 1; - fcic.function_handler = func_ptr; - fcic.calling_scope = NULL; - fcic.object_pp = NULL; - - result = zend_call_function(&fci, &fcic TSRMLS_CC); - - ZVAL_ZVAL(return_value, retval, 1, 1); - - efree(params); - return result; -} /* }}} */ - -#define FileFunctionCall(func_name, arg2) \ -{ \ - zend_function *func_ptr; \ - zend_hash_find(EG(function_table), #func_name, sizeof(#func_name), (void **) &func_ptr); \ - spl_filesystem_file_call(INTERNAL_FUNCTION_PARAM_PASSTHRU, intern, func_ptr, arg2); \ -} - -/* {{{ FileFunction */ -#define FileFunction(func_name) \ -SPL_METHOD(SplFileObject, func_name) \ -{ \ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \ - FileFunctionCall(func_name, NULL); \ -} -/* }}} */ - -/* {{{ proto array SplFileObject::fgetcsv([string delimiter [, string enclosure]]) - Return current line as csv */ -SPL_METHOD(SplFileObject, fgetcsv) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zval *arg2 = NULL; - MAKE_STD_ZVAL(arg2); - ZVAL_LONG(arg2, intern->u.file.max_line_len); - - spl_filesystem_file_free_line(intern TSRMLS_CC); - intern->u.file.current_line_num++; - - FileFunctionCall(fgetcsv, arg2); - - zval_ptr_dtor(&arg2); -} -/* }}} */ - -/* {{{ proto bool SplFileObject::flock(int operation [, int &wouldblock]) - Portable file locking */ -FileFunction(flock) -/* }}} */ - -/* {{{ proto bool SplFileObject::fflush() - Flush the file */ -SPL_METHOD(SplFileObject, fflush) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(!php_stream_flush(intern->u.file.stream)); -} /* }}} */ - - -/* {{{ proto int SplFileObject::ftell() - Return current file position */ -SPL_METHOD(SplFileObject, ftell) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long ret = php_stream_tell(intern->u.file.stream); - - if (ret == -1) { - RETURN_FALSE; - } else { - RETURN_LONG(ret); - } -} /* }}} */ - -/* {{{ proto int SplFileObject::fseek(int pos [, int whence = SEEK_SET]) - Return current file position */ -SPL_METHOD(SplFileObject, fseek) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long pos, whence = SEEK_SET; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &pos, &whence) == FAILURE) { - return; - } - - spl_filesystem_file_free_line(intern TSRMLS_CC); - RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, whence)); -} /* }}} */ - -/* {{{ proto int SplFileObject::fgetc() - Get a character form the file */ -SPL_METHOD(SplFileObject, fgetc) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char buf[2]; - int result; - - spl_filesystem_file_free_line(intern TSRMLS_CC); - - result = php_stream_getc(intern->u.file.stream); - - if (result == EOF) { - RETVAL_FALSE; - } else { - if (result == '\n') { - intern->u.file.current_line_num++; - } - buf[0] = result; - buf[1] = '\0'; - - RETURN_STRINGL(buf, 1, 1); - } -} /* }}} */ - -/* {{{ proto string SplFileObject::fgetss([string allowable_tags]) - Get a line from file pointer and strip HTML tags */ -SPL_METHOD(SplFileObject, fgetss) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zval *arg2 = NULL; - MAKE_STD_ZVAL(arg2); - ZVAL_LONG(arg2, intern->u.file.max_line_len); - - spl_filesystem_file_free_line(intern TSRMLS_CC); - intern->u.file.current_line_num++; - - FileFunctionCall(fgetss, arg2); - - zval_ptr_dtor(&arg2); -} /* }}} */ - -/* {{{ proto int SplFileObject::fpassthru() - Output all remaining data from a file pointer */ -SPL_METHOD(SplFileObject, fpassthru) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(php_stream_passthru(intern->u.file.stream)); -} /* }}} */ - -/* {{{ proto bool SplFileObject::fscanf(string format [, string ...]) - Implements a mostly ANSI compatible fscanf() */ -SPL_METHOD(SplFileObject, fscanf) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_filesystem_file_free_line(intern TSRMLS_CC); - intern->u.file.current_line_num++; - - FileFunctionCall(fscanf, NULL); -} -/* }}} */ - -/* {{{ proto mixed SplFileObject::fwrite(string str [, int length]) - Binary-safe file write */ -SPL_METHOD(SplFileObject, fwrite) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char *str; - int str_len; - int ret; - long length; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() < 2) { - str_len = MAX(0, MIN(length, str_len)); - } - if (!str_len) { - RETURN_LONG(0); - } - - if (PG(magic_quotes_runtime)) { - str = estrndup(str, str_len); - php_stripslashes(str, &str_len TSRMLS_CC); - ret = php_stream_write(intern->u.file.stream, str, str_len); - efree(str); - RETURN_LONG(ret); - } - - RETURN_LONG(php_stream_write(intern->u.file.stream, str, str_len)); -} /* }}} */ - -/* {{{ proto bool SplFileObject::fstat() - Stat() on a filehandle */ -FileFunction(fstat) -/* }}} */ - -/* {{{ proto bool SplFileObject::ftruncate(int size) - Truncate file to 'size' length */ -SPL_METHOD(SplFileObject, ftruncate) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long size; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) { - return; - } - - if (!php_stream_truncate_supported(intern->u.file.stream)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name); - RETURN_FALSE; - } - - RETURN_BOOL(0 == php_stream_truncate_set_size(intern->u.file.stream, size)); -} /* }}} */ - -/* {{{ proto void SplFileObject::seek(int line_pos) - Seek to specified line */ -SPL_METHOD(SplFileObject, seek) -{ - spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long line_pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_pos) == FAILURE) { - return; - } - if (line_pos < 0) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Can't seek file %s to negative line %ld", intern->file_name, line_pos); - RETURN_FALSE; - } - - spl_filesystem_file_rewind(intern TSRMLS_CC); - - while(intern->u.file.current_line_num < line_pos) { - spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC); - } -} - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object___construct, 0, 0, 1) - ZEND_ARG_INFO(0, file_name) - ZEND_ARG_INFO(0, open_mode) - ZEND_ARG_INFO(0, use_include_path) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_file_object_setFlags, 0) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_file_object_setMaxLineLen, 0) - ZEND_ARG_INFO(0, max_len) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetcsv, 0, 0, 0) - ZEND_ARG_INFO(0, delimiter) - ZEND_ARG_INFO(0, enclosure) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_flock, 0, 0, 1) - ZEND_ARG_INFO(0, operation) - ZEND_ARG_INFO(1, wouldblock]) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fseek, 0, 0, 1) - ZEND_ARG_INFO(0, pos) - ZEND_ARG_INFO(0, whence) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetss, 0, 0, 0) - ZEND_ARG_INFO(0, allowable_tags) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) - ZEND_ARG_INFO(0, format) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fwrite, 0, 0, 1) - ZEND_ARG_INFO(0, str) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_ftruncate, 0, 0, 1) - ZEND_ARG_INFO(0, size) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_seek, 0, 0, 1) - ZEND_ARG_INFO(0, line_pos) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_filesystem_file_class_functions[] = { - SPL_ME(SplFileObject, __construct, arginfo_file_object___construct, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, getFilename, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, eof, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fgets, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fgetcsv, arginfo_file_object_fgetcsv, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, flock, arginfo_file_object_flock, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fflush, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, ftell, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fseek, arginfo_file_object_fseek, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fgetc, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fpassthru, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fgetss, arginfo_file_object_fgetss, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fscanf, arginfo_file_object_fscanf, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fwrite, arginfo_file_object_fwrite, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, fstat, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, ftruncate, arginfo_file_object_ftruncate, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, setFlags, arginfo_file_object_setFlags, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, getFlags, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, setMaxLineLen, arginfo_file_object_setMaxLineLen, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, getMaxLineLen, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, getChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SplFileObject, seek, arginfo_file_object_seek, ZEND_ACC_PUBLIC) - // mappings - SPL_MA(SplFileObject, getCurrentLine, SplFileObject, fgets, NULL, ZEND_ACC_PUBLIC) - SPL_MA(SplFileObject, __toString, SplFileObject, current, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION(spl_directory) - */ -PHP_MINIT_FUNCTION(spl_directory) -{ - REGISTER_SPL_STD_CLASS_EX(SplFileInfo, spl_filesystem_object_new, spl_filesystem_info_class_functions); - memcpy(&spl_filesystem_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - spl_filesystem_object_handlers.clone_obj = spl_filesystem_object_clone; - spl_filesystem_object_handlers.cast_object = spl_filesystem_object_cast; - - REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_filesystem_dir_class_functions); - zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, zend_ce_iterator); - - spl_ce_DirectoryIterator->get_iterator = spl_filesystem_dir_get_iterator; - - REGISTER_SPL_SUB_CLASS_EX(RecursiveDirectoryIterator, DirectoryIterator, spl_filesystem_object_new, spl_filesystem_tree_class_functions); - REGISTER_SPL_IMPLEMENTS(RecursiveDirectoryIterator, RecursiveIterator); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, "CURRENT_AS_FILEINFO", SPL_FILE_DIR_CURRENT_AS_FILEINFO); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, "KEY_AS_FILENAME", SPL_FILE_DIR_KEY_AS_FILENAME); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, "NEW_CURRENT_AND_KEY", SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO); - - spl_ce_RecursiveDirectoryIterator->get_iterator = spl_filesystem_tree_get_iterator; - - REGISTER_SPL_SUB_CLASS_EX(SplFileObject, SplFileInfo, spl_filesystem_object_new, spl_filesystem_file_class_functions); - REGISTER_SPL_IMPLEMENTS(SplFileObject, RecursiveIterator); - REGISTER_SPL_IMPLEMENTS(SplFileObject, SeekableIterator); - - REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "DROP_NEW_LINE", SPL_FILE_OBJECT_DROP_NEW_LINE); - - return SUCCESS; -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h deleted file mode 100755 index 998fec139db01..0000000000000 --- a/ext/spl/spl_directory.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_DIRECTORY_H -#define SPL_DIRECTORY_H - -#include "php.h" -#include "php_spl.h" - -extern PHPAPI zend_class_entry *spl_ce_SplFileInfo; -extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator; -extern PHPAPI zend_class_entry *spl_ce_SplFileObject; - -PHP_MINIT_FUNCTION(spl_directory); - -typedef enum { - SPL_FS_INFO, - SPL_FS_DIR, - SPL_FS_FILE, -} SPL_FS_OBJ_TYPE; - -typedef struct _spl_filesystem_object { - zend_object std; - char *path; - int path_len; - char *file_name; - int file_name_len; - SPL_FS_OBJ_TYPE type; - long flags; - union { - struct { - php_stream *dirp; - php_stream_dirent entry; - char *sub_path; - int sub_path_len; - int index; - int is_recursive; - } dir; - struct { - php_stream *stream; - php_stream_context *context; - zval *zcontext; - char *open_mode; - int open_mode_len; - zval *current_zval; - char *current_line; - size_t current_line_len; - size_t max_line_len; - long current_line_num; - zval zresource; - zend_function *func_getCurr; - } file; - } u; -} spl_filesystem_object; - -#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */ -#define SPL_FILE_DIR_CURRENT_AS_FILEINFO 0x00000010 /* make RecursiveDirectoryTree::current() return SplFileInfo */ -#define SPL_FILE_DIR_KEY_AS_FILENAME 0x00000020 /* make RecursiveDirectoryTree::key() return getFilename() */ - -#endif /* SPL_DIRECTORY_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c deleted file mode 100755 index 43d39d17e1239..0000000000000 --- a/ext/spl/spl_engine.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_interfaces.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" - -#include "spl_array.h" - -/* {{{ spl_instantiate */ -void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC) -{ - if (alloc) { - ALLOC_ZVAL(*object); - } - object_init_ex(*object, pce); - (*object)->refcount = 1; - (*object)->is_ref = 1; /* check if this can be hold always */ -} -/* }}} */ - -/* {{{ spl_is_instance_of */ -int spl_is_instance_of(zval **obj, zend_class_entry *ce TSRMLS_DC) -{ - /* Ensure everything needed is available before checking for the type. - */ - zend_class_entry *instance_ce; - - if (obj && (instance_ce = spl_get_class_entry(*obj TSRMLS_CC)) != NULL) { - return instanceof_function(instance_ce, ce TSRMLS_CC); - } - return 0; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h deleted file mode 100755 index 74554503036c7..0000000000000 --- a/ext/spl/spl_engine.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_ENGINE_H -#define SPL_ENGINE_H - -#include "php.h" -#include "php_spl.h" -#include "zend_interfaces.h" - -/* {{{ zend_class_entry */ -static inline zend_class_entry *spl_get_class_entry(zval *obj TSRMLS_DC) -{ - if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_class_entry) { - return Z_OBJ_HT_P(obj)->get_class_entry(obj TSRMLS_CC); - } else { - return NULL; - } -} -/* }}} */ - -void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC); - -/* {{{ spl_instantiate_arg_ex1 */ -static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC) -{ - spl_instantiate(pce, retval, alloc TSRMLS_CC); - - zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC); - return 0; -} -/* }}} */ - -/* {{{ spl_instantiate_arg_ex2 */ -static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC) -{ - spl_instantiate(pce, retval, alloc TSRMLS_CC); - - zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC); - return 0; -} -/* }}} */ - -int spl_is_instance_of(zval **obj, zend_class_entry *ce TSRMLS_DC); - -#endif /* SPL_ENGINE_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c deleted file mode 100755 index 1e9584a60b33e..0000000000000 --- a/ext/spl/spl_exceptions.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_exceptions.h" - -PHPAPI zend_class_entry *spl_ce_LogicException; -PHPAPI zend_class_entry *spl_ce_BadFunctionCallException; -PHPAPI zend_class_entry *spl_ce_BadMethodCallException; -PHPAPI zend_class_entry *spl_ce_DomainException; -PHPAPI zend_class_entry *spl_ce_InvalidArgumentException; -PHPAPI zend_class_entry *spl_ce_LengthException; -PHPAPI zend_class_entry *spl_ce_OutOfRangeException; -PHPAPI zend_class_entry *spl_ce_RuntimeException; -PHPAPI zend_class_entry *spl_ce_OutOfBoundsException; -PHPAPI zend_class_entry *spl_ce_OverflowException; -PHPAPI zend_class_entry *spl_ce_RangeException; -PHPAPI zend_class_entry *spl_ce_UnderflowException; -PHPAPI zend_class_entry *spl_ce_UnexpectedValueException; - -#define spl_ce_Exception zend_exception_get_default(TSRMLS_C) - -/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */ -PHP_MINIT_FUNCTION(spl_exceptions) -{ - REGISTER_SPL_SUB_CLASS_EX(LogicException, Exception, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(BadFunctionCallException, LogicException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(BadMethodCallException, BadFunctionCallException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(DomainException, LogicException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(InvalidArgumentException, LogicException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(LengthException, LogicException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(OutOfRangeException, LogicException, NULL, NULL); - - REGISTER_SPL_SUB_CLASS_EX(RuntimeException, Exception, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(OutOfBoundsException, RuntimeException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(OverflowException, RuntimeException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(RangeException, RuntimeException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(UnderflowException, RuntimeException, NULL, NULL); - REGISTER_SPL_SUB_CLASS_EX(UnexpectedValueException, RuntimeException, NULL, NULL); - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h deleted file mode 100755 index bd1b28bc781af..0000000000000 --- a/ext/spl/spl_exceptions.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_EXCEPTIONS_H -#define SPL_EXCEPTIONS_H - -#include "php.h" -#include "php_spl.h" - -extern PHPAPI zend_class_entry *spl_ce_LogicException; -extern PHPAPI zend_class_entry *spl_ce_BadFunctionCallException; -extern PHPAPI zend_class_entry *spl_ce_BadMethodCallException; -extern PHPAPI zend_class_entry *spl_ce_DomainException; -extern PHPAPI zend_class_entry *spl_ce_InvalidArgumentException; -extern PHPAPI zend_class_entry *spl_ce_LengthException; -extern PHPAPI zend_class_entry *spl_ce_OutOfRangeException; - -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -extern PHPAPI zend_class_entry *spl_ce_OutOfBoundsException; -extern PHPAPI zend_class_entry *spl_ce_OverflowException; -extern PHPAPI zend_class_entry *spl_ce_RangeException; -extern PHPAPI zend_class_entry *spl_ce_UnderflowException; -extern PHPAPI zend_class_entry *spl_ce_UnexpectedValueException; - -PHP_MINIT_FUNCTION(spl_exceptions); - -#endif /* SPL_EXCEPTIONS_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c deleted file mode 100755 index 56e0825440141..0000000000000 --- a/ext/spl/spl_functions.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H - #include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_spl.h" - -/* {{{ spl_destroy_class */ -void spl_destroy_class(zend_class_entry ** ppce) -{ - SPL_DEBUG(fprintf(stderr, "Destroy(%s): %s\n", (*ppce)->type == ZEND_USER_CLASS ? "user" : "other", (*ppce)->name);) - destroy_zend_class(ppce); -} -/* }}} */ - -/* {{{ spl_register_interface */ -void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_function_entry *functions TSRMLS_DC) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, class_name, functions); - ce.name_length = strlen(class_name); - *ppce = zend_register_internal_class(&ce TSRMLS_CC); - - /* entries changed by initialize */ - (*ppce)->ce_flags = ZEND_ACC_INTERFACE; -} -/* }}} */ - -/* {{{ spl_register_std_class */ -void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, function_entry * function_list TSRMLS_DC) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, class_name, function_list); - ce.name_length = strlen(class_name); - *ppce = zend_register_internal_class(&ce TSRMLS_CC); - - /* entries changed by initialize */ - if (obj_ctor) { - (*ppce)->create_object = obj_ctor; - } -} -/* }}} */ - -/* {{{ spl_register_sub_class */ -void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, function_entry * function_list TSRMLS_DC) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, class_name, function_list); - ce.name_length = strlen(class_name); - *ppce = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); - - /* entries changed by initialize */ - if (obj_ctor) { - (*ppce)->create_object = obj_ctor; - } else { - (*ppce)->create_object = parent_ce->create_object; - } -} -/* }}} */ - -/* {{{ spl_register_parent_ce */ -void spl_register_parent_ce(zend_class_entry * class_entry, zend_class_entry * parent_class TSRMLS_DC) -{ - class_entry->parent = parent_class; -} -/* }}} */ - -/* {{{ spl_register_functions */ -void spl_register_functions(zend_class_entry * class_entry, function_entry * function_list TSRMLS_DC) -{ - zend_register_functions(class_entry, function_list, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC); -} -/* }}} */ - -/* {{{ spl_register_property */ -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC) -{ - if (!prop_val) { - INIT_PZVAL(prop_val); - prop_val->type = IS_NULL; - } - - zend_declare_property(class_entry, prop_name, strlen(prop_name), prop_val, prop_flags TSRMLS_CC); -} -/* }}} */ - -/* {{{ spl_add_class_name */ -void spl_add_class_name(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC) -{ - if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) { - size_t len = pce->name_length; - zval *tmp; - zend_uchar ztype = UG(unicode)?IS_UNICODE:IS_STRING; - - if (zend_u_hash_find(Z_ARRVAL_P(list), ztype, pce->name, len+1, (void*)&tmp) == FAILURE) { - MAKE_STD_ZVAL(tmp); - ZVAL_TEXTL(tmp, pce->name, pce->name_length, 1); - zend_u_hash_add(Z_ARRVAL_P(list), ztype, pce->name, len+1, &tmp, sizeof(zval *), NULL); - } - } -} -/* }}} */ - -/* {{{ spl_add_interfaces */ -void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC) -{ - zend_uint num_interfaces; - - for (num_interfaces = 0; num_interfaces < pce->num_interfaces; num_interfaces++) { - spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ spl_add_classes */ -int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC) -{ - if (!pce) { - return 0; - } - spl_add_class_name(list, pce, allow, ce_flags TSRMLS_CC); - if (sub) { - spl_add_interfaces(list, pce, allow, ce_flags TSRMLS_CC); - while (pce->parent) { - pce = pce->parent; - spl_add_classes(pce, list, sub, allow, ce_flags TSRMLS_CC); - } - } - return 0; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h deleted file mode 100755 index 2cbaedbeaa34a..0000000000000 --- a/ext/spl/spl_functions.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_FUNCTIONS_H -#define PHP_FUNCTIONS_H - -#include "php.h" - -typedef zend_object_value (*create_object_func_t)(zend_class_entry *class_type TSRMLS_DC); - -#define REGISTER_SPL_STD_CLASS(class_name, obj_ctor) \ - spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL TSRMLS_CC); - -#define REGISTER_SPL_STD_CLASS_EX(class_name, obj_ctor, funcs) \ - spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs TSRMLS_CC); - -#define REGISTER_SPL_SUB_CLASS_EX(class_name, parent_class_name, obj_ctor, funcs) \ - spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs TSRMLS_CC); - -#define REGISTER_SPL_INTERFACE(class_name) \ - spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name TSRMLS_CC); - -#define REGISTER_SPL_PARENT_CE(class_name, parent_class) \ - spl_register_parent_ce(spl_ce_ ## class_name, spl_ce_ ## parent_class TSRMLS_CC); - -#define REGISTER_SPL_IMPLEMENTS(class_name, interface_name) \ - zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, spl_ce_ ## interface_name); - -#define REGISTER_SPL_ITERATOR(class_name) \ - zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, zend_ce_iterator); - -#define REGISTER_SPL_FUNCTIONS(class_name, function_list) \ - spl_register_functions(spl_ce_ ## class_name, function_list TSRMLS_CC); - -#define REGISTER_SPL_PROPERTY(class_name, prop_name) \ - spl_register_property(spl_ce_ ## class_name, prop_name, prop_val, prop_flags TSRMLS_CC); - -#define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \ - zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); - -void spl_destroy_class(zend_class_entry ** ppce); - -void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, function_entry * function_list TSRMLS_DC); -void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, function_entry * function_list TSRMLS_DC); - -void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_function_entry *functions TSRMLS_DC); - -void spl_register_parent_ce(zend_class_entry * class_entry, zend_class_entry * parent_class TSRMLS_DC); -void spl_register_functions(zend_class_entry * class_entry, function_entry * function_list TSRMLS_DC); -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC); - -/* sub: whether to allow subclasses/interfaces - allow = 0: allow all classes and interfaces - allow > 0: allow all that match and mask ce_flags - allow < 0: disallow all that match and mask ce_flags - */ -void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC); -void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC); -int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC); - -#define SPL_ME(class_name, function_name, arg_info, flags) \ - PHP_ME( spl_ ## class_name, function_name, arg_info, flags) - -#define SPL_ABSTRACT_ME(class_name, function_name, arg_info) \ - ZEND_ABSTRACT_ME( spl_ ## class_name, function_name, arg_info) - -#define SPL_METHOD(class_name, function_name) \ - PHP_METHOD(spl_ ## class_name, function_name) - -#define SPL_MA(class_name, function_name, alias_class, alias_function, arg_info, flags) \ - PHP_MALIAS(spl_ ## alias_class, function_name, alias_function, arg_info, flags) -#endif /* PHP_FUNCTIONS_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c deleted file mode 100755 index 373cf7d1493c4..0000000000000 --- a/ext/spl/spl_iterators.c +++ /dev/null @@ -1,2461 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_exceptions.h" -#include "zend_interfaces.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_iterators.h" -#include "spl_directory.h" -#include "spl_array.h" -#include "spl_exceptions.h" - -#define INLINE inline - -PHPAPI zend_class_entry *spl_ce_RecursiveIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator; -PHPAPI zend_class_entry *spl_ce_FilterIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveFilterIterator; -PHPAPI zend_class_entry *spl_ce_ParentIterator; -PHPAPI zend_class_entry *spl_ce_SeekableIterator; -PHPAPI zend_class_entry *spl_ce_LimitIterator; -PHPAPI zend_class_entry *spl_ce_CachingIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveCachingIterator; -PHPAPI zend_class_entry *spl_ce_OuterIterator; -PHPAPI zend_class_entry *spl_ce_IteratorIterator; -PHPAPI zend_class_entry *spl_ce_NoRewindIterator; -PHPAPI zend_class_entry *spl_ce_InfiniteIterator; -PHPAPI zend_class_entry *spl_ce_EmptyIterator; -PHPAPI zend_class_entry *spl_ce_AppendIterator; -PHPAPI zend_class_entry *spl_ce_RegExIterator; -PHPAPI zend_class_entry *spl_ce_RecursiveRegExIterator; - -function_entry spl_funcs_RecursiveIterator[] = { - SPL_ABSTRACT_ME(RecursiveIterator, hasChildren, NULL) - SPL_ABSTRACT_ME(RecursiveIterator, getChildren, NULL) - {NULL, NULL, NULL} -}; - -typedef enum { - RIT_LEAVES_ONLY = 0, - RIT_SELF_FIRST = 1, - RIT_CHILD_FIRST = 2 -} RecursiveIteratorMode; - -#define RIT_CATCH_GET_CHILD CIT_CATCH_GET_CHILD - -typedef enum { - RS_NEXT = 0, - RS_TEST = 1, - RS_SELF = 2, - RS_CHILD = 3, - RS_START = 4 -} RecursiveIteratorState; - -typedef struct _spl_sub_iterator { - zend_object_iterator *iterator; - zval *zobject; - zend_class_entry *ce; - RecursiveIteratorState state; -} spl_sub_iterator; - -typedef struct _spl_recursive_it_object { - zend_object std; - spl_sub_iterator *iterators; - int level; - RecursiveIteratorMode mode; - int flags; - int max_depth; - zend_bool in_iteration; - zend_function *beginIteration; - zend_function *endIteration; - zend_function *callHasChildren; - zend_function *callGetChildren; - zend_function *beginChildren; - zend_function *endChildren; - zend_function *nextElement; - zend_class_entry *ce; -} spl_recursive_it_object; - -typedef struct _spl_recursive_it_iterator { - zend_object_iterator intern; - zval *zobject; -} spl_recursive_it_iterator; - -static zend_object_handlers spl_handlers_rec_it_it; -static zend_object_handlers spl_handlers_dual_it; - -static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC) -{ - spl_recursive_it_iterator *iter = (spl_recursive_it_iterator*)_iter; - spl_recursive_it_object *object = (spl_recursive_it_object*)_iter->data; - zend_object_iterator *sub_iter; - - while (object->level) { - sub_iter = object->iterators[object->level].iterator; - sub_iter->funcs->dtor(sub_iter TSRMLS_CC); - zval_ptr_dtor(&object->iterators[object->level--].zobject); - } - object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator)); - object->level = 0; - - zval_ptr_dtor(&iter->zobject); - efree(iter); -} - -static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) -{ - zend_object_iterator *sub_iter; - int level = object->level; - - while (level >=0) { - sub_iter = object->iterators[level].iterator; - if (sub_iter->funcs->valid(sub_iter TSRMLS_CC) == SUCCESS) { - return SUCCESS; - } - level--; - } - if (object->endIteration && object->in_iteration) { - zend_call_method_with_0_params(&zthis, object->ce, &object->endIteration, "endIteration", NULL); - } - object->in_iteration = 0; - return FAILURE; -} - -static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data; - - return spl_recursive_it_valid_ex(object, ((spl_recursive_it_iterator*)iter)->zobject TSRMLS_CC); -} - -static void spl_recursive_it_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data; - zend_object_iterator *sub_iter = object->iterators[object->level].iterator; - - sub_iter->funcs->get_current_data(sub_iter, data TSRMLS_CC); -} - -static int spl_recursive_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data; - zend_object_iterator *sub_iter = object->iterators[object->level].iterator; - - if (sub_iter->funcs->get_current_key) { - return sub_iter->funcs->get_current_key(sub_iter, str_key, str_key_len, int_key TSRMLS_CC); - } else { - *int_key = iter->index; - return HASH_KEY_IS_LONG; - } -} - -static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) -{ - zend_object_iterator *iterator; - zval *zobject; - zend_class_entry *ce; - zval *retval, *child; - zend_object_iterator *sub_iter; - int has_children; - - while (!EG(exception)) { -next_step: - iterator = object->iterators[object->level].iterator; - switch (object->iterators[object->level].state) { - case RS_NEXT: - iterator->funcs->move_forward(iterator TSRMLS_CC); - case RS_START: - if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) { - break; - } - object->iterators[object->level].state = RS_TEST; - /* break; */ - case RS_TEST: - ce = object->iterators[object->level].ce; - zobject = object->iterators[object->level].zobject; - if (object->callHasChildren) { - zend_call_method_with_0_params(&zthis, object->ce, &object->callHasChildren, "callHasChildren", &retval); - } else { - zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval); - } - if (retval) { - has_children = zend_is_true(retval); - zval_ptr_dtor(&retval); - if (has_children) { - if (object->max_depth == -1 || object->max_depth > object->level) { - switch (object->mode) { - case RIT_LEAVES_ONLY: - case RIT_CHILD_FIRST: - object->iterators[object->level].state = RS_CHILD; - goto next_step; - case RIT_SELF_FIRST: - object->iterators[object->level].state = RS_SELF; - goto next_step; - } - } else { - /* do not recurse into */ - if (object->mode == RIT_LEAVES_ONLY) { - /* this is not a leave, so skip it */ - object->iterators[object->level].state = RS_NEXT; - goto next_step; - } - } - } - } - if (object->nextElement) { - zend_call_method_with_0_params(&zthis, object->ce, &object->nextElement, "nextelement", NULL); - } - object->iterators[object->level].state = RS_NEXT; - return /* self */; - case RS_SELF: - if (object->nextElement && (object->mode == RIT_SELF_FIRST || object->mode == RIT_CHILD_FIRST)) { - zend_call_method_with_0_params(&zthis, object->ce, &object->nextElement, "nextelement", NULL); - } - if (object->mode == RIT_SELF_FIRST) { - object->iterators[object->level].state = RS_CHILD; - } else { - object->iterators[object->level].state = RS_NEXT; - } - return /* self */; - case RS_CHILD: - ce = object->iterators[object->level].ce; - zobject = object->iterators[object->level].zobject; - if (object->callGetChildren) { - zend_call_method_with_0_params(&zthis, object->ce, &object->callGetChildren, "callGetChildren", &child); - } else { - zend_call_method_with_0_params(&zobject, ce, NULL, "getchildren", &child); - } - - if (EG(exception)) { - if (!(object->flags & RIT_CATCH_GET_CHILD)) { - return; - } else { - zend_clear_exception(TSRMLS_C); - if (child) { - zval_ptr_dtor(&child); - } - object->iterators[object->level].state = RS_NEXT; - goto next_step; - } - } - - ce = child && Z_TYPE_P(child) == IS_OBJECT ? Z_OBJCE_P(child) : NULL; - if (!ce || !instanceof_function(ce, U_CLASS_ENTRY(spl_ce_RecursiveIterator) TSRMLS_CC)) { - if (child) { - zval_ptr_dtor(&child); - } - zend_throw_exception(U_CLASS_ENTRY(spl_ce_UnexpectedValueException), "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC); - return; - } - if (object->mode == RIT_CHILD_FIRST) { - object->iterators[object->level].state = RS_SELF; - } else { - object->iterators[object->level].state = RS_NEXT; - } - object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator) * (++object->level+1)); - sub_iter = ce->get_iterator(ce, child TSRMLS_CC); - object->iterators[object->level].iterator = sub_iter; - object->iterators[object->level].zobject = child; - object->iterators[object->level].ce = ce; - object->iterators[object->level].state = RS_START; - if (sub_iter->funcs->rewind) { - sub_iter->funcs->rewind(sub_iter TSRMLS_CC); - } - if (object->beginChildren) { - zend_call_method_with_0_params(&zthis, object->ce, &object->beginChildren, "beginchildren", NULL); - } - goto next_step; - } - /* no more elements */ - if (object->level > 0) { - if (object->endChildren) { - zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL); - } - iterator->funcs->dtor(iterator TSRMLS_CC); - zval_ptr_dtor(&object->iterators[object->level].zobject); - object->level--; - } else { - return; /* done completeley */ - } - } -} - -static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) -{ - zend_object_iterator *sub_iter; - - while (object->level) { - sub_iter = object->iterators[object->level].iterator; - sub_iter->funcs->dtor(sub_iter TSRMLS_CC); - zval_ptr_dtor(&object->iterators[object->level--].zobject); - if (!object->endChildren || object->endChildren->common.scope != U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL); - } - } - erealloc(object->iterators, sizeof(spl_sub_iterator)); - object->iterators[0].state = RS_START; - sub_iter = object->iterators[0].iterator; - if (sub_iter->funcs->rewind) { - sub_iter->funcs->rewind(sub_iter TSRMLS_CC); - } - if (object->beginIteration && !object->in_iteration) { - zend_call_method_with_0_params(&zthis, object->ce, &object->beginIteration, "beginIteration", NULL); - } - object->in_iteration = 1; - spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC); -} - -static void spl_recursive_it_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - spl_recursive_it_move_forward_ex((spl_recursive_it_object*)iter->data, ((spl_recursive_it_iterator*)iter)->zobject TSRMLS_CC); -} - -static void spl_recursive_it_rewind(zend_object_iterator *iter TSRMLS_DC) -{ - spl_recursive_it_rewind_ex((spl_recursive_it_object*)iter->data, ((spl_recursive_it_iterator*)iter)->zobject TSRMLS_CC); -} - -static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject TSRMLS_DC) -{ - spl_recursive_it_iterator *iterator = emalloc(sizeof(spl_recursive_it_iterator)); - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(zobject TSRMLS_CC); - - zobject->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = ce->iterator_funcs.funcs; - iterator->zobject = zobject; - return (zend_object_iterator*)iterator; -} - -zend_object_iterator_funcs spl_recursive_it_iterator_funcs = { - spl_recursive_it_dtor, - spl_recursive_it_valid, - spl_recursive_it_get_current_data, - spl_recursive_it_get_current_key, - spl_recursive_it_move_forward, - spl_recursive_it_rewind -}; - -/* {{{ proto RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException - Creates a RecursiveIteratorIterator from a RecursiveIterator. */ -SPL_METHOD(RecursiveIteratorIterator, __construct) -{ - zval *object = getThis(); - spl_recursive_it_object *intern; - zval *iterator; - zend_class_entry *ce_iterator; - long mode = RIT_LEAVES_ONLY, flags = 0; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) { - if (instanceof_function(Z_OBJCE_P(iterator), U_CLASS_ENTRY(zend_ce_aggregate) TSRMLS_CC)) { - zval *aggregate = iterator; - zend_call_method_with_0_params(&aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", &iterator); - } - } else { - iterator = NULL; - } - if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), U_CLASS_ENTRY(spl_ce_RecursiveIterator) TSRMLS_CC)) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC); - return; - } - - intern = (spl_recursive_it_object*)zend_object_store_get_object(object TSRMLS_CC); - intern->iterators = emalloc(sizeof(spl_sub_iterator)); - intern->level = 0; - intern->mode = mode; - intern->flags = flags; - intern->max_depth = -1; - intern->in_iteration = 0; - intern->ce = Z_OBJCE_P(object); - - zend_hash_find(&intern->ce->function_table, "beginiteration", sizeof("beginiteration"), (void **) &intern->beginIteration); - if (intern->beginIteration->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->beginIteration = NULL; - } - zend_hash_find(&intern->ce->function_table, "enditeration", sizeof("enditeration"), (void **) &intern->endIteration); - if (intern->endIteration->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->endIteration = NULL; - } - zend_hash_find(&intern->ce->function_table, "callhaschildren", sizeof("callHasChildren"), (void **) &intern->callHasChildren); - if (intern->callHasChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->callHasChildren = NULL; - } - zend_hash_find(&intern->ce->function_table, "callgetchildren", sizeof("callGetChildren"), (void **) &intern->callGetChildren); - if (intern->callGetChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->callGetChildren = NULL; - } - zend_hash_find(&intern->ce->function_table, "beginchildren", sizeof("beginchildren"), (void **) &intern->beginChildren); - if (intern->beginChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->beginChildren = NULL; - } - zend_hash_find(&intern->ce->function_table, "endchildren", sizeof("endchildren"), (void **) &intern->endChildren); - if (intern->endChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->endChildren = NULL; - } - zend_hash_find(&intern->ce->function_table, "nextelement", sizeof("nextElement"), (void **) &intern->nextElement); - if (intern->nextElement->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) { - intern->nextElement = NULL; - } - ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */ - intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator TSRMLS_CC); - iterator->refcount++; - intern->iterators[0].zobject = iterator; - intern->iterators[0].ce = ce_iterator; - intern->iterators[0].state = RS_START; - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} /* }}} */ - -/* {{{ proto void RecursiveIteratorIterator::rewind() - Rewind the iterator to the first element of the top level inner iterator. */ -SPL_METHOD(RecursiveIteratorIterator, rewind) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC); -} /* }}} */ - -/* {{{ proto bolean RecursiveIteratorIterator::valid() - Check whether the current position is valid */ -SPL_METHOD(RecursiveIteratorIterator, valid) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis() TSRMLS_CC) == SUCCESS); -} /* }}} */ - -/* {{{ proto mixed RecursiveIteratorIterator::key() - Access the current key */ -SPL_METHOD(RecursiveIteratorIterator, key) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zend_object_iterator *iterator = object->iterators[object->level].iterator; - - if (iterator->funcs->get_current_key) { - char *str_key; - uint str_key_len; - ulong int_key; - if (iterator->funcs->get_current_key(iterator, &str_key, &str_key_len, &int_key TSRMLS_CC) == HASH_KEY_IS_LONG) { - RETURN_LONG(int_key); - } else { - RETURN_STRINGL(str_key, str_key_len-1, 0); - } - } else { - RETURN_NULL(); - } -} /* }}} */ - -/* {{{ proto mixed RecursiveIteratorIterator::current() - Access the current element value */ -SPL_METHOD(RecursiveIteratorIterator, current) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zend_object_iterator *iterator = object->iterators[object->level].iterator; - zval **data; - - iterator->funcs->get_current_data(iterator, &data TSRMLS_CC); - RETURN_ZVAL(*data, 1, 0); -} /* }}} */ - -/* {{{ proto void RecursiveIteratorIterator::next() - Move forward to the next element */ -SPL_METHOD(RecursiveIteratorIterator, next) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_recursive_it_move_forward_ex(object, getThis() TSRMLS_CC); -} /* }}} */ - -/* {{{ proto int RecursiveIteratorIterator::getDepth() - Get the current depth of the recursive iteration */ -SPL_METHOD(RecursiveIteratorIterator, getDepth) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(object->level); -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getSubIterator([int level]) - The current active sub iterator or the iterator at specified level */ -SPL_METHOD(RecursiveIteratorIterator, getSubIterator) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long level = object->level; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &level) == FAILURE) { - return; - } - if (level < 0 || level > object->level) { - RETURN_NULL(); - } - RETURN_ZVAL(object->iterators[level].zobject, 1, 0); -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getInnerIterator() - The current active sub iterator */ -SPL_METHOD(RecursiveIteratorIterator, getInnerIterator) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long level = object->level; - - RETURN_ZVAL(object->iterators[level].zobject, 1, 0); -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::beginIteration() - Called when iteration begins (after first rewind() call) */ -SPL_METHOD(RecursiveIteratorIterator, beginIteration) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::endIteration() - Called when iteration ends (when valid() first returns false */ -SPL_METHOD(RecursiveIteratorIterator, endIteration) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto bool RecursiveIteratorIterator::callHasChildren() - Called for each element to test whether it has children */ -SPL_METHOD(RecursiveIteratorIterator, callHasChildren) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zend_class_entry *ce = object->iterators[object->level].ce; - zval *retval, *zobject; - - zobject = object->iterators[object->level].zobject; - if (!zobject) { - RETURN_FALSE; - } else { - zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval); - RETURN_ZVAL(retval, 0, 1); - } -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::callGetChildren() - Return children of current element */ -SPL_METHOD(RecursiveIteratorIterator, callGetChildren) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - zend_class_entry *ce = object->iterators[object->level].ce; - zval *retval, *zobject; - - zobject = object->iterators[object->level].zobject; - if (!zobject) { - return; - } else { - zend_call_method_with_0_params(&zobject, ce, NULL, "getchildren", &retval); - if (retval) { - RETURN_ZVAL(retval, 0, 1); - } - } -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::beginChildren() - Called when recursing one level down */ -SPL_METHOD(RecursiveIteratorIterator, beginChildren) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::endChildren() - Called when end recursing one level */ -SPL_METHOD(RecursiveIteratorIterator, endChildren) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::nextElement() - Called when the next element is available */ -SPL_METHOD(RecursiveIteratorIterator, nextElement) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::setMaxDepth([$max_depth = -1]) - Set the maximum allowed depth (or any depth if pmax_depth = -1] */ -SPL_METHOD(RecursiveIteratorIterator, setMaxDepth) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - long max_depth = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_depth) == FAILURE) { - return; - } - if (max_depth < -1) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter max_depth must be >= -1", 0 TSRMLS_CC); - return; - } - object->max_depth = max_depth; -} /* }}} */ - -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getMaxDepth() - Return the maximum accepted depth or false if any depth is allowed */ -SPL_METHOD(RecursiveIteratorIterator, getMaxDepth) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (object->max_depth == -1) { - RETURN_FALSE; - } else { - RETURN_LONG(object->max_depth); - } -} /* }}} */ - -static union _zend_function *spl_recursive_it_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC) -{ - union _zend_function *function_handler; - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC); - long level = object->level; - zval *zobj = object->iterators[level].zobject; - - function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC); - if (!function_handler) { - if (zend_hash_find(&Z_OBJCE_P(zobj)->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) { - if (Z_OBJ_HT_P(zobj)->get_method) { - *object_ptr = zobj; - function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC); - } - } - } - return function_handler; -} - -/* {{{ spl_RecursiveIteratorIterator_dtor */ -static void spl_RecursiveIteratorIterator_free_storage(void *_object TSRMLS_DC) -{ - spl_recursive_it_object *object = (spl_recursive_it_object *)_object; - zend_object_iterator *sub_iter; - - if (object->iterators) { - while (object->level >= 0) { - sub_iter = object->iterators[object->level].iterator; - sub_iter->funcs->dtor(sub_iter TSRMLS_CC); - zval_ptr_dtor(&object->iterators[object->level--].zobject); - } - efree(object->iterators); - object->iterators = NULL; - } - - zend_hash_destroy(object->std.properties); - FREE_HASHTABLE(object->std.properties); - - efree(object); -} -/* }}} */ - -/* {{{ spl_RecursiveIteratorIterator_new */ -static zend_object_value spl_RecursiveIteratorIterator_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - spl_recursive_it_object *intern; - zval *tmp; - - intern = emalloc(sizeof(spl_recursive_it_object)); - memset(intern, 0, sizeof(spl_recursive_it_object)); - intern->std.ce = class_type; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC); - retval.handlers = &spl_handlers_rec_it_it; - return retval; -} -/* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_recursive_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_getSubIterator, 0) - ZEND_ARG_INFO(0, level) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_setMaxDepth, 0) - ZEND_ARG_INFO(0, max_depth) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_RecursiveIteratorIterator[] = { - SPL_ME(RecursiveIteratorIterator, __construct, arginfo_recursive_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, getDepth, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, getSubIterator, arginfo_recursive_it_getSubIterator, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, beginIteration, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, endIteration, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, callHasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, callGetChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, beginChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, endChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, nextElement, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, setMaxDepth, arginfo_recursive_it_setMaxDepth, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveIteratorIterator, getMaxDepth, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -#if MBO_0 -static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - class_type->iterator_funcs.zf_valid = NULL; - class_type->iterator_funcs.zf_current = NULL; - class_type->iterator_funcs.zf_key = NULL; - class_type->iterator_funcs.zf_next = NULL; - class_type->iterator_funcs.zf_rewind = NULL; - if (!class_type->iterator_funcs.funcs) { - class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator; - } - - return SUCCESS; -} -#endif - -static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC) -{ - union _zend_function *function_handler; - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC); - - function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC); - if (!function_handler) { - if (zend_hash_find(&intern->inner.ce->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) { - if (Z_OBJ_HT_P(intern->inner.zobject)->get_method) { - *object_ptr = intern->inner.zobject; - function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC); - } - } - } - return function_handler; -} - -#if MBO_0 -int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - zval ***func_params, func; - zval *retval_ptr; - int arg_count; - int current = 0; - int success; - void **p; - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - ZVAL_TEXT(&func, method, 0); - if (!zend_is_callable(&func, 0, &method)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Method %v::%R() does not exist", intern->inner.ce->name, Z_TYPE(method), Z_UNIVAL(method)); - return FAILURE; - } - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - func_params = safe_emalloc(sizeof(zval **), arg_count, 0); - - current = 0; - while (arg_count-- > 0) { - func_params[current] = (zval **) p - (arg_count-current); - current++; - } - - if (call_user_function_ex(EG(function_table), NULL, &func, &retval_ptr, arg_count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { - RETURN_ZVAL(retval_ptr, 0, 1); - - success = SUCCESS; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method); - success = FAILURE; - } - - efree(func_params); - return success; -} -#endif - -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC); - -static INLINE spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, dual_it_type dit_type) -{ - zval *zobject; - spl_dual_it_object *intern; - zend_class_entry *ce; - - php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC); - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->dit_type = dit_type; - switch (dit_type) { - case DIT_LimitIterator: { - intern->u.limit.offset = 0; /* start at beginning */ - intern->u.limit.count = -1; /* get all */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - if (intern->u.limit.offset < 0) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter offset must be > 0", 0 TSRMLS_CC); - return NULL; - } - if (intern->u.limit.count < 0 && intern->u.limit.count != -1) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC); - return NULL; - } - break; - } - case DIT_CachingIterator: - case DIT_RecursiveCachingIterator: { - long flags = CIT_CALL_TOSTRING; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - if (((flags & CIT_CALL_TOSTRING) && (flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) - || ((flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)) == (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY, CIT_TOSTRING_USE_CURRENT", 0 TSRMLS_CC); - return NULL; - } - intern->u.caching.flags |= flags & CIT_PUBLIC; - MAKE_STD_ZVAL(intern->u.caching.zcache); - array_init(intern->u.caching.zcache); - break; - } - case DIT_IteratorIterator: { - zend_class_entry **pce_cast; - char * class_name; - int class_name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &zobject, ce_inner, &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - ce = Z_OBJCE_P(zobject); - if (!instanceof_function(ce, U_CLASS_ENTRY(zend_ce_iterator) TSRMLS_CC)) { - if (ZEND_NUM_ARGS() > 1) { - if (zend_lookup_class(class_name, class_name_len, &pce_cast TSRMLS_CC) == FAILURE - || !instanceof_function(ce, *pce_cast TSRMLS_CC) - || !(*pce_cast)->get_iterator - ) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_LogicException), "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - ce = *pce_cast; - } - if (instanceof_function(ce, U_CLASS_ENTRY(zend_ce_aggregate) TSRMLS_CC)) { - zval *retval; - zobject = zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); - ce = Z_OBJCE_P(zobject); - } - } - break; - } - case DIT_AppendIterator: - spl_instantiate(U_CLASS_ENTRY(spl_ce_ArrayIterator), &intern->u.append.zarrayit, 1 TSRMLS_CC); - zend_call_method_with_0_params(&intern->u.append.zarrayit, U_CLASS_ENTRY(spl_ce_ArrayIterator), &U_CLASS_ENTRY(spl_ce_ArrayIterator)->constructor, "__construct", NULL); - intern->u.append.iterator = U_CLASS_ENTRY(spl_ce_ArrayIterator)->get_iterator(U_CLASS_ENTRY(spl_ce_ArrayIterator), intern->u.append.zarrayit TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return intern; -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - case DIT_RegExIterator: - case DIT_RecursiveRegExIterator: { - char *regex; - int len, poptions, coptions; - pcre_extra *extra; - - intern->u.regex.flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &zobject, ce_inner, ®ex, &len, &intern->u.regex.flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - intern->u.regex.pce = pcre_get_compiled_regex_cache(regex, len, &extra, &poptions, &coptions TSRMLS_CC); - intern->u.regex.pce->refcount++; - break;; - } -#endif - default: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return NULL; - } - break; - } - - php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); - - zobject->refcount++; - intern->inner.zobject = zobject; - intern->inner.ce = dit_type == DIT_IteratorIterator ? ce : Z_OBJCE_P(zobject); - intern->inner.object = zend_object_store_get_object(zobject TSRMLS_CC); - intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject TSRMLS_CC); - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return intern; -} - -/* {{{ proto FilterIterator::__construct(Iterator it) - Create an Iterator from another iterator */ -SPL_METHOD(dual_it, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_Default); -} /* }}} */ - -/* {{{ proto Iterator FilterIterator::getInnerIterator() - proto Iterator CachingIterator::getInnerIterator() - proto Iterator LimitIterator::getInnerIterator() - proto Iterator ParentIterator::getInnerIterator() - Get the inner iterator */ -SPL_METHOD(dual_it, getInnerIterator) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->inner.zobject) { - RETVAL_ZVAL(intern->inner.zobject, 1, 0); - } else { - RETURN_NULL(); - } -} /* }}} */ - -static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC) -{ - if (!intern->inner.iterator) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "The inner constructor wasn't initialized with an iterator instance"); - } -} - -static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC) -{ - if (intern->inner.iterator && intern->inner.iterator->funcs->invalidate_current) { - intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator TSRMLS_CC); - } - if (intern->current.data) { - zval_ptr_dtor(&intern->current.data); - intern->current.data = NULL; - } - if (intern->current.str_key) { - efree(intern->current.str_key); - intern->current.str_key = NULL; - } - if (intern->dit_type == DIT_CachingIterator || intern->dit_type == DIT_RecursiveCachingIterator) { - if (intern->u.caching.zstr) { - zval_ptr_dtor(&intern->u.caching.zstr); - intern->u.caching.zstr = NULL; - } - if (intern->u.caching.zchildren) { - zval_ptr_dtor(&intern->u.caching.zchildren); - intern->u.caching.zchildren = NULL; - } - } -} - -static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC) -{ - spl_dual_it_free(intern TSRMLS_CC); - intern->current.pos = 0; - if (intern->inner.iterator->funcs->rewind) { - intern->inner.iterator->funcs->rewind(intern->inner.iterator TSRMLS_CC); - } -} - -static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC) -{ - /* FAILURE / SUCCESS */ - return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC); -} - -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC) -{ - zval **data; - - spl_dual_it_free(intern TSRMLS_CC); - if (!check_more || spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - intern->inner.iterator->funcs->get_current_data(intern->inner.iterator, &data TSRMLS_CC); - intern->current.data = *data; - intern->current.data->refcount++; - if (intern->inner.iterator->funcs->get_current_key) { - intern->current.key_type = intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.str_key, &intern->current.str_key_len, &intern->current.int_key TSRMLS_CC); - } else { - intern->current.key_type = HASH_KEY_IS_LONG; - intern->current.int_key = intern->current.pos; - } - return SUCCESS; - } - return FAILURE; -} - -static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free TSRMLS_DC) -{ - if (do_free) { - spl_dual_it_free(intern TSRMLS_CC); - } else { - spl_dual_it_require(intern TSRMLS_CC); - } - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); - intern->current.pos++; -} - -/* {{{ proto void ParentIterator::rewind() - proto void IteratorIterator::rewind() - Rewind the iterator - */ -SPL_METHOD(dual_it, rewind) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_dual_it_rewind(intern TSRMLS_CC); - spl_dual_it_fetch(intern, 1 TSRMLS_CC); -} /* }}} */ - -/* {{{ proto boolean FilterIterator::valid() - proto boolean ParentIterator::valid() - proto boolean IteratorIterator::valid() - proto boolean NoRewindIterator::valid() - Check whether the current element is valid */ -SPL_METHOD(dual_it, valid) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(intern->current.data); -} /* }}} */ - -/* {{{ proto mixed FilterIterator::key() - proto mixed CachingIterator::key() - proto mixed LimitIterator::key() - proto mixed ParentIterator::key() - proto mixed IteratorIterator::key() - proto mixed NoRewindIterator::key() - proto mixed AppendIterator::key() - Get the current key */ -SPL_METHOD(dual_it, key) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->current.data) { - if (intern->current.key_type == HASH_KEY_IS_STRING) { - RETURN_STRINGL(intern->current.str_key, intern->current.str_key_len-1, 1); - } else if (intern->current.key_type == HASH_KEY_IS_BINARY) { - RETURN_BINARYL(intern->current.str_key, intern->current.str_key_len-1, 1); - } else if (intern->current.key_type == HASH_KEY_IS_UNICODE) { - RETURN_UNICODEL((UChar *)intern->current.str_key, intern->current.str_key_len-1, 1); - } else { - RETURN_LONG(intern->current.int_key); - } - } - RETURN_NULL(); -} /* }}} */ - -/* {{{ proto mixed FilterIterator::current() - proto mixed CachingIterator::current() - proto mixed LimitIterator::current() - proto mixed ParentIterator::current() - proto mixed IteratorIterator::current() - proto mixed NoRewindIterator::current() - proto mixed AppendIterator::current() - Get the current element value */ -SPL_METHOD(dual_it, current) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->current.data) { - RETVAL_ZVAL(intern->current.data, 1, 0); - } else { - RETURN_NULL(); - } -} /* }}} */ - -/* {{{ proto void ParentIterator::next() - proto void IteratorIterator::next() - proto void NoRewindIterator::next() - Move the iterator forward */ -SPL_METHOD(dual_it, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_dual_it_next(intern, 1 TSRMLS_CC); - spl_dual_it_fetch(intern, 1 TSRMLS_CC); -} /* }}} */ - -static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) -{ - zval *retval; - - while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { - zend_call_method_with_0_params(&zthis, intern->std.ce, NULL, "accept", &retval); - if (retval) { - if (zend_is_true(retval)) { - zval_ptr_dtor(&retval); - return; - } - zval_ptr_dtor(&retval); - } - - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); - } - spl_dual_it_free(intern TSRMLS_CC); -} - -static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) -{ - spl_dual_it_rewind(intern TSRMLS_CC); - spl_filter_it_fetch(zthis, intern TSRMLS_CC); -} - -static INLINE void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern TSRMLS_DC) -{ - spl_dual_it_next(intern, 1 TSRMLS_CC); - spl_filter_it_fetch(zthis, intern TSRMLS_CC); -} - -/* {{{ proto void FilterIterator::rewind() - Rewind the iterator */ -SPL_METHOD(FilterIterator, rewind) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_filter_it_rewind(getThis(), intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto void FilterIterator::next() - Move the iterator forward */ -SPL_METHOD(FilterIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_filter_it_next(getThis(), intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto RecursiveFilterIterator::__construct(RecursiveIterator it) - Create a RecursiveFilterIterator from a RecursiveIterator */ -SPL_METHOD(RecursiveFilterIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_Default); -} /* }}} */ - -/* {{{ proto boolean RecursiveFilterIterator::hasChildren() - Check whether the inner iterator's current element has children */ -SPL_METHOD(RecursiveFilterIterator, hasChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval); - RETURN_ZVAL(retval, 0, 1); -} /* }}} */ - -/* {{{ proto RecursiveFilterIterator RecursiveFilterIterator::getChildren() - Return the inner iterator's children contained in a RecursiveFilterIterator */ -SPL_METHOD(RecursiveFilterIterator, getChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); - spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, retval TSRMLS_CC); - zval_ptr_dtor(&retval); -} /* }}} */ - -/* {{{ proto ParentIterator::__construct(RecursiveIterator it) - Create a ParentIterator from a RecursiveIterator */ -SPL_METHOD(ParentIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_Default); -} /* }}} */ - -/* {{{ proto boolean ParentIterator::hasChildren() - Check whether the inner iterator's current element has children */ -SPL_METHOD(ParentIterator, hasChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval); - RETURN_ZVAL(retval, 0, 1); -} /* }}} */ - -/* {{{ proto ParentIterator ParentIterator::getChildren() - Return the inner iterator's children contained in a ParentIterator */ -SPL_METHOD(ParentIterator, getChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); - spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, retval TSRMLS_CC); - zval_ptr_dtor(&retval); -} /* }}} */ - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -/* {{{ proto RegExIterator::__construct(Iterator it, string $regex [, int $flags]) - Create an RegExIterator from another iterator and a regular expression */ -SPL_METHOD(RegExIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_RegExIterator); -} /* }}} */ - -/* {{{ proto bool RegExIterator::accept() - Match (string)current() against regular expression */ -SPL_METHOD(RegExIterator, accept) -{ - spl_dual_it_object *intern; - int count; - char *subject, tmp[32]; - int subject_len, use_copy = 0; - zval subject_copy; - pcre_extra *extra; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->u.regex.flags & REGIT_USE_KEY) { - if (intern->current.key_type == HASH_KEY_IS_LONG) { - subject_len = snprintf(tmp, sizeof(tmp), "%ld", intern->current.int_key); - subject = &tmp[0]; - } else { - subject_len = intern->current.str_key_len; - subject = intern->current.str_key; - } - } else { - zend_make_printable_zval(intern->current.data, &subject_copy, &use_copy); - if (use_copy) { - subject = Z_STRVAL(subject_copy); - subject_len = Z_STRLEN(subject_copy); - } else { - subject = Z_STRVAL_P(intern->current.data); - subject_len = Z_STRLEN_P(intern->current.data); - } - } - - extra = intern->u.regex.pce->extra; - count = pcre_exec(intern->u.regex.pce->re, extra, subject, subject_len, 0, 0, NULL, 0); - - if (use_copy) { - zval_dtor(&subject_copy); - } - - RETURN_BOOL(count >= 0); -} /* }}} */ - -/* {{{ proto RecursiveRegExIterator::__construct(RecursiveIterator it, string $regex [, int $flags]) - Create an RecursiveRegExIterator from another recursive iterator and a regular expression */ -SPL_METHOD(RecursiveRegExIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_RecursiveRegExIterator); -} /* }}} */ -#endif - -/* {{{ spl_dual_it_free_storage */ -static INLINE void spl_dual_it_free_storage(void *_object TSRMLS_DC) -{ - spl_dual_it_object *object = (spl_dual_it_object *)_object; - - spl_dual_it_free(object TSRMLS_CC); - - if (object->inner.iterator) { - object->inner.iterator->funcs->dtor(object->inner.iterator TSRMLS_CC); - } - - if (object->inner.zobject) { - zval_ptr_dtor(&object->inner.zobject); - } - - if (object->dit_type == DIT_AppendIterator) { - object->u.append.iterator->funcs->dtor(object->u.append.iterator TSRMLS_CC); - zval_ptr_dtor(&object->u.append.zarrayit); - } - - if (object->dit_type == DIT_CachingIterator || object->dit_type == DIT_RecursiveCachingIterator) { - if (object->u.caching.zcache) { - zval_ptr_dtor(&object->u.caching.zcache); - object->u.caching.zcache = NULL; - } - } - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - if (object->dit_type == DIT_RegExIterator || object->dit_type == DIT_RecursiveRegExIterator) { - if (object->u.regex.pce) { - object->u.regex.pce->refcount--; - } - } -#endif - - zend_hash_destroy(object->std.properties); - FREE_HASHTABLE(object->std.properties); - - efree(object); -} -/* }}} */ - -/* {{{ spl_dual_it_new */ -static zend_object_value spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - spl_dual_it_object *intern; - zval *tmp; - - intern = emalloc(sizeof(spl_dual_it_object)); - memset(intern, 0, sizeof(spl_dual_it_object)); - intern->std.ce = class_type; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_dual_it_free_storage, NULL TSRMLS_CC); - retval.handlers = &spl_handlers_dual_it; - return retval; -} -/* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_filter_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_FilterIterator[] = { - SPL_ME(dual_it, __construct, arginfo_filter_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(FilterIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(FilterIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - SPL_ABSTRACT_ME(FilterIterator, accept, NULL) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_parent_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, RecursiveIterator, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_RecursiveFilterIterator[] = { - SPL_ME(RecursiveFilterIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC) - SPL_MA(ParentIterator, accept, RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveFilterIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_funcs_ParentIterator[] = { - SPL_ME(ParentIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC) - SPL_MA(ParentIterator, accept, ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -static -ZEND_BEGIN_ARG_INFO(arginfo_regex_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) - ZEND_ARG_INFO(0, regex) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_RegExIterator[] = { - SPL_ME(RegExIterator, __construct, arginfo_regex_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(RegExIterator, accept, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static zend_function_entry spl_funcs_RecursiveRegExIterator[] = { - SPL_ME(RecursiveRegExIterator, __construct, arginfo_regex_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; -#endif - -static INLINE int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC) -{ - /* FAILURE / SUCCESS */ - if (intern->u.limit.count != -1 && intern->current.pos >= intern->u.limit.offset + intern->u.limit.count) { - return FAILURE; - } else { - return spl_dual_it_valid(intern TSRMLS_CC); - } -} - -static INLINE void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS_DC) -{ - zval *zpos; - - spl_dual_it_free(intern TSRMLS_CC); - if (pos < intern->u.limit.offset) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset); - return; - } - if (pos > intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count); - return; - } - if (instanceof_function(intern->inner.ce, U_CLASS_ENTRY(spl_ce_SeekableIterator) TSRMLS_CC)) { - MAKE_STD_ZVAL(zpos); - ZVAL_LONG(zpos, pos); - spl_dual_it_free(intern TSRMLS_CC); - zend_call_method_with_1_params(&intern->inner.zobject, intern->inner.ce, NULL, "seek", NULL, zpos); - zval_ptr_dtor(&zpos); - intern->current.pos = pos; - if (spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); - } - } else { - /* emulate the forward seek, by next() calls */ - /* a back ward seek is done by a previous rewind() */ - if (pos < intern->current.pos) { - spl_dual_it_rewind(intern TSRMLS_CC); - } - while (pos > intern->current.pos && spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_next(intern, 1 TSRMLS_CC); - } - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 1 TSRMLS_CC); - } - } -} - -/* {{{ proto LimitIterator::__construct(Iterator it [, int offset, int count]) - Construct a LimitIterator from an Iterator with a given starting offset and optionally a maximum count */ -SPL_METHOD(LimitIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_LimitIterator); -} /* }}} */ - -/* {{{ proto void LimitIterator::rewind() - Rewind the iterator to the specified starting offset */ -SPL_METHOD(LimitIterator, rewind) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_dual_it_rewind(intern TSRMLS_CC); - spl_limit_it_seek(intern, intern->u.limit.offset TSRMLS_CC); -} /* }}} */ - -/* {{{ proto boolean LimitIterator::valid() - Check whether the current element is valid */ -SPL_METHOD(LimitIterator, valid) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - -/* RETURN_BOOL(spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS);*/ - RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && intern->current.data); -} /* }}} */ - -/* {{{ proto void LimitIterator::next() - Move the iterator forward */ -SPL_METHOD(LimitIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_dual_it_next(intern, 1 TSRMLS_CC); - if (intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) { - spl_dual_it_fetch(intern, 1 TSRMLS_CC); - } -} /* }}} */ - -/* {{{ proto void LimitIterator::seek(int position) - Seek to the given position */ -SPL_METHOD(LimitIterator, seek) -{ - spl_dual_it_object *intern; - long pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) { - return; - } - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_limit_it_seek(intern, pos TSRMLS_CC); - RETURN_LONG(intern->current.pos); -} /* }}} */ - -/* {{{ proto int LimitIterator::getPosition() - Return the current position */ -SPL_METHOD(LimitIterator, getPosition) -{ - spl_dual_it_object *intern; - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_LONG(intern->current.pos); -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_seekable_it_seek, 0) - ZEND_ARG_INFO(0, position) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_SeekableIterator[] = { - SPL_ABSTRACT_ME(SeekableIterator, seek, arginfo_seekable_it_seek) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_limit_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, count) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_limit_it_seek, 0) - ZEND_ARG_INFO(0, position) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_LimitIterator[] = { - SPL_ME(LimitIterator, __construct, arginfo_limit_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(LimitIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(LimitIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(LimitIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(LimitIterator, seek, arginfo_limit_it_seek, ZEND_ACC_PUBLIC) - SPL_ME(LimitIterator, getPosition, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static INLINE int spl_caching_it_valid(spl_dual_it_object *intern TSRMLS_DC) -{ - return intern->u.caching.flags & CIT_VALID ? SUCCESS : FAILURE; -} - -static INLINE int spl_caching_it_has_next(spl_dual_it_object *intern TSRMLS_DC) -{ - return spl_dual_it_valid(intern TSRMLS_CC); -} - -static INLINE void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) -{ - if (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { - intern->u.caching.flags |= CIT_VALID; - /* Full cache ? */ - if (intern->u.caching.flags & CIT_FULL_CACHE) { - zval *zcacheval; - - MAKE_STD_ZVAL(zcacheval); - ZVAL_ZVAL(zcacheval, intern->current.data, 1, 0); - if (intern->current.key_type == HASH_KEY_IS_LONG) { - add_index_zval(intern->u.caching.zcache, intern->current.int_key, zcacheval); - } else { - zend_u_symtable_update(HASH_OF(intern->u.caching.zcache), intern->current.key_type, intern->current.str_key, intern->current.str_key_len, &zcacheval, sizeof(void*), NULL); - } - } - /* Recursion ? */ - if (intern->dit_type == DIT_RecursiveCachingIterator) { - zval *retval, *zchildren, zflags; - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval); - if (zend_is_true(retval)) { - zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren); - if (EG(exception) && intern->u.caching.flags & CIT_CATCH_GET_CHILD) { - zend_clear_exception(TSRMLS_C); - if (zchildren) { - zval_ptr_dtor(&zchildren); - } - } else { - INIT_PZVAL(&zflags); - ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC); - spl_instantiate_arg_ex2(U_CLASS_ENTRY(spl_ce_RecursiveCachingIterator), &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC); - zval_ptr_dtor(&zchildren); - } - } - zval_ptr_dtor(&retval); - } - if (intern->u.caching.flags & CIT_CALL_TOSTRING) { - int use_copy; - zval expr_copy; - ALLOC_ZVAL(intern->u.caching.zstr); - *intern->u.caching.zstr = *intern->current.data; - zend_make_printable_zval(intern->u.caching.zstr, &expr_copy, &use_copy); - if (use_copy) { - *intern->u.caching.zstr = expr_copy; - INIT_PZVAL(intern->u.caching.zstr); - zval_copy_ctor(intern->u.caching.zstr); - zval_dtor(&expr_copy); - } else { - INIT_PZVAL(intern->u.caching.zstr); - zval_copy_ctor(intern->u.caching.zstr); - } - } - spl_dual_it_next(intern, 0 TSRMLS_CC); - } else { - intern->u.caching.flags &= ~CIT_VALID; - } -} - -static INLINE void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC) -{ - spl_dual_it_rewind(intern TSRMLS_CC); - zend_hash_clean(HASH_OF(intern->u.caching.zcache)); - spl_caching_it_next(intern TSRMLS_CC); -} - -/* {{{ proto CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING]) - Construct a CachingIterator from an Iterator */ -SPL_METHOD(CachingIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_CachingIterator); -} /* }}} */ - -/* {{{ proto void CachingIterator::rewind() - Rewind the iterator */ -SPL_METHOD(CachingIterator, rewind) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_caching_it_rewind(intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto boolean CachingIterator::valid() - Check whether the current element is valid */ -SPL_METHOD(CachingIterator, valid) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(spl_caching_it_valid(intern TSRMLS_CC) == SUCCESS); -} /* }}} */ - -/* {{{ proto void CachingIterator::next() - Move the iterator forward */ -SPL_METHOD(CachingIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_caching_it_next(intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto boolean CachingIterator::hasNext() - Check whether the inner iterator has a valid next element */ -SPL_METHOD(CachingIterator, hasNext) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(spl_caching_it_has_next(intern TSRMLS_CC) == SUCCESS); -} /* }}} */ - -/* {{{ proto string CachingIterator::__toString() - Return the string representation of the current element */ -SPL_METHOD(CachingIterator, __toString) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); - } - if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) { - if (intern->current.key_type == HASH_KEY_IS_STRING) { - RETURN_STRINGL(intern->current.str_key, intern->current.str_key_len, 1); - } else { - RETVAL_LONG(intern->current.int_key); - convert_to_string(return_value); - return; - } - } else if (intern->u.caching.flags & CIT_TOSTRING_USE_CURRENT) { - RETVAL_ZVAL(intern->current.data, 1, 0); - - return; - } - if (intern->u.caching.zstr) { - *return_value = *intern->u.caching.zstr; - zval_copy_ctor(return_value); - convert_to_text(return_value); - INIT_PZVAL(return_value); - } else { - RETURN_NULL(); - } -} /* }}} */ - -/* {{{ proto void CachingIterator::offsetSet(mixed index, mixed newval) - Set given index in cache */ -SPL_METHOD(CachingIterator, offsetSet) -{ - spl_dual_it_object *intern; - void *arKey; - uint nKeyLength; - zend_uchar type; - zval *value; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Tz", &arKey, &nKeyLength, &type, &value) == FAILURE) { - return; - } - - value->refcount++; - zend_u_symtable_update(HASH_OF(intern->u.caching.zcache), type, arKey, nKeyLength+1, &value, sizeof(value), NULL); -} -/* }}} */ - -/* {{{ proto string CachingIterator::offsetGet(mixed index) - Return the internal cache if used */ -SPL_METHOD(CachingIterator, offsetGet) -{ - spl_dual_it_object *intern; - void *arKey; - uint nKeyLength; - zend_uchar type; - zval **value; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) { - return; - } - - if (zend_u_symtable_find(HASH_OF(intern->u.caching.zcache), type, arKey, nKeyLength+1, (void**)&value) == FAILURE) { - zend_error(E_NOTICE, "Undefined index: %R", type, arKey); - return; - } - - RETURN_ZVAL(*value, 1, 0); -} -/* }}} */ - -/* {{{ proto void CachingIterator::offsetUnset(mixed index) - Unset given index in cache */ -SPL_METHOD(CachingIterator, offsetUnset) -{ - spl_dual_it_object *intern; - void *arKey; - uint nKeyLength; - zend_uchar type; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) { - return; - } - - zend_u_symtable_del(HASH_OF(intern->u.caching.zcache), type, arKey, nKeyLength+1); -} -/* }}} */ - -/* {{{ proto bool CachingIterator::offsetExists(mixed index) - Return whether the requested index exists */ -SPL_METHOD(CachingIterator, offsetExists) -{ - spl_dual_it_object *intern; - void *arKey; - uint nKeyLength; - zend_uchar type; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { - zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) { - return; - } - - RETURN_BOOL(zend_u_symtable_exists(HASH_OF(intern->u.caching.zcache), type, arKey, nKeyLength+1)); -} -/* }}} */ - -/* {{{ proto int CachingIterator::getFlags() - Return the internal flags */ -SPL_METHOD(CachingIterator, getFlags) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(intern->u.caching.flags); -} -/* }}} */ - -/* {{{ proto void CachingIterator::setFlags() - Set the internal flags */ -SPL_METHOD(CachingIterator, setFlags) -{ - spl_dual_it_object *intern; - long flags; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", flags) == FAILURE) { - return; - } - - if (((flags & CIT_CALL_TOSTRING) && (flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) - || ((flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)) == (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) { - zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY, CIT_TOSTRING_USE_CURRENT", 0 TSRMLS_CC); - return; - } - if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & ~CIT_CALL_TOSTRING) == 0) { - zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC); - return; - } - if ((flags && CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) { - /* clear on (re)enable */ - zend_hash_clean(HASH_OF(intern->u.caching.zcache)); - } - intern->u.caching.flags = (intern->u.caching.flags & ~CIT_PUBLIC) | (flags & CIT_PUBLIC); -} -/* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_caching_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO(arginfo_caching_it_setFlags, 0) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_caching_it_offsetGet, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_caching_it_offsetSet, 0, 0, 2) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, newval) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_CachingIterator[] = { - SPL_ME(CachingIterator, __construct, arginfo_caching_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, hasNext, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, __toString, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, getFlags, NULL, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, setFlags, arginfo_caching_it_setFlags, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, offsetGet, arginfo_caching_it_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, offsetSet, arginfo_caching_it_offsetSet, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, offsetUnset, arginfo_caching_it_offsetGet, ZEND_ACC_PUBLIC) - SPL_ME(CachingIterator, offsetExists, arginfo_caching_it_offsetGet, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto RecursiveCachingIterator::__construct(RecursiveIterator it [, flags = CIT_CALL_TOSTRING]) - Create an iterator from a RecursiveIterator */ -SPL_METHOD(RecursiveCachingIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_RecursiveCachingIterator); -} /* }}} */ - -/* {{{ proto bolean RecursiveCachingIterator::hasChildren() - Check whether the current element of the inner iterator has children */ -SPL_METHOD(RecursiveCachingIterator, hasChildren) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(intern->u.caching.zchildren); -} /* }}} */ - -/* {{{ proto RecursiveCachingIterator RecursiveCachingIterator::getChildren() - Return the inner iterator's children as a RecursiveCachingIterator */ -SPL_METHOD(RecursiveCachingIterator, getChildren) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->u.caching.zchildren) { - RETURN_ZVAL(intern->u.caching.zchildren, 1, 0); - } else { - RETURN_NULL(); - } -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_caching_rec_it___construct, 0, ZEND_RETURN_VALUE, 2) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_RecursiveCachingIterator[] = { - SPL_ME(RecursiveCachingIterator, __construct, arginfo_caching_rec_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveCachingIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveCachingIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto IteratorIterator::__construct(Traversable it) - Create an iterator from anything that is traversable */ -SPL_METHOD(IteratorIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_traversable), DIT_IteratorIterator); -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_iterator_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_IteratorIterator[] = { - SPL_ME(IteratorIterator, __construct, arginfo_iterator_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto NoRewindIterator::__construct(Iterator it) - Create an iterator from another iterator */ -SPL_METHOD(NoRewindIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_NoRewindIterator); -} /* }}} */ - -/* {{{ proto void NoRewindIterator::rewind() - Prevent a call to inner iterators rewind() */ -SPL_METHOD(NoRewindIterator, rewind) -{ - /* nothing to do */ -} /* }}} */ - -/* {{{ proto void NoRewindIterator::valid() - Return inner iterators valid() */ -SPL_METHOD(NoRewindIterator, valid) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC) == SUCCESS); -} /* }}} */ - -/* {{{ proto mixed NoRewindIterator::key() - Return inner iterators key() */ -SPL_METHOD(NoRewindIterator, key) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (intern->inner.iterator->funcs->get_current_key) { - char *str_key; - uint str_key_len; - ulong int_key; - if (intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &str_key, &str_key_len, &int_key TSRMLS_CC) == HASH_KEY_IS_LONG) { - RETURN_LONG(int_key); - } else { - RETURN_STRINGL(str_key, str_key_len-1, 0); - } - } else { - RETURN_NULL(); - } -} /* }}} */ - -/* {{{ proto mixed NoRewindIterator::current() - Return inner iterators current() */ -SPL_METHOD(NoRewindIterator, current) -{ - spl_dual_it_object *intern; - zval **data; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - intern->inner.iterator->funcs->get_current_data(intern->inner.iterator, &data TSRMLS_CC); - RETURN_ZVAL(*data, 1, 0); -} /* }}} */ - -/* {{{ proto void NoRewindIterator::next() - Return inner iterators next() */ -SPL_METHOD(NoRewindIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC); -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_norewind_it___construct, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_NoRewindIterator[] = { - SPL_ME(NoRewindIterator, __construct, arginfo_norewind_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(NoRewindIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(NoRewindIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(NoRewindIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(NoRewindIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(NoRewindIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto InfiniteIterator::__construct(Iterator it) - Create an iterator from another iterator */ -SPL_METHOD(InfiniteIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_InfiniteIterator); -} /* }}} */ - -/* {{{ proto InfiniteIterator::next() - Prevent a call to inner iterators rewind() (internally the current data will be fetched if valid()) */ -SPL_METHOD(InfiniteIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_dual_it_next(intern, 1 TSRMLS_CC); - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); - } else { - spl_dual_it_rewind(intern TSRMLS_CC); - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_fetch(intern, 0 TSRMLS_CC); - } - } -} /* }}} */ - -static zend_function_entry spl_funcs_InfiniteIterator[] = { - SPL_ME(InfiniteIterator, __construct, arginfo_norewind_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(InfiniteIterator, next, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto EmptyIterator::rewind() - Does nothing */ -SPL_METHOD(EmptyIterator, rewind) -{ -} /* }}} */ - -/* {{{ proto EmptyIterator::valid() - Return false */ -SPL_METHOD(EmptyIterator, valid) -{ - RETURN_FALSE; -} /* }}} */ - -/* {{{ proto EmptyIterator::key() - Throws exception */ -SPL_METHOD(EmptyIterator, key) -{ - zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Accessing the key of an EmptyIterator", 0 TSRMLS_CC); -} /* }}} */ - -/* {{{ proto EmptyIterator::current() - Throws exception */ -SPL_METHOD(EmptyIterator, current) -{ - zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Accessing the value of an EmptyIterator", 0 TSRMLS_CC); -} /* }}} */ - -/* {{{ proto EmptyIterator::next() - Does nothing */ -SPL_METHOD(EmptyIterator, next) -{ -} /* }}} */ - -static zend_function_entry spl_funcs_EmptyIterator[] = { - SPL_ME(EmptyIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(EmptyIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(EmptyIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(EmptyIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(EmptyIterator, next, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/ -{ - spl_dual_it_free(intern TSRMLS_CC); - - if (intern->inner.zobject) { - zval_ptr_dtor(&intern->inner.zobject); - intern->inner.zobject = NULL; - intern->inner.ce = NULL; - intern->inner.object = NULL; - intern->inner.iterator = NULL; - } - if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) == SUCCESS) { - zval **it; - - intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator, &it TSRMLS_CC); - (*it)->refcount++; - intern->inner.zobject = *it; - intern->inner.ce = Z_OBJCE_PP(it); - intern->inner.object = zend_object_store_get_object(*it TSRMLS_CC); - intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, *it TSRMLS_CC); - spl_dual_it_rewind(intern TSRMLS_CC); - intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator TSRMLS_CC); - return SUCCESS; - } else { - return FAILURE; - } -} /* }}} */ - -void spl_append_it_fetch(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/ -{ - while (spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) { - if (spl_append_it_next_iterator(intern TSRMLS_CC) != SUCCESS) { - return; - } - } - spl_dual_it_fetch(intern, 0 TSRMLS_CC); -} /* }}} */ - -void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */ -{ - if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { - spl_dual_it_next(intern, 1 TSRMLS_CC); - } - spl_append_it_fetch(intern TSRMLS_CC); -} /* }}} */ - -/* {{{ proto AppendIterator::__construct() - Create an AppendIterator */ -SPL_METHOD(AppendIterator, __construct) -{ - spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_AppendIterator); -} /* }}} */ - -/* {{{ proto void AppendIterator::append(Iterator it) - Append an iterator */ -SPL_METHOD(AppendIterator, append) -{ - spl_dual_it_object *intern; - zval *it; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, U_CLASS_ENTRY(zend_ce_iterator)) == FAILURE) { - return; - } - spl_array_iterator_append(intern->u.append.zarrayit, it TSRMLS_CC); - - if (!intern->inner.iterator || spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) { - if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) != SUCCESS) { - intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC); - } - do { - spl_append_it_next_iterator(intern TSRMLS_CC); - } while (intern->inner.zobject != it); - spl_append_it_fetch(intern TSRMLS_CC); - } -} /* }}} */ - -/* {{{ proto void AppendIterator::rewind() - Rewind to the first iterator and rewind the first iterator, too */ -SPL_METHOD(AppendIterator, rewind) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC); - if (spl_append_it_next_iterator(intern TSRMLS_CC) == SUCCESS) { - spl_append_it_fetch(intern TSRMLS_CC); - } -} /* }}} */ - -/* {{{ proto boolean AppendIterator::valid() - Check if the current state is valid */ -SPL_METHOD(AppendIterator, valid) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(intern->current.data); -} /* }}} */ - -/* {{{ proto AppendIterator::next() - Forward to next element */ -SPL_METHOD(AppendIterator, next) -{ - spl_dual_it_object *intern; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - spl_append_it_next(intern TSRMLS_CC); -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_append_it_append, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_AppendIterator[] = { - SPL_ME(AppendIterator, __construct, NULL, ZEND_ACC_PUBLIC) - SPL_ME(AppendIterator, append, arginfo_append_it_append, ZEND_ACC_PUBLIC) - SPL_ME(AppendIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(AppendIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(AppendIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ array iterator_to_array(Traversable it) - Copy the iterator into an array */ -PHP_FUNCTION(iterator_to_array) -{ - zval *obj, **data; - zend_object_iterator *iter; - char *str_key; - uint str_key_len; - ulong int_key; - int key_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, U_CLASS_ENTRY(zend_ce_traversable)) == FAILURE) { - RETURN_FALSE; - } - - array_init(return_value); - - iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC); - - iter->funcs->rewind(iter TSRMLS_CC); - while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - iter->funcs->get_current_data(iter, &data TSRMLS_CC); - (*data)->refcount++; - switch(key_type) { - case HASH_KEY_IS_STRING: - add_assoc_zval_ex(return_value, str_key, str_key_len, *data); - efree(str_key); - break; - case HASH_KEY_IS_BINARY: - add_u_assoc_zval_ex(return_value, IS_BINARY, str_key, str_key_len, *data); - efree(str_key); - break; - case HASH_KEY_IS_UNICODE: - add_u_assoc_zval_ex(return_value, IS_UNICODE, str_key, str_key_len, *data); - efree(str_key); - break; - case HASH_KEY_IS_LONG: - add_index_zval(return_value, int_key, *data); - break; - } - iter->funcs->move_forward(iter TSRMLS_CC); - } - iter->funcs->dtor(iter TSRMLS_CC); -} -/* }}} */ - -/* {{{ int iterator_count(IteratorAggregate it) - Count the elements in an iterator */ -PHP_FUNCTION(iterator_count) -{ - zval *obj; - zend_object_iterator *iter; - long count = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, U_CLASS_ENTRY(zend_ce_aggregate)) == FAILURE) { - RETURN_FALSE; - } - - iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC); - - iter->funcs->rewind(iter TSRMLS_CC); - while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) { - count++; - iter->funcs->move_forward(iter TSRMLS_CC); - } - iter->funcs->dtor(iter TSRMLS_CC); - - RETURN_LONG(count); -} -/* }}} */ - -static zend_function_entry spl_funcs_OuterIterator[] = { - SPL_ABSTRACT_ME(OuterIterator, getInnerIterator, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION(spl_iterators) - */ -PHP_MINIT_FUNCTION(spl_iterators) -{ - REGISTER_SPL_INTERFACE(RecursiveIterator); - REGISTER_SPL_ITERATOR(RecursiveIterator); - - REGISTER_SPL_STD_CLASS_EX(RecursiveIteratorIterator, spl_RecursiveIteratorIterator_new, spl_funcs_RecursiveIteratorIterator); - REGISTER_SPL_ITERATOR(RecursiveIteratorIterator); - - memcpy(&spl_handlers_rec_it_it, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - spl_handlers_rec_it_it.get_method = spl_recursive_it_get_method; - spl_handlers_rec_it_it.clone_obj = NULL; - - memcpy(&spl_handlers_dual_it, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - spl_handlers_dual_it.get_method = spl_dual_it_get_method; - /*spl_handlers_dual_it.call_method = spl_dual_it_call_method;*/ - spl_handlers_dual_it.clone_obj = NULL; - - spl_ce_RecursiveIteratorIterator->get_iterator = spl_recursive_it_get_iterator; - spl_ce_RecursiveIteratorIterator->iterator_funcs.funcs = &spl_recursive_it_iterator_funcs; - - REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "LEAVES_ONLY", RIT_LEAVES_ONLY); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "SELF_FIRST", RIT_SELF_FIRST); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CHILD_FIRST", RIT_CHILD_FIRST); - REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CATCH_GET_CHILD", RIT_CATCH_GET_CHILD); - - REGISTER_SPL_STD_CLASS_EX(FilterIterator, spl_dual_it_new, spl_funcs_FilterIterator); - REGISTER_SPL_ITERATOR(FilterIterator); - spl_ce_FilterIterator->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; - - REGISTER_SPL_SUB_CLASS_EX(RecursiveFilterIterator, FilterIterator, spl_dual_it_new, spl_funcs_RecursiveFilterIterator); - REGISTER_SPL_IMPLEMENTS(RecursiveFilterIterator, RecursiveIterator); - - REGISTER_SPL_SUB_CLASS_EX(ParentIterator, RecursiveFilterIterator, spl_dual_it_new, spl_funcs_ParentIterator); - - REGISTER_SPL_INTERFACE(SeekableIterator); - REGISTER_SPL_ITERATOR(SeekableIterator); - - REGISTER_SPL_STD_CLASS_EX(LimitIterator, spl_dual_it_new, spl_funcs_LimitIterator); - REGISTER_SPL_ITERATOR(LimitIterator); - - REGISTER_SPL_STD_CLASS_EX(CachingIterator, spl_dual_it_new, spl_funcs_CachingIterator); - REGISTER_SPL_ITERATOR(CachingIterator); - REGISTER_SPL_IMPLEMENTS(CachingIterator, ArrayAccess); - - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "CALL_TOSTRING", CIT_CALL_TOSTRING); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "CATCH_GET_CHILD", CIT_CATCH_GET_CHILD); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "TOSTRING_USE_KEY", CIT_TOSTRING_USE_KEY); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "TOSTRING_USE_CURRENT", CIT_TOSTRING_USE_CURRENT); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "FULL_CACHE", CIT_FULL_CACHE); - - REGISTER_SPL_SUB_CLASS_EX(RecursiveCachingIterator, CachingIterator, spl_dual_it_new, spl_funcs_RecursiveCachingIterator); - REGISTER_SPL_IMPLEMENTS(RecursiveCachingIterator, RecursiveIterator); - - REGISTER_SPL_STD_CLASS_EX(IteratorIterator, spl_dual_it_new, spl_funcs_IteratorIterator); - REGISTER_SPL_ITERATOR(IteratorIterator); - - REGISTER_SPL_STD_CLASS_EX(NoRewindIterator, spl_dual_it_new, spl_funcs_NoRewindIterator); - REGISTER_SPL_ITERATOR(NoRewindIterator); - - REGISTER_SPL_INTERFACE(OuterIterator); - REGISTER_SPL_ITERATOR(OuterIterator); - - REGISTER_SPL_STD_CLASS_EX(AppendIterator, spl_dual_it_new, spl_funcs_AppendIterator); - - REGISTER_SPL_IMPLEMENTS(RecursiveIteratorIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(CachingIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(FilterIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(LimitIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(IteratorIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(NoRewindIterator, OuterIterator); - REGISTER_SPL_IMPLEMENTS(AppendIterator, OuterIterator); - - REGISTER_SPL_SUB_CLASS_EX(InfiniteIterator, IteratorIterator, spl_dual_it_new, spl_funcs_InfiniteIterator); -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - REGISTER_SPL_SUB_CLASS_EX(RegExIterator, FilterIterator, spl_dual_it_new, spl_funcs_RegExIterator); - REGISTER_SPL_CLASS_CONST_LONG(RegExIterator, "USE_KEY", REGIT_USE_KEY); - REGISTER_SPL_SUB_CLASS_EX(RecursiveRegExIterator, RegExIterator, spl_dual_it_new, spl_funcs_RecursiveRegExIterator); - REGISTER_SPL_IMPLEMENTS(RecursiveRegExIterator, RecursiveIterator); -#else - spl_ce_RegExIterator = NULL; - spl_ce_RecursiveRegExIterator = NULL; -#endif - - REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator); - REGISTER_SPL_ITERATOR(EmptyIterator); - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h deleted file mode 100755 index 823bccee343d6..0000000000000 --- a/ext/spl/spl_iterators.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_ITERATORS_H -#define SPL_ITERATORS_H - -#include "php.h" -#include "php_spl.h" -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" - -#endif - -#define spl_ce_Traversable zend_ce_traversable -#define spl_ce_Iterator zend_ce_iterator -#define spl_ce_Aggregate zend_ce_aggregate -#define spl_ce_ArrayAccess zend_ce_arrayaccess -#define spl_ce_Serializable zend_ce_serializable - -extern PHPAPI zend_class_entry *spl_ce_RecursiveIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator; -extern PHPAPI zend_class_entry *spl_ce_FilterIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveFilterIterator; -extern PHPAPI zend_class_entry *spl_ce_ParentIterator; -extern PHPAPI zend_class_entry *spl_ce_SeekableIterator; -extern PHPAPI zend_class_entry *spl_ce_LimitIterator; -extern PHPAPI zend_class_entry *spl_ce_CachingIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveCachingIterator; -extern PHPAPI zend_class_entry *spl_ce_OuterIterator; -extern PHPAPI zend_class_entry *spl_ce_IteratorIterator; -extern PHPAPI zend_class_entry *spl_ce_NoRewindIterator; -extern PHPAPI zend_class_entry *spl_ce_InfiniteIterator; -extern PHPAPI zend_class_entry *spl_ce_EmptyIterator; -extern PHPAPI zend_class_entry *spl_ce_AppendIterator; -extern PHPAPI zend_class_entry *spl_ce_RegExIterator; -extern PHPAPI zend_class_entry *spl_ce_RecursiveRegExIterator; - -PHP_MINIT_FUNCTION(spl_iterators); - -PHP_FUNCTION(iterator_to_array); -PHP_FUNCTION(iterator_count); - -typedef enum { - DIT_Default = 0, - DIT_LimitIterator, - DIT_CachingIterator, - DIT_RecursiveCachingIterator, - DIT_IteratorIterator, - DIT_NoRewindIterator, - DIT_InfiniteIterator, - DIT_AppendIterator, -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - DIT_RegExIterator, - DIT_RecursiveRegExIterator, -#endif -} dual_it_type; - -enum { - /* public */ - CIT_CALL_TOSTRING = 0x00000001, - CIT_CATCH_GET_CHILD = 0x00000002, - CIT_TOSTRING_USE_KEY = 0x00000010, - CIT_TOSTRING_USE_CURRENT = 0x00000020, - CIT_FULL_CACHE = 0x00000100, - CIT_PUBLIC = 0x0000FFFF, - /* private */ - CIT_VALID = 0x00010000, - CIT_HAS_CHILDREN = 0x00020000 -}; - -enum { - /* public */ - REGIT_USE_KEY = 0x00000001, -}; - -typedef struct _spl_dual_it_object { - zend_object std; - struct { - zval *zobject; - zend_class_entry *ce; - zend_object *object; - zend_object_iterator *iterator; - } inner; - struct { - zval *data; - char *str_key; - uint str_key_len; - ulong int_key; - int key_type; /* HASH_KEY_IS_STRING or HASH_KEY_IS_LONG */ - int pos; - } current; - dual_it_type dit_type; - union { - struct { - long offset; - long count; - } limit; - struct { - int flags; /* CIT_* */ - zval *zstr; - zval *zchildren; - zval *zcache; - } caching; - struct { - zval *zarrayit; - zend_object_iterator *iterator; - } append; -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - struct { - int flags; - pcre_cache_entry *pce; - } regex; -#endif - } u; -} spl_dual_it_object; - -#endif /* SPL_ITERATORS_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c deleted file mode 100755 index aa8e602a571c8..0000000000000 --- a/ext/spl/spl_observer.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is SplSubject 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_observer.h" -#include "spl_iterators.h" -#include "spl_array.h" - -SPL_METHOD(SplObserver, update); -SPL_METHOD(SplSubject, attach); -SPL_METHOD(SplSubject, detach); -SPL_METHOD(SplSubject, notify); - -static -ZEND_BEGIN_ARG_INFO(arginfo_SplObserver_update, 0) - ZEND_ARG_OBJ_INFO(0, SplSubject, SplSubject, 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_SplObserver[] = { - SPL_ABSTRACT_ME(SplObserver, update, arginfo_SplObserver_update) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_SplSubject_attach, 0) - ZEND_ARG_OBJ_INFO(0, SplObserver, SplObserver, 0) -ZEND_END_ARG_INFO(); - -/*static -ZEND_BEGIN_ARG_INFO_EX(arginfo_SplSubject_notify, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, ignore, SplObserver, 1) -ZEND_END_ARG_INFO();*/ - -static zend_function_entry spl_funcs_SplSubject[] = { - SPL_ABSTRACT_ME(SplSubject, attach, arginfo_SplSubject_attach) - SPL_ABSTRACT_ME(SplSubject, detach, arginfo_SplSubject_attach) - SPL_ABSTRACT_ME(SplSubject, notify, NULL) - {NULL, NULL, NULL} -}; - -PHPAPI zend_class_entry *spl_ce_SplObserver; -PHPAPI zend_class_entry *spl_ce_SplSubject; -PHPAPI zend_class_entry *spl_ce_SplObjectStorage; -PHPAPI zend_object_handlers spl_handler_SplObjectStorage; - -typedef struct _spl_SplObjectStorage { - zend_object std; - HashTable storage; - long index; - HashPosition pos; -} spl_SplObjectStorage; - -/* storage is an assoc aray of [zend_object_value]=>[zval*] */ - -void spl_SplOjectStorage_free_storage(void *object TSRMLS_DC) /* {{{ */ -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - zend_hash_destroy(&intern->storage); - - efree(object); -} /* }}} */ - -static zend_object_value spl_object_storage_new_ex(zend_class_entry *class_type, spl_SplObjectStorage **obj, zval *orig TSRMLS_DC) /* {{{ */ -{ - zend_object_value retval; - spl_SplObjectStorage *intern; - zval *tmp; - - intern = emalloc(sizeof(spl_SplObjectStorage)); - memset(intern, 0, sizeof(spl_SplObjectStorage)); - intern->std.ce = class_type; - *obj = intern; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - zend_hash_init(&intern->storage, 0, NULL, ZVAL_PTR_DTOR, 0); - - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_SplOjectStorage_free_storage, NULL TSRMLS_CC); - retval.handlers = &spl_handler_SplObjectStorage; - return retval; -} -/* }}} */ - -/* {{{ spl_array_object_new */ -static zend_object_value spl_SplObjectStorage_new(zend_class_entry *class_type TSRMLS_DC) -{ - spl_SplObjectStorage *tmp; - return spl_object_storage_new_ex(class_type, &tmp, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto void SplObjectStorage::attach($obj) - Attaches an object to the storage if not yet contained */ -SPL_METHOD(SplObjectStorage, attach) -{ - zval *obj; - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { - return; - } - - zend_hash_update(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj), &obj, sizeof(zval**), NULL); - obj->refcount++; -} /* }}} */ - -/* {{{ proto void SplObjectStorage::detach($obj) - Detaches an object from the storage */ -SPL_METHOD(SplObjectStorage, detach) -{ - zval *obj; - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { - return; - } - - zend_hash_del(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj)); - zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); - intern->index = 0; -} /* }}} */ - -/* {{{ proto bool SplObjectStorage::contains($obj) - Determine whethe an object is contained in the storage */ -SPL_METHOD(SplObjectStorage, contains) -{ - zval *obj; - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) { - return; - } - - RETURN_BOOL(zend_hash_exists(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj))); -} /* }}} */ - -/* {{{ proto int SplObjectStorage::count() - Determine number of objects in storage */ -SPL_METHOD(SplObjectStorage, count) -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(zend_hash_num_elements(&intern->storage)); -} /* }}} */ - -/* {{{ proto void SplObjectStorage::rewind() - */ -SPL_METHOD(SplObjectStorage, rewind) -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); - intern->index = 0; -} /* }}} */ - -/* {{{ proto bool SplObjectStorage::valid() - */ -SPL_METHOD(SplObjectStorage, valid) -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS); -} /* }}} */ - -/* {{{ proto mixed SplObjectStorage::key() - */ -SPL_METHOD(SplObjectStorage, key) -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - RETURN_LONG(intern->index); -} /* }}} */ - -/* {{{ proto mixed SplObjectStorage::current() - */ -SPL_METHOD(SplObjectStorage, current) -{ - zval **entry; - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_hash_get_current_data_ex(&intern->storage, (void**)&entry, &intern->pos) == FAILURE) { - return; - } - RETVAL_ZVAL(*entry, 1, 0); -} /* }}} */ - -/* {{{ proto void SplObjectStorage::next() - */ -SPL_METHOD(SplObjectStorage, next) -{ - spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_hash_move_forward_ex(&intern->storage, &intern->pos); - intern->index++; -} /* }}} */ - -static -ZEND_BEGIN_ARG_INFO(arginfo_Object, 0) - ZEND_ARG_INFO(0, object 0) -ZEND_END_ARG_INFO(); - -static zend_function_entry spl_funcs_SplObjectStorage[] = { - SPL_ME(SplObjectStorage, attach, arginfo_Object, 0) - SPL_ME(SplObjectStorage, detach, arginfo_Object, 0) - SPL_ME(SplObjectStorage, contains, arginfo_Object, 0) - SPL_ME(SplObjectStorage, count, NULL, 0) - SPL_ME(SplObjectStorage, rewind, NULL, 0) - SPL_ME(SplObjectStorage, valid, NULL, 0) - SPL_ME(SplObjectStorage, key, NULL, 0) - SPL_ME(SplObjectStorage, current, NULL, 0) - SPL_ME(SplObjectStorage, next, NULL, 0) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION(spl_observer) */ -PHP_MINIT_FUNCTION(spl_observer) -{ - REGISTER_SPL_INTERFACE(SplObserver); - REGISTER_SPL_INTERFACE(SplSubject); - - REGISTER_SPL_STD_CLASS_EX(SplObjectStorage, spl_SplObjectStorage_new, spl_funcs_SplObjectStorage); - memcpy(&spl_handler_SplObjectStorage, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - - REGISTER_SPL_IMPLEMENTS(SplObjectStorage, Countable); - REGISTER_SPL_IMPLEMENTS(SplObjectStorage, Iterator); - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_observer.h b/ext/spl/spl_observer.h deleted file mode 100755 index d5cf4dc6a887e..0000000000000 --- a/ext/spl/spl_observer.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_OBSERVER_H -#define SPL_OBSERVER_H - -#include "php.h" -#include "php_spl.h" - -extern PHPAPI zend_class_entry *spl_ce_SplObserver; -extern PHPAPI zend_class_entry *spl_ce_SplSubject; -extern PHPAPI zend_class_entry *spl_ce_SplObjectStorage; - -PHP_MINIT_FUNCTION(spl_observer); - -#endif /* SPL_OBSERVER_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_sxe.c b/ext/spl/spl_sxe.c deleted file mode 100755 index f4c7f7b13fe40..0000000000000 --- a/ext/spl/spl_sxe.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "zend_interfaces.h" - -#include "php_spl.h" -#include "spl_functions.h" -#include "spl_engine.h" -#include "spl_iterators.h" -#include "spl_sxe.h" - -zend_class_entry *spl_ce_SimpleXMLIterator = NULL; -zend_class_entry *spl_ce_SimpleXMLElement; - -#if HAVE_LIBXML && HAVE_SIMPLEXML - -#include "ext/simplexml/php_simplexml_exports.h" - -SPL_METHOD(SimpleXMLIterator, rewind) /* {{{ */ -{ - php_sxe_iterator iter; - - iter.sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - spl_ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter TSRMLS_CC); -} -/* }}} */ - -SPL_METHOD(SimpleXMLIterator, valid) /* {{{ */ -{ - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - - RETURN_BOOL(sxe->iter.data); -} -/* }}} */ - -SPL_METHOD(SimpleXMLIterator, current) /* {{{ */ -{ - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - - if (!sxe->iter.data) { - return; /* return NULL */ - } - - RETURN_ZVAL(sxe->iter.data, 1, 0); -} -/* }}} */ - -SPL_METHOD(SimpleXMLIterator, key) /* {{{ */ -{ - xmlNodePtr curnode; - php_sxe_object *intern; - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - - if (!sxe->iter.data) { - RETURN_FALSE; - } - - intern = (php_sxe_object *)zend_object_store_get_object(sxe->iter.data TSRMLS_CC); - if (intern != NULL && intern->node != NULL) { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; - RETURN_U_STRINGL(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), (char*)curnode->name, xmlStrlen(curnode->name), 1); - } - - RETURN_FALSE; -} -/* }}} */ - -SPL_METHOD(SimpleXMLIterator, next) /* {{{ */ -{ - php_sxe_iterator iter; - - iter.sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - spl_ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter TSRMLS_CC); -} -/* }}} */ - -/* {{{ hasChildren() - */ -SPL_METHOD(SimpleXMLIterator, hasChildren) -{ - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - php_sxe_object *child; - xmlNodePtr node; - - if (!sxe->iter.data) { - RETURN_FALSE; - } - child = php_sxe_fetch_object(sxe->iter.data TSRMLS_CC); - - GET_NODE(child, node); - if (node) { - node = node->children; - } - while (node && node->type != XML_ELEMENT_NODE) { - node = node->next; - } - RETURN_BOOL(node ? 1 : 0); -} -/* }}} */ - -/* {{{ getChildren() - */ -SPL_METHOD(SimpleXMLIterator, getChildren) -{ - php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); - - if (!sxe->iter.data) { - return; /* return NULL */ - } - return_value->type = IS_OBJECT; - return_value->value.obj = zend_objects_store_clone_obj(sxe->iter.data TSRMLS_CC); -} - -static zend_function_entry spl_funcs_SimpleXMLIterator[] = { - SPL_ME(SimpleXMLIterator, rewind, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, valid, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, current, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, key, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, next, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(SimpleXMLIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; -/* }}} */ - -SPL_API PHP_MINIT_FUNCTION(spl_sxe) /* {{{ */ -{ - zend_class_entry **pce; - - if (zend_hash_find(CG(class_table), "simplexmlelement", sizeof("SimpleXMLElement"), (void **) &pce) == FAILURE) { - spl_ce_SimpleXMLElement = NULL; - spl_ce_SimpleXMLIterator = NULL; - return SUCCESS; /* SimpleXML must be initialized before */ - } - - spl_ce_SimpleXMLElement = *pce; - - REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXMLElement, spl_ce_SimpleXMLElement->create_object, spl_funcs_SimpleXMLIterator); - REGISTER_SPL_IMPLEMENTS(SimpleXMLIterator, RecursiveIterator); - - return SUCCESS; -} -/* }}} */ - -#else /* HAVE_LIBXML && HAVE_SIMPLEXML */ - -SPL_API PHP_MINIT_FUNCTION(spl_sxe) /* {{{ */ -{ - return SUCCESS; -} - -#endif /* HAVE_LIBXML && HAVE_SIMPLEXML */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/spl_sxe.h b/ext/spl/spl_sxe.h deleted file mode 100755 index 4abd830a415d8..0000000000000 --- a/ext/spl/spl_sxe.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef SPL_SXE_H -#define SPL_SXE_H - -#include "php.h" -#include "php_spl.h" - -extern zend_class_entry *spl_ce_SimpleXMLIterator; - -SPL_API PHP_MINIT_FUNCTION(spl_sxe); - -#endif /* SPL_SXE_H */ - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/spl/tests/.htaccess b/ext/spl/tests/.htaccess deleted file mode 100755 index 5a01a1c16ec56..0000000000000 --- a/ext/spl/tests/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - - IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t *.php - diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt deleted file mode 100755 index 8ddfdc67c6d65..0000000000000 --- a/ext/spl/tests/array_001.phpt +++ /dev/null @@ -1,167 +0,0 @@ ---TEST-- -SPL: ArrayObject ---SKIPIF-- - ---FILE-- -0, 1=>1); -$ar = new ArrayObject($ar); - -var_dump($ar); - -$ar[2] = 2; -var_dump($ar[2]); -var_dump($ar["3"] = 3); - -var_dump(array_merge((array)$ar, array(4=>4, 5=>5))); - -var_dump($ar["a"] = "a"); - -var_dump($ar); -var_dump($ar[0]); -var_dump($ar[6]); -var_dump($ar["b"]); - -unset($ar[1]); -unset($ar["3"]); -unset($ar["a"]); -unset($ar[7]); -unset($ar["c"]); -var_dump($ar); - -$ar[] = '3'; -$ar[] = 4; -var_dump($ar); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [1]=> - int(1) -} -int(2) -int(3) -array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) -} -string(1) "a" -object(ArrayObject)#1 (5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - ["a"]=> - string(1) "a" -} -int(0) - -Notice: Undefined offset: 6 in %sarray_001.php on line %d -NULL - -Notice: Undefined index: b in %sarray_001.php on line %d -NULL - -Notice: Undefined offset: 7 in %sarray_001.php on line %d - -Notice: Undefined index: c in %sarray_001.php on line %d -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [2]=> - int(2) -} -object(ArrayObject)#1 (4) { - [0]=> - int(0) - [2]=> - int(2) - [4]=> - string(1) "3" - [5]=> - int(4) -} -===DONE=== ---UEXPECTF-- -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [1]=> - int(1) -} -int(2) -int(3) -array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) -} -unicode(1) "a" -object(ArrayObject)#1 (5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [u"a"]=> - unicode(1) "a" -} -int(0) - -Notice: Undefined offset: 6 in %sarray_001.php on line %d -NULL - -Notice: Undefined index: b in %sarray_001.php on line %d -NULL - -Notice: Undefined offset: 7 in %sarray_001.php on line %d - -Notice: Undefined index: c in %sarray_001.php on line %d -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [2]=> - int(2) -} -object(ArrayObject)#1 (4) { - [0]=> - int(0) - [2]=> - int(2) - [4]=> - unicode(1) "3" - [5]=> - int(4) -} -===DONE=== diff --git a/ext/spl/tests/array_002.phpt b/ext/spl/tests/array_002.phpt deleted file mode 100755 index 122953c9750bd..0000000000000 --- a/ext/spl/tests/array_002.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SPL: ArrayObject copy constructor ---SKIPIF-- - ---FILE-- - 'one', - '2' => 'two', - '3' => 'three'); - -$object = new ArrayObject($array); -$object[] = 'four'; - -$arrayObject = new ArrayObject($object); - -$arrayObject[] = 'five'; - -var_dump($arrayObject); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#%d (5) { - [1]=> - string(3) "one" - [2]=> - string(3) "two" - [3]=> - string(5) "three" - [4]=> - string(4) "four" - [5]=> - string(4) "five" -} -===DONE=== ---UEXPECTF-- -object(ArrayObject)#%d (5) { - [1]=> - unicode(3) "one" - [2]=> - unicode(3) "two" - [3]=> - unicode(5) "three" - [4]=> - unicode(4) "four" - [5]=> - unicode(4) "five" -} -===DONE=== diff --git a/ext/spl/tests/array_003.phpt b/ext/spl/tests/array_003.phpt deleted file mode 100755 index f0ddb791c6971..0000000000000 --- a/ext/spl/tests/array_003.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -SPL: ArrayObject from object ---SKIPIF-- - ---FILE-- -imp = "implicit"; - } -}; - -$test = new test; -$test->dyn = "dynamic"; - -print_r($test); - -$object = new ArrayObject($test); - -print_r($object); - -foreach($test as $key => $val) -{ - echo "$key => $val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -test Object -( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic -) -ArrayObject Object -( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic -) -pub => public -imp => implicit -dyn => dynamic -===DONE=== diff --git a/ext/spl/tests/array_004.phpt b/ext/spl/tests/array_004.phpt deleted file mode 100755 index e7abf2b1dc853..0000000000000 --- a/ext/spl/tests/array_004.phpt +++ /dev/null @@ -1,143 +0,0 @@ ---TEST-- -SPL: ArrayIterator ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayObject($arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==0 && $bk==0) { - $arr[0] = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==UseRef==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==0 && $bk==0) { - $arr[0] = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==Modify==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==0 && $bk==0) { - $arr[0] = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==Delete==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==1 && $bk==1) { - unset($arr[1]); - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==Change==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==1 && $bk==1) { - $arr = NULL; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "Done\n"; -?> ---EXPECTF-- -==Normal== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -1=>1 - 0=>0 -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>0 -2=>2 - 1=>1 -2=>2 - 2=>2 -==UseRef== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -1=>1 - 0=>modify -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>modify -2=>2 - 1=>1 -2=>2 - 2=>2 -==Modify== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -1=>1 - 0=>modify -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>modify -2=>2 - 1=>1 -2=>2 - 2=>2 -==Delete== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -1=>1 - 0=>0 -1=>1 - 1=>1 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.php on line %d -1=>1 - 0=>0 -1=>1 - 2=>2 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.php on line %d -0=>0 - 0=>0 -0=>0 - 2=>2 -2=>2 - 0=>0 -2=>2 - 2=>2 -==Change== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -1=>1 - 0=>0 -1=>1 - 1=>1 - -Notice: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d -Done diff --git a/ext/spl/tests/array_005.phpt b/ext/spl/tests/array_005.phpt deleted file mode 100755 index 9214a4c92bdc5..0000000000000 --- a/ext/spl/tests/array_005.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -SPL: ArrayObject/Iterator interaction ---SKIPIF-- - ---FILE-- -id = $id; - $this->name = $name; - } - - public function __toString() - { - return $this->id . ', ' . $this->name; - } - - public function getId() - { - return $this->id; - } -} - -class StudentIdFilter extends FilterIterator -{ - private $id; - - public function __construct(ArrayObject $students, Student $other) - { - FilterIterator::__construct($students->getIterator()); - $this->id = $other->getId(); - } - - public function accept() - { - echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; - return $this->current()->getId() == $this->id; - } -} - -class StudentList implements IteratorAggregate -{ - private $students; - - public function __construct() - { - $this->students = new ArrayObject(array()); - } - - public function add(Student $student) - { - if (!$this->contains($student)) { - $this->students[] = $student; - } - } - - public function contains(Student $student) - { - foreach ($this->students as $s) - { - if ($s->getId() == $student->getId()) { - return true; - } - } - return false; - } - - public function getIterator() { - return $this->students->getIterator(); - } -} - -$students = new StudentList(); -$students->add(new Student('01234123', 'Joe')); -$students->add(new Student('00000014', 'Bob')); -$students->add(new Student('00000014', 'Foo')); - -foreach ($students as $student) { - echo $student, "\n"; -} -?> -===DONE=== - ---EXPECT-- -01234123, Joe -00000014, Bob -===DONE=== diff --git a/ext/spl/tests/array_006.phpt b/ext/spl/tests/array_006.phpt deleted file mode 100755 index 5dd9bdec7a5a7..0000000000000 --- a/ext/spl/tests/array_006.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SPL: ArrayIterator without ArrayObject ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayIterator($arr); - -foreach($obj as $ak=>$av) { - foreach($obj as $bk=>$bv) { - if ($ak==0 && $bk==0) { - $arr[0] = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -?> -===DONE=== - ---EXPECTF-- -==Normal== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -===DONE=== diff --git a/ext/spl/tests/array_007.phpt b/ext/spl/tests/array_007.phpt deleted file mode 100755 index 645794e24e2ab..0000000000000 --- a/ext/spl/tests/array_007.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -SPL: ArrayObject/Iterator from IteratorAggregate ---SKIPIF-- - ---FILE-- -imp = "implicit"; - } - - function getIterator() - { - $it = new ArrayObject($this); - return $it->getIterator(); - } -}; - -$test = new test; -$test->dyn = "dynamic"; - -print_r($test); - -print_r($test->getIterator()); - -foreach($test as $key => $val) -{ - echo "$key => $val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -test Object -( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic -) -ArrayIterator Object -( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic -) -pub => public -imp => implicit -dyn => dynamic -===DONE=== diff --git a/ext/spl/tests/array_008.phpt b/ext/spl/tests/array_008.phpt deleted file mode 100755 index 613e3247762fc..0000000000000 --- a/ext/spl/tests/array_008.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -SPL: ArrayIterator and foreach reference ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayObject($arr); - -foreach($obj as $ak=>&$av) { - foreach($obj as $bk=>&$bv) { - if ($ak==0 && $bk==0) { - $bv = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==UseRef==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>&$av) { - foreach($obj as $bk=>&$bv) { - if ($ak==0 && $bk==0) { - $bv = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -?> -===DONE=== - ---EXPECTF-- -==Normal== -0=>modify - 0=>modify -0=>modify - 1=>1 -0=>modify - 2=>2 -1=>1 - 0=>modify -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>modify -2=>2 - 1=>1 -2=>2 - 2=>2 -==UseRef== -0=>modify - 0=>modify -0=>modify - 1=>1 -0=>modify - 2=>2 -1=>1 - 0=>modify -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>modify -2=>2 - 1=>1 -2=>2 - 2=>2 -===DONE=== diff --git a/ext/spl/tests/array_009.phpt b/ext/spl/tests/array_009.phpt deleted file mode 100755 index 0431cca77ee39..0000000000000 --- a/ext/spl/tests/array_009.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SPL: ArrayIterator implementing RecursiveIterator ---SKIPIF-- - ---FILE-- - array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/array_009a.phpt b/ext/spl/tests/array_009a.phpt deleted file mode 100755 index aebac08ba64cd..0000000000000 --- a/ext/spl/tests/array_009a.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -SPL: ArrayIterator implementing RecursiveIterator ---SKIPIF-- - ---FILE-- -current()); - } - - function getChildren() - { - return new MyRecursiveArrayIterator($this->current()); - } -} - -$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new MyRecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/array_010.phpt deleted file mode 100755 index 7a7cc54e18c8e..0000000000000 --- a/ext/spl/tests/array_010.phpt +++ /dev/null @@ -1,225 +0,0 @@ ---TEST-- -SPL: ArrayIterator implements ArrayAccess ---SKIPIF-- - ---FILE-- -'3rd', '4th'=>4)); - -var_dump($obj->getArrayCopy()); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->getArrayCopy()); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->getArrayCopy()); - -?> -===DONE=== - ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -===isset=== -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -===offsetGet=== -string(3) "1st" -int(1) -string(3) "3rd" -int(4) - -Notice: Undefined index: 5th in %sarray_010.php on line %d -NULL - -Notice: Undefined offset: 6 in %sarray_010.php on line %d -NULL -===offsetSet=== -WRITE 1 -string(9) "Changed 1" -WRITE 2 -string(11) "Changed 4th" -WRITE 3 -string(9) "Added 5th" -WRITE 4 -string(7) "Added 6" -string(3) "1st" -string(3) "3rd" -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} - -Notice: Undefined offset: 7 in %sarray_010.php on line %d - -Notice: Undefined index: 8th in %sarray_010.php on line %d -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== ---UEXPECTF-- -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - int(1) - [2]=> - unicode(3) "3rd" - [u"4th"]=> - int(4) -} -===EMPTY=== -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -===isset=== -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -===offsetGet=== -unicode(3) "1st" -int(1) -unicode(3) "3rd" -int(4) - -Notice: Undefined index: 5th in %sarray_010.php on line %d -NULL - -Notice: Undefined offset: 6 in %sarray_010.php on line %d -NULL -===offsetSet=== -WRITE 1 -unicode(9) "Changed 1" -WRITE 2 -unicode(11) "Changed 4th" -WRITE 3 -unicode(9) "Added 5th" -WRITE 4 -unicode(7) "Added 6" -unicode(3) "1st" -unicode(3) "3rd" -unicode(9) "changed 6" -unicode(9) "changed 6" -===unset=== -array(6) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [2]=> - unicode(3) "3rd" - [u"4th"]=> - unicode(11) "Changed 4th" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} - -Notice: Undefined offset: 7 in %sarray_010.php on line %d - -Notice: Undefined index: 8th in %sarray_010.php on line %d -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} -===DONE=== diff --git a/ext/spl/tests/array_011.phpt b/ext/spl/tests/array_011.phpt deleted file mode 100755 index b648a3f8be8a1..0000000000000 --- a/ext/spl/tests/array_011.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -SPL: ArrayIterator, LimitIterator and string keys ---SKIPIF-- - ---FILE-- - 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5); -//foreach (new ArrayIterator($a) as $k => $v) -foreach (new LimitIterator(new ArrayIterator($a), 1, 3) as $k => $v) -{ - var_dump(array($k, $v)); -} - -?> -===DONE=== - ---EXPECT-- -array(2) { - [0]=> - string(3) "one" - [1]=> - int(1) -} -array(2) { - [0]=> - string(3) "two" - [1]=> - int(2) -} -array(2) { - [0]=> - string(5) "three" - [1]=> - int(3) -} -===DONE=== ---UEXPECT-- -array(2) { - [0]=> - unicode(3) "one" - [1]=> - int(1) -} -array(2) { - [0]=> - unicode(3) "two" - [1]=> - int(2) -} -array(2) { - [0]=> - unicode(5) "three" - [1]=> - int(3) -} -===DONE=== diff --git a/ext/spl/tests/array_012.phpt b/ext/spl/tests/array_012.phpt deleted file mode 100755 index a8889654a50cf..0000000000000 --- a/ext/spl/tests/array_012.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -SPL: ArrayIterator::count ---SKIPIF-- - ---FILE-- - 0, 'one' => 1, 'two' => 2); -$it = new ArrayIterator($a); - -var_dump($it->count()); -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; - var_dump($it->count()); -} -var_dump($it->count()); - -echo "===Object===\n"; - -class test -{ - public $zero = 0; - protected $pro; - public $one = 1; - private $pri; - public $two = 2; -} - -$o = new test; -$it = new ArrayIterator($o); - -var_dump($it->count()); -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; - var_dump($it->count()); -} -var_dump($it->count()); - -?> -===DONE=== - ---EXPECT-- -===Array=== -int(3) -zero=>0 -int(3) -one=>1 -int(3) -two=>2 -int(3) -int(3) -===Object=== -int(3) -zero=>0 -int(3) -one=>1 -int(3) -two=>2 -int(3) -int(3) -===DONE=== diff --git a/ext/spl/tests/array_013.phpt b/ext/spl/tests/array_013.phpt deleted file mode 100755 index 905b8339c9a3c..0000000000000 --- a/ext/spl/tests/array_013.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -SPL: ArrayIterator::append ---SKIPIF-- - ---FILE-- - 'zero', 1 => 'one', 2 => 'two'); -$it = new ArrayIterator($a); - -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append('three'); -$it->append('four'); - -foreach(new NoRewindIterator($it) as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Object===\n"; - -class test -{ - public $zero = 0; - protected $pro; - public $one = 1; - private $pri; - public $two = 2; -} - -$o = new test; -$it = new ArrayIterator($o); - -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append('three'); -$it->append('four'); - -foreach(new NoRewindIterator($it) as $key => $val) -{ - echo "$key=>$val\n"; -} - -var_dump($o->{0}); /* doesn't wotk anyway */ - -?> -===DONE=== - ---EXPECTF-- -===Array=== -0=>zero -1=>one -2=>two -===Append=== -3=>three -4=>four -===Object=== -zero=>0 -one=>1 -two=>2 -===Append=== - -Catchable fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in %sarray_013.php on line %d diff --git a/ext/spl/tests/array_014.phpt b/ext/spl/tests/array_014.phpt deleted file mode 100755 index ad9bc6c4ac267..0000000000000 --- a/ext/spl/tests/array_014.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -SPL: ArrayIterator::seek() ---SKIPIF-- - ---FILE-- -count()); -$it->seek(5); -var_dump($it->current()); -$it->seek(4); -var_dump($it->current()); -try -{ - $it->seek(-1); - var_dump($it->current()); -} -catch(Exception $e) -{ - echo $e->getMessage() . "\n"; -} - -try -{ - $it->seek(12); - var_dump($it->current()); -} -catch(Exception $e) -{ - echo $e->getMessage() . "\n"; -} - -$pos = 0; -foreach($it as $v) -{ - $it->seek($pos++); - var_dump($v); -} - -?> -===DONE=== - ---EXPECTF-- -int(11) -int(5) -int(4) -Seek position -1 is out of range -Seek position 12 is out of range -int(0) -int(1) -int(2) -int(3) -int(4) -int(5) -int(6) -int(7) -int(8) -int(9) -int(10) -===DONE=== diff --git a/ext/spl/tests/array_015.phpt b/ext/spl/tests/array_015.phpt deleted file mode 100755 index 0a82fc7a5d037..0000000000000 --- a/ext/spl/tests/array_015.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -SPL: ArrayIterator::next() with internal arrays ---FILE-- -getIterator(); - -$ar->offsetUnset($it->key()); -$it->next(); - -var_dump($it->current()); -var_dump($ar); - -foreach($it as $k => $v) -{ - $ar->offsetUnset($k+1); - echo "$k=>$v\n"; -} - -var_dump($ar); - -foreach($it as $k => $v) -{ - $ar->offsetUnset($k); - echo "$k=>$v\n"; -} - -var_dump($ar); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#%d (5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -int(2) -object(ArrayObject)#%d (4) { - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -1=>2 -3=>4 -object(ArrayObject)#%d (2) { - [1]=> - int(2) - [3]=> - int(4) -} -1=>2 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -3=>4 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -object(ArrayObject)#%d (0) { -} -===DONE=== diff --git a/ext/spl/tests/array_016.phpt b/ext/spl/tests/array_016.phpt deleted file mode 100755 index d4ea0ab39ad6b..0000000000000 --- a/ext/spl/tests/array_016.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SPL: ArrayItaerator/Object and IteratorIterator ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -int(0) -int(1) -int(2) -int(3) -int(0) -int(1) -int(2) -int(3) -===DONE=== diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/array_017.phpt deleted file mode 100755 index 50a3979b57f6a..0000000000000 --- a/ext/spl/tests/array_017.phpt +++ /dev/null @@ -1,1164 +0,0 @@ ---TEST-- -SPL: ArrayObject::exchangeArray($this) ---SKIPIF-- - ---FILE-- -imp2 = 4; - } - - function dump() - { - echo __METHOD__ . "()\n"; - var_dump(array('Flags'=>$this->getFlags() - ,'OVars'=>get_object_vars($this) - ,'$this'=>$this)); - } - - function setFlags($flags) - { - echo __METHOD__ . "($flags)\n"; - ArrayObject::setFlags($flags); - } -} - -class ArrayObjectEx extends ArrayObject -{ - public $pub1 = 1; - protected $pro1 = 2; - private $pri1 = 3; - - function __construct($ar = array(), $flags = 0) - { - echo __METHOD__ . "()\n"; - parent::__construct($ar, $flags); - $this->imp1 = 4; - } - - function exchange() - { - echo __METHOD__ . "()\n"; - $this->exchangeArray($this); - } - - function dump() - { - echo __METHOD__ . "()\n"; - var_dump(array('Flags'=>$this->getFlags() - ,'OVars'=>get_object_vars($this) - ,'$this'=>$this)); - } - - function show() - { - echo __METHOD__ . "()\n"; - foreach($this as $n => $v) - { - var_dump(array($n => $v)); - } - } - - function setFlags($flags) - { - echo __METHOD__ . "($flags)\n"; - ArrayObject::setFlags($flags); - } - - function getIterator() - { - echo __METHOD__ . "()\n"; - $it = new ArrayIteratorEx($this, $this->getFlags()); - $it->dyn2 = 5; - $it->dump(); - return $it; - } -} - -function check($obj, $flags) -{ - echo "===CHECK===\n"; - - $obj->setFlags($flags); - $obj->dump(); - $obj->show(); - - echo "===FOREACH===\n"; - - $it = $obj->getIterator(); - foreach($it as $n => $v) - { - var_dump(array($n => $v)); - } - - echo "===PROPERTY===\n"; - - var_dump($obj->pub1); - var_dump(isset($obj->a)); - $obj->setFlags($flags | 2); - var_dump($obj->pub1); - var_dump(isset($obj->a)); - - var_dump($it->pub2); - var_dump(isset($it->pub1)); - $it->setFlags($flags | 2); - var_dump($it->pub2); - var_dump(isset($it->pub1)); -} - -$obj = new ArrayObjectEx(array(0=>1,'a'=>25, 'pub1'=>42), 0); -$obj->dyn1 = 5; - -check($obj, 0); -check($obj, 1); - -echo "#####EXCHANGE#####\n"; - -$obj->exchange(); - -check($obj, 0); -check($obj, 1); - -?> -===DONE=== - ---EXPECTF-- -ArrayObjectEx::__construct() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayObjectEx)#1 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1":protected]=> - int(2) - ["pri1":"ArrayObjectEx":private]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub2"]=> - int(1) - ["pro2":protected]=> - int(2) - ["pri2":"ArrayIteratorEx":private]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub2"]=> - int(1) - ["pro2":protected]=> - int(2) - ["pri2":"ArrayIteratorEx":private]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -#####EXCHANGE##### -ArrayObjectEx::exchange() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1":protected]=> - int(2) - ["pri1":"ArrayObjectEx":private]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(4) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub1"]=> - int(1) - ["pro1":protected]=> - int(2) - ["pri1":"ArrayObjectEx":private]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(4) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub1"]=> - int(1) - ["pro1":protected]=> - int(2) - ["pri1":"ArrayObjectEx":private]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1":protected]=> - int(2) - ["pri1":"ArrayObjectEx":private]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub2"]=> - int(1) - ["pro2":protected]=> - int(2) - ["pri2":"ArrayIteratorEx":private]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub2"]=> - int(1) - ["pro2":protected]=> - int(2) - ["pri2":"ArrayIteratorEx":private]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -===DONE=== ---UEXPECTF-- -ArrayObjectEx::__construct() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(2) { - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } - [u"$this"]=> - object(ArrayObjectEx)#1 (3) { - [0]=> - int(1) - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(2) { - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } - [u"$this"]=> - object(ArrayIteratorEx)#2 (3) { - [0]=> - int(1) - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - [u"a"]=> - int(25) -} -array(1) { - [u"pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(2) { - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } - [u"$this"]=> - object(ArrayIteratorEx)#3 (3) { - [0]=> - int(1) - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - [u"a"]=> - int(25) -} -array(1) { - [u"pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub1"]=> - int(1) - [u"pro1"]=> - int(2) - [u"pri1"]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } - [u"$this"]=> - object(ArrayObjectEx)#1 (5) { - [u"pub1"]=> - int(1) - [u"pro1":protected]=> - int(2) - [u"pri1":u"ArrayObjectEx":private]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub2"]=> - int(1) - [u"pro2"]=> - int(2) - [u"pri2"]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { - [u"pub2"]=> - int(1) - [u"pro2":protected]=> - int(2) - [u"pri2":u"ArrayIteratorEx":private]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - [u"a"]=> - int(25) -} -array(1) { - [u"pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub2"]=> - int(1) - [u"pro2"]=> - int(2) - [u"pri2"]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { - [u"pub2"]=> - int(1) - [u"pro2":protected]=> - int(2) - [u"pri2":u"ArrayIteratorEx":private]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - [u"a"]=> - int(25) -} -array(1) { - [u"pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -#####EXCHANGE##### -ArrayObjectEx::exchange() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(5) { - [u"pub1"]=> - int(1) - [u"pro1"]=> - int(2) - [u"pri1"]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } - [u"$this"]=> - object(ArrayObjectEx)#1 (5) { - [u"pub1"]=> - int(1) - [u"pro1":protected]=> - int(2) - [u"pri1":u"ArrayObjectEx":private]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(4) { - [u"pub1"]=> - int(1) - [u"pro1"]=> - int(2) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { - [u"pub1"]=> - int(1) - [u"pro1":protected]=> - int(2) - [u"pri1":u"ArrayObjectEx":private]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } -} -array(1) { - [u"pub1"]=> - int(1) -} -array(1) { - [u"imp1"]=> - int(4) -} -array(1) { - [u"dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(0) - [u"OVars"]=> - array(4) { - [u"pub1"]=> - int(1) - [u"pro1"]=> - int(2) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { - [u"pub1"]=> - int(1) - [u"pro1":protected]=> - int(2) - [u"pri1":u"ArrayObjectEx":private]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } -} -array(1) { - [u"pub1"]=> - int(1) -} -array(1) { - [u"imp1"]=> - int(4) -} -array(1) { - [u"dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub1"]=> - int(1) - [u"pro1"]=> - int(2) - [u"pri1"]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } - [u"$this"]=> - object(ArrayObjectEx)#1 (5) { - [u"pub1"]=> - int(1) - [u"pro1":protected]=> - int(2) - [u"pri1":u"ArrayObjectEx":private]=> - int(3) - [u"imp1"]=> - int(4) - [u"dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub2"]=> - int(1) - [u"pro2"]=> - int(2) - [u"pri2"]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { - [u"pub2"]=> - int(1) - [u"pro2":protected]=> - int(2) - [u"pri2":u"ArrayIteratorEx":private]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } -} -array(1) { - [u"pub1"]=> - int(1) -} -array(1) { - [u"imp1"]=> - int(4) -} -array(1) { - [u"dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - [u"Flags"]=> - int(1) - [u"OVars"]=> - array(5) { - [u"pub2"]=> - int(1) - [u"pro2"]=> - int(2) - [u"pri2"]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } - [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { - [u"pub2"]=> - int(1) - [u"pro2":protected]=> - int(2) - [u"pri2":u"ArrayIteratorEx":private]=> - int(3) - [u"imp2"]=> - int(4) - [u"dyn2"]=> - int(5) - } -} -array(1) { - [u"pub1"]=> - int(1) -} -array(1) { - [u"imp1"]=> - int(4) -} -array(1) { - [u"dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -===DONE=== diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/array_018.phpt deleted file mode 100755 index 0cb882799555a..0000000000000 --- a/ext/spl/tests/array_018.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -SPL: ArrayObject and \0 ---SKIPIF-- - ---FILE-- -offsetSet("\0", "Foo"); -} -catch (Exception $e) -{ - var_dump($e->getMessage()); -} - -var_dump($foo); - -try -{ - $foo = new ArrayObject(); - $data = explode("=", "=Foo"); - $foo->offsetSet($data[0], $data[1]); -} -catch (Exception $e) -{ - var_dump($e->getMessage()); -} - -var_dump($foo); - -?> -===DONE=== ---EXPECTF-- -string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -===DONE=== ---UEXPECTF-- -unicode(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -unicode(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -===DONE=== diff --git a/ext/spl/tests/bug28822.phpt b/ext/spl/tests/bug28822.phpt deleted file mode 100755 index 0cf5575367f65..0000000000000 --- a/ext/spl/tests/bug28822.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #28822 (ArrayObject::offsetExists() works inverted) ---SKIPIF-- - ---FILE-- -offsetSet('key', 'value'); -var_dump($array->offsetExists('key')); -var_dump($array->offsetExists('nokey')); - -?> -===DONE=== ---EXPECT-- -bool(true) -bool(false) -===DONE=== diff --git a/ext/spl/tests/bug31185.phpt b/ext/spl/tests/bug31185.phpt deleted file mode 100755 index aa410ebaae23c..0000000000000 --- a/ext/spl/tests/bug31185.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Bug #31185 (Crash when exceptions thrown from ArrayAccess::offsetUnset()) ---FILE-- -array[$index]); - } - - public function offsetGet($index) { - return $this->array[$index]; - } - - public function offsetSet($index, $value) { - echo __METHOD__ . "($index, $value)\n"; - $this->array[$index] = $value; - } - - public function offsetUnset($index) { - throw new Exception('FAIL'); - unset($this->array[$index]); - } - -} - -$i = 0; $j = 0; -$foo = new FooBar(); -$foo[$j++] = $i++; -$foo[$j++] = $i++; -$foo[$j++] = $i++; -try -{ - unset($foo[1]); -} -catch (Exception $e) -{ - echo "CAUGHT: " . $e->getMessage() . "\n"; -} - -print_R($foo); -?> -===DONE=== ---EXPECT-- -FooBar::offsetSet(0, 0) -FooBar::offsetSet(1, 1) -FooBar::offsetSet(2, 2) -CAUGHT: FAIL -FooBar Object -( - [array:FooBar:private] => Array - ( - [0] => 0 - [1] => 1 - [2] => 2 - ) - -) -===DONE=== diff --git a/ext/spl/tests/bug31346.phpt b/ext/spl/tests/bug31346.phpt deleted file mode 100755 index 9b5618ec0eead..0000000000000 --- a/ext/spl/tests/bug31346.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #31486 (ArrayIterator::next segfaults) ---FILE-- -var1=1; - -$ao = new ArrayObject($obj); - -$i = $ao->getIterator(); - -$ao->offsetUnset($i->key()); -$i->next(); - -?> -===DONE=== ---EXPECTF-- -Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sbug31346.php on line %d -===DONE=== diff --git a/ext/spl/tests/bug31348.phpt b/ext/spl/tests/bug31348.phpt deleted file mode 100755 index 047e4b223ac25..0000000000000 --- a/ext/spl/tests/bug31348.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #31348 (CachingIterator::rewind() leaks) ---FILE-- -rewind(); - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/spl/tests/bug31926.phpt b/ext/spl/tests/bug31926.phpt deleted file mode 100755 index bcc9ed3d2c9d4..0000000000000 --- a/ext/spl/tests/bug31926.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #31926 (php in free() error with RecursiveArrayIterator) ---FILE-- - array('world')); - -$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array)); -foreach($it as $key => $val) { - var_dump($key, $val); -} - -?> ---EXPECT-- -int(0) -string(5) "world" ---UEXPECT-- -int(0) -unicode(5) "world" diff --git a/ext/spl/tests/bug32134.phpt b/ext/spl/tests/bug32134.phpt deleted file mode 100755 index 84001984ac198..0000000000000 --- a/ext/spl/tests/bug32134.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #32134 (Overloading offsetGet/offsetSet) ---FILE-- - 3) exit(1); - return parent::offsetGet($index); - } - - public function offsetSet($index, $newval) - { - echo __METHOD__ . "($index,$newval)\n"; - return parent::offsetSet($index, $newval); - } - -} - -$myArray = new myArray(); - -$myArray->offsetSet('one', 'one'); -var_dump($myArray->offsetGet('one')); - -$myArray['two'] = 'two'; -var_dump($myArray['two']); - -?> -===DONE=== - ---EXPECT-- -myArray::offsetSet(one,one) -myArray::offsetGet(one) -string(3) "one" -myArray::offsetSet(two,two) -myArray::offsetGet(two) -string(3) "two" -===DONE=== ---UEXPECT-- -myArray::offsetSet(one,one) -myArray::offsetGet(one) -unicode(3) "one" -myArray::offsetSet(two,two) -myArray::offsetGet(two) -unicode(3) "two" -===DONE=== diff --git a/ext/spl/tests/bug32394.phpt b/ext/spl/tests/bug32394.phpt deleted file mode 100755 index 8189b23f7a97d..0000000000000 --- a/ext/spl/tests/bug32394.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #32394 (offsetUnset() segfaults in a foreach) ---FILE-- -append(1); - -foreach($object as $key => $value) -{ - $object->offsetUnset($key); -} - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt deleted file mode 100755 index bb2e335a7cadc..0000000000000 --- a/ext/spl/tests/bug33136.phpt +++ /dev/null @@ -1,94 +0,0 @@ ---TEST-- -Bug #33136 method offsetSet in class extended from ArrayObject crash PHP ---FILE-- -data = array(); - parent::__construct($this->data); - } - - function offsetGet($index) - { - echo __METHOD__ . "($index)\n"; - return parent::offsetGet($index); - } - - function offsetSet($index, $value) - { - echo __METHOD__ . "(" . (is_null($index) ? "NULL" : $index) . ",$value)\n"; - parent::offsetSet($index, $value); - } -} - -echo "\n\nInitiate Obj\n"; -$arrayObj = new Collection(); - -echo "Assign values\n"; - -$arrayObj[] = "foo"; -var_dump($arrayObj[0]); - -$arrayObj[] = "bar"; -var_dump($arrayObj[0]); -var_dump($arrayObj[1]); - -$arrayObj["foo"] = "baz"; -var_dump($arrayObj["foo"]); - -print_r($arrayObj); - -var_dump(count($arrayObj)); - -?> -===DONE=== - ---EXPECT-- -Initiate Obj -Assign values -Collection::offsetSet(NULL,foo) -Collection::offsetGet(0) -string(3) "foo" -Collection::offsetSet(NULL,bar) -Collection::offsetGet(0) -string(3) "foo" -Collection::offsetGet(1) -string(3) "bar" -Collection::offsetSet(foo,baz) -Collection::offsetGet(foo) -string(3) "baz" -Collection Object -( - [0] => foo - [1] => bar - [foo] => baz -) -int(3) -===DONE=== ---UEXPECT-- -Initiate Obj -Assign values -Collection::offsetSet(NULL,foo) -Collection::offsetGet(0) -unicode(3) "foo" -Collection::offsetSet(NULL,bar) -Collection::offsetGet(0) -unicode(3) "foo" -Collection::offsetGet(1) -unicode(3) "bar" -Collection::offsetSet(foo,baz) -Collection::offsetGet(foo) -unicode(3) "baz" -Collection Object -( - [0] => foo - [1] => bar - [foo] => baz -) -int(3) -===DONE=== diff --git a/ext/spl/tests/bug34548.phpt b/ext/spl/tests/bug34548.phpt deleted file mode 100644 index dff1375ab0d60..0000000000000 --- a/ext/spl/tests/bug34548.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -bug #34548 (Method append() in class extended from ArrayObject crashes PHP) ---FILE-- -append($value); - } - - public function offsetSet($index, $value) - { - parent::offsetSet($index, $value); - } -} - -$data1=array('one', 'two', 'three'); -$data2=array('four', 'five'); - -$foo=new Collection($data1); -$foo->add($data2); - -print_r($foo->getArrayCopy()); - -echo "Done\n"; -?> ---EXPECT-- -Array -( - [0] => one - [1] => two - [2] => three - [3] => four - [4] => five -) -Done diff --git a/ext/spl/tests/dit_001.phpt b/ext/spl/tests/dit_001.phpt deleted file mode 100755 index f02291c77ba11..0000000000000 --- a/ext/spl/tests/dit_001.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SPL: Problem with casting to string ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -object(DirectoryIterator)#%d (0) { -} -bool(false) -bool(false) -===DONE=== diff --git a/ext/spl/tests/fileobject_001.phpt b/ext/spl/tests/fileobject_001.phpt deleted file mode 100755 index 61f688d79f0d7..0000000000000 --- a/ext/spl/tests/fileobject_001.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -SPL: SplFileObject::seek'ing ---FILE-- -key()); -var_dump($o->current()); -$o->setFlags(SplFileObject::DROP_NEW_LINE); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->next(); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->rewind(); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->seek(4); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); - -echo "===A===\n"; -foreach($o as $n => $l) -{ - var_dump($n, $l); -} - -echo "===B===\n"; -$o = new SplFileObject(dirname(__FILE__) . '/fileobject_001b.txt'); -$o->setFlags(SplFileObject::DROP_NEW_LINE); -foreach($o as $n => $l) -{ - var_dump($n, $l); -} - -?> -===DONE=== ---EXPECT-- -int(0) -string(2) "0 -" -int(0) -string(2) "0 -" -int(0) -int(1) -string(1) "1" -int(1) -int(0) -string(1) "0" -int(0) -int(4) -string(1) "4" -int(4) -===A=== -int(0) -string(1) "0" -int(1) -string(1) "1" -int(2) -string(1) "2" -int(3) -string(1) "3" -int(4) -string(1) "4" -int(5) -string(1) "5" -int(6) -string(0) "" -===B=== -int(0) -string(1) "0" -int(1) -string(1) "1" -int(2) -string(1) "2" -int(3) -string(1) "3" -int(4) -string(1) "4" -int(5) -string(1) "5" -===DONE=== diff --git a/ext/spl/tests/fileobject_001a.txt b/ext/spl/tests/fileobject_001a.txt deleted file mode 100755 index e8371f00609f3..0000000000000 --- a/ext/spl/tests/fileobject_001a.txt +++ /dev/null @@ -1,6 +0,0 @@ -0 -1 -2 -3 -4 -5 diff --git a/ext/spl/tests/fileobject_001b.txt b/ext/spl/tests/fileobject_001b.txt deleted file mode 100755 index 0c4a8b5cd356f..0000000000000 --- a/ext/spl/tests/fileobject_001b.txt +++ /dev/null @@ -1,6 +0,0 @@ -0 -1 -2 -3 -4 -5 \ No newline at end of file diff --git a/ext/spl/tests/fileobject_002.phpt b/ext/spl/tests/fileobject_002.phpt deleted file mode 100755 index 8031e98fdcc9b..0000000000000 --- a/ext/spl/tests/fileobject_002.phpt +++ /dev/null @@ -1,122 +0,0 @@ ---TEST-- -SPL: SplFileObject::fgetc ---FILE-- -key()); - while(($c = $o->fgetc()) !== false) - { - var_dump($o->key(), $c, $o->eof()); - } - echo "===EOF?===\n"; - var_dump($o->eof()); - var_dump($o->key()); - var_dump($o->eof()); -} - -test('fileobject_001a.txt'); -test('fileobject_001b.txt'); - -?> -===DONE=== - ---EXPECT-- -===fileobject_001a.txt=== -int(0) -int(0) -string(1) "0" -bool(false) -int(1) -string(1) " -" -bool(false) -int(1) -string(1) "1" -bool(false) -int(2) -string(1) " -" -bool(false) -int(2) -string(1) "2" -bool(false) -int(3) -string(1) " -" -bool(false) -int(3) -string(1) "3" -bool(false) -int(4) -string(1) " -" -bool(false) -int(4) -string(1) "4" -bool(false) -int(5) -string(1) " -" -bool(false) -int(5) -string(1) "5" -bool(false) -int(6) -string(1) " -" -bool(false) -===EOF?=== -bool(true) -int(6) -bool(true) -===fileobject_001b.txt=== -int(0) -int(0) -string(1) "0" -bool(false) -int(1) -string(1) " -" -bool(false) -int(1) -string(1) "1" -bool(false) -int(2) -string(1) " -" -bool(false) -int(2) -string(1) "2" -bool(false) -int(3) -string(1) " -" -bool(false) -int(3) -string(1) "3" -bool(false) -int(4) -string(1) " -" -bool(false) -int(4) -string(1) "4" -bool(false) -int(5) -string(1) " -" -bool(false) -int(5) -string(1) "5" -bool(false) -===EOF?=== -bool(true) -int(5) -bool(true) -===DONE=== diff --git a/ext/spl/tests/iterator_001.phpt b/ext/spl/tests/iterator_001.phpt deleted file mode 100755 index 2239417778643..0000000000000 --- a/ext/spl/tests/iterator_001.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -SPL: Iterator aggregating inner iterator's methods ---SKIPIF-- - ---FILE-- -a = $a; - } - - public function rewind() - { - echo __METHOD__ . "\n"; - $this->i = 0; - } - - public function valid() - { - $ret = $this->i < count($this->a); - echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; - return $ret; - } - - public function key() - { - echo __METHOD__ . "\n"; - return $this->i; - } - - public function current() - { - echo __METHOD__ . "\n"; - return $this->a[$this->i]; - } - - public function next() - { - echo __METHOD__ . "\n"; - $this->i++; - } - - public function greaterThan($comp) - { - echo get_class($this) . '::' . __FUNCTION__ . '(' . $comp . ")\n"; - return $this->current() > $comp; - } -} - -class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator -{ - public function seek($index) - { - if ($index < count($this->a)) { - $this->i = $index; - } - echo __METHOD__ . '(' . $index . ")\n"; - } -} - -$a = array(1, 2, 3, 4, 5); -$it = new LimitIterator(new NumericArrayIterator($a), 1, 3); -foreach ($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -echo "===SEEKABLE===\n"; -$a = array(1, 2, 3, 4, 5); -$it = new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3); -foreach($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -echo "===STACKED===\n"; -echo "Shows '2 is greater than 2' because the test is actually done with the current value which is 3.\n"; -$a = array(1, 2, 3, 4, 5); -$it = new CachingIterator(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3)); -foreach($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -NumericArrayIterator::__construct -NumericArrayIterator::rewind -NumericArrayIterator::valid(true) -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is less than or equal 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -NumericArrayIterator::next -===SEEKABLE=== -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is less than or equal 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -NumericArrayIterator::next -===STACKED=== -Shows '2 is greater than 2' because the test is actually done with the current value which is 3. -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -===DONE=== diff --git a/ext/spl/tests/iterator_002.phpt b/ext/spl/tests/iterator_002.phpt deleted file mode 100755 index d56a551c3f989..0000000000000 --- a/ext/spl/tests/iterator_002.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -SPL: Iterator using getInnerIterator ---SKIPIF-- - ---FILE-- -current()); - } - - function getChildren() - { - return new RecursiceArrayIterator($this->current()); - } -} - -class CrashIterator extends FilterIterator implements RecursiveIterator -{ - function accept() - { - return true; - } - - function hasChildren() - { - return $this->getInnerIterator()->hasChildren(); - } - - function getChildren() - { - return new RecursiceArrayIterator($this->getInnerIterator()->current()); - } -} - -$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/iterator_003.phpt b/ext/spl/tests/iterator_003.phpt deleted file mode 100755 index c60776cb331a6..0000000000000 --- a/ext/spl/tests/iterator_003.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -SPL: CachingIterator and __toString() ---SKIPIF-- - ---FILE-- -id = $id; - $this->name = $name; - } - - public function __toString() - { - return $this->id . ', ' . $this->name; - } - - public function getId() - { - return $this->id; - } -} - -class StudentIdFilter extends FilterIterator -{ - private $id; - - public function __construct(ArrayObject $students, Student $other) - { - FilterIterator::__construct($students->getIterator()); - $this->id = $other->getId(); - } - - public function accept() - { - echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; - return $this->current()->getId() == $this->id; - } -} - -class StudentList implements IteratorAggregate -{ - private $students; - - public function __construct() - { - $this->students = new ArrayObject(array()); - } - - public function add(Student $student) - { - if (!$this->contains($student)) { - $this->students[] = $student; - } - } - - public function contains(Student $student) - { - foreach ($this->students as $s) - { - if ($s->getId() == $student->getId()) { - return true; - } - } - return false; - } - - public function getIterator() { - return new CachingIterator($this->students->getIterator(), true); - } -} - -$students = new StudentList(); -$students->add(new Student('01234123', 'Joe')); -$students->add(new Student('00000014', 'Bob')); -$students->add(new Student('00000014', 'Foo')); - -// The goal is to verify we can access the cached string value even if it was -// generated by a call to __toString(). To check this we need to access the -// iterator's __toString() method. -$it = $students->getIterator(); -foreach ($it as $student) { - echo $it->__toString(), "\n"; -} -?> -===DONE=== - ---EXPECT-- -01234123, Joe -00000014, Bob -===DONE=== diff --git a/ext/spl/tests/iterator_004.phpt b/ext/spl/tests/iterator_004.phpt deleted file mode 100755 index 4e6006621b237..0000000000000 --- a/ext/spl/tests/iterator_004.phpt +++ /dev/null @@ -1,144 +0,0 @@ ---TEST-- -SPL: SeekableIterator and string keys ---SKIPIF-- - ---FILE-- -a = $a; - } - - public function rewind() - { - echo __METHOD__ . "\n"; - $this->i = 0; - } - - public function valid() - { - $ret = $this->i < count($this->a); - echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; - return $ret; - } - - public function key() - { - echo __METHOD__ . "\n"; - return $this->i; - } - - public function current() - { - echo __METHOD__ . "\n"; - return $this->a[$this->i]; - } - - public function next() - { - echo __METHOD__ . "\n"; - $this->i++; - } -} - -class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator -{ - public function seek($index) - { - if ($index < count($this->a)) { - $this->i = $index; - } - echo __METHOD__ . '(' . $index . ")\n"; - } -} - -$a = array(1, 2, 3, 4, 5); -foreach (new LimitIterator(new NumericArrayIterator($a), 1, 3) as $v) -{ - print "$v\n"; -} - -echo "===SEEKABLE===\n"; -$a = array(1, 2, 3, 4, 5); -foreach(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3) as $v) -{ - print "$v\n"; -} - -echo "===SEEKING===\n"; -$a = array(1, 2, 3, 4, 5); -$l = new LimitIterator(new SeekableNumericArrayIterator($a)); -for($i = 1; $i < 4; $i++) -{ - $l->seek($i); - print $l->current() . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -NumericArrayIterator::__construct -NumericArrayIterator::rewind -NumericArrayIterator::valid(true) -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -NumericArrayIterator::next -===SEEKABLE=== -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -NumericArrayIterator::next -===SEEKING=== -NumericArrayIterator::__construct -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -SeekableNumericArrayIterator::seek(2) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -SeekableNumericArrayIterator::seek(3) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -===DONE=== diff --git a/ext/spl/tests/iterator_005.phpt b/ext/spl/tests/iterator_005.phpt deleted file mode 100755 index 4aae600169776..0000000000000 --- a/ext/spl/tests/iterator_005.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -SPL: IteratorIterator and ArrayIterator/Object ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -ArrayIteratorEx::rewind -int(0) -int(1) -int(2) -int(3) -ArrayObjectEx::getIterator -int(0) -int(1) -int(2) -int(3) -===DONE=== diff --git a/ext/spl/tests/iterator_006.phpt b/ext/spl/tests/iterator_006.phpt deleted file mode 100755 index 05a1cc5a944bb..0000000000000 --- a/ext/spl/tests/iterator_006.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SPL: IteratorIterator and SimpleXMlElement ---SKIPIF-- - ---FILE-- - - - Hello - World - -'); - -foreach (new IteratorIterator($root->child) as $child) { - echo $child."\n"; -} -?> -===DONE=== - ---EXPECT-- -Hello -World -===DONE=== diff --git a/ext/spl/tests/iterator_007.phpt b/ext/spl/tests/iterator_007.phpt deleted file mode 100755 index eb87977ac9bba..0000000000000 --- a/ext/spl/tests/iterator_007.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -SPL: NoRewindIterator ---SKIPIF-- - ---FILE-- -getInnerIterator() as $v) { - var_dump($v); -} - -echo "===1===\n"; -foreach ($it as $v) { - var_dump($v); -} - -$pos =0; - -$it = new NoRewindIteratorEx(new ArrayIteratorEx(range(0,3))); - -echo "===2===\n"; -foreach ($it as $v) { - var_dump($v); - if ($pos++ > 1) { - break; - } -} - -echo "===3===\n"; -foreach ($it as $v) { - var_dump($v); -} - -echo "===4===\n"; -foreach ($it as $v) { - var_dump($v); -} -?> -===DONE=== - ---EXPECT-- -===0=== -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(3) -ArrayIteratorEx::next -ArrayIteratorEx::valid -===1=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===2=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(0) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(1) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(2) -===3=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -int(2) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(3) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===4=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===DONE=== diff --git a/ext/spl/tests/iterator_008.phpt b/ext/spl/tests/iterator_008.phpt deleted file mode 100755 index 5f3c7d89dfb87..0000000000000 --- a/ext/spl/tests/iterator_008.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -SPL: InfiniteIterator ---SKIPIF-- - ---FILE-- - 5) { - break; - } -} - -?> -===DONE=== - ---EXPECT-- -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -===DONE=== diff --git a/ext/spl/tests/iterator_009.phpt b/ext/spl/tests/iterator_009.phpt deleted file mode 100755 index 27a3e0655f179..0000000000000 --- a/ext/spl/tests/iterator_009.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -SPL: EmptyIterator ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECT-- -EmptyIteratorEx::rewind -EmptyIteratorEx::valid -===DONE=== diff --git a/ext/spl/tests/iterator_010.phpt b/ext/spl/tests/iterator_010.phpt deleted file mode 100755 index 39d1000f62d63..0000000000000 --- a/ext/spl/tests/iterator_010.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SPL: EmptyIterator ---FILE-- - $val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== -$val) -{ - echo "$key=>$val\n"; -} - -echo "===InfiniteIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -echo "===Infinite/LimitIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new LimitIterator($it, 1, 2); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===EmptyIterator=== -===InfiniteIterator=== -2=>C -3=>D -0=>A -1=>B -2=>C -===Infinite/LimitIterator=== -1=>B -2=>C -1=>B -2=>C -1=>B -===DONE=== diff --git a/ext/spl/tests/iterator_012.phpt b/ext/spl/tests/iterator_012.phpt deleted file mode 100755 index 09842b0988e66..0000000000000 --- a/ext/spl/tests/iterator_012.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SPL: NoRweindIterator ---FILE-- - 'A', 1 => 'B', 2 => 'C'))); - -echo $it->key() . '=>' . $it->current() . "\n"; - -echo "===Next===\n"; - -$it->next(); - -echo "===Foreach===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===Current=== -0=>A -===Next=== -===Foreach=== -1=>B -2=>C -===DONE=== diff --git a/ext/spl/tests/iterator_013.phpt b/ext/spl/tests/iterator_013.phpt deleted file mode 100755 index 119631c00038a..0000000000000 --- a/ext/spl/tests/iterator_013.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -SPL: AppendIterator ---FILE-- -$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B'))); - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D'))); - -foreach(new NoRewindIterator($it) as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===Empty=== -===Append=== -0=>A -1=>B -===Rewind=== -0=>A -1=>B -===Append=== -2=>C -3=>D -===Rewind=== -0=>A -1=>B -2=>C -3=>D -===DONE=== diff --git a/ext/spl/tests/iterator_014.phpt b/ext/spl/tests/iterator_014.phpt deleted file mode 100755 index 119fad05fbad2..0000000000000 --- a/ext/spl/tests/iterator_014.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and beginChildren/endChildren ---FILE-- -getDepth().")\n"; - } - - function endChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } -} - -foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"))) as $k=>$v) -{ - echo "$k=>$v\n"; -} -?> -===DONE=== - ---EXPECT-- -RecursiveArrayIteratorIterator::rewind -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>a -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ba -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -1=>bbb -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(3) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bcaa -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(3) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ca -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -3=>d -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::valid -MyRecursiveArrayIterator::valid = false -===DONE=== diff --git a/ext/spl/tests/iterator_015.phpt b/ext/spl/tests/iterator_015.phpt deleted file mode 100755 index aa30f79e1f675..0000000000000 --- a/ext/spl/tests/iterator_015.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and beginChildren/endChildren ---FILE-- -\n"; - parent::rewind(); - } - function beginChildren() - { - echo str_repeat(' ',$this->getDepth())."
    \n"; - } - - function endChildren() - { - echo str_repeat(' ',$this->getDepth())."
\n"; - } - function valid() - { - if (!parent::valid()) { - echo "
    \n"; - return false; - } - return true; - } -} - -$arr = array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"); -$obj = new RecursiveArrayIterator($arr); -$rit = new RecursiveArrayIteratorIterator($obj); -foreach($rit as $k=>$v) -{ - echo str_repeat(' ',$rit->getDepth()+1)."$k=>$v\n"; -} -?> -===DONE=== - ---EXPECTF-- -
      - 0=>a -
        - 0=>ba -
          - 0=>bba - 1=>bbb -
        -
          -
            - 0=>bcaa -
          -
        -
      -
        - 0=>ca -
      - 3=>d -
        -===DONE=== diff --git a/ext/spl/tests/iterator_016.phpt b/ext/spl/tests/iterator_016.phpt deleted file mode 100755 index f231c6eb347e2..0000000000000 --- a/ext/spl/tests/iterator_016.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and beginChildren/endChildren ---FILE-- -\n"; - parent::rewind(); - } - function beginChildren() - { - echo str_repeat(' ',$this->getDepth())."
          \n"; - } - - function endChildren() - { - echo str_repeat(' ',$this->getDepth())."
        \n"; - } - function valid() - { - if (!parent::valid()) { - echo "
          \n"; - return false; - } - return true; - } -} - -$arr = array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"); -$obj = new Menu($arr); -$rit = new MenuOutput($obj); -foreach($rit as $k=>$v) -{ - echo str_repeat(' ',$rit->getDepth()+1)."$k=>$v\n"; -} -?> -===DONE=== - ---EXPECTF-- -Menu::getIterator -
            - 0=>a -
              - 0=>ba -
                - 0=>bba - 1=>bbb -
              -
                -
                  - 0=>bcaa -
                -
              -
            -
              - 0=>ca -
            - 3=>d -
              -===DONE=== diff --git a/ext/spl/tests/iterator_017.phpt b/ext/spl/tests/iterator_017.phpt deleted file mode 100755 index 39d1000f62d63..0000000000000 --- a/ext/spl/tests/iterator_017.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -SPL: EmptyIterator ---FILE-- - $val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== -$val) -{ - echo "$key=>$val\n"; -} - -echo "===InfiniteIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -echo "===Infinite/LimitIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new LimitIterator($it, 1, 2); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -?> -===DONE=== -C -3=>D -0=>A -1=>B -2=>C -===Infinite/LimitIterator=== -1=>B -2=>C -1=>B -2=>C -1=>B -===DONE=== diff --git a/ext/spl/tests/iterator_019.phpt b/ext/spl/tests/iterator_019.phpt deleted file mode 100755 index 09842b0988e66..0000000000000 --- a/ext/spl/tests/iterator_019.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SPL: NoRweindIterator ---FILE-- - 'A', 1 => 'B', 2 => 'C'))); - -echo $it->key() . '=>' . $it->current() . "\n"; - -echo "===Next===\n"; - -$it->next(); - -echo "===Foreach===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===Current=== -0=>A -===Next=== -===Foreach=== -1=>B -2=>C -===DONE=== diff --git a/ext/spl/tests/iterator_020.phpt b/ext/spl/tests/iterator_020.phpt deleted file mode 100755 index 119631c00038a..0000000000000 --- a/ext/spl/tests/iterator_020.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -SPL: AppendIterator ---FILE-- -$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B'))); - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D'))); - -foreach(new NoRewindIterator($it) as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===Empty=== -===Append=== -0=>A -1=>B -===Rewind=== -0=>A -1=>B -===Append=== -2=>C -3=>D -===Rewind=== -0=>A -1=>B -2=>C -3=>D -===DONE=== diff --git a/ext/spl/tests/iterator_021.phpt b/ext/spl/tests/iterator_021.phpt deleted file mode 100755 index 4f2395a8e5916..0000000000000 --- a/ext/spl/tests/iterator_021.phpt +++ /dev/null @@ -1,180 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and hasChildren ---FILE-- -max_depth = $max_depth; - parent::__construct($it); - } - - function rewind() - { - echo __METHOD__ . "\n"; - $this->skip = false; - parent::rewind(); - } - - function valid() - { - echo __METHOD__ . "\n"; - if ($this->skip) - { - $this->skip = false; - $this->next(); - } - return parent::valid(); - } - - function current() - { - echo __METHOD__ . "\n"; - return parent::current(); - } - - function key() - { - echo __METHOD__ . "\n"; - return parent::key(); - } - - function next() - { - echo __METHOD__ . "\n"; - parent::next(); - } - - function callHasChildren() - { - $this->skip = false; - $has = parent::callHasChildren(); - $res = $this->getDepth() < $this->max_depth && $has; - echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n"; - if ($has && !$res) - { - $this->over++; - if ($this->over == 2) { - $this->skip = true; - } - } - return $res; - } - - function beginChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } - - function endChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } -} - -foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v) -{ - if (is_array($v)) $v = join('',$v); - echo "$k=>$v\n"; -} -?> -===DONE=== - ---EXPECT-- -RecursiveArrayIteratorIterator::rewind -RecursiveArrayIteratorIterator::callHasChildren(0) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>a -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(1) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -1=>bbb -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bcaa -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(1) = no/no -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ca -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(0) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -3=>d -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::valid -MyRecursiveArrayIterator::valid = false -===DONE=== diff --git a/ext/spl/tests/iterator_022.phpt b/ext/spl/tests/iterator_022.phpt deleted file mode 100755 index 8d055313ace5c..0000000000000 --- a/ext/spl/tests/iterator_022.phpt +++ /dev/null @@ -1,186 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and callHasChildren/callGetChildren ---FILE-- -current(); - } - - function valid() - { - if (!parent::valid()) - { - echo __METHOD__ . " = false\n"; - return false; - } - else - { - return true; - } - } -} - -class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator -{ - private $max_depth; - private $over = 0; - private $skip = false; - - function __construct($it, $max_depth) - { - $this->max_depth = $max_depth; - parent::__construct($it); - } - - function rewind() - { - echo __METHOD__ . "\n"; - $this->skip = false; - parent::rewind(); - } - - function valid() - { - echo __METHOD__ . "\n"; - if ($this->skip) - { - $this->skip = false; - $this->next(); - } - return parent::valid(); - } - - function current() - { - echo __METHOD__ . "\n"; - return parent::current(); - } - - function key() - { - echo __METHOD__ . "\n"; - return parent::key(); - } - - function next() - { - echo __METHOD__ . "\n"; - parent::next(); - } - - function callHasChildren() - { - $this->skip = false; - $has = parent::callHasChildren(); - $res = $this->getDepth() < $this->max_depth && $has; - echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n"; - if ($has && !$res) - { - $this->over++; - if ($this->over == 2) { - $this->skip = true; - } - } - return $res; - } - - function callGetChildren() - { - if ($this->over == 2) - { - echo __METHOD__ . "(skip)\n"; - return NULL; - } - echo __METHOD__ . "(ok:{$this->over})\n"; - return new MyRecursiveArrayIterator($this->current()); - } - - function beginChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } - - function endChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } -} - -try -{ - foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v) - { - if (is_array($v)) $v = join('',$v); - echo "$k=>$v\n"; - } -} -catch(UnexpectedValueException $e) -{ - echo $e->getMessage() . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -RecursiveArrayIteratorIterator::rewind -RecursiveArrayIteratorIterator::callHasChildren(0) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>a -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(1) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -1=>bbb -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bcaa -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(skip) -Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator -===DONE=== diff --git a/ext/spl/tests/iterator_023.phpt b/ext/spl/tests/iterator_023.phpt deleted file mode 100755 index 1b6b4685ec112..0000000000000 --- a/ext/spl/tests/iterator_023.phpt +++ /dev/null @@ -1,193 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and catch getChildren ---FILE-- -current(); - } - - function valid() - { - if (!parent::valid()) - { - echo __METHOD__ . " = false\n"; - return false; - } - else - { - return true; - } - } -} - -class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator -{ - private $max_depth; - private $over = 0; - private $skip = false; - - function __construct($it, $max_depth) - { - $this->max_depth = $max_depth; - parent::__construct($it, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); - } - - function rewind() - { - echo __METHOD__ . "\n"; - $this->skip = false; - parent::rewind(); - } - - function valid() - { - echo __METHOD__ . "\n"; - if ($this->skip) - { - $this->skip = false; - $this->next(); - } - return parent::valid(); - } - - function current() - { - echo __METHOD__ . "\n"; - return parent::current(); - } - - function key() - { - echo __METHOD__ . "\n"; - return parent::key(); - } - - function next() - { - echo __METHOD__ . "\n"; - parent::next(); - } - - function callHasChildren() - { - $this->skip = false; - $has = parent::callHasChildren(); - $res = $this->getDepth() < $this->max_depth && $has; - echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n"; - if ($has && !$res) - { - $this->over++; - if ($this->over == 2) { - $this->skip = true; - } - } - return $res; - } - - function callGetChildren() - { - if ($this->over == 2) - { - echo __METHOD__ . "(throw)\n"; - throw new Exception("Thrown in callGetChildren()"); - } - echo __METHOD__ . "(ok:{$this->over})\n"; - return new MyRecursiveArrayIterator($this->current()); - } - - function beginChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } - - function endChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } -} - -try -{ - foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v) - { - if (is_array($v)) $v = join('',$v); - echo "$k=>$v\n"; - } -} -catch(UnexpectedValueException $e) -{ - echo $e->getMessage() . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -RecursiveArrayIteratorIterator::rewind -RecursiveArrayIteratorIterator::callHasChildren(0) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>a -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(1) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/no -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -1=>bbb -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(ok:0) -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bcaa -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes -RecursiveArrayIteratorIterator::callGetChildren(throw) -RecursiveArrayIteratorIterator::callHasChildren(0) = no/no -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -3=>d -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::valid -MyRecursiveArrayIterator::valid = false -===DONE=== diff --git a/ext/spl/tests/iterator_024.phpt b/ext/spl/tests/iterator_024.phpt deleted file mode 100755 index cecf08e7a3e65..0000000000000 --- a/ext/spl/tests/iterator_024.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator with custom iterator class ---FILE-- -getIteratorClass()); - -try -{ - foreach(new RecursiveIteratorIterator(new ArrayObject($ar)) as $v) echo "$v\n"; -} -catch (InvalidArgumentException $e) -{ - echo $e->getMessage() . "\n"; -} - -echo "===MANUAL===\n"; - -$it->setIteratorClass("RecursiveArrayIterator"); -var_dump($it->getIteratorClass()); -foreach(new RecursiveIteratorIterator($it) as $v) echo "$v\n"; - - -?> -===DONE=== - ---EXPECT-- -1 -2 -31 -32 -331 -4 -string(13) "ArrayIterator" -An instance of RecursiveIterator or IteratorAggregate creating it is required -===MANUAL=== -string(22) "RecursiveArrayIterator" -1 -2 -31 -32 -331 -4 -===DONE=== ---UEXPECT-- -1 -2 -31 -32 -331 -4 -unicode(13) "ArrayIterator" -An instance of RecursiveIterator or IteratorAggregate creating it is required -===MANUAL=== -unicode(22) "RecursiveArrayIterator" -1 -2 -31 -32 -331 -4 -===DONE=== diff --git a/ext/spl/tests/iterator_025.phpt b/ext/spl/tests/iterator_025.phpt deleted file mode 100755 index e582b1f39e889..0000000000000 --- a/ext/spl/tests/iterator_025.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and begin/endIteration() ---FILE-- -rewind(); -foreach($it as $v) echo "$v\n"; -var_dump($it->valid()); - -echo "===MANUAL===\n"; - -$it->rewind(); -while($it->valid()) -{ - echo $it->current() . "\n"; - $it->next(); - break; -} -$it->rewind(); -while($it->valid()) -{ - echo $it->current() . "\n"; - $it->next(); -} - -?> -===DONE=== - ---EXPECT-- -MyRecursiveIteratorIterator::beginIteration() -1 -2 -31 -32 -331 -4 -MyRecursiveIteratorIterator::endIteration() -===MORE=== -MyRecursiveIteratorIterator::beginIteration() -1 -2 -31 -32 -331 -4 -MyRecursiveIteratorIterator::endIteration() -===MORE=== -MyRecursiveIteratorIterator::beginIteration() -1 -2 -31 -32 -331 -4 -MyRecursiveIteratorIterator::endIteration() -bool(false) -===MANUAL=== -MyRecursiveIteratorIterator::beginIteration() -1 -1 -2 -31 -32 -331 -4 -MyRecursiveIteratorIterator::endIteration() -===DONE=== diff --git a/ext/spl/tests/iterator_026.phpt b/ext/spl/tests/iterator_026.phpt deleted file mode 100755 index 8df96f0d2cb9d..0000000000000 --- a/ext/spl/tests/iterator_026.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SPL: CachingIterator::hasNext() ---FILE-- -$v) -{ - echo "$k=>$v\n"; - echo "hasNext: " . ($it->getInnerIterator()->hasNext() ? "yes" : "no") . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -0=>1 -hasNext: yes -1=>2 -hasNext: yes -0=>31 -hasNext: yes -1=>32 -hasNext: yes -0=>331 -hasNext: no -3=>4 -hasNext: no -===DONE=== diff --git a/ext/spl/tests/iterator_027.phpt b/ext/spl/tests/iterator_027.phpt deleted file mode 100755 index 3c2f72238522f..0000000000000 --- a/ext/spl/tests/iterator_027.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -SPL: CachingIterator::FULL_CACHE ---FILE-- -$v) -{ - echo "$k=>$v\n"; -} - -echo "===CHECK===\n"; - -for ($i = 0; $i < 4; $i++) -{ - if (isset($it[$i])) - { - var_dump($i, $it[$i]); - } -} - -$it[2] = 'foo'; -$it[3] = 'bar'; -$it['baz'] = '25'; - -var_dump($it[2]); -var_dump($it[3]); -var_dump($it['baz']); - -unset($it[0]); -unset($it[2]); -unset($it['baz']); - -var_dump(isset($it[0])); // unset -var_dump(isset($it[1])); // still present -var_dump(isset($it[2])); // unset -var_dump(isset($it[3])); // still present -var_dump(isset($it['baz'])); - -echo "===REWIND===\n"; - -$it->rewind(); // cleans and reads first element -var_dump(isset($it[0])); // pre-fetched -var_dump(isset($it[1])); // deleted -var_dump(isset($it[2])); // unset -var_dump(isset($it[3])); // deleted - -?> -===DONE=== - ---EXPECT-- -0=>1 -1=>2 -0=>31 -1=>32 -0=>331 -3=>4 -===CHECK=== -int(0) -int(331) -int(1) -int(32) -int(3) -int(4) -string(3) "foo" -string(3) "bar" -string(2) "25" -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -===REWIND=== -bool(true) -bool(false) -bool(false) -bool(false) -===DONE=== ---UEXPECT-- -0=>1 -1=>2 -0=>31 -1=>32 -0=>331 -3=>4 -===CHECK=== -int(0) -int(331) -int(1) -int(32) -int(3) -int(4) -unicode(3) "foo" -unicode(3) "bar" -unicode(2) "25" -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -===REWIND=== -bool(true) -bool(false) -bool(false) -bool(false) -===DONE=== diff --git a/ext/spl/tests/iterator_028.phpt b/ext/spl/tests/iterator_028.phpt deleted file mode 100755 index 7ec76d814410a..0000000000000 --- a/ext/spl/tests/iterator_028.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and setMaxDepth() ---FILE-- -getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===2===\n"; -$it->setMaxDepth(2); -var_dump($it->getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===X===\n"; -$it->setMaxDepth(); -var_dump($it->getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===3===\n"; -$it->setMaxDepth(3); -var_dump($it->getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===5===\n"; -$it->setMaxDepth(5); -var_dump($it->getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===0===\n"; -$it->setMaxDepth(0); -var_dump($it->getMaxDepth()); -foreach($it as $v) echo $it->getDepth() . ": $v\n"; - -echo "===-1===\n"; -$it->setMaxDepth(-1); -var_dump($it->getMaxDepth()); -try -{ - $it->setMaxDepth(4); - $it->setMaxDepth(-2); -} -catch(Exception $e) -{ - var_dump($e->getMessage()); -} -var_dump($it->getMaxDepth()); -?> -===DONE=== - ---EXPECT-- -===?=== -bool(false) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===2=== -int(2) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -0: 4 -===X=== -bool(false) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===3=== -int(3) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -0: 4 -===5=== -int(5) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===0=== -int(0) -0: 1 -0: 2 -0: 4 -===-1=== -bool(false) -string(33) "Parameter max_depth must be >= -1" -int(4) -===DONE=== ---UEXPECT-- -===?=== -bool(false) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===2=== -int(2) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -0: 4 -===X=== -bool(false) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===3=== -int(3) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -0: 4 -===5=== -int(5) -0: 1 -0: 2 -1: 31 -1: 32 -2: 331 -3: 3321 -4: 33221 -0: 4 -===0=== -int(0) -0: 1 -0: 2 -0: 4 -===-1=== -bool(false) -unicode(33) "Parameter max_depth must be >= -1" -int(4) -===DONE=== diff --git a/ext/spl/tests/iterator_029.phpt b/ext/spl/tests/iterator_029.phpt deleted file mode 100755 index b853f830e4853..0000000000000 --- a/ext/spl/tests/iterator_029.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -SPL: RegExIterator ---FILE-- - "abc", "a2b", 22, "a2d" => 7, 42); - -foreach(new RegExIterator(new ArrayIterator($ar), "/2/") as $k => $v) -{ - echo "$k=>$v\n"; -} - -?> -===KEY=== - $v) -{ - echo "$k=>$v\n"; -} - -?> -===DONE=== - ---EXPECT-- -1=>123 -2=>123 -23=>a2b -24=>22 -25=>42 -===KEY=== -2=>123 -22=>abc -23=>a2b -24=>22 -a2d=>7 -25=>42 -===DONE=== diff --git a/ext/spl/tests/observer_001.phpt b/ext/spl/tests/observer_001.phpt deleted file mode 100755 index e7d72b9e2409c..0000000000000 --- a/ext/spl/tests/observer_001.phpt +++ /dev/null @@ -1,116 +0,0 @@ ---TEST-- -SPL: SplObserver and SplSubject (empty notify) ---FILE-- -name = '$' . $name; - } - - function update(SplSubject $subject) - { - echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n"; - } - - function getName() - { - return $this->name; - } -} - -class SubjectImpl implements SplSubject -{ - protected $name = ''; - protected $observers = array(); - - function __construct($name = 'sub') - { - $this->name = '$' . $name; - } - - function attach(SplObserver $observer) - { - echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n"; - if (!in_array($observer, $this->observers)) - { - $this->observers[] = $observer; - } - } - - function detach(SplObserver $observer) - { - echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n"; - $idx = array_search($observer, $this->observers); - if ($idx !== false) - { - unset($this->observers[$idx]); - } - } - - function notify() - { - echo '$sub->' . __METHOD__ . "();\n"; - foreach($this->observers as $observer) - { - $observer->update($this); - } - } - - function getName() - { - return $this->name; - } -} - -$sub = new SubjectImpl; - -$ob1 = new ObserverImpl("ob1"); -$ob2 = new ObserverImpl("ob2"); -$ob3 = new ObserverImpl("ob3"); - -$sub->attach($ob1); -$sub->attach($ob1); -$sub->attach($ob2); -$sub->attach($ob3); - -$sub->notify(); - -$sub->detach($ob3); - -$sub->notify(); - -$sub->detach($ob2); -$sub->detach($ob1); - -$sub->notify(); - -$sub->attach($ob3); - -$sub->notify(); -?> -===DONE=== ---EXPECT-- -$sub->SubjectImpl::attach($ob1); -$sub->SubjectImpl::attach($ob1); -$sub->SubjectImpl::attach($ob2); -$sub->SubjectImpl::attach($ob3); -$sub->SubjectImpl::notify(); -$ob1->ObserverImpl::update($sub); -$ob2->ObserverImpl::update($sub); -$ob3->ObserverImpl::update($sub); -$sub->SubjectImpl::detach($ob3); -$sub->SubjectImpl::notify(); -$ob1->ObserverImpl::update($sub); -$ob2->ObserverImpl::update($sub); -$sub->SubjectImpl::detach($ob2); -$sub->SubjectImpl::detach($ob1); -$sub->SubjectImpl::notify(); -$sub->SubjectImpl::attach($ob3); -$sub->SubjectImpl::notify(); -$ob3->ObserverImpl::update($sub); -===DONE=== diff --git a/ext/spl/tests/observer_002.phpt b/ext/spl/tests/observer_002.phpt deleted file mode 100755 index 5d006177f2e34..0000000000000 --- a/ext/spl/tests/observer_002.phpt +++ /dev/null @@ -1,199 +0,0 @@ ---TEST-- -SPL: SplObjectStorage ---FILE-- -getName() . ")\n"; - return parent::current(); - } - - function next() - { - echo __METHOD__ . "()\n"; - parent::next(); - } -} - -class ObserverImpl implements SplObserver -{ - protected $name = ''; - - function __construct($name = 'obj') - { - $this->name = '$' . $name; - } - - function update(SplSubject $subject) - { - echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n"; - } - - function getName() - { - return $this->name; - } -} - -class SubjectImpl implements SplSubject -{ - protected $name = ''; - protected $observers; - - function __construct($name = 'sub') - { - $this->observers = new MyObjectStorage; - $this->name = '$' . $name; - } - - function attach(SplObserver $observer) - { - echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n"; - $this->observers->attach($observer); - } - - function detach(SplObserver $observer) - { - echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n"; - $this->observers->detach($observer); - } - - function count() - { - return $this->observers->count(); - } - - function notify() - { - echo $this->name . '->' . __METHOD__ . "();\n"; - foreach($this->observers as $key => $observer) - { - $observer->update($this); - } - } - - function getName() - { - return $this->name; - } - - function contains($obj) - { - return $this->observers->contains($obj); - } -} - -$sub = new SubjectImpl; - -$ob1 = new ObserverImpl("ob1"); -$ob2 = new ObserverImpl("ob2"); -$ob3 = new ObserverImpl("ob3"); - -var_dump($sub->contains($ob1)); -$sub->attach($ob1); -var_dump($sub->contains($ob1)); -$sub->attach($ob1); -$sub->attach($ob2); -$sub->attach($ob3); -var_dump($sub->count()); - -$sub->notify(); - -$sub->detach($ob3); -var_dump($sub->count()); - -$sub->notify(); - -$sub->detach($ob2); -$sub->detach($ob1); -var_dump($sub->count()); - -$sub->notify(); - -$sub->attach($ob3); -var_dump($sub->count()); - -$sub->notify(); - -?> -===DONE=== - ---EXPECT-- -bool(false) -$sub->SubjectImpl::attach($ob1); -bool(true) -$sub->SubjectImpl::attach($ob1); -$sub->SubjectImpl::attach($ob2); -$sub->SubjectImpl::attach($ob3); -int(3) -$sub->SubjectImpl::notify(); -MyObjectStorage::rewind() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob1) -MyObjectStorage::key(0) -$ob1->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob2) -MyObjectStorage::key(1) -$ob2->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob3) -MyObjectStorage::key(2) -$ob3->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(0) -$sub->SubjectImpl::detach($ob3); -int(2) -$sub->SubjectImpl::notify(); -MyObjectStorage::rewind() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob1) -MyObjectStorage::key(0) -$ob1->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob2) -MyObjectStorage::key(1) -$ob2->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(0) -$sub->SubjectImpl::detach($ob2); -$sub->SubjectImpl::detach($ob1); -int(0) -$sub->SubjectImpl::notify(); -MyObjectStorage::rewind() -MyObjectStorage::valid(0) -$sub->SubjectImpl::attach($ob3); -int(1) -$sub->SubjectImpl::notify(); -MyObjectStorage::rewind() -MyObjectStorage::valid(1) -MyObjectStorage::current($ob3) -MyObjectStorage::key(0) -$ob3->ObserverImpl::update($sub); -MyObjectStorage::next() -MyObjectStorage::valid(0) -===DONE=== diff --git a/ext/spl/tests/spl_001.phpt b/ext/spl/tests/spl_001.phpt deleted file mode 100755 index e101272a84dad..0000000000000 --- a/ext/spl/tests/spl_001.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SPL: iterator_to_array() and iterator_count() ---FILE-- -1, 1=>2, 3=>3, 4, "1"=>5)); - -$ar = iterator_to_array($it); - -var_dump(iterator_count($it)); - -print_r($ar); - -foreach($ar as $v) -{ - var_dump($v); -} - -?> -===DONE=== ---EXPECT-- -int(4) -Array -( - [x] => 1 - [1] => 5 - [3] => 3 - [4] => 4 -) -int(1) -int(5) -int(3) -int(4) -===DONE=== diff --git a/ext/spl/tests/spl_002.phpt b/ext/spl/tests/spl_002.phpt deleted file mode 100755 index d8b71b20cfd08..0000000000000 --- a/ext/spl/tests/spl_002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -SPL: Countable ---FILE-- - -===DONE=== ---EXPECT-- -int(4) -===DONE=== diff --git a/ext/spl/tests/spl_003.phpt b/ext/spl/tests/spl_003.phpt deleted file mode 100755 index 1411388612909..0000000000000 --- a/ext/spl/tests/spl_003.phpt +++ /dev/null @@ -1,117 +0,0 @@ ---TEST-- -SPL: class_parents() and class_implements() ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -Warning: class_parents(): Class foo does not exist in %sspl_003.php on line %d -string(3) "foo" - -Warning: class_parents(): Class foo does not exist and could not be loaded in %sspl_003.php on line %d -array(2) { - ["b"]=> - string(1) "b" - ["a"]=> - string(1) "a" -} -array(2) { - ["b"]=> - string(1) "b" - ["a"]=> - string(1) "a" -} -array(1) { - ["a"]=> - string(1) "a" -} -array(1) { - ["a"]=> - string(1) "a" -} -array(0) { -} -bool(false) -bool(false) -string(3) "aaa" - -Warning: class_implements(): Class aaa does not exist and could not be loaded in %sspl_003.php on line %d - -Warning: class_implements(): Class bbb does not exist in %sspl_003.php on line %d -array(0) { -} -array(0) { -} -bool(false) -bool(false) -===DONE=== ---UEXPECTF-- -Warning: class_parents(): Class foo does not exist in %sspl_003.php on line %d -unicode(3) "foo" - -Warning: class_parents(): Class foo does not exist and could not be loaded in %sspl_003.php on line %d -array(2) { - [u"b"]=> - unicode(1) "b" - [u"a"]=> - unicode(1) "a" -} -array(2) { - [u"b"]=> - unicode(1) "b" - [u"a"]=> - unicode(1) "a" -} -array(1) { - [u"a"]=> - unicode(1) "a" -} -array(1) { - [u"a"]=> - unicode(1) "a" -} -array(0) { -} -bool(false) -bool(false) -unicode(3) "aaa" - -Warning: class_implements(): Class aaa does not exist and could not be loaded in %sspl_003.php on line %d - -Warning: class_implements(): Class bbb does not exist in %sspl_003.php on line %d -array(0) { -} -array(0) { -} -bool(false) -bool(false) -===DONE=== \ No newline at end of file diff --git a/ext/spl/tests/spl_autoload_001.phpt b/ext/spl/tests/spl_autoload_001.phpt deleted file mode 100755 index da97ace27ed08..0000000000000 --- a/ext/spl/tests/spl_autoload_001.phpt +++ /dev/null @@ -1,136 +0,0 @@ ---TEST-- -SPL: spl_autoload() and friends ---INI-- -include_path=. ---FILE-- -getMessage() . "\n"; -} - -$test_exts = array(NULL, "1", ".inc,,.php.inc", ""); - -foreach($test_exts as $exts) -{ - echo "===($exts)===\n"; - try - { - spl_autoload("TestClass", $exts); - } - catch(Exception $e) - { - echo 'Exception: ' . $e->getMessage() . "\n"; - } -} - -try -{ - spl_autoload_extensions(".inc,.php.inc"); - spl_autoload("TestClass"); -} -catch(Exception $e) -{ - echo 'Exception: ' . $e->getMessage() . "\n"; -} - -function TestFunc1($classname) -{ - echo __METHOD__ . "($classname)\n"; -} - -function TestFunc2($classname) -{ - echo __METHOD__ . "($classname)\n"; -} - -echo "===SPL_AUTOLOAD()===\n"; - -spl_autoload_register(); - -try -{ - var_dump(spl_autoload_extensions(".inc")); - var_dump(class_exists("TestClass", true)); -} -catch(Exception $e) -{ - echo 'Exception: ' . $e->getMessage() . "\n"; -} - -echo "===REGISTER===\n"; - -spl_autoload_unregister("spl_autoload"); -spl_autoload_register("TestFunc1"); -spl_autoload_register("TestFunc2"); -spl_autoload_register("TestFunc2"); /* 2nd call ignored */ -spl_autoload_extensions(".inc,.class.inc"); /* we do not have spl_autoload_registered yet */ - -try -{ - var_dump(class_exists("TestClass", true)); -} -catch(Exception $e) -{ - echo 'Exception: ' . $e->getMessage() . "\n"; -} - -echo "===LOAD===\n"; - -spl_autoload_register("spl_autoload"); -var_dump(class_exists("TestClass", true)); - -echo "===NOFUNCTION===\n"; - -try -{ - spl_autoload_register("unavailable_autoload_function"); -} -catch(Exception $e) -{ - echo 'Exception: ' . $e->getMessage() . "\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===EMPTY=== -string(9) ".inc,.php" -%stestclass.inc -Exception: Class TestClass could not be loaded -===()=== -Exception: Class TestClass could not be loaded -===(1)=== -Exception: Class TestClass could not be loaded -===(.inc,,.php.inc)=== -%stestclass -%stestclass.php.inc -Exception: Class TestClass could not be loaded -===()=== -Exception: Class TestClass could not be loaded -Exception: Class TestClass could not be loaded -===SPL_AUTOLOAD()=== -string(4) ".inc" -Exception: Class TestClass could not be loaded -===REGISTER=== -TestFunc1(TestClass) -TestFunc2(TestClass) -bool(false) -===LOAD=== -TestFunc1(TestClass) -TestFunc2(TestClass) -%stestclass.class.inc -bool(true) -===NOFUNCTION=== -Exception: Function 'unavailable_autoload_function' not found -===DONE=== diff --git a/ext/spl/tests/spl_autoload_002.phpt b/ext/spl/tests/spl_autoload_002.phpt deleted file mode 100755 index 1bc45ec8089ce..0000000000000 --- a/ext/spl/tests/spl_autoload_002.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -SPL: spl_autoloadfunctions() ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECT-- -bool(false) -array(1) { - [0]=> - string(12) "spl_autoload" -} -array(3) { - [0]=> - string(12) "spl_autoload" - [1]=> - string(16) "SplAutoloadTest1" - [2]=> - string(16) "SplAutoloadTest2" -} -array(2) { - [0]=> - string(12) "spl_autoload" - [1]=> - string(16) "SplAutoloadTest2" -} -bool(false) -array(1) { - [0]=> - string(12) "spl_autoload" -} -bool(false) -===DONE=== ---UEXPECT-- -bool(false) -array(1) { - [0]=> - unicode(12) "spl_autoload" -} -array(3) { - [0]=> - unicode(12) "spl_autoload" - [1]=> - unicode(16) "SplAutoloadTest1" - [2]=> - unicode(16) "SplAutoloadTest2" -} -array(2) { - [0]=> - unicode(12) "spl_autoload" - [1]=> - unicode(16) "SplAutoloadTest2" -} -bool(false) -array(1) { - [0]=> - unicode(12) "spl_autoload" -} -bool(false) -===DONE=== diff --git a/ext/spl/tests/spl_autoload_003.phpt b/ext/spl/tests/spl_autoload_003.phpt deleted file mode 100755 index 00fdd2734f4b3..0000000000000 --- a/ext/spl/tests/spl_autoload_003.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -SPL: spl_autoload() and friends ---INI-- -include_path=. ---FILE-- -getMessage() . "\n"; -} - -?> -===DONE=== - ---EXPECTF-- -TestFunc1(TestClass) -TestFunc2(TestClass) -Exception: Class TestClass missing -===DONE=== diff --git a/ext/spl/tests/spl_autoload_004.phpt b/ext/spl/tests/spl_autoload_004.phpt deleted file mode 100755 index d995961d7a1ab..0000000000000 --- a/ext/spl/tests/spl_autoload_004.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -SPL: spl_autoload() with static methods ---INI-- -include_path=. ---FILE-- - -===DONE=== - ---EXPECTF-- -array(1) { - [0]=> - array(2) { - [0]=> - string(12) "MyAutoLoader" - [1]=> - string(8) "autoLoad" - } -} -MyAutoLoader::autoLoad(TestClass) -bool(false) -===DONE=== ---UEXPECTF-- -array(1) { - [0]=> - array(2) { - [0]=> - unicode(12) "MyAutoLoader" - [1]=> - unicode(8) "autoLoad" - } -} -MyAutoLoader::autoLoad(TestClass) -bool(false) -===DONE=== diff --git a/ext/spl/tests/spl_autoload_005.phpt b/ext/spl/tests/spl_autoload_005.phpt deleted file mode 100755 index 925771c82cc50..0000000000000 --- a/ext/spl/tests/spl_autoload_005.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -SPL: spl_autoload() with methods ---INI-- -include_path=. ---FILE-- -getMessage() . "\n"; -} - -// and - -$myAutoLoader = new MyAutoLoader(); - -spl_autoload_register(array($myAutoLoader, 'autoLoad')); -spl_autoload_register(array($myAutoLoader, 'autoThrow')); - -try -{ - var_dump(class_exists("TestClass", true)); -} -catch(Exception $e) -{ - echo 'Exception: ' . $e->getMessage() . "\n"; -} - -?> -===DONE=== - ---EXPECTF-- -Exception: Passed array specifies a non static method but no object -MyAutoLoader::autoLoad(TestClass) -MyAutoLoader::autoThrow(TestClass) -Exception: Unavailable -===DONE=== diff --git a/ext/spl/tests/sxe_001.phpt b/ext/spl/tests/sxe_001.phpt deleted file mode 100755 index 72180d6a1e4de..0000000000000 --- a/ext/spl/tests/sxe_001.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -SPL: SimpleXMLIterator ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - - - -EOF; - -$sxe = simplexml_load_string($xml, 'SimpleXMLIterator'); - -print_r($sxe); - -?> -===DONE=== ---EXPECT-- -SimpleXMLIterator Object -( - [elem1] => SimpleXMLIterator Object - ( - [comment] => SimpleXMLIterator Object - ( - ) - - [elem2] => SimpleXMLIterator Object - ( - [elem3] => SimpleXMLIterator Object - ( - [elem4] => SimpleXMLIterator Object - ( - [test] => SimpleXMLIterator Object - ( - ) - - ) - - ) - - ) - - ) - -) -===DONE=== diff --git a/ext/spl/tests/sxe_002.phpt b/ext/spl/tests/sxe_002.phpt deleted file mode 100755 index 4734625fcdf17..0000000000000 --- a/ext/spl/tests/sxe_002.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -SPL: SimpleXMLIterator and recursion ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - Foo Bar - - - -EOF; - -$sxe = simplexml_load_string($xml, 'SimpleXMLIterator'); - -foreach(new RecursiveIteratorIterator($sxe, 1) as $name => $data) { - var_dump($name); - var_dump(get_class($data)); - var_dump(trim($data)); -} - -echo "===DUMP===\n"; - -var_dump(get_class($sxe)); -var_dump(trim($sxe->elem1)); - -?> -===DONE=== ---EXPECT-- -string(5) "elem1" -string(17) "SimpleXMLIterator" -string(10) "Bla bla 1." -string(5) "elem2" -string(17) "SimpleXMLIterator" -string(28) "Here we have some text data." -string(5) "elem3" -string(17) "SimpleXMLIterator" -string(19) "And here some more." -string(5) "elem4" -string(17) "SimpleXMLIterator" -string(15) "Wow once again." -string(6) "elem11" -string(17) "SimpleXMLIterator" -string(10) "Bla bla 2." -string(7) "elem111" -string(17) "SimpleXMLIterator" -string(7) "Foo Bar" -===DUMP=== -string(17) "SimpleXMLIterator" -string(10) "Bla bla 1." -===DONE=== ---UEXPECT-- -unicode(5) "elem1" -unicode(17) "SimpleXMLIterator" -unicode(10) "Bla bla 1." -unicode(5) "elem2" -unicode(17) "SimpleXMLIterator" -unicode(28) "Here we have some text data." -unicode(5) "elem3" -unicode(17) "SimpleXMLIterator" -unicode(19) "And here some more." -unicode(5) "elem4" -unicode(17) "SimpleXMLIterator" -unicode(15) "Wow once again." -unicode(6) "elem11" -unicode(17) "SimpleXMLIterator" -unicode(10) "Bla bla 2." -unicode(7) "elem111" -unicode(17) "SimpleXMLIterator" -unicode(7) "Foo Bar" -===DUMP=== -unicode(17) "SimpleXMLIterator" -unicode(10) "Bla bla 1." -===DONE=== diff --git a/ext/spl/tests/sxe_003.phpt b/ext/spl/tests/sxe_003.phpt deleted file mode 100755 index 0d09b4ea6e3ab..0000000000000 --- a/ext/spl/tests/sxe_003.phpt +++ /dev/null @@ -1,96 +0,0 @@ ---TEST-- -SPL: SimpleXMLIterator and getChildren() ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - Foo Bar - - - -EOF; - -$sxe = simplexml_load_string($xml, 'SimpleXMLIterator'); - -foreach($sxe->getChildren() as $name => $data) { - var_dump($name); - var_dump(get_class($data)); - var_dump(trim($data)); -} - -echo "===RESET===\n"; - -for ($sxe->rewind(); $sxe->valid(); $sxe->next()) { - var_dump($sxe->hasChildren()); - var_dump(trim($sxe->key())); - var_dump(trim($sxe->current())); - foreach($sxe->getChildren() as $name => $data) { - var_dump($name); - var_dump(get_class($data)); - var_dump(trim($data)); - } -} - -?> -===DONE=== ---EXPECTF-- - -Warning: Invalid argument supplied for foreach() in %ssxe_003.php on line %d -===RESET=== -bool(true) -string(5) "elem1" -string(10) "Bla bla 1." -string(5) "elem2" -string(17) "SimpleXMLIterator" -string(28) "Here we have some text data." -bool(true) -string(6) "elem11" -string(10) "Bla bla 2." -string(7) "elem111" -string(17) "SimpleXMLIterator" -string(7) "Foo Bar" -===DONE=== ---UEXPECTF-- - -Warning: Invalid argument supplied for foreach() in %ssxe_003.php on line %d -===RESET=== -bool(true) -unicode(5) "elem1" -unicode(10) "Bla bla 1." -unicode(5) "elem2" -unicode(17) "SimpleXMLIterator" -unicode(28) "Here we have some text data." -bool(true) -unicode(6) "elem11" -unicode(10) "Bla bla 2." -unicode(7) "elem111" -unicode(17) "SimpleXMLIterator" -unicode(7) "Foo Bar" -===DONE=== diff --git a/ext/spl/tests/sxe_004.phpt b/ext/spl/tests/sxe_004.phpt deleted file mode 100755 index 487de45071003..0000000000000 --- a/ext/spl/tests/sxe_004.phpt +++ /dev/null @@ -1,206 +0,0 @@ ---TEST-- -SPL: SimpleXMLIterator and getChildren() ---SKIPIF-- - ---FILE-- - - - - Plain text. - - Bla bla 1. - - - Here we have some text data. - - And here some more. - - Wow once again. - - - - - - Bla bla 2. - - Foo Bar - - - -EOF; - -class SXETest extends SimpleXMLIterator -{ - function rewind() - { - echo __METHOD__ . "\n"; - return parent::rewind(); - } - function valid() - { - echo __METHOD__ . "\n"; - return parent::valid(); - } - function current() - { - echo __METHOD__ . "\n"; - return parent::current(); - } - function key() - { - echo __METHOD__ . "\n"; - return parent::key(); - } - function next() - { - echo __METHOD__ . "\n"; - return parent::next(); - } - function hasChildren() - { - echo __METHOD__ . "\n"; - return parent::hasChildren(); - } - function getChildren() - { - echo __METHOD__ . "\n"; - return parent::getChildren(); - } -} - -$sxe = new SXETest($xml); -$rit = new RecursiveIteratorIterator($sxe, RecursiveIteratorIterator::SELF_FIRST); - -foreach($rit as $data) { - var_dump(get_class($data)); - var_dump(trim($data)); -} - -?> -===DONE=== ---EXPECTF-- -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(10) "Bla bla 1." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(28) "Here we have some text data." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(19) "And here some more." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(15) "Wow once again." -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(10) "Bla bla 2." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -string(7) "SXETest" -string(7) "Foo Bar" -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::valid -===DONE=== ---UEXPECTF-- -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(10) "Bla bla 1." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(28) "Here we have some text data." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(19) "And here some more." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(15) "Wow once again." -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(10) "Bla bla 2." -SXETest::getChildren -SXETest::rewind -SXETest::valid -SXETest::hasChildren -SXETest::valid -SXETest::current -unicode(7) "SXETest" -unicode(7) "Foo Bar" -SXETest::next -SXETest::valid -SXETest::next -SXETest::valid -SXETest::valid -===DONE=== diff --git a/ext/spl/tests/testclass b/ext/spl/tests/testclass deleted file mode 100755 index ceb24c877cdc4..0000000000000 --- a/ext/spl/tests/testclass +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/tests/testclass.class.inc b/ext/spl/tests/testclass.class.inc deleted file mode 100755 index f5fe7411fac45..0000000000000 --- a/ext/spl/tests/testclass.class.inc +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/tests/testclass.inc b/ext/spl/tests/testclass.inc deleted file mode 100755 index ceb24c877cdc4..0000000000000 --- a/ext/spl/tests/testclass.inc +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/spl/tests/testclass.php.inc b/ext/spl/tests/testclass.php.inc deleted file mode 100755 index ceb24c877cdc4..0000000000000 --- a/ext/spl/tests/testclass.php.inc +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/sqlite/CREDITS b/ext/sqlite/CREDITS deleted file mode 100644 index f77d1919ce642..0000000000000 --- a/ext/sqlite/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -SQLite -Wez Furlong, Tal Peer, Marcus Boerger, Ilia Alshanetsky diff --git a/ext/sqlite/Makefile.frag b/ext/sqlite/Makefile.frag deleted file mode 100644 index dd691d7980818..0000000000000 --- a/ext/sqlite/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(srcdir)/libsqlite/src/parse.c: $(srcdir)/libsqlite/src/parse.y - @$(LEMON) $(srcdir)/libsqlite/src/parse.y diff --git a/ext/sqlite/README b/ext/sqlite/README deleted file mode 100644 index 2f6cbb0f873ac..0000000000000 --- a/ext/sqlite/README +++ /dev/null @@ -1,14 +0,0 @@ -This is an extension for the SQLite Embeddable SQL Database Engine. -http://www.sqlite.org/ - -SQLite is a C library that implements an embeddable SQL database engine. -Programs that link with the SQLite library can have SQL database access -without running a separate RDBMS process. - -SQLite is not a client library used to connect to a big database server. -SQLite is the server. The SQLite library reads and writes directly to and from -the database files on disk - - - -vim:tw=78:et diff --git a/ext/sqlite/TODO b/ext/sqlite/TODO deleted file mode 100644 index 325ac6fd6c783..0000000000000 --- a/ext/sqlite/TODO +++ /dev/null @@ -1,19 +0,0 @@ -- Implement a PDO driver, called sqlite2 - -- Transparent binary encoding of return values from PHP callback functions. - -- Add user-space callback for the authorizer function (this is potentially - very slow, so it needs to be implemented carefully). - -- Add user-space callback to handle busy databases. - -- Test-suite - - o Test how robust we are when a user-space function is registered as - a callback for a persistent connection in script A, then script B is - called that doesn't register the callback but does make use of the - function in an SQL query. - --> Our test suite doesn't allow us to test persistent connections - at this time :/ - -vim:tw=78 diff --git a/ext/sqlite/config.m4 b/ext/sqlite/config.m4 deleted file mode 100644 index 0962f077aba17..0000000000000 --- a/ext/sqlite/config.m4 +++ /dev/null @@ -1,160 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension sqlite -dnl vim:et:ts=2:sw=2 - -PHP_ARG_WITH(sqlite, for sqlite support, -[ --without-sqlite Do not include sqlite support. - Use --with-sqlite=DIR to specify DIR where - Sqlite include and library files are located, - if not using bundled library.], yes) - -PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite (default: ISO-8859-1), -[ --enable-sqlite-utf8 SQLite: Enable UTF-8 support for SQLite], no, no) - - - -dnl -dnl PHP_PROG_LEMON -dnl -dnl Search for lemon binary and check its version -dnl -AC_DEFUN([PHP_PROG_LEMON],[ - # we only support certain lemon versions - lemon_version_list="1.0" - - AC_CHECK_PROG(LEMON, lemon, lemon) - if test "$LEMON"; then - AC_CACHE_CHECK([for lemon version], php_cv_lemon_version, [ - lemon_version=`$LEMON -x 2>/dev/null | $SED -e 's/^.* //'` - php_cv_lemon_version=invalid - for lemon_check_version in $lemon_version_list; do - if test "$lemon_version" = "$lemon_check_version"; then - php_cv_lemon_version="$lemon_check_version (ok)" - fi - done - ]) - else - lemon_version=none - fi - case $php_cv_lemon_version in - ""|invalid[)] - lemon_msg="lemon versions supported for regeneration of libsqlite parsers: $lemon_version_list (found: $lemon_version)." - AC_MSG_WARN([$lemon_msg]) - LEMON="exit 0;" - ;; - esac - PHP_SUBST(LEMON) -]) - - -if test "$PHP_SQLITE" != "no"; then - if test "$PHP_PDO" != "no"; then - PHP_CHECK_PDO_INCLUDES([], [AC_MSG_WARN([Cannot find php_pdo_driver.h.])]) - if test -n "$pdo_inc_path"; then - AC_DEFINE([PHP_SQLITE2_HAVE_PDO], [1], [Have PDO]) - pdo_inc_path="-I$pdo_inc_path" - fi - fi - - if test "$PHP_SQLITE" != "yes"; then - SEARCH_PATH="/usr/local /usr" - SEARCH_FOR="/include/sqlite.h" - if test -r $PHP_SQLITE/; then # path given as parameter - SQLITE_DIR=$PHP_SQLITE - else # search default path list - AC_MSG_CHECKING([for sqlite files in default path]) - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - SQLITE_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$SQLITE_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org]) - fi - - PHP_CHECK_LIBRARY(sqlite, sqlite_open, [ - PHP_ADD_LIBRARY_WITH_PATH(sqlite, $SQLITE_DIR/$PHP_LIBDIR, SQLITE_SHARED_LIBADD) - PHP_ADD_INCLUDE($SQLITE_DIR/include) - ],[ - AC_MSG_ERROR([wrong sqlite lib version or lib not found]) - ],[ - -L$SQLITE_DIR/$PHP_LIBDIR -lm - ]) - SQLITE_MODULE_TYPE=external - PHP_SQLITE_CFLAGS=$pdo_inc_path - sqlite_extra_sources="libsqlite/src/encode.c" - else - # use bundled library - PHP_PROG_LEMON - SQLITE_MODULE_TYPE=builtin - PHP_SQLITE_CFLAGS="-I@ext_builddir@/libsqlite/src $pdo_inc_path" - sqlite_extra_sources="libsqlite/src/opcodes.c \ - libsqlite/src/parse.c libsqlite/src/encode.c \ - libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \ - libsqlite/src/delete.c libsqlite/src/expr.c libsqlite/src/func.c \ - libsqlite/src/hash.c libsqlite/src/insert.c libsqlite/src/main.c \ - libsqlite/src/os.c libsqlite/src/pager.c \ - libsqlite/src/printf.c libsqlite/src/random.c \ - libsqlite/src/select.c libsqlite/src/table.c libsqlite/src/tokenize.c \ - libsqlite/src/update.c libsqlite/src/util.c libsqlite/src/vdbe.c \ - libsqlite/src/attach.c libsqlite/src/btree_rb.c libsqlite/src/pragma.c \ - libsqlite/src/vacuum.c libsqlite/src/copy.c \ - libsqlite/src/vdbeaux.c libsqlite/src/date.c \ - libsqlite/src/where.c libsqlite/src/trigger.c" - - PHP_ADD_EXTENSION_DEP(sqlite, spl) - PHP_ADD_EXTENSION_DEP(sqlite, pdo) - fi - - dnl - dnl Common for both bundled/external - dnl - sqlite_sources="sqlite.c sess_sqlite.c pdo_sqlite2.c $sqlite_extra_sources" - PHP_NEW_EXTENSION(sqlite, $sqlite_sources, $ext_shared,,$PHP_SQLITE_CFLAGS) - PHP_ADD_MAKEFILE_FRAGMENT - PHP_SUBST(SQLITE_SHARED_LIBADD) - PHP_INSTALL_HEADERS([$ext_builddir/libsqlite/src/sqlite.h]) - - if test "$SQLITE_MODULE_TYPE" = "builtin"; then - PHP_ADD_BUILD_DIR($ext_builddir/libsqlite/src, 1) - AC_CHECK_SIZEOF(char *, 4) - AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer]) - dnl use latin 1 for SQLite older than 2.8.9; the utf-8 handling - dnl in funcs.c uses assert(), which is a bit silly and something - dnl we want to avoid. This assert() was removed in SQLite 2.8.9. - if test "$PHP_SQLITE_UTF8" = "yes"; then - SQLITE_ENCODING="UTF8" - AC_DEFINE(SQLITE_UTF8, 1, [ ]) - else - SQLITE_ENCODING="ISO8859" - fi - PHP_SUBST(SQLITE_ENCODING) - - SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION` - PHP_SUBST(SQLITE_VERSION) - - sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in > $ext_builddir/libsqlite/src/sqlite.h - - if test "$ext_shared" = "no" || test "$ext_srcdir" != "$abs_srcdir"; then - echo '#include ' > $ext_builddir/libsqlite/src/config.h - else - echo "#include \"$abs_builddir/config.h\"" > $ext_builddir/libsqlite/src/config.h - fi - - cat >> $ext_builddir/libsqlite/src/config.h <explain ) return; - db = pParse->db; - if( db->file_format<4 ){ - sqliteErrorMsg(pParse, "cannot attach auxiliary databases to an " - "older format master database", 0); - pParse->rc = SQLITE_ERROR; - return; - } - if( db->nDb>=MAX_ATTACHED+2 ){ - sqliteErrorMsg(pParse, "too many attached databases - max %d", - MAX_ATTACHED); - pParse->rc = SQLITE_ERROR; - return; - } - - zFile = 0; - sqliteSetNString(&zFile, pFilename->z, pFilename->n, 0); - if( zFile==0 ) return; - sqliteDequote(zFile); -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqliteAuthCheck(pParse, SQLITE_ATTACH, zFile, 0, 0)!=SQLITE_OK ){ - sqliteFree(zFile); - return; - } -#endif /* SQLITE_OMIT_AUTHORIZATION */ - - zName = 0; - sqliteSetNString(&zName, pDbname->z, pDbname->n, 0); - if( zName==0 ) return; - sqliteDequote(zName); - for(i=0; inDb; i++){ - if( db->aDb[i].zName && sqliteStrICmp(db->aDb[i].zName, zName)==0 ){ - sqliteErrorMsg(pParse, "database %z is already in use", zName); - pParse->rc = SQLITE_ERROR; - sqliteFree(zFile); - return; - } - } - - if( db->aDb==db->aDbStatic ){ - aNew = sqliteMalloc( sizeof(db->aDb[0])*3 ); - if( aNew==0 ) return; - memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2); - }else{ - aNew = sqliteRealloc(db->aDb, sizeof(db->aDb[0])*(db->nDb+1) ); - if( aNew==0 ) return; - } - db->aDb = aNew; - aNew = &db->aDb[db->nDb++]; - memset(aNew, 0, sizeof(*aNew)); - sqliteHashInit(&aNew->tblHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&aNew->idxHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&aNew->trigHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&aNew->aFKey, SQLITE_HASH_STRING, 1); - aNew->zName = zName; - rc = sqliteBtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt); - if( rc ){ - sqliteErrorMsg(pParse, "unable to open database: %s", zFile); - } -#if SQLITE_HAS_CODEC - { - extern int sqliteCodecAttach(sqlite*, int, void*, int); - char *zKey = 0; - int nKey; - if( pKey && pKey->z && pKey->n ){ - sqliteSetNString(&zKey, pKey->z, pKey->n, 0); - sqliteDequote(zKey); - nKey = strlen(zKey); - }else{ - zKey = 0; - nKey = 0; - } - sqliteCodecAttach(db, db->nDb-1, zKey, nKey); - } -#endif - sqliteFree(zFile); - db->flags &= ~SQLITE_Initialized; - if( pParse->nErr ) return; - if( rc==SQLITE_OK ){ - rc = sqliteInit(pParse->db, &pParse->zErrMsg); - } - if( rc ){ - int i = db->nDb - 1; - assert( i>=2 ); - if( db->aDb[i].pBt ){ - sqliteBtreeClose(db->aDb[i].pBt); - db->aDb[i].pBt = 0; - } - sqliteResetInternalSchema(db, 0); - pParse->nErr++; - pParse->rc = SQLITE_ERROR; - } -} - -/* -** This routine is called by the parser to process a DETACH statement: -** -** DETACH DATABASE dbname -** -** The pDbname argument is the name of the database in the DETACH statement. -*/ -void sqliteDetach(Parse *pParse, Token *pDbname){ - int i; - sqlite *db; - Vdbe *v; - Db *pDb; - - v = sqliteGetVdbe(pParse); - sqliteVdbeAddOp(v, OP_Halt, 0, 0); - if( pParse->explain ) return; - db = pParse->db; - for(i=0; inDb; i++){ - pDb = &db->aDb[i]; - if( pDb->pBt==0 || pDb->zName==0 ) continue; - if( strlen(pDb->zName)!=pDbname->n ) continue; - if( sqliteStrNICmp(pDb->zName, pDbname->z, pDbname->n)==0 ) break; - } - if( i>=db->nDb ){ - sqliteErrorMsg(pParse, "no such database: %T", pDbname); - return; - } - if( i<2 ){ - sqliteErrorMsg(pParse, "cannot detach database %T", pDbname); - return; - } -#ifndef SQLITE_OMIT_AUTHORIZATION - if( sqliteAuthCheck(pParse,SQLITE_DETACH,db->aDb[i].zName,0,0)!=SQLITE_OK ){ - return; - } -#endif /* SQLITE_OMIT_AUTHORIZATION */ - sqliteBtreeClose(pDb->pBt); - pDb->pBt = 0; - sqliteFree(pDb->zName); - sqliteResetInternalSchema(db, i); - if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); - db->nDb--; - if( inDb ){ - db->aDb[i] = db->aDb[db->nDb]; - memset(&db->aDb[db->nDb], 0, sizeof(db->aDb[0])); - sqliteResetInternalSchema(db, i); - } -} - -/* -** Initialize a DbFixer structure. This routine must be called prior -** to passing the structure to one of the sqliteFixAAAA() routines below. -** -** The return value indicates whether or not fixation is required. TRUE -** means we do need to fix the database references, FALSE means we do not. -*/ -int sqliteFixInit( - DbFixer *pFix, /* The fixer to be initialized */ - Parse *pParse, /* Error messages will be written here */ - int iDb, /* This is the database that must must be used */ - const char *zType, /* "view", "trigger", or "index" */ - const Token *pName /* Name of the view, trigger, or index */ -){ - sqlite *db; - - if( iDb<0 || iDb==1 ) return 0; - db = pParse->db; - assert( db->nDb>iDb ); - pFix->pParse = pParse; - pFix->zDb = db->aDb[iDb].zName; - pFix->zType = zType; - pFix->pName = pName; - return 1; -} - -/* -** The following set of routines walk through the parse tree and assign -** a specific database to all table references where the database name -** was left unspecified in the original SQL statement. The pFix structure -** must have been initialized by a prior call to sqliteFixInit(). -** -** These routines are used to make sure that an index, trigger, or -** view in one database does not refer to objects in a different database. -** (Exception: indices, triggers, and views in the TEMP database are -** allowed to refer to anything.) If a reference is explicitly made -** to an object in a different database, an error message is added to -** pParse->zErrMsg and these routines return non-zero. If everything -** checks out, these routines return 0. -*/ -int sqliteFixSrcList( - DbFixer *pFix, /* Context of the fixation */ - SrcList *pList /* The Source list to check and modify */ -){ - int i; - const char *zDb; - - if( pList==0 ) return 0; - zDb = pFix->zDb; - for(i=0; inSrc; i++){ - if( pList->a[i].zDatabase==0 ){ - pList->a[i].zDatabase = sqliteStrDup(zDb); - }else if( sqliteStrICmp(pList->a[i].zDatabase,zDb)!=0 ){ - sqliteErrorMsg(pFix->pParse, - "%s %z cannot reference objects in database %s", - pFix->zType, sqliteStrNDup(pFix->pName->z, pFix->pName->n), - pList->a[i].zDatabase); - return 1; - } - if( sqliteFixSelect(pFix, pList->a[i].pSelect) ) return 1; - if( sqliteFixExpr(pFix, pList->a[i].pOn) ) return 1; - } - return 0; -} -int sqliteFixSelect( - DbFixer *pFix, /* Context of the fixation */ - Select *pSelect /* The SELECT statement to be fixed to one database */ -){ - while( pSelect ){ - if( sqliteFixExprList(pFix, pSelect->pEList) ){ - return 1; - } - if( sqliteFixSrcList(pFix, pSelect->pSrc) ){ - return 1; - } - if( sqliteFixExpr(pFix, pSelect->pWhere) ){ - return 1; - } - if( sqliteFixExpr(pFix, pSelect->pHaving) ){ - return 1; - } - pSelect = pSelect->pPrior; - } - return 0; -} -int sqliteFixExpr( - DbFixer *pFix, /* Context of the fixation */ - Expr *pExpr /* The expression to be fixed to one database */ -){ - while( pExpr ){ - if( sqliteFixSelect(pFix, pExpr->pSelect) ){ - return 1; - } - if( sqliteFixExprList(pFix, pExpr->pList) ){ - return 1; - } - if( sqliteFixExpr(pFix, pExpr->pRight) ){ - return 1; - } - pExpr = pExpr->pLeft; - } - return 0; -} -int sqliteFixExprList( - DbFixer *pFix, /* Context of the fixation */ - ExprList *pList /* The expression to be fixed to one database */ -){ - int i; - if( pList==0 ) return 0; - for(i=0; inExpr; i++){ - if( sqliteFixExpr(pFix, pList->a[i].pExpr) ){ - return 1; - } - } - return 0; -} -int sqliteFixTriggerStep( - DbFixer *pFix, /* Context of the fixation */ - TriggerStep *pStep /* The trigger step be fixed to one database */ -){ - while( pStep ){ - if( sqliteFixSelect(pFix, pStep->pSelect) ){ - return 1; - } - if( sqliteFixExpr(pFix, pStep->pWhere) ){ - return 1; - } - if( sqliteFixExprList(pFix, pStep->pExprList) ){ - return 1; - } - pStep = pStep->pNext; - } - return 0; -} diff --git a/ext/sqlite/libsqlite/src/auth.c b/ext/sqlite/libsqlite/src/auth.c deleted file mode 100644 index 040488077c587..0000000000000 --- a/ext/sqlite/libsqlite/src/auth.c +++ /dev/null @@ -1,219 +0,0 @@ -/* -** 2003 January 11 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the sqlite_set_authorizer() -** API. This facility is an optional feature of the library. Embedded -** systems that do not need this facility may omit it by recompiling -** the library with -DSQLITE_OMIT_AUTHORIZATION=1 -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** All of the code in this file may be omitted by defining a single -** macro. -*/ -#ifndef SQLITE_OMIT_AUTHORIZATION - -/* -** Set or clear the access authorization function. -** -** The access authorization function is be called during the compilation -** phase to verify that the user has read and/or write access permission on -** various fields of the database. The first argument to the auth function -** is a copy of the 3rd argument to this routine. The second argument -** to the auth function is one of these constants: -** -** SQLITE_COPY -** SQLITE_CREATE_INDEX -** SQLITE_CREATE_TABLE -** SQLITE_CREATE_TEMP_INDEX -** SQLITE_CREATE_TEMP_TABLE -** SQLITE_CREATE_TEMP_TRIGGER -** SQLITE_CREATE_TEMP_VIEW -** SQLITE_CREATE_TRIGGER -** SQLITE_CREATE_VIEW -** SQLITE_DELETE -** SQLITE_DROP_INDEX -** SQLITE_DROP_TABLE -** SQLITE_DROP_TEMP_INDEX -** SQLITE_DROP_TEMP_TABLE -** SQLITE_DROP_TEMP_TRIGGER -** SQLITE_DROP_TEMP_VIEW -** SQLITE_DROP_TRIGGER -** SQLITE_DROP_VIEW -** SQLITE_INSERT -** SQLITE_PRAGMA -** SQLITE_READ -** SQLITE_SELECT -** SQLITE_TRANSACTION -** SQLITE_UPDATE -** -** The third and fourth arguments to the auth function are the name of -** the table and the column that are being accessed. The auth function -** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If -** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY -** means that the SQL statement will never-run - the sqlite_exec() call -** will return with an error. SQLITE_IGNORE means that the SQL statement -** should run but attempts to read the specified column will return NULL -** and attempts to write the column will be ignored. -** -** Setting the auth function to NULL disables this hook. The default -** setting of the auth function is NULL. -*/ -int sqlite_set_authorizer( - sqlite *db, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), - void *pArg -){ - db->xAuth = xAuth; - db->pAuthArg = pArg; - return SQLITE_OK; -} - -/* -** Write an error message into pParse->zErrMsg that explains that the -** user-supplied authorization function returned an illegal value. -*/ -static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ - sqliteErrorMsg(pParse, "illegal return value (%d) from the " - "authorization function - should be SQLITE_OK, SQLITE_IGNORE, " - "or SQLITE_DENY", rc); - pParse->rc = SQLITE_MISUSE; -} - -/* -** The pExpr should be a TK_COLUMN expression. The table referred to -** is in pTabList or else it is the NEW or OLD table of a trigger. -** Check to see if it is OK to read this particular column. -** -** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN -** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, -** then generate an error. -*/ -void sqliteAuthRead( - Parse *pParse, /* The parser context */ - Expr *pExpr, /* The expression to check authorization on */ - SrcList *pTabList /* All table that pExpr might refer to */ -){ - sqlite *db = pParse->db; - int rc; - Table *pTab; /* The table being read */ - const char *zCol; /* Name of the column of the table */ - int iSrc; /* Index in pTabList->a[] of table being read */ - const char *zDBase; /* Name of database being accessed */ - TriggerStack *pStack; /* The stack of current triggers */ - - if( db->xAuth==0 ) return; - assert( pExpr->op==TK_COLUMN ); - for(iSrc=0; iSrcnSrc; iSrc++){ - if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break; - } - if( iSrc>=0 && iSrcnSrc ){ - pTab = pTabList->a[iSrc].pTab; - }else if( (pStack = pParse->trigStack)!=0 ){ - /* This must be an attempt to read the NEW or OLD pseudo-tables - ** of a trigger. - */ - assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx ); - pTab = pStack->pTab; - }else{ - return; - } - if( pTab==0 ) return; - if( pExpr->iColumn>=0 ){ - assert( pExpr->iColumnnCol ); - zCol = pTab->aCol[pExpr->iColumn].zName; - }else if( pTab->iPKey>=0 ){ - assert( pTab->iPKeynCol ); - zCol = pTab->aCol[pTab->iPKey].zName; - }else{ - zCol = "ROWID"; - } - assert( pExpr->iDbnDb ); - zDBase = db->aDb[pExpr->iDb].zName; - rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase, - pParse->zAuthContext); - if( rc==SQLITE_IGNORE ){ - pExpr->op = TK_NULL; - }else if( rc==SQLITE_DENY ){ - if( db->nDb>2 || pExpr->iDb!=0 ){ - sqliteErrorMsg(pParse, "access to %s.%s.%s is prohibited", - zDBase, pTab->zName, zCol); - }else{ - sqliteErrorMsg(pParse, "access to %s.%s is prohibited", pTab->zName,zCol); - } - pParse->rc = SQLITE_AUTH; - }else if( rc!=SQLITE_OK ){ - sqliteAuthBadReturnCode(pParse, rc); - } -} - -/* -** Do an authorization check using the code and arguments given. Return -** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY -** is returned, then the error count and error message in pParse are -** modified appropriately. -*/ -int sqliteAuthCheck( - Parse *pParse, - int code, - const char *zArg1, - const char *zArg2, - const char *zArg3 -){ - sqlite *db = pParse->db; - int rc; - - if( db->init.busy || db->xAuth==0 ){ - return SQLITE_OK; - } - rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext); - if( rc==SQLITE_DENY ){ - sqliteErrorMsg(pParse, "not authorized"); - pParse->rc = SQLITE_AUTH; - }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ - rc = SQLITE_DENY; - sqliteAuthBadReturnCode(pParse, rc); - } - return rc; -} - -/* -** Push an authorization context. After this routine is called, the -** zArg3 argument to authorization callbacks will be zContext until -** popped. Or if pParse==0, this routine is a no-op. -*/ -void sqliteAuthContextPush( - Parse *pParse, - AuthContext *pContext, - const char *zContext -){ - pContext->pParse = pParse; - if( pParse ){ - pContext->zAuthContext = pParse->zAuthContext; - pParse->zAuthContext = zContext; - } -} - -/* -** Pop an authorization context that was previously pushed -** by sqliteAuthContextPush -*/ -void sqliteAuthContextPop(AuthContext *pContext){ - if( pContext->pParse ){ - pContext->pParse->zAuthContext = pContext->zAuthContext; - pContext->pParse = 0; - } -} - -#endif /* SQLITE_OMIT_AUTHORIZATION */ diff --git a/ext/sqlite/libsqlite/src/btree.c b/ext/sqlite/libsqlite/src/btree.c deleted file mode 100644 index a367092501253..0000000000000 --- a/ext/sqlite/libsqlite/src/btree.c +++ /dev/null @@ -1,3584 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** $Id$ -** -** This file implements a external (disk-based) database using BTrees. -** For a detailed discussion of BTrees, refer to -** -** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: -** "Sorting And Searching", pages 473-480. Addison-Wesley -** Publishing Company, Reading, Massachusetts. -** -** The basic idea is that each page of the file contains N database -** entries and N+1 pointers to subpages. -** -** ---------------------------------------------------------------- -** | Ptr(0) | Key(0) | Ptr(1) | Key(1) | ... | Key(N) | Ptr(N+1) | -** ---------------------------------------------------------------- -** -** All of the keys on the page that Ptr(0) points to have values less -** than Key(0). All of the keys on page Ptr(1) and its subpages have -** values greater than Key(0) and less than Key(1). All of the keys -** on Ptr(N+1) and its subpages have values greater than Key(N). And -** so forth. -** -** Finding a particular key requires reading O(log(M)) pages from the -** disk where M is the number of entries in the tree. -** -** In this implementation, a single file can hold one or more separate -** BTrees. Each BTree is identified by the index of its root page. The -** key and data for any entry are combined to form the "payload". Up to -** MX_LOCAL_PAYLOAD bytes of payload can be carried directly on the -** database page. If the payload is larger than MX_LOCAL_PAYLOAD bytes -** then surplus bytes are stored on overflow pages. The payload for an -** entry and the preceding pointer are combined to form a "Cell". Each -** page has a small header which contains the Ptr(N+1) pointer. -** -** The first page of the file contains a magic string used to verify that -** the file really is a valid BTree database, a pointer to a list of unused -** pages in the file, and some meta information. The root of the first -** BTree begins on page 2 of the file. (Pages are numbered beginning with -** 1, not 0.) Thus a minimum database contains 2 pages. -*/ -#include "sqliteInt.h" -#include "pager.h" -#include "btree.h" -#include - -/* Forward declarations */ -static BtOps sqliteBtreeOps; -static BtCursorOps sqliteBtreeCursorOps; - -/* -** Macros used for byteswapping. B is a pointer to the Btree -** structure. This is needed to access the Btree.needSwab boolean -** in order to tell if byte swapping is needed or not. -** X is an unsigned integer. SWAB16 byte swaps a 16-bit integer. -** SWAB32 byteswaps a 32-bit integer. -*/ -#define SWAB16(B,X) ((B)->needSwab? swab16((u16)X) : ((u16)X)) -#define SWAB32(B,X) ((B)->needSwab? swab32(X) : (X)) -#define SWAB_ADD(B,X,A) \ - if((B)->needSwab){ X=swab32(swab32(X)+A); }else{ X += (A); } - -/* -** The following global variable - available only if SQLITE_TEST is -** defined - is used to determine whether new databases are created in -** native byte order or in non-native byte order. Non-native byte order -** databases are created for testing purposes only. Under normal operation, -** only native byte-order databases should be created, but we should be -** able to read or write existing databases regardless of the byteorder. -*/ -#ifdef SQLITE_TEST -int btree_native_byte_order = 1; -#else -# define btree_native_byte_order 1 -#endif - -/* -** Forward declarations of structures used only in this file. -*/ -typedef struct PageOne PageOne; -typedef struct MemPage MemPage; -typedef struct PageHdr PageHdr; -typedef struct Cell Cell; -typedef struct CellHdr CellHdr; -typedef struct FreeBlk FreeBlk; -typedef struct OverflowPage OverflowPage; -typedef struct FreelistInfo FreelistInfo; - -/* -** All structures on a database page are aligned to 4-byte boundries. -** This routine rounds up a number of bytes to the next multiple of 4. -** -** This might need to change for computer architectures that require -** and 8-byte alignment boundry for structures. -*/ -#define ROUNDUP(X) ((X+3) & ~3) - -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -*/ -static const char zMagicHeader[] = - "** This file contains an SQLite 2.1 database **"; -#define MAGIC_SIZE (sizeof(zMagicHeader)) - -/* -** This is a magic integer also used to test the integrity of the database -** file. This integer is used in addition to the string above so that -** if the file is written on a little-endian architecture and read -** on a big-endian architectures (or vice versa) we can detect the -** problem. -** -** The number used was obtained at random and has no special -** significance other than the fact that it represents a different -** integer on little-endian and big-endian machines. -*/ -#define MAGIC 0xdae37528 - -/* -** The first page of the database file contains a magic header string -** to identify the file as an SQLite database file. It also contains -** a pointer to the first free page of the file. Page 2 contains the -** root of the principle BTree. The file might contain other BTrees -** rooted on pages above 2. -** -** The first page also contains SQLITE_N_BTREE_META integers that -** can be used by higher-level routines. -** -** Remember that pages are numbered beginning with 1. (See pager.c -** for additional information.) Page 0 does not exist and a page -** number of 0 is used to mean "no such page". -*/ -struct PageOne { - char zMagic[MAGIC_SIZE]; /* String that identifies the file as a database */ - int iMagic; /* Integer to verify correct byte order */ - Pgno freeList; /* First free page in a list of all free pages */ - int nFree; /* Number of pages on the free list */ - int aMeta[SQLITE_N_BTREE_META-1]; /* User defined integers */ -}; - -/* -** Each database page has a header that is an instance of this -** structure. -** -** PageHdr.firstFree is 0 if there is no free space on this page. -** Otherwise, PageHdr.firstFree is the index in MemPage.u.aDisk[] of a -** FreeBlk structure that describes the first block of free space. -** All free space is defined by a linked list of FreeBlk structures. -** -** Data is stored in a linked list of Cell structures. PageHdr.firstCell -** is the index into MemPage.u.aDisk[] of the first cell on the page. The -** Cells are kept in sorted order. -** -** A Cell contains all information about a database entry and a pointer -** to a child page that contains other entries less than itself. In -** other words, the i-th Cell contains both Ptr(i) and Key(i). The -** right-most pointer of the page is contained in PageHdr.rightChild. -*/ -struct PageHdr { - Pgno rightChild; /* Child page that comes after all cells on this page */ - u16 firstCell; /* Index in MemPage.u.aDisk[] of the first cell */ - u16 firstFree; /* Index in MemPage.u.aDisk[] of the first free block */ -}; - -/* -** Entries on a page of the database are called "Cells". Each Cell -** has a header and data. This structure defines the header. The -** key and data (collectively the "payload") follow this header on -** the database page. -** -** A definition of the complete Cell structure is given below. The -** header for the cell must be defined first in order to do some -** of the sizing #defines that follow. -*/ -struct CellHdr { - Pgno leftChild; /* Child page that comes before this cell */ - u16 nKey; /* Number of bytes in the key */ - u16 iNext; /* Index in MemPage.u.aDisk[] of next cell in sorted order */ - u8 nKeyHi; /* Upper 8 bits of key size for keys larger than 64K bytes */ - u8 nDataHi; /* Upper 8 bits of data size when the size is more than 64K */ - u16 nData; /* Number of bytes of data */ -}; - -/* -** The key and data size are split into a lower 16-bit segment and an -** upper 8-bit segment in order to pack them together into a smaller -** space. The following macros reassembly a key or data size back -** into an integer. -*/ -#define NKEY(b,h) (SWAB16(b,h.nKey) + h.nKeyHi*65536) -#define NDATA(b,h) (SWAB16(b,h.nData) + h.nDataHi*65536) - -/* -** The minimum size of a complete Cell. The Cell must contain a header -** and at least 4 bytes of payload. -*/ -#define MIN_CELL_SIZE (sizeof(CellHdr)+4) - -/* -** The maximum number of database entries that can be held in a single -** page of the database. -*/ -#define MX_CELL ((SQLITE_USABLE_SIZE-sizeof(PageHdr))/MIN_CELL_SIZE) - -/* -** The amount of usable space on a single page of the BTree. This is the -** page size minus the overhead of the page header. -*/ -#define USABLE_SPACE (SQLITE_USABLE_SIZE - sizeof(PageHdr)) - -/* -** The maximum amount of payload (in bytes) that can be stored locally for -** a database entry. If the entry contains more data than this, the -** extra goes onto overflow pages. -** -** This number is chosen so that at least 4 cells will fit on every page. -*/ -#define MX_LOCAL_PAYLOAD ((USABLE_SPACE/4-(sizeof(CellHdr)+sizeof(Pgno)))&~3) - -/* -** Data on a database page is stored as a linked list of Cell structures. -** Both the key and the data are stored in aPayload[]. The key always comes -** first. The aPayload[] field grows as necessary to hold the key and data, -** up to a maximum of MX_LOCAL_PAYLOAD bytes. If the size of the key and -** data combined exceeds MX_LOCAL_PAYLOAD bytes, then Cell.ovfl is the -** page number of the first overflow page. -** -** Though this structure is fixed in size, the Cell on the database -** page varies in size. Every cell has a CellHdr and at least 4 bytes -** of payload space. Additional payload bytes (up to the maximum of -** MX_LOCAL_PAYLOAD) and the Cell.ovfl value are allocated only as -** needed. -*/ -struct Cell { - CellHdr h; /* The cell header */ - char aPayload[MX_LOCAL_PAYLOAD]; /* Key and data */ - Pgno ovfl; /* The first overflow page */ -}; - -/* -** Free space on a page is remembered using a linked list of the FreeBlk -** structures. Space on a database page is allocated in increments of -** at least 4 bytes and is always aligned to a 4-byte boundry. The -** linked list of FreeBlks is always kept in order by address. -*/ -struct FreeBlk { - u16 iSize; /* Number of bytes in this block of free space */ - u16 iNext; /* Index in MemPage.u.aDisk[] of the next free block */ -}; - -/* -** The number of bytes of payload that will fit on a single overflow page. -*/ -#define OVERFLOW_SIZE (SQLITE_USABLE_SIZE-sizeof(Pgno)) - -/* -** When the key and data for a single entry in the BTree will not fit in -** the MX_LOCAL_PAYLOAD bytes of space available on the database page, -** then all extra bytes are written to a linked list of overflow pages. -** Each overflow page is an instance of the following structure. -** -** Unused pages in the database are also represented by instances of -** the OverflowPage structure. The PageOne.freeList field is the -** page number of the first page in a linked list of unused database -** pages. -*/ -struct OverflowPage { - Pgno iNext; - char aPayload[OVERFLOW_SIZE]; -}; - -/* -** The PageOne.freeList field points to a linked list of overflow pages -** hold information about free pages. The aPayload section of each -** overflow page contains an instance of the following structure. The -** aFree[] array holds the page number of nFree unused pages in the disk -** file. -*/ -struct FreelistInfo { - int nFree; - Pgno aFree[(OVERFLOW_SIZE-sizeof(int))/sizeof(Pgno)]; -}; - -/* -** For every page in the database file, an instance of the following structure -** is stored in memory. The u.aDisk[] array contains the raw bits read from -** the disk. The rest is auxiliary information held in memory only. The -** auxiliary info is only valid for regular database pages - it is not -** used for overflow pages and pages on the freelist. -** -** Of particular interest in the auxiliary info is the apCell[] entry. Each -** apCell[] entry is a pointer to a Cell structure in u.aDisk[]. The cells are -** put in this array so that they can be accessed in constant time, rather -** than in linear time which would be needed if we had to walk the linked -** list on every access. -** -** Note that apCell[] contains enough space to hold up to two more Cells -** than can possibly fit on one page. In the steady state, every apCell[] -** points to memory inside u.aDisk[]. But in the middle of an insert -** operation, some apCell[] entries may temporarily point to data space -** outside of u.aDisk[]. This is a transient situation that is quickly -** resolved. But while it is happening, it is possible for a database -** page to hold as many as two more cells than it might otherwise hold. -** The extra two entries in apCell[] are an allowance for this situation. -** -** The pParent field points back to the parent page. This allows us to -** walk up the BTree from any leaf to the root. Care must be taken to -** unref() the parent page pointer when this page is no longer referenced. -** The pageDestructor() routine handles that chore. -*/ -struct MemPage { - union u_page_data { - char aDisk[SQLITE_PAGE_SIZE]; /* Page data stored on disk */ - PageHdr hdr; /* Overlay page header */ - } u; - u8 isInit; /* True if auxiliary data is initialized */ - u8 idxShift; /* True if apCell[] indices have changed */ - u8 isOverfull; /* Some apCell[] points outside u.aDisk[] */ - MemPage *pParent; /* The parent of this page. NULL for root */ - int idxParent; /* Index in pParent->apCell[] of this node */ - int nFree; /* Number of free bytes in u.aDisk[] */ - int nCell; /* Number of entries on this page */ - Cell *apCell[MX_CELL+2]; /* All data entires in sorted order */ -}; - -/* -** The in-memory image of a disk page has the auxiliary information appended -** to the end. EXTRA_SIZE is the number of bytes of space needed to hold -** that extra information. -*/ -#define EXTRA_SIZE (sizeof(MemPage)-sizeof(union u_page_data)) - -/* -** Everything we need to know about an open database -*/ -struct Btree { - BtOps *pOps; /* Function table */ - Pager *pPager; /* The page cache */ - BtCursor *pCursor; /* A list of all open cursors */ - PageOne *page1; /* First page of the database */ - u8 inTrans; /* True if a transaction is in progress */ - u8 inCkpt; /* True if there is a checkpoint on the transaction */ - u8 readOnly; /* True if the underlying file is readonly */ - u8 needSwab; /* Need to byte-swapping */ -}; -typedef Btree Bt; - -/* -** A cursor is a pointer to a particular entry in the BTree. -** The entry is identified by its MemPage and the index in -** MemPage.apCell[] of the entry. -*/ -struct BtCursor { - BtCursorOps *pOps; /* Function table */ - Btree *pBt; /* The Btree to which this cursor belongs */ - BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ - BtCursor *pShared; /* Loop of cursors with the same root page */ - Pgno pgnoRoot; /* The root page of this tree */ - MemPage *pPage; /* Page that contains the entry */ - int idx; /* Index of the entry in pPage->apCell[] */ - u8 wrFlag; /* True if writable */ - u8 eSkip; /* Determines if next step operation is a no-op */ - u8 iMatch; /* compare result from last sqliteBtreeMoveto() */ -}; - -/* -** Legal values for BtCursor.eSkip. -*/ -#define SKIP_NONE 0 /* Always step the cursor */ -#define SKIP_NEXT 1 /* The next sqliteBtreeNext() is a no-op */ -#define SKIP_PREV 2 /* The next sqliteBtreePrevious() is a no-op */ -#define SKIP_INVALID 3 /* Calls to Next() and Previous() are invalid */ - -/* Forward declarations */ -static int fileBtreeCloseCursor(BtCursor *pCur); - -/* -** Routines for byte swapping. -*/ -u16 swab16(u16 x){ - return ((x & 0xff)<<8) | ((x>>8)&0xff); -} -u32 swab32(u32 x){ - return ((x & 0xff)<<24) | ((x & 0xff00)<<8) | - ((x>>8) & 0xff00) | ((x>>24)&0xff); -} - -/* -** Compute the total number of bytes that a Cell needs on the main -** database page. The number returned includes the Cell header, -** local payload storage, and the pointer to overflow pages (if -** applicable). Additional space allocated on overflow pages -** is NOT included in the value returned from this routine. -*/ -static int cellSize(Btree *pBt, Cell *pCell){ - int n = NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h); - if( n>MX_LOCAL_PAYLOAD ){ - n = MX_LOCAL_PAYLOAD + sizeof(Pgno); - }else{ - n = ROUNDUP(n); - } - n += sizeof(CellHdr); - return n; -} - -/* -** Defragment the page given. All Cells are moved to the -** beginning of the page and all free space is collected -** into one big FreeBlk at the end of the page. -*/ -static void defragmentPage(Btree *pBt, MemPage *pPage){ - int pc, i, n; - FreeBlk *pFBlk; - char newPage[SQLITE_USABLE_SIZE]; - - assert( sqlitepager_iswriteable(pPage) ); - assert( pPage->isInit ); - pc = sizeof(PageHdr); - pPage->u.hdr.firstCell = SWAB16(pBt, pc); - memcpy(newPage, pPage->u.aDisk, pc); - for(i=0; inCell; i++){ - Cell *pCell = pPage->apCell[i]; - - /* This routine should never be called on an overfull page. The - ** following asserts verify that constraint. */ - assert( Addr(pCell) > Addr(pPage) ); - assert( Addr(pCell) < Addr(pPage) + SQLITE_USABLE_SIZE ); - - n = cellSize(pBt, pCell); - pCell->h.iNext = SWAB16(pBt, pc + n); - memcpy(&newPage[pc], pCell, n); - pPage->apCell[i] = (Cell*)&pPage->u.aDisk[pc]; - pc += n; - } - assert( pPage->nFree==SQLITE_USABLE_SIZE-pc ); - memcpy(pPage->u.aDisk, newPage, pc); - if( pPage->nCell>0 ){ - pPage->apCell[pPage->nCell-1]->h.iNext = 0; - } - pFBlk = (FreeBlk*)&pPage->u.aDisk[pc]; - pFBlk->iSize = SWAB16(pBt, SQLITE_USABLE_SIZE - pc); - pFBlk->iNext = 0; - pPage->u.hdr.firstFree = SWAB16(pBt, pc); - memset(&pFBlk[1], 0, SQLITE_USABLE_SIZE - pc - sizeof(FreeBlk)); -} - -/* -** Allocate nByte bytes of space on a page. nByte must be a -** multiple of 4. -** -** Return the index into pPage->u.aDisk[] of the first byte of -** the new allocation. Or return 0 if there is not enough free -** space on the page to satisfy the allocation request. -** -** If the page contains nBytes of free space but does not contain -** nBytes of contiguous free space, then this routine automatically -** calls defragementPage() to consolidate all free space before -** allocating the new chunk. -*/ -static int allocateSpace(Btree *pBt, MemPage *pPage, int nByte){ - FreeBlk *p; - u16 *pIdx; - int start; - int iSize; -#ifndef NDEBUG - int cnt = 0; -#endif - - assert( sqlitepager_iswriteable(pPage) ); - assert( nByte==ROUNDUP(nByte) ); - assert( pPage->isInit ); - if( pPage->nFreeisOverfull ) return 0; - pIdx = &pPage->u.hdr.firstFree; - p = (FreeBlk*)&pPage->u.aDisk[SWAB16(pBt, *pIdx)]; - while( (iSize = SWAB16(pBt, p->iSize))iNext==0 ){ - defragmentPage(pBt, pPage); - pIdx = &pPage->u.hdr.firstFree; - }else{ - pIdx = &p->iNext; - } - p = (FreeBlk*)&pPage->u.aDisk[SWAB16(pBt, *pIdx)]; - } - if( iSize==nByte ){ - start = SWAB16(pBt, *pIdx); - *pIdx = p->iNext; - }else{ - FreeBlk *pNew; - start = SWAB16(pBt, *pIdx); - pNew = (FreeBlk*)&pPage->u.aDisk[start + nByte]; - pNew->iNext = p->iNext; - pNew->iSize = SWAB16(pBt, iSize - nByte); - *pIdx = SWAB16(pBt, start + nByte); - } - pPage->nFree -= nByte; - return start; -} - -/* -** Return a section of the MemPage.u.aDisk[] to the freelist. -** The first byte of the new free block is pPage->u.aDisk[start] -** and the size of the block is "size" bytes. Size must be -** a multiple of 4. -** -** Most of the effort here is involved in coalesing adjacent -** free blocks into a single big free block. -*/ -static void freeSpace(Btree *pBt, MemPage *pPage, int start, int size){ - int end = start + size; - u16 *pIdx, idx; - FreeBlk *pFBlk; - FreeBlk *pNew; - FreeBlk *pNext; - int iSize; - - assert( sqlitepager_iswriteable(pPage) ); - assert( size == ROUNDUP(size) ); - assert( start == ROUNDUP(start) ); - assert( pPage->isInit ); - pIdx = &pPage->u.hdr.firstFree; - idx = SWAB16(pBt, *pIdx); - while( idx!=0 && idxu.aDisk[idx]; - iSize = SWAB16(pBt, pFBlk->iSize); - if( idx + iSize == start ){ - pFBlk->iSize = SWAB16(pBt, iSize + size); - if( idx + iSize + size == SWAB16(pBt, pFBlk->iNext) ){ - pNext = (FreeBlk*)&pPage->u.aDisk[idx + iSize + size]; - if( pBt->needSwab ){ - pFBlk->iSize = swab16((u16)swab16(pNext->iSize)+iSize+size); - }else{ - pFBlk->iSize += pNext->iSize; - } - pFBlk->iNext = pNext->iNext; - } - pPage->nFree += size; - return; - } - pIdx = &pFBlk->iNext; - idx = SWAB16(pBt, *pIdx); - } - pNew = (FreeBlk*)&pPage->u.aDisk[start]; - if( idx != end ){ - pNew->iSize = SWAB16(pBt, size); - pNew->iNext = SWAB16(pBt, idx); - }else{ - pNext = (FreeBlk*)&pPage->u.aDisk[idx]; - pNew->iSize = SWAB16(pBt, size + SWAB16(pBt, pNext->iSize)); - pNew->iNext = pNext->iNext; - } - *pIdx = SWAB16(pBt, start); - pPage->nFree += size; -} - -/* -** Initialize the auxiliary information for a disk block. -** -** The pParent parameter must be a pointer to the MemPage which -** is the parent of the page being initialized. The root of the -** BTree (usually page 2) has no parent and so for that page, -** pParent==NULL. -** -** Return SQLITE_OK on success. If we see that the page does -** not contain a well-formed database page, then return -** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not -** guarantee that the page is well-formed. It only shows that -** we failed to detect any corruption. -*/ -static int initPage(Bt *pBt, MemPage *pPage, Pgno pgnoThis, MemPage *pParent){ - int idx; /* An index into pPage->u.aDisk[] */ - Cell *pCell; /* A pointer to a Cell in pPage->u.aDisk[] */ - FreeBlk *pFBlk; /* A pointer to a free block in pPage->u.aDisk[] */ - int sz; /* The size of a Cell in bytes */ - int freeSpace; /* Amount of free space on the page */ - - if( pPage->pParent ){ - assert( pPage->pParent==pParent ); - return SQLITE_OK; - } - if( pParent ){ - pPage->pParent = pParent; - sqlitepager_ref(pParent); - } - if( pPage->isInit ) return SQLITE_OK; - pPage->isInit = 1; - pPage->nCell = 0; - freeSpace = USABLE_SPACE; - idx = SWAB16(pBt, pPage->u.hdr.firstCell); - while( idx!=0 ){ - if( idx>SQLITE_USABLE_SIZE-MIN_CELL_SIZE ) goto page_format_error; - if( idxu.aDisk[idx]; - sz = cellSize(pBt, pCell); - if( idx+sz > SQLITE_USABLE_SIZE ) goto page_format_error; - freeSpace -= sz; - pPage->apCell[pPage->nCell++] = pCell; - idx = SWAB16(pBt, pCell->h.iNext); - } - pPage->nFree = 0; - idx = SWAB16(pBt, pPage->u.hdr.firstFree); - while( idx!=0 ){ - int iNext; - if( idx>SQLITE_USABLE_SIZE-sizeof(FreeBlk) ) goto page_format_error; - if( idxu.aDisk[idx]; - pPage->nFree += SWAB16(pBt, pFBlk->iSize); - iNext = SWAB16(pBt, pFBlk->iNext); - if( iNext>0 && iNext <= idx ) goto page_format_error; - idx = iNext; - } - if( pPage->nCell==0 && pPage->nFree==0 ){ - /* As a special case, an uninitialized root page appears to be - ** an empty database */ - return SQLITE_OK; - } - if( pPage->nFree!=freeSpace ) goto page_format_error; - return SQLITE_OK; - -page_format_error: - return SQLITE_CORRUPT; -} - -/* -** Set up a raw page so that it looks like a database page holding -** no entries. -*/ -static void zeroPage(Btree *pBt, MemPage *pPage){ - PageHdr *pHdr; - FreeBlk *pFBlk; - assert( sqlitepager_iswriteable(pPage) ); - memset(pPage, 0, SQLITE_USABLE_SIZE); - pHdr = &pPage->u.hdr; - pHdr->firstCell = 0; - pHdr->firstFree = SWAB16(pBt, sizeof(*pHdr)); - pFBlk = (FreeBlk*)&pHdr[1]; - pFBlk->iNext = 0; - pPage->nFree = SQLITE_USABLE_SIZE - sizeof(*pHdr); - pFBlk->iSize = SWAB16(pBt, pPage->nFree); - pPage->nCell = 0; - pPage->isOverfull = 0; -} - -/* -** This routine is called when the reference count for a page -** reaches zero. We need to unref the pParent pointer when that -** happens. -*/ -static void pageDestructor(void *pData){ - MemPage *pPage = (MemPage*)pData; - if( pPage->pParent ){ - MemPage *pParent = pPage->pParent; - pPage->pParent = 0; - sqlitepager_unref(pParent); - } -} - -/* -** Open a new database. -** -** Actually, this routine just sets up the internal data structures -** for accessing the database. We do not open the database file -** until the first page is loaded. -** -** zFilename is the name of the database file. If zFilename is NULL -** a new database with a random name is created. This randomly named -** database file will be deleted when sqliteBtreeClose() is called. -*/ -int sqliteBtreeOpen( - const char *zFilename, /* Name of the file containing the BTree database */ - int omitJournal, /* if TRUE then do not journal this file */ - int nCache, /* How many pages in the page cache */ - Btree **ppBtree /* Pointer to new Btree object written here */ -){ - Btree *pBt; - int rc; - - /* - ** The following asserts make sure that structures used by the btree are - ** the right size. This is to guard against size changes that result - ** when compiling on a different architecture. - */ - assert( sizeof(u32)==4 ); - assert( sizeof(u16)==2 ); - assert( sizeof(Pgno)==4 ); - assert( sizeof(PageHdr)==8 ); - assert( sizeof(CellHdr)==12 ); - assert( sizeof(FreeBlk)==4 ); - assert( sizeof(OverflowPage)==SQLITE_USABLE_SIZE ); - assert( sizeof(FreelistInfo)==OVERFLOW_SIZE ); - assert( sizeof(ptr)==sizeof(char*) ); - assert( sizeof(uptr)==sizeof(ptr) ); - - pBt = sqliteMalloc( sizeof(*pBt) ); - if( pBt==0 ){ - *ppBtree = 0; - return SQLITE_NOMEM; - } - if( nCache<10 ) nCache = 10; - rc = sqlitepager_open(&pBt->pPager, zFilename, nCache, EXTRA_SIZE, - !omitJournal); - if( rc!=SQLITE_OK ){ - if( pBt->pPager ) sqlitepager_close(pBt->pPager); - sqliteFree(pBt); - *ppBtree = 0; - return rc; - } - sqlitepager_set_destructor(pBt->pPager, pageDestructor); - pBt->pCursor = 0; - pBt->page1 = 0; - pBt->readOnly = sqlitepager_isreadonly(pBt->pPager); - pBt->pOps = &sqliteBtreeOps; - *ppBtree = pBt; - return SQLITE_OK; -} - -/* -** Close an open database and invalidate all cursors. -*/ -static int fileBtreeClose(Btree *pBt){ - while( pBt->pCursor ){ - fileBtreeCloseCursor(pBt->pCursor); - } - sqlitepager_close(pBt->pPager); - sqliteFree(pBt); - return SQLITE_OK; -} - -/* -** Change the limit on the number of pages allowed in the cache. -** -** The maximum number of cache pages is set to the absolute -** value of mxPage. If mxPage is negative, the pager will -** operate asynchronously - it will not stop to do fsync()s -** to insure data is written to the disk surface before -** continuing. Transactions still work if synchronous is off, -** and the database cannot be corrupted if this program -** crashes. But if the operating system crashes or there is -** an abrupt power failure when synchronous is off, the database -** could be left in an inconsistent and unrecoverable state. -** Synchronous is on by default so database corruption is not -** normally a worry. -*/ -static int fileBtreeSetCacheSize(Btree *pBt, int mxPage){ - sqlitepager_set_cachesize(pBt->pPager, mxPage); - return SQLITE_OK; -} - -/* -** Change the way data is synced to disk in order to increase or decrease -** how well the database resists damage due to OS crashes and power -** failures. Level 1 is the same as asynchronous (no syncs() occur and -** there is a high probability of damage) Level 2 is the default. There -** is a very low but non-zero probability of damage. Level 3 reduces the -** probability of damage to near zero but with a write performance reduction. -*/ -static int fileBtreeSetSafetyLevel(Btree *pBt, int level){ - sqlitepager_set_safety_level(pBt->pPager, level); - return SQLITE_OK; -} - -/* -** Get a reference to page1 of the database file. This will -** also acquire a readlock on that file. -** -** SQLITE_OK is returned on success. If the file is not a -** well-formed database file, then SQLITE_CORRUPT is returned. -** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM -** is returned if we run out of memory. SQLITE_PROTOCOL is returned -** if there is a locking protocol violation. -*/ -static int lockBtree(Btree *pBt){ - int rc; - if( pBt->page1 ) return SQLITE_OK; - rc = sqlitepager_get(pBt->pPager, 1, (void**)&pBt->page1); - if( rc!=SQLITE_OK ) return rc; - - /* Do some checking to help insure the file we opened really is - ** a valid database file. - */ - if( sqlitepager_pagecount(pBt->pPager)>0 ){ - PageOne *pP1 = pBt->page1; - if( strcmp(pP1->zMagic,zMagicHeader)!=0 || - (pP1->iMagic!=MAGIC && swab32(pP1->iMagic)!=MAGIC) ){ - rc = SQLITE_NOTADB; - goto page1_init_failed; - } - pBt->needSwab = pP1->iMagic!=MAGIC; - } - return rc; - -page1_init_failed: - sqlitepager_unref(pBt->page1); - pBt->page1 = 0; - return rc; -} - -/* -** If there are no outstanding cursors and we are not in the middle -** of a transaction but there is a read lock on the database, then -** this routine unrefs the first page of the database file which -** has the effect of releasing the read lock. -** -** If there are any outstanding cursors, this routine is a no-op. -** -** If there is a transaction in progress, this routine is a no-op. -*/ -static void unlockBtreeIfUnused(Btree *pBt){ - if( pBt->inTrans==0 && pBt->pCursor==0 && pBt->page1!=0 ){ - sqlitepager_unref(pBt->page1); - pBt->page1 = 0; - pBt->inTrans = 0; - pBt->inCkpt = 0; - } -} - -/* -** Create a new database by initializing the first two pages of the -** file. -*/ -static int newDatabase(Btree *pBt){ - MemPage *pRoot; - PageOne *pP1; - int rc; - if( sqlitepager_pagecount(pBt->pPager)>1 ) return SQLITE_OK; - pP1 = pBt->page1; - rc = sqlitepager_write(pBt->page1); - if( rc ) return rc; - rc = sqlitepager_get(pBt->pPager, 2, (void**)&pRoot); - if( rc ) return rc; - rc = sqlitepager_write(pRoot); - if( rc ){ - sqlitepager_unref(pRoot); - return rc; - } - strcpy(pP1->zMagic, zMagicHeader); - if( btree_native_byte_order ){ - pP1->iMagic = MAGIC; - pBt->needSwab = 0; - }else{ - pP1->iMagic = swab32(MAGIC); - pBt->needSwab = 1; - } - zeroPage(pBt, pRoot); - sqlitepager_unref(pRoot); - return SQLITE_OK; -} - -/* -** Attempt to start a new transaction. -** -** A transaction must be started before attempting any changes -** to the database. None of the following routines will work -** unless a transaction is started first: -** -** sqliteBtreeCreateTable() -** sqliteBtreeCreateIndex() -** sqliteBtreeClearTable() -** sqliteBtreeDropTable() -** sqliteBtreeInsert() -** sqliteBtreeDelete() -** sqliteBtreeUpdateMeta() -*/ -static int fileBtreeBeginTrans(Btree *pBt){ - int rc; - if( pBt->inTrans ) return SQLITE_ERROR; - if( pBt->readOnly ) return SQLITE_READONLY; - if( pBt->page1==0 ){ - rc = lockBtree(pBt); - if( rc!=SQLITE_OK ){ - return rc; - } - } - rc = sqlitepager_begin(pBt->page1); - if( rc==SQLITE_OK ){ - rc = newDatabase(pBt); - } - if( rc==SQLITE_OK ){ - pBt->inTrans = 1; - pBt->inCkpt = 0; - }else{ - unlockBtreeIfUnused(pBt); - } - return rc; -} - -/* -** Commit the transaction currently in progress. -** -** This will release the write lock on the database file. If there -** are no active cursors, it also releases the read lock. -*/ -static int fileBtreeCommit(Btree *pBt){ - int rc; - rc = pBt->readOnly ? SQLITE_OK : sqlitepager_commit(pBt->pPager); - pBt->inTrans = 0; - pBt->inCkpt = 0; - unlockBtreeIfUnused(pBt); - return rc; -} - -/* -** Rollback the transaction in progress. All cursors will be -** invalided by this operation. Any attempt to use a cursor -** that was open at the beginning of this operation will result -** in an error. -** -** This will release the write lock on the database file. If there -** are no active cursors, it also releases the read lock. -*/ -static int fileBtreeRollback(Btree *pBt){ - int rc; - BtCursor *pCur; - if( pBt->inTrans==0 ) return SQLITE_OK; - pBt->inTrans = 0; - pBt->inCkpt = 0; - rc = pBt->readOnly ? SQLITE_OK : sqlitepager_rollback(pBt->pPager); - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->pPage && pCur->pPage->isInit==0 ){ - sqlitepager_unref(pCur->pPage); - pCur->pPage = 0; - } - } - unlockBtreeIfUnused(pBt); - return rc; -} - -/* -** Set the checkpoint for the current transaction. The checkpoint serves -** as a sub-transaction that can be rolled back independently of the -** main transaction. You must start a transaction before starting a -** checkpoint. The checkpoint is ended automatically if the transaction -** commits or rolls back. -** -** Only one checkpoint may be active at a time. It is an error to try -** to start a new checkpoint if another checkpoint is already active. -*/ -static int fileBtreeBeginCkpt(Btree *pBt){ - int rc; - if( !pBt->inTrans || pBt->inCkpt ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - rc = pBt->readOnly ? SQLITE_OK : sqlitepager_ckpt_begin(pBt->pPager); - pBt->inCkpt = 1; - return rc; -} - - -/* -** Commit a checkpoint to transaction currently in progress. If no -** checkpoint is active, this is a no-op. -*/ -static int fileBtreeCommitCkpt(Btree *pBt){ - int rc; - if( pBt->inCkpt && !pBt->readOnly ){ - rc = sqlitepager_ckpt_commit(pBt->pPager); - }else{ - rc = SQLITE_OK; - } - pBt->inCkpt = 0; - return rc; -} - -/* -** Rollback the checkpoint to the current transaction. If there -** is no active checkpoint or transaction, this routine is a no-op. -** -** All cursors will be invalided by this operation. Any attempt -** to use a cursor that was open at the beginning of this operation -** will result in an error. -*/ -static int fileBtreeRollbackCkpt(Btree *pBt){ - int rc; - BtCursor *pCur; - if( pBt->inCkpt==0 || pBt->readOnly ) return SQLITE_OK; - rc = sqlitepager_ckpt_rollback(pBt->pPager); - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->pPage && pCur->pPage->isInit==0 ){ - sqlitepager_unref(pCur->pPage); - pCur->pPage = 0; - } - } - pBt->inCkpt = 0; - return rc; -} - -/* -** Create a new cursor for the BTree whose root is on the page -** iTable. The act of acquiring a cursor gets a read lock on -** the database file. -** -** If wrFlag==0, then the cursor can only be used for reading. -** If wrFlag==1, then the cursor can be used for reading or for -** writing if other conditions for writing are also met. These -** are the conditions that must be met in order for writing to -** be allowed: -** -** 1: The cursor must have been opened with wrFlag==1 -** -** 2: No other cursors may be open with wrFlag==0 on the same table -** -** 3: The database must be writable (not on read-only media) -** -** 4: There must be an active transaction. -** -** Condition 2 warrants further discussion. If any cursor is opened -** on a table with wrFlag==0, that prevents all other cursors from -** writing to that table. This is a kind of "read-lock". When a cursor -** is opened with wrFlag==0 it is guaranteed that the table will not -** change as long as the cursor is open. This allows the cursor to -** do a sequential scan of the table without having to worry about -** entries being inserted or deleted during the scan. Cursors should -** be opened with wrFlag==0 only if this read-lock property is needed. -** That is to say, cursors should be opened with wrFlag==0 only if they -** intend to use the sqliteBtreeNext() system call. All other cursors -** should be opened with wrFlag==1 even if they never really intend -** to write. -** -** No checking is done to make sure that page iTable really is the -** root page of a b-tree. If it is not, then the cursor acquired -** will not work correctly. -*/ -static -int fileBtreeCursor(Btree *pBt, int iTable, int wrFlag, BtCursor **ppCur){ - int rc; - BtCursor *pCur, *pRing; - - if( pBt->readOnly && wrFlag ){ - *ppCur = 0; - return SQLITE_READONLY; - } - if( pBt->page1==0 ){ - rc = lockBtree(pBt); - if( rc!=SQLITE_OK ){ - *ppCur = 0; - return rc; - } - } - pCur = sqliteMalloc( sizeof(*pCur) ); - if( pCur==0 ){ - rc = SQLITE_NOMEM; - goto create_cursor_exception; - } - pCur->pgnoRoot = (Pgno)iTable; - rc = sqlitepager_get(pBt->pPager, pCur->pgnoRoot, (void**)&pCur->pPage); - if( rc!=SQLITE_OK ){ - goto create_cursor_exception; - } - rc = initPage(pBt, pCur->pPage, pCur->pgnoRoot, 0); - if( rc!=SQLITE_OK ){ - goto create_cursor_exception; - } - pCur->pOps = &sqliteBtreeCursorOps; - pCur->pBt = pBt; - pCur->wrFlag = wrFlag; - pCur->idx = 0; - pCur->eSkip = SKIP_INVALID; - pCur->pNext = pBt->pCursor; - if( pCur->pNext ){ - pCur->pNext->pPrev = pCur; - } - pCur->pPrev = 0; - pRing = pBt->pCursor; - while( pRing && pRing->pgnoRoot!=pCur->pgnoRoot ){ pRing = pRing->pNext; } - if( pRing ){ - pCur->pShared = pRing->pShared; - pRing->pShared = pCur; - }else{ - pCur->pShared = pCur; - } - pBt->pCursor = pCur; - *ppCur = pCur; - return SQLITE_OK; - -create_cursor_exception: - *ppCur = 0; - if( pCur ){ - if( pCur->pPage ) sqlitepager_unref(pCur->pPage); - sqliteFree(pCur); - } - unlockBtreeIfUnused(pBt); - return rc; -} - -/* -** Close a cursor. The read lock on the database file is released -** when the last cursor is closed. -*/ -static int fileBtreeCloseCursor(BtCursor *pCur){ - Btree *pBt = pCur->pBt; - if( pCur->pPrev ){ - pCur->pPrev->pNext = pCur->pNext; - }else{ - pBt->pCursor = pCur->pNext; - } - if( pCur->pNext ){ - pCur->pNext->pPrev = pCur->pPrev; - } - if( pCur->pPage ){ - sqlitepager_unref(pCur->pPage); - } - if( pCur->pShared!=pCur ){ - BtCursor *pRing = pCur->pShared; - while( pRing->pShared!=pCur ){ pRing = pRing->pShared; } - pRing->pShared = pCur->pShared; - } - unlockBtreeIfUnused(pBt); - sqliteFree(pCur); - return SQLITE_OK; -} - -/* -** Make a temporary cursor by filling in the fields of pTempCur. -** The temporary cursor is not on the cursor list for the Btree. -*/ -static void getTempCursor(BtCursor *pCur, BtCursor *pTempCur){ - memcpy(pTempCur, pCur, sizeof(*pCur)); - pTempCur->pNext = 0; - pTempCur->pPrev = 0; - if( pTempCur->pPage ){ - sqlitepager_ref(pTempCur->pPage); - } -} - -/* -** Delete a temporary cursor such as was made by the CreateTemporaryCursor() -** function above. -*/ -static void releaseTempCursor(BtCursor *pCur){ - if( pCur->pPage ){ - sqlitepager_unref(pCur->pPage); - } -} - -/* -** Set *pSize to the number of bytes of key in the entry the -** cursor currently points to. Always return SQLITE_OK. -** Failure is not possible. If the cursor is not currently -** pointing to an entry (which can happen, for example, if -** the database is empty) then *pSize is set to 0. -*/ -static int fileBtreeKeySize(BtCursor *pCur, int *pSize){ - Cell *pCell; - MemPage *pPage; - - pPage = pCur->pPage; - assert( pPage!=0 ); - if( pCur->idx >= pPage->nCell ){ - *pSize = 0; - }else{ - pCell = pPage->apCell[pCur->idx]; - *pSize = NKEY(pCur->pBt, pCell->h); - } - return SQLITE_OK; -} - -/* -** Read payload information from the entry that the pCur cursor is -** pointing to. Begin reading the payload at "offset" and read -** a total of "amt" bytes. Put the result in zBuf. -** -** This routine does not make a distinction between key and data. -** It just reads bytes from the payload area. -*/ -static int getPayload(BtCursor *pCur, int offset, int amt, char *zBuf){ - char *aPayload; - Pgno nextPage; - int rc; - Btree *pBt = pCur->pBt; - assert( pCur!=0 && pCur->pPage!=0 ); - assert( pCur->idx>=0 && pCur->idxpPage->nCell ); - aPayload = pCur->pPage->apCell[pCur->idx]->aPayload; - if( offsetMX_LOCAL_PAYLOAD ){ - a = MX_LOCAL_PAYLOAD - offset; - } - memcpy(zBuf, &aPayload[offset], a); - if( a==amt ){ - return SQLITE_OK; - } - offset = 0; - zBuf += a; - amt -= a; - }else{ - offset -= MX_LOCAL_PAYLOAD; - } - if( amt>0 ){ - nextPage = SWAB32(pBt, pCur->pPage->apCell[pCur->idx]->ovfl); - } - while( amt>0 && nextPage ){ - OverflowPage *pOvfl; - rc = sqlitepager_get(pBt->pPager, nextPage, (void**)&pOvfl); - if( rc!=0 ){ - return rc; - } - nextPage = SWAB32(pBt, pOvfl->iNext); - if( offset OVERFLOW_SIZE ){ - a = OVERFLOW_SIZE - offset; - } - memcpy(zBuf, &pOvfl->aPayload[offset], a); - offset = 0; - amt -= a; - zBuf += a; - }else{ - offset -= OVERFLOW_SIZE; - } - sqlitepager_unref(pOvfl); - } - if( amt>0 ){ - return SQLITE_CORRUPT; - } - return SQLITE_OK; -} - -/* -** Read part of the key associated with cursor pCur. A maximum -** of "amt" bytes will be transfered into zBuf[]. The transfer -** begins at "offset". The number of bytes actually read is -** returned. -** -** Change: It used to be that the amount returned will be smaller -** than the amount requested if there are not enough bytes in the key -** to satisfy the request. But now, it must be the case that there -** is enough data available to satisfy the request. If not, an exception -** is raised. The change was made in an effort to boost performance -** by eliminating unneeded tests. -*/ -static int fileBtreeKey(BtCursor *pCur, int offset, int amt, char *zBuf){ - MemPage *pPage; - - assert( amt>=0 ); - assert( offset>=0 ); - assert( pCur->pPage!=0 ); - pPage = pCur->pPage; - if( pCur->idx >= pPage->nCell ){ - return 0; - } - assert( amt+offset <= NKEY(pCur->pBt, pPage->apCell[pCur->idx]->h) ); - getPayload(pCur, offset, amt, zBuf); - return amt; -} - -/* -** Set *pSize to the number of bytes of data in the entry the -** cursor currently points to. Always return SQLITE_OK. -** Failure is not possible. If the cursor is not currently -** pointing to an entry (which can happen, for example, if -** the database is empty) then *pSize is set to 0. -*/ -static int fileBtreeDataSize(BtCursor *pCur, int *pSize){ - Cell *pCell; - MemPage *pPage; - - pPage = pCur->pPage; - assert( pPage!=0 ); - if( pCur->idx >= pPage->nCell ){ - *pSize = 0; - }else{ - pCell = pPage->apCell[pCur->idx]; - *pSize = NDATA(pCur->pBt, pCell->h); - } - return SQLITE_OK; -} - -/* -** Read part of the data associated with cursor pCur. A maximum -** of "amt" bytes will be transfered into zBuf[]. The transfer -** begins at "offset". The number of bytes actually read is -** returned. The amount returned will be smaller than the -** amount requested if there are not enough bytes in the data -** to satisfy the request. -*/ -static int fileBtreeData(BtCursor *pCur, int offset, int amt, char *zBuf){ - Cell *pCell; - MemPage *pPage; - - assert( amt>=0 ); - assert( offset>=0 ); - assert( pCur->pPage!=0 ); - pPage = pCur->pPage; - if( pCur->idx >= pPage->nCell ){ - return 0; - } - pCell = pPage->apCell[pCur->idx]; - assert( amt+offset <= NDATA(pCur->pBt, pCell->h) ); - getPayload(pCur, offset + NKEY(pCur->pBt, pCell->h), amt, zBuf); - return amt; -} - -/* -** Compare an external key against the key on the entry that pCur points to. -** -** The external key is pKey and is nKey bytes long. The last nIgnore bytes -** of the key associated with pCur are ignored, as if they do not exist. -** (The normal case is for nIgnore to be zero in which case the entire -** internal key is used in the comparison.) -** -** The comparison result is written to *pRes as follows: -** -** *pRes<0 This means pCur0 This means pCur>pKey -** -** When one key is an exact prefix of the other, the shorter key is -** considered less than the longer one. In order to be equal the -** keys must be exactly the same length. (The length of the pCur key -** is the actual key length minus nIgnore bytes.) -*/ -static int fileBtreeKeyCompare( - BtCursor *pCur, /* Pointer to entry to compare against */ - const void *pKey, /* Key to compare against entry that pCur points to */ - int nKey, /* Number of bytes in pKey */ - int nIgnore, /* Ignore this many bytes at the end of pCur */ - int *pResult /* Write the result here */ -){ - Pgno nextPage; - int n, c, rc, nLocal; - Cell *pCell; - Btree *pBt = pCur->pBt; - const char *zKey = (const char*)pKey; - - assert( pCur->pPage ); - assert( pCur->idx>=0 && pCur->idxpPage->nCell ); - pCell = pCur->pPage->apCell[pCur->idx]; - nLocal = NKEY(pBt, pCell->h) - nIgnore; - if( nLocal<0 ) nLocal = 0; - n = nKeyMX_LOCAL_PAYLOAD ){ - n = MX_LOCAL_PAYLOAD; - } - c = memcmp(pCell->aPayload, zKey, n); - if( c!=0 ){ - *pResult = c; - return SQLITE_OK; - } - zKey += n; - nKey -= n; - nLocal -= n; - nextPage = SWAB32(pBt, pCell->ovfl); - while( nKey>0 && nLocal>0 ){ - OverflowPage *pOvfl; - if( nextPage==0 ){ - return SQLITE_CORRUPT; - } - rc = sqlitepager_get(pBt->pPager, nextPage, (void**)&pOvfl); - if( rc ){ - return rc; - } - nextPage = SWAB32(pBt, pOvfl->iNext); - n = nKeyOVERFLOW_SIZE ){ - n = OVERFLOW_SIZE; - } - c = memcmp(pOvfl->aPayload, zKey, n); - sqlitepager_unref(pOvfl); - if( c!=0 ){ - *pResult = c; - return SQLITE_OK; - } - nKey -= n; - nLocal -= n; - zKey += n; - } - if( c==0 ){ - c = nLocal - nKey; - } - *pResult = c; - return SQLITE_OK; -} - -/* -** Move the cursor down to a new child page. The newPgno argument is the -** page number of the child page in the byte order of the disk image. -*/ -static int moveToChild(BtCursor *pCur, int newPgno){ - int rc; - MemPage *pNewPage; - Btree *pBt = pCur->pBt; - - newPgno = SWAB32(pBt, newPgno); - rc = sqlitepager_get(pBt->pPager, newPgno, (void**)&pNewPage); - if( rc ) return rc; - rc = initPage(pBt, pNewPage, newPgno, pCur->pPage); - if( rc ) return rc; - assert( pCur->idx>=pCur->pPage->nCell - || pCur->pPage->apCell[pCur->idx]->h.leftChild==SWAB32(pBt,newPgno) ); - assert( pCur->idxpPage->nCell - || pCur->pPage->u.hdr.rightChild==SWAB32(pBt,newPgno) ); - pNewPage->idxParent = pCur->idx; - pCur->pPage->idxShift = 0; - sqlitepager_unref(pCur->pPage); - pCur->pPage = pNewPage; - pCur->idx = 0; - if( pNewPage->nCell<1 ){ - return SQLITE_CORRUPT; - } - return SQLITE_OK; -} - -/* -** Move the cursor up to the parent page. -** -** pCur->idx is set to the cell index that contains the pointer -** to the page we are coming from. If we are coming from the -** right-most child page then pCur->idx is set to one more than -** the largest cell index. -*/ -static void moveToParent(BtCursor *pCur){ - Pgno oldPgno; - MemPage *pParent; - MemPage *pPage; - int idxParent; - pPage = pCur->pPage; - assert( pPage!=0 ); - pParent = pPage->pParent; - assert( pParent!=0 ); - idxParent = pPage->idxParent; - sqlitepager_ref(pParent); - sqlitepager_unref(pPage); - pCur->pPage = pParent; - assert( pParent->idxShift==0 ); - if( pParent->idxShift==0 ){ - pCur->idx = idxParent; -#ifndef NDEBUG - /* Verify that pCur->idx is the correct index to point back to the child - ** page we just came from - */ - oldPgno = SWAB32(pCur->pBt, sqlitepager_pagenumber(pPage)); - if( pCur->idxnCell ){ - assert( pParent->apCell[idxParent]->h.leftChild==oldPgno ); - }else{ - assert( pParent->u.hdr.rightChild==oldPgno ); - } -#endif - }else{ - /* The MemPage.idxShift flag indicates that cell indices might have - ** changed since idxParent was set and hence idxParent might be out - ** of date. So recompute the parent cell index by scanning all cells - ** and locating the one that points to the child we just came from. - */ - int i; - pCur->idx = pParent->nCell; - oldPgno = SWAB32(pCur->pBt, sqlitepager_pagenumber(pPage)); - for(i=0; inCell; i++){ - if( pParent->apCell[i]->h.leftChild==oldPgno ){ - pCur->idx = i; - break; - } - } - } -} - -/* -** Move the cursor to the root page -*/ -static int moveToRoot(BtCursor *pCur){ - MemPage *pNew; - int rc; - Btree *pBt = pCur->pBt; - - rc = sqlitepager_get(pBt->pPager, pCur->pgnoRoot, (void**)&pNew); - if( rc ) return rc; - rc = initPage(pBt, pNew, pCur->pgnoRoot, 0); - if( rc ) return rc; - sqlitepager_unref(pCur->pPage); - pCur->pPage = pNew; - pCur->idx = 0; - return SQLITE_OK; -} - -/* -** Move the cursor down to the left-most leaf entry beneath the -** entry to which it is currently pointing. -*/ -static int moveToLeftmost(BtCursor *pCur){ - Pgno pgno; - int rc; - - while( (pgno = pCur->pPage->apCell[pCur->idx]->h.leftChild)!=0 ){ - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - } - return SQLITE_OK; -} - -/* -** Move the cursor down to the right-most leaf entry beneath the -** page to which it is currently pointing. Notice the difference -** between moveToLeftmost() and moveToRightmost(). moveToLeftmost() -** finds the left-most entry beneath the *entry* whereas moveToRightmost() -** finds the right-most entry beneath the *page*. -*/ -static int moveToRightmost(BtCursor *pCur){ - Pgno pgno; - int rc; - - while( (pgno = pCur->pPage->u.hdr.rightChild)!=0 ){ - pCur->idx = pCur->pPage->nCell; - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - } - pCur->idx = pCur->pPage->nCell - 1; - return SQLITE_OK; -} - -/* Move the cursor to the first entry in the table. Return SQLITE_OK -** on success. Set *pRes to 0 if the cursor actually points to something -** or set *pRes to 1 if the table is empty. -*/ -static int fileBtreeFirst(BtCursor *pCur, int *pRes){ - int rc; - if( pCur->pPage==0 ) return SQLITE_ABORT; - rc = moveToRoot(pCur); - if( rc ) return rc; - if( pCur->pPage->nCell==0 ){ - *pRes = 1; - return SQLITE_OK; - } - *pRes = 0; - rc = moveToLeftmost(pCur); - pCur->eSkip = SKIP_NONE; - return rc; -} - -/* Move the cursor to the last entry in the table. Return SQLITE_OK -** on success. Set *pRes to 0 if the cursor actually points to something -** or set *pRes to 1 if the table is empty. -*/ -static int fileBtreeLast(BtCursor *pCur, int *pRes){ - int rc; - if( pCur->pPage==0 ) return SQLITE_ABORT; - rc = moveToRoot(pCur); - if( rc ) return rc; - assert( pCur->pPage->isInit ); - if( pCur->pPage->nCell==0 ){ - *pRes = 1; - return SQLITE_OK; - } - *pRes = 0; - rc = moveToRightmost(pCur); - pCur->eSkip = SKIP_NONE; - return rc; -} - -/* Move the cursor so that it points to an entry near pKey. -** Return a success code. -** -** If an exact match is not found, then the cursor is always -** left pointing at a leaf page which would hold the entry if it -** were present. The cursor might point to an entry that comes -** before or after the key. -** -** The result of comparing the key with the entry to which the -** cursor is left pointing is stored in pCur->iMatch. The same -** value is also written to *pRes if pRes!=NULL. The meaning of -** this value is as follows: -** -** *pRes<0 The cursor is left pointing at an entry that -** is smaller than pKey or if the table is empty -** and the cursor is therefore left point to nothing. -** -** *pRes==0 The cursor is left pointing at an entry that -** exactly matches pKey. -** -** *pRes>0 The cursor is left pointing at an entry that -** is larger than pKey. -*/ -static -int fileBtreeMoveto(BtCursor *pCur, const void *pKey, int nKey, int *pRes){ - int rc; - if( pCur->pPage==0 ) return SQLITE_ABORT; - pCur->eSkip = SKIP_NONE; - rc = moveToRoot(pCur); - if( rc ) return rc; - for(;;){ - int lwr, upr; - Pgno chldPg; - MemPage *pPage = pCur->pPage; - int c = -1; /* pRes return if table is empty must be -1 */ - lwr = 0; - upr = pPage->nCell-1; - while( lwr<=upr ){ - pCur->idx = (lwr+upr)/2; - rc = fileBtreeKeyCompare(pCur, pKey, nKey, 0, &c); - if( rc ) return rc; - if( c==0 ){ - pCur->iMatch = c; - if( pRes ) *pRes = 0; - return SQLITE_OK; - } - if( c<0 ){ - lwr = pCur->idx+1; - }else{ - upr = pCur->idx-1; - } - } - assert( lwr==upr+1 ); - assert( pPage->isInit ); - if( lwr>=pPage->nCell ){ - chldPg = pPage->u.hdr.rightChild; - }else{ - chldPg = pPage->apCell[lwr]->h.leftChild; - } - if( chldPg==0 ){ - pCur->iMatch = c; - if( pRes ) *pRes = c; - return SQLITE_OK; - } - pCur->idx = lwr; - rc = moveToChild(pCur, chldPg); - if( rc ) return rc; - } - /* NOT REACHED */ -} - -/* -** Advance the cursor to the next entry in the database. If -** successful then set *pRes=0. If the cursor -** was already pointing to the last entry in the database before -** this routine was called, then set *pRes=1. -*/ -static int fileBtreeNext(BtCursor *pCur, int *pRes){ - int rc; - MemPage *pPage = pCur->pPage; - assert( pRes!=0 ); - if( pPage==0 ){ - *pRes = 1; - return SQLITE_ABORT; - } - assert( pPage->isInit ); - assert( pCur->eSkip!=SKIP_INVALID ); - if( pPage->nCell==0 ){ - *pRes = 1; - return SQLITE_OK; - } - assert( pCur->idxnCell ); - if( pCur->eSkip==SKIP_NEXT ){ - pCur->eSkip = SKIP_NONE; - *pRes = 0; - return SQLITE_OK; - } - pCur->eSkip = SKIP_NONE; - pCur->idx++; - if( pCur->idx>=pPage->nCell ){ - if( pPage->u.hdr.rightChild ){ - rc = moveToChild(pCur, pPage->u.hdr.rightChild); - if( rc ) return rc; - rc = moveToLeftmost(pCur); - *pRes = 0; - return rc; - } - do{ - if( pPage->pParent==0 ){ - *pRes = 1; - return SQLITE_OK; - } - moveToParent(pCur); - pPage = pCur->pPage; - }while( pCur->idx>=pPage->nCell ); - *pRes = 0; - return SQLITE_OK; - } - *pRes = 0; - if( pPage->u.hdr.rightChild==0 ){ - return SQLITE_OK; - } - rc = moveToLeftmost(pCur); - return rc; -} - -/* -** Step the cursor to the back to the previous entry in the database. If -** successful then set *pRes=0. If the cursor -** was already pointing to the first entry in the database before -** this routine was called, then set *pRes=1. -*/ -static int fileBtreePrevious(BtCursor *pCur, int *pRes){ - int rc; - Pgno pgno; - MemPage *pPage; - pPage = pCur->pPage; - if( pPage==0 ){ - *pRes = 1; - return SQLITE_ABORT; - } - assert( pPage->isInit ); - assert( pCur->eSkip!=SKIP_INVALID ); - if( pPage->nCell==0 ){ - *pRes = 1; - return SQLITE_OK; - } - if( pCur->eSkip==SKIP_PREV ){ - pCur->eSkip = SKIP_NONE; - *pRes = 0; - return SQLITE_OK; - } - pCur->eSkip = SKIP_NONE; - assert( pCur->idx>=0 ); - if( (pgno = pPage->apCell[pCur->idx]->h.leftChild)!=0 ){ - rc = moveToChild(pCur, pgno); - if( rc ) return rc; - rc = moveToRightmost(pCur); - }else{ - while( pCur->idx==0 ){ - if( pPage->pParent==0 ){ - if( pRes ) *pRes = 1; - return SQLITE_OK; - } - moveToParent(pCur); - pPage = pCur->pPage; - } - pCur->idx--; - rc = SQLITE_OK; - } - *pRes = 0; - return rc; -} - -/* -** Allocate a new page from the database file. -** -** The new page is marked as dirty. (In other words, sqlitepager_write() -** has already been called on the new page.) The new page has also -** been referenced and the calling routine is responsible for calling -** sqlitepager_unref() on the new page when it is done. -** -** SQLITE_OK is returned on success. Any other return value indicates -** an error. *ppPage and *pPgno are undefined in the event of an error. -** Do not invoke sqlitepager_unref() on *ppPage if an error is returned. -** -** If the "nearby" parameter is not 0, then a (feeble) effort is made to -** locate a page close to the page number "nearby". This can be used in an -** attempt to keep related pages close to each other in the database file, -** which in turn can make database access faster. -*/ -static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno nearby){ - PageOne *pPage1 = pBt->page1; - int rc; - if( pPage1->freeList ){ - OverflowPage *pOvfl; - FreelistInfo *pInfo; - - rc = sqlitepager_write(pPage1); - if( rc ) return rc; - SWAB_ADD(pBt, pPage1->nFree, -1); - rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList), - (void**)&pOvfl); - if( rc ) return rc; - rc = sqlitepager_write(pOvfl); - if( rc ){ - sqlitepager_unref(pOvfl); - return rc; - } - pInfo = (FreelistInfo*)pOvfl->aPayload; - if( pInfo->nFree==0 ){ - *pPgno = SWAB32(pBt, pPage1->freeList); - pPage1->freeList = pOvfl->iNext; - *ppPage = (MemPage*)pOvfl; - }else{ - int closest, n; - n = SWAB32(pBt, pInfo->nFree); - if( n>1 && nearby>0 ){ - int i, dist; - closest = 0; - dist = SWAB32(pBt, pInfo->aFree[0]) - nearby; - if( dist<0 ) dist = -dist; - for(i=1; iaFree[i]) - nearby; - if( d2<0 ) d2 = -d2; - if( d2nFree, -1); - *pPgno = SWAB32(pBt, pInfo->aFree[closest]); - pInfo->aFree[closest] = pInfo->aFree[n-1]; - rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage); - sqlitepager_unref(pOvfl); - if( rc==SQLITE_OK ){ - sqlitepager_dont_rollback(*ppPage); - rc = sqlitepager_write(*ppPage); - } - } - }else{ - *pPgno = sqlitepager_pagecount(pBt->pPager) + 1; - rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage); - if( rc ) return rc; - rc = sqlitepager_write(*ppPage); - } - return rc; -} - -/* -** Add a page of the database file to the freelist. Either pgno or -** pPage but not both may be 0. -** -** sqlitepager_unref() is NOT called for pPage. -*/ -static int freePage(Btree *pBt, void *pPage, Pgno pgno){ - PageOne *pPage1 = pBt->page1; - OverflowPage *pOvfl = (OverflowPage*)pPage; - int rc; - int needUnref = 0; - MemPage *pMemPage; - - if( pgno==0 ){ - assert( pOvfl!=0 ); - pgno = sqlitepager_pagenumber(pOvfl); - } - assert( pgno>2 ); - assert( sqlitepager_pagenumber(pOvfl)==pgno ); - pMemPage = (MemPage*)pPage; - pMemPage->isInit = 0; - if( pMemPage->pParent ){ - sqlitepager_unref(pMemPage->pParent); - pMemPage->pParent = 0; - } - rc = sqlitepager_write(pPage1); - if( rc ){ - return rc; - } - SWAB_ADD(pBt, pPage1->nFree, 1); - if( pPage1->nFree!=0 && pPage1->freeList!=0 ){ - OverflowPage *pFreeIdx; - rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList), - (void**)&pFreeIdx); - if( rc==SQLITE_OK ){ - FreelistInfo *pInfo = (FreelistInfo*)pFreeIdx->aPayload; - int n = SWAB32(pBt, pInfo->nFree); - if( n<(sizeof(pInfo->aFree)/sizeof(pInfo->aFree[0])) ){ - rc = sqlitepager_write(pFreeIdx); - if( rc==SQLITE_OK ){ - pInfo->aFree[n] = SWAB32(pBt, pgno); - SWAB_ADD(pBt, pInfo->nFree, 1); - sqlitepager_unref(pFreeIdx); - sqlitepager_dont_write(pBt->pPager, pgno); - return rc; - } - } - sqlitepager_unref(pFreeIdx); - } - } - if( pOvfl==0 ){ - assert( pgno>0 ); - rc = sqlitepager_get(pBt->pPager, pgno, (void**)&pOvfl); - if( rc ) return rc; - needUnref = 1; - } - rc = sqlitepager_write(pOvfl); - if( rc ){ - if( needUnref ) sqlitepager_unref(pOvfl); - return rc; - } - pOvfl->iNext = pPage1->freeList; - pPage1->freeList = SWAB32(pBt, pgno); - memset(pOvfl->aPayload, 0, OVERFLOW_SIZE); - if( needUnref ) rc = sqlitepager_unref(pOvfl); - return rc; -} - -/* -** Erase all the data out of a cell. This involves returning overflow -** pages back the freelist. -*/ -static int clearCell(Btree *pBt, Cell *pCell){ - Pager *pPager = pBt->pPager; - OverflowPage *pOvfl; - Pgno ovfl, nextOvfl; - int rc; - - if( NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h) <= MX_LOCAL_PAYLOAD ){ - return SQLITE_OK; - } - ovfl = SWAB32(pBt, pCell->ovfl); - pCell->ovfl = 0; - while( ovfl ){ - rc = sqlitepager_get(pPager, ovfl, (void**)&pOvfl); - if( rc ) return rc; - nextOvfl = SWAB32(pBt, pOvfl->iNext); - rc = freePage(pBt, pOvfl, ovfl); - if( rc ) return rc; - sqlitepager_unref(pOvfl); - ovfl = nextOvfl; - } - return SQLITE_OK; -} - -/* -** Create a new cell from key and data. Overflow pages are allocated as -** necessary and linked to this cell. -*/ -static int fillInCell( - Btree *pBt, /* The whole Btree. Needed to allocate pages */ - Cell *pCell, /* Populate this Cell structure */ - const void *pKey, int nKey, /* The key */ - const void *pData,int nData /* The data */ -){ - OverflowPage *pOvfl, *pPrior; - Pgno *pNext; - int spaceLeft; - int n, rc; - int nPayload; - const char *pPayload; - char *pSpace; - Pgno nearby = 0; - - pCell->h.leftChild = 0; - pCell->h.nKey = SWAB16(pBt, nKey & 0xffff); - pCell->h.nKeyHi = nKey >> 16; - pCell->h.nData = SWAB16(pBt, nData & 0xffff); - pCell->h.nDataHi = nData >> 16; - pCell->h.iNext = 0; - - pNext = &pCell->ovfl; - pSpace = pCell->aPayload; - spaceLeft = MX_LOCAL_PAYLOAD; - pPayload = pKey; - pKey = 0; - nPayload = nKey; - pPrior = 0; - while( nPayload>0 ){ - if( spaceLeft==0 ){ - rc = allocatePage(pBt, (MemPage**)&pOvfl, pNext, nearby); - if( rc ){ - *pNext = 0; - }else{ - nearby = *pNext; - } - if( pPrior ) sqlitepager_unref(pPrior); - if( rc ){ - clearCell(pBt, pCell); - return rc; - } - if( pBt->needSwab ) *pNext = swab32(*pNext); - pPrior = pOvfl; - spaceLeft = OVERFLOW_SIZE; - pSpace = pOvfl->aPayload; - pNext = &pOvfl->iNext; - } - n = nPayload; - if( n>spaceLeft ) n = spaceLeft; - memcpy(pSpace, pPayload, n); - nPayload -= n; - if( nPayload==0 && pData ){ - pPayload = pData; - nPayload = nData; - pData = 0; - }else{ - pPayload += n; - } - spaceLeft -= n; - pSpace += n; - } - *pNext = 0; - if( pPrior ){ - sqlitepager_unref(pPrior); - } - return SQLITE_OK; -} - -/* -** Change the MemPage.pParent pointer on the page whose number is -** given in the second argument so that MemPage.pParent holds the -** pointer in the third argument. -*/ -static void reparentPage(Pager *pPager, Pgno pgno, MemPage *pNewParent,int idx){ - MemPage *pThis; - - if( pgno==0 ) return; - assert( pPager!=0 ); - pThis = sqlitepager_lookup(pPager, pgno); - if( pThis && pThis->isInit ){ - if( pThis->pParent!=pNewParent ){ - if( pThis->pParent ) sqlitepager_unref(pThis->pParent); - pThis->pParent = pNewParent; - if( pNewParent ) sqlitepager_ref(pNewParent); - } - pThis->idxParent = idx; - sqlitepager_unref(pThis); - } -} - -/* -** Reparent all children of the given page to be the given page. -** In other words, for every child of pPage, invoke reparentPage() -** to make sure that each child knows that pPage is its parent. -** -** This routine gets called after you memcpy() one page into -** another. -*/ -static void reparentChildPages(Btree *pBt, MemPage *pPage){ - int i; - Pager *pPager = pBt->pPager; - for(i=0; inCell; i++){ - reparentPage(pPager, SWAB32(pBt, pPage->apCell[i]->h.leftChild), pPage, i); - } - reparentPage(pPager, SWAB32(pBt, pPage->u.hdr.rightChild), pPage, i); - pPage->idxShift = 0; -} - -/* -** Remove the i-th cell from pPage. This routine effects pPage only. -** The cell content is not freed or deallocated. It is assumed that -** the cell content has been copied someplace else. This routine just -** removes the reference to the cell from pPage. -** -** "sz" must be the number of bytes in the cell. -** -** Do not bother maintaining the integrity of the linked list of Cells. -** Only the pPage->apCell[] array is important. The relinkCellList() -** routine will be called soon after this routine in order to rebuild -** the linked list. -*/ -static void dropCell(Btree *pBt, MemPage *pPage, int idx, int sz){ - int j; - assert( idx>=0 && idxnCell ); - assert( sz==cellSize(pBt, pPage->apCell[idx]) ); - assert( sqlitepager_iswriteable(pPage) ); - freeSpace(pBt, pPage, Addr(pPage->apCell[idx]) - Addr(pPage), sz); - for(j=idx; jnCell-1; j++){ - pPage->apCell[j] = pPage->apCell[j+1]; - } - pPage->nCell--; - pPage->idxShift = 1; -} - -/* -** Insert a new cell on pPage at cell index "i". pCell points to the -** content of the cell. -** -** If the cell content will fit on the page, then put it there. If it -** will not fit, then just make pPage->apCell[i] point to the content -** and set pPage->isOverfull. -** -** Do not bother maintaining the integrity of the linked list of Cells. -** Only the pPage->apCell[] array is important. The relinkCellList() -** routine will be called soon after this routine in order to rebuild -** the linked list. -*/ -static void insertCell(Btree *pBt, MemPage *pPage, int i, Cell *pCell, int sz){ - int idx, j; - assert( i>=0 && i<=pPage->nCell ); - assert( sz==cellSize(pBt, pCell) ); - assert( sqlitepager_iswriteable(pPage) ); - idx = allocateSpace(pBt, pPage, sz); - for(j=pPage->nCell; j>i; j--){ - pPage->apCell[j] = pPage->apCell[j-1]; - } - pPage->nCell++; - if( idx<=0 ){ - pPage->isOverfull = 1; - pPage->apCell[i] = pCell; - }else{ - memcpy(&pPage->u.aDisk[idx], pCell, sz); - pPage->apCell[i] = (Cell*)&pPage->u.aDisk[idx]; - } - pPage->idxShift = 1; -} - -/* -** Rebuild the linked list of cells on a page so that the cells -** occur in the order specified by the pPage->apCell[] array. -** Invoke this routine once to repair damage after one or more -** invocations of either insertCell() or dropCell(). -*/ -static void relinkCellList(Btree *pBt, MemPage *pPage){ - int i; - u16 *pIdx; - assert( sqlitepager_iswriteable(pPage) ); - pIdx = &pPage->u.hdr.firstCell; - for(i=0; inCell; i++){ - int idx = Addr(pPage->apCell[i]) - Addr(pPage); - assert( idx>0 && idxapCell[i]->h.iNext; - } - *pIdx = 0; -} - -/* -** Make a copy of the contents of pFrom into pTo. The pFrom->apCell[] -** pointers that point into pFrom->u.aDisk[] must be adjusted to point -** into pTo->u.aDisk[] instead. But some pFrom->apCell[] entries might -** not point to pFrom->u.aDisk[]. Those are unchanged. -*/ -static void copyPage(MemPage *pTo, MemPage *pFrom){ - uptr from, to; - int i; - memcpy(pTo->u.aDisk, pFrom->u.aDisk, SQLITE_USABLE_SIZE); - pTo->pParent = 0; - pTo->isInit = 1; - pTo->nCell = pFrom->nCell; - pTo->nFree = pFrom->nFree; - pTo->isOverfull = pFrom->isOverfull; - to = Addr(pTo); - from = Addr(pFrom); - for(i=0; inCell; i++){ - uptr x = Addr(pFrom->apCell[i]); - if( x>from && xapCell[i]) = x + to - from; - }else{ - pTo->apCell[i] = pFrom->apCell[i]; - } - } -} - -/* -** The following parameters determine how many adjacent pages get involved -** in a balancing operation. NN is the number of neighbors on either side -** of the page that participate in the balancing operation. NB is the -** total number of pages that participate, including the target page and -** NN neighbors on either side. -** -** The minimum value of NN is 1 (of course). Increasing NN above 1 -** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance -** in exchange for a larger degradation in INSERT and UPDATE performance. -** The value of NN appears to give the best results overall. -*/ -#define NN 1 /* Number of neighbors on either side of pPage */ -#define NB (NN*2+1) /* Total pages involved in the balance */ - -/* -** This routine redistributes Cells on pPage and up to two siblings -** of pPage so that all pages have about the same amount of free space. -** Usually one sibling on either side of pPage is used in the balancing, -** though both siblings might come from one side if pPage is the first -** or last child of its parent. If pPage has fewer than two siblings -** (something which can only happen if pPage is the root page or a -** child of root) then all available siblings participate in the balancing. -** -** The number of siblings of pPage might be increased or decreased by -** one in an effort to keep pages between 66% and 100% full. The root page -** is special and is allowed to be less than 66% full. If pPage is -** the root page, then the depth of the tree might be increased -** or decreased by one, as necessary, to keep the root page from being -** overfull or empty. -** -** This routine calls relinkCellList() on its input page regardless of -** whether or not it does any real balancing. Client routines will typically -** invoke insertCell() or dropCell() before calling this routine, so we -** need to call relinkCellList() to clean up the mess that those other -** routines left behind. -** -** pCur is left pointing to the same cell as when this routine was called -** even if that cell gets moved to a different page. pCur may be NULL. -** Set the pCur parameter to NULL if you do not care about keeping track -** of a cell as that will save this routine the work of keeping track of it. -** -** Note that when this routine is called, some of the Cells on pPage -** might not actually be stored in pPage->u.aDisk[]. This can happen -** if the page is overfull. Part of the job of this routine is to -** make sure all Cells for pPage once again fit in pPage->u.aDisk[]. -** -** In the course of balancing the siblings of pPage, the parent of pPage -** might become overfull or underfull. If that happens, then this routine -** is called recursively on the parent. -** -** If this routine fails for any reason, it might leave the database -** in a corrupted state. So if this routine fails, the database should -** be rolled back. -*/ -static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ - MemPage *pParent; /* The parent of pPage */ - int nCell; /* Number of cells in apCell[] */ - int nOld; /* Number of pages in apOld[] */ - int nNew; /* Number of pages in apNew[] */ - int nDiv; /* Number of cells in apDiv[] */ - int i, j, k; /* Loop counters */ - int idx; /* Index of pPage in pParent->apCell[] */ - int nxDiv; /* Next divider slot in pParent->apCell[] */ - int rc; /* The return code */ - int iCur; /* apCell[iCur] is the cell of the cursor */ - MemPage *pOldCurPage; /* The cursor originally points to this page */ - int subtotal; /* Subtotal of bytes in cells on one page */ - MemPage *extraUnref = 0; /* A page that needs to be unref-ed */ - MemPage *apOld[NB]; /* pPage and up to two siblings */ - Pgno pgnoOld[NB]; /* Page numbers for each page in apOld[] */ - MemPage *apNew[NB+1]; /* pPage and up to NB siblings after balancing */ - Pgno pgnoNew[NB+1]; /* Page numbers for each page in apNew[] */ - int idxDiv[NB]; /* Indices of divider cells in pParent */ - Cell *apDiv[NB]; /* Divider cells in pParent */ - Cell aTemp[NB]; /* Temporary holding area for apDiv[] */ - int cntNew[NB+1]; /* Index in apCell[] of cell after i-th page */ - int szNew[NB+1]; /* Combined size of cells place on i-th page */ - MemPage aOld[NB]; /* Temporary copies of pPage and its siblings */ - Cell *apCell[(MX_CELL+2)*NB]; /* All cells from pages being balanced */ - int szCell[(MX_CELL+2)*NB]; /* Local size of all cells */ - - /* - ** Return without doing any work if pPage is neither overfull nor - ** underfull. - */ - assert( sqlitepager_iswriteable(pPage) ); - if( !pPage->isOverfull && pPage->nFreenCell>=2){ - relinkCellList(pBt, pPage); - return SQLITE_OK; - } - - /* - ** Find the parent of the page to be balanceed. - ** If there is no parent, it means this page is the root page and - ** special rules apply. - */ - pParent = pPage->pParent; - if( pParent==0 ){ - Pgno pgnoChild; - MemPage *pChild; - assert( pPage->isInit ); - if( pPage->nCell==0 ){ - if( pPage->u.hdr.rightChild ){ - /* - ** The root page is empty. Copy the one child page - ** into the root page and return. This reduces the depth - ** of the BTree by one. - */ - pgnoChild = SWAB32(pBt, pPage->u.hdr.rightChild); - rc = sqlitepager_get(pBt->pPager, pgnoChild, (void**)&pChild); - if( rc ) return rc; - memcpy(pPage, pChild, SQLITE_USABLE_SIZE); - pPage->isInit = 0; - rc = initPage(pBt, pPage, sqlitepager_pagenumber(pPage), 0); - assert( rc==SQLITE_OK ); - reparentChildPages(pBt, pPage); - if( pCur && pCur->pPage==pChild ){ - sqlitepager_unref(pChild); - pCur->pPage = pPage; - sqlitepager_ref(pPage); - } - freePage(pBt, pChild, pgnoChild); - sqlitepager_unref(pChild); - }else{ - relinkCellList(pBt, pPage); - } - return SQLITE_OK; - } - if( !pPage->isOverfull ){ - /* It is OK for the root page to be less than half full. - */ - relinkCellList(pBt, pPage); - return SQLITE_OK; - } - /* - ** If we get to here, it means the root page is overfull. - ** When this happens, Create a new child page and copy the - ** contents of the root into the child. Then make the root - ** page an empty page with rightChild pointing to the new - ** child. Then fall thru to the code below which will cause - ** the overfull child page to be split. - */ - rc = sqlitepager_write(pPage); - if( rc ) return rc; - rc = allocatePage(pBt, &pChild, &pgnoChild, sqlitepager_pagenumber(pPage)); - if( rc ) return rc; - assert( sqlitepager_iswriteable(pChild) ); - copyPage(pChild, pPage); - pChild->pParent = pPage; - pChild->idxParent = 0; - sqlitepager_ref(pPage); - pChild->isOverfull = 1; - if( pCur && pCur->pPage==pPage ){ - sqlitepager_unref(pPage); - pCur->pPage = pChild; - }else{ - extraUnref = pChild; - } - zeroPage(pBt, pPage); - pPage->u.hdr.rightChild = SWAB32(pBt, pgnoChild); - pParent = pPage; - pPage = pChild; - } - rc = sqlitepager_write(pParent); - if( rc ) return rc; - assert( pParent->isInit ); - - /* - ** Find the Cell in the parent page whose h.leftChild points back - ** to pPage. The "idx" variable is the index of that cell. If pPage - ** is the rightmost child of pParent then set idx to pParent->nCell - */ - if( pParent->idxShift ){ - Pgno pgno, swabPgno; - pgno = sqlitepager_pagenumber(pPage); - swabPgno = SWAB32(pBt, pgno); - for(idx=0; idxnCell; idx++){ - if( pParent->apCell[idx]->h.leftChild==swabPgno ){ - break; - } - } - assert( idxnCell || pParent->u.hdr.rightChild==swabPgno ); - }else{ - idx = pPage->idxParent; - } - - /* - ** Initialize variables so that it will be safe to jump - ** directly to balance_cleanup at any moment. - */ - nOld = nNew = 0; - sqlitepager_ref(pParent); - - /* - ** Find sibling pages to pPage and the Cells in pParent that divide - ** the siblings. An attempt is made to find NN siblings on either - ** side of pPage. More siblings are taken from one side, however, if - ** pPage there are fewer than NN siblings on the other side. If pParent - ** has NB or fewer children then all children of pParent are taken. - */ - nxDiv = idx - NN; - if( nxDiv + NB > pParent->nCell ){ - nxDiv = pParent->nCell - NB + 1; - } - if( nxDiv<0 ){ - nxDiv = 0; - } - nDiv = 0; - for(i=0, k=nxDiv; inCell ){ - idxDiv[i] = k; - apDiv[i] = pParent->apCell[k]; - nDiv++; - pgnoOld[i] = SWAB32(pBt, apDiv[i]->h.leftChild); - }else if( k==pParent->nCell ){ - pgnoOld[i] = SWAB32(pBt, pParent->u.hdr.rightChild); - }else{ - break; - } - rc = sqlitepager_get(pBt->pPager, pgnoOld[i], (void**)&apOld[i]); - if( rc ) goto balance_cleanup; - rc = initPage(pBt, apOld[i], pgnoOld[i], pParent); - if( rc ) goto balance_cleanup; - apOld[i]->idxParent = k; - nOld++; - } - - /* - ** Set iCur to be the index in apCell[] of the cell that the cursor - ** is pointing to. We will need this later on in order to keep the - ** cursor pointing at the same cell. If pCur points to a page that - ** has no involvement with this rebalancing, then set iCur to a large - ** number so that the iCur==j tests always fail in the main cell - ** distribution loop below. - */ - if( pCur ){ - iCur = 0; - for(i=0; ipPage==apOld[i] ){ - iCur += pCur->idx; - break; - } - iCur += apOld[i]->nCell; - if( ipPage==pParent && pCur->idx==idxDiv[i] ){ - break; - } - iCur++; - } - pOldCurPage = pCur->pPage; - } - - /* - ** Make copies of the content of pPage and its siblings into aOld[]. - ** The rest of this function will use data from the copies rather - ** that the original pages since the original pages will be in the - ** process of being overwritten. - */ - for(i=0; inCell; j++){ - apCell[nCell] = pOld->apCell[j]; - szCell[nCell] = cellSize(pBt, apCell[nCell]); - nCell++; - } - if( ih.leftChild)==pgnoOld[i] ); - apCell[nCell]->h.leftChild = pOld->u.hdr.rightChild; - nCell++; - } - } - - /* - ** Figure out the number of pages needed to hold all nCell cells. - ** Store this number in "k". Also compute szNew[] which is the total - ** size of all cells on the i-th page and cntNew[] which is the index - ** in apCell[] of the cell that divides path i from path i+1. - ** cntNew[k] should equal nCell. - ** - ** This little patch of code is critical for keeping the tree - ** balanced. - */ - for(subtotal=k=i=0; i USABLE_SPACE ){ - szNew[k] = subtotal - szCell[i]; - cntNew[k] = i; - subtotal = 0; - k++; - } - } - szNew[k] = subtotal; - cntNew[k] = nCell; - k++; - for(i=k-1; i>0; i--){ - while( szNew[i]0 ); - szNew[i] += szCell[cntNew[i-1]]; - szNew[i-1] -= szCell[cntNew[i-1]-1]; - } - } - assert( cntNew[0]>0 ); - - /* - ** Allocate k new pages. Reuse old pages where possible. - */ - for(i=0; iisInit = 1; - } - - /* Free any old pages that were not reused as new pages. - */ - while( ii ){ - int t; - MemPage *pT; - t = pgnoNew[i]; - pT = apNew[i]; - pgnoNew[i] = pgnoNew[minI]; - apNew[i] = apNew[minI]; - pgnoNew[minI] = t; - apNew[minI] = pT; - } - } - - /* - ** Evenly distribute the data in apCell[] across the new pages. - ** Insert divider cells into pParent as necessary. - */ - j = 0; - for(i=0; inFree>=szCell[j] ); - if( pCur && iCur==j ){ pCur->pPage = pNew; pCur->idx = pNew->nCell; } - insertCell(pBt, pNew, pNew->nCell, apCell[j], szCell[j]); - j++; - } - assert( pNew->nCell>0 ); - assert( !pNew->isOverfull ); - relinkCellList(pBt, pNew); - if( iu.hdr.rightChild = apCell[j]->h.leftChild; - apCell[j]->h.leftChild = SWAB32(pBt, pgnoNew[i]); - if( pCur && iCur==j ){ pCur->pPage = pParent; pCur->idx = nxDiv; } - insertCell(pBt, pParent, nxDiv, apCell[j], szCell[j]); - j++; - nxDiv++; - } - } - assert( j==nCell ); - apNew[nNew-1]->u.hdr.rightChild = aOld[nOld-1].u.hdr.rightChild; - if( nxDiv==pParent->nCell ){ - pParent->u.hdr.rightChild = SWAB32(pBt, pgnoNew[nNew-1]); - }else{ - pParent->apCell[nxDiv]->h.leftChild = SWAB32(pBt, pgnoNew[nNew-1]); - } - if( pCur ){ - if( j<=iCur && pCur->pPage==pParent && pCur->idx>idxDiv[nOld-1] ){ - assert( pCur->pPage==pOldCurPage ); - pCur->idx += nNew - nOld; - }else{ - assert( pOldCurPage!=0 ); - sqlitepager_ref(pCur->pPage); - sqlitepager_unref(pOldCurPage); - } - } - - /* - ** Reparent children of all cells. - */ - for(i=0; ipPage==0 ){ - pCur->pPage = pParent; - pCur->idx = 0; - }else{ - sqlitepager_unref(pParent); - } - return rc; -} - -/* -** This routine checks all cursors that point to the same table -** as pCur points to. If any of those cursors were opened with -** wrFlag==0 then this routine returns SQLITE_LOCKED. If all -** cursors point to the same table were opened with wrFlag==1 -** then this routine returns SQLITE_OK. -** -** In addition to checking for read-locks (where a read-lock -** means a cursor opened with wrFlag==0) this routine also moves -** all cursors other than pCur so that they are pointing to the -** first Cell on root page. This is necessary because an insert -** or delete might change the number of cells on a page or delete -** a page entirely and we do not want to leave any cursors -** pointing to non-existant pages or cells. -*/ -static int checkReadLocks(BtCursor *pCur){ - BtCursor *p; - assert( pCur->wrFlag ); - for(p=pCur->pShared; p!=pCur; p=p->pShared){ - assert( p ); - assert( p->pgnoRoot==pCur->pgnoRoot ); - if( p->wrFlag==0 ) return SQLITE_LOCKED; - if( sqlitepager_pagenumber(p->pPage)!=p->pgnoRoot ){ - moveToRoot(p); - } - } - return SQLITE_OK; -} - -/* -** Insert a new record into the BTree. The key is given by (pKey,nKey) -** and the data is given by (pData,nData). The cursor is used only to -** define what database the record should be inserted into. The cursor -** is left pointing at the new record. -*/ -static int fileBtreeInsert( - BtCursor *pCur, /* Insert data into the table of this cursor */ - const void *pKey, int nKey, /* The key of the new record */ - const void *pData, int nData /* The data of the new record */ -){ - Cell newCell; - int rc; - int loc; - int szNew; - MemPage *pPage; - Btree *pBt = pCur->pBt; - - if( pCur->pPage==0 ){ - return SQLITE_ABORT; /* A rollback destroyed this cursor */ - } - if( !pBt->inTrans || nKey+nData==0 ){ - /* Must start a transaction before doing an insert */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( !pBt->readOnly ); - if( !pCur->wrFlag ){ - return SQLITE_PERM; /* Cursor not open for writing */ - } - if( checkReadLocks(pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - rc = fileBtreeMoveto(pCur, pKey, nKey, &loc); - if( rc ) return rc; - pPage = pCur->pPage; - assert( pPage->isInit ); - rc = sqlitepager_write(pPage); - if( rc ) return rc; - rc = fillInCell(pBt, &newCell, pKey, nKey, pData, nData); - if( rc ) return rc; - szNew = cellSize(pBt, &newCell); - if( loc==0 ){ - newCell.h.leftChild = pPage->apCell[pCur->idx]->h.leftChild; - rc = clearCell(pBt, pPage->apCell[pCur->idx]); - if( rc ) return rc; - dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pPage->apCell[pCur->idx])); - }else if( loc<0 && pPage->nCell>0 ){ - assert( pPage->u.hdr.rightChild==0 ); /* Must be a leaf page */ - pCur->idx++; - }else{ - assert( pPage->u.hdr.rightChild==0 ); /* Must be a leaf page */ - } - insertCell(pBt, pPage, pCur->idx, &newCell, szNew); - rc = balance(pCur->pBt, pPage, pCur); - /* sqliteBtreePageDump(pCur->pBt, pCur->pgnoRoot, 1); */ - /* fflush(stdout); */ - pCur->eSkip = SKIP_INVALID; - return rc; -} - -/* -** Delete the entry that the cursor is pointing to. -** -** The cursor is left pointing at either the next or the previous -** entry. If the cursor is left pointing to the next entry, then -** the pCur->eSkip flag is set to SKIP_NEXT which forces the next call to -** sqliteBtreeNext() to be a no-op. That way, you can always call -** sqliteBtreeNext() after a delete and the cursor will be left -** pointing to the first entry after the deleted entry. Similarly, -** pCur->eSkip is set to SKIP_PREV is the cursor is left pointing to -** the entry prior to the deleted entry so that a subsequent call to -** sqliteBtreePrevious() will always leave the cursor pointing at the -** entry immediately before the one that was deleted. -*/ -static int fileBtreeDelete(BtCursor *pCur){ - MemPage *pPage = pCur->pPage; - Cell *pCell; - int rc; - Pgno pgnoChild; - Btree *pBt = pCur->pBt; - - assert( pPage->isInit ); - if( pCur->pPage==0 ){ - return SQLITE_ABORT; /* A rollback destroyed this cursor */ - } - if( !pBt->inTrans ){ - /* Must start a transaction before doing a delete */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - assert( !pBt->readOnly ); - if( pCur->idx >= pPage->nCell ){ - return SQLITE_ERROR; /* The cursor is not pointing to anything */ - } - if( !pCur->wrFlag ){ - return SQLITE_PERM; /* Did not open this cursor for writing */ - } - if( checkReadLocks(pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - rc = sqlitepager_write(pPage); - if( rc ) return rc; - pCell = pPage->apCell[pCur->idx]; - pgnoChild = SWAB32(pBt, pCell->h.leftChild); - clearCell(pBt, pCell); - if( pgnoChild ){ - /* - ** The entry we are about to delete is not a leaf so if we do not - ** do something we will leave a hole on an internal page. - ** We have to fill the hole by moving in a cell from a leaf. The - ** next Cell after the one to be deleted is guaranteed to exist and - ** to be a leaf so we can use it. - */ - BtCursor leafCur; - Cell *pNext; - int szNext; - int notUsed; - getTempCursor(pCur, &leafCur); - rc = fileBtreeNext(&leafCur, ¬Used); - if( rc!=SQLITE_OK ){ - if( rc!=SQLITE_NOMEM ) rc = SQLITE_CORRUPT; - return rc; - } - rc = sqlitepager_write(leafCur.pPage); - if( rc ) return rc; - dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pCell)); - pNext = leafCur.pPage->apCell[leafCur.idx]; - szNext = cellSize(pBt, pNext); - pNext->h.leftChild = SWAB32(pBt, pgnoChild); - insertCell(pBt, pPage, pCur->idx, pNext, szNext); - rc = balance(pBt, pPage, pCur); - if( rc ) return rc; - pCur->eSkip = SKIP_NEXT; - dropCell(pBt, leafCur.pPage, leafCur.idx, szNext); - rc = balance(pBt, leafCur.pPage, pCur); - releaseTempCursor(&leafCur); - }else{ - dropCell(pBt, pPage, pCur->idx, cellSize(pBt, pCell)); - if( pCur->idx>=pPage->nCell ){ - pCur->idx = pPage->nCell-1; - if( pCur->idx<0 ){ - pCur->idx = 0; - pCur->eSkip = SKIP_NEXT; - }else{ - pCur->eSkip = SKIP_PREV; - } - }else{ - pCur->eSkip = SKIP_NEXT; - } - rc = balance(pBt, pPage, pCur); - } - return rc; -} - -/* -** Create a new BTree table. Write into *piTable the page -** number for the root page of the new table. -** -** In the current implementation, BTree tables and BTree indices are the -** the same. In the future, we may change this so that BTree tables -** are restricted to having a 4-byte integer key and arbitrary data and -** BTree indices are restricted to having an arbitrary key and no data. -** But for now, this routine also serves to create indices. -*/ -static int fileBtreeCreateTable(Btree *pBt, int *piTable){ - MemPage *pRoot; - Pgno pgnoRoot; - int rc; - if( !pBt->inTrans ){ - /* Must start a transaction first */ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - if( pBt->readOnly ){ - return SQLITE_READONLY; - } - rc = allocatePage(pBt, &pRoot, &pgnoRoot, 0); - if( rc ) return rc; - assert( sqlitepager_iswriteable(pRoot) ); - zeroPage(pBt, pRoot); - sqlitepager_unref(pRoot); - *piTable = (int)pgnoRoot; - return SQLITE_OK; -} - -/* -** Erase the given database page and all its children. Return -** the page to the freelist. -*/ -static int clearDatabasePage(Btree *pBt, Pgno pgno, int freePageFlag){ - MemPage *pPage; - int rc; - Cell *pCell; - int idx; - - rc = sqlitepager_get(pBt->pPager, pgno, (void**)&pPage); - if( rc ) return rc; - rc = sqlitepager_write(pPage); - if( rc ) return rc; - rc = initPage(pBt, pPage, pgno, 0); - if( rc ) return rc; - idx = SWAB16(pBt, pPage->u.hdr.firstCell); - while( idx>0 ){ - pCell = (Cell*)&pPage->u.aDisk[idx]; - idx = SWAB16(pBt, pCell->h.iNext); - if( pCell->h.leftChild ){ - rc = clearDatabasePage(pBt, SWAB32(pBt, pCell->h.leftChild), 1); - if( rc ) return rc; - } - rc = clearCell(pBt, pCell); - if( rc ) return rc; - } - if( pPage->u.hdr.rightChild ){ - rc = clearDatabasePage(pBt, SWAB32(pBt, pPage->u.hdr.rightChild), 1); - if( rc ) return rc; - } - if( freePageFlag ){ - rc = freePage(pBt, pPage, pgno); - }else{ - zeroPage(pBt, pPage); - } - sqlitepager_unref(pPage); - return rc; -} - -/* -** Delete all information from a single table in the database. -*/ -static int fileBtreeClearTable(Btree *pBt, int iTable){ - int rc; - BtCursor *pCur; - if( !pBt->inTrans ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->pgnoRoot==(Pgno)iTable ){ - if( pCur->wrFlag==0 ) return SQLITE_LOCKED; - moveToRoot(pCur); - } - } - rc = clearDatabasePage(pBt, (Pgno)iTable, 0); - if( rc ){ - fileBtreeRollback(pBt); - } - return rc; -} - -/* -** Erase all information in a table and add the root of the table to -** the freelist. Except, the root of the principle table (the one on -** page 2) is never added to the freelist. -*/ -static int fileBtreeDropTable(Btree *pBt, int iTable){ - int rc; - MemPage *pPage; - BtCursor *pCur; - if( !pBt->inTrans ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ - if( pCur->pgnoRoot==(Pgno)iTable ){ - return SQLITE_LOCKED; /* Cannot drop a table that has a cursor */ - } - } - rc = sqlitepager_get(pBt->pPager, (Pgno)iTable, (void**)&pPage); - if( rc ) return rc; - rc = fileBtreeClearTable(pBt, iTable); - if( rc ) return rc; - if( iTable>2 ){ - rc = freePage(pBt, pPage, iTable); - }else{ - zeroPage(pBt, pPage); - } - sqlitepager_unref(pPage); - return rc; -} - -#if 0 /* UNTESTED */ -/* -** Copy all cell data from one database file into another. -** pages back the freelist. -*/ -static int copyCell(Btree *pBtFrom, BTree *pBtTo, Cell *pCell){ - Pager *pFromPager = pBtFrom->pPager; - OverflowPage *pOvfl; - Pgno ovfl, nextOvfl; - Pgno *pPrev; - int rc = SQLITE_OK; - MemPage *pNew, *pPrevPg; - Pgno new; - - if( NKEY(pBtTo, pCell->h) + NDATA(pBtTo, pCell->h) <= MX_LOCAL_PAYLOAD ){ - return SQLITE_OK; - } - pPrev = &pCell->ovfl; - pPrevPg = 0; - ovfl = SWAB32(pBtTo, pCell->ovfl); - while( ovfl && rc==SQLITE_OK ){ - rc = sqlitepager_get(pFromPager, ovfl, (void**)&pOvfl); - if( rc ) return rc; - nextOvfl = SWAB32(pBtFrom, pOvfl->iNext); - rc = allocatePage(pBtTo, &pNew, &new, 0); - if( rc==SQLITE_OK ){ - rc = sqlitepager_write(pNew); - if( rc==SQLITE_OK ){ - memcpy(pNew, pOvfl, SQLITE_USABLE_SIZE); - *pPrev = SWAB32(pBtTo, new); - if( pPrevPg ){ - sqlitepager_unref(pPrevPg); - } - pPrev = &pOvfl->iNext; - pPrevPg = pNew; - } - } - sqlitepager_unref(pOvfl); - ovfl = nextOvfl; - } - if( pPrevPg ){ - sqlitepager_unref(pPrevPg); - } - return rc; -} -#endif - - -#if 0 /* UNTESTED */ -/* -** Copy a page of data from one database over to another. -*/ -static int copyDatabasePage( - Btree *pBtFrom, - Pgno pgnoFrom, - Btree *pBtTo, - Pgno *pTo -){ - MemPage *pPageFrom, *pPage; - Pgno to; - int rc; - Cell *pCell; - int idx; - - rc = sqlitepager_get(pBtFrom->pPager, pgno, (void**)&pPageFrom); - if( rc ) return rc; - rc = allocatePage(pBt, &pPage, pTo, 0); - if( rc==SQLITE_OK ){ - rc = sqlitepager_write(pPage); - } - if( rc==SQLITE_OK ){ - memcpy(pPage, pPageFrom, SQLITE_USABLE_SIZE); - idx = SWAB16(pBt, pPage->u.hdr.firstCell); - while( idx>0 ){ - pCell = (Cell*)&pPage->u.aDisk[idx]; - idx = SWAB16(pBt, pCell->h.iNext); - if( pCell->h.leftChild ){ - Pgno newChld; - rc = copyDatabasePage(pBtFrom, SWAB32(pBtFrom, pCell->h.leftChild), - pBtTo, &newChld); - if( rc ) return rc; - pCell->h.leftChild = SWAB32(pBtFrom, newChld); - } - rc = copyCell(pBtFrom, pBtTo, pCell); - if( rc ) return rc; - } - if( pPage->u.hdr.rightChild ){ - Pgno newChld; - rc = copyDatabasePage(pBtFrom, SWAB32(pBtFrom, pPage->u.hdr.rightChild), - pBtTo, &newChld); - if( rc ) return rc; - pPage->u.hdr.rightChild = SWAB32(pBtTo, newChild); - } - } - sqlitepager_unref(pPage); - return rc; -} -#endif - -/* -** Read the meta-information out of a database file. -*/ -static int fileBtreeGetMeta(Btree *pBt, int *aMeta){ - PageOne *pP1; - int rc; - int i; - - rc = sqlitepager_get(pBt->pPager, 1, (void**)&pP1); - if( rc ) return rc; - aMeta[0] = SWAB32(pBt, pP1->nFree); - for(i=0; iaMeta)/sizeof(pP1->aMeta[0]); i++){ - aMeta[i+1] = SWAB32(pBt, pP1->aMeta[i]); - } - sqlitepager_unref(pP1); - return SQLITE_OK; -} - -/* -** Write meta-information back into the database. -*/ -static int fileBtreeUpdateMeta(Btree *pBt, int *aMeta){ - PageOne *pP1; - int rc, i; - if( !pBt->inTrans ){ - return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; - } - pP1 = pBt->page1; - rc = sqlitepager_write(pP1); - if( rc ) return rc; - for(i=0; iaMeta)/sizeof(pP1->aMeta[0]); i++){ - pP1->aMeta[i] = SWAB32(pBt, aMeta[i+1]); - } - return SQLITE_OK; -} - -/****************************************************************************** -** The complete implementation of the BTree subsystem is above this line. -** All the code the follows is for testing and troubleshooting the BTree -** subsystem. None of the code that follows is used during normal operation. -******************************************************************************/ - -/* -** Print a disassembly of the given page on standard output. This routine -** is used for debugging and testing only. -*/ -#ifdef SQLITE_TEST -static int fileBtreePageDump(Btree *pBt, int pgno, int recursive){ - int rc; - MemPage *pPage; - int i, j; - int nFree; - u16 idx; - char range[20]; - unsigned char payload[20]; - rc = sqlitepager_get(pBt->pPager, (Pgno)pgno, (void**)&pPage); - if( rc ){ - return rc; - } - if( recursive ) printf("PAGE %d:\n", pgno); - i = 0; - idx = SWAB16(pBt, pPage->u.hdr.firstCell); - while( idx>0 && idx<=SQLITE_USABLE_SIZE-MIN_CELL_SIZE ){ - Cell *pCell = (Cell*)&pPage->u.aDisk[idx]; - int sz = cellSize(pBt, pCell); - sprintf(range,"%d..%d", idx, idx+sz-1); - sz = NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h); - if( sz>sizeof(payload)-1 ) sz = sizeof(payload)-1; - memcpy(payload, pCell->aPayload, sz); - for(j=0; j0x7f ) payload[j] = '.'; - } - payload[sz] = 0; - printf( - "cell %2d: i=%-10s chld=%-4d nk=%-4d nd=%-4d payload=%s\n", - i, range, (int)pCell->h.leftChild, - NKEY(pBt, pCell->h), NDATA(pBt, pCell->h), - payload - ); - if( pPage->isInit && pPage->apCell[i]!=pCell ){ - printf("**** apCell[%d] does not match on prior entry ****\n", i); - } - i++; - idx = SWAB16(pBt, pCell->h.iNext); - } - if( idx!=0 ){ - printf("ERROR: next cell index out of range: %d\n", idx); - } - printf("right_child: %d\n", SWAB32(pBt, pPage->u.hdr.rightChild)); - nFree = 0; - i = 0; - idx = SWAB16(pBt, pPage->u.hdr.firstFree); - while( idx>0 && idxu.aDisk[idx]; - sprintf(range,"%d..%d", idx, idx+p->iSize-1); - nFree += SWAB16(pBt, p->iSize); - printf("freeblock %2d: i=%-10s size=%-4d total=%d\n", - i, range, SWAB16(pBt, p->iSize), nFree); - idx = SWAB16(pBt, p->iNext); - i++; - } - if( idx!=0 ){ - printf("ERROR: next freeblock index out of range: %d\n", idx); - } - if( recursive && pPage->u.hdr.rightChild!=0 ){ - idx = SWAB16(pBt, pPage->u.hdr.firstCell); - while( idx>0 && idxu.aDisk[idx]; - fileBtreePageDump(pBt, SWAB32(pBt, pCell->h.leftChild), 1); - idx = SWAB16(pBt, pCell->h.iNext); - } - fileBtreePageDump(pBt, SWAB32(pBt, pPage->u.hdr.rightChild), 1); - } - sqlitepager_unref(pPage); - return SQLITE_OK; -} -#endif - -#ifdef SQLITE_TEST -/* -** Fill aResult[] with information about the entry and page that the -** cursor is pointing to. -** -** aResult[0] = The page number -** aResult[1] = The entry number -** aResult[2] = Total number of entries on this page -** aResult[3] = Size of this entry -** aResult[4] = Number of free bytes on this page -** aResult[5] = Number of free blocks on the page -** aResult[6] = Page number of the left child of this entry -** aResult[7] = Page number of the right child for the whole page -** -** This routine is used for testing and debugging only. -*/ -static int fileBtreeCursorDump(BtCursor *pCur, int *aResult){ - int cnt, idx; - MemPage *pPage = pCur->pPage; - Btree *pBt = pCur->pBt; - aResult[0] = sqlitepager_pagenumber(pPage); - aResult[1] = pCur->idx; - aResult[2] = pPage->nCell; - if( pCur->idx>=0 && pCur->idxnCell ){ - aResult[3] = cellSize(pBt, pPage->apCell[pCur->idx]); - aResult[6] = SWAB32(pBt, pPage->apCell[pCur->idx]->h.leftChild); - }else{ - aResult[3] = 0; - aResult[6] = 0; - } - aResult[4] = pPage->nFree; - cnt = 0; - idx = SWAB16(pBt, pPage->u.hdr.firstFree); - while( idx>0 && idxu.aDisk[idx])->iNext); - } - aResult[5] = cnt; - aResult[7] = SWAB32(pBt, pPage->u.hdr.rightChild); - return SQLITE_OK; -} -#endif - -/* -** Return the pager associated with a BTree. This routine is used for -** testing and debugging only. -*/ -static Pager *fileBtreePager(Btree *pBt){ - return pBt->pPager; -} - -/* -** This structure is passed around through all the sanity checking routines -** in order to keep track of some global state information. -*/ -typedef struct IntegrityCk IntegrityCk; -struct IntegrityCk { - Btree *pBt; /* The tree being checked out */ - Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ - int nPage; /* Number of pages in the database */ - int *anRef; /* Number of times each page is referenced */ - char *zErrMsg; /* An error message. NULL of no errors seen. */ -}; - -/* -** Append a message to the error message string. -*/ -static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){ - if( pCheck->zErrMsg ){ - char *zOld = pCheck->zErrMsg; - pCheck->zErrMsg = 0; - sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0); - sqliteFree(zOld); - }else{ - sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0); - } -} - -/* -** Add 1 to the reference count for page iPage. If this is the second -** reference to the page, add an error message to pCheck->zErrMsg. -** Return 1 if there are 2 ore more references to the page and 0 if -** if this is the first reference to the page. -** -** Also check that the page number is in bounds. -*/ -static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){ - if( iPage==0 ) return 1; - if( iPage>pCheck->nPage || iPage<0 ){ - char zBuf[100]; - sprintf(zBuf, "invalid page number %d", iPage); - checkAppendMsg(pCheck, zContext, zBuf); - return 1; - } - if( pCheck->anRef[iPage]==1 ){ - char zBuf[100]; - sprintf(zBuf, "2nd reference to page %d", iPage); - checkAppendMsg(pCheck, zContext, zBuf); - return 1; - } - return (pCheck->anRef[iPage]++)>1; -} - -/* -** Check the integrity of the freelist or of an overflow page list. -** Verify that the number of pages on the list is N. -*/ -static void checkList( - IntegrityCk *pCheck, /* Integrity checking context */ - int isFreeList, /* True for a freelist. False for overflow page list */ - int iPage, /* Page number for first page in the list */ - int N, /* Expected number of pages in the list */ - char *zContext /* Context for error messages */ -){ - int i; - char zMsg[100]; - while( N-- > 0 ){ - OverflowPage *pOvfl; - if( iPage<1 ){ - sprintf(zMsg, "%d pages missing from overflow list", N+1); - checkAppendMsg(pCheck, zContext, zMsg); - break; - } - if( checkRef(pCheck, iPage, zContext) ) break; - if( sqlitepager_get(pCheck->pPager, (Pgno)iPage, (void**)&pOvfl) ){ - sprintf(zMsg, "failed to get page %d", iPage); - checkAppendMsg(pCheck, zContext, zMsg); - break; - } - if( isFreeList ){ - FreelistInfo *pInfo = (FreelistInfo*)pOvfl->aPayload; - int n = SWAB32(pCheck->pBt, pInfo->nFree); - for(i=0; ipBt, pInfo->aFree[i]), zContext); - } - N -= n; - } - iPage = SWAB32(pCheck->pBt, pOvfl->iNext); - sqlitepager_unref(pOvfl); - } -} - -/* -** Return negative if zKey1zKey2. -*/ -static int keyCompare( - const char *zKey1, int nKey1, - const char *zKey2, int nKey2 -){ - int min = nKey1>nKey2 ? nKey2 : nKey1; - int c = memcmp(zKey1, zKey2, min); - if( c==0 ){ - c = nKey1 - nKey2; - } - return c; -} - -/* -** Do various sanity checks on a single page of a tree. Return -** the tree depth. Root pages return 0. Parents of root pages -** return 1, and so forth. -** -** These checks are done: -** -** 1. Make sure that cells and freeblocks do not overlap -** but combine to completely cover the page. -** 2. Make sure cell keys are in order. -** 3. Make sure no key is less than or equal to zLowerBound. -** 4. Make sure no key is greater than or equal to zUpperBound. -** 5. Check the integrity of overflow pages. -** 6. Recursively call checkTreePage on all children. -** 7. Verify that the depth of all children is the same. -** 8. Make sure this page is at least 33% full or else it is -** the root of the tree. -*/ -static int checkTreePage( - IntegrityCk *pCheck, /* Context for the sanity check */ - int iPage, /* Page number of the page to check */ - MemPage *pParent, /* Parent page */ - char *zParentContext, /* Parent context */ - char *zLowerBound, /* All keys should be greater than this, if not NULL */ - int nLower, /* Number of characters in zLowerBound */ - char *zUpperBound, /* All keys should be less than this, if not NULL */ - int nUpper /* Number of characters in zUpperBound */ -){ - MemPage *pPage; - int i, rc, depth, d2, pgno; - char *zKey1, *zKey2; - int nKey1, nKey2; - BtCursor cur; - Btree *pBt; - char zMsg[100]; - char zContext[100]; - char hit[SQLITE_USABLE_SIZE]; - - /* Check that the page exists - */ - cur.pBt = pBt = pCheck->pBt; - if( iPage==0 ) return 0; - if( checkRef(pCheck, iPage, zParentContext) ) return 0; - sprintf(zContext, "On tree page %d: ", iPage); - if( (rc = sqlitepager_get(pCheck->pPager, (Pgno)iPage, (void**)&pPage))!=0 ){ - sprintf(zMsg, "unable to get the page. error code=%d", rc); - checkAppendMsg(pCheck, zContext, zMsg); - return 0; - } - if( (rc = initPage(pBt, pPage, (Pgno)iPage, pParent))!=0 ){ - sprintf(zMsg, "initPage() returns error code %d", rc); - checkAppendMsg(pCheck, zContext, zMsg); - sqlitepager_unref(pPage); - return 0; - } - - /* Check out all the cells. - */ - depth = 0; - if( zLowerBound ){ - zKey1 = sqliteMalloc( nLower+1 ); - memcpy(zKey1, zLowerBound, nLower); - zKey1[nLower] = 0; - }else{ - zKey1 = 0; - } - nKey1 = nLower; - cur.pPage = pPage; - for(i=0; inCell; i++){ - Cell *pCell = pPage->apCell[i]; - int sz; - - /* Check payload overflow pages - */ - nKey2 = NKEY(pBt, pCell->h); - sz = nKey2 + NDATA(pBt, pCell->h); - sprintf(zContext, "On page %d cell %d: ", iPage, i); - if( sz>MX_LOCAL_PAYLOAD ){ - int nPage = (sz - MX_LOCAL_PAYLOAD + OVERFLOW_SIZE - 1)/OVERFLOW_SIZE; - checkList(pCheck, 0, SWAB32(pBt, pCell->ovfl), nPage, zContext); - } - - /* Check that keys are in the right order - */ - cur.idx = i; - zKey2 = sqliteMallocRaw( nKey2+1 ); - getPayload(&cur, 0, nKey2, zKey2); - if( zKey1 && keyCompare(zKey1, nKey1, zKey2, nKey2)>=0 ){ - checkAppendMsg(pCheck, zContext, "Key is out of order"); - } - - /* Check sanity of left child page. - */ - pgno = SWAB32(pBt, pCell->h.leftChild); - d2 = checkTreePage(pCheck, pgno, pPage, zContext, zKey1,nKey1,zKey2,nKey2); - if( i>0 && d2!=depth ){ - checkAppendMsg(pCheck, zContext, "Child page depth differs"); - } - depth = d2; - sqliteFree(zKey1); - zKey1 = zKey2; - nKey1 = nKey2; - } - pgno = SWAB32(pBt, pPage->u.hdr.rightChild); - sprintf(zContext, "On page %d at right child: ", iPage); - checkTreePage(pCheck, pgno, pPage, zContext, zKey1,nKey1,zUpperBound,nUpper); - sqliteFree(zKey1); - - /* Check for complete coverage of the page - */ - memset(hit, 0, sizeof(hit)); - memset(hit, 1, sizeof(PageHdr)); - for(i=SWAB16(pBt, pPage->u.hdr.firstCell); i>0 && iu.aDisk[i]; - int j; - for(j=i+cellSize(pBt, pCell)-1; j>=i; j--) hit[j]++; - i = SWAB16(pBt, pCell->h.iNext); - } - for(i=SWAB16(pBt,pPage->u.hdr.firstFree); i>0 && iu.aDisk[i]; - int j; - for(j=i+SWAB16(pBt,pFBlk->iSize)-1; j>=i; j--) hit[j]++; - i = SWAB16(pBt,pFBlk->iNext); - } - for(i=0; i1 ){ - sprintf(zMsg, "Multiple uses for byte %d of page %d", i, iPage); - checkAppendMsg(pCheck, zMsg, 0); - break; - } - } - - /* Check that free space is kept to a minimum - */ -#if 0 - if( pParent && pParent->nCell>2 && pPage->nFree>3*SQLITE_USABLE_SIZE/4 ){ - sprintf(zMsg, "free space (%d) greater than max (%d)", pPage->nFree, - SQLITE_USABLE_SIZE/3); - checkAppendMsg(pCheck, zContext, zMsg); - } -#endif - - sqlitepager_unref(pPage); - return depth; -} - -/* -** This routine does a complete check of the given BTree file. aRoot[] is -** an array of pages numbers were each page number is the root page of -** a table. nRoot is the number of entries in aRoot. -** -** If everything checks out, this routine returns NULL. If something is -** amiss, an error message is written into memory obtained from malloc() -** and a pointer to that error message is returned. The calling function -** is responsible for freeing the error message when it is done. -*/ -char *fileBtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ - int i; - int nRef; - IntegrityCk sCheck; - - nRef = *sqlitepager_stats(pBt->pPager); - if( lockBtree(pBt)!=SQLITE_OK ){ - return sqliteStrDup("Unable to acquire a read lock on the database"); - } - sCheck.pBt = pBt; - sCheck.pPager = pBt->pPager; - sCheck.nPage = sqlitepager_pagecount(sCheck.pPager); - if( sCheck.nPage==0 ){ - unlockBtreeIfUnused(pBt); - return 0; - } - sCheck.anRef = sqliteMallocRaw( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) ); - sCheck.anRef[1] = 1; - for(i=2; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; } - sCheck.zErrMsg = 0; - - /* Check the integrity of the freelist - */ - checkList(&sCheck, 1, SWAB32(pBt, pBt->page1->freeList), - SWAB32(pBt, pBt->page1->nFree), "Main freelist: "); - - /* Check all the tables. - */ - for(i=0; ipPager) ){ - char zBuf[100]; - sprintf(zBuf, - "Outstanding page count goes from %d to %d during this analysis", - nRef, *sqlitepager_stats(pBt->pPager) - ); - checkAppendMsg(&sCheck, zBuf, 0); - } - - /* Clean up and report errors. - */ - sqliteFree(sCheck.anRef); - return sCheck.zErrMsg; -} - -/* -** Return the full pathname of the underlying database file. -*/ -static const char *fileBtreeGetFilename(Btree *pBt){ - assert( pBt->pPager!=0 ); - return sqlitepager_filename(pBt->pPager); -} - -/* -** Copy the complete content of pBtFrom into pBtTo. A transaction -** must be active for both files. -** -** The size of file pBtFrom may be reduced by this operation. -** If anything goes wrong, the transaction on pBtFrom is rolled back. -*/ -static int fileBtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){ - int rc = SQLITE_OK; - Pgno i, nPage, nToPage; - - if( !pBtTo->inTrans || !pBtFrom->inTrans ) return SQLITE_ERROR; - if( pBtTo->needSwab!=pBtFrom->needSwab ) return SQLITE_ERROR; - if( pBtTo->pCursor ) return SQLITE_BUSY; - memcpy(pBtTo->page1, pBtFrom->page1, SQLITE_USABLE_SIZE); - rc = sqlitepager_overwrite(pBtTo->pPager, 1, pBtFrom->page1); - nToPage = sqlitepager_pagecount(pBtTo->pPager); - nPage = sqlitepager_pagecount(pBtFrom->pPager); - for(i=2; rc==SQLITE_OK && i<=nPage; i++){ - void *pPage; - rc = sqlitepager_get(pBtFrom->pPager, i, &pPage); - if( rc ) break; - rc = sqlitepager_overwrite(pBtTo->pPager, i, pPage); - if( rc ) break; - sqlitepager_unref(pPage); - } - for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){ - void *pPage; - rc = sqlitepager_get(pBtTo->pPager, i, &pPage); - if( rc ) break; - rc = sqlitepager_write(pPage); - sqlitepager_unref(pPage); - sqlitepager_dont_write(pBtTo->pPager, i); - } - if( !rc && nPagepPager, nPage); - } - if( rc ){ - fileBtreeRollback(pBtTo); - } - return rc; -} - -/* -** The following tables contain pointers to all of the interface -** routines for this implementation of the B*Tree backend. To -** substitute a different implemention of the backend, one has merely -** to provide pointers to alternative functions in similar tables. -*/ -static BtOps sqliteBtreeOps = { - fileBtreeClose, - fileBtreeSetCacheSize, - fileBtreeSetSafetyLevel, - fileBtreeBeginTrans, - fileBtreeCommit, - fileBtreeRollback, - fileBtreeBeginCkpt, - fileBtreeCommitCkpt, - fileBtreeRollbackCkpt, - fileBtreeCreateTable, - fileBtreeCreateTable, /* Really sqliteBtreeCreateIndex() */ - fileBtreeDropTable, - fileBtreeClearTable, - fileBtreeCursor, - fileBtreeGetMeta, - fileBtreeUpdateMeta, - fileBtreeIntegrityCheck, - fileBtreeGetFilename, - fileBtreeCopyFile, - fileBtreePager, -#ifdef SQLITE_TEST - fileBtreePageDump, -#endif -}; -static BtCursorOps sqliteBtreeCursorOps = { - fileBtreeMoveto, - fileBtreeDelete, - fileBtreeInsert, - fileBtreeFirst, - fileBtreeLast, - fileBtreeNext, - fileBtreePrevious, - fileBtreeKeySize, - fileBtreeKey, - fileBtreeKeyCompare, - fileBtreeDataSize, - fileBtreeData, - fileBtreeCloseCursor, -#ifdef SQLITE_TEST - fileBtreeCursorDump, -#endif -}; diff --git a/ext/sqlite/libsqlite/src/btree.h b/ext/sqlite/libsqlite/src/btree.h deleted file mode 100644 index 8d318a3c03216..0000000000000 --- a/ext/sqlite/libsqlite/src/btree.h +++ /dev/null @@ -1,156 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite B-Tree file -** subsystem. See comments in the source code for a detailed description -** of what each interface routine does. -** -** @(#) $Id$ -*/ -#ifndef _BTREE_H_ -#define _BTREE_H_ - -/* -** Forward declarations of structure -*/ -typedef struct Btree Btree; -typedef struct BtCursor BtCursor; -typedef struct BtOps BtOps; -typedef struct BtCursorOps BtCursorOps; - - -/* -** An instance of the following structure contains pointers to all -** methods against an open BTree. Alternative BTree implementations -** (examples: file based versus in-memory) can be created by substituting -** different methods. Users of the BTree cannot tell the difference. -** -** In C++ we could do this by defining a virtual base class and then -** creating subclasses for each different implementation. But this is -** C not C++ so we have to be a little more explicit. -*/ -struct BtOps { - int (*Close)(Btree*); - int (*SetCacheSize)(Btree*, int); - int (*SetSafetyLevel)(Btree*, int); - int (*BeginTrans)(Btree*); - int (*Commit)(Btree*); - int (*Rollback)(Btree*); - int (*BeginCkpt)(Btree*); - int (*CommitCkpt)(Btree*); - int (*RollbackCkpt)(Btree*); - int (*CreateTable)(Btree*, int*); - int (*CreateIndex)(Btree*, int*); - int (*DropTable)(Btree*, int); - int (*ClearTable)(Btree*, int); - int (*Cursor)(Btree*, int iTable, int wrFlag, BtCursor **ppCur); - int (*GetMeta)(Btree*, int*); - int (*UpdateMeta)(Btree*, int*); - char *(*IntegrityCheck)(Btree*, int*, int); - const char *(*GetFilename)(Btree*); - int (*Copyfile)(Btree*,Btree*); - struct Pager *(*Pager)(Btree*); -#ifdef SQLITE_TEST - int (*PageDump)(Btree*, int, int); -#endif -}; - -/* -** An instance of this structure defines all of the methods that can -** be executed against a cursor. -*/ -struct BtCursorOps { - int (*Moveto)(BtCursor*, const void *pKey, int nKey, int *pRes); - int (*Delete)(BtCursor*); - int (*Insert)(BtCursor*, const void *pKey, int nKey, - const void *pData, int nData); - int (*First)(BtCursor*, int *pRes); - int (*Last)(BtCursor*, int *pRes); - int (*Next)(BtCursor*, int *pRes); - int (*Previous)(BtCursor*, int *pRes); - int (*KeySize)(BtCursor*, int *pSize); - int (*Key)(BtCursor*, int offset, int amt, char *zBuf); - int (*KeyCompare)(BtCursor*, const void *pKey, int nKey, - int nIgnore, int *pRes); - int (*DataSize)(BtCursor*, int *pSize); - int (*Data)(BtCursor*, int offset, int amt, char *zBuf); - int (*CloseCursor)(BtCursor*); -#ifdef SQLITE_TEST - int (*CursorDump)(BtCursor*, int*); -#endif -}; - -/* -** The number of 4-byte "meta" values contained on the first page of each -** database file. -*/ -#define SQLITE_N_BTREE_META 10 - -int sqliteBtreeOpen(const char *zFilename, int mode, int nPg, Btree **ppBtree); -int sqliteRbtreeOpen(const char *zFilename, int mode, int nPg, Btree **ppBtree); - -#define btOps(pBt) (*((BtOps **)(pBt))) -#define btCOps(pCur) (*((BtCursorOps **)(pCur))) - -#define sqliteBtreeClose(pBt) (btOps(pBt)->Close(pBt)) -#define sqliteBtreeSetCacheSize(pBt, sz) (btOps(pBt)->SetCacheSize(pBt, sz)) -#define sqliteBtreeSetSafetyLevel(pBt, sl) (btOps(pBt)->SetSafetyLevel(pBt, sl)) -#define sqliteBtreeBeginTrans(pBt) (btOps(pBt)->BeginTrans(pBt)) -#define sqliteBtreeCommit(pBt) (btOps(pBt)->Commit(pBt)) -#define sqliteBtreeRollback(pBt) (btOps(pBt)->Rollback(pBt)) -#define sqliteBtreeBeginCkpt(pBt) (btOps(pBt)->BeginCkpt(pBt)) -#define sqliteBtreeCommitCkpt(pBt) (btOps(pBt)->CommitCkpt(pBt)) -#define sqliteBtreeRollbackCkpt(pBt) (btOps(pBt)->RollbackCkpt(pBt)) -#define sqliteBtreeCreateTable(pBt,piTable)\ - (btOps(pBt)->CreateTable(pBt,piTable)) -#define sqliteBtreeCreateIndex(pBt, piIndex)\ - (btOps(pBt)->CreateIndex(pBt, piIndex)) -#define sqliteBtreeDropTable(pBt, iTable) (btOps(pBt)->DropTable(pBt, iTable)) -#define sqliteBtreeClearTable(pBt, iTable)\ - (btOps(pBt)->ClearTable(pBt, iTable)) -#define sqliteBtreeCursor(pBt, iTable, wrFlag, ppCur)\ - (btOps(pBt)->Cursor(pBt, iTable, wrFlag, ppCur)) -#define sqliteBtreeMoveto(pCur, pKey, nKey, pRes)\ - (btCOps(pCur)->Moveto(pCur, pKey, nKey, pRes)) -#define sqliteBtreeDelete(pCur) (btCOps(pCur)->Delete(pCur)) -#define sqliteBtreeInsert(pCur, pKey, nKey, pData, nData) \ - (btCOps(pCur)->Insert(pCur, pKey, nKey, pData, nData)) -#define sqliteBtreeFirst(pCur, pRes) (btCOps(pCur)->First(pCur, pRes)) -#define sqliteBtreeLast(pCur, pRes) (btCOps(pCur)->Last(pCur, pRes)) -#define sqliteBtreeNext(pCur, pRes) (btCOps(pCur)->Next(pCur, pRes)) -#define sqliteBtreePrevious(pCur, pRes) (btCOps(pCur)->Previous(pCur, pRes)) -#define sqliteBtreeKeySize(pCur, pSize) (btCOps(pCur)->KeySize(pCur, pSize) ) -#define sqliteBtreeKey(pCur, offset, amt, zBuf)\ - (btCOps(pCur)->Key(pCur, offset, amt, zBuf)) -#define sqliteBtreeKeyCompare(pCur, pKey, nKey, nIgnore, pRes)\ - (btCOps(pCur)->KeyCompare(pCur, pKey, nKey, nIgnore, pRes)) -#define sqliteBtreeDataSize(pCur, pSize) (btCOps(pCur)->DataSize(pCur, pSize)) -#define sqliteBtreeData(pCur, offset, amt, zBuf)\ - (btCOps(pCur)->Data(pCur, offset, amt, zBuf)) -#define sqliteBtreeCloseCursor(pCur) (btCOps(pCur)->CloseCursor(pCur)) -#define sqliteBtreeGetMeta(pBt, aMeta) (btOps(pBt)->GetMeta(pBt, aMeta)) -#define sqliteBtreeUpdateMeta(pBt, aMeta) (btOps(pBt)->UpdateMeta(pBt, aMeta)) -#define sqliteBtreeIntegrityCheck(pBt, aRoot, nRoot)\ - (btOps(pBt)->IntegrityCheck(pBt, aRoot, nRoot)) -#define sqliteBtreeGetFilename(pBt) (btOps(pBt)->GetFilename(pBt)) -#define sqliteBtreeCopyFile(pBt1, pBt2) (btOps(pBt1)->Copyfile(pBt1, pBt2)) -#define sqliteBtreePager(pBt) (btOps(pBt)->Pager(pBt)) - -#ifdef SQLITE_TEST -#define sqliteBtreePageDump(pBt, pgno, recursive)\ - (btOps(pBt)->PageDump(pBt, pgno, recursive)) -#define sqliteBtreeCursorDump(pCur, aResult)\ - (btCOps(pCur)->CursorDump(pCur, aResult)) -int btree_native_byte_order; -#endif /* SQLITE_TEST */ - - -#endif /* _BTREE_H_ */ diff --git a/ext/sqlite/libsqlite/src/btree_rb.c b/ext/sqlite/libsqlite/src/btree_rb.c deleted file mode 100644 index d932ab4a97403..0000000000000 --- a/ext/sqlite/libsqlite/src/btree_rb.c +++ /dev/null @@ -1,1488 +0,0 @@ -/* -** 2003 Feb 4 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** $Id$ -** -** This file implements an in-core database using Red-Black balanced -** binary trees. -** -** It was contributed to SQLite by anonymous on 2003-Feb-04 23:24:49 UTC. -*/ -#include "btree.h" -#include "sqliteInt.h" -#include - -/* -** Omit this whole file if the SQLITE_OMIT_INMEMORYDB macro is -** defined. This allows a lot of code to be omitted for installations -** that do not need it. -*/ -#ifndef SQLITE_OMIT_INMEMORYDB - - -typedef struct BtRbTree BtRbTree; -typedef struct BtRbNode BtRbNode; -typedef struct BtRollbackOp BtRollbackOp; -typedef struct Rbtree Rbtree; -typedef struct RbtCursor RbtCursor; - -/* Forward declarations */ -static BtOps sqliteRbtreeOps; -static BtCursorOps sqliteRbtreeCursorOps; - -/* - * During each transaction (or checkpoint), a linked-list of - * "rollback-operations" is accumulated. If the transaction is rolled back, - * then the list of operations must be executed (to restore the database to - * it's state before the transaction started). If the transaction is to be - * committed, just delete the list. - * - * Each operation is represented as follows, depending on the value of eOp: - * - * ROLLBACK_INSERT -> Need to insert (pKey, pData) into table iTab. - * ROLLBACK_DELETE -> Need to delete the record (pKey) into table iTab. - * ROLLBACK_CREATE -> Need to create table iTab. - * ROLLBACK_DROP -> Need to drop table iTab. - */ -struct BtRollbackOp { - u8 eOp; - int iTab; - int nKey; - void *pKey; - int nData; - void *pData; - BtRollbackOp *pNext; -}; - -/* -** Legal values for BtRollbackOp.eOp: -*/ -#define ROLLBACK_INSERT 1 /* Insert a record */ -#define ROLLBACK_DELETE 2 /* Delete a record */ -#define ROLLBACK_CREATE 3 /* Create a table */ -#define ROLLBACK_DROP 4 /* Drop a table */ - -struct Rbtree { - BtOps *pOps; /* Function table */ - int aMetaData[SQLITE_N_BTREE_META]; - - int next_idx; /* next available table index */ - Hash tblHash; /* All created tables, by index */ - u8 isAnonymous; /* True if this Rbtree is to be deleted when closed */ - u8 eTransState; /* State of this Rbtree wrt transactions */ - - BtRollbackOp *pTransRollback; - BtRollbackOp *pCheckRollback; - BtRollbackOp *pCheckRollbackTail; -}; - -/* -** Legal values for Rbtree.eTransState. -*/ -#define TRANS_NONE 0 /* No transaction is in progress */ -#define TRANS_INTRANSACTION 1 /* A transaction is in progress */ -#define TRANS_INCHECKPOINT 2 /* A checkpoint is in progress */ -#define TRANS_ROLLBACK 3 /* We are currently rolling back a checkpoint or - * transaction. */ - -struct RbtCursor { - BtCursorOps *pOps; /* Function table */ - Rbtree *pRbtree; - BtRbTree *pTree; - int iTree; /* Index of pTree in pRbtree */ - BtRbNode *pNode; - RbtCursor *pShared; /* List of all cursors on the same Rbtree */ - u8 eSkip; /* Determines if next step operation is a no-op */ - u8 wrFlag; /* True if this cursor is open for writing */ -}; - -/* -** Legal values for RbtCursor.eSkip. -*/ -#define SKIP_NONE 0 /* Always step the cursor */ -#define SKIP_NEXT 1 /* The next sqliteRbtreeNext() is a no-op */ -#define SKIP_PREV 2 /* The next sqliteRbtreePrevious() is a no-op */ -#define SKIP_INVALID 3 /* Calls to Next() and Previous() are invalid */ - -struct BtRbTree { - RbtCursor *pCursors; /* All cursors pointing to this tree */ - BtRbNode *pHead; /* Head of the tree, or NULL */ -}; - -struct BtRbNode { - int nKey; - void *pKey; - int nData; - void *pData; - u8 isBlack; /* true for a black node, 0 for a red node */ - BtRbNode *pParent; /* Nodes parent node, NULL for the tree head */ - BtRbNode *pLeft; /* Nodes left child, or NULL */ - BtRbNode *pRight; /* Nodes right child, or NULL */ - - int nBlackHeight; /* Only used during the red-black integrity check */ -}; - -/* Forward declarations */ -static int memRbtreeMoveto( - RbtCursor* pCur, - const void *pKey, - int nKey, - int *pRes -); -static int memRbtreeClearTable(Rbtree* tree, int n); -static int memRbtreeNext(RbtCursor* pCur, int *pRes); -static int memRbtreeLast(RbtCursor* pCur, int *pRes); -static int memRbtreePrevious(RbtCursor* pCur, int *pRes); - - -/* -** This routine checks all cursors that point to the same table -** as pCur points to. If any of those cursors were opened with -** wrFlag==0 then this routine returns SQLITE_LOCKED. If all -** cursors point to the same table were opened with wrFlag==1 -** then this routine returns SQLITE_OK. -** -** In addition to checking for read-locks (where a read-lock -** means a cursor opened with wrFlag==0) this routine also NULLs -** out the pNode field of all other cursors. -** This is necessary because an insert -** or delete might change erase the node out from under -** another cursor. -*/ -static int checkReadLocks(RbtCursor *pCur){ - RbtCursor *p; - assert( pCur->wrFlag ); - for(p=pCur->pTree->pCursors; p; p=p->pShared){ - if( p!=pCur ){ - if( p->wrFlag==0 ) return SQLITE_LOCKED; - p->pNode = 0; - } - } - return SQLITE_OK; -} - -/* - * The key-compare function for the red-black trees. Returns as follows: - * - * (key1 < key2) -1 - * (key1 == key2) 0 - * (key1 > key2) 1 - * - * Keys are compared using memcmp(). If one key is an exact prefix of the - * other, then the shorter key is less than the longer key. - */ -static int key_compare(void const*pKey1, int nKey1, void const*pKey2, int nKey2) -{ - int mcmp = memcmp(pKey1, pKey2, (nKey1 <= nKey2)?nKey1:nKey2); - if( mcmp == 0){ - if( nKey1 == nKey2 ) return 0; - return ((nKey1 < nKey2)?-1:1); - } - return ((mcmp>0)?1:-1); -} - -/* - * Perform the LEFT-rotate transformation on node X of tree pTree. This - * transform is part of the red-black balancing code. - * - * | | - * X Y - * / \ / \ - * a Y X c - * / \ / \ - * b c a b - * - * BEFORE AFTER - */ -static void leftRotate(BtRbTree *pTree, BtRbNode *pX) -{ - BtRbNode *pY; - BtRbNode *pb; - pY = pX->pRight; - pb = pY->pLeft; - - pY->pParent = pX->pParent; - if( pX->pParent ){ - if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; - else pX->pParent->pRight = pY; - } - pY->pLeft = pX; - pX->pParent = pY; - pX->pRight = pb; - if( pb ) pb->pParent = pX; - if( pTree->pHead == pX ) pTree->pHead = pY; -} - -/* - * Perform the RIGHT-rotate transformation on node X of tree pTree. This - * transform is part of the red-black balancing code. - * - * | | - * X Y - * / \ / \ - * Y c a X - * / \ / \ - * a b b c - * - * BEFORE AFTER - */ -static void rightRotate(BtRbTree *pTree, BtRbNode *pX) -{ - BtRbNode *pY; - BtRbNode *pb; - pY = pX->pLeft; - pb = pY->pRight; - - pY->pParent = pX->pParent; - if( pX->pParent ){ - if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; - else pX->pParent->pRight = pY; - } - pY->pRight = pX; - pX->pParent = pY; - pX->pLeft = pb; - if( pb ) pb->pParent = pX; - if( pTree->pHead == pX ) pTree->pHead = pY; -} - -/* - * A string-manipulation helper function for check_redblack_tree(). If (orig == - * NULL) a copy of val is returned. If (orig != NULL) then a copy of the * - * concatenation of orig and val is returned. The original orig is deleted - * (using sqliteFree()). - */ -static char *append_val(char * orig, char const * val){ - char *z; - if( !orig ){ - z = sqliteStrDup( val ); - } else{ - z = 0; - sqliteSetString(&z, orig, val, (char*)0); - sqliteFree( orig ); - } - return z; -} - -/* - * Append a string representation of the entire node to orig and return it. - * This is used to produce debugging information if check_redblack_tree() finds - * a problem with a red-black binary tree. - */ -static char *append_node(char * orig, BtRbNode *pNode, int indent) -{ - char buf[128]; - int i; - - for( i=0; iisBlack ){ - orig = append_val(orig, " B \n"); - }else{ - orig = append_val(orig, " R \n"); - } - orig = append_node( orig, pNode->pLeft, indent ); - orig = append_node( orig, pNode->pRight, indent ); - }else{ - orig = append_val(orig, "\n"); - } - return orig; -} - -/* - * Print a representation of a node to stdout. This function is only included - * so you can call it from within a debugger if things get really bad. It - * is not called from anyplace in the code. - */ -static void print_node(BtRbNode *pNode) -{ - char * str = append_node(0, pNode, 0); - printf("%s", str); - - /* Suppress a warning message about print_node() being unused */ - (void)print_node; -} - -/* - * Check the following properties of the red-black tree: - * (1) - If a node is red, both of it's children are black - * (2) - Each path from a given node to a leaf (NULL) node passes thru the - * same number of black nodes - * - * If there is a problem, append a description (using append_val() ) to *msg. - */ -static void check_redblack_tree(BtRbTree * tree, char ** msg) -{ - BtRbNode *pNode; - - /* 0 -> came from parent - * 1 -> came from left - * 2 -> came from right */ - int prev_step = 0; - - pNode = tree->pHead; - while( pNode ){ - switch( prev_step ){ - case 0: - if( pNode->pLeft ){ - pNode = pNode->pLeft; - }else{ - prev_step = 1; - } - break; - case 1: - if( pNode->pRight ){ - pNode = pNode->pRight; - prev_step = 0; - }else{ - prev_step = 2; - } - break; - case 2: - /* Check red-black property (1) */ - if( !pNode->isBlack && - ( (pNode->pLeft && !pNode->pLeft->isBlack) || - (pNode->pRight && !pNode->pRight->isBlack) ) - ){ - char buf[128]; - sprintf(buf, "Red node with red child at %p\n", pNode); - *msg = append_val(*msg, buf); - *msg = append_node(*msg, tree->pHead, 0); - *msg = append_val(*msg, "\n"); - } - - /* Check red-black property (2) */ - { - int leftHeight = 0; - int rightHeight = 0; - if( pNode->pLeft ){ - leftHeight += pNode->pLeft->nBlackHeight; - leftHeight += (pNode->pLeft->isBlack?1:0); - } - if( pNode->pRight ){ - rightHeight += pNode->pRight->nBlackHeight; - rightHeight += (pNode->pRight->isBlack?1:0); - } - if( leftHeight != rightHeight ){ - char buf[128]; - sprintf(buf, "Different black-heights at %p\n", pNode); - *msg = append_val(*msg, buf); - *msg = append_node(*msg, tree->pHead, 0); - *msg = append_val(*msg, "\n"); - } - pNode->nBlackHeight = leftHeight; - } - - if( pNode->pParent ){ - if( pNode == pNode->pParent->pLeft ) prev_step = 1; - else prev_step = 2; - } - pNode = pNode->pParent; - break; - default: assert(0); - } - } -} - -/* - * Node pX has just been inserted into pTree (by code in sqliteRbtreeInsert()). - * It is possible that pX is a red node with a red parent, which is a violation - * of the red-black tree properties. This function performs rotations and - * color changes to rebalance the tree - */ -static void do_insert_balancing(BtRbTree *pTree, BtRbNode *pX) -{ - /* In the first iteration of this loop, pX points to the red node just - * inserted in the tree. If the parent of pX exists (pX is not the root - * node) and is red, then the properties of the red-black tree are - * violated. - * - * At the start of any subsequent iterations, pX points to a red node - * with a red parent. In all other respects the tree is a legal red-black - * binary tree. */ - while( pX != pTree->pHead && !pX->pParent->isBlack ){ - BtRbNode *pUncle; - BtRbNode *pGrandparent; - - /* Grandparent of pX must exist and must be black. */ - pGrandparent = pX->pParent->pParent; - assert( pGrandparent ); - assert( pGrandparent->isBlack ); - - /* Uncle of pX may or may not exist. */ - if( pX->pParent == pGrandparent->pLeft ) - pUncle = pGrandparent->pRight; - else - pUncle = pGrandparent->pLeft; - - /* If the uncle of pX exists and is red, we do the following: - * | | - * G(b) G(r) - * / \ / \ - * U(r) P(r) U(b) P(b) - * \ \ - * X(r) X(r) - * - * BEFORE AFTER - * pX is then set to G. If the parent of G is red, then the while loop - * will run again. */ - if( pUncle && !pUncle->isBlack ){ - pGrandparent->isBlack = 0; - pUncle->isBlack = 1; - pX->pParent->isBlack = 1; - pX = pGrandparent; - }else{ - - if( pX->pParent == pGrandparent->pLeft ){ - if( pX == pX->pParent->pRight ){ - /* If pX is a right-child, do the following transform, essentially - * to change pX into a left-child: - * | | - * G(b) G(b) - * / \ / \ - * P(r) U(b) X(r) U(b) - * \ / - * X(r) P(r) <-- new X - * - * BEFORE AFTER - */ - pX = pX->pParent; - leftRotate(pTree, pX); - } - - /* Do the following transform, which balances the tree :) - * | | - * G(b) P(b) - * / \ / \ - * P(r) U(b) X(r) G(r) - * / \ - * X(r) U(b) - * - * BEFORE AFTER - */ - assert( pGrandparent == pX->pParent->pParent ); - pGrandparent->isBlack = 0; - pX->pParent->isBlack = 1; - rightRotate( pTree, pGrandparent ); - - }else{ - /* This code is symetric to the illustrated case above. */ - if( pX == pX->pParent->pLeft ){ - pX = pX->pParent; - rightRotate(pTree, pX); - } - assert( pGrandparent == pX->pParent->pParent ); - pGrandparent->isBlack = 0; - pX->pParent->isBlack = 1; - leftRotate( pTree, pGrandparent ); - } - } - } - pTree->pHead->isBlack = 1; -} - -/* - * A child of pParent, which in turn had child pX, has just been removed from - * pTree (the figure below depicts the operation, Z is being removed). pParent - * or pX, or both may be NULL. - * | | - * P P - * / \ / \ - * Z X - * / \ - * X nil - * - * This function is only called if Z was black. In this case the red-black tree - * properties have been violated, and pX has an "extra black". This function - * performs rotations and color-changes to re-balance the tree. - */ -static -void do_delete_balancing(BtRbTree *pTree, BtRbNode *pX, BtRbNode *pParent) -{ - BtRbNode *pSib; - - /* TODO: Comment this code! */ - while( pX != pTree->pHead && (!pX || pX->isBlack) ){ - if( pX == pParent->pLeft ){ - pSib = pParent->pRight; - if( pSib && !(pSib->isBlack) ){ - pSib->isBlack = 1; - pParent->isBlack = 0; - leftRotate(pTree, pParent); - pSib = pParent->pRight; - } - if( !pSib ){ - pX = pParent; - }else if( - (!pSib->pLeft || pSib->pLeft->isBlack) && - (!pSib->pRight || pSib->pRight->isBlack) ) { - pSib->isBlack = 0; - pX = pParent; - }else{ - if( (!pSib->pRight || pSib->pRight->isBlack) ){ - if( pSib->pLeft ) pSib->pLeft->isBlack = 1; - pSib->isBlack = 0; - rightRotate( pTree, pSib ); - pSib = pParent->pRight; - } - pSib->isBlack = pParent->isBlack; - pParent->isBlack = 1; - if( pSib->pRight ) pSib->pRight->isBlack = 1; - leftRotate(pTree, pParent); - pX = pTree->pHead; - } - }else{ - pSib = pParent->pLeft; - if( pSib && !(pSib->isBlack) ){ - pSib->isBlack = 1; - pParent->isBlack = 0; - rightRotate(pTree, pParent); - pSib = pParent->pLeft; - } - if( !pSib ){ - pX = pParent; - }else if( - (!pSib->pLeft || pSib->pLeft->isBlack) && - (!pSib->pRight || pSib->pRight->isBlack) ){ - pSib->isBlack = 0; - pX = pParent; - }else{ - if( (!pSib->pLeft || pSib->pLeft->isBlack) ){ - if( pSib->pRight ) pSib->pRight->isBlack = 1; - pSib->isBlack = 0; - leftRotate( pTree, pSib ); - pSib = pParent->pLeft; - } - pSib->isBlack = pParent->isBlack; - pParent->isBlack = 1; - if( pSib->pLeft ) pSib->pLeft->isBlack = 1; - rightRotate(pTree, pParent); - pX = pTree->pHead; - } - } - pParent = pX->pParent; - } - if( pX ) pX->isBlack = 1; -} - -/* - * Create table n in tree pRbtree. Table n must not exist. - */ -static void btreeCreateTable(Rbtree* pRbtree, int n) -{ - BtRbTree *pNewTbl = sqliteMalloc(sizeof(BtRbTree)); - sqliteHashInsert(&pRbtree->tblHash, 0, n, pNewTbl); -} - -/* - * Log a single "rollback-op" for the given Rbtree. See comments for struct - * BtRollbackOp. - */ -static void btreeLogRollbackOp(Rbtree* pRbtree, BtRollbackOp *pRollbackOp) -{ - assert( pRbtree->eTransState == TRANS_INCHECKPOINT || - pRbtree->eTransState == TRANS_INTRANSACTION ); - if( pRbtree->eTransState == TRANS_INTRANSACTION ){ - pRollbackOp->pNext = pRbtree->pTransRollback; - pRbtree->pTransRollback = pRollbackOp; - } - if( pRbtree->eTransState == TRANS_INCHECKPOINT ){ - if( !pRbtree->pCheckRollback ){ - pRbtree->pCheckRollbackTail = pRollbackOp; - } - pRollbackOp->pNext = pRbtree->pCheckRollback; - pRbtree->pCheckRollback = pRollbackOp; - } -} - -int sqliteRbtreeOpen( - const char *zFilename, - int mode, - int nPg, - Btree **ppBtree -){ - Rbtree **ppRbtree = (Rbtree**)ppBtree; - *ppRbtree = (Rbtree *)sqliteMalloc(sizeof(Rbtree)); - if( sqlite_malloc_failed ) goto open_no_mem; - sqliteHashInit(&(*ppRbtree)->tblHash, SQLITE_HASH_INT, 0); - - /* Create a binary tree for the SQLITE_MASTER table at location 2 */ - btreeCreateTable(*ppRbtree, 2); - if( sqlite_malloc_failed ) goto open_no_mem; - (*ppRbtree)->next_idx = 3; - (*ppRbtree)->pOps = &sqliteRbtreeOps; - /* Set file type to 4; this is so that "attach ':memory:' as ...." does not - ** think that the database in uninitialised and refuse to attach - */ - (*ppRbtree)->aMetaData[2] = 4; - - return SQLITE_OK; - -open_no_mem: - *ppBtree = 0; - return SQLITE_NOMEM; -} - -/* - * Create a new table in the supplied Rbtree. Set *n to the new table number. - * Return SQLITE_OK if the operation is a success. - */ -static int memRbtreeCreateTable(Rbtree* tree, int* n) -{ - assert( tree->eTransState != TRANS_NONE ); - - *n = tree->next_idx++; - btreeCreateTable(tree, *n); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - - /* Set up the rollback structure (if we are not doing this as part of a - * rollback) */ - if( tree->eTransState != TRANS_ROLLBACK ){ - BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); - if( pRollbackOp==0 ) return SQLITE_NOMEM; - pRollbackOp->eOp = ROLLBACK_DROP; - pRollbackOp->iTab = *n; - btreeLogRollbackOp(tree, pRollbackOp); - } - - return SQLITE_OK; -} - -/* - * Delete table n from the supplied Rbtree. - */ -static int memRbtreeDropTable(Rbtree* tree, int n) -{ - BtRbTree *pTree; - assert( tree->eTransState != TRANS_NONE ); - - memRbtreeClearTable(tree, n); - pTree = sqliteHashInsert(&tree->tblHash, 0, n, 0); - assert(pTree); - assert( pTree->pCursors==0 ); - sqliteFree(pTree); - - if( tree->eTransState != TRANS_ROLLBACK ){ - BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); - if( pRollbackOp==0 ) return SQLITE_NOMEM; - pRollbackOp->eOp = ROLLBACK_CREATE; - pRollbackOp->iTab = n; - btreeLogRollbackOp(tree, pRollbackOp); - } - - return SQLITE_OK; -} - -static int memRbtreeKeyCompare(RbtCursor* pCur, const void *pKey, int nKey, - int nIgnore, int *pRes) -{ - assert(pCur); - - if( !pCur->pNode ) { - *pRes = -1; - } else { - if( (pCur->pNode->nKey - nIgnore) < 0 ){ - *pRes = -1; - }else{ - *pRes = key_compare(pCur->pNode->pKey, pCur->pNode->nKey-nIgnore, - pKey, nKey); - } - } - return SQLITE_OK; -} - -/* - * Get a new cursor for table iTable of the supplied Rbtree. The wrFlag - * parameter indicates that the cursor is open for writing. - * - * Note that RbtCursor.eSkip and RbtCursor.pNode both initialize to 0. - */ -static int memRbtreeCursor( - Rbtree* tree, - int iTable, - int wrFlag, - RbtCursor **ppCur -){ - RbtCursor *pCur; - assert(tree); - pCur = *ppCur = sqliteMalloc(sizeof(RbtCursor)); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - pCur->pTree = sqliteHashFind(&tree->tblHash, 0, iTable); - assert( pCur->pTree ); - pCur->pRbtree = tree; - pCur->iTree = iTable; - pCur->pOps = &sqliteRbtreeCursorOps; - pCur->wrFlag = wrFlag; - pCur->pShared = pCur->pTree->pCursors; - pCur->pTree->pCursors = pCur; - - assert( (*ppCur)->pTree ); - return SQLITE_OK; -} - -/* - * Insert a new record into the Rbtree. The key is given by (pKey,nKey) - * and the data is given by (pData,nData). The cursor is used only to - * define what database the record should be inserted into. The cursor - * is left pointing at the new record. - * - * If the key exists already in the tree, just replace the data. - */ -static int memRbtreeInsert( - RbtCursor* pCur, - const void *pKey, - int nKey, - const void *pDataInput, - int nData -){ - void * pData; - int match; - - /* It is illegal to call sqliteRbtreeInsert() if we are - ** not in a transaction */ - assert( pCur->pRbtree->eTransState != TRANS_NONE ); - - /* Make sure some other cursor isn't trying to read this same table */ - if( checkReadLocks(pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - - /* Take a copy of the input data now, in case we need it for the - * replace case */ - pData = sqliteMallocRaw(nData); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - memcpy(pData, pDataInput, nData); - - /* Move the cursor to a node near the key to be inserted. If the key already - * exists in the table, then (match == 0). In this case we can just replace - * the data associated with the entry, we don't need to manipulate the tree. - * - * If there is no exact match, then the cursor points at what would be either - * the predecessor (match == -1) or successor (match == 1) of the - * searched-for key, were it to be inserted. The new node becomes a child of - * this node. - * - * The new node is initially red. - */ - memRbtreeMoveto( pCur, pKey, nKey, &match); - if( match ){ - BtRbNode *pNode = sqliteMalloc(sizeof(BtRbNode)); - if( pNode==0 ) return SQLITE_NOMEM; - pNode->nKey = nKey; - pNode->pKey = sqliteMallocRaw(nKey); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - memcpy(pNode->pKey, pKey, nKey); - pNode->nData = nData; - pNode->pData = pData; - if( pCur->pNode ){ - switch( match ){ - case -1: - assert( !pCur->pNode->pRight ); - pNode->pParent = pCur->pNode; - pCur->pNode->pRight = pNode; - break; - case 1: - assert( !pCur->pNode->pLeft ); - pNode->pParent = pCur->pNode; - pCur->pNode->pLeft = pNode; - break; - default: - assert(0); - } - }else{ - pCur->pTree->pHead = pNode; - } - - /* Point the cursor at the node just inserted, as per SQLite requirements */ - pCur->pNode = pNode; - - /* A new node has just been inserted, so run the balancing code */ - do_insert_balancing(pCur->pTree, pNode); - - /* Set up a rollback-op in case we have to roll this operation back */ - if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ - BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); - if( pOp==0 ) return SQLITE_NOMEM; - pOp->eOp = ROLLBACK_DELETE; - pOp->iTab = pCur->iTree; - pOp->nKey = pNode->nKey; - pOp->pKey = sqliteMallocRaw( pOp->nKey ); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - memcpy( pOp->pKey, pNode->pKey, pOp->nKey ); - btreeLogRollbackOp(pCur->pRbtree, pOp); - } - - }else{ - /* No need to insert a new node in the tree, as the key already exists. - * Just clobber the current nodes data. */ - - /* Set up a rollback-op in case we have to roll this operation back */ - if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ - BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); - if( pOp==0 ) return SQLITE_NOMEM; - pOp->iTab = pCur->iTree; - pOp->nKey = pCur->pNode->nKey; - pOp->pKey = sqliteMallocRaw( pOp->nKey ); - if( sqlite_malloc_failed ) return SQLITE_NOMEM; - memcpy( pOp->pKey, pCur->pNode->pKey, pOp->nKey ); - pOp->nData = pCur->pNode->nData; - pOp->pData = pCur->pNode->pData; - pOp->eOp = ROLLBACK_INSERT; - btreeLogRollbackOp(pCur->pRbtree, pOp); - }else{ - sqliteFree( pCur->pNode->pData ); - } - - /* Actually clobber the nodes data */ - pCur->pNode->pData = pData; - pCur->pNode->nData = nData; - } - - return SQLITE_OK; -} - -/* Move the cursor so that it points to an entry near pKey. -** Return a success code. -** -** *pRes<0 The cursor is left pointing at an entry that -** is smaller than pKey or if the table is empty -** and the cursor is therefore left point to nothing. -** -** *pRes==0 The cursor is left pointing at an entry that -** exactly matches pKey. -** -** *pRes>0 The cursor is left pointing at an entry that -** is larger than pKey. -*/ -static int memRbtreeMoveto( - RbtCursor* pCur, - const void *pKey, - int nKey, - int *pRes -){ - BtRbNode *pTmp = 0; - - pCur->pNode = pCur->pTree->pHead; - *pRes = -1; - while( pCur->pNode && *pRes ) { - *pRes = key_compare(pCur->pNode->pKey, pCur->pNode->nKey, pKey, nKey); - pTmp = pCur->pNode; - switch( *pRes ){ - case 1: /* cursor > key */ - pCur->pNode = pCur->pNode->pLeft; - break; - case -1: /* cursor < key */ - pCur->pNode = pCur->pNode->pRight; - break; - } - } - - /* If (pCur->pNode == NULL), then we have failed to find a match. Set - * pCur->pNode to pTmp, which is either NULL (if the tree is empty) or the - * last node traversed in the search. In either case the relation ship - * between pTmp and the searched for key is already stored in *pRes. pTmp is - * either the successor or predecessor of the key we tried to move to. */ - if( !pCur->pNode ) pCur->pNode = pTmp; - pCur->eSkip = SKIP_NONE; - - return SQLITE_OK; -} - - -/* -** Delete the entry that the cursor is pointing to. -** -** The cursor is left pointing at either the next or the previous -** entry. If the cursor is left pointing to the next entry, then -** the pCur->eSkip flag is set to SKIP_NEXT which forces the next call to -** sqliteRbtreeNext() to be a no-op. That way, you can always call -** sqliteRbtreeNext() after a delete and the cursor will be left -** pointing to the first entry after the deleted entry. Similarly, -** pCur->eSkip is set to SKIP_PREV is the cursor is left pointing to -** the entry prior to the deleted entry so that a subsequent call to -** sqliteRbtreePrevious() will always leave the cursor pointing at the -** entry immediately before the one that was deleted. -*/ -static int memRbtreeDelete(RbtCursor* pCur) -{ - BtRbNode *pZ; /* The one being deleted */ - BtRbNode *pChild; /* The child of the spliced out node */ - - /* It is illegal to call sqliteRbtreeDelete() if we are - ** not in a transaction */ - assert( pCur->pRbtree->eTransState != TRANS_NONE ); - - /* Make sure some other cursor isn't trying to read this same table */ - if( checkReadLocks(pCur) ){ - return SQLITE_LOCKED; /* The table pCur points to has a read lock */ - } - - pZ = pCur->pNode; - if( !pZ ){ - return SQLITE_OK; - } - - /* If we are not currently doing a rollback, set up a rollback op for this - * deletion */ - if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ - BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); - if( pOp==0 ) return SQLITE_NOMEM; - pOp->iTab = pCur->iTree; - pOp->nKey = pZ->nKey; - pOp->pKey = pZ->pKey; - pOp->nData = pZ->nData; - pOp->pData = pZ->pData; - pOp->eOp = ROLLBACK_INSERT; - btreeLogRollbackOp(pCur->pRbtree, pOp); - } - - /* First do a standard binary-tree delete (node pZ is to be deleted). How - * to do this depends on how many children pZ has: - * - * If pZ has no children or one child, then splice out pZ. If pZ has two - * children, splice out the successor of pZ and replace the key and data of - * pZ with the key and data of the spliced out successor. */ - if( pZ->pLeft && pZ->pRight ){ - BtRbNode *pTmp; - int dummy; - pCur->eSkip = SKIP_NONE; - memRbtreeNext(pCur, &dummy); - assert( dummy == 0 ); - if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ - sqliteFree(pZ->pKey); - sqliteFree(pZ->pData); - } - pZ->pData = pCur->pNode->pData; - pZ->nData = pCur->pNode->nData; - pZ->pKey = pCur->pNode->pKey; - pZ->nKey = pCur->pNode->nKey; - pTmp = pZ; - pZ = pCur->pNode; - pCur->pNode = pTmp; - pCur->eSkip = SKIP_NEXT; - }else{ - int res; - pCur->eSkip = SKIP_NONE; - memRbtreeNext(pCur, &res); - pCur->eSkip = SKIP_NEXT; - if( res ){ - memRbtreeLast(pCur, &res); - memRbtreePrevious(pCur, &res); - pCur->eSkip = SKIP_PREV; - } - if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ - sqliteFree(pZ->pKey); - sqliteFree(pZ->pData); - } - } - - /* pZ now points at the node to be spliced out. This block does the - * splicing. */ - { - BtRbNode **ppParentSlot = 0; - assert( !pZ->pLeft || !pZ->pRight ); /* pZ has at most one child */ - pChild = ((pZ->pLeft)?pZ->pLeft:pZ->pRight); - if( pZ->pParent ){ - assert( pZ == pZ->pParent->pLeft || pZ == pZ->pParent->pRight ); - ppParentSlot = ((pZ == pZ->pParent->pLeft) - ?&pZ->pParent->pLeft:&pZ->pParent->pRight); - *ppParentSlot = pChild; - }else{ - pCur->pTree->pHead = pChild; - } - if( pChild ) pChild->pParent = pZ->pParent; - } - - /* pZ now points at the spliced out node. pChild is the only child of pZ, or - * NULL if pZ has no children. If pZ is black, and not the tree root, then we - * will have violated the "same number of black nodes in every path to a - * leaf" property of the red-black tree. The code in do_delete_balancing() - * repairs this. */ - if( pZ->isBlack ){ - do_delete_balancing(pCur->pTree, pChild, pZ->pParent); - } - - sqliteFree(pZ); - return SQLITE_OK; -} - -/* - * Empty table n of the Rbtree. - */ -static int memRbtreeClearTable(Rbtree* tree, int n) -{ - BtRbTree *pTree; - BtRbNode *pNode; - - pTree = sqliteHashFind(&tree->tblHash, 0, n); - assert(pTree); - - pNode = pTree->pHead; - while( pNode ){ - if( pNode->pLeft ){ - pNode = pNode->pLeft; - } - else if( pNode->pRight ){ - pNode = pNode->pRight; - } - else { - BtRbNode *pTmp = pNode->pParent; - if( tree->eTransState == TRANS_ROLLBACK ){ - sqliteFree( pNode->pKey ); - sqliteFree( pNode->pData ); - }else{ - BtRollbackOp *pRollbackOp = sqliteMallocRaw(sizeof(BtRollbackOp)); - if( pRollbackOp==0 ) return SQLITE_NOMEM; - pRollbackOp->eOp = ROLLBACK_INSERT; - pRollbackOp->iTab = n; - pRollbackOp->nKey = pNode->nKey; - pRollbackOp->pKey = pNode->pKey; - pRollbackOp->nData = pNode->nData; - pRollbackOp->pData = pNode->pData; - btreeLogRollbackOp(tree, pRollbackOp); - } - sqliteFree( pNode ); - if( pTmp ){ - if( pTmp->pLeft == pNode ) pTmp->pLeft = 0; - else if( pTmp->pRight == pNode ) pTmp->pRight = 0; - } - pNode = pTmp; - } - } - - pTree->pHead = 0; - return SQLITE_OK; -} - -static int memRbtreeFirst(RbtCursor* pCur, int *pRes) -{ - if( pCur->pTree->pHead ){ - pCur->pNode = pCur->pTree->pHead; - while( pCur->pNode->pLeft ){ - pCur->pNode = pCur->pNode->pLeft; - } - } - if( pCur->pNode ){ - *pRes = 0; - }else{ - *pRes = 1; - } - pCur->eSkip = SKIP_NONE; - return SQLITE_OK; -} - -static int memRbtreeLast(RbtCursor* pCur, int *pRes) -{ - if( pCur->pTree->pHead ){ - pCur->pNode = pCur->pTree->pHead; - while( pCur->pNode->pRight ){ - pCur->pNode = pCur->pNode->pRight; - } - } - if( pCur->pNode ){ - *pRes = 0; - }else{ - *pRes = 1; - } - pCur->eSkip = SKIP_NONE; - return SQLITE_OK; -} - -/* -** Advance the cursor to the next entry in the database. If -** successful then set *pRes=0. If the cursor -** was already pointing to the last entry in the database before -** this routine was called, then set *pRes=1. -*/ -static int memRbtreeNext(RbtCursor* pCur, int *pRes) -{ - if( pCur->pNode && pCur->eSkip != SKIP_NEXT ){ - if( pCur->pNode->pRight ){ - pCur->pNode = pCur->pNode->pRight; - while( pCur->pNode->pLeft ) - pCur->pNode = pCur->pNode->pLeft; - }else{ - BtRbNode * pX = pCur->pNode; - pCur->pNode = pX->pParent; - while( pCur->pNode && (pCur->pNode->pRight == pX) ){ - pX = pCur->pNode; - pCur->pNode = pX->pParent; - } - } - } - pCur->eSkip = SKIP_NONE; - - if( !pCur->pNode ){ - *pRes = 1; - }else{ - *pRes = 0; - } - - return SQLITE_OK; -} - -static int memRbtreePrevious(RbtCursor* pCur, int *pRes) -{ - if( pCur->pNode && pCur->eSkip != SKIP_PREV ){ - if( pCur->pNode->pLeft ){ - pCur->pNode = pCur->pNode->pLeft; - while( pCur->pNode->pRight ) - pCur->pNode = pCur->pNode->pRight; - }else{ - BtRbNode * pX = pCur->pNode; - pCur->pNode = pX->pParent; - while( pCur->pNode && (pCur->pNode->pLeft == pX) ){ - pX = pCur->pNode; - pCur->pNode = pX->pParent; - } - } - } - pCur->eSkip = SKIP_NONE; - - if( !pCur->pNode ){ - *pRes = 1; - }else{ - *pRes = 0; - } - - return SQLITE_OK; -} - -static int memRbtreeKeySize(RbtCursor* pCur, int *pSize) -{ - if( pCur->pNode ){ - *pSize = pCur->pNode->nKey; - }else{ - *pSize = 0; - } - return SQLITE_OK; -} - -static int memRbtreeKey(RbtCursor* pCur, int offset, int amt, char *zBuf) -{ - if( !pCur->pNode ) return 0; - if( !pCur->pNode->pKey || ((amt + offset) <= pCur->pNode->nKey) ){ - memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, amt); - }else{ - memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, pCur->pNode->nKey-offset); - amt = pCur->pNode->nKey-offset; - } - return amt; -} - -static int memRbtreeDataSize(RbtCursor* pCur, int *pSize) -{ - if( pCur->pNode ){ - *pSize = pCur->pNode->nData; - }else{ - *pSize = 0; - } - return SQLITE_OK; -} - -static int memRbtreeData(RbtCursor *pCur, int offset, int amt, char *zBuf) -{ - if( !pCur->pNode ) return 0; - if( (amt + offset) <= pCur->pNode->nData ){ - memcpy(zBuf, ((char*)pCur->pNode->pData)+offset, amt); - }else{ - memcpy(zBuf, ((char*)pCur->pNode->pData)+offset ,pCur->pNode->nData-offset); - amt = pCur->pNode->nData-offset; - } - return amt; -} - -static int memRbtreeCloseCursor(RbtCursor* pCur) -{ - if( pCur->pTree->pCursors==pCur ){ - pCur->pTree->pCursors = pCur->pShared; - }else{ - RbtCursor *p = pCur->pTree->pCursors; - while( p && p->pShared!=pCur ){ p = p->pShared; } - assert( p!=0 ); - if( p ){ - p->pShared = pCur->pShared; - } - } - sqliteFree(pCur); - return SQLITE_OK; -} - -static int memRbtreeGetMeta(Rbtree* tree, int* aMeta) -{ - memcpy( aMeta, tree->aMetaData, sizeof(int) * SQLITE_N_BTREE_META ); - return SQLITE_OK; -} - -static int memRbtreeUpdateMeta(Rbtree* tree, int* aMeta) -{ - memcpy( tree->aMetaData, aMeta, sizeof(int) * SQLITE_N_BTREE_META ); - return SQLITE_OK; -} - -/* - * Check that each table in the Rbtree meets the requirements for a red-black - * binary tree. If an error is found, return an explanation of the problem in - * memory obtained from sqliteMalloc(). Parameters aRoot and nRoot are ignored. - */ -static char *memRbtreeIntegrityCheck(Rbtree* tree, int* aRoot, int nRoot) -{ - char * msg = 0; - HashElem *p; - - for(p=sqliteHashFirst(&tree->tblHash); p; p=sqliteHashNext(p)){ - BtRbTree *pTree = sqliteHashData(p); - check_redblack_tree(pTree, &msg); - } - - return msg; -} - -static int memRbtreeSetCacheSize(Rbtree* tree, int sz) -{ - return SQLITE_OK; -} - -static int memRbtreeSetSafetyLevel(Rbtree *pBt, int level){ - return SQLITE_OK; -} - -static int memRbtreeBeginTrans(Rbtree* tree) -{ - if( tree->eTransState != TRANS_NONE ) - return SQLITE_ERROR; - - assert( tree->pTransRollback == 0 ); - tree->eTransState = TRANS_INTRANSACTION; - return SQLITE_OK; -} - -/* -** Delete a linked list of BtRollbackOp structures. -*/ -static void deleteRollbackList(BtRollbackOp *pOp){ - while( pOp ){ - BtRollbackOp *pTmp = pOp->pNext; - sqliteFree(pOp->pData); - sqliteFree(pOp->pKey); - sqliteFree(pOp); - pOp = pTmp; - } -} - -static int memRbtreeCommit(Rbtree* tree){ - /* Just delete pTransRollback and pCheckRollback */ - deleteRollbackList(tree->pCheckRollback); - deleteRollbackList(tree->pTransRollback); - tree->pTransRollback = 0; - tree->pCheckRollback = 0; - tree->pCheckRollbackTail = 0; - tree->eTransState = TRANS_NONE; - return SQLITE_OK; -} - -/* - * Close the supplied Rbtree. Delete everything associated with it. - */ -static int memRbtreeClose(Rbtree* tree) -{ - HashElem *p; - memRbtreeCommit(tree); - while( (p=sqliteHashFirst(&tree->tblHash))!=0 ){ - tree->eTransState = TRANS_ROLLBACK; - memRbtreeDropTable(tree, sqliteHashKeysize(p)); - } - sqliteHashClear(&tree->tblHash); - sqliteFree(tree); - return SQLITE_OK; -} - -/* - * Execute and delete the supplied rollback-list on pRbtree. - */ -static void execute_rollback_list(Rbtree *pRbtree, BtRollbackOp *pList) -{ - BtRollbackOp *pTmp; - RbtCursor cur; - int res; - - cur.pRbtree = pRbtree; - cur.wrFlag = 1; - while( pList ){ - switch( pList->eOp ){ - case ROLLBACK_INSERT: - cur.pTree = sqliteHashFind( &pRbtree->tblHash, 0, pList->iTab ); - assert(cur.pTree); - cur.iTree = pList->iTab; - cur.eSkip = SKIP_NONE; - memRbtreeInsert( &cur, pList->pKey, - pList->nKey, pList->pData, pList->nData ); - break; - case ROLLBACK_DELETE: - cur.pTree = sqliteHashFind( &pRbtree->tblHash, 0, pList->iTab ); - assert(cur.pTree); - cur.iTree = pList->iTab; - cur.eSkip = SKIP_NONE; - memRbtreeMoveto(&cur, pList->pKey, pList->nKey, &res); - assert(res == 0); - memRbtreeDelete( &cur ); - break; - case ROLLBACK_CREATE: - btreeCreateTable(pRbtree, pList->iTab); - break; - case ROLLBACK_DROP: - memRbtreeDropTable(pRbtree, pList->iTab); - break; - default: - assert(0); - } - sqliteFree(pList->pKey); - sqliteFree(pList->pData); - pTmp = pList->pNext; - sqliteFree(pList); - pList = pTmp; - } -} - -static int memRbtreeRollback(Rbtree* tree) -{ - tree->eTransState = TRANS_ROLLBACK; - execute_rollback_list(tree, tree->pCheckRollback); - execute_rollback_list(tree, tree->pTransRollback); - tree->pTransRollback = 0; - tree->pCheckRollback = 0; - tree->pCheckRollbackTail = 0; - tree->eTransState = TRANS_NONE; - return SQLITE_OK; -} - -static int memRbtreeBeginCkpt(Rbtree* tree) -{ - if( tree->eTransState != TRANS_INTRANSACTION ) - return SQLITE_ERROR; - - assert( tree->pCheckRollback == 0 ); - assert( tree->pCheckRollbackTail == 0 ); - tree->eTransState = TRANS_INCHECKPOINT; - return SQLITE_OK; -} - -static int memRbtreeCommitCkpt(Rbtree* tree) -{ - if( tree->eTransState == TRANS_INCHECKPOINT ){ - if( tree->pCheckRollback ){ - tree->pCheckRollbackTail->pNext = tree->pTransRollback; - tree->pTransRollback = tree->pCheckRollback; - tree->pCheckRollback = 0; - tree->pCheckRollbackTail = 0; - } - tree->eTransState = TRANS_INTRANSACTION; - } - return SQLITE_OK; -} - -static int memRbtreeRollbackCkpt(Rbtree* tree) -{ - if( tree->eTransState != TRANS_INCHECKPOINT ) return SQLITE_OK; - tree->eTransState = TRANS_ROLLBACK; - execute_rollback_list(tree, tree->pCheckRollback); - tree->pCheckRollback = 0; - tree->pCheckRollbackTail = 0; - tree->eTransState = TRANS_INTRANSACTION; - return SQLITE_OK; -} - -#ifdef SQLITE_TEST -static int memRbtreePageDump(Rbtree* tree, int pgno, int rec) -{ - assert(!"Cannot call sqliteRbtreePageDump"); - return SQLITE_OK; -} - -static int memRbtreeCursorDump(RbtCursor* pCur, int* aRes) -{ - assert(!"Cannot call sqliteRbtreeCursorDump"); - return SQLITE_OK; -} -#endif - -static struct Pager *memRbtreePager(Rbtree* tree) -{ - return 0; -} - -/* -** Return the full pathname of the underlying database file. -*/ -static const char *memRbtreeGetFilename(Rbtree *pBt){ - return 0; /* A NULL return indicates there is no underlying file */ -} - -/* -** The copy file function is not implemented for the in-memory database -*/ -static int memRbtreeCopyFile(Rbtree *pBt, Rbtree *pBt2){ - return SQLITE_INTERNAL; /* Not implemented */ -} - -static BtOps sqliteRbtreeOps = { - (int(*)(Btree*)) memRbtreeClose, - (int(*)(Btree*,int)) memRbtreeSetCacheSize, - (int(*)(Btree*,int)) memRbtreeSetSafetyLevel, - (int(*)(Btree*)) memRbtreeBeginTrans, - (int(*)(Btree*)) memRbtreeCommit, - (int(*)(Btree*)) memRbtreeRollback, - (int(*)(Btree*)) memRbtreeBeginCkpt, - (int(*)(Btree*)) memRbtreeCommitCkpt, - (int(*)(Btree*)) memRbtreeRollbackCkpt, - (int(*)(Btree*,int*)) memRbtreeCreateTable, - (int(*)(Btree*,int*)) memRbtreeCreateTable, - (int(*)(Btree*,int)) memRbtreeDropTable, - (int(*)(Btree*,int)) memRbtreeClearTable, - (int(*)(Btree*,int,int,BtCursor**)) memRbtreeCursor, - (int(*)(Btree*,int*)) memRbtreeGetMeta, - (int(*)(Btree*,int*)) memRbtreeUpdateMeta, - (char*(*)(Btree*,int*,int)) memRbtreeIntegrityCheck, - (const char*(*)(Btree*)) memRbtreeGetFilename, - (int(*)(Btree*,Btree*)) memRbtreeCopyFile, - (struct Pager*(*)(Btree*)) memRbtreePager, -#ifdef SQLITE_TEST - (int(*)(Btree*,int,int)) memRbtreePageDump, -#endif -}; - -static BtCursorOps sqliteRbtreeCursorOps = { - (int(*)(BtCursor*,const void*,int,int*)) memRbtreeMoveto, - (int(*)(BtCursor*)) memRbtreeDelete, - (int(*)(BtCursor*,const void*,int,const void*,int)) memRbtreeInsert, - (int(*)(BtCursor*,int*)) memRbtreeFirst, - (int(*)(BtCursor*,int*)) memRbtreeLast, - (int(*)(BtCursor*,int*)) memRbtreeNext, - (int(*)(BtCursor*,int*)) memRbtreePrevious, - (int(*)(BtCursor*,int*)) memRbtreeKeySize, - (int(*)(BtCursor*,int,int,char*)) memRbtreeKey, - (int(*)(BtCursor*,const void*,int,int,int*)) memRbtreeKeyCompare, - (int(*)(BtCursor*,int*)) memRbtreeDataSize, - (int(*)(BtCursor*,int,int,char*)) memRbtreeData, - (int(*)(BtCursor*)) memRbtreeCloseCursor, -#ifdef SQLITE_TEST - (int(*)(BtCursor*,int*)) memRbtreeCursorDump, -#endif - -}; - -#endif /* SQLITE_OMIT_INMEMORYDB */ diff --git a/ext/sqlite/libsqlite/src/build.c b/ext/sqlite/libsqlite/src/build.c deleted file mode 100644 index a089bfe625bee..0000000000000 --- a/ext/sqlite/libsqlite/src/build.c +++ /dev/null @@ -1,2156 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK -** PRAGMA -** -** $Id$ -*/ -#include "sqliteInt.h" -#include - -/* -** This routine is called when a new SQL statement is beginning to -** be parsed. Check to see if the schema for the database needs -** to be read from the SQLITE_MASTER and SQLITE_TEMP_MASTER tables. -** If it does, then read it. -*/ -void sqliteBeginParse(Parse *pParse, int explainFlag){ - sqlite *db = pParse->db; - int i; - pParse->explain = explainFlag; - if((db->flags & SQLITE_Initialized)==0 && db->init.busy==0 ){ - int rc = sqliteInit(db, &pParse->zErrMsg); - if( rc!=SQLITE_OK ){ - pParse->rc = rc; - pParse->nErr++; - } - } - for(i=0; inDb; i++){ - DbClearProperty(db, i, DB_Locked); - if( !db->aDb[i].inTrans ){ - DbClearProperty(db, i, DB_Cookie); - } - } - pParse->nVar = 0; -} - -/* -** This routine is called after a single SQL statement has been -** parsed and we want to execute the VDBE code to implement -** that statement. Prior action routines should have already -** constructed VDBE code to do the work of the SQL statement. -** This routine just has to execute the VDBE code. -** -** Note that if an error occurred, it might be the case that -** no VDBE code was generated. -*/ -void sqliteExec(Parse *pParse){ - sqlite *db = pParse->db; - Vdbe *v = pParse->pVdbe; - - if( v==0 && (v = sqliteGetVdbe(pParse))!=0 ){ - sqliteVdbeAddOp(v, OP_Halt, 0, 0); - } - if( sqlite_malloc_failed ) return; - if( v && pParse->nErr==0 ){ - FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; - sqliteVdbeTrace(v, trace); - sqliteVdbeMakeReady(v, pParse->nVar, pParse->explain); - pParse->rc = pParse->nErr ? SQLITE_ERROR : SQLITE_DONE; - pParse->colNamesSet = 0; - }else if( pParse->rc==SQLITE_OK ){ - pParse->rc = SQLITE_ERROR; - } - pParse->nTab = 0; - pParse->nMem = 0; - pParse->nSet = 0; - pParse->nAgg = 0; - pParse->nVar = 0; -} - -/* -** Locate the in-memory structure that describes -** a particular database table given the name -** of that table and (optionally) the name of the database -** containing the table. Return NULL if not found. -** -** If zDatabase is 0, all databases are searched for the -** table and the first matching table is returned. (No checking -** for duplicate table names is done.) The search order is -** TEMP first, then MAIN, then any auxiliary databases added -** using the ATTACH command. -** -** See also sqliteLocateTable(). -*/ -Table *sqliteFindTable(sqlite *db, const char *zName, const char *zDatabase){ - Table *p = 0; - int i; - for(i=0; inDb; i++){ - int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDatabase!=0 && sqliteStrICmp(zDatabase, db->aDb[j].zName) ) continue; - p = sqliteHashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1); - if( p ) break; - } - return p; -} - -/* -** Locate the in-memory structure that describes -** a particular database table given the name -** of that table and (optionally) the name of the database -** containing the table. Return NULL if not found. -** Also leave an error message in pParse->zErrMsg. -** -** The difference between this routine and sqliteFindTable() -** is that this routine leaves an error message in pParse->zErrMsg -** where sqliteFindTable() does not. -*/ -Table *sqliteLocateTable(Parse *pParse, const char *zName, const char *zDbase){ - Table *p; - - p = sqliteFindTable(pParse->db, zName, zDbase); - if( p==0 ){ - if( zDbase ){ - sqliteErrorMsg(pParse, "no such table: %s.%s", zDbase, zName); - }else if( sqliteFindTable(pParse->db, zName, 0)!=0 ){ - sqliteErrorMsg(pParse, "table \"%s\" is not in database \"%s\"", - zName, zDbase); - }else{ - sqliteErrorMsg(pParse, "no such table: %s", zName); - } - } - return p; -} - -/* -** Locate the in-memory structure that describes -** a particular index given the name of that index -** and the name of the database that contains the index. -** Return NULL if not found. -** -** If zDatabase is 0, all databases are searched for the -** table and the first matching index is returned. (No checking -** for duplicate index names is done.) The search order is -** TEMP first, then MAIN, then any auxiliary databases added -** using the ATTACH command. -*/ -Index *sqliteFindIndex(sqlite *db, const char *zName, const char *zDb){ - Index *p = 0; - int i; - for(i=0; inDb; i++){ - int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ - if( zDb && sqliteStrICmp(zDb, db->aDb[j].zName) ) continue; - p = sqliteHashFind(&db->aDb[j].idxHash, zName, strlen(zName)+1); - if( p ) break; - } - return p; -} - -/* -** Remove the given index from the index hash table, and free -** its memory structures. -** -** The index is removed from the database hash tables but -** it is not unlinked from the Table that it indexes. -** Unlinking from the Table must be done by the calling function. -*/ -static void sqliteDeleteIndex(sqlite *db, Index *p){ - Index *pOld; - - assert( db!=0 && p->zName!=0 ); - pOld = sqliteHashInsert(&db->aDb[p->iDb].idxHash, p->zName, - strlen(p->zName)+1, 0); - if( pOld!=0 && pOld!=p ){ - sqliteHashInsert(&db->aDb[p->iDb].idxHash, pOld->zName, - strlen(pOld->zName)+1, pOld); - } - sqliteFree(p); -} - -/* -** Unlink the given index from its table, then remove -** the index from the index hash table and free its memory -** structures. -*/ -void sqliteUnlinkAndDeleteIndex(sqlite *db, Index *pIndex){ - if( pIndex->pTable->pIndex==pIndex ){ - pIndex->pTable->pIndex = pIndex->pNext; - }else{ - Index *p; - for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){} - if( p && p->pNext==pIndex ){ - p->pNext = pIndex->pNext; - } - } - sqliteDeleteIndex(db, pIndex); -} - -/* -** Erase all schema information from the in-memory hash tables of -** database connection. This routine is called to reclaim memory -** before the connection closes. It is also called during a rollback -** if there were schema changes during the transaction. -** -** If iDb<=0 then reset the internal schema tables for all database -** files. If iDb>=2 then reset the internal schema for only the -** single file indicated. -*/ -void sqliteResetInternalSchema(sqlite *db, int iDb){ - HashElem *pElem; - Hash temp1; - Hash temp2; - int i, j; - - assert( iDb>=0 && iDbnDb ); - db->flags &= ~SQLITE_Initialized; - for(i=iDb; inDb; i++){ - Db *pDb = &db->aDb[i]; - temp1 = pDb->tblHash; - temp2 = pDb->trigHash; - sqliteHashInit(&pDb->trigHash, SQLITE_HASH_STRING, 0); - sqliteHashClear(&pDb->aFKey); - sqliteHashClear(&pDb->idxHash); - for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ - Trigger *pTrigger = sqliteHashData(pElem); - sqliteDeleteTrigger(pTrigger); - } - sqliteHashClear(&temp2); - sqliteHashInit(&pDb->tblHash, SQLITE_HASH_STRING, 0); - for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ - Table *pTab = sqliteHashData(pElem); - sqliteDeleteTable(db, pTab); - } - sqliteHashClear(&temp1); - DbClearProperty(db, i, DB_SchemaLoaded); - if( iDb>0 ) return; - } - assert( iDb==0 ); - db->flags &= ~SQLITE_InternChanges; - - /* If one or more of the auxiliary database files has been closed, - ** then remove then from the auxiliary database list. We take the - ** opportunity to do this here since we have just deleted all of the - ** schema hash tables and therefore do not have to make any changes - ** to any of those tables. - */ - for(i=0; inDb; i++){ - struct Db *pDb = &db->aDb[i]; - if( pDb->pBt==0 ){ - if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); - pDb->pAux = 0; - } - } - for(i=j=2; inDb; i++){ - struct Db *pDb = &db->aDb[i]; - if( pDb->pBt==0 ){ - sqliteFree(pDb->zName); - pDb->zName = 0; - continue; - } - if( jaDb[j] = db->aDb[i]; - } - j++; - } - memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j])); - db->nDb = j; - if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ - memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0])); - sqliteFree(db->aDb); - db->aDb = db->aDbStatic; - } -} - -/* -** This routine is called whenever a rollback occurs. If there were -** schema changes during the transaction, then we have to reset the -** internal hash tables and reload them from disk. -*/ -void sqliteRollbackInternalChanges(sqlite *db){ - if( db->flags & SQLITE_InternChanges ){ - sqliteResetInternalSchema(db, 0); - } -} - -/* -** This routine is called when a commit occurs. -*/ -void sqliteCommitInternalChanges(sqlite *db){ - db->aDb[0].schema_cookie = db->next_cookie; - db->flags &= ~SQLITE_InternChanges; -} - -/* -** Remove the memory data structures associated with the given -** Table. No changes are made to disk by this routine. -** -** This routine just deletes the data structure. It does not unlink -** the table data structure from the hash table. Nor does it remove -** foreign keys from the sqlite.aFKey hash table. But it does destroy -** memory structures of the indices and foreign keys associated with -** the table. -** -** Indices associated with the table are unlinked from the "db" -** data structure if db!=NULL. If db==NULL, indices attached to -** the table are deleted, but it is assumed they have already been -** unlinked. -*/ -void sqliteDeleteTable(sqlite *db, Table *pTable){ - int i; - Index *pIndex, *pNext; - FKey *pFKey, *pNextFKey; - - if( pTable==0 ) return; - - /* Delete all indices associated with this table - */ - for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ - pNext = pIndex->pNext; - assert( pIndex->iDb==pTable->iDb || (pTable->iDb==0 && pIndex->iDb==1) ); - sqliteDeleteIndex(db, pIndex); - } - - /* Delete all foreign keys associated with this table. The keys - ** should have already been unlinked from the db->aFKey hash table - */ - for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ - pNextFKey = pFKey->pNextFrom; - assert( pTable->iDbnDb ); - assert( sqliteHashFind(&db->aDb[pTable->iDb].aFKey, - pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey ); - sqliteFree(pFKey); - } - - /* Delete the Table structure itself. - */ - for(i=0; inCol; i++){ - sqliteFree(pTable->aCol[i].zName); - sqliteFree(pTable->aCol[i].zDflt); - sqliteFree(pTable->aCol[i].zType); - } - sqliteFree(pTable->zName); - sqliteFree(pTable->aCol); - sqliteSelectDelete(pTable->pSelect); - sqliteFree(pTable); -} - -/* -** Unlink the given table from the hash tables and the delete the -** table structure with all its indices and foreign keys. -*/ -static void sqliteUnlinkAndDeleteTable(sqlite *db, Table *p){ - Table *pOld; - FKey *pF1, *pF2; - int i = p->iDb; - assert( db!=0 ); - pOld = sqliteHashInsert(&db->aDb[i].tblHash, p->zName, strlen(p->zName)+1, 0); - assert( pOld==0 || pOld==p ); - for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ - int nTo = strlen(pF1->zTo) + 1; - pF2 = sqliteHashFind(&db->aDb[i].aFKey, pF1->zTo, nTo); - if( pF2==pF1 ){ - sqliteHashInsert(&db->aDb[i].aFKey, pF1->zTo, nTo, pF1->pNextTo); - }else{ - while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } - if( pF2 ){ - pF2->pNextTo = pF1->pNextTo; - } - } - } - sqliteDeleteTable(db, p); -} - -/* -** Construct the name of a user table or index from a token. -** -** Space to hold the name is obtained from sqliteMalloc() and must -** be freed by the calling function. -*/ -char *sqliteTableNameFromToken(Token *pName){ - char *zName = sqliteStrNDup(pName->z, pName->n); - sqliteDequote(zName); - return zName; -} - -/* -** Generate code to open the appropriate master table. The table -** opened will be SQLITE_MASTER for persistent tables and -** SQLITE_TEMP_MASTER for temporary tables. The table is opened -** on cursor 0. -*/ -void sqliteOpenMasterTable(Vdbe *v, int isTemp){ - sqliteVdbeAddOp(v, OP_Integer, isTemp, 0); - sqliteVdbeAddOp(v, OP_OpenWrite, 0, 2); -} - -/* -** Begin constructing a new table representation in memory. This is -** the first of several action routines that get called in response -** to a CREATE TABLE statement. In particular, this routine is called -** after seeing tokens "CREATE" and "TABLE" and the table name. The -** pStart token is the CREATE and pName is the table name. The isTemp -** flag is true if the table should be stored in the auxiliary database -** file instead of in the main database file. This is normally the case -** when the "TEMP" or "TEMPORARY" keyword occurs in between -** CREATE and TABLE. -** -** The new table record is initialized and put in pParse->pNewTable. -** As more of the CREATE TABLE statement is parsed, additional action -** routines will be called to add more information to this record. -** At the end of the CREATE TABLE statement, the sqliteEndTable() routine -** is called to complete the construction of the new table record. -*/ -void sqliteStartTable( - Parse *pParse, /* Parser context */ - Token *pStart, /* The "CREATE" token */ - Token *pName, /* Name of table or view to create */ - int isTemp, /* True if this is a TEMP table */ - int isView /* True if this is a VIEW */ -){ - Table *pTable; - Index *pIdx; - char *zName; - sqlite *db = pParse->db; - Vdbe *v; - int iDb; - - pParse->sFirstToken = *pStart; - zName = sqliteTableNameFromToken(pName); - if( zName==0 ) return; - if( db->init.iDb==1 ) isTemp = 1; -#ifndef SQLITE_OMIT_AUTHORIZATION - assert( (isTemp & 1)==isTemp ); - { - int code; - char *zDb = isTemp ? "temp" : "main"; - if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ - sqliteFree(zName); - return; - } - if( isView ){ - if( isTemp ){ - code = SQLITE_CREATE_TEMP_VIEW; - }else{ - code = SQLITE_CREATE_VIEW; - } - }else{ - if( isTemp ){ - code = SQLITE_CREATE_TEMP_TABLE; - }else{ - code = SQLITE_CREATE_TABLE; - } - } - if( sqliteAuthCheck(pParse, code, zName, 0, zDb) ){ - sqliteFree(zName); - return; - } - } -#endif - - - /* Before trying to create a temporary table, make sure the Btree for - ** holding temporary tables is open. - */ - if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){ - int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt); - if( rc!=SQLITE_OK ){ - sqliteErrorMsg(pParse, "unable to open a temporary database " - "file for storing temporary tables"); - pParse->nErr++; - return; - } - if( db->flags & SQLITE_InTrans ){ - rc = sqliteBtreeBeginTrans(db->aDb[1].pBt); - if( rc!=SQLITE_OK ){ - sqliteErrorMsg(pParse, "unable to get a write lock on " - "the temporary database file"); - return; - } - } - } - - /* Make sure the new table name does not collide with an existing - ** index or table name. Issue an error message if it does. - ** - ** If we are re-reading the sqlite_master table because of a schema - ** change and a new permanent table is found whose name collides with - ** an existing temporary table, that is not an error. - */ - pTable = sqliteFindTable(db, zName, 0); - iDb = isTemp ? 1 : db->init.iDb; - if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){ - sqliteErrorMsg(pParse, "table %T already exists", pName); - sqliteFree(zName); - return; - } - if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 && - (pIdx->iDb==0 || !db->init.busy) ){ - sqliteErrorMsg(pParse, "there is already an index named %s", zName); - sqliteFree(zName); - return; - } - pTable = sqliteMalloc( sizeof(Table) ); - if( pTable==0 ){ - sqliteFree(zName); - return; - } - pTable->zName = zName; - pTable->nCol = 0; - pTable->aCol = 0; - pTable->iPKey = -1; - pTable->pIndex = 0; - pTable->iDb = iDb; - if( pParse->pNewTable ) sqliteDeleteTable(db, pParse->pNewTable); - pParse->pNewTable = pTable; - - /* Begin generating the code that will insert the table record into - ** the SQLITE_MASTER table. Note in particular that we must go ahead - ** and allocate the record number for the table entry now. Before any - ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause - ** indices to be created and the table record must come before the - ** indices. Hence, the record number for the table must be allocated - ** now. - */ - if( !db->init.busy && (v = sqliteGetVdbe(pParse))!=0 ){ - sqliteBeginWriteOperation(pParse, 0, isTemp); - if( !isTemp ){ - sqliteVdbeAddOp(v, OP_Integer, db->file_format, 0); - sqliteVdbeAddOp(v, OP_SetCookie, 0, 1); - } - sqliteOpenMasterTable(v, isTemp); - sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); - } -} - -/* -** Add a new column to the table currently being constructed. -** -** The parser calls this routine once for each column declaration -** in a CREATE TABLE statement. sqliteStartTable() gets called -** first to get things going. Then this routine is called for each -** column. -*/ -void sqliteAddColumn(Parse *pParse, Token *pName){ - Table *p; - int i; - char *z = 0; - Column *pCol; - if( (p = pParse->pNewTable)==0 ) return; - sqliteSetNString(&z, pName->z, pName->n, 0); - if( z==0 ) return; - sqliteDequote(z); - for(i=0; inCol; i++){ - if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){ - sqliteErrorMsg(pParse, "duplicate column name: %s", z); - sqliteFree(z); - return; - } - } - if( (p->nCol & 0x7)==0 ){ - Column *aNew; - aNew = sqliteRealloc( p->aCol, (p->nCol+8)*sizeof(p->aCol[0])); - if( aNew==0 ) return; - p->aCol = aNew; - } - pCol = &p->aCol[p->nCol]; - memset(pCol, 0, sizeof(p->aCol[0])); - pCol->zName = z; - pCol->sortOrder = SQLITE_SO_NUM; - p->nCol++; -} - -/* -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. A "NOT NULL" constraint has -** been seen on a column. This routine sets the notNull flag on -** the column currently under construction. -*/ -void sqliteAddNotNull(Parse *pParse, int onError){ - Table *p; - int i; - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - if( i>=0 ) p->aCol[i].notNull = onError; -} - -/* -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. The pFirst token is the first -** token in the sequence of tokens that describe the type of the -** column currently under construction. pLast is the last token -** in the sequence. Use this information to construct a string -** that contains the typename of the column and store that string -** in zType. -*/ -void sqliteAddColumnType(Parse *pParse, Token *pFirst, Token *pLast){ - Table *p; - int i, j; - int n; - char *z, **pz; - Column *pCol; - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - if( i<0 ) return; - pCol = &p->aCol[i]; - pz = &pCol->zType; - n = pLast->n + Addr(pLast->z) - Addr(pFirst->z); - sqliteSetNString(pz, pFirst->z, n, 0); - z = *pz; - if( z==0 ) return; - for(i=j=0; z[i]; i++){ - int c = z[i]; - if( isspace(c) ) continue; - z[j++] = c; - } - z[j] = 0; - if( pParse->db->file_format>=4 ){ - pCol->sortOrder = sqliteCollateType(z, n); - }else{ - pCol->sortOrder = SQLITE_SO_NUM; - } -} - -/* -** The given token is the default value for the last column added to -** the table currently under construction. If "minusFlag" is true, it -** means the value token was preceded by a minus sign. -** -** This routine is called by the parser while in the middle of -** parsing a CREATE TABLE statement. -*/ -void sqliteAddDefaultValue(Parse *pParse, Token *pVal, int minusFlag){ - Table *p; - int i; - char **pz; - if( (p = pParse->pNewTable)==0 ) return; - i = p->nCol-1; - if( i<0 ) return; - pz = &p->aCol[i].zDflt; - if( minusFlag ){ - sqliteSetNString(pz, "-", 1, pVal->z, pVal->n, 0); - }else{ - sqliteSetNString(pz, pVal->z, pVal->n, 0); - } - sqliteDequote(*pz); -} - -/* -** Designate the PRIMARY KEY for the table. pList is a list of names -** of columns that form the primary key. If pList is NULL, then the -** most recently added column of the table is the primary key. -** -** A table can have at most one primary key. If the table already has -** a primary key (and this is the second primary key) then create an -** error. -** -** If the PRIMARY KEY is on a single column whose datatype is INTEGER, -** then we will try to use that column as the row id. (Exception: -** For backwards compatibility with older databases, do not do this -** if the file format version number is less than 1.) Set the Table.iPKey -** field of the table under construction to be the index of the -** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is -** no INTEGER PRIMARY KEY. -** -** If the key is not an INTEGER PRIMARY KEY, then create a unique -** index for the key. No index is created for INTEGER PRIMARY KEYs. -*/ -void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){ - Table *pTab = pParse->pNewTable; - char *zType = 0; - int iCol = -1, i; - if( pTab==0 ) goto primary_key_exit; - if( pTab->hasPrimKey ){ - sqliteErrorMsg(pParse, - "table \"%s\" has more than one primary key", pTab->zName); - goto primary_key_exit; - } - pTab->hasPrimKey = 1; - if( pList==0 ){ - iCol = pTab->nCol - 1; - pTab->aCol[iCol].isPrimKey = 1; - }else{ - for(i=0; inId; i++){ - for(iCol=0; iColnCol; iCol++){ - if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ) break; - } - if( iColnCol ) pTab->aCol[iCol].isPrimKey = 1; - } - if( pList->nId>1 ) iCol = -1; - } - if( iCol>=0 && iColnCol ){ - zType = pTab->aCol[iCol].zType; - } - if( pParse->db->file_format>=1 && - zType && sqliteStrICmp(zType, "INTEGER")==0 ){ - pTab->iPKey = iCol; - pTab->keyConf = onError; - }else{ - sqliteCreateIndex(pParse, 0, 0, pList, onError, 0, 0); - pList = 0; - } - -primary_key_exit: - sqliteIdListDelete(pList); - return; -} - -/* -** Return the appropriate collating type given a type name. -** -** The collation type is text (SQLITE_SO_TEXT) if the type -** name contains the character stream "text" or "blob" or -** "clob". Any other type name is collated as numeric -** (SQLITE_SO_NUM). -*/ -int sqliteCollateType(const char *zType, int nType){ - int i; - for(i=0; ipNewTable)==0 ) return; - i = p->nCol-1; - if( i>=0 ) p->aCol[i].sortOrder = collType; -} - -/* -** Come up with a new random value for the schema cookie. Make sure -** the new value is different from the old. -** -** The schema cookie is used to determine when the schema for the -** database changes. After each schema change, the cookie value -** changes. When a process first reads the schema it records the -** cookie. Thereafter, whenever it goes to access the database, -** it checks the cookie to make sure the schema has not changed -** since it was last read. -** -** This plan is not completely bullet-proof. It is possible for -** the schema to change multiple times and for the cookie to be -** set back to prior value. But schema changes are infrequent -** and the probability of hitting the same cookie value is only -** 1 chance in 2^32. So we're safe enough. -*/ -void sqliteChangeCookie(sqlite *db, Vdbe *v){ - if( db->next_cookie==db->aDb[0].schema_cookie ){ - unsigned char r; - sqliteRandomness(1, &r); - db->next_cookie = db->aDb[0].schema_cookie + r + 1; - db->flags |= SQLITE_InternChanges; - sqliteVdbeAddOp(v, OP_Integer, db->next_cookie, 0); - sqliteVdbeAddOp(v, OP_SetCookie, 0, 0); - } -} - -/* -** Measure the number of characters needed to output the given -** identifier. The number returned includes any quotes used -** but does not include the null terminator. -*/ -static int identLength(const char *z){ - int n; - int needQuote = 0; - for(n=0; *z; n++, z++){ - if( *z=='\'' ){ n++; needQuote=1; } - } - return n + needQuote*2; -} - -/* -** Write an identifier onto the end of the given string. Add -** quote characters as needed. -*/ -static void identPut(char *z, int *pIdx, char *zIdent){ - int i, j, needQuote; - i = *pIdx; - for(j=0; zIdent[j]; j++){ - if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; - } - needQuote = zIdent[j]!=0 || isdigit(zIdent[0]) - || sqliteKeywordCode(zIdent, j)!=TK_ID; - if( needQuote ) z[i++] = '\''; - for(j=0; zIdent[j]; j++){ - z[i++] = zIdent[j]; - if( zIdent[j]=='\'' ) z[i++] = '\''; - } - if( needQuote ) z[i++] = '\''; - z[i] = 0; - *pIdx = i; -} - -/* -** Generate a CREATE TABLE statement appropriate for the given -** table. Memory to hold the text of the statement is obtained -** from sqliteMalloc() and must be freed by the calling function. -*/ -static char *createTableStmt(Table *p){ - int i, k, n; - char *zStmt; - char *zSep, *zSep2, *zEnd; - n = 0; - for(i=0; inCol; i++){ - n += identLength(p->aCol[i].zName); - } - n += identLength(p->zName); - if( n<40 ){ - zSep = ""; - zSep2 = ","; - zEnd = ")"; - }else{ - zSep = "\n "; - zSep2 = ",\n "; - zEnd = "\n)"; - } - n += 35 + 6*p->nCol; - zStmt = sqliteMallocRaw( n ); - if( zStmt==0 ) return 0; - strcpy(zStmt, p->iDb==1 ? "CREATE TEMP TABLE " : "CREATE TABLE "); - k = strlen(zStmt); - identPut(zStmt, &k, p->zName); - zStmt[k++] = '('; - for(i=0; inCol; i++){ - strcpy(&zStmt[k], zSep); - k += strlen(&zStmt[k]); - zSep = zSep2; - identPut(zStmt, &k, p->aCol[i].zName); - } - strcpy(&zStmt[k], zEnd); - return zStmt; -} - -/* -** This routine is called to report the final ")" that terminates -** a CREATE TABLE statement. -** -** The table structure that other action routines have been building -** is added to the internal hash tables, assuming no errors have -** occurred. -** -** An entry for the table is made in the master table on disk, unless -** this is a temporary table or db->init.busy==1. When db->init.busy==1 -** it means we are reading the sqlite_master table because we just -** connected to the database or because the sqlite_master table has -** recently changes, so the entry for this table already exists in -** the sqlite_master table. We do not want to create it again. -** -** If the pSelect argument is not NULL, it means that this routine -** was called to create a table generated from a -** "CREATE TABLE ... AS SELECT ..." statement. The column names of -** the new table will match the result set of the SELECT. -*/ -void sqliteEndTable(Parse *pParse, Token *pEnd, Select *pSelect){ - Table *p; - sqlite *db = pParse->db; - - if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; - p = pParse->pNewTable; - if( p==0 ) return; - - /* If the table is generated from a SELECT, then construct the - ** list of columns and the text of the table. - */ - if( pSelect ){ - Table *pSelTab = sqliteResultSetOfSelect(pParse, 0, pSelect); - if( pSelTab==0 ) return; - assert( p->aCol==0 ); - p->nCol = pSelTab->nCol; - p->aCol = pSelTab->aCol; - pSelTab->nCol = 0; - pSelTab->aCol = 0; - sqliteDeleteTable(0, pSelTab); - } - - /* If the db->init.busy is 1 it means we are reading the SQL off the - ** "sqlite_master" or "sqlite_temp_master" table on the disk. - ** So do not write to the disk again. Extract the root page number - ** for the table from the db->init.newTnum field. (The page number - ** should have been put there by the sqliteOpenCb routine.) - */ - if( db->init.busy ){ - p->tnum = db->init.newTnum; - } - - /* If not initializing, then create a record for the new table - ** in the SQLITE_MASTER table of the database. The record number - ** for the new table entry should already be on the stack. - ** - ** If this is a TEMPORARY table, write the entry into the auxiliary - ** file instead of into the main database file. - */ - if( !db->init.busy ){ - int n; - Vdbe *v; - - v = sqliteGetVdbe(pParse); - if( v==0 ) return; - if( p->pSelect==0 ){ - /* A regular table */ - sqliteVdbeOp3(v, OP_CreateTable, 0, p->iDb, (char*)&p->tnum, P3_POINTER); - }else{ - /* A view */ - sqliteVdbeAddOp(v, OP_Integer, 0, 0); - } - p->tnum = 0; - sqliteVdbeAddOp(v, OP_Pull, 1, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, p->pSelect==0?"table":"view", P3_STATIC); - sqliteVdbeOp3(v, OP_String, 0, 0, p->zName, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, p->zName, 0); - sqliteVdbeAddOp(v, OP_Dup, 4, 0); - sqliteVdbeAddOp(v, OP_String, 0, 0); - if( pSelect ){ - char *z = createTableStmt(p); - n = z ? strlen(z) : 0; - sqliteVdbeChangeP3(v, -1, z, n); - sqliteFree(z); - }else{ - assert( pEnd!=0 ); - n = Addr(pEnd->z) - Addr(pParse->sFirstToken.z) + 1; - sqliteVdbeChangeP3(v, -1, pParse->sFirstToken.z, n); - } - sqliteVdbeAddOp(v, OP_MakeRecord, 5, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); - if( !p->iDb ){ - sqliteChangeCookie(db, v); - } - sqliteVdbeAddOp(v, OP_Close, 0, 0); - if( pSelect ){ - sqliteVdbeAddOp(v, OP_Integer, p->iDb, 0); - sqliteVdbeAddOp(v, OP_OpenWrite, 1, 0); - pParse->nTab = 2; - sqliteSelect(pParse, pSelect, SRT_Table, 1, 0, 0, 0); - } - sqliteEndWriteOperation(pParse); - } - - /* Add the table to the in-memory representation of the database. - */ - if( pParse->explain==0 && pParse->nErr==0 ){ - Table *pOld; - FKey *pFKey; - pOld = sqliteHashInsert(&db->aDb[p->iDb].tblHash, - p->zName, strlen(p->zName)+1, p); - if( pOld ){ - assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ - return; - } - for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ - int nTo = strlen(pFKey->zTo) + 1; - pFKey->pNextTo = sqliteHashFind(&db->aDb[p->iDb].aFKey, pFKey->zTo, nTo); - sqliteHashInsert(&db->aDb[p->iDb].aFKey, pFKey->zTo, nTo, pFKey); - } - pParse->pNewTable = 0; - db->nTable++; - db->flags |= SQLITE_InternChanges; - } -} - -/* -** The parser calls this routine in order to create a new VIEW -*/ -void sqliteCreateView( - Parse *pParse, /* The parsing context */ - Token *pBegin, /* The CREATE token that begins the statement */ - Token *pName, /* The token that holds the name of the view */ - Select *pSelect, /* A SELECT statement that will become the new view */ - int isTemp /* TRUE for a TEMPORARY view */ -){ - Table *p; - int n; - const char *z; - Token sEnd; - DbFixer sFix; - - sqliteStartTable(pParse, pBegin, pName, isTemp, 1); - p = pParse->pNewTable; - if( p==0 || pParse->nErr ){ - sqliteSelectDelete(pSelect); - return; - } - if( sqliteFixInit(&sFix, pParse, p->iDb, "view", pName) - && sqliteFixSelect(&sFix, pSelect) - ){ - sqliteSelectDelete(pSelect); - return; - } - - /* Make a copy of the entire SELECT statement that defines the view. - ** This will force all the Expr.token.z values to be dynamically - ** allocated rather than point to the input string - which means that - ** they will persist after the current sqlite_exec() call returns. - */ - p->pSelect = sqliteSelectDup(pSelect); - sqliteSelectDelete(pSelect); - if( !pParse->db->init.busy ){ - sqliteViewGetColumnNames(pParse, p); - } - - /* Locate the end of the CREATE VIEW statement. Make sEnd point to - ** the end. - */ - sEnd = pParse->sLastToken; - if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ - sEnd.z += sEnd.n; - } - sEnd.n = 0; - n = sEnd.z - pBegin->z; - z = pBegin->z; - while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } - sEnd.z = &z[n-1]; - sEnd.n = 1; - - /* Use sqliteEndTable() to add the view to the SQLITE_MASTER table */ - sqliteEndTable(pParse, &sEnd, 0); - return; -} - -/* -** The Table structure pTable is really a VIEW. Fill in the names of -** the columns of the view in the pTable structure. Return the number -** of errors. If an error is seen leave an error message in pParse->zErrMsg. -*/ -int sqliteViewGetColumnNames(Parse *pParse, Table *pTable){ - ExprList *pEList; - Select *pSel; - Table *pSelTab; - int nErr = 0; - - assert( pTable ); - - /* A positive nCol means the columns names for this view are - ** already known. - */ - if( pTable->nCol>0 ) return 0; - - /* A negative nCol is a special marker meaning that we are currently - ** trying to compute the column names. If we enter this routine with - ** a negative nCol, it means two or more views form a loop, like this: - ** - ** CREATE VIEW one AS SELECT * FROM two; - ** CREATE VIEW two AS SELECT * FROM one; - ** - ** Actually, this error is caught previously and so the following test - ** should always fail. But we will leave it in place just to be safe. - */ - if( pTable->nCol<0 ){ - sqliteErrorMsg(pParse, "view %s is circularly defined", pTable->zName); - return 1; - } - - /* If we get this far, it means we need to compute the table names. - */ - assert( pTable->pSelect ); /* If nCol==0, then pTable must be a VIEW */ - pSel = pTable->pSelect; - - /* Note that the call to sqliteResultSetOfSelect() will expand any - ** "*" elements in this list. But we will need to restore the list - ** back to its original configuration afterwards, so we save a copy of - ** the original in pEList. - */ - pEList = pSel->pEList; - pSel->pEList = sqliteExprListDup(pEList); - if( pSel->pEList==0 ){ - pSel->pEList = pEList; - return 1; /* Malloc failed */ - } - pTable->nCol = -1; - pSelTab = sqliteResultSetOfSelect(pParse, 0, pSel); - if( pSelTab ){ - assert( pTable->aCol==0 ); - pTable->nCol = pSelTab->nCol; - pTable->aCol = pSelTab->aCol; - pSelTab->nCol = 0; - pSelTab->aCol = 0; - sqliteDeleteTable(0, pSelTab); - DbSetProperty(pParse->db, pTable->iDb, DB_UnresetViews); - }else{ - pTable->nCol = 0; - nErr++; - } - sqliteSelectUnbind(pSel); - sqliteExprListDelete(pSel->pEList); - pSel->pEList = pEList; - return nErr; -} - -/* -** Clear the column names from the VIEW pTable. -** -** This routine is called whenever any other table or view is modified. -** The view passed into this routine might depend directly or indirectly -** on the modified or deleted table so we need to clear the old column -** names so that they will be recomputed. -*/ -static void sqliteViewResetColumnNames(Table *pTable){ - int i; - Column *pCol; - assert( pTable!=0 && pTable->pSelect!=0 ); - for(i=0, pCol=pTable->aCol; inCol; i++, pCol++){ - sqliteFree(pCol->zName); - sqliteFree(pCol->zDflt); - sqliteFree(pCol->zType); - } - sqliteFree(pTable->aCol); - pTable->aCol = 0; - pTable->nCol = 0; -} - -/* -** Clear the column names from every VIEW in database idx. -*/ -static void sqliteViewResetAll(sqlite *db, int idx){ - HashElem *i; - if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; - for(i=sqliteHashFirst(&db->aDb[idx].tblHash); i; i=sqliteHashNext(i)){ - Table *pTab = sqliteHashData(i); - if( pTab->pSelect ){ - sqliteViewResetColumnNames(pTab); - } - } - DbClearProperty(db, idx, DB_UnresetViews); -} - -/* -** Given a token, look up a table with that name. If not found, leave -** an error for the parser to find and return NULL. -*/ -Table *sqliteTableFromToken(Parse *pParse, Token *pTok){ - char *zName; - Table *pTab; - zName = sqliteTableNameFromToken(pTok); - if( zName==0 ) return 0; - pTab = sqliteFindTable(pParse->db, zName, 0); - sqliteFree(zName); - if( pTab==0 ){ - sqliteErrorMsg(pParse, "no such table: %T", pTok); - } - return pTab; -} - -/* -** This routine is called to do the work of a DROP TABLE statement. -** pName is the name of the table to be dropped. -*/ -void sqliteDropTable(Parse *pParse, Token *pName, int isView){ - Table *pTable; - Vdbe *v; - int base; - sqlite *db = pParse->db; - int iDb; - - if( pParse->nErr || sqlite_malloc_failed ) return; - pTable = sqliteTableFromToken(pParse, pName); - if( pTable==0 ) return; - iDb = pTable->iDb; - assert( iDb>=0 && iDbnDb ); -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code; - const char *zTab = SCHEMA_TABLE(pTable->iDb); - const char *zDb = db->aDb[pTable->iDb].zName; - if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ - return; - } - if( isView ){ - if( iDb==1 ){ - code = SQLITE_DROP_TEMP_VIEW; - }else{ - code = SQLITE_DROP_VIEW; - } - }else{ - if( iDb==1 ){ - code = SQLITE_DROP_TEMP_TABLE; - }else{ - code = SQLITE_DROP_TABLE; - } - } - if( sqliteAuthCheck(pParse, code, pTable->zName, 0, zDb) ){ - return; - } - if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTable->zName, 0, zDb) ){ - return; - } - } -#endif - if( pTable->readOnly ){ - sqliteErrorMsg(pParse, "table %s may not be dropped", pTable->zName); - pParse->nErr++; - return; - } - if( isView && pTable->pSelect==0 ){ - sqliteErrorMsg(pParse, "use DROP TABLE to delete table %s", pTable->zName); - return; - } - if( !isView && pTable->pSelect ){ - sqliteErrorMsg(pParse, "use DROP VIEW to delete view %s", pTable->zName); - return; - } - - /* Generate code to remove the table from the master table - ** on disk. - */ - v = sqliteGetVdbe(pParse); - if( v ){ - static VdbeOpList dropTable[] = { - { OP_Rewind, 0, ADDR(8), 0}, - { OP_String, 0, 0, 0}, /* 1 */ - { OP_MemStore, 1, 1, 0}, - { OP_MemLoad, 1, 0, 0}, /* 3 */ - { OP_Column, 0, 2, 0}, - { OP_Ne, 0, ADDR(7), 0}, - { OP_Delete, 0, 0, 0}, - { OP_Next, 0, ADDR(3), 0}, /* 7 */ - }; - Index *pIdx; - Trigger *pTrigger; - sqliteBeginWriteOperation(pParse, 0, pTable->iDb); - - /* Drop all triggers associated with the table being dropped */ - pTrigger = pTable->pTrigger; - while( pTrigger ){ - assert( pTrigger->iDb==pTable->iDb || pTrigger->iDb==1 ); - sqliteDropTriggerPtr(pParse, pTrigger, 1); - if( pParse->explain ){ - pTrigger = pTrigger->pNext; - }else{ - pTrigger = pTable->pTrigger; - } - } - - /* Drop all SQLITE_MASTER entries that refer to the table */ - sqliteOpenMasterTable(v, pTable->iDb); - base = sqliteVdbeAddOpList(v, ArraySize(dropTable), dropTable); - sqliteVdbeChangeP3(v, base+1, pTable->zName, 0); - - /* Drop all SQLITE_TEMP_MASTER entries that refer to the table */ - if( pTable->iDb!=1 ){ - sqliteOpenMasterTable(v, 1); - base = sqliteVdbeAddOpList(v, ArraySize(dropTable), dropTable); - sqliteVdbeChangeP3(v, base+1, pTable->zName, 0); - } - - if( pTable->iDb==0 ){ - sqliteChangeCookie(db, v); - } - sqliteVdbeAddOp(v, OP_Close, 0, 0); - if( !isView ){ - sqliteVdbeAddOp(v, OP_Destroy, pTable->tnum, pTable->iDb); - for(pIdx=pTable->pIndex; pIdx; pIdx=pIdx->pNext){ - sqliteVdbeAddOp(v, OP_Destroy, pIdx->tnum, pIdx->iDb); - } - } - sqliteEndWriteOperation(pParse); - } - - /* Delete the in-memory description of the table. - ** - ** Exception: if the SQL statement began with the EXPLAIN keyword, - ** then no changes should be made. - */ - if( !pParse->explain ){ - sqliteUnlinkAndDeleteTable(db, pTable); - db->flags |= SQLITE_InternChanges; - } - sqliteViewResetAll(db, iDb); -} - -/* -** This routine constructs a P3 string suitable for an OP_MakeIdxKey -** opcode and adds that P3 string to the most recently inserted instruction -** in the virtual machine. The P3 string consists of a single character -** for each column in the index pIdx of table pTab. If the column uses -** a numeric sort order, then the P3 string character corresponding to -** that column is 'n'. If the column uses a text sort order, then the -** P3 string is 't'. See the OP_MakeIdxKey opcode documentation for -** additional information. See also the sqliteAddKeyType() routine. -*/ -void sqliteAddIdxKeyType(Vdbe *v, Index *pIdx){ - char *zType; - Table *pTab; - int i, n; - assert( pIdx!=0 && pIdx->pTable!=0 ); - pTab = pIdx->pTable; - n = pIdx->nColumn; - zType = sqliteMallocRaw( n+1 ); - if( zType==0 ) return; - for(i=0; iaiColumn[i]; - assert( iCol>=0 && iColnCol ); - if( (pTab->aCol[iCol].sortOrder & SQLITE_SO_TYPEMASK)==SQLITE_SO_TEXT ){ - zType[i] = 't'; - }else{ - zType[i] = 'n'; - } - } - zType[n] = 0; - sqliteVdbeChangeP3(v, -1, zType, n); - sqliteFree(zType); -} - -/* -** This routine is called to create a new foreign key on the table -** currently under construction. pFromCol determines which columns -** in the current table point to the foreign key. If pFromCol==0 then -** connect the key to the last column inserted. pTo is the name of -** the table referred to. pToCol is a list of tables in the other -** pTo table that the foreign key points to. flags contains all -** information about the conflict resolution algorithms specified -** in the ON DELETE, ON UPDATE and ON INSERT clauses. -** -** An FKey structure is created and added to the table currently -** under construction in the pParse->pNewTable field. The new FKey -** is not linked into db->aFKey at this point - that does not happen -** until sqliteEndTable(). -** -** The foreign key is set for IMMEDIATE processing. A subsequent call -** to sqliteDeferForeignKey() might change this to DEFERRED. -*/ -void sqliteCreateForeignKey( - Parse *pParse, /* Parsing context */ - IdList *pFromCol, /* Columns in this table that point to other table */ - Token *pTo, /* Name of the other table */ - IdList *pToCol, /* Columns in the other table */ - int flags /* Conflict resolution algorithms. */ -){ - Table *p = pParse->pNewTable; - int nByte; - int i; - int nCol; - char *z; - FKey *pFKey = 0; - - assert( pTo!=0 ); - if( p==0 || pParse->nErr ) goto fk_end; - if( pFromCol==0 ){ - int iCol = p->nCol-1; - if( iCol<0 ) goto fk_end; - if( pToCol && pToCol->nId!=1 ){ - sqliteErrorMsg(pParse, "foreign key on %s" - " should reference only one column of table %T", - p->aCol[iCol].zName, pTo); - goto fk_end; - } - nCol = 1; - }else if( pToCol && pToCol->nId!=pFromCol->nId ){ - sqliteErrorMsg(pParse, - "number of columns in foreign key does not match the number of " - "columns in the referenced table"); - goto fk_end; - }else{ - nCol = pFromCol->nId; - } - nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1; - if( pToCol ){ - for(i=0; inId; i++){ - nByte += strlen(pToCol->a[i].zName) + 1; - } - } - pFKey = sqliteMalloc( nByte ); - if( pFKey==0 ) goto fk_end; - pFKey->pFrom = p; - pFKey->pNextFrom = p->pFKey; - z = (char*)&pFKey[1]; - pFKey->aCol = (struct sColMap*)z; - z += sizeof(struct sColMap)*nCol; - pFKey->zTo = z; - memcpy(z, pTo->z, pTo->n); - z[pTo->n] = 0; - z += pTo->n+1; - pFKey->pNextTo = 0; - pFKey->nCol = nCol; - if( pFromCol==0 ){ - pFKey->aCol[0].iFrom = p->nCol-1; - }else{ - for(i=0; inCol; j++){ - if( sqliteStrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ - pFKey->aCol[i].iFrom = j; - break; - } - } - if( j>=p->nCol ){ - sqliteErrorMsg(pParse, - "unknown column \"%s\" in foreign key definition", - pFromCol->a[i].zName); - goto fk_end; - } - } - } - if( pToCol ){ - for(i=0; ia[i].zName); - pFKey->aCol[i].zCol = z; - memcpy(z, pToCol->a[i].zName, n); - z[n] = 0; - z += n+1; - } - } - pFKey->isDeferred = 0; - pFKey->deleteConf = flags & 0xff; - pFKey->updateConf = (flags >> 8 ) & 0xff; - pFKey->insertConf = (flags >> 16 ) & 0xff; - - /* Link the foreign key to the table as the last step. - */ - p->pFKey = pFKey; - pFKey = 0; - -fk_end: - sqliteFree(pFKey); - sqliteIdListDelete(pFromCol); - sqliteIdListDelete(pToCol); -} - -/* -** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED -** clause is seen as part of a foreign key definition. The isDeferred -** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. -** The behavior of the most recently created foreign key is adjusted -** accordingly. -*/ -void sqliteDeferForeignKey(Parse *pParse, int isDeferred){ - Table *pTab; - FKey *pFKey; - if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; - pFKey->isDeferred = isDeferred; -} - -/* -** Create a new index for an SQL table. pIndex is the name of the index -** and pTable is the name of the table that is to be indexed. Both will -** be NULL for a primary key or an index that is created to satisfy a -** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable -** as the table to be indexed. pParse->pNewTable is a table that is -** currently being constructed by a CREATE TABLE statement. -** -** pList is a list of columns to be indexed. pList will be NULL if this -** is a primary key or unique-constraint on the most recent column added -** to the table currently under construction. -*/ -void sqliteCreateIndex( - Parse *pParse, /* All information about this parse */ - Token *pName, /* Name of the index. May be NULL */ - SrcList *pTable, /* Name of the table to index. Use pParse->pNewTable if 0 */ - IdList *pList, /* A list of columns to be indexed */ - int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */ - Token *pEnd /* The ")" that closes the CREATE INDEX statement */ -){ - Table *pTab; /* Table to be indexed */ - Index *pIndex; /* The index to be created */ - char *zName = 0; - int i, j; - Token nullId; /* Fake token for an empty ID list */ - DbFixer sFix; /* For assigning database names to pTable */ - int isTemp; /* True for a temporary index */ - sqlite *db = pParse->db; - - if( pParse->nErr || sqlite_malloc_failed ) goto exit_create_index; - if( db->init.busy - && sqliteFixInit(&sFix, pParse, db->init.iDb, "index", pName) - && sqliteFixSrcList(&sFix, pTable) - ){ - goto exit_create_index; - } - - /* - ** Find the table that is to be indexed. Return early if not found. - */ - if( pTable!=0 ){ - assert( pName!=0 ); - assert( pTable->nSrc==1 ); - pTab = sqliteSrcListLookup(pParse, pTable); - }else{ - assert( pName==0 ); - pTab = pParse->pNewTable; - } - if( pTab==0 || pParse->nErr ) goto exit_create_index; - if( pTab->readOnly ){ - sqliteErrorMsg(pParse, "table %s may not be indexed", pTab->zName); - goto exit_create_index; - } - if( pTab->iDb>=2 && db->init.busy==0 ){ - sqliteErrorMsg(pParse, "table %s may not have indices added", pTab->zName); - goto exit_create_index; - } - if( pTab->pSelect ){ - sqliteErrorMsg(pParse, "views may not be indexed"); - goto exit_create_index; - } - isTemp = pTab->iDb==1; - - /* - ** Find the name of the index. Make sure there is not already another - ** index or table with the same name. - ** - ** Exception: If we are reading the names of permanent indices from the - ** sqlite_master table (because some other process changed the schema) and - ** one of the index names collides with the name of a temporary table or - ** index, then we will continue to process this index. - ** - ** If pName==0 it means that we are - ** dealing with a primary key or UNIQUE constraint. We have to invent our - ** own name. - */ - if( pName && !db->init.busy ){ - Index *pISameName; /* Another index with the same name */ - Table *pTSameName; /* A table with same name as the index */ - zName = sqliteTableNameFromToken(pName); - if( zName==0 ) goto exit_create_index; - if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){ - sqliteErrorMsg(pParse, "index %s already exists", zName); - goto exit_create_index; - } - if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){ - sqliteErrorMsg(pParse, "there is already a table named %s", zName); - goto exit_create_index; - } - }else if( pName==0 ){ - char zBuf[30]; - int n; - Index *pLoop; - for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} - sprintf(zBuf,"%d)",n); - zName = 0; - sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0); - if( zName==0 ) goto exit_create_index; - }else{ - zName = sqliteTableNameFromToken(pName); - } - - /* Check for authorization to create an index. - */ -#ifndef SQLITE_OMIT_AUTHORIZATION - { - const char *zDb = db->aDb[pTab->iDb].zName; - - assert( pTab->iDb==db->init.iDb || isTemp ); - if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ - goto exit_create_index; - } - i = SQLITE_CREATE_INDEX; - if( isTemp ) i = SQLITE_CREATE_TEMP_INDEX; - if( sqliteAuthCheck(pParse, i, zName, pTab->zName, zDb) ){ - goto exit_create_index; - } - } -#endif - - /* If pList==0, it means this routine was called to make a primary - ** key out of the last column added to the table under construction. - ** So create a fake list to simulate this. - */ - if( pList==0 ){ - nullId.z = pTab->aCol[pTab->nCol-1].zName; - nullId.n = strlen(nullId.z); - pList = sqliteIdListAppend(0, &nullId); - if( pList==0 ) goto exit_create_index; - } - - /* - ** Allocate the index structure. - */ - pIndex = sqliteMalloc( sizeof(Index) + strlen(zName) + 1 + - sizeof(int)*pList->nId ); - if( pIndex==0 ) goto exit_create_index; - pIndex->aiColumn = (int*)&pIndex[1]; - pIndex->zName = (char*)&pIndex->aiColumn[pList->nId]; - strcpy(pIndex->zName, zName); - pIndex->pTable = pTab; - pIndex->nColumn = pList->nId; - pIndex->onError = onError; - pIndex->autoIndex = pName==0; - pIndex->iDb = isTemp ? 1 : db->init.iDb; - - /* Scan the names of the columns of the table to be indexed and - ** load the column indices into the Index structure. Report an error - ** if any column is not found. - */ - for(i=0; inId; i++){ - for(j=0; jnCol; j++){ - if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break; - } - if( j>=pTab->nCol ){ - sqliteErrorMsg(pParse, "table %s has no column named %s", - pTab->zName, pList->a[i].zName); - sqliteFree(pIndex); - goto exit_create_index; - } - pIndex->aiColumn[i] = j; - } - - /* Link the new Index structure to its table and to the other - ** in-memory database structures. - */ - if( !pParse->explain ){ - Index *p; - p = sqliteHashInsert(&db->aDb[pIndex->iDb].idxHash, - pIndex->zName, strlen(pIndex->zName)+1, pIndex); - if( p ){ - assert( p==pIndex ); /* Malloc must have failed */ - sqliteFree(pIndex); - goto exit_create_index; - } - db->flags |= SQLITE_InternChanges; - } - - /* When adding an index to the list of indices for a table, make - ** sure all indices labeled OE_Replace come after all those labeled - ** OE_Ignore. This is necessary for the correct operation of UPDATE - ** and INSERT. - */ - if( onError!=OE_Replace || pTab->pIndex==0 - || pTab->pIndex->onError==OE_Replace){ - pIndex->pNext = pTab->pIndex; - pTab->pIndex = pIndex; - }else{ - Index *pOther = pTab->pIndex; - while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ - pOther = pOther->pNext; - } - pIndex->pNext = pOther->pNext; - pOther->pNext = pIndex; - } - - /* If the db->init.busy is 1 it means we are reading the SQL off the - ** "sqlite_master" table on the disk. So do not write to the disk - ** again. Extract the table number from the db->init.newTnum field. - */ - if( db->init.busy && pTable!=0 ){ - pIndex->tnum = db->init.newTnum; - } - - /* If the db->init.busy is 0 then create the index on disk. This - ** involves writing the index into the master table and filling in the - ** index with the current table contents. - ** - ** The db->init.busy is 0 when the user first enters a CREATE INDEX - ** command. db->init.busy is 1 when a database is opened and - ** CREATE INDEX statements are read out of the master table. In - ** the latter case the index already exists on disk, which is why - ** we don't want to recreate it. - ** - ** If pTable==0 it means this index is generated as a primary key - ** or UNIQUE constraint of a CREATE TABLE statement. Since the table - ** has just been created, it contains no data and the index initialization - ** step can be skipped. - */ - else if( db->init.busy==0 ){ - int n; - Vdbe *v; - int lbl1, lbl2; - int i; - int addr; - - v = sqliteGetVdbe(pParse); - if( v==0 ) goto exit_create_index; - if( pTable!=0 ){ - sqliteBeginWriteOperation(pParse, 0, isTemp); - sqliteOpenMasterTable(v, isTemp); - } - sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, "index", P3_STATIC); - sqliteVdbeOp3(v, OP_String, 0, 0, pIndex->zName, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->zName, 0); - sqliteVdbeOp3(v, OP_CreateIndex, 0, isTemp,(char*)&pIndex->tnum,P3_POINTER); - pIndex->tnum = 0; - if( pTable ){ - sqliteVdbeCode(v, - OP_Dup, 0, 0, - OP_Integer, isTemp, 0, - OP_OpenWrite, 1, 0, - 0); - } - addr = sqliteVdbeAddOp(v, OP_String, 0, 0); - if( pStart && pEnd ){ - n = Addr(pEnd->z) - Addr(pStart->z) + 1; - sqliteVdbeChangeP3(v, addr, pStart->z, n); - } - sqliteVdbeAddOp(v, OP_MakeRecord, 5, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); - if( pTable ){ - sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqliteVdbeOp3(v, OP_OpenRead, 2, pTab->tnum, pTab->zName, 0); - lbl2 = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_Rewind, 2, lbl2); - lbl1 = sqliteVdbeAddOp(v, OP_Recno, 2, 0); - for(i=0; inColumn; i++){ - int iCol = pIndex->aiColumn[i]; - if( pTab->iPKey==iCol ){ - sqliteVdbeAddOp(v, OP_Dup, i, 0); - }else{ - sqliteVdbeAddOp(v, OP_Column, 2, iCol); - } - } - sqliteVdbeAddOp(v, OP_MakeIdxKey, pIndex->nColumn, 0); - if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIndex); - sqliteVdbeOp3(v, OP_IdxPut, 1, pIndex->onError!=OE_None, - "indexed columns are not unique", P3_STATIC); - sqliteVdbeAddOp(v, OP_Next, 2, lbl1); - sqliteVdbeResolveLabel(v, lbl2); - sqliteVdbeAddOp(v, OP_Close, 2, 0); - sqliteVdbeAddOp(v, OP_Close, 1, 0); - } - if( pTable!=0 ){ - if( !isTemp ){ - sqliteChangeCookie(db, v); - } - sqliteVdbeAddOp(v, OP_Close, 0, 0); - sqliteEndWriteOperation(pParse); - } - } - - /* Clean up before exiting */ -exit_create_index: - sqliteIdListDelete(pList); - sqliteSrcListDelete(pTable); - sqliteFree(zName); - return; -} - -/* -** This routine will drop an existing named index. This routine -** implements the DROP INDEX statement. -*/ -void sqliteDropIndex(Parse *pParse, SrcList *pName){ - Index *pIndex; - Vdbe *v; - sqlite *db = pParse->db; - - if( pParse->nErr || sqlite_malloc_failed ) return; - assert( pName->nSrc==1 ); - pIndex = sqliteFindIndex(db, pName->a[0].zName, pName->a[0].zDatabase); - if( pIndex==0 ){ - sqliteErrorMsg(pParse, "no such index: %S", pName, 0); - goto exit_drop_index; - } - if( pIndex->autoIndex ){ - sqliteErrorMsg(pParse, "index associated with UNIQUE " - "or PRIMARY KEY constraint cannot be dropped", 0); - goto exit_drop_index; - } - if( pIndex->iDb>1 ){ - sqliteErrorMsg(pParse, "cannot alter schema of attached " - "databases", 0); - goto exit_drop_index; - } -#ifndef SQLITE_OMIT_AUTHORIZATION - { - int code = SQLITE_DROP_INDEX; - Table *pTab = pIndex->pTable; - const char *zDb = db->aDb[pIndex->iDb].zName; - const char *zTab = SCHEMA_TABLE(pIndex->iDb); - if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ - goto exit_drop_index; - } - if( pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX; - if( sqliteAuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ - goto exit_drop_index; - } - } -#endif - - /* Generate code to remove the index and from the master table */ - v = sqliteGetVdbe(pParse); - if( v ){ - static VdbeOpList dropIndex[] = { - { OP_Rewind, 0, ADDR(9), 0}, - { OP_String, 0, 0, 0}, /* 1 */ - { OP_MemStore, 1, 1, 0}, - { OP_MemLoad, 1, 0, 0}, /* 3 */ - { OP_Column, 0, 1, 0}, - { OP_Eq, 0, ADDR(8), 0}, - { OP_Next, 0, ADDR(3), 0}, - { OP_Goto, 0, ADDR(9), 0}, - { OP_Delete, 0, 0, 0}, /* 8 */ - }; - int base; - - sqliteBeginWriteOperation(pParse, 0, pIndex->iDb); - sqliteOpenMasterTable(v, pIndex->iDb); - base = sqliteVdbeAddOpList(v, ArraySize(dropIndex), dropIndex); - sqliteVdbeChangeP3(v, base+1, pIndex->zName, 0); - if( pIndex->iDb==0 ){ - sqliteChangeCookie(db, v); - } - sqliteVdbeAddOp(v, OP_Close, 0, 0); - sqliteVdbeAddOp(v, OP_Destroy, pIndex->tnum, pIndex->iDb); - sqliteEndWriteOperation(pParse); - } - - /* Delete the in-memory description of this index. - */ - if( !pParse->explain ){ - sqliteUnlinkAndDeleteIndex(db, pIndex); - db->flags |= SQLITE_InternChanges; - } - -exit_drop_index: - sqliteSrcListDelete(pName); -} - -/* -** Append a new element to the given IdList. Create a new IdList if -** need be. -** -** A new IdList is returned, or NULL if malloc() fails. -*/ -IdList *sqliteIdListAppend(IdList *pList, Token *pToken){ - if( pList==0 ){ - pList = sqliteMalloc( sizeof(IdList) ); - if( pList==0 ) return 0; - pList->nAlloc = 0; - } - if( pList->nId>=pList->nAlloc ){ - struct IdList_item *a; - pList->nAlloc = pList->nAlloc*2 + 5; - a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0]) ); - if( a==0 ){ - sqliteIdListDelete(pList); - return 0; - } - pList->a = a; - } - memset(&pList->a[pList->nId], 0, sizeof(pList->a[0])); - if( pToken ){ - char **pz = &pList->a[pList->nId].zName; - sqliteSetNString(pz, pToken->z, pToken->n, 0); - if( *pz==0 ){ - sqliteIdListDelete(pList); - return 0; - }else{ - sqliteDequote(*pz); - } - } - pList->nId++; - return pList; -} - -/* -** Append a new table name to the given SrcList. Create a new SrcList if -** need be. A new entry is created in the SrcList even if pToken is NULL. -** -** A new SrcList is returned, or NULL if malloc() fails. -** -** If pDatabase is not null, it means that the table has an optional -** database name prefix. Like this: "database.table". The pDatabase -** points to the table name and the pTable points to the database name. -** The SrcList.a[].zName field is filled with the table name which might -** come from pTable (if pDatabase is NULL) or from pDatabase. -** SrcList.a[].zDatabase is filled with the database name from pTable, -** or with NULL if no database is specified. -** -** In other words, if call like this: -** -** sqliteSrcListAppend(A,B,0); -** -** Then B is a table name and the database name is unspecified. If called -** like this: -** -** sqliteSrcListAppend(A,B,C); -** -** Then C is the table name and B is the database name. -*/ -SrcList *sqliteSrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){ - if( pList==0 ){ - pList = sqliteMalloc( sizeof(SrcList) ); - if( pList==0 ) return 0; - pList->nAlloc = 1; - } - if( pList->nSrc>=pList->nAlloc ){ - SrcList *pNew; - pList->nAlloc *= 2; - pNew = sqliteRealloc(pList, - sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) ); - if( pNew==0 ){ - sqliteSrcListDelete(pList); - return 0; - } - pList = pNew; - } - memset(&pList->a[pList->nSrc], 0, sizeof(pList->a[0])); - if( pDatabase && pDatabase->z==0 ){ - pDatabase = 0; - } - if( pDatabase && pTable ){ - Token *pTemp = pDatabase; - pDatabase = pTable; - pTable = pTemp; - } - if( pTable ){ - char **pz = &pList->a[pList->nSrc].zName; - sqliteSetNString(pz, pTable->z, pTable->n, 0); - if( *pz==0 ){ - sqliteSrcListDelete(pList); - return 0; - }else{ - sqliteDequote(*pz); - } - } - if( pDatabase ){ - char **pz = &pList->a[pList->nSrc].zDatabase; - sqliteSetNString(pz, pDatabase->z, pDatabase->n, 0); - if( *pz==0 ){ - sqliteSrcListDelete(pList); - return 0; - }else{ - sqliteDequote(*pz); - } - } - pList->a[pList->nSrc].iCursor = -1; - pList->nSrc++; - return pList; -} - -/* -** Assign cursors to all tables in a SrcList -*/ -void sqliteSrcListAssignCursors(Parse *pParse, SrcList *pList){ - int i; - for(i=0; inSrc; i++){ - if( pList->a[i].iCursor<0 ){ - pList->a[i].iCursor = pParse->nTab++; - } - } -} - -/* -** Add an alias to the last identifier on the given identifier list. -*/ -void sqliteSrcListAddAlias(SrcList *pList, Token *pToken){ - if( pList && pList->nSrc>0 ){ - int i = pList->nSrc - 1; - sqliteSetNString(&pList->a[i].zAlias, pToken->z, pToken->n, 0); - sqliteDequote(pList->a[i].zAlias); - } -} - -/* -** Delete an IdList. -*/ -void sqliteIdListDelete(IdList *pList){ - int i; - if( pList==0 ) return; - for(i=0; inId; i++){ - sqliteFree(pList->a[i].zName); - } - sqliteFree(pList->a); - sqliteFree(pList); -} - -/* -** Return the index in pList of the identifier named zId. Return -1 -** if not found. -*/ -int sqliteIdListIndex(IdList *pList, const char *zName){ - int i; - if( pList==0 ) return -1; - for(i=0; inId; i++){ - if( sqliteStrICmp(pList->a[i].zName, zName)==0 ) return i; - } - return -1; -} - -/* -** Delete an entire SrcList including all its substructure. -*/ -void sqliteSrcListDelete(SrcList *pList){ - int i; - if( pList==0 ) return; - for(i=0; inSrc; i++){ - sqliteFree(pList->a[i].zDatabase); - sqliteFree(pList->a[i].zName); - sqliteFree(pList->a[i].zAlias); - if( pList->a[i].pTab && pList->a[i].pTab->isTransient ){ - sqliteDeleteTable(0, pList->a[i].pTab); - } - sqliteSelectDelete(pList->a[i].pSelect); - sqliteExprDelete(pList->a[i].pOn); - sqliteIdListDelete(pList->a[i].pUsing); - } - sqliteFree(pList); -} - -/* -** Begin a transaction -*/ -void sqliteBeginTransaction(Parse *pParse, int onError){ - sqlite *db; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite_malloc_failed ) return; - if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return; - if( db->flags & SQLITE_InTrans ){ - sqliteErrorMsg(pParse, "cannot start a transaction within a transaction"); - return; - } - sqliteBeginWriteOperation(pParse, 0, 0); - if( !pParse->explain ){ - db->flags |= SQLITE_InTrans; - db->onError = onError; - } -} - -/* -** Commit a transaction -*/ -void sqliteCommitTransaction(Parse *pParse){ - sqlite *db; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite_malloc_failed ) return; - if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return; - if( (db->flags & SQLITE_InTrans)==0 ){ - sqliteErrorMsg(pParse, "cannot commit - no transaction is active"); - return; - } - if( !pParse->explain ){ - db->flags &= ~SQLITE_InTrans; - } - sqliteEndWriteOperation(pParse); - if( !pParse->explain ){ - db->onError = OE_Default; - } -} - -/* -** Rollback a transaction -*/ -void sqliteRollbackTransaction(Parse *pParse){ - sqlite *db; - Vdbe *v; - - if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; - if( pParse->nErr || sqlite_malloc_failed ) return; - if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return; - if( (db->flags & SQLITE_InTrans)==0 ){ - sqliteErrorMsg(pParse, "cannot rollback - no transaction is active"); - return; - } - v = sqliteGetVdbe(pParse); - if( v ){ - sqliteVdbeAddOp(v, OP_Rollback, 0, 0); - } - if( !pParse->explain ){ - db->flags &= ~SQLITE_InTrans; - db->onError = OE_Default; - } -} - -/* -** Generate VDBE code that will verify the schema cookie for all -** named database files. -*/ -void sqliteCodeVerifySchema(Parse *pParse, int iDb){ - sqlite *db = pParse->db; - Vdbe *v = sqliteGetVdbe(pParse); - assert( iDb>=0 && iDbnDb ); - assert( db->aDb[iDb].pBt!=0 ); - if( iDb!=1 && !DbHasProperty(db, iDb, DB_Cookie) ){ - sqliteVdbeAddOp(v, OP_VerifyCookie, iDb, db->aDb[iDb].schema_cookie); - DbSetProperty(db, iDb, DB_Cookie); - } -} - -/* -** Generate VDBE code that prepares for doing an operation that -** might change the database. -** -** This routine starts a new transaction if we are not already within -** a transaction. If we are already within a transaction, then a checkpoint -** is set if the setCheckpoint parameter is true. A checkpoint should -** be set for operations that might fail (due to a constraint) part of -** the way through and which will need to undo some writes without having to -** rollback the whole transaction. For operations where all constraints -** can be checked before any changes are made to the database, it is never -** necessary to undo a write and the checkpoint should not be set. -** -** Only database iDb and the temp database are made writable by this call. -** If iDb==0, then the main and temp databases are made writable. If -** iDb==1 then only the temp database is made writable. If iDb>1 then the -** specified auxiliary database and the temp database are made writable. -*/ -void sqliteBeginWriteOperation(Parse *pParse, int setCheckpoint, int iDb){ - Vdbe *v; - sqlite *db = pParse->db; - if( DbHasProperty(db, iDb, DB_Locked) ) return; - v = sqliteGetVdbe(pParse); - if( v==0 ) return; - if( !db->aDb[iDb].inTrans ){ - sqliteVdbeAddOp(v, OP_Transaction, iDb, 0); - DbSetProperty(db, iDb, DB_Locked); - sqliteCodeVerifySchema(pParse, iDb); - if( iDb!=1 ){ - sqliteBeginWriteOperation(pParse, setCheckpoint, 1); - } - }else if( setCheckpoint ){ - sqliteVdbeAddOp(v, OP_Checkpoint, iDb, 0); - DbSetProperty(db, iDb, DB_Locked); - } -} - -/* -** Generate code that concludes an operation that may have changed -** the database. If a statement transaction was started, then emit -** an OP_Commit that will cause the changes to be committed to disk. -** -** Note that checkpoints are automatically committed at the end of -** a statement. Note also that there can be multiple calls to -** sqliteBeginWriteOperation() but there should only be a single -** call to sqliteEndWriteOperation() at the conclusion of the statement. -*/ -void sqliteEndWriteOperation(Parse *pParse){ - Vdbe *v; - sqlite *db = pParse->db; - if( pParse->trigStack ) return; /* if this is in a trigger */ - v = sqliteGetVdbe(pParse); - if( v==0 ) return; - if( db->flags & SQLITE_InTrans ){ - /* A BEGIN has executed. Do not commit until we see an explicit - ** COMMIT statement. */ - }else{ - sqliteVdbeAddOp(v, OP_Commit, 0, 0); - } -} diff --git a/ext/sqlite/libsqlite/src/config_static.w32.h b/ext/sqlite/libsqlite/src/config_static.w32.h deleted file mode 100755 index d9893024faa7b..0000000000000 --- a/ext/sqlite/libsqlite/src/config_static.w32.h +++ /dev/null @@ -1 +0,0 @@ -#define SQLITE_PTR_SZ 4 \ No newline at end of file diff --git a/ext/sqlite/libsqlite/src/copy.c b/ext/sqlite/libsqlite/src/copy.c deleted file mode 100644 index 2f70fce17be65..0000000000000 --- a/ext/sqlite/libsqlite/src/copy.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -** 2003 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the COPY command. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** The COPY command is for compatibility with PostgreSQL and specificially -** for the ability to read the output of pg_dump. The format is as -** follows: -** -** COPY table FROM file [USING DELIMITERS string] -** -** "table" is an existing table name. We will read lines of code from -** file to fill this table with data. File might be "stdin". The optional -** delimiter string identifies the field separators. The default is a tab. -*/ -void sqliteCopy( - Parse *pParse, /* The parser context */ - SrcList *pTableName, /* The name of the table into which we will insert */ - Token *pFilename, /* The file from which to obtain information */ - Token *pDelimiter, /* Use this as the field delimiter */ - int onError /* What to do if a constraint fails */ -){ - Table *pTab; - int i; - Vdbe *v; - int addr, end; - char *zFile = 0; - const char *zDb; - sqlite *db = pParse->db; - - - if( sqlite_malloc_failed ) goto copy_cleanup; - assert( pTableName->nSrc==1 ); - pTab = sqliteSrcListLookup(pParse, pTableName); - if( pTab==0 || sqliteIsReadOnly(pParse, pTab, 0) ) goto copy_cleanup; - zFile = sqliteStrNDup(pFilename->z, pFilename->n); - sqliteDequote(zFile); - assert( pTab->iDbnDb ); - zDb = db->aDb[pTab->iDb].zName; - if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) - || sqliteAuthCheck(pParse, SQLITE_COPY, pTab->zName, zFile, zDb) ){ - goto copy_cleanup; - } - v = sqliteGetVdbe(pParse); - if( v ){ - sqliteBeginWriteOperation(pParse, 1, pTab->iDb); - addr = sqliteVdbeOp3(v, OP_FileOpen, 0, 0, pFilename->z, pFilename->n); - sqliteVdbeDequoteP3(v, addr); - sqliteOpenTableAndIndices(pParse, pTab, 0); - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeAddOp(v, OP_Integer, 0, 0); /* Initialize the row count */ - } - end = sqliteVdbeMakeLabel(v); - addr = sqliteVdbeAddOp(v, OP_FileRead, pTab->nCol, end); - if( pDelimiter ){ - sqliteVdbeChangeP3(v, addr, pDelimiter->z, pDelimiter->n); - sqliteVdbeDequoteP3(v, addr); - }else{ - sqliteVdbeChangeP3(v, addr, "\t", 1); - } - if( pTab->iPKey>=0 ){ - sqliteVdbeAddOp(v, OP_FileColumn, pTab->iPKey, 0); - sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); - }else{ - sqliteVdbeAddOp(v, OP_NewRecno, 0, 0); - } - for(i=0; inCol; i++){ - if( i==pTab->iPKey ){ - /* The integer primary key column is filled with NULL since its - ** value is always pulled from the record number */ - sqliteVdbeAddOp(v, OP_String, 0, 0); - }else{ - sqliteVdbeAddOp(v, OP_FileColumn, i, 0); - } - } - sqliteGenerateConstraintChecks(pParse, pTab, 0, 0, pTab->iPKey>=0, - 0, onError, addr); - sqliteCompleteInsertion(pParse, pTab, 0, 0, 0, 0, -1); - if( (db->flags & SQLITE_CountRows)!=0 ){ - sqliteVdbeAddOp(v, OP_AddImm, 1, 0); /* Increment row count */ - } - sqliteVdbeAddOp(v, OP_Goto, 0, addr); - sqliteVdbeResolveLabel(v, end); - sqliteVdbeAddOp(v, OP_Noop, 0, 0); - sqliteEndWriteOperation(pParse); - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeAddOp(v, OP_ColumnName, 0, 1); - sqliteVdbeChangeP3(v, -1, "rows inserted", P3_STATIC); - sqliteVdbeAddOp(v, OP_Callback, 1, 0); - } - } - -copy_cleanup: - sqliteSrcListDelete(pTableName); - sqliteFree(zFile); - return; -} diff --git a/ext/sqlite/libsqlite/src/date.c b/ext/sqlite/libsqlite/src/date.c deleted file mode 100644 index c7489ec078d9c..0000000000000 --- a/ext/sqlite/libsqlite/src/date.c +++ /dev/null @@ -1,875 +0,0 @@ -/* -** 2003 October 31 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement date and time -** functions for SQLite. -** -** There is only one exported symbol in this file - the function -** sqliteRegisterDateTimeFunctions() found at the bottom of the file. -** All other code has file scope. -** -** $Id$ -** -** NOTES: -** -** SQLite processes all times and dates as Julian Day numbers. The -** dates and times are stored as the number of days since noon -** in Greenwich on November 24, 4714 B.C. according to the Gregorian -** calendar system. -** -** 1970-01-01 00:00:00 is JD 2440587.5 -** 2000-01-01 00:00:00 is JD 2451544.5 -** -** This implemention requires years to be expressed as a 4-digit number -** which means that only dates between 0000-01-01 and 9999-12-31 can -** be represented, even though julian day numbers allow a much wider -** range of dates. -** -** The Gregorian calendar system is used for all dates and times, -** even those that predate the Gregorian calendar. Historians usually -** use the Julian calendar for dates prior to 1582-10-15 and for some -** dates afterwards, depending on locale. Beware of this difference. -** -** The conversion algorithms are implemented based on descriptions -** in the following text: -** -** Jean Meeus -** Astronomical Algorithms, 2nd Edition, 1998 -** ISBM 0-943396-61-1 -** Willmann-Bell, Inc -** Richmond, Virginia (USA) -*/ -#include "os.h" -#include "sqliteInt.h" -#include -#include -#include -#include - -#ifndef SQLITE_OMIT_DATETIME_FUNCS - -/* -** A structure for holding a single date and time. -*/ -typedef struct DateTime DateTime; -struct DateTime { - double rJD; /* The julian day number */ - int Y, M, D; /* Year, month, and day */ - int h, m; /* Hour and minutes */ - int tz; /* Timezone offset in minutes */ - double s; /* Seconds */ - char validYMD; /* True if Y,M,D are valid */ - char validHMS; /* True if h,m,s are valid */ - char validJD; /* True if rJD is valid */ - char validTZ; /* True if tz is valid */ -}; - - -/* -** Convert zDate into one or more integers. Additional arguments -** come in groups of 5 as follows: -** -** N number of digits in the integer -** min minimum allowed value of the integer -** max maximum allowed value of the integer -** nextC first character after the integer -** pVal where to write the integers value. -** -** Conversions continue until one with nextC==0 is encountered. -** The function returns the number of successful conversions. -*/ -static int getDigits(const char *zDate, ...){ - va_list ap; - int val; - int N; - int min; - int max; - int nextC; - int *pVal; - int cnt = 0; - va_start(ap, zDate); - do{ - N = va_arg(ap, int); - min = va_arg(ap, int); - max = va_arg(ap, int); - nextC = va_arg(ap, int); - pVal = va_arg(ap, int*); - val = 0; - while( N-- ){ - if( !isdigit(*zDate) ){ - return cnt; - } - val = val*10 + *zDate - '0'; - zDate++; - } - if( valmax || (nextC!=0 && nextC!=*zDate) ){ - return cnt; - } - *pVal = val; - zDate++; - cnt++; - }while( nextC ); - return cnt; -} - -/* -** Read text from z[] and convert into a floating point number. Return -** the number of digits converted. -*/ -static int getValue(const char *z, double *pR){ - const char *zEnd; - *pR = sqliteAtoF(z, &zEnd); - return zEnd - z; -} - -/* -** Parse a timezone extension on the end of a date-time. -** The extension is of the form: -** -** (+/-)HH:MM -** -** If the parse is successful, write the number of minutes -** of change in *pnMin and return 0. If a parser error occurs, -** return 0. -** -** A missing specifier is not considered an error. -*/ -static int parseTimezone(const char *zDate, DateTime *p){ - int sgn = 0; - int nHr, nMn; - while( isspace(*zDate) ){ zDate++; } - p->tz = 0; - if( *zDate=='-' ){ - sgn = -1; - }else if( *zDate=='+' ){ - sgn = +1; - }else{ - return *zDate!=0; - } - zDate++; - if( getDigits(zDate, 2, 0, 14, ':', &nHr, 2, 0, 59, 0, &nMn)!=2 ){ - return 1; - } - zDate += 5; - p->tz = sgn*(nMn + nHr*60); - while( isspace(*zDate) ){ zDate++; } - return *zDate!=0; -} - -/* -** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. -** The HH, MM, and SS must each be exactly 2 digits. The -** fractional seconds FFFF can be one or more digits. -** -** Return 1 if there is a parsing error and 0 on success. -*/ -static int parseHhMmSs(const char *zDate, DateTime *p){ - int h, m, s; - double ms = 0.0; - if( getDigits(zDate, 2, 0, 24, ':', &h, 2, 0, 59, 0, &m)!=2 ){ - return 1; - } - zDate += 5; - if( *zDate==':' ){ - zDate++; - if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){ - return 1; - } - zDate += 2; - if( *zDate=='.' && isdigit(zDate[1]) ){ - double rScale = 1.0; - zDate++; - while( isdigit(*zDate) ){ - ms = ms*10.0 + *zDate - '0'; - rScale *= 10.0; - zDate++; - } - ms /= rScale; - } - }else{ - s = 0; - } - p->validJD = 0; - p->validHMS = 1; - p->h = h; - p->m = m; - p->s = s + ms; - if( parseTimezone(zDate, p) ) return 1; - p->validTZ = p->tz!=0; - return 0; -} - -/* -** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume -** that the YYYY-MM-DD is according to the Gregorian calendar. -** -** Reference: Meeus page 61 -*/ -static void computeJD(DateTime *p){ - int Y, M, D, A, B, X1, X2; - - if( p->validJD ) return; - if( p->validYMD ){ - Y = p->Y; - M = p->M; - D = p->D; - }else{ - Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */ - M = 1; - D = 1; - } - if( M<=2 ){ - Y--; - M += 12; - } - A = Y/100; - B = 2 - A + (A/4); - X1 = 365.25*(Y+4716); - X2 = 30.6001*(M+1); - p->rJD = X1 + X2 + D + B - 1524.5; - p->validJD = 1; - p->validYMD = 0; - if( p->validHMS ){ - p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0; - if( p->validTZ ){ - p->rJD += p->tz*60/86400.0; - p->validHMS = 0; - p->validTZ = 0; - } - } -} - -/* -** Parse dates of the form -** -** YYYY-MM-DD HH:MM:SS.FFF -** YYYY-MM-DD HH:MM:SS -** YYYY-MM-DD HH:MM -** YYYY-MM-DD -** -** Write the result into the DateTime structure and return 0 -** on success and 1 if the input string is not a well-formed -** date. -*/ -static int parseYyyyMmDd(const char *zDate, DateTime *p){ - int Y, M, D, neg; - - if( zDate[0]=='-' ){ - zDate++; - neg = 1; - }else{ - neg = 0; - } - if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){ - return 1; - } - zDate += 10; - while( isspace(*zDate) ){ zDate++; } - if( parseHhMmSs(zDate, p)==0 ){ - /* We got the time */ - }else if( *zDate==0 ){ - p->validHMS = 0; - }else{ - return 1; - } - p->validJD = 0; - p->validYMD = 1; - p->Y = neg ? -Y : Y; - p->M = M; - p->D = D; - if( p->validTZ ){ - computeJD(p); - } - return 0; -} - -/* -** Attempt to parse the given string into a Julian Day Number. Return -** the number of errors. -** -** The following are acceptable forms for the input string: -** -** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM -** DDDD.DD -** now -** -** In the first form, the +/-HH:MM is always optional. The fractional -** seconds extension (the ".FFF") is optional. The seconds portion -** (":SS.FFF") is option. The year and date can be omitted as long -** as there is a time string. The time string can be omitted as long -** as there is a year and date. -*/ -static int parseDateOrTime(const char *zDate, DateTime *p){ - memset(p, 0, sizeof(*p)); - if( parseYyyyMmDd(zDate,p)==0 ){ - return 0; - }else if( parseHhMmSs(zDate, p)==0 ){ - return 0; - }else if( sqliteStrICmp(zDate,"now")==0){ - double r; - if( sqliteOsCurrentTime(&r)==0 ){ - p->rJD = r; - p->validJD = 1; - return 0; - } - return 1; - }else if( sqliteIsNumber(zDate) ){ - p->rJD = sqliteAtoF(zDate, 0); - p->validJD = 1; - return 0; - } - return 1; -} - -/* -** Compute the Year, Month, and Day from the julian day number. -*/ -static void computeYMD(DateTime *p){ - int Z, A, B, C, D, E, X1; - if( p->validYMD ) return; - if( !p->validJD ){ - p->Y = 2000; - p->M = 1; - p->D = 1; - }else{ - Z = p->rJD + 0.5; - A = (Z - 1867216.25)/36524.25; - A = Z + 1 + A - (A/4); - B = A + 1524; - C = (B - 122.1)/365.25; - D = 365.25*C; - E = (B-D)/30.6001; - X1 = 30.6001*E; - p->D = B - D - X1; - p->M = E<14 ? E-1 : E-13; - p->Y = p->M>2 ? C - 4716 : C - 4715; - } - p->validYMD = 1; -} - -/* -** Compute the Hour, Minute, and Seconds from the julian day number. -*/ -static void computeHMS(DateTime *p){ - int Z, s; - if( p->validHMS ) return; - Z = p->rJD + 0.5; - s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5; - p->s = 0.001*s; - s = p->s; - p->s -= s; - p->h = s/3600; - s -= p->h*3600; - p->m = s/60; - p->s += s - p->m*60; - p->validHMS = 1; -} - -/* -** Compute both YMD and HMS -*/ -static void computeYMD_HMS(DateTime *p){ - computeYMD(p); - computeHMS(p); -} - -/* -** Clear the YMD and HMS and the TZ -*/ -static void clearYMD_HMS_TZ(DateTime *p){ - p->validYMD = 0; - p->validHMS = 0; - p->validTZ = 0; -} - -/* -** Compute the difference (in days) between localtime and UTC (a.k.a. GMT) -** for the time value p where p is in UTC. -*/ -static double localtimeOffset(DateTime *p){ - DateTime x, y; - time_t t; - struct tm *pTm; - x = *p; - computeYMD_HMS(&x); - if( x.Y<1971 || x.Y>=2038 ){ - x.Y = 2000; - x.M = 1; - x.D = 1; - x.h = 0; - x.m = 0; - x.s = 0.0; - } else { - int s = x.s + 0.5; - x.s = s; - } - x.tz = 0; - x.validJD = 0; - computeJD(&x); - t = (x.rJD-2440587.5)*86400.0 + 0.5; - sqliteOsEnterMutex(); - pTm = localtime(&t); - y.Y = pTm->tm_year + 1900; - y.M = pTm->tm_mon + 1; - y.D = pTm->tm_mday; - y.h = pTm->tm_hour; - y.m = pTm->tm_min; - y.s = pTm->tm_sec; - sqliteOsLeaveMutex(); - y.validYMD = 1; - y.validHMS = 1; - y.validJD = 0; - y.validTZ = 0; - computeJD(&y); - return y.rJD - x.rJD; -} - -/* -** Process a modifier to a date-time stamp. The modifiers are -** as follows: -** -** NNN days -** NNN hours -** NNN minutes -** NNN.NNNN seconds -** NNN months -** NNN years -** start of month -** start of year -** start of week -** start of day -** weekday N -** unixepoch -** localtime -** utc -** -** Return 0 on success and 1 if there is any kind of error. -*/ -static int parseModifier(const char *zMod, DateTime *p){ - int rc = 1; - int n; - double r; - char *z, zBuf[30]; - z = zBuf; - for(n=0; nrJD += localtimeOffset(p); - clearYMD_HMS_TZ(p); - rc = 0; - } - break; - } - case 'u': { - /* - ** unixepoch - ** - ** Treat the current value of p->rJD as the number of - ** seconds since 1970. Convert to a real julian day number. - */ - if( strcmp(z, "unixepoch")==0 && p->validJD ){ - p->rJD = p->rJD/86400.0 + 2440587.5; - clearYMD_HMS_TZ(p); - rc = 0; - }else if( strcmp(z, "utc")==0 ){ - double c1; - computeJD(p); - c1 = localtimeOffset(p); - p->rJD -= c1; - clearYMD_HMS_TZ(p); - p->rJD += c1 - localtimeOffset(p); - rc = 0; - } - break; - } - case 'w': { - /* - ** weekday N - ** - ** Move the date to the same time on the next occurrance of - ** weekday N where 0==Sunday, 1==Monday, and so forth. If the - ** date is already on the appropriate weekday, this is a no-op. - */ - if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0 - && (n=r)==r && n>=0 && r<7 ){ - int Z; - computeYMD_HMS(p); - p->validTZ = 0; - p->validJD = 0; - computeJD(p); - Z = p->rJD + 1.5; - Z %= 7; - if( Z>n ) Z -= 7; - p->rJD += n - Z; - clearYMD_HMS_TZ(p); - rc = 0; - } - break; - } - case 's': { - /* - ** start of TTTTT - ** - ** Move the date backwards to the beginning of the current day, - ** or month or year. - */ - if( strncmp(z, "start of ", 9)!=0 ) break; - z += 9; - computeYMD(p); - p->validHMS = 1; - p->h = p->m = 0; - p->s = 0.0; - p->validTZ = 0; - p->validJD = 0; - if( strcmp(z,"month")==0 ){ - p->D = 1; - rc = 0; - }else if( strcmp(z,"year")==0 ){ - computeYMD(p); - p->M = 1; - p->D = 1; - rc = 0; - }else if( strcmp(z,"day")==0 ){ - rc = 0; - } - break; - } - case '+': - case '-': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': { - n = getValue(z, &r); - if( n<=0 ) break; - if( z[n]==':' ){ - /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the - ** specified number of hours, minutes, seconds, and fractional seconds - ** to the time. The ".FFF" may be omitted. The ":SS.FFF" may be - ** omitted. - */ - const char *z2 = z; - DateTime tx; - int day; - if( !isdigit(*z2) ) z2++; - memset(&tx, 0, sizeof(tx)); - if( parseHhMmSs(z2, &tx) ) break; - computeJD(&tx); - tx.rJD -= 0.5; - day = (int)tx.rJD; - tx.rJD -= day; - if( z[0]=='-' ) tx.rJD = -tx.rJD; - computeJD(p); - clearYMD_HMS_TZ(p); - p->rJD += tx.rJD; - rc = 0; - break; - } - z += n; - while( isspace(z[0]) ) z++; - n = strlen(z); - if( n>10 || n<3 ) break; - if( z[n-1]=='s' ){ z[n-1] = 0; n--; } - computeJD(p); - rc = 0; - if( n==3 && strcmp(z,"day")==0 ){ - p->rJD += r; - }else if( n==4 && strcmp(z,"hour")==0 ){ - p->rJD += r/24.0; - }else if( n==6 && strcmp(z,"minute")==0 ){ - p->rJD += r/(24.0*60.0); - }else if( n==6 && strcmp(z,"second")==0 ){ - p->rJD += r/(24.0*60.0*60.0); - }else if( n==5 && strcmp(z,"month")==0 ){ - int x, y; - computeYMD_HMS(p); - p->M += r; - x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; - p->Y += x; - p->M -= x*12; - p->validJD = 0; - computeJD(p); - y = r; - if( y!=r ){ - p->rJD += (r - y)*30.0; - } - }else if( n==4 && strcmp(z,"year")==0 ){ - computeYMD_HMS(p); - p->Y += r; - p->validJD = 0; - computeJD(p); - }else{ - rc = 1; - } - clearYMD_HMS_TZ(p); - break; - } - default: { - break; - } - } - return rc; -} - -/* -** Process time function arguments. argv[0] is a date-time stamp. -** argv[1] and following are modifiers. Parse them all and write -** the resulting time into the DateTime structure p. Return 0 -** on success and 1 if there are any errors. -*/ -static int isDate(int argc, const char **argv, DateTime *p){ - int i; - if( argc==0 ) return 1; - if( argv[0]==0 || parseDateOrTime(argv[0], p) ) return 1; - for(i=1; izErrMsg and return NULL. If all tables -** are found, return a pointer to the last table. -*/ -Table *sqliteSrcListLookup(Parse *pParse, SrcList *pSrc){ - Table *pTab = 0; - int i; - for(i=0; inSrc; i++){ - const char *zTab = pSrc->a[i].zName; - const char *zDb = pSrc->a[i].zDatabase; - pTab = sqliteLocateTable(pParse, zTab, zDb); - pSrc->a[i].pTab = pTab; - } - return pTab; -} - -/* -** Check to make sure the given table is writable. If it is not -** writable, generate an error message and return 1. If it is -** writable return 0; -*/ -int sqliteIsReadOnly(Parse *pParse, Table *pTab, int viewOk){ - if( pTab->readOnly ){ - sqliteErrorMsg(pParse, "table %s may not be modified", pTab->zName); - return 1; - } - if( !viewOk && pTab->pSelect ){ - sqliteErrorMsg(pParse, "cannot modify %s because it is a view",pTab->zName); - return 1; - } - return 0; -} - -/* -** Process a DELETE FROM statement. -*/ -void sqliteDeleteFrom( - Parse *pParse, /* The parser context */ - SrcList *pTabList, /* The table from which we should delete things */ - Expr *pWhere /* The WHERE clause. May be null */ -){ - Vdbe *v; /* The virtual database engine */ - Table *pTab; /* The table from which records will be deleted */ - const char *zDb; /* Name of database holding pTab */ - int end, addr; /* A couple addresses of generated code */ - int i; /* Loop counter */ - WhereInfo *pWInfo; /* Information about the WHERE clause */ - Index *pIdx; /* For looping over indices of the table */ - int iCur; /* VDBE Cursor number for pTab */ - sqlite *db; /* Main database structure */ - int isView; /* True if attempting to delete from a view */ - AuthContext sContext; /* Authorization context */ - - int row_triggers_exist = 0; /* True if any triggers exist */ - int before_triggers; /* True if there are BEFORE triggers */ - int after_triggers; /* True if there are AFTER triggers */ - int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */ - - sContext.pParse = 0; - if( pParse->nErr || sqlite_malloc_failed ){ - pTabList = 0; - goto delete_from_cleanup; - } - db = pParse->db; - assert( pTabList->nSrc==1 ); - - /* Locate the table which we want to delete. This table has to be - ** put in an SrcList structure because some of the subroutines we - ** will be calling are designed to work with multiple tables and expect - ** an SrcList* parameter instead of just a Table* parameter. - */ - pTab = sqliteSrcListLookup(pParse, pTabList); - if( pTab==0 ) goto delete_from_cleanup; - before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, - TK_DELETE, TK_BEFORE, TK_ROW, 0); - after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, - TK_DELETE, TK_AFTER, TK_ROW, 0); - row_triggers_exist = before_triggers || after_triggers; - isView = pTab->pSelect!=0; - if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){ - goto delete_from_cleanup; - } - assert( pTab->iDbnDb ); - zDb = db->aDb[pTab->iDb].zName; - if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ - goto delete_from_cleanup; - } - - /* If pTab is really a view, make sure it has been initialized. - */ - if( isView && sqliteViewGetColumnNames(pParse, pTab) ){ - goto delete_from_cleanup; - } - - /* Allocate a cursor used to store the old.* data for a trigger. - */ - if( row_triggers_exist ){ - oldIdx = pParse->nTab++; - } - - /* Resolve the column names in all the expressions. - */ - assert( pTabList->nSrc==1 ); - iCur = pTabList->a[0].iCursor = pParse->nTab++; - if( pWhere ){ - if( sqliteExprResolveIds(pParse, pTabList, 0, pWhere) ){ - goto delete_from_cleanup; - } - if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ - goto delete_from_cleanup; - } - } - - /* Start the view context - */ - if( isView ){ - sqliteAuthContextPush(pParse, &sContext, pTab->zName); - } - - /* Begin generating code. - */ - v = sqliteGetVdbe(pParse); - if( v==0 ){ - goto delete_from_cleanup; - } - sqliteBeginWriteOperation(pParse, row_triggers_exist, pTab->iDb); - - /* If we are trying to delete from a view, construct that view into - ** a temporary table. - */ - if( isView ){ - Select *pView = sqliteSelectDup(pTab->pSelect); - sqliteSelect(pParse, pView, SRT_TempTable, iCur, 0, 0, 0); - sqliteSelectDelete(pView); - } - - /* Initialize the counter of the number of rows deleted, if - ** we are counting rows. - */ - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeAddOp(v, OP_Integer, 0, 0); - } - - /* Special case: A DELETE without a WHERE clause deletes everything. - ** It is easier just to erase the whole table. Note, however, that - ** this means that the row change count will be incorrect. - */ - if( pWhere==0 && !row_triggers_exist ){ - if( db->flags & SQLITE_CountRows ){ - /* If counting rows deleted, just count the total number of - ** entries in the table. */ - int endOfLoop = sqliteVdbeMakeLabel(v); - int addr; - if( !isView ){ - sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum); - } - sqliteVdbeAddOp(v, OP_Rewind, iCur, sqliteVdbeCurrentAddr(v)+2); - addr = sqliteVdbeAddOp(v, OP_AddImm, 1, 0); - sqliteVdbeAddOp(v, OP_Next, iCur, addr); - sqliteVdbeResolveLabel(v, endOfLoop); - sqliteVdbeAddOp(v, OP_Close, iCur, 0); - } - if( !isView ){ - sqliteVdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb); - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - sqliteVdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb); - } - } - } - - /* The usual case: There is a WHERE clause so we have to scan through - ** the table and pick which records to delete. - */ - else{ - /* Begin the database scan - */ - pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 1, 0); - if( pWInfo==0 ) goto delete_from_cleanup; - - /* Remember the key of every item to be deleted. - */ - sqliteVdbeAddOp(v, OP_ListWrite, 0, 0); - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeAddOp(v, OP_AddImm, 1, 0); - } - - /* End the database scan loop. - */ - sqliteWhereEnd(pWInfo); - - /* Open the pseudo-table used to store OLD if there are triggers. - */ - if( row_triggers_exist ){ - sqliteVdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); - } - - /* Delete every item whose key was written to the list during the - ** database scan. We have to delete items after the scan is complete - ** because deleting an item can change the scan order. - */ - sqliteVdbeAddOp(v, OP_ListRewind, 0, 0); - end = sqliteVdbeMakeLabel(v); - - /* This is the beginning of the delete loop when there are - ** row triggers. - */ - if( row_triggers_exist ){ - addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - if( !isView ){ - sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum); - } - sqliteVdbeAddOp(v, OP_MoveTo, iCur, 0); - - sqliteVdbeAddOp(v, OP_Recno, iCur, 0); - sqliteVdbeAddOp(v, OP_RowData, iCur, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, oldIdx, 0); - if( !isView ){ - sqliteVdbeAddOp(v, OP_Close, iCur, 0); - } - - sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1, - oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, - addr); - } - - if( !isView ){ - /* Open cursors for the table we are deleting from and all its - ** indices. If there are row triggers, this happens inside the - ** OP_ListRead loop because the cursor have to all be closed - ** before the trigger fires. If there are no row triggers, the - ** cursors are opened only once on the outside the loop. - */ - pParse->nTab = iCur + 1; - sqliteOpenTableAndIndices(pParse, pTab, iCur); - - /* This is the beginning of the delete loop when there are no - ** row triggers */ - if( !row_triggers_exist ){ - addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end); - } - - /* Delete the row */ - sqliteGenerateRowDelete(db, v, pTab, iCur, pParse->trigStack==0); - } - - /* If there are row triggers, close all cursors then invoke - ** the AFTER triggers - */ - if( row_triggers_exist ){ - if( !isView ){ - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); - } - sqliteVdbeAddOp(v, OP_Close, iCur, 0); - } - sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1, - oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default, - addr); - } - - /* End of the delete loop */ - sqliteVdbeAddOp(v, OP_Goto, 0, addr); - sqliteVdbeResolveLabel(v, end); - sqliteVdbeAddOp(v, OP_ListReset, 0, 0); - - /* Close the cursors after the loop if there are no row triggers */ - if( !row_triggers_exist ){ - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum); - } - sqliteVdbeAddOp(v, OP_Close, iCur, 0); - pParse->nTab = iCur; - } - } - sqliteVdbeAddOp(v, OP_SetCounts, 0, 0); - sqliteEndWriteOperation(pParse); - - /* - ** Return the number of rows that were deleted. - */ - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeAddOp(v, OP_ColumnName, 0, 1); - sqliteVdbeChangeP3(v, -1, "rows deleted", P3_STATIC); - sqliteVdbeAddOp(v, OP_Callback, 1, 0); - } - -delete_from_cleanup: - sqliteAuthContextPop(&sContext); - sqliteSrcListDelete(pTabList); - sqliteExprDelete(pWhere); - return; -} - -/* -** This routine generates VDBE code that causes a single row of a -** single table to be deleted. -** -** The VDBE must be in a particular state when this routine is called. -** These are the requirements: -** -** 1. A read/write cursor pointing to pTab, the table containing the row -** to be deleted, must be opened as cursor number "base". -** -** 2. Read/write cursors for all indices of pTab must be open as -** cursor number base+i for the i-th index. -** -** 3. The record number of the row to be deleted must be on the top -** of the stack. -** -** This routine pops the top of the stack to remove the record number -** and then generates code to remove both the table record and all index -** entries that point to that record. -*/ -void sqliteGenerateRowDelete( - sqlite *db, /* The database containing the index */ - Vdbe *v, /* Generate code into this VDBE */ - Table *pTab, /* Table containing the row to be deleted */ - int iCur, /* Cursor number for the table */ - int count /* Increment the row change counter */ -){ - int addr; - addr = sqliteVdbeAddOp(v, OP_NotExists, iCur, 0); - sqliteGenerateRowIndexDelete(db, v, pTab, iCur, 0); - sqliteVdbeAddOp(v, OP_Delete, iCur, - (count?OPFLAG_NCHANGE:0) | OPFLAG_CSCHANGE); - sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); -} - -/* -** This routine generates VDBE code that causes the deletion of all -** index entries associated with a single row of a single table. -** -** The VDBE must be in a particular state when this routine is called. -** These are the requirements: -** -** 1. A read/write cursor pointing to pTab, the table containing the row -** to be deleted, must be opened as cursor number "iCur". -** -** 2. Read/write cursors for all indices of pTab must be open as -** cursor number iCur+i for the i-th index. -** -** 3. The "iCur" cursor must be pointing to the row that is to be -** deleted. -*/ -void sqliteGenerateRowIndexDelete( - sqlite *db, /* The database containing the index */ - Vdbe *v, /* Generate code into this VDBE */ - Table *pTab, /* Table containing the row to be deleted */ - int iCur, /* Cursor number for the table */ - char *aIdxUsed /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */ -){ - int i; - Index *pIdx; - - for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ - int j; - if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue; - sqliteVdbeAddOp(v, OP_Recno, iCur, 0); - for(j=0; jnColumn; j++){ - int idx = pIdx->aiColumn[j]; - if( idx==pTab->iPKey ){ - sqliteVdbeAddOp(v, OP_Dup, j, 0); - }else{ - sqliteVdbeAddOp(v, OP_Column, iCur, idx); - } - } - sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); - if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); - sqliteVdbeAddOp(v, OP_IdxDelete, iCur+i, 0); - } -} diff --git a/ext/sqlite/libsqlite/src/encode.c b/ext/sqlite/libsqlite/src/encode.c deleted file mode 100644 index 7d959b00caaec..0000000000000 --- a/ext/sqlite/libsqlite/src/encode.c +++ /dev/null @@ -1,254 +0,0 @@ -/* -** 2002 April 25 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains helper routines used to translate binary data into -** a null-terminated string (suitable for use in SQLite) and back again. -** These are convenience routines for use by people who want to store binary -** data in an SQLite database. The code in this file is not used by any other -** part of the SQLite library. -** -** $Id$ -*/ -#include -#include - -/* -** How This Encoder Works -** -** The output is allowed to contain any character except 0x27 (') and -** 0x00. This is accomplished by using an escape character to encode -** 0x27 and 0x00 as a two-byte sequence. The escape character is always -** 0x01. An 0x00 is encoded as the two byte sequence 0x01 0x01. The -** 0x27 character is encoded as the two byte sequence 0x01 0x28. Finally, -** the escape character itself is encoded as the two-character sequence -** 0x01 0x02. -** -** To summarize, the encoder works by using an escape sequences as follows: -** -** 0x00 -> 0x01 0x01 -** 0x01 -> 0x01 0x02 -** 0x27 -> 0x01 0x28 -** -** If that were all the encoder did, it would work, but in certain cases -** it could double the size of the encoded string. For example, to -** encode a string of 100 0x27 characters would require 100 instances of -** the 0x01 0x03 escape sequence resulting in a 200-character output. -** We would prefer to keep the size of the encoded string smaller than -** this. -** -** To minimize the encoding size, we first add a fixed offset value to each -** byte in the sequence. The addition is modulo 256. (That is to say, if -** the sum of the original character value and the offset exceeds 256, then -** the higher order bits are truncated.) The offset is chosen to minimize -** the number of characters in the string that need to be escaped. For -** example, in the case above where the string was composed of 100 0x27 -** characters, the offset might be 0x01. Each of the 0x27 characters would -** then be converted into an 0x28 character which would not need to be -** escaped at all and so the 100 character input string would be converted -** into just 100 characters of output. Actually 101 characters of output - -** we have to record the offset used as the first byte in the sequence so -** that the string can be decoded. Since the offset value is stored as -** part of the output string and the output string is not allowed to contain -** characters 0x00 or 0x27, the offset cannot be 0x00 or 0x27. -** -** Here, then, are the encoding steps: -** -** (1) Choose an offset value and make it the first character of -** output. -** -** (2) Copy each input character into the output buffer, one by -** one, adding the offset value as you copy. -** -** (3) If the value of an input character plus offset is 0x00, replace -** that one character by the two-character sequence 0x01 0x01. -** If the sum is 0x01, replace it with 0x01 0x02. If the sum -** is 0x27, replace it with 0x01 0x03. -** -** (4) Put a 0x00 terminator at the end of the output. -** -** Decoding is obvious: -** -** (5) Copy encoded characters except the first into the decode -** buffer. Set the first encoded character aside for use as -** the offset in step 7 below. -** -** (6) Convert each 0x01 0x01 sequence into a single character 0x00. -** Convert 0x01 0x02 into 0x01. Convert 0x01 0x28 into 0x27. -** -** (7) Subtract the offset value that was the first character of -** the encoded buffer from all characters in the output buffer. -** -** The only tricky part is step (1) - how to compute an offset value to -** minimize the size of the output buffer. This is accomplished by testing -** all offset values and picking the one that results in the fewest number -** of escapes. To do that, we first scan the entire input and count the -** number of occurances of each character value in the input. Suppose -** the number of 0x00 characters is N(0), the number of occurances of 0x01 -** is N(1), and so forth up to the number of occurances of 0xff is N(255). -** An offset of 0 is not allowed so we don't have to test it. The number -** of escapes required for an offset of 1 is N(1)+N(2)+N(40). The number -** of escapes required for an offset of 2 is N(2)+N(3)+N(41). And so forth. -** In this way we find the offset that gives the minimum number of escapes, -** and thus minimizes the length of the output string. -*/ - -/* -** Encode a binary buffer "in" of size n bytes so that it contains -** no instances of characters '\'' or '\000'. The output is -** null-terminated and can be used as a string value in an INSERT -** or UPDATE statement. Use sqlite_decode_binary() to convert the -** string back into its original binary. -** -** The result is written into a preallocated output buffer "out". -** "out" must be able to hold at least 2 +(257*n)/254 bytes. -** In other words, the output will be expanded by as much as 3 -** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. -** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) -** -** The return value is the number of characters in the encoded -** string, excluding the "\000" terminator. -** -** If out==NULL then no output is generated but the routine still returns -** the number of characters that would have been generated if out had -** not been NULL. -*/ -int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){ - int i, j, e, m; - unsigned char x; - int cnt[256]; - if( n<=0 ){ - if( out ){ - out[0] = 'x'; - out[1] = 0; - } - return 1; - } - memset(cnt, 0, sizeof(cnt)); - for(i=n-1; i>=0; i--){ cnt[in[i]]++; } - m = n; - for(i=1; i<256; i++){ - int sum; - if( i=='\'' ) continue; - sum = cnt[i] + cnt[(i+1)&0xff] + cnt[(i+'\'')&0xff]; - if( sum -/* -** The subroutines above are not tested by the usual test suite. To test -** these routines, compile just this one file with a -DENCODER_TEST=1 option -** and run the result. -*/ -int main(int argc, char **argv){ - int i, j, n, m, nOut, nByteIn, nByteOut; - unsigned char in[30000]; - unsigned char out[33000]; - - nByteIn = nByteOut = 0; - for(i=0; i%d (max %d)", n, strlen(out)+1, m); - if( strlen(out)+1>m ){ - printf(" ERROR output too big\n"); - exit(1); - } - for(j=0; out[j]; j++){ - if( out[j]=='\'' ){ - printf(" ERROR contains (')\n"); - exit(1); - } - } - j = sqlite_decode_binary(out, out); - if( j!=n ){ - printf(" ERROR decode size %d\n", j); - exit(1); - } - if( memcmp(in, out, n)!=0 ){ - printf(" ERROR decode mismatch\n"); - exit(1); - } - printf(" OK\n"); - } - fprintf(stderr,"Finished. Total encoding: %d->%d bytes\n", - nByteIn, nByteOut); - fprintf(stderr,"Avg size increase: %.3f%%\n", - (nByteOut-nByteIn)*100.0/(double)nByteIn); -} -#endif /* ENCODER_TEST */ diff --git a/ext/sqlite/libsqlite/src/expr.c b/ext/sqlite/libsqlite/src/expr.c deleted file mode 100644 index 86346fa5d9610..0000000000000 --- a/ext/sqlite/libsqlite/src/expr.c +++ /dev/null @@ -1,1662 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains routines used for analyzing expressions and -** for generating VDBE code that evaluates expressions in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include - -/* -** Construct a new expression node and return a pointer to it. Memory -** for this node is obtained from sqliteMalloc(). The calling function -** is responsible for making sure the node eventually gets freed. -*/ -Expr *sqliteExpr(int op, Expr *pLeft, Expr *pRight, Token *pToken){ - Expr *pNew; - pNew = sqliteMalloc( sizeof(Expr) ); - if( pNew==0 ){ - /* When malloc fails, we leak memory from pLeft and pRight */ - return 0; - } - pNew->op = op; - pNew->pLeft = pLeft; - pNew->pRight = pRight; - if( pToken ){ - assert( pToken->dyn==0 ); - pNew->token = *pToken; - pNew->span = *pToken; - }else{ - assert( pNew->token.dyn==0 ); - assert( pNew->token.z==0 ); - assert( pNew->token.n==0 ); - if( pLeft && pRight ){ - sqliteExprSpan(pNew, &pLeft->span, &pRight->span); - }else{ - pNew->span = pNew->token; - } - } - return pNew; -} - -/* -** Set the Expr.span field of the given expression to span all -** text between the two given tokens. -*/ -void sqliteExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){ - assert( pRight!=0 ); - assert( pLeft!=0 ); - /* Note: pExpr might be NULL due to a prior malloc failure */ - if( pExpr && pRight->z && pLeft->z ){ - if( pLeft->dyn==0 && pRight->dyn==0 ){ - pExpr->span.z = pLeft->z; - pExpr->span.n = pRight->n + Addr(pRight->z) - Addr(pLeft->z); - }else{ - pExpr->span.z = 0; - } - } -} - -/* -** Construct a new expression node for a function with multiple -** arguments. -*/ -Expr *sqliteExprFunction(ExprList *pList, Token *pToken){ - Expr *pNew; - pNew = sqliteMalloc( sizeof(Expr) ); - if( pNew==0 ){ - /* sqliteExprListDelete(pList); // Leak pList when malloc fails */ - return 0; - } - pNew->op = TK_FUNCTION; - pNew->pList = pList; - if( pToken ){ - assert( pToken->dyn==0 ); - pNew->token = *pToken; - }else{ - pNew->token.z = 0; - } - pNew->span = pNew->token; - return pNew; -} - -/* -** Recursively delete an expression tree. -*/ -void sqliteExprDelete(Expr *p){ - if( p==0 ) return; - if( p->span.dyn ) sqliteFree((char*)p->span.z); - if( p->token.dyn ) sqliteFree((char*)p->token.z); - sqliteExprDelete(p->pLeft); - sqliteExprDelete(p->pRight); - sqliteExprListDelete(p->pList); - sqliteSelectDelete(p->pSelect); - sqliteFree(p); -} - - -/* -** The following group of routines make deep copies of expressions, -** expression lists, ID lists, and select statements. The copies can -** be deleted (by being passed to their respective ...Delete() routines) -** without effecting the originals. -** -** The expression list, ID, and source lists return by sqliteExprListDup(), -** sqliteIdListDup(), and sqliteSrcListDup() can not be further expanded -** by subsequent calls to sqlite*ListAppend() routines. -** -** Any tables that the SrcList might point to are not duplicated. -*/ -Expr *sqliteExprDup(Expr *p){ - Expr *pNew; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*p) ); - if( pNew==0 ) return 0; - memcpy(pNew, p, sizeof(*pNew)); - if( p->token.z!=0 ){ - pNew->token.z = sqliteStrNDup(p->token.z, p->token.n); - pNew->token.dyn = 1; - }else{ - assert( pNew->token.z==0 ); - } - pNew->span.z = 0; - pNew->pLeft = sqliteExprDup(p->pLeft); - pNew->pRight = sqliteExprDup(p->pRight); - pNew->pList = sqliteExprListDup(p->pList); - pNew->pSelect = sqliteSelectDup(p->pSelect); - return pNew; -} -void sqliteTokenCopy(Token *pTo, Token *pFrom){ - if( pTo->dyn ) sqliteFree((char*)pTo->z); - if( pFrom->z ){ - pTo->n = pFrom->n; - pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); - pTo->dyn = 1; - }else{ - pTo->z = 0; - } -} -ExprList *sqliteExprListDup(ExprList *p){ - ExprList *pNew; - struct ExprList_item *pItem; - int i; - if( p==0 ) return 0; - pNew = sqliteMalloc( sizeof(*pNew) ); - if( pNew==0 ) return 0; - pNew->nExpr = pNew->nAlloc = p->nExpr; - pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) ); - if( pItem==0 ){ - sqliteFree(pNew); - return 0; - } - for(i=0; inExpr; i++, pItem++){ - Expr *pNewExpr, *pOldExpr; - pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr); - if( pOldExpr->span.z!=0 && pNewExpr ){ - /* Always make a copy of the span for top-level expressions in the - ** expression list. The logic in SELECT processing that determines - ** the names of columns in the result set needs this information */ - sqliteTokenCopy(&pNewExpr->span, &pOldExpr->span); - } - assert( pNewExpr==0 || pNewExpr->span.z!=0 - || pOldExpr->span.z==0 || sqlite_malloc_failed ); - pItem->zName = sqliteStrDup(p->a[i].zName); - pItem->sortOrder = p->a[i].sortOrder; - pItem->isAgg = p->a[i].isAgg; - pItem->done = 0; - } - return pNew; -} -SrcList *sqliteSrcListDup(SrcList *p){ - SrcList *pNew; - int i; - int nByte; - if( p==0 ) return 0; - nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); - pNew = sqliteMallocRaw( nByte ); - if( pNew==0 ) return 0; - pNew->nSrc = pNew->nAlloc = p->nSrc; - for(i=0; inSrc; i++){ - struct SrcList_item *pNewItem = &pNew->a[i]; - struct SrcList_item *pOldItem = &p->a[i]; - pNewItem->zDatabase = sqliteStrDup(pOldItem->zDatabase); - pNewItem->zName = sqliteStrDup(pOldItem->zName); - pNewItem->zAlias = sqliteStrDup(pOldItem->zAlias); - pNewItem->jointype = pOldItem->jointype; - pNewItem->iCursor = pOldItem->iCursor; - pNewItem->pTab = 0; - pNewItem->pSelect = sqliteSelectDup(pOldItem->pSelect); - pNewItem->pOn = sqliteExprDup(pOldItem->pOn); - pNewItem->pUsing = sqliteIdListDup(pOldItem->pUsing); - } - return pNew; -} -IdList *sqliteIdListDup(IdList *p){ - IdList *pNew; - int i; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*pNew) ); - if( pNew==0 ) return 0; - pNew->nId = pNew->nAlloc = p->nId; - pNew->a = sqliteMallocRaw( p->nId*sizeof(p->a[0]) ); - if( pNew->a==0 ) return 0; - for(i=0; inId; i++){ - struct IdList_item *pNewItem = &pNew->a[i]; - struct IdList_item *pOldItem = &p->a[i]; - pNewItem->zName = sqliteStrDup(pOldItem->zName); - pNewItem->idx = pOldItem->idx; - } - return pNew; -} -Select *sqliteSelectDup(Select *p){ - Select *pNew; - if( p==0 ) return 0; - pNew = sqliteMallocRaw( sizeof(*p) ); - if( pNew==0 ) return 0; - pNew->isDistinct = p->isDistinct; - pNew->pEList = sqliteExprListDup(p->pEList); - pNew->pSrc = sqliteSrcListDup(p->pSrc); - pNew->pWhere = sqliteExprDup(p->pWhere); - pNew->pGroupBy = sqliteExprListDup(p->pGroupBy); - pNew->pHaving = sqliteExprDup(p->pHaving); - pNew->pOrderBy = sqliteExprListDup(p->pOrderBy); - pNew->op = p->op; - pNew->pPrior = sqliteSelectDup(p->pPrior); - pNew->nLimit = p->nLimit; - pNew->nOffset = p->nOffset; - pNew->zSelect = 0; - pNew->iLimit = -1; - pNew->iOffset = -1; - return pNew; -} - - -/* -** Add a new element to the end of an expression list. If pList is -** initially NULL, then create a new expression list. -*/ -ExprList *sqliteExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){ - if( pList==0 ){ - pList = sqliteMalloc( sizeof(ExprList) ); - if( pList==0 ){ - /* sqliteExprDelete(pExpr); // Leak memory if malloc fails */ - return 0; - } - assert( pList->nAlloc==0 ); - } - if( pList->nAlloc<=pList->nExpr ){ - pList->nAlloc = pList->nAlloc*2 + 4; - pList->a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0])); - if( pList->a==0 ){ - /* sqliteExprDelete(pExpr); // Leak memory if malloc fails */ - pList->nExpr = pList->nAlloc = 0; - return pList; - } - } - assert( pList->a!=0 ); - if( pExpr || pName ){ - struct ExprList_item *pItem = &pList->a[pList->nExpr++]; - memset(pItem, 0, sizeof(*pItem)); - pItem->pExpr = pExpr; - if( pName ){ - sqliteSetNString(&pItem->zName, pName->z, pName->n, 0); - sqliteDequote(pItem->zName); - } - } - return pList; -} - -/* -** Delete an entire expression list. -*/ -void sqliteExprListDelete(ExprList *pList){ - int i; - if( pList==0 ) return; - assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); - assert( pList->nExpr<=pList->nAlloc ); - for(i=0; inExpr; i++){ - sqliteExprDelete(pList->a[i].pExpr); - sqliteFree(pList->a[i].zName); - } - sqliteFree(pList->a); - sqliteFree(pList); -} - -/* -** Walk an expression tree. Return 1 if the expression is constant -** and 0 if it involves variables. -** -** For the purposes of this function, a double-quoted string (ex: "abc") -** is considered a variable but a single-quoted string (ex: 'abc') is -** a constant. -*/ -int sqliteExprIsConstant(Expr *p){ - switch( p->op ){ - case TK_ID: - case TK_COLUMN: - case TK_DOT: - case TK_FUNCTION: - return 0; - case TK_NULL: - case TK_STRING: - case TK_INTEGER: - case TK_FLOAT: - case TK_VARIABLE: - return 1; - default: { - if( p->pLeft && !sqliteExprIsConstant(p->pLeft) ) return 0; - if( p->pRight && !sqliteExprIsConstant(p->pRight) ) return 0; - if( p->pList ){ - int i; - for(i=0; ipList->nExpr; i++){ - if( !sqliteExprIsConstant(p->pList->a[i].pExpr) ) return 0; - } - } - return p->pLeft!=0 || p->pRight!=0 || (p->pList && p->pList->nExpr>0); - } - } - return 0; -} - -/* -** If the given expression codes a constant integer that is small enough -** to fit in a 32-bit integer, return 1 and put the value of the integer -** in *pValue. If the expression is not an integer or if it is too big -** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. -*/ -int sqliteExprIsInteger(Expr *p, int *pValue){ - switch( p->op ){ - case TK_INTEGER: { - if( sqliteFitsIn32Bits(p->token.z) ){ - *pValue = atoi(p->token.z); - return 1; - } - break; - } - case TK_STRING: { - const char *z = p->token.z; - int n = p->token.n; - if( n>0 && z[0]=='-' ){ z++; n--; } - while( n>0 && *z && isdigit(*z) ){ z++; n--; } - if( n==0 && sqliteFitsIn32Bits(p->token.z) ){ - *pValue = atoi(p->token.z); - return 1; - } - break; - } - case TK_UPLUS: { - return sqliteExprIsInteger(p->pLeft, pValue); - } - case TK_UMINUS: { - int v; - if( sqliteExprIsInteger(p->pLeft, &v) ){ - *pValue = -v; - return 1; - } - break; - } - default: break; - } - return 0; -} - -/* -** Return TRUE if the given string is a row-id column name. -*/ -int sqliteIsRowid(const char *z){ - if( sqliteStrICmp(z, "_ROWID_")==0 ) return 1; - if( sqliteStrICmp(z, "ROWID")==0 ) return 1; - if( sqliteStrICmp(z, "OID")==0 ) return 1; - return 0; -} - -/* -** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up -** that name in the set of source tables in pSrcList and make the pExpr -** expression node refer back to that source column. The following changes -** are made to pExpr: -** -** pExpr->iDb Set the index in db->aDb[] of the database holding -** the table. -** pExpr->iTable Set to the cursor number for the table obtained -** from pSrcList. -** pExpr->iColumn Set to the column number within the table. -** pExpr->dataType Set to the appropriate data type for the column. -** pExpr->op Set to TK_COLUMN. -** pExpr->pLeft Any expression this points to is deleted -** pExpr->pRight Any expression this points to is deleted. -** -** The pDbToken is the name of the database (the "X"). This value may be -** NULL meaning that name is of the form Y.Z or Z. Any available database -** can be used. The pTableToken is the name of the table (the "Y"). This -** value can be NULL if pDbToken is also NULL. If pTableToken is NULL it -** means that the form of the name is Z and that columns from any table -** can be used. -** -** If the name cannot be resolved unambiguously, leave an error message -** in pParse and return non-zero. Return zero on success. -*/ -static int lookupName( - Parse *pParse, /* The parsing context */ - Token *pDbToken, /* Name of the database containing table, or NULL */ - Token *pTableToken, /* Name of table containing column, or NULL */ - Token *pColumnToken, /* Name of the column. */ - SrcList *pSrcList, /* List of tables used to resolve column names */ - ExprList *pEList, /* List of expressions used to resolve "AS" */ - Expr *pExpr /* Make this EXPR node point to the selected column */ -){ - char *zDb = 0; /* Name of the database. The "X" in X.Y.Z */ - char *zTab = 0; /* Name of the table. The "Y" in X.Y.Z or Y.Z */ - char *zCol = 0; /* Name of the column. The "Z" */ - int i, j; /* Loop counters */ - int cnt = 0; /* Number of matching column names */ - int cntTab = 0; /* Number of matching table names */ - sqlite *db = pParse->db; /* The database */ - - assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */ - if( pDbToken && pDbToken->z ){ - zDb = sqliteStrNDup(pDbToken->z, pDbToken->n); - sqliteDequote(zDb); - }else{ - zDb = 0; - } - if( pTableToken && pTableToken->z ){ - zTab = sqliteStrNDup(pTableToken->z, pTableToken->n); - sqliteDequote(zTab); - }else{ - assert( zDb==0 ); - zTab = 0; - } - zCol = sqliteStrNDup(pColumnToken->z, pColumnToken->n); - sqliteDequote(zCol); - if( sqlite_malloc_failed ){ - return 1; /* Leak memory (zDb and zTab) if malloc fails */ - } - assert( zTab==0 || pEList==0 ); - - pExpr->iTable = -1; - for(i=0; inSrc; i++){ - struct SrcList_item *pItem = &pSrcList->a[i]; - Table *pTab = pItem->pTab; - Column *pCol; - - if( pTab==0 ) continue; - assert( pTab->nCol>0 ); - if( zTab ){ - if( pItem->zAlias ){ - char *zTabName = pItem->zAlias; - if( sqliteStrICmp(zTabName, zTab)!=0 ) continue; - }else{ - char *zTabName = pTab->zName; - if( zTabName==0 || sqliteStrICmp(zTabName, zTab)!=0 ) continue; - if( zDb!=0 && sqliteStrICmp(db->aDb[pTab->iDb].zName, zDb)!=0 ){ - continue; - } - } - } - if( 0==(cntTab++) ){ - pExpr->iTable = pItem->iCursor; - pExpr->iDb = pTab->iDb; - } - for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ - if( sqliteStrICmp(pCol->zName, zCol)==0 ){ - cnt++; - pExpr->iTable = pItem->iCursor; - pExpr->iDb = pTab->iDb; - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - pExpr->iColumn = j==pTab->iPKey ? -1 : j; - pExpr->dataType = pCol->sortOrder & SQLITE_SO_TYPEMASK; - break; - } - } - } - - /* If we have not already resolved the name, then maybe - ** it is a new.* or old.* trigger argument reference - */ - if( zDb==0 && zTab!=0 && cnt==0 && pParse->trigStack!=0 ){ - TriggerStack *pTriggerStack = pParse->trigStack; - Table *pTab = 0; - if( pTriggerStack->newIdx != -1 && sqliteStrICmp("new", zTab) == 0 ){ - pExpr->iTable = pTriggerStack->newIdx; - assert( pTriggerStack->pTab ); - pTab = pTriggerStack->pTab; - }else if( pTriggerStack->oldIdx != -1 && sqliteStrICmp("old", zTab) == 0 ){ - pExpr->iTable = pTriggerStack->oldIdx; - assert( pTriggerStack->pTab ); - pTab = pTriggerStack->pTab; - } - - if( pTab ){ - int j; - Column *pCol = pTab->aCol; - - pExpr->iDb = pTab->iDb; - cntTab++; - for(j=0; j < pTab->nCol; j++, pCol++) { - if( sqliteStrICmp(pCol->zName, zCol)==0 ){ - cnt++; - pExpr->iColumn = j==pTab->iPKey ? -1 : j; - pExpr->dataType = pCol->sortOrder & SQLITE_SO_TYPEMASK; - break; - } - } - } - } - - /* - ** Perhaps the name is a reference to the ROWID - */ - if( cnt==0 && cntTab==1 && sqliteIsRowid(zCol) ){ - cnt = 1; - pExpr->iColumn = -1; - pExpr->dataType = SQLITE_SO_NUM; - } - - /* - ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z - ** might refer to an result-set alias. This happens, for example, when - ** we are resolving names in the WHERE clause of the following command: - ** - ** SELECT a+b AS x FROM table WHERE x<10; - ** - ** In cases like this, replace pExpr with a copy of the expression that - ** forms the result set entry ("a+b" in the example) and return immediately. - ** Note that the expression in the result set should have already been - ** resolved by the time the WHERE clause is resolved. - */ - if( cnt==0 && pEList!=0 ){ - for(j=0; jnExpr; j++){ - char *zAs = pEList->a[j].zName; - if( zAs!=0 && sqliteStrICmp(zAs, zCol)==0 ){ - assert( pExpr->pLeft==0 && pExpr->pRight==0 ); - pExpr->op = TK_AS; - pExpr->iColumn = j; - pExpr->pLeft = sqliteExprDup(pEList->a[j].pExpr); - sqliteFree(zCol); - assert( zTab==0 && zDb==0 ); - return 0; - } - } - } - - /* - ** If X and Y are NULL (in other words if only the column name Z is - ** supplied) and the value of Z is enclosed in double-quotes, then - ** Z is a string literal if it doesn't match any column names. In that - ** case, we need to return right away and not make any changes to - ** pExpr. - */ - if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){ - sqliteFree(zCol); - return 0; - } - - /* - ** cnt==0 means there was not match. cnt>1 means there were two or - ** more matches. Either way, we have an error. - */ - if( cnt!=1 ){ - char *z = 0; - char *zErr; - zErr = cnt==0 ? "no such column: %s" : "ambiguous column name: %s"; - if( zDb ){ - sqliteSetString(&z, zDb, ".", zTab, ".", zCol, 0); - }else if( zTab ){ - sqliteSetString(&z, zTab, ".", zCol, 0); - }else{ - z = sqliteStrDup(zCol); - } - sqliteErrorMsg(pParse, zErr, z); - sqliteFree(z); - } - - /* Clean up and return - */ - sqliteFree(zDb); - sqliteFree(zTab); - sqliteFree(zCol); - sqliteExprDelete(pExpr->pLeft); - pExpr->pLeft = 0; - sqliteExprDelete(pExpr->pRight); - pExpr->pRight = 0; - pExpr->op = TK_COLUMN; - sqliteAuthRead(pParse, pExpr, pSrcList); - return cnt!=1; -} - -/* -** This routine walks an expression tree and resolves references to -** table columns. Nodes of the form ID.ID or ID resolve into an -** index to the table in the table list and a column offset. The -** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable -** value is changed to the index of the referenced table in pTabList -** plus the "base" value. The base value will ultimately become the -** VDBE cursor number for a cursor that is pointing into the referenced -** table. The Expr.iColumn value is changed to the index of the column -** of the referenced table. The Expr.iColumn value for the special -** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an -** alias for ROWID. -** -** We also check for instances of the IN operator. IN comes in two -** forms: -** -** expr IN (exprlist) -** and -** expr IN (SELECT ...) -** -** The first form is handled by creating a set holding the list -** of allowed values. The second form causes the SELECT to generate -** a temporary table. -** -** This routine also looks for scalar SELECTs that are part of an expression. -** If it finds any, it generates code to write the value of that select -** into a memory cell. -** -** Unknown columns or tables provoke an error. The function returns -** the number of errors seen and leaves an error message on pParse->zErrMsg. -*/ -int sqliteExprResolveIds( - Parse *pParse, /* The parser context */ - SrcList *pSrcList, /* List of tables used to resolve column names */ - ExprList *pEList, /* List of expressions used to resolve "AS" */ - Expr *pExpr /* The expression to be analyzed. */ -){ - int i; - - if( pExpr==0 || pSrcList==0 ) return 0; - for(i=0; inSrc; i++){ - assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursornTab ); - } - switch( pExpr->op ){ - /* Double-quoted strings (ex: "abc") are used as identifiers if - ** possible. Otherwise they remain as strings. Single-quoted - ** strings (ex: 'abc') are always string literals. - */ - case TK_STRING: { - if( pExpr->token.z[0]=='\'' ) break; - /* Fall thru into the TK_ID case if this is a double-quoted string */ - } - /* A lone identifier is the name of a columnd. - */ - case TK_ID: { - if( lookupName(pParse, 0, 0, &pExpr->token, pSrcList, pEList, pExpr) ){ - return 1; - } - break; - } - - /* A table name and column name: ID.ID - ** Or a database, table and column: ID.ID.ID - */ - case TK_DOT: { - Token *pColumn; - Token *pTable; - Token *pDb; - Expr *pRight; - - pRight = pExpr->pRight; - if( pRight->op==TK_ID ){ - pDb = 0; - pTable = &pExpr->pLeft->token; - pColumn = &pRight->token; - }else{ - assert( pRight->op==TK_DOT ); - pDb = &pExpr->pLeft->token; - pTable = &pRight->pLeft->token; - pColumn = &pRight->pRight->token; - } - if( lookupName(pParse, pDb, pTable, pColumn, pSrcList, 0, pExpr) ){ - return 1; - } - break; - } - - case TK_IN: { - Vdbe *v = sqliteGetVdbe(pParse); - if( v==0 ) return 1; - if( sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pLeft) ){ - return 1; - } - if( pExpr->pSelect ){ - /* Case 1: expr IN (SELECT ...) - ** - ** Generate code to write the results of the select into a temporary - ** table. The cursor number of the temporary table has already - ** been put in iTable by sqliteExprResolveInSelect(). - */ - pExpr->iTable = pParse->nTab++; - sqliteVdbeAddOp(v, OP_OpenTemp, pExpr->iTable, 1); - sqliteSelect(pParse, pExpr->pSelect, SRT_Set, pExpr->iTable, 0,0,0); - }else if( pExpr->pList ){ - /* Case 2: expr IN (exprlist) - ** - ** Create a set to put the exprlist values in. The Set id is stored - ** in iTable. - */ - int i, iSet; - for(i=0; ipList->nExpr; i++){ - Expr *pE2 = pExpr->pList->a[i].pExpr; - if( !sqliteExprIsConstant(pE2) ){ - sqliteErrorMsg(pParse, - "right-hand side of IN operator must be constant"); - return 1; - } - if( sqliteExprCheck(pParse, pE2, 0, 0) ){ - return 1; - } - } - iSet = pExpr->iTable = pParse->nSet++; - for(i=0; ipList->nExpr; i++){ - Expr *pE2 = pExpr->pList->a[i].pExpr; - switch( pE2->op ){ - case TK_FLOAT: - case TK_INTEGER: - case TK_STRING: { - int addr; - assert( pE2->token.z ); - addr = sqliteVdbeOp3(v, OP_SetInsert, iSet, 0, - pE2->token.z, pE2->token.n); - sqliteVdbeDequoteP3(v, addr); - break; - } - default: { - sqliteExprCode(pParse, pE2); - sqliteVdbeAddOp(v, OP_SetInsert, iSet, 0); - break; - } - } - } - } - break; - } - - case TK_SELECT: { - /* This has to be a scalar SELECT. Generate code to put the - ** value of this select in a memory cell and record the number - ** of the memory cell in iColumn. - */ - pExpr->iColumn = pParse->nMem++; - if( sqliteSelect(pParse, pExpr->pSelect, SRT_Mem, pExpr->iColumn,0,0,0) ){ - return 1; - } - break; - } - - /* For all else, just recursively walk the tree */ - default: { - if( pExpr->pLeft - && sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pLeft) ){ - return 1; - } - if( pExpr->pRight - && sqliteExprResolveIds(pParse, pSrcList, pEList, pExpr->pRight) ){ - return 1; - } - if( pExpr->pList ){ - int i; - ExprList *pList = pExpr->pList; - for(i=0; inExpr; i++){ - Expr *pArg = pList->a[i].pExpr; - if( sqliteExprResolveIds(pParse, pSrcList, pEList, pArg) ){ - return 1; - } - } - } - } - } - return 0; -} - -/* -** pExpr is a node that defines a function of some kind. It might -** be a syntactic function like "count(x)" or it might be a function -** that implements an operator, like "a LIKE b". -** -** This routine makes *pzName point to the name of the function and -** *pnName hold the number of characters in the function name. -*/ -static void getFunctionName(Expr *pExpr, const char **pzName, int *pnName){ - switch( pExpr->op ){ - case TK_FUNCTION: { - *pzName = pExpr->token.z; - *pnName = pExpr->token.n; - break; - } - case TK_LIKE: { - *pzName = "like"; - *pnName = 4; - break; - } - case TK_GLOB: { - *pzName = "glob"; - *pnName = 4; - break; - } - default: { - *pzName = "can't happen"; - *pnName = 12; - break; - } - } -} - -/* -** Error check the functions in an expression. Make sure all -** function names are recognized and all functions have the correct -** number of arguments. Leave an error message in pParse->zErrMsg -** if anything is amiss. Return the number of errors. -** -** if pIsAgg is not null and this expression is an aggregate function -** (like count(*) or max(value)) then write a 1 into *pIsAgg. -*/ -int sqliteExprCheck(Parse *pParse, Expr *pExpr, int allowAgg, int *pIsAgg){ - int nErr = 0; - if( pExpr==0 ) return 0; - switch( pExpr->op ){ - case TK_GLOB: - case TK_LIKE: - case TK_FUNCTION: { - int n = pExpr->pList ? pExpr->pList->nExpr : 0; /* Number of arguments */ - int no_such_func = 0; /* True if no such function exists */ - int wrong_num_args = 0; /* True if wrong number of arguments */ - int is_agg = 0; /* True if is an aggregate function */ - int i; - int nId; /* Number of characters in function name */ - const char *zId; /* The function name. */ - FuncDef *pDef; - - getFunctionName(pExpr, &zId, &nId); - pDef = sqliteFindFunction(pParse->db, zId, nId, n, 0); - if( pDef==0 ){ - pDef = sqliteFindFunction(pParse->db, zId, nId, -1, 0); - if( pDef==0 ){ - no_such_func = 1; - }else{ - wrong_num_args = 1; - } - }else{ - is_agg = pDef->xFunc==0; - } - if( is_agg && !allowAgg ){ - sqliteErrorMsg(pParse, "misuse of aggregate function %.*s()", nId, zId); - nErr++; - is_agg = 0; - }else if( no_such_func ){ - sqliteErrorMsg(pParse, "no such function: %.*s", nId, zId); - nErr++; - }else if( wrong_num_args ){ - sqliteErrorMsg(pParse,"wrong number of arguments to function %.*s()", - nId, zId); - nErr++; - } - if( is_agg ){ - pExpr->op = TK_AGG_FUNCTION; - if( pIsAgg ) *pIsAgg = 1; - } - for(i=0; nErr==0 && ipList->a[i].pExpr, - allowAgg && !is_agg, pIsAgg); - } - if( pDef==0 ){ - /* Already reported an error */ - }else if( pDef->dataType>=0 ){ - if( pDef->dataTypedataType = - sqliteExprType(pExpr->pList->a[pDef->dataType].pExpr); - }else{ - pExpr->dataType = SQLITE_SO_NUM; - } - }else if( pDef->dataType==SQLITE_ARGS ){ - pDef->dataType = SQLITE_SO_TEXT; - for(i=0; ipList->a[i].pExpr)==SQLITE_SO_NUM ){ - pExpr->dataType = SQLITE_SO_NUM; - break; - } - } - }else if( pDef->dataType==SQLITE_NUMERIC ){ - pExpr->dataType = SQLITE_SO_NUM; - }else{ - pExpr->dataType = SQLITE_SO_TEXT; - } - } - default: { - if( pExpr->pLeft ){ - nErr = sqliteExprCheck(pParse, pExpr->pLeft, allowAgg, pIsAgg); - } - if( nErr==0 && pExpr->pRight ){ - nErr = sqliteExprCheck(pParse, pExpr->pRight, allowAgg, pIsAgg); - } - if( nErr==0 && pExpr->pList ){ - int n = pExpr->pList->nExpr; - int i; - for(i=0; nErr==0 && ipList->a[i].pExpr; - nErr = sqliteExprCheck(pParse, pE2, allowAgg, pIsAgg); - } - } - break; - } - } - return nErr; -} - -/* -** Return either SQLITE_SO_NUM or SQLITE_SO_TEXT to indicate whether the -** given expression should sort as numeric values or as text. -** -** The sqliteExprResolveIds() and sqliteExprCheck() routines must have -** both been called on the expression before it is passed to this routine. -*/ -int sqliteExprType(Expr *p){ - if( p==0 ) return SQLITE_SO_NUM; - while( p ) switch( p->op ){ - case TK_PLUS: - case TK_MINUS: - case TK_STAR: - case TK_SLASH: - case TK_AND: - case TK_OR: - case TK_ISNULL: - case TK_NOTNULL: - case TK_NOT: - case TK_UMINUS: - case TK_UPLUS: - case TK_BITAND: - case TK_BITOR: - case TK_BITNOT: - case TK_LSHIFT: - case TK_RSHIFT: - case TK_REM: - case TK_INTEGER: - case TK_FLOAT: - case TK_IN: - case TK_BETWEEN: - case TK_GLOB: - case TK_LIKE: - return SQLITE_SO_NUM; - - case TK_STRING: - case TK_NULL: - case TK_CONCAT: - case TK_VARIABLE: - return SQLITE_SO_TEXT; - - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: - if( sqliteExprType(p->pLeft)==SQLITE_SO_NUM ){ - return SQLITE_SO_NUM; - } - p = p->pRight; - break; - - case TK_AS: - p = p->pLeft; - break; - - case TK_COLUMN: - case TK_FUNCTION: - case TK_AGG_FUNCTION: - return p->dataType; - - case TK_SELECT: - assert( p->pSelect ); - assert( p->pSelect->pEList ); - assert( p->pSelect->pEList->nExpr>0 ); - p = p->pSelect->pEList->a[0].pExpr; - break; - - case TK_CASE: { - if( p->pRight && sqliteExprType(p->pRight)==SQLITE_SO_NUM ){ - return SQLITE_SO_NUM; - } - if( p->pList ){ - int i; - ExprList *pList = p->pList; - for(i=1; inExpr; i+=2){ - if( sqliteExprType(pList->a[i].pExpr)==SQLITE_SO_NUM ){ - return SQLITE_SO_NUM; - } - } - } - return SQLITE_SO_TEXT; - } - - default: - assert( p->op==TK_ABORT ); /* Can't Happen */ - break; - } - return SQLITE_SO_NUM; -} - -/* -** Generate code into the current Vdbe to evaluate the given -** expression and leave the result on the top of stack. -*/ -void sqliteExprCode(Parse *pParse, Expr *pExpr){ - Vdbe *v = pParse->pVdbe; - int op; - if( v==0 || pExpr==0 ) return; - switch( pExpr->op ){ - case TK_PLUS: op = OP_Add; break; - case TK_MINUS: op = OP_Subtract; break; - case TK_STAR: op = OP_Multiply; break; - case TK_SLASH: op = OP_Divide; break; - case TK_AND: op = OP_And; break; - case TK_OR: op = OP_Or; break; - case TK_LT: op = OP_Lt; break; - case TK_LE: op = OP_Le; break; - case TK_GT: op = OP_Gt; break; - case TK_GE: op = OP_Ge; break; - case TK_NE: op = OP_Ne; break; - case TK_EQ: op = OP_Eq; break; - case TK_ISNULL: op = OP_IsNull; break; - case TK_NOTNULL: op = OP_NotNull; break; - case TK_NOT: op = OP_Not; break; - case TK_UMINUS: op = OP_Negative; break; - case TK_BITAND: op = OP_BitAnd; break; - case TK_BITOR: op = OP_BitOr; break; - case TK_BITNOT: op = OP_BitNot; break; - case TK_LSHIFT: op = OP_ShiftLeft; break; - case TK_RSHIFT: op = OP_ShiftRight; break; - case TK_REM: op = OP_Remainder; break; - default: break; - } - switch( pExpr->op ){ - case TK_COLUMN: { - if( pParse->useAgg ){ - sqliteVdbeAddOp(v, OP_AggGet, 0, pExpr->iAgg); - }else if( pExpr->iColumn>=0 ){ - sqliteVdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn); - }else{ - sqliteVdbeAddOp(v, OP_Recno, pExpr->iTable, 0); - } - break; - } - case TK_STRING: - case TK_FLOAT: - case TK_INTEGER: { - if( pExpr->op==TK_INTEGER && sqliteFitsIn32Bits(pExpr->token.z) ){ - sqliteVdbeAddOp(v, OP_Integer, atoi(pExpr->token.z), 0); - }else{ - sqliteVdbeAddOp(v, OP_String, 0, 0); - } - assert( pExpr->token.z ); - sqliteVdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n); - sqliteVdbeDequoteP3(v, -1); - break; - } - case TK_NULL: { - sqliteVdbeAddOp(v, OP_String, 0, 0); - break; - } - case TK_VARIABLE: { - sqliteVdbeAddOp(v, OP_Variable, pExpr->iTable, 0); - break; - } - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ - op += 6; /* Convert numeric opcodes to text opcodes */ - } - /* Fall through into the next case */ - } - case TK_AND: - case TK_OR: - case TK_PLUS: - case TK_STAR: - case TK_MINUS: - case TK_REM: - case TK_BITAND: - case TK_BITOR: - case TK_SLASH: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteExprCode(pParse, pExpr->pRight); - sqliteVdbeAddOp(v, op, 0, 0); - break; - } - case TK_LSHIFT: - case TK_RSHIFT: { - sqliteExprCode(pParse, pExpr->pRight); - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, op, 0, 0); - break; - } - case TK_CONCAT: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteExprCode(pParse, pExpr->pRight); - sqliteVdbeAddOp(v, OP_Concat, 2, 0); - break; - } - case TK_UMINUS: { - assert( pExpr->pLeft ); - if( pExpr->pLeft->op==TK_FLOAT || pExpr->pLeft->op==TK_INTEGER ){ - Token *p = &pExpr->pLeft->token; - char *z = sqliteMalloc( p->n + 2 ); - sprintf(z, "-%.*s", p->n, p->z); - if( pExpr->pLeft->op==TK_INTEGER && sqliteFitsIn32Bits(z) ){ - sqliteVdbeAddOp(v, OP_Integer, atoi(z), 0); - }else{ - sqliteVdbeAddOp(v, OP_String, 0, 0); - } - sqliteVdbeChangeP3(v, -1, z, p->n+1); - sqliteFree(z); - break; - } - /* Fall through into TK_NOT */ - } - case TK_BITNOT: - case TK_NOT: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, op, 0, 0); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - int dest; - sqliteVdbeAddOp(v, OP_Integer, 1, 0); - sqliteExprCode(pParse, pExpr->pLeft); - dest = sqliteVdbeCurrentAddr(v) + 2; - sqliteVdbeAddOp(v, op, 1, dest); - sqliteVdbeAddOp(v, OP_AddImm, -1, 0); - break; - } - case TK_AGG_FUNCTION: { - sqliteVdbeAddOp(v, OP_AggGet, 0, pExpr->iAgg); - break; - } - case TK_GLOB: - case TK_LIKE: - case TK_FUNCTION: { - ExprList *pList = pExpr->pList; - int nExpr = pList ? pList->nExpr : 0; - FuncDef *pDef; - int nId; - const char *zId; - getFunctionName(pExpr, &zId, &nId); - pDef = sqliteFindFunction(pParse->db, zId, nId, nExpr, 0); - assert( pDef!=0 ); - nExpr = sqliteExprCodeExprList(pParse, pList, pDef->includeTypes); - sqliteVdbeOp3(v, OP_Function, nExpr, 0, (char*)pDef, P3_POINTER); - break; - } - case TK_SELECT: { - sqliteVdbeAddOp(v, OP_MemLoad, pExpr->iColumn, 0); - break; - } - case TK_IN: { - int addr; - sqliteVdbeAddOp(v, OP_Integer, 1, 0); - sqliteExprCode(pParse, pExpr->pLeft); - addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeAddOp(v, OP_NotNull, -1, addr+4); - sqliteVdbeAddOp(v, OP_Pop, 2, 0); - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, addr+6); - if( pExpr->pSelect ){ - sqliteVdbeAddOp(v, OP_Found, pExpr->iTable, addr+6); - }else{ - sqliteVdbeAddOp(v, OP_SetFound, pExpr->iTable, addr+6); - } - sqliteVdbeAddOp(v, OP_AddImm, -1, 0); - break; - } - case TK_BETWEEN: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); - sqliteVdbeAddOp(v, OP_Ge, 0, 0); - sqliteVdbeAddOp(v, OP_Pull, 1, 0); - sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); - sqliteVdbeAddOp(v, OP_Le, 0, 0); - sqliteVdbeAddOp(v, OP_And, 0, 0); - break; - } - case TK_UPLUS: - case TK_AS: { - sqliteExprCode(pParse, pExpr->pLeft); - break; - } - case TK_CASE: { - int expr_end_label; - int jumpInst; - int addr; - int nExpr; - int i; - - assert(pExpr->pList); - assert((pExpr->pList->nExpr % 2) == 0); - assert(pExpr->pList->nExpr > 0); - nExpr = pExpr->pList->nExpr; - expr_end_label = sqliteVdbeMakeLabel(v); - if( pExpr->pLeft ){ - sqliteExprCode(pParse, pExpr->pLeft); - } - for(i=0; ipList->a[i].pExpr); - if( pExpr->pLeft ){ - sqliteVdbeAddOp(v, OP_Dup, 1, 1); - jumpInst = sqliteVdbeAddOp(v, OP_Ne, 1, 0); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - }else{ - jumpInst = sqliteVdbeAddOp(v, OP_IfNot, 1, 0); - } - sqliteExprCode(pParse, pExpr->pList->a[i+1].pExpr); - sqliteVdbeAddOp(v, OP_Goto, 0, expr_end_label); - addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeChangeP2(v, jumpInst, addr); - } - if( pExpr->pLeft ){ - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - } - if( pExpr->pRight ){ - sqliteExprCode(pParse, pExpr->pRight); - }else{ - sqliteVdbeAddOp(v, OP_String, 0, 0); - } - sqliteVdbeResolveLabel(v, expr_end_label); - break; - } - case TK_RAISE: { - if( !pParse->trigStack ){ - sqliteErrorMsg(pParse, - "RAISE() may only be used within a trigger-program"); - pParse->nErr++; - return; - } - if( pExpr->iColumn == OE_Rollback || - pExpr->iColumn == OE_Abort || - pExpr->iColumn == OE_Fail ){ - sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn, - pExpr->token.z, pExpr->token.n); - sqliteVdbeDequoteP3(v, -1); - } else { - assert( pExpr->iColumn == OE_Ignore ); - sqliteVdbeOp3(v, OP_Goto, 0, pParse->trigStack->ignoreJump, - "(IGNORE jump)", 0); - } - } - break; - } -} - -/* -** Generate code that pushes the value of every element of the given -** expression list onto the stack. If the includeTypes flag is true, -** then also push a string that is the datatype of each element onto -** the stack after the value. -** -** Return the number of elements pushed onto the stack. -*/ -int sqliteExprCodeExprList( - Parse *pParse, /* Parsing context */ - ExprList *pList, /* The expression list to be coded */ - int includeTypes /* TRUE to put datatypes on the stack too */ -){ - struct ExprList_item *pItem; - int i, n; - Vdbe *v; - if( pList==0 ) return 0; - v = sqliteGetVdbe(pParse); - n = pList->nExpr; - for(pItem=pList->a, i=0; ipExpr); - if( includeTypes ){ - sqliteVdbeOp3(v, OP_String, 0, 0, - sqliteExprType(pItem->pExpr)==SQLITE_SO_NUM ? "numeric" : "text", - P3_STATIC); - } - } - return includeTypes ? n*2 : n; -} - -/* -** Generate code for a boolean expression such that a jump is made -** to the label "dest" if the expression is true but execution -** continues straight thru if the expression is false. -** -** If the expression evaluates to NULL (neither true nor false), then -** take the jump if the jumpIfNull flag is true. -*/ -void sqliteExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ - Vdbe *v = pParse->pVdbe; - int op = 0; - if( v==0 || pExpr==0 ) return; - switch( pExpr->op ){ - case TK_LT: op = OP_Lt; break; - case TK_LE: op = OP_Le; break; - case TK_GT: op = OP_Gt; break; - case TK_GE: op = OP_Ge; break; - case TK_NE: op = OP_Ne; break; - case TK_EQ: op = OP_Eq; break; - case TK_ISNULL: op = OP_IsNull; break; - case TK_NOTNULL: op = OP_NotNull; break; - default: break; - } - switch( pExpr->op ){ - case TK_AND: { - int d2 = sqliteVdbeMakeLabel(v); - sqliteExprIfFalse(pParse, pExpr->pLeft, d2, !jumpIfNull); - sqliteExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - sqliteVdbeResolveLabel(v, d2); - break; - } - case TK_OR: { - sqliteExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); - sqliteExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - break; - } - case TK_NOT: { - sqliteExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); - break; - } - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteExprCode(pParse, pExpr->pRight); - if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ - op += 6; /* Convert numeric opcodes to text opcodes */ - } - sqliteVdbeAddOp(v, op, jumpIfNull, dest); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, op, 1, dest); - break; - } - case TK_IN: { - int addr; - sqliteExprCode(pParse, pExpr->pLeft); - addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeAddOp(v, OP_NotNull, -1, addr+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, jumpIfNull ? dest : addr+4); - if( pExpr->pSelect ){ - sqliteVdbeAddOp(v, OP_Found, pExpr->iTable, dest); - }else{ - sqliteVdbeAddOp(v, OP_SetFound, pExpr->iTable, dest); - } - break; - } - case TK_BETWEEN: { - int addr; - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); - addr = sqliteVdbeAddOp(v, OP_Lt, !jumpIfNull, 0); - sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); - sqliteVdbeAddOp(v, OP_Le, jumpIfNull, dest); - sqliteVdbeAddOp(v, OP_Integer, 0, 0); - sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - break; - } - default: { - sqliteExprCode(pParse, pExpr); - sqliteVdbeAddOp(v, OP_If, jumpIfNull, dest); - break; - } - } -} - -/* -** Generate code for a boolean expression such that a jump is made -** to the label "dest" if the expression is false but execution -** continues straight thru if the expression is true. -** -** If the expression evaluates to NULL (neither true nor false) then -** jump if jumpIfNull is true or fall through if jumpIfNull is false. -*/ -void sqliteExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ - Vdbe *v = pParse->pVdbe; - int op = 0; - if( v==0 || pExpr==0 ) return; - switch( pExpr->op ){ - case TK_LT: op = OP_Ge; break; - case TK_LE: op = OP_Gt; break; - case TK_GT: op = OP_Le; break; - case TK_GE: op = OP_Lt; break; - case TK_NE: op = OP_Eq; break; - case TK_EQ: op = OP_Ne; break; - case TK_ISNULL: op = OP_NotNull; break; - case TK_NOTNULL: op = OP_IsNull; break; - default: break; - } - switch( pExpr->op ){ - case TK_AND: { - sqliteExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); - sqliteExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - break; - } - case TK_OR: { - int d2 = sqliteVdbeMakeLabel(v); - sqliteExprIfTrue(pParse, pExpr->pLeft, d2, !jumpIfNull); - sqliteExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - sqliteVdbeResolveLabel(v, d2); - break; - } - case TK_NOT: { - sqliteExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); - break; - } - case TK_LT: - case TK_LE: - case TK_GT: - case TK_GE: - case TK_NE: - case TK_EQ: { - if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ - /* Convert numeric comparison opcodes into text comparison opcodes. - ** This step depends on the fact that the text comparision opcodes are - ** always 6 greater than their corresponding numeric comparison - ** opcodes. - */ - assert( OP_Eq+6 == OP_StrEq ); - op += 6; - } - sqliteExprCode(pParse, pExpr->pLeft); - sqliteExprCode(pParse, pExpr->pRight); - sqliteVdbeAddOp(v, op, jumpIfNull, dest); - break; - } - case TK_ISNULL: - case TK_NOTNULL: { - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, op, 1, dest); - break; - } - case TK_IN: { - int addr; - sqliteExprCode(pParse, pExpr->pLeft); - addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeAddOp(v, OP_NotNull, -1, addr+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, jumpIfNull ? dest : addr+4); - if( pExpr->pSelect ){ - sqliteVdbeAddOp(v, OP_NotFound, pExpr->iTable, dest); - }else{ - sqliteVdbeAddOp(v, OP_SetNotFound, pExpr->iTable, dest); - } - break; - } - case TK_BETWEEN: { - int addr; - sqliteExprCode(pParse, pExpr->pLeft); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - sqliteExprCode(pParse, pExpr->pList->a[0].pExpr); - addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeAddOp(v, OP_Ge, !jumpIfNull, addr+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, dest); - sqliteExprCode(pParse, pExpr->pList->a[1].pExpr); - sqliteVdbeAddOp(v, OP_Gt, jumpIfNull, dest); - break; - } - default: { - sqliteExprCode(pParse, pExpr); - sqliteVdbeAddOp(v, OP_IfNot, jumpIfNull, dest); - break; - } - } -} - -/* -** Do a deep comparison of two expression trees. Return TRUE (non-zero) -** if they are identical and return FALSE if they differ in any way. -*/ -int sqliteExprCompare(Expr *pA, Expr *pB){ - int i; - if( pA==0 ){ - return pB==0; - }else if( pB==0 ){ - return 0; - } - if( pA->op!=pB->op ) return 0; - if( !sqliteExprCompare(pA->pLeft, pB->pLeft) ) return 0; - if( !sqliteExprCompare(pA->pRight, pB->pRight) ) return 0; - if( pA->pList ){ - if( pB->pList==0 ) return 0; - if( pA->pList->nExpr!=pB->pList->nExpr ) return 0; - for(i=0; ipList->nExpr; i++){ - if( !sqliteExprCompare(pA->pList->a[i].pExpr, pB->pList->a[i].pExpr) ){ - return 0; - } - } - }else if( pB->pList ){ - return 0; - } - if( pA->pSelect || pB->pSelect ) return 0; - if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0; - if( pA->token.z ){ - if( pB->token.z==0 ) return 0; - if( pB->token.n!=pA->token.n ) return 0; - if( sqliteStrNICmp(pA->token.z, pB->token.z, pB->token.n)!=0 ) return 0; - } - return 1; -} - -/* -** Add a new element to the pParse->aAgg[] array and return its index. -*/ -static int appendAggInfo(Parse *pParse){ - if( (pParse->nAgg & 0x7)==0 ){ - int amt = pParse->nAgg + 8; - AggExpr *aAgg = sqliteRealloc(pParse->aAgg, amt*sizeof(pParse->aAgg[0])); - if( aAgg==0 ){ - return -1; - } - pParse->aAgg = aAgg; - } - memset(&pParse->aAgg[pParse->nAgg], 0, sizeof(pParse->aAgg[0])); - return pParse->nAgg++; -} - -/* -** Analyze the given expression looking for aggregate functions and -** for variables that need to be added to the pParse->aAgg[] array. -** Make additional entries to the pParse->aAgg[] array as necessary. -** -** This routine should only be called after the expression has been -** analyzed by sqliteExprResolveIds() and sqliteExprCheck(). -** -** If errors are seen, leave an error message in zErrMsg and return -** the number of errors. -*/ -int sqliteExprAnalyzeAggregates(Parse *pParse, Expr *pExpr){ - int i; - AggExpr *aAgg; - int nErr = 0; - - if( pExpr==0 ) return 0; - switch( pExpr->op ){ - case TK_COLUMN: { - aAgg = pParse->aAgg; - for(i=0; inAgg; i++){ - if( aAgg[i].isAgg ) continue; - if( aAgg[i].pExpr->iTable==pExpr->iTable - && aAgg[i].pExpr->iColumn==pExpr->iColumn ){ - break; - } - } - if( i>=pParse->nAgg ){ - i = appendAggInfo(pParse); - if( i<0 ) return 1; - pParse->aAgg[i].isAgg = 0; - pParse->aAgg[i].pExpr = pExpr; - } - pExpr->iAgg = i; - break; - } - case TK_AGG_FUNCTION: { - aAgg = pParse->aAgg; - for(i=0; inAgg; i++){ - if( !aAgg[i].isAgg ) continue; - if( sqliteExprCompare(aAgg[i].pExpr, pExpr) ){ - break; - } - } - if( i>=pParse->nAgg ){ - i = appendAggInfo(pParse); - if( i<0 ) return 1; - pParse->aAgg[i].isAgg = 1; - pParse->aAgg[i].pExpr = pExpr; - pParse->aAgg[i].pFunc = sqliteFindFunction(pParse->db, - pExpr->token.z, pExpr->token.n, - pExpr->pList ? pExpr->pList->nExpr : 0, 0); - } - pExpr->iAgg = i; - break; - } - default: { - if( pExpr->pLeft ){ - nErr = sqliteExprAnalyzeAggregates(pParse, pExpr->pLeft); - } - if( nErr==0 && pExpr->pRight ){ - nErr = sqliteExprAnalyzeAggregates(pParse, pExpr->pRight); - } - if( nErr==0 && pExpr->pList ){ - int n = pExpr->pList->nExpr; - int i; - for(i=0; nErr==0 && ipList->a[i].pExpr); - } - } - break; - } - } - return nErr; -} - -/* -** Locate a user function given a name and a number of arguments. -** Return a pointer to the FuncDef structure that defines that -** function, or return NULL if the function does not exist. -** -** If the createFlag argument is true, then a new (blank) FuncDef -** structure is created and liked into the "db" structure if a -** no matching function previously existed. When createFlag is true -** and the nArg parameter is -1, then only a function that accepts -** any number of arguments will be returned. -** -** If createFlag is false and nArg is -1, then the first valid -** function found is returned. A function is valid if either xFunc -** or xStep is non-zero. -*/ -FuncDef *sqliteFindFunction( - sqlite *db, /* An open database */ - const char *zName, /* Name of the function. Not null-terminated */ - int nName, /* Number of characters in the name */ - int nArg, /* Number of arguments. -1 means any number */ - int createFlag /* Create new entry if true and does not otherwise exist */ -){ - FuncDef *pFirst, *p, *pMaybe; - pFirst = p = (FuncDef*)sqliteHashFind(&db->aFunc, zName, nName); - if( p && !createFlag && nArg<0 ){ - while( p && p->xFunc==0 && p->xStep==0 ){ p = p->pNext; } - return p; - } - pMaybe = 0; - while( p && p->nArg!=nArg ){ - if( p->nArg<0 && !createFlag && (p->xFunc || p->xStep) ) pMaybe = p; - p = p->pNext; - } - if( p && !createFlag && p->xFunc==0 && p->xStep==0 ){ - return 0; - } - if( p==0 && pMaybe ){ - assert( createFlag==0 ); - return pMaybe; - } - if( p==0 && createFlag && (p = sqliteMalloc(sizeof(*p)))!=0 ){ - p->nArg = nArg; - p->pNext = pFirst; - p->dataType = pFirst ? pFirst->dataType : SQLITE_NUMERIC; - sqliteHashInsert(&db->aFunc, zName, nName, (void*)p); - } - return p; -} diff --git a/ext/sqlite/libsqlite/src/func.c b/ext/sqlite/libsqlite/src/func.c deleted file mode 100644 index 8d6012eff7dcc..0000000000000 --- a/ext/sqlite/libsqlite/src/func.c +++ /dev/null @@ -1,658 +0,0 @@ -/* -** 2002 February 23 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement various SQL -** functions of SQLite. -** -** There is only one exported symbol in this file - the function -** sqliteRegisterBuildinFunctions() found at the bottom of the file. -** All other code has file scope. -** -** $Id$ -*/ -#include -#include -#include -#include -#include "sqliteInt.h" -#include "os.h" - -/* -** Implementation of the non-aggregate min() and max() functions -*/ -static void minmaxFunc(sqlite_func *context, int argc, const char **argv){ - const char *zBest; - int i; - int (*xCompare)(const char*, const char*); - int mask; /* 0 for min() or 0xffffffff for max() */ - - if( argc==0 ) return; - mask = (int)sqlite_user_data(context); - zBest = argv[0]; - if( zBest==0 ) return; - if( argv[1][0]=='n' ){ - xCompare = sqliteCompare; - }else{ - xCompare = strcmp; - } - for(i=2; i0 ){ - p1--; - } - if( p1+p2>len ){ - p2 = len-p1; - } -#ifdef SQLITE_UTF8 - for(i=0; i30 ) n = 30; - if( n<0 ) n = 0; - r = sqliteAtoF(argv[0], 0); - sprintf(zBuf,"%.*f",n,r); - sqlite_set_result_string(context, zBuf, -1); -} - -/* -** Implementation of the upper() and lower() SQL functions. -*/ -static void upperFunc(sqlite_func *context, int argc, const char **argv){ - unsigned char *z; - int i; - if( argc<1 || argv[0]==0 ) return; - z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); - if( z==0 ) return; - for(i=0; z[i]; i++){ - if( islower(z[i]) ) z[i] = toupper(z[i]); - } -} -static void lowerFunc(sqlite_func *context, int argc, const char **argv){ - unsigned char *z; - int i; - if( argc<1 || argv[0]==0 ) return; - z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); - if( z==0 ) return; - for(i=0; z[i]; i++){ - if( isupper(z[i]) ) z[i] = tolower(z[i]); - } -} - -/* -** Implementation of the IFNULL(), NVL(), and COALESCE() functions. -** All three do the same thing. They return the first non-NULL -** argument. -*/ -static void ifnullFunc(sqlite_func *context, int argc, const char **argv){ - int i; - for(i=0; i0 ){ - zResult[j++] = code + '0'; - } - } - while( j<4 ){ - zResult[j++] = '0'; - } - zResult[j] = 0; - sqlite_set_result_string(context, zResult, 4); - }else{ - sqlite_set_result_string(context, "?000", 4); - } -} -#endif - -#ifdef SQLITE_TEST -/* -** This function generates a string of random characters. Used for -** generating test data. -*/ -static void randStr(sqlite_func *context, int argc, const char **argv){ - static const unsigned char zSrc[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789" - ".-!,:*^+=_|?/<> "; - int iMin, iMax, n, r, i; - unsigned char zBuf[1000]; - if( argc>=1 ){ - iMin = atoi(argv[0]); - if( iMin<0 ) iMin = 0; - if( iMin>=sizeof(zBuf) ) iMin = sizeof(zBuf)-1; - }else{ - iMin = 1; - } - if( argc>=2 ){ - iMax = atoi(argv[1]); - if( iMax=sizeof(zBuf) ) iMax = sizeof(zBuf)-1; - }else{ - iMax = 50; - } - n = iMin; - if( iMax>iMin ){ - sqliteRandomness(sizeof(r), &r); - r &= 0x7fffffff; - n += r%(iMax + 1 - iMin); - } - assert( nsum += sqliteAtoF(argv[0], 0); - p->cnt++; - } -} -static void sumFinalize(sqlite_func *context){ - SumCtx *p; - p = sqlite_aggregate_context(context, sizeof(*p)); - sqlite_set_result_double(context, p ? p->sum : 0.0); -} -static void avgFinalize(sqlite_func *context){ - SumCtx *p; - p = sqlite_aggregate_context(context, sizeof(*p)); - if( p && p->cnt>0 ){ - sqlite_set_result_double(context, p->sum/(double)p->cnt); - } -} - -/* -** An instance of the following structure holds the context of a -** variance or standard deviation computation. -*/ -typedef struct StdDevCtx StdDevCtx; -struct StdDevCtx { - double sum; /* Sum of terms */ - double sum2; /* Sum of the squares of terms */ - int cnt; /* Number of terms counted */ -}; - -#if 0 /* Omit because math library is required */ -/* -** Routines used to compute the standard deviation as an aggregate. -*/ -static void stdDevStep(sqlite_func *context, int argc, const char **argv){ - StdDevCtx *p; - double x; - if( argc<1 ) return; - p = sqlite_aggregate_context(context, sizeof(*p)); - if( p && argv[0] ){ - x = sqliteAtoF(argv[0], 0); - p->sum += x; - p->sum2 += x*x; - p->cnt++; - } -} -static void stdDevFinalize(sqlite_func *context){ - double rN = sqlite_aggregate_count(context); - StdDevCtx *p = sqlite_aggregate_context(context, sizeof(*p)); - if( p && p->cnt>1 ){ - double rCnt = cnt; - sqlite_set_result_double(context, - sqrt((p->sum2 - p->sum*p->sum/rCnt)/(rCnt-1.0))); - } -} -#endif - -/* -** The following structure keeps track of state information for the -** count() aggregate function. -*/ -typedef struct CountCtx CountCtx; -struct CountCtx { - int n; -}; - -/* -** Routines to implement the count() aggregate function. -*/ -static void countStep(sqlite_func *context, int argc, const char **argv){ - CountCtx *p; - p = sqlite_aggregate_context(context, sizeof(*p)); - if( (argc==0 || argv[0]) && p ){ - p->n++; - } -} -static void countFinalize(sqlite_func *context){ - CountCtx *p; - p = sqlite_aggregate_context(context, sizeof(*p)); - sqlite_set_result_int(context, p ? p->n : 0); -} - -/* -** This function tracks state information for the min() and max() -** aggregate functions. -*/ -typedef struct MinMaxCtx MinMaxCtx; -struct MinMaxCtx { - char *z; /* The best so far */ - char zBuf[28]; /* Space that can be used for storage */ -}; - -/* -** Routines to implement min() and max() aggregate functions. -*/ -static void minmaxStep(sqlite_func *context, int argc, const char **argv){ - MinMaxCtx *p; - int (*xCompare)(const char*, const char*); - int mask; /* 0 for min() or 0xffffffff for max() */ - - assert( argc==2 ); - if( argv[0]==0 ) return; /* Ignore NULL values */ - if( argv[1][0]=='n' ){ - xCompare = sqliteCompare; - }else{ - xCompare = strcmp; - } - mask = (int)sqlite_user_data(context); - assert( mask==0 || mask==-1 ); - p = sqlite_aggregate_context(context, sizeof(*p)); - if( p==0 || argc<1 ) return; - if( p->z==0 || (xCompare(argv[0],p->z)^mask)<0 ){ - int len; - if( p->zBuf[0] ){ - sqliteFree(p->z); - } - len = strlen(argv[0]); - if( len < sizeof(p->zBuf)-1 ){ - p->z = &p->zBuf[1]; - p->zBuf[0] = 0; - }else{ - p->z = sqliteMalloc( len+1 ); - p->zBuf[0] = 1; - if( p->z==0 ) return; - } - strcpy(p->z, argv[0]); - } -} -static void minMaxFinalize(sqlite_func *context){ - MinMaxCtx *p; - p = sqlite_aggregate_context(context, sizeof(*p)); - if( p && p->z && p->zBuf[0]<2 ){ - sqlite_set_result_string(context, p->z, strlen(p->z)); - } - if( p && p->zBuf[0] ){ - sqliteFree(p->z); - } -} - -/* -** This function registered all of the above C functions as SQL -** functions. This should be the only routine in this file with -** external linkage. -*/ -void sqliteRegisterBuiltinFunctions(sqlite *db){ - static struct { - char *zName; - signed char nArg; - signed char dataType; - u8 argType; /* 0: none. 1: db 2: (-1) */ - void (*xFunc)(sqlite_func*,int,const char**); - } aFuncs[] = { - { "min", -1, SQLITE_ARGS, 0, minmaxFunc }, - { "min", 0, 0, 0, 0 }, - { "max", -1, SQLITE_ARGS, 2, minmaxFunc }, - { "max", 0, 0, 2, 0 }, - { "typeof", 1, SQLITE_TEXT, 0, typeofFunc }, - { "length", 1, SQLITE_NUMERIC, 0, lengthFunc }, - { "substr", 3, SQLITE_TEXT, 0, substrFunc }, - { "abs", 1, SQLITE_NUMERIC, 0, absFunc }, - { "round", 1, SQLITE_NUMERIC, 0, roundFunc }, - { "round", 2, SQLITE_NUMERIC, 0, roundFunc }, - { "upper", 1, SQLITE_TEXT, 0, upperFunc }, - { "lower", 1, SQLITE_TEXT, 0, lowerFunc }, - { "coalesce", -1, SQLITE_ARGS, 0, ifnullFunc }, - { "coalesce", 0, 0, 0, 0 }, - { "coalesce", 1, 0, 0, 0 }, - { "ifnull", 2, SQLITE_ARGS, 0, ifnullFunc }, - { "random", -1, SQLITE_NUMERIC, 0, randomFunc }, - { "like", 2, SQLITE_NUMERIC, 0, likeFunc }, - { "glob", 2, SQLITE_NUMERIC, 0, globFunc }, - { "nullif", 2, SQLITE_ARGS, 0, nullifFunc }, - { "sqlite_version",0,SQLITE_TEXT, 0, versionFunc}, - { "quote", 1, SQLITE_ARGS, 0, quoteFunc }, - { "last_insert_rowid", 0, SQLITE_NUMERIC, 1, last_insert_rowid }, - { "change_count", 0, SQLITE_NUMERIC, 1, change_count }, - { "last_statement_change_count", - 0, SQLITE_NUMERIC, 1, last_statement_change_count }, -#ifdef SQLITE_SOUNDEX - { "soundex", 1, SQLITE_TEXT, 0, soundexFunc}, -#endif -#ifdef SQLITE_TEST - { "randstr", 2, SQLITE_TEXT, 0, randStr }, -#endif - }; - static struct { - char *zName; - signed char nArg; - signed char dataType; - u8 argType; - void (*xStep)(sqlite_func*,int,const char**); - void (*xFinalize)(sqlite_func*); - } aAggs[] = { - { "min", 1, 0, 0, minmaxStep, minMaxFinalize }, - { "max", 1, 0, 2, minmaxStep, minMaxFinalize }, - { "sum", 1, SQLITE_NUMERIC, 0, sumStep, sumFinalize }, - { "avg", 1, SQLITE_NUMERIC, 0, sumStep, avgFinalize }, - { "count", 0, SQLITE_NUMERIC, 0, countStep, countFinalize }, - { "count", 1, SQLITE_NUMERIC, 0, countStep, countFinalize }, -#if 0 - { "stddev", 1, SQLITE_NUMERIC, 0, stdDevStep, stdDevFinalize }, -#endif - }; - static const char *azTypeFuncs[] = { "min", "max", "typeof" }; - int i; - - for(i=0; iaFunc, azTypeFuncs[i], n); - while( p ){ - p->includeTypes = 1; - p = p->pNext; - } - } - sqliteRegisterDateTimeFunctions(db); -} diff --git a/ext/sqlite/libsqlite/src/hash.c b/ext/sqlite/libsqlite/src/hash.c deleted file mode 100644 index 77be2807b2e6b..0000000000000 --- a/ext/sqlite/libsqlite/src/hash.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -** 2001 September 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the implementation of generic hash-tables -** used in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include - -/* Turn bulk memory into a hash table object by initializing the -** fields of the Hash structure. -** -** "new" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER, -** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass -** determines what kind of key the hash table will use. "copyKey" is -** true if the hash table should make its own private copy of keys and -** false if it should just use the supplied pointer. CopyKey only makes -** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored -** for other key classes. -*/ -void sqliteHashInit(Hash *new, int keyClass, int copyKey){ - assert( new!=0 ); - assert( keyClass>=SQLITE_HASH_INT && keyClass<=SQLITE_HASH_BINARY ); - new->keyClass = keyClass; - new->copyKey = copyKey && - (keyClass==SQLITE_HASH_STRING || keyClass==SQLITE_HASH_BINARY); - new->first = 0; - new->count = 0; - new->htsize = 0; - new->ht = 0; -} - -/* Remove all entries from a hash table. Reclaim all memory. -** Call this routine to delete a hash table or to reset a hash table -** to the empty state. -*/ -void sqliteHashClear(Hash *pH){ - HashElem *elem; /* For looping over all elements of the table */ - - assert( pH!=0 ); - elem = pH->first; - pH->first = 0; - if( pH->ht ) sqliteFree(pH->ht); - pH->ht = 0; - pH->htsize = 0; - while( elem ){ - HashElem *next_elem = elem->next; - if( pH->copyKey && elem->pKey ){ - sqliteFree(elem->pKey); - } - sqliteFree(elem); - elem = next_elem; - } - pH->count = 0; -} - -/* -** Hash and comparison functions when the mode is SQLITE_HASH_INT -*/ -static int intHash(const void *pKey, int nKey){ - return nKey ^ (nKey<<8) ^ (nKey>>8); -} -static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - return n2 - n1; -} - -#if 0 /* NOT USED */ -/* -** Hash and comparison functions when the mode is SQLITE_HASH_POINTER -*/ -static int ptrHash(const void *pKey, int nKey){ - uptr x = Addr(pKey); - return x ^ (x<<8) ^ (x>>8); -} -static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( pKey1==pKey2 ) return 0; - if( pKey1 0 ){ - h = (h<<3) ^ h ^ *(z++); - } - return h & 0x7fffffff; -} -static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( n1!=n2 ) return n2-n1; - return memcmp(pKey1,pKey2,n1); -} - -/* -** Return a pointer to the appropriate hash function given the key class. -** -** The C syntax in this function definition may be unfamilar to some -** programmers, so we provide the following additional explanation: -** -** The name of the function is "hashFunction". The function takes a -** single parameter "keyClass". The return value of hashFunction() -** is a pointer to another function. Specifically, the return value -** of hashFunction() is a pointer to a function that takes two parameters -** with types "const void*" and "int" and returns an "int". -*/ -static int (*hashFunction(int keyClass))(const void*,int){ - switch( keyClass ){ - case SQLITE_HASH_INT: return &intHash; - /* case SQLITE_HASH_POINTER: return &ptrHash; // NOT USED */ - case SQLITE_HASH_STRING: return &strHash; - case SQLITE_HASH_BINARY: return &binHash;; - default: break; - } - return 0; -} - -/* -** Return a pointer to the appropriate hash function given the key class. -** -** For help in interpreted the obscure C code in the function definition, -** see the header comment on the previous function. -*/ -static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ - switch( keyClass ){ - case SQLITE_HASH_INT: return &intCompare; - /* case SQLITE_HASH_POINTER: return &ptrCompare; // NOT USED */ - case SQLITE_HASH_STRING: return &strCompare; - case SQLITE_HASH_BINARY: return &binCompare; - default: break; - } - return 0; -} - - -/* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail -** to resize if sqliteMalloc() fails. -*/ -static void rehash(Hash *pH, int new_size){ - struct _ht *new_ht; /* The new hash table */ - HashElem *elem, *next_elem; /* For looping over existing elements */ - HashElem *x; /* Element being copied to new hash table */ - int (*xHash)(const void*,int); /* The hash function */ - - assert( (new_size & (new_size-1))==0 ); - new_ht = (struct _ht *)sqliteMalloc( new_size*sizeof(struct _ht) ); - if( new_ht==0 ) return; - if( pH->ht ) sqliteFree(pH->ht); - pH->ht = new_ht; - pH->htsize = new_size; - xHash = hashFunction(pH->keyClass); - for(elem=pH->first, pH->first=0; elem; elem = next_elem){ - int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); - next_elem = elem->next; - x = new_ht[h].chain; - if( x ){ - elem->next = x; - elem->prev = x->prev; - if( x->prev ) x->prev->next = elem; - else pH->first = elem; - x->prev = elem; - }else{ - elem->next = pH->first; - if( pH->first ) pH->first->prev = elem; - elem->prev = 0; - pH->first = elem; - } - new_ht[h].chain = elem; - new_ht[h].count++; - } -} - -/* This function (for internal use only) locates an element in an -** hash table that matches the given key. The hash for this key has -** already been computed and is passed as the 4th parameter. -*/ -static HashElem *findElementGivenHash( - const Hash *pH, /* The pH to be searched */ - const void *pKey, /* The key we are searching for */ - int nKey, - int h /* The hash for this key. */ -){ - HashElem *elem; /* Used to loop thru the element list */ - int count; /* Number of elements left to test */ - int (*xCompare)(const void*,int,const void*,int); /* comparison function */ - - if( pH->ht ){ - elem = pH->ht[h].chain; - count = pH->ht[h].count; - xCompare = compareFunction(pH->keyClass); - while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ - return elem; - } - elem = elem->next; - } - } - return 0; -} - -/* Remove a single entry from the hash table given a pointer to that -** element and a hash on the element's key. -*/ -static void removeElementGivenHash( - Hash *pH, /* The pH containing "elem" */ - HashElem* elem, /* The element to be removed from the pH */ - int h /* Hash value for the element */ -){ - if( elem->prev ){ - elem->prev->next = elem->next; - }else{ - pH->first = elem->next; - } - if( elem->next ){ - elem->next->prev = elem->prev; - } - if( pH->ht[h].chain==elem ){ - pH->ht[h].chain = elem->next; - } - pH->ht[h].count--; - if( pH->ht[h].count<=0 ){ - pH->ht[h].chain = 0; - } - if( pH->copyKey && elem->pKey ){ - sqliteFree(elem->pKey); - } - sqliteFree( elem ); - pH->count--; -} - -/* Attempt to locate an element of the hash table pH with a key -** that matches pKey,nKey. Return the data for this element if it is -** found, or NULL if there is no match. -*/ -void *sqliteHashFind(const Hash *pH, const void *pKey, int nKey){ - int h; /* A hash on key */ - HashElem *elem; /* The element that matches key */ - int (*xHash)(const void*,int); /* The hash function */ - - if( pH==0 || pH->ht==0 ) return 0; - xHash = hashFunction(pH->keyClass); - assert( xHash!=0 ); - h = (*xHash)(pKey,nKey); - assert( (pH->htsize & (pH->htsize-1))==0 ); - elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); - return elem ? elem->data : 0; -} - -/* Insert an element into the hash table pH. The key is pKey,nKey -** and the data is "data". -** -** If no element exists with a matching key, then a new -** element is created. A copy of the key is made if the copyKey -** flag is set. NULL is returned. -** -** If another element already exists with the same key, then the -** new data replaces the old data and the old data is returned. -** The key is not copied in this instance. If a malloc fails, then -** the new data is returned and the hash table is unchanged. -** -** If the "data" parameter to this function is NULL, then the -** element corresponding to "key" is removed from the hash table. -*/ -void *sqliteHashInsert(Hash *pH, const void *pKey, int nKey, void *data){ - int hraw; /* Raw hash value of the key */ - int h; /* the hash of the key modulo hash table size */ - HashElem *elem; /* Used to loop thru the element list */ - HashElem *new_elem; /* New element added to the pH */ - int (*xHash)(const void*,int); /* The hash function */ - - assert( pH!=0 ); - xHash = hashFunction(pH->keyClass); - assert( xHash!=0 ); - hraw = (*xHash)(pKey, nKey); - assert( (pH->htsize & (pH->htsize-1))==0 ); - h = hraw & (pH->htsize-1); - elem = findElementGivenHash(pH,pKey,nKey,h); - if( elem ){ - void *old_data = elem->data; - if( data==0 ){ - removeElementGivenHash(pH,elem,h); - }else{ - elem->data = data; - } - return old_data; - } - if( data==0 ) return 0; - new_elem = (HashElem*)sqliteMalloc( sizeof(HashElem) ); - if( new_elem==0 ) return data; - if( pH->copyKey && pKey!=0 ){ - new_elem->pKey = sqliteMallocRaw( nKey ); - if( new_elem->pKey==0 ){ - sqliteFree(new_elem); - return data; - } - memcpy((void*)new_elem->pKey, pKey, nKey); - }else{ - new_elem->pKey = (void*)pKey; - } - new_elem->nKey = nKey; - pH->count++; - if( pH->htsize==0 ) rehash(pH,8); - if( pH->htsize==0 ){ - pH->count = 0; - sqliteFree(new_elem); - return data; - } - if( pH->count > pH->htsize ){ - rehash(pH,pH->htsize*2); - } - assert( (pH->htsize & (pH->htsize-1))==0 ); - h = hraw & (pH->htsize-1); - elem = pH->ht[h].chain; - if( elem ){ - new_elem->next = elem; - new_elem->prev = elem->prev; - if( elem->prev ){ elem->prev->next = new_elem; } - else { pH->first = new_elem; } - elem->prev = new_elem; - }else{ - new_elem->next = pH->first; - new_elem->prev = 0; - if( pH->first ){ pH->first->prev = new_elem; } - pH->first = new_elem; - } - pH->ht[h].count++; - pH->ht[h].chain = new_elem; - new_elem->data = data; - return 0; -} diff --git a/ext/sqlite/libsqlite/src/hash.h b/ext/sqlite/libsqlite/src/hash.h deleted file mode 100644 index 5f6335e1c8180..0000000000000 --- a/ext/sqlite/libsqlite/src/hash.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -** 2001 September 22 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the header file for the generic hash-table implemenation -** used in SQLite. -** -** $Id$ -*/ -#ifndef _SQLITE_HASH_H_ -#define _SQLITE_HASH_H_ - -/* Forward declarations of structures. */ -typedef struct Hash Hash; -typedef struct HashElem HashElem; - -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, many of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -*/ -struct Hash { - char keyClass; /* SQLITE_HASH_INT, _POINTER, _STRING, _BINARY */ - char copyKey; /* True if copy of key made on insert */ - int count; /* Number of entries in this table */ - HashElem *first; /* The first element of the array */ - int htsize; /* Number of buckets in the hash table */ - struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ - HashElem *chain; /* Pointer to first entry with this hash */ - } *ht; -}; - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. -*/ -struct HashElem { - HashElem *next, *prev; /* Next and previous elements in the table */ - void *data; /* Data associated with this element */ - void *pKey; int nKey; /* Key associated with this element */ -}; - -/* -** There are 4 different modes of operation for a hash table: -** -** SQLITE_HASH_INT nKey is used as the key and pKey is ignored. -** -** SQLITE_HASH_POINTER pKey is used as the key and nKey is ignored. -** -** SQLITE_HASH_STRING pKey points to a string that is nKey bytes long -** (including the null-terminator, if any). Case -** is ignored in comparisons. -** -** SQLITE_HASH_BINARY pKey points to binary data nKey bytes long. -** memcmp() is used to compare keys. -** -** A copy of the key is made for SQLITE_HASH_STRING and SQLITE_HASH_BINARY -** if the copyKey parameter to HashInit is 1. -*/ -#define SQLITE_HASH_INT 1 -/* #define SQLITE_HASH_POINTER 2 // NOT USED */ -#define SQLITE_HASH_STRING 3 -#define SQLITE_HASH_BINARY 4 - -/* -** Access routines. To delete, insert a NULL pointer. -*/ -void sqliteHashInit(Hash*, int keytype, int copyKey); -void *sqliteHashInsert(Hash*, const void *pKey, int nKey, void *pData); -void *sqliteHashFind(const Hash*, const void *pKey, int nKey); -void sqliteHashClear(Hash*); - -/* -** Macros for looping over all elements of a hash table. The idiom is -** like this: -** -** Hash h; -** HashElem *p; -** ... -** for(p=sqliteHashFirst(&h); p; p=sqliteHashNext(p)){ -** SomeStructure *pData = sqliteHashData(p); -** // do something with pData -** } -*/ -#define sqliteHashFirst(H) ((H)->first) -#define sqliteHashNext(E) ((E)->next) -#define sqliteHashData(E) ((E)->data) -#define sqliteHashKey(E) ((E)->pKey) -#define sqliteHashKeysize(E) ((E)->nKey) - -/* -** Number of entries in a hash table -*/ -#define sqliteHashCount(H) ((H)->count) - -#endif /* _SQLITE_HASH_H_ */ diff --git a/ext/sqlite/libsqlite/src/insert.c b/ext/sqlite/libsqlite/src/insert.c deleted file mode 100644 index 86c581edee330..0000000000000 --- a/ext/sqlite/libsqlite/src/insert.c +++ /dev/null @@ -1,919 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** to handle INSERT statements in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" - -/* -** This routine is call to handle SQL of the following forms: -** -** insert into TABLE (IDLIST) values(EXPRLIST) -** insert into TABLE (IDLIST) select -** -** The IDLIST following the table name is always optional. If omitted, -** then a list of all columns for the table is substituted. The IDLIST -** appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted. -** -** The pList parameter holds EXPRLIST in the first form of the INSERT -** statement above, and pSelect is NULL. For the second form, pList is -** NULL and pSelect is a pointer to the select statement used to generate -** data for the insert. -** -** The code generated follows one of three templates. For a simple -** select with data coming from a VALUES clause, the code executes -** once straight down through. The template looks like this: -** -** open write cursor to and its indices -** puts VALUES clause expressions onto the stack -** write the resulting record into
              -** cleanup -** -** If the statement is of the form -** -** INSERT INTO
              SELECT ... -** -** And the SELECT clause does not read from
              at any time, then -** the generated code follows this template: -** -** goto B -** A: setup for the SELECT -** loop over the tables in the SELECT -** gosub C -** end loop -** cleanup after the SELECT -** goto D -** B: open write cursor to
              and its indices -** goto A -** C: insert the select result into
              -** return -** D: cleanup -** -** The third template is used if the insert statement takes its -** values from a SELECT but the data is being inserted into a table -** that is also read as part of the SELECT. In the third form, -** we have to use a intermediate table to store the results of -** the select. The template is like this: -** -** goto B -** A: setup for the SELECT -** loop over the tables in the SELECT -** gosub C -** end loop -** cleanup after the SELECT -** goto D -** C: insert the select result into the intermediate table -** return -** B: open a cursor to an intermediate table -** goto A -** D: open write cursor to
              and its indices -** loop over the intermediate table -** transfer values form intermediate table into
              -** end the loop -** cleanup -*/ -void sqliteInsert( - Parse *pParse, /* Parser context */ - SrcList *pTabList, /* Name of table into which we are inserting */ - ExprList *pList, /* List of values to be inserted */ - Select *pSelect, /* A SELECT statement to use as the data source */ - IdList *pColumn, /* Column names corresponding to IDLIST. */ - int onError /* How to handle constraint errors */ -){ - Table *pTab; /* The table to insert into */ - char *zTab; /* Name of the table into which we are inserting */ - const char *zDb; /* Name of the database holding this table */ - int i, j, idx; /* Loop counters */ - Vdbe *v; /* Generate code into this virtual machine */ - Index *pIdx; /* For looping over indices of the table */ - int nColumn; /* Number of columns in the data */ - int base; /* VDBE Cursor number for pTab */ - int iCont, iBreak; /* Beginning and end of the loop over srcTab */ - sqlite *db; /* The main database structure */ - int keyColumn = -1; /* Column that is the INTEGER PRIMARY KEY */ - int endOfLoop; /* Label for the end of the insertion loop */ - int useTempTable; /* Store SELECT results in intermediate table */ - int srcTab; /* Data comes from this temporary cursor if >=0 */ - int iSelectLoop; /* Address of code that implements the SELECT */ - int iCleanup; /* Address of the cleanup code */ - int iInsertBlock; /* Address of the subroutine used to insert data */ - int iCntMem; /* Memory cell used for the row counter */ - int isView; /* True if attempting to insert into a view */ - - int row_triggers_exist = 0; /* True if there are FOR EACH ROW triggers */ - int before_triggers; /* True if there are BEFORE triggers */ - int after_triggers; /* True if there are AFTER triggers */ - int newIdx = -1; /* Cursor for the NEW table */ - - if( pParse->nErr || sqlite_malloc_failed ) goto insert_cleanup; - db = pParse->db; - - /* Locate the table into which we will be inserting new information. - */ - assert( pTabList->nSrc==1 ); - zTab = pTabList->a[0].zName; - if( zTab==0 ) goto insert_cleanup; - pTab = sqliteSrcListLookup(pParse, pTabList); - if( pTab==0 ){ - goto insert_cleanup; - } - assert( pTab->iDbnDb ); - zDb = db->aDb[pTab->iDb].zName; - if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){ - goto insert_cleanup; - } - - /* Ensure that: - * (a) the table is not read-only, - * (b) that if it is a view then ON INSERT triggers exist - */ - before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, TK_INSERT, - TK_BEFORE, TK_ROW, 0); - after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger, TK_INSERT, - TK_AFTER, TK_ROW, 0); - row_triggers_exist = before_triggers || after_triggers; - isView = pTab->pSelect!=0; - if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){ - goto insert_cleanup; - } - if( pTab==0 ) goto insert_cleanup; - - /* If pTab is really a view, make sure it has been initialized. - */ - if( isView && sqliteViewGetColumnNames(pParse, pTab) ){ - goto insert_cleanup; - } - - /* Allocate a VDBE - */ - v = sqliteGetVdbe(pParse); - if( v==0 ) goto insert_cleanup; - sqliteBeginWriteOperation(pParse, pSelect || row_triggers_exist, pTab->iDb); - - /* if there are row triggers, allocate a temp table for new.* references. */ - if( row_triggers_exist ){ - newIdx = pParse->nTab++; - } - - /* Figure out how many columns of data are supplied. If the data - ** is coming from a SELECT statement, then this step also generates - ** all the code to implement the SELECT statement and invoke a subroutine - ** to process each row of the result. (Template 2.) If the SELECT - ** statement uses the the table that is being inserted into, then the - ** subroutine is also coded here. That subroutine stores the SELECT - ** results in a temporary table. (Template 3.) - */ - if( pSelect ){ - /* Data is coming from a SELECT. Generate code to implement that SELECT - */ - int rc, iInitCode; - iInitCode = sqliteVdbeAddOp(v, OP_Goto, 0, 0); - iSelectLoop = sqliteVdbeCurrentAddr(v); - iInsertBlock = sqliteVdbeMakeLabel(v); - rc = sqliteSelect(pParse, pSelect, SRT_Subroutine, iInsertBlock, 0,0,0); - if( rc || pParse->nErr || sqlite_malloc_failed ) goto insert_cleanup; - iCleanup = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_Goto, 0, iCleanup); - assert( pSelect->pEList ); - nColumn = pSelect->pEList->nExpr; - - /* Set useTempTable to TRUE if the result of the SELECT statement - ** should be written into a temporary table. Set to FALSE if each - ** row of the SELECT can be written directly into the result table. - ** - ** A temp table must be used if the table being updated is also one - ** of the tables being read by the SELECT statement. Also use a - ** temp table in the case of row triggers. - */ - if( row_triggers_exist ){ - useTempTable = 1; - }else{ - int addr = sqliteVdbeFindOp(v, OP_OpenRead, pTab->tnum); - useTempTable = 0; - if( addr>0 ){ - VdbeOp *pOp = sqliteVdbeGetOp(v, addr-2); - if( pOp->opcode==OP_Integer && pOp->p1==pTab->iDb ){ - useTempTable = 1; - } - } - } - - if( useTempTable ){ - /* Generate the subroutine that SELECT calls to process each row of - ** the result. Store the result in a temporary table - */ - srcTab = pParse->nTab++; - sqliteVdbeResolveLabel(v, iInsertBlock); - sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); - sqliteVdbeAddOp(v, OP_NewRecno, srcTab, 0); - sqliteVdbeAddOp(v, OP_Pull, 1, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, srcTab, 0); - sqliteVdbeAddOp(v, OP_Return, 0, 0); - - /* The following code runs first because the GOTO at the very top - ** of the program jumps to it. Create the temporary table, then jump - ** back up and execute the SELECT code above. - */ - sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); - sqliteVdbeAddOp(v, OP_OpenTemp, srcTab, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); - sqliteVdbeResolveLabel(v, iCleanup); - }else{ - sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); - } - }else{ - /* This is the case if the data for the INSERT is coming from a VALUES - ** clause - */ - SrcList dummy; - assert( pList!=0 ); - srcTab = -1; - useTempTable = 0; - assert( pList ); - nColumn = pList->nExpr; - dummy.nSrc = 0; - for(i=0; ia[i].pExpr) ){ - goto insert_cleanup; - } - if( sqliteExprCheck(pParse, pList->a[i].pExpr, 0, 0) ){ - goto insert_cleanup; - } - } - } - - /* Make sure the number of columns in the source data matches the number - ** of columns to be inserted into the table. - */ - if( pColumn==0 && nColumn!=pTab->nCol ){ - sqliteErrorMsg(pParse, - "table %S has %d columns but %d values were supplied", - pTabList, 0, pTab->nCol, nColumn); - goto insert_cleanup; - } - if( pColumn!=0 && nColumn!=pColumn->nId ){ - sqliteErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId); - goto insert_cleanup; - } - - /* If the INSERT statement included an IDLIST term, then make sure - ** all elements of the IDLIST really are columns of the table and - ** remember the column indices. - ** - ** If the table has an INTEGER PRIMARY KEY column and that column - ** is named in the IDLIST, then record in the keyColumn variable - ** the index into IDLIST of the primary key column. keyColumn is - ** the index of the primary key as it appears in IDLIST, not as - ** is appears in the original table. (The index of the primary - ** key in the original table is pTab->iPKey.) - */ - if( pColumn ){ - for(i=0; inId; i++){ - pColumn->a[i].idx = -1; - } - for(i=0; inId; i++){ - for(j=0; jnCol; j++){ - if( sqliteStrICmp(pColumn->a[i].zName, pTab->aCol[j].zName)==0 ){ - pColumn->a[i].idx = j; - if( j==pTab->iPKey ){ - keyColumn = i; - } - break; - } - } - if( j>=pTab->nCol ){ - if( sqliteIsRowid(pColumn->a[i].zName) ){ - keyColumn = i; - }else{ - sqliteErrorMsg(pParse, "table %S has no column named %s", - pTabList, 0, pColumn->a[i].zName); - pParse->nErr++; - goto insert_cleanup; - } - } - } - } - - /* If there is no IDLIST term but the table has an integer primary - ** key, the set the keyColumn variable to the primary key column index - ** in the original table definition. - */ - if( pColumn==0 ){ - keyColumn = pTab->iPKey; - } - - /* Open the temp table for FOR EACH ROW triggers - */ - if( row_triggers_exist ){ - sqliteVdbeAddOp(v, OP_OpenPseudo, newIdx, 0); - } - - /* Initialize the count of rows to be inserted - */ - if( db->flags & SQLITE_CountRows ){ - iCntMem = pParse->nMem++; - sqliteVdbeAddOp(v, OP_Integer, 0, 0); - sqliteVdbeAddOp(v, OP_MemStore, iCntMem, 1); - } - - /* Open tables and indices if there are no row triggers */ - if( !row_triggers_exist ){ - base = pParse->nTab; - idx = sqliteOpenTableAndIndices(pParse, pTab, base); - pParse->nTab += idx; - } - - /* If the data source is a temporary table, then we have to create - ** a loop because there might be multiple rows of data. If the data - ** source is a subroutine call from the SELECT statement, then we need - ** to launch the SELECT statement processing. - */ - if( useTempTable ){ - iBreak = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_Rewind, srcTab, iBreak); - iCont = sqliteVdbeCurrentAddr(v); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); - sqliteVdbeResolveLabel(v, iInsertBlock); - } - - /* Run the BEFORE and INSTEAD OF triggers, if there are any - */ - endOfLoop = sqliteVdbeMakeLabel(v); - if( before_triggers ){ - - /* build the NEW.* reference row. Note that if there is an INTEGER - ** PRIMARY KEY into which a NULL is being inserted, that NULL will be - ** translated into a unique ID for the row. But on a BEFORE trigger, - ** we do not know what the unique ID will be (because the insert has - ** not happened yet) so we substitute a rowid of -1 - */ - if( keyColumn<0 ){ - sqliteVdbeAddOp(v, OP_Integer, -1, 0); - }else if( useTempTable ){ - sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); - }else{ - sqliteExprCode(pParse, pList->a[keyColumn].pExpr); - sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_Integer, -1, 0); - sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); - } - - /* Create the new column data - */ - for(i=0; inCol; i++){ - if( pColumn==0 ){ - j = i; - }else{ - for(j=0; jnId; j++){ - if( pColumn->a[j].idx==i ) break; - } - } - if( pColumn && j>=pColumn->nId ){ - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); - }else if( useTempTable ){ - sqliteVdbeAddOp(v, OP_Column, srcTab, j); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Dup, nColumn-j-1, 1); - }else{ - sqliteExprCode(pParse, pList->a[j].pExpr); - } - } - sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); - - /* Fire BEFORE or INSTEAD OF triggers */ - if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_BEFORE, pTab, - newIdx, -1, onError, endOfLoop) ){ - goto insert_cleanup; - } - } - - /* If any triggers exists, the opening of tables and indices is deferred - ** until now. - */ - if( row_triggers_exist && !isView ){ - base = pParse->nTab; - idx = sqliteOpenTableAndIndices(pParse, pTab, base); - pParse->nTab += idx; - } - - /* Push the record number for the new entry onto the stack. The - ** record number is a randomly generate integer created by NewRecno - ** except when the table has an INTEGER PRIMARY KEY column, in which - ** case the record number is the same as that column. - */ - if( !isView ){ - if( keyColumn>=0 ){ - if( useTempTable ){ - sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); - }else{ - sqliteExprCode(pParse, pList->a[keyColumn].pExpr); - } - /* If the PRIMARY KEY expression is NULL, then use OP_NewRecno - ** to generate a unique primary key value. - */ - sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_NewRecno, base, 0); - sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); - }else{ - sqliteVdbeAddOp(v, OP_NewRecno, base, 0); - } - - /* Push onto the stack, data for all columns of the new entry, beginning - ** with the first column. - */ - for(i=0; inCol; i++){ - if( i==pTab->iPKey ){ - /* The value of the INTEGER PRIMARY KEY column is always a NULL. - ** Whenever this column is read, the record number will be substituted - ** in its place. So will fill this column with a NULL to avoid - ** taking up data space with information that will never be used. */ - sqliteVdbeAddOp(v, OP_String, 0, 0); - continue; - } - if( pColumn==0 ){ - j = i; - }else{ - for(j=0; jnId; j++){ - if( pColumn->a[j].idx==i ) break; - } - } - if( pColumn && j>=pColumn->nId ){ - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); - }else if( useTempTable ){ - sqliteVdbeAddOp(v, OP_Column, srcTab, j); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Dup, i+nColumn-j, 1); - }else{ - sqliteExprCode(pParse, pList->a[j].pExpr); - } - } - - /* Generate code to check constraints and generate index keys and - ** do the insertion. - */ - sqliteGenerateConstraintChecks(pParse, pTab, base, 0, keyColumn>=0, - 0, onError, endOfLoop); - sqliteCompleteInsertion(pParse, pTab, base, 0,0,0, - after_triggers ? newIdx : -1); - } - - /* Update the count of rows that are inserted - */ - if( (db->flags & SQLITE_CountRows)!=0 ){ - sqliteVdbeAddOp(v, OP_MemIncr, iCntMem, 0); - } - - if( row_triggers_exist ){ - /* Close all tables opened */ - if( !isView ){ - sqliteVdbeAddOp(v, OP_Close, base, 0); - for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ - sqliteVdbeAddOp(v, OP_Close, idx+base, 0); - } - } - - /* Code AFTER triggers */ - if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_AFTER, pTab, newIdx, -1, - onError, endOfLoop) ){ - goto insert_cleanup; - } - } - - /* The bottom of the loop, if the data source is a SELECT statement - */ - sqliteVdbeResolveLabel(v, endOfLoop); - if( useTempTable ){ - sqliteVdbeAddOp(v, OP_Next, srcTab, iCont); - sqliteVdbeResolveLabel(v, iBreak); - sqliteVdbeAddOp(v, OP_Close, srcTab, 0); - }else if( pSelect ){ - sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); - sqliteVdbeAddOp(v, OP_Return, 0, 0); - sqliteVdbeResolveLabel(v, iCleanup); - } - - if( !row_triggers_exist ){ - /* Close all tables opened */ - sqliteVdbeAddOp(v, OP_Close, base, 0); - for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){ - sqliteVdbeAddOp(v, OP_Close, idx+base, 0); - } - } - - sqliteVdbeAddOp(v, OP_SetCounts, 0, 0); - sqliteEndWriteOperation(pParse); - - /* - ** Return the number of rows inserted. - */ - if( db->flags & SQLITE_CountRows ){ - sqliteVdbeOp3(v, OP_ColumnName, 0, 1, "rows inserted", P3_STATIC); - sqliteVdbeAddOp(v, OP_MemLoad, iCntMem, 0); - sqliteVdbeAddOp(v, OP_Callback, 1, 0); - } - -insert_cleanup: - sqliteSrcListDelete(pTabList); - if( pList ) sqliteExprListDelete(pList); - if( pSelect ) sqliteSelectDelete(pSelect); - sqliteIdListDelete(pColumn); -} - -/* -** Generate code to do a constraint check prior to an INSERT or an UPDATE. -** -** When this routine is called, the stack contains (from bottom to top) -** the following values: -** -** 1. The recno of the row to be updated before the update. This -** value is omitted unless we are doing an UPDATE that involves a -** change to the record number. -** -** 2. The recno of the row after the update. -** -** 3. The data in the first column of the entry after the update. -** -** i. Data from middle columns... -** -** N. The data in the last column of the entry after the update. -** -** The old recno shown as entry (1) above is omitted unless both isUpdate -** and recnoChng are 1. isUpdate is true for UPDATEs and false for -** INSERTs and recnoChng is true if the record number is being changed. -** -** The code generated by this routine pushes additional entries onto -** the stack which are the keys for new index entries for the new record. -** The order of index keys is the same as the order of the indices on -** the pTable->pIndex list. A key is only created for index i if -** aIdxUsed!=0 and aIdxUsed[i]!=0. -** -** This routine also generates code to check constraints. NOT NULL, -** CHECK, and UNIQUE constraints are all checked. If a constraint fails, -** then the appropriate action is performed. There are five possible -** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE. -** -** Constraint type Action What Happens -** --------------- ---------- ---------------------------------------- -** any ROLLBACK The current transaction is rolled back and -** sqlite_exec() returns immediately with a -** return code of SQLITE_CONSTRAINT. -** -** any ABORT Back out changes from the current command -** only (do not do a complete rollback) then -** cause sqlite_exec() to return immediately -** with SQLITE_CONSTRAINT. -** -** any FAIL Sqlite_exec() returns immediately with a -** return code of SQLITE_CONSTRAINT. The -** transaction is not rolled back and any -** prior changes are retained. -** -** any IGNORE The record number and data is popped from -** the stack and there is an immediate jump -** to label ignoreDest. -** -** NOT NULL REPLACE The NULL value is replace by the default -** value for that column. If the default value -** is NULL, the action is the same as ABORT. -** -** UNIQUE REPLACE The other row that conflicts with the row -** being inserted is removed. -** -** CHECK REPLACE Illegal. The results in an exception. -** -** Which action to take is determined by the overrideError parameter. -** Or if overrideError==OE_Default, then the pParse->onError parameter -** is used. Or if pParse->onError==OE_Default then the onError value -** for the constraint is used. -** -** The calling routine must open a read/write cursor for pTab with -** cursor number "base". All indices of pTab must also have open -** read/write cursors with cursor number base+i for the i-th cursor. -** Except, if there is no possibility of a REPLACE action then -** cursors do not need to be open for indices where aIdxUsed[i]==0. -** -** If the isUpdate flag is true, it means that the "base" cursor is -** initially pointing to an entry that is being updated. The isUpdate -** flag causes extra code to be generated so that the "base" cursor -** is still pointing at the same entry after the routine returns. -** Without the isUpdate flag, the "base" cursor might be moved. -*/ -void sqliteGenerateConstraintChecks( - Parse *pParse, /* The parser context */ - Table *pTab, /* the table into which we are inserting */ - int base, /* Index of a read/write cursor pointing at pTab */ - char *aIdxUsed, /* Which indices are used. NULL means all are used */ - int recnoChng, /* True if the record number will change */ - int isUpdate, /* True for UPDATE, False for INSERT */ - int overrideError, /* Override onError to this if not OE_Default */ - int ignoreDest /* Jump to this label on an OE_Ignore resolution */ -){ - int i; - Vdbe *v; - int nCol; - int onError; - int addr; - int extra; - int iCur; - Index *pIdx; - int seenReplace = 0; - int jumpInst1, jumpInst2; - int contAddr; - int hasTwoRecnos = (isUpdate && recnoChng); - - v = sqliteGetVdbe(pParse); - assert( v!=0 ); - assert( pTab->pSelect==0 ); /* This table is not a VIEW */ - nCol = pTab->nCol; - - /* Test all NOT NULL constraints. - */ - for(i=0; iiPKey ){ - continue; - } - onError = pTab->aCol[i].notNull; - if( onError==OE_None ) continue; - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( pParse->db->onError!=OE_Default ){ - onError = pParse->db->onError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - if( onError==OE_Replace && pTab->aCol[i].zDflt==0 ){ - onError = OE_Abort; - } - sqliteVdbeAddOp(v, OP_Dup, nCol-1-i, 1); - addr = sqliteVdbeAddOp(v, OP_NotNull, 1, 0); - switch( onError ){ - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - char *zMsg = 0; - sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); - sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName, - " may not be NULL", (char*)0); - sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC); - break; - } - case OE_Ignore: { - sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - case OE_Replace: { - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); - sqliteVdbeAddOp(v, OP_Push, nCol-i, 0); - break; - } - default: assert(0); - } - sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); - } - - /* Test all CHECK constraints - */ - /**** TBD ****/ - - /* If we have an INTEGER PRIMARY KEY, make sure the primary key - ** of the new record does not previously exist. Except, if this - ** is an UPDATE and the primary key is not changing, that is OK. - */ - if( recnoChng ){ - onError = pTab->keyConf; - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( pParse->db->onError!=OE_Default ){ - onError = pParse->db->onError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - - if( isUpdate ){ - sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); - sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); - jumpInst1 = sqliteVdbeAddOp(v, OP_Eq, 0, 0); - } - sqliteVdbeAddOp(v, OP_Dup, nCol, 1); - jumpInst2 = sqliteVdbeAddOp(v, OP_NotExists, base, 0); - switch( onError ){ - default: { - onError = OE_Abort; - /* Fall thru into the next case */ - } - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, - "PRIMARY KEY must be unique", P3_STATIC); - break; - } - case OE_Replace: { - sqliteGenerateRowIndexDelete(pParse->db, v, pTab, base, 0); - if( isUpdate ){ - sqliteVdbeAddOp(v, OP_Dup, nCol+hasTwoRecnos, 1); - sqliteVdbeAddOp(v, OP_MoveTo, base, 0); - } - seenReplace = 1; - break; - } - case OE_Ignore: { - assert( seenReplace==0 ); - sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - } - contAddr = sqliteVdbeCurrentAddr(v); - sqliteVdbeChangeP2(v, jumpInst2, contAddr); - if( isUpdate ){ - sqliteVdbeChangeP2(v, jumpInst1, contAddr); - sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); - sqliteVdbeAddOp(v, OP_MoveTo, base, 0); - } - } - - /* Test all UNIQUE constraints by creating entries for each UNIQUE - ** index and making sure that duplicate entries do not already exist. - ** Add the new records to the indices as we go. - */ - extra = -1; - for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){ - if( aIdxUsed && aIdxUsed[iCur]==0 ) continue; /* Skip unused indices */ - extra++; - - /* Create a key for accessing the index entry */ - sqliteVdbeAddOp(v, OP_Dup, nCol+extra, 1); - for(i=0; inColumn; i++){ - int idx = pIdx->aiColumn[i]; - if( idx==pTab->iPKey ){ - sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol+1, 1); - }else{ - sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1); - } - } - jumpInst1 = sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); - if( pParse->db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); - - /* Find out what action to take in case there is an indexing conflict */ - onError = pIdx->onError; - if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */ - if( overrideError!=OE_Default ){ - onError = overrideError; - }else if( pParse->db->onError!=OE_Default ){ - onError = pParse->db->onError; - }else if( onError==OE_Default ){ - onError = OE_Abort; - } - if( seenReplace ){ - if( onError==OE_Ignore ) onError = OE_Replace; - else if( onError==OE_Fail ) onError = OE_Abort; - } - - - /* Check to see if the new index entry will be unique */ - sqliteVdbeAddOp(v, OP_Dup, extra+nCol+1+hasTwoRecnos, 1); - jumpInst2 = sqliteVdbeAddOp(v, OP_IsUnique, base+iCur+1, 0); - - /* Generate code that executes if the new index entry is not unique */ - switch( onError ){ - case OE_Rollback: - case OE_Abort: - case OE_Fail: { - int j, n1, n2; - char zErrMsg[200]; - strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column "); - n1 = strlen(zErrMsg); - for(j=0; jnColumn && n1aCol[pIdx->aiColumn[j]].zName; - n2 = strlen(zCol); - if( j>0 ){ - strcpy(&zErrMsg[n1], ", "); - n1 += 2; - } - if( n1+n2>sizeof(zErrMsg)-30 ){ - strcpy(&zErrMsg[n1], "..."); - n1 += 3; - break; - }else{ - strcpy(&zErrMsg[n1], zCol); - n1 += n2; - } - } - strcpy(&zErrMsg[n1], - pIdx->nColumn>1 ? " are not unique" : " is not unique"); - sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0); - break; - } - case OE_Ignore: { - assert( seenReplace==0 ); - sqliteVdbeAddOp(v, OP_Pop, nCol+extra+3+hasTwoRecnos, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); - break; - } - case OE_Replace: { - sqliteGenerateRowDelete(pParse->db, v, pTab, base, 0); - if( isUpdate ){ - sqliteVdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRecnos, 1); - sqliteVdbeAddOp(v, OP_MoveTo, base, 0); - } - seenReplace = 1; - break; - } - default: assert(0); - } - contAddr = sqliteVdbeCurrentAddr(v); -#if NULL_DISTINCT_FOR_UNIQUE - sqliteVdbeChangeP2(v, jumpInst1, contAddr); -#endif - sqliteVdbeChangeP2(v, jumpInst2, contAddr); - } -} - -/* -** This routine generates code to finish the INSERT or UPDATE operation -** that was started by a prior call to sqliteGenerateConstraintChecks. -** The stack must contain keys for all active indices followed by data -** and the recno for the new entry. This routine creates the new -** entries in all indices and in the main table. -** -** The arguments to this routine should be the same as the first six -** arguments to sqliteGenerateConstraintChecks. -*/ -void sqliteCompleteInsertion( - Parse *pParse, /* The parser context */ - Table *pTab, /* the table into which we are inserting */ - int base, /* Index of a read/write cursor pointing at pTab */ - char *aIdxUsed, /* Which indices are used. NULL means all are used */ - int recnoChng, /* True if the record number will change */ - int isUpdate, /* True for UPDATE, False for INSERT */ - int newIdx /* Index of NEW table for triggers. -1 if none */ -){ - int i; - Vdbe *v; - int nIdx; - Index *pIdx; - - v = sqliteGetVdbe(pParse); - assert( v!=0 ); - assert( pTab->pSelect==0 ); /* This table is not a VIEW */ - for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){} - for(i=nIdx-1; i>=0; i--){ - if( aIdxUsed && aIdxUsed[i]==0 ) continue; - sqliteVdbeAddOp(v, OP_IdxPut, base+i+1, 0); - } - sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); - if( newIdx>=0 ){ - sqliteVdbeAddOp(v, OP_Dup, 1, 0); - sqliteVdbeAddOp(v, OP_Dup, 1, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); - } - sqliteVdbeAddOp(v, OP_PutIntKey, base, - (pParse->trigStack?0:OPFLAG_NCHANGE) | - (isUpdate?0:OPFLAG_LASTROWID) | OPFLAG_CSCHANGE); - if( isUpdate && recnoChng ){ - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - } -} - -/* -** Generate code that will open write cursors for a table and for all -** indices of that table. The "base" parameter is the cursor number used -** for the table. Indices are opened on subsequent cursors. -** -** Return the total number of cursors opened. This is always at least -** 1 (for the main table) plus more for each cursor. -*/ -int sqliteOpenTableAndIndices(Parse *pParse, Table *pTab, int base){ - int i; - Index *pIdx; - Vdbe *v = sqliteGetVdbe(pParse); - assert( v!=0 ); - sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqliteVdbeOp3(v, OP_OpenWrite, base, pTab->tnum, pTab->zName, P3_STATIC); - for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ - sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - sqliteVdbeOp3(v, OP_OpenWrite, i+base, pIdx->tnum, pIdx->zName, P3_STATIC); - } - return i; -} diff --git a/ext/sqlite/libsqlite/src/libsqlite.dsp b/ext/sqlite/libsqlite/src/libsqlite.dsp deleted file mode 100755 index a60543c0eb787..0000000000000 --- a/ext/sqlite/libsqlite/src/libsqlite.dsp +++ /dev/null @@ -1,353 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libsqlite" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libsqlite - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libsqlite.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libsqlite.mak" CFG="libsqlite - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libsqlite - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "libsqlite - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "libsqlite - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "..\..\Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x406 /d "_DEBUG" -# ADD RSC /l 0x406 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "..\..\Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libsqlite___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "libsqlite___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TSDbg" -# PROP Intermediate_Dir "..\..\Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D THREADSAFE=1 /YX /FD /c -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"Release_TS\libsqlite.lib" -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libsqlite - Win32 Debug_TS" -# Name "libsqlite - Win32 Release_TS" -# Name "libsqlite - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=attach.c -# End Source File -# Begin Source File - -SOURCE=auth.c -# End Source File -# Begin Source File - -SOURCE=btree.c -# End Source File -# Begin Source File - -SOURCE=btree_rb.c -# End Source File -# Begin Source File - -SOURCE=build.c -# End Source File -# Begin Source File - -SOURCE=copy.c -# End Source File -# Begin Source File - -SOURCE=.\date.c -# End Source File -# Begin Source File - -SOURCE=delete.c -# End Source File -# Begin Source File - -SOURCE=encode.c -# End Source File -# Begin Source File - -SOURCE=expr.c -# End Source File -# Begin Source File - -SOURCE=func.c -# End Source File -# Begin Source File - -SOURCE=hash.c -# End Source File -# Begin Source File - -SOURCE=insert.c -# End Source File -# Begin Source File - -SOURCE=main.c -# End Source File -# Begin Source File - -SOURCE=opcodes.c -# End Source File -# Begin Source File - -SOURCE=os.c -# End Source File -# Begin Source File - -SOURCE=pager.c -# End Source File -# Begin Source File - -SOURCE=parse.c -# End Source File -# Begin Source File - -SOURCE=pragma.c -# End Source File -# Begin Source File - -SOURCE=printf.c -# End Source File -# Begin Source File - -SOURCE=random.c -# End Source File -# Begin Source File - -SOURCE=select.c -# End Source File -# Begin Source File - -SOURCE=table.c -# End Source File -# Begin Source File - -SOURCE=tokenize.c -# End Source File -# Begin Source File - -SOURCE=trigger.c -# End Source File -# Begin Source File - -SOURCE=update.c -# End Source File -# Begin Source File - -SOURCE=util.c -# End Source File -# Begin Source File - -SOURCE=vacuum.c -# End Source File -# Begin Source File - -SOURCE=vdbe.c -# End Source File -# Begin Source File - -SOURCE=.\vdbeaux.c -# End Source File -# Begin Source File - -SOURCE=where.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=btree.h -# End Source File -# Begin Source File - -SOURCE=config_static.w32.h - -!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" - -# Begin Custom Build -InputDir=. -InputPath=config_static.w32.h - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" - -# Begin Custom Build -InputDir=. -InputPath=config_static.w32.h - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=. -InputPath=config_static.w32.h - -"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=hash.h -# End Source File -# Begin Source File - -SOURCE=opcodes.h -# End Source File -# Begin Source File - -SOURCE=os.h -# End Source File -# Begin Source File - -SOURCE=pager.h -# End Source File -# Begin Source File - -SOURCE=parse.h -# End Source File -# Begin Source File - -SOURCE=sqlite.w32.h - -!IF "$(CFG)" == "libsqlite - Win32 Debug_TS" - -# Begin Custom Build -InputDir=. -InputPath=sqlite.w32.h - -"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\sqlite.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TS" - -# Begin Custom Build -InputDir=. -InputPath=sqlite.w32.h - -"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\sqlite.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libsqlite - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=. -InputPath=sqlite.w32.h - -"$(InputDir)\sqlite.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\sqlite.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=sqliteInt.h -# End Source File -# Begin Source File - -SOURCE=vdbe.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/sqlite/libsqlite/src/main.c b/ext/sqlite/libsqlite/src/main.c deleted file mode 100644 index c16300558ac64..0000000000000 --- a/ext/sqlite/libsqlite/src/main.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Main file for the SQLite library. The routines in this file -** implement the programmer interface to the library. Routines in -** other files are for internal use by SQLite and should not be -** accessed by users of the library. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" -#include - -/* -** A pointer to this structure is used to communicate information -** from sqliteInit into the sqliteInitCallback. -*/ -typedef struct { - sqlite *db; /* The database being initialized */ - char **pzErrMsg; /* Error message stored here */ -} InitData; - -/* -** Fill the InitData structure with an error message that indicates -** that the database is corrupt. -*/ -static void corruptSchema(InitData *pData, const char *zExtra){ - sqliteSetString(pData->pzErrMsg, "malformed database schema", - zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); -} - -/* -** This is the callback routine for the code that initializes the -** database. See sqliteInit() below for additional information. -** -** Each callback contains the following information: -** -** argv[0] = "file-format" or "schema-cookie" or "table" or "index" -** argv[1] = table or index name or meta statement type. -** argv[2] = root page number for table or index. NULL for meta. -** argv[3] = SQL text for a CREATE TABLE or CREATE INDEX statement. -** argv[4] = "1" for temporary files, "0" for main database, "2" or more -** for auxiliary database files. -** -*/ -static -int sqliteInitCallback(void *pInit, int argc, char **argv, char **azColName){ - InitData *pData = (InitData*)pInit; - int nErr = 0; - - assert( argc==5 ); - if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ - if( argv[0]==0 ){ - corruptSchema(pData, 0); - return 1; - } - switch( argv[0][0] ){ - case 'v': - case 'i': - case 't': { /* CREATE TABLE, CREATE INDEX, or CREATE VIEW statements */ - sqlite *db = pData->db; - if( argv[2]==0 || argv[4]==0 ){ - corruptSchema(pData, 0); - return 1; - } - if( argv[3] && argv[3][0] ){ - /* Call the parser to process a CREATE TABLE, INDEX or VIEW. - ** But because db->init.busy is set to 1, no VDBE code is generated - ** or executed. All the parser does is build the internal data - ** structures that describe the table, index, or view. - */ - char *zErr; - assert( db->init.busy ); - db->init.iDb = atoi(argv[4]); - assert( db->init.iDb>=0 && db->init.iDbnDb ); - db->init.newTnum = atoi(argv[2]); - if( sqlite_exec(db, argv[3], 0, 0, &zErr) ){ - corruptSchema(pData, zErr); - sqlite_freemem(zErr); - } - db->init.iDb = 0; - }else{ - /* If the SQL column is blank it means this is an index that - ** was created to be the PRIMARY KEY or to fulfill a UNIQUE - ** constraint for a CREATE TABLE. The index should have already - ** been created when we processed the CREATE TABLE. All we have - ** to do here is record the root page number for that index. - */ - int iDb; - Index *pIndex; - - iDb = atoi(argv[4]); - assert( iDb>=0 && iDbnDb ); - pIndex = sqliteFindIndex(db, argv[1], db->aDb[iDb].zName); - if( pIndex==0 || pIndex->tnum!=0 ){ - /* This can occur if there exists an index on a TEMP table which - ** has the same name as another index on a permanent index. Since - ** the permanent table is hidden by the TEMP table, we can also - ** safely ignore the index on the permanent table. - */ - /* Do Nothing */; - }else{ - pIndex->tnum = atoi(argv[2]); - } - } - break; - } - default: { - /* This can not happen! */ - nErr = 1; - assert( nErr==0 ); - } - } - return nErr; -} - -/* -** This is a callback procedure used to reconstruct a table. The -** name of the table to be reconstructed is passed in as argv[0]. -** -** This routine is used to automatically upgrade a database from -** format version 1 or 2 to version 3. The correct operation of -** this routine relys on the fact that no indices are used when -** copying a table out to a temporary file. -** -** The change from version 2 to version 3 occurred between SQLite -** version 2.5.6 and 2.6.0 on 2002-July-18. -*/ -static -int upgrade_3_callback(void *pInit, int argc, char **argv, char **NotUsed){ - InitData *pData = (InitData*)pInit; - int rc; - Table *pTab; - Trigger *pTrig; - char *zErr = 0; - - pTab = sqliteFindTable(pData->db, argv[0], 0); - assert( pTab!=0 ); - assert( sqliteStrICmp(pTab->zName, argv[0])==0 ); - if( pTab ){ - pTrig = pTab->pTrigger; - pTab->pTrigger = 0; /* Disable all triggers before rebuilding the table */ - } - rc = sqlite_exec_printf(pData->db, - "CREATE TEMP TABLE sqlite_x AS SELECT * FROM '%q'; " - "DELETE FROM '%q'; " - "INSERT INTO '%q' SELECT * FROM sqlite_x; " - "DROP TABLE sqlite_x;", - 0, 0, &zErr, argv[0], argv[0], argv[0]); - if( zErr ){ - if( *pData->pzErrMsg ) sqlite_freemem(*pData->pzErrMsg); - *pData->pzErrMsg = zErr; - } - - /* If an error occurred in the SQL above, then the transaction will - ** rollback which will delete the internal symbol tables. This will - ** cause the structure that pTab points to be deleted. In case that - ** happened, we need to refetch pTab. - */ - pTab = sqliteFindTable(pData->db, argv[0], 0); - if( pTab ){ - assert( sqliteStrICmp(pTab->zName, argv[0])==0 ); - pTab->pTrigger = pTrig; /* Re-enable triggers */ - } - return rc!=SQLITE_OK; -} - - - -/* -** Attempt to read the database schema and initialize internal -** data structures for a single database file. The index of the -** database file is given by iDb. iDb==0 is used for the main -** database. iDb==1 should never be used. iDb>=2 is used for -** auxiliary databases. Return one of the SQLITE_ error codes to -** indicate success or failure. -*/ -static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ - int rc; - BtCursor *curMain; - int size; - Table *pTab; - char const *azArg[6]; - char zDbNum[30]; - int meta[SQLITE_N_BTREE_META]; - InitData initData; - char const *zMasterSchema; - char const *zMasterName; - char *zSql = 0; - - /* - ** The master database table has a structure like this - */ - static char master_schema[] = - "CREATE TABLE sqlite_master(\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")" - ; - static char temp_master_schema[] = - "CREATE TEMP TABLE sqlite_temp_master(\n" - " type text,\n" - " name text,\n" - " tbl_name text,\n" - " rootpage integer,\n" - " sql text\n" - ")" - ; - - assert( iDb>=0 && iDbnDb ); - - /* zMasterSchema and zInitScript are set to point at the master schema - ** and initialisation script appropriate for the database being - ** initialised. zMasterName is the name of the master table. - */ - if( iDb==1 ){ - zMasterSchema = temp_master_schema; - zMasterName = TEMP_MASTER_NAME; - }else{ - zMasterSchema = master_schema; - zMasterName = MASTER_NAME; - } - - /* Construct the schema table. - */ - sqliteSafetyOff(db); - azArg[0] = "table"; - azArg[1] = zMasterName; - azArg[2] = "2"; - azArg[3] = zMasterSchema; - sprintf(zDbNum, "%d", iDb); - azArg[4] = zDbNum; - azArg[5] = 0; - initData.db = db; - initData.pzErrMsg = pzErrMsg; - sqliteInitCallback(&initData, 5, (char **)azArg, 0); - pTab = sqliteFindTable(db, zMasterName, db->aDb[iDb].zName); - if( pTab ){ - pTab->readOnly = 1; - }else{ - return SQLITE_NOMEM; - } - sqliteSafetyOn(db); - - /* Create a cursor to hold the database open - */ - if( db->aDb[iDb].pBt==0 ) return SQLITE_OK; - rc = sqliteBtreeCursor(db->aDb[iDb].pBt, 2, 0, &curMain); - if( rc ){ - sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); - return rc; - } - - /* Get the database meta information - */ - rc = sqliteBtreeGetMeta(db->aDb[iDb].pBt, meta); - if( rc ){ - sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); - sqliteBtreeCloseCursor(curMain); - return rc; - } - db->aDb[iDb].schema_cookie = meta[1]; - if( iDb==0 ){ - db->next_cookie = meta[1]; - db->file_format = meta[2]; - size = meta[3]; - if( size==0 ){ size = MAX_PAGES; } - db->cache_size = size; - db->safety_level = meta[4]; - if( meta[6]>0 && meta[6]<=2 && db->temp_store==0 ){ - db->temp_store = meta[6]; - } - if( db->safety_level==0 ) db->safety_level = 2; - - /* - ** file_format==1 Version 2.1.0. - ** file_format==2 Version 2.2.0. Add support for INTEGER PRIMARY KEY. - ** file_format==3 Version 2.6.0. Fix empty-string index bug. - ** file_format==4 Version 2.7.0. Add support for separate numeric and - ** text datatypes. - */ - if( db->file_format==0 ){ - /* This happens if the database was initially empty */ - db->file_format = 4; - }else if( db->file_format>4 ){ - sqliteBtreeCloseCursor(curMain); - sqliteSetString(pzErrMsg, "unsupported file format", (char*)0); - return SQLITE_ERROR; - } - }else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){ - assert( db->file_format>=4 ); - if( meta[2]==0 ){ - sqliteSetString(pzErrMsg, "cannot attach empty database: ", - db->aDb[iDb].zName, (char*)0); - }else{ - sqliteSetString(pzErrMsg, "incompatible file format in auxiliary " - "database: ", db->aDb[iDb].zName, (char*)0); - } - sqliteBtreeClose(db->aDb[iDb].pBt); - db->aDb[iDb].pBt = 0; - return SQLITE_FORMAT; - } - sqliteBtreeSetCacheSize(db->aDb[iDb].pBt, db->cache_size); - sqliteBtreeSetSafetyLevel(db->aDb[iDb].pBt, meta[4]==0 ? 2 : meta[4]); - - /* Read the schema information out of the schema tables - */ - assert( db->init.busy ); - sqliteSafetyOff(db); - - /* The following SQL will read the schema from the master tables. - ** The first version works with SQLite file formats 2 or greater. - ** The second version is for format 1 files. - ** - ** Beginning with file format 2, the rowid for new table entries - ** (including entries in sqlite_master) is an increasing integer. - ** So for file format 2 and later, we can play back sqlite_master - ** and all the CREATE statements will appear in the right order. - ** But with file format 1, table entries were random and so we - ** have to make sure the CREATE TABLEs occur before their corresponding - ** CREATE INDEXs. (We don't have to deal with CREATE VIEW or - ** CREATE TRIGGER in file format 1 because those constructs did - ** not exist then.) - */ - if( db->file_format>=2 ){ - sqliteSetString(&zSql, - "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"", - db->aDb[iDb].zName, "\".", zMasterName, (char*)0); - }else{ - sqliteSetString(&zSql, - "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"", - db->aDb[iDb].zName, "\".", zMasterName, - " WHERE type IN ('table', 'index')" - " ORDER BY CASE type WHEN 'table' THEN 0 ELSE 1 END", (char*)0); - } - rc = sqlite_exec(db, zSql, sqliteInitCallback, &initData, 0); - - sqliteFree(zSql); - sqliteSafetyOn(db); - sqliteBtreeCloseCursor(curMain); - if( sqlite_malloc_failed ){ - sqliteSetString(pzErrMsg, "out of memory", (char*)0); - rc = SQLITE_NOMEM; - sqliteResetInternalSchema(db, 0); - } - if( rc==SQLITE_OK ){ - DbSetProperty(db, iDb, DB_SchemaLoaded); - }else{ - sqliteResetInternalSchema(db, iDb); - } - return rc; -} - -/* -** Initialize all database files - the main database file, the file -** used to store temporary tables, and any additional database files -** created using ATTACH statements. Return a success code. If an -** error occurs, write an error message into *pzErrMsg. -** -** After the database is initialized, the SQLITE_Initialized -** bit is set in the flags field of the sqlite structure. An -** attempt is made to initialize the database as soon as it -** is opened. If that fails (perhaps because another process -** has the sqlite_master table locked) than another attempt -** is made the first time the database is accessed. -*/ -int sqliteInit(sqlite *db, char **pzErrMsg){ - int i, rc; - - if( db->init.busy ) return SQLITE_OK; - assert( (db->flags & SQLITE_Initialized)==0 ); - rc = SQLITE_OK; - db->init.busy = 1; - for(i=0; rc==SQLITE_OK && inDb; i++){ - if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; - rc = sqliteInitOne(db, i, pzErrMsg); - if( rc ){ - sqliteResetInternalSchema(db, i); - } - } - - /* Once all the other databases have been initialised, load the schema - ** for the TEMP database. This is loaded last, as the TEMP database - ** schema may contain references to objects in other databases. - */ - if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ - rc = sqliteInitOne(db, 1, pzErrMsg); - if( rc ){ - sqliteResetInternalSchema(db, 1); - } - } - - db->init.busy = 0; - if( rc==SQLITE_OK ){ - db->flags |= SQLITE_Initialized; - sqliteCommitInternalChanges(db); - } - - /* If the database is in formats 1 or 2, then upgrade it to - ** version 3. This will reconstruct all indices. If the - ** upgrade fails for any reason (ex: out of disk space, database - ** is read only, interrupt received, etc.) then fail the init. - */ - if( rc==SQLITE_OK && db->file_format<3 ){ - char *zErr = 0; - InitData initData; - int meta[SQLITE_N_BTREE_META]; - - db->magic = SQLITE_MAGIC_OPEN; - initData.db = db; - initData.pzErrMsg = &zErr; - db->file_format = 3; - rc = sqlite_exec(db, - "BEGIN; SELECT name FROM sqlite_master WHERE type='table';", - upgrade_3_callback, - &initData, - &zErr); - if( rc==SQLITE_OK ){ - sqliteBtreeGetMeta(db->aDb[0].pBt, meta); - meta[2] = 4; - sqliteBtreeUpdateMeta(db->aDb[0].pBt, meta); - sqlite_exec(db, "COMMIT", 0, 0, 0); - } - if( rc!=SQLITE_OK ){ - sqliteSetString(pzErrMsg, - "unable to upgrade database to the version 2.6 format", - zErr ? ": " : 0, zErr, (char*)0); - } - sqlite_freemem(zErr); - } - - if( rc!=SQLITE_OK ){ - db->flags &= ~SQLITE_Initialized; - } - return rc; -} - -/* -** The version of the library -*/ -const char rcsid[] = "@(#) \044Id: SQLite version " SQLITE_VERSION " $"; -const char sqlite_version[] = SQLITE_VERSION; - -/* -** Does the library expect data to be encoded as UTF-8 or iso8859? The -** following global constant always lets us know. -*/ -#ifdef SQLITE_UTF8 -const char sqlite_encoding[] = "UTF-8"; -#else -const char sqlite_encoding[] = "iso8859"; -#endif - -/* -** Open a new SQLite database. Construct an "sqlite" structure to define -** the state of this database and return a pointer to that structure. -** -** An attempt is made to initialize the in-memory data structures that -** hold the database schema. But if this fails (because the schema file -** is locked) then that step is deferred until the first call to -** sqlite_exec(). -*/ -sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){ - sqlite *db; - int rc, i; - - /* Allocate the sqlite data structure */ - db = sqliteMalloc( sizeof(sqlite) ); - if( pzErrMsg ) *pzErrMsg = 0; - if( db==0 ) goto no_mem_on_open; - db->onError = OE_Default; - db->priorNewRowid = 0; - db->magic = SQLITE_MAGIC_BUSY; - db->nDb = 2; - db->aDb = db->aDbStatic; - /* db->flags |= SQLITE_ShortColNames; */ - sqliteHashInit(&db->aFunc, SQLITE_HASH_STRING, 1); - for(i=0; inDb; i++){ - sqliteHashInit(&db->aDb[i].tblHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&db->aDb[i].idxHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&db->aDb[i].trigHash, SQLITE_HASH_STRING, 0); - sqliteHashInit(&db->aDb[i].aFKey, SQLITE_HASH_STRING, 1); - } - - /* Open the backend database driver */ - if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ - db->temp_store = 2; - } - rc = sqliteBtreeFactory(db, zFilename, 0, MAX_PAGES, &db->aDb[0].pBt); - if( rc!=SQLITE_OK ){ - switch( rc ){ - default: { - sqliteSetString(pzErrMsg, "unable to open database: ", - zFilename, (char*)0); - } - } - sqliteFree(db); - sqliteStrRealloc(pzErrMsg); - return 0; - } - db->aDb[0].zName = "main"; - db->aDb[1].zName = "temp"; - - /* Attempt to read the schema */ - sqliteRegisterBuiltinFunctions(db); - rc = sqliteInit(db, pzErrMsg); - db->magic = SQLITE_MAGIC_OPEN; - if( sqlite_malloc_failed ){ - sqlite_close(db); - goto no_mem_on_open; - }else if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ - sqlite_close(db); - sqliteStrRealloc(pzErrMsg); - return 0; - }else if( pzErrMsg ){ - sqliteFree(*pzErrMsg); - *pzErrMsg = 0; - } - - /* Return a pointer to the newly opened database structure */ - return db; - -no_mem_on_open: - sqliteSetString(pzErrMsg, "out of memory", (char*)0); - sqliteStrRealloc(pzErrMsg); - return 0; -} - -/* -** Return the ROWID of the most recent insert -*/ -int sqlite_last_insert_rowid(sqlite *db){ - return db->lastRowid; -} - -/* -** Return the number of changes in the most recent call to sqlite_exec(). -*/ -int sqlite_changes(sqlite *db){ - return db->nChange; -} - -/* -** Return the number of changes produced by the last INSERT, UPDATE, or -** DELETE statement to complete execution. The count does not include -** changes due to SQL statements executed in trigger programs that were -** triggered by that statement -*/ -int sqlite_last_statement_changes(sqlite *db){ - return db->lsChange; -} - -/* -** Close an existing SQLite database -*/ -void sqlite_close(sqlite *db){ - HashElem *i; - int j; - db->want_to_close = 1; - if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ - /* printf("DID NOT CLOSE\n"); fflush(stdout); */ - return; - } - db->magic = SQLITE_MAGIC_CLOSED; - for(j=0; jnDb; j++){ - struct Db *pDb = &db->aDb[j]; - if( pDb->pBt ){ - sqliteBtreeClose(pDb->pBt); - pDb->pBt = 0; - } - } - sqliteResetInternalSchema(db, 0); - assert( db->nDb<=2 ); - assert( db->aDb==db->aDbStatic ); - for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ - FuncDef *pFunc, *pNext; - for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){ - pNext = pFunc->pNext; - sqliteFree(pFunc); - } - } - sqliteHashClear(&db->aFunc); - sqliteFree(db); -} - -/* -** Rollback all database files. -*/ -void sqliteRollbackAll(sqlite *db){ - int i; - for(i=0; inDb; i++){ - if( db->aDb[i].pBt ){ - sqliteBtreeRollback(db->aDb[i].pBt); - db->aDb[i].inTrans = 0; - } - } - sqliteResetInternalSchema(db, 0); - /* sqliteRollbackInternalChanges(db); */ -} - -/* -** Execute SQL code. Return one of the SQLITE_ success/failure -** codes. Also write an error message into memory obtained from -** malloc() and make *pzErrMsg point to that message. -** -** If the SQL is a query, then for each row in the query result -** the xCallback() function is called. pArg becomes the first -** argument to xCallback(). If xCallback=NULL then no callback -** is invoked, even for queries. -*/ -int sqlite_exec( - sqlite *db, /* The database on which the SQL executes */ - const char *zSql, /* The SQL to be executed */ - sqlite_callback xCallback, /* Invoke this callback routine */ - void *pArg, /* First argument to xCallback() */ - char **pzErrMsg /* Write error messages here */ -){ - int rc = SQLITE_OK; - const char *zLeftover; - sqlite_vm *pVm; - int nRetry = 0; - int nChange = 0; - int nCallback; - - if( zSql==0 ) return SQLITE_OK; - while( rc==SQLITE_OK && zSql[0] ){ - pVm = 0; - rc = sqlite_compile(db, zSql, &zLeftover, &pVm, pzErrMsg); - if( rc!=SQLITE_OK ){ - assert( pVm==0 || sqlite_malloc_failed ); - return rc; - } - if( pVm==0 ){ - /* This happens if the zSql input contained only whitespace */ - break; - } - db->nChange += nChange; - nCallback = 0; - while(1){ - int nArg; - char **azArg, **azCol; - rc = sqlite_step(pVm, &nArg, (const char***)&azArg,(const char***)&azCol); - if( rc==SQLITE_ROW ){ - if( xCallback!=0 && xCallback(pArg, nArg, azArg, azCol) ){ - sqlite_finalize(pVm, 0); - return SQLITE_ABORT; - } - nCallback++; - }else{ - if( rc==SQLITE_DONE && nCallback==0 - && (db->flags & SQLITE_NullCallback)!=0 && xCallback!=0 ){ - xCallback(pArg, nArg, azArg, azCol); - } - rc = sqlite_finalize(pVm, pzErrMsg); - if( rc==SQLITE_SCHEMA && nRetry<2 ){ - nRetry++; - rc = SQLITE_OK; - break; - } - if( db->pVdbe==0 ){ - nChange = db->nChange; - } - nRetry = 0; - zSql = zLeftover; - while( isspace(zSql[0]) ) zSql++; - break; - } - } - } - return rc; -} - - -/* -** Compile a single statement of SQL into a virtual machine. Return one -** of the SQLITE_ success/failure codes. Also write an error message into -** memory obtained from malloc() and make *pzErrMsg point to that message. -*/ -int sqlite_compile( - sqlite *db, /* The database on which the SQL executes */ - const char *zSql, /* The SQL to be executed */ - const char **pzTail, /* OUT: Next statement after the first */ - sqlite_vm **ppVm, /* OUT: The virtual machine */ - char **pzErrMsg /* OUT: Write error messages here */ -){ - Parse sParse; - - if( pzErrMsg ) *pzErrMsg = 0; - if( sqliteSafetyOn(db) ) goto exec_misuse; - if( !db->init.busy ){ - if( (db->flags & SQLITE_Initialized)==0 ){ - int rc, cnt = 1; - while( (rc = sqliteInit(db, pzErrMsg))==SQLITE_BUSY - && db->xBusyCallback - && db->xBusyCallback(db->pBusyArg, "", cnt++)!=0 ){} - if( rc!=SQLITE_OK ){ - sqliteStrRealloc(pzErrMsg); - sqliteSafetyOff(db); - return rc; - } - if( pzErrMsg ){ - sqliteFree(*pzErrMsg); - *pzErrMsg = 0; - } - } - if( db->file_format<3 ){ - sqliteSafetyOff(db); - sqliteSetString(pzErrMsg, "obsolete database file format", (char*)0); - return SQLITE_ERROR; - } - } - assert( (db->flags & SQLITE_Initialized)!=0 || db->init.busy ); - if( db->pVdbe==0 ){ db->nChange = 0; } - memset(&sParse, 0, sizeof(sParse)); - sParse.db = db; - sqliteRunParser(&sParse, zSql, pzErrMsg); - if( db->xTrace && !db->init.busy ){ - /* Trace only the statment that was compiled. - ** Make a copy of that part of the SQL string since zSQL is const - ** and we must pass a zero terminated string to the trace function - ** The copy is unnecessary if the tail pointer is pointing at the - ** beginnig or end of the SQL string. - */ - if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){ - char *tmpSql = sqliteStrNDup(zSql, sParse.zTail - zSql); - if( tmpSql ){ - db->xTrace(db->pTraceArg, tmpSql); - free(tmpSql); - }else{ - /* If a memory error occurred during the copy, - ** trace entire SQL string and fall through to the - ** sqlite_malloc_failed test to report the error. - */ - db->xTrace(db->pTraceArg, zSql); - } - }else{ - db->xTrace(db->pTraceArg, zSql); - } - } - if( sqlite_malloc_failed ){ - sqliteSetString(pzErrMsg, "out of memory", (char*)0); - sParse.rc = SQLITE_NOMEM; - sqliteRollbackAll(db); - sqliteResetInternalSchema(db, 0); - db->flags &= ~SQLITE_InTrans; - } - if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; - if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ - sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), (char*)0); - } - sqliteStrRealloc(pzErrMsg); - if( sParse.rc==SQLITE_SCHEMA ){ - sqliteResetInternalSchema(db, 0); - } - assert( ppVm ); - *ppVm = (sqlite_vm*)sParse.pVdbe; - if( pzTail ) *pzTail = sParse.zTail; - if( sqliteSafetyOff(db) ) goto exec_misuse; - return sParse.rc; - -exec_misuse: - if( pzErrMsg ){ - *pzErrMsg = 0; - sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0); - sqliteStrRealloc(pzErrMsg); - } - return SQLITE_MISUSE; -} - - -/* -** The following routine destroys a virtual machine that is created by -** the sqlite_compile() routine. -** -** The integer returned is an SQLITE_ success/failure code that describes -** the result of executing the virtual machine. An error message is -** written into memory obtained from malloc and *pzErrMsg is made to -** point to that error if pzErrMsg is not NULL. The calling routine -** should use sqlite_freemem() to delete the message when it has finished -** with it. -*/ -int sqlite_finalize( - sqlite_vm *pVm, /* The virtual machine to be destroyed */ - char **pzErrMsg /* OUT: Write error messages here */ -){ - int rc = sqliteVdbeFinalize((Vdbe*)pVm, pzErrMsg); - sqliteStrRealloc(pzErrMsg); - return rc; -} - -/* -** Terminate the current execution of a virtual machine then -** reset the virtual machine back to its starting state so that it -** can be reused. Any error message resulting from the prior execution -** is written into *pzErrMsg. A success code from the prior execution -** is returned. -*/ -int sqlite_reset( - sqlite_vm *pVm, /* The virtual machine to be destroyed */ - char **pzErrMsg /* OUT: Write error messages here */ -){ - int rc = sqliteVdbeReset((Vdbe*)pVm, pzErrMsg); - sqliteVdbeMakeReady((Vdbe*)pVm, -1, 0); - sqliteStrRealloc(pzErrMsg); - return rc; -} - -/* -** Return a static string that describes the kind of error specified in the -** argument. -*/ -const char *sqlite_error_string(int rc){ - const char *z; - switch( rc ){ - case SQLITE_OK: z = "not an error"; break; - case SQLITE_ERROR: z = "SQL logic error or missing database"; break; - case SQLITE_INTERNAL: z = "internal SQLite implementation flaw"; break; - case SQLITE_PERM: z = "access permission denied"; break; - case SQLITE_ABORT: z = "callback requested query abort"; break; - case SQLITE_BUSY: z = "database is locked"; break; - case SQLITE_LOCKED: z = "database table is locked"; break; - case SQLITE_NOMEM: z = "out of memory"; break; - case SQLITE_READONLY: z = "attempt to write a readonly database"; break; - case SQLITE_INTERRUPT: z = "interrupted"; break; - case SQLITE_IOERR: z = "disk I/O error"; break; - case SQLITE_CORRUPT: z = "database disk image is malformed"; break; - case SQLITE_NOTFOUND: z = "table or record not found"; break; - case SQLITE_FULL: z = "database is full"; break; - case SQLITE_CANTOPEN: z = "unable to open database file"; break; - case SQLITE_PROTOCOL: z = "database locking protocol failure"; break; - case SQLITE_EMPTY: z = "table contains no data"; break; - case SQLITE_SCHEMA: z = "database schema has changed"; break; - case SQLITE_TOOBIG: z = "too much data for one table row"; break; - case SQLITE_CONSTRAINT: z = "constraint failed"; break; - case SQLITE_MISMATCH: z = "datatype mismatch"; break; - case SQLITE_MISUSE: z = "library routine called out of sequence";break; - case SQLITE_NOLFS: z = "kernel lacks large file support"; break; - case SQLITE_AUTH: z = "authorization denied"; break; - case SQLITE_FORMAT: z = "auxiliary database format error"; break; - case SQLITE_RANGE: z = "bind index out of range"; break; - case SQLITE_NOTADB: z = "file is encrypted or is not a database";break; - default: z = "unknown error"; break; - } - return z; -} - -/* -** This routine implements a busy callback that sleeps and tries -** again until a timeout value is reached. The timeout value is -** an integer number of milliseconds passed in as the first -** argument. -*/ -static int sqliteDefaultBusyCallback( - void *Timeout, /* Maximum amount of time to wait */ - const char *NotUsed, /* The name of the table that is busy */ - int count /* Number of times table has been busy */ -){ -#if SQLITE_MIN_SLEEP_MS==1 - static const char delays[] = - { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 50, 100}; - static const short int totals[] = - { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228, 287}; -# define NDELAY (sizeof(delays)/sizeof(delays[0])) - int timeout = (int)(long)Timeout; - int delay, prior; - - if( count <= NDELAY ){ - delay = delays[count-1]; - prior = totals[count-1]; - }else{ - delay = delays[NDELAY-1]; - prior = totals[NDELAY-1] + delay*(count-NDELAY-1); - } - if( prior + delay > timeout ){ - delay = timeout - prior; - if( delay<=0 ) return 0; - } - sqliteOsSleep(delay); - return 1; -#else - int timeout = (int)(long)Timeout; - if( (count+1)*1000 > timeout ){ - return 0; - } - sqliteOsSleep(1000); - return 1; -#endif -} - -/* -** This routine sets the busy callback for an Sqlite database to the -** given callback function with the given argument. -*/ -void sqlite_busy_handler( - sqlite *db, - int (*xBusy)(void*,const char*,int), - void *pArg -){ - db->xBusyCallback = xBusy; - db->pBusyArg = pArg; -} - -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK -/* -** This routine sets the progress callback for an Sqlite database to the -** given callback function with the given argument. The progress callback will -** be invoked every nOps opcodes. -*/ -void sqlite_progress_handler( - sqlite *db, - int nOps, - int (*xProgress)(void*), - void *pArg -){ - if( nOps>0 ){ - db->xProgress = xProgress; - db->nProgressOps = nOps; - db->pProgressArg = pArg; - }else{ - db->xProgress = 0; - db->nProgressOps = 0; - db->pProgressArg = 0; - } -} -#endif - - -/* -** This routine installs a default busy handler that waits for the -** specified number of milliseconds before returning 0. -*/ -void sqlite_busy_timeout(sqlite *db, int ms){ - if( ms>0 ){ - sqlite_busy_handler(db, sqliteDefaultBusyCallback, (void*)(long)ms); - }else{ - sqlite_busy_handler(db, 0, 0); - } -} - -/* -** Cause any pending operation to stop at its earliest opportunity. -*/ -void sqlite_interrupt(sqlite *db){ - db->flags |= SQLITE_Interrupt; -} - -/* -** Windows systems should call this routine to free memory that -** is returned in the in the errmsg parameter of sqlite_open() when -** SQLite is a DLL. For some reason, it does not work to call free() -** directly. -** -** Note that we need to call free() not sqliteFree() here, since every -** string that is exported from SQLite should have already passed through -** sqliteStrRealloc(). -*/ -void sqlite_freemem(void *p){ free(p); } - -/* -** Windows systems need functions to call to return the sqlite_version -** and sqlite_encoding strings since they are unable to access constants -** within DLLs. -*/ -const char *sqlite_libversion(void){ return sqlite_version; } -const char *sqlite_libencoding(void){ return sqlite_encoding; } - -/* -** Create new user-defined functions. The sqlite_create_function() -** routine creates a regular function and sqlite_create_aggregate() -** creates an aggregate function. -** -** Passing a NULL xFunc argument or NULL xStep and xFinalize arguments -** disables the function. Calling sqlite_create_function() with the -** same name and number of arguments as a prior call to -** sqlite_create_aggregate() disables the prior call to -** sqlite_create_aggregate(), and vice versa. -** -** If nArg is -1 it means that this function will accept any number -** of arguments, including 0. The maximum allowed value of nArg is 127. -*/ -int sqlite_create_function( - sqlite *db, /* Add the function to this database connection */ - const char *zName, /* Name of the function to add */ - int nArg, /* Number of arguments */ - void (*xFunc)(sqlite_func*,int,const char**), /* The implementation */ - void *pUserData /* User data */ -){ - FuncDef *p; - int nName; - if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; - if( nArg<-1 || nArg>127 ) return 1; - nName = strlen(zName); - if( nName>255 ) return 1; - p = sqliteFindFunction(db, zName, nName, nArg, 1); - if( p==0 ) return 1; - p->xFunc = xFunc; - p->xStep = 0; - p->xFinalize = 0; - p->pUserData = pUserData; - return 0; -} -int sqlite_create_aggregate( - sqlite *db, /* Add the function to this database connection */ - const char *zName, /* Name of the function to add */ - int nArg, /* Number of arguments */ - void (*xStep)(sqlite_func*,int,const char**), /* The step function */ - void (*xFinalize)(sqlite_func*), /* The finalizer */ - void *pUserData /* User data */ -){ - FuncDef *p; - int nName; - if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; - if( nArg<-1 || nArg>127 ) return 1; - nName = strlen(zName); - if( nName>255 ) return 1; - p = sqliteFindFunction(db, zName, nName, nArg, 1); - if( p==0 ) return 1; - p->xFunc = 0; - p->xStep = xStep; - p->xFinalize = xFinalize; - p->pUserData = pUserData; - return 0; -} - -/* -** Change the datatype for all functions with a given name. See the -** header comment for the prototype of this function in sqlite.h for -** additional information. -*/ -int sqlite_function_type(sqlite *db, const char *zName, int dataType){ - FuncDef *p = (FuncDef*)sqliteHashFind(&db->aFunc, zName, strlen(zName)); - while( p ){ - p->dataType = dataType; - p = p->pNext; - } - return SQLITE_OK; -} - -/* -** Register a trace function. The pArg from the previously registered trace -** is returned. -** -** A NULL trace function means that no tracing is executes. A non-NULL -** trace is a pointer to a function that is invoked at the start of each -** sqlite_exec(). -*/ -void *sqlite_trace(sqlite *db, void (*xTrace)(void*,const char*), void *pArg){ - void *pOld = db->pTraceArg; - db->xTrace = xTrace; - db->pTraceArg = pArg; - return pOld; -} - -/*** EXPERIMENTAL *** -** -** Register a function to be invoked when a transaction comments. -** If either function returns non-zero, then the commit becomes a -** rollback. -*/ -void *sqlite_commit_hook( - sqlite *db, /* Attach the hook to this database */ - int (*xCallback)(void*), /* Function to invoke on each commit */ - void *pArg /* Argument to the function */ -){ - void *pOld = db->pCommitArg; - db->xCommitCallback = xCallback; - db->pCommitArg = pArg; - return pOld; -} - - -/* -** This routine is called to create a connection to a database BTree -** driver. If zFilename is the name of a file, then that file is -** opened and used. If zFilename is the magic name ":memory:" then -** the database is stored in memory (and is thus forgotten as soon as -** the connection is closed.) If zFilename is NULL then the database -** is for temporary use only and is deleted as soon as the connection -** is closed. -** -** A temporary database can be either a disk file (that is automatically -** deleted when the file is closed) or a set of red-black trees held in memory, -** depending on the values of the TEMP_STORE compile-time macro and the -** db->temp_store variable, according to the following chart: -** -** TEMP_STORE db->temp_store Location of temporary database -** ---------- -------------- ------------------------------ -** 0 any file -** 1 1 file -** 1 2 memory -** 1 0 file -** 2 1 file -** 2 2 memory -** 2 0 memory -** 3 any memory -*/ -int sqliteBtreeFactory( - const sqlite *db, /* Main database when opening aux otherwise 0 */ - const char *zFilename, /* Name of the file containing the BTree database */ - int omitJournal, /* if TRUE then do not journal this file */ - int nCache, /* How many pages in the page cache */ - Btree **ppBtree){ /* Pointer to new Btree object written here */ - - assert( ppBtree != 0); - -#ifndef SQLITE_OMIT_INMEMORYDB - if( zFilename==0 ){ - if (TEMP_STORE == 0) { - /* Always use file based temporary DB */ - return sqliteBtreeOpen(0, omitJournal, nCache, ppBtree); - } else if (TEMP_STORE == 1 || TEMP_STORE == 2) { - /* Switch depending on compile-time and/or runtime settings. */ - int location = db->temp_store==0 ? TEMP_STORE : db->temp_store; - - if (location == 1) { - return sqliteBtreeOpen(zFilename, omitJournal, nCache, ppBtree); - } else { - return sqliteRbtreeOpen(0, 0, 0, ppBtree); - } - } else { - /* Always use in-core DB */ - return sqliteRbtreeOpen(0, 0, 0, ppBtree); - } - }else if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ - return sqliteRbtreeOpen(0, 0, 0, ppBtree); - }else -#endif - { - return sqliteBtreeOpen(zFilename, omitJournal, nCache, ppBtree); - } -} diff --git a/ext/sqlite/libsqlite/src/opcodes.c b/ext/sqlite/libsqlite/src/opcodes.c deleted file mode 100644 index 0907e0e7977a0..0000000000000 --- a/ext/sqlite/libsqlite/src/opcodes.c +++ /dev/null @@ -1,140 +0,0 @@ -/* Automatically generated file. Do not edit */ -char *sqliteOpcodeNames[] = { "???", - "Goto", - "Gosub", - "Return", - "Halt", - "Integer", - "String", - "Variable", - "Pop", - "Dup", - "Pull", - "Push", - "ColumnName", - "Callback", - "Concat", - "Add", - "Subtract", - "Multiply", - "Divide", - "Remainder", - "Function", - "BitAnd", - "BitOr", - "ShiftLeft", - "ShiftRight", - "AddImm", - "ForceInt", - "MustBeInt", - "Eq", - "Ne", - "Lt", - "Le", - "Gt", - "Ge", - "StrEq", - "StrNe", - "StrLt", - "StrLe", - "StrGt", - "StrGe", - "And", - "Or", - "Negative", - "AbsValue", - "Not", - "BitNot", - "Noop", - "If", - "IfNot", - "IsNull", - "NotNull", - "MakeRecord", - "MakeIdxKey", - "MakeKey", - "IncrKey", - "Checkpoint", - "Transaction", - "Commit", - "Rollback", - "ReadCookie", - "SetCookie", - "VerifyCookie", - "OpenRead", - "OpenWrite", - "OpenTemp", - "OpenPseudo", - "Close", - "MoveLt", - "MoveTo", - "Distinct", - "NotFound", - "Found", - "IsUnique", - "NotExists", - "NewRecno", - "PutIntKey", - "PutStrKey", - "Delete", - "SetCounts", - "KeyAsData", - "RowKey", - "RowData", - "Column", - "Recno", - "FullKey", - "NullRow", - "Last", - "Rewind", - "Prev", - "Next", - "IdxPut", - "IdxDelete", - "IdxRecno", - "IdxLT", - "IdxGT", - "IdxGE", - "IdxIsNull", - "Destroy", - "Clear", - "CreateIndex", - "CreateTable", - "IntegrityCk", - "ListWrite", - "ListRewind", - "ListRead", - "ListReset", - "ListPush", - "ListPop", - "ContextPush", - "ContextPop", - "SortPut", - "SortMakeRec", - "SortMakeKey", - "Sort", - "SortNext", - "SortCallback", - "SortReset", - "FileOpen", - "FileRead", - "FileColumn", - "MemStore", - "MemLoad", - "MemIncr", - "AggReset", - "AggInit", - "AggFunc", - "AggFocus", - "AggSet", - "AggGet", - "AggNext", - "SetInsert", - "SetFound", - "SetNotFound", - "SetFirst", - "SetNext", - "Vacuum", - "StackDepth", - "StackReset", -}; diff --git a/ext/sqlite/libsqlite/src/opcodes.h b/ext/sqlite/libsqlite/src/opcodes.h deleted file mode 100644 index 35e050697f31b..0000000000000 --- a/ext/sqlite/libsqlite/src/opcodes.h +++ /dev/null @@ -1,138 +0,0 @@ -/* Automatically generated file. Do not edit */ -#define OP_Goto 1 -#define OP_Gosub 2 -#define OP_Return 3 -#define OP_Halt 4 -#define OP_Integer 5 -#define OP_String 6 -#define OP_Variable 7 -#define OP_Pop 8 -#define OP_Dup 9 -#define OP_Pull 10 -#define OP_Push 11 -#define OP_ColumnName 12 -#define OP_Callback 13 -#define OP_Concat 14 -#define OP_Add 15 -#define OP_Subtract 16 -#define OP_Multiply 17 -#define OP_Divide 18 -#define OP_Remainder 19 -#define OP_Function 20 -#define OP_BitAnd 21 -#define OP_BitOr 22 -#define OP_ShiftLeft 23 -#define OP_ShiftRight 24 -#define OP_AddImm 25 -#define OP_ForceInt 26 -#define OP_MustBeInt 27 -#define OP_Eq 28 -#define OP_Ne 29 -#define OP_Lt 30 -#define OP_Le 31 -#define OP_Gt 32 -#define OP_Ge 33 -#define OP_StrEq 34 -#define OP_StrNe 35 -#define OP_StrLt 36 -#define OP_StrLe 37 -#define OP_StrGt 38 -#define OP_StrGe 39 -#define OP_And 40 -#define OP_Or 41 -#define OP_Negative 42 -#define OP_AbsValue 43 -#define OP_Not 44 -#define OP_BitNot 45 -#define OP_Noop 46 -#define OP_If 47 -#define OP_IfNot 48 -#define OP_IsNull 49 -#define OP_NotNull 50 -#define OP_MakeRecord 51 -#define OP_MakeIdxKey 52 -#define OP_MakeKey 53 -#define OP_IncrKey 54 -#define OP_Checkpoint 55 -#define OP_Transaction 56 -#define OP_Commit 57 -#define OP_Rollback 58 -#define OP_ReadCookie 59 -#define OP_SetCookie 60 -#define OP_VerifyCookie 61 -#define OP_OpenRead 62 -#define OP_OpenWrite 63 -#define OP_OpenTemp 64 -#define OP_OpenPseudo 65 -#define OP_Close 66 -#define OP_MoveLt 67 -#define OP_MoveTo 68 -#define OP_Distinct 69 -#define OP_NotFound 70 -#define OP_Found 71 -#define OP_IsUnique 72 -#define OP_NotExists 73 -#define OP_NewRecno 74 -#define OP_PutIntKey 75 -#define OP_PutStrKey 76 -#define OP_Delete 77 -#define OP_SetCounts 78 -#define OP_KeyAsData 79 -#define OP_RowKey 80 -#define OP_RowData 81 -#define OP_Column 82 -#define OP_Recno 83 -#define OP_FullKey 84 -#define OP_NullRow 85 -#define OP_Last 86 -#define OP_Rewind 87 -#define OP_Prev 88 -#define OP_Next 89 -#define OP_IdxPut 90 -#define OP_IdxDelete 91 -#define OP_IdxRecno 92 -#define OP_IdxLT 93 -#define OP_IdxGT 94 -#define OP_IdxGE 95 -#define OP_IdxIsNull 96 -#define OP_Destroy 97 -#define OP_Clear 98 -#define OP_CreateIndex 99 -#define OP_CreateTable 100 -#define OP_IntegrityCk 101 -#define OP_ListWrite 102 -#define OP_ListRewind 103 -#define OP_ListRead 104 -#define OP_ListReset 105 -#define OP_ListPush 106 -#define OP_ListPop 107 -#define OP_ContextPush 108 -#define OP_ContextPop 109 -#define OP_SortPut 110 -#define OP_SortMakeRec 111 -#define OP_SortMakeKey 112 -#define OP_Sort 113 -#define OP_SortNext 114 -#define OP_SortCallback 115 -#define OP_SortReset 116 -#define OP_FileOpen 117 -#define OP_FileRead 118 -#define OP_FileColumn 119 -#define OP_MemStore 120 -#define OP_MemLoad 121 -#define OP_MemIncr 122 -#define OP_AggReset 123 -#define OP_AggInit 124 -#define OP_AggFunc 125 -#define OP_AggFocus 126 -#define OP_AggSet 127 -#define OP_AggGet 128 -#define OP_AggNext 129 -#define OP_SetInsert 130 -#define OP_SetFound 131 -#define OP_SetNotFound 132 -#define OP_SetFirst 133 -#define OP_SetNext 134 -#define OP_Vacuum 135 -#define OP_StackDepth 136 -#define OP_StackReset 137 diff --git a/ext/sqlite/libsqlite/src/os.c b/ext/sqlite/libsqlite/src/os.c deleted file mode 100644 index 930d62440e7cc..0000000000000 --- a/ext/sqlite/libsqlite/src/os.c +++ /dev/null @@ -1,1849 +0,0 @@ -/* -** 2001 September 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file contains code that is specific to particular operating -** systems. The purpose of this file is to provide a uniform abstraction -** on which the rest of SQLite can operate. -*/ -#include "os.h" /* Must be first to enable large file support */ -#include "sqliteInt.h" - -#if OS_UNIX -# include -# include -# include -# ifndef O_LARGEFILE -# define O_LARGEFILE 0 -# endif -# ifdef SQLITE_DISABLE_LFS -# undef O_LARGEFILE -# define O_LARGEFILE 0 -# endif -# ifndef O_NOFOLLOW -# define O_NOFOLLOW 0 -# endif -# ifndef O_BINARY -# define O_BINARY 0 -# endif -#endif - - -#if OS_WIN -# include -#endif - -#if OS_MAC -# include -# include -# include -# include -# include -# include -# include -#endif - -/* -** The DJGPP compiler environment looks mostly like Unix, but it -** lacks the fcntl() system call. So redefine fcntl() to be something -** that always succeeds. This means that locking does not occur under -** DJGPP. But its DOS - what did you expect? -*/ -#ifdef __DJGPP__ -# define fcntl(A,B,C) 0 -#endif - -/* -** Macros used to determine whether or not to use threads. The -** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for -** Posix threads and SQLITE_W32_THREADS is defined if we are -** synchronizing using Win32 threads. -*/ -#if OS_UNIX && defined(THREADSAFE) && THREADSAFE -# include -# define SQLITE_UNIX_THREADS 1 -#endif -#if OS_WIN && defined(THREADSAFE) && THREADSAFE -# define SQLITE_W32_THREADS 1 -#endif -#if OS_MAC && defined(THREADSAFE) && THREADSAFE -# include -# define SQLITE_MACOS_MULTITASKING 1 -#endif - -/* -** Macros for performance tracing. Normally turned off -*/ -#if 0 -static int last_page = 0; -__inline__ unsigned long long int hwtime(void){ - unsigned long long int x; - __asm__("rdtsc\n\t" - "mov %%edx, %%ecx\n\t" - :"=A" (x)); - return x; -} -static unsigned long long int g_start; -static unsigned int elapse; -#define TIMER_START g_start=hwtime() -#define TIMER_END elapse=hwtime()-g_start -#define SEEK(X) last_page=(X) -#define TRACE1(X) fprintf(stderr,X) -#define TRACE2(X,Y) fprintf(stderr,X,Y) -#define TRACE3(X,Y,Z) fprintf(stderr,X,Y,Z) -#define TRACE4(X,Y,Z,A) fprintf(stderr,X,Y,Z,A) -#define TRACE5(X,Y,Z,A,B) fprintf(stderr,X,Y,Z,A,B) -#else -#define TIMER_START -#define TIMER_END -#define SEEK(X) -#define TRACE1(X) -#define TRACE2(X,Y) -#define TRACE3(X,Y,Z) -#define TRACE4(X,Y,Z,A) -#define TRACE5(X,Y,Z,A,B) -#endif - - -#if OS_UNIX -/* -** Here is the dirt on POSIX advisory locks: ANSI STD 1003.1 (1996) -** section 6.5.2.2 lines 483 through 490 specify that when a process -** sets or clears a lock, that operation overrides any prior locks set -** by the same process. It does not explicitly say so, but this implies -** that it overrides locks set by the same process using a different -** file descriptor. Consider this test case: -** -** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644); -** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); -** -** Suppose ./file1 and ./file2 are really the same file (because -** one is a hard or symbolic link to the other) then if you set -** an exclusive lock on fd1, then try to get an exclusive lock -** on fd2, it works. I would have expected the second lock to -** fail since there was already a lock on the file due to fd1. -** But not so. Since both locks came from the same process, the -** second overrides the first, even though they were on different -** file descriptors opened on different file names. -** -** Bummer. If you ask me, this is broken. Badly broken. It means -** that we cannot use POSIX locks to synchronize file access among -** competing threads of the same process. POSIX locks will work fine -** to synchronize access for threads in separate processes, but not -** threads within the same process. -** -** To work around the problem, SQLite has to manage file locks internally -** on its own. Whenever a new database is opened, we have to find the -** specific inode of the database file (the inode is determined by the -** st_dev and st_ino fields of the stat structure that fstat() fills in) -** and check for locks already existing on that inode. When locks are -** created or removed, we have to look at our own internal record of the -** locks to see if another thread has previously set a lock on that same -** inode. -** -** The OsFile structure for POSIX is no longer just an integer file -** descriptor. It is now a structure that holds the integer file -** descriptor and a pointer to a structure that describes the internal -** locks on the corresponding inode. There is one locking structure -** per inode, so if the same inode is opened twice, both OsFile structures -** point to the same locking structure. The locking structure keeps -** a reference count (so we will know when to delete it) and a "cnt" -** field that tells us its internal lock status. cnt==0 means the -** file is unlocked. cnt==-1 means the file has an exclusive lock. -** cnt>0 means there are cnt shared locks on the file. -** -** Any attempt to lock or unlock a file first checks the locking -** structure. The fcntl() system call is only invoked to set a -** POSIX lock if the internal lock structure transitions between -** a locked and an unlocked state. -** -** 2004-Jan-11: -** More recent discoveries about POSIX advisory locks. (The more -** I discover, the more I realize the a POSIX advisory locks are -** an abomination.) -** -** If you close a file descriptor that points to a file that has locks, -** all locks on that file that are owned by the current process are -** released. To work around this problem, each OsFile structure contains -** a pointer to an openCnt structure. There is one openCnt structure -** per open inode, which means that multiple OsFiles can point to a single -** openCnt. When an attempt is made to close an OsFile, if there are -** other OsFiles open on the same inode that are holding locks, the call -** to close() the file descriptor is deferred until all of the locks clear. -** The openCnt structure keeps a list of file descriptors that need to -** be closed and that list is walked (and cleared) when the last lock -** clears. -** -** First, under Linux threads, because each thread has a separate -** process ID, lock operations in one thread do not override locks -** to the same file in other threads. Linux threads behave like -** separate processes in this respect. But, if you close a file -** descriptor in linux threads, all locks are cleared, even locks -** on other threads and even though the other threads have different -** process IDs. Linux threads is inconsistent in this respect. -** (I'm beginning to think that linux threads is an abomination too.) -** The consequence of this all is that the hash table for the lockInfo -** structure has to include the process id as part of its key because -** locks in different threads are treated as distinct. But the -** openCnt structure should not include the process id in its -** key because close() clears lock on all threads, not just the current -** thread. Were it not for this goofiness in linux threads, we could -** combine the lockInfo and openCnt structures into a single structure. -*/ - -/* -** An instance of the following structure serves as the key used -** to locate a particular lockInfo structure given its inode. Note -** that we have to include the process ID as part of the key. On some -** threading implementations (ex: linux), each thread has a separate -** process ID. -*/ -struct lockKey { - dev_t dev; /* Device number */ - ino_t ino; /* Inode number */ - pid_t pid; /* Process ID */ -}; - -/* -** An instance of the following structure is allocated for each open -** inode on each thread with a different process ID. (Threads have -** different process IDs on linux, but not on most other unixes.) -** -** A single inode can have multiple file descriptors, so each OsFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of OsFiles pointing to it. -*/ -struct lockInfo { - struct lockKey key; /* The lookup key */ - int cnt; /* 0: unlocked. -1: write lock. 1...: read lock. */ - int nRef; /* Number of pointers to this structure */ -}; - -/* -** An instance of the following structure serves as the key used -** to locate a particular openCnt structure given its inode. This -** is the same as the lockKey except that the process ID is omitted. -*/ -struct openKey { - dev_t dev; /* Device number */ - ino_t ino; /* Inode number */ -}; - -/* -** An instance of the following structure is allocated for each open -** inode. This structure keeps track of the number of locks on that -** inode. If a close is attempted against an inode that is holding -** locks, the close is deferred until all locks clear by adding the -** file descriptor to be closed to the pending list. -*/ -struct openCnt { - struct openKey key; /* The lookup key */ - int nRef; /* Number of pointers to this structure */ - int nLock; /* Number of outstanding locks */ - int nPending; /* Number of pending close() operations */ - int *aPending; /* Malloced space holding fd's awaiting a close() */ -}; - -/* -** These hash table maps inodes and process IDs into lockInfo and openCnt -** structures. Access to these hash tables must be protected by a mutex. -*/ -static Hash lockHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; -static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; - -/* -** Release a lockInfo structure previously allocated by findLockInfo(). -*/ -static void releaseLockInfo(struct lockInfo *pLock){ - pLock->nRef--; - if( pLock->nRef==0 ){ - sqliteHashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0); - sqliteFree(pLock); - } -} - -/* -** Release a openCnt structure previously allocated by findLockInfo(). -*/ -static void releaseOpenCnt(struct openCnt *pOpen){ - pOpen->nRef--; - if( pOpen->nRef==0 ){ - sqliteHashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0); - sqliteFree(pOpen->aPending); - sqliteFree(pOpen); - } -} - -/* -** Given a file descriptor, locate lockInfo and openCnt structures that -** describes that file descriptor. Create a new ones if necessary. The -** return values might be unset if an error occurs. -** -** Return the number of errors. -*/ -int findLockInfo( - int fd, /* The file descriptor used in the key */ - struct lockInfo **ppLock, /* Return the lockInfo structure here */ - struct openCnt **ppOpen /* Return the openCnt structure here */ -){ - int rc; - struct lockKey key1; - struct openKey key2; - struct stat statbuf; - struct lockInfo *pLock; - struct openCnt *pOpen; - rc = fstat(fd, &statbuf); - if( rc!=0 ) return 1; - memset(&key1, 0, sizeof(key1)); - key1.dev = statbuf.st_dev; - key1.ino = statbuf.st_ino; - key1.pid = getpid(); - memset(&key2, 0, sizeof(key2)); - key2.dev = statbuf.st_dev; - key2.ino = statbuf.st_ino; - pLock = (struct lockInfo*)sqliteHashFind(&lockHash, &key1, sizeof(key1)); - if( pLock==0 ){ - struct lockInfo *pOld; - pLock = sqliteMallocRaw( sizeof(*pLock) ); - if( pLock==0 ) return 1; - pLock->key = key1; - pLock->nRef = 1; - pLock->cnt = 0; - pOld = sqliteHashInsert(&lockHash, &pLock->key, sizeof(key1), pLock); - if( pOld!=0 ){ - assert( pOld==pLock ); - sqliteFree(pLock); - return 1; - } - }else{ - pLock->nRef++; - } - *ppLock = pLock; - pOpen = (struct openCnt*)sqliteHashFind(&openHash, &key2, sizeof(key2)); - if( pOpen==0 ){ - struct openCnt *pOld; - pOpen = sqliteMallocRaw( sizeof(*pOpen) ); - if( pOpen==0 ){ - releaseLockInfo(pLock); - return 1; - } - pOpen->key = key2; - pOpen->nRef = 1; - pOpen->nLock = 0; - pOpen->nPending = 0; - pOpen->aPending = 0; - pOld = sqliteHashInsert(&openHash, &pOpen->key, sizeof(key2), pOpen); - if( pOld!=0 ){ - assert( pOld==pOpen ); - sqliteFree(pOpen); - releaseLockInfo(pLock); - return 1; - } - }else{ - pOpen->nRef++; - } - *ppOpen = pOpen; - return 0; -} - -#endif /** POSIX advisory lock work-around **/ - -/* -** If we compile with the SQLITE_TEST macro set, then the following block -** of code will give us the ability to simulate a disk I/O error. This -** is used for testing the I/O recovery logic. -*/ -#ifdef SQLITE_TEST -int sqlite_io_error_pending = 0; -#define SimulateIOError(A) \ - if( sqlite_io_error_pending ) \ - if( sqlite_io_error_pending-- == 1 ){ local_ioerr(); return A; } -static void local_ioerr(){ - sqlite_io_error_pending = 0; /* Really just a place to set a breakpoint */ -} -#else -#define SimulateIOError(A) -#endif - -/* -** When testing, keep a count of the number of open files. -*/ -#ifdef SQLITE_TEST -int sqlite_open_file_count = 0; -#define OpenCounter(X) sqlite_open_file_count+=(X) -#else -#define OpenCounter(X) -#endif - - -/* -** Delete the named file -*/ -int sqliteOsDelete(const char *zFilename){ -#if OS_UNIX - unlink(zFilename); -#endif -#if OS_WIN - DeleteFile(zFilename); -#endif -#if OS_MAC - unlink(zFilename); -#endif - return SQLITE_OK; -} - -/* -** Return TRUE if the named file exists. -*/ -int sqliteOsFileExists(const char *zFilename){ -#if OS_UNIX - return access(zFilename, 0)==0; -#endif -#if OS_WIN - return GetFileAttributes(zFilename) != 0xffffffff; -#endif -#if OS_MAC - return access(zFilename, 0)==0; -#endif -} - - -#if 0 /* NOT USED */ -/* -** Change the name of an existing file. -*/ -int sqliteOsFileRename(const char *zOldName, const char *zNewName){ -#if OS_UNIX - if( link(zOldName, zNewName) ){ - return SQLITE_ERROR; - } - unlink(zOldName); - return SQLITE_OK; -#endif -#if OS_WIN - if( !MoveFile(zOldName, zNewName) ){ - return SQLITE_ERROR; - } - return SQLITE_OK; -#endif -#if OS_MAC - /**** FIX ME ***/ - return SQLITE_ERROR; -#endif -} -#endif /* NOT USED */ - -/* -** Attempt to open a file for both reading and writing. If that -** fails, try opening it read-only. If the file does not exist, -** try to create it. -** -** On success, a handle for the open file is written to *id -** and *pReadonly is set to 0 if the file was opened for reading and -** writing or 1 if the file was opened read-only. The function returns -** SQLITE_OK. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id and *pReadonly unchanged. -*/ -int sqliteOsOpenReadWrite( - const char *zFilename, - OsFile *id, - int *pReadonly -){ -#if OS_UNIX - int rc; - id->dirfd = -1; - id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644); - if( id->fd<0 ){ -#ifdef EISDIR - if( errno==EISDIR ){ - return SQLITE_CANTOPEN; - } -#endif - id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); - if( id->fd<0 ){ - return SQLITE_CANTOPEN; - } - *pReadonly = 1; - }else{ - *pReadonly = 0; - } - sqliteOsEnterMutex(); - rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); - sqliteOsLeaveMutex(); - if( rc ){ - close(id->fd); - return SQLITE_NOMEM; - } - id->locked = 0; - TRACE3("OPEN %-3d %s\n", id->fd, zFilename); - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_WIN - HANDLE h = CreateFile(zFilename, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - h = CreateFile(zFilename, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - *pReadonly = 1; - }else{ - *pReadonly = 0; - } - id->h = h; - id->locked = 0; - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_MAC - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - if( __path2fss(zFilename, &fsSpec) != noErr ){ - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - } - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrShPerm, &(id->refNum)) != noErr ){ - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrPerm, &(id->refNum)) != noErr ){ - if (FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; - else - *pReadonly = 1; - } else - *pReadonly = 0; - } else - *pReadonly = 0; -# else - __path2fss(zFilename, &fsSpec); - if( !sqliteOsFileExists(zFilename) ){ - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - } - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNum)) != noErr ){ - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ){ - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; - else - *pReadonly = 1; - } else - *pReadonly = 0; - } else - *pReadonly = 0; -# endif - if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ - id->refNumRF = -1; - } - id->locked = 0; - id->delOnClose = 0; - OpenCounter(+1); - return SQLITE_OK; -#endif -} - - -/* -** Attempt to open a new file for exclusive access by this process. -** The file will be opened for both reading and writing. To avoid -** a potential security problem, we do not allow the file to have -** previously existed. Nor do we allow the file to be a symbolic -** link. -** -** If delFlag is true, then make arrangements to automatically delete -** the file when it is closed. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ -#if OS_UNIX - int rc; - if( access(zFilename, 0)==0 ){ - return SQLITE_CANTOPEN; - } - id->dirfd = -1; - id->fd = open(zFilename, - O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY, 0600); - if( id->fd<0 ){ - return SQLITE_CANTOPEN; - } - sqliteOsEnterMutex(); - rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); - sqliteOsLeaveMutex(); - if( rc ){ - close(id->fd); - unlink(zFilename); - return SQLITE_NOMEM; - } - id->locked = 0; - if( delFlag ){ - unlink(zFilename); - } - TRACE3("OPEN-EX %-3d %s\n", id->fd, zFilename); - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_WIN - HANDLE h; - int fileflags; - if( delFlag ){ - fileflags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_RANDOM_ACCESS - | FILE_FLAG_DELETE_ON_CLOSE; - }else{ - fileflags = FILE_FLAG_RANDOM_ACCESS; - } - h = CreateFile(zFilename, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - CREATE_ALWAYS, - fileflags, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - id->h = h; - id->locked = 0; - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_MAC - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - __path2fss(zFilename, &fsSpec); - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdWrPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# else - __path2fss(zFilename, &fsSpec); - if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr ) - return SQLITE_CANTOPEN; - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# endif - id->refNumRF = -1; - id->locked = 0; - id->delOnClose = delFlag; - if (delFlag) - id->pathToDel = sqliteOsFullPathname(zFilename); - OpenCounter(+1); - return SQLITE_OK; -#endif -} - -/* -** Attempt to open a new file for read-only access. -** -** On success, write the file handle into *id and return SQLITE_OK. -** -** On failure, return SQLITE_CANTOPEN. -*/ -int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){ -#if OS_UNIX - int rc; - id->dirfd = -1; - id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); - if( id->fd<0 ){ - return SQLITE_CANTOPEN; - } - sqliteOsEnterMutex(); - rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); - sqliteOsLeaveMutex(); - if( rc ){ - close(id->fd); - return SQLITE_NOMEM; - } - id->locked = 0; - TRACE3("OPEN-RO %-3d %s\n", id->fd, zFilename); - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_WIN - HANDLE h = CreateFile(zFilename, - GENERIC_READ, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - NULL - ); - if( h==INVALID_HANDLE_VALUE ){ - return SQLITE_CANTOPEN; - } - id->h = h; - id->locked = 0; - OpenCounter(+1); - return SQLITE_OK; -#endif -#if OS_MAC - FSSpec fsSpec; -# ifdef _LARGE_FILE - HFSUniStr255 dfName; - FSRef fsRef; - if( __path2fss(zFilename, &fsSpec) != noErr ) - return SQLITE_CANTOPEN; - if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr ) - return SQLITE_CANTOPEN; - FSGetDataForkName(&dfName); - if( FSOpenFork(&fsRef, dfName.length, dfName.unicode, - fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# else - __path2fss(zFilename, &fsSpec); - if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr ) - return SQLITE_CANTOPEN; -# endif - if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){ - id->refNumRF = -1; - } - id->locked = 0; - id->delOnClose = 0; - OpenCounter(+1); - return SQLITE_OK; -#endif -} - -/* -** Attempt to open a file descriptor for the directory that contains a -** file. This file descriptor can be used to fsync() the directory -** in order to make sure the creation of a new file is actually written -** to disk. -** -** This routine is only meaningful for Unix. It is a no-op under -** windows since windows does not support hard links. -** -** On success, a handle for a previously open file is at *id is -** updated with the new directory file descriptor and SQLITE_OK is -** returned. -** -** On failure, the function returns SQLITE_CANTOPEN and leaves -** *id unchanged. -*/ -int sqliteOsOpenDirectory( - const char *zDirname, - OsFile *id -){ -#if OS_UNIX - if( id->fd<0 ){ - /* Do not open the directory if the corresponding file is not already - ** open. */ - return SQLITE_CANTOPEN; - } - assert( id->dirfd<0 ); - id->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0644); - if( id->dirfd<0 ){ - return SQLITE_CANTOPEN; - } - TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname); -#endif - return SQLITE_OK; -} - -/* -** If the following global variable points to a string which is the -** name of a directory, then that directory will be used to store -** temporary files. -*/ -const char *sqlite_temp_directory = 0; - -/* -** Create a temporary file name in zBuf. zBuf must be big enough to -** hold at least SQLITE_TEMPNAME_SIZE characters. -*/ -int sqliteOsTempFileName(char *zBuf){ -#if OS_UNIX - static const char *azDirs[] = { - 0, - "/var/tmp", - "/usr/tmp", - "/tmp", - ".", - }; - static unsigned char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789"; - int i, j; - struct stat buf; - const char *zDir = "."; - azDirs[0] = sqlite_temp_directory; - for(i=0; i0 && zTempPath[i-1]=='\\'; i--){} - zTempPath[i] = 0; - zDir = zTempPath; - }else{ - zDir = sqlite_temp_directory; - } - for(;;){ - sprintf(zBuf, "%s\\"TEMP_FILE_PREFIX, zDir); - j = strlen(zBuf); - sqliteRandomness(15, &zBuf[j]); - for(i=0; i<15; i++, j++){ - zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; - } - zBuf[j] = 0; - if( !sqliteOsFileExists(zBuf) ) break; - } -#endif -#if OS_MAC - static char zChars[] = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789"; - int i, j; - char *zDir; - char zTempPath[SQLITE_TEMPNAME_SIZE]; - char zdirName[32]; - CInfoPBRec infoRec; - Str31 dirName; - memset(&infoRec, 0, sizeof(infoRec)); - memset(zTempPath, 0, SQLITE_TEMPNAME_SIZE); - if( sqlite_temp_directory!=0 ){ - zDir = sqlite_temp_directory; - }else if( FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder, - &(infoRec.dirInfo.ioVRefNum), &(infoRec.dirInfo.ioDrParID)) == noErr ){ - infoRec.dirInfo.ioNamePtr = dirName; - do{ - infoRec.dirInfo.ioFDirIndex = -1; - infoRec.dirInfo.ioDrDirID = infoRec.dirInfo.ioDrParID; - if( PBGetCatInfoSync(&infoRec) == noErr ){ - CopyPascalStringToC(dirName, zdirName); - i = strlen(zdirName); - memmove(&(zTempPath[i+1]), zTempPath, strlen(zTempPath)); - strcpy(zTempPath, zdirName); - zTempPath[i] = ':'; - }else{ - *zTempPath = 0; - break; - } - } while( infoRec.dirInfo.ioDrDirID != fsRtDirID ); - zDir = zTempPath; - } - if( zDir[0]==0 ){ - getcwd(zTempPath, SQLITE_TEMPNAME_SIZE-24); - zDir = zTempPath; - } - for(;;){ - sprintf(zBuf, "%s"TEMP_FILE_PREFIX, zDir); - j = strlen(zBuf); - sqliteRandomness(15, &zBuf[j]); - for(i=0; i<15; i++, j++){ - zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; - } - zBuf[j] = 0; - if( !sqliteOsFileExists(zBuf) ) break; - } -#endif - return SQLITE_OK; -} - -/* -** Close a file. -*/ -int sqliteOsClose(OsFile *id){ -#if OS_UNIX - sqliteOsUnlock(id); - if( id->dirfd>=0 ) close(id->dirfd); - id->dirfd = -1; - sqliteOsEnterMutex(); - if( id->pOpen->nLock ){ - /* If there are outstanding locks, do not actually close the file just - ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->aPending. It will be automatically closed when - ** the last lock is cleared. - */ - int *aNew; - struct openCnt *pOpen = id->pOpen; - pOpen->nPending++; - aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) ); - if( aNew==0 ){ - /* If a malloc fails, just leak the file descriptor */ - }else{ - pOpen->aPending = aNew; - pOpen->aPending[pOpen->nPending-1] = id->fd; - } - }else{ - /* There are no outstanding locks so we can close the file immediately */ - close(id->fd); - } - releaseLockInfo(id->pLock); - releaseOpenCnt(id->pOpen); - sqliteOsLeaveMutex(); - TRACE2("CLOSE %-3d\n", id->fd); - OpenCounter(-1); - return SQLITE_OK; -#endif -#if OS_WIN - CloseHandle(id->h); - OpenCounter(-1); - return SQLITE_OK; -#endif -#if OS_MAC - if( id->refNumRF!=-1 ) - FSClose(id->refNumRF); -# ifdef _LARGE_FILE - FSCloseFork(id->refNum); -# else - FSClose(id->refNum); -# endif - if( id->delOnClose ){ - unlink(id->pathToDel); - sqliteFree(id->pathToDel); - } - OpenCounter(-1); - return SQLITE_OK; -#endif -} - -/* -** Read data from a file into a buffer. Return SQLITE_OK if all -** bytes were read successfully and SQLITE_IOERR if anything goes -** wrong. -*/ -int sqliteOsRead(OsFile *id, void *pBuf, int amt){ -#if OS_UNIX - int got; - SimulateIOError(SQLITE_IOERR); - TIMER_START; - got = read(id->fd, pBuf, amt); - TIMER_END; - TRACE4("READ %-3d %7d %d\n", id->fd, last_page, elapse); - SEEK(0); - /* if( got<0 ) got = 0; */ - if( got==amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -#endif -#if OS_WIN - DWORD got; - SimulateIOError(SQLITE_IOERR); - TRACE2("READ %d\n", last_page); - if( !ReadFile(id->h, pBuf, amt, &got, 0) ){ - got = 0; - } - if( got==(DWORD)amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -#endif -#if OS_MAC - int got; - SimulateIOError(SQLITE_IOERR); - TRACE2("READ %d\n", last_page); -# ifdef _LARGE_FILE - FSReadFork(id->refNum, fsAtMark, 0, (ByteCount)amt, pBuf, (ByteCount*)&got); -# else - got = amt; - FSRead(id->refNum, &got, pBuf); -# endif - if( got==amt ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -#endif -} - -/* -** Write data from a buffer into a file. Return SQLITE_OK on success -** or some other error code on failure. -*/ -int sqliteOsWrite(OsFile *id, const void *pBuf, int amt){ -#if OS_UNIX - int wrote = 0; - SimulateIOError(SQLITE_IOERR); - TIMER_START; - while( amt>0 && (wrote = write(id->fd, pBuf, amt))>0 ){ - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - TIMER_END; - TRACE4("WRITE %-3d %7d %d\n", id->fd, last_page, elapse); - SEEK(0); - if( amt>0 ){ - return SQLITE_FULL; - } - return SQLITE_OK; -#endif -#if OS_WIN - int rc; - DWORD wrote; - SimulateIOError(SQLITE_IOERR); - TRACE2("WRITE %d\n", last_page); - while( amt>0 && (rc = WriteFile(id->h, pBuf, amt, &wrote, 0))!=0 && wrote>0 ){ - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - if( !rc || amt>(int)wrote ){ - return SQLITE_FULL; - } - return SQLITE_OK; -#endif -#if OS_MAC - OSErr oserr; - int wrote = 0; - SimulateIOError(SQLITE_IOERR); - TRACE2("WRITE %d\n", last_page); - while( amt>0 ){ -# ifdef _LARGE_FILE - oserr = FSWriteFork(id->refNum, fsAtMark, 0, - (ByteCount)amt, pBuf, (ByteCount*)&wrote); -# else - wrote = amt; - oserr = FSWrite(id->refNum, &wrote, pBuf); -# endif - if( wrote == 0 || oserr != noErr) - break; - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - if( oserr != noErr || amt>wrote ){ - return SQLITE_FULL; - } - return SQLITE_OK; -#endif -} - -/* -** Move the read/write pointer in a file. -*/ -int sqliteOsSeek(OsFile *id, off_t offset){ - SEEK(offset/1024 + 1); -#if OS_UNIX - lseek(id->fd, offset, SEEK_SET); - return SQLITE_OK; -#endif -#if OS_WIN - { - LONG upperBits = offset>>32; - LONG lowerBits = offset & 0xffffffff; - DWORD rc; - rc = SetFilePointer(id->h, lowerBits, &upperBits, FILE_BEGIN); - /* TRACE3("SEEK rc=0x%x upper=0x%x\n", rc, upperBits); */ - } - return SQLITE_OK; -#endif -#if OS_MAC - { - off_t curSize; - if( sqliteOsFileSize(id, &curSize) != SQLITE_OK ){ - return SQLITE_IOERR; - } - if( offset >= curSize ){ - if( sqliteOsTruncate(id, offset+1) != SQLITE_OK ){ - return SQLITE_IOERR; - } - } -# ifdef _LARGE_FILE - if( FSSetForkPosition(id->refNum, fsFromStart, offset) != noErr ){ -# else - if( SetFPos(id->refNum, fsFromStart, offset) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } - } -#endif -} - -#ifdef SQLITE_NOSYNC -# define fsync(X) 0 -#endif - -/* -** Make sure all writes to a particular file are committed to disk. -** -** Under Unix, also make sure that the directory entry for the file -** has been created by fsync-ing the directory that contains the file. -** If we do not do this and we encounter a power failure, the directory -** entry for the journal might not exist after we reboot. The next -** SQLite to access the file will not know that the journal exists (because -** the directory entry for the journal was never created) and the transaction -** will not roll back - possibly leading to database corruption. -*/ -int sqliteOsSync(OsFile *id){ -#if OS_UNIX - SimulateIOError(SQLITE_IOERR); - TRACE2("SYNC %-3d\n", id->fd); - if( fsync(id->fd) ){ - return SQLITE_IOERR; - }else{ - if( id->dirfd>=0 ){ - TRACE2("DIRSYNC %-3d\n", id->dirfd); - fsync(id->dirfd); - close(id->dirfd); /* Only need to sync once, so close the directory */ - id->dirfd = -1; /* when we are done. */ - } - return SQLITE_OK; - } -#endif -#if OS_WIN - if( FlushFileBuffers(id->h) ){ - return SQLITE_OK; - }else{ - return SQLITE_IOERR; - } -#endif -#if OS_MAC -# ifdef _LARGE_FILE - if( FSFlushFork(id->refNum) != noErr ){ -# else - ParamBlockRec params; - memset(¶ms, 0, sizeof(ParamBlockRec)); - params.ioParam.ioRefNum = id->refNum; - if( PBFlushFileSync(¶ms) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -#endif -} - -/* -** Truncate an open file to a specified size -*/ -int sqliteOsTruncate(OsFile *id, off_t nByte){ - SimulateIOError(SQLITE_IOERR); -#if OS_UNIX - return ftruncate(id->fd, nByte)==0 ? SQLITE_OK : SQLITE_IOERR; -#endif -#if OS_WIN - { - LONG upperBits = nByte>>32; - SetFilePointer(id->h, nByte, &upperBits, FILE_BEGIN); - SetEndOfFile(id->h); - } - return SQLITE_OK; -#endif -#if OS_MAC -# ifdef _LARGE_FILE - if( FSSetForkSize(id->refNum, fsFromStart, nByte) != noErr){ -# else - if( SetEOF(id->refNum, nByte) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -#endif -} - -/* -** Determine the current size of a file in bytes -*/ -int sqliteOsFileSize(OsFile *id, off_t *pSize){ -#if OS_UNIX - struct stat buf; - SimulateIOError(SQLITE_IOERR); - if( fstat(id->fd, &buf)!=0 ){ - return SQLITE_IOERR; - } - *pSize = buf.st_size; - return SQLITE_OK; -#endif -#if OS_WIN - DWORD upperBits, lowerBits; - SimulateIOError(SQLITE_IOERR); - lowerBits = GetFileSize(id->h, &upperBits); - *pSize = (((off_t)upperBits)<<32) + lowerBits; - return SQLITE_OK; -#endif -#if OS_MAC -# ifdef _LARGE_FILE - if( FSGetForkSize(id->refNum, pSize) != noErr){ -# else - if( GetEOF(id->refNum, pSize) != noErr ){ -# endif - return SQLITE_IOERR; - }else{ - return SQLITE_OK; - } -#endif -} - -#if OS_WIN -/* -** Return true (non-zero) if we are running under WinNT, Win2K or WinXP. -** Return false (zero) for Win95, Win98, or WinME. -** -** Here is an interesting observation: Win95, Win98, and WinME lack -** the LockFileEx() API. But we can still statically link against that -** API as long as we don't call it win running Win95/98/ME. A call to -** this routine is used to determine if the host is Win95/98/ME or -** WinNT/2K/XP so that we will know whether or not we can safely call -** the LockFileEx() API. -*/ -int isNT(void){ - static int osType = 0; /* 0=unknown 1=win95 2=winNT */ - if( osType==0 ){ - OSVERSIONINFO sInfo; - sInfo.dwOSVersionInfoSize = sizeof(sInfo); - GetVersionEx(&sInfo); - osType = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; - } - return osType==2; -} -#endif - -/* -** Windows file locking notes: [similar issues apply to MacOS] -** -** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because -** those functions are not available. So we use only LockFile() and -** UnlockFile(). -** -** LockFile() prevents not just writing but also reading by other processes. -** (This is a design error on the part of Windows, but there is nothing -** we can do about that.) So the region used for locking is at the -** end of the file where it is unlikely to ever interfere with an -** actual read attempt. -** -** A database read lock is obtained by locking a single randomly-chosen -** byte out of a specific range of bytes. The lock byte is obtained at -** random so two separate readers can probably access the file at the -** same time, unless they are unlucky and choose the same lock byte. -** A database write lock is obtained by locking all bytes in the range. -** There can only be one writer. -** -** A lock is obtained on the first byte of the lock range before acquiring -** either a read lock or a write lock. This prevents two processes from -** attempting to get a lock at a same time. The semantics of -** sqliteOsReadLock() require that if there is already a write lock, that -** lock is converted into a read lock atomically. The lock on the first -** byte allows us to drop the old write lock and get the read lock without -** another process jumping into the middle and messing us up. The same -** argument applies to sqliteOsWriteLock(). -** -** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available, -** which means we can use reader/writer locks. When reader writer locks -** are used, the lock is placed on the same range of bytes that is used -** for probabilistic locking in Win95/98/ME. Hence, the locking scheme -** will support two or more Win95 readers or two or more WinNT readers. -** But a single Win95 reader will lock out all WinNT readers and a single -** WinNT reader will lock out all other Win95 readers. -** -** Note: On MacOS we use the resource fork for locking. -** -** The following #defines specify the range of bytes used for locking. -** N_LOCKBYTE is the number of bytes available for doing the locking. -** The first byte used to hold the lock while the lock is changing does -** not count toward this number. FIRST_LOCKBYTE is the address of -** the first byte in the range of bytes used for locking. -*/ -#define N_LOCKBYTE 10239 -#if OS_MAC -# define FIRST_LOCKBYTE (0x000fffff - N_LOCKBYTE) -#else -# define FIRST_LOCKBYTE (0xffffffff - N_LOCKBYTE) -#endif - -/* -** Change the status of the lock on the file "id" to be a readlock. -** If the file was write locked, then this reduces the lock to a read. -** If the file was read locked, then this acquires a new read lock. -** -** Return SQLITE_OK on success and SQLITE_BUSY on failure. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqliteOsReadLock(OsFile *id){ -#if OS_UNIX - int rc; - sqliteOsEnterMutex(); - if( id->pLock->cnt>0 ){ - if( !id->locked ){ - id->pLock->cnt++; - id->locked = 1; - id->pOpen->nLock++; - } - rc = SQLITE_OK; - }else if( id->locked || id->pLock->cnt==0 ){ - struct flock lock; - int s; - lock.l_type = F_RDLCK; - lock.l_whence = SEEK_SET; - lock.l_start = lock.l_len = 0L; - s = fcntl(id->fd, F_SETLK, &lock); - if( s!=0 ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - }else{ - rc = SQLITE_OK; - if( !id->locked ){ - id->pOpen->nLock++; - id->locked = 1; - } - id->pLock->cnt = 1; - } - }else{ - rc = SQLITE_BUSY; - } - sqliteOsLeaveMutex(); - return rc; -#endif -#if OS_WIN - int rc; - if( id->locked>0 ){ - rc = SQLITE_OK; - }else{ - int lk; - int res; - int cnt = 100; - sqliteRandomness(sizeof(lk), &lk); - lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1; - while( cnt-->0 && (res = LockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0))==0 ){ - Sleep(1); - } - if( res ){ - UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); - if( isNT() ){ - OVERLAPPED ovlp; - ovlp.Offset = FIRST_LOCKBYTE+1; - ovlp.OffsetHigh = 0; - ovlp.hEvent = 0; - res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, - 0, N_LOCKBYTE, 0, &ovlp); - }else{ - res = LockFile(id->h, FIRST_LOCKBYTE+lk, 0, 1, 0); - } - UnlockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0); - } - if( res ){ - id->locked = lk; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -#endif -#if OS_MAC - int rc; - if( id->locked>0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else{ - int lk; - OSErr res; - int cnt = 5; - ParamBlockRec params; - sqliteRandomness(sizeof(lk), &lk); - lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ - UInt32 finalTicks; - Delay(1, &finalTicks); /* 1/60 sec */ - } - if( res == noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - PBUnlockRangeSync(¶ms); - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+lk; - params.ioParam.ioReqCount = 1; - res = PBLockRangeSync(¶ms); - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - } - if( res == noErr ){ - id->locked = lk; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -#endif -} - -/* -** Change the lock status to be an exclusive or write lock. Return -** SQLITE_OK on success and SQLITE_BUSY on a failure. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqliteOsWriteLock(OsFile *id){ -#if OS_UNIX - int rc; - sqliteOsEnterMutex(); - if( id->pLock->cnt==0 || (id->pLock->cnt==1 && id->locked==1) ){ - struct flock lock; - int s; - lock.l_type = F_WRLCK; - lock.l_whence = SEEK_SET; - lock.l_start = lock.l_len = 0L; - s = fcntl(id->fd, F_SETLK, &lock); - if( s!=0 ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - }else{ - rc = SQLITE_OK; - if( !id->locked ){ - id->pOpen->nLock++; - id->locked = 1; - } - id->pLock->cnt = -1; - } - }else{ - rc = SQLITE_BUSY; - } - sqliteOsLeaveMutex(); - return rc; -#endif -#if OS_WIN - int rc; - if( id->locked<0 ){ - rc = SQLITE_OK; - }else{ - int res; - int cnt = 100; - while( cnt-->0 && (res = LockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0))==0 ){ - Sleep(1); - } - if( res ){ - if( id->locked>0 ){ - if( isNT() ){ - UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); - }else{ - res = UnlockFile(id->h, FIRST_LOCKBYTE + id->locked, 0, 1, 0); - } - } - if( res ){ - res = LockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); - }else{ - res = 0; - } - UnlockFile(id->h, FIRST_LOCKBYTE, 0, 1, 0); - } - if( res ){ - id->locked = -1; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -#endif -#if OS_MAC - int rc; - if( id->locked<0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else{ - OSErr res; - int cnt = 5; - ParamBlockRec params; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - while( cnt-->0 && (res = PBLockRangeSync(¶ms))!=noErr ){ - UInt32 finalTicks; - Delay(1, &finalTicks); /* 1/60 sec */ - } - if( res == noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE + id->locked; - params.ioParam.ioReqCount = 1; - if( id->locked==0 - || PBUnlockRangeSync(¶ms)==noErr ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - res = PBLockRangeSync(¶ms); - }else{ - res = afpRangeNotLocked; - } - params.ioParam.ioPosOffset = FIRST_LOCKBYTE; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - } - if( res == noErr ){ - id->locked = -1; - rc = SQLITE_OK; - }else{ - rc = SQLITE_BUSY; - } - } - return rc; -#endif -} - -/* -** Unlock the given file descriptor. If the file descriptor was -** not previously locked, then this routine is a no-op. If this -** library was compiled with large file support (LFS) but LFS is not -** available on the host, then an SQLITE_NOLFS is returned. -*/ -int sqliteOsUnlock(OsFile *id){ -#if OS_UNIX - int rc; - if( !id->locked ) return SQLITE_OK; - sqliteOsEnterMutex(); - assert( id->pLock->cnt!=0 ); - if( id->pLock->cnt>1 ){ - id->pLock->cnt--; - rc = SQLITE_OK; - }else{ - struct flock lock; - int s; - lock.l_type = F_UNLCK; - lock.l_whence = SEEK_SET; - lock.l_start = lock.l_len = 0L; - s = fcntl(id->fd, F_SETLK, &lock); - if( s!=0 ){ - rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; - }else{ - rc = SQLITE_OK; - id->pLock->cnt = 0; - } - } - if( rc==SQLITE_OK ){ - /* Decrement the count of locks against this same file. When the - ** count reaches zero, close any other file descriptors whose close - ** was deferred because of outstanding locks. - */ - struct openCnt *pOpen = id->pOpen; - pOpen->nLock--; - assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 && pOpen->nPending>0 ){ - int i; - for(i=0; inPending; i++){ - close(pOpen->aPending[i]); - } - sqliteFree(pOpen->aPending); - pOpen->nPending = 0; - pOpen->aPending = 0; - } - } - sqliteOsLeaveMutex(); - id->locked = 0; - return rc; -#endif -#if OS_WIN - int rc; - if( id->locked==0 ){ - rc = SQLITE_OK; - }else if( isNT() || id->locked<0 ){ - UnlockFile(id->h, FIRST_LOCKBYTE+1, 0, N_LOCKBYTE, 0); - rc = SQLITE_OK; - id->locked = 0; - }else{ - UnlockFile(id->h, FIRST_LOCKBYTE+id->locked, 0, 1, 0); - rc = SQLITE_OK; - id->locked = 0; - } - return rc; -#endif -#if OS_MAC - int rc; - ParamBlockRec params; - memset(¶ms, 0, sizeof(params)); - params.ioParam.ioRefNum = id->refNumRF; - params.ioParam.ioPosMode = fsFromStart; - if( id->locked==0 || id->refNumRF == -1 ){ - rc = SQLITE_OK; - }else if( id->locked<0 ){ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1; - params.ioParam.ioReqCount = N_LOCKBYTE; - PBUnlockRangeSync(¶ms); - rc = SQLITE_OK; - id->locked = 0; - }else{ - params.ioParam.ioPosOffset = FIRST_LOCKBYTE+id->locked; - params.ioParam.ioReqCount = 1; - PBUnlockRangeSync(¶ms); - rc = SQLITE_OK; - id->locked = 0; - } - return rc; -#endif -} - -/* -** Get information to seed the random number generator. The seed -** is written into the buffer zBuf[256]. The calling function must -** supply a sufficiently large buffer. -*/ -int sqliteOsRandomSeed(char *zBuf){ - /* We have to initialize zBuf to prevent valgrind from reporting - ** errors. The reports issued by valgrind are incorrect - we would - ** prefer that the randomness be increased by making use of the - ** uninitialized space in zBuf - but valgrind errors tend to worry - ** some users. Rather than argue, it seems easier just to initialize - ** the whole array and silence valgrind, even if that means less randomness - ** in the random seed. - ** - ** When testing, initializing zBuf[] to zero is all we do. That means - ** that we always use the same random number sequence.* This makes the - ** tests repeatable. - */ - memset(zBuf, 0, 256); -#if OS_UNIX && !defined(SQLITE_TEST) - { - int pid; - time((time_t*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); - } -#endif -#if OS_WIN && !defined(SQLITE_TEST) - GetSystemTime((LPSYSTEMTIME)zBuf); -#endif -#if OS_MAC - { - int pid; - Microseconds((UnsignedWide*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid)); - } -#endif - return SQLITE_OK; -} - -/* -** Sleep for a little while. Return the amount of time slept. -*/ -int sqliteOsSleep(int ms){ -#if OS_UNIX -#if defined(HAVE_USLEEP) && HAVE_USLEEP - usleep(ms*1000); - return ms; -#else - sleep((ms+999)/1000); - return 1000*((ms+999)/1000); -#endif -#endif -#if OS_WIN - Sleep(ms); - return ms; -#endif -#if OS_MAC - UInt32 finalTicks; - UInt32 ticks = (((UInt32)ms+16)*3)/50; /* 1/60 sec per tick */ - Delay(ticks, &finalTicks); - return (int)((ticks*50)/3); -#endif -} - -/* -** Static variables used for thread synchronization -*/ -static int inMutex = 0; -#ifdef SQLITE_UNIX_THREADS - static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -#endif -#ifdef SQLITE_W32_THREADS - static CRITICAL_SECTION cs; -#endif -#ifdef SQLITE_MACOS_MULTITASKING - static MPCriticalRegionID criticalRegion; -#endif - -/* -** The following pair of routine implement mutual exclusion for -** multi-threaded processes. Only a single thread is allowed to -** executed code that is surrounded by EnterMutex() and LeaveMutex(). -** -** SQLite uses only a single Mutex. There is not much critical -** code and what little there is executes quickly and without blocking. -*/ -void sqliteOsEnterMutex(){ -#ifdef SQLITE_UNIX_THREADS - pthread_mutex_lock(&mutex); -#endif -#ifdef SQLITE_W32_THREADS - static int isInit = 0; - while( !isInit ){ - static long lock = 0; - if( InterlockedIncrement(&lock)==1 ){ - InitializeCriticalSection(&cs); - isInit = 1; - }else{ - Sleep(1); - } - } - EnterCriticalSection(&cs); -#endif -#ifdef SQLITE_MACOS_MULTITASKING - static volatile int notInit = 1; - if( notInit ){ - if( notInit == 2 ) /* as close as you can get to thread safe init */ - MPYield(); - else{ - notInit = 2; - MPCreateCriticalRegion(&criticalRegion); - notInit = 0; - } - } - MPEnterCriticalRegion(criticalRegion, kDurationForever); -#endif - assert( !inMutex ); - inMutex = 1; -} -void sqliteOsLeaveMutex(){ - assert( inMutex ); - inMutex = 0; -#ifdef SQLITE_UNIX_THREADS - pthread_mutex_unlock(&mutex); -#endif -#ifdef SQLITE_W32_THREADS - LeaveCriticalSection(&cs); -#endif -#ifdef SQLITE_MACOS_MULTITASKING - MPExitCriticalRegion(criticalRegion); -#endif -} - -/* -** Turn a relative pathname into a full pathname. Return a pointer -** to the full pathname stored in space obtained from sqliteMalloc(). -** The calling function is responsible for freeing this space once it -** is no longer needed. -*/ -char *sqliteOsFullPathname(const char *zRelative){ -#if OS_UNIX - char *zFull = 0; - if( zRelative[0]=='/' ){ - sqliteSetString(&zFull, zRelative, (char*)0); - }else{ - char zBuf[5000]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, - (char*)0); - } - return zFull; -#endif -#if OS_WIN - char *zNotUsed; - char *zFull; - int nByte; - nByte = GetFullPathName(zRelative, 0, 0, &zNotUsed) + 1; - zFull = sqliteMalloc( nByte ); - if( zFull==0 ) return 0; - GetFullPathName(zRelative, nByte, zFull, &zNotUsed); - return zFull; -#endif -#if OS_MAC - char *zFull = 0; - if( zRelative[0]==':' ){ - char zBuf[_MAX_PATH+1]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), - (char*)0); - }else{ - if( strchr(zRelative, ':') ){ - sqliteSetString(&zFull, zRelative, (char*)0); - }else{ - char zBuf[_MAX_PATH+1]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0); - } - } - return zFull; -#endif -} - -/* -** The following variable, if set to a non-zero value, becomes the result -** returned from sqliteOsCurrentTime(). This is used for testing. -*/ -#ifdef SQLITE_TEST -int sqlite_current_time = 0; -#endif - -/* -** Find the current time (in Universal Coordinated Time). Write the -** current time and date as a Julian Day number into *prNow and -** return 0. Return 1 if the time and date cannot be found. -*/ -int sqliteOsCurrentTime(double *prNow){ -#if OS_UNIX - time_t t; - time(&t); - *prNow = t/86400.0 + 2440587.5; -#endif -#if OS_WIN - FILETIME ft; - /* FILETIME structure is a 64-bit value representing the number of - 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). - */ - double now; - GetSystemTimeAsFileTime( &ft ); - now = ((double)ft.dwHighDateTime) * 4294967296.0; - *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5; -#endif -#ifdef SQLITE_TEST - if( sqlite_current_time ){ - *prNow = sqlite_current_time/86400.0 + 2440587.5; - } -#endif - return 0; -} diff --git a/ext/sqlite/libsqlite/src/os.h b/ext/sqlite/libsqlite/src/os.h deleted file mode 100644 index d1395841d2f64..0000000000000 --- a/ext/sqlite/libsqlite/src/os.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -** 2001 September 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file (together with is companion C source-code file -** "os.c") attempt to abstract the underlying operating system so that -** the SQLite library will work on both POSIX and windows systems. -*/ -#ifndef _SQLITE_OS_H_ -#define _SQLITE_OS_H_ - -/* -** Helpful hint: To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE -** to the compiler command line. -*/ - -/* -** These #defines should enable >2GB file support on Posix if the -** underlying operating system supports it. If the OS lacks -** large file support, or if the OS is windows, these should be no-ops. -** -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch -** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: RedHat 7.2) but you want your code to work -** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 -** without this option, LFS is enable. But LFS does not exist in the kernel -** in RedHat 6.0, so the code won't work. Hence, for maximum binary -** portability you should omit LFS. -** -** Similar is true for MacOS. LFS is only supported on MacOS 9 and later. -*/ -#ifndef SQLITE_DISABLE_LFS -# define _LARGE_FILE 1 -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# define _LARGEFILE_SOURCE 1 -#endif - -/* -** Temporary files are named starting with this prefix followed by 16 random -** alphanumeric characters, and no file extension. They are stored in the -** OS's standard temporary file directory, and are deleted prior to exit. -** If sqlite is being embedded in another program, you may wish to change the -** prefix to reflect your program's name, so that if your program exits -** prematurely, old temporary files can be easily identified. This can be done -** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line. -*/ -#ifndef TEMP_FILE_PREFIX -# define TEMP_FILE_PREFIX "sqlite_" -#endif - -/* -** Figure out if we are dealing with Unix, Windows or MacOS. -** -** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix. -** The MacOS build is designed to use CodeWarrior (tested with v8) -*/ -#ifndef OS_UNIX -# ifndef OS_WIN -# ifndef OS_MAC -# if defined(__MACOS__) -# define OS_MAC 1 -# define OS_WIN 0 -# define OS_UNIX 0 -# elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) -# define OS_MAC 0 -# define OS_WIN 1 -# define OS_UNIX 0 -# else -# define OS_MAC 0 -# define OS_WIN 0 -# define OS_UNIX 1 -# endif -# else -# define OS_WIN 0 -# define OS_UNIX 0 -# endif -# else -# define OS_MAC 0 -# define OS_UNIX 0 -# endif -#else -# define OS_MAC 0 -# ifndef OS_WIN -# define OS_WIN 0 -# endif -#endif - -/* -** A handle for an open file is stored in an OsFile object. -*/ -#if OS_UNIX -# include -# include -# include -# include - typedef struct OsFile OsFile; - struct OsFile { - struct openCnt *pOpen; /* Info about all open fd's on this inode */ - struct lockInfo *pLock; /* Info about locks on this inode */ - int fd; /* The file descriptor */ - int locked; /* True if this instance holds the lock */ - int dirfd; /* File descriptor for the directory */ - }; -# define SQLITE_TEMPNAME_SIZE 200 -# if defined(HAVE_USLEEP) && HAVE_USLEEP -# define SQLITE_MIN_SLEEP_MS 1 -# else -# define SQLITE_MIN_SLEEP_MS 1000 -# endif -#endif - -#if OS_WIN -#include -#include - typedef struct OsFile OsFile; - struct OsFile { - HANDLE h; /* Handle for accessing the file */ - int locked; /* 0: unlocked, <0: write lock, >0: read lock */ - }; -# if defined(_MSC_VER) || defined(__BORLANDC__) - typedef __int64 off_t; -# else -# if !defined(_CYGWIN_TYPES_H) - typedef long long off_t; -# if defined(__MINGW32__) -# define _OFF_T_ -# endif -# endif -# endif -# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50) -# define SQLITE_MIN_SLEEP_MS 1 -#endif - -#if OS_MAC -# include -# include - typedef struct OsFile OsFile; - struct OsFile { - SInt16 refNum; /* Data fork/file reference number */ - SInt16 refNumRF; /* Resource fork reference number (for locking) */ - int locked; /* 0: unlocked, <0: write lock, >0: read lock */ - int delOnClose; /* True if file is to be deleted on close */ - char *pathToDel; /* Name of file to delete on close */ - }; -# ifdef _LARGE_FILE - typedef SInt64 off_t; -# else - typedef SInt32 off_t; -# endif -# define SQLITE_TEMPNAME_SIZE _MAX_PATH -# define SQLITE_MIN_SLEEP_MS 17 -#endif - -int sqliteOsDelete(const char*); -int sqliteOsFileExists(const char*); -int sqliteOsFileRename(const char*, const char*); -int sqliteOsOpenReadWrite(const char*, OsFile*, int*); -int sqliteOsOpenExclusive(const char*, OsFile*, int); -int sqliteOsOpenReadOnly(const char*, OsFile*); -int sqliteOsOpenDirectory(const char*, OsFile*); -int sqliteOsTempFileName(char*); -int sqliteOsClose(OsFile*); -int sqliteOsRead(OsFile*, void*, int amt); -int sqliteOsWrite(OsFile*, const void*, int amt); -int sqliteOsSeek(OsFile*, off_t offset); -int sqliteOsSync(OsFile*); -int sqliteOsTruncate(OsFile*, off_t size); -int sqliteOsFileSize(OsFile*, off_t *pSize); -int sqliteOsReadLock(OsFile*); -int sqliteOsWriteLock(OsFile*); -int sqliteOsUnlock(OsFile*); -int sqliteOsRandomSeed(char*); -int sqliteOsSleep(int ms); -int sqliteOsCurrentTime(double*); -void sqliteOsEnterMutex(void); -void sqliteOsLeaveMutex(void); -char *sqliteOsFullPathname(const char*); - - - -#endif /* _SQLITE_OS_H_ */ diff --git a/ext/sqlite/libsqlite/src/pager.c b/ext/sqlite/libsqlite/src/pager.c deleted file mode 100644 index 23d3fb80093ae..0000000000000 --- a/ext/sqlite/libsqlite/src/pager.c +++ /dev/null @@ -1,2220 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the implementation of the page cache subsystem or "pager". -** -** The pager is used to access a database disk file. It implements -** atomic commit and rollback through the use of a journal file that -** is separate from the database file. The pager also implements file -** locking to prevent two processes from writing the same database -** file simultaneously, or one process from reading the database while -** another is writing. -** -** @(#) $Id$ -*/ -#include "os.h" /* Must be first to enable large file support */ -#include "sqliteInt.h" -#include "pager.h" -#include -#include - -/* -** Macros for troubleshooting. Normally turned off -*/ -#if 0 -static Pager *mainPager = 0; -#define SET_PAGER(X) if( mainPager==0 ) mainPager = (X) -#define CLR_PAGER(X) if( mainPager==(X) ) mainPager = 0 -#define TRACE1(X) if( pPager==mainPager ) fprintf(stderr,X) -#define TRACE2(X,Y) if( pPager==mainPager ) fprintf(stderr,X,Y) -#define TRACE3(X,Y,Z) if( pPager==mainPager ) fprintf(stderr,X,Y,Z) -#else -#define SET_PAGER(X) -#define CLR_PAGER(X) -#define TRACE1(X) -#define TRACE2(X,Y) -#define TRACE3(X,Y,Z) -#endif - - -/* -** The page cache as a whole is always in one of the following -** states: -** -** SQLITE_UNLOCK The page cache is not currently reading or -** writing the database file. There is no -** data held in memory. This is the initial -** state. -** -** SQLITE_READLOCK The page cache is reading the database. -** Writing is not permitted. There can be -** multiple readers accessing the same database -** file at the same time. -** -** SQLITE_WRITELOCK The page cache is writing the database. -** Access is exclusive. No other processes or -** threads can be reading or writing while one -** process is writing. -** -** The page cache comes up in SQLITE_UNLOCK. The first time a -** sqlite_page_get() occurs, the state transitions to SQLITE_READLOCK. -** After all pages have been released using sqlite_page_unref(), -** the state transitions back to SQLITE_UNLOCK. The first time -** that sqlite_page_write() is called, the state transitions to -** SQLITE_WRITELOCK. (Note that sqlite_page_write() can only be -** called on an outstanding page which means that the pager must -** be in SQLITE_READLOCK before it transitions to SQLITE_WRITELOCK.) -** The sqlite_page_rollback() and sqlite_page_commit() functions -** transition the state from SQLITE_WRITELOCK back to SQLITE_READLOCK. -*/ -#define SQLITE_UNLOCK 0 -#define SQLITE_READLOCK 1 -#define SQLITE_WRITELOCK 2 - - -/* -** Each in-memory image of a page begins with the following header. -** This header is only visible to this pager module. The client -** code that calls pager sees only the data that follows the header. -** -** Client code should call sqlitepager_write() on a page prior to making -** any modifications to that page. The first time sqlitepager_write() -** is called, the original page contents are written into the rollback -** journal and PgHdr.inJournal and PgHdr.needSync are set. Later, once -** the journal page has made it onto the disk surface, PgHdr.needSync -** is cleared. The modified page cannot be written back into the original -** database file until the journal pages has been synced to disk and the -** PgHdr.needSync has been cleared. -** -** The PgHdr.dirty flag is set when sqlitepager_write() is called and -** is cleared again when the page content is written back to the original -** database file. -*/ -typedef struct PgHdr PgHdr; -struct PgHdr { - Pager *pPager; /* The pager to which this page belongs */ - Pgno pgno; /* The page number for this page */ - PgHdr *pNextHash, *pPrevHash; /* Hash collision chain for PgHdr.pgno */ - int nRef; /* Number of users of this page */ - PgHdr *pNextFree, *pPrevFree; /* Freelist of pages where nRef==0 */ - PgHdr *pNextAll, *pPrevAll; /* A list of all pages */ - PgHdr *pNextCkpt, *pPrevCkpt; /* List of pages in the checkpoint journal */ - u8 inJournal; /* TRUE if has been written to journal */ - u8 inCkpt; /* TRUE if written to the checkpoint journal */ - u8 dirty; /* TRUE if we need to write back changes */ - u8 needSync; /* Sync journal before writing this page */ - u8 alwaysRollback; /* Disable dont_rollback() for this page */ - PgHdr *pDirty; /* Dirty pages sorted by PgHdr.pgno */ - /* SQLITE_PAGE_SIZE bytes of page data follow this header */ - /* Pager.nExtra bytes of local data follow the page data */ -}; - - -/* -** A macro used for invoking the codec if there is one -*/ -#ifdef SQLITE_HAS_CODEC -# define CODEC(P,D,N,X) if( P->xCodec ){ P->xCodec(P->pCodecArg,D,N,X); } -#else -# define CODEC(P,D,N,X) -#endif - -/* -** Convert a pointer to a PgHdr into a pointer to its data -** and back again. -*/ -#define PGHDR_TO_DATA(P) ((void*)(&(P)[1])) -#define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1]) -#define PGHDR_TO_EXTRA(P) ((void*)&((char*)(&(P)[1]))[SQLITE_PAGE_SIZE]) - -/* -** How big to make the hash table used for locating in-memory pages -** by page number. -*/ -#define N_PG_HASH 2048 - -/* -** Hash a page number -*/ -#define pager_hash(PN) ((PN)&(N_PG_HASH-1)) - -/* -** A open page cache is an instance of the following structure. -*/ -struct Pager { - char *zFilename; /* Name of the database file */ - char *zJournal; /* Name of the journal file */ - char *zDirectory; /* Directory hold database and journal files */ - OsFile fd, jfd; /* File descriptors for database and journal */ - OsFile cpfd; /* File descriptor for the checkpoint journal */ - int dbSize; /* Number of pages in the file */ - int origDbSize; /* dbSize before the current change */ - int ckptSize; /* Size of database (in pages) at ckpt_begin() */ - off_t ckptJSize; /* Size of journal at ckpt_begin() */ - int nRec; /* Number of pages written to the journal */ - u32 cksumInit; /* Quasi-random value added to every checksum */ - int ckptNRec; /* Number of records in the checkpoint journal */ - int nExtra; /* Add this many bytes to each in-memory page */ - void (*xDestructor)(void*); /* Call this routine when freeing pages */ - int nPage; /* Total number of in-memory pages */ - int nRef; /* Number of in-memory pages with PgHdr.nRef>0 */ - int mxPage; /* Maximum number of pages to hold in cache */ - int nHit, nMiss, nOvfl; /* Cache hits, missing, and LRU overflows */ - void (*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ - void *pCodecArg; /* First argument to xCodec() */ - u8 journalOpen; /* True if journal file descriptors is valid */ - u8 journalStarted; /* True if header of journal is synced */ - u8 useJournal; /* Use a rollback journal on this file */ - u8 ckptOpen; /* True if the checkpoint journal is open */ - u8 ckptInUse; /* True we are in a checkpoint */ - u8 ckptAutoopen; /* Open ckpt journal when main journal is opened*/ - u8 noSync; /* Do not sync the journal if true */ - u8 fullSync; /* Do extra syncs of the journal for robustness */ - u8 state; /* SQLITE_UNLOCK, _READLOCK or _WRITELOCK */ - u8 errMask; /* One of several kinds of errors */ - u8 tempFile; /* zFilename is a temporary file */ - u8 readOnly; /* True for a read-only database */ - u8 needSync; /* True if an fsync() is needed on the journal */ - u8 dirtyFile; /* True if database file has changed in any way */ - u8 alwaysRollback; /* Disable dont_rollback() for all pages */ - u8 *aInJournal; /* One bit for each page in the database file */ - u8 *aInCkpt; /* One bit for each page in the database */ - PgHdr *pFirst, *pLast; /* List of free pages */ - PgHdr *pFirstSynced; /* First free page with PgHdr.needSync==0 */ - PgHdr *pAll; /* List of all pages */ - PgHdr *pCkpt; /* List of pages in the checkpoint journal */ - PgHdr *aHash[N_PG_HASH]; /* Hash table to map page number of PgHdr */ -}; - -/* -** These are bits that can be set in Pager.errMask. -*/ -#define PAGER_ERR_FULL 0x01 /* a write() failed */ -#define PAGER_ERR_MEM 0x02 /* malloc() failed */ -#define PAGER_ERR_LOCK 0x04 /* error in the locking protocol */ -#define PAGER_ERR_CORRUPT 0x08 /* database or journal corruption */ -#define PAGER_ERR_DISK 0x10 /* general disk I/O error - bad hard drive? */ - -/* -** The journal file contains page records in the following -** format. -** -** Actually, this structure is the complete page record for pager -** formats less than 3. Beginning with format 3, this record is surrounded -** by two checksums. -*/ -typedef struct PageRecord PageRecord; -struct PageRecord { - Pgno pgno; /* The page number */ - char aData[SQLITE_PAGE_SIZE]; /* Original data for page pgno */ -}; - -/* -** Journal files begin with the following magic string. The data -** was obtained from /dev/random. It is used only as a sanity check. -** -** There are three journal formats (so far). The 1st journal format writes -** 32-bit integers in the byte-order of the host machine. New -** formats writes integers as big-endian. All new journals use the -** new format, but we have to be able to read an older journal in order -** to rollback journals created by older versions of the library. -** -** The 3rd journal format (added for 2.8.0) adds additional sanity -** checking information to the journal. If the power fails while the -** journal is being written, semi-random garbage data might appear in -** the journal file after power is restored. If an attempt is then made -** to roll the journal back, the database could be corrupted. The additional -** sanity checking data is an attempt to discover the garbage in the -** journal and ignore it. -** -** The sanity checking information for the 3rd journal format consists -** of a 32-bit checksum on each page of data. The checksum covers both -** the page number and the SQLITE_PAGE_SIZE bytes of data for the page. -** This cksum is initialized to a 32-bit random value that appears in the -** journal file right after the header. The random initializer is important, -** because garbage data that appears at the end of a journal is likely -** data that was once in other files that have now been deleted. If the -** garbage data came from an obsolete journal file, the checksums might -** be correct. But by initializing the checksum to random value which -** is different for every journal, we minimize that risk. -*/ -static const unsigned char aJournalMagic1[] = { - 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd4, -}; -static const unsigned char aJournalMagic2[] = { - 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd5, -}; -static const unsigned char aJournalMagic3[] = { - 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd6, -}; -#define JOURNAL_FORMAT_1 1 -#define JOURNAL_FORMAT_2 2 -#define JOURNAL_FORMAT_3 3 - -/* -** The following integer determines what format to use when creating -** new primary journal files. By default we always use format 3. -** When testing, we can set this value to older journal formats in order to -** make sure that newer versions of the library are able to rollback older -** journal files. -** -** Note that checkpoint journals always use format 2 and omit the header. -*/ -#ifdef SQLITE_TEST -int journal_format = 3; -#else -# define journal_format 3 -#endif - -/* -** The size of the header and of each page in the journal varies according -** to which journal format is being used. The following macros figure out -** the sizes based on format numbers. -*/ -#define JOURNAL_HDR_SZ(X) \ - (sizeof(aJournalMagic1) + sizeof(Pgno) + ((X)>=3)*2*sizeof(u32)) -#define JOURNAL_PG_SZ(X) \ - (SQLITE_PAGE_SIZE + sizeof(Pgno) + ((X)>=3)*sizeof(u32)) - -/* -** Enable reference count tracking here: -*/ -#ifdef SQLITE_TEST - int pager_refinfo_enable = 0; - static void pager_refinfo(PgHdr *p){ - static int cnt = 0; - if( !pager_refinfo_enable ) return; - printf( - "REFCNT: %4d addr=0x%08x nRef=%d\n", - p->pgno, (int)PGHDR_TO_DATA(p), p->nRef - ); - cnt++; /* Something to set a breakpoint on */ - } -# define REFINFO(X) pager_refinfo(X) -#else -# define REFINFO(X) -#endif - -/* -** Read a 32-bit integer from the given file descriptor. Store the integer -** that is read in *pRes. Return SQLITE_OK if everything worked, or an -** error code is something goes wrong. -** -** If the journal format is 2 or 3, read a big-endian integer. If the -** journal format is 1, read an integer in the native byte-order of the -** host machine. -*/ -static int read32bits(int format, OsFile *fd, u32 *pRes){ - u32 res; - int rc; - rc = sqliteOsRead(fd, &res, sizeof(res)); - if( rc==SQLITE_OK && format>JOURNAL_FORMAT_1 ){ - unsigned char ac[4]; - memcpy(ac, &res, 4); - res = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3]; - } - *pRes = res; - return rc; -} - -/* -** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK -** on success or an error code is something goes wrong. -** -** If the journal format is 2 or 3, write the integer as 4 big-endian -** bytes. If the journal format is 1, write the integer in the native -** byte order. In normal operation, only formats 2 and 3 are used. -** Journal format 1 is only used for testing. -*/ -static int write32bits(OsFile *fd, u32 val){ - unsigned char ac[4]; - if( journal_format<=1 ){ - return sqliteOsWrite(fd, &val, 4); - } - ac[0] = (val>>24) & 0xff; - ac[1] = (val>>16) & 0xff; - ac[2] = (val>>8) & 0xff; - ac[3] = val & 0xff; - return sqliteOsWrite(fd, ac, 4); -} - -/* -** Write a 32-bit integer into a page header right before the -** page data. This will overwrite the PgHdr.pDirty pointer. -** -** The integer is big-endian for formats 2 and 3 and native byte order -** for journal format 1. -*/ -static void store32bits(u32 val, PgHdr *p, int offset){ - unsigned char *ac; - ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset]; - if( journal_format<=1 ){ - memcpy(ac, &val, 4); - }else{ - ac[0] = (val>>24) & 0xff; - ac[1] = (val>>16) & 0xff; - ac[2] = (val>>8) & 0xff; - ac[3] = val & 0xff; - } -} - - -/* -** Convert the bits in the pPager->errMask into an approprate -** return code. -*/ -static int pager_errcode(Pager *pPager){ - int rc = SQLITE_OK; - if( pPager->errMask & PAGER_ERR_LOCK ) rc = SQLITE_PROTOCOL; - if( pPager->errMask & PAGER_ERR_DISK ) rc = SQLITE_IOERR; - if( pPager->errMask & PAGER_ERR_FULL ) rc = SQLITE_FULL; - if( pPager->errMask & PAGER_ERR_MEM ) rc = SQLITE_NOMEM; - if( pPager->errMask & PAGER_ERR_CORRUPT ) rc = SQLITE_CORRUPT; - return rc; -} - -/* -** Add or remove a page from the list of all pages that are in the -** checkpoint journal. -** -** The Pager keeps a separate list of pages that are currently in -** the checkpoint journal. This helps the sqlitepager_ckpt_commit() -** routine run MUCH faster for the common case where there are many -** pages in memory but only a few are in the checkpoint journal. -*/ -static void page_add_to_ckpt_list(PgHdr *pPg){ - Pager *pPager = pPg->pPager; - if( pPg->inCkpt ) return; - assert( pPg->pPrevCkpt==0 && pPg->pNextCkpt==0 ); - pPg->pPrevCkpt = 0; - if( pPager->pCkpt ){ - pPager->pCkpt->pPrevCkpt = pPg; - } - pPg->pNextCkpt = pPager->pCkpt; - pPager->pCkpt = pPg; - pPg->inCkpt = 1; -} -static void page_remove_from_ckpt_list(PgHdr *pPg){ - if( !pPg->inCkpt ) return; - if( pPg->pPrevCkpt ){ - assert( pPg->pPrevCkpt->pNextCkpt==pPg ); - pPg->pPrevCkpt->pNextCkpt = pPg->pNextCkpt; - }else{ - assert( pPg->pPager->pCkpt==pPg ); - pPg->pPager->pCkpt = pPg->pNextCkpt; - } - if( pPg->pNextCkpt ){ - assert( pPg->pNextCkpt->pPrevCkpt==pPg ); - pPg->pNextCkpt->pPrevCkpt = pPg->pPrevCkpt; - } - pPg->pNextCkpt = 0; - pPg->pPrevCkpt = 0; - pPg->inCkpt = 0; -} - -/* -** Find a page in the hash table given its page number. Return -** a pointer to the page or NULL if not found. -*/ -static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ - PgHdr *p = pPager->aHash[pager_hash(pgno)]; - while( p && p->pgno!=pgno ){ - p = p->pNextHash; - } - return p; -} - -/* -** Unlock the database and clear the in-memory cache. This routine -** sets the state of the pager back to what it was when it was first -** opened. Any outstanding pages are invalidated and subsequent attempts -** to access those pages will likely result in a coredump. -*/ -static void pager_reset(Pager *pPager){ - PgHdr *pPg, *pNext; - for(pPg=pPager->pAll; pPg; pPg=pNext){ - pNext = pPg->pNextAll; - sqliteFree(pPg); - } - pPager->pFirst = 0; - pPager->pFirstSynced = 0; - pPager->pLast = 0; - pPager->pAll = 0; - memset(pPager->aHash, 0, sizeof(pPager->aHash)); - pPager->nPage = 0; - if( pPager->state>=SQLITE_WRITELOCK ){ - sqlitepager_rollback(pPager); - } - sqliteOsUnlock(&pPager->fd); - pPager->state = SQLITE_UNLOCK; - pPager->dbSize = -1; - pPager->nRef = 0; - assert( pPager->journalOpen==0 ); -} - -/* -** When this routine is called, the pager has the journal file open and -** a write lock on the database. This routine releases the database -** write lock and acquires a read lock in its place. The journal file -** is deleted and closed. -** -** TODO: Consider keeping the journal file open for temporary databases. -** This might give a performance improvement on windows where opening -** a file is an expensive operation. -*/ -static int pager_unwritelock(Pager *pPager){ - int rc; - PgHdr *pPg; - if( pPager->stateckptOpen ){ - sqliteOsClose(&pPager->cpfd); - pPager->ckptOpen = 0; - } - if( pPager->journalOpen ){ - sqliteOsClose(&pPager->jfd); - pPager->journalOpen = 0; - sqliteOsDelete(pPager->zJournal); - sqliteFree( pPager->aInJournal ); - pPager->aInJournal = 0; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - pPg->inJournal = 0; - pPg->dirty = 0; - pPg->needSync = 0; - } - }else{ - assert( pPager->dirtyFile==0 || pPager->useJournal==0 ); - } - rc = sqliteOsReadLock(&pPager->fd); - if( rc==SQLITE_OK ){ - pPager->state = SQLITE_READLOCK; - }else{ - /* This can only happen if a process does a BEGIN, then forks and the - ** child process does the COMMIT. Because of the semantics of unix - ** file locking, the unlock will fail. - */ - pPager->state = SQLITE_UNLOCK; - } - return rc; -} - -/* -** Compute and return a checksum for the page of data. -** -** This is not a real checksum. It is really just the sum of the -** random initial value and the page number. We considered do a checksum -** of the database, but that was found to be too slow. -*/ -static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){ - u32 cksum = pPager->cksumInit + pgno; - return cksum; -} - -/* -** Read a single page from the journal file opened on file descriptor -** jfd. Playback this one page. -** -** There are three different journal formats. The format parameter determines -** which format is used by the journal that is played back. -*/ -static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int format){ - int rc; - PgHdr *pPg; /* An existing page in the cache */ - PageRecord pgRec; - u32 cksum; - - rc = read32bits(format, jfd, &pgRec.pgno); - if( rc!=SQLITE_OK ) return rc; - rc = sqliteOsRead(jfd, &pgRec.aData, sizeof(pgRec.aData)); - if( rc!=SQLITE_OK ) return rc; - - /* Sanity checking on the page. This is more important that I originally - ** thought. If a power failure occurs while the journal is being written, - ** it could cause invalid data to be written into the journal. We need to - ** detect this invalid data (with high probability) and ignore it. - */ - if( pgRec.pgno==0 ){ - return SQLITE_DONE; - } - if( pgRec.pgno>(unsigned)pPager->dbSize ){ - return SQLITE_OK; - } - if( format>=JOURNAL_FORMAT_3 ){ - rc = read32bits(format, jfd, &cksum); - if( rc ) return rc; - if( pager_cksum(pPager, pgRec.pgno, pgRec.aData)!=cksum ){ - return SQLITE_DONE; - } - } - - /* Playback the page. Update the in-memory copy of the page - ** at the same time, if there is one. - */ - pPg = pager_lookup(pPager, pgRec.pgno); - TRACE2("PLAYBACK %d\n", pgRec.pgno); - sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE); - rc = sqliteOsWrite(&pPager->fd, pgRec.aData, SQLITE_PAGE_SIZE); - if( pPg ){ - /* No page should ever be rolled back that is in use, except for page - ** 1 which is held in use in order to keep the lock on the database - ** active. - */ - assert( pPg->nRef==0 || pPg->pgno==1 ); - memcpy(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE); - memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); - pPg->dirty = 0; - pPg->needSync = 0; - CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); - } - return rc; -} - -/* -** Playback the journal and thus restore the database file to -** the state it was in before we started making changes. -** -** The journal file format is as follows: -** -** * 8 byte prefix. One of the aJournalMagic123 vectors defined -** above. The format of the journal file is determined by which -** of the three prefix vectors is seen. -** * 4 byte big-endian integer which is the number of valid page records -** in the journal. If this value is 0xffffffff, then compute the -** number of page records from the journal size. This field appears -** in format 3 only. -** * 4 byte big-endian integer which is the initial value for the -** sanity checksum. This field appears in format 3 only. -** * 4 byte integer which is the number of pages to truncate the -** database to during a rollback. -** * Zero or more pages instances, each as follows: -** + 4 byte page number. -** + SQLITE_PAGE_SIZE bytes of data. -** + 4 byte checksum (format 3 only) -** -** When we speak of the journal header, we mean the first 4 bullets above. -** Each entry in the journal is an instance of the 5th bullet. Note that -** bullets 2 and 3 only appear in format-3 journals. -** -** Call the value from the second bullet "nRec". nRec is the number of -** valid page entries in the journal. In most cases, you can compute the -** value of nRec from the size of the journal file. But if a power -** failure occurred while the journal was being written, it could be the -** case that the size of the journal file had already been increased but -** the extra entries had not yet made it safely to disk. In such a case, -** the value of nRec computed from the file size would be too large. For -** that reason, we always use the nRec value in the header. -** -** If the nRec value is 0xffffffff it means that nRec should be computed -** from the file size. This value is used when the user selects the -** no-sync option for the journal. A power failure could lead to corruption -** in this case. But for things like temporary table (which will be -** deleted when the power is restored) we don't care. -** -** Journal formats 1 and 2 do not have an nRec value in the header so we -** have to compute nRec from the file size. This has risks (as described -** above) which is why all persistent tables have been changed to use -** format 3. -** -** If the file opened as the journal file is not a well-formed -** journal file then the database will likely already be -** corrupted, so the PAGER_ERR_CORRUPT bit is set in pPager->errMask -** and SQLITE_CORRUPT is returned. If it all works, then this routine -** returns SQLITE_OK. -*/ -static int pager_playback(Pager *pPager, int useJournalSize){ - off_t szJ; /* Size of the journal file in bytes */ - int nRec; /* Number of Records in the journal */ - int i; /* Loop counter */ - Pgno mxPg = 0; /* Size of the original file in pages */ - int format; /* Format of the journal file. */ - unsigned char aMagic[sizeof(aJournalMagic1)]; - int rc; - - /* Figure out how many records are in the journal. Abort early if - ** the journal is empty. - */ - assert( pPager->journalOpen ); - sqliteOsSeek(&pPager->jfd, 0); - rc = sqliteOsFileSize(&pPager->jfd, &szJ); - if( rc!=SQLITE_OK ){ - goto end_playback; - } - - /* If the journal file is too small to contain a complete header, - ** it must mean that the process that created the journal was just - ** beginning to write the journal file when it died. In that case, - ** the database file should have still been completely unchanged. - ** Nothing needs to be rolled back. We can safely ignore this journal. - */ - if( szJ < sizeof(aMagic)+sizeof(Pgno) ){ - goto end_playback; - } - - /* Read the beginning of the journal and truncate the - ** database file back to its original size. - */ - rc = sqliteOsRead(&pPager->jfd, aMagic, sizeof(aMagic)); - if( rc!=SQLITE_OK ){ - rc = SQLITE_PROTOCOL; - goto end_playback; - } - if( memcmp(aMagic, aJournalMagic3, sizeof(aMagic))==0 ){ - format = JOURNAL_FORMAT_3; - }else if( memcmp(aMagic, aJournalMagic2, sizeof(aMagic))==0 ){ - format = JOURNAL_FORMAT_2; - }else if( memcmp(aMagic, aJournalMagic1, sizeof(aMagic))==0 ){ - format = JOURNAL_FORMAT_1; - }else{ - rc = SQLITE_PROTOCOL; - goto end_playback; - } - if( format>=JOURNAL_FORMAT_3 ){ - if( szJ < sizeof(aMagic) + 3*sizeof(u32) ){ - /* Ignore the journal if it is too small to contain a complete - ** header. We already did this test once above, but at the prior - ** test, we did not know the journal format and so we had to assume - ** the smallest possible header. Now we know the header is bigger - ** than the minimum so we test again. - */ - goto end_playback; - } - rc = read32bits(format, &pPager->jfd, (u32*)&nRec); - if( rc ) goto end_playback; - rc = read32bits(format, &pPager->jfd, &pPager->cksumInit); - if( rc ) goto end_playback; - if( nRec==0xffffffff || useJournalSize ){ - nRec = (szJ - JOURNAL_HDR_SZ(3))/JOURNAL_PG_SZ(3); - } - }else{ - nRec = (szJ - JOURNAL_HDR_SZ(2))/JOURNAL_PG_SZ(2); - assert( nRec*JOURNAL_PG_SZ(2)+JOURNAL_HDR_SZ(2)==szJ ); - } - rc = read32bits(format, &pPager->jfd, &mxPg); - if( rc!=SQLITE_OK ){ - goto end_playback; - } - assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg ); - rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)mxPg); - if( rc!=SQLITE_OK ){ - goto end_playback; - } - pPager->dbSize = mxPg; - - /* Copy original pages out of the journal and back into the database file. - */ - for(i=0; ijfd, format); - if( rc!=SQLITE_OK ){ - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - } - break; - } - } - - /* Pages that have been written to the journal but never synced - ** where not restored by the loop above. We have to restore those - ** pages by reading them back from the original database. - */ - if( rc==SQLITE_OK ){ - PgHdr *pPg; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - char zBuf[SQLITE_PAGE_SIZE]; - if( !pPg->dirty ) continue; - if( (int)pPg->pgno <= pPager->origDbSize ){ - sqliteOsSeek(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)(pPg->pgno-1)); - rc = sqliteOsRead(&pPager->fd, zBuf, SQLITE_PAGE_SIZE); - TRACE2("REFETCH %d\n", pPg->pgno); - CODEC(pPager, zBuf, pPg->pgno, 2); - if( rc ) break; - }else{ - memset(zBuf, 0, SQLITE_PAGE_SIZE); - } - if( pPg->nRef==0 || memcmp(zBuf, PGHDR_TO_DATA(pPg), SQLITE_PAGE_SIZE) ){ - memcpy(PGHDR_TO_DATA(pPg), zBuf, SQLITE_PAGE_SIZE); - memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); - } - pPg->needSync = 0; - pPg->dirty = 0; - } - } - -end_playback: - if( rc!=SQLITE_OK ){ - pager_unwritelock(pPager); - pPager->errMask |= PAGER_ERR_CORRUPT; - rc = SQLITE_CORRUPT; - }else{ - rc = pager_unwritelock(pPager); - } - return rc; -} - -/* -** Playback the checkpoint journal. -** -** This is similar to playing back the transaction journal but with -** a few extra twists. -** -** (1) The number of pages in the database file at the start of -** the checkpoint is stored in pPager->ckptSize, not in the -** journal file itself. -** -** (2) In addition to playing back the checkpoint journal, also -** playback all pages of the transaction journal beginning -** at offset pPager->ckptJSize. -*/ -static int pager_ckpt_playback(Pager *pPager){ - off_t szJ; /* Size of the full journal */ - int nRec; /* Number of Records */ - int i; /* Loop counter */ - int rc; - - /* Truncate the database back to its original size. - */ - rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)pPager->ckptSize); - pPager->dbSize = pPager->ckptSize; - - /* Figure out how many records are in the checkpoint journal. - */ - assert( pPager->ckptInUse && pPager->journalOpen ); - sqliteOsSeek(&pPager->cpfd, 0); - nRec = pPager->ckptNRec; - - /* Copy original pages out of the checkpoint journal and back into the - ** database file. Note that the checkpoint journal always uses format - ** 2 instead of format 3 since it does not need to be concerned with - ** power failures corrupting the journal and can thus omit the checksums. - */ - for(i=nRec-1; i>=0; i--){ - rc = pager_playback_one_page(pPager, &pPager->cpfd, 2); - assert( rc!=SQLITE_DONE ); - if( rc!=SQLITE_OK ) goto end_ckpt_playback; - } - - /* Figure out how many pages need to be copied out of the transaction - ** journal. - */ - rc = sqliteOsSeek(&pPager->jfd, pPager->ckptJSize); - if( rc!=SQLITE_OK ){ - goto end_ckpt_playback; - } - rc = sqliteOsFileSize(&pPager->jfd, &szJ); - if( rc!=SQLITE_OK ){ - goto end_ckpt_playback; - } - nRec = (szJ - pPager->ckptJSize)/JOURNAL_PG_SZ(journal_format); - for(i=nRec-1; i>=0; i--){ - rc = pager_playback_one_page(pPager, &pPager->jfd, journal_format); - if( rc!=SQLITE_OK ){ - assert( rc!=SQLITE_DONE ); - goto end_ckpt_playback; - } - } - -end_ckpt_playback: - if( rc!=SQLITE_OK ){ - pPager->errMask |= PAGER_ERR_CORRUPT; - rc = SQLITE_CORRUPT; - } - return rc; -} - -/* -** Change the maximum number of in-memory pages that are allowed. -** -** The maximum number is the absolute value of the mxPage parameter. -** If mxPage is negative, the noSync flag is also set. noSync bypasses -** calls to sqliteOsSync(). The pager runs much faster with noSync on, -** but if the operating system crashes or there is an abrupt power -** failure, the database file might be left in an inconsistent and -** unrepairable state. -*/ -void sqlitepager_set_cachesize(Pager *pPager, int mxPage){ - if( mxPage>=0 ){ - pPager->noSync = pPager->tempFile; - if( pPager->noSync==0 ) pPager->needSync = 0; - }else{ - pPager->noSync = 1; - mxPage = -mxPage; - } - if( mxPage>10 ){ - pPager->mxPage = mxPage; - } -} - -/* -** Adjust the robustness of the database to damage due to OS crashes -** or power failures by changing the number of syncs()s when writing -** the rollback journal. There are three levels: -** -** OFF sqliteOsSync() is never called. This is the default -** for temporary and transient files. -** -** NORMAL The journal is synced once before writes begin on the -** database. This is normally adequate protection, but -** it is theoretically possible, though very unlikely, -** that an inopertune power failure could leave the journal -** in a state which would cause damage to the database -** when it is rolled back. -** -** FULL The journal is synced twice before writes begin on the -** database (with some additional information - the nRec field -** of the journal header - being written in between the two -** syncs). If we assume that writing a -** single disk sector is atomic, then this mode provides -** assurance that the journal will not be corrupted to the -** point of causing damage to the database during rollback. -** -** Numeric values associated with these states are OFF==1, NORMAL=2, -** and FULL=3. -*/ -void sqlitepager_set_safety_level(Pager *pPager, int level){ - pPager->noSync = level==1 || pPager->tempFile; - pPager->fullSync = level==3 && !pPager->tempFile; - if( pPager->noSync==0 ) pPager->needSync = 0; -} - -/* -** Open a temporary file. Write the name of the file into zName -** (zName must be at least SQLITE_TEMPNAME_SIZE bytes long.) Write -** the file descriptor into *fd. Return SQLITE_OK on success or some -** other error code if we fail. -** -** The OS will automatically delete the temporary file when it is -** closed. -*/ -static int sqlitepager_opentemp(char *zFile, OsFile *fd){ - int cnt = 8; - int rc; - do{ - cnt--; - sqliteOsTempFileName(zFile); - rc = sqliteOsOpenExclusive(zFile, fd, 1); - }while( cnt>0 && rc!=SQLITE_OK ); - return rc; -} - -/* -** Create a new page cache and put a pointer to the page cache in *ppPager. -** The file to be cached need not exist. The file is not locked until -** the first call to sqlitepager_get() and is only held open until the -** last page is released using sqlitepager_unref(). -** -** If zFilename is NULL then a randomly-named temporary file is created -** and used as the file to be cached. The file will be deleted -** automatically when it is closed. -*/ -int sqlitepager_open( - Pager **ppPager, /* Return the Pager structure here */ - const char *zFilename, /* Name of the database file to open */ - int mxPage, /* Max number of in-memory cache pages */ - int nExtra, /* Extra bytes append to each in-memory page */ - int useJournal /* TRUE to use a rollback journal on this file */ -){ - Pager *pPager; - char *zFullPathname; - int nameLen; - OsFile fd; - int rc, i; - int tempFile; - int readOnly = 0; - char zTemp[SQLITE_TEMPNAME_SIZE]; - - *ppPager = 0; - if( sqlite_malloc_failed ){ - return SQLITE_NOMEM; - } - if( zFilename && zFilename[0] ){ - zFullPathname = sqliteOsFullPathname(zFilename); - rc = sqliteOsOpenReadWrite(zFullPathname, &fd, &readOnly); - tempFile = 0; - }else{ - rc = sqlitepager_opentemp(zTemp, &fd); - zFilename = zTemp; - zFullPathname = sqliteOsFullPathname(zFilename); - tempFile = 1; - } - if( sqlite_malloc_failed ){ - return SQLITE_NOMEM; - } - if( rc!=SQLITE_OK ){ - sqliteFree(zFullPathname); - return SQLITE_CANTOPEN; - } - nameLen = strlen(zFullPathname); - pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 ); - if( pPager==0 ){ - sqliteOsClose(&fd); - sqliteFree(zFullPathname); - return SQLITE_NOMEM; - } - SET_PAGER(pPager); - pPager->zFilename = (char*)&pPager[1]; - pPager->zDirectory = &pPager->zFilename[nameLen+1]; - pPager->zJournal = &pPager->zDirectory[nameLen+1]; - strcpy(pPager->zFilename, zFullPathname); - strcpy(pPager->zDirectory, zFullPathname); - for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){} - if( i>0 ) pPager->zDirectory[i-1] = 0; - strcpy(pPager->zJournal, zFullPathname); - sqliteFree(zFullPathname); - strcpy(&pPager->zJournal[nameLen], "-journal"); - pPager->fd = fd; - pPager->journalOpen = 0; - pPager->useJournal = useJournal; - pPager->ckptOpen = 0; - pPager->ckptInUse = 0; - pPager->nRef = 0; - pPager->dbSize = -1; - pPager->ckptSize = 0; - pPager->ckptJSize = 0; - pPager->nPage = 0; - pPager->mxPage = mxPage>5 ? mxPage : 10; - pPager->state = SQLITE_UNLOCK; - pPager->errMask = 0; - pPager->tempFile = tempFile; - pPager->readOnly = readOnly; - pPager->needSync = 0; - pPager->noSync = pPager->tempFile || !useJournal; - pPager->pFirst = 0; - pPager->pFirstSynced = 0; - pPager->pLast = 0; - pPager->nExtra = nExtra; - memset(pPager->aHash, 0, sizeof(pPager->aHash)); - *ppPager = pPager; - return SQLITE_OK; -} - -/* -** Set the destructor for this pager. If not NULL, the destructor is called -** when the reference count on each page reaches zero. The destructor can -** be used to clean up information in the extra segment appended to each page. -** -** The destructor is not called as a result sqlitepager_close(). -** Destructors are only called by sqlitepager_unref(). -*/ -void sqlitepager_set_destructor(Pager *pPager, void (*xDesc)(void*)){ - pPager->xDestructor = xDesc; -} - -/* -** Return the total number of pages in the disk file associated with -** pPager. -*/ -int sqlitepager_pagecount(Pager *pPager){ - off_t n; - assert( pPager!=0 ); - if( pPager->dbSize>=0 ){ - return pPager->dbSize; - } - if( sqliteOsFileSize(&pPager->fd, &n)!=SQLITE_OK ){ - pPager->errMask |= PAGER_ERR_DISK; - return 0; - } - n /= SQLITE_PAGE_SIZE; - if( pPager->state!=SQLITE_UNLOCK ){ - pPager->dbSize = n; - } - return n; -} - -/* -** Forward declaration -*/ -static int syncJournal(Pager*); - -/* -** Truncate the file to the number of pages specified. -*/ -int sqlitepager_truncate(Pager *pPager, Pgno nPage){ - int rc; - if( pPager->dbSize<0 ){ - sqlitepager_pagecount(pPager); - } - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - return rc; - } - if( nPage>=(unsigned)pPager->dbSize ){ - return SQLITE_OK; - } - syncJournal(pPager); - rc = sqliteOsTruncate(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)nPage); - if( rc==SQLITE_OK ){ - pPager->dbSize = nPage; - } - return rc; -} - -/* -** Shutdown the page cache. Free all memory and close all files. -** -** If a transaction was in progress when this routine is called, that -** transaction is rolled back. All outstanding pages are invalidated -** and their memory is freed. Any attempt to use a page associated -** with this page cache after this function returns will likely -** result in a coredump. -*/ -int sqlitepager_close(Pager *pPager){ - PgHdr *pPg, *pNext; - switch( pPager->state ){ - case SQLITE_WRITELOCK: { - sqlitepager_rollback(pPager); - sqliteOsUnlock(&pPager->fd); - assert( pPager->journalOpen==0 ); - break; - } - case SQLITE_READLOCK: { - sqliteOsUnlock(&pPager->fd); - break; - } - default: { - /* Do nothing */ - break; - } - } - for(pPg=pPager->pAll; pPg; pPg=pNext){ - pNext = pPg->pNextAll; - sqliteFree(pPg); - } - sqliteOsClose(&pPager->fd); - assert( pPager->journalOpen==0 ); - /* Temp files are automatically deleted by the OS - ** if( pPager->tempFile ){ - ** sqliteOsDelete(pPager->zFilename); - ** } - */ - CLR_PAGER(pPager); - if( pPager->zFilename!=(char*)&pPager[1] ){ - assert( 0 ); /* Cannot happen */ - sqliteFree(pPager->zFilename); - sqliteFree(pPager->zJournal); - sqliteFree(pPager->zDirectory); - } - sqliteFree(pPager); - return SQLITE_OK; -} - -/* -** Return the page number for the given page data. -*/ -Pgno sqlitepager_pagenumber(void *pData){ - PgHdr *p = DATA_TO_PGHDR(pData); - return p->pgno; -} - -/* -** Increment the reference count for a page. If the page is -** currently on the freelist (the reference count is zero) then -** remove it from the freelist. -*/ -#define page_ref(P) ((P)->nRef==0?_page_ref(P):(void)(P)->nRef++) -static void _page_ref(PgHdr *pPg){ - if( pPg->nRef==0 ){ - /* The page is currently on the freelist. Remove it. */ - if( pPg==pPg->pPager->pFirstSynced ){ - PgHdr *p = pPg->pNextFree; - while( p && p->needSync ){ p = p->pNextFree; } - pPg->pPager->pFirstSynced = p; - } - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg->pNextFree; - }else{ - pPg->pPager->pFirst = pPg->pNextFree; - } - if( pPg->pNextFree ){ - pPg->pNextFree->pPrevFree = pPg->pPrevFree; - }else{ - pPg->pPager->pLast = pPg->pPrevFree; - } - pPg->pPager->nRef++; - } - pPg->nRef++; - REFINFO(pPg); -} - -/* -** Increment the reference count for a page. The input pointer is -** a reference to the page data. -*/ -int sqlitepager_ref(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - page_ref(pPg); - return SQLITE_OK; -} - -/* -** Sync the journal. In other words, make sure all the pages that have -** been written to the journal have actually reached the surface of the -** disk. It is not safe to modify the original database file until after -** the journal has been synced. If the original database is modified before -** the journal is synced and a power failure occurs, the unsynced journal -** data would be lost and we would be unable to completely rollback the -** database changes. Database corruption would occur. -** -** This routine also updates the nRec field in the header of the journal. -** (See comments on the pager_playback() routine for additional information.) -** If the sync mode is FULL, two syncs will occur. First the whole journal -** is synced, then the nRec field is updated, then a second sync occurs. -** -** For temporary databases, we do not care if we are able to rollback -** after a power failure, so sync occurs. -** -** This routine clears the needSync field of every page current held in -** memory. -*/ -static int syncJournal(Pager *pPager){ - PgHdr *pPg; - int rc = SQLITE_OK; - - /* Sync the journal before modifying the main database - ** (assuming there is a journal and it needs to be synced.) - */ - if( pPager->needSync ){ - if( !pPager->tempFile ){ - assert( pPager->journalOpen ); - /* assert( !pPager->noSync ); // noSync might be set if synchronous - ** was turned off after the transaction was started. Ticket #615 */ -#ifndef NDEBUG - { - /* Make sure the pPager->nRec counter we are keeping agrees - ** with the nRec computed from the size of the journal file. - */ - off_t hdrSz, pgSz, jSz; - hdrSz = JOURNAL_HDR_SZ(journal_format); - pgSz = JOURNAL_PG_SZ(journal_format); - rc = sqliteOsFileSize(&pPager->jfd, &jSz); - if( rc!=0 ) return rc; - assert( pPager->nRec*pgSz+hdrSz==jSz ); - } -#endif - if( journal_format>=3 ){ - /* Write the nRec value into the journal file header */ - off_t szJ; - if( pPager->fullSync ){ - TRACE1("SYNC\n"); - rc = sqliteOsSync(&pPager->jfd); - if( rc!=0 ) return rc; - } - sqliteOsSeek(&pPager->jfd, sizeof(aJournalMagic1)); - rc = write32bits(&pPager->jfd, pPager->nRec); - if( rc ) return rc; - szJ = JOURNAL_HDR_SZ(journal_format) + - pPager->nRec*JOURNAL_PG_SZ(journal_format); - sqliteOsSeek(&pPager->jfd, szJ); - } - TRACE1("SYNC\n"); - rc = sqliteOsSync(&pPager->jfd); - if( rc!=0 ) return rc; - pPager->journalStarted = 1; - } - pPager->needSync = 0; - - /* Erase the needSync flag from every page. - */ - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - pPg->needSync = 0; - } - pPager->pFirstSynced = pPager->pFirst; - } - -#ifndef NDEBUG - /* If the Pager.needSync flag is clear then the PgHdr.needSync - ** flag must also be clear for all pages. Verify that this - ** invariant is true. - */ - else{ - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - assert( pPg->needSync==0 ); - } - assert( pPager->pFirstSynced==pPager->pFirst ); - } -#endif - - return rc; -} - -/* -** Given a list of pages (connected by the PgHdr.pDirty pointer) write -** every one of those pages out to the database file and mark them all -** as clean. -*/ -static int pager_write_pagelist(PgHdr *pList){ - Pager *pPager; - int rc; - - if( pList==0 ) return SQLITE_OK; - pPager = pList->pPager; - while( pList ){ - assert( pList->dirty ); - sqliteOsSeek(&pPager->fd, (pList->pgno-1)*(off_t)SQLITE_PAGE_SIZE); - CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6); - TRACE2("STORE %d\n", pList->pgno); - rc = sqliteOsWrite(&pPager->fd, PGHDR_TO_DATA(pList), SQLITE_PAGE_SIZE); - CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 0); - if( rc ) return rc; - pList->dirty = 0; - pList = pList->pDirty; - } - return SQLITE_OK; -} - -/* -** Collect every dirty page into a dirty list and -** return a pointer to the head of that list. All pages are -** collected even if they are still in use. -*/ -static PgHdr *pager_get_all_dirty_pages(Pager *pPager){ - PgHdr *p, *pList; - pList = 0; - for(p=pPager->pAll; p; p=p->pNextAll){ - if( p->dirty ){ - p->pDirty = pList; - pList = p; - } - } - return pList; -} - -/* -** Acquire a page. -** -** A read lock on the disk file is obtained when the first page is acquired. -** This read lock is dropped when the last page is released. -** -** A _get works for any page number greater than 0. If the database -** file is smaller than the requested page, then no actual disk -** read occurs and the memory image of the page is initialized to -** all zeros. The extra data appended to a page is always initialized -** to zeros the first time a page is loaded into memory. -** -** The acquisition might fail for several reasons. In all cases, -** an appropriate error code is returned and *ppPage is set to NULL. -** -** See also sqlitepager_lookup(). Both this routine and _lookup() attempt -** to find a page in the in-memory cache first. If the page is not already -** in memory, this routine goes to disk to read it in whereas _lookup() -** just returns 0. This routine acquires a read-lock the first time it -** has to go to disk, and could also playback an old journal if necessary. -** Since _lookup() never goes to disk, it never has to deal with locks -** or journal files. -*/ -int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){ - PgHdr *pPg; - int rc; - - /* Make sure we have not hit any critical errors. - */ - assert( pPager!=0 ); - assert( pgno!=0 ); - *ppPage = 0; - if( pPager->errMask & ~(PAGER_ERR_FULL) ){ - return pager_errcode(pPager); - } - - /* If this is the first page accessed, then get a read lock - ** on the database file. - */ - if( pPager->nRef==0 ){ - rc = sqliteOsReadLock(&pPager->fd); - if( rc!=SQLITE_OK ){ - return rc; - } - pPager->state = SQLITE_READLOCK; - - /* If a journal file exists, try to play it back. - */ - if( pPager->useJournal && sqliteOsFileExists(pPager->zJournal) ){ - int rc; - - /* Get a write lock on the database - */ - rc = sqliteOsWriteLock(&pPager->fd); - if( rc!=SQLITE_OK ){ - if( sqliteOsUnlock(&pPager->fd)!=SQLITE_OK ){ - /* This should never happen! */ - rc = SQLITE_INTERNAL; - } - return rc; - } - pPager->state = SQLITE_WRITELOCK; - - /* Open the journal for reading only. Return SQLITE_BUSY if - ** we are unable to open the journal file. - ** - ** The journal file does not need to be locked itself. The - ** journal file is never open unless the main database file holds - ** a write lock, so there is never any chance of two or more - ** processes opening the journal at the same time. - */ - rc = sqliteOsOpenReadOnly(pPager->zJournal, &pPager->jfd); - if( rc!=SQLITE_OK ){ - rc = sqliteOsUnlock(&pPager->fd); - assert( rc==SQLITE_OK ); - return SQLITE_BUSY; - } - pPager->journalOpen = 1; - pPager->journalStarted = 0; - - /* Playback and delete the journal. Drop the database write - ** lock and reacquire the read lock. - */ - rc = pager_playback(pPager, 0); - if( rc!=SQLITE_OK ){ - return rc; - } - } - pPg = 0; - }else{ - /* Search for page in cache */ - pPg = pager_lookup(pPager, pgno); - } - if( pPg==0 ){ - /* The requested page is not in the page cache. */ - int h; - pPager->nMiss++; - if( pPager->nPagemxPage || pPager->pFirst==0 ){ - /* Create a new page */ - pPg = sqliteMallocRaw( sizeof(*pPg) + SQLITE_PAGE_SIZE - + sizeof(u32) + pPager->nExtra ); - if( pPg==0 ){ - pager_unwritelock(pPager); - pPager->errMask |= PAGER_ERR_MEM; - return SQLITE_NOMEM; - } - memset(pPg, 0, sizeof(*pPg)); - pPg->pPager = pPager; - pPg->pNextAll = pPager->pAll; - if( pPager->pAll ){ - pPager->pAll->pPrevAll = pPg; - } - pPg->pPrevAll = 0; - pPager->pAll = pPg; - pPager->nPage++; - }else{ - /* Find a page to recycle. Try to locate a page that does not - ** require us to do an fsync() on the journal. - */ - pPg = pPager->pFirstSynced; - - /* If we could not find a page that does not require an fsync() - ** on the journal file then fsync the journal file. This is a - ** very slow operation, so we work hard to avoid it. But sometimes - ** it can't be helped. - */ - if( pPg==0 ){ - int rc = syncJournal(pPager); - if( rc!=0 ){ - sqlitepager_rollback(pPager); - return SQLITE_IOERR; - } - pPg = pPager->pFirst; - } - assert( pPg->nRef==0 ); - - /* Write the page to the database file if it is dirty. - */ - if( pPg->dirty ){ - assert( pPg->needSync==0 ); - pPg->pDirty = 0; - rc = pager_write_pagelist( pPg ); - if( rc!=SQLITE_OK ){ - sqlitepager_rollback(pPager); - return SQLITE_IOERR; - } - } - assert( pPg->dirty==0 ); - - /* If the page we are recycling is marked as alwaysRollback, then - ** set the global alwaysRollback flag, thus disabling the - ** sqlite_dont_rollback() optimization for the rest of this transaction. - ** It is necessary to do this because the page marked alwaysRollback - ** might be reloaded at a later time but at that point we won't remember - ** that is was marked alwaysRollback. This means that all pages must - ** be marked as alwaysRollback from here on out. - */ - if( pPg->alwaysRollback ){ - pPager->alwaysRollback = 1; - } - - /* Unlink the old page from the free list and the hash table - */ - if( pPg==pPager->pFirstSynced ){ - PgHdr *p = pPg->pNextFree; - while( p && p->needSync ){ p = p->pNextFree; } - pPager->pFirstSynced = p; - } - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg->pNextFree; - }else{ - assert( pPager->pFirst==pPg ); - pPager->pFirst = pPg->pNextFree; - } - if( pPg->pNextFree ){ - pPg->pNextFree->pPrevFree = pPg->pPrevFree; - }else{ - assert( pPager->pLast==pPg ); - pPager->pLast = pPg->pPrevFree; - } - pPg->pNextFree = pPg->pPrevFree = 0; - if( pPg->pNextHash ){ - pPg->pNextHash->pPrevHash = pPg->pPrevHash; - } - if( pPg->pPrevHash ){ - pPg->pPrevHash->pNextHash = pPg->pNextHash; - }else{ - h = pager_hash(pPg->pgno); - assert( pPager->aHash[h]==pPg ); - pPager->aHash[h] = pPg->pNextHash; - } - pPg->pNextHash = pPg->pPrevHash = 0; - pPager->nOvfl++; - } - pPg->pgno = pgno; - if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){ - sqliteCheckMemory(pPager->aInJournal, pgno/8); - assert( pPager->journalOpen ); - pPg->inJournal = (pPager->aInJournal[pgno/8] & (1<<(pgno&7)))!=0; - pPg->needSync = 0; - }else{ - pPg->inJournal = 0; - pPg->needSync = 0; - } - if( pPager->aInCkpt && (int)pgno<=pPager->ckptSize - && (pPager->aInCkpt[pgno/8] & (1<<(pgno&7)))!=0 ){ - page_add_to_ckpt_list(pPg); - }else{ - page_remove_from_ckpt_list(pPg); - } - pPg->dirty = 0; - pPg->nRef = 1; - REFINFO(pPg); - pPager->nRef++; - h = pager_hash(pgno); - pPg->pNextHash = pPager->aHash[h]; - pPager->aHash[h] = pPg; - if( pPg->pNextHash ){ - assert( pPg->pNextHash->pPrevHash==0 ); - pPg->pNextHash->pPrevHash = pPg; - } - if( pPager->nExtra>0 ){ - memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); - } - if( pPager->dbSize<0 ) sqlitepager_pagecount(pPager); - if( pPager->errMask!=0 ){ - sqlitepager_unref(PGHDR_TO_DATA(pPg)); - rc = pager_errcode(pPager); - return rc; - } - if( pPager->dbSize<(int)pgno ){ - memset(PGHDR_TO_DATA(pPg), 0, SQLITE_PAGE_SIZE); - }else{ - int rc; - sqliteOsSeek(&pPager->fd, (pgno-1)*(off_t)SQLITE_PAGE_SIZE); - rc = sqliteOsRead(&pPager->fd, PGHDR_TO_DATA(pPg), SQLITE_PAGE_SIZE); - TRACE2("FETCH %d\n", pPg->pgno); - CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); - if( rc!=SQLITE_OK ){ - off_t fileSize; - if( sqliteOsFileSize(&pPager->fd,&fileSize)!=SQLITE_OK - || fileSize>=pgno*SQLITE_PAGE_SIZE ){ - sqlitepager_unref(PGHDR_TO_DATA(pPg)); - return rc; - }else{ - memset(PGHDR_TO_DATA(pPg), 0, SQLITE_PAGE_SIZE); - } - } - } - }else{ - /* The requested page is in the page cache. */ - pPager->nHit++; - page_ref(pPg); - } - *ppPage = PGHDR_TO_DATA(pPg); - return SQLITE_OK; -} - -/* -** Acquire a page if it is already in the in-memory cache. Do -** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. -** -** See also sqlitepager_get(). The difference between this routine -** and sqlitepager_get() is that _get() will go to the disk and read -** in the page if the page is not already in cache. This routine -** returns NULL if the page is not in cache or if a disk I/O error -** has ever happened. -*/ -void *sqlitepager_lookup(Pager *pPager, Pgno pgno){ - PgHdr *pPg; - - assert( pPager!=0 ); - assert( pgno!=0 ); - if( pPager->errMask & ~(PAGER_ERR_FULL) ){ - return 0; - } - /* if( pPager->nRef==0 ){ - ** return 0; - ** } - */ - pPg = pager_lookup(pPager, pgno); - if( pPg==0 ) return 0; - page_ref(pPg); - return PGHDR_TO_DATA(pPg); -} - -/* -** Release a page. -** -** If the number of references to the page drop to zero, then the -** page is added to the LRU list. When all references to all pages -** are released, a rollback occurs and the lock on the database is -** removed. -*/ -int sqlitepager_unref(void *pData){ - PgHdr *pPg; - - /* Decrement the reference count for this page - */ - pPg = DATA_TO_PGHDR(pData); - assert( pPg->nRef>0 ); - pPg->nRef--; - REFINFO(pPg); - - /* When the number of references to a page reach 0, call the - ** destructor and add the page to the freelist. - */ - if( pPg->nRef==0 ){ - Pager *pPager; - pPager = pPg->pPager; - pPg->pNextFree = 0; - pPg->pPrevFree = pPager->pLast; - pPager->pLast = pPg; - if( pPg->pPrevFree ){ - pPg->pPrevFree->pNextFree = pPg; - }else{ - pPager->pFirst = pPg; - } - if( pPg->needSync==0 && pPager->pFirstSynced==0 ){ - pPager->pFirstSynced = pPg; - } - if( pPager->xDestructor ){ - pPager->xDestructor(pData); - } - - /* When all pages reach the freelist, drop the read lock from - ** the database file. - */ - pPager->nRef--; - assert( pPager->nRef>=0 ); - if( pPager->nRef==0 ){ - pager_reset(pPager); - } - } - return SQLITE_OK; -} - -/* -** Create a journal file for pPager. There should already be a write -** lock on the database file when this routine is called. -** -** Return SQLITE_OK if everything. Return an error code and release the -** write lock if anything goes wrong. -*/ -static int pager_open_journal(Pager *pPager){ - int rc; - assert( pPager->state==SQLITE_WRITELOCK ); - assert( pPager->journalOpen==0 ); - assert( pPager->useJournal ); - sqlitepager_pagecount(pPager); - pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 ); - if( pPager->aInJournal==0 ){ - sqliteOsReadLock(&pPager->fd); - pPager->state = SQLITE_READLOCK; - return SQLITE_NOMEM; - } - rc = sqliteOsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile); - if( rc!=SQLITE_OK ){ - sqliteFree(pPager->aInJournal); - pPager->aInJournal = 0; - sqliteOsReadLock(&pPager->fd); - pPager->state = SQLITE_READLOCK; - return SQLITE_CANTOPEN; - } - sqliteOsOpenDirectory(pPager->zDirectory, &pPager->jfd); - pPager->journalOpen = 1; - pPager->journalStarted = 0; - pPager->needSync = 0; - pPager->alwaysRollback = 0; - pPager->nRec = 0; - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - return rc; - } - pPager->origDbSize = pPager->dbSize; - if( journal_format==JOURNAL_FORMAT_3 ){ - rc = sqliteOsWrite(&pPager->jfd, aJournalMagic3, sizeof(aJournalMagic3)); - if( rc==SQLITE_OK ){ - rc = write32bits(&pPager->jfd, pPager->noSync ? 0xffffffff : 0); - } - if( rc==SQLITE_OK ){ - sqliteRandomness(sizeof(pPager->cksumInit), &pPager->cksumInit); - rc = write32bits(&pPager->jfd, pPager->cksumInit); - } - }else if( journal_format==JOURNAL_FORMAT_2 ){ - rc = sqliteOsWrite(&pPager->jfd, aJournalMagic2, sizeof(aJournalMagic2)); - }else{ - assert( journal_format==JOURNAL_FORMAT_1 ); - rc = sqliteOsWrite(&pPager->jfd, aJournalMagic1, sizeof(aJournalMagic1)); - } - if( rc==SQLITE_OK ){ - rc = write32bits(&pPager->jfd, pPager->dbSize); - } - if( pPager->ckptAutoopen && rc==SQLITE_OK ){ - rc = sqlitepager_ckpt_begin(pPager); - } - if( rc!=SQLITE_OK ){ - rc = pager_unwritelock(pPager); - if( rc==SQLITE_OK ){ - rc = SQLITE_FULL; - } - } - return rc; -} - -/* -** Acquire a write-lock on the database. The lock is removed when -** the any of the following happen: -** -** * sqlitepager_commit() is called. -** * sqlitepager_rollback() is called. -** * sqlitepager_close() is called. -** * sqlitepager_unref() is called to on every outstanding page. -** -** The parameter to this routine is a pointer to any open page of the -** database file. Nothing changes about the page - it is used merely -** to acquire a pointer to the Pager structure and as proof that there -** is already a read-lock on the database. -** -** A journal file is opened if this is not a temporary file. For -** temporary files, the opening of the journal file is deferred until -** there is an actual need to write to the journal. -** -** If the database is already write-locked, this routine is a no-op. -*/ -int sqlitepager_begin(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - int rc = SQLITE_OK; - assert( pPg->nRef>0 ); - assert( pPager->state!=SQLITE_UNLOCK ); - if( pPager->state==SQLITE_READLOCK ){ - assert( pPager->aInJournal==0 ); - rc = sqliteOsWriteLock(&pPager->fd); - if( rc!=SQLITE_OK ){ - return rc; - } - pPager->state = SQLITE_WRITELOCK; - pPager->dirtyFile = 0; - TRACE1("TRANSACTION\n"); - if( pPager->useJournal && !pPager->tempFile ){ - rc = pager_open_journal(pPager); - } - } - return rc; -} - -/* -** Mark a data page as writeable. The page is written into the journal -** if it is not there already. This routine must be called before making -** changes to a page. -** -** The first time this routine is called, the pager creates a new -** journal and acquires a write lock on the database. If the write -** lock could not be acquired, this routine returns SQLITE_BUSY. The -** calling routine must check for that return value and be careful not to -** change any page data until this routine returns SQLITE_OK. -** -** If the journal file could not be written because the disk is full, -** then this routine returns SQLITE_FULL and does an immediate rollback. -** All subsequent write attempts also return SQLITE_FULL until there -** is a call to sqlitepager_commit() or sqlitepager_rollback() to -** reset. -*/ -int sqlitepager_write(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - int rc = SQLITE_OK; - - /* Check for errors - */ - if( pPager->errMask ){ - return pager_errcode(pPager); - } - if( pPager->readOnly ){ - return SQLITE_PERM; - } - - /* Mark the page as dirty. If the page has already been written - ** to the journal then we can return right away. - */ - pPg->dirty = 1; - if( pPg->inJournal && (pPg->inCkpt || pPager->ckptInUse==0) ){ - pPager->dirtyFile = 1; - return SQLITE_OK; - } - - /* If we get this far, it means that the page needs to be - ** written to the transaction journal or the ckeckpoint journal - ** or both. - ** - ** First check to see that the transaction journal exists and - ** create it if it does not. - */ - assert( pPager->state!=SQLITE_UNLOCK ); - rc = sqlitepager_begin(pData); - if( rc!=SQLITE_OK ){ - return rc; - } - assert( pPager->state==SQLITE_WRITELOCK ); - if( !pPager->journalOpen && pPager->useJournal ){ - rc = pager_open_journal(pPager); - if( rc!=SQLITE_OK ) return rc; - } - assert( pPager->journalOpen || !pPager->useJournal ); - pPager->dirtyFile = 1; - - /* The transaction journal now exists and we have a write lock on the - ** main database file. Write the current page to the transaction - ** journal if it is not there already. - */ - if( !pPg->inJournal && pPager->useJournal ){ - if( (int)pPg->pgno <= pPager->origDbSize ){ - int szPg; - u32 saved; - if( journal_format>=JOURNAL_FORMAT_3 ){ - u32 cksum = pager_cksum(pPager, pPg->pgno, pData); - saved = *(u32*)PGHDR_TO_EXTRA(pPg); - store32bits(cksum, pPg, SQLITE_PAGE_SIZE); - szPg = SQLITE_PAGE_SIZE+8; - }else{ - szPg = SQLITE_PAGE_SIZE+4; - } - store32bits(pPg->pgno, pPg, -4); - CODEC(pPager, pData, pPg->pgno, 7); - rc = sqliteOsWrite(&pPager->jfd, &((char*)pData)[-4], szPg); - TRACE3("JOURNAL %d %d\n", pPg->pgno, pPg->needSync); - CODEC(pPager, pData, pPg->pgno, 0); - if( journal_format>=JOURNAL_FORMAT_3 ){ - *(u32*)PGHDR_TO_EXTRA(pPg) = saved; - } - if( rc!=SQLITE_OK ){ - sqlitepager_rollback(pPager); - pPager->errMask |= PAGER_ERR_FULL; - return rc; - } - pPager->nRec++; - assert( pPager->aInJournal!=0 ); - pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); - pPg->needSync = !pPager->noSync; - pPg->inJournal = 1; - if( pPager->ckptInUse ){ - pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_ckpt_list(pPg); - } - }else{ - pPg->needSync = !pPager->journalStarted && !pPager->noSync; - TRACE3("APPEND %d %d\n", pPg->pgno, pPg->needSync); - } - if( pPg->needSync ){ - pPager->needSync = 1; - } - } - - /* If the checkpoint journal is open and the page is not in it, - ** then write the current page to the checkpoint journal. Note that - ** the checkpoint journal always uses the simplier format 2 that lacks - ** checksums. The header is also omitted from the checkpoint journal. - */ - if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ - assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); - store32bits(pPg->pgno, pPg, -4); - CODEC(pPager, pData, pPg->pgno, 7); - rc = sqliteOsWrite(&pPager->cpfd, &((char*)pData)[-4], SQLITE_PAGE_SIZE+4); - TRACE2("CKPT-JOURNAL %d\n", pPg->pgno); - CODEC(pPager, pData, pPg->pgno, 0); - if( rc!=SQLITE_OK ){ - sqlitepager_rollback(pPager); - pPager->errMask |= PAGER_ERR_FULL; - return rc; - } - pPager->ckptNRec++; - assert( pPager->aInCkpt!=0 ); - pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_ckpt_list(pPg); - } - - /* Update the database size and return. - */ - if( pPager->dbSize<(int)pPg->pgno ){ - pPager->dbSize = pPg->pgno; - } - return rc; -} - -/* -** Return TRUE if the page given in the argument was previously passed -** to sqlitepager_write(). In other words, return TRUE if it is ok -** to change the content of the page. -*/ -int sqlitepager_iswriteable(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - return pPg->dirty; -} - -/* -** Replace the content of a single page with the information in the third -** argument. -*/ -int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void *pData){ - void *pPage; - int rc; - - rc = sqlitepager_get(pPager, pgno, &pPage); - if( rc==SQLITE_OK ){ - rc = sqlitepager_write(pPage); - if( rc==SQLITE_OK ){ - memcpy(pPage, pData, SQLITE_PAGE_SIZE); - } - sqlitepager_unref(pPage); - } - return rc; -} - -/* -** A call to this routine tells the pager that it is not necessary to -** write the information on page "pgno" back to the disk, even though -** that page might be marked as dirty. -** -** The overlying software layer calls this routine when all of the data -** on the given page is unused. The pager marks the page as clean so -** that it does not get written to disk. -** -** Tests show that this optimization, together with the -** sqlitepager_dont_rollback() below, more than double the speed -** of large INSERT operations and quadruple the speed of large DELETEs. -** -** When this routine is called, set the alwaysRollback flag to true. -** Subsequent calls to sqlitepager_dont_rollback() for the same page -** will thereafter be ignored. This is necessary to avoid a problem -** where a page with data is added to the freelist during one part of -** a transaction then removed from the freelist during a later part -** of the same transaction and reused for some other purpose. When it -** is first added to the freelist, this routine is called. When reused, -** the dont_rollback() routine is called. But because the page contains -** critical data, we still need to be sure it gets rolled back in spite -** of the dont_rollback() call. -*/ -void sqlitepager_dont_write(Pager *pPager, Pgno pgno){ - PgHdr *pPg; - - pPg = pager_lookup(pPager, pgno); - pPg->alwaysRollback = 1; - if( pPg && pPg->dirty ){ - if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSizedbSize ){ - /* If this pages is the last page in the file and the file has grown - ** during the current transaction, then do NOT mark the page as clean. - ** When the database file grows, we must make sure that the last page - ** gets written at least once so that the disk file will be the correct - ** size. If you do not write this page and the size of the file - ** on the disk ends up being too small, that can lead to database - ** corruption during the next transaction. - */ - }else{ - TRACE2("DONT_WRITE %d\n", pgno); - pPg->dirty = 0; - } - } -} - -/* -** A call to this routine tells the pager that if a rollback occurs, -** it is not necessary to restore the data on the given page. This -** means that the pager does not have to record the given page in the -** rollback journal. -*/ -void sqlitepager_dont_rollback(void *pData){ - PgHdr *pPg = DATA_TO_PGHDR(pData); - Pager *pPager = pPg->pPager; - - if( pPager->state!=SQLITE_WRITELOCK || pPager->journalOpen==0 ) return; - if( pPg->alwaysRollback || pPager->alwaysRollback ) return; - if( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ){ - assert( pPager->aInJournal!=0 ); - pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); - pPg->inJournal = 1; - if( pPager->ckptInUse ){ - pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_ckpt_list(pPg); - } - TRACE2("DONT_ROLLBACK %d\n", pPg->pgno); - } - if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ - assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); - assert( pPager->aInCkpt!=0 ); - pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); - page_add_to_ckpt_list(pPg); - } -} - -/* -** Commit all changes to the database and release the write lock. -** -** If the commit fails for any reason, a rollback attempt is made -** and an error code is returned. If the commit worked, SQLITE_OK -** is returned. -*/ -int sqlitepager_commit(Pager *pPager){ - int rc; - PgHdr *pPg; - - if( pPager->errMask==PAGER_ERR_FULL ){ - rc = sqlitepager_rollback(pPager); - if( rc==SQLITE_OK ){ - rc = SQLITE_FULL; - } - return rc; - } - if( pPager->errMask!=0 ){ - rc = pager_errcode(pPager); - return rc; - } - if( pPager->state!=SQLITE_WRITELOCK ){ - return SQLITE_ERROR; - } - TRACE1("COMMIT\n"); - if( pPager->dirtyFile==0 ){ - /* Exit early (without doing the time-consuming sqliteOsSync() calls) - ** if there have been no changes to the database file. */ - assert( pPager->needSync==0 ); - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - } - assert( pPager->journalOpen ); - rc = syncJournal(pPager); - if( rc!=SQLITE_OK ){ - goto commit_abort; - } - pPg = pager_get_all_dirty_pages(pPager); - if( pPg ){ - rc = pager_write_pagelist(pPg); - if( rc || (!pPager->noSync && sqliteOsSync(&pPager->fd)!=SQLITE_OK) ){ - goto commit_abort; - } - } - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - - /* Jump here if anything goes wrong during the commit process. - */ -commit_abort: - rc = sqlitepager_rollback(pPager); - if( rc==SQLITE_OK ){ - rc = SQLITE_FULL; - } - return rc; -} - -/* -** Rollback all changes. The database falls back to read-only mode. -** All in-memory cache pages revert to their original data contents. -** The journal is deleted. -** -** This routine cannot fail unless some other process is not following -** the correct locking protocol (SQLITE_PROTOCOL) or unless some other -** process is writing trash into the journal file (SQLITE_CORRUPT) or -** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error -** codes are returned for all these occasions. Otherwise, -** SQLITE_OK is returned. -*/ -int sqlitepager_rollback(Pager *pPager){ - int rc; - TRACE1("ROLLBACK\n"); - if( !pPager->dirtyFile || !pPager->journalOpen ){ - rc = pager_unwritelock(pPager); - pPager->dbSize = -1; - return rc; - } - - if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){ - if( pPager->state>=SQLITE_WRITELOCK ){ - pager_playback(pPager, 1); - } - return pager_errcode(pPager); - } - if( pPager->state!=SQLITE_WRITELOCK ){ - return SQLITE_OK; - } - rc = pager_playback(pPager, 1); - if( rc!=SQLITE_OK ){ - rc = SQLITE_CORRUPT; - pPager->errMask |= PAGER_ERR_CORRUPT; - } - pPager->dbSize = -1; - return rc; -} - -/* -** Return TRUE if the database file is opened read-only. Return FALSE -** if the database is (in theory) writable. -*/ -int sqlitepager_isreadonly(Pager *pPager){ - return pPager->readOnly; -} - -/* -** This routine is used for testing and analysis only. -*/ -int *sqlitepager_stats(Pager *pPager){ - static int a[9]; - a[0] = pPager->nRef; - a[1] = pPager->nPage; - a[2] = pPager->mxPage; - a[3] = pPager->dbSize; - a[4] = pPager->state; - a[5] = pPager->errMask; - a[6] = pPager->nHit; - a[7] = pPager->nMiss; - a[8] = pPager->nOvfl; - return a; -} - -/* -** Set the checkpoint. -** -** This routine should be called with the transaction journal already -** open. A new checkpoint journal is created that can be used to rollback -** changes of a single SQL command within a larger transaction. -*/ -int sqlitepager_ckpt_begin(Pager *pPager){ - int rc; - char zTemp[SQLITE_TEMPNAME_SIZE]; - if( !pPager->journalOpen ){ - pPager->ckptAutoopen = 1; - return SQLITE_OK; - } - assert( pPager->journalOpen ); - assert( !pPager->ckptInUse ); - pPager->aInCkpt = sqliteMalloc( pPager->dbSize/8 + 1 ); - if( pPager->aInCkpt==0 ){ - sqliteOsReadLock(&pPager->fd); - return SQLITE_NOMEM; - } -#ifndef NDEBUG - rc = sqliteOsFileSize(&pPager->jfd, &pPager->ckptJSize); - if( rc ) goto ckpt_begin_failed; - assert( pPager->ckptJSize == - pPager->nRec*JOURNAL_PG_SZ(journal_format)+JOURNAL_HDR_SZ(journal_format) ); -#endif - pPager->ckptJSize = pPager->nRec*JOURNAL_PG_SZ(journal_format) - + JOURNAL_HDR_SZ(journal_format); - pPager->ckptSize = pPager->dbSize; - if( !pPager->ckptOpen ){ - rc = sqlitepager_opentemp(zTemp, &pPager->cpfd); - if( rc ) goto ckpt_begin_failed; - pPager->ckptOpen = 1; - pPager->ckptNRec = 0; - } - pPager->ckptInUse = 1; - return SQLITE_OK; - -ckpt_begin_failed: - if( pPager->aInCkpt ){ - sqliteFree(pPager->aInCkpt); - pPager->aInCkpt = 0; - } - return rc; -} - -/* -** Commit a checkpoint. -*/ -int sqlitepager_ckpt_commit(Pager *pPager){ - if( pPager->ckptInUse ){ - PgHdr *pPg, *pNext; - sqliteOsSeek(&pPager->cpfd, 0); - /* sqliteOsTruncate(&pPager->cpfd, 0); */ - pPager->ckptNRec = 0; - pPager->ckptInUse = 0; - sqliteFree( pPager->aInCkpt ); - pPager->aInCkpt = 0; - for(pPg=pPager->pCkpt; pPg; pPg=pNext){ - pNext = pPg->pNextCkpt; - assert( pPg->inCkpt ); - pPg->inCkpt = 0; - pPg->pPrevCkpt = pPg->pNextCkpt = 0; - } - pPager->pCkpt = 0; - } - pPager->ckptAutoopen = 0; - return SQLITE_OK; -} - -/* -** Rollback a checkpoint. -*/ -int sqlitepager_ckpt_rollback(Pager *pPager){ - int rc; - if( pPager->ckptInUse ){ - rc = pager_ckpt_playback(pPager); - sqlitepager_ckpt_commit(pPager); - }else{ - rc = SQLITE_OK; - } - pPager->ckptAutoopen = 0; - return rc; -} - -/* -** Return the full pathname of the database file. -*/ -const char *sqlitepager_filename(Pager *pPager){ - return pPager->zFilename; -} - -/* -** Set the codec for this pager -*/ -void sqlitepager_set_codec( - Pager *pPager, - void (*xCodec)(void*,void*,Pgno,int), - void *pCodecArg -){ - pPager->xCodec = xCodec; - pPager->pCodecArg = pCodecArg; -} - -#ifdef SQLITE_TEST -/* -** Print a listing of all referenced pages and their ref count. -*/ -void sqlitepager_refdump(Pager *pPager){ - PgHdr *pPg; - for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ - if( pPg->nRef<=0 ) continue; - printf("PAGE %3d addr=0x%08x nRef=%d\n", - pPg->pgno, (int)PGHDR_TO_DATA(pPg), pPg->nRef); - } -} -#endif diff --git a/ext/sqlite/libsqlite/src/pager.h b/ext/sqlite/libsqlite/src/pager.h deleted file mode 100644 index 7172db88f5628..0000000000000 --- a/ext/sqlite/libsqlite/src/pager.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. The page cache subsystem reads and writes a file a page -** at a time and provides a journal for rollback. -** -** @(#) $Id$ -*/ - -/* -** The size of one page -** -** You can change this value to another (reasonable) value you want. -** It need not be a power of two, though the interface to the disk -** will likely be faster if it is. -** -** Experiments show that a page size of 1024 gives the best speed -** for common usages. The speed differences for different sizes -** such as 512, 2048, 4096, an so forth, is minimal. Note, however, -** that changing the page size results in a completely imcompatible -** file format. -*/ -#ifndef SQLITE_PAGE_SIZE -#define SQLITE_PAGE_SIZE 1024 -#endif - -/* -** Number of extra bytes of data allocated at the end of each page and -** stored on disk but not used by the higher level btree layer. Changing -** this value results in a completely incompatible file format. -*/ -#ifndef SQLITE_PAGE_RESERVE -#define SQLITE_PAGE_RESERVE 0 -#endif - -/* -** The total number of usable bytes stored on disk for each page. -** The usable bytes come at the beginning of the page and the reserve -** bytes come at the end. -*/ -#define SQLITE_USABLE_SIZE (SQLITE_PAGE_SIZE-SQLITE_PAGE_RESERVE) - -/* -** Maximum number of pages in one database. (This is a limitation of -** imposed by 4GB files size limits.) -*/ -#define SQLITE_MAX_PAGE 1073741823 - -/* -** The type used to represent a page number. The first page in a file -** is called page 1. 0 is used to represent "not a page". -*/ -typedef unsigned int Pgno; - -/* -** Each open file is managed by a separate instance of the "Pager" structure. -*/ -typedef struct Pager Pager; - -/* -** See source code comments for a detailed description of the following -** routines: -*/ -int sqlitepager_open(Pager **ppPager, const char *zFilename, - int nPage, int nExtra, int useJournal); -void sqlitepager_set_destructor(Pager*, void(*)(void*)); -void sqlitepager_set_cachesize(Pager*, int); -int sqlitepager_close(Pager *pPager); -int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage); -void *sqlitepager_lookup(Pager *pPager, Pgno pgno); -int sqlitepager_ref(void*); -int sqlitepager_unref(void*); -Pgno sqlitepager_pagenumber(void*); -int sqlitepager_write(void*); -int sqlitepager_iswriteable(void*); -int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void*); -int sqlitepager_pagecount(Pager*); -int sqlitepager_truncate(Pager*,Pgno); -int sqlitepager_begin(void*); -int sqlitepager_commit(Pager*); -int sqlitepager_rollback(Pager*); -int sqlitepager_isreadonly(Pager*); -int sqlitepager_ckpt_begin(Pager*); -int sqlitepager_ckpt_commit(Pager*); -int sqlitepager_ckpt_rollback(Pager*); -void sqlitepager_dont_rollback(void*); -void sqlitepager_dont_write(Pager*, Pgno); -int *sqlitepager_stats(Pager*); -void sqlitepager_set_safety_level(Pager*,int); -const char *sqlitepager_filename(Pager*); -int sqlitepager_rename(Pager*, const char *zNewName); -void sqlitepager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*); - -#ifdef SQLITE_TEST -void sqlitepager_refdump(Pager*); -int pager_refinfo_enable; -int journal_format; -#endif diff --git a/ext/sqlite/libsqlite/src/parse.c b/ext/sqlite/libsqlite/src/parse.c deleted file mode 100644 index 1c5264ca66f53..0000000000000 --- a/ext/sqlite/libsqlite/src/parse.c +++ /dev/null @@ -1,4035 +0,0 @@ -/* Driver template for the LEMON parser generator. -** The author disclaims copyright to this source code. -*/ -/* First off, code is include which follows the "include" declaration -** in the input file. */ -#include -#line 33 "parse.y" - -#include "sqliteInt.h" -#include "parse.h" - -/* -** An instance of this structure holds information about the -** LIMIT clause of a SELECT statement. -*/ -struct LimitVal { - int limit; /* The LIMIT value. -1 if there is no limit */ - int offset; /* The OFFSET. 0 if there is none */ -}; - -/* -** An instance of the following structure describes the event of a -** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, -** TK_DELETE, or TK_INSTEAD. If the event is of the form -** -** UPDATE ON (a,b,c) -** -** Then the "b" IdList records the list "a,b,c". -*/ -struct TrigEvent { int a; IdList * b; }; - - -#line 34 "parse.c" -/* Next is all token values, in a form suitable for use by makeheaders. -** This section will be null unless lemon is run with the -m switch. -*/ -/* -** These constants (all generated automatically by the parser generator) -** specify the various kinds of tokens (terminals) that the parser -** understands. -** -** Each symbol here is a terminal symbol in the grammar. -*/ -/* Make sure the INTERFACE macro is defined. -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/* The next thing included is series of defines which control -** various aspects of the generated parser. -** YYCODETYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 terminals -** and nonterminals. "int" is used otherwise. -** YYNOCODE is a number of type YYCODETYPE which corresponds -** to no legal terminal or nonterminal number. This -** number is used to fill in empty slots of the hash -** table. -** YYFALLBACK If defined, this indicates that one or more tokens -** have fall-back values which should be used if the -** original value of the token will not parse. -** YYACTIONTYPE is the data type used for storing terminal -** and nonterminal numbers. "unsigned char" is -** used if there are fewer than 250 rules and -** states combined. "int" is used otherwise. -** sqliteParserTOKENTYPE is the data type used for minor tokens given -** directly to the parser from the tokenizer. -** YYMINORTYPE is the data type used for all minor tokens. -** This is typically a union of many types, one of -** which is sqliteParserTOKENTYPE. The entry in the union -** for base tokens is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. -** sqliteParserARG_SDECL A static variable declaration for the %extra_argument -** sqliteParserARG_PDECL A parameter declaration for the %extra_argument -** sqliteParserARG_STORE Code to store %extra_argument into yypParser -** sqliteParserARG_FETCH Code to extract %extra_argument from yypParser -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -*/ -/*  */ -#define YYCODETYPE unsigned char -#define YYNOCODE 221 -#define YYACTIONTYPE unsigned short int -#define sqliteParserTOKENTYPE Token -typedef union { - sqliteParserTOKENTYPE yy0; - TriggerStep * yy19; - struct LimitVal yy124; - Select* yy179; - Expr * yy182; - Expr* yy242; - struct TrigEvent yy290; - Token yy298; - SrcList* yy307; - IdList* yy320; - ExprList* yy322; - int yy372; - struct {int value; int mask;} yy407; - int yy441; -} YYMINORTYPE; -#define YYSTACKDEPTH 100 -#define sqliteParserARG_SDECL Parse *pParse; -#define sqliteParserARG_PDECL ,Parse *pParse -#define sqliteParserARG_FETCH Parse *pParse = yypParser->pParse -#define sqliteParserARG_STORE yypParser->pParse = pParse -#define YYNSTATE 563 -#define YYNRULE 293 -#define YYERRORSYMBOL 131 -#define YYERRSYMDT yy441 -#define YYFALLBACK 1 -#define YY_NO_ACTION (YYNSTATE+YYNRULE+2) -#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) -#define YY_ERROR_ACTION (YYNSTATE+YYNRULE) - -/* Next are that tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N < YYNSTATE Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. -** -** N == YYNSTATE+YYNRULE A syntax error has occurred. -** -** N == YYNSTATE+YYNRULE+1 The parser accepts its input. -** -** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as -** -** yy_action[ yy_shift_ofst[S] + X ] -** -** If the index value yy_shift_ofst[S]+X is out of range or if the value -** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] -** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table -** and that yy_default[S] should be used instead. -** -** The formula above is for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -*/ -static YYACTIONTYPE yy_action[] = { - /* 0 */ 264, 5, 262, 119, 123, 117, 121, 129, 131, 133, - /* 10 */ 135, 144, 146, 148, 150, 152, 154, 568, 106, 106, - /* 20 */ 143, 857, 1, 562, 3, 142, 129, 131, 133, 135, - /* 30 */ 144, 146, 148, 150, 152, 154, 174, 103, 8, 115, - /* 40 */ 104, 139, 127, 125, 156, 161, 157, 162, 166, 119, - /* 50 */ 123, 117, 121, 129, 131, 133, 135, 144, 146, 148, - /* 60 */ 150, 152, 154, 31, 361, 392, 263, 143, 363, 369, - /* 70 */ 374, 97, 142, 148, 150, 152, 154, 68, 75, 377, - /* 80 */ 167, 64, 218, 46, 20, 289, 115, 104, 139, 127, - /* 90 */ 125, 156, 161, 157, 162, 166, 119, 123, 117, 121, - /* 100 */ 129, 131, 133, 135, 144, 146, 148, 150, 152, 154, - /* 110 */ 193, 41, 336, 563, 44, 54, 60, 62, 308, 331, - /* 120 */ 175, 20, 560, 561, 572, 333, 640, 18, 359, 144, - /* 130 */ 146, 148, 150, 152, 154, 143, 181, 179, 303, 18, - /* 140 */ 142, 84, 86, 20, 177, 66, 67, 111, 21, 22, - /* 150 */ 112, 105, 83, 792, 115, 104, 139, 127, 125, 156, - /* 160 */ 161, 157, 162, 166, 119, 123, 117, 121, 129, 131, - /* 170 */ 133, 135, 144, 146, 148, 150, 152, 154, 790, 560, - /* 180 */ 561, 46, 13, 113, 183, 21, 22, 534, 361, 2, - /* 190 */ 3, 14, 363, 369, 374, 338, 361, 690, 544, 542, - /* 200 */ 363, 369, 374, 377, 836, 143, 15, 21, 22, 16, - /* 210 */ 142, 377, 44, 54, 60, 62, 308, 331, 396, 535, - /* 220 */ 17, 9, 191, 333, 115, 104, 139, 127, 125, 156, - /* 230 */ 161, 157, 162, 166, 119, 123, 117, 121, 129, 131, - /* 240 */ 133, 135, 144, 146, 148, 150, 152, 154, 571, 230, - /* 250 */ 340, 343, 143, 20, 536, 537, 538, 142, 402, 337, - /* 260 */ 398, 339, 357, 68, 346, 347, 32, 64, 266, 391, - /* 270 */ 37, 115, 104, 139, 127, 125, 156, 161, 157, 162, - /* 280 */ 166, 119, 123, 117, 121, 129, 131, 133, 135, 144, - /* 290 */ 146, 148, 150, 152, 154, 839, 193, 651, 291, 298, - /* 300 */ 300, 221, 357, 43, 173, 689, 175, 251, 330, 36, - /* 310 */ 37, 106, 232, 40, 335, 58, 137, 21, 22, 330, - /* 320 */ 411, 143, 181, 179, 47, 59, 142, 358, 390, 174, - /* 330 */ 177, 66, 67, 111, 448, 49, 112, 105, 583, 213, - /* 340 */ 115, 104, 139, 127, 125, 156, 161, 157, 162, 166, - /* 350 */ 119, 123, 117, 121, 129, 131, 133, 135, 144, 146, - /* 360 */ 148, 150, 152, 154, 306, 301, 106, 249, 259, 113, - /* 370 */ 183, 793, 70, 253, 281, 219, 20, 106, 20, 11, - /* 380 */ 106, 482, 454, 444, 299, 143, 169, 10, 171, 172, - /* 390 */ 142, 169, 73, 171, 172, 103, 688, 69, 174, 169, - /* 400 */ 252, 171, 172, 12, 115, 104, 139, 127, 125, 156, - /* 410 */ 161, 157, 162, 166, 119, 123, 117, 121, 129, 131, - /* 420 */ 133, 135, 144, 146, 148, 150, 152, 154, 95, 237, - /* 430 */ 313, 20, 143, 295, 244, 424, 169, 142, 171, 172, - /* 440 */ 21, 22, 21, 22, 219, 386, 316, 323, 325, 837, - /* 450 */ 19, 115, 104, 139, 127, 125, 156, 161, 157, 162, - /* 460 */ 166, 119, 123, 117, 121, 129, 131, 133, 135, 144, - /* 470 */ 146, 148, 150, 152, 154, 106, 661, 20, 264, 143, - /* 480 */ 262, 844, 315, 169, 142, 171, 172, 333, 38, 842, - /* 490 */ 10, 356, 348, 184, 421, 21, 22, 282, 115, 104, - /* 500 */ 139, 127, 125, 156, 161, 157, 162, 166, 119, 123, - /* 510 */ 117, 121, 129, 131, 133, 135, 144, 146, 148, 150, - /* 520 */ 152, 154, 69, 254, 262, 251, 143, 639, 663, 35, - /* 530 */ 65, 142, 726, 313, 283, 259, 185, 417, 419, 418, - /* 540 */ 284, 21, 22, 690, 263, 115, 104, 139, 127, 125, - /* 550 */ 156, 161, 157, 162, 166, 119, 123, 117, 121, 129, - /* 560 */ 131, 133, 135, 144, 146, 148, 150, 152, 154, 256, - /* 570 */ 20, 791, 424, 143, 169, 52, 171, 172, 142, 169, - /* 580 */ 24, 171, 172, 247, 53, 315, 26, 169, 263, 171, - /* 590 */ 172, 253, 115, 164, 139, 127, 125, 156, 161, 157, - /* 600 */ 162, 166, 119, 123, 117, 121, 129, 131, 133, 135, - /* 610 */ 144, 146, 148, 150, 152, 154, 426, 349, 252, 425, - /* 620 */ 143, 262, 575, 297, 591, 142, 169, 296, 171, 172, - /* 630 */ 169, 471, 171, 172, 21, 22, 427, 221, 91, 115, - /* 640 */ 227, 139, 127, 125, 156, 161, 157, 162, 166, 119, - /* 650 */ 123, 117, 121, 129, 131, 133, 135, 144, 146, 148, - /* 660 */ 150, 152, 154, 388, 312, 106, 89, 143, 720, 376, - /* 670 */ 387, 170, 142, 487, 666, 248, 320, 216, 319, 217, - /* 680 */ 28, 459, 30, 305, 189, 263, 209, 104, 139, 127, - /* 690 */ 125, 156, 161, 157, 162, 166, 119, 123, 117, 121, - /* 700 */ 129, 131, 133, 135, 144, 146, 148, 150, 152, 154, - /* 710 */ 106, 106, 809, 494, 143, 489, 106, 816, 33, 142, - /* 720 */ 395, 234, 273, 217, 274, 420, 20, 545, 114, 481, - /* 730 */ 137, 429, 576, 321, 116, 139, 127, 125, 156, 161, - /* 740 */ 157, 162, 166, 119, 123, 117, 121, 129, 131, 133, - /* 750 */ 135, 144, 146, 148, 150, 152, 154, 7, 322, 23, - /* 760 */ 25, 27, 394, 68, 415, 416, 10, 64, 197, 477, - /* 770 */ 577, 533, 266, 548, 578, 831, 276, 201, 520, 4, - /* 780 */ 6, 245, 430, 557, 29, 266, 491, 106, 441, 497, - /* 790 */ 21, 22, 205, 168, 443, 195, 193, 531, 276, 448, - /* 800 */ 276, 808, 267, 272, 529, 174, 175, 318, 440, 341, - /* 810 */ 344, 106, 342, 345, 69, 286, 68, 582, 69, 69, - /* 820 */ 64, 540, 181, 179, 541, 328, 302, 366, 217, 118, - /* 830 */ 177, 66, 67, 111, 34, 143, 112, 105, 445, 510, - /* 840 */ 142, 215, 278, 800, 467, 276, 498, 503, 444, 193, - /* 850 */ 106, 219, 486, 443, 42, 73, 231, 73, 45, 175, - /* 860 */ 449, 39, 225, 229, 278, 451, 278, 68, 174, 113, - /* 870 */ 183, 64, 371, 55, 106, 181, 179, 292, 69, 276, - /* 880 */ 276, 69, 48, 177, 66, 67, 111, 224, 276, 112, - /* 890 */ 105, 106, 481, 393, 106, 106, 63, 106, 106, 106, - /* 900 */ 193, 653, 106, 467, 233, 51, 380, 437, 526, 120, - /* 910 */ 175, 278, 122, 124, 219, 126, 128, 130, 69, 453, - /* 920 */ 132, 106, 113, 183, 451, 106, 181, 179, 159, 106, - /* 930 */ 106, 106, 518, 106, 177, 66, 67, 111, 106, 134, - /* 940 */ 112, 105, 422, 136, 106, 278, 278, 138, 141, 145, - /* 950 */ 720, 147, 106, 329, 275, 274, 149, 106, 852, 158, - /* 960 */ 106, 106, 151, 106, 106, 351, 106, 352, 106, 464, - /* 970 */ 153, 106, 106, 113, 183, 155, 106, 106, 163, 165, - /* 980 */ 106, 176, 178, 106, 180, 106, 182, 106, 401, 190, - /* 990 */ 192, 106, 106, 293, 210, 212, 106, 367, 214, 274, - /* 1000 */ 372, 226, 274, 228, 381, 241, 274, 106, 106, 246, - /* 1010 */ 280, 290, 106, 69, 375, 438, 472, 274, 422, 832, - /* 1020 */ 106, 73, 474, 73, 458, 412, 462, 480, 464, 478, - /* 1030 */ 466, 690, 515, 519, 475, 478, 516, 50, 479, 221, - /* 1040 */ 690, 221, 56, 57, 61, 592, 71, 69, 593, 73, - /* 1050 */ 72, 74, 245, 242, 93, 81, 76, 69, 77, 240, - /* 1060 */ 78, 82, 79, 245, 85, 554, 80, 88, 87, 90, - /* 1070 */ 92, 94, 96, 102, 100, 99, 101, 107, 109, 160, - /* 1080 */ 154, 667, 98, 508, 108, 668, 110, 220, 211, 669, - /* 1090 */ 137, 140, 188, 194, 186, 196, 187, 199, 198, 200, - /* 1100 */ 203, 204, 202, 207, 206, 208, 221, 223, 222, 235, - /* 1110 */ 236, 239, 238, 217, 250, 258, 243, 261, 279, 270, - /* 1120 */ 271, 255, 257, 260, 269, 265, 285, 294, 277, 268, - /* 1130 */ 287, 304, 309, 307, 327, 312, 288, 354, 389, 314, - /* 1140 */ 364, 365, 370, 378, 379, 382, 310, 49, 311, 362, - /* 1150 */ 368, 373, 317, 324, 326, 332, 350, 355, 383, 400, - /* 1160 */ 353, 397, 399, 403, 404, 334, 405, 406, 407, 384, - /* 1170 */ 413, 409, 824, 414, 360, 385, 829, 423, 410, 431, - /* 1180 */ 428, 432, 830, 433, 434, 436, 439, 798, 799, 447, - /* 1190 */ 442, 450, 727, 728, 446, 823, 452, 838, 455, 445, - /* 1200 */ 456, 457, 408, 435, 460, 461, 463, 840, 465, 468, - /* 1210 */ 470, 469, 476, 841, 483, 485, 843, 660, 662, 493, - /* 1220 */ 806, 496, 473, 849, 499, 719, 501, 484, 488, 490, - /* 1230 */ 492, 502, 504, 495, 500, 507, 505, 506, 509, 722, - /* 1240 */ 513, 511, 512, 514, 517, 725, 528, 522, 524, 525, - /* 1250 */ 527, 523, 807, 530, 810, 532, 811, 812, 813, 814, - /* 1260 */ 817, 819, 539, 820, 818, 815, 521, 543, 546, 552, - /* 1270 */ 556, 550, 850, 547, 549, 851, 555, 558, 551, 855, - /* 1280 */ 553, 559, -}; -static YYCODETYPE yy_lookahead[] = { - /* 0 */ 21, 9, 23, 70, 71, 72, 73, 74, 75, 76, - /* 10 */ 77, 78, 79, 80, 81, 82, 83, 9, 140, 140, - /* 20 */ 41, 132, 133, 134, 135, 46, 74, 75, 76, 77, - /* 30 */ 78, 79, 80, 81, 82, 83, 158, 158, 138, 60, - /* 40 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - /* 50 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 60 */ 81, 82, 83, 19, 90, 21, 87, 41, 94, 95, - /* 70 */ 96, 192, 46, 80, 81, 82, 83, 19, 174, 105, - /* 80 */ 19, 23, 204, 62, 23, 181, 60, 61, 62, 63, - /* 90 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - /* 100 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 110 */ 52, 90, 91, 0, 93, 94, 95, 96, 97, 98, - /* 120 */ 62, 23, 9, 10, 9, 104, 20, 12, 22, 78, - /* 130 */ 79, 80, 81, 82, 83, 41, 78, 79, 80, 12, - /* 140 */ 46, 78, 79, 23, 86, 87, 88, 89, 87, 88, - /* 150 */ 92, 93, 89, 127, 60, 61, 62, 63, 64, 65, - /* 160 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 170 */ 76, 77, 78, 79, 80, 81, 82, 83, 14, 9, - /* 180 */ 10, 62, 15, 125, 126, 87, 88, 140, 90, 134, - /* 190 */ 135, 24, 94, 95, 96, 23, 90, 9, 78, 79, - /* 200 */ 94, 95, 96, 105, 11, 41, 39, 87, 88, 42, - /* 210 */ 46, 105, 93, 94, 95, 96, 97, 98, 17, 99, - /* 220 */ 53, 139, 128, 104, 60, 61, 62, 63, 64, 65, - /* 230 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 240 */ 76, 77, 78, 79, 80, 81, 82, 83, 9, 19, - /* 250 */ 78, 79, 41, 23, 207, 208, 209, 46, 57, 87, - /* 260 */ 59, 89, 140, 19, 92, 93, 144, 23, 152, 147, - /* 270 */ 148, 60, 61, 62, 63, 64, 65, 66, 67, 68, - /* 280 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 290 */ 79, 80, 81, 82, 83, 14, 52, 9, 182, 20, - /* 300 */ 20, 113, 140, 156, 20, 20, 62, 22, 161, 147, - /* 310 */ 148, 140, 20, 155, 156, 26, 200, 87, 88, 161, - /* 320 */ 127, 41, 78, 79, 93, 36, 46, 165, 166, 158, - /* 330 */ 86, 87, 88, 89, 53, 104, 92, 93, 9, 128, - /* 340 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - /* 350 */ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - /* 360 */ 80, 81, 82, 83, 20, 194, 140, 183, 184, 125, - /* 370 */ 126, 127, 146, 88, 19, 204, 23, 140, 23, 31, - /* 380 */ 140, 100, 101, 102, 158, 41, 107, 99, 109, 110, - /* 390 */ 46, 107, 111, 109, 110, 158, 20, 171, 158, 107, - /* 400 */ 115, 109, 110, 170, 60, 61, 62, 63, 64, 65, - /* 410 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - /* 420 */ 76, 77, 78, 79, 80, 81, 82, 83, 191, 192, - /* 430 */ 47, 23, 41, 80, 194, 140, 107, 46, 109, 110, - /* 440 */ 87, 88, 87, 88, 204, 62, 100, 101, 102, 11, - /* 450 */ 140, 60, 61, 62, 63, 64, 65, 66, 67, 68, - /* 460 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 470 */ 79, 80, 81, 82, 83, 140, 9, 23, 21, 41, - /* 480 */ 23, 9, 99, 107, 46, 109, 110, 104, 149, 9, - /* 490 */ 99, 152, 153, 158, 199, 87, 88, 146, 60, 61, - /* 500 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - /* 510 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - /* 520 */ 82, 83, 171, 115, 23, 22, 41, 20, 9, 22, - /* 530 */ 19, 46, 9, 47, 183, 184, 201, 100, 101, 102, - /* 540 */ 189, 87, 88, 19, 87, 60, 61, 62, 63, 64, - /* 550 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 560 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 115, - /* 570 */ 23, 14, 140, 41, 107, 34, 109, 110, 46, 107, - /* 580 */ 138, 109, 110, 22, 43, 99, 138, 107, 87, 109, - /* 590 */ 110, 88, 60, 61, 62, 63, 64, 65, 66, 67, - /* 600 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 610 */ 78, 79, 80, 81, 82, 83, 25, 19, 115, 28, - /* 620 */ 41, 23, 9, 108, 113, 46, 107, 112, 109, 110, - /* 630 */ 107, 199, 109, 110, 87, 88, 45, 113, 22, 60, - /* 640 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - /* 650 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 660 */ 81, 82, 83, 161, 162, 140, 50, 41, 9, 139, - /* 670 */ 168, 108, 46, 17, 111, 114, 91, 20, 93, 22, - /* 680 */ 138, 22, 142, 158, 127, 87, 129, 61, 62, 63, - /* 690 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - /* 700 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 710 */ 140, 140, 9, 57, 41, 59, 140, 9, 145, 46, - /* 720 */ 143, 20, 20, 22, 22, 49, 23, 19, 158, 158, - /* 730 */ 200, 18, 9, 29, 158, 62, 63, 64, 65, 66, - /* 740 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 750 */ 77, 78, 79, 80, 81, 82, 83, 11, 54, 13, - /* 760 */ 14, 15, 16, 19, 55, 56, 99, 23, 15, 198, - /* 770 */ 9, 63, 152, 27, 9, 99, 140, 24, 32, 136, - /* 780 */ 137, 122, 205, 37, 141, 152, 130, 140, 211, 146, - /* 790 */ 87, 88, 39, 146, 146, 42, 52, 51, 140, 53, - /* 800 */ 140, 9, 182, 167, 58, 158, 62, 103, 95, 89, - /* 810 */ 89, 140, 92, 92, 171, 182, 19, 9, 171, 171, - /* 820 */ 23, 89, 78, 79, 92, 167, 20, 167, 22, 158, - /* 830 */ 86, 87, 88, 89, 20, 41, 92, 93, 60, 196, - /* 840 */ 46, 194, 206, 130, 196, 140, 100, 101, 102, 52, - /* 850 */ 140, 204, 106, 146, 140, 111, 146, 111, 139, 62, - /* 860 */ 212, 150, 68, 69, 206, 217, 206, 19, 158, 125, - /* 870 */ 126, 23, 167, 48, 140, 78, 79, 80, 171, 140, - /* 880 */ 140, 171, 139, 86, 87, 88, 89, 93, 140, 92, - /* 890 */ 93, 140, 158, 146, 140, 140, 19, 140, 140, 140, - /* 900 */ 52, 123, 140, 196, 194, 44, 167, 167, 116, 158, - /* 910 */ 62, 206, 158, 158, 204, 158, 158, 158, 171, 212, - /* 920 */ 158, 140, 125, 126, 217, 140, 78, 79, 62, 140, - /* 930 */ 140, 140, 198, 140, 86, 87, 88, 89, 140, 158, - /* 940 */ 92, 93, 22, 158, 140, 206, 206, 158, 158, 158, - /* 950 */ 9, 158, 140, 20, 206, 22, 158, 140, 9, 93, - /* 960 */ 140, 140, 158, 140, 140, 20, 140, 22, 140, 140, - /* 970 */ 158, 140, 140, 125, 126, 158, 140, 140, 158, 158, - /* 980 */ 140, 158, 158, 140, 158, 140, 158, 140, 146, 158, - /* 990 */ 158, 140, 140, 140, 158, 158, 140, 20, 158, 22, - /* 1000 */ 20, 158, 22, 158, 20, 158, 22, 140, 140, 158, - /* 1010 */ 158, 158, 140, 171, 158, 20, 20, 22, 22, 99, - /* 1020 */ 140, 111, 146, 111, 195, 158, 158, 20, 140, 22, - /* 1030 */ 158, 103, 146, 20, 124, 22, 124, 164, 158, 113, - /* 1040 */ 114, 113, 157, 139, 139, 113, 172, 171, 113, 111, - /* 1050 */ 171, 173, 122, 119, 117, 180, 175, 171, 176, 120, - /* 1060 */ 177, 121, 178, 122, 89, 116, 179, 154, 89, 154, - /* 1070 */ 154, 118, 22, 151, 98, 157, 23, 113, 113, 93, - /* 1080 */ 83, 111, 193, 195, 140, 111, 140, 140, 127, 111, - /* 1090 */ 200, 200, 14, 19, 202, 20, 203, 140, 22, 20, - /* 1100 */ 140, 20, 22, 140, 22, 20, 113, 186, 140, 140, - /* 1110 */ 186, 157, 193, 22, 185, 115, 118, 186, 99, 116, - /* 1120 */ 19, 140, 140, 140, 188, 140, 20, 113, 157, 187, - /* 1130 */ 187, 20, 140, 139, 19, 162, 188, 20, 166, 140, - /* 1140 */ 48, 19, 19, 48, 19, 97, 159, 104, 160, 140, - /* 1150 */ 139, 139, 163, 163, 163, 151, 154, 152, 140, 21, - /* 1160 */ 154, 140, 140, 140, 213, 164, 214, 99, 140, 159, - /* 1170 */ 40, 215, 11, 38, 166, 160, 99, 140, 216, 130, - /* 1180 */ 49, 140, 99, 99, 140, 19, 139, 9, 130, 169, - /* 1190 */ 11, 14, 123, 123, 170, 9, 9, 14, 169, 60, - /* 1200 */ 140, 103, 186, 186, 140, 63, 176, 9, 63, 123, - /* 1210 */ 19, 140, 19, 9, 114, 176, 9, 9, 9, 186, - /* 1220 */ 9, 186, 197, 9, 114, 9, 186, 140, 140, 140, - /* 1230 */ 140, 176, 169, 140, 140, 103, 140, 186, 176, 9, - /* 1240 */ 186, 123, 140, 197, 19, 9, 87, 140, 114, 140, - /* 1250 */ 35, 186, 9, 140, 9, 152, 9, 9, 9, 9, - /* 1260 */ 9, 9, 210, 9, 9, 9, 169, 210, 140, 140, - /* 1270 */ 33, 152, 9, 20, 218, 9, 152, 218, 21, 9, - /* 1280 */ 219, 140, -}; -#define YY_SHIFT_USE_DFLT (-68) -static short yy_shift_ofst[] = { - /* 0 */ 170, 113, -68, 746, -8, -68, 8, 127, 288, 239, - /* 10 */ 348, 167, -68, -68, -68, -68, -68, -68, 547, -68, - /* 20 */ -68, -68, -68, 115, 613, 115, 723, 115, 761, 44, - /* 30 */ 765, 547, 507, 814, 808, 98, -68, 501, -68, 21, - /* 40 */ -68, 547, 119, -68, 667, -68, 231, 667, -68, 861, - /* 50 */ -68, 541, -68, -68, 825, 289, 667, -68, -68, -68, - /* 60 */ 667, -68, 877, 848, 511, 58, 932, 935, 744, -68, - /* 70 */ 279, 938, -68, 515, -68, 561, 930, 934, 939, 937, - /* 80 */ 940, -68, 63, -68, 975, -68, 979, -68, 616, 63, - /* 90 */ -68, 63, -68, 953, 848, 1050, 848, 976, 289, -68, - /* 100 */ 1053, -68, -68, 485, 848, -68, 964, 547, 965, 547, - /* 110 */ -68, -68, -68, -68, 673, 848, 626, 848, -48, 848, - /* 120 */ -48, 848, -48, 848, -48, 848, -67, 848, -67, 848, - /* 130 */ 51, 848, 51, 848, 51, 848, 51, 848, -67, 794, - /* 140 */ 848, -67, -68, -68, 848, -7, 848, -7, 848, 997, - /* 150 */ 848, 997, 848, 997, 848, -68, -68, 866, -68, 986, - /* 160 */ -68, -68, 848, 532, 848, -67, 61, 744, 284, 563, - /* 170 */ 970, 974, 978, -68, 485, 848, 673, 848, -68, 848, - /* 180 */ -68, 848, -68, 244, 26, 961, 557, 1078, -68, 848, - /* 190 */ 94, 848, 485, 1074, 753, 1075, -68, 1076, 547, 1079, - /* 200 */ -68, 1080, 547, 1081, -68, 1082, 547, 1085, -68, 848, - /* 210 */ 164, 848, 211, 848, 485, 657, -68, 848, -68, -68, - /* 220 */ 993, 547, -68, -68, -68, 848, 579, 848, 673, 230, - /* 230 */ 744, 292, -68, 701, -68, 993, -68, 976, 289, -68, - /* 240 */ 848, 485, 998, 848, 1091, 848, 485, -68, -68, 503, - /* 250 */ -68, -68, -68, 408, -68, 454, -68, 1000, -68, 355, - /* 260 */ 993, 457, -68, -68, 547, -68, -68, 1019, 1003, -68, - /* 270 */ 1101, 547, 702, -68, 547, -68, 289, -68, -68, 848, - /* 280 */ 485, 938, 376, 285, 1106, 457, 1019, 1003, -68, 797, - /* 290 */ -21, -68, -68, 1014, 353, -68, -68, -68, -68, 280, - /* 300 */ -68, 806, -68, 1111, -68, 344, 667, -68, 547, 1115, - /* 310 */ -68, 486, -68, 547, -68, 346, 704, -68, 585, -68, - /* 320 */ -68, -68, -68, 704, -68, 704, -68, 547, 933, -68, - /* 330 */ -68, 1053, -68, 861, -68, -68, 172, -68, -68, -68, - /* 340 */ 720, -68, -68, 721, -68, -68, -68, -68, 598, 63, - /* 350 */ 945, -68, 63, 1117, -68, -68, -68, -68, 106, -26, - /* 360 */ -68, 547, -68, 1092, 1122, 547, 977, 667, -68, 1123, - /* 370 */ 547, 980, 667, -68, 848, 391, -68, 1095, 1125, 547, - /* 380 */ 984, 1048, 547, 1115, -68, 383, 1043, -68, -68, -68, - /* 390 */ -68, -68, 938, 329, 713, 201, 547, -68, 547, 1138, - /* 400 */ 938, 467, 547, 591, 437, 1068, 547, 993, 1130, 193, - /* 410 */ 1161, 848, 438, 1135, 709, -68, -68, 1077, 1083, 676, - /* 420 */ 547, 920, 547, -68, -68, -68, -68, 1131, -68, -68, - /* 430 */ 1049, 547, 1084, 547, 524, 1166, 547, 995, 288, 1178, - /* 440 */ 1058, 1179, 281, 472, 778, 167, -68, 1069, 1070, 1177, - /* 450 */ 1186, 1187, 281, 1183, 1139, 547, 1098, 547, 659, 547, - /* 460 */ 1142, 848, 485, 1198, 1145, 848, 485, 1086, 547, 1191, - /* 470 */ 547, 996, -68, 910, 480, 1193, 848, 1007, 848, 485, - /* 480 */ 1204, 485, 1100, 547, 941, 1207, 656, 547, 1208, 547, - /* 490 */ 1209, 547, 188, 1211, 547, 188, 1214, 519, 1110, 547, - /* 500 */ 993, 941, 1216, 1139, 547, 928, 1132, 547, 659, 1230, - /* 510 */ 1118, 547, 993, 1191, 912, 523, 1225, 848, 1013, 1236, - /* 520 */ 1139, 547, 926, 1134, 547, 792, 1215, 1159, 1243, 703, - /* 530 */ 1245, 501, 708, 120, 1247, 1248, 1249, 1250, 732, 1251, - /* 540 */ 1252, 1254, 732, 1255, -68, 547, 1253, 1256, 1237, 501, - /* 550 */ 1257, 547, 949, 1263, 501, 1266, -68, 1237, 547, 1270, - /* 560 */ -68, -68, -68, -}; -#define YY_REDUCE_USE_DFLT (-123) -static short yy_reduce_ofst[] = { - /* 0 */ -111, 55, -123, 643, -123, -123, -123, -100, 82, -123, - /* 10 */ -123, 233, -123, -123, -123, -123, -123, -123, 310, -123, - /* 20 */ -123, -123, -123, 442, -123, 448, -123, 542, -123, 540, - /* 30 */ -123, 122, 573, -123, -123, 162, -123, 339, 711, 158, - /* 40 */ -123, 714, 147, -123, 719, -123, -123, 743, -123, 873, - /* 50 */ -123, -123, -123, -123, -123, 885, 904, -123, -123, -123, - /* 60 */ 905, -123, -123, 525, -123, 171, -123, -123, 226, -123, - /* 70 */ 874, 879, -123, 878, -96, 881, 882, 883, 884, 887, - /* 80 */ 875, -123, 913, -123, -123, -123, -123, -123, -123, 915, - /* 90 */ -123, 916, -123, -123, 237, -123, -121, 889, 918, -123, - /* 100 */ 922, -123, -123, 890, 570, -123, -123, 944, -123, 946, - /* 110 */ -123, -123, -123, -123, 890, 576, 890, 671, 890, 751, - /* 120 */ 890, 754, 890, 755, 890, 757, 890, 758, 890, 759, - /* 130 */ 890, 762, 890, 781, 890, 785, 890, 789, 890, 891, - /* 140 */ 790, 890, -123, -123, 791, 890, 793, 890, 798, 890, - /* 150 */ 804, 890, 812, 890, 817, 890, -123, -123, -123, -123, - /* 160 */ -123, -123, 820, 890, 821, 890, 947, 647, 874, -123, - /* 170 */ -123, -123, -123, -123, 890, 823, 890, 824, 890, 826, - /* 180 */ 890, 828, 890, 335, 890, 892, 893, -123, -123, 831, - /* 190 */ 890, 832, 890, -123, -123, -123, -123, -123, 957, -123, - /* 200 */ -123, -123, 960, -123, -123, -123, 963, -123, -123, 836, - /* 210 */ 890, 837, 890, 840, 890, -123, -123, -122, -123, -123, - /* 220 */ 921, 968, -123, -123, -123, 843, 890, 845, 890, 969, - /* 230 */ 710, 874, -123, -123, -123, 924, -123, 919, 954, -123, - /* 240 */ 847, 890, -123, 240, -123, 851, 890, -123, 184, 929, - /* 250 */ -123, -123, -123, 981, -123, 982, -123, -123, -123, 983, - /* 260 */ 931, 620, -123, -123, 985, -123, -123, 942, 936, -123, - /* 270 */ -123, 636, -123, -123, 748, -123, 971, -123, -123, 852, - /* 280 */ 890, 351, 874, 929, -123, 633, 943, 948, -123, 853, - /* 290 */ 116, -123, -123, -123, 944, -123, -123, -123, -123, 890, - /* 300 */ -123, -123, -123, -123, -123, 890, 994, -123, 992, 987, - /* 310 */ 988, 973, -123, 999, -123, -123, 989, -123, -123, -123, - /* 320 */ -123, -123, -123, 990, -123, 991, -123, 658, -123, -123, - /* 330 */ -123, 1004, -123, 1001, -123, -123, -123, -123, -123, -123, - /* 340 */ -123, -123, -123, -123, -123, -123, -123, -123, 1005, 1002, - /* 350 */ -123, -123, 1006, -123, -123, -123, -123, -123, 972, 1008, - /* 360 */ -123, 1009, -123, -123, -123, 660, -123, 1011, -123, -123, - /* 370 */ 705, -123, 1012, -123, 856, 530, -123, -123, -123, 739, - /* 380 */ -123, -123, 1018, 1010, 1015, 502, -123, -123, -123, -123, - /* 390 */ -123, -123, 747, 874, 577, -123, 1021, -123, 1022, -123, - /* 400 */ 842, 874, 1023, 951, 952, -123, 1028, 1016, 956, 962, - /* 410 */ -123, 867, 890, -123, -123, -123, -123, -123, -123, -123, - /* 420 */ 295, -123, 1037, -123, -123, -123, -123, -123, -123, -123, - /* 430 */ -123, 1041, -123, 1044, 1017, -123, 740, -123, 1047, -123, - /* 440 */ -123, -123, 648, 874, 1020, 1024, -123, -123, -123, -123, - /* 450 */ -123, -123, 707, -123, 1029, 1060, -123, 829, 1030, 1064, - /* 460 */ -123, 868, 890, -123, -123, 872, 890, -123, 1071, 1025, - /* 470 */ 432, -123, -123, 876, 874, -123, 571, -123, 880, 890, - /* 480 */ -123, 890, -123, 1087, 1039, -123, -123, 1088, -123, 1089, - /* 490 */ -123, 1090, 1033, -123, 1093, 1035, -123, 874, -123, 1094, - /* 500 */ 1040, 1055, -123, 1063, 1096, 1051, -123, 888, 1062, -123, - /* 510 */ -123, 1102, 1054, 1046, 886, 874, -123, 734, -123, -123, - /* 520 */ 1097, 1107, 1065, -123, 1109, -123, -123, -123, -123, 1113, - /* 530 */ -123, 1103, -123, 47, -123, -123, -123, -123, 1052, -123, - /* 540 */ -123, -123, 1057, -123, -123, 1128, -123, -123, 1056, 1119, - /* 550 */ -123, 1129, 1061, -123, 1124, -123, -123, 1059, 1141, -123, - /* 560 */ -123, -123, -123, -}; -static YYACTIONTYPE yy_default[] = { - /* 0 */ 570, 570, 564, 856, 856, 566, 856, 572, 856, 856, - /* 10 */ 856, 856, 652, 655, 656, 657, 658, 659, 573, 574, - /* 20 */ 591, 592, 593, 856, 856, 856, 856, 856, 856, 856, - /* 30 */ 856, 856, 856, 856, 856, 856, 584, 594, 604, 586, - /* 40 */ 603, 856, 856, 605, 651, 616, 856, 651, 617, 636, - /* 50 */ 634, 856, 637, 638, 856, 708, 651, 618, 706, 707, - /* 60 */ 651, 619, 856, 856, 737, 797, 743, 738, 856, 664, - /* 70 */ 856, 856, 665, 673, 675, 682, 720, 711, 713, 701, - /* 80 */ 715, 670, 856, 600, 856, 601, 856, 602, 716, 856, - /* 90 */ 717, 856, 718, 856, 856, 702, 856, 709, 708, 703, - /* 100 */ 856, 588, 710, 705, 856, 736, 856, 856, 739, 856, - /* 110 */ 740, 741, 742, 744, 747, 856, 748, 856, 749, 856, - /* 120 */ 750, 856, 751, 856, 752, 856, 753, 856, 754, 856, - /* 130 */ 755, 856, 756, 856, 757, 856, 758, 856, 759, 856, - /* 140 */ 856, 760, 761, 762, 856, 763, 856, 764, 856, 765, - /* 150 */ 856, 766, 856, 767, 856, 768, 769, 856, 770, 856, - /* 160 */ 773, 771, 856, 856, 856, 779, 856, 797, 856, 856, - /* 170 */ 856, 856, 856, 782, 796, 856, 774, 856, 775, 856, - /* 180 */ 776, 856, 777, 856, 856, 856, 856, 856, 787, 856, - /* 190 */ 856, 856, 788, 856, 856, 856, 845, 856, 856, 856, - /* 200 */ 846, 856, 856, 856, 847, 856, 856, 856, 848, 856, - /* 210 */ 856, 856, 856, 856, 789, 856, 781, 797, 794, 795, - /* 220 */ 690, 856, 691, 785, 772, 856, 856, 856, 780, 856, - /* 230 */ 797, 856, 784, 856, 783, 690, 786, 709, 708, 704, - /* 240 */ 856, 714, 856, 797, 712, 856, 721, 674, 685, 683, - /* 250 */ 684, 692, 693, 856, 694, 856, 695, 856, 696, 856, - /* 260 */ 690, 681, 589, 590, 856, 679, 680, 698, 700, 686, - /* 270 */ 856, 856, 856, 699, 856, 803, 708, 805, 804, 856, - /* 280 */ 697, 685, 856, 856, 856, 681, 698, 700, 687, 856, - /* 290 */ 681, 676, 677, 856, 856, 678, 671, 672, 778, 856, - /* 300 */ 735, 856, 745, 856, 746, 856, 651, 620, 856, 801, - /* 310 */ 624, 621, 625, 856, 626, 856, 856, 627, 856, 630, - /* 320 */ 631, 632, 633, 856, 628, 856, 629, 856, 856, 802, - /* 330 */ 622, 856, 623, 636, 635, 606, 856, 607, 608, 609, - /* 340 */ 856, 610, 613, 856, 611, 614, 612, 615, 595, 856, - /* 350 */ 856, 596, 856, 856, 597, 599, 598, 587, 856, 856, - /* 360 */ 641, 856, 644, 856, 856, 856, 856, 651, 645, 856, - /* 370 */ 856, 856, 651, 646, 856, 651, 647, 856, 856, 856, - /* 380 */ 856, 856, 856, 801, 624, 649, 856, 648, 650, 642, - /* 390 */ 643, 585, 856, 856, 581, 856, 856, 579, 856, 856, - /* 400 */ 856, 856, 856, 828, 856, 856, 856, 690, 833, 856, - /* 410 */ 856, 856, 856, 856, 856, 834, 835, 856, 856, 856, - /* 420 */ 856, 856, 856, 733, 734, 825, 826, 856, 827, 580, - /* 430 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, - /* 440 */ 856, 856, 856, 856, 856, 856, 654, 856, 856, 856, - /* 450 */ 856, 856, 856, 856, 653, 856, 856, 856, 856, 856, - /* 460 */ 856, 856, 723, 856, 856, 856, 724, 856, 856, 731, - /* 470 */ 856, 856, 732, 856, 856, 856, 856, 856, 856, 729, - /* 480 */ 856, 730, 856, 856, 856, 856, 856, 856, 856, 856, - /* 490 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, - /* 500 */ 690, 856, 856, 653, 856, 856, 856, 856, 856, 856, - /* 510 */ 856, 856, 690, 731, 856, 856, 856, 856, 856, 856, - /* 520 */ 653, 856, 856, 856, 856, 856, 856, 856, 856, 856, - /* 530 */ 856, 856, 856, 822, 856, 856, 856, 856, 856, 856, - /* 540 */ 856, 856, 856, 856, 821, 856, 856, 856, 854, 856, - /* 550 */ 856, 856, 856, 856, 856, 856, 853, 854, 856, 856, - /* 560 */ 567, 569, 565, -}; -#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0])) - -/* The next table maps tokens into fallback tokens. If a construct -** like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammer, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { - 0, /* $ => nothing */ - 0, /* END_OF_FILE => nothing */ - 0, /* ILLEGAL => nothing */ - 0, /* SPACE => nothing */ - 0, /* UNCLOSED_STRING => nothing */ - 0, /* COMMENT => nothing */ - 0, /* FUNCTION => nothing */ - 0, /* COLUMN => nothing */ - 0, /* AGG_FUNCTION => nothing */ - 0, /* SEMI => nothing */ - 23, /* EXPLAIN => ID */ - 23, /* BEGIN => ID */ - 0, /* TRANSACTION => nothing */ - 0, /* COMMIT => nothing */ - 23, /* END => ID */ - 0, /* ROLLBACK => nothing */ - 0, /* CREATE => nothing */ - 0, /* TABLE => nothing */ - 23, /* TEMP => ID */ - 0, /* LP => nothing */ - 0, /* RP => nothing */ - 0, /* AS => nothing */ - 0, /* COMMA => nothing */ - 0, /* ID => nothing */ - 23, /* ABORT => ID */ - 23, /* AFTER => ID */ - 23, /* ASC => ID */ - 23, /* ATTACH => ID */ - 23, /* BEFORE => ID */ - 23, /* CASCADE => ID */ - 23, /* CLUSTER => ID */ - 23, /* CONFLICT => ID */ - 23, /* COPY => ID */ - 23, /* DATABASE => ID */ - 23, /* DEFERRED => ID */ - 23, /* DELIMITERS => ID */ - 23, /* DESC => ID */ - 23, /* DETACH => ID */ - 23, /* EACH => ID */ - 23, /* FAIL => ID */ - 23, /* FOR => ID */ - 23, /* GLOB => ID */ - 23, /* IGNORE => ID */ - 23, /* IMMEDIATE => ID */ - 23, /* INITIALLY => ID */ - 23, /* INSTEAD => ID */ - 23, /* LIKE => ID */ - 23, /* MATCH => ID */ - 23, /* KEY => ID */ - 23, /* OF => ID */ - 23, /* OFFSET => ID */ - 23, /* PRAGMA => ID */ - 23, /* RAISE => ID */ - 23, /* REPLACE => ID */ - 23, /* RESTRICT => ID */ - 23, /* ROW => ID */ - 23, /* STATEMENT => ID */ - 23, /* TRIGGER => ID */ - 23, /* VACUUM => ID */ - 23, /* VIEW => ID */ - 0, /* OR => nothing */ - 0, /* AND => nothing */ - 0, /* NOT => nothing */ - 0, /* EQ => nothing */ - 0, /* NE => nothing */ - 0, /* ISNULL => nothing */ - 0, /* NOTNULL => nothing */ - 0, /* IS => nothing */ - 0, /* BETWEEN => nothing */ - 0, /* IN => nothing */ - 0, /* GT => nothing */ - 0, /* GE => nothing */ - 0, /* LT => nothing */ - 0, /* LE => nothing */ - 0, /* BITAND => nothing */ - 0, /* BITOR => nothing */ - 0, /* LSHIFT => nothing */ - 0, /* RSHIFT => nothing */ - 0, /* PLUS => nothing */ - 0, /* MINUS => nothing */ - 0, /* STAR => nothing */ - 0, /* SLASH => nothing */ - 0, /* REM => nothing */ - 0, /* CONCAT => nothing */ - 0, /* UMINUS => nothing */ - 0, /* UPLUS => nothing */ - 0, /* BITNOT => nothing */ - 0, /* STRING => nothing */ - 0, /* JOIN_KW => nothing */ - 0, /* INTEGER => nothing */ - 0, /* CONSTRAINT => nothing */ - 0, /* DEFAULT => nothing */ - 0, /* FLOAT => nothing */ - 0, /* NULL => nothing */ - 0, /* PRIMARY => nothing */ - 0, /* UNIQUE => nothing */ - 0, /* CHECK => nothing */ - 0, /* REFERENCES => nothing */ - 0, /* COLLATE => nothing */ - 0, /* ON => nothing */ - 0, /* DELETE => nothing */ - 0, /* UPDATE => nothing */ - 0, /* INSERT => nothing */ - 0, /* SET => nothing */ - 0, /* DEFERRABLE => nothing */ - 0, /* FOREIGN => nothing */ - 0, /* DROP => nothing */ - 0, /* UNION => nothing */ - 0, /* ALL => nothing */ - 0, /* INTERSECT => nothing */ - 0, /* EXCEPT => nothing */ - 0, /* SELECT => nothing */ - 0, /* DISTINCT => nothing */ - 0, /* DOT => nothing */ - 0, /* FROM => nothing */ - 0, /* JOIN => nothing */ - 0, /* USING => nothing */ - 0, /* ORDER => nothing */ - 0, /* BY => nothing */ - 0, /* GROUP => nothing */ - 0, /* HAVING => nothing */ - 0, /* LIMIT => nothing */ - 0, /* WHERE => nothing */ - 0, /* INTO => nothing */ - 0, /* VALUES => nothing */ - 0, /* VARIABLE => nothing */ - 0, /* CASE => nothing */ - 0, /* WHEN => nothing */ - 0, /* THEN => nothing */ - 0, /* ELSE => nothing */ - 0, /* INDEX => nothing */ -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -*/ -struct yyStackEntry { - int stateno; /* The state-number */ - int major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - int yyidx; /* Index of top element in stack */ - int yyerrcnt; /* Shifts left before out of the error */ - sqliteParserARG_SDECL /* A place to hold %extra_argument */ - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -**
                -**
              • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
              • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
              -** -** Outputs: -** None. -*/ -void sqliteParserTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *yyTokenName[] = { - "$", "END_OF_FILE", "ILLEGAL", "SPACE", - "UNCLOSED_STRING", "COMMENT", "FUNCTION", "COLUMN", - "AGG_FUNCTION", "SEMI", "EXPLAIN", "BEGIN", - "TRANSACTION", "COMMIT", "END", "ROLLBACK", - "CREATE", "TABLE", "TEMP", "LP", - "RP", "AS", "COMMA", "ID", - "ABORT", "AFTER", "ASC", "ATTACH", - "BEFORE", "CASCADE", "CLUSTER", "CONFLICT", - "COPY", "DATABASE", "DEFERRED", "DELIMITERS", - "DESC", "DETACH", "EACH", "FAIL", - "FOR", "GLOB", "IGNORE", "IMMEDIATE", - "INITIALLY", "INSTEAD", "LIKE", "MATCH", - "KEY", "OF", "OFFSET", "PRAGMA", - "RAISE", "REPLACE", "RESTRICT", "ROW", - "STATEMENT", "TRIGGER", "VACUUM", "VIEW", - "OR", "AND", "NOT", "EQ", - "NE", "ISNULL", "NOTNULL", "IS", - "BETWEEN", "IN", "GT", "GE", - "LT", "LE", "BITAND", "BITOR", - "LSHIFT", "RSHIFT", "PLUS", "MINUS", - "STAR", "SLASH", "REM", "CONCAT", - "UMINUS", "UPLUS", "BITNOT", "STRING", - "JOIN_KW", "INTEGER", "CONSTRAINT", "DEFAULT", - "FLOAT", "NULL", "PRIMARY", "UNIQUE", - "CHECK", "REFERENCES", "COLLATE", "ON", - "DELETE", "UPDATE", "INSERT", "SET", - "DEFERRABLE", "FOREIGN", "DROP", "UNION", - "ALL", "INTERSECT", "EXCEPT", "SELECT", - "DISTINCT", "DOT", "FROM", "JOIN", - "USING", "ORDER", "BY", "GROUP", - "HAVING", "LIMIT", "WHERE", "INTO", - "VALUES", "VARIABLE", "CASE", "WHEN", - "THEN", "ELSE", "INDEX", "error", - "input", "cmdlist", "ecmd", "explain", - "cmdx", "cmd", "trans_opt", "onconf", - "nm", "create_table", "create_table_args", "temp", - "columnlist", "conslist_opt", "select", "column", - "columnid", "type", "carglist", "id", - "ids", "typename", "signed", "carg", - "ccons", "sortorder", "expr", "idxlist_opt", - "refargs", "defer_subclause", "refarg", "refact", - "init_deferred_pred_opt", "conslist", "tcons", "idxlist", - "defer_subclause_opt", "orconf", "resolvetype", "oneselect", - "multiselect_op", "distinct", "selcollist", "from", - "where_opt", "groupby_opt", "having_opt", "orderby_opt", - "limit_opt", "sclp", "as", "seltablist", - "stl_prefix", "joinop", "dbnm", "on_opt", - "using_opt", "seltablist_paren", "joinop2", "sortlist", - "sortitem", "collate", "exprlist", "setlist", - "insert_cmd", "inscollist_opt", "itemlist", "inscollist", - "likeop", "case_operand", "case_exprlist", "case_else", - "expritem", "uniqueflag", "idxitem", "plus_num", - "minus_num", "plus_opt", "number", "trigger_decl", - "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", - "when_clause", "trigger_cmd", "database_kw_opt", "key_opt", -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *yyRuleName[] = { - /* 0 */ "input ::= cmdlist", - /* 1 */ "cmdlist ::= cmdlist ecmd", - /* 2 */ "cmdlist ::= ecmd", - /* 3 */ "ecmd ::= explain cmdx SEMI", - /* 4 */ "ecmd ::= SEMI", - /* 5 */ "cmdx ::= cmd", - /* 6 */ "explain ::= EXPLAIN", - /* 7 */ "explain ::=", - /* 8 */ "cmd ::= BEGIN trans_opt onconf", - /* 9 */ "trans_opt ::=", - /* 10 */ "trans_opt ::= TRANSACTION", - /* 11 */ "trans_opt ::= TRANSACTION nm", - /* 12 */ "cmd ::= COMMIT trans_opt", - /* 13 */ "cmd ::= END trans_opt", - /* 14 */ "cmd ::= ROLLBACK trans_opt", - /* 15 */ "cmd ::= create_table create_table_args", - /* 16 */ "create_table ::= CREATE temp TABLE nm", - /* 17 */ "temp ::= TEMP", - /* 18 */ "temp ::=", - /* 19 */ "create_table_args ::= LP columnlist conslist_opt RP", - /* 20 */ "create_table_args ::= AS select", - /* 21 */ "columnlist ::= columnlist COMMA column", - /* 22 */ "columnlist ::= column", - /* 23 */ "column ::= columnid type carglist", - /* 24 */ "columnid ::= nm", - /* 25 */ "id ::= ID", - /* 26 */ "ids ::= ID", - /* 27 */ "ids ::= STRING", - /* 28 */ "nm ::= ID", - /* 29 */ "nm ::= STRING", - /* 30 */ "nm ::= JOIN_KW", - /* 31 */ "type ::=", - /* 32 */ "type ::= typename", - /* 33 */ "type ::= typename LP signed RP", - /* 34 */ "type ::= typename LP signed COMMA signed RP", - /* 35 */ "typename ::= ids", - /* 36 */ "typename ::= typename ids", - /* 37 */ "signed ::= INTEGER", - /* 38 */ "signed ::= PLUS INTEGER", - /* 39 */ "signed ::= MINUS INTEGER", - /* 40 */ "carglist ::= carglist carg", - /* 41 */ "carglist ::=", - /* 42 */ "carg ::= CONSTRAINT nm ccons", - /* 43 */ "carg ::= ccons", - /* 44 */ "carg ::= DEFAULT STRING", - /* 45 */ "carg ::= DEFAULT ID", - /* 46 */ "carg ::= DEFAULT INTEGER", - /* 47 */ "carg ::= DEFAULT PLUS INTEGER", - /* 48 */ "carg ::= DEFAULT MINUS INTEGER", - /* 49 */ "carg ::= DEFAULT FLOAT", - /* 50 */ "carg ::= DEFAULT PLUS FLOAT", - /* 51 */ "carg ::= DEFAULT MINUS FLOAT", - /* 52 */ "carg ::= DEFAULT NULL", - /* 53 */ "ccons ::= NULL onconf", - /* 54 */ "ccons ::= NOT NULL onconf", - /* 55 */ "ccons ::= PRIMARY KEY sortorder onconf", - /* 56 */ "ccons ::= UNIQUE onconf", - /* 57 */ "ccons ::= CHECK LP expr RP onconf", - /* 58 */ "ccons ::= REFERENCES nm idxlist_opt refargs", - /* 59 */ "ccons ::= defer_subclause", - /* 60 */ "ccons ::= COLLATE id", - /* 61 */ "refargs ::=", - /* 62 */ "refargs ::= refargs refarg", - /* 63 */ "refarg ::= MATCH nm", - /* 64 */ "refarg ::= ON DELETE refact", - /* 65 */ "refarg ::= ON UPDATE refact", - /* 66 */ "refarg ::= ON INSERT refact", - /* 67 */ "refact ::= SET NULL", - /* 68 */ "refact ::= SET DEFAULT", - /* 69 */ "refact ::= CASCADE", - /* 70 */ "refact ::= RESTRICT", - /* 71 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", - /* 72 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", - /* 73 */ "init_deferred_pred_opt ::=", - /* 74 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", - /* 75 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", - /* 76 */ "conslist_opt ::=", - /* 77 */ "conslist_opt ::= COMMA conslist", - /* 78 */ "conslist ::= conslist COMMA tcons", - /* 79 */ "conslist ::= conslist tcons", - /* 80 */ "conslist ::= tcons", - /* 81 */ "tcons ::= CONSTRAINT nm", - /* 82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf", - /* 83 */ "tcons ::= UNIQUE LP idxlist RP onconf", - /* 84 */ "tcons ::= CHECK expr onconf", - /* 85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", - /* 86 */ "defer_subclause_opt ::=", - /* 87 */ "defer_subclause_opt ::= defer_subclause", - /* 88 */ "onconf ::=", - /* 89 */ "onconf ::= ON CONFLICT resolvetype", - /* 90 */ "orconf ::=", - /* 91 */ "orconf ::= OR resolvetype", - /* 92 */ "resolvetype ::= ROLLBACK", - /* 93 */ "resolvetype ::= ABORT", - /* 94 */ "resolvetype ::= FAIL", - /* 95 */ "resolvetype ::= IGNORE", - /* 96 */ "resolvetype ::= REPLACE", - /* 97 */ "cmd ::= DROP TABLE nm", - /* 98 */ "cmd ::= CREATE temp VIEW nm AS select", - /* 99 */ "cmd ::= DROP VIEW nm", - /* 100 */ "cmd ::= select", - /* 101 */ "select ::= oneselect", - /* 102 */ "select ::= select multiselect_op oneselect", - /* 103 */ "multiselect_op ::= UNION", - /* 104 */ "multiselect_op ::= UNION ALL", - /* 105 */ "multiselect_op ::= INTERSECT", - /* 106 */ "multiselect_op ::= EXCEPT", - /* 107 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", - /* 108 */ "distinct ::= DISTINCT", - /* 109 */ "distinct ::= ALL", - /* 110 */ "distinct ::=", - /* 111 */ "sclp ::= selcollist COMMA", - /* 112 */ "sclp ::=", - /* 113 */ "selcollist ::= sclp expr as", - /* 114 */ "selcollist ::= sclp STAR", - /* 115 */ "selcollist ::= sclp nm DOT STAR", - /* 116 */ "as ::= AS nm", - /* 117 */ "as ::= ids", - /* 118 */ "as ::=", - /* 119 */ "from ::=", - /* 120 */ "from ::= FROM seltablist", - /* 121 */ "stl_prefix ::= seltablist joinop", - /* 122 */ "stl_prefix ::=", - /* 123 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt", - /* 124 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt", - /* 125 */ "seltablist_paren ::= select", - /* 126 */ "seltablist_paren ::= seltablist", - /* 127 */ "dbnm ::=", - /* 128 */ "dbnm ::= DOT nm", - /* 129 */ "joinop ::= COMMA", - /* 130 */ "joinop ::= JOIN", - /* 131 */ "joinop ::= JOIN_KW JOIN", - /* 132 */ "joinop ::= JOIN_KW nm JOIN", - /* 133 */ "joinop ::= JOIN_KW nm nm JOIN", - /* 134 */ "on_opt ::= ON expr", - /* 135 */ "on_opt ::=", - /* 136 */ "using_opt ::= USING LP idxlist RP", - /* 137 */ "using_opt ::=", - /* 138 */ "orderby_opt ::=", - /* 139 */ "orderby_opt ::= ORDER BY sortlist", - /* 140 */ "sortlist ::= sortlist COMMA sortitem collate sortorder", - /* 141 */ "sortlist ::= sortitem collate sortorder", - /* 142 */ "sortitem ::= expr", - /* 143 */ "sortorder ::= ASC", - /* 144 */ "sortorder ::= DESC", - /* 145 */ "sortorder ::=", - /* 146 */ "collate ::=", - /* 147 */ "collate ::= COLLATE id", - /* 148 */ "groupby_opt ::=", - /* 149 */ "groupby_opt ::= GROUP BY exprlist", - /* 150 */ "having_opt ::=", - /* 151 */ "having_opt ::= HAVING expr", - /* 152 */ "limit_opt ::=", - /* 153 */ "limit_opt ::= LIMIT signed", - /* 154 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 155 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 156 */ "cmd ::= DELETE FROM nm dbnm where_opt", - /* 157 */ "where_opt ::=", - /* 158 */ "where_opt ::= WHERE expr", - /* 159 */ "cmd ::= UPDATE orconf nm dbnm SET setlist where_opt", - /* 160 */ "setlist ::= setlist COMMA nm EQ expr", - /* 161 */ "setlist ::= nm EQ expr", - /* 162 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt VALUES LP itemlist RP", - /* 163 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt select", - /* 164 */ "insert_cmd ::= INSERT orconf", - /* 165 */ "insert_cmd ::= REPLACE", - /* 166 */ "itemlist ::= itemlist COMMA expr", - /* 167 */ "itemlist ::= expr", - /* 168 */ "inscollist_opt ::=", - /* 169 */ "inscollist_opt ::= LP inscollist RP", - /* 170 */ "inscollist ::= inscollist COMMA nm", - /* 171 */ "inscollist ::= nm", - /* 172 */ "expr ::= LP expr RP", - /* 173 */ "expr ::= NULL", - /* 174 */ "expr ::= ID", - /* 175 */ "expr ::= JOIN_KW", - /* 176 */ "expr ::= nm DOT nm", - /* 177 */ "expr ::= nm DOT nm DOT nm", - /* 178 */ "expr ::= INTEGER", - /* 179 */ "expr ::= FLOAT", - /* 180 */ "expr ::= STRING", - /* 181 */ "expr ::= VARIABLE", - /* 182 */ "expr ::= ID LP exprlist RP", - /* 183 */ "expr ::= ID LP STAR RP", - /* 184 */ "expr ::= expr AND expr", - /* 185 */ "expr ::= expr OR expr", - /* 186 */ "expr ::= expr LT expr", - /* 187 */ "expr ::= expr GT expr", - /* 188 */ "expr ::= expr LE expr", - /* 189 */ "expr ::= expr GE expr", - /* 190 */ "expr ::= expr NE expr", - /* 191 */ "expr ::= expr EQ expr", - /* 192 */ "expr ::= expr BITAND expr", - /* 193 */ "expr ::= expr BITOR expr", - /* 194 */ "expr ::= expr LSHIFT expr", - /* 195 */ "expr ::= expr RSHIFT expr", - /* 196 */ "expr ::= expr likeop expr", - /* 197 */ "expr ::= expr NOT likeop expr", - /* 198 */ "likeop ::= LIKE", - /* 199 */ "likeop ::= GLOB", - /* 200 */ "expr ::= expr PLUS expr", - /* 201 */ "expr ::= expr MINUS expr", - /* 202 */ "expr ::= expr STAR expr", - /* 203 */ "expr ::= expr SLASH expr", - /* 204 */ "expr ::= expr REM expr", - /* 205 */ "expr ::= expr CONCAT expr", - /* 206 */ "expr ::= expr ISNULL", - /* 207 */ "expr ::= expr IS NULL", - /* 208 */ "expr ::= expr NOTNULL", - /* 209 */ "expr ::= expr NOT NULL", - /* 210 */ "expr ::= expr IS NOT NULL", - /* 211 */ "expr ::= NOT expr", - /* 212 */ "expr ::= BITNOT expr", - /* 213 */ "expr ::= MINUS expr", - /* 214 */ "expr ::= PLUS expr", - /* 215 */ "expr ::= LP select RP", - /* 216 */ "expr ::= expr BETWEEN expr AND expr", - /* 217 */ "expr ::= expr NOT BETWEEN expr AND expr", - /* 218 */ "expr ::= expr IN LP exprlist RP", - /* 219 */ "expr ::= expr IN LP select RP", - /* 220 */ "expr ::= expr NOT IN LP exprlist RP", - /* 221 */ "expr ::= expr NOT IN LP select RP", - /* 222 */ "expr ::= expr IN nm dbnm", - /* 223 */ "expr ::= expr NOT IN nm dbnm", - /* 224 */ "expr ::= CASE case_operand case_exprlist case_else END", - /* 225 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", - /* 226 */ "case_exprlist ::= WHEN expr THEN expr", - /* 227 */ "case_else ::= ELSE expr", - /* 228 */ "case_else ::=", - /* 229 */ "case_operand ::= expr", - /* 230 */ "case_operand ::=", - /* 231 */ "exprlist ::= exprlist COMMA expritem", - /* 232 */ "exprlist ::= expritem", - /* 233 */ "expritem ::= expr", - /* 234 */ "expritem ::=", - /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", - /* 236 */ "uniqueflag ::= UNIQUE", - /* 237 */ "uniqueflag ::=", - /* 238 */ "idxlist_opt ::=", - /* 239 */ "idxlist_opt ::= LP idxlist RP", - /* 240 */ "idxlist ::= idxlist COMMA idxitem", - /* 241 */ "idxlist ::= idxitem", - /* 242 */ "idxitem ::= nm sortorder", - /* 243 */ "cmd ::= DROP INDEX nm dbnm", - /* 244 */ "cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING", - /* 245 */ "cmd ::= COPY orconf nm dbnm FROM nm", - /* 246 */ "cmd ::= VACUUM", - /* 247 */ "cmd ::= VACUUM nm", - /* 248 */ "cmd ::= PRAGMA ids EQ nm", - /* 249 */ "cmd ::= PRAGMA ids EQ ON", - /* 250 */ "cmd ::= PRAGMA ids EQ plus_num", - /* 251 */ "cmd ::= PRAGMA ids EQ minus_num", - /* 252 */ "cmd ::= PRAGMA ids LP nm RP", - /* 253 */ "cmd ::= PRAGMA ids", - /* 254 */ "plus_num ::= plus_opt number", - /* 255 */ "minus_num ::= MINUS number", - /* 256 */ "number ::= INTEGER", - /* 257 */ "number ::= FLOAT", - /* 258 */ "plus_opt ::= PLUS", - /* 259 */ "plus_opt ::=", - /* 260 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", - /* 261 */ "trigger_decl ::= temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause", - /* 262 */ "trigger_time ::= BEFORE", - /* 263 */ "trigger_time ::= AFTER", - /* 264 */ "trigger_time ::= INSTEAD OF", - /* 265 */ "trigger_time ::=", - /* 266 */ "trigger_event ::= DELETE", - /* 267 */ "trigger_event ::= INSERT", - /* 268 */ "trigger_event ::= UPDATE", - /* 269 */ "trigger_event ::= UPDATE OF inscollist", - /* 270 */ "foreach_clause ::=", - /* 271 */ "foreach_clause ::= FOR EACH ROW", - /* 272 */ "foreach_clause ::= FOR EACH STATEMENT", - /* 273 */ "when_clause ::=", - /* 274 */ "when_clause ::= WHEN expr", - /* 275 */ "trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list", - /* 276 */ "trigger_cmd_list ::=", - /* 277 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", - /* 278 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", - /* 279 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", - /* 280 */ "trigger_cmd ::= DELETE FROM nm where_opt", - /* 281 */ "trigger_cmd ::= select", - /* 282 */ "expr ::= RAISE LP IGNORE RP", - /* 283 */ "expr ::= RAISE LP ROLLBACK COMMA nm RP", - /* 284 */ "expr ::= RAISE LP ABORT COMMA nm RP", - /* 285 */ "expr ::= RAISE LP FAIL COMMA nm RP", - /* 286 */ "cmd ::= DROP TRIGGER nm dbnm", - /* 287 */ "cmd ::= ATTACH database_kw_opt ids AS nm key_opt", - /* 288 */ "key_opt ::= USING ids", - /* 289 */ "key_opt ::=", - /* 290 */ "database_kw_opt ::= DATABASE", - /* 291 */ "database_kw_opt ::=", - /* 292 */ "cmd ::= DETACH database_kw_opt nm", -}; -#endif /* NDEBUG */ - -/* -** This function returns the symbolic name associated with a token -** value. -*/ -const char *sqliteParserTokenName(int tokenType){ -#ifndef NDEBUG - if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ - return yyTokenName[tokenType]; - }else{ - return "Unknown"; - } -#else - return ""; -#endif -} - -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to sqliteParser and sqliteParserFree. -*/ -void *sqliteParserAlloc(void *(*mallocProc)(size_t)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); - if( pParser ){ - pParser->yyidx = -1; - } - return pParser; -} - -/* The following function deletes the value associated with a -** symbol. The symbol can be either a terminal or nonterminal. -** "yymajor" is the symbol code, and "yypminor" is a pointer to -** the value. -*/ -static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are not used - ** inside the C code. - */ - case 146: -#line 286 "parse.y" -{sqliteSelectDelete((yypminor->yy179));} -#line 1235 "parse.c" - break; - case 158: -#line 533 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1240 "parse.c" - break; - case 159: -#line 746 "parse.y" -{sqliteIdListDelete((yypminor->yy320));} -#line 1245 "parse.c" - break; - case 167: -#line 744 "parse.y" -{sqliteIdListDelete((yypminor->yy320));} -#line 1250 "parse.c" - break; - case 171: -#line 288 "parse.y" -{sqliteSelectDelete((yypminor->yy179));} -#line 1255 "parse.c" - break; - case 174: -#line 322 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1260 "parse.c" - break; - case 175: -#line 353 "parse.y" -{sqliteSrcListDelete((yypminor->yy307));} -#line 1265 "parse.c" - break; - case 176: -#line 483 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1270 "parse.c" - break; - case 177: -#line 459 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1275 "parse.c" - break; - case 178: -#line 464 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1280 "parse.c" - break; - case 179: -#line 431 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1285 "parse.c" - break; - case 181: -#line 324 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1290 "parse.c" - break; - case 183: -#line 349 "parse.y" -{sqliteSrcListDelete((yypminor->yy307));} -#line 1295 "parse.c" - break; - case 184: -#line 351 "parse.y" -{sqliteSrcListDelete((yypminor->yy307));} -#line 1300 "parse.c" - break; - case 187: -#line 420 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1305 "parse.c" - break; - case 188: -#line 425 "parse.y" -{sqliteIdListDelete((yypminor->yy320));} -#line 1310 "parse.c" - break; - case 189: -#line 400 "parse.y" -{sqliteSelectDelete((yypminor->yy179));} -#line 1315 "parse.c" - break; - case 191: -#line 433 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1320 "parse.c" - break; - case 192: -#line 435 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1325 "parse.c" - break; - case 194: -#line 719 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1330 "parse.c" - break; - case 195: -#line 489 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1335 "parse.c" - break; - case 197: -#line 520 "parse.y" -{sqliteIdListDelete((yypminor->yy320));} -#line 1340 "parse.c" - break; - case 198: -#line 514 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1345 "parse.c" - break; - case 199: -#line 522 "parse.y" -{sqliteIdListDelete((yypminor->yy320));} -#line 1350 "parse.c" - break; - case 202: -#line 702 "parse.y" -{sqliteExprListDelete((yypminor->yy322));} -#line 1355 "parse.c" - break; - case 204: -#line 721 "parse.y" -{sqliteExprDelete((yypminor->yy242));} -#line 1360 "parse.c" - break; - case 212: -#line 828 "parse.y" -{sqliteDeleteTriggerStep((yypminor->yy19));} -#line 1365 "parse.c" - break; - case 214: -#line 812 "parse.y" -{sqliteIdListDelete((yypminor->yy290).b);} -#line 1370 "parse.c" - break; - case 217: -#line 836 "parse.y" -{sqliteDeleteTriggerStep((yypminor->yy19));} -#line 1375 "parse.c" - break; - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -** -** Return the major token number for the symbol popped. -*/ -static int yy_pop_parser_stack(yyParser *pParser){ - YYCODETYPE yymajor; - yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; - - if( pParser->yyidx<0 ) return 0; -#ifndef NDEBUG - if( yyTraceFILE && pParser->yyidx>=0 ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yymajor = yytos->major; - yy_destructor( yymajor, &yytos->minor); - pParser->yyidx--; - return yymajor; -} - -/* -** Deallocate and destroy a parser. Destructors are all called for -** all stack elements before shutting the parser down. -** -** Inputs: -**
                -**
              • A pointer to the parser. This should be a pointer -** obtained from sqliteParserAlloc. -**
              • A pointer to a function used to reclaim memory obtained -** from malloc. -**
              -*/ -void sqliteParserFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ - yyParser *pParser = (yyParser*)p; - if( pParser==0 ) return; - while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); - (*freeProc)((void*)pParser); -} - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_shift_action( - yyParser *pParser, /* The parser */ - int iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yystack[pParser->yyidx].stateno; - - /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */ - i = yy_shift_ofst[stateno]; - if( i==YY_SHIFT_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - int iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - return yy_find_shift_action(pParser, iFallback); - } -#endif - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -** -** If the look-ahead token is YYNOCODE, then check to see if the action is -** independent of the look-ahead. If it is, return the action, otherwise -** return YY_NO_ACTION. -*/ -static int yy_find_reduce_action( - yyParser *pParser, /* The parser */ - int iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yystack[pParser->yyidx].stateno; - - i = yy_reduce_ofst[stateno]; - if( i==YY_REDUCE_USE_DFLT ){ - return yy_default[stateno]; - } - if( iLookAhead==YYNOCODE ){ - return YY_NO_ACTION; - } - i += iLookAhead; - if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } -} - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yyidx++; - if( yypParser->yyidx>=YYSTACKDEPTH ){ - sqliteParserARG_FETCH; - yypParser->yyidx--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ - sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument var */ - return; - } - yytos = &yypParser->yystack[yypParser->yyidx]; - yytos->stateno = yyNewState; - yytos->major = yyMajor; - yytos->minor = *yypMinor; -#ifndef NDEBUG - if( yyTraceFILE && yypParser->yyidx>0 ){ - int i; - fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); - fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); - for(i=1; i<=yypParser->yyidx; i++) - fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); - fprintf(yyTraceFILE,"\n"); - } -#endif -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - unsigned char nrhs; /* Number of right-hand side symbols in the rule */ -} yyRuleInfo[] = { - { 132, 1 }, - { 133, 2 }, - { 133, 1 }, - { 134, 3 }, - { 134, 1 }, - { 136, 1 }, - { 135, 1 }, - { 135, 0 }, - { 137, 3 }, - { 138, 0 }, - { 138, 1 }, - { 138, 2 }, - { 137, 2 }, - { 137, 2 }, - { 137, 2 }, - { 137, 2 }, - { 141, 4 }, - { 143, 1 }, - { 143, 0 }, - { 142, 4 }, - { 142, 2 }, - { 144, 3 }, - { 144, 1 }, - { 147, 3 }, - { 148, 1 }, - { 151, 1 }, - { 152, 1 }, - { 152, 1 }, - { 140, 1 }, - { 140, 1 }, - { 140, 1 }, - { 149, 0 }, - { 149, 1 }, - { 149, 4 }, - { 149, 6 }, - { 153, 1 }, - { 153, 2 }, - { 154, 1 }, - { 154, 2 }, - { 154, 2 }, - { 150, 2 }, - { 150, 0 }, - { 155, 3 }, - { 155, 1 }, - { 155, 2 }, - { 155, 2 }, - { 155, 2 }, - { 155, 3 }, - { 155, 3 }, - { 155, 2 }, - { 155, 3 }, - { 155, 3 }, - { 155, 2 }, - { 156, 2 }, - { 156, 3 }, - { 156, 4 }, - { 156, 2 }, - { 156, 5 }, - { 156, 4 }, - { 156, 1 }, - { 156, 2 }, - { 160, 0 }, - { 160, 2 }, - { 162, 2 }, - { 162, 3 }, - { 162, 3 }, - { 162, 3 }, - { 163, 2 }, - { 163, 2 }, - { 163, 1 }, - { 163, 1 }, - { 161, 3 }, - { 161, 2 }, - { 164, 0 }, - { 164, 2 }, - { 164, 2 }, - { 145, 0 }, - { 145, 2 }, - { 165, 3 }, - { 165, 2 }, - { 165, 1 }, - { 166, 2 }, - { 166, 6 }, - { 166, 5 }, - { 166, 3 }, - { 166, 10 }, - { 168, 0 }, - { 168, 1 }, - { 139, 0 }, - { 139, 3 }, - { 169, 0 }, - { 169, 2 }, - { 170, 1 }, - { 170, 1 }, - { 170, 1 }, - { 170, 1 }, - { 170, 1 }, - { 137, 3 }, - { 137, 6 }, - { 137, 3 }, - { 137, 1 }, - { 146, 1 }, - { 146, 3 }, - { 172, 1 }, - { 172, 2 }, - { 172, 1 }, - { 172, 1 }, - { 171, 9 }, - { 173, 1 }, - { 173, 1 }, - { 173, 0 }, - { 181, 2 }, - { 181, 0 }, - { 174, 3 }, - { 174, 2 }, - { 174, 4 }, - { 182, 2 }, - { 182, 1 }, - { 182, 0 }, - { 175, 0 }, - { 175, 2 }, - { 184, 2 }, - { 184, 0 }, - { 183, 6 }, - { 183, 7 }, - { 189, 1 }, - { 189, 1 }, - { 186, 0 }, - { 186, 2 }, - { 185, 1 }, - { 185, 1 }, - { 185, 2 }, - { 185, 3 }, - { 185, 4 }, - { 187, 2 }, - { 187, 0 }, - { 188, 4 }, - { 188, 0 }, - { 179, 0 }, - { 179, 3 }, - { 191, 5 }, - { 191, 3 }, - { 192, 1 }, - { 157, 1 }, - { 157, 1 }, - { 157, 0 }, - { 193, 0 }, - { 193, 2 }, - { 177, 0 }, - { 177, 3 }, - { 178, 0 }, - { 178, 2 }, - { 180, 0 }, - { 180, 2 }, - { 180, 4 }, - { 180, 4 }, - { 137, 5 }, - { 176, 0 }, - { 176, 2 }, - { 137, 7 }, - { 195, 5 }, - { 195, 3 }, - { 137, 9 }, - { 137, 6 }, - { 196, 2 }, - { 196, 1 }, - { 198, 3 }, - { 198, 1 }, - { 197, 0 }, - { 197, 3 }, - { 199, 3 }, - { 199, 1 }, - { 158, 3 }, - { 158, 1 }, - { 158, 1 }, - { 158, 1 }, - { 158, 3 }, - { 158, 5 }, - { 158, 1 }, - { 158, 1 }, - { 158, 1 }, - { 158, 1 }, - { 158, 4 }, - { 158, 4 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 4 }, - { 200, 1 }, - { 200, 1 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 3 }, - { 158, 2 }, - { 158, 3 }, - { 158, 2 }, - { 158, 3 }, - { 158, 4 }, - { 158, 2 }, - { 158, 2 }, - { 158, 2 }, - { 158, 2 }, - { 158, 3 }, - { 158, 5 }, - { 158, 6 }, - { 158, 5 }, - { 158, 5 }, - { 158, 6 }, - { 158, 6 }, - { 158, 4 }, - { 158, 5 }, - { 158, 5 }, - { 202, 5 }, - { 202, 4 }, - { 203, 2 }, - { 203, 0 }, - { 201, 1 }, - { 201, 0 }, - { 194, 3 }, - { 194, 1 }, - { 204, 1 }, - { 204, 0 }, - { 137, 11 }, - { 205, 1 }, - { 205, 0 }, - { 159, 0 }, - { 159, 3 }, - { 167, 3 }, - { 167, 1 }, - { 206, 2 }, - { 137, 4 }, - { 137, 9 }, - { 137, 6 }, - { 137, 1 }, - { 137, 2 }, - { 137, 4 }, - { 137, 4 }, - { 137, 4 }, - { 137, 4 }, - { 137, 5 }, - { 137, 2 }, - { 207, 2 }, - { 208, 2 }, - { 210, 1 }, - { 210, 1 }, - { 209, 1 }, - { 209, 0 }, - { 137, 5 }, - { 211, 10 }, - { 213, 1 }, - { 213, 1 }, - { 213, 2 }, - { 213, 0 }, - { 214, 1 }, - { 214, 1 }, - { 214, 1 }, - { 214, 3 }, - { 215, 0 }, - { 215, 3 }, - { 215, 3 }, - { 216, 0 }, - { 216, 2 }, - { 212, 3 }, - { 212, 0 }, - { 217, 6 }, - { 217, 8 }, - { 217, 5 }, - { 217, 4 }, - { 217, 1 }, - { 158, 4 }, - { 158, 6 }, - { 158, 6 }, - { 158, 6 }, - { 137, 4 }, - { 137, 6 }, - { 219, 2 }, - { 219, 0 }, - { 218, 1 }, - { 218, 0 }, - { 137, 3 }, -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - int yyruleno /* Number of the rule by which to reduce */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - sqliteParserARG_FETCH; - yymsp = &yypParser->yystack[yypParser->yyidx]; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno>=0 - && yyruleno - ** { ... } // User supplied code - ** #line - ** break; - */ - case 0: - /* No destructor defined for cmdlist */ - break; - case 1: - /* No destructor defined for cmdlist */ - /* No destructor defined for ecmd */ - break; - case 2: - /* No destructor defined for ecmd */ - break; - case 3: - /* No destructor defined for explain */ - /* No destructor defined for cmdx */ - /* No destructor defined for SEMI */ - break; - case 4: - /* No destructor defined for SEMI */ - break; - case 5: -#line 72 "parse.y" -{ sqliteExec(pParse); } -#line 1901 "parse.c" - /* No destructor defined for cmd */ - break; - case 6: -#line 73 "parse.y" -{ sqliteBeginParse(pParse, 1); } -#line 1907 "parse.c" - /* No destructor defined for EXPLAIN */ - break; - case 7: -#line 74 "parse.y" -{ sqliteBeginParse(pParse, 0); } -#line 1913 "parse.c" - break; - case 8: -#line 79 "parse.y" -{sqliteBeginTransaction(pParse,yymsp[0].minor.yy372);} -#line 1918 "parse.c" - /* No destructor defined for BEGIN */ - /* No destructor defined for trans_opt */ - break; - case 9: - break; - case 10: - /* No destructor defined for TRANSACTION */ - break; - case 11: - /* No destructor defined for TRANSACTION */ - /* No destructor defined for nm */ - break; - case 12: -#line 83 "parse.y" -{sqliteCommitTransaction(pParse);} -#line 1934 "parse.c" - /* No destructor defined for COMMIT */ - /* No destructor defined for trans_opt */ - break; - case 13: -#line 84 "parse.y" -{sqliteCommitTransaction(pParse);} -#line 1941 "parse.c" - /* No destructor defined for END */ - /* No destructor defined for trans_opt */ - break; - case 14: -#line 85 "parse.y" -{sqliteRollbackTransaction(pParse);} -#line 1948 "parse.c" - /* No destructor defined for ROLLBACK */ - /* No destructor defined for trans_opt */ - break; - case 15: - /* No destructor defined for create_table */ - /* No destructor defined for create_table_args */ - break; - case 16: -#line 90 "parse.y" -{ - sqliteStartTable(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy298,yymsp[-2].minor.yy372,0); -} -#line 1961 "parse.c" - /* No destructor defined for TABLE */ - break; - case 17: -#line 94 "parse.y" -{yygotominor.yy372 = 1;} -#line 1967 "parse.c" - /* No destructor defined for TEMP */ - break; - case 18: -#line 95 "parse.y" -{yygotominor.yy372 = 0;} -#line 1973 "parse.c" - break; - case 19: -#line 96 "parse.y" -{ - sqliteEndTable(pParse,&yymsp[0].minor.yy0,0); -} -#line 1980 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for columnlist */ - /* No destructor defined for conslist_opt */ - break; - case 20: -#line 99 "parse.y" -{ - sqliteEndTable(pParse,0,yymsp[0].minor.yy179); - sqliteSelectDelete(yymsp[0].minor.yy179); -} -#line 1991 "parse.c" - /* No destructor defined for AS */ - break; - case 21: - /* No destructor defined for columnlist */ - /* No destructor defined for COMMA */ - /* No destructor defined for column */ - break; - case 22: - /* No destructor defined for column */ - break; - case 23: - /* No destructor defined for columnid */ - /* No destructor defined for type */ - /* No destructor defined for carglist */ - break; - case 24: -#line 111 "parse.y" -{sqliteAddColumn(pParse,&yymsp[0].minor.yy298);} -#line 2010 "parse.c" - break; - case 25: -#line 117 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2015 "parse.c" - break; - case 26: -#line 149 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2020 "parse.c" - break; - case 27: -#line 150 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2025 "parse.c" - break; - case 28: -#line 155 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2030 "parse.c" - break; - case 29: -#line 156 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2035 "parse.c" - break; - case 30: -#line 157 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 2040 "parse.c" - break; - case 31: - break; - case 32: -#line 160 "parse.y" -{sqliteAddColumnType(pParse,&yymsp[0].minor.yy298,&yymsp[0].minor.yy298);} -#line 2047 "parse.c" - break; - case 33: -#line 161 "parse.y" -{sqliteAddColumnType(pParse,&yymsp[-3].minor.yy298,&yymsp[0].minor.yy0);} -#line 2052 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for signed */ - break; - case 34: -#line 163 "parse.y" -{sqliteAddColumnType(pParse,&yymsp[-5].minor.yy298,&yymsp[0].minor.yy0);} -#line 2059 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for signed */ - /* No destructor defined for COMMA */ - /* No destructor defined for signed */ - break; - case 35: -#line 165 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy298;} -#line 2068 "parse.c" - break; - case 36: -#line 166 "parse.y" -{yygotominor.yy298 = yymsp[-1].minor.yy298;} -#line 2073 "parse.c" - /* No destructor defined for ids */ - break; - case 37: -#line 168 "parse.y" -{ yygotominor.yy372 = atoi(yymsp[0].minor.yy0.z); } -#line 2079 "parse.c" - break; - case 38: -#line 169 "parse.y" -{ yygotominor.yy372 = atoi(yymsp[0].minor.yy0.z); } -#line 2084 "parse.c" - /* No destructor defined for PLUS */ - break; - case 39: -#line 170 "parse.y" -{ yygotominor.yy372 = -atoi(yymsp[0].minor.yy0.z); } -#line 2090 "parse.c" - /* No destructor defined for MINUS */ - break; - case 40: - /* No destructor defined for carglist */ - /* No destructor defined for carg */ - break; - case 41: - break; - case 42: - /* No destructor defined for CONSTRAINT */ - /* No destructor defined for nm */ - /* No destructor defined for ccons */ - break; - case 43: - /* No destructor defined for ccons */ - break; - case 44: -#line 175 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2110 "parse.c" - /* No destructor defined for DEFAULT */ - break; - case 45: -#line 176 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2116 "parse.c" - /* No destructor defined for DEFAULT */ - break; - case 46: -#line 177 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2122 "parse.c" - /* No destructor defined for DEFAULT */ - break; - case 47: -#line 178 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2128 "parse.c" - /* No destructor defined for DEFAULT */ - /* No destructor defined for PLUS */ - break; - case 48: -#line 179 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);} -#line 2135 "parse.c" - /* No destructor defined for DEFAULT */ - /* No destructor defined for MINUS */ - break; - case 49: -#line 180 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2142 "parse.c" - /* No destructor defined for DEFAULT */ - break; - case 50: -#line 181 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 2148 "parse.c" - /* No destructor defined for DEFAULT */ - /* No destructor defined for PLUS */ - break; - case 51: -#line 182 "parse.y" -{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);} -#line 2155 "parse.c" - /* No destructor defined for DEFAULT */ - /* No destructor defined for MINUS */ - break; - case 52: - /* No destructor defined for DEFAULT */ - /* No destructor defined for NULL */ - break; - case 53: - /* No destructor defined for NULL */ - /* No destructor defined for onconf */ - break; - case 54: -#line 189 "parse.y" -{sqliteAddNotNull(pParse, yymsp[0].minor.yy372);} -#line 2170 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for NULL */ - break; - case 55: -#line 190 "parse.y" -{sqliteAddPrimaryKey(pParse,0,yymsp[0].minor.yy372);} -#line 2177 "parse.c" - /* No destructor defined for PRIMARY */ - /* No destructor defined for KEY */ - /* No destructor defined for sortorder */ - break; - case 56: -#line 191 "parse.y" -{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);} -#line 2185 "parse.c" - /* No destructor defined for UNIQUE */ - break; - case 57: - /* No destructor defined for CHECK */ - /* No destructor defined for LP */ - yy_destructor(158,&yymsp[-2].minor); - /* No destructor defined for RP */ - /* No destructor defined for onconf */ - break; - case 58: -#line 194 "parse.y" -{sqliteCreateForeignKey(pParse,0,&yymsp[-2].minor.yy298,yymsp[-1].minor.yy320,yymsp[0].minor.yy372);} -#line 2198 "parse.c" - /* No destructor defined for REFERENCES */ - break; - case 59: -#line 195 "parse.y" -{sqliteDeferForeignKey(pParse,yymsp[0].minor.yy372);} -#line 2204 "parse.c" - break; - case 60: -#line 196 "parse.y" -{ - sqliteAddCollateType(pParse, sqliteCollateType(yymsp[0].minor.yy298.z, yymsp[0].minor.yy298.n)); -} -#line 2211 "parse.c" - /* No destructor defined for COLLATE */ - break; - case 61: -#line 206 "parse.y" -{ yygotominor.yy372 = OE_Restrict * 0x010101; } -#line 2217 "parse.c" - break; - case 62: -#line 207 "parse.y" -{ yygotominor.yy372 = (yymsp[-1].minor.yy372 & yymsp[0].minor.yy407.mask) | yymsp[0].minor.yy407.value; } -#line 2222 "parse.c" - break; - case 63: -#line 209 "parse.y" -{ yygotominor.yy407.value = 0; yygotominor.yy407.mask = 0x000000; } -#line 2227 "parse.c" - /* No destructor defined for MATCH */ - /* No destructor defined for nm */ - break; - case 64: -#line 210 "parse.y" -{ yygotominor.yy407.value = yymsp[0].minor.yy372; yygotominor.yy407.mask = 0x0000ff; } -#line 2234 "parse.c" - /* No destructor defined for ON */ - /* No destructor defined for DELETE */ - break; - case 65: -#line 211 "parse.y" -{ yygotominor.yy407.value = yymsp[0].minor.yy372<<8; yygotominor.yy407.mask = 0x00ff00; } -#line 2241 "parse.c" - /* No destructor defined for ON */ - /* No destructor defined for UPDATE */ - break; - case 66: -#line 212 "parse.y" -{ yygotominor.yy407.value = yymsp[0].minor.yy372<<16; yygotominor.yy407.mask = 0xff0000; } -#line 2248 "parse.c" - /* No destructor defined for ON */ - /* No destructor defined for INSERT */ - break; - case 67: -#line 214 "parse.y" -{ yygotominor.yy372 = OE_SetNull; } -#line 2255 "parse.c" - /* No destructor defined for SET */ - /* No destructor defined for NULL */ - break; - case 68: -#line 215 "parse.y" -{ yygotominor.yy372 = OE_SetDflt; } -#line 2262 "parse.c" - /* No destructor defined for SET */ - /* No destructor defined for DEFAULT */ - break; - case 69: -#line 216 "parse.y" -{ yygotominor.yy372 = OE_Cascade; } -#line 2269 "parse.c" - /* No destructor defined for CASCADE */ - break; - case 70: -#line 217 "parse.y" -{ yygotominor.yy372 = OE_Restrict; } -#line 2275 "parse.c" - /* No destructor defined for RESTRICT */ - break; - case 71: -#line 219 "parse.y" -{yygotominor.yy372 = yymsp[0].minor.yy372;} -#line 2281 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for DEFERRABLE */ - break; - case 72: -#line 220 "parse.y" -{yygotominor.yy372 = yymsp[0].minor.yy372;} -#line 2288 "parse.c" - /* No destructor defined for DEFERRABLE */ - break; - case 73: -#line 222 "parse.y" -{yygotominor.yy372 = 0;} -#line 2294 "parse.c" - break; - case 74: -#line 223 "parse.y" -{yygotominor.yy372 = 1;} -#line 2299 "parse.c" - /* No destructor defined for INITIALLY */ - /* No destructor defined for DEFERRED */ - break; - case 75: -#line 224 "parse.y" -{yygotominor.yy372 = 0;} -#line 2306 "parse.c" - /* No destructor defined for INITIALLY */ - /* No destructor defined for IMMEDIATE */ - break; - case 76: - break; - case 77: - /* No destructor defined for COMMA */ - /* No destructor defined for conslist */ - break; - case 78: - /* No destructor defined for conslist */ - /* No destructor defined for COMMA */ - /* No destructor defined for tcons */ - break; - case 79: - /* No destructor defined for conslist */ - /* No destructor defined for tcons */ - break; - case 80: - /* No destructor defined for tcons */ - break; - case 81: - /* No destructor defined for CONSTRAINT */ - /* No destructor defined for nm */ - break; - case 82: -#line 236 "parse.y" -{sqliteAddPrimaryKey(pParse,yymsp[-2].minor.yy320,yymsp[0].minor.yy372);} -#line 2335 "parse.c" - /* No destructor defined for PRIMARY */ - /* No destructor defined for KEY */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 83: -#line 238 "parse.y" -{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);} -#line 2344 "parse.c" - /* No destructor defined for UNIQUE */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 84: - /* No destructor defined for CHECK */ - yy_destructor(158,&yymsp[-1].minor); - /* No destructor defined for onconf */ - break; - case 85: -#line 241 "parse.y" -{ - sqliteCreateForeignKey(pParse, yymsp[-6].minor.yy320, &yymsp[-3].minor.yy298, yymsp[-2].minor.yy320, yymsp[-1].minor.yy372); - sqliteDeferForeignKey(pParse, yymsp[0].minor.yy372); -} -#line 2360 "parse.c" - /* No destructor defined for FOREIGN */ - /* No destructor defined for KEY */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - /* No destructor defined for REFERENCES */ - break; - case 86: -#line 246 "parse.y" -{yygotominor.yy372 = 0;} -#line 2370 "parse.c" - break; - case 87: -#line 247 "parse.y" -{yygotominor.yy372 = yymsp[0].minor.yy372;} -#line 2375 "parse.c" - break; - case 88: -#line 255 "parse.y" -{ yygotominor.yy372 = OE_Default; } -#line 2380 "parse.c" - break; - case 89: -#line 256 "parse.y" -{ yygotominor.yy372 = yymsp[0].minor.yy372; } -#line 2385 "parse.c" - /* No destructor defined for ON */ - /* No destructor defined for CONFLICT */ - break; - case 90: -#line 257 "parse.y" -{ yygotominor.yy372 = OE_Default; } -#line 2392 "parse.c" - break; - case 91: -#line 258 "parse.y" -{ yygotominor.yy372 = yymsp[0].minor.yy372; } -#line 2397 "parse.c" - /* No destructor defined for OR */ - break; - case 92: -#line 259 "parse.y" -{ yygotominor.yy372 = OE_Rollback; } -#line 2403 "parse.c" - /* No destructor defined for ROLLBACK */ - break; - case 93: -#line 260 "parse.y" -{ yygotominor.yy372 = OE_Abort; } -#line 2409 "parse.c" - /* No destructor defined for ABORT */ - break; - case 94: -#line 261 "parse.y" -{ yygotominor.yy372 = OE_Fail; } -#line 2415 "parse.c" - /* No destructor defined for FAIL */ - break; - case 95: -#line 262 "parse.y" -{ yygotominor.yy372 = OE_Ignore; } -#line 2421 "parse.c" - /* No destructor defined for IGNORE */ - break; - case 96: -#line 263 "parse.y" -{ yygotominor.yy372 = OE_Replace; } -#line 2427 "parse.c" - /* No destructor defined for REPLACE */ - break; - case 97: -#line 267 "parse.y" -{sqliteDropTable(pParse,&yymsp[0].minor.yy298,0);} -#line 2433 "parse.c" - /* No destructor defined for DROP */ - /* No destructor defined for TABLE */ - break; - case 98: -#line 271 "parse.y" -{ - sqliteCreateView(pParse, &yymsp[-5].minor.yy0, &yymsp[-2].minor.yy298, yymsp[0].minor.yy179, yymsp[-4].minor.yy372); -} -#line 2442 "parse.c" - /* No destructor defined for VIEW */ - /* No destructor defined for AS */ - break; - case 99: -#line 274 "parse.y" -{ - sqliteDropTable(pParse, &yymsp[0].minor.yy298, 1); -} -#line 2451 "parse.c" - /* No destructor defined for DROP */ - /* No destructor defined for VIEW */ - break; - case 100: -#line 280 "parse.y" -{ - sqliteSelect(pParse, yymsp[0].minor.yy179, SRT_Callback, 0, 0, 0, 0); - sqliteSelectDelete(yymsp[0].minor.yy179); -} -#line 2461 "parse.c" - break; - case 101: -#line 290 "parse.y" -{yygotominor.yy179 = yymsp[0].minor.yy179;} -#line 2466 "parse.c" - break; - case 102: -#line 291 "parse.y" -{ - if( yymsp[0].minor.yy179 ){ - yymsp[0].minor.yy179->op = yymsp[-1].minor.yy372; - yymsp[0].minor.yy179->pPrior = yymsp[-2].minor.yy179; - } - yygotominor.yy179 = yymsp[0].minor.yy179; -} -#line 2477 "parse.c" - break; - case 103: -#line 299 "parse.y" -{yygotominor.yy372 = TK_UNION;} -#line 2482 "parse.c" - /* No destructor defined for UNION */ - break; - case 104: -#line 300 "parse.y" -{yygotominor.yy372 = TK_ALL;} -#line 2488 "parse.c" - /* No destructor defined for UNION */ - /* No destructor defined for ALL */ - break; - case 105: -#line 301 "parse.y" -{yygotominor.yy372 = TK_INTERSECT;} -#line 2495 "parse.c" - /* No destructor defined for INTERSECT */ - break; - case 106: -#line 302 "parse.y" -{yygotominor.yy372 = TK_EXCEPT;} -#line 2501 "parse.c" - /* No destructor defined for EXCEPT */ - break; - case 107: -#line 304 "parse.y" -{ - yygotominor.yy179 = sqliteSelectNew(yymsp[-6].minor.yy322,yymsp[-5].minor.yy307,yymsp[-4].minor.yy242,yymsp[-3].minor.yy322,yymsp[-2].minor.yy242,yymsp[-1].minor.yy322,yymsp[-7].minor.yy372,yymsp[0].minor.yy124.limit,yymsp[0].minor.yy124.offset); -} -#line 2509 "parse.c" - /* No destructor defined for SELECT */ - break; - case 108: -#line 312 "parse.y" -{yygotominor.yy372 = 1;} -#line 2515 "parse.c" - /* No destructor defined for DISTINCT */ - break; - case 109: -#line 313 "parse.y" -{yygotominor.yy372 = 0;} -#line 2521 "parse.c" - /* No destructor defined for ALL */ - break; - case 110: -#line 314 "parse.y" -{yygotominor.yy372 = 0;} -#line 2527 "parse.c" - break; - case 111: -#line 325 "parse.y" -{yygotominor.yy322 = yymsp[-1].minor.yy322;} -#line 2532 "parse.c" - /* No destructor defined for COMMA */ - break; - case 112: -#line 326 "parse.y" -{yygotominor.yy322 = 0;} -#line 2538 "parse.c" - break; - case 113: -#line 327 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[-1].minor.yy242,yymsp[0].minor.yy298.n?&yymsp[0].minor.yy298:0); -} -#line 2545 "parse.c" - break; - case 114: -#line 330 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(yymsp[-1].minor.yy322, sqliteExpr(TK_ALL, 0, 0, 0), 0); -} -#line 2552 "parse.c" - /* No destructor defined for STAR */ - break; - case 115: -#line 333 "parse.y" -{ - Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0); - Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy298); - yygotominor.yy322 = sqliteExprListAppend(yymsp[-3].minor.yy322, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0); -} -#line 2562 "parse.c" - /* No destructor defined for DOT */ - /* No destructor defined for STAR */ - break; - case 116: -#line 343 "parse.y" -{ yygotominor.yy298 = yymsp[0].minor.yy298; } -#line 2569 "parse.c" - /* No destructor defined for AS */ - break; - case 117: -#line 344 "parse.y" -{ yygotominor.yy298 = yymsp[0].minor.yy298; } -#line 2575 "parse.c" - break; - case 118: -#line 345 "parse.y" -{ yygotominor.yy298.n = 0; } -#line 2580 "parse.c" - break; - case 119: -#line 357 "parse.y" -{yygotominor.yy307 = sqliteMalloc(sizeof(*yygotominor.yy307));} -#line 2585 "parse.c" - break; - case 120: -#line 358 "parse.y" -{yygotominor.yy307 = yymsp[0].minor.yy307;} -#line 2590 "parse.c" - /* No destructor defined for FROM */ - break; - case 121: -#line 363 "parse.y" -{ - yygotominor.yy307 = yymsp[-1].minor.yy307; - if( yygotominor.yy307 && yygotominor.yy307->nSrc>0 ) yygotominor.yy307->a[yygotominor.yy307->nSrc-1].jointype = yymsp[0].minor.yy372; -} -#line 2599 "parse.c" - break; - case 122: -#line 367 "parse.y" -{yygotominor.yy307 = 0;} -#line 2604 "parse.c" - break; - case 123: -#line 368 "parse.y" -{ - yygotominor.yy307 = sqliteSrcListAppend(yymsp[-5].minor.yy307,&yymsp[-4].minor.yy298,&yymsp[-3].minor.yy298); - if( yymsp[-2].minor.yy298.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy298); - if( yymsp[-1].minor.yy242 ){ - if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; } - else { sqliteExprDelete(yymsp[-1].minor.yy242); } - } - if( yymsp[0].minor.yy320 ){ - if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; } - else { sqliteIdListDelete(yymsp[0].minor.yy320); } - } -} -#line 2620 "parse.c" - break; - case 124: -#line 381 "parse.y" -{ - yygotominor.yy307 = sqliteSrcListAppend(yymsp[-6].minor.yy307,0,0); - yygotominor.yy307->a[yygotominor.yy307->nSrc-1].pSelect = yymsp[-4].minor.yy179; - if( yymsp[-2].minor.yy298.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy298); - if( yymsp[-1].minor.yy242 ){ - if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; } - else { sqliteExprDelete(yymsp[-1].minor.yy242); } - } - if( yymsp[0].minor.yy320 ){ - if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; } - else { sqliteIdListDelete(yymsp[0].minor.yy320); } - } -} -#line 2637 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 125: -#line 401 "parse.y" -{yygotominor.yy179 = yymsp[0].minor.yy179;} -#line 2644 "parse.c" - break; - case 126: -#line 402 "parse.y" -{ - yygotominor.yy179 = sqliteSelectNew(0,yymsp[0].minor.yy307,0,0,0,0,0,-1,0); -} -#line 2651 "parse.c" - break; - case 127: -#line 407 "parse.y" -{yygotominor.yy298.z=0; yygotominor.yy298.n=0;} -#line 2656 "parse.c" - break; - case 128: -#line 408 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy298;} -#line 2661 "parse.c" - /* No destructor defined for DOT */ - break; - case 129: -#line 412 "parse.y" -{ yygotominor.yy372 = JT_INNER; } -#line 2667 "parse.c" - /* No destructor defined for COMMA */ - break; - case 130: -#line 413 "parse.y" -{ yygotominor.yy372 = JT_INNER; } -#line 2673 "parse.c" - /* No destructor defined for JOIN */ - break; - case 131: -#line 414 "parse.y" -{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-1].minor.yy0,0,0); } -#line 2679 "parse.c" - /* No destructor defined for JOIN */ - break; - case 132: -#line 415 "parse.y" -{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy298,0); } -#line 2685 "parse.c" - /* No destructor defined for JOIN */ - break; - case 133: -#line 417 "parse.y" -{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy298,&yymsp[-1].minor.yy298); } -#line 2691 "parse.c" - /* No destructor defined for JOIN */ - break; - case 134: -#line 421 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 2697 "parse.c" - /* No destructor defined for ON */ - break; - case 135: -#line 422 "parse.y" -{yygotominor.yy242 = 0;} -#line 2703 "parse.c" - break; - case 136: -#line 426 "parse.y" -{yygotominor.yy320 = yymsp[-1].minor.yy320;} -#line 2708 "parse.c" - /* No destructor defined for USING */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 137: -#line 427 "parse.y" -{yygotominor.yy320 = 0;} -#line 2716 "parse.c" - break; - case 138: -#line 437 "parse.y" -{yygotominor.yy322 = 0;} -#line 2721 "parse.c" - break; - case 139: -#line 438 "parse.y" -{yygotominor.yy322 = yymsp[0].minor.yy322;} -#line 2726 "parse.c" - /* No destructor defined for ORDER */ - /* No destructor defined for BY */ - break; - case 140: -#line 439 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[-2].minor.yy242,0); - if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372; -} -#line 2736 "parse.c" - /* No destructor defined for COMMA */ - break; - case 141: -#line 443 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(0,yymsp[-2].minor.yy242,0); - if( yygotominor.yy322 ) yygotominor.yy322->a[0].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372; -} -#line 2745 "parse.c" - break; - case 142: -#line 447 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 2750 "parse.c" - break; - case 143: -#line 452 "parse.y" -{yygotominor.yy372 = SQLITE_SO_ASC;} -#line 2755 "parse.c" - /* No destructor defined for ASC */ - break; - case 144: -#line 453 "parse.y" -{yygotominor.yy372 = SQLITE_SO_DESC;} -#line 2761 "parse.c" - /* No destructor defined for DESC */ - break; - case 145: -#line 454 "parse.y" -{yygotominor.yy372 = SQLITE_SO_ASC;} -#line 2767 "parse.c" - break; - case 146: -#line 455 "parse.y" -{yygotominor.yy372 = SQLITE_SO_UNK;} -#line 2772 "parse.c" - break; - case 147: -#line 456 "parse.y" -{yygotominor.yy372 = sqliteCollateType(yymsp[0].minor.yy298.z, yymsp[0].minor.yy298.n);} -#line 2777 "parse.c" - /* No destructor defined for COLLATE */ - break; - case 148: -#line 460 "parse.y" -{yygotominor.yy322 = 0;} -#line 2783 "parse.c" - break; - case 149: -#line 461 "parse.y" -{yygotominor.yy322 = yymsp[0].minor.yy322;} -#line 2788 "parse.c" - /* No destructor defined for GROUP */ - /* No destructor defined for BY */ - break; - case 150: -#line 465 "parse.y" -{yygotominor.yy242 = 0;} -#line 2795 "parse.c" - break; - case 151: -#line 466 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 2800 "parse.c" - /* No destructor defined for HAVING */ - break; - case 152: -#line 469 "parse.y" -{yygotominor.yy124.limit = -1; yygotominor.yy124.offset = 0;} -#line 2806 "parse.c" - break; - case 153: -#line 470 "parse.y" -{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = 0;} -#line 2811 "parse.c" - /* No destructor defined for LIMIT */ - break; - case 154: -#line 472 "parse.y" -{yygotominor.yy124.limit = yymsp[-2].minor.yy372; yygotominor.yy124.offset = yymsp[0].minor.yy372;} -#line 2817 "parse.c" - /* No destructor defined for LIMIT */ - /* No destructor defined for OFFSET */ - break; - case 155: -#line 474 "parse.y" -{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = yymsp[-2].minor.yy372;} -#line 2824 "parse.c" - /* No destructor defined for LIMIT */ - /* No destructor defined for COMMA */ - break; - case 156: -#line 478 "parse.y" -{ - sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&yymsp[-2].minor.yy298,&yymsp[-1].minor.yy298), yymsp[0].minor.yy242); -} -#line 2833 "parse.c" - /* No destructor defined for DELETE */ - /* No destructor defined for FROM */ - break; - case 157: -#line 485 "parse.y" -{yygotominor.yy242 = 0;} -#line 2840 "parse.c" - break; - case 158: -#line 486 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 2845 "parse.c" - /* No destructor defined for WHERE */ - break; - case 159: -#line 494 "parse.y" -{sqliteUpdate(pParse,sqliteSrcListAppend(0,&yymsp[-4].minor.yy298,&yymsp[-3].minor.yy298),yymsp[-1].minor.yy322,yymsp[0].minor.yy242,yymsp[-5].minor.yy372);} -#line 2851 "parse.c" - /* No destructor defined for UPDATE */ - /* No destructor defined for SET */ - break; - case 160: -#line 497 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[0].minor.yy242,&yymsp[-2].minor.yy298);} -#line 2858 "parse.c" - /* No destructor defined for COMMA */ - /* No destructor defined for EQ */ - break; - case 161: -#line 498 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,&yymsp[-2].minor.yy298);} -#line 2865 "parse.c" - /* No destructor defined for EQ */ - break; - case 162: -#line 504 "parse.y" -{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-6].minor.yy298,&yymsp[-5].minor.yy298), yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy320, yymsp[-8].minor.yy372);} -#line 2871 "parse.c" - /* No destructor defined for INTO */ - /* No destructor defined for VALUES */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 163: -#line 506 "parse.y" -{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-3].minor.yy298,&yymsp[-2].minor.yy298), 0, yymsp[0].minor.yy179, yymsp[-1].minor.yy320, yymsp[-5].minor.yy372);} -#line 2880 "parse.c" - /* No destructor defined for INTO */ - break; - case 164: -#line 509 "parse.y" -{yygotominor.yy372 = yymsp[0].minor.yy372;} -#line 2886 "parse.c" - /* No destructor defined for INSERT */ - break; - case 165: -#line 510 "parse.y" -{yygotominor.yy372 = OE_Replace;} -#line 2892 "parse.c" - /* No destructor defined for REPLACE */ - break; - case 166: -#line 516 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[0].minor.yy242,0);} -#line 2898 "parse.c" - /* No destructor defined for COMMA */ - break; - case 167: -#line 517 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,0);} -#line 2904 "parse.c" - break; - case 168: -#line 524 "parse.y" -{yygotominor.yy320 = 0;} -#line 2909 "parse.c" - break; - case 169: -#line 525 "parse.y" -{yygotominor.yy320 = yymsp[-1].minor.yy320;} -#line 2914 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 170: -#line 526 "parse.y" -{yygotominor.yy320 = sqliteIdListAppend(yymsp[-2].minor.yy320,&yymsp[0].minor.yy298);} -#line 2921 "parse.c" - /* No destructor defined for COMMA */ - break; - case 171: -#line 527 "parse.y" -{yygotominor.yy320 = sqliteIdListAppend(0,&yymsp[0].minor.yy298);} -#line 2927 "parse.c" - break; - case 172: -#line 535 "parse.y" -{yygotominor.yy242 = yymsp[-1].minor.yy242; sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } -#line 2932 "parse.c" - break; - case 173: -#line 536 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_NULL, 0, 0, &yymsp[0].minor.yy0);} -#line 2937 "parse.c" - break; - case 174: -#line 537 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} -#line 2942 "parse.c" - break; - case 175: -#line 538 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} -#line 2947 "parse.c" - break; - case 176: -#line 539 "parse.y" -{ - Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy298); - Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy298); - yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp2, 0); -} -#line 2956 "parse.c" - /* No destructor defined for DOT */ - break; - case 177: -#line 544 "parse.y" -{ - Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-4].minor.yy298); - Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy298); - Expr *temp3 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy298); - Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); - yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp4, 0); -} -#line 2968 "parse.c" - /* No destructor defined for DOT */ - /* No destructor defined for DOT */ - break; - case 178: -#line 551 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_INTEGER, 0, 0, &yymsp[0].minor.yy0);} -#line 2975 "parse.c" - break; - case 179: -#line 552 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_FLOAT, 0, 0, &yymsp[0].minor.yy0);} -#line 2980 "parse.c" - break; - case 180: -#line 553 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_STRING, 0, 0, &yymsp[0].minor.yy0);} -#line 2985 "parse.c" - break; - case 181: -#line 554 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_VARIABLE, 0, 0, &yymsp[0].minor.yy0); - if( yygotominor.yy242 ) yygotominor.yy242->iTable = ++pParse->nVar; -} -#line 2993 "parse.c" - break; - case 182: -#line 558 "parse.y" -{ - yygotominor.yy242 = sqliteExprFunction(yymsp[-1].minor.yy322, &yymsp[-3].minor.yy0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); -} -#line 3001 "parse.c" - /* No destructor defined for LP */ - break; - case 183: -#line 562 "parse.y" -{ - yygotominor.yy242 = sqliteExprFunction(0, &yymsp[-3].minor.yy0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); -} -#line 3010 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for STAR */ - break; - case 184: -#line 566 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_AND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3017 "parse.c" - /* No destructor defined for AND */ - break; - case 185: -#line 567 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_OR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3023 "parse.c" - /* No destructor defined for OR */ - break; - case 186: -#line 568 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_LT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3029 "parse.c" - /* No destructor defined for LT */ - break; - case 187: -#line 569 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_GT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3035 "parse.c" - /* No destructor defined for GT */ - break; - case 188: -#line 570 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_LE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3041 "parse.c" - /* No destructor defined for LE */ - break; - case 189: -#line 571 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_GE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3047 "parse.c" - /* No destructor defined for GE */ - break; - case 190: -#line 572 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_NE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3053 "parse.c" - /* No destructor defined for NE */ - break; - case 191: -#line 573 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_EQ, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3059 "parse.c" - /* No destructor defined for EQ */ - break; - case 192: -#line 574 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_BITAND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3065 "parse.c" - /* No destructor defined for BITAND */ - break; - case 193: -#line 575 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_BITOR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3071 "parse.c" - /* No destructor defined for BITOR */ - break; - case 194: -#line 576 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_LSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3077 "parse.c" - /* No destructor defined for LSHIFT */ - break; - case 195: -#line 577 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_RSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3083 "parse.c" - /* No destructor defined for RSHIFT */ - break; - case 196: -#line 578 "parse.y" -{ - ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0); - pList = sqliteExprListAppend(pList, yymsp[-2].minor.yy242, 0); - yygotominor.yy242 = sqliteExprFunction(pList, 0); - if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372; - sqliteExprSpan(yygotominor.yy242, &yymsp[-2].minor.yy242->span, &yymsp[0].minor.yy242->span); -} -#line 3095 "parse.c" - break; - case 197: -#line 585 "parse.y" -{ - ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0); - pList = sqliteExprListAppend(pList, yymsp[-3].minor.yy242, 0); - yygotominor.yy242 = sqliteExprFunction(pList, 0); - if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372; - yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy242->span); -} -#line 3107 "parse.c" - /* No destructor defined for NOT */ - break; - case 198: -#line 594 "parse.y" -{yygotominor.yy372 = TK_LIKE;} -#line 3113 "parse.c" - /* No destructor defined for LIKE */ - break; - case 199: -#line 595 "parse.y" -{yygotominor.yy372 = TK_GLOB;} -#line 3119 "parse.c" - /* No destructor defined for GLOB */ - break; - case 200: -#line 596 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_PLUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3125 "parse.c" - /* No destructor defined for PLUS */ - break; - case 201: -#line 597 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_MINUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3131 "parse.c" - /* No destructor defined for MINUS */ - break; - case 202: -#line 598 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_STAR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3137 "parse.c" - /* No destructor defined for STAR */ - break; - case 203: -#line 599 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_SLASH, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3143 "parse.c" - /* No destructor defined for SLASH */ - break; - case 204: -#line 600 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_REM, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3149 "parse.c" - /* No destructor defined for REM */ - break; - case 205: -#line 601 "parse.y" -{yygotominor.yy242 = sqliteExpr(TK_CONCAT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);} -#line 3155 "parse.c" - /* No destructor defined for CONCAT */ - break; - case 206: -#line 602 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-1].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3164 "parse.c" - break; - case 207: -#line 606 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-2].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3172 "parse.c" - /* No destructor defined for IS */ - break; - case 208: -#line 610 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-1].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3181 "parse.c" - break; - case 209: -#line 614 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-2].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3189 "parse.c" - /* No destructor defined for NOT */ - break; - case 210: -#line 618 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-3].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3198 "parse.c" - /* No destructor defined for IS */ - /* No destructor defined for NOT */ - break; - case 211: -#line 622 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_NOT, yymsp[0].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); -} -#line 3208 "parse.c" - break; - case 212: -#line 626 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_BITNOT, yymsp[0].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); -} -#line 3216 "parse.c" - break; - case 213: -#line 630 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_UMINUS, yymsp[0].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); -} -#line 3224 "parse.c" - break; - case 214: -#line 634 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_UPLUS, yymsp[0].minor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span); -} -#line 3232 "parse.c" - break; - case 215: -#line 638 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_SELECT, 0, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; - sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); -} -#line 3241 "parse.c" - break; - case 216: -#line 643 "parse.y" -{ - ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); - pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0); - yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-4].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pList = pList; - sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy242->span); -} -#line 3252 "parse.c" - /* No destructor defined for BETWEEN */ - /* No destructor defined for AND */ - break; - case 217: -#line 650 "parse.y" -{ - ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); - pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0); - yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-5].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pList = pList; - yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy242->span); -} -#line 3266 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for BETWEEN */ - /* No destructor defined for AND */ - break; - case 218: -#line 658 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322; - sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3278 "parse.c" - /* No destructor defined for IN */ - /* No destructor defined for LP */ - break; - case 219: -#line 663 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; - sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3289 "parse.c" - /* No destructor defined for IN */ - /* No destructor defined for LP */ - break; - case 220: -#line 668 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322; - yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3301 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for IN */ - /* No destructor defined for LP */ - break; - case 221: -#line 674 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179; - yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0); -} -#line 3314 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for IN */ - /* No destructor defined for LP */ - break; - case 222: -#line 680 "parse.y" -{ - SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy298, &yymsp[0].minor.yy298); - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-3].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,yymsp[0].minor.yy298.z?&yymsp[0].minor.yy298:&yymsp[-1].minor.yy298); -} -#line 3327 "parse.c" - /* No destructor defined for IN */ - break; - case 223: -#line 686 "parse.y" -{ - SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy298, &yymsp[0].minor.yy298); - yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); - yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0); - sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,yymsp[0].minor.yy298.z?&yymsp[0].minor.yy298:&yymsp[-1].minor.yy298); -} -#line 3339 "parse.c" - /* No destructor defined for NOT */ - /* No destructor defined for IN */ - break; - case 224: -#line 696 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_CASE, yymsp[-3].minor.yy242, yymsp[-1].minor.yy242, 0); - if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-2].minor.yy322; - sqliteExprSpan(yygotominor.yy242, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3350 "parse.c" - break; - case 225: -#line 703 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322, yymsp[-2].minor.yy242, 0); - yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0); -} -#line 3358 "parse.c" - /* No destructor defined for WHEN */ - /* No destructor defined for THEN */ - break; - case 226: -#line 707 "parse.y" -{ - yygotominor.yy322 = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0); - yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0); -} -#line 3368 "parse.c" - /* No destructor defined for WHEN */ - /* No destructor defined for THEN */ - break; - case 227: -#line 712 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 3375 "parse.c" - /* No destructor defined for ELSE */ - break; - case 228: -#line 713 "parse.y" -{yygotominor.yy242 = 0;} -#line 3381 "parse.c" - break; - case 229: -#line 715 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 3386 "parse.c" - break; - case 230: -#line 716 "parse.y" -{yygotominor.yy242 = 0;} -#line 3391 "parse.c" - break; - case 231: -#line 724 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[0].minor.yy242,0);} -#line 3396 "parse.c" - /* No destructor defined for COMMA */ - break; - case 232: -#line 725 "parse.y" -{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,0);} -#line 3402 "parse.c" - break; - case 233: -#line 726 "parse.y" -{yygotominor.yy242 = yymsp[0].minor.yy242;} -#line 3407 "parse.c" - break; - case 234: -#line 727 "parse.y" -{yygotominor.yy242 = 0;} -#line 3412 "parse.c" - break; - case 235: -#line 732 "parse.y" -{ - SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-5].minor.yy298, &yymsp[-4].minor.yy298); - if( yymsp[-9].minor.yy372!=OE_None ) yymsp[-9].minor.yy372 = yymsp[0].minor.yy372; - if( yymsp[-9].minor.yy372==OE_Default) yymsp[-9].minor.yy372 = OE_Abort; - sqliteCreateIndex(pParse, &yymsp[-7].minor.yy298, pSrc, yymsp[-2].minor.yy320, yymsp[-9].minor.yy372, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0); -} -#line 3422 "parse.c" - /* No destructor defined for INDEX */ - /* No destructor defined for ON */ - /* No destructor defined for LP */ - break; - case 236: -#line 740 "parse.y" -{ yygotominor.yy372 = OE_Abort; } -#line 3430 "parse.c" - /* No destructor defined for UNIQUE */ - break; - case 237: -#line 741 "parse.y" -{ yygotominor.yy372 = OE_None; } -#line 3436 "parse.c" - break; - case 238: -#line 749 "parse.y" -{yygotominor.yy320 = 0;} -#line 3441 "parse.c" - break; - case 239: -#line 750 "parse.y" -{yygotominor.yy320 = yymsp[-1].minor.yy320;} -#line 3446 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 240: -#line 751 "parse.y" -{yygotominor.yy320 = sqliteIdListAppend(yymsp[-2].minor.yy320,&yymsp[0].minor.yy298);} -#line 3453 "parse.c" - /* No destructor defined for COMMA */ - break; - case 241: -#line 752 "parse.y" -{yygotominor.yy320 = sqliteIdListAppend(0,&yymsp[0].minor.yy298);} -#line 3459 "parse.c" - break; - case 242: -#line 753 "parse.y" -{yygotominor.yy298 = yymsp[-1].minor.yy298;} -#line 3464 "parse.c" - /* No destructor defined for sortorder */ - break; - case 243: -#line 758 "parse.y" -{ - sqliteDropIndex(pParse, sqliteSrcListAppend(0,&yymsp[-1].minor.yy298,&yymsp[0].minor.yy298)); -} -#line 3472 "parse.c" - /* No destructor defined for DROP */ - /* No destructor defined for INDEX */ - break; - case 244: -#line 766 "parse.y" -{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-6].minor.yy298,&yymsp[-5].minor.yy298),&yymsp[-3].minor.yy298,&yymsp[0].minor.yy0,yymsp[-7].minor.yy372);} -#line 3479 "parse.c" - /* No destructor defined for COPY */ - /* No destructor defined for FROM */ - /* No destructor defined for USING */ - /* No destructor defined for DELIMITERS */ - break; - case 245: -#line 768 "parse.y" -{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-3].minor.yy298,&yymsp[-2].minor.yy298),&yymsp[0].minor.yy298,0,yymsp[-4].minor.yy372);} -#line 3488 "parse.c" - /* No destructor defined for COPY */ - /* No destructor defined for FROM */ - break; - case 246: -#line 772 "parse.y" -{sqliteVacuum(pParse,0);} -#line 3495 "parse.c" - /* No destructor defined for VACUUM */ - break; - case 247: -#line 773 "parse.y" -{sqliteVacuum(pParse,&yymsp[0].minor.yy298);} -#line 3501 "parse.c" - /* No destructor defined for VACUUM */ - break; - case 248: -#line 777 "parse.y" -{sqlitePragma(pParse,&yymsp[-2].minor.yy298,&yymsp[0].minor.yy298,0);} -#line 3507 "parse.c" - /* No destructor defined for PRAGMA */ - /* No destructor defined for EQ */ - break; - case 249: -#line 778 "parse.y" -{sqlitePragma(pParse,&yymsp[-2].minor.yy298,&yymsp[0].minor.yy0,0);} -#line 3514 "parse.c" - /* No destructor defined for PRAGMA */ - /* No destructor defined for EQ */ - break; - case 250: -#line 779 "parse.y" -{sqlitePragma(pParse,&yymsp[-2].minor.yy298,&yymsp[0].minor.yy298,0);} -#line 3521 "parse.c" - /* No destructor defined for PRAGMA */ - /* No destructor defined for EQ */ - break; - case 251: -#line 780 "parse.y" -{sqlitePragma(pParse,&yymsp[-2].minor.yy298,&yymsp[0].minor.yy298,1);} -#line 3528 "parse.c" - /* No destructor defined for PRAGMA */ - /* No destructor defined for EQ */ - break; - case 252: -#line 781 "parse.y" -{sqlitePragma(pParse,&yymsp[-3].minor.yy298,&yymsp[-1].minor.yy298,0);} -#line 3535 "parse.c" - /* No destructor defined for PRAGMA */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 253: -#line 782 "parse.y" -{sqlitePragma(pParse,&yymsp[0].minor.yy298,&yymsp[0].minor.yy298,0);} -#line 3543 "parse.c" - /* No destructor defined for PRAGMA */ - break; - case 254: -#line 783 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy298;} -#line 3549 "parse.c" - /* No destructor defined for plus_opt */ - break; - case 255: -#line 784 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy298;} -#line 3555 "parse.c" - /* No destructor defined for MINUS */ - break; - case 256: -#line 785 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 3561 "parse.c" - break; - case 257: -#line 786 "parse.y" -{yygotominor.yy298 = yymsp[0].minor.yy0;} -#line 3566 "parse.c" - break; - case 258: - /* No destructor defined for PLUS */ - break; - case 259: - break; - case 260: -#line 792 "parse.y" -{ - Token all; - all.z = yymsp[-4].minor.yy0.z; - all.n = (yymsp[0].minor.yy0.z - yymsp[-4].minor.yy0.z) + yymsp[0].minor.yy0.n; - sqliteFinishTrigger(pParse, yymsp[-1].minor.yy19, &all); -} -#line 3581 "parse.c" - /* No destructor defined for trigger_decl */ - /* No destructor defined for BEGIN */ - break; - case 261: -#line 800 "parse.y" -{ - SrcList *pTab = sqliteSrcListAppend(0, &yymsp[-3].minor.yy298, &yymsp[-2].minor.yy298); - sqliteBeginTrigger(pParse, &yymsp[-7].minor.yy298, yymsp[-6].minor.yy372, yymsp[-5].minor.yy290.a, yymsp[-5].minor.yy290.b, pTab, yymsp[-1].minor.yy372, yymsp[0].minor.yy182, yymsp[-9].minor.yy372); -} -#line 3591 "parse.c" - /* No destructor defined for TRIGGER */ - /* No destructor defined for ON */ - break; - case 262: -#line 806 "parse.y" -{ yygotominor.yy372 = TK_BEFORE; } -#line 3598 "parse.c" - /* No destructor defined for BEFORE */ - break; - case 263: -#line 807 "parse.y" -{ yygotominor.yy372 = TK_AFTER; } -#line 3604 "parse.c" - /* No destructor defined for AFTER */ - break; - case 264: -#line 808 "parse.y" -{ yygotominor.yy372 = TK_INSTEAD;} -#line 3610 "parse.c" - /* No destructor defined for INSTEAD */ - /* No destructor defined for OF */ - break; - case 265: -#line 809 "parse.y" -{ yygotominor.yy372 = TK_BEFORE; } -#line 3617 "parse.c" - break; - case 266: -#line 813 "parse.y" -{ yygotominor.yy290.a = TK_DELETE; yygotominor.yy290.b = 0; } -#line 3622 "parse.c" - /* No destructor defined for DELETE */ - break; - case 267: -#line 814 "parse.y" -{ yygotominor.yy290.a = TK_INSERT; yygotominor.yy290.b = 0; } -#line 3628 "parse.c" - /* No destructor defined for INSERT */ - break; - case 268: -#line 815 "parse.y" -{ yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = 0;} -#line 3634 "parse.c" - /* No destructor defined for UPDATE */ - break; - case 269: -#line 816 "parse.y" -{yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = yymsp[0].minor.yy320; } -#line 3640 "parse.c" - /* No destructor defined for UPDATE */ - /* No destructor defined for OF */ - break; - case 270: -#line 819 "parse.y" -{ yygotominor.yy372 = TK_ROW; } -#line 3647 "parse.c" - break; - case 271: -#line 820 "parse.y" -{ yygotominor.yy372 = TK_ROW; } -#line 3652 "parse.c" - /* No destructor defined for FOR */ - /* No destructor defined for EACH */ - /* No destructor defined for ROW */ - break; - case 272: -#line 821 "parse.y" -{ yygotominor.yy372 = TK_STATEMENT; } -#line 3660 "parse.c" - /* No destructor defined for FOR */ - /* No destructor defined for EACH */ - /* No destructor defined for STATEMENT */ - break; - case 273: -#line 824 "parse.y" -{ yygotominor.yy182 = 0; } -#line 3668 "parse.c" - break; - case 274: -#line 825 "parse.y" -{ yygotominor.yy182 = yymsp[0].minor.yy242; } -#line 3673 "parse.c" - /* No destructor defined for WHEN */ - break; - case 275: -#line 829 "parse.y" -{ - yymsp[-2].minor.yy19->pNext = yymsp[0].minor.yy19; - yygotominor.yy19 = yymsp[-2].minor.yy19; -} -#line 3682 "parse.c" - /* No destructor defined for SEMI */ - break; - case 276: -#line 833 "parse.y" -{ yygotominor.yy19 = 0; } -#line 3688 "parse.c" - break; - case 277: -#line 839 "parse.y" -{ yygotominor.yy19 = sqliteTriggerUpdateStep(&yymsp[-3].minor.yy298, yymsp[-1].minor.yy322, yymsp[0].minor.yy242, yymsp[-4].minor.yy372); } -#line 3693 "parse.c" - /* No destructor defined for UPDATE */ - /* No destructor defined for SET */ - break; - case 278: -#line 844 "parse.y" -{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-5].minor.yy298, yymsp[-4].minor.yy320, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy372);} -#line 3700 "parse.c" - /* No destructor defined for INTO */ - /* No destructor defined for VALUES */ - /* No destructor defined for LP */ - /* No destructor defined for RP */ - break; - case 279: -#line 847 "parse.y" -{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-2].minor.yy298, yymsp[-1].minor.yy320, 0, yymsp[0].minor.yy179, yymsp[-4].minor.yy372);} -#line 3709 "parse.c" - /* No destructor defined for INTO */ - break; - case 280: -#line 851 "parse.y" -{yygotominor.yy19 = sqliteTriggerDeleteStep(&yymsp[-1].minor.yy298, yymsp[0].minor.yy242);} -#line 3715 "parse.c" - /* No destructor defined for DELETE */ - /* No destructor defined for FROM */ - break; - case 281: -#line 854 "parse.y" -{yygotominor.yy19 = sqliteTriggerSelectStep(yymsp[0].minor.yy179); } -#line 3722 "parse.c" - break; - case 282: -#line 857 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, 0); - yygotominor.yy242->iColumn = OE_Ignore; - sqliteExprSpan(yygotominor.yy242, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3731 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for IGNORE */ - break; - case 283: -#line 862 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy298); - yygotominor.yy242->iColumn = OE_Rollback; - sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3742 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for ROLLBACK */ - /* No destructor defined for COMMA */ - break; - case 284: -#line 867 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy298); - yygotominor.yy242->iColumn = OE_Abort; - sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3754 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for ABORT */ - /* No destructor defined for COMMA */ - break; - case 285: -#line 872 "parse.y" -{ - yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy298); - yygotominor.yy242->iColumn = OE_Fail; - sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); -} -#line 3766 "parse.c" - /* No destructor defined for LP */ - /* No destructor defined for FAIL */ - /* No destructor defined for COMMA */ - break; - case 286: -#line 879 "parse.y" -{ - sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&yymsp[-1].minor.yy298,&yymsp[0].minor.yy298)); -} -#line 3776 "parse.c" - /* No destructor defined for DROP */ - /* No destructor defined for TRIGGER */ - break; - case 287: -#line 884 "parse.y" -{ - sqliteAttach(pParse, &yymsp[-3].minor.yy298, &yymsp[-1].minor.yy298, &yymsp[0].minor.yy298); -} -#line 3785 "parse.c" - /* No destructor defined for ATTACH */ - /* No destructor defined for database_kw_opt */ - /* No destructor defined for AS */ - break; - case 288: -#line 888 "parse.y" -{ yygotominor.yy298 = yymsp[0].minor.yy298; } -#line 3793 "parse.c" - /* No destructor defined for USING */ - break; - case 289: -#line 889 "parse.y" -{ yygotominor.yy298.z = 0; yygotominor.yy298.n = 0; } -#line 3799 "parse.c" - break; - case 290: - /* No destructor defined for DATABASE */ - break; - case 291: - break; - case 292: -#line 895 "parse.y" -{ - sqliteDetach(pParse, &yymsp[0].minor.yy298); -} -#line 3811 "parse.c" - /* No destructor defined for DETACH */ - /* No destructor defined for database_kw_opt */ - break; - }; - yygoto = yyRuleInfo[yyruleno].lhs; - yysize = yyRuleInfo[yyruleno].nrhs; - yypParser->yyidx -= yysize; - yyact = yy_find_reduce_action(yypParser,yygoto); - if( yyact < YYNSTATE ){ - yy_shift(yypParser,yyact,yygoto,&yygotominor); - }else if( yyact == YYNSTATE + YYNRULE + 1 ){ - yy_accept(yypParser); - } -} - -/* -** The following code executes when the parse fails -*/ -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - sqliteParserARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ - sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - YYMINORTYPE yyminor /* The minor type of the error token */ -){ - sqliteParserARG_FETCH; -#define TOKEN (yyminor.yy0) -#line 23 "parse.y" - - if( pParse->zErrMsg==0 ){ - if( TOKEN.z[0] ){ - sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); - }else{ - sqliteErrorMsg(pParse, "incomplete SQL statement"); - } - } - -#line 3865 "parse.c" - sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - sqliteParserARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif - while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ - sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "sqliteParserAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -**
                -**
              • A pointer to the parser (an opaque structure.) -**
              • The major token number. -**
              • The minor token number. -**
              • An option argument of a grammar-specified type. -**
              -** -** Outputs: -** None. -*/ -void sqliteParser( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - sqliteParserTOKENTYPE yyminor /* The value for the token */ - sqliteParserARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - int yyact; /* The parser action. */ - int yyendofinput; /* True if we are at the end of input */ - int yyerrorhit = 0; /* True if yymajor has invoked an error */ - yyParser *yypParser; /* The parser */ - - /* (re)initialize the parser, if necessary */ - yypParser = (yyParser*)yyp; - if( yypParser->yyidx<0 ){ - if( yymajor==0 ) return; - yypParser->yyidx = 0; - yypParser->yyerrcnt = -1; - yypParser->yystack[0].stateno = 0; - yypParser->yystack[0].major = 0; - } - yyminorunion.yy0 = yyminor; - yyendofinput = (yymajor==0); - sqliteParserARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,yymajor); - if( yyactyyerrcnt--; - if( yyendofinput && yypParser->yyidx>=0 ){ - yymajor = 0; - }else{ - yymajor = YYNOCODE; - } - }else if( yyact < YYNSTATE + YYNRULE ){ - yy_reduce(yypParser,yyact-YYNSTATE); - }else if( yyact == YY_ERROR_ACTION ){ - int yymx; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yymx = yypParser->yystack[yypParser->yyidx].major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yymajor,&yyminorunion); - yymajor = YYNOCODE; - }else{ - while( - yypParser->yyidx >= 0 && - yymx != YYERRORSYMBOL && - (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yyidx < 0 || yymajor==0 ){ - yy_destructor(yymajor,&yyminorunion); - yy_parse_failed(yypParser); - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - YYMINORTYPE u2; - u2.YYERRSYMDT = 0; - yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor,yyminorunion); - } - yypParser->yyerrcnt = 3; - yy_destructor(yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); - } - yymajor = YYNOCODE; -#endif - }else{ - yy_accept(yypParser); - yymajor = YYNOCODE; - } - }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); - return; -} diff --git a/ext/sqlite/libsqlite/src/parse.h b/ext/sqlite/libsqlite/src/parse.h deleted file mode 100644 index 188a336c8d296..0000000000000 --- a/ext/sqlite/libsqlite/src/parse.h +++ /dev/null @@ -1,130 +0,0 @@ -#define TK_END_OF_FILE 1 -#define TK_ILLEGAL 2 -#define TK_SPACE 3 -#define TK_UNCLOSED_STRING 4 -#define TK_COMMENT 5 -#define TK_FUNCTION 6 -#define TK_COLUMN 7 -#define TK_AGG_FUNCTION 8 -#define TK_SEMI 9 -#define TK_EXPLAIN 10 -#define TK_BEGIN 11 -#define TK_TRANSACTION 12 -#define TK_COMMIT 13 -#define TK_END 14 -#define TK_ROLLBACK 15 -#define TK_CREATE 16 -#define TK_TABLE 17 -#define TK_TEMP 18 -#define TK_LP 19 -#define TK_RP 20 -#define TK_AS 21 -#define TK_COMMA 22 -#define TK_ID 23 -#define TK_ABORT 24 -#define TK_AFTER 25 -#define TK_ASC 26 -#define TK_ATTACH 27 -#define TK_BEFORE 28 -#define TK_CASCADE 29 -#define TK_CLUSTER 30 -#define TK_CONFLICT 31 -#define TK_COPY 32 -#define TK_DATABASE 33 -#define TK_DEFERRED 34 -#define TK_DELIMITERS 35 -#define TK_DESC 36 -#define TK_DETACH 37 -#define TK_EACH 38 -#define TK_FAIL 39 -#define TK_FOR 40 -#define TK_GLOB 41 -#define TK_IGNORE 42 -#define TK_IMMEDIATE 43 -#define TK_INITIALLY 44 -#define TK_INSTEAD 45 -#define TK_LIKE 46 -#define TK_MATCH 47 -#define TK_KEY 48 -#define TK_OF 49 -#define TK_OFFSET 50 -#define TK_PRAGMA 51 -#define TK_RAISE 52 -#define TK_REPLACE 53 -#define TK_RESTRICT 54 -#define TK_ROW 55 -#define TK_STATEMENT 56 -#define TK_TRIGGER 57 -#define TK_VACUUM 58 -#define TK_VIEW 59 -#define TK_OR 60 -#define TK_AND 61 -#define TK_NOT 62 -#define TK_EQ 63 -#define TK_NE 64 -#define TK_ISNULL 65 -#define TK_NOTNULL 66 -#define TK_IS 67 -#define TK_BETWEEN 68 -#define TK_IN 69 -#define TK_GT 70 -#define TK_GE 71 -#define TK_LT 72 -#define TK_LE 73 -#define TK_BITAND 74 -#define TK_BITOR 75 -#define TK_LSHIFT 76 -#define TK_RSHIFT 77 -#define TK_PLUS 78 -#define TK_MINUS 79 -#define TK_STAR 80 -#define TK_SLASH 81 -#define TK_REM 82 -#define TK_CONCAT 83 -#define TK_UMINUS 84 -#define TK_UPLUS 85 -#define TK_BITNOT 86 -#define TK_STRING 87 -#define TK_JOIN_KW 88 -#define TK_INTEGER 89 -#define TK_CONSTRAINT 90 -#define TK_DEFAULT 91 -#define TK_FLOAT 92 -#define TK_NULL 93 -#define TK_PRIMARY 94 -#define TK_UNIQUE 95 -#define TK_CHECK 96 -#define TK_REFERENCES 97 -#define TK_COLLATE 98 -#define TK_ON 99 -#define TK_DELETE 100 -#define TK_UPDATE 101 -#define TK_INSERT 102 -#define TK_SET 103 -#define TK_DEFERRABLE 104 -#define TK_FOREIGN 105 -#define TK_DROP 106 -#define TK_UNION 107 -#define TK_ALL 108 -#define TK_INTERSECT 109 -#define TK_EXCEPT 110 -#define TK_SELECT 111 -#define TK_DISTINCT 112 -#define TK_DOT 113 -#define TK_FROM 114 -#define TK_JOIN 115 -#define TK_USING 116 -#define TK_ORDER 117 -#define TK_BY 118 -#define TK_GROUP 119 -#define TK_HAVING 120 -#define TK_LIMIT 121 -#define TK_WHERE 122 -#define TK_INTO 123 -#define TK_VALUES 124 -#define TK_VARIABLE 125 -#define TK_CASE 126 -#define TK_WHEN 127 -#define TK_THEN 128 -#define TK_ELSE 129 -#define TK_INDEX 130 diff --git a/ext/sqlite/libsqlite/src/parse.y b/ext/sqlite/libsqlite/src/parse.y deleted file mode 100644 index cc236a5df8790..0000000000000 --- a/ext/sqlite/libsqlite/src/parse.y +++ /dev/null @@ -1,897 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains SQLite's grammar for SQL. Process this file -** using the lemon parser generator to generate C code that runs -** the parser. Lemon will also generate a header file containing -** numeric codes for all of the tokens. -** -** @(#) $Id$ -*/ -%token_prefix TK_ -%token_type {Token} -%default_type {Token} -%extra_argument {Parse *pParse} -%syntax_error { - if( pParse->zErrMsg==0 ){ - if( TOKEN.z[0] ){ - sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); - }else{ - sqliteErrorMsg(pParse, "incomplete SQL statement"); - } - } -} -%name sqliteParser -%include { -#include "sqliteInt.h" -#include "parse.h" - -/* -** An instance of this structure holds information about the -** LIMIT clause of a SELECT statement. -*/ -struct LimitVal { - int limit; /* The LIMIT value. -1 if there is no limit */ - int offset; /* The OFFSET. 0 if there is none */ -}; - -/* -** An instance of the following structure describes the event of a -** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, -** TK_DELETE, or TK_INSTEAD. If the event is of the form -** -** UPDATE ON (a,b,c) -** -** Then the "b" IdList records the list "a,b,c". -*/ -struct TrigEvent { int a; IdList * b; }; - -} // end %include - -// These are extra tokens used by the lexer but never seen by the -// parser. We put them in a rule so that the parser generator will -// add them to the parse.h output file. -// -%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION - COLUMN AGG_FUNCTION. - -// Input is a single SQL command -input ::= cmdlist. -cmdlist ::= cmdlist ecmd. -cmdlist ::= ecmd. -ecmd ::= explain cmdx SEMI. -ecmd ::= SEMI. -cmdx ::= cmd. { sqliteExec(pParse); } -explain ::= EXPLAIN. { sqliteBeginParse(pParse, 1); } -explain ::= . { sqliteBeginParse(pParse, 0); } - -///////////////////// Begin and end transactions. //////////////////////////// -// - -cmd ::= BEGIN trans_opt onconf(R). {sqliteBeginTransaction(pParse,R);} -trans_opt ::= . -trans_opt ::= TRANSACTION. -trans_opt ::= TRANSACTION nm. -cmd ::= COMMIT trans_opt. {sqliteCommitTransaction(pParse);} -cmd ::= END trans_opt. {sqliteCommitTransaction(pParse);} -cmd ::= ROLLBACK trans_opt. {sqliteRollbackTransaction(pParse);} - -///////////////////// The CREATE TABLE statement //////////////////////////// -// -cmd ::= create_table create_table_args. -create_table ::= CREATE(X) temp(T) TABLE nm(Y). { - sqliteStartTable(pParse,&X,&Y,T,0); -} -%type temp {int} -temp(A) ::= TEMP. {A = 1;} -temp(A) ::= . {A = 0;} -create_table_args ::= LP columnlist conslist_opt RP(X). { - sqliteEndTable(pParse,&X,0); -} -create_table_args ::= AS select(S). { - sqliteEndTable(pParse,0,S); - sqliteSelectDelete(S); -} -columnlist ::= columnlist COMMA column. -columnlist ::= column. - -// About the only information used for a column is the name of the -// column. The type is always just "text". But the code will accept -// an elaborate typename. Perhaps someday we'll do something with it. -// -column ::= columnid type carglist. -columnid ::= nm(X). {sqliteAddColumn(pParse,&X);} - -// An IDENTIFIER can be a generic identifier, or one of several -// keywords. Any non-standard keyword can also be an identifier. -// -%type id {Token} -id(A) ::= ID(X). {A = X;} - -// The following directive causes tokens ABORT, AFTER, ASC, etc. to -// fallback to ID if they will not parse as their original value. -// This obviates the need for the "id" nonterminal. -// -%fallback ID - ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT - COPY DATABASE DEFERRED DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR - GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH KEY - OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT - TEMP TRIGGER VACUUM VIEW. - -// Define operator precedence early so that this is the first occurance -// of the operator tokens in the grammer. Keeping the operators together -// causes them to be assigned integer values that are close together, -// which keeps parser tables smaller. -// -%left OR. -%left AND. -%right NOT. -%left EQ NE ISNULL NOTNULL IS LIKE GLOB BETWEEN IN. -%left GT GE LT LE. -%left BITAND BITOR LSHIFT RSHIFT. -%left PLUS MINUS. -%left STAR SLASH REM. -%left CONCAT. -%right UMINUS UPLUS BITNOT. - -// And "ids" is an identifer-or-string. -// -%type ids {Token} -ids(A) ::= ID(X). {A = X;} -ids(A) ::= STRING(X). {A = X;} - -// The name of a column or table can be any of the following: -// -%type nm {Token} -nm(A) ::= ID(X). {A = X;} -nm(A) ::= STRING(X). {A = X;} -nm(A) ::= JOIN_KW(X). {A = X;} - -type ::= . -type ::= typename(X). {sqliteAddColumnType(pParse,&X,&X);} -type ::= typename(X) LP signed RP(Y). {sqliteAddColumnType(pParse,&X,&Y);} -type ::= typename(X) LP signed COMMA signed RP(Y). - {sqliteAddColumnType(pParse,&X,&Y);} -%type typename {Token} -typename(A) ::= ids(X). {A = X;} -typename(A) ::= typename(X) ids. {A = X;} -%type signed {int} -signed(A) ::= INTEGER(X). { A = atoi(X.z); } -signed(A) ::= PLUS INTEGER(X). { A = atoi(X.z); } -signed(A) ::= MINUS INTEGER(X). { A = -atoi(X.z); } -carglist ::= carglist carg. -carglist ::= . -carg ::= CONSTRAINT nm ccons. -carg ::= ccons. -carg ::= DEFAULT STRING(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT ID(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT INTEGER(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT PLUS INTEGER(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT MINUS INTEGER(X). {sqliteAddDefaultValue(pParse,&X,1);} -carg ::= DEFAULT FLOAT(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT PLUS FLOAT(X). {sqliteAddDefaultValue(pParse,&X,0);} -carg ::= DEFAULT MINUS FLOAT(X). {sqliteAddDefaultValue(pParse,&X,1);} -carg ::= DEFAULT NULL. - -// In addition to the type name, we also care about the primary key and -// UNIQUE constraints. -// -ccons ::= NULL onconf. -ccons ::= NOT NULL onconf(R). {sqliteAddNotNull(pParse, R);} -ccons ::= PRIMARY KEY sortorder onconf(R). {sqliteAddPrimaryKey(pParse,0,R);} -ccons ::= UNIQUE onconf(R). {sqliteCreateIndex(pParse,0,0,0,R,0,0);} -ccons ::= CHECK LP expr RP onconf. -ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R). - {sqliteCreateForeignKey(pParse,0,&T,TA,R);} -ccons ::= defer_subclause(D). {sqliteDeferForeignKey(pParse,D);} -ccons ::= COLLATE id(C). { - sqliteAddCollateType(pParse, sqliteCollateType(C.z, C.n)); -} - -// The next group of rules parses the arguments to a REFERENCES clause -// that determine if the referential integrity checking is deferred or -// or immediate and which determine what action to take if a ref-integ -// check fails. -// -%type refargs {int} -refargs(A) ::= . { A = OE_Restrict * 0x010101; } -refargs(A) ::= refargs(X) refarg(Y). { A = (X & Y.mask) | Y.value; } -%type refarg {struct {int value; int mask;}} -refarg(A) ::= MATCH nm. { A.value = 0; A.mask = 0x000000; } -refarg(A) ::= ON DELETE refact(X). { A.value = X; A.mask = 0x0000ff; } -refarg(A) ::= ON UPDATE refact(X). { A.value = X<<8; A.mask = 0x00ff00; } -refarg(A) ::= ON INSERT refact(X). { A.value = X<<16; A.mask = 0xff0000; } -%type refact {int} -refact(A) ::= SET NULL. { A = OE_SetNull; } -refact(A) ::= SET DEFAULT. { A = OE_SetDflt; } -refact(A) ::= CASCADE. { A = OE_Cascade; } -refact(A) ::= RESTRICT. { A = OE_Restrict; } -%type defer_subclause {int} -defer_subclause(A) ::= NOT DEFERRABLE init_deferred_pred_opt(X). {A = X;} -defer_subclause(A) ::= DEFERRABLE init_deferred_pred_opt(X). {A = X;} -%type init_deferred_pred_opt {int} -init_deferred_pred_opt(A) ::= . {A = 0;} -init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;} -init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;} - -// For the time being, the only constraint we care about is the primary -// key and UNIQUE. Both create indices. -// -conslist_opt ::= . -conslist_opt ::= COMMA conslist. -conslist ::= conslist COMMA tcons. -conslist ::= conslist tcons. -conslist ::= tcons. -tcons ::= CONSTRAINT nm. -tcons ::= PRIMARY KEY LP idxlist(X) RP onconf(R). - {sqliteAddPrimaryKey(pParse,X,R);} -tcons ::= UNIQUE LP idxlist(X) RP onconf(R). - {sqliteCreateIndex(pParse,0,0,X,R,0,0);} -tcons ::= CHECK expr onconf. -tcons ::= FOREIGN KEY LP idxlist(FA) RP - REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). { - sqliteCreateForeignKey(pParse, FA, &T, TA, R); - sqliteDeferForeignKey(pParse, D); -} -%type defer_subclause_opt {int} -defer_subclause_opt(A) ::= . {A = 0;} -defer_subclause_opt(A) ::= defer_subclause(X). {A = X;} - -// The following is a non-standard extension that allows us to declare the -// default behavior when there is a constraint conflict. -// -%type onconf {int} -%type orconf {int} -%type resolvetype {int} -onconf(A) ::= . { A = OE_Default; } -onconf(A) ::= ON CONFLICT resolvetype(X). { A = X; } -orconf(A) ::= . { A = OE_Default; } -orconf(A) ::= OR resolvetype(X). { A = X; } -resolvetype(A) ::= ROLLBACK. { A = OE_Rollback; } -resolvetype(A) ::= ABORT. { A = OE_Abort; } -resolvetype(A) ::= FAIL. { A = OE_Fail; } -resolvetype(A) ::= IGNORE. { A = OE_Ignore; } -resolvetype(A) ::= REPLACE. { A = OE_Replace; } - -////////////////////////// The DROP TABLE ///////////////////////////////////// -// -cmd ::= DROP TABLE nm(X). {sqliteDropTable(pParse,&X,0);} - -///////////////////// The CREATE VIEW statement ///////////////////////////// -// -cmd ::= CREATE(X) temp(T) VIEW nm(Y) AS select(S). { - sqliteCreateView(pParse, &X, &Y, S, T); -} -cmd ::= DROP VIEW nm(X). { - sqliteDropTable(pParse, &X, 1); -} - -//////////////////////// The SELECT statement ///////////////////////////////// -// -cmd ::= select(X). { - sqliteSelect(pParse, X, SRT_Callback, 0, 0, 0, 0); - sqliteSelectDelete(X); -} - -%type select {Select*} -%destructor select {sqliteSelectDelete($$);} -%type oneselect {Select*} -%destructor oneselect {sqliteSelectDelete($$);} - -select(A) ::= oneselect(X). {A = X;} -select(A) ::= select(X) multiselect_op(Y) oneselect(Z). { - if( Z ){ - Z->op = Y; - Z->pPrior = X; - } - A = Z; -} -%type multiselect_op {int} -multiselect_op(A) ::= UNION. {A = TK_UNION;} -multiselect_op(A) ::= UNION ALL. {A = TK_ALL;} -multiselect_op(A) ::= INTERSECT. {A = TK_INTERSECT;} -multiselect_op(A) ::= EXCEPT. {A = TK_EXCEPT;} -oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y) - groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). { - A = sqliteSelectNew(W,X,Y,P,Q,Z,D,L.limit,L.offset); -} - -// The "distinct" nonterminal is true (1) if the DISTINCT keyword is -// present and false (0) if it is not. -// -%type distinct {int} -distinct(A) ::= DISTINCT. {A = 1;} -distinct(A) ::= ALL. {A = 0;} -distinct(A) ::= . {A = 0;} - -// selcollist is a list of expressions that are to become the return -// values of the SELECT statement. The "*" in statements like -// "SELECT * FROM ..." is encoded as a special expression with an -// opcode of TK_ALL. -// -%type selcollist {ExprList*} -%destructor selcollist {sqliteExprListDelete($$);} -%type sclp {ExprList*} -%destructor sclp {sqliteExprListDelete($$);} -sclp(A) ::= selcollist(X) COMMA. {A = X;} -sclp(A) ::= . {A = 0;} -selcollist(A) ::= sclp(P) expr(X) as(Y). { - A = sqliteExprListAppend(P,X,Y.n?&Y:0); -} -selcollist(A) ::= sclp(P) STAR. { - A = sqliteExprListAppend(P, sqliteExpr(TK_ALL, 0, 0, 0), 0); -} -selcollist(A) ::= sclp(P) nm(X) DOT STAR. { - Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0); - Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &X); - A = sqliteExprListAppend(P, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0); -} - -// An option "AS " phrase that can follow one of the expressions that -// define the result set, or one of the tables in the FROM clause. -// -%type as {Token} -as(X) ::= AS nm(Y). { X = Y; } -as(X) ::= ids(Y). { X = Y; } -as(X) ::= . { X.n = 0; } - - -%type seltablist {SrcList*} -%destructor seltablist {sqliteSrcListDelete($$);} -%type stl_prefix {SrcList*} -%destructor stl_prefix {sqliteSrcListDelete($$);} -%type from {SrcList*} -%destructor from {sqliteSrcListDelete($$);} - -// A complete FROM clause. -// -from(A) ::= . {A = sqliteMalloc(sizeof(*A));} -from(A) ::= FROM seltablist(X). {A = X;} - -// "seltablist" is a "Select Table List" - the content of the FROM clause -// in a SELECT statement. "stl_prefix" is a prefix of this list. -// -stl_prefix(A) ::= seltablist(X) joinop(Y). { - A = X; - if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = Y; -} -stl_prefix(A) ::= . {A = 0;} -seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). { - A = sqliteSrcListAppend(X,&Y,&D); - if( Z.n ) sqliteSrcListAddAlias(A,&Z); - if( N ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } - else { sqliteExprDelete(N); } - } - if( U ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } - else { sqliteIdListDelete(U); } - } -} -seltablist(A) ::= stl_prefix(X) LP seltablist_paren(S) RP - as(Z) on_opt(N) using_opt(U). { - A = sqliteSrcListAppend(X,0,0); - A->a[A->nSrc-1].pSelect = S; - if( Z.n ) sqliteSrcListAddAlias(A,&Z); - if( N ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; } - else { sqliteExprDelete(N); } - } - if( U ){ - if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; } - else { sqliteIdListDelete(U); } - } -} - -// A seltablist_paren nonterminal represents anything in a FROM that -// is contained inside parentheses. This can be either a subquery or -// a grouping of table and subqueries. -// -%type seltablist_paren {Select*} -%destructor seltablist_paren {sqliteSelectDelete($$);} -seltablist_paren(A) ::= select(S). {A = S;} -seltablist_paren(A) ::= seltablist(F). { - A = sqliteSelectNew(0,F,0,0,0,0,0,-1,0); -} - -%type dbnm {Token} -dbnm(A) ::= . {A.z=0; A.n=0;} -dbnm(A) ::= DOT nm(X). {A = X;} - -%type joinop {int} -%type joinop2 {int} -joinop(X) ::= COMMA. { X = JT_INNER; } -joinop(X) ::= JOIN. { X = JT_INNER; } -joinop(X) ::= JOIN_KW(A) JOIN. { X = sqliteJoinType(pParse,&A,0,0); } -joinop(X) ::= JOIN_KW(A) nm(B) JOIN. { X = sqliteJoinType(pParse,&A,&B,0); } -joinop(X) ::= JOIN_KW(A) nm(B) nm(C) JOIN. - { X = sqliteJoinType(pParse,&A,&B,&C); } - -%type on_opt {Expr*} -%destructor on_opt {sqliteExprDelete($$);} -on_opt(N) ::= ON expr(E). {N = E;} -on_opt(N) ::= . {N = 0;} - -%type using_opt {IdList*} -%destructor using_opt {sqliteIdListDelete($$);} -using_opt(U) ::= USING LP idxlist(L) RP. {U = L;} -using_opt(U) ::= . {U = 0;} - - -%type orderby_opt {ExprList*} -%destructor orderby_opt {sqliteExprListDelete($$);} -%type sortlist {ExprList*} -%destructor sortlist {sqliteExprListDelete($$);} -%type sortitem {Expr*} -%destructor sortitem {sqliteExprDelete($$);} - -orderby_opt(A) ::= . {A = 0;} -orderby_opt(A) ::= ORDER BY sortlist(X). {A = X;} -sortlist(A) ::= sortlist(X) COMMA sortitem(Y) collate(C) sortorder(Z). { - A = sqliteExprListAppend(X,Y,0); - if( A ) A->a[A->nExpr-1].sortOrder = C+Z; -} -sortlist(A) ::= sortitem(Y) collate(C) sortorder(Z). { - A = sqliteExprListAppend(0,Y,0); - if( A ) A->a[0].sortOrder = C+Z; -} -sortitem(A) ::= expr(X). {A = X;} - -%type sortorder {int} -%type collate {int} - -sortorder(A) ::= ASC. {A = SQLITE_SO_ASC;} -sortorder(A) ::= DESC. {A = SQLITE_SO_DESC;} -sortorder(A) ::= . {A = SQLITE_SO_ASC;} -collate(C) ::= . {C = SQLITE_SO_UNK;} -collate(C) ::= COLLATE id(X). {C = sqliteCollateType(X.z, X.n);} - -%type groupby_opt {ExprList*} -%destructor groupby_opt {sqliteExprListDelete($$);} -groupby_opt(A) ::= . {A = 0;} -groupby_opt(A) ::= GROUP BY exprlist(X). {A = X;} - -%type having_opt {Expr*} -%destructor having_opt {sqliteExprDelete($$);} -having_opt(A) ::= . {A = 0;} -having_opt(A) ::= HAVING expr(X). {A = X;} - -%type limit_opt {struct LimitVal} -limit_opt(A) ::= . {A.limit = -1; A.offset = 0;} -limit_opt(A) ::= LIMIT signed(X). {A.limit = X; A.offset = 0;} -limit_opt(A) ::= LIMIT signed(X) OFFSET signed(Y). - {A.limit = X; A.offset = Y;} -limit_opt(A) ::= LIMIT signed(X) COMMA signed(Y). - {A.limit = Y; A.offset = X;} - -/////////////////////////// The DELETE statement ///////////////////////////// -// -cmd ::= DELETE FROM nm(X) dbnm(D) where_opt(Y). { - sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&X,&D), Y); -} - -%type where_opt {Expr*} -%destructor where_opt {sqliteExprDelete($$);} - -where_opt(A) ::= . {A = 0;} -where_opt(A) ::= WHERE expr(X). {A = X;} - -%type setlist {ExprList*} -%destructor setlist {sqliteExprListDelete($$);} - -////////////////////////// The UPDATE command //////////////////////////////// -// -cmd ::= UPDATE orconf(R) nm(X) dbnm(D) SET setlist(Y) where_opt(Z). - {sqliteUpdate(pParse,sqliteSrcListAppend(0,&X,&D),Y,Z,R);} - -setlist(A) ::= setlist(Z) COMMA nm(X) EQ expr(Y). - {A = sqliteExprListAppend(Z,Y,&X);} -setlist(A) ::= nm(X) EQ expr(Y). {A = sqliteExprListAppend(0,Y,&X);} - -////////////////////////// The INSERT command ///////////////////////////////// -// -cmd ::= insert_cmd(R) INTO nm(X) dbnm(D) inscollist_opt(F) - VALUES LP itemlist(Y) RP. - {sqliteInsert(pParse, sqliteSrcListAppend(0,&X,&D), Y, 0, F, R);} -cmd ::= insert_cmd(R) INTO nm(X) dbnm(D) inscollist_opt(F) select(S). - {sqliteInsert(pParse, sqliteSrcListAppend(0,&X,&D), 0, S, F, R);} - -%type insert_cmd {int} -insert_cmd(A) ::= INSERT orconf(R). {A = R;} -insert_cmd(A) ::= REPLACE. {A = OE_Replace;} - - -%type itemlist {ExprList*} -%destructor itemlist {sqliteExprListDelete($$);} - -itemlist(A) ::= itemlist(X) COMMA expr(Y). {A = sqliteExprListAppend(X,Y,0);} -itemlist(A) ::= expr(X). {A = sqliteExprListAppend(0,X,0);} - -%type inscollist_opt {IdList*} -%destructor inscollist_opt {sqliteIdListDelete($$);} -%type inscollist {IdList*} -%destructor inscollist {sqliteIdListDelete($$);} - -inscollist_opt(A) ::= . {A = 0;} -inscollist_opt(A) ::= LP inscollist(X) RP. {A = X;} -inscollist(A) ::= inscollist(X) COMMA nm(Y). {A = sqliteIdListAppend(X,&Y);} -inscollist(A) ::= nm(Y). {A = sqliteIdListAppend(0,&Y);} - -/////////////////////////// Expression Processing ///////////////////////////// -// - -%type expr {Expr*} -%destructor expr {sqliteExprDelete($$);} - -expr(A) ::= LP(B) expr(X) RP(E). {A = X; sqliteExprSpan(A,&B,&E); } -expr(A) ::= NULL(X). {A = sqliteExpr(TK_NULL, 0, 0, &X);} -expr(A) ::= ID(X). {A = sqliteExpr(TK_ID, 0, 0, &X);} -expr(A) ::= JOIN_KW(X). {A = sqliteExpr(TK_ID, 0, 0, &X);} -expr(A) ::= nm(X) DOT nm(Y). { - Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X); - Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y); - A = sqliteExpr(TK_DOT, temp1, temp2, 0); -} -expr(A) ::= nm(X) DOT nm(Y) DOT nm(Z). { - Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X); - Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y); - Expr *temp3 = sqliteExpr(TK_ID, 0, 0, &Z); - Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); - A = sqliteExpr(TK_DOT, temp1, temp4, 0); -} -expr(A) ::= INTEGER(X). {A = sqliteExpr(TK_INTEGER, 0, 0, &X);} -expr(A) ::= FLOAT(X). {A = sqliteExpr(TK_FLOAT, 0, 0, &X);} -expr(A) ::= STRING(X). {A = sqliteExpr(TK_STRING, 0, 0, &X);} -expr(A) ::= VARIABLE(X). { - A = sqliteExpr(TK_VARIABLE, 0, 0, &X); - if( A ) A->iTable = ++pParse->nVar; -} -expr(A) ::= ID(X) LP exprlist(Y) RP(E). { - A = sqliteExprFunction(Y, &X); - sqliteExprSpan(A,&X,&E); -} -expr(A) ::= ID(X) LP STAR RP(E). { - A = sqliteExprFunction(0, &X); - sqliteExprSpan(A,&X,&E); -} -expr(A) ::= expr(X) AND expr(Y). {A = sqliteExpr(TK_AND, X, Y, 0);} -expr(A) ::= expr(X) OR expr(Y). {A = sqliteExpr(TK_OR, X, Y, 0);} -expr(A) ::= expr(X) LT expr(Y). {A = sqliteExpr(TK_LT, X, Y, 0);} -expr(A) ::= expr(X) GT expr(Y). {A = sqliteExpr(TK_GT, X, Y, 0);} -expr(A) ::= expr(X) LE expr(Y). {A = sqliteExpr(TK_LE, X, Y, 0);} -expr(A) ::= expr(X) GE expr(Y). {A = sqliteExpr(TK_GE, X, Y, 0);} -expr(A) ::= expr(X) NE expr(Y). {A = sqliteExpr(TK_NE, X, Y, 0);} -expr(A) ::= expr(X) EQ expr(Y). {A = sqliteExpr(TK_EQ, X, Y, 0);} -expr(A) ::= expr(X) BITAND expr(Y). {A = sqliteExpr(TK_BITAND, X, Y, 0);} -expr(A) ::= expr(X) BITOR expr(Y). {A = sqliteExpr(TK_BITOR, X, Y, 0);} -expr(A) ::= expr(X) LSHIFT expr(Y). {A = sqliteExpr(TK_LSHIFT, X, Y, 0);} -expr(A) ::= expr(X) RSHIFT expr(Y). {A = sqliteExpr(TK_RSHIFT, X, Y, 0);} -expr(A) ::= expr(X) likeop(OP) expr(Y). [LIKE] { - ExprList *pList = sqliteExprListAppend(0, Y, 0); - pList = sqliteExprListAppend(pList, X, 0); - A = sqliteExprFunction(pList, 0); - if( A ) A->op = OP; - sqliteExprSpan(A, &X->span, &Y->span); -} -expr(A) ::= expr(X) NOT likeop(OP) expr(Y). [LIKE] { - ExprList *pList = sqliteExprListAppend(0, Y, 0); - pList = sqliteExprListAppend(pList, X, 0); - A = sqliteExprFunction(pList, 0); - if( A ) A->op = OP; - A = sqliteExpr(TK_NOT, A, 0, 0); - sqliteExprSpan(A,&X->span,&Y->span); -} -%type likeop {int} -likeop(A) ::= LIKE. {A = TK_LIKE;} -likeop(A) ::= GLOB. {A = TK_GLOB;} -expr(A) ::= expr(X) PLUS expr(Y). {A = sqliteExpr(TK_PLUS, X, Y, 0);} -expr(A) ::= expr(X) MINUS expr(Y). {A = sqliteExpr(TK_MINUS, X, Y, 0);} -expr(A) ::= expr(X) STAR expr(Y). {A = sqliteExpr(TK_STAR, X, Y, 0);} -expr(A) ::= expr(X) SLASH expr(Y). {A = sqliteExpr(TK_SLASH, X, Y, 0);} -expr(A) ::= expr(X) REM expr(Y). {A = sqliteExpr(TK_REM, X, Y, 0);} -expr(A) ::= expr(X) CONCAT expr(Y). {A = sqliteExpr(TK_CONCAT, X, Y, 0);} -expr(A) ::= expr(X) ISNULL(E). { - A = sqliteExpr(TK_ISNULL, X, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IS NULL(E). { - A = sqliteExpr(TK_ISNULL, X, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOTNULL(E). { - A = sqliteExpr(TK_NOTNULL, X, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOT NULL(E). { - A = sqliteExpr(TK_NOTNULL, X, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IS NOT NULL(E). { - A = sqliteExpr(TK_NOTNULL, X, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= NOT(B) expr(X). { - A = sqliteExpr(TK_NOT, X, 0, 0); - sqliteExprSpan(A,&B,&X->span); -} -expr(A) ::= BITNOT(B) expr(X). { - A = sqliteExpr(TK_BITNOT, X, 0, 0); - sqliteExprSpan(A,&B,&X->span); -} -expr(A) ::= MINUS(B) expr(X). [UMINUS] { - A = sqliteExpr(TK_UMINUS, X, 0, 0); - sqliteExprSpan(A,&B,&X->span); -} -expr(A) ::= PLUS(B) expr(X). [UPLUS] { - A = sqliteExpr(TK_UPLUS, X, 0, 0); - sqliteExprSpan(A,&B,&X->span); -} -expr(A) ::= LP(B) select(X) RP(E). { - A = sqliteExpr(TK_SELECT, 0, 0, 0); - if( A ) A->pSelect = X; - sqliteExprSpan(A,&B,&E); -} -expr(A) ::= expr(W) BETWEEN expr(X) AND expr(Y). { - ExprList *pList = sqliteExprListAppend(0, X, 0); - pList = sqliteExprListAppend(pList, Y, 0); - A = sqliteExpr(TK_BETWEEN, W, 0, 0); - if( A ) A->pList = pList; - sqliteExprSpan(A,&W->span,&Y->span); -} -expr(A) ::= expr(W) NOT BETWEEN expr(X) AND expr(Y). { - ExprList *pList = sqliteExprListAppend(0, X, 0); - pList = sqliteExprListAppend(pList, Y, 0); - A = sqliteExpr(TK_BETWEEN, W, 0, 0); - if( A ) A->pList = pList; - A = sqliteExpr(TK_NOT, A, 0, 0); - sqliteExprSpan(A,&W->span,&Y->span); -} -expr(A) ::= expr(X) IN LP exprlist(Y) RP(E). { - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pList = Y; - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IN LP select(Y) RP(E). { - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pSelect = Y; - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOT IN LP exprlist(Y) RP(E). { - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pList = Y; - A = sqliteExpr(TK_NOT, A, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) NOT IN LP select(Y) RP(E). { - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pSelect = Y; - A = sqliteExpr(TK_NOT, A, 0, 0); - sqliteExprSpan(A,&X->span,&E); -} -expr(A) ::= expr(X) IN nm(Y) dbnm(D). { - SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); - sqliteExprSpan(A,&X->span,D.z?&D:&Y); -} -expr(A) ::= expr(X) NOT IN nm(Y) dbnm(D). { - SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); - A = sqliteExpr(TK_IN, X, 0, 0); - if( A ) A->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0); - A = sqliteExpr(TK_NOT, A, 0, 0); - sqliteExprSpan(A,&X->span,D.z?&D:&Y); -} - - -/* CASE expressions */ -expr(A) ::= CASE(C) case_operand(X) case_exprlist(Y) case_else(Z) END(E). { - A = sqliteExpr(TK_CASE, X, Z, 0); - if( A ) A->pList = Y; - sqliteExprSpan(A, &C, &E); -} -%type case_exprlist {ExprList*} -%destructor case_exprlist {sqliteExprListDelete($$);} -case_exprlist(A) ::= case_exprlist(X) WHEN expr(Y) THEN expr(Z). { - A = sqliteExprListAppend(X, Y, 0); - A = sqliteExprListAppend(A, Z, 0); -} -case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). { - A = sqliteExprListAppend(0, Y, 0); - A = sqliteExprListAppend(A, Z, 0); -} -%type case_else {Expr*} -case_else(A) ::= ELSE expr(X). {A = X;} -case_else(A) ::= . {A = 0;} -%type case_operand {Expr*} -case_operand(A) ::= expr(X). {A = X;} -case_operand(A) ::= . {A = 0;} - -%type exprlist {ExprList*} -%destructor exprlist {sqliteExprListDelete($$);} -%type expritem {Expr*} -%destructor expritem {sqliteExprDelete($$);} - -exprlist(A) ::= exprlist(X) COMMA expritem(Y). - {A = sqliteExprListAppend(X,Y,0);} -exprlist(A) ::= expritem(X). {A = sqliteExprListAppend(0,X,0);} -expritem(A) ::= expr(X). {A = X;} -expritem(A) ::= . {A = 0;} - -///////////////////////////// The CREATE INDEX command /////////////////////// -// -cmd ::= CREATE(S) uniqueflag(U) INDEX nm(X) - ON nm(Y) dbnm(D) LP idxlist(Z) RP(E) onconf(R). { - SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); - if( U!=OE_None ) U = R; - if( U==OE_Default) U = OE_Abort; - sqliteCreateIndex(pParse, &X, pSrc, Z, U, &S, &E); -} - -%type uniqueflag {int} -uniqueflag(A) ::= UNIQUE. { A = OE_Abort; } -uniqueflag(A) ::= . { A = OE_None; } - -%type idxlist {IdList*} -%destructor idxlist {sqliteIdListDelete($$);} -%type idxlist_opt {IdList*} -%destructor idxlist_opt {sqliteIdListDelete($$);} -%type idxitem {Token} - -idxlist_opt(A) ::= . {A = 0;} -idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} -idxlist(A) ::= idxlist(X) COMMA idxitem(Y). {A = sqliteIdListAppend(X,&Y);} -idxlist(A) ::= idxitem(Y). {A = sqliteIdListAppend(0,&Y);} -idxitem(A) ::= nm(X) sortorder. {A = X;} - -///////////////////////////// The DROP INDEX command ///////////////////////// -// - -cmd ::= DROP INDEX nm(X) dbnm(Y). { - sqliteDropIndex(pParse, sqliteSrcListAppend(0,&X,&Y)); -} - - -///////////////////////////// The COPY command /////////////////////////////// -// -cmd ::= COPY orconf(R) nm(X) dbnm(D) FROM nm(Y) USING DELIMITERS STRING(Z). - {sqliteCopy(pParse,sqliteSrcListAppend(0,&X,&D),&Y,&Z,R);} -cmd ::= COPY orconf(R) nm(X) dbnm(D) FROM nm(Y). - {sqliteCopy(pParse,sqliteSrcListAppend(0,&X,&D),&Y,0,R);} - -///////////////////////////// The VACUUM command ///////////////////////////// -// -cmd ::= VACUUM. {sqliteVacuum(pParse,0);} -cmd ::= VACUUM nm(X). {sqliteVacuum(pParse,&X);} - -///////////////////////////// The PRAGMA command ///////////////////////////// -// -cmd ::= PRAGMA ids(X) EQ nm(Y). {sqlitePragma(pParse,&X,&Y,0);} -cmd ::= PRAGMA ids(X) EQ ON(Y). {sqlitePragma(pParse,&X,&Y,0);} -cmd ::= PRAGMA ids(X) EQ plus_num(Y). {sqlitePragma(pParse,&X,&Y,0);} -cmd ::= PRAGMA ids(X) EQ minus_num(Y). {sqlitePragma(pParse,&X,&Y,1);} -cmd ::= PRAGMA ids(X) LP nm(Y) RP. {sqlitePragma(pParse,&X,&Y,0);} -cmd ::= PRAGMA ids(X). {sqlitePragma(pParse,&X,&X,0);} -plus_num(A) ::= plus_opt number(X). {A = X;} -minus_num(A) ::= MINUS number(X). {A = X;} -number(A) ::= INTEGER(X). {A = X;} -number(A) ::= FLOAT(X). {A = X;} -plus_opt ::= PLUS. -plus_opt ::= . - -//////////////////////////// The CREATE TRIGGER command ///////////////////// - -cmd ::= CREATE(A) trigger_decl BEGIN trigger_cmd_list(S) END(Z). { - Token all; - all.z = A.z; - all.n = (Z.z - A.z) + Z.n; - sqliteFinishTrigger(pParse, S, &all); -} - -trigger_decl ::= temp(T) TRIGGER nm(B) trigger_time(C) trigger_event(D) - ON nm(E) dbnm(DB) foreach_clause(F) when_clause(G). { - SrcList *pTab = sqliteSrcListAppend(0, &E, &DB); - sqliteBeginTrigger(pParse, &B, C, D.a, D.b, pTab, F, G, T); -} - -%type trigger_time {int} -trigger_time(A) ::= BEFORE. { A = TK_BEFORE; } -trigger_time(A) ::= AFTER. { A = TK_AFTER; } -trigger_time(A) ::= INSTEAD OF. { A = TK_INSTEAD;} -trigger_time(A) ::= . { A = TK_BEFORE; } - -%type trigger_event {struct TrigEvent} -%destructor trigger_event {sqliteIdListDelete($$.b);} -trigger_event(A) ::= DELETE. { A.a = TK_DELETE; A.b = 0; } -trigger_event(A) ::= INSERT. { A.a = TK_INSERT; A.b = 0; } -trigger_event(A) ::= UPDATE. { A.a = TK_UPDATE; A.b = 0;} -trigger_event(A) ::= UPDATE OF inscollist(X). {A.a = TK_UPDATE; A.b = X; } - -%type foreach_clause {int} -foreach_clause(A) ::= . { A = TK_ROW; } -foreach_clause(A) ::= FOR EACH ROW. { A = TK_ROW; } -foreach_clause(A) ::= FOR EACH STATEMENT. { A = TK_STATEMENT; } - -%type when_clause {Expr *} -when_clause(A) ::= . { A = 0; } -when_clause(A) ::= WHEN expr(X). { A = X; } - -%type trigger_cmd_list {TriggerStep *} -%destructor trigger_cmd_list {sqliteDeleteTriggerStep($$);} -trigger_cmd_list(A) ::= trigger_cmd(X) SEMI trigger_cmd_list(Y). { - X->pNext = Y; - A = X; -} -trigger_cmd_list(A) ::= . { A = 0; } - -%type trigger_cmd {TriggerStep *} -%destructor trigger_cmd {sqliteDeleteTriggerStep($$);} -// UPDATE -trigger_cmd(A) ::= UPDATE orconf(R) nm(X) SET setlist(Y) where_opt(Z). - { A = sqliteTriggerUpdateStep(&X, Y, Z, R); } - -// INSERT -trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) - VALUES LP itemlist(Y) RP. -{A = sqliteTriggerInsertStep(&X, F, Y, 0, R);} - -trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) select(S). - {A = sqliteTriggerInsertStep(&X, F, 0, S, R);} - -// DELETE -trigger_cmd(A) ::= DELETE FROM nm(X) where_opt(Y). - {A = sqliteTriggerDeleteStep(&X, Y);} - -// SELECT -trigger_cmd(A) ::= select(X). {A = sqliteTriggerSelectStep(X); } - -// The special RAISE expression that may occur in trigger programs -expr(A) ::= RAISE(X) LP IGNORE RP(Y). { - A = sqliteExpr(TK_RAISE, 0, 0, 0); - A->iColumn = OE_Ignore; - sqliteExprSpan(A, &X, &Y); -} -expr(A) ::= RAISE(X) LP ROLLBACK COMMA nm(Z) RP(Y). { - A = sqliteExpr(TK_RAISE, 0, 0, &Z); - A->iColumn = OE_Rollback; - sqliteExprSpan(A, &X, &Y); -} -expr(A) ::= RAISE(X) LP ABORT COMMA nm(Z) RP(Y). { - A = sqliteExpr(TK_RAISE, 0, 0, &Z); - A->iColumn = OE_Abort; - sqliteExprSpan(A, &X, &Y); -} -expr(A) ::= RAISE(X) LP FAIL COMMA nm(Z) RP(Y). { - A = sqliteExpr(TK_RAISE, 0, 0, &Z); - A->iColumn = OE_Fail; - sqliteExprSpan(A, &X, &Y); -} - -//////////////////////// DROP TRIGGER statement ////////////////////////////// -cmd ::= DROP TRIGGER nm(X) dbnm(D). { - sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&X,&D)); -} - -//////////////////////// ATTACH DATABASE file AS name ///////////////////////// -cmd ::= ATTACH database_kw_opt ids(F) AS nm(D) key_opt(K). { - sqliteAttach(pParse, &F, &D, &K); -} -%type key_opt {Token} -key_opt(A) ::= USING ids(X). { A = X; } -key_opt(A) ::= . { A.z = 0; A.n = 0; } - -database_kw_opt ::= DATABASE. -database_kw_opt ::= . - -//////////////////////// DETACH DATABASE name ///////////////////////////////// -cmd ::= DETACH database_kw_opt nm(D). { - sqliteDetach(pParse, &D); -} diff --git a/ext/sqlite/libsqlite/src/pragma.c b/ext/sqlite/libsqlite/src/pragma.c deleted file mode 100644 index 965dbb9da65c2..0000000000000 --- a/ext/sqlite/libsqlite/src/pragma.c +++ /dev/null @@ -1,712 +0,0 @@ -/* -** 2003 April 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to implement the PRAGMA command. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include - -/* -** Interpret the given string as a boolean value. -*/ -static int getBoolean(const char *z){ - static char *azTrue[] = { "yes", "on", "true" }; - int i; - if( z[0]==0 ) return 0; - if( isdigit(z[0]) || (z[0]=='-' && isdigit(z[1])) ){ - return atoi(z); - } - for(i=0; i='0' && z[0]<='2' ){ - return z[0] - '0'; - }else if( sqliteStrICmp(z, "file")==0 ){ - return 1; - }else if( sqliteStrICmp(z, "memory")==0 ){ - return 2; - }else{ - return 0; - } -} - -/* -** If the TEMP database is open, close it and mark the database schema -** as needing reloading. This must be done when using the TEMP_STORE -** or DEFAULT_TEMP_STORE pragmas. -*/ -static int changeTempStorage(Parse *pParse, const char *zStorageType){ - int ts = getTempStore(zStorageType); - sqlite *db = pParse->db; - if( db->temp_store==ts ) return SQLITE_OK; - if( db->aDb[1].pBt!=0 ){ - if( db->flags & SQLITE_InTrans ){ - sqliteErrorMsg(pParse, "temporary storage cannot be changed " - "from within a transaction"); - return SQLITE_ERROR; - } - sqliteBtreeClose(db->aDb[1].pBt); - db->aDb[1].pBt = 0; - sqliteResetInternalSchema(db, 0); - } - db->temp_store = ts; - return SQLITE_OK; -} - -/* -** Check to see if zRight and zLeft refer to a pragma that queries -** or changes one of the flags in db->flags. Return 1 if so and 0 if not. -** Also, implement the pragma. -*/ -static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ - static const struct { - const char *zName; /* Name of the pragma */ - int mask; /* Mask for the db->flags value */ - } aPragma[] = { - { "vdbe_trace", SQLITE_VdbeTrace }, - { "full_column_names", SQLITE_FullColNames }, - { "short_column_names", SQLITE_ShortColNames }, - { "show_datatypes", SQLITE_ReportTypes }, - { "count_changes", SQLITE_CountRows }, - { "empty_result_callbacks", SQLITE_NullCallback }, - }; - int i; - for(i=0; idb; - Vdbe *v; - if( strcmp(zLeft,zRight)==0 && (v = sqliteGetVdbe(pParse))!=0 ){ - sqliteVdbeOp3(v, OP_ColumnName, 0, 1, aPragma[i].zName, P3_STATIC); - sqliteVdbeOp3(v, OP_ColumnName, 1, 0, "boolean", P3_STATIC); - sqliteVdbeCode(v, OP_Integer, (db->flags & aPragma[i].mask)!=0, 0, - OP_Callback, 1, 0, - 0); - }else if( getBoolean(zRight) ){ - db->flags |= aPragma[i].mask; - }else{ - db->flags &= ~aPragma[i].mask; - } - return 1; - } - } - return 0; -} - -/* -** Process a pragma statement. -** -** Pragmas are of this form: -** -** PRAGMA id = value -** -** The identifier might also be a string. The value is a string, and -** identifier, or a number. If minusFlag is true, then the value is -** a number that was preceded by a minus sign. -*/ -void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ - char *zLeft = 0; - char *zRight = 0; - sqlite *db = pParse->db; - Vdbe *v = sqliteGetVdbe(pParse); - if( v==0 ) return; - - zLeft = sqliteStrNDup(pLeft->z, pLeft->n); - sqliteDequote(zLeft); - if( minusFlag ){ - zRight = 0; - sqliteSetNString(&zRight, "-", 1, pRight->z, pRight->n, 0); - }else{ - zRight = sqliteStrNDup(pRight->z, pRight->n); - sqliteDequote(zRight); - } - if( sqliteAuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, 0) ){ - sqliteFree(zLeft); - sqliteFree(zRight); - return; - } - - /* - ** PRAGMA default_cache_size - ** PRAGMA default_cache_size=N - ** - ** The first form reports the current persistent setting for the - ** page cache size. The value returned is the maximum number of - ** pages in the page cache. The second form sets both the current - ** page cache size value and the persistent page cache size value - ** stored in the database file. - ** - ** The default cache size is stored in meta-value 2 of page 1 of the - ** database file. The cache size is actually the absolute value of - ** this memory location. The sign of meta-value 2 determines the - ** synchronous setting. A negative value means synchronous is off - ** and a positive value means synchronous is on. - */ - if( sqliteStrICmp(zLeft,"default_cache_size")==0 ){ - static VdbeOpList getCacheSize[] = { - { OP_ReadCookie, 0, 2, 0}, - { OP_AbsValue, 0, 0, 0}, - { OP_Dup, 0, 0, 0}, - { OP_Integer, 0, 0, 0}, - { OP_Ne, 0, 6, 0}, - { OP_Integer, 0, 0, 0}, /* 5 */ - { OP_ColumnName, 0, 1, "cache_size"}, - { OP_Callback, 1, 0, 0}, - }; - int addr; - if( pRight->z==pLeft->z ){ - addr = sqliteVdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); - sqliteVdbeChangeP1(v, addr+5, MAX_PAGES); - }else{ - int size = atoi(zRight); - if( size<0 ) size = -size; - sqliteBeginWriteOperation(pParse, 0, 0); - sqliteVdbeAddOp(v, OP_Integer, size, 0); - sqliteVdbeAddOp(v, OP_ReadCookie, 0, 2); - addr = sqliteVdbeAddOp(v, OP_Integer, 0, 0); - sqliteVdbeAddOp(v, OP_Ge, 0, addr+3); - sqliteVdbeAddOp(v, OP_Negative, 0, 0); - sqliteVdbeAddOp(v, OP_SetCookie, 0, 2); - sqliteEndWriteOperation(pParse); - db->cache_size = db->cache_size<0 ? -size : size; - sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); - } - }else - - /* - ** PRAGMA cache_size - ** PRAGMA cache_size=N - ** - ** The first form reports the current local setting for the - ** page cache size. The local setting can be different from - ** the persistent cache size value that is stored in the database - ** file itself. The value returned is the maximum number of - ** pages in the page cache. The second form sets the local - ** page cache size value. It does not change the persistent - ** cache size stored on the disk so the cache size will revert - ** to its default value when the database is closed and reopened. - ** N should be a positive integer. - */ - if( sqliteStrICmp(zLeft,"cache_size")==0 ){ - static VdbeOpList getCacheSize[] = { - { OP_ColumnName, 0, 1, "cache_size"}, - { OP_Callback, 1, 0, 0}, - }; - if( pRight->z==pLeft->z ){ - int size = db->cache_size;; - if( size<0 ) size = -size; - sqliteVdbeAddOp(v, OP_Integer, size, 0); - sqliteVdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); - }else{ - int size = atoi(zRight); - if( size<0 ) size = -size; - if( db->cache_size<0 ) size = -size; - db->cache_size = size; - sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); - } - }else - - /* - ** PRAGMA default_synchronous - ** PRAGMA default_synchronous=ON|OFF|NORMAL|FULL - ** - ** The first form returns the persistent value of the "synchronous" setting - ** that is stored in the database. This is the synchronous setting that - ** is used whenever the database is opened unless overridden by a separate - ** "synchronous" pragma. The second form changes the persistent and the - ** local synchronous setting to the value given. - ** - ** If synchronous is OFF, SQLite does not attempt any fsync() systems calls - ** to make sure data is committed to disk. Write operations are very fast, - ** but a power failure can leave the database in an inconsistent state. - ** If synchronous is ON or NORMAL, SQLite will do an fsync() system call to - ** make sure data is being written to disk. The risk of corruption due to - ** a power loss in this mode is negligible but non-zero. If synchronous - ** is FULL, extra fsync()s occur to reduce the risk of corruption to near - ** zero, but with a write performance penalty. The default mode is NORMAL. - */ - if( sqliteStrICmp(zLeft,"default_synchronous")==0 ){ - static VdbeOpList getSync[] = { - { OP_ColumnName, 0, 1, "synchronous"}, - { OP_ReadCookie, 0, 3, 0}, - { OP_Dup, 0, 0, 0}, - { OP_If, 0, 0, 0}, /* 3 */ - { OP_ReadCookie, 0, 2, 0}, - { OP_Integer, 0, 0, 0}, - { OP_Lt, 0, 5, 0}, - { OP_AddImm, 1, 0, 0}, - { OP_Callback, 1, 0, 0}, - { OP_Halt, 0, 0, 0}, - { OP_AddImm, -1, 0, 0}, /* 10 */ - { OP_Callback, 1, 0, 0} - }; - if( pRight->z==pLeft->z ){ - int addr = sqliteVdbeAddOpList(v, ArraySize(getSync), getSync); - sqliteVdbeChangeP2(v, addr+3, addr+10); - }else{ - int addr; - int size = db->cache_size; - if( size<0 ) size = -size; - sqliteBeginWriteOperation(pParse, 0, 0); - sqliteVdbeAddOp(v, OP_ReadCookie, 0, 2); - sqliteVdbeAddOp(v, OP_Dup, 0, 0); - addr = sqliteVdbeAddOp(v, OP_Integer, 0, 0); - sqliteVdbeAddOp(v, OP_Ne, 0, addr+3); - sqliteVdbeAddOp(v, OP_AddImm, MAX_PAGES, 0); - sqliteVdbeAddOp(v, OP_AbsValue, 0, 0); - db->safety_level = getSafetyLevel(zRight)+1; - if( db->safety_level==1 ){ - sqliteVdbeAddOp(v, OP_Negative, 0, 0); - size = -size; - } - sqliteVdbeAddOp(v, OP_SetCookie, 0, 2); - sqliteVdbeAddOp(v, OP_Integer, db->safety_level, 0); - sqliteVdbeAddOp(v, OP_SetCookie, 0, 3); - sqliteEndWriteOperation(pParse); - db->cache_size = size; - sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); - sqliteBtreeSetSafetyLevel(db->aDb[0].pBt, db->safety_level); - } - }else - - /* - ** PRAGMA synchronous - ** PRAGMA synchronous=OFF|ON|NORMAL|FULL - ** - ** Return or set the local value of the synchronous flag. Changing - ** the local value does not make changes to the disk file and the - ** default value will be restored the next time the database is - ** opened. - */ - if( sqliteStrICmp(zLeft,"synchronous")==0 ){ - static VdbeOpList getSync[] = { - { OP_ColumnName, 0, 1, "synchronous"}, - { OP_Callback, 1, 0, 0}, - }; - if( pRight->z==pLeft->z ){ - sqliteVdbeAddOp(v, OP_Integer, db->safety_level-1, 0); - sqliteVdbeAddOpList(v, ArraySize(getSync), getSync); - }else{ - int size = db->cache_size; - if( size<0 ) size = -size; - db->safety_level = getSafetyLevel(zRight)+1; - if( db->safety_level==1 ) size = -size; - db->cache_size = size; - sqliteBtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); - sqliteBtreeSetSafetyLevel(db->aDb[0].pBt, db->safety_level); - } - }else - -#ifndef NDEBUG - if( sqliteStrICmp(zLeft, "trigger_overhead_test")==0 ){ - if( getBoolean(zRight) ){ - always_code_trigger_setup = 1; - }else{ - always_code_trigger_setup = 0; - } - }else -#endif - - if( flagPragma(pParse, zLeft, zRight) ){ - /* The flagPragma() call also generates any necessary code */ - }else - - if( sqliteStrICmp(zLeft, "table_info")==0 ){ - Table *pTab; - pTab = sqliteFindTable(db, zRight, 0); - if( pTab ){ - static VdbeOpList tableInfoPreface[] = { - { OP_ColumnName, 0, 0, "cid"}, - { OP_ColumnName, 1, 0, "name"}, - { OP_ColumnName, 2, 0, "type"}, - { OP_ColumnName, 3, 0, "notnull"}, - { OP_ColumnName, 4, 0, "dflt_value"}, - { OP_ColumnName, 5, 1, "pk"}, - }; - int i; - sqliteVdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); - sqliteViewGetColumnNames(pParse, pTab); - for(i=0; inCol; i++){ - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zName, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, - pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0); - sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, - pTab->aCol[i].zDflt, P3_STATIC); - sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0); - sqliteVdbeAddOp(v, OP_Callback, 6, 0); - } - } - }else - - if( sqliteStrICmp(zLeft, "index_info")==0 ){ - Index *pIdx; - Table *pTab; - pIdx = sqliteFindIndex(db, zRight, 0); - if( pIdx ){ - static VdbeOpList tableInfoPreface[] = { - { OP_ColumnName, 0, 0, "seqno"}, - { OP_ColumnName, 1, 0, "cid"}, - { OP_ColumnName, 2, 1, "name"}, - }; - int i; - pTab = pIdx->pTable; - sqliteVdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); - for(i=0; inColumn; i++){ - int cnum = pIdx->aiColumn[i]; - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeAddOp(v, OP_Integer, cnum, 0); - assert( pTab->nCol>cnum ); - sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[cnum].zName, 0); - sqliteVdbeAddOp(v, OP_Callback, 3, 0); - } - } - }else - - if( sqliteStrICmp(zLeft, "index_list")==0 ){ - Index *pIdx; - Table *pTab; - pTab = sqliteFindTable(db, zRight, 0); - if( pTab ){ - v = sqliteGetVdbe(pParse); - pIdx = pTab->pIndex; - } - if( pTab && pIdx ){ - int i = 0; - static VdbeOpList indexListPreface[] = { - { OP_ColumnName, 0, 0, "seq"}, - { OP_ColumnName, 1, 0, "name"}, - { OP_ColumnName, 2, 1, "unique"}, - }; - - sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); - while(pIdx){ - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, pIdx->zName, 0); - sqliteVdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0); - sqliteVdbeAddOp(v, OP_Callback, 3, 0); - ++i; - pIdx = pIdx->pNext; - } - } - }else - - if( sqliteStrICmp(zLeft, "foreign_key_list")==0 ){ - FKey *pFK; - Table *pTab; - pTab = sqliteFindTable(db, zRight, 0); - if( pTab ){ - v = sqliteGetVdbe(pParse); - pFK = pTab->pFKey; - } - if( pTab && pFK ){ - int i = 0; - static VdbeOpList indexListPreface[] = { - { OP_ColumnName, 0, 0, "id"}, - { OP_ColumnName, 1, 0, "seq"}, - { OP_ColumnName, 2, 0, "table"}, - { OP_ColumnName, 3, 0, "from"}, - { OP_ColumnName, 4, 1, "to"}, - }; - - sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); - while(pFK){ - int j; - for(j=0; jnCol; j++){ - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeAddOp(v, OP_Integer, j, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, pFK->zTo, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, - pTab->aCol[pFK->aCol[j].iFrom].zName, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, pFK->aCol[j].zCol, 0); - sqliteVdbeAddOp(v, OP_Callback, 5, 0); - } - ++i; - pFK = pFK->pNextFrom; - } - } - }else - - if( sqliteStrICmp(zLeft, "database_list")==0 ){ - int i; - static VdbeOpList indexListPreface[] = { - { OP_ColumnName, 0, 0, "seq"}, - { OP_ColumnName, 1, 0, "name"}, - { OP_ColumnName, 2, 1, "file"}, - }; - - sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); - for(i=0; inDb; i++){ - if( db->aDb[i].pBt==0 ) continue; - assert( db->aDb[i].zName!=0 ); - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, db->aDb[i].zName, 0); - sqliteVdbeOp3(v, OP_String, 0, 0, - sqliteBtreeGetFilename(db->aDb[i].pBt), 0); - sqliteVdbeAddOp(v, OP_Callback, 3, 0); - } - }else - - - /* - ** PRAGMA temp_store - ** PRAGMA temp_store = "default"|"memory"|"file" - ** - ** Return or set the local value of the temp_store flag. Changing - ** the local value does not make changes to the disk file and the default - ** value will be restored the next time the database is opened. - ** - ** Note that it is possible for the library compile-time options to - ** override this setting - */ - if( sqliteStrICmp(zLeft, "temp_store")==0 ){ - static VdbeOpList getTmpDbLoc[] = { - { OP_ColumnName, 0, 1, "temp_store"}, - { OP_Callback, 1, 0, 0}, - }; - if( pRight->z==pLeft->z ){ - sqliteVdbeAddOp(v, OP_Integer, db->temp_store, 0); - sqliteVdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); - }else{ - changeTempStorage(pParse, zRight); - } - }else - - /* - ** PRAGMA default_temp_store - ** PRAGMA default_temp_store = "default"|"memory"|"file" - ** - ** Return or set the value of the persistent temp_store flag. Any - ** change does not take effect until the next time the database is - ** opened. - ** - ** Note that it is possible for the library compile-time options to - ** override this setting - */ - if( sqliteStrICmp(zLeft, "default_temp_store")==0 ){ - static VdbeOpList getTmpDbLoc[] = { - { OP_ColumnName, 0, 1, "temp_store"}, - { OP_ReadCookie, 0, 5, 0}, - { OP_Callback, 1, 0, 0}}; - if( pRight->z==pLeft->z ){ - sqliteVdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); - }else{ - sqliteBeginWriteOperation(pParse, 0, 0); - sqliteVdbeAddOp(v, OP_Integer, getTempStore(zRight), 0); - sqliteVdbeAddOp(v, OP_SetCookie, 0, 5); - sqliteEndWriteOperation(pParse); - } - }else - -#ifndef NDEBUG - if( sqliteStrICmp(zLeft, "parser_trace")==0 ){ - extern void sqliteParserTrace(FILE*, char *); - if( getBoolean(zRight) ){ - sqliteParserTrace(stdout, "parser: "); - }else{ - sqliteParserTrace(0, 0); - } - }else -#endif - - if( sqliteStrICmp(zLeft, "integrity_check")==0 ){ - int i, j, addr; - - /* Code that initializes the integrity check program. Set the - ** error count 0 - */ - static VdbeOpList initCode[] = { - { OP_Integer, 0, 0, 0}, - { OP_MemStore, 0, 1, 0}, - { OP_ColumnName, 0, 1, "integrity_check"}, - }; - - /* Code to do an BTree integrity check on a single database file. - */ - static VdbeOpList checkDb[] = { - { OP_SetInsert, 0, 0, "2"}, - { OP_Integer, 0, 0, 0}, /* 1 */ - { OP_OpenRead, 0, 2, 0}, - { OP_Rewind, 0, 7, 0}, /* 3 */ - { OP_Column, 0, 3, 0}, /* 4 */ - { OP_SetInsert, 0, 0, 0}, - { OP_Next, 0, 4, 0}, /* 6 */ - { OP_IntegrityCk, 0, 0, 0}, /* 7 */ - { OP_Dup, 0, 1, 0}, - { OP_String, 0, 0, "ok"}, - { OP_StrEq, 0, 12, 0}, /* 10 */ - { OP_MemIncr, 0, 0, 0}, - { OP_String, 0, 0, "*** in database "}, - { OP_String, 0, 0, 0}, /* 13 */ - { OP_String, 0, 0, " ***\n"}, - { OP_Pull, 3, 0, 0}, - { OP_Concat, 4, 1, 0}, - { OP_Callback, 1, 0, 0}, - }; - - /* Code that appears at the end of the integrity check. If no error - ** messages have been generated, output OK. Otherwise output the - ** error message - */ - static VdbeOpList endCode[] = { - { OP_MemLoad, 0, 0, 0}, - { OP_Integer, 0, 0, 0}, - { OP_Ne, 0, 0, 0}, /* 2 */ - { OP_String, 0, 0, "ok"}, - { OP_Callback, 1, 0, 0}, - }; - - /* Initialize the VDBE program */ - sqliteVdbeAddOpList(v, ArraySize(initCode), initCode); - - /* Do an integrity check on each database file */ - for(i=0; inDb; i++){ - HashElem *x; - - /* Do an integrity check of the B-Tree - */ - addr = sqliteVdbeAddOpList(v, ArraySize(checkDb), checkDb); - sqliteVdbeChangeP1(v, addr+1, i); - sqliteVdbeChangeP2(v, addr+3, addr+7); - sqliteVdbeChangeP2(v, addr+6, addr+4); - sqliteVdbeChangeP2(v, addr+7, i); - sqliteVdbeChangeP2(v, addr+10, addr+ArraySize(checkDb)); - sqliteVdbeChangeP3(v, addr+13, db->aDb[i].zName, P3_STATIC); - - /* Make sure all the indices are constructed correctly. - */ - sqliteCodeVerifySchema(pParse, i); - for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ - Table *pTab = sqliteHashData(x); - Index *pIdx; - int loopTop; - - if( pTab->pIndex==0 ) continue; - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeOp3(v, OP_OpenRead, 1, pTab->tnum, pTab->zName, 0); - for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - if( pIdx->tnum==0 ) continue; - sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - sqliteVdbeOp3(v, OP_OpenRead, j+2, pIdx->tnum, pIdx->zName, 0); - } - sqliteVdbeAddOp(v, OP_Integer, 0, 0); - sqliteVdbeAddOp(v, OP_MemStore, 1, 1); - loopTop = sqliteVdbeAddOp(v, OP_Rewind, 1, 0); - sqliteVdbeAddOp(v, OP_MemIncr, 1, 0); - for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - int k, jmp2; - static VdbeOpList idxErr[] = { - { OP_MemIncr, 0, 0, 0}, - { OP_String, 0, 0, "rowid "}, - { OP_Recno, 1, 0, 0}, - { OP_String, 0, 0, " missing from index "}, - { OP_String, 0, 0, 0}, /* 4 */ - { OP_Concat, 4, 0, 0}, - { OP_Callback, 1, 0, 0}, - }; - sqliteVdbeAddOp(v, OP_Recno, 1, 0); - for(k=0; knColumn; k++){ - int idx = pIdx->aiColumn[k]; - if( idx==pTab->iPKey ){ - sqliteVdbeAddOp(v, OP_Recno, 1, 0); - }else{ - sqliteVdbeAddOp(v, OP_Column, 1, idx); - } - } - sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); - if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); - jmp2 = sqliteVdbeAddOp(v, OP_Found, j+2, 0); - addr = sqliteVdbeAddOpList(v, ArraySize(idxErr), idxErr); - sqliteVdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC); - sqliteVdbeChangeP2(v, jmp2, sqliteVdbeCurrentAddr(v)); - } - sqliteVdbeAddOp(v, OP_Next, 1, loopTop+1); - sqliteVdbeChangeP2(v, loopTop, sqliteVdbeCurrentAddr(v)); - for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ - static VdbeOpList cntIdx[] = { - { OP_Integer, 0, 0, 0}, - { OP_MemStore, 2, 1, 0}, - { OP_Rewind, 0, 0, 0}, /* 2 */ - { OP_MemIncr, 2, 0, 0}, - { OP_Next, 0, 0, 0}, /* 4 */ - { OP_MemLoad, 1, 0, 0}, - { OP_MemLoad, 2, 0, 0}, - { OP_Eq, 0, 0, 0}, /* 7 */ - { OP_MemIncr, 0, 0, 0}, - { OP_String, 0, 0, "wrong # of entries in index "}, - { OP_String, 0, 0, 0}, /* 10 */ - { OP_Concat, 2, 0, 0}, - { OP_Callback, 1, 0, 0}, - }; - if( pIdx->tnum==0 ) continue; - addr = sqliteVdbeAddOpList(v, ArraySize(cntIdx), cntIdx); - sqliteVdbeChangeP1(v, addr+2, j+2); - sqliteVdbeChangeP2(v, addr+2, addr+5); - sqliteVdbeChangeP1(v, addr+4, j+2); - sqliteVdbeChangeP2(v, addr+4, addr+3); - sqliteVdbeChangeP2(v, addr+7, addr+ArraySize(cntIdx)); - sqliteVdbeChangeP3(v, addr+10, pIdx->zName, P3_STATIC); - } - } - } - addr = sqliteVdbeAddOpList(v, ArraySize(endCode), endCode); - sqliteVdbeChangeP2(v, addr+2, addr+ArraySize(endCode)); - }else - - {} - sqliteFree(zLeft); - sqliteFree(zRight); -} diff --git a/ext/sqlite/libsqlite/src/printf.c b/ext/sqlite/libsqlite/src/printf.c deleted file mode 100644 index f867d62af61a5..0000000000000 --- a/ext/sqlite/libsqlite/src/printf.c +++ /dev/null @@ -1,858 +0,0 @@ -/* -** The "printf" code that follows dates from the 1980's. It is in -** the public domain. The original comments are included here for -** completeness. They are very out-of-date but might be useful as -** an historical reference. Most of the "enhancements" have been backed -** out so that the functionality is now the same as standard printf(). -** -************************************************************************** -** -** The following modules is an enhanced replacement for the "printf" subroutines -** found in the standard C library. The following enhancements are -** supported: -** -** + Additional functions. The standard set of "printf" functions -** includes printf, fprintf, sprintf, vprintf, vfprintf, and -** vsprintf. This module adds the following: -** -** * snprintf -- Works like sprintf, but has an extra argument -** which is the size of the buffer written to. -** -** * mprintf -- Similar to sprintf. Writes output to memory -** obtained from malloc. -** -** * xprintf -- Calls a function to dispose of output. -** -** * nprintf -- No output, but returns the number of characters -** that would have been output by printf. -** -** * A v- version (ex: vsnprintf) of every function is also -** supplied. -** -** + A few extensions to the formatting notation are supported: -** -** * The "=" flag (similar to "-") causes the output to be -** be centered in the appropriately sized field. -** -** * The %b field outputs an integer in binary notation. -** -** * The %c field now accepts a precision. The character output -** is repeated by the number of times the precision specifies. -** -** * The %' field works like %c, but takes as its character the -** next character of the format string, instead of the next -** argument. For example, printf("%.78'-") prints 78 minus -** signs, the same as printf("%.78c",'-'). -** -** + When compiled using GCC on a SPARC, this version of printf is -** faster than the library printf for SUN OS 4.1. -** -** + All functions are fully reentrant. -** -*/ -#include "sqliteInt.h" - -/* -** Conversion types fall into various categories as defined by the -** following enumeration. -*/ -#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */ -#define etFLOAT 2 /* Floating point. %f */ -#define etEXP 3 /* Exponentional notation. %e and %E */ -#define etGENERIC 4 /* Floating or exponential, depending on exponent. %g */ -#define etSIZE 5 /* Return number of characters processed so far. %n */ -#define etSTRING 6 /* Strings. %s */ -#define etDYNSTRING 7 /* Dynamically allocated strings. %z */ -#define etPERCENT 8 /* Percent symbol. %% */ -#define etCHARX 9 /* Characters. %c */ -#define etERROR 10 /* Used to indicate no such conversion type */ -/* The rest are extensions, not normally found in printf() */ -#define etCHARLIT 11 /* Literal characters. %' */ -#define etSQLESCAPE 12 /* Strings with '\'' doubled. %q */ -#define etSQLESCAPE2 13 /* Strings with '\'' doubled and enclosed in '', - NULL pointers replaced by SQL NULL. %Q */ -#define etTOKEN 14 /* a pointer to a Token structure */ -#define etSRCLIST 15 /* a pointer to a SrcList */ - - -/* -** An "etByte" is an 8-bit unsigned value. -*/ -typedef unsigned char etByte; - -/* -** Each builtin conversion character (ex: the 'd' in "%d") is described -** by an instance of the following structure -*/ -typedef struct et_info { /* Information about each format field */ - char fmttype; /* The format field code letter */ - etByte base; /* The base for radix conversion */ - etByte flags; /* One or more of FLAG_ constants below */ - etByte type; /* Conversion paradigm */ - char *charset; /* The character set for conversion */ - char *prefix; /* Prefix on non-zero values in alt format */ -} et_info; - -/* -** Allowed values for et_info.flags -*/ -#define FLAG_SIGNED 1 /* True if the value to convert is signed */ -#define FLAG_INTERN 2 /* True if for internal use only */ - - -/* -** The following table is searched linearly, so it is good to put the -** most frequently used conversion types first. -*/ -static et_info fmtinfo[] = { - { 'd', 10, 1, etRADIX, "0123456789", 0 }, - { 's', 0, 0, etSTRING, 0, 0 }, - { 'z', 0, 2, etDYNSTRING, 0, 0 }, - { 'q', 0, 0, etSQLESCAPE, 0, 0 }, - { 'Q', 0, 0, etSQLESCAPE2, 0, 0 }, - { 'c', 0, 0, etCHARX, 0, 0 }, - { 'o', 8, 0, etRADIX, "01234567", "0" }, - { 'u', 10, 0, etRADIX, "0123456789", 0 }, - { 'x', 16, 0, etRADIX, "0123456789abcdef", "x0" }, - { 'X', 16, 0, etRADIX, "0123456789ABCDEF", "X0" }, - { 'f', 0, 1, etFLOAT, 0, 0 }, - { 'e', 0, 1, etEXP, "e", 0 }, - { 'E', 0, 1, etEXP, "E", 0 }, - { 'g', 0, 1, etGENERIC, "e", 0 }, - { 'G', 0, 1, etGENERIC, "E", 0 }, - { 'i', 10, 1, etRADIX, "0123456789", 0 }, - { 'n', 0, 0, etSIZE, 0, 0 }, - { '%', 0, 0, etPERCENT, 0, 0 }, - { 'p', 10, 0, etRADIX, "0123456789", 0 }, - { 'T', 0, 2, etTOKEN, 0, 0 }, - { 'S', 0, 2, etSRCLIST, 0, 0 }, -}; -#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) - -/* -** If NOFLOATINGPOINT is defined, then none of the floating point -** conversions will work. -*/ -#ifndef etNOFLOATINGPOINT -/* -** "*val" is a double such that 0.1 <= *val < 10.0 -** Return the ascii code for the leading digit of *val, then -** multiply "*val" by 10.0 to renormalize. -** -** Example: -** input: *val = 3.14159 -** output: *val = 1.4159 function return = '3' -** -** The counter *cnt is incremented each time. After counter exceeds -** 16 (the number of significant digits in a 64-bit float) '0' is -** always returned. -*/ -static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ - int digit; - LONGDOUBLE_TYPE d; - if( (*cnt)++ >= 16 ) return '0'; - digit = (int)*val; - d = digit; - digit += '0'; - *val = (*val - d)*10.0; - return digit; -} -#endif - -#define etBUFSIZE 1000 /* Size of the output buffer */ - -/* -** The root program. All variations call this core. -** -** INPUTS: -** func This is a pointer to a function taking three arguments -** 1. A pointer to anything. Same as the "arg" parameter. -** 2. A pointer to the list of characters to be output -** (Note, this list is NOT null terminated.) -** 3. An integer number of characters to be output. -** (Note: This number might be zero.) -** -** arg This is the pointer to anything which will be passed as the -** first argument to "func". Use it for whatever you like. -** -** fmt This is the format string, as in the usual print. -** -** ap This is a pointer to a list of arguments. Same as in -** vfprint. -** -** OUTPUTS: -** The return value is the total number of characters sent to -** the function "func". Returns -1 on a error. -** -** Note that the order in which automatic variables are declared below -** seems to make a big difference in determining how fast this beast -** will run. -*/ -static int vxprintf( - void (*func)(void*,const char*,int), /* Consumer of text */ - void *arg, /* First argument to the consumer */ - int useExtended, /* Allow extended %-conversions */ - const char *fmt, /* Format string */ - va_list ap /* arguments */ -){ - int c; /* Next character in the format string */ - char *bufpt; /* Pointer to the conversion buffer */ - int precision; /* Precision of the current field */ - int length; /* Length of the field */ - int idx; /* A general purpose loop counter */ - int count; /* Total number of characters output */ - int width; /* Width of the current field */ - etByte flag_leftjustify; /* True if "-" flag is present */ - etByte flag_plussign; /* True if "+" flag is present */ - etByte flag_blanksign; /* True if " " flag is present */ - etByte flag_alternateform; /* True if "#" flag is present */ - etByte flag_zeropad; /* True if field width constant starts with zero */ - etByte flag_long; /* True if "l" flag is present */ - unsigned long longvalue; /* Value for integer types */ - LONGDOUBLE_TYPE realvalue; /* Value for real types */ - et_info *infop; /* Pointer to the appropriate info structure */ - char buf[etBUFSIZE]; /* Conversion buffer */ - char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ - etByte errorflag = 0; /* True if an error is encountered */ - etByte xtype; /* Conversion paradigm */ - char *zExtra; /* Extra memory used for etTCLESCAPE conversions */ - static char spaces[] = " "; -#define etSPACESIZE (sizeof(spaces)-1) -#ifndef etNOFLOATINGPOINT - int exp; /* exponent of real numbers */ - double rounder; /* Used for rounding floating point values */ - etByte flag_dp; /* True if decimal point should be shown */ - etByte flag_rtz; /* True if trailing zeros should be removed */ - etByte flag_exp; /* True to force display of the exponent */ - int nsd; /* Number of significant digits returned */ -#endif - - func(arg,"",0); - count = length = 0; - bufpt = 0; - for(; (c=(*fmt))!=0; ++fmt){ - if( c!='%' ){ - int amt; - bufpt = (char *)fmt; - amt = 1; - while( (c=(*++fmt))!='%' && c!=0 ) amt++; - (*func)(arg,bufpt,amt); - count += amt; - if( c==0 ) break; - } - if( (c=(*++fmt))==0 ){ - errorflag = 1; - (*func)(arg,"%",1); - count++; - break; - } - /* Find out what flags are present */ - flag_leftjustify = flag_plussign = flag_blanksign = - flag_alternateform = flag_zeropad = 0; - do{ - switch( c ){ - case '-': flag_leftjustify = 1; c = 0; break; - case '+': flag_plussign = 1; c = 0; break; - case ' ': flag_blanksign = 1; c = 0; break; - case '#': flag_alternateform = 1; c = 0; break; - case '0': flag_zeropad = 1; c = 0; break; - default: break; - } - }while( c==0 && (c=(*++fmt))!=0 ); - /* Get the field width */ - width = 0; - if( c=='*' ){ - width = va_arg(ap,int); - if( width<0 ){ - flag_leftjustify = 1; - width = -width; - } - c = *++fmt; - }else{ - while( c>='0' && c<='9' ){ - width = width*10 + c - '0'; - c = *++fmt; - } - } - if( width > etBUFSIZE-10 ){ - width = etBUFSIZE-10; - } - /* Get the precision */ - if( c=='.' ){ - precision = 0; - c = *++fmt; - if( c=='*' ){ - precision = va_arg(ap,int); - if( precision<0 ) precision = -precision; - c = *++fmt; - }else{ - while( c>='0' && c<='9' ){ - precision = precision*10 + c - '0'; - c = *++fmt; - } - } - /* Limit the precision to prevent overflowing buf[] during conversion */ - if( precision>etBUFSIZE-40 ) precision = etBUFSIZE-40; - }else{ - precision = -1; - } - /* Get the conversion type modifier */ - if( c=='l' ){ - flag_long = 1; - c = *++fmt; - }else{ - flag_long = 0; - } - /* Fetch the info entry for the field */ - infop = 0; - xtype = etERROR; - for(idx=0; idxflags & FLAG_INTERN)==0 ){ - xtype = infop->type; - } - break; - } - } - zExtra = 0; - - /* - ** At this point, variables are initialized as follows: - ** - ** flag_alternateform TRUE if a '#' is present. - ** flag_plussign TRUE if a '+' is present. - ** flag_leftjustify TRUE if a '-' is present or if the - ** field width was negative. - ** flag_zeropad TRUE if the width began with 0. - ** flag_long TRUE if the letter 'l' (ell) prefixed - ** the conversion character. - ** flag_blanksign TRUE if a ' ' is present. - ** width The specified field width. This is - ** always non-negative. Zero is the default. - ** precision The specified precision. The default - ** is -1. - ** xtype The class of the conversion. - ** infop Pointer to the appropriate info struct. - */ - switch( xtype ){ - case etRADIX: - if( flag_long ) longvalue = va_arg(ap,long); - else longvalue = va_arg(ap,int); -#if 1 - /* For the format %#x, the value zero is printed "0" not "0x0". - ** I think this is stupid. */ - if( longvalue==0 ) flag_alternateform = 0; -#else - /* More sensible: turn off the prefix for octal (to prevent "00"), - ** but leave the prefix for hex. */ - if( longvalue==0 && infop->base==8 ) flag_alternateform = 0; -#endif - if( infop->flags & FLAG_SIGNED ){ - if( *(long*)&longvalue<0 ){ - longvalue = -*(long*)&longvalue; - prefix = '-'; - }else if( flag_plussign ) prefix = '+'; - else if( flag_blanksign ) prefix = ' '; - else prefix = 0; - }else prefix = 0; - if( flag_zeropad && precisioncharset; - base = infop->base; - do{ /* Convert to ascii */ - *(--bufpt) = cset[longvalue%base]; - longvalue = longvalue/base; - }while( longvalue>0 ); - } - length = &buf[etBUFSIZE-1]-bufpt; - for(idx=precision-length; idx>0; idx--){ - *(--bufpt) = '0'; /* Zero pad */ - } - if( prefix ) *(--bufpt) = prefix; /* Add sign */ - if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ - char *pre, x; - pre = infop->prefix; - if( *bufpt!=pre[0] ){ - for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x; - } - } - length = &buf[etBUFSIZE-1]-bufpt; - break; - case etFLOAT: - case etEXP: - case etGENERIC: - realvalue = va_arg(ap,double); -#ifndef etNOFLOATINGPOINT - if( precision<0 ) precision = 6; /* Set default precision */ - if( precision>etBUFSIZE-10 ) precision = etBUFSIZE-10; - if( realvalue<0.0 ){ - realvalue = -realvalue; - prefix = '-'; - }else{ - if( flag_plussign ) prefix = '+'; - else if( flag_blanksign ) prefix = ' '; - else prefix = 0; - } - if( infop->type==etGENERIC && precision>0 ) precision--; - rounder = 0.0; -#if 0 - /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ - for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); -#else - /* It makes more sense to use 0.5 */ - for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1); -#endif - if( infop->type==etFLOAT ) realvalue += rounder; - /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ - exp = 0; - if( realvalue>0.0 ){ - while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; } - while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; } - while( realvalue<1e-8 && exp>=-350 ){ realvalue *= 1e8; exp-=8; } - while( realvalue<1.0 && exp>=-350 ){ realvalue *= 10.0; exp--; } - if( exp>350 || exp<-350 ){ - bufpt = "NaN"; - length = 3; - break; - } - } - bufpt = buf; - /* - ** If the field type is etGENERIC, then convert to either etEXP - ** or etFLOAT, as appropriate. - */ - flag_exp = xtype==etEXP; - if( xtype!=etFLOAT ){ - realvalue += rounder; - if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } - } - if( xtype==etGENERIC ){ - flag_rtz = !flag_alternateform; - if( exp<-4 || exp>precision ){ - xtype = etEXP; - }else{ - precision = precision - exp; - xtype = etFLOAT; - } - }else{ - flag_rtz = 0; - } - /* - ** The "exp+precision" test causes output to be of type etEXP if - ** the precision is too large to fit in buf[]. - */ - nsd = 0; - if( xtype==etFLOAT && exp+precision0 || flag_alternateform); - if( prefix ) *(bufpt++) = prefix; /* Sign */ - if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */ - else for(; exp>=0; exp--) *(bufpt++) = et_getdigit(&realvalue,&nsd); - if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */ - for(exp++; exp<0 && precision>0; precision--, exp++){ - *(bufpt++) = '0'; - } - while( (precision--)>0 ) *(bufpt++) = et_getdigit(&realvalue,&nsd); - *(bufpt--) = 0; /* Null terminate */ - if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */ - while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; - if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; - } - bufpt++; /* point to next free slot */ - }else{ /* etEXP or etGENERIC */ - flag_dp = (precision>0 || flag_alternateform); - if( prefix ) *(bufpt++) = prefix; /* Sign */ - *(bufpt++) = et_getdigit(&realvalue,&nsd); /* First digit */ - if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */ - while( (precision--)>0 ) *(bufpt++) = et_getdigit(&realvalue,&nsd); - bufpt--; /* point to last digit */ - if( flag_rtz && flag_dp ){ /* Remove tail zeros */ - while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; - if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; - } - bufpt++; /* point to next free slot */ - if( exp || flag_exp ){ - *(bufpt++) = infop->charset[0]; - if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */ - else { *(bufpt++) = '+'; } - if( exp>=100 ){ - *(bufpt++) = (exp/100)+'0'; /* 100's digit */ - exp %= 100; - } - *(bufpt++) = exp/10+'0'; /* 10's digit */ - *(bufpt++) = exp%10+'0'; /* 1's digit */ - } - } - /* The converted number is in buf[] and zero terminated. Output it. - ** Note that the number is in the usual order, not reversed as with - ** integer conversions. */ - length = bufpt-buf; - bufpt = buf; - - /* Special case: Add leading zeros if the flag_zeropad flag is - ** set and we are not left justified */ - if( flag_zeropad && !flag_leftjustify && length < width){ - int i; - int nPad = width - length; - for(i=width; i>=nPad; i--){ - bufpt[i] = bufpt[i-nPad]; - } - i = prefix!=0; - while( nPad-- ) bufpt[i++] = '0'; - length = width; - } -#endif - break; - case etSIZE: - *(va_arg(ap,int*)) = count; - length = width = 0; - break; - case etPERCENT: - buf[0] = '%'; - bufpt = buf; - length = 1; - break; - case etCHARLIT: - case etCHARX: - c = buf[0] = (xtype==etCHARX ? va_arg(ap,int) : *++fmt); - if( precision>=0 ){ - for(idx=1; idx=0 && precisionetBUFSIZE ){ - bufpt = zExtra = sqliteMalloc( n ); - if( bufpt==0 ) return -1; - }else{ - bufpt = buf; - } - j = 0; - if( !isnull && xtype==etSQLESCAPE2 ) bufpt[j++] = '\''; - for(i=0; (c=arg[i])!=0; i++){ - bufpt[j++] = c; - if( c=='\'' ) bufpt[j++] = c; - } - if( !isnull && xtype==etSQLESCAPE2 ) bufpt[j++] = '\''; - bufpt[j] = 0; - length = j; - if( precision>=0 && precisionz, pToken->n); - length = width = 0; - break; - } - case etSRCLIST: { - SrcList *pSrc = va_arg(ap, SrcList*); - int k = va_arg(ap, int); - struct SrcList_item *pItem = &pSrc->a[k]; - assert( k>=0 && knSrc ); - if( pItem->zDatabase && pItem->zDatabase[0] ){ - (*func)(arg, pItem->zDatabase, strlen(pItem->zDatabase)); - (*func)(arg, ".", 1); - } - (*func)(arg, pItem->zName, strlen(pItem->zName)); - length = width = 0; - break; - } - case etERROR: - buf[0] = '%'; - buf[1] = c; - errorflag = 0; - idx = 1+(c!=0); - (*func)(arg,"%",idx); - count += idx; - if( c==0 ) fmt--; - break; - }/* End switch over the format type */ - /* - ** The text of the conversion is pointed to by "bufpt" and is - ** "length" characters long. The field width is "width". Do - ** the output. - */ - if( !flag_leftjustify ){ - register int nspace; - nspace = width-length; - if( nspace>0 ){ - count += nspace; - while( nspace>=etSPACESIZE ){ - (*func)(arg,spaces,etSPACESIZE); - nspace -= etSPACESIZE; - } - if( nspace>0 ) (*func)(arg,spaces,nspace); - } - } - if( length>0 ){ - (*func)(arg,bufpt,length); - count += length; - } - if( flag_leftjustify ){ - register int nspace; - nspace = width-length; - if( nspace>0 ){ - count += nspace; - while( nspace>=etSPACESIZE ){ - (*func)(arg,spaces,etSPACESIZE); - nspace -= etSPACESIZE; - } - if( nspace>0 ) (*func)(arg,spaces,nspace); - } - } - if( zExtra ){ - sqliteFree(zExtra); - } - }/* End for loop over the format string */ - return errorflag ? -1 : count; -} /* End of function */ - - -/* This structure is used to store state information about the -** write to memory that is currently in progress. -*/ -struct sgMprintf { - char *zBase; /* A base allocation */ - char *zText; /* The string collected so far */ - int nChar; /* Length of the string so far */ - int nTotal; /* Output size if unconstrained */ - int nAlloc; /* Amount of space allocated in zText */ - void *(*xRealloc)(void*,int); /* Function used to realloc memory */ -}; - -/* -** This function implements the callback from vxprintf. -** -** This routine add nNewChar characters of text in zNewText to -** the sgMprintf structure pointed to by "arg". -*/ -static void mout(void *arg, const char *zNewText, int nNewChar){ - struct sgMprintf *pM = (struct sgMprintf*)arg; - pM->nTotal += nNewChar; - if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ - if( pM->xRealloc==0 ){ - nNewChar = pM->nAlloc - pM->nChar - 1; - }else{ - pM->nAlloc = pM->nChar + nNewChar*2 + 1; - if( pM->zText==pM->zBase ){ - pM->zText = pM->xRealloc(0, pM->nAlloc); - if( pM->zText && pM->nChar ){ - memcpy(pM->zText, pM->zBase, pM->nChar); - } - }else{ - pM->zText = pM->xRealloc(pM->zText, pM->nAlloc); - } - } - } - if( pM->zText ){ - if( nNewChar>0 ){ - memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); - pM->nChar += nNewChar; - } - pM->zText[pM->nChar] = 0; - } -} - -/* -** This routine is a wrapper around xprintf() that invokes mout() as -** the consumer. -*/ -static char *base_vprintf( - void *(*xRealloc)(void*,int), /* Routine to realloc memory. May be NULL */ - int useInternal, /* Use internal %-conversions if true */ - char *zInitBuf, /* Initially write here, before mallocing */ - int nInitBuf, /* Size of zInitBuf[] */ - const char *zFormat, /* format string */ - va_list ap /* arguments */ -){ - struct sgMprintf sM; - sM.zBase = sM.zText = zInitBuf; - sM.nChar = sM.nTotal = 0; - sM.nAlloc = nInitBuf; - sM.xRealloc = xRealloc; - vxprintf(mout, &sM, useInternal, zFormat, ap); - if( xRealloc ){ - if( sM.zText==sM.zBase ){ - sM.zText = xRealloc(0, sM.nChar+1); - memcpy(sM.zText, sM.zBase, sM.nChar+1); - }else if( sM.nAlloc>sM.nChar+10 ){ - sM.zText = xRealloc(sM.zText, sM.nChar+1); - } - } - return sM.zText; -} - -/* -** Realloc that is a real function, not a macro. -*/ -static void *printf_realloc(void *old, int size){ - return sqliteRealloc(old,size); -} - -/* -** Print into memory obtained from sqliteMalloc(). Use the internal -** %-conversion extensions. -*/ -char *sqliteVMPrintf(const char *zFormat, va_list ap){ - char zBase[1000]; - return base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); -} - -/* -** Print into memory obtained from sqliteMalloc(). Use the internal -** %-conversion extensions. -*/ -char *sqliteMPrintf(const char *zFormat, ...){ - va_list ap; - char *z; - char zBase[1000]; - va_start(ap, zFormat); - z = base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap); - va_end(ap); - return z; -} - -/* -** Print into memory obtained from malloc(). Do not use the internal -** %-conversion extensions. This routine is for use by external users. -*/ -char *sqlite_mprintf(const char *zFormat, ...){ - va_list ap; - char *z; - char zBuf[200]; - - va_start(ap,zFormat); - z = base_vprintf((void*(*)(void*,int))realloc, 0, - zBuf, sizeof(zBuf), zFormat, ap); - va_end(ap); - return z; -} - -/* This is the varargs version of sqlite_mprintf. -*/ -char *sqlite_vmprintf(const char *zFormat, va_list ap){ - char zBuf[200]; - return base_vprintf((void*(*)(void*,int))realloc, 0, - zBuf, sizeof(zBuf), zFormat, ap); -} - -/* -** sqlite_snprintf() works like snprintf() except that it ignores the -** current locale settings. This is important for SQLite because we -** are not able to use a "," as the decimal point in place of "." as -** specified by some locales. -*/ -char *sqlite_snprintf(int n, char *zBuf, const char *zFormat, ...){ - char *z; - va_list ap; - - va_start(ap,zFormat); - z = base_vprintf(0, 0, zBuf, n, zFormat, ap); - va_end(ap); - return z; -} - -/* -** The following four routines implement the varargs versions of the -** sqlite_exec() and sqlite_get_table() interfaces. See the sqlite.h -** header files for a more detailed description of how these interfaces -** work. -** -** These routines are all just simple wrappers. -*/ -int sqlite_exec_printf( - sqlite *db, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback xCallback, /* Callback function */ - void *pArg, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string. */ -){ - va_list ap; - int rc; - - va_start(ap, errmsg); - rc = sqlite_exec_vprintf(db, sqlFormat, xCallback, pArg, errmsg, ap); - va_end(ap); - return rc; -} -int sqlite_exec_vprintf( - sqlite *db, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback xCallback, /* Callback function */ - void *pArg, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string. */ -){ - char *zSql; - int rc; - - zSql = sqlite_vmprintf(sqlFormat, ap); - rc = sqlite_exec(db, zSql, xCallback, pArg, errmsg); - free(zSql); - return rc; -} -int sqlite_get_table_printf( - sqlite *db, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncol, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string */ -){ - va_list ap; - int rc; - - va_start(ap, errmsg); - rc = sqlite_get_table_vprintf(db, sqlFormat, resultp, nrow, ncol, errmsg, ap); - va_end(ap); - return rc; -} -int sqlite_get_table_vprintf( - sqlite *db, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string */ -){ - char *zSql; - int rc; - - zSql = sqlite_vmprintf(sqlFormat, ap); - rc = sqlite_get_table(db, zSql, resultp, nrow, ncolumn, errmsg); - free(zSql); - return rc; -} diff --git a/ext/sqlite/libsqlite/src/random.c b/ext/sqlite/libsqlite/src/random.c deleted file mode 100644 index dd8bdd4c58b90..0000000000000 --- a/ext/sqlite/libsqlite/src/random.c +++ /dev/null @@ -1,97 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code to implement a pseudo-random number -** generator (PRNG) for SQLite. -** -** Random numbers are used by some of the database backends in order -** to generate random integer keys for tables or random filenames. -** -** $Id$ -*/ -#include "sqliteInt.h" -#include "os.h" - - -/* -** Get a single 8-bit random value from the RC4 PRNG. The Mutex -** must be held while executing this routine. -** -** Why not just use a library random generator like lrand48() for this? -** Because the OP_NewRecno opcode in the VDBE depends on having a very -** good source of random numbers. The lrand48() library function may -** well be good enough. But maybe not. Or maybe lrand48() has some -** subtle problems on some systems that could cause problems. It is hard -** to know. To minimize the risk of problems due to bad lrand48() -** implementations, SQLite uses this random number generator based -** on RC4, which we know works very well. -*/ -static int randomByte(){ - unsigned char t; - - /* All threads share a single random number generator. - ** This structure is the current state of the generator. - */ - static struct { - unsigned char isInit; /* True if initialized */ - unsigned char i, j; /* State variables */ - unsigned char s[256]; /* State variables */ - } prng; - - /* Initialize the state of the random number generator once, - ** the first time this routine is called. The seed value does - ** not need to contain a lot of randomness since we are not - ** trying to do secure encryption or anything like that... - ** - ** Nothing in this file or anywhere else in SQLite does any kind of - ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random - ** number generator) not as an encryption device. - */ - if( !prng.isInit ){ - int i; - char k[256]; - prng.j = 0; - prng.i = 0; - sqliteOsRandomSeed(k); - for(i=0; i<256; i++){ - prng.s[i] = i; - } - for(i=0; i<256; i++){ - prng.j += prng.s[i] + k[i]; - t = prng.s[prng.j]; - prng.s[prng.j] = prng.s[i]; - prng.s[i] = t; - } - prng.isInit = 1; - } - - /* Generate and return single random byte - */ - prng.i++; - t = prng.s[prng.i]; - prng.j += t; - prng.s[prng.i] = prng.s[prng.j]; - prng.s[prng.j] = t; - t += prng.s[prng.i]; - return prng.s[t]; -} - -/* -** Return N random bytes. -*/ -void sqliteRandomness(int N, void *pBuf){ - unsigned char *zBuf = pBuf; - sqliteOsEnterMutex(); - while( N-- ){ - *(zBuf++) = randomByte(); - } - sqliteOsLeaveMutex(); -} diff --git a/ext/sqlite/libsqlite/src/select.c b/ext/sqlite/libsqlite/src/select.c deleted file mode 100644 index c19c2bac86471..0000000000000 --- a/ext/sqlite/libsqlite/src/select.c +++ /dev/null @@ -1,2434 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the parser -** to handle SELECT statements in SQLite. -** -** $Id$ -*/ -#include "sqliteInt.h" - - -/* -** Allocate a new Select structure and return a pointer to that -** structure. -*/ -Select *sqliteSelectNew( - ExprList *pEList, /* which columns to include in the result */ - SrcList *pSrc, /* the FROM clause -- which tables to scan */ - Expr *pWhere, /* the WHERE clause */ - ExprList *pGroupBy, /* the GROUP BY clause */ - Expr *pHaving, /* the HAVING clause */ - ExprList *pOrderBy, /* the ORDER BY clause */ - int isDistinct, /* true if the DISTINCT keyword is present */ - int nLimit, /* LIMIT value. -1 means not used */ - int nOffset /* OFFSET value. 0 means no offset */ -){ - Select *pNew; - pNew = sqliteMalloc( sizeof(*pNew) ); - if( pNew==0 ){ - sqliteExprListDelete(pEList); - sqliteSrcListDelete(pSrc); - sqliteExprDelete(pWhere); - sqliteExprListDelete(pGroupBy); - sqliteExprDelete(pHaving); - sqliteExprListDelete(pOrderBy); - }else{ - if( pEList==0 ){ - pEList = sqliteExprListAppend(0, sqliteExpr(TK_ALL,0,0,0), 0); - } - pNew->pEList = pEList; - pNew->pSrc = pSrc; - pNew->pWhere = pWhere; - pNew->pGroupBy = pGroupBy; - pNew->pHaving = pHaving; - pNew->pOrderBy = pOrderBy; - pNew->isDistinct = isDistinct; - pNew->op = TK_SELECT; - pNew->nLimit = nLimit; - pNew->nOffset = nOffset; - pNew->iLimit = -1; - pNew->iOffset = -1; - } - return pNew; -} - -/* -** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the -** type of join. Return an integer constant that expresses that type -** in terms of the following bit values: -** -** JT_INNER -** JT_OUTER -** JT_NATURAL -** JT_LEFT -** JT_RIGHT -** -** A full outer join is the combination of JT_LEFT and JT_RIGHT. -** -** If an illegal or unsupported join type is seen, then still return -** a join type, but put an error in the pParse structure. -*/ -int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ - int jointype = 0; - Token *apAll[3]; - Token *p; - static struct { - const char *zKeyword; - int nChar; - int code; - } keywords[] = { - { "natural", 7, JT_NATURAL }, - { "left", 4, JT_LEFT|JT_OUTER }, - { "right", 5, JT_RIGHT|JT_OUTER }, - { "full", 4, JT_LEFT|JT_RIGHT|JT_OUTER }, - { "outer", 5, JT_OUTER }, - { "inner", 5, JT_INNER }, - { "cross", 5, JT_INNER }, - }; - int i, j; - apAll[0] = pA; - apAll[1] = pB; - apAll[2] = pC; - for(i=0; i<3 && apAll[i]; i++){ - p = apAll[i]; - for(j=0; jn==keywords[j].nChar - && sqliteStrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){ - jointype |= keywords[j].code; - break; - } - } - if( j>=sizeof(keywords)/sizeof(keywords[0]) ){ - jointype |= JT_ERROR; - break; - } - } - if( - (jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) || - (jointype & JT_ERROR)!=0 - ){ - static Token dummy = { 0, 0 }; - char *zSp1 = " ", *zSp2 = " "; - if( pB==0 ){ pB = &dummy; zSp1 = 0; } - if( pC==0 ){ pC = &dummy; zSp2 = 0; } - sqliteSetNString(&pParse->zErrMsg, "unknown or unsupported join type: ", 0, - pA->z, pA->n, zSp1, 1, pB->z, pB->n, zSp2, 1, pC->z, pC->n, 0); - pParse->nErr++; - jointype = JT_INNER; - }else if( jointype & JT_RIGHT ){ - sqliteErrorMsg(pParse, - "RIGHT and FULL OUTER JOINs are not currently supported"); - jointype = JT_INNER; - } - return jointype; -} - -/* -** Return the index of a column in a table. Return -1 if the column -** is not contained in the table. -*/ -static int columnIndex(Table *pTab, const char *zCol){ - int i; - for(i=0; inCol; i++){ - if( sqliteStrICmp(pTab->aCol[i].zName, zCol)==0 ) return i; - } - return -1; -} - -/* -** Add a term to the WHERE expression in *ppExpr that requires the -** zCol column to be equal in the two tables pTab1 and pTab2. -*/ -static void addWhereTerm( - const char *zCol, /* Name of the column */ - const Table *pTab1, /* First table */ - const Table *pTab2, /* Second table */ - Expr **ppExpr /* Add the equality term to this expression */ -){ - Token dummy; - Expr *pE1a, *pE1b, *pE1c; - Expr *pE2a, *pE2b, *pE2c; - Expr *pE; - - dummy.z = zCol; - dummy.n = strlen(zCol); - dummy.dyn = 0; - pE1a = sqliteExpr(TK_ID, 0, 0, &dummy); - pE2a = sqliteExpr(TK_ID, 0, 0, &dummy); - dummy.z = pTab1->zName; - dummy.n = strlen(dummy.z); - pE1b = sqliteExpr(TK_ID, 0, 0, &dummy); - dummy.z = pTab2->zName; - dummy.n = strlen(dummy.z); - pE2b = sqliteExpr(TK_ID, 0, 0, &dummy); - pE1c = sqliteExpr(TK_DOT, pE1b, pE1a, 0); - pE2c = sqliteExpr(TK_DOT, pE2b, pE2a, 0); - pE = sqliteExpr(TK_EQ, pE1c, pE2c, 0); - ExprSetProperty(pE, EP_FromJoin); - if( *ppExpr ){ - *ppExpr = sqliteExpr(TK_AND, *ppExpr, pE, 0); - }else{ - *ppExpr = pE; - } -} - -/* -** Set the EP_FromJoin property on all terms of the given expression. -** -** The EP_FromJoin property is used on terms of an expression to tell -** the LEFT OUTER JOIN processing logic that this term is part of the -** join restriction specified in the ON or USING clause and not a part -** of the more general WHERE clause. These terms are moved over to the -** WHERE clause during join processing but we need to remember that they -** originated in the ON or USING clause. -*/ -static void setJoinExpr(Expr *p){ - while( p ){ - ExprSetProperty(p, EP_FromJoin); - setJoinExpr(p->pLeft); - p = p->pRight; - } -} - -/* -** This routine processes the join information for a SELECT statement. -** ON and USING clauses are converted into extra terms of the WHERE clause. -** NATURAL joins also create extra WHERE clause terms. -** -** This routine returns the number of errors encountered. -*/ -static int sqliteProcessJoin(Parse *pParse, Select *p){ - SrcList *pSrc; - int i, j; - pSrc = p->pSrc; - for(i=0; inSrc-1; i++){ - struct SrcList_item *pTerm = &pSrc->a[i]; - struct SrcList_item *pOther = &pSrc->a[i+1]; - - if( pTerm->pTab==0 || pOther->pTab==0 ) continue; - - /* When the NATURAL keyword is present, add WHERE clause terms for - ** every column that the two tables have in common. - */ - if( pTerm->jointype & JT_NATURAL ){ - Table *pTab; - if( pTerm->pOn || pTerm->pUsing ){ - sqliteErrorMsg(pParse, "a NATURAL join may not have " - "an ON or USING clause", 0); - return 1; - } - pTab = pTerm->pTab; - for(j=0; jnCol; j++){ - if( columnIndex(pOther->pTab, pTab->aCol[j].zName)>=0 ){ - addWhereTerm(pTab->aCol[j].zName, pTab, pOther->pTab, &p->pWhere); - } - } - } - - /* Disallow both ON and USING clauses in the same join - */ - if( pTerm->pOn && pTerm->pUsing ){ - sqliteErrorMsg(pParse, "cannot have both ON and USING " - "clauses in the same join"); - return 1; - } - - /* Add the ON clause to the end of the WHERE clause, connected by - ** and AND operator. - */ - if( pTerm->pOn ){ - setJoinExpr(pTerm->pOn); - if( p->pWhere==0 ){ - p->pWhere = pTerm->pOn; - }else{ - p->pWhere = sqliteExpr(TK_AND, p->pWhere, pTerm->pOn, 0); - } - pTerm->pOn = 0; - } - - /* Create extra terms on the WHERE clause for each column named - ** in the USING clause. Example: If the two tables to be joined are - ** A and B and the USING clause names X, Y, and Z, then add this - ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z - ** Report an error if any column mentioned in the USING clause is - ** not contained in both tables to be joined. - */ - if( pTerm->pUsing ){ - IdList *pList; - int j; - assert( inSrc-1 ); - pList = pTerm->pUsing; - for(j=0; jnId; j++){ - if( columnIndex(pTerm->pTab, pList->a[j].zName)<0 || - columnIndex(pOther->pTab, pList->a[j].zName)<0 ){ - sqliteErrorMsg(pParse, "cannot join using column %s - column " - "not present in both tables", pList->a[j].zName); - return 1; - } - addWhereTerm(pList->a[j].zName, pTerm->pTab, pOther->pTab, &p->pWhere); - } - } - } - return 0; -} - -/* -** Delete the given Select structure and all of its substructures. -*/ -void sqliteSelectDelete(Select *p){ - if( p==0 ) return; - sqliteExprListDelete(p->pEList); - sqliteSrcListDelete(p->pSrc); - sqliteExprDelete(p->pWhere); - sqliteExprListDelete(p->pGroupBy); - sqliteExprDelete(p->pHaving); - sqliteExprListDelete(p->pOrderBy); - sqliteSelectDelete(p->pPrior); - sqliteFree(p->zSelect); - sqliteFree(p); -} - -/* -** Delete the aggregate information from the parse structure. -*/ -static void sqliteAggregateInfoReset(Parse *pParse){ - sqliteFree(pParse->aAgg); - pParse->aAgg = 0; - pParse->nAgg = 0; - pParse->useAgg = 0; -} - -/* -** Insert code into "v" that will push the record on the top of the -** stack into the sorter. -*/ -static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){ - char *zSortOrder; - int i; - zSortOrder = sqliteMalloc( pOrderBy->nExpr + 1 ); - if( zSortOrder==0 ) return; - for(i=0; inExpr; i++){ - int order = pOrderBy->a[i].sortOrder; - int type; - int c; - if( (order & SQLITE_SO_TYPEMASK)==SQLITE_SO_TEXT ){ - type = SQLITE_SO_TEXT; - }else if( (order & SQLITE_SO_TYPEMASK)==SQLITE_SO_NUM ){ - type = SQLITE_SO_NUM; - }else if( pParse->db->file_format>=4 ){ - type = sqliteExprType(pOrderBy->a[i].pExpr); - }else{ - type = SQLITE_SO_NUM; - } - if( (order & SQLITE_SO_DIRMASK)==SQLITE_SO_ASC ){ - c = type==SQLITE_SO_TEXT ? 'A' : '+'; - }else{ - c = type==SQLITE_SO_TEXT ? 'D' : '-'; - } - zSortOrder[i] = c; - sqliteExprCode(pParse, pOrderBy->a[i].pExpr); - } - zSortOrder[pOrderBy->nExpr] = 0; - sqliteVdbeOp3(v, OP_SortMakeKey, pOrderBy->nExpr, 0, zSortOrder, P3_DYNAMIC); - sqliteVdbeAddOp(v, OP_SortPut, 0, 0); -} - -/* -** This routine adds a P3 argument to the last VDBE opcode that was -** inserted. The P3 argument added is a string suitable for the -** OP_MakeKey or OP_MakeIdxKey opcodes. The string consists of -** characters 't' or 'n' depending on whether or not the various -** fields of the key to be generated should be treated as numeric -** or as text. See the OP_MakeKey and OP_MakeIdxKey opcode -** documentation for additional information about the P3 string. -** See also the sqliteAddIdxKeyType() routine. -*/ -void sqliteAddKeyType(Vdbe *v, ExprList *pEList){ - int nColumn = pEList->nExpr; - char *zType = sqliteMalloc( nColumn+1 ); - int i; - if( zType==0 ) return; - for(i=0; ia[i].pExpr)==SQLITE_SO_NUM ? 'n' : 't'; - } - zType[i] = 0; - sqliteVdbeChangeP3(v, -1, zType, P3_DYNAMIC); -} - -/* -** Add code to implement the OFFSET and LIMIT -*/ -static void codeLimiter( - Vdbe *v, /* Generate code into this VM */ - Select *p, /* The SELECT statement being coded */ - int iContinue, /* Jump here to skip the current record */ - int iBreak, /* Jump here to end the loop */ - int nPop /* Number of times to pop stack when jumping */ -){ - if( p->iOffset>=0 ){ - int addr = sqliteVdbeCurrentAddr(v) + 2; - if( nPop>0 ) addr++; - sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr); - if( nPop>0 ){ - sqliteVdbeAddOp(v, OP_Pop, nPop, 0); - } - sqliteVdbeAddOp(v, OP_Goto, 0, iContinue); - } - if( p->iLimit>=0 ){ - sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak); - } -} - -/* -** This routine generates the code for the inside of the inner loop -** of a SELECT. -** -** If srcTab and nColumn are both zero, then the pEList expressions -** are evaluated in order to get the data for this row. If nColumn>0 -** then data is pulled from srcTab and pEList is used only to get the -** datatypes for each column. -*/ -static int selectInnerLoop( - Parse *pParse, /* The parser context */ - Select *p, /* The complete select statement being coded */ - ExprList *pEList, /* List of values being extracted */ - int srcTab, /* Pull data from this table */ - int nColumn, /* Number of columns in the source table */ - ExprList *pOrderBy, /* If not NULL, sort results using this key */ - int distinct, /* If >=0, make sure results are distinct */ - int eDest, /* How to dispose of the results */ - int iParm, /* An argument to the disposal method */ - int iContinue, /* Jump here to continue with next row */ - int iBreak /* Jump here to break out of the inner loop */ -){ - Vdbe *v = pParse->pVdbe; - int i; - int hasDistinct; /* True if the DISTINCT keyword is present */ - - if( v==0 ) return 0; - assert( pEList!=0 ); - - /* If there was a LIMIT clause on the SELECT statement, then do the check - ** to see if this row should be output. - */ - hasDistinct = distinct>=0 && pEList && pEList->nExpr>0; - if( pOrderBy==0 && !hasDistinct ){ - codeLimiter(v, p, iContinue, iBreak, 0); - } - - /* Pull the requested columns. - */ - if( nColumn>0 ){ - for(i=0; inExpr; - for(i=0; inExpr; i++){ - sqliteExprCode(pParse, pEList->a[i].pExpr); - } - } - - /* If the DISTINCT keyword was present on the SELECT statement - ** and this row has been seen before, then do not make this row - ** part of the result. - */ - if( hasDistinct ){ -#if NULL_ALWAYS_DISTINCT - sqliteVdbeAddOp(v, OP_IsNull, -pEList->nExpr, sqliteVdbeCurrentAddr(v)+7); -#endif - sqliteVdbeAddOp(v, OP_MakeKey, pEList->nExpr, 1); - if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pEList); - sqliteVdbeAddOp(v, OP_Distinct, distinct, sqliteVdbeCurrentAddr(v)+3); - sqliteVdbeAddOp(v, OP_Pop, pEList->nExpr+1, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, iContinue); - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_PutStrKey, distinct, 0); - if( pOrderBy==0 ){ - codeLimiter(v, p, iContinue, iBreak, nColumn); - } - } - - switch( eDest ){ - /* In this mode, write each query result to the key of the temporary - ** table iParm. - */ - case SRT_Union: { - sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); - break; - } - - /* Store the result as data using a unique key. - */ - case SRT_Table: - case SRT_TempTable: { - sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); - if( pOrderBy ){ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0); - sqliteVdbeAddOp(v, OP_Pull, 1, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0); - } - break; - } - - /* Construct a record from the query result, but instead of - ** saving that record, use it as a key to delete elements from - ** the temporary table iParm. - */ - case SRT_Except: { - int addr; - addr = sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); - sqliteVdbeAddOp(v, OP_NotFound, iParm, addr+3); - sqliteVdbeAddOp(v, OP_Delete, iParm, 0); - break; - } - - /* If we are creating a set for an "expr IN (SELECT ...)" construct, - ** then there should be a single item on the stack. Write this - ** item into the set table with bogus data. - */ - case SRT_Set: { - int addr1 = sqliteVdbeCurrentAddr(v); - int addr2; - assert( nColumn==1 ); - sqliteVdbeAddOp(v, OP_NotNull, -1, addr1+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - addr2 = sqliteVdbeAddOp(v, OP_Goto, 0, 0); - if( pOrderBy ){ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); - } - sqliteVdbeChangeP2(v, addr2, sqliteVdbeCurrentAddr(v)); - break; - } - - /* If this is a scalar select that is part of an expression, then - ** store the results in the appropriate memory cell and break out - ** of the scan loop. - */ - case SRT_Mem: { - assert( nColumn==1 ); - if( pOrderBy ){ - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); - sqliteVdbeAddOp(v, OP_Goto, 0, iBreak); - } - break; - } - - /* Send the data to the callback function. - */ - case SRT_Callback: - case SRT_Sorter: { - if( pOrderBy ){ - sqliteVdbeAddOp(v, OP_SortMakeRec, nColumn, 0); - pushOntoSorter(pParse, v, pOrderBy); - }else{ - assert( eDest==SRT_Callback ); - sqliteVdbeAddOp(v, OP_Callback, nColumn, 0); - } - break; - } - - /* Invoke a subroutine to handle the results. The subroutine itself - ** is responsible for popping the results off of the stack. - */ - case SRT_Subroutine: { - if( pOrderBy ){ - sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); - pushOntoSorter(pParse, v, pOrderBy); - }else{ - sqliteVdbeAddOp(v, OP_Gosub, 0, iParm); - } - break; - } - - /* Discard the results. This is used for SELECT statements inside - ** the body of a TRIGGER. The purpose of such selects is to call - ** user-defined functions that have side effects. We do not care - ** about the actual results of the select. - */ - default: { - assert( eDest==SRT_Discard ); - sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); - break; - } - } - return 0; -} - -/* -** If the inner loop was generated using a non-null pOrderBy argument, -** then the results were placed in a sorter. After the loop is terminated -** we need to run the sorter and output the results. The following -** routine generates the code needed to do that. -*/ -static void generateSortTail( - Select *p, /* The SELECT statement */ - Vdbe *v, /* Generate code into this VDBE */ - int nColumn, /* Number of columns of data */ - int eDest, /* Write the sorted results here */ - int iParm /* Optional parameter associated with eDest */ -){ - int end1 = sqliteVdbeMakeLabel(v); - int end2 = sqliteVdbeMakeLabel(v); - int addr; - if( eDest==SRT_Sorter ) return; - sqliteVdbeAddOp(v, OP_Sort, 0, 0); - addr = sqliteVdbeAddOp(v, OP_SortNext, 0, end1); - codeLimiter(v, p, addr, end2, 1); - switch( eDest ){ - case SRT_Callback: { - sqliteVdbeAddOp(v, OP_SortCallback, nColumn, 0); - break; - } - case SRT_Table: - case SRT_TempTable: { - sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0); - sqliteVdbeAddOp(v, OP_Pull, 1, 0); - sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0); - break; - } - case SRT_Set: { - assert( nColumn==1 ); - sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); - sqliteVdbeAddOp(v, OP_Pop, 1, 0); - sqliteVdbeAddOp(v, OP_Goto, 0, sqliteVdbeCurrentAddr(v)+3); - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); - break; - } - case SRT_Mem: { - assert( nColumn==1 ); - sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); - sqliteVdbeAddOp(v, OP_Goto, 0, end1); - break; - } - case SRT_Subroutine: { - int i; - for(i=0; ipVdbe; - int i, j; - for(i=0; inExpr; i++){ - Expr *p = pEList->a[i].pExpr; - char *zType = 0; - if( p==0 ) continue; - if( p->op==TK_COLUMN && pTabList ){ - Table *pTab; - int iCol = p->iColumn; - for(j=0; jnSrc && pTabList->a[j].iCursor!=p->iTable; j++){} - assert( jnSrc ); - pTab = pTabList->a[j].pTab; - if( iCol<0 ) iCol = pTab->iPKey; - assert( iCol==-1 || (iCol>=0 && iColnCol) ); - if( iCol<0 ){ - zType = "INTEGER"; - }else{ - zType = pTab->aCol[iCol].zType; - } - }else{ - if( sqliteExprType(p)==SQLITE_SO_TEXT ){ - zType = "TEXT"; - }else{ - zType = "NUMERIC"; - } - } - sqliteVdbeOp3(v, OP_ColumnName, i + pEList->nExpr, 0, zType, 0); - } -} - -/* -** Generate code that will tell the VDBE the names of columns -** in the result set. This information is used to provide the -** azCol[] values in the callback. -*/ -static void generateColumnNames( - Parse *pParse, /* Parser context */ - SrcList *pTabList, /* List of tables */ - ExprList *pEList /* Expressions defining the result set */ -){ - Vdbe *v = pParse->pVdbe; - int i, j; - sqlite *db = pParse->db; - int fullNames, shortNames; - - assert( v!=0 ); - if( pParse->colNamesSet || v==0 || sqlite_malloc_failed ) return; - pParse->colNamesSet = 1; - fullNames = (db->flags & SQLITE_FullColNames)!=0; - shortNames = (db->flags & SQLITE_ShortColNames)!=0; - for(i=0; inExpr; i++){ - Expr *p; - int p2 = i==pEList->nExpr-1; - p = pEList->a[i].pExpr; - if( p==0 ) continue; - if( pEList->a[i].zName ){ - char *zName = pEList->a[i].zName; - sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0); - continue; - } - if( p->op==TK_COLUMN && pTabList ){ - Table *pTab; - char *zCol; - int iCol = p->iColumn; - for(j=0; jnSrc && pTabList->a[j].iCursor!=p->iTable; j++){} - assert( jnSrc ); - pTab = pTabList->a[j].pTab; - if( iCol<0 ) iCol = pTab->iPKey; - assert( iCol==-1 || (iCol>=0 && iColnCol) ); - if( iCol<0 ){ - zCol = "_ROWID_"; - }else{ - zCol = pTab->aCol[iCol].zName; - } - if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){ - int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n); - sqliteVdbeCompressSpace(v, addr); - }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){ - char *zName = 0; - char *zTab; - - zTab = pTabList->a[j].zAlias; - if( fullNames || zTab==0 ) zTab = pTab->zName; - sqliteSetString(&zName, zTab, ".", zCol, 0); - sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, P3_DYNAMIC); - }else{ - sqliteVdbeOp3(v, OP_ColumnName, i, p2, zCol, 0); - } - }else if( p->span.z && p->span.z[0] ){ - int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n); - sqliteVdbeCompressSpace(v, addr); - }else{ - char zName[30]; - assert( p->op!=TK_COLUMN || pTabList==0 ); - sprintf(zName, "column%d", i+1); - sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0); - } - } -} - -/* -** Name of the connection operator, used for error messages. -*/ -static const char *selectOpName(int id){ - char *z; - switch( id ){ - case TK_ALL: z = "UNION ALL"; break; - case TK_INTERSECT: z = "INTERSECT"; break; - case TK_EXCEPT: z = "EXCEPT"; break; - default: z = "UNION"; break; - } - return z; -} - -/* -** Forward declaration -*/ -static int fillInColumnList(Parse*, Select*); - -/* -** Given a SELECT statement, generate a Table structure that describes -** the result set of that SELECT. -*/ -Table *sqliteResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){ - Table *pTab; - int i, j; - ExprList *pEList; - Column *aCol; - - if( fillInColumnList(pParse, pSelect) ){ - return 0; - } - pTab = sqliteMalloc( sizeof(Table) ); - if( pTab==0 ){ - return 0; - } - pTab->zName = zTabName ? sqliteStrDup(zTabName) : 0; - pEList = pSelect->pEList; - pTab->nCol = pEList->nExpr; - assert( pTab->nCol>0 ); - pTab->aCol = aCol = sqliteMalloc( sizeof(pTab->aCol[0])*pTab->nCol ); - for(i=0; inCol; i++){ - Expr *p, *pR; - if( pEList->a[i].zName ){ - aCol[i].zName = sqliteStrDup(pEList->a[i].zName); - }else if( (p=pEList->a[i].pExpr)->op==TK_DOT - && (pR=p->pRight)!=0 && pR->token.z && pR->token.z[0] ){ - int cnt; - sqliteSetNString(&aCol[i].zName, pR->token.z, pR->token.n, 0); - for(j=cnt=0; jtoken.z, pR->token.n, zBuf, n,0); - j = -1; - } - } - }else if( p->span.z && p->span.z[0] ){ - sqliteSetNString(&pTab->aCol[i].zName, p->span.z, p->span.n, 0); - }else{ - char zBuf[30]; - sprintf(zBuf, "column%d", i+1); - aCol[i].zName = sqliteStrDup(zBuf); - } - sqliteDequote(aCol[i].zName); - } - pTab->iPKey = -1; - return pTab; -} - -/* -** For the given SELECT statement, do three things. -** -** (1) Fill in the pTabList->a[].pTab fields in the SrcList that -** defines the set of tables that should be scanned. For views, -** fill pTabList->a[].pSelect with a copy of the SELECT statement -** that implements the view. A copy is made of the view's SELECT -** statement so that we can freely modify or delete that statement -** without worrying about messing up the presistent representation -** of the view. -** -** (2) Add terms to the WHERE clause to accomodate the NATURAL keyword -** on joins and the ON and USING clause of joins. -** -** (3) Scan the list of columns in the result set (pEList) looking -** for instances of the "*" operator or the TABLE.* operator. -** If found, expand each "*" to be every column in every table -** and TABLE.* to be every column in TABLE. -** -** Return 0 on success. If there are problems, leave an error message -** in pParse and return non-zero. -*/ -static int fillInColumnList(Parse *pParse, Select *p){ - int i, j, k, rc; - SrcList *pTabList; - ExprList *pEList; - Table *pTab; - - if( p==0 || p->pSrc==0 ) return 1; - pTabList = p->pSrc; - pEList = p->pEList; - - /* Look up every table in the table list. - */ - for(i=0; inSrc; i++){ - if( pTabList->a[i].pTab ){ - /* This routine has run before! No need to continue */ - return 0; - } - if( pTabList->a[i].zName==0 ){ - /* A sub-query in the FROM clause of a SELECT */ - assert( pTabList->a[i].pSelect!=0 ); - if( pTabList->a[i].zAlias==0 ){ - char zFakeName[60]; - sprintf(zFakeName, "sqlite_subquery_%p_", - (void*)pTabList->a[i].pSelect); - sqliteSetString(&pTabList->a[i].zAlias, zFakeName, 0); - } - pTabList->a[i].pTab = pTab = - sqliteResultSetOfSelect(pParse, pTabList->a[i].zAlias, - pTabList->a[i].pSelect); - if( pTab==0 ){ - return 1; - } - /* The isTransient flag indicates that the Table structure has been - ** dynamically allocated and may be freed at any time. In other words, - ** pTab is not pointing to a persistent table structure that defines - ** part of the schema. */ - pTab->isTransient = 1; - }else{ - /* An ordinary table or view name in the FROM clause */ - pTabList->a[i].pTab = pTab = - sqliteLocateTable(pParse,pTabList->a[i].zName,pTabList->a[i].zDatabase); - if( pTab==0 ){ - return 1; - } - if( pTab->pSelect ){ - /* We reach here if the named table is a really a view */ - if( sqliteViewGetColumnNames(pParse, pTab) ){ - return 1; - } - /* If pTabList->a[i].pSelect!=0 it means we are dealing with a - ** view within a view. The SELECT structure has already been - ** copied by the outer view so we can skip the copy step here - ** in the inner view. - */ - if( pTabList->a[i].pSelect==0 ){ - pTabList->a[i].pSelect = sqliteSelectDup(pTab->pSelect); - } - } - } - } - - /* Process NATURAL keywords, and ON and USING clauses of joins. - */ - if( sqliteProcessJoin(pParse, p) ) return 1; - - /* For every "*" that occurs in the column list, insert the names of - ** all columns in all tables. And for every TABLE.* insert the names - ** of all columns in TABLE. The parser inserted a special expression - ** with the TK_ALL operator for each "*" that it found in the column list. - ** The following code just has to locate the TK_ALL expressions and expand - ** each one to the list of all columns in all tables. - ** - ** The first loop just checks to see if there are any "*" operators - ** that need expanding. - */ - for(k=0; knExpr; k++){ - Expr *pE = pEList->a[k].pExpr; - if( pE->op==TK_ALL ) break; - if( pE->op==TK_DOT && pE->pRight && pE->pRight->op==TK_ALL - && pE->pLeft && pE->pLeft->op==TK_ID ) break; - } - rc = 0; - if( knExpr ){ - /* - ** If we get here it means the result set contains one or more "*" - ** operators that need to be expanded. Loop through each expression - ** in the result set and expand them one by one. - */ - struct ExprList_item *a = pEList->a; - ExprList *pNew = 0; - for(k=0; knExpr; k++){ - Expr *pE = a[k].pExpr; - if( pE->op!=TK_ALL && - (pE->op!=TK_DOT || pE->pRight==0 || pE->pRight->op!=TK_ALL) ){ - /* This particular expression does not need to be expanded. - */ - pNew = sqliteExprListAppend(pNew, a[k].pExpr, 0); - pNew->a[pNew->nExpr-1].zName = a[k].zName; - a[k].pExpr = 0; - a[k].zName = 0; - }else{ - /* This expression is a "*" or a "TABLE.*" and needs to be - ** expanded. */ - int tableSeen = 0; /* Set to 1 when TABLE matches */ - char *zTName; /* text of name of TABLE */ - if( pE->op==TK_DOT && pE->pLeft ){ - zTName = sqliteTableNameFromToken(&pE->pLeft->token); - }else{ - zTName = 0; - } - for(i=0; inSrc; i++){ - Table *pTab = pTabList->a[i].pTab; - char *zTabName = pTabList->a[i].zAlias; - if( zTabName==0 || zTabName[0]==0 ){ - zTabName = pTab->zName; - } - if( zTName && (zTabName==0 || zTabName[0]==0 || - sqliteStrICmp(zTName, zTabName)!=0) ){ - continue; - } - tableSeen = 1; - for(j=0; jnCol; j++){ - Expr *pExpr, *pLeft, *pRight; - char *zName = pTab->aCol[j].zName; - - if( i>0 && (pTabList->a[i-1].jointype & JT_NATURAL)!=0 && - columnIndex(pTabList->a[i-1].pTab, zName)>=0 ){ - /* In a NATURAL join, omit the join columns from the - ** table on the right */ - continue; - } - if( i>0 && sqliteIdListIndex(pTabList->a[i-1].pUsing, zName)>=0 ){ - /* In a join with a USING clause, omit columns in the - ** using clause from the table on the right. */ - continue; - } - pRight = sqliteExpr(TK_ID, 0, 0, 0); - if( pRight==0 ) break; - pRight->token.z = zName; - pRight->token.n = strlen(zName); - pRight->token.dyn = 0; - if( zTabName && pTabList->nSrc>1 ){ - pLeft = sqliteExpr(TK_ID, 0, 0, 0); - pExpr = sqliteExpr(TK_DOT, pLeft, pRight, 0); - if( pExpr==0 ) break; - pLeft->token.z = zTabName; - pLeft->token.n = strlen(zTabName); - pLeft->token.dyn = 0; - sqliteSetString((char**)&pExpr->span.z, zTabName, ".", zName, 0); - pExpr->span.n = strlen(pExpr->span.z); - pExpr->span.dyn = 1; - pExpr->token.z = 0; - pExpr->token.n = 0; - pExpr->token.dyn = 0; - }else{ - pExpr = pRight; - pExpr->span = pExpr->token; - } - pNew = sqliteExprListAppend(pNew, pExpr, 0); - } - } - if( !tableSeen ){ - if( zTName ){ - sqliteErrorMsg(pParse, "no such table: %s", zTName); - }else{ - sqliteErrorMsg(pParse, "no tables specified"); - } - rc = 1; - } - sqliteFree(zTName); - } - } - sqliteExprListDelete(pEList); - p->pEList = pNew; - } - return rc; -} - -/* -** This routine recursively unlinks the Select.pSrc.a[].pTab pointers -** in a select structure. It just sets the pointers to NULL. This -** routine is recursive in the sense that if the Select.pSrc.a[].pSelect -** pointer is not NULL, this routine is called recursively on that pointer. -** -** This routine is called on the Select structure that defines a -** VIEW in order to undo any bindings to tables. This is necessary -** because those tables might be DROPed by a subsequent SQL command. -** If the bindings are not removed, then the Select.pSrc->a[].pTab field -** will be left pointing to a deallocated Table structure after the -** DROP and a coredump will occur the next time the VIEW is used. -*/ -void sqliteSelectUnbind(Select *p){ - int i; - SrcList *pSrc = p->pSrc; - Table *pTab; - if( p==0 ) return; - for(i=0; inSrc; i++){ - if( (pTab = pSrc->a[i].pTab)!=0 ){ - if( pTab->isTransient ){ - sqliteDeleteTable(0, pTab); - } - pSrc->a[i].pTab = 0; - if( pSrc->a[i].pSelect ){ - sqliteSelectUnbind(pSrc->a[i].pSelect); - } - } - } -} - -/* -** This routine associates entries in an ORDER BY expression list with -** columns in a result. For each ORDER BY expression, the opcode of -** the top-level node is changed to TK_COLUMN and the iColumn value of -** the top-level node is filled in with column number and the iTable -** value of the top-level node is filled with iTable parameter. -** -** If there are prior SELECT clauses, they are processed first. A match -** in an earlier SELECT takes precedence over a later SELECT. -** -** Any entry that does not match is flagged as an error. The number -** of errors is returned. -** -** This routine does NOT correctly initialize the Expr.dataType field -** of the ORDER BY expressions. The multiSelectSortOrder() routine -** must be called to do that after the individual select statements -** have all been analyzed. This routine is unable to compute Expr.dataType -** because it must be called before the individual select statements -** have been analyzed. -*/ -static int matchOrderbyToColumn( - Parse *pParse, /* A place to leave error messages */ - Select *pSelect, /* Match to result columns of this SELECT */ - ExprList *pOrderBy, /* The ORDER BY values to match against columns */ - int iTable, /* Insert this value in iTable */ - int mustComplete /* If TRUE all ORDER BYs must match */ -){ - int nErr = 0; - int i, j; - ExprList *pEList; - - if( pSelect==0 || pOrderBy==0 ) return 1; - if( mustComplete ){ - for(i=0; inExpr; i++){ pOrderBy->a[i].done = 0; } - } - if( fillInColumnList(pParse, pSelect) ){ - return 1; - } - if( pSelect->pPrior ){ - if( matchOrderbyToColumn(pParse, pSelect->pPrior, pOrderBy, iTable, 0) ){ - return 1; - } - } - pEList = pSelect->pEList; - for(i=0; inExpr; i++){ - Expr *pE = pOrderBy->a[i].pExpr; - int iCol = -1; - if( pOrderBy->a[i].done ) continue; - if( sqliteExprIsInteger(pE, &iCol) ){ - if( iCol<=0 || iCol>pEList->nExpr ){ - sqliteErrorMsg(pParse, - "ORDER BY position %d should be between 1 and %d", - iCol, pEList->nExpr); - nErr++; - break; - } - if( !mustComplete ) continue; - iCol--; - } - for(j=0; iCol<0 && jnExpr; j++){ - if( pEList->a[j].zName && (pE->op==TK_ID || pE->op==TK_STRING) ){ - char *zName, *zLabel; - zName = pEList->a[j].zName; - assert( pE->token.z ); - zLabel = sqliteStrNDup(pE->token.z, pE->token.n); - sqliteDequote(zLabel); - if( sqliteStrICmp(zName, zLabel)==0 ){ - iCol = j; - } - sqliteFree(zLabel); - } - if( iCol<0 && sqliteExprCompare(pE, pEList->a[j].pExpr) ){ - iCol = j; - } - } - if( iCol>=0 ){ - pE->op = TK_COLUMN; - pE->iColumn = iCol; - pE->iTable = iTable; - pOrderBy->a[i].done = 1; - } - if( iCol<0 && mustComplete ){ - sqliteErrorMsg(pParse, - "ORDER BY term number %d does not match any result column", i+1); - nErr++; - break; - } - } - return nErr; -} - -/* -** Get a VDBE for the given parser context. Create a new one if necessary. -** If an error occurs, return NULL and leave a message in pParse. -*/ -Vdbe *sqliteGetVdbe(Parse *pParse){ - Vdbe *v = pParse->pVdbe; - if( v==0 ){ - v = pParse->pVdbe = sqliteVdbeCreate(pParse->db); - } - return v; -} - -/* -** This routine sets the Expr.dataType field on all elements of -** the pOrderBy expression list. The pOrderBy list will have been -** set up by matchOrderbyToColumn(). Hence each expression has -** a TK_COLUMN as its root node. The Expr.iColumn refers to a -** column in the result set. The datatype is set to SQLITE_SO_TEXT -** if the corresponding column in p and every SELECT to the left of -** p has a datatype of SQLITE_SO_TEXT. If the cooressponding column -** in p or any of the left SELECTs is SQLITE_SO_NUM, then the datatype -** of the order-by expression is set to SQLITE_SO_NUM. -** -** Examples: -** -** CREATE TABLE one(a INTEGER, b TEXT); -** CREATE TABLE two(c VARCHAR(5), d FLOAT); -** -** SELECT b, b FROM one UNION SELECT d, c FROM two ORDER BY 1, 2; -** -** The primary sort key will use SQLITE_SO_NUM because the "d" in -** the second SELECT is numeric. The 1st column of the first SELECT -** is text but that does not matter because a numeric always overrides -** a text. -** -** The secondary key will use the SQLITE_SO_TEXT sort order because -** both the (second) "b" in the first SELECT and the "c" in the second -** SELECT have a datatype of text. -*/ -static void multiSelectSortOrder(Select *p, ExprList *pOrderBy){ - int i; - ExprList *pEList; - if( pOrderBy==0 ) return; - if( p==0 ){ - for(i=0; inExpr; i++){ - pOrderBy->a[i].pExpr->dataType = SQLITE_SO_TEXT; - } - return; - } - multiSelectSortOrder(p->pPrior, pOrderBy); - pEList = p->pEList; - for(i=0; inExpr; i++){ - Expr *pE = pOrderBy->a[i].pExpr; - if( pE->dataType==SQLITE_SO_NUM ) continue; - assert( pE->iColumn>=0 ); - if( pEList->nExpr>pE->iColumn ){ - pE->dataType = sqliteExprType(pEList->a[pE->iColumn].pExpr); - } - } -} - -/* -** Compute the iLimit and iOffset fields of the SELECT based on the -** nLimit and nOffset fields. nLimit and nOffset hold the integers -** that appear in the original SQL statement after the LIMIT and OFFSET -** keywords. Or that hold -1 and 0 if those keywords are omitted. -** iLimit and iOffset are the integer memory register numbers for -** counters used to compute the limit and offset. If there is no -** limit and/or offset, then iLimit and iOffset are negative. -** -** This routine changes the values if iLimit and iOffset only if -** a limit or offset is defined by nLimit and nOffset. iLimit and -** iOffset should have been preset to appropriate default values -** (usually but not always -1) prior to calling this routine. -** Only if nLimit>=0 or nOffset>0 do the limit registers get -** redefined. The UNION ALL operator uses this property to force -** the reuse of the same limit and offset registers across multiple -** SELECT statements. -*/ -static void computeLimitRegisters(Parse *pParse, Select *p){ - /* - ** If the comparison is p->nLimit>0 then "LIMIT 0" shows - ** all rows. It is the same as no limit. If the comparision is - ** p->nLimit>=0 then "LIMIT 0" show no rows at all. - ** "LIMIT -1" always shows all rows. There is some - ** contraversy about what the correct behavior should be. - ** The current implementation interprets "LIMIT 0" to mean - ** no rows. - */ - if( p->nLimit>=0 ){ - int iMem = pParse->nMem++; - Vdbe *v = sqliteGetVdbe(pParse); - if( v==0 ) return; - sqliteVdbeAddOp(v, OP_Integer, -p->nLimit, 0); - sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); - p->iLimit = iMem; - } - if( p->nOffset>0 ){ - int iMem = pParse->nMem++; - Vdbe *v = sqliteGetVdbe(pParse); - if( v==0 ) return; - sqliteVdbeAddOp(v, OP_Integer, -p->nOffset, 0); - sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); - p->iOffset = iMem; - } -} - -/* -** This routine is called to process a query that is really the union -** or intersection of two or more separate queries. -** -** "p" points to the right-most of the two queries. the query on the -** left is p->pPrior. The left query could also be a compound query -** in which case this routine will be called recursively. -** -** The results of the total query are to be written into a destination -** of type eDest with parameter iParm. -** -** Example 1: Consider a three-way compound SQL statement. -** -** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3 -** -** This statement is parsed up as follows: -** -** SELECT c FROM t3 -** | -** `-----> SELECT b FROM t2 -** | -** `------> SELECT a FROM t1 -** -** The arrows in the diagram above represent the Select.pPrior pointer. -** So if this routine is called with p equal to the t3 query, then -** pPrior will be the t2 query. p->op will be TK_UNION in this case. -** -** Notice that because of the way SQLite parses compound SELECTs, the -** individual selects always group from left to right. -*/ -static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ - int rc; /* Success code from a subroutine */ - Select *pPrior; /* Another SELECT immediately to our left */ - Vdbe *v; /* Generate code to this VDBE */ - - /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only - ** the last SELECT in the series may have an ORDER BY or LIMIT. - */ - if( p==0 || p->pPrior==0 ) return 1; - pPrior = p->pPrior; - if( pPrior->pOrderBy ){ - sqliteErrorMsg(pParse,"ORDER BY clause should come after %s not before", - selectOpName(p->op)); - return 1; - } - if( pPrior->nLimit>=0 || pPrior->nOffset>0 ){ - sqliteErrorMsg(pParse,"LIMIT clause should come after %s not before", - selectOpName(p->op)); - return 1; - } - - /* Make sure we have a valid query engine. If not, create a new one. - */ - v = sqliteGetVdbe(pParse); - if( v==0 ) return 1; - - /* Create the destination temporary table if necessary - */ - if( eDest==SRT_TempTable ){ - sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); - eDest = SRT_Table; - } - - /* Generate code for the left and right SELECT statements. - */ - switch( p->op ){ - case TK_ALL: { - if( p->pOrderBy==0 ){ - pPrior->nLimit = p->nLimit; - pPrior->nOffset = p->nOffset; - rc = sqliteSelect(pParse, pPrior, eDest, iParm, 0, 0, 0); - if( rc ) return rc; - p->pPrior = 0; - p->iLimit = pPrior->iLimit; - p->iOffset = pPrior->iOffset; - p->nLimit = -1; - p->nOffset = 0; - rc = sqliteSelect(pParse, p, eDest, iParm, 0, 0, 0); - p->pPrior = pPrior; - if( rc ) return rc; - break; - } - /* For UNION ALL ... ORDER BY fall through to the next case */ - } - case TK_EXCEPT: - case TK_UNION: { - int unionTab; /* Cursor number of the temporary table holding result */ - int op; /* One of the SRT_ operations to apply to self */ - int priorOp; /* The SRT_ operation to apply to prior selects */ - int nLimit, nOffset; /* Saved values of p->nLimit and p->nOffset */ - ExprList *pOrderBy; /* The ORDER BY clause for the right SELECT */ - - priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union; - if( eDest==priorOp && p->pOrderBy==0 && p->nLimit<0 && p->nOffset==0 ){ - /* We can reuse a temporary table generated by a SELECT to our - ** right. - */ - unionTab = iParm; - }else{ - /* We will need to create our own temporary table to hold the - ** intermediate results. - */ - unionTab = pParse->nTab++; - if( p->pOrderBy - && matchOrderbyToColumn(pParse, p, p->pOrderBy, unionTab, 1) ){ - return 1; - } - if( p->op!=TK_ALL ){ - sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 1); - sqliteVdbeAddOp(v, OP_KeyAsData, unionTab, 1); - }else{ - sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 0); - } - } - - /* Code the SELECT statements to our left - */ - rc = sqliteSelect(pParse, pPrior, priorOp, unionTab, 0, 0, 0); - if( rc ) return rc; - - /* Code the current SELECT statement - */ - switch( p->op ){ - case TK_EXCEPT: op = SRT_Except; break; - case TK_UNION: op = SRT_Union; break; - case TK_ALL: op = SRT_Table; break; - } - p->pPrior = 0; - pOrderBy = p->pOrderBy; - p->pOrderBy = 0; - nLimit = p->nLimit; - p->nLimit = -1; - nOffset = p->nOffset; - p->nOffset = 0; - rc = sqliteSelect(pParse, p, op, unionTab, 0, 0, 0); - p->pPrior = pPrior; - p->pOrderBy = pOrderBy; - p->nLimit = nLimit; - p->nOffset = nOffset; - if( rc ) return rc; - - /* Convert the data in the temporary table into whatever form - ** it is that we currently need. - */ - if( eDest!=priorOp || unionTab!=iParm ){ - int iCont, iBreak, iStart; - assert( p->pEList ); - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, 0, p->pEList); - generateColumnTypes(pParse, p->pSrc, p->pEList); - } - iBreak = sqliteVdbeMakeLabel(v); - iCont = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_Rewind, unionTab, iBreak); - computeLimitRegisters(pParse, p); - iStart = sqliteVdbeCurrentAddr(v); - multiSelectSortOrder(p, p->pOrderBy); - rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr, - p->pOrderBy, -1, eDest, iParm, - iCont, iBreak); - if( rc ) return 1; - sqliteVdbeResolveLabel(v, iCont); - sqliteVdbeAddOp(v, OP_Next, unionTab, iStart); - sqliteVdbeResolveLabel(v, iBreak); - sqliteVdbeAddOp(v, OP_Close, unionTab, 0); - if( p->pOrderBy ){ - generateSortTail(p, v, p->pEList->nExpr, eDest, iParm); - } - } - break; - } - case TK_INTERSECT: { - int tab1, tab2; - int iCont, iBreak, iStart; - int nLimit, nOffset; - - /* INTERSECT is different from the others since it requires - ** two temporary tables. Hence it has its own case. Begin - ** by allocating the tables we will need. - */ - tab1 = pParse->nTab++; - tab2 = pParse->nTab++; - if( p->pOrderBy && matchOrderbyToColumn(pParse,p,p->pOrderBy,tab1,1) ){ - return 1; - } - sqliteVdbeAddOp(v, OP_OpenTemp, tab1, 1); - sqliteVdbeAddOp(v, OP_KeyAsData, tab1, 1); - - /* Code the SELECTs to our left into temporary table "tab1". - */ - rc = sqliteSelect(pParse, pPrior, SRT_Union, tab1, 0, 0, 0); - if( rc ) return rc; - - /* Code the current SELECT into temporary table "tab2" - */ - sqliteVdbeAddOp(v, OP_OpenTemp, tab2, 1); - sqliteVdbeAddOp(v, OP_KeyAsData, tab2, 1); - p->pPrior = 0; - nLimit = p->nLimit; - p->nLimit = -1; - nOffset = p->nOffset; - p->nOffset = 0; - rc = sqliteSelect(pParse, p, SRT_Union, tab2, 0, 0, 0); - p->pPrior = pPrior; - p->nLimit = nLimit; - p->nOffset = nOffset; - if( rc ) return rc; - - /* Generate code to take the intersection of the two temporary - ** tables. - */ - assert( p->pEList ); - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, 0, p->pEList); - generateColumnTypes(pParse, p->pSrc, p->pEList); - } - iBreak = sqliteVdbeMakeLabel(v); - iCont = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_Rewind, tab1, iBreak); - computeLimitRegisters(pParse, p); - iStart = sqliteVdbeAddOp(v, OP_FullKey, tab1, 0); - sqliteVdbeAddOp(v, OP_NotFound, tab2, iCont); - multiSelectSortOrder(p, p->pOrderBy); - rc = selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr, - p->pOrderBy, -1, eDest, iParm, - iCont, iBreak); - if( rc ) return 1; - sqliteVdbeResolveLabel(v, iCont); - sqliteVdbeAddOp(v, OP_Next, tab1, iStart); - sqliteVdbeResolveLabel(v, iBreak); - sqliteVdbeAddOp(v, OP_Close, tab2, 0); - sqliteVdbeAddOp(v, OP_Close, tab1, 0); - if( p->pOrderBy ){ - generateSortTail(p, v, p->pEList->nExpr, eDest, iParm); - } - break; - } - } - assert( p->pEList && pPrior->pEList ); - if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ - sqliteErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - return 1; - } - return 0; -} - -/* -** Scan through the expression pExpr. Replace every reference to -** a column in table number iTable with a copy of the iColumn-th -** entry in pEList. (But leave references to the ROWID column -** unchanged.) -** -** This routine is part of the flattening procedure. A subquery -** whose result set is defined by pEList appears as entry in the -** FROM clause of a SELECT such that the VDBE cursor assigned to that -** FORM clause entry is iTable. This routine make the necessary -** changes to pExpr so that it refers directly to the source table -** of the subquery rather the result set of the subquery. -*/ -static void substExprList(ExprList*,int,ExprList*); /* Forward Decl */ -static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){ - if( pExpr==0 ) return; - if( pExpr->op==TK_COLUMN && pExpr->iTable==iTable ){ - if( pExpr->iColumn<0 ){ - pExpr->op = TK_NULL; - }else{ - Expr *pNew; - assert( pEList!=0 && pExpr->iColumnnExpr ); - assert( pExpr->pLeft==0 && pExpr->pRight==0 && pExpr->pList==0 ); - pNew = pEList->a[pExpr->iColumn].pExpr; - assert( pNew!=0 ); - pExpr->op = pNew->op; - pExpr->dataType = pNew->dataType; - assert( pExpr->pLeft==0 ); - pExpr->pLeft = sqliteExprDup(pNew->pLeft); - assert( pExpr->pRight==0 ); - pExpr->pRight = sqliteExprDup(pNew->pRight); - assert( pExpr->pList==0 ); - pExpr->pList = sqliteExprListDup(pNew->pList); - pExpr->iTable = pNew->iTable; - pExpr->iColumn = pNew->iColumn; - pExpr->iAgg = pNew->iAgg; - sqliteTokenCopy(&pExpr->token, &pNew->token); - sqliteTokenCopy(&pExpr->span, &pNew->span); - } - }else{ - substExpr(pExpr->pLeft, iTable, pEList); - substExpr(pExpr->pRight, iTable, pEList); - substExprList(pExpr->pList, iTable, pEList); - } -} -static void -substExprList(ExprList *pList, int iTable, ExprList *pEList){ - int i; - if( pList==0 ) return; - for(i=0; inExpr; i++){ - substExpr(pList->a[i].pExpr, iTable, pEList); - } -} - -/* -** This routine attempts to flatten subqueries in order to speed -** execution. It returns 1 if it makes changes and 0 if no flattening -** occurs. -** -** To understand the concept of flattening, consider the following -** query: -** -** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5 -** -** The default way of implementing this query is to execute the -** subquery first and store the results in a temporary table, then -** run the outer query on that temporary table. This requires two -** passes over the data. Furthermore, because the temporary table -** has no indices, the WHERE clause on the outer query cannot be -** optimized. -** -** This routine attempts to rewrite queries such as the above into -** a single flat select, like this: -** -** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 -** -** The code generated for this simpification gives the same result -** but only has to scan the data once. And because indices might -** exist on the table t1, a complete scan of the data might be -** avoided. -** -** Flattening is only attempted if all of the following are true: -** -** (1) The subquery and the outer query do not both use aggregates. -** -** (2) The subquery is not an aggregate or the outer query is not a join. -** -** (3) The subquery is not the right operand of a left outer join, or -** the subquery is not itself a join. (Ticket #306) -** -** (4) The subquery is not DISTINCT or the outer query is not a join. -** -** (5) The subquery is not DISTINCT or the outer query does not use -** aggregates. -** -** (6) The subquery does not use aggregates or the outer query is not -** DISTINCT. -** -** (7) The subquery has a FROM clause. -** -** (8) The subquery does not use LIMIT or the outer query is not a join. -** -** (9) The subquery does not use LIMIT or the outer query does not use -** aggregates. -** -** (10) The subquery does not use aggregates or the outer query does not -** use LIMIT. -** -** (11) The subquery and the outer query do not both have ORDER BY clauses. -** -** (12) The subquery is not the right term of a LEFT OUTER JOIN or the -** subquery has no WHERE clause. (added by ticket #350) -** -** In this routine, the "p" parameter is a pointer to the outer query. -** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query -** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. -** -** If flattening is not attempted, this routine is a no-op and returns 0. -** If flattening is attempted this routine returns 1. -** -** All of the expression analysis must occur on both the outer query and -** the subquery before this routine runs. -*/ -static int flattenSubquery( - Parse *pParse, /* The parsing context */ - Select *p, /* The parent or outer SELECT statement */ - int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ - int isAgg, /* True if outer SELECT uses aggregate functions */ - int subqueryIsAgg /* True if the subquery uses aggregate functions */ -){ - Select *pSub; /* The inner query or "subquery" */ - SrcList *pSrc; /* The FROM clause of the outer query */ - SrcList *pSubSrc; /* The FROM clause of the subquery */ - ExprList *pList; /* The result set of the outer query */ - int iParent; /* VDBE cursor number of the pSub result set temp table */ - int i; - Expr *pWhere; - - /* Check to see if flattening is permitted. Return 0 if not. - */ - if( p==0 ) return 0; - pSrc = p->pSrc; - assert( pSrc && iFrom>=0 && iFromnSrc ); - pSub = pSrc->a[iFrom].pSelect; - assert( pSub!=0 ); - if( isAgg && subqueryIsAgg ) return 0; - if( subqueryIsAgg && pSrc->nSrc>1 ) return 0; - pSubSrc = pSub->pSrc; - assert( pSubSrc ); - if( pSubSrc->nSrc==0 ) return 0; - if( (pSub->isDistinct || pSub->nLimit>=0) && (pSrc->nSrc>1 || isAgg) ){ - return 0; - } - if( (p->isDistinct || p->nLimit>=0) && subqueryIsAgg ) return 0; - if( p->pOrderBy && pSub->pOrderBy ) return 0; - - /* Restriction 3: If the subquery is a join, make sure the subquery is - ** not used as the right operand of an outer join. Examples of why this - ** is not allowed: - ** - ** t1 LEFT OUTER JOIN (t2 JOIN t3) - ** - ** If we flatten the above, we would get - ** - ** (t1 LEFT OUTER JOIN t2) JOIN t3 - ** - ** which is not at all the same thing. - */ - if( pSubSrc->nSrc>1 && iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 ){ - return 0; - } - - /* Restriction 12: If the subquery is the right operand of a left outer - ** join, make sure the subquery has no WHERE clause. - ** An examples of why this is not allowed: - ** - ** t1 LEFT OUTER JOIN (SELECT * FROM t2 WHERE t2.x>0) - ** - ** If we flatten the above, we would get - ** - ** (t1 LEFT OUTER JOIN t2) WHERE t2.x>0 - ** - ** But the t2.x>0 test will always fail on a NULL row of t2, which - ** effectively converts the OUTER JOIN into an INNER JOIN. - */ - if( iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 - && pSub->pWhere!=0 ){ - return 0; - } - - /* If we reach this point, it means flattening is permitted for the - ** iFrom-th entry of the FROM clause in the outer query. - */ - - /* Move all of the FROM elements of the subquery into the - ** the FROM clause of the outer query. Before doing this, remember - ** the cursor number for the original outer query FROM element in - ** iParent. The iParent cursor will never be used. Subsequent code - ** will scan expressions looking for iParent references and replace - ** those references with expressions that resolve to the subquery FROM - ** elements we are now copying in. - */ - iParent = pSrc->a[iFrom].iCursor; - { - int nSubSrc = pSubSrc->nSrc; - int jointype = pSrc->a[iFrom].jointype; - - if( pSrc->a[iFrom].pTab && pSrc->a[iFrom].pTab->isTransient ){ - sqliteDeleteTable(0, pSrc->a[iFrom].pTab); - } - sqliteFree(pSrc->a[iFrom].zDatabase); - sqliteFree(pSrc->a[iFrom].zName); - sqliteFree(pSrc->a[iFrom].zAlias); - if( nSubSrc>1 ){ - int extra = nSubSrc - 1; - for(i=1; ipSrc = pSrc; - for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){ - pSrc->a[i] = pSrc->a[i-extra]; - } - } - for(i=0; ia[i+iFrom] = pSubSrc->a[i]; - memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); - } - pSrc->a[iFrom+nSubSrc-1].jointype = jointype; - } - - /* Now begin substituting subquery result set expressions for - ** references to the iParent in the outer query. - ** - ** Example: - ** - ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; - ** \ \_____________ subquery __________/ / - ** \_____________________ outer query ______________________________/ - ** - ** We look at every expression in the outer query and every place we see - ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - */ - substExprList(p->pEList, iParent, pSub->pEList); - pList = p->pEList; - for(i=0; inExpr; i++){ - Expr *pExpr; - if( pList->a[i].zName==0 && (pExpr = pList->a[i].pExpr)->span.z!=0 ){ - pList->a[i].zName = sqliteStrNDup(pExpr->span.z, pExpr->span.n); - } - } - if( isAgg ){ - substExprList(p->pGroupBy, iParent, pSub->pEList); - substExpr(p->pHaving, iParent, pSub->pEList); - } - if( pSub->pOrderBy ){ - assert( p->pOrderBy==0 ); - p->pOrderBy = pSub->pOrderBy; - pSub->pOrderBy = 0; - }else if( p->pOrderBy ){ - substExprList(p->pOrderBy, iParent, pSub->pEList); - } - if( pSub->pWhere ){ - pWhere = sqliteExprDup(pSub->pWhere); - }else{ - pWhere = 0; - } - if( subqueryIsAgg ){ - assert( p->pHaving==0 ); - p->pHaving = p->pWhere; - p->pWhere = pWhere; - substExpr(p->pHaving, iParent, pSub->pEList); - if( pSub->pHaving ){ - Expr *pHaving = sqliteExprDup(pSub->pHaving); - if( p->pHaving ){ - p->pHaving = sqliteExpr(TK_AND, p->pHaving, pHaving, 0); - }else{ - p->pHaving = pHaving; - } - } - assert( p->pGroupBy==0 ); - p->pGroupBy = sqliteExprListDup(pSub->pGroupBy); - }else if( p->pWhere==0 ){ - p->pWhere = pWhere; - }else{ - substExpr(p->pWhere, iParent, pSub->pEList); - if( pWhere ){ - p->pWhere = sqliteExpr(TK_AND, p->pWhere, pWhere, 0); - } - } - - /* The flattened query is distinct if either the inner or the - ** outer query is distinct. - */ - p->isDistinct = p->isDistinct || pSub->isDistinct; - - /* Transfer the limit expression from the subquery to the outer - ** query. - */ - if( pSub->nLimit>=0 ){ - if( p->nLimit<0 ){ - p->nLimit = pSub->nLimit; - }else if( p->nLimit+p->nOffset > pSub->nLimit+pSub->nOffset ){ - p->nLimit = pSub->nLimit + pSub->nOffset - p->nOffset; - } - } - p->nOffset += pSub->nOffset; - - /* Finially, delete what is left of the subquery and return - ** success. - */ - sqliteSelectDelete(pSub); - return 1; -} - -/* -** Analyze the SELECT statement passed in as an argument to see if it -** is a simple min() or max() query. If it is and this query can be -** satisfied using a single seek to the beginning or end of an index, -** then generate the code for this SELECT and return 1. If this is not a -** simple min() or max() query, then return 0; -** -** A simply min() or max() query looks like this: -** -** SELECT min(a) FROM table; -** SELECT max(a) FROM table; -** -** The query may have only a single table in its FROM argument. There -** can be no GROUP BY or HAVING or WHERE clauses. The result set must -** be the min() or max() of a single column of the table. The column -** in the min() or max() function must be indexed. -** -** The parameters to this routine are the same as for sqliteSelect(). -** See the header comment on that routine for additional information. -*/ -static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ - Expr *pExpr; - int iCol; - Table *pTab; - Index *pIdx; - int base; - Vdbe *v; - int seekOp; - int cont; - ExprList *pEList, *pList, eList; - struct ExprList_item eListItem; - SrcList *pSrc; - - - /* Check to see if this query is a simple min() or max() query. Return - ** zero if it is not. - */ - if( p->pGroupBy || p->pHaving || p->pWhere ) return 0; - pSrc = p->pSrc; - if( pSrc->nSrc!=1 ) return 0; - pEList = p->pEList; - if( pEList->nExpr!=1 ) return 0; - pExpr = pEList->a[0].pExpr; - if( pExpr->op!=TK_AGG_FUNCTION ) return 0; - pList = pExpr->pList; - if( pList==0 || pList->nExpr!=1 ) return 0; - if( pExpr->token.n!=3 ) return 0; - if( sqliteStrNICmp(pExpr->token.z,"min",3)==0 ){ - seekOp = OP_Rewind; - }else if( sqliteStrNICmp(pExpr->token.z,"max",3)==0 ){ - seekOp = OP_Last; - }else{ - return 0; - } - pExpr = pList->a[0].pExpr; - if( pExpr->op!=TK_COLUMN ) return 0; - iCol = pExpr->iColumn; - pTab = pSrc->a[0].pTab; - - /* If we get to here, it means the query is of the correct form. - ** Check to make sure we have an index and make pIdx point to the - ** appropriate index. If the min() or max() is on an INTEGER PRIMARY - ** key column, no index is necessary so set pIdx to NULL. If no - ** usable index is found, return 0. - */ - if( iCol<0 ){ - pIdx = 0; - }else{ - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - assert( pIdx->nColumn>=1 ); - if( pIdx->aiColumn[0]==iCol ) break; - } - if( pIdx==0 ) return 0; - } - - /* Identify column types if we will be using the callback. This - ** step is skipped if the output is going to a table or a memory cell. - ** The column names have already been generated in the calling function. - */ - v = sqliteGetVdbe(pParse); - if( v==0 ) return 0; - if( eDest==SRT_Callback ){ - generateColumnTypes(pParse, p->pSrc, p->pEList); - } - - /* If the output is destined for a temporary table, open that table. - */ - if( eDest==SRT_TempTable ){ - sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); - } - - /* Generating code to find the min or the max. Basically all we have - ** to do is find the first or the last entry in the chosen index. If - ** the min() or max() is on the INTEGER PRIMARY KEY, then find the first - ** or last entry in the main table. - */ - sqliteCodeVerifySchema(pParse, pTab->iDb); - base = pSrc->a[0].iCursor; - computeLimitRegisters(pParse, p); - if( pSrc->a[0].pSelect==0 ){ - sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); - sqliteVdbeOp3(v, OP_OpenRead, base, pTab->tnum, pTab->zName, 0); - } - cont = sqliteVdbeMakeLabel(v); - if( pIdx==0 ){ - sqliteVdbeAddOp(v, seekOp, base, 0); - }else{ - sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); - sqliteVdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum, pIdx->zName, P3_STATIC); - if( seekOp==OP_Rewind ){ - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_MakeKey, 1, 0); - sqliteVdbeAddOp(v, OP_IncrKey, 0, 0); - seekOp = OP_MoveTo; - } - sqliteVdbeAddOp(v, seekOp, base+1, 0); - sqliteVdbeAddOp(v, OP_IdxRecno, base+1, 0); - sqliteVdbeAddOp(v, OP_Close, base+1, 0); - sqliteVdbeAddOp(v, OP_MoveTo, base, 0); - } - eList.nExpr = 1; - memset(&eListItem, 0, sizeof(eListItem)); - eList.a = &eListItem; - eList.a[0].pExpr = pExpr; - selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, cont, cont); - sqliteVdbeResolveLabel(v, cont); - sqliteVdbeAddOp(v, OP_Close, base, 0); - - return 1; -} - -/* -** Generate code for the given SELECT statement. -** -** The results are distributed in various ways depending on the -** value of eDest and iParm. -** -** eDest Value Result -** ------------ ------------------------------------------- -** SRT_Callback Invoke the callback for each row of the result. -** -** SRT_Mem Store first result in memory cell iParm -** -** SRT_Set Store results as keys of a table with cursor iParm -** -** SRT_Union Store results as a key in a temporary table iParm -** -** SRT_Except Remove results from the temporary table iParm. -** -** SRT_Table Store results in temporary table iParm -** -** The table above is incomplete. Additional eDist value have be added -** since this comment was written. See the selectInnerLoop() function for -** a complete listing of the allowed values of eDest and their meanings. -** -** This routine returns the number of errors. If any errors are -** encountered, then an appropriate error message is left in -** pParse->zErrMsg. -** -** This routine does NOT free the Select structure passed in. The -** calling function needs to do that. -** -** The pParent, parentTab, and *pParentAgg fields are filled in if this -** SELECT is a subquery. This routine may try to combine this SELECT -** with its parent to form a single flat query. In so doing, it might -** change the parent query from a non-aggregate to an aggregate query. -** For that reason, the pParentAgg flag is passed as a pointer, so it -** can be changed. -** -** Example 1: The meaning of the pParent parameter. -** -** SELECT * FROM t1 JOIN (SELECT x, count(*) FROM t2) JOIN t3; -** \ \_______ subquery _______/ / -** \ / -** \____________________ outer query ___________________/ -** -** This routine is called for the outer query first. For that call, -** pParent will be NULL. During the processing of the outer query, this -** routine is called recursively to handle the subquery. For the recursive -** call, pParent will point to the outer query. Because the subquery is -** the second element in a three-way join, the parentTab parameter will -** be 1 (the 2nd value of a 0-indexed array.) -*/ -int sqliteSelect( - Parse *pParse, /* The parser context */ - Select *p, /* The SELECT statement being coded. */ - int eDest, /* How to dispose of the results */ - int iParm, /* A parameter used by the eDest disposal method */ - Select *pParent, /* Another SELECT for which this is a sub-query */ - int parentTab, /* Index in pParent->pSrc of this query */ - int *pParentAgg /* True if pParent uses aggregate functions */ -){ - int i; - WhereInfo *pWInfo; - Vdbe *v; - int isAgg = 0; /* True for select lists like "count(*)" */ - ExprList *pEList; /* List of columns to extract. */ - SrcList *pTabList; /* List of tables to select from */ - Expr *pWhere; /* The WHERE clause. May be NULL */ - ExprList *pOrderBy; /* The ORDER BY clause. May be NULL */ - ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ - Expr *pHaving; /* The HAVING clause. May be NULL */ - int isDistinct; /* True if the DISTINCT keyword is present */ - int distinct; /* Table to use for the distinct set */ - int rc = 1; /* Value to return from this function */ - - if( sqlite_malloc_failed || pParse->nErr || p==0 ) return 1; - if( sqliteAuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; - - /* If there is are a sequence of queries, do the earlier ones first. - */ - if( p->pPrior ){ - return multiSelect(pParse, p, eDest, iParm); - } - - /* Make local copies of the parameters for this query. - */ - pTabList = p->pSrc; - pWhere = p->pWhere; - pOrderBy = p->pOrderBy; - pGroupBy = p->pGroupBy; - pHaving = p->pHaving; - isDistinct = p->isDistinct; - - /* Allocate VDBE cursors for each table in the FROM clause - */ - sqliteSrcListAssignCursors(pParse, pTabList); - - /* - ** Do not even attempt to generate any code if we have already seen - ** errors before this routine starts. - */ - if( pParse->nErr>0 ) goto select_end; - - /* Expand any "*" terms in the result set. (For example the "*" in - ** "SELECT * FROM t1") The fillInColumnlist() routine also does some - ** other housekeeping - see the header comment for details. - */ - if( fillInColumnList(pParse, p) ){ - goto select_end; - } - pWhere = p->pWhere; - pEList = p->pEList; - if( pEList==0 ) goto select_end; - - /* If writing to memory or generating a set - ** only a single column may be output. - */ - if( (eDest==SRT_Mem || eDest==SRT_Set) && pEList->nExpr>1 ){ - sqliteErrorMsg(pParse, "only a single result allowed for " - "a SELECT that is part of an expression"); - goto select_end; - } - - /* ORDER BY is ignored for some destinations. - */ - switch( eDest ){ - case SRT_Union: - case SRT_Except: - case SRT_Discard: - pOrderBy = 0; - break; - default: - break; - } - - /* At this point, we should have allocated all the cursors that we - ** need to handle subquerys and temporary tables. - ** - ** Resolve the column names and do a semantics check on all the expressions. - */ - for(i=0; inExpr; i++){ - if( sqliteExprResolveIds(pParse, pTabList, 0, pEList->a[i].pExpr) ){ - goto select_end; - } - if( sqliteExprCheck(pParse, pEList->a[i].pExpr, 1, &isAgg) ){ - goto select_end; - } - } - if( pWhere ){ - if( sqliteExprResolveIds(pParse, pTabList, pEList, pWhere) ){ - goto select_end; - } - if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ - goto select_end; - } - } - if( pHaving ){ - if( pGroupBy==0 ){ - sqliteErrorMsg(pParse, "a GROUP BY clause is required before HAVING"); - goto select_end; - } - if( sqliteExprResolveIds(pParse, pTabList, pEList, pHaving) ){ - goto select_end; - } - if( sqliteExprCheck(pParse, pHaving, 1, &isAgg) ){ - goto select_end; - } - } - if( pOrderBy ){ - for(i=0; inExpr; i++){ - int iCol; - Expr *pE = pOrderBy->a[i].pExpr; - if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){ - sqliteExprDelete(pE); - pE = pOrderBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr); - } - if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){ - goto select_end; - } - if( sqliteExprCheck(pParse, pE, isAgg, 0) ){ - goto select_end; - } - if( sqliteExprIsConstant(pE) ){ - if( sqliteExprIsInteger(pE, &iCol)==0 ){ - sqliteErrorMsg(pParse, - "ORDER BY terms must not be non-integer constants"); - goto select_end; - }else if( iCol<=0 || iCol>pEList->nExpr ){ - sqliteErrorMsg(pParse, - "ORDER BY column number %d out of range - should be " - "between 1 and %d", iCol, pEList->nExpr); - goto select_end; - } - } - } - } - if( pGroupBy ){ - for(i=0; inExpr; i++){ - int iCol; - Expr *pE = pGroupBy->a[i].pExpr; - if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){ - sqliteExprDelete(pE); - pE = pGroupBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr); - } - if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){ - goto select_end; - } - if( sqliteExprCheck(pParse, pE, isAgg, 0) ){ - goto select_end; - } - if( sqliteExprIsConstant(pE) ){ - if( sqliteExprIsInteger(pE, &iCol)==0 ){ - sqliteErrorMsg(pParse, - "GROUP BY terms must not be non-integer constants"); - goto select_end; - }else if( iCol<=0 || iCol>pEList->nExpr ){ - sqliteErrorMsg(pParse, - "GROUP BY column number %d out of range - should be " - "between 1 and %d", iCol, pEList->nExpr); - goto select_end; - } - } - } - } - - /* Begin generating code. - */ - v = sqliteGetVdbe(pParse); - if( v==0 ) goto select_end; - - /* Identify column names if we will be using them in a callback. This - ** step is skipped if the output is going to some other destination. - */ - if( eDest==SRT_Callback ){ - generateColumnNames(pParse, pTabList, pEList); - } - - /* Generate code for all sub-queries in the FROM clause - */ - for(i=0; inSrc; i++){ - const char *zSavedAuthContext; - int needRestoreContext; - - if( pTabList->a[i].pSelect==0 ) continue; - if( pTabList->a[i].zName!=0 ){ - zSavedAuthContext = pParse->zAuthContext; - pParse->zAuthContext = pTabList->a[i].zName; - needRestoreContext = 1; - }else{ - needRestoreContext = 0; - } - sqliteSelect(pParse, pTabList->a[i].pSelect, SRT_TempTable, - pTabList->a[i].iCursor, p, i, &isAgg); - if( needRestoreContext ){ - pParse->zAuthContext = zSavedAuthContext; - } - pTabList = p->pSrc; - pWhere = p->pWhere; - if( eDest!=SRT_Union && eDest!=SRT_Except && eDest!=SRT_Discard ){ - pOrderBy = p->pOrderBy; - } - pGroupBy = p->pGroupBy; - pHaving = p->pHaving; - isDistinct = p->isDistinct; - } - - /* Check for the special case of a min() or max() function by itself - ** in the result set. - */ - if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){ - rc = 0; - goto select_end; - } - - /* Check to see if this is a subquery that can be "flattened" into its parent. - ** If flattening is a possiblity, do so and return immediately. - */ - if( pParent && pParentAgg && - flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){ - if( isAgg ) *pParentAgg = 1; - return rc; - } - - /* Set the limiter. - */ - computeLimitRegisters(pParse, p); - - /* Identify column types if we will be using a callback. This - ** step is skipped if the output is going to a destination other - ** than a callback. - ** - ** We have to do this separately from the creation of column names - ** above because if the pTabList contains views then they will not - ** have been resolved and we will not know the column types until - ** now. - */ - if( eDest==SRT_Callback ){ - generateColumnTypes(pParse, pTabList, pEList); - } - - /* If the output is destined for a temporary table, open that table. - */ - if( eDest==SRT_TempTable ){ - sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0); - } - - /* Do an analysis of aggregate expressions. - */ - sqliteAggregateInfoReset(pParse); - if( isAgg || pGroupBy ){ - assert( pParse->nAgg==0 ); - isAgg = 1; - for(i=0; inExpr; i++){ - if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){ - goto select_end; - } - } - if( pGroupBy ){ - for(i=0; inExpr; i++){ - if( sqliteExprAnalyzeAggregates(pParse, pGroupBy->a[i].pExpr) ){ - goto select_end; - } - } - } - if( pHaving && sqliteExprAnalyzeAggregates(pParse, pHaving) ){ - goto select_end; - } - if( pOrderBy ){ - for(i=0; inExpr; i++){ - if( sqliteExprAnalyzeAggregates(pParse, pOrderBy->a[i].pExpr) ){ - goto select_end; - } - } - } - } - - /* Reset the aggregator - */ - if( isAgg ){ - sqliteVdbeAddOp(v, OP_AggReset, 0, pParse->nAgg); - for(i=0; inAgg; i++){ - FuncDef *pFunc; - if( (pFunc = pParse->aAgg[i].pFunc)!=0 && pFunc->xFinalize!=0 ){ - sqliteVdbeOp3(v, OP_AggInit, 0, i, (char*)pFunc, P3_POINTER); - } - } - if( pGroupBy==0 ){ - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_AggFocus, 0, 0); - } - } - - /* Initialize the memory cell to NULL - */ - if( eDest==SRT_Mem ){ - sqliteVdbeAddOp(v, OP_String, 0, 0); - sqliteVdbeAddOp(v, OP_MemStore, iParm, 1); - } - - /* Open a temporary table to use for the distinct set. - */ - if( isDistinct ){ - distinct = pParse->nTab++; - sqliteVdbeAddOp(v, OP_OpenTemp, distinct, 1); - }else{ - distinct = -1; - } - - /* Begin the database scan - */ - pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 0, - pGroupBy ? 0 : &pOrderBy); - if( pWInfo==0 ) goto select_end; - - /* Use the standard inner loop if we are not dealing with - ** aggregates - */ - if( !isAgg ){ - if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest, - iParm, pWInfo->iContinue, pWInfo->iBreak) ){ - goto select_end; - } - } - - /* If we are dealing with aggregates, then do the special aggregate - ** processing. - */ - else{ - AggExpr *pAgg; - if( pGroupBy ){ - int lbl1; - for(i=0; inExpr; i++){ - sqliteExprCode(pParse, pGroupBy->a[i].pExpr); - } - sqliteVdbeAddOp(v, OP_MakeKey, pGroupBy->nExpr, 0); - if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pGroupBy); - lbl1 = sqliteVdbeMakeLabel(v); - sqliteVdbeAddOp(v, OP_AggFocus, 0, lbl1); - for(i=0, pAgg=pParse->aAgg; inAgg; i++, pAgg++){ - if( pAgg->isAgg ) continue; - sqliteExprCode(pParse, pAgg->pExpr); - sqliteVdbeAddOp(v, OP_AggSet, 0, i); - } - sqliteVdbeResolveLabel(v, lbl1); - } - for(i=0, pAgg=pParse->aAgg; inAgg; i++, pAgg++){ - Expr *pE; - int nExpr; - FuncDef *pDef; - if( !pAgg->isAgg ) continue; - assert( pAgg->pFunc!=0 ); - assert( pAgg->pFunc->xStep!=0 ); - pDef = pAgg->pFunc; - pE = pAgg->pExpr; - assert( pE!=0 ); - assert( pE->op==TK_AGG_FUNCTION ); - nExpr = sqliteExprCodeExprList(pParse, pE->pList, pDef->includeTypes); - sqliteVdbeAddOp(v, OP_Integer, i, 0); - sqliteVdbeOp3(v, OP_AggFunc, 0, nExpr, (char*)pDef, P3_POINTER); - } - } - - /* End the database scan loop. - */ - sqliteWhereEnd(pWInfo); - - /* If we are processing aggregates, we need to set up a second loop - ** over all of the aggregate values and process them. - */ - if( isAgg ){ - int endagg = sqliteVdbeMakeLabel(v); - int startagg; - startagg = sqliteVdbeAddOp(v, OP_AggNext, 0, endagg); - pParse->useAgg = 1; - if( pHaving ){ - sqliteExprIfFalse(pParse, pHaving, startagg, 1); - } - if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest, - iParm, startagg, endagg) ){ - goto select_end; - } - sqliteVdbeAddOp(v, OP_Goto, 0, startagg); - sqliteVdbeResolveLabel(v, endagg); - sqliteVdbeAddOp(v, OP_Noop, 0, 0); - pParse->useAgg = 0; - } - - /* If there is an ORDER BY clause, then we need to sort the results - ** and send them to the callback one by one. - */ - if( pOrderBy ){ - generateSortTail(p, v, pEList->nExpr, eDest, iParm); - } - - /* If this was a subquery, we have now converted the subquery into a - ** temporary table. So delete the subquery structure from the parent - ** to prevent this subquery from being evaluated again and to force the - ** the use of the temporary table. - */ - if( pParent ){ - assert( pParent->pSrc->nSrc>parentTab ); - assert( pParent->pSrc->a[parentTab].pSelect==p ); - sqliteSelectDelete(p); - pParent->pSrc->a[parentTab].pSelect = 0; - } - - /* The SELECT was successfully coded. Set the return code to 0 - ** to indicate no errors. - */ - rc = 0; - - /* Control jumps to here if an error is encountered above, or upon - ** successful coding of the SELECT. - */ -select_end: - sqliteAggregateInfoReset(pParse); - return rc; -} diff --git a/ext/sqlite/libsqlite/src/sqlite.h.in b/ext/sqlite/libsqlite/src/sqlite.h.in deleted file mode 100644 index a823f5b2e6fc1..0000000000000 --- a/ext/sqlite/libsqlite/src/sqlite.h.in +++ /dev/null @@ -1,886 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the SQLite library -** presents to client programs. -** -** @(#) $Id$ -*/ -#ifndef _SQLITE_H_ -#define _SQLITE_H_ -#include /* Needed for the definition of va_list */ - -/* -** Make sure we can call this stuff from C++. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/* -** The version of the SQLite library. -*/ -#ifdef SQLITE_VERSION -# undef SQLITE_VERSION -#else -# define SQLITE_VERSION "--VERS--" -#endif - -/* -** The version string is also compiled into the library so that a program -** can check to make sure that the lib*.a file and the *.h file are from -** the same version. -*/ -extern const char sqlite_version[]; - -/* -** The SQLITE_UTF8 macro is defined if the library expects to see -** UTF-8 encoded data. The SQLITE_ISO8859 macro is defined if the -** iso8859 encoded should be used. -*/ -#define SQLITE_--ENCODING-- 1 - -/* -** The following constant holds one of two strings, "UTF-8" or "iso8859", -** depending on which character encoding the SQLite library expects to -** see. The character encoding makes a difference for the LIKE and GLOB -** operators and for the LENGTH() and SUBSTR() functions. -*/ -extern const char sqlite_encoding[]; - -/* -** Each open sqlite database is represented by an instance of the -** following opaque structure. -*/ -typedef struct sqlite sqlite; - -/* -** A function to open a new sqlite database. -** -** If the database does not exist and mode indicates write -** permission, then a new database is created. If the database -** does not exist and mode does not indicate write permission, -** then the open fails, an error message generated (if errmsg!=0) -** and the function returns 0. -** -** If mode does not indicates user write permission, then the -** database is opened read-only. -** -** The Truth: As currently implemented, all databases are opened -** for writing all the time. Maybe someday we will provide the -** ability to open a database readonly. The mode parameters is -** provided in anticipation of that enhancement. -*/ -sqlite *sqlite_open(const char *filename, int mode, char **errmsg); - -/* -** A function to close the database. -** -** Call this function with a pointer to a structure that was previously -** returned from sqlite_open() and the corresponding database will by closed. -*/ -void sqlite_close(sqlite *); - -/* -** The type for a callback function. -*/ -typedef int (*sqlite_callback)(void*,int,char**, char**); - -/* -** A function to executes one or more statements of SQL. -** -** If one or more of the SQL statements are queries, then -** the callback function specified by the 3rd parameter is -** invoked once for each row of the query result. This callback -** should normally return 0. If the callback returns a non-zero -** value then the query is aborted, all subsequent SQL statements -** are skipped and the sqlite_exec() function returns the SQLITE_ABORT. -** -** The 4th parameter is an arbitrary pointer that is passed -** to the callback function as its first parameter. -** -** The 2nd parameter to the callback function is the number of -** columns in the query result. The 3rd parameter to the callback -** is an array of strings holding the values for each column. -** The 4th parameter to the callback is an array of strings holding -** the names of each column. -** -** The callback function may be NULL, even for queries. A NULL -** callback is not an error. It just means that no callback -** will be invoked. -** -** If an error occurs while parsing or evaluating the SQL (but -** not while executing the callback) then an appropriate error -** message is written into memory obtained from malloc() and -** *errmsg is made to point to that message. The calling function -** is responsible for freeing the memory that holds the error -** message. Use sqlite_freemem() for this. If errmsg==NULL, -** then no error message is ever written. -** -** The return value is is SQLITE_OK if there are no errors and -** some other return code if there is an error. The particular -** return value depends on the type of error. -** -** If the query could not be executed because a database file is -** locked or busy, then this function returns SQLITE_BUSY. (This -** behavior can be modified somewhat using the sqlite_busy_handler() -** and sqlite_busy_timeout() functions below.) -*/ -int sqlite_exec( - sqlite*, /* An open database */ - const char *sql, /* SQL to be executed */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg /* Error msg written here */ -); - -/* -** Return values for sqlite_exec() and sqlite_step() -*/ -#define SQLITE_OK 0 /* Successful result */ -#define SQLITE_ERROR 1 /* SQL error or missing database */ -#define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ -#define SQLITE_PERM 3 /* Access permission denied */ -#define SQLITE_ABORT 4 /* Callback routine requested an abort */ -#define SQLITE_BUSY 5 /* The database file is locked */ -#define SQLITE_LOCKED 6 /* A table in the database is locked */ -#define SQLITE_NOMEM 7 /* A malloc() failed */ -#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ -#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */ -#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ -#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ -#define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */ -#define SQLITE_FULL 13 /* Insertion failed because database is full */ -#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ -#define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */ -#define SQLITE_SCHEMA 17 /* The database schema changed */ -#define SQLITE_TOOBIG 18 /* Too much data for one row of a table */ -#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */ -#define SQLITE_MISMATCH 20 /* Data type mismatch */ -#define SQLITE_MISUSE 21 /* Library used incorrectly */ -#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ -#define SQLITE_AUTH 23 /* Authorization denied */ -#define SQLITE_FORMAT 24 /* Auxiliary database format error */ -#define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ -#define SQLITE_NOTADB 26 /* File opened that is not a database file */ -#define SQLITE_ROW 100 /* sqlite_step() has another row ready */ -#define SQLITE_DONE 101 /* sqlite_step() has finished executing */ - -/* -** Each entry in an SQLite table has a unique integer key. (The key is -** the value of the INTEGER PRIMARY KEY column if there is such a column, -** otherwise the key is generated at random. The unique key is always -** available as the ROWID, OID, or _ROWID_ column.) The following routine -** returns the integer key of the most recent insert in the database. -** -** This function is similar to the mysql_insert_id() function from MySQL. -*/ -int sqlite_last_insert_rowid(sqlite*); - -/* -** This function returns the number of database rows that were changed -** (or inserted or deleted) by the most recent called sqlite_exec(). -** -** All changes are counted, even if they were later undone by a -** ROLLBACK or ABORT. Except, changes associated with creating and -** dropping tables are not counted. -** -** If a callback invokes sqlite_exec() recursively, then the changes -** in the inner, recursive call are counted together with the changes -** in the outer call. -** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements form the table.) Because of -** this optimization, the change count for "DELETE FROM table" will be -** zero regardless of the number of elements that were originally in the -** table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. -*/ -int sqlite_changes(sqlite*); - -/* -** This function returns the number of database rows that were changed -** by the last INSERT, UPDATE, or DELETE statment executed by sqlite_exec(), -** or by the last VM to run to completion. The change count is not updated -** by SQL statements other than INSERT, UPDATE or DELETE. -** -** Changes are counted, even if they are later undone by a ROLLBACK or -** ABORT. Changes associated with trigger programs that execute as a -** result of the INSERT, UPDATE, or DELETE statement are not counted. -** -** If a callback invokes sqlite_exec() recursively, then the changes -** in the inner, recursive call are counted together with the changes -** in the outer call. -** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements form the table.) Because of -** this optimization, the change count for "DELETE FROM table" will be -** zero regardless of the number of elements that were originally in the -** table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite_last_statement_changes(sqlite*); - -/* If the parameter to this routine is one of the return value constants -** defined above, then this routine returns a constant text string which -** descripts (in English) the meaning of the return value. -*/ -const char *sqlite_error_string(int); -#define sqliteErrStr sqlite_error_string /* Legacy. Do not use in new code. */ - -/* This function causes any pending database operation to abort and -** return at its earliest opportunity. This routine is typically -** called in response to a user action such as pressing "Cancel" -** or Ctrl-C where the user wants a long query operation to halt -** immediately. -*/ -void sqlite_interrupt(sqlite*); - - -/* This function returns true if the given input string comprises -** one or more complete SQL statements. -** -** The algorithm is simple. If the last token other than spaces -** and comments is a semicolon, then return true. otherwise return -** false. -*/ -int sqlite_complete(const char *sql); - -/* -** This routine identifies a callback function that is invoked -** whenever an attempt is made to open a database table that is -** currently locked by another process or thread. If the busy callback -** is NULL, then sqlite_exec() returns SQLITE_BUSY immediately if -** it finds a locked table. If the busy callback is not NULL, then -** sqlite_exec() invokes the callback with three arguments. The -** second argument is the name of the locked table and the third -** argument is the number of times the table has been busy. If the -** busy callback returns 0, then sqlite_exec() immediately returns -** SQLITE_BUSY. If the callback returns non-zero, then sqlite_exec() -** tries to open the table again and the cycle repeats. -** -** The default busy callback is NULL. -** -** Sqlite is re-entrant, so the busy handler may start a new query. -** (It is not clear why anyone would every want to do this, but it -** is allowed, in theory.) But the busy handler may not close the -** database. Closing the database from a busy handler will delete -** data structures out from under the executing query and will -** probably result in a coredump. -*/ -void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*); - -/* -** This routine sets a busy handler that sleeps for a while when a -** table is locked. The handler will sleep multiple times until -** at least "ms" milleseconds of sleeping have been done. After -** "ms" milleseconds of sleeping, the handler returns 0 which -** causes sqlite_exec() to return SQLITE_BUSY. -** -** Calling this routine with an argument less than or equal to zero -** turns off all busy handlers. -*/ -void sqlite_busy_timeout(sqlite*, int ms); - -/* -** This next routine is really just a wrapper around sqlite_exec(). -** Instead of invoking a user-supplied callback for each row of the -** result, this routine remembers each row of the result in memory -** obtained from malloc(), then returns all of the result after the -** query has finished. -** -** As an example, suppose the query result where this table: -** -** Name | Age -** ----------------------- -** Alice | 43 -** Bob | 28 -** Cindy | 21 -** -** If the 3rd argument were &azResult then after the function returns -** azResult will contain the following data: -** -** azResult[0] = "Name"; -** azResult[1] = "Age"; -** azResult[2] = "Alice"; -** azResult[3] = "43"; -** azResult[4] = "Bob"; -** azResult[5] = "28"; -** azResult[6] = "Cindy"; -** azResult[7] = "21"; -** -** Notice that there is an extra row of data containing the column -** headers. But the *nrow return value is still 3. *ncolumn is -** set to 2. In general, the number of values inserted into azResult -** will be ((*nrow) + 1)*(*ncolumn). -** -** After the calling function has finished using the result, it should -** pass the result data pointer to sqlite_free_table() in order to -** release the memory that was malloc-ed. Because of the way the -** malloc() happens, the calling function must not try to call -** malloc() directly. Only sqlite_free_table() is able to release -** the memory properly and safely. -** -** The return value of this routine is the same as from sqlite_exec(). -*/ -int sqlite_get_table( - sqlite*, /* An open database */ - const char *sql, /* SQL to be executed */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg /* Error msg written here */ -); - -/* -** Call this routine to free the memory that sqlite_get_table() allocated. -*/ -void sqlite_free_table(char **result); - -/* -** The following routines are wrappers around sqlite_exec() and -** sqlite_get_table(). The only difference between the routines that -** follow and the originals is that the second argument to the -** routines that follow is really a printf()-style format -** string describing the SQL to be executed. Arguments to the format -** string appear at the end of the argument list. -** -** All of the usual printf formatting options apply. In addition, there -** is a "%q" option. %q works like %s in that it substitutes a null-terminated -** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' -** character it escapes that character and allows it to be inserted into -** the string. -** -** For example, so some string variable contains text as follows: -** -** char *zText = "It's a happy day!"; -** -** We can use this text in an SQL statement as follows: -** -** sqlite_exec_printf(db, "INSERT INTO table VALUES('%q')", -** callback1, 0, 0, zText); -** -** Because the %q format string is used, the '\'' character in zText -** is escaped and the SQL generated is as follows: -** -** INSERT INTO table1 VALUES('It''s a happy day!') -** -** This is correct. Had we used %s instead of %q, the generated SQL -** would have looked like this: -** -** INSERT INTO table1 VALUES('It's a happy day!'); -** -** This second example is an SQL syntax error. As a general rule you -** should always use %q instead of %s when inserting text into a string -** literal. -*/ -int sqlite_exec_printf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string. */ -); -int sqlite_exec_vprintf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string. */ -); -int sqlite_get_table_printf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string */ -); -int sqlite_get_table_vprintf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string */ -); -char *sqlite_mprintf(const char*,...); -char *sqlite_vmprintf(const char*, va_list); - -/* -** Windows systems should call this routine to free memory that -** is returned in the in the errmsg parameter of sqlite_open() when -** SQLite is a DLL. For some reason, it does not work to call free() -** directly. -*/ -void sqlite_freemem(void *p); - -/* -** Windows systems need functions to call to return the sqlite_version -** and sqlite_encoding strings. -*/ -const char *sqlite_libversion(void); -const char *sqlite_libencoding(void); - -/* -** A pointer to the following structure is used to communicate with -** the implementations of user-defined functions. -*/ -typedef struct sqlite_func sqlite_func; - -/* -** Use the following routines to create new user-defined functions. See -** the documentation for details. -*/ -int sqlite_create_function( - sqlite*, /* Database where the new function is registered */ - const char *zName, /* Name of the new function */ - int nArg, /* Number of arguments. -1 means any number */ - void (*xFunc)(sqlite_func*,int,const char**), /* C code to implement */ - void *pUserData /* Available via the sqlite_user_data() call */ -); -int sqlite_create_aggregate( - sqlite*, /* Database where the new function is registered */ - const char *zName, /* Name of the function */ - int nArg, /* Number of arguments */ - void (*xStep)(sqlite_func*,int,const char**), /* Called for each row */ - void (*xFinalize)(sqlite_func*), /* Called once to get final result */ - void *pUserData /* Available via the sqlite_user_data() call */ -); - -/* -** Use the following routine to define the datatype returned by a -** user-defined function. The second argument can be one of the -** constants SQLITE_NUMERIC, SQLITE_TEXT, or SQLITE_ARGS or it -** can be an integer greater than or equal to zero. When the datatype -** parameter is non-negative, the type of the result will be the -** same as the datatype-th argument. If datatype==SQLITE_NUMERIC -** then the result is always numeric. If datatype==SQLITE_TEXT then -** the result is always text. If datatype==SQLITE_ARGS then the result -** is numeric if any argument is numeric and is text otherwise. -*/ -int sqlite_function_type( - sqlite *db, /* The database there the function is registered */ - const char *zName, /* Name of the function */ - int datatype /* The datatype for this function */ -); -#define SQLITE_NUMERIC (-1) -/* #define SQLITE_TEXT (-2) // See below */ -#define SQLITE_ARGS (-3) - -/* -** SQLite version 3 defines SQLITE_TEXT differently. To allow both -** version 2 and version 3 to be included, undefine them both if a -** conflict is seen. Define SQLITE2_TEXT to be the version 2 value. -*/ -#ifdef SQLITE_TEXT -# undef SQLITE_TEXT -#else -# define SQLITE_TEXT (-2) -#endif -#define SQLITE2_TEXT (-2) - - - -/* -** The user function implementations call one of the following four routines -** in order to return their results. The first parameter to each of these -** routines is a copy of the first argument to xFunc() or xFinialize(). -** The second parameter to these routines is the result to be returned. -** A NULL can be passed as the second parameter to sqlite_set_result_string() -** in order to return a NULL result. -** -** The 3rd argument to _string and _error is the number of characters to -** take from the string. If this argument is negative, then all characters -** up to and including the first '\000' are used. -** -** The sqlite_set_result_string() function allocates a buffer to hold the -** result and returns a pointer to this buffer. The calling routine -** (that is, the implmentation of a user function) can alter the content -** of this buffer if desired. -*/ -char *sqlite_set_result_string(sqlite_func*,const char*,int); -void sqlite_set_result_int(sqlite_func*,int); -void sqlite_set_result_double(sqlite_func*,double); -void sqlite_set_result_error(sqlite_func*,const char*,int); - -/* -** The pUserData parameter to the sqlite_create_function() and -** sqlite_create_aggregate() routines used to register user functions -** is available to the implementation of the function using this -** call. -*/ -void *sqlite_user_data(sqlite_func*); - -/* -** Aggregate functions use the following routine to allocate -** a structure for storing their state. The first time this routine -** is called for a particular aggregate, a new structure of size nBytes -** is allocated, zeroed, and returned. On subsequent calls (for the -** same aggregate instance) the same buffer is returned. The implementation -** of the aggregate can use the returned buffer to accumulate data. -** -** The buffer allocated is freed automatically be SQLite. -*/ -void *sqlite_aggregate_context(sqlite_func*, int nBytes); - -/* -** The next routine returns the number of calls to xStep for a particular -** aggregate function instance. The current call to xStep counts so this -** routine always returns at least 1. -*/ -int sqlite_aggregate_count(sqlite_func*); - -/* -** This routine registers a callback with the SQLite library. The -** callback is invoked (at compile-time, not at run-time) for each -** attempt to access a column of a table in the database. The callback -** returns SQLITE_OK if access is allowed, SQLITE_DENY if the entire -** SQL statement should be aborted with an error and SQLITE_IGNORE -** if the column should be treated as a NULL value. -*/ -int sqlite_set_authorizer( - sqlite*, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), - void *pUserData -); - -/* -** The second parameter to the access authorization function above will -** be one of the values below. These values signify what kind of operation -** is to be authorized. The 3rd and 4th parameters to the authorization -** function will be parameters or NULL depending on which of the following -** codes is used as the second parameter. The 5th parameter is the name -** of the database ("main", "temp", etc.) if applicable. The 6th parameter -** is the name of the inner-most trigger or view that is responsible for -** the access attempt or NULL if this access attempt is directly from -** input SQL code. -** -** Arg-3 Arg-4 -*/ -#define SQLITE_COPY 0 /* Table Name File Name */ -#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ -#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ -#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ -#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ -#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ -#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ -#define SQLITE_DELETE 9 /* Table Name NULL */ -#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ -#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ -#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ -#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ -#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ -#define SQLITE_DROP_VIEW 17 /* View Name NULL */ -#define SQLITE_INSERT 18 /* Table Name NULL */ -#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ -#define SQLITE_READ 20 /* Table Name Column Name */ -#define SQLITE_SELECT 21 /* NULL NULL */ -#define SQLITE_TRANSACTION 22 /* NULL NULL */ -#define SQLITE_UPDATE 23 /* Table Name Column Name */ -#define SQLITE_ATTACH 24 /* Filename NULL */ -#define SQLITE_DETACH 25 /* Database Name NULL */ - - -/* -** The return value of the authorization function should be one of the -** following constants: -*/ -/* #define SQLITE_OK 0 // Allow access (This is actually defined above) */ -#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ -#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ - -/* -** Register a function that is called at every invocation of sqlite_exec() -** or sqlite_compile(). This function can be used (for example) to generate -** a log file of all SQL executed against a database. -*/ -void *sqlite_trace(sqlite*, void(*xTrace)(void*,const char*), void*); - -/*** The Callback-Free API -** -** The following routines implement a new way to access SQLite that does not -** involve the use of callbacks. -** -** An sqlite_vm is an opaque object that represents a single SQL statement -** that is ready to be executed. -*/ -typedef struct sqlite_vm sqlite_vm; - -/* -** To execute an SQLite query without the use of callbacks, you first have -** to compile the SQL using this routine. The 1st parameter "db" is a pointer -** to an sqlite object obtained from sqlite_open(). The 2nd parameter -** "zSql" is the text of the SQL to be compiled. The remaining parameters -** are all outputs. -** -** *pzTail is made to point to the first character past the end of the first -** SQL statement in zSql. This routine only compiles the first statement -** in zSql, so *pzTail is left pointing to what remains uncompiled. -** -** *ppVm is left pointing to a "virtual machine" that can be used to execute -** the compiled statement. Or if there is an error, *ppVm may be set to NULL. -** If the input text contained no SQL (if the input is and empty string or -** a comment) then *ppVm is set to NULL. -** -** If any errors are detected during compilation, an error message is written -** into space obtained from malloc() and *pzErrMsg is made to point to that -** error message. The calling routine is responsible for freeing the text -** of this message when it has finished with it. Use sqlite_freemem() to -** free the message. pzErrMsg may be NULL in which case no error message -** will be generated. -** -** On success, SQLITE_OK is returned. Otherwise and error code is returned. -*/ -int sqlite_compile( - sqlite *db, /* The open database */ - const char *zSql, /* SQL statement to be compiled */ - const char **pzTail, /* OUT: uncompiled tail of zSql */ - sqlite_vm **ppVm, /* OUT: the virtual machine to execute zSql */ - char **pzErrmsg /* OUT: Error message. */ -); - -/* -** After an SQL statement has been compiled, it is handed to this routine -** to be executed. This routine executes the statement as far as it can -** go then returns. The return value will be one of SQLITE_DONE, -** SQLITE_ERROR, SQLITE_BUSY, SQLITE_ROW, or SQLITE_MISUSE. -** -** SQLITE_DONE means that the execute of the SQL statement is complete -** an no errors have occurred. sqlite_step() should not be called again -** for the same virtual machine. *pN is set to the number of columns in -** the result set and *pazColName is set to an array of strings that -** describe the column names and datatypes. The name of the i-th column -** is (*pazColName)[i] and the datatype of the i-th column is -** (*pazColName)[i+*pN]. *pazValue is set to NULL. -** -** SQLITE_ERROR means that the virtual machine encountered a run-time -** error. sqlite_step() should not be called again for the same -** virtual machine. *pN is set to 0 and *pazColName and *pazValue are set -** to NULL. Use sqlite_finalize() to obtain the specific error code -** and the error message text for the error. -** -** SQLITE_BUSY means that an attempt to open the database failed because -** another thread or process is holding a lock. The calling routine -** can try again to open the database by calling sqlite_step() again. -** The return code will only be SQLITE_BUSY if no busy handler is registered -** using the sqlite_busy_handler() or sqlite_busy_timeout() routines. If -** a busy handler callback has been registered but returns 0, then this -** routine will return SQLITE_ERROR and sqltie_finalize() will return -** SQLITE_BUSY when it is called. -** -** SQLITE_ROW means that a single row of the result is now available. -** The data is contained in *pazValue. The value of the i-th column is -** (*azValue)[i]. *pN and *pazColName are set as described in SQLITE_DONE. -** Invoke sqlite_step() again to advance to the next row. -** -** SQLITE_MISUSE is returned if sqlite_step() is called incorrectly. -** For example, if you call sqlite_step() after the virtual machine -** has halted (after a prior call to sqlite_step() has returned SQLITE_DONE) -** or if you call sqlite_step() with an incorrectly initialized virtual -** machine or a virtual machine that has been deleted or that is associated -** with an sqlite structure that has been closed. -*/ -int sqlite_step( - sqlite_vm *pVm, /* The virtual machine to execute */ - int *pN, /* OUT: Number of columns in result */ - const char ***pazValue, /* OUT: Column data */ - const char ***pazColName /* OUT: Column names and datatypes */ -); - -/* -** This routine is called to delete a virtual machine after it has finished -** executing. The return value is the result code. SQLITE_OK is returned -** if the statement executed successfully and some other value is returned if -** there was any kind of error. If an error occurred and pzErrMsg is not -** NULL, then an error message is written into memory obtained from malloc() -** and *pzErrMsg is made to point to that error message. The calling routine -** should use sqlite_freemem() to delete this message when it has finished -** with it. -** -** This routine can be called at any point during the execution of the -** virtual machine. If the virtual machine has not completed execution -** when this routine is called, that is like encountering an error or -** an interrupt. (See sqlite_interrupt().) Incomplete updates may be -** rolled back and transactions cancelled, depending on the circumstances, -** and the result code returned will be SQLITE_ABORT. -*/ -int sqlite_finalize(sqlite_vm*, char **pzErrMsg); - -/* -** This routine deletes the virtual machine, writes any error message to -** *pzErrMsg and returns an SQLite return code in the same way as the -** sqlite_finalize() function. -** -** Additionally, if ppVm is not NULL, *ppVm is left pointing to a new virtual -** machine loaded with the compiled version of the original query ready for -** execution. -** -** If sqlite_reset() returns SQLITE_SCHEMA, then *ppVm is set to NULL. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite_reset(sqlite_vm*, char **pzErrMsg); - -/* -** If the SQL that was handed to sqlite_compile contains variables that -** are represeted in the SQL text by a question mark ('?'). This routine -** is used to assign values to those variables. -** -** The first parameter is a virtual machine obtained from sqlite_compile(). -** The 2nd "idx" parameter determines which variable in the SQL statement -** to bind the value to. The left most '?' is 1. The 3rd parameter is -** the value to assign to that variable. The 4th parameter is the number -** of bytes in the value, including the terminating \000 for strings. -** Finally, the 5th "copy" parameter is TRUE if SQLite should make its -** own private copy of this value, or false if the space that the 3rd -** parameter points to will be unchanging and can be used directly by -** SQLite. -** -** Unbound variables are treated as having a value of NULL. To explicitly -** set a variable to NULL, call this routine with the 3rd parameter as a -** NULL pointer. -** -** If the 4th "len" parameter is -1, then strlen() is used to find the -** length. -** -** This routine can only be called immediately after sqlite_compile() -** or sqlite_reset() and before any calls to sqlite_step(). -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); - -/* -** This routine configures a callback function - the progress callback - that -** is invoked periodically during long running calls to sqlite_exec(), -** sqlite_step() and sqlite_get_table(). An example use for this API is to keep -** a GUI updated during a large query. -** -** The progress callback is invoked once for every N virtual machine opcodes, -** where N is the second argument to this function. The progress callback -** itself is identified by the third argument to this function. The fourth -** argument to this function is a void pointer passed to the progress callback -** function each time it is invoked. -** -** If a call to sqlite_exec(), sqlite_step() or sqlite_get_table() results -** in less than N opcodes being executed, then the progress callback is not -** invoked. -** -** Calling this routine overwrites any previously installed progress callback. -** To remove the progress callback altogether, pass NULL as the third -** argument to this function. -** -** If the progress callback returns a result other than 0, then the current -** query is immediately terminated and any database changes rolled back. If the -** query was part of a larger transaction, then the transaction is not rolled -** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); - -/* -** Register a callback function to be invoked whenever a new transaction -** is committed. The pArg argument is passed through to the callback. -** callback. If the callback function returns non-zero, then the commit -** is converted into a rollback. -** -** If another function was previously registered, its pArg value is returned. -** Otherwise NULL is returned. -** -** Registering a NULL function disables the callback. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -void *sqlite_commit_hook(sqlite*, int(*)(void*), void*); - -/* -** Open an encrypted SQLite database. If pKey==0 or nKey==0, this routine -** is the same as sqlite_open(). -** -** The code to implement this API is not available in the public release -** of SQLite. -*/ -sqlite *sqlite_open_encrypted( - const char *zFilename, /* Name of the encrypted database */ - const void *pKey, /* Pointer to the key */ - int nKey, /* Number of bytes in the key */ - int *pErrcode, /* Write error code here */ - char **pzErrmsg /* Write error message here */ -); - -/* -** Change the key on an open database. If the current database is not -** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the -** database is decrypted. -** -** The code to implement this API is not available in the public release -** of SQLite. -*/ -int sqlite_rekey( - sqlite *db, /* Database to be rekeyed */ - const void *pKey, int nKey /* The new key */ -); - -/* -** Encode a binary buffer "in" of size n bytes so that it contains -** no instances of characters '\'' or '\000'. The output is -** null-terminated and can be used as a string value in an INSERT -** or UPDATE statement. Use sqlite_decode_binary() to convert the -** string back into its original binary. -** -** The result is written into a preallocated output buffer "out". -** "out" must be able to hold at least 2 +(257*n)/254 bytes. -** In other words, the output will be expanded by as much as 3 -** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. -** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) -** -** The return value is the number of characters in the encoded -** string, excluding the "\000" terminator. -** -** If out==NULL then no output is generated but the routine still returns -** the number of characters that would have been generated if out had -** not been NULL. -*/ -int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out); - -/* -** Decode the string "in" into binary data and write it into "out". -** This routine reverses the encoding created by sqlite_encode_binary(). -** The output will always be a few bytes less than the input. The number -** of bytes of output is returned. If the input is not a well-formed -** encoding, -1 is returned. -** -** The "in" and "out" parameters may point to the same buffer in order -** to decode a string in place. -*/ -int sqlite_decode_binary(const unsigned char *in, unsigned char *out); - -#ifdef __cplusplus -} /* End of the 'extern "C"' block */ -#endif - -#endif /* _SQLITE_H_ */ diff --git a/ext/sqlite/libsqlite/src/sqlite.w32.h b/ext/sqlite/libsqlite/src/sqlite.w32.h deleted file mode 100644 index 0239fcd657761..0000000000000 --- a/ext/sqlite/libsqlite/src/sqlite.w32.h +++ /dev/null @@ -1,764 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the SQLite library -** presents to client programs. -** -** @(#) $Id$ -*/ -#ifndef _SQLITE_H_ -#define _SQLITE_H_ -#include /* Needed for the definition of va_list */ - -/* -** Make sure we can call this stuff from C++. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/* -** The version of the SQLite library. -*/ -#define SQLITE_VERSION "2.8.16" - -/* -** The version string is also compiled into the library so that a program -** can check to make sure that the lib*.a file and the *.h file are from -** the same version. -*/ -extern const char sqlite_version[]; - -/* -** The SQLITE_UTF8 macro is defined if the library expects to see -** UTF-8 encoded data. The SQLITE_ISO8859 macro is defined if the -** iso8859 encoded should be used. -*/ -#define SQLITE_ISO8859 1 - -/* -** The following constant holds one of two strings, "UTF-8" or "iso8859", -** depending on which character encoding the SQLite library expects to -** see. The character encoding makes a difference for the LIKE and GLOB -** operators and for the LENGTH() and SUBSTR() functions. -*/ -extern const char sqlite_encoding[]; - -/* -** Each open sqlite database is represented by an instance of the -** following opaque structure. -*/ -typedef struct sqlite sqlite; - -/* -** A function to open a new sqlite database. -** -** If the database does not exist and mode indicates write -** permission, then a new database is created. If the database -** does not exist and mode does not indicate write permission, -** then the open fails, an error message generated (if errmsg!=0) -** and the function returns 0. -** -** If mode does not indicates user write permission, then the -** database is opened read-only. -** -** The Truth: As currently implemented, all databases are opened -** for writing all the time. Maybe someday we will provide the -** ability to open a database readonly. The mode parameters is -** provided in anticipation of that enhancement. -*/ -sqlite *sqlite_open(const char *filename, int mode, char **errmsg); - -/* -** A function to close the database. -** -** Call this function with a pointer to a structure that was previously -** returned from sqlite_open() and the corresponding database will by closed. -*/ -void sqlite_close(sqlite *); - -/* -** The type for a callback function. -*/ -typedef int (*sqlite_callback)(void*,int,char**, char**); - -/* -** A function to executes one or more statements of SQL. -** -** If one or more of the SQL statements are queries, then -** the callback function specified by the 3rd parameter is -** invoked once for each row of the query result. This callback -** should normally return 0. If the callback returns a non-zero -** value then the query is aborted, all subsequent SQL statements -** are skipped and the sqlite_exec() function returns the SQLITE_ABORT. -** -** The 4th parameter is an arbitrary pointer that is passed -** to the callback function as its first parameter. -** -** The 2nd parameter to the callback function is the number of -** columns in the query result. The 3rd parameter to the callback -** is an array of strings holding the values for each column. -** The 4th parameter to the callback is an array of strings holding -** the names of each column. -** -** The callback function may be NULL, even for queries. A NULL -** callback is not an error. It just means that no callback -** will be invoked. -** -** If an error occurs while parsing or evaluating the SQL (but -** not while executing the callback) then an appropriate error -** message is written into memory obtained from malloc() and -** *errmsg is made to point to that message. The calling function -** is responsible for freeing the memory that holds the error -** message. Use sqlite_freemem() for this. If errmsg==NULL, -** then no error message is ever written. -** -** The return value is is SQLITE_OK if there are no errors and -** some other return code if there is an error. The particular -** return value depends on the type of error. -** -** If the query could not be executed because a database file is -** locked or busy, then this function returns SQLITE_BUSY. (This -** behavior can be modified somewhat using the sqlite_busy_handler() -** and sqlite_busy_timeout() functions below.) -*/ -int sqlite_exec( - sqlite*, /* An open database */ - const char *sql, /* SQL to be executed */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg /* Error msg written here */ -); - -/* -** Return values for sqlite_exec() and sqlite_step() -*/ -#define SQLITE_OK 0 /* Successful result */ -#define SQLITE_ERROR 1 /* SQL error or missing database */ -#define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ -#define SQLITE_PERM 3 /* Access permission denied */ -#define SQLITE_ABORT 4 /* Callback routine requested an abort */ -#define SQLITE_BUSY 5 /* The database file is locked */ -#define SQLITE_LOCKED 6 /* A table in the database is locked */ -#define SQLITE_NOMEM 7 /* A malloc() failed */ -#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ -#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */ -#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ -#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ -#define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */ -#define SQLITE_FULL 13 /* Insertion failed because database is full */ -#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ -#define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */ -#define SQLITE_SCHEMA 17 /* The database schema changed */ -#define SQLITE_TOOBIG 18 /* Too much data for one row of a table */ -#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */ -#define SQLITE_MISMATCH 20 /* Data type mismatch */ -#define SQLITE_MISUSE 21 /* Library used incorrectly */ -#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ -#define SQLITE_AUTH 23 /* Authorization denied */ -#define SQLITE_FORMAT 24 /* Auxiliary database format error */ -#define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ -#define SQLITE_NOTADB 26 /* File opened that is not a database file */ -#define SQLITE_ROW 100 /* sqlite_step() has another row ready */ -#define SQLITE_DONE 101 /* sqlite_step() has finished executing */ - -/* -** Each entry in an SQLite table has a unique integer key. (The key is -** the value of the INTEGER PRIMARY KEY column if there is such a column, -** otherwise the key is generated at random. The unique key is always -** available as the ROWID, OID, or _ROWID_ column.) The following routine -** returns the integer key of the most recent insert in the database. -** -** This function is similar to the mysql_insert_id() function from MySQL. -*/ -int sqlite_last_insert_rowid(sqlite*); - -/* -** This function returns the number of database rows that were changed -** (or inserted or deleted) by the most recent called sqlite_exec(). -** -** All changes are counted, even if they were later undone by a -** ROLLBACK or ABORT. Except, changes associated with creating and -** dropping tables are not counted. -** -** If a callback invokes sqlite_exec() recursively, then the changes -** in the inner, recursive call are counted together with the changes -** in the outer call. -** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements form the table.) Because of -** this optimization, the change count for "DELETE FROM table" will be -** zero regardless of the number of elements that were originally in the -** table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. -*/ -int sqlite_changes(sqlite*); - -/* If the parameter to this routine is one of the return value constants -** defined above, then this routine returns a constant text string which -** descripts (in English) the meaning of the return value. -*/ -const char *sqlite_error_string(int); -#define sqliteErrStr sqlite_error_string /* Legacy. Do not use in new code. */ - -/* This function causes any pending database operation to abort and -** return at its earliest opportunity. This routine is typically -** called in response to a user action such as pressing "Cancel" -** or Ctrl-C where the user wants a long query operation to halt -** immediately. -*/ -void sqlite_interrupt(sqlite*); - - -/* This function returns true if the given input string comprises -** one or more complete SQL statements. -** -** The algorithm is simple. If the last token other than spaces -** and comments is a semicolon, then return true. otherwise return -** false. -*/ -int sqlite_complete(const char *sql); - -/* -** This routine identifies a callback function that is invoked -** whenever an attempt is made to open a database table that is -** currently locked by another process or thread. If the busy callback -** is NULL, then sqlite_exec() returns SQLITE_BUSY immediately if -** it finds a locked table. If the busy callback is not NULL, then -** sqlite_exec() invokes the callback with three arguments. The -** second argument is the name of the locked table and the third -** argument is the number of times the table has been busy. If the -** busy callback returns 0, then sqlite_exec() immediately returns -** SQLITE_BUSY. If the callback returns non-zero, then sqlite_exec() -** tries to open the table again and the cycle repeats. -** -** The default busy callback is NULL. -** -** Sqlite is re-entrant, so the busy handler may start a new query. -** (It is not clear why anyone would every want to do this, but it -** is allowed, in theory.) But the busy handler may not close the -** database. Closing the database from a busy handler will delete -** data structures out from under the executing query and will -** probably result in a coredump. -*/ -void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*); - -/* -** This routine sets a busy handler that sleeps for a while when a -** table is locked. The handler will sleep multiple times until -** at least "ms" milleseconds of sleeping have been done. After -** "ms" milleseconds of sleeping, the handler returns 0 which -** causes sqlite_exec() to return SQLITE_BUSY. -** -** Calling this routine with an argument less than or equal to zero -** turns off all busy handlers. -*/ -void sqlite_busy_timeout(sqlite*, int ms); - -/* -** This next routine is really just a wrapper around sqlite_exec(). -** Instead of invoking a user-supplied callback for each row of the -** result, this routine remembers each row of the result in memory -** obtained from malloc(), then returns all of the result after the -** query has finished. -** -** As an example, suppose the query result where this table: -** -** Name | Age -** ----------------------- -** Alice | 43 -** Bob | 28 -** Cindy | 21 -** -** If the 3rd argument were &azResult then after the function returns -** azResult will contain the following data: -** -** azResult[0] = "Name"; -** azResult[1] = "Age"; -** azResult[2] = "Alice"; -** azResult[3] = "43"; -** azResult[4] = "Bob"; -** azResult[5] = "28"; -** azResult[6] = "Cindy"; -** azResult[7] = "21"; -** -** Notice that there is an extra row of data containing the column -** headers. But the *nrow return value is still 3. *ncolumn is -** set to 2. In general, the number of values inserted into azResult -** will be ((*nrow) + 1)*(*ncolumn). -** -** After the calling function has finished using the result, it should -** pass the result data pointer to sqlite_free_table() in order to -** release the memory that was malloc-ed. Because of the way the -** malloc() happens, the calling function must not try to call -** malloc() directly. Only sqlite_free_table() is able to release -** the memory properly and safely. -** -** The return value of this routine is the same as from sqlite_exec(). -*/ -int sqlite_get_table( - sqlite*, /* An open database */ - const char *sql, /* SQL to be executed */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg /* Error msg written here */ -); - -/* -** Call this routine to free the memory that sqlite_get_table() allocated. -*/ -void sqlite_free_table(char **result); - -/* -** The following routines are wrappers around sqlite_exec() and -** sqlite_get_table(). The only difference between the routines that -** follow and the originals is that the second argument to the -** routines that follow is really a printf()-style format -** string describing the SQL to be executed. Arguments to the format -** string appear at the end of the argument list. -** -** All of the usual printf formatting options apply. In addition, there -** is a "%q" option. %q works like %s in that it substitutes a null-terminated -** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' -** character it escapes that character and allows it to be inserted into -** the string. -** -** For example, so some string variable contains text as follows: -** -** char *zText = "It's a happy day!"; -** -** We can use this text in an SQL statement as follows: -** -** sqlite_exec_printf(db, "INSERT INTO table VALUES('%q')", -** callback1, 0, 0, zText); -** -** Because the %q format string is used, the '\'' character in zText -** is escaped and the SQL generated is as follows: -** -** INSERT INTO table1 VALUES('It''s a happy day!') -** -** This is correct. Had we used %s instead of %q, the generated SQL -** would have looked like this: -** -** INSERT INTO table1 VALUES('It's a happy day!'); -** -** This second example is an SQL syntax error. As a general rule you -** should always use %q instead of %s when inserting text into a string -** literal. -*/ -int sqlite_exec_printf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string. */ -); -int sqlite_exec_vprintf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - sqlite_callback, /* Callback function */ - void *, /* 1st argument to callback function */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string. */ -); -int sqlite_get_table_printf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - ... /* Arguments to the format string */ -); -int sqlite_get_table_vprintf( - sqlite*, /* An open database */ - const char *sqlFormat, /* printf-style format string for the SQL */ - char ***resultp, /* Result written to a char *[] that this points to */ - int *nrow, /* Number of result rows written here */ - int *ncolumn, /* Number of result columns written here */ - char **errmsg, /* Error msg written here */ - va_list ap /* Arguments to the format string */ -); -char *sqlite_mprintf(const char*,...); -char *sqlite_vmprintf(const char*, va_list); - -/* -** Windows systems should call this routine to free memory that -** is returned in the in the errmsg parameter of sqlite_open() when -** SQLite is a DLL. For some reason, it does not work to call free() -** directly. -*/ -void sqlite_freemem(void *p); - -/* -** Windows systems need functions to call to return the sqlite_version -** and sqlite_encoding strings. -*/ -const char *sqlite_libversion(void); -const char *sqlite_libencoding(void); - -/* -** A pointer to the following structure is used to communicate with -** the implementations of user-defined functions. -*/ -typedef struct sqlite_func sqlite_func; - -/* -** Use the following routines to create new user-defined functions. See -** the documentation for details. -*/ -int sqlite_create_function( - sqlite*, /* Database where the new function is registered */ - const char *zName, /* Name of the new function */ - int nArg, /* Number of arguments. -1 means any number */ - void (*xFunc)(sqlite_func*,int,const char**), /* C code to implement */ - void *pUserData /* Available via the sqlite_user_data() call */ -); -int sqlite_create_aggregate( - sqlite*, /* Database where the new function is registered */ - const char *zName, /* Name of the function */ - int nArg, /* Number of arguments */ - void (*xStep)(sqlite_func*,int,const char**), /* Called for each row */ - void (*xFinalize)(sqlite_func*), /* Called once to get final result */ - void *pUserData /* Available via the sqlite_user_data() call */ -); - -/* -** Use the following routine to define the datatype returned by a -** user-defined function. The second argument can be one of the -** constants SQLITE_NUMERIC, SQLITE_TEXT, or SQLITE_ARGS or it -** can be an integer greater than or equal to zero. The datatype -** will be numeric or text (the only two types supported) if the -** argument is SQLITE_NUMERIC or SQLITE_TEXT. If the argument is -** SQLITE_ARGS, then the datatype is numeric if any argument to the -** function is numeric and is text otherwise. If the second argument -** is an integer, then the datatype of the result is the same as the -** parameter to the function that corresponds to that integer. -*/ -int sqlite_function_type( - sqlite *db, /* The database there the function is registered */ - const char *zName, /* Name of the function */ - int datatype /* The datatype for this function */ -); -#define SQLITE_NUMERIC (-1) -#define SQLITE_TEXT (-2) -#define SQLITE_ARGS (-3) - -/* -** The user function implementations call one of the following four routines -** in order to return their results. The first parameter to each of these -** routines is a copy of the first argument to xFunc() or xFinialize(). -** The second parameter to these routines is the result to be returned. -** A NULL can be passed as the second parameter to sqlite_set_result_string() -** in order to return a NULL result. -** -** The 3rd argument to _string and _error is the number of characters to -** take from the string. If this argument is negative, then all characters -** up to and including the first '\000' are used. -** -** The sqlite_set_result_string() function allocates a buffer to hold the -** result and returns a pointer to this buffer. The calling routine -** (that is, the implmentation of a user function) can alter the content -** of this buffer if desired. -*/ -char *sqlite_set_result_string(sqlite_func*,const char*,int); -void sqlite_set_result_int(sqlite_func*,int); -void sqlite_set_result_double(sqlite_func*,double); -void sqlite_set_result_error(sqlite_func*,const char*,int); - -/* -** The pUserData parameter to the sqlite_create_function() and -** sqlite_create_aggregate() routines used to register user functions -** is available to the implementation of the function using this -** call. -*/ -void *sqlite_user_data(sqlite_func*); - -/* -** Aggregate functions use the following routine to allocate -** a structure for storing their state. The first time this routine -** is called for a particular aggregate, a new structure of size nBytes -** is allocated, zeroed, and returned. On subsequent calls (for the -** same aggregate instance) the same buffer is returned. The implementation -** of the aggregate can use the returned buffer to accumulate data. -** -** The buffer allocated is freed automatically be SQLite. -*/ -void *sqlite_aggregate_context(sqlite_func*, int nBytes); - -/* -** The next routine returns the number of calls to xStep for a particular -** aggregate function instance. The current call to xStep counts so this -** routine always returns at least 1. -*/ -int sqlite_aggregate_count(sqlite_func*); - -/* -** This routine registers a callback with the SQLite library. The -** callback is invoked (at compile-time, not at run-time) for each -** attempt to access a column of a table in the database. The callback -** returns SQLITE_OK if access is allowed, SQLITE_DENY if the entire -** SQL statement should be aborted with an error and SQLITE_IGNORE -** if the column should be treated as a NULL value. -*/ -int sqlite_set_authorizer( - sqlite*, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), - void *pUserData -); - -/* -** The second parameter to the access authorization function above will -** be one of the values below. These values signify what kind of operation -** is to be authorized. The 3rd and 4th parameters to the authorization -** function will be parameters or NULL depending on which of the following -** codes is used as the second parameter. The 5th parameter is the name -** of the database ("main", "temp", etc.) if applicable. The 6th parameter -** is the name of the inner-most trigger or view that is responsible for -** the access attempt or NULL if this access attempt is directly from -** input SQL code. -** -** Arg-3 Arg-4 -*/ -#define SQLITE_COPY 0 /* Table Name File Name */ -#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ -#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ -#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ -#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ -#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ -#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ -#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ -#define SQLITE_DELETE 9 /* Table Name NULL */ -#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ -#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ -#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ -#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ -#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ -#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ -#define SQLITE_DROP_VIEW 17 /* View Name NULL */ -#define SQLITE_INSERT 18 /* Table Name NULL */ -#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ -#define SQLITE_READ 20 /* Table Name Column Name */ -#define SQLITE_SELECT 21 /* NULL NULL */ -#define SQLITE_TRANSACTION 22 /* NULL NULL */ -#define SQLITE_UPDATE 23 /* Table Name Column Name */ -#define SQLITE_ATTACH 24 /* Filename NULL */ -#define SQLITE_DETACH 25 /* Database Name NULL */ - - -/* -** The return value of the authorization function should be one of the -** following constants: -*/ -/* #define SQLITE_OK 0 // Allow access (This is actually defined above) */ -#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ -#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ - -/* -** Register a function that is called at every invocation of sqlite_exec() -** or sqlite_compile(). This function can be used (for example) to generate -** a log file of all SQL executed against a database. -*/ -void *sqlite_trace(sqlite*, void(*xTrace)(void*,const char*), void*); - -/*** The Callback-Free API -** -** The following routines implement a new way to access SQLite that does not -** involve the use of callbacks. -** -** An sqlite_vm is an opaque object that represents a single SQL statement -** that is ready to be executed. -*/ -typedef struct sqlite_vm sqlite_vm; - -/* -** To execute an SQLite query without the use of callbacks, you first have -** to compile the SQL using this routine. The 1st parameter "db" is a pointer -** to an sqlite object obtained from sqlite_open(). The 2nd parameter -** "zSql" is the text of the SQL to be compiled. The remaining parameters -** are all outputs. -** -** *pzTail is made to point to the first character past the end of the first -** SQL statement in zSql. This routine only compiles the first statement -** in zSql, so *pzTail is left pointing to what remains uncompiled. -** -** *ppVm is left pointing to a "virtual machine" that can be used to execute -** the compiled statement. Or if there is an error, *ppVm may be set to NULL. -** If the input text contained no SQL (if the input is and empty string or -** a comment) then *ppVm is set to NULL. -** -** If any errors are detected during compilation, an error message is written -** into space obtained from malloc() and *pzErrMsg is made to point to that -** error message. The calling routine is responsible for freeing the text -** of this message when it has finished with it. Use sqlite_freemem() to -** free the message. pzErrMsg may be NULL in which case no error message -** will be generated. -** -** On success, SQLITE_OK is returned. Otherwise and error code is returned. -*/ -int sqlite_compile( - sqlite *db, /* The open database */ - const char *zSql, /* SQL statement to be compiled */ - const char **pzTail, /* OUT: uncompiled tail of zSql */ - sqlite_vm **ppVm, /* OUT: the virtual machine to execute zSql */ - char **pzErrmsg /* OUT: Error message. */ -); - -/* -** After an SQL statement has been compiled, it is handed to this routine -** to be executed. This routine executes the statement as far as it can -** go then returns. The return value will be one of SQLITE_DONE, -** SQLITE_ERROR, SQLITE_BUSY, SQLITE_ROW, or SQLITE_MISUSE. -** -** SQLITE_DONE means that the execute of the SQL statement is complete -** an no errors have occurred. sqlite_step() should not be called again -** for the same virtual machine. *pN is set to the number of columns in -** the result set and *pazColName is set to an array of strings that -** describe the column names and datatypes. The name of the i-th column -** is (*pazColName)[i] and the datatype of the i-th column is -** (*pazColName)[i+*pN]. *pazValue is set to NULL. -** -** SQLITE_ERROR means that the virtual machine encountered a run-time -** error. sqlite_step() should not be called again for the same -** virtual machine. *pN is set to 0 and *pazColName and *pazValue are set -** to NULL. Use sqlite_finalize() to obtain the specific error code -** and the error message text for the error. -** -** SQLITE_BUSY means that an attempt to open the database failed because -** another thread or process is holding a lock. The calling routine -** can try again to open the database by calling sqlite_step() again. -** The return code will only be SQLITE_BUSY if no busy handler is registered -** using the sqlite_busy_handler() or sqlite_busy_timeout() routines. If -** a busy handler callback has been registered but returns 0, then this -** routine will return SQLITE_ERROR and sqltie_finalize() will return -** SQLITE_BUSY when it is called. -** -** SQLITE_ROW means that a single row of the result is now available. -** The data is contained in *pazValue. The value of the i-th column is -** (*azValue)[i]. *pN and *pazColName are set as described in SQLITE_DONE. -** Invoke sqlite_step() again to advance to the next row. -** -** SQLITE_MISUSE is returned if sqlite_step() is called incorrectly. -** For example, if you call sqlite_step() after the virtual machine -** has halted (after a prior call to sqlite_step() has returned SQLITE_DONE) -** or if you call sqlite_step() with an incorrectly initialized virtual -** machine or a virtual machine that has been deleted or that is associated -** with an sqlite structure that has been closed. -*/ -int sqlite_step( - sqlite_vm *pVm, /* The virtual machine to execute */ - int *pN, /* OUT: Number of columns in result */ - const char ***pazValue, /* OUT: Column data */ - const char ***pazColName /* OUT: Column names and datatypes */ -); - -/* -** This routine is called to delete a virtual machine after it has finished -** executing. The return value is the result code. SQLITE_OK is returned -** if the statement executed successfully and some other value is returned if -** there was any kind of error. If an error occurred and pzErrMsg is not -** NULL, then an error message is written into memory obtained from malloc() -** and *pzErrMsg is made to point to that error message. The calling routine -** should use sqlite_freemem() to delete this message when it has finished -** with it. -** -** This routine can be called at any point during the execution of the -** virtual machine. If the virtual machine has not completed execution -** when this routine is called, that is like encountering an error or -** an interrupt. (See sqlite_interrupt().) Incomplete updates may be -** rolled back and transactions cancelled, depending on the circumstances, -** and the result code returned will be SQLITE_ABORT. -*/ -int sqlite_finalize(sqlite_vm*, char **pzErrMsg); - -/* -** This routine deletes the virtual machine, writes any error message to -** *pzErrMsg and returns an SQLite return code in the same way as the -** sqlite_finalize() function. -** -** Additionally, if ppVm is not NULL, *ppVm is left pointing to a new virtual -** machine loaded with the compiled version of the original query ready for -** execution. -** -** If sqlite_reset() returns SQLITE_SCHEMA, then *ppVm is set to NULL. -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite_reset(sqlite_vm*, char **pzErrMsg); - -/* -** If the SQL that was handed to sqlite_compile contains variables that -** are represeted in the SQL text by a question mark ('?'). This routine -** is used to assign values to those variables. -** -** The first parameter is a virtual machine obtained from sqlite_compile(). -** The 2nd "idx" parameter determines which variable in the SQL statement -** to bind the value to. The left most '?' is 1. The 3rd parameter is -** the value to assign to that variable. The 4th parameter is the number -** of bytes in the value, including the terminating \000 for strings. -** Finally, the 5th "copy" parameter is TRUE if SQLite should make its -** own private copy of this value, or false if the space that the 3rd -** parameter points to will be unchanging and can be used directly by -** SQLite. -** -** Unbound variables are treated as having a value of NULL. To explicitly -** set a variable to NULL, call this routine with the 3rd parameter as a -** NULL pointer. -** -** If the 4th "len" parameter is -1, then strlen() is used to find the -** length. -** -** This routine can only be called immediately after sqlite_compile() -** or sqlite_reset() and before any calls to sqlite_step(). -** -******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** -*/ -int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); - -/* -** This routine configures a callback function - the progress callback - that -** is invoked periodically during long running calls to sqlite_exec(), -** sqlite_step() and sqlite_get_table(). An example use for this API is to keep -** a GUI updated during a large query. -** -** The progress callback is invoked once for every N virtual machine opcodes, -** where N is the second argument to this function. The progress callback -** itself is identified by the third argument to this function. The fourth -** argument to this function is a void pointer passed to the progress callback -** function each time it is invoked. -** -** If a call to sqlite_exec(), sqlite_step() or sqlite_get_table() results -** in less than N opcodes being executed, then the progress callback is not -** invoked. -** -** Calling this routine overwrites any previously installed progress callback. -** To remove the progress callback altogether, pass NULL as the third -** argument to this function. -** -** If the progress callback returns a result other than 0, then the current -** query is immediately terminated and any database changes rolled back. If the -** query was part of a larger transaction, then the transaction is not rolled -** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. -*/ -void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); - -#ifdef __cplusplus -} /* End of the 'extern "C"' block */ -#endif - -#endif /* _SQLITE_H_ */ diff --git a/ext/sqlite/libsqlite/src/sqliteInt.h b/ext/sqlite/libsqlite/src/sqliteInt.h deleted file mode 100644 index 02236c2dc985a..0000000000000 --- a/ext/sqlite/libsqlite/src/sqliteInt.h +++ /dev/null @@ -1,1270 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Internal interface definitions for SQLite. -** -** @(#) $Id$ -*/ -#include "config.h" -#include "sqlite.h" -#include "hash.h" -#include "parse.h" -#include "btree.h" -#include -#include -#include -#include - -/* -** The maximum number of in-memory pages to use for the main database -** table and for temporary tables. -*/ -#define MAX_PAGES 2000 -#define TEMP_PAGES 500 - -/* -** If the following macro is set to 1, then NULL values are considered -** distinct for the SELECT DISTINCT statement and for UNION or EXCEPT -** compound queries. No other SQL database engine (among those tested) -** works this way except for OCELOT. But the SQL92 spec implies that -** this is how things should work. -** -** If the following macro is set to 0, then NULLs are indistinct for -** SELECT DISTINCT and for UNION. -*/ -#define NULL_ALWAYS_DISTINCT 0 - -/* -** If the following macro is set to 1, then NULL values are considered -** distinct when determining whether or not two entries are the same -** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL, -** OCELOT, and Firebird all work. The SQL92 spec explicitly says this -** is the way things are suppose to work. -** -** If the following macro is set to 0, the NULLs are indistinct for -** a UNIQUE index. In this mode, you can only have a single NULL entry -** for a column declared UNIQUE. This is the way Informix and SQL Server -** work. -*/ -#define NULL_DISTINCT_FOR_UNIQUE 1 - -/* -** The maximum number of attached databases. This must be at least 2 -** in order to support the main database file (0) and the file used to -** hold temporary tables (1). And it must be less than 256 because -** an unsigned character is used to stored the database index. -*/ -#define MAX_ATTACHED 10 - -/* -** The next macro is used to determine where TEMP tables and indices -** are stored. Possible values: -** -** 0 Always use a temporary files -** 1 Use a file unless overridden by "PRAGMA temp_store" -** 2 Use memory unless overridden by "PRAGMA temp_store" -** 3 Always use memory -*/ -#ifndef TEMP_STORE -# define TEMP_STORE 1 -#endif - -/* -** When building SQLite for embedded systems where memory is scarce, -** you can define one or more of the following macros to omit extra -** features of the library and thus keep the size of the library to -** a minimum. -*/ -/* #define SQLITE_OMIT_AUTHORIZATION 1 */ -/* #define SQLITE_OMIT_INMEMORYDB 1 */ -/* #define SQLITE_OMIT_VACUUM 1 */ -/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */ -/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */ - -/* -** Integers of known sizes. These typedefs might change for architectures -** where the sizes very. Preprocessor macros are available so that the -** types can be conveniently redefined at compile-type. Like this: -** -** cc '-DUINTPTR_TYPE=long long int' ... -*/ -#ifndef UINT32_TYPE -# define UINT32_TYPE unsigned int -#endif -#ifndef UINT16_TYPE -# define UINT16_TYPE unsigned short int -#endif -#ifndef INT16_TYPE -# define INT16_TYPE short int -#endif -#ifndef UINT8_TYPE -# define UINT8_TYPE unsigned char -#endif -#ifndef INT8_TYPE -# define INT8_TYPE signed char -#endif -#ifndef INTPTR_TYPE -# if SQLITE_PTR_SZ==4 -# define INTPTR_TYPE int -# else -# define INTPTR_TYPE long long -# endif -#endif -typedef UINT32_TYPE u32; /* 4-byte unsigned integer */ -typedef UINT16_TYPE u16; /* 2-byte unsigned integer */ -typedef INT16_TYPE i16; /* 2-byte signed integer */ -typedef UINT8_TYPE u8; /* 1-byte unsigned integer */ -typedef UINT8_TYPE i8; /* 1-byte signed integer */ -typedef INTPTR_TYPE ptr; /* Big enough to hold a pointer */ -typedef unsigned INTPTR_TYPE uptr; /* Big enough to hold a pointer */ - -/* -** Defer sourcing vdbe.h until after the "u8" typedef is defined. -*/ -#include "vdbe.h" - -/* -** Most C compilers these days recognize "long double", don't they? -** Just in case we encounter one that does not, we will create a macro -** for long double so that it can be easily changed to just "double". -*/ -#ifndef LONGDOUBLE_TYPE -# define LONGDOUBLE_TYPE long double -#endif - -/* -** This macro casts a pointer to an integer. Useful for doing -** pointer arithmetic. -*/ -#define Addr(X) ((uptr)X) - -/* -** The maximum number of bytes of data that can be put into a single -** row of a single table. The upper bound on this limit is 16777215 -** bytes (or 16MB-1). We have arbitrarily set the limit to just 1MB -** here because the overflow page chain is inefficient for really big -** records and we want to discourage people from thinking that -** multi-megabyte records are OK. If your needs are different, you can -** change this define and recompile to increase or decrease the record -** size. -** -** The 16777198 is computed as follows: 238 bytes of payload on the -** original pages plus 16448 overflow pages each holding 1020 bytes of -** data. -*/ -#define MAX_BYTES_PER_ROW 1048576 -/* #define MAX_BYTES_PER_ROW 16777198 */ - -/* -** If memory allocation problems are found, recompile with -** -** -DMEMORY_DEBUG=1 -** -** to enable some sanity checking on malloc() and free(). To -** check for memory leaks, recompile with -** -** -DMEMORY_DEBUG=2 -** -** and a line of text will be written to standard error for -** each malloc() and free(). This output can be analyzed -** by an AWK script to determine if there are any leaks. -*/ -#ifdef MEMORY_DEBUG -# define sqliteMalloc(X) sqliteMalloc_(X,1,__FILE__,__LINE__) -# define sqliteMallocRaw(X) sqliteMalloc_(X,0,__FILE__,__LINE__) -# define sqliteFree(X) sqliteFree_(X,__FILE__,__LINE__) -# define sqliteRealloc(X,Y) sqliteRealloc_(X,Y,__FILE__,__LINE__) -# define sqliteStrDup(X) sqliteStrDup_(X,__FILE__,__LINE__) -# define sqliteStrNDup(X,Y) sqliteStrNDup_(X,Y,__FILE__,__LINE__) - void sqliteStrRealloc(char**); -#else -# define sqliteRealloc_(X,Y) sqliteRealloc(X,Y) -# define sqliteStrRealloc(X) -#endif - -/* -** This variable gets set if malloc() ever fails. After it gets set, -** the SQLite library shuts down permanently. -*/ -extern int sqlite_malloc_failed; - -/* -** The following global variables are used for testing and debugging -** only. They only work if MEMORY_DEBUG is defined. -*/ -#ifdef MEMORY_DEBUG -extern int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ -extern int sqlite_nFree; /* Number of sqliteFree() calls */ -extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ -#endif - -/* -** Name of the master database table. The master database table -** is a special table that holds the names and attributes of all -** user tables and indices. -*/ -#define MASTER_NAME "sqlite_master" -#define TEMP_MASTER_NAME "sqlite_temp_master" - -/* -** The name of the schema table. -*/ -#define SCHEMA_TABLE(x) (x?TEMP_MASTER_NAME:MASTER_NAME) - -/* -** A convenience macro that returns the number of elements in -** an array. -*/ -#define ArraySize(X) (sizeof(X)/sizeof(X[0])) - -/* -** Forward references to structures -*/ -typedef struct Column Column; -typedef struct Table Table; -typedef struct Index Index; -typedef struct Instruction Instruction; -typedef struct Expr Expr; -typedef struct ExprList ExprList; -typedef struct Parse Parse; -typedef struct Token Token; -typedef struct IdList IdList; -typedef struct SrcList SrcList; -typedef struct WhereInfo WhereInfo; -typedef struct WhereLevel WhereLevel; -typedef struct Select Select; -typedef struct AggExpr AggExpr; -typedef struct FuncDef FuncDef; -typedef struct Trigger Trigger; -typedef struct TriggerStep TriggerStep; -typedef struct TriggerStack TriggerStack; -typedef struct FKey FKey; -typedef struct Db Db; -typedef struct AuthContext AuthContext; - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. -*/ -struct Db { - char *zName; /* Name of this database */ - Btree *pBt; /* The B*Tree structure for this database file */ - int schema_cookie; /* Database schema version number for this file */ - Hash tblHash; /* All tables indexed by name */ - Hash idxHash; /* All (named) indices indexed by name */ - Hash trigHash; /* All triggers indexed by name */ - Hash aFKey; /* Foreign keys indexed by to-table */ - u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */ - u16 flags; /* Flags associated with this database */ - void *pAux; /* Auxiliary data. Usually NULL */ - void (*xFreeAux)(void*); /* Routine to free pAux */ -}; - -/* -** These macros can be used to test, set, or clear bits in the -** Db.flags field. -*/ -#define DbHasProperty(D,I,P) (((D)->aDb[I].flags&(P))==(P)) -#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].flags&(P))!=0) -#define DbSetProperty(D,I,P) (D)->aDb[I].flags|=(P) -#define DbClearProperty(D,I,P) (D)->aDb[I].flags&=~(P) - -/* -** Allowed values for the DB.flags field. -** -** The DB_Locked flag is set when the first OP_Transaction or OP_Checkpoint -** opcode is emitted for a database. This prevents multiple occurances -** of those opcodes for the same database in the same program. Similarly, -** the DB_Cookie flag is set when the OP_VerifyCookie opcode is emitted, -** and prevents duplicate OP_VerifyCookies from taking up space and slowing -** down execution. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. -*/ -#define DB_Locked 0x0001 /* OP_Transaction opcode has been emitted */ -#define DB_Cookie 0x0002 /* OP_VerifyCookie opcode has been emiited */ -#define DB_SchemaLoaded 0x0004 /* The schema has been loaded */ -#define DB_UnresetViews 0x0008 /* Some views have defined column names */ - - -/* -** Each database is an instance of the following structure. -** -** The sqlite.file_format is initialized by the database file -** and helps determines how the data in the database file is -** represented. This field allows newer versions of the library -** to read and write older databases. The various file formats -** are as follows: -** -** file_format==1 Version 2.1.0. -** file_format==2 Version 2.2.0. Add support for INTEGER PRIMARY KEY. -** file_format==3 Version 2.6.0. Fix empty-string index bug. -** file_format==4 Version 2.7.0. Add support for separate numeric and -** text datatypes. -** -** The sqlite.temp_store determines where temporary database files -** are stored. If 1, then a file is created to hold those tables. If -** 2, then they are held in memory. 0 means use the default value in -** the TEMP_STORE macro. -** -** The sqlite.lastRowid records the last insert rowid generated by an -** insert statement. Inserts on views do not affect its value. Each -** trigger has its own context, so that lastRowid can be updated inside -** triggers as usual. The previous value will be restored once the trigger -** exits. Upon entering a before or instead of trigger, lastRowid is no -** longer (since after version 2.8.12) reset to -1. -** -** The sqlite.nChange does not count changes within triggers and keeps no -** context. It is reset at start of sqlite_exec. -** The sqlite.lsChange represents the number of changes made by the last -** insert, update, or delete statement. It remains constant throughout the -** length of a statement and is then updated by OP_SetCounts. It keeps a -** context stack just like lastRowid so that the count of changes -** within a trigger is not seen outside the trigger. Changes to views do not -** affect the value of lsChange. -** The sqlite.csChange keeps track of the number of current changes (since -** the last statement) and is used to update sqlite_lsChange. -*/ -struct sqlite { - int nDb; /* Number of backends currently in use */ - Db *aDb; /* All backends */ - Db aDbStatic[2]; /* Static space for the 2 default backends */ - int flags; /* Miscellanous flags. See below */ - u8 file_format; /* What file format version is this database? */ - u8 safety_level; /* How aggressive at synching data to disk */ - u8 want_to_close; /* Close after all VDBEs are deallocated */ - u8 temp_store; /* 1=file, 2=memory, 0=compile-time default */ - u8 onError; /* Default conflict algorithm */ - int next_cookie; /* Next value of aDb[0].schema_cookie */ - int cache_size; /* Number of pages to use in the cache */ - int nTable; /* Number of tables in the database */ - void *pBusyArg; /* 1st Argument to the busy callback */ - int (*xBusyCallback)(void *,const char*,int); /* The busy callback */ - void *pCommitArg; /* Argument to xCommitCallback() */ - int (*xCommitCallback)(void*);/* Invoked at every commit. */ - Hash aFunc; /* All functions that can be in SQL exprs */ - int lastRowid; /* ROWID of most recent insert (see above) */ - int priorNewRowid; /* Last randomly generated ROWID */ - int magic; /* Magic number for detect library misuse */ - int nChange; /* Number of rows changed (see above) */ - int lsChange; /* Last statement change count (see above) */ - int csChange; /* Current statement change count (see above) */ - struct sqliteInitInfo { /* Information used during initialization */ - int iDb; /* When back is being initialized */ - int newTnum; /* Rootpage of table being initialized */ - u8 busy; /* TRUE if currently initializing */ - } init; - struct Vdbe *pVdbe; /* List of active virtual machines */ - void (*xTrace)(void*,const char*); /* Trace function */ - void *pTraceArg; /* Argument to the trace function */ -#ifndef SQLITE_OMIT_AUTHORIZATION - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); - /* Access authorization function */ - void *pAuthArg; /* 1st argument to the access auth function */ -#endif -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - int (*xProgress)(void *); /* The progress callback */ - void *pProgressArg; /* Argument to the progress callback */ - int nProgressOps; /* Number of opcodes for progress callback */ -#endif -}; - -/* -** Possible values for the sqlite.flags and or Db.flags fields. -** -** On sqlite.flags, the SQLITE_InTrans value means that we have -** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement -** transaction is active on that particular database file. -*/ -#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ -#define SQLITE_Initialized 0x00000002 /* True after initialization */ -#define SQLITE_Interrupt 0x00000004 /* Cancel current operation */ -#define SQLITE_InTrans 0x00000008 /* True if in a transaction */ -#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */ -#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */ -#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */ -#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */ - /* DELETE, or UPDATE and return */ - /* the count using a callback. */ -#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */ - /* result set is empty */ -#define SQLITE_ReportTypes 0x00000200 /* Include information on datatypes */ - /* in 4th argument of callback */ - -/* -** Possible values for the sqlite.magic field. -** The numbers are obtained at random and have no special meaning, other -** than being distinct from one another. -*/ -#define SQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */ -#define SQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */ -#define SQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */ -#define SQLITE_MAGIC_ERROR 0xb5357930 /* An SQLITE_MISUSE error occurred */ - -/* -** Each SQL function is defined by an instance of the following -** structure. A pointer to this structure is stored in the sqlite.aFunc -** hash table. When multiple functions have the same name, the hash table -** points to a linked list of these structures. -*/ -struct FuncDef { - void (*xFunc)(sqlite_func*,int,const char**); /* Regular function */ - void (*xStep)(sqlite_func*,int,const char**); /* Aggregate function step */ - void (*xFinalize)(sqlite_func*); /* Aggregate function finializer */ - signed char nArg; /* Number of arguments. -1 means unlimited */ - signed char dataType; /* Arg that determines datatype. -1=NUMERIC, */ - /* -2=TEXT. -3=SQLITE_ARGS */ - u8 includeTypes; /* Add datatypes to args of xFunc and xStep */ - void *pUserData; /* User data parameter */ - FuncDef *pNext; /* Next function with same name */ -}; - -/* -** information about each column of an SQL table is held in an instance -** of this structure. -*/ -struct Column { - char *zName; /* Name of this column */ - char *zDflt; /* Default value of this column */ - char *zType; /* Data type for this column */ - u8 notNull; /* True if there is a NOT NULL constraint */ - u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */ - u8 sortOrder; /* Some combination of SQLITE_SO_... values */ - u8 dottedName; /* True if zName contains a "." character */ -}; - -/* -** The allowed sort orders. -** -** The TEXT and NUM values use bits that do not overlap with DESC and ASC. -** That way the two can be combined into a single number. -*/ -#define SQLITE_SO_UNK 0 /* Use the default collating type. (SCT_NUM) */ -#define SQLITE_SO_TEXT 2 /* Sort using memcmp() */ -#define SQLITE_SO_NUM 4 /* Sort using sqliteCompare() */ -#define SQLITE_SO_TYPEMASK 6 /* Mask to extract the collating sequence */ -#define SQLITE_SO_ASC 0 /* Sort in ascending order */ -#define SQLITE_SO_DESC 1 /* Sort in descending order */ -#define SQLITE_SO_DIRMASK 1 /* Mask to extract the sort direction */ - -/* -** Each SQL table is represented in memory by an instance of the -** following structure. -** -** Table.zName is the name of the table. The case of the original -** CREATE TABLE statement is stored, but case is not significant for -** comparisons. -** -** Table.nCol is the number of columns in this table. Table.aCol is a -** pointer to an array of Column structures, one for each column. -** -** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of -** the column that is that key. Otherwise Table.iPKey is negative. Note -** that the datatype of the PRIMARY KEY must be INTEGER for this field to -** be set. An INTEGER PRIMARY KEY is used as the rowid for each row of -** the table. If a table has no INTEGER PRIMARY KEY, then a random rowid -** is generated for each row of the table. Table.hasPrimKey is true if -** the table has any PRIMARY KEY, INTEGER or otherwise. -** -** Table.tnum is the page number for the root BTree page of the table in the -** database file. If Table.iDb is the index of the database table backend -** in sqlite.aDb[]. 0 is for the main database and 1 is for the file that -** holds temporary tables and indices. If Table.isTransient -** is true, then the table is stored in a file that is automatically deleted -** when the VDBE cursor to the table is closed. In this case Table.tnum -** refers VDBE cursor number that holds the table open, not to the root -** page number. Transient tables are used to hold the results of a -** sub-query that appears instead of a real table name in the FROM clause -** of a SELECT statement. -*/ -struct Table { - char *zName; /* Name of the table */ - int nCol; /* Number of columns in this table */ - Column *aCol; /* Information about each column */ - int iPKey; /* If not less then 0, use aCol[iPKey] as the primary key */ - Index *pIndex; /* List of SQL indexes on this table. */ - int tnum; /* Root BTree node for this table (see note above) */ - Select *pSelect; /* NULL for tables. Points to definition if a view. */ - u8 readOnly; /* True if this table should not be written by the user */ - u8 iDb; /* Index into sqlite.aDb[] of the backend for this table */ - u8 isTransient; /* True if automatically deleted when VDBE finishes */ - u8 hasPrimKey; /* True if there exists a primary key */ - u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ - Trigger *pTrigger; /* List of SQL triggers on this table */ - FKey *pFKey; /* Linked list of all foreign keys in this table */ -}; - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existance of the to-table is not checked -** until an attempt is made to insert data into the from-table. -** -** The sqlite.aFKey hash table stores pointers to this structure -** given the name of a to-table. For each to-table, all foreign keys -** associated with that table are on a linked list using the FKey.pNextTo -** field. -*/ -struct FKey { - Table *pFrom; /* The table that constains the REFERENCES clause */ - FKey *pNextFrom; /* Next foreign key in pFrom */ - char *zTo; /* Name of table that the key points to */ - FKey *pNextTo; /* Next foreign key that points to zTo */ - int nCol; /* Number of columns in this key */ - struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ - int iFrom; /* Index of column in pFrom */ - char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */ - } *aCol; /* One entry for each of nCol column s */ - u8 isDeferred; /* True if constraint checking is deferred till COMMIT */ - u8 updateConf; /* How to resolve conflicts that occur on UPDATE */ - u8 deleteConf; /* How to resolve conflicts that occur on DELETE */ - u8 insertConf; /* How to resolve conflicts that occur on INSERT */ -}; - -/* -** SQLite supports many different ways to resolve a contraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** -** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The following symbolic values are used to record which type -** of action to take. -*/ -#define OE_None 0 /* There is no constraint to check */ -#define OE_Rollback 1 /* Fail the operation and rollback the transaction */ -#define OE_Abort 2 /* Back out changes but do no rollback transaction */ -#define OE_Fail 3 /* Stop the operation but leave all prior changes */ -#define OE_Ignore 4 /* Ignore the error. Do not do the INSERT or UPDATE */ -#define OE_Replace 5 /* Delete existing record, then do INSERT or UPDATE */ - -#define OE_Restrict 6 /* OE_Abort for IMMEDIATE, OE_Rollback for DEFERRED */ -#define OE_SetNull 7 /* Set the foreign key value to NULL */ -#define OE_SetDflt 8 /* Set the foreign key value to its default */ -#define OE_Cascade 9 /* Cascade the changes */ - -#define OE_Default 99 /* Do whatever the default action is */ - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicate the which conflict resolution -** algorithm to employ whenever an attempt is made to insert a non-unique -** element. -*/ -struct Index { - char *zName; /* Name of this index */ - int nColumn; /* Number of columns in the table used by this index */ - int *aiColumn; /* Which columns are used by this index. 1st is 0 */ - Table *pTable; /* The SQL table being indexed */ - int tnum; /* Page containing root of this index in database file */ - u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ - u8 iDb; /* Index in sqlite.aDb[] of where this index is stored */ - Index *pNext; /* The next index associated with the same table */ -}; - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** Note if Token.z==0 then Token.dyn and Token.n are undefined and -** may contain random values. Do not make any assuptions about Token.dyn -** and Token.n when Token.z==0. -*/ -struct Token { - const char *z; /* Text of the token. Not NULL-terminated! */ - unsigned dyn : 1; /* True for malloced memory, false for static */ - unsigned n : 31; /* Number of characters in this token */ -}; - -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** Expr.pRight and Expr.pLeft are subexpressions. Expr.pList is a list -** of argument if the expression is a function. -** -** Expr.token is the operator token for this node. For some expressions -** that have subexpressions, Expr.token can be the complete text that gave -** rise to the Expr. In the latter case, the token is marked as being -** a compound token. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is a function, the Expr.iTable is an integer code -** representing which function. If the expression is an unbound variable -** marker (a question mark character '?' in the original SQL) then the -** Expr.iTable holds the index number for that variable. -** -** The Expr.pSelect field points to a SELECT statement. The SELECT might -** be the right operand of an IN operator. Or, if a scalar SELECT appears -** in an expression the opcode is TK_SELECT and Expr.pSelect is the only -** operand. -*/ -struct Expr { - u8 op; /* Operation performed by this node */ - u8 dataType; /* Either SQLITE_SO_TEXT or SQLITE_SO_NUM */ - u8 iDb; /* Database referenced by this expression */ - u8 flags; /* Various flags. See below */ - Expr *pLeft, *pRight; /* Left and right subnodes */ - ExprList *pList; /* A list of expressions used as function arguments - ** or in " IN (useAgg==TRUE, pull - ** result from the iAgg-th element of the aggregator */ - Select *pSelect; /* When the expression is a sub-select. Also the - ** right side of " IN (
              "); - php_printf("\n"); - } else { - php_printf("%s", module->name); - php_printf("\n"); - } - } - return 0; -} -/* }}} */ - -/* {{{ php_print_gpcse_array - */ -static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) -{ - zval **data, **tmp, tmp2; - char *string_key; - uint string_len; - ulong num_key; - char *elem_esc = NULL; - - zend_is_auto_global(name, name_length TSRMLS_CC); - - if (zend_hash_find(&EG(symbol_table), name, name_length+1, (void **) &data)!=FAILURE - && (Z_TYPE_PP(data)==IS_ARRAY)) { - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data)); - while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) { - if (!sapi_module.phpinfo_as_text) { - PUTS(""); - PUTS("\n"); - } else { - PUTS("\n"); - } - zend_hash_move_forward(Z_ARRVAL_PP(data)); - } - } -} -/* }}} */ - -/* {{{ php_info_print_style - */ -void php_info_print_style(TSRMLS_D) -{ - php_printf("\n"); -} -/* }}} */ - - -/* {{{ php_info_html_esc - */ -PHPAPI char *php_info_html_esc(char *string TSRMLS_DC) -{ - int new_len; - return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); -} -/* }}} */ - - -/* {{{ php_get_uname - */ -PHPAPI char *php_get_uname(char mode) -{ - char *php_uname; - char tmp_uname[256]; -#ifdef PHP_WIN32 - DWORD dwBuild=0; - DWORD dwVersion = GetVersion(); - DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); - DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); - DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1; - char ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; - SYSTEM_INFO SysInfo; - - GetComputerName(ComputerName, &dwSize); - GetSystemInfo(&SysInfo); - - if (mode == 's') { - if (dwVersion < 0x80000000) { - php_uname = "Windows NT"; - } else { - php_uname = "Windows 9x"; - } - } else if (mode == 'r') { - snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d", dwWindowsMajorVersion, dwWindowsMinorVersion); - php_uname = tmp_uname; - } else if (mode == 'n') { - php_uname = ComputerName; - } else if (mode == 'v') { - dwBuild = (DWORD)(HIWORD(dwVersion)); - snprintf(tmp_uname, sizeof(tmp_uname), "build %d", dwBuild); - php_uname = tmp_uname; - } else if (mode == 'm') { - switch (SysInfo.wProcessorArchitecture) { - case PROCESSOR_ARCHITECTURE_INTEL : - snprintf(tmp_uname, sizeof(tmp_uname), "i%d", SysInfo.dwProcessorType); - php_uname = tmp_uname; - break; - case PROCESSOR_ARCHITECTURE_MIPS : - php_uname = "MIPS R4000"; - php_uname = tmp_uname; - break; - case PROCESSOR_ARCHITECTURE_ALPHA : - snprintf(tmp_uname, sizeof(tmp_uname), "Alpha %d", SysInfo.wProcessorLevel); - php_uname = tmp_uname; - break; - case PROCESSOR_ARCHITECTURE_PPC : - snprintf(tmp_uname, sizeof(tmp_uname), "PPC 6%02d", SysInfo.wProcessorLevel); - php_uname = tmp_uname; - break; - case PROCESSOR_ARCHITECTURE_IA64 : - php_uname = "IA64"; - break; -#if defined(PROCESSOR_ARCHITECTURE_IA32_ON_WIN64) - case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 : - php_uname = "IA32"; - break; -#endif -#if defined(PROCESSOR_ARCHITECTURE_AMD64) - case PROCESSOR_ARCHITECTURE_AMD64 : - php_uname = "AMD64"; - break; -#endif - case PROCESSOR_ARCHITECTURE_UNKNOWN : - default : - php_uname = "Unknown"; - break; - } - } else { /* assume mode == 'a' */ - /* Get build numbers for Windows NT or Win95 */ - if (dwVersion < 0x80000000){ - dwBuild = (DWORD)(HIWORD(dwVersion)); - snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d", - "Windows NT", ComputerName, - dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild); - } else { - snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d", - "Windows 9x", ComputerName, - dwWindowsMajorVersion, dwWindowsMinorVersion); - } - php_uname = tmp_uname; - } -#else -#ifdef HAVE_SYS_UTSNAME_H - struct utsname buf; - if (uname((struct utsname *)&buf) == -1) { - php_uname = PHP_UNAME; - } else { - if (mode == 's') { - php_uname = buf.sysname; - } else if (mode == 'r') { - php_uname = buf.release; - } else if (mode == 'n') { - php_uname = buf.nodename; - } else if (mode == 'v') { - php_uname = buf.version; - } else if (mode == 'm') { - php_uname = buf.machine; - } else { /* assume mode == 'a' */ - snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %s %s %s", - buf.sysname, buf.nodename, buf.release, buf.version, - buf.machine); - php_uname = tmp_uname; - } - } -#else - php_uname = PHP_UNAME; -#endif -#endif - return estrdup(php_uname); -} -/* }}} */ - - -/* {{{ php_print_info_htmlhead - */ -PHPAPI void php_print_info_htmlhead(TSRMLS_D) -{ - -/*** none of this is needed now *** - - const char *charset = NULL; - - if (SG(default_charset)) { - charset = SG(default_charset); - } - -#if HAVE_MBSTRING - if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { - if (MBSTRG(current_http_output_encoding) == mbfl_no_encoding_pass) { - charset = "US-ASCII"; - } else { - charset = mbfl_no2preferred_mime_name(MBSTRG(current_http_output_encoding)); - } - } -#endif - -#if HAVE_ICONV - if (php_ob_handler_used("ob_iconv_handler" TSRMLS_CC)) { - charset = ICONVG(output_encoding); - } -#endif - - if (!charset || !charset[0]) { - charset = "US-ASCII"; - } - -*** none of that is needed now ***/ - - - PUTS("\n"); - PUTS(""); - PUTS("\n"); - php_info_print_style(TSRMLS_C); - PUTS("phpinfo()"); -/* - php_printf("\n", charset); -*/ - PUTS("\n"); - PUTS("
              \n"); -} -/* }}} */ - -/* {{{ module_name_cmp */ -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f = *((Bucket **) a); - Bucket *s = *((Bucket **) b); - - return strcasecmp(((zend_module_entry *)f->pData)->name, - ((zend_module_entry *)s->pData)->name); -} -/* }}} */ - -/* {{{ php_print_info - */ -PHPAPI void php_print_info(int flag TSRMLS_DC) -{ - char **env, *tmp1, *tmp2; - char *php_uname; - int expose_php = INI_INT("expose_php"); - - if (!sapi_module.phpinfo_as_text) { - php_print_info_htmlhead(TSRMLS_C); - } else { - PUTS("phpinfo()\n"); - } - - if (flag & PHP_INFO_GENERAL) { - char *zend_version = get_zend_version(); - char temp_api[10]; - char *logo_guid; - - php_uname = php_get_uname('a'); - - if (!sapi_module.phpinfo_as_text) { - php_info_print_box_start(1); - } - - if (expose_php && !sapi_module.phpinfo_as_text) { - PUTS("\"PHP"); - } - - if (!sapi_module.phpinfo_as_text) { - php_printf("

              PHP Version %s

              \n", PHP_VERSION); - } else { - php_info_print_table_row(2, "PHP Version", PHP_VERSION); - } - php_info_print_box_end(); - php_info_print_table_start(); - php_info_print_table_row(2, "System", php_uname ); - php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__ ); -#ifdef CONFIGURE_COMMAND - php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND ); -#endif - if (sapi_module.pretty_name) { - php_info_print_table_row(2, "Server API", sapi_module.pretty_name ); - } - -#ifdef VIRTUAL_DIR - php_info_print_table_row(2, "Virtual Directory Support", "enabled" ); -#else - php_info_print_table_row(2, "Virtual Directory Support", "disabled" ); -#endif - - php_info_print_table_row(2, "Configuration File (php.ini) Path", php_ini_opened_path?php_ini_opened_path:PHP_CONFIG_FILE_PATH); - - if (strlen(PHP_CONFIG_FILE_SCAN_DIR)) { - php_info_print_table_row(2, "Scan this dir for additional .ini files", PHP_CONFIG_FILE_SCAN_DIR); - if (php_ini_scanned_files) { - php_info_print_table_row(2, "additional .ini files parsed", php_ini_scanned_files); - } - } - - snprintf(temp_api, sizeof(temp_api), "%d", PHP_API_VERSION); - php_info_print_table_row(2, "PHP API", temp_api); - - snprintf(temp_api, sizeof(temp_api), "%d", ZEND_MODULE_API_NO); - php_info_print_table_row(2, "PHP Extension", temp_api); - - snprintf(temp_api, sizeof(temp_api), "%d", ZEND_EXTENSION_API_NO); - php_info_print_table_row(2, "Zend Extension", temp_api); - -#if ZEND_DEBUG - php_info_print_table_row(2, "Debug Build", "yes" ); -#else - php_info_print_table_row(2, "Debug Build", "no" ); -#endif - -#ifdef ZTS - php_info_print_table_row(2, "Thread Safety", "enabled" ); -#else - php_info_print_table_row(2, "Thread Safety", "disabled" ); -#endif - -#if USE_ZEND_ALLOC - php_info_print_table_row(2, "Zend Memory Manager", "enabled" ); -#else - php_info_print_table_row(2, "Zend Memory Manager", "disabled" ); -#endif - - { - char buf[1024]; - snprintf(buf, sizeof(buf), "Based on%s. ICU Version %s.", U_COPYRIGHT_STRING, U_ICU_VERSION); - php_info_print_table_row(2, "Unicode Support", buf); - } -#if HAVE_IPV6 - php_info_print_table_row(2, "IPv6 Support", "enabled" ); -#else - php_info_print_table_row(2, "IPv6 Support", "disabled" ); -#endif - { - HashTable *url_stream_wrappers_hash; - char *stream_protocol, *stream_protocols_buf = NULL; - int stream_protocol_len, stream_protocols_buf_len = 0; - ulong num_key; - - if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { - for (zend_hash_internal_pointer_reset(url_stream_wrappers_hash); - zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(url_stream_wrappers_hash)) { - stream_protocols_buf = erealloc(stream_protocols_buf, stream_protocols_buf_len + stream_protocol_len + 2 + 1); - memcpy(stream_protocols_buf + stream_protocols_buf_len, stream_protocol, stream_protocol_len); - stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len] = ','; - stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len + 1] = ' '; - stream_protocols_buf_len += stream_protocol_len + 2; - } - if (stream_protocols_buf) { - stream_protocols_buf[stream_protocols_buf_len - 2] = ' '; - stream_protocols_buf[stream_protocols_buf_len] = 0; - php_info_print_table_row(2, "Registered PHP Streams", stream_protocols_buf); - efree(stream_protocols_buf); - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "Registered PHP Streams", "no streams registered"); - } - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "PHP Streams", "disabled"); /* ?? */ - } - } - - { - HashTable *stream_xport_hash; - char *xport_name, *xport_buf = NULL; - int xport_name_len, xport_buf_len = 0, xport_buf_size = 0; - ulong num_key; - - if ((stream_xport_hash = php_stream_xport_get_hash())) { - for(zend_hash_internal_pointer_reset(stream_xport_hash); - zend_hash_get_current_key_ex(stream_xport_hash, &xport_name, &xport_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(stream_xport_hash)) { - if (xport_buf_len + xport_name_len + 3 > xport_buf_size) { - while (xport_buf_len + xport_name_len + 3 > xport_buf_size) { - xport_buf_size += 256; - } - if (xport_buf) { - xport_buf = erealloc(xport_buf, xport_buf_size); - } else { - xport_buf = emalloc(xport_buf_size); - } - } - if (xport_buf_len > 0) { - xport_buf[xport_buf_len++] = ','; - xport_buf[xport_buf_len++] = ' '; - } - memcpy(xport_buf + xport_buf_len, xport_name, xport_name_len); - xport_buf_len += xport_name_len; - xport_buf[xport_buf_len] = '\0'; - } - if (xport_buf) { - php_info_print_table_row(2, "Registered Stream Socket Transports", xport_buf); - efree(xport_buf); - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "Registered Stream Socket Transports", "no transports registered"); - } - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "Stream Socket Transports", "disabled"); /* ?? */ - } - } - - { - HashTable *stream_filter_hash; - char *filter_name, *filter_buf = NULL; - int filter_name_len, filter_buf_len = 0, filter_buf_size = 0; - ulong num_key; - - if ((stream_filter_hash = php_get_stream_filters_hash())) { - for(zend_hash_internal_pointer_reset(stream_filter_hash); - zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, &filter_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(stream_filter_hash)) { - if (filter_buf_len + filter_name_len + 3 > filter_buf_size) { - while (filter_buf_len + filter_name_len + 3 > filter_buf_size) { - filter_buf_size += 256; - } - if (filter_buf) { - filter_buf = erealloc(filter_buf, filter_buf_size); - } else { - filter_buf = emalloc(filter_buf_size); - } - } - if (filter_buf_len > 0) { - filter_buf[filter_buf_len++] = ','; - filter_buf[filter_buf_len++] = ' '; - } - memcpy(filter_buf + filter_buf_len, filter_name, filter_name_len); - filter_buf_len += filter_name_len; - filter_buf[filter_buf_len] = '\0'; - } - if (filter_buf) { - php_info_print_table_row(2, "Registered Stream Filters", filter_buf); - efree(filter_buf); - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "Registered Stream Filters", "no filters registered"); - } - } else { - /* Any chances we will ever hit this? */ - php_info_print_table_row(2, "Stream Filters", "disabled"); /* ?? */ - } - } - - php_info_print_table_end(); - - /* Zend Engine */ - php_info_print_box_start(0); - if (expose_php && !sapi_module.phpinfo_as_text) { - PUTS("\"Zend\n"); - } - PUTS("This program makes use of the Zend Scripting Language Engine:"); - PUTS(!sapi_module.phpinfo_as_text?"
              ":"\n"); - if (sapi_module.phpinfo_as_text) { - PUTS(zend_version); - } else { - zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC); - } - php_info_print_box_end(); - efree(php_uname); - } - - if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) { - php_info_print_hr(); - PUTS("

              "); - PUTS("PHP Credits"); - PUTS("

              \n"); - } - - zend_ini_sort_entries(TSRMLS_C); - - if (flag & PHP_INFO_CONFIGURATION) { - php_info_print_hr(); - if (!sapi_module.phpinfo_as_text) { - PUTS("

              Configuration

              \n"); - } else { - SECTION("Configuration"); - } - SECTION("PHP Core"); - display_ini_entries(NULL); - } - - if (flag & PHP_INFO_MODULES) { - int show_info_func; - HashTable sorted_registry; - zend_module_entry tmp; - - zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); - zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - - show_info_func = 1; - zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC); - - SECTION("Additional Modules"); - php_info_print_table_start(); - php_info_print_table_header(1, "Module Name"); - show_info_func = 0; - zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC); - php_info_print_table_end(); - - zend_hash_destroy(&sorted_registry); - } - - if (flag & PHP_INFO_ENVIRONMENT) { - SECTION("Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - for (env=environ; env!=NULL && *env !=NULL; env++) { - tmp1 = estrdup(*env); - if (!(tmp2=strchr(tmp1,'='))) { /* malformed entry? */ - efree(tmp1); - continue; - } - *tmp2 = 0; - tmp2++; - php_info_print_table_row(2, tmp1, tmp2); - efree(tmp1); - } - php_info_print_table_end(); - } - - if (flag & PHP_INFO_VARIABLES) { - pval **data; - - SECTION("PHP Variables"); - - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) { - php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_PP(data)); - } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) { - php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_PP(data)); - } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) { - php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_PP(data)); - } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) { - php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_PP(data)); - } - php_print_gpcse_array("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); - php_print_gpcse_array("_GET", sizeof("_GET")-1 TSRMLS_CC); - php_print_gpcse_array("_POST", sizeof("_POST")-1 TSRMLS_CC); - php_print_gpcse_array("_FILES", sizeof("_FILES")-1 TSRMLS_CC); - php_print_gpcse_array("_COOKIE", sizeof("_COOKIE")-1 TSRMLS_CC); - php_print_gpcse_array("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - php_print_gpcse_array("_ENV", sizeof("_ENV")-1 TSRMLS_CC); - php_info_print_table_end(); - } - - if (flag & PHP_INFO_LICENSE) { - if (!sapi_module.phpinfo_as_text) { - SECTION("PHP License"); - php_info_print_box_start(0); - PUTS("

              \n"); - PUTS("This program is free software; you can redistribute it and/or modify "); - PUTS("it under the terms of the PHP License as published by the PHP Group "); - PUTS("and included in the distribution in the file: LICENSE\n"); - PUTS("

              \n"); - PUTS("

              "); - PUTS("This program is distributed in the hope that it will be useful, "); - PUTS("but WITHOUT ANY WARRANTY; without even the implied warranty of "); - PUTS("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); - PUTS("

              \n"); - PUTS("

              "); - PUTS("If you did not receive a copy of the PHP license, or have any questions about "); - PUTS("PHP licensing, please contact license@php.net.\n"); - PUTS("

              \n"); - php_info_print_box_end(); - } else { - PUTS("\nPHP License\n"); - PUTS("This program is free software; you can redistribute it and/or modify\n"); - PUTS("it under the terms of the PHP License as published by the PHP Group\n"); - PUTS("and included in the distribution in the file: LICENSE\n"); - PUTS("\n"); - PUTS("This program is distributed in the hope that it will be useful,\n"); - PUTS("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); - PUTS("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); - PUTS("\n"); - PUTS("If you did not receive a copy of the PHP license, or have any\n"); - PUTS("questions about PHP licensing, please contact license@php.net.\n"); - } - } - if (!sapi_module.phpinfo_as_text) { - PUTS("
              "); - } -} -/* }}} */ - - -PHPAPI void php_info_print_table_start() -{ - if (!sapi_module.phpinfo_as_text) { - php_printf("
              "); - php_printf("%s", module->name); - php_printf("
              "); - - } - - PUTS(name); - PUTS("[\""); - - switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) { - case HASH_KEY_IS_STRING: - if (!sapi_module.phpinfo_as_text) { - elem_esc = php_info_html_esc(string_key TSRMLS_CC); - PUTS(elem_esc); - efree(elem_esc); - } else { - PUTS(string_key); - } - break; - case HASH_KEY_IS_LONG: - php_printf("%ld", num_key); - break; - } - PUTS("\"]"); - if (!sapi_module.phpinfo_as_text) { - PUTS(""); - } else { - PUTS(" => "); - } - if (Z_TYPE_PP(tmp) == IS_ARRAY) { - zval *tmp3; - - MAKE_STD_ZVAL(tmp3); - - if (!sapi_module.phpinfo_as_text) { - PUTS("
              ");
              -				}
              -				php_start_ob_buffer(NULL, 4096, 1 TSRMLS_CC);
              -				
              -				zend_print_zval_r(*tmp, 0 TSRMLS_CC);
              -				
              -				php_ob_get_buffer(tmp3 TSRMLS_CC);
              -				php_end_ob_buffer(0, 0 TSRMLS_CC);
              -				
              -				if (!sapi_module.phpinfo_as_text) {
              -					elem_esc = php_info_html_esc(Z_STRVAL_P(tmp3) TSRMLS_CC);
              -					PUTS(elem_esc);
              -					efree(elem_esc);
              -					PUTS("
              "); - } else { - PUTS(Z_STRVAL_P(tmp3)); - } - zval_ptr_dtor(&tmp3); - - } else if (Z_TYPE_PP(tmp) != IS_STRING) { - tmp2 = **tmp; - zval_copy_ctor(&tmp2); - convert_to_string(&tmp2); - if (!sapi_module.phpinfo_as_text) { - if (Z_STRLEN(tmp2) == 0) { - PUTS("no value"); - } else { - elem_esc = php_info_html_esc(Z_STRVAL(tmp2) TSRMLS_CC); - PUTS(elem_esc); - efree(elem_esc); - } - } else { - PUTS(Z_STRVAL(tmp2)); - } - zval_dtor(&tmp2); - } else { - if (!sapi_module.phpinfo_as_text) { - if (Z_STRLEN_PP(tmp) == 0) { - PUTS("no value"); - } else { - elem_esc = php_info_html_esc(Z_STRVAL_PP(tmp) TSRMLS_CC); - PUTS(elem_esc); - efree(elem_esc); - } - } else { - PUTS(Z_STRVAL_PP(tmp)); - } - } - if (!sapi_module.phpinfo_as_text) { - PUTS("
              \n"); - } else { - php_printf("\n"); - } -} - -PHPAPI void php_info_print_table_end() -{ - if (!sapi_module.phpinfo_as_text) { - php_printf("

              \n"); - } - -} - -PHPAPI void php_info_print_box_start(int flag) -{ - php_info_print_table_start(); - if (flag) { - if (!sapi_module.phpinfo_as_text) { - php_printf("\n"); - } - } else { - if (!sapi_module.phpinfo_as_text) { - php_printf("\n"); - } else { - php_printf("\n"); - } - } -} - -PHPAPI void php_info_print_box_end() -{ - if (!sapi_module.phpinfo_as_text) { - php_printf("\n"); - } - php_info_print_table_end(); -} - -PHPAPI void php_info_print_hr() -{ - if (!sapi_module.phpinfo_as_text) { - php_printf("
              \n"); - } else { - php_printf("\n\n _______________________________________________________________________\n\n"); - } -} - -PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) -{ - int spaces; - - if (!sapi_module.phpinfo_as_text) { - php_printf("%s\n", num_cols, header ); - } else { - spaces = (74 - strlen(header)); - php_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " "); - } -} - -/* {{{ php_info_print_table_header - */ -PHPAPI void php_info_print_table_header(int num_cols, ...) -{ - int i; - va_list row_elements; - char *row_element; - - TSRMLS_FETCH(); - - va_start(row_elements, num_cols); - if (!sapi_module.phpinfo_as_text) { - php_printf(""); - } - for (i=0; i"); - PUTS(row_element); - PUTS(""); - } else { - PUTS(row_element); - if (i < num_cols-1) { - PUTS(" => "); - } else { - PUTS("\n"); - } - } - } - if (!sapi_module.phpinfo_as_text) { - php_printf("\n"); - } - - va_end(row_elements); -} -/* }}} */ - -/* {{{ php_info_print_table_row_internal - */ -static void php_info_print_table_row_internal(int num_cols, - const char *value_class, va_list row_elements) -{ - int i; - char *row_element; - char *elem_esc = NULL; -/* - int elem_esc_len; -*/ - - TSRMLS_FETCH(); - - if (!sapi_module.phpinfo_as_text) { - php_printf(""); - } - for (i=0; i", - (i==0 ? "e" : value_class ) - ); - } - row_element = va_arg(row_elements, char *); - if (!row_element || !*row_element) { - if (!sapi_module.phpinfo_as_text) { - PUTS( "no value" ); - } else { - PUTS( " " ); - } - } else { - if (!sapi_module.phpinfo_as_text) { - elem_esc = php_info_html_esc(row_element TSRMLS_CC); - PUTS(elem_esc); - efree(elem_esc); - } else { - PUTS(row_element); - if (i < num_cols-1) { - PUTS(" => "); - } - } - } - if (!sapi_module.phpinfo_as_text) { - php_printf(" "); - } else if (i == (num_cols - 1)) { - PUTS("\n"); - } - } - if (!sapi_module.phpinfo_as_text) { - php_printf("\n"); - } -} -/* }}} */ - -/* {{{ php_info_print_table_row - */ -PHPAPI void php_info_print_table_row(int num_cols, ...) -{ - va_list row_elements; - - va_start(row_elements, num_cols); - php_info_print_table_row_internal(num_cols, "v", row_elements); - va_end(row_elements); -} -/* }}} */ - -/* {{{ php_info_print_table_row_ex - */ -PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, - ...) -{ - va_list row_elements; - - va_start(row_elements, value_class); - php_info_print_table_row_internal(num_cols, value_class, row_elements); - va_end(row_elements); -} -/* }}} */ - -/* {{{ register_phpinfo_constants - */ -void register_phpinfo_constants(INIT_FUNC_ARGS) -{ - REGISTER_LONG_CONSTANT("INFO_GENERAL", PHP_INFO_GENERAL, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_CREDITS", PHP_INFO_CREDITS, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_CONFIGURATION", PHP_INFO_CONFIGURATION, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_MODULES", PHP_INFO_MODULES, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_ENVIRONMENT", PHP_INFO_ENVIRONMENT, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_VARIABLES", PHP_INFO_VARIABLES, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_LICENSE", PHP_INFO_LICENSE, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("INFO_ALL", PHP_INFO_ALL, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_GROUP", PHP_CREDITS_GROUP, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_GENERAL", PHP_CREDITS_GENERAL, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_SAPI", PHP_CREDITS_SAPI, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_MODULES", PHP_CREDITS_MODULES, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_DOCS", PHP_CREDITS_DOCS, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_FULLPAGE", PHP_CREDITS_FULLPAGE, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_QA", PHP_CREDITS_QA, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("CREDITS_ALL", PHP_CREDITS_ALL, CONST_PERSISTENT|CONST_CS); -} -/* }}} */ - -/* {{{ proto void phpinfo([int what]) - Output a page of useful information about PHP and the current request */ -PHP_FUNCTION(phpinfo) -{ - int argc = ZEND_NUM_ARGS(); - long flag; - - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) { - return; - } - - if(!argc) { - flag = PHP_INFO_ALL; - } - - /* Andale! Andale! Yee-Hah! */ - php_start_ob_buffer(NULL, 4096, 0 TSRMLS_CC); - php_print_info(flag TSRMLS_CC); - php_end_ob_buffer(1, 0 TSRMLS_CC); - - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto string phpversion([string extension]) - Return the current PHP version */ -PHP_FUNCTION(phpversion) -{ - zval **arg; - int argc = ZEND_NUM_ARGS(); - - if (argc == 0) { - RETURN_ASCII_STRING(PHP_VERSION, 1); - } else if (argc == 1 && zend_get_parameters_ex(1, &arg) == SUCCESS) { - char *version; - convert_to_string_ex(arg); - version = zend_get_module_version(Z_STRVAL_PP(arg)); - if (version == NULL) { - RETURN_FALSE; - } - RETURN_ASCII_STRING(version, 1); - } else { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto void phpcredits([int flag]) - Prints the list of people who've contributed to the PHP project */ -PHP_FUNCTION(phpcredits) -{ - int argc = ZEND_NUM_ARGS(); - long flag; - - if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) { - return; - } - - if(!argc) { - flag = PHP_CREDITS_ALL; - } - - php_print_credits(flag TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ php_logo_guid - */ -PHPAPI char *php_logo_guid() -{ - char *logo_guid; - - time_t the_time; - struct tm *ta, tmbuf; - - the_time = time(NULL); - ta = php_localtime_r(&the_time, &tmbuf); - - if ((ta->tm_mon==3) && (ta->tm_mday==1)) { - logo_guid = PHP_EGG_LOGO_GUID; - } else { - logo_guid = PHP_LOGO_GUID; - } - - return estrdup(logo_guid); - -} -/* }}} */ - -/* {{{ proto string php_logo_guid(void) - Return the special ID used to request the PHP logo in phpinfo screens*/ -PHP_FUNCTION(php_logo_guid) -{ - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_ASCII_STRING(php_logo_guid(), 0); -} -/* }}} */ - -/* {{{ proto string php_real_logo_guid(void) - Return the special ID used to request the PHP logo in phpinfo screens*/ -PHP_FUNCTION(php_real_logo_guid) -{ - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_ASCII_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1); -} -/* }}} */ - -/* {{{ proto string php_egg_logo_guid(void) - Return the special ID used to request the PHP logo in phpinfo screens*/ -PHP_FUNCTION(php_egg_logo_guid) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_ASCII_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1); -} -/* }}} */ - -/* {{{ proto string zend_logo_guid(void) - Return the special ID used to request the Zend logo in phpinfo screens*/ -PHP_FUNCTION(zend_logo_guid) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_ASCII_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1); -} -/* }}} */ - -/* {{{ proto string php_sapi_name(void) - Return the current SAPI module name */ -PHP_FUNCTION(php_sapi_name) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (sapi_module.name) { - RETURN_ASCII_STRING(sapi_module.name, 1); - } else { - RETURN_FALSE; - } -} - -/* }}} */ - -/* {{{ proto string php_uname(void) - Return information about the system PHP was built on */ -PHP_FUNCTION(php_uname) -{ - char *mode = "a"; - int modelen; - char *tmp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) { - return; - } - tmp = php_get_uname(*mode); - RETVAL_RT_STRING(tmp, 0); - if (UG(unicode)) { - efree(tmp); - } -} - -/* }}} */ - -/* {{{ proto string php_ini_scanned_files(void) - Return comma-separated string of .ini files parsed from the additional ini dir */ -PHP_FUNCTION(php_ini_scanned_files) -{ - if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) { - RETURN_RT_STRING(php_ini_scanned_files, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/info.h b/ext/standard/info.h deleted file mode 100644 index 5b3bd12fd5578..0000000000000 --- a/ext/standard/info.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef INFO_H -#define INFO_H - -#define PHP_ENTRY_NAME_COLOR "#ccccff" -#define PHP_CONTENTS_COLOR "#cccccc" -#define PHP_HEADER_COLOR "#9999cc" - -#define PHP_INFO_GENERAL (1<<0) -#define PHP_INFO_CREDITS (1<<1) -#define PHP_INFO_CONFIGURATION (1<<2) -#define PHP_INFO_MODULES (1<<3) -#define PHP_INFO_ENVIRONMENT (1<<4) -#define PHP_INFO_VARIABLES (1<<5) -#define PHP_INFO_LICENSE (1<<6) -#define PHP_INFO_ALL 0xFFFFFFFF - -#ifndef HAVE_CREDITS_DEFS -#define HAVE_CREDITS_DEFS - -#define PHP_CREDITS_GROUP (1<<0) -#define PHP_CREDITS_GENERAL (1<<1) -#define PHP_CREDITS_SAPI (1<<2) -#define PHP_CREDITS_MODULES (1<<3) -#define PHP_CREDITS_DOCS (1<<4) -#define PHP_CREDITS_FULLPAGE (1<<5) -#define PHP_CREDITS_QA (1<<6) -#define PHP_CREDITS_WEB (1<<7) -#define PHP_CREDITS_ALL 0xFFFFFFFF - -#endif /* HAVE_CREDITS_DEFS */ - -#define PHP_LOGO_GUID "PHPE9568F34-D428-11d2-A769-00AA001ACF42" -#define PHP_EGG_LOGO_GUID "PHPE9568F36-D428-11d2-A769-00AA001ACF42" -#define ZEND_LOGO_GUID "PHPE9568F35-D428-11d2-A769-00AA001ACF42" -#define PHP_CREDITS_GUID "PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000" - -BEGIN_EXTERN_C() -PHP_FUNCTION(phpversion); -PHP_FUNCTION(phpinfo); -PHP_FUNCTION(phpcredits); -PHP_FUNCTION(php_logo_guid); -PHP_FUNCTION(php_real_logo_guid); -PHP_FUNCTION(zend_logo_guid); -PHP_FUNCTION(php_egg_logo_guid); -PHP_FUNCTION(php_sapi_name); -PHP_FUNCTION(php_uname); -PHP_FUNCTION(php_ini_scanned_files); -PHPAPI char *php_info_html_esc(char *string TSRMLS_DC); -PHPAPI void php_print_info_htmlhead(TSRMLS_D); -PHPAPI void php_print_info(int flag TSRMLS_DC); -PHPAPI void php_print_style(void); -PHPAPI void php_info_print_style(TSRMLS_D); -PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header); -PHPAPI void php_info_print_table_header(int num_cols, ...); -PHPAPI void php_info_print_table_row(int num_cols, ...); -PHPAPI void php_info_print_table_row_ex(int num_cols, const char *, ...); -PHPAPI void php_info_print_table_start(void); -PHPAPI void php_info_print_table_end(void); -PHPAPI void php_info_print_box_start(int bg); -PHPAPI void php_info_print_box_end(void); -PHPAPI void php_info_print_hr(void); -PHPAPI char *php_logo_guid(void); - -void register_phpinfo_constants(INIT_FUNC_ARGS); -END_EXTERN_C() - -#endif /* INFO_H */ diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c deleted file mode 100644 index af77640f6baa2..0000000000000 --- a/ext/standard/iptc.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * Functions to parse & compse IPTC data. - * PhotoShop >= 3.0 can read and write textual data to JPEG files. - * ... more to come ..... - * - * i know, parts of this is now duplicated in image.c - * but in this case i think it's okay! - */ - -/* - * TODO: - * - add IPTC translation table - */ - -#include "php.h" -#include "php_iptc.h" -#include "ext/standard/head.h" - -#include - - -/* some defines for the different JPEG block types */ -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xe0 -#define M_APP1 0xe1 -#define M_APP2 0xe2 -#define M_APP3 0xe3 -#define M_APP4 0xe4 -#define M_APP5 0xe5 -#define M_APP6 0xe6 -#define M_APP7 0xe7 -#define M_APP8 0xe8 -#define M_APP9 0xe9 -#define M_APP10 0xea -#define M_APP11 0xeb -#define M_APP12 0xec -#define M_APP13 0xed -#define M_APP14 0xee -#define M_APP15 0xef - -/* {{{ php_iptc_put1 - */ -static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf TSRMLS_DC) -{ - if (spool > 0) - PUTC(c); - - if (spoolbuf) *(*spoolbuf)++ = c; - - return c; -} -/* }}} */ - -/* {{{ php_iptc_get1 - */ -static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) -{ - int c; - char cc; - - c = getc(fp); - - if (c == EOF) return EOF; - - if (spool > 0) { - cc = c; - PUTC(cc); - } - - if (spoolbuf) *(*spoolbuf)++ = c; - - return c; -} -/* }}} */ - -/* {{{ php_iptc_read_remaining - */ -static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) -{ - while (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) != EOF) continue; - - return M_EOI; -} -/* }}} */ - -/* {{{ php_iptc_skip_variable - */ -static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) -{ - unsigned int length; - int c1, c2; - - if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; - - if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; - - length = (((unsigned char) c1) << 8) + ((unsigned char) c2); - - length -= 2; - - while (length--) - if (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) == EOF) return M_EOI; - - return 0; -} -/* }}} */ - -/* {{{ php_iptc_next_marker - */ -static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) -{ - int c; - - /* skip unimportant stuff */ - - c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC); - - if (c == EOF) return M_EOI; - - while (c != 0xff) { - if ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) - return M_EOI; /* we hit EOF */ - } - - /* get marker byte, swallowing possible padding */ - do { - c = php_iptc_get1(fp, 0, 0 TSRMLS_CC); - if (c == EOF) - return M_EOI; /* we hit EOF */ - else - if (c == 0xff) - php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf TSRMLS_CC); - } while (c == 0xff); - - return (unsigned int) c; -} -/* }}} */ - -static char psheader[] = "\xFF\xED\0\0Photoshop 3.0\08BIM\x04\x04\0\0\0\0"; - -/* {{{ proto array iptcembed(string iptcdata, string jpeg_file_name [, int spool]) - Embed binary IPTC data into a JPEG image. */ -PHP_FUNCTION(iptcembed) -{ - zval **iptcdata, **jpeg_file, **spool_flag; - FILE *fp; - unsigned int marker; - unsigned int spool = 0, done = 0, inx, len; - unsigned char *spoolbuf=0, *poi=0; - struct stat sb; - - switch(ZEND_NUM_ARGS()){ - case 3: - if (zend_get_parameters_ex(3, &iptcdata, &jpeg_file, &spool_flag) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(iptcdata); - convert_to_string_ex(jpeg_file); - convert_to_long_ex(spool_flag); - spool = Z_LVAL_PP(spool_flag); - break; - - case 2: - if (zend_get_parameters_ex(2, &iptcdata, &jpeg_file) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(iptcdata); - convert_to_string_ex(jpeg_file); - break; - - default: - WRONG_PARAM_COUNT; - break; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(jpeg_file), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(jpeg_file) TSRMLS_CC)) { - RETURN_FALSE; - } - - if ((fp = VCWD_FOPEN(Z_STRVAL_PP(jpeg_file), "rb")) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open %s", Z_STRVAL_PP(jpeg_file)); - RETURN_FALSE; - } - - len = Z_STRLEN_PP(iptcdata); - - if (spool < 2) { - fstat(fileno(fp), &sb); - - poi = spoolbuf = emalloc(len + sizeof(psheader) + sb.st_size + 1024); - } - - if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) { - fclose(fp); - RETURN_FALSE; - } - - if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) { - fclose(fp); - RETURN_FALSE; - } - - while (!done) { - marker = php_iptc_next_marker(fp, spool, poi?&poi:0 TSRMLS_CC); - - if (marker == M_EOI) { /* EOF */ - break; - } else if (marker != M_APP13) { - php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0 TSRMLS_CC); - } - - switch (marker) { - case M_APP13: - /* we are going to write a new APP13 marker, so don't output the old one */ - php_iptc_skip_variable(fp, 0, 0 TSRMLS_CC); - php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC); - done = 1; - break; - - case M_APP0: - /* APP0 is in each and every JPEG, so when we hit APP0 we insert our new APP13! */ - php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC); - - if (len & 1) len++; /* make the length even */ - - psheader[ 2 ] = (len+28)>>8; - psheader[ 3 ] = (len+28)&0xff; - - for (inx = 0; inx < 28; inx++) - php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0 TSRMLS_CC); - - php_iptc_put1(fp, spool, (unsigned char)(len>>8), poi?&poi:0 TSRMLS_CC); - php_iptc_put1(fp, spool, (unsigned char)(len&0xff), poi?&poi:0 TSRMLS_CC); - - for (inx = 0; inx < len; inx++) - php_iptc_put1(fp, spool, Z_STRVAL_PP(iptcdata)[inx], poi?&poi:0 TSRMLS_CC); - break; - - case M_SOS: - /* we hit data, no more marker-inserting can be done! */ - php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC); - done = 1; - break; - - default: - php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC); - break; - } - } - - fclose(fp); - - if (spool < 2) { - RETVAL_STRINGL(spoolbuf, poi - spoolbuf, 0); - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array iptcparse(string iptcdata) - Parse binary IPTC-data into associative array */ -PHP_FUNCTION(iptcparse) -{ - unsigned int length, inx, len, tagsfound; - unsigned char *buffer; - unsigned char recnum, dataset; - unsigned char key[ 16 ]; - zval *values, **str, **element; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(str); - - inx = 0; - length = Z_STRLEN_PP(str); - buffer = Z_STRVAL_PP(str); - - tagsfound = 0; /* number of tags already found */ - - while (inx < length) { /* find 1st tag */ - if ((buffer[inx] == 0x1c) && ((buffer[inx+1] == 0x01) || (buffer[inx+1] == 0x02))){ - break; - } else { - inx++; - } - } - - while (inx < length) { - if (buffer[ inx++ ] != 0x1c) { - break; /* we ran against some data which does not conform to IPTC - stop parsing! */ - } - - if ((inx + 4) >= length) - break; - - dataset = buffer[ inx++ ]; - recnum = buffer[ inx++ ]; - - if (buffer[ inx ] & (unsigned char) 0x80) { /* long tag */ - len = (((long) buffer[ inx + 2 ]) << 24) + (((long) buffer[ inx + 3 ]) << 16) + - (((long) buffer[ inx + 4 ]) << 8) + (((long) buffer[ inx + 5 ])); - inx += 6; - } else { /* short tag */ - len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ]; - inx += 2; - } - - snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum); - - if ((len > length) || (inx + len) > length) - break; - - if (tagsfound == 0) { /* found the 1st tag - initialize the return array */ - array_init(return_value); - } - - if (zend_hash_find(Z_ARRVAL_P(return_value), key, strlen(key) + 1, (void **) &element) == FAILURE) { - ALLOC_ZVAL(values); - INIT_PZVAL(values); - array_init(values); - - zend_hash_update(Z_ARRVAL_P(return_value), key, strlen(key)+1, (void *) &values, sizeof(pval*), (void **) &element); - } - - add_next_index_stringl(*element, buffer+inx, len, 1); - - inx += len; - - tagsfound++; - } - - if (! tagsfound) { - RETURN_FALSE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c deleted file mode 100644 index f16057da30c2e..0000000000000 --- a/ext/standard/lcg.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_lcg.h" - -#if HAVE_UNISTD_H -#include -#endif - -#ifdef PHP_WIN32 -#include "win32/time.h" -#else -#include -#endif - -#ifdef ZTS -int lcg_globals_id; -#else -static php_lcg_globals lcg_globals; -#endif - - -#ifdef PHP_WIN32 -#include -#endif - -/* - * combinedLCG() returns a pseudo random number in the range of (0, 1). - * The function combines two CGs with periods of - * 2^31 - 85 and 2^31 - 249. The period of this function - * is equal to the product of both primes. - */ - -#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m - -static void lcg_seed(TSRMLS_D); - -PHPAPI double php_combined_lcg(TSRMLS_D) -{ - php_int32 q; - php_int32 z; - - if (!LCG(seeded)) { - lcg_seed(TSRMLS_C); - } - - MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1)); - MODMULT(52774, 40692, 3791, 2147483399L, LCG(s2)); - - z = LCG(s1) - LCG(s2); - if (z < 1) { - z += 2147483562; - } - - return z * 4.656613e-10; -} - -static void lcg_seed(TSRMLS_D) -{ - struct timeval tv; - - if (gettimeofday(&tv, NULL) == 0) { - LCG(s1) = tv.tv_sec ^ (~tv.tv_usec); - } else { - LCG(s1) = 1; - } -#ifdef ZTS - LCG(s2) = (long) tsrm_thread_id(); -#else - LCG(s2) = (long) getpid(); -#endif - - LCG(seeded) = 1; -} - -static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) -{ - LCG(seeded) = 0; -} - -PHP_MINIT_FUNCTION(lcg) -{ -#ifdef ZTS - ts_allocate_id(&lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL); -#else - lcg_init_globals(&lcg_globals); -#endif - return SUCCESS; -} - -PHP_RINIT_FUNCTION(lcg) -{ - if (!LCG(seeded)) { - lcg_seed(TSRMLS_C); - } - return SUCCESS; -} - -/* {{{ proto float lcg_value() - Returns a value from the combined linear congruential generator */ -PHP_FUNCTION(lcg_value) -{ - RETURN_DOUBLE(php_combined_lcg(TSRMLS_C)); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c deleted file mode 100644 index 08213516c1b08..0000000000000 --- a/ext/standard/levenshtein.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" -#include -#include -#include -#include "php_string.h" - -#define LEVENSHTEIN_MAX_LENTH 255 - -/* {{{ reference_levdist - * reference implementation, only optimized for memory usage, not speed */ -static int reference_levdist(void *s1, int32_t l1, void *s2, int32_t l2, zend_uchar str_type, int cost_ins, int cost_rep, int cost_del ) -{ - int *p1, *p2, *tmp; - int32_t i1, i2, j1, j2, cp1, cp2; - int32_t c0, c1, c2; - UChar32 ch1, ch2; - - if (str_type == IS_UNICODE) { - cp1 = u_countChar32((UChar *)s1, l1); - cp2 = u_countChar32((UChar *)s2, l2); - - if (cp1 == 0) return cp2*cost_ins; - if (cp2 == 0) return cp1*cost_del; - if ((cp1>LEVENSHTEIN_MAX_LENTH)||(cp2>LEVENSHTEIN_MAX_LENTH)) { - return -1; - } - - p1 = safe_emalloc((cp2+1), sizeof(int), 0); - p2 = safe_emalloc((cp2+1), sizeof(int), 0); - } else { - if (l1 == 0) return l2*cost_ins; - if (l2 == 0) return l1*cost_del; - if ((l1>LEVENSHTEIN_MAX_LENTH)||(l2>LEVENSHTEIN_MAX_LENTH)) { - return -1; - } - - p1 = safe_emalloc((l2+1), sizeof(int), 0); - p2 = safe_emalloc((l2+1), sizeof(int), 0); - } - - for (i2 = 0 ; i2 <= l2 ; i2++) - p1[i2] = i2*cost_ins; - - for (i1 = 0, j1 = 0 ; i1 < l1 ; i1++) { - p2[0] = p1[0] + cost_del; - if (str_type == IS_UNICODE) { - U16_NEXT((UChar *)s1, j1, l1, ch1); - } - for (i2 = 0, j2 = 0 ; i2 < l2 ; i2++) { - if (str_type == IS_UNICODE) { - U16_NEXT((UChar *)s2, j2, l2, ch2); - c0 = p1[i2] + ((ch1==ch2) ? 0 : cost_rep); - } else { - c0 = p1[i2] + ((*((char *)s1+i1)==*((char *)s2+i2)) ? 0 : cost_rep); - } - c1 = p1[i2+1] + cost_del; if (c1 < c0) c0 = c1; - c2 = p2[i2] + cost_ins; if (c2 < c0) c0 = c2; - p2[i2+1] = c0; - } - tmp=p1; p1=p2; p2=tmp; - } - c0 = p1[l2]; - - efree(p1); - efree(p2); - - return c0; -} -/* }}} */ - -/* {{{ custom_levdist - */ -static int custom_levdist(void *str1, void *str2, char *callback_name TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet"); - /* not there yet */ - - return -1; -} -/* }}} */ - -/* {{{ proto int levenshtein(string str1, string str2) - Calculate Levenshtein distance between two strings */ -PHP_FUNCTION(levenshtein) -{ - int argc = ZEND_NUM_ARGS(); - void *str1, *str2; - int32_t str1_len, str2_len; - zend_uchar str1_type, str2_type; - int cost_ins, cost_rep, cost_del; - char *callback_name; - int distance = -1; - - switch (argc) { - case 2: /* just two string: use maximum performance version */ - if (zend_parse_parameters(2 TSRMLS_CC, "TT", - &str1, &str1_len, &str1_type, - &str2, &str2_len, &str2_type) == FAILURE) { - return; - } - - distance = reference_levdist(str1, str1_len, str2, str2_len, str1_type, 1, 1, 1); - break; - - case 5: /* more general version: calc cost by ins/rep/del weights */ - if (zend_parse_parameters(5 TSRMLS_CC, "TTlll", - &str1, &str1_len, &str1_type, - &str2, &str2_len, &str2_type, - &cost_ins, &cost_rep, &cost_del) == FAILURE) { - return; - } - - distance = reference_levdist(str1, str1_len, str2, str2_len, str1_type, cost_ins, cost_rep, cost_del); - break; - - case 3: /* most general version: calc cost by user-supplied function */ - if (zend_parse_parameters(3 TSRMLS_CC, "TTs", - &str1, &str1_len, &str1_type, - &str2, &str2_len, &str2_type, - &callback_name) == FAILURE) { - return; - } - distance = custom_levdist(str1, str2, callback_name TSRMLS_CC); - break; - - default: - WRONG_PARAM_COUNT; - } - - if (distance < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument string(s) too long"); - } - - RETURN_LONG(distance); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/link.c b/ext/standard/link.c deleted file mode 100644 index c790372f09657..0000000000000 --- a/ext/standard/link.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_filestat.h" -#include "php_globals.h" - -#ifdef HAVE_SYMLINK - -#include -#if HAVE_UNISTD_H -#include -#endif -#include -#include -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif -#if HAVE_GRP_H -#ifdef PHP_WIN32 -#include "win32/grp.h" -#else -#include -#endif -#endif -#include -#include - -#include "safe_mode.h" -#include "php_link.h" - -/* {{{ proto string readlink(string filename) - Return the target of a symbolic link */ -PHP_FUNCTION(readlink) -{ - zval **filename; - char buff[MAXPATHLEN]; - int ret; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) { - RETURN_FALSE; - } - - ret = readlink(Z_STRVAL_PP(filename), buff, MAXPATHLEN-1); - - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - RETURN_FALSE; - } - /* Append NULL to the end of the string */ - buff[ret] = '\0'; - - RETURN_RT_STRING(buff, 1); -} -/* }}} */ - -/* {{{ proto int linkinfo(string filename) - Returns the st_dev field of the UNIX C stat structure describing the link */ -PHP_FUNCTION(linkinfo) -{ - zval **filename; - struct stat sb; - int ret; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - ret = VCWD_LSTAT(Z_STRVAL_PP(filename), &sb); - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - RETURN_LONG(-1L); - } - - RETURN_LONG((long) sb.st_dev); -} -/* }}} */ - -/* {{{ proto int symlink(string target, string link) - Create a symbolic link */ -PHP_FUNCTION(symlink) -{ - zval **topath, **frompath; - int ret; - char source_p[MAXPATHLEN]; - char dest_p[MAXPATHLEN]; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &topath, &frompath) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(topath); - convert_to_string_ex(frompath); - - expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC); - expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC); - - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL"); - RETURN_FALSE; - } - - if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - RETURN_FALSE; - } - - if (PG(safe_mode) && !php_checkuid(source_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - RETURN_FALSE; - } - - if (php_check_open_basedir(dest_p TSRMLS_CC)) { - RETURN_FALSE; - } - - if (php_check_open_basedir(source_p TSRMLS_CC)) { - RETURN_FALSE; - } - -#ifndef ZTS - ret = symlink(Z_STRVAL_PP(topath), Z_STRVAL_PP(frompath)); -#else - ret = symlink(dest_p, source_p); -#endif - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int link(string target, string link) - Create a hard link */ -PHP_FUNCTION(link) -{ - zval **topath, **frompath; - int ret; - char source_p[MAXPATHLEN]; - char dest_p[MAXPATHLEN]; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &topath, &frompath) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(topath); - convert_to_string_ex(frompath); - - expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC); - expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC); - - if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL"); - RETURN_FALSE; - } - - if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - RETURN_FALSE; - } - - if (PG(safe_mode) && !php_checkuid(source_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - RETURN_FALSE; - } - - if (php_check_open_basedir(dest_p TSRMLS_CC)) { - RETURN_FALSE; - } - - if (php_check_open_basedir(source_p TSRMLS_CC)) { - RETURN_FALSE; - } - -#ifndef ZTS - ret = link(Z_STRVAL_PP(topath), Z_STRVAL_PP(frompath)); -#else - ret = link(dest_p, source_p); -#endif - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/mail.c b/ext/standard/mail.c deleted file mode 100644 index d60c5bb3db557..0000000000000 --- a/ext/standard/mail.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#include "php.h" -#include "ext/standard/info.h" - -#if HAVE_SYSEXITS_H -#include -#endif -#if HAVE_SYS_SYSEXITS_H -#include -#endif - -#include "php_mail.h" -#include "php_ini.h" -#include "safe_mode.h" -#include "exec.h" - -#if HAVE_SENDMAIL -#ifdef PHP_WIN32 -#include "win32/sendmail.h" -#endif - -#ifdef NETWARE -#define EX_OK 0 /* successful termination */ -#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ -#endif - -#define SKIP_LONG_HEADER_SEP(str, pos) \ - if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \ - pos += 3; \ - while (str[pos] == ' ' || str[pos] == '\t') { \ - pos++; \ - } \ - continue; \ - } \ - -/* {{{ proto int ezmlm_hash(string addr) - Calculate EZMLM list hash value. */ -PHP_FUNCTION(ezmlm_hash) -{ - char *str = NULL; - unsigned long h = 5381L; - int j, str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &str, &str_len) == FAILURE) { - return; - } - - for (j = 0; j < str_len; j++) { - h = (h + (h << 5)) ^ (unsigned long) (unsigned char) tolower(str[j]); - } - - h = (h % 53); - - RETURN_LONG((int) h); -} -/* }}} */ - -/* {{{ proto int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) - Send an email message */ -PHP_FUNCTION(mail) -{ - char *to=NULL, *message=NULL, *headers=NULL; - char *subject=NULL, *extra_cmd=NULL; - int to_len, message_len, headers_len; - int subject_len, extra_cmd_len, i; - char *force_extra_parameters = INI_STR("mail.force_extra_parameters"); - char *to_r, *subject_r; - - if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE."); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", - &to, &to_len, - &subject, &subject_len, - &message, &message_len, - &headers, &headers_len, - &extra_cmd, &extra_cmd_len - ) == FAILURE) { - return; - } - - if (to_len > 0) { - to_r = estrndup(to, to_len); - for (; to_len; to_len--) { - if (!isspace((unsigned char) to_r[to_len - 1])) { - break; - } - to_r[to_len - 1] = '\0'; - } - for (i = 0; to_r[i]; i++) { - if (iscntrl((unsigned char) to_r[i])) { - /* According to RFC 822, section 3.1.1 long headers may be separated into - * parts using CRLF followed at least one linear-white-space character ('\t' or ' '). - * To prevent these separators from being replaced with a space, we use the - * SKIP_LONG_HEADER_SEP to skip over them. - */ - SKIP_LONG_HEADER_SEP(to_r, i); - to_r[i] = ' '; - } - } - } else { - to_r = to; - } - - if (subject_len > 0) { - subject_r = estrndup(subject, subject_len); - for (; subject_len; subject_len--) { - if (!isspace((unsigned char) subject_r[subject_len - 1])) { - break; - } - subject_r[subject_len - 1] = '\0'; - } - for(i = 0; subject_r[i]; i++) { - if (iscntrl((unsigned char) subject_r[i])) { - SKIP_LONG_HEADER_SEP(subject_r, i); - subject_r[i] = ' '; - } - } - } else { - subject_r = subject; - } - - if (force_extra_parameters) { - extra_cmd = estrdup(force_extra_parameters); - } else if (extra_cmd) { - extra_cmd = php_escape_shell_cmd(extra_cmd); - } - - if (php_mail(to_r, subject_r, message, headers, extra_cmd TSRMLS_CC)) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } - - if (extra_cmd) { - efree (extra_cmd); - } - if (to_r != to) { - efree(to_r); - } - if (subject_r != subject) { - efree(subject_r); - } -} -/* }}} */ - -/* {{{ php_mail - */ -PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) -{ -#if (defined PHP_WIN32 || defined NETWARE) - int tsm_err; - char *tsm_errmsg = NULL; -#endif - FILE *sendmail; - int ret; - char *sendmail_path = INI_STR("sendmail_path"); - char *sendmail_cmd = NULL; - - if (!sendmail_path) { -#if (defined PHP_WIN32 || defined NETWARE) - /* handle old style win smtp sending */ - if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) { - if (tsm_errmsg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg); - efree(tsm_errmsg); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err)); - } - return 0; - } - return 1; -#else - return 0; -#endif - } - if (extra_cmd != NULL) { - sendmail_cmd = emalloc (strlen (sendmail_path) + strlen (extra_cmd) + 2); - strcpy (sendmail_cmd, sendmail_path); - strcat (sendmail_cmd, " "); - strcat (sendmail_cmd, extra_cmd); - } else { - sendmail_cmd = sendmail_path; - } - -#ifdef PHP_WIN32 - sendmail = popen(sendmail_cmd, "wb"); -#else - /* Since popen() doesn't indicate if the internal fork() doesn't work - * (e.g. the shell can't be executed) we explicitely set it to 0 to be - * sure we don't catch any older errno value. */ - errno = 0; - sendmail = popen(sendmail_cmd, "w"); -#endif - if (extra_cmd != NULL) - efree (sendmail_cmd); - - if (sendmail) { -#ifndef PHP_WIN32 - if (EACCES == errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path); - pclose(sendmail); - return 0; - } -#endif - fprintf(sendmail, "To: %s\n", to); - fprintf(sendmail, "Subject: %s\n", subject); - if (headers != NULL) { - fprintf(sendmail, "%s\n", headers); - } - fprintf(sendmail, "\n%s\n", message); - ret = pclose(sendmail); -#ifdef PHP_WIN32 - if (ret == -1) -#else -#if defined(EX_TEMPFAIL) - if ((ret != EX_OK)&&(ret != EX_TEMPFAIL)) -#elif defined(EX_OK) - if (ret != EX_OK) -#else - if (ret != 0) -#endif -#endif - { - return 0; - } else { - return 1; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); - return 0; - } - - return 1; /* never reached */ -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(mail) -{ - char *sendmail_path = INI_STR("sendmail_path"); - -#ifdef PHP_WIN32 - if (!sendmail_path) { - php_info_print_table_row(2, "Internal Sendmail Support for Windows", "enabled"); - } else { - php_info_print_table_row(2, "Path to sendmail", sendmail_path); - } -#else - php_info_print_table_row(2, "Path to sendmail", sendmail_path); -#endif -} -/* }}} */ - -#else - -PHP_FUNCTION(mail) {} -PHP_MINFO_FUNCTION(mail) {} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/math.c b/ext/standard/math.c deleted file mode 100644 index e9c421c5329f1..0000000000000 --- a/ext/standard/math.c +++ /dev/null @@ -1,1149 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - | Stig Sĉther Bakken | - | Zeev Suraski | - | PHP 4.0 patches by Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_math.h" -#include "zend_multiply.h" - -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#ifndef PHP_ROUND_FUZZ -# ifndef PHP_WIN32 -# define PHP_ROUND_FUZZ 0.50000000001 -# else -# define PHP_ROUND_FUZZ 0.5 -# endif -#endif - -#define PHP_ROUND_WITH_FUZZ(val, places) { \ - double tmp_val=val, f = pow(10.0, (double) places); \ - tmp_val *= f; \ - if (tmp_val >= 0.0) { \ - tmp_val = floor(tmp_val + PHP_ROUND_FUZZ); \ - } else { \ - tmp_val = ceil(tmp_val - PHP_ROUND_FUZZ); \ - } \ - tmp_val /= f; \ - val = !zend_isnan(tmp_val) ? tmp_val : val; \ -} \ - -/* {{{ proto int abs(int number) - Return the absolute value of the number */ -PHP_FUNCTION(abs) -{ - zval **value; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_scalar_to_number_ex(value); - - if (Z_TYPE_PP(value) == IS_DOUBLE) { - RETURN_DOUBLE(fabs(Z_DVAL_PP(value))); - } else if (Z_TYPE_PP(value) == IS_LONG) { - if (Z_LVAL_PP(value) == LONG_MIN) { - RETURN_DOUBLE(-(double)LONG_MIN); - } else { - RETURN_LONG(Z_LVAL_PP(value) < 0 ? -Z_LVAL_PP(value) : Z_LVAL_PP(value)); - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto float ceil(float number) - Returns the next highest integer value of the number */ -PHP_FUNCTION(ceil) -{ - zval **value; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_scalar_to_number_ex(value); - - if (Z_TYPE_PP(value) == IS_DOUBLE) { - RETURN_DOUBLE(ceil(Z_DVAL_PP(value))); - } else if (Z_TYPE_PP(value) == IS_LONG) { - convert_to_double_ex(value); - RETURN_DOUBLE(Z_DVAL_PP(value)); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto float floor(float number) - Returns the next lowest integer value from the number */ -PHP_FUNCTION(floor) -{ - zval **value; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_scalar_to_number_ex(value); - - if (Z_TYPE_PP(value) == IS_DOUBLE) { - RETURN_DOUBLE(floor(Z_DVAL_PP(value))); - } else if (Z_TYPE_PP(value) == IS_LONG) { - convert_to_double_ex(value); - RETURN_DOUBLE(Z_DVAL_PP(value)); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto float round(float number [, int precision]) - Returns the number rounded to specified precision */ -PHP_FUNCTION(round) -{ - zval **value, **precision; - int places = 0; - double return_val; - - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 2 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &value, &precision) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (ZEND_NUM_ARGS() == 2) { - convert_to_long_ex(precision); - places = (int) Z_LVAL_PP(precision); - } - - convert_scalar_to_number_ex(value); - - switch (Z_TYPE_PP(value)) { - case IS_LONG: - /* Simple case - long that doesn't need to be rounded. */ - if (places >= 0) { - RETURN_DOUBLE((double) Z_LVAL_PP(value)); - } - /* break omitted intentionally */ - - case IS_DOUBLE: - return_val = (Z_TYPE_PP(value) == IS_LONG) ? - (double)Z_LVAL_PP(value) : Z_DVAL_PP(value); - - PHP_ROUND_WITH_FUZZ(return_val, places); - - RETURN_DOUBLE(return_val); - break; - - default: - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto float sin(float number) - Returns the sine of the number in radians */ -PHP_FUNCTION(sin) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = sin(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float cos(float number) - Returns the cosine of the number in radians */ -PHP_FUNCTION(cos) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = cos(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float tan(float number) - Returns the tangent of the number in radians */ -PHP_FUNCTION(tan) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = tan(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float asin(float number) - Returns the arc sine of the number in radians */ -PHP_FUNCTION(asin) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = asin(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float acos(float number) - Return the arc cosine of the number in radians */ -PHP_FUNCTION(acos) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = acos(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float atan(float number) - Returns the arc tangent of the number in radians */ -PHP_FUNCTION(atan) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = atan(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float atan2(float y, float x) - Returns the arc tangent of y/x, with the resulting quadrant determined by the signs of y and x */ -PHP_FUNCTION(atan2) -{ - zval **num1, **num2; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num1); - convert_to_double_ex(num2); - Z_DVAL_P(return_value) = atan2(Z_DVAL_PP(num1), Z_DVAL_PP(num2)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float sinh(float number) - Returns the hyperbolic sine of the number, defined as (exp(number) - exp(-number))/2 */ -PHP_FUNCTION(sinh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = sinh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float cosh(float number) - Returns the hyperbolic cosine of the number, defined as (exp(number) + exp(-number))/2 */ -PHP_FUNCTION(cosh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = cosh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float tanh(float number) - Returns the hyperbolic tangent of the number, defined as sinh(number)/cosh(number) */ -PHP_FUNCTION(tanh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = tanh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -#if !defined(PHP_WIN32) && !defined(NETWARE) -#ifdef HAVE_ASINH -/* {{{ proto float asinh(float number) - Returns the inverse hyperbolic sine of the number, i.e. the value whose hyperbolic sine is number */ -PHP_FUNCTION(asinh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = asinh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ -#endif /* HAVE_ASINH */ - -#ifdef HAVE_ACOSH -/* {{{ proto float acosh(float number) - Returns the inverse hyperbolic cosine of the number, i.e. the value whose hyperbolic cosine is number */ -PHP_FUNCTION(acosh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = acosh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ -#endif /* HAVE_ACOSH */ - -#ifdef HAVE_ATANH -/* {{{ proto float atanh(float number) - Returns the inverse hyperbolic tangent of the number, i.e. the value whose hyperbolic tangent is number */ -PHP_FUNCTION(atanh) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = atanh(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ -#endif /* HAVE_ATANH */ -#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */ - -/* {{{ proto float pi(void) - Returns an approximation of pi */ -PHP_FUNCTION(pi) -{ - Z_DVAL_P(return_value) = M_PI; - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto bool is_finite(float val) - Returns whether argument is finite */ -PHP_FUNCTION(is_finite) -{ - double dval; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { - return; - } - RETURN_BOOL(zend_finite(dval)); -} -/* }}} */ - -/* {{{ proto bool is_infinite(float val) - Returns whether argument is infinite */ -PHP_FUNCTION(is_infinite) -{ - double dval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { - return; - } - RETURN_BOOL(zend_isinf(dval)); -} -/* }}} */ - -/* {{{ proto bool is_nan(float val) - Returns whether argument is not a number */ -PHP_FUNCTION(is_nan) -{ - double dval; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) { - return; - } - RETURN_BOOL(zend_isnan(dval)); -} -/* }}} */ - -/* {{{ proto number pow(number base, number exponent) - Returns base raised to the power of exponent. Returns integer result when possible */ -PHP_FUNCTION(pow) -{ - zval *zbase, *zexp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &zbase, &zexp) == FAILURE) { - return; - } - - /* make sure we're dealing with numbers */ - convert_scalar_to_number(zbase TSRMLS_CC); - convert_scalar_to_number(zexp TSRMLS_CC); - - /* if both base and exponent were longs, we'll try to get a long out */ - if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) >= 0) { - long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp); - - if (i == 0) { - RETURN_LONG(1L); - } else if (l2 == 0) { - RETURN_LONG(0); - } - - /* calculate pow(long,long) in O(log exp) operations, bail if overflow */ - while (i >= 1) { - int overflow; - double dval; - - if (i % 2) { - --i; - ZEND_SIGNED_MULTIPLY_LONG(l1,l2,l1,dval,overflow); - if (overflow) RETURN_DOUBLE(dval * pow(l2,i)); - } else { - i /= 2; - ZEND_SIGNED_MULTIPLY_LONG(l2,l2,l2,dval,overflow); - if (overflow) RETURN_DOUBLE((double)l1 * pow(dval,i)); - } - if (i == 0) { - RETURN_LONG(l1); - } - } - } - convert_to_double(zbase); - convert_to_double(zexp); - - RETURN_DOUBLE( pow(Z_DVAL_P(zbase),Z_DVAL_P(zexp)) ); -} -/* }}} */ - -/* {{{ proto float exp(float number) - Returns e raised to the power of the number */ -PHP_FUNCTION(exp) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = exp(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -#if !defined(PHP_WIN32) && !defined(NETWARE) -/* {{{ proto float expm1(float number) - Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero */ -/* - WARNING: this function is expermental: it could change its name or - disappear in the next version of PHP! -*/ -PHP_FUNCTION(expm1) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = expm1(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -#ifdef HAVE_LOG1P -/* {{{ proto float log1p(float number) - Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero */ -/* - WARNING: this function is expermental: it could change its name or - disappear in the next version of PHP! -*/ -PHP_FUNCTION(log1p) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = log1p(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ -#endif /* HAVE_LOG1P */ -#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */ - -/* {{{ proto float log(float number, [float base]) - Returns the natural logarithm of the number, or the base log if base is specified */ -PHP_FUNCTION(log) -{ - zval **num, **base; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - RETURN_DOUBLE(log(Z_DVAL_PP(num))); - case 2: - if (zend_get_parameters_ex(2, &num, &base) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - convert_to_double_ex(base); - - if (Z_DVAL_PP(base) <= 0.0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0"); - RETURN_FALSE; - } - RETURN_DOUBLE(log(Z_DVAL_PP(num)) / log(Z_DVAL_PP(base))); - default: - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -/* {{{ proto float log10(float number) - Returns the base-10 logarithm of the number */ -PHP_FUNCTION(log10) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = log10(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float sqrt(float number) - Returns the square root of the number */ -PHP_FUNCTION(sqrt) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num); - Z_DVAL_P(return_value) = sqrt(Z_DVAL_PP(num)); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float hypot(float num1, float num2) - Returns sqrt(num1*num1 + num2*num2) */ -PHP_FUNCTION(hypot) -{ - zval **num1, **num2; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(num1); - convert_to_double_ex(num2); -#if HAVE_HYPOT - Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2)); -#elif defined(_MSC_VER) - Z_DVAL_P(return_value) = _hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2)); -#else - Z_DVAL_P(return_value) = sqrt((Z_DVAL_PP(num1) * Z_DVAL_PP(num1)) + - (Z_DVAL_PP(num2) * Z_DVAL_PP(num2))); -#endif - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - -/* {{{ proto float deg2rad(float number) - Converts the number in degrees to the radian equivalent */ -PHP_FUNCTION(deg2rad) -{ - zval **deg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(deg); - RETVAL_DOUBLE((Z_DVAL_PP(deg) / 180.0) * M_PI); -} -/* }}} */ - -/* {{{ proto float rad2deg(float number) - Converts the radian number to the equivalent number in degrees */ -PHP_FUNCTION(rad2deg) -{ - zval **rad; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &rad) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_double_ex(rad); - RETVAL_DOUBLE((Z_DVAL_PP(rad) / M_PI) * 180); -} -/* }}} */ - -/* {{{ _php_math_basetolong */ -/* - * Convert a string representation of a base(2-36) number to a long. - */ -PHPAPI long _php_math_basetolong(zval *arg, int base) -{ - long num = 0, digit, onum; - int i; - char c, *s; - - if (Z_TYPE_P(arg) != IS_STRING || base < 2 || base > 36) { - return 0; - } - - s = Z_STRVAL_P(arg); - - for (i = Z_STRLEN_P(arg); i > 0; i--) { - c = *s++; - - digit = (c >= '0' && c <= '9') ? c - '0' - : (c >= 'A' && c <= 'Z') ? c - 'A' + 10 - : (c >= 'a' && c <= 'z') ? c - 'a' + 10 - : base; - - if (digit >= base) { - continue; - } - - onum = num; - num = num * base + digit; - if (num > onum) - continue; - - { - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is too big to fit in long", s); - return LONG_MAX; - } - } - - return num; -} -/* }}} */ - -/* {{{ _php_math_basetozval */ -/* - * Convert a string representation of a base(2-36) number to a zval. - */ -PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) -{ - long num = 0; - double fnum = 0; - int i; - int mode = 0; - char c, *s; - long cutoff; - int cutlim; - - if (Z_TYPE_P(arg) != IS_STRING || base < 2 || base > 36) { - return FAILURE; - } - - s = Z_STRVAL_P(arg); - - cutoff = LONG_MAX / base; - cutlim = LONG_MAX % base; - - for (i = Z_STRLEN_P(arg); i > 0; i--) { - c = *s++; - - /* might not work for EBCDIC */ - if (c >= '0' && c <= '9') - c -= '0'; - else if (c >= 'A' && c <= 'Z') - c -= 'A' - 10; - else if (c >= 'a' && c <= 'z') - c -= 'a' - 10; - else - continue; - - if (c >= base) - continue; - - switch (mode) { - case 0: /* Integer */ - if (num < cutoff || (num == cutoff && c <= cutlim)) { - num = num * base + c; - break; - } else { - fnum = num; - mode = 1; - } - /* fall-through */ - case 1: /* Float */ - fnum = fnum * base + c; - } - } - - if (mode == 1) { - ZVAL_DOUBLE(ret, fnum); - } else { - ZVAL_LONG(ret, num); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ _php_math_longtobase */ -/* - * Convert a long to a string containing a base(2-36) representation of - * the number. - */ -PHPAPI char * _php_math_longtobase(zval *arg, int base) -{ - static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; - char buf[(sizeof(unsigned long) << 3) + 1]; - char *ptr, *end; - unsigned long value; - - if (Z_TYPE_P(arg) != IS_LONG || base < 2 || base > 36) { - return STR_EMPTY_ALLOC(); - } - - value = Z_LVAL_P(arg); - - end = ptr = buf + sizeof(buf) - 1; - *ptr = '\0'; - - do { - *--ptr = digits[value % base]; - value /= base; - } while (ptr > buf && value); - - return estrndup(ptr, end - ptr); -} -/* }}} */ - -/* {{{ _php_math_zvaltobase */ -/* - * Convert a zval to a string containing a base(2-36) representation of - * the number. - */ -PHPAPI char * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC) -{ - static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; - - if ((Z_TYPE_P(arg) != IS_LONG && Z_TYPE_P(arg) != IS_DOUBLE) || base < 2 || base > 36) { - return STR_EMPTY_ALLOC(); - } - - if (Z_TYPE_P(arg) == IS_DOUBLE) { - double fvalue = floor(Z_DVAL_P(arg)); /* floor it just in case */ - char *ptr, *end; - char buf[(sizeof(double) << 3) + 1]; - - /* Don't try to convert +/- infinity */ - if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large"); - return STR_EMPTY_ALLOC(); - } - - end = ptr = buf + sizeof(buf) - 1; - *ptr = '\0'; - - do { - *--ptr = digits[(int) fmod(fvalue, base)]; - fvalue /= base; - } while (ptr > buf && fabs(fvalue) >= 1); - - return estrndup(ptr, end - ptr); - } - - return _php_math_longtobase(arg, base); -} -/* }}} */ - -/* {{{ proto int bindec(string binary_number) - Returns the decimal equivalent of the binary number */ -PHP_FUNCTION(bindec) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - if(_php_math_basetozval(*arg, 2, return_value) != SUCCESS) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int hexdec(string hexadecimal_number) - Returns the decimal equivalent of the hexadecimal number */ -PHP_FUNCTION(hexdec) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - - if(_php_math_basetozval(*arg, 16, return_value) != SUCCESS) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int octdec(string octal_number) - Returns the decimal equivalent of an octal string */ -PHP_FUNCTION(octdec) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - - if(_php_math_basetozval(*arg, 8, return_value) != SUCCESS) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string decbin(int decimal_number) - Returns a string containing a binary representation of the number */ -PHP_FUNCTION(decbin) -{ - zval **arg; - char *result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg); - - result = _php_math_longtobase(*arg, 2); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; -} -/* }}} */ - -/* {{{ proto string decoct(int decimal_number) - Returns a string containing an octal representation of the given number */ -PHP_FUNCTION(decoct) -{ - zval **arg; - char *result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg); - - result = _php_math_longtobase(*arg, 8); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; -} -/* }}} */ - -/* {{{ proto string dechex(int decimal_number) - Returns a string containing a hexadecimal representation of the given number */ -PHP_FUNCTION(dechex) -{ - zval **arg; - char *result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg); - - result = _php_math_longtobase(*arg, 16); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; -} -/* }}} */ - -/* {{{ proto string base_convert(string number, int frombase, int tobase) - Converts a number in a string from any base <= 36 to any base <= 36 */ -PHP_FUNCTION(base_convert) -{ - zval **number, **frombase, **tobase, temp; - char *result; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &number, &frombase, &tobase) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(number); - convert_to_long_ex(frombase); - convert_to_long_ex(tobase); - if (Z_LVAL_PP(frombase) < 2 || Z_LVAL_PP(frombase) > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%ld)", Z_LVAL_PP(frombase)); - RETURN_FALSE; - } - if (Z_LVAL_PP(tobase) < 2 || Z_LVAL_PP(tobase) > 36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%ld)", Z_LVAL_PP(tobase)); - RETURN_FALSE; - } - - if(_php_math_basetozval(*number, Z_LVAL_PP(frombase), &temp) != SUCCESS) { - RETURN_FALSE; - } - result = _php_math_zvaltobase(&temp, Z_LVAL_PP(tobase) TSRMLS_CC); - RETVAL_STRING(result, 0); -} -/* }}} */ - -/* {{{ _php_math_number_format -*/ -PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep) -{ - char *tmpbuf = NULL, *resbuf; - char *s, *t; /* source, target */ - char *dp; - int integral; - int tmplen, reslen=0; - int count=0; - int is_negative=0; - - if (d < 0) { - is_negative = 1; - d = -d; - } - if (!dec_point && dec > 0) { - d *= pow(10, dec); - dec = 0; - } else { - dec = MAX(0, dec); - } - - PHP_ROUND_WITH_FUZZ(d, dec); - - tmplen = spprintf(&tmpbuf, 0, "%.*f", dec, d); - - if (tmpbuf == NULL || !isdigit((int)tmpbuf[0])) { - return tmpbuf; - } - - /* calculate the length of the return buffer */ - dp = strchr(tmpbuf, '.'); - if (dp) { - integral = dp - tmpbuf; - } else { - /* no decimal point was found */ - integral = tmplen; - } - - /* allow for thousand separators */ - if (thousand_sep) { - integral += (integral-1) / 3; - } - - reslen = integral; - - if (dec) { - reslen += 1 + dec; - } - - /* add a byte for minus sign */ - if (is_negative) { - reslen++; - } - resbuf = (char *) emalloc(reslen+1); /* +1 for NUL terminator */ - - s = tmpbuf+tmplen-1; - t = resbuf+reslen; - *t-- = '\0'; - - /* copy the decimal places. - * Take care, as the sprintf implementation may return less places than - * we requested due to internal buffer limitations */ - if (dec) { - int declen = dp ? strlen(dp+1) : 0; - int topad = declen > 0 ? dec - declen : 0; - - /* pad with '0's */ - - while (topad--) { - *t-- = '0'; - } - - if (dp) { - /* now copy the chars after the point */ - memcpy(t - declen + 1, dp + 1, declen); - - t -= declen; - s -= declen; - } - - /* add decimal point */ - *t-- = dec_point; - s--; - } - - /* copy the numbers before the decimal place, adding thousand - * separator every three digits */ - while(s >= tmpbuf) { - *t-- = *s--; - if (thousand_sep && (++count%3)==0 && s>=tmpbuf) { - *t-- = thousand_sep; - } - } - - /* and a minus sign, if needed */ - if (is_negative) { - *t-- = '-'; - } - - efree(tmpbuf); - - return resbuf; -} -/* }}} */ - -/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]]) - Formats a number with grouped thousands */ -PHP_FUNCTION(number_format) -{ - zval **num, **dec, **t_s, **d_p; - char thousand_sep=',', dec_point='.'; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &num)==FAILURE) { - RETURN_FALSE; - } - convert_to_double_ex(num); - RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), 0, dec_point, thousand_sep), 0); - break; - case 2: - if (zend_get_parameters_ex(2, &num, &dec)==FAILURE) { - RETURN_FALSE; - } - convert_to_double_ex(num); - convert_to_long_ex(dec); - RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), Z_LVAL_PP(dec), dec_point, thousand_sep), 0); - break; - case 4: - if (zend_get_parameters_ex(4, &num, &dec, &d_p, &t_s)==FAILURE) { - RETURN_FALSE; - } - convert_to_double_ex(num); - convert_to_long_ex(dec); - - if (Z_TYPE_PP(d_p) != IS_NULL) { - convert_to_string_ex(d_p); - if (Z_STRLEN_PP(d_p)>=1) { - dec_point=Z_STRVAL_PP(d_p)[0]; - } else if (Z_STRLEN_PP(d_p)==0) { - dec_point=0; - } - } - if (Z_TYPE_PP(t_s) != IS_NULL) { - convert_to_string_ex(t_s); - if (Z_STRLEN_PP(t_s)>=1) { - thousand_sep=Z_STRVAL_PP(t_s)[0]; - } else if(Z_STRLEN_PP(t_s)==0) { - thousand_sep=0; - } - } - RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), Z_LVAL_PP(dec), dec_point, thousand_sep), 0); - break; - default: - WRONG_PARAM_COUNT; - break; - } -} -/* }}} */ - -/* {{{ proto float fmod(float x, float y) - Returns the remainder of dividing x by y as a float */ -PHP_FUNCTION(fmod) -{ - double num1, num2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) { - return; - } - - Z_DVAL_P(return_value) = fmod(num1, num2); - Z_TYPE_P(return_value) = IS_DOUBLE; -} -/* }}} */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/standard/md5.c b/ext/standard/md5.c deleted file mode 100644 index 3f8a4f7aa45af..0000000000000 --- a/ext/standard/md5.c +++ /dev/null @@ -1,435 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Lachlan Roche | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * md5.c - Copyright 1997 Lachlan Roche - * md5_file() added by Alessandro Astarita - */ - -#include "php.h" -#include "md5.h" - -PHPAPI void make_digest(char *md5str, unsigned char *digest) -{ - int i; - - for (i = 0; i < 16; i++) { - sprintf(md5str, "%02x", digest[i]); - md5str += 2; - } - - *md5str = '\0'; -} - -/* {{{ proto string md5(string str, [ bool raw_output]) - Calculate the md5 hash of a string */ -PHP_NAMED_FUNCTION(php_if_md5) -{ - char *arg; - int arg_len; - zend_bool raw_output = 0; - char md5str[33]; - PHP_MD5_CTX context; - unsigned char digest[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) { - return; - } - - md5str[0] = '\0'; - PHP_MD5Init(&context); - PHP_MD5Update(&context, arg, arg_len); - PHP_MD5Final(digest, &context); - if (raw_output) { - RETURN_BINARYL(digest, 16, 1); - } else { - make_digest(md5str, digest); - RETVAL_ASCII_STRING(md5str, 1); - } - -} -/* }}} */ - -/* {{{ proto string md5_file(string filename [, bool raw_output]) - Calculate the md5 hash of given filename */ -PHP_NAMED_FUNCTION(php_if_md5_file) -{ - char *arg; - int arg_len; - zend_bool raw_output = 0; - char md5str[33]; - unsigned char buf[1024]; - unsigned char digest[16]; - PHP_MD5_CTX context; - int n; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) { - return; - } - - stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL); - if (!stream) { - RETURN_FALSE; - } - - PHP_MD5Init(&context); - - while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) { - PHP_MD5Update(&context, buf, n); - } - - PHP_MD5Final(digest, &context); - - php_stream_close(stream); - - if (n<0) { - RETURN_FALSE; - } - - if (raw_output) { - RETURN_BINARYL(digest, 16, 1); - } else { - make_digest(md5str, digest); - RETVAL_ASCII_STRING(md5str, 1); - } -} -/* }}} */ - -/* - * The remaining code is the reference MD5 code (md5c.c) from rfc1321 - */ -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - rights reserved. - - License to copy and use this software is granted provided that it - is identified as the "RSA Data Security, Inc. MD5 Message-Digest - Algorithm" in all material mentioning or referencing this software - or this function. - - License is also granted to make and use derivative works provided - that such works are identified as "derived from the RSA Data - Security, Inc. MD5 Message-Digest Algorithm" in all material - mentioning or referencing the derived work. - - RSA Data Security, Inc. makes no representations concerning either - the merchantability of this software or the suitability of this - software for any particular purpose. It is provided "as is" - without express or implied warranty of any kind. - - These notices must be retained in any copies of any part of this - documentation and/or software. - */ - -/* Constants for MD5Transform routine. - */ - - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform(php_uint32[4], const unsigned char[64]); -static void Encode(unsigned char *, php_uint32 *, unsigned int); -static void Decode(php_uint32 *, const unsigned char *, unsigned int); - -static unsigned char PADDING[64] = -{ - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. - Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (php_uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (php_uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (php_uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (php_uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* {{{ PHP_MD5Init - * MD5 initialization. Begins an MD5 operation, writing a new context. - */ -PHPAPI void PHP_MD5Init(PHP_MD5_CTX * context) -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. - */ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} -/* }}} */ - -/* {{{ PHP_MD5Update - MD5 block update operation. Continues an MD5 message-digest - operation, processing another message block, and updating the - context. - */ -PHPAPI void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input, - unsigned int inputLen) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int) ((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((php_uint32) inputLen << 3)) - < ((php_uint32) inputLen << 3)) - context->count[1]++; - context->count[1] += ((php_uint32) inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. - */ - if (inputLen >= partLen) { - memcpy - ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); - MD5Transform(context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform(context->state, &input[i]); - - index = 0; - } else - i = 0; - - /* Buffer remaining input */ - memcpy - ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], - inputLen - i); -} -/* }}} */ - -/* {{{ PHP_MD5Final - MD5 finalization. Ends an MD5 message-digest operation, writing the - the message digest and zeroizing the context. - */ -PHPAPI void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode(bits, context->count, 8); - - /* Pad out to 56 mod 64. - */ - index = (unsigned int) ((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - PHP_MD5Update(context, PADDING, padLen); - - /* Append length (before padding) */ - PHP_MD5Update(context, bits, 8); - - /* Store state in digest */ - Encode(digest, context->state, 16); - - /* Zeroize sensitive information. - */ - memset((unsigned char*) context, 0, sizeof(*context)); -} -/* }}} */ - -/* {{{ MD5Transform - * MD5 basic transformation. Transforms state based on block. - */ -static void MD5Transform(state, block) -php_uint32 state[4]; -const unsigned char block[64]; -{ - php_uint32 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode(x, block, 64); - - /* Round 1 */ - FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ - FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */ - FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */ - FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */ - FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */ - FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */ - FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */ - FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */ - FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */ - FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */ - FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */ - GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */ - GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */ - GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */ - GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */ - GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */ - GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */ - GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */ - GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */ - GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */ - GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */ - HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */ - HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */ - HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */ - HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */ - HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */ - HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */ - HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */ - HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */ - HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */ - II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */ - II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */ - II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */ - II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */ - II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */ - II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */ - II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */ - II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */ - II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); -} -/* }}} */ - -/* {{{ Encode - Encodes input (php_uint32) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void Encode(output, input, len) -unsigned char *output; -php_uint32 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char) (input[i] & 0xff); - output[j + 1] = (unsigned char) ((input[i] >> 8) & 0xff); - output[j + 2] = (unsigned char) ((input[i] >> 16) & 0xff); - output[j + 3] = (unsigned char) ((input[i] >> 24) & 0xff); - } -} -/* }}} */ - -/* {{{ Decode - Decodes input (unsigned char) into output (php_uint32). Assumes len is - a multiple of 4. - */ -static void Decode(output, input, len) -php_uint32 *output; -const unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((php_uint32) input[j]) | (((php_uint32) input[j + 1]) << 8) | - (((php_uint32) input[j + 2]) << 16) | (((php_uint32) input[j + 3]) << 24); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/md5.h b/ext/standard/md5.h deleted file mode 100644 index bd4af1921fe88..0000000000000 --- a/ext/standard/md5.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef MD5_H -#define MD5_H -/* MD5.H - header file for MD5C.C - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - rights reserved. - - License to copy and use this software is granted provided that it - is identified as the "RSA Data Security, Inc. MD5 Message-Digest - Algorithm" in all material mentioning or referencing this software - or this function. - - License is also granted to make and use derivative works provided - that such works are identified as "derived from the RSA Data - Security, Inc. MD5 Message-Digest Algorithm" in all material - mentioning or referencing the derived work. - - RSA Data Security, Inc. makes no representations concerning either - the merchantability of this software or the suitability of this - software for any particular purpose. It is provided "as is" - without express or implied warranty of any kind. - - These notices must be retained in any copies of any part of this - documentation and/or software. - */ - -#include "ext/standard/basic_functions.h" - -/* MD5 context. */ -typedef struct { - php_uint32 state[4]; /* state (ABCD) */ - php_uint32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} PHP_MD5_CTX; - -PHPAPI void make_digest(char *md5str, unsigned char *digest); -PHPAPI void PHP_MD5Init(PHP_MD5_CTX *); -PHPAPI void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, unsigned int); -PHPAPI void PHP_MD5Final(unsigned char[16], PHP_MD5_CTX *); - -PHP_NAMED_FUNCTION(php_if_md5); -PHP_NAMED_FUNCTION(php_if_md5_file); - -#endif diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c deleted file mode 100644 index c7cffd6847b2e..0000000000000 --- a/ext/standard/metaphone.c +++ /dev/null @@ -1,478 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern -*/ - -#include "php.h" -#include "php_metaphone.h" - -static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional); - -PHP_FUNCTION(metaphone); - -/* {{{ proto string metaphone(string text, int phones) - Break english phrases down into their phonemes */ -PHP_FUNCTION(metaphone) -{ - char *str; - char *result = 0; - int str_len; - long phones = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, - &phones) == FAILURE) { - return; - } - - if (metaphone(str, str_len, phones, &result, 1) == 0) { - RETVAL_STRING(result, 0); - } else { - if (result) { - efree(result); - } - RETURN_FALSE; - } -} -/* }}} */ - -/* - this is now the original code by Michael G Schwern: - i've changed it just a slightly bit (use emalloc, - get rid of includes etc) - - thies - 13.09.1999 -*/ - -/*----------------------------- */ -/* this used to be "metaphone.h" */ -/*----------------------------- */ - -/* Special encodings */ -#define SH 'X' -#define TH '0' - -/*----------------------------- */ -/* end of "metaphone.h" */ -/*----------------------------- */ - -/*----------------------------- */ -/* this used to be "metachar.h" */ -/*----------------------------- */ - -/* Metachar.h ... little bits about characters for metaphone */ -/*-- Character encoding array & accessing macros --*/ -/* Stolen directly out of the book... */ -char _codes[26] = -{ - 1, 16, 4, 16, 9, 2, 4, 16, 9, 2, 0, 2, 2, 2, 1, 4, 0, 2, 4, 4, 1, 0, 0, 0, 8, 0 -/* a b c d e f g h i j k l m n o p q r s t u v w x y z */ -}; - - -#define ENCODE(c) (isalpha(c) ? _codes[((toupper(c)) - 'A')] : 0) - -#define isvowel(c) (ENCODE(c) & 1) /* AEIOU */ - -/* These letters are passed through unchanged */ -#define NOCHANGE(c) (ENCODE(c) & 2) /* FJMNR */ - -/* These form dipthongs when preceding H */ -#define AFFECTH(c) (ENCODE(c) & 4) /* CGPST */ - -/* These make C and G soft */ -#define MAKESOFT(c) (ENCODE(c) & 8) /* EIY */ - -/* These prevent GH from becoming F */ -#define NOGHTOF(c) (ENCODE(c) & 16) /* BDH */ - -/*----------------------------- */ -/* end of "metachar.h" */ -/*----------------------------- */ - -/* I suppose I could have been using a character pointer instead of - * accesssing the array directly... */ - -/* Look at the next letter in the word */ -#define Next_Letter (toupper(word[w_idx+1])) -/* Look at the current letter in the word */ -#define Curr_Letter (toupper(word[w_idx])) -/* Go N letters back. */ -#define Look_Back_Letter(n) (w_idx >= n ? toupper(word[w_idx-n]) : '\0') -/* Previous letter. I dunno, should this return null on failure? */ -#define Prev_Letter (Look_Back_Letter(1)) -/* Look two letters down. It makes sure you don't walk off the string. */ -#define After_Next_Letter (Next_Letter != '\0' ? toupper(word[w_idx+2]) \ - : '\0') -#define Look_Ahead_Letter(n) (toupper(Lookahead(word+w_idx, n))) - - -/* Allows us to safely look ahead an arbitrary # of letters */ -/* I probably could have just used strlen... */ -static char Lookahead(char *word, int how_far) -{ - char letter_ahead = '\0'; /* null by default */ - int idx; - for (idx = 0; word[idx] != '\0' && idx < how_far; idx++); - /* Edge forward in the string... */ - - letter_ahead = word[idx]; /* idx will be either == to how_far or - * at the end of the string - */ - return letter_ahead; -} - - -/* phonize one letter - * We don't know the buffers size in advance. On way to solve this is to just - * re-allocate the buffer size. We're using an extra of 2 characters (this - * could be one though; or more too). */ -#define Phonize(c) { \ - if (p_idx >= max_buffer_len) { \ - *phoned_word = erealloc(*phoned_word, max_buffer_len + 2); \ - max_buffer_len += 2; \ - } \ - (*phoned_word)[p_idx++] = c; \ - } -/* Slap a null character on the end of the phoned word */ -#define End_Phoned_Word {(*phoned_word)[p_idx] = '\0';} -/* How long is the phoned word? */ -#define Phone_Len (p_idx) - -/* Note is a letter is a 'break' in the word */ -#define Isbreak(c) (!isalpha(c)) - -/* {{{ metaphone - */ -static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional) -{ - int w_idx = 0; /* point in the phonization we're at. */ - int p_idx = 0; /* end of the phoned phrase */ - int max_buffer_len = 0; /* maximum length of the destination buffer */ - -/*-- Parameter checks --*/ - /* Negative phoneme length is meaningless */ - - if (max_phonemes < 0) - return -1; - - /* Empty/null string is meaningless */ - /* Overly paranoid */ - /* assert(word != NULL && word[0] != '\0'); */ - - if (word == NULL) - return -1; - -/*-- Allocate memory for our phoned_phrase --*/ - if (max_phonemes == 0) { /* Assume largest possible */ - max_buffer_len = word_len; - *phoned_word = safe_emalloc(sizeof(char), word_len, 1); - } else { - max_buffer_len = max_phonemes; - *phoned_word = safe_emalloc(sizeof(char), max_phonemes, 1); - } - - -/*-- The first phoneme has to be processed specially. --*/ - /* Find our first letter */ - for (; !isalpha(Curr_Letter); w_idx++) { - /* On the off chance we were given nothing but crap... */ - if (Curr_Letter == '\0') { - End_Phoned_Word - return SUCCESS; /* For testing */ - } - } - - switch (Curr_Letter) { - /* AE becomes E */ - case 'A': - if (Next_Letter == 'E') { - Phonize('E'); - w_idx += 2; - } - /* Remember, preserve vowels at the beginning */ - else { - Phonize('A'); - w_idx++; - } - break; - /* [GKP]N becomes N */ - case 'G': - case 'K': - case 'P': - if (Next_Letter == 'N') { - Phonize('N'); - w_idx += 2; - } - break; - /* WH becomes H, - WR becomes R - W if followed by a vowel */ - case 'W': - if (Next_Letter == 'H' || - Next_Letter == 'R') { - Phonize(Next_Letter); - w_idx += 2; - } else if (isvowel(Next_Letter)) { - Phonize('W'); - w_idx += 2; - } - /* else ignore */ - break; - /* X becomes S */ - case 'X': - Phonize('S'); - w_idx++; - break; - /* Vowels are kept */ - /* We did A already - case 'A': - case 'a': - */ - case 'E': - case 'I': - case 'O': - case 'U': - Phonize(Curr_Letter); - w_idx++; - break; - default: - /* do nothing */ - break; - } - - - - /* On to the metaphoning */ - for (; Curr_Letter != '\0' && - (max_phonemes == 0 || Phone_Len < max_phonemes); - w_idx++) { - /* How many letters to skip because an eariler encoding handled - * multiple letters */ - unsigned short int skip_letter = 0; - - - /* THOUGHT: It would be nice if, rather than having things like... - * well, SCI. For SCI you encode the S, then have to remember - * to skip the C. So the phonome SCI invades both S and C. It would - * be better, IMHO, to skip the C from the S part of the encoding. - * Hell, I'm trying it. - */ - - /* Ignore non-alphas */ - if (!isalpha(Curr_Letter)) - continue; - - /* Drop duplicates, except CC */ - if (Curr_Letter == Prev_Letter && - Curr_Letter != 'C') - continue; - - switch (Curr_Letter) { - /* B -> B unless in MB */ - case 'B': - if (Prev_Letter != 'M') - Phonize('B'); - break; - /* 'sh' if -CIA- or -CH, but not SCH, except SCHW. - * (SCHW is handled in S) - * S if -CI-, -CE- or -CY- - * dropped if -SCI-, SCE-, -SCY- (handed in S) - * else K - */ - case 'C': - if (MAKESOFT(Next_Letter)) { /* C[IEY] */ - if (After_Next_Letter == 'A' && - Next_Letter == 'I') { /* CIA */ - Phonize(SH); - } - /* SC[IEY] */ - else if (Prev_Letter == 'S') { - /* Dropped */ - } else { - Phonize('S'); - } - } else if (Next_Letter == 'H') { - if ((!traditional) && (After_Next_Letter == 'R' || Prev_Letter == 'S')) { /* Christ, School */ - Phonize('K'); - } else { - Phonize(SH); - } - skip_letter++; - } else { - Phonize('K'); - } - break; - /* J if in -DGE-, -DGI- or -DGY- - * else T - */ - case 'D': - if (Next_Letter == 'G' && - MAKESOFT(After_Next_Letter)) { - Phonize('J'); - skip_letter++; - } else - Phonize('T'); - break; - /* F if in -GH and not B--GH, D--GH, -H--GH, -H---GH - * else dropped if -GNED, -GN, - * else dropped if -DGE-, -DGI- or -DGY- (handled in D) - * else J if in -GE-, -GI, -GY and not GG - * else K - */ - case 'G': - if (Next_Letter == 'H') { - if (!(NOGHTOF(Look_Back_Letter(3)) || - Look_Back_Letter(4) == 'H')) { - Phonize('F'); - skip_letter++; - } else { - /* silent */ - } - } else if (Next_Letter == 'N') { - if (Isbreak(After_Next_Letter) || - (After_Next_Letter == 'E' && - Look_Ahead_Letter(3) == 'D')) { - /* dropped */ - } else - Phonize('K'); - } else if (MAKESOFT(Next_Letter) && - Prev_Letter != 'G') { - Phonize('J'); - } else { - Phonize('K'); - } - break; - /* H if before a vowel and not after C,G,P,S,T */ - case 'H': - if (isvowel(Next_Letter) && - !AFFECTH(Prev_Letter)) - Phonize('H'); - break; - /* dropped if after C - * else K - */ - case 'K': - if (Prev_Letter != 'C') - Phonize('K'); - break; - /* F if before H - * else P - */ - case 'P': - if (Next_Letter == 'H') { - Phonize('F'); - } else { - Phonize('P'); - } - break; - /* K - */ - case 'Q': - Phonize('K'); - break; - /* 'sh' in -SH-, -SIO- or -SIA- or -SCHW- - * else S - */ - case 'S': - if (Next_Letter == 'I' && - (After_Next_Letter == 'O' || - After_Next_Letter == 'A')) { - Phonize(SH); - } else if (Next_Letter == 'H') { - Phonize(SH); - skip_letter++; - } else if ((!traditional) && (Next_Letter == 'C' && Look_Ahead_Letter(2) == 'H' && Look_Ahead_Letter(3) == 'W')) { - Phonize(SH); - skip_letter += 2; - } else { - Phonize('S'); - } - break; - /* 'sh' in -TIA- or -TIO- - * else 'th' before H - * else T - */ - case 'T': - if (Next_Letter == 'I' && - (After_Next_Letter == 'O' || - After_Next_Letter == 'A')) { - Phonize(SH); - } else if (Next_Letter == 'H') { - Phonize(TH); - skip_letter++; - } else { - Phonize('T'); - } - break; - /* F */ - case 'V': - Phonize('F'); - break; - /* W before a vowel, else dropped */ - case 'W': - if (isvowel(Next_Letter)) - Phonize('W'); - break; - /* KS */ - case 'X': - Phonize('K'); - Phonize('S'); - break; - /* Y if followed by a vowel */ - case 'Y': - if (isvowel(Next_Letter)) - Phonize('Y'); - break; - /* S */ - case 'Z': - Phonize('S'); - break; - /* No transformation */ - case 'F': - case 'J': - case 'L': - case 'M': - case 'N': - case 'R': - Phonize(Curr_Letter); - break; - default: - /* nothing */ - break; - } /* END SWITCH */ - - w_idx += skip_letter; - } /* END FOR */ - - End_Phoned_Word; - - return 0; -} /* END metaphone */ -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c deleted file mode 100644 index 5550be3a088a3..0000000000000 --- a/ext/standard/microtime.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Paul Panotzki - Bunyip Information Systems | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef PHP_WIN32 -#include "win32/time.h" -#elif defined(NETWARE) -#include -#include -#else -#include -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include - -#include "microtime.h" - -#define NUL '\0' -#define MICRO_IN_SEC 1000000.00 -#define SEC_IN_MIN 60 - -#ifdef HAVE_GETTIMEOFDAY -static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zend_bool get_as_float = 0; - struct timeval tp = {0}; - struct timezone tz = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) { - return; - } - - if (gettimeofday(&tp, &tz)) { - RETURN_FALSE; - } - - if (get_as_float) { - RETURN_DOUBLE((double)(tp.tv_sec + tp.tv_usec / MICRO_IN_SEC)); - } - - if (mode) { - array_init(return_value); - add_assoc_long(return_value, "sec", tp.tv_sec); - add_assoc_long(return_value, "usec", tp.tv_usec); -#ifdef PHP_WIN32 - add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest/SEC_IN_MIN); -#else - add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest); -#endif - add_assoc_long(return_value, "dsttime", tz.tz_dsttime); - } else { - char ret[100]; - - snprintf(ret, 100, "%.8f %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); - RETURN_STRING(ret, 1); - } -} - -/* {{{ proto mixed microtime([bool get_as_float]) - Returns either a string or a float containing the current time in seconds and microseconds */ -PHP_FUNCTION(microtime) -{ - _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array gettimeofday([bool get_as_float]) - Returns the current time as array */ -PHP_FUNCTION(gettimeofday) -{ - _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -#endif -/* }}} */ - -#ifdef HAVE_GETRUSAGE -/* {{{ proto array getrusage([int who]) - Returns an array of usage statistics */ -PHP_FUNCTION(getrusage) -{ - struct rusage usg; - long pwho = 0; - int who = RUSAGE_SELF; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) { - who = RUSAGE_CHILDREN; - } - - memset(&usg, 0, sizeof(struct rusage)); - - if (getrusage(who, &usg) == -1) { - RETURN_FALSE; - } - - array_init(return_value); -#define PHP_RUSAGE_PARA(a) \ - add_assoc_long(return_value, #a, usg.a) -#if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */ - PHP_RUSAGE_PARA(ru_oublock); - PHP_RUSAGE_PARA(ru_inblock); - PHP_RUSAGE_PARA(ru_msgsnd); - PHP_RUSAGE_PARA(ru_msgrcv); - PHP_RUSAGE_PARA(ru_maxrss); - PHP_RUSAGE_PARA(ru_ixrss); - PHP_RUSAGE_PARA(ru_idrss); - PHP_RUSAGE_PARA(ru_minflt); - PHP_RUSAGE_PARA(ru_majflt); - PHP_RUSAGE_PARA(ru_nsignals); - PHP_RUSAGE_PARA(ru_nvcsw); - PHP_RUSAGE_PARA(ru_nivcsw); - PHP_RUSAGE_PARA(ru_nswap); -#endif /*_OSD_POSIX*/ - PHP_RUSAGE_PARA(ru_utime.tv_usec); - PHP_RUSAGE_PARA(ru_utime.tv_sec); - PHP_RUSAGE_PARA(ru_stime.tv_usec); - PHP_RUSAGE_PARA(ru_stime.tv_sec); -#undef PHP_RUSAGE_PARA -} -#endif /* HAVE_GETRUSAGE */ - -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h deleted file mode 100644 index e0c451fab7e32..0000000000000 --- a/ext/standard/microtime.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Paul Panotzki - Bunyip Information Systems | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef MICROTIME_H -#define MICROTIME_H - -#ifdef HAVE_GETTIMEOFDAY -PHP_FUNCTION(microtime); -PHP_FUNCTION(gettimeofday); -#endif -#ifdef HAVE_GETRUSAGE -PHP_FUNCTION(getrusage); -#endif - -#endif /* MICROTIME_H */ diff --git a/ext/standard/pack.c b/ext/standard/pack.c deleted file mode 100644 index 80ef259356bf7..0000000000000 --- a/ext/standard/pack.c +++ /dev/null @@ -1,929 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Chris Schneider | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" - -#include -#include -#include -#include -#include -#include -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#elif defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#endif -#include -#else -#include -#endif -#include "ext/standard/head.h" -#include "safe_mode.h" -#include "php_string.h" -#include "pack.h" -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif -#include "fsock.h" -#if HAVE_NETINET_IN_H -#include -#endif - -#define INC_OUTPUTPOS(a,b) \ - if ((a) < 0 || ((INT_MAX - outputpos)/(b)) < (a)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \ - RETURN_FALSE; \ - } \ - outputpos += (a)*(b); - -/* Whether machine is little endian */ -char machine_little_endian; - -/* Mapping of byte from char (8bit) to long for machine endian */ -static int byte_map[1]; - -/* Mappings of bytes from int (machine dependant) to int for machine endian */ -static int int_map[sizeof(int)]; - -/* Mappings of bytes from shorts (16bit) for all endian environments */ -static int machine_endian_short_map[2]; -static int big_endian_short_map[2]; -static int little_endian_short_map[2]; - -/* Mappings of bytes from longs (32bit) for all endian environments */ -static int machine_endian_long_map[4]; -static int big_endian_long_map[4]; -static int little_endian_long_map[4]; - -/* {{{ php_pack - */ -static void php_pack(zval **val, int size, int *map, char *output) -{ - int i; - char *v; - - convert_to_long_ex(val); - v = (char *) &Z_LVAL_PP(val); - - for (i = 0; i < size; i++) { - *output++ = v[map[i]]; - } -} -/* }}} */ - -/* pack() idea stolen from Perl (implemented formats behave the same as there) - * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. - */ -/* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]]) - Takes one or more arguments and packs them into a binary string according to the format argument */ -PHP_FUNCTION(pack) -{ - zval ***argv; - int argc, i; - int currentarg; - char *format; - int formatlen; - char *formatcodes; - int *formatargs; - int formatcount = 0; - int outputpos = 0, outputsize = 0; - char *output; - - argc = ZEND_NUM_ARGS(); - - if (argc < 1) { - WRONG_PARAM_COUNT; - } - - argv = safe_emalloc(argc, sizeof(zval **), 0); - - if (zend_get_parameters_array_ex(argc, argv) == FAILURE) { - efree(argv); - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(argv[0]); - format = Z_STRVAL_PP(argv[0]); - formatlen = Z_STRLEN_PP(argv[0]); - - /* We have a maximum of format codes to deal with */ - formatcodes = safe_emalloc(formatlen, sizeof(*formatcodes), 0); - formatargs = safe_emalloc(formatlen, sizeof(*formatargs), 0); - currentarg = 1; - - /* Preprocess format into formatcodes and formatargs */ - for (i = 0; i < formatlen; formatcount++) { - char code = format[i++]; - int arg = 1; - - /* Handle format arguments if any */ - if (i < formatlen) { - char c = format[i]; - - if (c == '*') { - arg = -1; - i++; - } - else if (c >= '0' && c <= '9') { - arg = atoi(&format[i]); - - while (format[i] >= '0' && format[i] <= '9' && i < formatlen) { - i++; - } - } - } - - /* Handle special arg '*' for all codes and check argv overflows */ - switch ((int) code) { - /* Never uses any args */ - case 'x': - case 'X': - case '@': - if (arg < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: '*' ignored", code); - arg = 1; - } - break; - - /* Always uses one arg */ - case 'a': - case 'A': - case 'h': - case 'H': - if (currentarg >= argc) { - efree(argv); - efree(formatcodes); - efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough arguments", code); - RETURN_FALSE; - } - - if (arg < 0) { - arg = Z_STRLEN_PP(argv[currentarg]); - } - - currentarg++; - break; - - /* Use as many args as specified */ - case 'c': - case 'C': - case 's': - case 'S': - case 'i': - case 'I': - case 'l': - case 'L': - case 'n': - case 'N': - case 'v': - case 'V': - case 'f': - case 'd': - if (arg < 0) { - arg = argc - currentarg; - } - - currentarg += arg; - - if (currentarg > argc) { - efree(argv); - efree(formatcodes); - efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: too few arguments", code); - RETURN_FALSE; - } - break; - - default: - efree(argv); - efree(formatcodes); - efree(formatargs); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: unknown format code", code); - RETURN_FALSE; - } - - formatcodes[formatcount] = code; - formatargs[formatcount] = arg; - } - - if (currentarg < argc) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d arguments unused", (argc - currentarg)); - } - - /* Calculate output length and upper bound while processing*/ - for (i = 0; i < formatcount; i++) { - int code = (int) formatcodes[i]; - int arg = formatargs[i]; - - switch ((int) code) { - case 'h': - case 'H': - INC_OUTPUTPOS((arg + 1) / 2,1) /* 4 bit per arg */ - break; - - case 'a': - case 'A': - case 'c': - case 'C': - case 'x': - INC_OUTPUTPOS(arg,1) /* 8 bit per arg */ - break; - - case 's': - case 'S': - case 'n': - case 'v': - INC_OUTPUTPOS(arg,2) /* 16 bit per arg */ - break; - - case 'i': - case 'I': - INC_OUTPUTPOS(arg,sizeof(int)) - break; - - case 'l': - case 'L': - case 'N': - case 'V': - INC_OUTPUTPOS(arg,4) /* 32 bit per arg */ - break; - - case 'f': - INC_OUTPUTPOS(arg,sizeof(float)) - break; - - case 'd': - INC_OUTPUTPOS(arg,sizeof(double)) - break; - - case 'X': - outputpos -= arg; - - if (outputpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", code); - outputpos = 0; - } - break; - - case '@': - outputpos = arg; - break; - } - - if (outputsize < outputpos) { - outputsize = outputpos; - } - } - - output = emalloc(outputsize + 1); - outputpos = 0; - currentarg = 1; - - /* Do actual packing */ - for (i = 0; i < formatcount; i++) { - int code = (int) formatcodes[i]; - int arg = formatargs[i]; - zval **val; - - switch ((int) code) { - case 'a': - case 'A': - memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg); - val = argv[currentarg++]; - convert_to_string_ex(val); - memcpy(&output[outputpos], Z_STRVAL_PP(val), - (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg); - outputpos += arg; - break; - - case 'h': - case 'H': { - int nibbleshift = (code == 'h') ? 0 : 4; - int first = 1; - char *v; - - val = argv[currentarg++]; - convert_to_string_ex(val); - v = Z_STRVAL_PP(val); - outputpos--; - if(arg > Z_STRLEN_PP(val)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code); - arg = Z_STRLEN_PP(val); - } - - while (arg-- > 0) { - char n = *v++; - - if (n >= '0' && n <= '9') { - n -= '0'; - } else if (n >= 'A' && n <= 'F') { - n -= ('A' - 10); - } else if (n >= 'a' && n <= 'f') { - n -= ('a' - 10); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: illegal hex digit %c", code, n); - n = 0; - } - - if (first--) { - output[++outputpos] = 0; - } else { - first = 1; - } - - output[outputpos] |= (n << nibbleshift); - nibbleshift = (nibbleshift + 4) & 7; - } - - outputpos++; - break; - } - - case 'c': - case 'C': - while (arg-- > 0) { - php_pack(argv[currentarg++], 1, byte_map, &output[outputpos]); - outputpos++; - } - break; - - case 's': - case 'S': - case 'n': - case 'v': { - int *map = machine_endian_short_map; - - if (code == 'n') { - map = big_endian_short_map; - } else if (code == 'v') { - map = little_endian_short_map; - } - - while (arg-- > 0) { - php_pack(argv[currentarg++], 2, map, &output[outputpos]); - outputpos += 2; - } - break; - } - - case 'i': - case 'I': - while (arg-- > 0) { - php_pack(argv[currentarg++], sizeof(int), int_map, &output[outputpos]); - outputpos += sizeof(int); - } - break; - - case 'l': - case 'L': - case 'N': - case 'V': { - int *map = machine_endian_long_map; - - if (code == 'N') { - map = big_endian_long_map; - } else if (code == 'V') { - map = little_endian_long_map; - } - - while (arg-- > 0) { - php_pack(argv[currentarg++], 4, map, &output[outputpos]); - outputpos += 4; - } - break; - } - - case 'f': { - float v; - - while (arg-- > 0) { - val = argv[currentarg++]; - convert_to_double_ex(val); - v = (float) Z_DVAL_PP(val); - memcpy(&output[outputpos], &v, sizeof(v)); - outputpos += sizeof(v); - } - break; - } - - case 'd': { - double v; - - while (arg-- > 0) { - val = argv[currentarg++]; - convert_to_double_ex(val); - v = (double) Z_DVAL_PP(val); - memcpy(&output[outputpos], &v, sizeof(v)); - outputpos += sizeof(v); - } - break; - } - - case 'x': - memset(&output[outputpos], '\0', arg); - outputpos += arg; - break; - - case 'X': - outputpos -= arg; - - if (outputpos < 0) { - outputpos = 0; - } - break; - - case '@': - if (arg > outputpos) { - memset(&output[outputpos], '\0', arg - outputpos); - } - outputpos = arg; - break; - } - } - - efree(argv); - efree(formatcodes); - efree(formatargs); - output[outputpos] = '\0'; - RETVAL_STRINGL(output, outputpos, 1); - efree(output); -} -/* }}} */ - -/* {{{ php_unpack - */ -static long php_unpack(char *data, int size, int issigned, int *map) -{ - long result; - char *cresult = (char *) &result; - int i; - - result = issigned ? -1 : 0; - - for (i = 0; i < size; i++) { - cresult[map[i]] = *data++; - } - - return result; -} -/* }}} */ - -/* unpack() is based on Perl's unpack(), but is modified a bit from there. - * Rather than depending on error-prone ordered lists or syntactically - * unpleasant pass-by-reference, we return an object with named paramters - * (like *_fetch_object()). Syntax is "f[repeat]name/...", where "f" is the - * formatter char (like pack()), "[repeat]" is the optional repeater argument, - * and "name" is the name of the variable to use. - * Example: "c2chars/nints" will return an object with fields - * chars1, chars2, and ints. - * Numeric pack types will return numbers, a and A will return strings, - * f and d will return doubles. - * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. - */ -/* {{{ proto array unpack(string format, string input) - Unpack binary string into named array elements according to format argument */ -PHP_FUNCTION(unpack) -{ - zval **formatarg; - zval **inputarg; - char *format; - char *input; - int formatlen; - int inputpos, inputlen; - int i; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &formatarg, &inputarg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(formatarg); - convert_to_string_ex(inputarg); - - format = Z_STRVAL_PP(formatarg); - formatlen = Z_STRLEN_PP(formatarg); - input = Z_STRVAL_PP(inputarg); - inputlen = Z_STRLEN_PP(inputarg); - inputpos = 0; - - array_init(return_value); - - while (formatlen-- > 0) { - char type = *(format++); - char c; - int arg = 1; - char *name; - int namelen; - int size=0; - - /* Handle format arguments if any */ - if (formatlen > 0) { - c = *format; - - if (c >= '0' && c <= '9') { - arg = atoi(format); - - while (formatlen > 0 && *format >= '0' && *format <= '9') { - format++; - formatlen--; - } - } else if (c == '*') { - arg = -1; - format++; - formatlen--; - } - } - - /* Get of new value in array */ - name = format; - - while (formatlen > 0 && *format != '/') { - formatlen--; - format++; - } - - namelen = format - name; - - if (namelen > 200) - namelen = 200; - - switch ((int) type) { - /* Never use any input */ - case 'X': - size = -1; - break; - - case '@': - size = 0; - break; - - case 'a': - case 'A': - size = arg; - arg = 1; - break; - - case 'h': - case 'H': - size = (arg > 0) ? arg / 2 : arg; - arg = 1; - break; - - /* Use 1 byte of input */ - case 'c': - case 'C': - case 'x': - size = 1; - break; - - /* Use 2 bytes of input */ - case 's': - case 'S': - case 'n': - case 'v': - size = 2; - break; - - /* Use sizeof(int) bytes of input */ - case 'i': - case 'I': - size = sizeof(int); - break; - - /* Use 4 bytes of input */ - case 'l': - case 'L': - case 'N': - case 'V': - size = 4; - break; - - /* Use sizeof(float) bytes of input */ - case 'f': - size = sizeof(float); - break; - - /* Use sizeof(double) bytes of input */ - case 'd': - size = sizeof(double); - break; - } - - /* Do actual unpacking */ - for (i = 0; i != arg; i++ ) { - /* Space for name + number, safe as namelen is ensured <= 200 */ - char n[256]; - - if (arg != 1 || namelen == 0) { - /* Need to add element number to name */ - sprintf(n, "%.*s%d", namelen, name, i + 1); - } else { - /* Truncate name to next format code or end of string */ - sprintf(n, "%.*s", namelen, name); - } - - if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow", type); - inputpos = 0; - } - - if ((inputpos + size) <= inputlen) { - switch ((int) type) { - case 'a': - case 'A': { - char pad = (type == 'a') ? '\0' : ' '; - int len = inputlen - inputpos; /* Remaining string */ - - /* If size was given take minimum of len and size */ - if ((size >= 0) && (len > size)) { - len = size; - } - - size = len; - - /* Remove padding chars from unpacked data */ - while (--len >= 0) { - if (input[inputpos + len] != pad) - break; - } - - add_assoc_stringl(return_value, n, &input[inputpos], len + 1, 1); - break; - } - - case 'h': - case 'H': { - int len = (inputlen - inputpos) * 2; /* Remaining */ - int nibbleshift = (type == 'h') ? 0 : 4; - int first = 1; - char *buf; - int ipos, opos; - - /* If size was given take minimum of len and size */ - if (size >= 0 && len > (size * 2)) { - len = size * 2; - } - - buf = emalloc(len + 1); - - for (ipos = opos = 0; opos < len; opos++) { - char c = (input[inputpos + ipos] >> nibbleshift) & 0xf; - - if (c < 10) { - c += '0'; - } else { - c += 'a' - 10; - } - - buf[opos] = c; - nibbleshift = (nibbleshift + 4) & 7; - - if (first-- == 0) { - ipos++; - first = 1; - } - } - - buf[len] = '\0'; - add_assoc_stringl(return_value, n, buf, len, 1); - efree(buf); - break; - } - - case 'c': - case 'C': { - int issigned = (type == 'c') ? (input[inputpos] & 0x80) : 0; - long v = php_unpack(&input[inputpos], 1, issigned, byte_map); - add_assoc_long(return_value, n, v); - break; - } - - case 's': - case 'S': - case 'n': - case 'v': { - long v; - int issigned = 0; - int *map = machine_endian_short_map; - - if (type == 's') { - issigned = input[inputpos + (machine_little_endian ? 1 : 0)] & 0x80; - } else if (type == 'n') { - map = big_endian_short_map; - } else if (type == 'v') { - map = little_endian_short_map; - } - - v = php_unpack(&input[inputpos], 2, issigned, map); - add_assoc_long(return_value, n, v); - break; - } - - case 'i': - case 'I': { - long v; - int issigned = 0; - - if (type == 'i') { - issigned = input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)] & 0x80; - } - - v = php_unpack(&input[inputpos], sizeof(int), issigned, int_map); - add_assoc_long(return_value, n, v); - break; - } - - case 'l': - case 'L': - case 'N': - case 'V': { - int issigned = 0; - int *map = machine_endian_long_map; - long v; - - if (type == 'l') { - issigned = input[inputpos + (machine_little_endian ? 3 : 0)] & 0x80; - } else if (type == 'N') { - map = big_endian_long_map; - } else if (type == 'V') { - map = little_endian_long_map; - } - - v = php_unpack(&input[inputpos], 4, issigned, map); - add_assoc_long(return_value, n, v); - break; - } - - case 'f': { - float v; - - memcpy(&v, &input[inputpos], sizeof(float)); - add_assoc_double(return_value, n, (double)v); - break; - } - - case 'd': { - double v; - - memcpy(&v, &input[inputpos], sizeof(double)); - add_assoc_double(return_value, n, v); - break; - } - - case 'x': - /* Do nothing with input, just skip it */ - break; - - case 'X': - if (inputpos < size) { - inputpos = -size; - i = arg - 1; /* Break out of for loop */ - - if (arg >= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); - } - } - break; - - case '@': - if (arg <= inputlen) { - inputpos = arg; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); - } - - i = arg - 1; /* Done, break out of for loop */ - break; - } - - inputpos += size; - if (inputpos < 0) { - if (size != -1) { /* only print warning if not working with * */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type); - } - inputpos = 0; - } - } else if (arg < 0) { - /* Reached end of input for '*' repeater */ - break; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos); - zval_dtor(return_value); - RETURN_FALSE; - } - } - - formatlen--; /* Skip '/' separator, does no harm if inputlen == 0 */ - format++; - } -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(pack) -{ - int machine_endian_check = 1; - int i; - - machine_little_endian = ((char *)&machine_endian_check)[0]; - - if (machine_little_endian) { - /* Where to get lo to hi bytes from */ - byte_map[0] = 0; - - for (i = 0; i < (int)sizeof(int); i++) { - int_map[i] = i; - } - - machine_endian_short_map[0] = 0; - machine_endian_short_map[1] = 1; - big_endian_short_map[0] = 1; - big_endian_short_map[1] = 0; - little_endian_short_map[0] = 0; - little_endian_short_map[1] = 1; - - machine_endian_long_map[0] = 0; - machine_endian_long_map[1] = 1; - machine_endian_long_map[2] = 2; - machine_endian_long_map[3] = 3; - big_endian_long_map[0] = 3; - big_endian_long_map[1] = 2; - big_endian_long_map[2] = 1; - big_endian_long_map[3] = 0; - little_endian_long_map[0] = 0; - little_endian_long_map[1] = 1; - little_endian_long_map[2] = 2; - little_endian_long_map[3] = 3; - } - else { - zval val; - int size = sizeof(Z_LVAL(val)); - Z_LVAL(val)=0; /*silence a warning*/ - - /* Where to get hi to lo bytes from */ - byte_map[0] = size - 1; - - for (i = 0; i < (int)sizeof(int); i++) { - int_map[i] = size - (sizeof(int) - i); - } - - machine_endian_short_map[0] = size - 2; - machine_endian_short_map[1] = size - 1; - big_endian_short_map[0] = size - 2; - big_endian_short_map[1] = size - 1; - little_endian_short_map[0] = size - 1; - little_endian_short_map[1] = size - 2; - - machine_endian_long_map[0] = size - 4; - machine_endian_long_map[1] = size - 3; - machine_endian_long_map[2] = size - 2; - machine_endian_long_map[3] = size - 1; - big_endian_long_map[0] = size - 4; - big_endian_long_map[1] = size - 3; - big_endian_long_map[2] = size - 2; - big_endian_long_map[3] = size - 1; - little_endian_long_map[0] = size - 1; - little_endian_long_map[1] = size - 2; - little_endian_long_map[2] = size - 3; - little_endian_long_map[3] = size - 4; - } - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/pack.h b/ext/standard/pack.h deleted file mode 100644 index f91b024869c6a..0000000000000 --- a/ext/standard/pack.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PACK_H -#define PACK_H - -PHP_MINIT_FUNCTION(pack); -PHP_FUNCTION(pack); -PHP_FUNCTION(unpack); - -#endif /* PACK_H */ diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c deleted file mode 100644 index fd99ed41ae505..0000000000000 --- a/ext/standard/pageinfo.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "pageinfo.h" -#include "SAPI.h" - -#include -#include -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif -#if HAVE_GRP_H -# ifdef PHP_WIN32 -# include "win32/grp.h" -# else -# include -# endif -#endif -#ifdef PHP_WIN32 -#undef getgid -#define getgroups(a, b) 0 -#define getgid() 1 -#define getuid() 1 -#endif -#if HAVE_UNISTD_H -#include -#endif -#include -#include -#ifdef PHP_WIN32 -#include -#endif - -#include "ext/standard/basic_functions.h" - -/* {{{ php_statpage - */ -PHPAPI void php_statpage(TSRMLS_D) -{ - struct stat *pstat; - - pstat = sapi_get_stat(TSRMLS_C); - - if (BG(page_uid)==-1 || BG(page_gid)==-1) { - if(pstat) { - BG(page_uid) = pstat->st_uid; - BG(page_gid) = pstat->st_gid; - BG(page_inode) = pstat->st_ino; -#ifdef NETWARE - BG(page_mtime) = (pstat->st_mtime).tv_sec; -#else - BG(page_mtime) = pstat->st_mtime; -#endif - } else { /* handler for situations where there is no source file, ex. php -r */ - BG(page_uid) = getuid(); - BG(page_gid) = getgid(); - } - } -} -/* }}} */ - -/* {{{ php_getuid - */ -long php_getuid(void) -{ - TSRMLS_FETCH(); - - php_statpage(TSRMLS_C); - return (BG(page_uid)); -} -/* }}} */ - -long php_getgid(void) -{ - TSRMLS_FETCH(); - - php_statpage(TSRMLS_C); - return (BG(page_gid)); -} - -/* {{{ proto int getmyuid(void) - Get PHP script owner's UID */ -PHP_FUNCTION(getmyuid) -{ - long uid; - - uid = php_getuid(); - if (uid < 0) { - RETURN_FALSE; - } else { - RETURN_LONG(uid); - } -} -/* }}} */ - -/* {{{ proto int getmygid(void) - Get PHP script owner's GID */ -PHP_FUNCTION(getmygid) -{ - long gid; - - gid = php_getgid(); - if (gid < 0) { - RETURN_FALSE; - } else { - RETURN_LONG(gid); - } -} -/* }}} */ - -/* {{{ proto int getmypid(void) - Get current process ID */ -PHP_FUNCTION(getmypid) -{ - int pid; - - pid = getpid(); - if (pid < 0) { - RETURN_FALSE; - } else { - RETURN_LONG((long) pid); - } -} -/* }}} */ - -/* {{{ proto int getmyinode(void) - Get the inode of the current script being parsed */ -PHP_FUNCTION(getmyinode) -{ - php_statpage(TSRMLS_C); - if (BG(page_inode) < 0) { - RETURN_FALSE; - } else { - RETURN_LONG(BG(page_inode)); - } -} -/* }}} */ - -PHPAPI time_t php_getlastmod(TSRMLS_D) -{ - php_statpage(TSRMLS_C); - return BG(page_mtime); -} - -/* {{{ proto int getlastmod(void) - Get time of last page modification */ -PHP_FUNCTION(getlastmod) -{ - long lm = php_getlastmod(TSRMLS_C); - if (lm < 0) { - RETURN_FALSE; - } else { - RETURN_LONG(lm); - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h deleted file mode 100644 index 7adf343af5d8e..0000000000000 --- a/ext/standard/pageinfo.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PAGEINFO_H -#define PAGEINFO_H - -PHP_FUNCTION(getmyuid); -PHP_FUNCTION(getmygid); -PHP_FUNCTION(getmypid); -PHP_FUNCTION(getmyinode); -PHP_FUNCTION(getlastmod); - -PHPAPI void php_statpage(TSRMLS_D); -PHPAPI time_t php_getlastmod(TSRMLS_D); -extern long php_getuid(void); -extern long php_getgid(void); - -#endif diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h deleted file mode 100644 index d79805c298d54..0000000000000 --- a/ext/standard/php_array.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - | Rasmus Lerdorf | - | Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ARRAY_H -#define PHP_ARRAY_H - -PHP_MINIT_FUNCTION(array); -PHP_MSHUTDOWN_FUNCTION(array); - -PHP_FUNCTION(ksort); -PHP_FUNCTION(krsort); -PHP_FUNCTION(natsort); -PHP_FUNCTION(natcasesort); -PHP_FUNCTION(asort); -PHP_FUNCTION(arsort); -PHP_FUNCTION(sort); -PHP_FUNCTION(rsort); -PHP_FUNCTION(usort); -PHP_FUNCTION(uasort); -PHP_FUNCTION(uksort); -PHP_FUNCTION(array_walk); -PHP_FUNCTION(array_walk_recursive); -PHP_FUNCTION(count); -PHP_FUNCTION(end); -PHP_FUNCTION(prev); -PHP_FUNCTION(next); -PHP_FUNCTION(reset); -PHP_FUNCTION(current); -PHP_FUNCTION(key); -PHP_FUNCTION(min); -PHP_FUNCTION(max); -PHP_FUNCTION(in_array); -PHP_FUNCTION(array_search); -PHP_FUNCTION(extract); -PHP_FUNCTION(compact); -PHP_FUNCTION(array_fill); -PHP_FUNCTION(range); -PHP_FUNCTION(shuffle); -PHP_FUNCTION(array_multisort); -PHP_FUNCTION(array_push); -PHP_FUNCTION(array_pop); -PHP_FUNCTION(array_shift); -PHP_FUNCTION(array_unshift); -PHP_FUNCTION(array_splice); -PHP_FUNCTION(array_slice); -PHP_FUNCTION(array_merge); -PHP_FUNCTION(array_merge_recursive); -PHP_FUNCTION(array_keys); -PHP_FUNCTION(array_values); -PHP_FUNCTION(array_count_values); -PHP_FUNCTION(array_reverse); -PHP_FUNCTION(array_reduce); -PHP_FUNCTION(array_pad); -PHP_FUNCTION(array_flip); -PHP_FUNCTION(array_change_key_case); -PHP_FUNCTION(array_rand); -PHP_FUNCTION(array_unique); -PHP_FUNCTION(array_intersect); -PHP_FUNCTION(array_intersect_key); -PHP_FUNCTION(array_intersect_ukey); -PHP_FUNCTION(array_uintersect); -PHP_FUNCTION(array_intersect_assoc); -PHP_FUNCTION(array_uintersect_assoc); -PHP_FUNCTION(array_intersect_uassoc); -PHP_FUNCTION(array_uintersect_uassoc); -PHP_FUNCTION(array_diff); -PHP_FUNCTION(array_diff_key); -PHP_FUNCTION(array_diff_ukey); -PHP_FUNCTION(array_udiff); -PHP_FUNCTION(array_diff_assoc); -PHP_FUNCTION(array_udiff_assoc); -PHP_FUNCTION(array_diff_uassoc); -PHP_FUNCTION(array_udiff_uassoc); -PHP_FUNCTION(array_sum); -PHP_FUNCTION(array_product); -PHP_FUNCTION(array_filter); -PHP_FUNCTION(array_map); -PHP_FUNCTION(array_key_exists); -PHP_FUNCTION(array_chunk); -PHP_FUNCTION(array_combine); - -HashTable* php_splice(HashTable *, int, int, zval ***, int, HashTable **); -PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS_DC); -int multisort_compare(const void *a, const void *b TSRMLS_DC); - -#endif /* PHP_ARRAY_H */ diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h deleted file mode 100644 index fd0c7124be206..0000000000000 --- a/ext/standard/php_assert.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ASSERT_H -#define PHP_ASSERT_H - -PHP_MINIT_FUNCTION(assert); -PHP_MSHUTDOWN_FUNCTION(assert); -PHP_RINIT_FUNCTION(assert); -PHP_RSHUTDOWN_FUNCTION(assert); -PHP_MINFO_FUNCTION(assert); -PHP_FUNCTION(assert); -PHP_FUNCTION(assert_options); - -#endif /* PHP_ASSERT_H */ diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h deleted file mode 100644 index 256f56e76308a..0000000000000 --- a/ext/standard/php_browscap.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BROWSCAP_H -#define PHP_BROWSCAP_H - -PHP_MINIT_FUNCTION(browscap); -PHP_MSHUTDOWN_FUNCTION(browscap); - -PHP_FUNCTION(get_browser); - -#endif /* PHP_BROWSCAP_H */ diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h deleted file mode 100644 index e525ac15b83e2..0000000000000 --- a/ext/standard/php_crypt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Bakken | - | Zeev Suraski | - | Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_CRYPT_H -#define PHP_CRYPT_H - -PHP_FUNCTION(crypt); -#if HAVE_CRYPT -PHP_MINIT_FUNCTION(crypt); -PHP_RINIT_FUNCTION(crypt); -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h deleted file mode 100644 index 056db9268d1be..0000000000000 --- a/ext/standard/php_dir.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_DIR_H -#define PHP_DIR_H - -/* directory functions */ -PHP_MINIT_FUNCTION(dir); -PHP_RINIT_FUNCTION(dir); -PHP_FUNCTION(opendir); -PHP_FUNCTION(closedir); -PHP_FUNCTION(chdir); -#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC -PHP_FUNCTION(chroot); -#endif -PHP_FUNCTION(getcwd); -PHP_FUNCTION(rewinddir); -PHP_NAMED_FUNCTION(php_if_readdir); -PHP_FUNCTION(getdir); -PHP_FUNCTION(glob); -PHP_FUNCTION(scandir); - -#endif /* PHP_DIR_H */ diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h deleted file mode 100644 index 47a9c9920d229..0000000000000 --- a/ext/standard/php_ext_syslog.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_EXT_SYSLOG_H -#define PHP_EXT_SYSLOG_H - -#ifdef HAVE_SYSLOG_H - -#include "php_syslog.h" - -PHP_MINIT_FUNCTION(syslog); -PHP_RINIT_FUNCTION(syslog); -PHP_RSHUTDOWN_FUNCTION(syslog); - -PHP_FUNCTION(openlog); -PHP_FUNCTION(syslog); -PHP_FUNCTION(closelog); -PHP_FUNCTION(define_syslog_variables); - -#endif - -#endif /* PHP_EXT_SYSLOG_H */ diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h deleted file mode 100644 index a7dddfcb2ece9..0000000000000 --- a/ext/standard/php_filestat.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FILESTAT_H -#define PHP_FILESTAT_H - -PHP_RINIT_FUNCTION(filestat); -PHP_RSHUTDOWN_FUNCTION(filestat); - -PHP_FUNCTION(clearstatcache); -PHP_FUNCTION(fileatime); -PHP_FUNCTION(filectime); -PHP_FUNCTION(filegroup); -PHP_FUNCTION(fileinode); -PHP_FUNCTION(filemtime); -PHP_FUNCTION(fileowner); -PHP_FUNCTION(fileperms); -PHP_FUNCTION(filesize); -PHP_FUNCTION(filetype); -PHP_FUNCTION(is_writable); -PHP_FUNCTION(is_readable); -PHP_FUNCTION(is_executable); -PHP_FUNCTION(is_file); -PHP_FUNCTION(is_dir); -PHP_FUNCTION(is_link); -PHP_FUNCTION(file_exists); -PHP_NAMED_FUNCTION(php_if_stat); -PHP_NAMED_FUNCTION(php_if_lstat); -PHP_FUNCTION(disk_total_space); -PHP_FUNCTION(disk_free_space); -PHP_FUNCTION(chown); -PHP_FUNCTION(chgrp); -PHP_FUNCTION(chmod); -#if HAVE_UTIME -PHP_FUNCTION(touch); -#endif -PHP_FUNCTION(clearstatcache); - -#define MAKE_LONG_ZVAL_INCREF(name, val)\ - MAKE_STD_ZVAL(name); \ - ZVAL_LONG(name, val); \ - name->refcount++; - -#ifdef PHP_WIN32 -#define S_IRUSR S_IREAD -#define S_IWUSR S_IWRITE -#define S_IXUSR S_IEXEC -#define S_IRGRP S_IREAD -#define S_IWGRP S_IWRITE -#define S_IXGRP S_IEXEC -#define S_IROTH S_IREAD -#define S_IWOTH S_IWRITE -#define S_IXOTH S_IEXEC - -#undef getgid -#define getgroups(a, b) 0 -#define getgid() 1 -#define getuid() 1 -#endif - -#ifdef PHP_WIN32 -typedef unsigned int php_stat_len; -#else -typedef int php_stat_len; -#endif - -PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, pval *return_value TSRMLS_DC); - -/* Switches for various filestat functions: */ -#define FS_PERMS 0 -#define FS_INODE 1 -#define FS_SIZE 2 -#define FS_OWNER 3 -#define FS_GROUP 4 -#define FS_ATIME 5 -#define FS_MTIME 6 -#define FS_CTIME 7 -#define FS_TYPE 8 -#define FS_IS_W 9 -#define FS_IS_R 10 -#define FS_IS_X 11 -#define FS_IS_FILE 12 -#define FS_IS_DIR 13 -#define FS_IS_LINK 14 -#define FS_EXISTS 15 -#define FS_LSTAT 16 -#define FS_STAT 17 - -#endif /* PHP_FILESTAT_H */ diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c deleted file mode 100644 index dec178051de1c..0000000000000 --- a/ext/standard/php_fopen_wrapper.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jim Winstead | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#include "php.h" -#include "php_globals.h" -#include "php_standard.h" -#include "php_fopen_wrappers.h" -#include "SAPI.h" - -static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - PHPWRITE(buf, count); - return count; -} - -static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - stream->eof = 1; - return 0; -} - -static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - return 0; -} - -static int php_stream_output_flush(php_stream *stream TSRMLS_DC) -{ - sapi_flush(TSRMLS_C); - return 0; -} - -php_stream_ops php_stream_output_ops = { - php_stream_output_write, - php_stream_output_read, - php_stream_output_close, - php_stream_output_flush, - "Output", - NULL, /* seek */ - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - return -1; -} - -static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - size_t read_bytes = 0; - if(!stream->eof) { - if(SG(request_info).raw_post_data) { /* data has already been read by a post handler */ - read_bytes = SG(request_info).raw_post_data_length - stream->position; - if(read_bytes <= count) { - stream->eof = 1; - } else { - read_bytes = count; - } - if(read_bytes) { - memcpy(buf, SG(request_info).raw_post_data + stream->position, read_bytes); - } - } else if(sapi_module.read_post) { - read_bytes = sapi_module.read_post(buf, count TSRMLS_CC); - if(read_bytes <= 0){ - stream->eof = 1; - read_bytes = 0; - } - } else { - stream->eof = 1; - } - } - - SG(read_post_bytes) += read_bytes; - return read_bytes; -} - -static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - return 0; -} - -static int php_stream_input_flush(php_stream *stream TSRMLS_DC) -{ - return -1; -} - -php_stream_ops php_stream_input_ops = { - php_stream_input_write, - php_stream_input_read, - php_stream_input_close, - php_stream_input_flush, - "Input", - NULL, /* seek */ - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) { - char *p, *token; - php_stream_filter *temp_filter; - - p = php_strtok_r(filterlist, "|", &token); - while (p) { - if (read_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { - php_stream_filter_append(&stream->readfilters, temp_filter); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); - } - } - if (write_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { - php_stream_filter_append(&stream->writefilters, temp_filter); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); - } - } - p = php_strtok_r(NULL, "|", &token); - } -} - - -php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - int fd = -1; - int mode_rw = 0; - php_stream * stream = NULL; - char *p, *token, *pathdup; - - if (!strncasecmp(path, "php://", 6)) - path += 6; - - if (!strcasecmp(path, "output")) { - return php_stream_alloc(&php_stream_output_ops, NULL, 0, "wb"); - } - - if (!strcasecmp(path, "input")) { - return php_stream_alloc(&php_stream_input_ops, NULL, 0, "rb"); - } - - if (!strcasecmp(path, "stdin")) { - fd = !strcmp(sapi_module.name, "cli") ? STDIN_FILENO : dup(STDIN_FILENO); - } else if (!strcasecmp(path, "stdout")) { - fd = !strcmp(sapi_module.name, "cli") ? STDOUT_FILENO : dup(STDOUT_FILENO); - } else if (!strcasecmp(path, "stderr")) { - fd = !strcmp(sapi_module.name, "cli") ? STDERR_FILENO : dup(STDERR_FILENO); - } else if (!strncasecmp(path, "filter/", 7)) { - /* Save time/memory when chain isn't specified */ - if (strchr(mode, 'r') || strchr(mode, '+')) { - mode_rw |= PHP_STREAM_FILTER_READ; - } - if (strchr(mode, 'w') || strchr(mode, '+') || strchr(mode, 'a')) { - mode_rw |= PHP_STREAM_FILTER_WRITE; - } - pathdup = estrndup(path + 6, strlen(path + 6)); - p = strstr(pathdup, "/resource="); - if (!p) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "No URL resource specified."); - efree(pathdup); - return NULL; - } - if (!(stream = php_stream_open_wrapper(p + 10, mode, options, opened_path))) { - efree(pathdup); - return NULL; - } - - *p = '\0'; - - p = php_strtok_r(pathdup + 1, "/", &token); - while (p) { - if (!strncasecmp(p, "read=", 5)) { - php_stream_apply_filter_list(stream, p + 5, 1, 0 TSRMLS_CC); - } else if (!strncasecmp(p, "write=", 6)) { - php_stream_apply_filter_list(stream, p + 6, 0, 1 TSRMLS_CC); - } else { - php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE TSRMLS_CC); - } - p = php_strtok_r(NULL, "/", &token); - } - efree(pathdup); - - return stream; - } else { - /* invalid php://thingy */ - return NULL; - } - - /* must be stdin, stderr or stdout */ - if (fd == -1) { - /* failed to dup */ - return NULL; - } - - stream = php_stream_fopen_from_fd(fd, mode, NULL); - if (stream == NULL) { - close(fd); - } - - return stream; -} - -static php_stream_wrapper_ops php_stdio_wops = { - php_stream_url_wrap_php, - NULL, /* close */ - NULL, /* fstat */ - NULL, /* stat */ - NULL, /* opendir */ - "PHP", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_php_wrapper = { - &php_stdio_wops, - NULL, - 0, /* is_url */ -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h deleted file mode 100644 index 86f66228207c3..0000000000000 --- a/ext/standard/php_fopen_wrappers.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jim Winstead | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FOPEN_WRAPPERS_H -#define PHP_FOPEN_WRAPPERS_H - -php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -extern PHPAPI php_stream_wrapper php_stream_http_wrapper; -extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper; -extern php_stream_wrapper php_stream_php_wrapper; -extern php_stream_wrapper php_plain_files_wrapper; - -#endif diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h deleted file mode 100644 index 5ffbc7cd2f932..0000000000000 --- a/ext/standard/php_ftok.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andrew Sitnikov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FTOK_H -#define PHP_FTOK_H - -#if HAVE_FTOK -PHP_FUNCTION(ftok); -#endif - -#endif /* PHP_FTOK_H */ diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h deleted file mode 100644 index a2de9dc59f1d8..0000000000000 --- a/ext/standard/php_http.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sara Golemon | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_HTTP_H -#define PHP_HTTP_H - -#include "php.h" -#include "php_smart_str.h" - -PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, - const char *num_prefix, int num_prefix_len, - const char *key_prefix, int key_prefix_len, - const char *key_suffix, int key_suffix_len, - zval *type, char *arg_sep TSRMLS_DC); -#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL TSRMLS_CC) - -PHP_FUNCTION(http_build_query); - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ - diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h deleted file mode 100644 index 3f9c4055c98e8..0000000000000 --- a/ext/standard/php_image.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_IMAGE_H -#define PHP_IMAGE_H - -PHP_FUNCTION(getimagesize); - -PHP_FUNCTION(image_type_to_mime_type); -PHP_FUNCTION(image_type_to_extension); - -/* {{{ enum image_filetype - This enum is used to have ext/standard/image.c and ext/exif/exif.c use - the same constants for file types. -*/ -typedef enum -{ IMAGE_FILETYPE_UNKNOWN=0, - IMAGE_FILETYPE_GIF=1, - IMAGE_FILETYPE_JPEG, - IMAGE_FILETYPE_PNG, - IMAGE_FILETYPE_SWF, - IMAGE_FILETYPE_PSD, - IMAGE_FILETYPE_BMP, - IMAGE_FILETYPE_TIFF_II, /* intel */ - IMAGE_FILETYPE_TIFF_MM, /* motorola */ - IMAGE_FILETYPE_JPC, - IMAGE_FILETYPE_JP2, - IMAGE_FILETYPE_JPX, - IMAGE_FILETYPE_JB2, - IMAGE_FILETYPE_SWC, - IMAGE_FILETYPE_IFF, - IMAGE_FILETYPE_WBMP, - /* IMAGE_FILETYPE_JPEG2000 is a userland alias for IMAGE_FILETYPE_JPC */ - IMAGE_FILETYPE_XBM -/* WHEN EXTENDING: PLEASE ALSO REGISTER IN image.c:PHP_MINIT_FUNCTION(imagetypes) */ -} image_filetype; -/* }}} */ - -PHP_MINIT_FUNCTION(imagetypes); - -PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC); - -PHPAPI char * php_image_type_to_mime_type(int image_type); - -#endif /* PHP_IMAGE_H */ diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h deleted file mode 100644 index 12d295c08153e..0000000000000 --- a/ext/standard/php_incomplete_class.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_INCOMPLETE_CLASS_H -#define PHP_INCOMPLETE_CLASS_H - -#include "ext/standard/basic_functions.h" - -#define PHP_IC_ENTRY \ - BG(incomplete_class) - -#define PHP_SET_CLASS_ATTRIBUTES(struc) \ - /* OBJECTS_FIXME: Fix for new object model */ \ - if (Z_OBJ_HT_P(struc)->get_class_entry && \ - Z_OBJCE_P(struc) == BG(incomplete_class)) { \ - class_name = php_lookup_class_name(struc, &name_len); \ - free_class_name = 1; \ - incomplete_class = 1; \ - } else { \ - free_class_name = !zend_get_object_classname(struc, &class_name, &name_len TSRMLS_CC);\ - } - -#define PHP_CLEANUP_CLASS_ATTRIBUTES() \ - if (free_class_name) efree(class_name) - -#define PHP_CLASS_ATTRIBUTES \ - char *class_name; \ - zend_uint name_len; \ - zend_bool free_class_name = 0; \ - zend_bool incomplete_class = 0 - -#define INCOMPLETE_CLASS "__PHP_Incomplete_Class" -#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name" - -#ifdef __cplusplus -extern "C" { -#endif - -zend_class_entry *php_create_incomplete_class(TSRMLS_D); - -char *php_lookup_class_name(zval *object, zend_uint *nlen); -void php_store_class_name(zval *object, const char *name, zend_uint len); - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h deleted file mode 100644 index 5e48a53b23a84..0000000000000 --- a/ext/standard/php_iptc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_IPTC_H -#define PHP_IPTC_H - -PHP_FUNCTION(iptcparse); -PHP_FUNCTION(iptcembed); - -#endif /* PHP_IPTC_H */ diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h deleted file mode 100644 index 5d223e76d6092..0000000000000 --- a/ext/standard/php_lcg.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_LCG_H -#define PHP_LCG_H - -#include "ext/standard/basic_functions.h" - -typedef struct { - php_int32 s1; - php_int32 s2; - int seeded; -} php_lcg_globals; - -PHPAPI double php_combined_lcg(TSRMLS_D); -PHP_FUNCTION(lcg_value); - -PHP_MINIT_FUNCTION(lcg); -PHP_RINIT_FUNCTION(lcg); - -#ifdef ZTS -#define LCG(v) TSRMG(lcg_globals_id, php_lcg_globals *, v) -#else -#define LCG(v) (lcg_globals.v) -#endif - -#endif diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h deleted file mode 100644 index eea8f3d8de093..0000000000000 --- a/ext/standard/php_link.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_LINK_H -#define PHP_LINK_H - -#ifdef HAVE_SYMLINK - -PHP_FUNCTION(link); -PHP_FUNCTION(readlink); -PHP_FUNCTION(linkinfo); -PHP_FUNCTION(symlink); - -#endif - -#endif /* PHP_LINK_H */ diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h deleted file mode 100644 index 5dae7e45feb63..0000000000000 --- a/ext/standard/php_mail.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_MAIL_H -#define PHP_MAIL_H - -PHP_FUNCTION(mail); -PHP_MINFO_FUNCTION(mail); - -#if HAVE_SENDMAIL - -PHP_FUNCTION(ezmlm_hash); -PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC); - -#endif - -#endif /* PHP_MAIL_H */ diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h deleted file mode 100644 index 18965f3179e92..0000000000000 --- a/ext/standard/php_math.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - | Stig Sĉther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_MATH_H -#define PHP_MATH_H - -PHPAPI char *_php_math_number_format(double, int, char , char); - -PHP_FUNCTION(sin); -PHP_FUNCTION(cos); -PHP_FUNCTION(tan); -PHP_FUNCTION(asin); -PHP_FUNCTION(acos); -PHP_FUNCTION(atan); -PHP_FUNCTION(atan2); -PHP_FUNCTION(pi); -PHP_FUNCTION(exp); -PHP_FUNCTION(log); -PHP_FUNCTION(log10); -PHP_FUNCTION(is_finite); -PHP_FUNCTION(is_infinite); -PHP_FUNCTION(is_nan); -PHP_FUNCTION(pow); -PHP_FUNCTION(sqrt); -PHP_FUNCTION(srand); -PHP_FUNCTION(rand); -PHP_FUNCTION(getrandmax); -PHP_FUNCTION(mt_srand); -PHP_FUNCTION(mt_rand); -PHP_FUNCTION(mt_getrandmax); -PHP_FUNCTION(abs); -PHP_FUNCTION(ceil); -PHP_FUNCTION(floor); -PHP_FUNCTION(round); -PHP_FUNCTION(decbin); -PHP_FUNCTION(dechex); -PHP_FUNCTION(decoct); -PHP_FUNCTION(bindec); -PHP_FUNCTION(hexdec); -PHP_FUNCTION(octdec); -PHP_FUNCTION(base_convert); -PHP_FUNCTION(number_format); -PHP_FUNCTION(fmod); -PHP_FUNCTION(deg2rad); -PHP_FUNCTION(rad2deg); - - /* - WARNING: these functions are expermental: they could change their names or - disappear in the next version of PHP! - */ -PHP_FUNCTION(hypot); -PHP_FUNCTION(expm1); -PHP_FUNCTION(log1p); - - -PHP_FUNCTION(sinh); -PHP_FUNCTION(cosh); -PHP_FUNCTION(tanh); - -#ifdef HAVE_ASINH -PHP_FUNCTION(asinh); -#endif -#ifdef HAVE_ACOSH -PHP_FUNCTION(acosh); -#endif -#ifdef HAVE_ATANH -PHP_FUNCTION(atanh); -#endif - -#include - -#ifndef M_E -#define M_E 2.7182818284590452354 /* e */ -#endif - -#ifndef M_LOG2E -#define M_LOG2E 1.4426950408889634074 /* log_2 e */ -#endif - -#ifndef M_LOG10E -#define M_LOG10E 0.43429448190325182765 /* log_10 e */ -#endif - -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 /* log_e 2 */ -#endif - -#ifndef M_LN10 -#define M_LN10 2.30258509299404568402 /* log_e 10 */ -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif - -#ifndef M_PI_2 -#define M_PI_2 1.57079632679489661923 /* pi/2 */ -#endif - -#ifndef M_PI_4 -#define M_PI_4 0.78539816339744830962 /* pi/4 */ -#endif - -#ifndef M_1_PI -#define M_1_PI 0.31830988618379067154 /* 1/pi */ -#endif - -#ifndef M_2_PI -#define M_2_PI 0.63661977236758134308 /* 2/pi */ -#endif - -#ifndef M_SQRTPI -#define M_SQRTPI 1.77245385090551602729 /* sqrt(pi) */ -#endif - -#ifndef M_2_SQRTPI -#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ -#endif - -#ifndef M_LNPI -#define M_LNPI 1.14472988584940017414 /* ln(pi) */ -#endif - -#ifndef M_EULER -#define M_EULER 0.57721566490153286061 /* Euler constant */ -#endif - -#ifndef M_SQRT2 -#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ -#endif - -#ifndef M_SQRT1_2 -#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ -#endif - -#ifndef M_SQRT3 -#define M_SQRT3 1.73205080756887729352 /* sqrt(3) */ -#endif - -#endif /* PHP_MATH_H */ diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h deleted file mode 100644 index 4baedc831874a..0000000000000 --- a/ext/standard/php_metaphone.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_METAPHONE_H -#define PHP_METAPHONE_H - -PHP_FUNCTION(metaphone); - -#endif diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h deleted file mode 100644 index 570565ed09ad2..0000000000000 --- a/ext/standard/php_rand.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Zeev Suraski | - | Pedro Melo | - | Sterling Hughes | - | | - | Based on code from: Shawn Cokus | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef PHP_RAND_H -#define PHP_RAND_H - -#include -#include "basic_functions.h" - -/* System Rand functions */ -#ifndef RAND_MAX -#define RAND_MAX (1<<15) -#endif - -/* In ZTS mode we rely on rand_r() so we must use RAND_MAX. */ -#if !defined(ZTS) && (defined(HAVE_LRAND48) || defined(HAVE_RANDOM)) -#define PHP_RAND_MAX 2147483647 -#else -#define PHP_RAND_MAX RAND_MAX -#endif - -#define RAND_RANGE(__n, __min, __max, __tmax) \ - (__n) = (__min) + (long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0))) - -/* MT Rand */ -#define PHP_MT_RAND_MAX ((long) (0x7FFFFFFF)) /* (1<<31) - 1 */ - -#ifdef PHP_WIN32 -#define GENERATE_SEED() ((long) (time(0) * GetCurrentProcessId() * 1000000 * php_combined_lcg(TSRMLS_C))) -#else -#define GENERATE_SEED() ((long) (time(0) * getpid() * 1000000 * php_combined_lcg(TSRMLS_C))) -#endif - -PHPAPI void php_srand(long seed TSRMLS_DC); -PHPAPI long php_rand(TSRMLS_D); -PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC); -PHPAPI php_uint32 php_mt_rand(TSRMLS_D); - -#endif /* PHP_RAND_H */ diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h deleted file mode 100644 index 63ee00a3b2a1f..0000000000000 --- a/ext/standard/php_smart_str.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_SMART_STR_H -#define PHP_SMART_STR_H - -#include "php_smart_str_public.h" - -#include -#ifndef SMART_STR_USE_REALLOC -#include -#endif - -/* It's safe to write to "one behind the length" as we allocate two extra bytes - * to allow for Unicode trailers */ -#define smart_str_0(x) do { \ - if ((x)->c) { \ - (x)->c[(x)->len] = '\0'; \ - (x)->c[(x)->len + 1] = '\0'; \ - } \ -} while (0) - -#ifndef SMART_STR_PREALLOC -#define SMART_STR_PREALLOC 128 -#endif - -#ifndef SMART_STR_START_SIZE -#define SMART_STR_START_SIZE 78 -#endif - -#ifdef SMART_STR_USE_REALLOC -#define SMART_STR_REALLOC(a,b,c) realloc((a),(b)) -#else -#define SMART_STR_REALLOC(a,b,c) perealloc((a),(b),(c)) -#endif - -#define SMART_STR_DO_REALLOC(d, what) \ - (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 2, (what)) - -#define smart_str_alloc4(d, n, what, newlen) do { \ - if (!(d)->c) { \ - (d)->len = 0; \ - newlen = (n); \ - (d)->a = newlen < SMART_STR_START_SIZE \ - ? SMART_STR_START_SIZE \ - : newlen + SMART_STR_PREALLOC; \ - SMART_STR_DO_REALLOC(d, what); \ - } else { \ - newlen = (d)->len + (n); \ - if (newlen >= (d)->a) { \ - (d)->a = newlen + SMART_STR_PREALLOC; \ - SMART_STR_DO_REALLOC(d, what); \ - } \ - } \ -} while (0) - -#define smart_str_alloc(d, n, what) \ - smart_str_alloc4((d), (n), (what), newlen) - -/* wrapper */ - -#define smart_str_appends_ex(dest, src, what) \ - smart_str_appendl_ex((dest), (src), strlen(src), (what)) -#define smart_str_appends(dest, src) \ - smart_str_appendl((dest), (src), strlen(src)) - -/* normal character appending */ -#define smart_str_appendc(dest, c) \ - smart_str_appendc_ex((dest), (c), 0) - -/* appending of a single UTF-16 code unit (2 byte)*/ -#define smart_str_append2c(dest, c) do { \ - smart_str_appendc_ex((dest), (c&0xFF), 0); \ - smart_str_appendc_ex((dest), (c&0xFF00 ? c>>8 : '\0'), 0); \ -} while (0) - -#define smart_str_free(s) \ - smart_str_free_ex((s), 0) -#define smart_str_appendl(dest, src, len) \ - smart_str_appendl_ex((dest), (src), (len), 0) -#define smart_str_append(dest, src) \ - smart_str_append_ex((dest), (src), 0) -#define smart_str_append_long(dest, val) \ - smart_str_append_long_ex((dest), (val), 0) -#define smart_str_append_off_t(dest, val) \ - smart_str_append_off_t_ex((dest), (val), 0) -#define smart_str_append_unsigned(dest, val) \ - smart_str_append_unsigned_ex((dest), (val), 0) - -#define smart_str_appendc_ex(dest, ch, what) do { \ - register size_t __nl; \ - smart_str_alloc4((dest), 1, (what), __nl); \ - (dest)->len = __nl; \ - ((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch); \ -} while (0) - -#define smart_str_free_ex(s, what) do { \ - smart_str *__s = (smart_str *) (s); \ - if (__s->c) { \ - pefree(__s->c, what); \ - __s->c = NULL; \ - } \ - __s->a = __s->len = 0; \ -} while (0) - -#define smart_str_appendl_ex(dest, src, nlen, what) do { \ - register size_t __nl; \ - smart_str *__dest = (smart_str *) (dest); \ - \ - smart_str_alloc4(__dest, (nlen), (what), __nl); \ - memcpy(__dest->c + __dest->len, (src), (nlen)); \ - __dest->len = __nl; \ -} while (0) - -/* input: buf points to the END of the buffer */ -#define smart_str_print_unsigned4(buf, num, vartype, result) do { \ - char *__p = (buf); \ - vartype __num = (num); \ - *__p = '\0'; \ - do { \ - *--__p = (char) (__num % 10) + '0'; \ - __num /= 10; \ - } while (__num > 0); \ - result = __p; \ -} while (0) - -/* buf points to the END of the buffer */ -#define smart_str_print_long4(buf, num, vartype, result) do { \ - if (num < 0) { \ - /* this might cause problems when dealing with LONG_MIN \ - and machines which don't support long long. Works \ - flawlessly on 32bit x86 */ \ - smart_str_print_unsigned4((buf), -(num), vartype, (result)); \ - *--(result) = '-'; \ - } else { \ - smart_str_print_unsigned4((buf), (num), vartype, (result)); \ - } \ -} while (0) - -/* - * these could be replaced using a braced-group inside an expression - * for GCC compatible compilers, e.g. - * - * #define f(..) ({char *r;..;__r;}) - */ - -static inline char *smart_str_print_long(char *buf, long num) { - char *r; - smart_str_print_long4(buf, num, unsigned long, r); - return r; -} - -static inline char *smart_str_print_unsigned(char *buf, long num) { - char *r; - smart_str_print_unsigned4(buf, num, unsigned long, r); - return r; -} - -#define smart_str_append_generic_ex(dest, num, type, vartype, func) do { \ - char __b[32]; \ - char *__t; \ - smart_str_print##func##4 (__b + sizeof(__b) - 1, (num), vartype, __t); \ - smart_str_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \ -} while (0) - -#define smart_str_append_unsigned_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), unsigned long, _unsigned) - -#define smart_str_append_long_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), unsigned long, _long) - -#define smart_str_append_off_t_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), off_t, _long) - -#define smart_str_append_ex(dest, src, what) \ - smart_str_appendl_ex((dest), ((smart_str *)(src))->c, \ - ((smart_str *)(src))->len, (what)); - - -#define smart_str_setl(dest, src, nlen) do { \ - (dest)->len = (nlen); \ - (dest)->a = (nlen) + 1; \ - (dest)->c = (char *) (src); \ -} while (0) - -#define smart_str_sets(dest, src) \ - smart_str_setl((dest), (src), strlen(src)); - -#endif diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h deleted file mode 100644 index 026e2a7a03008..0000000000000 --- a/ext/standard/php_smart_str_public.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_SMART_STR_PUBLIC_H -#define PHP_SMART_STR_PUBLIC_H - -#include - -typedef struct { - char *c; - size_t len; - size_t a; -} smart_str; - -#endif diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h deleted file mode 100644 index 8e021c468fef8..0000000000000 --- a/ext/standard/php_standard.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "basic_functions.h" -#include "php_math.h" -#include "php_string.h" -#include "base64.h" -#include "php_dir.h" -#include "dns.h" -#include "reg.h" -#include "php_mail.h" -#include "md5.h" -#include "sha1.h" -#include "html.h" -#include "exec.h" -#include "file.h" -#include "php_ext_syslog.h" -#include "php_filestat.h" -#include "php_browscap.h" -#include "pack.h" -#include "datetime.h" -#include "microtime.h" -#include "url.h" -#include "pageinfo.h" -#include "cyr_convert.h" -#include "php_link.h" -#include "fsock.h" -#include "php_image.h" -#include "php_iptc.h" -#include "info.h" -#include "uniqid.h" -#include "php_var.h" -#include "quot_print.h" -#include "dl.h" -#include "php_crypt.h" -#include "head.h" -#include "php_lcg.h" -#include "php_metaphone.h" -#include "php_output.h" -#include "php_array.h" -#include "php_assert.h" -#include "php_versioning.h" -#include "php_ftok.h" -#include "php_type.h" -#include "php_sunfuncs.h" - -#define phpext_standard_ptr basic_functions_module_ptr -PHP_MINIT_FUNCTION(standard_filters); -PHP_MSHUTDOWN_FUNCTION(standard_filters); - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h deleted file mode 100644 index 02e724037a29f..0000000000000 --- a/ext/standard/php_string.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Sĉther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */ - -#ifndef PHP_STRING_H -#define PHP_STRING_H - -PHP_FUNCTION(strspn); -PHP_FUNCTION(strcspn); -PHP_FUNCTION(str_replace); -PHP_FUNCTION(str_ireplace); -PHP_FUNCTION(rtrim); -PHP_FUNCTION(trim); -PHP_FUNCTION(ltrim); -PHP_FUNCTION(soundex); -PHP_FUNCTION(levenshtein); - -PHP_FUNCTION(count_chars); -PHP_FUNCTION(wordwrap); -PHP_FUNCTION(explode); -PHP_FUNCTION(implode); -PHP_FUNCTION(strtok); -PHP_FUNCTION(strtoupper); -PHP_FUNCTION(strtolower); -PHP_FUNCTION(basename); -PHP_FUNCTION(dirname); -PHP_FUNCTION(pathinfo); -PHP_FUNCTION(strstr); -PHP_FUNCTION(strpos); -PHP_FUNCTION(stripos); -PHP_FUNCTION(strrpos); -PHP_FUNCTION(strripos); -PHP_FUNCTION(strrchr); -PHP_FUNCTION(substr); -PHP_FUNCTION(quotemeta); -PHP_FUNCTION(ucfirst); -PHP_FUNCTION(ucwords); -PHP_FUNCTION(strtr); -PHP_FUNCTION(strrev); -PHP_FUNCTION(hebrev); -PHP_FUNCTION(hebrevc); -PHP_FUNCTION(user_sprintf); -PHP_FUNCTION(user_printf); -PHP_FUNCTION(vprintf); -PHP_FUNCTION(vsprintf); -PHP_FUNCTION(addcslashes); -PHP_FUNCTION(addslashes); -PHP_FUNCTION(stripcslashes); -PHP_FUNCTION(stripslashes); -PHP_FUNCTION(chr); -PHP_FUNCTION(ord); -PHP_FUNCTION(nl2br); -PHP_FUNCTION(setlocale); -PHP_FUNCTION(localeconv); -PHP_FUNCTION(nl_langinfo); -PHP_FUNCTION(stristr); -PHP_FUNCTION(chunk_split); -PHP_FUNCTION(parse_str); -PHP_FUNCTION(bin2hex); -PHP_FUNCTION(similar_text); -PHP_FUNCTION(strip_tags); -PHP_FUNCTION(str_repeat); -PHP_FUNCTION(substr_replace); -PHP_FUNCTION(strnatcmp); -PHP_FUNCTION(strnatcasecmp); -PHP_FUNCTION(substr_count); -PHP_FUNCTION(str_pad); -PHP_FUNCTION(sscanf); -PHP_FUNCTION(str_shuffle); -PHP_FUNCTION(str_word_count); -PHP_FUNCTION(str_split); -PHP_FUNCTION(strpbrk); -PHP_FUNCTION(substr_compare); -#ifdef HAVE_STRCOLL -PHP_FUNCTION(strcoll); -#endif -#if HAVE_STRFMON -PHP_FUNCTION(money_format); -#endif - -#if defined(HAVE_LOCALECONV) && defined(ZTS) -PHP_MINIT_FUNCTION(localeconv); -PHP_MSHUTDOWN_FUNCTION(localeconv); -#endif -#if HAVE_NL_LANGINFO -PHP_MINIT_FUNCTION(nl_langinfo); -#endif - -#define strnatcmp(a, b) \ - strnatcmp_ex(a, strlen(a), b, strlen(b), 0) -#define strnatcasecmp(a, b) \ - strnatcmp_ex(a, strlen(a), b, strlen(b), 1) -PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case); - -#ifdef HAVE_LOCALECONV -PHPAPI struct lconv *localeconv_r(struct lconv *out); -#endif - -PHPAPI char *php_strtoupper(char *s, size_t len); -PHPAPI char *php_strtolower(char *s, size_t len); -PHPAPI UChar *php_u_strtoupper(UChar **s, int32_t *len, const char *locale); -PHPAPI UChar *php_u_strtolower(UChar **s, int32_t *len, const char *locale); -PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen); -PHPAPI UChar *php_u_addslashes(UChar *str, int32_t length, int32_t *new_length, int freeit TSRMLS_DC); -PHPAPI UChar *php_u_addslashes_ex(UChar *str, int32_t length, int32_t *new_length, int freeit, int ignore_sybase TSRMLS_DC); -PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC); -PHPAPI char *php_addslashes_ex(char *str, int length, int *new_length, int freeit, int ignore_sybase TSRMLS_DC); -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC); -PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC); -PHPAPI void php_u_stripslashes(UChar *str, int32_t *len TSRMLS_DC); -PHPAPI void php_stripcslashes(char *str, int *len); -PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC); -PHPAPI size_t php_dirname(char *str, size_t len); -PHPAPI UChar *php_u_stristr(UChar *s, UChar *t, int32_t s_len, int32_t t_len); -PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len); -PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle, - int needle_len, char *str, int str_len, int *_new_length, int case_sensitivity, int *replace_count); -PHPAPI char *php_str_to_str(char *haystack, int length, char *needle, - int needle_len, char *str, int str_len, int *_new_length); -PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zend_uchar str_type, zval *return_value, int mode TSRMLS_DC); -PHPAPI int32_t php_u_strip_tags(UChar *rbuf, int32_t len, int *stateptr, UChar *allow, int32_t allow_len TSRMLS_DC); -PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int allow_len); -PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_len, pval *result, int case_sensitivity, int *replace_count); -PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result); -PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value); -PHPAPI void php_explode(char *delim, uint delim_len, char *str, uint str_len, zend_uchar str_type, zval *return_value, int limit); - -PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); -PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end); - -#ifndef HAVE_STRERROR -PHPAPI char *php_strerror(int errnum); -#define strerror php_strerror -#endif - -#ifndef HAVE_MBLEN -# define php_mblen(ptr, len) 1 -#else -# if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T) -# define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state))) -# else -# define php_mblen(ptr, len) mblen(ptr, len) -# endif -#endif - -void register_string_constants(INIT_FUNC_ARGS); - -#endif /* PHP_STRING_H */ diff --git a/ext/standard/php_sunfuncs.h b/ext/standard/php_sunfuncs.h deleted file mode 100644 index 07a3e828a8263..0000000000000 --- a/ext/standard/php_sunfuncs.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Moshe Doron | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SUNFUNCS_H -#define PHP_SUNFUNCS_H - -/* default ini entries: */ -/* Jerusalem one. */ -#define DATE_DEFAULT_LATITUDE "31.7667" -#define DATE_DEFAULT_LONGITUDE "35.2333" - -/* on 90'50; common jewish sunset declaration (start of sun body appear) */ -#define DATE_SUNSET_ZENITH "90.83" - -/* on 90'50; common jewish sunrise declaration (sun body disappeared) */ -#define DATE_SUNRISE_ZENITH "90.83" - -#define SUNFUNCS_RET_TIMESTAMP 0 -#define SUNFUNCS_RET_STRING 1 -#define SUNFUNCS_RET_DOUBLE 2 - -PHP_FUNCTION(date_sunrise); -PHP_FUNCTION(date_sunset); - -#endif /* PHP_SUNFUNCS_H */ diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h deleted file mode 100644 index 07da585fc06ff..0000000000000 --- a/ext/standard/php_type.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_TYPE_H -#define PHP_TYPE_H - -PHP_FUNCTION(intval); -PHP_FUNCTION(floatval); -PHP_FUNCTION(strval); -PHP_FUNCTION(gettype); -PHP_FUNCTION(settype); -PHP_FUNCTION(is_null); -PHP_FUNCTION(is_resource); -PHP_FUNCTION(is_bool); -PHP_FUNCTION(is_long); -PHP_FUNCTION(is_float); -PHP_FUNCTION(is_numeric); -PHP_FUNCTION(is_string); -PHP_FUNCTION(is_unicode); -PHP_FUNCTION(is_binary); -PHP_FUNCTION(is_buffer); -PHP_FUNCTION(is_array); -PHP_FUNCTION(is_object); -PHP_FUNCTION(is_scalar); -PHP_FUNCTION(is_callable); - -#endif diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h deleted file mode 100644 index e2bcdb81abdcd..0000000000000 --- a/ext/standard/php_uuencode.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ilia Alshanetsky | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_UUENCODE_H -#define PHP_UUENCODE_H - -PHP_FUNCTION(convert_uudecode); -PHP_FUNCTION(convert_uuencode); - -PHPAPI int php_uudecode(char *src, int src_len, char **dest); -PHPAPI int php_uuencode(char *src, int src_len, char **dest); - -#endif /* PHP_UUENCODE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h deleted file mode 100644 index a65cb32c9722c..0000000000000 --- a/ext/standard/php_var.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jani Lehtimäki | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_VAR_H -#define PHP_VAR_H - -#include "ext/standard/php_smart_str_public.h" - -PHP_FUNCTION(var_dump); -PHP_FUNCTION(var_inspect); -PHP_FUNCTION(var_export); -PHP_FUNCTION(debug_zval_dump); -PHP_FUNCTION(serialize); -PHP_FUNCTION(unserialize); -#if MEMORY_LIMIT -PHP_FUNCTION(memory_get_usage); -#endif - -PHPAPI void php_var_dump(zval **struc, int level, int verbose TSRMLS_DC); -PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC); -PHPAPI void php_debug_zval_dump(zval **struc, int level, int verbose TSRMLS_DC); - -/* typdef HashTable php_serialize_data_t; */ -#define php_serialize_data_t HashTable - -struct php_unserialize_data { - void *first; - void *first_dtor; -}; - -typedef struct php_unserialize_data php_unserialize_data_t; - -PHPAPI void php_var_serialize(smart_str *buf, zval **struc, php_serialize_data_t *var_hash TSRMLS_DC); -PHPAPI int php_var_unserialize(zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); - -#define PHP_VAR_SERIALIZE_INIT(var_hash) \ - zend_hash_init(&(var_hash), 10, NULL, NULL, 0) -#define PHP_VAR_SERIALIZE_DESTROY(var_hash) \ - zend_hash_destroy(&(var_hash)) - -#define PHP_VAR_UNSERIALIZE_INIT(var_hash) \ - (var_hash).first = 0; \ - (var_hash).first_dtor = 0 -#define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \ - var_destroy(&(var_hash)) - -PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval **nzval); -PHPAPI void var_destroy(php_unserialize_data_t *var_hash); - -#define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \ - var_replace((var_hash), (ozval), &(nzval)) - -PHPAPI zend_class_entry *php_create_empty_class(char *class_name, int len); - -#endif /* PHP_VAR_H */ diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h deleted file mode 100644 index bd8ab7ee77861..0000000000000 --- a/ext/standard/php_versioning.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_VERSIONING_H -#define PHP_VERSIONING_H - -#include "ext/standard/basic_functions.h" - -PHPAPI char *php_canonicalize_version(const char *); -PHPAPI int php_version_compare(const char *, const char *); -PHP_FUNCTION(version_compare); - -#endif diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c deleted file mode 100644 index 991a98835e99b..0000000000000 --- a/ext/standard/proc_open.c +++ /dev/null @@ -1,979 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) -# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ -# define _BSD_COMPAT /* irix: uint */ -# define _XOPEN_SOURCE 500 /* turn on Unix98 */ -# define __EXTENSIONS__ 1 /* Solaris: uint */ -#endif - -#include "php.h" -#include -#include -#include "php_string.h" -#include "safe_mode.h" -#include "ext/standard/head.h" -#include "ext/standard/file.h" -#include "exec.h" -#include "php_globals.h" -#include "SAPI.h" - -#ifdef NETWARE -#include -#include -#endif - -#if HAVE_SYS_WAIT_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif - -#if HAVE_SYS_STAT_H -#include -#endif -#if HAVE_FCNTL_H -#include -#endif - -/* This symbol is defined in ext/standard/config.m4. - * Essentially, it is set if you HAVE_FORK || PHP_WIN32 - * Otherplatforms may modify that configure check and add suitable #ifdefs - * around the alternate code. - * */ -#ifdef PHP_CAN_SUPPORT_PROC_OPEN - -#if 0 && HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H -# include -# include -# define PHP_CAN_DO_PTS 1 -#endif - -#include "proc_open.h" - -static int le_proc_open; - -/* {{{ _php_array_to_envp */ -static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent TSRMLS_DC) -{ - zval **element; - php_process_env_t env; - char *string_key, *data; -#ifndef PHP_WIN32 - char **ep; -#endif - char *p; - uint string_length, cnt, l, sizeenv=0, el_len; - ulong num_key; - HashTable *target_hash; - HashPosition pos; - - memset(&env, 0, sizeof(env)); - - if (!environment) { - return env; - } - - cnt = zend_hash_num_elements(Z_ARRVAL_P(environment)); - - if (cnt < 1) { - return env; - } - - target_hash = HASH_OF(environment); - if (!target_hash) { - return env; - } - - /* first, we have to get the size of all the elements in the hash */ - for (zend_hash_internal_pointer_reset_ex(target_hash, &pos); - zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS; - zend_hash_move_forward_ex(target_hash, &pos)) { - - convert_to_string_ex(element); - el_len = Z_STRLEN_PP(element); - if (el_len == 0) { - continue; - } - - sizeenv += el_len+1; - - switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, &pos)) { - case HASH_KEY_IS_STRING: - if (string_length == 0) { - continue; - } - sizeenv += string_length+1; - break; - } - } - -#ifndef PHP_WIN32 - ep = env.envarray = (char **) pecalloc(cnt + 1, sizeof(char *), is_persistent); -#endif - p = env.envp = (char *) pecalloc(sizeenv + 4, 1, is_persistent); - - for (zend_hash_internal_pointer_reset_ex(target_hash, &pos); - zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS; - zend_hash_move_forward_ex(target_hash, &pos)) { - - convert_to_string_ex(element); - el_len = Z_STRLEN_PP(element); - - if (el_len == 0) { - continue; - } - - data = Z_STRVAL_PP(element); - switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, &pos)) { - case HASH_KEY_IS_STRING: - if (string_length == 0) { - continue; - } - l = string_length + el_len + 1; - memcpy(p, string_key, string_length); - strcat(p, "="); - strcat(p, data); - -#ifndef PHP_WIN32 - *ep = p; - ++ep; -#endif - p += l; - break; - case HASH_KEY_IS_LONG: - memcpy(p,data,el_len); -#ifndef PHP_WIN32 - *ep = p; - ++ep; -#endif - p += el_len + 1; - break; - case HASH_KEY_NON_EXISTANT: - break; - } - } - - assert(p - env.envp <= sizeenv); - - zend_hash_internal_pointer_reset_ex(target_hash, &pos); - - return env; -} -/* }}} */ - -/* {{{ _php_free_envp */ -static void _php_free_envp(php_process_env_t env, int is_persistent) -{ -#ifndef PHP_WIN32 - if (env.envarray) { - pefree(env.envarray, is_persistent); - } -#endif - if (env.envp) { - pefree(env.envp, is_persistent); - } -} -/* }}} */ - -/* {{{ proc_open_rsrc_dtor */ -static void proc_open_rsrc_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - struct php_process_handle *proc = (struct php_process_handle*)rsrc->ptr; - int i; -#ifdef PHP_WIN32 - DWORD wstatus; -#elif HAVE_SYS_WAIT_H - int wstatus; - pid_t wait_pid; -#endif - - /* Close all handles to avoid a deadlock */ - for (i = 0; i < proc->npipes; i++) { - if (proc->pipes[i] != 0) { - zend_list_delete(proc->pipes[i]); - proc->pipes[i] = 0; - } - } - -#ifdef PHP_WIN32 - - WaitForSingleObject(proc->child, INFINITE); - GetExitCodeProcess(proc->child, &wstatus); - FG(pclose_ret) = wstatus; - CloseHandle(proc->child); - -#elif HAVE_SYS_WAIT_H - - do { - wait_pid = waitpid(proc->child, &wstatus, 0); - } while (wait_pid == -1 && errno == EINTR); - - if (wait_pid == -1) - FG(pclose_ret) = -1; - else { - if (WIFEXITED(wstatus)) - wstatus = WEXITSTATUS(wstatus); - FG(pclose_ret) = wstatus; - } - -#else - FG(pclose_ret) = -1; -#endif - _php_free_envp(proc->env, proc->is_persistent); - pefree(proc->command, proc->is_persistent); - pefree(proc, proc->is_persistent); - -} -/* }}} */ - -/* {{{ php_make_safe_mode_command */ -static int php_make_safe_mode_command(char *cmd, char **safecmd, int is_persistent TSRMLS_DC) -{ - int lcmd, larg0, ldir, len, overflow_limit; - char *space, *sep, *arg0; - - if (!PG(safe_mode)) { - *safecmd = pestrdup(cmd, is_persistent); - return SUCCESS; - } - - lcmd = strlen(cmd); - ldir = strlen(PG(safe_mode_exec_dir)); - len = lcmd + ldir + 2; - overflow_limit = len; - - arg0 = emalloc(len); - - strcpy(arg0, cmd); - - space = strchr(arg0, ' '); - if (space) { - *space = '\0'; - } - larg0 = strlen(arg0); - - if (strstr(arg0, "..")) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No '..' components allowed in path"); - efree(arg0); - return FAILURE; - } - - *safecmd = emalloc(len); - strcpy(*safecmd, PG(safe_mode_exec_dir)); - overflow_limit -= ldir; - - sep = strrchr(arg0, PHP_DIR_SEPARATOR); - if (sep) { - strcat(*safecmd, sep); - overflow_limit -= strlen(sep); - } else { - strcat(*safecmd, "/"); - strcat(*safecmd, arg0); - overflow_limit -= larg0 + 1; - } - if (space) { - strncat(*safecmd, cmd + larg0, overflow_limit); - } - efree(arg0); - arg0 = php_escape_shell_cmd(*safecmd); - efree(*safecmd); - if (is_persistent) { - *safecmd = pestrdup(arg0, 1); - efree(arg0); - } else { - *safecmd = arg0; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(proc_open) */ -PHP_MINIT_FUNCTION(proc_open) -{ - le_proc_open = zend_register_list_destructors_ex(proc_open_rsrc_dtor, NULL, "process", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ proto int proc_terminate(resource process [, long signal]) - kill a process opened by proc_open */ -PHP_FUNCTION(proc_terminate) -{ - zval *zproc; - struct php_process_handle *proc; - long sig_no = SIGTERM; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zproc, &sig_no) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", le_proc_open); - -#ifdef PHP_WIN32 - TerminateProcess(proc->child, 255); -#else - kill(proc->child, sig_no); -#endif - - zend_list_delete(Z_LVAL_P(zproc)); - RETURN_LONG(FG(pclose_ret)); -} -/* }}} */ - -/* {{{ proto int proc_close(resource process) - close a process opened by proc_open */ -PHP_FUNCTION(proc_close) -{ - zval *zproc; - struct php_process_handle *proc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", le_proc_open); - - zend_list_delete(Z_LVAL_P(zproc)); - RETURN_LONG(FG(pclose_ret)); -} -/* }}} */ - -/* {{{ proto array proc_get_status(resource process) - get information about a process opened by proc_open */ -PHP_FUNCTION(proc_get_status) -{ - zval *zproc; - struct php_process_handle *proc; -#ifdef PHP_WIN32 - DWORD wstatus; -#elif HAVE_SYS_WAIT_H - int wstatus; - pid_t wait_pid; -#endif - int running = 1, signaled = 0, stopped = 0; - int exitcode = -1, termsig = 0, stopsig = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", le_proc_open); - - array_init(return_value); - - add_assoc_string(return_value, "command", proc->command, 1); - add_assoc_long(return_value, "pid", (long) proc->child); - -#ifdef PHP_WIN32 - - GetExitCodeProcess(proc->child, &wstatus); - - running = wstatus == STILL_ACTIVE; - exitcode == STILL_ACTIVE ? -1 : wstatus; - -#elif HAVE_SYS_WAIT_H - - errno = 0; - wait_pid = waitpid(proc->child, &wstatus, WNOHANG|WUNTRACED); - - if (wait_pid == proc->child) { - if (WIFEXITED(wstatus)) { - running = 0; - exitcode = WEXITSTATUS(wstatus); - } - if (WIFSIGNALED(wstatus)) { - running = 0; - signaled = 1; -#ifdef NETWARE - termsig = WIFTERMSIG(wstatus); -#else - termsig = WTERMSIG(wstatus); -#endif - } - if (WIFSTOPPED(wstatus)) { - stopped = 1; - stopsig = WSTOPSIG(wstatus); - } - } else if (wait_pid == -1) { - running = 0; - } -#endif - - add_assoc_bool(return_value, "running", running); - add_assoc_bool(return_value, "signaled", signaled); - add_assoc_bool(return_value, "stopped", stopped); - add_assoc_long(return_value, "exitcode", exitcode); - add_assoc_long(return_value, "termsig", termsig); - add_assoc_long(return_value, "stopsig", stopsig); -} -/* }}} */ - -/* {{{ handy definitions for portability/readability */ -#ifdef PHP_WIN32 -# define pipe(pair) (CreatePipe(&pair[0], &pair[1], &security, 2048L) ? 0 : -1) - -# define COMSPEC_NT "cmd.exe" -# define COMSPEC_9X "command.com" - -static inline HANDLE dup_handle(HANDLE src, BOOL inherit, BOOL closeorig) -{ - HANDLE copy, self = GetCurrentProcess(); - - if (!DuplicateHandle(self, src, self, ©, 0, inherit, DUPLICATE_SAME_ACCESS | - (closeorig ? DUPLICATE_CLOSE_SOURCE : 0))) - return NULL; - return copy; -} - -static inline HANDLE dup_fd_as_handle(int fd) -{ - return dup_handle((HANDLE)_get_osfhandle(fd), TRUE, FALSE); -} - -# define close_descriptor(fd) CloseHandle(fd) -#else -# define close_descriptor(fd) close(fd) -#endif - -#define DESC_PIPE 1 -#define DESC_FILE 2 -#define DESC_PARENT_MODE_WRITE 8 - -struct php_proc_open_descriptor_item { - int index; /* desired fd number in child process */ - php_file_descriptor_t parentend, childend; /* fds for pipes in parent/child */ - int mode; /* mode for proc_open code */ - int mode_flags; /* mode flags for opening fds */ -}; -/* }}} */ - -/* {{{ proto resource proc_open(string command, array descriptorspec, array &pipes [, string cwd [, array env [, array other_options]]]) - Run a process with more control over it's file descriptors */ -PHP_FUNCTION(proc_open) -{ - char *command, *cwd=NULL; - int command_len, cwd_len; - zval *descriptorspec; - zval *pipes; - zval *environment = NULL; - zval *other_options = NULL; - php_process_env_t env; - int ndesc = 0; - int i; - zval **descitem = NULL; - HashPosition pos; - struct php_proc_open_descriptor_item descriptors[PHP_PROC_OPEN_MAX_DESCRIPTORS]; -#ifdef PHP_WIN32 - PROCESS_INFORMATION pi; - STARTUPINFO si; - BOOL newprocok; - SECURITY_ATTRIBUTES security; - char *command_with_cmd; - UINT old_error_mode; -#endif -#ifdef NETWARE - char** child_argv = NULL; - char* command_dup = NULL; - char* orig_cwd = NULL; - int command_num_args = 0; - wiring_t channel; -#endif - php_process_id_t child; - struct php_process_handle *proc; - int is_persistent = 0; /* TODO: ensure that persistent procs will work */ - int suppress_errors = 0; -#if PHP_CAN_DO_PTS - php_file_descriptor_t dev_ptmx = -1; /* master */ - php_file_descriptor_t slave_pty = -1; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz|s!a!a!", &command, - &command_len, &descriptorspec, &pipes, &cwd, &cwd_len, &environment, - &other_options) == FAILURE) { - RETURN_FALSE; - } - - if (FAILURE == php_make_safe_mode_command(command, &command, is_persistent TSRMLS_CC)) { - RETURN_FALSE; - } - - if (other_options) { - zval **item; - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) { - if (Z_TYPE_PP(item) == IS_BOOL && Z_BVAL_PP(item)) { - suppress_errors = 1; - } - } - } - - command_len = strlen(command); - - if (environment) { - env = _php_array_to_envp(environment, is_persistent TSRMLS_CC); - } else { - memset(&env, 0, sizeof(env)); - } - - memset(descriptors, 0, sizeof(descriptors)); - -#ifdef PHP_WIN32 - /* we use this to allow the child to inherit handles */ - memset(&security, 0, sizeof(security)); - security.nLength = sizeof(security); - security.bInheritHandle = TRUE; - security.lpSecurityDescriptor = NULL; -#endif - - /* walk the descriptor spec and set up files/pipes */ - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(descriptorspec), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(descriptorspec), (void **)&descitem, &pos) == SUCCESS) { - char *str_index; - ulong nindex; - zval **ztype; - - str_index = NULL; - zend_hash_get_current_key_ex(Z_ARRVAL_P(descriptorspec), &str_index, NULL, &nindex, 0, &pos); - - if (str_index) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor spec must be an integer indexed array"); - goto exit_fail; - } - - descriptors[ndesc].index = nindex; - - if (Z_TYPE_PP(descitem) == IS_RESOURCE) { - /* should be a stream - try and dup the descriptor */ - php_stream *stream; - int fd; - - php_stream_from_zval(stream, descitem); - - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, REPORT_ERRORS)) { - goto exit_fail; - } - -#ifdef PHP_WIN32 - descriptors[ndesc].childend = dup_fd_as_handle(fd); - if (descriptors[ndesc].childend == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex); - goto exit_fail; - } -#else - descriptors[ndesc].childend = dup(fd); - if (descriptors[ndesc].childend < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %ld - %s", nindex, strerror(errno)); - goto exit_fail; - } -#endif - descriptors[ndesc].mode = DESC_FILE; - - } else if (Z_TYPE_PP(descitem) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor item must be either an array or a File-Handle"); - goto exit_fail; - } else { - - if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 0, (void **)&ztype) == SUCCESS) { - convert_to_string_ex(ztype); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing handle qualifier in array"); - goto exit_fail; - } - - if (strcmp(Z_STRVAL_PP(ztype), "pipe") == 0) { - php_file_descriptor_t newpipe[2]; - zval **zmode; - - if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zmode) == SUCCESS) { - convert_to_string_ex(zmode); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'"); - goto exit_fail; - } - - descriptors[ndesc].mode = DESC_PIPE; - - if (0 != pipe(newpipe)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create pipe %s", strerror(errno)); - goto exit_fail; - } - - if (strcmp(Z_STRVAL_PP(zmode), "w") != 0) { - descriptors[ndesc].parentend = newpipe[1]; - descriptors[ndesc].childend = newpipe[0]; - descriptors[ndesc].mode |= DESC_PARENT_MODE_WRITE; - } else { - descriptors[ndesc].parentend = newpipe[0]; - descriptors[ndesc].childend = newpipe[1]; - } -#ifdef PHP_WIN32 - /* don't let the child inherit the parent side of the pipe */ - descriptors[ndesc].parentend = dup_handle(descriptors[ndesc].parentend, FALSE, TRUE); -#endif - descriptors[ndesc].mode_flags = descriptors[ndesc].mode & DESC_PARENT_MODE_WRITE ? O_WRONLY : O_RDONLY; -#ifdef PHP_WIN32 - if (Z_STRLEN_PP(zmode) >= 2 && Z_STRVAL_PP(zmode)[1] == 'b') - descriptors[ndesc].mode_flags |= O_BINARY; -#endif - - - - } else if (strcmp(Z_STRVAL_PP(ztype), "file") == 0) { - zval **zfile, **zmode; - int fd; - php_stream *stream; - - descriptors[ndesc].mode = DESC_FILE; - - if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zfile) == SUCCESS) { - convert_to_string_ex(zfile); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'"); - goto exit_fail; - } - - if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 2, (void **)&zmode) == SUCCESS) { - convert_to_string_ex(zmode); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'"); - goto exit_fail; - } - - /* try a wrapper */ - stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), Z_STRVAL_PP(zmode), - ENFORCE_SAFE_MODE|REPORT_ERRORS|STREAM_WILL_CAST, NULL); - - /* force into an fd */ - if (stream == NULL || FAILURE == php_stream_cast(stream, - PHP_STREAM_CAST_RELEASE|PHP_STREAM_AS_FD, - (void **)&fd, REPORT_ERRORS)) { - goto exit_fail; - } - -#ifdef PHP_WIN32 - descriptors[ndesc].childend = (HANDLE)_get_osfhandle(fd); -#else - descriptors[ndesc].childend = fd; -#endif - } else if (strcmp(Z_STRVAL_PP(ztype), "pty") == 0) { -#if PHP_CAN_DO_PTS - if (dev_ptmx == -1) { - /* open things up */ - dev_ptmx = open("/dev/ptmx", O_RDWR); - if (dev_ptmx == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open /dev/ptmx, errno %d", errno); - goto exit_fail; - } - grantpt(dev_ptmx); - unlockpt(dev_ptmx); - slave_pty = open(ptsname(dev_ptmx), O_RDWR); - - if (slave_pty == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open slave pty, errno %d", errno); - goto exit_fail; - } - } - descriptors[ndesc].mode = DESC_PIPE; - descriptors[ndesc].childend = dup(slave_pty); - descriptors[ndesc].parentend = dup(dev_ptmx); - descriptors[ndesc].mode_flags = O_RDWR; -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal not supported on this system"); - goto exit_fail; -#endif - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_PP(ztype)); - goto exit_fail; - } - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(descriptorspec), &pos); - if (++ndesc == PHP_PROC_OPEN_MAX_DESCRIPTORS) - break; - } - -#ifdef PHP_WIN32 - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - si.dwFlags = STARTF_USESTDHANDLES; - - si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - si.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - /* redirect stdin/stdout/stderr if requested */ - for (i = 0; i < ndesc; i++) { - switch(descriptors[i].index) { - case 0: - si.hStdInput = descriptors[i].childend; - break; - case 1: - si.hStdOutput = descriptors[i].childend; - break; - case 2: - si.hStdError = descriptors[i].childend; - break; - } - } - - - memset(&pi, 0, sizeof(pi)); - - command_with_cmd = emalloc(command_len + sizeof(COMSPEC_9X) + 1 + sizeof(" /c ")); - sprintf(command_with_cmd, "%s /c %s", GetVersion() < 0x80000000 ? COMSPEC_NT : COMSPEC_9X, command); - - if (suppress_errors) { - old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX); - } - - newprocok = CreateProcess(NULL, command_with_cmd, &security, &security, TRUE, NORMAL_PRIORITY_CLASS, env.envp, cwd, &si, &pi); - - if (suppress_errors) { - SetErrorMode(old_error_mode); - } - - efree(command_with_cmd); - - if (FALSE == newprocok) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed"); - goto exit_fail; - } - - child = pi.hProcess; - CloseHandle(pi.hThread); - -#elif defined(NETWARE) - if (cwd) { - orig_cwd = getcwd(NULL, PATH_MAX); - chdir2(cwd); - } - channel.infd = descriptors[0].childend; - channel.outfd = descriptors[1].childend; - channel.errfd = -1; - /* Duplicate the command as processing downwards will modify it*/ - command_dup = strdup(command); - /* get a number of args */ - construct_argc_argv(command_dup, NULL, &command_num_args, NULL); - child_argv = (char**) malloc((command_num_args + 1) * sizeof(char*)); - if(!child_argv) { - free(command_dup); - if (cwd && orig_cwd) { - chdir2(orig_cwd); - free(orig_cwd); - } - } - /* fill the child arg vector */ - construct_argc_argv(command_dup, NULL, &command_num_args, child_argv); - child_argv[command_num_args] = NULL; - child = procve(child_argv[0], PROC_DETACHED|PROC_INHERIT_CWD, NULL, &channel, NULL, NULL, 0, NULL, (const char**)child_argv); - free(child_argv); - free(command_dup); - if (cwd && orig_cwd) { - chdir2(orig_cwd); - free(orig_cwd); - } - if (child < 0) { - /* failed to fork() */ - /* clean up all the descriptors */ - for (i = 0; i < ndesc; i++) { - close(descriptors[i].childend); - close(descriptors[i].parentend); - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "procve failed - %s", strerror(errno)); - goto exit_fail; - } -#elif HAVE_FORK - /* the unix way */ - child = fork(); - - if (child == 0) { - /* this is the child process */ - -#if PHP_CAN_DO_PTS - if (dev_ptmx >= 0) { - int my_pid = getpid(); - -#ifdef TIOCNOTTY - /* detach from original tty. Might only need this if isatty(0) is true */ - ioctl(0,TIOCNOTTY,NULL); -#else - setsid(); -#endif - /* become process group leader */ - setpgid(my_pid, my_pid); - tcsetpgrp(0, my_pid); - } -#endif - - /* close those descriptors that we just opened for the parent stuff, - * dup new descriptors into required descriptors and close the original - * cruft */ - for (i = 0; i < ndesc; i++) { - switch (descriptors[i].mode & ~DESC_PARENT_MODE_WRITE) { - case DESC_PIPE: - close(descriptors[i].parentend); - break; - } - if (dup2(descriptors[i].childend, descriptors[i].index) < 0) - perror("dup2"); - if (descriptors[i].childend != descriptors[i].index) - close(descriptors[i].childend); - } - -#if PHP_CAN_DO_PTS - if (dev_ptmx >= 0) { - close(dev_ptmx); - close(slave_pty); - } -#endif - - if (cwd) { - chdir(cwd); - } - - if (env.envarray) { - execle("/bin/sh", "sh", "-c", command, NULL, env.envarray); - } else { - execl("/bin/sh", "sh", "-c", command, NULL); - } - _exit(127); - - } else if (child < 0) { - /* failed to fork() */ - - /* clean up all the descriptors */ - for (i = 0; i < ndesc; i++) { - close(descriptors[i].childend); - close(descriptors[i].parentend); - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", strerror(errno)); - - goto exit_fail; - - } -#else -# error You lose (configure should not have let you get here) -#endif - /* we forked/spawned and this is the parent */ - - proc = (struct php_process_handle*)pemalloc(sizeof(struct php_process_handle), is_persistent); - proc->is_persistent = is_persistent; - proc->command = command; - proc->npipes = ndesc; - proc->child = child; - proc->env = env; - - if (pipes != NULL) { - zval_dtor(pipes); - } - array_init(pipes); - -#if PHP_CAN_DO_PTS - if (dev_ptmx >= 0) { - close(dev_ptmx); - close(slave_pty); - } -#endif - - /* clean up all the child ends and then open streams on the parent - * ends, where appropriate */ - for (i = 0; i < ndesc; i++) { - char *mode_string=NULL; - php_stream *stream = NULL; - - close_descriptor(descriptors[i].childend); - - switch (descriptors[i].mode & ~DESC_PARENT_MODE_WRITE) { - case DESC_PIPE: - switch(descriptors[i].mode_flags) { -#ifdef PHP_WIN32 - case O_WRONLY|O_BINARY: - mode_string = "wb"; - break; - case O_RDONLY|O_BINARY: - mode_string = "rb"; - break; -#endif - case O_WRONLY: - mode_string = "w"; - break; - case O_RDONLY: - mode_string = "r"; - break; - case O_RDWR: - mode_string = "r+"; - break; - } -#ifdef PHP_WIN32 - stream = php_stream_fopen_from_fd(_open_osfhandle((long)descriptors[i].parentend, - descriptors[i].mode_flags), mode_string, NULL); -#else - stream = php_stream_fopen_from_fd(descriptors[i].parentend, mode_string, NULL); -#endif - if (stream) { - zval *retfp; - - /* nasty hack; don't copy it */ - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - - MAKE_STD_ZVAL(retfp); - php_stream_to_zval(stream, retfp); - add_index_zval(pipes, descriptors[i].index, retfp); - - proc->pipes[i] = Z_LVAL_P(retfp); - } - break; - default: - proc->pipes[i] = 0; - } - } - - ZEND_REGISTER_RESOURCE(return_value, proc, le_proc_open); - return; - -exit_fail: - _php_free_envp(env, is_persistent); - pefree(command, is_persistent); -#if PHP_CAN_DO_PTS - if (dev_ptmx >= 0) { - close(dev_ptmx); - } - if (slave_pty >= 0) { - close(slave_pty); - } -#endif - RETURN_FALSE; - -} -/* }}} */ - -#endif /* PHP_CAN_SUPPORT_PROC_OPEN */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h deleted file mode 100644 index 7b8d1823c6fe7..0000000000000 --- a/ext/standard/proc_open.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef PHP_WIN32 -typedef HANDLE php_file_descriptor_t; -typedef HANDLE php_process_id_t; -#else -typedef int php_file_descriptor_t; -typedef pid_t php_process_id_t; -#endif - -#define PHP_PROC_OPEN_MAX_DESCRIPTORS 16 - -/* Environment block under win32 is a NUL terminated sequence of NUL terminated - * name=value strings. - * Under unix, it is an argv style array. - * */ -typedef struct _php_process_env { - char *envp; -#ifndef PHP_WIN32 - char **envarray; -#endif -} php_process_env_t; - -struct php_process_handle { - php_process_id_t child; - int npipes; - long pipes[PHP_PROC_OPEN_MAX_DESCRIPTORS]; - char *command; - int is_persistent; - php_process_env_t env; -}; - diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c deleted file mode 100644 index 77a1b53fc9cd7..0000000000000 --- a/ext/standard/quot_print.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kirill Maximov | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include - -#include "php.h" -#include "quot_print.h" - -#include - -/* -* Converting HEX char to INT value -*/ -static char php_hex2int(int c) -{ - if (isdigit(c)) { - return c - '0'; - } - else if (c >= 'A' && c <= 'F') { - return c - 'A' + 10; - } - else if (c >= 'a' && c <= 'f') { - return c - 'a' + 10; - } - else { - return -1; - } -} - -PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws) -{ - register unsigned int i; - register unsigned const char *p1; - register unsigned char *p2; - register unsigned int h_nbl, l_nbl; - - size_t decoded_len, buf_size; - unsigned char *retval; - - static unsigned int hexval_tbl[256] = { - 64, 64, 64, 64, 64, 64, 64, 64, 64, 32, 16, 64, 64, 16, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 32, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 64, 64, 64, 64, 64, - 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 - }; - - if (replace_us_by_ws) { - replace_us_by_ws = '_'; - } - - i = length, p1 = str; buf_size = length; - - while (i > 1 && *p1 != '\0') { - if (*p1 == '=') { - buf_size -= 2; - p1++; - i--; - } - p1++; - i--; - } - - retval = emalloc(buf_size + 1); - i = length; p1 = str; p2 = retval; - decoded_len = 0; - - while (i > 0 && *p1 != '\0') { - if (*p1 == '=') { - i--, p1++; - if (i == 0 || *p1 == '\0') { - break; - } - h_nbl = hexval_tbl[*p1]; - if (h_nbl < 16) { - /* next char should be a hexadecimal digit */ - if ((--i) == 0 || (l_nbl = hexval_tbl[*(++p1)]) >= 16) { - efree(retval); - return NULL; - } - *(p2++) = (h_nbl << 4) | l_nbl, decoded_len++; - i--, p1++; - } else if (h_nbl < 64) { - /* soft line break */ - while (h_nbl == 32) { - if (--i == 0 || (h_nbl = hexval_tbl[*(++p1)]) == 64) { - efree(retval); - return NULL; - } - } - if (p1[0] == '\r' && i >= 2 && p1[1] == '\n') { - i--, p1++; - } - i--, p1++; - } else { - efree(retval); - return NULL; - } - } else { - *(p2++) = (replace_us_by_ws == *p1 ? '\x20': *p1); - i--, p1++, decoded_len++; - } - } - - *p2 = '\0'; - *ret_length = decoded_len; - return retval; -} - - -/* -* -* Decoding Quoted-printable string. -* -*/ -/* {{{ proto string quoted_printable_decode(string str) - Convert a quoted-printable string to an 8 bit string */ -PHP_FUNCTION(quoted_printable_decode) -{ - pval **arg1; - char *str_in, *str_out; - int i = 0, j = 0, k; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg1); - - if (Z_STRLEN_PP(arg1) == 0) { - /* shortcut */ - RETURN_EMPTY_STRING(); - } - - str_in = Z_STRVAL_PP(arg1); - str_out = emalloc(Z_STRLEN_PP(arg1) + 1); - while (str_in[i]) { - switch (str_in[i]) { - case '=': - if (str_in[i + 1] && str_in[i + 2] && - isxdigit((int) str_in[i + 1]) && - isxdigit((int) str_in[i + 2])) - { - str_out[j++] = (php_hex2int((int) str_in[i + 1]) << 4) - + php_hex2int((int) str_in[i + 2]); - i += 3; - } else /* check for soft line break according to RFC 2045*/ { - k = 1; - while (str_in[i + k] && ((str_in[i + k] == 32) || (str_in[i + k] == 9))) { - /* Possibly, skip spaces/tabs at the end of line */ - k++; - } - if (!str_in[i + k]) { - /* End of line reached */ - i += k; - } - else if ((str_in[i + k] == 13) && (str_in[i + k + 1] == 10)) { - /* CRLF */ - i += k + 2; - } - else if ((str_in[i + k] == 13) || (str_in[i + k] == 10)) { - /* CR or LF */ - i += k + 1; - } - else { - str_out[j++] = str_in[i++]; - } - } - break; - default: - str_out[j++] = str_in[i++]; - } - } - str_out[j] = '\0'; - - RETVAL_STRINGL(str_out, j, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h deleted file mode 100644 index d7beb35663150..0000000000000 --- a/ext/standard/quot_print.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Kirill Maximov (kir@rus.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef QUOT_PRINT_H -#define QUOT_PRINT_H - -PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws); - -PHP_FUNCTION(quoted_printable_decode); - -#endif /* QUOT_PRINT_H */ diff --git a/ext/standard/rand.c b/ext/standard/rand.c deleted file mode 100644 index 05534b55469de..0000000000000 --- a/ext/standard/rand.c +++ /dev/null @@ -1,403 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Zeev Suraski | - | Pedro Melo | - | Sterling Hughes | - | | - | Based on code from: Shawn Cokus | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include - -#include "php.h" -#include "php_math.h" -#include "php_rand.h" -#include "php_lcg.h" - -#include "basic_functions.h" - - -/* SYSTEM RAND FUNCTIONS */ - -/* {{{ php_srand - */ -PHPAPI void php_srand(long seed TSRMLS_DC) -{ -#ifdef ZTS - BG(rand_seed) = (unsigned int) seed; -#else -# if defined(HAVE_SRANDOM) - srandom((unsigned int) seed); -# elif defined(HAVE_SRAND48) - srand48(seed); -# else - srand((unsigned int) seed); -# endif -#endif - - /* Seed only once */ - BG(rand_is_seeded) = 1; -} -/* }}} */ - -/* {{{ php_rand - */ -PHPAPI long php_rand(TSRMLS_D) -{ - long ret; - - if (!BG(rand_is_seeded)) { - php_srand(GENERATE_SEED() TSRMLS_CC); - } - -#ifdef ZTS - ret = php_rand_r(&BG(rand_seed)); -#else -# if defined(HAVE_RANDOM) - ret = random(); -# elif defined(HAVE_LRAND48) - ret = lrand48(); -# else - ret = rand(); -# endif -#endif - - return ret; -} -/* }}} */ - - -/* MT RAND FUNCTIONS */ - -/* - This is the ``Mersenne Twister'' random number generator MT19937, which - generates pseudorandom integers uniformly distributed in 0..(2^32 - 1) - starting from any odd seed in 0..(2^32 - 1). This version is a recode - by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by - Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in - July-August 1997). - - Effectiveness of the recoding (on Goedel2.math.washington.edu, a DEC Alpha - running OSF/1) using GCC -O3 as a compiler: before recoding: 51.6 sec. to - generate 300 million random numbers; after recoding: 24.0 sec. for the same - (i.e., 46.5% of original time), so speed is now about 12.5 million random - number generations per second on this machine. - - According to the URL - (and paraphrasing a bit in places), the Mersenne Twister is ``designed - with consideration of the flaws of various existing generators,'' has - a period of 2^19937 - 1, gives a sequence that is 623-dimensionally - equidistributed, and ``has passed many stringent tests, including the - die-hard test of G. Marsaglia and the load test of P. Hellekalek and - S. Wegenkittl.'' It is efficient in memory usage (typically using 2506 - to 5012 bytes of static data, depending on data type sizes, and the code - is quite short as well). It generates random numbers in batches of 624 - at a time, so the caching and pipelining of modern systems is exploited. - It is also divide- and mod-free. - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation (either version 2 of the License or, at your - option, any later version). This library 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 Library General Public License for more details. You should have - received a copy of the GNU Library General Public License along with this - library; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307, USA. - - The code as Shawn received it included the following notice: - - Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. When - you use this, send an e-mail to with - an appropriate reference to your work. - - It would be nice to CC: when you write. - - - - php_uint32 must be an unsigned integer type capable of holding at least 32 - bits; exactly 32 should be fastest, but 64 is better on an Alpha with - GCC at -O3 optimization so try your options and see what's best for you - - Melo: we should put some ifdefs here to catch those alphas... -*/ -#define N MT_N /* length of state vector */ -#define M (397) /* a period parameter */ -#define K (0x9908B0DFU) /* a magic constant */ -#define hiBit(u) ((u) & 0x80000000U) /* mask all but highest bit of u */ -#define loBit(u) ((u) & 0x00000001U) /* mask all but lowest bit of u */ -#define loBits(u) ((u) & 0x7FFFFFFFU) /* mask the highest bit of u */ -#define mixBits(u, v) (hiBit(u)|loBits(v)) /* move hi bit of u to hi bit of v */ - -/* {{{ php_mt_srand - */ -PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC) -{ - /* - We initialize state[0..(N-1)] via the generator - - x_new = (69069 * x_old) mod 2^32 - - from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's - _The Art of Computer Programming_, Volume 2, 3rd ed. - - Notes (SJC): I do not know what the initial state requirements - of the Mersenne Twister are, but it seems this seeding generator - could be better. It achieves the maximum period for its modulus - (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if - x_initial can be even, you have sequences like 0, 0, 0, ...; - 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31, - 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below. - - - Even if x_initial is odd, if x_initial is 1 mod 4 then - - the lowest bit of x is always 1, - the next-to-lowest bit of x is always 0, - the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... , - the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... , - the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... , - ... - - and if x_initial is 3 mod 4 then - - the lowest bit of x is always 1, - the next-to-lowest bit of x is always 1, - the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... , - the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... , - the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... , - ... - - The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is - 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It - also does well in the dimension 2..5 spectral tests, but it could be - better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth). - - Note that the random number user does not see the values generated - here directly since reloadMT() will always munge them first, so maybe - none of all of this matters. In fact, the seed values made here could - even be extra-special desirable if the Mersenne Twister theory says - so-- that's why the only change I made is to restrict to odd seeds. - */ - - register php_uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = BG(state); - register int j; - - for (BG(left) = 0, *s++ = x, j = N; --j; - *s++ = (x *= 69069U) & 0xFFFFFFFFU); - - /* Seed only once */ - BG(mt_rand_is_seeded) = 1; -} -/* }}} */ - -/* {{{ php_mt_reload - */ -static php_uint32 php_mt_reload(TSRMLS_D) -{ - register php_uint32 *p0 = BG(state), *p2 = BG(state) + 2, *pM = BG(state) + M, s0, s1; - register int j; - - if (BG(left) < -1) - php_mt_srand(4357U TSRMLS_CC); - - BG(left) = N - 1, BG(next) = BG(state) + 1; - - for (s0 = BG(state)[0], s1 = BG(state)[1], j = N - M + 1; --j; s0 = s1, s1 = *p2++) - *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); - - for (pM = BG(state), j = M; --j; s0 = s1, s1 = *p2++) - *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); - - s1 = BG(state)[0], *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); - s1 ^= (s1 >> 11); - s1 ^= (s1 << 7) & 0x9D2C5680U; - s1 ^= (s1 << 15) & 0xEFC60000U; - - return s1 ^ (s1 >> 18); -} -/* }}} */ - -/* {{{ php_mt_rand - */ -PHPAPI php_uint32 php_mt_rand(TSRMLS_D) -{ - php_uint32 y; - - if (--BG(left) < 0) - return php_mt_reload(TSRMLS_C); - - y = *BG(next)++; - y ^= (y >> 11); - y ^= (y << 7) & 0x9D2C5680U; - y ^= (y << 15) & 0xEFC60000U; - - return y ^ (y >> 18); -} -/* }}} */ - -/* {{{ proto void srand([int seed]) - Seeds random number generator */ -PHP_FUNCTION(srand) -{ - long seed; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) - return; - - if (ZEND_NUM_ARGS() == 0) - seed = GENERATE_SEED(); - - php_srand(seed TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto void mt_srand([int seed]) - Seeds Mersenne Twister random number generator */ -PHP_FUNCTION(mt_srand) -{ - long seed; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE) - return; - - if (ZEND_NUM_ARGS() == 0) - seed = GENERATE_SEED(); - - php_mt_srand(seed TSRMLS_CC); -} -/* }}} */ - - -/* - * A bit of tricky math here. We want to avoid using a modulus because - * that simply tosses the high-order bits and might skew the distribution - * of random values over the range. Instead we map the range directly. - * - * We need to map the range from 0...M evenly to the range a...b - * Let n = the random number and n' = the mapped random number - * - * Then we have: n' = a + n(b-a)/M - * - * We have a problem here in that only n==M will get mapped to b which - # means the chances of getting b is much much less than getting any of - # the other values in the range. We can fix this by increasing our range - # artifically and using: - # - # n' = a + n(b-a+1)/M - * - # Now we only have a problem if n==M which would cause us to produce a - # number of b+1 which would be bad. So we bump M up by one to make sure - # this will never happen, and the final algorithm looks like this: - # - # n' = a + n(b-a+1)/(M+1) - * - * -RL - */ - -/* {{{ proto int rand([int min, int max]) - Returns a random number */ -PHP_FUNCTION(rand) -{ - long min; - long max; - long number; - int argc = ZEND_NUM_ARGS(); - - if (argc != 0 && zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) - return; - - number = php_rand(TSRMLS_C); - if (argc == 2) { - RAND_RANGE(number, min, max, PHP_RAND_MAX); - } - - RETURN_LONG(number); -} -/* }}} */ - -/* {{{ proto int mt_rand([int min, int max]) - Returns a random number from Mersenne Twister */ -PHP_FUNCTION(mt_rand) -{ - long min; - long max; - long number; - int argc = ZEND_NUM_ARGS(); - - if (argc != 0 && zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) - return; - - if (!BG(mt_rand_is_seeded)) { - php_mt_srand(GENERATE_SEED() TSRMLS_CC); - } - - /* - * Melo: hmms.. randomMT() returns 32 random bits... - * Yet, the previous php_rand only returns 31 at most. - * So I put a right shift to loose the lsb. It *seems* - * better than clearing the msb. - * Update: - * I talked with Cokus via email and it won't ruin the algorithm - */ - number = (long) (php_mt_rand(TSRMLS_C) >> 1); - if (argc == 2) { - RAND_RANGE(number, min, max, PHP_MT_RAND_MAX); - } - - RETURN_LONG(number); -} -/* }}} */ - -/* {{{ proto int getrandmax(void) - Returns the maximum value a random number can have */ -PHP_FUNCTION(getrandmax) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_LONG(PHP_RAND_MAX); -} -/* }}} */ - -/* {{{ proto int mt_getrandmax(void) - Returns the maximum value a random number from Mersenne Twister can have */ -PHP_FUNCTION(mt_getrandmax) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - /* - * Melo: it could be 2^^32 but we only use 2^^31 to maintain - * compatibility with the previous php_rand - */ - RETURN_LONG(PHP_MT_RAND_MAX); /* 2^^31 */ -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/reg.c b/ext/standard/reg.c deleted file mode 100644 index 0b87b184165ff..0000000000000 --- a/ext/standard/reg.c +++ /dev/null @@ -1,668 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jim Winstead | - | Jaakko Hyvätti | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include -#include "php.h" -#include "php_string.h" -#include "reg.h" -#include "ext/standard/info.h" - -ZEND_DECLARE_MODULE_GLOBALS(reg) - -typedef struct { - regex_t preg; - int cflags; -} reg_cache; - -static int reg_magic = 0; - -/* {{{ _php_regcomp - */ -static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) -{ - int r = 0; - int patlen = strlen(pattern); - reg_cache *rc = NULL; - TSRMLS_FETCH(); - - if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == SUCCESS - && rc->cflags == cflags) { -#ifdef HAVE_REGEX_T_RE_MAGIC - /* - * We use a saved magic number to see whether cache is corrupted, and if it - * is, we flush it and compile the pattern from scratch. - */ - if (rc->preg.re_magic != reg_magic) { - zend_hash_clean(®(ht_rc)); - } else { - memcpy(preg, &rc->preg, sizeof(*preg)); - return r; - } - } - - r = regcomp(preg, pattern, cflags); - if(!r) { - reg_cache rcp; - - rcp.cflags = cflags; - memcpy(&rcp.preg, preg, sizeof(*preg)); - /* - * Since we don't have access to the actual MAGIC1 definition in the private - * header file, we save the magic value immediately after compilation. Hopefully, - * it's good. - */ - if (!reg_magic) reg_magic = preg->re_magic; - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, - (void *) &rcp, sizeof(rcp), NULL); - } -#else - memcpy(preg, &rc->preg, sizeof(*preg)); - } else { - r = regcomp(preg, pattern, cflags); - if(!r) { - reg_cache rcp; - - rcp.cflags = cflags; - memcpy(&rcp.preg, preg, sizeof(*preg)); - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, - (void *) &rcp, sizeof(rcp), NULL); - } - } -#endif - return r; -} -/* }}} */ - -static void _free_reg_cache(reg_cache *rc) -{ - regfree(&rc->preg); -} - -#undef regfree -#define regfree(a); -#undef regcomp -#define regcomp(a, b, c) _php_regcomp(a, b, c) - -static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC) -{ - zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); -} - -static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC) -{ - zend_hash_destroy(®_globals->ht_rc); -} - -PHP_MINIT_FUNCTION(regex) -{ - ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(regex) -{ -#ifndef ZTS - php_reg_destroy_globals(®_globals TSRMLS_CC); -#endif - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(regex) -{ -#if HSREGEX - php_info_print_table_row(2, "Regex Library", "Bundled library enabled"); -#else - php_info_print_table_row(2, "Regex Library", "System library enabled"); -#endif -} - - -/* {{{ php_reg_eprint - * php_reg_eprint - convert error number to name - */ -static void php_reg_eprint(int err, regex_t *re) { - char *buf = NULL, *message = NULL; - size_t len; - size_t buf_len; - -#ifdef REG_ITOA - /* get the length of the message */ - buf_len = regerror(REG_ITOA | err, re, NULL, 0); - if (buf_len) { - buf = (char *)safe_emalloc(buf_len, sizeof(char), 0); - if (!buf) return; /* fail silently */ - /* finally, get the error message */ - regerror(REG_ITOA | err, re, buf, buf_len); - } -#else - buf_len = 0; -#endif - len = regerror(err, re, NULL, 0); - if (len) { - TSRMLS_FETCH(); - - message = (char *)safe_emalloc((buf_len + len + 2), sizeof(char), 0); - if (!message) { - return; /* fail silently */ - } - if (buf_len) { - snprintf(message, buf_len, "%s: ", buf); - buf_len += 1; /* so pointer math below works */ - } - /* drop the message into place */ - regerror(err, re, message + buf_len, len); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); - } - - STR_FREE(buf); - STR_FREE(message); -} -/* }}} */ - -/* {{{ php_ereg - */ -static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **regex, /* Regular expression */ - **findin, /* String to apply expression to */ - **array = NULL; /* Optional register array */ - regex_t re; - regmatch_t *subs; - int err, match_len, string_len; - uint i; - int copts = 0; - off_t start, end; - char *buf = NULL; - char *string = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (icase) - copts |= REG_ICASE; - - if (argc == 2) - copts |= REG_NOSUB; - - /* compile the regular expression from the supplied regex */ - if (Z_TYPE_PP(regex) == IS_STRING) { - err = regcomp(&re, Z_STRVAL_PP(regex), REG_EXTENDED | copts); - } else { - /* we convert numbers to integers and treat them as a string */ - if (Z_TYPE_PP(regex) == IS_DOUBLE) - convert_to_long_ex(regex); /* get rid of decimal places */ - convert_to_string_ex(regex); - /* don't bother doing an extended regex with just a number */ - err = regcomp(&re, Z_STRVAL_PP(regex), copts); - } - - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - /* make a copy of the string we're looking in */ - convert_to_string_ex(findin); - string = estrndup(Z_STRVAL_PP(findin), Z_STRLEN_PP(findin)); - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - - /* actually execute the regular expression */ - err = regexec(&re, string, re.re_nsub+1, subs, 0); - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - efree(subs); - RETURN_FALSE; - } - match_len = 1; - - if (array && err != REG_NOMATCH) { - match_len = (int) (subs[0].rm_eo - subs[0].rm_so); - string_len = Z_STRLEN_PP(findin) + 1; - - buf = emalloc(string_len); - - zval_dtor(*array); /* start with clean array */ - array_init(*array); - - for (i = 0; i <= re.re_nsub; i++) { - start = subs[i].rm_so; - end = subs[i].rm_eo; - if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) { - add_index_stringl(*array, i, string+start, end-start, 1); - } else { - add_index_bool(*array, i, 0); - } - } - efree(buf); - } - - efree(subs); - efree(string); - if (err == REG_NOMATCH) { - RETVAL_FALSE; - } else { - if (match_len == 0) - match_len = 1; - RETVAL_LONG(match_len); - } - regfree(&re); -} -/* }}} */ - -/* {{{ proto int ereg(string pattern, string string [, array registers]) - Regular expression match */ -PHP_FUNCTION(ereg) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int eregi(string pattern, string string [, array registers]) - Case-insensitive regular expression match */ -PHP_FUNCTION(eregi) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_reg_replace - * this is the meat and potatoes of regex replacement! */ -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) -{ - regex_t re; - regmatch_t *subs; - - char *buf, /* buf is where we build the replaced string */ - *nbuf, /* nbuf is used when we grow the buffer */ - *walkbuf; /* used to walk buf when replacing backrefs */ - const char *walk; /* used to walk replacement string for backrefs */ - int buf_len; - int pos, tmp, string_len, new_l; - int err, copts = 0; - - string_len = strlen(string); - - if (icase) { - copts = REG_ICASE; - } - if (extended) { - copts |= REG_EXTENDED; - } - - err = regcomp(&re, pattern, copts); - if (err) { - php_reg_eprint(err, &re); - return ((char *) -1); - } - - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - - /* start with a buffer that is twice the size of the stringo - we're doing replacements in */ - buf_len = 2 * string_len + 1; - buf = safe_emalloc(buf_len, sizeof(char), 0); - - err = pos = 0; - buf[0] = '\0'; - while (!err) { - err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0)); - - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - efree(subs); - efree(buf); - regfree(&re); - return ((char *) -1); - } - - if (!err) { - /* backref replacement is done in two passes: - 1) find out how long the string will be, and allocate buf - 2) copy the part before match, replacement and backrefs to buf - - Jaakko Hyvätti - */ - - new_l = strlen(buf) + subs[0].rm_so; /* part before the match */ - walk = replace; - while (*walk) { - if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) { - if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) { - new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so; - } - walk += 2; - } else { - new_l++; - walk++; - } - } - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = emalloc(buf_len); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - tmp = strlen(buf); - /* copy the part of the string before the match */ - strncat(buf, &string[pos], subs[0].rm_so); - - /* copy replacement and backrefs */ - walkbuf = &buf[tmp + subs[0].rm_so]; - walk = replace; - while (*walk) { - if ('\\' == *walk && isdigit(walk[1]) && walk[1] - '0' <= (int)re.re_nsub) { - if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1 - /* this next case shouldn't happen. it does. */ - && subs[walk[1] - '0'].rm_so <= subs[walk[1] - '0'].rm_eo) { - - tmp = subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so; - memcpy (walkbuf, &string[pos + subs[walk[1] - '0'].rm_so], tmp); - walkbuf += tmp; - } - walk += 2; - } else { - *walkbuf++ = *walk++; - } - } - *walkbuf = '\0'; - - /* and get ready to keep looking for replacements */ - if (subs[0].rm_so == subs[0].rm_eo) { - if (subs[0].rm_so + pos >= string_len) { - break; - } - new_l = strlen (buf) + 1; - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = safe_emalloc(buf_len, sizeof(char), 0); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - pos += subs[0].rm_eo + 1; - buf [new_l-1] = string [pos-1]; - buf [new_l] = '\0'; - } else { - pos += subs[0].rm_eo; - } - } else { /* REG_NOMATCH */ - new_l = strlen(buf) + strlen(&string[pos]); - if (new_l + 1 > buf_len) { - buf_len = new_l + 1; /* now we know exactly how long it is */ - nbuf = safe_emalloc(buf_len, sizeof(char), 0); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - /* stick that last bit of string on our output */ - strcat(buf, &string[pos]); - } - } - - /* don't want to leak memory .. */ - efree(subs); - regfree(&re); - - /* whew. */ - return (buf); -} -/* }}} */ - -/* {{{ php_ereg_replace - */ -static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **arg_pattern, - **arg_replace, - **arg_string; - char *pattern; - char *string; - char *replace; - char *ret; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(arg_pattern) == IS_STRING) { - if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern)) - pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern)); - else - pattern = STR_EMPTY_ALLOC(); - } else { - convert_to_long_ex(arg_pattern); - pattern = emalloc(2); - pattern[0] = (char) Z_LVAL_PP(arg_pattern); - pattern[1] = '\0'; - } - - if (Z_TYPE_PP(arg_replace) == IS_STRING) { - if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace)) - replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace)); - else - replace = STR_EMPTY_ALLOC(); - } else { - convert_to_long_ex(arg_replace); - replace = emalloc(2); - replace[0] = (char) Z_LVAL_PP(arg_replace); - replace[1] = '\0'; - } - - convert_to_string_ex(arg_string); - if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string)) - string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string)); - else - string = STR_EMPTY_ALLOC(); - - /* do the actual work */ - ret = php_reg_replace(pattern, replace, string, icase, 1); - if (ret == (char *) -1) { - RETVAL_FALSE; - } else { - RETVAL_STRING(ret, 1); - STR_FREE(ret); - } - - STR_FREE(string); - STR_FREE(replace); - STR_FREE(pattern); -} -/* }}} */ - -/* {{{ proto string ereg_replace(string pattern, string replacement, string string) - Replace regular expression */ -PHP_FUNCTION(ereg_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string eregi_replace(string pattern, string replacement, string string) - Case insensitive replace regular expression */ -PHP_FUNCTION(eregi_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_split - */ -static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - zval **spliton, **str, **arg_count = NULL; - regex_t re; - regmatch_t subs[1]; - char *strp, *endp; - int err, size, count = -1, copts = 0; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 2) { - convert_to_long_ex(arg_count); - count = Z_LVAL_PP(arg_count); - } - - if (icase) - copts = REG_ICASE; - - convert_to_string_ex(spliton); - convert_to_string_ex(str); - - strp = Z_STRVAL_PP(str); - endp = strp + Z_STRLEN_PP(str); - - err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts); - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - array_init(return_value); - - /* churn through str, generating array entries as we go */ - while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) { - if (subs[0].rm_so == 0 && subs[0].rm_eo) { - /* match is at start of string, return empty string */ - add_next_index_stringl(return_value, "", 0, 1); - /* skip ahead the length of the regex match */ - strp += subs[0].rm_eo; - } else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) { - /* No more matches */ - regfree(&re); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression to split()"); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } else { - /* On a real match */ - - /* make a copy of the substring */ - size = subs[0].rm_so; - - /* add it to the array */ - add_next_index_stringl(return_value, strp, size, 1); - - /* point at our new starting point */ - strp = strp + subs[0].rm_eo; - } - - /* if we're only looking for a certain number of points, - stop looking once we hit it */ - if (count != -1) { - count--; - } - } - - /* see if we encountered an error */ - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } - - /* otherwise we just have one last element to add to the array */ - size = endp - strp; - - add_next_index_stringl(return_value, strp, size, 1); - - regfree(&re); -} -/* }}} */ - -/* {{{ proto array split(string pattern, string string [, int limit]) - Split string into array by regular expression */ -PHP_FUNCTION(split) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array spliti(string pattern, string string [, int limit]) - Split string into array by regular expression case-insensitive */ - -PHP_FUNCTION(spliti) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* }}} */ - -/* {{{ proto string sql_regcase(string string) - Make regular expression for case insensitive match */ -PHPAPI PHP_FUNCTION(sql_regcase) -{ - zval **string; - char *tmp; - unsigned char c; - register int i, j; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &string)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(string); - - tmp = safe_emalloc(Z_STRLEN_PP(string), 4, 1); - - for (i = j = 0; i < Z_STRLEN_PP(string); i++) { - c = (unsigned char) Z_STRVAL_PP(string)[i]; - if(isalpha(c)) { - tmp[j++] = '['; - tmp[j++] = toupper(c); - tmp[j++] = tolower(c); - tmp[j++] = ']'; - } else { - tmp[j++] = c; - } - } - tmp[j] = 0; - - RETVAL_STRINGL(tmp, j, 1); - efree(tmp); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/reg.h b/ext/standard/reg.h deleted file mode 100644 index 5497026b491ad..0000000000000 --- a/ext/standard/reg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - - -/* $Id$ */ - -#ifndef REG_H -#define REG_H - -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); - -PHP_FUNCTION(ereg); -PHP_FUNCTION(eregi); -PHP_FUNCTION(eregi_replace); -PHP_FUNCTION(ereg_replace); -PHP_FUNCTION(split); -PHP_FUNCTION(spliti); -PHPAPI PHP_FUNCTION(sql_regcase); - -ZEND_BEGIN_MODULE_GLOBALS(reg) - HashTable ht_rc; -ZEND_END_MODULE_GLOBALS(reg) - -PHP_MINIT_FUNCTION(regex); -PHP_MSHUTDOWN_FUNCTION(regex); -PHP_MINFO_FUNCTION(regex); - - -#ifdef ZTS -#define REG(v) TSRMG(reg_globals_id, zend_reg_globals *, v) -#else -#define REG(v) (reg_globals.v) -#endif - -#endif /* REG_H */ diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c deleted file mode 100644 index b05af5331c35e..0000000000000 --- a/ext/standard/scanf.c +++ /dev/null @@ -1,1261 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Clayton Collie | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - scanf.c -- - - This file contains the base code which implements sscanf and by extension - fscanf. Original code is from TCL8.3.0 and bears the following copyright - - - - This software is copyrighted by the Regents of the University of - California, Sun Microsystems, Inc., Scriptics Corporation, - and other parties. The following terms apply to all files associated - with the software unless explicitly disclaimed in individual files. - - The authors hereby grant permission to use, copy, modify, distribute, - and license this software and its documentation for any purpose, provided - that existing copyright notices are retained in all copies and that this - notice is included verbatim in any distributions. No written agreement, - license, or royalty fee is required for any of the authorized uses. - Modifications to this software may be copyrighted by their authors - and need not follow the licensing terms described here, provided that - the new terms are clearly indicated on the first page of each file where - they apply. - - IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY - FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY - DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE - IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE - NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR - MODIFICATIONS. - - GOVERNMENT USE: If you are acquiring this software on behalf of the - U.S. government, the Government shall have only "Restricted Rights" - in the software and related documentation as defined in the Federal - Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you - are acquiring the software on behalf of the Department of Defense, the - software shall be classified as "Commercial Computer Software" and the - Government shall have only "Restricted Rights" as defined in Clause - 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the - authors grant the U.S. Government and others acting in its behalf - permission to use and distribute the software in accordance with the - terms specified in this license. - - */ - -#include -#include -#include -#include "php.h" -#include "php_variables.h" -#ifdef HAVE_LOCALE_H -#include -#endif -#include "zend_execute.h" -#include "zend_operators.h" -#include "zend_strtod.h" -#include "php_globals.h" -#include "basic_functions.h" -#include "scanf.h" - -/* - * Flag values used internally by [f|s]canf. - */ - -#define SCAN_NOSKIP 0x1 /* Don't skip blanks. */ -#define SCAN_SUPPRESS 0x2 /* Suppress assignment. */ -#define SCAN_UNSIGNED 0x4 /* Read an unsigned value. */ -#define SCAN_WIDTH 0x8 /* A width value was supplied. */ - -#define SCAN_SIGNOK 0x10 /* A +/- character is allowed. */ -#define SCAN_NODIGITS 0x20 /* No digits have been scanned. */ -#define SCAN_NOZERO 0x40 /* No zero digits have been scanned. */ -#define SCAN_XOK 0x80 /* An 'x' is allowed. */ -#define SCAN_PTOK 0x100 /* Decimal point is allowed. */ -#define SCAN_EXPOK 0x200 /* An exponent is allowed. */ - -#define UCHAR(x) (zend_uchar)(x) - - - -/* - * The following structure contains the information associated with - * a character set. - */ - -typedef struct CharSet { - int exclude; /* 1 if this is an exclusion set. */ - int nchars; - char *chars; - int nranges; - struct Range { - char start; - char end; - } *ranges; -} CharSet; - -/* - * Declarations for functions used only in this file. - */ - -static char *BuildCharSet(CharSet *cset, char *format); -static int CharInSet(CharSet *cset, int ch); -static void ReleaseCharSet(CharSet *cset); -static inline void scan_set_error_return(int numVars, pval **return_value); - - -/* {{{ BuildCharSet - *---------------------------------------------------------------------- - * - * BuildCharSet -- - * - * This function examines a character set format specification - * and builds a CharSet containing the individual characters and - * character ranges specified. - * - * Results: - * Returns the next format position. - * - * Side effects: - * Initializes the charset. - * - *---------------------------------------------------------------------- - */ -static char * BuildCharSet(CharSet *cset, char *format) -{ - char *ch, start; - int nranges; - char *end; - - memset(cset, 0, sizeof(CharSet)); - - ch = format; - if (*ch == '^') { - cset->exclude = 1; - ch = ++format; - } - end = format + 1; /* verify this - cc */ - - /* - * Find the close bracket so we can overallocate the set. - */ - - if (*ch == ']') { - ch = end++; - } - nranges = 0; - while (*ch != ']') { - if (*ch == '-') { - nranges++; - } - ch = end++; - } - - cset->chars = (char *) safe_emalloc(sizeof(char), (end - format - 1), 0); - if (nranges > 0) { - cset->ranges = (struct Range *) safe_emalloc(sizeof(struct Range), nranges, 0); - } else { - cset->ranges = NULL; - } - - /* - * Now build the character set. - */ - - cset->nchars = cset->nranges = 0; - ch = format++; - start = *ch; - if (*ch == ']' || *ch == '-') { - cset->chars[cset->nchars++] = *ch; - ch = format++; - } - while (*ch != ']') { - if (*format == '-') { - /* - * This may be the first character of a range, so don't add - * it yet. - */ - - start = *ch; - } else if (*ch == '-') { - /* - * Check to see if this is the last character in the set, in which - * case it is not a range and we should add the previous character - * as well as the dash. - */ - - if (*format == ']') { - cset->chars[cset->nchars++] = start; - cset->chars[cset->nchars++] = *ch; - } else { - ch = format++; - - /* - * Check to see if the range is in reverse order. - */ - - if (start < *ch) { - cset->ranges[cset->nranges].start = start; - cset->ranges[cset->nranges].end = *ch; - } else { - cset->ranges[cset->nranges].start = *ch; - cset->ranges[cset->nranges].end = start; - } - cset->nranges++; - } - } else { - cset->chars[cset->nchars++] = *ch; - } - ch = format++; - } - return format; -} -/* }}} */ - -/* {{{ CharInSet - *---------------------------------------------------------------------- - * - * CharInSet -- - * - * Check to see if a character matches the given set. - * - * Results: - * Returns non-zero if the character matches the given set. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static int CharInSet(CharSet *cset, int c) -{ - char ch = (char) c; - int i, match = 0; - - for (i = 0; i < cset->nchars; i++) { - if (cset->chars[i] == ch) { - match = 1; - break; - } - } - if (!match) { - for (i = 0; i < cset->nranges; i++) { - if ((cset->ranges[i].start <= ch) - && (ch <= cset->ranges[i].end)) { - match = 1; - break; - } - } - } - return (cset->exclude ? !match : match); -} -/* }}} */ - -/* {{{ ReleaseCharSet - *---------------------------------------------------------------------- - * - * ReleaseCharSet -- - * - * Free the storage associated with a character set. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static void ReleaseCharSet(CharSet *cset) -{ - efree((char *)cset->chars); - if (cset->ranges) { - efree((char *)cset->ranges); - } -} -/* }}} */ - -/* {{{ ValidateFormat - *---------------------------------------------------------------------- - * - * ValidateFormat -- - * - * Parse the format string and verify that it is properly formed - * and that there are exactly enough variables on the command line. - * - * Results: - * FAILURE or SUCCESS. - * - * Side effects: - * May set php_error based on abnormal conditions. - * - * Parameters : - * format The format string. - * numVars The number of variables passed to the scan command. - * totalSubs The number of variables that will be required. - * - *---------------------------------------------------------------------- -*/ -PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs) -{ -#define STATIC_LIST_SIZE 16 - int gotXpg, gotSequential, value, i, flags; - char *end, *ch = NULL; - int staticAssign[STATIC_LIST_SIZE]; - int *nassign = staticAssign; - int objIndex, xpgSize, nspace = STATIC_LIST_SIZE; - TSRMLS_FETCH(); - - /* - * Initialize an array that records the number of times a variable - * is assigned to by the format string. We use this to detect if - * a variable is multiply assigned or left unassigned. - */ - - if (numVars > nspace) { - nassign = (int*)safe_emalloc(sizeof(int), numVars, 0); - nspace = numVars; - } - for (i = 0; i < nspace; i++) { - nassign[i] = 0; - } - - xpgSize = objIndex = gotXpg = gotSequential = 0; - - while (*format != '\0') { - ch = format++; - flags = 0; - - if (*ch != '%') { - continue; - } - ch = format++; - if (*ch == '%') { - continue; - } - if (*ch == '*') { - flags |= SCAN_SUPPRESS; - ch = format++; - goto xpgCheckDone; - } - - if ( isdigit( (int)*ch ) ) { - /* - * Check for an XPG3-style %n$ specification. Note: there - * must not be a mixture of XPG3 specs and non-XPG3 specs - * in the same format string. - */ - - value = strtoul(format-1, &end, 10); - if (*end != '$') { - goto notXpg; - } - format = end+1; - ch = format++; - gotXpg = 1; - if (gotSequential) { - goto mixedXPG; - } - objIndex = value - 1; - if ((objIndex < 0) || (numVars && (objIndex >= numVars))) { - goto badIndex; - } else if (numVars == 0) { - /* - * In the case where no vars are specified, the user can - * specify %9999$ legally, so we have to consider special - * rules for growing the assign array. 'value' is - * guaranteed to be > 0. - */ - - /* set a lower artificial limit on this - * in the interest of security and resource friendliness - * 255 arguments should be more than enough. - cc - */ - if (value > SCAN_MAX_ARGS) { - goto badIndex; - } - - xpgSize = (xpgSize > value) ? xpgSize : value; - } - goto xpgCheckDone; - } - - notXpg: - gotSequential = 1; - if (gotXpg) { - mixedXPG: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers"); - goto error; - } - - xpgCheckDone: - /* - * Parse any width specifier. - */ - - if (isdigit(UCHAR(*ch))) { - value = strtoul(format-1, &format, 10); - flags |= SCAN_WIDTH; - ch = format++; - } - - /* - * Ignore size specifier. - */ - - if ((*ch == 'l') || (*ch == 'L') || (*ch == 'h')) { - ch = format++; - } - - if (!(flags & SCAN_SUPPRESS) && numVars && (objIndex >= numVars)) { - goto badIndex; - } - - /* - * Handle the various field types. - */ - - switch (*ch) { - case 'n': - case 'd': - case 'D': - case 'i': - case 'o': - case 'x': - case 'X': - case 'u': - case 'f': - case 'e': - case 'E': - case 'g': - case 's': - break; - case 'c': - /* we differ here with the TCL implementation in allowing for */ - /* a character width specification, to be more consistent with */ - /* ANSI. since Zend auto allocates space for vars, this is no */ - /* problem - cc */ - /* - if (flags & SCAN_WIDTH) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field width may not be specified in %c conversion"); - goto error; - } - */ - break; - case '[': - if (*format == '\0') { - goto badSet; - } - ch = format++; - if (*ch == '^') { - if (*format == '\0') { - goto badSet; - } - ch = format++; - } - if (*ch == ']') { - if (*format == '\0') { - goto badSet; - } - ch = format++; - } - while (*ch != ']') { - if (*format == '\0') { - goto badSet; - } - ch = format++; - } - break; - badSet: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unmatched [ in format string"); - goto error; - default: - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", *ch); - goto error; - } - } - if (!(flags & SCAN_SUPPRESS)) { - if (objIndex >= nspace) { - /* - * Expand the nassign buffer. If we are using XPG specifiers, - * make sure that we grow to a large enough size. xpgSize is - * guaranteed to be at least one larger than objIndex. - */ - value = nspace; - if (xpgSize) { - nspace = xpgSize; - } else { - nspace += STATIC_LIST_SIZE; - } - if (nassign == staticAssign) { - nassign = (void *)safe_emalloc(nspace, sizeof(int), 0); - for (i = 0; i < STATIC_LIST_SIZE; ++i) { - nassign[i] = staticAssign[i]; - } - } else { - nassign = (void *)erealloc((void *)nassign, nspace * sizeof(int)); - } - for (i = value; i < nspace; i++) { - nassign[i] = 0; - } - } - nassign[objIndex]++; - objIndex++; - } - } /* while (*format != '\0') */ - - /* - * Verify that all of the variable were assigned exactly once. - */ - - if (numVars == 0) { - if (xpgSize) { - numVars = xpgSize; - } else { - numVars = objIndex; - } - } - if (totalSubs) { - *totalSubs = numVars; - } - for (i = 0; i < numVars; i++) { - if (nassign[i] > 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers"); - goto error; - } else if (!xpgSize && (nassign[i] == 0)) { - /* - * If the space is empty, and xpgSize is 0 (means XPG wasn't - * used, and/or numVars != 0), then too many vars were given - */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is not assigned by any conversion specifiers"); - goto error; - } - } - - if (nassign != staticAssign) { - efree((char *)nassign); - } - return SCAN_SUCCESS; - -badIndex: - if (gotXpg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "\"%n$\" argument index out of range"); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of variable names and field specifiers"); - } - -error: - if (nassign != staticAssign) { - efree((char *)nassign); - } - return SCAN_ERROR_INVALID_FORMAT; -#undef STATIC_LIST_SIZE -} -/* }}} */ - -/* {{{ php_sscanf_internal - * This is the internal function which does processing on behalf of - * both sscanf() and fscanf() - * - * parameters : - * string literal string to be processed - * format format string - * argCount total number of elements in the args array - * args arguments passed in from user function (f|s)scanf - * varStart offset (in args) of 1st variable passed in to (f|s)scanf - * return_value set with the results of the scan - */ - -PHPAPI int php_sscanf_internal( char *string, char *format, - int argCount, zval ***args, - int varStart, pval **return_value TSRMLS_DC) -{ - int numVars, nconversions, totalVars = -1; - int i, value, result; - int objIndex; - char *end, *baseString; - zval **current; - char op = 0; - int base = 0; - int underflow = 0; - size_t width; - long (*fn)() = NULL; - char *ch, sch; - int flags; - char buf[64]; /* Temporary buffer to hold scanned - * number strings before they are - * passed to strtoul. */ - - - /* do some sanity checking */ - if ((varStart > argCount) || (varStart < 0)){ - varStart = SCAN_MAX_ARGS + 1; - } - numVars = argCount - varStart; - if (numVars < 0) { - numVars = 0; - } - -#if 0 - zend_printf("
              in sscanf_internal :
              string is \"%s\", format = \"%s\"
              NumVars = %d. VarStart = %d
              -------------------------
              ", - string, format, numVars, varStart); -#endif - /* - * Check for errors in the format string. - */ - if (ValidateFormat(format, numVars, &totalVars) != SCAN_SUCCESS) { - scan_set_error_return( numVars, return_value ); - return SCAN_ERROR_INVALID_FORMAT; - } - - objIndex = numVars ? varStart : 0; - - /* - * If any variables are passed, make sure they are all passed by reference - */ - if (numVars) { - for (i = varStart;i < argCount;i++){ - if ( ! PZVAL_IS_REF( *args[ i ] ) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d must be passed by reference", i); - scan_set_error_return(numVars, return_value); - return SCAN_ERROR_VAR_PASSED_BYVAL; - } - } - } - - - /* - * Allocate space for the result objects. Only happens when no variables - * are specified - */ - - if (!numVars) { - /* allocate an array for return */ - array_init(*return_value); - - for (i = 0; i < totalVars; i++) { - if (add_next_index_null(*return_value) == FAILURE) { - scan_set_error_return(0, return_value); - return FAILURE; - } - } - } - - baseString = string; - - /* - * Iterate over the format string filling in the result objects until - * we reach the end of input, the end of the format string, or there - * is a mismatch. - */ - - nconversions = 0; - /* note ! - we need to limit the loop for objIndex to keep it in bounds */ - - while (*format != '\0') { - - ch = format++; - - flags = 0; - - /* - * If we see whitespace in the format, skip whitespace in the string. - */ - - if ( isspace( (int)*ch ) ) { - sch = *string; - while ( isspace( (int)sch ) ) { - if (*string == '\0') { - goto done; - } - string++; - sch = *string; - } - continue; - } - - if (*ch != '%') { - literal: - if (*string == '\0') { - underflow = 1; - goto done; - } - sch = *string; - string++; - if (*ch != sch) { - goto done; - } - continue; - } - - ch = format++; - if (*ch == '%') { - goto literal; - } - - /* - * Check for assignment suppression ('*') or an XPG3-style - * assignment ('%n$'). - */ - - if (*ch == '*') { - flags |= SCAN_SUPPRESS; - ch = format++; - } else if ( isdigit(UCHAR(*ch))) { - value = strtoul(format-1, &end, 10); - if (*end == '$') { - format = end+1; - ch = format++; - objIndex = varStart + value; - } - } - - /* - * Parse any width specifier. - */ - - if ( isdigit(UCHAR(*ch))) { - width = strtoul(format-1, &format, 10); - ch = format++; - } else { - width = 0; - } - - /* - * Ignore size specifier. - */ - - if ((*ch == 'l') || (*ch == 'L') || (*ch == 'h')) { - ch = format++; - } - - /* - * Handle the various field types. - */ - - switch (*ch) { - case 'n': - if (!(flags & SCAN_SUPPRESS)) { - if (numVars) { - zend_uint refcount; - - current = args[objIndex++]; - refcount = (*current)->refcount; - zval_dtor( *current ); - ZVAL_LONG( *current, (long)(string - baseString) ); - (*current)->refcount = refcount; - (*current)->is_ref = 1; - } else { - add_index_long(*return_value, objIndex++, string - baseString); - } - } - nconversions++; - continue; - - case 'd': - case 'D': - op = 'i'; - base = 10; - fn = (long (*)())strtol; - break; - case 'i': - op = 'i'; - base = 0; - fn = (long (*)())strtol; - break; - case 'o': - op = 'i'; - base = 8; - fn = (long (*)())strtol; - break; - case 'x': - case 'X': - op = 'i'; - base = 16; - fn = (long (*)())strtol; - break; - case 'u': - op = 'i'; - base = 10; - flags |= SCAN_UNSIGNED; - fn = (long (*)())strtoul; - break; - - case 'f': - case 'e': - case 'E': - case 'g': - op = 'f'; - break; - - case 's': - op = 's'; - break; - - case 'c': - op = 's'; - flags |= SCAN_NOSKIP; - /*-cc-*/ - if (0 == width) { - width = 1; - } - /*-cc-*/ - break; - case '[': - op = '['; - flags |= SCAN_NOSKIP; - break; - } /* switch */ - - /* - * At this point, we will need additional characters from the - * string to proceed. - */ - - if (*string == '\0') { - underflow = 1; - goto done; - } - - /* - * Skip any leading whitespace at the beginning of a field unless - * the format suppresses this behavior. - */ - - if (!(flags & SCAN_NOSKIP)) { - while (*string != '\0') { - sch = *string; - if (! isspace((int)sch) ) { - break; - } - string++; - } - if (*string == '\0') { - underflow = 1; - goto done; - } - } - - /* - * Perform the requested scanning operation. - */ - - switch (op) { - case 'c': - case 's': - /* - * Scan a string up to width characters or whitespace. - */ - - if (width == 0) { - width = (size_t) ~0; - } - end = string; - while (*end != '\0') { - sch = *end; - if ( isspace( (int)sch ) ) { - break; - } - end++; - if (--width == 0) { - break; - } - } - if (!(flags & SCAN_SUPPRESS)) { - if (numVars) { - zend_uint refcount; - - current = args[objIndex++]; - refcount = (*current)->refcount; - zval_dtor( *current ); - ZVAL_STRINGL( *current, string, end-string, 1); - (*current)->refcount = refcount; - (*current)->is_ref = 1; - } else { - add_index_stringl( *return_value, objIndex++, string, end-string, 1); - } - } - string = end; - break; - - case '[': { - CharSet cset; - - if (width == 0) { - width = (size_t) ~0; - } - end = string; - - format = BuildCharSet(&cset, format); - while (*end != '\0') { - sch = *end; - if (!CharInSet(&cset, (int)sch)) { - break; - } - end++; - if (--width == 0) { - break; - } - } - ReleaseCharSet(&cset); - - if (string == end) { - /* - * Nothing matched the range, stop processing - */ - goto done; - } - if (!(flags & SCAN_SUPPRESS)) { - if (numVars) { - current = args[objIndex++]; - zval_dtor( *current ); - ZVAL_STRINGL( *current, string, end-string, 1); - } else { - add_index_stringl(*return_value, objIndex++, string, end-string, 1); - } - } - string = end; - - break; - } - /* - case 'c': - / Scan a single character./ - - sch = *string; - string++; - if (!(flags & SCAN_SUPPRESS)) { - if (numVars) { - char __buf[2]; - __buf[0] = sch; - __buf[1] = '\0';; - current = args[objIndex++]; - convert_to_string_ex( current ); - ZVAL_STRINGL( *current, __buf, 1, 1); - } else { - add_index_stringl(*return_value, objIndex++, &sch, 1, 1); - } - } - break; - */ - case 'i': - /* - * Scan an unsigned or signed integer. - */ - - /*-cc-*/ - buf[0] = '\0'; - /*-cc-*/ - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; - } - - flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_NOZERO; - for (end = buf; width > 0; width--) { - switch (*string) { - /* - * The 0 digit has special meaning at the beginning of - * a number. If we are unsure of the base, it - * indicates that we are in base 8 or base 16 (if it is - * followed by an 'x'). - */ - case '0': - /*-cc-*/ - if (base == 16) { - flags |= SCAN_XOK; - } - /*-cc-*/ - if (base == 0) { - base = 8; - flags |= SCAN_XOK; - } - if (flags & SCAN_NOZERO) { - flags &= ~(SCAN_SIGNOK | SCAN_NODIGITS | SCAN_NOZERO); - } else { - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - } - goto addToInt; - - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': - if (base == 0) { - base = 10; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case '8': case '9': - if (base == 0) { - base = 10; - } - if (base <= 8) { - break; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case 'A': case 'B': case 'C': - case 'D': case 'E': case 'F': - case 'a': case 'b': case 'c': - case 'd': case 'e': case 'f': - if (base <= 10) { - break; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case '+': case '-': - if (flags & SCAN_SIGNOK) { - flags &= ~SCAN_SIGNOK; - goto addToInt; - } - break; - - case 'x': case 'X': - if ((flags & SCAN_XOK) && (end == buf+1)) { - base = 16; - flags &= ~SCAN_XOK; - goto addToInt; - } - break; - } - - /* - * We got an illegal character so we are done accumulating. - */ - - break; - - addToInt: - /* - * Add the character to the temporary buffer. - */ - *end++ = *string++; - if (*string == '\0') { - break; - } - } - - /* - * Check to see if we need to back up because we only got a - * sign or a trailing x after a 0. - */ - - if (flags & SCAN_NODIGITS) { - if (*string == '\0') { - underflow = 1; - } - goto done; - } else if (end[-1] == 'x' || end[-1] == 'X') { - end--; - string--; - } - - - /* - * Scan the value from the temporary buffer. If we are - * returning a large unsigned value, we have to convert it back - * to a string since PHP only supports signed values. - */ - - if (!(flags & SCAN_SUPPRESS)) { - *end = '\0'; - value = (int) (*fn)(buf, NULL, base); - if ((flags & SCAN_UNSIGNED) && (value < 0)) { - sprintf(buf, "%u", value); /* INTL: ISO digit */ - if (numVars) { - /* change passed value type to string */ - current = args[objIndex++]; - convert_to_string( *current ); - ZVAL_STRING( *current, buf, 1 ); - } else { - add_index_string(*return_value, objIndex++, buf, 1); - } - } else { - if (numVars) { - current = args[objIndex++]; - convert_to_long( *current ); - Z_LVAL(**current) = value; - } else { - add_index_long(*return_value, objIndex++, value); - } - } - } - - break; - - case 'f': - /* - * Scan a floating point number - */ - buf[0] = '\0'; /* call me pedantic */ - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; - } - flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_PTOK | SCAN_EXPOK; - for (end = buf; width > 0; width--) { - switch (*string) { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - flags &= ~(SCAN_SIGNOK | SCAN_NODIGITS); - goto addToFloat; - case '+': case '-': - if (flags & SCAN_SIGNOK) { - flags &= ~SCAN_SIGNOK; - goto addToFloat; - } - break; - case '.': - if (flags & SCAN_PTOK) { - flags &= ~(SCAN_SIGNOK | SCAN_PTOK); - goto addToFloat; - } - break; - case 'e': case 'E': - /* - * An exponent is not allowed until there has - * been at least one digit. - */ - - if ((flags & (SCAN_NODIGITS | SCAN_EXPOK)) == SCAN_EXPOK) { - flags = (flags & ~(SCAN_EXPOK|SCAN_PTOK)) - | SCAN_SIGNOK | SCAN_NODIGITS; - goto addToFloat; - } - break; - } - - /* - * We got an illegal character so we are done accumulating. - */ - - break; - - addToFloat: - /* - * Add the character to the temporary buffer. - */ - - *end++ = *string++; - if (*string == '\0') { - break; - } - } - - /* - * Check to see if we need to back up because we saw a - * trailing 'e' or sign. - */ - - if (flags & SCAN_NODIGITS) { - if (flags & SCAN_EXPOK) { - /* - * There were no digits at all so scanning has - * failed and we are done. - */ - if (*string == '\0') { - underflow = 1; - } - goto done; - } - - /* - * We got a bad exponent ('e' and maybe a sign). - */ - - end--; - string--; - if (*end != 'e' && *end != 'E') { - end--; - string--; - } - } - - /* - * Scan the value from the temporary buffer. - */ - - if (!(flags & SCAN_SUPPRESS)) { - double dvalue; - *end = '\0'; - dvalue = zend_strtod(buf, NULL); - if (numVars) { - current = args[objIndex++]; - convert_to_double( *current ); - Z_DVAL_PP( current ) = dvalue; - } else { - add_index_double( *return_value, objIndex++, dvalue ); - } - } - break; - } /* switch (op) */ - nconversions++; - } /* while (*format != '\0') */ - -done: - result = SCAN_SUCCESS; - - if (underflow && (0==nconversions)) { - scan_set_error_return( numVars, return_value ); - result = SCAN_ERROR_EOF; - } else if (numVars) { - convert_to_long( *return_value ); - Z_LVAL_PP(return_value) = nconversions; - } else if (nconversions < totalVars) { - /* to do : not all elements converted. we need to prune the list - cc - */ - } - - return result; -} -/* }}} */ - -/* the compiler choked when i tried to make this a macro */ -static inline void scan_set_error_return(int numVars, pval **return_value) -{ - if (numVars) { - Z_TYPE_PP(return_value) = IS_LONG; - Z_LVAL_PP(return_value) = SCAN_ERROR_EOF; /* EOF marker */ - } else { - /* pval_destructor( *return_value ); */ - /* convert_to_null calls destructor */ - convert_to_null( *return_value ); - } -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h deleted file mode 100644 index c848b6e3727ad..0000000000000 --- a/ext/standard/scanf.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Clayton Collie | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SCANF_H -#define SCANF_H - - -#define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */ - /* passed to (f|s)scanf. This is an artifical */ - /* upper limit to keep resources in check and */ - /* minimize the possibility of exploits */ - -#define SCAN_SUCCESS SUCCESS -#define SCAN_ERROR_EOF -1 /* indicates premature termination of scan */ - /* can be caused by bad parameters or format*/ - /* string. */ -#define SCAN_ERROR_INVALID_FORMAT (SCAN_ERROR_EOF - 1) -#define SCAN_ERROR_VAR_PASSED_BYVAL (SCAN_ERROR_INVALID_FORMAT - 1) -#define SCAN_ERROR_WRONG_PARAM_COUNT (SCAN_ERROR_VAR_PASSED_BYVAL - 1) -#define SCAN_ERROR_INTERNAL (SCAN_ERROR_WRONG_PARAM_COUNT - 1) - - -/* - * The following are here solely for the benefit of the scanf type functions - * e.g. fscanf - */ -PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars); -PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval ***args, - int varStart, pval **return_value TSRMLS_DC); - - -#endif /* SCANF_H */ diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c deleted file mode 100644 index a32a496c9ab1b..0000000000000 --- a/ext/standard/sha1.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stefan Esser | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -/* This code is heavily based on the PHP md5 implementation */ - -#include "sha1.h" - -PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest) -{ - int i; - - for (i = 0; i < 20; i++) { - sprintf(sha1str, "%02x", digest[i]); - sha1str += 2; - } - - *sha1str = '\0'; -} - -/* {{{ proto string sha1(string str [, bool raw_output]) - Calculate the sha1 hash of a string */ -PHP_FUNCTION(sha1) -{ - char *arg; - int arg_len; - zend_bool raw_output = 0; - char sha1str[41]; - PHP_SHA1_CTX context; - unsigned char digest[20]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) { - return; - } - - sha1str[0] = '\0'; - PHP_SHA1Init(&context); - PHP_SHA1Update(&context, arg, arg_len); - PHP_SHA1Final(digest, &context); - if (raw_output) { - RETURN_STRINGL(digest, 20, 1); - } else { - make_sha1_digest(sha1str, digest); - RETVAL_STRING(sha1str, 1); - } - -} - -/* }}} */ - - -/* {{{ proto string sha1_file(string filename [, bool raw_output]) - Calculate the sha1 hash of given filename */ -PHP_FUNCTION(sha1_file) -{ - char *arg; - int arg_len; - zend_bool raw_output = 0; - char sha1str[41]; - unsigned char buf[1024]; - unsigned char digest[20]; - PHP_SHA1_CTX context; - int n; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) { - return; - } - - stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL); - if (!stream) { - RETURN_FALSE; - } - - PHP_SHA1Init(&context); - - while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) { - PHP_SHA1Update(&context, buf, n); - } - - PHP_SHA1Final(digest, &context); - - php_stream_close(stream); - - if (n<0) { - RETURN_FALSE; - } - - if (raw_output) { - RETURN_STRINGL(digest, 20, 1); - } else { - make_sha1_digest(sha1str, digest); - RETVAL_STRING(sha1str, 1); - } -} -/* }}} */ - - -static void SHA1Transform(php_uint32[5], const unsigned char[64]); -static void SHA1Encode(unsigned char *, php_uint32 *, unsigned int); -static void SHA1Decode(php_uint32 *, const unsigned char *, unsigned int); - -static unsigned char PADDING[64] = -{ - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic SHA1 functions. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((x) ^ (y) ^ (z)) -#define H(x, y, z) (((x) & (y)) | ((z) & ((x) | (y)))) -#define I(x, y, z) ((x) ^ (y) ^ (z)) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* W[i] - */ -#define W(i) ( tmp=x[(i-3)&15]^x[(i-8)&15]^x[(i-14)&15]^x[i&15], \ - (x[i&15]=ROTATE_LEFT(tmp, 1)) ) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. - */ -#define FF(a, b, c, d, e, w) { \ - (e) += F ((b), (c), (d)) + (w) + (php_uint32)(0x5A827999); \ - (e) += ROTATE_LEFT ((a), 5); \ - (b) = ROTATE_LEFT((b), 30); \ - } -#define GG(a, b, c, d, e, w) { \ - (e) += G ((b), (c), (d)) + (w) + (php_uint32)(0x6ED9EBA1); \ - (e) += ROTATE_LEFT ((a), 5); \ - (b) = ROTATE_LEFT((b), 30); \ - } -#define HH(a, b, c, d, e, w) { \ - (e) += H ((b), (c), (d)) + (w) + (php_uint32)(0x8F1BBCDC); \ - (e) += ROTATE_LEFT ((a), 5); \ - (b) = ROTATE_LEFT((b), 30); \ - } -#define II(a, b, c, d, e, w) { \ - (e) += I ((b), (c), (d)) + (w) + (php_uint32)(0xCA62C1D6); \ - (e) += ROTATE_LEFT ((a), 5); \ - (b) = ROTATE_LEFT((b), 30); \ - } - - -/* {{{ PHP_SHA1Init - * SHA1 initialization. Begins an SHA1 operation, writing a new context. - */ -PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX * context) -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. - */ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; - context->state[4] = 0xc3d2e1f0; -} -/* }}} */ - -/* {{{ PHP_SHA1Update - SHA1 block update operation. Continues an SHA1 message-digest - operation, processing another message block, and updating the - context. - */ -PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, - unsigned int inputLen) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int) ((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((php_uint32) inputLen << 3)) - < ((php_uint32) inputLen << 3)) - context->count[1]++; - context->count[1] += ((php_uint32) inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. - */ - if (inputLen >= partLen) { - memcpy - ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); - SHA1Transform(context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - SHA1Transform(context->state, &input[i]); - - index = 0; - } else - i = 0; - - /* Buffer remaining input */ - memcpy - ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], - inputLen - i); -} -/* }}} */ - -/* {{{ PHP_SHA1Final - SHA1 finalization. Ends an SHA1 message-digest operation, writing the - the message digest and zeroizing the context. - */ -PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - bits[7] = context->count[0] & 0xFF; - bits[6] = (context->count[0] >> 8) & 0xFF; - bits[5] = (context->count[0] >> 16) & 0xFF; - bits[4] = (context->count[0] >> 24) & 0xFF; - bits[3] = context->count[1] & 0xFF; - bits[2] = (context->count[1] >> 8) & 0xFF; - bits[1] = (context->count[1] >> 16) & 0xFF; - bits[0] = (context->count[1] >> 24) & 0xFF; - - /* Pad out to 56 mod 64. - */ - index = (unsigned int) ((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - PHP_SHA1Update(context, PADDING, padLen); - - /* Append length (before padding) */ - PHP_SHA1Update(context, bits, 8); - - /* Store state in digest */ - SHA1Encode(digest, context->state, 20); - - /* Zeroize sensitive information. - */ - memset((unsigned char*) context, 0, sizeof(*context)); -} -/* }}} */ - -/* {{{ SHA1Transform - * SHA1 basic transformation. Transforms state based on block. - */ -static void SHA1Transform(state, block) -php_uint32 state[5]; -const unsigned char block[64]; -{ - php_uint32 a = state[0], b = state[1], c = state[2]; - php_uint32 d = state[3], e = state[4], x[16], tmp; - - SHA1Decode(x, block, 64); - - /* Round 1 */ - FF(a, b, c, d, e, x[0]); /* 1 */ - FF(e, a, b, c, d, x[1]); /* 2 */ - FF(d, e, a, b, c, x[2]); /* 3 */ - FF(c, d, e, a, b, x[3]); /* 4 */ - FF(b, c, d, e, a, x[4]); /* 5 */ - FF(a, b, c, d, e, x[5]); /* 6 */ - FF(e, a, b, c, d, x[6]); /* 7 */ - FF(d, e, a, b, c, x[7]); /* 8 */ - FF(c, d, e, a, b, x[8]); /* 9 */ - FF(b, c, d, e, a, x[9]); /* 10 */ - FF(a, b, c, d, e, x[10]); /* 11 */ - FF(e, a, b, c, d, x[11]); /* 12 */ - FF(d, e, a, b, c, x[12]); /* 13 */ - FF(c, d, e, a, b, x[13]); /* 14 */ - FF(b, c, d, e, a, x[14]); /* 15 */ - FF(a, b, c, d, e, x[15]); /* 16 */ - FF(e, a, b, c, d, W(16)); /* 17 */ - FF(d, e, a, b, c, W(17)); /* 18 */ - FF(c, d, e, a, b, W(18)); /* 19 */ - FF(b, c, d, e, a, W(19)); /* 20 */ - - /* Round 2 */ - GG(a, b, c, d, e, W(20)); /* 21 */ - GG(e, a, b, c, d, W(21)); /* 22 */ - GG(d, e, a, b, c, W(22)); /* 23 */ - GG(c, d, e, a, b, W(23)); /* 24 */ - GG(b, c, d, e, a, W(24)); /* 25 */ - GG(a, b, c, d, e, W(25)); /* 26 */ - GG(e, a, b, c, d, W(26)); /* 27 */ - GG(d, e, a, b, c, W(27)); /* 28 */ - GG(c, d, e, a, b, W(28)); /* 29 */ - GG(b, c, d, e, a, W(29)); /* 30 */ - GG(a, b, c, d, e, W(30)); /* 31 */ - GG(e, a, b, c, d, W(31)); /* 32 */ - GG(d, e, a, b, c, W(32)); /* 33 */ - GG(c, d, e, a, b, W(33)); /* 34 */ - GG(b, c, d, e, a, W(34)); /* 35 */ - GG(a, b, c, d, e, W(35)); /* 36 */ - GG(e, a, b, c, d, W(36)); /* 37 */ - GG(d, e, a, b, c, W(37)); /* 38 */ - GG(c, d, e, a, b, W(38)); /* 39 */ - GG(b, c, d, e, a, W(39)); /* 40 */ - - /* Round 3 */ - HH(a, b, c, d, e, W(40)); /* 41 */ - HH(e, a, b, c, d, W(41)); /* 42 */ - HH(d, e, a, b, c, W(42)); /* 43 */ - HH(c, d, e, a, b, W(43)); /* 44 */ - HH(b, c, d, e, a, W(44)); /* 45 */ - HH(a, b, c, d, e, W(45)); /* 46 */ - HH(e, a, b, c, d, W(46)); /* 47 */ - HH(d, e, a, b, c, W(47)); /* 48 */ - HH(c, d, e, a, b, W(48)); /* 49 */ - HH(b, c, d, e, a, W(49)); /* 50 */ - HH(a, b, c, d, e, W(50)); /* 51 */ - HH(e, a, b, c, d, W(51)); /* 52 */ - HH(d, e, a, b, c, W(52)); /* 53 */ - HH(c, d, e, a, b, W(53)); /* 54 */ - HH(b, c, d, e, a, W(54)); /* 55 */ - HH(a, b, c, d, e, W(55)); /* 56 */ - HH(e, a, b, c, d, W(56)); /* 57 */ - HH(d, e, a, b, c, W(57)); /* 58 */ - HH(c, d, e, a, b, W(58)); /* 59 */ - HH(b, c, d, e, a, W(59)); /* 60 */ - - /* Round 4 */ - II(a, b, c, d, e, W(60)); /* 61 */ - II(e, a, b, c, d, W(61)); /* 62 */ - II(d, e, a, b, c, W(62)); /* 63 */ - II(c, d, e, a, b, W(63)); /* 64 */ - II(b, c, d, e, a, W(64)); /* 65 */ - II(a, b, c, d, e, W(65)); /* 66 */ - II(e, a, b, c, d, W(66)); /* 67 */ - II(d, e, a, b, c, W(67)); /* 68 */ - II(c, d, e, a, b, W(68)); /* 69 */ - II(b, c, d, e, a, W(69)); /* 70 */ - II(a, b, c, d, e, W(70)); /* 71 */ - II(e, a, b, c, d, W(71)); /* 72 */ - II(d, e, a, b, c, W(72)); /* 73 */ - II(c, d, e, a, b, W(73)); /* 74 */ - II(b, c, d, e, a, W(74)); /* 75 */ - II(a, b, c, d, e, W(75)); /* 76 */ - II(e, a, b, c, d, W(76)); /* 77 */ - II(d, e, a, b, c, W(77)); /* 78 */ - II(c, d, e, a, b, W(78)); /* 79 */ - II(b, c, d, e, a, W(79)); /* 80 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - - /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); -} -/* }}} */ - -/* {{{ SHA1Encode - Encodes input (php_uint32) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void SHA1Encode(output, input, len) -unsigned char *output; -php_uint32 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char) ((input[i] >> 24) & 0xff); - output[j + 1] = (unsigned char) ((input[i] >> 16) & 0xff); - output[j + 2] = (unsigned char) ((input[i] >> 8) & 0xff); - output[j + 3] = (unsigned char) (input[i] & 0xff); - } -} -/* }}} */ - -/* {{{ SHA1Decode - Decodes input (unsigned char) into output (php_uint32). Assumes len is - a multiple of 4. - */ -static void SHA1Decode(output, input, len) -php_uint32 *output; -const unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((php_uint32) input[j + 3]) | (((php_uint32) input[j + 2]) << 8) | - (((php_uint32) input[j + 1]) << 16) | (((php_uint32) input[j]) << 24); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h deleted file mode 100644 index ec4bbfc2f54ed..0000000000000 --- a/ext/standard/sha1.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stefan Esser | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SHA1_H -#define SHA1_H - -#include "ext/standard/basic_functions.h" - -/* SHA1 context. */ -typedef struct { - php_uint32 state[5]; /* state (ABCD) */ - php_uint32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} PHP_SHA1_CTX; - -PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX *); -PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, unsigned int); -PHPAPI void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *); - -PHP_FUNCTION(sha1); -PHP_FUNCTION(sha1_file); - -#endif diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c deleted file mode 100644 index 9d64263f732eb..0000000000000 --- a/ext/standard/soundex.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Bjĝrn Borud - Guardian Networks AS | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" -#include -#include -#include -#include "php_string.h" - -/* Simple soundex algorithm as described by Knuth in TAOCP, vol 3 */ -/* {{{ proto string soundex(string str) - Calculate the soundex key of a string */ -PHP_FUNCTION(soundex) -{ - char *str; - int i, _small, str_len, code, last; - char soundex[4 + 1]; - - static char soundex_table[26] = - {0, /* A */ - '1', /* B */ - '2', /* C */ - '3', /* D */ - 0, /* E */ - '1', /* F */ - '2', /* G */ - 0, /* H */ - 0, /* I */ - '2', /* J */ - '2', /* K */ - '4', /* L */ - '5', /* M */ - '5', /* N */ - 0, /* O */ - '1', /* P */ - '2', /* Q */ - '6', /* R */ - '2', /* S */ - '3', /* T */ - 0, /* U */ - '1', /* V */ - 0, /* W */ - '2', /* X */ - 0, /* Y */ - '2'}; /* Z */ - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { - return; - } - if (str_len == 0) { - RETURN_FALSE; - } - - /* build soundex string */ - last = -1; - for (i = 0, _small = 0; i < str_len && _small < 4; i++) { - /* convert chars to upper case and strip non-letter chars */ - /* BUG: should also map here accented letters used in non */ - /* English words or names (also found in English text!): */ - /* esstsett, thorn, n-tilde, c-cedilla, s-caron, ... */ - code = toupper((int)(unsigned char)str[i]); - if (code >= 'A' && code <= 'Z') { - if (_small == 0) { - /* remember first valid char */ - soundex[_small++] = code; - last = soundex_table[code - 'A']; - } - else { - /* ignore sequences of consonants with same soundex */ - /* code in trail, and vowels unless they separate */ - /* consonant letters */ - code = soundex_table[code - 'A']; - if (code != last) { - if (code != 0) { - soundex[_small++] = code; - } - last = code; - } - } - } - } - /* pad with '0' and terminate with 0 ;-) */ - while (_small < 4) { - soundex[_small++] = '0'; - } - soundex[_small] = '\0'; - - RETURN_STRINGL(soundex, _small, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c deleted file mode 100644 index 9b5f5ab0e08d1..0000000000000 --- a/ext/standard/streamsfuncs.c +++ /dev/null @@ -1,1432 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | Sara Golemon | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/flock_compat.h" -#include "ext/standard/file.h" -#include "ext/standard/php_filestat.h" -#include "php_open_temporary_file.h" -#include "ext/standard/basic_functions.h" -#include "php_ini.h" -#include "streamsfuncs.h" -#include "php_network.h" -#include "php_string.h" - -#ifndef PHP_WIN32 -#define php_select(m, r, w, e, t) select(m, r, w, e, t) -#else -#include "win32/select.h" -#endif - -static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC); - -/* Streams based network functions */ - -#if HAVE_SOCKETPAIR -/* {{{ proto array stream_socket_pair(int domain, int type, int protocol) - Creates a pair of connected, indistinguishable socket streams */ -PHP_FUNCTION(stream_socket_pair) -{ - long domain, type, protocol; - php_stream *s1, *s2; - int pair[2]; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", - &domain, &type, &protocol)) { - RETURN_FALSE; - } - - if (0 != socketpair(domain, type, protocol, pair)) { - char errbuf[256]; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create sockets: [%d]: %s", - php_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf))); - RETURN_FALSE; - } - - array_init(return_value); - - s1 = php_stream_sock_open_from_socket(pair[0], 0); - s2 = php_stream_sock_open_from_socket(pair[1], 0); - - add_next_index_resource(return_value, php_stream_get_resource_id(s1)); - add_next_index_resource(return_value, php_stream_get_resource_id(s2)); -} -/* }}} */ -#endif - -/* {{{ proto resource stream_socket_client(string remoteaddress [, long &errcode, string &errstring, double timeout, long flags, resource context]) - Open a client connection to a remote address */ -PHP_FUNCTION(stream_socket_client) -{ - char *host; - int host_len; - zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL; - double timeout = FG(default_socket_timeout); - unsigned long conv; - struct timeval tv; - char *hashkey = NULL; - php_stream *stream = NULL; - int err; - long flags = PHP_STREAM_CLIENT_CONNECT; - char *errstr = NULL; - php_stream_context *context = NULL; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zzd!lr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) { - RETURN_FALSE; - } - - context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); - - if (flags & PHP_STREAM_CLIENT_PERSISTENT) { - spprintf(&hashkey, 0, "stream_socket_client__%s", host); - } - - /* prepare the timeout value for use */ - conv = (unsigned long) (timeout * 1000000.0); - tv.tv_sec = conv / 1000000; - tv.tv_usec = conv % 1000000; - - if (zerrno) { - zval_dtor(zerrno); - ZVAL_LONG(zerrno, 0); - } - if (zerrstr) { - zval_dtor(zerrstr); - ZVAL_STRING(zerrstr, "", 1); - } - - stream = php_stream_xport_create(host, host_len, ENFORCE_SAFE_MODE | REPORT_ERRORS, - STREAM_XPORT_CLIENT | (flags & PHP_STREAM_CLIENT_CONNECT ? STREAM_XPORT_CONNECT : 0) | - (flags & PHP_STREAM_CLIENT_ASYNC_CONNECT ? STREAM_XPORT_CONNECT_ASYNC : 0), - hashkey, &tv, context, &errstr, &err); - - if (stream == NULL) { - /* host might contain binary characters */ - char *quoted_host = php_addslashes(host, host_len, NULL, 0 TSRMLS_CC); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", quoted_host, errstr == NULL ? "Unknown error" : errstr); - efree(quoted_host); - } - - if (hashkey) { - efree(hashkey); - } - - if (stream == NULL) { - if (zerrno) { - zval_dtor(zerrno); - ZVAL_LONG(zerrno, err); - } - if (zerrstr && errstr) { - /* no need to dup; we need to efree buf anyway */ - zval_dtor(zerrstr); - ZVAL_STRING(zerrstr, errstr, 0); - } else if (errstr) { - efree(errstr); - } - RETURN_FALSE; - } - - if (errstr) { - efree(errstr); - } - - php_stream_to_zval(stream, return_value); - - if (zcontext) { - zend_list_addref(Z_RESVAL_P(zcontext)); - } -} -/* }}} */ - -/* {{{ proto resource stream_socket_server(string localaddress [, long &errcode, string &errstring, long flags, resource context]) - Create a server socket bound to localaddress */ -PHP_FUNCTION(stream_socket_server) -{ - char *host; - int host_len; - zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL; - php_stream *stream = NULL; - int err = 0; - long flags = STREAM_XPORT_BIND | STREAM_XPORT_LISTEN; - char *errstr = NULL; - php_stream_context *context = NULL; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zzlr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) { - RETURN_FALSE; - } - - context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); - - if (zerrno) { - zval_dtor(zerrno); - ZVAL_LONG(zerrno, 0); - } - if (zerrstr) { - zval_dtor(zerrstr); - ZVAL_STRING(zerrstr, "", 1); - } - - stream = php_stream_xport_create(host, host_len, ENFORCE_SAFE_MODE | REPORT_ERRORS, - STREAM_XPORT_SERVER | flags, - NULL, NULL, context, &errstr, &err); - - if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr); - } - - if (stream == NULL) { - if (zerrno) { - zval_dtor(zerrno); - ZVAL_LONG(zerrno, err); - } - if (zerrstr && errstr) { - /* no need to dup; we need to efree buf anyway */ - zval_dtor(zerrstr); - ZVAL_STRING(zerrstr, errstr, 0); - } - RETURN_FALSE; - } - - if (errstr) { - efree(errstr); - } - - php_stream_to_zval(stream, return_value); - - if (zcontext) { - zend_list_addref(Z_RESVAL_P(zcontext)); - } -} -/* }}} */ - -/* {{{ proto resource stream_socket_accept(resource serverstream, [ double timeout, string &peername ]) - Accept a client connection from a server socket */ -PHP_FUNCTION(stream_socket_accept) -{ - double timeout = FG(default_socket_timeout); - zval *peername = NULL; - unsigned long conv; - struct timeval tv; - php_stream *stream = NULL, *clistream = NULL; - zval *zstream; - - char *errstr = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|dz", &zstream, &timeout, &peername) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - /* prepare the timeout value for use */ - conv = (unsigned long) (timeout * 1000000.0); - tv.tv_sec = conv / 1000000; - tv.tv_usec = conv % 1000000; - - if (peername) { - zval_dtor(peername); - ZVAL_NULL(peername); - } - - if (0 == php_stream_xport_accept(stream, &clistream, - peername ? &Z_STRVAL_P(peername) : NULL, - peername ? &Z_STRLEN_P(peername) : NULL, - NULL, NULL, - &tv, &errstr - TSRMLS_CC) && clistream) { - - if (peername) { - Z_TYPE_P(peername) = IS_STRING; - } - php_stream_to_zval(clistream, return_value); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr : "Unknown error"); - RETVAL_FALSE; - } - - if (errstr) { - efree(errstr); - } -} -/* }}} */ - -/* {{{ proto string stream_socket_get_name(resource stream, bool want_peer) - Returns either the locally bound or remote name for a socket stream */ -PHP_FUNCTION(stream_socket_get_name) -{ - php_stream *stream; - zval *zstream; - zend_bool want_peer; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - Z_TYPE_P(return_value) = IS_STRING; - - if (0 != php_stream_xport_get_name(stream, want_peer, - &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), - NULL, NULL - TSRMLS_CC)) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto long stream_socket_sendto(resouce stream, string data [, long flags [, string target_addr]]) - Send data to a socket stream. If target_addr is specified it must be in dotted quad (or [ipv6]) format */ -PHP_FUNCTION(stream_socket_sendto) -{ - php_stream *stream; - zval *zstream; - long flags = 0; - char *data, *target_addr; - int datalen, target_addr_len = 0; - php_sockaddr_storage sa; - socklen_t sl = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) { - RETURN_FALSE; - } - php_stream_from_zval(stream, &zstream); - - if (target_addr_len) { - /* parse the address */ - if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr); - RETURN_FALSE; - } - } - - RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, flags, target_addr ? &sa : NULL, sl TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto string stream_socket_recvfrom(resource stream, long amount [, long flags [, string &remote_addr]]) - Receives data from a socket stream */ -PHP_FUNCTION(stream_socket_recvfrom) -{ - php_stream *stream; - zval *zstream, *zremote = NULL; - long to_read = 0; - char *read_buf; - long flags = 0; - int recvd; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz", &zstream, &to_read, &flags, &zremote) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - if (zremote) { - zval_dtor(zremote); - ZVAL_NULL(zremote); - Z_STRLEN_P(zremote) = 0; - } - - if (to_read <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0."); - RETURN_FALSE; - } - - read_buf = emalloc(to_read + 1); - - recvd = php_stream_xport_recvfrom(stream, read_buf, to_read, flags, NULL, NULL, - zremote ? &Z_STRVAL_P(zremote) : NULL, - zremote ? &Z_STRLEN_P(zremote) : NULL - TSRMLS_CC); - - if (recvd >= 0) { - if (zremote && Z_STRLEN_P(zremote)) { - Z_TYPE_P(zremote) = IS_STRING; - } - read_buf[recvd] = '\0'; - - if (PG(magic_quotes_runtime)) { - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = php_addslashes(Z_STRVAL_P(return_value), - Z_STRLEN_P(return_value), &Z_STRLEN_P(return_value), 1 TSRMLS_CC); - return; - } else { - RETURN_STRINGL(read_buf, recvd, 0); - } - } - - efree(read_buf); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto long stream_get_contents(resource source [, long maxlen [, long offset]]) - Reads all remaining bytes (or up to maxlen bytes) from a stream and returns them as a string. */ -PHP_FUNCTION(stream_get_contents) -{ - php_stream *stream; - zval *zsrc; - long maxlen = PHP_STREAM_COPY_ALL, pos = 0; - int len, newlen; - char *contents = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &pos) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zsrc); - - if (pos > 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos); - RETURN_FALSE; - } - - if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { - - if (PG(magic_quotes_runtime)) { - contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ - len = newlen; - } - - RETVAL_STRINGL(contents, len, 0); - } else if (len == 0) { - RETVAL_EMPTY_STRING(); - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto long stream_copy_to_stream(resource source, resource dest [, long maxlen [, long pos]]) - Reads up to maxlen bytes from source stream and writes them to dest stream. */ -PHP_FUNCTION(stream_copy_to_stream) -{ - php_stream *src, *dest; - zval *zsrc, *zdest; - long maxlen = PHP_STREAM_COPY_ALL, pos = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(src, &zsrc); - php_stream_from_zval(dest, &zdest); - - if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos); - RETURN_FALSE; - } - - RETURN_LONG(php_stream_copy_to_stream(src, dest, maxlen)); -} -/* }}} */ - -/* {{{ proto resource stream_get_meta_data(resource fp) - Retrieves header/meta data from streams/file pointers */ -PHP_FUNCTION(stream_get_meta_data) -{ - zval **arg1; - php_stream *stream; - zval *newval; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - php_stream_from_zval(stream, arg1); - - array_init(return_value); - - if (stream->wrapperdata) { - MAKE_STD_ZVAL(newval); - *newval = *(stream->wrapperdata); - zval_copy_ctor(newval); - INIT_PZVAL(newval); - - add_assoc_zval(return_value, "wrapper_data", newval); - } - if (stream->wrapper) { - add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); - } - add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); - - add_assoc_string(return_value, "mode", stream->mode, 1); - - if (stream->readfilters.head) { - php_stream_filter *filter; - - MAKE_STD_ZVAL(newval); - array_init(newval); - - for (filter = stream->readfilters.head; filter != NULL; filter = filter->next) { - add_next_index_string(newval, (char *)filter->fops->label, 1); - } - - add_assoc_zval(return_value, "read_filters", newval); - } - - if (stream->writefilters.head) { - php_stream_filter *filter; - - MAKE_STD_ZVAL(newval); - array_init(newval); - - for (filter = stream->writefilters.head; filter != NULL; filter = filter->next) { - add_next_index_string(newval, (char *)filter->fops->label, 1); - } - - add_assoc_zval(return_value, "write_filters", newval); - } - - add_assoc_long(return_value, "unread_bytes", stream->readbuf_avail); - - add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); - if (stream->orig_path) { - add_assoc_string(return_value, "uri", stream->orig_path, 1); - } - - if (!php_stream_populate_meta_data(stream, return_value)) { - add_assoc_bool(return_value, "timed_out", 0); - add_assoc_bool(return_value, "blocked", 1); - add_assoc_bool(return_value, "eof", php_stream_eof(stream)); - } - -} -/* }}} */ - -/* {{{ proto array stream_get_transports() - Retrieves list of registered socket transports */ -PHP_FUNCTION(stream_get_transports) -{ - HashTable *stream_xport_hash; - char *stream_xport; - int stream_xport_len; - ulong num_key; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if ((stream_xport_hash = php_stream_xport_get_hash())) { - array_init(return_value); - zend_hash_internal_pointer_reset(stream_xport_hash); - while (zend_hash_get_current_key_ex(stream_xport_hash, - &stream_xport, &stream_xport_len, - &num_key, 0, NULL) == HASH_KEY_IS_STRING) { - add_next_index_stringl(return_value, stream_xport, stream_xport_len, 1); - zend_hash_move_forward(stream_xport_hash); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array stream_get_wrappers() - Retrieves list of registered stream wrappers */ -PHP_FUNCTION(stream_get_wrappers) -{ - HashTable *url_stream_wrappers_hash; - char *stream_protocol; - int key_flags, stream_protocol_len = 0; - ulong num_key; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { - array_init(return_value); - for(zend_hash_internal_pointer_reset(url_stream_wrappers_hash); - (key_flags = zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; - zend_hash_move_forward(url_stream_wrappers_hash)) { - if (key_flags == HASH_KEY_IS_STRING) { - add_next_index_stringl(return_value, stream_protocol, stream_protocol_len, 1); - } - } - } else { - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ stream_select related functions */ -static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd TSRMLS_DC) -{ - zval **elem; - php_stream *stream; - php_socket_t this_fd; - - if (Z_TYPE_P(stream_array) != IS_ARRAY) { - return 0; - } - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream_array)); - zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(stream_array))) { - - php_stream_from_zval_no_verify(stream, elem); - if (stream == NULL) { - continue; - } - /* get the fd. - * NB: Most other code will NOT use the PHP_STREAM_CAST_INTERNAL flag - * when casting. It is only used here so that the buffered data warning - * is not displayed. - * */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { - - PHP_SAFE_FD_SET(this_fd, fds); - - if (this_fd > *max_fd) { - *max_fd = this_fd; - } - } - } - return 1; -} - -static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) -{ - zval **elem, **dest_elem; - php_stream *stream; - HashTable *new_hash; - int this_fd, ret = 0; - - if (Z_TYPE_P(stream_array) != IS_ARRAY) { - return 0; - } - ALLOC_HASHTABLE(new_hash); - zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0); - - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream_array)); - zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(stream_array))) { - - php_stream_from_zval_no_verify(stream, elem); - if (stream == NULL) { - continue; - } - /* get the fd - * NB: Most other code will NOT use the PHP_STREAM_CAST_INTERNAL flag - * when casting. It is only used here so that the buffered data warning - * is not displayed. - */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { - if (PHP_SAFE_FD_ISSET(this_fd, fds)) { - zend_hash_next_index_insert(new_hash, (void *)elem, sizeof(zval *), (void **)&dest_elem); - if (dest_elem) { - zval_add_ref(dest_elem); - } - ret++; - continue; - } - } - } - - /* destroy old array and add new one */ - zend_hash_destroy(Z_ARRVAL_P(stream_array)); - efree(Z_ARRVAL_P(stream_array)); - - zend_hash_internal_pointer_reset(new_hash); - Z_ARRVAL_P(stream_array) = new_hash; - - return ret; -} - -static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC) -{ - zval **elem, **dest_elem; - php_stream *stream; - HashTable *new_hash; - int ret = 0; - - if (Z_TYPE_P(stream_array) != IS_ARRAY) { - return 0; - } - ALLOC_HASHTABLE(new_hash); - zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0); - - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream_array)); - zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(stream_array))) { - - php_stream_from_zval_no_verify(stream, elem); - if (stream == NULL) { - continue; - } - if ((stream->readbuf_avail) > 0) { - /* allow readable non-descriptor based streams to participate in stream_select. - * Non-descriptor streams will only "work" if they have previously buffered the - * data. Not ideal, but better than nothing. - * This branch of code also allows blocking streams with buffered data to - * operate correctly in stream_select. - * */ - zend_hash_next_index_insert(new_hash, (void *)elem, sizeof(zval *), (void **)&dest_elem); - if (dest_elem) { - zval_add_ref(dest_elem); - } - ret++; - continue; - } - } - - if (ret > 0) { - /* destroy old array and add new one */ - zend_hash_destroy(Z_ARRVAL_P(stream_array)); - efree(Z_ARRVAL_P(stream_array)); - - zend_hash_internal_pointer_reset(new_hash); - Z_ARRVAL_P(stream_array) = new_hash; - } else { - zend_hash_destroy(new_hash); - FREE_HASHTABLE(new_hash); - } - - return ret; -} -/* }}} */ - -/* {{{ proto int stream_select(array &read_streams, array &write_streams, array &except_streams, int tv_sec[, int tv_usec]) - Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec */ -PHP_FUNCTION(stream_select) -{ - zval *r_array, *w_array, *e_array, *sec = NULL; - struct timeval tv; - struct timeval *tv_p = NULL; - fd_set rfds, wfds, efds; - int max_fd = 0; - int retval, sets = 0; - long usec = 0; - int set_count, max_set_count = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) - return; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_ZERO(&efds); - - if (r_array != NULL) { - set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC); - if (set_count > max_set_count) - max_set_count = set_count; - sets += set_count; - } - - if (w_array != NULL) { - set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC); - if (set_count > max_set_count) - max_set_count = set_count; - sets += set_count; - } - - if (e_array != NULL) { - set_count = stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC); - if (set_count > max_set_count) - max_set_count = set_count; - sets += set_count; - } - - if (!sets) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed"); - RETURN_FALSE; - } - - PHP_SAFE_MAX_FD(max_fd, max_set_count); - - /* If seconds is not set to null, build the timeval, else we wait indefinitely */ - if (sec != NULL) { - convert_to_long_ex(&sec); - - /* Solaris + BSD do not like microsecond values which are >= 1 sec */ - if (usec > 999999) { - tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); - tv.tv_usec = usec % 1000000; - } else { - tv.tv_sec = Z_LVAL_P(sec); - tv.tv_usec = usec; - } - - tv_p = &tv; - } - - /* slight hack to support buffered data; if there is data sitting in the - * read buffer of any of the streams in the read array, let's pretend - * that we selected, but return only the readable sockets */ - if (r_array != NULL) { - - retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC); - if (retval > 0) { - RETURN_LONG(retval); - } - } - - retval = php_select(max_fd+1, &rfds, &wfds, &efds, tv_p); - - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)", - errno, strerror(errno), max_fd); - RETURN_FALSE; - } - - if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds TSRMLS_CC); - if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds TSRMLS_CC); - if (e_array != NULL) stream_array_from_fd_set(e_array, &efds TSRMLS_CC); - - RETURN_LONG(retval); -} -/* }}} */ - -/* {{{ stream_context related functions */ -static void user_space_stream_notifier(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC) -{ - zval *callback = (zval*)context->notifier->ptr; - zval *retval = NULL; - zval zvs[6]; - zval *ps[6]; - zval **ptps[6]; - int i; - - for (i = 0; i < 6; i++) { - INIT_ZVAL(zvs[i]); - ps[i] = &zvs[i]; - ptps[i] = &ps[i]; - } - - ZVAL_LONG(ps[0], notifycode); - ZVAL_LONG(ps[1], severity); - if (xmsg) { - ZVAL_STRING(ps[2], xmsg, 0); - } else { - ZVAL_NULL(ps[2]); - } - ZVAL_LONG(ps[3], xcode); - ZVAL_LONG(ps[4], bytes_sofar); - ZVAL_LONG(ps[5], bytes_max); - - if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier"); - } - if (retval) { - zval_ptr_dtor(&retval); - } -} - -static void user_space_stream_notifier_dtor(php_stream_notifier *notifier) -{ - if (notifier && notifier->ptr) { - zval_ptr_dtor((zval **)&(notifier->ptr)); - notifier->ptr = NULL; - } -} - -static int parse_context_options(php_stream_context *context, zval *options TSRMLS_DC) -{ - HashPosition pos, opos; - zval **wval, **oval; - char *wkey, *okey; - int wkey_len, okey_len; - int ret = SUCCESS; - ulong num_key; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), &pos); - while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), (void**)&wval, &pos)) { - int wtype = zend_hash_get_current_key_ex(Z_ARRVAL_P(options), &wkey, &wkey_len, &num_key, 0, &pos); - if (((HASH_KEY_IS_STRING == wtype) || (HASH_KEY_IS_UNICODE == wtype)) - && Z_TYPE_PP(wval) == IS_ARRAY) { - if (HASH_KEY_IS_UNICODE == wtype) { - /* fold to string */ - UErrorCode errCode = 0; - - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &wkey, &wkey_len, (UChar*)wkey, wkey_len, &errCode); - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), &opos); - while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)&oval, &opos)) { - int otype = zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, &num_key, 0, &opos); - if (HASH_KEY_IS_UNICODE == otype) { - /* fold to string */ - UErrorCode errCode = 0; - - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &okey, &okey_len, (UChar*)okey, okey_len, &errCode); - php_stream_context_set_option(context, wkey, okey, *oval); - efree(okey); - } - if (HASH_KEY_IS_STRING == otype) { - php_stream_context_set_option(context, wkey, okey, *oval); - } - zend_hash_move_forward_ex(Z_ARRVAL_PP(wval), &opos); - } - if (wtype == HASH_KEY_IS_UNICODE) { - efree(wkey); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value"); - } - zend_hash_move_forward_ex(Z_ARRVAL_P(options), &pos); - } - - return ret; -} - -static int parse_context_params(php_stream_context *context, zval *params TSRMLS_DC) -{ - int ret = SUCCESS; - zval **tmp; - U_STRING_DECL(u_notification, "notification", 12); - U_STRING_DECL(u_options, "options", 7); - U_STRING_DECL(u_input_encoding, "input_encoding", 14); - U_STRING_DECL(u_output_encoding, "output_encoding", 15); - U_STRING_DECL(u_default_mode, "default_mode", 12); - - U_STRING_INIT(u_notification, "notification", 12); - U_STRING_INIT(u_options, "options", 7); - U_STRING_INIT(u_input_encoding, "input_encoding", 14); - U_STRING_INIT(u_output_encoding, "output_encoding", 15); - U_STRING_INIT(u_default_mode, "default_mode", 12); - - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, u_notification, sizeof("notification"), (void**)&tmp)) { - - if (context->notifier) { - php_stream_notification_free(context->notifier); - context->notifier = NULL; - } - - context->notifier = php_stream_notification_alloc(); - context->notifier->func = user_space_stream_notifier; - context->notifier->ptr = *tmp; - ZVAL_ADDREF(*tmp); - context->notifier->dtor = user_space_stream_notifier_dtor; - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, u_options, sizeof("options"), (void**)&tmp)) { - parse_context_options(context, *tmp TSRMLS_CC); - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, u_input_encoding, sizeof("input_encoding"), (void**)&tmp)) { - zval strval = **tmp; - - if (context->input_encoding) { - efree(context->input_encoding); - } - - zval_copy_ctor(&strval); - convert_to_string(&strval); - context->input_encoding = Z_STRVAL(strval); - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, u_output_encoding, sizeof("output_encoding"), (void**)&tmp)) { - zval strval = **tmp; - - if (context->output_encoding) { - efree(context->output_encoding); - } - - zval_copy_ctor(&strval); - convert_to_string(&strval); - context->output_encoding = Z_STRVAL(strval); - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp) || - SUCCESS == zend_u_hash_find(Z_ARRVAL_P(params), IS_UNICODE, u_default_mode, sizeof("default_mode"), (void**)&tmp)) { - zval longval = **tmp; - - zval_copy_ctor(&longval); - convert_to_long(&longval); - context->default_mode = Z_LVAL(longval); - zval_dtor(&longval); - } - return ret; -} - -/* given a zval which is either a stream or a context, return the underlying - * stream_context. If it is a stream that does not have a context assigned, it - * will create and assign a context and return that. */ -static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC) -{ - php_stream_context *context = NULL; - - context = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context()); - if (context == NULL) { - php_stream *stream; - - stream = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream); - - if (stream) { - context = stream->context; - if (context == NULL) { - /* Only way this happens is if file is opened with NO_DEFAULT_CONTEXT - param, but then something is called which requires a context. - Don't give them the default one though since they already said they - didn't want it. */ - context = stream->context = php_stream_context_alloc(); - } - } - } - - return context; -} -/* }}} */ - -/* {{{ proto array stream_context_get_options(resource context|resource stream) - Retrieve options for a stream/wrapper/context */ -PHP_FUNCTION(stream_context_get_options) -{ - zval *zcontext; - php_stream_context *context; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { - RETURN_FALSE; - } - context = decode_context_param(zcontext TSRMLS_CC); - if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter."); - RETURN_FALSE; - } - - RETURN_ZVAL(context->options, 1, 0); -} -/* }}} */ - -/* {{{ proto bool stream_context_set_option(resource context|resource stream, string wrappername, string optionname, mixed value) - Set an option for a wrapper */ -PHP_FUNCTION(stream_context_set_option) -{ - zval *options = NULL, *zcontext = NULL, *zvalue = NULL; - php_stream_context *context; - char *wrappername, *optionname; - int wrapperlen, optionlen; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "rssz", &zcontext, &wrappername, &wrapperlen, - &optionname, &optionlen, &zvalue) == FAILURE) { - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "ra", &zcontext, &options) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "called with wrong number or type of parameters; please RTM"); - RETURN_FALSE; - } - } - - /* figure out where the context is coming from exactly */ - context = decode_context_param(zcontext TSRMLS_CC); - if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter."); - RETURN_FALSE; - } - - if (options) { - /* handle the array syntax */ - RETVAL_BOOL(parse_context_options(context, options TSRMLS_CC) == SUCCESS); - } else { - php_stream_context_set_option(context, wrappername, optionname, zvalue); - RETVAL_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool stream_context_set_params(resource context|resource stream, array options) - Set parameters for a file context */ -PHP_FUNCTION(stream_context_set_params) -{ - zval *params, *zcontext; - php_stream_context *context; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, ¶ms) == FAILURE) { - RETURN_FALSE; - } - - context = decode_context_param(zcontext TSRMLS_CC); - if (!context) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter."); - RETURN_FALSE; - } - - RETVAL_BOOL(parse_context_params(context, params TSRMLS_CC) == SUCCESS); -} -/* }}} */ - -/* {{{ proto resource stream_context_get_default([array options]) - Get a handle on the default file/stream context and optionally set parameters */ -PHP_FUNCTION(stream_context_get_default) -{ - zval *params = NULL; - php_stream_context *context; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", ¶ms) == FAILURE) { - RETURN_FALSE; - } - - if (FG(default_context) == NULL) { - FG(default_context) = php_stream_context_alloc(); - } - context = FG(default_context); - - if (params) { - parse_context_options(context, params TSRMLS_CC); - } - - php_stream_context_to_zval(context, return_value); -} -/* }}} */ - -/* {{{ proto resource stream_context_create([array options]) - Create a file context and optionally set parameters */ -PHP_FUNCTION(stream_context_create) -{ - zval *params = NULL; - php_stream_context *context; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", ¶ms) == FAILURE) { - RETURN_FALSE; - } - - context = php_stream_context_alloc(); - - if (params) { - parse_context_options(context, params TSRMLS_CC); - } - - php_stream_context_to_zval(context, return_value); -} -/* }}} */ - -/* {{{ streams filter functions */ -static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *zstream; - php_stream *stream; - char *filtername; - int filternamelen; - long read_write = 0; - zval *filterparams = NULL; - php_stream_filter *filter = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream, - &filtername, &filternamelen, &read_write, &filterparams) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - if ((read_write & PHP_STREAM_FILTER_ALL) == 0) { - /* Chain not specified. - * Examine stream->mode to determine which filters are needed - * There's no harm in attaching a filter to an unused chain, - * but why waste the memory and clock cycles? - */ - if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { - read_write |= PHP_STREAM_FILTER_READ; - } - if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { - read_write |= PHP_STREAM_FILTER_WRITE; - } - } - - if (read_write & PHP_STREAM_FILTER_READ) { - filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC); - if (filter == NULL) { - RETURN_FALSE; - } - - if (append) { - php_stream_filter_append(&stream->readfilters, filter); - } else { - php_stream_filter_prepend(&stream->readfilters, filter); - } - if (FAILURE == php_stream_filter_check_chain(&stream->readfilters)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Readfilter chain unstable -- unresolvable unicode/string conversion conflict"); - } - } - - if (read_write & PHP_STREAM_FILTER_WRITE) { - filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC); - if (filter == NULL) { - RETURN_FALSE; - } - - if (append) { - php_stream_filter_append(&stream->writefilters, filter); - } else { - php_stream_filter_prepend(&stream->writefilters, filter); - } - if (FAILURE == php_stream_filter_check_chain(&stream->writefilters)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Writefilter chain unstable -- unresolvable unicode/string conversion conflict"); - } - } - - if (filter) { - RETURN_RESOURCE(filter->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, filter, php_file_le_stream_filter())); - } else { - RETURN_FALSE; - } -} - -/* {{{ proto resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]]) - Prepend a filter to a stream */ -PHP_FUNCTION(stream_filter_prepend) -{ - apply_filter_to_stream(0, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto resource stream_filter_append(resource stream, string filtername[, int read_write[, string filterparams]]) - Append a filter to a stream */ -PHP_FUNCTION(stream_filter_append) -{ - apply_filter_to_stream(1, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto bool stream_filter_remove(resource stream_filter) - Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource */ -PHP_FUNCTION(stream_filter_remove) -{ - zval *zfilter; - php_stream_filter *filter; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) { - RETURN_FALSE; - } - - filter = zend_fetch_resource(&zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter()); - if (!filter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid resource given, not a stream filter"); - RETURN_FALSE; - } - - if (php_stream_filter_flush(filter, 1) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to flush filter, not removing"); - RETURN_FALSE; - } - - if (zend_list_delete(Z_LVAL_P(zfilter)) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not invalidate filter, not removing"); - RETURN_FALSE; - } else { - if (FAILURE == php_stream_filter_check_chain(filter->chain)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filterchain unstable -- unresolvable unicode/string conversion conflict"); - } - - php_stream_filter_remove(filter, 1 TSRMLS_CC); - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto string stream_get_line(resource stream, int maxlen [, string ending]) - Read up to maxlen bytes from a stream or until the ending string is found */ -/* UTODO */ -PHP_FUNCTION(stream_get_line) -{ - char *str = NULL; - int str_len; - long max_length; - zval *zstream; - char *buf; - size_t buf_size; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) { - RETURN_FALSE; - } - - if (max_length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater then or equal to zero."); - RETURN_FALSE; - } - if (!max_length) { - max_length = PHP_SOCK_CHUNK_SIZE; - } - - php_stream_from_zval(stream, &zstream); - - if ((buf = php_stream_get_record(stream, max_length, &buf_size, str, str_len TSRMLS_CC))) { - RETURN_STRINGL(buf, buf_size, 0); - } else { - RETURN_FALSE; - } -} - -/* }}} */ - -/* {{{ proto bool stream_set_blocking(resource socket, int mode) - Set blocking/non-blocking mode on a socket or stream */ -PHP_FUNCTION(stream_set_blocking) -{ - zval **arg1, **arg2; - int block; - php_stream *stream; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - php_stream_from_zval(stream, arg1); - - convert_to_long_ex(arg2); - block = Z_LVAL_PP(arg2); - - if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block == 0 ? 0 : 1, NULL) == -1) - RETURN_FALSE; - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto bool set_socket_blocking(resource socket, int mode) - Set blocking/non-blocking mode on a socket */ -PHP_FUNCTION(set_socket_blocking) -{ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated, use stream_set_blocking() instead"); - PHP_FN(stream_set_blocking)(INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto bool stream_set_timeout(resource stream, int seconds, int microseconds) - Set timeout on stream read to seconds + microseonds */ -#if HAVE_SYS_TIME_H || defined(PHP_WIN32) -PHP_FUNCTION(stream_set_timeout) -{ - zval **socket, **seconds, **microseconds; - struct timeval t; - php_stream *stream; - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || - zend_get_parameters_ex(ZEND_NUM_ARGS(), &socket, &seconds, µseconds)==FAILURE) { - WRONG_PARAM_COUNT; - } - - php_stream_from_zval(stream, socket); - - convert_to_long_ex(seconds); - t.tv_sec = Z_LVAL_PP(seconds); - - if (ZEND_NUM_ARGS() == 3) { - convert_to_long_ex(microseconds); - t.tv_usec = Z_LVAL_PP(microseconds) % 1000000; - t.tv_sec += Z_LVAL_PP(microseconds) / 1000000; - } - else - t.tv_usec = 0; - - if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &t)) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -#endif /* HAVE_SYS_TIME_H || defined(PHP_WIN32) */ -/* }}} */ - -/* {{{ proto int stream_set_write_buffer(resource fp, int buffer) - Set file write buffer */ -PHP_FUNCTION(stream_set_write_buffer) -{ - zval **arg1, **arg2; - int ret; - size_t buff; - php_stream *stream; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &arg1, &arg2)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - /* NOTREACHED */ - break; - } - - php_stream_from_zval(stream, arg1); - - convert_to_long_ex(arg2); - buff = Z_LVAL_PP(arg2); - - /* if buff is 0 then set to non-buffered */ - if (buff == 0) { - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); - } else { - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); - } - - RETURN_LONG(ret == 0 ? 0 : EOF); -} -/* }}} */ - -/* {{{ proto int stream_socket_enable_crypto(resource stream, bool enable [, int cryptokind, resource sessionstream]) - Enable or disable a specific kind of crypto on the stream */ -PHP_FUNCTION(stream_socket_enable_crypto) -{ - long cryptokind; - zval *zstream, *zsessstream = NULL; - php_stream *stream, *sessstream = NULL; - zend_bool enable; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|lr", &zstream, &enable, &cryptokind, &zsessstream) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - if (ZEND_NUM_ARGS() >= 3) { - if (zsessstream) { - php_stream_from_zval(sessstream, &zsessstream); - } - - if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) { - RETURN_FALSE; - } - } - - ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC); - switch (ret) { - case -1: - RETURN_FALSE; - - case 0: - RETURN_LONG(0); - - default: - RETURN_TRUE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ - diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h deleted file mode 100644 index d0fa5ae839562..0000000000000 --- a/ext/standard/streamsfuncs.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Flags for stream_socket_client */ -#define PHP_STREAM_CLIENT_PERSISTENT 1 -#define PHP_STREAM_CLIENT_ASYNC_CONNECT 2 -#define PHP_STREAM_CLIENT_CONNECT 4 - -PHP_FUNCTION(stream_socket_client); -PHP_FUNCTION(stream_socket_server); -PHP_FUNCTION(stream_socket_accept); -PHP_FUNCTION(stream_socket_get_name); -PHP_FUNCTION(stream_socket_recvfrom); -PHP_FUNCTION(stream_socket_sendto); - -PHP_FUNCTION(stream_copy_to_stream); -PHP_FUNCTION(stream_get_contents); - -PHP_FUNCTION(set_socket_blocking); /* deprecated */ -PHP_FUNCTION(stream_set_blocking); -PHP_FUNCTION(stream_select); -PHP_FUNCTION(stream_set_timeout); -PHP_FUNCTION(stream_set_write_buffer); -PHP_FUNCTION(stream_get_transports); -PHP_FUNCTION(stream_get_wrappers); -PHP_FUNCTION(stream_get_line); -PHP_FUNCTION(stream_get_meta_data); -PHP_FUNCTION(stream_wrapper_register); -PHP_FUNCTION(stream_wrapper_unregister); -PHP_FUNCTION(stream_wrapper_restore); -PHP_FUNCTION(stream_context_create); -PHP_FUNCTION(stream_context_set_params); -PHP_FUNCTION(stream_context_set_option); -PHP_FUNCTION(stream_context_get_options); -PHP_FUNCTION(stream_context_get_default); -PHP_FUNCTION(stream_filter_prepend); -PHP_FUNCTION(stream_filter_append); -PHP_FUNCTION(stream_filter_remove); -PHP_FUNCTION(stream_socket_enable_crypto); -PHP_FUNCTION(stream_socket_pair); - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ - diff --git a/ext/standard/string.c b/ext/standard/string.c deleted file mode 100644 index 65158ed635d53..0000000000000 --- a/ext/standard/string.c +++ /dev/null @@ -1,6732 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Sĉther Bakken | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ - -#include -#include "php.h" -#include "reg.h" -#include "php_rand.h" -#include "php_string.h" -#include "php_variables.h" -#ifdef HAVE_LOCALE_H -# include -#endif -#ifdef HAVE_LANGINFO_H -# include -#endif -#ifdef HAVE_MONETARY_H -# include -#endif -#ifdef HAVE_LIBINTL -# include /* For LC_MESSAGES */ -#endif - -#include - -#include "scanf.h" -#include "zend_API.h" -#include "zend_execute.h" -#include "php_globals.h" -#include "basic_functions.h" -#include "php_smart_str.h" -#ifdef ZTS -#include "TSRM.h" -#endif - -#include "unicode/uchar.h" - -#define STR_PAD_LEFT 0 -#define STR_PAD_RIGHT 1 -#define STR_PAD_BOTH 2 -#define PHP_PATHINFO_DIRNAME 1 -#define PHP_PATHINFO_BASENAME 2 -#define PHP_PATHINFO_EXTENSION 4 -#define PHP_PATHINFO_ALL (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | PHP_PATHINFO_EXTENSION) - -#define STR_STRSPN 0 -#define STR_STRCSPN 1 - -/* {{{ register_string_constants - */ -void register_string_constants(INIT_FUNC_ARGS) -{ - REGISTER_LONG_CONSTANT("STR_PAD_LEFT", STR_PAD_LEFT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STR_PAD_RIGHT", STR_PAD_RIGHT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STR_PAD_BOTH", STR_PAD_BOTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PATHINFO_DIRNAME", PHP_PATHINFO_DIRNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PATHINFO_BASENAME", PHP_PATHINFO_BASENAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PATHINFO_EXTENSION", PHP_PATHINFO_EXTENSION, CONST_CS | CONST_PERSISTENT); - -#ifdef HAVE_LOCALECONV - /* If last members of struct lconv equal CHAR_MAX, no grouping is done */ - -/* This is bad, but since we are going to be hardcoding in the POSIX stuff anyway... */ -# ifndef HAVE_LIMITS_H -# define CHAR_MAX 127 -# endif - - REGISTER_LONG_CONSTANT("CHAR_MAX", CHAR_MAX, CONST_CS | CONST_PERSISTENT); -#endif - -#ifdef HAVE_LOCALE_H - REGISTER_LONG_CONSTANT("LC_CTYPE", LC_CTYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LC_NUMERIC", LC_NUMERIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LC_TIME", LC_TIME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LC_COLLATE", LC_COLLATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LC_MONETARY", LC_MONETARY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LC_ALL", LC_ALL, CONST_CS | CONST_PERSISTENT); -# ifdef LC_MESSAGES - REGISTER_LONG_CONSTANT("LC_MESSAGES", LC_MESSAGES, CONST_CS | CONST_PERSISTENT); -# endif -#endif - -} -/* }}} */ - -int php_tag_find(char *tag, int len, char *set); - -/* this is read-only, so it's ok */ -static char hexconvtab[] = "0123456789abcdef"; - -/* localeconv mutex */ -#ifdef ZTS -static MUTEX_T locale_mutex = NULL; -#endif - -/* {{{ php_bin2hex - */ -static char *php_bin2hex(const unsigned char *old, const size_t oldlen, size_t *newlen) -{ - register unsigned char *result = NULL; - size_t i, j; - - result = (char *) safe_emalloc(oldlen * 2, sizeof(char), 1); - - for (i = j = 0; i < oldlen; i++) { - result[j++] = hexconvtab[old[i] >> 4]; - result[j++] = hexconvtab[old[i] & 15]; - } - result[j] = '\0'; - - if (newlen) - *newlen = oldlen * 2 * sizeof(char); - - return result; -} -/* }}} */ - -#ifdef HAVE_LOCALECONV -/* {{{ localeconv_r - * glibc's localeconv is not reentrant, so lets make it so ... sorta */ -PHPAPI struct lconv *localeconv_r(struct lconv *out) -{ - struct lconv *res; - -# ifdef ZTS - tsrm_mutex_lock( locale_mutex ); -# endif - - /* localeconv doesn't return an error condition */ - res = localeconv(); - - *out = *res; - -# ifdef ZTS - tsrm_mutex_unlock( locale_mutex ); -# endif - - return out; -} -/* }}} */ - -# ifdef ZTS -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(localeconv) -{ - locale_mutex = tsrm_mutex_alloc(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(localeconv) -{ - tsrm_mutex_free( locale_mutex ); - locale_mutex = NULL; - return SUCCESS; -} -/* }}} */ -# endif -#endif - -/* {{{ proto string bin2hex(string data) - Converts the binary representation of data to hex */ -PHP_FUNCTION(bin2hex) -{ - unsigned char *data; - int data_len; - char *result; - size_t newlen; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "y", &data, &data_len) == FAILURE) { - return; - } - - result = php_bin2hex(data, data_len, &newlen); - - if (!result) { - RETURN_FALSE; - } - - RETVAL_ASCII_STRINGL(result, newlen, 0); - if (UG(unicode)) { - efree(result); - } -} -/* }}} */ - -static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) -{ - void *s1, *s2; - int32_t len1, len2; - zend_uchar type1, type2; - long start, len; /* For UNICODE, these are codepoint units */ - - start = 0; - len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT|ll", - &s1, &len1, &type1, &s2, &len2, &type2, - &start, &len) == FAILURE) { - return; - } - - if (ZEND_NUM_ARGS() < 4) { - len = len1; - } - - /* look at substr() function for more information */ - - if (start < 0) { - start += len1; - if (start < 0) { - start = 0; - } - } else if (start > len1) { - RETURN_FALSE; - } - - if (len < 0) { - len += (len1 - start); - if (len < 0) { - len = 0; - } - } - - if (((unsigned) start + (unsigned) len) > len1) { - len = len1 - start; - } - - if (type1 == IS_UNICODE) { - UChar *u_start, *u_end; - int32_t i = 0; - - U16_FWD_N((UChar*)s1, i, len1, start); - u_start = (UChar *)s1 + i; - U16_FWD_N((UChar *)s1, i, len1, len); - u_end = (UChar *)s1 + i; - - if (behavior == STR_STRSPN) { - RETURN_LONG(php_u_strspn(u_start /*str1_start*/, - (UChar *)s2 /*str2_start*/, - u_end /*str1_end*/, - (UChar *)s2 + len2 /*str2_end*/)); - } else if (behavior == STR_STRCSPN) { - RETURN_LONG(php_u_strcspn(u_start /*str1_start*/, - (UChar *)s2 /*str2_start*/, - u_end /*str1_end*/, - (UChar *)s2 + len2 /*str2_end*/)); - } - } else { - if (behavior == STR_STRSPN) { - RETURN_LONG(php_strspn((char *)s1 + start /*str1_start*/, - (char *)s2 /*str2_start*/, - (char *)s1 + start + len /*str1_end*/, - (char *)s2 + len2 /*str2_end*/)); - } else if (behavior == STR_STRCSPN) { - RETURN_LONG(php_strcspn((char *)s1 + start /*str1_start*/, - (char *)s2 /*str2_start*/, - (char *)s1 + start + len /*str1_end*/, - (char *)s2 + len2 /*str2_end*/)); - } - } - -} - -/* {{{ proto int strspn(string str, string mask [, start [, len]]) - Finds length of initial segment consisting entirely of characters found in mask. If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars) */ -PHP_FUNCTION(strspn) -{ - php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRSPN); -} -/* }}} */ - -/* {{{ proto int strcspn(string str, string mask [, start [, len]]) - Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provide works like strcspn(substr($s,$start,$len),$bad_chars) */ -PHP_FUNCTION(strcspn) -{ - php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRCSPN); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(nl_langinfo) */ -#if HAVE_NL_LANGINFO -PHP_MINIT_FUNCTION(nl_langinfo) -{ -#define REGISTER_NL_LANGINFO_CONSTANT(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT) -#ifdef ABDAY_1 - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_1); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_2); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_3); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_4); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_5); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_6); - REGISTER_NL_LANGINFO_CONSTANT(ABDAY_7); -#endif -#ifdef DAY_1 - REGISTER_NL_LANGINFO_CONSTANT(DAY_1); - REGISTER_NL_LANGINFO_CONSTANT(DAY_2); - REGISTER_NL_LANGINFO_CONSTANT(DAY_3); - REGISTER_NL_LANGINFO_CONSTANT(DAY_4); - REGISTER_NL_LANGINFO_CONSTANT(DAY_5); - REGISTER_NL_LANGINFO_CONSTANT(DAY_6); - REGISTER_NL_LANGINFO_CONSTANT(DAY_7); -#endif -#ifdef ABMON_1 - REGISTER_NL_LANGINFO_CONSTANT(ABMON_1); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_2); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_3); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_4); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_5); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_6); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_7); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_8); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_9); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_10); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_11); - REGISTER_NL_LANGINFO_CONSTANT(ABMON_12); -#endif -#ifdef MON_1 - REGISTER_NL_LANGINFO_CONSTANT(MON_1); - REGISTER_NL_LANGINFO_CONSTANT(MON_2); - REGISTER_NL_LANGINFO_CONSTANT(MON_3); - REGISTER_NL_LANGINFO_CONSTANT(MON_4); - REGISTER_NL_LANGINFO_CONSTANT(MON_5); - REGISTER_NL_LANGINFO_CONSTANT(MON_6); - REGISTER_NL_LANGINFO_CONSTANT(MON_7); - REGISTER_NL_LANGINFO_CONSTANT(MON_8); - REGISTER_NL_LANGINFO_CONSTANT(MON_9); - REGISTER_NL_LANGINFO_CONSTANT(MON_10); - REGISTER_NL_LANGINFO_CONSTANT(MON_11); - REGISTER_NL_LANGINFO_CONSTANT(MON_12); -#endif -#ifdef AM_STR - REGISTER_NL_LANGINFO_CONSTANT(AM_STR); -#endif -#ifdef PM_STR - REGISTER_NL_LANGINFO_CONSTANT(PM_STR); -#endif -#ifdef D_T_FMT - REGISTER_NL_LANGINFO_CONSTANT(D_T_FMT); -#endif -#ifdef D_FMT - REGISTER_NL_LANGINFO_CONSTANT(D_FMT); -#endif -#ifdef T_FMT - REGISTER_NL_LANGINFO_CONSTANT(T_FMT); -#endif -#ifdef T_FMT_AMPM - REGISTER_NL_LANGINFO_CONSTANT(T_FMT_AMPM); -#endif -#ifdef ERA - REGISTER_NL_LANGINFO_CONSTANT(ERA); -#endif -#ifdef ERA_YEAR - REGISTER_NL_LANGINFO_CONSTANT(ERA_YEAR); -#endif -#ifdef ERA_D_T_FMT - REGISTER_NL_LANGINFO_CONSTANT(ERA_D_T_FMT); -#endif -#ifdef ERA_D_FMT - REGISTER_NL_LANGINFO_CONSTANT(ERA_D_FMT); -#endif -#ifdef ERA_T_FMT - REGISTER_NL_LANGINFO_CONSTANT(ERA_T_FMT); -#endif -#ifdef ALT_DIGITS - REGISTER_NL_LANGINFO_CONSTANT(ALT_DIGITS); -#endif -#ifdef INT_CURR_SYMBOL - REGISTER_NL_LANGINFO_CONSTANT(INT_CURR_SYMBOL); -#endif -#ifdef CURRENCY_SYMBOL - REGISTER_NL_LANGINFO_CONSTANT(CURRENCY_SYMBOL); -#endif -#ifdef CRNCYSTR - REGISTER_NL_LANGINFO_CONSTANT(CRNCYSTR); -#endif -#ifdef MON_DECIMAL_POINT - REGISTER_NL_LANGINFO_CONSTANT(MON_DECIMAL_POINT); -#endif -#ifdef MON_THOUSANDS_SEP - REGISTER_NL_LANGINFO_CONSTANT(MON_THOUSANDS_SEP); -#endif -#ifdef MON_GROUPING - REGISTER_NL_LANGINFO_CONSTANT(MON_GROUPING); -#endif -#ifdef POSITIVE_SIGN - REGISTER_NL_LANGINFO_CONSTANT(POSITIVE_SIGN); -#endif -#ifdef NEGATIVE_SIGN - REGISTER_NL_LANGINFO_CONSTANT(NEGATIVE_SIGN); -#endif -#ifdef INT_FRAC_DIGITS - REGISTER_NL_LANGINFO_CONSTANT(INT_FRAC_DIGITS); -#endif -#ifdef FRAC_DIGITS - REGISTER_NL_LANGINFO_CONSTANT(FRAC_DIGITS); -#endif -#ifdef P_CS_PRECEDES - REGISTER_NL_LANGINFO_CONSTANT(P_CS_PRECEDES); -#endif -#ifdef P_SEP_BY_SPACE - REGISTER_NL_LANGINFO_CONSTANT(P_SEP_BY_SPACE); -#endif -#ifdef N_CS_PRECEDES - REGISTER_NL_LANGINFO_CONSTANT(N_CS_PRECEDES); -#endif -#ifdef N_SEP_BY_SPACE - REGISTER_NL_LANGINFO_CONSTANT(N_SEP_BY_SPACE); -#endif -#ifdef P_SIGN_POSN - REGISTER_NL_LANGINFO_CONSTANT(P_SIGN_POSN); -#endif -#ifdef N_SIGN_POSN - REGISTER_NL_LANGINFO_CONSTANT(N_SIGN_POSN); -#endif -#ifdef DECIMAL_POINT - REGISTER_NL_LANGINFO_CONSTANT(DECIMAL_POINT); -#endif -#ifdef RADIXCHAR - REGISTER_NL_LANGINFO_CONSTANT(RADIXCHAR); -#endif -#ifdef THOUSANDS_SEP - REGISTER_NL_LANGINFO_CONSTANT(THOUSANDS_SEP); -#endif -#ifdef THOUSEP - REGISTER_NL_LANGINFO_CONSTANT(THOUSEP); -#endif -#ifdef GROUPING - REGISTER_NL_LANGINFO_CONSTANT(GROUPING); -#endif -#ifdef YESEXPR - REGISTER_NL_LANGINFO_CONSTANT(YESEXPR); -#endif -#ifdef NOEXPR - REGISTER_NL_LANGINFO_CONSTANT(NOEXPR); -#endif -#ifdef YESSTR - REGISTER_NL_LANGINFO_CONSTANT(YESSTR); -#endif -#ifdef NOSTR - REGISTER_NL_LANGINFO_CONSTANT(NOSTR); -#endif -#ifdef CODESET - REGISTER_NL_LANGINFO_CONSTANT(CODESET); -#endif -#undef REGISTER_NL_LANGINFO_CONSTANT - return SUCCESS; -} -/* }}} */ - -/* {{{ proto string nl_langinfo(int item) - Query language and locale information */ -PHP_FUNCTION(nl_langinfo) -{ - zval **item; - char *value; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &item) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(item); - - value = nl_langinfo(Z_LVAL_PP(item)); - if (value == NULL) { - RETURN_FALSE; - } else { - RETURN_STRING(value, 1); - } -} -#endif -/* }}} */ - -#ifdef HAVE_STRCOLL -/* {{{ proto int strcoll(string str1, string str2) - Compares two strings using the current locale */ -PHP_FUNCTION(strcoll) -{ - zval **s1, **s2; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - - RETURN_LONG(strcoll((const char *) Z_STRVAL_PP(s1), - (const char *) Z_STRVAL_PP(s2))); -} -/* }}} */ -#endif - -/* {{{ php_charmask - * Fills a 256-byte bytemask with input. You can specify a range like 'a..z', - * it needs to be incrementing. - * Returns: FAILURE/SUCCESS wether the input was correct (i.e. no range errors) - */ -static inline int php_charmask(unsigned char *input, int len, char *mask TSRMLS_DC) -{ - unsigned char *end; - unsigned char c; - int result = SUCCESS; - - memset(mask, 0, 256); - for (end = input+len; input < end; input++) { - c=*input; - if ((input+3 < end) && input[1] == '.' && input[2] == '.' - && input[3] >= c) { - memset(mask+c, 1, input[3] - c + 1); - input+=3; - } else if ((input+1 < end) && input[0] == '.' && input[1] == '.') { - /* Error, try to be as helpful as possible: - (a range ending/starting with '.' won't be captured here) */ - if (end-len >= input) { /* there was no 'left' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'."); - result = FAILURE; - continue; - } - if (input+2 >= end) { /* there is no 'right' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'."); - result = FAILURE; - continue; - } - if (input[-1] > input[2]) { /* wrong order */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing."); - result = FAILURE; - continue; - } - /* FIXME: better error (a..b..c is the only left possibility?) */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range."); - result = FAILURE; - continue; - } else { - mask[c]=1; - } - } - return result; -} -/* }}} */ - -/* {{{ php_trim() - * mode 1 : trim left - * mode 2 : trim right - * mode 3 : trim left and right - * what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0') - */ -PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zend_uchar str_type, zval *return_value, int mode TSRMLS_DC) -{ - register int i; - int trimmed = 0; - char mask[256]; - - if (what) { - php_charmask(what, what_len, mask TSRMLS_CC); - } else { - php_charmask(" \n\r\t\v\0", 6, mask TSRMLS_CC); - } - - if (mode & 1) { - for (i = 0; i < len; i++) { - if (mask[(unsigned char)c[i]]) { - trimmed++; - } else { - break; - } - } - len -= trimmed; - c += trimmed; - } - if (mode & 2) { - for (i = len - 1; i >= 0; i--) { - if (mask[(unsigned char)c[i]]) { - len--; - } else { - break; - } - } - } - - if (return_value) { - if ( str_type == IS_BINARY ) { - RETVAL_BINARYL(c, len, 1); - } else { - RETVAL_STRINGL(c, len, 1); - } - } else { - return estrndup(c, len); - } - return ""; -} -/* }}} */ - -/* {{{ php_expand_u_trim_range() - * Expands possible ranges of the form 'a..b' in input charlist, - * where a < b in code-point order - */ -static int php_expand_u_trim_range(UChar **range, int32_t *range_len TSRMLS_DC) -{ - UChar32 *codepts, *tmp, *input, *end, c; - int32_t len, tmp_len, idx; - UErrorCode err; - int expanded = 0; - int result = SUCCESS; - - /* First, convert UTF-16 to UTF-32 */ - len = *range_len; - codepts = (UChar32 *)emalloc((len+1)*sizeof(UChar32)); - err = U_ZERO_ERROR; - u_strToUTF32((UChar32 *)codepts, len+1, &len, *range, len, &err); - - /* Expand ranges, if any - taken from php_charmask() */ - tmp_len = len; - tmp = (UChar32 *)emalloc((tmp_len+1)*sizeof(UChar32)); - input = codepts; - for ( idx = 0, end = input+len ; input < end ; input++ ) { - c = input[0]; - if ( (input+3 < end) && input[1] == '.' && input[2] == '.' && input[3] >= c ) { - tmp_len += (input[3] - c + 1); - tmp = (UChar32 *)erealloc(tmp, tmp_len*sizeof(UChar32)); - for ( ; c <= input[3] ; c++ ) { - if ( U_IS_UNICODE_CHAR(c) ) tmp[idx++] = c; - } - input += 3; - expanded++; - } else if ( (input+1 < end) && input[0] == '.' && input[1] == '.' ) { - /* Error, try to be as helpful as possible: - (a range ending/starting with '.' won't be captured here) */ - if ( end-len >= input ) { /* There is no 'left' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'"); - result = FAILURE; - continue; - } - if ( input+2 >= end ) { /* There is no 'right' char */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'"); - result = FAILURE; - continue; - } - if ( input[-1] > input[2] ) { /* Wrong order */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing"); - result = FAILURE; - continue; - } - /* FIXME: Better error (a..b..c is the only left possibility?) */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range"); - result = FAILURE; - continue; - } else { - tmp[idx++] = c; - } - } - - /* If any ranges were expanded, convert the expanded results back to UTF-16 */ - if ( expanded > 0 ) { - len = tmp_len; - *range = (UChar *)erealloc(*range, (len+1)*sizeof(UChar)); - err = U_ZERO_ERROR; - u_strFromUTF32(*range, len+1, &len, tmp, tmp_len, &err); - if ( U_FAILURE(err) == U_BUFFER_OVERFLOW_ERROR ) { - err = U_ZERO_ERROR; - *range = (UChar *)erealloc(*range, (len+1)*sizeof(UChar)); - u_strFromUTF32(*range, len+1, NULL, tmp, tmp_len, &err); - if ( U_FAILURE(err) ) { /* Internal ICU error */ - result = FAILURE; - } - } - *range_len = len; - } - - efree(tmp); - efree(codepts); - - return result; -} -/* }}} */ - -/* {{{ php_u_trim() - * Unicode capable version of php_trim() - */ -static UChar *php_u_trim(UChar *c, int32_t len, UChar *what, int32_t what_len, zval *return_value, int mode TSRMLS_DC) -{ - int32_t i,j; - UChar ch,wh; - int32_t start = 0, end = len; - - if ( what ) { - php_expand_u_trim_range(&what, &what_len TSRMLS_CC); - } - - if ( mode & 1 ) { - for ( i = 0 ; i < end ; ) { - U16_NEXT(c, i, end, ch); - if ( what ) { - for ( j = 0 ; j < what_len ; ) { - U16_NEXT(what, j, what_len, wh); - if ( wh == ch ) break; - } - if ( wh != ch ) break; - } else { - if ( u_isWhitespace(ch) == FALSE ) break; - } - } - if ( i < end ) { - U16_BACK_1(c, 0, i); /* U16_NEXT() post-increments 'i' */ - } - start = i; - } - if ( mode & 2 ) { - for ( i = end ; i > start ; ) { - U16_PREV(c, 0, i, ch); - if ( what ) { - for ( j = 0 ; j < what_len ; ) { - U16_NEXT(what, j, what_len, wh); - if ( wh == ch ) break; - } - if ( wh != ch ) break; - } else { - if ( u_isWhitespace(ch) == FALSE ) break; - } - } - end = i; - } else { - --end; - } - - if ( start < len ) { - if ( return_value ) { - RETVAL_UNICODEL(c+start, end-start+1, 1); - return NULL; - } else { - return eustrndup(c+start, end-start+1); - } - } else { /* Trimmed the whole string */ - if ( return_value ) { - RETVAL_EMPTY_UNICODE(); - return NULL; - } else { - return (USTR_MAKE("")); - } - } -} -/* }}} */ - -/* {{{ php_do_trim - * Base for trim(), rtrim() and ltrim() functions. - */ -static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval **str, **what; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &str, &what) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_text_ex(str); - - if (argc > 1) { - if (Z_TYPE_PP(str) != Z_TYPE_PP(what)) { - zend_error(E_WARNING, "%v() expects parameter 2 to be string (legacy, Unicode, or binary), %s given", - get_active_function_name(TSRMLS_C), - zend_zval_type_name(*what)); - } - if (Z_TYPE_PP(str) == IS_UNICODE) { - php_u_trim(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), Z_USTRVAL_PP(what), Z_USTRLEN_PP(what), return_value, mode TSRMLS_CC); - } else { - php_trim(Z_STRVAL_PP(str), Z_STRLEN_PP(str), Z_STRVAL_PP(what), Z_STRLEN_PP(what), Z_TYPE_PP(str), return_value, mode TSRMLS_CC); - } - } else { - if (Z_TYPE_PP(str) == IS_UNICODE) { - php_u_trim(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), NULL, 0, return_value, mode TSRMLS_CC); - } else { - php_trim(Z_STRVAL_PP(str), Z_STRLEN_PP(str), NULL, 0, Z_TYPE_PP(str), return_value, mode TSRMLS_CC); - } - } -} -/* }}} */ - -/* {{{ proto string trim(string str [, string character_mask]) - Strips whitespace from the beginning and end of a string */ -PHP_FUNCTION(trim) -{ - php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); -} -/* }}} */ - -/* {{{ proto string rtrim(string str [, string character_mask]) - Removes trailing whitespace */ -PHP_FUNCTION(rtrim) -{ - php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto string ltrim(string str [, string character_mask]) - Strips whitespace from the beginning of a string */ -PHP_FUNCTION(ltrim) -{ - php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string wordwrap(string str [, int width [, string break [, boolean cut]]]) - Wraps buffer to selected number of characters using string break char */ -PHP_FUNCTION(wordwrap) -{ - const char *text, *breakchar = "\n"; - char *newtext; - int textlen, breakcharlen = 1, newtextlen, alloced, chk; - long current = 0, laststart = 0, lastspace = 0; - long linelength = 75; - zend_bool docut = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lsb", &text, &textlen, &linelength, &breakchar, &breakcharlen, &docut) == FAILURE) { - return; - } - - if (textlen == 0) { - RETURN_EMPTY_STRING(); - } - - if (linelength == 0 && docut) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero."); - RETURN_FALSE; - } - - /* Special case for a single-character break as it needs no - additional storage space */ - if (breakcharlen == 1 && !docut) { - newtext = estrndup(text, textlen); - - laststart = lastspace = 0; - for (current = 0; current < textlen; current++) { - if (text[current] == breakchar[0]) { - laststart = lastspace = current; - } else if (text[current] == ' ') { - if (current - laststart >= linelength) { - newtext[current] = breakchar[0]; - laststart = current + 1; - } - lastspace = current; - } else if (current - laststart >= linelength && laststart != lastspace) { - newtext[lastspace] = breakchar[0]; - laststart = lastspace; - } - } - - RETURN_STRINGL(newtext, textlen, 0); - } else { - /* Multiple character line break or forced cut */ - if (linelength > 0) { - chk = (int)(textlen/linelength + 1); - alloced = textlen + chk * breakcharlen + 1; - } else { - chk = textlen; - alloced = textlen * (breakcharlen + 1) + 1; - } - newtext = emalloc(alloced); - - /* now keep track of the actual new text length */ - newtextlen = 0; - - laststart = lastspace = 0; - for (current = 0; current < textlen; current++) { - if (chk <= 0) { - alloced += (int) (((textlen - current + 1)/linelength + 1) * breakcharlen) + 1; - newtext = erealloc(newtext, alloced); - chk = (int) ((textlen - current)/linelength) + 1; - } - /* when we hit an existing break, copy to new buffer, and - * fix up laststart and lastspace */ - if (text[current] == breakchar[0] - && current + breakcharlen < textlen - && !strncmp(text+current, breakchar, breakcharlen)) { - memcpy(newtext+newtextlen, text+laststart, current-laststart+breakcharlen); - newtextlen += current-laststart+breakcharlen; - current += breakcharlen - 1; - laststart = lastspace = current + 1; - chk--; - } - /* if it is a space, check if it is at the line boundary, - * copy and insert a break, or just keep track of it */ - else if (text[current] == ' ') { - if (current - laststart >= linelength) { - memcpy(newtext+newtextlen, text+laststart, current-laststart); - newtextlen += current - laststart; - memcpy(newtext+newtextlen, breakchar, breakcharlen); - newtextlen += breakcharlen; - laststart = current + 1; - chk--; - } - lastspace = current; - } - /* if we are cutting, and we've accumulated enough - * characters, and we haven't see a space for this line, - * copy and insert a break. */ - else if (current - laststart >= linelength - && docut && laststart >= lastspace) { - memcpy(newtext+newtextlen, text+laststart, current-laststart); - newtextlen += current - laststart; - memcpy(newtext+newtextlen, breakchar, breakcharlen); - newtextlen += breakcharlen; - laststart = lastspace = current; - chk--; - } - /* if the current word puts us over the linelength, copy - * back up until the last space, insert a break, and move - * up the laststart */ - else if (current - laststart >= linelength - && laststart < lastspace) { - memcpy(newtext+newtextlen, text+laststart, lastspace-laststart); - newtextlen += lastspace - laststart; - memcpy(newtext+newtextlen, breakchar, breakcharlen); - newtextlen += breakcharlen; - laststart = lastspace = lastspace + 1; - chk--; - } - } - - /* copy over any stragglers */ - if (laststart != current) { - memcpy(newtext+newtextlen, text+laststart, current-laststart); - newtextlen += current - laststart; - } - - newtext[newtextlen] = '\0'; - /* free unused memory */ - newtext = erealloc(newtext, newtextlen+1); - - RETURN_STRINGL(newtext, newtextlen, 0); - } -} -/* }}} */ - -/* {{{ php_explode - */ -PHPAPI void php_explode(char *delim, uint delim_len, char *str, uint str_len, zend_uchar str_type, zval *return_value, int limit) -{ - char *p1, *p2, *endp; - - endp = str + str_len; - p1 = str; - p2 = php_memnstr(str, delim, delim_len, endp); - - if ( p2 == NULL ) { - if ( str_type == IS_BINARY ) { - add_next_index_binaryl(return_value, p1, str_len, 1); - } else { - add_next_index_stringl(return_value, p1, str_len, 1); - } - } else { - do { - if ( str_type == IS_BINARY ) { - add_next_index_binaryl(return_value, p1, p2-p1, 1); - } else { - add_next_index_stringl(return_value, p1, p2-p1, 1); - } - p1 = p2 + delim_len; - } while ( (p2 = php_memnstr(p1, delim, delim_len, endp)) != NULL && - (limit == -1 || --limit > 1) ); - - if ( p1 <= endp ) { - if ( str_type == IS_BINARY ) { - add_next_index_binaryl(return_value, p1, endp-p1, 1); - } else { - add_next_index_stringl(return_value, p1, endp-p1, 1); - } - } - } -} -/* }}} */ - -/* {{{ php_explode_negative_limit - */ -PHPAPI void php_explode_negative_limit(char *delim, uint delim_len, char *str, uint str_len, zend_uchar str_type, zval *return_value, int limit) -{ -#define EXPLODE_ALLOC_STEP 50 - char *p1, *p2, *endp; - int allocated = EXPLODE_ALLOC_STEP, found = 0, i = 0, to_return = 0; - char **positions = safe_emalloc(allocated, sizeof(char *), 0); - - endp = str + str_len; - p1 = str; - p2 = php_memnstr(str, delim, delim_len, endp); - - if ( p2 == NULL ) { - /* - do nothing since limit <= -1, thus if only one chunk - 1 + (limit) <= 0 - by doing nothing we return empty array - */ - } else { - positions[found++] = p1; - do { - if ( found >= allocated ) { - allocated = found + EXPLODE_ALLOC_STEP;/* make sure we have enough memory */ - positions = erealloc(positions, allocated*sizeof(char *)); - } - positions[found++] = p1 = p2 + delim_len; - } while ( (p2 = php_memnstr(p1, delim, delim_len, endp)) != NULL ); - - to_return = limit + found; - /* limit is at least -1 therefore no need of bounds checking : i will be always less than found */ - for ( i = 0 ; i < to_return ; i++ ) { /* this checks also for to_return > 0 */ - if ( str_type == IS_BINARY ) { - add_next_index_binaryl(return_value, positions[i], - (positions[i+1]-delim_len) - positions[i], 1); - } else { - add_next_index_stringl(return_value, positions[i], - (positions[i+1]-delim_len) - positions[i], 1); - } - } - } - efree(positions); -#undef EXPLODE_ALLOC_STEP -} -/* }}} */ - -/* {{{ php_u_explode - * Unicode capable version of php_explode() - */ -static void php_u_explode(UChar *delim, uint delim_len, UChar *str, uint str_len, zval *return_value, int limit) -{ - UChar *p1, *p2, *endp; - - endp = str + str_len; - p1 = str; - p2 = zend_u_memnstr(str, delim, delim_len, endp); - - if ( p2 == NULL ) { - add_next_index_unicodel(return_value, p1, str_len, 1); - } else { - do { - add_next_index_unicodel(return_value, p1, p2-p1, 1); - p1 = (UChar *)p2 + delim_len; - } while ((p2 = zend_u_memnstr(p1, delim, delim_len, endp)) != NULL && - (limit == -1 || --limit > 1) ); - - if ( p1 <= endp ) { - add_next_index_unicodel(return_value, p1, endp-p1, 1); - } - } -} -/* }}} */ - -/* {{{ php_u_explode_negative_limit - * Unicode capable version of php_explode_negative_limit() - */ -static void php_u_explode_negative_limit(UChar *delim, uint delim_len, UChar *str, uint str_len, zval *return_value, int limit) -{ -#define EXPLODE_ALLOC_STEP 50 - UChar *p1, *p2, *endp; - int allocated = EXPLODE_ALLOC_STEP, found = 0, i = 0, to_return = 0; - UChar **positions = safe_emalloc(allocated, sizeof(UChar *), 0); - - endp = str + str_len; - p1 = str; - p2 = zend_u_memnstr(str, delim, delim_len, endp); - - if ( p2 == NULL ) { - /* - do nothing since limit <= -1, thus if only one chunk - 1 + (limit) <= 0 - by doing nothing we return empty array - */ - } else { - positions[found++] = p1; - do { - if ( found >= allocated ) { - allocated = found + EXPLODE_ALLOC_STEP;/* make sure we have enough memory */ - positions = erealloc(positions, allocated*sizeof(UChar *)); - } - positions[found++] = p1 = p2 + delim_len; - } while ( (p2 = zend_u_memnstr(p1, delim, delim_len, endp)) != NULL ); - - to_return = limit + found; - /* limit is at least -1 therefore no need of bounds checking : i will be always less than found */ - for ( i = 0 ; i < to_return ; i++ ) { /* this checks also for to_return > 0 */ - add_next_index_unicodel(return_value, positions[i], - (positions[i+1]-delim_len) - positions[i], 1); - } - } - efree(positions); -#undef EXPLODE_ALLOC_STEP -} -/* }}} */ - -/* {{{ proto array explode(string separator, string str [, int limit]) - Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned. */ -PHP_FUNCTION(explode) -{ - void *str, *delim; - int32_t str_len, delim_len; - zend_uchar str_type, delim_type; - int limit = -1; - int argc = ZEND_NUM_ARGS(); - - if ( argc < 2 || argc > 3 ) { - WRONG_PARAM_COUNT; - } - - if ( zend_parse_parameters(argc TSRMLS_CC, "TT|l", &delim, &delim_len, &delim_type, - &str, &str_len, &str_type, &limit) == FAILURE) { - return; - } - - if ( delim_len == 0 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter."); - RETURN_FALSE; - } - - array_init(return_value); - - if ( str_len == 0 ) { - if ( str_type == IS_UNICODE ) { - add_next_index_unicodel(return_value, USTR_MAKE(""), sizeof("")-1, 0); - } else if ( str_type == IS_BINARY ) { - add_next_index_binaryl(return_value, "", sizeof("")-1, 1); - } else { - add_next_index_stringl(return_value, "", sizeof("")-1, 1); - } - return; - } - - - if (limit == 0 || limit == 1) { - if ( str_type == IS_UNICODE ) { - add_index_unicodel(return_value, 0, (UChar *)str, str_len, 1); - } else if ( str_type == IS_BINARY ) { - add_index_binaryl(return_value, 0, (char *)str, str_len, 1 TSRMLS_CC); - } else { - add_index_stringl(return_value, 0, (char *)str, str_len, 1); - } - } else if (limit < 0 && argc == 3) { - if ( str_type == IS_UNICODE ) { - php_u_explode_negative_limit((UChar *)delim, delim_len, (UChar *)str, str_len, return_value, limit); - } else { - php_explode_negative_limit((char *)delim, delim_len, (char *)str, str_len, str_type, return_value, limit); - } - } else { - if ( str_type == IS_UNICODE ) { - php_u_explode((UChar *)delim, delim_len, (UChar *)str, str_len, return_value, limit); - } else { - php_explode((char *)delim, delim_len, (char *)str, str_len, str_type, return_value, limit); - } - } -} -/* }}} */ - -/* {{{ proto string join(array src, string glue) - An alias for implode */ -/* }}} */ - -/* {{{ php_implode - */ -PHPAPI void php_implode(zval *delim, zval *arr, zval *retval) -{ - zend_uchar return_type; - int numelems, i=0; - HashPosition pos; - zval **tmp; - TSRMLS_FETCH(); - - Z_TYPE_P(retval) = return_type = Z_TYPE_P(delim); /* ... to start off */ - - /* Setup return value */ - if (return_type == IS_UNICODE) { - ZVAL_EMPTY_UNICODE(retval); - } else if (return_type == IS_BINARY) { - ZVAL_EMPTY_BINARY(retval); - } else { - ZVAL_EMPTY_STRING(retval); - } - - numelems = zend_hash_num_elements(Z_ARRVAL_P(arr)); - if (numelems == 0) { - return; - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&tmp, &pos) == SUCCESS) { - if (Z_TYPE_PP(tmp) != return_type) { - /* Convert to common type, if possible */ - if (return_type == IS_UNICODE) { - if (Z_TYPE_PP(tmp) == IS_BINARY) { - /* ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot mix binary strings with other string types"); - efree(Z_USTRVAL_P(retval)); - ZVAL_FALSE(retval); - return; - } else { - SEPARATE_ZVAL(tmp); - convert_to_unicode_ex(tmp); - } - } else if (return_type == IS_BINARY) { - if (Z_TYPE_PP(tmp) == IS_UNICODE || Z_TYPE_PP(tmp) == IS_STRING) { - /* ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot mix binary strings with other string types"); - efree(Z_BINVAL_P(retval)); - ZVAL_FALSE(retval); - return; - } else { - SEPARATE_ZVAL(tmp); - convert_to_binary_ex(tmp); - } - } else { - if (Z_TYPE_PP(tmp) == IS_UNICODE) { - /* Convert IS_STRING up to IS_UNICODE */ - convert_to_unicode_ex(&retval); - convert_to_unicode_ex(&delim); - Z_TYPE_P(retval) = return_type = IS_UNICODE; - } else if (Z_TYPE_PP(tmp) == IS_BINARY) { - /* ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot mix binary strings with other string types"); - efree(Z_STRVAL_P(retval)); - ZVAL_FALSE(retval); - return; - } else { - SEPARATE_ZVAL(tmp); - convert_to_string_ex(tmp); - } - } - } - - /* Append elem */ - if (return_type == IS_UNICODE) { - Z_USTRVAL_P(retval) = eurealloc(Z_USTRVAL_P(retval), - UBYTES(Z_USTRLEN_P(retval)+Z_USTRLEN_PP(tmp)+1)); - memcpy(Z_USTRVAL_P(retval)+Z_USTRLEN_P(retval), Z_USTRVAL_PP(tmp), UBYTES(Z_USTRLEN_PP(tmp)+1)); - Z_USTRLEN_P(retval) += Z_USTRLEN_PP(tmp); - if (++i < numelems) { /* Append delim */ - Z_USTRVAL_P(retval) = eurealloc(Z_USTRVAL_P(retval), - UBYTES(Z_USTRLEN_P(retval)+Z_USTRLEN_P(delim)+1)); - memcpy(Z_USTRVAL_P(retval)+Z_USTRLEN_P(retval), Z_USTRVAL_P(delim), UBYTES(Z_USTRLEN_P(delim)+1)); - Z_USTRLEN_P(retval) += Z_USTRLEN_P(delim); - } - } else { - Z_STRVAL_P(retval) = (char *)erealloc(Z_STRVAL_P(retval), - Z_STRLEN_P(retval)+Z_STRLEN_PP(tmp)+1); - memcpy(Z_STRVAL_P(retval)+Z_STRLEN_P(retval), Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)+1); - Z_STRLEN_P(retval) += Z_STRLEN_PP(tmp); - if (++i < numelems) { /* Append delim */ - Z_STRVAL_P(retval) = (char *)erealloc(Z_STRVAL_P(retval), - Z_STRLEN_P(retval)+Z_STRLEN_P(delim)+1); - memcpy(Z_STRVAL_P(retval)+Z_STRLEN_P(retval), Z_STRVAL_P(delim), Z_STRLEN_P(delim)+1); - Z_STRLEN_P(retval) += Z_STRLEN_P(delim); - } - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos); - } - - return; -} -/* }}} */ - -/* {{{ proto string implode([string glue,] array pieces) - Joins array elements placing glue string between items and return one string */ -PHP_FUNCTION(implode) -{ - zval **arg1 = NULL, **arg2 = NULL; - zval *delim, *arr; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2) { - WRONG_PARAM_COUNT; - } - if (zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) { - return; - } - - if (argc == 1) { - if (Z_TYPE_PP(arg1) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument to implode must be an array."); - RETURN_FALSE; - } else { - SEPARATE_ZVAL(arg1); - arr = *arg1; - MAKE_STD_ZVAL(delim); - if (UG(unicode)) { - ZVAL_UNICODEL(delim, EMPTY_STR, sizeof("")-1, 0); - } else { - ZVAL_STRINGL(delim, "", sizeof("")-1, 0); - } - } - } else { - if (Z_TYPE_PP(arg1) == IS_ARRAY) { - SEPARATE_ZVAL(arg1); - arr = *arg1; - if (Z_TYPE_PP(arg2) != IS_UNICODE && Z_TYPE_PP(arg2) != IS_BINARY && Z_TYPE_PP(arg2) != IS_STRING) { - convert_to_text_ex(arg2); - } - delim = *arg2; - } else if (Z_TYPE_PP(arg2) == IS_ARRAY) { - SEPARATE_ZVAL(arg2); - arr = *arg2; - if (Z_TYPE_PP(arg1) != IS_UNICODE && Z_TYPE_PP(arg1) != IS_BINARY && Z_TYPE_PP(arg1) != IS_STRING) { - convert_to_text_ex(arg1); - } - delim = *arg1; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad arguments."); - RETURN_FALSE; - } - } - - php_implode(delim, arr, return_value); - - if (argc == 1) { - FREE_ZVAL(delim); - } -} -/* }}} */ - -#define STRTOK_TABLE(p) BG(strtok_table)[(unsigned char) *p] - -/* {{{ proto string strtok([string str,] string token) - Tokenize a string */ -PHP_FUNCTION(strtok) -{ - void *tok, *str; - int32_t tok_len, str_len; - zend_uchar tok_type, str_type; - zval *zv; - char *token, *token_end, *p, *pe; - UChar *u_token, *u_p, *u_pe; - - UChar32 ch, th; - int32_t start, end, i, j, rem_len; - int delim_found, token_present; - int skipped = 0; - - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 2) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T|T", - &str, &str_len, &str_type, - &tok, &tok_len, &tok_type) == FAILURE) { - return; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - tok = str; - tok_len = str_len; - tok_type = str_type; - break; - - default: - case 2: - if (BG(strtok_zval)) { - zval_ptr_dtor(&BG(strtok_zval)); - } - MAKE_STD_ZVAL(zv); - if (str_type == IS_UNICODE) { - ZVAL_UNICODEL(zv, (UChar *)str, str_len, 1); - } else if (str_type == IS_BINARY) { - ZVAL_BINARYL(zv, (char *)str, str_len, 1); - } else { - ZVAL_STRINGL(zv, (char *)str, str_len, 1); - } - BG(strtok_zval) = zv; - if (str_type == IS_UNICODE) { - BG(strtok_last) = BG(strtok_string) = Z_USTRVAL_P(zv); - } else { - BG(strtok_last) = BG(strtok_string) = Z_STRVAL_P(zv); - } - BG(strtok_len) = str_len; - break; - } - - if (BG(strtok_zval) && tok_type != Z_TYPE_P(BG(strtok_zval))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delimiter type must match string type."); - RETURN_FALSE; - } - - if (tok_type == IS_UNICODE) { - u_p = (UChar *)BG(strtok_last); /* Where we start to search */ - u_pe = (UChar *)BG(strtok_string) + BG(strtok_len); - u_token = (UChar *)tok; - if (!u_p || u_p >= u_pe) { - RETURN_FALSE; - } - rem_len = u_pe - u_p; - - /* Skip leading delimiters */ - token_present = 0; - for (i = 0 ; (u_p + i) < u_pe ; ) { - delim_found = 0; - U16_NEXT(u_p, i, rem_len, ch); - for (j = 0 ; j < tok_len ; ) { - U16_NEXT(u_token, j, tok_len, th); - if ( ch == th ) { - delim_found = 1; - break; - } - } - if (delim_found == 0) { - U16_BACK_1(u_p, 0, i); /* U16_NEXT() post-incrs 'i' */ - start = i; - token_present = 1; - break; - } - } - if (token_present == 0) { - BG(strtok_last) = NULL; - RETURN_FALSE; - } - - /* Seek to next delimiter */ - delim_found = 0; - for (i = start ; (u_p + i) < u_pe ; ) { - U16_NEXT(u_p, i, rem_len, ch); - for (j = 0 ; j < tok_len ; ) { - U16_NEXT(u_token, j, tok_len, th); - if ( ch == th ) { - delim_found = 1; - break; - } - } - if (delim_found) { - U16_BACK_1(u_p, 0, i); /* 'i' was beyond delimiter */ - break; - } - } - end = i; - - if (end - start) { - BG(strtok_last) = u_p + end; - RETURN_UNICODEL(u_p + start, end - start, 1); - } else { - BG(strtok_last) = NULL; - RETURN_FALSE; - } - } else { - p = (char *)BG(strtok_last); /* Where we start to search */ - pe = (char *)BG(strtok_string) + BG(strtok_len); - if (!p || p >= pe) { - RETURN_FALSE; - } - token = (char *)tok; - token_end = token + tok_len; - while (token < token_end) { - STRTOK_TABLE(token++) = 1; - } - - /* Skip leading delimiters */ - while (STRTOK_TABLE(p)) { - if (++p >= pe) { - /* no other chars left */ - BG(strtok_last) = NULL; - RETVAL_FALSE; - goto restore; - } - skipped++; - } - /* We know at this place that *p is no delimiter, so skip it */ - while (++p < pe) { - if (STRTOK_TABLE(p)) { - goto return_token; - } - } - - if (p - (char *)BG(strtok_last)) { -return_token: - if (tok_type == IS_BINARY) { - RETVAL_BINARYL((char *)BG(strtok_last) + skipped, (p - (char *)BG(strtok_last)) - skipped, 1); - } else { - RETVAL_STRINGL((char *)BG(strtok_last) + skipped, (p - (char *)BG(strtok_last)) - skipped, 1); - } - BG(strtok_last) = p + 1; - } else { - RETVAL_FALSE; - BG(strtok_last) = NULL; - } - - /* Restore table -- usually faster then memset'ing the table on every invocation */ -restore: - token = (char *)tok; - while (token < token_end) { - STRTOK_TABLE(token++) = 0; - } - } -} -/* }}} */ - -/* {{{ php_strtoupper - */ -PHPAPI char *php_strtoupper(char *s, size_t len) -{ - unsigned char *c, *e; - - c = s; - e = c+len; - - while (c < e) { - *c = toupper(*c); - c++; - } - return s; -} -/* }}} */ - -/* {{{ php_u_strtoupper - */ -PHPAPI UChar* php_u_strtoupper(UChar **s, int32_t *len, const char* locale) -{ - UChar *dest = NULL; - int32_t dest_len; - UErrorCode status; - - dest_len = *len; - while (1) { - status = U_ZERO_ERROR; - dest = eurealloc(dest, dest_len+1); - dest_len = u_strToUpper(dest, dest_len, *s, *len, locale, &status); - if (status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - - if (U_SUCCESS(status)) { - efree(*s); - dest[dest_len] = 0; - *s = dest; - *len = dest_len; - } else { - efree(dest); - } - - return *s; -} -/* }}} */ - -/* {{{ proto string strtoupper(string str) - Makes a string uppercase */ -PHP_FUNCTION(strtoupper) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_PP(arg) != IS_STRING && Z_TYPE_PP(arg) != IS_UNICODE) { - convert_to_text_ex(arg); - } - - RETVAL_ZVAL(*arg, 1, 0); - if (Z_TYPE_P(return_value) == IS_UNICODE) { - php_u_strtoupper(&Z_USTRVAL_P(return_value), &Z_USTRLEN_P(return_value), UG(default_locale)); - } else { - php_strtoupper(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); - } -} -/* }}} */ - -/* {{{ php_u_strtolower - */ -PHPAPI UChar *php_u_strtolower(UChar **s, int32_t *len, const char* locale) -{ - UChar *dest = NULL; - int32_t dest_len; - UErrorCode status = U_ZERO_ERROR; - - dest_len = *len; - while (1) { - status = U_ZERO_ERROR; - dest = eurealloc(dest, dest_len+1); - dest_len = u_strToLower(dest, dest_len, *s, *len, locale, &status); - if (status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - - if (U_SUCCESS(status)) { - efree(*s); - dest[dest_len] = 0; - *s = dest; - *len = dest_len; - } else { - efree(dest); - } - return *s; -} -/* }}} */ - -/* {{{ php_strtolower - */ -PHPAPI char *php_strtolower(char *s, size_t len) -{ - unsigned char *c, *e; - - c = s; - e = c+len; - - while (c < e) { - *c = tolower(*c); - c++; - } - return s; -} -/* }}} */ - -/* {{{ proto string strtolower(string str) - Makes a string lowercase */ -PHP_FUNCTION(strtolower) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str)) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_PP(str) != IS_STRING && Z_TYPE_PP(str) != IS_UNICODE) { - convert_to_text_ex(str); - } - - RETVAL_ZVAL(*str, 1, 0); - if (Z_TYPE_P(return_value) == IS_UNICODE) { - php_u_strtolower(&Z_USTRVAL_P(return_value), &Z_USTRLEN_P(return_value), UG(default_locale)); - } else { - php_strtolower(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); - } -} -/* }}} */ - -/* {{{ php_basename - */ -PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC) -{ - char *ret = NULL, *c, *comp, *cend; - size_t inc_len, cnt; - int state; - - c = comp = cend = s; - cnt = len; - state = 0; - while (cnt > 0) { - inc_len = (*c == '\0' ? 1: php_mblen(c, cnt)); - - switch (inc_len) { - case -2: - case -1: - inc_len = 1; - php_mblen(NULL, 0); - break; - case 0: - goto quit_loop; - case 1: -#if defined(PHP_WIN32) || defined(NETWARE) - if (*c == '/' || *c == '\\') { -#else - if (*c == '/') { -#endif - if (state == 1) { - state = 0; - cend = c; - } - } else { - if (state == 0) { - comp = c; - state = 1; - } - } - default: - break; - } - c += inc_len; - cnt -= inc_len; - } - -quit_loop: - if (state == 1) { - cend = c; - } - if (suffix != NULL && sufflen < (cend - comp) && - memcmp(cend - sufflen, suffix, sufflen) == 0) { - cend -= sufflen; - } - - len = cend - comp; - ret = emalloc(len + 1); - memcpy(ret, comp, len); - ret[len] = '\0'; - - if (p_ret) { - *p_ret = ret; - } - if (p_len) { - *p_len = len; - } -} -/* }}} */ - -/* {{{ proto string basename(string path [, string suffix]) - Returns the filename component of the path */ -PHP_FUNCTION(basename) -{ - char *string, *suffix = NULL, *ret; - int string_len, suffix_len = 0; - size_t ret_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) { - return; - } - - php_basename(string, string_len, suffix, suffix_len, &ret, &ret_len TSRMLS_CC); - RETURN_STRINGL(ret, (int)ret_len, 0); -} -/* }}} */ - -/* {{{ php_dirname - Returns directory name component of path */ -PHPAPI size_t php_dirname(char *path, size_t len) -{ - register char *end = path + len - 1; - unsigned int len_adjust = 0; - -#ifdef PHP_WIN32 - /* Note that on Win32 CWD is per drive (heritage from CP/M). - * This means dirname("c:foo") maps to "c:." or "c:" - which means CWD on C: drive. - */ - if ((2 <= len) && isalpha((int)((unsigned char *)path)[0]) && (':' == path[1])) { - /* Skip over the drive spec (if any) so as not to change */ - path += 2; - len_adjust += 2; - if (2 == len) { - /* Return "c:" on Win32 for dirname("c:"). - * It would be more consistent to return "c:." - * but that would require making the string *longer*. - */ - return len; - } - } -#elif defined(NETWARE) - /* - * Find the first occurence of : from the left - * move the path pointer to the position just after : - * increment the len_adjust to the length of path till colon character(inclusive) - * If there is no character beyond : simple return len - */ - char *colonpos = NULL; - colonpos = strchr(path, ':'); - if(colonpos != NULL) { - len_adjust = ((colonpos - path) + 1); - path += len_adjust; - if(len_adjust == len) { - return len; - } - } -#endif - - if (len == 0) { - /* Illegal use of this function */ - return 0; - } - - /* Strip trailing slashes */ - while (end >= path && IS_SLASH_P(end)) { - end--; - } - if (end < path) { - /* The path only contained slashes */ - path[0] = DEFAULT_SLASH; - path[1] = '\0'; - return 1 + len_adjust; - } - - /* Strip filename */ - while (end >= path && !IS_SLASH_P(end)) { - end--; - } - if (end < path) { - /* No slash found, therefore return '.' */ -#ifdef NETWARE - if(len_adjust == 0) { - path[0] = '.'; - path[1] = '\0'; - return 1; //only one character - } - else { - path[0] = '\0'; - return len_adjust; - } -#else - path[0] = '.'; - path[1] = '\0'; - return 1 + len_adjust; -#endif - } - - /* Strip slashes which came before the file name */ - while (end >= path && IS_SLASH_P(end)) { - end--; - } - if (end < path) { - path[0] = DEFAULT_SLASH; - path[1] = '\0'; - return 1 + len_adjust; - } - *(end+1) = '\0'; - - return (size_t)(end + 1 - path) + len_adjust; -} -/* }}} */ - -/* {{{ proto string dirname(string path) - Returns the directory name component of the path */ -PHP_FUNCTION(dirname) -{ - zval **str; - char *ret; - size_t ret_len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(str); - - ret = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - ret_len = php_dirname(ret, Z_STRLEN_PP(str)); - - RETURN_STRINGL(ret, ret_len, 0); -} -/* }}} */ - -/* {{{ proto array pathinfo(string path) - Returns information about a certain string */ -PHP_FUNCTION(pathinfo) -{ - zval *tmp; - char *path, *ret = NULL; - int path_len; - size_t ret_len; - long opt = PHP_PATHINFO_ALL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) { - return; - } - - MAKE_STD_ZVAL(tmp); - array_init(tmp); - - if ((opt & PHP_PATHINFO_DIRNAME) == PHP_PATHINFO_DIRNAME) { - ret = estrndup(path, path_len); - php_dirname(ret, path_len); - if (*ret) { - add_assoc_rt_string(tmp, "dirname", ret, 1); - } - efree(ret); - } - - if ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME) { - php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC); - add_assoc_rt_stringl(tmp, "basename", ret, ret_len, 0); - if (UG(unicode)) { - efree(ret); - } - } - - if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) { - char *p; - int idx; - int have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME); - - /* Have we alrady looked up the basename? */ - if (!have_basename) { - php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC); - } - - p = strrchr(ret, '.'); - - if (p) { - idx = p - ret; - add_assoc_rt_stringl(tmp, "extension", ret + idx + 1, ret_len - idx - 1, 1); - } - - if (!have_basename) { - efree(ret); - } - } - - if (opt == PHP_PATHINFO_ALL) { - RETURN_ZVAL(tmp, 0, 1); - } else { - zval **element; - if (zend_hash_get_current_data(Z_ARRVAL_P(tmp), (void **) &element) == SUCCESS) { - RETVAL_ZVAL(*element, 1, 0); - } else { - ZVAL_EMPTY_STRING(return_value); - } - } - - zval_ptr_dtor(&tmp); -} -/* }}} */ - -/* {{{ php_u_stristr - Unicode version of case insensitve strstr */ -PHPAPI UChar *php_u_stristr(UChar *s, UChar *t, int32_t s_len, int32_t t_len) -{ - int32_t i,j, last; - UChar32 ch1, ch2; - - /* Have to do this by hand since lower-casing can change lengths - by changing codepoints, and an offset within the lower-case & - upper-case strings might be different codepoints. - - Find an occurrence of the first codepoint of 't' in 's', and - starting from this point, match the rest of the codepoints of - 't' with those in 's'. Comparisons are performed against - lower-case equivalents of the codepoints being matched. - - 'i' & 'j' are indices used for extracting codepoints 'ch1' & - 'ch2'. 'last' is offset in 's' where the search for 't' - started, and indicates beginning of 't' in 's' for a successful - match. - */ - - i = 0; - while (i <= (s_len-t_len)) { - last = i; - U16_NEXT(s, i, s_len, ch1); - j = 0; - U16_NEXT(t, j, t_len, ch2); - if (u_tolower(ch1) == u_tolower(ch2)) { - while (j < t_len) { - U16_NEXT(s, i, s_len, ch1); - U16_NEXT(t, j, t_len, ch2); - if (u_tolower(ch1) != u_tolower(ch2)) { - /* U16_NEXT() incr 'i' beyond 'ch1', re-adjust to - restart compare - */ - U16_BACK_1(s, 0, i); - break; - } - } - if (u_tolower(ch1) == u_tolower(ch2)) { - return s+last; - } - } - } - return NULL; -} -/* }}} */ - -/* {{{ php_stristr - case insensitve strstr */ -PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len) -{ - php_strtolower(s, s_len); - php_strtolower(t, t_len); - return php_memnstr(s, t, t_len, s + s_len); -} -/* }}} */ - -/* {{{ php_u_strspn - */ -PHPAPI int32_t php_u_strspn(UChar *s1, UChar *s2, UChar *s1_end, UChar *s2_end) -{ - int32_t len1 = s1_end - s1; - int32_t len2 = s2_end - s2; - int32_t i, codepts; - UChar32 ch; - - for (i = 0, codepts = 0 ; i < len1 ; codepts++) { - U16_NEXT(s1, i, len1, ch); - if (u_memchr32(s2, ch, len2) == NULL) { - break; - } - } - return codepts; -} -/* }}} */ - -/* {{{ php_strspn - */ -PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end) -{ - register const char *p = s1, *spanp; - register char c = *p; - -cont: - for (spanp = s2; p != s1_end && spanp != s2_end;) { - if (*spanp++ == c) { - c = *(++p); - goto cont; - } - } - return (p - s1); -} -/* }}} */ - -/* {{{ php_u_strcspn - */ -PHPAPI int32_t php_u_strcspn(UChar *s1, UChar *s2, UChar *s1_end, UChar *s2_end) -{ - int32_t len1 = s1_end - s1; - int32_t len2 = s2_end - s2; - int32_t i, codepts; - UChar32 ch; - - for (i = 0, codepts = 0 ; i < len1 ; codepts++) { - U16_NEXT(s1, i, len1, ch); - if (u_memchr32(s2, ch, len2)) { - break; - } - } - return codepts; -} -/* }}} */ - -/* {{{ php_strcspn - */ -PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end) -{ - register const char *p, *spanp; - register char c = *s1; - - for (p = s1;;) { - spanp = s2; - do { - if (*spanp == c || p == s1_end) { - return p - s1; - } - } while (spanp++ < s2_end); - c = *++p; - } - /* NOTREACHED */ -} -/* }}} */ - -/* {{{ proto string stristr(string haystack, string needle[, bool part]) - Finds first occurrence of a string within another, case insensitive */ -PHP_FUNCTION(stristr) -{ - zval *haystack, *needle; - zend_bool part = 0; - zend_uchar str_type; - char needle_char[2]; - UChar u_needle_char[3]; - int32_t needle_len; - char *haystack_copy; - void *target; - void *found = NULL; - int found_offset; - void *start, *end; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &haystack, &needle, &part) == FAILURE) { - return; - } - SEPARATE_ZVAL(&haystack); - SEPARATE_ZVAL(&needle); - if (Z_TYPE_P(haystack) != IS_UNICODE && Z_TYPE_P(haystack) != IS_BINARY && Z_TYPE_P(haystack) != IS_STRING) { - convert_to_text(haystack); - } - - if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_BINARY || Z_TYPE_P(needle) == IS_STRING) { - if (!Z_UNILEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter."); - RETURN_FALSE; - } - if (Z_TYPE_P(haystack) != Z_TYPE_P(needle)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(haystack), Z_TYPE_P(needle)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type(haystack, IS_BINARY); - convert_to_explicit_type(needle, IS_BINARY); - } else { - convert_to_explicit_type(haystack, str_type); - convert_to_explicit_type(needle, str_type); - } - } - target = Z_UNIVAL_P(needle); - needle_len = Z_UNILEN_P(needle); - } else { - convert_to_long_ex(&needle); - needle_len = 0; - if (Z_TYPE_P(haystack) == IS_UNICODE) { - if (Z_LVAL_P(needle) < 0 || Z_LVAL_P(needle) > 0x10FFFF) { - php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)"); - RETURN_FALSE; - } - if (U_IS_BMP(Z_LVAL_P(needle))) { - u_needle_char[needle_len++] = (UChar)Z_LVAL_P(needle); - u_needle_char[needle_len] = 0; - } else { - u_needle_char[needle_len++] = (UChar)U16_LEAD(Z_LVAL_P(needle)); - u_needle_char[needle_len++] = (UChar)U16_TRAIL(Z_LVAL_P(needle)); - u_needle_char[needle_len] = 0; - } - target = u_needle_char; - } else { - needle_char[needle_len++] = (char)Z_LVAL_P(needle); - needle_char[needle_len] = 0; - target = needle_char; - } - } - - if (needle_len > Z_UNILEN_P(haystack)) { - RETURN_FALSE; - } - - if (Z_TYPE_P(haystack) == IS_UNICODE) { - found = php_u_stristr(Z_USTRVAL_P(haystack), (UChar *)target, - Z_USTRLEN_P(haystack), needle_len); - } else { - haystack_copy = estrndup(Z_STRVAL_P(haystack), Z_STRLEN_P(haystack)); - found = php_stristr(Z_STRVAL_P(haystack), (char *)target, - Z_STRLEN_P(haystack), needle_len); - } - - if (found) { - if (Z_TYPE_P(haystack) == IS_UNICODE) { - start = part ? Z_USTRVAL_P(haystack) : found; - end = part ? found : (Z_USTRVAL_P(haystack) + Z_USTRLEN_P(haystack)); - RETVAL_UNICODEL((UChar *)start, (UChar *)end-(UChar *)start, 1); - } else { - found_offset = (char *)found - Z_STRVAL_P(haystack); - start = part ? haystack_copy : haystack_copy + found_offset; - end = part ? haystack_copy + found_offset : (haystack_copy + Z_STRLEN_P(haystack)); - if (Z_TYPE_P(haystack) == IS_BINARY) { - RETVAL_BINARYL((char *)start, (char *)end-(char *)start, 1); - } else { - RETVAL_STRINGL((char *)start, (char *)end-(char *)start, 1); - } - } - } else { - RETVAL_FALSE; - } - - if (Z_TYPE_P(haystack) != IS_UNICODE) { - efree(haystack_copy); - } -} -/* }}} */ - -/* {{{ proto string strstr(string haystack, string needle[, bool part]) - Finds first occurrence of a string within another */ -PHP_FUNCTION(strstr) -{ - void *haystack; - int32_t haystack_len; - zend_uchar haystack_type; - zval **needle; - void *found = NULL; - char needle_char[2]; - UChar u_needle_char[3]; - int32_t n_len = 0; - size_t found_offset; - zend_bool part = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|b", &haystack, &haystack_len, &haystack_type, &needle, &part) == FAILURE) { - return; - } - - if (Z_TYPE_PP(needle) == IS_STRING || Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_BINARY) { - if (!Z_STRLEN_PP(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter."); - RETURN_FALSE; - } - - /* haystack type determines the needle type */ - if (haystack_type == IS_UNICODE) { - convert_to_unicode_ex(needle); - found = zend_u_memnstr((UChar*)haystack, - Z_USTRVAL_PP(needle), - Z_USTRLEN_PP(needle), - (UChar*)haystack + haystack_len); - } else { - convert_to_string_ex(needle); - found = php_memnstr((char*)haystack, - Z_STRVAL_PP(needle), - Z_STRLEN_PP(needle), - (char*)haystack + haystack_len); - } - } else { - convert_to_long_ex(needle); - if (haystack_type == IS_UNICODE) { - if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) { - php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)"); - RETURN_FALSE; - } - /* supplementary codepoint values may require 2 UChar's */ - if (U_IS_BMP(Z_LVAL_PP(needle))) { - u_needle_char[n_len++] = (UChar) Z_LVAL_PP(needle); - u_needle_char[n_len] = 0; - } else { - u_needle_char[n_len++] = (UChar) U16_LEAD(Z_LVAL_PP(needle)); - u_needle_char[n_len++] = (UChar) U16_TRAIL(Z_LVAL_PP(needle)); - u_needle_char[n_len] = 0; - } - - found = zend_u_memnstr((UChar*)haystack, - u_needle_char, - n_len, - (UChar*)haystack + haystack_len); - } else { - needle_char[0] = (char) Z_LVAL_PP(needle); - needle_char[1] = 0; - - found = php_memnstr((char*)haystack, - needle_char, - 1, - (char*)haystack + haystack_len); - } - } - - if (found) { - switch (haystack_type) { - case IS_UNICODE: - found_offset = (UChar*)found - (UChar*)haystack; - if (part) { - UChar *ret; - ret = eumalloc(found_offset + 1); - u_strncpy(ret, haystack, found_offset); - ret[found_offset] = '\0'; - RETURN_UNICODEL(ret , found_offset, 0); - } else { - RETURN_UNICODEL(found, haystack_len - found_offset, 1); - } - break; - - case IS_STRING: - found_offset = (char *)found - (char *)haystack; - if (part) { - char *ret; - ret = emalloc(found_offset + 1); - strncpy(ret, haystack, found_offset); - ret[found_offset] = '\0'; - RETURN_STRINGL(ret , found_offset, 0); - } else { - RETURN_STRINGL(found, haystack_len - found_offset, 1); - } - break; - - case IS_BINARY: - found_offset = (char *)found - (char *)haystack; - if (part) { - char *ret; - ret = emalloc(found_offset + 1); - strncpy(ret, haystack, found_offset); - ret[found_offset] = '\0'; - RETURN_BINARYL(ret , found_offset, 0); - } else { - RETURN_BINARYL(found, haystack_len - found_offset, 1); - } - break; - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string strchr(string haystack, string needle) - An alias for strstr */ -/* }}} */ - -/* {{{ proto int strpos(text haystack, mixed needle [, int offset]) - Finds position of first occurrence of a string within another */ -PHP_FUNCTION(strpos) -{ - void *haystack; - int32_t haystack_len; - zend_uchar haystack_type; - zval **needle; - int offset = 0; - void *found = NULL; - char needle_char[2]; - UChar u_needle_char[3]; - int32_t n_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack, - &haystack_len, &haystack_type, &needle, &offset) == FAILURE) { - return; - } - - /* - * Unicode note: it's okay to not convert offset to codepoint offset here. - * We'll just do a rough check that the offset does not exceed length in - * code units, and leave the rest to zend_u_memnstr(). - */ - if (offset < 0 || offset > haystack_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); - RETURN_FALSE; - } - - if (Z_TYPE_PP(needle) == IS_STRING || Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_BINARY) { - if (!Z_STRLEN_PP(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter."); - RETURN_FALSE; - } - - /* haystack type determines the needle type */ - if (haystack_type == IS_UNICODE) { - int32_t cp_offset = 0; - convert_to_unicode_ex(needle); - /* locate the codepoint at the specified offset */ - U16_FWD_N((UChar*)haystack, cp_offset, haystack_len, offset); - found = zend_u_memnstr((UChar*)haystack + cp_offset, - Z_USTRVAL_PP(needle), - Z_USTRLEN_PP(needle), - (UChar*)haystack + haystack_len); - } else { - convert_to_string_ex(needle); - found = php_memnstr((char*)haystack + offset, - Z_STRVAL_PP(needle), - Z_STRLEN_PP(needle), - (char*)haystack + haystack_len); - } - } else { - convert_to_long_ex(needle); - if (haystack_type == IS_UNICODE) { - int32_t cp_offset = 0; - if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) { - php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)"); - RETURN_FALSE; - } - /* supplementary codepoint values may require 2 UChar's */ - if (U_IS_BMP(Z_LVAL_PP(needle))) { - u_needle_char[n_len++] = (UChar) Z_LVAL_PP(needle); - u_needle_char[n_len] = 0; - } else { - u_needle_char[n_len++] = (UChar) U16_LEAD(Z_LVAL_PP(needle)); - u_needle_char[n_len++] = (UChar) U16_TRAIL(Z_LVAL_PP(needle)); - u_needle_char[n_len] = 0; - } - - /* locate the codepoint at the specified offset */ - U16_FWD_N((UChar*)haystack, cp_offset, haystack_len, offset); - found = zend_u_memnstr((UChar*)haystack + cp_offset, - u_needle_char, - n_len, - (UChar*)haystack + haystack_len); - } else { - needle_char[0] = (char) Z_LVAL_PP(needle); - needle_char[1] = 0; - - found = php_memnstr((char*)haystack + offset, - needle_char, - 1, - (char*)haystack + haystack_len); - } - } - - if (found) { - if (haystack_type == IS_UNICODE) { - /* simple subtraction will not suffice, since there may be - supplementary codepoints */ - RETURN_LONG(u_countChar32(haystack, ((char *)found - (char *)haystack)/sizeof(UChar))); - } else { - RETURN_LONG((char *)found - (char *)haystack); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int stripos(string haystack, string needle [, int offset]) - Finds position of first occurrence of a string within another, case insensitive */ -PHP_FUNCTION(stripos) -{ - zval *haystack, *needle; - long offset = 0; - int32_t haystack_len, needle_len = 0; - zend_uchar str_type; - void *haystack_dup, *needle_dup = NULL; - char needle_char[2]; - char c; - UChar u_needle_char[3]; - UChar32 ch; - void *found = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &haystack, &needle, &offset) == FAILURE) { - return; - } - - if (Z_TYPE_P(haystack) != IS_UNICODE && Z_TYPE_P(haystack) != IS_BINARY && Z_TYPE_P(haystack) != IS_STRING) { - convert_to_text(haystack); - } - if (offset < 0 || offset > Z_UNILEN_P(haystack)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); - RETURN_FALSE; - } - - if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_BINARY || Z_TYPE_P(needle) == IS_STRING) { - if (!Z_UNILEN_P(needle)) { - RETURN_FALSE; - } - if (Z_TYPE_P(haystack) != Z_TYPE_P(needle)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(haystack), Z_TYPE_P(needle)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type(haystack, IS_BINARY); - convert_to_explicit_type(needle, IS_BINARY); - } else { - convert_to_explicit_type(haystack, str_type); - convert_to_explicit_type(needle, str_type); - } - } - haystack_len = Z_UNILEN_P(haystack); - needle_len = Z_UNILEN_P(needle); - if (Z_TYPE_P(haystack) == IS_UNICODE) { - haystack_dup = eustrndup(Z_USTRVAL_P(haystack), haystack_len); - php_u_strtolower((UChar **)&haystack_dup, &haystack_len, UG(default_locale)); - needle_dup = eustrndup(Z_STRVAL_P(needle), needle_len); - php_u_strtolower((UChar **)&needle_dup, &needle_len, UG(default_locale)); - found = zend_u_memnstr((UChar *)haystack_dup + offset, - (UChar *)needle_dup, needle_len, - (UChar *)haystack_dup + haystack_len); - } else { - haystack_dup = estrndup(Z_STRVAL_P(haystack), haystack_len); - php_strtolower((char *)haystack_dup, haystack_len); - needle_dup = estrndup(Z_STRVAL_P(needle), needle_len); - php_strtolower((char *)needle_dup, Z_STRLEN_P(needle)); - found = php_memnstr((char *)haystack_dup + offset, - (char *)needle_dup, needle_len, - (char *)haystack_dup + haystack_len); - } - } else { - switch (Z_TYPE_P(needle)) { - case IS_LONG: - case IS_BOOL: - if (Z_TYPE_P(haystack) == IS_UNICODE) { - ch = u_tolower((UChar32)Z_LVAL_P(needle)); - } else { - c = tolower((char)Z_LVAL_P(needle)); - } - break; - case IS_DOUBLE: - if (Z_TYPE_P(haystack) == IS_UNICODE) { - ch = u_tolower((UChar32)Z_DVAL_P(needle)); - } else { - c = tolower((char)Z_DVAL_P(needle)); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer."); - RETURN_FALSE; - break; - - } - if (Z_TYPE_P(haystack) == IS_UNICODE) { - if (U_IS_BMP(ch)) { - u_needle_char[needle_len++] = ch; - u_needle_char[needle_len] = 0; - } else { - u_needle_char[needle_len++] = U16_LEAD(ch); - u_needle_char[needle_len++] = U16_TRAIL(ch); - u_needle_char[needle_len] = 0; - } - haystack_dup = eustrndup(Z_USTRVAL_P(haystack), haystack_len); - php_u_strtolower((UChar **)&haystack_dup, &haystack_len, UG(default_locale)); - found = zend_u_memnstr((UChar *)haystack_dup + offset, - (UChar *)u_needle_char, needle_len, - (UChar *)haystack_dup + haystack_len); - } else { - needle_char[0] = c; - needle_char[1] = '\0'; - haystack_dup = estrndup(Z_STRVAL_P(haystack), haystack_len); - php_strtolower((char *)haystack_dup, haystack_len); - found = php_memnstr((char *)haystack_dup + offset, - (char *)needle_char, - sizeof(needle_char) - 1, - (char *)haystack_dup + haystack_len); - } - } - - efree(haystack_dup); - if (needle_dup) { - efree(needle_dup); - } - - if (found) { - if (Z_TYPE_P(haystack) == IS_UNICODE) { - RETURN_LONG((UChar *)found - (UChar *)haystack_dup); - } else { - RETURN_LONG((char *)found - (char *)haystack_dup); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int strrpos(string haystack, string needle [, int offset]) - Finds position of last occurrence of a string within another string */ -PHP_FUNCTION(strrpos) -{ - zval *zhaystack, *zneedle; - void *haystack, *needle; - int32_t haystack_len, needle_len = 0; - zend_uchar str_type; - long offset = 0; - char *p, *e, ord_needle[2]; - UChar *pos, *u_p, *u_e, u_ord_needle[3]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", - &zhaystack, &zneedle, &offset) == FAILURE) { - RETURN_FALSE; - } - - if (Z_TYPE_P(zhaystack) != IS_UNICODE && Z_TYPE_P(zhaystack) != IS_BINARY && Z_TYPE_P(zhaystack) != IS_STRING) { - convert_to_text(zhaystack); - } - if (Z_TYPE_P(zneedle) == IS_UNICODE || Z_TYPE_P(zneedle) == IS_BINARY || Z_TYPE_P(zneedle) == IS_STRING) { - if (Z_TYPE_P(zneedle) != Z_TYPE_P(zhaystack)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(zhaystack), Z_TYPE_P(zneedle)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type(zhaystack, IS_BINARY); - convert_to_explicit_type(zneedle, IS_BINARY); - } else { - convert_to_explicit_type(zhaystack, str_type); - convert_to_explicit_type(zneedle, str_type); - } - } - needle = Z_UNIVAL_P(zneedle); - needle_len = Z_UNILEN_P(zneedle); - } else { - if (Z_TYPE_P(zhaystack) == IS_UNICODE) { - if (Z_LVAL_P(zneedle) < 0 || Z_LVAL_P(zneedle) > 0x10FFFF) { - php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)"); - RETURN_FALSE; - } - if (U_IS_BMP(Z_LVAL_P(zneedle))) { - u_ord_needle[needle_len++] = (UChar)Z_LVAL_P(zneedle); - u_ord_needle[needle_len] = 0; - } else { - u_ord_needle[needle_len++] = (UChar)U16_LEAD(Z_LVAL_P(zneedle)); - u_ord_needle[needle_len++] = (UChar)U16_TRAIL(Z_LVAL_P(zneedle)); - u_ord_needle[needle_len] = 0; - } - needle = u_ord_needle; - } else { - convert_to_long(zneedle); - ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF); - ord_needle[1] = '\0'; - needle = ord_needle; - needle_len = 1; - } - } - haystack = Z_UNIVAL_P(zhaystack); - haystack_len = Z_UNILEN_P(zhaystack); - - if ((haystack_len == 0) || (needle_len == 0)) { - RETURN_FALSE; - } - - if (Z_TYPE_P(zhaystack) == IS_UNICODE) { - if (offset >= 0) { - u_p = (UChar *)haystack + offset; - u_e = (UChar *)haystack + haystack_len - needle_len; - } else { - u_p = haystack; - if (-offset > haystack_len) { - u_e = (UChar *)haystack - needle_len; - } else if (needle_len > -offset) { - u_e = (UChar *)haystack + haystack_len - needle_len; - } else { - u_e = (UChar *)haystack + haystack_len + offset; - } - } - - pos = u_strFindLast(u_p, u_e-u_p+needle_len, (UChar *)needle, needle_len); - if (pos) { - RETURN_LONG(pos - (UChar *)haystack); - } else { - RETURN_FALSE; - } - } else { - if (offset >= 0) { - p = (char *)haystack + offset; - e = (char *)haystack + haystack_len - needle_len; - } else { - p = haystack; - if (-offset > haystack_len) { - e = (char *)haystack - needle_len; - } else if (needle_len > -offset) { - e = (char *)haystack + haystack_len - needle_len; - } else { - e = (char *)haystack + haystack_len + offset; - } - } - - if (needle_len == 1) { - /* Single character search can shortcut memcmps */ - while (e >= p) { - if (*e == *(char *)needle) { - RETURN_LONG(e - p + (offset > 0 ? offset : 0)); - } - e--; - } - RETURN_FALSE; - } - - while (e >= p) { - if (memcmp(e, needle, needle_len) == 0) { - RETURN_LONG(e - p + (offset > 0 ? offset : 0)); - } - e--; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int strripos(string haystack, string needle [, int offset]) - Finds position of last occurrence of a string within another string */ -PHP_FUNCTION(strripos) -{ - zval *zneedle; - char *needle, *haystack; - int needle_len, haystack_len; - long offset = 0; - char *p, *e, ord_needle[2]; - char *needle_dup, *haystack_dup; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) { - RETURN_FALSE; - } - - if (Z_TYPE_P(zneedle) == IS_STRING) { - needle = Z_STRVAL_P(zneedle); - needle_len = Z_STRLEN_P(zneedle); - } else { - convert_to_long(zneedle); - ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF); - ord_needle[1] = '\0'; - needle = ord_needle; - needle_len = 1; - } - - if ((haystack_len == 0) || (needle_len == 0)) { - RETURN_FALSE; - } - - if (needle_len == 1) { - /* Single character search can shortcut memcmps - Can also avoid tolower emallocs */ - if (offset >= 0) { - p = haystack + offset; - e = haystack + haystack_len - 1; - } else { - p = haystack; - if (-offset > haystack_len) { - e = haystack + haystack_len - 1; - } else { - e = haystack + haystack_len + offset; - } - } - /* Borrow that ord_needle buffer to avoid repeatedly tolower()ing needle */ - *ord_needle = tolower(*needle); - while (e >= p) { - if (tolower(*e) == *ord_needle) { - RETURN_LONG(e - p + (offset > 0 ? offset : 0)); - } - e--; - } - RETURN_FALSE; - } - - needle_dup = estrndup(needle, needle_len); - php_strtolower(needle_dup, needle_len); - haystack_dup = estrndup(haystack, haystack_len); - php_strtolower(haystack_dup, haystack_len); - - if (offset >= 0) { - p = haystack_dup + offset; - e = haystack_dup + haystack_len - needle_len; - } else { - p = haystack_dup; - if (-offset > haystack_len) { - e = haystack_dup - needle_len; - } else if (needle_len > -offset) { - e = haystack_dup + haystack_len - needle_len; - } else { - e = haystack_dup + haystack_len + offset; - } - } - - while (e >= p) { - if (memcmp(e, needle_dup, needle_len) == 0) { - efree(haystack_dup); - efree(needle_dup); - RETURN_LONG(e - p + (offset > 0 ? offset : 0)); - } - e--; - } - - efree(haystack_dup); - efree(needle_dup); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ php_u_strrchr - */ -UChar *php_u_strrchr(UChar *s, UChar32 ch, int32_t s_len) -{ - UChar32 ch1; - int32_t i = s_len; - - while (i > 0) { - U16_PREV(s, 0, i, ch1); - if (ch1 == ch) { - return (s+i); - } - } - return NULL; -} -/* }}} */ - -/* {{{ proto string strrchr(string haystack, string needle) - Finds the last occurrence of a character in a string within another */ -PHP_FUNCTION(strrchr) -{ - zval *haystack, *needle; - zend_uchar str_type; - UChar32 ch; - void *found = NULL; - int32_t found_offset; - - if (ZEND_NUM_ARGS() != 2 || zend_parse_parameters(2 TSRMLS_CC, "zz", &haystack, &needle) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_P(haystack) != IS_UNICODE || Z_TYPE_P(haystack) != IS_BINARY || Z_TYPE_P(haystack) != IS_STRING) { - convert_to_string(haystack); - } - - if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_BINARY || Z_TYPE_P(needle) == IS_STRING) { - if (Z_TYPE_P(needle) != Z_TYPE_P(haystack)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(haystack), Z_TYPE_P(needle)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type(haystack, IS_BINARY); - convert_to_explicit_type(needle, IS_BINARY); - } else { - convert_to_explicit_type(haystack, str_type); - convert_to_explicit_type(needle, str_type); - } - } - if (Z_TYPE_P(haystack) == IS_UNICODE) { - U16_GET(Z_USTRVAL_P(needle), 0, 0, Z_USTRLEN_P(needle), ch); - found = php_u_strrchr(Z_USTRVAL_P(haystack), ch, Z_USTRLEN_P(haystack)); - } else { - found = strrchr(Z_STRVAL_P(haystack), *Z_STRVAL_P(needle)); - } - } else { - convert_to_long(needle); - if (Z_TYPE_P(haystack) == IS_UNICODE) { - if (Z_LVAL_P(needle) < 0 || Z_LVAL_P(needle) > 0x10FFFF) { - php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)"); - RETURN_FALSE; - } - found = php_u_strrchr(Z_USTRVAL_P(haystack), (UChar32)Z_LVAL_P(needle), Z_USTRLEN_P(haystack)); - } else { - found = strrchr(Z_STRVAL_P(haystack), (char)Z_LVAL_P(needle)); - } - } - - if (found) { - if (Z_TYPE_P(haystack) == IS_UNICODE) { - found_offset = (UChar *)found - Z_USTRVAL_P(haystack); - RETURN_UNICODEL((UChar *)found, Z_USTRLEN_P(haystack) - found_offset, 1); - } else { - found_offset = (char *)found - Z_STRVAL_P(haystack); - if (Z_TYPE_P(haystack) == IS_BINARY) { - RETURN_BINARYL((char *)found, Z_BINLEN_P(haystack) - found_offset, 1); - } else { - RETURN_STRINGL((char *)found, Z_STRLEN_P(haystack) - found_offset, 1); - } - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_chunk_split - */ -static char *php_chunk_split(char *src, int srclen, char *end, int endlen, int chunklen, int *destlen) -{ - char *dest; - char *p, *q; - int chunks; /* complete chunks! */ - int restlen; - - chunks = srclen / chunklen; - restlen = srclen - chunks * chunklen; /* srclen % chunklen */ - - dest = safe_emalloc((srclen + (chunks + 1) * endlen + 1), sizeof(char), 0); - - for (p = src, q = dest; p < (src + srclen - chunklen + 1); ) { - memcpy(q, p, chunklen); - q += chunklen; - memcpy(q, end, endlen); - q += endlen; - p += chunklen; - } - - if (restlen) { - memcpy(q, p, restlen); - q += restlen; - memcpy(q, end, endlen); - q += endlen; - } - - *q = '\0'; - if (destlen) { - *destlen = q - dest; - } - - return(dest); -} -/* }}} */ - -/* {{{ proto string chunk_split(string str [, int chunklen [, string ending]]) - Returns split line */ -PHP_FUNCTION(chunk_split) -{ - zval **p_str, **p_chunklen, **p_ending; - char *result; - char *end = "\r\n"; - int endlen = 2; - int chunklen = 76; - int result_len; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &p_str, &p_chunklen, &p_ending) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_str); - - if (argc > 1) { - convert_to_long_ex(p_chunklen); - chunklen = Z_LVAL_PP(p_chunklen); - } - - if (argc > 2) { - convert_to_string_ex(p_ending); - end = Z_STRVAL_PP(p_ending); - endlen = Z_STRLEN_PP(p_ending); - } - - if (chunklen <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Chunk length should be greater than zero."); - RETURN_FALSE; - } - - if (chunklen > Z_STRLEN_PP(p_str)) { - /* to maintain BC, we must return original string + ending */ - result_len = endlen + Z_STRLEN_PP(p_str); - result = emalloc(result_len + 1); - memcpy(result, Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str)); - memcpy(result + Z_STRLEN_PP(p_str), end, endlen); - result[result_len] = '\0'; - RETURN_STRINGL(result, result_len, 0); - } - - if (!Z_STRLEN_PP(p_str)) { - RETURN_EMPTY_STRING(); - } - - result = php_chunk_split(Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str), end, endlen, chunklen, &result_len); - - if (result) { - RETURN_STRINGL(result, result_len, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string substr(string str, int start [, int length]) - Returns part of a string */ -PHP_FUNCTION(substr) -{ - void *str; - int32_t str_len, cp_len; - zend_uchar str_type; - int l = -1; - int f; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|l", &str, &str_len, &str_type, &f, &l) == FAILURE) { - return; - } - - if (str_type == IS_UNICODE) { - cp_len = u_countChar32(str, str_len); - } else { - cp_len = str_len; - } - - if (ZEND_NUM_ARGS() == 2) { - l = cp_len; - } - - /* if "from" position is negative, count start position from the end - * of the string - */ - if (f < 0) { - f = cp_len + f; - if (f < 0) { - f = 0; - } - } - - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ - if (l < 0) { - l = (cp_len - f) + l; - if (l < 0) { - l = 0; - } - } - - if (f >= cp_len) { - RETURN_FALSE; - } - - if (((unsigned) f + (unsigned) l) > cp_len) { - l = cp_len - f; - } - - if (str_type == IS_UNICODE) { - int32_t start = 0, end = 0; - U16_FWD_N((UChar*)str, end, str_len, f); - start = end; - U16_FWD_N((UChar*)str, end, str_len, l); - RETURN_UNICODEL((UChar*)str + start, end-start, 1); - } else { - RETURN_STRINGL((char*)str + f, l, 1); - } -} -/* }}} */ - - -/* {{{ php_adjust_limits - */ -PHPAPI void php_adjust_limits(zval **str, int32_t *f, int32_t *l) -{ - int32_t str_codepts; - - if (Z_TYPE_PP(str) == IS_UNICODE) { - str_codepts = u_countChar32(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str)); - } else { - str_codepts = Z_STRLEN_PP(str); - } - - /* If "from" position is negative, count start position from the end - * of the string */ - if (*f < 0) { - *f = str_codepts + *f; - if (*f < 0) { - *f = 0; - } - } else if (*f > str_codepts) { - *f = str_codepts; - } - /* If "length" position is negative, set it to the length - * needed to stop that many codepts/chars from the end of the string */ - if (*l < 0) { - *l = str_codepts - *f + *l; - if (*l < 0) { - *l = 0; - } - } - if (((unsigned)(*f) + (unsigned)(*l)) > str_codepts) { - *l = str_codepts - *f; - } -} -/* }}} */ - -/* {{{ php_do_substr_replace - */ -PHPAPI int32_t php_do_substr_replace(void **result, zval **str, zval **repl, int32_t f, int32_t l TSRMLS_DC) -{ - void *buf; - int32_t buf_len, idx; - UChar ch; - int repl_len; - - if (repl) { - repl_len = Z_UNILEN_PP(repl); - } else { - repl_len = 0; - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - buf = emalloc(UBYTES(Z_USTRLEN_PP(str) -l + repl_len + 1)); - - /* buf_len is codept count here */ - buf_len = 0; idx = 0; - while (f-- > 0) { - U16_NEXT(Z_USTRVAL_PP(str), idx, Z_USTRLEN_PP(str), ch); - buf_len += zend_codepoint_to_uchar(ch, (UChar *)buf + buf_len); - } - if (repl != NULL) { - u_memcpy((UChar *)buf + buf_len, Z_USTRVAL_PP(repl), repl_len); - buf_len += repl_len; - } - U16_FWD_N(Z_USTRVAL_PP(str), idx, Z_USTRLEN_PP(str), l); - u_memcpy((UChar *)buf + buf_len, Z_USTRVAL_PP(str) + idx, Z_USTRLEN_PP(str) - idx); - buf_len += (Z_USTRLEN_PP(str) - idx); - - *((UChar *)buf + buf_len) = 0; - buf = erealloc(buf, UBYTES(buf_len + 1)); - } else { - /* buf_len is char count here */ - buf_len = Z_STRLEN_PP(str) - l + repl_len; - buf = emalloc(buf_len + 1); - - memcpy(buf, Z_STRVAL_PP(str), f); - if (repl != NULL) { - memcpy((char *)buf + f, Z_STRVAL_PP(repl), repl_len); - } - memcpy((char *)buf + f + repl_len, Z_STRVAL_PP(str) + f + l, Z_STRLEN_PP(str) - f - l); - - *((char *)buf + buf_len) = '\0'; - } - - *result = buf; - return buf_len; -} -/* }}} */ - -/* {{{ proto mixed substr_replace(mixed str, mixed repl, mixed start [, mixed length]) - Replaces part of a string with another string */ -PHP_FUNCTION(substr_replace) -{ - zval **str; - zval **from; - zval **len = NULL; - zval **repl; - void *result; - int32_t result_len; - int32_t l = 0; - int32_t f; - int argc = ZEND_NUM_ARGS(); - - HashPosition pos_str, pos_from, pos_repl, pos_len; - zval **tmp_str = NULL, **tmp_from = NULL, **tmp_repl = NULL, **tmp_len= NULL; - zend_uchar str_type; - - if (argc < 3 || argc > 4 || zend_get_parameters_ex(argc, &str, &repl, &from, &len) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(str) != IS_ARRAY && Z_TYPE_PP(str) != IS_UNICODE && - Z_TYPE_PP(str) != IS_BINARY && Z_TYPE_PP(str) != IS_STRING) { - convert_to_text_ex(str); - } - if (Z_TYPE_PP(repl) != IS_ARRAY && Z_TYPE_PP(repl) != IS_UNICODE && - Z_TYPE_PP(repl) != IS_BINARY && Z_TYPE_PP(repl) != IS_STRING) { - convert_to_text_ex(repl); - } - if (Z_TYPE_PP(from) != IS_ARRAY) { - convert_to_long_ex(from); - f = Z_LVAL_PP(from); - } - if (argc > 3) { - if (Z_TYPE_PP(len) != IS_ARRAY) { - convert_to_long_ex(len); - l = Z_LVAL_PP(len); - } - } else { - if (Z_TYPE_PP(str) != IS_ARRAY) { - l = Z_UNILEN_PP(str); - } - } - - if (Z_TYPE_PP(str) != IS_ARRAY) { - if ( (argc == 3 && Z_TYPE_PP(from) == IS_ARRAY) || - (argc == 4 && Z_TYPE_PP(from) != Z_TYPE_PP(len)) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should be of same type - numerical or array "); - RETURN_ZVAL(*str, 1, 0); - } - if (argc == 4 && Z_TYPE_PP(from) == IS_ARRAY) { - if (zend_hash_num_elements(Z_ARRVAL_PP(from)) != zend_hash_num_elements(Z_ARRVAL_PP(len))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should have the same number of elements"); - RETURN_ZVAL(*str, 1, 0); - } - } - } - - - if (Z_TYPE_PP(str) != IS_ARRAY) { - if (Z_TYPE_PP(from) != IS_ARRAY ) { - if (Z_TYPE_PP(repl) == IS_ARRAY) { - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(repl), &pos_repl); - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(repl), (void **) &tmp_repl, &pos_repl)) { - if (Z_TYPE_PP(repl) != IS_UNICODE && Z_TYPE_PP(repl) != IS_BINARY && Z_TYPE_PP(repl) != IS_STRING) { - convert_to_text_ex(tmp_repl); - } - } else { - tmp_repl = NULL; - } - } else { - tmp_repl = repl; - } - - if (tmp_repl && Z_TYPE_PP(str) != Z_TYPE_PP(tmp_repl)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(str), Z_TYPE_PP(tmp_repl)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type_ex(str, IS_BINARY); - convert_to_explicit_type_ex(tmp_repl, IS_BINARY); - } else { - convert_to_explicit_type_ex(str, str_type); - convert_to_explicit_type_ex(tmp_repl, str_type); - } - } - php_adjust_limits(str, &f, &l); - result_len = php_do_substr_replace(&result, str, tmp_repl, f, l TSRMLS_CC); - - if (Z_TYPE_PP(str) == IS_UNICODE) { - RETURN_UNICODEL((UChar *)result, result_len, 0); - } else if (Z_TYPE_PP(str) == IS_BINARY) { - RETURN_BINARYL((char *)result, result_len, 0); - } else { - RETURN_STRINGL((char *)result, result_len, 0); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented."); - RETURN_ZVAL(*str, 1, 0); - } - } else { /* str is array of strings */ - array_init(return_value); - - if (Z_TYPE_PP(from) == IS_ARRAY) { - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(from), &pos_from); - } - if (argc > 3 && Z_TYPE_PP(len) == IS_ARRAY) { - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(len), &pos_len); - } - if (Z_TYPE_PP(repl) == IS_ARRAY) { - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(repl), &pos_repl); - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(str), &pos_str); - while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(str), (void **) &tmp_str, &pos_str) == SUCCESS) { - if (Z_TYPE_PP(tmp_str) != IS_UNICODE && Z_TYPE_PP(tmp_str) != IS_BINARY && Z_TYPE_PP(tmp_str) != IS_STRING) { - convert_to_text_ex(tmp_str); - } - - if (Z_TYPE_PP(from) == IS_ARRAY) { - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(from), (void **) &tmp_from, &pos_from)) { - convert_to_long_ex(tmp_from); - f = Z_LVAL_PP(tmp_from); - zend_hash_move_forward_ex(Z_ARRVAL_PP(from), &pos_from); - } else { - f = 0; - } - } - - if (argc > 3 && (Z_TYPE_PP(len) == IS_ARRAY)) { - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(len), (void **) &tmp_len, &pos_len)) { - convert_to_long_ex(tmp_len); - l = Z_LVAL_PP(tmp_len); - zend_hash_move_forward_ex(Z_ARRVAL_PP(len), &pos_len); - } else { - l = Z_UNILEN_PP(tmp_str); - } - } else if (argc > 3) { - /* 'l' parsed & set at top of funcn */ - l = Z_LVAL_PP(len); - } else { - l = Z_UNILEN_PP(tmp_str); - } - - if (Z_TYPE_PP(repl) == IS_ARRAY) { - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(repl), (void **) &tmp_repl, &pos_repl)) { - if (Z_TYPE_PP(repl) != IS_UNICODE && Z_TYPE_PP(repl) != IS_BINARY && Z_TYPE_PP(repl) != IS_STRING) { - convert_to_text_ex(tmp_repl); - } - zend_hash_move_forward_ex(Z_ARRVAL_PP(repl), &pos_repl); - } else { - tmp_repl = NULL; - } - } else { - tmp_repl = repl; - } - - if (tmp_repl && Z_TYPE_PP(tmp_str) != Z_TYPE_PP(tmp_repl)) { - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(tmp_str), Z_TYPE_PP(tmp_repl)); - if (str_type == (zend_uchar)-1) { - convert_to_explicit_type_ex(tmp_str, IS_BINARY); - convert_to_explicit_type_ex(tmp_repl, IS_BINARY); - } else { - convert_to_explicit_type_ex(tmp_str, str_type); - convert_to_explicit_type_ex(tmp_repl, str_type); - } - } - php_adjust_limits(tmp_str, &f, &l); - result_len = php_do_substr_replace(&result, tmp_str, tmp_repl, f, l TSRMLS_CC); - - if (Z_TYPE_PP(tmp_str) == IS_UNICODE) { - add_next_index_unicodel(return_value, (UChar *)result, result_len, 0); - } else if (Z_TYPE_PP(tmp_str) == IS_BINARY) { - add_next_index_binaryl(return_value, (char *)result, result_len, 0); - } else { - add_next_index_stringl(return_value, (char *)result, result_len, 0); - } - - zend_hash_move_forward_ex(Z_ARRVAL_PP(str), &pos_str); - } /*while*/ - } /* if */ -} -/* }}} */ - - - - -/* {{{ proto string quotemeta(string str) - Quotes meta characters */ -PHP_FUNCTION(quotemeta) -{ - zval **arg; - char *str, *old; - char *old_end; - char *p, *q; - char c; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - - old = Z_STRVAL_PP(arg); - old_end = Z_STRVAL_PP(arg) + Z_STRLEN_PP(arg); - - if (old == old_end) { - RETURN_FALSE; - } - - str = safe_emalloc(2, Z_STRLEN_PP(arg), 1); - - for (p = old, q = str; p != old_end; p++) { - c = *p; - switch (c) { - case '.': - case '\\': - case '+': - case '*': - case '?': - case '[': - case '^': - case ']': - case '$': - case '(': - case ')': - *q++ = '\\'; - /* break is missing _intentionally_ */ - default: - *q++ = c; - } - } - *q = 0; - - RETURN_STRINGL(erealloc(str, q - str + 1), q - str, 0); -} -/* }}} */ - -/* {{{ proto int ord(text character) - Returns the codepoint value of a character */ -PHP_FUNCTION(ord) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(str) == IS_BINARY) { - RETURN_LONG((unsigned char) Z_STRVAL_PP(str)[0]); - } - - convert_to_text_ex(str); - if (Z_TYPE_PP(str) == IS_UNICODE) { - RETURN_LONG(zend_get_codepoint_at(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), 0)); - } else { - RETURN_LONG((unsigned char) Z_STRVAL_PP(str)[0]); - } -} -/* }}} */ - -/* {{{ proto text chr(int codepoint) - Converts a codepoint number to a character */ -PHP_FUNCTION(chr) -{ - zval **num; - char temp[2]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(num); - - if (UG(unicode)) { - UChar buf[2]; - int32_t buf_len; - - if (Z_LVAL_PP(num) > UCHAR_MAX_VALUE) { - php_error(E_WARNING, "Codepoint value cannot be greater than %X", UCHAR_MAX_VALUE); - return; - } - buf_len = zend_codepoint_to_uchar((uint32_t)Z_LVAL_PP(num), buf); - RETURN_UNICODEL(buf, buf_len, 1); - } else { - temp[0] = (char) Z_LVAL_PP(num); - temp[1] = 0; - - RETVAL_STRINGL(temp, 1, 1); - } -} -/* }}} */ - -/* {{{ php_u_ucfirst() - Makes an Unicode string's first character uppercase */ -static void php_u_ucfirst(zval *ustr, zval *return_value) -{ - UChar32 lc, uc; - UChar tmp[2] = {0, 0}; /* UChar32 will be converted to upto 2 UChar units ? */ - int32_t tmp_len = 2; - int32_t pos = 0; - UErrorCode err = U_ZERO_ERROR; - - U16_NEXT(Z_USTRVAL_P(ustr), pos, Z_USTRLEN_P(ustr), lc); - uc = u_toupper(lc); - if ( uc == lc ) { - ZVAL_UNICODEL(return_value, Z_USTRVAL_P(ustr), Z_USTRLEN_P(ustr), 1); - return; - } - - u_strFromUTF32(tmp, tmp_len, &tmp_len, &uc, 1, &err); - if (U_FAILURE(err)) { - ZVAL_EMPTY_UNICODE(return_value); - return; - } - - Z_USTRVAL_P(return_value) = eumalloc(tmp_len+Z_USTRLEN_P(ustr)-pos+1); - Z_USTRVAL_P(return_value)[0] = tmp[0]; - if (tmp_len > 1) { - Z_USTRVAL_P(return_value)[1] = tmp[1]; - } - memcpy(Z_USTRVAL_P(return_value)+tmp_len, Z_USTRVAL_P(ustr)+pos, UBYTES(Z_USTRLEN_P(ustr)-pos+1)); - Z_USTRLEN_P(return_value) = tmp_len+Z_USTRLEN_P(ustr)-pos; -} -/* }}} */ - -/* {{{ proto string ucfirst(string str) - Makes a string's first character uppercase */ -PHP_FUNCTION(ucfirst) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(str) != IS_UNICODE && Z_TYPE_PP(str) != IS_BINARY && Z_TYPE_PP(str) != IS_STRING) { - convert_to_text_ex(str); - } - - if (Z_TYPE_PP(str) == IS_UNICODE && !Z_USTRLEN_PP(str)) { - RETURN_EMPTY_UNICODE(); - } else if (Z_TYPE_PP(str) == IS_BINARY && !Z_BINLEN_PP(str)) { - RETURN_EMPTY_BINARY(); - } else if (!Z_STRLEN_PP(str)) { - RETURN_EMPTY_STRING(); - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - Z_TYPE_P(return_value) = IS_UNICODE; - php_u_ucfirst(*str, return_value); - } else if (Z_TYPE_PP(str) == IS_BINARY) { - ZVAL_BINARYL(return_value, Z_BINVAL_PP(str), Z_BINLEN_PP(str), 1); - *Z_BINVAL_P(return_value) = toupper((unsigned char) *Z_BINVAL_P(return_value)); - } else { - ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - *Z_STRVAL_P(return_value) = toupper((unsigned char) *Z_STRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ php_u_ucwords() - Uppercase the first character of every word in an Unicode string */ -static void php_u_ucwords(zval *ustr, zval *retval) -{ - UChar32 *codepts; - int32_t len, retval_len; - int32_t i; - UErrorCode err; - - len = Z_USTRLEN_P(ustr); - codepts = (UChar32 *)emalloc((len+1)*sizeof(UChar32)); - err = U_ZERO_ERROR; - u_strToUTF32(codepts, len+1, &len, Z_USTRVAL_P(ustr), len, &err); - if (U_FAILURE(err)) { - efree(codepts); - ZVAL_EMPTY_UNICODE(retval); - return; - } - - codepts[0] = u_toupper(codepts[0]); - for (i = 1; i < len ; i++) { - if (u_isWhitespace(codepts[i-1]) == TRUE) { - codepts[i] = u_totitle(codepts[i]); - } - } - - retval_len = len; - Z_USTRVAL_P(retval) = eumalloc(retval_len+1); - err = U_ZERO_ERROR; - u_strFromUTF32(Z_USTRVAL_P(retval), retval_len+1, &retval_len, codepts, len, &err); - if (U_FAILURE(err) == U_BUFFER_OVERFLOW_ERROR) { - err = U_ZERO_ERROR; - Z_USTRVAL_P(retval) = eurealloc(Z_USTRVAL_P(retval), retval_len+1); - u_strFromUTF32(Z_USTRVAL_P(retval), retval_len+1, NULL, codepts, len, &err); - } - - if (U_SUCCESS(err)) { - Z_USTRLEN_P(retval) = retval_len; - } else { - efree(Z_USTRVAL_P(retval)); - ZVAL_EMPTY_UNICODE(retval); - } - - efree(codepts); -} -/* }}} */ - -/* {{{ proto string ucwords(string str) - Uppercase the first character of every word in a string */ -PHP_FUNCTION(ucwords) -{ - zval **str; - register char *r, *r_end; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(str) != IS_UNICODE && Z_TYPE_PP(str) != IS_BINARY && Z_TYPE_PP(str) != IS_STRING) { - convert_to_text_ex(str); - } - - if (Z_TYPE_PP(str) == IS_UNICODE && !Z_USTRLEN_PP(str)) { - RETURN_EMPTY_UNICODE(); - } else if (Z_TYPE_PP(str) == IS_BINARY && !Z_BINLEN_PP(str)) { - RETURN_EMPTY_BINARY(); - } else if (!Z_STRLEN_PP(str)) { - RETURN_EMPTY_STRING(); - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - Z_TYPE_P(return_value) = IS_UNICODE; - php_u_ucwords(*str, return_value); - } else { - if (Z_TYPE_PP(str) == IS_BINARY) { - ZVAL_BINARYL(return_value, Z_BINVAL_PP(str), Z_BINLEN_PP(str), 1); - } else { - ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - } - - r = Z_STRVAL_P(return_value); - *r = toupper((unsigned char) *r); - for (r_end = r + Z_STRLEN_P(return_value) - 1; r < r_end; ) { - if (isspace((int) *(unsigned char *)r++)) { - *r = toupper((unsigned char) *r); - } - } - } -} -/* }}} */ - -/* {{{ php_strtr - */ -PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen) -{ - int i; - unsigned char xlat[256]; - - if ((trlen < 1) || (len < 1)) { - return str; - } - - for (i = 0; i < 256; xlat[i] = i, i++); - - for (i = 0; i < trlen; i++) { - xlat[(unsigned char) str_from[i]] = str_to[i]; - } - - for (i = 0; i < len; i++) { - str[i] = xlat[(unsigned char) str[i]]; - } - - return str; -} -/* }}} */ - -/* {{{ php_strtr_array - */ -static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *hash) -{ - zval **entry; - char *string_key; - uint string_key_len; - zval **trans; - zval ctmp; - ulong num_key; - int minlen = 128*1024; - int maxlen = 0, pos, len, found; - char *key; - HashPosition hpos; - smart_str result = {0}; - HashTable tmp_hash; - - zend_hash_init(&tmp_hash, 0, NULL, NULL, 0); - zend_hash_internal_pointer_reset_ex(hash, &hpos); - while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) { - switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) { - case HASH_KEY_IS_STRING: - len = string_key_len-1; - if (len < 1) { - zend_hash_destroy(&tmp_hash); - RETURN_FALSE; - } - zend_hash_add(&tmp_hash, string_key, string_key_len, entry, sizeof(zval*), NULL); - if (len > maxlen) { - maxlen = len; - } - if (len < minlen) { - minlen = len; - } - break; - - case HASH_KEY_IS_LONG: - Z_TYPE(ctmp) = IS_LONG; - Z_LVAL(ctmp) = num_key; - - convert_to_string(&ctmp); - len = Z_STRLEN(ctmp); - zend_hash_add(&tmp_hash, Z_STRVAL(ctmp), len+1, entry, sizeof(zval*), NULL); - zval_dtor(&ctmp); - - if (len > maxlen) { - maxlen = len; - } - if (len < minlen) { - minlen = len; - } - break; - } - zend_hash_move_forward_ex(hash, &hpos); - } - - key = emalloc(maxlen+1); - pos = 0; - - while (pos < slen) { - if ((pos + maxlen) > slen) { - maxlen = slen - pos; - } - - found = 0; - memcpy(key, str+pos, maxlen); - - for (len = maxlen; len >= minlen; len--) { - key[len] = 0; - - if (zend_hash_find(&tmp_hash, key, len+1, (void**)&trans) == SUCCESS) { - char *tval; - int tlen; - zval tmp; - - if (Z_TYPE_PP(trans) != IS_STRING) { - tmp = **trans; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - tval = Z_STRVAL(tmp); - tlen = Z_STRLEN(tmp); - } else { - tval = Z_STRVAL_PP(trans); - tlen = Z_STRLEN_PP(trans); - } - - smart_str_appendl(&result, tval, tlen); - pos += len; - found = 1; - - if (Z_TYPE_PP(trans) != IS_STRING) { - zval_dtor(&tmp); - } - break; - } - } - - if (! found) { - smart_str_appendc(&result, str[pos++]); - } - } - - efree(key); - zend_hash_destroy(&tmp_hash); - smart_str_0(&result); - RETVAL_STRINGL(result.c, result.len, 0); -} -/* }}} */ - -/* {{{ proto string strtr(string str, string from, string to) - Translates characters in str using given translation tables */ -PHP_FUNCTION(strtr) -{ - zval **str, **from, **to; - int ac = ZEND_NUM_ARGS(); - - if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &str, &from, &to) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (ac == 2 && Z_TYPE_PP(from) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument is not an array."); - RETURN_FALSE; - } - - convert_to_string_ex(str); - - /* shortcut for empty string */ - if (Z_STRLEN_PP(str) == 0) { - RETURN_EMPTY_STRING(); - } - - if (ac == 2) { - php_strtr_array(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), HASH_OF(*from)); - } else { - convert_to_string_ex(from); - convert_to_string_ex(to); - - ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - - php_strtr(Z_STRVAL_P(return_value), - Z_STRLEN_P(return_value), - Z_STRVAL_PP(from), - Z_STRVAL_PP(to), - MIN(Z_STRLEN_PP(from), - Z_STRLEN_PP(to))); - } -} -/* }}} */ - -/* {{{ proto string strrev(string str) - Reverse a string */ -PHP_FUNCTION(strrev) -{ - zval **str; - char *s, *e, *n, *p; - int32_t i, x1, x2; - UChar32 ch; - UChar *u_s, *u_n, *u_p; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(str) != IS_UNICODE && Z_TYPE_PP(str) != IS_BINARY && Z_TYPE_PP(str) != IS_STRING) { - convert_to_text_ex(str); - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - u_n = eumalloc(Z_USTRLEN_PP(str)+1); - u_p = u_n; - u_s = Z_USTRVAL_PP(str); - - i = Z_USTRLEN_PP(str); - while (i > 0) { - U16_PREV(u_s, 0, i, ch); - if (u_getCombiningClass(ch) == 0) { - u_p += zend_codepoint_to_uchar(ch, u_p); - } else { - x2 = i; - do { - U16_PREV(u_s, 0, i, ch); - } while (u_getCombiningClass(ch) != 0); - x1 = i; - while (x1 <= x2) { - U16_NEXT(u_s, x1, Z_USTRLEN_PP(str), ch); - u_p += zend_codepoint_to_uchar(ch, u_p); - } - } - } - *u_p = 0; - } else { - n = emalloc(Z_STRLEN_PP(str)+1); - p = n; - s = Z_STRVAL_PP(str); - e = s + Z_STRLEN_PP(str); - - while (--e >= s) { - *(p++) = *e; - } - *p = '\0'; - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - RETVAL_UNICODEL(u_n, Z_USTRLEN_PP(str), 0); - } else if (Z_TYPE_PP(str) == IS_BINARY) { - RETVAL_BINARYL(n, Z_BINLEN_PP(str), 0); - } else { - RETVAL_STRINGL(n, Z_STRLEN_PP(str), 0); - } -} -/* }}} */ - -/* {{{ php_u_similar_str - */ -static void php_u_similar_str(const UChar *txt1, int32_t len1, - const UChar *txt2, int32_t len2, - int32_t *pos1, int32_t *end1, - int32_t *pos2, int32_t *end2, int *max) -{ - int32_t i1, i2, j1, j2, l; - UChar32 ch1, ch2; - - *max = 0; - for (i1 = 0 ; i1 < len1 ; ) { - for (i2 = 0 ; i2 < len2 ; ) { - l = 0 ; j1 = 0 ; j2 = 0; - while ((i1+j1 < len1) && (i2+j2 < len2)) { - U16_NEXT(txt1+i1, j1, len1-i1, ch1); - U16_NEXT(txt2+i2, j2, len2-i2, ch2); - if (ch1 != ch2) { - U16_BACK_1(txt1+i1, 0, j1); - U16_BACK_1(txt2+i2, 0, j2); - break; - } - l++; - } - if (l > *max) { - *max = l; - *pos1 = i1; *end1 = j1; - *pos2 = i2; *end2 = j2; - } - U16_FWD_1(txt2, i2, len2); - } - U16_FWD_1(txt1, i1, len1); - } -} -/* }}} */ - -/* {{{ php_similar_str - */ -static void php_similar_str(const char *txt1, int len1, const char *txt2, int len2, int *pos1, int *pos2, int *max) -{ - char *p, *q; - char *end1 = (char *) txt1 + len1; - char *end2 = (char *) txt2 + len2; - int l; - - *max = 0; - for (p = (char *) txt1; p < end1; p++) { - for (q = (char *) txt2; q < end2; q++) { - for (l = 0; (p + l < end1) && (q + l < end2) && (p[l] == q[l]); l++); - if (l > *max) { - *max = l; - *pos1 = p - txt1; - *pos2 = q - txt2; - } - } - } -} -/* }}} */ - -/* {{{ php_similar_char - */ -static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2) -{ - int sum; - int pos1, pos2, max; - - php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); - if ((sum = max)) { - if (pos1 && pos2) { - sum += php_similar_char(txt1, pos1, - txt2, pos2); - } - if ((pos1 + max < len1) && (pos2 + max < len2)) { - sum += php_similar_char(txt1 + pos1 + max, len1 - pos1 - max, - txt2 + pos2 + max, len2 - pos2 - max); - } - } - - return sum; -} -/* }}} */ - -/* {{{ php_u_similar_char - */ -static int php_u_similar_char(const UChar *txt1, int32_t len1, const UChar *txt2, int32_t len2) -{ - int sum, max; - int32_t pos1, pos2, end1, end2; - - php_u_similar_str(txt1, len1, txt2, len2, &pos1, &end1, &pos2, &end2, &max); - if ((sum = max)) { - if (pos1 && pos2) { - sum += php_u_similar_char(txt1, pos1, txt2, pos2); - } - if ((pos1 + end1 < len1) && (pos2 + end2 < len2)) { - sum += php_similar_char((UChar *)txt1+pos1+end1, len1-pos1-end1, - (UChar *)txt2+pos2+end2, len2-pos2-end2); - } - } - return sum; -} -/* }}} */ - -/* {{{ proto int similar_text(string str1, string str2 [, float percent]) - Calculates the similarity between two strings */ -PHP_FUNCTION(similar_text) -{ - zval **t1, **t2, **percent; - int ac = ZEND_NUM_ARGS(); - int sim; - zend_uchar str_type; - - if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &t1, &t2, &percent) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_PP(t1) != IS_UNICODE && Z_TYPE_PP(t1) != IS_BINARY && Z_TYPE_PP(t1) != IS_STRING) { - convert_to_text_ex(t1); - } - if (Z_TYPE_PP(t2) != IS_UNICODE && Z_TYPE_PP(t2) != IS_BINARY && Z_TYPE_PP(t2) != IS_STRING) { - convert_to_text_ex(t2); - } - str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(t1), Z_TYPE_PP(t2)); - if (str_type == (zend_uchar)-1) { - convert_to_binary_ex(t1); - convert_to_binary_ex(t2); - } else { - convert_to_explicit_type_ex(t1, str_type); - convert_to_explicit_type_ex(t2, str_type); - } - if (ac > 2) { - convert_to_double_ex(percent); - } - - if (Z_UNILEN_PP(t1) + Z_UNILEN_PP(t2) == 0) { - if (ac > 2) { - Z_DVAL_PP(percent) = 0; - } - - RETURN_LONG(0); - } - - if (str_type == IS_UNICODE) { - sim = php_u_similar_char(Z_USTRVAL_PP(t1), Z_USTRLEN_PP(t1), Z_USTRVAL_PP(t2), Z_USTRLEN_PP(t2)); - } else { - sim = php_similar_char(Z_STRVAL_PP(t1), Z_STRLEN_PP(t1), Z_STRVAL_PP(t2), Z_STRLEN_PP(t2)); - } - - if (ac > 2) { - if (str_type == IS_UNICODE) { - Z_DVAL_PP(percent) = sim * 200.0 / (Z_USTRCPLEN_PP(t1) + Z_USTRCPLEN_PP(t2)); - } else { - Z_DVAL_PP(percent) = sim * 200.0 / (Z_STRLEN_PP(t1) + Z_STRLEN_PP(t2)); - } - } - - RETURN_LONG(sim); -} -/* }}} */ - -/* {{{ php_u_stripslashes - * - * be careful, this edits the string in-place */ -PHPAPI void php_u_stripslashes(UChar *str, int32_t *len TSRMLS_DC) -{ - int32_t tmp_len = 0, i = 0; - UChar32 ch1, ch2; - - ch1 = -1; ch2 = -1; - if (PG(magic_quotes_sybase)) { - while (i < *len) { - U16_NEXT(str, i, *len, ch1); - if (ch1 == '\'') { - tmp_len += zend_codepoint_to_uchar(ch1, str+tmp_len); - if (i < *len) { - U16_NEXT(str, i, *len, ch2); - if (ch2 != '\'') { - tmp_len += zend_codepoint_to_uchar(ch2, str+tmp_len); - } - } - } else if (ch1 == '\\') { - if (i < *len) { - U16_NEXT(str, i, *len, ch2); - if (ch2 == '0') { - tmp_len += zend_codepoint_to_uchar('\0', str+tmp_len); - } else { - tmp_len += zend_codepoint_to_uchar(ch1, str+tmp_len); - tmp_len += zend_codepoint_to_uchar(ch2, str+tmp_len); - } - } else { - tmp_len += zend_codepoint_to_uchar(ch1, str+tmp_len); - } - } else { - tmp_len += zend_codepoint_to_uchar(ch1, str+tmp_len); - } - } - } else { - while (i < *len) { - U16_NEXT(str, i, *len, ch1); - if (ch1 == '\\') { - if (i < *len) { - U16_NEXT(str, i, *len, ch2); - if (ch2 == '0') { - tmp_len += zend_codepoint_to_uchar('\0', str+tmp_len); - } else { - tmp_len += zend_codepoint_to_uchar(ch2, str+tmp_len); - } - } - } else { - tmp_len += zend_codepoint_to_uchar(ch1, str+tmp_len); - } - } - } - *(str+tmp_len) = 0; - str = eurealloc(str, tmp_len+1); - *len = tmp_len; - return; -} -/* }}} */ - -/* {{{ php_stripslashes - * - * be careful, this edits the string in-place */ -PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC) -{ - char *s, *t; - int l; - - if (len != NULL) { - l = *len; - } else { - l = strlen(str); - } - s = str; - t = str; - - if (PG(magic_quotes_sybase)) { - while (l > 0) { - if (*t == '\'') { - if ((l > 0) && (t[1] == '\'')) { - t++; - if (len != NULL) { - (*len)--; - } - l--; - } - *s++ = *t++; - } else if (*t == '\\' && t[1] == '0' && l > 0) { - *s++='\0'; - t+=2; - if (len != NULL) { - (*len)--; - } - l--; - } else { - *s++ = *t++; - } - l--; - } - *s = '\0'; - - return; - } - - while (l > 0) { - if (*t == '\\') { - t++; /* skip the slash */ - if (len != NULL) { - (*len)--; - } - l--; - if (l > 0) { - if (*t == '0') { - *s++='\0'; - t++; - } else { - *s++ = *t++; /* preserve the next character */ - } - l--; - } - } else { - *s++ = *t++; - l--; - } - } - if (s != t) { - *s = '\0'; - } -} -/* }}} */ - -/* {{{ proto string addcslashes(string str, string charlist) - Escapes all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\n', '\r', '\t' etc...) */ -PHP_FUNCTION(addcslashes) -{ - zval **str, **what; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &what) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(str); - convert_to_string_ex(what); - - if (Z_STRLEN_PP(str) == 0) { - RETURN_EMPTY_STRING(); - } - - if (Z_STRLEN_PP(what) == 0) { - RETURN_STRINGL(Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - } - - RETURN_STRING(php_addcslashes(Z_STRVAL_PP(str), - Z_STRLEN_PP(str), - &Z_STRLEN_P(return_value), 0, - Z_STRVAL_PP(what), - Z_STRLEN_PP(what) TSRMLS_CC), 0); -} -/* }}} */ - -/* {{{ proto string addslashes(string str) - Escapes single quote, double quotes and backslash characters in a string with backslashes */ -PHP_FUNCTION(addslashes) -{ - zval **str; - void *tmp = NULL; - int32_t tmp_len = 0; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_text_ex(str); - - if (Z_TYPE_PP(str) == IS_UNICODE && Z_USTRLEN_PP(str) == 0) { - RETURN_EMPTY_UNICODE(); - } else if (Z_TYPE_PP(str) == IS_BINARY && Z_BINLEN_PP(str) == 0) { - RETURN_EMPTY_BINARY(); - } else if (Z_TYPE_PP(str) == IS_STRING && Z_STRLEN_PP(str) == 0) { - RETURN_EMPTY_STRING(); - } - - if (Z_TYPE_PP(str) == IS_UNICODE) { - tmp = (UChar *)php_u_addslashes(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), - &tmp_len, 0 TSRMLS_CC); - RETURN_UNICODEL((UChar *)tmp, tmp_len, 0); - } else { - tmp = (char *)php_addslashes(Z_STRVAL_PP(str), Z_STRLEN_PP(str), - &tmp_len, 0 TSRMLS_CC); - if (Z_TYPE_PP(str) == IS_BINARY) { - RETURN_BINARYL((char *)tmp, tmp_len, 0); - } else { - RETURN_STRINGL((char *)tmp, tmp_len, 0); - } - } -} -/* }}} */ - -/* {{{ proto string stripcslashes(string str) - Strips backslashes from a string. Uses C-style conventions */ -PHP_FUNCTION(stripcslashes) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(str); - - ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - php_stripcslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value)); -} -/* }}} */ - -/* {{{ proto string stripslashes(string str) - Strips backslashes from a string */ -PHP_FUNCTION(stripslashes) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_text_ex(str); - - if (Z_TYPE_PP(str) == IS_UNICODE) { - ZVAL_UNICODEL(return_value, Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), 1); - php_u_stripslashes(Z_USTRVAL_P(return_value), &Z_USTRLEN_P(return_value) TSRMLS_CC); - } else { - if (Z_TYPE_PP(str) == IS_BINARY) { - ZVAL_BINARYL(return_value, Z_BINVAL_PP(str), Z_BINLEN_PP(str), 1); - } else { - ZVAL_STRINGL(return_value, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); - } - php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC); - } -} -/* }}} */ - -#ifndef HAVE_STRERROR -/* {{{ php_strerror - */ -char *php_strerror(int errnum) -{ - extern int sys_nerr; - extern char *sys_errlist[]; - TSRMLS_FETCH(); - - if ((unsigned int) errnum < sys_nerr) { - return(sys_errlist[errnum]); - } - - (void) sprintf(BG(str_ebuf), "Unknown error: %d", errnum); - return(BG(str_ebuf)); -} -/* }}} */ -#endif - -/* {{{ php_stripcslashes - */ -PHPAPI void php_stripcslashes(char *str, int *len) -{ - char *source, *target, *end; - int nlen = *len, i; - char numtmp[4]; - - for (source=str, end=str+nlen, target=str; source < end; source++) { - if (*source == '\\' && source+1 < end) { - source++; - switch (*source) { - case 'n': *target++='\n'; nlen--; break; - case 'r': *target++='\r'; nlen--; break; - case 'a': *target++='\a'; nlen--; break; - case 't': *target++='\t'; nlen--; break; - case 'v': *target++='\v'; nlen--; break; - case 'b': *target++='\b'; nlen--; break; - case 'f': *target++='\f'; nlen--; break; - case '\\': *target++='\\'; nlen--; break; - case 'x': - if (source+1 < end && isxdigit((int)(*(source+1)))) { - numtmp[0] = *++source; - if (source+1 < end && isxdigit((int)(*(source+1)))) { - numtmp[1] = *++source; - numtmp[2] = '\0'; - nlen-=3; - } else { - numtmp[1] = '\0'; - nlen-=2; - } - *target++=(char)strtol(numtmp, NULL, 16); - break; - } - /* break is left intentionally */ - default: - i=0; - while (source < end && *source >= '0' && *source <= '7' && i<3) { - numtmp[i++] = *source++; - } - if (i) { - numtmp[i]='\0'; - *target++=(char)strtol(numtmp, NULL, 8); - nlen-=i; - source--; - } else { - *target++=*source; - nlen--; - } - } - } else { - *target++=*source; - } - } - - if (nlen != 0) { - *target='\0'; - } - - *len = nlen; -} -/* }}} */ - -/* {{{ php_addcslashes - */ -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC) -{ - char flags[256]; - char *new_str = safe_emalloc(4, (length?length:(length=strlen(str))), 1); - char *source, *target; - char *end; - char c; - int newlen; - - if (!wlength) { - wlength = strlen(what); - } - - if (!length) { - length = strlen(str); - } - - php_charmask(what, wlength, flags TSRMLS_CC); - - for (source = str, end = source + length, target = new_str; (c = *source) || (source < end); source++) { - if (flags[(unsigned char)c]) { - if ((unsigned char) c < 32 || (unsigned char) c > 126) { - *target++ = '\\'; - switch (c) { - case '\n': *target++ = 'n'; break; - case '\t': *target++ = 't'; break; - case '\r': *target++ = 'r'; break; - case '\a': *target++ = 'a'; break; - case '\v': *target++ = 'v'; break; - case '\b': *target++ = 'b'; break; - case '\f': *target++ = 'f'; break; - default: target += sprintf(target, "%03o", (unsigned char) c); - } - continue; - } - *target++ = '\\'; - } - *target++ = c; - } - *target = 0; - newlen = target - new_str; - if (target - new_str < length * 4) { - new_str = erealloc(new_str, newlen + 1); - } - if (new_length) { - *new_length = newlen; - } - if (should_free) { - STR_FREE(str); - } - return new_str; -} -/* }}} */ - -/* {{{ php_u_addslashes - */ -PHPAPI UChar *php_u_addslashes(UChar *str, int32_t length, int32_t *new_length, int should_free TSRMLS_DC) -{ - return php_u_addslashes_ex(str, length, new_length, should_free, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_u_addslashes_ex - */ -PHPAPI UChar *php_u_addslashes_ex(UChar *str, int32_t length, int32_t *new_length, int should_free, int ignore_sybase TSRMLS_DC) -{ - UChar *buf; - int32_t buf_len = 0, i = 0; - UChar32 ch; - - if (!new_length) { - new_length = &buf_len; - } - if (!str) { - *new_length = 0; - return str; - } - - buf = eumalloc(length * 2); - if (!ignore_sybase && PG(magic_quotes_sybase)) { - while (i < length) { - U16_NEXT(str, i, length, ch); - switch (ch) { - case '\0': - *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */ - *(buf+buf_len) = (UChar)0x30; buf_len++; /* 0 */ - break; - case '\'': - *(buf+buf_len) = (UChar)0x27; buf_len++; /* ' */ - *(buf+buf_len) = (UChar)0x27; buf_len++; /* ' */ - break; - default: - buf_len += zend_codepoint_to_uchar(ch, buf+buf_len); - break; - } - } - } else { - while (i < length) { - U16_NEXT(str, i, length, ch); - switch (ch) { - case '\0': - *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */ - *(buf+buf_len) = (UChar)0x30; buf_len++; /* 0 */ - break; - case '\'': - case '\"': - case '\\': - *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */ - /* break is missing *intentionally* */ - default: - buf_len += zend_codepoint_to_uchar(ch, buf+buf_len); - break; - } - } - } - *(buf+buf_len) = 0; - - if (should_free) { - STR_FREE(str); - } - buf = eurealloc(buf, buf_len+1); - *new_length = buf_len; - return buf; -} -/* }}} */ - -/* {{{ php_addslashes - */ -PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free TSRMLS_DC) -{ - return php_addslashes_ex(str, length, new_length, should_free, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_addslashes_ex - */ -PHPAPI char *php_addslashes_ex(char *str, int length, int *new_length, int should_free, int ignore_sybase TSRMLS_DC) -{ - /* maximum string length, worst case situation */ - char *new_str; - char *source, *target; - char *end; - int local_new_length; - - if (!new_length) { - new_length = &local_new_length; - } - if (!str) { - *new_length = 0; - return str; - } - new_str = (char *) safe_emalloc(2, (length ? length : (length = strlen(str))), 1); - source = str; - end = source + length; - target = new_str; - - if (!ignore_sybase && PG(magic_quotes_sybase)) { - while (source < end) { - switch (*source) { - case '\0': - *target++ = '\\'; - *target++ = '0'; - break; - case '\'': - *target++ = '\''; - *target++ = '\''; - break; - default: - *target++ = *source; - break; - } - source++; - } - } else { - while (source < end) { - switch (*source) { - case '\0': - *target++ = '\\'; - *target++ = '0'; - break; - case '\'': - case '\"': - case '\\': - *target++ = '\\'; - /* break is missing *intentionally* */ - default: - *target++ = *source; - break; - } - - source++; - } - } - - *target = 0; - *new_length = target - new_str; - if (should_free) { - STR_FREE(str); - } - new_str = (char *) erealloc(new_str, *new_length + 1); - return new_str; -} -/* }}} */ - -#define _HEB_BLOCK_TYPE_ENG 1 -#define _HEB_BLOCK_TYPE_HEB 2 -#define isheb(c) (((((unsigned char) c) >= 224) && (((unsigned char) c) <= 250)) ? 1 : 0) -#define _isblank(c) (((((unsigned char) c) == ' ' || ((unsigned char) c) == '\t')) ? 1 : 0) -#define _isnewline(c) (((((unsigned char) c) == '\n' || ((unsigned char) c) == '\r')) ? 1 : 0) - -/* {{{ php_char_to_str_ex - */ -PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_len, zval *result, int case_sensitivity, int *replace_count) -{ - int char_count = 0; - int replaced = 0; - char *source, *target, *tmp, *source_end=str+len, *tmp_end = NULL; - - for (source = str; source < source_end; source++) { - if ((case_sensitivity && *source == from) || (!case_sensitivity && tolower(*source) == tolower(from))) { - char_count++; - } - } - - if (char_count == 0 && case_sensitivity) { - ZVAL_STRINGL(result, str, len, 1); - return 0; - } - - Z_STRLEN_P(result) = len + (char_count * (to_len - 1)); - Z_STRVAL_P(result) = target = emalloc(Z_STRLEN_P(result) + 1); - Z_TYPE_P(result) = IS_STRING; - - for (source = str; source < source_end; source++) { - if ((case_sensitivity && *source == from) || (!case_sensitivity && tolower(*source) == tolower(from))) { - replaced = 1; - if (replace_count) { - *replace_count += 1; - } - for (tmp = to, tmp_end = tmp+to_len; tmp < tmp_end; tmp++) { - *target = *tmp; - target++; - } - } else { - *target = *source; - target++; - } - } - *target = 0; - return replaced; -} -/* }}} */ - -/* {{{ php_char_to_str - */ -PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result) -{ - return php_char_to_str_ex(str, len, from, to, to_len, result, 1, NULL); -} -/* }}} */ - -/* {{{ php_str_to_str_ex - */ -PHPAPI char *php_str_to_str_ex(char *haystack, int length, - char *needle, int needle_len, char *str, int str_len, int *_new_length, int case_sensitivity, int *replace_count) -{ - char *new_str; - - if (needle_len < length) { - char *end, *haystack_dup = NULL, *needle_dup = NULL; - char *e, *s, *p, *r; - - if (needle_len == str_len) { - new_str = estrndup(haystack, length); - *_new_length = length; - - if (case_sensitivity) { - end = new_str + length; - for (p = new_str; (r = php_memnstr(p, needle, needle_len, end)); p = r + needle_len) { - memcpy(r, str, str_len); - if (replace_count) { - (*replace_count)++; - } - } - } else { - haystack_dup = estrndup(haystack, length); - needle_dup = estrndup(needle, needle_len); - php_strtolower(haystack_dup, length); - php_strtolower(needle_dup, needle_len); - end = haystack_dup + length; - for (p = haystack_dup; (r = php_memnstr(p, needle_dup, needle_len, end)); p = r + needle_len) { - memcpy(new_str + (r - haystack_dup), str, str_len); - if (replace_count) { - (*replace_count)++; - } - } - efree(haystack_dup); - efree(needle_dup); - } - return new_str; - } else { - if (!case_sensitivity) { - haystack_dup = estrndup(haystack, length); - needle_dup = estrndup(needle, needle_len); - php_strtolower(haystack_dup, length); - php_strtolower(needle_dup, needle_len); - } - - if (str_len < needle_len) { - new_str = emalloc(length + 1); - } else { - int count = 0; - char *o, *n, *endp; - - if (case_sensitivity) { - o = haystack; - n = needle; - } else { - o = haystack_dup; - n = needle_dup; - } - endp = o + length; - - while ((o = php_memnstr(o, n, needle_len, endp))) { - o += needle_len; - count++; - } - if (count == 0) { - /* Needle doesn't occur, shortcircuit the actual replacement. */ - if (haystack_dup) { - efree(haystack_dup); - } - if (needle_dup) { - efree(needle_dup); - } - new_str = estrndup(haystack, length); - if (_new_length) { - *_new_length = length; - } - return new_str; - } else { - new_str = safe_emalloc(count, str_len - needle_len, length + 1); - } - } - - e = s = new_str; - - if (case_sensitivity) { - end = haystack + length; - for (p = haystack; (r = php_memnstr(p, needle, needle_len, end)); p = r + needle_len) { - memcpy(e, p, r - p); - e += r - p; - memcpy(e, str, str_len); - e += str_len; - if (replace_count) { - (*replace_count)++; - } - } - - if (p < end) { - memcpy(e, p, end - p); - e += end - p; - } - } else { - end = haystack_dup + length; - - for (p = haystack_dup; (r = php_memnstr(p, needle_dup, needle_len, end)); p = r + needle_len) { - memcpy(e, haystack + (p - haystack_dup), r - p); - e += r - p; - memcpy(e, str, str_len); - e += str_len; - if (replace_count) { - (*replace_count)++; - } - } - - if (p < end) { - memcpy(e, haystack + (p - haystack_dup), end - p); - e += end - p; - } - } - - if (haystack_dup) { - efree(haystack_dup); - } - if (needle_dup) { - efree(needle_dup); - } - - *e = '\0'; - *_new_length = e - s; - - new_str = erealloc(new_str, *_new_length + 1); - return new_str; - } - } else if (needle_len > length) { -nothing_todo: - *_new_length = length; - new_str = estrndup(haystack, length); - return new_str; - } else { - if (case_sensitivity ? strncmp(haystack, needle, length) : strncasecmp(haystack, needle, length)) { - goto nothing_todo; - } else { - *_new_length = str_len; - new_str = estrndup(str, str_len); - if (replace_count) { - (*replace_count)++; - } - return new_str; - } - } - -} -/* }}} */ - -/* {{{ php_str_to_str - */ -PHPAPI char *php_str_to_str(char *haystack, int length, - char *needle, int needle_len, char *str, int str_len, int *_new_length) -{ - return php_str_to_str_ex(haystack, length, needle, needle_len, str, str_len, _new_length, 1, NULL); -} -/* }}} - */ - -/* {{{ php_str_replace_in_subject - */ -static void php_str_replace_in_subject(zval *search, zval *replace, zval **subject, zval *result, int case_sensitivity, int *replace_count) -{ - zval **search_entry, - **replace_entry = NULL, - temp_result; - char *replace_value = NULL; - int replace_len = 0; - - /* Make sure we're dealing with strings. */ - convert_to_string_ex(subject); - Z_TYPE_P(result) = IS_STRING; - if (Z_STRLEN_PP(subject) == 0) { - ZVAL_STRINGL(result, "", 0, 1); - return; - } - - /* If search is an array */ - if (Z_TYPE_P(search) == IS_ARRAY) { - /* Duplicate subject string for repeated replacement */ - *result = **subject; - zval_copy_ctor(result); - INIT_PZVAL(result); - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(search)); - - if (Z_TYPE_P(replace) == IS_ARRAY) { - zend_hash_internal_pointer_reset(Z_ARRVAL_P(replace)); - } else { - /* Set replacement value to the passed one */ - replace_value = Z_STRVAL_P(replace); - replace_len = Z_STRLEN_P(replace); - } - - /* For each entry in the search array, get the entry */ - while (zend_hash_get_current_data(Z_ARRVAL_P(search), (void **) &search_entry) == SUCCESS) { - /* Make sure we're dealing with strings. */ - SEPARATE_ZVAL(search_entry); - convert_to_string(*search_entry); - if (Z_STRLEN_PP(search_entry) == 0) { - zend_hash_move_forward(Z_ARRVAL_P(search)); - if (Z_TYPE_P(replace) == IS_ARRAY) { - zend_hash_move_forward(Z_ARRVAL_P(replace)); - } - continue; - } - - /* If replace is an array. */ - if (Z_TYPE_P(replace) == IS_ARRAY) { - /* Get current entry */ - if (zend_hash_get_current_data(Z_ARRVAL_P(replace), (void **)&replace_entry) == SUCCESS) { - /* Make sure we're dealing with strings. */ - convert_to_string_ex(replace_entry); - - /* Set replacement value to the one we got from array */ - replace_value = Z_STRVAL_PP(replace_entry); - replace_len = Z_STRLEN_PP(replace_entry); - - zend_hash_move_forward(Z_ARRVAL_P(replace)); - } else { - /* We've run out of replacement strings, so use an empty one. */ - replace_value = ""; - replace_len = 0; - } - } - - if (Z_STRLEN_PP(search_entry) == 1) { - php_char_to_str_ex(Z_STRVAL_P(result), - Z_STRLEN_P(result), - Z_STRVAL_PP(search_entry)[0], - replace_value, - replace_len, - &temp_result, - case_sensitivity, - replace_count); - } else if (Z_STRLEN_PP(search_entry) > 1) { - Z_STRVAL(temp_result) = php_str_to_str_ex(Z_STRVAL_P(result), Z_STRLEN_P(result), - Z_STRVAL_PP(search_entry), Z_STRLEN_PP(search_entry), - replace_value, replace_len, &Z_STRLEN(temp_result), case_sensitivity, replace_count); - } - - efree(Z_STRVAL_P(result)); - Z_STRVAL_P(result) = Z_STRVAL(temp_result); - Z_STRLEN_P(result) = Z_STRLEN(temp_result); - - if (Z_STRLEN_P(result) == 0) { - return; - } - - zend_hash_move_forward(Z_ARRVAL_P(search)); - } - } else { - if (Z_STRLEN_P(search) == 1) { - php_char_to_str_ex(Z_STRVAL_PP(subject), - Z_STRLEN_PP(subject), - Z_STRVAL_P(search)[0], - Z_STRVAL_P(replace), - Z_STRLEN_P(replace), - result, - case_sensitivity, - replace_count); - } else if (Z_STRLEN_P(search) > 1) { - Z_STRVAL_P(result) = php_str_to_str_ex(Z_STRVAL_PP(subject), Z_STRLEN_PP(subject), - Z_STRVAL_P(search), Z_STRLEN_P(search), - Z_STRVAL_P(replace), Z_STRLEN_P(replace), &Z_STRLEN_P(result), case_sensitivity, replace_count); - } else { - *result = **subject; - zval_copy_ctor(result); - INIT_PZVAL(result); - } - } -} -/* }}} */ - -/* {{{ php_str_replace_common - */ -static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensitivity) -{ - zval **subject, **search, **replace, **subject_entry, **zcount; - zval *result; - char *string_key; - uint string_key_len; - ulong num_key; - int count = 0; - int argc = ZEND_NUM_ARGS(); - - if (argc < 3 || argc > 4 || - zend_get_parameters_ex(argc, &search, &replace, &subject, &zcount) == FAILURE) { - WRONG_PARAM_COUNT; - } - - SEPARATE_ZVAL(search); - SEPARATE_ZVAL(replace); - SEPARATE_ZVAL(subject); - - /* Make sure we're dealing with strings and do the replacement. */ - if (Z_TYPE_PP(search) != IS_ARRAY) { - convert_to_string_ex(search); - convert_to_string_ex(replace); - } else if (Z_TYPE_PP(replace) != IS_ARRAY) { - convert_to_string_ex(replace); - } - - /* if subject is an array */ - if (Z_TYPE_PP(subject) == IS_ARRAY) { - array_init(return_value); - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(subject)); - - /* For each subject entry, convert it to string, then perform replacement - and add the result to the return_value array. */ - while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { - if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) { - MAKE_STD_ZVAL(result); - SEPARATE_ZVAL(subject_entry); - php_str_replace_in_subject(*search, *replace, subject_entry, result, case_sensitivity, (argc > 3) ? &count : NULL); - } else { - ALLOC_ZVAL(result); - ZVAL_ADDREF(*subject_entry); - COPY_PZVAL_TO_ZVAL(*result, *subject_entry); - } - /* Add to return array */ - switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key, - &string_key_len, &num_key, 0, NULL)) { - case HASH_KEY_IS_STRING: - add_assoc_zval_ex(return_value, string_key, string_key_len, result); - break; - - case HASH_KEY_IS_LONG: - add_index_zval(return_value, num_key, result); - break; - } - - zend_hash_move_forward(Z_ARRVAL_PP(subject)); - } - } else { /* if subject is not an array */ - php_str_replace_in_subject(*search, *replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL); - } - if (argc > 3) { - zval_dtor(*zcount); - ZVAL_LONG(*zcount, count); - } -} -/* }}} */ - -/* {{{ proto mixed str_replace(mixed search, mixed replace, mixed subject [, int &replace_count]) - Replaces all occurrences of search in haystack with replace */ -PHP_FUNCTION(str_replace) -{ - php_str_replace_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto mixed str_ireplace(mixed search, mixed replace, mixed subject [, int &replace_count]) - Replaces all occurrences of search in haystack with replace / case-insensitive */ -PHP_FUNCTION(str_ireplace) -{ - php_str_replace_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ php_hebrev - * - * Converts Logical Hebrew text (Hebrew Windows style) to Visual text - * Cheers/complaints/flames - Zeev Suraski - */ -static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) -{ - zval **str, **max_chars_per_line; - char *heb_str, *tmp, *target, *broken_str; - int block_start, block_end, block_type, block_length, i; - long max_chars=0; - int begin, end, char_count, orig_begin; - - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &str) == FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &str, &max_chars_per_line) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(max_chars_per_line); - max_chars = Z_LVAL_PP(max_chars_per_line); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(str); - - if (Z_STRLEN_PP(str) == 0) { - RETURN_FALSE; - } - - tmp = Z_STRVAL_PP(str); - block_start=block_end=0; - - heb_str = (char *) emalloc(Z_STRLEN_PP(str)+1); - target = heb_str+Z_STRLEN_PP(str); - *target = 0; - target--; - - block_length=0; - - if (isheb(*tmp)) { - block_type = _HEB_BLOCK_TYPE_HEB; - } else { - block_type = _HEB_BLOCK_TYPE_ENG; - } - - do { - if (block_type == _HEB_BLOCK_TYPE_HEB) { - while ((isheb((int)*(tmp+1)) || _isblank((int)*(tmp+1)) || ispunct((int)*(tmp+1)) || (int)*(tmp+1)=='\n' ) && block_end': - *target = '<'; - break; - case '\\': - *target = '/'; - break; - case '/': - *target = '\\'; - break; - default: - break; - } - target--; - } - block_type = _HEB_BLOCK_TYPE_ENG; - } else { - while (!isheb(*(tmp+1)) && (int)*(tmp+1)!='\n' && block_end < Z_STRLEN_PP(str)-1) { - tmp++; - block_end++; - block_length++; - } - while ((_isblank((int)*tmp) || ispunct((int)*tmp)) && *tmp!='/' && *tmp!='-' && block_end > block_start) { - tmp--; - block_end--; - } - for (i = block_end; i >= block_start; i--) { - *target = Z_STRVAL_PP(str)[i]; - target--; - } - block_type = _HEB_BLOCK_TYPE_HEB; - } - block_start=block_end+1; - } while (block_end < Z_STRLEN_PP(str)-1); - - - broken_str = (char *) emalloc(Z_STRLEN_PP(str)+1); - begin=end=Z_STRLEN_PP(str)-1; - target = broken_str; - - while (1) { - char_count=0; - while ((!max_chars || char_count < max_chars) && begin > 0) { - char_count++; - begin--; - if (begin <= 0 || _isnewline(heb_str[begin])) { - while (begin > 0 && _isnewline(heb_str[begin-1])) { - begin--; - char_count++; - } - break; - } - } - if (char_count == max_chars) { /* try to avoid breaking words */ - int new_char_count=char_count, new_begin=begin; - - while (new_char_count > 0) { - if (_isblank(heb_str[new_begin]) || _isnewline(heb_str[new_begin])) { - break; - } - new_begin++; - new_char_count--; - } - if (new_char_count > 0) { - char_count=new_char_count; - begin=new_begin; - } - } - orig_begin=begin; - - if (_isblank(heb_str[begin])) { - heb_str[begin]='\n'; - } - while (begin <= end && _isnewline(heb_str[begin])) { /* skip leading newlines */ - begin++; - } - for (i = begin; i <= end; i++) { /* copy content */ - *target = heb_str[i]; - target++; - } - for (i = orig_begin; i <= end && _isnewline(heb_str[i]); i++) { - *target = heb_str[i]; - target++; - } - begin=orig_begin; - - if (begin <= 0) { - *target = 0; - break; - } - begin--; - end=begin; - } - efree(heb_str); - - if (convert_newlines) { - php_char_to_str(broken_str, Z_STRLEN_PP(str),'\n', "
              \n", 7, return_value); - efree(broken_str); - } else { - Z_STRVAL_P(return_value) = broken_str; - Z_STRLEN_P(return_value) = Z_STRLEN_PP(str); - Z_TYPE_P(return_value) = IS_STRING; - } -} -/* }}} */ - -/* {{{ proto string hebrev(string str [, int max_chars_per_line]) - Converts logical Hebrew text to visual text */ -PHP_FUNCTION(hebrev) -{ - php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string hebrevc(string str [, int max_chars_per_line]) - Converts logical Hebrew text to visual text with newline conversion */ -PHP_FUNCTION(hebrevc) -{ - php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - - -/* {{{ proto string nl2br(string str) - Converts newlines to HTML line breaks */ -PHP_FUNCTION(nl2br) -{ - /* in brief this inserts
              before matched regexp \n\r?|\r\n? */ - zval **zstr; - char *tmp, *str; - int new_length; - char *end, *target; - int repl_cnt = 0; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(zstr); - - str = Z_STRVAL_PP(zstr); - end = str + Z_STRLEN_PP(zstr); - - /* it is really faster to scan twice and allocate mem once insted scanning once - and constantly reallocing */ - while (str < end) { - if (*str == '\r') { - if (*(str+1) == '\n') { - str++; - } - repl_cnt++; - } else if (*str == '\n') { - if (*(str+1) == '\r') { - str++; - } - repl_cnt++; - } - - str++; - } - - if (repl_cnt == 0) { - RETURN_STRINGL(Z_STRVAL_PP(zstr), Z_STRLEN_PP(zstr), 1); - } - - new_length = Z_STRLEN_PP(zstr) + repl_cnt * (sizeof("
              ") - 1); - tmp = target = emalloc(new_length + 1); - - str = Z_STRVAL_PP(zstr); - - while (str < end) { - switch (*str) { - case '\r': - case '\n': - *target++ = '<'; - *target++ = 'b'; - *target++ = 'r'; - *target++ = ' '; - *target++ = '/'; - *target++ = '>'; - - if ((*str == '\r' && *(str+1) == '\n') || (*str == '\n' && *(str+1) == '\r')) { - *target++ = *str++; - } - /* lack of a break; is intentional */ - default: - *target++ = *str; - } - - str++; - } - - *target = '\0'; - - RETURN_STRINGL(tmp, new_length, 0); -} -/* }}} */ - - -/* {{{ proto string strip_tags(string str [, string allowable_tags]) - Strips HTML and PHP tags from a string */ -PHP_FUNCTION(strip_tags) -{ - void *str, *allow = NULL; - int32_t str_len, allow_len = 0; - zend_uchar str_type, allow_type; - void *buf; - int32_t retval_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T|T", &str, &str_len, &str_type, - &allow, &allow_len, &allow_type) == FAILURE) { - return; - } - - if (str_type == IS_UNICODE) { - buf = eustrndup(str, str_len); - retval_len = php_u_strip_tags((UChar *)buf, str_len, NULL, (UChar *)allow, allow_len TSRMLS_CC); - RETURN_UNICODEL((UChar *)buf, retval_len, 0); - } else { - buf = estrndup(str, str_len); - retval_len = php_strip_tags((char *)buf, str_len, NULL, (char *)allow, allow_len); - if (str_type == IS_BINARY) { - RETURN_BINARYL((char *)buf, retval_len, 0); - } else { - RETURN_STRINGL((char *)buf, retval_len, 0); - } - } -} -/* }}} */ - -/* {{{ proto string setlocale(mixed category, string locale [, string ...]) - Set locale information */ -PHP_FUNCTION(setlocale) -{ - pval ***args = (pval ***) safe_emalloc(sizeof(pval **), ZEND_NUM_ARGS(), 0); - zval **pcategory, **plocale; - int i, cat, n_args=ZEND_NUM_ARGS(); - char *loc, *retval; - - if (zend_get_parameters_array_ex(n_args, args) == FAILURE || n_args < 2) { - efree(args); - WRONG_PARAM_COUNT; - } -#ifdef HAVE_SETLOCALE - pcategory = args[0]; - if (Z_TYPE_PP(pcategory) == IS_LONG) { - convert_to_long_ex(pcategory); - cat = Z_LVAL_PP(pcategory); - } else { /* FIXME: The following behaviour should be removed. */ - char *category; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passing locale category name as string is deprecated. Use the LC_* -constants instead."); - convert_to_string_ex(pcategory); - category = Z_STRVAL_P(*pcategory); - - if (!strcasecmp ("LC_ALL", category)) - cat = LC_ALL; - else if (!strcasecmp ("LC_COLLATE", category)) - cat = LC_COLLATE; - else if (!strcasecmp ("LC_CTYPE", category)) - cat = LC_CTYPE; -#ifdef LC_MESSAGES - else if (!strcasecmp ("LC_MESSAGES", category)) - cat = LC_MESSAGES; -#endif - else if (!strcasecmp ("LC_MONETARY", category)) - cat = LC_MONETARY; - else if (!strcasecmp ("LC_NUMERIC", category)) - cat = LC_NUMERIC; - else if (!strcasecmp ("LC_TIME", category)) - cat = LC_TIME; - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME.", category); - efree(args); - RETURN_FALSE; - } - } - - if (Z_TYPE_PP(args[1]) == IS_ARRAY) { - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(args[1])); - i=0; /* not needed in this case: only kill a compiler warning */ - } else { - i=1; - } - while (1) { - if (Z_TYPE_PP(args[1]) == IS_ARRAY) { - if (!zend_hash_num_elements(Z_ARRVAL_PP(args[1]))) { - break; - } - zend_hash_get_current_data(Z_ARRVAL_PP(args[1]),(void **)&plocale); - } else { - plocale = args[i]; - } - - convert_to_string_ex(plocale); - - if (!strcmp ("0", Z_STRVAL_PP(plocale))) { - loc = NULL; - } else { - loc = Z_STRVAL_PP(plocale); - } - - retval = setlocale (cat, loc); - if (retval) { - /* Remember if locale was changed */ - if (loc) { - STR_FREE(BG(locale_string)); - BG(locale_string) = estrdup(retval); - } - - efree(args); - RETVAL_STRING(retval, 1); - - return; - } - - if (Z_TYPE_PP(args[1]) == IS_ARRAY) { - if (zend_hash_move_forward(Z_ARRVAL_PP(args[1])) == FAILURE) break; - } else { - if (++i >= n_args) break; - } - } - -#endif - efree(args); - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto void parse_str(string encoded_string [, array result]) - Parses GET/POST/COOKIE data and sets global variables */ -PHP_FUNCTION(parse_str) -{ - zval **arg; - zval **arrayArg; - zval *sarg; - char *res = NULL; - int argCount; - - argCount = ZEND_NUM_ARGS(); - if (argCount < 1 || argCount > 2 || zend_get_parameters_ex(argCount, &arg, &arrayArg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - sarg = *arg; - if (Z_STRVAL_P(sarg) && *Z_STRVAL_P(sarg)) { - res = estrndup(Z_STRVAL_P(sarg), Z_STRLEN_P(sarg)); - } - - if (argCount == 1) { - zval tmp; - Z_ARRVAL(tmp) = EG(active_symbol_table); - - sapi_module.treat_data(PARSE_STRING, res, &tmp TSRMLS_CC); - } else { - /* Clear out the array that was passed in. */ - zval_dtor(*arrayArg); - array_init(*arrayArg); - - sapi_module.treat_data(PARSE_STRING, res, *arrayArg TSRMLS_CC); - } -} -/* }}} */ - -#define PHP_TAG_BUF_SIZE 1023 - -/* php_u_tag_find / php_tag_find - * - * Check if tag is in a set of tags - * - * states: - * - * 0 start tag - * 1 first non-whitespace char seen - */ - -/* {{{ php_u_tag_find - */ -int php_u_tag_find(UChar *tag, int32_t len, UChar *set, int32_t set_len) -{ - int32_t idx = 0; - UChar32 ch; - UChar *norm, *n; - int state = 0, done = 0; - - if (!len) { - return 0; - } - - norm = eumalloc(len+1); - n = norm; - - while (!done) { - U16_NEXT(tag, idx, len, ch); - switch (u_tolower(ch)) { - case '<': - *(n++) = ch; - break; - case '>': - done = 1; - break; - default: - if (u_isWhitespace(ch) == FALSE) { - if (state == 0) { - state = 1; - if (ch != '/') - *(n++) = ch; - } else { - *(n++) = ch; - } - } else { - if (state == 1) - done = 1; - } - break; - } - } - *(n++) = '>'; - *n = 0; - - if (u_strFindFirst(set, set_len, norm, n-norm) != NULL) { - done = 1; - } else { - done = 0; - } - - efree(norm); - return done; -} -/* }}} */ - -/* {{{ php_tag_find - */ -int php_tag_find(char *tag, int len, char *set) { - char c, *n, *t; - int state=0, done=0; - char *norm = emalloc(len+1); - - n = norm; - t = tag; - c = tolower(*t); - /* - normalize the tag removing leading and trailing whitespace - and turn any into just and any - into - */ - if (!len) { - return 0; - } - while (!done) { - switch (c) { - case '<': - *(n++) = c; - break; - case '>': - done =1; - break; - default: - if (!isspace((int)c)) { - if (state == 0) { - state=1; - if (c != '/') - *(n++) = c; - } else { - *(n++) = c; - } - } else { - if (state == 1) - done=1; - } - break; - } - c = tolower(*(++t)); - } - *(n++) = '>'; - *n = '\0'; - if (strstr(set, norm)) { - done=1; - } else { - done=0; - } - efree(norm); - return done; -} -/* }}} */ - -/* php_u_strip_tags / php_strip_tags - - A simple little state-machine to strip out html and php tags - - State 0 is the output state, State 1 means we are inside a - normal html tag and state 2 means we are inside a php tag. - - The state variable is passed in to allow a function like fgetss - to maintain state across calls to the function. - - lc holds the last significant character read and br is a bracket - counter. - - When an allow string is passed in we keep track of the string - in state 1 and when the tag is closed check it against the - allow string to see if we should allow it. - - swm: Added ability to strip = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - } - } else if (state == 1) { - depth++; - } - break; - - case 0x28: /* '(' */ - if (state == 2) { - if (last != 0x22 && last != 0x27) { /* '"' & '\'' */ - last = 0x28; - br++; - } - } else if (allow_len && state == 1) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - } else if (state == 0) { - *(rp++) = ch; - } - break; - - case 0x29: /* ')' */ - if (state == 2) { - if (last != 0x22 && last != 0x27) { /* '"' & '\'' */ - last = ch; - br--; - } - } else if (allow_len && state == 1) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - } else if (state == 0) { - *(rp++) = ch; - } - break; - - case 0x3E: /* '>' */ - if (depth) { - depth--; - break; - } - - switch (state) { - case 1: /* HTML/XML */ - last = ch; - state = 0; - if (allow_len) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - *(tp) = 0; - if (php_u_tag_find(tbuf, tp-tbuf, allow, allow_len)) { - u_memcpy(rp, tbuf, tp-tbuf); - rp += tp-tbuf; - } - tp = tbuf; - } - break; - - case 2: /* PHP */ - if (!br && last != 0x22 && prev1 == 0x3F) { /* '"' & '?' */ - state = 0; - tp = tbuf; - } - break; - - case 3: - state = 0; - tp = tbuf; - break; - - case 4: /* JavaScript/CSS/etc... */ - if (codepts >= 2 && prev1 == 0x2D && prev2 == 0x2D) { /* '-' */ - state = 0; - tp = tbuf; - } - break; - - default: - *(rp++) = ch; - break; - } - break; - - case 0x22: /* '"' */ - case 0x27: /* '\'' */ - if (state == 2 && prev1 != 0x5C) { /* '\\' */ - if (last == ch) { - last = 0x00; - } else if (last != 0x5C) { - last = ch; - } - } else if (state == 0) { - *(rp++) = ch; - } else if (allow_len && state == 1) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - } - break; - - case 0x21: /* '!' */ - /* JavaScript & Other HTML scripting languages */ - if (state == 1 && prev1 == 0x3C) { /* '<' */ - state = 3; - last = ch; - } else { - if (state == 0) { - *(rp++) = ch; - } else if (allow_len && state == 1) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - *(tp++) = ch; - } - } - break; - - case 0x2D: /* '-' */ - if (state == 3 && codepts >= 2 && prev1 == 0x2D && prev2 == 0x21) { /* '-' & '!' */ - state = 4; - } else { - goto reg_u_char; - } - break; - - case 0x3F: /* '?' */ - if (state == 1 && prev1 == 0x3C) { /* '<' */ - br = 0; - state = 2; - break; - } - - case 'E': - case 'e': - /* !DOCTYPE exception */ - if (state==3 && codepts > 6) { - tmp = idx; - for (i = 0 ; i < 6 ; i++) { - U16_PREV(buf, 0, tmp, doctype[i]); - } - if (u_tolower(doctype[0])=='p' && u_tolower(doctype[1])=='y' && - u_tolower(doctype[2])=='t' && u_tolower(doctype[3])=='c' && - u_tolower(doctype[4])=='o' && u_tolower(doctype[5])=='d') { - state = 1; - break; - } - } - /* fall-through */ - - case 'l': - - /* swm: If we encounter ' 2 && prev1 == 'm' && prev2 == 'x') { - state = 1; - break; - } - /* fall-through */ - - default: -reg_u_char: - if (state == 0) { - rp += zend_codepoint_to_uchar(ch, rp); - } else if (allow_len && state == 1) { - tp = ((tp-tbuf) >= UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); - tp += zend_codepoint_to_uchar(ch, tp); - } - break; - } - } - - *rp = 0; - efree(buf); - if (allow_len) { - efree(tbuf); - efree(allow); - } - if (stateptr) - *stateptr = state; - - return (int32_t)(rp-rbuf); -} -/* }}} */ - -/* {{{ php_strip_tags - */ -PHPAPI size_t php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, int allow_len) -{ - char *tbuf, *buf, *p, *tp, *rp, c, lc; - int br, i=0, depth=0; - int state = 0; - - if (stateptr) - state = *stateptr; - - buf = estrndup(rbuf, len); - c = *buf; - lc = '\0'; - p = buf; - rp = rbuf; - br = 0; - if (allow) { - php_strtolower(allow, allow_len); - tbuf = emalloc(PHP_TAG_BUF_SIZE+1); - tp = tbuf; - } else { - tbuf = tp = NULL; - } - - while (i < len) { - switch (c) { - case '\0': - break; - case '<': - if (isspace(*(p + 1))) { - goto reg_char; - } - if (state == 0) { - lc = '<'; - state = 1; - if (allow) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = '<'; - } - } else if (state == 1) { - depth++; - } - break; - - case '(': - if (state == 2) { - if (lc != '"' && lc != '\'') { - lc = '('; - br++; - } - } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = c; - } else if (state == 0) { - *(rp++) = c; - } - break; - - case ')': - if (state == 2) { - if (lc != '"' && lc != '\'') { - lc = ')'; - br--; - } - } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = c; - } else if (state == 0) { - *(rp++) = c; - } - break; - - case '>': - if (depth) { - depth--; - break; - } - - switch (state) { - case 1: /* HTML/XML */ - lc = '>'; - state = 0; - if (allow) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = '>'; - *tp='\0'; - if (php_tag_find(tbuf, tp-tbuf, allow)) { - memcpy(rp, tbuf, tp-tbuf); - rp += tp-tbuf; - } - tp = tbuf; - } - break; - - case 2: /* PHP */ - if (!br && lc != '\"' && *(p-1) == '?') { - state = 0; - tp = tbuf; - } - break; - - case 3: - state = 0; - tp = tbuf; - break; - - case 4: /* JavaScript/CSS/etc... */ - if (p >= buf + 2 && *(p-1) == '-' && *(p-2) == '-') { - state = 0; - tp = tbuf; - } - break; - - default: - *(rp++) = c; - break; - } - break; - - case '"': - case '\'': - if (state == 2 && *(p-1) != '\\') { - if (lc == c) { - lc = '\0'; - } else if (lc != '\\') { - lc = c; - } - } else if (state == 0) { - *(rp++) = c; - } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = c; - } - break; - - case '!': - /* JavaScript & Other HTML scripting languages */ - if (state == 1 && *(p-1) == '<') { - state = 3; - lc = c; - } else { - if (state == 0) { - *(rp++) = c; - } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = c; - } - } - break; - - case '-': - if (state == 3 && p >= buf + 2 && *(p-1) == '-' && *(p-2) == '!') { - state = 4; - } else { - goto reg_char; - } - break; - - case '?': - - if (state == 1 && *(p-1) == '<') { - br=0; - state=2; - break; - } - - case 'E': - case 'e': - /* !DOCTYPE exception */ - if (state==3 && p > buf+6 - && tolower(*(p-1)) == 'p' - && tolower(*(p-2)) == 'y' - && tolower(*(p-3)) == 't' - && tolower(*(p-4)) == 'c' - && tolower(*(p-5)) == 'o' - && tolower(*(p-6)) == 'd') { - state = 1; - break; - } - /* fall-through */ - - case 'l': - - /* swm: If we encounter ' buf+2 && *(p-1) == 'm' && *(p-2) == 'x') { - state = 1; - break; - } - - /* fall-through */ - default: -reg_char: - if (state == 0) { - *(rp++) = c; - } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = c; - } - break; - } - c = *(++p); - i++; - } - if (rp < rbuf + len) { - *rp = '\0'; - } - efree(buf); - if (allow) - efree(tbuf); - if (stateptr) - *stateptr = state; - - return (size_t)(rp - rbuf); -} -/* }}} */ - -/* {{{ proto string str_repeat(string input, int mult) - Returns the input string repeat mult times */ -PHP_FUNCTION(str_repeat) -{ - void *input_str; /* Input string */ - int32_t input_str_len; - int32_t input_str_chars; - zend_uchar input_str_type; - long mult; /* Multiplier */ - void *result; /* Resulting string */ - int32_t result_len; /* Length of the resulting string, in bytes */ - int32_t result_chars; /* Chars/UChars in resulting string */ - - if ( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl", &input_str, - &input_str_chars, &input_str_type, &mult) == FAILURE ) { - return; - } - - if ( mult < 0 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be greater than or equal to 0"); - return; - } - - /* Don't waste our time if input is empty or if the multiplier is zero */ - if ( input_str_chars == 0 || mult == 0 ) { - if ( input_str_type == IS_UNICODE ) { - RETURN_UNICODEL(USTR_MAKE(""), 0, 0); - } else if ( input_str_type == IS_STRING ) { - RETURN_STRINGL("", 0, 1); - } else { - RETURN_BINARYL("", 0, 1); - } - } - - /* Initialize the result string */ - result_chars = (input_str_chars * mult) + 1; - if ( input_str_type == IS_UNICODE ) { - input_str_len = UBYTES(input_str_chars); - result_len = UBYTES(result_chars); - if ( result_chars < 1 || result_chars > (2147483647/UBYTES(1)) ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may not create strings longer then %ld characters", 2147483647/UBYTES(1)); - RETURN_FALSE; - } - } else { - input_str_len = input_str_chars; - result_len = result_chars; - if ( result_chars < 1 || result_chars > 2147483647 ) { - if ( input_str_type == IS_STRING ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may not create strings longer then 2147483647 characters"); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may not create strings longer then 2147483647 bytes"); - } - RETURN_FALSE; - } - } - result = emalloc(result_len); - - /* Heavy optimization for situations where input string is 1 byte long */ - if ( input_str_len == 1 ) { - memset(result, *((char *)input_str), mult); - } else { - char *s, *e, *ee; - int l=0; - memcpy(result, input_str, input_str_len); - s = result; - e = (char *) result + input_str_len; - ee = (char *) result + result_len; - - while ( e < ee ) { - l = (e-s) < (ee-e) ? (e-s) : (ee-e); - memmove(e, s, l); - e += l; - } - } - - if ( input_str_type == IS_UNICODE ) { - *(((UChar *)result)+result_chars-1) = 0; - RETURN_UNICODEL((UChar *)result, result_chars-1, 0); - } else { - *(((char *)result)+result_chars-1) = '\0'; - if ( input_str_type == IS_BINARY ) { - RETURN_BINARYL((char *)result, result_chars-1, 0); - } else { - RETURN_STRINGL((char *)result, result_chars-1, 0); - } - } -} -/* }}} */ - -/* {{{ proto mixed count_chars(string input [, int mode]) - Returns info about what characters are used in input */ -PHP_FUNCTION(count_chars) -{ - zval **input, **mode; - int chars[256]; - int ac=ZEND_NUM_ARGS(); - int mymode=0; - unsigned char *buf; - int len, inx; - char retstr[256]; - int retlen=0; - - if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &input, &mode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(input); - - if (ac == 2) { - convert_to_long_ex(mode); - mymode = Z_LVAL_PP(mode); - - if (mymode < 0 || mymode > 4) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown mode."); - RETURN_FALSE; - } - } - - len = Z_STRLEN_PP(input); - buf = (unsigned char *) Z_STRVAL_PP(input); - memset((void*) chars, 0, sizeof(chars)); - - while (len > 0) { - chars[*buf]++; - buf++; - len--; - } - - if (mymode < 3) { - array_init(return_value); - } - - for (inx = 0; inx < 256; inx++) { - switch (mymode) { - case 0: - add_index_long(return_value, inx, chars[inx]); - break; - case 1: - if (chars[inx] != 0) { - add_index_long(return_value, inx, chars[inx]); - } - break; - case 2: - if (chars[inx] == 0) { - add_index_long(return_value, inx, chars[inx]); - } - break; - case 3: - if (chars[inx] != 0) { - retstr[retlen++] = inx; - } - break; - case 4: - if (chars[inx] == 0) { - retstr[retlen++] = inx; - } - break; - } - } - - if (mymode >= 3 && mymode <= 4) { - RETURN_STRINGL(retstr, retlen, 1); - } -} -/* }}} */ - -/* {{{ php_strnatcmp - */ -static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) -{ - zval **s1, **s2; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(s1); - convert_to_string_ex(s2); - - RETURN_LONG(strnatcmp_ex(Z_STRVAL_PP(s1), Z_STRLEN_PP(s1), - Z_STRVAL_PP(s2), Z_STRLEN_PP(s2), - fold_case)); -} -/* }}} */ - -/* {{{ proto int strnatcmp(string s1, string s2) - Returns the result of string comparison using 'natural' algorithm */ -PHP_FUNCTION(strnatcmp) -{ - php_strnatcmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array localeconv(void) - Returns numeric formatting information based on the current locale */ -PHP_FUNCTION(localeconv) -{ - zval *grouping, *mon_grouping; - int len, i; - - /* We don't need no stinkin' parameters... */ - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - MAKE_STD_ZVAL(grouping); - MAKE_STD_ZVAL(mon_grouping); - - array_init(return_value); - array_init(grouping); - array_init(mon_grouping); - -#ifdef HAVE_LOCALECONV - { - struct lconv currlocdata; - - localeconv_r( &currlocdata ); - - /* Grab the grouping data out of the array */ - len = strlen(currlocdata.grouping); - - for (i = 0; i < len; i++) { - add_index_long(grouping, i, currlocdata.grouping[i]); - } - - /* Grab the monetary grouping data out of the array */ - len = strlen(currlocdata.mon_grouping); - - for (i = 0; i < len; i++) { - add_index_long(mon_grouping, i, currlocdata.mon_grouping[i]); - } - - add_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1); - add_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1); - add_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1); - add_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1); - add_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1); - add_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1); - add_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1); - add_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1); - add_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits ); - add_assoc_long( return_value, "frac_digits", currlocdata.frac_digits ); - add_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes ); - add_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space ); - add_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes ); - add_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space ); - add_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn ); - add_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn ); - } -#else - /* Ok, it doesn't look like we have locale info floating around, so I guess it - wouldn't hurt to just go ahead and return the POSIX locale information? */ - - add_index_long(grouping, 0, -1); - add_index_long(mon_grouping, 0, -1); - - add_assoc_string(return_value, "decimal_point", "\x2E", 1); - add_assoc_string(return_value, "thousands_sep", "", 1); - add_assoc_string(return_value, "int_curr_symbol", "", 1); - add_assoc_string(return_value, "currency_symbol", "", 1); - add_assoc_string(return_value, "mon_decimal_point", "\x2E", 1); - add_assoc_string(return_value, "mon_thousands_sep", "", 1); - add_assoc_string(return_value, "positive_sign", "", 1); - add_assoc_string(return_value, "negative_sign", "", 1); - add_assoc_long( return_value, "int_frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "p_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "p_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "n_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "n_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "p_sign_posn", CHAR_MAX ); - add_assoc_long( return_value, "n_sign_posn", CHAR_MAX ); -#endif - - zend_hash_update(Z_ARRVAL_P(return_value), "grouping", 9, &grouping, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(return_value), "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ proto int strnatcasecmp(string s1, string s2) - Returns the result of case-insensitive string comparison using 'natural' algorithm */ -PHP_FUNCTION(strnatcasecmp) -{ - php_strnatcmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int substr_count(string haystack, string needle [, int offset [, int length]]) - Returns the number of times a substring occurs in the string */ -PHP_FUNCTION(substr_count) -{ - void *haystack, *needle; - int32_t haystack_len, needle_len; - zend_uchar haystack_type, needle_type; - long offset = 0, length = 0; - int ac = ZEND_NUM_ARGS(); - int count = 0; - void *p, *endp, *tmp; - int32_t i, j; - char cmp; - - if (zend_parse_parameters(ac TSRMLS_CC, "TT|ll", - &haystack, &haystack_len, &haystack_type, - &needle, &needle_len, &needle_type, - &offset, &length) == FAILURE) { - return; - } - - if (needle_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring."); - RETURN_FALSE; - } - - if (haystack_type == IS_UNICODE) { - p = (UChar *)haystack; - endp = (UChar *)haystack + haystack_len; - } else { - p = (char *)haystack; - endp = (char *)haystack + haystack_len; - } - - if (ac > 2) { - if (offset < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset should be greater then or equal to 0."); - RETURN_FALSE; - } - if (haystack_type == IS_UNICODE) { - i = 0; - U16_FWD_N((UChar *)haystack, i, haystack_len, offset); - p = (UChar *)haystack + i; - } else { - p = (char *)haystack + offset; - } - if (p > endp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value %ld exceeds string length.", offset); - RETURN_FALSE; - } - if (ac == 4) { - if (length < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0."); - RETURN_FALSE; - } - if (haystack_type == IS_UNICODE) { - j = i; - i = 0; - U16_FWD_N((UChar *)p, i, haystack_len-j, length); - tmp = (UChar *)p + i; - } else { - tmp = (char *)p + length; - } - if (tmp > endp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value %ld exceeds string length.", offset); - RETURN_FALSE; - } else { - endp = tmp; - } - } - } - - if (haystack_type == IS_UNICODE) { - while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) { - /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */ - p = (UChar *)p + needle_len; - count++; - } - } else { - if (needle_len == 1) { - cmp = ((char *)needle)[0]; - while ((p = memchr(p, cmp, (char *)endp - (char *)p))) { - count++; - p = (char *)p + 1; - } - } else { - while ((p = php_memnstr((char *)p, (char *)needle, needle_len, (char *)endp))) { - /*(char *)p += needle_len; // GCC 4.0.0 cannot compile this */ - p = (char *)p + needle_len; - count++; - } - } - } - - RETURN_LONG(count); -} -/* }}} */ - -/* {{{ proto string str_pad(string input, int pad_length [, string pad_string [, int pad_type]]) - Returns input string padded on the left or right to specified length with pad_string */ -PHP_FUNCTION(str_pad) -{ - /* Input arguments */ - void *input; /* Input string */ - int32_t pad_length; /* Length to pad to, in codepoints for Unicode */ - void *padstr; /* Padding string */ - int32_t pad_type; /* Padding type (left/right/both) */ - int32_t input_len, padstr_len; /* Lengths in code units for Unicode */ - zend_uchar input_type, padstr_type; - - /* Helper variables */ - int32_t input_codepts; /* Number of codepts in Unicode input */ - int32_t num_pad_chars; /* Number of padding characters (total - input size) */ - void *result = NULL; /* Resulting string */ - int32_t result_len = 0; /* Length of the resulting string */ - int32_t i, j, left_pad=0, right_pad=0; - UChar32 ch; - - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 4) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Tl|Tl", - &input, &input_len, &input_type, &pad_length, - &padstr, &padstr_len, &padstr_type, &pad_type) == FAILURE) { - return; - } - - if (input_type == IS_UNICODE) { - /* For Unicode, num_pad_chars/pad_length is number of codepoints */ - i = 0; input_codepts = 0; - input_codepts = u_countChar32((UChar *)input, input_len); - num_pad_chars = pad_length - input_codepts; - } else { - num_pad_chars = pad_length - input_len; - } - /* If resulting string turns out to be shorter than input string, - we simply copy the input and return. */ - if (num_pad_chars < 0) { - if (input_type == IS_UNICODE) { - RETURN_UNICODEL((UChar *)input, input_len, 1); - } else if (input_type == IS_BINARY) { - RETURN_BINARYL((char *)input, input_len, 1); - } else { - RETURN_STRINGL((char *)input, input_len, 1); - } - } - - /* Setup the padding string values if NOT specified. */ - if (ZEND_NUM_ARGS() > 2) { - if (padstr_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty."); - return; - } - if (ZEND_NUM_ARGS() > 3) { - if (pad_type < STR_PAD_LEFT || pad_type > STR_PAD_BOTH) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH."); - return; - } - } else { - pad_type = STR_PAD_RIGHT; - } - } else { - if (input_type == IS_UNICODE) { - padstr = USTR_MAKE(" "); - } else { - padstr = " "; - } - padstr_len = 1; - pad_type = STR_PAD_RIGHT; - } - - if (input_type == IS_UNICODE) { - result = eumalloc(input_len + num_pad_chars*2 + 1); - } else { - result = emalloc(input_len + num_pad_chars + 1); - } - - /* We need to figure out the left/right padding lengths. */ - switch (pad_type) { - case STR_PAD_RIGHT: - left_pad = 0; - right_pad = num_pad_chars; - break; - case STR_PAD_LEFT: - left_pad = num_pad_chars; - right_pad = 0; - break; - case STR_PAD_BOTH: - left_pad = num_pad_chars / 2; - right_pad = num_pad_chars - left_pad; - break; - } - - /* Pad left, copy input, pad right, terminate */ - if (input_type == IS_UNICODE) { - j = 0; - for (i = 0; i < left_pad; i++) { - if (j >= padstr_len) { - j = 0; - } - U16_NEXT((UChar *)padstr, j, padstr_len, ch); - result_len += zend_codepoint_to_uchar(ch, (UChar *)result + result_len); - } - memcpy((UChar *)result + result_len, input, UBYTES(input_len)); - result_len += input_len; - j = 0; - for (i = 0; i < right_pad; i++) { - if (j >= padstr_len) { - j = 0; - } - U16_NEXT((UChar *)padstr, j, padstr_len, ch); - result_len += zend_codepoint_to_uchar(ch, (UChar *)result + result_len); - } - *((UChar *)result + result_len) = 0; - result = eurealloc(result, result_len+1); - } else { - for (i = 0; i < left_pad; i++) - *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len)); - memcpy((char *)result + result_len, input, input_len); - result_len += input_len; - for (i = 0; i < right_pad; i++) - *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len)); - *((char *)result + result_len) = '\0'; - } - - if (input_type == IS_UNICODE) { - if (ZEND_NUM_ARGS() < 3) { - efree(padstr); - } - RETURN_UNICODEL((UChar *)result, result_len, 0); - } else if (input_type == IS_BINARY) { - RETURN_BINARYL((char *)result, result_len, 0); - } else { - RETURN_STRINGL((char *)result, result_len, 0); - } -} -/* }}} */ - -/* {{{ proto mixed sscanf(string str, string format [, string ...]) - Implements an ANSI C compatible sscanf */ -PHP_FUNCTION(sscanf) -{ - zval ***args; - int result; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2) { - WRONG_PARAM_COUNT; - } - - args = (zval ***) safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(args[0]); - convert_to_string_ex(args[1]); - - result = php_sscanf_internal(Z_STRVAL_PP(args[0]), - Z_STRVAL_PP(args[1]), - argc, args, - 2, &return_value TSRMLS_CC); - efree(args); - - if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; - } -} -/* }}} */ - -static char rot13_from[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; -static char rot13_to[] = "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM"; - -/* {{{ proto string str_rot13(string str) - Perform the rot13 transform on a string */ -PHP_FUNCTION(str_rot13) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) { - WRONG_PARAM_COUNT; - } - RETVAL_ZVAL(*arg, 1, 0); - - php_strtr(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), rot13_from, rot13_to, 52); -} -/* }}} */ - - -static void php_string_shuffle(char *str, long len TSRMLS_DC) -{ - long n_elems, rnd_idx, n_left; - char temp; - /* The implementation is stolen from array_data_shuffle */ - /* Thus the characteristics of the randomization are the same */ - n_elems = len; - - if (n_elems <= 1) { - return; - } - - n_left = n_elems; - - while (--n_left) { - rnd_idx = php_rand(TSRMLS_C); - RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX); - if (rnd_idx != n_left) { - temp = str[n_left]; - str[n_left] = str[rnd_idx]; - str[rnd_idx] = temp; - } - } -} - - -/* {{{ proto void str_shuffle(string str) - Shuffles string. One permutation of all possible is created */ -PHP_FUNCTION(str_shuffle) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - RETVAL_ZVAL(*arg, 1, 0); - if (Z_STRLEN_P(return_value) > 1) { - php_string_shuffle(Z_STRVAL_P(return_value), (long) Z_STRLEN_P(return_value) TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto mixed str_word_count(string str, [int format [, string charlist]]) - Counts the number of words inside a string. If format of 1 is specified, - then the function will return an array containing all the words - found inside the string. If format of 2 is specified, then the function - will return an associated array where the position of the word is the key - and the word itself is the value. - - For the purpose of this function, 'word' is defined as a locale dependent - string containing alphabetic characters, which also may contain, but not start - with "'" and "-" characters. -*/ -PHP_FUNCTION(str_word_count) -{ - char *buf, *str, *char_list = NULL, *p, *e, *s, ch[256]; - int str_len, char_list_len, word_count = 0; - long type = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, &type, &char_list, &char_list_len) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (char_list) { - php_charmask(char_list, char_list_len, ch TSRMLS_CC); - } - - p = str; - e = str + str_len; - - if (type == 1 || type == 2) { - array_init(return_value); - } - - while (p < e) { - if (isalpha(*p) || (char_list && ch[(unsigned char)*p])) { - s = ++p - 1; - while (isalpha(*p) || *p == '\'' || (*p == '-' && isalpha(*(p+1))) || (char_list && ch[(unsigned char)*p])) { - p++; - } - - switch (type) - { - case 1: - buf = estrndup(s, (p-s)); - add_next_index_stringl(return_value, buf, (p-s), 1); - efree(buf); - break; - case 2: - buf = estrndup(s, (p-s)); - add_index_stringl(return_value, (s - str), buf, p-s, 1); - efree(buf); - break; - default: - word_count++; - break; - } - } else { - p++; - } - } - - if (!type) { - RETURN_LONG(word_count); - } -} - -/* }}} */ - -#if HAVE_STRFMON -/* {{{ proto string money_format(string format , float value) - Convert monetary value(s) to string */ -PHP_FUNCTION(money_format) -{ - int format_len = 0, str_len; - char *format, *str; - double value; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sd", &format, &format_len, &value) == FAILURE) { - return; - } - - str_len = format_len + 1024; - str = emalloc(str_len); - if ((str_len = strfmon(str, str_len, format, value)) < 0) { - efree(str); - RETURN_FALSE; - } - str[str_len] = 0; - - RETURN_STRINGL(erealloc(str, str_len + 1), str_len, 0); -} -/* }}} */ -#endif - -/* {{{ proto array str_split(string str [, int split_length]) - Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */ -PHP_FUNCTION(str_split) -{ - char *str; - int str_len; - long split_length = 1; - char *p; - int n_reg_segments; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &split_length) == FAILURE) { - return; - } - - if (split_length <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length of each segment must be greater than zero."); - RETURN_FALSE; - } - - array_init(return_value); - - if (split_length >= str_len) { - add_next_index_stringl(return_value, str, str_len, 1); - return; - } - - n_reg_segments = floor(str_len / split_length); - p = str; - - while (n_reg_segments-- > 0) { - add_next_index_stringl(return_value, p, split_length, 1); - p += split_length; - } - - if (p != (str + str_len)) { - add_next_index_stringl(return_value, p, (str + str_len - p), 1); - } -} -/* }}} */ - -/* {{{ proto array strpbrk(string haystack, string char_list) - Search a string for any of a set of characters */ -PHP_FUNCTION(strpbrk) -{ - void *haystack, *char_list; - int32_t haystack_len, char_list_len; - zend_uchar haystack_type, char_list_type; - void *p = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT", - &haystack, &haystack_len, &haystack_type, - &char_list, &char_list_len, &char_list_type) == FAILURE) { - RETURN_FALSE; - } - - if (!char_list_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The character list cannot be empty."); - RETURN_FALSE; - } - - if (haystack_type == IS_UNICODE) { - int32_t i, j; - UChar32 ch1, ch2; - - for (i = 0 ; i < haystack_len ; ) { - U16_NEXT((UChar *)haystack, i, haystack_len, ch1); - for (j = 0 ; j < char_list_len ; ) { - U16_NEXT((UChar *)char_list, j, char_list_len, ch2); - if (ch1 == ch2) { - U16_BACK_1((UChar *)haystack, 0, i); - p = (UChar *)haystack + i; - break; - } - } - if (ch1 == ch2) { - break; - } - } - } else { - p = strpbrk((char *)haystack, (char *)char_list); - } - - if (p) { - if (haystack_type == IS_UNICODE) { - RETURN_UNICODEL((UChar *)p, ((UChar *)haystack + haystack_len - (UChar *)p), 1); - } else if (haystack_type == IS_BINARY) { - RETURN_BINARYL((char *)p, ((char *)haystack + haystack_len - (char *)p), 1); - } else { - RETURN_STRINGL((char *)p, ((char *)haystack + haystack_len - (char *)p), 1); - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int substr_compare(string main_str, string str, int offset [, int length [, bool case_sensitivity]]) - Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters */ -PHP_FUNCTION(substr_compare) -{ - char *s1, *s2; - int s1_len, s2_len; - long offset, len=0; - zend_bool cs=0; - uint cmp_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl|lb", &s1, &s1_len, &s2, &s2_len, &offset, &len, &cs) == FAILURE) { - RETURN_FALSE; - } - - if (offset < 0) { /* negative offset, start comparison at the end of string */ - offset = s1_len + offset; - } - - if (len && offset >= s1_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length."); - RETURN_FALSE; - } - - cmp_len = (uint) (len ? len : MAX(s2_len, (s1_len - offset))); - - if (!cs) { - RETURN_LONG(zend_binary_strncmp(s1 + offset, (s1_len - offset), s2, s2_len, cmp_len)); - } else { - RETURN_LONG(zend_binary_strncasecmp(s1 + offset, (s1_len - offset), s2, s2_len, cmp_len)); - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c deleted file mode 100644 index e1f491a3df48b..0000000000000 --- a/ext/standard/strnatcmp.c +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- mode: c; c-file-style: "k&r" -*- - - Modified for PHP by Andrei Zmievski - - strnatcmp.c -- Perform 'natural order' comparisons of strings in C. - Copyright (C) 2000 by Martin Pool - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include - -#include "php.h" -#include "php_string.h" - -#if defined(__GNUC__) -# define UNUSED __attribute__((__unused__)) -#else -# define UNUSED -#endif - -#if 0 -static char const *version UNUSED = - "$Id$"; -#endif -/* {{{ compare_right - */ -static int -compare_right(char const **a, char const *aend, char const **b, char const *bend) -{ - int bias = 0; - - /* The longest run of digits wins. That aside, the greatest - value wins, but we can't know that it will until we've scanned - both numbers to know that they have the same magnitude, so we - remember it in BIAS. */ - for(;; (*a)++, (*b)++) { - if ((*a == aend || !isdigit((int)(unsigned char)**a)) && - (*b == bend || !isdigit((int)(unsigned char)**b))) - return bias; - else if (*a == aend || !isdigit((int)(unsigned char)**a)) - return -1; - else if (*b == bend || !isdigit((int)(unsigned char)**b)) - return +1; - else if (**a < **b) { - if (!bias) - bias = -1; - } else if (**a > **b) { - if (!bias) - bias = +1; - } - } - - return 0; -} -/* }}} */ - -/* {{{ compare_left - */ -static int -compare_left(char const **a, char const *aend, char const **b, char const *bend) -{ - /* Compare two left-aligned numbers: the first to have a - different value wins. */ - for(;; (*a)++, (*b)++) { - if ((*a == aend || !isdigit((int)(unsigned char)**a)) && - (*b == bend || !isdigit((int)(unsigned char)**b))) - return 0; - else if (*a == aend || !isdigit((int)(unsigned char)**a)) - return -1; - else if (*b == bend || !isdigit((int)(unsigned char)**b)) - return +1; - else if (**a < **b) - return -1; - else if (**a > **b) - return +1; - } - - return 0; -} -/* }}} */ - -/* {{{ strnatcmp_ex - */ -PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case) -{ - char ca, cb; - char const *ap, *bp; - char const *aend = a + a_len, - *bend = b + b_len; - int fractional, result; - - if (a_len == 0 || b_len == 0) - return a_len - b_len; - - ap = a; - bp = b; - while (1) { - ca = *ap; cb = *bp; - - /* skip over leading spaces or zeros */ - while (isspace((int)(unsigned char)ca)) - ca = *++ap; - - while (isspace((int)(unsigned char)cb)) - cb = *++bp; - - /* process run of digits */ - if (isdigit((int)(unsigned char)ca) && isdigit((int)(unsigned char)cb)) { - fractional = (ca == '0' || cb == '0'); - - if (fractional) - result = compare_left(&ap, aend, &bp, bend); - else - result = compare_right(&ap, aend, &bp, bend); - - if (result != 0) - return result; - else if (ap == aend && bp == bend) - /* End of the strings. Let caller sort them out. */ - return 0; - else { - /* Keep on comparing from the current point. */ - ca = *ap; cb = *bp; - } - } - - if (fold_case) { - ca = toupper((int)(unsigned char)ca); - cb = toupper((int)(unsigned char)cb); - } - - if (ca < cb) - return -1; - else if (ca > cb) - return +1; - - ++ap; ++bp; - if (ap >= aend && bp >= bend) - /* The strings compare the same. Perhaps the caller - will want to call strcmp to break the tie. */ - return 0; - else if (ap >= aend) - return -1; - else if (bp >= bend) - return 1; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/sunfuncs.c b/ext/standard/sunfuncs.c deleted file mode 100644 index 1c1709eb13ce0..0000000000000 --- a/ext/standard/sunfuncs.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Moshe Doron | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - The sun position algorithm taken from the 'US Naval Observatory's - Almanac for Computers', implemented by Ken Bloom - for the zmanim project - and finally converted to C by Moshe Doron . -*/ - -#include "php.h" -#include "php_sunfuncs.h" -#include "datetime.h" -#include "php_ini.h" - -#include -#include -#include - -/* {{{ macros and constants - */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#define to_rad(degrees) (degrees * M_PI / 180) -#define to_rad_with_min(degrees) (degrees + minutes / 60) -#define to_deg(rad) (rad * 180 / M_PI) -/* }}} */ - -/* {{{ php_sunrise_sunset - returns time in UTC */ -static double php_sunrise_sunset(long N, double latitude, double longitude, double zenith, int calc_sunset) -{ - double lngHour, t, M, L, Lx, RA, RAx, Lquadrant, RAquadrant, sinDec, cosDec, cosH, H, T, UT, UTx; - - /* step 1: First calculate the day of the year - int N = theday - date(1, 1, theday.year()) + 1; - */ - - /* step 2: convert the longitude to hour value and calculate an approximate time */ - lngHour = longitude / 15; - - /* use 18 for sunset instead of 6 */ - if (calc_sunset) { - t = (double) N + ((18 - lngHour) / 24); /* Sunset */ - } else { - t = (double) N + ((6 - lngHour) / 24); /* Sunrise */ - } - - /* step 3: calculate the sun's mean anomaly */ - M = (0.9856 * t) - 3.289; - - /* step 4: calculate the sun's true longitude */ - L = M + (1.916 * sin(to_rad(M))) + (0.020 * sin (to_rad(2 * M))) + 282.634; - - while (L < 0) { - Lx = L + 360; - assert (Lx != L); /* askingtheguru: realy needed? */ - L = Lx; - } - - while (L >= 360) { - Lx = L - 360; - assert (Lx != L); /* askingtheguru: realy needed? */ - L = Lx; - } - - /* step 5a: calculate the sun's right ascension */ - RA = to_deg(atan(0.91764 * tan(to_rad(L)))); - - while (RA < 0) { - RAx = RA + 360; - assert (RAx != RA); /* askingtheguru: realy needed? */ - RA = RAx; - } - - while (RA >= 360) { - RAx = RA - 360; - assert (RAx != RA); /* askingtheguru: realy needed? */ - RA = RAx; - } - - /* step 5b: right ascension value needs to be in the same quadrant as L */ - Lquadrant = floor(L / 90) * 90; - RAquadrant = floor(RA / 90) * 90; - RA = RA + (Lquadrant - RAquadrant); - - /* step 5c: right ascension value needs to be converted into hours */ - RA /= 15; - - /* step 6: calculate the sun's declination */ - sinDec = 0.39782 * sin(to_rad(L)); - cosDec = cos(asin(sinDec)); - - /* step 7a: calculate the sun's local hour angle */ - cosH = (cos(to_rad(zenith)) - (sinDec * sin(to_rad(latitude)))) / (cosDec * cos(to_rad(latitude))); - - /* XXX: What's the use of this block.. ? - * if (!calc_sunset && cosH > 1 || calc_sunset && cosH < -1) { - * throw doesnthappen(); - * } - */ - - /* step 7b: finish calculating H and convert into hours */ - if (calc_sunset) { - H = to_deg(acos(cosH)); /* Sunset */ - } else { - H = 360 - to_deg(acos(cosH)); /* Sunrise */ - } - H = H / 15; - - /* step 8: calculate local mean time */ - T = H + RA - (0.06571 * t) - 6.622; - - /* step 9: convert to UTC */ - UT = T - lngHour; - - while (UT < 0) { - UTx = UT + 24; - assert (UTx != UT); /* askingtheguru: realy needed? */ - UT = UTx; - } - - while (UT >= 24) { - UTx = UT - 24; - assert (UTx != UT); /* askingtheguru: realy needed? */ - UT = UTx; - } - - return UT; -} -/* }}} */ - -/* {{{ php_do_date_sunrise_sunset - * Common for date_sunrise() and date_sunset() functions - */ -static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_sunset) -{ - zval *date; - double latitude, longitude, zenith, gmt_offset, ret; - int time, N; - long retformat; - char retstr[6]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ldddd", &date, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) { - RETURN_FALSE; - } - - switch (Z_TYPE_P(date)) { - case IS_LONG: - time = Z_LVAL_P(date); - break; - case IS_STRING: - /* todo: more user friendly format */ - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "date must be timestamp for now"); - RETURN_FALSE; - } - - N = php_idate('z', time, 0) + 1; - - switch (ZEND_NUM_ARGS()) { - case 1: - retformat = SUNFUNCS_RET_STRING; - case 2: - latitude = INI_FLT("date.default_latitude"); - case 3: - longitude = INI_FLT("date.default_longitude"); - case 4: - if (calc_sunset) { - zenith = INI_FLT("date.sunset_zenith"); - } else { - zenith = INI_FLT("date.sunrise_zenith"); - } - case 5: - gmt_offset = php_idate('Z', time, 0) / 3600; - case 6: - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid format"); - RETURN_FALSE; - break; - } - - ret = php_sunrise_sunset(N, latitude, longitude, zenith, calc_sunset) + gmt_offset; - - switch (retformat) { - case SUNFUNCS_RET_TIMESTAMP: - RETURN_LONG((int) (time - (time % (24 * 3600))) + (int) (3600 * ret)); - break; - case SUNFUNCS_RET_STRING: - N = (int) ret; - sprintf(retstr, "%02d:%02d", N, (int) (60 * (ret - (double) N))); - RETVAL_STRINGL(retstr, 5, 1); - break; - case SUNFUNCS_RET_DOUBLE: - RETURN_DOUBLE(ret); - break; - } -} -/* }}} */ - -/* {{{ proto mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]]) - Returns time of sunrise for a given day and location */ -PHP_FUNCTION(date_sunrise) -{ - php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]]) - Returns time of sunset for a given day and location */ -PHP_FUNCTION(date_sunset) -{ - php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c deleted file mode 100644 index cac327222ef98..0000000000000 --- a/ext/standard/syslog.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_SYSLOG_H -#include "php_ini.h" -#include "zend_globals.h" - -#include -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#include -#include "basic_functions.h" -#include "php_ext_syslog.h" - -static void start_syslog(TSRMLS_D); - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(syslog) -{ - /* error levels */ - REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */ - REGISTER_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_CS | CONST_PERSISTENT); /* immediate action required */ - REGISTER_LONG_CONSTANT("LOG_CRIT", LOG_CRIT, CONST_CS | CONST_PERSISTENT); /* critical conditions */ - REGISTER_LONG_CONSTANT("LOG_ERR", LOG_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_WARNING", LOG_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_NOTICE", LOG_NOTICE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_INFO", LOG_INFO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_DEBUG", LOG_DEBUG, CONST_CS | CONST_PERSISTENT); - /* facility: type of program logging the message */ - REGISTER_LONG_CONSTANT("LOG_KERN", LOG_KERN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_USER", LOG_USER, CONST_CS | CONST_PERSISTENT); /* generic user level */ - REGISTER_LONG_CONSTANT("LOG_MAIL", LOG_MAIL, CONST_CS | CONST_PERSISTENT); /* log to email */ - REGISTER_LONG_CONSTANT("LOG_DAEMON", LOG_DAEMON, CONST_CS | CONST_PERSISTENT); /* other system daemons */ - REGISTER_LONG_CONSTANT("LOG_AUTH", LOG_AUTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_SYSLOG", LOG_SYSLOG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LPR", LOG_LPR, CONST_CS | CONST_PERSISTENT); -#ifdef LOG_NEWS - /* No LOG_NEWS on HP-UX */ - REGISTER_LONG_CONSTANT("LOG_NEWS", LOG_NEWS, CONST_CS | CONST_PERSISTENT); /* usenet new */ -#endif -#ifdef LOG_UUCP - /* No LOG_UUCP on HP-UX */ - REGISTER_LONG_CONSTANT("LOG_UUCP", LOG_UUCP, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef LOG_CRON - /* apparently some systems don't have this one */ - REGISTER_LONG_CONSTANT("LOG_CRON", LOG_CRON, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef LOG_AUTHPRIV - /* AIX doesn't have LOG_AUTHPRIV */ - REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT); -#endif -#ifndef PHP_WIN32 - REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL3", LOG_LOCAL3, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL4", LOG_LOCAL4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL5", LOG_LOCAL5, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL6", LOG_LOCAL6, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_LOCAL7", LOG_LOCAL7, CONST_CS | CONST_PERSISTENT); -#endif - /* options */ - REGISTER_LONG_CONSTANT("LOG_PID", LOG_PID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_CS | CONST_PERSISTENT); -#ifdef LOG_NOWAIT - REGISTER_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_CS | CONST_PERSISTENT); -#endif -#ifdef LOG_PERROR - /* AIX doesn't have LOG_PERROR */ - REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/ -#endif - - return SUCCESS; -} -/* }}} */ - -PHP_RINIT_FUNCTION(syslog) -{ - if (INI_INT("define_syslog_variables")) { - start_syslog(TSRMLS_C); - } else { - BG(syslog_started)=0; - } - BG(syslog_device)=NULL; - return SUCCESS; -} - - -PHP_RSHUTDOWN_FUNCTION(syslog) -{ - if (BG(syslog_device)) { - efree(BG(syslog_device)); - } -#ifdef PHP_WIN32 - closelog(); -#endif - return SUCCESS; -} - -/* {{{ start_syslog - */ -static void start_syslog(TSRMLS_D) -{ - /* error levels */ - SET_VAR_LONG("LOG_EMERG", LOG_EMERG); /* system unusable */ - SET_VAR_LONG("LOG_ALERT", LOG_ALERT); /* immediate action required */ - SET_VAR_LONG("LOG_CRIT", LOG_CRIT); /* critical conditions */ - SET_VAR_LONG("LOG_ERR", LOG_ERR); - SET_VAR_LONG("LOG_WARNING", LOG_WARNING); - SET_VAR_LONG("LOG_NOTICE", LOG_NOTICE); - SET_VAR_LONG("LOG_INFO", LOG_INFO); - SET_VAR_LONG("LOG_DEBUG", LOG_DEBUG); - /* facility: type of program logging the message */ - SET_VAR_LONG("LOG_KERN", LOG_KERN); - SET_VAR_LONG("LOG_USER", LOG_USER); /* generic user level */ - SET_VAR_LONG("LOG_MAIL", LOG_MAIL); /* log to email */ - SET_VAR_LONG("LOG_DAEMON", LOG_DAEMON); /* other system daemons */ - SET_VAR_LONG("LOG_AUTH", LOG_AUTH); -#ifndef NETWARE - SET_VAR_LONG("LOG_SYSLOG", LOG_SYSLOG); -#endif - SET_VAR_LONG("LOG_LPR", LOG_LPR); -#ifdef LOG_NEWS - /* No LOG_NEWS on HP-UX */ - SET_VAR_LONG("LOG_NEWS", LOG_NEWS); /* usenet new */ -#endif -#ifdef LOG_UUCP - /* No LOG_UUCP on HP-UX */ - SET_VAR_LONG("LOG_UUCP", LOG_UUCP); -#endif -#ifdef LOG_CRON - /* apparently some systems don't have this one */ - SET_VAR_LONG("LOG_CRON", LOG_CRON); -#endif -#ifdef LOG_AUTHPRIV - /* AIX doesn't have LOG_AUTHPRIV */ - SET_VAR_LONG("LOG_AUTHPRIV", LOG_AUTHPRIV); -#endif -#if !defined(PHP_WIN32) && !defined(NETWARE) - SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0); - SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1); - SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2); - SET_VAR_LONG("LOG_LOCAL3", LOG_LOCAL3); - SET_VAR_LONG("LOG_LOCAL4", LOG_LOCAL4); - SET_VAR_LONG("LOG_LOCAL5", LOG_LOCAL5); - SET_VAR_LONG("LOG_LOCAL6", LOG_LOCAL6); - SET_VAR_LONG("LOG_LOCAL7", LOG_LOCAL7); -#endif - /* options */ - SET_VAR_LONG("LOG_PID", LOG_PID); - SET_VAR_LONG("LOG_CONS", LOG_CONS); - SET_VAR_LONG("LOG_ODELAY", LOG_ODELAY); - SET_VAR_LONG("LOG_NDELAY", LOG_NDELAY); -#ifdef LOG_NOWAIT - /* BeOS doesn't have LOG_NOWAIT */ - SET_VAR_LONG("LOG_NOWAIT", LOG_NOWAIT); -#endif -#ifdef LOG_PERROR - /* AIX doesn't have LOG_PERROR */ - SET_VAR_LONG("LOG_PERROR", LOG_PERROR); /*log to stderr*/ -#endif - - BG(syslog_started)=1; -} -/* }}} */ - -/* {{{ proto void define_syslog_variables(void) - Initializes all syslog-related variables */ -PHP_FUNCTION(define_syslog_variables) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (!BG(syslog_started)) { - start_syslog(TSRMLS_C); - } -} -/* }}} */ - -/* {{{ proto bool openlog(string ident, int option, int facility) - Open connection to system logger */ -/* - ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1); - ** Syslog($LOG_EMERG, "help me!") - ** CloseLog(); - */ -PHP_FUNCTION(openlog) -{ - char *ident; - long option, facility; - int ident_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &ident, - &ident_len, &option, &facility) == FAILURE) { - return; - } - if (BG(syslog_device)) { - efree(BG(syslog_device)); - } - BG(syslog_device) = estrndup(ident, ident_len); - openlog(BG(syslog_device), option, facility); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool closelog(void) - Close connection to system logger */ -PHP_FUNCTION(closelog) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - closelog(); - if (BG(syslog_device)) { - efree(BG(syslog_device)); - BG(syslog_device)=NULL; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool syslog(int priority, string message) - Generate a system log message */ -PHP_FUNCTION(syslog) -{ - long priority; - char *message; - int message_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority, - &message, &message_len) == FAILURE) { - return; - } - - /* - * CAVEAT: if the message contains patterns such as "%s", - * this will cause problems. - */ - - php_syslog(priority, "%.500s", message); - RETURN_TRUE; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/tests/array/001.phpt b/ext/standard/tests/array/001.phpt deleted file mode 100644 index f5d0eb81aef6b..0000000000000 --- a/ext/standard/tests/array/001.phpt +++ /dev/null @@ -1,269 +0,0 @@ ---TEST-- -Test array_merge and array_walk ---INI-- -precision=14 ---FILE-- - ---EXPECT-- -array(11) { - [0]=> - string(3) "PHP" - [1]=> - string(27) "PHP: Hypertext Preprocessor" - [2]=> - string(4) "Test" - ["test"]=> - int(27) - [3]=> - string(4) "test" - [4]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [5]=> - string(6) "monkey" - [6]=> - float(-0.33333333333333) - [7]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } - [8]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } - [9]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } -} - -- Testing array_walk() -- -int(0) -string(3) "PHP" -int(1) -string(27) "PHP: Hypertext Preprocessor" -int(2) -string(4) "Test" -string(4) "test" -int(27) -int(3) -string(4) "test" -int(4) -array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" -} -int(5) -string(6) "monkey" -int(6) -float(-0.33333333333333) -int(7) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} -int(8) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} -int(9) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} ---UEXPECT-- -array(11) { - [0]=> - unicode(3) "PHP" - [1]=> - unicode(27) "PHP: Hypertext Preprocessor" - [2]=> - unicode(4) "Test" - [u"test"]=> - int(27) - [3]=> - unicode(4) "test" - [4]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [5]=> - unicode(6) "monkey" - [6]=> - float(-0.33333333333333) - [7]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } - [8]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } - [9]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } - } -} - -- Testing array_walk() -- -int(0) -unicode(3) "PHP" -int(1) -unicode(27) "PHP: Hypertext Preprocessor" -int(2) -unicode(4) "Test" -unicode(4) "test" -int(27) -int(3) -unicode(4) "test" -int(4) -array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" -} -int(5) -unicode(6) "monkey" -int(6) -float(-0.33333333333333) -int(7) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} -int(8) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} -int(9) -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } - } -} diff --git a/ext/standard/tests/array/002.phpt b/ext/standard/tests/array/002.phpt deleted file mode 100644 index 7109f92c4cae7..0000000000000 --- a/ext/standard/tests/array/002.phpt +++ /dev/null @@ -1,1257 +0,0 @@ ---TEST-- -Test arsort, asort, krsort, ksort, rsort, and sort ---INI-- -precision=14 ---FILE-- - ---EXPECT-- -Unsorted data: -array(8) { - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - ["test"]=> - int(27) - [1000]=> - string(4) "test" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} - - -- Testing arsort() -- -No second argument: -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [0]=> - string(3) "PHP" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [0]=> - string(3) "PHP" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - ["test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [1001]=> - string(6) "monkey" - [5]=> - string(4) "Test" - [1000]=> - string(4) "test" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [0]=> - string(3) "PHP" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) - [16777216]=> - float(-0.33333333333333) -} - - -- Testing asort() -- -No second argument: -array(8) { - [16777216]=> - float(-0.33333333333333) - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - ["test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [16777216]=> - float(-0.33333333333333) - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - ["test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [0]=> - string(3) "PHP" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) -} -Using SORT_STRING -array(8) { - [16777216]=> - float(-0.33333333333333) - ["test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" -} - - -- Testing krsort() -- -No second argument: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - ["test"]=> - int(27) - [0]=> - string(3) "PHP" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [0]=> - string(3) "PHP" - ["test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - ["test"]=> - int(27) - [0]=> - string(3) "PHP" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_STRING -array(8) { - ["test"]=> - int(27) - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [16777216]=> - float(-0.33333333333333) - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" - [0]=> - string(3) "PHP" - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} - - -- Testing ksort() -- -No second argument: -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - ["test"]=> - int(27) - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) - [0]=> - string(3) "PHP" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - ["test"]=> - int(27) - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - ["test"]=> - int(27) -} - - -- Testing rsort() -- -No second argument: -array(8) { - [0]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [1]=> - int(27) - [2]=> - string(4) "test" - [3]=> - string(6) "monkey" - [4]=> - string(4) "Test" - [5]=> - string(27) "PHP: Hypertext Preprocessor" - [6]=> - string(3) "PHP" - [7]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [0]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [1]=> - int(27) - [2]=> - string(4) "test" - [3]=> - string(6) "monkey" - [4]=> - string(4) "Test" - [5]=> - string(27) "PHP: Hypertext Preprocessor" - [6]=> - string(3) "PHP" - [7]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - [0]=> - int(27) - [1]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [2]=> - string(3) "PHP" - [3]=> - string(27) "PHP: Hypertext Preprocessor" - [4]=> - string(6) "monkey" - [5]=> - string(4) "Test" - [6]=> - string(4) "test" - [7]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [0]=> - string(4) "test" - [1]=> - string(6) "monkey" - [2]=> - string(4) "Test" - [3]=> - string(27) "PHP: Hypertext Preprocessor" - [4]=> - string(3) "PHP" - [5]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [6]=> - int(27) - [7]=> - float(-0.33333333333333) -} - - -- Testing sort() -- -No second argument: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - string(3) "PHP" - [2]=> - string(27) "PHP: Hypertext Preprocessor" - [3]=> - string(4) "Test" - [4]=> - string(6) "monkey" - [5]=> - string(4) "test" - [6]=> - int(27) - [7]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - string(3) "PHP" - [2]=> - string(27) "PHP: Hypertext Preprocessor" - [3]=> - string(4) "Test" - [4]=> - string(6) "monkey" - [5]=> - string(4) "test" - [6]=> - int(27) - [7]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - string(6) "monkey" - [2]=> - string(4) "test" - [3]=> - string(4) "Test" - [4]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(3) "PHP" - [6]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [7]=> - int(27) -} -Using SORT_STRING -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - int(27) - [2]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [3]=> - string(3) "PHP" - [4]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [6]=> - string(6) "monkey" - [7]=> - string(4) "test" -} ---UEXPECT-- -Unsorted data: -array(8) { - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [u"test"]=> - int(27) - [1000]=> - unicode(4) "test" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} - - -- Testing arsort() -- -No second argument: -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [0]=> - unicode(3) "PHP" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [0]=> - unicode(3) "PHP" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - [u"test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [1001]=> - unicode(6) "monkey" - [5]=> - unicode(4) "Test" - [1000]=> - unicode(4) "test" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [0]=> - unicode(3) "PHP" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) - [16777216]=> - float(-0.33333333333333) -} - - -- Testing asort() -- -No second argument: -array(8) { - [16777216]=> - float(-0.33333333333333) - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [u"test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [16777216]=> - float(-0.33333333333333) - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [u"test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [0]=> - unicode(3) "PHP" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) -} -Using SORT_STRING -array(8) { - [16777216]=> - float(-0.33333333333333) - [u"test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" -} - - -- Testing krsort() -- -No second argument: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [u"test"]=> - int(27) - [0]=> - unicode(3) "PHP" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [0]=> - unicode(3) "PHP" - [u"test"]=> - int(27) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [16777216]=> - float(-0.33333333333333) - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [u"test"]=> - int(27) - [0]=> - unicode(3) "PHP" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_STRING -array(8) { - [u"test"]=> - int(27) - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [16777216]=> - float(-0.33333333333333) - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" - [0]=> - unicode(3) "PHP" - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} - - -- Testing ksort() -- -No second argument: -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [u"test"]=> - int(27) - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) - [0]=> - unicode(3) "PHP" - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [u"test"]=> - int(27) - [5]=> - unicode(4) "Test" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [u"test"]=> - int(27) -} - - -- Testing rsort() -- -No second argument: -array(8) { - [0]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [1]=> - int(27) - [2]=> - unicode(4) "test" - [3]=> - unicode(6) "monkey" - [4]=> - unicode(4) "Test" - [5]=> - unicode(27) "PHP: Hypertext Preprocessor" - [6]=> - unicode(3) "PHP" - [7]=> - float(-0.33333333333333) -} -Using SORT_REGULAR: -array(8) { - [0]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [1]=> - int(27) - [2]=> - unicode(4) "test" - [3]=> - unicode(6) "monkey" - [4]=> - unicode(4) "Test" - [5]=> - unicode(27) "PHP: Hypertext Preprocessor" - [6]=> - unicode(3) "PHP" - [7]=> - float(-0.33333333333333) -} -Using SORT_NUMERIC: -array(8) { - [0]=> - int(27) - [1]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [2]=> - unicode(3) "PHP" - [3]=> - unicode(27) "PHP: Hypertext Preprocessor" - [4]=> - unicode(6) "monkey" - [5]=> - unicode(4) "Test" - [6]=> - unicode(4) "test" - [7]=> - float(-0.33333333333333) -} -Using SORT_STRING -array(8) { - [0]=> - unicode(4) "test" - [1]=> - unicode(6) "monkey" - [2]=> - unicode(4) "Test" - [3]=> - unicode(27) "PHP: Hypertext Preprocessor" - [4]=> - unicode(3) "PHP" - [5]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [6]=> - int(27) - [7]=> - float(-0.33333333333333) -} - - -- Testing sort() -- -No second argument: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - unicode(3) "PHP" - [2]=> - unicode(27) "PHP: Hypertext Preprocessor" - [3]=> - unicode(4) "Test" - [4]=> - unicode(6) "monkey" - [5]=> - unicode(4) "test" - [6]=> - int(27) - [7]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_REGULAR: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - unicode(3) "PHP" - [2]=> - unicode(27) "PHP: Hypertext Preprocessor" - [3]=> - unicode(4) "Test" - [4]=> - unicode(6) "monkey" - [5]=> - unicode(4) "test" - [6]=> - int(27) - [7]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } -} -Using SORT_NUMERIC: -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - unicode(6) "monkey" - [2]=> - unicode(4) "test" - [3]=> - unicode(4) "Test" - [4]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(3) "PHP" - [6]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [7]=> - int(27) -} -Using SORT_STRING -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - int(27) - [2]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [3]=> - unicode(3) "PHP" - [4]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [6]=> - unicode(6) "monkey" - [7]=> - unicode(4) "test" -} diff --git a/ext/standard/tests/array/003.phpt b/ext/standard/tests/array/003.phpt deleted file mode 100644 index 1a17a44d21d7a..0000000000000 --- a/ext/standard/tests/array/003.phpt +++ /dev/null @@ -1,179 +0,0 @@ ---TEST-- -Test usort, uksort and uasort ---INI-- -precision=14 ---FILE-- - ---EXPECT-- --- Testing uasort() -- -array(8) { - [16777216]=> - float(-0.33333333333333) - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - ["test"]=> - int(27) - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [1001]=> - string(6) "monkey" - [1000]=> - string(4) "test" -} - - -- Testing uksort() -- -array(8) { - [-1000]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [0]=> - string(3) "PHP" - [1000]=> - string(4) "test" - [1001]=> - string(6) "monkey" - [16777216]=> - float(-0.33333333333333) - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - ["test"]=> - int(27) -} - - -- Testing usort() -- -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - array(2) { - [0]=> - string(6) "banana" - [1]=> - string(6) "orange" - } - [2]=> - int(27) - [3]=> - string(3) "PHP" - [4]=> - string(27) "PHP: Hypertext Preprocessor" - [5]=> - string(4) "Test" - [6]=> - string(6) "monkey" - [7]=> - string(4) "test" -} ---UEXPECT-- --- Testing uasort() -- -array(8) { - [16777216]=> - float(-0.33333333333333) - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [u"test"]=> - int(27) - [0]=> - unicode(3) "PHP" - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [1001]=> - unicode(6) "monkey" - [1000]=> - unicode(4) "test" -} - - -- Testing uksort() -- -array(8) { - [-1000]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [0]=> - unicode(3) "PHP" - [1000]=> - unicode(4) "test" - [1001]=> - unicode(6) "monkey" - [16777216]=> - float(-0.33333333333333) - [17]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [u"test"]=> - int(27) -} - - -- Testing usort() -- -array(8) { - [0]=> - float(-0.33333333333333) - [1]=> - array(2) { - [0]=> - unicode(6) "banana" - [1]=> - unicode(6) "orange" - } - [2]=> - int(27) - [3]=> - unicode(3) "PHP" - [4]=> - unicode(27) "PHP: Hypertext Preprocessor" - [5]=> - unicode(4) "Test" - [6]=> - unicode(6) "monkey" - [7]=> - unicode(4) "test" -} diff --git a/ext/standard/tests/array/004.phpt b/ext/standard/tests/array/004.phpt deleted file mode 100644 index fa64c3028c373..0000000000000 --- a/ext/standard/tests/array/004.phpt +++ /dev/null @@ -1,96 +0,0 @@ ---TEST-- -Test natsort and natcasesort ---INI-- -precision=14 ---FILE-- -0, - 5=>'test2', - 'abc'=>'test10', - 'test21' -); - -var_dump($data); - -natsort($data); -var_dump($data); - -natcasesort($data); -var_dump($data); -?> ---EXPECT-- -array(5) { - [0]=> - string(5) "Test1" - ["teST2"]=> - int(0) - [5]=> - string(5) "test2" - ["abc"]=> - string(6) "test10" - [6]=> - string(6) "test21" -} -array(5) { - ["teST2"]=> - int(0) - [0]=> - string(5) "Test1" - [5]=> - string(5) "test2" - ["abc"]=> - string(6) "test10" - [6]=> - string(6) "test21" -} -array(5) { - ["teST2"]=> - int(0) - [0]=> - string(5) "Test1" - [5]=> - string(5) "test2" - ["abc"]=> - string(6) "test10" - [6]=> - string(6) "test21" -} ---UEXPECT-- -array(5) { - [0]=> - unicode(5) "Test1" - [u"teST2"]=> - int(0) - [5]=> - unicode(5) "test2" - [u"abc"]=> - unicode(6) "test10" - [6]=> - unicode(6) "test21" -} -array(5) { - [u"teST2"]=> - int(0) - [0]=> - unicode(5) "Test1" - [5]=> - unicode(5) "test2" - [u"abc"]=> - unicode(6) "test10" - [6]=> - unicode(6) "test21" -} -array(5) { - [u"teST2"]=> - int(0) - [0]=> - unicode(5) "Test1" - [5]=> - unicode(5) "test2" - [u"abc"]=> - unicode(6) "test10" - [6]=> - unicode(6) "test21" -} \ No newline at end of file diff --git a/ext/standard/tests/array/005.phpt b/ext/standard/tests/array/005.phpt deleted file mode 100644 index d38bf940d157f..0000000000000 --- a/ext/standard/tests/array/005.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test array_shift behaviour ---FILE-- - "foo", "4" => "bar", "5" => "fubar"); -$c = array("a" => "foo", "b" => "bar", "c" => "fubar"); - -/* simple array */ -echo array_shift($a), "\n"; -var_dump($a); - -/* numerical assoc indices */ -echo array_shift($b), "\n"; -var_dump($b); - -/* assoc indices */ -echo array_shift($c), "\n"; -var_dump($c); - -?> ---EXPECT-- -foo -array(2) { - [0]=> - string(3) "bar" - [1]=> - string(5) "fubar" -} -foo -array(2) { - [0]=> - string(3) "bar" - [1]=> - string(5) "fubar" -} -foo -array(2) { - ["b"]=> - string(3) "bar" - ["c"]=> - string(5) "fubar" -} ---UEXPECT-- -foo -array(2) { - [0]=> - unicode(3) "bar" - [1]=> - unicode(5) "fubar" -} -foo -array(2) { - [0]=> - unicode(3) "bar" - [1]=> - unicode(5) "fubar" -} -foo -array(2) { - [u"b"]=> - unicode(3) "bar" - [u"c"]=> - unicode(5) "fubar" -} diff --git a/ext/standard/tests/array/006.phpt b/ext/standard/tests/array/006.phpt deleted file mode 100644 index 6a6f32dc974fd..0000000000000 --- a/ext/standard/tests/array/006.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Test array_pop behaviour ---FILE-- - "foo", "4" => "bar", "5" => "fubar"); -$c = array("a" => "foo", "b" => "bar", "c" => "fubar"); - -/* simple array */ -echo array_pop($a), "\n"; -array_push($a, "foobar"); -var_dump($a); - -/* numerical assoc indices */ -echo array_pop($b), "\n"; -var_dump($b); - -/* assoc indices */ -echo array_pop($c), "\n"; -var_dump($c); - -?> ---EXPECT-- -fubar -array(3) { - [0]=> - string(3) "foo" - [1]=> - string(3) "bar" - [2]=> - string(6) "foobar" -} -fubar -array(2) { - [3]=> - string(3) "foo" - [4]=> - string(3) "bar" -} -fubar -array(2) { - ["a"]=> - string(3) "foo" - ["b"]=> - string(3) "bar" -} ---UEXPECT-- -fubar -array(3) { - [0]=> - unicode(3) "foo" - [1]=> - unicode(3) "bar" - [2]=> - unicode(6) "foobar" -} -fubar -array(2) { - [3]=> - unicode(3) "foo" - [4]=> - unicode(3) "bar" -} -fubar -array(2) { - [u"a"]=> - unicode(3) "foo" - [u"b"]=> - unicode(3) "bar" -} diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt deleted file mode 100644 index 7a21d3e35a76a..0000000000000 --- a/ext/standard/tests/array/007.phpt +++ /dev/null @@ -1,1174 +0,0 @@ ---TEST-- -Test array_diff and array_diff_assoc behaviour ---FILE-- -2,3,6,3,5,3,3,3,3,3,3,3,3,3,3); -$b = array(2,2,3,3,3,3,3,3,3,3,3,3,3,3,3); -$c = array(-1,1); -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo '$c='.var_export($c,TRUE).";\n"; -var_dump(array_diff($a,$b,$c)); -var_dump(array_diff_assoc($a,$b,$c)); -$a = array( -'a'=>2, -'b'=>'some', -'c'=>'done', -'z'=>'foo', -'f'=>5, -'fan'=>'fen', -7=>18, -9=>25, -11=>42, -12=>42, -45=>42, -73=>'foo', -95=>'some', -'som3'=>'some', -'want'=>'wanna'); -$b = array( -'a'=>7, -7=>18, -9=>13, -11=>42, -45=>46, -'som3'=>'some', -'foo'=>'some', -'goo'=>'foo', -'f'=>5, -'z'=>'equal' -); -$c = array( -73=>'foo', -95=>'some'); -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo '$c='.var_export($c,TRUE).";\n"; -echo "Results:\n\n"; -var_dump(array_diff($a,$b,$c)); -var_dump(array_diff_assoc($a,$b,$c)); - -echo "-=-=-=-=-=-=-=-=- New functionality from 5.0.0 -=-=-=-=-=-=-=-\n"; -error_reporting(E_ALL); -class cr { - private $priv_member; - public $public_member; - function cr($val) { - $this->priv_member = $val; - $this->public_member = $val; - } - static function comp_func_cr($a, $b) { - if ($a->priv_member === $b->priv_member) return 0; - return ($a->priv_member > $b->priv_member)? 1:-1; - } -} - -function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; - -} - -function comp_func_cr($a, $b) { - if ($a->public_member === $b->public_member) return 0; - return ($a->public_member > $b->public_member)? 1:-1; -} - - -/* -$a = array(1,"big"=>2,3,6,3,5,3,3,3,3,3,3,3,3,3,3); -$b = array(2,2,3,3,3,3,3,3,3,3,3,3,3,3,3); -$c = array(-1,1); -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo '$c='.var_export($c,TRUE).";\n"; -var_dump(array_diff($a,$b,$c)); -var_dump(array_diff_assoc($a,$b,$c)); -var_dump(array_udiff($a, $b, $c, "comp_func")); -var_dump(array_diff_uassoc($a,$b,$c, "comp_func")); -*/ - -/* - $a = array(new cr(9),new cr(12),new cr(23),new cr(4),new cr(-15),); - $b = array(new cr(9),new cr(22),new cr( 3),new cr(4),new cr(-15),); - var_dump(array_udiff($a, $b, "comp_func_cr")); -*/ -$a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),); -$b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr( 3), 1=> new cr(4), 2 => new cr(-15),); - -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func"));'."\n"; -var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func")); - - -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));'."\n"; -var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); - - -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_diff_assoc($a, $b));'."\n"; -var_dump(array_diff_assoc($a, $b)); - - -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_udiff($a, $b, "comp_func_cr"));'."\n"; -var_dump(array_udiff($a, $b, "comp_func_cr")); - - -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_udiff_assoc($a, $b, "comp_func_cr"));'."\n"; -var_dump(array_udiff_assoc($a, $b, "comp_func_cr")); - -?> ---EXPECTF-- -$a=array ( - 0 => 1, - 'big' => 2, - 1 => 3, - 2 => 6, - 3 => 3, - 4 => 5, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, -); -$b=array ( - 0 => 2, - 1 => 2, - 2 => 3, - 3 => 3, - 4 => 3, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, -); -$c=array ( - 0 => -1, - 1 => 1, -); -array(2) { - [2]=> - int(6) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - ["big"]=> - int(2) - [1]=> - int(3) - [2]=> - int(6) - [4]=> - int(5) -} -$a=array ( - 'a' => 2, - 'b' => 'some', - 'c' => 'done', - 'z' => 'foo', - 'f' => 5, - 'fan' => 'fen', - 7 => 18, - 9 => 25, - 11 => 42, - 12 => 42, - 45 => 42, - 73 => 'foo', - 95 => 'some', - 'som3' => 'some', - 'want' => 'wanna', -); -$b=array ( - 'a' => 7, - 7 => 18, - 9 => 13, - 11 => 42, - 45 => 46, - 'som3' => 'some', - 'foo' => 'some', - 'goo' => 'foo', - 'f' => 5, - 'z' => 'equal', -); -$c=array ( - 73 => 'foo', - 95 => 'some', -); -Results: - -array(5) { - ["a"]=> - int(2) - ["c"]=> - string(4) "done" - ["fan"]=> - string(3) "fen" - [9]=> - int(25) - ["want"]=> - string(5) "wanna" -} -array(9) { - ["a"]=> - int(2) - ["b"]=> - string(4) "some" - ["c"]=> - string(4) "done" - ["z"]=> - string(3) "foo" - ["fan"]=> - string(3) "fen" - [9]=> - int(25) - [12]=> - int(42) - [45]=> - int(42) - ["want"]=> - string(5) "wanna" -} --=-=-=-=-=-=-=-=- New functionality from 5.0.0 -=-=-=-=-=-=-=- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func")); -array(3) { - ["0.1"]=> - object(cr)#1 (2) { - ["priv_member":"cr":private]=> - int(9) - ["public_member"]=> - int(9) - } - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member":"cr":private]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member":"cr":private]=> - int(23) - ["public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); -array(3) { - ["0.1"]=> - object(cr)#1 (2) { - ["priv_member":"cr":private]=> - int(9) - ["public_member"]=> - int(9) - } - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member":"cr":private]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member":"cr":private]=> - int(23) - ["public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_diff_assoc($a, $b)); -array(5) { - ["0.1"]=> - object(cr)#1 (2) { - ["priv_member":"cr":private]=> - int(9) - ["public_member"]=> - int(9) - } - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member":"cr":private]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member":"cr":private]=> - int(23) - ["public_member"]=> - int(23) - } - [1]=> - object(cr)#4 (2) { - ["priv_member":"cr":private]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member":"cr":private]=> - int(-15) - ["public_member"]=> - int(-15) - } -} -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_udiff($a, $b, "comp_func_cr")); -array(2) { - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member":"cr":private]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member":"cr":private]=> - int(23) - ["public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_udiff_assoc($a, $b, "comp_func_cr")); -array(3) { - ["0.1"]=> - object(cr)#1 (2) { - ["priv_member":"cr":private]=> - int(9) - ["public_member"]=> - int(9) - } - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member":"cr":private]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member":"cr":private]=> - int(23) - ["public_member"]=> - int(23) - } -} ---UEXPECTF-- -$a=array ( - 0 => 1, - 'big' => 2, - 1 => 3, - 2 => 6, - 3 => 3, - 4 => 5, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, -); -$b=array ( - 0 => 2, - 1 => 2, - 2 => 3, - 3 => 3, - 4 => 3, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, -); -$c=array ( - 0 => -1, - 1 => 1, -); -array(2) { - [2]=> - int(6) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - [u"big"]=> - int(2) - [1]=> - int(3) - [2]=> - int(6) - [4]=> - int(5) -} -$a=array ( - 'a' => 2, - 'b' => 'some', - 'c' => 'done', - 'z' => 'foo', - 'f' => 5, - 'fan' => 'fen', - 7 => 18, - 9 => 25, - 11 => 42, - 12 => 42, - 45 => 42, - 73 => 'foo', - 95 => 'some', - 'som3' => 'some', - 'want' => 'wanna', -); -$b=array ( - 'a' => 7, - 7 => 18, - 9 => 13, - 11 => 42, - 45 => 46, - 'som3' => 'some', - 'foo' => 'some', - 'goo' => 'foo', - 'f' => 5, - 'z' => 'equal', -); -$c=array ( - 73 => 'foo', - 95 => 'some', -); -Results: - -array(5) { - [u"a"]=> - int(2) - [u"c"]=> - unicode(4) "done" - [u"fan"]=> - unicode(3) "fen" - [9]=> - int(25) - [u"want"]=> - unicode(5) "wanna" -} -array(9) { - [u"a"]=> - int(2) - [u"b"]=> - unicode(4) "some" - [u"c"]=> - unicode(4) "done" - [u"z"]=> - unicode(3) "foo" - [u"fan"]=> - unicode(3) "fen" - [9]=> - int(25) - [12]=> - int(42) - [45]=> - int(42) - [u"want"]=> - unicode(5) "wanna" -} --=-=-=-=-=-=-=-=- New functionality from 5.0.0 -=-=-=-=-=-=-=- -$a=array ( - '0.1' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 12; - public $public_member = 12; - }, - 0 => - class cr { - private $priv_member = 23; - public $public_member = 23; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -$b=array ( - '0.2' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 22; - public $public_member = 22; - }, - 0 => - class cr { - private $priv_member = 3; - public $public_member = 3; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func")); -array(3) { - [u"0.1"]=> - object(cr)#1 (2) { - [u"priv_member":u"cr":private]=> - int(9) - [u"public_member"]=> - int(9) - } - [u"0.5"]=> - object(cr)#2 (2) { - [u"priv_member":u"cr":private]=> - int(12) - [u"public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - [u"priv_member":u"cr":private]=> - int(23) - [u"public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 12; - public $public_member = 12; - }, - 0 => - class cr { - private $priv_member = 23; - public $public_member = 23; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -$b=array ( - '0.2' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 22; - public $public_member = 22; - }, - 0 => - class cr { - private $priv_member = 3; - public $public_member = 3; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); -array(3) { - [u"0.1"]=> - object(cr)#1 (2) { - [u"priv_member":u"cr":private]=> - int(9) - [u"public_member"]=> - int(9) - } - [u"0.5"]=> - object(cr)#2 (2) { - [u"priv_member":u"cr":private]=> - int(12) - [u"public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - [u"priv_member":u"cr":private]=> - int(23) - [u"public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 12; - public $public_member = 12; - }, - 0 => - class cr { - private $priv_member = 23; - public $public_member = 23; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -$b=array ( - '0.2' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 22; - public $public_member = 22; - }, - 0 => - class cr { - private $priv_member = 3; - public $public_member = 3; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -var_dump(array_diff_assoc($a, $b)); -array(5) { - [u"0.1"]=> - object(cr)#1 (2) { - [u"priv_member":u"cr":private]=> - int(9) - [u"public_member"]=> - int(9) - } - [u"0.5"]=> - object(cr)#2 (2) { - [u"priv_member":u"cr":private]=> - int(12) - [u"public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - [u"priv_member":u"cr":private]=> - int(23) - [u"public_member"]=> - int(23) - } - [1]=> - object(cr)#4 (2) { - [u"priv_member":u"cr":private]=> - int(4) - [u"public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - [u"priv_member":u"cr":private]=> - int(-15) - [u"public_member"]=> - int(-15) - } -} -$a=array ( - '0.1' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 12; - public $public_member = 12; - }, - 0 => - class cr { - private $priv_member = 23; - public $public_member = 23; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -$b=array ( - '0.2' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 22; - public $public_member = 22; - }, - 0 => - class cr { - private $priv_member = 3; - public $public_member = 3; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -var_dump(array_udiff($a, $b, "comp_func_cr")); -array(2) { - [u"0.5"]=> - object(cr)#2 (2) { - [u"priv_member":u"cr":private]=> - int(12) - [u"public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - [u"priv_member":u"cr":private]=> - int(23) - [u"public_member"]=> - int(23) - } -} -$a=array ( - '0.1' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 12; - public $public_member = 12; - }, - 0 => - class cr { - private $priv_member = 23; - public $public_member = 23; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -$b=array ( - '0.2' => - class cr { - private $priv_member = 9; - public $public_member = 9; - }, - '0.5' => - class cr { - private $priv_member = 22; - public $public_member = 22; - }, - 0 => - class cr { - private $priv_member = 3; - public $public_member = 3; - }, - 1 => - class cr { - private $priv_member = 4; - public $public_member = 4; - }, - 2 => - class cr { - private $priv_member = -15; - public $public_member = -15; - }, -); -var_dump(array_udiff_assoc($a, $b, "comp_func_cr")); -array(3) { - [u"0.1"]=> - object(cr)#1 (2) { - [u"priv_member":u"cr":private]=> - int(9) - [u"public_member"]=> - int(9) - } - [u"0.5"]=> - object(cr)#2 (2) { - [u"priv_member":u"cr":private]=> - int(12) - [u"public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - [u"priv_member":u"cr":private]=> - int(23) - [u"public_member"]=> - int(23) - } -} diff --git a/ext/standard/tests/array/008.phpt b/ext/standard/tests/array/008.phpt deleted file mode 100644 index 295a3d3f313fb..0000000000000 --- a/ext/standard/tests/array/008.phpt +++ /dev/null @@ -1,537 +0,0 @@ ---TEST-- -Test array_intersect and array_intersect_assoc behaviour ---FILE-- -2,2,6,3,5,3,3,454,'some_string',3,3,3,3,3,3,3,3,17); -$b = array(2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,17,25,'some_string',7,8,9,109,78,17); -$c = array(-1,2,1,15,25,17); -echo str_repeat("-=",10)." TEST 1 ".str_repeat("-=",20)."\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo '$c='.var_export($c,TRUE).";\n"; - -echo 'array_intersect($a,$b,$c);'."\n"; -var_dump(array_intersect($a,$b,$c)); - -echo 'array_intersect_assoc($a,$b,$c);'."\n"; -var_dump(array_intersect_assoc($a,$b,$c)); - -echo 'array_intersect($a,$b);'."\n"; -var_dump(array_intersect($a,$b)); - -echo 'array_intersect_assoc($a,$b);'."\n"; -var_dump(array_intersect_assoc($a,$b)); - -//-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=- TEST 2 -=-=-=-=-=- -$a = array( -'a'=>2, -'b'=>'some', -'c'=>'done', -'z'=>'foo', -'f'=>5, -'fan'=>'fen', -'bad'=>'bed', -'gate'=>'web', -7=>18, -9=>25, -11=>42, -12=>42, -45=>42, -73=>'foo', -95=>'some', -'som3'=>'some', -'want'=>'wanna'); - - -$b = array( -'a'=>7, -7=>18, -9=>13, -11=>42, -45=>46, -'som3'=>'some', -'foo'=>'some', -'goo'=>'foo', -'f'=>5, -'z'=>'equal', -'gate'=>'web' -); -$c = array( -'gate'=>'web', -73=>'foo', -95=>'some' -); - -echo str_repeat("-=",10)." TEST 2 ".str_repeat("-=",20)."\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo '$c='.var_export($c,TRUE).";\n"; -echo "\n\nResults:\n\n"; - -echo 'array_intersect($a,$b,$c);'."\n"; -var_dump(array_intersect($a,$b,$c)); - -echo 'array_intersect_assoc($a,$b,$c);'."\n"; -var_dump(array_intersect_assoc($a,$b,$c)); - -echo 'array_intersect($a,$b);'."\n"; -var_dump(array_intersect($a,$b)); - -echo 'array_intersect_assoc($a,$b);'."\n"; -var_dump(array_intersect_assoc($a,$b)); -?> ---EXPECT-- --=-=-=-=-=-=-=-=-=-= TEST 1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -$a=array ( - 0 => 1, - 'big' => 2, - 1 => 2, - 2 => 6, - 3 => 3, - 4 => 5, - 5 => 3, - 6 => 3, - 7 => 454, - 8 => 'some_string', - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, - 15 => 3, - 16 => 3, - 17 => 17, -); -$b=array ( - 0 => 2, - 1 => 2, - 2 => 3, - 3 => 3, - 4 => 3, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, - 15 => 17, - 16 => 25, - 17 => 'some_string', - 18 => 7, - 19 => 8, - 20 => 9, - 21 => 109, - 22 => 78, - 23 => 17, -); -$c=array ( - 0 => -1, - 1 => 2, - 2 => 1, - 3 => 15, - 4 => 25, - 5 => 17, -); -array_intersect($a,$b,$c); -array(3) { - ["big"]=> - int(2) - [1]=> - int(2) - [17]=> - int(17) -} -array_intersect_assoc($a,$b,$c); -array(1) { - [1]=> - int(2) -} -array_intersect($a,$b); -array(15) { - ["big"]=> - int(2) - [1]=> - int(2) - [3]=> - int(3) - [5]=> - int(3) - [6]=> - int(3) - [8]=> - string(11) "some_string" - [9]=> - int(3) - [10]=> - int(3) - [11]=> - int(3) - [12]=> - int(3) - [13]=> - int(3) - [14]=> - int(3) - [15]=> - int(3) - [16]=> - int(3) - [17]=> - int(17) -} -array_intersect_assoc($a,$b); -array(10) { - [1]=> - int(2) - [3]=> - int(3) - [5]=> - int(3) - [6]=> - int(3) - [9]=> - int(3) - [10]=> - int(3) - [11]=> - int(3) - [12]=> - int(3) - [13]=> - int(3) - [14]=> - int(3) -} --=-=-=-=-=-=-=-=-=-= TEST 2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -$a=array ( - 'a' => 2, - 'b' => 'some', - 'c' => 'done', - 'z' => 'foo', - 'f' => 5, - 'fan' => 'fen', - 'bad' => 'bed', - 'gate' => 'web', - 7 => 18, - 9 => 25, - 11 => 42, - 12 => 42, - 45 => 42, - 73 => 'foo', - 95 => 'some', - 'som3' => 'some', - 'want' => 'wanna', -); -$b=array ( - 'a' => 7, - 7 => 18, - 9 => 13, - 11 => 42, - 45 => 46, - 'som3' => 'some', - 'foo' => 'some', - 'goo' => 'foo', - 'f' => 5, - 'z' => 'equal', - 'gate' => 'web', -); -$c=array ( - 'gate' => 'web', - 73 => 'foo', - 95 => 'some', -); - - -Results: - -array_intersect($a,$b,$c); -array(6) { - ["b"]=> - string(4) "some" - ["z"]=> - string(3) "foo" - ["gate"]=> - string(3) "web" - [73]=> - string(3) "foo" - [95]=> - string(4) "some" - ["som3"]=> - string(4) "some" -} -array_intersect_assoc($a,$b,$c); -array(1) { - ["gate"]=> - string(3) "web" -} -array_intersect($a,$b); -array(11) { - ["b"]=> - string(4) "some" - ["z"]=> - string(3) "foo" - ["f"]=> - int(5) - ["gate"]=> - string(3) "web" - [7]=> - int(18) - [11]=> - int(42) - [12]=> - int(42) - [45]=> - int(42) - [73]=> - string(3) "foo" - [95]=> - string(4) "some" - ["som3"]=> - string(4) "some" -} -array_intersect_assoc($a,$b); -array(5) { - ["f"]=> - int(5) - ["gate"]=> - string(3) "web" - [7]=> - int(18) - [11]=> - int(42) - ["som3"]=> - string(4) "some" -} ---UEXPECT-- --=-=-=-=-=-=-=-=-=-= TEST 1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -$a=array ( - 0 => 1, - 'big' => 2, - 1 => 2, - 2 => 6, - 3 => 3, - 4 => 5, - 5 => 3, - 6 => 3, - 7 => 454, - 8 => 'some_string', - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, - 15 => 3, - 16 => 3, - 17 => 17, -); -$b=array ( - 0 => 2, - 1 => 2, - 2 => 3, - 3 => 3, - 4 => 3, - 5 => 3, - 6 => 3, - 7 => 3, - 8 => 3, - 9 => 3, - 10 => 3, - 11 => 3, - 12 => 3, - 13 => 3, - 14 => 3, - 15 => 17, - 16 => 25, - 17 => 'some_string', - 18 => 7, - 19 => 8, - 20 => 9, - 21 => 109, - 22 => 78, - 23 => 17, -); -$c=array ( - 0 => -1, - 1 => 2, - 2 => 1, - 3 => 15, - 4 => 25, - 5 => 17, -); -array_intersect($a,$b,$c); -array(3) { - [u"big"]=> - int(2) - [1]=> - int(2) - [17]=> - int(17) -} -array_intersect_assoc($a,$b,$c); -array(1) { - [1]=> - int(2) -} -array_intersect($a,$b); -array(15) { - [u"big"]=> - int(2) - [1]=> - int(2) - [3]=> - int(3) - [5]=> - int(3) - [6]=> - int(3) - [8]=> - unicode(11) "some_string" - [9]=> - int(3) - [10]=> - int(3) - [11]=> - int(3) - [12]=> - int(3) - [13]=> - int(3) - [14]=> - int(3) - [15]=> - int(3) - [16]=> - int(3) - [17]=> - int(17) -} -array_intersect_assoc($a,$b); -array(10) { - [1]=> - int(2) - [3]=> - int(3) - [5]=> - int(3) - [6]=> - int(3) - [9]=> - int(3) - [10]=> - int(3) - [11]=> - int(3) - [12]=> - int(3) - [13]=> - int(3) - [14]=> - int(3) -} --=-=-=-=-=-=-=-=-=-= TEST 2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -$a=array ( - 'a' => 2, - 'b' => 'some', - 'c' => 'done', - 'z' => 'foo', - 'f' => 5, - 'fan' => 'fen', - 'bad' => 'bed', - 'gate' => 'web', - 7 => 18, - 9 => 25, - 11 => 42, - 12 => 42, - 45 => 42, - 73 => 'foo', - 95 => 'some', - 'som3' => 'some', - 'want' => 'wanna', -); -$b=array ( - 'a' => 7, - 7 => 18, - 9 => 13, - 11 => 42, - 45 => 46, - 'som3' => 'some', - 'foo' => 'some', - 'goo' => 'foo', - 'f' => 5, - 'z' => 'equal', - 'gate' => 'web', -); -$c=array ( - 'gate' => 'web', - 73 => 'foo', - 95 => 'some', -); - - -Results: - -array_intersect($a,$b,$c); -array(6) { - [u"b"]=> - unicode(4) "some" - [u"z"]=> - unicode(3) "foo" - [u"gate"]=> - unicode(3) "web" - [73]=> - unicode(3) "foo" - [95]=> - unicode(4) "some" - [u"som3"]=> - unicode(4) "some" -} -array_intersect_assoc($a,$b,$c); -array(1) { - [u"gate"]=> - unicode(3) "web" -} -array_intersect($a,$b); -array(11) { - [u"b"]=> - unicode(4) "some" - [u"z"]=> - unicode(3) "foo" - [u"f"]=> - int(5) - [u"gate"]=> - unicode(3) "web" - [7]=> - int(18) - [11]=> - int(42) - [12]=> - int(42) - [45]=> - int(42) - [73]=> - unicode(3) "foo" - [95]=> - unicode(4) "some" - [u"som3"]=> - unicode(4) "some" -} -array_intersect_assoc($a,$b); -array(5) { - [u"f"]=> - int(5) - [u"gate"]=> - unicode(3) "web" - [7]=> - int(18) - [11]=> - int(42) - [u"som3"]=> - unicode(4) "some" -} diff --git a/ext/standard/tests/array/array_change_key_case.phpt b/ext/standard/tests/array/array_change_key_case.phpt deleted file mode 100644 index 11adce868fe87..0000000000000 --- a/ext/standard/tests/array/array_change_key_case.phpt +++ /dev/null @@ -1,1486 +0,0 @@ ---TEST-- -array_change_key_case() ---FILE-- - 1), - array ("a" => 1), - array ("Z" => 1), - array ("one" => 1), - array ("ONE" => 1), - array ("OnE" => 1), - array ("oNe" => 1), - array ("one" => 1, "two" => 2), - array ("ONE" => 1, "two" => 2), - array ("OnE" => 1, "two" => 2), - array ("oNe" => 1, "two" => 2), - array ("one" => 1, "TWO" => 2), - array ("ONE" => 1, "TWO" => 2), - array ("OnE" => 1, "TWO" => 2), - array ("oNe" => 1, "TWO" => 2), - array ("one" => 1, "TwO" => 2), - array ("ONE" => 1, "TwO" => 2), - array ("OnE" => 1, "TwO" => 2), - array ("oNe" => 1, "TwO" => 2), - array ("one" => 1, "tWo" => 2), - array ("ONE" => 1, "tWo" => 2), - array ("OnE" => 1, "tWo" => 2), - array ("oNe" => 1, "tWo" => 2), - array ("one" => 1, 2), - array ("ONE" => 1, 2), - array ("OnE" => 1, 2), - array ("oNe" => 1, 2), - array ("ONE" => 1, "TWO" => 2, "THREE" => 3, "FOUR" => "four"), - array ("one" => 1, "two" => 2, "three" => 3, "four" => "FOUR"), - array ("ONE" => 1, "TWO" => 2, "three" => 3, "four" => "FOUR"), - array ("one" => 1, "two" => 2, "THREE" => 3, "FOUR" => "four") -); - -foreach ($arrays as $item) { - var_dump(array_change_key_case($item)); - var_dump(array_change_key_case($item, CASE_UPPER)); - var_dump(array_change_key_case($item, CASE_LOWER)); - echo "\n"; -} -echo "end\n"; -?> ---EXPECT-- -array(0) { -} -array(0) { -} -array(0) { -} - -array(1) { - [0]=> - int(0) -} -array(1) { - [0]=> - int(0) -} -array(1) { - [0]=> - int(0) -} - -array(1) { - [0]=> - int(1) -} -array(1) { - [0]=> - int(1) -} -array(1) { - [0]=> - int(1) -} - -array(1) { - [0]=> - int(-1) -} -array(1) { - [0]=> - int(-1) -} -array(1) { - [0]=> - int(-1) -} - -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -array(1) { - [""]=> - int(1) -} -array(1) { - [""]=> - int(1) -} -array(1) { - [""]=> - int(1) -} - -array(1) { - ["a"]=> - int(1) -} -array(1) { - ["A"]=> - int(1) -} -array(1) { - ["a"]=> - int(1) -} - -array(1) { - ["z"]=> - int(1) -} -array(1) { - ["Z"]=> - int(1) -} -array(1) { - ["z"]=> - int(1) -} - -array(1) { - ["one"]=> - int(1) -} -array(1) { - ["ONE"]=> - int(1) -} -array(1) { - ["one"]=> - int(1) -} - -array(1) { - ["one"]=> - int(1) -} -array(1) { - ["ONE"]=> - int(1) -} -array(1) { - ["one"]=> - int(1) -} - -array(1) { - ["one"]=> - int(1) -} -array(1) { - ["ONE"]=> - int(1) -} -array(1) { - ["one"]=> - int(1) -} - -array(1) { - ["one"]=> - int(1) -} -array(1) { - ["ONE"]=> - int(1) -} -array(1) { - ["one"]=> - int(1) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - ["two"]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - ["one"]=> - int(1) - [0]=> - int(2) -} - -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "four" -} -array(4) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) - ["THREE"]=> - int(3) - ["FOUR"]=> - string(4) "four" -} -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "four" -} - -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "FOUR" -} -array(4) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) - ["THREE"]=> - int(3) - ["FOUR"]=> - string(4) "FOUR" -} -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "FOUR" -} - -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "FOUR" -} -array(4) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) - ["THREE"]=> - int(3) - ["FOUR"]=> - string(4) "FOUR" -} -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "FOUR" -} - -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "four" -} -array(4) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) - ["THREE"]=> - int(3) - ["FOUR"]=> - string(4) "four" -} -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - ["four"]=> - string(4) "four" -} - -end ---UEXPECT-- -array(0) { -} -array(0) { -} -array(0) { -} - -array(1) { - [0]=> - int(0) -} -array(1) { - [0]=> - int(0) -} -array(1) { - [0]=> - int(0) -} - -array(1) { - [0]=> - int(1) -} -array(1) { - [0]=> - int(1) -} -array(1) { - [0]=> - int(1) -} - -array(1) { - [0]=> - int(-1) -} -array(1) { - [0]=> - int(-1) -} -array(1) { - [0]=> - int(-1) -} - -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(0) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -array(1) { - [u""]=> - int(1) -} -array(1) { - [u""]=> - int(1) -} -array(1) { - [u""]=> - int(1) -} - -array(1) { - [u"a"]=> - int(1) -} -array(1) { - [u"A"]=> - int(1) -} -array(1) { - [u"a"]=> - int(1) -} - -array(1) { - [u"z"]=> - int(1) -} -array(1) { - [u"Z"]=> - int(1) -} -array(1) { - [u"z"]=> - int(1) -} - -array(1) { - [u"one"]=> - int(1) -} -array(1) { - [u"ONE"]=> - int(1) -} -array(1) { - [u"one"]=> - int(1) -} - -array(1) { - [u"one"]=> - int(1) -} -array(1) { - [u"ONE"]=> - int(1) -} -array(1) { - [u"one"]=> - int(1) -} - -array(1) { - [u"one"]=> - int(1) -} -array(1) { - [u"ONE"]=> - int(1) -} -array(1) { - [u"one"]=> - int(1) -} - -array(1) { - [u"one"]=> - int(1) -} -array(1) { - [u"ONE"]=> - int(1) -} -array(1) { - [u"one"]=> - int(1) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} - -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"ONE"]=> - int(1) - [0]=> - int(2) -} -array(2) { - [u"one"]=> - int(1) - [0]=> - int(2) -} - -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "four" -} -array(4) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) - [u"THREE"]=> - int(3) - [u"FOUR"]=> - unicode(4) "four" -} -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "four" -} - -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "FOUR" -} -array(4) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) - [u"THREE"]=> - int(3) - [u"FOUR"]=> - unicode(4) "FOUR" -} -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "FOUR" -} - -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "FOUR" -} -array(4) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) - [u"THREE"]=> - int(3) - [u"FOUR"]=> - unicode(4) "FOUR" -} -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "FOUR" -} - -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "four" -} -array(4) { - [u"ONE"]=> - int(1) - [u"TWO"]=> - int(2) - [u"THREE"]=> - int(3) - [u"FOUR"]=> - unicode(4) "four" -} -array(4) { - [u"one"]=> - int(1) - [u"two"]=> - int(2) - [u"three"]=> - int(3) - [u"four"]=> - unicode(4) "four" -} - -end diff --git a/ext/standard/tests/array/array_chunk.phpt b/ext/standard/tests/array/array_chunk.phpt deleted file mode 100644 index 8782dcfa58651..0000000000000 --- a/ext/standard/tests/array/array_chunk.phpt +++ /dev/null @@ -1,10599 +0,0 @@ ---TEST-- -array_chunk() ---FILE-- - 0), - array (2 => 1), - array (3 => -1), - - array (1 => 0, 2 => 2), - array (1 => 1, 2 => 2, 3 => 3), - array (0 => 0, 3 => 2), - array (1 => 1, 5 => 2, 8 => 3), - - array (1, 2), - array (0, 1, 2), - array (1, 2, 3), - array (0, 1, 2, 3), - array (1, 2, 3, 4), - array (0, 1, 2, 3, 4), - array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10), - array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), - - array ("a" => 1), - array ("b" => 1, "c" => 2), - array ("p" => 1, "q" => 2, "r" => 3, "s" => 4, "u" => 5, "v" => 6), - - array ("a" => "A"), - array ("p" => "A", "q" => "B", "r" => "C", "s" => "D", "u" => "E", "v" => "F"), -); - -foreach ($arrays as $item) { - echo "===========================================\n"; - var_dump ($item); - echo "-------------------------------------------\n"; - for ($i = 0; $i < (sizeof($item) + 1); $i++) { - echo "[$i]\n"; - var_dump (@array_chunk ($item, $i)); - var_dump (@array_chunk ($item, $i, TRUE)); - var_dump (@array_chunk ($item, $i, FALSE)); - echo "\n"; - } - echo "\n"; -} -echo "end\n"; -?> ---EXPECT-- -=========================================== -array(0) { -} -------------------------------------------- -[0] -NULL -NULL -NULL - - -=========================================== -array(1) { - [0]=> - int(0) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} - - -=========================================== -array(1) { - [0]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(1) { - [0]=> - int(-1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} - - -=========================================== -array(2) { - [0]=> - int(0) - [1]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [2]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(1) { - [1]=> - int(0) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [1]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} - - -=========================================== -array(1) { - [2]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [2]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(1) { - [3]=> - int(-1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [3]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} - - -=========================================== -array(2) { - [1]=> - int(0) - [2]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [1]=> - int(0) - } - [1]=> - array(1) { - [2]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [1]=> - int(0) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [1]=> - int(1) - } - [1]=> - array(1) { - [2]=> - int(2) - } - [2]=> - array(1) { - [3]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(2) { - [0]=> - int(0) - [3]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [3]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [3]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [1]=> - int(1) - [5]=> - int(2) - [8]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [1]=> - int(1) - } - [1]=> - array(1) { - [5]=> - int(2) - } - [2]=> - array(1) { - [8]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [1]=> - int(1) - [5]=> - int(2) - } - [1]=> - array(1) { - [8]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [1]=> - int(1) - [5]=> - int(2) - [8]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [2]=> - int(2) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [2]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[4] -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} - - -=========================================== -array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } - [3]=> - array(1) { - [3]=> - int(4) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [2]=> - int(3) - [3]=> - int(4) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [3]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} - -[4] -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} - - -=========================================== -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } -} -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } - [4]=> - array(1) { - [4]=> - int(4) - } -} -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(1) { - [0]=> - int(4) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } - [2]=> - array(1) { - [4]=> - int(4) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(1) { - [0]=> - int(4) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [3]=> - int(3) - [4]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [4]=> - int(4) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} - -[5] -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} - - -=========================================== -array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } - [6]=> - array(1) { - [0]=> - int(7) - } - [7]=> - array(1) { - [0]=> - int(8) - } - [8]=> - array(1) { - [0]=> - int(9) - } - [9]=> - array(1) { - [0]=> - int(10) - } -} -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } - [3]=> - array(1) { - [3]=> - int(4) - } - [4]=> - array(1) { - [4]=> - int(5) - } - [5]=> - array(1) { - [5]=> - int(6) - } - [6]=> - array(1) { - [6]=> - int(7) - } - [7]=> - array(1) { - [7]=> - int(8) - } - [8]=> - array(1) { - [8]=> - int(9) - } - [9]=> - array(1) { - [9]=> - int(10) - } -} -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } - [6]=> - array(1) { - [0]=> - int(7) - } - [7]=> - array(1) { - [0]=> - int(8) - } - [8]=> - array(1) { - [0]=> - int(9) - } - [9]=> - array(1) { - [0]=> - int(10) - } -} - -[2] -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } - [3]=> - array(2) { - [0]=> - int(7) - [1]=> - int(8) - } - [4]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [2]=> - int(3) - [3]=> - int(4) - } - [2]=> - array(2) { - [4]=> - int(5) - [5]=> - int(6) - } - [3]=> - array(2) { - [6]=> - int(7) - [7]=> - int(8) - } - [4]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } - [3]=> - array(2) { - [0]=> - int(7) - [1]=> - int(8) - } - [4]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[3] -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } - [2]=> - array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - } - [3]=> - array(1) { - [0]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [2]=> - array(3) { - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [3]=> - array(1) { - [9]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } - [2]=> - array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - } - [3]=> - array(1) { - [0]=> - int(10) - } -} - -[4] -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - } - [2]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [2]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - } - [2]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} - -[6] -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} - -[7] -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[8] -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[9] -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} - -[10] -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} - - -=========================================== -array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } - [5]=> - array(1) { - [0]=> - int(5) - } - [6]=> - array(1) { - [0]=> - int(6) - } - [7]=> - array(1) { - [0]=> - int(7) - } - [8]=> - array(1) { - [0]=> - int(8) - } - [9]=> - array(1) { - [0]=> - int(9) - } - [10]=> - array(1) { - [0]=> - int(10) - } -} -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } - [4]=> - array(1) { - [4]=> - int(4) - } - [5]=> - array(1) { - [5]=> - int(5) - } - [6]=> - array(1) { - [6]=> - int(6) - } - [7]=> - array(1) { - [7]=> - int(7) - } - [8]=> - array(1) { - [8]=> - int(8) - } - [9]=> - array(1) { - [9]=> - int(9) - } - [10]=> - array(1) { - [10]=> - int(10) - } -} -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } - [5]=> - array(1) { - [0]=> - int(5) - } - [6]=> - array(1) { - [0]=> - int(6) - } - [7]=> - array(1) { - [0]=> - int(7) - } - [8]=> - array(1) { - [0]=> - int(8) - } - [9]=> - array(1) { - [0]=> - int(9) - } - [10]=> - array(1) { - [0]=> - int(10) - } -} - -[2] -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(2) { - [0]=> - int(4) - [1]=> - int(5) - } - [3]=> - array(2) { - [0]=> - int(6) - [1]=> - int(7) - } - [4]=> - array(2) { - [0]=> - int(8) - [1]=> - int(9) - } - [5]=> - array(1) { - [0]=> - int(10) - } -} -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } - [2]=> - array(2) { - [4]=> - int(4) - [5]=> - int(5) - } - [3]=> - array(2) { - [6]=> - int(6) - [7]=> - int(7) - } - [4]=> - array(2) { - [8]=> - int(8) - [9]=> - int(9) - } - [5]=> - array(1) { - [10]=> - int(10) - } -} -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(2) { - [0]=> - int(4) - [1]=> - int(5) - } - [3]=> - array(2) { - [0]=> - int(6) - [1]=> - int(7) - } - [4]=> - array(2) { - [0]=> - int(8) - [1]=> - int(9) - } - [5]=> - array(1) { - [0]=> - int(10) - } -} - -[3] -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [0]=> - int(3) - [1]=> - int(4) - [2]=> - int(5) - } - [2]=> - array(3) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - } - [3]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [2]=> - array(3) { - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [3]=> - array(2) { - [9]=> - int(9) - [10]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [0]=> - int(3) - [1]=> - int(4) - [2]=> - int(5) - } - [2]=> - array(3) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - } - [3]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[4] -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - [3]=> - int(7) - } - [2]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [2]=> - array(3) { - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - [3]=> - int(7) - } - [2]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[5] -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - [4]=> - int(9) - } - [2]=> - array(1) { - [0]=> - int(10) - } -} -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [2]=> - array(1) { - [10]=> - int(10) - } -} -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - [4]=> - int(9) - } - [2]=> - array(1) { - [0]=> - int(10) - } -} - -[6] -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} - -[7] -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} - -[8] -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[9] -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[10] -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} - -[11] -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} - - -=========================================== -array(1) { - ["a"]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - ["a"]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(2) { - ["b"]=> - int(1) - ["c"]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - ["b"]=> - int(1) - } - [1]=> - array(1) { - ["c"]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - ["b"]=> - int(1) - ["c"]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} - - -=========================================== -array(6) { - ["p"]=> - int(1) - ["q"]=> - int(2) - ["r"]=> - int(3) - ["s"]=> - int(4) - ["u"]=> - int(5) - ["v"]=> - int(6) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(6) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } -} -array(6) { - [0]=> - array(1) { - ["p"]=> - int(1) - } - [1]=> - array(1) { - ["q"]=> - int(2) - } - [2]=> - array(1) { - ["r"]=> - int(3) - } - [3]=> - array(1) { - ["s"]=> - int(4) - } - [4]=> - array(1) { - ["u"]=> - int(5) - } - [5]=> - array(1) { - ["v"]=> - int(6) - } -} -array(6) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} -array(3) { - [0]=> - array(2) { - ["p"]=> - int(1) - ["q"]=> - int(2) - } - [1]=> - array(2) { - ["r"]=> - int(3) - ["s"]=> - int(4) - } - [2]=> - array(2) { - ["u"]=> - int(5) - ["v"]=> - int(6) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } -} -array(2) { - [0]=> - array(3) { - ["p"]=> - int(1) - ["q"]=> - int(2) - ["r"]=> - int(3) - } - [1]=> - array(3) { - ["s"]=> - int(4) - ["u"]=> - int(5) - ["v"]=> - int(6) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} -array(2) { - [0]=> - array(4) { - ["p"]=> - int(1) - ["q"]=> - int(2) - ["r"]=> - int(3) - ["s"]=> - int(4) - } - [1]=> - array(2) { - ["u"]=> - int(5) - ["v"]=> - int(6) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(1) { - [0]=> - int(6) - } -} -array(2) { - [0]=> - array(5) { - ["p"]=> - int(1) - ["q"]=> - int(2) - ["r"]=> - int(3) - ["s"]=> - int(4) - ["u"]=> - int(5) - } - [1]=> - array(1) { - ["v"]=> - int(6) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(1) { - [0]=> - int(6) - } -} - -[6] -array(1) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } -} -array(1) { - [0]=> - array(6) { - ["p"]=> - int(1) - ["q"]=> - int(2) - ["r"]=> - int(3) - ["s"]=> - int(4) - ["u"]=> - int(5) - ["v"]=> - int(6) - } -} -array(1) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } -} - - -=========================================== -array(1) { - ["a"]=> - string(1) "A" -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - string(1) "A" - } -} -array(1) { - [0]=> - array(1) { - ["a"]=> - string(1) "A" - } -} -array(1) { - [0]=> - array(1) { - [0]=> - string(1) "A" - } -} - - -=========================================== -array(6) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - ["r"]=> - string(1) "C" - ["s"]=> - string(1) "D" - ["u"]=> - string(1) "E" - ["v"]=> - string(1) "F" -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(6) { - [0]=> - array(1) { - [0]=> - string(1) "A" - } - [1]=> - array(1) { - [0]=> - string(1) "B" - } - [2]=> - array(1) { - [0]=> - string(1) "C" - } - [3]=> - array(1) { - [0]=> - string(1) "D" - } - [4]=> - array(1) { - [0]=> - string(1) "E" - } - [5]=> - array(1) { - [0]=> - string(1) "F" - } -} -array(6) { - [0]=> - array(1) { - ["p"]=> - string(1) "A" - } - [1]=> - array(1) { - ["q"]=> - string(1) "B" - } - [2]=> - array(1) { - ["r"]=> - string(1) "C" - } - [3]=> - array(1) { - ["s"]=> - string(1) "D" - } - [4]=> - array(1) { - ["u"]=> - string(1) "E" - } - [5]=> - array(1) { - ["v"]=> - string(1) "F" - } -} -array(6) { - [0]=> - array(1) { - [0]=> - string(1) "A" - } - [1]=> - array(1) { - [0]=> - string(1) "B" - } - [2]=> - array(1) { - [0]=> - string(1) "C" - } - [3]=> - array(1) { - [0]=> - string(1) "D" - } - [4]=> - array(1) { - [0]=> - string(1) "E" - } - [5]=> - array(1) { - [0]=> - string(1) "F" - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - } - [1]=> - array(2) { - [0]=> - string(1) "C" - [1]=> - string(1) "D" - } - [2]=> - array(2) { - [0]=> - string(1) "E" - [1]=> - string(1) "F" - } -} -array(3) { - [0]=> - array(2) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - } - [1]=> - array(2) { - ["r"]=> - string(1) "C" - ["s"]=> - string(1) "D" - } - [2]=> - array(2) { - ["u"]=> - string(1) "E" - ["v"]=> - string(1) "F" - } -} -array(3) { - [0]=> - array(2) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - } - [1]=> - array(2) { - [0]=> - string(1) "C" - [1]=> - string(1) "D" - } - [2]=> - array(2) { - [0]=> - string(1) "E" - [1]=> - string(1) "F" - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - } - [1]=> - array(3) { - [0]=> - string(1) "D" - [1]=> - string(1) "E" - [2]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(3) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - ["r"]=> - string(1) "C" - } - [1]=> - array(3) { - ["s"]=> - string(1) "D" - ["u"]=> - string(1) "E" - ["v"]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(3) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - } - [1]=> - array(3) { - [0]=> - string(1) "D" - [1]=> - string(1) "E" - [2]=> - string(1) "F" - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - } - [1]=> - array(2) { - [0]=> - string(1) "E" - [1]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(4) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - ["r"]=> - string(1) "C" - ["s"]=> - string(1) "D" - } - [1]=> - array(2) { - ["u"]=> - string(1) "E" - ["v"]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - } - [1]=> - array(2) { - [0]=> - string(1) "E" - [1]=> - string(1) "F" - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" - } - [1]=> - array(1) { - [0]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(5) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - ["r"]=> - string(1) "C" - ["s"]=> - string(1) "D" - ["u"]=> - string(1) "E" - } - [1]=> - array(1) { - ["v"]=> - string(1) "F" - } -} -array(2) { - [0]=> - array(5) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" - } - [1]=> - array(1) { - [0]=> - string(1) "F" - } -} - -[6] -array(1) { - [0]=> - array(6) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" - [5]=> - string(1) "F" - } -} -array(1) { - [0]=> - array(6) { - ["p"]=> - string(1) "A" - ["q"]=> - string(1) "B" - ["r"]=> - string(1) "C" - ["s"]=> - string(1) "D" - ["u"]=> - string(1) "E" - ["v"]=> - string(1) "F" - } -} -array(1) { - [0]=> - array(6) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" - [5]=> - string(1) "F" - } -} - - -end ---UEXPECT-- -=========================================== -array(0) { -} -------------------------------------------- -[0] -NULL -NULL -NULL - - -=========================================== -array(1) { - [0]=> - int(0) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} - - -=========================================== -array(1) { - [0]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(1) { - [0]=> - int(-1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} - - -=========================================== -array(2) { - [0]=> - int(0) - [1]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [2]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(1) { - [1]=> - int(0) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [1]=> - int(0) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} - - -=========================================== -array(1) { - [2]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [2]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(1) { - [3]=> - int(-1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [3]=> - int(-1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(-1) - } -} - - -=========================================== -array(2) { - [1]=> - int(0) - [2]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [1]=> - int(0) - } - [1]=> - array(1) { - [2]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [1]=> - int(0) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [1]=> - int(1) - } - [1]=> - array(1) { - [2]=> - int(2) - } - [2]=> - array(1) { - [3]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(2) { - [0]=> - int(0) - [3]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [3]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [3]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [1]=> - int(1) - [5]=> - int(2) - [8]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [1]=> - int(1) - } - [1]=> - array(1) { - [5]=> - int(2) - } - [2]=> - array(1) { - [8]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [1]=> - int(1) - [5]=> - int(2) - } - [1]=> - array(1) { - [8]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [1]=> - int(1) - [5]=> - int(2) - [8]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [2]=> - int(2) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } -} - - -=========================================== -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } -} -array(3) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [2]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[3] -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } -} - - -=========================================== -array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [3]=> - int(3) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(1) { - [0]=> - int(3) - } -} - -[4] -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } -} - - -=========================================== -array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } - [3]=> - array(1) { - [3]=> - int(4) - } -} -array(4) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } -} - -[2] -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [2]=> - int(3) - [3]=> - int(4) - } -} -array(2) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [3]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} - -[4] -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} -array(1) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } -} - - -=========================================== -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } -} -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } - [4]=> - array(1) { - [4]=> - int(4) - } -} -array(5) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(1) { - [0]=> - int(4) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } - [2]=> - array(1) { - [4]=> - int(4) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(1) { - [0]=> - int(4) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [3]=> - int(3) - [4]=> - int(4) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [4]=> - int(4) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(1) { - [0]=> - int(4) - } -} - -[5] -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} -array(1) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } -} - - -=========================================== -array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } - [6]=> - array(1) { - [0]=> - int(7) - } - [7]=> - array(1) { - [0]=> - int(8) - } - [8]=> - array(1) { - [0]=> - int(9) - } - [9]=> - array(1) { - [0]=> - int(10) - } -} -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [1]=> - int(2) - } - [2]=> - array(1) { - [2]=> - int(3) - } - [3]=> - array(1) { - [3]=> - int(4) - } - [4]=> - array(1) { - [4]=> - int(5) - } - [5]=> - array(1) { - [5]=> - int(6) - } - [6]=> - array(1) { - [6]=> - int(7) - } - [7]=> - array(1) { - [7]=> - int(8) - } - [8]=> - array(1) { - [8]=> - int(9) - } - [9]=> - array(1) { - [9]=> - int(10) - } -} -array(10) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } - [6]=> - array(1) { - [0]=> - int(7) - } - [7]=> - array(1) { - [0]=> - int(8) - } - [8]=> - array(1) { - [0]=> - int(9) - } - [9]=> - array(1) { - [0]=> - int(10) - } -} - -[2] -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } - [3]=> - array(2) { - [0]=> - int(7) - [1]=> - int(8) - } - [4]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [2]=> - int(3) - [3]=> - int(4) - } - [2]=> - array(2) { - [4]=> - int(5) - [5]=> - int(6) - } - [3]=> - array(2) { - [6]=> - int(7) - [7]=> - int(8) - } - [4]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(5) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } - [3]=> - array(2) { - [0]=> - int(7) - [1]=> - int(8) - } - [4]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[3] -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } - [2]=> - array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - } - [3]=> - array(1) { - [0]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [2]=> - array(3) { - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [3]=> - array(1) { - [9]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } - [2]=> - array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - } - [3]=> - array(1) { - [0]=> - int(10) - } -} - -[4] -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - } - [2]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [2]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(4) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - } - [2]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} - -[6] -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} - -[7] -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[8] -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [8]=> - int(9) - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[9] -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [9]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} - -[10] -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} -array(1) { - [0]=> - array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - } -} - - -=========================================== -array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } - [5]=> - array(1) { - [0]=> - int(5) - } - [6]=> - array(1) { - [0]=> - int(6) - } - [7]=> - array(1) { - [0]=> - int(7) - } - [8]=> - array(1) { - [0]=> - int(8) - } - [9]=> - array(1) { - [0]=> - int(9) - } - [10]=> - array(1) { - [0]=> - int(10) - } -} -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [1]=> - int(1) - } - [2]=> - array(1) { - [2]=> - int(2) - } - [3]=> - array(1) { - [3]=> - int(3) - } - [4]=> - array(1) { - [4]=> - int(4) - } - [5]=> - array(1) { - [5]=> - int(5) - } - [6]=> - array(1) { - [6]=> - int(6) - } - [7]=> - array(1) { - [7]=> - int(7) - } - [8]=> - array(1) { - [8]=> - int(8) - } - [9]=> - array(1) { - [9]=> - int(9) - } - [10]=> - array(1) { - [10]=> - int(10) - } -} -array(11) { - [0]=> - array(1) { - [0]=> - int(0) - } - [1]=> - array(1) { - [0]=> - int(1) - } - [2]=> - array(1) { - [0]=> - int(2) - } - [3]=> - array(1) { - [0]=> - int(3) - } - [4]=> - array(1) { - [0]=> - int(4) - } - [5]=> - array(1) { - [0]=> - int(5) - } - [6]=> - array(1) { - [0]=> - int(6) - } - [7]=> - array(1) { - [0]=> - int(7) - } - [8]=> - array(1) { - [0]=> - int(8) - } - [9]=> - array(1) { - [0]=> - int(9) - } - [10]=> - array(1) { - [0]=> - int(10) - } -} - -[2] -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(2) { - [0]=> - int(4) - [1]=> - int(5) - } - [3]=> - array(2) { - [0]=> - int(6) - [1]=> - int(7) - } - [4]=> - array(2) { - [0]=> - int(8) - [1]=> - int(9) - } - [5]=> - array(1) { - [0]=> - int(10) - } -} -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [2]=> - int(2) - [3]=> - int(3) - } - [2]=> - array(2) { - [4]=> - int(4) - [5]=> - int(5) - } - [3]=> - array(2) { - [6]=> - int(6) - [7]=> - int(7) - } - [4]=> - array(2) { - [8]=> - int(8) - [9]=> - int(9) - } - [5]=> - array(1) { - [10]=> - int(10) - } -} -array(6) { - [0]=> - array(2) { - [0]=> - int(0) - [1]=> - int(1) - } - [1]=> - array(2) { - [0]=> - int(2) - [1]=> - int(3) - } - [2]=> - array(2) { - [0]=> - int(4) - [1]=> - int(5) - } - [3]=> - array(2) { - [0]=> - int(6) - [1]=> - int(7) - } - [4]=> - array(2) { - [0]=> - int(8) - [1]=> - int(9) - } - [5]=> - array(1) { - [0]=> - int(10) - } -} - -[3] -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [0]=> - int(3) - [1]=> - int(4) - [2]=> - int(5) - } - [2]=> - array(3) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - } - [3]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [2]=> - array(3) { - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [3]=> - array(2) { - [9]=> - int(9) - [10]=> - int(10) - } -} -array(4) { - [0]=> - array(3) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - } - [1]=> - array(3) { - [0]=> - int(3) - [1]=> - int(4) - [2]=> - int(5) - } - [2]=> - array(3) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - } - [3]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[4] -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - [3]=> - int(7) - } - [2]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [2]=> - array(3) { - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(3) { - [0]=> - array(4) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - } - [1]=> - array(4) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - [3]=> - int(7) - } - [2]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[5] -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - [4]=> - int(9) - } - [2]=> - array(1) { - [0]=> - int(10) - } -} -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [2]=> - array(1) { - [10]=> - int(10) - } -} -array(3) { - [0]=> - array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - } - [1]=> - array(5) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) - [4]=> - int(9) - } - [2]=> - array(1) { - [0]=> - int(10) - } -} - -[6] -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - } - [1]=> - array(5) { - [0]=> - int(6) - [1]=> - int(7) - [2]=> - int(8) - [3]=> - int(9) - [4]=> - int(10) - } -} - -[7] -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(7) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - } - [1]=> - array(4) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) - [3]=> - int(10) - } -} - -[8] -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(8) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(8) - [1]=> - int(9) - [2]=> - int(10) - } -} - -[9] -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [9]=> - int(9) - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(9) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - } - [1]=> - array(2) { - [0]=> - int(9) - [1]=> - int(10) - } -} - -[10] -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [10]=> - int(10) - } -} -array(2) { - [0]=> - array(10) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - } - [1]=> - array(1) { - [0]=> - int(10) - } -} - -[11] -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} -array(1) { - [0]=> - array(11) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) - [6]=> - int(6) - [7]=> - int(7) - [8]=> - int(8) - [9]=> - int(9) - [10]=> - int(10) - } -} - - -=========================================== -array(1) { - [u"a"]=> - int(1) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [u"a"]=> - int(1) - } -} -array(1) { - [0]=> - array(1) { - [0]=> - int(1) - } -} - - -=========================================== -array(2) { - [u"b"]=> - int(1) - [u"c"]=> - int(2) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [u"b"]=> - int(1) - } - [1]=> - array(1) { - [u"c"]=> - int(2) - } -} -array(2) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } -} - -[2] -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [u"b"]=> - int(1) - [u"c"]=> - int(2) - } -} -array(1) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} - - -=========================================== -array(6) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - [u"r"]=> - int(3) - [u"s"]=> - int(4) - [u"u"]=> - int(5) - [u"v"]=> - int(6) -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(6) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } -} -array(6) { - [0]=> - array(1) { - [u"p"]=> - int(1) - } - [1]=> - array(1) { - [u"q"]=> - int(2) - } - [2]=> - array(1) { - [u"r"]=> - int(3) - } - [3]=> - array(1) { - [u"s"]=> - int(4) - } - [4]=> - array(1) { - [u"u"]=> - int(5) - } - [5]=> - array(1) { - [u"v"]=> - int(6) - } -} -array(6) { - [0]=> - array(1) { - [0]=> - int(1) - } - [1]=> - array(1) { - [0]=> - int(2) - } - [2]=> - array(1) { - [0]=> - int(3) - } - [3]=> - array(1) { - [0]=> - int(4) - } - [4]=> - array(1) { - [0]=> - int(5) - } - [5]=> - array(1) { - [0]=> - int(6) - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} -array(3) { - [0]=> - array(2) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - } - [1]=> - array(2) { - [u"r"]=> - int(3) - [u"s"]=> - int(4) - } - [2]=> - array(2) { - [u"u"]=> - int(5) - [u"v"]=> - int(6) - } -} -array(3) { - [0]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [2]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } -} -array(2) { - [0]=> - array(3) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - [u"r"]=> - int(3) - } - [1]=> - array(3) { - [u"s"]=> - int(4) - [u"u"]=> - int(5) - [u"v"]=> - int(6) - } -} -array(2) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [1]=> - array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} -array(2) { - [0]=> - array(4) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - [u"r"]=> - int(3) - [u"s"]=> - int(4) - } - [1]=> - array(2) { - [u"u"]=> - int(5) - [u"v"]=> - int(6) - } -} -array(2) { - [0]=> - array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - } - [1]=> - array(2) { - [0]=> - int(5) - [1]=> - int(6) - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(1) { - [0]=> - int(6) - } -} -array(2) { - [0]=> - array(5) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - [u"r"]=> - int(3) - [u"s"]=> - int(4) - [u"u"]=> - int(5) - } - [1]=> - array(1) { - [u"v"]=> - int(6) - } -} -array(2) { - [0]=> - array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - } - [1]=> - array(1) { - [0]=> - int(6) - } -} - -[6] -array(1) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } -} -array(1) { - [0]=> - array(6) { - [u"p"]=> - int(1) - [u"q"]=> - int(2) - [u"r"]=> - int(3) - [u"s"]=> - int(4) - [u"u"]=> - int(5) - [u"v"]=> - int(6) - } -} -array(1) { - [0]=> - array(6) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - } -} - - -=========================================== -array(1) { - [u"a"]=> - unicode(1) "A" -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(1) { - [0]=> - array(1) { - [0]=> - unicode(1) "A" - } -} -array(1) { - [0]=> - array(1) { - [u"a"]=> - unicode(1) "A" - } -} -array(1) { - [0]=> - array(1) { - [0]=> - unicode(1) "A" - } -} - - -=========================================== -array(6) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - [u"r"]=> - unicode(1) "C" - [u"s"]=> - unicode(1) "D" - [u"u"]=> - unicode(1) "E" - [u"v"]=> - unicode(1) "F" -} -------------------------------------------- -[0] -NULL -NULL -NULL - -[1] -array(6) { - [0]=> - array(1) { - [0]=> - unicode(1) "A" - } - [1]=> - array(1) { - [0]=> - unicode(1) "B" - } - [2]=> - array(1) { - [0]=> - unicode(1) "C" - } - [3]=> - array(1) { - [0]=> - unicode(1) "D" - } - [4]=> - array(1) { - [0]=> - unicode(1) "E" - } - [5]=> - array(1) { - [0]=> - unicode(1) "F" - } -} -array(6) { - [0]=> - array(1) { - [u"p"]=> - unicode(1) "A" - } - [1]=> - array(1) { - [u"q"]=> - unicode(1) "B" - } - [2]=> - array(1) { - [u"r"]=> - unicode(1) "C" - } - [3]=> - array(1) { - [u"s"]=> - unicode(1) "D" - } - [4]=> - array(1) { - [u"u"]=> - unicode(1) "E" - } - [5]=> - array(1) { - [u"v"]=> - unicode(1) "F" - } -} -array(6) { - [0]=> - array(1) { - [0]=> - unicode(1) "A" - } - [1]=> - array(1) { - [0]=> - unicode(1) "B" - } - [2]=> - array(1) { - [0]=> - unicode(1) "C" - } - [3]=> - array(1) { - [0]=> - unicode(1) "D" - } - [4]=> - array(1) { - [0]=> - unicode(1) "E" - } - [5]=> - array(1) { - [0]=> - unicode(1) "F" - } -} - -[2] -array(3) { - [0]=> - array(2) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - } - [1]=> - array(2) { - [0]=> - unicode(1) "C" - [1]=> - unicode(1) "D" - } - [2]=> - array(2) { - [0]=> - unicode(1) "E" - [1]=> - unicode(1) "F" - } -} -array(3) { - [0]=> - array(2) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - } - [1]=> - array(2) { - [u"r"]=> - unicode(1) "C" - [u"s"]=> - unicode(1) "D" - } - [2]=> - array(2) { - [u"u"]=> - unicode(1) "E" - [u"v"]=> - unicode(1) "F" - } -} -array(3) { - [0]=> - array(2) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - } - [1]=> - array(2) { - [0]=> - unicode(1) "C" - [1]=> - unicode(1) "D" - } - [2]=> - array(2) { - [0]=> - unicode(1) "E" - [1]=> - unicode(1) "F" - } -} - -[3] -array(2) { - [0]=> - array(3) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - } - [1]=> - array(3) { - [0]=> - unicode(1) "D" - [1]=> - unicode(1) "E" - [2]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(3) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - [u"r"]=> - unicode(1) "C" - } - [1]=> - array(3) { - [u"s"]=> - unicode(1) "D" - [u"u"]=> - unicode(1) "E" - [u"v"]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(3) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - } - [1]=> - array(3) { - [0]=> - unicode(1) "D" - [1]=> - unicode(1) "E" - [2]=> - unicode(1) "F" - } -} - -[4] -array(2) { - [0]=> - array(4) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - } - [1]=> - array(2) { - [0]=> - unicode(1) "E" - [1]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(4) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - [u"r"]=> - unicode(1) "C" - [u"s"]=> - unicode(1) "D" - } - [1]=> - array(2) { - [u"u"]=> - unicode(1) "E" - [u"v"]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(4) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - } - [1]=> - array(2) { - [0]=> - unicode(1) "E" - [1]=> - unicode(1) "F" - } -} - -[5] -array(2) { - [0]=> - array(5) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - [4]=> - unicode(1) "E" - } - [1]=> - array(1) { - [0]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(5) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - [u"r"]=> - unicode(1) "C" - [u"s"]=> - unicode(1) "D" - [u"u"]=> - unicode(1) "E" - } - [1]=> - array(1) { - [u"v"]=> - unicode(1) "F" - } -} -array(2) { - [0]=> - array(5) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - [4]=> - unicode(1) "E" - } - [1]=> - array(1) { - [0]=> - unicode(1) "F" - } -} - -[6] -array(1) { - [0]=> - array(6) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - [4]=> - unicode(1) "E" - [5]=> - unicode(1) "F" - } -} -array(1) { - [0]=> - array(6) { - [u"p"]=> - unicode(1) "A" - [u"q"]=> - unicode(1) "B" - [u"r"]=> - unicode(1) "C" - [u"s"]=> - unicode(1) "D" - [u"u"]=> - unicode(1) "E" - [u"v"]=> - unicode(1) "F" - } -} -array(1) { - [0]=> - array(6) { - [0]=> - unicode(1) "A" - [1]=> - unicode(1) "B" - [2]=> - unicode(1) "C" - [3]=> - unicode(1) "D" - [4]=> - unicode(1) "E" - [5]=> - unicode(1) "F" - } -} - - -end diff --git a/ext/standard/tests/array/array_count_values.phpt b/ext/standard/tests/array/array_count_values.phpt deleted file mode 100644 index 7212db28a45ed..0000000000000 --- a/ext/standard/tests/array/array_count_values.phpt +++ /dev/null @@ -1,164 +0,0 @@ ---TEST-- -array_count_values() ---FILE-- - ---EXPECT-- -array(0) { -} - -array(1) { - [0]=> - int(1) -} - -array(1) { - [1]=> - int(1) -} - -array(1) { - [-1]=> - int(1) -} - -array(1) { - [0]=> - int(2) -} - -array(2) { - [0]=> - int(1) - [1]=> - int(1) -} - -array(1) { - [1]=> - int(2) -} - -array(3) { - [1]=> - int(2) - ["hello"]=> - int(2) - ["world"]=> - int(1) -} - -array(2) { - ["hello"]=> - int(2) - ["world"]=> - int(1) -} - -array(3) { - [""]=> - int(2) - ["world"]=> - int(3) - ["hello"]=> - int(4) -} - -array(1) { - [0]=> - int(1) -} - -array(1) { - [1]=> - int(1) -} ---UEXPECT-- -array(0) { -} - -array(1) { - [0]=> - int(1) -} - -array(1) { - [1]=> - int(1) -} - -array(1) { - [-1]=> - int(1) -} - -array(1) { - [0]=> - int(2) -} - -array(2) { - [0]=> - int(1) - [1]=> - int(1) -} - -array(1) { - [1]=> - int(2) -} - -array(3) { - [1]=> - int(2) - [u"hello"]=> - int(2) - [u"world"]=> - int(1) -} - -array(2) { - [u"hello"]=> - int(2) - [u"world"]=> - int(1) -} - -array(3) { - [u""]=> - int(2) - [u"world"]=> - int(3) - [u"hello"]=> - int(4) -} - -array(1) { - [0]=> - int(1) -} - -array(1) { - [1]=> - int(1) -} diff --git a/ext/standard/tests/array/array_diff_1.phpt b/ext/standard/tests/array/array_diff_1.phpt deleted file mode 100644 index a25d19d5cab79..0000000000000 --- a/ext/standard/tests/array/array_diff_1.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Test array_diff when non-array is passed ---FILE-- - ---EXPECTF-- -Warning: array_diff(): Argument #2 is not an array in %s -OK! diff --git a/ext/standard/tests/array/array_diff_key.phpt b/ext/standard/tests/array/array_diff_key.phpt deleted file mode 100644 index 91664a8711a4c..0000000000000 --- a/ext/standard/tests/array/array_diff_key.phpt +++ /dev/null @@ -1,250 +0,0 @@ ---TEST-- -Test of the array_diff_key() and array_diff_ukey() ---FILE-- - &$a_f_el) { $a_f_el =$k*2;} -foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;} -foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;} -foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;} - -echo "------ Test $i --------\n";$i++;// 1 -var_dump(array_diff_key($a_f, $b_f));// keys -> 1, 6, 15, 1200 -var_dump(array_diff_ukey($a_f, $b_f, "comp_func"));// 1, 6, 15, 1200 - -echo "------ Test $i --------\n";$i++;// 2 -var_dump(array_diff_key($a_f, $c_f));// keys -> 1, 15, 1200 -var_dump(array_diff_ukey($a_f, $c_f, "comp_func"));// 1, 15, 1200 - -echo "------ Test $i --------\n";$i++;// 3 -var_dump(array_diff_key($a_f, $d_f));// 1, 6, 2, 15, 1200, -2500 -var_dump(array_diff_ukey($a_f, $d_f, "comp_func"));// 1, 6, 2, 15, 1200, -2500 - -echo "------ Test $i --------\n";$i++;// 4 -var_dump(array_diff_key($a_f, $b_f, $c_f));// 1, 15, 1200 -var_dump(array_diff_ukey($a_f, $b_f, $c_f, "comp_func"));// 1, 15, 1200 - -echo "------ Test $i --------\n";$i++;// 5 -var_dump(array_diff_key($a_f, $b_f, $d_f));// 1, 6, 15, 1200 -var_dump(array_diff_ukey($a_f, $b_f, $d_f, "comp_func"));// 1, 6, 15, 1200 - - -echo "------ Test $i --------\n";$i++;// 6 -var_dump(array_diff_key($a_f, $b_f, $c_f, $d_f));// 1, 15, 1200 -var_dump(array_diff_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//1, 15, 1200 - - -echo "------ Test $i --------\n";$i++;// 7 -var_dump(array_diff_key($b_f, $c_f));// 7, 11, 1100 -var_dump(array_diff_ukey($b_f, $c_f, "comp_func"));//7, 11, 1100 - -echo "------ Test $i --------\n";$i++;// 8 -var_dump(array_diff_key($b_f, $d_f));//0, 7, 2, 11, 1100, -2500 -var_dump(array_diff_ukey($b_f, $d_f, "comp_func"));//0, 7, 2, 11, 1100, -2500 - - -echo "------ Test $i --------\n";$i++;// 9 -var_dump(array_diff_key($b_f, $c_f, $d_f));// 7, 11, 1100 -var_dump(array_diff_ukey($b_f, $c_f, $d_f, "comp_func"));// 7, 11, 1000 - -function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; - -} -?> ---EXPECTF-- ------- Test 1 -------- -array(4) { - [1]=> - &int(2) - [6]=> - &int(12) - [15]=> - &int(30) - [1200]=> - &int(2400) -} -array(4) { - [1]=> - int(2) - [6]=> - int(12) - [15]=> - int(30) - [1200]=> - int(2400) -} ------- Test 2 -------- -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} ------- Test 3 -------- -array(6) { - [1]=> - int(2) - [6]=> - int(12) - [2]=> - int(4) - [15]=> - int(30) - [1200]=> - int(2400) - [-2500]=> - &int(-5000) -} -array(6) { - [1]=> - int(2) - [6]=> - int(12) - [2]=> - int(4) - [15]=> - int(30) - [1200]=> - int(2400) - [-2500]=> - &int(-5000) -} ------- Test 4 -------- -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} ------- Test 5 -------- -array(4) { - [1]=> - int(2) - [6]=> - int(12) - [15]=> - int(30) - [1200]=> - int(2400) -} -array(4) { - [1]=> - int(2) - [6]=> - int(12) - [15]=> - int(30) - [1200]=> - int(2400) -} ------- Test 6 -------- -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} -array(3) { - [1]=> - int(2) - [15]=> - int(30) - [1200]=> - int(2400) -} ------- Test 7 -------- -array(3) { - [7]=> - &int(14) - [11]=> - &int(22) - [1100]=> - &int(2200) -} -array(3) { - [7]=> - int(14) - [11]=> - int(22) - [1100]=> - int(2200) -} ------- Test 8 -------- -array(6) { - [0]=> - int(0) - [7]=> - int(14) - [2]=> - int(4) - [11]=> - int(22) - [1100]=> - int(2200) - [-2500]=> - &int(-5000) -} -array(6) { - [0]=> - int(0) - [7]=> - int(14) - [2]=> - int(4) - [11]=> - int(22) - [1100]=> - int(2200) - [-2500]=> - &int(-5000) -} ------- Test 9 -------- -array(3) { - [7]=> - int(14) - [11]=> - int(22) - [1100]=> - int(2200) -} -array(3) { - [7]=> - int(14) - [11]=> - int(22) - [1100]=> - int(2200) -} diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt deleted file mode 100644 index 5aa23349e716a..0000000000000 --- a/ext/standard/tests/array/array_intersect_1.phpt +++ /dev/null @@ -1,1042 +0,0 @@ ---TEST-- -Test of the *intersect* bunch of functions (both assoc and non-assoc) ---FILE-- -priv_member = $val; - $this->public_member = $val; - } - static function comp_func_cr($a, $b) { - if ($a->priv_member === $b->priv_member) return 0; - return ($a->priv_member > $b->priv_member)? 1:-1; - } -} - -function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; - -} - -function comp_func_cr($a, $b) { - if ($a->public_member === $b->public_member) return 0; - return ($a->public_member > $b->public_member)? 1:-1; -} - -$a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),); -$b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr( 3), 1=> new cr(4), 2 => new cr(-15),); - -/* array_intersect() */ -echo "begin ------------ array_intersect() ----------------------------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_intersect($a, $b);'."\n"; -var_dump(array_intersect($a, $b)); -echo "end ------------ array_intersect() ----------------------------\n"; - -/* array_uintersect() */ -echo "begin ------------ array_uintersect() ---------------------------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_uintersect($a, $b, "comp_func_cr"));'."\n"; -var_dump(array_uintersect($a, $b, "comp_func_cr")); -echo "end ------------ array_uintersect() ---------------------------\n"; - -/* array_intersect_assoc() */ -echo "begin ------------ array_intersect_assoc() ----------------------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_intersect_assoc($a, $b));'."\n"; -var_dump(array_intersect_assoc($a, $b)); -echo "end ------------ array_intersect_assoc() ----------------------\n"; - -/* array_uintersect_assoc() */ -echo "begin ------------ array_uintersect_assoc() ---------------------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));'."\n"; -var_dump(array_uintersect_assoc($a, $b, "comp_func_cr")); -echo "end ------------ array_uintersect_assoc() ---------------------\n"; - -/* array_intersect_uassoc() */ -echo "begin ------------ array_intersect_uassoc() ---------------------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_intersect_uassoc($a, $b, "comp_func"));'."\n"; -var_dump(array_intersect_uassoc($a, $b, "comp_func")); -echo "end ------------ array_intersect_uassoc() ---------------------\n"; - -/* array_uintersect_uassoc() - with ordinary function */ -echo "begin ------------ array_uintersect_uassoc() with ordinary func -\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func"));'."\n"; -var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func")); -echo "end ------------ array_uintersect_uassoc() with ordinary func -\n"; - -/* array_uintersect_uassoc() - by method call */ -echo "begin ------------ array_uintersect_uassoc() with method --------\n"; -echo '$a='.var_export($a,TRUE).";\n"; -echo '$b='.var_export($b,TRUE).";\n"; -echo 'var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));'."\n"; -var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); -echo "end ------------ array_uintersect_uassoc() with method --------\n"; -?> ---EXPECTF-- -begin ------------ array_intersect() ---------------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect($a, $b); -array(0) { -} -end ------------ array_intersect() ---------------------------- -begin ------------ array_uintersect() --------------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect($a, $b, "comp_func_cr")); -array(3) { - ["0.1"]=> - object(cr)#1 (2) { - ["priv_member":"cr":private]=> - int(9) - ["public_member"]=> - int(9) - } - [1]=> - object(cr)#4 (2) { - ["priv_member":"cr":private]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member":"cr":private]=> - int(-15) - ["public_member"]=> - int(-15) - } -} -end ------------ array_uintersect() --------------------------- -begin ------------ array_intersect_assoc() ---------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect_assoc($a, $b)); -array(0) { -} -end ------------ array_intersect_assoc() ---------------------- -begin ------------ array_uintersect_assoc() --------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_assoc($a, $b, "comp_func_cr")); -array(2) { - [1]=> - object(cr)#4 (2) { - ["priv_member":"cr":private]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member":"cr":private]=> - int(-15) - ["public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_assoc() --------------------- -begin ------------ array_intersect_uassoc() --------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect_uassoc($a, $b, "comp_func")); -array(0) { -} -end ------------ array_intersect_uassoc() --------------------- -begin ------------ array_uintersect_uassoc() with ordinary func - -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func")); -array(2) { - [1]=> - object(cr)#4 (2) { - ["priv_member":"cr":private]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member":"cr":private]=> - int(-15) - ["public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_uassoc() with ordinary func - -begin ------------ array_uintersect_uassoc() with method -------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); -array(2) { - [1]=> - object(cr)#4 (2) { - ["priv_member":"cr":private]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member":"cr":private]=> - int(-15) - ["public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_uassoc() with method -------- ---UEXPECTF-- -begin ------------ array_intersect() ---------------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect($a, $b); -array(0) { -} -end ------------ array_intersect() ---------------------------- -begin ------------ array_uintersect() --------------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect($a, $b, "comp_func_cr")); -array(3) { - [u"0.1"]=> - object(cr)#1 (2) { - [u"priv_member":u"cr":private]=> - int(9) - [u"public_member"]=> - int(9) - } - [1]=> - object(cr)#4 (2) { - [u"priv_member":u"cr":private]=> - int(4) - [u"public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - [u"priv_member":u"cr":private]=> - int(-15) - [u"public_member"]=> - int(-15) - } -} -end ------------ array_uintersect() --------------------------- -begin ------------ array_intersect_assoc() ---------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect_assoc($a, $b)); -array(0) { -} -end ------------ array_intersect_assoc() ---------------------- -begin ------------ array_uintersect_assoc() --------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_assoc($a, $b, "comp_func_cr")); -array(2) { - [1]=> - object(cr)#4 (2) { - [u"priv_member":u"cr":private]=> - int(4) - [u"public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - [u"priv_member":u"cr":private]=> - int(-15) - [u"public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_assoc() --------------------- -begin ------------ array_intersect_uassoc() --------------------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_intersect_uassoc($a, $b, "comp_func")); -array(0) { -} -end ------------ array_intersect_uassoc() --------------------- -begin ------------ array_uintersect_uassoc() with ordinary func - -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func")); -array(2) { - [1]=> - object(cr)#4 (2) { - [u"priv_member":u"cr":private]=> - int(4) - [u"public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - [u"priv_member":u"cr":private]=> - int(-15) - [u"public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_uassoc() with ordinary func - -begin ------------ array_uintersect_uassoc() with method -------- -$a=array ( - '0.1' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 12, - 'public_member' => 12, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 23, - 'public_member' => 23, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -$b=array ( - '0.2' => - cr::__set_state(array( - 'priv_member' => 9, - 'public_member' => 9, - )), - '0.5' => - cr::__set_state(array( - 'priv_member' => 22, - 'public_member' => 22, - )), - 0 => - cr::__set_state(array( - 'priv_member' => 3, - 'public_member' => 3, - )), - 1 => - cr::__set_state(array( - 'priv_member' => 4, - 'public_member' => 4, - )), - 2 => - cr::__set_state(array( - 'priv_member' => -15, - 'public_member' => -15, - )), -); -var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); -array(2) { - [1]=> - object(cr)#4 (2) { - [u"priv_member":u"cr":private]=> - int(4) - [u"public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - [u"priv_member":u"cr":private]=> - int(-15) - [u"public_member"]=> - int(-15) - } -} -end ------------ array_uintersect_uassoc() with method -------- diff --git a/ext/standard/tests/array/array_intersect_key.phpt b/ext/standard/tests/array/array_intersect_key.phpt deleted file mode 100644 index 6a5965ba73cbd..0000000000000 --- a/ext/standard/tests/array/array_intersect_key.phpt +++ /dev/null @@ -1,209 +0,0 @@ ---TEST-- -Test of the array_intersect_key() and array_intersect_ukey() ---FILE-- - &$a_f_el) { $a_f_el =$k*2;} -foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;} -foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;} -foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;} - -var_dump(array_intersect_key($a_f, $b_f));// keys -> 2, -20, -2500 -var_dump(array_intersect_ukey($a_f, $b_f, "comp_func"));// 2, 20, -2500 -var_dump(array_intersect_key($a_f, $c_f));// keys -> 6, 2, -20, -2500 -var_dump(array_intersect_ukey($a_f, $c_f, "comp_func"));// 6, 2, -20, -2500 -var_dump(array_intersect_key($a_f, $d_f));// -20 -var_dump(array_intersect_ukey($a_f, $d_f, "comp_func"));// -20 - -var_dump(array_intersect_key($a_f, $b_f, $c_f));// 2, -20, -2500 -var_dump(array_intersect_ukey($a_f, $b_f, $c_f, "comp_func"));// 2, -20, -2500 -var_dump(array_intersect_key($a_f, $b_f, $d_f));// -20 -var_dump(array_intersect_ukey($a_f, $b_f, $d_f, "comp_func"));// -20 - -var_dump(array_intersect_key($a_f, $b_f, $c_f, $d_f));// -20 -var_dump(array_intersect_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//-20 - - -var_dump(array_intersect_key($b_f, $c_f));// 0, 2, -20, -2500 -var_dump(array_intersect_ukey($b_f, $c_f, "comp_func"));//0, 2, -20, 2500 - -var_dump(array_intersect_key($b_f, $d_f));// -20 -var_dump(array_intersect_ukey($b_f, $d_f, "comp_func"));// -20 - -var_dump(array_intersect_key($b_f, $c_f, $d_f));// -20 -var_dump(array_intersect_ukey($b_f, $c_f, $d_f, "comp_func"));// -20 - - -echo "----- Now testing array_intersect() ------- \n"; -var_dump(array_intersect($a, $b_f)); -var_dump(array_uintersect($a, $b, "comp_func")); -var_dump(array_intersect($a, $b, $c)); -var_dump(array_uintersect($a, $b, $c, "comp_func")); -var_dump(array_intersect($a, $b, $c, $d)); -var_dump(array_uintersect($a, $b, $c, $d, "comp_func")); - -/////////////////////////////////////////////////////////////////////// -function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; - -} -?> ---EXPECTF-- -array(3) { - [2]=> - &int(4) - [-20]=> - &int(-40) - [-2500]=> - &int(-5000) -} -array(3) { - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(4) { - [6]=> - int(12) - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(4) { - [6]=> - int(12) - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(3) { - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(3) { - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(4) { - [0]=> - &int(0) - [2]=> - &int(4) - [-20]=> - &int(-40) - [-2500]=> - &int(-5000) -} -array(4) { - [0]=> - int(0) - [2]=> - int(4) - [-20]=> - int(-40) - [-2500]=> - &int(-5000) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} -array(1) { - [-20]=> - int(-40) -} ------ Now testing array_intersect() ------- -array(0) { -} -array(3) { - [2]=> - int(2) - [3]=> - int(-20) - [6]=> - int(-2500) -} -array(3) { - [2]=> - int(2) - [3]=> - int(-20) - [6]=> - int(-2500) -} -array(3) { - [2]=> - int(2) - [3]=> - int(-20) - [6]=> - int(-2500) -} -array(1) { - [3]=> - int(-20) -} -array(1) { - [3]=> - int(-20) -} diff --git a/ext/standard/tests/array/array_search.phpt b/ext/standard/tests/array/array_search.phpt deleted file mode 100644 index e95fda1286ba1..0000000000000 --- a/ext/standard/tests/array/array_search.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -search_array and in_array (including bug 13567) ---FILE-- -'d'); -$arr4 = array("a\0b"=>'e','key'=>'d', 'f'); - -$tests = << ---EXPECTF-- -int(500500) -int(500500) -%st(5000050000) -%st(5000050000) diff --git a/ext/standard/tests/array/array_walk_recursive.phpt b/ext/standard/tests/array/array_walk_recursive.phpt deleted file mode 100644 index c3b37c321c213..0000000000000 --- a/ext/standard/tests/array/array_walk_recursive.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Test array_walk_recursive() ---FILE-- - ---EXPECTF-- -1 foo -2 foo -3 foo -bool(true) -1 bar -2 bar -3 bar -bool(true) diff --git a/ext/standard/tests/array/bug12776.phpt b/ext/standard/tests/array/bug12776.phpt deleted file mode 100644 index 54c6f6fceb466..0000000000000 --- a/ext/standard/tests/array/bug12776.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #12776 (array_walk crash) ---FILE-- -'v'); -array_walk($arr,'test'); - -print "First value: ".$globalArray[0]; - -print "\nDone\n"; - -?> ---EXPECT-- -val: v; key: k -First value: k -Done diff --git a/ext/standard/tests/array/bug14580.phpt b/ext/standard/tests/array/bug14580.phpt deleted file mode 100644 index 8a80bddcb40ce..0000000000000 --- a/ext/standard/tests/array/bug14580.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST--n -Bug #14580 (key() not binary safe) ---FILE-- - "foo\0bar"); - $key = key($arr); - echo strlen($key), ': '; - echo urlencode($key), "\n"; -?> ---EXPECT-- -7: foo%00bar diff --git a/ext/standard/tests/array/bug20381.phpt b/ext/standard/tests/array/bug20381.phpt deleted file mode 100644 index da06da0e383d6..0000000000000 --- a/ext/standard/tests/array/bug20381.phpt +++ /dev/null @@ -1,134 +0,0 @@ ---TEST-- -Bug #20381 (array_merge_recursive mangles input arrays) ---FILE-- - 1, - 'a2' => array( 1, 2, 3 ), - 'a3' => array( - 'a' => array( 10, 20, 30 ), - 'b' => 'b' - ) - ); -$b = array( 'a1' => 2, - 'a2' => array( 3, 4, 5 ), - 'a3' => array( - 'c' => 'cc', - 'a' => array( 10, 40 ) - ) - ); - -var_dump($a); -array_merge_recursive( $a, $b ); -var_dump($a); -?> ---EXPECT-- -array(3) { - ["a1"]=> - int(1) - ["a2"]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - ["a3"]=> - array(2) { - ["a"]=> - array(3) { - [0]=> - int(10) - [1]=> - int(20) - [2]=> - int(30) - } - ["b"]=> - string(1) "b" - } -} -array(3) { - ["a1"]=> - int(1) - ["a2"]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - ["a3"]=> - array(2) { - ["a"]=> - array(3) { - [0]=> - int(10) - [1]=> - int(20) - [2]=> - int(30) - } - ["b"]=> - string(1) "b" - } -} ---UEXPECT-- -array(3) { - [u"a1"]=> - int(1) - [u"a2"]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [u"a3"]=> - array(2) { - [u"a"]=> - array(3) { - [0]=> - int(10) - [1]=> - int(20) - [2]=> - int(30) - } - [u"b"]=> - unicode(1) "b" - } -} -array(3) { - [u"a1"]=> - int(1) - [u"a2"]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [u"a3"]=> - array(2) { - [u"a"]=> - array(3) { - [0]=> - int(10) - [1]=> - int(20) - [2]=> - int(30) - } - [u"b"]=> - unicode(1) "b" - } -} diff --git a/ext/standard/tests/array/bug20865.phpt b/ext/standard/tests/array/bug20865.phpt deleted file mode 100644 index f1edbabab5ab6..0000000000000 --- a/ext/standard/tests/array/bug20865.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #20865 (array_key_exists and NULL key) ---FILE-- - ---EXPECT-- -bool(true) diff --git a/ext/standard/tests/array/bug21182.phpt b/ext/standard/tests/array/bug21182.phpt deleted file mode 100644 index 11ff76a5ce116..0000000000000 --- a/ext/standard/tests/array/bug21182.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #21182 (range modifies arguments) ---FILE-- - ---EXPECT-- -a1: 20 -a2: 20 : type : string ---UEXPECT-- -a1: 20 -a2: 20 : type : unicode diff --git a/ext/standard/tests/array/bug21918.phpt b/ext/standard/tests/array/bug21918.phpt deleted file mode 100755 index 9288dd1520bf5..0000000000000 --- a/ext/standard/tests/array/bug21918.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Bug #21918 (different handling of positive vs. negative array indexes) ---FILE-- -'a', '-2'=>'b', 3=>'c', '4'=>'d', 5=>'e', '6001'=>'f', '07'=>'g'); - -foreach($a as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Normal==\n"; -$b = array(); -$b[] = 'a'; - -foreach($b as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Negative==\n"; -$c = array('-2' => 'a'); - -foreach($c as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Done==\n"; -?> ---EXPECT-- -==Mixed== -int(-1) -string(1) "a" -int(-2) -string(1) "b" -int(3) -string(1) "c" -int(4) -string(1) "d" -int(5) -string(1) "e" -int(6001) -string(1) "f" -string(2) "07" -string(1) "g" -==Normal== -int(0) -string(1) "a" -==Negative== -int(-2) -string(1) "a" -==Done== ---UEXPECT-- -==Mixed== -int(-1) -unicode(1) "a" -int(-2) -unicode(1) "b" -int(3) -unicode(1) "c" -int(4) -unicode(1) "d" -int(5) -unicode(1) "e" -int(6001) -unicode(1) "f" -unicode(2) "07" -unicode(1) "g" -==Normal== -int(0) -unicode(1) "a" -==Negative== -int(-2) -unicode(1) "a" -==Done== diff --git a/ext/standard/tests/array/bug21998.phpt b/ext/standard/tests/array/bug21998.phpt deleted file mode 100644 index b5fe8675c998f..0000000000000 --- a/ext/standard/tests/array/bug21998.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #21998 (array_pop() does not reset the current array position) ---FILE-- - ---EXPECT-- -int(0) -string(1) "c" -int(0) -string(1) "b" -int(0) -string(1) "a" -NULL ---UEXPECT-- -int(0) -unicode(1) "c" -int(0) -unicode(1) "b" -int(0) -unicode(1) "a" -NULL diff --git a/ext/standard/tests/array/bug22088.phpt b/ext/standard/tests/array/bug22088.phpt deleted file mode 100644 index 24f815ce90028..0000000000000 --- a/ext/standard/tests/array/bug22088.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug #22088 (array_shift() leaves next index to be +1 too much) ---FILE-- - 1, 'b' => 2, 'c' => 3); -$last = array_shift ($a); -$a[] = 'a'; -var_dump($a); - -?> ---EXPECT-- -array(3) { - [0]=> - string(1) "b" - [1]=> - string(1) "c" - [2]=> - string(1) "a" -} -array(3) { - ["b"]=> - int(2) - ["c"]=> - int(3) - [0]=> - string(1) "a" -} ---UEXPECT-- -array(3) { - [0]=> - unicode(1) "b" - [1]=> - unicode(1) "c" - [2]=> - unicode(1) "a" -} -array(3) { - [u"b"]=> - int(2) - [u"c"]=> - int(3) - [0]=> - unicode(1) "a" -} diff --git a/ext/standard/tests/array/bug22463.phpt b/ext/standard/tests/array/bug22463.phpt deleted file mode 100644 index dcede511bb4b9..0000000000000 --- a/ext/standard/tests/array/bug22463.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #22463 (array_reduce() segfaults) ---FILE-- - ---EXPECT-- -int(5) diff --git a/ext/standard/tests/array/bug23581.phpt b/ext/standard/tests/array/bug23581.phpt deleted file mode 100644 index 06e1e388efc3e..0000000000000 --- a/ext/standard/tests/array/bug23581.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #23581 (array_map(NULL, array, array, ...) yields an undefined result) ---FILE-- - ---EXPECT-- -array(3) { - [0]=> - array(3) { - [0]=> - int(1) - [1]=> - int(4) - [2]=> - int(7) - } - [1]=> - array(3) { - [0]=> - int(2) - [1]=> - int(5) - [2]=> - int(8) - } - [2]=> - array(3) { - [0]=> - int(3) - [1]=> - int(6) - [2]=> - int(9) - } -} - diff --git a/ext/standard/tests/array/bug23788.phpt b/ext/standard/tests/array/bug23788.phpt deleted file mode 100644 index 022b3cecd47ce..0000000000000 --- a/ext/standard/tests/array/bug23788.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #23788 (*_replace() clobbers referenced array elements) ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - &int(123) - [1]=> - &bool(true) -} -array(2) { - [0]=> - &int(123) - [1]=> - &bool(true) -} diff --git a/ext/standard/tests/array/bug24198.phpt b/ext/standard/tests/array/bug24198.phpt deleted file mode 100644 index abfde36e759a9..0000000000000 --- a/ext/standard/tests/array/bug24198.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST--n -Bug #24198 (array_merge_recursive() invalid recursion detection) ---FILE-- - 'aa','b' => 'bb'); - -var_dump(array_merge_recursive($c, $c)); -?> ---EXPECT-- -array(2) { - ["a"]=> - array(2) { - [0]=> - string(2) "aa" - [1]=> - string(2) "aa" - } - ["b"]=> - array(2) { - [0]=> - string(2) "bb" - [1]=> - string(2) "bb" - } -} ---UEXPECT-- -array(2) { - [u"a"]=> - array(2) { - [0]=> - unicode(2) "aa" - [1]=> - unicode(2) "aa" - } - [u"b"]=> - array(2) { - [0]=> - unicode(2) "bb" - [1]=> - unicode(2) "bb" - } -} diff --git a/ext/standard/tests/array/bug24220.phpt b/ext/standard/tests/array/bug24220.phpt deleted file mode 100644 index 4a280d68d20d9..0000000000000 --- a/ext/standard/tests/array/bug24220.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST--n -Bug #24220 (range() numeric string handling) ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - int(2003) - [1]=> - int(2004) -} -array(26) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" - [3]=> - string(1) "d" - [4]=> - string(1) "e" - [5]=> - string(1) "f" - [6]=> - string(1) "g" - [7]=> - string(1) "h" - [8]=> - string(1) "i" - [9]=> - string(1) "j" - [10]=> - string(1) "k" - [11]=> - string(1) "l" - [12]=> - string(1) "m" - [13]=> - string(1) "n" - [14]=> - string(1) "o" - [15]=> - string(1) "p" - [16]=> - string(1) "q" - [17]=> - string(1) "r" - [18]=> - string(1) "s" - [19]=> - string(1) "t" - [20]=> - string(1) "u" - [21]=> - string(1) "v" - [22]=> - string(1) "w" - [23]=> - string(1) "x" - [24]=> - string(1) "y" - [25]=> - string(1) "z" -} -array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) -} ---UEXPECT-- -array(2) { - [0]=> - int(2003) - [1]=> - int(2004) -} -array(26) { - [0]=> - unicode(1) "a" - [1]=> - unicode(1) "b" - [2]=> - unicode(1) "c" - [3]=> - unicode(1) "d" - [4]=> - unicode(1) "e" - [5]=> - unicode(1) "f" - [6]=> - unicode(1) "g" - [7]=> - unicode(1) "h" - [8]=> - unicode(1) "i" - [9]=> - unicode(1) "j" - [10]=> - unicode(1) "k" - [11]=> - unicode(1) "l" - [12]=> - unicode(1) "m" - [13]=> - unicode(1) "n" - [14]=> - unicode(1) "o" - [15]=> - unicode(1) "p" - [16]=> - unicode(1) "q" - [17]=> - unicode(1) "r" - [18]=> - unicode(1) "s" - [19]=> - unicode(1) "t" - [20]=> - unicode(1) "u" - [21]=> - unicode(1) "v" - [22]=> - unicode(1) "w" - [23]=> - unicode(1) "x" - [24]=> - unicode(1) "y" - [25]=> - unicode(1) "z" -} -array(10) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) -} diff --git a/ext/standard/tests/array/bug24766.phpt b/ext/standard/tests/array/bug24766.phpt deleted file mode 100644 index d6f82f3b16f86..0000000000000 --- a/ext/standard/tests/array/bug24766.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Bug #24766 (strange result array from unpack) ---FILE-- - 18, 2 => 52); -debug_zval_dump($a, $b); -$k = array_keys($a); -$l = array_keys($b); -debug_zval_dump($k, $l); -$i=$k[0]; -var_dump($a[$i]); -$i=$l[0]; -var_dump($b[$i]); -?> ---EXPECT-- -array(2) refcount(2){ - [1]=> - long(18) refcount(1) - [2]=> - long(52) refcount(1) -} -array(2) refcount(2){ - [1]=> - long(18) refcount(1) - [2]=> - long(52) refcount(1) -} -array(2) refcount(2){ - [0]=> - long(1) refcount(1) - [1]=> - long(2) refcount(1) -} -array(2) refcount(2){ - [0]=> - long(1) refcount(1) - [1]=> - long(2) refcount(1) -} -int(18) -int(18) diff --git a/ext/standard/tests/array/bug24897.phpt b/ext/standard/tests/array/bug24897.phpt deleted file mode 100644 index 45bcde340f2e7..0000000000000 --- a/ext/standard/tests/array/bug24897.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #24897 (inconsistent behaviour or shuffle() & array_multisort()) ---FILE-- - 2); -shuffle($a); -var_dump($a); - -$a = array(1 => 2); -array_multisort($a); -var_dump($a); -?> ---EXPECT-- -array(1) { - [0]=> - int(2) -} -array(1) { - [0]=> - int(2) -} diff --git a/ext/standard/tests/array/bug24980.phpt b/ext/standard/tests/array/bug24980.phpt deleted file mode 100644 index 0e481a7af7a78..0000000000000 --- a/ext/standard/tests/array/bug24980.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #24980 (array_reduce() uses first element as default running total) ---FILE-- - ---EXPECT-- -running_total is 0, current_value is 2 -running_total is 4, current_value is 3 -running_total is 13, current_value is 5 -running_total is 38, current_value is 7 -Total is 87 -string(3) "abc" -int(15) -int(1200) -int(1) ---UEXPECT-- -running_total is 0, current_value is 2 -running_total is 4, current_value is 3 -running_total is 13, current_value is 5 -running_total is 38, current_value is 7 -Total is 87 -unicode(3) "abc" -int(15) -int(1200) -int(1) diff --git a/ext/standard/tests/array/bug25359.phpt b/ext/standard/tests/array/bug25359.phpt deleted file mode 100644 index 8ad36c2cfede6..0000000000000 --- a/ext/standard/tests/array/bug25359.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Bug #25359 (array_multisort() does not work in a function if array is global or reference) ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(5) "first" - [1]=> - string(6) "second" - [2]=> - string(5) "third" - [3]=> - string(5) "forth" - [4]=> - string(5) "fifth" -} ---UEXPECT-- -array(5) { - [0]=> - unicode(5) "first" - [1]=> - unicode(6) "second" - [2]=> - unicode(5) "third" - [3]=> - unicode(5) "forth" - [4]=> - unicode(5) "fifth" -} diff --git a/ext/standard/tests/array/bug25708.phpt b/ext/standard/tests/array/bug25708.phpt deleted file mode 100644 index fdaed851f2640..0000000000000 --- a/ext/standard/tests/array/bug25708.phpt +++ /dev/null @@ -1,378 +0,0 @@ ---TEST-- -Bug #25708 (extract($GLOBALS, EXTR_REFS) mangles $GLOBALS) ---FILE-- - ---EXPECT-- -NULL refcount(2) -NULL refcount(2) -long(1) refcount(3) -long(2) refcount(3) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -string(1) "x" refcount(1) -long(4) refcount(1) -string(1) "x" refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----a -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -string(1) "x" refcount(1) -long(4) refcount(1) -string(1) "x" refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----ra -NULL refcount(2) -NULL refcount(2) -long(1) refcount(3) -long(2) refcount(3) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -string(1) "x" refcount(1) -long(4) refcount(1) -string(1) "x" refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) ----- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -string(1) "x" refcount(1) -long(4) refcount(1) -string(1) "x" refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----r -string(2) "ok" refcount(2) -string(2) "ok" refcount(2) ---UEXPECT-- -NULL refcount(2) -NULL refcount(2) -long(1) refcount(3) -long(2) refcount(3) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----a -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----ra -NULL refcount(2) -NULL refcount(2) -long(1) refcount(3) -long(2) refcount(3) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) ----- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(2) refcount(1) -long(1) refcount(1) -long(2) refcount(1) --- -long(1) refcount(1) -long(3) refcount(1) -long(1) refcount(1) -long(3) refcount(1) --- -long(4) refcount(1) -long(3) refcount(1) -long(4) refcount(1) -long(3) refcount(1) --- -long(3) refcount(1) -long(3) refcount(1) -long(3) refcount(2) --- -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(4) refcount(1) -unicode(1) "x" { 0078 } refcount(1) -long(3) refcount(2) --- -long(1) refcount(2) -long(2) refcount(2) -----r -unicode(2) "ok" { 006f 006b } refcount(2) -unicode(2) "ok" { 006f 006b } refcount(2) diff --git a/ext/standard/tests/array/bug25758.phpt b/ext/standard/tests/array/bug25758.phpt deleted file mode 100644 index ff97d2e3fb2b5..0000000000000 --- a/ext/standard/tests/array/bug25758.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #25758 (var_export does not escape ' & \ inside array keys) ---FILE-- - array("quote'")); - echo var_export($a, true); -?> ---EXPECT-- -array ( - 'quote\'' => - array ( - 0 => 'quote\'', - ), -) diff --git a/ext/standard/tests/array/bug26458.phpt b/ext/standard/tests/array/bug26458.phpt deleted file mode 100644 index 105caee0de7ee..0000000000000 Binary files a/ext/standard/tests/array/bug26458.phpt and /dev/null differ diff --git a/ext/standard/tests/array/bug28739.phpt b/ext/standard/tests/array/bug28739.phpt deleted file mode 100644 index 418ae9f77e38f..0000000000000 --- a/ext/standard/tests/array/bug28739.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Bug #28739 (*diff() and *intersect() not clearing the fci cache before work) ---FILE-- -x=$x;} -} -function a(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;} -function b(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;} - -$p1 = array(new p(2), new p(1), new p(0)); -$p2 = array(new p(0), new p(2), new p(3)); - -uasort($p1, 'a'); -print_r($p1); -echo "Now diffing:\n"; -print_r(array_udiff($p1,$p2, 'b')); -?> ---EXPECT-- -string(1) "a" -string(1) "a" -Array -( - [2] => p Object - ( - [x] => 0 - ) - - [1] => p Object - ( - [x] => 1 - ) - - [0] => p Object - ( - [x] => 2 - ) - -) -Now diffing: -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -string(1) "b" -Array -( - [1] => p Object - ( - [x] => 1 - ) - -) ---UEXPECT-- -unicode(1) "a" -unicode(1) "a" -Array -( - [2] => p Object - ( - [x] => 0 - ) - - [1] => p Object - ( - [x] => 1 - ) - - [0] => p Object - ( - [x] => 2 - ) - -) -Now diffing: -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -unicode(1) "b" -Array -( - [1] => p Object - ( - [x] => 1 - ) - -) \ No newline at end of file diff --git a/ext/standard/tests/array/bug28974.phpt b/ext/standard/tests/array/bug28974.phpt deleted file mode 100644 index fb272e1d744dc..0000000000000 --- a/ext/standard/tests/array/bug28974.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Bug #28974 array_(p)slice() treats large lengths incorrectly - overflow ---FILE-- - ---EXPECT-- -Array -( - [0] => 0 - [1] => 1 - [2] => 2 - [3] => 3 - [4] => 4 - [5] => 5 -) -Array -( - [0] => 2 - [1] => 3 - [2] => 4 - [3] => 5 -) -Array -( - [0] => 2 - [1] => 3 - [2] => 4 - [3] => 5 -) -print_r(array_splice($a,2,1)); -Array -( - [0] => 2 -) -$a is :Array -( - [0] => 0 - [1] => 1 - [2] => 3 - [3] => 4 - [4] => 5 -) -print_r(array_splice($b,2,2147483645)); -Array -( - [0] => 2 - [1] => 3 - [2] => 4 - [3] => 5 -) -$b is :Array -( - [0] => 0 - [1] => 1 -) -print_r(array_splice($c,2,2147483646)); -Array -( - [0] => 2 - [1] => 3 - [2] => 4 - [3] => 5 -) -$c is :Array -( - [0] => 0 - [1] => 1 -) diff --git a/ext/standard/tests/array/bug29253.phpt b/ext/standard/tests/array/bug29253.phpt deleted file mode 100755 index 4b7aa9f275977..0000000000000 --- a/ext/standard/tests/array/bug29253.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #29253 array_diff with $GLOBALS argument fails ---FILE-- - ---EXPECT-- -array(0) { -} -string(4) "afad" ---UEXPECT-- -array(0) { -} -unicode(4) "afad" diff --git a/ext/standard/tests/array/bug29493.phpt b/ext/standard/tests/array/bug29493.phpt deleted file mode 100644 index adcb7065cec53..0000000000000 --- a/ext/standard/tests/array/bug29493.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Bug #29493 (extract(EXTR_REFS) fails if array has multiple referrals) ---FILE-- - 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = $a; - // refcount($a) = 2 - // refcount($a['foo']) = 1 - $b['foo'] = 'bbb'; - // refcount($a) = 1 - // refcount($a['foo']) = 1 - - var_dump($a, $b); - - extract($a, EXTR_REFS); - - $foo = 'noo'; - - var_dump($a, $b); -} - -function t2() -{ - $a = array('foo' => 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = &$a; - // refcount($a) = 2 - // is_ref($a) = true - // refcount($a['foo']) = 1 - $b['foo'] = 'bbb'; - // refcount($a) = 2 - // refcount($a['foo']) = 1 - - var_dump($a, $b); - - extract($a, EXTR_REFS); - - $foo = 'noo'; - - var_dump($a, $b); -} - -function t3() -{ - $a = array('foo' => 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = &$a; - // refcount($a) = 2 - // is_ref($a) = true - // refcount($a['foo']) = 1 - unset($b); - // refcount($a) = 1 - // is_ref($a) = true - // refcount($a['foo']) = 1 - - var_dump($a); - - extract($a, EXTR_REFS); - - $foo = 'noo'; - - var_dump($a); -} - -t1(); -t2(); -t3(); -?> ---EXPECT-- -array(1) { - ["foo"]=> - string(3) "aaa" -} -array(1) { - ["foo"]=> - string(3) "bbb" -} -array(1) { - ["foo"]=> - &string(3) "noo" -} -array(1) { - ["foo"]=> - string(3) "bbb" -} -array(1) { - ["foo"]=> - string(3) "bbb" -} -array(1) { - ["foo"]=> - string(3) "bbb" -} -array(1) { - ["foo"]=> - &string(3) "noo" -} -array(1) { - ["foo"]=> - &string(3) "noo" -} -array(1) { - ["foo"]=> - string(3) "aaa" -} -array(1) { - ["foo"]=> - &string(3) "noo" -} ---UEXPECT-- -array(1) { - [u"foo"]=> - unicode(3) "aaa" -} -array(1) { - [u"foo"]=> - unicode(3) "bbb" -} -array(1) { - [u"foo"]=> - &unicode(3) "noo" -} -array(1) { - [u"foo"]=> - unicode(3) "bbb" -} -array(1) { - [u"foo"]=> - unicode(3) "bbb" -} -array(1) { - [u"foo"]=> - unicode(3) "bbb" -} -array(1) { - [u"foo"]=> - &unicode(3) "noo" -} -array(1) { - [u"foo"]=> - &unicode(3) "noo" -} -array(1) { - [u"foo"]=> - unicode(3) "aaa" -} -array(1) { - [u"foo"]=> - &unicode(3) "noo" -} diff --git a/ext/standard/tests/array/bug30266.phpt b/ext/standard/tests/array/bug30266.phpt deleted file mode 100755 index 8f7c3d21354cc..0000000000000 --- a/ext/standard/tests/array/bug30266.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #30266 (Invalid opcode 137/1/8) and array_walk ---FILE-- -b = $val; - throw new Exception("Error"); - } -} - -$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); - -$myobj = new testc(); - -function test($item2, $key, $userd) -{ - $userd->crash($item2); -} - -try -{ - array_walk($fruits, 'test', $myobj); -} -catch(Exception $e) -{ - echo "Caught: " . $e->getMessage() . "\n"; -} -?> -===DONE=== ---EXPECT-- -Caught: Error -===DONE=== diff --git a/ext/standard/tests/array/bug30833.phpt b/ext/standard/tests/array/bug30833.phpt deleted file mode 100644 index bd540917d343e..0000000000000 --- a/ext/standard/tests/array/bug30833.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -bug #30833 (array_count_values() modifying input array) ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(3) "abc" - [1]=> - string(4) "0000" -} -array(2) { - ["abc"]=> - int(1) - ["0000"]=> - int(1) -} -array(2) { - [0]=> - string(3) "abc" - [1]=> - string(4) "0000" -} -Done ---UEXPECT-- -array(2) { - [0]=> - unicode(3) "abc" - [1]=> - unicode(4) "0000" -} -array(2) { - [u"abc"]=> - int(1) - [u"0000"]=> - int(1) -} -array(2) { - [0]=> - unicode(3) "abc" - [1]=> - unicode(4) "0000" -} -Done diff --git a/ext/standard/tests/array/bug31158.phpt b/ext/standard/tests/array/bug31158.phpt deleted file mode 100755 index e672a10b28d62..0000000000000 --- a/ext/standard/tests/array/bug31158.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #31158 (array_splice on $GLOBALS crashes) ---FILE-- - ---EXPECTF-- -Notice: Undefined variable: GLOBALS in %sbug31158.php on line 6 -ok - diff --git a/ext/standard/tests/array/bug31213.phpt b/ext/standard/tests/array/bug31213.phpt deleted file mode 100644 index 02fafca52e577..0000000000000 --- a/ext/standard/tests/array/bug31213.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Bug #31213 (Sideeffects caused by bug #29493) ---FILE-- - $a, - '_b' => &$b - ); - - var_dump($a, $b); - - if ($use_extract) { - extract($arr, EXTR_REFS); - } else { - $_a = &$arr['_a']; - $_b = &$arr['_b']; - } - - $_a++; - $_b++; - - var_dump($a, $b, $_a, $_b, $arr); -} - -test(false); -test(true); - -?> ---EXPECT-- -int(1) -int(1) -int(1) -int(2) -int(2) -int(2) -array(2) { - ["_a"]=> - &int(2) - ["_b"]=> - &int(2) -} -int(1) -int(1) -int(1) -int(2) -int(2) -int(2) -array(2) { - ["_a"]=> - &int(2) - ["_b"]=> - &int(2) -} ---UEXPECT-- -int(1) -int(1) -int(1) -int(2) -int(2) -int(2) -array(2) { - [u"_a"]=> - &int(2) - [u"_b"]=> - &int(2) -} -int(1) -int(1) -int(1) -int(2) -int(2) -int(2) -array(2) { - [u"_a"]=> - &int(2) - [u"_b"]=> - &int(2) -} diff --git a/ext/standard/tests/array/bug32021.phpt b/ext/standard/tests/array/bug32021.phpt deleted file mode 100644 index 5d3b421ab468f..0000000000000 --- a/ext/standard/tests/array/bug32021.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #32021 (Crash caused by range('', 'z')) ---FILE-- - -ALIVE ---EXPECT-- -array(1) { - [0]=> - int(0) -} -ALIVE diff --git a/ext/standard/tests/array/bug33382.phpt b/ext/standard/tests/array/bug33382.phpt deleted file mode 100644 index 407b5846fea41..0000000000000 --- a/ext/standard/tests/array/bug33382.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -bug #33382 ( array_reverse() fails after *sort() ) ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(5) - [1]=> - int(4) - [2]=> - int(3) - [3]=> - int(2) - [4]=> - int(1) -} -Done diff --git a/ext/standard/tests/array/bug33940.phpt b/ext/standard/tests/array/bug33940.phpt deleted file mode 100755 index f1aba87bd5cbe..0000000000000 --- a/ext/standard/tests/array/bug33940.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #33940 array_map() fails to pass by reference when called recursively ---INI-- -error_reporting=4095 -allow_call_time_pass_reference=1 ---FILE-- - ---EXPECT-- -Array: Array -( - [0] => Array - ( - [0] => 0 - ) - - [1] => 0 -) -Return: Array -( - [0] => Array - ( - [0] => 2 - ) - - [1] => 2 -) -Array: Array -( - [0] => Array - ( - [0] => 1 - ) - - [1] => 1 -) -Return: Array -( - [0] => Array - ( - [0] => 2 - ) - - [1] => 2 -) diff --git a/ext/standard/tests/array/bug33989.phpt b/ext/standard/tests/array/bug33989.phpt deleted file mode 100755 index ccef172d61cc8..0000000000000 --- a/ext/standard/tests/array/bug33989.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP) ---FILE-- - ---EXPECT-- -ok diff --git a/ext/standard/tests/array/bug34227.phpt b/ext/standard/tests/array/bug34227.phpt deleted file mode 100755 index 29762b72332f0..0000000000000 --- a/ext/standard/tests/array/bug34227.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Bug #34277 (array_filter() crashes with references and objects) ---FILE-- -m2(); - } - - function m2() - { - $this->m3(); - } - - function m3() - { - $this->m4(); - } - - function m4() - { - $this->m5(); - } - - function m5() - { - $this->m6(); - } - - function m6() - { - $this->m7(); - } - - function m7() - { - $this->m8(); - } - - function m8() - { - $this->m9(); - } - - function m9() - { - $this->m10(); - } - - function m10() - { - $this->m11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - } - - function m11($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10) - { - $arr = explode('a', 'b'); - } -} - -function f($str) -{ - $obj = new C; - $obj->m1(); - return TRUE; -} - -function p5($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12) -{ - $ret = array_filter(array(0), 'f'); -} - -function p4() -{ - p5(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12); -} - -function p3() -{ - p4(); -} - -function p2() -{ - p3(); -} - -function p1() -{ - p2(); -} - -p1(); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt deleted file mode 100644 index e6824ab0e5835..0000000000000 --- a/ext/standard/tests/array/count_recursive.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -count ---FILE-- - 1, "b" => 2, array("c" => 3, array("d" => 5))); -print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n"; -print "COUNT_RECURSIVE: should be 6, is ".count($arr, COUNT_RECURSIVE)."\n"; - -print "Testing strings...\n"; -print "COUNT_NORMAL: should be 1, is ".count("string", COUNT_NORMAL)."\n"; -print "COUNT_RECURSIVE: should be 1, is ".count("string", COUNT_RECURSIVE)."\n"; - -print "Testing various types with no second argument.\n"; -print "COUNT_NORMAL: should be 1, is ".count("string")."\n"; -print "COUNT_NORMAL: should be 2, is ".count(array("a", array("b")))."\n"; - -$arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL), - array(array(array(array(array(NULL)))))); -print "Testing really cool arrays ;)\n"; -print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n"; -print "COUNT_RECURSIVE: should be 13, is ".count($arr, COUNT_RECURSIVE)."\n"; -?> ---EXPECT-- -Testing NULL... -COUNT_NORMAL: should be 0, is 0 -COUNT_RECURSIVE: should be 0, is 0 -Testing arrays... -COUNT_NORMAL: should be 2, is 2 -COUNT_RECURSIVE: should be 8, is 8 -Testing hashes... -COUNT_NORMAL: should be 3, is 3 -COUNT_RECURSIVE: should be 6, is 6 -Testing strings... -COUNT_NORMAL: should be 1, is 1 -COUNT_RECURSIVE: should be 1, is 1 -Testing various types with no second argument. -COUNT_NORMAL: should be 1, is 1 -COUNT_NORMAL: should be 2, is 2 -Testing really cool arrays ;) -COUNT_NORMAL: should be 3, is 3 -COUNT_RECURSIVE: should be 13, is 13 diff --git a/ext/standard/tests/array/data.inc b/ext/standard/tests/array/data.inc deleted file mode 100644 index 2991274be88b1..0000000000000 --- a/ext/standard/tests/array/data.inc +++ /dev/null @@ -1,13 +0,0 @@ -'PHP: Hypertext Preprocessor', - 5=>'Test', - 'test'=>27, - 1000=>'test', - "-1000"=>array('banana', 'orange'), - 'monkey', - $tmp=>-1/3 -); -?> diff --git a/ext/standard/tests/array/locale_sort.phpt b/ext/standard/tests/array/locale_sort.phpt deleted file mode 100644 index b99017ce41462..0000000000000 --- a/ext/standard/tests/array/locale_sort.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Sort with SORT_LOCALE_STRING ---SKIPIF-- - ---INI-- -unicode.script_encoding=UTF-8 -unicode.output_encoding=UTF-8 ---FILE-- - "Alberta", -"BC" => "Colombie-Britannique", -"MB" => "Manitoba", -"NB" => "Nouveau-Brunswick", -"NL" => "Terre-Neuve-et-Labrador", -"NS" => "Nouvelle-‰cosse", -"ON" => "Ontario", -"PE" => "Žle-du-Prince-‰douard", -"QC" => "Quİbec", -"SK" => "Saskatchewan", -"NT" => "Territoires du Nord-Ouest", -"NU" => "Nunavut", -"YT" => "Territoire du Yukon"); -asort($table, SORT_LOCALE_STRING); -var_dump($table); -?> ---EXPECT-- -array(13) { - ["AB"]=> - string(7) "Alberta" - ["BC"]=> - string(20) "Colombie-Britannique" - ["PE"]=> - string(21) "Žle-du-Prince-‰douard" - ["MB"]=> - string(8) "Manitoba" - ["NB"]=> - string(17) "Nouveau-Brunswick" - ["NS"]=> - string(15) "Nouvelle-‰cosse" - ["NU"]=> - string(7) "Nunavut" - ["ON"]=> - string(7) "Ontario" - ["QC"]=> - string(6) "Quİbec" - ["SK"]=> - string(12) "Saskatchewan" - ["NL"]=> - string(23) "Terre-Neuve-et-Labrador" - ["YT"]=> - string(19) "Territoire du Yukon" - ["NT"]=> - string(25) "Territoires du Nord-Ouest" -} ---UEXPECT-- -array(13) { - [u"AB"]=> - unicode(7) "Alberta" - [u"BC"]=> - unicode(20) "Colombie-Britannique" - [u"PE"]=> - unicode(21) "Žle-du-Prince-‰douard" - [u"MB"]=> - unicode(8) "Manitoba" - [u"NB"]=> - unicode(17) "Nouveau-Brunswick" - [u"NS"]=> - unicode(15) "Nouvelle-‰cosse" - [u"NU"]=> - unicode(7) "Nunavut" - [u"ON"]=> - unicode(7) "Ontario" - [u"QC"]=> - unicode(6) "Quİbec" - [u"SK"]=> - unicode(12) "Saskatchewan" - [u"NL"]=> - unicode(23) "Terre-Neuve-et-Labrador" - [u"YT"]=> - unicode(19) "Territoire du Yukon" - [u"NT"]=> - unicode(25) "Territoires du Nord-Ouest" -} diff --git a/ext/standard/tests/array/range.phpt b/ext/standard/tests/array/range.phpt deleted file mode 100644 index 049260c36d9eb..0000000000000 --- a/ext/standard/tests/array/range.phpt +++ /dev/null @@ -1,2662 +0,0 @@ ---TEST-- -range() ---FILE-- - ---EXPECT-- -array(100) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - [10]=> - int(11) - [11]=> - int(12) - [12]=> - int(13) - [13]=> - int(14) - [14]=> - int(15) - [15]=> - int(16) - [16]=> - int(17) - [17]=> - int(18) - [18]=> - int(19) - [19]=> - int(20) - [20]=> - int(21) - [21]=> - int(22) - [22]=> - int(23) - [23]=> - int(24) - [24]=> - int(25) - [25]=> - int(26) - [26]=> - int(27) - [27]=> - int(28) - [28]=> - int(29) - [29]=> - int(30) - [30]=> - int(31) - [31]=> - int(32) - [32]=> - int(33) - [33]=> - int(34) - [34]=> - int(35) - [35]=> - int(36) - [36]=> - int(37) - [37]=> - int(38) - [38]=> - int(39) - [39]=> - int(40) - [40]=> - int(41) - [41]=> - int(42) - [42]=> - int(43) - [43]=> - int(44) - [44]=> - int(45) - [45]=> - int(46) - [46]=> - int(47) - [47]=> - int(48) - [48]=> - int(49) - [49]=> - int(50) - [50]=> - int(51) - [51]=> - int(52) - [52]=> - int(53) - [53]=> - int(54) - [54]=> - int(55) - [55]=> - int(56) - [56]=> - int(57) - [57]=> - int(58) - [58]=> - int(59) - [59]=> - int(60) - [60]=> - int(61) - [61]=> - int(62) - [62]=> - int(63) - [63]=> - int(64) - [64]=> - int(65) - [65]=> - int(66) - [66]=> - int(67) - [67]=> - int(68) - [68]=> - int(69) - [69]=> - int(70) - [70]=> - int(71) - [71]=> - int(72) - [72]=> - int(73) - [73]=> - int(74) - [74]=> - int(75) - [75]=> - int(76) - [76]=> - int(77) - [77]=> - int(78) - [78]=> - int(79) - [79]=> - int(80) - [80]=> - int(81) - [81]=> - int(82) - [82]=> - int(83) - [83]=> - int(84) - [84]=> - int(85) - [85]=> - int(86) - [86]=> - int(87) - [87]=> - int(88) - [88]=> - int(89) - [89]=> - int(90) - [90]=> - int(91) - [91]=> - int(92) - [92]=> - int(93) - [93]=> - int(94) - [94]=> - int(95) - [95]=> - int(96) - [96]=> - int(97) - [97]=> - int(98) - [98]=> - int(99) - [99]=> - int(100) -} -array(100) { - [0]=> - int(100) - [1]=> - int(99) - [2]=> - int(98) - [3]=> - int(97) - [4]=> - int(96) - [5]=> - int(95) - [6]=> - int(94) - [7]=> - int(93) - [8]=> - int(92) - [9]=> - int(91) - [10]=> - int(90) - [11]=> - int(89) - [12]=> - int(88) - [13]=> - int(87) - [14]=> - int(86) - [15]=> - int(85) - [16]=> - int(84) - [17]=> - int(83) - [18]=> - int(82) - [19]=> - int(81) - [20]=> - int(80) - [21]=> - int(79) - [22]=> - int(78) - [23]=> - int(77) - [24]=> - int(76) - [25]=> - int(75) - [26]=> - int(74) - [27]=> - int(73) - [28]=> - int(72) - [29]=> - int(71) - [30]=> - int(70) - [31]=> - int(69) - [32]=> - int(68) - [33]=> - int(67) - [34]=> - int(66) - [35]=> - int(65) - [36]=> - int(64) - [37]=> - int(63) - [38]=> - int(62) - [39]=> - int(61) - [40]=> - int(60) - [41]=> - int(59) - [42]=> - int(58) - [43]=> - int(57) - [44]=> - int(56) - [45]=> - int(55) - [46]=> - int(54) - [47]=> - int(53) - [48]=> - int(52) - [49]=> - int(51) - [50]=> - int(50) - [51]=> - int(49) - [52]=> - int(48) - [53]=> - int(47) - [54]=> - int(46) - [55]=> - int(45) - [56]=> - int(44) - [57]=> - int(43) - [58]=> - int(42) - [59]=> - int(41) - [60]=> - int(40) - [61]=> - int(39) - [62]=> - int(38) - [63]=> - int(37) - [64]=> - int(36) - [65]=> - int(35) - [66]=> - int(34) - [67]=> - int(33) - [68]=> - int(32) - [69]=> - int(31) - [70]=> - int(30) - [71]=> - int(29) - [72]=> - int(28) - [73]=> - int(27) - [74]=> - int(26) - [75]=> - int(25) - [76]=> - int(24) - [77]=> - int(23) - [78]=> - int(22) - [79]=> - int(21) - [80]=> - int(20) - [81]=> - int(19) - [82]=> - int(18) - [83]=> - int(17) - [84]=> - int(16) - [85]=> - int(15) - [86]=> - int(14) - [87]=> - int(13) - [88]=> - int(12) - [89]=> - int(11) - [90]=> - int(10) - [91]=> - int(9) - [92]=> - int(8) - [93]=> - int(7) - [94]=> - int(6) - [95]=> - int(5) - [96]=> - int(4) - [97]=> - int(3) - [98]=> - int(2) - [99]=> - int(1) -} -array(100) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - [10]=> - int(11) - [11]=> - int(12) - [12]=> - int(13) - [13]=> - int(14) - [14]=> - int(15) - [15]=> - int(16) - [16]=> - int(17) - [17]=> - int(18) - [18]=> - int(19) - [19]=> - int(20) - [20]=> - int(21) - [21]=> - int(22) - [22]=> - int(23) - [23]=> - int(24) - [24]=> - int(25) - [25]=> - int(26) - [26]=> - int(27) - [27]=> - int(28) - [28]=> - int(29) - [29]=> - int(30) - [30]=> - int(31) - [31]=> - int(32) - [32]=> - int(33) - [33]=> - int(34) - [34]=> - int(35) - [35]=> - int(36) - [36]=> - int(37) - [37]=> - int(38) - [38]=> - int(39) - [39]=> - int(40) - [40]=> - int(41) - [41]=> - int(42) - [42]=> - int(43) - [43]=> - int(44) - [44]=> - int(45) - [45]=> - int(46) - [46]=> - int(47) - [47]=> - int(48) - [48]=> - int(49) - [49]=> - int(50) - [50]=> - int(51) - [51]=> - int(52) - [52]=> - int(53) - [53]=> - int(54) - [54]=> - int(55) - [55]=> - int(56) - [56]=> - int(57) - [57]=> - int(58) - [58]=> - int(59) - [59]=> - int(60) - [60]=> - int(61) - [61]=> - int(62) - [62]=> - int(63) - [63]=> - int(64) - [64]=> - int(65) - [65]=> - int(66) - [66]=> - int(67) - [67]=> - int(68) - [68]=> - int(69) - [69]=> - int(70) - [70]=> - int(71) - [71]=> - int(72) - [72]=> - int(73) - [73]=> - int(74) - [74]=> - int(75) - [75]=> - int(76) - [76]=> - int(77) - [77]=> - int(78) - [78]=> - int(79) - [79]=> - int(80) - [80]=> - int(81) - [81]=> - int(82) - [82]=> - int(83) - [83]=> - int(84) - [84]=> - int(85) - [85]=> - int(86) - [86]=> - int(87) - [87]=> - int(88) - [88]=> - int(89) - [89]=> - int(90) - [90]=> - int(91) - [91]=> - int(92) - [92]=> - int(93) - [93]=> - int(94) - [94]=> - int(95) - [95]=> - int(96) - [96]=> - int(97) - [97]=> - int(98) - [98]=> - int(99) - [99]=> - int(100) -} -array(100) { - [0]=> - int(100) - [1]=> - int(99) - [2]=> - int(98) - [3]=> - int(97) - [4]=> - int(96) - [5]=> - int(95) - [6]=> - int(94) - [7]=> - int(93) - [8]=> - int(92) - [9]=> - int(91) - [10]=> - int(90) - [11]=> - int(89) - [12]=> - int(88) - [13]=> - int(87) - [14]=> - int(86) - [15]=> - int(85) - [16]=> - int(84) - [17]=> - int(83) - [18]=> - int(82) - [19]=> - int(81) - [20]=> - int(80) - [21]=> - int(79) - [22]=> - int(78) - [23]=> - int(77) - [24]=> - int(76) - [25]=> - int(75) - [26]=> - int(74) - [27]=> - int(73) - [28]=> - int(72) - [29]=> - int(71) - [30]=> - int(70) - [31]=> - int(69) - [32]=> - int(68) - [33]=> - int(67) - [34]=> - int(66) - [35]=> - int(65) - [36]=> - int(64) - [37]=> - int(63) - [38]=> - int(62) - [39]=> - int(61) - [40]=> - int(60) - [41]=> - int(59) - [42]=> - int(58) - [43]=> - int(57) - [44]=> - int(56) - [45]=> - int(55) - [46]=> - int(54) - [47]=> - int(53) - [48]=> - int(52) - [49]=> - int(51) - [50]=> - int(50) - [51]=> - int(49) - [52]=> - int(48) - [53]=> - int(47) - [54]=> - int(46) - [55]=> - int(45) - [56]=> - int(44) - [57]=> - int(43) - [58]=> - int(42) - [59]=> - int(41) - [60]=> - int(40) - [61]=> - int(39) - [62]=> - int(38) - [63]=> - int(37) - [64]=> - int(36) - [65]=> - int(35) - [66]=> - int(34) - [67]=> - int(33) - [68]=> - int(32) - [69]=> - int(31) - [70]=> - int(30) - [71]=> - int(29) - [72]=> - int(28) - [73]=> - int(27) - [74]=> - int(26) - [75]=> - int(25) - [76]=> - int(24) - [77]=> - int(23) - [78]=> - int(22) - [79]=> - int(21) - [80]=> - int(20) - [81]=> - int(19) - [82]=> - int(18) - [83]=> - int(17) - [84]=> - int(16) - [85]=> - int(15) - [86]=> - int(14) - [87]=> - int(13) - [88]=> - int(12) - [89]=> - int(11) - [90]=> - int(10) - [91]=> - int(9) - [92]=> - int(8) - [93]=> - int(7) - [94]=> - int(6) - [95]=> - int(5) - [96]=> - int(4) - [97]=> - int(3) - [98]=> - int(2) - [99]=> - int(1) -} -array(26) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" - [3]=> - string(1) "d" - [4]=> - string(1) "e" - [5]=> - string(1) "f" - [6]=> - string(1) "g" - [7]=> - string(1) "h" - [8]=> - string(1) "i" - [9]=> - string(1) "j" - [10]=> - string(1) "k" - [11]=> - string(1) "l" - [12]=> - string(1) "m" - [13]=> - string(1) "n" - [14]=> - string(1) "o" - [15]=> - string(1) "p" - [16]=> - string(1) "q" - [17]=> - string(1) "r" - [18]=> - string(1) "s" - [19]=> - string(1) "t" - [20]=> - string(1) "u" - [21]=> - string(1) "v" - [22]=> - string(1) "w" - [23]=> - string(1) "x" - [24]=> - string(1) "y" - [25]=> - string(1) "z" -} -array(26) { - [0]=> - string(1) "z" - [1]=> - string(1) "y" - [2]=> - string(1) "x" - [3]=> - string(1) "w" - [4]=> - string(1) "v" - [5]=> - string(1) "u" - [6]=> - string(1) "t" - [7]=> - string(1) "s" - [8]=> - string(1) "r" - [9]=> - string(1) "q" - [10]=> - string(1) "p" - [11]=> - string(1) "o" - [12]=> - string(1) "n" - [13]=> - string(1) "m" - [14]=> - string(1) "l" - [15]=> - string(1) "k" - [16]=> - string(1) "j" - [17]=> - string(1) "i" - [18]=> - string(1) "h" - [19]=> - string(1) "g" - [20]=> - string(1) "f" - [21]=> - string(1) "e" - [22]=> - string(1) "d" - [23]=> - string(1) "c" - [24]=> - string(1) "b" - [25]=> - string(1) "a" -} -array(1) { - [0]=> - string(1) "q" -} -array(1) { - [0]=> - int(5) -} -array(6) { - [0]=> - float(5.1) - [1]=> - float(6.1) - [2]=> - float(7.1) - [3]=> - float(8.1) - [4]=> - float(9.1) - [5]=> - float(10.1) -} -array(6) { - [0]=> - float(10.1) - [1]=> - float(9.1) - [2]=> - float(8.1) - [3]=> - float(7.1) - [4]=> - float(6.1) - [5]=> - float(5.1) -} -array(6) { - [0]=> - float(5.1) - [1]=> - float(6.1) - [2]=> - float(7.1) - [3]=> - float(8.1) - [4]=> - float(9.1) - [5]=> - float(10.1) -} -array(6) { - [0]=> - float(10.1) - [1]=> - float(9.1) - [2]=> - float(8.1) - [3]=> - float(7.1) - [4]=> - float(6.1) - [5]=> - float(5.1) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} -array(41) { - [0]=> - float(5) - [1]=> - float(4.9) - [2]=> - float(4.8) - [3]=> - float(4.7) - [4]=> - float(4.6) - [5]=> - float(4.5) - [6]=> - float(4.4) - [7]=> - float(4.3) - [8]=> - float(4.2) - [9]=> - float(4.1) - [10]=> - float(4) - [11]=> - float(3.9) - [12]=> - float(3.8) - [13]=> - float(3.7) - [14]=> - float(3.6) - [15]=> - float(3.5) - [16]=> - float(3.4) - [17]=> - float(3.3) - [18]=> - float(3.2) - [19]=> - float(3.1) - [20]=> - float(3) - [21]=> - float(2.9) - [22]=> - float(2.8) - [23]=> - float(2.7) - [24]=> - float(2.6) - [25]=> - float(2.5) - [26]=> - float(2.4) - [27]=> - float(2.3) - [28]=> - float(2.2) - [29]=> - float(2.1) - [30]=> - float(2) - [31]=> - float(1.9) - [32]=> - float(1.8) - [33]=> - float(1.7) - [34]=> - float(1.6) - [35]=> - float(1.5) - [36]=> - float(1.4) - [37]=> - float(1.3) - [38]=> - float(1.2) - [39]=> - float(1.1) - [40]=> - float(1) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} ---UEXPECT-- -array(100) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - [10]=> - int(11) - [11]=> - int(12) - [12]=> - int(13) - [13]=> - int(14) - [14]=> - int(15) - [15]=> - int(16) - [16]=> - int(17) - [17]=> - int(18) - [18]=> - int(19) - [19]=> - int(20) - [20]=> - int(21) - [21]=> - int(22) - [22]=> - int(23) - [23]=> - int(24) - [24]=> - int(25) - [25]=> - int(26) - [26]=> - int(27) - [27]=> - int(28) - [28]=> - int(29) - [29]=> - int(30) - [30]=> - int(31) - [31]=> - int(32) - [32]=> - int(33) - [33]=> - int(34) - [34]=> - int(35) - [35]=> - int(36) - [36]=> - int(37) - [37]=> - int(38) - [38]=> - int(39) - [39]=> - int(40) - [40]=> - int(41) - [41]=> - int(42) - [42]=> - int(43) - [43]=> - int(44) - [44]=> - int(45) - [45]=> - int(46) - [46]=> - int(47) - [47]=> - int(48) - [48]=> - int(49) - [49]=> - int(50) - [50]=> - int(51) - [51]=> - int(52) - [52]=> - int(53) - [53]=> - int(54) - [54]=> - int(55) - [55]=> - int(56) - [56]=> - int(57) - [57]=> - int(58) - [58]=> - int(59) - [59]=> - int(60) - [60]=> - int(61) - [61]=> - int(62) - [62]=> - int(63) - [63]=> - int(64) - [64]=> - int(65) - [65]=> - int(66) - [66]=> - int(67) - [67]=> - int(68) - [68]=> - int(69) - [69]=> - int(70) - [70]=> - int(71) - [71]=> - int(72) - [72]=> - int(73) - [73]=> - int(74) - [74]=> - int(75) - [75]=> - int(76) - [76]=> - int(77) - [77]=> - int(78) - [78]=> - int(79) - [79]=> - int(80) - [80]=> - int(81) - [81]=> - int(82) - [82]=> - int(83) - [83]=> - int(84) - [84]=> - int(85) - [85]=> - int(86) - [86]=> - int(87) - [87]=> - int(88) - [88]=> - int(89) - [89]=> - int(90) - [90]=> - int(91) - [91]=> - int(92) - [92]=> - int(93) - [93]=> - int(94) - [94]=> - int(95) - [95]=> - int(96) - [96]=> - int(97) - [97]=> - int(98) - [98]=> - int(99) - [99]=> - int(100) -} -array(100) { - [0]=> - int(100) - [1]=> - int(99) - [2]=> - int(98) - [3]=> - int(97) - [4]=> - int(96) - [5]=> - int(95) - [6]=> - int(94) - [7]=> - int(93) - [8]=> - int(92) - [9]=> - int(91) - [10]=> - int(90) - [11]=> - int(89) - [12]=> - int(88) - [13]=> - int(87) - [14]=> - int(86) - [15]=> - int(85) - [16]=> - int(84) - [17]=> - int(83) - [18]=> - int(82) - [19]=> - int(81) - [20]=> - int(80) - [21]=> - int(79) - [22]=> - int(78) - [23]=> - int(77) - [24]=> - int(76) - [25]=> - int(75) - [26]=> - int(74) - [27]=> - int(73) - [28]=> - int(72) - [29]=> - int(71) - [30]=> - int(70) - [31]=> - int(69) - [32]=> - int(68) - [33]=> - int(67) - [34]=> - int(66) - [35]=> - int(65) - [36]=> - int(64) - [37]=> - int(63) - [38]=> - int(62) - [39]=> - int(61) - [40]=> - int(60) - [41]=> - int(59) - [42]=> - int(58) - [43]=> - int(57) - [44]=> - int(56) - [45]=> - int(55) - [46]=> - int(54) - [47]=> - int(53) - [48]=> - int(52) - [49]=> - int(51) - [50]=> - int(50) - [51]=> - int(49) - [52]=> - int(48) - [53]=> - int(47) - [54]=> - int(46) - [55]=> - int(45) - [56]=> - int(44) - [57]=> - int(43) - [58]=> - int(42) - [59]=> - int(41) - [60]=> - int(40) - [61]=> - int(39) - [62]=> - int(38) - [63]=> - int(37) - [64]=> - int(36) - [65]=> - int(35) - [66]=> - int(34) - [67]=> - int(33) - [68]=> - int(32) - [69]=> - int(31) - [70]=> - int(30) - [71]=> - int(29) - [72]=> - int(28) - [73]=> - int(27) - [74]=> - int(26) - [75]=> - int(25) - [76]=> - int(24) - [77]=> - int(23) - [78]=> - int(22) - [79]=> - int(21) - [80]=> - int(20) - [81]=> - int(19) - [82]=> - int(18) - [83]=> - int(17) - [84]=> - int(16) - [85]=> - int(15) - [86]=> - int(14) - [87]=> - int(13) - [88]=> - int(12) - [89]=> - int(11) - [90]=> - int(10) - [91]=> - int(9) - [92]=> - int(8) - [93]=> - int(7) - [94]=> - int(6) - [95]=> - int(5) - [96]=> - int(4) - [97]=> - int(3) - [98]=> - int(2) - [99]=> - int(1) -} -array(100) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) - [5]=> - int(6) - [6]=> - int(7) - [7]=> - int(8) - [8]=> - int(9) - [9]=> - int(10) - [10]=> - int(11) - [11]=> - int(12) - [12]=> - int(13) - [13]=> - int(14) - [14]=> - int(15) - [15]=> - int(16) - [16]=> - int(17) - [17]=> - int(18) - [18]=> - int(19) - [19]=> - int(20) - [20]=> - int(21) - [21]=> - int(22) - [22]=> - int(23) - [23]=> - int(24) - [24]=> - int(25) - [25]=> - int(26) - [26]=> - int(27) - [27]=> - int(28) - [28]=> - int(29) - [29]=> - int(30) - [30]=> - int(31) - [31]=> - int(32) - [32]=> - int(33) - [33]=> - int(34) - [34]=> - int(35) - [35]=> - int(36) - [36]=> - int(37) - [37]=> - int(38) - [38]=> - int(39) - [39]=> - int(40) - [40]=> - int(41) - [41]=> - int(42) - [42]=> - int(43) - [43]=> - int(44) - [44]=> - int(45) - [45]=> - int(46) - [46]=> - int(47) - [47]=> - int(48) - [48]=> - int(49) - [49]=> - int(50) - [50]=> - int(51) - [51]=> - int(52) - [52]=> - int(53) - [53]=> - int(54) - [54]=> - int(55) - [55]=> - int(56) - [56]=> - int(57) - [57]=> - int(58) - [58]=> - int(59) - [59]=> - int(60) - [60]=> - int(61) - [61]=> - int(62) - [62]=> - int(63) - [63]=> - int(64) - [64]=> - int(65) - [65]=> - int(66) - [66]=> - int(67) - [67]=> - int(68) - [68]=> - int(69) - [69]=> - int(70) - [70]=> - int(71) - [71]=> - int(72) - [72]=> - int(73) - [73]=> - int(74) - [74]=> - int(75) - [75]=> - int(76) - [76]=> - int(77) - [77]=> - int(78) - [78]=> - int(79) - [79]=> - int(80) - [80]=> - int(81) - [81]=> - int(82) - [82]=> - int(83) - [83]=> - int(84) - [84]=> - int(85) - [85]=> - int(86) - [86]=> - int(87) - [87]=> - int(88) - [88]=> - int(89) - [89]=> - int(90) - [90]=> - int(91) - [91]=> - int(92) - [92]=> - int(93) - [93]=> - int(94) - [94]=> - int(95) - [95]=> - int(96) - [96]=> - int(97) - [97]=> - int(98) - [98]=> - int(99) - [99]=> - int(100) -} -array(100) { - [0]=> - int(100) - [1]=> - int(99) - [2]=> - int(98) - [3]=> - int(97) - [4]=> - int(96) - [5]=> - int(95) - [6]=> - int(94) - [7]=> - int(93) - [8]=> - int(92) - [9]=> - int(91) - [10]=> - int(90) - [11]=> - int(89) - [12]=> - int(88) - [13]=> - int(87) - [14]=> - int(86) - [15]=> - int(85) - [16]=> - int(84) - [17]=> - int(83) - [18]=> - int(82) - [19]=> - int(81) - [20]=> - int(80) - [21]=> - int(79) - [22]=> - int(78) - [23]=> - int(77) - [24]=> - int(76) - [25]=> - int(75) - [26]=> - int(74) - [27]=> - int(73) - [28]=> - int(72) - [29]=> - int(71) - [30]=> - int(70) - [31]=> - int(69) - [32]=> - int(68) - [33]=> - int(67) - [34]=> - int(66) - [35]=> - int(65) - [36]=> - int(64) - [37]=> - int(63) - [38]=> - int(62) - [39]=> - int(61) - [40]=> - int(60) - [41]=> - int(59) - [42]=> - int(58) - [43]=> - int(57) - [44]=> - int(56) - [45]=> - int(55) - [46]=> - int(54) - [47]=> - int(53) - [48]=> - int(52) - [49]=> - int(51) - [50]=> - int(50) - [51]=> - int(49) - [52]=> - int(48) - [53]=> - int(47) - [54]=> - int(46) - [55]=> - int(45) - [56]=> - int(44) - [57]=> - int(43) - [58]=> - int(42) - [59]=> - int(41) - [60]=> - int(40) - [61]=> - int(39) - [62]=> - int(38) - [63]=> - int(37) - [64]=> - int(36) - [65]=> - int(35) - [66]=> - int(34) - [67]=> - int(33) - [68]=> - int(32) - [69]=> - int(31) - [70]=> - int(30) - [71]=> - int(29) - [72]=> - int(28) - [73]=> - int(27) - [74]=> - int(26) - [75]=> - int(25) - [76]=> - int(24) - [77]=> - int(23) - [78]=> - int(22) - [79]=> - int(21) - [80]=> - int(20) - [81]=> - int(19) - [82]=> - int(18) - [83]=> - int(17) - [84]=> - int(16) - [85]=> - int(15) - [86]=> - int(14) - [87]=> - int(13) - [88]=> - int(12) - [89]=> - int(11) - [90]=> - int(10) - [91]=> - int(9) - [92]=> - int(8) - [93]=> - int(7) - [94]=> - int(6) - [95]=> - int(5) - [96]=> - int(4) - [97]=> - int(3) - [98]=> - int(2) - [99]=> - int(1) -} -array(26) { - [0]=> - unicode(1) "a" - [1]=> - unicode(1) "b" - [2]=> - unicode(1) "c" - [3]=> - unicode(1) "d" - [4]=> - unicode(1) "e" - [5]=> - unicode(1) "f" - [6]=> - unicode(1) "g" - [7]=> - unicode(1) "h" - [8]=> - unicode(1) "i" - [9]=> - unicode(1) "j" - [10]=> - unicode(1) "k" - [11]=> - unicode(1) "l" - [12]=> - unicode(1) "m" - [13]=> - unicode(1) "n" - [14]=> - unicode(1) "o" - [15]=> - unicode(1) "p" - [16]=> - unicode(1) "q" - [17]=> - unicode(1) "r" - [18]=> - unicode(1) "s" - [19]=> - unicode(1) "t" - [20]=> - unicode(1) "u" - [21]=> - unicode(1) "v" - [22]=> - unicode(1) "w" - [23]=> - unicode(1) "x" - [24]=> - unicode(1) "y" - [25]=> - unicode(1) "z" -} -array(26) { - [0]=> - unicode(1) "z" - [1]=> - unicode(1) "y" - [2]=> - unicode(1) "x" - [3]=> - unicode(1) "w" - [4]=> - unicode(1) "v" - [5]=> - unicode(1) "u" - [6]=> - unicode(1) "t" - [7]=> - unicode(1) "s" - [8]=> - unicode(1) "r" - [9]=> - unicode(1) "q" - [10]=> - unicode(1) "p" - [11]=> - unicode(1) "o" - [12]=> - unicode(1) "n" - [13]=> - unicode(1) "m" - [14]=> - unicode(1) "l" - [15]=> - unicode(1) "k" - [16]=> - unicode(1) "j" - [17]=> - unicode(1) "i" - [18]=> - unicode(1) "h" - [19]=> - unicode(1) "g" - [20]=> - unicode(1) "f" - [21]=> - unicode(1) "e" - [22]=> - unicode(1) "d" - [23]=> - unicode(1) "c" - [24]=> - unicode(1) "b" - [25]=> - unicode(1) "a" -} -array(1) { - [0]=> - unicode(1) "q" -} -array(1) { - [0]=> - int(5) -} -array(6) { - [0]=> - float(5.1) - [1]=> - float(6.1) - [2]=> - float(7.1) - [3]=> - float(8.1) - [4]=> - float(9.1) - [5]=> - float(10.1) -} -array(6) { - [0]=> - float(10.1) - [1]=> - float(9.1) - [2]=> - float(8.1) - [3]=> - float(7.1) - [4]=> - float(6.1) - [5]=> - float(5.1) -} -array(6) { - [0]=> - float(5.1) - [1]=> - float(6.1) - [2]=> - float(7.1) - [3]=> - float(8.1) - [4]=> - float(9.1) - [5]=> - float(10.1) -} -array(6) { - [0]=> - float(10.1) - [1]=> - float(9.1) - [2]=> - float(8.1) - [3]=> - float(7.1) - [4]=> - float(6.1) - [5]=> - float(5.1) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} -array(41) { - [0]=> - float(5) - [1]=> - float(4.9) - [2]=> - float(4.8) - [3]=> - float(4.7) - [4]=> - float(4.6) - [5]=> - float(4.5) - [6]=> - float(4.4) - [7]=> - float(4.3) - [8]=> - float(4.2) - [9]=> - float(4.1) - [10]=> - float(4) - [11]=> - float(3.9) - [12]=> - float(3.8) - [13]=> - float(3.7) - [14]=> - float(3.6) - [15]=> - float(3.5) - [16]=> - float(3.4) - [17]=> - float(3.3) - [18]=> - float(3.2) - [19]=> - float(3.1) - [20]=> - float(3) - [21]=> - float(2.9) - [22]=> - float(2.8) - [23]=> - float(2.7) - [24]=> - float(2.6) - [25]=> - float(2.5) - [26]=> - float(2.4) - [27]=> - float(2.3) - [28]=> - float(2.2) - [29]=> - float(2.1) - [30]=> - float(2) - [31]=> - float(1.9) - [32]=> - float(1.8) - [33]=> - float(1.7) - [34]=> - float(1.6) - [35]=> - float(1.5) - [36]=> - float(1.4) - [37]=> - float(1.3) - [38]=> - float(1.2) - [39]=> - float(1.1) - [40]=> - float(1) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} -array(41) { - [0]=> - float(1) - [1]=> - float(1.1) - [2]=> - float(1.2) - [3]=> - float(1.3) - [4]=> - float(1.4) - [5]=> - float(1.5) - [6]=> - float(1.6) - [7]=> - float(1.7) - [8]=> - float(1.8) - [9]=> - float(1.9) - [10]=> - float(2) - [11]=> - float(2.1) - [12]=> - float(2.2) - [13]=> - float(2.3) - [14]=> - float(2.4) - [15]=> - float(2.5) - [16]=> - float(2.6) - [17]=> - float(2.7) - [18]=> - float(2.8) - [19]=> - float(2.9) - [20]=> - float(3) - [21]=> - float(3.1) - [22]=> - float(3.2) - [23]=> - float(3.3) - [24]=> - float(3.4) - [25]=> - float(3.5) - [26]=> - float(3.6) - [27]=> - float(3.7) - [28]=> - float(3.8) - [29]=> - float(3.9) - [30]=> - float(4) - [31]=> - float(4.1) - [32]=> - float(4.2) - [33]=> - float(4.3) - [34]=> - float(4.4) - [35]=> - float(4.5) - [36]=> - float(4.6) - [37]=> - float(4.7) - [38]=> - float(4.8) - [39]=> - float(4.9) - [40]=> - float(5) -} diff --git a/ext/standard/tests/array/var_export.phpt b/ext/standard/tests/array/var_export.phpt deleted file mode 100644 index acfec76991981..0000000000000 --- a/ext/standard/tests/array/var_export.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -var_export() and objects with numeric indexes properties ---FILE-- - "bar"); -var_export($a); -?> ---EXPECT-- -stdClass::__set_state(array( - 'foo' => 'bar', -)) diff --git a/ext/standard/tests/array/var_export2.phpt b/ext/standard/tests/array/var_export2.phpt deleted file mode 100644 index 2b8a1f97ef9b2..0000000000000 Binary files a/ext/standard/tests/array/var_export2.phpt and /dev/null differ diff --git a/ext/standard/tests/array/var_export3.phpt b/ext/standard/tests/array/var_export3.phpt deleted file mode 100644 index 6d39946916c41..0000000000000 --- a/ext/standard/tests/array/var_export3.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -var_export() and classes ---FILE-- -mann = 42; - $this->kvinne = 43; - } -} - -$kake = new kake; - -var_export($kake); -?> ---EXPECT-- -kake::__set_state(array( - 'mann' => 42, - 'kvinne' => 43, -)) diff --git a/ext/standard/tests/assert/assert.phpt b/ext/standard/tests/assert/assert.phpt deleted file mode 100644 index bced47d8f3330..0000000000000 --- a/ext/standard/tests/assert/assert.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -assert() ---INI-- -error_reporting = 2039 ---FILE-- - ---EXPECT-- -assertion failed 22,"$a != 0" -class assertion failed 25,"$a != 0" -class assertion failed 29,"$a != 0" diff --git a/ext/standard/tests/file/001-win32.phpt b/ext/standard/tests/file/001-win32.phpt deleted file mode 100644 index 09ab2b7a1b3dd..0000000000000 --- a/ext/standard/tests/file/001-win32.phpt +++ /dev/null @@ -1,125 +0,0 @@ ---TEST-- -File type functions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -test.file does not exist -test.file exists -test.link does not exist -test.file is not a symlink -test.link is not a symlink -test.file exists -test.file is file -test.link is file -test.file permissions are 0666 -test.file size is 0 -test.file is writeable -test.file is readable -test.file is a regular file -test.link is not a regular file -test.link is not a directory -../file is a directory -test.file is not a directory -test.file does not exist -test.file does not exist diff --git a/ext/standard/tests/file/001.phpt b/ext/standard/tests/file/001.phpt deleted file mode 100644 index e3768b19dd79c..0000000000000 --- a/ext/standard/tests/file/001.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -File type functions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -test.file does not exist -test.file exists -test.link exists -test.file is not a symlink -test.link is a symlink -test.file exists -test.link lstat and stat differ at element 1 -test.link lstat and stat differ at element 2 -test.link lstat and stat differ at element 7 -test.link lstat and stat differ at element 8 -test.link lstat and stat differ at element 9 -test.file is file -test.link is link -test.file permissions are 0744 -test.file size is 0 -test.file is writeable -test.file is readable -test.file is executable -test.file is a regular file -test.link is a regular file -test.link is not a directory -../file is a directory -test.file is not a directory -test.file does not exist -test.file does not exist diff --git a/ext/standard/tests/file/002.phpt b/ext/standard/tests/file/002.phpt deleted file mode 100644 index 134f5416fc439..0000000000000 --- a/ext/standard/tests/file/002.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -File/Stream functions ---FILE-- - ---EXPECT-- -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah diff --git a/ext/standard/tests/file/003.phpt b/ext/standard/tests/file/003.phpt deleted file mode 100644 index 8eeaa939eb17a..0000000000000 --- a/ext/standard/tests/file/003.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -is_*() and file_exists() return values are boolean. ---FILE-- - ---EXPECT-- -boolean -boolean -boolean -boolean -boolean -boolean -boolean -boolean -boolean -boolean diff --git a/ext/standard/tests/file/004.phpt b/ext/standard/tests/file/004.phpt deleted file mode 100644 index f1fab47ac3266..0000000000000 --- a/ext/standard/tests/file/004.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -file_put_contents() test ---FILE-- - ---EXPECT-- -String Test: OK -Integer Test: OK -Float Test: OK -Bool Test: OK -Array Test: OK diff --git a/ext/standard/tests/file/bug12556.phpt b/ext/standard/tests/file/bug12556.phpt deleted file mode 100644 index c8e35cfcadc59..0000000000000 --- a/ext/standard/tests/file/bug12556.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #12556 (fgetcsv() ignores lengths when quotes not closed) ---FILE-- - ---EXPECT-- -array(4) { - [0]=> - string(1) "6" - [1]=> - string(1) "7" - [2]=> - string(1) "8" - [3]=> - string(5) "line1" -} -array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(186) "line2 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -" -} diff --git a/ext/standard/tests/file/bug20424.phpt b/ext/standard/tests/file/bug20424.phpt deleted file mode 100644 index df10d4abdbfae..0000000000000 --- a/ext/standard/tests/file/bug20424.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #20424 (stream_get_meta_data crashes on a normal file stream) ---FILE-- - ---EXPECT-- -I'm alive! diff --git a/ext/standard/tests/file/bug22382.phpt b/ext/standard/tests/file/bug22382.phpt deleted file mode 100644 index 2ba36ee1de82d..0000000000000 --- a/ext/standard/tests/file/bug22382.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #22382 (fgetcsv() does not handle escaped quotes correctly) ---FILE-- - ---EXPECT-- -array(6) { - [0]=> - string(3) "One" - [1]=> - string(7) "\"Two\"" - [2]=> - string(7) "Three\"" - [3]=> - string(4) "Four" - [4]=> - string(2) "\\" - [5]=> - string(28) "\\\\\\\\\\\\\\\\\\\\\\\"\\\\" -} diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt deleted file mode 100644 index f4f097d66d130..0000000000000 --- a/ext/standard/tests/file/bug22414.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #22414 (passthru() does not read data correctly) ---INI-- -safe_mode= -output_handler= ---FILE-- - '.$tmpfile ; - exec($cmd); - - if (md5_file($php) == md5_file($tmpfile)) { - echo "Works\n"; - } else { - echo "Does not work\n"; - } - - @unlink($tmpfile); -?> ---EXPECT-- -HELLO -Works diff --git a/ext/standard/tests/file/bug24313.phpt b/ext/standard/tests/file/bug24313.phpt deleted file mode 100644 index dcea58ffef23e..0000000000000 --- a/ext/standard/tests/file/bug24313.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #24313 (file_exists() warning on non-existant files when is open_basedir enabled) ---INI-- -open_basedir=/tmp ---FILE-- - ---EXPECT-- -bool(false) diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt deleted file mode 100644 index 4bf12e8f66ad8..0000000000000 --- a/ext/standard/tests/file/bug24482.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #24482 (GLOB_ONLYDIR not working) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/standard/tests/file/bug26003.phpt b/ext/standard/tests/file/bug26003.phpt deleted file mode 100644 index 7d083746932df..0000000000000 Binary files a/ext/standard/tests/file/bug26003.phpt and /dev/null differ diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt deleted file mode 100644 index 34d71e4b38459..0000000000000 --- a/ext/standard/tests/file/bug26615.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #26615 (exec crash on long input lines) ---INI--- -variables_order=E ---FILE-- - ---EXPECT-- -Array -( - [0] => 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 -) diff --git a/ext/standard/tests/file/bug26938.phpt b/ext/standard/tests/file/bug26938.phpt deleted file mode 100644 index 8e059ee840336..0000000000000 --- a/ext/standard/tests/file/bug26938.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #26938 (exec does not read consecutive long lines correctly) ---FILE-- - ---EXPECT-- -md5(line 0)= e86410fa2d6e2634fd8ac5f4b3afe7f3 (length 10) -md5(line 1)= e84debf3a1d132871d7fe45c1c04c566 (length 20000) -md5(line 2)= c33b4d2f86908eea5d75ee5a61fd81f4 (length 10000) -md5(line 3)= 2ecdde3959051d913f61b14579ea136d (length 5) -md5(line 4)= c33b4d2f86908eea5d75ee5a61fd81f4 (length 10000) -md5(line 5)= 902fbdd2b1df0c4f70b4a5d23525e932 (length 3) diff --git a/ext/standard/tests/file/bug27508.phpt b/ext/standard/tests/file/bug27508.phpt deleted file mode 100644 index 5374a0dcbcf65..0000000000000 --- a/ext/standard/tests/file/bug27508.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Bug #27508 (userspace wrappers have bogus eof indicator) ---FILE-- -fp = fopen($url, $mode); - - return true; - } - - function stream_read($count) - { - return fread($this->fp, $count); - } - - function stream_write($data) - { - return fwrite($this->fp, $data); - } - - function stream_tell() - { - return ftell($this->fp); - } - - function stream_eof() - { - return feof($this->fp); - } - - function stream_seek($offset, $whence) - { - return fseek($this->fp, $offset, $whence) == 0 ? true : false; - } -} - -stream_wrapper_register("myFile", "FileStream") - or die("Failed to register protocol"); - -$tn = tempnam('/tmp', 'foo'); - -$fp = fopen("myFile://" . urlencode($tn), "w+"); - -fwrite($fp, "line1\n"); -fwrite($fp, "line2\n"); -fwrite($fp, "line3\n"); - -debug_zval_dump(feof($fp)); -rewind($fp); -echo ftell($fp) . "\n"; -debug_zval_dump(feof($fp)); -while (!feof($fp)) { - echo fgets($fp); -} -fclose($fp); - -unlink($tn); ---EXPECT-- -bool(false) refcount(1) -0 -bool(false) refcount(1) -line1 -line2 -line3 diff --git a/ext/standard/tests/file/bug27619.phpt b/ext/standard/tests/file/bug27619.phpt deleted file mode 100644 index 095a18c199ff6..0000000000000 --- a/ext/standard/tests/file/bug27619.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #27619 (filters not applied to pre-buffered data) ---FILE-- - ---EXPECT-- -this IS A LOWERCASE STRING. diff --git a/ext/standard/tests/file/bug30362.phpt b/ext/standard/tests/file/bug30362.phpt deleted file mode 100644 index 1c2b4be979a17..0000000000000 --- a/ext/standard/tests/file/bug30362.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #30362 (stream_get_line() not working as documented) ---FILE-- - ---EXPECT-- -111 -111111111 -111111111 -111111111 -111111111 -111111111 -111111111 -111111111 -111111111 -111111111 diff --git a/ext/standard/tests/file/bug30362.txt b/ext/standard/tests/file/bug30362.txt deleted file mode 100644 index 3a1b7f448cb0e..0000000000000 --- a/ext/standard/tests/file/bug30362.txt +++ /dev/null @@ -1 +0,0 @@ -111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111 diff --git a/ext/standard/tests/file/bug32160.phpt b/ext/standard/tests/file/bug32160.phpt deleted file mode 100644 index e4968034ad5d8..0000000000000 --- a/ext/standard/tests/file/bug32160.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #32160 (copying a file into itself leads to data loss) ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -bool(false) diff --git a/ext/standard/tests/file/bug32160.txt b/ext/standard/tests/file/bug32160.txt deleted file mode 100644 index 1e4a6b512d348..0000000000000 --- a/ext/standard/tests/file/bug32160.txt +++ /dev/null @@ -1 +0,0 @@ -copy test diff --git a/ext/standard/tests/file/fgetcsv.phpt b/ext/standard/tests/file/fgetcsv.phpt deleted file mode 100644 index 868212c033b6a..0000000000000 --- a/ext/standard/tests/file/fgetcsv.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -various fgetcsv() functionality tests ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(0) "" - [1]=> - string(0) "" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(0) "" -} -array(2) { - [0]=> - string(0) "" - [1]=> - string(3) "aaa" -} -array(2) { - [0]=> - string(0) "" - [1]=> - string(0) "" -} -array(2) { - [0]=> - string(2) "\"" - [1]=> - string(3) "aaa" -} -array(2) { - [0]=> - string(2) """" - [1]=> - string(0) "" -} -array(1) { - [0]=> - string(7) """,aaa -" -} -array(1) { - [0]=> - string(8) "\"",aaa -" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(10) "\"bbb,ccc -" -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(6) "bbb " -} -array(2) { - [0]=> - string(3) "aaa" - [1]=> - string(6) "bbb " -} -array(2) { - [0]=> - string(8) "aaa"aaa"" - [1]=> - string(6) "bbbbbb" -} -array(2) { - [0]=> - string(10) "aaa"aaa"""" - [1]=> - string(3) "bbb" -} -array(2) { - [0]=> - string(8) "aaa"\"a"" - [1]=> - string(3) "bbb" -} diff --git a/ext/standard/tests/file/fopencookie.phpt b/ext/standard/tests/file/fopencookie.phpt deleted file mode 100644 index 1b2cfb17b8d35..0000000000000 --- a/ext/standard/tests/file/fopencookie.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -fopencookie detected and working (or cast mechanism works) ---FILE-- -data, $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($this->data); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($this->data) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->position = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - -} - -stream_wrapper_register("cookietest", "userstream"); - -include("cookietest://foo"); - -?> ---EXPECT-- -If you can read this, it worked diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt deleted file mode 100755 index 486d10a1fccec..0000000000000 --- a/ext/standard/tests/file/fputcsv.phpt +++ /dev/null @@ -1,107 +0,0 @@ ---TEST-- -various fputcsv() functionality tests ---INI-- -magic_quotes_runtime=0 ---FILE-- - 'aaa,bbb', - 1 => 'aaa,"bbb"', - 2 => '"aaa","bbb"', - 3 => 'aaa,bbb', - 4 => '"aaa",bbb', - 5 => '"aaa", "bbb"', - 6 => ',', - 7 => 'aaa,', - 8 => ',"aaa"', - 9 => '"",""', - 10 => '"""""",', - 11 => '""""",aaa', - 12 => 'aaa,bbb ', - 13 => 'aaa,"bbb "', - 14 => 'aaa"aaa","bbb"bbb', - 15 => 'aaa"aaa""",bbb', - 16 => 'aaa,"\\"bbb,ccc', - 17 => 'aaa"\\"a","bbb"', - 18 => '"\\"","aaa"', - 19 => '"\\""",aaa', -); - -$file = dirname(__FILE__) . 'fgetcsv.csv'; -@unlink($file); - -$fp = fopen($file, "w"); -foreach ($list as $v) { - fputcsv($fp, split(',', $v)); -} -fclose($fp); - -$res = file($file); -foreach($res as &$val) -{ - $val = substr($val, 0, -1); -} -echo '$list = ';var_export($res);echo ";\n"; - -$fp = fopen($file, "r"); -$res = array(); -while($l=fgetcsv($fp)) -{ - $res[] = join(',',$l); -} -fclose($fp); - -echo '$list = ';var_export($res);echo ";\n"; - -@unlink($file); - -?> -===DONE=== - ---EXPECT-- -$list = array ( - 0 => 'aaa,bbb', - 1 => 'aaa,"""bbb"""', - 2 => '"""aaa""","""bbb"""', - 3 => 'aaa,bbb', - 4 => '"""aaa""",bbb', - 5 => '"""aaa"""," ""bbb"""', - 6 => ',', - 7 => 'aaa,', - 8 => ',"""aaa"""', - 9 => '"""""",""""""', - 10 => '"""""""""""""",', - 11 => '"""""""""""",aaa', - 12 => 'aaa,"bbb "', - 13 => 'aaa,"""bbb """', - 14 => '"aaa""aaa""","""bbb""bbb"', - 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\"bbb",ccc', - 17 => '"aaa""\\"a""","""bbb"""', - 18 => '"""\\"""","""aaa"""', - 19 => '"""\\"""""",aaa', -); -$list = array ( - 0 => 'aaa,bbb', - 1 => 'aaa,"bbb"', - 2 => '"aaa","bbb"', - 3 => 'aaa,bbb', - 4 => '"aaa",bbb', - 5 => '"aaa", "bbb"', - 6 => ',', - 7 => 'aaa,', - 8 => ',"aaa"', - 9 => '"",""', - 10 => '"""""",', - 11 => '""""",aaa', - 12 => 'aaa,bbb ', - 13 => 'aaa,"bbb "', - 14 => 'aaa"aaa","bbb"bbb', - 15 => 'aaa"aaa""",bbb', - 16 => 'aaa,"\\"bbb,ccc', - 17 => 'aaa"\\"a","bbb"', - 18 => '"\\"","aaa"', - 19 => '"\\""",aaa', -); -===DONE=== diff --git a/ext/standard/tests/file/proc_open01.phpt b/ext/standard/tests/file/proc_open01.phpt deleted file mode 100644 index 39fc4e4cf6b15..0000000000000 --- a/ext/standard/tests/file/proc_open01.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -proc_open() regression test 1 (proc_open() leak) ---FILE-- - array('pipe', 'r'), 1 => array('pipe', 'w')), - $pipes -); -if ($proc === false) { - print "something went wrong.\n"; -} -var_dump($pipes); -stream_set_blocking($pipes[1], FALSE); -$test_string = "yay!\n"; -fwrite($pipes[0], $test_string); -fflush($pipes[0]); -fclose($pipes[0]); -$cnt = ''; -$n=0; -for ($left = strlen($test_string); $left > 0;) { - if (++$n >1000) { - print "terminated after 1000 iterations\n"; - break; - } - $read_fds = array($pipes[1]); - $retval = stream_select($read_fds, $write_fds = NULL, $exp_fds = NULL, 1); - if ($retval === false) { - print "select() failed\n"; - break; - } - if ($retval === 0) { - print "timed out\n"; - break; - } - $buf = fread($pipes[1], 1024); - $cnt .= $buf; - $left -= strlen($buf); -} -var_dump($cnt); -fclose($pipes[1]); -proc_close($proc); -var_dump($orig_pipes); -?> ---EXPECTF-- -array(2) { - [0]=> - resource(%d) of type (stream) - [1]=> - resource(%d) of type (stream) -} -string(5) "yay! -" -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} diff --git a/ext/standard/tests/file/statcache-corruption.phpt b/ext/standard/tests/file/statcache-corruption.phpt deleted file mode 100644 index 7fa391624cec6..0000000000000 --- a/ext/standard/tests/file/statcache-corruption.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -statcache corruption ---FILE-- - ---EXPECT-- -Array -( -) diff --git a/ext/standard/tests/file/stream_get_line.phpt b/ext/standard/tests/file/stream_get_line.phpt deleted file mode 100644 index 51261f7043ba9..0000000000000 --- a/ext/standard/tests/file/stream_get_line.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Crash inside stream_get_line(), when length=0 ---FILE-- -bar
              foo"); -$fp = fopen($path, "r"); -while ($fp && !feof($fp)) { - echo stream_get_line($fp, 0, "
              ")."\n"; -} -fclose($fp); -@unlink($path); -?> ---EXPECT-- -foo -bar -foo diff --git a/ext/standard/tests/file/test.csv b/ext/standard/tests/file/test.csv deleted file mode 100644 index d99984c2ab779..0000000000000 --- a/ext/standard/tests/file/test.csv +++ /dev/null @@ -1,17 +0,0 @@ -6,7,8,line1 -1,2,3,"line2 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 -2,4,5,line3 diff --git a/ext/standard/tests/file/test2.csv b/ext/standard/tests/file/test2.csv deleted file mode 100644 index d8164641703ce..0000000000000 --- a/ext/standard/tests/file/test2.csv +++ /dev/null @@ -1 +0,0 @@ -"One","\"Two\"","Three\"","Four","\\","\\\\\\\\\\\\\\\\\\\\\\\"\\\\" diff --git a/ext/standard/tests/file/test3.csv b/ext/standard/tests/file/test3.csv deleted file mode 100644 index 63f09033df499..0000000000000 Binary files a/ext/standard/tests/file/test3.csv and /dev/null differ diff --git a/ext/standard/tests/file/userdirstream.phpt b/ext/standard/tests/file/userdirstream.phpt deleted file mode 100644 index f857b3c82f1f4..0000000000000 --- a/ext/standard/tests/file/userdirstream.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Directory Streams ---FILE-- -idx = 0; - - return true; - } - - function dir_readdir() { - $sample = array('first','second','third','fourth'); - - if ($this->idx >= count($sample)) return false; - else return $sample[$this->idx++]; - } - - function dir_rewinddir() { - $this->idx = 0; - - return true; - } - - function dir_closedir() { - print "Closing up!\n"; - - return true; - } -} - -stream_wrapper_register('test', 'test'); - -var_dump(scandir('test://example.com/path/to/test')); -?> ---EXPECT-- -Opening -Closing up! -array(4) { - [0]=> - string(5) "first" - [1]=> - string(6) "fourth" - [2]=> - string(6) "second" - [3]=> - string(5) "third" -} ---UEXPECT-- -Opening -Closing up! -array(4) { - [0]=> - unicode(5) "first" - [1]=> - unicode(6) "fourth" - [2]=> - unicode(6) "second" - [3]=> - unicode(5) "third" -} diff --git a/ext/standard/tests/file/userfilters.phpt b/ext/standard/tests/file/userfilters.phpt deleted file mode 100644 index dfa8376fffc68..0000000000000 --- a/ext/standard/tests/file/userfilters.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -stream userfilter test ---FILE-- -data = strtoupper($bucket->data); - $consumed += strlen($bucket->data); - stream_bucket_append($out, $bucket); - } - return PSFS_PASS_ON; - } - - function oncreate() { - echo "params: {$this->params}\n"; - } -} - -stream_filter_register('testfilter','testfilter'); - -$text = "Hello There!"; - -$fp = tmpfile(); -fwrite($fp, $text); - -rewind($fp); -stream_filter_append($fp, 'testfilter', STREAM_FILTER_READ, 'testuserfilter'); - -var_dump(fgets($fp)); -fclose($fp); - -?> ---EXPECT-- -params: testuserfilter -string(12) "HELLO THERE!" diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt deleted file mode 100644 index 124825f24ed54..0000000000000 --- a/ext/standard/tests/file/userstreams.phpt +++ /dev/null @@ -1,325 +0,0 @@ ---TEST-- -User-space streams ---FILE-- -path = $path; - $this->mode = $mode; - $this->options = $options; - - $split = parse_url($path); - $this->varname = $split["host"]; - - if (strchr($mode, 'a')) - $this->position = strlen($GLOBALS[$this->varname]); - else - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - -} - -if (@stream_wrapper_register("bogus", "class_not_exist")) { - die("Registered a non-existant class!!!???"); -} -echo "Not Registered\n"; - -if (!stream_wrapper_register("test", "mystream")) { - die("test wrapper registration failed"); -} -echo "Registered\n"; - -if (!stream_wrapper_register("bogon", "uselessstream")) { - die("bogon wrapper registration failed"); -} -echo "Registered\n"; - -$b = @fopen("bogon://url", "rb"); -if (is_resource($b)) { - die("Opened a bogon??"); -} - -$fp = fopen("test://DATA", "rb"); -if (!$fp || !is_resource($fp)) { - die("Failed to open resource"); -} - -/* some default seeks that will cause buffer/cache misses */ -$seeks = array( - array(SEEK_SET, 0, 0), - array(SEEK_CUR, 8450, 8450), - array(SEEK_CUR, -7904, 546), - array(SEEK_CUR, 12456, 13002), - - /* end up at BOF so that randomly generated seek offsets - * below will know where they are supposed to be */ - array(SEEK_SET, 0, 0) -); - -$whence_map = array( - SEEK_CUR, - SEEK_SET, - SEEK_END -); -$whence_names = array( - SEEK_CUR => "SEEK_CUR", - SEEK_SET => "SEEK_SET", - SEEK_END => "SEEK_END" - ); - -/* generate some random seek offsets */ -$position = 0; -for ($i = 0; $i < 256; $i++) { - $whence = $whence_map[array_rand($whence_map, 1)]; - switch($whence) { - case SEEK_SET: - $offset = rand(0, $DATALEN); - $position = $offset; - break; - case SEEK_END: - $offset = -rand(0, $DATALEN); - $position = $DATALEN + $offset; - break; - case SEEK_CUR: - $offset = rand(0, $DATALEN); - $offset -= $position; - $position += $offset; - break; - } - - $seeks[] = array($whence, $offset, $position); -} - -/* we compare the results of fgets using differing line lengths to - * test the fgets layer also */ -$line_lengths = array(1024, 256, 64, 16); -$fail_count = 0; - -ob_start(); -foreach($line_lengths as $line_length) { - /* now compare the real stream with the user stream */ - $j = 0; - rewind($tf); - rewind($fp); - foreach($seeks as $seekdata) { - list($whence, $offset, $position) = $seekdata; - - $rpb = ftell($tf); - $rr = (int)fseek($tf, $offset, $whence); - $rpa = ftell($tf); - $rline = fgets($tf, $line_length); - (int)fseek($tf, - strlen($rline), SEEK_CUR); - - $upb = ftell($fp); - $ur = (int)fseek($fp, $offset, $whence); - $upa = ftell($fp); - $uline = fgets($fp, $line_length); - (int)fseek($fp, - strlen($uline), SEEK_CUR); - - printf("\n--[%d] whence=%s offset=%d line_length=%d position_should_be=%d --\n", - $j, $whence_names[$whence], $offset, $line_length, $position); - printf("REAL: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $rpb, $rpa, ftell($tf), $rr, strlen($rline), $rline); - printf("USER: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $upb, $upa, ftell($fp), $ur, strlen($uline), $uline); - - if ($rr != $ur || $rline != $uline || $rpa != $position || $upa != $position) { - $fail_count++; - echo "###################################### FAIL!\n"; - $dat = stream_get_meta_data($fp); - var_dump($dat); - break; - } - - $j++; - } - if ($fail_count) - break; -} - -if ($fail_count == 0) { - ob_end_clean(); - echo "SEEK: OK\n"; -} else { - echo "SEEK: FAIL\n"; - ob_end_flush(); -} - -$fail_count = 0; - -fseek($fp, $DATALEN / 2, SEEK_SET); -fseek($tf, $DATALEN / 2, SEEK_SET); - -if (ftell($fp) != ftell($tf)) { - echo "SEEK: positions do not match!\n"; -} - -$n = 0; -while(!feof($fp)) { - $uline = fgets($fp, 1024); - $rline = fgets($tf, 1024); - - if ($uline != $rline) { - echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . "]\nreal=$rline [pos=" . ftell($tf) . "]\n"; - $fail_count++; - break; - } -} - -if ($fail_count == 0) { - echo "FGETS: OK\n"; -} - -/* One final test to see if the position is respected when opened for append */ -$fp = fopen("test://lyrics", "a+"); -rewind($fp); -var_dump(ftell($fp)); -$data = fgets($fp); -fclose($fp); -echo $data . "\n"; - -?> ---EXPECT-- -Not Registered -Registered -Registered -SEEK: OK -FGETS: OK -int(0) -...and the road becomes my bride diff --git a/ext/standard/tests/file/userwrapper.phpt b/ext/standard/tests/file/userwrapper.phpt deleted file mode 100644 index 717e73c708566..0000000000000 --- a/ext/standard/tests/file/userwrapper.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Userstream unlink, rename, mkdir, rmdir, and url_stat. ---FILE-- -1, 'ino'=>2, 'mode'=>0644, 'nlink'=>3, - 'uid'=>100, 'gid'=>1000, 'rdev'=>-1, 'size'=>31337, - 'atime'=>1234567890, 'mtime'=>1231231231, 'ctime'=>1234564564, - 'blksize'=>-1, 'blocks'=>-1); - } -} - -stream_wrapper_register('test', 'test'); - -unlink('test://example.com/path/to/file'); -rename('test://example.com/path/to/from', 'test://example.com/path/to/to'); -/* We *want* this to fail and thus not output the watch statement */ -@rename('test://example.com/path/to/from', 'http://example.com/path/to/to'); -mkdir('test://example.com/path/to/directory', 0755); -rmdir('test://example.com/path/to/directory'); -print_r(stat('test://example.com/path/to/file')); -echo "Filesize = " . filesize('test://example.com/path/to/file') . "\n"; -echo "filemtime = " . filemtime('test://example.com/path/to/file') . "\n"; -?> ---EXPECT-- -Unlinking file: test://example.com/path/to/file -Renaming test://example.com/path/to/from to test://example.com/path/to/to -Making directory: test://example.com/path/to/directory as 755 -Removing directory: test://example.com/path/to/directory -Stating file: test://example.com/path/to/file -Array -( - [0] => 1 - [1] => 2 - [2] => 420 - [3] => 3 - [4] => 100 - [5] => 1000 - [6] => -1 - [7] => 31337 - [8] => 1234567890 - [9] => 1231231231 - [10] => 1234564564 - [11] => -1 - [12] => -1 - [dev] => 1 - [ino] => 2 - [mode] => 420 - [nlink] => 3 - [uid] => 100 - [gid] => 1000 - [rdev] => -1 - [size] => 31337 - [atime] => 1234567890 - [mtime] => 1231231231 - [ctime] => 1234564564 - [blksize] => -1 - [blocks] => -1 -) -Filesize = 31337 -filemtime = 1231231231 - diff --git a/ext/standard/tests/filters/basic.phpt b/ext/standard/tests/filters/basic.phpt deleted file mode 100644 index 13a79e2cd18db..0000000000000 --- a/ext/standard/tests/filters/basic.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -basic stream filter tests ---FILE-- - ---EXPECTF-- -filter: string.rot13 -resource(%d) of type (stream filter) -string(12) "Uryyb Gurer!" -filter: string.toupper -resource(%d) of type (stream filter) -string(12) "HELLO THERE!" -filter: string.tolower -resource(%d) of type (stream filter) -string(12) "hello there!" -filter: string.rot13 -resource(%d) of type (stream filter) -filter: string.toupper -resource(%d) of type (stream filter) -string(12) "URYYB GURER!" diff --git a/ext/standard/tests/filters/bug22538.phpt b/ext/standard/tests/filters/bug22538.phpt deleted file mode 100644 index 438b5be31f8dc..0000000000000 --- a/ext/standard/tests/filters/bug22538.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #22538 (filtered stream doesn't update file pointer) ---FILE-- - 0) { - fwrite($fp, $str); -} -$cnt = $size - ($str_len + $cnt); -fclose($fp); -$fin = fopen($path1, "r") or die("Can not open $path1\n");; -$fout = fopen($path2, "w") or die("Can not open $path2\n");; -stream_filter_append($fout, "string.rot13"); -my_stream_copy_to_stream($fin, $fout); -fclose($fout); -fclose($fin); -var_dump($cnt); -var_dump(filesize($path2)); -var_dump(md5_file($path1)); -var_dump(md5_file($path2)); -unlink($path1); -unlink($path2); -?> ---EXPECT-- -int(65529) -int(65529) -string(32) "e10e3d1ae81b084b822e8592d019b57a" -string(32) "931f0fbf8a72312e3bab9965b1d1081c" diff --git a/ext/standard/tests/general_functions/001.phpt b/ext/standard/tests/general_functions/001.phpt deleted file mode 100644 index 164bd7fb2154c..0000000000000 --- a/ext/standard/tests/general_functions/001.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -sprintf() function ---FILE-- - ---EXPECT-- -sprintf string truncate test: passed -sprintf padding and align test: passed -sprintf octal and hex test: passed -sprintf octal binary test: passed -sprintf float test: passed -99.00 -99.00 -1.23400e-18 -1.23400e+18 -9.84324e+6 --9.84324e+6 diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt deleted file mode 100644 index 58528da13aadb..0000000000000 --- a/ext/standard/tests/general_functions/002.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -quoted_printable_decode() function test ---FILE-- - ---EXPECT-- -úwow-factorÁĠŬĊÎÎÙĊ - ÔÏÒÇÏ×ÙĊ ÒÏĊËÔÙ diff --git a/ext/standard/tests/general_functions/003.phpt b/ext/standard/tests/general_functions/003.phpt deleted file mode 100644 index 7ad90c8b5adbc..0000000000000 --- a/ext/standard/tests/general_functions/003.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -levenshtein() function test ---FILE-- - ---EXPECT-- -all passed diff --git a/ext/standard/tests/general_functions/004.data b/ext/standard/tests/general_functions/004.data deleted file mode 100644 index 5dd0832842415..0000000000000 --- a/ext/standard/tests/general_functions/004.data +++ /dev/null @@ -1,4 +0,0 @@ -name value comment -true 1 boolean true -false 0 boolean false -empty nothing diff --git a/ext/standard/tests/general_functions/004.phpt b/ext/standard/tests/general_functions/004.phpt deleted file mode 100644 index 40b47cc1caf3b..0000000000000 --- a/ext/standard/tests/general_functions/004.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -fgetcsv() with tab delimited fields (BUG #8258) ---FILE-- - ---EXPECT-- -name,value,comment -true,1,boolean true -false,0,boolean false -empty,,nothing diff --git a/ext/standard/tests/general_functions/005.phpt b/ext/standard/tests/general_functions/005.phpt deleted file mode 100644 index 027d124add72f..0000000000000 --- a/ext/standard/tests/general_functions/005.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -is_scalar() function test ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) - diff --git a/ext/standard/tests/general_functions/006.phpt b/ext/standard/tests/general_functions/006.phpt deleted file mode 100644 index 6852286c5e783..0000000000000 --- a/ext/standard/tests/general_functions/006.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -quoted_printable_decode() function test with CR/LF ---FILE-- - ---EXPECT-- -úwow-factorÁĠŬĊÎÎÙĊ - ÔÏÒÇÏ×ÙĊ ÒÏĊËÔÙ diff --git a/ext/standard/tests/general_functions/007.phpt b/ext/standard/tests/general_functions/007.phpt deleted file mode 100644 index f755ab4f80827..0000000000000 --- a/ext/standard/tests/general_functions/007.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -MD5 / Base64 ---FILE-- - ---EXPECT-- -d41d8cd98f00b204e9800998ecf8427e -0cc175b9c0f1b6a831c399e269772661 -900150983cd24fb0d6963f7d28e17f72 -f96b697d7cb7938d525a2f31aaf161d0 -c3fcd3d76192e4007dfb496cca67e13b -d174ab98d277d9f5a5611c2c9f419d9f -57edf4a22be3c955ac49da2e2107b67a diff --git a/ext/standard/tests/general_functions/008.phpt b/ext/standard/tests/general_functions/008.phpt deleted file mode 100644 index bb633c334db9a..0000000000000 --- a/ext/standard/tests/general_functions/008.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -var_dump float test ---INI-- -precision=12 ---FILE-- - ---EXPECT-- -array(14) { - [0]=> - string(2) "12" - [1]=> - float(0.012) - [2]=> - float(-0.012) - [3]=> - float(0.12) - [4]=> - float(-0.12) - [5]=> - float(1.2) - [6]=> - float(-1.2) - [7]=> - float(12) - [8]=> - float(-12) - [9]=> - float(0.000123) - [10]=> - float(1.23E-5) - [11]=> - float(123456789012) - [12]=> - float(1234567890120) - [13]=> - float(1.23456789012E+19) -} \ No newline at end of file diff --git a/ext/standard/tests/general_functions/009.phpt b/ext/standard/tests/general_functions/009.phpt deleted file mode 100644 index e80d36140dc8b..0000000000000 --- a/ext/standard/tests/general_functions/009.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SHA1 ---FILE-- - ---EXPECT-- -da39a3ee5e6b4b0d3255bfef95601890afd80709 -86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -a9993e364706816aba3e25717850c26c9cd0d89d -c12252ceda8be8994d5fa0290a47231c1d16aae3 -32d10c7b8cf96570ca04ce37f2a19d84240d3a89 -761c457bf73b14d27e9e9265c46f4b4dda11f940 -50abf5706a150990a08b2c5ea40fa0e585554732 diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt deleted file mode 100755 index 52fe0320564f3..0000000000000 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #25038 (call_user_func issues warning if function throws exception) ---FILE-- -getMessage()."\n"; -} -try -{ - call_user_func('bar','second try'); -} -catch (Exception $e) -{ - print $e->getMessage()."\n"; -} - -?> -===DONE=== ---EXPECT-- -This is an exception from bar(first try). -This is an exception from bar(second try). -===DONE=== diff --git a/ext/standard/tests/general_functions/bug29038.phpt b/ext/standard/tests/general_functions/bug29038.phpt deleted file mode 100644 index 0f792299941ac..0000000000000 --- a/ext/standard/tests/general_functions/bug29038.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings) ---FILE-- - 1),EXTR_PREFIX_SAME,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f2() { - $a = 1; - $c = extract(array("a" => 1),EXTR_PREFIX_SAME,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f3() { - $a = 1; - $c = extract(array("a" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f4() { - $c = extract(array("" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f5() { - $c = extract(array("111" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} - -f1(); -f2(); -f3(); -f4(); -f5(); -?> ---EXPECT-- -Extracted:int(0) -Array -( - [c] => 0 -) -Extracted:int(1) -Array -( - [a] => 1 - [prefix_a] => 1 - [c] => 1 -) -Extracted:int(1) -Array -( - [a] => 1 - [prefix_a] => 1 - [c] => 1 -) -Extracted:int(0) -Array -( - [c] => 0 -) -Extracted:int(1) -Array -( - [prefix_111] => 1 - [c] => 1 -) diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt deleted file mode 100644 index 7d154708fa418..0000000000000 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #31190 (exception in call_user_func_array()) ---FILE-- -getMessage(); -} - -try { - call_user_func_array($array, array(1, 2)); -} catch (Exception $e) { - echo $e->getMessage(); -} -?> ---EXPECT-- -Hello World! -Hello World! - diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt deleted file mode 100644 index ca98f429a735b..0000000000000 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP) ---INI-- -error_reporting=2047 -display_errors=1 ---FILE-- - ---EXPECTF-- -Notice: Undefined variable: obj in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Notice: Undefined variable: obj in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Warning: (Registered shutdown functions) Unable to call bar::foo() - function does not exist in Unknown on line 0 - -Warning: (Registered shutdown functions) Unable to call bar() - function does not exist in Unknown on line 0 -joo! -bar! - -Warning: (Registered shutdown functions) Unable to call bar::foobar() - function does not exist in Unknown on line 0 -bar! diff --git a/ext/standard/tests/general_functions/getopt.phpt b/ext/standard/tests/general_functions/getopt.phpt deleted file mode 100644 index 0c48b9b6615c5..0000000000000 --- a/ext/standard/tests/general_functions/getopt.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -getopt ---ARGS-- --v -h -d test -m 1234 -t -j ---INI-- -register_argc_argv=On -variables_order=GPS ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(5) { - ["v"]=> - bool(false) - ["h"]=> - bool(false) - ["d"]=> - string(4) "test" - ["m"]=> - string(4) "1234" - ["t"]=> - bool(false) -} ---UEXPECT-- -array(5) { - [u"v"]=> - bool(false) - [u"h"]=> - bool(false) - [u"d"]=> - unicode(4) "test" - [u"m"]=> - unicode(4) "1234" - [u"t"]=> - bool(false) -} diff --git a/ext/standard/tests/general_functions/highlight_heredoc.phpt b/ext/standard/tests/general_functions/highlight_heredoc.phpt deleted file mode 100644 index 58f83806a5e3a..0000000000000 --- a/ext/standard/tests/general_functions/highlight_heredoc.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -highlight_string() handling of heredoc ---FILE-- - ---EXPECT-- - -
              $x=<<<DD
              jhdsjkfhjdsh
              DD
              ."";
              $a=<<<DDDD
              jhdsjkfhjdsh
              DDDD;
              -
              diff --git a/ext/standard/tests/general_functions/is_resource.phpt b/ext/standard/tests/general_functions/is_resource.phpt deleted file mode 100644 index d44461e442209..0000000000000 --- a/ext/standard/tests/general_functions/is_resource.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #27822: is_resource() returns TRUE for closed resources ---FILE-- - ---EXPECT-- -bool(false) diff --git a/ext/standard/tests/general_functions/proc_open.phpt b/ext/standard/tests/general_functions/proc_open.phpt deleted file mode 100644 index ecf8d8ad79e86..0000000000000 --- a/ext/standard/tests/general_functions/proc_open.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -proc_open ---SKIPIF-- - ---FILE-- - array("pipe", "r"), - 1 => array("pipe", "w"), - 2 => array("pipe", "w") - ); - -$cat = proc_open( - "/bin/cat", - $ds, - $pipes - ); - -proc_close($cat); - -echo "I didn't segfault!\n"; - -?> ---EXPECT-- -I didn't segfault! diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt deleted file mode 100644 index a9711ffc34ee5..0000000000000 --- a/ext/standard/tests/general_functions/sunfuncts.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -date_sunrise() and date_sunset() functions ---INI-- -precision=13 ---FILE-- - ---EXPECT-- -1041316748 06:39 6.652455761896 -1041353169 16:46 16.76937486746 -1043994763 06:32 6.54537029266 -1044033183 17:13 17.21752470874 -1046412416 06:06 6.115652675685 -1046453799 17:36 17.6108549623 -1049088501 05:28 5.472742029069 -1049133501 17:58 17.97255258437 -1051678444 04:54 4.901229982859 -1051726729 18:18 18.31368876948 -1054355667 04:34 4.57442928945 -1054406363 18:39 18.65640094324 -1056947818 04:36 4.616120450519 -1056998911 18:48 18.80887165777 -1059627264 04:54 4.906882509836 -1059676557 18:35 18.59928600203 -1062306852 05:14 5.236889557074 -1062353017 18:03 18.06054178788 -1064899952 05:32 5.542366581139 -1064942681 17:24 17.41150561492 -1067579698 05:54 5.916208842058 -1067619001 16:50 16.83369857063 -1070173246 06:20 6.34622155207 -1070210100 16:35 16.58358905554 diff --git a/ext/standard/tests/image/246x247.png b/ext/standard/tests/image/246x247.png deleted file mode 100644 index 648a64e0aa83d..0000000000000 Binary files a/ext/standard/tests/image/246x247.png and /dev/null differ diff --git a/ext/standard/tests/image/384x385.png b/ext/standard/tests/image/384x385.png deleted file mode 100644 index 843ddfaf08e32..0000000000000 Binary files a/ext/standard/tests/image/384x385.png and /dev/null differ diff --git a/ext/standard/tests/image/bug13213.jpg b/ext/standard/tests/image/bug13213.jpg deleted file mode 100644 index b90c7a4059fc8..0000000000000 Binary files a/ext/standard/tests/image/bug13213.jpg and /dev/null differ diff --git a/ext/standard/tests/image/bug13213.phpt b/ext/standard/tests/image/bug13213.phpt deleted file mode 100644 index a191905847038..0000000000000 --- a/ext/standard/tests/image/bug13213.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #13213 (GetImageSize and wrong JPEG Comments) ---FILE-- - ---EXPECT-- -array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - string(20) "width="1" height="1"" - ["bits"]=> - int(8) - ["channels"]=> - int(3) - ["mime"]=> - string(10) "image/jpeg" -} ---UEXPECT-- -array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - unicode(20) "width="1" height="1"" - [u"bits"]=> - int(8) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(10) "image/jpeg" -} diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt deleted file mode 100644 index 368da04ceaddf..0000000000000 --- a/ext/standard/tests/image/getimagesize.phpt +++ /dev/null @@ -1,368 +0,0 @@ ---TEST-- -GetImageSize() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(11) { - ["test1pix.bmp"]=> - array(6) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(6) - [3]=> - string(20) "width="1" height="1"" - ["bits"]=> - int(24) - ["mime"]=> - string(9) "image/bmp" - } - ["test1pix.jp2"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(10) - [3]=> - string(20) "width="1" height="1"" - ["bits"]=> - int(8) - ["channels"]=> - int(3) - ["mime"]=> - string(9) "image/jp2" - } - ["test1pix.jpc"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(9) - [3]=> - string(20) "width="1" height="1"" - ["bits"]=> - int(8) - ["channels"]=> - int(3) - ["mime"]=> - string(24) "application/octet-stream" - } - ["test1pix.jpg"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - string(20) "width="1" height="1"" - ["bits"]=> - int(8) - ["channels"]=> - int(3) - ["mime"]=> - string(10) "image/jpeg" - } - ["test2pix.gif"]=> - array(7) { - [0]=> - int(2) - [1]=> - int(1) - [2]=> - int(1) - [3]=> - string(20) "width="2" height="1"" - ["bits"]=> - int(1) - ["channels"]=> - int(3) - ["mime"]=> - string(9) "image/gif" - } - ["test4pix.gif"]=> - array(7) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(1) - [3]=> - string(20) "width="4" height="1"" - ["bits"]=> - int(2) - ["channels"]=> - int(3) - ["mime"]=> - string(9) "image/gif" - } - ["test4pix.iff"]=> - array(6) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(14) - [3]=> - string(20) "width="4" height="1"" - ["bits"]=> - int(4) - ["mime"]=> - string(9) "image/iff" - } - ["test4pix.png"]=> - array(6) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(3) - [3]=> - string(20) "width="4" height="1"" - ["bits"]=> - int(4) - ["mime"]=> - string(9) "image/png" - } - ["test4pix.psd"]=> - array(5) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(5) - [3]=> - string(20) "width="4" height="1"" - ["mime"]=> - string(9) "image/psd" - } - ["test4pix.swf"]=> - array(5) { - [0]=> - int(550) - [1]=> - int(400) - [2]=> - int(4) - [3]=> - string(24) "width="550" height="400"" - ["mime"]=> - string(29) "application/x-shockwave-flash" - } - ["test4pix.tif"]=> - array(5) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(7) - [3]=> - string(20) "width="4" height="1"" - ["mime"]=> - string(10) "image/tiff" - } -} ---UEXPECT-- -array(11) { - [u"test1pix.bmp"]=> - array(6) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(6) - [3]=> - unicode(20) "width="1" height="1"" - [u"bits"]=> - int(24) - [u"mime"]=> - unicode(9) "image/bmp" - } - [u"test1pix.jp2"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(10) - [3]=> - unicode(20) "width="1" height="1"" - [u"bits"]=> - int(8) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(9) "image/jp2" - } - [u"test1pix.jpc"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(9) - [3]=> - unicode(20) "width="1" height="1"" - [u"bits"]=> - int(8) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(24) "application/octet-stream" - } - [u"test1pix.jpg"]=> - array(7) { - [0]=> - int(1) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - unicode(20) "width="1" height="1"" - [u"bits"]=> - int(8) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(10) "image/jpeg" - } - [u"test2pix.gif"]=> - array(7) { - [0]=> - int(2) - [1]=> - int(1) - [2]=> - int(1) - [3]=> - unicode(20) "width="2" height="1"" - [u"bits"]=> - int(1) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(9) "image/gif" - } - [u"test4pix.gif"]=> - array(7) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(1) - [3]=> - unicode(20) "width="4" height="1"" - [u"bits"]=> - int(2) - [u"channels"]=> - int(3) - [u"mime"]=> - unicode(9) "image/gif" - } - [u"test4pix.iff"]=> - array(6) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(14) - [3]=> - unicode(20) "width="4" height="1"" - [u"bits"]=> - int(4) - [u"mime"]=> - unicode(9) "image/iff" - } - [u"test4pix.png"]=> - array(6) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(3) - [3]=> - unicode(20) "width="4" height="1"" - [u"bits"]=> - int(4) - [u"mime"]=> - unicode(9) "image/png" - } - [u"test4pix.psd"]=> - array(5) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(5) - [3]=> - unicode(20) "width="4" height="1"" - [u"mime"]=> - unicode(9) "image/psd" - } - [u"test4pix.swf"]=> - array(5) { - [0]=> - int(550) - [1]=> - int(400) - [2]=> - int(4) - [3]=> - unicode(24) "width="550" height="400"" - [u"mime"]=> - unicode(29) "application/x-shockwave-flash" - } - [u"test4pix.tif"]=> - array(5) { - [0]=> - int(4) - [1]=> - int(1) - [2]=> - int(7) - [3]=> - unicode(20) "width="4" height="1"" - [u"mime"]=> - unicode(10) "image/tiff" - } -} diff --git a/ext/standard/tests/image/getimagesize_246x247.phpt b/ext/standard/tests/image/getimagesize_246x247.phpt deleted file mode 100644 index 6f1c44124d119..0000000000000 --- a/ext/standard/tests/image/getimagesize_246x247.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -GetImageSize() with 246x247 pixels ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(1) { - ["246x247.png"]=> - array(6) { - [0]=> - int(246) - [1]=> - int(247) - [2]=> - int(3) - [3]=> - string(24) "width="246" height="247"" - ["bits"]=> - int(4) - ["mime"]=> - string(9) "image/png" - } -} ---UEXPECT-- -array(1) { - [u"246x247.png"]=> - array(6) { - [0]=> - int(246) - [1]=> - int(247) - [2]=> - int(3) - [3]=> - unicode(24) "width="246" height="247"" - [u"bits"]=> - int(4) - [u"mime"]=> - unicode(9) "image/png" - } -} diff --git a/ext/standard/tests/image/getimagesize_384x385.phpt b/ext/standard/tests/image/getimagesize_384x385.phpt deleted file mode 100644 index a75c8e051a354..0000000000000 --- a/ext/standard/tests/image/getimagesize_384x385.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -GetImageSize() with 384x385 pixels ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(1) { - ["384x385.png"]=> - array(6) { - [0]=> - int(384) - [1]=> - int(385) - [2]=> - int(3) - [3]=> - string(24) "width="384" height="385"" - ["bits"]=> - int(1) - ["mime"]=> - string(9) "image/png" - } -} ---UEXPECT-- -array(1) { - [u"384x385.png"]=> - array(6) { - [0]=> - int(384) - [1]=> - int(385) - [2]=> - int(3) - [3]=> - unicode(24) "width="384" height="385"" - [u"bits"]=> - int(1) - [u"mime"]=> - unicode(9) "image/png" - } -} diff --git a/ext/standard/tests/image/getimagesize_swc.phpt b/ext/standard/tests/image/getimagesize_swc.phpt deleted file mode 100644 index 516164d7a98e3..0000000000000 --- a/ext/standard/tests/image/getimagesize_swc.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -GetImageSize() for compressed swf files ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(550) - [1]=> - int(400) - [2]=> - int(13) - [3]=> - string(24) "width="550" height="400"" - ["mime"]=> - string(29) "application/x-shockwave-flash" -} ---UEXPECT-- -array(5) { - [0]=> - int(550) - [1]=> - int(400) - [2]=> - int(13) - [3]=> - unicode(24) "width="550" height="400"" - [u"mime"]=> - unicode(29) "application/x-shockwave-flash" -} diff --git a/ext/standard/tests/image/image_type_to_mime_type.phpt b/ext/standard/tests/image/image_type_to_mime_type.phpt deleted file mode 100644 index d241aaf4edeb6..0000000000000 --- a/ext/standard/tests/image/image_type_to_mime_type.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -image_type_to_mime_type() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(11) { - ["test1pix.bmp"]=> - string(9) "image/bmp" - ["test1pix.jp2"]=> - string(9) "image/jp2" - ["test1pix.jpc"]=> - string(24) "application/octet-stream" - ["test1pix.jpg"]=> - string(10) "image/jpeg" - ["test2pix.gif"]=> - string(9) "image/gif" - ["test4pix.gif"]=> - string(9) "image/gif" - ["test4pix.iff"]=> - string(9) "image/iff" - ["test4pix.png"]=> - string(9) "image/png" - ["test4pix.psd"]=> - string(9) "image/psd" - ["test4pix.swf"]=> - string(29) "application/x-shockwave-flash" - ["test4pix.tif"]=> - string(10) "image/tiff" -} ---UEXPECT-- -array(11) { - [u"test1pix.bmp"]=> - unicode(9) "image/bmp" - [u"test1pix.jp2"]=> - unicode(9) "image/jp2" - [u"test1pix.jpc"]=> - unicode(24) "application/octet-stream" - [u"test1pix.jpg"]=> - unicode(10) "image/jpeg" - [u"test2pix.gif"]=> - unicode(9) "image/gif" - [u"test4pix.gif"]=> - unicode(9) "image/gif" - [u"test4pix.iff"]=> - unicode(9) "image/iff" - [u"test4pix.png"]=> - unicode(9) "image/png" - [u"test4pix.psd"]=> - unicode(9) "image/psd" - [u"test4pix.swf"]=> - unicode(29) "application/x-shockwave-flash" - [u"test4pix.tif"]=> - unicode(10) "image/tiff" -} \ No newline at end of file diff --git a/ext/standard/tests/image/skipif_imagetype.inc b/ext/standard/tests/image/skipif_imagetype.inc deleted file mode 100644 index 827f10c17992a..0000000000000 --- a/ext/standard/tests/image/skipif_imagetype.inc +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/ext/standard/tests/image/test13pix.swf b/ext/standard/tests/image/test13pix.swf deleted file mode 100755 index 0d40cb743e22a..0000000000000 Binary files a/ext/standard/tests/image/test13pix.swf and /dev/null differ diff --git a/ext/standard/tests/image/test1pix.bmp b/ext/standard/tests/image/test1pix.bmp deleted file mode 100644 index f3799d2d1e8b1..0000000000000 Binary files a/ext/standard/tests/image/test1pix.bmp and /dev/null differ diff --git a/ext/standard/tests/image/test1pix.jp2 b/ext/standard/tests/image/test1pix.jp2 deleted file mode 100644 index 8a1172e10d96f..0000000000000 Binary files a/ext/standard/tests/image/test1pix.jp2 and /dev/null differ diff --git a/ext/standard/tests/image/test1pix.jpc b/ext/standard/tests/image/test1pix.jpc deleted file mode 100644 index ac11c6bc814b2..0000000000000 Binary files a/ext/standard/tests/image/test1pix.jpc and /dev/null differ diff --git a/ext/standard/tests/image/test1pix.jpg b/ext/standard/tests/image/test1pix.jpg deleted file mode 100644 index 121decb65ad30..0000000000000 Binary files a/ext/standard/tests/image/test1pix.jpg and /dev/null differ diff --git a/ext/standard/tests/image/test2pix.gif b/ext/standard/tests/image/test2pix.gif deleted file mode 100644 index c4d4483544f71..0000000000000 Binary files a/ext/standard/tests/image/test2pix.gif and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.gif b/ext/standard/tests/image/test4pix.gif deleted file mode 100644 index a02ebe9784b1c..0000000000000 Binary files a/ext/standard/tests/image/test4pix.gif and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.iff b/ext/standard/tests/image/test4pix.iff deleted file mode 100644 index fe9daebbae5b5..0000000000000 Binary files a/ext/standard/tests/image/test4pix.iff and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.png b/ext/standard/tests/image/test4pix.png deleted file mode 100644 index 2b75ac5fb2fe1..0000000000000 Binary files a/ext/standard/tests/image/test4pix.png and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.psd b/ext/standard/tests/image/test4pix.psd deleted file mode 100644 index 4c378239d7693..0000000000000 Binary files a/ext/standard/tests/image/test4pix.psd and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.swf b/ext/standard/tests/image/test4pix.swf deleted file mode 100755 index b1d41c6766fa1..0000000000000 Binary files a/ext/standard/tests/image/test4pix.swf and /dev/null differ diff --git a/ext/standard/tests/image/test4pix.tif b/ext/standard/tests/image/test4pix.tif deleted file mode 100644 index 13367ee1738ba..0000000000000 Binary files a/ext/standard/tests/image/test4pix.tif and /dev/null differ diff --git a/ext/standard/tests/math/abs.phpt b/ext/standard/tests/math/abs.phpt deleted file mode 100644 index f5c26c3037143..0000000000000 --- a/ext/standard/tests/math/abs.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Simple math tests ---FILE-- - ---EXPECT-- -string(2775) "-2,000.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -OK diff --git a/ext/standard/tests/math/bug24142.phpt b/ext/standard/tests/math/bug24142.phpt deleted file mode 100644 index 244952369d824..0000000000000 --- a/ext/standard/tests/math/bug24142.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #24142 (round() problems) ---FILE-- - ".round($v, 2)."\n"; - $v += 0.01; -} -?> ---EXPECT-- -round(0.005, 2) -> 0.01 -round(0.015, 2) -> 0.02 -round(0.025, 2) -> 0.03 -round(0.035, 2) -> 0.04 -round(0.045, 2) -> 0.05 -round(0.055, 2) -> 0.06 -round(0.065, 2) -> 0.07 -round(0.075, 2) -> 0.08 -round(0.085, 2) -> 0.09 diff --git a/ext/standard/tests/math/bug25665.phpt b/ext/standard/tests/math/bug25665.phpt deleted file mode 100644 index 469236c943d5a..0000000000000 --- a/ext/standard/tests/math/bug25665.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #25665 (var_dump () hangs on Nan and INF) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -float(NAN) -float(-INF) diff --git a/ext/standard/tests/math/bug25694.phpt b/ext/standard/tests/math/bug25694.phpt deleted file mode 100644 index 165e1db0830d7..0000000000000 --- a/ext/standard/tests/math/bug25694.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #25694 (round() and number_format() inconsistency) ---FILE-- - ---EXPECT-- -round 0.045 = 0.05 -number format 0.045 = 0.05 - -round 0.055 = 0.06 -number format 0.055 = 0.06 - -round 5.045 = 5.05 -number format 5.045 = 5.05 - -round 5.055 = 5.06 -number format 5.055 = 5.06 - -round 3.025 = 3.03 -number format 3.025 = 3.03 - -round 4.025 = 4.03 -number format 4.025 = 4.03 diff --git a/ext/standard/tests/math/bug27646.phpt b/ext/standard/tests/math/bug27646.phpt deleted file mode 100755 index 7b4a923f1f011..0000000000000 --- a/ext/standard/tests/math/bug27646.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #27646 (Cannot serialize/unserialize non-finite numeric values) ---FILE-- - ---EXPECTF-- -float(1%f) -string(%d) "d:1%s;" -float(1%f) -float(-1%f) -string(%d) "d:-1%s;" -float(-1%f) -float(-INF) -string(7) "d:-INF;" -float(-INF) -float(INF) -string(6) "d:INF;" -float(INF) -float(NAN) -string(6) "d:NAN;" -float(NAN) diff --git a/ext/standard/tests/math/bug28228.phpt b/ext/standard/tests/math/bug28228.phpt deleted file mode 100755 index 4223f4bc15f24..0000000000000 --- a/ext/standard/tests/math/bug28228.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #28228 (number_format() does not allow empty decimal separator) ---FILE-- - ---EXPECT-- -12345678 -1,234.5678 -1,23405678 -1,234.5678 diff --git a/ext/standard/tests/math/bug30069.phpt b/ext/standard/tests/math/bug30069.phpt deleted file mode 100755 index 5e3246c51cc97..0000000000000 --- a/ext/standard/tests/math/bug30069.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #30069 (floats as strings used in calculations do not work) ---FILE-- - ---EXPECT-- -0.2 --0.2 diff --git a/ext/standard/tests/math/bug30695.phpt b/ext/standard/tests/math/bug30695.phpt deleted file mode 100644 index c515784ee2aca..0000000000000 --- a/ext/standard/tests/math/bug30695.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Bug #30695 (32 bit issues) ---FILE-- -> 6) & 0x1f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xffff0000): // 16 bit - $char = ( chr(0xe0 | (($char_code >> 12) & 0x0f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xffe00000): // 21 bit - $char = ( chr(0xf0 | (($char_code >> 18) & 0x07)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xfc000000): // 26 bit - $char = ( chr(0xf8 | (($char_code >> 24) & 0x03)) . - chr(0x80 | (($char_code >> 18) & 0x3f)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - default: // 31 bit - $char = ( chr(0xfc | (($char_code >> 30) & 0x01)) . - chr(0x80 | (($char_code >> 24) & 0x3f)) . - chr(0x80 | (($char_code >> 18) & 0x3f)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - } - return $char; - } - - - echo "\n", toUTF8(65), "\n", toUTF8(233), "\n", toUTF8(1252), "\n", toUTF8(20095), "\n"; -?> ---EXPECT-- - -A -İ -Ó¤ -äıż diff --git a/ext/standard/tests/math/floorceil.phpt b/ext/standard/tests/math/floorceil.phpt deleted file mode 100644 index 2f7d82c6e6212..0000000000000 --- a/ext/standard/tests/math/floorceil.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Tests for floor en ceil ---FILE-- - ---EXPECT-- -float(0) -float(-1) -float(-1) -float(-1) -float(-2) -float(0) -float(1) -float(1) -float(2) -float(2) -float(3) -float(0) -float(-1) -float(-1) -float(-2) -float(-2) -float(-3) -float(0) -float(0) -float(1) -float(1) -float(1) -float(2) diff --git a/ext/standard/tests/math/hexdec.phpt b/ext/standard/tests/math/hexdec.phpt deleted file mode 100644 index d8ff71f1ceb56..0000000000000 --- a/ext/standard/tests/math/hexdec.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -overflow check for _php_math_basetozval ---FILE-- - ---EXPECT-- -int(74565) -int(74565) -int(74565) -int(74565) -int(74565) -float(78187069441) -float(6442450943) diff --git a/ext/standard/tests/math/log.phpt b/ext/standard/tests/math/log.phpt deleted file mode 100644 index 4f8b47a76b6c1..0000000000000 --- a/ext/standard/tests/math/log.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -log() tests ---FILE-- - ($x - 2))) { - $count++; - } else { - print "$x : $x2\n"; - } -} -print $count . "\n"; - -// Now test the base form of log -for ($base = 2; $base < 11; $base++) { - for ($x = 0, $count= 0; $x < 50; $x++) { - $x2 = (int) pow($base, log($x, $base)); - // base ^ log(x) should be close in range to x - if (($x2 < ($x + 2)) && ($x2 > ($x - 2))) { - $count++; - } else { - print "base $base: $x : $x2\n"; - } - } - print $count . "\n"; -} -?> ---EXPECT-- -On failure, please mail result to php-dev@lists.php.net -200 -50 -50 -50 -50 -50 -50 -50 -50 -50 diff --git a/ext/standard/tests/math/pow.phpt b/ext/standard/tests/math/pow.phpt deleted file mode 100644 index a1e894483092c..0000000000000 --- a/ext/standard/tests/math/pow.phpt +++ /dev/null @@ -1,149 +0,0 @@ ---TEST-- -Various pow() tests ---FILE-- -\n"; -} -else { - /* Likewise, writes will always appear to succeed */ - $x = fwrite($fp,"\n"); - var_dump($x); - /* But reads should always fail */ - $content = fread($fp, 40); - var_dump($content); - fclose($fp); -} -?> ---EXPECT-- -int(1) -bool(false) diff --git a/ext/standard/tests/network/tcp4loop.phpt b/ext/standard/tests/network/tcp4loop.phpt deleted file mode 100644 index afd955918e8fb..0000000000000 --- a/ext/standard/tests/network/tcp4loop.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Streams Based IPv4 TCP Loopback test ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/network/tcp6loop.phpt b/ext/standard/tests/network/tcp6loop.phpt deleted file mode 100644 index 3f28cd44377b5..0000000000000 --- a/ext/standard/tests/network/tcp6loop.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Streams Based IPv6 TCP Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/network/udgloop.phpt b/ext/standard/tests/network/udgloop.phpt deleted file mode 100644 index a61d082c189b9..0000000000000 --- a/ext/standard/tests/network/udgloop.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Streams Based Unix Domain Datagram Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/network/udp4loop.phpt b/ext/standard/tests/network/udp4loop.phpt deleted file mode 100644 index 10d36ed73fc7f..0000000000000 --- a/ext/standard/tests/network/udp4loop.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Streams Based IPv4 UDP Loopback test ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/network/udp6loop.phpt b/ext/standard/tests/network/udp6loop.phpt deleted file mode 100644 index 5fcf7a7f46cd3..0000000000000 --- a/ext/standard/tests/network/udp6loop.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Streams Based IPv6 UDP Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/network/unixloop.phpt b/ext/standard/tests/network/unixloop.phpt deleted file mode 100644 index abb103b0d14ca..0000000000000 --- a/ext/standard/tests/network/unixloop.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Streams Based Unix Domain Loopback test ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(10) "ABCdef123 -" diff --git a/ext/standard/tests/reg/001.phpt b/ext/standard/tests/reg/001.phpt deleted file mode 100644 index 13c50d0d1e458..0000000000000 --- a/ext/standard/tests/reg/001.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -RegReplace test 1 ---FILE-- - ---EXPECT-- -abcdef diff --git a/ext/standard/tests/reg/002.phpt b/ext/standard/tests/reg/002.phpt deleted file mode 100644 index abe9e063d8b76..0000000000000 --- a/ext/standard/tests/reg/002.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -RegReplace test 2 ---FILE-- - ---EXPECT-- -abc diff --git a/ext/standard/tests/reg/003.phpt b/ext/standard/tests/reg/003.phpt deleted file mode 100644 index 4257f0d27e78d..0000000000000 --- a/ext/standard/tests/reg/003.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -ereg_replace single-quote test ---FILE-- - ---EXPECT-- -'test diff --git a/ext/standard/tests/reg/004.phpt b/ext/standard/tests/reg/004.phpt deleted file mode 100644 index 3e535c6a9de40..0000000000000 --- a/ext/standard/tests/reg/004.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -simple ereg test ---FILE-- - ---EXPECT-- -ok -ok diff --git a/ext/standard/tests/reg/005.phpt b/ext/standard/tests/reg/005.phpt deleted file mode 100644 index ee9ccc6da4afc..0000000000000 --- a/ext/standard/tests/reg/005.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test Regular expression register support in ereg ---FILE-- - ---EXPECT-- -32 -This is a nice and simple string -is -is diff --git a/ext/standard/tests/reg/006.phpt b/ext/standard/tests/reg/006.phpt deleted file mode 100644 index cae349672ed76..0000000000000 --- a/ext/standard/tests/reg/006.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Test ereg_replace of start-of-line ---FILE-- - ---EXPECT-- -That is a nice and simple string diff --git a/ext/standard/tests/reg/007.phpt b/ext/standard/tests/reg/007.phpt deleted file mode 100644 index beb3cdc159176..0000000000000 --- a/ext/standard/tests/reg/007.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Test empty result buffer in reg_replace ---FILE-- - ---EXPECT-- -strlen($b)=0 diff --git a/ext/standard/tests/reg/008.phpt b/ext/standard/tests/reg/008.phpt deleted file mode 100644 index 9a0cedabc5338..0000000000000 --- a/ext/standard/tests/reg/008.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Test back-references in regular expressions ---FILE-- - ---EXPECT-- -123 abc +-|= diff --git a/ext/standard/tests/reg/009.phpt b/ext/standard/tests/reg/009.phpt deleted file mode 100644 index 528606f3c897d..0000000000000 --- a/ext/standard/tests/reg/009.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test split() ---FILE-- - ---EXPECT-- -4 -this -is -a -test diff --git a/ext/standard/tests/reg/010.phpt b/ext/standard/tests/reg/010.phpt deleted file mode 100644 index f6f8909f73d7b..0000000000000 --- a/ext/standard/tests/reg/010.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -Long back references ---FILE-- - ---EXPECT-- -abc2222222222def2222222222 diff --git a/ext/standard/tests/reg/011.phpt b/ext/standard/tests/reg/011.phpt deleted file mode 100644 index 65554b302fc6a..0000000000000 --- a/ext/standard/tests/reg/011.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -\0 back reference ---FILE-- - ---EXPECT-- -abcdef123ghi diff --git a/ext/standard/tests/reg/012.phpt b/ext/standard/tests/reg/012.phpt deleted file mode 100644 index 88ad5992addf9..0000000000000 --- a/ext/standard/tests/reg/012.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -nonexisting back reference ---FILE-- - ---EXPECT-- -abcdef\1ghi diff --git a/ext/standard/tests/reg/013.phpt b/ext/standard/tests/reg/013.phpt deleted file mode 100644 index a2d9ee009910e..0000000000000 --- a/ext/standard/tests/reg/013.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -escapes in replace string ---FILE-- - ---EXPECT-- -abcdef\g\\hi\ diff --git a/ext/standard/tests/reg/014.phpt b/ext/standard/tests/reg/014.phpt deleted file mode 100644 index d2a32451a9d94..0000000000000 --- a/ext/standard/tests/reg/014.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -backreferences not replaced recursively ---FILE-- - ---EXPECT-- -\2 diff --git a/ext/standard/tests/reg/015.phpt b/ext/standard/tests/reg/015.phpt deleted file mode 100644 index c255ddf05bb9f..0000000000000 --- a/ext/standard/tests/reg/015.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -replace empty matches ---FILE-- - ---EXPECT-- -zabc123 diff --git a/ext/standard/tests/reg/016.phpt b/ext/standard/tests/reg/016.phpt deleted file mode 100644 index c354ab26fc5f2..0000000000000 --- a/ext/standard/tests/reg/016.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -test backslash handling in regular expressions ---FILE-- - ---EXPECT-- -abc123abc diff --git a/ext/standard/tests/serialize/001.phpt b/ext/standard/tests/serialize/001.phpt deleted file mode 100644 index 21a2d6c5347a5..0000000000000 --- a/ext/standard/tests/serialize/001.phpt +++ /dev/null @@ -1,120 +0,0 @@ ---TEST-- -serialize()/unserialize()/var_dump() ---FILE-- -a = "hallo"; - } -} - -class s -{ - public $a; - public $b; - public $c; - - function s() - { - $this->a = "hallo"; - $this->b = "php"; - $this->c = "world"; - $this->d = "!"; - } - - function __sleep() - { - echo "__sleep called\n"; - return array("a","c"); - } - - function __wakeup() - { - echo "__wakeup called\n"; - } -} - - -echo serialize(NULL)."\n"; -echo serialize((bool) true)."\n"; -echo serialize((bool) false)."\n"; -echo serialize(1)."\n"; -echo serialize(0)."\n"; -echo serialize(-1)."\n"; -echo serialize(2147483647)."\n"; -echo serialize(-2147483647)."\n"; -echo serialize(1.123456789)."\n"; -echo serialize(1.0)."\n"; -echo serialize(0.0)."\n"; -echo serialize(-1.0)."\n"; -echo serialize(-1.123456789)."\n"; -echo serialize("hallo")."\n"; -echo serialize(array(1,1.1,"hallo",NULL,true,array()))."\n"; - -$t = new t(); -$data = serialize($t); -echo "$data\n"; -$t = unserialize($data); -var_dump($t); - -$t = new s(); -$data = serialize($t); -echo "$data\n"; -$t = unserialize($data); -var_dump($t); - -$a = array("a" => "test"); -$a[ "b" ] = &$a[ "a" ]; -var_dump($a); -$data = serialize($a); -echo "$data\n"; -$a = unserialize($data); -var_dump($a); -?> ---EXPECTF-- -N; -b:1; -b:0; -i:1; -i:0; -i:-1; -i:2147483647; -i:-2147483647; -d:1.123456789000000011213842299184761941432952880859375; -d:1; -d:0; -d:-1; -d:-1.123456789000000011213842299184761941432952880859375; -s:5:"hallo"; -a:6:{i:0;i:1;i:1;d:1.100000000000000088817841970012523233890533447265625;i:2;s:5:"hallo";i:3;N;i:4;b:1;i:5;a:0:{}} -O:1:"t":1:{s:1:"a";s:5:"hallo";} -object(t)#%d (1) { - ["a"]=> - string(5) "hallo" -} -__sleep called -O:1:"s":2:{s:1:"a";s:5:"hallo";s:1:"c";s:5:"world";} -__wakeup called -object(s)#%d (3) { - ["a"]=> - string(5) "hallo" - ["b"]=> - NULL - ["c"]=> - string(5) "world" -} -array(2) { - ["a"]=> - &string(4) "test" - ["b"]=> - &string(4) "test" -} -a:2:{s:1:"a";s:4:"test";s:1:"b";R:2;} -array(2) { - ["a"]=> - &string(4) "test" - ["b"]=> - &string(4) "test" -} diff --git a/ext/standard/tests/serialize/002.phpt b/ext/standard/tests/serialize/002.phpt deleted file mode 100644 index 3085d1cf4f76a..0000000000000 --- a/ext/standard/tests/serialize/002.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #25378 (unserialize() crashes with invalid data) ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(true) -int(823) -string(0) "" -string(3) "foo" -array(1) { - [0]=> - string(2) "12" -} -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} -array(3) { - [0]=> - string(3) "foo" - [1]=> - string(3) "bar" - [2]=> - string(3) "baz" -} -object(stdClass)#%d (0) { -} -===DONE=== diff --git a/ext/standard/tests/serialize/003.phpt b/ext/standard/tests/serialize/003.phpt deleted file mode 100644 index 173f57b72c1c5..0000000000000 --- a/ext/standard/tests/serialize/003.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -unserialize() floats with E notation (#18654) ---INI-- -precision=12 -serialize_precision=100 ---FILE-- - ---EXPECTREGEX-- -d:100; -float\(100\) - -d:5\.2E\+25; -float\(5\.2E\+25\) - -d:8\.52[89][0-9]+E-22; -float\(8\.529E-22\) - -d:9\.[0-9]*E-9; -float\(9\.0E-9\) diff --git a/ext/standard/tests/serialize/004.phpt b/ext/standard/tests/serialize/004.phpt deleted file mode 100644 index a4a7c68d6f9e7..0000000000000 --- a/ext/standard/tests/serialize/004.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -serialize()/unserialize() floats in array. ---INI-- -precision=12 -serialize_precision=100 ---FILE-- - ---EXPECT-- -Serialized array: a:1:{i:0;i:4;} -Unserialized array: array(1) { - [0]=> - int(4) -} - -Serialized array: a:1:{i:0;d:4.5;} -Unserialized array: array(1) { - [0]=> - float(4.5) -} diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt deleted file mode 100755 index d67f6fbf70262..0000000000000 --- a/ext/standard/tests/serialize/005.phpt +++ /dev/null @@ -1,186 +0,0 @@ ---TEST-- -serialize()/unserialize() objects ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -===O1=== -TestOld::__sleep() -string(18) "O:7:"TestOld":0:{}" -TestOld::__wakeup() -object(TestOld)#%d (0) { -} -===N1=== -TestNew::serialize() -string(2) "N;" -NULL -===N2=== -TestNew::serialize() -string(19) "C:7:"TestNew":1:{2}" -TestNew::unserialize() -object(TestNew)#%d (0) { -} -===NAOld=== -unserializer(TestNAOld) -TestOld::__wakeup() -object(TestNAOld)#%d (0) { -} -===NANew=== -unserializer(TestNANew) -TestNew::__wakeup() -object(TestNANew)#%d (0) { -} -===NANew2=== -unserializer(TestNANew2) -TestNew::unserialize() -object(TestNANew2)#%d (0) { -} -===AutoOld=== -unserializer(autoload_implements) -Try __autoload() -do_autoload(autoload_interface) -do_autoload(autoload_implements) -object(autoload_implements)#%d (0) { -} -===AutoNA=== -do_autoload(autoload_not_available) -unserializer(autoload_not_available) -Try __autoload() -do_autoload(autoload_not_available) -do_autoload(autoload_not_available) - -Warning: unserialize(): Function unserializer() hasn't defined the class it was called for in %s005.php on line %d -object(__PHP_Incomplete_Class)#1 (1) { - ["__PHP_Incomplete_Class_Name"]=> - string(22) "autoload_not_available" -} -===DONE=== diff --git a/ext/standard/tests/serialize/006.phpt b/ext/standard/tests/serialize/006.phpt deleted file mode 100644 index e9b58e7a070ba..0000000000000 --- a/ext/standard/tests/serialize/006.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -serialize()/unserialize() with exotic letters ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - 'ċäöĊÄÖ'); - - class ÜberKööliäċ - { - public $ċäöĊÄÖüÜber = 'ċäöĊÄÖ'; - } - - $foo = new Überkööliäċ(); - - var_dump(serialize($foo)); - var_dump(unserialize(serialize($foo))); - var_dump(serialize($ċäöĊÄÖ)); - var_dump(unserialize(serialize($ċäöĊÄÖ))); -?> ---EXPECT-- -string(55) "O:11:"ÜberKööliäċ":1:{s:11:"ċäöĊÄÖüÜber";s:6:"ċäöĊÄÖ";}" -object(ÜberKööliäċ)#2 (1) { - ["ċäöĊÄÖüÜber"]=> - string(6) "ċäöĊÄÖ" -} -string(32) "a:1:{s:6:"ċäöĊÄÖ";s:6:"ċäöĊÄÖ";}" -array(1) { - ["ċäöĊÄÖ"]=> - string(6) "ċäöĊÄÖ" -} diff --git a/ext/standard/tests/serialize/autoload_implements.p5c b/ext/standard/tests/serialize/autoload_implements.p5c deleted file mode 100755 index 2c3479c860787..0000000000000 --- a/ext/standard/tests/serialize/autoload_implements.p5c +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/ext/standard/tests/serialize/autoload_interface.p5c b/ext/standard/tests/serialize/autoload_interface.p5c deleted file mode 100755 index 6908155e610e8..0000000000000 --- a/ext/standard/tests/serialize/autoload_interface.p5c +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/ext/standard/tests/serialize/bug14293.phpt b/ext/standard/tests/serialize/bug14293.phpt deleted file mode 100644 index 3fca7e406edcf..0000000000000 --- a/ext/standard/tests/serialize/bug14293.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #14293 (serialize() and __sleep()) ---FILE-- -a = 'hello'; - } - - function __sleep() - { - echo "__sleep called\n"; - return array('a','b'); - } -} - -$t = new t(); -$data = serialize($t); -echo "$data\n"; -$t = unserialize($data); -var_dump($t); - -?> ---EXPECTF-- -__sleep called - -Notice: serialize(): "b" returned as member variable from __sleep() but does not exist in %sbug14293.php on line %d -O:1:"t":2:{s:1:"a";s:5:"hello";s:1:"b";N;} -object(t)#%d (2) { - ["a"]=> - string(5) "hello" - ["b"]=> - NULL -} diff --git a/ext/standard/tests/serialize/bug21957.phpt b/ext/standard/tests/serialize/bug21957.phpt deleted file mode 100644 index 29eeb2ee6c721..0000000000000 --- a/ext/standard/tests/serialize/bug21957.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #21957 (serialize() mangles objects with __sleep) ---FILE-- -a = 7; - $this->b = 2; - } - - function __sleep() - { - $this->b = 0; - } -} - -$t['one'] = 'ABC'; -$t['two'] = new test(); - -var_dump($t); - -$s = @serialize($t); -echo $s . "\n"; - -var_dump(unserialize($s)); -?> ---EXPECT-- -array(2) { - ["one"]=> - string(3) "ABC" - ["two"]=> - object(test)#1 (2) { - ["a"]=> - int(7) - ["b"]=> - int(2) - } -} -a:2:{s:3:"one";s:3:"ABC";s:3:"two";N;} -array(2) { - ["one"]=> - string(3) "ABC" - ["two"]=> - NULL -} diff --git a/ext/standard/tests/serialize/bug23298.phpt b/ext/standard/tests/serialize/bug23298.phpt deleted file mode 100644 index a5305cf37c924..0000000000000 --- a/ext/standard/tests/serialize/bug23298.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #23298 (serialize() and floats/doubles) ---INI-- -serialize_precision=100 ---FILE-- - ---EXPECT-- -bool(true) diff --git a/ext/standard/tests/serialize/bug24063.phpt b/ext/standard/tests/serialize/bug24063.phpt deleted file mode 100644 index e1cdfecf557ba..0000000000000 --- a/ext/standard/tests/serialize/bug24063.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #24063 (serialize() missing 0 after the . on scientific notation) ---INI-- -serialize_precision=100 -precision=12 ---FILE-- - ---EXPECT-- -0.1 0.1 -0.01 0.01 -0.001 0.001 -0.0001 0.0001 -1E-05 1E-05 -1E-06 1E-06 -1E-07 1E-07 -1E-08 1E-08 -1E-09 1E-09 diff --git a/ext/standard/tests/serialize/bug25378.phpt b/ext/standard/tests/serialize/bug25378.phpt deleted file mode 100644 index e865b96e9935f..0000000000000 --- a/ext/standard/tests/serialize/bug25378.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bug #25378 (unserialize() crashes with invalid data) ---FILE-- - -===DONE=== ---EXPECTF-- -Notice: unserialize(): Error at offset 0 of 8 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 0 of 5 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 13 of 19 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 14 of 19 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 2 of 22 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 17 of 18 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 24 of 33 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 2 of 11 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 8 of 9 bytes in %sbug25378.php on line %d -bool(false) - -Notice: unserialize(): Error at offset 5 of 10 bytes in %sbug25378.php on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/serialize/bug26762.phpt b/ext/standard/tests/serialize/bug26762.phpt deleted file mode 100755 index 3011bb602c15c..0000000000000 --- a/ext/standard/tests/serialize/bug26762.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #26762 (unserialize() produces lowercase classnames) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(3) "FOO" diff --git a/ext/standard/tests/serialize/bug27469.phpt b/ext/standard/tests/serialize/bug27469.phpt deleted file mode 100644 index e8d14106a8ba9..0000000000000 --- a/ext/standard/tests/serialize/bug27469.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #27469 (serialize() objects of incomplete class) ---FILE-- - ---EXPECT-- -object(__PHP_Incomplete_Class)#1 (1) { - ["__PHP_Incomplete_Class_Name"]=> - string(9) "TestClass" -} -O:9:"TestClass":0:{} -object(__PHP_Incomplete_Class)#1 (1) { - ["__PHP_Incomplete_Class_Name"]=> - string(9) "TestClass" -} -O:9:"TestClass":0:{} -object(__PHP_Incomplete_Class)#1 (1) { - ["__PHP_Incomplete_Class_Name"]=> - string(9) "TestClass" -} diff --git a/ext/standard/tests/serialize/bug28325.phpt b/ext/standard/tests/serialize/bug28325.phpt deleted file mode 100644 index 7f2bd66371128..0000000000000 --- a/ext/standard/tests/serialize/bug28325.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #28325 (Problem in serialisation of circular references) ---FILE-- -b = new b(); -$a->b->c = new c(); -$a->b->c->d = $a; -var_dump(unserialize(serialize($a))); -?> ---EXPECTF-- -object(a)#%d (1) { - ["b"]=> - object(b)#%d (1) { - ["c"]=> - object(c)#%d (1) { - ["d"]=> - object(a)#%d (1) { - ["b"]=> - object(b)#%d (1) { - ["c"]=> - object(c)#%d (1) { - ["d"]=> - *RECURSION* - } - } - } - } - } -} diff --git a/ext/standard/tests/serialize/bug30234.phpt b/ext/standard/tests/serialize/bug30234.phpt deleted file mode 100755 index 9b40cc54b3129..0000000000000 --- a/ext/standard/tests/serialize/bug30234.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #30234 (__autoload() not invoked for interfaces) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(false) -__autoload(autoload_interface) -__autoload(Autoload_Implements) -object(autoload_implements)#%d (0) { -} -bool(true) -bool(true) -bool(true) -===DONE=== diff --git a/ext/standard/tests/serialize/bug31402.phpt b/ext/standard/tests/serialize/bug31402.phpt deleted file mode 100644 index 9db838d71760f..0000000000000 --- a/ext/standard/tests/serialize/bug31402.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Bug #31402 (unserialize() generates references when it should not) ---INI-- -error_reporting=E_ALL&~E_STRICT ---FILE-- -i = $i; - } -} - -class TestY { - var $A = array(); - var $B; - - function __construct() { - $this->A[1] = new TestX(1); - $this->A[2] = & new TestX(2); - $this->A[3] = & $this->A[2]; - $this->B = $this->A[1]; - } -} - -$before = new TestY(); -$ser = serialize($before); -$after = unserialize($ser); - -var_dump($before, $after); - -?> -===DONE=== ---EXPECTF-- -object(TestY)#%d (2) { - ["A"]=> - array(3) { - [1]=> - object(TestX)#%d (1) { - ["i"]=> - int(1) - } - [2]=> - &object(TestX)#%d (1) { - ["i"]=> - int(2) - } - [3]=> - &object(TestX)#%d (1) { - ["i"]=> - int(2) - } - } - ["B"]=> - object(TestX)#%d (1) { - ["i"]=> - int(1) - } -} -object(TestY)#%d (2) { - ["A"]=> - array(3) { - [1]=> - object(TestX)#%d (1) { - ["i"]=> - int(1) - } - [2]=> - &object(TestX)#%d (1) { - ["i"]=> - int(2) - } - [3]=> - &object(TestX)#%d (1) { - ["i"]=> - int(2) - } - } - ["B"]=> - object(TestX)#%d (1) { - ["i"]=> - int(1) - } -} -===DONE=== diff --git a/ext/standard/tests/serialize/bug31442.phpt b/ext/standard/tests/serialize/bug31442.phpt deleted file mode 100755 index 3497b278cb125..0000000000000 --- a/ext/standard/tests/serialize/bug31442.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #31442 (unserialize broken on 64-bit systems) ---FILE-- - ---EXPECT-- -2147483648 diff --git a/ext/standard/tests/strings/004.phpt b/ext/standard/tests/strings/004.phpt deleted file mode 100644 index b9904c614ae3b..0000000000000 --- a/ext/standard/tests/strings/004.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Testing randomization of shuffle() and str_shuffle(). ---FILE-- - $v) - print "$k: $v: " . sprintf('%0.3f', $v / $times) . "\n"; -} -$a = array(); -$times = 90000; -for ($i = 0; $i < $times; $i++) { - $p = range(1,4); - shuffle($p); - $s = join('', $p); - if (empty($a[$s])) $a[$s] = 0; - $a[$s]++; -} - -stats('shuffle', $a); -$a = array(); -$times = 90000; -for ($i = 0; $i < $times; $i++) { - $p = '1234'; - $s = str_shuffle($p); - if (empty($a[$s])) $a[$s] = 0; - $a[$s]++; -} - -stats('str_shuffle', $a); -?> ---EXPECTREGEX-- -shuffle -1234: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1243: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1324: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1342: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1423: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1432: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2134: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2143: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2314: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2341: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2413: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2431: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3124: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3142: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3214: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3241: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3412: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3421: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4123: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4132: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4213: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4231: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4312: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4321: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -str_shuffle -1234: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1243: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1324: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1342: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1423: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -1432: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2134: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2143: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2314: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2341: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2413: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -2431: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3124: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3142: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3214: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3241: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3412: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -3421: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4123: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4132: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4213: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4231: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4312: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] -4321: 3[0-9][0-9][0-9]: 0.0[3-4][0-9] diff --git a/ext/standard/tests/strings/add-and-stripcslashes.phpt b/ext/standard/tests/strings/add-and-stripcslashes.phpt deleted file mode 100644 index 7c7e36edc5361..0000000000000 --- a/ext/standard/tests/strings/add-and-stripcslashes.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -addcslashes() and stripcslashes() function ---FILE-- - ---EXPECT-- - - -kaboemkara! -foo\b\a\r\b\az -\f\o\o\[ \] -\zoo['\.'] -\abcd\e\f\g\h\i\j\k\l\m\n\o\pqrstuvwxy\z -1 -5d - diff --git a/ext/standard/tests/strings/add-and-stripslashes.phpt b/ext/standard/tests/strings/add-and-stripslashes.phpt deleted file mode 100644 index a5eab410b907b..0000000000000 --- a/ext/standard/tests/strings/add-and-stripslashes.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -addslashes() and stripslashes() functions, normal and sybase-style ---FILE-- - ---EXPECT-- -Normal: OK -Sybase: OK diff --git a/ext/standard/tests/strings/basename.phpt b/ext/standard/tests/strings/basename.phpt deleted file mode 100644 index a39a6f9aebe74..0000000000000 Binary files a/ext/standard/tests/strings/basename.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/bin2hex.phpt b/ext/standard/tests/strings/bin2hex.phpt deleted file mode 100644 index 42a4f4c59465d..0000000000000 --- a/ext/standard/tests/strings/bin2hex.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -bin2hex() function ---FILE-- - ---EXPECT-- -000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -616263 diff --git a/ext/standard/tests/strings/bug20108.phpt b/ext/standard/tests/strings/bug20108.phpt deleted file mode 100644 index 6e2219d990915..0000000000000 --- a/ext/standard/tests/strings/bug20108.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #20108 (Segfault on printf statement) ---FILE-- - ---EXPECT-- -string(581) " boo -" diff --git a/ext/standard/tests/strings/bug20169.phpt b/ext/standard/tests/strings/bug20169.phpt deleted file mode 100644 index c606578677fc2..0000000000000 --- a/ext/standard/tests/strings/bug20169.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #20169 (implode() clobbers first argument) ---FILE-- - ---EXPECT-- -delimiter: | -delimiter: | diff --git a/ext/standard/tests/strings/bug20261.phpt b/ext/standard/tests/strings/bug20261.phpt deleted file mode 100644 index 163e905a4aac4..0000000000000 --- a/ext/standard/tests/strings/bug20261.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #20261 (str_rot13() changes too much) ---FILE-- - ---EXPECT-- -1: boo -2: boo -3: -1: boo -2: boo -3: obb - diff --git a/ext/standard/tests/strings/bug20927.phpt b/ext/standard/tests/strings/bug20927.phpt deleted file mode 100644 index 7575f2af025bf..0000000000000 --- a/ext/standard/tests/strings/bug20927.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #20927 (Segfault on wordwrap statement) ---FILE-- - ---EXPECT-- -Length of original string: 130 -Length of break string: 352 -string(6799) "1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapXa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heap1234567890a-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapa-very-long-break-string-to-clobber-the-heapX " diff --git a/ext/standard/tests/strings/bug20934.phpt b/ext/standard/tests/strings/bug20934.phpt deleted file mode 100644 index 0d95081d54dfc..0000000000000 --- a/ext/standard/tests/strings/bug20934.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #20934 (htmlspecialchars returns latin1 from UTF-8) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(2) "àá" -string(2) "àá" diff --git a/ext/standard/tests/strings/bug21338.phpt b/ext/standard/tests/strings/bug21338.phpt deleted file mode 100644 index c84576563ef82..0000000000000 --- a/ext/standard/tests/strings/bug21338.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #20934 (html_entity_decode() crash when "" is passed) ---FILE-- - ---EXPECT-- -string(0) "" -string(0) "" diff --git a/ext/standard/tests/strings/bug21453.phpt b/ext/standard/tests/strings/bug21453.phpt deleted file mode 100644 index cc14573432a22..0000000000000 --- a/ext/standard/tests/strings/bug21453.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #21453 (handling of non-encoded <) ---FILE-- - - first cell before < first cell after - second cell before < second cell after -"; - - var_dump(strip_tags($test)); -?> ---EXPECT-- -string(80) " - - first cell before < first cell after - second cell before < second cell after -" ---UEXPECT-- -unicode(80) " - - first cell before < first cell after - second cell before < second cell after -" diff --git a/ext/standard/tests/strings/bug21730.phpt b/ext/standard/tests/strings/bug21730.phpt deleted file mode 100644 index 8d40e204ce109..0000000000000 --- a/ext/standard/tests/strings/bug21730.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #21730 (*scanf "%n" conversion flag gives string instead of integer) ---FILE-- - ---EXPECT-- -array(3) { - [0]=> - string(3) "ABC" - [1]=> - string(3) "DEF" - [2]=> - int(9) -} -array(3) { - [0]=> - string(3) "ABC" - [1]=> - string(3) "DEF" - [2]=> - int(9) -} diff --git a/ext/standard/tests/strings/bug21744.phpt b/ext/standard/tests/strings/bug21744.phpt deleted file mode 100644 index 925dac3fa094d..0000000000000 --- a/ext/standard/tests/strings/bug21744.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #21744 (strip_tags misses exclamation marks in alt text) ---FILE-- -test
              - -HERE; - -print strip_tags($test, ''); -print strip_tags($test, ''); -?> ---EXPECT-- -test -test diff --git a/ext/standard/tests/strings/bug22008.phpt b/ext/standard/tests/strings/bug22008.phpt deleted file mode 100644 index 0965337e64e74..0000000000000 --- a/ext/standard/tests/strings/bug22008.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #22008 (strip_tags() eliminates too much) ---FILE-- - - - -test - - -PHP! - - - -HERE; - -echo trim(strip_tags($html, ''))."\n"; -?> ---EXPECT-- -test - - -PHP! diff --git a/ext/standard/tests/strings/bug22187.phpt b/ext/standard/tests/strings/bug22187.phpt deleted file mode 100644 index dccaccc04dc1a..0000000000000 --- a/ext/standard/tests/strings/bug22187.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #22187 (possible crash in number_format() function) ---FILE-- - ---EXPECT-- -string(3) "0.0" -string(1) "0" diff --git a/ext/standard/tests/strings/bug22207.phpt b/ext/standard/tests/strings/bug22207.phpt deleted file mode 100644 index 688bb5b74493e..0000000000000 --- a/ext/standard/tests/strings/bug22207.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #22207 (missing 0 when using the e notation in *printf functions) ---FILE-- - ---EXPECT-- -1.1000e+0 -string(11) " 1.1000e+0 -" diff --git a/ext/standard/tests/strings/bug22224.phpt b/ext/standard/tests/strings/bug22224.phpt deleted file mode 100644 index b9a1191537b45..0000000000000 --- a/ext/standard/tests/strings/bug22224.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #22224 (implode changes object references in array) ---INI-- -error_reporting=0 ---FILE-- -&$a, 1=>&$a); -var_dump(implode(",",$arr)); -var_dump($arr) -?> ---EXPECTF-- -string(13) "Object,Object" -array(2) { - [0]=> - &object(foo)#%d (0) { - } - [1]=> - &object(foo)#%d (0) { - } -} ---UEXPECTF-- -unicode(13) "Object,Object" -array(2) { - [0]=> - &object(foo)#%d (0) { - } - [1]=> - &object(foo)#%d (0) { - } -} diff --git a/ext/standard/tests/strings/bug22227.phpt b/ext/standard/tests/strings/bug22227.phpt deleted file mode 100644 index eb980f986519c..0000000000000 --- a/ext/standard/tests/strings/bug22227.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #22227 (printf() field limiters broke between 4.2.3 and 4.3.0) ---FILE-- - ---EXPECT-- -abc diff --git a/ext/standard/tests/strings/bug22904.phpt b/ext/standard/tests/strings/bug22904.phpt deleted file mode 100644 index 3c56e1a414dc9..0000000000000 --- a/ext/standard/tests/strings/bug22904.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #22904 (magic mode failed for cybase with '\0') ---FILE-- -not active yet - ---EXPECT-- -not active yet diff --git a/ext/standard/tests/strings/bug23650.phpt b/ext/standard/tests/strings/bug23650.phpt deleted file mode 100644 index 01dc88843d888..0000000000000 --- a/ext/standard/tests/strings/bug23650.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #23650 (strip_tags() removes hyphens) ---FILE-- - -2: -3: -4: -5:abc - def -6: - -HERE; - -echo strip_tags($str); -echo strip_tags($str, ''); -?> ---EXPECT-- -1: -2: -3: -4: -5:abc - def -6: -1: -2: -3: -4: -5:abc - def -6: - diff --git a/ext/standard/tests/strings/bug23894.phpt b/ext/standard/tests/strings/bug23894.phpt deleted file mode 100644 index 9cc0316a2416e..0000000000000 --- a/ext/standard/tests/strings/bug23894.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #23894 (sprintf() decimal specifiers problem) ---FILE-- - ---EXPECT-- -string(4) "-012" -string(8) "2d303132" -string(13) " 4294967284" -string(26) "20202034323934393637323834" diff --git a/ext/standard/tests/strings/bug24098.phpt b/ext/standard/tests/strings/bug24098.phpt deleted file mode 100644 index 967da1545008b..0000000000000 --- a/ext/standard/tests/strings/bug24098.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #24098 (pathinfo() crash) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(3) { - ["dirname"]=> - string(1) "/" - ["basename"]=> - string(8) "dsds.asa" - ["extension"]=> - string(3) "asa" -} ---UEXPECT-- -array(3) { - [u"dirname"]=> - unicode(1) "/" - [u"basename"]=> - unicode(8) "dsds.asa" - [u"extension"]=> - unicode(3) "asa" -} diff --git a/ext/standard/tests/strings/bug24208.phpt b/ext/standard/tests/strings/bug24208.phpt deleted file mode 100644 index f3226e4fd3253..0000000000000 --- a/ext/standard/tests/strings/bug24208.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #24208 (parse_str() is not working) ---FILE-- - ---EXPECT-- -string(1) "1" -string(1) "2" -string(1) "3" ---UEXPECT-- -unicode(1) "1" -unicode(1) "2" -unicode(1) "3" diff --git a/ext/standard/tests/strings/bug24281.phpt b/ext/standard/tests/strings/bug24281.phpt deleted file mode 100644 index 3c041d67cba5b..0000000000000 --- a/ext/standard/tests/strings/bug24281.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #24281 (str_replace count not returned if variable wasn't initialized) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -3 changes were made. -3 changes were made. diff --git a/ext/standard/tests/strings/bug24312.phpt b/ext/standard/tests/strings/bug24312.phpt deleted file mode 100644 index 5ec444dd584a0..0000000000000 --- a/ext/standard/tests/strings/bug24312.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #24208 (base64_decode() not skipping 0xF0 - 0xFF) ---FILE-- - ---EXPECT-- -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -string(100) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" diff --git a/ext/standard/tests/strings/bug25671.phpt b/ext/standard/tests/strings/bug25671.phpt deleted file mode 100644 index ac6479070428a..0000000000000 --- a/ext/standard/tests/strings/bug25671.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #25671 (subarrays not copied correctly) ---FILE-- - ---EXPECT-- -a:4:{i:0;s:19:"This is strung one.";i:1;s:19:"This is strung two.";i:2;a:2:{i:0;s:23:"This is another string.";i:1;s:22:"This is a last string.";}i:3;s:22:"This is a last strung.";} -a:4:{i:0;s:19:"This is strung one.";i:1;s:19:"This is strung two.";i:2;a:2:{i:0;s:23:"This is another string.";i:1;s:22:"This is a last string.";}i:3;s:22:"This is a last strung.";} -a:4:{i:0;s:16:"Thisisstringone.";i:1;s:16:"Thisisstringtwo.";i:2;a:2:{i:0;s:23:"This is another string.";i:1;s:22:"This is a last string.";}i:3;s:18:"Thisisalaststring.";} -a:4:{i:0;s:16:"Thisisstringone.";i:1;s:16:"Thisisstringtwo.";i:2;a:2:{i:0;s:23:"This is another string.";i:1;s:22:"This is a last string.";}i:3;s:18:"Thisisalaststring.";} - diff --git a/ext/standard/tests/strings/bug25707.phpt b/ext/standard/tests/strings/bug25707.phpt deleted file mode 100644 index 4954fb1ae5aec..0000000000000 --- a/ext/standard/tests/strings/bug25707.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #25707 (html_entity_decode over-decodes &lt;) ---FILE-- - ---EXPECT-- -string(4) "<" -string(5) "&" -string(8) "&lt;" diff --git a/ext/standard/tests/strings/bug26817.phpt b/ext/standard/tests/strings/bug26817.phpt deleted file mode 100644 index 228348708cb1e..0000000000000 --- a/ext/standard/tests/strings/bug26817.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #26817 (http_build_query() did not handle private & protected object properties) ---FILE-- -bar = 'meuh'; - $this->foo = 'lala'; - $this->test = 'test'; - - var_dump(http_build_query($this)); - } -} - -$obj = new test(); -$obj->foo(); -var_dump(http_build_query($obj)); -?> ---EXPECT-- -string(27) "foo=lala&bar=meuh&test=test" -string(9) "test=test" diff --git a/ext/standard/tests/strings/bug26819.phpt b/ext/standard/tests/strings/bug26819.phpt deleted file mode 100644 index 4a53539434e7c..0000000000000 --- a/ext/standard/tests/strings/bug26819.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #26819 (http_build_query() crash on empty output) ---FILE-- - ---EXPECT-- -NULL diff --git a/ext/standard/tests/strings/bug26878.phpt b/ext/standard/tests/strings/bug26878.phpt deleted file mode 100644 index 602f710c8370e..0000000000000 --- a/ext/standard/tests/strings/bug26878.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #26878 (problem with multiple references to the same variable with different types) ---FILE-- - ---EXPECT-- -Int: 0 and as string: some string diff --git a/ext/standard/tests/strings/bug26973.phpt b/ext/standard/tests/strings/bug26973.phpt deleted file mode 100644 index 4a586ecaa28dc..0000000000000 --- a/ext/standard/tests/strings/bug26973.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #26973 (*printf() '+' modifier problem) ---FILE-- - ---EXPECT-- -+0200 --0200 -+200.000000 --200.000000 -00200 -4294967096 ---- -00200 --0200 -200.000000 --200.000000 -00200 -4294967096 diff --git a/ext/standard/tests/strings/bug27276.phpt b/ext/standard/tests/strings/bug27276.phpt deleted file mode 100644 index f27e1d560bf5f..0000000000000 --- a/ext/standard/tests/strings/bug27276.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #27276 (str_replace tries to use obscene amounts of ram) ---FILE-- - ---EXPECT-- -Alive! diff --git a/ext/standard/tests/strings/bug27278.phpt b/ext/standard/tests/strings/bug27278.phpt deleted file mode 100644 index 512fe64c924d2..0000000000000 --- a/ext/standard/tests/strings/bug27278.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #27278 (*printf() functions treat arguments as if passed by reference) ---FILE-- - ---EXPECT-- -string(2) "02" -string(2) "02" -string(2) "02" ---UEXPECT-- -unicode(2) "02" -unicode(2) "02" -unicode(2) "02" diff --git a/ext/standard/tests/strings/bug27295.phpt b/ext/standard/tests/strings/bug27295.phpt deleted file mode 100644 index d23d27049f671..0000000000000 --- a/ext/standard/tests/strings/bug27295.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #27295 (memory leak inside sscanf()) ---FILE-- - ---EXPECT-- -foo = bar -bar = foo diff --git a/ext/standard/tests/strings/bug27457.phpt b/ext/standard/tests/strings/bug27457.phpt deleted file mode 100644 index 6f5ec05f79a2a..0000000000000 --- a/ext/standard/tests/strings/bug27457.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #27457 (Problem with strtr() and translation array) ---FILE-- - '0')); - echo $test; - $test = strtr($test, array('0' => '.')); - echo $test; - $test = strtr($test, '.', '0'); - echo $test; - $test = strtr($test, '0', '.'); - echo $test; -?> ---EXPECT-- -Dot in brackets [.] -Dot in brackets [0] -Dot in brackets [.] -Dot in brackets [0] -Dot in brackets [.] diff --git a/ext/standard/tests/strings/bug27675.phpt b/ext/standard/tests/strings/bug27675.phpt deleted file mode 100644 index a5d4294b2ce65..0000000000000 --- a/ext/standard/tests/strings/bug27675.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #27675 (str_ireplace segfaults when shrinking string) ---FILE-- -', '', '/* I am a comment*/'); -?> ---EXPECT-- - I am a comment*/ diff --git a/ext/standard/tests/strings/bug28386.phpt b/ext/standard/tests/strings/bug28386.phpt deleted file mode 100644 index 9c7c158bc9825..0000000000000 --- a/ext/standard/tests/strings/bug28386.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #28386 (wordwrap() wraps text 1 character too soon) ---FILE-- - ---EXPECT-- -Some text -Some text -Some text -Some text diff --git a/ext/standard/tests/strings/bug28633.phpt b/ext/standard/tests/strings/bug28633.phpt deleted file mode 100644 index 5a1c2567fac5c..0000000000000 --- a/ext/standard/tests/strings/bug28633.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #28633 (sprintf incorrectly adding padding to floats) ---FILE-- - ---EXPECT-- -00.02 -02.02 diff --git a/ext/standard/tests/strings/bug29075.phpt b/ext/standard/tests/strings/bug29075.phpt deleted file mode 100644 index 7fe7da6c49789..0000000000000 --- a/ext/standard/tests/strings/bug29075.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #29075 (strnatcmp() incorrectly handles whitespace) ---FILE-- - ---EXPECT-- -int(0) -int(0) -int(0) diff --git a/ext/standard/tests/strings/bug29119.phpt b/ext/standard/tests/strings/bug29119.phpt deleted file mode 100644 index 0ca68ce973bb6..0000000000000 --- a/ext/standard/tests/strings/bug29119.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #29119 (html_entity_decode() misbehaves with UTF-8) ---FILE-- - ---EXPECT-- -string(42) "e28082e28089e28098e280a0e280b2e28184e282ac" ---UEXPECT-- -unicode(42) "e28082e28089e28098e280a0e280b2e28184e282ac" diff --git a/ext/standard/tests/strings/bug33076.phpt b/ext/standard/tests/strings/bug33076.phpt deleted file mode 100644 index dafb8161b0f17..0000000000000 --- a/ext/standard/tests/strings/bug33076.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #33076 (str_ireplace() incorrectly counts result string length and may cause segfault) ---FILE-- - ---EXPECT-- -string(6) "bzexbz" -Done diff --git a/ext/standard/tests/strings/bug34214.phpt b/ext/standard/tests/strings/bug34214.phpt deleted file mode 100644 index dc2eb45031dd0..0000000000000 --- a/ext/standard/tests/strings/bug34214.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #34214 (base64_decode() does not properly ignore whitespace) ---FILE-- - ---EXPECT-- -foobar foobar diff --git a/ext/standard/tests/strings/chr_ord.phpt b/ext/standard/tests/strings/chr_ord.phpt deleted file mode 100644 index 56cfef70a3416..0000000000000 --- a/ext/standard/tests/strings/chr_ord.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -chr() and ord() functions ---FILE-- - ---EXPECT-- -Testing ord() & chr()... done diff --git a/ext/standard/tests/strings/chunk_split.phpt b/ext/standard/tests/strings/chunk_split.phpt deleted file mode 100644 index b6bed3ab486d5..0000000000000 --- a/ext/standard/tests/strings/chunk_split.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -chunk_split() function ---FILE-- - ---EXPECT-- -a-b-c- -foooo -ooooo -ooooo -oo - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - -test|end diff --git a/ext/standard/tests/strings/count_chars.phpt b/ext/standard/tests/strings/count_chars.phpt deleted file mode 100644 index fe21b656f0990..0000000000000 --- a/ext/standard/tests/strings/count_chars.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -count_chars() function ---FILE-- - ---EXPECT-- -000000000000000000000000000000001200000000000010000000000000000000000000000000000000000000000000003000120111121083202362220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -121312111121832236222 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - -aeghijklnoprstuvw -1 diff --git a/ext/standard/tests/strings/crc32.phpt b/ext/standard/tests/strings/crc32.phpt deleted file mode 100644 index e1b338f011641..0000000000000 --- a/ext/standard/tests/strings/crc32.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -crc32() function ---FILE-- - ---EXPECT-- -2356372769 -1996459178 -2015626392 -824412087 diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt deleted file mode 100644 index 5368178e11b81..0000000000000 --- a/ext/standard/tests/strings/crypt.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -crypt() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -STD -EXT -MD5 -BLO diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt deleted file mode 100644 index 35ab73a4eda41..0000000000000 --- a/ext/standard/tests/strings/explode.phpt +++ /dev/null @@ -1,278 +0,0 @@ ---TEST-- -explode() function ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECTF-- -26d4e18734cb2582df5055e2175223df -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - string(0) "" -} -array(2) { - [0]=> - string(0) "" - [1]=> - string(0) "" -} -array(1) { - [0]=> - string(0) "" -} -bool(false) -array(1) { - [0]=> - string(3) "acb" -} -array(1) { - [0]=> - string(11) "otherstring" -} -array(7) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(0) "" - [6]=> - string(0) "" -} -array(1) { - [0]=> - string(60) "-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-" -} -array(21) { - [0]=> - string(1) "-" - [1]=> - string(2) "48" - [2]=> - string(2) "--" - [3]=> - string(2) "48" - [4]=> - string(2) "--" - [5]=> - string(2) "48" - [6]=> - string(2) "--" - [7]=> - string(2) "48" - [8]=> - string(2) "--" - [9]=> - string(2) "48" - [10]=> - string(2) "--" - [11]=> - string(2) "48" - [12]=> - string(2) "--" - [13]=> - string(2) "48" - [14]=> - string(2) "--" - [15]=> - string(2) "48" - [16]=> - string(2) "--" - [17]=> - string(2) "48" - [18]=> - string(2) "--" - [19]=> - string(2) "48" - [20]=> - string(1) "-" -} -array(3) { - [0]=> - string(10) "a lazy dog" - [1]=> - string(5) "jumps" - [2]=> - string(4) "over" -} -array(2) { - [0]=> - string(10) "a lazy dog" - [1]=> - string(5) "jumps" -} -array(1) { - [0]=> - string(10) "a lazy dog" -} -array(0) { -} -array(0) { -} -array(2) { - [0]=> - string(10) "a lazy dog" - [1]=> - string(11) "jumps::over" -} -array(1) { - [0]=> - string(10) "a lazy dog" -} ---UEXPECTF-- -26d4e18734cb2582df5055e2175223df -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - unicode(0) "" -} -array(2) { - [0]=> - unicode(0) "" - [1]=> - unicode(0) "" -} -array(1) { - [0]=> - unicode(0) "" -} -bool(false) -array(1) { - [0]=> - unicode(3) "acb" -} -array(1) { - [0]=> - unicode(11) "otherstring" -} -array(7) { - [0]=> - unicode(0) "" - [1]=> - unicode(0) "" - [2]=> - unicode(0) "" - [3]=> - unicode(0) "" - [4]=> - unicode(0) "" - [5]=> - unicode(0) "" - [6]=> - unicode(0) "" -} -array(1) { - [0]=> - unicode(60) "-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-" -} -array(21) { - [0]=> - unicode(1) "-" - [1]=> - unicode(2) "48" - [2]=> - unicode(2) "--" - [3]=> - unicode(2) "48" - [4]=> - unicode(2) "--" - [5]=> - unicode(2) "48" - [6]=> - unicode(2) "--" - [7]=> - unicode(2) "48" - [8]=> - unicode(2) "--" - [9]=> - unicode(2) "48" - [10]=> - unicode(2) "--" - [11]=> - unicode(2) "48" - [12]=> - unicode(2) "--" - [13]=> - unicode(2) "48" - [14]=> - unicode(2) "--" - [15]=> - unicode(2) "48" - [16]=> - unicode(2) "--" - [17]=> - unicode(2) "48" - [18]=> - unicode(2) "--" - [19]=> - unicode(2) "48" - [20]=> - unicode(1) "-" -} -array(3) { - [0]=> - unicode(10) "a lazy dog" - [1]=> - unicode(5) "jumps" - [2]=> - unicode(4) "over" -} -array(2) { - [0]=> - unicode(10) "a lazy dog" - [1]=> - unicode(5) "jumps" -} -array(1) { - [0]=> - unicode(10) "a lazy dog" -} -array(0) { -} -array(0) { -} -array(2) { - [0]=> - unicode(10) "a lazy dog" - [1]=> - unicode(11) "jumps::over" -} -array(1) { - [0]=> - unicode(10) "a lazy dog" -} diff --git a/ext/standard/tests/strings/htmlentities.phpt b/ext/standard/tests/strings/htmlentities.phpt deleted file mode 100644 index 4dc15f9e67ae2..0000000000000 --- a/ext/standard/tests/strings/htmlentities.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -HTML entities ---INI-- -output_handler= -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- -\"&ċÄ\n"); -echo $sc_encoded; -$ent_encoded = htmlentities ("<>\"&ċÄ\n"); -echo $ent_encoded; -echo html_entity_decode($sc_encoded); -echo html_entity_decode($ent_encoded); -?> ---EXPECT-- -<>"&ċÄ -<>"&åÄ -<>"&ċÄ -<>"&ċÄ diff --git a/ext/standard/tests/strings/htmlentities01.phpt b/ext/standard/tests/strings/htmlentities01.phpt deleted file mode 100644 index 4ab49472d1f38..0000000000000 --- a/ext/standard/tests/strings/htmlentities01.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -htmlentities() test 1 (cp1252) ---INI-- -output_handler= -mbstring.internal_encoding=pass ---FILE-- - ---EXPECT-- -string(28) "‚†™Ÿ" -string(32) "€¢£¤¥" diff --git a/ext/standard/tests/strings/htmlentities02.phpt b/ext/standard/tests/strings/htmlentities02.phpt deleted file mode 100644 index 666c4f650b9a0..0000000000000 --- a/ext/standard/tests/strings/htmlentities02.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) ---SKIPIF-- - ---INI-- -output_handler= -default_charset= -mbstring.internal_encoding=none ---FILE-- - ---EXPECT-- -string(20) "ŒœŸ" diff --git a/ext/standard/tests/strings/htmlentities03.phpt b/ext/standard/tests/strings/htmlentities03.phpt deleted file mode 100644 index 7e933544fe52a..0000000000000 --- a/ext/standard/tests/strings/htmlentities03.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -htmlentities() test 3 (setlocale / de_DE.ISO-8859-1) ---SKIPIF-- - ---INI-- -output_handler= -default_charset= -mbstring.internal_encoding=none ---FILE-- - ---EXPECT-- -string(18) "äöü" diff --git a/ext/standard/tests/strings/htmlentities04.phpt b/ext/standard/tests/strings/htmlentities04.phpt deleted file mode 100644 index 8e362d073cc56..0000000000000 --- a/ext/standard/tests/strings/htmlentities04.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -htmlentities() test 4 (setlocale / ja_JP.EUC-JP) ---SKIPIF-- - ---INI-- -output_handler= -default_charset= -mbstring.internal_encoding=none ---FILE-- - ---EXPECT-- -string(6) "Ħ˘Ħ£Ħ¤" diff --git a/ext/standard/tests/strings/htmlentities05.phpt b/ext/standard/tests/strings/htmlentities05.phpt deleted file mode 100644 index 779cf289b0b1d..0000000000000 --- a/ext/standard/tests/strings/htmlentities05.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -htmlentities() test 5 (mbstring / cp1252) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Windows-1252 -string(28) "‚†™Ÿ" -string(32) "€¢£¤¥" diff --git a/ext/standard/tests/strings/htmlentities06.phpt b/ext/standard/tests/strings/htmlentities06.phpt deleted file mode 100644 index 44d1466da9b68..0000000000000 --- a/ext/standard/tests/strings/htmlentities06.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -htmlentities() test 6 (mbstring / ISO-8859-15) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ISO-8859-15 -string(20) "ŒœŸ" diff --git a/ext/standard/tests/strings/htmlentities07.phpt b/ext/standard/tests/strings/htmlentities07.phpt deleted file mode 100644 index efd06f08ad0f0..0000000000000 --- a/ext/standard/tests/strings/htmlentities07.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -htmlentities() test 7 (mbstring / ISO-8859-1) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ISO-8859-1 -string(18) "äöü" diff --git a/ext/standard/tests/strings/htmlentities08.phpt b/ext/standard/tests/strings/htmlentities08.phpt deleted file mode 100644 index 0f8f912f272f9..0000000000000 --- a/ext/standard/tests/strings/htmlentities08.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -htmlentities() test 8 (mbstring / EUC-JP) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -EUC-JP -string(6) "Ħ˘Ħ£Ħ¤" diff --git a/ext/standard/tests/strings/htmlentities09.phpt b/ext/standard/tests/strings/htmlentities09.phpt deleted file mode 100644 index 4c6ef60c740ec..0000000000000 --- a/ext/standard/tests/strings/htmlentities09.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -htmlentities() test 9 (mbstring / Shift_JIS) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -SJIS -string(6) "ABC" diff --git a/ext/standard/tests/strings/htmlentities10.phpt b/ext/standard/tests/strings/htmlentities10.phpt deleted file mode 100644 index ee5099cf3416a..0000000000000 --- a/ext/standard/tests/strings/htmlentities10.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -htmlentities() test 10 (default_charset / cp1252) ---INI-- -output_handler= -mbstring.internal_encoding=pass -default_charset=cp1252 ---FILE-- - ---EXPECT-- -cp1252 -string(28) "‚†™Ÿ" -string(32) "€¢£¤¥" diff --git a/ext/standard/tests/strings/htmlentities11.phpt b/ext/standard/tests/strings/htmlentities11.phpt deleted file mode 100644 index 62b6aec7c8e36..0000000000000 --- a/ext/standard/tests/strings/htmlentities11.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -htmlentities() test 11 (default_charset / ISO-8859-15) ---INI-- -output_handler= -mbstring.internal_encoding=pass -default_charset=ISO-8859-15 ---FILE-- - ---EXPECT-- -ISO-8859-15 -string(20) "ŒœŸ" diff --git a/ext/standard/tests/strings/htmlentities12.phpt b/ext/standard/tests/strings/htmlentities12.phpt deleted file mode 100644 index 826706680d4f0..0000000000000 --- a/ext/standard/tests/strings/htmlentities12.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -htmlentities() test 12 (default_charset / ISO-8859-1) ---INI-- -output_handler= -mbstring.internal_encoding=pass -default_charset=ISO-8859-1 ---FILE-- - ---EXPECT-- -ISO-8859-1 -string(18) "äöü" diff --git a/ext/standard/tests/strings/htmlentities13.phpt b/ext/standard/tests/strings/htmlentities13.phpt deleted file mode 100644 index 2c559916e9a76..0000000000000 --- a/ext/standard/tests/strings/htmlentities13.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -htmlentities() test 13 (default_charset / EUC-JP) ---INI-- -output_handler= -mbstring.internal_encoding=pass -default_charset=EUC-JP ---FILE-- - ---EXPECT-- -EUC-JP -string(6) "Ħ˘Ħ£Ħ¤" diff --git a/ext/standard/tests/strings/htmlentities14.phpt b/ext/standard/tests/strings/htmlentities14.phpt deleted file mode 100644 index 9190d26515f19..0000000000000 --- a/ext/standard/tests/strings/htmlentities14.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -htmlentities() test 14 (default_charset / Shift_JIS) ---INI-- -output_handler= -mbstring.internal_encoding=pass -default_charset=Shift_JIS ---FILE-- - ---EXPECT-- -Shift_JIS -string(6) "ABC" diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt deleted file mode 100644 index 8828b827b1cdf..0000000000000 --- a/ext/standard/tests/strings/htmlentities15.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -htmlentities() test 15 (setlocale / KOI8-R) ---INI-- -output_handler= -default_charset= -mbstring.internal_encoding=none -unicode.script_encoding=KOI-8 -unicode.output_encoding=KOI-8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(9) "ÒÏÓËÏÛÎÙÊ" -string(63) "роскошный" diff --git a/ext/standard/tests/strings/htmlentities16.phpt b/ext/standard/tests/strings/htmlentities16.phpt deleted file mode 100644 index 0f945280b52f1..0000000000000 --- a/ext/standard/tests/strings/htmlentities16.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -htmlentities() test 16 (mbstring / cp1251) ---INI-- -output_handler= ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(11) "ˆİîñêîĝíûé" -string(75) "€©роскошный" diff --git a/ext/standard/tests/strings/htmlentities17.phpt b/ext/standard/tests/strings/htmlentities17.phpt deleted file mode 100644 index b203e7c3e0272..0000000000000 --- a/ext/standard/tests/strings/htmlentities17.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -htmlentities() / html_entity_decode() #8592 - #9002 table test ---FILE-- - ---EXPECT-- -string(8) "≀" -string(7) "⊕" -string(8) "⊗" -string(6) "⊥" -string(6) "⋅" -string(7) "⌈" -string(7) "⌉" -string(8) "⌊" -string(8) "⌋" -string(6) "⟨" -string(6) "⟩" -string(6) "e28980" -string(6) "e28a95" -string(6) "e28a97" -string(6) "e28aa5" -string(6) "e28b85" -string(6) "e28c88" -string(6) "e28c89" -string(6) "e28c8a" -string(6) "e28c8b" -string(6) "e28ca9" -string(6) "e28caa" diff --git a/ext/standard/tests/strings/implode.phpt b/ext/standard/tests/strings/implode.phpt deleted file mode 100644 index 36be0f395cfd7..0000000000000 --- a/ext/standard/tests/strings/implode.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -implode() function ---INI-- -error_reporting=2047 -log_errors=0 -display_errors=0 -track_errors=1 ---FILE-- - ---EXPECTF-- - - -foobarbaz -foo:bar:baz -foo:Array:burp -Array to string conversion diff --git a/ext/standard/tests/strings/md5.phpt b/ext/standard/tests/strings/md5.phpt deleted file mode 100644 index 32dba03609acc..0000000000000 --- a/ext/standard/tests/strings/md5.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -md5() with ASCII output ---FILE-- - ---EXPECT-- -d41d8cd98f00b204e9800998ecf8427e -0cc175b9c0f1b6a831c399e269772661 -900150983cd24fb0d6963f7d28e17f72 -f96b697d7cb7938d525a2f31aaf161d0 -c3fcd3d76192e4007dfb496cca67e13b -d174ab98d277d9f5a5611c2c9f419d9f -57edf4a22be3c955ac49da2e2107b67a diff --git a/ext/standard/tests/strings/md5raw.phpt b/ext/standard/tests/strings/md5raw.phpt deleted file mode 100644 index 8f71ea6d0e030..0000000000000 --- a/ext/standard/tests/strings/md5raw.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -md5() with RAW output ---FILE-- - ---EXPECT-- -d41d8cd98f00b204e9800998ecf8427e -0cc175b9c0f1b6a831c399e269772661 -900150983cd24fb0d6963f7d28e17f72 -f96b697d7cb7938d525a2f31aaf161d0 -c3fcd3d76192e4007dfb496cca67e13b -d174ab98d277d9f5a5611c2c9f419d9f -57edf4a22be3c955ac49da2e2107b67a diff --git a/ext/standard/tests/strings/nl2br.phpt b/ext/standard/tests/strings/nl2br.phpt deleted file mode 100644 index e43d435dfe24b..0000000000000 --- a/ext/standard/tests/strings/nl2br.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -nl2br() function ---FILE-- - ---EXPECT-- -string(4) "test" -string(0) "" -string(0) "" -string(8) "
              -" -string(7) "
              -" -string(7) "
              -" -string(8) "
              - -" -string(44) "
              - -
              -
              -
              -
              -
              -" -string(47) "
              - -
              -
              - -
              - -
              -
              -" -string(66) "
              - -
              -
              -
              -
              - -
              -
              -
              -
              -" diff --git a/ext/standard/tests/strings/sha1.phpt b/ext/standard/tests/strings/sha1.phpt deleted file mode 100644 index c405eedde5924..0000000000000 --- a/ext/standard/tests/strings/sha1.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sha1() with ASCII output ---FILE-- - ---EXPECT-- -a9993e364706816aba3e25717850c26c9cd0d89d -84983e441c3bd26ebaae4aa1f95129e5e54670f1 -86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -e0c094e867ef46c350ef54a7f59dd60bed92ae83 diff --git a/ext/standard/tests/strings/sha1raw.phpt b/ext/standard/tests/strings/sha1raw.phpt deleted file mode 100644 index 6777cab3ee0b7..0000000000000 --- a/ext/standard/tests/strings/sha1raw.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sha1() with RAW output ---FILE-- - ---EXPECT-- -a9993e364706816aba3e25717850c26c9cd0d89d -84983e441c3bd26ebaae4aa1f95129e5e54670f1 -86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -e0c094e867ef46c350ef54a7f59dd60bed92ae83 diff --git a/ext/standard/tests/strings/sprintf_f.phpt b/ext/standard/tests/strings/sprintf_f.phpt deleted file mode 100755 index 6135270d23ee8..0000000000000 --- a/ext/standard/tests/strings/sprintf_f.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -sprintf %f ---FILE-- - ---EXPECTF-- -string(4) "1.20" -string(4) "1.20" -string(4) "1.20" -string(4) "1.20" - -string(5) " 3.40" -string(5) "3.40 " -string(5) "03.40" -string(5) "3.400" - -string(7) " -5.60" -string(7) "-5.60 " -string(7) "-005.60" -string(7) "-5.6000" - -string(105) "12345678%d00000000000000000000000000000000000000000000000000.0000" \ No newline at end of file diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt deleted file mode 100644 index f91bd31b670be..0000000000000 --- a/ext/standard/tests/strings/str_repeat.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -str_repeat() function ---FILE-- - ---EXPECT-- - -a -aa -aaa -aaaa - -foo -foofoo -foofoofoo -foofoofoofoo - -barbazbax -barbazbaxbarbazbax -barbazbaxbarbazbaxbarbazbax -barbazbaxbarbazbaxbarbazbaxbarbazbax diff --git a/ext/standard/tests/strings/str_shuffle.phpt b/ext/standard/tests/strings/str_shuffle.phpt deleted file mode 100644 index 32f387287b02f..0000000000000 --- a/ext/standard/tests/strings/str_shuffle.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Testing str_shuffle. ---FILE-- - ---EXPECTF-- -string(3) %s -string(3) "123" \ No newline at end of file diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt deleted file mode 100644 index 2e5d15d54aa47..0000000000000 --- a/ext/standard/tests/strings/str_word_count.phpt +++ /dev/null @@ -1,228 +0,0 @@ ---TEST-- -str_word_count() ---FILE-- - ---EXPECTF-- -array(6) { - [0]=> - string(5) "Hello" - [1]=> - string(6) "friend" - [2]=> - string(6) "you're" - [3]=> - string(7) "looking" - [4]=> - string(4) "good" - [5]=> - string(5) "today" -} -array(6) { - [0]=> - string(5) "Hello" - [6]=> - string(6) "friend" - [14]=> - string(6) "you're" - [27]=> - string(7) "looking" - [44]=> - string(4) "good" - [49]=> - string(5) "today" -} -int(6) -NULL -NULL -NULL -NULL - -Warning: str_word_count() expects parameter 2 to be long, array given in %s on line 13 - -Warning: Wrong parameter count for str_word_count() in %s on line 13 -NULL - -Warning: str_word_count() expects parameter 2 to be long, native string given in %s on line 14 - -Warning: Wrong parameter count for str_word_count() in %s on line 14 -NULL -string(55) "Hello friend, you're - looking good today!" -int(5) -int(6) -int(5) - -Warning: str_word_count() expects parameter 3 to be native string, array given in %s on line 21 - -Warning: Wrong parameter count for str_word_count() in %s on line 21 -NULL - -Warning: str_word_count() expects parameter 3 to be native string, object given in %s on line 22 - -Warning: Wrong parameter count for str_word_count() in %s on line 22 -NULL -int(7) -array(5) { - [0]=> - string(3) "F0o" - [1]=> - string(3) "B4r" - [2]=> - string(1) "s" - [3]=> - string(3) "bar" - [4]=> - string(3) "foo" -} -array(6) { - [0]=> - string(3) "F0o" - [1]=> - string(1) "B" - [2]=> - string(1) "r" - [3]=> - string(2) "1s" - [4]=> - string(3) "bar" - [5]=> - string(3) "foo" -} -array(5) { - [0]=> - string(3) "F0o" - [1]=> - string(3) "B4r" - [2]=> - string(2) "1s" - [3]=> - string(3) "bar" - [4]=> - string(3) "foo" -} - -Warning: str_word_count() expects parameter 3 to be native string, array given in %s on line 27 - -Warning: Wrong parameter count for str_word_count() in %s on line 27 -NULL - -Warning: str_word_count() expects parameter 3 to be native string, object given in %s on line 28 - -Warning: Wrong parameter count for str_word_count() in %s on line 28 -NULL -array(7) { - [0]=> - string(1) "F" - [1]=> - string(1) "o" - [2]=> - string(1) "B" - [3]=> - string(1) "r" - [4]=> - string(1) "s" - [5]=> - string(3) "bar" - [6]=> - string(3) "foo" -} -array(5) { - [0]=> - string(3) "F0o" - [4]=> - string(3) "B4r" - [9]=> - string(1) "s" - [11]=> - string(3) "bar" - [15]=> - string(3) "foo" -} -array(6) { - [0]=> - string(3) "F0o" - [4]=> - string(1) "B" - [6]=> - string(1) "r" - [8]=> - string(2) "1s" - [11]=> - string(3) "bar" - [15]=> - string(3) "foo" -} -array(5) { - [0]=> - string(3) "F0o" - [4]=> - string(3) "B4r" - [8]=> - string(2) "1s" - [11]=> - string(3) "bar" - [15]=> - string(3) "foo" -} - -Warning: str_word_count() expects parameter 3 to be native string, array given in %s on line 33 - -Warning: Wrong parameter count for str_word_count() in %s on line 33 -NULL - -Warning: str_word_count() expects parameter 3 to be native string, object given in %s on line 34 - -Warning: Wrong parameter count for str_word_count() in %s on line 34 -NULL -array(7) { - [0]=> - string(1) "F" - [2]=> - string(1) "o" - [4]=> - string(1) "B" - [6]=> - string(1) "r" - [9]=> - string(1) "s" - [11]=> - string(3) "bar" - [15]=> - string(3) "foo" -} \ No newline at end of file diff --git a/ext/standard/tests/strings/strcspn.phpt b/ext/standard/tests/strings/strcspn.phpt deleted file mode 100644 index 8f8b1a4285dc6..0000000000000 --- a/ext/standard/tests/strings/strcspn.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test strcspn() behavior ---FILE-- - ---EXPECT-- -string(25) "22222222aaaa bbb1111 cccc" -string(4) "1234" -int(0) -int(7) -int(6) ---UEXPECT-- -unicode(25) "22222222aaaa bbb1111 cccc" -unicode(4) "1234" -int(0) -int(7) -int(6) diff --git a/ext/standard/tests/strings/strings001.phpt b/ext/standard/tests/strings/strings001.phpt deleted file mode 100644 index 87f8489b8a48b..0000000000000 --- a/ext/standard/tests/strings/strings001.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Test whether strstr() and strrchr() are binary safe. ---FILE-- - ---EXPECTREGEX-- -string\(18\) \"nica\x00turska panica\" -string\(19\) \" nica\x00turska panica\" diff --git a/ext/standard/tests/strings/strip_tags.phpt b/ext/standard/tests/strings/strip_tags.phpt deleted file mode 100644 index 7beebf1b0ceec..0000000000000 --- a/ext/standard/tests/strings/strip_tags.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -strip_tags() function ---FILE-- - STUFF'); - echo "\n"; - echo strip_tags('NEAT blah ?> STUFF'); - echo "\n"; - echo strip_tags('NEAT STUFF'); - echo "\n"; - echo strip_tags('NEAT STUFF'); - echo "\n"; - echo strip_tags('NEAT STUFF'); - echo "\n"; - echo strip_tags('NEAT STUFF'); - echo "\n"; - echo strip_tags('TESTS ?!!?!?!!!?!!'); - echo "\n"; -?> ---EXPECT-- -NEAT STUFF -NEAT STUFF -NEAT STUFF -NEAT STUFF -NEAT STUFF -NEAT STUFF -TESTS ?!!?!?!!!?!! diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt deleted file mode 100644 index cb5f193c76e66..0000000000000 --- a/ext/standard/tests/strings/stristr.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -stristr() function ---FILE-- - ---EXPECT-- -string(11) "tEsT sTrInG" -string(6) "sTrInG" -string(6) "sTrInG" -string(8) "T sTrInG" -string(1) "G" -string(32) "7272696018bdeb2c9a3f8d01fc2a9273" -bool(false) -bool(false) -bool(false) -string(32) "6ec19f52f0766c463f3bb240f4396913" -string(7) " sTrInG" -string(4) "tEsT" diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt deleted file mode 100644 index 4d30e9822923f..0000000000000 --- a/ext/standard/tests/strings/strpos.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -strpos() function ---FILE-- - ---EXPECT-- -int(0) -int(5) -int(5) -int(3) -int(10) -int(2) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) diff --git a/ext/standard/tests/strings/strrev.phpt b/ext/standard/tests/strings/strrev.phpt deleted file mode 100644 index 321aca5bd7a69..0000000000000 --- a/ext/standard/tests/strings/strrev.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -strrev() function ---FILE-- - ---EXPECT-- -string(32) "ec6df70f2569891eae50321a9179eb82" -string(0) "" -string(0) "" diff --git a/ext/standard/tests/strings/strripos.phpt b/ext/standard/tests/strings/strripos.phpt deleted file mode 100644 index eb4e70bd354a9..0000000000000 --- a/ext/standard/tests/strings/strripos.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -strripos() function ---FILE-- - ---EXPECT-- -int(5) -int(12) -int(18) -int(12) -int(10) -int(2) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) - diff --git a/ext/standard/tests/strings/strrpos.phpt b/ext/standard/tests/strings/strrpos.phpt deleted file mode 100644 index 691f67e599e14..0000000000000 --- a/ext/standard/tests/strings/strrpos.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -strrpos() function ---FILE-- - ---EXPECT-- -int(5) -int(5) -int(18) -int(12) -int(10) -int(2) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) diff --git a/ext/standard/tests/strings/strspn.phpt b/ext/standard/tests/strings/strspn.phpt deleted file mode 100644 index 6780e1d3981c4..0000000000000 --- a/ext/standard/tests/strings/strspn.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test strspn() behavior ---FILE-- - ---EXPECT-- -string(25) "22222222aaaa bbb1111 cccc" -string(4) "1234" -int(8) -int(6) -int(3) ---UEXPECT-- -unicode(25) "22222222aaaa bbb1111 cccc" -unicode(4) "1234" -int(8) -int(6) -int(3) diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt deleted file mode 100644 index 85e832e69e923..0000000000000 --- a/ext/standard/tests/strings/strstr.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -strstr() function ---FILE-- - ---EXPECT-- -string(11) "test string" -string(6) "string" -string(6) "string" -string(8) "t string" -string(1) "g" -string(32) "7272696018bdeb2c9a3f8d01fc2a9273" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -string(32) "6ec19f52f0766c463f3bb240f4396913" -string(7) " string" -string(4) "test" ---UEXPECT-- -unicode(11) "test string" -unicode(6) "string" -unicode(6) "string" -unicode(8) "t string" -unicode(1) "g" -unicode(32) "7272696018bdeb2c9a3f8d01fc2a9273" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -unicode(32) "6ec19f52f0766c463f3bb240f4396913" -unicode(7) " string" -unicode(4) "test" diff --git a/ext/standard/tests/strings/strtoupper.phpt b/ext/standard/tests/strings/strtoupper.phpt deleted file mode 100644 index b338bd881a8d4..0000000000000 --- a/ext/standard/tests/strings/strtoupper.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test strtoupper on non-ASCII characters ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - ---EXPECT-- -ÄÖÜ diff --git a/ext/standard/tests/strings/strtr.phpt b/ext/standard/tests/strings/strtr.phpt deleted file mode 100644 index 80ed722b8e4c3..0000000000000 --- a/ext/standard/tests/strings/strtr.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -strtr() function ---FILE-- -"hi", "hi"=>"hello", "a"=>"A", "world"=>"planet"); -var_dump(strtr("# hi all, I said hello world! #", $trans)); -?> ---EXPECT-- -string(32) "# hello All, I sAid hi planet! #" \ No newline at end of file diff --git a/ext/standard/tests/strings/strval.phpt b/ext/standard/tests/strings/strval.phpt deleted file mode 100644 index 3f8b5cc985d1b..0000000000000 --- a/ext/standard/tests/strings/strval.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -strval() function ---FILE-- - ---EXPECT-- -string(3) "bar" -string(3) "BAR" -string(6) "foobar" -string(1) "1" -string(3) "1.1" -string(1) "1" -string(0) "" -string(5) "Array" diff --git a/ext/standard/tests/strings/substr_count.phpt b/ext/standard/tests/strings/substr_count.phpt deleted file mode 100644 index 6aee365340ed7..0000000000000 --- a/ext/standard/tests/strings/substr_count.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -substr_count() function ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(100) -int(200) -int(160) -int(10) diff --git a/ext/standard/tests/strings/substr_replace.phpt b/ext/standard/tests/strings/substr_replace.phpt deleted file mode 100644 index a0c338e8eefa9..0000000000000 --- a/ext/standard/tests/strings/substr_replace.phpt +++ /dev/null @@ -1,1171 +0,0 @@ ---TEST-- -substr_replace() function ---FILE-- - ---EXPECT-- -substr_replace('try this', 'bala ', 2) -string(7) "trbala " - -substr_replace('try this', 'bala ', 2, 3) -string(10) "trbala his" - -substr_replace('try this', 'bala ', 2, 0) -string(13) "trbala y this" - -substr_replace('try this', 'bala ', 2, -2) -string(9) "trbala is" - - - -substr_replace('try this', array ( 0 => 'bala ',), 4 -string(9) "try bala " - -substr_replace('try this', array ( 0 => 'bala ',), 4 -string(10) "try bala s" - - - - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,) -array(1) { - [0]=> - string(9) "ala bala " -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 3,)) -array(1) { - [0]=> - string(15) "ala bala tokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 0,)) -array(1) { - [0]=> - string(18) "ala bala portokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => -2,)) -array(1) { - [0]=> - string(11) "ala bala la" -} - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',4) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) "try s" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "try bala s" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "try bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(6) "try is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(11) "try bala is" -} - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) " this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "bala try this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(2) "is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(7) "bala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "trbala his" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(4) "tris" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(9) "trbala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(7) "trbala " -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(6) "trthis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(11) "trbala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(10) "trbala his" -} ---UEXPECT-- -substr_replace('try this', 'bala ', 2) -unicode(7) "trbala " - -substr_replace('try this', 'bala ', 2, 3) -unicode(10) "trbala his" - -substr_replace('try this', 'bala ', 2, 0) -unicode(13) "trbala y this" - -substr_replace('try this', 'bala ', 2, -2) -unicode(9) "trbala is" - - - -substr_replace('try this', array ( 0 => 'bala ',), 4 -unicode(9) "try bala " - -substr_replace('try this', array ( 0 => 'bala ',), 4 -unicode(10) "try bala s" - - - - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,) -array(1) { - [0]=> - unicode(9) "ala bala " -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 3,)) -array(1) { - [0]=> - unicode(15) "ala bala tokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 0,)) -array(1) { - [0]=> - unicode(18) "ala bala portokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => -2,)) -array(1) { - [0]=> - unicode(11) "ala bala la" -} - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',4) -array(1) { - [0]=> - unicode(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(5) "try s" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(10) "try bala s" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(13) "try bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(6) "try is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(11) "try bala is" -} - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4,)) -array(1) { - [0]=> - unicode(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(5) " this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(10) "bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(13) "bala try this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(2) "is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(7) "bala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - unicode(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(10) "trbala his" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(4) "tris" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(9) "trbala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - unicode(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(7) "trbala " -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - unicode(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(6) "trthis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - unicode(15) "ala bala tokala" - [1]=> - unicode(11) "trbala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - unicode(18) "ala bala portokala" - [1]=> - unicode(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - unicode(11) "ala bala la" - [1]=> - unicode(10) "trbala his" -} diff --git a/ext/standard/tests/strings/trim.phpt b/ext/standard/tests/strings/trim.phpt deleted file mode 100644 index a69f17c6d7ad4..0000000000000 --- a/ext/standard/tests/strings/trim.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -trim(), rtrim() and ltrim() functions ---FILE-- - ---EXPECT-- -array(1) { - ["path"]=> - string(0) "" -} -array(1) { - ["path"]=> - string(12) "64.246.30.37" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(13) "64.246.30.37/" -} -array(3) { - ["host"]=> - string(12) "64.246.30.37" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(7) "php.net" -} -array(1) { - ["path"]=> - string(8) "php.net/" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(11) "www.php.net" -} -array(1) { - ["path"]=> - string(12) "www.php.net/" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} -array(2) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" -} -array(1) { - ["path"]=> - string(12) "www.php.net/" -} -array(3) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(18) "/foo/bar/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" - ["query"]=> - string(37) "lots=1&of=2¶meters=3&too=4&here=5" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(45) "/this/is/a/very/deep/directory/structure/and/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(28) "/this/../a/../deep/directory" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(29) "/this/../a/../deep/directory/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(42) "/this/is/a/very/deep/directory/../file.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["fragment"]=> - string(3) "foo" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(6) "test=1" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" - ["query"]=> - string(7) "test=1&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(1) "&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(7) "test=1&" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(1) "&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "foo&" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "&foo" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" -} -array(5) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(19) "hideout@www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hid:out" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(2) { - ["scheme"]=> - string(4) "nntp" - ["host"]=> - string(12) "news.php.net" -} -array(3) { - ["scheme"]=> - string(3) "ftp" - ["host"]=> - string(11) "ftp.gnu.org" - ["path"]=> - string(22) "/gnu/glic/glibc.tar.gz" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(14) "http://foo@bar" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(12) "filename.txt" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(25) "/path/to/my/file/file.txt" -} -array(3) { - ["scheme"]=> - string(3) "foo" - ["host"]=> - string(3) "bar" - ["user"]=> - string(3) "foo" -} -array(2) { - ["scheme"]=> - string(6) "mailto" - ["path"]=> - string(15) "me@mydomain.com" -} -array(2) { - ["path"]=> - string(8) "/foo.php" - ["query"]=> - string(7) "a=b&c=d" -} -array(2) { - ["path"]=> - string(7) "foo.php" - ["query"]=> - string(7) "a=b&c=d" -} -array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(15) "www.example.com" - ["port"]=> - int(8080) - ["user"]=> - string(4) "user" - ["pass"]=> - string(6) "passwd" - ["query"]=> - string(12) "bar=1&boom=0" -} -array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} -array(3) { - ["scheme"]=> - string(4) "file" - ["host"]=> - string(4) "path" - ["path"]=> - string(8) "/to/file" -} -array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "1.2.3.4" - ["path"]=> - string(8) "/abc.asp" - ["query"]=> - string(7) "a=1&b=2" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "foo.com" - ["fragment"]=> - string(3) "bar" -} -array(1) { - ["scheme"]=> - string(6) "scheme" -} -array(4) { - ["scheme"]=> - string(7) "foo+bar" - ["host"]=> - string(4) "bang" - ["user"]=> - string(3) "baz" - ["path"]=> - string(4) "/bla" -} diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt deleted file mode 100644 index 66104e3c77820..0000000000000 --- a/ext/standard/tests/strings/wordwrap.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -wordwrap() function ---FILE-- - ---FILE-- - $last_t || ($time == $last_t && $micro >= $last_m)) { - $passed++; - } else if ($failed++ <=10) { - $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n"; - } - $last_m = $micro; - $last_t = $time; -} -echo "Passed: $passed\n"; -echo "Failed: $failed\n"; -echo $result; -?> ---EXPECT-- -Passed: 100000 -Failed: 0 diff --git a/ext/standard/tests/time/idate.phpt b/ext/standard/tests/time/idate.phpt deleted file mode 100644 index 485f9804af74f..0000000000000 --- a/ext/standard/tests/time/idate.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -idate() function ---FILE-- - ---EXPECT-- -U: 1043324459 -Y: 2003 -z: 22 -y: 3 -m: 1 -n: 1 -d: 23 -j: 23 -H: 12 -G: 12 -h: 12 -g: 12 -i: 20 -s: 59 -t: 31 -w: 4 -L: 0 -B: 556 -I: 0 -W: 4 diff --git a/ext/standard/tests/versioning/version_compare.phpt b/ext/standard/tests/versioning/version_compare.phpt deleted file mode 100644 index 6ef49ba7772cc..0000000000000 --- a/ext/standard/tests/versioning/version_compare.phpt +++ /dev/null @@ -1,600 +0,0 @@ ---TEST-- -version_compare test ---FILE-- -", - "ge", ">=", - "eq", "=", "==", - "ne", "<>", "!=" -); -test("1", "2"); -test("10", "2"); -test("1.0", "1.1"); -test("1.2", "1.0.1"); -foreach ($special_forms as $f1) { - foreach ($special_forms as $f2) { - test("1.0$f1", "1.0$f2"); - } -} -print "TESTING OPERATORS\n"; -foreach ($special_forms as $f1) { - foreach ($special_forms as $f2) { - foreach ($operators as $op) { - $v1 = "1.0$f1"; - $v2 = "1.0$f2"; - $test = version_compare($v1, $v2, $op) ? "true" : "false"; - printf("%7s %2s %-7s : %s\n", $v1, $op, $v2, $test); - } - } -} - -function test($v1, $v2) { - $compare = version_compare($v1, $v2); - switch ($compare) { - case -1: - print "$v1 < $v2\n"; - break; - case 1: - print "$v1 > $v2\n"; - break; - case 0: - default: - print "$v1 = $v2\n"; - break; - } -} - -?> ---EXPECT-- -TESTING COMPARE -1 < 2 -10 > 2 -1.0 < 1.1 -1.2 > 1.0.1 -1.0-dev = 1.0-dev -1.0-dev < 1.0a1 -1.0-dev < 1.0b1 -1.0-dev < 1.0RC1 -1.0-dev < 1.0 -1.0-dev < 1.0pl1 -1.0a1 > 1.0-dev -1.0a1 = 1.0a1 -1.0a1 < 1.0b1 -1.0a1 < 1.0RC1 -1.0a1 < 1.0 -1.0a1 < 1.0pl1 -1.0b1 > 1.0-dev -1.0b1 > 1.0a1 -1.0b1 = 1.0b1 -1.0b1 < 1.0RC1 -1.0b1 < 1.0 -1.0b1 < 1.0pl1 -1.0RC1 > 1.0-dev -1.0RC1 > 1.0a1 -1.0RC1 > 1.0b1 -1.0RC1 = 1.0RC1 -1.0RC1 < 1.0 -1.0RC1 < 1.0pl1 -1.0 > 1.0-dev -1.0 > 1.0a1 -1.0 > 1.0b1 -1.0 > 1.0RC1 -1.0 = 1.0 -1.0 < 1.0pl1 -1.0pl1 > 1.0-dev -1.0pl1 > 1.0a1 -1.0pl1 > 1.0b1 -1.0pl1 > 1.0RC1 -1.0pl1 > 1.0 -1.0pl1 = 1.0pl1 -TESTING OPERATORS -1.0-dev lt 1.0-dev : false -1.0-dev < 1.0-dev : false -1.0-dev le 1.0-dev : true -1.0-dev <= 1.0-dev : true -1.0-dev gt 1.0-dev : false -1.0-dev > 1.0-dev : false -1.0-dev ge 1.0-dev : true -1.0-dev >= 1.0-dev : true -1.0-dev eq 1.0-dev : true -1.0-dev = 1.0-dev : true -1.0-dev == 1.0-dev : true -1.0-dev ne 1.0-dev : false -1.0-dev <> 1.0-dev : false -1.0-dev != 1.0-dev : false -1.0-dev lt 1.0a1 : true -1.0-dev < 1.0a1 : true -1.0-dev le 1.0a1 : true -1.0-dev <= 1.0a1 : true -1.0-dev gt 1.0a1 : false -1.0-dev > 1.0a1 : false -1.0-dev ge 1.0a1 : false -1.0-dev >= 1.0a1 : false -1.0-dev eq 1.0a1 : false -1.0-dev = 1.0a1 : false -1.0-dev == 1.0a1 : false -1.0-dev ne 1.0a1 : true -1.0-dev <> 1.0a1 : true -1.0-dev != 1.0a1 : true -1.0-dev lt 1.0b1 : true -1.0-dev < 1.0b1 : true -1.0-dev le 1.0b1 : true -1.0-dev <= 1.0b1 : true -1.0-dev gt 1.0b1 : false -1.0-dev > 1.0b1 : false -1.0-dev ge 1.0b1 : false -1.0-dev >= 1.0b1 : false -1.0-dev eq 1.0b1 : false -1.0-dev = 1.0b1 : false -1.0-dev == 1.0b1 : false -1.0-dev ne 1.0b1 : true -1.0-dev <> 1.0b1 : true -1.0-dev != 1.0b1 : true -1.0-dev lt 1.0RC1 : true -1.0-dev < 1.0RC1 : true -1.0-dev le 1.0RC1 : true -1.0-dev <= 1.0RC1 : true -1.0-dev gt 1.0RC1 : false -1.0-dev > 1.0RC1 : false -1.0-dev ge 1.0RC1 : false -1.0-dev >= 1.0RC1 : false -1.0-dev eq 1.0RC1 : false -1.0-dev = 1.0RC1 : false -1.0-dev == 1.0RC1 : false -1.0-dev ne 1.0RC1 : true -1.0-dev <> 1.0RC1 : true -1.0-dev != 1.0RC1 : true -1.0-dev lt 1.0 : true -1.0-dev < 1.0 : true -1.0-dev le 1.0 : true -1.0-dev <= 1.0 : true -1.0-dev gt 1.0 : false -1.0-dev > 1.0 : false -1.0-dev ge 1.0 : false -1.0-dev >= 1.0 : false -1.0-dev eq 1.0 : false -1.0-dev = 1.0 : false -1.0-dev == 1.0 : false -1.0-dev ne 1.0 : true -1.0-dev <> 1.0 : true -1.0-dev != 1.0 : true -1.0-dev lt 1.0pl1 : true -1.0-dev < 1.0pl1 : true -1.0-dev le 1.0pl1 : true -1.0-dev <= 1.0pl1 : true -1.0-dev gt 1.0pl1 : false -1.0-dev > 1.0pl1 : false -1.0-dev ge 1.0pl1 : false -1.0-dev >= 1.0pl1 : false -1.0-dev eq 1.0pl1 : false -1.0-dev = 1.0pl1 : false -1.0-dev == 1.0pl1 : false -1.0-dev ne 1.0pl1 : true -1.0-dev <> 1.0pl1 : true -1.0-dev != 1.0pl1 : true - 1.0a1 lt 1.0-dev : false - 1.0a1 < 1.0-dev : false - 1.0a1 le 1.0-dev : false - 1.0a1 <= 1.0-dev : false - 1.0a1 gt 1.0-dev : true - 1.0a1 > 1.0-dev : true - 1.0a1 ge 1.0-dev : true - 1.0a1 >= 1.0-dev : true - 1.0a1 eq 1.0-dev : false - 1.0a1 = 1.0-dev : false - 1.0a1 == 1.0-dev : false - 1.0a1 ne 1.0-dev : true - 1.0a1 <> 1.0-dev : true - 1.0a1 != 1.0-dev : true - 1.0a1 lt 1.0a1 : false - 1.0a1 < 1.0a1 : false - 1.0a1 le 1.0a1 : true - 1.0a1 <= 1.0a1 : true - 1.0a1 gt 1.0a1 : false - 1.0a1 > 1.0a1 : false - 1.0a1 ge 1.0a1 : true - 1.0a1 >= 1.0a1 : true - 1.0a1 eq 1.0a1 : true - 1.0a1 = 1.0a1 : true - 1.0a1 == 1.0a1 : true - 1.0a1 ne 1.0a1 : false - 1.0a1 <> 1.0a1 : false - 1.0a1 != 1.0a1 : false - 1.0a1 lt 1.0b1 : true - 1.0a1 < 1.0b1 : true - 1.0a1 le 1.0b1 : true - 1.0a1 <= 1.0b1 : true - 1.0a1 gt 1.0b1 : false - 1.0a1 > 1.0b1 : false - 1.0a1 ge 1.0b1 : false - 1.0a1 >= 1.0b1 : false - 1.0a1 eq 1.0b1 : false - 1.0a1 = 1.0b1 : false - 1.0a1 == 1.0b1 : false - 1.0a1 ne 1.0b1 : true - 1.0a1 <> 1.0b1 : true - 1.0a1 != 1.0b1 : true - 1.0a1 lt 1.0RC1 : true - 1.0a1 < 1.0RC1 : true - 1.0a1 le 1.0RC1 : true - 1.0a1 <= 1.0RC1 : true - 1.0a1 gt 1.0RC1 : false - 1.0a1 > 1.0RC1 : false - 1.0a1 ge 1.0RC1 : false - 1.0a1 >= 1.0RC1 : false - 1.0a1 eq 1.0RC1 : false - 1.0a1 = 1.0RC1 : false - 1.0a1 == 1.0RC1 : false - 1.0a1 ne 1.0RC1 : true - 1.0a1 <> 1.0RC1 : true - 1.0a1 != 1.0RC1 : true - 1.0a1 lt 1.0 : true - 1.0a1 < 1.0 : true - 1.0a1 le 1.0 : true - 1.0a1 <= 1.0 : true - 1.0a1 gt 1.0 : false - 1.0a1 > 1.0 : false - 1.0a1 ge 1.0 : false - 1.0a1 >= 1.0 : false - 1.0a1 eq 1.0 : false - 1.0a1 = 1.0 : false - 1.0a1 == 1.0 : false - 1.0a1 ne 1.0 : true - 1.0a1 <> 1.0 : true - 1.0a1 != 1.0 : true - 1.0a1 lt 1.0pl1 : true - 1.0a1 < 1.0pl1 : true - 1.0a1 le 1.0pl1 : true - 1.0a1 <= 1.0pl1 : true - 1.0a1 gt 1.0pl1 : false - 1.0a1 > 1.0pl1 : false - 1.0a1 ge 1.0pl1 : false - 1.0a1 >= 1.0pl1 : false - 1.0a1 eq 1.0pl1 : false - 1.0a1 = 1.0pl1 : false - 1.0a1 == 1.0pl1 : false - 1.0a1 ne 1.0pl1 : true - 1.0a1 <> 1.0pl1 : true - 1.0a1 != 1.0pl1 : true - 1.0b1 lt 1.0-dev : false - 1.0b1 < 1.0-dev : false - 1.0b1 le 1.0-dev : false - 1.0b1 <= 1.0-dev : false - 1.0b1 gt 1.0-dev : true - 1.0b1 > 1.0-dev : true - 1.0b1 ge 1.0-dev : true - 1.0b1 >= 1.0-dev : true - 1.0b1 eq 1.0-dev : false - 1.0b1 = 1.0-dev : false - 1.0b1 == 1.0-dev : false - 1.0b1 ne 1.0-dev : true - 1.0b1 <> 1.0-dev : true - 1.0b1 != 1.0-dev : true - 1.0b1 lt 1.0a1 : false - 1.0b1 < 1.0a1 : false - 1.0b1 le 1.0a1 : false - 1.0b1 <= 1.0a1 : false - 1.0b1 gt 1.0a1 : true - 1.0b1 > 1.0a1 : true - 1.0b1 ge 1.0a1 : true - 1.0b1 >= 1.0a1 : true - 1.0b1 eq 1.0a1 : false - 1.0b1 = 1.0a1 : false - 1.0b1 == 1.0a1 : false - 1.0b1 ne 1.0a1 : true - 1.0b1 <> 1.0a1 : true - 1.0b1 != 1.0a1 : true - 1.0b1 lt 1.0b1 : false - 1.0b1 < 1.0b1 : false - 1.0b1 le 1.0b1 : true - 1.0b1 <= 1.0b1 : true - 1.0b1 gt 1.0b1 : false - 1.0b1 > 1.0b1 : false - 1.0b1 ge 1.0b1 : true - 1.0b1 >= 1.0b1 : true - 1.0b1 eq 1.0b1 : true - 1.0b1 = 1.0b1 : true - 1.0b1 == 1.0b1 : true - 1.0b1 ne 1.0b1 : false - 1.0b1 <> 1.0b1 : false - 1.0b1 != 1.0b1 : false - 1.0b1 lt 1.0RC1 : true - 1.0b1 < 1.0RC1 : true - 1.0b1 le 1.0RC1 : true - 1.0b1 <= 1.0RC1 : true - 1.0b1 gt 1.0RC1 : false - 1.0b1 > 1.0RC1 : false - 1.0b1 ge 1.0RC1 : false - 1.0b1 >= 1.0RC1 : false - 1.0b1 eq 1.0RC1 : false - 1.0b1 = 1.0RC1 : false - 1.0b1 == 1.0RC1 : false - 1.0b1 ne 1.0RC1 : true - 1.0b1 <> 1.0RC1 : true - 1.0b1 != 1.0RC1 : true - 1.0b1 lt 1.0 : true - 1.0b1 < 1.0 : true - 1.0b1 le 1.0 : true - 1.0b1 <= 1.0 : true - 1.0b1 gt 1.0 : false - 1.0b1 > 1.0 : false - 1.0b1 ge 1.0 : false - 1.0b1 >= 1.0 : false - 1.0b1 eq 1.0 : false - 1.0b1 = 1.0 : false - 1.0b1 == 1.0 : false - 1.0b1 ne 1.0 : true - 1.0b1 <> 1.0 : true - 1.0b1 != 1.0 : true - 1.0b1 lt 1.0pl1 : true - 1.0b1 < 1.0pl1 : true - 1.0b1 le 1.0pl1 : true - 1.0b1 <= 1.0pl1 : true - 1.0b1 gt 1.0pl1 : false - 1.0b1 > 1.0pl1 : false - 1.0b1 ge 1.0pl1 : false - 1.0b1 >= 1.0pl1 : false - 1.0b1 eq 1.0pl1 : false - 1.0b1 = 1.0pl1 : false - 1.0b1 == 1.0pl1 : false - 1.0b1 ne 1.0pl1 : true - 1.0b1 <> 1.0pl1 : true - 1.0b1 != 1.0pl1 : true - 1.0RC1 lt 1.0-dev : false - 1.0RC1 < 1.0-dev : false - 1.0RC1 le 1.0-dev : false - 1.0RC1 <= 1.0-dev : false - 1.0RC1 gt 1.0-dev : true - 1.0RC1 > 1.0-dev : true - 1.0RC1 ge 1.0-dev : true - 1.0RC1 >= 1.0-dev : true - 1.0RC1 eq 1.0-dev : false - 1.0RC1 = 1.0-dev : false - 1.0RC1 == 1.0-dev : false - 1.0RC1 ne 1.0-dev : true - 1.0RC1 <> 1.0-dev : true - 1.0RC1 != 1.0-dev : true - 1.0RC1 lt 1.0a1 : false - 1.0RC1 < 1.0a1 : false - 1.0RC1 le 1.0a1 : false - 1.0RC1 <= 1.0a1 : false - 1.0RC1 gt 1.0a1 : true - 1.0RC1 > 1.0a1 : true - 1.0RC1 ge 1.0a1 : true - 1.0RC1 >= 1.0a1 : true - 1.0RC1 eq 1.0a1 : false - 1.0RC1 = 1.0a1 : false - 1.0RC1 == 1.0a1 : false - 1.0RC1 ne 1.0a1 : true - 1.0RC1 <> 1.0a1 : true - 1.0RC1 != 1.0a1 : true - 1.0RC1 lt 1.0b1 : false - 1.0RC1 < 1.0b1 : false - 1.0RC1 le 1.0b1 : false - 1.0RC1 <= 1.0b1 : false - 1.0RC1 gt 1.0b1 : true - 1.0RC1 > 1.0b1 : true - 1.0RC1 ge 1.0b1 : true - 1.0RC1 >= 1.0b1 : true - 1.0RC1 eq 1.0b1 : false - 1.0RC1 = 1.0b1 : false - 1.0RC1 == 1.0b1 : false - 1.0RC1 ne 1.0b1 : true - 1.0RC1 <> 1.0b1 : true - 1.0RC1 != 1.0b1 : true - 1.0RC1 lt 1.0RC1 : false - 1.0RC1 < 1.0RC1 : false - 1.0RC1 le 1.0RC1 : true - 1.0RC1 <= 1.0RC1 : true - 1.0RC1 gt 1.0RC1 : false - 1.0RC1 > 1.0RC1 : false - 1.0RC1 ge 1.0RC1 : true - 1.0RC1 >= 1.0RC1 : true - 1.0RC1 eq 1.0RC1 : true - 1.0RC1 = 1.0RC1 : true - 1.0RC1 == 1.0RC1 : true - 1.0RC1 ne 1.0RC1 : false - 1.0RC1 <> 1.0RC1 : false - 1.0RC1 != 1.0RC1 : false - 1.0RC1 lt 1.0 : true - 1.0RC1 < 1.0 : true - 1.0RC1 le 1.0 : true - 1.0RC1 <= 1.0 : true - 1.0RC1 gt 1.0 : false - 1.0RC1 > 1.0 : false - 1.0RC1 ge 1.0 : false - 1.0RC1 >= 1.0 : false - 1.0RC1 eq 1.0 : false - 1.0RC1 = 1.0 : false - 1.0RC1 == 1.0 : false - 1.0RC1 ne 1.0 : true - 1.0RC1 <> 1.0 : true - 1.0RC1 != 1.0 : true - 1.0RC1 lt 1.0pl1 : true - 1.0RC1 < 1.0pl1 : true - 1.0RC1 le 1.0pl1 : true - 1.0RC1 <= 1.0pl1 : true - 1.0RC1 gt 1.0pl1 : false - 1.0RC1 > 1.0pl1 : false - 1.0RC1 ge 1.0pl1 : false - 1.0RC1 >= 1.0pl1 : false - 1.0RC1 eq 1.0pl1 : false - 1.0RC1 = 1.0pl1 : false - 1.0RC1 == 1.0pl1 : false - 1.0RC1 ne 1.0pl1 : true - 1.0RC1 <> 1.0pl1 : true - 1.0RC1 != 1.0pl1 : true - 1.0 lt 1.0-dev : false - 1.0 < 1.0-dev : false - 1.0 le 1.0-dev : false - 1.0 <= 1.0-dev : false - 1.0 gt 1.0-dev : true - 1.0 > 1.0-dev : true - 1.0 ge 1.0-dev : true - 1.0 >= 1.0-dev : true - 1.0 eq 1.0-dev : false - 1.0 = 1.0-dev : false - 1.0 == 1.0-dev : false - 1.0 ne 1.0-dev : true - 1.0 <> 1.0-dev : true - 1.0 != 1.0-dev : true - 1.0 lt 1.0a1 : false - 1.0 < 1.0a1 : false - 1.0 le 1.0a1 : false - 1.0 <= 1.0a1 : false - 1.0 gt 1.0a1 : true - 1.0 > 1.0a1 : true - 1.0 ge 1.0a1 : true - 1.0 >= 1.0a1 : true - 1.0 eq 1.0a1 : false - 1.0 = 1.0a1 : false - 1.0 == 1.0a1 : false - 1.0 ne 1.0a1 : true - 1.0 <> 1.0a1 : true - 1.0 != 1.0a1 : true - 1.0 lt 1.0b1 : false - 1.0 < 1.0b1 : false - 1.0 le 1.0b1 : false - 1.0 <= 1.0b1 : false - 1.0 gt 1.0b1 : true - 1.0 > 1.0b1 : true - 1.0 ge 1.0b1 : true - 1.0 >= 1.0b1 : true - 1.0 eq 1.0b1 : false - 1.0 = 1.0b1 : false - 1.0 == 1.0b1 : false - 1.0 ne 1.0b1 : true - 1.0 <> 1.0b1 : true - 1.0 != 1.0b1 : true - 1.0 lt 1.0RC1 : false - 1.0 < 1.0RC1 : false - 1.0 le 1.0RC1 : false - 1.0 <= 1.0RC1 : false - 1.0 gt 1.0RC1 : true - 1.0 > 1.0RC1 : true - 1.0 ge 1.0RC1 : true - 1.0 >= 1.0RC1 : true - 1.0 eq 1.0RC1 : false - 1.0 = 1.0RC1 : false - 1.0 == 1.0RC1 : false - 1.0 ne 1.0RC1 : true - 1.0 <> 1.0RC1 : true - 1.0 != 1.0RC1 : true - 1.0 lt 1.0 : false - 1.0 < 1.0 : false - 1.0 le 1.0 : true - 1.0 <= 1.0 : true - 1.0 gt 1.0 : false - 1.0 > 1.0 : false - 1.0 ge 1.0 : true - 1.0 >= 1.0 : true - 1.0 eq 1.0 : true - 1.0 = 1.0 : true - 1.0 == 1.0 : true - 1.0 ne 1.0 : false - 1.0 <> 1.0 : false - 1.0 != 1.0 : false - 1.0 lt 1.0pl1 : true - 1.0 < 1.0pl1 : true - 1.0 le 1.0pl1 : true - 1.0 <= 1.0pl1 : true - 1.0 gt 1.0pl1 : false - 1.0 > 1.0pl1 : false - 1.0 ge 1.0pl1 : false - 1.0 >= 1.0pl1 : false - 1.0 eq 1.0pl1 : false - 1.0 = 1.0pl1 : false - 1.0 == 1.0pl1 : false - 1.0 ne 1.0pl1 : true - 1.0 <> 1.0pl1 : true - 1.0 != 1.0pl1 : true - 1.0pl1 lt 1.0-dev : false - 1.0pl1 < 1.0-dev : false - 1.0pl1 le 1.0-dev : false - 1.0pl1 <= 1.0-dev : false - 1.0pl1 gt 1.0-dev : true - 1.0pl1 > 1.0-dev : true - 1.0pl1 ge 1.0-dev : true - 1.0pl1 >= 1.0-dev : true - 1.0pl1 eq 1.0-dev : false - 1.0pl1 = 1.0-dev : false - 1.0pl1 == 1.0-dev : false - 1.0pl1 ne 1.0-dev : true - 1.0pl1 <> 1.0-dev : true - 1.0pl1 != 1.0-dev : true - 1.0pl1 lt 1.0a1 : false - 1.0pl1 < 1.0a1 : false - 1.0pl1 le 1.0a1 : false - 1.0pl1 <= 1.0a1 : false - 1.0pl1 gt 1.0a1 : true - 1.0pl1 > 1.0a1 : true - 1.0pl1 ge 1.0a1 : true - 1.0pl1 >= 1.0a1 : true - 1.0pl1 eq 1.0a1 : false - 1.0pl1 = 1.0a1 : false - 1.0pl1 == 1.0a1 : false - 1.0pl1 ne 1.0a1 : true - 1.0pl1 <> 1.0a1 : true - 1.0pl1 != 1.0a1 : true - 1.0pl1 lt 1.0b1 : false - 1.0pl1 < 1.0b1 : false - 1.0pl1 le 1.0b1 : false - 1.0pl1 <= 1.0b1 : false - 1.0pl1 gt 1.0b1 : true - 1.0pl1 > 1.0b1 : true - 1.0pl1 ge 1.0b1 : true - 1.0pl1 >= 1.0b1 : true - 1.0pl1 eq 1.0b1 : false - 1.0pl1 = 1.0b1 : false - 1.0pl1 == 1.0b1 : false - 1.0pl1 ne 1.0b1 : true - 1.0pl1 <> 1.0b1 : true - 1.0pl1 != 1.0b1 : true - 1.0pl1 lt 1.0RC1 : false - 1.0pl1 < 1.0RC1 : false - 1.0pl1 le 1.0RC1 : false - 1.0pl1 <= 1.0RC1 : false - 1.0pl1 gt 1.0RC1 : true - 1.0pl1 > 1.0RC1 : true - 1.0pl1 ge 1.0RC1 : true - 1.0pl1 >= 1.0RC1 : true - 1.0pl1 eq 1.0RC1 : false - 1.0pl1 = 1.0RC1 : false - 1.0pl1 == 1.0RC1 : false - 1.0pl1 ne 1.0RC1 : true - 1.0pl1 <> 1.0RC1 : true - 1.0pl1 != 1.0RC1 : true - 1.0pl1 lt 1.0 : false - 1.0pl1 < 1.0 : false - 1.0pl1 le 1.0 : false - 1.0pl1 <= 1.0 : false - 1.0pl1 gt 1.0 : true - 1.0pl1 > 1.0 : true - 1.0pl1 ge 1.0 : true - 1.0pl1 >= 1.0 : true - 1.0pl1 eq 1.0 : false - 1.0pl1 = 1.0 : false - 1.0pl1 == 1.0 : false - 1.0pl1 ne 1.0 : true - 1.0pl1 <> 1.0 : true - 1.0pl1 != 1.0 : true - 1.0pl1 lt 1.0pl1 : false - 1.0pl1 < 1.0pl1 : false - 1.0pl1 le 1.0pl1 : true - 1.0pl1 <= 1.0pl1 : true - 1.0pl1 gt 1.0pl1 : false - 1.0pl1 > 1.0pl1 : false - 1.0pl1 ge 1.0pl1 : true - 1.0pl1 >= 1.0pl1 : true - 1.0pl1 eq 1.0pl1 : true - 1.0pl1 = 1.0pl1 : true - 1.0pl1 == 1.0pl1 : true - 1.0pl1 ne 1.0pl1 : false - 1.0pl1 <> 1.0pl1 : false - 1.0pl1 != 1.0pl1 : false diff --git a/ext/standard/type.c b/ext/standard/type.c deleted file mode 100644 index a98d9cf1d694e..0000000000000 --- a/ext/standard/type.c +++ /dev/null @@ -1,452 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_incomplete_class.h" - -/* {{{ proto string gettype(mixed var) - Returns the type of the variable */ -PHP_FUNCTION(gettype) -{ - pval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_NULL: - RETVAL_ASCII_STRING("NULL", 1); - break; - - case IS_BOOL: - RETVAL_ASCII_STRING("boolean", 1); - break; - - case IS_LONG: - RETVAL_ASCII_STRING("integer", 1); - break; - - case IS_DOUBLE: - RETVAL_ASCII_STRING("double", 1); - break; - - case IS_STRING: - RETVAL_ASCII_STRING("string", 1); - break; - - case IS_BINARY: - RETVAL_ASCII_STRING("binary", 1); - break; - - case IS_UNICODE: - RETVAL_ASCII_STRING("unicode", 1); - break; - - case IS_ARRAY: - RETVAL_ASCII_STRING("array", 1); - break; - - case IS_OBJECT: - RETVAL_ASCII_STRING("object", 1); - /* - { - char *result; - int res_len; - - res_len = sizeof("object of type ")-1 + Z_OBJCE_P(arg)->name_length; - result = (char *) emalloc(res_len+1); - sprintf(result, "object of type %s", Z_OBJCE_P(arg)->name); - RETVAL_STRINGL(result, res_len, 0); - } - */ - break; - - case IS_RESOURCE: - { - char *type_name; - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC); - if (type_name) { - RETVAL_ASCII_STRING("resource", 1); - break; - } - } - - default: - RETVAL_ASCII_STRING("unknown type", 1); - } -} -/* }}} */ - -/* {{{ proto bool settype(mixed var, string type) - Set the type of the variable */ -PHP_FUNCTION(settype) -{ - pval **var, **type; - char *new_type; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &var, &type) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(type); - new_type = Z_STRVAL_PP(type); - - if (!strcasecmp(new_type, "integer")) { - convert_to_long(*var); - } else if (!strcasecmp(new_type, "int")) { - convert_to_long(*var); - } else if (!strcasecmp(new_type, "float")) { - convert_to_double(*var); - } else if (!strcasecmp(new_type, "double")) { /* deprecated */ - convert_to_double(*var); - } else if (!strcasecmp(new_type, "string")) { - convert_to_string(*var); - } else if (!strcasecmp(new_type, "array")) { - convert_to_array(*var); - } else if (!strcasecmp(new_type, "object")) { - convert_to_object(*var); - } else if (!strcasecmp(new_type, "bool")) { - convert_to_boolean(*var); - } else if (!strcasecmp(new_type, "boolean")) { - convert_to_boolean(*var); - } else if (!strcasecmp(new_type, "null")) { - convert_to_null(*var); - } else if (!strcasecmp(new_type, "resource")) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type"); - RETURN_FALSE; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type"); - RETURN_FALSE; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int intval(mixed var [, int base]) - Get the integer value of a variable using the optional base for the conversion */ -PHP_FUNCTION(intval) -{ - pval **num, **arg_base; - int base; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - base = 10; - break; - - case 2: - if (zend_get_parameters_ex(2, &num, &arg_base) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg_base); - base = Z_LVAL_PP(arg_base); - break; - - default: - WRONG_PARAM_COUNT; - } - - RETVAL_ZVAL(*num, 1, 0); - convert_to_long_base(return_value, base); -} -/* }}} */ - -/* {{{ proto float floatval(mixed var) - Get the float value of a variable */ -PHP_FUNCTION(floatval) -{ - pval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - RETVAL_ZVAL(*num, 1, 0); - convert_to_double(return_value); -} -/* }}} */ - -/* {{{ proto string strval(mixed var) - Get the string value of a variable */ -PHP_FUNCTION(strval) -{ - zval **num, *tmp; - zval expr_copy; - int use_copy; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - zend_make_printable_zval(*num, &expr_copy, &use_copy); - if (use_copy) { - tmp = &expr_copy; - RETVAL_ZVAL(tmp, 0, 0); - } else { - RETVAL_ZVAL(*num, 1, 0); - } -} -/* }}} */ - -static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - pval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected"); - RETURN_FALSE; - } - - if (Z_TYPE_PP(arg) == type) { - if (type == IS_OBJECT) { - zend_class_entry *ce; - if(Z_OBJ_HT_PP(arg)->get_class_entry == NULL) { - /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */ - RETURN_TRUE; - } - ce = Z_OBJCE_PP(arg); - if (!strcmp(ce->name, INCOMPLETE_CLASS)) { - RETURN_FALSE; - } - } - if (type == IS_RESOURCE) { - char *type_name; - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC); - if (!type_name) { - RETURN_FALSE; - } - } - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - - -/* {{{ proto bool is_null(mixed var) - Returns true if variable is null */ -PHP_FUNCTION(is_null) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_NULL); -} -/* }}} */ - -/* {{{ proto bool is_resource(mixed var) - Returns true if variable is a resource */ -PHP_FUNCTION(is_resource) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_RESOURCE); -} -/* }}} */ - -/* {{{ proto bool is_bool(mixed var) - Returns true if variable is a boolean */ -PHP_FUNCTION(is_bool) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_BOOL); -} -/* }}} */ - -/* {{{ proto bool is_long(mixed var) - Returns true if variable is a long (integer) */ -PHP_FUNCTION(is_long) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_LONG); -} -/* }}} */ - -/* {{{ proto bool is_float(mixed var) - Returns true if variable is float point*/ -PHP_FUNCTION(is_float) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_DOUBLE); -} -/* }}} */ - -/* {{{ proto bool is_string(mixed var) - Returns true if variable is a native string */ -PHP_FUNCTION(is_string) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_STRING); -} -/* }}} */ - -/* {{{ proto bool is_unicode(mixed var) - Returns true if variable is a unicode string */ -PHP_FUNCTION(is_unicode) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_UNICODE); -} -/* }}} */ - -/* {{{ proto bool is_binary(mixed var) - Returns true if variable is a binary string */ -PHP_FUNCTION(is_binary) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_BINARY); -} -/* }}} */ - -/* {{{ proto bool is_buffer(mixed var) - Returns true if variable is a native, unicode or binary string */ -PHP_FUNCTION(is_buffer) -{ - pval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected"); - RETURN_FALSE; - } - - if (Z_TYPE_PP(arg) == IS_STRING || Z_TYPE_PP(arg) == IS_UNICODE || Z_TYPE_PP(arg) == IS_BINARY) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool is_array(mixed var) - Returns true if variable is an array */ -PHP_FUNCTION(is_array) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_ARRAY); -} -/* }}} */ - -/* {{{ proto bool is_object(mixed var) - Returns true if variable is an object */ -PHP_FUNCTION(is_object) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_OBJECT); -} -/* }}} */ - -/* {{{ proto bool is_numeric(mixed value) - Returns true if value is a number or a numeric string */ -PHP_FUNCTION(is_numeric) -{ - zval **arg; - int result; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_LONG: - case IS_DOUBLE: - RETURN_TRUE; - break; - - case IS_STRING: - result = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), NULL, NULL, 0); - if (result == IS_LONG || result == IS_DOUBLE) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - break; - - case IS_UNICODE: - result = is_numeric_unicode(Z_USTRVAL_PP(arg), Z_USTRLEN_PP(arg), NULL, NULL, 0); - if (result == IS_LONG || result == IS_DOUBLE) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - break; - - default: - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto bool is_scalar(mixed value) - Returns true if value is a scalar */ -PHP_FUNCTION(is_scalar) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_BOOL: - case IS_DOUBLE: - case IS_LONG: - case IS_STRING: - case IS_BINARY: - case IS_UNICODE: - RETURN_TRUE; - break; - - default: - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto bool is_callable(mixed var [, bool syntax_only [, string callable_name]]) - Returns true if var is callable. */ -PHP_FUNCTION(is_callable) -{ - zval **var, **syntax_only, **callable_name; - zval name; - zend_bool retval; - zend_bool syntax = 0; - int argc=ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &var, &syntax_only, &callable_name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 1) { - convert_to_boolean_ex(syntax_only); - syntax = Z_BVAL_PP(syntax_only); - } - - if (argc > 2) { - retval = zend_is_callable(*var, syntax, &name); - zval_dtor(*callable_name); - **callable_name = name; - } else { - retval = zend_is_callable(*var, syntax, NULL); - } - - RETURN_BOOL(retval); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c deleted file mode 100644 index 304e14250238c..0000000000000 --- a/ext/standard/uniqid.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#include -#ifdef PHP_WIN32 -#include "win32/time.h" -#else -#include -#endif - -#include "php_lcg.h" -#include "uniqid.h" - -/* {{{ proto string uniqid([string prefix , bool more_entropy]) - Generates a unique ID */ -#ifdef HAVE_GETTIMEOFDAY -PHP_FUNCTION(uniqid) -{ - char *prefix = ""; -#if defined(__CYGWIN__) - zend_bool more_entropy = 1; -#else - zend_bool more_entropy = 0; -#endif - char *uniqid; - int sec, usec, prefix_len = 0; - struct timeval tv; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len, - &more_entropy)) { - return; - } - -#if HAVE_USLEEP && !defined(PHP_WIN32) - if (!more_entropy) { -#if defined(__CYGWIN__) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN."); - RETURN_FALSE; -#else - usleep(1); -#endif - } -#endif - gettimeofday((struct timeval *) &tv, (struct timezone *) NULL); - sec = (int) tv.tv_sec; - usec = (int) (tv.tv_usec % 0x100000); - - /* The max value usec can have is 0xF423F, so we use only five hex - * digits for usecs. - */ - if (more_entropy) { - spprintf(&uniqid, 0, "%s%08x%05x%.8f", prefix, sec, usec, php_combined_lcg(TSRMLS_C) * 10); - } else { - spprintf(&uniqid, 0, "%s%08x%05x", prefix, sec, usec); - } - - RETURN_RT_STRING(uniqid, 0); -} -#endif -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h deleted file mode 100644 index 6c431fe2f74ff..0000000000000 --- a/ext/standard/uniqid.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef UNIQID_H -#define UNIQID_H - -#ifdef HAVE_GETTIMEOFDAY -PHP_FUNCTION(uniqid); -#endif - -#endif /* UNIQID_H */ diff --git a/ext/standard/url.c b/ext/standard/url.c deleted file mode 100644 index 1e5dece138cd1..0000000000000 --- a/ext/standard/url.c +++ /dev/null @@ -1,720 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include -#include -#include - -#include "php.h" - -#include "url.h" -#ifdef _OSD_POSIX -#ifndef APACHE -#error On this EBCDIC platform, PHP is only supported as an Apache module. -#else /*APACHE*/ -#ifndef CHARSET_EBCDIC -#define CHARSET_EBCDIC /* this machine uses EBCDIC, not ASCII! */ -#endif -#include "ebcdic.h" -#endif /*APACHE*/ -#endif /*_OSD_POSIX*/ - -/* {{{ free_url - */ -PHPAPI void php_url_free(php_url *theurl) -{ - if (theurl->scheme) - efree(theurl->scheme); - if (theurl->user) - efree(theurl->user); - if (theurl->pass) - efree(theurl->pass); - if (theurl->host) - efree(theurl->host); - if (theurl->path) - efree(theurl->path); - if (theurl->query) - efree(theurl->query); - if (theurl->fragment) - efree(theurl->fragment); - efree(theurl); -} -/* }}} */ - -/* {{{ php_replace_controlchars - */ -PHPAPI char *php_replace_controlchars_ex(char *str, int len) -{ - unsigned char *s = (unsigned char *)str; - unsigned char *e = (unsigned char *)str + len; - - if (!str) { - return (NULL); - } - - while (s < e) { - - if (iscntrl(*s)) { - *s='_'; - } - s++; - } - - return (str); -} -/* }}} */ - -PHPAPI char *php_replace_controlchars(char *str) -{ - return php_replace_controlchars_ex(str, strlen(str)); -} - -PHPAPI php_url *php_url_parse(char const *str) -{ - return php_url_parse_ex(str, strlen(str)); -} - -/* {{{ php_url_parse - */ -PHPAPI php_url *php_url_parse_ex(char const *str, int length) -{ - char port_buf[6]; - php_url *ret = ecalloc(1, sizeof(php_url)); - char const *s, *e, *p, *pp, *ue; - - s = str; - ue = s + length; - - /* parse scheme */ - if ((e = memchr(s, ':', length)) && (e - s)) { - /* validate scheme */ - p = s; - while (p < e) { - /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */ - if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != '.' && *p != '-') { - if (e + 1 < ue) { - goto parse_port; - } else { - goto just_path; - } - } - p++; - } - - if (*(e + 1) == '\0') { /* only scheme is available */ - ret->scheme = estrndup(s, (e - s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - goto end; - } - - /* - * certain schemas like mailto: and zlib: may not have any / after them - * this check ensures we support those. - */ - if (*(e+1) != '/') { - /* check if the data we get is a port this allows us to - * correctly parse things like a.com:80 - */ - p = e + 1; - while (isdigit(*p)) { - p++; - } - - if ((*p) == '\0' || *p == '/') { - goto parse_port; - } - - ret->scheme = estrndup(s, (e-s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - - length -= ++e - s; - s = e; - goto just_path; - } else { - ret->scheme = estrndup(s, (e-s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - - if (*(e+2) == '/') { - s = e + 3; - if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - if (*(e + 3) == '/') { - /* support windows drive letters as in: - file:///c:/somedir/file.txt - */ - if (*(e + 5) == ':') { - s = e + 4; - } - goto nohost; - } - } - } else { - if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - s = e + 1; - goto nohost; - } else { - length -= ++e - s; - s = e; - goto just_path; - } - } - } - } else if (e) { /* no scheme, look for port */ - parse_port: - p = e + 1; - pp = p; - - while (pp-p < 6 && isdigit(*pp)) { - pp++; - } - - if (pp-p < 6 && (*pp == '/' || *pp == '\0')) { - memcpy(port_buf, p, (pp-p)); - port_buf[pp-p] = '\0'; - ret->port = atoi(port_buf); - } else { - goto just_path; - } - } else { - just_path: - ue = s + length; - goto nohost; - } - - e = ue; - - if (!(p = memchr(s, '/', (ue - s)))) { - if ((p = memchr(s, '?', (ue - s)))) { - e = p; - } else if ((p = memchr(s, '#', (ue - s)))) { - e = p; - } - } else { - e = p; - } - - /* check for login and password */ - if ((p = memchr(s, '@', (e-s)))) { - if ((pp = memchr(s, ':', (p-s)))) { - if ((pp-s) > 0) { - ret->user = estrndup(s, (pp-s)); - php_replace_controlchars_ex(ret->user, (pp - s)); - } - - pp++; - if (p-pp > 0) { - ret->pass = estrndup(pp, (p-pp)); - php_replace_controlchars_ex(ret->pass, (p-pp)); - } - } else { - ret->user = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->user, (p-s)); - } - - s = p + 1; - } - - /* check for port */ - if (*s == '[' && *(e-1) == ']') { - /* Short circuit portscan, - we're dealing with an - IPv6 embedded address */ - p = s; - } else { - /* memrchr is a GNU specific extension - Emulate for wide compatability */ - for(p = e; *p != ':' && p >= s; p--); - } - - if (p >= s && *p == ':') { - if (!ret->port) { - p++; - if (e-p > 5) { /* port cannot be longer then 5 characters */ - STR_FREE(ret->scheme); - STR_FREE(ret->user); - STR_FREE(ret->pass); - efree(ret); - return NULL; - } else if (e - p > 0) { - memcpy(port_buf, p, (e-p)); - port_buf[e-p] = '\0'; - ret->port = atoi(port_buf); - } - p--; - } - } else { - p = e; - } - - /* check if we have a valid host, if we don't reject the string as url */ - if ((p-s) < 1) { - STR_FREE(ret->scheme); - STR_FREE(ret->user); - STR_FREE(ret->pass); - efree(ret); - return NULL; - } - - ret->host = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->host, (p - s)); - - if (e == ue) { - return ret; - } - - s = e; - - nohost: - - if ((p = memchr(s, '?', (ue - s)))) { - pp = strchr(s, '#'); - - if (pp && pp < p) { - p = pp; - pp = strchr(pp+2, '#'); - } - - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); - } - - if (pp) { - if (pp - ++p) { - ret->query = estrndup(p, (pp-p)); - php_replace_controlchars_ex(ret->query, (pp - p)); - } - p = pp; - goto label_parse; - } else if (++p - ue) { - ret->query = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->query, (ue - p)); - } - } else if ((p = memchr(s, '#', (ue - s)))) { - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); - } - - label_parse: - p++; - - if (ue - p) { - ret->fragment = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->fragment, (ue - p)); - } - } else { - ret->path = estrndup(s, (ue-s)); - php_replace_controlchars_ex(ret->path, (ue - s)); - } -end: - return ret; -} -/* }}} */ - -/* {{{ proto mixed parse_url(string url, [int url_component]) - Parse a URL and return its components */ -PHP_FUNCTION(parse_url) -{ - char *str; - int str_len; - php_url *resource; - long key = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { - return; - } - - resource = php_url_parse_ex(str, str_len); - if (resource == NULL) { - php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse url"); - RETURN_FALSE; - } - - if (key > -1) { - switch (key) { - case PHP_URL_SCHEME: - if (resource->scheme != NULL) RETVAL_STRING(resource->scheme, 1); - break; - case PHP_URL_HOST: - if (resource->host != NULL) RETVAL_STRING(resource->host, 1); - break; - case PHP_URL_PORT: - if (resource->port != 0) RETVAL_LONG(resource->port); - break; - case PHP_URL_USER: - if (resource->user != NULL) RETVAL_STRING(resource->user, 1); - break; - case PHP_URL_PASS: - if (resource->pass != NULL) RETVAL_STRING(resource->pass, 1); - break; - case PHP_URL_PATH: - if (resource->path != NULL) RETVAL_STRING(resource->path, 1); - break; - case PHP_URL_QUERY: - if (resource->query != NULL) RETVAL_STRING(resource->query, 1); - break; - case PHP_URL_FRAGMENT: - if (resource->fragment != NULL) RETVAL_STRING(resource->fragment, 1); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid url component identifier %ld.", key); - RETVAL_FALSE; - } - goto done; - } - - /* allocate an array for return */ - array_init(return_value); - - /* add the various elements to the array */ - if (resource->scheme != NULL) - add_assoc_string(return_value, "scheme", resource->scheme, 1); - if (resource->host != NULL) - add_assoc_string(return_value, "host", resource->host, 1); - if (resource->port != 0) - add_assoc_long(return_value, "port", resource->port); - if (resource->user != NULL) - add_assoc_string(return_value, "user", resource->user, 1); - if (resource->pass != NULL) - add_assoc_string(return_value, "pass", resource->pass, 1); - if (resource->path != NULL) - add_assoc_string(return_value, "path", resource->path, 1); - if (resource->query != NULL) - add_assoc_string(return_value, "query", resource->query, 1); - if (resource->fragment != NULL) - add_assoc_string(return_value, "fragment", resource->fragment, 1); -done: - php_url_free(resource); -} -/* }}} */ - -/* {{{ php_htoi - */ -static int php_htoi(char *s) -{ - int value; - int c; - - c = ((unsigned char *)s)[0]; - if (isupper(c)) - c = tolower(c); - value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16; - - c = ((unsigned char *)s)[1]; - if (isupper(c)) - c = tolower(c); - value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10; - - return (value); -} -/* }}} */ - -/* rfc1738: - - ...The characters ";", - "/", "?", ":", "@", "=" and "&" are the characters which may be - reserved for special meaning within a scheme... - - ...Thus, only alphanumerics, the special characters "$-_.+!*'(),", and - reserved characters used for their reserved purposes may be used - unencoded within a URL... - - For added safety, we only leave -_. unencoded. - */ - -static unsigned char hexchars[] = "0123456789ABCDEF"; - -/* {{{ php_url_encode - */ -PHPAPI char *php_url_encode(char const *s, int len, int *new_length) -{ - register unsigned char c; - unsigned char *to, *start; - unsigned char const *from, *end; - - from = s; - end = s + len; - start = to = (unsigned char *) safe_emalloc(3, len, 1); - - while (from < end) { - c = *from++; - - if (c == ' ') { - *to++ = '+'; -#ifndef CHARSET_EBCDIC - } else if ((c < '0' && c != '-' && c != '.') || - (c < 'A' && c > '9') || - (c > 'Z' && c < 'a' && c != '_') || - (c > 'z')) { - to[0] = '%'; - to[1] = hexchars[c >> 4]; - to[2] = hexchars[c & 15]; - to += 3; -#else /*CHARSET_EBCDIC*/ - } else if (!isalnum(c) && strchr("_-.", c) == NULL) { - /* Allow only alphanumeric chars and '_', '-', '.'; escape the rest */ - to[0] = '%'; - to[1] = hexchars[os_toascii[c] >> 4]; - to[2] = hexchars[os_toascii[c] & 15]; - to += 3; -#endif /*CHARSET_EBCDIC*/ - } else { - *to++ = c; - } - } - *to = 0; - if (new_length) { - *new_length = to - start; - } - return (char *) start; -} -/* }}} */ - -/* {{{ proto string urlencode(string str) - URL-encodes string */ -PHP_FUNCTION(urlencode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = php_url_encode(in_str, in_str_len, &out_str_len); - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ proto string urldecode(string str) - Decodes URL-encoded string */ -PHP_FUNCTION(urldecode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = estrndup(in_str, in_str_len); - out_str_len = php_url_decode(out_str, in_str_len); - - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ php_url_decode - */ -PHPAPI int php_url_decode(char *str, int len) -{ - char *dest = str; - char *data = str; - - while (len--) { - if (*data == '+') { - *dest = ' '; - } - else if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) - && isxdigit((int) *(data + 2))) { -#ifndef CHARSET_EBCDIC - *dest = (char) php_htoi(data + 1); -#else - *dest = os_toebcdic[(char) php_htoi(data + 1)]; -#endif - data += 2; - len -= 2; - } else { - *dest = *data; - } - data++; - dest++; - } - *dest = '\0'; - return dest - str; -} -/* }}} */ - -/* {{{ php_raw_url_encode - */ -PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length) -{ - register int x, y; - unsigned char *str; - - str = (unsigned char *) safe_emalloc(3, len, 1); - for (x = 0, y = 0; len--; x++, y++) { - str[y] = (unsigned char) s[x]; -#ifndef CHARSET_EBCDIC - if ((str[y] < '0' && str[y] != '-' && str[y] != '.') || - (str[y] < 'A' && str[y] > '9') || - (str[y] > 'Z' && str[y] < 'a' && str[y] != '_') || - (str[y] > 'z')) { - str[y++] = '%'; - str[y++] = hexchars[(unsigned char) s[x] >> 4]; - str[y] = hexchars[(unsigned char) s[x] & 15]; -#else /*CHARSET_EBCDIC*/ - if (!isalnum(str[y]) && strchr("_-.", str[y]) != NULL) { - str[y++] = '%'; - str[y++] = hexchars[os_toascii[(unsigned char) s[x]] >> 4]; - str[y] = hexchars[os_toascii[(unsigned char) s[x]] & 15]; -#endif /*CHARSET_EBCDIC*/ - } - } - str[y] = '\0'; - if (new_length) { - *new_length = y; - } - return ((char *) str); -} -/* }}} */ - -/* {{{ proto string rawurlencode(string str) - URL-encodes string */ -PHP_FUNCTION(rawurlencode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = php_raw_url_encode(in_str, in_str_len, &out_str_len); - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ proto string rawurldecode(string str) - Decodes URL-encodes string */ -PHP_FUNCTION(rawurldecode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = estrndup(in_str, in_str_len); - out_str_len = php_raw_url_decode(out_str, in_str_len); - - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ php_raw_url_decode - */ -PHPAPI int php_raw_url_decode(char *str, int len) -{ - char *dest = str; - char *data = str; - - while (len--) { - if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) - && isxdigit((int) *(data + 2))) { -#ifndef CHARSET_EBCDIC - *dest = (char) php_htoi(data + 1); -#else - *dest = os_toebcdic[(char) php_htoi(data + 1)]; -#endif - data += 2; - len -= 2; - } else { - *dest = *data; - } - data++; - dest++; - } - *dest = '\0'; - return dest - str; -} -/* }}} */ - -/* {{{ proto array get_headers(string url) - fetches all the headers sent by the server in response to a HTTP request */ -PHP_FUNCTION(get_headers) -{ - char *url; - int url_len; - php_stream_context *context = NULL; - php_stream *stream; - zval **prev_val, **hdr = NULL; - HashPosition pos; - long format = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { - return; - } - - if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) { - RETURN_FALSE; - } - - array_init(return_value); - - zend_hash_internal_pointer_reset_ex(HASH_OF(stream->wrapperdata), &pos); - while (zend_hash_get_current_data_ex(HASH_OF(stream->wrapperdata), (void**)&hdr, &pos) != FAILURE) { - if (!format) { -no_name_header: - add_next_index_stringl(return_value, Z_STRVAL_PP(hdr), Z_STRLEN_PP(hdr), 1); - } else { - char c; - char *s, *p; - - if ((p = strchr(Z_STRVAL_PP(hdr), ':'))) { - c = *p; - *p = '\0'; - s = p + 1; - while (isspace((int)*(unsigned char *)s)) { - s++; - } - - if (zend_hash_find(HASH_OF(return_value), Z_STRVAL_PP(hdr), (p - Z_STRVAL_PP(hdr) + 1), (void **) &prev_val) == FAILURE) { - add_assoc_stringl_ex(return_value, Z_STRVAL_PP(hdr), (p - Z_STRVAL_PP(hdr) + 1), s, (Z_STRLEN_PP(hdr) - (s - Z_STRVAL_PP(hdr))), 1); - } else { /* some headers may occur more then once, therefor we need to remake the string into an array */ - convert_to_array(*prev_val); - add_next_index_stringl(*prev_val, s, (Z_STRLEN_PP(hdr) - (s - Z_STRVAL_PP(hdr))), 1); - } - - *p = c; - } else { - goto no_name_header; - } - } - zend_hash_move_forward_ex(HASH_OF(stream->wrapperdata), &pos); - } - - php_stream_close(stream); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/url.h b/ext/standard/url.h deleted file mode 100644 index ece95e0e39bf3..0000000000000 --- a/ext/standard/url.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef URL_H -#define URL_H - -typedef struct php_url { - char *scheme; - char *user; - char *pass; - char *host; - unsigned short port; - char *path; - char *query; - char *fragment; -} php_url; - -PHPAPI void php_url_free(php_url *theurl); -PHPAPI php_url *php_url_parse(char const *str); -PHPAPI php_url *php_url_parse_ex(char const *str, int length); -PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI char *php_url_encode(char const *s, int len, int *new_length); -PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length); - -PHP_FUNCTION(parse_url); -PHP_FUNCTION(urlencode); -PHP_FUNCTION(urldecode); -PHP_FUNCTION(rawurlencode); -PHP_FUNCTION(rawurldecode); -PHP_FUNCTION(get_headers); - -#define PHP_URL_SCHEME 0 -#define PHP_URL_HOST 1 -#define PHP_URL_PORT 2 -#define PHP_URL_USER 3 -#define PHP_URL_PASS 4 -#define PHP_URL_PATH 5 -#define PHP_URL_QUERY 6 -#define PHP_URL_FRAGMENT 7 - -#endif /* URL_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c deleted file mode 100644 index 9f021d1d9cd9a..0000000000000 --- a/ext/standard/url_scanner.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" - -#include "php_globals.h" - -#include -#include -#include -#include -#include "basic_functions.h" -#include "url_scanner.h" - -#ifndef BUFSIZE -#define BUFSIZE 256 -#endif - -int php_url_scanner_activate(TSRMLS_D) -{ - url_adapt(NULL,0,NULL,NULL); - return SUCCESS; -} - - -int php_url_scanner_deactivate(TSRMLS_D) -{ - url_adapt(NULL,0,NULL,NULL); - return SUCCESS; -} - -/* {{{ url_attr_addon - */ -static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf) -{ - int flag = 0; - TSRMLS_FETCH(); - - if(!strcasecmp(tag,"a") && !strcasecmp(attr,"href")) { - flag = 1; - } else if(!strcasecmp(tag,"area" ) && !strcasecmp(attr,"href" )) { - flag = 1; - } else if(!strcasecmp(tag,"form" ) && !strcasecmp(attr,"action" )) { - flag = 1; - } else if(!strcasecmp(tag,"frame") && !strcasecmp(attr,"source" )) { - flag = 1; - } else if(!strcasecmp(tag,"img" ) && !strcasecmp(attr,"action" )) { - flag = 1; - } - if(flag) { - if(!strstr(val,buf)&&!strchr(val,':')) - { - char *result = (char *)emalloc(strlen(buf)+strlen(PG(arg_separator).output)+1); - int n; - - if(strchr(val,'?')) { - strcpy(result,PG(arg_separator).output); - n=strlen(PG(arg_separator).output); - } else { - *result='?'; - n=1; - } - strcpy(result+n,buf); - return result; - } - } - return NULL; -} -/* }}} */ - -#define US BG(url_adapt_state) - -/* {{{ url_adapt_ext - */ -char *url_adapt_ext(const char *src, uint srclen, const char *name, const char *val, size_t *newlen) -{ - char buf[1024]; - - snprintf(buf, sizeof(buf)-1, "%s=%s", name, val); - - return url_adapt(src, srclen, buf, newlen); -} -/* }}} */ - -/* {{{ url_adapt - */ -char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen) -{ - char *out,*outp; - int maxl,n; - TSRMLS_FETCH(); - - if(src==NULL) { - US.state=STATE_NORMAL; - if(US.tag) { efree(US.tag); US.tag =NULL; } - if(US.attr) { efree(US.attr); US.attr=NULL; } - if(US.val) { efree(US.val); US.val =NULL; } - return NULL; - } - - if(srclen==0) - srclen=strlen(src); - - out=malloc(srclen+1); - maxl=srclen; - n=srclen; - - *newlen=0; - outp=out; - - while(n--) { - switch(US.state) { - case STATE_NORMAL: - if(*src=='<') - US.state=STATE_TAG_START; - break; - - case STATE_TAG_START: - if(! isalnum(*src)) - US.state=STATE_NORMAL; - US.state=STATE_TAG; - US.ml=BUFSIZE; - US.p=US.tag=erealloc(US.tag,US.ml); - *(US.p)++=*src; - US.l=1; - break; - - case STATE_TAG: - if(isalnum(*src)) { - *(US.p)++ = *src; - US.l++; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.tag=erealloc(US.tag,US.ml); - US.p = US.tag+US.l; - } - } else if (isspace(*src)) { - US.state = STATE_IN_TAG; - *US.p='\0'; - US.tag=erealloc(US.tag,US.l); - } else { - US.state = STATE_NORMAL; - efree(US.tag); - US.tag=NULL; - } - break; - - case STATE_IN_TAG: - if(isalnum(*src)) { - US.state=STATE_TAG_ATTR; - US.ml=BUFSIZE; - US.p=US.attr=erealloc(US.attr,US.ml); - *(US.p)++=*src; - US.l=1; - } else if (! isspace(*src)) { - US.state = STATE_NORMAL; - efree(US.tag); - US.tag=NULL; - } - break; - - case STATE_TAG_ATTR: - if(isalnum(*src)) { - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.attr=erealloc(US.attr,US.ml); - US.p = US.attr+US.l; - } - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.attr=erealloc(US.attr,US.ml); - US.p = US.attr+US.l; - } - } else if(isspace(*src)||(*src=='=')){ - US.state=STATE_TAG_IS; - *US.p=0; - US.attr=erealloc(US.attr,US.l); - } else if(*src=='>') { - US.state=STATE_NORMAL; - } else { - efree(US.attr); - US.attr=NULL; - US.state=STATE_IN_TAG; - } - break; - - case STATE_TAG_IS: - case STATE_TAG_IS2: - if(*src=='>'){ - US.state=STATE_NORMAL; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,"",data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - p=url_attr_addon(US.tag,US.attr,"#",data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(!isspace(*src)&&(*src!='=')) { - US.ml=BUFSIZE; - US.p=US.val=erealloc(US.val,US.ml); - US.l=0; - US.attr_done=0; - if((*src=='"')||(*src=='\'')) { - US.state=STATE_TAG_QVAL2; - US.delim=*src; - } else { - US.state=STATE_TAG_VAL; - *US.p++=*src; - US.l++; - } - } - break; - - - case STATE_TAG_QVAL2: - if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - *US.p='\0'; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(*src==US.delim) { - US.state=STATE_IN_TAG; - *US.p='\0'; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - break; - } else if(*src=='\\') { - US.state=STATE_TAG_QVAL2b; - } else if (*src=='>') { - US.state=STATE_NORMAL; - } - - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - - break; - - case STATE_TAG_QVAL2b: - US.state=STATE_TAG_QVAL2; - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - break; - - case STATE_TAG_VAL: - case STATE_TAG_VAL2: - if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - *US.p='\0'; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(isspace(*src)||(*src=='>')) { - US.state=(*src=='>')?STATE_NORMAL:STATE_IN_TAG; - *US.p='\0'; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strcpy(outp,p); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else { - *US.p++=*src; - US.l++; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - } - break; - default: - break; - } - - *outp++=*src++; - *newlen+=1; - } - *outp='\0'; - return out; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/url_scanner.h b/ext/standard/url_scanner.h deleted file mode 100644 index e747648192d8e..0000000000000 --- a/ext/standard/url_scanner.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef URI_SCANNER_H -#define URI_SCANNER_H - -int php_url_scanner_activate(TSRMLS_D); -int php_url_scanner_deactivate(TSRMLS_D); - -char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen); - -enum url_state { - STATE_NORMAL, - STATE_TAG_START, - STATE_TAG, - STATE_IN_TAG, - STATE_TAG_ATTR, - STATE_TAG_IS, - STATE_TAG_IS2, - STATE_TAG_VAL, - STATE_TAG_VAL2, - STATE_TAG_QVAL1, - STATE_TAG_QVAL2, - STATE_TAG_QVAL2b -}; - -typedef struct url_adapt_struct { - enum url_state state; - char *tag; - char *attr; - char *val; - char delim; - char *p; - int l, ml; - int attr_done; -} url_adapt_state_t; - -#endif diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c deleted file mode 100644 index 27b90bd95904d..0000000000000 --- a/ext/standard/url_scanner_ex.c +++ /dev/null @@ -1,1149 +0,0 @@ -/* Generated by re2c 0.9.8 on Wed Jun 29 02:16:53 2005 */ -#line 1 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include -#include -#include - -#include "php_ini.h" -#include "php_globals.h" -#define STATE_TAG SOME_OTHER_STATE_TAG -#include "basic_functions.h" -#include "url.h" -#undef STATE_TAG - -#define url_scanner url_scanner_ex - -#include "php_smart_str.h" - -static PHP_INI_MH(OnUpdateTags) -{ - url_adapt_state_ex_t *ctx; - char *key; - char *lasts; - char *tmp; - - ctx = &BG(url_adapt_state_ex); - - tmp = estrndup(new_value, new_value_length); - - if (ctx->tags) - zend_hash_destroy(ctx->tags); - else - ctx->tags = malloc(sizeof(HashTable)); - - zend_hash_init(ctx->tags, 0, NULL, NULL, 1); - - for (key = php_strtok_r(tmp, ",", &lasts); - key; - key = php_strtok_r(NULL, ",", &lasts)) { - char *val; - - val = strchr(key, '='); - if (val) { - char *q; - int keylen; - - *val++ = '\0'; - for (q = key; *q; q++) - *q = tolower(*q); - keylen = q - key; - /* key is stored withOUT NUL - val is stored WITH NUL */ - zend_hash_add(ctx->tags, key, keylen, val, strlen(val)+1, NULL); - } - } - - efree(tmp); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) -PHP_INI_END() - -#line 97 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -#define YYFILL(n) goto done -#define YYCTYPE unsigned char -#define YYCURSOR p -#define YYLIMIT q -#define YYMARKER r - -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) -{ - register const char *p, *q; - const char *bash = NULL; - const char *sep = "?"; - - q = (p = url->c) + url->len; - -scan: -{ - static unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 128, 128, 128, 128, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - -#line 149 "" -{ - YYCTYPE yych; - goto yy0; - ++YYCURSOR; -yy0: - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy8; - } - if(yych <= '9') goto yy6; - if(yych >= ';') goto yy4; - goto yy2; -yy2: ++YYCURSOR; - goto yy3; -yy3: -#line 115 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ smart_str_append(dest, url); return; } -#line 168 "" -yy4: ++YYCURSOR; - goto yy5; -yy5: -#line 116 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ sep = separator; goto scan; } -#line 174 "" -yy6: ++YYCURSOR; - goto yy7; -yy7: -#line 117 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ bash = p - 1; goto done; } -#line 180 "" -yy8: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy9; -yy9: if(yybm[0+yych] & 128) { - goto yy8; - } - goto yy10; -yy10: -#line 118 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ goto scan; } -#line 192 "" -} -} -#line 119 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - -done: - - /* Don't modify URLs of the format "#mark" */ - if (bash && bash - url->c == 0) { - smart_str_append(dest, url); - return; - } - - if (bash) - smart_str_appendl(dest, url->c, bash - url->c); - else - smart_str_append(dest, url); - - smart_str_appends(dest, sep); - smart_str_append(dest, url_app); - - if (bash) - smart_str_appendl(dest, bash, q - bash); -} - - -#undef YYFILL -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER - -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) -{ - char f = 0; - - if (strncasecmp(ctx->arg.c, ctx->lookup_data, ctx->arg.len) == 0) - f = 1; - - if (quotes) - smart_str_appendc(&ctx->result, type); - if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); - } else { - smart_str_append(&ctx->result, &ctx->val); - } - if (quotes) - smart_str_appendc(&ctx->result, type); -} - -enum { - STATE_PLAIN = 0, - STATE_TAG, - STATE_NEXT_ARG, - STATE_ARG, - STATE_BEFORE_VAL, - STATE_VAL -}; - -#define YYFILL(n) goto stop -#define YYCTYPE unsigned char -#define YYCURSOR xp -#define YYLIMIT end -#define YYMARKER q -#define STATE ctx->state - -#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC -#define STD_ARGS ctx, start, xp TSRMLS_CC - -#if SCANNER_DEBUG -#define scdebug(x) printf x -#else -#define scdebug(x) -#endif - -static inline void passthru(STD_PARA) -{ - scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); - smart_str_appendl(&ctx->result, start, YYCURSOR - start); -} - -/* - * This function appends a hidden input field after a
              or - *
              . The latter is important for XHTML. - */ - -static void handle_form(STD_PARA) -{ - int doit = 0; - - if (ctx->form_app.len > 0) { - switch (ctx->tag.len) { - -#define RECOGNIZE(x) do { \ - case sizeof(x)-1: \ - if (strncasecmp(ctx->tag.c, x, sizeof(x)-1) == 0) \ - doit = 1; \ - break; \ -} while (0) - - RECOGNIZE("form"); - RECOGNIZE("fieldset"); - } - - if (doit) - smart_str_append(&ctx->result, &ctx->form_app); - } -} - - - -/* - * HANDLE_TAG copies the HTML Tag and checks whether we - * have that tag in our table. If we might modify it, - * we continue to scan the tag, otherwise we simply copy the complete - * HTML stuff to the result buffer. - */ - -static inline void handle_tag(STD_PARA) -{ - int ok = 0; - int i; - - ctx->tag.len = 0; - smart_str_appendl(&ctx->tag, start, YYCURSOR - start); - for (i = 0; i < ctx->tag.len; i++) - ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]); - if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS) - ok = 1; - STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; -} - -static inline void handle_arg(STD_PARA) -{ - ctx->arg.len = 0; - smart_str_appendl(&ctx->arg, start, YYCURSOR - start); -} - -static inline void handle_val(STD_PARA, char quotes, char type) -{ - smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); -} - -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) -{ - char *end, *q; - char *xp; - char *start; - int rest; - - smart_str_appendl(&ctx->buf, newdata, newlen); - - YYCURSOR = ctx->buf.c; - YYLIMIT = ctx->buf.c + ctx->buf.len; - - switch (STATE) { - case STATE_PLAIN: goto state_plain; - case STATE_TAG: goto state_tag; - case STATE_NEXT_ARG: goto state_next_arg; - case STATE_ARG: goto state_arg; - case STATE_BEFORE_VAL: goto state_before_val; - case STATE_VAL: goto state_val; - } - - -state_plain_begin: - STATE = STATE_PLAIN; - -state_plain: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - -#line 399 "" -{ - YYCTYPE yych; - goto yy11; - ++YYCURSOR; -yy11: - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy15; - } - goto yy13; -yy13: ++YYCURSOR; - goto yy14; -yy14: -#line 287 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 416 "" -yy15: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy16; -yy16: if(yybm[0+yych] & 128) { - goto yy15; - } - goto yy17; -yy17: -#line 288 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); goto state_plain; } -#line 428 "" -} -} -#line 289 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -state_tag: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 472 "" -{ - YYCTYPE yych; - goto yy18; - ++YYCURSOR; -yy18: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= '@') goto yy22; - if(yych <= 'Z') goto yy20; - if(yych <= '`') goto yy22; - if(yych >= '{') goto yy22; - goto yy20; -yy20: ++YYCURSOR; - yych = *YYCURSOR; - goto yy25; -yy21: -#line 294 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } -#line 491 "" -yy22: ++YYCURSOR; - goto yy23; -yy23: -#line 295 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); goto state_plain_begin; } -#line 497 "" -yy24: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy25; -yy25: if(yybm[0+yych] & 128) { - goto yy24; - } - goto yy21; -} -} -#line 296 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -state_next_arg_begin: - STATE = STATE_NEXT_ARG; - -state_next_arg: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 552 "" -{ - YYCTYPE yych; - goto yy26; - ++YYCURSOR; -yy26: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= '='){ - if(yych <= 0x0B){ - if(yych <= 0x08) goto yy34; - goto yy30; - } else { - if(yych == ' ') goto yy30; - goto yy34; - } - } else { - if(yych <= 'Z'){ - if(yych <= '>') goto yy28; - if(yych <= '@') goto yy34; - goto yy32; - } else { - if(yych <= '`') goto yy34; - if(yych <= 'z') goto yy32; - goto yy34; - } - } -yy28: ++YYCURSOR; - goto yy29; -yy29: -#line 304 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 584 "" -yy30: ++YYCURSOR; - yych = *YYCURSOR; - goto yy37; -yy31: -#line 305 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); goto state_next_arg; } -#line 591 "" -yy32: ++YYCURSOR; - goto yy33; -yy33: -#line 306 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 597 "" -yy34: ++YYCURSOR; - goto yy35; -yy35: -#line 307 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); goto state_plain_begin; } -#line 603 "" -yy36: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy37; -yy37: if(yybm[0+yych] & 128) { - goto yy36; - } - goto yy31; -} -} -#line 308 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -state_arg: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 655 "" -{ - YYCTYPE yych; - goto yy38; - ++YYCURSOR; -yy38: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= '@') goto yy42; - if(yych <= 'Z') goto yy40; - if(yych <= '`') goto yy42; - if(yych >= '{') goto yy42; - goto yy40; -yy40: ++YYCURSOR; - yych = *YYCURSOR; - goto yy45; -yy41: -#line 313 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 674 "" -yy42: ++YYCURSOR; - goto yy43; -yy43: -#line 314 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 680 "" -yy44: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy45; -yy45: if(yybm[0+yych] & 128) { - goto yy44; - } - goto yy41; -} -} -#line 315 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -state_before_val: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 732 "" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy46; - ++YYCURSOR; -yy46: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych == ' ') goto yy48; - if(yych == '=') goto yy50; - goto yy52; -yy48: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ' ') goto yy55; - if(yych == '=') goto yy53; - goto yy49; -yy49: -#line 321 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ --YYCURSOR; goto state_next_arg_begin; } -#line 752 "" -yy50: ++YYCURSOR; - yych = *YYCURSOR; - goto yy54; -yy51: -#line 320 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 759 "" -yy52: yych = *++YYCURSOR; - goto yy49; -yy53: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy54; -yy54: if(yybm[0+yych] & 128) { - goto yy53; - } - goto yy51; -yy55: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy56; -yy56: if(yych == ' ') goto yy55; - if(yych == '=') goto yy53; - goto yy57; -yy57: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 0: goto yy49; - } -} -} -#line 322 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - - -state_val: - start = YYCURSOR; -{ - static unsigned char yybm[] = { - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 160, 160, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 160, 248, 56, 248, 248, 248, 248, 200, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 0, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - }; - -#line 825 "" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy58; - ++YYCURSOR; -yy58: - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych <= 0x08) goto yy63; - goto yy64; - } else { - if(yych == ' ') goto yy64; - goto yy63; - } - } else { - if(yych <= '\''){ - if(yych <= '"') goto yy60; - if(yych <= '&') goto yy63; - goto yy62; - } else { - if(yych == '>') goto yy64; - goto yy63; - } - } -yy60: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy77; -yy61: -#line 330 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; } -#line 858 "" -yy62: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy69; -yy63: yych = *++YYCURSOR; - goto yy67; -yy64: ++YYCURSOR; - goto yy65; -yy65: -#line 331 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ passthru(STD_ARGS); goto state_next_arg_begin; } -#line 869 "" -yy66: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy67; -yy67: if(yybm[0+yych] & 8) { - goto yy66; - } - goto yy61; -yy68: yyaccept = 0; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy69; -yy69: if(yybm[0+yych] & 16) { - goto yy68; - } - if(yych <= '&') goto yy72; - if(yych >= '(') goto yy61; - goto yy70; -yy70: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 8) { - yych = *YYCURSOR; - goto yy66; - } - goto yy71; -yy71: -#line 329 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 898 "" -yy72: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy73; -yy73: if(yybm[0+yych] & 32) { - goto yy72; - } - if(yych <= '=') goto yy75; - goto yy74; -yy74: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 0: goto yy61; - } -yy75: yych = *++YYCURSOR; - goto yy71; -yy76: yyaccept = 0; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy77; -yy77: if(yybm[0+yych] & 64) { - goto yy76; - } - if(yych <= '!') goto yy80; - if(yych >= '#') goto yy61; - goto yy78; -yy78: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 8) { - yych = *YYCURSOR; - goto yy66; - } - goto yy79; -yy79: -#line 328 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" -{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 934 "" -yy80: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy81; -yy81: if(yybm[0+yych] & 128) { - goto yy80; - } - if(yych >= '>') goto yy74; - goto yy82; -yy82: ++YYCURSOR; - yych = *YYCURSOR; - goto yy79; -} -} -#line 332 "/usr/src/php/php5/ext/standard/url_scanner_ex.re" - - -stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; - - if (rest) memmove(ctx->buf.c, start, rest); - ctx->buf.len = rest; -} - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) -{ - smart_str surl = {0}; - smart_str buf = {0}; - smart_str url_app = {0}; - - smart_str_setl(&surl, url, urllen); - - smart_str_appends(&url_app, name); - smart_str_appendc(&url_app, '='); - smart_str_appends(&url_app, value); - - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); - - smart_str_0(&buf); - if (newlen) *newlen = buf.len; - - smart_str_free(&url_app); - - return buf.c; -} - - -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) -{ - url_adapt_state_ex_t *ctx; - char *retval; - - ctx = &BG(url_adapt_state_ex); - - xx_mainloop(ctx, src, srclen TSRMLS_CC); - - *newlen = ctx->result.len; - if (!ctx->result.c) { - smart_str_appendl(&ctx->result, "", 0); - } - smart_str_0(&ctx->result); - if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - *newlen += ctx->buf.len; - smart_str_free(&ctx->buf); - } - retval = ctx->result.c; - ctx->result.c = NULL; - ctx->result.len = 0; - return retval; -} - -int php_url_scanner_ex_activate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); - - return SUCCESS; -} - -int php_url_scanner_ex_deactivate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - smart_str_free(&ctx->result); - smart_str_free(&ctx->buf); - smart_str_free(&ctx->tag); - smart_str_free(&ctx->arg); - - return SUCCESS; -} - -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - size_t len; - - if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); - if (sizeof(uint) < sizeof(size_t)) { - if (len > UINT_MAX) - len = UINT_MAX; - } - *handled_output_len = len; - } else if (BG(url_adapt_state_ex).url_app.len == 0) { - url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); - if (ctx->buf.len) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - smart_str_appendl(&ctx->result, output, output_len); - - *handled_output = ctx->result.c; - *handled_output_len = ctx->buf.len + output_len; - - ctx->result.c = NULL; - ctx->result.len = 0; - smart_str_free(&ctx->buf); - } else { - *handled_output = NULL; - } - } else { - *handled_output = NULL; - } -} - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) -{ - char *encoded; - int encoded_len; - smart_str val; - - if (! BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC); - BG(url_adapt_state_ex).active = 1; - } - - - if (BG(url_adapt_state_ex).url_app.len != 0) { - smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output); - } - - if (urlencode) { - encoded = php_url_encode(value, value_len, &encoded_len); - smart_str_setl(&val, encoded, encoded_len); - } else { - smart_str_setl(&val, value, value_len); - } - - smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); - smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); - - smart_str_appends(&BG(url_adapt_state_ex).form_app, ""); - - if (urlencode) - efree(encoded); - - return SUCCESS; -} - -int php_url_scanner_reset_vars(TSRMLS_D) -{ - BG(url_adapt_state_ex).form_app.len = 0; - BG(url_adapt_state_ex).url_app.len = 0; - - return SUCCESS; -} - -PHP_MINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).tags = NULL; - - BG(url_adapt_state_ex).form_app.c = BG(url_adapt_state_ex).url_app.c = 0; - BG(url_adapt_state_ex).form_app.len = BG(url_adapt_state_ex).url_app.len = 0; - - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(url_scanner) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).active = 0; - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(url_scanner) -{ - if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); - BG(url_adapt_state_ex).active = 0; - } - - smart_str_free(&BG(url_adapt_state_ex).form_app); - smart_str_free(&BG(url_adapt_state_ex).url_app); - - return SUCCESS; -} diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h deleted file mode 100644 index 998d8943ba594..0000000000000 --- a/ext/standard/url_scanner_ex.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef URL_SCANNER_EX_H -#define URL_SCANNER_EX_H - -PHP_MINIT_FUNCTION(url_scanner_ex); -PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); - -PHP_RINIT_FUNCTION(url_scanner_ex); -PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC); - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC); -int php_url_scanner_reset_vars(TSRMLS_D); - -int php_url_scanner_ex_activate(TSRMLS_D); -int php_url_scanner_ex_deactivate(TSRMLS_D); - -#include "php_smart_str_public.h" - -typedef struct { - /* Used by the mainloop of the scanner */ - smart_str tag; /* read only */ - smart_str arg; /* read only */ - smart_str val; /* read only */ - smart_str buf; - - /* The result buffer */ - smart_str result; - - /* The data which is appended to each relative URL/FORM */ - smart_str form_app, url_app; - - int active; - - char *lookup_data; - int state; - - /* Everything above is zeroed in RINIT */ - HashTable *tags; -} url_adapt_state_ex_t; - -typedef struct { - smart_str var; - smart_str val; -} url_adapt_var_t; - -#endif diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re deleted file mode 100644 index 0cd63a92644ee..0000000000000 --- a/ext/standard/url_scanner_ex.re +++ /dev/null @@ -1,532 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include -#include -#include - -#include "php_ini.h" -#include "php_globals.h" -#define STATE_TAG SOME_OTHER_STATE_TAG -#include "basic_functions.h" -#include "url.h" -#undef STATE_TAG - -#define url_scanner url_scanner_ex - -#include "php_smart_str.h" - -static PHP_INI_MH(OnUpdateTags) -{ - url_adapt_state_ex_t *ctx; - char *key; - char *lasts; - char *tmp; - - ctx = &BG(url_adapt_state_ex); - - tmp = estrndup(new_value, new_value_length); - - if (ctx->tags) - zend_hash_destroy(ctx->tags); - else - ctx->tags = malloc(sizeof(HashTable)); - - zend_hash_init(ctx->tags, 0, NULL, NULL, 1); - - for (key = php_strtok_r(tmp, ",", &lasts); - key; - key = php_strtok_r(NULL, ",", &lasts)) { - char *val; - - val = strchr(key, '='); - if (val) { - char *q; - int keylen; - - *val++ = '\0'; - for (q = key; *q; q++) - *q = tolower(*q); - keylen = q - key; - /* key is stored withOUT NUL - val is stored WITH NUL */ - zend_hash_add(ctx->tags, key, keylen, val, strlen(val)+1, NULL); - } - } - - efree(tmp); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) -PHP_INI_END() - -/*!re2c -any = [\000-\377]; -N = (any\[<]); -alpha = [a-zA-Z]; -alphadash = ([a-zA-Z] | "-"); -*/ - -#define YYFILL(n) goto done -#define YYCTYPE unsigned char -#define YYCURSOR p -#define YYLIMIT q -#define YYMARKER r - -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) -{ - register const char *p, *q; - const char *bash = NULL; - const char *sep = "?"; - - q = (p = url->c) + url->len; - -scan: -/*!re2c - ":" { smart_str_append(dest, url); return; } - "?" { sep = separator; goto scan; } - "#" { bash = p - 1; goto done; } - (any\[:?#])+ { goto scan; } -*/ -done: - - /* Don't modify URLs of the format "#mark" */ - if (bash && bash - url->c == 0) { - smart_str_append(dest, url); - return; - } - - if (bash) - smart_str_appendl(dest, url->c, bash - url->c); - else - smart_str_append(dest, url); - - smart_str_appends(dest, sep); - smart_str_append(dest, url_app); - - if (bash) - smart_str_appendl(dest, bash, q - bash); -} - - -#undef YYFILL -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER - -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) -{ - char f = 0; - - if (strncasecmp(ctx->arg.c, ctx->lookup_data, ctx->arg.len) == 0) - f = 1; - - if (quotes) - smart_str_appendc(&ctx->result, type); - if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); - } else { - smart_str_append(&ctx->result, &ctx->val); - } - if (quotes) - smart_str_appendc(&ctx->result, type); -} - -enum { - STATE_PLAIN = 0, - STATE_TAG, - STATE_NEXT_ARG, - STATE_ARG, - STATE_BEFORE_VAL, - STATE_VAL -}; - -#define YYFILL(n) goto stop -#define YYCTYPE unsigned char -#define YYCURSOR xp -#define YYLIMIT end -#define YYMARKER q -#define STATE ctx->state - -#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC -#define STD_ARGS ctx, start, xp TSRMLS_CC - -#if SCANNER_DEBUG -#define scdebug(x) printf x -#else -#define scdebug(x) -#endif - -static inline void passthru(STD_PARA) -{ - scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); - smart_str_appendl(&ctx->result, start, YYCURSOR - start); -} - -/* - * This function appends a hidden input field after a or - *
              . The latter is important for XHTML. - */ - -static void handle_form(STD_PARA) -{ - int doit = 0; - - if (ctx->form_app.len > 0) { - switch (ctx->tag.len) { - -#define RECOGNIZE(x) do { \ - case sizeof(x)-1: \ - if (strncasecmp(ctx->tag.c, x, sizeof(x)-1) == 0) \ - doit = 1; \ - break; \ -} while (0) - - RECOGNIZE("form"); - RECOGNIZE("fieldset"); - } - - if (doit) - smart_str_append(&ctx->result, &ctx->form_app); - } -} - - - -/* - * HANDLE_TAG copies the HTML Tag and checks whether we - * have that tag in our table. If we might modify it, - * we continue to scan the tag, otherwise we simply copy the complete - * HTML stuff to the result buffer. - */ - -static inline void handle_tag(STD_PARA) -{ - int ok = 0; - int i; - - ctx->tag.len = 0; - smart_str_appendl(&ctx->tag, start, YYCURSOR - start); - for (i = 0; i < ctx->tag.len; i++) - ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]); - if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS) - ok = 1; - STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; -} - -static inline void handle_arg(STD_PARA) -{ - ctx->arg.len = 0; - smart_str_appendl(&ctx->arg, start, YYCURSOR - start); -} - -static inline void handle_val(STD_PARA, char quotes, char type) -{ - smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); -} - -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) -{ - char *end, *q; - char *xp; - char *start; - int rest; - - smart_str_appendl(&ctx->buf, newdata, newlen); - - YYCURSOR = ctx->buf.c; - YYLIMIT = ctx->buf.c + ctx->buf.len; - - switch (STATE) { - case STATE_PLAIN: goto state_plain; - case STATE_TAG: goto state_tag; - case STATE_NEXT_ARG: goto state_next_arg; - case STATE_ARG: goto state_arg; - case STATE_BEFORE_VAL: goto state_before_val; - case STATE_VAL: goto state_val; - } - - -state_plain_begin: - STATE = STATE_PLAIN; - -state_plain: - start = YYCURSOR; -/*!re2c - "<" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } - N+ { passthru(STD_ARGS); goto state_plain; } -*/ - -state_tag: - start = YYCURSOR; -/*!re2c - alpha+ { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } - any { passthru(STD_ARGS); goto state_plain_begin; } -*/ - -state_next_arg_begin: - STATE = STATE_NEXT_ARG; - -state_next_arg: - start = YYCURSOR; -/*!re2c - ">" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } - [ \v\t\n]+ { passthru(STD_ARGS); goto state_next_arg; } - alpha { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } - any { passthru(STD_ARGS); goto state_plain_begin; } -*/ - -state_arg: - start = YYCURSOR; -/*!re2c - alpha alphadash* { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } - any { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -*/ - -state_before_val: - start = YYCURSOR; -/*!re2c - [ ]* "=" [ ]* { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } - any { --YYCURSOR; goto state_next_arg_begin; } -*/ - - -state_val: - start = YYCURSOR; -/*!re2c - ["] (any\[">])* ["] { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } - ['] (any\['>])* ['] { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } - (any\[ \t\n>])+ { handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; } - any { passthru(STD_ARGS); goto state_next_arg_begin; } -*/ - -stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; - - if (rest) memmove(ctx->buf.c, start, rest); - ctx->buf.len = rest; -} - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) -{ - smart_str surl = {0}; - smart_str buf = {0}; - smart_str url_app = {0}; - - smart_str_setl(&surl, url, urllen); - - smart_str_appends(&url_app, name); - smart_str_appendc(&url_app, '='); - smart_str_appends(&url_app, value); - - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); - - smart_str_0(&buf); - if (newlen) *newlen = buf.len; - - smart_str_free(&url_app); - - return buf.c; -} - - -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) -{ - url_adapt_state_ex_t *ctx; - char *retval; - - ctx = &BG(url_adapt_state_ex); - - xx_mainloop(ctx, src, srclen TSRMLS_CC); - - *newlen = ctx->result.len; - if (!ctx->result.c) { - smart_str_appendl(&ctx->result, "", 0); - } - smart_str_0(&ctx->result); - if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - *newlen += ctx->buf.len; - smart_str_free(&ctx->buf); - } - retval = ctx->result.c; - ctx->result.c = NULL; - ctx->result.len = 0; - return retval; -} - -int php_url_scanner_ex_activate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); - - return SUCCESS; -} - -int php_url_scanner_ex_deactivate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - smart_str_free(&ctx->result); - smart_str_free(&ctx->buf); - smart_str_free(&ctx->tag); - smart_str_free(&ctx->arg); - - return SUCCESS; -} - -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - size_t len; - - if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); - if (sizeof(uint) < sizeof(size_t)) { - if (len > UINT_MAX) - len = UINT_MAX; - } - *handled_output_len = len; - } else if (BG(url_adapt_state_ex).url_app.len == 0) { - url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); - if (ctx->buf.len) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - smart_str_appendl(&ctx->result, output, output_len); - - *handled_output = ctx->result.c; - *handled_output_len = ctx->buf.len + output_len; - - ctx->result.c = NULL; - ctx->result.len = 0; - smart_str_free(&ctx->buf); - } else { - *handled_output = NULL; - } - } else { - *handled_output = NULL; - } -} - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) -{ - char *encoded; - int encoded_len; - smart_str val; - - if (! BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC); - BG(url_adapt_state_ex).active = 1; - } - - - if (BG(url_adapt_state_ex).url_app.len != 0) { - smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output); - } - - if (urlencode) { - encoded = php_url_encode(value, value_len, &encoded_len); - smart_str_setl(&val, encoded, encoded_len); - } else { - smart_str_setl(&val, value, value_len); - } - - smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); - smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); - - smart_str_appends(&BG(url_adapt_state_ex).form_app, ""); - - if (urlencode) - efree(encoded); - - return SUCCESS; -} - -int php_url_scanner_reset_vars(TSRMLS_D) -{ - BG(url_adapt_state_ex).form_app.len = 0; - BG(url_adapt_state_ex).url_app.len = 0; - - return SUCCESS; -} - -PHP_MINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).tags = NULL; - - BG(url_adapt_state_ex).form_app.c = BG(url_adapt_state_ex).url_app.c = 0; - BG(url_adapt_state_ex).form_app.len = BG(url_adapt_state_ex).url_app.len = 0; - - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(url_scanner) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).active = 0; - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(url_scanner) -{ - if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); - BG(url_adapt_state_ex).active = 0; - } - - smart_str_free(&BG(url_adapt_state_ex).form_app); - smart_str_free(&BG(url_adapt_state_ex).url_app); - - return SUCCESS; -} diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c deleted file mode 100644 index c8daad1a25a24..0000000000000 --- a/ext/standard/user_filters.c +++ /dev/null @@ -1,578 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - | Wez Furlong (wez@thebrainroom.com) | - | Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/basic_functions.h" -#include "ext/standard/file.h" - -#define PHP_STREAM_BRIGADE_RES_NAME "userfilter.bucket brigade" -#define PHP_STREAM_BUCKET_RES_NAME "userfilter.bucket" -#define PHP_STREAM_FILTER_RES_NAME "userfilter.filter" - -struct php_user_filter_data { - zend_class_entry *ce; - /* variable length; this *must* be last in the structure */ - char classname[1]; -}; - -/* to provide context for calling into the next filter from user-space */ -static int le_userfilters; -static int le_bucket_brigade; -static int le_bucket; - -#define GET_FILTER_FROM_OBJ() { \ - zval **tmp; \ - if (FAILURE == zend_hash_index_find(Z_OBJPROP_P(this_ptr), 0, (void**)&tmp)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "filter property vanished"); \ - RETURN_FALSE; \ - } \ - ZEND_FETCH_RESOURCE(filter, php_stream_filter*, tmp, -1, "filter", le_userfilters); \ -} - -/* define the base filter class */ - -PHP_FUNCTION(user_filter_nop) -{ -} - -static zend_function_entry user_filter_class_funcs[] = { - PHP_NAMED_FE(filter, PHP_FN(user_filter_nop), NULL) - PHP_NAMED_FE(onCreate, PHP_FN(user_filter_nop), NULL) - PHP_NAMED_FE(onClose, PHP_FN(user_filter_nop), NULL) - { NULL, NULL, NULL } -}; - -static zend_class_entry user_filter_class_entry; - -PHP_MINIT_FUNCTION(user_filters) -{ - /* init the filter class ancestor */ - INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs); - if (NULL == zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) { - return FAILURE; - } - - /* init the filter resource; it has no dtor, as streams will always clean it up - * at the correct time */ - le_userfilters = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_FILTER_RES_NAME, 0); - - if (le_userfilters == FAILURE) { - return FAILURE; - } - - /* Filters will dispose of their brigades */ - le_bucket_brigade = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_BRIGADE_RES_NAME, module_number); - /* Brigades will dispose of their buckets */ - le_bucket = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_BUCKET_RES_NAME, module_number); - - if (le_bucket_brigade == FAILURE) { - return FAILURE; - } - - REGISTER_LONG_CONSTANT("PSFS_PASS_ON", PSFS_PASS_ON, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FEED_ME", PSFS_FEED_ME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_ERR_FATAL", PSFS_ERR_FATAL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("PSFS_FLAG_NORMAL", PSFS_FLAG_NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_INC", PSFS_FLAG_FLUSH_INC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_CLOSE", PSFS_FLAG_FLUSH_CLOSE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(user_filters) -{ - if (BG(user_filter_map)) { - zend_hash_destroy(BG(user_filter_map)); - efree(BG(user_filter_map)); - BG(user_filter_map) = NULL; - } - - return SUCCESS; -} - -static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - zval *obj = (zval*)thisfilter->abstract; - zval func_name; - zval *retval = NULL; - - if (obj == NULL) { - /* If there's no object associated then there's nothing to dispose of */ - return; - } - - ZVAL_STRINGL(&func_name, "onclose", sizeof("onclose")-1, 0); - - call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - /* kill the object */ - zval_ptr_dtor(&obj); -} - -php_stream_filter_status_t userfilter_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *consumed, - int flags - TSRMLS_DC) -{ - int ret = PSFS_ERR_FATAL; - zval *obj = (zval*)thisfilter->abstract; - zval func_name; - zval *retval = NULL; - zval **args[4]; - zval *zclosing, *zconsumed, *zin, *zout, *zstream; - int call_result; - - if (FAILURE == zend_hash_find(Z_OBJPROP_P(obj), "stream", sizeof("stream"), (void**)&zstream)) { - /* Give the userfilter class a hook back to the stream */ - ALLOC_INIT_ZVAL(zstream); - php_stream_to_zval(stream, zstream); - add_property_zval(obj, "stream", zstream); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zstream); - } - - ZVAL_STRINGL(&func_name, "filter", sizeof("filter")-1, 0); - - /* Setup calling arguments */ - ALLOC_INIT_ZVAL(zin); - ZEND_REGISTER_RESOURCE(zin, buckets_in, le_bucket_brigade); - args[0] = &zin; - - ALLOC_INIT_ZVAL(zout); - ZEND_REGISTER_RESOURCE(zout, buckets_out, le_bucket_brigade); - args[1] = &zout; - - ALLOC_INIT_ZVAL(zconsumed); - ZVAL_NULL(zconsumed); - args[2] = &zconsumed; - - ALLOC_INIT_ZVAL(zclosing); - ZVAL_BOOL(zclosing, flags & PSFS_FLAG_FLUSH_CLOSE); - args[3] = &zclosing; - - call_result = call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 4, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL) { - convert_to_long(retval); - if (consumed) { - convert_to_long(zconsumed); - *consumed = Z_LVAL_P(zconsumed); - } - ret = Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function"); - } - - if (retval) - zval_ptr_dtor(&retval); - zval_ptr_dtor(&zclosing); - zval_ptr_dtor(&zconsumed); - zval_ptr_dtor(&zout); - zval_ptr_dtor(&zin); - - return ret; -} - -static php_stream_filter_ops userfilter_ops = { - userfilter_filter, - userfilter_dtor, - "user-filter", - PSFO_FLAG_OUTPUTS_SAME -}; - -static php_stream_filter *user_filter_factory_create(const char *filtername, - zval *filterparams, int persistent TSRMLS_DC) -{ - struct php_user_filter_data *fdat = NULL; - php_stream_filter *filter; - zval *obj, *zfilter; - zval func_name; - zval *retval = NULL; - - /* some sanity checks */ - if (persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "cannot use a user-space filter with a persistent stream"); - return NULL; - } - - /* determine the classname/class entry */ - if (FAILURE == zend_hash_find(BG(user_filter_map), (char*)filtername, - strlen(filtername), (void**)&fdat)) { - char *period; - - /* Userspace Filters using ambiguous wildcards could cause problems. - i.e.: myfilter.foo.bar will always call into myfilter.foo.* - never seeing myfilter.* - TODO: Allow failed userfilter creations to continue - scanning through the list */ - if ((period = strrchr(filtername, '.'))) { - char *wildcard; - - /* Search for wildcard matches instead */ - wildcard = estrdup(filtername); - period = wildcard + (period - filtername); - while (period) { - *period = '\0'; - strcat(wildcard, ".*"); - if (SUCCESS == zend_hash_find(BG(user_filter_map), wildcard, strlen(wildcard), (void**)&fdat)) { - period = NULL; - } else { - *period = '\0'; - period = strrchr(wildcard, '.'); - } - } - efree(wildcard); - } - if (fdat == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Err, filter \"%s\" is not in the user-filter map, but somehow the user-filter-factory was invoked for it!?", filtername); - return NULL; - } - } - - /* bind the classname to the actual class */ - if (fdat->ce == NULL) { - if (FAILURE == zend_lookup_class(fdat->classname, strlen(fdat->classname), - (zend_class_entry ***)&fdat->ce TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "user-filter \"%s\" requires class \"%s\", but that class is not defined", - filtername, fdat->classname); - return NULL; - } - fdat->ce = *(zend_class_entry**)fdat->ce; - - } - - filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0); - if (filter == NULL) { - return NULL; - } - - /* create the object */ - ALLOC_ZVAL(obj); - object_init_ex(obj, fdat->ce); - ZVAL_REFCOUNT(obj) = 1; - PZVAL_IS_REF(obj) = 1; - - /* filtername */ - add_property_string(obj, "filtername", (char*)filtername, 1); - - /* and the parameters, if any */ - if (filterparams) { - add_property_zval(obj, "params", filterparams); - } else { - add_property_null(obj, "params"); - } - - /* invoke the constructor */ - ZVAL_STRINGL(&func_name, "oncreate", sizeof("oncreate")-1, 0); - - call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (retval) { - if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) { - /* User reported filter creation error "return false;" */ - zval_ptr_dtor(&retval); - - /* Kill the filter (safely) */ - filter->abstract = NULL; - php_stream_filter_free(filter TSRMLS_CC); - - /* Kill the object */ - zval_ptr_dtor(&obj); - - /* Report failure to filter_alloc */ - return NULL; - } - zval_ptr_dtor(&retval); - } - - /* set the filter property, this will be used during cleanup */ - ALLOC_INIT_ZVAL(zfilter); - ZEND_REGISTER_RESOURCE(zfilter, filter, le_userfilters); - filter->abstract = obj; - add_property_zval(obj, "filter", zfilter); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zfilter); - - return filter; -} - -static php_stream_filter_factory user_filter_factory = { - user_filter_factory_create -}; - -static void filter_item_dtor(struct php_user_filter_data *fdat) -{ -} - -/* {{{ proto object stream_bucket_make_writeable(resource brigade) - Return a bucket object from the brigade for operating on */ -PHP_FUNCTION(stream_bucket_make_writeable) -{ - zval *zbrigade, *zbucket; - php_stream_bucket_brigade *brigade; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, &zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); - - ZVAL_NULL(return_value); - - if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) { - ALLOC_INIT_ZVAL(zbucket); - ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket); - object_init(return_value); - add_property_zval(return_value, "bucket", zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); - if (bucket->is_unicode) { - zval *unicode_data; - - ALLOC_INIT_ZVAL(unicode_data); - ZVAL_UNICODEL(unicode_data, bucket->buf.ustr.val, bucket->buf.ustr.len, 1); - add_property_zval(return_value, "data", unicode_data); - add_property_long(return_value, "datalen", bucket->buf.str.len); - } else { - add_property_stringl(return_value, "data", bucket->buf.str.val, bucket->buf.str.len, 1); - add_property_long(return_value, "datalen", bucket->buf.str.len); - } - } -} -/* }}} */ - -/* {{{ php_stream_bucket_attach */ -static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *zbrigade, *zobject; - zval **pzbucket, **pzdata; - php_stream_bucket_brigade *brigade; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zo", &zbrigade, &zobject) == FAILURE) { - RETURN_FALSE; - } - - if (FAILURE == zend_hash_find(Z_OBJPROP_P(zobject), "bucket", 7, (void**)&pzbucket)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has no bucket property"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, &zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); - ZEND_FETCH_RESOURCE(bucket, php_stream_bucket *, pzbucket, -1, PHP_STREAM_BUCKET_RES_NAME, le_bucket); - - if (SUCCESS == zend_hash_find(Z_OBJPROP_P(zobject), "data", 5, (void**)&pzdata)) { - if (!bucket->own_buf) { - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - } - if (Z_TYPE_PP(pzdata) == IS_UNICODE) { - if (!bucket->is_unicode) { - pefree(bucket->buf.str.val, bucket->is_persistent); - bucket->buf.ustr.len = Z_USTRLEN_PP(pzdata); - bucket->buf.ustr.val = safe_pemalloc(sizeof(UChar), bucket->buf.ustr.len, 0, bucket->is_persistent); - bucket->is_unicode = 1; - } - if (bucket->buf.ustr.len < Z_USTRLEN_PP(pzdata)) { - pefree(bucket->buf.ustr.val, bucket->is_persistent); - bucket->buf.ustr.len = Z_USTRLEN_PP(pzdata); - bucket->buf.ustr.val = safe_pemalloc(sizeof(UChar), bucket->buf.ustr.len, 0, bucket->is_persistent); - } - bucket->buf.ustr.len = Z_USTRLEN_PP(pzdata); - memcpy(bucket->buf.ustr.val, Z_USTRVAL_PP(pzdata), bucket->buf.ustr.len * sizeof(UChar)); - } else { /* string -- or at least string expressable */ - SEPARATE_ZVAL_IF_NOT_REF(pzdata); - convert_to_string_ex(pzdata); - if (bucket->is_unicode) { - pefree(bucket->buf.ustr.val, bucket->is_persistent); - bucket->buf.str.len = Z_STRLEN_PP(pzdata); - bucket->buf.str.val = pemalloc(bucket->buf.str.len, bucket->is_persistent); - bucket->is_unicode = 0; - } - if (bucket->buf.str.len < Z_STRLEN_PP(pzdata)) { - bucket->buf.str.len = Z_STRLEN_PP(pzdata); - bucket->buf.str.val = perealloc(bucket->buf.str.val, bucket->buf.str.len, bucket->is_persistent); - } - bucket->buf.str.len = Z_STRLEN_PP(pzdata); - memcpy(bucket->buf.str.val, Z_STRVAL_PP(pzdata), bucket->buf.str.len); - } - } - - if (append) { - php_stream_bucket_append(brigade, bucket TSRMLS_CC); - } else { - php_stream_bucket_prepend(brigade, bucket TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto void stream_bucket_prepend(resource brigade, resource bucket) - Prepend bucket to brigade */ -PHP_FUNCTION(stream_bucket_prepend) -{ - php_stream_bucket_attach(0, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto void stream_bucket_append(resource brigade, resource bucket) - Append bucket to brigade */ -PHP_FUNCTION(stream_bucket_append) -{ - php_stream_bucket_attach(1, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto resource stream_bucket_new(resource stream, string buffer) - Create a new bucket for use on the current stream */ -PHP_FUNCTION(stream_bucket_new) -{ - zval *zstream, *zbucket; - php_stream *stream; - zval *buffer; - char *pbuffer; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zstream, &buffer) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - object_init(return_value); - if (Z_TYPE_P(buffer) == IS_UNICODE) { - bucket = php_stream_bucket_new_unicode(stream, Z_USTRVAL_P(buffer), Z_USTRLEN_P(buffer), 0, php_stream_is_persistent(stream) TSRMLS_CC); - - ZVAL_ADDREF(buffer); - add_property_zval(return_value, "data", buffer); - add_property_long(return_value, "datalen", Z_USTRLEN_P(buffer)); - } else { - convert_to_string(buffer); - bucket = php_stream_bucket_new(stream, Z_STRVAL_P(buffer), Z_STRLEN_P(buffer), 0, php_stream_is_persistent(stream) TSRMLS_CC); - - add_property_zval(return_value, "data", buffer); - add_property_long(return_value, "datalen", Z_STRLEN_P(buffer)); - } - ALLOC_INIT_ZVAL(zbucket); - ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket); - add_property_zval(return_value, "bucket", zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); -} -/* }}} */ - -/* {{{ proto array stream_get_filters(void) - Returns a list of registered filters */ -PHP_FUNCTION(stream_get_filters) -{ - char *filter_name; - int key_flags, filter_name_len = 0; - HashTable *filters_hash; - ulong num_key; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - filters_hash = php_get_stream_filters_hash(); - - if (filters_hash) { - for(zend_hash_internal_pointer_reset(filters_hash); - (key_flags = zend_hash_get_current_key_ex(filters_hash, &filter_name, &filter_name_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; - zend_hash_move_forward(filters_hash)) - if (key_flags == HASH_KEY_IS_STRING) - add_next_index_stringl(return_value, filter_name, filter_name_len, 1); - } - /* It's okay to return an empty array if no filters are registered */ -} -/* }}} */ - -/* {{{ proto bool stream_filter_register(string filtername, string classname) - Registers a custom filter handler class */ -PHP_FUNCTION(stream_filter_register) -{ - char *filtername, *classname; - int filtername_len, classname_len; - struct php_user_filter_data *fdat; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &filtername, &filtername_len, - &classname, &classname_len) == FAILURE) { - RETURN_FALSE; - } - - RETVAL_FALSE; - - if (!BG(user_filter_map)) { - BG(user_filter_map) = (HashTable*) emalloc(sizeof(HashTable)); - zend_hash_init(BG(user_filter_map), 5, NULL, (dtor_func_t) filter_item_dtor, 0); - } - - fdat = ecalloc(1, sizeof(*fdat) + classname_len); - memcpy(fdat->classname, classname, classname_len); - - if (zend_hash_add(BG(user_filter_map), filtername, filtername_len, (void*)fdat, - sizeof(*fdat) + classname_len, NULL) == SUCCESS && - php_stream_filter_register_factory_volatile(filtername, &user_filter_factory TSRMLS_CC) == SUCCESS) { - RETVAL_TRUE; - } - - efree(fdat); -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c deleted file mode 100644 index 58612bdb40495..0000000000000 --- a/ext/standard/uuencode.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Ilia Alshanetsky | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * Portions of this code are based on Berkeley's uuencode/uudecode - * implementation. - * - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -#include - -#include "php.h" -#include "php_uuencode.h" - -#define PHP_UU_ENC(c) ((c) ? ((c) & 077) + ' ' : '`') -#define PHP_UU_ENC_C2(c) PHP_UU_ENC(((*(c) << 4) & 060) | ((*((c) + 1) >> 4) & 017)) -#define PHP_UU_ENC_C3(c) PHP_UU_ENC(((*(c + 1) << 2) & 074) | ((*((c) + 2) >> 6) & 03)) - -#define PHP_UU_DEC(c) (((c) - ' ') & 077) - -PHPAPI int php_uuencode(char *src, int src_len, char **dest) -{ - int len = 45; - char *p, *s, *e, *ee; - - /* encoded length is ~ 38% greater then the original */ - p = *dest = emalloc((ceil(src_len * 1.38) + 45 + 1)); - s = src; - e = src + src_len; - - while ((s + 3) < e) { - ee = s + len; - if (ee > e) { - ee = e; - len = ee - s; - if (len % 3) { - ee = s + (int) (floor(len / 3) * 3); - } - } - *p++ = PHP_UU_ENC(len); - - while (s < ee) { - *p++ = PHP_UU_ENC(*s >> 2); - *p++ = PHP_UU_ENC_C2(s); - *p++ = PHP_UU_ENC_C3(s); - *p++ = PHP_UU_ENC(*(s + 2) & 077); - - s += 3; - } - - if (len == 45) { - *p++ = '\n'; - } - } - - if (s < e) { - if (len == 45) { - *p++ = PHP_UU_ENC(e - s); - len = 0; - } - - *p++ = PHP_UU_ENC(*s >> 2); - *p++ = PHP_UU_ENC_C2(s); - *p++ = ((e - s) > 1) ? PHP_UU_ENC_C3(s) : PHP_UU_ENC('\0'); - *p++ = ((e - s) > 2) ? PHP_UU_ENC(*(s + 2) & 077) : PHP_UU_ENC('\0'); - } - - if (len < 45) { - *p++ = '\n'; - } - - *p++ = PHP_UU_ENC('\0'); - *p++ = '\n'; - *p = '\0'; - - return (p - *dest); -} - -PHPAPI int php_uudecode(char *src, int src_len, char **dest) -{ - int len, total_len=0; - char *s, *e, *p, *ee; - - p = *dest = emalloc(ceil(src_len * 0.75) + 1); - s = src; - e = src + src_len; - - while (s < e) { - if ((len = PHP_UU_DEC(*s++)) <= 0) { - break; - } - /* sanity check */ - if (len > src_len) { - goto err; - } - - total_len += len; - - ee = s + (len == 45 ? 60 : (int) floor(len * 1.33)); - /* sanity check */ - if (ee > e) { - goto err; - } - - while (s < ee) { - *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; - *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; - *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); - s += 4; - } - - if (len < 45) { - break; - } - - /* skip \n */ - s++; - } - - if ((len = total_len > (p - *dest))) { - *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; - if (len > 1) { - *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; - if (len > 2) { - *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); - } - } - } - - *(*dest + total_len) = '\0'; - - return total_len; - -err: - efree(*dest); - return -1; -} - -/* {{{ proto string uuencode(string data) - uuencode a string */ -PHP_FUNCTION(convert_uuencode) -{ - char *src, *dst; - int src_len, dst_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &src, &src_len) == FAILURE || src_len < 1) { - RETURN_FALSE; - } - - dst_len = php_uuencode(src, src_len, &dst); - - RETURN_STRINGL(dst, dst_len, 0); -} -/* }}} */ - -/* {{{ proto string uudecode(string data) - decode a uuencoded string */ -PHP_FUNCTION(convert_uudecode) -{ - char *src, *dst; - int src_len, dst_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &src, &src_len) == FAILURE || src_len < 1) { - RETURN_FALSE; - } - - dst_len = php_uudecode(src, src_len, &dst); - if (dst_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The given parameter is not a valid uuencoded string."); - RETURN_FALSE; - } - - RETURN_STRINGL(dst, dst_len, 0); -} -/* }}} */ diff --git a/ext/standard/var.c b/ext/standard/var.c deleted file mode 100644 index 809365545e01b..0000000000000 --- a/ext/standard/var.c +++ /dev/null @@ -1,1110 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jani Lehtimäki | - | Thies C. Arntzen | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - - -/* {{{ includes -*/ - -#include -#include -#include -#include "php.h" -#include "php_string.h" -#include "php_var.h" -#include "php_smart_str.h" -#include "basic_functions.h" -#include "php_incomplete_class.h" - -#define COMMON ((*struc)->is_ref ? "&" : "") -#define Z_REFCOUNT_PP(a) ((*a)->refcount) - -/* }}} */ -/* {{{ php_var_dump */ - -/* temporary, for debugging */ -static void php_var_dump_unicode(UChar *ustr, int32_t length, int verbose, char *quote, int escape TSRMLS_DC) -{ - UChar32 c; - int32_t i; - UErrorCode status = U_ZERO_ERROR; - int32_t clen; - char *out = NULL; - - if (length == 0) { - ZEND_PUTS(quote); - ZEND_PUTS(quote); - return; - } - - clen = length * ucnv_getMaxCharSize(ZEND_U_CONVERTER(UG(output_encoding_conv))) + 1; - while (1) { - status = U_ZERO_ERROR; - out = erealloc(out, clen+1); - clen = ucnv_fromUChars(ZEND_U_CONVERTER(UG(output_encoding_conv)), out, clen+1, ustr, length, &status); - if (status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - if(U_FAILURE(status) || status==U_STRING_NOT_TERMINATED_WARNING) { - php_printf("problem converting string from Unicode: %s\n", u_errorName(status)); - efree(out); - return; - } - - ZEND_PUTS(quote); - if (escape) { - char *str; - int str_len; - - str = php_addcslashes(out, clen, &str_len, 0, "'\\", 2 TSRMLS_CC); - PHPWRITE(str, str_len); - efree(str); - } else { - PHPWRITE(out, clen); - } - ZEND_PUTS(quote); - if (verbose) { - ZEND_PUTS(" {"); - /* output the code points (not code units) */ - if(length>=0) { - /* s is not NUL-terminated */ - for(i=0; inKeyLength==0) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - if (va_arg(args, int) && - ((hash_key->type == IS_STRING && hash_key->u.string[0] == 0) || - (hash_key->type == IS_UNICODE && hash_key->u.unicode[0] == '\0'))) { - /* XXX: perhaps when we are inside the class we should permit access to - * private & protected values - */ - return 0; - } - php_printf("%*c[", level + 1, ' '); - if (hash_key->type == IS_STRING) { - php_printf("\""); - PHPWRITE(hash_key->u.string, hash_key->nKeyLength - 1); - php_printf("\""); - } else if (hash_key->type == IS_BINARY) { - php_printf("b\""); - PHPWRITE(hash_key->u.string, hash_key->nKeyLength - 1); - php_printf("\""); - } else if (hash_key->type == IS_UNICODE) { - php_printf("u"); - php_var_dump_unicode(hash_key->u.unicode, hash_key->nKeyLength-1, verbose, "\"", 0 TSRMLS_CC); - } - php_printf("]=>\n"); - } - php_var_dump(zv, level + 2, verbose TSRMLS_CC); - return 0; -} - -static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - char *prop_name, *class_name; - int verbose; - TSRMLS_FETCH(); - - level = va_arg(args, int); - verbose = va_arg(args, int); - - if (hash_key->nKeyLength ==0 ) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - int is_unicode = hash_key->type == IS_UNICODE; - - zend_u_unmangle_property_name(hash_key->type, hash_key->u.string, &class_name, &prop_name); - php_printf("%*c[", level + 1, ' '); - - if (class_name) { - if (class_name[0]=='*') { - php_printf("%s\"%R\":protected", is_unicode ? "u" : "", hash_key->type, prop_name); - } else { - php_printf("%s\"%R\":%s\"%R\":private", is_unicode ? "u" : "", hash_key->type, prop_name, is_unicode ? "u" : "", hash_key->type, class_name); - } - } else { - php_printf("%s\"%R\"", is_unicode ? "u" : "", hash_key->type, prop_name); - } - ZEND_PUTS("]=>\n"); - } - php_var_dump(zv, level + 2, verbose TSRMLS_CC); - return 0; -} - - -PHPAPI void php_var_dump(zval **struc, int level, int verbose TSRMLS_DC) -{ - HashTable *myht = NULL; - char *class_name; - zend_uint class_name_len; - int (*php_element_dump_func)(zval**, int, va_list, zend_hash_key*); - - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%sbool(%s)\n", COMMON, Z_LVAL_PP(struc)?"true":"false"); - break; - case IS_NULL: - php_printf("%sNULL\n", COMMON); - break; - case IS_LONG: - php_printf("%sint(%ld)\n", COMMON, Z_LVAL_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc)); - break; - case IS_STRING: - php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - PUTS("\"\n"); - break; - case IS_BINARY: - php_printf("%sbinary(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - PUTS("\"\n"); - break; - case IS_UNICODE: - php_printf("%sunicode(%d) ", COMMON, u_countChar32((*struc)->value.ustr.val, (*struc)->value.ustr.len)); - php_var_dump_unicode((*struc)->value.ustr.val, (*struc)->value.ustr.len, verbose, "\"", 0 TSRMLS_CC); - PUTS("\n"); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht)); - php_element_dump_func = php_array_element_dump; - goto head_done; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (myht && myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf("%sobject(%v)#%d (%d) {\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0); - efree(class_name); - php_element_dump_func = php_object_property_dump; -head_done: - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_element_dump_func, 3, level, verbose, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1)); - } - if (level > 1) { - php_printf("%*c", level-1, ' '); - } - PUTS("}\n"); - break; - case IS_RESOURCE: { - char *type_name; - - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); - php_printf("%sresource(%ld) of type (%s)\n", COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown"); - break; - } - default: - php_printf("%sUNKNOWN:0\n", COMMON); - break; - } -} - -/* }}} */ - - - -/* {{{ proto void var_dump(mixed var) - Dumps a string representation of variable to output */ -PHP_FUNCTION(var_dump) -{ - zval ***args; - int argc; - int i; - - argc = ZEND_NUM_ARGS(); - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - for (i=0; inKeyLength==0) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - /* XXX: perphaps when we are inside the class we should permit access to - * private & protected values - */ - if (va_arg(args, int) && - ((hash_key->type == IS_STRING && hash_key->u.string[0] == 0) || - (hash_key->type == IS_UNICODE && hash_key->u.unicode[0] == '\0'))) { - return 0; - } - php_printf("%*c[", level + 1, ' '); - if (hash_key->type == IS_STRING) { - php_printf("\""); - PHPWRITE(hash_key->u.string, hash_key->nKeyLength - 1); - php_printf("\""); - } else if (hash_key->type == IS_BINARY) { - php_printf("b\""); - PHPWRITE(hash_key->u.string, hash_key->nKeyLength - 1); - php_printf("\""); - } else if (hash_key->type == IS_UNICODE) { - php_printf("u"); - php_var_dump_unicode(hash_key->u.unicode, hash_key->nKeyLength-1, 1, "\"", 0 TSRMLS_CC); - } - php_printf("]=>\n"); - } - php_debug_zval_dump(zv, level + 2, 1 TSRMLS_CC); - return 0; -} - -PHPAPI void php_debug_zval_dump(zval **struc, int level, int verbose TSRMLS_DC) -{ - HashTable *myht = NULL; - char *class_name; - zend_uint class_name_len; - zend_class_entry *ce; - - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%sbool(%s) refcount(%u)\n", COMMON, Z_LVAL_PP(struc)?"true":"false", Z_REFCOUNT_PP(struc)); - break; - case IS_NULL: - php_printf("%sNULL refcount(%u)\n", COMMON, Z_REFCOUNT_PP(struc)); - break; - case IS_LONG: - php_printf("%slong(%ld) refcount(%u)\n", COMMON, Z_LVAL_PP(struc), Z_REFCOUNT_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%sdouble(%.*G) refcount(%u)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc), Z_REFCOUNT_PP(struc)); - break; - case IS_STRING: - php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - php_printf("\" refcount(%u)\n", Z_REFCOUNT_PP(struc)); - break; - case IS_BINARY: - php_printf("%sbinary(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - php_printf("\" refcount(%u)\n", Z_REFCOUNT_PP(struc)); - break; - case IS_UNICODE: - php_printf("%sunicode(%d) ", COMMON, u_countChar32((*struc)->value.ustr.val, (*struc)->value.ustr.len)); - php_var_dump_unicode((*struc)->value.ustr.val, (*struc)->value.ustr.len, verbose, "\"", 0 TSRMLS_CC); - php_printf(" refcount(%u)\n", Z_REFCOUNT_PP(struc)); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNT_PP(struc)); - goto head_done; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (myht && myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - ce = Z_OBJCE(**struc); - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf("%sobject(%v)#%d (%d) refcount(%u){\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0, Z_REFCOUNT_PP(struc)); - efree(class_name); -head_done: - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) zval_array_element_dump, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1)); - } - if (level > 1) { - php_printf("%*c", level-1, ' '); - } - PUTS("}\n"); - break; - case IS_RESOURCE: { - char *type_name; - - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); - php_printf("%sresource(%ld) of type (%s) refcount(%u)\n", COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown", Z_REFCOUNT_PP(struc)); - break; - } - default: - php_printf("%sUNKNOWN:0\n", COMMON); - break; - } -} - -/* }}} */ - -/* {{{ proto void debug_zval_dump(mixed var) - Dumps a string representation of an internal zend value to output. */ -PHP_FUNCTION(debug_zval_dump) -{ - zval ***args; - int argc; - int i; - - argc = ZEND_NUM_ARGS(); - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - for (i=0; inKeyLength==0) { /* numeric key */ - php_printf("%*c%ld => ", level + 1, ' ', hash_key->h); - } else { /* string key */ - php_printf("%*c'", level + 1, ' '); - if (hash_key->type == IS_UNICODE) { - php_var_dump_unicode(hash_key->u.unicode, hash_key->nKeyLength-1, 0, "", 1 TSRMLS_CC); - } else { - char *key; - int key_len; - - key = php_addcslashes(hash_key->u.string, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC); - PHPWRITE(key, key_len); - efree(key); - } - php_printf("' => "); - } - php_var_export(zv, level + 2 TSRMLS_CC); - PUTS (",\n"); - return 0; -} - -static int php_object_element_export(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - char *prop_name, *class_name; - TSRMLS_FETCH(); - - level = va_arg(args, int); - - if (hash_key->nKeyLength != 0) { - php_printf("%*c", level + 1, ' '); - zend_u_unmangle_property_name(hash_key->type, hash_key->u.string, &class_name, &prop_name); - php_printf(" '%R' => ", hash_key->type, prop_name); - php_var_export(zv, level + 2 TSRMLS_CC); - PUTS (",\n"); - } - return 0; -} - -PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) -{ - HashTable *myht; - char* tmp_str; - int tmp_len; - char *class_name; - zend_uint class_name_len; - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%s", Z_LVAL_PP(struc) ? "true" : "false"); - break; - case IS_NULL: - php_printf("NULL"); - break; - case IS_LONG: - php_printf("%ld", Z_LVAL_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%.*G", (int) EG(precision), Z_DVAL_PP(struc)); - break; - case IS_BINARY: - PUTS ("b"); - case IS_STRING: - tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC); - PUTS ("'"); - PHPWRITE(tmp_str, tmp_len); - PUTS ("'"); - efree (tmp_str); - break; - case IS_UNICODE: - php_var_dump_unicode(Z_USTRVAL_PP(struc), Z_USTRLEN_PP(struc), 0, "'", 1 TSRMLS_CC); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (level > 1) { - php_printf("\n%*c", level - 1, ' '); - } - PUTS ("array (\n"); - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_array_element_export, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1)); - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - PUTS(")"); - break; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (level > 1) { - php_printf("\n%*c", level - 1, ' '); - } - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf ("%v::__set_state(array(\n", class_name); - efree(class_name); - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_object_element_export, 1, level); - } - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - php_printf ("))"); - break; - default: - PUTS ("NULL"); - break; - } -} - -/* }}} */ - - -/* {{{ proto mixed var_export(mixed var [, bool return]) - Outputs or returns a string representation of a variable */ -PHP_FUNCTION(var_export) -{ - zval *var; - zend_bool return_output = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) { - return; - } - - if (return_output) { - php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC); - } - - php_var_export(&var, 1 TSRMLS_CC); - - if (return_output) { - php_ob_get_buffer (return_value TSRMLS_CC); - php_end_ob_buffer (0, 0 TSRMLS_CC); - } -} -/* }}} */ - - - -/* {{{ php_var_serialize */ - -static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *var_hash TSRMLS_DC); - -static inline int php_add_var_hash(HashTable *var_hash, zval *var, void *var_old TSRMLS_DC) -{ - ulong var_no; - char id[32], *p; - register int len; - - /* relies on "(long)" being a perfect hash function for data pointers, - however the actual identity of an object has had to be determined - by its object handle and the class entry since 5.0. */ - if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, - (((unsigned long)Z_OBJCE_P(var) << 5) - | ((unsigned long)Z_OBJCE_P(var) >> (sizeof(long) * 8 - 5))) - + (long) Z_OBJ_HANDLE_P(var)); - *(--p) = 'O'; - len = id + sizeof(id) - 1 - p; - } else { - p = smart_str_print_long(id + sizeof(id) - 1, (long) var); - len = id + sizeof(id) - 1 - p; - } - - if (var_old && zend_hash_find(var_hash, p, len, var_old) == SUCCESS) { - if (!var->is_ref) { - /* we still need to bump up the counter, since non-refs will - be counted separately by unserializer */ - var_no = -1; - zend_hash_next_index_insert(var_hash, &var_no, sizeof(var_no), NULL); - } - return FAILURE; - } - - /* +1 because otherwise hash will think we are trying to store NULL pointer */ - var_no = zend_hash_num_elements(var_hash) + 1; - zend_hash_add(var_hash, p, len, &var_no, sizeof(var_no), NULL); - return SUCCESS; -} - -static inline void php_var_serialize_long(smart_str *buf, long val) -{ - smart_str_appendl(buf, "i:", 2); - smart_str_append_long(buf, val); - smart_str_appendc(buf, ';'); -} - -static inline void php_var_serialize_string(smart_str *buf, char *str, int len) -{ - smart_str_appendl(buf, "s:", 2); - smart_str_append_long(buf, len); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, str, len); - smart_str_appendl(buf, "\";", 2); -} - -static inline void php_var_serialize_binary(smart_str *buf, char *str, int len) -{ - smart_str_appendl(buf, "B:", 2); - smart_str_append_long(buf, len); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, str, len); - smart_str_appendl(buf, "\";", 2); -} - -static inline void php_var_serialize_ustr(smart_str *buf, UChar *ustr, int len) -{ - static const char hex[] = "0123456789abcdef"; - UChar32 c; - int32_t i; - - for(i=0; i> 12) & 0xf]); - smart_str_appendc(buf, hex[(c >> 8) & 0xf]); - smart_str_appendc(buf, hex[(c >> 4) & 0xf]); - smart_str_appendc(buf, hex[(c >> 0) & 0xf]); - } -} - -static inline void php_var_serialize_unicode(smart_str *buf, UChar *ustr, int len) -{ - smart_str_appendl(buf, "U:", 2); - smart_str_append_long(buf, len); - smart_str_appendl(buf, ":\"", 2); - php_var_serialize_ustr(buf, ustr, len); - smart_str_appendl(buf, "\";", 2); -} - -static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval **struc TSRMLS_DC) -{ - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(*struc); - smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, name_len); - smart_str_appendl(buf, ":\"", 2); - if (UG(unicode)) { - php_var_serialize_ustr(buf, (UChar*)class_name, name_len); - } else { - smart_str_appendl(buf, class_name, name_len); - } - smart_str_appendl(buf, "\":", 2); - PHP_CLEANUP_CLASS_ATTRIBUTES(); - return incomplete_class; -} - -static void php_var_serialize_class(smart_str *buf, zval **struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC) -{ - int count; - zend_bool incomplete_class; - - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); - /* count after serializing name, since php_var_serialize_class_name - changes the count if the variable is incomplete class */ - count = zend_hash_num_elements(HASH_OF(retval_ptr)); - if (incomplete_class) { - --count; - } - smart_str_append_long(buf, count); - smart_str_appendl(buf, ":{", 2); - - if (count > 0) { - char *key; - zval **d, **name; - ulong index; - HashPosition pos; - int i; - zval nval, *nvalp; - - ZVAL_NULL(&nval); - nvalp = &nval; - - zend_hash_internal_pointer_reset_ex(HASH_OF(retval_ptr), &pos); - - for (;; zend_hash_move_forward_ex(HASH_OF(retval_ptr), &pos)) { - i = zend_hash_get_current_key_ex(HASH_OF(retval_ptr), &key, NULL, - &index, 0, &pos); - - if (i == HASH_KEY_NON_EXISTANT) - break; - - if (incomplete_class && strcmp(key, MAGIC_MEMBER) == 0) { - continue; - } - zend_hash_get_current_data_ex(HASH_OF(retval_ptr), - (void **) &name, &pos); - - if (Z_TYPE_PP(name) != (UG(unicode)?IS_UNICODE:IS_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only " - "containing the names of instance-variables to " - "serialize."); - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - smart_str_appendl(buf,"N;", 2); - continue; - } - if (zend_u_hash_find(Z_OBJPROP_PP(struc), Z_TYPE_PP(name), Z_UNIVAL_PP(name), - Z_UNILEN_PP(name) + 1, (void *) &d) == SUCCESS) { - if (Z_TYPE_PP(name) == IS_UNICODE) { - php_var_serialize_unicode(buf, Z_USTRVAL_PP(name), Z_USTRLEN_PP(name)); - } else { - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - } - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); - } else { - zend_class_entry *ce; - ce = zend_get_class_entry(*struc TSRMLS_CC); - if (ce) { - char *prot_name, *priv_name; - int prop_name_length; - - do { - zend_u_mangle_property_name(&priv_name, &prop_name_length, Z_TYPE_PP(name), ce->name, ce->name_length, - Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_u_hash_find(Z_OBJPROP_PP(struc), Z_TYPE_PP(name), priv_name, prop_name_length, (void *) &d) == SUCCESS) { - if (Z_TYPE_PP(name) == IS_UNICODE) { - php_var_serialize_unicode(buf, (UChar *)priv_name, prop_name_length-1); - } else { - php_var_serialize_string(buf, priv_name, prop_name_length-1); - } - efree(priv_name); - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); - break; - } - efree(priv_name); - zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), "*", 1, - Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_u_hash_find(Z_OBJPROP_PP(struc), Z_TYPE_PP(name), prot_name, prop_name_length, (void *) &d) == SUCCESS) { - if (Z_TYPE_PP(name) == IS_UNICODE) { - php_var_serialize_unicode(buf, (UChar *)prot_name, prop_name_length-1); - } else { - php_var_serialize_string(buf, prot_name, prop_name_length-1); - } - efree(prot_name); - php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); - break; - } - efree(prot_name); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%R\" returned as member variable from __sleep() but does not exist", Z_TYPE_PP(name), Z_UNIVAL_PP(name)); - if (Z_TYPE_PP(name) == IS_UNICODE) { - php_var_serialize_unicode(buf, Z_USTRVAL_PP(name), Z_USTRLEN_PP(name)); - } else { - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - } - php_var_serialize_intern(buf, &nvalp, var_hash TSRMLS_CC); - } while (0); - } else { - if (Z_TYPE_PP(name) == IS_UNICODE) { - php_var_serialize_unicode(buf, Z_USTRVAL_PP(name), Z_USTRLEN_PP(name)); - } else { - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - } - php_var_serialize_intern(buf, &nvalp, var_hash TSRMLS_CC); - } - } - } - } - smart_str_appendc(buf, '}'); -} - - -static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *var_hash TSRMLS_DC) -{ - int i; - ulong *var_already; - HashTable *myht; - - if (var_hash - && php_add_var_hash(var_hash, *struc, (void *) &var_already TSRMLS_CC) == FAILURE) { - if((*struc)->is_ref) { - smart_str_appendl(buf, "R:", 2); - smart_str_append_long(buf, *var_already); - smart_str_appendc(buf, ';'); - return; - } else if(Z_TYPE_PP(struc) == IS_OBJECT) { - smart_str_appendl(buf, "r:", 2); - smart_str_append_long(buf, *var_already); - smart_str_appendc(buf, ';'); - return; - } - } - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - smart_str_appendl(buf, "b:", 2); - smart_str_append_long(buf, Z_LVAL_PP(struc)); - smart_str_appendc(buf, ';'); - return; - - case IS_NULL: - smart_str_appendl(buf, "N;", 2); - return; - - case IS_LONG: - php_var_serialize_long(buf, Z_LVAL_PP(struc)); - return; - - case IS_DOUBLE: { - char *s; - ulong slen; - - slen = spprintf(&s, 0, "d:%.*G;", (int) PG(serialize_precision), Z_DVAL_PP(struc)); - smart_str_appendl(buf, s, slen); - efree(s); - return; - } - - case IS_STRING: - php_var_serialize_string(buf, Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - return; - - case IS_BINARY: - php_var_serialize_binary(buf, Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - return; - - case IS_UNICODE: - php_var_serialize_unicode(buf, Z_USTRVAL_PP(struc), Z_USTRLEN_PP(struc)); - return; - - case IS_OBJECT: { - zval *retval_ptr = NULL; - zval fname; - int res; - zend_class_entry *ce = NULL; - - if(Z_OBJ_HT_PP(struc)->get_class_entry) { - ce = Z_OBJCE_PP(struc); - } - - if(ce && ce->serialize != NULL) { - /* has custom handler */ - unsigned char *serialized_data = NULL; - zend_uint serialized_length; - - if(ce->serialize(*struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { - smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, Z_OBJCE_PP(struc)->name_length); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, Z_OBJCE_PP(struc)->name, Z_OBJCE_PP(struc)->name_length); - smart_str_appendl(buf, "\":", 2); - - smart_str_append_long(buf, serialized_length); - smart_str_appendl(buf, ":{", 2); - smart_str_appendl(buf, serialized_data, serialized_length); - smart_str_appendc(buf, '}'); - } else { - smart_str_appendl(buf, "N;", 2); - } - if(serialized_data) { - efree(serialized_data); - } - return; - } - - if (ce && ce != PHP_IC_ENTRY && - zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1, 0); - res = call_user_function_ex(CG(function_table), struc, &fname, - &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - - if (res == SUCCESS && !EG(exception)) { - if (retval_ptr) { - if (HASH_OF(retval_ptr)) { - php_var_serialize_class(buf, struc, retval_ptr, - var_hash TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only " - "containing the names of instance-variables to " - "serialize."); - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - smart_str_appendl(buf,"N;", 2); - } - - zval_ptr_dtor(&retval_ptr); - } - return; - } - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - /* fall-through */ - } - case IS_ARRAY: { - zend_bool incomplete_class = 0; - if (Z_TYPE_PP(struc) == IS_ARRAY) { - smart_str_appendl(buf, "a:", 2); - myht = HASH_OF(*struc); - } else { - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); - myht = Z_OBJPROP_PP(struc); - } - /* count after serializing name, since php_var_serialize_class_name - changes the count if the variable is incomplete class */ - i = myht ? zend_hash_num_elements(myht) : 0; - if (i > 0 && incomplete_class) { - --i; - } - smart_str_append_long(buf, i); - smart_str_appendl(buf, ":{", 2); - if (i > 0) { - char *key; - zval **data; - ulong index; - uint key_len; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(myht, &pos); - for (;; zend_hash_move_forward_ex(myht, &pos)) { - i = zend_hash_get_current_key_ex(myht, &key, &key_len, - &index, 0, &pos); - if (i == HASH_KEY_NON_EXISTANT) - break; - - if (incomplete_class && strcmp(key, MAGIC_MEMBER) == 0) { - continue; - } - - switch (i) { - case HASH_KEY_IS_LONG: - php_var_serialize_long(buf, index); - break; - case HASH_KEY_IS_STRING: - php_var_serialize_string(buf, key, key_len - 1); - break; - case HASH_KEY_IS_BINARY: - php_var_serialize_binary(buf, key, key_len - 1); - break; - case HASH_KEY_IS_UNICODE: - php_var_serialize_unicode(buf, (UChar*)key, key_len - 1); - break; - } - - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - if (zend_hash_get_current_data_ex(myht, - (void **) &data, &pos) != SUCCESS - || !data - || data == struc) { - smart_str_appendl(buf, "N;", 2); - } else { - php_var_serialize_intern(buf, data, var_hash TSRMLS_CC); - } - } - } - smart_str_appendc(buf, '}'); - return; - } - default: - smart_str_appendl(buf, "i:0;", 4); - return; - } -} - -PHPAPI void php_var_serialize(smart_str *buf, zval **struc, HashTable *var_hash TSRMLS_DC) -{ - php_var_serialize_intern(buf, struc, var_hash TSRMLS_CC); - smart_str_0(buf); -} - -/* }}} */ - -/* {{{ proto string serialize(mixed variable) - Returns a string representation of variable (which can later be unserialized) */ -PHP_FUNCTION(serialize) -{ - zval **struc; - php_serialize_data_t var_hash; - smart_str buf = {0}; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &struc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, struc, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - if (buf.c) { - RETURN_STRINGL(buf.c, buf.len, 0); - } else { - RETURN_NULL(); - } -} - -/* }}} */ -/* {{{ proto mixed unserialize(string variable_representation) - Takes a string representation of variable and recreates it */ - - -PHP_FUNCTION(unserialize) -{ - zval **buf; - php_unserialize_data_t var_hash; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &buf) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(buf) == IS_STRING) { - const unsigned char *p = (unsigned char*)Z_STRVAL_PP(buf); - - if (Z_STRLEN_PP(buf) == 0) { - RETURN_FALSE; - } - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf), &var_hash TSRMLS_CC)) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zval_dtor(return_value); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - Z_STRVAL_PP(buf)), Z_STRLEN_PP(buf)); - RETURN_FALSE; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is not a string"); - RETURN_FALSE; - } -} - -/* }}} */ - -#if MEMORY_LIMIT -/* {{{ proto int memory_get_usage() - Returns the allocated by PHP memory */ -PHP_FUNCTION(memory_get_usage) { - RETURN_LONG(AG(allocated_memory)); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c deleted file mode 100644 index 7693e74bb58cc..0000000000000 --- a/ext/standard/var_unserializer.c +++ /dev/null @@ -1,1087 +0,0 @@ -/* Generated by re2c 0.9.10 on Mon Sep 5 19:20:33 2005 */ -#line 1 "/usr/src/php/php6/ext/standard/var_unserializer.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/php_var.h" -#include "php_incomplete_class.h" - -/* {{{ reference-handling for unserializer: var_* */ -#define VAR_ENTRIES_MAX 1024 - -typedef struct { - zval *data[VAR_ENTRIES_MAX]; - long used_slots; - void *next; -} var_entries; - -static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first) - var_hashx->first = var_hash; - else - prev->next = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - -static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first_dtor) - var_hashx->first_dtor = var_hash; - else - prev->next = var_hash; - } - - (*rval)->refcount++; - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) -{ - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - if (var_hash->data[i] == ozval) { - var_hash->data[i] = *nzval; - /* do not break here */ - } - } - var_hash = var_hash->next; - } -} - -static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) -{ - var_entries *var_hash = var_hashx->first; - - while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = var_hash->next; - id -= VAR_ENTRIES_MAX; - } - - if (!var_hash) return !SUCCESS; - - if (id < 0 || id >= var_hash->used_slots) return !SUCCESS; - - *store = &var_hash->data[id]; - - return SUCCESS; -} - -PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) -{ - void *next; - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - next = var_hash->next; - efree(var_hash); - var_hash = next; - } - - var_hash = var_hashx->first_dtor; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - zval_ptr_dtor(&var_hash->data[i]); - } - next = var_hash->next; - efree(var_hash); - var_hash = next; - } -} - -/* }}} */ - -#define YYFILL(n) do { } while (0) -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker - - -#line 155 "/usr/src/php/php6/ext/standard/var_unserializer.re" - - - - -static inline long parse_iv2(const unsigned char *p, const unsigned char **q) -{ - char cursor; - long result = 0; - int neg = 0; - - switch (*p) { - case '-': - neg++; - /* fall-through */ - case '+': - p++; - } - - while (1) { - cursor = (char)*p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + cursor - '0'; - } else { - break; - } - p++; - } - if (q) *q = p; - if (neg) return -result; - return result; -} - -static inline long parse_iv(const unsigned char *p) -{ - return parse_iv2(p, NULL); -} - -/* no need to check for length - re2c already did */ -static inline size_t parse_uiv(const unsigned char *p) -{ - unsigned char cursor; - size_t result = 0; - - if (*p == '+') { - p++; - } - - while (1) { - cursor = *p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - return result; -} - -#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC -#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC - -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) -{ - while (elements-- > 0) { - zval *key, *data, **old_data; - - ALLOC_INIT_ZVAL(key); - - if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - ALLOC_INIT_ZVAL(data); - - if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - zval_dtor(data); - FREE_ZVAL(data); - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); - break; - case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); - break; - } - - zval_dtor(key); - FREE_ZVAL(key); - - if (elements && *(*p-1) != ';' && *(*p-1) != '}') { - (*p)--; - return 0; - } - } - - return 1; -} - -static inline int finish_nested_data(UNSERIALIZE_PARAMETER) -{ - if (*((*p)++) == '}') - return 1; - -#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE - zval_ptr_dtor(rval); -#endif - return 0; -} - -static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long datalen; - - if(ce->unserialize == NULL) { - zend_error(E_WARNING, "Class %v has no unserializer", ce->name); - return 0; - } - - datalen = parse_iv2((*p) + 2, p); - - (*p) += 2; - - if(datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %d present", datalen, max - (*p)); - return 0; - } - - if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { - return 0; - } - - (*p) += datalen; - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long elements; - - elements = parse_iv2((*p) + 2, p); - - (*p) += 2; - - object_init_ex(*rval, ce); - return elements; -} - -static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) -{ - zval *retval_ptr = NULL; - zval fname; - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { - return 0; - } - - if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && - zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0); - call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - - return finish_nested_data(UNSERIALIZE_PASSTHRU); - -} - -PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -{ - const unsigned char *cursor, *limit, *marker, *start; - zval **rval_ref; - - limit = cursor = *p; - - if (var_hash && cursor[0] != 'R') { - var_push(var_hash, rval); - } - - start = cursor; - - - -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - -#line 394 "" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy0; - ++YYCURSOR; -yy0: - if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); - yych = *YYCURSOR; - switch(yych){ - case 'C': case 'O': goto yy12; - case 'N': goto yy5; - case 'R': goto yy2; - case 'a': goto yy10; - case 'b': goto yy6; - case 'd': goto yy8; - case 'i': goto yy7; - case 'o': goto yy11; - case 'r': goto yy4; - case 's': goto yy9; - case '}': goto yy13; - default: goto yy15; - } -yy2: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy87; - goto yy3; -yy3: -#line 626 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ return 0; } -#line 424 "" -yy4: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy81; - goto yy3; -yy5: yych = *++YYCURSOR; - if(yych == ';') goto yy79; - goto yy3; -yy6: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy75; - goto yy3; -yy7: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy69; - goto yy3; -yy8: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy45; - goto yy3; -yy9: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy38; - goto yy3; -yy10: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy31; - goto yy3; -yy11: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy24; - goto yy3; -yy12: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy16; - goto yy3; -yy13: ++YYCURSOR; - goto yy14; -yy14: -#line 620 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); - return 0; /* not sure if it should be 0 or 1 here? */ -} -#line 469 "" -yy15: yych = *++YYCURSOR; - goto yy3; -yy16: yych = *++YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy19; - } - if(yych == '+') goto yy18; - goto yy17; -yy17: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 0: goto yy3; - } -yy18: yych = *++YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy19; - } - goto yy17; -yy19: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy20; -yy20: if(yybm[0+yych] & 128) { - goto yy19; - } - if(yych != ':') goto yy17; - goto yy21; -yy21: yych = *++YYCURSOR; - if(yych != '"') goto yy17; - goto yy22; -yy22: ++YYCURSOR; - goto yy23; -yy23: -#line 508 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - size_t len, len2, len3, maxlen; - long elements; - char *class_name; - zend_class_entry *ce; - zend_class_entry **pce; - int incomplete_class = 0; - - int custom_object = 0; - - zval *user_func; - zval *retval_ptr; - zval **args[1]; - zval *arg_func_name; - - if(*start == 'C') { - custom_object = 1; - } - - INIT_PZVAL(*rval); - len2 = len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len || len == 0) { - *p = start + 2; - return 0; - } - - class_name = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - if (*(YYCURSOR+1) != ':') { - *p = YYCURSOR+1; - return 0; - } - - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); - if (len3 != len) - { - *p = YYCURSOR + len3 - len; - return 0; - } - - class_name = estrndup(class_name, len); - - do { - /* Try to find class directly */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - break; - } - - /* Check for unserialize callback */ - if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { - incomplete_class = 1; - ce = PHP_IC_ENTRY; - break; - } - - /* Call unserialize callback */ - MAKE_STD_ZVAL(user_func); - ZVAL_STRING(user_func, PG(unserialize_callback_func), 1); - args[0] = &arg_func_name; - MAKE_STD_ZVAL(arg_func_name); - ZVAL_STRING(arg_func_name, class_name, 1); - if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - /* The callback function may have defined the class */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - } - - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } while (1); - - *p = YYCURSOR; - - if(custom_object) { - efree(class_name); - return object_custom(UNSERIALIZE_PASSTHRU, ce); - } - - elements = object_common1(UNSERIALIZE_PASSTHRU, ce); - - if (incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - - return object_common2(UNSERIALIZE_PASSTHRU, elements); -} -#line 614 "" -yy24: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy17; - goto yy25; - } else { - if(yych <= '-') goto yy25; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy26; - goto yy17; - } -yy25: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy26; -yy26: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy27; -yy27: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy26; - if(yych >= ';') goto yy17; - goto yy28; -yy28: yych = *++YYCURSOR; - if(yych != '"') goto yy17; - goto yy29; -yy29: ++YYCURSOR; - goto yy30; -yy30: -#line 500 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - - INIT_PZVAL(*rval); - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} -#line 651 "" -yy31: yych = *++YYCURSOR; - if(yych == '+') goto yy32; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy33; - goto yy17; -yy32: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy33; -yy33: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy34; -yy34: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy33; - if(yych >= ';') goto yy17; - goto yy35; -yy35: yych = *++YYCURSOR; - if(yych != '{') goto yy17; - goto yy36; -yy36: ++YYCURSOR; - goto yy37; -yy37: -#line 478 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - - if (elements < 0) { - return 0; - } - - INIT_PZVAL(*rval); - Z_TYPE_PP(rval) = IS_ARRAY; - ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); - - zend_hash_init(Z_ARRVAL_PP(rval), elements + 1, NULL, ZVAL_PTR_DTOR, 0); - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} -#line 697 "" -yy38: yych = *++YYCURSOR; - if(yych == '+') goto yy39; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy40; - goto yy17; -yy39: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy40; -yy40: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy41; -yy41: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy40; - if(yych >= ';') goto yy17; - goto yy42; -yy42: yych = *++YYCURSOR; - if(yych != '"') goto yy17; - goto yy43; -yy43: ++YYCURSOR; - goto yy44; -yy44: -#line 450 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 1); - return 1; -} -#line 749 "" -yy45: yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych <= ','){ - if(yych == '+') goto yy49; - goto yy17; - } else { - if(yych <= '-') goto yy47; - if(yych <= '.') goto yy52; - goto yy17; - } - } else { - if(yych <= 'I'){ - if(yych <= '9') goto yy50; - if(yych <= 'H') goto yy17; - goto yy48; - } else { - if(yych != 'N') goto yy17; - goto yy46; - } - } -yy46: yych = *++YYCURSOR; - if(yych == 'A') goto yy68; - goto yy17; -yy47: yych = *++YYCURSOR; - if(yych <= '/'){ - if(yych == '.') goto yy52; - goto yy17; - } else { - if(yych <= '9') goto yy50; - if(yych != 'I') goto yy17; - goto yy48; - } -yy48: yych = *++YYCURSOR; - if(yych == 'N') goto yy64; - goto yy17; -yy49: yych = *++YYCURSOR; - if(yych == '.') goto yy52; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy50; -yy50: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy51; -yy51: if(yych <= ':'){ - if(yych <= '.'){ - if(yych <= '-') goto yy17; - goto yy62; - } else { - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy50; - goto yy17; - } - } else { - if(yych <= 'E'){ - if(yych <= ';') goto yy55; - if(yych <= 'D') goto yy17; - goto yy57; - } else { - if(yych == 'e') goto yy57; - goto yy17; - } - } -yy52: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy53; -yy53: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy54; -yy54: if(yych <= ';'){ - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy53; - if(yych <= ':') goto yy17; - goto yy55; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy17; - goto yy57; - } else { - if(yych == 'e') goto yy57; - goto yy17; - } - } -yy55: ++YYCURSOR; - goto yy56; -yy56: -#line 443 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); - return 1; -} -#line 845 "" -yy57: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy17; - goto yy58; - } else { - if(yych <= '-') goto yy58; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy59; - goto yy17; - } -yy58: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych == '+') goto yy61; - goto yy17; - } else { - if(yych <= '-') goto yy61; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy59; - } -yy59: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy60; -yy60: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy59; - if(yych == ';') goto yy55; - goto yy17; -yy61: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy59; - goto yy17; -yy62: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - goto yy63; -yy63: if(yych <= ';'){ - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy62; - if(yych <= ':') goto yy17; - goto yy55; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy17; - goto yy57; - } else { - if(yych == 'e') goto yy57; - goto yy17; - } - } -yy64: yych = *++YYCURSOR; - if(yych != 'F') goto yy17; - goto yy65; -yy65: yych = *++YYCURSOR; - if(yych != ';') goto yy17; - goto yy66; -yy66: ++YYCURSOR; - goto yy67; -yy67: -#line 428 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - *p = YYCURSOR; - INIT_PZVAL(*rval); - - if (!strncmp(start + 2, "NAN", 3)) { - ZVAL_DOUBLE(*rval, php_get_nan()); - } else if (!strncmp(start + 2, "INF", 3)) { - ZVAL_DOUBLE(*rval, php_get_inf()); - } else if (!strncmp(start + 2, "-INF", 4)) { - ZVAL_DOUBLE(*rval, -php_get_inf()); - } - - return 1; -} -#line 920 "" -yy68: yych = *++YYCURSOR; - if(yych == 'N') goto yy65; - goto yy17; -yy69: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy17; - goto yy70; - } else { - if(yych <= '-') goto yy70; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy71; - goto yy17; - } -yy70: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy71; -yy71: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy72; -yy72: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy71; - if(yych != ';') goto yy17; - goto yy73; -yy73: ++YYCURSOR; - goto yy74; -yy74: -#line 421 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_LONG(*rval, parse_iv(start + 2)); - return 1; -} -#line 956 "" -yy75: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= '2') goto yy17; - goto yy76; -yy76: yych = *++YYCURSOR; - if(yych != ';') goto yy17; - goto yy77; -yy77: ++YYCURSOR; - goto yy78; -yy78: -#line 414 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_BOOL(*rval, parse_iv(start + 2)); - return 1; -} -#line 974 "" -yy79: ++YYCURSOR; - goto yy80; -yy80: -#line 407 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_NULL(*rval); - return 1; -} -#line 985 "" -yy81: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy17; - goto yy82; - } else { - if(yych <= '-') goto yy82; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy83; - goto yy17; - } -yy82: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy83; -yy83: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy84; -yy84: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy83; - if(yych != ';') goto yy17; - goto yy85; -yy85: ++YYCURSOR; - goto yy86; -yy86: -#line 384 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval == *rval_ref) return 0; - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 0; - - return 1; -} -#line 1034 "" -yy87: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy17; - goto yy88; - } else { - if(yych <= '-') goto yy88; - if(yych <= '/') goto yy17; - if(yych <= '9') goto yy89; - goto yy17; - } -yy88: yych = *++YYCURSOR; - if(yych <= '/') goto yy17; - if(yych >= ':') goto yy17; - goto yy89; -yy89: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy90; -yy90: if(yych <= '/') goto yy17; - if(yych <= '9') goto yy89; - if(yych != ';') goto yy17; - goto yy91; -yy91: ++YYCURSOR; - goto yy92; -yy92: -#line 363 "/usr/src/php/php6/ext/standard/var_unserializer.re" -{ - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 1; - - return 1; -} -#line 1081 "" -} -} -#line 628 "/usr/src/php/php6/ext/standard/var_unserializer.re" - - - return 0; -} diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re deleted file mode 100644 index 22277dddd7a76..0000000000000 --- a/ext/standard/var_unserializer.re +++ /dev/null @@ -1,631 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/php_var.h" -#include "php_incomplete_class.h" - -/* {{{ reference-handling for unserializer: var_* */ -#define VAR_ENTRIES_MAX 1024 - -typedef struct { - zval *data[VAR_ENTRIES_MAX]; - long used_slots; - void *next; -} var_entries; - -static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first) - var_hashx->first = var_hash; - else - prev->next = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - -static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first_dtor) - var_hashx->first_dtor = var_hash; - else - prev->next = var_hash; - } - - (*rval)->refcount++; - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) -{ - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - if (var_hash->data[i] == ozval) { - var_hash->data[i] = *nzval; - /* do not break here */ - } - } - var_hash = var_hash->next; - } -} - -static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) -{ - var_entries *var_hash = var_hashx->first; - - while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = var_hash->next; - id -= VAR_ENTRIES_MAX; - } - - if (!var_hash) return !SUCCESS; - - if (id < 0 || id >= var_hash->used_slots) return !SUCCESS; - - *store = &var_hash->data[id]; - - return SUCCESS; -} - -PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) -{ - void *next; - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - next = var_hash->next; - efree(var_hash); - var_hash = next; - } - - var_hash = var_hashx->first_dtor; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - zval_ptr_dtor(&var_hash->data[i]); - } - next = var_hash->next; - efree(var_hash); - var_hash = next; - } -} - -/* }}} */ - -#define YYFILL(n) do { } while (0) -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker - - -/*!re2c -uiv = [+]? [0-9]+; -iv = [+-]? [0-9]+; -nv = [+-]? ([0-9]* "." [0-9]+|[0-9]+ "." [0-9]*); -nvexp = (iv | nv) [eE] [+-]? iv; -any = [\000-\377]; -object = [OC]; -*/ - - - -static inline long parse_iv2(const unsigned char *p, const unsigned char **q) -{ - char cursor; - long result = 0; - int neg = 0; - - switch (*p) { - case '-': - neg++; - /* fall-through */ - case '+': - p++; - } - - while (1) { - cursor = (char)*p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + cursor - '0'; - } else { - break; - } - p++; - } - if (q) *q = p; - if (neg) return -result; - return result; -} - -static inline long parse_iv(const unsigned char *p) -{ - return parse_iv2(p, NULL); -} - -/* no need to check for length - re2c already did */ -static inline size_t parse_uiv(const unsigned char *p) -{ - unsigned char cursor; - size_t result = 0; - - if (*p == '+') { - p++; - } - - while (1) { - cursor = *p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - return result; -} - -#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC -#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC - -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) -{ - while (elements-- > 0) { - zval *key, *data, **old_data; - - ALLOC_INIT_ZVAL(key); - - if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - ALLOC_INIT_ZVAL(data); - - if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - zval_dtor(data); - FREE_ZVAL(data); - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); - break; - case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); - break; - } - - zval_dtor(key); - FREE_ZVAL(key); - - if (elements && *(*p-1) != ';' && *(*p-1) != '}') { - (*p)--; - return 0; - } - } - - return 1; -} - -static inline int finish_nested_data(UNSERIALIZE_PARAMETER) -{ - if (*((*p)++) == '}') - return 1; - -#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE - zval_ptr_dtor(rval); -#endif - return 0; -} - -static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long datalen; - - if(ce->unserialize == NULL) { - zend_error(E_WARNING, "Class %v has no unserializer", ce->name); - return 0; - } - - datalen = parse_iv2((*p) + 2, p); - - (*p) += 2; - - if(datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %d present", datalen, max - (*p)); - return 0; - } - - if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { - return 0; - } - - (*p) += datalen; - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long elements; - - elements = parse_iv2((*p) + 2, p); - - (*p) += 2; - - object_init_ex(*rval, ce); - return elements; -} - -static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) -{ - zval *retval_ptr = NULL; - zval fname; - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { - return 0; - } - - if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && - zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0); - call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - - return finish_nested_data(UNSERIALIZE_PASSTHRU); - -} - -PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -{ - const unsigned char *cursor, *limit, *marker, *start; - zval **rval_ref; - - limit = cursor = *p; - - if (var_hash && cursor[0] != 'R') { - var_push(var_hash, rval); - } - - start = cursor; - - - -/*!re2c - -"R:" iv ";" { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 1; - - return 1; -} - -"r:" iv ";" { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval == *rval_ref) return 0; - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 0; - - return 1; -} - -"N;" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_NULL(*rval); - return 1; -} - -"b:" [01] ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_BOOL(*rval, parse_iv(start + 2)); - return 1; -} - -"i:" iv ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_LONG(*rval, parse_iv(start + 2)); - return 1; -} - -"d:" ("NAN" | "-"? "INF") ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - - if (!strncmp(start + 2, "NAN", 3)) { - ZVAL_DOUBLE(*rval, php_get_nan()); - } else if (!strncmp(start + 2, "INF", 3)) { - ZVAL_DOUBLE(*rval, php_get_inf()); - } else if (!strncmp(start + 2, "-INF", 4)) { - ZVAL_DOUBLE(*rval, -php_get_inf()); - } - - return 1; -} - -"d:" (iv | nv | nvexp) ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); - return 1; -} - -"s:" uiv ":" ["] { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 1); - return 1; -} - -"a:" uiv ":" "{" { - long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - - if (elements < 0) { - return 0; - } - - INIT_PZVAL(*rval); - Z_TYPE_PP(rval) = IS_ARRAY; - ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); - - zend_hash_init(Z_ARRVAL_PP(rval), elements + 1, NULL, ZVAL_PTR_DTOR, 0); - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -"o:" iv ":" ["] { - - INIT_PZVAL(*rval); - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} - -object ":" uiv ":" ["] { - size_t len, len2, len3, maxlen; - long elements; - char *class_name; - zend_class_entry *ce; - zend_class_entry **pce; - int incomplete_class = 0; - - int custom_object = 0; - - zval *user_func; - zval *retval_ptr; - zval **args[1]; - zval *arg_func_name; - - if(*start == 'C') { - custom_object = 1; - } - - INIT_PZVAL(*rval); - len2 = len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len || len == 0) { - *p = start + 2; - return 0; - } - - class_name = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - if (*(YYCURSOR+1) != ':') { - *p = YYCURSOR+1; - return 0; - } - - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); - if (len3 != len) - { - *p = YYCURSOR + len3 - len; - return 0; - } - - class_name = estrndup(class_name, len); - - do { - /* Try to find class directly */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - break; - } - - /* Check for unserialize callback */ - if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { - incomplete_class = 1; - ce = PHP_IC_ENTRY; - break; - } - - /* Call unserialize callback */ - MAKE_STD_ZVAL(user_func); - ZVAL_STRING(user_func, PG(unserialize_callback_func), 1); - args[0] = &arg_func_name; - MAKE_STD_ZVAL(arg_func_name); - ZVAL_STRING(arg_func_name, class_name, 1); - if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - /* The callback function may have defined the class */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - } - - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } while (1); - - *p = YYCURSOR; - - if(custom_object) { - efree(class_name); - return object_custom(UNSERIALIZE_PASSTHRU, ce); - } - - elements = object_common1(UNSERIALIZE_PASSTHRU, ce); - - if (incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - - return object_common2(UNSERIALIZE_PASSTHRU, elements); -} - -"}" { - /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); - return 0; /* not sure if it should be 0 or 1 here? */ -} - -any { return 0; } - -*/ - - return 0; -} diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c deleted file mode 100644 index 064440799788d..0000000000000 --- a/ext/standard/versioning.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include "php.h" -#include "php_versioning.h" - -#define sign(n) ((n)<0?-1:((n)>0?1:0)) - -/* {{{ php_canonicalize_version() */ - -PHPAPI char * -php_canonicalize_version(const char *version) -{ - int len = strlen(version); - char *buf = safe_emalloc(len, 2, 1), *q, lp, lq; - const char *p; - - if (len == 0) { - *buf = '\0'; - return buf; - } - - p = version; - q = buf; - *q++ = lp = *p++; - lq = '\0'; - while (*p) { -/* s/[-_+]/./g; - * s/([^\d\.])([^\D\.])/$1.$2/g; - * s/([^\D\.])([^\d\.])/$1.$2/g; - */ -#define isdig(x) (isdigit(x)&&(x)!='.') -#define isndig(x) (!isdigit(x)&&(x)!='.') -#define isspecialver(x) ((x)=='-'||(x)=='_'||(x)=='+') - - lq = *(q - 1); - if (isspecialver(*p)) { - if (lq != '.') { - lq = *q++ = '.'; - } - } else if ((isndig(lp) && isdig(*p)) || (isdig(lp) && isndig(*p))) { - if (lq != '.') { - *q++ = '.'; - } - lq = *q++ = *p; - } else if (!isalnum(*p)) { - if (lq != '.') { - lq = *q++ = '.'; - } - } else { - lq = *q++ = *p; - } - lp = *p++; - } - *q++ = '\0'; - return buf; -} - -/* }}} */ -/* {{{ compare_special_version_forms() */ - -typedef struct { - const char *name; - int order; -} special_forms_t; - -static int -compare_special_version_forms(char *form1, char *form2) -{ - int found1 = -1, found2 = -1; - special_forms_t special_forms[10] = { - {"dev", 0}, - {"alpha", 1}, - {"a", 1}, - {"beta", 2}, - {"b", 2}, - {"RC", 3}, - {"#", 4}, - {"pl", 5}, - {"p", 5}, - {NULL, 0}, - }; - special_forms_t *pp; - - for (pp = special_forms; pp && pp->name; pp++) { - if (strncmp(form1, pp->name, strlen(pp->name)) == 0) { - found1 = pp->order; - break; - } - } - for (pp = special_forms; pp && pp->name; pp++) { - if (strncmp(form2, pp->name, strlen(pp->name)) == 0) { - found2 = pp->order; - break; - } - } - return sign(found1 - found2); -} - -/* }}} */ -/* {{{ php_version_compare() */ - -PHPAPI int -php_version_compare(const char *orig_ver1, const char *orig_ver2) -{ - char *ver1; - char *ver2; - char *p1, *p2, *n1, *n2; - long l1, l2; - int compare = 0; - - if (!*orig_ver1 || !*orig_ver2) { - if (!*orig_ver1 && !*orig_ver2) { - return 0; - } else { - return *orig_ver1 ? 1 : -1; - } - } - if (orig_ver1[0] == '#') { - ver1 = estrdup(orig_ver1); - } else { - ver1 = php_canonicalize_version(orig_ver1); - } - if (orig_ver2[0] == '#') { - ver2 = estrdup(orig_ver2); - } else { - ver2 = php_canonicalize_version(orig_ver2); - } - p1 = n1 = ver1; - p2 = n2 = ver2; - while (*p1 && *p2 && n1 && n2) { - if ((n1 = strchr(p1, '.')) != NULL) { - *n1 = '\0'; - } - if ((n2 = strchr(p2, '.')) != NULL) { - *n2 = '\0'; - } - if (isdigit(*p1) && isdigit(*p2)) { - /* compare element numerically */ - l1 = strtol(p1, NULL, 10); - l2 = strtol(p2, NULL, 10); - compare = sign(l1 - l2); - } else if (!isdigit(*p1) && !isdigit(*p2)) { - /* compare element names */ - compare = compare_special_version_forms(p1, p2); - } else { - /* mix of names and numbers */ - if (isdigit(*p1)) { - compare = compare_special_version_forms("#N#", p2); - } else { - compare = compare_special_version_forms(p1, "#N#"); - } - } - if (compare != 0) { - break; - } - if (n1 != NULL) { - p1 = n1 + 1; - } - if (n2 != NULL) { - p2 = n2 + 1; - } - } - if (compare == 0) { - if (n1 != NULL) { - if (isdigit(*p1)) { - compare = 1; - } else { - compare = php_version_compare(p1, "#N#"); - } - } else if (n2 != NULL) { - if (isdigit(*p2)) { - compare = -1; - } else { - compare = php_version_compare("#N#", p2); - } - } - } - efree(ver1); - efree(ver2); - return compare; -} - -/* }}} */ -/* {{{ do_version_compare() */ - -/* {{{ proto int version_compare(string ver1, string ver2 [, string oper]) - Compares two "PHP-standardized" version number strings */ - -PHP_FUNCTION(version_compare) -{ - char *v1, *v2, *op; - int v1_len, v2_len, op_len; - int compare, argc; - - argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2, - &v2_len, &op, &op_len) == FAILURE) { - return; - } - compare = php_version_compare(v1, v2); - if (argc == 2) { - RETURN_LONG(compare); - } - if (!strncmp(op, "<", op_len) || !strncmp(op, "lt", op_len)) { - RETURN_BOOL(compare == -1); - } - if (!strncmp(op, "<=", op_len) || !strncmp(op, "le", op_len)) { - RETURN_BOOL(compare != 1); - } - if (!strncmp(op, ">", op_len) || !strncmp(op, "gt", op_len)) { - RETURN_BOOL(compare == 1); - } - if (!strncmp(op, ">=", op_len) || !strncmp(op, "ge", op_len)) { - RETURN_BOOL(compare != -1); - } - if (!strncmp(op, "==", op_len) || !strncmp(op, "=", op_len) || !strncmp(op, "eq", op_len)) { - RETURN_BOOL(compare == 0); - } - if (!strncmp(op, "!=", op_len) || !strncmp(op, "<>", op_len) || !strncmp(op, "ne", op_len)) { - RETURN_BOOL(compare != 0); - } - RETURN_NULL(); -} - -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/sybase/CREDITS b/ext/sybase/CREDITS deleted file mode 100644 index 632dcce0ca499..0000000000000 --- a/ext/sybase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sybase-DB -Zeev Suraski diff --git a/ext/sybase/config.m4 b/ext/sybase/config.m4 deleted file mode 100644 index 882b176018dab..0000000000000 --- a/ext/sybase/config.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(sybase,for Sybase support, -[ --with-sybase[=DIR] Include Sybase-DB support. DIR is the Sybase home - directory, defaults to /home/sybase]) - -if test "$PHP_SYBASE" != "no"; then - if test "$PHP_SYBASE" = "yes"; then - SYBASE_INCDIR=/home/sybase/include - SYBASE_LIBDIR=/home/sybase/lib - else - SYBASE_INCDIR=$PHP_SYBASE/include - SYBASE_LIBDIR=$PHP_SYBASE/lib - fi - PHP_ADD_INCLUDE($SYBASE_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(sybdb, $SYBASE_LIBDIR, SYBASE_SHARED_LIBADD) - PHP_NEW_EXTENSION(sybase, php_sybase_db.c, $ext_shared) - AC_CHECK_LIB(dnet_stub, dnet_addr, - [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,SYBASE_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) - ]) - AC_DEFINE(HAVE_SYBASE,1,[ ]) - AC_CHECK_LIB(sybdb, tdsdbopen, - [ AC_DEFINE(PHP_SYBASE_DBOPEN,tdsdbopen,[ ]) - AC_DEFINE(DBMFIX,1,[ ]) ], - [ AC_DEFINE(PHP_SYBASE_DBOPEN,dbopen,[ ]) ]) - - PHP_SUBST(SYBASE_SHARED_LIBADD) -fi diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c deleted file mode 100644 index ae46a5703700a..0000000000000 --- a/ext/sybase/php_sybase_db.c +++ /dev/null @@ -1,1457 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ - | php_sybase_get_column_content_with_type() based on code by: | - | Muhammad A Muquit | - | Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_sybase_db.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_globals.h" - -#if HAVE_SYBASE - -#include -#include -#include - -#if BROKEN_SYBASE_PCONNECTS -#include "http_log.h" -#endif - -/* Moved these structures/defines into the .c file (or into a *private* header), - because leaving them in php_sybase_db.h caused namespace pollution in - main/internal_functions.c. */ - -#define coltype(j) dbcoltype(sybase_ptr->link,j) -#define intcol(i) ((int) *(DBINT *) dbdata(sybase_ptr->link,i)) -#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(sybase_ptr->link,i)) -#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(sybase_ptr->link,i)) -#define anyintcol(j) (coltype(j)==SYBINT4?intcol(j):(coltype(j)==SYBINT2?smallintcol(j):tinyintcol(j))) -#define charcol(i) ((DBCHAR *) dbdata(sybase_ptr->link,i)) -#define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybase_ptr->link,i)) - -typedef struct sybase_link_struct sybase_link; - -struct sybase_link_struct { - LOGINREC *login; - DBPROCESS *link; - int valid; -}; - -#define SYBASE_ROWS_BLOCK 128 - -typedef struct { - char *name,*column_source; - int max_length, numeric; - int type; -} sybase_field; - -typedef struct { - pval ***data; - sybase_field *fields; - sybase_link *sybase_ptr; - int cur_row,cur_field; - int num_rows,num_fields; -} sybase_result; - - -function_entry sybase_functions[] = { - PHP_FE(sybase_connect, NULL) - PHP_FE(sybase_pconnect, NULL) - PHP_FE(sybase_close, NULL) - PHP_FE(sybase_select_db, NULL) - PHP_FE(sybase_query, NULL) - PHP_FE(sybase_free_result, NULL) - PHP_FE(sybase_get_last_message, NULL) - PHP_FE(sybase_num_rows, NULL) - PHP_FE(sybase_num_fields, NULL) - PHP_FE(sybase_fetch_row, NULL) - PHP_FE(sybase_fetch_array, NULL) - PHP_FE(sybase_fetch_object, NULL) - PHP_FE(sybase_data_seek, NULL) - PHP_FE(sybase_fetch_field, NULL) - PHP_FE(sybase_field_seek, NULL) - PHP_FE(sybase_result, NULL) - PHP_FE(sybase_affected_rows, NULL) - PHP_FE(sybase_min_error_severity, NULL) - PHP_FE(sybase_min_message_severity, NULL) - -#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL) - PHP_FALIAS(mssql_connect, sybase_connect, NULL) - PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL) - PHP_FALIAS(mssql_close, sybase_close, NULL) - PHP_FALIAS(mssql_select_db, sybase_select_db, NULL) - PHP_FALIAS(mssql_query, sybase_query, NULL) - PHP_FALIAS(mssql_free_result, sybase_free_result, NULL) - PHP_FALIAS(mssql_get_last_message, sybase_get_last_message, NULL) - PHP_FALIAS(mssql_num_rows, sybase_num_rows, NULL) - PHP_FALIAS(mssql_num_fields, sybase_num_fields, NULL) - PHP_FALIAS(mssql_fetch_row, sybase_fetch_row, NULL) - PHP_FALIAS(mssql_fetch_array, sybase_fetch_array, NULL) - PHP_FALIAS(mssql_fetch_object, sybase_fetch_object, NULL) - PHP_FALIAS(mssql_data_seek, sybase_data_seek, NULL) - PHP_FALIAS(mssql_fetch_field, sybase_fetch_field, NULL) - PHP_FALIAS(mssql_field_seek, sybase_field_seek, NULL) - PHP_FALIAS(mssql_result, sybase_result, NULL) - PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL) - PHP_FALIAS(mssql_min_error_severity, sybase_min_error_severity, NULL) - PHP_FALIAS(mssql_min_message_severity, sybase_min_message_severity, NULL) -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry sybase_module_entry = { - STANDARD_MODULE_HEADER, - "sybase", sybase_functions, PHP_MINIT(sybase), PHP_MSHUTDOWN(sybase), PHP_RINIT(sybase), PHP_RSHUTDOWN(sybase), PHP_MINFO(sybase), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_SYBASE -ZEND_GET_MODULE(sybase) -#endif - -THREAD_LS sybase_module php_sybase_module; - - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } - - -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval **result_ptr, int column_type); - -/* error handler */ -static int php_sybase_error_handler(DBPROCESS *dbproc,int severity,int dberr, - int oserr,char *dberrstr,char *oserrstr) -{ - if (severity >= php_sybase_module.min_error_severity) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase error: %s (severity %d)",dberrstr,severity); - } - return INT_CANCEL; -} - -/* message handler */ -static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate, - int severity,char *msgtext,char *srvname, - char *procname,DBUSMALLINT line) -{ - if (severity >= php_sybase_module.min_message_severity) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase message: %s (severity %d)",msgtext,severity); - } - STR_FREE(php_sybase_module.server_message); - php_sybase_module.server_message = estrdup(msgtext); - return 0; -} - - -static int _clean_invalid_results(list_entry *le TSRMLS_DC) -{ - if (Z_TYPE_P(le) == php_sybase_module.le_result) { - sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; - - if (!sybase_ptr->valid) { - return 1; - } - } - return 0; -} - - -static void _free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_result *result = (sybase_result *)rsrc->ptr; - int i,j; - - if (result->data) { - for (i=0; inum_rows; i++) { - for (j=0; jnum_fields; j++) { - zval_ptr_dtor(&result->data[i][j]); - } - efree(result->data[i]); - } - efree(result->data); - } - - if (result->fields) { - for (i=0; inum_fields; i++) { - STR_FREE(result->fields[i].name); - STR_FREE(result->fields[i].column_source); - } - efree(result->fields); - } - efree(result); -} - - -static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - - sybase_ptr->valid = 0; - - /* - this can cause crashes in the current model. - if the resource gets destroyed via destroy_resource_list() resource_list - will *not* be in a consistent state. thies@thieso.net - */ - - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); - dbclose(sybase_ptr->link); - dbloginfree(sybase_ptr->login); - efree(sybase_ptr); - php_sybase_module.num_links--; -} - - -static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - - dbclose(sybase_ptr->link); - dbloginfree(sybase_ptr->login); - free(sybase_ptr); - php_sybase_module.num_persistent--; - php_sybase_module.num_links--; -} - - -PHP_MINIT_FUNCTION(sybase) -{ - char *interface_file; - - if (dbinit()==FAIL) { - return FAILURE; - } - dberrhandle((EHANDLEFUNC) php_sybase_error_handler); - dbmsghandle((MHANDLEFUNC) php_sybase_message_handler); - - if (cfg_get_string("sybase.interface_file",&interface_file)==SUCCESS) { - dbsetifile(interface_file); - } - if (cfg_get_long("sybase.allow_persistent",&php_sybase_module.allow_persistent)==FAILURE) { - php_sybase_module.allow_persistent=1; - } - if (cfg_get_long("sybase.max_persistent",&php_sybase_module.max_persistent)==FAILURE) { - php_sybase_module.max_persistent=-1; - } - if (cfg_get_long("sybase.max_links",&php_sybase_module.max_links)==FAILURE) { - php_sybase_module.max_links=-1; - } - if (cfg_get_long("sybase.min_error_severity",&php_sybase_module.cfg_min_error_severity)==FAILURE) { - php_sybase_module.cfg_min_error_severity=10; - } - if (cfg_get_long("sybase.min_message_severity",&php_sybase_module.cfg_min_message_severity)==FAILURE) { - php_sybase_module.cfg_min_message_severity=10; - } - if (cfg_get_long("sybase.compatability_mode",&php_sybase_module.compatability_mode)==FAILURE) { - php_sybase_module.compatability_mode = 0; - } - - php_sybase_module.num_persistent=0; - php_sybase_module.le_link = zend_register_list_destructors_ex(_close_sybase_link, NULL, "sybase-db link", module_number); - php_sybase_module.le_plink = zend_register_list_destructors_ex(NULL, _close_sybase_plink, "sybase-db link persistent", module_number); - php_sybase_module.le_result = zend_register_list_destructors_ex(_free_sybase_result, NULL, "sybase-db result", module_number); - - return SUCCESS; -} - - -PHP_RINIT_FUNCTION(sybase) -{ - php_sybase_module.default_link=-1; - php_sybase_module.num_links = php_sybase_module.num_persistent; - php_sybase_module.appname = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION)); - php_sybase_module.server_message = STR_EMPTY_ALLOC(); - php_sybase_module.min_error_severity = php_sybase_module.cfg_min_error_severity; - php_sybase_module.min_message_severity = php_sybase_module.cfg_min_message_severity; - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(sybase) -{ - dbexit(); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(sybase) -{ - efree(php_sybase_module.appname); - php_sybase_module.appname = NULL; - STR_FREE(php_sybase_module.server_message); - php_sybase_module.server_message = NULL; - return SUCCESS; -} - -static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) -{ - char *user=NULL,*passwd=NULL,*host=NULL,*charset=NULL,*appname=NULL; - char *hashed_details; - int hashed_details_length; - sybase_link sybase,*sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - hashed_details_length=6+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details,"sybase___"); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - hashed_details_length = Z_STRLEN_PP(yyhost)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s____", Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost, **yyuser; - - if (zend_get_parameters_ex(2, &yyhost, &yyuser) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s___",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost, **yyuser,**yypasswd; - - if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s__",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */ - } - break; - case 4: { - zval **yyhost, **yyuser, **yypasswd, **yycharset; - - if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s_%s_",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd),Z_STRVAL_PP(yycharset)); /* SAFE */ - } - break; - case 5: { - zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - - if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - convert_to_string_ex(yyappname); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname = Z_STRVAL_PP(yyappname); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+Z_STRLEN_PP(yyappname)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd),Z_STRVAL_PP(yycharset),Z_STRVAL_PP(yyappname)); /* SAFE */ - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - /* set a DBLOGIN record */ - if ((sybase.login=dblogin())==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to allocate login record"); - goto err; - } - - if (user) { - DBSETLUSER(sybase.login,user); - } - if (passwd) { - DBSETLPWD(sybase.login,passwd); - } - if (charset) { - DBSETLCHARSET(sybase.login,charset); - } - if (appname) { - DBSETLAPP(sybase.login,appname); - } else { - DBSETLAPP(sybase.login,php_sybase_module.appname); - } - - sybase.valid = 1; - - if (!php_sybase_module.allow_persistent) { - persistent=0; - } - if (persistent) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); - goto err_login; - } - if (php_sybase_module.max_persistent!=-1 && php_sybase_module.num_persistent>=php_sybase_module.max_persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open persistent links (%d)",php_sybase_module.num_persistent); - goto err_login; - } - /* create the link */ - if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ - goto err_login; - } - - if (dbsetopt(sybase.link,DBBUFFER,"2",-1)==FAIL) { - goto err_link; - } - - /* hash it up */ - sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link)); - memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); - Z_TYPE(new_le) = php_sybase_module.le_plink; - new_le.ptr = sybase_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { - free(sybase_ptr); - goto err_link; - } - php_sybase_module.num_persistent++; - php_sybase_module.num_links++; - } else { /* we do */ - if (Z_TYPE_P(le) != php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Hashed persistent link is not a Sybase link!"); - goto err_login; - } - - sybase_ptr = (sybase_link *) le->ptr; - /* test that the link hasn't died */ - if (DBDEAD(sybase_ptr->link)==TRUE) { - if ((sybase_ptr->link=PHP_SYBASE_DBOPEN(sybase_ptr->login,host))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - goto err_login; - } - if (dbsetopt(sybase_ptr->link,DBBUFFER,"2",-1)==FAIL) { - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - goto err_login; - } - } - } - Z_LVAL_P(return_value) = zend_list_insert(sybase_ptr,php_sybase_module.le_plink); - Z_TYPE_P(return_value) = IS_LONG; - } else { /* non persistent */ - list_entry *index_ptr,new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual sybase link sits. - * if it doesn't, open a new sybase link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { - int type,link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - goto err_login; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==php_sybase_module.le_link || type==php_sybase_module.le_plink)) { - Z_LVAL_P(return_value) = php_sybase_module.default_link = link; - Z_TYPE_P(return_value) = IS_LONG; - efree(hashed_details); - dbloginfree(sybase.login); - return; - } else { - zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); - } - } - if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); - goto err_login; - } - - if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==NULL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ - goto err_login; - } - - if (dbsetopt(sybase.link,DBBUFFER,"2",-1)==FAIL) { - goto err_link; - } - - /* add it to the list */ - sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link)); - memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); - Z_LVAL_P(return_value) = zend_list_insert(sybase_ptr,php_sybase_module.le_link); - Z_TYPE_P(return_value) = IS_LONG; - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { - goto err_link; - } - php_sybase_module.num_links++; - } - efree(hashed_details); - php_sybase_module.default_link=Z_LVAL_P(return_value); - return; - -err_link: - dbclose(sybase.link); -err_login: - dbloginfree(sybase.login); -err: - efree(hashed_details); - RETURN_FALSE; -} - - -static int php_sybase_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (php_sybase_module.default_link==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); - } - return php_sybase_module.default_link; -} - - -/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open Sybase server connection */ -PHP_FUNCTION(sybase_connect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} -/* }}} */ - -/* {{{ proto int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open persistent Sybase connection */ -PHP_FUNCTION(sybase_pconnect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* {{{ proto bool sybase_close([int link_id]) - Close Sybase connection */ -PHP_FUNCTION(sybase_close) -{ - zval **sybase_link_index; - int id,type; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_module.default_link; - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - zend_list_delete(id); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool sybase_select_db(string database [, int link_id]) - Select Sybase database */ -PHP_FUNCTION(sybase_select_db) -{ - zval **db, **sybase_link_index; - int id,type; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - CHECK_LINK(id); - - sybase_ptr = (sybase_link *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - convert_to_string_ex(db); - - if (dbuse(sybase_ptr->link,Z_STRVAL_PP(db))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to select database: %s",sybase_error(sybase));*/ - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - - -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval **result_ptr, int column_type) -{ - zval *result; - - ALLOC_INIT_ZVAL(result); - *result_ptr = result; - - if (dbdatlen(sybase_ptr->link,offset) == 0) { - ZVAL_FALSE(result); - return; - } - - switch (column_type) - { - case SYBINT2: - case SYBINT4: { - Z_LVAL_P(result) = (long) anyintcol(offset); - Z_TYPE_P(result) = IS_LONG; - break; - } - case SYBCHAR: - case SYBTEXT: { - int length; - char *data = charcol(offset); - - length=dbdatlen(sybase_ptr->link,offset); - while (length>0 && charcol(offset)[length-1] == ' ') { /* nuke trailing whitespace */ - length--; - } - Z_STRVAL_P(result) = estrndup(data,length); - Z_STRLEN_P(result) = length; - Z_TYPE_P(result) = IS_STRING; - break; - } - /*case SYBFLT8:*/ - case SYBREAL: { - Z_DVAL_P(result) = (double) floatcol(offset); - Z_TYPE_P(result) = IS_DOUBLE; - break; - } - default: { - if (dbwillconvert(coltype(offset),SYBCHAR)) { - char *res_buf; - int res_length = dbdatlen(sybase_ptr->link,offset); - int src_length = res_length; - register char *p; - - switch (coltype(offset)) { - case SYBBINARY: - case SYBVARBINARY: - case SYBIMAGE: - res_length *= 2; - break; - case SYBCHAR: - case SYBVARCHAR: - case SYBTEXT: - break; - default: - /* take no chances, no telling how big the result would really be */ - res_length += 20; - break; - } - - res_buf = (char *) emalloc(res_length+1); - memset(res_buf,' ',res_length+1); /* XXX i'm sure there's a better way - but i don't have sybase here to test - 991105 thies@thieso.net */ - dbconvert(NULL,coltype(offset),dbdata(sybase_ptr->link,offset), src_length,SYBCHAR,res_buf,res_length); -#if ilia_0 - /* get rid of trailing spaces */ - p = res_buf + res_length; - while (p >= res_buf && (*p == ' ' || *p == '\0')) { - p--; - } - *(++p) = 0; /* put a trailing NULL */ - res_length = p - res_buf; -#endif - Z_STRLEN_P(result) = res_length; - Z_STRVAL_P(result) = res_buf; - Z_TYPE_P(result) = IS_STRING; - } else { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: column %d has unknown data type (%d)", offset, coltype(offset)); - ZVAL_FALSE(result); - } - } - } -} - - -/* {{{ proto int sybase_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_query) -{ - zval **query, **sybase_link_index; - int id,type,retvalue; - sybase_link *sybase_ptr; - sybase_result *result; - int num_fields; - int blocks_initialized=1; - int i,j; - int *column_types; - RETCODE dbresults_retval; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_module.default_link; - break; - case 2: - if (zend_get_parameters_ex(2, &query, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - sybase_ptr = (sybase_link *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - convert_to_string_ex(query); - if (dbcmd(sybase_ptr->link,Z_STRVAL_PP(query))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to set query");*/ - RETURN_FALSE; - } - - if (dbsqlexec(sybase_ptr->link)==FAIL) { - /*php_error(E_WARNING,"Sybase: Query failed");*/ - RETURN_FALSE; - } - - dbresults_retval = dbresults(sybase_ptr->link); - if (dbresults_retval==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Query failed");*/ - RETURN_FALSE; - } - - /* The following is more or less the equivalent of mysql_store_result(). - * fetch all rows from the server into the row buffer, thus: - * 1) Being able to fire up another query without explicitly reading all rows - * 2) Having numrows accessible - */ - - retvalue=dbnextrow(sybase_ptr->link); - - if (retvalue==FAIL) { - RETURN_FALSE; - } - - num_fields = dbnumcols(sybase_ptr->link); - if (num_fields<=0) { - RETURN_TRUE; - } - - column_types = (int *) safe_emalloc(sizeof(int), num_fields, 0); - for (i=0; idata = (pval ***) safe_emalloc(sizeof(pval **), SYBASE_ROWS_BLOCK, 0); - result->sybase_ptr = sybase_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->num_fields = num_fields; - - i=0; - while (retvalue!=FAIL && retvalue!=NO_MORE_ROWS) { - result->num_rows++; - if (result->num_rows > blocks_initialized*SYBASE_ROWS_BLOCK) { - result->data = (pval ***) erealloc(result->data,sizeof(pval **)*SYBASE_ROWS_BLOCK*(++blocks_initialized)); - } - result->data[i] = (pval **) safe_emalloc(sizeof(pval *), num_fields, 0); - for (j=1; j<=num_fields; j++) { - php_sybase_get_column_content(sybase_ptr, j, &result->data[i][j-1], column_types[j-1]); - if (!php_sybase_module.compatability_mode) { - zval *cur_value = result->data[i][j-1]; - - convert_to_string(cur_value); - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(cur_value) = php_addslashes(Z_STRVAL_P(cur_value), Z_STRLEN_P(cur_value), &Z_STRLEN_P(cur_value),0 TSRMLS_CC); - } - } - } - retvalue=dbnextrow(sybase_ptr->link); - dbclrbuf(sybase_ptr->link,DBLASTROW(sybase_ptr->link)-1); - i++; - } - result->num_rows = DBCOUNT(sybase_ptr->link); - - result->fields = (sybase_field *) safe_emalloc(sizeof(sybase_field), num_fields, 0); - j=0; - for (i=0; ilink,i+1); - char computed_buf[16]; - - if (*fname) { - result->fields[i].name = estrdup(fname); - } else { - if (j>0) { - snprintf(computed_buf,16,"computed%d",j); - } else { - strcpy(computed_buf,"computed"); - } - result->fields[i].name = estrdup(computed_buf); - j++; - } - result->fields[i].max_length = dbcollen(sybase_ptr->link,i+1); - result->fields[i].column_source = estrdup(dbcolsource(sybase_ptr->link,i+1)); - if (!result->fields[i].column_source) { - result->fields[i].column_source = STR_EMPTY_ALLOC(); - } - Z_TYPE(result->fields[i]) = column_types[i]; - /* set numeric flag */ - switch (column_types[i]) { - case SYBINT2: - case SYBINT4: - case SYBFLT8: - case SYBREAL: - result->fields[i].numeric = 1; - break; - case SYBCHAR: - case SYBTEXT: - default: - result->fields[i].numeric = 0; - break; - } - } - efree(column_types); - Z_LVAL_P(return_value) = zend_list_insert(result,php_sybase_module.le_result); - Z_TYPE_P(return_value) = IS_LONG; - - /** - * mgruetzner@rw3.com -- 3-6/2003 - * - * If you do a query that calls a stored procedure which returns - * data AND calls raiserror to generated a user-defined error message, - * then after retrieving the first set of results above, the call - * to dbresults will have returned SUCCESS, instead of NO_MORE_RESULTS - * which indicates that the message generated by raiserror is still - * waiting to be read. If this is the case, then call dbresults - * again to force the reading of the message. This will ensure the - * get_last_message call will return the message properly if called - * after mssql_query, like it should. - * - * One thing to note, we are assuming that no more data should follow - * in this case--only the message will be read. To make sure, I have - * added a call to dbnextrow. The assumption is that it will return - * NO_MORE_ROWS in this case. If the assumption is false, generate - * a PHP error so we can debug this case. - * - */ - if (dbresults_retval != NO_MORE_RESULTS) { - /* Call dbresults again to read message */ - dbresults_retval = dbresults(sybase_ptr->link); - - /* Check assumption that dbnextrow returns NO_MORE_ROWS */ - retvalue = dbnextrow(sybase_ptr->link); - if (retvalue != NO_MORE_ROWS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Expected dbnextrow() to return NO_MORE_ROWS."); - } - } -} -/* }}} */ - - -/* {{{ proto bool sybase_free_result(int result) - Free result memory */ -PHP_FUNCTION(sybase_free_result) -{ - zval **sybase_result_index; - sybase_result *result; - int type; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - if (Z_LVAL_PP(sybase_result_index)==0) { - RETURN_FALSE; - } - result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); - - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Sybase result index", Z_LVAL_PP(sybase_result_index)); - RETURN_FALSE; - } - zend_list_delete(Z_LVAL_PP(sybase_result_index)); - RETURN_TRUE; -} -/* }}} */ - - - -/* {{{ proto string sybase_get_last_message(void) - Returns the last message from server (over min_message_severity) */ -PHP_FUNCTION(sybase_get_last_message) -{ - RETURN_STRING(php_sybase_module.server_message,1); -} -/* }}} */ - -/* {{{ proto int sybase_num_rows(int result) - Get number of rows in result */ -PHP_FUNCTION(sybase_num_rows) -{ - zval **result_index; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(result_index); - id = Z_LVAL_PP(result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = result->num_rows; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto int sybase_num_fields(int result) - Get number of fields in result */ -PHP_FUNCTION(sybase_num_fields) -{ - zval **result_index; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(result_index); - id = Z_LVAL_PP(result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = result->num_fields; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto array sybase_fetch_row(int result) - Get row as enumerated array */ -PHP_FUNCTION(sybase_fetch_row) -{ - zval **sybase_result_index; - int type,i,id; - sybase_result *result; - pval *field_content; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - for (i=0; inum_fields; i++) { - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); - } - result->cur_row++; -} -/* }}} */ - - -static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) -{ - zval **sybase_result_index; - sybase_result *result; - int type; - int i; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); - - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Sybase result index", Z_LVAL_PP(sybase_result_index)); - RETURN_FALSE; - } - - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i=0; inum_fields; i++) { - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); - } - result->cur_row++; -} - - -/* {{{ proto object sybase_fetch_object(int result) - Fetch row as object */ -PHP_FUNCTION(sybase_fetch_object) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init( - return_value, - ZEND_STANDARD_CLASS_DEF_PTR, - Z_ARRVAL_P(return_value) - ); - } -} -/* }}} */ - -/* {{{ proto array sybase_fetch_array(int result) - Fetch row as array */ -PHP_FUNCTION(sybase_fetch_array) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto bool sybase_data_seek(int result, int offset) - Move internal row pointer */ -PHP_FUNCTION(sybase_data_seek) -{ - zval **sybase_result_index, **offset; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(offset); - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset"); - RETURN_FALSE; - } - - result->cur_row = Z_LVAL_PP(offset); - RETURN_TRUE; -} -/* }}} */ - -static char *php_sybase_get_field_name(int type) -{ - switch (type) { - case SYBBINARY: - case SYBVARBINARY: - return "blob"; - break; - case SYBCHAR: - case SYBVARCHAR: - case SYBTEXT: - return "string"; - case SYBDATETIME: - case SYBDATETIME4: - case SYBDATETIMN: - return "datetime"; - break; - case SYBDECIMAL: - case SYBFLT8: - case SYBFLTN: - case SYBREAL: - case SYBNUMERIC: - return "real"; - break; - case SYBINT1: - case SYBINT2: - case SYBINT4: - case SYBINTN: - return "int"; - break; - case SYBMONEY: - case SYBMONEY4: - case SYBMONEYN: - return "money"; - break; - case SYBBIT: - return "bit"; - break; - case SYBIMAGE: - return "image"; - break; - default: - return "unknown"; - break; - } -} - - -/* {{{ proto object sybase_fetch_field(int result [, int offset]) - Get field information */ -PHP_FUNCTION(sybase_fetch_field) -{ - zval **sybase_result_index, **offset; - int type,id,field_offset; - sybase_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); - } - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name",result->fields[field_offset].name, 1); - add_property_long(return_value, "max_length",result->fields[field_offset].max_length); - add_property_string(return_value, "column_source",result->fields[field_offset].column_source, 1); - add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_sybase_get_field_name(Z_TYPE(result->fields[field_offset])), 1); -} -/* }}} */ - -/* {{{ proto bool sybase_field_seek(int result, int offset) - Set field offset */ -PHP_FUNCTION(sybase_field_seek) -{ - zval **sybase_result_index, **offset; - int type,id,field_offset; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - - if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); - RETURN_FALSE; - } - - result->cur_field = field_offset; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string sybase_result(int result, int row, mixed field) - Get result data */ -PHP_FUNCTION(sybase_result) -{ - zval **row, **field, **sybase_result_index; - int id,type,field_offset=0; - sybase_result *result; - - - if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(row); - if (Z_LVAL_PP(row)<0 || Z_LVAL_PP(row)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset (%ld)", Z_LVAL_PP(row)); - RETURN_FALSE; - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i; - - for (i=0; inum_fields; i++) { - if (!strcasecmp(result->fields[i].name,Z_STRVAL_PP(field))) { - field_offset = i; - break; - } - } - if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: %s field not found in result",Z_STRVAL_PP(field)); - RETURN_FALSE; - } - break; - } - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset specified"); - RETURN_FALSE; - } - break; - } - - *return_value = *result->data[Z_LVAL_PP(row)][field_offset]; - pval_copy_constructor(return_value); -} -/* }}} */ - - -/* {{{ proto int sybase_affected_rows([int link_id]) - Get number of affected rows in last query */ -PHP_FUNCTION(sybase_affected_rows) -{ - zval **sybase_link_index = NULL; - sybase_link *sybase_ptr = NULL; - int id = 0; - int type = 0; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_module.default_link; - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - sybase_ptr = (sybase_link *)zend_list_find(id, &type); - - if(type != php_sybase_module.le_link && type != php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = DBCOUNT(sybase_ptr->link); - Z_TYPE_P(return_value) = IS_LONG; -} - - -PHP_MINFO_FUNCTION(sybase) -{ - char maxp[32], maxl[32]; - - if (php_sybase_module.max_persistent==-1) { - snprintf(maxp, 31, "%ld/unlimited", php_sybase_module.num_persistent ); - } else { - snprintf(maxp, 31, "%ld/%ld", php_sybase_module.num_persistent, php_sybase_module.max_persistent); - } - maxp[31]=0; - - if (php_sybase_module.max_links==-1) { - snprintf(maxl, 31, "%ld/unlimited", php_sybase_module.num_links ); - } else { - snprintf(maxl, 31, "%ld/%ld", php_sybase_module.num_links, php_sybase_module.max_links); - } - maxl[31]=0; - - php_info_print_table_start(); - php_info_print_table_row(2, "Sybase Support", "enabled"); - php_info_print_table_row(2, "Allow Persistent Links", (php_sybase_module.allow_persistent?"Yes":"No") ); - php_info_print_table_row(2, "Persistent Links", maxp); - php_info_print_table_row(2, "Total Links", maxl); - php_info_print_table_row(2, "Application Name", php_sybase_module.appname ); - php_info_print_table_row(2, "Client API Version", dbversion() ); - php_info_print_table_end(); - -} - - -/* {{{ proto void sybase_min_error_severity(int severity) - Sets the minimum error severity */ -PHP_FUNCTION(sybase_min_error_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - php_sybase_module.min_error_severity = Z_LVAL_PP(severity); -} -/* }}} */ - -/* {{{ proto void sybase_min_message_severity(int severity) - Sets the minimum message severity */ -PHP_FUNCTION(sybase_min_message_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - php_sybase_module.min_message_severity = Z_LVAL_PP(severity); -} -/* }}} */ - -#endif diff --git a/ext/sybase/php_sybase_db.h b/ext/sybase/php_sybase_db.h deleted file mode 100644 index e34a52dfdb578..0000000000000 --- a/ext/sybase/php_sybase_db.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYBASE_DB_H -#define PHP_SYBASE_DB_H - -#if HAVE_SYBASE - -extern zend_module_entry sybase_module_entry; -#define sybase_module_ptr &sybase_module_entry - -PHP_MINIT_FUNCTION(sybase); -PHP_RINIT_FUNCTION(sybase); -PHP_MSHUTDOWN_FUNCTION(sybase); -PHP_RSHUTDOWN_FUNCTION(sybase); -PHP_MINFO_FUNCTION(sybase); -PHP_FUNCTION(sybase_connect); -PHP_FUNCTION(sybase_pconnect); -PHP_FUNCTION(sybase_close); -PHP_FUNCTION(sybase_select_db); -PHP_FUNCTION(sybase_query); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_get_last_message); -PHP_FUNCTION(sybase_num_rows); -PHP_FUNCTION(sybase_num_fields); -PHP_FUNCTION(sybase_fetch_row); -PHP_FUNCTION(sybase_fetch_array); -PHP_FUNCTION(sybase_fetch_object); -PHP_FUNCTION(sybase_data_seek); -PHP_FUNCTION(sybase_affected_rows); -PHP_FUNCTION(sybase_result); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_min_error_severity); -PHP_FUNCTION(sybase_min_message_severity); - -PHP_FUNCTION(sybase_db_query); -PHP_FUNCTION(sybase_list_fields); -PHP_FUNCTION(sybase_fetch_lengths); -PHP_FUNCTION(sybase_fetch_field); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_field_name); -PHP_FUNCTION(sybase_field_table); -PHP_FUNCTION(sybase_field_len); -PHP_FUNCTION(sybase_field_type); -PHP_FUNCTION(sybase_field_flags); - - -typedef struct { - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - char *appname; - char *server_message; - int le_link,le_plink,le_result; - long min_error_severity,min_message_severity; - long cfg_min_error_severity,cfg_min_message_severity; - long compatability_mode; -} sybase_module; - -extern sybase_module php_sybase_module; - -#else - -#define sybase_module_ptr NULL - -#endif - -#define phpext_sybase_ptr sybase_module_ptr - -#endif /* PHP_SYBASE_DB_H */ diff --git a/ext/sybase_ct/CREDITS b/ext/sybase_ct/CREDITS deleted file mode 100644 index f739a533c41f0..0000000000000 --- a/ext/sybase_ct/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sybase-CT -Zeev Suraski, Tom May, Timm Friebe diff --git a/ext/sybase_ct/config.m4 b/ext/sybase_ct/config.m4 deleted file mode 100644 index cb133e957b8bf..0000000000000 --- a/ext/sybase_ct/config.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(sybase-ct, for Sybase-CT support, -[ --with-sybase-ct[=DIR] Include Sybase-CT support. DIR is the Sybase home - directory. Defaults to /home/sybase]) - -if test "$PHP_SYBASE_CT" != "no"; then - - if test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then - AC_MSG_ERROR([You can not use both --with-sybase and --with-sybase-ct in same build!]) - fi - - AC_DEFINE(HAVE_SYBASE_CT,1,[ ]) - PHP_NEW_EXTENSION(sybase_ct, php_sybase_ct.c, $ext_shared) - PHP_SUBST(SYBASE_CT_SHARED_LIBADD) - - if test "$PHP_SYBASE_CT" = "yes"; then - SYBASE_CT_INCDIR=/home/sybase/include - SYBASE_CT_LIBDIR=/home/sybase/lib - else - SYBASE_CT_INCDIR=$PHP_SYBASE_CT/include - SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib - fi - - if test -f $SYBASE_CT_INCDIR/ctpublic.h; then - PHP_ADD_INCLUDE($SYBASE_CT_INCDIR) - else - AC_MSG_ERROR([ctpublic.h missing!]) - fi - - PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) - if test -f $SYBASE_CT_INCDIR/tds.h; then - PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) - SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct" - else - PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(comn,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(intl,, SYBASE_CT_SHARED_LIBADD) - - SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl" - - PHP_CHECK_LIBRARY(tcl, netg_errstr, [ - PHP_ADD_LIBRARY(tcl,,SYBASE_CT_SHARED_LIBADD) - ],[ - PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) - ],[ - $SYBASE_CT_LIBS - ]) - - PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - fi -fi diff --git a/ext/sybase_ct/config.w32 b/ext/sybase_ct/config.w32 deleted file mode 100644 index bf56bd1402989..0000000000000 --- a/ext/sybase_ct/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ - -// $Id$ -// vim:ft=javascript - -ARG_WITH("sybase-ct", "SYBASE_CT support", "no"); - -if (PHP_SYBASE_CT != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("ctpublic.h", "CFLAGS_SYBASE_CT", PHP_PHP_BUILD + "\\sybase\\include;" + PHP_SYBASE_CT) && - CHECK_LIB("libcs.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT) && - CHECK_LIB("libct.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT)) { - EXTENSION('sybase_ct', 'php_sybase_ct.c'); - AC_DEFINE('HAVE_SYBASE_CT', 1); - } else { - WARNING("sybase_ct not enabled; libraries and headers not found"); - } -} - diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c deleted file mode 100644 index e524db7160bd3..0000000000000 --- a/ext/sybase_ct/php_sybase_ct.c +++ /dev/null @@ -1,2252 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - | Tom May | - | Timm Friebe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_sybase_ct.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_globals.h" -#include "php_ini.h" - -/* True globals, no need for thread safety */ -static int le_link, le_plink, le_result; - -#if HAVE_SYBASE_CT - -function_entry sybase_functions[] = { - PHP_FE(sybase_connect, NULL) - PHP_FE(sybase_pconnect, NULL) - PHP_FE(sybase_close, NULL) - PHP_FE(sybase_select_db, NULL) - PHP_FE(sybase_query, NULL) - PHP_FE(sybase_unbuffered_query, NULL) - PHP_FE(sybase_free_result, NULL) - PHP_FE(sybase_get_last_message, NULL) - PHP_FE(sybase_num_rows, NULL) - PHP_FE(sybase_num_fields, NULL) - PHP_FE(sybase_fetch_row, NULL) - PHP_FE(sybase_fetch_array, NULL) - PHP_FE(sybase_fetch_assoc, NULL) - PHP_FE(sybase_fetch_object, NULL) - PHP_FE(sybase_data_seek, NULL) - PHP_FE(sybase_fetch_field, NULL) - PHP_FE(sybase_field_seek, NULL) - PHP_FE(sybase_result, NULL) - PHP_FE(sybase_affected_rows, NULL) - PHP_FE(sybase_min_client_severity, NULL) - PHP_FE(sybase_min_server_severity, NULL) - PHP_FE(sybase_set_message_handler, NULL) - PHP_FE(sybase_deadlock_retry_count, NULL) - -#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL) - PHP_FALIAS(mssql_connect, sybase_connect, NULL) - PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL) - PHP_FALIAS(mssql_close, sybase_close, NULL) - PHP_FALIAS(mssql_select_db, sybase_select_db, NULL) - PHP_FALIAS(mssql_query, sybase_query, NULL) - PHP_FALIAS(mssql_unbuffered_query, sybase_unbuffered_query, NULL) - PHP_FALIAS(mssql_free_result, sybase_free_result, NULL) - PHP_FALIAS(mssql_get_last_message, sybase_get_last_message, NULL) - PHP_FALIAS(mssql_num_rows, sybase_num_rows, NULL) - PHP_FALIAS(mssql_num_fields, sybase_num_fields, NULL) - PHP_FALIAS(mssql_fetch_row, sybase_fetch_row, NULL) - PHP_FALIAS(mssql_fetch_array, sybase_fetch_array, NULL) - PHP_FALIAS(mssql_fetch_assoc, sybase_fetch_assoc, NULL) - PHP_FALIAS(mssql_fetch_object, sybase_fetch_object, NULL) - PHP_FALIAS(mssql_data_seek, sybase_data_seek, NULL) - PHP_FALIAS(mssql_fetch_field, sybase_fetch_field, NULL) - PHP_FALIAS(mssql_field_seek, sybase_field_seek, NULL) - PHP_FALIAS(mssql_result, sybase_result, NULL) - PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL) - PHP_FALIAS(mssql_min_client_severity, sybase_min_client_severity, NULL) - PHP_FALIAS(mssql_min_server_severity, sybase_min_server_severity, NULL) - PHP_FALIAS(mssql_set_message_handler, sybase_set_message_handler, NULL) - PHP_FALIAS(mssql_deadlock_retry_count, sybase_deadlock_retry_count, NULL) -#endif - - {NULL, NULL, NULL} -}; - -zend_module_entry sybase_module_entry = { - STANDARD_MODULE_HEADER, - "sybase_ct", sybase_functions, PHP_MINIT(sybase), PHP_MSHUTDOWN(sybase), PHP_RINIT(sybase), PHP_RSHUTDOWN(sybase), PHP_MINFO(sybase), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -ZEND_DECLARE_MODULE_GLOBALS(sybase) -/* static CS_CONTEXT *context; */ - -#ifdef COMPILE_DL_SYBASE_CT -ZEND_GET_MODULE(sybase) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(sybase) - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } - - -static int _clean_invalid_results(list_entry *le TSRMLS_DC) -{ - if (Z_TYPE_P(le) == le_result) { - sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; - - if (!sybase_ptr->valid) { - return 1; - } - } - return 0; -} - -static void _free_sybase_result(sybase_result *result) -{ - int i, j; - - if (result->data) { - for (i = 0; i < (result->store ? result->num_rows : MIN(1, result->num_rows)); i++) { - for (j=0; jnum_fields; j++) { - zval_dtor(&result->data[i][j]); - } - efree(result->data[i]); - } - efree(result->data); - } - - if (result->fields) { - for (i=0; inum_fields; i++) { - STR_FREE(result->fields[i].name); - STR_FREE(result->fields[i].column_source); - } - efree(result->fields); - } - - efree(result); -} - -/* Forward declaration */ -static int php_sybase_finish_results (sybase_result *result); - -static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_result *result = (sybase_result *)rsrc->ptr; - - /* Check to see if we've read all rows */ - if (result->sybase_ptr && result->sybase_ptr->active_result_index) { - if (result->sybase_ptr->cmd) { - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - } - php_sybase_finish_results(result); - } - - _free_sybase_result(result); -} - -static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - CS_INT con_status; - - sybase_ptr->valid = 0; - if (sybase_ptr->callback_name != NULL) { - zval_ptr_dtor(&sybase_ptr->callback_name); - sybase_ptr->callback_name= NULL; - } - - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); - - /* Non-persistent connections will always be connected or we wouldn't - * get here, but since we want to check the death status anyway - * we might as well double-check the connect status. - */ - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close"); - /* Assume the worst. */ - con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD; - } - if (con_status & CS_CONSTAT_CONNECTED) { - if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - } - - ct_cmd_drop(sybase_ptr->cmd); - ct_con_drop(sybase_ptr->connection); - efree(sybase_ptr); - SybCtG(num_links)--; -} - - -static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - CS_INT con_status; - - /* Persistent connections may have been closed before a failed - * reopen attempt. - */ - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close"); - /* Assume the worst. */ - con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD; - } - if (con_status & CS_CONSTAT_CONNECTED) { - if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - } - - ct_con_drop(sybase_ptr->connection); - free(sybase_ptr); - SybCtG(num_persistent)--; - SybCtG(num_links)--; -} - - -static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_CLIENTMSG *errmsg) -{ - TSRMLS_FETCH(); - - if (CS_SEVERITY(errmsg->msgnumber) >= SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Client message: %s (severity %d)", errmsg->msgstring, CS_SEVERITY(errmsg->msgnumber)); - } - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = estrdup(errmsg->msgstring); - - - /* If this is a timeout message, return CS_FAIL to cancel the - * operation and mark the connection as dead. - */ - if (CS_SEVERITY(errmsg->msgnumber) == CS_SV_RETRY_FAIL && - CS_NUMBER(errmsg->msgnumber) == 63 && - CS_ORIGIN(errmsg->msgnumber) == 2 && - CS_LAYER(errmsg->msgnumber) == 1) - { - return CS_FAIL; - } - - return CS_SUCCEED; -} - -static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC) -{ - int handled = 0; - - if (callback_name) { - zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; - zval **args[5]; - - MAKE_STD_ZVAL(msgnumber); - ZVAL_LONG(msgnumber, srvmsg->msgnumber); - args[0] = &msgnumber; - - MAKE_STD_ZVAL(severity); - ZVAL_LONG(severity, srvmsg->severity); - args[1] = &severity; - - MAKE_STD_ZVAL(state); - ZVAL_LONG(state, srvmsg->state); - args[2] = &state; - - MAKE_STD_ZVAL(line); - ZVAL_LONG(line, srvmsg->line); - args[3] = &line; - - MAKE_STD_ZVAL(text); - ZVAL_STRING(text, srvmsg->text, 1); - args[4] = &text; - - if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL_P(callback_name)); - } - - if (retval) { - handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); - zval_ptr_dtor(&retval); - } - - zval_ptr_dtor(&msgnumber); - zval_ptr_dtor(&severity); - zval_ptr_dtor(&state); - zval_ptr_dtor(&line); - zval_ptr_dtor(&text); - } - - return handled; -} - -static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_SERVERMSG *srvmsg) -{ - sybase_link *sybase; - int handled = 0; - TSRMLS_FETCH(); - - /* Remember the last server message in any case */ - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = estrdup(srvmsg->text); - - /* Retrieve sybase link */ - if (ct_con_props(connection, CS_GET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL) != CS_SUCCEED) { - sybase = NULL; - } - - /* If this is a deadlock message, set the connection's deadlock flag - * so we will retry the request. Sorry about the bare constant here, - * but it's not defined anywhere and it's a "well-known" number. - */ - if (sybase && (srvmsg->msgnumber == 1205)) { - sybase->deadlock = 1; - } - - /* Check mininum server severity level */ - if (srvmsg->severity < SybCtG(min_server_severity)) { - return CS_SUCCEED; - } - - /* Call global message handler */ - handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg TSRMLS_CC); - - /* Call link specific message handler */ - if (sybase) { - handled = handled | _call_message_handler(sybase->callback_name, srvmsg TSRMLS_CC); - } - - /* Spit out a warning if neither of them has handled this message */ - if (!handled) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Server message: %s (severity %d, procedure %s)", - srvmsg->text, srvmsg->severity, ((srvmsg->proclen>0) ? srvmsg->proc : "N/A")); - } - - return CS_SUCCEED; -} - - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("sybct.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY_EX("sybct.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_sybase_globals, sybase_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("sybct.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_sybase_globals, sybase_globals, display_link_numbers) - STD_PHP_INI_ENTRY("sybct.min_server_severity", "10", PHP_INI_ALL, OnUpdateLong, min_server_severity, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.min_client_severity", "10", PHP_INI_ALL, OnUpdateLong, min_client_severity, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.login_timeout", "-1", PHP_INI_ALL, OnUpdateLong, login_timeout, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.hostname", NULL, PHP_INI_ALL, OnUpdateString, hostname, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY_EX("sybct.deadlock_retry_count", "0", PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers) -PHP_INI_END() - - -static void php_sybase_init_globals(zend_sybase_globals *sybase_globals) -{ - long opt; - TSRMLS_FETCH(); - - if (cs_ctx_alloc(CTLIB_VERSION, &sybase_globals->context)!=CS_SUCCEED || ct_init(sybase_globals->context, CTLIB_VERSION)!=CS_SUCCEED) { - return; - } - - /* Initialize message handlers */ - if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)_server_message_handler)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set server message handler"); - } - - if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set client message handler"); - } - - /* Set datetime conversion format to "Nov 3 1998 8:06PM". - * This is the default format for the ct-lib that comes with - * Sybase ASE 11.5.1 for Solaris, but the Linux libraries that - * come with 11.0.3.3 default to "03/11/98" which is singularly - * useless. This levels the playing field for all platforms. - */ - { - CS_INT dt_convfmt = CS_DATES_SHORT; - if (cs_dt_info(sybase_globals->context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set datetime conversion format"); - } - } - - /* Set the timeout, which is per context and can't be set with - * ct_con_props(), so set it globally from the config value if - * requested. The default is CS_NO_LIMIT. - * - * Note that despite some noise in the documentation about using - * signals to implement timeouts, they are actually implemented - * by using poll() or select() on Solaris and Linux. - */ - if (cfg_get_long("sybct.timeout", &opt)==SUCCESS) { - CS_INT cs_timeout = opt; - if (ct_config(sybase_globals->context, CS_SET, CS_TIMEOUT, &cs_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the timeout"); - } - } - - sybase_globals->num_persistent=0; - sybase_globals->callback_name = NULL; -} - - -static void php_sybase_destroy_globals(zend_sybase_globals *sybase_globals) -{ - ct_exit(sybase_globals->context, CS_UNUSED); - cs_ctx_drop(sybase_globals->context); -} - -PHP_MINIT_FUNCTION(sybase) -{ - ZEND_INIT_MODULE_GLOBALS(sybase, php_sybase_init_globals, php_sybase_destroy_globals); - - REGISTER_INI_ENTRIES(); - - le_link = zend_register_list_destructors_ex(_close_sybase_link, NULL, "sybase-ct link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_sybase_plink, "sybase-ct link persistent", module_number); - le_result = zend_register_list_destructors_ex(php_free_sybase_result, NULL, "sybase-ct result", module_number); - - return SUCCESS; -} - - - -PHP_RINIT_FUNCTION(sybase) -{ - SybCtG(default_link)=-1; - SybCtG(num_links) = SybCtG(num_persistent); - SybCtG(appname) = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION)); - SybCtG(server_message) = STR_EMPTY_ALLOC(); - return SUCCESS; -} - - - -PHP_MSHUTDOWN_FUNCTION(sybase) -{ - UNREGISTER_INI_ENTRIES(); -#if 0 - ct_exit(context, CS_UNUSED); - cs_ctx_drop(context); -#endif - return SUCCESS; -} - - -PHP_RSHUTDOWN_FUNCTION(sybase) -{ - efree(SybCtG(appname)); - SybCtG(appname) = NULL; - if (SybCtG(callback_name)) { - zval_ptr_dtor(&SybCtG(callback_name)); - SybCtG(callback_name)= NULL; - } - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = NULL; - return SUCCESS; -} - - -static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname) -{ - CS_LOCALE *tmp_locale; - TSRMLS_FETCH(); - long packetsize; - - /* set a CS_CONNECTION record */ - if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate connection record"); - return 0; - } - - /* Note - this saves a copy of sybase, not a pointer to it. */ - if (ct_con_props(sybase->connection, CS_SET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set userdata"); - ct_con_drop(sybase->connection); - return 0; - } - - if (user) { - ct_con_props(sybase->connection, CS_SET, CS_USERNAME, user, CS_NULLTERM, NULL); - } - if (passwd) { - ct_con_props(sybase->connection, CS_SET, CS_PASSWORD, passwd, CS_NULLTERM, NULL); - } - if (appname) { - ct_con_props(sybase->connection, CS_SET, CS_APPNAME, appname, CS_NULLTERM, NULL); - } else { - ct_con_props(sybase->connection, CS_SET, CS_APPNAME, SybCtG(appname), CS_NULLTERM, NULL); - } - - if (SybCtG(hostname)) { - ct_con_props(sybase->connection, CS_SET, CS_HOSTNAME, SybCtG(hostname), CS_NULLTERM, NULL); - } - - if (charset) { - if (cs_loc_alloc(SybCtG(context), &tmp_locale)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate locale information."); - } else { - if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_LC_ALL, NULL, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to load default locale data."); - } else { - if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update character set."); - } else { - if (ct_con_props(sybase->connection, CS_SET, CS_LOC_PROP, tmp_locale, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection properties."); - } - } - } - } - } - - if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) { - if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize."); - } - } - - /* Set the login timeout. Actually, the login timeout is per context - * and not per connection, but we will update the context here to - * allow for code such as the following: - * - * ini_set('sybct.login_timeout', $timeout); - * sybase_connect(...) - * - * Note that preceding calls to sybase_connect() will now use the - * updated value and not the default one! - * - * The default value for CS_LOGIN_TIMEOUT is 60 (1 minute). - */ - if (SybCtG(login_timeout) != -1) { - CS_INT cs_login_timeout = SybCtG(login_timeout); - if (ct_config(SybCtG(context), CS_SET, CS_LOGIN_TIMEOUT, &cs_login_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the login timeout"); - } - } - - sybase->valid = 1; - sybase->dead = 0; - sybase->active_result_index = 0; - sybase->callback_name = NULL; - - /* create the link */ - if (ct_connect(sybase->connection, host, CS_NULLTERM)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to connect"); - ct_con_drop(sybase->connection); - return 0; - } - - if (ct_cmd_alloc(sybase->connection, &sybase->cmd)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate command record"); - ct_close(sybase->connection, CS_UNUSED); - ct_con_drop(sybase->connection); - return 0; - } - - return 1; -} - - -static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *user, *passwd, *host, *charset, *appname; - char *hashed_details; - int hashed_details_length; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - host=user=passwd=charset=appname=NULL; - hashed_details_length=6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details, "sybase_____"); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - user=passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s____", Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost, **yyuser; - - if (zend_get_parameters_ex(2, &yyhost, &yyuser) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s___", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost, **yyuser, **yypasswd; - - if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s__", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); - } - break; - case 4: { - zval **yyhost, **yyuser, **yypasswd, **yycharset; - - if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s_%s_", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); - } - break; - case 5: { - zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - - if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - convert_to_string_ex(yyappname); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname = Z_STRVAL_PP(yyappname); - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+Z_STRLEN_PP(yyappname)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s_%s_%s", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (!SybCtG(allow_persistent)) { - persistent=0; - } - if (persistent) { - list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; - - if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - if (SybCtG(max_persistent)!=-1 && SybCtG(num_persistent)>=SybCtG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent)); - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) { - free(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - - /* hash it up */ - Z_TYPE(new_le) = le_plink; - new_le.ptr = sybase_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { - ct_close(sybase_ptr->connection, CS_UNUSED); - ct_con_drop(sybase_ptr->connection); - free(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - SybCtG(num_persistent)++; - SybCtG(num_links)++; - } else { /* we do */ - CS_INT con_status; - - if (Z_TYPE_P(le) != le_plink) { - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) le->ptr; - - /* If the link has died, close it and overwrite it with a new one. */ - - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status"); - efree(hashed_details); - RETURN_FALSE; - } - if (!(con_status & CS_CONSTAT_CONNECTED) || (con_status & CS_CONSTAT_DEAD) || sybase_ptr->dead) { - sybase_link sybase; - - if (con_status & CS_CONSTAT_CONNECTED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - /* Create a new connection, then replace the old - * connection. If we fail to create a new connection, - * put the old one back so there will be a connection, - * even if it is a non-functional one. This is because - * code may still be holding an id for this connection - * so we can't free the CS_CONNECTION. - * (This is actually totally hokey, it would be better - * to just ct_con_drop() the connection and set - * sybase_ptr->connection to NULL, then test it for - * NULL before trying to use it elsewhere . . .) - */ - memcpy(&sybase, sybase_ptr, sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) { - memcpy(sybase_ptr, &sybase, sizeof(sybase_link)); - efree(hashed_details); - RETURN_FALSE; - } - ct_con_drop(sybase.connection); /* drop old connection */ - } - } - ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_plink); - } else { /* non persistent */ - list_entry *index_ptr, new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual sybase link sits. - * if it doesn't, open a new sybase link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { - int type, link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - efree(hashed_details); - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = SybCtG(default_link) = link; - Z_TYPE_P(return_value) = IS_RESOURCE; - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); - } - } - if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) { - efree(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { - ct_close(sybase_ptr->connection, CS_UNUSED); - ct_con_drop(sybase_ptr->connection); - efree(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - SybCtG(num_links)++; - } - efree(hashed_details); - SybCtG(default_link)=Z_LVAL_P(return_value); - zend_list_addref(SybCtG(default_link)); -} - - -static int php_sybase_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (SybCtG(default_link)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return SybCtG(default_link); -} - - -/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open Sybase server connection */ -PHP_FUNCTION(sybase_connect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} - -/* }}} */ - -/* {{{ proto int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open persistent Sybase connection */ -PHP_FUNCTION(sybase_pconnect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* }}} */ - - -/* {{{ proto bool sybase_close([int link_id]) - Close Sybase connection */ -PHP_FUNCTION(sybase_close) -{ - zval **sybase_link_index = 0; - int id; - sybase_link *sybase_ptr; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = SybCtG(default_link); - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - if (id == -1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(sybase_link_index)); - } - - if (id != -1 || (sybase_link_index && Z_RESVAL_PP(sybase_link_index)==SybCtG(default_link))) { - zend_list_delete(SybCtG(default_link)); - SybCtG(default_link) = -1; - } - - RETURN_TRUE; -} - -/* }}} */ - - -static int exec_cmd(sybase_link *sybase_ptr, char *cmdbuf) -{ - CS_RETCODE retcode; - CS_INT restype; - int failure=0; - - /* Fail if we already marked this connection dead. */ - - if (sybase_ptr->dead) { - return FAILURE; - } - - /* - ** Get a command handle, store the command string in it, and - ** send it to the server. - */ - - if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, cmdbuf, CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { - sybase_ptr->dead = 1; - return FAILURE; - } - if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { - sybase_ptr->dead = 1; - return FAILURE; - } - - while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - failure=1; - break; - - case CS_STATUS_RESULT: - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - failure=1; - break; - } - if (failure) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - return FAILURE; - } - } - - switch (retcode) { - case CS_END_RESULTS: - return SUCCESS; - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - sybase_ptr->dead = 1; - return FAILURE; - - default: - return FAILURE; - } -} - - -/* {{{ proto bool sybase_select_db(string database [, int link_id]) - Select Sybase database */ -PHP_FUNCTION(sybase_select_db) -{ - zval **db, **sybase_link_index; - int id; - char *cmdbuf; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - convert_to_string_ex(db); - cmdbuf = (char *) emalloc(sizeof("use ")+Z_STRLEN_PP(db)+1); - sprintf(cmdbuf, "use %s", Z_STRVAL_PP(db)); /* SAFE */ - - if (exec_cmd(sybase_ptr, cmdbuf)==FAILURE) { - efree(cmdbuf); - RETURN_FALSE; - } else { - efree(cmdbuf); - RETURN_TRUE; - } -} - -/* }}} */ - -static int php_sybase_finish_results (sybase_result *result) -{ - int i, fail; - CS_RETCODE retcode; - CS_INT restype; - TSRMLS_FETCH(); - - efree(result->datafmt); - efree(result->lengths); - efree(result->indicators); - efree(result->numerics); - efree(result->types); - for (i=0; inum_fields; i++) { - efree(result->tmp_buffer[i]); - } - efree(result->tmp_buffer); - - /* Indicate we have read all rows */ - result->sybase_ptr->active_result_index= 0; - - /* The only restype we should get now is CS_CMD_DONE, possibly - * followed by a CS_STATUS_RESULT/CS_CMD_SUCCEED/CS_CMD_DONE - * sequence if the command was a stored procedure call. But we - * still need to read and discard unexpected results. We might - * want to return a failure in this case because the application - * won't be getting all the results it asked for. - */ - fail = 0; - while ((retcode = ct_results(result->sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, cancelling rest"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - fail = 1; - break; - - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - /* Unexpected results, cancel them. */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling current"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - case CS_STATUS_RESULT: - /* Status result from a stored procedure, cancel it but do not tell user */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling all"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - break; - } - - if (fail) { - break; - } - } - - switch (retcode) { - case CS_END_RESULTS: - /* Normal. */ - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - result->sybase_ptr->dead = 1; - - case CS_CANCELED: - default: - _free_sybase_result(result); - result = NULL; - retcode = CS_FAIL; - break; - } - - return retcode; -} - -#define RETURN_DOUBLE_VAL(result, buf, length) \ - if ((length - 1) <= EG(precision)) { \ - errno = 0; \ - Z_DVAL(result) = strtod(buf, NULL); \ - if (errno != ERANGE) { \ - Z_TYPE(result) = IS_DOUBLE; \ - } else { \ - ZVAL_STRINGL(&result, buf, length- 1, 1); \ - } \ - } else { \ - ZVAL_STRINGL(&result, buf, length- 1, 1); \ - } - -static int php_sybase_fetch_result_row (sybase_result *result, int numrows) -{ - int i, j; - CS_INT retcode; - TSRMLS_FETCH(); - - /* We've already fetched everything */ - if (result->last_retcode == CS_END_DATA || result->last_retcode == CS_END_RESULTS) { - return result->last_retcode; - } - - if (numrows!=-1) numrows+= result->num_rows; - while ((retcode=ct_fetch(result->sybase_ptr->cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED - || retcode==CS_ROW_FAIL) { - /* - if (retcode==CS_ROW_FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Error reading row %d", result->num_rows); - } - */ - - result->num_rows++; - i= result->store ? result->num_rows- 1 : 0; - if (i >= result->blocks_initialized*SYBASE_ROWS_BLOCK) { - result->data = (zval **) erealloc(result->data, sizeof(zval *)*SYBASE_ROWS_BLOCK*(++result->blocks_initialized)); - } - if (result->store || 1 == result->num_rows) { - result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0); - } - - for (j = 0; j < result->num_fields; j++) { - - /* If we are in non-storing mode, free the previous result */ - if (!result->store && result->num_rows > 1 && Z_TYPE(result->data[i][j]) == IS_STRING) { - efree(Z_STRVAL(result->data[i][j])); - } - - if (result->indicators[j] == -1) { /* null value */ - ZVAL_NULL(&result->data[i][j]); - } else { - switch (result->numerics[j]) { - case 1: { - /* This indicates a long */ - ZVAL_LONG(&result->data[i][j], strtol(result->tmp_buffer[j], NULL, 10)); - break; - } - - case 2: { - /* This indicates a float */ - RETURN_DOUBLE_VAL(result->data[i][j], result->tmp_buffer[j], result->lengths[j]); - break; - } - - case 3: { - /* This indicates either a long or a float, which ever fits */ - errno = 0; - Z_LVAL(result->data[i][j]) = strtol(result->tmp_buffer[j], NULL, 10); - if (errno == ERANGE) { - - /* An overflow occurred, so try to fit it into a double */ - RETURN_DOUBLE_VAL(result->data[i][j], result->tmp_buffer[j], result->lengths[j]); - break; - } - Z_TYPE(result->data[i][j]) = IS_LONG; - break; - } - - default: { - /* This indicates anything else, return it as string */ - ZVAL_STRINGL(&result->data[i][j], result->tmp_buffer[j], result->lengths[j]- 1, 1); - break; - } - } - } - } - if (numrows!=-1 && result->num_rows>=numrows) break; - } - - result->last_retcode= retcode; - switch (retcode) { - case CS_END_DATA: - retcode = php_sybase_finish_results(result); - break; - - case CS_ROW_FAIL: - case CS_SUCCEED: - break; - - default: - _free_sybase_result(result); - result = NULL; - retcode = CS_FAIL; /* Just to be sure */ - break; - } - - return retcode; -} - -static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int buffered, int store) -{ - int num_fields; - sybase_result *result; - int i, j; - CS_INT retcode; - - /* The following (if unbuffered) is more or less the equivalent of mysql_store_result(). - * fetch all rows from the server into the row buffer, thus: - * 1) Being able to fire up another query without explicitly reading all rows - * 2) Having numrows accessible - */ - if (ct_res_info(sybase_ptr->cmd, CS_NUMDATA, &num_fields, CS_UNUSED, NULL)!=CS_SUCCEED) { - return NULL; - } - - result = (sybase_result *) emalloc(sizeof(sybase_result)); - result->data = (zval **) safe_emalloc(sizeof(zval *), SYBASE_ROWS_BLOCK, 0); - result->fields = NULL; - result->sybase_ptr = sybase_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->num_fields = num_fields; - result->last_retcode = 0; - result->store= store; - result->blocks_initialized= 1; - result->tmp_buffer = (char **) safe_emalloc(sizeof(char *), num_fields, 0); - result->lengths = (CS_INT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - result->indicators = (CS_SMALLINT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - result->datafmt = (CS_DATAFMT *) safe_emalloc(sizeof(CS_DATAFMT), num_fields, 0); - result->numerics = (unsigned char *) safe_emalloc(sizeof(unsigned char), num_fields, 0); - result->types = (CS_INT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - - for (i=0; icmd, i+1, &result->datafmt[i]); - result->types[i] = result->datafmt[i].datatype; - switch (result->datafmt[i].datatype) { - case CS_CHAR_TYPE: - case CS_VARCHAR_TYPE: - case CS_TEXT_TYPE: - case CS_IMAGE_TYPE: - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - case CS_BINARY_TYPE: - case CS_VARBINARY_TYPE: - result->datafmt[i].maxlength *= 2; - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - case CS_BIT_TYPE: - case CS_TINYINT_TYPE: - result->datafmt[i].maxlength = 4; - result->numerics[i] = 1; - break; - case CS_SMALLINT_TYPE: - result->datafmt[i].maxlength = 7; - result->numerics[i] = 1; - break; - case CS_INT_TYPE: - result->datafmt[i].maxlength = 12; - result->numerics[i] = 1; - break; - case CS_REAL_TYPE: - case CS_FLOAT_TYPE: - result->datafmt[i].maxlength = 24; - result->numerics[i] = 2; - break; - case CS_MONEY_TYPE: - case CS_MONEY4_TYPE: - result->datafmt[i].maxlength = 24; - result->numerics[i] = 2; - break; - case CS_DATETIME_TYPE: - case CS_DATETIME4_TYPE: - result->datafmt[i].maxlength = 30; - result->numerics[i] = 0; - break; - case CS_NUMERIC_TYPE: - case CS_DECIMAL_TYPE: - result->datafmt[i].maxlength = result->datafmt[i].precision + 3; - /* numeric(10) vs numeric(10, 1) */ - result->numerics[i] = (result->datafmt[i].scale == 0) ? 3 : 2; - break; - default: - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - } - result->tmp_buffer[i] = (char *)emalloc(result->datafmt[i].maxlength); - result->datafmt[i].datatype = CS_CHAR_TYPE; - result->datafmt[i].format = CS_FMT_NULLTERM; - ct_bind(sybase_ptr->cmd, i+1, &result->datafmt[i], result->tmp_buffer[i], &result->lengths[i], &result->indicators[i]); - } - - result->fields = (sybase_field *) safe_emalloc(sizeof(sybase_field), num_fields, 0); - j=0; - for (i=0; idatafmt[i].namelen>0) { - result->fields[i].name = estrndup(result->datafmt[i].name, result->datafmt[i].namelen); - } else { - if (j>0) { - snprintf(computed_buf, 16, "computed%d", j); - } else { - strcpy(computed_buf, "computed"); - } - result->fields[i].name = estrdup(computed_buf); - j++; - } - result->fields[i].column_source = STR_EMPTY_ALLOC(); - result->fields[i].max_length = result->datafmt[i].maxlength-1; - result->fields[i].numeric = result->numerics[i]; - Z_TYPE(result->fields[i]) = result->types[i]; - } - - if (buffered) { - retcode = CS_SUCCEED; - } else { - if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) { - return NULL; - } - } - - result->last_retcode = retcode; - return result; -} - -static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered) -{ - zval **query, **sybase_link_index=NULL; - zval **store_mode= NULL; - int id, deadlock_count, store; - sybase_link *sybase_ptr; - sybase_result *result; - CS_INT restype; - CS_RETCODE retcode; - enum { - Q_RESULT, /* Success with results. */ - Q_SUCCESS, /* Success but no results. */ - Q_FAILURE, /* Failure, no results. */ - } status; - - store= 1; - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = SybCtG(default_link); - break; - case 2: - if (zend_get_parameters_ex(2, &query, &sybase_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &query, &sybase_link_index, &store_mode)==FAILURE) { - RETURN_FALSE; - } - if (!buffered) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "cannot use non-storing mode with buffered queries"); - store = 1; - } else { - convert_to_long_ex(store_mode); - store= (Z_LVAL_PP(store_mode) != 0); - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - convert_to_string_ex(query); - - /* Fail if we already marked this connection dead. */ - if (sybase_ptr->dead) { - RETURN_FALSE; - } - - /* Check to see if a previous sybase_unbuffered_query has read all rows */ - if (sybase_ptr->active_result_index) { - zval *tmp = NULL; - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "called without first fetching all rows from a previous unbuffered query"); - if (sybase_ptr->cmd) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - } - - /* Get the resultset and free it */ - ALLOC_ZVAL(tmp); - Z_LVAL_P(tmp)= sybase_ptr->active_result_index; - Z_TYPE_P(tmp)= IS_RESOURCE; - INIT_PZVAL(tmp); - ZEND_FETCH_RESOURCE(result, sybase_result *, &tmp, -1, "Sybase result", le_result); - - /* Causes the following segfault: - Program received signal SIGSEGV, Segmentation fault. - 0x8144380 in _efree (ptr=0x81fe024, __zend_filename=0x81841a0 "php4/ext/sybase_ct/php_sybase_ct.c", - __zend_lineno=946, __zend_orig_filename=0x0, __zend_orig_lineno=0) at php4/Zend/zend_alloc.c:229 - php4/Zend/zend_alloc.c:229:7284:beg:0x8144380 - */ - #if O_TIMM - if (result) { - php_sybase_finish_results(result); - } - #endif - - zval_ptr_dtor(&tmp); - zend_list_delete(sybase_ptr->active_result_index); - sybase_ptr->active_result_index= 0; - } - - /* Repeat until we don't deadlock. */ - deadlock_count= 0; - for (;;) { - result = NULL; - sybase_ptr->deadlock = 0; - sybase_ptr->affected_rows = 0; - - /* On Solaris 11.5, ct_command() can be moved outside the - * loop, but not on Linux 11.0. - */ - if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, Z_STRVAL_PP(query), CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { - /* If this didn't work, the connection is screwed but - * ct-lib might not set CS_CONSTAT_DEAD. So set our own - * flag. This happens sometimes when the database is restarted - * and/or its machine is rebooted, and ct_command() returns - * CS_BUSY for some reason. - */ - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Connection is dead"); - RETURN_FALSE; - } - - if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot send command"); - RETURN_FALSE; - } - - /* Use the first result set or succeed/fail status and discard the - * others. Applications really shouldn't be making calls that - * return multiple result sets, but if they do then we need to - * properly read or cancel them or the connection will become - * unusable. - */ - if (ct_results(sybase_ptr->cmd, &restype)!=CS_SUCCEED) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot read results"); - RETURN_FALSE; - } - switch ((int) restype) { - case CS_CMD_FAIL: - default: - status = Q_FAILURE; - break; - case CS_CMD_SUCCEED: - case CS_CMD_DONE: { - CS_INT row_count; - if (ct_res_info(sybase_ptr->cmd, CS_ROW_COUNT, &row_count, CS_UNUSED, NULL)==CS_SUCCEED) { - sybase_ptr->affected_rows = (long)row_count; - } - } - /* Fall through */ - case CS_COMPUTEFMT_RESULT: - case CS_ROWFMT_RESULT: - case CS_DESCRIBE_RESULT: - case CS_MSG_RESULT: - buffered= 0; /* These queries have no need for buffering */ - status = Q_SUCCESS; - break; - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - case CS_STATUS_RESULT: - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); - if (result == NULL) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - RETURN_FALSE; - } - status = Q_RESULT; - break; - } - - /* Check for left-over results */ - if (!buffered && status != Q_RESULT) { - while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - status = Q_FAILURE; - break; - - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - if (status != Q_RESULT) { - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); - if (result == NULL) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - RETURN_FALSE; - } - status = Q_RESULT; - retcode = result->last_retcode; - } else { - /* Unexpected results, cancel them. */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - } - break; - case CS_STATUS_RESULT: - /* Unexpected results, cancel them. */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - status = Q_FAILURE; - break; - } - if (status == Q_FAILURE) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - } - if (retcode == CS_END_RESULTS) { - break; - } - } - switch (retcode) { - case CS_END_RESULTS: - /* Normal. */ - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - sybase_ptr->dead = 1; - case CS_CANCELED: - default: - status = Q_FAILURE; - break; - } - } - - /* Retry deadlocks up until deadlock_retry_count times */ - if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlock_retry_count)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count)); - if (result != NULL) { - _free_sybase_result(result); - } - break; - } - - /* If query completed without deadlock, break out of the loop. - * Sometimes deadlock results in failures and sometimes not, - * it seems to depend on the server flavor. But we want to - * retry all deadlocks. - */ - if (sybase_ptr->dead || sybase_ptr->deadlock == 0) { - break; - } - - /* Get rid of any results we may have fetched. This happens: - * e.g., our result set may be a stored procedure status which - * is returned even if the stored procedure deadlocks. As an - * optimization, we could try not to fetch results in known - * deadlock conditions, but deadlock is (should be) rare. - */ - if (result != NULL) { - _free_sybase_result(result); - } - } - - if (status == Q_SUCCESS) { - RETURN_TRUE; - } - - if (status == Q_FAILURE) { - if (result != NULL) { - _free_sybase_result(result); - } - RETURN_FALSE; - } - - /* Indicate we have data in case of buffered queries */ - id= ZEND_REGISTER_RESOURCE(return_value, result, le_result); - sybase_ptr->active_result_index= buffered ? id : 0; -} - -/* {{{ proto int sybase_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_query) -{ - php_sybase_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int sybase_unbuffered_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_unbuffered_query) -{ - php_sybase_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* {{{ proto bool sybase_free_result(int result) - Free result memory */ -PHP_FUNCTION(sybase_free_result) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(sybase_result_index) == IS_RESOURCE && Z_LVAL_PP(sybase_result_index) == 0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Did we fetch up until the end? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cancelling the rest of the results"); */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - php_sybase_finish_results(result); - } - - zend_list_delete(Z_LVAL_PP(sybase_result_index)); - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto string sybase_get_last_message(void) - Returns the last message from server (over min_message_severity) */ -PHP_FUNCTION(sybase_get_last_message) -{ - RETURN_STRING(SybCtG(server_message), 1); -} -/* }}} */ - -/* {{{ proto int sybase_num_rows(int result) - Get number of rows in result */ -PHP_FUNCTION(sybase_num_rows) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - Z_LVAL_P(return_value) = result->num_rows; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto int sybase_num_fields(int result) - Get number of fields in result */ -PHP_FUNCTION(sybase_num_fields) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - Z_LVAL_P(return_value) = result->num_fields; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto array sybase_fetch_row(int result) - Get row as enumerated array */ -PHP_FUNCTION(sybase_fetch_row) -{ - zval **sybase_result_index; - int i; - sybase_result *result; - zval *field_content; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Unbuffered? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); - } - - /* At the end? */ - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - for (i=0; inum_fields; i++) { - ALLOC_ZVAL(field_content); - *field_content = result->data[result->store ? result->cur_row : 0][i]; - INIT_PZVAL(field_content); - zval_copy_ctor(field_content); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &field_content, sizeof(zval* ), NULL); - } - result->cur_row++; -} - -/* }}} */ - -static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics) -{ - zval **sybase_result_index; - sybase_result *result; - int i, j; - zval *tmp; - char name[32]; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Unbuffered ? Fetch next row */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); - } - - /* At the end? */ - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - - j= 1; - for (i=0; inum_fields; i++) { - ALLOC_ZVAL(tmp); - *tmp = result->data[result->store ? result->cur_row : 0][i]; - INIT_PZVAL(tmp); - if (PG(magic_quotes_runtime) && Z_TYPE_P(tmp) == IS_STRING) { - Z_STRVAL_P(tmp) = php_addslashes(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), &Z_STRLEN_P(tmp), 0 TSRMLS_CC); - } else { - zval_copy_ctor(tmp); - } - if (numerics) { - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &tmp, sizeof(zval *), NULL); - tmp->refcount++; - } - - if (zend_hash_exists(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1)) { - snprintf(name, 32, "%s%d", result->fields[i].name, j); - result->fields[i].name= estrdup(name); - j++; - } - zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(zval *), NULL); - } - result->cur_row++; -} - - -/* {{{ proto object sybase_fetch_object(int result [, mixed object]) - Fetch row as object */ -PHP_FUNCTION(sybase_fetch_object) -{ - zval **object= NULL; - zval *sybase_result_index; - zend_class_entry *ce= NULL; - - /* Was a second parameter given? */ - if (2 == ZEND_NUM_ARGS()) { - if (zend_get_parameters_ex(2, &sybase_result_index, &object) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(object)) { - case IS_OBJECT: - ce = Z_OBJCE_PP(object); - break; - case IS_NULL: - break; - default: { - zend_class_entry **pce = NULL; - - convert_to_string_ex(object); - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_PP(object)); - } else { - ce = *pce; - } - } - } - - /* Reset no. of arguments to 1 so that we can use INTERNAL_FUNCTION_PARAM_PASSTHRU */ - ht= 1; - } - - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init( - return_value, - ce ? ce : ZEND_STANDARD_CLASS_DEF_PTR, - Z_ARRVAL_P(return_value) - ); - } -} -/* }}} */ - -/* {{{ proto array sybase_fetch_array(int result) - Fetch row as array */ -PHP_FUNCTION(sybase_fetch_array) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto array sybase_fetch_assoc(int result) - Fetch row as array without numberic indices */ -PHP_FUNCTION(sybase_fetch_assoc) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool sybase_data_seek(int result, int offset) - Move internal row pointer */ -PHP_FUNCTION(sybase_data_seek) -{ - zval **sybase_result_index, **offset; - sybase_result *result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(offset); - - /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && Z_LVAL_PP(offset)>=result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_PP(offset)+ 1); - } - - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", Z_LVAL_PP(offset), result->num_rows - 1); - RETURN_FALSE; - } - - result->cur_row = Z_LVAL_PP(offset); - RETURN_TRUE; -} -/* }}} */ - -static char *php_sybase_get_field_name(CS_INT type) -{ - switch (type) { - case CS_CHAR_TYPE: - case CS_VARCHAR_TYPE: - case CS_TEXT_TYPE: - return "string"; - break; - case CS_IMAGE_TYPE: - return "image"; - break; - case CS_BINARY_TYPE: - case CS_VARBINARY_TYPE: - return "blob"; - break; - case CS_BIT_TYPE: - return "bit"; - break; - case CS_TINYINT_TYPE: - case CS_SMALLINT_TYPE: - case CS_INT_TYPE: - return "int"; - break; - case CS_REAL_TYPE: - case CS_FLOAT_TYPE: - case CS_NUMERIC_TYPE: - case CS_DECIMAL_TYPE: - return "real"; - break; - case CS_MONEY_TYPE: - case CS_MONEY4_TYPE: - return "money"; - break; - case CS_DATETIME_TYPE: - case CS_DATETIME4_TYPE: - return "datetime"; - break; - default: - return "unknown"; - break; - } -} - - -/* {{{ proto object sybase_fetch_field(int result [, int offset]) - Get field information */ -PHP_FUNCTION(sybase_fetch_field) -{ - zval **sybase_result_index, **offset; - int field_offset; - sybase_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset"); - } - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name", result->fields[field_offset].name, 1); - add_property_long(return_value, "max_length", result->fields[field_offset].max_length); - add_property_string(return_value, "column_source", result->fields[field_offset].column_source, 1); - add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_sybase_get_field_name(Z_TYPE(result->fields[field_offset])), 1); -} -/* }}} */ - - -/* {{{ proto bool sybase_field_seek(int result, int offset) - Set field offset */ -PHP_FUNCTION(sybase_field_seek) -{ - zval **sybase_result_index, **offset; - int field_offset; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - - if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset"); - RETURN_FALSE; - } - - result->cur_field = field_offset; - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto string sybase_result(int result, int row, mixed field) - Get result data */ -PHP_FUNCTION(sybase_result) -{ - zval **row, **field, **sybase_result_index; - int field_offset=0; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(row); - - /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && Z_LVAL_PP(row) >= result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_PP(row)); - } - - if (Z_LVAL_PP(row) < 0 || Z_LVAL_PP(row) >= result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%ld)", Z_LVAL_PP(row)); - RETURN_FALSE; - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i; - - for (i=0; inum_fields; i++) { - if (!strcasecmp(result->fields[i].name, Z_STRVAL_PP(field))) { - field_offset = i; - break; - } - } - if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_PP(field)); - RETURN_FALSE; - } - break; - } - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset specified"); - RETURN_FALSE; - } - break; - } - - *return_value = result->data[Z_LVAL_PP(row)][field_offset]; - zval_copy_ctor(return_value); -} -/* }}} */ - - -/* {{{ proto int sybase_affected_rows([int link_id]) - Get number of affected rows in last query */ -PHP_FUNCTION(sybase_affected_rows) -{ - zval **sybase_link_index; - sybase_link *sybase_ptr; - int id; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - Z_LVAL_P(return_value) = sybase_ptr->affected_rows; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - - -PHP_MINFO_FUNCTION(sybase) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "Sybase_CT Support", "enabled" ); - sprintf(buf, "%ld", SybCtG(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - sprintf(buf, "%ld", SybCtG(num_links)); - php_info_print_table_row(2, "Active Links", buf); - sprintf(buf, "%ld", SybCtG(min_server_severity)); - php_info_print_table_row(2, "Min server severity", buf); - sprintf(buf, "%ld", SybCtG(min_client_severity)); - php_info_print_table_row(2, "Min client severity", buf); - php_info_print_table_row(2, "Application Name", SybCtG(appname)); - sprintf(buf, "%ld", SybCtG(deadlock_retry_count)); - php_info_print_table_row(2, "Deadlock retry count", buf); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - - -/* {{{ proto void sybase_min_client_severity(int severity) - Sets minimum client severity */ -PHP_FUNCTION(sybase_min_client_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - SybCtG(min_client_severity) = Z_LVAL_PP(severity); -} -/* }}} */ - - -/* {{{ proto void sybase_min_server_severity(int severity) - Sets minimum server severity */ -PHP_FUNCTION(sybase_min_server_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - SybCtG(min_server_severity) = Z_LVAL_PP(severity); -} -/* }}} */ - -/* {{{ proto void sybase_deadlock_retry_count(int retry_count) - Sets deadlock retry count */ -PHP_FUNCTION(sybase_deadlock_retry_count) -{ - zval **retry_count; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &retry_count) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(retry_count); - SybCtG(deadlock_retry_count) = Z_LVAL_PP(retry_count); -} -/* }}} */ - - -/* {{{ proto bool sybase_set_message_handler(mixed error_func [, resource connection]) - Set the error handler, to be called when a server message is raised. - If error_func is NULL the handler will be deleted */ -PHP_FUNCTION(sybase_set_message_handler) -{ - zval **callback, **param, **sybase_link_index= NULL; - zval name; - sybase_link *sybase_ptr; - - switch (ZEND_NUM_ARGS()) { - case 1: /* Default message handler */ - if (zend_get_parameters_ex(1, ¶m) == FAILURE) { - RETURN_FALSE; - } - callback = &SybCtG(callback_name); - break; - - case 2: /* Connection-based message handler */ - if (zend_get_parameters_ex(2, ¶m, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, -1, "Sybase-Link", le_link, le_plink); - callback = &sybase_ptr->callback_name; - break; - - default: - WRONG_PARAM_COUNT; - } - - /* Clean out old callback */ - if (*callback) { - zval_ptr_dtor(callback); - *callback = NULL; - } - - switch (Z_TYPE_PP(param)) { - case IS_NULL: - /* Return TRUE to indicate we deleted the message handler */ - RETURN_TRUE; - break; - - case IS_ARRAY: - case IS_STRING: - /* Either "function", array("class", "function") or array($object, "function") */ - if (!zend_is_callable(*param, 0, &name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be a valid callback, '%R' was given", Z_TYPE(name), Z_UNIVAL(name)); - zval_dtor(&name); - RETURN_FALSE; - } - zval_dtor(&name); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be either NULL, an array or string, %s given", zend_zval_type_name(*param)); - RETURN_FALSE; - } - - ALLOC_ZVAL(*callback); - **callback = **param; - INIT_PZVAL(*callback); - zval_copy_ctor(*callback); - RETURN_TRUE; -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h deleted file mode 100644 index 024d908e6390f..0000000000000 --- a/ext/sybase_ct/php_sybase_ct.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - | Timm Friebe | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYBASE_CT_H -#define PHP_SYBASE_CT_H - -#if HAVE_SYBASE_CT - -#define CTLIB_VERSION CS_VERSION_100 - -extern zend_module_entry sybase_module_entry; -#define sybase_module_ptr &sybase_module_entry - -PHP_MINIT_FUNCTION(sybase); -PHP_MSHUTDOWN_FUNCTION(sybase); -PHP_RINIT_FUNCTION(sybase); -PHP_RSHUTDOWN_FUNCTION(sybase); -PHP_MINFO_FUNCTION(sybase); - -PHP_FUNCTION(sybase_connect); -PHP_FUNCTION(sybase_pconnect); -PHP_FUNCTION(sybase_close); -PHP_FUNCTION(sybase_select_db); -PHP_FUNCTION(sybase_query); -PHP_FUNCTION(sybase_unbuffered_query); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_get_last_message); -PHP_FUNCTION(sybase_num_rows); -PHP_FUNCTION(sybase_num_fields); -PHP_FUNCTION(sybase_fetch_row); -PHP_FUNCTION(sybase_fetch_array); -PHP_FUNCTION(sybase_fetch_assoc); -PHP_FUNCTION(sybase_fetch_object); -PHP_FUNCTION(sybase_data_seek); -PHP_FUNCTION(sybase_result); -PHP_FUNCTION(sybase_affected_rows); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_min_client_severity); -PHP_FUNCTION(sybase_min_server_severity); -PHP_FUNCTION(sybase_fetch_field); -PHP_FUNCTION(sybase_set_message_handler); -PHP_FUNCTION(sybase_deadlock_retry_count); - -#include - -ZEND_BEGIN_MODULE_GLOBALS(sybase) - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long login_timeout; - long allow_persistent; - char *appname; - char *hostname; - char *server_message; - long min_server_severity, min_client_severity; - long deadlock_retry_count; - zval *callback_name; - CS_CONTEXT *context; -ZEND_END_MODULE_GLOBALS(sybase) - -typedef struct { - CS_CONNECTION *connection; - CS_COMMAND *cmd; - int valid; - int deadlock; - int dead; - int active_result_index; - long affected_rows; - zval *callback_name; -} sybase_link; - -#define SYBASE_ROWS_BLOCK 128 - -typedef struct { - char *name,*column_source; - int max_length, numeric; - CS_INT type; -} sybase_field; - -typedef struct { - pval **data; - sybase_field *fields; - sybase_link *sybase_ptr; - int cur_row,cur_field; - int num_rows,num_fields; - - /* For unbuffered reads */ - CS_INT *lengths; - CS_SMALLINT *indicators; - char **tmp_buffer; - unsigned char *numerics; - CS_INT *types; - CS_DATAFMT *datafmt; - int blocks_initialized; - CS_RETCODE last_retcode; - int store; -} sybase_result; - -#ifdef ZTS -# define SybCtG(v) TSRMG(sybase_globals_id, zend_sybase_globals *, v) -#else -# define SybCtG(v) (sybase_globals.v) -#endif - -#else - -#define sybase_module_ptr NULL - -#endif - -#define phpext_sybase_ct_ptr sybase_module_ptr - -#endif /* PHP_SYBASE_CT_H */ diff --git a/ext/sybase_ct/sybase_ct.dsp b/ext/sybase_ct/sybase_ct.dsp deleted file mode 100644 index be2f890bab09a..0000000000000 --- a/ext/sybase_ct/sybase_ct.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sybase_ct" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=sybase_ct - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sybase_ct.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sybase_ct.mak" CFG="sybase_ct - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sybase_ct - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "sybase_ct - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sybase_ct - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D HAVE_SYBASE_CT=1 /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libct.lib libcs.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sybase_ct.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "sybase_ct - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SYBASE_CT=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_sybase_ct.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "sybase_ct - Win32 Release_TS" -# Name "sybase_ct - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_sybase_ct.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_sybase_ct.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/sybase_ct/tests/bug22403.phpt b/ext/sybase_ct/tests/bug22403.phpt deleted file mode 100644 index 2088595d33c8f..0000000000000 --- a/ext/sybase_ct/tests/bug22403.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Sybase-CT bug #22403 (crash when executing a stored procedure without parameters) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) ->>> Query: exec %s -*** Caught Sybase Server Message #201 [Severity 16, state 2] at line 0 - %s -<<< Return: boolean -bool(false) ->>> Query: exec %s "foo" -*** Caught Sybase Server Message #257 [Severity 16, state 1] at line 0 - %s -<<< Return: boolean -bool(false) ->>> Query: exec does_not_exist -*** Caught Sybase Server Message #2812 [Severity 16, state 4] at line 1 - %s -<<< Return: boolean -bool(false) ->>> Query: exec %s NULL -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - NULL - } -} ->>> Query: exec %s 1 -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - int(1) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug26407.phpt b/ext/sybase_ct/tests/bug26407.phpt deleted file mode 100644 index c8a2d8f28f46b..0000000000000 --- a/ext/sybase_ct/tests/bug26407.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Sybase-CT bug #26407 (Result set fetching broken around transactions) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) ->>> Query: - begin transaction - -- anything producing a result set here will fail; - -- however, print or update statements will work - select "foo" - commit - -- anything afterwards will fail, too - -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - string(3) "foo" - } -} ->>> Query: - begin transaction - -- no result returned... - update #phpt_bug26407 set the_big_answer=42 - commit - -<<< Return: boolean -bool(true) ->>> Query: - select "foo" - begin transaction - -- do anything, even return a result set - commit - select "bar" - - -Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %s/test.inc on line %d -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - string(3) "foo" - } -} diff --git a/ext/sybase_ct/tests/bug27843.phpt b/ext/sybase_ct/tests/bug27843.phpt deleted file mode 100644 index 2de4dbb2ff210..0000000000000 --- a/ext/sybase_ct/tests/bug27843.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Sybase-CT bug #27843 (notices when query is a stored procedure) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) ->>> Query: exec phpt_bug27843 -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - int(1) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug28354.phpt b/ext/sybase_ct/tests/bug28354.phpt deleted file mode 100644 index 3ef374469a719..0000000000000 --- a/ext/sybase_ct/tests/bug28354.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Sybase-CT bug #28354 (sybase_free_result crash) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) -int(0) -string(%d) "%s" diff --git a/ext/sybase_ct/tests/bug29064.phpt b/ext/sybase_ct/tests/bug29064.phpt deleted file mode 100644 index 902fe43358ac3..0000000000000 --- a/ext/sybase_ct/tests/bug29064.phpt +++ /dev/null @@ -1,143 +0,0 @@ ---TEST-- -Sybase-CT bug #29064 (Exact numeric/decimal/money datatypes lose precision) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) ->>> Query: select * from #test -<<< Return: resource -array(2) { - [0]=> - array(10) { - ["test_decimal"]=> - string(39) "12345678901234567890123456789012.123456" - ["test_numeric"]=> - string(39) "12345678901234567890123456.123456789012" - ["test_money"]=> - string(18) "123456789012345.12" - ["test_bigint"]=> - string(38) "12345678901234567890123456789012345678" - ["test_int"]=> - int(1234567890) - ["test_smallmoney"]=> - float(123456.12) - ["test_smallint"]=> - int(12345) - ["test_tinyint"]=> - int(123) - ["test_real"]=> - string(16) "123456789.123457" - ["test_double"]=> - string(16) "123456789.123457" - } - [1]=> - array(10) { - ["test_decimal"]=> - string(40) "-12345678901234567890123456789012.123456" - ["test_numeric"]=> - string(40) "-12345678901234567890123456.123456789012" - ["test_money"]=> - string(19) "-123456789012345.12" - ["test_bigint"]=> - string(39) "-12345678901234567890123456789012345678" - ["test_int"]=> - int(-1234567890) - ["test_smallmoney"]=> - float(-123456.12) - ["test_smallint"]=> - int(-12345) - ["test_tinyint"]=> - int(255) - ["test_real"]=> - string(17) "-123456789.123457" - ["test_double"]=> - string(17) "-123456789.123457" - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug30312.phpt b/ext/sybase_ct/tests/bug30312.phpt deleted file mode 100644 index 55ae9f0809905..0000000000000 --- a/ext/sybase_ct/tests/bug30312.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Sybase-CT bug #30312 (sybase_unbuffered_query calls) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(%d) "%s %d %d %d:%d%s" -string(%d) "%s %d %d %d:%d%s" diff --git a/ext/sybase_ct/tests/bug6339.phpt b/ext/sybase_ct/tests/bug6339.phpt deleted file mode 100644 index 3b0a072b4a10e..0000000000000 --- a/ext/sybase_ct/tests/bug6339.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Sybase-CT bug #6339 (invalid Sybase-link resource) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(1) { - [0]=> - int(1) -} diff --git a/ext/sybase_ct/tests/index.php b/ext/sybase_ct/tests/index.php deleted file mode 100644 index 47202efa3b524..0000000000000 --- a/ext/sybase_ct/tests/index.php +++ /dev/null @@ -1,216 +0,0 @@ -expected= $expected; - } - - function matches($output) { } - } - // }}} - - // {{{ class PHPTRegexExpectancy - // Expectancy class for regular expressions - class PHPTRegexExpectancy extends PHPTExpectancy { - - function matches($output) { - return preg_match('°^'.strtr(preg_quote(rtrim($this->expected), '°'), array( - '%s' => '(.+)', - '%d' => '([0-9]+)' - )).'°', $output); - } - } - // }}} - - // {{{ class PHPTTest - // Represents a single .phpt-style test - class PHPTTest { - var - $name = '', - $description = '', - $skipif = '', - $code = '', - $expectancy = NULL, - $output = ''; - - function &fromFile($filename) { - $fd= fopen($filename, 'r'); - - $sections= array(); - $current= NULL; - while (!feof($fd)) { - $line= fgets($fd, 0xFFFF); - if (1 == sscanf($line, '--%[^-]--', $section)) { - $sections[$section]= ''; - $current= $section; - continue; - } - $sections[$current].= $line; - } - fclose($fd); - - // Create instance from read data and return it - $t= &new PHPTTest(); { - $t->name= substr(realpath($filename), 0, -1); - $t->description= rtrim($sections['TEST']); - $t->skipif= $sections['SKIPIF']; - $t->code= $sections['FILE']; - - if (isset($sections['EXPECTF'])) { - $t->expectancy= &new PHPTRegexExpectancy($sections['EXPECTF']); - } else { - // XXX TBI XXX - } - } - return $t; - } - - function onError($errno, $errstr, $errfile, $errline) { - static $names= array( - E_NOTICE => 'Notice', - E_WARNING => 'Warning' - ); - - if (!(error_reporting() & $errno)) return; - printf( - "\n%s: %s in %s on line %d\n", - $names[$errno], - $errstr, - strstr($errfile, 'eval()\'d code') ? $this->name : $errfile, - $errline - ); - } - - function run() { - - // Precondition check - will die if test needs to be skipped - eval('?>'.$this->skipif); - - set_error_handler(array(&$this, 'onError')); { - error_reporting(E_ALL); - - ob_start(); - eval('?>'.$this->code); - $this->output= rtrim(ob_get_contents()); - ob_end_clean(); - } restore_error_handler(); - - return $this->expectancy->matches($this->output); - } - } - // }}} - - // {{{ main - if (isset($_GET['phpinfo'])) { - phpinfo((int)$_GET['phpinfo']); - - echo 'Home'; - exit(); - } - - echo <<<__ - - - PHPT Test - - - -__; - - $test= basename($_SERVER['QUERY_STRING']); - if ($test && file_exists($test)) { - $t= &PHPTTest::fromFile($test); - echo '

              '.basename($t->name), ': ', $t->description.'

              '; - echo 'Back to test suite'; - flush(); - - // Run the test - $result= $t->run(); - - // Evaluate results - if ($result) { - echo '

              Passed

              '; - } else { - echo '

              Failed


              '; - - echo '

              Actual output

              '; - echo '', $t->output, '
              '; - - echo '

              Expectancy

              '; - echo '', $t->expectancy->expected, ''; - } - - echo '
              '; - exit(); - } - - echo '

              Test suite

              '; - - // phpinfo() links - echo 'phpinfo(): '; - foreach (array( - 1 => 'General', - 4 => 'Configuration', - 8 => 'Modules' - ) as $const => $name) { - printf('%s | ', $const, $name); - } - echo '(All)'; - - echo '

              Select one to run

              '; - echo '
                '; - $d= dir(dirname(__FILE__)); - while ($entry= $d->read()) { - if ('.phpt' != substr($entry, -5)) continue; - echo '
              • '.$entry.'
              • '; - } - $d->close(); - echo '

              '; - - echo <<<__ - - -__; - // }}} -?> diff --git a/ext/sybase_ct/tests/skipif.inc b/ext/sybase_ct/tests/skipif.inc deleted file mode 100644 index 3bbc1e8a62469..0000000000000 --- a/ext/sybase_ct/tests/skipif.inc +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/ext/sybase_ct/tests/test.inc b/ext/sybase_ct/tests/test.inc deleted file mode 100644 index 48aa7d23b32c5..0000000000000 --- a/ext/sybase_ct/tests/test.inc +++ /dev/null @@ -1,84 +0,0 @@ ->> Query: %s\n", $query); - $h= sybase_query($query, $dbh); - printf("<<< Return: %s\n", gettype($h)); - flush(); - if (!is_resource($h)) return $h; - - $return= array(); - while ($row= sybase_fetch_assoc($h)) { - $return[]= $row; - } - return $return; - } - - // {{{ mixed sybase_select_single(resource dbh, string query) - // Fires an SQL query and returns the first value from the first row - function sybase_select_single($dbh, $query) { - return array_shift(sybase_fetch_row(sybase_query($query, $dbh))); - } - // }}} -?> diff --git a/ext/sybase_ct/tests/test_appname.phpt b/ext/sybase_ct/tests/test_appname.phpt deleted file mode 100644 index c423ff0b52667..0000000000000 --- a/ext/sybase_ct/tests/test_appname.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Sybase-CT application name ---SKIPIF-- - ---FILE-- - ---EXPECTF-- ->>> Query: - select - hostname, - program_name - from - master..sysprocesses - where - program_name = "phpt_test" -<<< Return: resource -array(1) { - [0]=> - array(2) { - ["hostname"]=> - string(10) "php.net%s" - ["program_name"]=> - string(16) "phpt_test%s" - } -} -bool(true) -bool(true) diff --git a/ext/sybase_ct/tests/test_connect.phpt b/ext/sybase_ct/tests/test_connect.phpt deleted file mode 100644 index e1e3eead389cc..0000000000000 --- a/ext/sybase_ct/tests/test_connect.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Sybase-CT connectivity ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) diff --git a/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt b/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt deleted file mode 100644 index 72e6b3a8dc12b..0000000000000 --- a/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Sybase-CT connection-based server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) -bool(true) ->>> Query: select getdate(NULL) -*** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d - %s -<<< Return: boolean -bool(false) diff --git a/ext/sybase_ct/tests/test_fetch_object.phpt b/ext/sybase_ct/tests/test_fetch_object.phpt deleted file mode 100644 index aba5ea938d964..0000000000000 --- a/ext/sybase_ct/tests/test_fetch_object.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Sybase-CT sybase_fetch_object ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} - -Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} diff --git a/ext/sybase_ct/tests/test_fields.phpt b/ext/sybase_ct/tests/test_fields.phpt deleted file mode 100644 index cda606ab21151..0000000000000 --- a/ext/sybase_ct/tests/test_fields.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Sybase-CT sybase_field_* functions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct result) -int(4) -class stdClass { - %s $name = 'id'; - %s $max_length = 11; - %s $column_source = ''; - %s $numeric = 1; - %s $type = 'int'; -} -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'author'; - %s $max_length = 4; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'lastchange'; - %s $max_length = 29; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'datetime'; -} -bool(true) -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} diff --git a/ext/sybase_ct/tests/test_long.phpt b/ext/sybase_ct/tests/test_long.phpt deleted file mode 100644 index 9f940d8efd4be..0000000000000 --- a/ext/sybase_ct/tests/test_long.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -Sybase-CT select LONG_MAX / LONG_MIN ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) ->>> Query: select value from test_long -<<< Return: resource -array(6) { - [0]=> - array(1) { - ["value"]=> - int(%s) - } - [1]=> - array(1) { - ["value"]=> - int(%s) - } - [2]=> - array(1) { - ["value"]=> - float(%s) - } - [3]=> - array(1) { - ["value"]=> - int(-%s) - } - [4]=> - array(1) { - ["value"]=> - int(-%s) - } - [5]=> - array(1) { - ["value"]=> - float(-%s) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/test_msghandler.phpt b/ext/sybase_ct/tests/test_msghandler.phpt deleted file mode 100644 index 742dc684ad480..0000000000000 --- a/ext/sybase_ct/tests/test_msghandler.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Sybase-CT server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Nonexistant: -Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %s/test.inc on line %d -bool(false) -Static method: bool(true) -Instance method: bool(true) -Lambda function: bool(true) -Unset: bool(true) -Incorrect type: -Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %s/test.inc on line %d -bool(false) -Function: bool(true) ->>> Query: select getdate(NULL) -*** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d - %s -<<< Return: boolean -bool(false) diff --git a/ext/sybase_ct/tests/test_msghandler_handled.phpt b/ext/sybase_ct/tests/test_msghandler_handled.phpt deleted file mode 100644 index c9ccc1ddebb1f..0000000000000 --- a/ext/sybase_ct/tests/test_msghandler_handled.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Sybase-CT server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) ->>> Query: select getdate(NULL) -*** Caught 'The function 'GETDATE' requires 0 arguments.' -<<< Return: boolean -bool(false) ->>> Query: print "Hi" -!!! Hi -<<< Return: boolean -bool(true) ->>> Query: use NULL -Cannot handle message #156 - -Warning: sybase_query(): Sybase: Server message: Incorrect syntax near the keyword 'NULL'. - (severity 15, procedure N/A) in %s on line %d -<<< Return: boolean -bool(false) ->>> Query: select convert(datetime, "notadate") -Cannot handle message #249 - -Warning: sybase_query(): Sybase: Server message: Syntax error during explicit conversion of VARCHAR value 'notadate' to a DATETIME field. - (severity 16, procedure N/A) in %s on line %d -<<< Return: resource -array(0) { -} diff --git a/ext/sybase_ct/tests/test_query_nostore.phpt b/ext/sybase_ct/tests/test_query_nostore.phpt deleted file mode 100644 index 9d717ec2fd64a..0000000000000 --- a/ext/sybase_ct/tests/test_query_nostore.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Sybase-CT query without storing ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -resource(%d) of type (sybase-ct result) -array(5) { - ["id"]=> - int(1) - ["caption"]=> - string(5) "Hello" - ["author"]=> - string(4) "timm" - ["link"]=> - NULL - ["lastchange"]=> - string(%d) "%s" -} -array(5) { - ["id"]=> - int(2) - ["caption"]=> - string(5) "World" - ["author"]=> - string(6) "thekid" - ["link"]=> - string(17) "http://thekid.de/" - ["lastchange"]=> - string(%d) "%s" -} -array(5) { - ["id"]=> - int(3) - ["caption"]=> - string(3) "PHP" - ["author"]=> - string(6) "friebe" - ["link"]=> - NULL - ["lastchange"]=> - string(%d) "%s" -} -bool(true) diff --git a/ext/sybase_ct/tests/test_types.phpt b/ext/sybase_ct/tests/test_types.phpt deleted file mode 100644 index 735c02d8437a4..0000000000000 --- a/ext/sybase_ct/tests/test_types.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Sybase-CT select and types ---SKIPIF-- - ---FILE-- - ---EXPECTF-- ->>> Query: select - 1 as "integer", - -%s as "integer_min", - -%s as "integer_min_exceed", - %s as "integer_max", - %s as "integer_max_exceed", - 1.0 as "float", - 12345678901234567890123456789012.123456 as "large_float", - $22.36 as "money", - "Binford" as "string", - convert(datetime, "2004-01-23") as "date", - NULL as "null", - convert(bit, 1) as "bit", - convert(smalldatetime, "2004-01-23") as "smalldate", - convert(char(10), "char") as "char10" - -<<< Return: resource -array(1) { - [0]=> - array(%d) { - ["integer"]=> - int(1) - ["integer_min"]=> - int(-%s) - ["integer_min_exceed"]=> - float(-%s) - ["integer_max"]=> - int(%s) - ["integer_max_exceed"]=> - float(%s) - ["float"]=> - float(1) - ["large_float"]=> - string(39) "12345678901234567890123456789012.123456" - ["money"]=> - float(22.36) - ["string"]=> - string(7) "Binford" - ["date"]=> - string(19) "Jan 23 2004 12:00AM" - ["null"]=> - NULL - ["bit"]=> - int(1) - ["smalldate"]=> - string(19) "Jan 23 2004 12:00AM" - ["char10"]=> - string(10) "char " - } -} diff --git a/ext/sybase_ct/tests/test_unbuffered_query.phpt b/ext/sybase_ct/tests/test_unbuffered_query.phpt deleted file mode 100644 index 74b10143b2eaf..0000000000000 --- a/ext/sybase_ct/tests/test_unbuffered_query.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Sybase-CT unbuffered query ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) -resource(%d) of type (sybase-ct result) -int(%d) -int(%d) -bool(true) -resource(%d) of type (sybase-ct result) -resource(%d) of type (Unknown) - -Warning: sybase_num_rows(): %d is not a valid Sybase result resource in %s/test_unbuffered_query.php on line %d -bool(true) -resource(%d) of type (sybase-ct result) -int(%d) -int(%d) -int(4) diff --git a/ext/sysvmsg/CREDITS b/ext/sysvmsg/CREDITS deleted file mode 100644 index 6b150d5301455..0000000000000 --- a/ext/sysvmsg/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Message based IPC -Wez Furlong diff --git a/ext/sysvmsg/config.m4 b/ext/sysvmsg/config.m4 deleted file mode 100644 index 28f03e76d9484..0000000000000 --- a/ext/sysvmsg/config.m4 +++ /dev/null @@ -1,9 +0,0 @@ -dnl $Id$ - -PHP_ARG_ENABLE(sysvmsg,whether to enable System V IPC support, -[ --enable-sysvmsg Enable sysvmsg support]) - -if test "$PHP_SYSVMSG" != "no"; then - AC_DEFINE(HAVE_SYSVMSG, 1, [ ]) - PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared) -fi diff --git a/ext/sysvmsg/package.xml b/ext/sysvmsg/package.xml deleted file mode 100644 index a14335279fb5a..0000000000000 --- a/ext/sysvmsg/package.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - sysvmsg - Unix System V IPC Message Queues - - - wez - Wez Furlong - wez@php.net - lead - - - -Unix System V IPC Message Queues - - PHP - - stable - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h deleted file mode 100644 index 5b167b7cce265..0000000000000 --- a/ext/sysvmsg/php_sysvmsg.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVMSG_H -#define PHP_SYSVMSG_H - -#if HAVE_SYSVMSG - -extern zend_module_entry sysvmsg_module_entry; -#define phpext_sysvmsg_ptr &sysvmsg_module_entry - -#ifndef __USE_GNU -/* we want to use mtype instead of __mtype */ -#define __USE_GNU -#endif - -#include -#include -#include - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(sysvmsg); -PHP_MSHUTDOWN_FUNCTION(sysvmsg); -PHP_RINIT_FUNCTION(sysvmsg); -PHP_RSHUTDOWN_FUNCTION(sysvmsg); -PHP_MINFO_FUNCTION(sysvmsg); - -PHP_FUNCTION(msg_get_queue); -PHP_FUNCTION(msg_remove_queue); -PHP_FUNCTION(msg_stat_queue); -PHP_FUNCTION(msg_set_queue); -PHP_FUNCTION(msg_send); -PHP_FUNCTION(msg_receive); - -typedef struct { - key_t key; - long id; -} sysvmsg_queue_t; - -struct php_msgbuf { - long mtype; - char mtext[1]; -}; - -#endif /* HAVE_SYSVMSG */ - -#endif /* PHP_SYSVMSG_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c deleted file mode 100644 index 951282e9dcc88..0000000000000 --- a/ext/sysvmsg/sysvmsg.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_sysvmsg.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" - -/* In order to detect MSG_EXCEPT use at run time; we have no way - * of knowing what the bit definitions are, so we can't just define - * out own MSG_EXCEPT value. */ -#define PHP_MSG_IPC_NOWAIT 1 -#define PHP_MSG_NOERROR 2 -#define PHP_MSG_EXCEPT 4 - -/* True global resources - no need for thread safety here */ -static int le_sysvmsg; - -static - ZEND_BEGIN_ARG_INFO(sixth_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(msg_receive_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -/* {{{ sysvmsg_functions[] - * - * Every user visible function must have an entry in sysvmsg_functions[]. - */ -function_entry sysvmsg_functions[] = { - PHP_FE(msg_get_queue, NULL) - PHP_FE(msg_send, sixth_arg_force_ref) - PHP_FE(msg_receive, msg_receive_args_force_ref) - PHP_FE(msg_remove_queue, NULL) - PHP_FE(msg_stat_queue, NULL) - PHP_FE(msg_set_queue, NULL) - {NULL, NULL, NULL} /* Must be the last line in sysvmsg_functions[] */ -}; -/* }}} */ - -/* {{{ sysvmsg_module_entry - */ -zend_module_entry sysvmsg_module_entry = { - STANDARD_MODULE_HEADER, - "sysvmsg", - sysvmsg_functions, - PHP_MINIT(sysvmsg), - PHP_MSHUTDOWN(sysvmsg), - NULL, - NULL, - PHP_MINFO(sysvmsg), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVMSG -ZEND_GET_MODULE(sysvmsg) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/* {{{ PHP_INI - */ -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("sysvmsg.value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_sysvmsg_globals, sysvmsg_globals) - STD_PHP_INI_ENTRY("sysvmsg.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_sysvmsg_globals, sysvmsg_globals) -PHP_INI_END() -*/ -/* }}} */ - -static void sysvmsg_release(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvmsg_queue_t * mq = (sysvmsg_queue_t *) rsrc->ptr; - efree(mq); -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvmsg) -{ - le_sysvmsg = zend_register_list_destructors_ex(sysvmsg_release, NULL, "sysvmsg queue", module_number); - REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_NOERROR", PHP_MSG_NOERROR, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_EXCEPT", PHP_MSG_EXCEPT, CONST_PERSISTENT|CONST_CS); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(sysvmsg) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(sysvmsg) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "sysvmsg support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto bool msg_set_queue(resource queue, array data) - Set information for a message queue */ -PHP_FUNCTION(msg_set_queue) -{ - zval *queue, *data; - sysvmsg_queue_t *mq = NULL; - struct msqid_ds stat; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_STAT, &stat) == 0) { - zval **item; - - /* now pull out members of data and set them in the stat buffer */ - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.uid", sizeof("msg_perm.uid"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.uid = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.gid", sizeof("msg_perm.gid"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.gid = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.mode", sizeof("msg_perm.mode"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.mode = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_qbytes", sizeof("msg_qbytes"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_qbytes = Z_LVAL_PP(item); - } - if (msgctl(mq->id, IPC_SET, &stat) == 0) { - RETVAL_TRUE; - } - } -} -/* }}} */ - -/* {{{ proto array msg_stat_queue(resource queue) - Returns information about a message queue */ -PHP_FUNCTION(msg_stat_queue) -{ - zval *queue; - sysvmsg_queue_t *mq = NULL; - struct msqid_ds stat; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_STAT, &stat) == 0) { - array_init(return_value); - - add_assoc_long(return_value, "msg_perm.uid", stat.msg_perm.uid); - add_assoc_long(return_value, "msg_perm.gid", stat.msg_perm.gid); - add_assoc_long(return_value, "msg_perm.mode", stat.msg_perm.mode); - add_assoc_long(return_value, "msg_stime", stat.msg_stime); - add_assoc_long(return_value, "msg_rtime", stat.msg_rtime); - add_assoc_long(return_value, "msg_ctime", stat.msg_ctime); - add_assoc_long(return_value, "msg_qnum", stat.msg_qnum); - add_assoc_long(return_value, "msg_qbytes", stat.msg_qbytes); - add_assoc_long(return_value, "msg_lspid", stat.msg_lspid); - add_assoc_long(return_value, "msg_lrpid", stat.msg_lrpid); - } -} -/* }}} */ - -/* {{{ proto resource msg_get_queue(int key [, int perms]) - Attach to a message queue */ -PHP_FUNCTION(msg_get_queue) -{ - long key; - long perms = 0666; - sysvmsg_queue_t *mq; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) { - return; - } - - mq = (sysvmsg_queue_t *) emalloc(sizeof(sysvmsg_queue_t)); - - mq->key = key; - mq->id = msgget(key, 0); - if (mq->id < 0) { - /* doesn't already exist; create it */ - mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms); - if (mq->id < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - efree(mq); - RETURN_FALSE; - } - } - RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg)); -} -/* }}} */ - -/* {{{ proto bool msg_remove_queue(resource queue) - Destroy the queue */ -PHP_FUNCTION(msg_remove_queue) -{ - zval *queue; - sysvmsg_queue_t *mq = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_RMID, NULL) == 0) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto mixed msg_receive(resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed message [, bool unserialize=true [, int flags=0 [, int errorcode]]]) - Send a message of type msgtype (must be > 0) to a message queue */ -PHP_FUNCTION(msg_receive) -{ - zval *out_message, *queue, *out_msgtype, *zerrcode = NULL; - long desiredmsgtype, maxsize, flags = 0; - long realflags = 0; - zend_bool do_unserialize = 1; - sysvmsg_queue_t *mq = NULL; - struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */ - int result; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlzlz|blz", - &queue, &desiredmsgtype, &out_msgtype, &maxsize, - &out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) { - return; - } - - if (flags != 0) { - if (flags & PHP_MSG_EXCEPT) { -#ifndef MSG_EXCEPT - php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system"); - RETURN_FALSE; -#else - realflags |= MSG_EXCEPT; -#endif - } - if (flags & PHP_MSG_NOERROR) { - realflags |= MSG_NOERROR; - } - if (flags & PHP_MSG_IPC_NOWAIT) { - realflags |= IPC_NOWAIT; - } - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - messagebuffer = (struct php_msgbuf *) emalloc(sizeof(struct php_msgbuf) + maxsize); - - result = msgrcv(mq->id, messagebuffer, maxsize, desiredmsgtype, realflags); - - zval_dtor(out_msgtype); - zval_dtor(out_message); - ZVAL_LONG(out_msgtype, 0); - ZVAL_FALSE(out_message); - - if (zerrcode) { - zval_dtor(zerrcode); - ZVAL_LONG(zerrcode, 0); - } - - if (result >= 0) { - /* got it! */ - ZVAL_LONG(out_msgtype, messagebuffer->mtype); - - RETVAL_TRUE; - if (do_unserialize) { - php_unserialize_data_t var_hash; - zval *tmp = NULL; - const unsigned char *p = (const unsigned char *) messagebuffer->mtext; - - MAKE_STD_ZVAL(tmp); - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted"); - RETVAL_FALSE; - } - REPLACE_ZVAL_VALUE(&out_message, tmp, 0); - FREE_ZVAL(tmp); - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - } else { - ZVAL_STRINGL(out_message, messagebuffer->mtext, result, 1); - } - } else if (zerrcode) { - ZVAL_LONG(zerrcode, errno); - } - efree(messagebuffer); -} -/* }}} */ - -/* {{{ proto bool msg_send(resource queue, int msgtype, mixed message [, bool serialize=true [, bool blocking=true [, int errorcode]]]) - Send a message of type msgtype (must be > 0) to a message queue */ -PHP_FUNCTION(msg_send) -{ - zval *message, *queue, *zerror=NULL; - long msgtype; - zend_bool do_serialize = 1, blocking = 1; - sysvmsg_queue_t * mq = NULL; - struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */ - int result; - int message_len = 0; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz", - &queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t*, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (do_serialize) { - smart_str msg_var = {0}; - php_serialize_data_t var_hash; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&msg_var, &message, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - /* NB: php_msgbuf is 1 char bigger than a long, so there is no need to - * allocate the extra byte. */ - messagebuffer = emalloc(sizeof(struct php_msgbuf) + msg_var.len); - memcpy(messagebuffer->mtext, msg_var.c, msg_var.len + 1); - message_len = msg_var.len; - smart_str_free(&msg_var); - } else { - char *p; - switch (Z_TYPE_P(message)) { - case IS_STRING: - p = Z_STRVAL_P(message); - message_len = Z_STRLEN_P(message); - break; - - case IS_LONG: - case IS_BOOL: - message_len = spprintf(&p, 0, "%ld", Z_LVAL_P(message)); - break; - - case IS_DOUBLE: - message_len = spprintf(&p, 0, "%f", Z_DVAL_P(message)); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number."); - RETURN_FALSE; - } - - messagebuffer = emalloc(sizeof(struct php_msgbuf) + message_len); - memcpy(messagebuffer->mtext, p, message_len + 1); - - if (Z_TYPE_P(message) != IS_STRING) { - efree(p); - } - } - - /* set the message type */ - messagebuffer->mtype = msgtype; - - result = msgsnd(mq->id, messagebuffer, message_len, blocking ? 0 : IPC_NOWAIT); - - efree(messagebuffer); - - if (result == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno)); - if (zerror) { - ZVAL_LONG(zerror, errno); - } - } else { - RETVAL_TRUE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 tw=78 fdm=marker - * vim<600: noet sw=4 ts=4 tw=78 - */ diff --git a/ext/sysvmsg/tests/001.phpt b/ext/sysvmsg/tests/001.phpt deleted file mode 100644 index 4f57dba305137..0000000000000 --- a/ext/sysvmsg/tests/001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -send/receive serialized message. ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TYPE: 1 -DATA: hello diff --git a/ext/sysvmsg/tests/002.phpt b/ext/sysvmsg/tests/002.phpt deleted file mode 100644 index e603ed02b5e04..0000000000000 --- a/ext/sysvmsg/tests/002.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -msg_receive() should return false when unserialize() failed ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: msg_receive(): message corrupted in %s002.php on line %d -bool(false) -Done diff --git a/ext/sysvsem/CREDITS b/ext/sysvsem/CREDITS deleted file mode 100644 index 45232809f01ba..0000000000000 --- a/ext/sysvsem/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Semaphores -Tom May diff --git a/ext/sysvsem/config.m4 b/ext/sysvsem/config.m4 deleted file mode 100644 index bfb5d92f4ea37..0000000000000 --- a/ext/sysvsem/config.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(sysvsem,whether to enable System V semaphore support, -[ --enable-sysvsem Enable System V semaphore support]) - -if test "$PHP_SYSVSEM" != "no"; then - PHP_NEW_EXTENSION(sysvsem, sysvsem.c, $ext_shared) - AC_DEFINE(HAVE_SYSVSEM, 1, [ ]) - AC_CACHE_CHECK(for union semun,php_cv_semun, - AC_TRY_COMPILE([ -#include -#include -#include - ], - [union semun x;], - [ - php_cv_semun=yes - ],[ - php_cv_semun=no - ]) - ) - if test "$php_cv_semun" = "yes"; then - AC_DEFINE(HAVE_SEMUN, 1, [ ]) - else - AC_DEFINE(HAVE_SEMUN, 0, [ ]) - fi -fi diff --git a/ext/sysvsem/package.xml b/ext/sysvsem/package.xml deleted file mode 100644 index ea8f5c94a3ddd..0000000000000 --- a/ext/sysvsem/package.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - sysvsem - Unix System V IPC Semaphores - - - ??? - Tom May - tom@go2net.com - lead - - - -Unix System V IPC Semaphores - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h deleted file mode 100644 index a7053469c4703..0000000000000 --- a/ext/sysvsem/php_sysvsem.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Tom May | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVSEM_H -#define PHP_SYSVSEM_H - -#if HAVE_SYSVSEM - -extern zend_module_entry sysvsem_module_entry; -#define sysvsem_module_ptr &sysvsem_module_entry - -PHP_MINIT_FUNCTION(sysvsem); -PHP_FUNCTION(sem_get); -PHP_FUNCTION(sem_acquire); -PHP_FUNCTION(sem_release); -PHP_FUNCTION(sem_remove); - -typedef struct { - int le_sem; -} sysvsem_module; - -typedef struct { - int id; /* For error reporting. */ - int key; /* For error reporting. */ - int semid; /* Returned by semget(). */ - int count; /* Acquire count for auto-release. */ - int auto_release; /* flag that says to auto-release. */ -} sysvsem_sem; - -extern sysvsem_module php_sysvsem_module; - -#else - -#define sysvsem_module_ptr NULL - -#endif - -#define phpext_sysvsem_ptr sysvsem_module_ptr - -#endif /* PHP_SYSVSEM_H */ diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c deleted file mode 100644 index 2602bdf1bd8e6..0000000000000 --- a/ext/sysvsem/sysvsem.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Tom May | - | Gavin Sherry | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Latest update build anc tested on Linux 2.2.14 - * - * This has been built and tested on Solaris 2.6 and Linux 2.1.122. - * It may not compile or execute correctly on other systems. - * - * sas: Works for me on Linux 2.0.36 and FreeBSD 3.0-current - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_SYSVSEM - -#include -#include -#include -#include - -#include "php_sysvsem.h" - -#if !HAVE_SEMUN - -union semun { - int val; /* value for SETVAL */ - struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ - unsigned short int *array; /* array for GETALL, SETALL */ - struct seminfo *__buf; /* buffer for IPC_INFO */ -}; - -#undef HAVE_SEMUN -#define HAVE_SEMUN 1 - -#endif - -/* {{{ sysvsem_functions[] - */ -function_entry sysvsem_functions[] = { - PHP_FE(sem_get, NULL) - PHP_FE(sem_acquire, NULL) - PHP_FE(sem_release, NULL) - PHP_FE(sem_remove, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ sysvsem_module_entry - */ -zend_module_entry sysvsem_module_entry = { - STANDARD_MODULE_HEADER, - "sysvsem", - sysvsem_functions, - PHP_MINIT(sysvsem), - NULL, - NULL, - NULL, - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVSEM -ZEND_GET_MODULE(sysvsem) -#endif - - -THREAD_LS sysvsem_module php_sysvsem_module; - -/* Semaphore functions using System V semaphores. Each semaphore - * actually consists of three semaphores allocated as a unit under the - * same key. Semaphore 0 (SYSVSEM_SEM) is the actual semaphore, it is - * initialized to max_acquire and decremented as processes acquire it. - * The value of semaphore 1 (SYSVSEM_USAGE) is a count of the number - * of processes using the semaphore. After calling semget(), if a - * process finds that the usage count is 1, it will set the value of - * SYSVSEM_SEM to max_acquire. This allows max_acquire to be set and - * track the PHP code without having a global init routine or external - * semaphore init code. Except see the bug regarding a race condition - * php_sysvsem_get(). Semaphore 2 (SYSVSEM_SETVAL) serializes the - * calls to GETVAL SYSVSEM_USAGE and SETVAL SYSVSEM_SEM. It can be - * acquired only when it is zero. - */ - -#define SYSVSEM_SEM 0 -#define SYSVSEM_USAGE 1 -#define SYSVSEM_SETVAL 2 - -/* {{{ release_sysvsem_sem - */ -static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr; - struct sembuf sop[2]; - int opcount = 1; -/* - * if count == -1, semaphore has been removed - * Need better way to handle this - */ - - if (sem_ptr->count == -1 || !sem_ptr->auto_release) { - efree(sem_ptr); - return; - } - /* Decrement the usage count. */ - - sop[0].sem_num = SYSVSEM_USAGE; - sop[0].sem_op = -1; - sop[0].sem_flg = SEM_UNDO; - - /* Release the semaphore if it has been acquired but not released. */ - - if (sem_ptr->count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Releasing SysV semaphore id %d key 0x%x in request cleanup", sem_ptr->id, sem_ptr->key); - - sop[1].sem_num = SYSVSEM_SEM; - sop[1].sem_op = sem_ptr->count; - sop[1].sem_flg = SEM_UNDO; - - opcount++; - } - if (semop(sem_ptr->semid, sop, opcount) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed in release_sysvsem_sem for key 0x%x: %s", sem_ptr->key, strerror(errno)); - } - - efree(sem_ptr); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvsem) -{ - php_sysvsem_module.le_sem = zend_register_list_destructors_ex(release_sysvsem_sem, NULL, "sysvsem", module_number); - return SUCCESS; -} -/* }}} */ - -#define SETVAL_WANTS_PTR - -#if defined(_AIX) -#undef SETVAL_WANTS_PTR -#endif - -/* {{{ proto resource sem_get(int key [, int max_acquire [, int perm [, int auto_release]]) - Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */ -PHP_FUNCTION(sem_get) -{ - long key, max_acquire, perm, auto_release = 1; - int semid; - struct sembuf sop[3]; - int count; - sysvsem_sem *sem_ptr; -#if HAVE_SEMUN - union semun un; -#endif - - max_acquire = 1; - perm = 0666; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|lll", &key, &max_acquire, &perm, &auto_release)) { - RETURN_FALSE; - } - - /* Get/create the semaphore. Note that we rely on the semaphores - * being zeroed when they are created. Despite the fact that - * the(?) Linux semget() man page says they are not initialized, - * the kernel versions 2.0.x and 2.1.z do in fact zero them. - */ - - semid = semget(key, 3, perm|IPC_CREAT); - if (semid == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - RETURN_FALSE; - } - - /* Find out how many processes are using this semaphore. Note - * that on Linux (at least) there is a race condition here because - * semaphore undo on process exit is not atomic, so we could - * acquire SYSVSEM_SETVAL before a crashed process has decremented - * SYSVSEM_USAGE in which case count will be greater than it - * should be and we won't set max_acquire. Fortunately this - * doesn't actually matter in practice. - */ - - /* Wait for sem 1 to be zero . . . */ - - sop[0].sem_num = SYSVSEM_SETVAL; - sop[0].sem_op = 0; - sop[0].sem_flg = 0; - - /* . . . and increment it so it becomes non-zero . . . */ - - sop[1].sem_num = SYSVSEM_SETVAL; - sop[1].sem_op = 1; - sop[1].sem_flg = SEM_UNDO; - - /* . . . and increment the usage count. */ - - sop[2].sem_num = SYSVSEM_USAGE; - sop[2].sem_op = 1; - sop[2].sem_flg = SEM_UNDO; - while (semop(semid, sop, 3) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); - break; - } - } - - /* Get the usage count. */ -#if HAVE_SEMUN - count = semctl(semid, SYSVSEM_USAGE, GETVAL, un); -#else - count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL); -#endif - if (count == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } - - /* If we are the only user, then take this opportunity to set the max. */ - - if (count == 1) { -#if HAVE_SEMUN - /* This is correct for Linux which has union semun. */ - union semun semarg; - semarg.val = max_acquire; - if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#elif defined(SETVAL_WANTS_PTR) - /* This is correct for Solaris 2.6 which does not have union semun. */ - if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#else - /* This works for i.e. AIX */ - if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#endif - } - - /* Set semaphore 1 back to zero. */ - - sop[0].sem_num = SYSVSEM_SETVAL; - sop[0].sem_op = -1; - sop[0].sem_flg = SEM_UNDO; - while (semop(semid, sop, 1) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); - break; - } - } - - sem_ptr = (sysvsem_sem *) emalloc(sizeof(sysvsem_sem)); - sem_ptr->key = key; - sem_ptr->semid = semid; - sem_ptr->count = 0; - sem_ptr->auto_release = auto_release; - - sem_ptr->id = ZEND_REGISTER_RESOURCE(return_value, sem_ptr, php_sysvsem_module.le_sem); -} -/* }}} */ - -/* {{{ php_sysvsem_semop - */ -static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) -{ - zval **arg_id; - sysvsem_sem *sem_ptr; - struct sembuf sop; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &arg_id)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem); - - if (!acquire && sem_ptr->count == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key); - RETURN_FALSE; - } - - sop.sem_num = SYSVSEM_SEM; - sop.sem_op = acquire ? -1 : 1; - sop.sem_flg = SEM_UNDO; - - while (semop(sem_ptr->semid, &sop, 1) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno)); - RETURN_FALSE; - } - } - - sem_ptr->count -= acquire ? -1 : 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool sem_acquire(resource id) - Acquires the semaphore with the given id, blocking if necessary */ -PHP_FUNCTION(sem_acquire) -{ - php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool sem_release(resource id) - Releases the semaphore with the given id */ -PHP_FUNCTION(sem_release) -{ - php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool sem_remove(resource id) - Removes semaphore from Unix systems */ - -/* - * contributed by Gavin Sherry gavin@linuxworld.com.au - * Fri Mar 16 00:50:13 EST 2001 - */ - -PHP_FUNCTION(sem_remove) -{ - zval **arg_id; - sysvsem_sem *sem_ptr; -#if HAVE_SEMUN - union semun un; - struct semid_ds buf; -#endif - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem); - -#if HAVE_SEMUN - un.buf = &buf; - if (semctl(sem_ptr->semid, 0, IPC_STAT, un) < 0) { -#else - if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_PP(arg_id)); - RETURN_FALSE; - } - -#if HAVE_SEMUN - if (semctl(sem_ptr->semid, 0, IPC_RMID, un) < 0) { -#else - if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_PP(arg_id), strerror(errno)); - RETURN_FALSE; - } - - /* let release_sysvsem_sem know we have removed - * the semaphore to avoid issues with releasing. - */ - - sem_ptr->count = -1; - RETURN_TRUE; -} - -/* }}} */ - -#endif /* HAVE_SYSVSEM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt deleted file mode 100644 index f7d95f7f48f00..0000000000000 --- a/ext/sysvsem/tests/sysv.phpt +++ /dev/null @@ -1,114 +0,0 @@ ---TEST-- -General semaphore and shared memory test ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECTF-- -Start. -Got semaphore Resource id #%i. -Success aquire semaphore Resource id #%i. -Success to attach shared memory : %i. -Write var1 to shared memory. -Write var2 to shared memory. -Read var1=Variable 1. -Read var2=Variable 2. -Semaphore Resource id #%i released. -Shared memory successfully removed from SysV. -semaphore removed successfully from SysV. -End. diff --git a/ext/sysvshm/CREDITS b/ext/sysvshm/CREDITS deleted file mode 100644 index 65a30ceb0cec9..0000000000000 --- a/ext/sysvshm/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Shared Memory -Christian Cartus diff --git a/ext/sysvshm/config.m4 b/ext/sysvshm/config.m4 deleted file mode 100644 index 3827f59541893..0000000000000 --- a/ext/sysvshm/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(sysvshm,whether to enable System V shared memory support, -[ --enable-sysvshm Enable the System V shared memory support]) - -if test "$PHP_SYSVSHM" != "no"; then - AC_DEFINE(HAVE_SYSVSHM, 1, [ ]) - PHP_NEW_EXTENSION(sysvshm, sysvshm.c, $ext_shared) -fi diff --git a/ext/sysvshm/package.xml b/ext/sysvshm/package.xml deleted file mode 100644 index 23e38c7ee6bfd..0000000000000 --- a/ext/sysvshm/package.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - sysvsem - Unix System V IPC Shared Memory - - - ??? - Cristian Cartus - cartus@atrior.de - lead - - - -Unix System V IPC Shared Memory - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h deleted file mode 100644 index b21a295bd78e3..0000000000000 --- a/ext/sysvshm/php_sysvshm.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Cartus | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVSHM_H -#define PHP_SYSVSHM_H - -#if HAVE_SYSVSHM - -extern zend_module_entry sysvshm_module_entry; -#define sysvshm_module_ptr &sysvshm_module_entry - -#include -#include -#include - -typedef struct { - int le_shm; - long init_mem; -} sysvshm_module; - -typedef struct { - long key; - long length; - long next; - char mem; -} sysvshm_chunk; - -typedef struct { - char magic[8]; - long start; - long end; - long free; - long total; -} sysvshm_chunk_head; - -typedef struct { - key_t key; /* Key set by user */ - long id; /* Returned by shmget. */ - sysvshm_chunk_head *ptr; /* memoryaddress of shared memory */ -} sysvshm_shm; - -PHP_MINIT_FUNCTION(sysvshm); -PHP_FUNCTION(shm_attach); -PHP_FUNCTION(shm_detach); -PHP_FUNCTION(shm_remove); -PHP_FUNCTION(shm_put_var); -PHP_FUNCTION(shm_get_var); -PHP_FUNCTION(shm_remove_var); - -extern sysvshm_module php_sysvshm; - -#else - -#define sysvshm_module_ptr NULL - -#endif - -#define phpext_sysvshm_ptr sysvshm_module_ptr - -#endif /* PHP_SYSVSHM_H */ diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c deleted file mode 100644 index 34c7e1cb66907..0000000000000 --- a/ext/sysvshm/sysvshm.c +++ /dev/null @@ -1,445 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Cartus | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This has been built and tested on Linux 2.2.14 - * - * This has been built and tested on Solaris 2.6. - * It may not compile or execute correctly on other systems. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_SYSVSHM - -#include - -#include "php_sysvshm.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" - -/* {{{ sysvshm_functions[] - */ -function_entry sysvshm_functions[] = { - PHP_FE(shm_attach, NULL) - PHP_FE(shm_remove, NULL) - PHP_FE(shm_detach, NULL) - PHP_FE(shm_put_var, NULL) - PHP_FE(shm_get_var, NULL) - PHP_FE(shm_remove_var, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ sysvshm_module_entry - */ -zend_module_entry sysvshm_module_entry = { - STANDARD_MODULE_HEADER, - "sysvshm", - sysvshm_functions, - PHP_MINIT(sysvshm), - NULL, - NULL, - NULL, - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVSHM -ZEND_GET_MODULE(sysvshm) -#endif - -#undef shm_ptr /* undefine AIX-specific macro */ - -THREAD_LS sysvshm_module php_sysvshm; - -static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long len); -static long php_check_shm_data(sysvshm_chunk_head *ptr, long key); -static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos); - -/* {{{ php_release_sysvshm - */ -static void php_release_sysvshm(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvshm_shm *shm_ptr = (sysvshm_shm *) rsrc->ptr; - shmdt((void *) shm_ptr->ptr); - efree(shm_ptr); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvshm) -{ - php_sysvshm.le_shm = zend_register_list_destructors_ex(php_release_sysvshm, NULL, "sysvshm", module_number); - - if (cfg_get_long("sysvshm.init_mem", &php_sysvshm.init_mem) == FAILURE) { - php_sysvshm.init_mem=10000; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ proto int shm_attach(int key [, int memsize [, int perm]]) - Creates or open a shared memory segment */ -PHP_FUNCTION(shm_attach) -{ - zval **arg_key, **arg_size, **arg_flag; - long shm_size, shm_flag; - sysvshm_shm *shm_list_ptr; - char *shm_ptr; - sysvshm_chunk_head *chunk_ptr; - key_t shm_key = (key_t) 0; - long shm_id, list_id; - int ac = ZEND_NUM_ARGS(); - - shm_flag = 0666; - shm_size = php_sysvshm.init_mem; - - if (ac < 1 || ac > 3 || zend_get_parameters_ex(ac, &arg_key, &arg_size, &arg_flag) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (ac) { - case 3: - convert_to_long_ex(arg_flag); - shm_flag = Z_LVAL_PP(arg_flag); - case 2: - convert_to_long_ex(arg_size); - shm_size= Z_LVAL_PP(arg_size); - case 1: - convert_to_long_ex(arg_key); - shm_key = Z_LVAL_PP(arg_key); - } - - shm_list_ptr = (sysvshm_shm *) emalloc(sizeof(sysvshm_shm)); - - /* get the id from a specified key or create new shared memory */ - if ((shm_id = shmget(shm_key, 0, 0)) < 0) { - if (shm_size < sizeof(sysvshm_chunk_head)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: memorysize too small", shm_key); - efree(shm_list_ptr); - RETURN_FALSE; - } - if ((shm_id = shmget(shm_key, shm_size, shm_flag | IPC_CREAT | IPC_EXCL)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno)); - efree(shm_list_ptr); - RETURN_FALSE; - } - } - - if ((shm_ptr = shmat(shm_id, NULL, 0)) == (void *) - 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno)); - efree(shm_list_ptr); - RETURN_FALSE; - } - - /* check if shm is already initialized */ - chunk_ptr = (sysvshm_chunk_head *) shm_ptr; - if (strcmp((char*) &(chunk_ptr->magic), "PHP_SM") != 0) { - strcpy((char*) &(chunk_ptr->magic), "PHP_SM"); - chunk_ptr->start = sizeof(sysvshm_chunk_head); - chunk_ptr->end = chunk_ptr->start; - chunk_ptr->total = shm_size; - chunk_ptr->free = shm_size-chunk_ptr->end; - } - - shm_list_ptr->key = shm_key; - shm_list_ptr->id = shm_id; - shm_list_ptr->ptr = chunk_ptr; - list_id = zend_list_insert(shm_list_ptr, php_sysvshm.le_shm); - RETURN_LONG(list_id); -} -/* }}} */ - -/* {{{ proto bool shm_detach(int shm_identifier) - Disconnects from shared memory segment */ -PHP_FUNCTION(shm_detach) -{ - zval **arg_id; - int type; - sysvshm_shm *shm_list_ptr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - shm_list_ptr = (sysvshm_shm *) zend_list_find(Z_LVAL_PP(arg_id), &type); - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_identifier"); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_PP(arg_id)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool shm_remove(int shm_identifier) - Removes shared memory from Unix systems */ -PHP_FUNCTION(shm_remove) -{ - zval **arg_id; - long id; - int type; - sysvshm_shm *shm_list_ptr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - - if (!shm_list_ptr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_identifier"); - RETURN_FALSE; - } - - if (shmctl(shm_list_ptr->id, IPC_RMID,NULL) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, id, strerror(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool shm_put_var(int shm_identifier, int variable_key, mixed variable) - Inserts or updates a variable in shared memory */ -PHP_FUNCTION(shm_put_var) -{ - zval **arg_id, **arg_key, **arg_var; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - smart_str shm_var = {0}; - int ret; - php_serialize_data_t var_hash; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg_id, &arg_key, &arg_var) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - /* setup string-variable and serialize */ - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&shm_var, arg_var, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - /* insert serialized variable into shared memory */ - ret = php_put_shm_data(shm_list_ptr->ptr, key, shm_var.c, shm_var.len); - - /* free string */ - smart_str_free(&shm_var); - - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not enough shared memory left"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed shm_get_var(int id, int variable_key) - Returns a variable from shared memory */ -PHP_FUNCTION(shm_get_var) -{ - zval **arg_id, **arg_key; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - char *shm_data; - long shm_varpos; - sysvshm_chunk *shm_var; - php_unserialize_data_t var_hash; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg_id, &arg_key) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - /* setup string-variable and serialize */ - /* get serialized variable from shared memory */ - shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key); - - if (shm_varpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key); - RETURN_FALSE; - } - shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos); - shm_data = &shm_var->mem; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (php_var_unserialize(&return_value, (const unsigned char **) &shm_data, shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corrupted"); - RETURN_FALSE; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); -} -/* }}} */ - -/* {{{ proto bool shm_remove_var(int id, int variable_key) - Removes variable from shared memory */ -PHP_FUNCTION(shm_remove_var) -{ - zval **arg_id, **arg_key; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - long shm_varpos; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg_id, &arg_key) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key); - - if (shm_varpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key); - RETURN_FALSE; - } - php_remove_shm_data((shm_list_ptr->ptr), shm_varpos); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_put_shm_data - * inserts an ascii-string into shared memory */ -static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long len) -{ - sysvshm_chunk *shm_var; - long total_size; - long shm_varpos; - - total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 4) * 4 + 4; /* 4-byte alligment */ - - if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) { - php_remove_shm_data(ptr, shm_varpos); - } - - if (ptr->free < total_size) { - return -1; /* not enough memeory */ - } - - shm_var = (sysvshm_chunk *) ((char *) ptr + ptr->end); - shm_var->key = key; - shm_var->length = len; - shm_var->next = total_size; - memcpy(&(shm_var->mem), data, len); - ptr->end += total_size; - ptr->free -= total_size; - return 0; -} -/* }}} */ - -/* {{{ php_check_shm_data - */ -static long php_check_shm_data(sysvshm_chunk_head *ptr, long key) -{ - long pos; - sysvshm_chunk *shm_var; - - pos = ptr->start; - - for (;;) { - if (pos >= ptr->end) { - return -1; - } - shm_var = (sysvshm_chunk*) ((char *) ptr + pos); - if (shm_var->key == key) { - return pos; - } - pos += shm_var->next; - } - return -1; -} -/* }}} */ - -/* {{{ php_remove_shm_data - */ -static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) -{ - sysvshm_chunk *chunk_ptr, *next_chunk_ptr; - long memcpy_len; - - chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos); - next_chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos + chunk_ptr->next); - - memcpy_len = ptr->end-shm_varpos - chunk_ptr->next; - ptr->free += chunk_ptr->next; - ptr->end -= chunk_ptr->next; - if (memcpy_len > 0) { - memcpy(chunk_ptr, next_chunk_ptr, memcpy_len); - } - return 0; -} -/* }}} */ - -#endif /* HAVE_SYSVSHM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/tidy/CREDITS b/ext/tidy/CREDITS deleted file mode 100644 index 1c77b2ff3b49d..0000000000000 --- a/ext/tidy/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tidy -John Coggeshall, Ilia Alshanetsky diff --git a/ext/tidy/README b/ext/tidy/README deleted file mode 100644 index 19f6b9ff6a3e0..0000000000000 --- a/ext/tidy/README +++ /dev/null @@ -1,16 +0,0 @@ - -README FOR ext/tidy by John Coggeshall - - -Tidy is an extension based on Libtidy (http://tidy.sf.net/) and allows a PHP developer -to clean, repair, and traverse HTML, XHTML, and XML documents -- including ones with -embedded scripting languages such as PHP or ASP within them using OO constructs. - ---------------------------------------------------------------------------------------- -!! Important Note !! ---------------------------------------------------------------------------------------- -Older versions of libtidy have a small memory leak inside the ParseConfigFileEnc() function -used to load configuration from a file. If you intend to use this functionality apply -the "libtidy.txt" patch (cd tidy/src/; patch -p0 < libtidy.txt) to libtidy sources and -then recompile libtidy. ---------------------------------------------------------------------------------------- diff --git a/ext/tidy/TODO b/ext/tidy/TODO deleted file mode 100644 index 8a13162cc0d44..0000000000000 --- a/ext/tidy/TODO +++ /dev/null @@ -1,3 +0,0 @@ -TODO - -Do the docs. diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 deleted file mode 100644 index 8f83238402bde..0000000000000 --- a/ext/tidy/config.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(tidy,for TIDY support, -[ --with-tidy[=DIR] Include TIDY support]) - -if test "$PHP_TIDY" != "no"; then - - if test "$PHP_TIDY" != "yes"; then - TIDY_SEARCH_DIRS=$PHP_TIDY - else - TIDY_SEARCH_DIRS="/usr/local /usr" - fi - - for i in $TIDY_SEARCH_DIRS; do - if test -f $i/include/tidy/tidy.h; then - TIDY_DIR=$i - TIDY_INCDIR=$i/include/tidy - elif test -f $i/include/tidy.h; then - TIDY_DIR=$i - TIDY_INCDIR=$i/include - fi - done - - if test -z "$TIDY_DIR"; then - AC_MSG_ERROR(Cannot find libtidy) - fi - - TIDY_LIBDIR=$TIDY_DIR/lib - - PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD) - PHP_ADD_INCLUDE($TIDY_INCDIR) - - PHP_CHECK_LIBRARY(tidy,tidyOptGetDoc, - [ - AC_DEFINE(HAVE_TIDYOPTGETDOC,1,[ ]) - ],[],[]) - - - PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared) - PHP_SUBST(TIDY_SHARED_LIBADD) - AC_DEFINE(HAVE_TIDY,1,[ ]) -fi diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32 deleted file mode 100644 index e9e2a225f7ddc..0000000000000 --- a/ext/tidy/config.w32 +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("tidy", "TIDY support", "no"); - -if (PHP_TIDY != "no") { - if (CHECK_LIB("libtidy.lib", "tidy", PHP_TIDY) && - ( - CHECK_HEADER_ADD_INCLUDE("tidy.h", "CFLAGS_TIDY") || - CHECK_HEADER_ADD_INCLUDE("tidy/tidy.h", "CFLAGS_TIDY", null, null, true) || - CHECK_HEADER_ADD_INCLUDE("libtidy/tidy.h", "CFLAGS_TIDY", null, null, true) - )) { - EXTENSION("tidy", "tidy.c"); - AC_DEFINE('HAVE_TIDY', 1, 'Have TIDY library'); - if (!PHP_TIDY_SHARED) { - ADD_DEF_FILE("ext\\tidy\\php_tidy.def"); - } - } else { - WARNING("tidy not enabled; libraries and headers not found"); - } -} - diff --git a/ext/tidy/examples/cleanhtml.php b/ext/tidy/examples/cleanhtml.php deleted file mode 100644 index 9a6713dc55f0a..0000000000000 --- a/ext/tidy/examples/cleanhtml.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Usage: php cleanhtml.php [filename] - * - */ - - if(!isset($_SERVER['argv'][1])) { - $data = file_get_contents("php://stdin"); - tidy_parse_string($data); - } else { - tidy_parse_file($_SERVER['argv'][1]); - } - - tidy_clean_repair(); - - if(tidy_warning_count() || - tidy_error_count()) { - - echo "\n\nThe following errors or warnings occured:\n"; - echo tidy_get_error_buffer(); - echo "\n"; - } - - echo tidy_get_output(); - -?> - - - - \ No newline at end of file diff --git a/ext/tidy/examples/cleanhtml5.php b/ext/tidy/examples/cleanhtml5.php deleted file mode 100644 index 4dfd7643e133c..0000000000000 --- a/ext/tidy/examples/cleanhtml5.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Usage: php cleanhtml5.php [filename] - * - */ - - if(!isset($_SERVER['argv'][1])) { - $data = file_get_contents("php://stdin"); - $tidy = tidy_parse_string($data); - } else { - $tidy = tidy_parse_file($_SERVER['argv'][1]); - } - - $tidy->cleanRepair(); - - if(!empty($tidy->errorBuffer)) { - - echo "\n\nThe following errors or warnings occured:\n"; - echo "{$tidy->errorBuffer}\n"; - - } - - echo $tidy; - -?> - - - - diff --git a/ext/tidy/examples/dumpit5.php b/ext/tidy/examples/dumpit5.php deleted file mode 100644 index d7aee2d652dfa..0000000000000 --- a/ext/tidy/examples/dumpit5.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * Usage; php dumpit5.php - */ - - $tidy = tidy_parse_file($_SERVER['argv'][1]); - - /* Optionally you can do this here if you want to fix up the document */ - - /* $tidy->clean_repair() */ - - $tree = $tidy->root(); - dump_tree($tree); - echo "\n"; - - function node_type($type) { - - switch($type) { - - case TIDY_NODETYPE_ROOT: return "Root Node"; - case TIDY_NODETYPE_DOCTYPE: return "DocType Node"; - case TIDY_NODETYPE_COMMENT: return "Comment Node"; - case TIDY_NODETYPE_PROCINS: return "ProcIns Node"; - case TIDY_NODETYPE_TEXT: return "Text Node"; - case TIDY_NODETYPE_START: return "Start Node"; - case TIDY_NODETYPE_END: return "End Node"; - case TIDY_NODETYPE_STARTEND: return "Start/End Node"; - case TIDY_NODETYPE_CDATA: return "CDATA Node"; - case TIDY_NODETYPE_SECTION: return "Section Node"; - case TIDY_NODETYPE_ASP: return "ASP Source Code Node"; - case TIDY_NODETYPE_PHP: return "PHP Source Code Node"; - case TIDY_NODETYPE_JSTE: return "JSTE Source Code"; - case TIDY_NODETYPE_XMLDECL: return "XML Declaration Node"; - default: return "Unknown Node"; - } - } - - function do_leaf($string, $indent) { - for($i = 0; $i < $indent; $i++) { - echo " "; - } - echo $string; - } - - function dump_tree(tidyNode $node, $indent = 0) { - - /* Put something there if the node name is empty */ - $nodename = trim(strtoupper($node->name)); - $nodename = (empty($nodename)) ? "[EMPTY]" : $nodename; - - /* Generate the Node, and a pretty name for it */ - do_leaf(" + $nodename (".node_type($node->type).")\n", $indent); - - /* Check to see if this node is a text node. Text nodes are - generated by start/end tags and contain the text in between. - i.e. foo will create a text node with $node->value - equal to 'foo' */ - if($node->type == TIDY_NODETYPE_TEXT) { - do_leaf(" |\n", $indent); - do_leaf(" +---- Value: '{$node->value}'\n", $indent); - } - - if(count($node->attribute)) { - do_leaf(" |\n", $indent); - do_leaf(" +---- Attributes\n", $indent); - - foreach($node->attribute as $name=>$value) { - @do_leaf(" +-- $name\n", $indent); - do_leaf(" | +-- Value: $value\n", $indent); - } - } - - /* Recurse along the children to generate the remaining nodes */ - if($node->hasChildren()) { - foreach($node->child as $child) { - dump_tree($child, $indent + 3); - } - } - - } - - -?> \ No newline at end of file diff --git a/ext/tidy/examples/urlgrab5.php b/ext/tidy/examples/urlgrab5.php deleted file mode 100644 index 875baf0cf90d2..0000000000000 --- a/ext/tidy/examples/urlgrab5.php +++ /dev/null @@ -1,39 +0,0 @@ - tags from a document. - * - * NOTE: Only works with tidy for PHP 5, please see urlgrab.php for tidy for PHP 4.3.x - * - * By: John Coggeshall - * - * Usage: php urlgrab5.php - * - */ - function dump_nodes(tidyNode $node, &$urls = NULL) { - - $urls = (is_array($urls)) ? $urls : array(); - - if(isset($node->id)) { - if($node->id == TIDY_TAG_A) { - $urls[] = $node->attribute['href']; - } - } - - if($node->hasChildren()) { - - foreach($node->child as $c) { - dump_nodes($c, $urls); - } - - } - - return $urls; - } - - $a = tidy_parse_file($_SERVER['argv'][1]); - $a->cleanRepair(); - print_r(dump_nodes($a->html())); -?> diff --git a/ext/tidy/libtidy.txt b/ext/tidy/libtidy.txt deleted file mode 100644 index 53185d9fc229e..0000000000000 --- a/ext/tidy/libtidy.txt +++ /dev/null @@ -1,12 +0,0 @@ ---- config.c Mon Jun 9 04:07:55 2003 -+++ config.c Sun Sep 21 16:13:04 2003 -@@ -719,7 +719,8 @@ - } - - fclose( fin ); -- MemFree( cfg->cfgIn ); -+ MemFree( cfg->cfgIn->source.sourceData ); -+ MemFree( cfg->cfgIn ); - cfg->cfgIn = NULL; - } - diff --git a/ext/tidy/package.xml b/ext/tidy/package.xml deleted file mode 100644 index a5b461ce45094..0000000000000 --- a/ext/tidy/package.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - tidy - Tidy HTML Repairing and Parsing - - - john - John Coggeshall - john@php.net - lead - - - iliaa - Ilia Alshanetsky - ilia@php.net - developer - - - -Tidy is a binding for the Tidy HTML clean and repair utility which -allows you to not only clean and otherwise manipluate HTML documents, -but also traverse the document tree using the Zend Engine 2 OO semantics. - - PHP - - beta - 2.0dev - 2003-11-13 - - Major API changes for PHP 5.0, including the re-introduction of resources, output buffering support, - dual-nature syntax (tidy_clean_repair($tidy_res) or $tidy->clean_repair()) and more. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/tidy/php_tidy.def b/ext/tidy/php_tidy.def deleted file mode 100644 index 0caabc01f340f..0000000000000 --- a/ext/tidy/php_tidy.def +++ /dev/null @@ -1,293 +0,0 @@ -EXPORTS -tidyBufInit -tidyBufAlloc -tidyBufCheckAlloc -tidyBufFree -tidyBufClear -tidyBufAttach -tidyBufDetach -tidyBufAppend -tidyBufPutByte -tidyBufPopByte -tidyBufGetByte -tidyBufEndOfInput -tidyBufUngetByte -initInputBuffer -initOutputBuffer -tidyCreate -tidyRelease -tidySetAppData -tidyGetAppData -tidyReleaseDate -tidyStatus -tidyDetectedHtmlVersion -tidyDetectedXhtml -tidyDetectedGenericXml -tidyErrorCount -tidyWarningCount -tidyAccessWarningCount -tidyConfigErrorCount -tidyLoadConfig -tidyLoadConfigEnc -tidyFileExists -tidySetCharEncoding -tidySetOptionCallback -tidyOptGetIdForName -tidyGetOptionList -tidyGetNextOption -tidyGetOption -tidyGetOptionByName -tidyOptGetId -tidyOptGetName -tidyOptGetType -tidyOptIsReadOnly -tidyOptGetCategory -tidyOptGetDefault -tidyOptGetDefaultInt -tidyOptGetDefaultBool -tidyOptGetDoc -tidyOptGetPickList -tidyOptGetNextPick -tidyOptGetValue -tidyOptSetValue -tidyOptParseValue -tidyOptGetInt -tidyOptSetInt -tidyOptGetBool -tidyOptSetBool -tidyOptResetToDefault -tidyOptResetAllToDefault -tidyOptSnapshot -tidyOptResetToSnapshot -tidyOptDiffThanDefault -tidyOptDiffThanSnapshot -tidyOptCopyConfig -tidyOptGetEncName -tidyOptGetCurrPick -tidyOptGetDeclTagList -tidyOptGetNextDeclTag -tidyInitSource -tidyGetByte -tidyUngetByte -tidyIsEOF -tidyInitSink -tidyPutByte -tidySetReportFilter -tidySetErrorFile -tidySetErrorBuffer -tidySetErrorSink -tidySetMallocCall -tidySetReallocCall -tidySetFreeCall -tidySetPanicCall -tidyParseFile -tidyParseStdin -tidyParseString -tidyParseBuffer -tidyParseSource -tidyCleanAndRepair -tidyRunDiagnostics -tidySaveFile -tidySaveStdout -tidySaveBuffer -tidySaveString -tidySaveSink -tidyOptSaveFile -tidyOptSaveSink -tidyErrorSummary -tidyGeneralInfo -tidyGetRoot -tidyGetHtml -tidyGetHead -tidyGetBody -tidyGetParent -tidyGetChild -tidyGetNext -tidyGetPrev -tidyAttrFirst -tidyAttrNext -tidyAttrName -tidyAttrValue -tidyNodeGetType -tidyNodeGetName -tidyNodeIsText -tidyNodeIsProp -tidyNodeIsHeader -tidyNodeHasText -tidyNodeGetText -tidyNodeGetId -tidyNodeLine -tidyNodeColumn -tidyNodeIsHTML -tidyNodeIsHEAD -tidyNodeIsTITLE -tidyNodeIsBASE -tidyNodeIsMETA -tidyNodeIsBODY -tidyNodeIsFRAMESET -tidyNodeIsFRAME -tidyNodeIsIFRAME -tidyNodeIsNOFRAMES -tidyNodeIsHR -tidyNodeIsH1 -tidyNodeIsH2 -tidyNodeIsPRE -tidyNodeIsLISTING -tidyNodeIsP -tidyNodeIsUL -tidyNodeIsOL -tidyNodeIsDL -tidyNodeIsDIR -tidyNodeIsLI -tidyNodeIsDT -tidyNodeIsDD -tidyNodeIsTABLE -tidyNodeIsCAPTION -tidyNodeIsTD -tidyNodeIsTH -tidyNodeIsTR -tidyNodeIsCOL -tidyNodeIsCOLGROUP -tidyNodeIsBR -tidyNodeIsA -tidyNodeIsLINK -tidyNodeIsB -tidyNodeIsI -tidyNodeIsSTRONG -tidyNodeIsEM -tidyNodeIsBIG -tidyNodeIsSMALL -tidyNodeIsPARAM -tidyNodeIsOPTION -tidyNodeIsOPTGROUP -tidyNodeIsIMG -tidyNodeIsMAP -tidyNodeIsAREA -tidyNodeIsNOBR -tidyNodeIsWBR -tidyNodeIsFONT -tidyNodeIsLAYER -tidyNodeIsSPACER -tidyNodeIsCENTER -tidyNodeIsSTYLE -tidyNodeIsSCRIPT -tidyNodeIsNOSCRIPT -tidyNodeIsFORM -tidyNodeIsTEXTAREA -tidyNodeIsBLOCKQUOTE -tidyNodeIsAPPLET -tidyNodeIsOBJECT -tidyNodeIsDIV -tidyNodeIsSPAN -tidyNodeIsINPUT -tidyNodeIsQ -tidyNodeIsLABEL -tidyNodeIsH3 -tidyNodeIsH4 -tidyNodeIsH5 -tidyNodeIsH6 -tidyNodeIsADDRESS -tidyNodeIsXMP -tidyNodeIsSELECT -tidyNodeIsBLINK -tidyNodeIsMARQUEE -tidyNodeIsEMBED -tidyNodeIsBASEFONT -tidyNodeIsISINDEX -tidyNodeIsS -tidyNodeIsSTRIKE -tidyNodeIsU -tidyNodeIsMENU -tidyAttrGetId -tidyAttrIsEvent -tidyAttrIsProp -tidyAttrIsHREF -tidyAttrIsSRC -tidyAttrIsID -tidyAttrIsNAME -tidyAttrIsSUMMARY -tidyAttrIsALT -tidyAttrIsLONGDESC -tidyAttrIsUSEMAP -tidyAttrIsISMAP -tidyAttrIsLANGUAGE -tidyAttrIsTYPE -tidyAttrIsVALUE -tidyAttrIsCONTENT -tidyAttrIsTITLE -tidyAttrIsXMLNS -tidyAttrIsDATAFLD -tidyAttrIsWIDTH -tidyAttrIsHEIGHT -tidyAttrIsFOR -tidyAttrIsSELECTED -tidyAttrIsCHECKED -tidyAttrIsLANG -tidyAttrIsTARGET -tidyAttrIsHTTP_EQUIV -tidyAttrIsREL -tidyAttrIsOnMOUSEMOVE -tidyAttrIsOnMOUSEDOWN -tidyAttrIsOnMOUSEUP -tidyAttrIsOnCLICK -tidyAttrIsOnMOUSEOVER -tidyAttrIsOnMOUSEOUT -tidyAttrIsOnKEYDOWN -tidyAttrIsOnKEYUP -tidyAttrIsOnKEYPRESS -tidyAttrIsOnFOCUS -tidyAttrIsOnBLUR -tidyAttrIsBGCOLOR -tidyAttrIsLINK -tidyAttrIsALINK -tidyAttrIsVLINK -tidyAttrIsTEXT -tidyAttrIsSTYLE -tidyAttrIsABBR -tidyAttrIsCOLSPAN -tidyAttrIsROWSPAN -tidyAttrGetHREF -tidyAttrGetSRC -tidyAttrGetID -tidyAttrGetNAME -tidyAttrGetSUMMARY -tidyAttrGetALT -tidyAttrGetLONGDESC -tidyAttrGetUSEMAP -tidyAttrGetISMAP -tidyAttrGetLANGUAGE -tidyAttrGetTYPE -tidyAttrGetVALUE -tidyAttrGetCONTENT -tidyAttrGetTITLE -tidyAttrGetXMLNS -tidyAttrGetDATAFLD -tidyAttrGetWIDTH -tidyAttrGetHEIGHT -tidyAttrGetFOR -tidyAttrGetSELECTED -tidyAttrGetCHECKED -tidyAttrGetLANG -tidyAttrGetTARGET -tidyAttrGetHTTP_EQUIV -tidyAttrGetREL -tidyAttrGetOnMOUSEMOVE -tidyAttrGetOnMOUSEDOWN -tidyAttrGetOnMOUSEUP -tidyAttrGetOnCLICK -tidyAttrGetOnMOUSEOVER -tidyAttrGetOnMOUSEOUT -tidyAttrGetOnKEYDOWN -tidyAttrGetOnKEYUP -tidyAttrGetOnKEYPRESS -tidyAttrGetOnFOCUS -tidyAttrGetOnBLUR -tidyAttrGetBGCOLOR -tidyAttrGetLINK -tidyAttrGetALINK -tidyAttrGetVLINK -tidyAttrGetTEXT -tidyAttrGetSTYLE -tidyAttrGetABBR -tidyAttrGetCOLSPAN -tidyAttrGetROWSPAN diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h deleted file mode 100644 index 8a98ebfbb91d9..0000000000000 --- a/ext/tidy/php_tidy.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: John Coggeshall | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_TIDY_H -#define PHP_TIDY_H - -extern zend_module_entry tidy_module_entry; -#define phpext_tidy_ptr &tidy_module_entry - -#ifdef PHP_WIN32 -#define PHP_TIDY_API __declspec(dllexport) -#else -#define PHP_TIDY_API -#endif - -#define TIDY_METHOD_MAP(name, func_name, arg_types) \ - ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types) -#define TIDY_NODE_METHOD(name) PHP_FUNCTION(tnm_ ##name) -#define TIDY_NODE_ME(name, param) TIDY_METHOD_MAP(name, tnm_ ##name, param) -#define TIDY_DOC_METHOD(name) PHP_FUNCTION(tdm_ ##name) -#define TIDY_DOC_ME(name, param) TIDY_METHOD_MAP(name, tdm_ ##name, param) -#define TIDY_ATTR_METHOD(name) PHP_FUNCTION(tam_ ##name) -#define TIDY_ATTR_ME(name, param) TIDY_METHOD_MAP(name, tam_ ##name, param) - -PHP_MINIT_FUNCTION(tidy); -PHP_RINIT_FUNCTION(tidy); -PHP_MINFO_FUNCTION(tidy); - -PHP_FUNCTION(tidy_getopt); -PHP_FUNCTION(tidy_parse_string); -PHP_FUNCTION(tidy_parse_file); -PHP_FUNCTION(tidy_clean_repair); -PHP_FUNCTION(tidy_repair_string); -PHP_FUNCTION(tidy_repair_file); -PHP_FUNCTION(tidy_diagnose); -PHP_FUNCTION(tidy_get_output); -PHP_FUNCTION(tidy_get_error_buffer); -PHP_FUNCTION(tidy_get_release); -PHP_FUNCTION(tidy_reset_config); -PHP_FUNCTION(tidy_get_config); -PHP_FUNCTION(tidy_get_status); -PHP_FUNCTION(tidy_get_html_ver); -#if HAVE_TIDYOPTGETDOC -PHP_FUNCTION(tidy_get_opt_doc); -#endif -PHP_FUNCTION(tidy_is_xhtml); -PHP_FUNCTION(tidy_is_xml); -PHP_FUNCTION(tidy_error_count); -PHP_FUNCTION(tidy_warning_count); -PHP_FUNCTION(tidy_access_count); -PHP_FUNCTION(tidy_config_count); - -PHP_FUNCTION(ob_tidyhandler); - -PHP_FUNCTION(tidy_get_root); -PHP_FUNCTION(tidy_get_html); -PHP_FUNCTION(tidy_get_head); -PHP_FUNCTION(tidy_get_body); - -TIDY_DOC_METHOD(__construct); -TIDY_DOC_METHOD(parseFile); -TIDY_DOC_METHOD(parseString); - -TIDY_NODE_METHOD(__construct); -TIDY_NODE_METHOD(hasChildren); -TIDY_NODE_METHOD(hasSiblings); -TIDY_NODE_METHOD(isComment); -TIDY_NODE_METHOD(isHtml); -TIDY_NODE_METHOD(isXhtml); -TIDY_NODE_METHOD(isXml); -TIDY_NODE_METHOD(isText); -TIDY_NODE_METHOD(isJste); -TIDY_NODE_METHOD(isAsp); -TIDY_NODE_METHOD(isPhp); - -ZEND_BEGIN_MODULE_GLOBALS(tidy) - char *default_config; - zval *inst; -ZEND_END_MODULE_GLOBALS(tidy) - -#ifdef ZTS -#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v) -#else -#define TG(v) (tidy_globals.v) -#endif - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tidy/tests/001.phpt b/ext/tidy/tests/001.phpt deleted file mode 100644 index bfd3782078bf3..0000000000000 --- a/ext/tidy/tests/001.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Check for tidy presence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -tidy extension is available diff --git a/ext/tidy/tests/002.phpt b/ext/tidy/tests/002.phpt deleted file mode 100644 index 89c3804b89d38..0000000000000 --- a/ext/tidy/tests/002.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -tidy_parse_string() ---SKIPIF-- - ---FILE-- -"); - echo tidy_get_output($a); - -?> ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/003.phpt b/ext/tidy/tests/003.phpt deleted file mode 100644 index 7201d6a5a22a2..0000000000000 --- a/ext/tidy/tests/003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -tidy_clean_repair() ---SKIPIF-- - ---FILE-- -"); - tidy_clean_repair($a); - echo tidy_get_output($a); - -?> ---EXPECT-- - - - - - - - - diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt deleted file mode 100644 index e941de452bbc4..0000000000000 --- a/ext/tidy/tests/004.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -tidy_diagnose() ---SKIPIF-- - ---FILE-- -"); - tidy_diagnose($a); - echo tidy_get_error_buffer($a); -?> ---EXPECT-- - -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Warning: discarding unexpected -line 1 column 14 - Warning: inserting missing 'title' element -Info: Document content looks like HTML 3.2 -3 warnings, 0 errors were found! \ No newline at end of file diff --git a/ext/tidy/tests/005.html b/ext/tidy/tests/005.html deleted file mode 100644 index 8c17451f917d9..0000000000000 --- a/ext/tidy/tests/005.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/tidy/tests/005.phpt b/ext/tidy/tests/005.phpt deleted file mode 100644 index 1d3a10c2ffadd..0000000000000 --- a/ext/tidy/tests/005.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -tidy_parse_file() ---SKIPIF-- - ---FILE-- - ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/006.phpt b/ext/tidy/tests/006.phpt deleted file mode 100644 index c8261813145a0..0000000000000 --- a/ext/tidy/tests/006.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Verbose tidy_get_error_buffer() ---SKIPIF-- - ---FILE-- -"); - echo tidy_get_error_buffer($a); - -?> ---EXPECT-- -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Error: is not recognized! -line 1 column 7 - Warning: discarding unexpected -line 1 column 17 - Warning: discarding unexpected -line 1 column 7 - Warning: inserting missing 'title' element \ No newline at end of file diff --git a/ext/tidy/tests/007.html b/ext/tidy/tests/007.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/007.html +++ /dev/null @@ -1 +0,0 @@ -testing
              diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt deleted file mode 100644 index 26867ff3fb277..0000000000000 --- a/ext/tidy/tests/007.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Verbose tidy_getopt() ---SKIPIF-- - ---INI-- -tidy.default_config= ---FILE-- -getopt("tidy-mark")); - echo "Current Value of 'error-file': "; - var_dump($a->getopt("error-file")); - echo "Current Value of 'tab-size': "; - var_dump($a->getopt("tab-size")); - -?> ---EXPECT-- -Current Value of 'tidy-mark': bool(false) -Current Value of 'error-file': string(0) "" -Current Value of 'tab-size': int(8) diff --git a/ext/tidy/tests/008.phpt b/ext/tidy/tests/008.phpt deleted file mode 100644 index 150b98f56074a..0000000000000 --- a/ext/tidy/tests/008.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Accessing the error buffer via $obj->error_buf... ---SKIPIF-- - ---FILE-- -"); - echo $a->errorBuffer; -?> ---EXPECT-- -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Error: is not recognized! -line 1 column 7 - Warning: discarding unexpected -line 1 column 17 - Warning: discarding unexpected -line 1 column 7 - Warning: inserting missing 'title' element \ No newline at end of file diff --git a/ext/tidy/tests/009.phpt b/ext/tidy/tests/009.phpt deleted file mode 100644 index 02c65df7cbd98..0000000000000 --- a/ext/tidy/tests/009.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -tidy_doc object overloading ---SKIPIF-- - ---FILE-- -"); - echo $a; - -?> ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/010.phpt b/ext/tidy/tests/010.phpt deleted file mode 100644 index eabbc0391ff80..0000000000000 --- a/ext/tidy/tests/010.phpt +++ /dev/null @@ -1,317 +0,0 @@ ---TEST-- -Accessing root, body, html, and head nodes.. ---SKIPIF-- - ---FILE-- -"); - var_dump($a->root()); - var_dump($a->body()); - var_dump($a->html()); - var_dump($a->head()); - -?> ---EXPECT-- -object(tidyNode)#2 (8) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(0) "" - ["type"]=> - int(0) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#3 (9) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(4) "html" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["id"]=> - int(48) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#5 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL - } - } - } - } -} -object(tidyNode)#2 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL -} -object(tidyNode)#2 (9) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(4) "html" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["id"]=> - int(48) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#3 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL - } - } -} -object(tidyNode)#2 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} diff --git a/ext/tidy/tests/011.phpt b/ext/tidy/tests/011.phpt deleted file mode 100644 index 2a9461675907f..0000000000000 --- a/ext/tidy/tests/011.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Accessing attributes of a node ---SKIPIF-- - ---FILE-- -"); - $body = $a->body(); - var_dump($body->attribute); - foreach($body->attribute as $key=>$val) { - echo "Attrib '$key': $val\n"; - } -?> ---EXPECT-- -array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" -} -Attrib 'bgcolor': #FFFFFF -Attrib 'alink': #000000 \ No newline at end of file diff --git a/ext/tidy/tests/012.phpt b/ext/tidy/tests/012.phpt deleted file mode 100644 index 43fff38df589e..0000000000000 --- a/ext/tidy/tests/012.phpt +++ /dev/null @@ -1,473 +0,0 @@ ---TEST-- -Accessing children nodes ---SKIPIF-- - ---FILE-- -hasChildren()); - if($node->hasChildren()) { - - foreach($node->child as $c) { - - var_dump($c); - - if($c->hasChildren()) { - - dump_nodes($c); - - } - } - - } - - } - - $a = tidy_parse_string("HiByeTest"); - $html = $a->html(); - dump_nodes($html); - -?> ---EXPECT-- -bool(true) -object(tidyNode)#3 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(87) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(87) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#5 (9) { - ["value"]=> - string(80) " -HiByeTest - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(9) "Hi" - ["name"]=> - string(1) "b" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(43) - ["proprietary"]=> - bool(false) - ["id"]=> - int(8) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#8 (9) { - ["value"]=> - string(21) "ByeTest" - ["name"]=> - string(1) "i" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(52) - ["proprietary"]=> - bool(false) - ["id"]=> - int(49) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - [1]=> - &object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - } - } - } -} -bool(true) -object(tidyNode)#6 (9) { - ["value"]=> - string(9) "Hi" - ["name"]=> - string(1) "b" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(43) - ["proprietary"]=> - bool(false) - ["id"]=> - int(8) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#8 (9) { - ["value"]=> - string(21) "ByeTest" - ["name"]=> - string(1) "i" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(52) - ["proprietary"]=> - bool(false) - ["id"]=> - int(49) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - [1]=> - &object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - } -} -bool(true) -object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} diff --git a/ext/tidy/tests/013.html b/ext/tidy/tests/013.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/013.html +++ /dev/null @@ -1 +0,0 @@ -testing diff --git a/ext/tidy/tests/013.phpt b/ext/tidy/tests/013.phpt deleted file mode 100644 index 8f1ac94ef4a13..0000000000000 --- a/ext/tidy/tests/013.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Parsing a file using constructor ---SKIPIF-- - ---FILE-- -true)); - $tidy->cleanRepair(); - echo $tidy; - -?> ---EXPECT-- -testing diff --git a/ext/tidy/tests/014.phpt b/ext/tidy/tests/014.phpt deleted file mode 100644 index a391b3dc9ebf3..0000000000000 --- a/ext/tidy/tests/014.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Passing configuration options through tidy_parse_string(). ---SKIPIF-- - ---FILE-- -testing"; - $tidy = tidy_parse_string($text, array('show-body-only'=>true)); - tidy_clean_repair($tidy); - echo tidy_get_output($tidy); - -?> ---EXPECT-- -testing \ No newline at end of file diff --git a/ext/tidy/tests/015.html b/ext/tidy/tests/015.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/015.html +++ /dev/null @@ -1 +0,0 @@ -testing diff --git a/ext/tidy/tests/015.phpt b/ext/tidy/tests/015.phpt deleted file mode 100644 index 03018ffa198fd..0000000000000 --- a/ext/tidy/tests/015.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Passing configuration options through tidy_parse_file(). ---SKIPIF-- - ---FILE-- -true)); - tidy_clean_repair($tidy); - echo tidy_get_output($tidy); - -?> ---EXPECT-- -testing \ No newline at end of file diff --git a/ext/tidy/tests/016.html b/ext/tidy/tests/016.html deleted file mode 100644 index 7dc6e4aba8c96..0000000000000 --- a/ext/tidy/tests/016.html +++ /dev/null @@ -1 +0,0 @@ -

              testing

              diff --git a/ext/tidy/tests/016.phpt b/ext/tidy/tests/016.phpt deleted file mode 100644 index 001371aa3e13e..0000000000000 --- a/ext/tidy/tests/016.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Passing configuration file through tidy_parse_file() (may fail with buggy libtidy) ---SKIPIF-- - ---FILE-- - ---EXPECT-- - - - - - - - - -

              testing

              - - diff --git a/ext/tidy/tests/016.tcfg b/ext/tidy/tests/016.tcfg deleted file mode 100644 index fd6e4e44f4fdd..0000000000000 --- a/ext/tidy/tests/016.tcfg +++ /dev/null @@ -1 +0,0 @@ -clean: yes diff --git a/ext/tidy/tests/017.phpt b/ext/tidy/tests/017.phpt deleted file mode 100644 index ba620a32ec329..0000000000000 --- a/ext/tidy/tests/017.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -The Tidy Output Buffer Filter ---SKIPIF-- - ---FILE-- - -testing ---EXPECT-- - - - - - - -testing - - \ No newline at end of file diff --git a/ext/tidy/tests/018.phpt b/ext/tidy/tests/018.phpt deleted file mode 100644 index 405a46d42b204..0000000000000 --- a/ext/tidy/tests/018.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -binary safety ---SKIPIF-- - ---FILE-- -abra\0cadabra

              ", - array( 'show-body-only' => true, - 'clean' => false, - 'newline' => "\n") - ); -var_dump($x); -?> ---EXPECT-- -string(19) "

              abracadabra

              -" diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c deleted file mode 100644 index 9b0e33bbe9d36..0000000000000 --- a/ext/tidy/tidy.c +++ /dev/null @@ -1,1850 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: John Coggeshall | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_tidy.h" - -#if HAVE_TIDY - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "safe_mode.h" - -#include "Zend/zend_exceptions.h" -#include "Zend/zend_object_handlers.h" - -#include "tidy.h" -#include "buffio.h" - -#define PHP_TIDY_MODULE_VERSION "2.0" - -/* {{{ ext/tidy macros -*/ -#define REMOVE_NEWLINE(_z) _z->value.str.val[_z->value.str.len-1] = '\0'; _z->value.str.len--; - -#define TIDYDOC_FROM_OBJECT(tdoc, object) \ - { \ - PHPTidyObj *obj = (PHPTidyObj*) zend_object_store_get_object(object TSRMLS_CC); \ - tdoc = obj->ptdoc; \ - } - -#define TIDY_SET_CONTEXT \ - zval *object; \ - TG(inst) = getThis(); \ - object = TG(inst) - -#define TIDY_FETCH_OBJECT \ - PHPTidyObj *obj; \ - TIDY_SET_CONTEXT; \ - if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - } else { \ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, tidy_ce_doc) == FAILURE) { \ - RETURN_FALSE; \ - } \ - } \ - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); \ - -#define TIDY_FETCH_ONLY_OBJECT \ - PHPTidyObj *obj; \ - TIDY_SET_CONTEXT; \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); \ - - -#define Z_OBJ_P(zval_p) zend_objects_get_address(zval_p TSRMLS_CC) - -#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \ - if(_val) { \ - if(Z_TYPE_P(_val) == IS_ARRAY) { \ - _php_tidy_apply_config_array(_doc, HASH_OF(_val) TSRMLS_CC); \ - } else { \ - convert_to_string_ex(&_val); \ - TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(_val)); \ - if (tidyLoadConfig(_doc, Z_STRVAL_P(_val)) < 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \ - RETURN_FALSE; \ - } \ - } \ - } - -#define REGISTER_TIDY_CLASS(classname, name, parent, __flags) \ - { \ - zend_class_entry ce; \ - INIT_CLASS_ENTRY(ce, # classname, tidy_funcs_ ## name); \ - ce.create_object = tidy_object_new_ ## name; \ - tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ - tidy_ce_ ## name->ce_flags |= __flags; \ - memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \ - tidy_object_handlers_ ## name.clone_obj = NULL; \ - } - -#define TIDY_TAG_CONST(tag) REGISTER_LONG_CONSTANT("TIDY_TAG_" #tag, TidyTag_##tag, CONST_CS | CONST_PERSISTENT) -#define TIDY_NODE_CONST(name, type) REGISTER_LONG_CONSTANT("TIDY_NODETYPE_" #name, TidyNode_##type, CONST_CS | CONST_PERSISTENT) - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#define ADD_PROPERTY_STRING(_table, _key, _string) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - if (_string) { \ - ZVAL_STRING(tmp, (char *)_string, 1); \ - } else { \ - ZVAL_EMPTY_STRING(tmp); \ - } \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_STRINGL(_table, _key, _string, _len) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - if (_string) { \ - ZVAL_STRINGL(tmp, (char *)_string, _len, 1); \ - } else { \ - ZVAL_EMPTY_STRING(tmp); \ - } \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_LONG(_table, _key, _long) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_LONG(tmp, _long); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_NULL(_table, _key) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_NULL(tmp); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_BOOL(_table, _key, _bool) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_BOOL(tmp, _bool); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define TIDY_SAFE_MODE_CHECK(filename) \ -if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) { \ - RETURN_FALSE; \ -} \ - -#define TIDY_SET_DEFAULT_CONFIG(_doc) \ - if (TG(default_config) && TG(default_config)[0]) { \ - if (tidyLoadConfig(_doc, TG(default_config)) < 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \ - } \ - } -/* }}} */ - -/* {{{ ext/tidy structs -*/ -typedef struct _PHPTidyDoc PHPTidyDoc; -typedef struct _PHPTidyObj PHPTidyObj; - -typedef enum { - is_node, - is_doc, - is_exception -} tidy_obj_type; - -typedef enum { - is_root_node, - is_html_node, - is_head_node, - is_body_node -} tidy_base_nodetypes; - -struct _PHPTidyDoc { - TidyDoc doc; - TidyBuffer *errbuf; - unsigned int ref_count; -}; - -struct _PHPTidyObj { - zend_object std; - TidyNode node; - tidy_obj_type type; - PHPTidyDoc *ptdoc; -}; -/* }}} */ - -/* {{{ ext/tidy prototypes -*/ -static char *php_tidy_file_to_mem(char *, zend_bool, int * TSRMLS_DC); -static void tidy_object_free_storage(void * TSRMLS_DC); -static zend_object_value tidy_object_new_node(zend_class_entry * TSRMLS_DC); -static zend_object_value tidy_object_new_doc(zend_class_entry * TSRMLS_DC); -static zend_object_value tidy_object_new_exception(zend_class_entry * TSRMLS_DC); -static zend_class_entry *tidy_get_ce_node(zval * TSRMLS_DC); -static zend_class_entry *tidy_get_ce_doc(zval * TSRMLS_DC); -static zval * tidy_instanciate(zend_class_entry *, zval * TSRMLS_DC); -static int tidy_doc_cast_handler(zval *, zval *, int TSRMLS_DC); -static int tidy_node_cast_handler(zval *, zval *, int TSRMLS_DC); -static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC); -static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC); -static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType * TSRMLS_DC); -static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes); -static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval * TSRMLS_DC); -static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC); -static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS); -static void _php_tidy_register_tags(INIT_FUNC_ARGS); -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(tidy) - -PHP_INI_BEGIN() -STD_PHP_INI_ENTRY("tidy.default_config", "", PHP_INI_SYSTEM, OnUpdateString, default_config, zend_tidy_globals, tidy_globals) -PHP_INI_ENTRY("tidy.clean_output", "0", PHP_INI_PERDIR, NULL) -PHP_INI_END() - -function_entry tidy_functions[] = { - PHP_FE(tidy_getopt, NULL) - PHP_FE(tidy_parse_string, NULL) - PHP_FE(tidy_parse_file, NULL) - PHP_FE(tidy_get_output, NULL) - PHP_FE(tidy_get_error_buffer, NULL) - PHP_FE(tidy_clean_repair, NULL) - PHP_FE(tidy_repair_string, NULL) - PHP_FE(tidy_repair_file, NULL) - PHP_FE(tidy_diagnose, NULL) - PHP_FE(tidy_get_release, NULL) - PHP_FE(tidy_get_config, NULL) - PHP_FE(tidy_get_status, NULL) - PHP_FE(tidy_get_html_ver, NULL) - PHP_FE(tidy_is_xhtml, NULL) - PHP_FE(tidy_is_xml, NULL) - PHP_FE(tidy_error_count, NULL) - PHP_FE(tidy_warning_count, NULL) - PHP_FE(tidy_access_count, NULL) - PHP_FE(tidy_config_count, NULL) -#if HAVE_TIDYOPTGETDOC - PHP_FE(tidy_get_opt_doc, NULL) -#endif - PHP_FE(tidy_get_root, NULL) - PHP_FE(tidy_get_head, NULL) - PHP_FE(tidy_get_html, NULL) - PHP_FE(tidy_get_body, NULL) - PHP_FE(ob_tidyhandler, NULL) - {NULL, NULL, NULL} -}; - -function_entry tidy_funcs_doc[] = { - TIDY_METHOD_MAP(getOpt, tidy_getopt, NULL) - TIDY_METHOD_MAP(cleanRepair, tidy_clean_repair, NULL) - TIDY_DOC_ME(parseFile, NULL) - TIDY_DOC_ME(parseString, NULL) - TIDY_METHOD_MAP(repairString, tidy_repair_string, NULL) - TIDY_METHOD_MAP(repairFile, tidy_repair_file, NULL) - TIDY_METHOD_MAP(diagnose, tidy_diagnose, NULL) - TIDY_METHOD_MAP(getRelease, tidy_get_release, NULL) - TIDY_METHOD_MAP(getConfig, tidy_get_config, NULL) - TIDY_METHOD_MAP(getStatus, tidy_get_status, NULL) - TIDY_METHOD_MAP(getHtmlVer, tidy_get_html_ver, NULL) -#if HAVE_TIDYOPTGETDOC - TIDY_METHOD_MAP(getOptDoc, tidy_get_opt_doc, NULL) -#endif - TIDY_METHOD_MAP(isXhtml, tidy_is_xhtml, NULL) - TIDY_METHOD_MAP(isXml, tidy_is_xml, NULL) - TIDY_METHOD_MAP(root, tidy_get_root, NULL) - TIDY_METHOD_MAP(head, tidy_get_head, NULL) - TIDY_METHOD_MAP(html, tidy_get_html, NULL) - TIDY_METHOD_MAP(body, tidy_get_body, NULL) - TIDY_DOC_ME(__construct, NULL) - {NULL, NULL, NULL} -}; - -function_entry tidy_funcs_node[] = { - TIDY_NODE_ME(__construct, NULL) - TIDY_NODE_ME(hasChildren, NULL) - TIDY_NODE_ME(hasSiblings, NULL) - TIDY_NODE_ME(isComment, NULL) - TIDY_NODE_ME(isHtml, NULL) - TIDY_NODE_ME(isText, NULL) - TIDY_NODE_ME(isJste, NULL) - TIDY_NODE_ME(isAsp, NULL) - TIDY_NODE_ME(isPhp, NULL) - {NULL, NULL, NULL} -}; - -function_entry tidy_funcs_exception[] = { - {NULL, NULL, NULL} -}; - -zend_class_entry *tidy_ce_doc, *tidy_ce_node, *tidy_ce_exception; - -static zend_object_handlers tidy_object_handlers_doc; -static zend_object_handlers tidy_object_handlers_node; -static zend_object_handlers tidy_object_handlers_exception; - -zend_module_entry tidy_module_entry = { - STANDARD_MODULE_HEADER, - "tidy", - tidy_functions, - PHP_MINIT(tidy), - NULL, - PHP_RINIT(tidy), - NULL, - PHP_MINFO(tidy), - PHP_TIDY_MODULE_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_TIDY -ZEND_GET_MODULE(tidy) -#endif - -void *php_tidy_malloc(size_t len) -{ - return emalloc(len); -} - -void *php_tidy_realloc(void *buf, size_t len) -{ - return erealloc(buf, len); -} - -void php_tidy_free(void *buf) -{ - efree(buf); -} - -void php_tidy_panic(ctmbstr msg) -{ - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg); -} - -static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS_DC) -{ - TidyOption opt = tidyGetOptionByName(doc, optname); - zval conv = *value; - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname); - return FAILURE; - } - - if (tidyOptIsReadOnly(opt)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Attempting to set read-only option '%s'", optname); - return FAILURE; - } - - switch(tidyOptGetType(opt)) { - case TidyString: - if (Z_TYPE(conv) != IS_STRING) { - zval_copy_ctor(&conv); - convert_to_string(&conv); - } - if (tidyOptSetValue(doc, tidyOptGetId(opt), Z_STRVAL(conv))) { - if (Z_TYPE(conv) != Z_TYPE_P(value)) { - zval_dtor(&conv); - } - return SUCCESS; - } - if (Z_TYPE(conv) != Z_TYPE_P(value)) { - zval_dtor(&conv); - } - break; - - case TidyInteger: - if (Z_TYPE(conv) != IS_LONG) { - zval_copy_ctor(&conv); - convert_to_long(&conv); - } - if (tidyOptSetInt(doc, tidyOptGetId(opt), Z_LVAL(conv))) { - return SUCCESS; - } - break; - - case TidyBoolean: - if (Z_TYPE(conv) != IS_LONG) { - zval_copy_ctor(&conv); - convert_to_long(&conv); - } - if (tidyOptSetBool(doc, tidyOptGetId(opt), Z_LVAL(conv))) { - return SUCCESS; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option"); - break; - } - - return FAILURE; -} - -static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file) -{ - char *data=NULL, *arg1, *enc = NULL; - int arg1_len, enc_len = 0, data_len = 0; - zend_bool use_include_path = 0; - TidyDoc doc; - TidyBuffer *errbuf; - zval *config; - - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - if (is_file) { - if (!(data = php_tidy_file_to_mem(arg1, use_include_path, &data_len TSRMLS_CC))) { - RETURN_FALSE; - } - } else { - data = arg1; - data_len = arg1_len; - } - - doc = tidyCreate(); - errbuf = emalloc(sizeof(TidyBuffer)); - tidyBufInit(errbuf); - - if (tidySetErrorBuffer(doc, errbuf) != 0) { - tidyBufFree(errbuf); - efree(errbuf); - tidyRelease(doc); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - tidyOptSetBool(doc, TidyForceOutput, yes); - tidyOptSetBool(doc, TidyMark, no); - - TIDY_SET_DEFAULT_CONFIG(doc); - - /* We can't use TIDY_APPLY_CONFIG_ZVAL() here, it uses RETURN_FALSE */ - - if (ZEND_NUM_ARGS() > 1) { - if(Z_TYPE_P(config) == IS_ARRAY) { - _php_tidy_apply_config_array(doc, HASH_OF(config) TSRMLS_CC); - } else { - convert_to_string_ex(&config); - TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(config)); - if (tidyLoadConfig(doc, Z_STRVAL_P(config)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(config)); - RETVAL_FALSE; - } - } - } - - if(enc_len) { - if (tidySetCharEncoding(doc, enc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc); - RETVAL_FALSE; - } - } - - if (data) { - TidyBuffer buf = {0}; - - tidyBufInit(&buf); - tidyBufAppend(&buf, data, data_len); - - if (tidyParseBuffer(doc, &buf) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf->bp); - RETVAL_FALSE; - } else { - if (tidyCleanAndRepair(doc) >= 0) { - TidyBuffer output = {0}; - - tidySaveBuffer (doc, &output); - RETVAL_STRINGL(output.bp, output.size-1, 1); - tidyBufFree(&output); - } else { - RETVAL_FALSE; - } - } - - tidyBufFree(&buf); - } - - if (is_file) { - efree(data); - } - - tidyBufFree(errbuf); - efree(errbuf); - tidyRelease(doc); -} - -static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path, int *len TSRMLS_DC) -{ - php_stream *stream; - char *data = NULL; - - if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE, NULL))) { - return NULL; - } - if ((*len = (int) php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) == 0) { - data = estrdup(""); - *len = 0; - } - php_stream_close(stream); - - return data; -} - -static void tidy_object_free_storage(void *object TSRMLS_DC) -{ - PHPTidyObj *intern = (PHPTidyObj *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - if (intern->ptdoc) { - intern->ptdoc->ref_count--; - - if (intern->ptdoc->ref_count <= 0) { - tidyBufFree(intern->ptdoc->errbuf); - efree(intern->ptdoc->errbuf); - tidyRelease(intern->ptdoc->doc); - efree(intern->ptdoc); - } - } - - efree(object); -} - -static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, - zend_object_value *retval, tidy_obj_type objtype TSRMLS_DC) -{ - PHPTidyObj *intern; - zval *tmp; - - intern = emalloc(sizeof(PHPTidyObj)); - memset(intern, 0, sizeof(PHPTidyObj)); - intern->std.ce = class_type; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - switch(objtype) { - case is_node: - break; - - case is_doc: - tidySetMallocCall(php_tidy_malloc); - tidySetReallocCall(php_tidy_realloc); - tidySetFreeCall(php_tidy_free); - tidySetPanicCall(php_tidy_panic); - - intern->ptdoc = emalloc(sizeof(PHPTidyDoc)); - intern->ptdoc->doc = tidyCreate(); - intern->ptdoc->ref_count = 1; - intern->ptdoc->errbuf = emalloc(sizeof(TidyBuffer)); - tidyBufInit(intern->ptdoc->errbuf); - - if (tidySetErrorBuffer(intern->ptdoc->doc, intern->ptdoc->errbuf) != 0) { - tidyBufFree(intern->ptdoc->errbuf); - efree(intern->ptdoc->errbuf); - tidyRelease(intern->ptdoc->doc); - efree(intern->ptdoc); - efree(intern); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - tidyOptSetBool(intern->ptdoc->doc, TidyForceOutput, yes); - tidyOptSetBool(intern->ptdoc->doc, TidyMark, no); - - TIDY_SET_DEFAULT_CONFIG(intern->ptdoc->doc); - - tidy_add_default_properties(intern, is_doc TSRMLS_CC); - break; - - default: - break; - } - - retval->handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) tidy_object_free_storage, NULL TSRMLS_CC); - retval->handlers = handlers; -} - -static zend_object_value tidy_object_new_node(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - tidy_object_new(class_type, &tidy_object_handlers_node, &retval, is_node TSRMLS_CC); - return retval; -} - -static zend_object_value tidy_object_new_doc(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - tidy_object_new(class_type, &tidy_object_handlers_doc, &retval, is_doc TSRMLS_CC); - return retval; -} - -static zend_object_value tidy_object_new_exception(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - tidy_object_new(class_type, &tidy_object_handlers_exception, &retval, is_exception TSRMLS_CC); - return retval; -} - -static zend_class_entry *tidy_get_ce_node(zval *object TSRMLS_DC) -{ - return tidy_ce_node; -} - -static zend_class_entry *tidy_get_ce_doc(zval *object TSRMLS_DC) -{ - return tidy_ce_doc; -} - -static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; - return object; -} - -static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC) -{ - TidyBuffer output = {0}; - PHPTidyObj *obj; - - switch(type) { - case IS_LONG: - ZVAL_LONG(out, 0); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(out, 0); - break; - - case IS_BOOL: - ZVAL_BOOL(out, TRUE); - break; - - case IS_STRING: - obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC); - tidySaveBuffer (obj->ptdoc->doc, &output); - ZVAL_STRINGL(out, output.bp, output.size-1, TRUE); - tidyBufFree(&output); - break; - - default: - return FAILURE; - } - - return SUCCESS; -} - -static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC) -{ - TidyBuffer buf = {0}; - PHPTidyObj *obj; - - switch(type) { - case IS_LONG: - ZVAL_LONG(out, 0); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(out, 0); - break; - - case IS_BOOL: - ZVAL_BOOL(out, TRUE); - break; - - case IS_STRING: - obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC); - tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf); - ZVAL_STRINGL(out, buf.bp, buf.size-1, TRUE); - tidyBufFree(&buf); - break; - - default: - return FAILURE; - } - - return SUCCESS; -} - -static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC) -{ - - TidyBuffer output = {0}; - zval *temp; - - tidySaveBuffer (obj->ptdoc->doc, &output); - - if (output.size) { - MAKE_STD_ZVAL(temp); - ZVAL_STRINGL(temp, output.bp, output.size-1, TRUE); - zend_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL); - } - - tidyBufFree(&output); - - if (obj->ptdoc->errbuf->size) { - MAKE_STD_ZVAL(temp); - ZVAL_STRINGL(temp, obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, TRUE); - zend_hash_update(obj->std.properties, "errorBuffer", sizeof("errorBuffer"), (void *)&temp, sizeof(zval *), NULL); - } -} - -static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRMLS_DC) -{ - - TidyBuffer buf; - TidyAttr tempattr; - TidyNode tempnode; - zval *attribute, *children, *temp; - PHPTidyObj *newobj; - - switch(type) { - - case is_node: - - memset(&buf, 0, sizeof(buf)); - tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf); - ADD_PROPERTY_STRINGL(obj->std.properties, value, buf.bp, buf.size-1); - tidyBufFree(&buf); - - ADD_PROPERTY_STRING(obj->std.properties, name, tidyNodeGetName(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, type, tidyNodeGetType(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, line, tidyNodeLine(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, column, tidyNodeColumn(obj->node)); - ADD_PROPERTY_BOOL(obj->std.properties, proprietary, tidyNodeIsProp(obj->ptdoc->doc, obj->node)); - - switch(tidyNodeGetType(obj->node)) { - case TidyNode_Root: - case TidyNode_DocType: - case TidyNode_Text: - case TidyNode_Comment: - break; - - default: - ADD_PROPERTY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node)); - } - - tempattr = tidyAttrFirst(obj->node); - MAKE_STD_ZVAL(attribute); - - if (tempattr) { - char *name, *val; - array_init(attribute); - - do { - name = (char *)tidyAttrName(tempattr); - val = (char *)tidyAttrValue(tempattr); - if (name && val) { - add_assoc_string(attribute, name, val, TRUE); - } - } while((tempattr = tidyAttrNext(tempattr))); - } else { - ZVAL_NULL(attribute); - } - zend_hash_update(obj->std.properties, "attribute", sizeof("attribute"), (void *)&attribute, sizeof(zval *), NULL); - - tempnode = tidyGetChild(obj->node); - - MAKE_STD_ZVAL(children); - if (tempnode) { - array_init(children); - do { - MAKE_STD_ZVAL(temp); - tidy_instanciate(tidy_ce_node, temp TSRMLS_CC); - newobj = (PHPTidyObj *) zend_object_store_get_object(temp TSRMLS_CC); - newobj->node = tempnode; - newobj->type = is_node; - newobj->ptdoc = obj->ptdoc; - newobj->ptdoc->ref_count++; - - tidy_add_default_properties(newobj, is_node TSRMLS_CC); - add_next_index_zval(children, temp); - - } while((tempnode = tidyGetNext(tempnode))); - - } else { - ZVAL_NULL(children); - } - - zend_hash_update(obj->std.properties, "child", sizeof("child"), (void *)&children, sizeof(zval *), NULL); - - break; - - case is_doc: - ADD_PROPERTY_NULL(obj->std.properties, errorBuffer); - ADD_PROPERTY_NULL(obj->std.properties, value); - break; - - case is_exception: - default: - break; - } -} - -static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type TSRMLS_DC) -{ - *type = tidyOptGetType(opt); - - switch (*type) { - case TidyString: { - char *val = (char *) tidyOptGetValue(ptdoc->doc, tidyOptGetId(opt)); - if (val) { - return (void *) estrdup(val); - } else { - return (void *) estrdup(""); - } - } - break; - - case TidyInteger: - return (void *) tidyOptGetInt(ptdoc->doc, tidyOptGetId(opt)); - break; - - case TidyBoolean: - return (void *) tidyOptGetBool(ptdoc->doc, tidyOptGetId(opt)); - break; - } - - /* should not happen */ - return NULL; -} - -static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes node) -{ - PHPTidyObj *newobj; - TIDY_FETCH_OBJECT; - - tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC); - newobj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - newobj->type = is_node; - newobj->ptdoc = obj->ptdoc; - newobj->ptdoc->ref_count++; - - switch(node) { - case is_root_node: - newobj->node = tidyGetRoot(newobj->ptdoc->doc); - break; - - case is_html_node: - newobj->node = tidyGetHtml(newobj->ptdoc->doc); - break; - - case is_head_node: - newobj->node = tidyGetHead(newobj->ptdoc->doc); - break; - - case is_body_node: - newobj->node = tidyGetBody(newobj->ptdoc->doc); - break; - } - - tidy_add_default_properties(newobj, is_node TSRMLS_CC); -} - -static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC) -{ - char *opt_name = NULL; - zval **opt_val; - ulong opt_indx; - - for (zend_hash_internal_pointer_reset(ht_options); - zend_hash_get_current_data(ht_options, (void **)&opt_val) == SUCCESS; - zend_hash_move_forward(ht_options)) { - - if(zend_hash_get_current_key(ht_options, &opt_name, &opt_indx, FALSE) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve key from option array"); - return FAILURE; - } - - if(opt_name) { - _php_tidy_set_tidy_opt(doc, opt_name, *opt_val TSRMLS_CC); - opt_name = NULL; - } - - } - - return SUCCESS; -} - -static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc TSRMLS_DC) -{ - TidyBuffer buf = {0}; - - if(enc) { - if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc); - return FAILURE; - } - } - - tidyBufInit(&buf); - tidyBufAppend(&buf, string, len); - if (tidyParseBuffer(obj->ptdoc->doc, &buf) < 0) { - tidyBufFree(&buf); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", obj->ptdoc->errbuf->bp); - return FAILURE; - - } - tidyBufFree(&buf); - tidy_doc_update_properties(obj TSRMLS_CC); - - return SUCCESS; -} - -static void tidy_globals_ctor(void *global TSRMLS_DC) -{ - -} - -static void tidy_globals_dtor(void *global TSRMLS_DC) -{ - -} - -PHP_MINIT_FUNCTION(tidy) -{ - ZEND_INIT_MODULE_GLOBALS(tidy, tidy_globals_ctor, tidy_globals_dtor); - - REGISTER_INI_ENTRIES(); - REGISTER_TIDY_CLASS(tidy, doc, NULL, 0); - REGISTER_TIDY_CLASS(tidyNode, node, NULL, ZEND_ACC_FINAL_CLASS); - /* no exceptions for now.. - REGISTER_TIDY_CLASS(tidyException, exception, zend_exception_get_default(TSRMLS_C)); - */ - tidy_object_handlers_doc.get_class_entry = tidy_get_ce_doc; - tidy_object_handlers_node.get_class_entry = tidy_get_ce_node; - - tidy_object_handlers_doc.cast_object = tidy_doc_cast_handler; - tidy_object_handlers_node.cast_object = tidy_node_cast_handler; - - _php_tidy_register_tags(INIT_FUNC_ARGS_PASSTHRU); - _php_tidy_register_nodetypes(INIT_FUNC_ARGS_PASSTHRU); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(tidy) -{ - if (INI_BOOL("tidy.clean_output") == TRUE) { - if (php_start_ob_buffer_named("ob_tidyhandler", 0, 1 TSRMLS_CC) == FAILURE) { - zend_error(E_NOTICE, "Failure installing Tidy output buffering."); - } - } - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(tidy) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Tidy support", "enabled"); - php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate()); - php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id$)"); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -PHP_FUNCTION(ob_tidyhandler) -{ - char *input; - int input_len; - long mode; - TidyBuffer errbuf = {0}; - TidyDoc doc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &input, &input_len, &mode) == FAILURE) { - WRONG_PARAM_COUNT; - } - - doc = tidyCreate(); - tidyBufInit(&errbuf); - - tidyOptSetBool(doc, TidyForceOutput, yes); - tidyOptSetBool(doc, TidyMark, no); - - if (tidySetErrorBuffer(doc, &errbuf) != 0) { - tidyRelease(doc); - tidyBufFree(&errbuf); - - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - TIDY_SET_DEFAULT_CONFIG(doc); - - if (input_len > 1) { - TidyBuffer buf = {0}; - - tidyBufInit(&buf); - tidyBufAppend(&buf, input, input_len); - - if (tidyParseBuffer(doc, &buf) < 0 || tidyCleanAndRepair(doc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf.bp); - RETVAL_NULL(); - } else { - TidyBuffer output = {0}; - tidyBufInit(&output); - - tidySaveBuffer(doc, &output); - RETVAL_STRINGL(output.bp, output.size-1, 1); - - tidyBufFree(&output); - } - - tidyBufFree(&buf); - } else { - RETVAL_NULL(); - } - - tidyRelease(doc); - tidyBufFree(&errbuf); -} - -/* {{{ proto bool tidy_parse_string(string input [, mixed config_options [, string encoding]]) - Parse a document stored in a string */ -PHP_FUNCTION(tidy_parse_string) -{ - char *input, *enc = NULL; - int input_len, enc_len = 0; - zval *options = NULL; - - PHPTidyObj *obj; - - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) { - RETURN_FALSE; - } - - tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC); - obj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - INIT_ZVAL(*return_value); - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ proto string tidy_get_error_buffer([boolean detailed]) - Return warnings and errors which occured parsing the specified document*/ -PHP_FUNCTION(tidy_get_error_buffer) -{ - TIDY_FETCH_OBJECT; - - if (obj->ptdoc->errbuf && obj->ptdoc->errbuf->bp) { - RETURN_STRINGL(obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string tidy_get_output() - Return a string representing the parsed tidy markup */ -PHP_FUNCTION(tidy_get_output) -{ - TidyBuffer output = {0}; - TIDY_FETCH_OBJECT; - - tidySaveBuffer(obj->ptdoc->doc, &output); - - RETVAL_STRINGL(output.bp, output.size-1, 1); - - tidyBufFree(&output); -} -/* }}} */ - -/* {{{ proto boolean tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]]) - Parse markup in file or URI */ -PHP_FUNCTION(tidy_parse_file) -{ - char *inputfile, *enc = NULL; - int input_len, contents_len, enc_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval *options = NULL; - - PHPTidyObj *obj; - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC); - obj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - RETURN_FALSE; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - INIT_ZVAL(*return_value); - RETVAL_FALSE; - } - - efree(contents); -} -/* }}} */ - -/* {{{ proto boolean tidy_clean_repair() - Execute configured cleanup and repair operations on parsed markup */ -PHP_FUNCTION(tidy_clean_repair) -{ - TIDY_FETCH_OBJECT; - - if (tidyCleanAndRepair(obj->ptdoc->doc) >= 0) { - tidy_doc_update_properties(obj TSRMLS_CC); - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean tidy_repair_string(string data [, mixed config_file [, string encoding]]) - Repair a string using an optionally provided configuration file */ -PHP_FUNCTION(tidy_repair_string) -{ - TIDY_SET_CONTEXT; - php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE); -} -/* }}} */ - -/* {{{ proto boolean tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]]) - Repair a file using an optionally provided configuration file */ -PHP_FUNCTION(tidy_repair_file) -{ - TIDY_SET_CONTEXT; - php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE); -} -/* }}} */ - -/* {{{ proto boolean tidy_diagnose() - Run configured diagnostics on parsed and repaired markup. */ -PHP_FUNCTION(tidy_diagnose) -{ - TIDY_FETCH_OBJECT; - - if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) { - tidy_doc_update_properties(obj TSRMLS_CC); - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string tidy_get_release() - Get release date (version) for Tidy library */ -PHP_FUNCTION(tidy_get_release) -{ - TIDY_SET_CONTEXT; - - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - RETURN_STRING((char *)tidyReleaseDate(), 1); -} -/* }}} */ - - -#if HAVE_TIDYOPTGETDOC -/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname) - Returns the documentation for the given option name */ -PHP_FUNCTION(tidy_get_opt_doc) -{ - PHPTidyObj *obj; - char *optname, *optval; - int optname_len; - TidyOption opt; - - TIDY_SET_CONTEXT; - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } else { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } - - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); - - opt = tidyGetOptionByName(obj->ptdoc->doc, optname); - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname); - RETURN_FALSE; - } - - if ( (optval = (char *) tidyOptGetDoc(obj->ptdoc->doc, opt)) ) { - RETURN_STRING(optval, 1); - } - - RETURN_FALSE; -} -/* }}} */ -#endif - - -/* {{{ proto array tidy_get_config() - Get current Tidy configuarion */ -PHP_FUNCTION(tidy_get_config) -{ - TidyIterator itOpt; - char *opt_name; - void *opt_value; - TidyOptionType optt; - - TIDY_FETCH_OBJECT; - - itOpt = tidyGetOptionList(obj->ptdoc->doc); - - array_init(return_value); - - while (itOpt) { - TidyOption opt = tidyGetNextOption(obj->ptdoc->doc, &itOpt); - - opt_name = (char *)tidyOptGetName(opt); - opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC); - switch (optt) { - case TidyString: - add_assoc_string(return_value, opt_name, (char*)opt_value, 0); - break; - - case TidyInteger: - add_assoc_long(return_value, opt_name, (long)opt_value); - break; - - case TidyBoolean: - add_assoc_bool(return_value, opt_name, (long)opt_value); - break; - } - } - - return; -} -/* }}} */ - -/* {{{ proto int tidy_get_status() - Get status of specfied document. */ -PHP_FUNCTION(tidy_get_status) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyStatus(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_get_html_ver() - Get the Detected HTML version for the specified document. */ -PHP_FUNCTION(tidy_get_html_ver) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyDetectedHtmlVersion(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto boolean tidy_is_xhtml() - Indicates if the document is a XHTML document. */ -PHP_FUNCTION(tidy_is_xhtml) -{ - TIDY_FETCH_OBJECT; - - RETURN_BOOL(tidyDetectedXhtml(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto boolean tidy_is_xhtml() - Indicates if the document is a generic (non HTML/XHTML) XML document. */ -PHP_FUNCTION(tidy_is_xml) -{ - TIDY_FETCH_OBJECT; - - RETURN_BOOL(tidyDetectedGenericXml(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_error_count() - Returns the Number of Tidy errors encountered for specified document. */ -PHP_FUNCTION(tidy_error_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyErrorCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_warning_count() - Returns the Number of Tidy warnings encountered for specified document. */ -PHP_FUNCTION(tidy_warning_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyWarningCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_access_count() - Returns the Number of Tidy accessibility warnings encountered for specified document. */ -PHP_FUNCTION(tidy_access_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyAccessWarningCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_config_count() - Returns the Number of Tidy configuration errors encountered for specified document. */ -PHP_FUNCTION(tidy_config_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyConfigErrorCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto mixed tidy_getopt(string option) - Returns the value of the specified configuration option for the tidy document. */ -PHP_FUNCTION(tidy_getopt) -{ - PHPTidyObj *obj; - char *optname; - void *optval; - int optname_len; - TidyOption opt; - TidyOptionType optt; - - TIDY_SET_CONTEXT; - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } else { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } - - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); - - opt = tidyGetOptionByName(obj->ptdoc->doc, optname); - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname); - RETURN_FALSE; - } - - optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC); - switch (optt) { - case TidyString: - RETURN_STRING((char *)optval, 0); - break; - - case TidyInteger: - RETURN_LONG((long)optval); - break; - - case TidyBoolean: - if (optval) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option"); - break; - } - - RETURN_FALSE; -} -/* }}} */ - -TIDY_DOC_METHOD(__construct) -{ - char *inputfile = NULL, *enc = NULL; - int input_len = 0, enc_len = 0, contents_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval *options = NULL; - - PHPTidyObj *obj; - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - if (inputfile) { - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - return; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC); - - efree(contents); - } -} - -TIDY_DOC_METHOD(parseFile) -{ - char *inputfile, *enc = NULL; - int input_len, enc_len = 0, contents_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval *options = NULL; - PHPTidyObj *obj; - - TIDY_SET_CONTEXT; - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - RETURN_FALSE; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) { - RETVAL_FALSE; - } else { - RETVAL_TRUE; - } - - efree(contents); -} - -TIDY_DOC_METHOD(parseString) -{ - char *input, *enc = NULL; - int input_len, enc_len = 0; - zval *options = NULL; - PHPTidyObj *obj; - - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) { - RETURN_FALSE; - } - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - - -/* {{{ proto TidyNode tidy_get_root() - Returns a TidyNode Object representing the root of the tidy parse tree */ -PHP_FUNCTION(tidy_get_root) -{ - TIDY_SET_CONTEXT; - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_root_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_html() - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -PHP_FUNCTION(tidy_get_html) -{ - TIDY_SET_CONTEXT; - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_html_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_head() - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -PHP_FUNCTION(tidy_get_head) -{ - TIDY_SET_CONTEXT; - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_head_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_body(resource tidy) - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -PHP_FUNCTION(tidy_get_body) -{ - TIDY_SET_CONTEXT; - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_body_node); -} -/* }}} */ - -/* {{{ proto tidyNode::tidyNode() - Constructor. */ -TIDY_NODE_METHOD(__construct) -{ -} -/* }}} */ - -/* {{{ proto boolean tidyNode::hasChildren() - Returns true if this node has children */ -TIDY_NODE_METHOD(hasChildren) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyGetChild(obj->node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::hasSiblings() - Returns true if this node has siblings */ -TIDY_NODE_METHOD(hasSiblings) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyGetNext(obj->node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isComment() - Returns true if this node represents a comment */ -TIDY_NODE_METHOD(isComment) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Comment) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isHtml() - Returns true if this node is part of a HTML document */ -TIDY_NODE_METHOD(isHtml) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) & (TidyNode_Start | TidyNode_End | TidyNode_StartEnd)) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isXhtml() - Returns true if this node is part of a XHTML document */ -TIDY_NODE_METHOD(isXhtml) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyDetectedXhtml(obj->ptdoc->doc)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isXml() - Returns true if this node is part of a XML document */ -TIDY_NODE_METHOD(isXml) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyDetectedGenericXml(obj->ptdoc->doc)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isText() - Returns true if this node represents text (no markup) */ -TIDY_NODE_METHOD(isText) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Text) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isJste() - Returns true if this node is JSTE */ -TIDY_NODE_METHOD(isJste) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Jste) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isAsp() - Returns true if this node is ASP */ -TIDY_NODE_METHOD(isAsp) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Asp) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isPhp() - Returns true if this node is PHP */ -TIDY_NODE_METHOD(isPhp) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Php) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS) -{ - TIDY_NODE_CONST(ROOT, Root); - TIDY_NODE_CONST(DOCTYPE, DocType); - TIDY_NODE_CONST(COMMENT, Comment); - TIDY_NODE_CONST(PROCINS, ProcIns); - TIDY_NODE_CONST(TEXT, Text); - TIDY_NODE_CONST(START, Start); - TIDY_NODE_CONST(END, End); - TIDY_NODE_CONST(STARTEND, StartEnd); - TIDY_NODE_CONST(CDATA, CDATA); - TIDY_NODE_CONST(SECTION, Section); - TIDY_NODE_CONST(ASP, Asp); - TIDY_NODE_CONST(JSTE, Jste); - TIDY_NODE_CONST(PHP, Php); - TIDY_NODE_CONST(XMLDECL, XmlDecl); -} - -static void _php_tidy_register_tags(INIT_FUNC_ARGS) -{ - TIDY_TAG_CONST(UNKNOWN); - TIDY_TAG_CONST(A); - TIDY_TAG_CONST(ABBR); - TIDY_TAG_CONST(ACRONYM); - TIDY_TAG_CONST(ADDRESS); - TIDY_TAG_CONST(ALIGN); - TIDY_TAG_CONST(APPLET); - TIDY_TAG_CONST(AREA); - TIDY_TAG_CONST(B); - TIDY_TAG_CONST(BASE); - TIDY_TAG_CONST(BASEFONT); - TIDY_TAG_CONST(BDO); - TIDY_TAG_CONST(BGSOUND); - TIDY_TAG_CONST(BIG); - TIDY_TAG_CONST(BLINK); - TIDY_TAG_CONST(BLOCKQUOTE); - TIDY_TAG_CONST(BODY); - TIDY_TAG_CONST(BR); - TIDY_TAG_CONST(BUTTON); - TIDY_TAG_CONST(CAPTION); - TIDY_TAG_CONST(CENTER); - TIDY_TAG_CONST(CITE); - TIDY_TAG_CONST(CODE); - TIDY_TAG_CONST(COL); - TIDY_TAG_CONST(COLGROUP); - TIDY_TAG_CONST(COMMENT); - TIDY_TAG_CONST(DD); - TIDY_TAG_CONST(DEL); - TIDY_TAG_CONST(DFN); - TIDY_TAG_CONST(DIR); - TIDY_TAG_CONST(DIV); - TIDY_TAG_CONST(DL); - TIDY_TAG_CONST(DT); - TIDY_TAG_CONST(EM); - TIDY_TAG_CONST(EMBED); - TIDY_TAG_CONST(FIELDSET); - TIDY_TAG_CONST(FONT); - TIDY_TAG_CONST(FORM); - TIDY_TAG_CONST(FRAME); - TIDY_TAG_CONST(FRAMESET); - TIDY_TAG_CONST(H1); - TIDY_TAG_CONST(H2); - TIDY_TAG_CONST(H3); - TIDY_TAG_CONST(H4); - TIDY_TAG_CONST(H5); - TIDY_TAG_CONST(H6); - TIDY_TAG_CONST(HEAD); - TIDY_TAG_CONST(HR); - TIDY_TAG_CONST(HTML); - TIDY_TAG_CONST(I); - TIDY_TAG_CONST(IFRAME); - TIDY_TAG_CONST(ILAYER); - TIDY_TAG_CONST(IMG); - TIDY_TAG_CONST(INPUT); - TIDY_TAG_CONST(INS); - TIDY_TAG_CONST(ISINDEX); - TIDY_TAG_CONST(KBD); - TIDY_TAG_CONST(KEYGEN); - TIDY_TAG_CONST(LABEL); - TIDY_TAG_CONST(LAYER); - TIDY_TAG_CONST(LEGEND); - TIDY_TAG_CONST(LI); - TIDY_TAG_CONST(LINK); - TIDY_TAG_CONST(LISTING); - TIDY_TAG_CONST(MAP); - TIDY_TAG_CONST(MARQUEE); - TIDY_TAG_CONST(MENU); - TIDY_TAG_CONST(META); - TIDY_TAG_CONST(MULTICOL); - TIDY_TAG_CONST(NOBR); - TIDY_TAG_CONST(NOEMBED); - TIDY_TAG_CONST(NOFRAMES); - TIDY_TAG_CONST(NOLAYER); - TIDY_TAG_CONST(NOSAVE); - TIDY_TAG_CONST(NOSCRIPT); - TIDY_TAG_CONST(OBJECT); - TIDY_TAG_CONST(OL); - TIDY_TAG_CONST(OPTGROUP); - TIDY_TAG_CONST(OPTION); - TIDY_TAG_CONST(P); - TIDY_TAG_CONST(PARAM); - TIDY_TAG_CONST(PLAINTEXT); - TIDY_TAG_CONST(PRE); - TIDY_TAG_CONST(Q); - TIDY_TAG_CONST(RB); - TIDY_TAG_CONST(RBC); - TIDY_TAG_CONST(RP); - TIDY_TAG_CONST(RT); - TIDY_TAG_CONST(RTC); - TIDY_TAG_CONST(RUBY); - TIDY_TAG_CONST(S); - TIDY_TAG_CONST(SAMP); - TIDY_TAG_CONST(SCRIPT); - TIDY_TAG_CONST(SELECT); - TIDY_TAG_CONST(SERVER); - TIDY_TAG_CONST(SERVLET); - TIDY_TAG_CONST(SMALL); - TIDY_TAG_CONST(SPACER); - TIDY_TAG_CONST(SPAN); - TIDY_TAG_CONST(STRIKE); - TIDY_TAG_CONST(STRONG); - TIDY_TAG_CONST(STYLE); - TIDY_TAG_CONST(SUB); - TIDY_TAG_CONST(SUP); - TIDY_TAG_CONST(TABLE); - TIDY_TAG_CONST(TBODY); - TIDY_TAG_CONST(TD); - TIDY_TAG_CONST(TEXTAREA); - TIDY_TAG_CONST(TFOOT); - TIDY_TAG_CONST(TH); - TIDY_TAG_CONST(THEAD); - TIDY_TAG_CONST(TITLE); - TIDY_TAG_CONST(TR); - TIDY_TAG_CONST(TT); - TIDY_TAG_CONST(U); - TIDY_TAG_CONST(UL); - TIDY_TAG_CONST(VAR); - TIDY_TAG_CONST(WBR); - TIDY_TAG_CONST(XMP); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tidy/tidy.dsp b/ext/tidy/tidy.dsp deleted file mode 100755 index fe44fa7a512e4..0000000000000 --- a/ext/tidy/tidy.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tidy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tidy - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tidy.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tidy.mak" CFG="tidy - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tidy - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "tidy - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tidy - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tidy.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "tidy - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tidy.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "tidy - Win32 Release_TS" -# Name "tidy - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tidy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_tidy.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/tokenizer/CREDITS b/ext/tokenizer/CREDITS deleted file mode 100644 index c2879dd4eede0..0000000000000 --- a/ext/tokenizer/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tokenizer -Andrei Zmievski diff --git a/ext/tokenizer/Makefile.frag b/ext/tokenizer/Makefile.frag deleted file mode 100644 index eaca6e7f4f7d9..0000000000000 --- a/ext/tokenizer/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -Zend/zend_language_parser.h: -$(builddir)/tokenizer.lo: Zend/zend_language_parser.h diff --git a/ext/tokenizer/config.m4 b/ext/tokenizer/config.m4 deleted file mode 100644 index eed403626e95f..0000000000000 --- a/ext/tokenizer/config.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension tokenizer - -dnl Otherwise use enable: - -PHP_ARG_ENABLE(tokenizer, whether to enable tokenizer support, -[ --disable-tokenizer Disable tokenizer support], yes) - -if test "$PHP_TOKENIZER" != "no"; then - PHP_NEW_EXTENSION(tokenizer, tokenizer.c, $ext_shared) - PHP_ADD_MAKEFILE_FRAGMENT -fi diff --git a/ext/tokenizer/config.w32 b/ext/tokenizer/config.w32 deleted file mode 100644 index 404b399057c56..0000000000000 --- a/ext/tokenizer/config.w32 +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("tokenizer", "tokenizer support", "yes"); - -if (PHP_TOKENIZER == "yes") { - EXTENSION("tokenizer", "tokenizer.c"); - AC_DEFINE("HAVE_TOKENIZER", 1, "Tokenizer support"); -} - - diff --git a/ext/tokenizer/package.xml b/ext/tokenizer/package.xml deleted file mode 100644 index 16757db7dfbda..0000000000000 --- a/ext/tokenizer/package.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - tokenizer - PHP Source code tokenizer - - - andrei - Andrei Zmievski - andrei@php.net - lead - - - -The tokenizer functions provide an interface to the PHP tokenizer -embedded in the Zend Engine. Using these functions you may write -your own PHP source analyzing or modification tools without having -to deal with the language specification at the lexical level. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h deleted file mode 100644 index 8033eeec43803..0000000000000 --- a/ext/tokenizer/php_tokenizer.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_TOKENIZER_H -#define PHP_TOKENIZER_H - -extern zend_module_entry tokenizer_module_entry; -#define phpext_tokenizer_ptr &tokenizer_module_entry - -#ifdef PHP_WIN32 -#define PHP_TOKENIZER_API __declspec(dllexport) -#else -#define PHP_TOKENIZER_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(tokenizer); -PHP_MSHUTDOWN_FUNCTION(tokenizer); -PHP_RINIT_FUNCTION(tokenizer); -PHP_RSHUTDOWN_FUNCTION(tokenizer); -PHP_MINFO_FUNCTION(tokenizer); - -PHP_FUNCTION(confirm_tokenizer_compiled); /* For testing, remove later. */ -PHP_FUNCTION(token_get_all); -PHP_FUNCTION(token_name); - -#ifdef ZTS -#define TOKENIZER_G(v) TSRMG(tokenizer_globals_id, zend_tokenizer_globals *, v) -#else -#define TOKENIZER_G(v) (tokenizer_globals.v) -#endif - -#endif /* PHP_TOKENIZER_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/tokenizer/tests/bug26463.phpt b/ext/tokenizer/tests/bug26463.phpt deleted file mode 100644 index 7480aa2f59f90..0000000000000 --- a/ext/tokenizer/tests/bug26463.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Bug #26463 (token_get_all() does not correctly handle semicolons after T_END_HEREDOC) ---FILE-- -'; -var_dump(token_get_all($str)); -?> ---EXPECTF-- -array(17) { - [0]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(6) " - array(2) { - [0]=> - int(%d) - [1]=> - string(2) "$x" - } - [2]=> - string(1) "=" - [3]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(6) "<<
              - array(2) { - [0]=> - int(%d) - [1]=> - string(13) "jhdsjkfhjdsh -" - } - [5]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(2) "DD" - } - [6]=> - string(1) "." - [7]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(2) """" - } - [8]=> - string(1) ";" - [9]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(1) " -" - } - [10]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - } - [11]=> - string(1) "=" - [12]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(8) "<< - array(2) { - [0]=> - int(%d) - [1]=> - string(13) "jhdsjkfhjdsh -" - } - [14]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(4) "DDDD" - } - [15]=> - string(1) ";" - [16]=> - array(2) { - [0]=> - int(%d) - [1]=> - string(2) "?>" - } -} diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c deleted file mode 100644 index 4d2f78893c2bc..0000000000000 --- a/ext/tokenizer/tokenizer.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_tokenizer.h" - -typedef struct yy_buffer_state *YY_BUFFER_STATE; -typedef unsigned int yy_size_t; -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -#include "zend.h" -#include "zend_language_scanner.h" -#include - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) -/* If you declare any globals in php_tokenizer.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(tokenizer) -*/ - -/* True global resources - no need for thread safety here */ -/* static int le_tokenizer; */ - -/* {{{ tokenizer_functions[] - * - * Every user visible function must have an entry in tokenizer_functions[]. - */ -function_entry tokenizer_functions[] = { - PHP_FE(token_get_all, NULL) - PHP_FE(token_name, NULL) - {NULL, NULL, NULL} /* Must be the last line in tokenizer_functions[] */ -}; -/* }}} */ - -/* {{{ tokenizer_module_entry - */ -zend_module_entry tokenizer_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "tokenizer", - tokenizer_functions, - PHP_MINIT(tokenizer), - PHP_MSHUTDOWN(tokenizer), - PHP_RINIT(tokenizer), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(tokenizer), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(tokenizer), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_TOKENIZER -ZEND_GET_MODULE(tokenizer) -#endif - -/* {{{ PHP_INI - */ -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("tokenizer.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_tokenizer_globals, tokenizer_globals) - STD_PHP_INI_ENTRY("tokenizer.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_tokenizer_globals, tokenizer_globals) -PHP_INI_END() -*/ -/* }}} */ - -/* {{{ php_tokenizer_init_globals - */ -/* Uncomment this function if you have INI entries -static void php_tokenizer_init_globals(zend_tokenizer_globals *tokenizer_globals) -{ - tokenizer_globals->global_value = 0; - tokenizer_globals->global_string = NULL; -} -*/ -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(tokenizer) -{ - /* If you have INI entries, uncomment these lines - ZEND_INIT_MODULE_GLOBALS(tokenizer, php_tokenizer_init_globals, NULL); - REGISTER_INI_ENTRIES(); - */ - - REGISTER_LONG_CONSTANT("T_INCLUDE", T_INCLUDE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INCLUDE_ONCE", T_INCLUDE_ONCE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EVAL", T_EVAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_REQUIRE", T_REQUIRE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_REQUIRE_ONCE", T_REQUIRE_ONCE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_OR", T_LOGICAL_OR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_XOR", T_LOGICAL_XOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_AND", T_LOGICAL_AND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PRINT", T_PRINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PLUS_EQUAL", T_PLUS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MINUS_EQUAL", T_MINUS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MUL_EQUAL", T_MUL_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DIV_EQUAL", T_DIV_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONCAT_EQUAL", T_CONCAT_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MOD_EQUAL", T_MOD_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_AND_EQUAL", T_AND_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OR_EQUAL", T_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_XOR_EQUAL", T_XOR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SL_EQUAL", T_SL_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SR_EQUAL", T_SR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOLEAN_OR", T_BOOLEAN_OR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOLEAN_AND", T_BOOLEAN_AND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_EQUAL", T_IS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_NOT_EQUAL", T_IS_NOT_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_IDENTICAL", T_IS_IDENTICAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_NOT_IDENTICAL", T_IS_NOT_IDENTICAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_SMALLER_OR_EQUAL", T_IS_SMALLER_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_GREATER_OR_EQUAL", T_IS_GREATER_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SL", T_SL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SR", T_SR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INC", T_INC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DEC", T_DEC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INT_CAST", T_INT_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_CAST", T_DOUBLE_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING_CAST", T_STRING_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ARRAY_CAST", T_ARRAY_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OBJECT_CAST", T_OBJECT_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOL_CAST", T_BOOL_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_UNSET_CAST", T_UNSET_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ELSEIF", T_ELSEIF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ELSE", T_ELSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDIF", T_ENDIF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LNUMBER", T_LNUMBER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DNUMBER", T_DNUMBER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING", T_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_VARIABLE", T_VARIABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INLINE_HTML", T_INLINE_HTML, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENCAPSED_AND_WHITESPACE", T_ENCAPSED_AND_WHITESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONSTANT_ENCAPSED_STRING", T_CONSTANT_ENCAPSED_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ECHO", T_ECHO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DO", T_DO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_WHILE", T_WHILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDWHILE", T_ENDWHILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FOR", T_FOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDFOR", T_ENDFOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FOREACH", T_FOREACH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDFOREACH", T_ENDFOREACH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DECLARE", T_DECLARE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDDECLARE", T_ENDDECLARE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_AS", T_AS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SWITCH", T_SWITCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDSWITCH", T_ENDSWITCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CASE", T_CASE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DEFAULT", T_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BREAK", T_BREAK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONTINUE", T_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FUNCTION", T_FUNCTION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONST", T_CONST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_RETURN", T_RETURN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_USE", T_USE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_GLOBAL", T_GLOBAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_VAR", T_VAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_UNSET", T_UNSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ISSET", T_ISSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EMPTY", T_EMPTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLASS", T_CLASS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INTERFACE", T_INTERFACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ARRAY", T_ARRAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLASS_C", T_CLASS_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FUNC_C", T_FUNC_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_METHOD_C", T_METHOD_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_COMMENT", T_COMMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOC_COMMENT", T_DOC_COMMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OPEN_TAG", T_OPEN_TAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OPEN_TAG_WITH_ECHO", T_OPEN_TAG_WITH_ECHO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLOSE_TAG", T_CLOSE_TAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_WHITESPACE", T_WHITESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_START_HEREDOC", T_START_HEREDOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_END_HEREDOC", T_END_HEREDOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOLLAR_OPEN_CURLY_BRACES", T_DOLLAR_OPEN_CURLY_BRACES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CURLY_OPEN", T_CURLY_OPEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PAAMAYIM_NEKUDOTAYIM", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CATCH", T_CATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INSTANCEOF", T_INSTANCEOF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(tokenizer) -{ - /* uncomment this line if you have INI entries - UNREGISTER_INI_ENTRIES(); - */ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request start */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(tokenizer) -{ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request end */ -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(tokenizer) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(tokenizer) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Tokenizer Support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -static void tokenize(zval *return_value TSRMLS_DC) -{ - zval token; - zval *keyword; - int token_type; - zend_bool destroy; - - CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; - - array_init(return_value); - - ZVAL_NULL(&token); - while ((token_type = lex_scan(&token TSRMLS_CC))) { - destroy = 1; - switch (token_type) { - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - case T_CLOSE_TAG: - destroy = 0; - break; - } - - if (token_type >= 256) { - MAKE_STD_ZVAL(keyword); - array_init(keyword); - add_next_index_long(keyword, token_type); - if (token_type == T_END_HEREDOC) { - add_next_index_stringl(keyword, Z_STRVAL(token), Z_STRLEN(token), 1); - efree(Z_STRVAL(token)); - } else { - add_next_index_stringl(keyword, zendtext, zendleng, 1); - } - add_next_index_zval(return_value, keyword); - } else { - add_next_index_stringl(return_value, zendtext, zendleng, 1); - } - if (destroy && Z_TYPE(token) != IS_NULL) { - zval_dtor(&token); - } - ZVAL_NULL(&token); - } -} - -static char * -get_token_type_name(int token_type) -{ - switch (token_type) { - case T_INCLUDE: return "T_INCLUDE"; - case T_INCLUDE_ONCE: return "T_INCLUDE_ONCE"; - case T_EVAL: return "T_EVAL"; - case T_REQUIRE: return "T_REQUIRE"; - case T_REQUIRE_ONCE: return "T_REQUIRE_ONCE"; - case T_LOGICAL_OR: return "T_LOGICAL_OR"; - case T_LOGICAL_XOR: return "T_LOGICAL_XOR"; - case T_LOGICAL_AND: return "T_LOGICAL_AND"; - case T_PRINT: return "T_PRINT"; - case T_PLUS_EQUAL: return "T_PLUS_EQUAL"; - case T_MINUS_EQUAL: return "T_MINUS_EQUAL"; - case T_MUL_EQUAL: return "T_MUL_EQUAL"; - case T_DIV_EQUAL: return "T_DIV_EQUAL"; - case T_CONCAT_EQUAL: return "T_CONCAT_EQUAL"; - case T_MOD_EQUAL: return "T_MOD_EQUAL"; - case T_AND_EQUAL: return "T_AND_EQUAL"; - case T_OR_EQUAL: return "T_OR_EQUAL"; - case T_XOR_EQUAL: return "T_XOR_EQUAL"; - case T_SL_EQUAL: return "T_SL_EQUAL"; - case T_SR_EQUAL: return "T_SR_EQUAL"; - case T_BOOLEAN_OR: return "T_BOOLEAN_OR"; - case T_BOOLEAN_AND: return "T_BOOLEAN_AND"; - case T_IS_EQUAL: return "T_IS_EQUAL"; - case T_IS_NOT_EQUAL: return "T_IS_NOT_EQUAL"; - case T_IS_IDENTICAL: return "T_IS_IDENTICAL"; - case T_IS_NOT_IDENTICAL: return "T_IS_NOT_IDENTICAL"; - case T_IS_SMALLER_OR_EQUAL: return "T_IS_SMALLER_OR_EQUAL"; - case T_IS_GREATER_OR_EQUAL: return "T_IS_GREATER_OR_EQUAL"; - case T_SL: return "T_SL"; - case T_SR: return "T_SR"; - case T_INC: return "T_INC"; - case T_DEC: return "T_DEC"; - case T_INT_CAST: return "T_INT_CAST"; - case T_DOUBLE_CAST: return "T_DOUBLE_CAST"; - case T_STRING_CAST: return "T_STRING_CAST"; - case T_ARRAY_CAST: return "T_ARRAY_CAST"; - case T_OBJECT_CAST: return "T_OBJECT_CAST"; - case T_BOOL_CAST: return "T_BOOL_CAST"; - case T_UNSET_CAST: return "T_UNSET_CAST"; - case T_NEW: return "T_NEW"; - case T_EXIT: return "T_EXIT"; - case T_IF: return "T_IF"; - case T_ELSEIF: return "T_ELSEIF"; - case T_ELSE: return "T_ELSE"; - case T_ENDIF: return "T_ENDIF"; - case T_LNUMBER: return "T_LNUMBER"; - case T_DNUMBER: return "T_DNUMBER"; - case T_STRING: return "T_STRING"; - case T_STRING_VARNAME: return "T_STRING_VARNAME"; - case T_VARIABLE: return "T_VARIABLE"; - case T_NUM_STRING: return "T_NUM_STRING"; - case T_INLINE_HTML: return "T_INLINE_HTML"; - case T_CHARACTER: return "T_CHARACTER"; - case T_BAD_CHARACTER: return "T_BAD_CHARACTER"; - case T_ENCAPSED_AND_WHITESPACE: return "T_ENCAPSED_AND_WHITESPACE"; - case T_CONSTANT_ENCAPSED_STRING: return "T_CONSTANT_ENCAPSED_STRING"; - case T_ECHO: return "T_ECHO"; - case T_DO: return "T_DO"; - case T_WHILE: return "T_WHILE"; - case T_ENDWHILE: return "T_ENDWHILE"; - case T_FOR: return "T_FOR"; - case T_ENDFOR: return "T_ENDFOR"; - case T_FOREACH: return "T_FOREACH"; - case T_ENDFOREACH: return "T_ENDFOREACH"; - case T_DECLARE: return "T_DECLARE"; - case T_ENDDECLARE: return "T_ENDDECLARE"; - case T_AS: return "T_AS"; - case T_SWITCH: return "T_SWITCH"; - case T_ENDSWITCH: return "T_ENDSWITCH"; - case T_CASE: return "T_CASE"; - case T_DEFAULT: return "T_DEFAULT"; - case T_BREAK: return "T_BREAK"; - case T_CONTINUE: return "T_CONTINUE"; - case T_FUNCTION: return "T_FUNCTION"; - case T_CONST: return "T_CONST"; - case T_RETURN: return "T_RETURN"; - case T_USE: return "T_USE"; - case T_GLOBAL: return "T_GLOBAL"; - case T_STATIC: return "T_STATIC"; - case T_VAR: return "T_VAR"; - case T_UNSET: return "T_UNSET"; - case T_ISSET: return "T_ISSET"; - case T_EMPTY: return "T_EMPTY"; - case T_CLASS: return "T_CLASS"; - case T_EXTENDS: return "T_EXTENDS"; - case T_INTERFACE: return "T_INTERFACE"; - case T_IMPLEMENTS: return "T_IMPLEMENTS"; - case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR"; - case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; - case T_LIST: return "T_LIST"; - case T_ARRAY: return "T_ARRAY"; - case T_CLASS_C: return "T_CLASS_C"; - case T_FUNC_C: return "T_FUNC_C"; - case T_METHOD_C: return "T_METHOD_C"; - case T_LINE: return "T_LINE"; - case T_FILE: return "T_FILE"; - case T_COMMENT: return "T_COMMENT"; - case T_OPEN_TAG: return "T_OPEN_TAG"; - case T_OPEN_TAG_WITH_ECHO: return "T_OPEN_TAG_WITH_ECHO"; - case T_CLOSE_TAG: return "T_CLOSE_TAG"; - case T_WHITESPACE: return "T_WHITESPACE"; - case T_START_HEREDOC: return "T_START_HEREDOC"; - case T_END_HEREDOC: return "T_END_HEREDOC"; - case T_DOLLAR_OPEN_CURLY_BRACES: return "T_DOLLAR_OPEN_CURLY_BRACES"; - case T_CURLY_OPEN: return "T_CURLY_OPEN"; - case T_PAAMAYIM_NEKUDOTAYIM: return "T_DOUBLE_COLON"; - case T_DOC_COMMENT: return "T_DOC_COMMENT"; - case T_ABSTRACT: return "T_ABSTRACT"; - case T_CATCH: return "T_CATCH"; - case T_FINAL: return "T_FINAL"; - case T_INSTANCEOF: return "T_INSTANCEOF"; - case T_PRIVATE: return "T_PRIVATE"; - case T_PROTECTED: return "T_PROTECTED"; - case T_PUBLIC: return "T_PUBLIC"; - case T_THROW: return "T_THROW"; - case T_TRY: return "T_TRY"; - case T_CLONE: return "T_CLONE"; - } - return "UNKNOWN"; -} - -/* {{{ proto array token_get_all(string source) - */ -PHP_FUNCTION(token_get_all) -{ - char *source = NULL; - int argc = ZEND_NUM_ARGS(); - int source_len; - zval source_z; - zend_lex_state original_lex_state; - - if (zend_parse_parameters(argc TSRMLS_CC, "s", &source, &source_len) == FAILURE) - return; - - ZVAL_STRINGL(&source_z, source, source_len, 1); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - if (zend_prepare_string_for_scanning(&source_z, "" TSRMLS_CC) == FAILURE) { - RETURN_EMPTY_STRING(); - } - - LANG_SCNG(start) = 1; - - tokenize(return_value TSRMLS_CC); - - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(&source_z); -} -/* }}} */ - -/* {{{ proto string token_name(int type) - */ -PHP_FUNCTION(token_name) -{ - int argc = ZEND_NUM_ARGS(); - long type; - - if (zend_parse_parameters(argc TSRMLS_CC, "l", &type) == FAILURE) { - return; - } - RETVAL_STRING(get_token_type_name(type), 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tokenizer/tokenizer.dsp b/ext/tokenizer/tokenizer.dsp deleted file mode 100644 index 9844574a8a820..0000000000000 --- a/ext/tokenizer/tokenizer.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tokenizer" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tokenizer - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tokenizer.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tokenizer.mak" CFG="tokenizer - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tokenizer - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "tokenizer - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tokenizer - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tokenizer.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "tokenizer - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tokenizer.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "tokenizer - Win32 Release_TS" -# Name "tokenizer - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tokenizer.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_tokenizer.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/tokenizer/tokenizer.php b/ext/tokenizer/tokenizer.php deleted file mode 100644 index c13063c628ac2..0000000000000 --- a/ext/tokenizer/tokenizer.php +++ /dev/null @@ -1,35 +0,0 @@ - diff --git a/ext/unicode/CREDITS b/ext/unicode/CREDITS deleted file mode 100644 index df6de5bf06a55..0000000000000 --- a/ext/unicode/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -unicode -Andrei Zmievski diff --git a/ext/unicode/EXPERIMENTAL b/ext/unicode/EXPERIMENTAL deleted file mode 100644 index 6443e99646410..0000000000000 --- a/ext/unicode/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/ext/unicode/config.m4 b/ext/unicode/config.m4 deleted file mode 100644 index 68d28870dc2a3..0000000000000 --- a/ext/unicode/config.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(unicode, whether to enable unicode functions, -[ --disable-unicode Disable Unicode API support]) - -if test "$PHP_UNICODE" != "no"; then - PHP_SUBST(UNICODE_SHARED_LIBADD) - AC_DEFINE(HAVE_UNICODE, 1, [ ]) - PHP_NEW_EXTENSION(unicode, unicode.c locale.c unicode_filter.c, $ext_shared) -fi - diff --git a/ext/unicode/config.w32 b/ext/unicode/config.w32 deleted file mode 100644 index d40047f023596..0000000000000 --- a/ext/unicode/config.w32 +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE('unicode' , 'ICU API extension', 'yes'); -if (PHP_UNICODE != 'no') { - EXTENSION("unicode", "unicode.c unicode_filter.c locale.c"); - AC_DEFINE('HAVE_UNICODE', 1, 'ICU API extension'); -} diff --git a/ext/unicode/locale.c b/ext/unicode/locale.c deleted file mode 100644 index b69eec132770c..0000000000000 --- a/ext/unicode/locale.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 6 | - +----------------------------------------------------------------------+ - | 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: Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php_unicode.h" - -#if HAVE_UNICODE -#include "unicode/ubrk.h" - -static void php_canonicalize_locale_id(char **target, int32_t *target_len, char *locale, UErrorCode *status) -{ - char *canonicalized = NULL; - int32_t canonicalized_len = 128; - - while (1) { - *status = U_ZERO_ERROR; - canonicalized = erealloc(canonicalized, canonicalized_len + 1); - canonicalized_len = uloc_canonicalize(locale, canonicalized, canonicalized_len, status); - if (*status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - - canonicalized[canonicalized_len] = 0; - *target = canonicalized; - *target_len = canonicalized_len; -} - -PHP_FUNCTION(i18n_loc_get_default) -{ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { - return; - } - - RETURN_STRING(UG(default_locale), 1); -} - -PHP_FUNCTION(i18n_loc_set_default) -{ - char *locale; - int locale_len; - char *canonicalized = NULL; - UErrorCode status = U_ZERO_ERROR; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &locale, &locale_len) == FAILURE) { - return; - } - - php_canonicalize_locale_id(&canonicalized, &locale_len, locale, &status); - /* - * UTODO: is this right? canonicalization does not seem to perform locale - * validation. - */ - if (U_FAILURE(status)) { - php_error(E_WARNING, "Invalid locale: %s", locale); - RETURN_FALSE; - } - /* don't bother if locales are identical */ - if (!strcmp(UG(default_locale), canonicalized)) { - efree(canonicalized); - RETURN_FALSE; - } - efree(UG(default_locale)); - UG(default_locale) = canonicalized; - zend_reset_locale_deps(TSRMLS_C); - RETURN_TRUE; -} - -/* {{{ php_strtotitle - */ -PHPAPI char *php_strtotitle(char *s, size_t len) -{ - s[0] = toupper(s[0]); - return s; -} -/* }}} */ - -/* {{{ php_u_strtotitle - */ -PHPAPI UChar* php_u_strtotitle(UChar **s, int32_t *len, const char* locale) -{ - UChar *dest = NULL; - int32_t dest_len; - UErrorCode status = U_ZERO_ERROR; - UBreakIterator *brkiter; - - dest_len = *len; - brkiter = ubrk_open(UBRK_TITLE, locale, *s, *len, &status); - while (1) { - status = U_ZERO_ERROR; - dest = eurealloc(dest, dest_len+1); - dest_len = u_strToTitle(dest, dest_len, *s, *len, NULL, locale, &status); - if (status != U_BUFFER_OVERFLOW_ERROR) { - break; - } - } - ubrk_close(brkiter); - - if (U_SUCCESS(status)) { - efree(*s); - dest[dest_len] = 0; - *s = dest; - *len = dest_len; - } else { - efree(dest); - } - - return *s; -} -/* }}} */ - - -/* {{{ proto string strtoupper(string str) - Makes a string uppercase */ -PHP_FUNCTION(i18n_strtotitle) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) { - WRONG_PARAM_COUNT; - } - if (Z_TYPE_PP(arg) != IS_STRING && Z_TYPE_PP(arg) != IS_UNICODE) { - convert_to_text_ex(arg); - } - - RETVAL_ZVAL(*arg, 1, 0); - php_u_strtotitle(&Z_USTRVAL_P(return_value), &Z_USTRLEN_P(return_value), UG(default_locale)); -} -/* }}} */ -#endif /* HAVE_UNICODE */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/unicode/package.xml b/ext/unicode/package.xml deleted file mode 100644 index 4a0606b2c6d7c..0000000000000 --- a/ext/unicode/package.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - unicode - ICU API extension - PHP - - - - andrei - Andrei Zmievski - andrei@php.net - lead - - - - - 1.0 - 2005-04-18 - unknown - - - - - EXPERIMENTAL - CREDITS - config.m4 - unicode.dsp - config.w32 - unicode.c - php_unicode.h - - - diff --git a/ext/unicode/php_unicode.h b/ext/unicode/php_unicode.h deleted file mode 100644 index b4e56845950d0..0000000000000 --- a/ext/unicode/php_unicode.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 6 | - +----------------------------------------------------------------------+ - | 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: Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_UNICODE_H -#define PHP_UNICODE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#ifdef HAVE_UNICODE - -#include -#include -#include - - -extern zend_module_entry unicode_module_entry; -#define phpext_unicode_ptr &unicode_module_entry - -#ifdef PHP_WIN32 -#define PHP_UNICODE_API __declspec(dllexport) -#else -#define PHP_UNICODE_API -#endif - -PHP_MINIT_FUNCTION(unicode); -PHP_MSHUTDOWN_FUNCTION(unicode); -PHP_RINIT_FUNCTION(unicode); -PHP_RSHUTDOWN_FUNCTION(unicode); -PHP_MINFO_FUNCTION(unicode); - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_FUNCTION(i18n_loc_get_default); -PHP_FUNCTION(i18n_loc_set_default); -PHP_FUNCTION(i18n_strtotitle); - -extern php_stream_filter_factory php_unicode_filter_factory; - -#ifdef __cplusplus -} // extern "C" -#endif - -#include -#include -#endif /* PHP_HAVE_UNICODE */ - -#endif /* PHP_UNICODE_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/unicode/unicode.c b/ext/unicode/unicode.c deleted file mode 100644 index 88759f4d23cf5..0000000000000 --- a/ext/unicode/unicode.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 6 | - +----------------------------------------------------------------------+ - | 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: Andrei Zmievski | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php_unicode.h" -#if HAVE_UNICODE -#include "zend_unicode.h" - -/* {{{ proto unicode unicode_decode(string input, string encoding) - Takes a string in the source encoding and converts it to a UTF-16 unicode string, returning the result */ -static PHP_FUNCTION(unicode_decode) -{ - union { - void *vptr; - char *bin; - } input; - zend_uchar type; - int len; - char *encoding; - int enclen; - UErrorCode status; - UConverter *conv = NULL; - UChar *target; - int32_t targetlen; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ts", &input.vptr, &len, &type, &encoding, &enclen)) { - return; - } - - if (type == IS_UNICODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "input string is already unicode"); - RETURN_FALSE; - } - - status = U_ZERO_ERROR; - conv = ucnv_open(encoding, &status); - if (!conv) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not locate converter for %s", encoding); - RETURN_FALSE; - } - - status = U_ZERO_ERROR; - zend_convert_to_unicode(conv, &target, &targetlen, input.bin, len, &status); - if (U_FAILURE(status)) { - /* TODO: error handling semantics ? */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "conversion was not entirely successful: %d", status); - } - RETVAL_UNICODEL(target, targetlen, 0); - - ucnv_close(conv); -} -/* }}} */ - -/* {{{ proto string unicode_encode(unicode input, string encoding) - Takes a unicode string and converts it to a string in the specified encoding */ -static PHP_FUNCTION(unicode_encode) -{ - UChar *uni; - int len; - char *encoding; - int enclen; - UErrorCode status; - UConverter *conv = NULL; - char *target; - int32_t targetlen; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "us", &uni, &len, &encoding, &enclen)) { - return; - } - - status = U_ZERO_ERROR; - conv = ucnv_open(encoding, &status); - if (!conv) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not locate converter for %s", encoding); - RETURN_FALSE; - } - - status = U_ZERO_ERROR; - zend_convert_from_unicode(conv, &target, &targetlen, uni, len, &status); - if (U_FAILURE(status)) { - /* TODO: error handling semantics ? */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "conversion was not entirely successful: %d", status); - } - RETVAL_STRINGL(target, targetlen, 0); - - ucnv_close(conv); -} -/* {{{ unicode_functions[] */ -function_entry unicode_functions[] = { - PHP_FE(i18n_loc_get_default, NULL) - PHP_FE(i18n_loc_set_default, NULL) - PHP_FE(unicode_decode, NULL) - PHP_FE(unicode_encode, NULL) - PHP_FE(i18n_strtotitle, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - - -/* {{{ unicode_module_entry - */ -zend_module_entry unicode_module_entry = { - STANDARD_MODULE_HEADER, - "unicode", - unicode_functions, - PHP_MINIT(unicode), /* Replace with NULL if there is nothing to do at php startup */ - PHP_MSHUTDOWN(unicode), /* Replace with NULL if there is nothing to do at php shutdown */ - PHP_RINIT(unicode), /* Replace with NULL if there is nothing to do at request start */ - PHP_RSHUTDOWN(unicode), /* Replace with NULL if there is nothing to do at request end */ - PHP_MINFO(unicode), - "1.0", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_UNICODE -ZEND_GET_MODULE(unicode) -#endif - - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(unicode) -{ - if (php_stream_filter_register_factory("unicode.*", &php_unicode_filter_factory TSRMLS_CC) == FAILURE) { - return FAILURE; - } - /* add your stuff here */ - - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(unicode) -{ - if (php_stream_filter_unregister_factory("unicode.*" TSRMLS_CC) == FAILURE) { - return FAILURE; - } - /* add your stuff here */ - - - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(unicode) -{ - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(unicode) -{ - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(unicode) -{ - php_info_print_box_start(0); - php_printf("ICU API extension\n"); - php_printf("Based on ICU library %s\n", U_COPYRIGHT_STRING); - php_printf("ICU Version %s\n", U_ICU_VERSION); - php_info_print_box_end(); - /* add your stuff here */ - -} -/* }}} */ - - -#endif /* HAVE_UNICODE */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/unicode/unicode.dsp b/ext/unicode/unicode.dsp deleted file mode 100644 index efc8ab6eaea36..0000000000000 --- a/ext/unicode/unicode.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="unicode" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=unicode - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "unicode.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "unicode.mak" CFG="unicode - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "unicode - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "unicode - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "unicode - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UNICODE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_UNICODE" /D ZTS=1 /D HAVE_UNICODE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_unicode.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "unicode - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UNICODE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_UNICODE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_UNICODE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_unicode.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "unicode - Win32 Release_TS" -# Name "unicode - Win32 Debug_TS" - -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - -# Begin Source File - -SOURCE=.\unicode.c -# End Source File - -# End Group - -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" - -# Begin Source File - -SOURCE=.\php_unicode.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/unicode/unicode_filter.c b/ext/unicode/unicode_filter.c deleted file mode 100644 index 3f28c9b09a7f8..0000000000000 --- a/ext/unicode/unicode_filter.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 6 | - +----------------------------------------------------------------------+ - | 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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#include "php.h" -#include - -/* {{{ data structure */ -typedef struct _php_unicode_filter_data { - char is_persistent; - UConverter *conv; - - char to_unicode; -} php_unicode_filter_data; -/* }}} */ - -/* {{{ unicode.* filter implementation */ - -/* unicode.to.* -- Expects String -- Returns Unicode */ -static php_stream_filter_status_t php_unicode_to_string_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_unicode_filter_data *data; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - size_t consumed = 0; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_unicode_filter_data *)(thisfilter->abstract); - while (buckets_in->head) { - php_stream_bucket *bucket = buckets_in->head; - UChar *src = bucket->buf.ustr.val; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - if (!bucket->is_unicode) { - /* Already ASCII, can't really do anything with it */ - consumed += bucket->buf.str.len; - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - continue; - } - - while (src < (bucket->buf.ustr.val + bucket->buf.ustr.len)) { - int remaining = bucket->buf.ustr.len - (src - bucket->buf.ustr.val); - char *destp, *destbuf; - int32_t destlen = UCNV_GET_MAX_BYTES_FOR_STRING(remaining, ucnv_getMaxCharSize(data->conv)); - UErrorCode errCode = U_ZERO_ERROR; - php_stream_bucket *new_bucket; - - destp = destbuf = (char *)pemalloc(destlen, data->is_persistent); - - ucnv_fromUnicode(data->conv, &destp, destbuf + destlen, (const UChar**)&src, src + remaining, NULL, FALSE, &errCode); - new_bucket = php_stream_bucket_new(stream, destbuf, destp - destbuf, 1, data->is_persistent TSRMLS_CC); - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - } - consumed += UBYTES(bucket->buf.ustr.len); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - UErrorCode errCode = U_ZERO_ERROR; - char d[64], *dest = d, *destp = d + 64; - /* Spit it out! */ - - ucnv_fromUnicode(data->conv, &dest, destp, NULL, NULL, NULL, TRUE, &errCode); - if (dest > d) { - php_stream_bucket *bucket = php_stream_bucket_new(stream, d, dest - d, 0, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -/* unicode.from.* -- Expects Unicode -- Returns String */ -static php_stream_filter_status_t php_unicode_from_string_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_unicode_filter_data *data; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - size_t consumed = 0; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_unicode_filter_data *)(thisfilter->abstract); - while (buckets_in->head) { - php_stream_bucket *bucket = buckets_in->head; - char *src = bucket->buf.str.val; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - if (bucket->is_unicode) { - /* already in unicode, nothing to do */ - consumed += UBYTES(bucket->buf.ustr.len); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - continue; - } - - while (src < (bucket->buf.str.val + bucket->buf.str.len)) { - int remaining = bucket->buf.str.len - (src - bucket->buf.str.val); - UChar *destp, *destbuf; - int32_t destlen = UCNV_GET_MAX_BYTES_FOR_STRING(remaining, ucnv_getMaxCharSize(data->conv)); - UErrorCode errCode = U_ZERO_ERROR; - php_stream_bucket *new_bucket; - - destp = destbuf = (UChar *)pemalloc(destlen, data->is_persistent); - - ucnv_toUnicode(data->conv, &destp, (UChar*)((char*)destbuf + destlen), (const char**)&src, src + remaining, NULL, FALSE, &errCode); - - new_bucket = php_stream_bucket_new_unicode(stream, destbuf, destp - destbuf, 1, data->is_persistent TSRMLS_CC); - php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - } - consumed += bucket->buf.str.len; - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - UErrorCode errCode = U_ZERO_ERROR; - UChar d[64], *dest = d, *destp = d + 64; - /* Spit it out! */ - - ucnv_toUnicode(data->conv, &dest, destp, NULL, NULL, NULL, TRUE, &errCode); - if (dest > d) { - php_stream_bucket *bucket = php_stream_bucket_new_unicode(stream, d, dest - d, 0, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - exit_status = PSFS_PASS_ON; - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -/* unicode.tidy.* -- Expects anything -- Returns whatever is preferred by subsequent filters - Can be used to "magically" fix-up bucket messes */ -static php_stream_filter_status_t php_unicode_tidy_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_unicode_filter_data *data; - int prefer_unicode = php_stream_filter_output_prefer_unicode(thisfilter); - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_unicode_filter_data *)(thisfilter->abstract); - - if (prefer_unicode) { - if (!data->to_unicode) { - ucnv_resetToUnicode(data->conv); - data->to_unicode = prefer_unicode; - } - return php_unicode_from_string_filter(stream, thisfilter, buckets_in, buckets_out, bytes_consumed, flags TSRMLS_CC); - } else { - if (data->to_unicode) { - ucnv_resetFromUnicode(data->conv); - data->to_unicode = prefer_unicode; - } - return php_unicode_to_string_filter(stream, thisfilter, buckets_in, buckets_out, bytes_consumed, flags TSRMLS_CC); - } -} - -static void php_unicode_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_unicode_filter_data *data = (php_unicode_filter_data *)thisfilter->abstract; - ucnv_close(data->conv); - pefree(data, data->is_persistent); - } -} - -static php_stream_filter_ops php_unicode_to_string_filter_ops = { - php_unicode_to_string_filter, - php_unicode_filter_dtor, - "unicode.to.*", - PSFO_FLAG_ACCEPTS_UNICODE | PSFO_FLAG_OUTPUTS_STRING -}; - -static php_stream_filter_ops php_unicode_from_string_filter_ops = { - php_unicode_from_string_filter, - php_unicode_filter_dtor, - "unicode.from.*", - PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_OUTPUTS_UNICODE -}; - -static php_stream_filter_ops php_unicode_tidy_filter_ops = { - php_unicode_tidy_filter, - php_unicode_filter_dtor, - "unicode.tidy.*", - PSFO_FLAG_ACCEPTS_ANY | PSFO_FLAG_OUTPUTS_ANY -}; -/* }}} */ - - -/* {{{ unicode.* factory */ - -static php_stream_filter *php_unicode_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_unicode_filter_data *data; - const char *charset, *direction; - php_stream_filter_ops *fops; - UErrorCode ucnvError = U_ZERO_ERROR; - char to_unicode = 0; - - if (strncasecmp(filtername, "unicode.", sizeof("unicode.") - 1)) { - /* Never happens */ - return NULL; - } - - direction = filtername + sizeof("unicode.") - 1; - if (strncmp(direction, "to.", sizeof("to.") - 1) == 0) { - fops = &php_unicode_to_string_filter_ops; - charset = direction + sizeof("to.") - 1; - } else if (strncmp(direction, "from.", sizeof("from.") - 1) == 0) { - fops = &php_unicode_from_string_filter_ops; - to_unicode = 1; - charset = direction + sizeof("from.") - 1; - } else if (strncmp(direction, "tidy.", sizeof("tidy.") - 1) == 0) { - fops = &php_unicode_tidy_filter_ops; - charset = direction + sizeof("tidy.") - 1; - } else if (strcmp(direction, "tidy") == 0) { - fops = &php_unicode_tidy_filter_ops; - charset = "utf8"; - } else { - /* Shouldn't happen */ - return NULL; - } - - /* Create this filter */ - data = (php_unicode_filter_data *)pecalloc(1, sizeof(php_unicode_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed allocating %d bytes.", sizeof(php_unicode_filter_data)); - return NULL; - } - - data->conv = ucnv_open(charset, &ucnvError); - data->to_unicode = to_unicode; - if (!data->conv) { - char *reason = "Unknown Error"; - pefree(data, persistent); - switch (ucnvError) { - case U_MEMORY_ALLOCATION_ERROR: - reason = "unable to allocate memory"; - break; - case U_FILE_ACCESS_ERROR: - reason = "file access error"; - break; - default: - ; - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open charset converter, %s", reason); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_unicode_filter_factory = { - php_unicode_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ - diff --git a/ext/wddx/CREDITS b/ext/wddx/CREDITS deleted file mode 100644 index 4c98513048e0f..0000000000000 --- a/ext/wddx/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -WDDX -Andrei Zmievski diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4 deleted file mode 100644 index 25f366e9581f3..0000000000000 --- a/ext/wddx/config.m4 +++ /dev/null @@ -1,15 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(wddx,whether to enable WDDX support, -[ --enable-wddx Enable WDDX support]) - -if test "$PHP_WDDX" != "no"; then - if test "$ext_shared" != "yes" && test "$enable_xml" = "no"; then - AC_MSG_WARN(Activating XML) - enable_xml=yes - fi - AC_DEFINE(HAVE_WDDX, 1, [ ]) - PHP_NEW_EXTENSION(wddx, wddx.c, $ext_shared) -fi diff --git a/ext/wddx/config.w32 b/ext/wddx/config.w32 deleted file mode 100644 index 7b8483d0aa1b0..0000000000000 --- a/ext/wddx/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("wddx", "WDDX support", "yes"); - -if (PHP_WDDX == "yes" && PHP_LIBXML == "yes") { - EXTENSION("wddx", "wddx.c"); - AC_DEFINE("HAVE_WDDX", 1, "WDDX support"); - ADD_EXTENSION_DEP('wddx', 'libxml'); - CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_WDDX", "ext/date/lib"); -} - - diff --git a/ext/wddx/package.xml b/ext/wddx/package.xml deleted file mode 100644 index 4351d356bbe7a..0000000000000 --- a/ext/wddx/package.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - wddx - WDDX serialization functions - - - andrei - Andrei Zmievski - andrei@php.net - lead - - - -These functions are intended for work with WDDX (http://www.openwddx.org/) - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h deleted file mode 100644 index c95c221d1f952..0000000000000 --- a/ext/wddx/php_wddx.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_WDDX_H -#define PHP_WDDX_H - -#if HAVE_WDDX - -extern zend_module_entry wddx_module_entry; -#define wddx_module_ptr &wddx_module_entry - -PHP_FUNCTION(wddx_serialize_value); -PHP_FUNCTION(wddx_serialize_vars); -PHP_FUNCTION(wddx_packet_start); -PHP_FUNCTION(wddx_packet_end); -PHP_FUNCTION(wddx_add_vars); -PHP_FUNCTION(wddx_unserialize); - -#else - -#define wddx_module_ptr NULL - -#endif /* HAVE_WDDX */ - -#define phpext_wddx_ptr wddx_module_ptr - -#endif /* !PHP_WDDX_H */ diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h deleted file mode 100644 index 1c34f173c556f..0000000000000 --- a/ext/wddx/php_wddx_api.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_WDDX_API_H -#define PHP_WDDX_API_H - -#include "ext/standard/php_smart_str.h" - -#define WDDX_ARRAY_S "" -#define WDDX_ARRAY_E "" -#define WDDX_BINARY_S "" -#define WDDX_BINARY_E "" -#define WDDX_BOOLEAN "" -#define WDDX_CHAR "" -#define WDDX_COMMENT_S "" -#define WDDX_COMMENT_E "" -#define WDDX_DATA_S "" -#define WDDX_DATA_E "" -#define WDDX_HEADER "
              " -#define WDDX_HEADER_S "
              " -#define WDDX_HEADER_E "
              " -#define WDDX_NULL "" -#define WDDX_NUMBER "%s" -#define WDDX_PACKET_S "" -#define WDDX_PACKET_E "" -#define WDDX_STRING_S "" -#define WDDX_STRING_E "" -#define WDDX_STRUCT_S "" -#define WDDX_STRUCT_E "" -#define WDDX_VAR_S "" -#define WDDX_VAR_E "" - -#define php_wddx_add_chunk(packet, str) smart_str_appends(packet, str) -#define php_wddx_add_chunk_ex(packet, str, len) smart_str_appendl(packet, str, len) -#define php_wddx_add_chunk_static(packet, str) smart_str_appendl(packet, str, sizeof(str)-1) - -typedef smart_str wddx_packet; - -wddx_packet* php_wddx_constructor(void); -void php_wddx_destructor(wddx_packet *packet); - -void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len); -void php_wddx_packet_end(wddx_packet *packet); - -void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC); -int php_wddx_unserialize_ex(char *, int, zval *return_value); -#define php_wddx_gather(packet) estrndup(packet->c, packet->len) - -#endif /* PHP_WDDX_API_H */ diff --git a/ext/wddx/tests/001.phpt b/ext/wddx/tests/001.phpt deleted file mode 100644 index 825d6857331bc..0000000000000 --- a/ext/wddx/tests/001.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -wddx unserialization test ---FILE-- - ---EXPECT-- -array(11) { - ["aNull"]=> - NULL - ["aString"]=> - string(8) "a string" - ["aNumber"]=> - float(-12.456) - ["aDateTime"]=> - int(897625932) - ["aDateTime2"]=> - int(329632332) - ["aDateTime3"]=> - string(22) "2040-06-12T04:32:12+00" - ["aBoolean"]=> - bool(true) - ["anArray"]=> - array(2) { - [0]=> - int(10) - [1]=> - string(14) "second element" - } - ["aBinary"]=> - string(11) "binary data" - ["anObject"]=> - array(2) { - ["s"]=> - string(8) "a string" - ["n"]=> - float(-12.456) - } - ["aRecordset"]=> - array(2) { - ["NAME"]=> - array(2) { - [0]=> - string(8) "John Doe" - [1]=> - string(8) "Jane Doe" - } - ["AGE"]=> - array(2) { - [0]=> - int(34) - [1]=> - int(31) - } - } -} diff --git a/ext/wddx/tests/bug27287.phpt b/ext/wddx/tests/bug27287.phpt deleted file mode 100755 index 9029e1c88c47e..0000000000000 --- a/ext/wddx/tests/bug27287.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #27287 (segfault with unserializing object data) ---FILE-- -abc = 'def'; - - $string = wddx_serialize_value($foo); - $bar = wddx_unserialize($string); - - echo "OK\n"; - -?> ---EXPECT-- -OK diff --git a/ext/wddx/tests/bug34306.phpt b/ext/wddx/tests/bug34306.phpt deleted file mode 100755 index 2212dad91809d..0000000000000 --- a/ext/wddx/tests/bug34306.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -#34306 (wddx_serialize_value() crashes with long array keys) ---FILE-- - 1); -$buf = wddx_serialize_value($var, 'name'); -echo "OK\n"; - -?> ---EXPECT-- -OK diff --git a/ext/wddx/tests/wddx.xml b/ext/wddx/tests/wddx.xml deleted file mode 100644 index 00857095c9809..0000000000000 --- a/ext/wddx/tests/wddx.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - -
              - - - - - - - a string - - - -12.456 - - - 1998-06-12T04:32:12+00 - - - 1980-06-12T04:32:12+00 - - - 2040-06-12T04:32:12+00 - - - - - - - 10 - second element - - - - YmluYXJ5IGRhdGE= - - - - - a string - - - -12.456 - - - - - - - John Doe - Jane Doe - - - 34 - 31 - - - - - diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c deleted file mode 100644 index ff6744a01d0e5..0000000000000 --- a/ext/wddx/wddx.c +++ /dev/null @@ -1,1380 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if HAVE_WDDX - -#include "ext/xml/expat_compat.h" -#include "php_wddx.h" -#include "php_wddx_api.h" - -#define PHP_XML_INTERNAL -#include "ext/xml/php_xml.h" -#include "ext/standard/php_incomplete_class.h" -#include "ext/standard/base64.h" -#include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/html.h" -#include "ext/standard/php_string.h" -#include "ext/date/php_date.h" - -#define WDDX_BUF_LEN 256 -#define PHP_CLASS_NAME_VAR "php_class_name" - -#define EL_ARRAY "array" -#define EL_BINARY "binary" -#define EL_BOOLEAN "boolean" -#define EL_CHAR "char" -#define EL_CHAR_CODE "code" -#define EL_NULL "null" -#define EL_NUMBER "number" -#define EL_PACKET "wddxPacket" -#define EL_STRING "string" -#define EL_STRUCT "struct" -#define EL_VALUE "value" -#define EL_VAR "var" -#define EL_NAME "name" -#define EL_VERSION "version" -#define EL_RECORDSET "recordset" -#define EL_FIELD "field" -#define EL_DATETIME "dateTime" - -#define php_wddx_unserialize(a,b) \ - php_wddx_unserialize_ex((a)->value.str.val, (a)->value.str.len, (b)) - -#define SET_STACK_VARNAME \ - if (stack->varname) { \ - ent.varname = estrdup(stack->varname); \ - efree(stack->varname); \ - stack->varname = NULL; \ - } else \ - ent.varname = NULL; \ - -static int le_wddx; - -typedef struct { - zval *data; - enum { - ST_ARRAY, - ST_BOOLEAN, - ST_NULL, - ST_NUMBER, - ST_STRING, - ST_BINARY, - ST_STRUCT, - ST_RECORDSET, - ST_FIELD, - ST_DATETIME - } type; - char *varname; -} st_entry; - -typedef struct { - int top, max; - char *varname; - zend_bool done; - void **elements; -} wddx_stack; - - -static void php_wddx_process_data(void *user_data, const XML_Char *s, int len); - -/* {{{ wddx_functions[] - */ -function_entry wddx_functions[] = { - PHP_FE(wddx_serialize_value, NULL) - PHP_FE(wddx_serialize_vars, NULL) - PHP_FE(wddx_packet_start, NULL) - PHP_FE(wddx_packet_end, NULL) - PHP_FE(wddx_add_vars, NULL) - PHP_FE(wddx_unserialize, NULL) - PHP_FALIAS(wddx_deserialize, wddx_unserialize, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHP_MINIT_FUNCTION(wddx); -PHP_MINFO_FUNCTION(wddx); - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_WDDX -ZEND_GET_MODULE(wddx) -#endif /* COMPILE_DL_WDDX */ -/* }}} */ - -/* {{{ wddx_module_entry - */ -zend_module_entry wddx_module_entry = { - STANDARD_MODULE_HEADER, - "wddx", - wddx_functions, - PHP_MINIT(wddx), - NULL, - NULL, - NULL, - PHP_MINFO(wddx), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ wddx_stack_init - */ -static int wddx_stack_init(wddx_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) safe_emalloc(sizeof(void **), STACK_BLOCK_SIZE, 0); - stack->max = STACK_BLOCK_SIZE; - stack->varname = NULL; - stack->done = 0; - - return SUCCESS; -} -/* }}} */ - -/* {{{ wddx_stack_push - */ -static int wddx_stack_push(wddx_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} -/* }}} */ - -/* {{{ wddx_stack_top - */ -static int wddx_stack_top(wddx_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} -/* }}} */ - -/* {{{ wddx_stack_is_empty - */ -static int wddx_stack_is_empty(wddx_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ wddx_stack_destroy - */ -static int wddx_stack_destroy(wddx_stack *stack) -{ - register int i; - - if (stack->elements) { - for (i = 0; i < stack->top; i++) { - if (((st_entry *)stack->elements[i])->data) - { - zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); - } - if (((st_entry *)stack->elements[i])->varname) - efree(((st_entry *)stack->elements[i])->varname); - efree(stack->elements[i]); - } - efree(stack->elements); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ release_wddx_packet_rsrc - */ -static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - smart_str *str = (smart_str *)rsrc->ptr; - smart_str_free(str); - efree(str); -} -/* }}} */ - -#include "ext/session/php_session.h" - -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) -/* {{{ PS_SERIALIZER_ENCODE_FUNC - */ -PS_SERIALIZER_ENCODE_FUNC(wddx) -{ - wddx_packet *packet; - PS_ENCODE_VARS; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, NULL, 0); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - PS_ENCODE_LOOP( - php_wddx_serialize_var(packet, *struc, key, key_length TSRMLS_CC); - ); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - php_wddx_packet_end(packet); - *newstr = php_wddx_gather(packet); - php_wddx_destructor(packet); - - if (newlen) - *newlen = strlen(*newstr); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PS_SERIALIZER_DECODE_FUNC - */ -PS_SERIALIZER_DECODE_FUNC(wddx) -{ - zval *retval; - zval **ent; - char *key; - uint key_length; - char tmp[128]; - ulong idx; - int hash_type; - int ret; - - if (vallen == 0) - return SUCCESS; - - MAKE_STD_ZVAL(retval); - - if ((ret = php_wddx_unserialize_ex((char *)val, vallen, retval)) == SUCCESS) { - - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(retval)); - zend_hash_get_current_data(Z_ARRVAL_P(retval), (void **) &ent) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(retval))) { - hash_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(retval), &key, &key_length, &idx, 0, NULL); - - switch (hash_type) { - case HASH_KEY_IS_LONG: - sprintf(tmp, "%ld", idx); - key = tmp; - /* fallthru */ - case HASH_KEY_IS_STRING: - php_set_session_var(key, key_length-1, *ent, NULL TSRMLS_CC); - PS_ADD_VAR(key); - } - } - } - - zval_ptr_dtor(&retval); - - return ret; -} -/* }}} */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(wddx) -{ - le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number); - -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - php_session_register_serializer("wddx", - PS_SERIALIZER_ENCODE_NAME(wddx), - PS_SERIALIZER_DECODE_NAME(wddx)); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(wddx) -{ - php_info_print_table_start(); -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - php_info_print_table_header(2, "WDDX Support", "enabled" ); - php_info_print_table_row(2, "WDDX Session Serializer", "enabled" ); -#else - php_info_print_table_row(2, "WDDX Support", "enabled" ); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_wddx_packet_start - */ -void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len) -{ - php_wddx_add_chunk_static(packet, WDDX_PACKET_S); - if (comment) { - php_wddx_add_chunk_static(packet, WDDX_HEADER_S); - php_wddx_add_chunk_static(packet, WDDX_COMMENT_S); - php_wddx_add_chunk_ex(packet, comment, comment_len); - php_wddx_add_chunk_static(packet, WDDX_COMMENT_E); - php_wddx_add_chunk_static(packet, WDDX_HEADER_E); - } else - php_wddx_add_chunk_static(packet, WDDX_HEADER); - php_wddx_add_chunk_static(packet, WDDX_DATA_S); -} -/* }}} */ - -/* {{{ php_wddx_packet_end - */ -void php_wddx_packet_end(wddx_packet *packet) -{ - php_wddx_add_chunk_static(packet, WDDX_DATA_E); - php_wddx_add_chunk_static(packet, WDDX_PACKET_E); -} -/* }}} */ - -#define FLUSH_BUF() \ - if (l > 0) { \ - php_wddx_add_chunk_ex(packet, buf, l); \ - l = 0; \ - } - -/* {{{ php_wddx_serialize_string - */ -static void php_wddx_serialize_string(wddx_packet *packet, zval *var) -{ - char *buf, - *p, - *vend, - control_buf[WDDX_BUF_LEN]; - int l; - - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - - if (Z_STRLEN_P(var) > 0) { - l = 0; - vend = Z_STRVAL_P(var) + Z_STRLEN_P(var); - buf = (char *)emalloc(Z_STRLEN_P(var) + 1); - - for(p = Z_STRVAL_P(var); p != vend; p++) { - switch (*p) { - case '<': - FLUSH_BUF(); - php_wddx_add_chunk_static(packet, "<"); - break; - - case '&': - FLUSH_BUF(); - php_wddx_add_chunk_static(packet, "&"); - break; - - case '>': - FLUSH_BUF(); - php_wddx_add_chunk_static(packet, ">"); - break; - - default: - if (iscntrl((int)*(unsigned char *)p)) { - FLUSH_BUF(); - sprintf(control_buf, WDDX_CHAR, *p); - php_wddx_add_chunk(packet, control_buf); - } else - buf[l++] = *p; - break; - } - } - - FLUSH_BUF(); - efree(buf); - } - - php_wddx_add_chunk_static(packet, WDDX_STRING_E); -} -/* }}} */ - -/* {{{ php_wddx_serialize_number - */ -static void php_wddx_serialize_number(wddx_packet *packet, zval *var) -{ - char tmp_buf[WDDX_BUF_LEN]; - zval tmp; - - tmp = *var; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp)); - zval_dtor(&tmp); - - php_wddx_add_chunk(packet, tmp_buf); -} -/* }}} */ - -/* {{{ php_wddx_serialize_boolean - */ -static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var) -{ - char tmp_buf[WDDX_BUF_LEN]; - - sprintf(tmp_buf, WDDX_BOOLEAN, Z_LVAL_P(var) ? "true" : "false"); - php_wddx_add_chunk(packet, tmp_buf); -} -/* }}} */ - -/* {{{ php_wddx_serialize_unset - */ -static void php_wddx_serialize_unset(wddx_packet *packet) -{ - php_wddx_add_chunk_static(packet, WDDX_NULL); -} -/* }}} */ - -/* {{{ php_wddx_serialize_object - */ -static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) -{ -/* OBJECTS_FIXME */ - zval **ent, *fname, **varname; - zval *retval = NULL; - char *key; - ulong idx; - char tmp_buf[WDDX_BUF_LEN]; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(fname); - ZVAL_STRING(fname, "__sleep", 1); - - /* - * We try to call __sleep() method on object. It's supposed to return an - * array of property names to be serialized. - */ - if (call_user_function_ex(CG(function_table), &obj, fname, &retval, 0, 0, 1, NULL TSRMLS_CC) == SUCCESS) { - if (retval && HASH_OF(retval)) { - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(obj); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - sprintf(tmp_buf, WDDX_VAR_S, PHP_CLASS_NAME_VAR); - php_wddx_add_chunk(packet, tmp_buf); - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - php_wddx_add_chunk_ex(packet, class_name, name_len); - php_wddx_add_chunk_static(packet, WDDX_STRING_E); - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - - PHP_CLEANUP_CLASS_ATTRIBUTES(); - - for (zend_hash_internal_pointer_reset(HASH_OF(retval)); - zend_hash_get_current_data(HASH_OF(retval), (void **)&varname) == SUCCESS; - zend_hash_move_forward(HASH_OF(retval))) { - if (Z_TYPE_PP(varname) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize."); - continue; - } - - if (zend_hash_find(HASH_OF(obj), Z_STRVAL_PP(varname), Z_STRLEN_PP(varname)+1, (void **)&ent) == SUCCESS) { - php_wddx_serialize_var(packet, *ent, Z_STRVAL_PP(varname), Z_STRLEN_PP(varname) TSRMLS_CC); - } - } - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } - } else { - uint key_len; - - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(obj); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - sprintf(tmp_buf, WDDX_VAR_S, PHP_CLASS_NAME_VAR); - php_wddx_add_chunk(packet, tmp_buf); - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - php_wddx_add_chunk_ex(packet, class_name, name_len); - php_wddx_add_chunk_static(packet, WDDX_STRING_E); - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - - PHP_CLEANUP_CLASS_ATTRIBUTES(); - - for (zend_hash_internal_pointer_reset(HASH_OF(obj)); - zend_hash_get_current_data(HASH_OF(obj), (void**)&ent) == SUCCESS; - zend_hash_move_forward(HASH_OF(obj))) { - if (*ent == obj) - continue; - - if (zend_hash_get_current_key_ex(HASH_OF(obj), &key, &key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) { - char *class_name, *prop_name; - - zend_unmangle_property_name(key, &class_name, &prop_name); - php_wddx_serialize_var(packet, *ent, prop_name, strlen(prop_name)+1 TSRMLS_CC); - } else { - key_len = sprintf(tmp_buf, "%ld", idx); - php_wddx_serialize_var(packet, *ent, tmp_buf, key_len TSRMLS_CC); - } - } - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } - - zval_dtor(fname); - FREE_ZVAL(fname); - - if (retval) { - zval_ptr_dtor(&retval); - } -} -/* }}} */ - -/* {{{ php_wddx_serialize_array - */ -static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) -{ - zval **ent; - char *key; - uint key_len; - int is_struct = 0, ent_type; - ulong idx; - HashTable *target_hash; - char tmp_buf[WDDX_BUF_LEN]; - ulong ind = 0; - int type; - TSRMLS_FETCH(); - - target_hash = HASH_OF(arr); - - for (zend_hash_internal_pointer_reset(target_hash); - zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS; - zend_hash_move_forward(target_hash)) { - - type = zend_hash_get_current_key(target_hash, &key, &idx, 0); - - if (type == HASH_KEY_IS_STRING) { - is_struct = 1; - break; - } - - if (idx != ind) { - is_struct = 1; - break; - } - - ind++; - } - - if (is_struct) { - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - } else { - sprintf(tmp_buf, WDDX_ARRAY_S, zend_hash_num_elements(target_hash)); - php_wddx_add_chunk(packet, tmp_buf); - } - - for (zend_hash_internal_pointer_reset(target_hash); - zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS; - zend_hash_move_forward(target_hash)) { - if (*ent == arr) - continue; - - if (is_struct) { - ent_type = zend_hash_get_current_key_ex(target_hash, &key, &key_len, &idx, 0, NULL); - - if (ent_type == HASH_KEY_IS_STRING) { - php_wddx_serialize_var(packet, *ent, key, key_len TSRMLS_CC); - } else { - key_len = sprintf(tmp_buf, "%ld", idx); - php_wddx_serialize_var(packet, *ent, tmp_buf, key_len TSRMLS_CC); - } - } else - php_wddx_serialize_var(packet, *ent, NULL, 0 TSRMLS_CC); - } - - if (is_struct) { - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } else { - php_wddx_add_chunk_static(packet, WDDX_ARRAY_E); - } -} -/* }}} */ - -/* {{{ php_wddx_serialize_var - */ -void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC) -{ - char *tmp_buf; - char *name_esc; - int name_esc_len; - HashTable *ht; - - if (name) { - name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S)); - snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc); - php_wddx_add_chunk(packet, tmp_buf); - efree(tmp_buf); - efree(name_esc); - } - - switch(Z_TYPE_P(var)) { - case IS_STRING: - php_wddx_serialize_string(packet, var); - break; - - case IS_LONG: - case IS_DOUBLE: - php_wddx_serialize_number(packet, var); - break; - - case IS_BOOL: - php_wddx_serialize_boolean(packet, var); - break; - - case IS_NULL: - php_wddx_serialize_unset(packet); - break; - - case IS_ARRAY: - ht = Z_ARRVAL_P(var); - if (ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "WDDX doesn't support circular references"); - return; - } - ht->nApplyCount++; - php_wddx_serialize_array(packet, var); - ht->nApplyCount--; - break; - - case IS_OBJECT: - ht = Z_OBJPROP_P(var); - if (ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "WDDX doesn't support circular references"); - return; - } - ht->nApplyCount++; - php_wddx_serialize_object(packet, var); - ht->nApplyCount--; - break; - } - - if (name) { - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - } -} -/* }}} */ - -/* {{{ php_wddx_add_var - */ -static void php_wddx_add_var(wddx_packet *packet, zval *name_var) -{ - zval **val; - HashTable *target_hash; - TSRMLS_FETCH(); - - if (Z_TYPE_P(name_var) == IS_STRING) - { - if (zend_hash_find(EG(active_symbol_table), Z_STRVAL_P(name_var), - Z_STRLEN_P(name_var)+1, (void**)&val) != FAILURE) { - php_wddx_serialize_var(packet, *val, Z_STRVAL_P(name_var), Z_STRLEN_P(name_var) TSRMLS_CC); - } - } - else if (Z_TYPE_P(name_var) == IS_ARRAY || Z_TYPE_P(name_var) == IS_OBJECT) - { - target_hash = HASH_OF(name_var); - - zend_hash_internal_pointer_reset(target_hash); - - while(zend_hash_get_current_data(target_hash, (void**)&val) == SUCCESS) { - php_wddx_add_var(packet, *val); - - zend_hash_move_forward(target_hash); - } - } -} -/* }}} */ - -/* {{{ php_wddx_push_element - */ -static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) -{ - st_entry ent; - wddx_stack *stack = (wddx_stack *)user_data; - - if (!strcmp(name, EL_PACKET)) { - int i; - - for (i=0; atts[i]; i++) { - if (!strcmp(atts[i], EL_VERSION)) { - /* nothing for now */ - } - } - } else if (!strcmp(name, EL_STRING)) { - ent.type = ST_STRING; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_STRING; - Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC(); - Z_STRLEN_P(ent.data) = 0; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_BINARY)) { - ent.type = ST_BINARY; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_STRING; - Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC(); - Z_STRLEN_P(ent.data) = 0; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_CHAR)) { - int i; - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_CHAR_CODE) && atts[++i] && atts[i][0]) { - char tmp_buf[2]; - - sprintf(tmp_buf, "%c", (char)strtol(atts[i], NULL, 16)); - php_wddx_process_data(user_data, tmp_buf, strlen(tmp_buf)); - break; - } - } - } else if (!strcmp(name, EL_NUMBER)) { - ent.type = ST_NUMBER; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_LONG; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_BOOLEAN)) { - int i; - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_VALUE) && atts[++i] && atts[i][0]) { - ent.type = ST_BOOLEAN; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_BOOL; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - php_wddx_process_data(user_data, atts[i], strlen(atts[i])); - break; - } - } - } else if (!strcmp(name, EL_NULL)) { - ent.type = ST_NULL; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - ZVAL_NULL(ent.data); - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_ARRAY)) { - ent.type = ST_ARRAY; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - array_init(ent.data); - INIT_PZVAL(ent.data); - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_STRUCT)) { - ent.type = ST_STRUCT; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - array_init(ent.data); - INIT_PZVAL(ent.data); - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_VAR)) { - int i; - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { - char *decoded; - int decoded_len; - decoded = xml_utf8_decode(atts[i], strlen(atts[i]), &decoded_len, "ISO-8859-1"); - stack->varname = decoded; - break; - } - } - } else if (!strcmp(name, EL_RECORDSET)) { - int i; - - ent.type = ST_RECORDSET; - SET_STACK_VARNAME; - MAKE_STD_ZVAL(ent.data); - array_init(ent.data); - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], "fieldNames") && atts[++i] && atts[i][0]) { - zval *tmp; - char *key; - char *p1, *p2, *endp; - char *decoded; - int decoded_len; - - decoded = xml_utf8_decode(atts[i], strlen(atts[i]), &decoded_len, "ISO-8859-1"); - endp = (char *)decoded + decoded_len; - p1 = (char *)decoded; - while ((p2 = php_memnstr(p1, ",", sizeof(",")-1, endp)) != NULL) { - key = estrndup(p1, p2 - p1); - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_zval_ex(ent.data, key, p2 - p1 + 1, tmp); - p1 = p2 + sizeof(",")-1; - efree(key); - } - - if (p1 <= endp) { - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_zval_ex(ent.data, p1, endp - p1 + 1, tmp); - } - - efree(decoded); - break; - } - } - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_FIELD)) { - int i; - st_entry ent; - - ent.type = ST_FIELD; - ent.varname = NULL; - ent.data = NULL; - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { - char *decoded; - int decoded_len; - st_entry *recordset; - zval **field; - - decoded = xml_utf8_decode(atts[i], strlen(atts[i]), &decoded_len, "ISO-8859-1"); - if (wddx_stack_top(stack, (void**)&recordset) == SUCCESS && - recordset->type == ST_RECORDSET && - zend_hash_find(Z_ARRVAL_P(recordset->data), decoded, decoded_len+1, (void**)&field) == SUCCESS) { - ent.data = *field; - } - - efree(decoded); - break; - } - } - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_DATETIME)) { - ent.type = ST_DATETIME; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_LONG; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } -} -/* }}} */ - -/* {{{ php_wddx_pop_element - */ -static void php_wddx_pop_element(void *user_data, const XML_Char *name) -{ - st_entry *ent1, *ent2; - wddx_stack *stack = (wddx_stack *)user_data; - HashTable *target_hash; - zend_class_entry **pce; - zval *obj; - zval *tmp; - TSRMLS_FETCH(); - -/* OBJECTS_FIXME */ - if (stack->top == 0) - return; - - if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) || - !strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) || - !strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) || - !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) || - !strcmp(name, EL_DATETIME)) { - wddx_stack_top(stack, (void**)&ent1); - - if (!strcmp(name, EL_BINARY)) { - int new_len=0; - unsigned char *new_str; - - new_str = php_base64_decode(Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data), &new_len); - STR_FREE(Z_STRVAL_P(ent1->data)); - Z_STRVAL_P(ent1->data) = new_str; - Z_STRLEN_P(ent1->data) = new_len; - } - - /* Call __wakeup() method on the object. */ - if (Z_TYPE_P(ent1->data) == IS_OBJECT) { - zval *fname, *retval = NULL; - - MAKE_STD_ZVAL(fname); - ZVAL_STRING(fname, "__wakeup", 1); - - call_user_function_ex(NULL, &ent1->data, fname, &retval, 0, 0, 0, NULL TSRMLS_CC); - - zval_dtor(fname); - FREE_ZVAL(fname); - if (retval) - zval_ptr_dtor(&retval); - } - - if (stack->top > 1) { - stack->top--; - wddx_stack_top(stack, (void**)&ent2); - - /* if non-existent field */ - if (ent2->type == ST_FIELD && ent2->data == NULL) { - zval_ptr_dtor(&ent1->data); - efree(ent1); - return; - } - - if (Z_TYPE_P(ent2->data) == IS_ARRAY || Z_TYPE_P(ent2->data) == IS_OBJECT) { - target_hash = HASH_OF(ent2->data); - - if (ent1->varname) { - if (!strcmp(ent1->varname, PHP_CLASS_NAME_VAR) && - Z_TYPE_P(ent1->data) == IS_STRING && Z_STRLEN_P(ent1->data)) { - zend_bool incomplete_class = 0; - - zend_str_tolower(Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data)); - if (zend_hash_find(EG(class_table), Z_STRVAL_P(ent1->data), - Z_STRLEN_P(ent1->data)+1, (void **) &pce)==FAILURE) { - incomplete_class = 1; - pce = &PHP_IC_ENTRY; - } - - /* Initialize target object */ - MAKE_STD_ZVAL(obj); - object_init_ex(obj, *pce); - - /* Merge current hashtable with object's default properties */ - zend_hash_merge(Z_OBJPROP_P(obj), - Z_ARRVAL_P(ent2->data), - (void (*)(void *)) zval_add_ref, - (void *) &tmp, sizeof(zval *), 0); - - if (incomplete_class) { - php_store_class_name(obj, Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data)); - } - - /* Clean up old array entry */ - zval_ptr_dtor(&ent2->data); - - /* Set stack entry to point to the newly created object */ - ent2->data = obj; - - /* Clean up class name var entry */ - zval_ptr_dtor(&ent1->data); - } else if (Z_TYPE_P(ent2->data) == IS_OBJECT) { - zend_class_entry *old_scope = EG(scope); - - EG(scope) = Z_OBJCE_P(ent2->data); - ent1->data->refcount--; - add_property_zval(ent2->data, ent1->varname, ent1->data); - EG(scope) = old_scope; - } else { - long l; - double d; - - switch (is_numeric_string(ent1->varname, strlen(ent1->varname), &l, &d, 0)) { - case IS_DOUBLE: - l = (long) d; - case IS_LONG: - zend_hash_index_update(target_hash, l, &ent1->data, sizeof(zval *), NULL); - break; - default: - zend_hash_update(target_hash,ent1->varname, strlen(ent1->varname)+1, &ent1->data, sizeof(zval *), NULL); - } - } - efree(ent1->varname); - } else { - zend_hash_next_index_insert(target_hash, - &ent1->data, - sizeof(zval *), NULL); - } - } - efree(ent1); - } else - stack->done = 1; - } else if (!strcmp(name, EL_VAR) && stack->varname) { - efree(stack->varname); - } else if (!strcmp(name, EL_FIELD)) { - st_entry *ent; - wddx_stack_top(stack, (void **)&ent); - efree(ent); - stack->top--; - } -} -/* }}} */ - -/* {{{ php_wddx_process_data - */ -static void php_wddx_process_data(void *user_data, const XML_Char *s, int len) -{ - st_entry *ent; - wddx_stack *stack = (wddx_stack *)user_data; - char *decoded; - int decoded_len; - TSRMLS_FETCH(); - - if (!wddx_stack_is_empty(stack) && !stack->done) { - wddx_stack_top(stack, (void**)&ent); - switch (Z_TYPE_P(ent)) { - case ST_STRING: - decoded = xml_utf8_decode(s, len, &decoded_len, "ISO-8859-1"); - - if (Z_STRLEN_P(ent->data) == 0) { - STR_FREE(Z_STRVAL_P(ent->data)); - Z_STRVAL_P(ent->data) = estrndup(decoded, decoded_len); - Z_STRLEN_P(ent->data) = decoded_len; - } else { - Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), - Z_STRLEN_P(ent->data) + decoded_len + 1); - strncpy(Z_STRVAL_P(ent->data)+Z_STRLEN_P(ent->data), decoded, decoded_len); - Z_STRLEN_P(ent->data) += decoded_len; - Z_STRVAL_P(ent->data)[Z_STRLEN_P(ent->data)] = '\0'; - } - - efree(decoded); - break; - - case ST_BINARY: - if (Z_STRLEN_P(ent->data) == 0) { - STR_FREE(Z_STRVAL_P(ent->data)); - Z_STRVAL_P(ent->data) = estrndup(s, len + 1); - } else { - Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + len + 1); - memcpy(Z_STRVAL_P(ent->data) + Z_STRLEN_P(ent->data), s, len); - } - Z_STRLEN_P(ent->data) += len; - Z_STRVAL_P(ent->data)[Z_STRLEN_P(ent->data)] = '\0'; - break; - - case ST_NUMBER: - Z_TYPE_P(ent->data) = IS_STRING; - Z_STRLEN_P(ent->data) = len; - Z_STRVAL_P(ent->data) = estrndup(s, len); - convert_scalar_to_number(ent->data TSRMLS_CC); - break; - - case ST_BOOLEAN: - if (!strcmp(s, "true")) - Z_LVAL_P(ent->data) = 1; - else if (!strcmp(s, "false")) - Z_LVAL_P(ent->data) = 0; - else { - stack->top--; - zval_ptr_dtor(&ent->data); - if (ent->varname) - efree(ent->varname); - efree(ent); - } - break; - - case ST_DATETIME: { - char *tmp; - - tmp = emalloc(len + 1); - memcpy(tmp, s, len); - tmp[len] = '\0'; - - Z_LVAL_P(ent->data) = php_parse_date(tmp, NULL); - /* date out of range < 1969 or > 2038 */ - if (Z_LVAL_P(ent->data) == -1) { - Z_TYPE_P(ent->data) = IS_STRING; - Z_STRLEN_P(ent->data) = len; - Z_STRVAL_P(ent->data) = estrndup(s, len); - } - efree(tmp); - } - break; - - default: - break; - } - } -} -/* }}} */ - -/* {{{ php_wddx_unserialize_ex - */ -int php_wddx_unserialize_ex(char *value, int vallen, zval *return_value) -{ - wddx_stack stack; - XML_Parser parser; - st_entry *ent; - int retval; - - wddx_stack_init(&stack); - parser = XML_ParserCreate("ISO-8859-1"); - - XML_SetUserData(parser, &stack); - XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element); - XML_SetCharacterDataHandler(parser, php_wddx_process_data); - - XML_Parse(parser, value, vallen, 1); - - XML_ParserFree(parser); - - if (stack.top == 1) { - wddx_stack_top(&stack, (void**)&ent); - *return_value = *(ent->data); - zval_copy_ctor(return_value); - retval = SUCCESS; - } else - retval = FAILURE; - - wddx_stack_destroy(&stack); - - return retval; -} -/* }}} */ - -/* {{{ proto string wddx_serialize_value(mixed var [, string comment]) - Creates a new packet and serializes the given value */ -PHP_FUNCTION(wddx_serialize_value) -{ - zval *var; - char *comment = NULL; - int comment_len = 0; - wddx_packet *packet; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", - &var, &comment, &comment_len) == FAILURE) - return; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, comment, comment_len); - php_wddx_serialize_var(packet, var, NULL, 0 TSRMLS_CC); - php_wddx_packet_end(packet); - - ZVAL_STRINGL(return_value, packet->c, packet->len, 1); - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ proto string wddx_serialize_vars(mixed var_name [, mixed ...]) - Creates a new packet and serializes given variables into a struct */ -PHP_FUNCTION(wddx_serialize_vars) -{ - int argc, i; - wddx_packet *packet; - zval ***args; - - argc = ZEND_NUM_ARGS(); - if (argc < 1) { - WRONG_PARAM_COUNT; - } - - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, NULL, 0); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - for (i=0; ic, packet->len, 1); - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ php_wddx_constructor - */ -wddx_packet *php_wddx_constructor(void) -{ - smart_str *packet; - - packet = (smart_str *)emalloc(sizeof(smart_str)); - packet->c = NULL; - - return packet; -} -/* }}} */ - -/* {{{ php_wddx_destructor - */ -void php_wddx_destructor(wddx_packet *packet) -{ - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ proto int wddx_packet_start([string comment]) - Starts a WDDX packet with optional comment and returns the packet id */ -PHP_FUNCTION(wddx_packet_start) -{ - char *comment = NULL; - int comment_len = 0; - wddx_packet *packet; - - comment = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &comment, &comment_len) == FAILURE) - return; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, comment, comment_len); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - ZEND_REGISTER_RESOURCE(return_value, packet, le_wddx); -} -/* }}} */ - -/* {{{ proto string wddx_packet_end(int packet_id) - Ends specified WDDX packet and returns the string containing the packet */ -PHP_FUNCTION(wddx_packet_end) -{ - zval *packet_id; - wddx_packet *packet = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(packet, wddx_packet *, &packet_id, -1, "WDDX packet ID", le_wddx); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - - php_wddx_packet_end(packet); - - ZVAL_STRINGL(return_value, packet->c, packet->len, 1); - - zend_list_delete(Z_LVAL_P(packet_id)); -} -/* }}} */ - -/* {{{ proto int wddx_add_vars(int packet_id, mixed var_names [, mixed ...]) - Serializes given variables and adds them to packet given by packet_id */ -PHP_FUNCTION(wddx_add_vars) -{ - int argc, i; - zval ***args; - zval **packet_id; - wddx_packet *packet = NULL; - - argc = ZEND_NUM_ARGS(); - if (argc < 2) { - WRONG_PARAM_COUNT; - } - - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - packet_id = args[0]; - - packet = (wddx_packet *)zend_fetch_resource(packet_id TSRMLS_CC, -1, "WDDX packet ID", NULL, 1, le_wddx); - if (!packet) - { - efree(args); - RETURN_FALSE; - } - - for (i=1; i | - +----------------------------------------------------------------------+ - */ - -#include "php.h" -#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) -#include "expat_compat.h" - -typedef struct _php_xml_ns { - xmlNsPtr nsptr; - int ref_count; - void *next; - void *prev; -} php_xml_ns; - -#ifdef LIBXML_EXPAT_COMPAT - -#define IS_NS_DECL(__ns) \ - ((__ns) != NULL && strlen(__ns) == 5 && *(__ns) == 'x' && *((__ns)+1) == 'm' && \ - *((__ns)+2) == 'l' && *((__ns)+3) == 'n' && *((__ns)+4) == 's') - -static void -_qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified) -{ - if (URI) { - /* Use libxml functions otherwise its memory deallocation is screwed up */ - *qualified = xmlStrdup(URI); - *qualified = xmlStrncat(*qualified, parser->_ns_seperator, 1); - *qualified = xmlStrncat(*qualified, name, strlen(name)); - } else { - *qualified = xmlStrdup(name); - } -} - -static void -_start_element_handler(void *user, const xmlChar *name, const xmlChar **attributes) -{ - XML_Parser parser = (XML_Parser) user; - xmlChar *qualified_name = NULL; - - if (parser->h_start_element == NULL) { - if (parser->h_default) { - int attno = 0; - - qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name)); - if (attributes) { - while (attributes[attno] != NULL) { - int att_len; - char *att_string, *att_name, *att_value; - - att_name = (char *)attributes[attno++]; - att_value = (char *)attributes[attno++]; - - att_len = spprintf(&att_string, 0, " %s=\"%s\"", att_name, att_value); - - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len); - efree(att_string); - } - - } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1); - parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); - xmlFree(qualified_name); - } - return; - } - - qualified_name = xmlStrdup(name); - - parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attributes); - - xmlFree(qualified_name); -} - -static void -_start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar ** namespaces, int nb_attributes, int nb_defaulted, const xmlChar ** attributes) -{ - XML_Parser parser = (XML_Parser) user; - xmlChar *qualified_name = NULL; - xmlChar **attrs = NULL; - int i; - int z = 0; - int y = 0; - - if (nb_namespaces > 0 && parser->h_start_ns != NULL) { - for (i = 0; i < nb_namespaces; i += 1) { - parser->h_start_ns(parser->user, (const XML_Char *) namespaces[y], (const XML_Char *) namespaces[y+1]); - y += 2; - } - y = 0; - } - - if (parser->h_start_element == NULL && parser->h_default == NULL) { - return; - } - _qualify_namespace(parser, name, URI, &qualified_name); - - if (attributes != NULL) { - xmlChar *qualified_name_attr = NULL; - attrs = safe_emalloc((nb_attributes * 2) + 1, sizeof(int *), 0); - - for (i = 0; i < nb_attributes; i += 1) { - - if (attributes[y+1] != NULL) { - _qualify_namespace(parser, attributes[y] , attributes[y + 2], &qualified_name_attr); - } else { - qualified_name_attr = xmlStrdup(attributes[y]); - } - attrs[z] = qualified_name_attr; - attrs[z + 1] = xmlStrndup(attributes[y + 3] , (int) (attributes[y + 4] - attributes[y + 3])); - z += 2; - y += 5; - } - - attrs[z] = NULL; - } - parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attrs); - if (attrs) { - for (i = 0; i < z; i++) { - xmlFree(attrs[i]); - } - efree(attrs); - } - xmlFree(qualified_name); -} - -static void -_namespace_handler(XML_Parser parser, xmlNsPtr nsptr) -{ - if (nsptr != NULL) { - _namespace_handler(parser, nsptr->next); - parser->h_end_ns(parser->user, nsptr->prefix); - } -} - -static void -_end_element_handler(void *user, const xmlChar *name) -{ - xmlChar *qualified_name; - XML_Parser parser = (XML_Parser) user; - - if (parser->h_end_element == NULL) { - if (parser->h_default) { - char *end_element; - - spprintf(&end_element, 0, "", (char *)name); - parser->h_default(parser->user, (const XML_Char *) end_element, strlen(end_element)); - efree(end_element); - } - return; - } - - qualified_name = xmlStrdup(name); - - parser->h_end_element(parser->user, (const XML_Char *) qualified_name); - - xmlFree(qualified_name); -} - -static void -_end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix, const xmlChar *URI) -{ - xmlChar *qualified_name; - XML_Parser parser = (XML_Parser) user; - - if (parser->h_end_element == NULL) { - return; - } - - _qualify_namespace(parser, name, URI, &qualified_name); - - parser->h_end_element(parser->user, (const XML_Char *) qualified_name); - - xmlFree(qualified_name); -} - -static void -_cdata_handler(void *user, const xmlChar *cdata, int cdata_len) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_cdata == NULL) { - if (parser->h_default) { - parser->h_default(parser->user, (const XML_Char *) cdata, cdata_len); - } - return; - } - - parser->h_cdata(parser->user, (const XML_Char *) cdata, cdata_len); -} - -static void -_pi_handler(void *user, const xmlChar *target, const xmlChar *data) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_pi == NULL) { - if (parser->h_default) { - char *full_pi; - spprintf(&full_pi, 0, "", (char *)target, (char *)data); - parser->h_default(parser->user, (const XML_Char *) full_pi, xmlStrlen(full_pi)); - efree(full_pi); - } - return; - } - - parser->h_pi(parser->user, (const XML_Char *) target, (const XML_Char *) data); -} - -static void -_unparsed_entity_decl_handler(void *user, - const xmlChar *name, - const xmlChar *pub_id, - const xmlChar *sys_id, - const xmlChar *notation) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_unparsed_entity_decl == NULL) { - return; - } - - parser->h_unparsed_entity_decl(parser->user, name, NULL, sys_id, pub_id, notation); -} - -static void -_notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *pub_id, const xmlChar *sys_id) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_notation_decl == NULL) { - return; - } - - parser->h_notation_decl(parser->user, notation, NULL, sys_id, pub_id); -} - -static void -_build_comment(const xmlChar *data, int data_len, xmlChar **comment, int *comment_len) -{ - *comment_len = data_len + 7; - - *comment = xmlMalloc(*comment_len + 1); - memcpy(*comment, "", 3); - - (*comment)[*comment_len] = '\0'; -} - -static void -_comment_handler(void *user, const xmlChar *comment) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_default) { - xmlChar *d_comment; - int d_comment_len; - - _build_comment(comment, xmlStrlen(comment), &d_comment, &d_comment_len); - parser->h_default(parser->user, d_comment, d_comment_len); - xmlFree(d_comment); - } -} - -static void -_build_entity(const xmlChar *name, int len, xmlChar **entity, int *entity_len) -{ - *entity_len = len + 2; - *entity = xmlMalloc(*entity_len + 1); - (*entity)[0] = '&'; - memcpy(*entity+1, name, len); - (*entity)[len+1] = ';'; - (*entity)[*entity_len] = '\0'; -} - -static void -_external_entity_ref_handler(void *user, const xmlChar *names, int type, const xmlChar *sys_id, const xmlChar *pub_id, xmlChar *content) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_external_entity_ref == NULL) { - return; - } - - parser->h_external_entity_ref(parser, names, "", sys_id, pub_id); -} - -static xmlEntityPtr -_get_entity(void *user, const xmlChar *name) -{ - XML_Parser parser = (XML_Parser) user; - xmlEntityPtr ret = NULL; - - if (parser->parser->inSubset == 0) { - ret = xmlGetPredefinedEntity(name); - if (ret == NULL) - ret = xmlGetDocEntity(parser->parser->myDoc, name); - - if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) { - if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) { - /* Predefined entities will expand unless no cdata handler is present */ - if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) { - xmlChar *entity; - int len; - - _build_entity(name, xmlStrlen(name), &entity, &len); - parser->h_default(parser->user, (const xmlChar *) entity, len); - xmlFree(entity); - } else { - /* expat will not expand internal entities if default handler is present otherwise - it will expand and pass them to cdata handler */ - if (parser->h_cdata && ret) { - parser->h_cdata(parser->user, ret->content, xmlStrlen(ret->content)); - } - } - } else { - if (ret->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) { - _external_entity_ref_handler(user, ret->name, ret->etype, ret->SystemID, ret->ExternalID, NULL); - } - } - } - } - - return ret; -} - -static xmlSAXHandler -php_xml_compat_handlers = { - NULL, /* internalSubset */ - NULL, /* isStandalone */ - NULL, /* hasInternalSubset */ - NULL, /* hasExternalSubset */ - NULL, /* resolveEntity */ - _get_entity, /* getEntity */ - NULL, /* entityDecl */ - _notation_decl_handler, - NULL, /* attributeDecl */ - NULL, /* elementDecl */ - _unparsed_entity_decl_handler, /* unparsedEntity */ - NULL, /* setDocumentLocator */ - NULL, /* startDocument */ - NULL, /* endDocument */ - _start_element_handler, /* startElement */ - _end_element_handler, /* endElement */ - NULL, /* reference */ - _cdata_handler, - NULL, /* ignorableWhitespace */ - _pi_handler, - _comment_handler, /* comment */ - NULL, /* warning */ - NULL, /* error */ - NULL, /* fatalError */ - NULL, /* getParameterEntity */ - _cdata_handler, /* cdataBlock */ - NULL, /* externalSubset */ - XML_SAX2_MAGIC, - NULL, - _start_element_handler_ns, - _end_element_handler_ns, - NULL -}; - -PHPAPI XML_Parser -XML_ParserCreate(const XML_Char *encoding) -{ - return XML_ParserCreate_MM(encoding, NULL, NULL); -} - -PHPAPI XML_Parser -XML_ParserCreateNS(const XML_Char *encoding, const XML_Char sep) -{ - XML_Char tmp[2]; - tmp[0] = sep; - tmp[1] = '\0'; - return XML_ParserCreate_MM(encoding, NULL, tmp); -} - -PHPAPI XML_Parser -XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *sep) -{ - XML_Parser parser; - - parser = (XML_Parser) emalloc(sizeof(struct _XML_Parser)); - memset(parser, 0, sizeof(struct _XML_Parser)); - parser->use_namespace = 0; - parser->_ns_seperator = NULL; - - parser->parser = xmlCreatePushParserCtxt((xmlSAXHandlerPtr) &php_xml_compat_handlers, (void *) parser, NULL, 0, NULL); - if (parser->parser == NULL) { - efree(parser); - return NULL; - } - if (encoding != NULL) { - parser->parser->encoding = xmlStrdup(encoding); -#if LIBXML_VERSION <= 20617 - /* for older versions of libxml2, allow correct detection of - * charset in documents with a BOM: */ - } else { - parser->parser->charset = XML_CHAR_ENCODING_NONE; -#endif - } - parser->parser->replaceEntities = 1; - parser->parser->wellFormed = 0; - if (sep != NULL) { - parser->use_namespace = 1; - parser->parser->sax2 = 1; - parser->_ns_seperator = xmlStrdup(sep); - } else { - /* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt - so must be set in the handlers */ - parser->parser->sax->initialized = 1; - } - return parser; -} - -PHPAPI void -XML_SetUserData(XML_Parser parser, void *user) -{ - parser->user = user; -} - -PHPAPI void * -XML_GetUserData(XML_Parser parser) -{ - return parser->user; -} - -PHPAPI void -XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) -{ - parser->h_start_element = start; - parser->h_end_element = end; -} - -PHPAPI void -XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler cdata) -{ - parser->h_cdata = cdata; -} - -PHPAPI void -XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler pi) -{ - parser->h_pi = pi; -} - -PHPAPI void -XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler comment) -{ - parser->h_comment = comment; -} - -PHPAPI void -XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler d) -{ - parser->h_default = d; -} - -PHPAPI void -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler unparsed_decl) -{ - parser->h_unparsed_entity_decl = unparsed_decl; -} - -PHPAPI void -XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler notation_decl) -{ - parser->h_notation_decl = notation_decl; -} - -PHPAPI void -XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler ext_entity) -{ - parser->h_external_entity_ref = ext_entity; -} - -PHPAPI void -XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start_ns) -{ - parser->h_start_ns = start_ns; -} - -PHPAPI void -XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end_ns) -{ - parser->h_end_ns = end_ns; -} - -PHPAPI int -XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final) -{ - int error; - -/* The following is a hack to keep BC with PHP 4 while avoiding -the inifite loop in libxml <= 2.6.17 which occurs when no encoding -has been defined and none can be detected */ -#if LIBXML_VERSION <= 20617 - if (parser->parser->charset == XML_CHAR_ENCODING_NONE) { - if (data_len >= 4 || (parser->parser->input->buf->buffer->use + data_len >= 4)) { - xmlChar start[4]; - int char_count; - - char_count = parser->parser->input->buf->buffer->use; - if (char_count > 4) { - char_count = 4; - } - - memcpy(start, parser->parser->input->buf->buffer->content, (size_t)char_count); - memcpy(start + char_count, data, (size_t)(4 - char_count)); - - if (xmlDetectCharEncoding(&start[0], 4) == XML_CHAR_ENCODING_NONE) { - parser->parser->charset = XML_CHAR_ENCODING_UTF8; - } - } - } -#endif - - error = xmlParseChunk(parser->parser, data, data_len, is_final); - if (!error) { - return 1; - } else if (parser->parser->lastError.level > XML_ERR_WARNING ){ - return 0; - } else { - return 1; - } -} - -PHPAPI int -XML_GetErrorCode(XML_Parser parser) -{ - return parser->parser->errNo; -} - -static const XML_Char *const error_mapping[] = { - "No error", - "Internal error", - "No memory", - "Invalid document start", - "Empty document", - "Invalid document end", - "Invalid hexadecimal character reference", - "Invalid decimal character reference", - "Invalid character reference", - "Invalid character", - "XML_ERR_CHARREF_AT_EOF", - "XML_ERR_CHARREF_IN_PROLOG", - "XML_ERR_CHARREF_IN_EPILOG", - "XML_ERR_CHARREF_IN_DTD", - "XML_ERR_ENTITYREF_AT_EOF", - "XML_ERR_ENTITYREF_IN_PROLOG", - "XML_ERR_ENTITYREF_IN_EPILOG", - "XML_ERR_ENTITYREF_IN_DTD", - "PEReference at end of document", - "PEReference in prolog", - "PEReference in epilog", - "PEReference: forbidden within markup decl in internal subset", - "XML_ERR_ENTITYREF_NO_NAME", - "EntityRef: expecting ';'", - "PEReference: no name", - "PEReference: expecting ';'", - "Undeclared entity error", - "Undeclared entity warning", - "Unparsed Entity", - "XML_ERR_ENTITY_IS_EXTERNAL", - "XML_ERR_ENTITY_IS_PARAMETER", - "Unknown encoding", - "Unsupported encoding", - "String not started expecting ' or \"", - "String not closed expecting \" or '", - "Namespace declaration error", - "EntityValue: \" or ' expected", - "EntityValue: \" or ' expected", - "< in attribute", - "Attribute not started", - "Attribute not finished", - "Attribute without value", - "Attribute redefined", - "SystemLiteral \" or ' expected", - "SystemLiteral \" or ' expected", - /* "XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ - "Comment not finished", - "Processing Instruction not started", - "Processing Instruction not finished", - "NOTATION: Name expected here", - "'>' required to close NOTATION declaration", - "'(' required to start ATTLIST enumeration", - "'(' required to start ATTLIST enumeration", - "MixedContentDecl : '|' or ')*' expected", - "XML_ERR_MIXED_NOT_FINISHED", - "ELEMENT in DTD not started", - "ELEMENT in DTD not finished", - "XML declaration not started", - "XML declaration not finished", - "XML_ERR_CONDSEC_NOT_STARTED", - "XML conditional section not closed", - "Content error in the external subset", - "DOCTYPE not finished", - "Sequence ']]>' not allowed in content", - "CDATA not finished", - "Reserved XML Name", - "Space required", - "XML_ERR_SEPARATOR_REQUIRED", - "NmToken expected in ATTLIST enumeration", - "XML_ERR_NAME_REQUIRED", - "MixedContentDecl : '#PCDATA' expected", - "SYSTEM or PUBLIC, the URI is missing", - "PUBLIC, the Public Identifier is missing", - "< required", - "> required", - "= (int)(sizeof(error_mapping) / sizeof(error_mapping[0]))) { - return "Unknown"; - } - return error_mapping[code]; -} - -PHPAPI int -XML_GetCurrentLineNumber(XML_Parser parser) -{ - return parser->parser->input->line; -} - -PHPAPI int -XML_GetCurrentColumnNumber(XML_Parser parser) -{ - return parser->parser->input->col; -} - -PHPAPI int -XML_GetCurrentByteIndex(XML_Parser parser) -{ - return parser->parser->input->consumed + - (parser->parser->input->cur - parser->parser->input->base); -} - -PHPAPI int -XML_GetCurrentByteCount(XML_Parser parser) -{ - /* WARNING: this is identical to ByteIndex; it should probably - * be different */ - return parser->parser->input->consumed + - (parser->parser->input->cur - parser->parser->input->base); -} - -PHPAPI const XML_Char *XML_ExpatVersion(void) -{ - return "1.0"; -} - -PHPAPI void -XML_ParserFree(XML_Parser parser) -{ - if (parser->use_namespace) { - if (parser->_ns_seperator) { - xmlFree(parser->_ns_seperator); - } - } - if (parser->parser->myDoc) { - xmlFreeDoc(parser->parser->myDoc); - parser->parser->myDoc = NULL; - } - xmlFreeParserCtxt(parser->parser); - efree(parser); -} - -#endif /* LIBXML_EXPAT_COMPAT */ -#endif - -/** - * Local Variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: fdm=marker - * vim: ts=4 noet sw=4 - */ diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 deleted file mode 100644 index 5a2630bdcf877..0000000000000 --- a/ext/xml/config.m4 +++ /dev/null @@ -1,59 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(xml,whether to enable XML support, -[ --disable-xml Disable XML support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no) -fi - -PHP_ARG_WITH(libexpat-dir, libexpat install dir, -[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no) - -if test "$PHP_XML" != "no"; then - - dnl - dnl Default to libxml2 if --with-libexpat-dir is not used. - dnl - if test "$PHP_LIBEXPAT_DIR" = "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XML extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [ - xml_extra_sources="compat.c" - PHP_ADD_EXTENSION_DEP(xml, libxml) - ], [ - AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=]) - ]) - fi - - dnl - dnl Check for expat only if --with-libexpat-dir is used. - dnl - if test "$PHP_LIBEXPAT_DIR" != "no"; then - for i in $PHP_XML $PHP_LIBEXPAT_DIR; do - if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then - EXPAT_DIR=$i - break - fi - done - - if test -z "$EXPAT_DIR"; then - AC_MSG_ERROR([not found. Please reinstall the expat distribution.]) - fi - - PHP_ADD_INCLUDE($EXPAT_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, XML_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBEXPAT, 1, [ ]) - fi - - PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared) - PHP_SUBST(XML_SHARED_LIBADD) - PHP_INSTALL_HEADERS([ext/xml/]) - AC_DEFINE(HAVE_XML, 1, [ ]) -fi diff --git a/ext/xml/config.w32 b/ext/xml/config.w32 deleted file mode 100644 index 08d25ffe57042..0000000000000 --- a/ext/xml/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xml", "XML support", "yes"); - -if (PHP_XML == "yes" && PHP_LIBXML == "yes") { - EXTENSION("xml", "xml.c compat.c"); - AC_DEFINE("HAVE_XML", 1, "XML support"); - if (!PHP_XML_SHARED) { - ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC "); - } - ADD_EXTENSION_DEP('xml', 'libxml'); -} - - diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h deleted file mode 100644 index 0370da894298d..0000000000000 --- a/ext/xml/expat_compat.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_EXPAT_COMPAT_H -#define PHP_EXPAT_COMPAT_H - -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -#if !defined(HAVE_LIBEXPAT) && defined(HAVE_LIBXML) -#define LIBXML_EXPAT_COMPAT 1 - -#include "php.h" -#include "php_compat.h" - -#include -#include -#include -#include - -typedef xmlChar XML_Char; - -typedef void (*XML_StartElementHandler)(void *, const XML_Char *, const XML_Char **); -typedef void (*XML_EndElementHandler)(void *, const XML_Char *); -typedef void (*XML_CharacterDataHandler)(void *, const XML_Char *, int); -typedef void (*XML_ProcessingInstructionHandler)(void *, const XML_Char *, const XML_Char *); -typedef void (*XML_CommentHandler)(void *, const XML_Char *); -typedef void (*XML_DefaultHandler)(void *, const XML_Char *, int); -typedef void (*XML_UnparsedEntityDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef void (*XML_NotationDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef int (*XML_ExternalEntityRefHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef void (*XML_StartNamespaceDeclHandler)(void *, const XML_Char *, const XML_Char *); -typedef void (*XML_EndNamespaceDeclHandler)(void *, const XML_Char *); - -typedef struct _XML_Memory_Handling_Suite { - void *(*malloc_fcn)(size_t size); - void *(*realloc_fcn)(void *ptr, size_t size); - void (*free_fcn)(void *ptr); -} XML_Memory_Handling_Suite; - -typedef struct _XML_Parser { - int use_namespace; - - xmlChar *_ns_seperator; - - void *user; - xmlParserCtxtPtr parser; - - XML_StartElementHandler h_start_element; - XML_EndElementHandler h_end_element; - XML_CharacterDataHandler h_cdata; - XML_ProcessingInstructionHandler h_pi; - XML_CommentHandler h_comment; - XML_DefaultHandler h_default; - XML_UnparsedEntityDeclHandler h_unparsed_entity_decl; - XML_NotationDeclHandler h_notation_decl; - XML_ExternalEntityRefHandler h_external_entity_ref; - XML_StartNamespaceDeclHandler h_start_ns; - XML_EndNamespaceDeclHandler h_end_ns; -} *XML_Parser; - -enum XML_Error { - XML_ERROR_NONE, - XML_ERROR_NO_MEMORY, - XML_ERROR_SYNTAX, - XML_ERROR_NO_ELEMENTS, - XML_ERROR_INVALID_TOKEN, - XML_ERROR_UNCLOSED_TOKEN, - XML_ERROR_PARTIAL_CHAR, - XML_ERROR_TAG_MISMATCH, - XML_ERROR_DUPLICATE_ATTRIBUTE, - XML_ERROR_JUNK_AFTER_DOC_ELEMENT, - XML_ERROR_PARAM_ENTITY_REF, - XML_ERROR_UNDEFINED_ENTITY, - XML_ERROR_RECURSIVE_ENTITY_REF, - XML_ERROR_ASYNC_ENTITY, - XML_ERROR_BAD_CHAR_REF, - XML_ERROR_BINARY_ENTITY_REF, - XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, - XML_ERROR_MISPLACED_XML_PI, - XML_ERROR_UNKNOWN_ENCODING, - XML_ERROR_INCORRECT_ENCODING, - XML_ERROR_UNCLOSED_CDATA_SECTION, - XML_ERROR_EXTERNAL_ENTITY_HANDLING, - XML_ERROR_NOT_STANDALONE, - XML_ERROR_UNEXPECTED_STATE, - XML_ERROR_ENTITY_DECLARED_IN_PE, - XML_ERROR_FEATURE_REQUIRES_XML_DTD, - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING -}; - -enum XML_Content_Type { - XML_CTYPE_EMPTY = 1, - XML_CTYPE_ANY, - XML_CTYPE_MIXED, - XML_CTYPE_NAME, - XML_CTYPE_CHOICE, - XML_CTYPE_SEQ -}; - -PHPAPI XML_Parser XML_ParserCreate(const XML_Char *); -PHPAPI XML_Parser XML_ParserCreateNS(const XML_Char *, const XML_Char); -PHPAPI XML_Parser XML_ParserCreate_MM(const XML_Char *, const XML_Memory_Handling_Suite *, const XML_Char *); -PHPAPI void XML_SetUserData(XML_Parser, void *); -PHPAPI void *XML_GetUserData(XML_Parser); -PHPAPI void XML_SetElementHandler(XML_Parser, XML_StartElementHandler, XML_EndElementHandler); -PHPAPI void XML_SetCharacterDataHandler(XML_Parser, XML_CharacterDataHandler); -PHPAPI void XML_SetProcessingInstructionHandler(XML_Parser, XML_ProcessingInstructionHandler); -PHPAPI void XML_SetDefaultHandler(XML_Parser, XML_DefaultHandler); -PHPAPI void XML_SetUnparsedEntityDeclHandler(XML_Parser, XML_UnparsedEntityDeclHandler); -PHPAPI void XML_SetNotationDeclHandler(XML_Parser, XML_NotationDeclHandler); -PHPAPI void XML_SetExternalEntityRefHandler(XML_Parser, XML_ExternalEntityRefHandler); -PHPAPI void XML_SetStartNamespaceDeclHandler(XML_Parser, XML_StartNamespaceDeclHandler); -PHPAPI void XML_SetEndNamespaceDeclHandler(XML_Parser, XML_EndNamespaceDeclHandler); -PHPAPI int XML_Parse(XML_Parser, const XML_Char *, int data_len, int is_final); -PHPAPI int XML_GetErrorCode(XML_Parser); -PHPAPI const XML_Char *XML_ErrorString(int); -PHPAPI int XML_GetCurrentLineNumber(XML_Parser); -PHPAPI int XML_GetCurrentColumnNumber(XML_Parser); -PHPAPI int XML_GetCurrentByteIndex(XML_Parser); -PHPAPI int XML_GetCurrentByteCount(XML_Parser); -PHPAPI const XML_Char *XML_ExpatVersion(void); -PHPAPI void XML_ParserFree(XML_Parser); - -#elif defined(HAVE_LIBEXPAT) -#include -#endif /* HAVE_LIBEXPAT */ - -#endif /* PHP_EXPAT_COMPAT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xml/package.xml b/ext/xml/package.xml deleted file mode 100644 index f7f4ce62b5481..0000000000000 --- a/ext/xml/package.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - xml - XML Parsing functions - - - ssb - Stig Bakken - ssb@php.net - lead - - - thies - Thies Arntzen - thies@php.net - lead - - - sterling - Sterling Hughes - sterling@php.net - lead - - - -This extension lets you create XML parsers and then define -handlers for different XML events. Each XML parser also has -a few parameters you can adjust. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h deleted file mode 100644 index a4e9f5e5f1091..0000000000000 --- a/ext/xml/php_xml.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - | Thies C. Arntzen | - | Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XML_H -#define PHP_XML_H - -#ifdef HAVE_XML -extern zend_module_entry xml_module_entry; -#define xml_module_ptr &xml_module_entry -#else -#define xml_module_ptr NULL -#endif - -#ifdef HAVE_XML - -#include "ext/xml/expat_compat.h" - -#ifdef PHP_WIN32 -#define PHP_XML_API __declspec(dllexport) -#else -#define PHP_XML_API -#endif - - -#ifdef XML_UNICODE -#error "UTF-16 Unicode support not implemented!" -#endif - -typedef struct { - XML_Char *default_encoding; -} php_xml_globals; - -typedef struct { - int index; - int case_folding; - XML_Parser parser; - XML_Char *target_encoding; - - zval *startElementHandler; - zval *endElementHandler; - zval *characterDataHandler; - zval *processingInstructionHandler; - zval *defaultHandler; - zval *unparsedEntityDeclHandler; - zval *notationDeclHandler; - zval *externalEntityRefHandler; - zval *unknownEncodingHandler; - zval *startNamespaceDeclHandler; - zval *endNamespaceDeclHandler; - - zend_function *startElementPtr; - zend_function *endElementPtr; - zend_function *characterDataPtr; - zend_function *processingInstructionPtr; - zend_function *defaultPtr; - zend_function *unparsedEntityDeclPtr; - zend_function *notationDeclPtr; - zend_function *externalEntityRefPtr; - zend_function *unknownEncodingPtr; - zend_function *startNamespaceDeclPtr; - zend_function *endNamespaceDeclPtr; - - zval *object; - - zval *data; - zval *info; - int level; - int toffset; - int curtag; - pval **ctag; - char **ltags; - int lastwasopen; - int skipwhite; - int isparsing; - - XML_Char *baseURI; -} xml_parser; - - -typedef struct { - XML_Char *name; - char (*decoding_function)(unsigned short); - unsigned short (*encoding_function)(unsigned char); -} xml_encoding; - - -enum php_xml_option { - PHP_XML_OPTION_CASE_FOLDING = 1, - PHP_XML_OPTION_TARGET_ENCODING, - PHP_XML_OPTION_SKIP_TAGSTART, - PHP_XML_OPTION_SKIP_WHITE -}; - -/* for xml_parse_into_struct */ - -#define XML_MAXLEVEL 255 /* XXX this should be dynamic */ - -PHP_FUNCTION(xml_parser_create); -PHP_FUNCTION(xml_parser_create_ns); -PHP_FUNCTION(xml_set_object); -PHP_FUNCTION(xml_set_element_handler); -PHP_FUNCTION(xml_set_character_data_handler); -PHP_FUNCTION(xml_set_processing_instruction_handler); -PHP_FUNCTION(xml_set_default_handler); -PHP_FUNCTION(xml_set_unparsed_entity_decl_handler); -PHP_FUNCTION(xml_set_notation_decl_handler); -PHP_FUNCTION(xml_set_external_entity_ref_handler); -PHP_FUNCTION(xml_set_start_namespace_decl_handler); -PHP_FUNCTION(xml_set_end_namespace_decl_handler); -PHP_FUNCTION(xml_parse); -PHP_FUNCTION(xml_get_error_code); -PHP_FUNCTION(xml_error_string); -PHP_FUNCTION(xml_get_current_line_number); -PHP_FUNCTION(xml_get_current_column_number); -PHP_FUNCTION(xml_get_current_byte_index); -PHP_FUNCTION(xml_parser_free); -PHP_FUNCTION(xml_parser_set_option); -PHP_FUNCTION(xml_parser_get_option); -PHP_FUNCTION(utf8_encode); -PHP_FUNCTION(utf8_decode); -PHP_FUNCTION(xml_parse_into_struct); - -PHPAPI char *_xml_zval_strdup(zval *val); -PHPAPI char *xml_utf8_decode(const XML_Char *, int, int *, const XML_Char *); - -#endif /* HAVE_LIBEXPAT */ - -#define phpext_xml_ptr xml_module_ptr - -#ifdef ZTS -#define XML(v) TSRMG(xml_globals_id, php_xml_globals *, v) -#else -#define XML(v) (xml_globals.v) -#endif - -#endif /* PHP_XML_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xml/tests/bug25666.phpt b/ext/xml/tests/bug25666.phpt deleted file mode 100644 index ce67ea8ed43e9..0000000000000 --- a/ext/xml/tests/bug25666.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #25666 (XML namespaces broken in libxml-based SAX interface) ---SKIPIF-- - ---FILE-- - - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -string(24) "http://example.com/foo@a" -string(24) "http://example.com/bar@b" -string(24) "http://example.com/baz@c" diff --git a/ext/xml/tests/bug26528.phpt b/ext/xml/tests/bug26528.phpt deleted file mode 100644 index 2fa015a84d3c2..0000000000000 --- a/ext/xml/tests/bug26528.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #26528 (HTML entities are not being decoded) ---FILE-- -"; - $parser = xml_parser_create(); - $res = xml_parse_into_struct($parser,$sample,$vals,$index); - xml_parser_free($parser); - var_dump($vals); -?> ---EXPECT-- -array(1) { - [0]=> - array(4) { - ["tag"]=> - string(4) "TEST" - ["type"]=> - string(8) "complete" - ["level"]=> - int(1) - ["attributes"]=> - array(1) { - ["ATTR"]=> - string(13) "angle ---FILE-- - - - -'; - -// Case 2: replace some characters so that we get comments instead -$xmls["Comment"] =' - - -'; - -// Case 3: replace even more characters so that only textual data is left -$xmls["Text"] =' - --!-- ATA[ -multi -line -CDATA -block ---- -'; - -function startElement($parser, $name, $attrs) { - printf("<$name> at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function endElement($parser, $name) { - printf(" at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function characterData($parser, $data) { - // dummy -} - -foreach ($xmls as $desc => $xml) { - echo "$desc\n"; - $xml_parser = xml_parser_create(); - xml_set_element_handler($xml_parser, "startElement", "endElement"); - xml_set_character_data_handler($xml_parser, "characterData"); - if (!xml_parse($xml_parser, $xml, true)) - echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n"; - xml_parser_free($xml_parser); -} -?> ---EXPECT-- -CDATA - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) -Comment - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) -Text - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) diff --git a/ext/xml/tests/bug26614_libxml.phpt b/ext/xml/tests/bug26614_libxml.phpt deleted file mode 100755 index 645bf7e759efa..0000000000000 --- a/ext/xml/tests/bug26614_libxml.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -Bug #26614 (CDATA sections skipped on line count) ---SKIPIF-- - ---FILE-- - - - -'; - -// Case 2: replace some characters so that we get comments instead -$xmls["Comment"] =' - - -'; - -// Case 3: replace even more characters so that only textual data is left -$xmls["Text"] =' - --!-- ATA[ -multi -line -CDATA -block ---- -'; - -function startElement($parser, $name, $attrs) { - printf("<$name> at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function endElement($parser, $name) { - printf(" at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function characterData($parser, $data) { - // dummy -} - -foreach ($xmls as $desc => $xml) { - echo "$desc\n"; - $xml_parser = xml_parser_create(); - xml_set_element_handler($xml_parser, "startElement", "endElement"); - xml_set_character_data_handler($xml_parser, "characterData"); - if (!xml_parse($xml_parser, $xml, true)) - echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n"; - xml_parser_free($xml_parser); -} -?> ---EXPECTF-- -CDATA - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) -Comment - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) -Text - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) diff --git a/ext/xml/tests/bug27908.phpt b/ext/xml/tests/bug27908.phpt deleted file mode 100644 index abb856137afc6..0000000000000 --- a/ext/xml/tests/bug27908.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #27908 (default handler not being called) ---FILE-- -',TRUE); -xml_parser_free($xp); -echo "Done\n"; -?> ---EXPECT-- -x_default_handler -x_default_handler -Done diff --git a/ext/xml/tests/bug30266.phpt b/ext/xml/tests/bug30266.phpt deleted file mode 100644 index ebc0a270c76ab..0000000000000 --- a/ext/xml/tests/bug30266.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #30266 (Invalid opcode 137/1/8) ---FILE-- -dummy = "b"; - throw new Exception("ex"); - } - - function endHandler($XmlParser, $tag) - { - } -} - -$p1 = new Xml_Parser(); -try { - $p1->parse(''); -} catch (Exception $e) { - echo "OK\n"; -} -?> ---EXPECT-- -OK diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt deleted file mode 100644 index 6b7320d06b537..0000000000000 --- a/ext/xml/tests/bug32001.phpt +++ /dev/null @@ -1,485 +0,0 @@ ---TEST-- -Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) ---SKIPIF-- - ---FILE-- -encoding = $enc; - $this->chunk_size = $chunk_size; - $this->bom = $bom; - $this->prologue = !$omit_prologue; - $this->tags = array(); - } - - function start_element($parser, $name, $attrs) { - $attrs = array_map('bin2hex', $attrs); - $this->tags[] = bin2hex($name).": ".implode(', ', $attrs); - } - - function end_element($parser, $name) { - } - - function run() { - $data = ''; - - if ($this->prologue) { - $canonical_name = preg_replace('/BE|LE/i', '', $this->encoding); - $data .= "\n"; - } - - $data .= << - <ƒ†‚ıƒˆ:ƒ†‚ıƒˆ2 ƒ†‚ıƒˆ="ƒ†‚ıƒˆ"> - <ƒ†‚ıƒˆ:ƒ†‚ıƒˆ3> - test! - - - -HERE; - - $data = iconv("UTF-8", $this->encoding, $data); - - if ($this->bom) { - switch (strtoupper($this->encoding)) { - case 'UTF-8': - case 'UTF8': - $data = "\xef\xbb\xbf".$data; - break; - - case 'UTF-16': - case 'UTF16': - case 'UTF-16BE': - case 'UTF16BE': - case 'UCS-2': - case 'UCS2': - case 'UCS-2BE': - case 'UCS2BE': - $data = "\xfe\xff".$data; - break; - - case 'UTF-16LE': - case 'UTF16LE': - case 'UCS-2LE': - case 'UCS2LE': - $data = "\xff\xfe".$data; - break; - - case 'UTF-32': - case 'UTF32': - case 'UTF-32BE': - case 'UTF32BE': - case 'UCS-4': - case 'UCS4': - case 'UCS-4BE': - case 'UCS4BE': - $data = "\x00\x00\xfe\xff".$data; - break; - - case 'UTF-32LE': - case 'UTF32LE': - case 'UCS-4LE': - case 'UCS4LE': - $data = "\xff\xfe\x00\x00".$data; - break; - } - } - - $parser = xml_parser_create(NULL); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_element_handler($parser, "start_element", "end_element"); - xml_set_object($parser, $this); - - if ($this->chunk_size == 0) { - $success = @xml_parse($parser, $data, true); - } else { - for ($offset = 0; $offset < strlen($data); - $offset += $this->chunk_size) { - $success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false); - if (!$success) { - break; - } - } - if ($success) { - $success = @xml_parse($parser, "", true); - } - } - - echo "Encoding: $this->encoding\n"; - echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n"; - echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n"); - echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n"; - - if ($success) { - var_dump($this->tags); - } else { - echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n"; - } - } -} -$suite = array( - new testcase("UTF-8", 0, 0, 0), - new testcase("UTF-8", 0, 0, 1), - new testcase("UTF-8", 0, 1, 0), - new testcase("UTF-8", 0, 1, 1), - new testcase("UTF-16BE", 0, 0, 0), - new testcase("UTF-16BE", 0, 1, 0), - new testcase("UTF-16BE", 0, 1, 1), - new testcase("UTF-16LE", 0, 0, 0), - new testcase("UTF-16LE", 0, 1, 0), - new testcase("UTF-16LE", 0, 1, 1), - new testcase("UTF-8", 1, 0, 0), - new testcase("UTF-8", 1, 0, 1), - new testcase("UTF-8", 1, 1, 0), - new testcase("UTF-8", 1, 1, 1), - new testcase("UTF-16BE", 1, 0, 0), - new testcase("UTF-16BE", 1, 1, 0), - new testcase("UTF-16BE", 1, 1, 1), - new testcase("UTF-16LE", 1, 0, 0), - new testcase("UTF-16LE", 1, 1, 0), - new testcase("UTF-16LE", 1, 1, 1), - new testcase("EUC-JP" , 0), - new testcase("EUC-JP" , 1), - new testcase("Shift_JIS", 0), - new testcase("Shift_JIS", 1), - new testcase("GB2312", 0), - new testcase("GB2312", 1), -); - -if (XML_SAX_IMPL == 'libxml') { - $php = getenv('TEST_PHP_EXECUTABLE'); - preg_match("/^libxml2 Version.*\$/im", `$php -i`, $match); - echo $match[0], "\n"; -} else { - echo "libxml2 Version => NONE\n"; -} - -foreach ($suite as $testcase) { - $testcase->run(); -} - -// vim600: sts=4 sw=4 ts=4 encoding=UTF-8 -?> ---EXPECTF-- -libxml2 Version => %s -Encoding: UTF-8 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: EUC-JP -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: EUC-JP -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} diff --git a/ext/xml/tests/inc.ent b/ext/xml/tests/inc.ent deleted file mode 100644 index 8f86465c2ab0e..0000000000000 --- a/ext/xml/tests/inc.ent +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/xml/tests/skipif.inc b/ext/xml/tests/skipif.inc deleted file mode 100644 index 44898f3da63c2..0000000000000 --- a/ext/xml/tests/skipif.inc +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/ext/xml/tests/xml001.phpt b/ext/xml/tests/xml001.phpt deleted file mode 100644 index 6ee908e46d8c5..0000000000000 --- a/ext/xml/tests/xml001.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -XML parser test, function callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml002.phpt b/ext/xml/tests/xml002.phpt deleted file mode 100644 index 9785002926be5..0000000000000 --- a/ext/xml/tests/xml002.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -XML parser test, object tuple callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml003.phpt b/ext/xml/tests/xml003.phpt deleted file mode 100644 index fa0984e8936b9..0000000000000 --- a/ext/xml/tests/xml003.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -XML parser test, xml_set_object callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml004.phpt b/ext/xml/tests/xml004.phpt deleted file mode 100644 index 78840ee122762..0000000000000 --- a/ext/xml/tests/xml004.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -XML parser case folding test ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- -\n"; -} - -function end_element($xp, $elem) -{ - print "\n"; -} -?> ---EXPECT-- - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xml/tests/xml006.phpt b/ext/xml/tests/xml006.phpt deleted file mode 100644 index 088a81b0cbe61..0000000000000 --- a/ext/xml/tests/xml006.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -UTF-8<->ISO Latin 1 encoding/decoding test ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- - %s\n", urlencode("ĉ"), urlencode(utf8_encode("ĉ"))); -printf("%s <- %s\n", urlencode(utf8_decode(urldecode("%C3%A6"))), "%C3%A6"); -?> ---EXPECT-- -%E6 -> %C3%A6 -%E6 <- %C3%A6 diff --git a/ext/xml/tests/xml007.phpt b/ext/xml/tests/xml007.phpt deleted file mode 100644 index a57f64d7c03da..0000000000000 --- a/ext/xml/tests/xml007.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -xml_parse_into_struct/umlauts in tags ---SKIPIF-- - ---INI-- -unicode.script_encoding=ISO-8859-1 -unicode.output_encoding=ISO-8859-1 ---FILE-- -<äöü üäß="Üäß">ÄÖÜ'; -$parser = xml_parser_create('ISO-8859-1'); -xml_set_element_handler($parser, "startHandler", "endHandler"); -xml_parse_into_struct($parser, $xmldata, $struct, $index); -var_dump($struct); -?> ---EXPECT-- -string(3) "ÄÖÜ" -array(1) { - ["ÜÄß"]=> - string(3) "Üäß" -} -string(3) "ÄÖÜ" -array(1) { - [0]=> - array(5) { - ["tag"]=> - string(3) "ÄÖÜ" - ["type"]=> - string(8) "complete" - ["level"]=> - int(1) - ["attributes"]=> - array(1) { - ["ÜÄß"]=> - string(3) "Üäß" - } - ["value"]=> - string(3) "ÄÖÜ" - } -} diff --git a/ext/xml/tests/xml009.phpt b/ext/xml/tests/xml009.phpt deleted file mode 100644 index 3b64e7b8baff8..0000000000000 --- a/ext/xml/tests/xml009.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -XML parser test, default namespaces ---SKIPIF-- - ---FILE-- - - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -string(24) "http://example.com/foo@a" -string(24) "http://example.com/bar@b" -string(24) "http://example.com/foo@c" diff --git a/ext/xml/tests/xml010.phpt b/ext/xml/tests/xml010.phpt deleted file mode 100644 index 125e9c7b03e9b..0000000000000 --- a/ext/xml/tests/xml010.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -XML parser test, attributes ---SKIPIF-- - ---FILE-- - $value) { - print "$key = $value "; - } - print "\n"; -} -function end_elem() -{ -} - -$xml = << - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -http://example.com/foo@a -http://example.com/bar@b foo = bar -http://example.com/bar@c http://example.com/bar@nix = null foo = bar diff --git a/ext/xml/tests/xmltest.xml b/ext/xml/tests/xmltest.xml deleted file mode 100644 index c15d6ea1ab04d..0000000000000 --- a/ext/xml/tests/xmltest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - -%incent; -]> - - Plain text. - - - - - - &included-entity; - - - - - - - diff --git a/ext/xml/xml.c b/ext/xml/xml.c deleted file mode 100644 index 7f17d68a5005b..0000000000000 --- a/ext/xml/xml.c +++ /dev/null @@ -1,1630 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - | Thies C. Arntzen | - | Sterling Hughes | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#define PHP_XML_INTERNAL -#include "zend_variables.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" - -#if HAVE_XML - -#include "php_xml.h" -# include "ext/standard/head.h" -#ifdef LIBXML_EXPAT_COMPAT -#include "ext/libxml/php_libxml.h" -#endif - -/* Short-term TODO list: - * - Implement XML_ExternalEntityParserCreate() - * - XML_SetCommentHandler - * - XML_SetCdataSectionHandler - * - XML_SetParamEntityParsing - */ - -/* Long-term TODO list: - * - Fix the expat library so you can install your own memory manager - * functions - */ - -/* Known bugs: - * - Weird things happen with sections. - */ - -#ifdef ZTS -int xml_globals_id; -#else -PHP_XML_API php_xml_globals xml_globals; -#endif - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_XML -ZEND_GET_MODULE(xml) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif /* COMPILE_DL_XML */ -/* }}} */ - -/* {{{ function prototypes */ -PHP_MINIT_FUNCTION(xml); -PHP_MINFO_FUNCTION(xml); - -static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void xml_set_handler(zval **, zval **); -inline static unsigned short xml_encode_iso_8859_1(unsigned char); -inline static char xml_decode_iso_8859_1(unsigned short); -inline static unsigned short xml_encode_us_ascii(unsigned char); -inline static char xml_decode_us_ascii(unsigned short); -static XML_Char *xml_utf8_encode(const char *, int, int *, const XML_Char *); -static zval *xml_call_handler(xml_parser *, zval *, zend_function *, int, zval **); -static zval *_xml_xmlchar_zval(const XML_Char *, int, const XML_Char *); -static int _xml_xmlcharlen(const XML_Char *); -static void _xml_add_to_info(xml_parser *parser,char *name); -inline static char *_xml_decode_tag(xml_parser *parser, const char *tag); - -void _xml_startElementHandler(void *, const XML_Char *, const XML_Char **); -void _xml_endElementHandler(void *, const XML_Char *); -void _xml_characterDataHandler(void *, const XML_Char *, int); -void _xml_processingInstructionHandler(void *, const XML_Char *, const XML_Char *); -void _xml_defaultHandler(void *, const XML_Char *, int); -void _xml_unparsedEntityDeclHandler(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -void _xml_notationDeclHandler(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -int _xml_externalEntityRefHandler(XML_Parser, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); - -void _xml_startNamespaceDeclHandler(void *, const XML_Char *, const XML_Char *); -void _xml_endNamespaceDeclHandler(void *, const XML_Char *); -/* }}} */ - -/* {{{ extension definition structures */ -static - ZEND_BEGIN_ARG_INFO(third_and_fourth_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -function_entry xml_functions[] = { - PHP_FE(xml_parser_create, NULL) - PHP_FE(xml_parser_create_ns, NULL) - PHP_FE(xml_set_object, second_arg_force_ref) - PHP_FE(xml_set_element_handler, NULL) - PHP_FE(xml_set_character_data_handler, NULL) - PHP_FE(xml_set_processing_instruction_handler, NULL) - PHP_FE(xml_set_default_handler, NULL) - PHP_FE(xml_set_unparsed_entity_decl_handler, NULL) - PHP_FE(xml_set_notation_decl_handler, NULL) - PHP_FE(xml_set_external_entity_ref_handler, NULL) - PHP_FE(xml_set_start_namespace_decl_handler, NULL) - PHP_FE(xml_set_end_namespace_decl_handler, NULL) - PHP_FE(xml_parse, NULL) - PHP_FE(xml_parse_into_struct, third_and_fourth_args_force_ref) - PHP_FE(xml_get_error_code, NULL) - PHP_FE(xml_error_string, NULL) - PHP_FE(xml_get_current_line_number, NULL) - PHP_FE(xml_get_current_column_number, NULL) - PHP_FE(xml_get_current_byte_index, NULL) - PHP_FE(xml_parser_free, NULL) - PHP_FE(xml_parser_set_option, NULL) - PHP_FE(xml_parser_get_option, NULL) - PHP_FE(utf8_encode, NULL) - PHP_FE(utf8_decode, NULL) - {NULL, NULL, NULL} -}; - -#ifdef LIBXML_EXPAT_COMPAT -static zend_module_dep xml_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; -#endif - -zend_module_entry xml_module_entry = { -#ifdef LIBXML_EXPAT_COMPAT - STANDARD_MODULE_HEADER_EX, NULL, - xml_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "xml", /* extension name */ - xml_functions, /* extension function list */ - PHP_MINIT(xml), /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - NULL, /* per-request startup function */ - NULL, /* per-request shutdown function */ - PHP_MINFO(xml), /* information function */ - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* All the encoding functions are set to NULL right now, since all - * the encoding is currently done internally by expat/xmltok. - */ -xml_encoding xml_encodings[] = { - { "ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, - { "US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, - { "UTF-8", NULL, NULL }, - { NULL, NULL, NULL } -}; - -static XML_Memory_Handling_Suite php_xml_mem_hdlrs; - -/* True globals, no need for thread safety */ -static int le_xml_parser; - -/* }}} */ - -/* {{{ startup, shutdown and info functions */ -#ifdef ZTS -static void php_xml_init_globals(php_xml_globals *xml_globals_p TSRMLS_DC) -{ - XML(default_encoding) = "UTF-8"; -} -#endif - -static void *php_xml_malloc_wrapper(size_t sz) -{ - return emalloc(sz); -} - -static void *php_xml_realloc_wrapper(void *ptr, size_t sz) -{ - return erealloc(ptr, sz); -} - -static void php_xml_free_wrapper(void *ptr) -{ - if (ptr != NULL) { - efree(ptr); - } -} - -PHP_MINIT_FUNCTION(xml) -{ - le_xml_parser = zend_register_list_destructors_ex(xml_parser_dtor, NULL, "xml", module_number); - -#ifdef ZTS - ts_allocate_id(&xml_globals_id, sizeof(php_xml_globals), (ts_allocate_ctor) php_xml_init_globals, NULL); -#else - XML(default_encoding) = "UTF-8"; -#endif - - REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_NO_MEMORY", XML_ERROR_NO_MEMORY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_SYNTAX", XML_ERROR_SYNTAX, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_NO_ELEMENTS", XML_ERROR_NO_ELEMENTS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_INVALID_TOKEN", XML_ERROR_INVALID_TOKEN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_TOKEN", XML_ERROR_UNCLOSED_TOKEN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_PARTIAL_CHAR", XML_ERROR_PARTIAL_CHAR, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_TAG_MISMATCH", XML_ERROR_TAG_MISMATCH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_DUPLICATE_ATTRIBUTE", XML_ERROR_DUPLICATE_ATTRIBUTE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_JUNK_AFTER_DOC_ELEMENT", XML_ERROR_JUNK_AFTER_DOC_ELEMENT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_PARAM_ENTITY_REF", XML_ERROR_PARAM_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNDEFINED_ENTITY", XML_ERROR_UNDEFINED_ENTITY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_RECURSIVE_ENTITY_REF", XML_ERROR_RECURSIVE_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_ASYNC_ENTITY", XML_ERROR_ASYNC_ENTITY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_BAD_CHAR_REF", XML_ERROR_BAD_CHAR_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_BINARY_ENTITY_REF", XML_ERROR_BINARY_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_MISPLACED_XML_PI", XML_ERROR_MISPLACED_XML_PI, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNKNOWN_ENCODING", XML_ERROR_UNKNOWN_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_INCORRECT_ENCODING", XML_ERROR_INCORRECT_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_CDATA_SECTION", XML_ERROR_UNCLOSED_CDATA_SECTION, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_EXTERNAL_ENTITY_HANDLING", XML_ERROR_EXTERNAL_ENTITY_HANDLING, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("XML_OPTION_CASE_FOLDING", PHP_XML_OPTION_CASE_FOLDING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_TARGET_ENCODING", PHP_XML_OPTION_TARGET_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_TAGSTART", PHP_XML_OPTION_SKIP_TAGSTART, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_CS|CONST_PERSISTENT); - - /* this object should not be pre-initialised at compile time, - as the order of members may vary */ - - php_xml_mem_hdlrs.malloc_fcn = php_xml_malloc_wrapper; - php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper; - php_xml_mem_hdlrs.free_fcn = php_xml_free_wrapper; - -#ifdef LIBXML_EXPAT_COMPAT - REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "libxml", CONST_CS|CONST_PERSISTENT); -#else - REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "expat", CONST_CS|CONST_PERSISTENT); -#endif - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(xml) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "XML Support", "active"); - php_info_print_table_row(2, "XML Namespace Support", "active"); -#if defined(LIBXML_DOTTED_VERSION) && defined(LIBXML_EXPAT_COMPAT) - php_info_print_table_row(2, "libxml2 Version", LIBXML_DOTTED_VERSION); -#else - php_info_print_table_row(2, "EXPAT Version", XML_ExpatVersion()); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ extension-internal functions */ -static zval *_xml_resource_zval(long value) -{ - zval *ret; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(ret); - - Z_TYPE_P(ret) = IS_RESOURCE; - Z_LVAL_P(ret) = value; - - zend_list_addref(value); - - return ret; -} - -static zval *_xml_string_zval(const char *str) -{ - zval *ret; - int len = strlen(str); - MAKE_STD_ZVAL(ret); - - Z_TYPE_P(ret) = IS_STRING; - Z_STRLEN_P(ret) = len; - Z_STRVAL_P(ret) = estrndup(str, len); - return ret; -} - -static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encoding) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - - if (s == NULL) { - ZVAL_FALSE(ret); - return ret; - } - if (len == 0) { - len = _xml_xmlcharlen(s); - } - Z_TYPE_P(ret) = IS_STRING; - Z_STRVAL_P(ret) = xml_utf8_decode(s, len, &Z_STRLEN_P(ret), encoding); - return ret; -} -/* }}} */ - -/* {{{ xml_parser_dtor() */ -static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xml_parser *parser = (xml_parser *)rsrc->ptr; - - if (parser->parser) { - XML_ParserFree(parser->parser); - } - if (parser->ltags) { - int inx; - for (inx = 0; inx < parser->level; inx++) - efree(parser->ltags[ inx ]); - efree(parser->ltags); - } - if (parser->startElementHandler) { - zval_ptr_dtor(&parser->startElementHandler); - } - if (parser->endElementHandler) { - zval_ptr_dtor(&parser->endElementHandler); - } - if (parser->characterDataHandler) { - zval_ptr_dtor(&parser->characterDataHandler); - } - if (parser->processingInstructionHandler) { - zval_ptr_dtor(&parser->processingInstructionHandler); - } - if (parser->defaultHandler) { - zval_ptr_dtor(&parser->defaultHandler); - } - if (parser->unparsedEntityDeclHandler) { - zval_ptr_dtor(&parser->unparsedEntityDeclHandler); - } - if (parser->notationDeclHandler) { - zval_ptr_dtor(&parser->notationDeclHandler); - } - if (parser->externalEntityRefHandler) { - zval_ptr_dtor(&parser->externalEntityRefHandler); - } - if (parser->unknownEncodingHandler) { - zval_ptr_dtor(&parser->unknownEncodingHandler); - } - if (parser->startNamespaceDeclHandler) { - zval_ptr_dtor(&parser->startNamespaceDeclHandler); - } - if (parser->endNamespaceDeclHandler) { - zval_ptr_dtor(&parser->endNamespaceDeclHandler); - } - if (parser->baseURI) { - efree(parser->baseURI); - } - if (parser->object) { - zval_ptr_dtor(&parser->object); - } - - efree(parser); -} -/* }}} */ - -/* {{{ xml_set_handler() */ -static void xml_set_handler(zval **handler, zval **data) -{ - /* If we have already a handler, release it */ - if (*handler) { - zval_ptr_dtor(handler); - } - - /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */ - if (Z_TYPE_PP(data) != IS_ARRAY) { - convert_to_string_ex(data); - } - - zval_add_ref(data); - - *handler = *data; -} -/* }}} */ - -/* {{{ xml_call_handler() */ -static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval **argv) -{ - int i; - TSRMLS_FETCH(); - - if (parser && handler && !EG(exception)) { - zval ***args; - zval *retval; - int result; - zend_fcall_info fci; - - args = safe_emalloc(sizeof(zval **), argc, 0); - for (i = 0; i < argc; i++) { - args[i] = &argv[i]; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = handler; - fci.symbol_table = NULL; - fci.object_pp = &parser->object; - fci.retval_ptr_ptr = &retval; - fci.param_count = argc; - fci.params = args; - fci.no_separation = 0; - /*fci.function_handler_cache = &function_ptr;*/ - - result = zend_call_function(&fci, NULL TSRMLS_CC); - if (result == FAILURE) { - zval **method; - zval **obj; - - if (Z_TYPE_P(handler) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler)); - } else if (zend_hash_index_find(Z_ARRVAL_P(handler), 0, (void **) &obj) == SUCCESS && - zend_hash_index_find(Z_ARRVAL_P(handler), 1, (void **) &method) == SUCCESS && - Z_TYPE_PP(obj) == IS_OBJECT && - Z_TYPE_PP(method) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %v::%R()", Z_OBJCE_PP(obj)->name, Z_TYPE_PP(method), Z_UNIVAL_PP(method)); - } else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler"); - } - - for (i = 0; i < argc; i++) { - zval_ptr_dtor(args[i]); - } - efree(args); - - if (result == FAILURE) { - return NULL; - } else { - return EG(exception) ? NULL : retval; - } - } else { - for (i = 0; i < argc; i++) { - zval_ptr_dtor(&argv[i]); - } - return NULL; - } -} -/* }}} */ - -/* {{{ xml_encode_iso_8859_1() */ -inline static unsigned short xml_encode_iso_8859_1(unsigned char c) -{ - return (unsigned short)c; -} -/* }}} */ - -/* {{{ xml_decode_iso_8859_1() */ -inline static char xml_decode_iso_8859_1(unsigned short c) -{ - return (char)(c > 0xff ? '?' : c); -} -/* }}} */ - -/* {{{ xml_encode_us_ascii() */ -inline static unsigned short xml_encode_us_ascii(unsigned char c) -{ - return (unsigned short)c; -} -/* }}} */ - -/* {{{ xml_decode_us_ascii() */ -inline static char xml_decode_us_ascii(unsigned short c) -{ - return (char)(c > 0x7f ? '?' : c); -} -/* }}} */ - -/* {{{ xml_get_encoding() */ -static xml_encoding *xml_get_encoding(const XML_Char *name) -{ - xml_encoding *enc = &xml_encodings[0]; - - while (enc && enc->name) { - if (strcasecmp(name, enc->name) == 0) { - return enc; - } - enc++; - } - return NULL; -} -/* }}} */ - -/* {{{ xml_utf8_encode */ -static XML_Char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding) -{ - int pos = len; - char *newbuf; - unsigned int c; - unsigned short (*encoder)(unsigned char) = NULL; - xml_encoding *enc = xml_get_encoding(encoding); - - *newlen = 0; - if (enc) { - encoder = enc->encoding_function; - } else { - /* If the target encoding was unknown, fail */ - return NULL; - } - if (encoder == NULL) { - /* If no encoder function was specified, return the data as-is. - */ - newbuf = emalloc(len + 1); - memcpy(newbuf, s, len); - *newlen = len; - newbuf[*newlen] = '\0'; - return newbuf; - } - /* This is the theoretical max (will never get beyond len * 2 as long - * as we are converting from single-byte characters, though) */ - newbuf = safe_emalloc(len, 4, 1); - while (pos > 0) { - c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); - if (c < 0x80) { - newbuf[(*newlen)++] = (char) c; - } else if (c < 0x800) { - newbuf[(*newlen)++] = (0xc0 | (c >> 6)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } else if (c < 0x10000) { - newbuf[(*newlen)++] = (0xe0 | (c >> 12)); - newbuf[(*newlen)++] = (0xc0 | ((c >> 6) & 0x3f)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } else if (c < 0x200000) { - newbuf[(*newlen)++] = (0xf0 | (c >> 18)); - newbuf[(*newlen)++] = (0xe0 | ((c >> 12) & 0x3f)); - newbuf[(*newlen)++] = (0xc0 | ((c >> 6) & 0x3f)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } - pos--; - s++; - } - newbuf[*newlen] = 0; - newbuf = erealloc(newbuf, (*newlen)+1); - return newbuf; -} -/* }}} */ - -/* {{{ xml_utf8_decode */ -PHPAPI char *xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding) -{ - int pos = len; - char *newbuf = emalloc(len + 1); - unsigned short c; - char (*decoder)(unsigned short) = NULL; - xml_encoding *enc = xml_get_encoding(encoding); - - *newlen = 0; - if (enc) { - decoder = enc->decoding_function; - } - if (decoder == NULL) { - /* If the target encoding was unknown, or no decoder function - * was specified, return the UTF-8-encoded data as-is. - */ - memcpy(newbuf, s, len); - *newlen = len; - newbuf[*newlen] = '\0'; - return newbuf; - } - while (pos > 0) { - c = (unsigned char)(*s); - if (c >= 0xf0) { /* four bytes encoded, 21 bits */ - c = ((s[0]&7)<<18) | ((s[1]&63)<<12) | ((s[2]&63)<<6) | (s[3]&63); - s += 4; - pos -= 4; - } else if (c >= 0xe0) { /* three bytes encoded, 16 bits */ - c = ((s[0]&63)<<12) | ((s[1]&63)<<6) | (s[2]&63); - s += 3; - pos -= 3; - } else if (c >= 0xc0) { /* two bytes encoded, 11 bits */ - c = ((s[0]&63)<<6) | (s[1]&63); - s += 2; - pos -= 2; - } else { - s++; - pos--; - } - newbuf[*newlen] = decoder ? decoder(c) : c; - ++*newlen; - } - if (*newlen < len) { - newbuf = erealloc(newbuf, *newlen + 1); - } - newbuf[*newlen] = '\0'; - return newbuf; -} -/* }}} */ - -/* {{{ _xml_xmlcharlen() */ -static int _xml_xmlcharlen(const XML_Char *s) -{ - int len = 0; - - while (*s) { - len++; - s++; - } - return len; -} -/* }}} */ - -/* {{{ _xml_zval_strdup() */ -PHPAPI char *_xml_zval_strdup(zval *val) -{ - if (Z_TYPE_P(val) == IS_STRING) { - char *buf = emalloc(Z_STRLEN_P(val) + 1); - memcpy(buf, Z_STRVAL_P(val), Z_STRLEN_P(val)); - buf[Z_STRLEN_P(val)] = '\0'; - return buf; - } - return NULL; -} -/* }}} */ - -/* {{{ _xml_add_to_info */ -static void _xml_add_to_info(xml_parser *parser,char *name) -{ - zval **element, *values; - - if (! parser->info) { - return; - } - - if (zend_hash_find(Z_ARRVAL_P(parser->info),name,strlen(name) + 1,(void **) &element) == FAILURE) { - MAKE_STD_ZVAL(values); - - array_init(values); - - zend_hash_update(Z_ARRVAL_P(parser->info), name, strlen(name)+1, (void *) &values, sizeof(zval*), (void **) &element); - } - - add_next_index_long(*element,parser->curtag); - - parser->curtag++; -} -/* }}} */ - -/* {{{ _xml_decode_tag() */ -static char *_xml_decode_tag(xml_parser *parser, const char *tag) -{ - char *newstr; - int out_len; - - newstr = xml_utf8_decode(tag, strlen(tag), &out_len, parser->target_encoding); - - if (parser->case_folding) { - php_strtoupper(newstr, out_len); - } - - return newstr; -} -/* }}} */ - -/* {{{ _xml_startElementHandler() */ -void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Char **attributes) -{ - xml_parser *parser = (xml_parser *)userData; - const char **attrs = (const char **) attributes; - char *tag_name; - char *att, *val; - int val_len; - zval *retval, *args[3]; - - if (parser) { - parser->level++; - - tag_name = _xml_decode_tag(parser, name); - - if (parser->startElementHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(tag_name); - MAKE_STD_ZVAL(args[2]); - array_init(args[2]); - - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - - add_assoc_stringl(args[2], att, val, val_len, 0); - - attributes += 2; - - efree(att); - } - - if ((retval = xml_call_handler(parser, parser->startElementHandler, parser->startElementPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - zval *tag, *atr; - int atcnt = 0; - - MAKE_STD_ZVAL(tag); - MAKE_STD_ZVAL(atr); - - array_init(tag); - array_init(atr); - - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","open",1); - add_assoc_long(tag,"level",parser->level); - - parser->ltags[parser->level-1] = estrdup(tag_name); - parser->lastwasopen = 1; - - attributes = (const XML_Char **) attrs; - - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - - add_assoc_stringl(atr,att,val,val_len,0); - - atcnt++; - attributes += 2; - - efree(att); - } - - if (atcnt) { - zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); - } else { - zval_ptr_dtor(&atr); - } - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); - } - - efree(tag_name); - } -} -/* }}} */ - -/* {{{ _xml_endElementHandler() */ -void _xml_endElementHandler(void *userData, const XML_Char *name) -{ - xml_parser *parser = (xml_parser *)userData; - char *tag_name; - - if (parser) { - zval *retval, *args[2]; - - tag_name = _xml_decode_tag(parser, name); - - if (parser->endElementHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(tag_name); - - if ((retval = xml_call_handler(parser, parser->endElementHandler, parser->endElementPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - zval *tag; - - if (parser->lastwasopen) { - add_assoc_string(*(parser->ctag),"type","complete",1); - } else { - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","close",1); - add_assoc_long(tag,"level",parser->level); - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); - } - - parser->lastwasopen = 0; - } - - efree(tag_name); - - if (parser->ltags) { - efree(parser->ltags[parser->level-1]); - } - - parser->level--; - } -} -/* }}} */ - -/* {{{ _xml_characterDataHandler() */ -void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser) { - zval *retval, *args[2]; - - if (parser->characterDataHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->characterDataHandler, parser->characterDataPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - int i; - int doprint = 0; - - char *decoded_value; - int decoded_len; - - decoded_value = xml_utf8_decode(s,len,&decoded_len,parser->target_encoding); - for (i = 0; i < decoded_len; i++) { - switch (decoded_value[i]) { - case ' ': - case '\t': - case '\n': - continue; - default: - doprint = 1; - break; - } - if (doprint) { - break; - } - } - if (doprint || (! parser->skipwhite)) { - if (parser->lastwasopen) { - zval **myval; - - /* check if the current tag already has a value - if yes append to that! */ - if (zend_hash_find(Z_ARRVAL_PP(parser->ctag),"value",sizeof("value"),(void **) &myval) == SUCCESS) { - int newlen = Z_STRLEN_PP(myval) + decoded_len; - Z_STRVAL_PP(myval) = erealloc(Z_STRVAL_PP(myval),newlen+1); - strcpy(Z_STRVAL_PP(myval) + Z_STRLEN_PP(myval),decoded_value); - Z_STRLEN_PP(myval) += decoded_len; - efree(decoded_value); - } else { - add_assoc_string(*(parser->ctag),"value",decoded_value,0); - } - - } else { - zval *tag; - - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); - - add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); - add_assoc_string(tag,"value",decoded_value,0); - add_assoc_string(tag,"type","cdata",1); - add_assoc_long(tag,"level",parser->level); - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); - } - } else { - efree(decoded_value); - } - } - } -} -/* }}} */ - -/* {{{ _xml_processingInstructionHandler() */ -void _xml_processingInstructionHandler(void *userData, const XML_Char *target, const XML_Char *data) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->processingInstructionHandler) { - zval *retval, *args[3]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(target, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(data, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->processingInstructionHandler, parser->processingInstructionPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_defaultHandler() */ -void _xml_defaultHandler(void *userData, const XML_Char *s, int len) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->defaultHandler) { - zval *retval, *args[2]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->defaultHandler, parser->defaultPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_unparsedEntityDeclHandler() */ -void _xml_unparsedEntityDeclHandler(void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->unparsedEntityDeclHandler) { - zval *retval, *args[6]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(entityName, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - args[5] = _xml_xmlchar_zval(notationName, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->unparsedEntityDeclHandler, parser->unparsedEntityDeclPtr, 6, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_notationDeclHandler() */ -void _xml_notationDeclHandler(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->notationDeclHandler) { - zval *retval, *args[5]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(notationName, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->notationDeclHandler, parser->notationDeclPtr, 5, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_externalEntityRefHandler() */ -int _xml_externalEntityRefHandler(XML_Parser parserPtr, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - xml_parser *parser = XML_GetUserData(parserPtr); - int ret = 0; /* abort if no handler is set (should be configurable?) */ - - if (parser && parser->externalEntityRefHandler) { - zval *retval, *args[5]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(openEntityNames, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->externalEntityRefHandler, parser->externalEntityRefPtr, 5, args))) { - convert_to_long(retval); - ret = Z_LVAL_P(retval); - efree(retval); - } else { - ret = 0; - } - } - return ret; -} -/* }}} */ - -/* {{{ _xml_startNamespaceDeclHandler() */ -void _xml_startNamespaceDeclHandler(void *userData,const XML_Char *prefix, const XML_Char *uri) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->startNamespaceDeclHandler) { - zval *retval, *args[3]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(uri, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->startNamespaceDeclHandler, parser->startNamespaceDeclPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_endNamespaceDeclHandler() */ -void _xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->endNamespaceDeclHandler) { - zval *retval, *args[2]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->endNamespaceDeclHandler, parser->endNamespaceDeclPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/************************* EXTENSION FUNCTIONS *************************/ - -static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_support) -{ - xml_parser *parser; - int auto_detect = 0; - - char *encoding_param = NULL; - int encoding_param_len = 0; - - char *ns_param = NULL; - int ns_param_len = 0; - - XML_Char *encoding; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) { - RETURN_FALSE; - } - - if (encoding_param != NULL) { - /* The supported encoding types are hardcoded here because - * we are limited to the encodings supported by expat/xmltok. - */ - if (encoding_param_len == 0) { - encoding = XML(default_encoding); - auto_detect = 1; - } else if (strcasecmp(encoding_param, "ISO-8859-1") == 0) { - encoding = "ISO-8859-1"; - } else if (strcasecmp(encoding_param, "UTF-8") == 0) { - encoding = "UTF-8"; - } else if (strcasecmp(encoding_param, "US-ASCII") == 0) { - encoding = "US-ASCII"; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported source encoding \"%s\"", encoding_param); - RETURN_FALSE; - } - } else { - encoding = XML(default_encoding); - } - - if (ns_support && ns_param == NULL){ - ns_param = ":"; - } - - parser = ecalloc(sizeof(xml_parser), 1); - parser->parser = XML_ParserCreate_MM((auto_detect ? NULL : encoding), - &php_xml_mem_hdlrs, ns_param); - - parser->target_encoding = encoding; - parser->case_folding = 1; - parser->object = NULL; - parser->isparsing = 0; - - XML_SetUserData(parser->parser, parser); - - ZEND_REGISTER_RESOURCE(return_value, parser,le_xml_parser); - parser->index = Z_LVAL_P(return_value); -} - -/* {{{ proto resource xml_parser_create([string encoding]) - Create an XML parser */ -PHP_FUNCTION(xml_parser_create) -{ - php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]]) - Create an XML parser */ -PHP_FUNCTION(xml_parser_create_ns) -{ - php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int xml_set_object(resource parser, object &obj) - Set up object which should be used for callbacks */ -PHP_FUNCTION(xml_set_object) -{ - xml_parser *parser; - zval **pind, **mythis; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &pind, &mythis) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(mythis) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument 2 has wrong type"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ - if (parser->object) { - zval_ptr_dtor(&parser->object); - } - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ -/* #ifdef ZEND_ENGINE_2 - zval_add_ref(&parser->object); -#endif */ - - ALLOC_ZVAL(parser->object); - *parser->object = **mythis; - zval_copy_ctor(parser->object); - INIT_PZVAL(parser->object); - - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl) - Set up start and end element handlers */ -PHP_FUNCTION(xml_set_element_handler) -{ - xml_parser *parser; - zval **pind, **shdl, **ehdl; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &pind, &shdl, &ehdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->startElementHandler, shdl); - xml_set_handler(&parser->endElementHandler, ehdl); - XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_character_data_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->characterDataHandler, hdl); - XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl) - Set up processing instruction (PI) handler */ -PHP_FUNCTION(xml_set_processing_instruction_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->processingInstructionHandler, hdl); - XML_SetProcessingInstructionHandler(parser->parser, _xml_processingInstructionHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_default_handler(resource parser, string hdl) - Set up default handler */ -PHP_FUNCTION(xml_set_default_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->defaultHandler, hdl); - XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl) - Set up unparsed entity declaration handler */ -PHP_FUNCTION(xml_set_unparsed_entity_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->unparsedEntityDeclHandler, hdl); - XML_SetUnparsedEntityDeclHandler(parser->parser, _xml_unparsedEntityDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) - Set up notation declaration handler */ -PHP_FUNCTION(xml_set_notation_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->notationDeclHandler, hdl); - XML_SetNotationDeclHandler(parser->parser, _xml_notationDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl) - Set up external entity reference handler */ -PHP_FUNCTION(xml_set_external_entity_ref_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->externalEntityRefHandler, hdl); - XML_SetExternalEntityRefHandler(parser->parser, (void *) _xml_externalEntityRefHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_start_namespace_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->startNamespaceDeclHandler, hdl); - XML_SetStartNamespaceDeclHandler(parser->parser, _xml_startNamespaceDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_end_namespace_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->endNamespaceDeclHandler, hdl); - XML_SetEndNamespaceDeclHandler(parser->parser, _xml_endNamespaceDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parse(resource parser, string data [, int isFinal]) - Start parsing an XML document */ -PHP_FUNCTION(xml_parse) -{ - xml_parser *parser; - zval **pind, **data, **final; - int argc, isFinal, ret; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &pind, &data, &final) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_string_ex(data); - - if (argc == 3) { - convert_to_long_ex(final); - isFinal = Z_LVAL_PP(final); - } else { - isFinal = 0; - } - - parser->isparsing = 1; - ret = XML_Parse(parser->parser, Z_STRVAL_PP(data), Z_STRLEN_PP(data), isFinal); - parser->isparsing = 0; - RETVAL_LONG(ret); -} - -/* }}} */ - -/* {{{ proto int xml_parse_into_struct(resource parser, string data, array &struct, array &index) - Parsing a XML document */ - -PHP_FUNCTION(xml_parse_into_struct) -{ - xml_parser *parser; - zval **pind, **data, **xdata, **info = 0; - int argc, ret; - - argc = ZEND_NUM_ARGS(); - if (zend_get_parameters_ex(4, &pind, &data, &xdata,&info) == SUCCESS) { - zval_dtor(*info); - array_init(*info); - } else if (zend_get_parameters_ex(3, &pind, &data, &xdata) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_string_ex(data); - zval_dtor(*xdata); - array_init(*xdata); - - parser->data = *xdata; - if (info) - parser->info = *info; - parser->level = 0; - parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); - - XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); - XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); - XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler); - - parser->isparsing = 1; - ret = XML_Parse(parser->parser, Z_STRVAL_PP(data), Z_STRLEN_PP(data), 1); - parser->isparsing = 0; - - RETVAL_LONG(ret); -} -/* }}} */ - -/* {{{ proto int xml_get_error_code(resource parser) - Get XML parser error code */ -PHP_FUNCTION(xml_get_error_code) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG((long)XML_GetErrorCode(parser->parser)); -} -/* }}} */ - -/* {{{ proto string xml_error_string(int code) - Get XML parser error string */ -PHP_FUNCTION(xml_error_string) -{ - zval **code; - char *str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &code) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(code); - str = (char *)XML_ErrorString((int)Z_LVAL_PP(code)); - if (str) { - RETVAL_STRING(str, 1); - } -} -/* }}} */ - -/* {{{ proto int xml_get_current_line_number(resource parser) - Get current line number for an XML parser */ -PHP_FUNCTION(xml_get_current_line_number) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentLineNumber(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_get_current_column_number(resource parser) - Get current column number for an XML parser */ -PHP_FUNCTION(xml_get_current_column_number) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentColumnNumber(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_get_current_byte_index(resource parser) - Get current byte index for an XML parser */ -PHP_FUNCTION(xml_get_current_byte_index) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentByteIndex(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_parser_free(resource parser) - Free an XML parser */ -PHP_FUNCTION(xml_parser_free) -{ - zval **pind; - xml_parser *parser; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - if (parser->isparsing == 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parser cannot be freed while it is parsing."); - RETURN_FALSE; - } - - if (zend_list_delete(parser->index) == FAILURE) { - RETURN_FALSE; - } - - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value) - Set options in an XML parser */ -PHP_FUNCTION(xml_parser_set_option) -{ - xml_parser *parser; - zval **pind, **opt, **val; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &pind, &opt, &val) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_long_ex(opt); - - switch (Z_LVAL_PP(opt)) { - case PHP_XML_OPTION_CASE_FOLDING: - convert_to_long_ex(val); - parser->case_folding = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_SKIP_TAGSTART: - convert_to_long_ex(val); - parser->toffset = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_SKIP_WHITE: - convert_to_long_ex(val); - parser->skipwhite = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_TARGET_ENCODING: { - xml_encoding *enc; - convert_to_string_ex(val); - enc = xml_get_encoding(Z_STRVAL_PP(val)); - if (enc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_PP(val)); - RETURN_FALSE; - } - parser->target_encoding = enc->name; - break; - } - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option"); - RETURN_FALSE; - break; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parser_get_option(resource parser, int option) - Get options from an XML parser */ -PHP_FUNCTION(xml_parser_get_option) -{ - xml_parser *parser; - zval **pind, **opt; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &opt) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_long_ex(opt); - - switch (Z_LVAL_PP(opt)) { - case PHP_XML_OPTION_CASE_FOLDING: - RETURN_LONG(parser->case_folding); - break; - case PHP_XML_OPTION_TARGET_ENCODING: - RETURN_STRING(parser->target_encoding, 1); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option"); - RETURN_FALSE; - break; - } - - RETVAL_FALSE; /* never reached */ -} -/* }}} */ - -/* {{{ proto string utf8_encode(string data) - Encodes an ISO-8859-1 string to UTF-8 */ -PHP_FUNCTION(utf8_encode) -{ - zval **arg; - XML_Char *encoded; - int len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg); - encoded = xml_utf8_encode(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &len, "ISO-8859-1"); - if (encoded == NULL) { - RETURN_FALSE; - } - RETVAL_STRINGL(encoded, len, 0); -} -/* }}} */ - -/* {{{ proto string utf8_decode(string data) - Converts a UTF-8 encoded string to ISO-8859-1 */ -PHP_FUNCTION(utf8_decode) -{ - zval **arg; - XML_Char *decoded; - int len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg); - decoded = xml_utf8_decode(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &len, "ISO-8859-1"); - if (decoded == NULL) { - RETURN_FALSE; - } - RETVAL_STRINGL(decoded, len, 0); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/xml/xml.mak b/ext/xml/xml.mak deleted file mode 100644 index ab60f28eeddeb..0000000000000 --- a/ext/xml/xml.mak +++ /dev/null @@ -1,172 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = php_xml -MODULE_DESC = "PHP 5 - XML Extension" -VMAJ = 3 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = xml.c \ - start.c - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS += -c -maxerrors 25 -msgstyle gcc -C_FLAGS += -wchar_t on -bool on -C_FLAGS += -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DNEW_LIBC -C_FLAGS += -DCOMPILE_DL_XML -DHAVE_LIBEXPAT=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(EXPAT_DIR)/include - -ifndef STACK_SIZE -STACK_SIZE=8192 -endif - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off - C_FLAGS += -opt intrinsics - C_FLAGS += -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - -# Dependencies -MODULE = LibC \ - expatlbc \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(EXPAT_DIR)/imports/expatlbc.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $( $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/xmlreader/CREDITS b/ext/xmlreader/CREDITS deleted file mode 100644 index 35f3af1933050..0000000000000 --- a/ext/xmlreader/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -XMLReader -Rob Richards diff --git a/ext/xmlreader/README b/ext/xmlreader/README deleted file mode 100644 index 0d946f62da4b4..0000000000000 --- a/ext/xmlreader/README +++ /dev/null @@ -1,5 +0,0 @@ -XMLReader represents a reader that provides non-cached, -forward-only access to XML data. It is based upon the -xmlTextReader api from libxml - -This extension is designed to only work under PHP 5. diff --git a/ext/xmlreader/TODO b/ext/xmlreader/TODO deleted file mode 100644 index 744c56192a15a..0000000000000 --- a/ext/xmlreader/TODO +++ /dev/null @@ -1,8 +0,0 @@ -- Implement functions to support PHP 4 - -- Refactor internals once libxml 2.6.x is minimum requirement for PHP 5 - use new api for creating the xmlTextReaderPtr - -- Add Custom Error Handling - - diff --git a/ext/xmlreader/config.m4 b/ext/xmlreader/config.m4 deleted file mode 100644 index 42ee0c411a4c7..0000000000000 --- a/ext/xmlreader/config.m4 +++ /dev/null @@ -1,26 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(xmlreader, for XMLReader support, -[ --with-xmlreader Include XMLReader support]) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLReader: libxml2 install prefix], no, no) -fi - -if test "$PHP_XMLREADER" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XMLReader extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XMLREADER_SHARED_LIBADD, [ - AC_DEFINE(HAVE_XMLREADER,1,[ ]) - PHP_NEW_EXTENSION(xmlreader, php_xmlreader.c, $ext_shared) - PHP_SUBST(XMLREADER_SHARED_LIBADD) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/xmlreader/config.w32 b/ext/xmlreader/config.w32 deleted file mode 100644 index d77fccc8f61ac..0000000000000 --- a/ext/xmlreader/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xmlreader", "XMLReader support", "no"); - -if (PHP_XMLREADER == "yes" && PHP_LIBXML == "yes") { - EXTENSION("xmlreader", "php_xmlreader.c"); - AC_DEFINE("HAVE_XMLREADER", 1, "XMLReader support"); - if (!PHP_XMLREADER_SHARED) { - ADD_FLAG("CFLAGS_XMLREADER", "/D LIBXML_STATIC"); - } - ADD_EXTENSION_DEP('xmlreader', 'libxml'); -} - diff --git a/ext/xmlreader/examples/dtdexample.dtd b/ext/xmlreader/examples/dtdexample.dtd deleted file mode 100644 index ce53f0bc18c94..0000000000000 --- a/ext/xmlreader/examples/dtdexample.dtd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/ext/xmlreader/examples/dtdexample.xml b/ext/xmlreader/examples/dtdexample.xml deleted file mode 100644 index 052889c05d296..0000000000000 --- a/ext/xmlreader/examples/dtdexample.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Move Title 1 -Location 1 - - - -Move Title 2 - -Location 2 - - - diff --git a/ext/xmlreader/examples/relaxNG.rng b/ext/xmlreader/examples/relaxNG.rng deleted file mode 100644 index f4357e04ef8ab..0000000000000 --- a/ext/xmlreader/examples/relaxNG.rng +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/ext/xmlreader/examples/relaxNG.xml b/ext/xmlreader/examples/relaxNG.xml deleted file mode 100644 index 6b0cac1225050..0000000000000 --- a/ext/xmlreader/examples/relaxNG.xml +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/ext/xmlreader/examples/relaxNG2.rng b/ext/xmlreader/examples/relaxNG2.rng deleted file mode 100644 index 4adae7b15113d..0000000000000 --- a/ext/xmlreader/examples/relaxNG2.rng +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/examples/relaxNG3.rng b/ext/xmlreader/examples/relaxNG3.rng deleted file mode 100644 index 73e1eb6165102..0000000000000 --- a/ext/xmlreader/examples/relaxNG3.rng +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/examples/xmlreader.xml b/ext/xmlreader/examples/xmlreader.xml deleted file mode 100644 index 4c53743de66b5..0000000000000 --- a/ext/xmlreader/examples/xmlreader.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/xmlreader/examples/xmlreader_file.php b/ext/xmlreader/examples/xmlreader_file.php deleted file mode 100644 index 531e20b6f8b96..0000000000000 --- a/ext/xmlreader/examples/xmlreader_file.php +++ /dev/null @@ -1,20 +0,0 @@ -open('xmlreader.xml'); -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - print "Node Name: ".$reader->name."\n"; - print "Node Value: ".$reader->value."\n"; - print "Node Depth: ".$reader->depth."\n"; - if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - while ($attr) { - print " Attribute Name: ".$reader->name."\n"; - print " Attribute Value: ".$reader->value."\n"; - $attr = $reader->moveToNextAttribute(); - } - } - print "\n"; - } -} -?> diff --git a/ext/xmlreader/examples/xmlreader_relaxNG.php b/ext/xmlreader/examples/xmlreader_relaxNG.php deleted file mode 100644 index e56739a2fb267..0000000000000 --- a/ext/xmlreader/examples/xmlreader_relaxNG.php +++ /dev/null @@ -1,25 +0,0 @@ -open('relaxNG.xml'); -/* -Example setting relaxNG using string: -$reader->setRelaxNGSchemaSource(file_get_contents('relaxNG.rng')); -*/ -if ($reader->setRelaxNGSchema('relaxNG.rng')) { - while ($reader->read()) { - /* Print node name indenting it based on depth and $indent var */ - print str_repeat(" ", $reader->depth * $indent).$reader->name."\n"; - } -} - -print "\n"; - -if (! $reader->isValid()) { - print "Document is not valid\n"; -} else { - print "Document is valid\n"; -} - -?> \ No newline at end of file diff --git a/ext/xmlreader/examples/xmlreader_string.php b/ext/xmlreader/examples/xmlreader_string.php deleted file mode 100644 index f267245fd93f0..0000000000000 --- a/ext/xmlreader/examples/xmlreader_string.php +++ /dev/null @@ -1,31 +0,0 @@ - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - -'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - print "Node Name: ".$reader->name."\n"; - print "Node Value: ".$reader->value."\n"; - print "Node Depth: ".$reader->depth."\n"; - if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - while ($attr) { - print " Attribute Name: ".$reader->name."\n"; - print " Attribute Value: ".$reader->value."\n"; - $attr = $reader->moveToNextAttribute(); - } - } - print "\n"; - } -} -?> diff --git a/ext/xmlreader/examples/xmlreader_validatedtd.php b/ext/xmlreader/examples/xmlreader_validatedtd.php deleted file mode 100644 index 520a61ee30dde..0000000000000 --- a/ext/xmlreader/examples/xmlreader_validatedtd.php +++ /dev/null @@ -1,18 +0,0 @@ -open("dtdexample.xml"); -$xml->setParserProperty(XMLREADER::LOADDTD, TRUE); -$xml->setParserProperty(XMLREADER::VALIDATE, TRUE); -while($xml->read()) { - /* Print node name indenting it based on depth and $indent var */ - print str_repeat(" ", $xml->depth * $indent).$xml->name."\n"; - if ($xml->hasAttributes) { - $attCount = $xml->attributeCount; - print str_repeat(" ", $xml->depth * $indent)." Number of Attributes: ".$xml->attributeCount."\n"; - } -} -print "\n\nValid:\n"; -var_dump($xml->isValid()); -?> \ No newline at end of file diff --git a/ext/xmlreader/package.xml b/ext/xmlreader/package.xml deleted file mode 100644 index 6536b78c1f1c1..0000000000000 --- a/ext/xmlreader/package.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - xmlreader - Provides fast, non-cached, forward-only access to XML data under PHP 5. - - This extension wraps the libxml xmlReader API. The reader acts as a cursor - going forward on the document stream and stopping at each node in the way. - xmlReader is similar to SAX though uses a much simpler API. - - PHP License - - - rrichards - Rob Richards - rrichards@php.net - lead - - - chregu - lead - Christian Stocker - chregu@php.net - - - - - 1.0.1 - 2005-04-30 - stable - - Add workaround for next() bug when using libxml 2.6.17 and lower. - - - - - - 1.0 - 2004-07-27 - stable - - Add name parameter to next() to skip to next named sibling node. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - libxml - - diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c deleted file mode 100644 index 9a02147ce090e..0000000000000 --- a/ext/xmlreader/php_xmlreader.c +++ /dev/null @@ -1,1187 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xmlreader.h" -#ifdef HAVE_DOM -#include "ext/dom/xml_common.h" -#endif -#include - -zend_class_entry *xmlreader_class_entry; - -static zend_object_handlers xmlreader_object_handlers; - -static HashTable xmlreader_prop_handlers; - -typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader); -typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader); -typedef const unsigned char *(*xmlreader_read_const_char_t)(xmlTextReaderPtr reader); -typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval TSRMLS_DC); - -typedef unsigned char *(*xmlreader_read_one_char_t)(xmlTextReaderPtr reader, const unsigned char *); - -typedef struct _xmlreader_prop_handler { - xmlreader_read_int_t read_int_func; - xmlreader_read_const_char_t read_char_func; - xmlreader_write_t write_func; - int type; -} xmlreader_prop_handler; - -#define XMLREADER_LOAD_STRING 0 -#define XMLREADER_LOAD_FILE 1 - -static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype TSRMLS_DC) -{ - xmlreader_prop_handler hnd; - - hnd.read_char_func = read_char_func; - hnd.read_int_func = read_int_func; - hnd.type = rettype; - zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(xmlreader_prop_handler), NULL); -} - -static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval **retval TSRMLS_DC) -{ - const xmlChar *retchar = NULL; - int retint = 0; - - if (obj->ptr != NULL) { - if (hnd->read_char_func) { - retchar = hnd->read_char_func(obj->ptr); - } else { - if (hnd->read_int_func) { - retint = hnd->read_int_func(obj->ptr); - if (retint == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal libxml error returned"); - return FAILURE; - } - } - } - } - - ALLOC_ZVAL(*retval); - - switch (hnd->type) { - case IS_STRING: - if (retchar) { - ZVAL_STRING(*retval, (xmlChar *) retchar, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - break; - case IS_BOOL: - ZVAL_BOOL(*retval, retint); - break; - case IS_LONG: - ZVAL_LONG(*retval, retint); - break; - default: - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* {{{ xmlreader_read_property */ -zval *xmlreader_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - xmlreader_object *obj; - zval tmp_member; - zval *retval; - xmlreader_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - ret = xmlreader_property_reader(obj, hnd, &retval TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - retval->refcount = 0; - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -/* {{{ xmlreader_write_property */ -void xmlreader_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - xmlreader_object *obj; - zval tmp_member; - xmlreader_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write to read-only property"); - } else { - std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } -} -/* }}} */ - -/* _xmlreader_get_valid_file_path and _xmlreader_get_relaxNG should be made a - common function in libxml extension as code is common to a few xml extensions */ -char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr(source, ":"); - xmlParseURIReference(uri, escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */ - if (! VCWD_REALPATH(source, resolved_path)) { - expand_filepath(source, resolved_path TSRMLS_CC); - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} - -#ifdef LIBXML_SCHEMAS_ENABLED -static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, int source_len, int type, - xmlRelaxNGValidityErrorFunc error_func, - xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC) -{ - char *valid_file = NULL; - xmlRelaxNGParserCtxtPtr parser = NULL; - xmlRelaxNGPtr sptr; - char resolved_path[MAXPATHLEN + 1]; - - switch (type) { - case XMLREADER_LOAD_FILE: - valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - return NULL; - } - parser = xmlRelaxNGNewParserCtxt(valid_file); - break; - case XMLREADER_LOAD_STRING: - parser = xmlRelaxNGNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return NULL; - } - - if (parser == NULL) { - return NULL; - } - - if (error_func || warn_func) { - xmlRelaxNGSetParserErrors(parser, - (xmlRelaxNGValidityErrorFunc) error_func, - (xmlRelaxNGValidityWarningFunc) warn_func, - parser); - } - sptr = xmlRelaxNGParse(parser); - xmlRelaxNGFreeParserCtxt(parser); - - return sptr; -} -#endif - -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep xmlreader_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; -#endif - -/* {{{ xmlreader_module_entry - */ -zend_module_entry xmlreader_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - xmlreader_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "xmlreader", - NULL, - PHP_MINIT(xmlreader), - PHP_MSHUTDOWN(xmlreader), - NULL, - NULL, - PHP_MINFO(xmlreader), - "0.1", /* Replace with version number for your extension */ - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XMLREADER -ZEND_GET_MODULE(xmlreader) -#endif - -/* {{{ xmlreader_objects_clone */ -void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - /* TODO */ -} -/* }}} */ - -static void xmlreader_free_resources(xmlreader_object *intern) { - if (intern) { - if (intern->ptr) { - xmlFreeTextReader(intern->ptr); - intern->ptr = NULL; - } -#ifdef LIBXML_SCHEMAS_ENABLED - if (intern->schema) { - xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema); - intern->schema = NULL; - } -#endif - } -} - -/* {{{ xmlreader_objects_free_storage */ -void xmlreader_objects_free_storage(void *object TSRMLS_DC) -{ - xmlreader_object *intern = (xmlreader_object *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - xmlreader_free_resources(intern); - - efree(object); -} -/* }}} */ - -/* {{{ xmlreader_objects_new */ -zend_object_value xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - xmlreader_object *intern; - zval *tmp; - - intern = emalloc(sizeof(xmlreader_object)); - intern->std.ce = class_type; - intern->std.in_get = 0; - intern->std.in_set = 0; - intern->ptr = NULL; - intern->schema = NULL; - intern->prop_handler = &xmlreader_prop_handlers; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) xmlreader_objects_free_storage, xmlreader_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = &xmlreader_object_handlers; - return retval; -} -/* }}} */ - -static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_one_char_t internal_function) { - zval *id; - int name_len = 0; - char *retchar = NULL; - xmlreader_object *intern; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - if (!name_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument cannot be an empty string"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = internal_function(intern->ptr, name); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETVAL_EMPTY_STRING(); - } -} - -static void php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_int_t internal_function) { - zval *id; - int retval; - xmlreader_object *intern; - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = internal_function(intern->ptr); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} - -static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) { - zval *id; - char *retchar = NULL; - xmlreader_object *intern; - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = internal_function(intern->ptr); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETVAL_EMPTY_STRING(); - } -} - -static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) { -#ifdef LIBXML_SCHEMAS_ENABLED - zval *id; - int source_len = 0, retval = -1; - xmlreader_object *intern; - xmlRelaxNGPtr schema = NULL; - char *source; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) { - return; - } - - if (source != NULL && !source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is requried"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - if (source) { - schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC); - if (schema) { - retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, schema); - } - } else { - /* unset the associated relaxNG context and schema if one exists */ - retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, NULL); - } - - if (retval == 0) { - if (intern->schema) { - xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema); - } - - intern->schema = schema; - - RETURN_TRUE; - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors."); - - RETURN_FALSE; -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml."); - - RETURN_FALSE; -#endif -} - -/* {{{ proto boolean close() -Closes xmlreader - current frees resources until xmlTextReaderClose is fixed in libxml */ -PHP_METHOD(xmlreader, close) -{ - zval *id; - xmlreader_object *intern; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - /* libxml is segfaulting in versions up to 2.6.8 using xmlTextReaderClose so for - now we will free the whole reader when close is called as it would get rebuilt on - a new load anyways */ - xmlreader_free_resources(intern); - - RETURN_TRUE; -} - -/* {{{ proto string getAttribute(string name) -Get value of an attribute from current element */ -PHP_METHOD(xmlreader, getAttribute) -{ - php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderGetAttribute); -} -/* }}} */ - -/* {{{ proto string getAttributeNo(int index) -Get value of an attribute at index from current element */ -PHP_METHOD(xmlreader, getAttributeNo) -{ - zval *id; - long attr_pos; - char *retchar = NULL; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = xmlTextReaderGetAttributeNo(intern->ptr,attr_pos); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto string getAttributeNs(string name, string namespaceURI) -Get value of a attribute via name and namespace from current element */ -PHP_METHOD(xmlreader, getAttributeNs) -{ - zval *id; - int name_len = 0, ns_uri_len = 0; - xmlreader_object *intern; - char *name, *ns_uri, *retchar = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - if (name_len == 0 || ns_uri_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = xmlTextReaderGetAttributeNs(intern->ptr, name, ns_uri); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto boolean getParserProperty(int property) -Indicates wether given property (one of the parser option constants) is set or not on parser */ -PHP_METHOD(xmlreader, getParserProperty) -{ - zval *id; - long property; - int retval = -1; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &property) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderGetParserProp(intern->ptr,property); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property"); - RETURN_FALSE; - } - - RETURN_BOOL(retval); -} -/* }}} */ - -/* {{{ proto boolean isValid() -Returns boolean indicating if parsed document is valid or not. -Must set XMLREADER_LOADDTD or XMLREADER_VALIDATE parser option prior to the first call to read -or this method will always return FALSE */ -PHP_METHOD(xmlreader, isValid) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderIsValid); -} -/* }}} */ - -/* {{{ proto string lookupNamespace(string prefix) -Return namespaceURI for associated prefix on current node */ -PHP_METHOD(xmlreader, lookupNamespace) -{ - php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderLookupNamespace); -} -/* }}} */ - -/* {{{ proto boolean moveToAttribute(string name) -Positions reader at specified attribute - Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttribute) -{ - zval *id; - int name_len = 0, retval; - xmlreader_object *intern; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttribute(intern->ptr, name); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean moveToAttributeNo(int index) -Positions reader at attribute at spcecified index. -Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNo) -{ - zval *id; - long attr_pos; - int retval; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttributeNo(intern->ptr, attr_pos); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean moveToAttributeNs(string name, string namespaceURI) -Positions reader at attribute spcified by name and namespaceURI. -Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNs) -{ - zval *id; - int name_len=0, ns_uri_len=0, retval; - xmlreader_object *intern; - char *name, *ns_uri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - if (name_len == 0 || ns_uri_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttributeNs(intern->ptr, name, ns_uri); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean moveToElement() -Moves the position of the current instance to the node that contains the current Attribute node. */ -PHP_METHOD(xmlreader, moveToElement) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToElement); -} -/* }}} */ - -/* {{{ proto boolean moveToFirstAttribute() -Moves the position of the current instance to the first attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToFirstAttribute) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToFirstAttribute); -} -/* }}} */ - -/* {{{ proto boolean moveToNextAttribute() -Moves the position of the current instance to the next attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToNextAttribute) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToNextAttribute); -} -/* }}} */ - -/* {{{ proto boolean read() -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, read) -{ - zval *id; - int retval; - xmlreader_object *intern; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - retval = xmlTextReaderRead(intern->ptr); - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); - RETURN_FALSE; - } else { - RETURN_BOOL(retval); - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean next([string localname]) -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, next) -{ - zval *id; - int retval, name_len=0; - xmlreader_object *intern; - char *name = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { - return; - } - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { -#if LIBXML_VERSION <= 20617 - /* Bug in libxml prevents a next in certain cases when positioned on end of element */ - if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) { - retval = xmlTextReaderRead(intern->ptr); - } else -#endif - retval = xmlTextReaderNext(intern->ptr); - while (name != NULL && retval == 1) { - if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), name)) { - RETURN_TRUE; - } - retval = xmlTextReaderNext(intern->ptr); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); - RETURN_FALSE; - } else { - RETURN_BOOL(retval); - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean open(string URI [, string encoding [, int options]]) -Sets the URI that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, open) -{ - zval *id; - int source_len = 0, encoding_len = 0; - long options = 0; - xmlreader_object *intern; - char *source, *valid_file = NULL; - char *encoding = NULL; - char resolved_path[MAXPATHLEN + 1]; - xmlTextReaderPtr reader = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) { - return; - } - - id = getThis(); - if (id != NULL) { - if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) { - id = NULL; - } else { - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - xmlreader_free_resources(intern); - } - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - - if (valid_file) { - xmlNewTextReaderFilename(valid_file); - reader = xmlReaderForFile(valid_file, encoding, options); - } - - if (reader == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open source data"); - RETURN_FALSE; - } - - if (id == NULL) { - object_init_ex(return_value, xmlreader_class_entry); - intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC); - intern->ptr = reader; - return; - } - - intern->ptr = reader; - - RETURN_TRUE; - -} -/* }}} */ - -/* Not Yet Implemented in libxml - functions exist just not coded -PHP_METHOD(xmlreader, resetState) -{ - -} -*/ - -#if LIBXML_VERSION >= 20620 -PHP_METHOD(xmlreader, readInnerXml) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml); -} - -PHP_METHOD(xmlreader, readOuterXml) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadOuterXml); -} - -PHP_METHOD(xmlreader, readString) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString); -} -#endif - -/* {{{ proto boolean setParserProperty(int property, boolean value) -Sets parser property (one of the parser option constants). -Properties must be set after open() or XML() and before the first read() is called */ -PHP_METHOD(xmlreader, setParserProperty) -{ - zval *id; - long property; - int retval = -1; - zend_bool value; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &property, &value) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderSetParserProp(intern->ptr,property, value); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property"); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto boolean setRelaxNGSchemaSource(string filename) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchema) -{ - php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_FILE); -} -/* }}} */ - -/* {{{ proto boolean setRelaxNGSchemaSource(string source) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchemaSource) -{ - php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_STRING); -} -/* }}} */ - -/* TODO -XMLPUBFUN int XMLCALL - xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, - const char *xsd); -XMLPUBFUN int XMLCALL - xmlTextReaderSetSchema (xmlTextReaderPtr reader, - xmlSchemaPtr schema); -*/ - -/* {{{ proto boolean XML(string source [, string encoding [, int options]]) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, XML) -{ - zval *id; - int source_len = 0, encoding_len = 0; - long options = 0; - xmlreader_object *intern; - char *source, *uri = NULL, *encoding = NULL; - int resolved_path_len; - char *directory=NULL, resolved_path[MAXPATHLEN]; - xmlTextReaderPtr reader; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) { - return; - } - - id = getThis(); - if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) { - id = NULL; - } - if (id != NULL) { - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - xmlreader_free_resources(intern); - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - -/* Get the URI of the current script so that we can set the base directory in libxml */ -#if HAVE_GETCWD - directory = VCWD_GETCWD(resolved_path, MAXPATHLEN); -#elif HAVE_GETWD - directory = VCWD_GETWD(resolved_path); -#endif - if (directory) { - resolved_path_len = strlen(resolved_path); - if (resolved_path[resolved_path_len - 1] != DEFAULT_SLASH) { - resolved_path[resolved_path_len] = DEFAULT_SLASH; - resolved_path[++resolved_path_len] = '\0'; - } - uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path); - } - - reader = xmlReaderForMemory(source, source_len, uri, encoding, options); - - if (uri) { - xmlFree(uri); - } - - if (reader != NULL) { - if (id == NULL) { - object_init_ex(return_value, xmlreader_class_entry); - intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC); - intern->ptr = reader; - return; - } else { - intern->ptr = reader; - RETURN_TRUE; - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load source data"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean expand() -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, expand) -{ -#ifdef HAVE_DOM - zval *id, *rv = NULL; - int ret; - xmlreader_object *intern; - xmlNode *node, *nodec; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - - if (intern && intern->ptr) { - node = xmlTextReaderExpand(intern->ptr); - - if (node == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding "); - RETURN_FALSE; - } else { - nodec = xmlCopyNode(node, 1); - DOM_RET_OBJ(rv, nodec, &ret, NULL); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand"); - RETURN_FALSE; - } -#else - php_error(E_WARNING, "DOM support is not enabled"); - return; -#endif -} -/* }}} */ - -static zend_function_entry xmlreader_functions[] = { - PHP_ME(xmlreader, close, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNo, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNs, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getParserProperty, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, isValid, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, lookupNamespace, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNo, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNs, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToElement, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToFirstAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToNextAttribute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, open, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(xmlreader, read, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, next, NULL, ZEND_ACC_PUBLIC) -#if LIBXML_VERSION >= 20620 - PHP_ME(xmlreader, readInnerXml, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readOuterXml, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readString, NULL, ZEND_ACC_PUBLIC) -#endif -/* Not Yet Implemented though defined in libxml as of 2.6.9dev - PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC) -*/ - PHP_ME(xmlreader, setParserProperty, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchema, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchemaSource, NULL, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, XML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(xmlreader, expand, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(xmlreader) -{ - - zend_class_entry ce; - - memcpy(&xmlreader_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xmlreader_object_handlers.read_property = xmlreader_read_property; - xmlreader_object_handlers.write_property = xmlreader_write_property; - xmlreader_object_handlers.get_property_ptr_ptr = NULL; - - INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); - ce.create_object = xmlreader_objects_new; - xmlreader_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - zend_hash_init(&xmlreader_prop_handlers, 0, NULL, NULL, 1); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING TSRMLS_CC); - - /* Constants for NodeType - cannot define common types to share with dom as there are differences in these types */ - - REGISTER_XMLREADER_CLASS_CONST_LONG("NONE", XML_READER_TYPE_NONE); - REGISTER_XMLREADER_CLASS_CONST_LONG("ELEMENT", XML_READER_TYPE_ELEMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("ATTRIBUTE", XML_READER_TYPE_ATTRIBUTE); - REGISTER_XMLREADER_CLASS_CONST_LONG("TEXT", XML_READER_TYPE_TEXT); - REGISTER_XMLREADER_CLASS_CONST_LONG("CDATA", XML_READER_TYPE_CDATA); - REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY_REF", XML_READER_TYPE_ENTITY_REFERENCE); - REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY", XML_READER_TYPE_ENTITY); - REGISTER_XMLREADER_CLASS_CONST_LONG("PI", XML_READER_TYPE_PROCESSING_INSTRUCTION); - REGISTER_XMLREADER_CLASS_CONST_LONG("COMMENT", XML_READER_TYPE_COMMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC", XML_READER_TYPE_DOCUMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_TYPE", XML_READER_TYPE_DOCUMENT_TYPE); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_FRAGMENT", XML_READER_TYPE_DOCUMENT_FRAGMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("NOTATION", XML_READER_TYPE_NOTATION); - REGISTER_XMLREADER_CLASS_CONST_LONG("WHITESPACE", XML_READER_TYPE_WHITESPACE); - REGISTER_XMLREADER_CLASS_CONST_LONG("SIGNIFICANT_WHITESPACE", XML_READER_TYPE_SIGNIFICANT_WHITESPACE); - REGISTER_XMLREADER_CLASS_CONST_LONG("END_ELEMENT", XML_READER_TYPE_END_ELEMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("END_ENTITY", XML_READER_TYPE_END_ENTITY); - REGISTER_XMLREADER_CLASS_CONST_LONG("XML_DECLARATION", XML_READER_TYPE_XML_DECLARATION); - - /* Constants for Parser options */ - REGISTER_XMLREADER_CLASS_CONST_LONG("LOADDTD", XML_PARSER_LOADDTD); - REGISTER_XMLREADER_CLASS_CONST_LONG("DEFAULTATTRS", XML_PARSER_DEFAULTATTRS); - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDATE", XML_PARSER_VALIDATE); - REGISTER_XMLREADER_CLASS_CONST_LONG("SUBST_ENTITIES", XML_PARSER_SUBST_ENTITIES); - - /* Constants for Errors when loading - not yet used until we implement custom error handling - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_WARNING", XML_PARSER_SEVERITY_VALIDITY_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_ERROR", XML_PARSER_SEVERITY_VALIDITY_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("WARNING", XML_PARSER_SEVERITY_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("ERROR", XML_PARSER_SEVERITY_ERROR, CONST_CS | CONST_PERSISTENT); - */ - - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(xmlreader) -{ - zend_hash_destroy(&xmlreader_prop_handlers); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(xmlreader) -{ - php_info_print_table_start(); - { - php_info_print_table_row(2, "XMLReader", "enabled"); - } - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h deleted file mode 100644 index d7fa701d36edd..0000000000000 --- a/ext/xmlreader/php_xmlreader.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XMLREADER_H -#define PHP_XMLREADER_H - -extern zend_module_entry xmlreader_module_entry; -#define phpext_xmlreader_ptr &xmlreader_module_entry - -#ifdef PHP_WIN32 -#define PHP_XMLREADER_API __declspec(dllexport) -#else -#define PHP_XMLREADER_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include "ext/libxml/php_libxml.h" -#include - -typedef struct _xmlreader_object { - zend_object std; - xmlTextReaderPtr ptr; - void *schema; - HashTable *prop_handler; - zend_object_handle handle; -} xmlreader_object; - -PHP_MINIT_FUNCTION(xmlreader); -PHP_MSHUTDOWN_FUNCTION(xmlreader); -PHP_MINFO_FUNCTION(xmlreader); - -#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \ - zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); - -#ifdef ZTS -#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v) -#else -#define XMLREADER_G(v) (xmlreader_globals.v) -#endif - -#endif /* PHP_XMLREADER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlreader/xmlreader.dsp b/ext/xmlreader/xmlreader.dsp deleted file mode 100644 index 7b21518ba3198..0000000000000 --- a/ext/xmlreader/xmlreader.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlreader" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlreader - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlreader.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlreader.mak" CFG="xmlreader - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlreader - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlreader - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlreader - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "xmlreader___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "xmlreader___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XMLREADER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ELSEIF "$(CFG)" == "xmlreader - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "xmlreader___Win32_Release_TS0" -# PROP BASE Intermediate_Dir "xmlreader___Win32_Release_TS0" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c -# SUBTRACT CPP /Fr -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# ADD LINK32 php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /incremental:no /machine:I386 /out:"..\..\Release_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "xmlreader - Win32 Debug_TS" -# Name "xmlreader - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xmlreader.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlreader.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xmlrpc/CREDITS b/ext/xmlrpc/CREDITS deleted file mode 100644 index cfb14faf804ea..0000000000000 --- a/ext/xmlrpc/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -xmlrpc -Dan Libby diff --git a/ext/xmlrpc/EXPERIMENTAL b/ext/xmlrpc/EXPERIMENTAL deleted file mode 100644 index 6443e99646410..0000000000000 --- a/ext/xmlrpc/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4 deleted file mode 100644 index 34bfa919bdf15..0000000000000 --- a/ext/xmlrpc/config.m4 +++ /dev/null @@ -1,118 +0,0 @@ -dnl -dnl $Id$ -dnl - -sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4) -sinclude(ext/xmlrpc/libxmlrpc/xmlrpc.m4) -sinclude(libxmlrpc/acinclude.m4) -sinclude(libxmlrpc/xmlrpc.m4) - -PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support, -[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support]) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no) -fi - -PHP_ARG_WITH(libexpat-dir, libexpat dir for XMLRPC-EPI, -[ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no) - -PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI, -[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no) - -if test "$PHP_XMLRPC" != "no"; then - - PHP_ADD_EXTENSION_DEP(xmlrpc, libxml) - PHP_SUBST(XMLRPC_SHARED_LIBADD) - AC_DEFINE(HAVE_XMLRPC,1,[ ]) - - dnl - dnl Default to libxml2 if --with-libexpat-dir is not used - dnl - if test "$PHP_LIBEXPAT_DIR" = "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XML-RPC extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XMLRPC_SHARED_LIBADD, [ - if test "$PHP_XML" = "no"; then - PHP_ADD_SOURCES(ext/xml, compat.c) - PHP_ADD_BUILD_DIR(ext/xml) - fi - ], [ - AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=]) - ]) - else - testval=no - for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do - if test -f $i/$PHP_LIBDIR/libexpat.a -o -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then - AC_DEFINE(HAVE_LIBEXPAT,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH(expat, $i/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD) - PHP_ADD_INCLUDE($i/include) - testval=yes - break - fi - done - - if test "$testval" = "no"; then - AC_MSG_ERROR([XML-RPC support requires libexpat. Use --with-libexpat-dir= (deprecated!)]) - fi - fi - - if test "$PHP_ICONV_DIR" != "no"; then - PHP_ICONV=$PHP_ICONV_DIR - fi - - if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then - PHP_ICONV=yes - fi - - PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [ - AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library]) - ]) -fi - -if test "$PHP_XMLRPC" = "yes"; then - XMLRPC_CHECKS - PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \ - libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ - libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ - libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ - libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ - libxmlrpc/xml_to_soap.c,$ext_shared,, - -I@ext_srcdir@/libxmlrpc -DVERSION="0.50") - PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc) - XMLRPC_MODULE_TYPE=builtin - -elif test "$PHP_XMLRPC" != "no"; then - - if test -r $PHP_XMLRPC/include/xmlrpc.h; then - XMLRPC_DIR=$PHP_XMLRPC/include - elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then -dnl some xmlrpc-epi header files have generic file names like -dnl queue.h or base64.h. Distributions have to create dir -dnl for xmlrpc-epi because of this. - XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi - else - AC_MSG_CHECKING(for XMLRPC-EPI in default path) - for i in /usr/local /usr; do - if test -r $i/include/xmlrpc.h; then - XMLRPC_DIR=$i/include - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$XMLRPC_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the XMLRPC-EPI distribution) - fi - - PHP_ADD_INCLUDE($XMLRPC_DIR) - PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD) - PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared) - XMLRPC_MODULE_TYPE=external -fi diff --git a/ext/xmlrpc/config.w32 b/ext/xmlrpc/config.w32 deleted file mode 100644 index 8c399cd147935..0000000000000 --- a/ext/xmlrpc/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xmlrpc", "XMLRPC-EPI support", "no"); - -if (PHP_XMLRPC != "no") { - CHECK_HEADER_ADD_INCLUDE("xmlrpc.h", "CFLAGS_XMLRPC", configure_module_dirname + "/libxmlrpc"); - EXTENSION('xmlrpc', 'xmlrpc-epi-php.c', PHP_XMLRPC_SHARED, "-DVERSION=\"0.50\""); - ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \ - xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \ - queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc"); - ADD_EXTENSION_DEP('xmlrpc', 'libxml'); -} - diff --git a/ext/xmlrpc/libxmlrpc/README b/ext/xmlrpc/libxmlrpc/README deleted file mode 100644 index 323edfa67185b..0000000000000 --- a/ext/xmlrpc/libxmlrpc/README +++ /dev/null @@ -1,17 +0,0 @@ -organization of this directory is moving towards this approach: - -.h -- public API and data types -_private.h -- protected API and data types -.c -- implementation and private API / types - -The rules are: -.c files may include *_private.h. -.h files may not include *_private.h - -This allows us to have a nicely encapsulated C api with opaque data types and private functions -that are nonetheless shared between source files without redundant extern declarations.. - - - - - diff --git a/ext/xmlrpc/libxmlrpc/acinclude.m4 b/ext/xmlrpc/libxmlrpc/acinclude.m4 deleted file mode 100644 index 49b6090f6b068..0000000000000 --- a/ext/xmlrpc/libxmlrpc/acinclude.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# Local macros for automake & autoconf - -AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[ - -# Standard XMLRPC list -AC_CHECK_FUNCS( \ - strtoul strtoull snprintf \ - strstr strpbrk strerror\ - memcpy memmove) - -]) - -AC_DEFUN([XMLRPC_HEADER_CHECKS],[ -AC_HEADER_STDC -AC_CHECK_HEADERS(xmlparse.h xmltok.h stdlib.h strings.h string.h) -]) - -AC_DEFUN([XMLRPC_TYPE_CHECKS],[ - -AC_REQUIRE([AC_C_CONST]) -AC_REQUIRE([AC_C_INLINE]) -AC_CHECK_SIZEOF(char, 1) - -AC_CHECK_SIZEOF(int, 4) -AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(long long, 8) -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_TYPE_UID_T - - -]) diff --git a/ext/xmlrpc/libxmlrpc/base64.c b/ext/xmlrpc/libxmlrpc/base64.c deleted file mode 100644 index 7788d028d7859..0000000000000 --- a/ext/xmlrpc/libxmlrpc/base64.c +++ /dev/null @@ -1,192 +0,0 @@ -static const char rcsid[] = "#(@) $Id$"; - -/* - - Encode or decode file as MIME base64 (RFC 1341) - - by John Walker - http://www.fourmilab.ch/ - - This program is in the public domain. - -*/ -#include - -/* ENCODE -- Encode binary file into base64. */ -#include -#include - -#include "base64.h" - -static unsigned char dtable[512]; - -void buffer_new(struct buffer_st *b) -{ - b->length = 512; - b->data = malloc(sizeof(char)*(b->length)); - b->data[0] = 0; - b->ptr = b->data; - b->offset = 0; -} - -void buffer_add(struct buffer_st *b, char c) -{ - *(b->ptr++) = c; - b->offset++; - if (b->offset == b->length) { - b->length += 512; - b->data = realloc(b->data, b->length); - b->ptr = b->data + b->offset; - } -} - -void buffer_delete(struct buffer_st *b) -{ - free(b->data); - b->length = 0; - b->offset = 0; - b->ptr = NULL; - b->data = NULL; -} - -void base64_encode(struct buffer_st *b, const char *source, int length) -{ - int i, hiteof = 0; - int offset = 0; - int olen; - - olen = 0; - - buffer_new(b); - - /* Fill dtable with character encodings. */ - - for (i = 0; i < 26; i++) { - dtable[i] = 'A' + i; - dtable[26 + i] = 'a' + i; - } - for (i = 0; i < 10; i++) { - dtable[52 + i] = '0' + i; - } - dtable[62] = '+'; - dtable[63] = '/'; - - while (!hiteof) { - unsigned char igroup[3], ogroup[4]; - int c, n; - - igroup[0] = igroup[1] = igroup[2] = 0; - for (n = 0; n < 3; n++) { - c = *(source++); - offset++; - if (offset > length) { - hiteof = 1; - break; - } - igroup[n] = (unsigned char) c; - } - if (n > 0) { - ogroup[0] = dtable[igroup[0] >> 2]; - ogroup[1] = dtable[((igroup[0] & 3) << 4) | (igroup[1] >> 4)]; - ogroup[2] = dtable[((igroup[1] & 0xF) << 2) | (igroup[2] >> 6)]; - ogroup[3] = dtable[igroup[2] & 0x3F]; - - /* Replace characters in output stream with "=" pad - characters if fewer than three characters were - read from the end of the input stream. */ - - if (n < 3) { - ogroup[3] = '='; - if (n < 2) { - ogroup[2] = '='; - } - } - for (i = 0; i < 4; i++) { - buffer_add(b, ogroup[i]); - if (!(b->offset % 72)) { - /* buffer_add(b, '\r'); */ - buffer_add(b, '\n'); - } - } - } - } - /* buffer_add(b, '\r'); */ - buffer_add(b, '\n'); -} - -void base64_decode(struct buffer_st *bfr, const char *source, int length) -{ - int i; - int offset = 0; - int endoffile; - int count; - - buffer_new(bfr); - - for (i = 0; i < 255; i++) { - dtable[i] = 0x80; - } - for (i = 'A'; i <= 'Z'; i++) { - dtable[i] = 0 + (i - 'A'); - } - for (i = 'a'; i <= 'z'; i++) { - dtable[i] = 26 + (i - 'a'); - } - for (i = '0'; i <= '9'; i++) { - dtable[i] = 52 + (i - '0'); - } - dtable['+'] = 62; - dtable['/'] = 63; - dtable['='] = 0; - - endoffile = 0; - - /*CONSTANTCONDITION*/ - while (1) { - unsigned char a[4], b[4], o[3]; - - for (i = 0; i < 4; i++) { - int c; - while (1) { - c = *(source++); - offset++; - if (offset > length) endoffile = 1; - if (isspace(c) || c == '\n' || c == '\r') continue; - break; - } - - if (endoffile) { - /* - if (i > 0) { - fprintf(stderr, "Input file incomplete.\n"); - exit(1); - } - */ - return; - } - - if (dtable[c] & 0x80) { - /* - fprintf(stderr, "Offset %i length %i\n", offset, length); - fprintf(stderr, "character '%c:%x:%c' in input file.\n", c, c, dtable[c]); - exit(1); - */ - i--; - continue; - } - a[i] = (unsigned char) c; - b[i] = (unsigned char) dtable[c]; - } - o[0] = (b[0] << 2) | (b[1] >> 4); - o[1] = (b[1] << 4) | (b[2] >> 2); - o[2] = (b[2] << 6) | b[3]; - i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3); - count = 0; - while (count < i) { - buffer_add(bfr, o[count++]); - } - if (i < 3) { - return; - } - } -} diff --git a/ext/xmlrpc/libxmlrpc/base64.h b/ext/xmlrpc/libxmlrpc/base64.h deleted file mode 100644 index 4cf156ad1e6f8..0000000000000 --- a/ext/xmlrpc/libxmlrpc/base64.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Encode or decode file as MIME base64 (RFC 1341) - - by John Walker - http://www.fourmilab.ch/ - - This program is in the public domain. - -*/ - - -struct buffer_st { - char *data; - int length; - char *ptr; - int offset; -}; - -void buffer_new(struct buffer_st *b); -void buffer_add(struct buffer_st *b, char c); -void buffer_delete(struct buffer_st *b); - -void base64_encode(struct buffer_st *b, const char *source, int length); -void base64_decode(struct buffer_st *b, const char *source, int length); - -/* -#define DEBUG_MALLOC - */ - -#ifdef DEBUG_MALLOC -void *_malloc_real(size_t s, char *file, int line); -void _free_real(void *p, char *file, int line); - -#define malloc(s) _malloc_real(s,__FILE__,__LINE__) -#define free(p) _free_real(p, __FILE__,__LINE__) -#endif - diff --git a/ext/xmlrpc/libxmlrpc/encodings.c b/ext/xmlrpc/libxmlrpc/encodings.c deleted file mode 100644 index 1637a0961c211..0000000000000 --- a/ext/xmlrpc/libxmlrpc/encodings.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef PHP_WIN32 -#include -#else -#include -#include -#endif - -static const char rcsid[] = "#(@) $Id$"; - -#include - -#ifdef HAVE_GICONV_H -#include -#else -#include -#endif - -#include "encodings.h" - -static char* convert(const char* src, int src_len, int *new_len, const char* from_enc, const char* to_enc) { - char* outbuf = 0; - - if(src && src_len && from_enc && to_enc) { - size_t outlenleft = src_len; - size_t inlenleft = src_len; - int outlen = src_len; - iconv_t ic = iconv_open(to_enc, from_enc); - char* out_ptr = 0; - - if(ic != (iconv_t)-1) { - size_t st; - outbuf = (char*)malloc(outlen + 1); - - if(outbuf) { - out_ptr = (char*)outbuf; - while(inlenleft) { - st = iconv(ic, (char**)&src, &inlenleft, &out_ptr, &outlenleft); - if(st == -1) { - if(errno == E2BIG) { - int diff = out_ptr - outbuf; - outlen += inlenleft; - outlenleft += inlenleft; - outbuf = (char*)realloc(outbuf, outlen + 1); - if(!outbuf) { - break; - } - out_ptr = outbuf + diff; - } - else { - free(outbuf); - outbuf = 0; - break; - } - } - } - } - iconv_close(ic); - } - outlen -= outlenleft; - - if(new_len) { - *new_len = outbuf ? outlen : 0; - } - if(outbuf) { - outbuf[outlen] = 0; - } - } - return outbuf; -} - -/* returns a new string that must be freed */ -char* utf8_encode(const char *s, int len, int *newlen, const char* encoding) -{ - return convert(s, len, newlen, encoding, "UTF-8"); -} - -/* returns a new string, possibly decoded */ -char* utf8_decode(const char *s, int len, int *newlen, const char* encoding) -{ - return convert(s, len, newlen, "UTF-8", encoding); -} - diff --git a/ext/xmlrpc/libxmlrpc/encodings.h b/ext/xmlrpc/libxmlrpc/encodings.h deleted file mode 100644 index 486360b1be9b0..0000000000000 --- a/ext/xmlrpc/libxmlrpc/encodings.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef __ENCODINGS__H -#define __ENCODINGS__H - -/* these defines are for legacy purposes. */ -#define encoding_utf_8 "UTF-8" -typedef const char* ENCODING_ID; -#define utf8_get_encoding_id_string(desired_enc) ((const char*)desired_enc) -#define utf8_get_encoding_id_from_string(id_string) ((ENCODING_ID)id_string) - -char* utf8_encode(const char *s, int len, int *newlen, ENCODING_ID encoding); -char* utf8_decode(const char *s, int len, int *newlen, ENCODING_ID encoding); - -#endif /* __ENCODINGS__H */ diff --git a/ext/xmlrpc/libxmlrpc/queue.c b/ext/xmlrpc/libxmlrpc/queue.c deleted file mode 100644 index 24187383fd13b..0000000000000 --- a/ext/xmlrpc/libxmlrpc/queue.c +++ /dev/null @@ -1,982 +0,0 @@ -static const char rcsid[] = "#(@) $Id$"; - -/* - * Date last modified: Jan 2001 - * Modifications by Dan Libby (dan@libby.com), including: - * - various fixes, null checks, etc - * - addition of Q_Iter funcs, macros - */ - - -/*-************************************************************** - * - * File : q.c - * - * Author: Peter Yard [1993.01.02] -- 02 Jan 1993 - * - * Disclaimer: This code is released to the public domain. - * - * Description: - * Generic double ended queue (Deque pronounced DEK) for handling - * any data types, with sorting. - * - * By use of various functions in this module the caller - * can create stacks, queues, lists, doubly linked lists, - * sorted lists, indexed lists. All lists are dynamic. - * - * It is the responsibility of the caller to malloc and free - * memory for insertion into the queue. A pointer to the object - * is used so that not only can any data be used but various kinds - * of data can be pushed on the same queue if one so wished e.g. - * various length string literals mixed with pointers to structures - * or integers etc. - * - * Enhancements: - * A future improvement would be the option of multiple "cursors" - * so that multiple locations could occur in the one queue to allow - * placemarkers and additional flexibility. Perhaps even use queue - * itself to have a list of cursors. - * - * Usage: - * - * /x init queue x/ - * queue q; - * Q_Init(&q); - * - * To create a stack : - * - * Q_PushHead(&q, &mydata1); /x push x/ - * Q_PushHead(&q, &mydata2); - * ..... - * data_ptr = Q_PopHead(&q); /x pop x/ - * ..... - * data_ptr = Q_Head(&q); /x top of stack x/ - * - * To create a FIFO: - * - * Q_PushHead(&q, &mydata1); - * ..... - * data_ptr = Q_PopTail(&q); - * - * To create a double list: - * - * data_ptr = Q_Head(&q); - * .... - * data_ptr = Q_Next(&q); - * data_ptr = Q_Tail(&q); - * if (Q_IsEmpty(&q)) .... - * ..... - * data_ptr = Q_Previous(&q); - * - * To create a sorted list: - * - * Q_PushHead(&q, &mydata1); /x push x/ - * Q_PushHead(&q, &mydata2); - * ..... - * if (!Q_Sort(&q, MyFunction)) - * .. error .. - * - * /x fill in key field of mydata1. - * * NB: Q_Find does linear search - * x/ - * - * if (Q_Find(&q, &mydata1, MyFunction)) - * { - * /x found it, queue cursor now at correct record x/ - * /x can retrieve with x/ - * data_ptr = Q_Get(&q); - * - * /x alter data , write back with x/ - * Q_Put(&q, data_ptr); - * } - * - * /x Search with binary search x/ - * if (Q_Seek(&q, &mydata, MyFunction)) - * /x etc x/ - * - * - ****************************************************************/ - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include "queue.h" - - -static void QuickSort(void *list[], int low, int high, - int (*Comp)(const void *, const void *)); -static int Q_BSearch(queue *q, void *key, - int (*Comp)(const void *, const void *)); - -/* The index: a pointer to pointers */ - -static void **index; -static datanode **posn_index; - - -/*** - * - ** function : Q_Init - * - ** purpose : Initialise queue object and pointers. - * - ** parameters : 'queue' pointer. - * - ** returns : True_ if init successful else False_ - * - ** comments : - ***/ - -int Q_Init(queue *q) -{ - if(q) { - q->head = q->tail = NULL; - q->cursor = q->head; - q->size = 0; - q->sorted = False_; - } - - return True_; -} - -/*** - * - ** function : Q_AtHead - * - ** purpose : tests if cursor is at head of queue - * - ** parameters : 'queue' pointer. - * - ** returns : boolean - True_ is at head else False_ - * - ** comments : - * - ***/ - -int Q_AtHead(queue *q) -{ - return(q && q->cursor == q->head); -} - - -/*** - * - ** function : Q_AtTail - * - ** purpose : boolean test if cursor at tail of queue - * - ** parameters : 'queue' pointer to test. - * - ** returns : True_ or False_ - * - ** comments : - * - ***/ - -int Q_AtTail(queue *q) -{ - return(q && q->cursor == q->tail); -} - - -/*** - * - ** function : Q_IsEmpty - * - ** purpose : test if queue has nothing in it. - * - ** parameters : 'queue' pointer - * - ** returns : True_ if IsEmpty queue, else False_ - * - ** comments : - * - ***/ - -inline int Q_IsEmpty(queue *q) -{ - return(!q || q->size == 0); -} - -/*** - * - ** function : Q_Size - * - ** purpose : return the number of elements in the queue - * - ** parameters : queue pointer - * - ** returns : number of elements - * - ** comments : - * - ***/ - -int Q_Size(queue *q) -{ - return q ? q->size : 0; -} - - -/*** - * - ** function : Q_Head - * - ** purpose : position queue cursor to first element (head) of queue. - * - ** parameters : 'queue' pointer - * - ** returns : pointer to data at head. If queue is IsEmpty returns NULL - * - ** comments : - * - ***/ - -void *Q_Head(queue *q) -{ - if(Q_IsEmpty(q)) - return NULL; - - q->cursor = q->head; - - return q->cursor->data; -} - - -/*** - * - ** function : Q_Tail - * - ** purpose : locate cursor at tail of queue. - * - ** parameters : 'queue' pointer - * - ** returns : pointer to data at tail , if queue IsEmpty returns NULL - * - ** comments : - * - ***/ - -void *Q_Tail(queue *q) -{ - if(Q_IsEmpty(q)) - return NULL; - - q->cursor = q->tail; - - return q->cursor->data; -} - - -/*** - * - ** function : Q_PushHead - * - ** purpose : put a data pointer at the head of the queue - * - ** parameters : 'queue' pointer, void pointer to the data. - * - ** returns : True_ if success else False_ if unable to push data. - * - ** comments : - * - ***/ - -int Q_PushHead(queue *q, void *d) -{ - if(q && d) { - node *n; - datanode *p; - - p = malloc(sizeof(datanode)); - if(p == NULL) - return False_; - - n = q->head; - - q->head = (node*)p; - q->head->prev = NULL; - - if(q->size == 0) { - q->head->next = NULL; - q->tail = q->head; - } - else { - q->head->next = (datanode*)n; - n->prev = q->head; - } - - q->head->data = d; - q->size++; - - q->cursor = q->head; - - q->sorted = False_; - - return True_; - } - return False_; -} - - - -/*** - * - ** function : Q_PushTail - * - ** purpose : put a data element pointer at the tail of the queue - * - ** parameters : queue pointer, pointer to the data - * - ** returns : True_ if data pushed, False_ if data not inserted. - * - ** comments : - * - ***/ - -int Q_PushTail(queue *q, void *d) -{ - if(q && d) { - node *p; - datanode *n; - - n = malloc(sizeof(datanode)); - if(n == NULL) - return False_; - - p = q->tail; - q->tail = (node *)n; - - if(q->size == 0) { - q->tail->prev = NULL; - q->head = q->tail; - } - else { - q->tail->prev = (datanode *)p; - p->next = q->tail; - } - - q->tail->next = NULL; - - q->tail->data = d; - q->cursor = q->tail; - q->size++; - - q->sorted = False_; - - return True_; - } - return False_; -} - - - -/*** - * - ** function : Q_PopHead - * - ** purpose : remove and return the top element at the head of the - * queue. - * - ** parameters : queue pointer - * - ** returns : pointer to data element or NULL if queue is IsEmpty. - * - ** comments : - * - ***/ - -void *Q_PopHead(queue *q) -{ - datanode *n; - void *d; - - if(Q_IsEmpty(q)) - return NULL; - - d = q->head->data; - n = q->head->next; - free(q->head); - - q->size--; - - if(q->size == 0) - q->head = q->tail = q->cursor = NULL; - else { - q->head = (node *)n; - q->head->prev = NULL; - q->cursor = q->head; - } - - q->sorted = False_; - - return d; -} - - -/*** - * - ** function : Q_PopTail - * - ** purpose : remove element from tail of queue and return data. - * - ** parameters : queue pointer - * - ** returns : pointer to data element that was at tail. NULL if queue - * IsEmpty. - * - ** comments : - * - ***/ - -void *Q_PopTail(queue *q) -{ - datanode *p; - void *d; - - if(Q_IsEmpty(q)) - return NULL; - - d = q->tail->data; - p = q->tail->prev; - free(q->tail); - q->size--; - - if(q->size == 0) - q->head = q->tail = q->cursor = NULL; - else { - q->tail = (node *)p; - q->tail->next = NULL; - q->cursor = q->tail; - } - - q->sorted = False_; - - return d; -} - - - -/*** - * - ** function : Q_Next - * - ** purpose : Move to the next element in the queue without popping - * - ** parameters : queue pointer. - * - ** returns : pointer to data element of new element or NULL if end - * of the queue. - * - ** comments : This uses the cursor for the current position. Q_Next - * only moves in the direction from the head of the queue - * to the tail. - ***/ - -void *Q_Next(queue *q) -{ - if(!q) - return NULL; - - if(!q->cursor || q->cursor->next == NULL) - return NULL; - - q->cursor = (node *)q->cursor->next; - - return q->cursor->data ; -} - - - -/*** - * - ** function : Q_Previous - * - ** purpose : Opposite of Q_Next. Move to next element closer to the - * head of the queue. - * - ** parameters : pointer to queue - * - ** returns : pointer to data of new element else NULL if queue IsEmpty - * - ** comments : Makes cursor move towards the head of the queue. - * - ***/ - -void *Q_Previous(queue *q) -{ - if(!q) - return NULL; - - if(q->cursor->prev == NULL) - return NULL; - - q->cursor = (node *)q->cursor->prev; - - return q->cursor->data; -} - - -void *Q_Iter_Del(queue *q, q_iter iter) -{ - void *d; - datanode *n, *p; - - if(!q) - return NULL; - - if(iter == NULL) - return NULL; - - if(iter == (q_iter)q->head) - return Q_PopHead(q); - - if(iter == (q_iter)q->tail) - return Q_PopTail(q); - - n = ((node*)iter)->next; - p = ((node*)iter)->prev; - d = ((node*)iter)->data; - - free(iter); - - if(p) { - p->next = n; - } - if (q->cursor == (node*)iter) { - if (p) { - q->cursor = p; - } else { - q->cursor = n; - } - } - - - if (n != NULL) { - n->prev = p; - } - - q->size--; - - q->sorted = False_; - - return d; -} - - - -/*** - * - ** function : Q_DelCur - * - ** purpose : Delete the current queue element as pointed to by - * the cursor. - * - ** parameters : queue pointer - * - ** returns : pointer to data element. - * - ** comments : WARNING! It is the responsibility of the caller to - * free any memory. Queue cannot distinguish between - * pointers to literals and malloced memory. - * - ***/ - -void *Q_DelCur(queue* q) { - if(q) { - return Q_Iter_Del(q, (q_iter)q->cursor); - } - return 0; -} - - -/*** - * - ** function : Q_Destroy - * - ** purpose : Free all queue resources - * - ** parameters : queue pointer - * - ** returns : null. - * - ** comments : WARNING! It is the responsibility of the caller to - * free any memory. Queue cannot distinguish between - * pointers to literals and malloced memory. - * - ***/ - -void Q_Destroy(queue *q) -{ - while(!Q_IsEmpty(q)) { - Q_PopHead(q); - } -} - - -/*** - * - ** function : Q_Get - * - ** purpose : get the pointer to the data at the cursor location - * - ** parameters : queue pointer - * - ** returns : data element pointer - * - ** comments : - * - ***/ - -void *Q_Get(queue *q) -{ - if(!q) - return NULL; - - if(q->cursor == NULL) - return NULL; - return q->cursor->data; -} - - - -/*** - * - ** function : Q_Put - * - ** purpose : replace pointer to data with new pointer to data. - * - ** parameters : queue pointer, data pointer - * - ** returns : boolean- True_ if successful, False_ if cursor at NULL - * - ** comments : - * - ***/ - -int Q_Put(queue *q, void *data) -{ - if(q && data) { - if(q->cursor == NULL) - return False_; - - q->cursor->data = data; - return True_; - } - return False_; -} - - -/*** - * - ** function : Q_Find - * - ** purpose : Linear search of queue for match with key in *data - * - ** parameters : queue pointer q, data pointer with data containing key - * comparison function here called Comp. - * - ** returns : True_ if found , False_ if not in queue. - * - ** comments : Useful for small queues that are constantly changing - * and would otherwise need constant sorting with the - * Q_Seek function. - * For description of Comp see Q_Sort. - * Queue cursor left on position found item else at end. - * - ***/ - -int Q_Find(queue *q, void *data, - int (*Comp)(const void *, const void *)) -{ - void *d; - - if (q == NULL) { - return False_; - } - - d = Q_Head(q); - do { - if(Comp(d, data) == 0) - return True_; - d = Q_Next(q); - } while(!Q_AtTail(q)); - - if(Comp(d, data) == 0) - return True_; - - return False_; -} - -/*======== Sorted Queue and Index functions ========= */ - - -static void QuickSort(void *list[], int low, int high, - int (*Comp)(const void *, const void *)) -{ - int flag = 1, i, j; - void *key, *temp; - - if(low < high) { - i = low; - j = high + 1; - - key = list[ low ]; - - while(flag) { - i++; - while(Comp(list[i], key) < 0) - i++; - - j--; - while(Comp(list[j], key) > 0) - j--; - - if(i < j) { - temp = list[i]; - list[i] = list[j]; - list[j] = temp; - } - else flag = 0; - } - - temp = list[low]; - list[low] = list[j]; - list[j] = temp; - - QuickSort(list, low, j-1, Comp); - QuickSort(list, j+1, high, Comp); - } -} - - -/*** - * - ** function : Q_Sort - * - ** purpose : sort the queue and allow index style access. - * - ** parameters : queue pointer, comparison function compatible with - * with 'qsort'. - * - ** returns : True_ if sort succeeded. False_ if error occurred. - * - ** comments : Comp function supplied by caller must return - * -1 if data1 < data2 - * 0 if data1 == data2 - * +1 if data1 > data2 - * - * for Comp(data1, data2) - * - * If queue is already sorted it frees the memory of the - * old index and starts again. - * - ***/ - -int Q_Sort(queue *q, int (*Comp)(const void *, const void *)) -{ - int i; - void *d; - datanode *dn; - - /* if already sorted free memory for tag array */ - - if(q->sorted) { - free(index); - free(posn_index); - q->sorted = False_; - } - - /* Now allocate memory of array, array of pointers */ - - index = malloc(q->size * sizeof(q->cursor->data)); - if(index == NULL) - return False_; - - posn_index = malloc(q->size * sizeof(q->cursor)); - if(posn_index == NULL) { - free(index); - return False_; - } - - /* Walk queue putting pointers into array */ - - d = Q_Head(q); - for(i=0; i < q->size; i++) { - index[i] = d; - posn_index[i] = q->cursor; - d = Q_Next(q); - } - - /* Now sort the index */ - - QuickSort(index, 0, q->size - 1, Comp); - - /* Rearrange the actual queue into correct order */ - - dn = q->head; - i = 0; - while(dn != NULL) { - dn->data = index[i++]; - dn = dn->next; - } - - /* Re-position to original element */ - - if(d != NULL) - Q_Find(q, d, Comp); - else Q_Head(q); - - q->sorted = True_; - - return True_; -} - - -/*** - * - ** function : Q_BSearch - * - ** purpose : binary search of queue index for node containing key - * - ** parameters : queue pointer 'q', data pointer of key 'key', - * Comp comparison function. - * - ** returns : integer index into array of node pointers, - * or -1 if not found. - * - ** comments : see Q_Sort for description of 'Comp' function. - * - ***/ - -static int Q_BSearch( queue *q, void *key, - int (*Comp)(const void *, const void*)) -{ - int low, mid, hi, val; - - low = 0; - hi = q->size - 1; - - while(low <= hi) { - mid = (low + hi) / 2; - val = Comp(key, index[ mid ]); - - if(val < 0) - hi = mid - 1; - - else if(val > 0) - low = mid + 1; - - else /* Success */ - return mid; - } - - /* Not Found */ - - return -1; -} - - -/*** - * - ** function : Q_Seek - * - ** purpose : use index to locate data according to key in 'data' - * - ** parameters : queue pointer 'q', data pointer 'data', Comp comparison - * function. - * - ** returns : pointer to data or NULL if could not find it or could - * not sort queue. - * - ** comments : see Q_Sort for description of 'Comp' function. - * - ***/ - -void *Q_Seek(queue *q, void *data, int (*Comp)(const void *, const void *)) -{ - int idx; - - if (q == NULL) { - return NULL; - } - - if(!q->sorted) { - if(!Q_Sort(q, Comp)) - return NULL; - } - - idx = Q_BSearch(q, data, Comp); - - if(idx < 0) - return NULL; - - q->cursor = posn_index[idx]; - - return index[idx]; -} - - - -/*** - * - ** function : Q_Insert - * - ** purpose : Insert an element into an indexed queue - * - ** parameters : queue pointer 'q', data pointer 'data', Comp comparison - * function. - * - ** returns : pointer to data or NULL if could not find it or could - * not sort queue. - * - ** comments : see Q_Sort for description of 'Comp' function. - * WARNING! This code can be very slow since each new - * element means a new Q_Sort. Should only be used for - * the insertion of the odd element ,not the piecemeal - * building of an entire queue. - ***/ - -int Q_Insert(queue *q, void *data, int (*Comp)(const void *, const void *)) -{ - if (q == NULL) { - return False_; - } - - Q_PushHead(q, data); - - if(!Q_Sort(q, Comp)) - return False_; - - return True_; -} - -/* read only funcs for iterating through queue. above funcs modify queue */ -q_iter Q_Iter_Head(queue *q) { - return q ? (q_iter)q->head : NULL; -} - -q_iter Q_Iter_Tail(queue *q) { - return q ? (q_iter)q->tail : NULL; -} - -q_iter Q_Iter_Next(q_iter qi) { - return qi ? (q_iter)((node*)qi)->next : NULL; -} - -q_iter Q_Iter_Prev(q_iter qi) { - return qi ? (q_iter)((node*)qi)->prev : NULL; -} - -void * Q_Iter_Get(q_iter qi) { - return qi ? ((node*)qi)->data : NULL; -} - -int Q_Iter_Put(q_iter qi, void* data) { - if(qi) { - ((node*)qi)->data = data; - return True_; - } - return False_; -} diff --git a/ext/xmlrpc/libxmlrpc/queue.h b/ext/xmlrpc/libxmlrpc/queue.h deleted file mode 100644 index be73f6da00ecb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/queue.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Date last modified: Jan 2001 - * Modifications by Dan Libby (dan@libby.com), including: - * - various fixes, null checks, etc - * - addition of Q_Iter funcs, macros - */ - -/* - * File : q.h - * - * Peter Yard 02 Jan 1993. - * - * Disclaimer: This code is released to the public domain. - */ - -#ifndef Q__H -#define Q__H - -#ifndef False_ - #define False_ 0 -#endif - -#ifndef True_ - #define True_ 1 -#endif - -typedef struct nodeptr datanode; - -typedef struct nodeptr { - void *data ; - datanode *prev, *next ; -} node ; - -/* For external use with Q_Iter* funcs */ -typedef struct nodeptr* q_iter; - -typedef struct { - node *head, *tail, *cursor; - int size, sorted, item_deleted; -} queue; - -typedef struct { - void *dataptr; - node *loc ; -} index_elt ; - - -int Q_Init(queue *q); -void Q_Destroy(queue *q); -int Q_IsEmpty(queue *q); -int Q_Size(queue *q); -int Q_AtHead(queue *q); -int Q_AtTail(queue *q); -int Q_PushHead(queue *q, void *d); -int Q_PushTail(queue *q, void *d); -void *Q_Head(queue *q); -void *Q_Tail(queue *q); -void *Q_PopHead(queue *q); -void *Q_PopTail(queue *q); -void *Q_Next(queue *q); -void *Q_Previous(queue *q); -void *Q_DelCur(queue *q); -void *Q_Get(queue *q); -int Q_Put(queue *q, void *data); -int Q_Sort(queue *q, int (*Comp)(const void *, const void *)); -int Q_Find(queue *q, void *data, - int (*Comp)(const void *, const void *)); -void *Q_Seek(queue *q, void *data, - int (*Comp)(const void *, const void *)); -int Q_Insert(queue *q, void *data, - int (*Comp)(const void *, const void *)); - -/* read only funcs for iterating through queue. above funcs modify queue */ -q_iter Q_Iter_Head(queue *q); -q_iter Q_Iter_Tail(queue *q); -q_iter Q_Iter_Next(q_iter qi); -q_iter Q_Iter_Prev(q_iter qi); -void* Q_Iter_Get(q_iter qi); -int Q_Iter_Put(q_iter qi, void* data); /* not read only! here for completeness. */ -void* Q_Iter_Del(queue *q, q_iter iter); /* not read only! here for completeness. */ - -/* Fast (macro'd) versions of above */ -#define Q_Iter_Head_F(q) (q ? (q_iter)((queue*)q)->head : NULL) -#define Q_Iter_Tail_F(q) (q ? (q_iter)((queue*)q)->tail : NULL) -#define Q_Iter_Next_F(qi) (qi ? (q_iter)((node*)qi)->next : NULL) -#define Q_Iter_Prev_F(qi) (qi ? (q_iter)((node*)qi)->prev : NULL) -#define Q_Iter_Get_F(qi) (qi ? ((node*)qi)->data : NULL) - -#endif /* Q__H */ diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c deleted file mode 100644 index 7211d2cd94195..0000000000000 --- a/ext/xmlrpc/libxmlrpc/simplestring.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - -#define SIMPLESTRING_INCR 32 - -/****h* ABOUT/simplestring - * NAME - * simplestring - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 06/2000 - * HISTORY - * $Log$ - * Revision 1.3 2002/08/22 01:25:50 sniper - * kill some compile warnings - * - * Revision 1.2 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.4 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.3 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * This code was written primarily for xmlrpc, but has found some other uses. - * - * simplestring is, as the name implies, a simple API for dealing with C strings. - * Why would I write yet another string API? Because I couldn't find any that were - * a) free / GPL, b) simple/lightweight, c) fast, not doing unneccesary strlens all - * over the place. So. It is simple, and it seems to work, and it is pretty fast. - * - * Oh, and it is also binary safe, ie it can handle strings with embedded NULLs, - * so long as the real length is passed in. - * - * And the masses rejoiced. - * - * BUGS - * there must be some. - ******/ - -#include -#include -#include "simplestring.h" - -#define my_free(thing) if(thing) {free(thing); thing = 0;} - -/*----------------------** -* Begin String Functions * -*-----------------------*/ - -/****f* FUNC/simplestring_init - * NAME - * simplestring_init - * SYNOPSIS - * void simplestring_init(simplestring* string) - * FUNCTION - * initialize string - * INPUTS - * string - pointer to a simplestring struct that will be initialized - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_free () - * simplestring_clear () - * SOURCE - */ -void simplestring_init(simplestring* string) { - memset(string, 0, sizeof(simplestring)); -} -/******/ - -static void simplestring_init_str(simplestring* string) { - string->str = (char*)malloc(SIMPLESTRING_INCR); - if(string->str) { - string->str[0] = 0; - string->len = 0; - string->size = SIMPLESTRING_INCR; - } - else { - string->size = 0; - } -} - -/****f* FUNC/simplestring_clear - * NAME - * simplestring_clear - * SYNOPSIS - * void simplestring_clear(simplestring* string) - * FUNCTION - * clears contents of a string - * INPUTS - * string - the string value to clear - * RESULT - * void - * NOTES - * This function is very fast as it does not de-allocate any memory. - * SEE ALSO - * - * SOURCE - */ -void simplestring_clear(simplestring* string) { - if(string->str) { - string->str[0] = 0; - } - string->len = 0; -} -/******/ - -/****f* FUNC/simplestring_free - * NAME - * simplestring_free - * SYNOPSIS - * void simplestring_free(simplestring* string) - * FUNCTION - * frees contents of a string, if any. Does *not* free the simplestring struct itself. - * INPUTS - * string - value containing string to be free'd - * RESULT - * void - * NOTES - * caller is responsible for allocating and freeing simplestring* struct itself. - * SEE ALSO - * simplestring_init () - * SOURCE - */ -void simplestring_free(simplestring* string) { - if(string && string->str) { - my_free(string->str); - string->len = 0; - } -} -/******/ - -/****f* FUNC/simplestring_addn - * NAME - * simplestring_addn - * SYNOPSIS - * void simplestring_addn(simplestring* string, const char* add, int add_len) - * FUNCTION - * copies n characters from source to target string - * INPUTS - * target - target string - * source - source string - * add_len - number of characters to copy - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_add () - * SOURCE - */ -void simplestring_addn(simplestring* target, const char* source, int add_len) { - if(target && source) { - if(!target->str) { - simplestring_init_str(target); - } - if(target->len + add_len + 1 > target->size) { - /* newsize is current length + new length */ - int newsize = target->len + add_len + 1; - int incr = target->size * 2; - - /* align to SIMPLESTRING_INCR increments */ - newsize = newsize - (newsize % incr) + incr; - target->str = (char*)realloc(target->str, newsize); - - target->size = target->str ? newsize : 0; - } - - if(target->str) { - if(add_len) { - memcpy(target->str + target->len, source, add_len); - } - target->len += add_len; - target->str[target->len] = 0; /* null terminate */ - } - } -} -/******/ - -/****f* FUNC/simplestring_add - * NAME - * simplestring_add - * SYNOPSIS - * void simplestring_add(simplestring* string, const char* add) - * FUNCTION - * appends a string of unknown length from source to target - * INPUTS - * target - the target string to append to - * source - the source string of unknown length - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_addn () - * SOURCE - */ -void simplestring_add(simplestring* target, const char* source) { - if(target && source) { - simplestring_addn(target, source, strlen(source)); - } -} -/******/ - - -/*---------------------- -* End String Functions * -*--------------------**/ diff --git a/ext/xmlrpc/libxmlrpc/simplestring.h b/ext/xmlrpc/libxmlrpc/simplestring.h deleted file mode 100644 index c5d98cf1d8e01..0000000000000 --- a/ext/xmlrpc/libxmlrpc/simplestring.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef __SIMPLESTRING_H__ - #define __SIMPLESTRING_H__ - -/*-******************************** -* begin simplestring header stuff * -**********************************/ - -#ifdef __cplusplus -extern "C" { -#endif - - /****s* struct/simplestring - * NAME - * simplestring - * NOTES - * represents a string efficiently for fast appending, etc. - * SOURCE - */ -typedef struct _simplestring { - char* str; /* string buf */ - int len; /* length of string/buf */ - int size; /* size of allocated buffer */ -} simplestring; -/******/ - -#ifndef NULL - #define NULL 0 -#endif - -void simplestring_init(simplestring* string); -void simplestring_clear(simplestring* string); -void simplestring_free(simplestring* string); -void simplestring_add(simplestring* string, const char* add); -void simplestring_addn(simplestring* string, const char* add, int add_len); - -#ifdef __cplusplus -} -#endif - -/*-****************************** -* end simplestring header stuff * -********************************/ - -#endif /* __SIMPLESTRING_H__ */ diff --git a/ext/xmlrpc/libxmlrpc/system_methods.c b/ext/xmlrpc/libxmlrpc/system_methods.c deleted file mode 100644 index c47236df140e5..0000000000000 --- a/ext/xmlrpc/libxmlrpc/system_methods.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -/****h* ABOUT/system_methods - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * HISTORY - * $Log$ - * Revision 1.7 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 4/28/2001 -- danda -- adding system.multicall and separating out system methods. - * TODO - * NOTES - *******/ - - -#include "queue.h" -#include "xmlrpc.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include "system_methods_private.h" -#include -#include -#include - - -static const char* xsm_introspection_xml = -"" - -"" - "" - - "" - "value identifier" - "value's xmlrpc or user-defined type" - "value's textual description " - "true if value is optional, else it is required " - "a child of this element. n/a for scalar types " - "" - - "" - "" - "" - - "" - "" - "" - - - "" - - "" - - "" - "" - "Dan Libby" - "fully describes the methods and types implemented by this XML-RPC server." - "1.1" - "" - "" - "" - "" - "a valid method name" - "" - "" - "" - "" - "" - "" - "method name" - "method version" - "method author" - "method purpose" - "" - "" - "parameter list" - "return value list" - "" - "" - "list of known bugs" - "list of possible errors and error codes" - "list of examples" - "list of modifications" - "list of notes" - "see also. list of related methods" - "list of unimplemented features" - "" - "" - "" - "a type description" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "enumerates the methods implemented by this XML-RPC server." - "1.0" - "" - "" - "" - "" - "name of a method implemented by the server." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "provides documentation string for a single method" - "1.0" - "" - "" - "" - "name of the method for which documentation is desired" - "" - "" - "help text if defined for the method passed, otherwise an empty string" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "provides 1 or more signatures for a single method" - "1.0" - "" - "" - "" - "name of the method for which documentation is desired" - "" - "" - "" - "" - "a string indicating the xmlrpc type of a value. one of: string, int, double, base64, datetime, array, struct" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "executes multiple methods in sequence and returns the results" - "1.0" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "returns a list of capabilities supported by this server" - "1.0" - "spec url: http://groups.yahoo.com/group/xml-rpc/message/2897" - "" - "" - "" - "" - "" - "www address of the specification defining this capability" - "version of the spec that this server's implementation conforms to" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" -""; - - -/* forward declarations for static (non public, non api) funcs */ -static XMLRPC_VALUE xsm_system_multicall_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xsm_system_get_capabilities_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); - -/*-******************* -* System Methods API * -*********************/ - -static void xsm_lazy_doc_methods_cb(XMLRPC_SERVER server, void* userData) { - XMLRPC_VALUE xDesc = XMLRPC_IntrospectionCreateDescription(xsm_introspection_xml, NULL); - XMLRPC_ServerAddIntrospectionData(server, xDesc); - XMLRPC_CleanupValue(xDesc); -} - -void xsm_register(XMLRPC_SERVER server) { - xi_register_system_methods(server); - - XMLRPC_ServerRegisterMethod(server, xsm_token_system_multicall, xsm_system_multicall_cb); - XMLRPC_ServerRegisterMethod(server, xsm_token_system_get_capabilities, xsm_system_get_capabilities_cb); - - /* callback for documentation generation should it be requested */ - XMLRPC_ServerRegisterIntrospectionCallback(server, xsm_lazy_doc_methods_cb); -} - -XMLRPC_VALUE xsm_system_multicall_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xArray = XMLRPC_VectorRewind(XMLRPC_RequestGetData(input)); - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(0, xmlrpc_vector_array); - - if (xArray) { - XMLRPC_VALUE xMethodIter = XMLRPC_VectorRewind(xArray); - - while (xMethodIter) { - XMLRPC_REQUEST request = XMLRPC_RequestNew(); - if(request) { - const char* methodName = XMLRPC_VectorGetStringWithID(xMethodIter, "methodName"); - XMLRPC_VALUE params = XMLRPC_VectorGetValueWithID(xMethodIter, "params"); - - if(methodName && params) { - XMLRPC_VALUE xRandomArray = XMLRPC_CreateVector(0, xmlrpc_vector_array); - XMLRPC_RequestSetMethodName(request, methodName); - XMLRPC_RequestSetData(request, params); - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - - XMLRPC_AddValueToVector(xRandomArray, - XMLRPC_ServerCallMethod(server, request, userData)); - - XMLRPC_AddValueToVector(xReturn, xRandomArray); - } - XMLRPC_RequestFree(request, 1); - } - xMethodIter = XMLRPC_VectorNext(xArray); - } - } - return xReturn; -} - - -XMLRPC_VALUE xsm_system_get_capabilities_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(0, xmlrpc_vector_struct); - XMLRPC_VALUE xFaults = XMLRPC_CreateVector("faults_interop", xmlrpc_vector_struct); - XMLRPC_VALUE xIntro = XMLRPC_CreateVector("introspection", xmlrpc_vector_struct); - - /* support for fault spec */ - XMLRPC_VectorAppendString(xFaults, "specURL", "http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php", 0); - XMLRPC_VectorAppendInt(xFaults, "specVersion", 20010516); - - /* support for introspection spec */ - XMLRPC_VectorAppendString(xIntro, "specURL", "http://xmlrpc-epi.sourceforge.net/specs/rfc.introspection.php", 0); - XMLRPC_VectorAppendInt(xIntro, "specVersion", 20010516); - - XMLRPC_AddValuesToVector(xReturn, - xFaults, - xIntro, - NULL); - - return xReturn; - -} - -/*-*********************** -* End System Methods API * -*************************/ - - - diff --git a/ext/xmlrpc/libxmlrpc/system_methods_private.h b/ext/xmlrpc/libxmlrpc/system_methods_private.h deleted file mode 100644 index 72408fd3c4baf..0000000000000 --- a/ext/xmlrpc/libxmlrpc/system_methods_private.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Dan Libby, Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - - -#ifndef __SYSTEM_METHODS_PRIVATE_H -/* - * Avoid include redundancy. - */ -#define __SYSTEM_METHODS_PRIVATE_H - -/*---------------------------------------------------------------------------- - * system_methods_private.h - * - * Purpose: - * define non-public system.* methods - * Comments: - * xsm = xmlrpc system methods - */ - -/*---------------------------------------------------------------------------- - * Constants - */ -#define xsm_token_system_multicall "system.multiCall" -#define xsm_token_system_get_capabilities "system.getCapabilities" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -void xsm_register(XMLRPC_SERVER server); -int xsm_is_system_method(XMLRPC_Callback cb); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __SYSTEM_METHODS_PRIVATE_H */ - - - - diff --git a/ext/xmlrpc/libxmlrpc/xml_element.c b/ext/xmlrpc/libxmlrpc/xml_element.c deleted file mode 100644 index 1016574e7afc6..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_element.c +++ /dev/null @@ -1,756 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - - -/****h* ABOUT/xml_element - * NAME - * xml_element - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 06/2000 - * HISTORY - * $Log$ - * Revision 1.8 2005/03/28 00:07:24 edink - * Reshufle includes to make it compile on windows - * - * Revision 1.7 2005/03/26 03:13:58 sniper - * - Made it possible to build ext/xmlrpc with libxml2 - * - * Revision 1.6 2004/06/01 20:16:06 iliaa - * Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in - * 200-210 range). - * Patch by: fernando dot nemec at folha dot com dot br - * - * Revision 1.5 2003/12/16 21:00:21 sniper - * Fix some compile warnings (patch by Joe Orton) - * - * Revision 1.4 2002/11/26 23:01:16 fmk - * removing unused variables - * - * Revision 1.3 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.9 2002/07/03 20:54:30 danda - * root element should not have a parent. patch from anon SF user - * - * Revision 1.8 2002/05/23 17:46:51 danda - * patch from mukund - fix non utf-8 encoding conversions - * - * Revision 1.7 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.6 2002/01/08 01:06:55 danda - * enable format for parsers that are very picky. - * - * Revision 1.5 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * TODO - * Nicer external API. Get rid of macros. Make opaque types, etc. - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * This code incorporates ideas from expat-ensor from http://xml.ensor.org. - * - * It was coded primarily to act as a go-between for expat and xmlrpc. To this - * end, it stores xml elements, their sub-elements, and their attributes in an - * in-memory tree. When expat is done parsing, the tree can be walked, thus - * retrieving the values. The code can also be used to build a tree via API then - * write out the tree to a buffer, thus "serializing" the xml. - * - * It turns out this is useful for other purposes, such as parsing config files. - * YMMV. - * - * Some Features: - * - output option for xml escaping data. Choices include no escaping, entity escaping, - * or CDATA sections. - * - output option for character encoding. Defaults to (none) utf-8. - * - output option for verbosity/readability. ultra-compact, newlines, pretty/level indented. - * - * BUGS - * there must be some. - ******/ - -#include "ext/xml/expat_compat.h" -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include - -#include "xml_element.h" -#include "queue.h" -#include "encodings.h" - -#define my_free(thing) if(thing) {free(thing); thing = NULL;} - -#define XML_DECL_START "" -#define XML_DECL_END_LEN sizeof(XML_DECL_END) - 1 -#define START_TOKEN_BEGIN "<" -#define START_TOKEN_BEGIN_LEN sizeof(START_TOKEN_BEGIN) - 1 -#define START_TOKEN_END ">" -#define START_TOKEN_END_LEN sizeof(START_TOKEN_END) - 1 -#define EMPTY_START_TOKEN_END "/>" -#define EMPTY_START_TOKEN_END_LEN sizeof(EMPTY_START_TOKEN_END) - 1 -#define END_TOKEN_BEGIN "" -#define END_TOKEN_END_LEN sizeof(END_TOKEN_END) - 1 -#define ATTR_DELIMITER "\"" -#define ATTR_DELIMITER_LEN sizeof(ATTR_DELIMITER) - 1 -#define CDATA_BEGIN "" -#define CDATA_END_LEN sizeof(CDATA_END) - 1 -#define EQUALS "=" -#define EQUALS_LEN sizeof(EQUALS) - 1 -#define WHITESPACE " " -#define WHITESPACE_LEN sizeof(WHITESPACE) - 1 -#define NEWLINE "\n" -#define NEWLINE_LEN sizeof(NEWLINE) - 1 -#define MAX_VAL_BUF 144 -#define SCALAR_STR "SCALAR" -#define SCALAR_STR_LEN sizeof(SCALAR_STR) - 1 -#define VECTOR_STR "VECTOR" -#define VECTOR_STR_LEN sizeof(VECTOR_STR) - 1 -#define RESPONSE_STR "RESPONSE" -#define RESPONSE_STR_LEN sizeof(RESPONSE_STR) - 1 - - -/*----------------------------- -- Begin xml_element Functions - ------------------------------*/ - -/****f* xml_element/xml_elem_free_non_recurse - * NAME - * xml_elem_free_non_recurse - * SYNOPSIS - * void xml_elem_free_non_recurse(xml_element* root) - * FUNCTION - * free a single xml element. child elements will not be freed. - * INPUTS - * root - the element to free - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_free () - * xml_elem_new () - * SOURCE - */ -void xml_elem_free_non_recurse(xml_element* root) { - if(root) { - xml_element_attr* attrs = Q_Head(&root->attrs); - while(attrs) { - my_free(attrs->key); - my_free(attrs->val); - my_free(attrs); - attrs = Q_Next(&root->attrs); - } - - Q_Destroy(&root->children); - Q_Destroy(&root->attrs); - if(root->name) { - free((char *)root->name); - root->name = NULL; - } - simplestring_free(&root->text); - my_free(root); - } -} -/******/ - -/****f* xml_element/xml_elem_free - * NAME - * xml_elem_free - * SYNOPSIS - * void xml_elem_free(xml_element* root) - * FUNCTION - * free an xml element and all of its child elements - * INPUTS - * root - the root of an xml tree you would like to free - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_free_non_recurse () - * xml_elem_new () - * SOURCE - */ -void xml_elem_free(xml_element* root) { - if(root) { - xml_element* kids = Q_Head(&root->children); - while(kids) { - xml_elem_free(kids); - kids = Q_Next(&root->children); - } - xml_elem_free_non_recurse(root); - } -} -/******/ - -/****f* xml_element/xml_elem_new - * NAME - * xml_elem_new - * SYNOPSIS - * xml_element* xml_elem_new() - * FUNCTION - * allocates and initializes a new xml_element - * INPUTS - * none - * RESULT - * xml_element* or NULL. NULL indicates an out-of-memory condition. - * NOTES - * SEE ALSO - * xml_elem_free () - * xml_elem_free_non_recurse () - * SOURCE - */ -xml_element* xml_elem_new() { - xml_element* elem = calloc(1, sizeof(xml_element)); - if(elem) { - Q_Init(&elem->children); - Q_Init(&elem->attrs); - simplestring_init(&elem->text); - - /* init empty string in case we don't find any char data */ - simplestring_addn(&elem->text, "", 0); - } - return elem; -} -/******/ - -static int xml_elem_writefunc(int (*fptr)(void *data, const char *text, int size), const char *text, void *data, int len) -{ - return fptr && text ? fptr(data, text, len ? len : strlen(text)) : 0; -} - - - -static int create_xml_escape(char *pString, unsigned char c) -{ - int counter = 0; - - pString[counter++] = '&'; - pString[counter++] = '#'; - if(c >= 100) { - pString[counter++] = c / 100 + '0'; - c = c % 100; - } - pString[counter++] = c / 10 + '0'; - c = c % 10; - - pString[counter++] = c + '0'; - pString[counter++] = ';'; - return counter; -} - -#define non_ascii(c) (c > 127) -#define non_print(c) (!isprint(c)) -#define markup(c) (c == '&' || c == '\"' || c == '>' || c == '<') -#define entity_length(c) ( (c >= 100) ? 3 : ((c >= 10) ? 2 : 1) ) + 3; /* "&#" + c + ";" */ - -/* - * xml_elem_entity_escape - * - * Purpose: - * escape reserved xml chars and non utf-8 chars as xml entities - * Comments: - * The return value may be a new string, or null if no - * conversion was performed. In the latter case, *newlen will - * be 0. - * Flags (to escape) - * xml_elem_no_escaping = 0x000, - * xml_elem_entity_escaping = 0x002, // escape xml special chars as entities - * xml_elem_non_ascii_escaping = 0x008, // escape chars above 127 - * xml_elem_cdata_escaping = 0x010, // wrap in cdata - */ -static char* xml_elem_entity_escape(const char* buf, int old_len, int *newlen, XML_ELEM_ESCAPING flags) { - char *pRetval = 0; - int iNewBufLen=0; - -#define should_escape(c, flag) ( ((flag & xml_elem_markup_escaping) && markup(c)) || \ - ((flag & xml_elem_non_ascii_escaping) && non_ascii(c)) || \ - ((flag & xml_elem_non_print_escaping) && non_print(c)) ) - - if(buf && *buf) { - const unsigned char *bufcopy; - char *NewBuffer; - int ToBeXmlEscaped=0; - int iLength; - bufcopy = buf; - iLength= old_len ? old_len : strlen(buf); - while(*bufcopy) { - if( should_escape(*bufcopy, flags) ) { - /* the length will increase by length of xml escape - the character length */ - iLength += entity_length(*bufcopy); - ToBeXmlEscaped=1; - } - bufcopy++; - } - - if(ToBeXmlEscaped) { - - NewBuffer= malloc(iLength+1); - if(NewBuffer) { - bufcopy=buf; - while(*bufcopy) { - if(should_escape(*bufcopy, flags)) { - iNewBufLen += create_xml_escape(NewBuffer+iNewBufLen,*bufcopy); - } - else { - NewBuffer[iNewBufLen++]=*bufcopy; - } - bufcopy++; - } - NewBuffer[iNewBufLen] = 0; - pRetval = NewBuffer; - } - } - } - - if(newlen) { - *newlen = iNewBufLen; - } - - return pRetval; -} - - -static void xml_element_serialize(xml_element *el, int (*fptr)(void *data, const char *text, int size), void *data, XML_ELEM_OUTPUT_OPTIONS options, int depth) -{ - int i; - static STRUCT_XML_ELEM_OUTPUT_OPTIONS default_opts = {xml_elem_pretty, xml_elem_markup_escaping | xml_elem_non_print_escaping, XML_DECL_ENCODING_DEFAULT}; - static char whitespace[] = " " - " " - " "; - depth++; - - if(!el) { - fprintf(stderr, "Nothing to write\n"); - return; - } - if(!options) { - options = &default_opts; - } - - /* print xml declaration if at root level */ - if(depth == 1) { - xml_elem_writefunc(fptr, XML_DECL_START, data, XML_DECL_START_LEN); - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, XML_DECL_VERSION, data, XML_DECL_VERSION_LEN); - if(options->encoding && *options->encoding) { - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, XML_DECL_ENCODING_ATTR, data, XML_DECL_ENCODING_ATTR_LEN); - xml_elem_writefunc(fptr, EQUALS, data, EQUALS_LEN); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - xml_elem_writefunc(fptr, options->encoding, data, 0); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - } - xml_elem_writefunc(fptr, XML_DECL_END, data, XML_DECL_END_LEN); - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } - } - - if(options->verbosity == xml_elem_pretty && depth > 2) { - xml_elem_writefunc(fptr, whitespace, data, depth - 2); - } - /* begin element */ - xml_elem_writefunc(fptr,START_TOKEN_BEGIN, data, START_TOKEN_BEGIN_LEN); - if(el->name) { - xml_elem_writefunc(fptr, el->name, data, 0); - - /* write attrs, if any */ - if(Q_Size(&el->attrs)) { - xml_element_attr* iter = Q_Head(&el->attrs); - while( iter ) { - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, iter->key, data, 0); - xml_elem_writefunc(fptr, EQUALS, data, EQUALS_LEN); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - xml_elem_writefunc(fptr, iter->val, data, 0); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - - iter = Q_Next(&el->attrs); - } - } - } - else { - xml_elem_writefunc(fptr, "None", data, 0); - } - /* if no text and no children, use abbreviated form, eg: */ - if(!el->text.len && !Q_Size(&el->children)) { - xml_elem_writefunc(fptr, EMPTY_START_TOKEN_END, data, EMPTY_START_TOKEN_END_LEN); - } - /* otherwise, print element contents */ - else { - xml_elem_writefunc(fptr, START_TOKEN_END, data, START_TOKEN_END_LEN); - - /* print text, if any */ - if(el->text.len) { - char* escaped_str = el->text.str; - int buflen = el->text.len; - - if(options->escaping && options->escaping != xml_elem_cdata_escaping) { - escaped_str = xml_elem_entity_escape(el->text.str, buflen, &buflen, options->escaping ); - if(!escaped_str) { - escaped_str = el->text.str; - } - } - - if(options->escaping & xml_elem_cdata_escaping) { - xml_elem_writefunc(fptr, CDATA_BEGIN, data, CDATA_BEGIN_LEN); - } - - xml_elem_writefunc(fptr, escaped_str, data, buflen); - - if(escaped_str != el->text.str) { - my_free(escaped_str); - } - - if(options->escaping & xml_elem_cdata_escaping) { - xml_elem_writefunc(fptr, CDATA_END, data, CDATA_END_LEN); - } - } - /* no text, so print child elems */ - else { - xml_element *kids = Q_Head(&el->children); - i = 0; - while( kids ) { - if(i++ == 0) { - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } - } - xml_element_serialize(kids, fptr, data, options, depth); - kids = Q_Next(&el->children); - } - if(i) { - if(options->verbosity == xml_elem_pretty && depth > 2) { - xml_elem_writefunc(fptr, whitespace, data, depth - 2); - } - } - } - - xml_elem_writefunc(fptr, END_TOKEN_BEGIN, data, END_TOKEN_BEGIN_LEN); - xml_elem_writefunc(fptr,el->name ? el->name : "None", data, 0); - xml_elem_writefunc(fptr, END_TOKEN_END, data, END_TOKEN_END_LEN); - } - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } -} - -/* print buf to file */ -static int file_out_fptr(void *f, const char *text, int size) -{ - fputs(text, (FILE *)f); - return 0; -} - -/* print buf to simplestring */ -static int simplestring_out_fptr(void *f, const char *text, int size) -{ - simplestring* buf = (simplestring*)f; - if(buf) { - simplestring_addn(buf, text, size); - } - return 0; -} - -/****f* xml_element/xml_elem_serialize_to_string - * NAME - * xml_elem_serialize_to_string - * SYNOPSIS - * void xml_element_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len) - * FUNCTION - * writes element tree as XML into a newly allocated buffer - * INPUTS - * el - root element of tree - * options - options determining how output is written. see XML_ELEM_OUTPUT_OPTIONS - * buf_len - length of returned buffer, if not null. - * RESULT - * char* or NULL. Must be free'd by caller. - * NOTES - * SEE ALSO - * xml_elem_serialize_to_stream () - * xml_elem_parse_buf () - * SOURCE - */ -char* xml_elem_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len) -{ - simplestring buf; - simplestring_init(&buf); - - xml_element_serialize(el, simplestring_out_fptr, (void *)&buf, options, 0); - - if(buf_len) { - *buf_len = buf.len; - } - - return buf.str; -} -/******/ - -/****f* xml_element/xml_elem_serialize_to_stream - * NAME - * xml_elem_serialize_to_stream - * SYNOPSIS - * void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options) - * FUNCTION - * writes element tree as XML into a stream (typically an opened file) - * INPUTS - * el - root element of tree - * output - stream handle - * options - options determining how output is written. see XML_ELEM_OUTPUT_OPTIONS - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_serialize_to_string () - * xml_elem_parse_buf () - * SOURCE - */ -void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options) -{ - xml_element_serialize(el, file_out_fptr, (void *)output, options, 0); -} -/******/ - -/*--------------------------* -* End xml_element Functions * -*--------------------------*/ - - -/*---------------------- -* Begin Expat Handlers * -*---------------------*/ - -typedef struct _xml_elem_data { - xml_element* root; - xml_element* current; - XML_ELEM_INPUT_OPTIONS input_options; - int needs_enc_conversion; -} xml_elem_data; - - -/* expat start of element handler */ -static void _xmlrpc_startElement(void *userData, const char *name, const char **attrs) -{ - xml_element *c; - xml_elem_data* mydata = (xml_elem_data*)userData; - const char** p = attrs; - - if(mydata) { - c = mydata->current; - - mydata->current = xml_elem_new(); - mydata->current->name = (char*)strdup(name); - mydata->current->parent = c; - - /* init attrs */ - while(p && *p) { - xml_element_attr* attr = malloc(sizeof(xml_element_attr)); - if(attr) { - attr->key = strdup(*p); - attr->val = strdup(*(p+1)); - Q_PushTail(&mydata->current->attrs, attr); - - p += 2; - } - } - } -} - -/* expat end of element handler */ -static void _xmlrpc_endElement(void *userData, const char *name) -{ - xml_elem_data* mydata = (xml_elem_data*)userData; - - if(mydata && mydata->current && mydata->current->parent) { - Q_PushTail(&mydata->current->parent->children, mydata->current); - - mydata->current = mydata->current->parent; - } -} - -/* expat char data handler */ -static void _xmlrpc_charHandler(void *userData, - const char *s, - int len) -{ - xml_elem_data* mydata = (xml_elem_data*)userData; - if(mydata && mydata->current) { - - /* Check if we need to decode utf-8 parser output to another encoding */ - if(mydata->needs_enc_conversion && mydata->input_options->encoding) { - int new_len = 0; - char* add_text = utf8_decode(s, len, &new_len, mydata->input_options->encoding); - if(add_text) { - len = new_len; - simplestring_addn(&mydata->current->text, add_text, len); - free(add_text); - return; - } - } - simplestring_addn(&mydata->current->text, s, len); - } -} -/******/ - -/*-------------------* -* End Expat Handlers * -*-------------------*/ - -/*-------------------* -* xml_elem_parse_buf * -*-------------------*/ - -/****f* xml_element/xml_elem_parse_buf - * NAME - * xml_elem_parse_buf - * SYNOPSIS - * xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error) - * FUNCTION - * parse a buffer containing XML into an xml_element in-memory tree - * INPUTS - * in_buf - buffer containing XML document - * len - length of buffer - * options - input options. optional - * error - error result data. optional. check if result is null. - * RESULT - * void - * NOTES - * The returned data must be free'd by caller - * SEE ALSO - * xml_elem_serialize_to_string () - * xml_elem_free () - * SOURCE - */ -xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error) -{ - xml_element* xReturn = NULL; - char buf[100] = ""; - static STRUCT_XML_ELEM_INPUT_OPTIONS default_opts = {encoding_utf_8}; - - if(!options) { - options = &default_opts; - } - - if(in_buf) { - XML_Parser parser; - xml_elem_data mydata = {0}; - - parser = XML_ParserCreate(NULL); - - mydata.root = xml_elem_new(); - mydata.current = mydata.root; - mydata.input_options = options; - mydata.needs_enc_conversion = options->encoding && strcmp(options->encoding, encoding_utf_8); - - XML_SetElementHandler(parser, _xmlrpc_startElement, _xmlrpc_endElement); - XML_SetCharacterDataHandler(parser, _xmlrpc_charHandler); - - /* pass the xml_elem_data struct along */ - XML_SetUserData(parser, (void*)&mydata); - - if(!len) { - len = strlen(in_buf); - } - - /* parse the XML */ - if(XML_Parse(parser, in_buf, len, 1) == 0) { - enum XML_Error err_code = XML_GetErrorCode(parser); - int line_num = XML_GetCurrentLineNumber(parser); - int col_num = XML_GetCurrentColumnNumber(parser); - long byte_idx = XML_GetCurrentByteIndex(parser); - int byte_total = XML_GetCurrentByteCount(parser); - const char * error_str = XML_ErrorString(err_code); - if(byte_idx >= 0) { - snprintf(buf, - sizeof(buf), - "\n\tdata beginning %ld before byte index: %s\n", - byte_idx > 10 ? 10 : byte_idx, - in_buf + (byte_idx > 10 ? byte_idx - 10 : byte_idx)); - } - - fprintf(stderr, "expat reports error code %i\n" - "\tdescription: %s\n" - "\tline: %i\n" - "\tcolumn: %i\n" - "\tbyte index: %ld\n" - "\ttotal bytes: %i\n%s ", - err_code, error_str, line_num, - col_num, byte_idx, byte_total, buf); - - - /* error condition */ - if(error) { - error->parser_code = (long)err_code; - error->line = line_num; - error->column = col_num; - error->byte_index = byte_idx; - error->parser_error = error_str; - } - } - else { - xReturn = (xml_element*)Q_Head(&mydata.root->children); - xReturn->parent = NULL; - } - - XML_ParserFree(parser); - - - xml_elem_free_non_recurse(mydata.root); - } - - return xReturn; -} - -/******/ diff --git a/ext/xmlrpc/libxmlrpc/xml_element.h b/ext/xmlrpc/libxmlrpc/xml_element.h deleted file mode 100644 index cfe7ca2483396..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_element.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef __XML_ELEMENT_H__ - #define __XML_ELEMENT_H__ - -/* includes */ -#include -#include "queue.h" -#include "simplestring.h" -#include "encodings.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/****d* enum/XML_ELEM_VERBOSITY - * NAME - * XML_ELEM_VERBOSITY - * NOTES - * verbosity/readability options for generated xml - * SEE ALSO - * XML_ELEM_OUTPUT_OPTIONS - * SOURCE - */ -typedef enum _xml_elem_verbosity { - xml_elem_no_white_space, /* compact xml with no white space */ - xml_elem_newlines_only, /* add newlines for enhanced readability */ - xml_elem_pretty /* add newlines and indent accordint to depth */ -} XML_ELEM_VERBOSITY; -/******/ - - -/****d* enum/XML_ELEM_ESCAPING - * NAME - * XML_ELEM_ESCAPING - * NOTES - * xml escaping options for generated xml - * SEE ALSO - * XML_ELEM_OUTPUT_OPTIONS - * SOURCE - */ -typedef enum _xml_elem_escaping { - xml_elem_no_escaping = 0x000, - xml_elem_markup_escaping = 0x002, /* entity escape xml special chars */ - xml_elem_non_ascii_escaping = 0x008, /* entity escape chars above 127 */ - xml_elem_non_print_escaping = 0x010, /* entity escape non print (illegal) chars */ - xml_elem_cdata_escaping = 0x020, /* wrap in cdata section */ -} XML_ELEM_ESCAPING; -/******/ - - -/****s* struct/XML_ELEM_OUTPUT_OPTIONS - * NAME - * XML_ELEM_OUTPUT_OPTIONS - * NOTES - * defines various output options - * SOURCE - */ -typedef struct _xml_output_options { - XML_ELEM_VERBOSITY verbosity; /* length/verbosity of xml */ - XML_ELEM_ESCAPING escaping; /* how to escape special chars */ - const char* encoding; /* " ?> */ -} STRUCT_XML_ELEM_OUTPUT_OPTIONS, *XML_ELEM_OUTPUT_OPTIONS; -/******/ - -/****s* struct/XML_ELEM_INPUT_OPTIONS - * NAME - * XML_ELEM_INPUT_OPTIONS - * NOTES - * defines various input options - * SOURCE - */ -typedef struct _xml_input_options { - ENCODING_ID encoding; /* which encoding to use. */ -} STRUCT_XML_ELEM_INPUT_OPTIONS, *XML_ELEM_INPUT_OPTIONS; -/******/ - -/****s* struct/XML_ELEM_ERROR - * NAME - * XML_ELEM_ERROR - * NOTES - * defines an xml parser error - * SOURCE - */ -typedef struct _xml_elem_error { - int parser_code; - const char* parser_error; - long line; - long column; - long byte_index; -} STRUCT_XML_ELEM_ERROR, *XML_ELEM_ERROR; -/******/ - - -/*-************************ -* begin xml element stuff * -**************************/ - -/****s* struct/xml_elem_attr - * NAME - * xml_elem_attr - * NOTES - * representation of an xml attribute, foo="bar" - * SOURCE - */ -typedef struct _xml_element_attr { - char* key; /* attribute key */ - char* val; /* attribute value */ -} xml_element_attr; -/******/ - -/****s* struct/xml_elem_attr - * NAME - * xml_elem_attr - * NOTES - * representation of an xml element, eg - * SOURCE - */ -typedef struct _xml_element { - const char* name; /* element identifier */ - simplestring text; /* text contained between element begin/end pairs */ - struct _xml_element* parent; /* element's parent */ - - queue attrs; /* attribute list */ - queue children; /* child element list */ -} xml_element; -/******/ - -void xml_elem_free(xml_element* root); -void xml_elem_free_non_recurse(xml_element* root); -xml_element* xml_elem_new(void); -char* xml_elem_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len); -void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options); -xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error); - -/*-********************** -* end xml element stuff * -************************/ - -/*-********************** -* Begin xml_element API * -************************/ - -/****d* VALUE/XMLRPC_MACROS - * NAME - * Some Helpful Macros - * NOTES - * Some macros for making life easier. Should be self-explanatory. - * SEE ALSO - * XMLRPC_AddValueToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * SOURCE - */ -#define xml_elem_next_element(el) ((el) ? (xml_element *)Q_Next(&el->children) : NULL) -#define xml_elem_head_element(el) ((el) ? (xml_element *)Q_Head(&el->children) : NULL) -#define xml_elem_next_attr(el) ((el) ? (xml_element_attr *)Q_Next(&el->attrs) : NULL) -#define xml_elem_head_attr(el) ((el) ? (xml_element_attr *)Q_Head(&el->attrs) : NULL) -#define xml_elem_get_name(el) (char *)((el) ? el->name : NULL) -#define xml_elem_get_val(el) (char *)((el) ? el->text.str : NULL) -/******/ - - -/*-******************** -* End xml_element API * -**********************/ - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_ELEMENT_H__ */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c b/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c deleted file mode 100644 index b51d99172361f..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_dandarpc.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define ELEM_METHODCALL "methodCall" -#define ELEM_METHODNAME "methodName" -#define ELEM_METHODRESPONSE "methodResponse" -#define ELEM_ROOT "simpleRPC" - -#define ATTR_ARRAY "array" -#define ATTR_BASE64 "base64" -#define ATTR_BOOLEAN "boolean" -#define ATTR_DATETIME "dateTime.iso8601" -#define ATTR_DOUBLE "double" -#define ATTR_ID "id" -#define ATTR_INT "int" -#define ATTR_MIXED "mixed" -#define ATTR_SCALAR "scalar" -#define ATTR_STRING "string" -#define ATTR_STRUCT "struct" -#define ATTR_TYPE "type" -#define ATTR_VECTOR "vector" -#define ATTR_VERSION "version" - -#define VAL_VERSION_0_9 "0.9" - - -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST_worker(XMLRPC_REQUEST request, XMLRPC_VALUE xCurrent, xml_element* el) { - if(!xCurrent) { - xCurrent = XMLRPC_CreateValueEmpty(); - } - - if(el->name) { - const char* id = NULL; - const char* type = NULL; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - - while(attr_iter) { - if(!strcmp(attr_iter->key, ATTR_ID)) { - id = attr_iter->val; - } - if(!strcmp(attr_iter->key, ATTR_TYPE)) { - type = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - if(id) { - XMLRPC_SetValueID_Case(xCurrent, id, 0, xmlrpc_case_exact); - } - - if(!strcmp(el->name, ATTR_SCALAR)) { - if(!type || !strcmp(type, ATTR_STRING)) { - XMLRPC_SetValueString(xCurrent, el->text.str, el->text.len); - } - else if(!strcmp(type, ATTR_INT)) { - XMLRPC_SetValueInt(xCurrent, atoi(el->text.str)); - } - else if(!strcmp(type, ATTR_BOOLEAN)) { - XMLRPC_SetValueBoolean(xCurrent, atoi(el->text.str)); - } - else if(!strcmp(type, ATTR_DOUBLE)) { - XMLRPC_SetValueDouble(xCurrent, atof(el->text.str)); - } - else if(!strcmp(type, ATTR_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(xCurrent, el->text.str); - } - else if(!strcmp(type, ATTR_BASE64)) { - struct buffer_st buf; - base64_decode(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(xCurrent, buf.data, buf.offset); - buffer_delete(&buf); - } - } - else if(!strcmp(el->name, ATTR_VECTOR)) { - xml_element* iter = (xml_element*)Q_Head(&el->children); - - if(!type || !strcmp(type, ATTR_MIXED)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_mixed); - } - else if(!strcmp(type, ATTR_ARRAY)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_array); - } - else if(!strcmp(type, ATTR_STRUCT)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_struct); - } - while( iter ) { - XMLRPC_VALUE xNext = XMLRPC_CreateValueEmpty(); - xml_element_to_DANDARPC_REQUEST_worker(request, xNext, iter); - XMLRPC_AddValueToVector(xCurrent, xNext); - iter = (xml_element*)Q_Next(&el->children); - } - } - else { - xml_element* iter = (xml_element*)Q_Head(&el->children); - while( iter ) { - xml_element_to_DANDARPC_REQUEST_worker(request, xCurrent, iter); - iter = (xml_element*)Q_Next(&el->children); - } - - if(!strcmp(el->name, ELEM_METHODCALL)) { - if(request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - } - } - else if(!strcmp(el->name, ELEM_METHODRESPONSE)) { - if(request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_response); - } - } - else if(!strcmp(el->name, ELEM_METHODNAME)) { - if(request) { - XMLRPC_RequestSetMethodName(request, el->text.str); - } - } - } - } - return xCurrent; -} - -XMLRPC_VALUE xml_element_to_DANDARPC_VALUE(xml_element* el) -{ - return xml_element_to_DANDARPC_REQUEST_worker(NULL, NULL, el); -} - -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if(request) { - return XMLRPC_RequestSetData(request, xml_element_to_DANDARPC_REQUEST_worker(request, NULL, el)); - } - return NULL; -} - -xml_element* DANDARPC_to_xml_element_worker(XMLRPC_REQUEST request, XMLRPC_VALUE node) { -#define BUF_SIZE 512 - xml_element* root = NULL; - if(node) { - char buf[BUF_SIZE]; - const char* id = XMLRPC_GetValueID(node); - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(node); - XMLRPC_REQUEST_OUTPUT_OPTIONS output = XMLRPC_RequestGetOutputOptions(request); - int bNoAddType = (type == xmlrpc_string && request && output && output->xml_elem_opts.verbosity == xml_elem_no_white_space); - xml_element* elem_val = xml_elem_new(); - const char* pAttrType = NULL; - - xml_element_attr* attr_type = bNoAddType ? NULL : malloc(sizeof(xml_element_attr)); - - if(attr_type) { - attr_type->key = strdup(ATTR_TYPE); - attr_type->val = 0; - Q_PushTail(&elem_val->attrs, attr_type); - } - - elem_val->name = (type == xmlrpc_vector) ? strdup(ATTR_VECTOR) : strdup(ATTR_SCALAR); - - if(id && *id) { - xml_element_attr* attr_id = malloc(sizeof(xml_element_attr)); - if(attr_id) { - attr_id->key = strdup(ATTR_ID); - attr_id->val = strdup(id); - Q_PushTail(&elem_val->attrs, attr_id); - } - } - - switch(type) { - case xmlrpc_string: - pAttrType = ATTR_STRING; - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_int: - pAttrType = ATTR_INT; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_boolean: - pAttrType = ATTR_BOOLEAN; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_double: - pAttrType = ATTR_DOUBLE; - snprintf(buf, BUF_SIZE, "%f", XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_datetime: - pAttrType = ATTR_DATETIME; - simplestring_add(&elem_val->text, XMLRPC_GetValueDateTime_ISO8601(node)); - break; - case xmlrpc_base64: - { - struct buffer_st buf; - pAttrType = ATTR_BASE64; - base64_encode(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - case xmlrpc_vector: - { - XMLRPC_VECTOR_TYPE my_type = XMLRPC_GetVectorType(node); - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - - switch(my_type) { - case xmlrpc_vector_array: - pAttrType = ATTR_ARRAY; - break; - case xmlrpc_vector_mixed: - pAttrType = ATTR_MIXED; - break; - case xmlrpc_vector_struct: - pAttrType = ATTR_STRUCT; - break; - default: - break; - } - - /* recurse through sub-elements */ - while( xIter ) { - xml_element* next_el = DANDARPC_to_xml_element_worker(request, xIter); - if(next_el) { - Q_PushTail(&elem_val->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - break; - default: - break; - } - if(pAttrType && attr_type && !bNoAddType) { - attr_type->val = strdup(pAttrType); - } - root = elem_val; - } - return root; -} - -xml_element* DANDARPC_VALUE_to_xml_element(XMLRPC_VALUE node) { - return DANDARPC_to_xml_element_worker(NULL, node); -} - -xml_element* DANDARPC_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* wrapper = NULL; - xml_element* root = NULL; - if(request) { - XMLRPC_REQUEST_TYPE request_type = XMLRPC_RequestGetRequestType(request); - const char* pStr = NULL; - xml_element_attr* version = malloc(sizeof(xml_element_attr)); - version->key = strdup(ATTR_VERSION); - version->val = strdup(VAL_VERSION_0_9); - - wrapper = xml_elem_new(); - - if(request_type == xmlrpc_request_response) { - pStr = ELEM_METHODRESPONSE; - } - else if(request_type == xmlrpc_request_call) { - pStr = ELEM_METHODCALL; - } - if(pStr) { - wrapper->name = strdup(pStr); - } - - root = xml_elem_new(); - root->name = strdup(ELEM_ROOT); - Q_PushTail(&root->attrs, version); - Q_PushTail(&root->children, wrapper); - - pStr = XMLRPC_RequestGetMethodName(request); - - if(pStr) { - xml_element* method = xml_elem_new(); - method->name = strdup(ELEM_METHODNAME); - simplestring_add(&method->text, pStr); - Q_PushTail(&wrapper->children, method); - } - Q_PushTail(&wrapper->children, - DANDARPC_to_xml_element_worker(request, XMLRPC_RequestGetData(request))); - } - return root; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h b/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h deleted file mode 100644 index 6facb557788c4..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef XML_TO_DANDARPC_H - #define XML_TO_DANDARPC_H - -#include "time.h" -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_DANDARPC_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* DANDARPC_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* DANDARPC_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_DANDARPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c deleted file mode 100644 index 8390f06e8e2f3..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c +++ /dev/null @@ -1,670 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) -*/ - - -/*-********************************************************************** -* TODO: * -* - [SOAP-ENC:position] read sparse arrays (and write?) * -* - [SOAP-ENC:offset] read partially transmitted arrays (and write?) * -* - read "flattened" multi-dimensional arrays. (don't bother writing) * -* * -* BUGS: * -* - does not read schema. thus only knows soap pre-defined types. * -* - references (probably) do not work. untested. * -* - does not expose SOAP-ENV:Header to application at all. * -* - does not use namespaces correctly, thus: * -* - namespaces are hard-coded in comparison tokens * -* - if a sender uses another namespace identifer, it will break * -************************************************************************/ - - -static const char rcsid[] = "#(@) $Id:"; - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_soap.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define TOKEN_ANY "xsd:ur-type" -#define TOKEN_ARRAY "SOAP-ENC:Array" -#define TOKEN_ARRAY_TYPE "SOAP-ENC:arrayType" -#define TOKEN_BASE64 "SOAP-ENC:base64" -#define TOKEN_BOOLEAN "xsd:boolean" -#define TOKEN_DATETIME "xsd:timeInstant" -#define TOKEN_DOUBLE "xsd:double" -#define TOKEN_FLOAT "xsd:float" -#define TOKEN_ID "id" -#define TOKEN_INT "xsd:int" -#define TOKEN_NULL "xsi:null" -#define TOKEN_STRING "xsd:string" -#define TOKEN_STRUCT "xsd:struct" -#define TOKEN_TYPE "xsi:type" -#define TOKEN_FAULT "SOAP-ENV:Fault" -#define TOKEN_MUSTUNDERSTAND "SOAP-ENV:mustUnderstand" -#define TOKEN_ACTOR "SOAP-ENV:actor" -#define TOKEN_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next" - -#define TOKEN_XMLRPC_FAULTCODE "faultCode" -#define TOKEN_XMLRPC_FAULTSTRING "faultString" -#define TOKEN_SOAP_FAULTCODE "faultcode" -#define TOKEN_SOAP_FAULTSTRING "faultstring" -#define TOKEN_SOAP_FAULTDETAILS "details" -#define TOKEN_SOAP_FAULTACTOR "actor" - - -/* determine if a string represents a soap type, as used in element names */ -static inline int is_soap_type(const char* soap_type) { - return(strstr(soap_type, "SOAP-ENC:") || strstr(soap_type, "xsd:")) ? 1 : 0; -} - -/* utility func to generate a new attribute. possibly should be in xml_element.c?? */ -static xml_element_attr* new_attr(const char* key, const char* val) { - xml_element_attr* attr = malloc(sizeof(xml_element_attr)); - if (attr) { - attr->key = key ? strdup(key) : NULL; - attr->val = val ? strdup(val) : NULL; - } - return attr; -} - -struct array_info { - char kids_type[30]; - unsigned long size; - /* ... ? */ -}; - - -/* parses soap arrayType attribute to generate an array_info structure. - * TODO: should deal with sparse, flattened, & multi-dimensional arrays - */ -static struct array_info* parse_array_type_info(const char* array_type) { - struct array_info* ai = NULL; - if (array_type) { - ai = (struct array_info*)calloc(1, sizeof(struct array_info)); - if (ai) { - char buf[128], *p; - snprintf(buf, sizeof(buf), "%s", array_type); - p = strchr(buf, '['); - if (p) { - *p = 0; - } - strcpy(ai->kids_type, buf); - } - } - return ai; -} - -/* performs heuristics on an xmlrpc_vector_array to determine - * appropriate soap arrayType string. - */ -static const char* get_array_soap_type(XMLRPC_VALUE node) { - XMLRPC_VALUE_TYPE_EASY type = xmlrpc_type_none; - - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - int loopCount = 0; - const char* soapType = TOKEN_ANY; - - type = XMLRPC_GetValueTypeEasy(xIter); - xIter = XMLRPC_VectorNext(node); - - while (xIter) { - /* 50 seems like a decent # of loops. That will likely - * cover most cases. Any more and we start to sacrifice - * performance. - */ - if ( (XMLRPC_GetValueTypeEasy(xIter) != type) || loopCount >= 50) { - type = xmlrpc_type_none; - break; - } - loopCount ++; - - xIter = XMLRPC_VectorNext(node); - } - switch (type) { - case xmlrpc_type_none: - soapType = TOKEN_ANY; - break; - case xmlrpc_type_empty: - soapType = TOKEN_NULL; - break; - case xmlrpc_type_int: - soapType = TOKEN_INT; - break; - case xmlrpc_type_double: - soapType = TOKEN_DOUBLE; - break; - case xmlrpc_type_boolean: - soapType = TOKEN_BOOLEAN; - break; - case xmlrpc_type_string: - soapType = TOKEN_STRING; - break; - case xmlrpc_type_base64: - soapType = TOKEN_BASE64; - break; - case xmlrpc_type_datetime: - soapType = TOKEN_DATETIME; - break; - case xmlrpc_type_struct: - soapType = TOKEN_STRUCT; - break; - case xmlrpc_type_array: - soapType = TOKEN_ARRAY; - break; - case xmlrpc_type_mixed: - soapType = TOKEN_STRUCT; - break; - } - return soapType; -} - -/* determines wether a node is a fault or not, and of which type: - * 0 = not a fault, - * 1 = xmlrpc style fault - * 2 = soap style fault. - */ -static inline int get_fault_type(XMLRPC_VALUE node) { - if (XMLRPC_VectorGetValueWithID(node, TOKEN_XMLRPC_FAULTCODE) && - XMLRPC_VectorGetValueWithID(node, TOKEN_XMLRPC_FAULTSTRING)) { - return 1; - } - else if (XMLRPC_VectorGetValueWithID(node, TOKEN_SOAP_FAULTCODE) && - XMLRPC_VectorGetValueWithID(node, TOKEN_SOAP_FAULTSTRING)) { - return 2; - } - return 0; -} - -/* input: an XMLRPC_VALUE representing a fault struct in xml-rpc style. - * output: an XMLRPC_VALUE representing a fault struct in soap style, - * with xmlrpc codes mapped to soap codes, and all other values preserved. - * note that the returned value is a completely new value, and must be freed. - * the input value is untouched. - */ -static XMLRPC_VALUE gen_fault_xmlrpc(XMLRPC_VALUE node, xml_element* el_target) { - XMLRPC_VALUE xDup = XMLRPC_DupValueNew(node); - XMLRPC_VALUE xCode = XMLRPC_VectorGetValueWithID(xDup, TOKEN_XMLRPC_FAULTCODE); - XMLRPC_VALUE xStr = XMLRPC_VectorGetValueWithID(xDup, TOKEN_XMLRPC_FAULTSTRING); - - XMLRPC_SetValueID(xCode, TOKEN_SOAP_FAULTCODE, 0); - XMLRPC_SetValueID(xStr, TOKEN_SOAP_FAULTSTRING, 0); - - /* rough mapping of xmlrpc fault codes to soap codes */ - switch (XMLRPC_GetValueInt(xCode)) { - case -32700: /* "parse error. not well formed", */ - case -32701: /* "parse error. unsupported encoding" */ - case -32702: /* "parse error. invalid character for encoding" */ - case -32600: /* "server error. invalid xml-rpc. not conforming to spec." */ - case -32601: /* "server error. requested method not found" */ - case -32602: /* "server error. invalid method parameters" */ - XMLRPC_SetValueString(xCode, "SOAP-ENV:Client", 0); - break; - case -32603: /* "server error. internal xml-rpc error" */ - case -32500: /* "application error" */ - case -32400: /* "system error" */ - case -32300: /* "transport error */ - XMLRPC_SetValueString(xCode, "SOAP-ENV:Server", 0); - break; - } - return xDup; -} - -/* returns a new XMLRPC_VALUE representing a soap fault, comprised of a struct with four keys. */ -static XMLRPC_VALUE gen_soap_fault(const char* fault_code, const char* fault_string, - const char* actor, const char* details) { - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(TOKEN_FAULT, xmlrpc_vector_struct); - XMLRPC_AddValuesToVector(xReturn, - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTCODE, fault_code, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTSTRING, fault_string, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTACTOR, actor, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTDETAILS, details, 0), - NULL); - return xReturn; -} - -/* translates xml soap dom to native data structures. recursive. */ -XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request, - XMLRPC_VALUE xParent, - struct array_info* parent_array, - XMLRPC_VALUE xCurrent, - xml_element* el, - int depth) { - XMLRPC_REQUEST_TYPE rtype = xmlrpc_request_none; - - /* no current element on first call */ - if (!xCurrent) { - xCurrent = XMLRPC_CreateValueEmpty(); - } - - /* increment recursion depth guage */ - depth ++; - - /* safety first. must have a valid element */ - if (el && el->name) { - const char* id = NULL; - const char* type = NULL, *arrayType=NULL, *actor = NULL; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - int b_must_understand = 0; - - /* in soap, types may be specified in either element name -or- with xsi:type attribute. */ - if (is_soap_type(el->name)) { - type = el->name; - } - /* if our parent node, by definition a vector, is not an array, then - our element name must be our key identifier. */ - else if (XMLRPC_GetVectorType(xParent) != xmlrpc_vector_array) { - id = el->name; - if(!strcmp(id, "item")) { - } - } - - /* iterate through element attributes, pick out useful stuff. */ - while (attr_iter) { - /* element's type */ - if (!strcmp(attr_iter->key, TOKEN_TYPE)) { - type = attr_iter->val; - } - /* array type */ - else if (!strcmp(attr_iter->key, TOKEN_ARRAY_TYPE)) { - arrayType = attr_iter->val; - } - /* must understand, sometimes present in headers. */ - else if (!strcmp(attr_iter->key, TOKEN_MUSTUNDERSTAND)) { - b_must_understand = strchr(attr_iter->val, '1') ? 1 : 0; - } - /* actor, used in conjuction with must understand. */ - else if (!strcmp(attr_iter->key, TOKEN_ACTOR)) { - actor = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - /* check if caller says we must understand something in a header. */ - if (b_must_understand) { - /* is must understand actually indended for us? - BUG: spec says we should also determine if actor is our URL, but - we do not have that information. */ - if (!actor || !strcmp(actor, TOKEN_ACTOR_NEXT)) { - /* TODO: implement callbacks or other mechanism for applications - to "understand" these headers. For now, we just bail if we - get a mustUnderstand header intended for us. */ - XMLRPC_RequestSetError(request, - gen_soap_fault("SOAP-ENV:MustUnderstand", - "SOAP Must Understand Error", - "", "")); - return xCurrent; - } - } - - /* set id (key) if one was found. */ - if (id) { - XMLRPC_SetValueID_Case(xCurrent, id, 0, xmlrpc_case_exact); - } - - /* according to soap spec, - depth 1 = Envelope, 2 = Header, Body & Fault, 3 = methodcall or response. */ - if (depth == 3) { - const char* methodname = el->name; - char* p = NULL; - - /* BUG: we determine request or response type using presence of "Response" in element name. - According to spec, this is only recommended, not required. Apparently, implementations - are supposed to know the type of action based on state, which strikes me as a bit lame. - Anyway, we don't have that state info, thus we use Response as a heuristic. */ - rtype = -#ifdef strcasestr - strcasestr(el->name, "response") ? xmlrpc_request_response : xmlrpc_request_call; -#else - strstr(el->name, "esponse") ? xmlrpc_request_response : xmlrpc_request_call; -#endif - XMLRPC_RequestSetRequestType(request, rtype); - - /* Get methodname. strip xml namespace crap. */ - p = strchr(el->name, ':'); - if (p) { - methodname = p + 1; - } - if (rtype == xmlrpc_request_call) { - XMLRPC_RequestSetMethodName(request, methodname); - } - } - - - /* Next, we begin to convert actual values. if no children, then must be a scalar value. */ - if (!Q_Size(&el->children)) { - if (!type && parent_array && parent_array->kids_type[0]) { - type = parent_array->kids_type; - } - if (!type || !strcmp(type, TOKEN_STRING)) { - XMLRPC_SetValueString(xCurrent, el->text.str, el->text.len); - } - else if (!strcmp(type, TOKEN_INT)) { - XMLRPC_SetValueInt(xCurrent, atoi(el->text.str)); - } - else if (!strcmp(type, TOKEN_BOOLEAN)) { - XMLRPC_SetValueBoolean(xCurrent, atoi(el->text.str)); - } - else if (!strcmp(type, TOKEN_DOUBLE) || - !strcmp(type, TOKEN_FLOAT)) { - XMLRPC_SetValueDouble(xCurrent, atof(el->text.str)); - } - else if (!strcmp(type, TOKEN_NULL)) { - /* already an empty val. do nothing. */ - } - else if (!strcmp(type, TOKEN_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(xCurrent, el->text.str); - } - else if (!strcmp(type, TOKEN_BASE64)) { - struct buffer_st buf; - base64_decode(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(xCurrent, buf.data, buf.offset); - buffer_delete(&buf); - } - } - /* Element has children, thus a vector, or "compound type" in soap-speak. */ - else { - struct array_info* ai = NULL; - xml_element* iter = (xml_element*)Q_Head(&el->children); - - if (!type || !strcmp(type, TOKEN_STRUCT)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_struct); - } - else if (!strcmp(type, TOKEN_ARRAY) || arrayType != NULL) { - /* determine magic associated with soap array type. - this is passed down as we recurse, so our children have access to the info. */ - ai = parse_array_type_info(arrayType); // alloc'ed ai free'd below. - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_array); - } - else { - /* mixed is probably closest thing we have to compound type. */ - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_mixed); - } - /* Recurse, adding values as we go. Check for error during recursion - and if found, bail. this short-circuits us out of the recursion. */ - while ( iter && !XMLRPC_RequestGetError(request) ) { - XMLRPC_VALUE xNext = NULL; - /* top level elements don't actually represent values, so we just pass the - current value along until we are deep enough. */ - if ( depth <= 2 || - (rtype == xmlrpc_request_response && depth <= 3) ) { - xml_element_to_SOAP_REQUEST_worker(request, NULL, ai, xCurrent, iter, depth); - } - /* ready to do some actual de-serialization. create a new empty value and - pass that along to be init'd, then add it to our current vector. */ - else { - xNext = XMLRPC_CreateValueEmpty(); - xml_element_to_SOAP_REQUEST_worker(request, xCurrent, ai, xNext, iter, depth); - XMLRPC_AddValueToVector(xCurrent, xNext); - } - iter = (xml_element*)Q_Next(&el->children); - } - /* cleanup */ - if (ai) { - free(ai); - } - } - } - return xCurrent; -} - -/* Convert soap xml dom to XMLRPC_VALUE, sans request info. untested. */ -XMLRPC_VALUE xml_element_to_SOAP_VALUE(xml_element* el) -{ - return xml_element_to_SOAP_REQUEST_worker(NULL, NULL, NULL, NULL, el, 0); -} - -/* Convert soap xml dom to XMLRPC_REQUEST */ -XMLRPC_VALUE xml_element_to_SOAP_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if (request) { - return XMLRPC_RequestSetData(request, xml_element_to_SOAP_REQUEST_worker(request, NULL, NULL, NULL, el, 0)); - } - return NULL; -} - - -/* translates data structures to soap/xml. recursive */ -xml_element* SOAP_to_xml_element_worker(XMLRPC_REQUEST request, XMLRPC_VALUE node) { -#define BUF_SIZE 128 - xml_element* elem_val = NULL; - if (node) { - int bFreeNode = 0; /* sometimes we may need to free 'node' variable */ - char buf[BUF_SIZE]; - XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(node); - char* pName = NULL, *pAttrType = NULL; - - /* create our return value element */ - elem_val = xml_elem_new(); - - switch (type) { - case xmlrpc_type_struct: - case xmlrpc_type_mixed: - case xmlrpc_type_array: - if (type == xmlrpc_type_array) { - /* array's are _very_ special in soap. - TODO: Should handle sparse/partial arrays here. */ - - /* determine soap array type. */ - const char* type = get_array_soap_type(node); - xml_element_attr* attr_array_type = NULL; - - /* specify array kids type and array size. */ - snprintf(buf, sizeof(buf), "%s[%i]", type, XMLRPC_VectorSize(node)); - attr_array_type = new_attr(TOKEN_ARRAY_TYPE, buf); - - Q_PushTail(&elem_val->attrs, attr_array_type); - - pAttrType = TOKEN_ARRAY; - } - /* check for fault, which is a rather special case. - (can't these people design anything consistent/simple/elegant?) */ - else if (type == xmlrpc_type_struct) { - int fault_type = get_fault_type(node); - if (fault_type) { - if (fault_type == 1) { - /* gen fault from xmlrpc style fault codes - notice that we get a new node, which must be freed herein. */ - node = gen_fault_xmlrpc(node, elem_val); - bFreeNode = 1; - } - pName = TOKEN_FAULT; - } - } - - { - /* recurse through sub-elements */ - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - while ( xIter ) { - xml_element* next_el = SOAP_to_xml_element_worker(request, xIter); - if (next_el) { - Q_PushTail(&elem_val->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - - break; - - /* handle scalar types */ - case xmlrpc_type_empty: - pAttrType = TOKEN_NULL; - break; - case xmlrpc_type_string: - pAttrType = TOKEN_STRING; - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_type_int: - pAttrType = TOKEN_INT; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_boolean: - pAttrType = TOKEN_BOOLEAN; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_double: - pAttrType = TOKEN_DOUBLE; - snprintf(buf, BUF_SIZE, "%f", XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_datetime: - { - time_t tt = XMLRPC_GetValueDateTime(node); - struct tm *tm = localtime (&tt); - pAttrType = TOKEN_DATETIME; - if(strftime (buf, BUF_SIZE, "%Y-%m-%dT%H:%M:%SZ", tm)) { - simplestring_add(&elem_val->text, buf); - } - } - break; - case xmlrpc_type_base64: - { - struct buffer_st buf; - pAttrType = TOKEN_BASE64; - base64_encode(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - break; - default: - break; - } - - /* determining element's name is a bit tricky, due to soap semantics. */ - if (!pName) { - /* if the value's type is known... */ - if (pAttrType) { - /* see if it has an id (key). If so, use that as name, and type as an attribute. */ - pName = (char*)XMLRPC_GetValueID(node); - if (pName) { - Q_PushTail(&elem_val->attrs, new_attr(TOKEN_TYPE, pAttrType)); - } - - /* otherwise, use the type as the name. */ - else { - pName = pAttrType; - } - } - /* if the value's type is not known... (a rare case?) */ - else { - /* see if it has an id (key). otherwise, default to generic "item" */ - pName = (char*)XMLRPC_GetValueID(node); - if (!pName) { - pName = "item"; - } - } - } - elem_val->name = strdup(pName); - - /* cleanup */ - if (bFreeNode) { - XMLRPC_CleanupValue(node); - } - } - return elem_val; -} - -/* convert XMLRPC_VALUE to soap xml dom. untested. */ -xml_element* SOAP_VALUE_to_xml_element(XMLRPC_VALUE node) { - return SOAP_to_xml_element_worker(NULL, node); -} - -/* convert XMLRPC_REQUEST to soap xml dom. */ -xml_element* SOAP_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* root = xml_elem_new(); - - /* safety first. */ - if (root) { - xml_element* body = xml_elem_new(); - root->name = strdup("SOAP-ENV:Envelope"); - - /* silly namespace stuff */ - Q_PushTail(&root->attrs, new_attr("xmlns:SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/")); - Q_PushTail(&root->attrs, new_attr("xmlns:xsi", "http://www.w3.org/1999/XMLSchema-instance")); - Q_PushTail(&root->attrs, new_attr("xmlns:xsd", "http://www.w3.org/1999/XMLSchema")); - Q_PushTail(&root->attrs, new_attr("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/")); - Q_PushTail(&root->attrs, new_attr("xmlns:si", "http://soapinterop.org/xsd")); - Q_PushTail(&root->attrs, new_attr("xmlns:ns6", "http://testuri.org")); - Q_PushTail(&root->attrs, new_attr("SOAP-ENV:encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/")); - - /* Q_PushHead(&root->attrs, new_attr("xmlns:ks", "http://kitchen.sink.org/soap/everything/under/sun")); - JUST KIDDING!! :-) ----> ------------------------------------------------- */ - - if (body) { - /* go ahead and serialize first... */ - xml_element* el_serialized = - SOAP_to_xml_element_worker(request, - XMLRPC_RequestGetData(request)); - - /* check for fault, in which case, there is no intermediate element */ - if (el_serialized && !strcmp(el_serialized->name, TOKEN_FAULT)) { - Q_PushTail(&body->children, el_serialized); - } - /* usual case: not a fault. Add Response element in between. */ - else { - xml_element* rpc = xml_elem_new(); - - if (rpc) { - const char* methodname = XMLRPC_RequestGetMethodName(request); - XMLRPC_REQUEST_TYPE rtype = XMLRPC_RequestGetRequestType(request); - - /* if we are making a request, we want to use the methodname as is. */ - if (rtype == xmlrpc_request_call) { - if (methodname) { - rpc->name = strdup(methodname); - } - } - /* if it's a response, we append "Response". Also, given xmlrpc-epi - API/architecture, it's likely that we don't have a methodname for - the response, so we have to check that. */ - else { - char buf[128]; - snprintf(buf, sizeof(buf), "%s%s", - methodname ? methodname : "", - "Response"); - - rpc->name = strdup(buf); - } - - /* add serialized data to method call/response. - add method call/response to body element */ - if (rpc->name) { - if(el_serialized) { - if(Q_Size(&el_serialized->children) && rtype == xmlrpc_request_call) { - xml_element* iter = (xml_element*)Q_Head(&el_serialized->children); - while(iter) { - Q_PushTail(&rpc->children, iter); - iter = (xml_element*)Q_Next(&el_serialized->children); - } - xml_elem_free_non_recurse(el_serialized); - } - else { - Q_PushTail(&rpc->children, el_serialized); - } - } - - Q_PushTail(&body->children, rpc); - } - else { - /* no method name?! - TODO: fault here...? */ - } - } - } - body->name = strdup("SOAP-ENV:Body"); - Q_PushTail(&root->children, body); - } - } - - return root; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.h b/ext/xmlrpc/libxmlrpc/xml_to_soap.h deleted file mode 100644 index 9ae9308b225bb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef XML_TO_SOAP_H - #define XML_TO_SOAP_H - -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_SOAP_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_SOAP_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* SOAP_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* SOAP_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_XMLRPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c deleted file mode 100644 index 4caf9e3afd222..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_xmlrpc.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define ELEM_ARRAY "array" -#define ELEM_BASE64 "base64" -#define ELEM_BOOLEAN "boolean" -#define ELEM_DATA "data" -#define ELEM_DATETIME "dateTime.iso8601" -#define ELEM_DOUBLE "double" -#define ELEM_FAULT "fault" -#define ELEM_FAULTCODE "faultCode" -#define ELEM_FAULTSTRING "faultString" -#define ELEM_I4 "i4" -#define ELEM_INT "int" -#define ELEM_MEMBER "member" -#define ELEM_METHODCALL "methodCall" -#define ELEM_METHODNAME "methodName" -#define ELEM_METHODRESPONSE "methodResponse" -#define ELEM_NAME "name" -#define ELEM_PARAM "param" -#define ELEM_PARAMS "params" -#define ELEM_STRING "string" -#define ELEM_STRUCT "struct" -#define ELEM_VALUE "value" - - -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST_worker(XMLRPC_REQUEST request, XMLRPC_VALUE parent_vector, XMLRPC_VALUE current_val, xml_element* el) { - if (!current_val) { - /* This should only be the case for the first element */ - current_val = XMLRPC_CreateValueEmpty(); - } - - if (el->name) { - - /* first, deal with the crazy/stupid fault format */ - if (!strcmp(el->name, ELEM_FAULT)) { - xml_element* fault_value = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_struct); - - if(fault_value) { - xml_element* fault_struct = (xml_element*)Q_Head(&fault_value->children); - if(fault_struct) { - xml_element* iter = (xml_element*)Q_Head(&fault_struct->children); - - while (iter) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&fault_struct->children); - } - } - } - } - else if (!strcmp(el->name, ELEM_DATA) /* should be ELEM_ARRAY, but there is an extra level. weird */ - || (!strcmp(el->name, ELEM_PARAMS) && - (XMLRPC_RequestGetRequestType(request) == xmlrpc_request_call)) ) { /* this "PARAMS" concept is silly. dave?! */ - xml_element* iter = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_array); - - while (iter) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&el->children); - } - } - else if (!strcmp(el->name, ELEM_STRUCT)) { - xml_element* iter = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_struct); - - while ( iter ) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&el->children); - } - } - else if (!strcmp(el->name, ELEM_STRING) || - (!strcmp(el->name, ELEM_VALUE) && Q_Size(&el->children) == 0)) { - XMLRPC_SetValueString(current_val, el->text.str, el->text.len); - } - else if (!strcmp(el->name, ELEM_NAME)) { - XMLRPC_SetValueID_Case(current_val, el->text.str, 0, xmlrpc_case_exact); - } - else if (!strcmp(el->name, ELEM_INT) || !strcmp(el->name, ELEM_I4)) { - XMLRPC_SetValueInt(current_val, atoi(el->text.str)); - } - else if (!strcmp(el->name, ELEM_BOOLEAN)) { - XMLRPC_SetValueBoolean(current_val, atoi(el->text.str)); - } - else if (!strcmp(el->name, ELEM_DOUBLE)) { - XMLRPC_SetValueDouble(current_val, atof(el->text.str)); - } - else if (!strcmp(el->name, ELEM_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(current_val, el->text.str); - } - else if (!strcmp(el->name, ELEM_BASE64)) { - struct buffer_st buf; - base64_decode(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(current_val, buf.data, buf.offset); - buffer_delete(&buf); - } - else { - xml_element* iter; - - if (!strcmp(el->name, ELEM_METHODCALL)) { - if (request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - } - } - else if (!strcmp(el->name, ELEM_METHODRESPONSE)) { - if (request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_response); - } - } - else if (!strcmp(el->name, ELEM_METHODNAME)) { - if (request) { - XMLRPC_RequestSetMethodName(request, el->text.str); - } - } - - iter = (xml_element*)Q_Head(&el->children); - while ( iter ) { - xml_element_to_XMLRPC_REQUEST_worker(request, parent_vector, - current_val, iter); - iter = (xml_element*)Q_Next(&el->children); - } - } - } - return current_val; -} - -XMLRPC_VALUE xml_element_to_XMLRPC_VALUE(xml_element* el) -{ - return xml_element_to_XMLRPC_REQUEST_worker(NULL, NULL, NULL, el); -} - -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if (request) { - return XMLRPC_RequestSetData(request, xml_element_to_XMLRPC_REQUEST_worker(request, NULL, NULL, el)); - } - return NULL; -} - -xml_element* XMLRPC_to_xml_element_worker(XMLRPC_VALUE current_vector, XMLRPC_VALUE node, - XMLRPC_REQUEST_TYPE request_type, int depth) { -#define BUF_SIZE 512 - xml_element* root = NULL; - if (node) { - char buf[BUF_SIZE]; - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(node); - XMLRPC_VECTOR_TYPE vtype = XMLRPC_GetVectorType(node); - xml_element* elem_val = xml_elem_new(); - - /* special case for when root element is not an array */ - if (depth == 0 && - !(type == xmlrpc_vector && - vtype == xmlrpc_vector_array && - request_type == xmlrpc_request_call) ) { - int bIsFault = (vtype == xmlrpc_vector_struct && XMLRPC_VectorGetValueWithID(node, ELEM_FAULTCODE)); - - xml_element* next_el = XMLRPC_to_xml_element_worker(NULL, node, request_type, depth + 1); - if (next_el) { - Q_PushTail(&elem_val->children, next_el); - } - elem_val->name = strdup(bIsFault ? ELEM_FAULT : ELEM_PARAMS); - } - else { - switch (type) { - case xmlrpc_empty: /* treat null value as empty string in xmlrpc. */ - case xmlrpc_string: - elem_val->name = strdup(ELEM_STRING); - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_int: - elem_val->name = strdup(ELEM_INT); - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_boolean: - elem_val->name = strdup(ELEM_BOOLEAN); - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_double: - elem_val->name = strdup(ELEM_DOUBLE); - snprintf(buf, BUF_SIZE, "%f", XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_datetime: - elem_val->name = strdup(ELEM_DATETIME); - simplestring_add(&elem_val->text, XMLRPC_GetValueDateTime_ISO8601(node)); - break; - case xmlrpc_base64: - { - struct buffer_st buf; - elem_val->name = strdup(ELEM_BASE64); - base64_encode(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - case xmlrpc_vector: - { - XMLRPC_VECTOR_TYPE my_type = XMLRPC_GetVectorType(node); - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - xml_element* root_vector_elem = elem_val; - - switch (my_type) { - case xmlrpc_vector_array: - { - if(depth == 0) { - elem_val->name = strdup(ELEM_PARAMS); - } - else { - /* Hi my name is Dave and I like to make things as confusing - * as possible, thus I will throw in this 'data' element - * where it absolutely does not belong just so that people - * cannot code arrays and structs in a similar and straight - * forward manner. Have a good day. - * - * GRRRRRRRRR! - */ - xml_element* data = xml_elem_new(); - data->name = strdup(ELEM_DATA); - - elem_val->name = strdup(ELEM_ARRAY); - Q_PushTail(&elem_val->children, data); - root_vector_elem = data; - } - } - break; - case xmlrpc_vector_mixed: /* not officially supported */ - case xmlrpc_vector_struct: - elem_val->name = strdup(ELEM_STRUCT); - break; - default: - break; - } - - /* recurse through sub-elements */ - while ( xIter ) { - xml_element* next_el = XMLRPC_to_xml_element_worker(node, xIter, request_type, depth + 1); - if (next_el) { - Q_PushTail(&root_vector_elem->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - break; - default: - break; - } - } - - { - XMLRPC_VECTOR_TYPE vtype = XMLRPC_GetVectorType(current_vector); - - if (depth == 1) { - xml_element* value = xml_elem_new(); - value->name = strdup(ELEM_VALUE); - - /* yet another hack for the "fault" crap */ - if (XMLRPC_VectorGetValueWithID(node, ELEM_FAULTCODE)) { - root = value; - } - else { - xml_element* param = xml_elem_new(); - param->name = strdup(ELEM_PARAM); - - Q_PushTail(¶m->children, value); - - root = param; - } - Q_PushTail(&value->children, elem_val); - } - else if (vtype == xmlrpc_vector_struct || vtype == xmlrpc_vector_mixed) { - xml_element* member = xml_elem_new(); - xml_element* name = xml_elem_new(); - xml_element* value = xml_elem_new(); - - member->name = strdup(ELEM_MEMBER); - name->name = strdup(ELEM_NAME); - value->name = strdup(ELEM_VALUE); - - simplestring_add(&name->text, XMLRPC_GetValueID(node)); - - Q_PushTail(&member->children, name); - Q_PushTail(&member->children, value); - Q_PushTail(&value->children, elem_val); - - root = member; - } - else if (vtype == xmlrpc_vector_array) { - xml_element* value = xml_elem_new(); - - value->name = strdup(ELEM_VALUE); - - Q_PushTail(&value->children, elem_val); - - root = value; - } - else if (vtype == xmlrpc_vector_none) { - /* no parent. non-op */ - root = elem_val; - } - else { - xml_element* value = xml_elem_new(); - - value->name = strdup(ELEM_VALUE); - - Q_PushTail(&value->children, elem_val); - - root = value; - } - } - } - return root; -} - -xml_element* XMLRPC_VALUE_to_xml_element(XMLRPC_VALUE node) { - return XMLRPC_to_xml_element_worker(NULL, node, xmlrpc_request_none, 0); -} - -xml_element* XMLRPC_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* wrapper = NULL; - if (request) { - const char* pStr = NULL; - XMLRPC_REQUEST_TYPE request_type = XMLRPC_RequestGetRequestType(request); - XMLRPC_VALUE xParams = XMLRPC_RequestGetData(request); - - wrapper = xml_elem_new(); - - if (request_type == xmlrpc_request_call) { - pStr = ELEM_METHODCALL; - } - else if (request_type == xmlrpc_request_response) { - pStr = ELEM_METHODRESPONSE; - } - if (pStr) { - wrapper->name = strdup(pStr); - } - - if(request_type == xmlrpc_request_call) { - pStr = XMLRPC_RequestGetMethodName(request); - - if (pStr) { - xml_element* method = xml_elem_new(); - method->name = strdup(ELEM_METHODNAME); - simplestring_add(&method->text, pStr); - Q_PushTail(&wrapper->children, method); - } - } - if (xParams) { - Q_PushTail(&wrapper->children, - XMLRPC_to_xml_element_worker(NULL, XMLRPC_RequestGetData(request), XMLRPC_RequestGetRequestType(request), 0)); - } - else { - /* Despite the spec, the xml-rpc list folk want me to send an empty params element */ - xml_element* params = xml_elem_new(); - params->name = strdup(ELEM_PARAMS); - Q_PushTail(&wrapper->children, params); - } - } - return wrapper; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h deleted file mode 100644 index 234a153460db2..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef XML_TO_XMLRPC_H - #define XML_TO_XMLRPC_H - -#include "time.h" -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_XMLRPC_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* XMLRPC_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* XMLRPC_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_XMLRPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c deleted file mode 100644 index 4112216866cc7..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ /dev/null @@ -1,2962 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - -/****h* ABOUT/xmlrpc - * NAME - * XMLRPC_VALUE - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 9/1999 - 10/2000 - * HISTORY - * $Log$ - * Revision 1.7 2005/03/26 03:13:58 sniper - * - Made it possible to build ext/xmlrpc with libxml2 - * - * Revision 1.6 2004/04/27 17:33:59 iliaa - * Removed C++ style comments. - * - * Revision 1.5 2003/12/16 21:00:21 sniper - * Fix some compile warnings (patch by Joe Orton) - * - * Revision 1.4 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.22 2002/03/09 23:15:44 danda - * add fault interrogation funcs - * - * Revision 1.21 2002/03/09 22:27:41 danda - * win32 build patches contributed by Jeff Lawson - * - * Revision 1.20 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.19 2001/10/12 23:25:54 danda - * default to writing xmlrpc - * - * Revision 1.18 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * 08/2000 -- danda -- PHP C extension that uses XMLRPC - * 08/2000 -- danda -- support for two vocabularies: danda-rpc and xml-rpc - * 09/1999 -- danda -- Initial API, before I even knew of standard XMLRPC vocab. Response only. - * 07/2000 -- danda -- wrote new implementation to be compatible with xmlrpc standard and - * incorporated some ideas from ensor, most notably the separation of - * xml dom from xmlrpc api. - * 06/2000 -- danda -- played with expat-ensor from www.ensor.org. Cool, but some flaws. - * TODO - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * Welcome to XMLRPC. For more info on the specification and history, see - * http://www.xmlrpc.org. - * - * This code aims to be a full-featured C implementation of XMLRPC. It does not - * have any networking code. Rather, it is intended to be plugged into apps - * or libraries with existing networking facilities, eg PHP, apache, perl, mozilla, - * home-brew application servers, etc. - * - * Usage Paradigm: - * The user of this library will typically be implementing either an XMLRPC server, - * an XMLRPC client, or both. The client will use the library to build an in-memory - * representation of a request, and then serialize (encode) that request into XML. The - * client will then send the XML to the server via external mechanism. The server will - * de-serialize the XML back into an binary representation, call the appropriate registered - * method -- thereby generating a response. The response will be serialized into XML and - * sent back to the client. The client will de-serialize it into memory, and can - * iterate through the results via API. - * - * Both the request and the response may consist of arbitrarily long, arbitrarily nested - * values. The values may be one of several types, as defined by XMLRPC_VALUE_TYPE. - * - * Features and Architecture: - * - The XML parsing (xml_element.c) is completely independent of the XMLRPC api. In fact, - * it can be used as a standalone dom implementation. - * - Because of this, the same XMLRPC data can be serialized into multiple xml vocabularies. - * It is simply a matter of writing a transport. So far, two transports have been defined. - * The default xmlrpc vocab (xml_to_xmlrpc.c), and simple-rpc (xml_to_dandarpc.c) which is - * proprietary, but imho more readable, and nice for proprietary legacy reasons. - * - Various output options, including: xml escaping via CDATA or entity, case folding, - * vocab version, and character encoding. - * - One to One mapping between C structures and actual values, unlike ensor which forces - * one to understand the arcana of the xmlrpc vocab. - * - support for mixed indexed/keyed vector types, making it more compatible with - * languages such as PHP. - * - quite speedy compared to implementations written in interpreted languages. Also, uses - * intelligent string handling, so not many strlen() calls, etc. - * - comprehensive API for manipulation of values - *******/ - -#include "ext/xml/expat_compat.h" -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include -#include -#include -#include - -#include "queue.h" -#include "xmlrpc.h" -#include "base64.h" - -#include "xml_to_xmlrpc.h" -#include "xml_to_dandarpc.h" -#include "xml_to_soap.h" -#include "xml_element.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include "system_methods_private.h" - - - -/*-********************* -* Begin Time Functions * -***********************/ - -static int date_from_ISO8601 (const char *text, time_t * value) { - struct tm tm; - int n; - int i; - char buf[18]; - - if (strchr (text, '-')) { - char *p = (char *) text, *p2 = buf; - while (p && *p) { - if (*p != '-') { - *p2 = *p; - p2++; - } - p++; - } - text = buf; - } - - - tm.tm_isdst = -1; - - if(strlen(text) < 17) { - return -1; - } - - n = 1000; - tm.tm_year = 0; - for(i = 0; i < 4; i++) { - tm.tm_year += (text[i]-'0')*n; - n /= 10; - } - n = 10; - tm.tm_mon = 0; - for(i = 0; i < 2; i++) { - tm.tm_mon += (text[i+4]-'0')*n; - n /= 10; - } - tm.tm_mon --; - - n = 10; - tm.tm_mday = 0; - for(i = 0; i < 2; i++) { - tm.tm_mday += (text[i+6]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_hour = 0; - for(i = 0; i < 2; i++) { - tm.tm_hour += (text[i+9]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_min = 0; - for(i = 0; i < 2; i++) { - tm.tm_min += (text[i+12]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_sec = 0; - for(i = 0; i < 2; i++) { - tm.tm_sec += (text[i+15]-'0')*n; - n /= 10; - } - - tm.tm_year -= 1900; - - *value = mktime(&tm); - - return 0; - -} - -static int date_to_ISO8601 (time_t value, char *buf, int length) { - struct tm *tm; - tm = localtime(&value); -#if 0 /* TODO: soap seems to favor this method. xmlrpc the latter. */ - return strftime (buf, length, "%Y-%m-%dT%H:%M:%SZ", tm); -#else - return strftime(buf, length, "%Y%m%dT%H:%M:%S", tm); -#endif -} - -/*-******************* -* End Time Functions * -*********************/ - - -/*-*************************** -* Begin XMLRPC_REQUEST funcs * -*****************************/ - -/****f* REQUEST/XMLRPC_RequestNew - * NAME - * XMLRPC_RequestNew - * SYNOPSIS - * XMLRPC_REQUEST XMLRPC_RequestNew() - * FUNCTION - * Creates a new XMLRPC_Request data struct - * INPUTS - * none - * SEE ALSO - * XMLRPC_RequestFree () - * SOURCE - */ -XMLRPC_REQUEST XMLRPC_RequestNew() { - XMLRPC_REQUEST xRequest = calloc(1, sizeof(STRUCT_XMLRPC_REQUEST)); - if(xRequest) { - simplestring_init(&xRequest->methodName); - } - return xRequest; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestFree - * NAME - * XMLRPC_RequestFree - * SYNOPSIS - * void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO) - * FUNCTION - * Free XMLRPC Request and all sub-values - * INPUTS - * request -- previously allocated request struct - * bFreeIO -- 1 = also free request value data, if any, 0 = ignore. - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_CleanupValue () - * SOURCE - */ -void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO) { - if(request) { - simplestring_free(&request->methodName); - - if(request->io && bFreeIO) { - XMLRPC_CleanupValue(request->io); - } - if(request->error) { - XMLRPC_CleanupValue(request->error); - } - my_free(request); - } -} - -/*******/ - -/* Set Method Name to call */ -/****f* REQUEST/XMLRPC_RequestSetMethodName - * NAME - * XMLRPC_RequestSetMethodName - * SYNOPSIS - * const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName) - * FUNCTION - * Set name of method to call with this request. - * INPUTS - * request -- previously allocated request struct - * methodName -- name of method - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetMethodName () - * XMLRPC_RequestFree () - * SOURCE - */ -const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName) { - if(request) { - simplestring_clear(&request->methodName); - simplestring_add(&request->methodName, methodName); - return request->methodName.str; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetMethodName - * NAME - * XMLRPC_RequestGetMethodName - * SYNOPSIS - * const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request) - * FUNCTION - * Get name of method called by this request - * INPUTS - * request -- previously allocated request struct - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetMethodName () - * XMLRPC_RequestFree () - * SOURCE - */ -const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request) { - return request ? request->methodName.str : NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestSetRequestType - * NAME - * XMLRPC_RequestSetRequestType - * SYNOPSIS - * XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType(XMLRPC_REQUEST request, XMLRPC_REQUEST_TYPE type) - * FUNCTION - * A request struct may be allocated by a caller or by xmlrpc - * in response to a request. This allows setting the - * request type. - * INPUTS - * request -- previously allocated request struct - * type -- request type [xmlrpc_method_call | xmlrpc_method_response] - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetRequestType () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType (XMLRPC_REQUEST request, - XMLRPC_REQUEST_TYPE type) { - if(request) { - request->request_type = type; - return request->request_type; - } - return xmlrpc_request_none; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetRequestType - * NAME - * XMLRPC_RequestGetRequestType - * SYNOPSIS - * XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request) - * FUNCTION - * A request struct may be allocated by a caller or by xmlrpc - * in response to a request. This allows setting the - * request type. - * INPUTS - * request -- previously allocated request struct - * RESULT - * type -- request type [xmlrpc_method_call | xmlrpc_method_response] - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetRequestType () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request) { - return request ? request->request_type : xmlrpc_request_none; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestSetData - * NAME - * XMLRPC_RequestSetData - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data) - * FUNCTION - * Associates a block of xmlrpc data with the request. The - * data is *not* copied. A pointer is kept. The caller - * should be careful not to doubly free the data value, - * which may optionally be free'd by XMLRPC_RequestFree(). - * INPUTS - * request -- previously allocated request struct - * data -- previously allocated data struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetData () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data) { - if(request && data) { - if (request->io) { - XMLRPC_CleanupValue (request->io); - } - request->io = XMLRPC_CopyValue(data); - return request->io; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetData - * NAME - * XMLRPC_RequestGetData - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request) - * FUNCTION - * Returns data associated with request, if any. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetData () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request) { - return request ? request->io : NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestSetError - * NAME - * XMLRPC_RequestSetError - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestSetError(XMLRPC_REQUEST request, XMLRPC_VALUE error) - * FUNCTION - * Associates a block of xmlrpc data, representing an error - * condition, with the request. - * INPUTS - * request -- previously allocated request struct - * error -- previously allocated error code or struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * NOTES - * This is a private function for usage by internals only. - * SEE ALSO - * XMLRPC_RequestGetError () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestSetError (XMLRPC_REQUEST request, XMLRPC_VALUE error) { - if (request && error) { - if (request->error) { - XMLRPC_CleanupValue (request->error); - } - request->error = XMLRPC_CopyValue (error); - return request->error; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetError - * NAME - * XMLRPC_RequestGetError - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestGetError(XMLRPC_REQUEST request) - * FUNCTION - * Returns error data associated with request, if any. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_VALUE -- pointer to error value stored, or NULL - * NOTES - * This is a private function for usage by internals only. - * SEE ALSO - * XMLRPC_RequestSetError () - * XMLRPC_RequestFree () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestGetError (XMLRPC_REQUEST request) { - return request ? request->error : NULL; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestSetOutputOptions - * NAME - * XMLRPC_RequestSetOutputOptions - * SYNOPSIS - * XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output) - * FUNCTION - * Sets output options used for generating XML. The output struct - * is copied, and may be freed by the caller. - * INPUTS - * request -- previously allocated request struct - * output -- output options struct initialized by caller - * RESULT - * XMLRPC_REQUEST_OUTPUT_OPTIONS -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetOutputOptions () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * SOURCE - */ -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output) { - if(request && output) { - memcpy (&request->output, output, - sizeof (STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS)); - return &request->output; - } - return NULL; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestGetOutputOptions - * NAME - * XMLRPC_RequestGetOutputOptions - * SYNOPSIS - * XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request) - * FUNCTION - * Gets a pointer to output options used for generating XML. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_REQUEST_OUTPUT_OPTIONS -- pointer to options stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetOutputOptions () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * SOURCE - */ -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request) { - return request ? &request->output : NULL; -} - -/*******/ - -/*-************************* -* End XMLRPC_REQUEST funcs * -***************************/ - - -/*-*************************** -* Begin Serializiation funcs * -*****************************/ - -/****f* SERIALIZE/XMLRPC_VALUE_ToXML - * NAME - * XMLRPC_VALUE_ToXML - * SYNOPSIS - * char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val) - * FUNCTION - * encode XMLRPC_VALUE into XML buffer. Note that the generated - * buffer will not contain a methodCall. - * INPUTS - * val -- previously allocated XMLRPC_VALUE - * buf_len -- length of returned buffer, if not null - * RESULT - * char* -- newly allocated buffer containing XML. - * It is the caller's responsibility to free it. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_VALUE_FromXML () - * XMLRPC_Free () - * XMLRPC_VALUE - * SOURCE - */ -char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val, int* buf_len) { - xml_element *root_elem = XMLRPC_VALUE_to_xml_element(val); - char* pRet = NULL; - - if(root_elem) { - pRet = xml_elem_serialize_to_string(root_elem, NULL, buf_len); - xml_elem_free(root_elem); - } - return pRet; -} - -/*******/ - -/****f* SERIALIZE/XMLRPC_REQUEST_ToXML - * NAME - * XMLRPC_REQUEST_ToXML - * SYNOPSIS - * char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request) - * FUNCTION - * encode XMLRPC_REQUEST into XML buffer - * INPUTS - * request -- previously allocated XMLRPC_REQUEST - * buf_len -- size of returned buf, if not null - * RESULT - * char* -- newly allocated buffer containing XML. - * It is the caller's responsibility to free it. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_REQUEST_FromXML () - * XMLRPC_Free () - * XMLRPC_VALUE_ToXML () - * XMLRPC_REQUEST - * SOURCE - */ -char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int* buf_len) { - char* pRet = NULL; - if (request) { - xml_element *root_elem = NULL; - if (request->output.version == xmlrpc_version_simple) { - root_elem = DANDARPC_REQUEST_to_xml_element (request); - } - else if (request->output.version == xmlrpc_version_1_0 || - request->output.version == xmlrpc_version_none) { - root_elem = XMLRPC_REQUEST_to_xml_element (request); - } - else if (request->output.version == xmlrpc_version_soap_1_1) { - root_elem = SOAP_REQUEST_to_xml_element (request); - } - - if(root_elem) { - pRet = - xml_elem_serialize_to_string (root_elem, - &request->output.xml_elem_opts, - buf_len); - xml_elem_free(root_elem); - } - } - return pRet; -} - -/*******/ - -/****f* SERIALIZE/XMLRPC_VALUE_FromXML - * NAME - * XMLRPC_VALUE_FromXML - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VALUE_FromXML(const char* in_buf, int le - * FUNCTION - * Retrieve XMLRPC_VALUE from XML buffer. Note that this will - * ignore any methodCall. See XMLRPC_REQUEST_FromXML - * INPUTS - * in_buf -- character buffer containing XML - * len -- length of buffer - * RESULT - * XMLRPC_VALUE -- newly allocated data, or NULL if error. Should - * be free'd by caller. - * SEE ALSO - * XMLRPC_VALUE_ToXML () - * XMLRPC_REQUEST_FromXML () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VALUE_FromXML (const char *in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options) { - XMLRPC_VALUE xResponse = NULL; - XMLRPC_REQUEST req = XMLRPC_REQUEST_FromXML(in_buf, len, in_options); - - if(req) { - xResponse = req->io; - XMLRPC_RequestFree(req, 0); - } - return xResponse; -} - -/*******/ - -/* map parser errors to standard xml-rpc errors */ -static XMLRPC_VALUE map_expat_errors(XML_ELEM_ERROR error) { - XMLRPC_VALUE xReturn = NULL; - if(error) { - XMLRPC_ERROR_CODE code; - char buf[1024]; - snprintf(buf, sizeof(buf), - "error occurred at line %ld, column %ld, byte index %ld", - error->line, error->column, error->byte_index); - - /* expat specific errors */ - switch(error->parser_code) { - case XML_ERROR_UNKNOWN_ENCODING: - code = xmlrpc_error_parse_unknown_encoding; - break; - case XML_ERROR_INCORRECT_ENCODING: - code = xmlrpc_error_parse_bad_encoding; - break; - default: - code = xmlrpc_error_parse_xml_syntax; - break; - } - xReturn = XMLRPC_UtilityCreateFault(code, buf); - } - return xReturn; -} - -/****f* SERIALIZE/XMLRPC_REQUEST_FromXML - * NAME - * XMLRPC_REQUEST_FromXML - * SYNOPSIS - * XMLRPC_REQUEST XMLRPC_REQUEST_FromXML(const char* in_buf, int le - * FUNCTION - * Retrieve XMLRPC_REQUEST from XML buffer - * INPUTS - * in_buf -- character buffer containing XML - * len -- length of buffer - * RESULT - * XMLRPC_REQUEST -- newly allocated data, or NULL if error. Should - * be free'd by caller. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_VALUE_FromXML () - * XMLRPC_REQUEST - * SOURCE - */ -XMLRPC_REQUEST XMLRPC_REQUEST_FromXML (const char *in_buf, int len, - XMLRPC_REQUEST_INPUT_OPTIONS in_options) { - XMLRPC_REQUEST request = XMLRPC_RequestNew(); - STRUCT_XML_ELEM_ERROR error = {0}; - - if(request) { - xml_element *root_elem = - xml_elem_parse_buf (in_buf, len, - (in_options ? &in_options->xml_elem_opts : NULL), - &error); - - if(root_elem) { - if(!strcmp(root_elem->name, "simpleRPC")) { - request->output.version = xmlrpc_version_simple; - xml_element_to_DANDARPC_REQUEST(request, root_elem); - } - else if (!strcmp (root_elem->name, "SOAP-ENV:Envelope")) { - request->output.version = xmlrpc_version_soap_1_1; - xml_element_to_SOAP_REQUEST (request, root_elem); - } - else { - request->output.version = xmlrpc_version_1_0; - xml_element_to_XMLRPC_REQUEST(request, root_elem); - } - xml_elem_free(root_elem); - } - else { - if(error.parser_error) { - XMLRPC_RequestSetError (request, map_expat_errors (&error)); - } - } - } - - return request; -} - -/*******/ - -/*-************************ -* End Serialization Funcs * -**************************/ - - - -/****f* VALUE/XMLRPC_CreateValueEmpty - * NAME - * XMLRPC_CreateValueEmpty - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueEmpty () - * FUNCTION - * Create an XML value to be used/modified elsewhere. - * INPUTS - * RESULT - * XMLRPC_VALUE. The new value, or NULL on failure. - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueEmpty() { - XMLRPC_VALUE v = calloc(1, sizeof(STRUCT_XMLRPC_VALUE)); - if(v) { -#ifdef XMLRPC_DEBUG_REFCOUNT - printf ("calloc'd 0x%x\n", v); -#endif - v->type = xmlrpc_empty; - simplestring_init(&v->id); - simplestring_init(&v->str); - } - return v; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueID_Case - * NAME - * XMLRPC_SetValueID_Case - * SYNOPSIS - * const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case) - * FUNCTION - * Assign an ID (key) to an XMLRPC value. - * INPUTS - * value The xml value who's ID we will set. - * id The desired new id. - * len length of id string if known, or 0 if unknown. - * id_case one of XMLRPC_CASE - * RESULT - * const char* pointer to the newly allocated id string, or NULL - * SEE ALSO - * XMLRPC_SetValueID () - * XMLRPC_GetValueID () - * XMLRPC_VALUE - * XMLRPC_CASE - * SOURCE - */ -const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case) { - const char* pRetval = NULL; - if(value) { - if(id) { - simplestring_clear(&value->id); - (len > 0) ? simplestring_addn(&value->id, id, len) : - simplestring_add(&value->id, id); - - /* upper or lower case string in place if required. could be a seperate func. */ - if(id_case == xmlrpc_case_lower || id_case == xmlrpc_case_upper) { - int i; - for(i = 0; i < value->id.len; i++) { - value->id.str[i] = - (id_case == - xmlrpc_case_lower) ? tolower (value->id. - str[i]) : toupper (value-> - id. - str[i]); - } - } - - pRetval = value->id.str; - -#ifdef XMLRPC_DEBUG_REFCOUNT - printf("set value id: %s\n", pRetval); -#endif - } - } - - return pRetval; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueString - * NAME - * XMLRPC_SetValueString - * SYNOPSIS - * const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* val, int len) - * FUNCTION - * Assign a string value to an XMLRPC_VALUE, and set it to type xmlrpc_string - * INPUTS - * value The xml value who's ID we will set. - * val The desired new string val. - * len length of val string if known, or 0 if unknown. - * RESULT - * const char* pointer to the newly allocated value string, or NULL - * SEE ALSO - * XMLRPC_GetValueString () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* val, int len) { - char *pRetval = NULL; - if(value && val) { - simplestring_clear(&value->str); - (len > 0) ? simplestring_addn(&value->str, val, len) : - simplestring_add(&value->str, val); - value->type = xmlrpc_string; - pRetval = (char *)value->str.str; - } - - return pRetval; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueInt - * NAME - * XMLRPC_SetValueInt - * SYNOPSIS - * void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val) - * FUNCTION - * Assign an int value to an XMLRPC_VALUE, and set it to type xmlrpc_int - * INPUTS - * value The xml value who's ID we will set. - * val The desired new integer value - * RESULT - * SEE ALSO - * XMLRPC_GetValueInt () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val) { - if(value) { - value->type = xmlrpc_int; - value->i = val; - } -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueBoolean - * NAME - * XMLRPC_SetValueBoolean - * SYNOPSIS - * void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val) - * FUNCTION - * Assign a boolean value to an XMLRPC_VALUE, and set it to type xmlrpc_boolean - * INPUTS - * value The xml value who's value we will set. - * val The desired new boolean value. [0 | 1] - * RESULT - * SEE ALSO - * XMLRPC_GetValueBoolean () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val) { - if(value) { - value->type = xmlrpc_boolean; - value->i = val ? 1 : 0; - } -} - -/*******/ - - -/****f* VECTOR/XMLRPC_SetIsVector - * NAME - * XMLRPC_SetIsVector - * SYNOPSIS - * int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type) - * FUNCTION - * Set the XMLRPC_VALUE to be a vector (list) type. The vector may be one of - * [xmlrpc_array | xmlrpc_struct | xmlrpc_mixed]. An array has only index values. - * A struct has key/val pairs. Mixed allows both index and key/val combinations. - * INPUTS - * value The xml value who's vector type we will set - * type New type of vector as enumerated by XMLRPC_VECTOR_TYPE - * RESULT - * int 1 if successful, 0 otherwise - * SEE ALSO - * XMLRPC_GetValueType () - * XMLRPC_GetVectorType () - * XMLRPC_VALUE - * XMLRPC_VECTOR_TYPE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type) { - int bSuccess = 0; - - if (value) { - /* we can change the type so long as nothing is currently stored. */ - if(value->type == xmlrpc_vector) { - if(value->v) { - if(!Q_Size(value->v->q)) { - value->v->type = type; - } - } - } - else { - value->v = calloc(1, sizeof(STRUCT_XMLRPC_VECTOR)); - if(value->v) { - value->v->q = (queue*)malloc(sizeof(queue)); - if(value->v->q) { - Q_Init(value->v->q); - value->v->type = type; - value->type = xmlrpc_vector; - bSuccess = 1; - } - } - } - } - - return bSuccess; -} - -/*******/ - -/****f* VECTOR/XMLRPC_CreateVector - * NAME - * XMLRPC_CreateVector - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type) - * FUNCTION - * Create a new vector and optionally set an id. - * INPUTS - * id The id of the vector, or NULL - * type New type of vector as enumerated by XMLRPC_VECTOR_TYPE - * RESULT - * XMLRPC_VALUE The new vector, or NULL on failure. - * SEE ALSO - * XMLRPC_CreateValueEmpty () - * XMLRPC_SetIsVector () - * XMLRPC_GetValueType () - * XMLRPC_GetVectorType () - * XMLRPC_VALUE - * XMLRPC_VECTOR_TYPE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type) { - XMLRPC_VALUE val = NULL; - - val = XMLRPC_CreateValueEmpty(); - if(val) { - if(XMLRPC_SetIsVector(val, type)) { - if(id) { - const char *pSVI = NULL; - - pSVI = XMLRPC_SetValueID(val, id, 0); - if(NULL == pSVI) { - val = NULL; - } - } - } - else { - val = NULL; - } - } - return val; -} - -/*******/ - - -/* Not yet implemented. - * - * This should use a hash to determine if a given target id has already - * been appended. - * - * Alternately, it could walk the entire vector, but that could be quite - * slow for very large lists. - */ -static int isDuplicateEntry(XMLRPC_VALUE target, XMLRPC_VALUE source) { - return 0; -} - -/****f* VECTOR/XMLRPC_AddValueToVector - * NAME - * XMLRPC_AddValueToVector - * SYNOPSIS - * int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source) - * FUNCTION - * Add (append) an existing XMLRPC_VALUE to a vector. - * INPUTS - * target The target vector - * source The source value to append - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_AddValuesToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * NOTES - * The function will fail and return 0 if an attempt is made to add - * a value with an ID into a vector of type xmlrpc_vector_array. Such - * values can only be added to xmlrpc_vector_struct. - * SOURCE - */ -int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source) { - if(target && source) { - if(target->type == xmlrpc_vector && target->v && - target->v->q && target->v->type != xmlrpc_vector_none) { - - /* guard against putting value of unknown type into vector */ - switch(source->type) { - case xmlrpc_empty: - case xmlrpc_base64: - case xmlrpc_boolean: - case xmlrpc_datetime: - case xmlrpc_double: - case xmlrpc_int: - case xmlrpc_string: - case xmlrpc_vector: - /* Guard against putting a key/val pair into an array vector */ - if( !(source->id.len && target->v->type == xmlrpc_vector_array) ) { - if (isDuplicateEntry (target, source) - || Q_PushTail (target->v->q, XMLRPC_CopyValue (source))) { - return 1; - } - } - else { - fprintf (stderr, - "xmlrpc: attempted to add key/val pair to vector of type array\n"); - } - break; - default: - fprintf (stderr, - "xmlrpc: attempted to add value of unknown type to vector\n"); - break; - } - } - } - return 0; -} - -/*******/ - - -/****f* VECTOR/XMLRPC_AddValuesToVector - * NAME - * XMLRPC_AddValuesToVector - * SYNOPSIS - * XMLRPC_AddValuesToVector ( target, val1, val2, val3, val(n), 0 ) - * XMLRPC_AddValuesToVector( XMLRPC_VALUE, ... ) - * FUNCTION - * Add (append) a series of existing XMLRPC_VALUE to a vector. - * INPUTS - * target The target vector - * ... The source value(s) to append. The last item *must* be 0. - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_AddValuesToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * NOTES - * This function may actually return failure after it has already modified - * or added items to target. You can not trust the state of target - * if this function returns failure. - * SOURCE - */ -int XMLRPC_AddValuesToVector(XMLRPC_VALUE target, ...) { - int iRetval = 0; - - if(target) { - if(target->type == xmlrpc_vector) { - XMLRPC_VALUE v = NULL; - va_list vl; - - va_start(vl, target); - - do { - v = va_arg(vl, XMLRPC_VALUE); - if(v) { - if(!XMLRPC_AddValueToVector(target, v)) { - iRetval = 0; - break; - } - } - } - while (v); - - va_end(vl); - - if(NULL == v) { - iRetval = 1; - } - } - } - return iRetval; -} - -/*******/ - - -/****f* VECTOR/XMLRPC_VectorGetValueWithID_Case - * NAME - * XMLRPC_VectorGetValueWithID_Case - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case(XMLRPC_VALUE vector, const char* id, XMLRPC_CASE_COMPARISON id_case) - * FUNCTION - * Get value from vector matching id (key) - * INPUTS - * vector The source vector - * id The key to find - * id_case Rule for how to match key - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_SetValueID_Case () - * XMLRPC_VALUE - * XMLRPC_CASE_COMPARISON - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case (XMLRPC_VALUE vector, const char *id, - XMLRPC_CASE_COMPARISON id_case) { - if(vector && vector->v && vector->v->q) { - q_iter qi = Q_Iter_Head_F(vector->v->q); - - while(qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F(qi); - if(xIter && xIter->id.str) { - if(id_case == xmlrpc_case_sensitive) { - if(!strcmp(xIter->id.str, id)) { - return xIter; - } - } - else if(id_case == xmlrpc_case_insensitive) { - if(!strcasecmp(xIter->id.str, id)) { - return xIter; - } - } - } - qi = Q_Iter_Next_F(qi); - } - } - return NULL; -} - -/*******/ - - -int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value) { - if(vector && vector->v && vector->v->q && value) { - q_iter qi = Q_Iter_Head_F(vector->v->q); - - while(qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F(qi); - if(xIter == value) { - XMLRPC_CleanupValue(xIter); - Q_Iter_Del(vector->v->q, qi); - return 1; - } - qi = Q_Iter_Next_F(qi); - } - } - return 0; -} - - -/****f* VALUE/XMLRPC_CreateValueString - * NAME - * XMLRPC_CreateValueString - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* val, int len) - * FUNCTION - * Create an XMLRPC_VALUE, and assign a string to it - * INPUTS - * id The id of the value, or NULL - * val The desired new string val. - * len length of val string if known, or 0 if unknown. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueString () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* val, int len) { - XMLRPC_VALUE value = NULL; - if(val) { - value = XMLRPC_CreateValueEmpty(); - if(value) { - XMLRPC_SetValueString(value, val, len); - if(id) { - XMLRPC_SetValueID(value, id, 0); - } - } - } - return value; -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueInt - * NAME - * XMLRPC_CreateValueInt - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i) - * FUNCTION - * Create an XMLRPC_VALUE, and assign an int to it - * INPUTS - * id The id of the value, or NULL - * i The desired new int val. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueInt () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueInt(val, i); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueBoolean - * NAME - * XMLRPC_CreateValueBoolean - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int i) - * FUNCTION - * Create an XMLRPC_VALUE, and assign an int to it - * INPUTS - * id The id of the value, or NULL - * i The desired new int val. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueBoolean () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int i) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueBoolean(val, i); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_CleanupValue - * NAME - * XMLRPC_CleanupValue - * SYNOPSIS - * void XMLRPC_CleanupValue(XMLRPC_VALUE value) - * FUNCTION - * Frees all memory allocated for an XMLRPC_VALUE and any of its children (if a vector) - * INPUTS - * value The id of the value to be cleaned up. - * RESULT - * void - * NOTES - * Normally this function will be called for the topmost vector, thus free-ing - * all children. If a child of a vector is free'd first, results are undefined. - * Failure to call this function *will* cause memory leaks. - * - * Also, this function is implemented using reference counting. Thus a value - * may be added and freed from multiple parents so long as a reference is added - * first using XMLRPC_CopyValue() - * SEE ALSO - * XMLRPC_RequestFree () - * XMLRPC_CreateValueEmpty () - * XMLRPC_CopyValue() - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_CleanupValue(XMLRPC_VALUE value) { - if(value) { - if(value->iRefCount > 0) { - value->iRefCount --; - } - -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf ("decremented refcount of %s, now %i\n", value->id.str, - value->iRefCount); - } - else { - printf ("decremented refcount of 0x%x, now %i\n", value, - value->iRefCount); - } -#endif - - if(value->type == xmlrpc_vector) { - if(value->v) { - if(value->iRefCount == 0) { - XMLRPC_VALUE cur = (XMLRPC_VALUE)Q_Head(value->v->q); - while( cur ) { - XMLRPC_CleanupValue(cur); - - /* Make sure some idiot didn't include a vector as a child of itself - * and thus it would have already free'd these. - */ - if(value->v && value->v->q) { - cur = Q_Next(value->v->q); - } - else { - break; - } - } - - Q_Destroy(value->v->q); - my_free(value->v->q); - my_free(value->v); - } - } - } - - - if(value->iRefCount == 0) { - - /* guard against freeing invalid types */ - switch(value->type) { - case xmlrpc_empty: - case xmlrpc_base64: - case xmlrpc_boolean: - case xmlrpc_datetime: - case xmlrpc_double: - case xmlrpc_int: - case xmlrpc_string: - case xmlrpc_vector: -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf("free'd %s\n", value->id.str); - } - else { - printf("free'd 0x%x\n", value); - } -#endif - simplestring_free(&value->id); - simplestring_free(&value->str); - - memset(value, 0, sizeof(STRUCT_XMLRPC_VALUE)); - my_free(value); - break; - default: - fprintf (stderr, - "xmlrpc: attempted to free value of invalid type\n"); - break; - } - } - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueDateTime - * NAME - * XMLRPC_SetValueDateTime - * SYNOPSIS - * void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time) - * FUNCTION - * Assign time value to XMLRPC_VALUE - * INPUTS - * value The target XMLRPC_VALUE - * time The desired new unix time value (time_t) - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDateTime () - * XMLRPC_SetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time) { - if(value) { - char timeBuf[30]; - value->type = xmlrpc_datetime; - value->i = time; - - timeBuf[0] = 0; - - date_to_ISO8601(time, timeBuf, sizeof(timeBuf)); - - if(timeBuf[0]) { - simplestring_clear(&value->str); - simplestring_add(&value->str, timeBuf); - } - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CopyValue - * NAME - * XMLRPC_CopyValue - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) - * FUNCTION - * Make a copy (reference) of an XMLRPC_VALUE - * INPUTS - * value The target XMLRPC_VALUE - * RESULT - * XMLRPC_VALUE -- address of the copy - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_DupValueNew () - * NOTES - * This function is implemented via reference counting, so the - * returned value is going to be the same as the passed in value. - * The value must be freed the same number of times it is copied - * or there will be a memory leak. - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) { - if(value) { - value->iRefCount ++; -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf ("incremented refcount of %s, now %i\n", value->id.str, - value->iRefCount); - } - else { - printf ("incremented refcount of 0x%x, now %i\n", value, - value->iRefCount); - } -#endif - } - return value; -} - -/*******/ - - -/****f* VALUE/XMLRPC_DupValueNew - * NAME - * XMLRPC_DupValueNew - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_DupValueNew(XMLRPC_VALUE value) - * FUNCTION - * Make a duplicate (non reference) of an XMLRPC_VALUE with newly allocated mem. - * INPUTS - * value The source XMLRPC_VALUE to duplicate - * RESULT - * XMLRPC_VALUE -- address of the duplicate value - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_CopyValue () - * NOTES - * Use this when function when you need to modify the contents of - * the copied value seperately from the original. - * - * this function is recursive, thus the value and all of its children - * (if any) will be duplicated. - * SOURCE - */ -XMLRPC_VALUE XMLRPC_DupValueNew (XMLRPC_VALUE xSource) { - XMLRPC_VALUE xReturn = NULL; - if (xSource) { - xReturn = XMLRPC_CreateValueEmpty (); - if (xSource->id.len) { - XMLRPC_SetValueID (xReturn, xSource->id.str, xSource->id.len); - } - - switch (xSource->type) { - case xmlrpc_int: - case xmlrpc_boolean: - XMLRPC_SetValueInt (xReturn, xSource->i); - break; - case xmlrpc_string: - case xmlrpc_base64: - XMLRPC_SetValueString (xReturn, xSource->str.str, xSource->str.len); - break; - case xmlrpc_datetime: - XMLRPC_SetValueDateTime (xReturn, xSource->i); - break; - case xmlrpc_double: - XMLRPC_SetValueDouble (xReturn, xSource->d); - break; - case xmlrpc_vector: - { - q_iter qi = Q_Iter_Head_F (xSource->v->q); - XMLRPC_SetIsVector (xReturn, xSource->v->type); - - while (qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F (qi); - XMLRPC_AddValueToVector (xReturn, XMLRPC_DupValueNew (xIter)); - qi = Q_Iter_Next_F (qi); - } - } - break; - default: - break; - } - } - return xReturn; -} - -/*******/ - - - -/****f* VALUE/XMLRPC_CreateValueDateTime - * NAME - * XMLRPC_CreateValueDateTime - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) - * FUNCTION - * Create new datetime value from time_t - * INPUTS - * id id of the new value, or NULL - * time The desired unix time value (time_t) - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDateTime () - * XMLRPC_SetValueDateTime () - * XMLRPC_CreateValueDateTime_ISO8601 () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDateTime(val, time); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueDateTime_ISO8601 - * NAME - * XMLRPC_SetValueDateTime_ISO8601 - * SYNOPSIS - * void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s) - * FUNCTION - * Set datetime value from IS08601 encoded string - * INPUTS - * value The target XMLRPC_VALUE - * s The desired new time value - * RESULT - * void - * BUGS - * This function currently attempts to convert the time string to a valid unix time - * value before passing it. Behavior when the string is invalid or out of range - * is not well defined, but will probably result in Jan 1, 1970 (0) being passed. - * SEE ALSO - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s) { - if(value) { - time_t time_val = 0; - if(s) { - date_from_ISO8601(s, &time_val); - XMLRPC_SetValueDateTime(value, time_val); - } - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueDateTime_ISO8601 - * NAME - * XMLRPC_CreateValueDateTime_ISO8601 - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) - * FUNCTION - * Create datetime value from IS08601 encoded string - * INPUTS - * id The id of the new value, or NULL - * s The desired new time value - * RESULT - * newly allocated XMLRPC_VALUE, or NULL if no value created. - * BUGS - * See XMLRPC_SetValueDateTime_ISO8601 () - * SEE ALSO - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_SetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDateTime_ISO8601(val, s); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueBase64 - * NAME - * XMLRPC_SetValueBase64 - * SYNOPSIS - * void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len) - * FUNCTION - * Set base64 value. Base64 is useful for transferring binary data, such as an image. - * INPUTS - * value The target XMLRPC_VALUE - * s The desired new binary value - * len The length of s, or NULL. If buffer is not null terminated, len *must* be passed. - * RESULT - * void - * NOTES - * Data is set/stored/retrieved as passed in, but is base64 encoded for XML transfer, and - * decoded on the other side. This is transparent to the caller. - * SEE ALSO - * XMLRPC_GetValueBase64 () - * XMLRPC_CreateValueBase64 () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len) { - if(value && s) { - simplestring_clear(&value->str); - (len > 0) ? simplestring_addn(&value->str, s, len) : - simplestring_add(&value->str, s); - value->type = xmlrpc_base64; - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_CreateValueBase64 - * NAME - * XMLRPC_CreateValueBase64 - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) - * FUNCTION - * Create base64 value. Base64 is useful for transferring binary data, such as an image. - * INPUTS - * id id of the new value, or NULL - * s The desired new binary value - * len The length of s, or NULL. If buffer is not null terminated, len *must* be passed. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL if error - * NOTES - * See XMLRPC_SetValueBase64 () - * SEE ALSO - * XMLRPC_GetValueBase64 () - * XMLRPC_SetValueBase64 () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueBase64(val, s, len); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueDouble - * NAME - * XMLRPC_SetValueDouble - * SYNOPSIS - * void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val) - * FUNCTION - * Set double (floating point) value. - * INPUTS - * value The target XMLRPC_VALUE - * val The desired new double value - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDouble () - * XMLRPC_CreateValueDouble () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val) { - if(value) { - value->type = xmlrpc_double; - value->d = val; - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueDouble - * NAME - * XMLRPC_CreateValueDouble - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) - * FUNCTION - * Create double (floating point) value. - * INPUTS - * id id of the newly created value, or NULL - * d The desired new double value - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDouble () - * XMLRPC_CreateValueDouble () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDouble(val, d); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueString - * NAME - * XMLRPC_GetValueString - * SYNOPSIS - * const char* XMLRPC_GetValueString(XMLRPC_VALUE value) - * FUNCTION - * retrieve string value - * INPUTS - * value source XMLRPC_VALUE of type xmlrpc_string - * RESULT - * void - * SEE ALSO - * XMLRPC_SetValueString () - * XMLRPC_GetValueType () - * XMLRPC_VALUE - * SOURCE - */ -const char* XMLRPC_GetValueString(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_string) ? value->str.str : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueStringLen - * NAME - * XMLRPC_GetValueStringLen - * SYNOPSIS - * int XMLRPC_GetValueStringLen(XMLRPC_VALUE value) - * FUNCTION - * determine length of string value - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_string - * RESULT - * length of string, or 0 - * NOTES - * SEE ALSO - * XMLRPC_SetValueString () - * XMLRPC_GetValueString () - * SOURCE - */ -int XMLRPC_GetValueStringLen(XMLRPC_VALUE value) { - return ((value) ? value->str.len : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueInt - * NAME - * XMLRPC_GetValueInt - * SYNOPSIS - * int XMLRPC_GetValueInt(XMLRPC_VALUE value) - * FUNCTION - * retrieve integer value. - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_int - * RESULT - * integer value or 0 if value is not valid int - * NOTES - * use XMLRPC_GetValueType () to be sure if 0 is real return value or not - * SEE ALSO - * XMLRPC_SetValueInt () - * XMLRPC_CreateValueInt () - * SOURCE - */ -int XMLRPC_GetValueInt(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_int) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueBoolean - * NAME - * XMLRPC_GetValueBoolean - * SYNOPSIS - * int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) - * FUNCTION - * retrieve boolean value. - * INPUTS - * XMLRPC_VALUE of type xmlrpc_boolean - * RESULT - * boolean value or 0 if value is not valid boolean - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueBoolean () - * XMLRPC_CreateValueBoolean () - * SOURCE - */ -int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_boolean) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDouble - * NAME - * XMLRPC_GetValueDouble - * SYNOPSIS - * double XMLRPC_GetValueDouble(XMLRPC_VALUE value) - * FUNCTION - * retrieve double value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_double - * RESULT - * double value or 0 if value is not valid double. - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueDouble () - * XMLRPC_CreateValueDouble () - * SOURCE - */ -double XMLRPC_GetValueDouble(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_double) ? value->d : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueBase64 - * NAME - * XMLRPC_GetValueBase64 - * SYNOPSIS - * const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) - * FUNCTION - * retrieve binary value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_base64 - * RESULT - * pointer to binary value or 0 if value is not valid. - * SEE ALSO - * XMLRPC_SetValueBase64 () - * XMLRPC_CreateValueBase64 () - * NOTES - * Call XMLRPC_GetValueStringLen() to retrieve real length of binary data. strlen() - * will not be accurate, as returned data may contain embedded nulls. - * SOURCE - */ -const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_base64) ? value->str.str : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDateTime - * NAME - * XMLRPC_GetValueDateTime - * SYNOPSIS - * time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) - * FUNCTION - * retrieve time_t value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_datetime - * RESULT - * time_t value or 0 if value is not valid datetime. - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueDateTime () - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * SOURCE - */ -time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) { - return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDateTime_IOS8601 - * NAME - * XMLRPC_GetValueDateTime_IOS8601 - * SYNOPSIS - * const char* XMLRPC_GetValueDateTime_IOS8601(XMLRPC_VALUE value) - * FUNCTION - * retrieve ISO8601 formatted time value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_datetime - * RESULT - * const char* value or 0 if value is not valid datetime. - * SEE ALSO - * XMLRPC_SetValueDateTime_IOS8601 () - * XMLRPC_GetValueDateTime () - * XMLRPC_CreateValueDateTime_IOS8601 () - * SOURCE - */ -const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_datetime) ? value->str.str : 0); -} - -/*******/ - -/* Get ID (key) of value or NULL */ -/****f* VALUE/XMLRPC_GetValueID - * NAME - * XMLRPC_GetValueID - * SYNOPSIS - * const char* XMLRPC_GetValueID(XMLRPC_VALUE value) - * FUNCTION - * retrieve id (key) of value - * INPUTS - * XMLRPC_VALUE of any type - * RESULT - * const char* pointer to id of value, or NULL - * NOTES - * SEE ALSO - * XMLRPC_SetValueID() - * XMLRPC_CreateValueEmpty() - * SOURCE - */ -const char* XMLRPC_GetValueID(XMLRPC_VALUE value) { - return (const char*)((value && value->id.len) ? value->id.str : 0); -} - -/*******/ - - -/****f* VECTOR/XMLRPC_VectorSize - * NAME - * XMLRPC_VectorSize - * SYNOPSIS - * int XMLRPC_VectorSize(XMLRPC_VALUE value) - * FUNCTION - * retrieve size of vector - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * count of items in vector - * NOTES - * This is a cheap operation even on large vectors. Vector size is - * maintained by queue during add/remove ops. - * SEE ALSO - * XMLRPC_AddValueToVector () - * SOURCE - */ -int XMLRPC_VectorSize(XMLRPC_VALUE value) { - int size = 0; - if(value && value->type == xmlrpc_vector && value->v) { - size = Q_Size(value->v->q); - } - return size; -} - -/*******/ - -/****f* VECTOR/XMLRPC_VectorRewind - * NAME - * XMLRPC_VectorRewind - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value) - * FUNCTION - * reset vector to first item - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * first XMLRPC_VALUE in list, or NULL if empty or error. - * NOTES - * Be careful to rewind any vector passed in to you if you expect to - * iterate through the entire list. - * SEE ALSO - * XMLRPC_VectorNext () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value) { - XMLRPC_VALUE xReturn = NULL; - if(value && value->type == xmlrpc_vector && value->v) { - xReturn = (XMLRPC_VALUE)Q_Head(value->v->q); - } - return xReturn; -} - -/*******/ - -/****f* VECTOR/XMLRPC_VectorNext - * NAME - * XMLRPC_VectorNext - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value) - * FUNCTION - * Iterate vector to next item in list. - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * Next XMLRPC_VALUE in vector, or NULL if at end. - * NOTES - * SEE ALSO - * XMLRPC_VectorRewind () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value) { - XMLRPC_VALUE xReturn = NULL; - if(value && value->type == xmlrpc_vector && value->v) { - xReturn = (XMLRPC_VALUE)Q_Next(value->v->q); - } - return xReturn; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueType - * NAME - * XMLRPC_GetValueType - * SYNOPSIS - * XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) - * FUNCTION - * determine data type of the XMLRPC_VALUE - * INPUTS - * XMLRPC_VALUE target of query - * RESULT - * data type of value as enumerated by XMLRPC_VALUE_TYPE - * NOTES - * all values are of type xmlrpc_empty until set. - * Deprecated for public use. See XMLRPC_GetValueTypeEasy - * SEE ALSO - * XMLRPC_SetValue* - * XMLRPC_CreateValue* - * XMLRPC_Append* - * XMLRPC_GetValueTypeEasy () - * SOURCE - */ -XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) { - return value ? value->type : xmlrpc_empty; -} - -/*******/ - -/* Vector type accessor */ -/****f* VALUE/XMLRPC_GetVectorType - * NAME - * XMLRPC_GetVectorType - * SYNOPSIS - * XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) - * FUNCTION - * determine vector type of the XMLRPC_VALUE - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * vector type of value as enumerated by XMLRPC_VECTOR_TYPE. - * xmlrpc_none if not a value. - * NOTES - * xmlrpc_none is returned if value is not a vector - * Deprecated for public use. See XMLRPC_GetValueTypeEasy - * SEE ALSO - * XMLRPC_SetIsVector () - * XMLRPC_GetValueType () - * XMLRPC_GetValueTypeEasy () - * SOURCE - */ -XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) { - return(value && value->v) ? value->v->type : xmlrpc_none; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueTypeEasy - * NAME - * XMLRPC_GetValueTypeEasy - * SYNOPSIS - * XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy(XMLRPC_VALUE value) - * FUNCTION - * determine data type of the XMLRPC_VALUE. includes vector types. - * INPUTS - * XMLRPC_VALUE target of query - * RESULT - * data type of value as enumerated by XMLRPC_VALUE_TYPE_EASY - * xmlrpc_type_none if not a value. - * NOTES - * all values are of type xmlrpc_type_empty until set. - * SEE ALSO - * XMLRPC_SetValue* - * XMLRPC_CreateValue* - * XMLRPC_Append* - * SOURCE - */ -XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy (XMLRPC_VALUE value) { - if (value) { - switch (value->type) { - case xmlrpc_vector: - switch (value->v->type) { - case xmlrpc_vector_none: - return xmlrpc_type_none; - case xmlrpc_vector_struct: - return xmlrpc_type_struct; - case xmlrpc_vector_mixed: - return xmlrpc_type_mixed; - case xmlrpc_vector_array: - return xmlrpc_type_array; - } - default: - /* evil cast, but we know they are the same */ - return(XMLRPC_VALUE_TYPE_EASY) value->type; - } - } - return xmlrpc_none; -} - -/*******/ - - - -/*-******************* -* Begin Server Funcs * -*********************/ - - -/****f* VALUE/XMLRPC_ServerCreate - * NAME - * XMLRPC_ServerCreate - * SYNOPSIS - * XMLRPC_SERVER XMLRPC_ServerCreate() - * FUNCTION - * Allocate/Init XMLRPC Server Resources. - * INPUTS - * none - * RESULT - * newly allocated XMLRPC_SERVER - * NOTES - * SEE ALSO - * XMLRPC_ServerDestroy () - * XMLRPC_GetGlobalServer () - * SOURCE - */ -XMLRPC_SERVER XMLRPC_ServerCreate() { - XMLRPC_SERVER server = calloc(1, sizeof(STRUCT_XMLRPC_SERVER)); - if(server) { - Q_Init(&server->methodlist); - Q_Init(&server->docslist); - - /* register system methods */ - xsm_register(server); - } - return server; -} - -/*******/ - -/* Return global server. Not locking! Not Thread Safe! */ -/****f* VALUE/XMLRPC_GetGlobalServer - * NAME - * XMLRPC_GetGlobalServer - * SYNOPSIS - * XMLRPC_SERVER XMLRPC_GetGlobalServer() - * FUNCTION - * Allocates a global (process-wide) server, or returns pointer if pre-existing. - * INPUTS - * none - * RESULT - * pointer to global server, or 0 if error. - * NOTES - * ***WARNING*** This function is not thread safe. It is included only for the very lazy. - * Multi-threaded programs that use this may experience problems. - * BUGS - * There is currently no way to cleanup the global server gracefully. - * SEE ALSO - * XMLRPC_ServerCreate () - * SOURCE - */ -XMLRPC_SERVER XMLRPC_GetGlobalServer() { - static XMLRPC_SERVER xsServer = 0; - if(!xsServer) { - xsServer = XMLRPC_ServerCreate(); - } - return xsServer; -} - -/*******/ - -/****f* VALUE/XMLRPC_ServerDestroy - * NAME - * XMLRPC_ServerDestroy - * SYNOPSIS - * void XMLRPC_ServerDestroy(XMLRPC_SERVER server) - * FUNCTION - * Free Server Resources - * INPUTS - * server The server to be free'd - * RESULT - * void - * NOTES - * This frees the server struct and any methods that have been added. - * SEE ALSO - * XMLRPC_ServerCreate () - * SOURCE - */ -void XMLRPC_ServerDestroy(XMLRPC_SERVER server) { - if(server) { - doc_method* dm = Q_Head(&server->docslist); - server_method* sm = Q_Head(&server->methodlist); - while( dm ) { - my_free(dm); - dm = Q_Next(&server->docslist); - } - while( sm ) { - if(sm->name) { - my_free(sm->name); - } - if(sm->desc) { - XMLRPC_CleanupValue(sm->desc); - } - my_free(sm); - sm = Q_Next(&server->methodlist); - } - if(server->xIntrospection) { - XMLRPC_CleanupValue(server->xIntrospection); - } - - Q_Destroy(&server->methodlist); - Q_Destroy(&server->docslist); - my_free(server); - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_ServerRegisterMethod - * NAME - * XMLRPC_ServerRegisterMethod - * SYNOPSIS - * void XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb) - * FUNCTION - * Register new XMLRPC method with server - * INPUTS - * server The XMLRPC_SERVER to register the method with - * name public name of the method - * cb C function that implements the method - * RESULT - * int - 1 if success, else 0 - * NOTES - * A C function must be registered for every "method" that the server recognizes. The - * method name is equivalent to method name in the - * XML syntax. - * SEE ALSO - * XMLRPC_ServerFindMethod () - * XMLRPC_ServerCallMethod () - * SOURCE - */ -int XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb) { - if(server && name && cb) { - - server_method* sm = malloc(sizeof(server_method)); - - if(sm) { - sm->name = strdup(name); - sm->method = cb; - sm->desc = NULL; - - return Q_PushTail(&server->methodlist, sm); - } - } - return 0; -} - -/*******/ - -server_method* find_method(XMLRPC_SERVER server, const char* name) { - server_method* sm; - - q_iter qi = Q_Iter_Head_F(&server->methodlist); - - while( qi ) { - sm = Q_Iter_Get_F(qi); - if(sm && !strcmp(sm->name, name)) { - return sm; - } - qi = Q_Iter_Next_F(qi); - } - return NULL; -} - - -const char* type_to_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype) { - switch(type) { - case xmlrpc_none: - return "none"; - case xmlrpc_empty: - return "empty"; - case xmlrpc_base64: - return "base64"; - case xmlrpc_boolean: - return "boolean"; - case xmlrpc_datetime: - return "datetime"; - case xmlrpc_double: - return "double"; - case xmlrpc_int: - return "int"; - case xmlrpc_string: - return "string"; - case xmlrpc_vector: - switch(vtype) { - case xmlrpc_vector_none: - return "none"; - case xmlrpc_vector_array: - return "array"; - case xmlrpc_vector_mixed: - return "mixed vector (struct)"; - case xmlrpc_vector_struct: - return "struct"; - } - } - return "unknown"; -} - -/****f* VALUE/XMLRPC_ServerFindMethod - * NAME - * XMLRPC_ServerFindMethod - * SYNOPSIS - * XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName) - * FUNCTION - * retrieve C callback associated with a given method name. - * INPUTS - * server The XMLRPC_SERVER the method is registered with - * callName the method to find - * RESULT - * previously registered XMLRPC_Callback, or NULL - * NOTES - * Typically, this is used to determine if a requested method exists, without actually calling it. - * SEE ALSO - * XMLRPC_ServerCallMethod () - * XMLRPC_ServerRegisterMethod () - * SOURCE - */ -XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName) { - if(server && callName) { - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm && !strcmp(sm->name, callName)) { - return sm->method; - } - qi = Q_Iter_Next_F(qi); - } - } - return NULL; -} - -/*******/ - - -/* Call method specified in request */ -/****f* VALUE/XMLRPC_ServerCallMethod - * NAME - * XMLRPC_ServerCallMethod - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData) - * FUNCTION - * - * INPUTS - * server The XMLRPC_SERVER the method is registered with - * request the request to handle - * userData any additional data to pass to the C callback, or NULL - * RESULT - * XMLRPC_VALUE allocated by the callback, or NULL - * NOTES - * It is typically the caller's responsibility to free the returned value. - * - * Often the caller will want to serialize the result as XML, via - * XMLRPC_VALUE_To_XML () or XMLRPC_REQUEST_To_XML () - * SEE ALSO - * XMLRPC_ServerFindMethod () - * XMLRPC_ServerRegisterMethod () - * XMLRPC_CleanupValue () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData) { - XMLRPC_VALUE xReturn = NULL; - - /* check for error set during request parsing / generation */ - if(request && request->error) { - xReturn = XMLRPC_CopyValue(request->error); - } - else if (server && request) { - XMLRPC_Callback cb = - XMLRPC_ServerFindMethod (server, request->methodName.str); - if(cb) { - xReturn = cb(server, request, userData); - } - else { - xReturn = - XMLRPC_UtilityCreateFault (xmlrpc_error_unknown_method, - request->methodName.str); - } - } - return xReturn; -} - -/*******/ - -/*-***************** -* End server funcs * -*******************/ - - -/*-*********************************** -* Begin XMLRPC General Options funcs * -*************************************/ - -/* For options used by XMLRPC_VALUE funcs that otherwise do not have - * parameters for options. Kind of gross. :( - */ -typedef struct _xmlrpc_options { - XMLRPC_CASE id_case; - XMLRPC_CASE_COMPARISON id_case_compare; -} -STRUCT_XMLRPC_OPTIONS, *XMLRPC_OPTIONS; - -static XMLRPC_OPTIONS XMLRPC_GetDefaultOptions() { - static STRUCT_XMLRPC_OPTIONS options = { - xmlrpc_case_exact, - xmlrpc_case_sensitive - }; - return &options; -} - -/****f* VALUE/XMLRPC_GetDefaultIdCase - * NAME - * XMLRPC_GetDefaultIdCase - * SYNOPSIS - * XMLRPC_CASE XMLRPC_GetDefaultIdCase() - * FUNCTION - * Gets default case options used by XMLRPC_VALUE funcs - * INPUTS - * none - * RESULT - * XMLRPC_CASE - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_SetDefaultIdCase () - * SOURCE - */ -XMLRPC_CASE XMLRPC_GetDefaultIdCase() { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - return options->id_case; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetDefaultIdCase - * NAME - * XMLRPC_SetDefaultIdCase - * SYNOPSIS - * XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case) - * FUNCTION - * Sets default case options used by XMLRPC_VALUE funcs - * INPUTS - * id_case case options as enumerated by XMLRPC_CASE - * RESULT - * XMLRPC_CASE -- newly set option - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_GetDefaultIdCase () - * SOURCE - */ -XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case) { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - options->id_case = id_case; - return options->id_case; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetDefaultIdCaseComparison - * NAME - * XMLRPC_GetDefaultIdCaseComparison - * SYNOPSIS - * XMLRPC_CASE XMLRPC_GetDefaultIdCaseComparison( ) - * FUNCTION - * Gets default case comparison options used by XMLRPC_VALUE funcs - * INPUTS - * none - * RESULT - * XMLRPC_CASE_COMPARISON default - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_SetDefaultIdCaseComparison () - * SOURCE - */ -XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison() { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - return options->id_case_compare; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetDefaultIdCaseComparison - * NAME - * XMLRPC_SetDefaultIdCaseComparison - * SYNOPSIS - * XMLRPC_CASE XMLRPC_SetDefaultIdCaseComparison( XMLRPC_CASE_COMPARISON id_case_compare ) - * FUNCTION - * Gets default case comparison options used by XMLRPC_VALUE funcs - * INPUTS - * id_case_compare case comparison rule to set as default - * RESULT - * XMLRPC_CASE_COMPARISON newly set default - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_GetDefaultIdCaseComparison () - * SOURCE - */ -XMLRPC_CASE_COMPARISON XMLRPC_SetDefaultIdCaseComparison(XMLRPC_CASE_COMPARISON id_case_compare) { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - options->id_case_compare = id_case_compare; - return options->id_case_compare; -} - -/*******/ - -/*-********************************* -* End XMLRPC General Options funcs * -***********************************/ - - -/*-****************** -* Fault API funcs * -********************/ - -/****f* UTILITY/XMLRPC_UtilityCreateFault - * NAME - * XMLRPC_UtilityCreateFault - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_UtilityCreateFault( int fault_code, const char* fault_string ) - * FUNCTION - * generates a struct containing a string member with id "faultString" and an int member - * with id "faultCode". When using the xmlrpc xml serialization, these will be translated - * to ... format. - * INPUTS - * fault_code application specific error code. can be 0. - * fault_string application specific error string. cannot be null. - * RESULT - * XMLRPC_VALUE a newly created struct vector representing the error, or null on error. - * NOTES - * This is a utility function. xmlrpc "faults" are not directly represented in this xmlrpc - * API or data structures. It is the author's view, that this API is intended for simple - * data types, and a "fault" is a complex data type consisting of multiple simple data - * types. This function is provided for convenience only, the same result could be - * achieved directly by the application. - * - * This function now supports some "standardized" fault codes, as specified at. - * http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php. - * If one of these fault codes is received, the description string will automatically - * be prefixed with a standard error string and 2 newlines. - * - * The actual transformation between this complex type and the xml "" element takes - * place in the xmlrpc to xml serialization layer. This step is not performed when using the - * simplerpc serialization, meaning that there will be no "" element in that - * serialization. There will simply be a standard struct with 2 child elements. - * imho, the "" element is unnecessary and/or out of place as part of the standard API. - * - * SOURCE - */ -XMLRPC_VALUE XMLRPC_UtilityCreateFault(int fault_code, const char* fault_string) { - XMLRPC_VALUE xOutput = NULL; - - char* string = NULL; - simplestring description; - simplestring_init(&description); - - switch (fault_code) { - case xmlrpc_error_parse_xml_syntax: - string = xmlrpc_error_parse_xml_syntax_str; - break; - case xmlrpc_error_parse_unknown_encoding: - string = xmlrpc_error_parse_unknown_encoding_str; - break; - case xmlrpc_error_parse_bad_encoding: - string = xmlrpc_error_parse_bad_encoding_str; - break; - case xmlrpc_error_invalid_xmlrpc: - string = xmlrpc_error_invalid_xmlrpc_str; - break; - case xmlrpc_error_unknown_method: - string = xmlrpc_error_unknown_method_str; - break; - case xmlrpc_error_invalid_params: - string = xmlrpc_error_invalid_params_str; - break; - case xmlrpc_error_internal_server: - string = xmlrpc_error_internal_server_str; - break; - case xmlrpc_error_application: - string = xmlrpc_error_application_str; - break; - case xmlrpc_error_system: - string = xmlrpc_error_system_str; - break; - case xmlrpc_error_transport: - string = xmlrpc_error_transport_str; - break; - } - - simplestring_add(&description, string); - - if(string && fault_string) { - simplestring_add(&description, "\n\n"); - } - simplestring_add(&description, fault_string); - - - if(description.len) { - xOutput = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - - XMLRPC_VectorAppendString (xOutput, "faultString", description.str, - description.len); - XMLRPC_VectorAppendInt(xOutput, "faultCode", fault_code); - } - - simplestring_free(&description); - - return xOutput; -} - -/*******/ - - -/****f* FAULT/XMLRPC_ValueIsFault - * NAME - * XMLRPC_ValueIsFault - * SYNOPSIS - * int XMLRPC_ValueIsFault (XMLRPC_VALUE value) - * FUNCTION - * Determines if a value encapsulates a fault "object" - * INPUTS - * value any XMLRPC_VALUE - * RESULT - * 1 if it is a fault, else 0 - * SEE ALSO - * XMLRPC_ResponseIsFault () - * SOURCE - */ -int XMLRPC_ValueIsFault (XMLRPC_VALUE value) { - if( XMLRPC_VectorGetValueWithID(value, "faultCode") && - XMLRPC_VectorGetValueWithID(value, "faultString") ) { - return 1; - } - return 0; -} -/*******/ - - -/****f* FAULT/XMLRPC_ResponseIsFault - * NAME - * XMLRPC_ResponseIsFault - * SYNOPSIS - * int XMLRPC_ResponseIsFault (XMLRPC_REQUEST response) - * FUNCTION - * Determines if a response contains an encapsulated fault "object" - * INPUTS - * value any XMLRPC_REQUEST. typically of type xmlrpc_request_response - * RESULT - * 1 if it contains a fault, else 0 - * SEE ALSO - * XMLRPC_ValueIsFault () - * SOURCE - */ -int XMLRPC_ResponseIsFault(XMLRPC_REQUEST response) { - return XMLRPC_ValueIsFault( XMLRPC_RequestGetData(response) ); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetValueFaultCode - * NAME - * XMLRPC_GetValueFaultCode - * SYNOPSIS - * int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value) - * FUNCTION - * returns fault code from a struct, if any - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_vector_struct. - * RESULT - * fault code, else 0. - * BUGS - * impossible to distinguish faultCode == 0 from faultCode not present. - * SEE ALSO - * XMLRPC_GetResponseFaultCode () - * SOURCE - */ -int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value) { - return XMLRPC_VectorGetIntWithID(value, "faultCode"); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetResponseFaultCode - * NAME - * XMLRPC_GetResponseFaultCode - * SYNOPSIS - * int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) - * FUNCTION - * returns fault code from a response, if any - * INPUTS - * response XMLRPC_REQUEST. typically of type xmlrpc_request_response. - * RESULT - * fault code, else 0. - * BUGS - * impossible to distinguish faultCode == 0 from faultCode not present. - * SEE ALSO - * XMLRPC_GetValueFaultCode () - * SOURCE - */ -int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) { - return XMLRPC_GetValueFaultCode( XMLRPC_RequestGetData(response) ); -} - -/*******/ - - -/****f* FAULT/XMLRPC_GetValueFaultString - * NAME - * XMLRPC_GetValueFaultString - * SYNOPSIS - * const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value) - * FUNCTION - * returns fault string from a struct, if any - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_vector_struct. - * RESULT - * fault string, else 0. - * SEE ALSO - * XMLRPC_GetResponseFaultString () - * SOURCE - */ -const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value) { - return XMLRPC_VectorGetStringWithID(value, "faultString"); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetResponseFaultString - * NAME - * XMLRPC_GetResponseFaultString - * SYNOPSIS - * const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) - * FUNCTION - * returns fault string from a response, if any - * INPUTS - * response XMLRPC_REQUEST. typically of type xmlrpc_request_response. - * RESULT - * fault string, else 0. - * SEE ALSO - * XMLRPC_GetValueFaultString () - * SOURCE - */ -const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) { - return XMLRPC_GetValueFaultString( XMLRPC_RequestGetData(response) ); -} - -/*******/ - - -/*-****************** -* Utility API funcs * -********************/ - - -/****f* UTILITY/XMLRPC_Free - * NAME - * XMLRPC_Free - * SYNOPSIS - * void XMLRPC_Free(void* mem) - * FUNCTION - * frees a block of memory allocated by xmlrpc. - * INPUTS - * mem memory to free - * RESULT - * void - * NOTES - * Useful for OS's where memory must be free'd - * in the same library in which it is allocated. - * SOURCE - */ -void XMLRPC_Free(void* mem) { - my_free(mem); -} - -/*******/ - - -/****f* UTILITY/XMLRPC_GetVersionString - * NAME - * XMLRPC_GetVersionString - * SYNOPSIS - * const char* XMLRPC_GetVersionString() - * FUNCTION - * returns library version string - * INPUTS - * - * RESULT - * const char* - * NOTES - * SOURCE - */ -const char* XMLRPC_GetVersionString() { - return XMLRPC_VERSION_STR; -} - -/*******/ - - -/*-********************** -* End Utility API funcs * -************************/ diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.h b/ext/xmlrpc/libxmlrpc/xmlrpc.h deleted file mode 100644 index dde3d5e122439..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef XMLRPC_ALREADY_INCLUDED -#define XMLRPC_ALREADY_INCLUDED 1 - -/* includes */ -#include "xml_element.h" -#include /* for time_t */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* allow version to be specified via compile line define */ -#ifndef XMLRPC_LIB_VERSION - #define XMLRPC_LIB_VERSION "0.51" -#endif - -/* this number, representing the date, must be increased each time the API changes */ -#define XMLRPC_API_NO 20020623 - -/* this string should be changed with each packaged release */ -#define XMLRPC_VERSION_STR "xmlrpc-epi v. " XMLRPC_LIB_VERSION - -/* where to find more info. shouldn't need to change much */ -#define XMLRPC_HOME_PAGE_STR "http://xmlprc-epi.sourceforge.net/" - - -/****d* VALUE/XMLRPC_VALUE_TYPE - * NAME - * XMLRPC_VALUE_TYPE - * NOTES - * Defines data types for XMLRPC_VALUE - * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY - * SEE ALSO - * XMLRPC_VECTOR_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VALUE_TYPE { - xmlrpc_none, /* not a value */ - xmlrpc_empty, /* empty value, eg NULL */ - xmlrpc_base64, /* base64 value, eg binary data */ - xmlrpc_boolean, /* boolean [0 | 1] */ - xmlrpc_datetime, /* datetime [ISO8601 | time_t] */ - xmlrpc_double, /* double / floating point */ - xmlrpc_int, /* integer */ - xmlrpc_string, /* string */ - xmlrpc_vector /* vector, aka list, array */ -} XMLRPC_VALUE_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_VECTOR_TYPE - * NAME - * XMLRPC_VECTOR_TYPE - * NOTES - * Defines data types for XMLRPC_VECTOR. - * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY - * SEE ALSO - * XMLRPC_VALUE_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VECTOR_TYPE { - xmlrpc_vector_none, /* not an array */ - xmlrpc_vector_array, /* no values may have key names */ - xmlrpc_vector_mixed, /* some values may have key names */ - xmlrpc_vector_struct /* all values must have key names */ -} XMLRPC_VECTOR_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_VALUE_TYPE_EASY - * NAME - * XMLRPC_VALUE_TYPE_EASY - * NOTES - * Defines data types for XMLRPC_VALUE, including vector types. - * SEE ALSO - * XMLRPC_VECTOR_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VALUE_TYPE_EASY { - xmlrpc_type_none, /* not a value */ - xmlrpc_type_empty, /* empty value, eg NULL */ - xmlrpc_type_base64, /* base64 value, eg binary data */ - xmlrpc_type_boolean, /* boolean [0 | 1] */ - xmlrpc_type_datetime, /* datetime [ISO8601 | time_t] */ - xmlrpc_type_double, /* double / floating point */ - xmlrpc_type_int, /* integer */ - xmlrpc_type_string, /* string */ -/* -- IMPORTANT: identical to XMLRPC_VALUE_TYPE to this point. -- */ - xmlrpc_type_array, /* vector array */ - xmlrpc_type_mixed, /* vector mixed */ - xmlrpc_type_struct /* vector struct */ -} XMLRPC_VALUE_TYPE_EASY; -/*******/ - - -/****d* VALUE/XMLRPC_REQUEST_TYPE - * NAME - * XMLRPC_REQUEST_TYPE - * NOTES - * Defines data types for XMLRPC_REQUEST - * SEE ALSO - * XMLRPC_VALUE_TYPE - * XMLRPC_VECTOR_TYPE - * SOURCE - */ -typedef enum _xmlrpc_request_type { - xmlrpc_request_none, /* not a valid request */ - xmlrpc_request_call, /* calling/invoking a method */ - xmlrpc_request_response, /* responding to a method call */ -} XMLRPC_REQUEST_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_ERROR_CODE - * NAME - * XMLRPC_ERROR_CODE - * NOTES - * All existing error codes - * SEE ALSO - * XMLRPC_REQUEST_ERROR - * SOURCE - */ -typedef enum _xmlrpc_error_code { - xmlrpc_error_none = 0, /* not an error */ - xmlrpc_error_parse_xml_syntax = -32700, - xmlrpc_error_parse_unknown_encoding = -32701, - xmlrpc_error_parse_bad_encoding = -32702, - xmlrpc_error_invalid_xmlrpc = -32600, - xmlrpc_error_unknown_method = -32601, - xmlrpc_error_invalid_params = -32602, - xmlrpc_error_internal_server = -32603, - xmlrpc_error_application = -32500, - xmlrpc_error_system = -32400, - xmlrpc_error_transport = -32300 -} XMLRPC_ERROR_CODE; -/******/ - -#define xmlrpc_error_parse_xml_syntax_str "parse error. not well formed." -#define xmlrpc_error_parse_unknown_encoding_str "parse error. unknown encoding" -#define xmlrpc_error_parse_bad_encoding_str "parse error. invalid character for encoding" -#define xmlrpc_error_invalid_xmlrpc_str "server error. xml-rpc not conforming to spec" -#define xmlrpc_error_unknown_method_str "server error. method not found." -#define xmlrpc_error_invalid_params_str "server error. invalid method parameters" -#define xmlrpc_error_internal_server_str "server error. internal xmlrpc library error" -#define xmlrpc_error_application_str "application error." -#define xmlrpc_error_system_str "system error." -#define xmlrpc_error_transport_str "transport error." - - - -/****d* VALUE/XMLRPC_VERSION - * NAME - * XMLRPC_VERSION - * NOTES - * Defines xml vocabulary used for generated xml - * SEE ALSO - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * XMLRPC_REQUEST_To_XML () - * SOURCE - */ -typedef enum _xmlrpc_version { - xmlrpc_version_none = 0, /* not a recognized vocabulary */ - xmlrpc_version_1_0 = 1, /* xmlrpc 1.0 standard vocab */ - xmlrpc_version_simple = 2, /* alt more readable vocab */ - xmlrpc_version_danda = 2, /* same as simple. legacy */ - xmlrpc_version_soap_1_1 = 3 /* SOAP. version 1.1 */ -} XMLRPC_VERSION; -/******/ - -/****s* VALUE/XMLRPC_REQUEST_OUTPUT_OPTIONS - * NAME - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * NOTES - * Defines output options for generated xml - * SEE ALSO - * XMLRPC_VERSION - * XML_ELEM_OUTPUT_OPTIONS - * XMLRPC_REQUEST_To_XML () - * SOURCE - */ -typedef struct _xmlrpc_request_output_options { - STRUCT_XML_ELEM_OUTPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */ - XMLRPC_VERSION version; /* xml vocabulary to use */ -} STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS, *XMLRPC_REQUEST_OUTPUT_OPTIONS; -/******/ - -/****s* VALUE/XMLRPC_REQUEST_INPUT_OPTIONS - * NAME - * XMLRPC_REQUEST_INPUT_OPTIONS - * NOTES - * Defines options for reading in xml data - * SEE ALSO - * XMLRPC_VERSION - * XML_ELEM_INPUT_OPTIONS - * XMLRPC_REQUEST_From_XML () - * SOURCE - */ -typedef struct _xmlrpc_request_input_options { - STRUCT_XML_ELEM_INPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */ -} STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS, *XMLRPC_REQUEST_INPUT_OPTIONS; -/******/ - -/****s* VALUE/XMLRPC_ERROR - * NAME - * XMLRPC_ERROR - * NOTES - * For the reporting and handling of errors - * SOURCE - */ -typedef struct _xmlrpc_error { - XMLRPC_ERROR_CODE code; - STRUCT_XML_ELEM_ERROR xml_elem_error; /* xml_element errors (parser errors) */ -} STRUCT_XMLRPC_ERROR, *XMLRPC_ERROR; -/******/ - - -/****d* VALUE/XMLRPC_CASE_COMPARISON - * NAME - * XMLRPC_CASE_COMPARISON - * NOTES - * Defines case comparison options for XMLRPC_VALUE/VECTOR API's - * SEE ALSO - * XMLRPC_CASE - * XMLRPC_VALUE - * SOURCE - */ -typedef enum _xmlrpc_case_comparison { - xmlrpc_case_insensitive, /* use case-insensitive compare */ - xmlrpc_case_sensitive /* use case-sensitive compare */ -} XMLRPC_CASE_COMPARISON; -/******/ - -/****d* VALUE/XMLRPC_CASE - * NAME - * XMLRPC_CASE - * NOTES - * Defines case behavior when setting IDs in XMLRPC_VALUE API's - * SEE ALSO - * XMLRPC_CASE_COMPARISON - * XMLRPC_VALUE - * SOURCE - */ -typedef enum _xmlrpc_case { - xmlrpc_case_exact, /* leave case alone */ - xmlrpc_case_lower, /* lower-case id */ - xmlrpc_case_upper /* upper-case id */ -} XMLRPC_CASE; -/******/ - -/* if you don't like these defaults, you can set them with XMLRPC_SetDefaultIdCase*() */ -#define XMLRPC_DEFAULT_ID_CASE XMLRPC_GetDefaultIdCase() -#define XMLRPC_DEFAULT_ID_CASE_SENSITIVITY XMLRPC_GetDefaultIdCaseComparison() - -/* opaque (non-public) types. defined locally in xmlrpc.c */ -typedef struct _xmlrpc_request* XMLRPC_REQUEST; -typedef struct _xmlrpc_server* XMLRPC_SERVER; -typedef struct _xmlrpc_value* XMLRPC_VALUE; - -/****d* VALUE/XMLRPC_Callback - * NAME - * XMLRPC_Callback - * NOTES - * Function prototype for user defined method handlers (callbacks). - * SEE ALSO - * XMLRPC_ServerRegisterMethod () - * XMLRPC_ServerCallMethod () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -typedef XMLRPC_VALUE (*XMLRPC_Callback)(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -/******/ - -/* ID Case Defaults */ -XMLRPC_CASE XMLRPC_GetDefaultIdCase(void); -XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case); -XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison(void); -XMLRPC_CASE_COMPARISON XMLRPC_SetDefaultIdCaseComparison(XMLRPC_CASE_COMPARISON id_case); - -/* Vector manipulation */ -int XMLRPC_VectorSize(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value); -int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type); -int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source); -int XMLRPC_AddValuesToVector(XMLRPC_VALUE target, ...); -int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case(XMLRPC_VALUE vector, const char* id, XMLRPC_CASE_COMPARISON id_case); - - -/* Create values */ -XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int truth); -XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len); -XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time); -XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s); -XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double f); -XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i); -XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* s, int len); -XMLRPC_VALUE XMLRPC_CreateValueEmpty(void); -XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type); - -/* Cleanup values */ -void XMLRPC_CleanupValue(XMLRPC_VALUE value); - -/* Request error */ -XMLRPC_VALUE XMLRPC_RequestSetError (XMLRPC_REQUEST request, XMLRPC_VALUE error); -XMLRPC_VALUE XMLRPC_RequestGetError (XMLRPC_REQUEST request); - -/* Copy values */ -XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_DupValueNew(XMLRPC_VALUE xSource); - -/* Set Values */ -void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time); -void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s); -void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val); -void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val); -void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val); -const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* s, int len); -void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len); -const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case); -#define XMLRPC_SetValueID(value, id, len) XMLRPC_SetValueID_Case(value, id, len, XMLRPC_DEFAULT_ID_CASE) - -/* Get Values */ -const char* XMLRPC_GetValueString(XMLRPC_VALUE value); -int XMLRPC_GetValueStringLen(XMLRPC_VALUE value); -int XMLRPC_GetValueInt(XMLRPC_VALUE value); -int XMLRPC_GetValueBoolean(XMLRPC_VALUE value); -double XMLRPC_GetValueDouble(XMLRPC_VALUE value); -const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value); -time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value); -const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value); -const char* XMLRPC_GetValueID(XMLRPC_VALUE value); - -/* Type introspection */ -XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE v); -XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy(XMLRPC_VALUE v); -XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE v); - -/* Parsing and Creating XML */ -XMLRPC_REQUEST XMLRPC_REQUEST_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options); -XMLRPC_VALUE XMLRPC_VALUE_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options); -char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int *buf_len); -char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val, int* buf_len); - -/* Request manipulation funcs */ -const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName); -const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request); -XMLRPC_REQUEST XMLRPC_RequestNew(void); -void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO); -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output); -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request); -XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data); -XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request); -XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType(XMLRPC_REQUEST request, XMLRPC_REQUEST_TYPE type); -XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request); - -/* Server Creation/Destruction; Method Registration and Invocation */ -XMLRPC_SERVER XMLRPC_ServerCreate(void); -XMLRPC_SERVER XMLRPC_GetGlobalServer(void); /* better to use XMLRPC_ServerCreate if you can */ -void XMLRPC_ServerDestroy(XMLRPC_SERVER server); -int XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb); -XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName); -XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData); - -#include "xmlrpc_introspection.h" - -/* Fault interrogation funcs */ -int XMLRPC_ValueIsFault (XMLRPC_VALUE value); -int XMLRPC_ResponseIsFault(XMLRPC_REQUEST response); -int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value); -int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response); -const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value); -const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response); - - -/* Public Utility funcs */ -XMLRPC_VALUE XMLRPC_UtilityCreateFault(int fault_code, const char* fault_string); -void XMLRPC_Free(void* mem); -const char* XMLRPC_GetVersionString(void); - -/****d* VALUE/XMLRPC_MACROS - * NAME - * Some Helpful Macros - * NOTES - * Some macros for making life easier. Should be self-explanatory. - * SEE ALSO - * XMLRPC_AddValueToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * SOURCE - */ - -/* Append values to vector */ -#define XMLRPC_VectorAppendString(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueString(id, s, len)) -#define XMLRPC_VectorAppendBase64(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBase64(id, s, len)) -#define XMLRPC_VectorAppendDateTime(vector, id, time) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime(id, time)) -#define XMLRPC_VectorAppendDateTime_ISO8601(vector, id, s) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime_ISO8601(id, s)) -#define XMLRPC_VectorAppendDouble(vector, id, f) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDouble(id, f)) -#define XMLRPC_VectorAppendInt(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueInt(id, i)) -#define XMLRPC_VectorAppendBoolean(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBoolean(id, i)) - -/* Get named values from vector */ -#define XMLRPC_VectorGetValueWithID(vector, id) XMLRPC_VectorGetValueWithID_Case(vector, id, XMLRPC_DEFAULT_ID_CASE_SENSITIVITY) -#define XMLRPC_VectorGetStringWithID(vector, id) XMLRPC_GetValueString(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetBase64WithID(vector, id) XMLRPC_GetValueBase64(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetDateTimeWithID(vector, id) XMLRPC_GetValueDateTime(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetDoubleWithID(vector, id) XMLRPC_GetValueDouble(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetIntWithID(vector, id) XMLRPC_GetValueInt(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetBooleanWithID(vector, id) XMLRPC_GetValueBoolean(XMLRPC_VectorGetValueWithID(vector, id)) - -/******/ - - -#ifdef __cplusplus -} -#endif - -#endif /* not XMLRPC_ALREADY_INCLUDED */ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 b/ext/xmlrpc/libxmlrpc/xmlrpc.m4 deleted file mode 100644 index 87da92db8a678..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 +++ /dev/null @@ -1,12 +0,0 @@ -AC_DEFUN([XMLRPC_CHECKS],[ - -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_LN_S]) -AC_REQUIRE([AC_PROG_RANLIB]) - -AC_DEFINE(UNDEF_THREADS_HACK,,[ ]) - -XMLRPC_HEADER_CHECKS -XMLRPC_TYPE_CHECKS -XMLRPC_FUNCTION_CHECKS -]) diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c deleted file mode 100644 index 78ec65803844c..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -/****h* ABOUT/xmlrpc_introspection - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * HISTORY - * $Log$ - * Revision 1.3 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.9 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 4/10/2001 -- danda -- initial introspection support - * TODO - * NOTES - *******/ - - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include "queue.h" -#include "xmlrpc.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include -#include -#include - - -/* forward declarations for static (non public, non api) funcs */ -static XMLRPC_VALUE xi_system_describe_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_list_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_method_signature_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_method_help_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); - - -/*-********************************** -* Introspection Callbacks (methods) * -************************************/ - -/* iterates through a list of structs and finds the one with key "name" matching - * needle. slow, would benefit from a struct key hash. - */ -inline XMLRPC_VALUE find_named_value(XMLRPC_VALUE list, const char* needle) { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(list); - while(xIter) { - const char* name = XMLRPC_VectorGetStringWithID(xIter, xi_token_name); - if(name && !strcmp(name, needle)) { - return xIter; - } - xIter = XMLRPC_VectorNext(list); - } - return NULL; -} - - -/* iterates through docs callbacks and calls any that have not yet been called */ -static void check_docs_loaded(XMLRPC_SERVER server, void* userData) { - if(server) { - q_iter qi = Q_Iter_Head_F(&server->docslist); - while( qi ) { - doc_method* dm = Q_Iter_Get_F(qi); - if(dm && !dm->b_called) { - dm->method(server, userData); - dm->b_called = 1; - } - qi = Q_Iter_Next_F(qi); - } - } -} - - -/* utility function for xi_system_describe_methods_cb */ -inline void describe_method(XMLRPC_SERVER server, XMLRPC_VALUE vector, const char* method) { - if(method) { - server_method* sm = find_method(server, method); - if(sm) { - XMLRPC_AddValueToVector(vector, sm->desc); - } - } -} - - - -/* system.describeMethods() callback */ -static XMLRPC_VALUE xi_system_describe_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xParams = XMLRPC_VectorRewind(XMLRPC_RequestGetData(input)); - XMLRPC_VALUE xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - XMLRPC_VALUE xMethodList = XMLRPC_CreateVector("methodList", xmlrpc_vector_array); - XMLRPC_VALUE xTypeList = NULL; - int bAll = 1; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - xTypeList = XMLRPC_VectorGetValueWithID(server->xIntrospection, "typeList"); - - XMLRPC_AddValueToVector(xResponse, xTypeList); - XMLRPC_AddValueToVector(xResponse, xMethodList); - - /* check if we have any param */ - if(xParams) { - /* check if string or vector (1 or n) */ - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(xParams); - if(type == xmlrpc_string) { - /* just one. spit it out. */ - describe_method(server, xMethodList, XMLRPC_GetValueString(xParams)); - bAll = 0; - } - else if(type == xmlrpc_vector) { - /* multiple. spit all out */ - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(xParams); - while(xIter) { - describe_method(server, xMethodList, XMLRPC_GetValueString(xIter)); - xIter = XMLRPC_VectorNext(xParams); - } - bAll = 0; - } - } - - /* otherwise, default to sending all methods */ - if(bAll) { - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm) { - XMLRPC_AddValueToVector(xMethodList, sm->desc); - } - qi = Q_Iter_Next_F(qi); - } - } - - return xResponse; -} - -/* this complies with system.listMethods as defined at http://xmlrpc.usefulinc.com/doc/reserved.html */ -static XMLRPC_VALUE xi_system_list_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm) { - XMLRPC_VectorAppendString(xResponse, 0, sm->name, 0); - } - qi = Q_Iter_Next_F(qi); - } - return xResponse; -} - -/* this complies with system.methodSignature as defined at - * http://xmlrpc.usefulinc.com/doc/sysmethodsig.html - */ -static XMLRPC_VALUE xi_system_method_signature_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - const char* method = XMLRPC_GetValueString(XMLRPC_VectorRewind(XMLRPC_RequestGetData(input))); - XMLRPC_VALUE xResponse = NULL; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - if(method) { - server_method* sm = find_method(server, method); - if(sm && sm->desc) { - XMLRPC_VALUE xTypesArray = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - XMLRPC_VALUE xIter, xParams, xSig, xSigIter; - const char* type; - - /* array of possible signatures. */ - xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - - /* find first signature */ - xSig = XMLRPC_VectorGetValueWithID(sm->desc, xi_token_signatures); - xSigIter = XMLRPC_VectorRewind( xSig ); - - /* iterate through sigs */ - while(xSigIter) { - /* first type is the return value */ - type = XMLRPC_VectorGetStringWithID(XMLRPC_VectorRewind( - XMLRPC_VectorGetValueWithID(xSigIter, xi_token_returns)), - xi_token_type); - XMLRPC_AddValueToVector(xTypesArray, - XMLRPC_CreateValueString(NULL, - type ? type : type_to_str(xmlrpc_none, 0), - 0)); - - /* the rest are parameters */ - xParams = XMLRPC_VectorGetValueWithID(xSigIter, xi_token_params); - xIter = XMLRPC_VectorRewind(xParams); - - /* iter through params, adding to types array */ - while(xIter) { - XMLRPC_AddValueToVector(xTypesArray, - XMLRPC_CreateValueString(NULL, - XMLRPC_VectorGetStringWithID(xIter, xi_token_type), - 0)); - xIter = XMLRPC_VectorNext(xParams); - } - - /* add types for this signature */ - XMLRPC_AddValueToVector(xResponse, xTypesArray); - - xSigIter = XMLRPC_VectorNext( xSig ); - } - } - } - - return xResponse; -} - -/* this complies with system.methodHelp as defined at - * http://xmlrpc.usefulinc.com/doc/sysmethhelp.html - */ -static XMLRPC_VALUE xi_system_method_help_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - const char* method = XMLRPC_GetValueString(XMLRPC_VectorRewind(XMLRPC_RequestGetData(input))); - XMLRPC_VALUE xResponse = NULL; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - if(method) { - server_method* sm = find_method(server, method); - if(sm && sm->desc) { - const char* help = XMLRPC_VectorGetStringWithID(sm->desc, xi_token_purpose); - - /* returns a documentation string, or empty string */ - xResponse = XMLRPC_CreateValueString(NULL, help ? help : xi_token_empty, 0); - } - } - - return xResponse; -} - -/*-************************************** -* End Introspection Callbacks (methods) * -****************************************/ - - -/*-************************ -* Introspection Utilities * -**************************/ - -/* performs registration of introspection methods */ -void xi_register_system_methods(XMLRPC_SERVER server) { - XMLRPC_ServerRegisterMethod(server, xi_token_system_list_methods, xi_system_list_methods_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_method_help, xi_system_method_help_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_method_signature, xi_system_method_signature_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_describe_methods, xi_system_describe_methods_cb); -} - -/* describe a value (param, return, type) */ -static XMLRPC_VALUE describeValue_worker(const char* type, const char* id, const char* desc, int optional, const char* default_val, XMLRPC_VALUE sub_params) { - XMLRPC_VALUE xParam = NULL; - if(id || desc) { - xParam = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - XMLRPC_VectorAppendString(xParam, xi_token_name, id, 0); - XMLRPC_VectorAppendString(xParam, xi_token_type, type, 0); - XMLRPC_VectorAppendString(xParam, xi_token_description, desc, 0); - if(optional != 2) { - XMLRPC_VectorAppendInt(xParam, xi_token_optional, optional); - } - if(optional == 1 && default_val) { - XMLRPC_VectorAppendString(xParam, xi_token_default, default_val, 0); - } - XMLRPC_AddValueToVector(xParam, sub_params); - } - return xParam; -} - - -/* convert an xml tree conforming to spec to XMLRPC_VALUE - * suitable for use with XMLRPC_ServerAddIntrospectionData - */ -XMLRPC_VALUE xml_element_to_method_description(xml_element* el, XMLRPC_ERROR err) { - XMLRPC_VALUE xReturn = NULL; - - if(el->name) { - const char* name = NULL; - const char* type = NULL; - const char* basetype = NULL; - const char* desc = NULL; - const char* def = NULL; - int optional = 0; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - - /* grab element attributes up front to save redundant while loops */ - while(attr_iter) { - if(!strcmp(attr_iter->key, "name")) { - name = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "type")) { - type = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "basetype")) { - basetype = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "desc")) { - desc = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "optional")) { - if(attr_iter->val && !strcmp(attr_iter->val, "yes")) { - optional = 1; - } - } - else if(!strcmp(attr_iter->key, "default")) { - def = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - /* value and typeDescription behave about the same */ - if(!strcmp(el->name, "value") || !strcmp(el->name, "typeDescription")) { - XMLRPC_VALUE xSubList = NULL; - const char* ptype = !strcmp(el->name, "value") ? type : basetype; - if(ptype) { - if(Q_Size(&el->children) && - (!strcmp(ptype, "array") || !strcmp(ptype, "struct") || !strcmp(ptype, "mixed"))) { - xSubList = XMLRPC_CreateVector("member", xmlrpc_vector_array); - - if(xSubList) { - xml_element* elem_iter = Q_Head(&el->children); - while(elem_iter) { - XMLRPC_AddValueToVector(xSubList, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - } - xReturn = describeValue_worker(ptype, name, (desc ? desc : (xSubList ? NULL : el->text.str)), optional, def, xSubList); - } - } - - /* these three kids are about equivalent */ - else if(!strcmp(el->name, "params") || - !strcmp(el->name, "returns") || - !strcmp(el->name, "signature")) { - if(Q_Size(&el->children)) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(!strcmp(el->name, "signature") ? NULL : el->name, xmlrpc_vector_struct); - - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - } - - - else if(!strcmp(el->name, "methodDescription")) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - - XMLRPC_VectorAppendString(xReturn, xi_token_name, name, 0); - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - - /* items are slightly special */ - else if(!strcmp(el->name, "item")) { - xReturn = XMLRPC_CreateValueString(name, el->text.str, el->text.len); - } - - /* sure. we'll let any ol element with children through */ - else if(Q_Size(&el->children)) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(el->name, xmlrpc_vector_mixed); - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - - /* or anything at all really, so long as its got some text. - * no reason being all snotty about a spec, right? - */ - else if(el->name && el->text.len) { - xReturn = XMLRPC_CreateValueString(el->name, el->text.str, el->text.len); - } - } - - return xReturn; -} - -/*-**************************** -* End Introspection Utilities * -******************************/ - - - -/*-****************** -* Introspection API * -********************/ - - -/****f* VALUE/XMLRPC_IntrospectionCreateDescription - * NAME - * XMLRPC_IntrospectionCreateDescription - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR err) - * FUNCTION - * converts raw xml describing types and methods into an - * XMLRPC_VALUE suitable for use with XMLRPC_ServerAddIntrospectionData() - * INPUTS - * xml - xml data conforming to introspection spec at - * err - optional pointer to error struct. filled in if error occurs and not NULL. - * RESULT - * XMLRPC_VALUE - newly created value, or NULL if fatal error. - * BUGS - * Currently does little or no validation of xml. - * Only parse errors are currently reported in err, not structural errors. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR err) { - XMLRPC_VALUE xReturn = NULL; - xml_element* root = xml_elem_parse_buf(xml, 0, 0, err ? &err->xml_elem_error : NULL); - - if(root) { - xReturn = xml_element_to_method_description(root, err); - - xml_elem_free(root); - } - - return xReturn; - -} -/*******/ - - -/****f* SERVER/XMLRPC_ServerAddIntrospectionData - * NAME - * XMLRPC_ServerAddIntrospectionData - * SYNOPSIS - * int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc) - * FUNCTION - * updates server with additional introspection data - * INPUTS - * server - target server - * desc - introspection data, should be a struct generated by - * XMLRPC_IntrospectionCreateDescription () - * RESULT - * int - 1 if success, else 0 - * NOTES - * - function will fail if neither typeList nor methodList key is present in struct. - * - if method or type already exists, it will be replaced. - * - desc is never freed by the server. caller is responsible for cleanup. - * BUGS - * - horribly slow lookups. prime candidate for hash improvements. - * - uglier and more complex than I like to see for API functions. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * XMLRPC_ServerRegisterIntrospectionCallback () - * XMLRPC_CleanupValue () - * SOURCE - */ -int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc) { - int bSuccess = 0; - if(server && desc) { - XMLRPC_VALUE xNewTypes = XMLRPC_VectorGetValueWithID(desc, "typeList"); - XMLRPC_VALUE xNewMethods = XMLRPC_VectorGetValueWithID(desc, "methodList"); - XMLRPC_VALUE xServerTypes = XMLRPC_VectorGetValueWithID(server->xIntrospection, "typeList"); - - if(xNewMethods) { - XMLRPC_VALUE xMethod = XMLRPC_VectorRewind(xNewMethods); - - while(xMethod) { - const char* name = XMLRPC_VectorGetStringWithID(xMethod, xi_token_name); - server_method* sm = find_method(server, name); - - if(sm) { - if(sm->desc) { - XMLRPC_CleanupValue(sm->desc); - } - sm->desc = XMLRPC_CopyValue(xMethod); - bSuccess = 1; - } - - xMethod = XMLRPC_VectorNext(xNewMethods); - } - } - if(xNewTypes) { - if(!xServerTypes) { - if(!server->xIntrospection) { - server->xIntrospection = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - } - - XMLRPC_AddValueToVector(server->xIntrospection, xNewTypes); - bSuccess = 1; - } - else { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(xNewTypes); - while(xIter) { - /* get rid of old values */ - XMLRPC_VALUE xPrev = find_named_value(xServerTypes, XMLRPC_VectorGetStringWithID(xIter, xi_token_name)); - if(xPrev) { - XMLRPC_VectorRemoveValue(xServerTypes, xPrev); - } - XMLRPC_AddValueToVector(xServerTypes, xIter); - bSuccess = 1; - xIter = XMLRPC_VectorNext(xNewTypes); - } - } - } - } - return bSuccess; -} -/*******/ - - -/****f* SERVER/XMLRPC_ServerRegisterIntrospectionCallback - * NAME - * XMLRPC_ServerRegisterIntrospectionCallback - * SYNOPSIS - * int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb) - * FUNCTION - * registers a callback for lazy generation of introspection data - * INPUTS - * server - target server - * cb - callback that will generate introspection data - * RESULT - * int - 1 if success, else 0 - * NOTES - * parsing xml and generating introspection data is fairly expensive, thus a - * server may wish to wait until this data is actually requested before generating - * it. Any number of callbacks may be registered at any time. A given callback - * will only ever be called once, the first time an introspection request is - * processed after the time of callback registration. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * XMLRPC_IntrospectionCreateDescription () - * SOURCE - */ -int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb) { - int bSuccess = 0; - if(server && cb) { - - doc_method* dm = calloc(1, sizeof(doc_method)); - - if(dm) { - dm->method = cb; - dm->b_called = 0; - - if(Q_PushTail(&server->docslist, dm)) { - bSuccess = 1; - } - else { - my_free(dm); - } - } - } - return 0; -} -/*******/ - -/*-********************** -* End Introspection API * -************************/ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h deleted file mode 100644 index 656e441b96bfb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only public (official API) things should be in this file. Anything else - * should go in _private.h, or in the appropriate .c file. - */ - - -#ifndef __XI_INTROSPECTION_H -/* - * Avoid include redundancy. - */ -#define __XI_INTROSPECTION_H - -/*---------------------------------------------------------------------------- - * xmlrpc_introspection.h - * - * Purpose: - * define public introspection API - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ - #define xi_token_params "params" - #define xi_token_returns "returns" - #define xi_token_related "related" - #define xi_token_sub "sub" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - - /****d* VALUE/XMLRPC_IntrospectionCallback - * NAME - * XMLRPC_IntrospectionCallback - * NOTES - * Function prototype for lazy documentation generation (not generated until requested). - * SOURCE - */ -typedef void (*XMLRPC_IntrospectionCallback)(XMLRPC_SERVER server, void* userData); -/******/ - - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR error); -int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc); -int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __XI_INTROSPECTION_H */ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h deleted file mode 100644 index 7b97fa7ed7cb7..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Dan Libby, Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - - -#ifndef __XI_INTROSPECTION_PRIVATE_H -/* - * Avoid include redundancy. - */ -#define __XI_INTROSPECTION_PRIVATE_H - -/*---------------------------------------------------------------------------- - * xmlrpc_introspection_private.h - * - * Purpose: - * define non-public introspection routines - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ -#define xi_token_default "default" -#define xi_token_description "description" -#define xi_token_name "name" -#define xi_token_optional "optional" -#define xi_token_params "params" -#define xi_token_purpose "purpose" -#define xi_token_returns "returns" -#define xi_token_signatures "signatures" -#define xi_token_type "type" -#define xi_token_version "version" -#define xi_token_empty "" -#define xi_token_system_describe_methods "system.describeMethods" -#define xi_token_system_list_methods "system.listMethods" -#define xi_token_system_method_help "system.methodHelp" -#define xi_token_system_method_signature "system.methodSignature" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ -typedef struct _doc_method { - XMLRPC_IntrospectionCallback method; - int b_called; -} doc_method; - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -void xi_register_system_methods(XMLRPC_SERVER server); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __XI_INTROSPECTION_PRIVATE_H */ - - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_private.h b/ext/xmlrpc/libxmlrpc/xmlrpc_private.h deleted file mode 100644 index 65c6b136a6948..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_private.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - -#ifndef XMLRPC_PRIVATE_ALREADY_INCLUDED -/* - * Avoid include redundancy. - */ -#define XMLRPC_PRIVATE_ALREADY_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - - -/*---------------------------------------------------------------------------- - * xmlrpc_private.h - * - * Purpose: - * define non-public intra-library routines & data - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - -/* Some of these are typedef'd in xmlrpc.h for public use */ - -typedef struct _xmlrpc_vector* XMLRPC_VECTOR; - -/****s* VALUE/XMLRPC_VALUE - * NAME - * XMLRPC_VALUE - * NOTES - * A value of variable data type. The most important object in this API. :) - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * SEE ALSO - * XMLRPC_REQUEST - * XMLRPC_CreateValueEmpty () - * XMLRPC_CleanupValue () - * SOURCE - */ -typedef struct _xmlrpc_value { - XMLRPC_VALUE_TYPE type; /* data type of this value */ - XMLRPC_VECTOR v; /* vector type specific info */ - simplestring str; /* string value buffer */ - simplestring id; /* id of this value. possibly empty. */ - int i; /* integer value. */ - double d; /* double value */ - int iRefCount; /* So we know when we can delete the value . */ -} STRUCT_XMLRPC_VALUE; -/******/ - -/****s* VALUE/XMLRPC_REQUEST - * NAME - * XMLRPC_REQUEST - * NOTES - * Internal representation of an XML request. - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * - * SEE ALSO - * XMLRPC_VALUE - * XMLRPC_RequestNew () - * XMLRPC_RequestFree () - * SOURCE - */ -typedef struct _xmlrpc_request { - XMLRPC_VALUE io; /* data associated with this request */ - simplestring methodName; /* name of method being called */ - XMLRPC_REQUEST_TYPE request_type; /* type of request */ - STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS output; /* xml output options */ - XMLRPC_VALUE error; /* error codes */ -} STRUCT_XMLRPC_REQUEST; -/******/ - -/* Vector type. Used by XMLRPC_VALUE. Never visible to users of the API. */ -typedef struct _xmlrpc_vector { - XMLRPC_VECTOR_TYPE type; /* vector type */ - queue *q; /* list of child values */ -} STRUCT_XMLRPC_VECTOR; -/******/ - -/****s* VALUE/XMLRPC_SERVER - * NAME - * XMLRPC_SERVER - * NOTES - * internal representation of an xmlrpc server - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * - * SEE ALSO - * XMLRPC_ServerCreate () - * XMLRPC_ServerDestroy () - * SOURCE - */ -typedef struct _xmlrpc_server { - queue methodlist; /* list of callback methods */ - queue docslist; /* list of introspection callbacks */ - XMLRPC_VALUE xIntrospection; -} STRUCT_XMLRPC_SERVER; -/******/ - -typedef struct _server_method { - char* name; - XMLRPC_VALUE desc; - XMLRPC_Callback method; -} server_method; - - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -server_method* find_method(XMLRPC_SERVER server, const char* name); -const char* type_to_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype); - -/*---------------------------------------------------------------------------- - * Macros - */ -#define my_free(thing) if(thing) {free(thing); thing = 0;} - - -#ifdef __cplusplus -} -#endif - - -#endif /* XMLRPC_PRIVATE_ALREADY_INCLUDED */ - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h b/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h deleted file mode 100644 index 58c54bbb80931..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _XMLRPC_WIN32_H -#define _XMLRPC_WIN32_H -/* just some things needed to compile win32 */ -#include -#include -#define inline __inline -#define snprintf _snprintf -#define strcasecmp(s1, s2) stricmp(s1, s2) - - -#endif \ No newline at end of file diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h deleted file mode 100644 index 15011a2213b89..0000000000000 --- a/ext/xmlrpc/php_xmlrpc.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - This file is part of, or distributed with, libXMLRPC - a C library for - xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* auto-generated portions of this file are also subject to the php license */ - -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Dan Libby | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _PHP_XMLRPC_H -#define _PHP_XMLRPC_H - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if 1 /* HAVE_XMLRPC */ - -extern zend_module_entry xmlrpc_module_entry; -#define phpext_xmlrpc_ptr &xmlrpc_module_entry - -#ifdef PHP_WIN32 -#define PHP_XMLRPC_API __declspec(dllexport) -#else -#define PHP_XMLRPC_API -#endif - -PHP_MINIT_FUNCTION(xmlrpc); -PHP_MSHUTDOWN_FUNCTION(xmlrpc); -PHP_RINIT_FUNCTION(xmlrpc); -PHP_RSHUTDOWN_FUNCTION(xmlrpc); -PHP_MINFO_FUNCTION(xmlrpc); - -PHP_FUNCTION(xmlrpc_encode); -PHP_FUNCTION(xmlrpc_decode); -PHP_FUNCTION(xmlrpc_decode_request); -PHP_FUNCTION(xmlrpc_encode_request); -PHP_FUNCTION(xmlrpc_get_type); -PHP_FUNCTION(xmlrpc_set_type); -PHP_FUNCTION(xmlrpc_is_fault); -PHP_FUNCTION(xmlrpc_server_create); -PHP_FUNCTION(xmlrpc_server_destroy); -PHP_FUNCTION(xmlrpc_server_register_method); -PHP_FUNCTION(xmlrpc_server_call_method); -PHP_FUNCTION(xmlrpc_parse_method_descriptions); -PHP_FUNCTION(xmlrpc_server_add_introspection_data); -PHP_FUNCTION(xmlrpc_server_register_introspection_callback); - -/* Fill in this structure and use entries in it - for thread safety instead of using true globals. -*/ -typedef struct { - int x; /* fix error in msvc, cannot have empty structs */ -} zend_xmlrpc_globals; - -/* In every function that needs to use variables in zend_xmlrpc_globals, - do call XMLRPCLS_FETCH(); after declaring other variables used by - that function, and always refer to them as XMLRPCG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#else - -#define phpext_xmlrpc_ptr NULL - -#endif - -#endif /* _PHP_XMLRPC_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c deleted file mode 100644 index b3be29cabdc9f..0000000000000 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ /dev/null @@ -1,1508 +0,0 @@ -/* - This file is part of, or distributed with, libXMLRPC - a C library for - xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* auto-generated portions of this file are also subject to the php license */ - -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Dan Libby | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/********************************************************************** -* BUGS: * -* - when calling a php user function, there appears to be no way to * -* distinguish between a return value of null, and no return value * -* at all. The xml serialization layer(s) will then return a value * -* of null, when the right thing may be no value at all. (SOAP) * -**********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_xmlrpc.h" -#include "xmlrpc.h" - -#define PHP_EXT_VERSION "0.51" - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. */ - -ZEND_DECLARE_MODULE_GLOBALS(xmlrpc) - -static int le_xmlrpc_server; - -function_entry xmlrpc_functions[] = { - PHP_FE(xmlrpc_encode, NULL) - PHP_FE(xmlrpc_decode, NULL) - PHP_FE(xmlrpc_decode_request, second_arg_force_ref) - PHP_FE(xmlrpc_encode_request, NULL) - PHP_FE(xmlrpc_get_type, NULL) - PHP_FE(xmlrpc_set_type, first_arg_force_ref) - PHP_FE(xmlrpc_is_fault, NULL) - PHP_FE(xmlrpc_server_create, NULL) - PHP_FE(xmlrpc_server_destroy, NULL) - PHP_FE(xmlrpc_server_register_method, NULL) - PHP_FE(xmlrpc_server_call_method, NULL) - PHP_FE(xmlrpc_parse_method_descriptions, NULL) - PHP_FE(xmlrpc_server_add_introspection_data, NULL) - PHP_FE(xmlrpc_server_register_introspection_callback, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry xmlrpc_module_entry = { - STANDARD_MODULE_HEADER, - "xmlrpc", - xmlrpc_functions, - PHP_MINIT(xmlrpc), - PHP_MSHUTDOWN(xmlrpc), - PHP_RINIT(xmlrpc), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(xmlrpc), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(xmlrpc), - PHP_EXT_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_XMLRPC -ZEND_GET_MODULE(xmlrpc) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/******************************* -* local structures and defines * -*******************************/ - -/* per server data */ -typedef struct _xmlrpc_server_data { - zval* method_map; - zval* introspection_map; - XMLRPC_SERVER server_ptr; -} xmlrpc_server_data; - - -/* how to format output */ -typedef struct _php_output_options { - int b_php_out; - int b_auto_version; - STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS xmlrpc_out; -} php_output_options; - -/* data passed to C callback */ -typedef struct _xmlrpc_callback_data { - zval* xmlrpc_method; - zval* php_function; - zval* caller_params; - zval* return_data; - xmlrpc_server_data* server; - char php_executed; -} xmlrpc_callback_data; - -/* output options */ -#define OUTPUT_TYPE_KEY "output_type" -#define OUTPUT_TYPE_KEY_LEN (sizeof(OUTPUT_TYPE_KEY) - 1) -#define OUTPUT_TYPE_VALUE_PHP "php" -#define OUTPUT_TYPE_VALUE_XML "xml" - -#define VERBOSITY_KEY "verbosity" -#define VERBOSITY_KEY_LEN (sizeof(VERBOSITY_KEY) - 1) -#define VERBOSITY_VALUE_NO_WHITE_SPACE "no_white_space" -#define VERBOSITY_VALUE_NEWLINES_ONLY "newlines_only" -#define VERBOSITY_VALUE_PRETTY "pretty" - -#define ESCAPING_KEY "escaping" -#define ESCAPING_KEY_LEN (sizeof(ESCAPING_KEY) - 1) -#define ESCAPING_VALUE_CDATA "cdata" -#define ESCAPING_VALUE_NON_ASCII "non-ascii" -#define ESCAPING_VALUE_NON_PRINT "non-print" -#define ESCAPING_VALUE_MARKUP "markup" - -#define VERSION_KEY "version" -#define VERSION_KEY_LEN (sizeof(VERSION_KEY) - 1) -#define VERSION_VALUE_SIMPLE "simple" -#define VERSION_VALUE_XMLRPC "xmlrpc" -#define VERSION_VALUE_SOAP11 "soap 1.1" -#define VERSION_VALUE_AUTO "auto" - -#define ENCODING_KEY "encoding" -#define ENCODING_KEY_LEN (sizeof(ENCODING_KEY) - 1) -#define ENCODING_DEFAULT "iso-8859-1" - -/* value types */ -#define OBJECT_TYPE_ATTR "xmlrpc_type" -#define OBJECT_VALUE_ATTR "scalar" -#define OBJECT_VALUE_TS_ATTR "timestamp" - -/* faults */ -#define FAULT_CODE "faultCode" -#define FAULT_CODE_LEN (sizeof(FAULT_CODE) - 1) -#define FAULT_STRING "faultString" -#define FAULT_STRING_LEN (sizeof(FAULT_STRING) - 1) - -/*********************** -* forward declarations * -***********************/ -XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval** newvalue); -static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data); -int sset_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type); -zval* decode_request_worker(zval* xml_in, zval* encoding_in, zval* method_name_out); -const char* xmlrpc_type_as_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype); -XMLRPC_VALUE_TYPE xmlrpc_str_as_type(const char* str); -XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str); -int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type); - -/********************* -* startup / shutdown * -*********************/ - -static void destroy_server_data(xmlrpc_server_data *server) -{ - if (server) { - XMLRPC_ServerDestroy(server->server_ptr); - - zval_dtor(server->method_map); - FREE_ZVAL(server->method_map); - - zval_dtor(server->introspection_map); - FREE_ZVAL(server->introspection_map); - - efree(server); - } -} - -/* called when server is being destructed. either when xmlrpc_server_destroy - * is called, or when request ends. */ -static void xmlrpc_server_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - if (rsrc && rsrc->ptr) { - destroy_server_data((xmlrpc_server_data*) rsrc->ptr); - } -} - -/* module init */ -PHP_MINIT_FUNCTION(xmlrpc) -{ - le_xmlrpc_server = zend_register_list_destructors_ex(xmlrpc_server_destructor, NULL, "xmlrpc server", module_number); - - return SUCCESS; -} - -/* module shutdown */ -PHP_MSHUTDOWN_FUNCTION(xmlrpc) -{ - return SUCCESS; -} - -/* Remove if there's nothing to do at request start */ -PHP_RINIT_FUNCTION(xmlrpc) -{ - return SUCCESS; -} - -/* Remove if there's nothing to do at request end */ -PHP_RSHUTDOWN_FUNCTION(xmlrpc) -{ - return SUCCESS; -} - -/* display info in phpinfo() */ -PHP_MINFO_FUNCTION(xmlrpc) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "core library version", XMLRPC_GetVersionString()); - php_info_print_table_row(2, "php extension version", PHP_EXT_VERSION); - php_info_print_table_row(2, "author", "Dan Libby"); - php_info_print_table_row(2, "homepage", "http://xmlrpc-epi.sourceforge.net"); - php_info_print_table_row(2, "open sourced by", "Epinions.com"); - php_info_print_table_end(); -} - -/******************* -* random utilities * -*******************/ - -/* Utility functions for adding data types to arrays, with or without key (assoc, non-assoc). - * Could easily be further generalized to work with objects. - */ -#if 0 -static int add_long(zval* list, char* id, int num) { - if(id) return add_assoc_long(list, id, num); - else return add_next_index_long(list, num); -} - -static int add_double(zval* list, char* id, double num) { - if(id) return add_assoc_double(list, id, num); - else return add_next_index_double(list, num); -} - -static int add_string(zval* list, char* id, char* string, int duplicate) { - if(id) return add_assoc_string(list, id, string, duplicate); - else return add_next_index_string(list, string, duplicate); -} - -static int add_stringl(zval* list, char* id, char* string, uint length, int duplicate) { - if(id) return add_assoc_stringl(list, id, string, length, duplicate); - else return add_next_index_stringl(list, string, length, duplicate); -} - -#endif - -static int add_zval(zval* list, const char* id, zval** val) -{ - if (list && val) { - if (id) { - return zend_hash_update(Z_ARRVAL_P(list), (char*) id, strlen(id) + 1, (void *) val, sizeof(zval **), NULL); - } else { - return zend_hash_next_index_insert(Z_ARRVAL_P(list), (void *) val, sizeof(zval **), NULL); - } - } - /* what is the correct return on error? */ - return 0; -} - -#define my_zend_hash_get_current_key(ht, my_key, num_index) zend_hash_get_current_key(ht, my_key, num_index, 0) - - -/************************* -* input / output options * -*************************/ - -/* parse an array (user input) into output options suitable for use by xmlrpc engine - * and determine whether to return data as xml or php vars */ -static void set_output_options(php_output_options* options, zval* output_opts) -{ - if (options) { - - /* defaults */ - options->b_php_out = 0; - options->b_auto_version = 1; - options->xmlrpc_out.version = xmlrpc_version_1_0; - options->xmlrpc_out.xml_elem_opts.encoding = ENCODING_DEFAULT; - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping | xml_elem_non_ascii_escaping | xml_elem_non_print_escaping; - - if (output_opts && Z_TYPE_P(output_opts) == IS_ARRAY) { - zval** val; - - /* type of output (xml/php) */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), OUTPUT_TYPE_KEY, OUTPUT_TYPE_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - if (!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_PHP)) { - options->b_php_out = 1; - } else if (!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_XML)) { - options->b_php_out = 0; - } - } - } - - /* verbosity of generated xml */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), VERBOSITY_KEY, VERBOSITY_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NO_WHITE_SPACE)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_no_white_space; - } else if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NEWLINES_ONLY)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_newlines_only; - } else if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_PRETTY)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; - } - } - } - - /* version of xml to output */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), VERSION_KEY, VERSION_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - options->b_auto_version = 0; - if (!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_XMLRPC)) { - options->xmlrpc_out.version = xmlrpc_version_1_0; - } else if (!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_SIMPLE)) { - options->xmlrpc_out.version = xmlrpc_version_simple; - } else if (!strcmp((*val)->value.str.val, VERSION_VALUE_SOAP11)) { - options->xmlrpc_out.version = xmlrpc_version_soap_1_1; - } else { /* if(!strcmp((*val)->value.str.val, VERSION_VALUE_AUTO)) { */ - options->b_auto_version = 1; - } - } - } - - /* encoding code set */ - if(zend_hash_find(Z_ARRVAL_P(output_opts), - ENCODING_KEY, ENCODING_KEY_LEN + 1, - (void**)&val) == SUCCESS) { - if(Z_TYPE_PP(val) == IS_STRING) { - options->xmlrpc_out.xml_elem_opts.encoding = estrdup(Z_STRVAL_PP(val)); - } - } - - /* escaping options */ - if(zend_hash_find(Z_ARRVAL_P(output_opts), - ESCAPING_KEY, ESCAPING_KEY_LEN + 1, - (void**)&val) == SUCCESS) { - /* multiple values allowed. check if array */ - if(Z_TYPE_PP(val) == IS_ARRAY) { - zval** iter_val; - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(val)); - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_no_escaping; - while(1) { - if(zend_hash_get_current_data(Z_ARRVAL_PP(val), (void**)&iter_val) == SUCCESS) { - if(Z_TYPE_PP(iter_val) == IS_STRING && Z_STRVAL_PP(iter_val)) { - if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_CDATA)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_cdata_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_ASCII)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_ascii_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_PRINT)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_print_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_MARKUP)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_markup_escaping; - } - } - } - else { - break; - } - - zend_hash_move_forward(Z_ARRVAL_PP(val)); - } - } - /* else, check for single value */ - else if(Z_TYPE_PP(val) == IS_STRING) { - if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_CDATA)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_cdata_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_ASCII)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_ascii_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_PRINT)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_print_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_MARKUP)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping; - } - } - } - } - } -} - - -/****************** -* encode / decode * -******************/ - -/* php arrays have no distinction between array and struct types. - * they even allow mixed. Thus, we determine the type by iterating - * through the entire array and figuring out each element. - * room for some optimation here if we stop after a specific # of elements. - */ -static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht) -{ - int bArray = 0, bStruct = 0, bMixed = 0; - unsigned long num_index; - char* my_key; - - zend_hash_internal_pointer_reset(ht); - while(1) { - int res = my_zend_hash_get_current_key(ht, &my_key, &num_index); - if(res == HASH_KEY_IS_LONG) { - if(bStruct) { - bMixed = 1; - break; - } - bArray = 1; - } - else if(res == HASH_KEY_NON_EXISTANT) { - break; - } - else if(res == HASH_KEY_IS_STRING) { - if(bArray) { - bMixed = 1; - break; - } - bStruct = 1; - } - - zend_hash_move_forward(ht); - } - return bMixed ? xmlrpc_vector_mixed : (bStruct ? xmlrpc_vector_struct : xmlrpc_vector_array); -} - -/* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) -{ - XMLRPC_VALUE xReturn = NULL; - if(in_val) { - zval* val = NULL; - XMLRPC_VALUE_TYPE type = get_zval_xmlrpc_type(in_val, &val); - if(val) { - switch(type) { - case xmlrpc_base64: - if(Z_TYPE_P(val) == IS_NULL) { - xReturn = XMLRPC_CreateValueEmpty(); - XMLRPC_SetValueID(xReturn, key, 0); - } - else { - xReturn = XMLRPC_CreateValueBase64(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); - } - break; - case xmlrpc_datetime: - convert_to_string(val); - xReturn = XMLRPC_CreateValueDateTime_ISO8601(key, Z_STRVAL_P(val)); - break; - case xmlrpc_boolean: - convert_to_boolean(val); - xReturn = XMLRPC_CreateValueBoolean(key, Z_LVAL_P(val)); - break; - case xmlrpc_int: - convert_to_long(val); - xReturn = XMLRPC_CreateValueInt(key, Z_LVAL_P(val)); - break; - case xmlrpc_double: - convert_to_double(val); - xReturn = XMLRPC_CreateValueDouble(key, Z_DVAL_P(val)); - break; - case xmlrpc_string: - convert_to_string(val); - xReturn = XMLRPC_CreateValueString(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); - break; - case xmlrpc_vector: - { - unsigned long num_index; - zval** pIter; - char* my_key; - HashTable *ht = NULL; - - ht = HASH_OF(val); - if (ht && ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "XML-RPC doesn't support circular references"); - return NULL; - } - - convert_to_array(val); - xReturn = XMLRPC_CreateVector(key, determine_vector_type(Z_ARRVAL_P(val))); - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); - while(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) { - int res = my_zend_hash_get_current_key(Z_ARRVAL_P(val), &my_key, &num_index); - - switch (res) { - case HASH_KEY_NON_EXISTANT: - break; - default: - ht = HASH_OF(*pIter); - if (ht) { - ht->nApplyCount++; - } - if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); - } - else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); - } - if (ht) { - ht->nApplyCount--; - } - break; - } - zend_hash_move_forward(Z_ARRVAL_P(val)); - } - } - break; - default: - break; - } - } - } - return xReturn; -} - -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) -{ - return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); -} - -/* recursively convert xmlrpc values into php values */ -static zval* XMLRPC_to_PHP(XMLRPC_VALUE el) -{ - zval* elem = NULL; - const char* pStr; - - if(el) { - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(el); - - MAKE_STD_ZVAL(elem); /* init. very important. spent a frustrating day finding this out. */ - - switch(type) { - case xmlrpc_empty: - Z_TYPE_P(elem) = IS_NULL; - break; - case xmlrpc_string: - pStr = XMLRPC_GetValueString(el); - if(pStr) { - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - } - break; - case xmlrpc_int: - Z_LVAL_P(elem) = XMLRPC_GetValueInt(el); - Z_TYPE_P(elem) = IS_LONG; - break; - case xmlrpc_boolean: - Z_LVAL_P(elem) = XMLRPC_GetValueBoolean(el); - Z_TYPE_P(elem) = IS_BOOL; - break; - case xmlrpc_double: - Z_DVAL_P(elem) = XMLRPC_GetValueDouble(el); - Z_TYPE_P(elem) = IS_DOUBLE; - break; - case xmlrpc_datetime: - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(XMLRPC_GetValueDateTime_ISO8601(el), Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - break; - case xmlrpc_base64: - pStr = XMLRPC_GetValueBase64(el); - if(pStr) { - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - } - break; - case xmlrpc_vector: - array_init(elem); - { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(el); - - while( xIter ) { - zval *val = XMLRPC_to_PHP(xIter); - if (val) { - add_zval(elem, XMLRPC_GetValueID(xIter), &val); - } - xIter = XMLRPC_VectorNext(el); - } - } - break; - default: - break; - } - set_zval_xmlrpc_type(elem, type); - } - return elem; -} - -/* {{{ proto string xmlrpc_encode_request(string method, mixed params) - Generates XML for a method request */ -PHP_FUNCTION(xmlrpc_encode_request) -{ - XMLRPC_REQUEST xRequest = NULL; - zval **method, **vals, **out_opts; - char* outBuf; - php_output_options out; - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || (zend_get_parameters_ex(ZEND_NUM_ARGS(), &method, &vals, &out_opts) == FAILURE)) { - WRONG_PARAM_COUNT; /* prints/logs a warning and returns */ - } - - set_output_options(&out, (ZEND_NUM_ARGS() == 3) ? *out_opts : 0); - - if(return_value_used) { - xRequest = XMLRPC_RequestNew(); - - if(xRequest) { - XMLRPC_RequestSetOutputOptions(xRequest, &out.xmlrpc_out); - if (Z_TYPE_PP(method) == IS_NULL) { - XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response); - } else { - XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_PP(method)); - XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); - } - if (Z_TYPE_PP(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); - } - - outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); - if(outBuf) { - RETVAL_STRING(outBuf, 1); - free(outBuf); - } - XMLRPC_RequestFree(xRequest, 1); - } - } - - if (out.xmlrpc_out.xml_elem_opts.encoding != ENCODING_DEFAULT) { - efree(out.xmlrpc_out.xml_elem_opts.encoding); - } -} -/* }}} */ - -/* {{{ proto string xmlrpc_encode(mixed value) - Generates XML for a PHP value */ -PHP_FUNCTION(xmlrpc_encode) -{ - XMLRPC_VALUE xOut = NULL; - zval **arg1; - char *outBuf; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if( return_value_used ) { - /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC); - - /* generate raw xml from xmlrpc data */ - outBuf = XMLRPC_VALUE_ToXML(xOut, 0); - - if(xOut) { - if(outBuf) { - RETVAL_STRING(outBuf, 1); - free(outBuf); - } - /* cleanup */ - XMLRPC_CleanupValue(xOut); - } - } -} -/* }}} */ - - -zval* decode_request_worker (zval* xml_in, zval* encoding_in, zval* method_name_out) -{ - zval* retval = NULL; - XMLRPC_REQUEST response; - STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS opts = {{0}}; - opts.xml_elem_opts.encoding = encoding_in ? utf8_get_encoding_id_from_string(Z_STRVAL_P(encoding_in)) : ENCODING_DEFAULT; - - /* generate XMLRPC_REQUEST from raw xml */ - response = XMLRPC_REQUEST_FromXML(Z_STRVAL_P(xml_in), Z_STRLEN_P(xml_in), &opts); - if(response) { - /* convert xmlrpc data to native php types */ - retval = XMLRPC_to_PHP(XMLRPC_RequestGetData(response)); - - if(XMLRPC_RequestGetRequestType(response) == xmlrpc_request_call) { - if(method_name_out) { - convert_to_string(method_name_out); - Z_TYPE_P(method_name_out) = IS_STRING; - Z_STRVAL_P(method_name_out) = estrdup(XMLRPC_RequestGetMethodName(response)); - Z_STRLEN_P(method_name_out) = strlen(Z_STRVAL_P(method_name_out)); - } - } - - /* dust, sweep, and mop */ - XMLRPC_RequestFree(response, 1); - } - return retval; -} - -/* {{{ proto array xmlrpc_decode_request(string xml, string& method [, string encoding]) - Decodes XML into native PHP types */ -PHP_FUNCTION(xmlrpc_decode_request) -{ - zval **xml, **method, **encoding = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || (zend_get_parameters_ex(argc, &xml, &method, &encoding) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(xml); - convert_to_string_ex(method); - if(argc == 3) { - convert_to_string_ex(encoding); - } - - if(return_value_used) { - zval* retval = decode_request_worker(*xml, encoding ? *encoding : NULL, *method); - if(retval) { - *return_value = *retval; - FREE_ZVAL(retval); - } - } -} -/* }}} */ - - -/* {{{ proto array xmlrpc_decode(string xml [, string encoding]) - Decodes XML into native PHP types */ -PHP_FUNCTION(xmlrpc_decode) -{ - zval **arg1, **arg2 = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || (zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - if(argc == 2) { - convert_to_string_ex(arg2); - } - - if(return_value_used) { - zval* retval = decode_request_worker(*arg1, arg2 ? *arg2 : NULL, NULL); - if(retval) { - *return_value = *retval; - FREE_ZVAL(retval); - } - } -} -/* }}} */ - - -/************************* -* server related methods * -*************************/ - -/* {{{ proto resource xmlrpc_server_create(void) - Creates an xmlrpc server */ -PHP_FUNCTION(xmlrpc_server_create) -{ - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if(return_value_used) { - zval *method_map, *introspection_map; - xmlrpc_server_data *server = emalloc(sizeof(xmlrpc_server_data)); - MAKE_STD_ZVAL(method_map); - MAKE_STD_ZVAL(introspection_map); - - array_init(method_map); - array_init(introspection_map); - - /* allocate server data. free'd in destroy_server_data() */ - server->method_map = method_map; - server->introspection_map = introspection_map; - server->server_ptr = XMLRPC_ServerCreate(); - - XMLRPC_ServerRegisterIntrospectionCallback(server->server_ptr, php_xmlrpc_introspection_callback); - - /* store for later use */ - ZEND_REGISTER_RESOURCE(return_value,server, le_xmlrpc_server); - } -} -/* }}} */ - -/* {{{ proto int xmlrpc_server_destroy(resource server) - Destroys server resources */ -PHP_FUNCTION(xmlrpc_server_destroy) -{ - zval **arg1; - int bSuccess = FAILURE; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if(Z_TYPE_PP(arg1) == IS_RESOURCE) { - int type; - - xmlrpc_server_data *server = zend_list_find(Z_LVAL_PP(arg1), &type); - - if(server && type == le_xmlrpc_server) { - bSuccess = zend_list_delete(Z_LVAL_PP(arg1)); - - /* called by hashtable destructor - * destroy_server_data(server); - */ - } - } - RETVAL_LONG(bSuccess == SUCCESS); -} -/* }}} */ - - -/* called by xmlrpc C engine as method handler for all registered methods. - * it then calls the corresponding PHP function to handle the method. - */ -static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRequest, void* data) -{ - xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data; - zval* xmlrpc_params; - zval* callback_params[3]; - TSRMLS_FETCH(); - - /* convert xmlrpc to native php types */ - xmlrpc_params = XMLRPC_to_PHP(XMLRPC_RequestGetData(xRequest)); - - /* setup data hoojum */ - callback_params[0] = pData->xmlrpc_method; - callback_params[1] = xmlrpc_params; - callback_params[2] = pData->caller_params; - - /* Use same C function for all methods */ - - /* php func prototype: function user_func($method_name, $xmlrpc_params, $user_params) */ - call_user_function(CG(function_table), NULL, pData->php_function, pData->return_data, 3, callback_params TSRMLS_CC); - - pData->php_executed = 1; - - zval_dtor(xmlrpc_params); - FREE_ZVAL(xmlrpc_params); - - return NULL; -} - -/* called by the C server when it first receives an introspection request. We pass this on to - * our PHP listeners, if any - */ -static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data) -{ - zval *retval_ptr, **php_function; - zval* callback_params[1]; - xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(retval_ptr); - Z_TYPE_P(retval_ptr) = IS_NULL; - - /* setup data hoojum */ - callback_params[0] = pData->caller_params; - - /* loop through and call all registered callbacks */ - zend_hash_internal_pointer_reset(Z_ARRVAL_P(pData->server->introspection_map)); - while(1) { - if(zend_hash_get_current_data(Z_ARRVAL_P(pData->server->introspection_map), - (void**)&php_function) == SUCCESS) { - - /* php func prototype: function string user_func($user_params) */ - if(call_user_function(CG(function_table), NULL, *php_function, - retval_ptr, 1, callback_params TSRMLS_CC) == SUCCESS) { - XMLRPC_VALUE xData; - STRUCT_XMLRPC_ERROR err = {0}; - - /* return value should be a string */ - convert_to_string(retval_ptr); - - xData = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_P(retval_ptr), &err); - - if(xData) { - if(!XMLRPC_ServerAddIntrospectionData(server, xData)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", Z_STRVAL_PP(php_function)); - } - XMLRPC_CleanupValue(xData); - } - else { - /* could not create description */ - if(err.xml_elem_error.parser_code) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()", - err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, Z_STRVAL_PP(php_function)); - } - else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s()", - Z_STRVAL_PP(php_function)); - } - } - } - else { - /* user func failed */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling user introspection callback: %s()", Z_STRVAL_PP(php_function)); - } - } - else { - break; - } - - zend_hash_move_forward(Z_ARRVAL_P(pData->server->introspection_map)); - } - - /* so we don't call the same callbacks ever again */ - zend_hash_clean(Z_ARRVAL_P(pData->server->introspection_map)); -} - -/* {{{ proto bool xmlrpc_server_register_method(resource server, string method_name, string function) - Register a PHP function to handle method matching method_name */ -PHP_FUNCTION(xmlrpc_server_register_method) -{ - zval **method_key, **method_name, **handle, *method_name_save; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 3 || (zend_get_parameters_ex(3, &handle, &method_key, &method_name) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* register with C engine. every method just calls our standard callback, - * and it then dispatches to php as necessary - */ - if(XMLRPC_ServerRegisterMethod(server->server_ptr, Z_STRVAL_PP(method_key), php_xmlrpc_callback)) { - /* save for later use */ - MAKE_STD_ZVAL(method_name_save); - *method_name_save = **method_name; - zval_copy_ctor(method_name_save); - - /* register our php method */ - add_zval(server->method_map, Z_STRVAL_PP(method_key), &method_name_save); - - RETURN_BOOL(1); - } - } - RETURN_BOOL(0); -} -/* }}} */ - - -/* {{{ proto bool xmlrpc_server_register_introspection_callback(resource server, string function) - Register a PHP function to generate documentation */ -PHP_FUNCTION(xmlrpc_server_register_introspection_callback) -{ - zval **method_name, **handle, *method_name_save; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &handle, &method_name) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* save for later use */ - MAKE_STD_ZVAL(method_name_save); - *method_name_save = **method_name; - zval_copy_ctor(method_name_save); - - /* register our php method */ - add_zval(server->introspection_map, NULL, &method_name_save); - - RETURN_BOOL(1); - } - RETURN_BOOL(0); -} -/* }}} */ - - -/* this function is itchin for a re-write */ - -/* {{{ proto mixed xmlrpc_server_call_method(resource server, string xml, mixed user_data [, array output_options]) - Parses XML requests and call methods */ -PHP_FUNCTION(xmlrpc_server_call_method) -{ - xmlrpc_callback_data data = {0}; - XMLRPC_REQUEST xRequest; - STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS input_opts; - xmlrpc_server_data* server; - zval **rawxml, **caller_params, **handle, **output_opts = NULL; - int type; - php_output_options out; - int argc =ZEND_NUM_ARGS(); - - if (argc < 3 || argc > 4 || (zend_get_parameters_ex(argc, &handle, &rawxml, &caller_params, &output_opts) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - /* user output options */ - if (argc == 3) { - set_output_options(&out, NULL); - } - else { - set_output_options(&out, *output_opts); - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* HACK: use output encoding for now */ - input_opts.xml_elem_opts.encoding = utf8_get_encoding_id_from_string(out.xmlrpc_out.xml_elem_opts.encoding); - - /* generate an XMLRPC_REQUEST from the raw xml input */ - xRequest = XMLRPC_REQUEST_FromXML(Z_STRVAL_PP(rawxml), Z_STRLEN_PP(rawxml), &input_opts); - - if(xRequest) { - const char* methodname = XMLRPC_RequestGetMethodName(xRequest); - zval **php_function; - XMLRPC_VALUE xAnswer = NULL; - MAKE_STD_ZVAL(data.xmlrpc_method); /* init. very important. spent a frustrating day finding this out. */ - MAKE_STD_ZVAL(data.return_data); - Z_TYPE_P(data.return_data) = IS_NULL; /* in case value is never init'd, we don't dtor to think it is a string or something */ - Z_TYPE_P(data.xmlrpc_method) = IS_NULL; - - if (!methodname) { - methodname = ""; - } - - /* setup some data to pass to the callback function */ - Z_STRVAL_P(data.xmlrpc_method) = estrdup(methodname); - Z_STRLEN_P(data.xmlrpc_method) = strlen(methodname); - Z_TYPE_P(data.xmlrpc_method) = IS_STRING; - data.caller_params = *caller_params; - data.php_executed = 0; - data.server = server; - - /* check if the called method has been previous registered */ - if(zend_hash_find(Z_ARRVAL_P(server->method_map), - Z_STRVAL_P(data.xmlrpc_method), - Z_STRLEN_P(data.xmlrpc_method) + 1, - (void**)&php_function) == SUCCESS) { - - data.php_function = *php_function; - } - - /* We could just call the php method directly ourselves at this point, but we do this - * with a C callback in case the xmlrpc library ever implements some cool usage stats, - * or somesuch. - */ - xAnswer = XMLRPC_ServerCallMethod(server->server_ptr, xRequest, &data); - if(xAnswer && out.b_php_out) { - zval_dtor(data.return_data); - FREE_ZVAL(data.return_data); - data.return_data = XMLRPC_to_PHP(xAnswer); - } else if(data.php_executed && !out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); - } - - /* should we return data as xml? */ - if(!out.b_php_out) { - XMLRPC_REQUEST xResponse = XMLRPC_RequestNew(); - if(xResponse) { - char *outBuf = 0; - int buf_len = 0; - - /* automagically determine output serialization type from request type */ - if (out.b_auto_version) { - XMLRPC_REQUEST_OUTPUT_OPTIONS opts = XMLRPC_RequestGetOutputOptions(xRequest); - if (opts) { - out.xmlrpc_out.version = opts->version; - } - } - /* set some required request hoojum */ - XMLRPC_RequestSetOutputOptions(xResponse, &out.xmlrpc_out); - XMLRPC_RequestSetRequestType(xResponse, xmlrpc_request_response); - XMLRPC_RequestSetData(xResponse, xAnswer); - XMLRPC_RequestSetMethodName(xResponse, methodname); - - /* generate xml */ - outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len); - if(outBuf) { - RETVAL_STRINGL(outBuf, buf_len, 1); - free(outBuf); - } - /* cleanup after ourselves. what a sty! */ - XMLRPC_RequestFree(xResponse, 0); - } - } else { /* or as native php types? */ - *return_value = *data.return_data; - zval_copy_ctor(return_value); - } - - /* cleanup after ourselves. what a sty! */ - zval_dtor(data.xmlrpc_method); - FREE_ZVAL(data.xmlrpc_method); - zval_dtor(data.return_data); - FREE_ZVAL(data.return_data); - - if(xAnswer) { - XMLRPC_CleanupValue(xAnswer); - } - - XMLRPC_RequestFree(xRequest, 1); - } - } -} -/* }}} */ - - -/* {{{ proto int xmlrpc_server_add_introspection_data(resource server, array desc) - Adds introspection documentation */ -PHP_FUNCTION(xmlrpc_server_add_introspection_data) -{ - zval **handle, **desc; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &handle, &desc) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC); - if (xDesc) { - int retval = XMLRPC_ServerAddIntrospectionData(server->server_ptr, xDesc); - XMLRPC_CleanupValue(xDesc); - RETURN_LONG(retval); - } - } - RETURN_LONG(0); -} -/* }}} */ - - -/* {{{ proto array xmlrpc_parse_method_descriptions(string xml) - Decodes XML into a list of method descriptions */ -PHP_FUNCTION(xmlrpc_parse_method_descriptions) -{ - zval **arg1, *retval; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - - if(return_value_used) { - STRUCT_XMLRPC_ERROR err = {0}; - XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_PP(arg1), &err); - if(xVal) { - retval = XMLRPC_to_PHP(xVal); - - if(retval) { - *return_value = *retval; - zval_copy_ctor(return_value); - } - /* dust, sweep, and mop */ - XMLRPC_CleanupValue(xVal); - } else { - /* could not create description */ - if(err.xml_elem_error.parser_code) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data", - err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data"); - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error. no method description created"); - } - } -} -/* }}} */ - - -/************ -* type data * -************/ - -#define XMLRPC_TYPE_COUNT 9 -#define XMLRPC_VECTOR_TYPE_COUNT 4 -#define TYPE_STR_MAP_SIZE (XMLRPC_TYPE_COUNT + XMLRPC_VECTOR_TYPE_COUNT) - -/* return a string matching a given xmlrpc type */ -static const char** get_type_str_mapping(void) -{ - static const char* str_mapping[TYPE_STR_MAP_SIZE]; - static int first = 1; - if (first) { - /* warning. do not add/delete without changing size define */ - str_mapping[xmlrpc_none] = "none"; - str_mapping[xmlrpc_empty] = "empty"; - str_mapping[xmlrpc_base64] = "base64"; - str_mapping[xmlrpc_boolean] = "boolean"; - str_mapping[xmlrpc_datetime] = "datetime"; - str_mapping[xmlrpc_double] = "double"; - str_mapping[xmlrpc_int] = "int"; - str_mapping[xmlrpc_string] = "string"; - str_mapping[xmlrpc_vector] = "vector"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_none] = "none"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_array] = "array"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_mixed] = "mixed"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_struct] = "struct"; - first = 0; - } - return (const char**)str_mapping; -} - -/* map an xmlrpc type to a string */ -const char* xmlrpc_type_as_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype) -{ - const char** str_mapping = get_type_str_mapping(); - - if (vtype == xmlrpc_vector_none) { - return str_mapping[type]; - } else { - return str_mapping[XMLRPC_TYPE_COUNT + vtype]; - } -} - -/* map a string to an xmlrpc type */ -XMLRPC_VALUE_TYPE xmlrpc_str_as_type(const char* str) -{ - const char** str_mapping = get_type_str_mapping(); - int i; - - if (str) { - for (i = 0; i < XMLRPC_TYPE_COUNT; i++) { - if (!strcmp(str_mapping[i], str)) { - return (XMLRPC_VALUE_TYPE) i; - } - } - } - return xmlrpc_none; -} - -/* map a string to an xmlrpc vector type */ -XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str) -{ - const char** str_mapping = get_type_str_mapping(); - int i; - - if (str) { - for (i = XMLRPC_TYPE_COUNT; i < TYPE_STR_MAP_SIZE; i++) { - if (!strcmp(str_mapping[i], str)) { - return (XMLRPC_VECTOR_TYPE) (i - XMLRPC_TYPE_COUNT); - } - } - } - return xmlrpc_none; -} - - -/* set a given value to a particular type. - * note: this only works on strings, and only for date and base64, - * which do not have native php types. black magic lies herein. - */ -int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) -{ - int bSuccess = FAILURE; - TSRMLS_FETCH(); - - /* we only really care about strings because they can represent - * base64 and datetime. all other types have corresponding php types - */ - if (Z_TYPE_P(value) == IS_STRING) { - if (newtype == xmlrpc_base64 || newtype == xmlrpc_datetime) { - const char* typestr = xmlrpc_type_as_str(newtype, xmlrpc_vector_none); - zval* type; - - MAKE_STD_ZVAL(type); - - Z_TYPE_P(type) = IS_STRING; - Z_STRVAL_P(type) = estrdup(typestr); - Z_STRLEN_P(type) = strlen(typestr); - - if(newtype == xmlrpc_datetime) { - XMLRPC_VALUE v = XMLRPC_CreateValueDateTime_ISO8601(NULL, value->value.str.val); - if(v) { - time_t timestamp = XMLRPC_GetValueDateTime(v); - if(timestamp) { - pval* ztimestamp; - - MAKE_STD_ZVAL(ztimestamp); - - ztimestamp->type = IS_LONG; - ztimestamp->value.lval = timestamp; - - convert_to_object(value); - if(SUCCESS == zend_hash_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL)) { - bSuccess = zend_hash_update(Z_OBJPROP_P(value), OBJECT_VALUE_TS_ATTR, sizeof(OBJECT_VALUE_TS_ATTR), (void *) &ztimestamp, sizeof(zval *), NULL); - } - } - XMLRPC_CleanupValue(v); - } - } - else { - convert_to_object(value); - bSuccess = zend_hash_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL); - } - } - } - - return bSuccess; -} - -/* return xmlrpc type of a php value */ -XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval** newvalue) -{ - XMLRPC_VALUE_TYPE type = xmlrpc_none; - TSRMLS_FETCH(); - - if (value) { - switch (Z_TYPE_P(value)) { - case IS_NULL: - type = xmlrpc_base64; - break; -#ifndef BOOL_AS_LONG - - /* Right thing to do, but it breaks some legacy code. */ - case IS_BOOL: - type = xmlrpc_boolean; - break; -#else - case IS_BOOL: -#endif - case IS_LONG: - case IS_RESOURCE: - type = xmlrpc_int; - break; - case IS_DOUBLE: - type = xmlrpc_double; - break; - case IS_CONSTANT: - type = xmlrpc_string; - break; - case IS_STRING: - type = xmlrpc_string; - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - type = xmlrpc_vector; - break; - case IS_OBJECT: - { - zval** attr; - type = xmlrpc_vector; - - if (zend_hash_find(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void**) &attr) == SUCCESS) { - if (Z_TYPE_PP(attr) == IS_STRING) { - type = xmlrpc_str_as_type(Z_STRVAL_PP(attr)); - } - } - break; - } - } - - /* if requested, return an unmolested (magic removed) copy of the value */ - if (newvalue) { - zval** val; - - if ((type == xmlrpc_base64 && Z_TYPE_P(value) != IS_NULL) || type == xmlrpc_datetime) { - if (zend_hash_find(Z_OBJPROP_P(value), OBJECT_VALUE_ATTR, sizeof(OBJECT_VALUE_ATTR), (void**) &val) == SUCCESS) { - *newvalue = *val; - } - } else { - *newvalue = value; - } - } - } - - return type; -} - - -/* {{{ proto bool xmlrpc_set_type(string value, string type) - Sets xmlrpc type, base64 or datetime, for a PHP string value */ -PHP_FUNCTION(xmlrpc_set_type) -{ - zval **arg, **type; - XMLRPC_VALUE_TYPE vtype; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &arg, &type) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(type); - vtype = xmlrpc_str_as_type(Z_STRVAL_PP(type)); - if (vtype != xmlrpc_none) { - if (set_zval_xmlrpc_type(*arg, vtype) == SUCCESS) { - RETURN_TRUE; - } - } else { - zend_error(E_WARNING,"invalid type '%s' passed to xmlrpc_set_type()", Z_STRVAL_PP(type)); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string xmlrpc_get_type(mixed value) - Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings */ -PHP_FUNCTION(xmlrpc_get_type) -{ - zval **arg; - XMLRPC_VALUE_TYPE type; - XMLRPC_VECTOR_TYPE vtype = xmlrpc_vector_none; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - type = get_zval_xmlrpc_type(*arg, 0); - if (type == xmlrpc_vector) { - vtype = determine_vector_type(Z_ARRVAL_PP(arg)); - } - - RETURN_STRING((char*) xmlrpc_type_as_str(type, vtype), 1); -} -/* }}} */ - -/* {{{ proto bool xmlrpc_is_fault(array) - Determines if an array value represents an XMLRPC fault. */ -PHP_FUNCTION(xmlrpc_is_fault) -{ - zval **arg, **val; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(arg) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array argument expected"); - } else { - /* The "correct" way to do this would be to call the xmlrpc - * library XMLRPC_ValueIsFault() func. However, doing that - * would require us to create an xmlrpc value from the php - * array, which is rather expensive, especially if it was - * a big array. Thus, we resort to this not so clever hackery. - */ - if (zend_hash_find(Z_ARRVAL_PP(arg), FAULT_CODE, FAULT_CODE_LEN + 1, (void**) &val) == SUCCESS && - zend_hash_find(Z_ARRVAL_PP(arg), FAULT_STRING, FAULT_STRING_LEN + 1, (void**) &val) == SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - diff --git a/ext/xmlrpc/xmlrpc.dsp b/ext/xmlrpc/xmlrpc.dsp deleted file mode 100644 index 8c455d3fcd775..0000000000000 --- a/ext/xmlrpc/xmlrpc.dsp +++ /dev/null @@ -1,211 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlrpc - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlrpc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlrpc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlrpc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlrpc - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x1009 /d "_DEBUG" -# ADD RSC /l 0x1009 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_xmlrpc.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "xmlrpc - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x1009 /d "NDEBUG" -# ADD RSC /l 0x1009 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlrpc.dll" /libpath:"..\..\Release_TS" - -!ENDIF - -# Begin Target - -# Name "xmlrpc - Win32 Debug_TS" -# Name "xmlrpc - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=".\xmlrpc-epi-php.c" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlrpc.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "libxmlrpc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\libxmlrpc\base64.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\base64.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\encodings.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\encodings.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\queue.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\queue.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\simplestring.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\simplestring.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\system_methods.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\system_methods_private.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_element.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_element.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_dandarpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_dandarpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_soap.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_soap.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_xmlrpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_xmlrpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection_private.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_private.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/xmlwriter/CREDITS b/ext/xmlwriter/CREDITS deleted file mode 100644 index d3a9ebe1bb8cd..0000000000000 --- a/ext/xmlwriter/CREDITS +++ /dev/null @@ -1,3 +0,0 @@ -XMLWriter -Rob Richards -Pierre-Alain Joye diff --git a/ext/xmlwriter/TODO b/ext/xmlwriter/TODO deleted file mode 100644 index bfc895d769194..0000000000000 --- a/ext/xmlwriter/TODO +++ /dev/null @@ -1,5 +0,0 @@ -- Fix up config file for PHP 5 to use libxml extension configuration -- Add tests for Namespace functions/methods -- Sync with xmlwriter (new dtd func?) -- Write documentations in docbook - diff --git a/ext/xmlwriter/config.m4 b/ext/xmlwriter/config.m4 deleted file mode 100644 index a1952b38797ed..0000000000000 --- a/ext/xmlwriter/config.m4 +++ /dev/null @@ -1,61 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN([PHP_XMLWRITER_CHECK_VERSION],[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$XMLWRITER_DIR/include$XMLWRITER_DIR_ADD - AC_MSG_CHECKING(for libxml version) - AC_EGREP_CPP(yes,[ -#include -#if LIBXML_VERSION >= 20600 - yes -#endif - ],[ - AC_MSG_RESULT(>= 2.6.0) - ],[ - AC_MSG_ERROR(libxml version 2.6.0 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS -]) - -PHP_ARG_WITH(xmlwriter, for XMLWriter support, -[ --with-xmlwriter Include XMLWriter support.]) - -if test "$PHP_XMLWRITER" != "no"; then - - XMLWRITER_DIR_ADD="" - if test -r $PHP_XMLWRITER/include/libxml2/libxml/xmlwriter.h; then - XMLWRITER_DIR=$PHP_XMLWRITER - XMLWRITER_DIR_ADD="/libxml2" - elif test -r $PHP_XMLWRITER/include/libxml/xmlwriter.h; then - XMLWRITER_DIR=$PHP_XMLWRITER - else - for i in /usr/local /usr; do - test -r $i/include/libxml/xmlwriter.h && XMLWRITER_DIR=$i - test -r $i/include/libxml2/libxml/xmlwriter.h && XMLWRITER_DIR=$i && XMLWRITER_DIR_ADD="/libxml2" - done - fi - - if test -z "$XMLWRITER_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libxml >= 2.6.0 distribution) - fi - - PHP_XMLWRITER_CHECK_VERSION - - XML2_CONFIG=$XMLWRITER_DIR/bin/xml2-config - - if test -x $XML2_CONFIG; then - XMLWRITER_LIBS=`$XML2_CONFIG --libs` - PHP_EVAL_LIBLINE($XMLWRITER_LIBS, XMLWRITER_SHARED_LIBADD) - else - PHP_ADD_LIBRARY_WITH_PATH($XMLWRITER_LIBNAME, $XMLWRITER_DIR/lib, XMLWRITER_SHARED_LIBADD) - fi - - PHP_ADD_INCLUDE($XMLWRITER_DIR/include$XMLWRITER_DIR_ADD) - - AC_DEFINE(HAVE_XMLWRITER,1,[ ]) - PHP_NEW_EXTENSION(xmlwriter, php_xmlwriter.c, $ext_shared) - PHP_SUBST(XMLWRITER_SHARED_LIBADD) -fi diff --git a/ext/xmlwriter/config.w32 b/ext/xmlwriter/config.w32 deleted file mode 100644 index c18b2c13fd5e3..0000000000000 --- a/ext/xmlwriter/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xmlwriter", "XMLWriter support", "no"); - -if (PHP_XMLWRITER == "yes" && PHP_LIBXML == "yes") { - if (CHECK_HEADER_ADD_INCLUDE('libxml/xmlwriter.h', 'CFLAGS_XMLWRITER', PHP_XMLWRITER)) { - EXTENSION("xmlwriter", "php_xmlwriter.c"); - AC_DEFINE("HAVE_XMLWRITER", 1, "XMLWriter support"); - if (!PHP_XMLWRITER_SHARED) { - ADD_FLAG("CFLAGS_XMLWRITER", "/D LIBXML_STATIC"); - } - ADD_EXTENSION_DEP('xmlwriter', 'libxml'); - } else { - WARNING('Could not find xmlwriter.h'); - } -} - diff --git a/ext/xmlwriter/examples/xmlwriter_file.php b/ext/xmlwriter/examples/xmlwriter_file.php deleted file mode 100644 index 13bb262334bb7..0000000000000 --- a/ext/xmlwriter/examples/xmlwriter_file.php +++ /dev/null @@ -1,44 +0,0 @@ -openUri('test.xml'); -$xw->startDocument("1.0"); -$xw->startElement("book"); -$xw->text("example"); -$xw->endElement(); -$xw->endDocument(); -$xw->flush(0); diff --git a/ext/xmlwriter/package.xml b/ext/xmlwriter/package.xml deleted file mode 100644 index bc104a470ad64..0000000000000 --- a/ext/xmlwriter/package.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - xmlwriter - Provides fast, non-cached, forward-only means to write XML data. - - This extension wraps the libxml xmlWriter API. Represents a writer that - provides a non-cached, forward-only means of generating streams or files - containing XML data. - - PHP License - - - rrichards - Rob Richards - rrichards@php.net - lead - - - - pajoye - Pierre-Alain Joye - pierre.dev@gmail.com - developer - - - 2.0.0 - 2005-08-07 - stable - - fix tests using UTF-8 - move to stable state - - - - - - 1.1.0 - 2005-05-24 - beta - - Add OO interface (php5 only) - Add test cases - - - - 1.0 - 2005-05-02 - stable - - Many Bug Fixes - Use PHP streams under PHP 4 - Add xmlwriter_flush function to flush buffer - Add support for xmlTextWriterStart/EndComment - - - - 0.1 - 2004-07-20 - alpha - Initial Release - - - 0.2 - 2004-10-08 - alpha - Fix bug 2482 and other function parameters - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xmlwriter/package2.xml b/ext/xmlwriter/package2.xml deleted file mode 100644 index c1871f0260154..0000000000000 --- a/ext/xmlwriter/package2.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - xmlwriter - pecl.php.net - Provides fast, non-cached, forward-only means to write XML data. - - This extension wraps the libxml xmlWriter API. Represents a writer that - provides a non-cached, forward-only means of generating streams or files - containing XML data. - - - Rob Richards - rrichards - rrichards@php.net - yes - - - Pierre-Alain Joye - pajoye - pajoye@php.net - yes - - 2005-08-07 - - - 2.0.0 - 2.0.0 - - - stable - stable - - PHP - Promote to stable - - - - - - - - - - - - - - - - - - - - - - 4.3.0 - - - 1.4.0a2 - - - - xmlwriter - - diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c deleted file mode 100644 index e9e632d23ea18..0000000000000 --- a/ext/xmlwriter/php_xmlwriter.c +++ /dev/null @@ -1,1831 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xmlwriter.h" - -zend_class_entry *xmlwriter_class_entry; - -/* {{{ xmlwriter_object_free_storage */ -static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC) -{ - if (intern) { - if (intern->ptr) { - xmlFreeTextWriter(intern->ptr); - intern->ptr = NULL; - } - if (intern->output) { - xmlBufferFree(intern->output); - intern->output = NULL; - } - efree(intern); - } -} -/* }}} */ - -#ifdef ZEND_ENGINE_2 -/* {{{ XMLWRITER_FROM_OBJECT */ -#define XMLWRITER_FROM_OBJECT(intern, object) \ - { \ - ze_xmlwriter_object *obj = (ze_xmlwriter_object*) zend_object_store_get_object(object TSRMLS_CC); \ - intern = obj->xmlwriter_ptr; \ - if (!intern) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized XMLWriter object"); \ - RETURN_FALSE; \ - } \ - } -/* }}} */ - -static zend_object_handlers xmlwriter_object_handlers; - -/* {{{ xmlwriter_object_free_storage */ -static void xmlwriter_object_free_storage(void *object TSRMLS_DC) -{ - ze_xmlwriter_object * intern = (ze_xmlwriter_object *) object; - if (!intern) { - return; - } - if (intern->xmlwriter_ptr) { - xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC); - } - intern->xmlwriter_ptr = NULL; - if (intern->zo.properties) { - zend_hash_destroy(intern->zo.properties); - FREE_HASHTABLE(intern->zo.properties); - } - - efree(intern); -} -/* }}} */ - - -/* {{{ xmlwriter_object_new */ -PHP_XMLWRITER_API zend_object_value xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC) -{ - ze_xmlwriter_object *intern; - zval *tmp; - zend_object_value retval; - - intern = emalloc(sizeof(ze_xmlwriter_object)); - intern->zo.ce = class_type; - intern->zo.in_get = 0; - intern->zo.in_set = 0; - intern->zo.properties = NULL; - - ALLOC_HASHTABLE(intern->zo.properties); - zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, - NULL, - (zend_objects_free_object_storage_t) xmlwriter_object_free_storage, - NULL TSRMLS_CC); - - retval.handlers = (zend_object_handlers *) & xmlwriter_object_handlers; - - return retval; -} -/* }}} */ -#endif - -#define XMLW_NAME_CHK(__err) \ - if (xmlValidateName((xmlChar *) name, 0) != 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, #__err); \ - RETURN_FALSE; \ - } \ - -/* {{{ xmlwriter_functions */ -static zend_function_entry xmlwriter_functions[] = { - PHP_FE(xmlwriter_open_uri, NULL) - PHP_FE(xmlwriter_open_memory, NULL) -#if LIBXML_VERSION >= 20605 - PHP_FE(xmlwriter_set_indent, NULL) - PHP_FE(xmlwriter_set_indent_string, NULL) -#endif -#if LIBXML_VERSION >= 20607 - PHP_FE(xmlwriter_start_comment, NULL) - PHP_FE(xmlwriter_end_comment, NULL) -#endif - PHP_FE(xmlwriter_start_attribute, NULL) - PHP_FE(xmlwriter_end_attribute, NULL) - PHP_FE(xmlwriter_write_attribute, NULL) -#if LIBXML_VERSION > 20617 - PHP_FE(xmlwriter_start_attribute_ns,NULL) -#endif - PHP_FE(xmlwriter_start_element, NULL) - PHP_FE(xmlwriter_end_element, NULL) - PHP_FE(xmlwriter_start_element_ns, NULL) - PHP_FE(xmlwriter_write_element, NULL) - PHP_FE(xmlwriter_write_element_ns, NULL) - PHP_FE(xmlwriter_start_pi, NULL) - PHP_FE(xmlwriter_end_pi, NULL) - PHP_FE(xmlwriter_write_pi, NULL) - PHP_FE(xmlwriter_start_cdata, NULL) - PHP_FE(xmlwriter_end_cdata, NULL) - PHP_FE(xmlwriter_write_cdata, NULL) - PHP_FE(xmlwriter_text, NULL) - PHP_FE(xmlwriter_start_document, NULL) - PHP_FE(xmlwriter_end_document, NULL) - PHP_FE(xmlwriter_write_comment, NULL) - PHP_FE(xmlwriter_start_dtd, NULL) - PHP_FE(xmlwriter_end_dtd, NULL) - PHP_FE(xmlwriter_write_dtd, NULL) - PHP_FE(xmlwriter_start_dtd_element, NULL) - PHP_FE(xmlwriter_end_dtd_element, NULL) - PHP_FE(xmlwriter_output_memory, NULL) - PHP_FE(xmlwriter_flush, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -#ifdef ZEND_ENGINE_2 -/* {{{ xmlwriter_class_functions */ -static zend_function_entry xmlwriter_class_functions[] = { - PHP_ME_MAPPING(openUri, xmlwriter_open_uri, NULL) - PHP_ME_MAPPING(openMemory, xmlwriter_open_memory, NULL) -#if LIBXML_VERSION >= 20605 - PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL) - PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL) -#endif -#if LIBXML_VERSION >= 20607 - PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL) - PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL) -#endif - PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, NULL) - PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, NULL) - PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, NULL) -#if LIBXML_VERSION > 20617 - PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL) -#endif - PHP_ME_MAPPING(startElement, xmlwriter_start_element, NULL) - PHP_ME_MAPPING(endElement, xmlwriter_end_element, NULL) - PHP_ME_MAPPING(startElementNs, xmlwriter_start_element_ns, NULL) - PHP_ME_MAPPING(writeElement, xmlwriter_write_element, NULL) - PHP_ME_MAPPING(writeElementNs, xmlwriter_write_element_ns, NULL) - PHP_ME_MAPPING(startPi, xmlwriter_start_pi, NULL) - PHP_ME_MAPPING(endPi, xmlwriter_end_pi, NULL) - PHP_ME_MAPPING(writePi, xmlwriter_write_pi, NULL) - PHP_ME_MAPPING(startCdata, xmlwriter_start_cdata, NULL) - PHP_ME_MAPPING(endCdata, xmlwriter_end_cdata, NULL) - PHP_ME_MAPPING(writeCdata, xmlwriter_write_cdata, NULL) - PHP_ME_MAPPING(text, xmlwriter_text, NULL) - PHP_ME_MAPPING(startDocument, xmlwriter_start_document, NULL) - PHP_ME_MAPPING(endDocument, xmlwriter_end_document, NULL) - PHP_ME_MAPPING(writeComment, xmlwriter_write_comment, NULL) - PHP_ME_MAPPING(startDtd, xmlwriter_start_dtd, NULL) - PHP_ME_MAPPING(endDtd, xmlwriter_end_dtd, NULL) - PHP_ME_MAPPING(writeDtd, xmlwriter_write_dtd, NULL) - PHP_ME_MAPPING(startDtdElement, xmlwriter_start_dtd_element, NULL) - PHP_ME_MAPPING(endDtdElement, xmlwriter_end_dtd_element, NULL) - PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL) - PHP_ME_MAPPING(flush, xmlwriter_flush, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ -#endif - -/* {{{ function prototypes */ -PHP_MINIT_FUNCTION(xmlwriter); -PHP_MSHUTDOWN_FUNCTION(xmlwriter); -PHP_MINFO_FUNCTION(xmlwriter); - -static int le_xmlwriter; -/* }}} */ - -/* _xmlwriter_get_valid_file_path should be made a - common function in libxml extension as code is common to a few xml extensions */ -/* {{{ _xmlwriter_get_valid_file_path */ -char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr(source, ":"); - xmlParseURIReference(uri, escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */ - if (! VCWD_REALPATH(source, resolved_path)) { - expand_filepath(source, resolved_path TSRMLS_CC); - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} -/* }}} */ - -#ifndef ZEND_ENGINE_2 -/* Channel libxml file io layer through the PHP streams subsystem. - * This allows use of ftps:// and https:// urls */ - -/* {{{ php_xmlwriter_streams_IO_open_write_wrapper */ -static void *php_xmlwriter_streams_IO_open_write_wrapper(const char *filename TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - void *ret_val = NULL; - - ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, NULL); - return ret_val; -} -/* }}} */ - -/* {{{ php_xmlwriter_streams_IO_write */ -int php_xmlwriter_streams_IO_write(void *context, const char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_write((php_stream*)context, buffer, len); -} -/* }}} */ - -/* {{{ xmlwriter_objects_clone */ -int php_xmlwriter_streams_IO_close(void *context) -{ - TSRMLS_FETCH(); - return php_stream_close((php_stream*)context); -} -/* }}} */ -#endif - -/* {{{ xmlwriter_module_entry - */ -zend_module_entry xmlwriter_module_entry = { - STANDARD_MODULE_HEADER, - "xmlwriter", - xmlwriter_functions, - PHP_MINIT(xmlwriter), - PHP_MSHUTDOWN(xmlwriter), - NULL, - NULL, - PHP_MINFO(xmlwriter), - "0.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XMLWRITER -ZEND_GET_MODULE(xmlwriter) -#endif - -/* {{{ xmlwriter_objects_clone */ -void xmlwriter_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - /* TODO */ -} -/* }}} */ - -/* {{{ xmlwriter_dtor */ -static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { - xmlwriter_object *intern; - - intern = (xmlwriter_object *) rsrc->ptr; - xmlwriter_free_resource_ptr(intern TSRMLS_CC); -} -/* }}} */ - -#if LIBXML_VERSION >= 20605 -/* {{{ proto bool xmlwriter_set_indent(resource xmlwriter, bool) -Toggle indentation on/off - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_set_indent) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; - zend_bool indent; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &pind, &indent) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &pind, &indent) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - - ptr = intern->ptr; - if (ptr) { - retval = xmlTextWriterSetIndent(ptr, indent); - if (retval == 0) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_set_indent_string(resource xmlwriter, string indentString) -Set string used for indenting - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_set_indent_string) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *indent; - int indent_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &indent, &indent_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &indent, &indent_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterSetIndentString(ptr, indent); - if (retval == 0) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -#endif - -/* {{{ proto bool xmlwriter_start_attribute(resource xmlwriter, string name) -Create start attribute - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_attribute) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartAttribute(ptr, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - switch (type) { - case 0: - retval = xmlTextWriterEndAttribute(ptr); - break; - case 1: - retval = xmlTextWriterEndElement(ptr); - break; - case 2: - retval = xmlTextWriterEndPI(ptr); - break; - case 3: - retval = xmlTextWriterEndCDATA(ptr); - break; - case 4: - retval = xmlTextWriterEndComment(ptr); - break; - case 5: - retval = xmlTextWriterEndDocument(ptr); - break; - case 6: - retval = xmlTextWriterEndDTD(ptr); - break; - case 7: - retval = xmlTextWriterEndDTDElement(ptr); - break; - case 8: - retval = xmlTextWriterEndDTDAttlist(ptr); - break; - case 9: - retval = xmlTextWriterEndDTDEntity(ptr); - break; - default: - retval = -1; - break; - } - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} - - -/* {{{ proto bool xmlwriter_end_attribute(resource xmlwriter) -End attribute - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_attribute) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -#if LIBXML_VERSION > 20617 -/* {{{ proto bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri) -Create start namespaced attribute - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_attribute_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri; - int name_len, prefix_len, uri_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartAttributeNS(ptr, prefix, name, uri); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ -#endif - -/* {{{ proto bool xmlwriter_write_attribute(resource xmlwriter, string name, string content) -Write full attribute - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_attribute) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteAttribute(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content) -Write full namespaced attribute - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_attribute_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri, *content; - int name_len, prefix_len, uri_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteAttributeNS(ptr, prefix, name, uri, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_element(resource xmlwriter, string name) -Create start element tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartElement(ptr, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - - -/* {{{ proto bool xmlwriter_start_element_ns(resource xmlwriter, string prefix, string name, string uri) -Create start namespaced element tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_element_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri; - int name_len, prefix_len, uri_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartElementNS(ptr, prefix, name, uri); - if (retval != -1) { - RETURN_TRUE; - } - - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_element(resource xmlwriter) -End current element - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_element) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_element(resource xmlwriter, string name, string content) -Write full element tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteElement(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_element_ns(resource xmlwriter, string prefix, string name, string uri, string content) -Write full namesapced element tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_element_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri, *content; - int name_len, prefix_len, uri_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteElementNS(ptr, prefix, name, uri, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_pi(resource xmlwriter, string target) -Create start PI tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_pi) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid PI Target"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartPI(ptr, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_pi(resource xmlwriter) -End current PI - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_pi) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_pi(resource xmlwriter, string target, string content) -Write full PI tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_pi) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid PI Target"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWritePI(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_cdata(resource xmlwriter) -Create start CDATA tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_cdata) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartCDATA(ptr); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_cdata(resource xmlwriter) -End current CDATA - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_cdata) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_cdata(resource xmlwriter, string content) -Write full CDATA tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_cdata) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *content; - int content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, - &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteCDATA(ptr, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_text(resource xmlwriter, string content) -Write text - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_text) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *content; - int content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &content, &content_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteString(ptr, content); - if (retval) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -#if LIBXML_VERSION >= 20607 -/* {{{ proto bool xmlwriter_start_comment(resource xmlwriter) -Create start comment - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_comment) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartComment(ptr); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_comment(resource xmlwriter) -Create end comment - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_comment) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 4); -} -/* }}} */ -#endif /* LIBXML_VERSION >= 20607 */ - - -/* {{{ proto bool xmlwriter_write_comment(resource xmlwriter, string content) -Write full comment tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_comment) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *content; - int content_len, retval; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, - &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteComment(ptr, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_document(resource xmlwriter, string version, string encoding, string standalone) -Create document tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_document) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *version = NULL, *enc = NULL, *alone = NULL; - int version_len, enc_len, alone_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDocument(ptr, version, enc, alone); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_document(resource xmlwriter) -End current document - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_document) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 5); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd(resource xmlwriter, string name, string pubid, string sysid) -Create start DTD tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_dtd) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *pubid = NULL, *sysid = NULL; - int name_len, pubid_len, sysid_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) { - return; - } - - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTD(ptr, name, pubid, sysid); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd(resource xmlwriter) -End current DTD - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_dtd) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 6); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd(resource xmlwriter, string name, string pubid, string sysid, string subset) -Write full DTD tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_dtd) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *pubid = NULL, *sysid = NULL, *subset = NULL; - int name_len, pubid_len, sysid_len, subset_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) { - return; - } - - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTD(ptr, name, pubid, sysid, subset); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd_element(resource xmlwriter, string name) -Create start DTD element - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_dtd_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTDElement(ptr, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_element(resource xmlwriter) -End current DTD element - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_dtd_element) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 7); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_element(resource xmlwriter, string name, string content) -Write full DTD element tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_dtd_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDElement(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd_attlist(resource xmlwriter, string name) -Create start DTD AttList - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_dtd_attlist) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTDAttlist(ptr, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_attlist(resource xmlwriter) -End current DTD AttList - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_dtd_attlist) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 8); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_attlist(resource xmlwriter, string name, string content) -Write full DTD AttList tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_dtd_attlist) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDAttlist(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd_entity(resource xmlwriter, string name, bool isparam) -Create start DTD Entity - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_start_dtd_entity) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - zend_bool isparm; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &name, &name_len, &isparm) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &pind, &name, &name_len, &isparm) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTDEntity(ptr, isparm, name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_entity(resource xmlwriter) -End current DTD Entity - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_end_dtd_entity) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 9); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content) -Write full DTD Entity tag - returns FALSE on error */ -PHP_FUNCTION(xmlwriter_write_dtd_entity) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDAttlist(ptr, name, content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto resource xmlwriter_open_uri(resource xmlwriter, string source) -Create new xmlwriter using source uri for output */ -PHP_FUNCTION(xmlwriter_open_uri) -{ - char *valid_file = NULL; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *source; - char resolved_path[MAXPATHLEN + 1]; - int source_len; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - ze_xmlwriter_object *ze_obj; -#endif - -#ifndef ZEND_ENGINE_2 - xmlOutputBufferPtr out_buffer; - void *ioctx; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) { - WRONG_PARAM_COUNT; - return; - } - -#ifdef ZEND_ENGINE_2 - if (this) { - // We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here - ze_obj = (ze_xmlwriter_object*) zend_object_store_get_object(this TSRMLS_CC); - } -#endif - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source"); - RETURN_FALSE; - } - - valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - RETURN_FALSE; - } - -#ifndef ZEND_ENGINE_2 - ioctx = php_xmlwriter_streams_IO_open_write_wrapper(valid_file TSRMLS_CC); - if (ioctx == NULL) { - RETURN_FALSE; - } - - out_buffer = xmlOutputBufferCreateIO(php_xmlwriter_streams_IO_write, - php_xmlwriter_streams_IO_close, ioctx, NULL); - - if (out_buffer == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer"); - RETURN_FALSE; - } - ptr = xmlNewTextWriter(out_buffer); -#else - ptr = xmlNewTextWriterFilename(valid_file, 0); -#endif - - if (!ptr) { - RETURN_FALSE; - } - - intern = emalloc(sizeof(xmlwriter_object)); - intern->ptr = ptr; - intern->output = NULL; -#ifndef ZEND_ENGINE_2 - intern->uri_output = out_buffer; -#else - if (this) { - ze_obj->xmlwriter_ptr = intern; - RETURN_TRUE; - } else -#endif - { - ZEND_REGISTER_RESOURCE(return_value,intern,le_xmlwriter); - } -} -/* }}} */ - -/* {{{ proto resource xmlwriter_open_memory() -Create new xmlwriter using memory for string output */ -PHP_FUNCTION(xmlwriter_open_memory) -{ - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - xmlBufferPtr buffer; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - ze_xmlwriter_object *ze_obj; -#endif - -#ifdef ZEND_ENGINE_2 - if (this) { - // We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here - ze_obj = (ze_xmlwriter_object*) zend_object_store_get_object(this TSRMLS_CC); - } -#endif - - buffer = xmlBufferCreate(); - - if (buffer == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer"); - RETURN_FALSE; - } - - ptr = xmlNewTextWriterMemory(buffer, 0); - if (! ptr) { - xmlBufferFree(buffer); - RETURN_FALSE; - } - - intern = emalloc(sizeof(xmlwriter_object)); - intern->ptr = ptr; - intern->output = buffer; -#ifndef ZEND_ENGINE_2 - intern->uri_output = NULL; -#else - if (this) { - ze_obj->xmlwriter_ptr = intern; - RETURN_TRUE; - } else -#endif - { - ZEND_REGISTER_RESOURCE(return_value,intern,le_xmlwriter); - } - -} -/* }}} */ - -/* {{{ php_xmlwriter_flush */ -static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string) { - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - xmlBufferPtr buffer; - zend_bool empty = 1; - int output_bytes; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &empty) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &pind, &empty) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - ptr = intern->ptr; - - if (ptr) { - buffer = intern->output; - if (force_string == 1 && buffer == NULL) { - RETURN_EMPTY_STRING(); - } - output_bytes = xmlTextWriterFlush(ptr); - if (buffer) { - RETVAL_STRING(buffer->content, 1); - if (empty) { - xmlBufferEmpty(buffer); - } - } else { - RETVAL_LONG(output_bytes); - } - return; - } - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ proto string xmlwriter_output_memory(resource xmlwriter [,bool flush]) -Output current buffer as string */ -PHP_FUNCTION(xmlwriter_output_memory) -{ - php_xmlwriter_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto mixed xmlwriter_flush(resource xmlwriter [,bool empty]) -Output current buffer */ -PHP_FUNCTION(xmlwriter_flush) -{ - php_xmlwriter_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(xmlwriter) -{ -#ifdef ZEND_ENGINE_2 - zend_class_entry ce; -#endif - - le_xmlwriter = zend_register_list_destructors_ex(xmlwriter_dtor, NULL, "xmlwriter", module_number); - -#ifdef ZEND_ENGINE_2 - memcpy(&xmlwriter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xmlwriter_object_handlers.clone_obj = NULL; - INIT_CLASS_ENTRY(ce, "XMLWriter", xmlwriter_class_functions); - ce.create_object = xmlwriter_object_new; - xmlwriter_class_entry_ce = zend_register_internal_class(&ce TSRMLS_CC); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(xmlwriter) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(xmlwriter) -{ - php_info_print_table_start(); - { - php_info_print_table_row(2, "XMLWriter", "enabled"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h deleted file mode 100644 index 1c3687e181903..0000000000000 --- a/ext/xmlwriter/php_xmlwriter.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XMLWRITER_H -#define PHP_XMLWRITER_H - -extern zend_module_entry xmlwriter_module_entry; -#define phpext_xmlwriter_ptr &xmlwriter_module_entry - -#ifdef PHP_WIN32 -#define PHP_XMLWRITER_API __declspec(dllexport) -#else -#define PHP_XMLWRITER_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include - -/* Resource struct, not the object :) */ -typedef struct _xmlwriter_object { - xmlTextWriterPtr ptr; - xmlBufferPtr output; -#ifndef ZEND_ENGINE_2 - xmlOutputBufferPtr uri_output; -#endif -} xmlwriter_object; - - -/* Extends zend object */ -typedef struct _ze_xmlwriter_object { - zend_object zo; - xmlwriter_object *xmlwriter_ptr; -} ze_xmlwriter_object; - -static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC); -static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -zend_class_entry *xmlwriter_class_entry_ce; - -#if LIBXML_VERSION >= 20605 -PHP_FUNCTION(xmlwriter_set_indent); -PHP_FUNCTION(xmlwriter_set_indent_string); -#endif -PHP_FUNCTION(xmlwriter_start_attribute); -PHP_FUNCTION(xmlwriter_end_attribute); -PHP_FUNCTION(xmlwriter_start_attribute_ns); -PHP_FUNCTION(xmlwriter_write_attribute); -#if LIBXML_VERSION > 20617 -PHP_FUNCTION(xmlwriter_write_attribute_ns); -#endif -PHP_FUNCTION(xmlwriter_start_element); -PHP_FUNCTION(xmlwriter_end_element); -PHP_FUNCTION(xmlwriter_start_element_ns); -PHP_FUNCTION(xmlwriter_write_element); -PHP_FUNCTION(xmlwriter_write_element_ns); -PHP_FUNCTION(xmlwriter_start_pi); -PHP_FUNCTION(xmlwriter_end_pi); -PHP_FUNCTION(xmlwriter_write_pi); -PHP_FUNCTION(xmlwriter_start_cdata); -PHP_FUNCTION(xmlwriter_end_cdata); -PHP_FUNCTION(xmlwriter_write_cdata); -PHP_FUNCTION(xmlwriter_text); -PHP_FUNCTION(xmlwriter_start_document); -PHP_FUNCTION(xmlwriter_end_document); -#if LIBXML_VERSION >= 20607 -PHP_FUNCTION(xmlwriter_start_comment); -PHP_FUNCTION(xmlwriter_end_comment); -#endif -PHP_FUNCTION(xmlwriter_write_comment); -PHP_FUNCTION(xmlwriter_start_dtd); -PHP_FUNCTION(xmlwriter_end_dtd); -PHP_FUNCTION(xmlwriter_write_dtd); -PHP_FUNCTION(xmlwriter_start_dtd_element); -PHP_FUNCTION(xmlwriter_end_dtd_element); -PHP_FUNCTION(xmlwriter_open_uri); -PHP_FUNCTION(xmlwriter_open_memory); -PHP_FUNCTION(xmlwriter_output_memory); -PHP_FUNCTION(xmlwriter_flush); - -#endif /* PHP_XMLWRITER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlwriter/tests/001.phpt b/ext/xmlwriter/tests/001.phpt deleted file mode 100644 index a9349d2d16c65..0000000000000 --- a/ext/xmlwriter/tests/001.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/002.phpt b/ext/xmlwriter/tests/002.phpt deleted file mode 100644 index f2537a47ff7dd..0000000000000 --- a/ext/xmlwriter/tests/002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/003.phpt b/ext/xmlwriter/tests/003.phpt deleted file mode 100644 index 5415797864e70..0000000000000 --- a/ext/xmlwriter/tests/003.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush, attribute ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - -Test text for tag1 -===DONE=== diff --git a/ext/xmlwriter/tests/004.phpt b/ext/xmlwriter/tests/004.phpt deleted file mode 100644 index 2d3e8587256a3..0000000000000 --- a/ext/xmlwriter/tests/004.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- - - -'); -unset($xw); -unlink('001.xml'); -if ($md5_out != $md5_res) { - echo "failed: $md5_res != $md5_out\n"; -} else { - echo "ok.\n"; -} -?> -===DONE=== ---EXPECT-- -ok. -===DONE=== diff --git a/ext/xmlwriter/tests/005.phpt b/ext/xmlwriter/tests/005.phpt deleted file mode 100644 index ab933c6f564b9..0000000000000 --- a/ext/xmlwriter/tests/005.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, comments ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_001.phpt b/ext/xmlwriter/tests/OO_001.phpt deleted file mode 100644 index be448b9c65bb3..0000000000000 --- a/ext/xmlwriter/tests/OO_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8', 'standalonearg'); -$xw->startElement("tag1"); -$xw->endDocument(); - -// Force to write and empty the buffer -$output_bytes = $xw->flush(true); -echo file_get_contents($doc_dest); -unset($xw); -unlink('001.xml'); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_002.phpt b/ext/xmlwriter/tests/OO_002.phpt deleted file mode 100644 index ec605f50a4ab9..0000000000000 --- a/ext/xmlwriter/tests/OO_002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->startDocument('1.0', 'UTF-8', 'standalone'); -$xw->startElement("tag1"); -$xw->endDocument(); - -// Force to write and empty the buffer -echo $xw->flush(true); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_003.phpt b/ext/xmlwriter/tests/OO_003.phpt deleted file mode 100644 index 7fb47910f0f92..0000000000000 --- a/ext/xmlwriter/tests/OO_003.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush, text, attribute ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); - -$res = $xw->startAttribute('attr1'); -$xw->text("attr1_value"); -$xw->endAttribute(); - -$res = $xw->startAttribute('attr2'); -$xw->text("attr2_value"); -$xw->endAttribute(); - -$xw->text("Test text for tag1"); -$res = $xw->startElement('tag2'); -if ($res < 1) { - echo "StartElement context validation failed\n"; - exit(); -} -$xw->endDocument(); - -// Force to write and empty the buffer -echo $xw->flush(true); -?> -===DONE=== ---EXPECT-- - -Test text for tag1 -===DONE=== diff --git a/ext/xmlwriter/tests/OO_004.phpt b/ext/xmlwriter/tests/OO_004.phpt deleted file mode 100644 index 08b423ccef29d..0000000000000 --- a/ext/xmlwriter/tests/OO_004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); - -$xw->startPi("PHP"); -$xw->text('echo $a;'); -$xw->endPi(); -$xw->endDocument(); - -// Force to write and empty the buffer -$xw->flush(true); -$md5_out = md5_file($doc_dest); -$md5_res = md5(' - -'); -unset($xw); -unlink('001.xml'); -if ($md5_out != $md5_res) { - echo "failed: $md5_res != $md5_out\n"; -} else { - echo "ok.\n"; -} -?> -===DONE=== ---EXPECT-- -ok. -===DONE=== diff --git a/ext/xmlwriter/tests/OO_005.phpt b/ext/xmlwriter/tests/OO_005.phpt deleted file mode 100644 index 2c6d2f43339ec..0000000000000 --- a/ext/xmlwriter/tests/OO_005.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, comments ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); -$xw->startComment(); -$xw->text('comment'); -$xw->endComment(); -$xw->writeComment("comment #2"); -$xw->endDocument(); - -// Force to write and empty the buffer -$output_bytes = $xw->flush(true); -echo file_get_contents($doc_dest); -unset($xw); -unlink('001.xml'); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/xmlwriter.dsp b/ext/xmlwriter/xmlwriter.dsp deleted file mode 100644 index e5eca77be5236..0000000000000 --- a/ext/xmlwriter/xmlwriter.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlwriter" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlwriter - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlwriter.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlwriter.mak" CFG="xmlwriter - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlwriter - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlwriter - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlwriter - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_XMLWRITER=1 /D "LIBXML_STATIC" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlwriter.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "xmlwriter - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "xmlwriter___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "xmlwriter___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib php4ts_debug.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "xmlwriter - Win32 Release_TS" -# Name "xmlwriter - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xmlwriter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlwriter.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xsl/CREDITS b/ext/xsl/CREDITS deleted file mode 100644 index 2f33c8874c0d9..0000000000000 --- a/ext/xsl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -XSL -Christian Stocker, Rob Richards diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4 deleted file mode 100644 index 08a11f29db391..0000000000000 --- a/ext/xsl/config.m4 +++ /dev/null @@ -1,67 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(xsl, for XSL support, -[ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18). - DIR is the libxslt install directory]) - -if test "$PHP_XSL" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XSL extension requires LIBXML extension, add --enable-libxml]) - fi - - if test "$PHP_DOM" = "no"; then - AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom]) - fi - - for i in $PHP_XSL /usr/local /usr; do - if test -x "$i/bin/xslt-config"; then - XSLT_CONFIG=$i/bin/xslt-config - break - fi - done - - if test -z "$XSLT_CONFIG"; then - AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.0.18 distribution]) - else - libxslt_full_version=`$XSLT_CONFIG --version` - ac_IFS=$IFS - IFS="." - set $libxslt_full_version - IFS=$ac_IFS - LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` - if test "$LIBXSLT_VERSION" -ge "1000018"; then - XSL_LIBS=`$XSLT_CONFIG --libs` - XSL_INCS=`$XSLT_CONFIG --cflags` - PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD) - PHP_EVAL_INCLINE($XSL_INCS) - - AC_MSG_CHECKING([for EXSLT support]) - for i in $PHP_XSL /usr/local /usr; do - if test -r "$i/include/libexslt/exslt.h"; then - PHP_XSL_EXSL_DIR=$i - break - fi - done - if test -z "$PHP_XSL_EXSL_DIR"; then - AC_MSG_RESULT(not found) - else - AC_MSG_RESULT(found) - PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include) - AC_DEFINE(HAVE_XSL_EXSLT,1,[ ]) - fi - else - AC_MSG_ERROR([libxslt version 1.0.18 or greater required.]) - fi - - - fi - - AC_DEFINE(HAVE_XSL,1,[ ]) - PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared) - PHP_SUBST(XSL_SHARED_LIBADD) - PHP_ADD_EXTENSION_DEP(xsl, libxml) -fi diff --git a/ext/xsl/config.w32 b/ext/xsl/config.w32 deleted file mode 100644 index 37da4bd630d19..0000000000000 --- a/ext/xsl/config.w32 +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ -// vim: ft=javascript - -ARG_WITH("xsl", "xsl support", "no"); - -if (PHP_XSL != "no") { - if (PHP_DOM == "yes" && PHP_LIBXML == "yes") { - var ext_xsl_lib_found = false; - var ext_exslt_lib_found = false; - - if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) { - ext_xsl_lib_found = true; - ADD_FLAG("CFLAGS_XSL", "/D LIBXSLT_STATIC "); - if (CHECK_LIB("libexslt_a.lib", "xsl", PHP_XSL)) { - ADD_FLAG("CFLAGS_XSL", "/D LIBEXSLT_STATIC "); - ext_exslt_lib_found = true; - } - } else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) { - ext_xsl_lib_found = true; - if (CHECK_LIB("libexslt.lib", "xsl", PHP_XSL)) { - ext_exslt_lib_found = true; - } - } - - if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) { - if (ext_exslt_lib_found) { - if (CHECK_HEADER_ADD_INCLUDE("libexslt\\exslt.h", "CFLAGS_XSL")) { - AC_DEFINE("HAVE_XSL_EXSLT", 1, ""); - } - } - EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED); - AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled"); - if (! PHP_XSL_SHARED) { - ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC"); - } else { - if (PHP_DEBUG == "yes") { - ADD_FLAG("LDFLAGS_XSL", "/nodefaultlib:msvcrt"); - } - } - ADD_EXTENSION_DEP('xsl', 'libxml'); - } else { - WARNING("xsl not enabled; libraries and headers not found"); - } - } else { - WARNING("xsl not enabled; DOM extension required"); - } -} diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c deleted file mode 100644 index 8ea0f83053a29..0000000000000 --- a/ext/xsl/php_xsl.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xsl.h" - - -/* If you declare any globals in php_xsl.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(xsl) -*/ -zend_class_entry *xsl_xsltprocessor_class_entry; -static zend_object_handlers xsl_object_handlers; - -/* {{{ xsl_functions[] - * - * Every user visible function must have an entry in xsl_functions[]. - */ -function_entry xsl_functions[] = { - {NULL, NULL, NULL} /* Must be the last line in xsl_functions[] */ -}; -/* }}} */ - -static zend_module_dep xsl_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; - -/* {{{ xsl_module_entry - */ -zend_module_entry xsl_module_entry = { -#if ZEND_MODULE_API_NO >= 20050617 - STANDARD_MODULE_HEADER_EX, NULL, - xsl_deps, -#elif ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "xsl", - xsl_functions, - PHP_MINIT(xsl), - PHP_MSHUTDOWN(xsl), - PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(xsl), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XSL -ZEND_GET_MODULE(xsl) -#endif - -/* {{{ xsl_objects_free_storage */ -void xsl_objects_free_storage(void *object TSRMLS_DC) -{ - xsl_object *intern = (xsl_object *)object; - - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); - - zend_hash_destroy(intern->parameter); - FREE_HASHTABLE(intern->parameter); - - zend_hash_destroy(intern->registered_phpfunctions); - FREE_HASHTABLE(intern->registered_phpfunctions); - - if (intern->node_list) { - zend_hash_destroy(intern->node_list); - FREE_HASHTABLE(intern->node_list); - } - - if (intern->doc) { - php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC); - efree(intern->doc); - } - - if (intern->ptr) { - /* free wrapper */ - if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { - ((xsltStylesheetPtr) intern->ptr)->_private = NULL; - } - - xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); - intern->ptr = NULL; - } - efree(object); -} -/* }}} */ -/* {{{ xsl_objects_new */ -zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - xsl_object *intern; - zval *tmp; - - intern = emalloc(sizeof(xsl_object)); - intern->std.ce = class_type; - intern->std.in_get = 0; - intern->std.in_set = 0; - intern->ptr = NULL; - intern->prop_handler = NULL; - intern->parameter = NULL; - intern->hasKeys = 0; - intern->registerPhpFunctions = 0; - intern->registered_phpfunctions = NULL; - intern->node_list = NULL; - intern->doc = NULL; - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - ALLOC_HASHTABLE(intern->parameter); - zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_HASHTABLE(intern->registered_phpfunctions); - zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = &xsl_object_handlers; - return retval; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(xsl) -{ - - zend_class_entry ce; - - memcpy(&xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xsl_object_handlers.clone_obj = NULL; - - REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry); -#if HAVE_XSL_EXSLT - exsltRegisterAll(); -#endif - - xsltRegisterExtModuleFunction ((const xmlChar *) "functionString", - (const xmlChar *) "http://php.net/xsl", - xsl_ext_function_string_php); - xsltRegisterExtModuleFunction ((const xmlChar *) "function", - (const xmlChar *) "http://php.net/xsl", - xsl_ext_function_object_php); - - REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSL_CLONE_ALWAYS", 1, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ xsl_object_get_data */ -zval *xsl_object_get_data(void *obj) -{ - zval *dom_wrapper; - dom_wrapper = ((xsltStylesheetPtr) obj)->_private; - return dom_wrapper; -} -/* }}} */ - -/* {{{ xsl_object_set_data */ -static void xsl_object_set_data(void *obj, zval *wrapper TSRMLS_DC) -{ - ((xsltStylesheetPtr) obj)->_private = wrapper; -} -/* }}} */ - -/* {{{ php_xsl_set_object */ -void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC) -{ - xsl_object *object; - - object = (xsl_object *)zend_objects_get_address(wrapper TSRMLS_CC); - object->ptr = obj; - xsl_object_set_data(obj, wrapper TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_xsl_create_object */ -zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC) -{ - zval *wrapper; - zend_class_entry *ce; - - *found = 0; - - if (!obj) { - if(!wrapper_in) { - ALLOC_ZVAL(wrapper); - } else { - wrapper = wrapper_in; - } - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) xsl_object_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - if(!wrapper_in) { - wrapper = return_value; - } else { - wrapper = wrapper_in; - } - - - ce = xsl_xsltprocessor_class_entry; - - if(!wrapper_in) { - object_init_ex(wrapper, ce); - } - php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC); - return (wrapper); -} -/* }}} */ - - - - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(xsl) -{ - /* uncomment this line if you have INI entries - UNREGISTER_INI_ENTRIES(); - */ - - xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString", - (const xmlChar *) "http://php.net/xsl"); - xsltUnregisterExtModuleFunction ((const xmlChar *) "function", - (const xmlChar *) "http://php.net/xsl"); - - xsltCleanupGlobals(); - - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request start */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request end */ -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, NULL); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(xsl) -{ - php_info_print_table_start(); - { - char buffer[128]; - int major, minor, subminor; - - php_info_print_table_row(2, "XSL", "enabled"); - major = xsltLibxsltVersion/10000; - minor = (xsltLibxsltVersion - major * 10000) / 100; - subminor = (xsltLibxsltVersion - major * 10000 - minor * 100); - snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor); - php_info_print_table_row(2, "libxslt Version", buffer); - major = xsltLibxmlVersion/10000; - minor = (xsltLibxmlVersion - major * 10000) / 100; - subminor = (xsltLibxmlVersion - major * 10000 - minor * 100); - snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor); - php_info_print_table_row(2, "libxslt compiled against libxml Version", buffer); - } -#if HAVE_XSL_EXSLT - php_info_print_table_row(2, "EXSLT", "enabled"); - php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION); -#endif - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h deleted file mode 100644 index a2f9dfcc95c89..0000000000000 --- a/ext/xsl/php_xsl.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XSL_H -#define PHP_XSL_H - -extern zend_module_entry xsl_module_entry; -#define phpext_xsl_ptr &xsl_module_entry - -#ifdef PHP_WIN32 -#define PHP_XSL_API __declspec(dllexport) -#else -#define PHP_XSL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include -#include -#if HAVE_XSL_EXSLT -#include -#include -#endif - -#include "../dom/xml_common.h" -#include "xsl_fe.h" - -#include -#include - -typedef struct _xsl_object { - zend_object std; - void *ptr; - HashTable *prop_handler; - zend_object_handle handle; - HashTable *parameter; - int hasKeys; - int registerPhpFunctions; - HashTable *registered_phpfunctions; - HashTable *node_list; - php_libxml_node_object *doc; -} xsl_object; - -void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC); -void xsl_objects_free_storage(void *object TSRMLS_DC); -zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC); - -void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs); -void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs); - -#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = xsl_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); - -#define XSL_DOMOBJ_NEW(zval, obj, ret) \ - if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - - - -PHP_MINIT_FUNCTION(xsl); -PHP_MSHUTDOWN_FUNCTION(xsl); -PHP_RINIT_FUNCTION(xsl); -PHP_RSHUTDOWN_FUNCTION(xsl); -PHP_MINFO_FUNCTION(xsl); - - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(xsl) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(xsl) -*/ - -/* In every utility function you add that needs to use variables - in php_xsl_globals, call TSRM_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as XSL_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v) -#else -#define XSL_G(v) (xsl_globals.v) -#endif - -#endif /* PHP_XSL_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xsl/tests/area_list.xsl b/ext/xsl/tests/area_list.xsl deleted file mode 100644 index e0c88c6215a53..0000000000000 --- a/ext/xsl/tests/area_list.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - HERE - - diff --git a/ext/xsl/tests/area_name.xml b/ext/xsl/tests/area_name.xml deleted file mode 100644 index 76cea58511edc..0000000000000 --- a/ext/xsl/tests/area_name.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 13 - "²Ñ‚²" ĵ. - m."Avtovo" - - - - - diff --git a/ext/xsl/tests/bug26384.phpt b/ext/xsl/tests/bug26384.phpt deleted file mode 100644 index b8f80f8c3ea58..0000000000000 --- a/ext/xsl/tests/bug26384.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #26384 (domxslt->process causes segfault with xsl:key) ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/area_name.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/area_list.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - -$proc->importStylesheet($xsl); -print $proc->transformToXml($dom); - -//this segfaulted before -print $dom->documentElement->firstChild->nextSibling->nodeName; - ---EXPECT-- -HERE -ROW diff --git a/ext/xsl/tests/bug33853.phpt b/ext/xsl/tests/bug33853.phpt deleted file mode 100755 index bcf30f65a36ae..0000000000000 --- a/ext/xsl/tests/bug33853.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #33853 (php:function call __autoload with lowercase param) ---SKIPIF-- - ---FILE-- -loadXML(' - - - - -'); -$inputdom = new DomDocument(); -$inputdom->loadXML(' -'); - -$proc = new XsltProcessor(); -$proc->registerPhpFunctions(); -$xsl = $proc->importStylesheet($xsl); -$newdom = $proc->transformToDoc($inputdom); -?> -===DONE=== ---EXPECT-- -string(4) "TeSt" diff --git a/ext/xsl/tests/documentxpath.xsl b/ext/xsl/tests/documentxpath.xsl deleted file mode 100644 index 0e5c5c181d737..0000000000000 --- a/ext/xsl/tests/documentxpath.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ext/xsl/tests/exslt.xml b/ext/xsl/tests/exslt.xml deleted file mode 100644 index 54913c6f5d83f..0000000000000 --- a/ext/xsl/tests/exslt.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ext/xsl/tests/exslt.xsl b/ext/xsl/tests/exslt.xsl deleted file mode 100644 index 8f0baef6ca8fe..0000000000000 --- a/ext/xsl/tests/exslt.xsl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Test Date : - - year : - - leap-year : - - month-in-year : - - month-name : - - month-abbreviation : - - week-in-year : - - day-in-year : - - day-in-month : - - day-of-week-in-month : - - day-in-week : - - day-name : - - day-abbreviation : - - time : - - hour-in-day : - - minute-in-hour : - - second-in-minute : - - - diff --git a/ext/xsl/tests/prepare.inc b/ext/xsl/tests/prepare.inc deleted file mode 100644 index bd5bbee40cbc8..0000000000000 --- a/ext/xsl/tests/prepare.inc +++ /dev/null @@ -1,20 +0,0 @@ -load(dirname(__FILE__)."/xslt.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/xslt.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - -?> diff --git a/ext/xsl/tests/skipif.inc b/ext/xsl/tests/skipif.inc deleted file mode 100644 index 0ef73723a3b8b..0000000000000 --- a/ext/xsl/tests/skipif.inc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/xsl/tests/streamsinclude.xsl b/ext/xsl/tests/streamsinclude.xsl deleted file mode 100644 index 6f8bc40ed9ac8..0000000000000 --- a/ext/xsl/tests/streamsinclude.xsl +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ext/xsl/tests/xslt.xml b/ext/xsl/tests/xslt.xml deleted file mode 100644 index b0e9506c7bf3e..0000000000000 --- a/ext/xsl/tests/xslt.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - Title - - - - - - - - a1 - b1 - c1 - - - a2 - c2 - - - ä3 - b3 - c3 - - - - - - diff --git a/ext/xsl/tests/xslt.xsl b/ext/xsl/tests/xslt.xsl deleted file mode 100644 index 8331ccc2b56fe..0000000000000 --- a/ext/xsl/tests/xslt.xsl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
              - - -
              -
              diff --git a/ext/xsl/tests/xslt.xsl.gz b/ext/xsl/tests/xslt.xsl.gz deleted file mode 100644 index 910bb63c8e32f..0000000000000 Binary files a/ext/xsl/tests/xslt.xsl.gz and /dev/null differ diff --git a/ext/xsl/tests/xslt001.phpt b/ext/xsl/tests/xslt001.phpt deleted file mode 100644 index 885e7c9824e56..0000000000000 --- a/ext/xsl/tests/xslt001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test 1: Transform To XML String ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 1: Transform To XML String - -bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt002.phpt b/ext/xsl/tests/xslt002.phpt deleted file mode 100644 index 6c9f0c632c844..0000000000000 --- a/ext/xsl/tests/xslt002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test 2: Transform To HTML String ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@method"); -if ($res->length != 1) { - print "No or more than one xsl:output/@method found"; - exit; -} -$res->item(0)->value = "html"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 2: Transform To HTML String -bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt003.phpt b/ext/xsl/tests/xslt003.phpt deleted file mode 100644 index a3c848b1b72de..0000000000000 --- a/ext/xsl/tests/xslt003.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test 3: Using Parameters ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -$proc->setParameter( "", "foo","hello world"); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 3: Using Parameters - -hello world -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt004.phpt b/ext/xsl/tests/xslt004.phpt deleted file mode 100644 index 6e8f47601805e..0000000000000 --- a/ext/xsl/tests/xslt004.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test 4: Checking UTF8 Output ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@encoding"); -if ($res->length != 1) { - print "No or more than one xsl:output/@encoding found"; - exit; -} -$res->item(0)->value = "utf-8"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 4: Checking UTF8 Output - -bar -a1 b1 c1
              -a2 c2
              -¤3 b3 c3
              - diff --git a/ext/xsl/tests/xslt005.phpt b/ext/xsl/tests/xslt005.phpt deleted file mode 100644 index a70e6ea4f1a7d..0000000000000 --- a/ext/xsl/tests/xslt005.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test 5: Checking Indent ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@indent"); -if ($res->length != 1) { - print "No or more than one xsl:output/@indent found"; - exit; -} -$res->item(0)->value = "yes"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 5: Checking Indent - - - bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - - diff --git a/ext/xsl/tests/xslt006.phpt b/ext/xsl/tests/xslt006.phpt deleted file mode 100644 index 26fada1650028..0000000000000 --- a/ext/xsl/tests/xslt006.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test 6: Transform To Doc ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -$doc = $proc->transformToDoc($dom); -print $doc->saveXML(); -print "\n"; - - ---EXPECT-- -Test 6: Transform To Doc - -bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt007.phpt b/ext/xsl/tests/xslt007.phpt deleted file mode 100644 index bc6ad8477a417..0000000000000 --- a/ext/xsl/tests/xslt007.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test 7: Transform To Uri ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -$doc = $proc->transformToUri($dom, "file://".dirname(__FILE__)."/out.xml"); -print file_get_contents(dirname(__FILE__)."/out.xml"); -unlink(dirname(__FILE__)."/out.xml"); -print "\n"; - - ---EXPECT-- -Test 7: Transform To Uri - -bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt008.phpt b/ext/xsl/tests/xslt008.phpt deleted file mode 100644 index 0efc88e8c5e86..0000000000000 --- a/ext/xsl/tests/xslt008.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test 8: Stream Wrapper Includes ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/streamsinclude.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -chdir(dirname(__FILE__)); -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXML($dom); - - ---EXPECT-- -Test 8: Stream Wrapper Includes - -bar -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt009.phpt b/ext/xsl/tests/xslt009.phpt deleted file mode 100644 index f763e84daa6e7..0000000000000 --- a/ext/xsl/tests/xslt009.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test 9: Stream Wrapper XPath-Document() ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/documentxpath.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} - -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXML($dom); - - ---EXPECT-- -Test 9: Stream Wrapper XPath-Document() - -foo diff --git a/ext/xsl/tests/xslt010.phpt b/ext/xsl/tests/xslt010.phpt deleted file mode 100644 index 7c46d030f4eaa..0000000000000 --- a/ext/xsl/tests/xslt010.phpt +++ /dev/null @@ -1,112 +0,0 @@ ---TEST-- -Test 10: EXSLT Support ---SKIPIF-- -hasExsltSupport()) die('skip EXSLT support not available');?> ---FILE-- -load(dirname(__FILE__)."/exslt.xsl"); - $proc = new xsltprocessor; - $xsl = $proc->importStylesheet($dom); - - $xml = new DomDocument(); - $xml->load(dirname(__FILE__)."/exslt.xml"); - - print $proc->transformToXml($xml); ---EXPECT-- -Test 10: EXSLT Support - - - Test Date : 0001-12-31Z - year : 1 - leap-year : false - month-in-year : 12 - month-name : December - month-abbreviation : Dec - week-in-year : 53 - day-in-year : 365 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 2 - day-name : Monday - day-abbreviation : Mon - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 3000-01-31 - year : 3000 - leap-year : false - month-in-year : 1 - month-name : January - month-abbreviation : Jan - week-in-year : 5 - day-in-year : 31 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 6 - day-name : Friday - day-abbreviation : Fri - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 2000-02-29 - year : 2000 - leap-year : true - month-in-year : 2 - month-name : February - month-abbreviation : Feb - week-in-year : 8 - day-in-year : 60 - day-in-month : 29 - day-of-week-in-month : 5 - day-in-week : 3 - day-name : Tuesday - day-abbreviation : Tue - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 9990001-12-31Z - year : 9990001 - leap-year : false - month-in-year : 12 - month-name : December - month-abbreviation : Dec - week-in-year : 53 - day-in-year : 365 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 2 - day-name : Monday - day-abbreviation : Mon - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : -0004-02-29 - year : -4 - leap-year : true - month-in-year : 2 - month-name : February - month-abbreviation : Feb - week-in-year : 9 - day-in-year : 60 - day-in-month : 29 - day-of-week-in-month : 5 - day-in-week : 1 - day-name : Sunday - day-abbreviation : Sun - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN diff --git a/ext/xsl/tests/xslt011.phpt b/ext/xsl/tests/xslt011.phpt deleted file mode 100644 index 5f7865279e2ff..0000000000000 --- a/ext/xsl/tests/xslt011.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test 11: php:function Support ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/xslt011.xsl"); - $proc = new xsltprocessor; - $xsl = $proc->importStylesheet($dom); - - $xml = new DomDocument(); - $xml->load(dirname(__FILE__)."/xslt011.xml"); - $proc->registerPHPFunctions(); - print $proc->transformToXml($xml); - - function foobar($id, $secondArg = "" ) { - if (is_array($id)) { - return $id[0]->value . " - " . $secondArg; - } else { - return $id . " - " . $secondArg; - } - } - function nodeSet($id = null) { - if ($id and is_array($id)) { - return $id[0]; - } else { - $dom = new domdocument; - $dom->loadXML("this is from an external DomDocument"); - return $dom->documentElement; - } - } - function nonDomNode() { - return new foo(); - } - - class aClass { - static function aStaticFunction($id) { - return $id; - } - } - ---EXPECTF-- -Test 11: php:function Support - -Warning: XSLTProcessor::transformToXml(): A PHP Object can not be converted to a XPath-string in %s on line 16 - -foobar - secondArg -foobar - -this is from an external DomDocument -from the Input Document -static - diff --git a/ext/xsl/tests/xslt011.xml b/ext/xsl/tests/xslt011.xml deleted file mode 100644 index f40500b0f5ad0..0000000000000 --- a/ext/xsl/tests/xslt011.xml +++ /dev/null @@ -1 +0,0 @@ -This is from the Input Document diff --git a/ext/xsl/tests/xslt011.xsl b/ext/xsl/tests/xslt011.xsl deleted file mode 100644 index e1960e57d3beb..0000000000000 --- a/ext/xsl/tests/xslt011.xsl +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xsl/tests/xslt012.phpt b/ext/xsl/tests/xslt012.phpt deleted file mode 100644 index 60387af4cefef..0000000000000 --- a/ext/xsl/tests/xslt012.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test 12: Using Associative Array of Parameters ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/xslt.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/xslt012.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} - -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - - -$proc->importStylesheet($xsl); - -$parameters = Array( - 'foo' => 'barbar', - 'foo1' => 'test', - ); - -$proc->setParameter( "", $parameters); - -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 12: Using Associative Array of Parameters - -barbar -test -a1 b1 c1
              -a2 c2
              -ä3 b3 c3
              - diff --git a/ext/xsl/tests/xslt012.xsl b/ext/xsl/tests/xslt012.xsl deleted file mode 100644 index 27f413855f157..0000000000000 --- a/ext/xsl/tests/xslt012.xsl +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
              - - -
              -
              diff --git a/ext/xsl/xsl.dsp b/ext/xsl/xsl.dsp deleted file mode 100644 index ff7257d16121d..0000000000000 --- a/ext/xsl/xsl.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xsl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xsl - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xsl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xsl.mak" CFG="xsl - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xsl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xsl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xsl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 wsock32.lib php5ts.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xsl.dll" /implib:".Release_TS/php_xsl.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "xsl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xsl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt" - -!ENDIF - -# Begin Target - -# Name "xsl - Win32 Release_TS" -# Name "xsl - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xsl.c -# End Source File -# Begin Source File - -SOURCE=.\xsltprocessor.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xsl.h -# End Source File -# Begin Source File - -SOURCE=.\xsl_fe.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h deleted file mode 100644 index b58b7df67ad35..0000000000000 --- a/ext/xsl/xsl_fe.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef XSL_FE_H -#define XSL_FE_H - -extern zend_function_entry php_xsl_xsltprocessor_class_functions[]; -extern zend_class_entry *xsl_xsltprocessor_class_entry; - -PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml); -PHP_FUNCTION(xsl_xsltprocessor_set_parameter); -PHP_FUNCTION(xsl_xsltprocessor_get_parameter); -PHP_FUNCTION(xsl_xsltprocessor_remove_parameter); -PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support); -PHP_FUNCTION(xsl_xsltprocessor_register_php_functions); -#endif diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c deleted file mode 100644 index a8af3cf6cf69c..0000000000000 --- a/ext/xsl/xsltprocessor.c +++ /dev/null @@ -1,743 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_xsl.h" -#include "ext/libxml/php_libxml.h" - -/* -* class xsl_xsltprocessor -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -* Since: -*/ - -zend_function_entry php_xsl_xsltprocessor_class_functions[] = { - PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, NULL) - PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, NULL) - PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, NULL) - PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, NULL) - PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, NULL) - PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, NULL) - PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, NULL) - PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, NULL) - PHP_FALIAS(registerPHPFunctions, xsl_xsltprocessor_register_php_functions, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ -/* {{{ php_xsl_xslt_string_to_xpathexpr() - Translates a string to a XPath Expression */ -static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC) -{ - const xmlChar *string = (const xmlChar *)str; - - xmlChar *value; - int str_len; - - str_len = xmlStrlen(string) + 3; - - if (xmlStrchr(string, '"')) { - if (xmlStrchr(string, '\'')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)"); - return NULL; - } - value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0); - snprintf(value, str_len, "'%s'", string); - } else { - value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0); - snprintf(value, str_len, "\"%s\"", string); - } - return (char *) value; -} - - -/* {{{ php_xsl_xslt_make_params() - Translates a PHP array to a libxslt parameters array */ -static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS_DC) -{ - - int parsize; - zval **value; - char *xpath_expr, *string_key = NULL; - ulong num_key; - char **params = NULL; - int i = 0; - - parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *); - params = (char **)emalloc(parsize); - memset((char *)params, 0, parsize); - - for (zend_hash_internal_pointer_reset(parht); - zend_hash_get_current_data(parht, (void **)&value) == SUCCESS; - zend_hash_move_forward(parht)) { - - if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array"); - efree(params); - return NULL; - } else { - if (Z_TYPE_PP(value) != IS_STRING) { - SEPARATE_ZVAL(value); - convert_to_string(*value); - } - - if (!xpath_params) { - xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC); - } else { - xpath_expr = estrndup(Z_STRVAL_PP(value), strlen(Z_STRVAL_PP(value))); - } - if (xpath_expr) { - params[i++] = string_key; - params[i++] = xpath_expr; - } - } - } - - params[i++] = NULL; - - return params; -} -/* }}} */ - - -static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) -{ - xsltTransformContextPtr tctxt; - zval **args; - zval *retval; - int result, i, ret; - int error = 0; - zend_fcall_info fci; - zval handler; - xmlXPathObjectPtr obj; - char *str; - zval callable; - xsl_object *intern; - - TSRMLS_FETCH(); - - if (! zend_is_executing(TSRMLS_C)) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: Function called from outside of PHP\n"); - error = 1; - } else { - tctxt = xsltXPathGetTransformContext(ctxt); - if (tctxt == NULL) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: failed to get the transformation context\n"); - error = 1; - } else { - intern = (xsl_object *) tctxt->_private; - if (intern == NULL) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: failed to get the internal object\n"); - error = 1; - } - else if (intern->registerPhpFunctions == 0) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: PHP Object did not register PHP functions\n"); - error = 1; - } - } - } - - if (error == 1) { - for (i = nargs - 1; i >= 0; i--) { - obj = valuePop(ctxt); - xmlXPathFreeObject(obj); - } - return; - } - - fci.param_count = nargs - 1; - if (fci.param_count > 0) { - fci.params = safe_emalloc(fci.param_count, sizeof(zval**), 0); - args = safe_emalloc(fci.param_count, sizeof(zval *), 0); - } - /* Reverse order to pop values off ctxt stack */ - for (i = nargs - 2; i >= 0; i--) { - obj = valuePop(ctxt); - MAKE_STD_ZVAL(args[i]); - switch (obj->type) { - case XPATH_STRING: - ZVAL_STRING(args[i], obj->stringval, 1); - break; - case XPATH_BOOLEAN: - ZVAL_BOOL(args[i], obj->boolval); - break; - case XPATH_NUMBER: - ZVAL_DOUBLE(args[i], obj->floatval); - break; - case XPATH_NODESET: - if (type == 1) { - str = xmlXPathCastToString(obj); - ZVAL_STRING(args[i], str, 1); - xmlFree(str); - } else if (type == 2) { - int j; - dom_object *domintern = (dom_object *)intern->doc; - array_init(args[i]); - if (obj->nodesetval && obj->nodesetval->nodeNr > 0) { - for (j = 0; j < obj->nodesetval->nodeNr; j++) { - xmlNodePtr node = obj->nodesetval->nodeTab[j]; - zval *child; - MAKE_STD_ZVAL(child); - /* not sure, if we need this... it's copied from xpath.c */ - if (node->type == XML_NAMESPACE_DECL) { - xmlNsPtr curns; - xmlNodePtr nsparent; - - nsparent = node->_private; - curns = xmlNewNs(NULL, node->name, NULL); - if (node->children) { - curns->prefix = xmlStrdup((char *) node->children); - } - if (node->children) { - node = xmlNewDocNode(node->doc, NULL, (char *) node->children, node->name); - } else { - node = xmlNewDocNode(node->doc, NULL, "xmlns", node->name); - } - node->type = XML_NAMESPACE_DECL; - node->parent = nsparent; - node->ns = curns; - } - child = php_dom_create_object(node, &ret, NULL, child, domintern TSRMLS_CC); - add_next_index_zval(args[i], child); - } - } - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php:function object type %d is not supported yet", obj->type); - ZVAL_STRING(args[i], "", 0); - } - xmlXPathFreeObject(obj); - fci.params[i] = &args[i]; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - - obj = valuePop(ctxt); - if (obj->stringval == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string"); - xmlXPathFreeObject(obj); - if (fci.param_count > 0) { - for (i = 0; i < nargs - 1; i++) { - zval_ptr_dtor(&args[i]); - } - efree(args); - efree(fci.params); - } - return; - } - INIT_PZVAL(&handler); - ZVAL_STRING(&handler, obj->stringval, 1); - xmlXPathFreeObject(obj); - - fci.function_name = &handler; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval; - fci.no_separation = 0; - /*fci.function_handler_cache = &function_ptr;*/ - if (!zend_make_callable(&handler, &callable TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %R()", Z_TYPE(callable), Z_UNIVAL(callable)); - - } else if ( intern->registerPhpFunctions == 2 && zend_u_hash_exists(intern->registered_phpfunctions, Z_TYPE(callable), Z_UNIVAL(callable), Z_UNILEN(callable) + 1) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%R()'.", Z_TYPE(callable), Z_UNIVAL(callable)); - // Push an empty string, so that we at least have an xslt result... - valuePush(ctxt, xmlXPathNewString("")); - } else { - result = zend_call_function(&fci, NULL TSRMLS_CC); - if (result == FAILURE) { - if (Z_TYPE(handler) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler)); - } - /* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */ - } else if (retval == NULL) { - } else { - if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { - xmlNode *nodep; - dom_object *obj; - if (intern->node_list == NULL) { - ALLOC_HASHTABLE(intern->node_list); - zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0); - } - zval_add_ref(&retval); - zend_hash_next_index_insert(intern->node_list, &retval, sizeof(zval *), NULL); - obj = (dom_object *)zend_object_store_get_object(retval TSRMLS_CC); - nodep = dom_object_get_node(obj); - valuePush(ctxt, xmlXPathNewNodeSet(nodep)); - } else if (retval->type == IS_BOOL) { - valuePush(ctxt, xmlXPathNewBoolean(retval->value.lval)); - } else if (retval->type == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object can not be converted to a XPath-string"); - valuePush(ctxt, xmlXPathNewString("")); - } else { - convert_to_string_ex(&retval); - valuePush(ctxt, xmlXPathNewString( Z_STRVAL_P(retval))); - } - zval_ptr_dtor(&retval); - } - } - zval_dtor(&callable); - zval_dtor(&handler); - if (fci.param_count > 0) { - for (i = 0; i < nargs - 1; i++) { - zval_ptr_dtor(&args[i]); - } - efree(args); - efree(fci.params); - } -} - -void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs) -{ - xsl_ext_function_php(ctxt, nargs, 1); -} - -void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs) -{ - xsl_ext_function_php(ctxt, nargs, 2); -} - - -/* {{{ proto void xsl_xsltprocessor_import_stylesheet(domdocument doc); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -Since: -*/ -PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet) -{ - zval *id, *docp = NULL; - xmlDoc *doc = NULL, *newdoc = NULL; - xsltStylesheetPtr sheetp, oldsheetp; - xsl_object *intern; - int prevSubstValue, prevExtDtdValue, clone_docu = 0; - xmlNode *nodep = NULL; - zend_object_handlers *std_hnd; - zval *cloneDocu, *member; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) { - RETURN_FALSE; - } - - nodep = php_libxml_import_node(docp TSRMLS_CC); - - if (nodep) { - doc = nodep->doc; - } - if (doc == NULL) { - php_error(E_WARNING, "Invalid Document"); - RETURN_NULL(); - } - - /* libxslt uses _private, so we must copy the imported - stylesheet document otherwise the node proxies will be a mess */ - newdoc = xmlCopyDoc(doc, 1); - xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL); - prevSubstValue = xmlSubstituteEntitiesDefault(1); - prevExtDtdValue = xmlLoadExtDtdDefaultValue; - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - - sheetp = xsltParseStylesheetDoc(newdoc); - xmlSubstituteEntitiesDefault(prevSubstValue); - xmlLoadExtDtdDefaultValue = prevExtDtdValue; - - if (!sheetp) { - xmlFreeDoc(newdoc); - RETURN_FALSE; - } - - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - std_hnd = zend_get_std_object_handlers(); - MAKE_STD_ZVAL(member); - ZVAL_STRING(member, "cloneDocument", 0); - cloneDocu = std_hnd->read_property(id, member, BP_VAR_IS TSRMLS_CC); - if (Z_TYPE_P(cloneDocu) != IS_NULL) { - convert_to_long(cloneDocu); - clone_docu = Z_LVAL_P(cloneDocu); - } - efree(member); - if (clone_docu == 0) { - /* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */ - nodep = xmlDocGetRootElement(sheetp->doc)->children; - while (nodep) { - if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) { - intern->hasKeys = 1; - break; - } - nodep = nodep->next; - } - } else { - intern->hasKeys = clone_docu; - } - - if ((oldsheetp = (xsltStylesheetPtr)intern->ptr)) { - /* free wrapper */ - if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { - ((xsltStylesheetPtr) intern->ptr)->_private = NULL; - } - xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); - intern->ptr = NULL; - } - - php_xsl_set_object(id, sheetp TSRMLS_CC); -} -/* }}} end xsl_xsltprocessor_import_stylesheet */ - - -static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) -{ - xmlDocPtr newdocp; - xmlDocPtr doc = NULL; - xmlNodePtr node = NULL; - xsltTransformContextPtr ctxt; - php_libxml_node_object *object; - char **params = NULL; - int clone; - - node = php_libxml_import_node(docp TSRMLS_CC); - - if (node) { - doc = node->doc; - } - if (doc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document"); - return NULL; - } - - if (style == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stylesheet associated to this object"); - return NULL; - } - if (intern->parameter) { - params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC); - } - - intern->doc = emalloc(sizeof(php_libxml_node_object)); - memset(intern->doc, 0, sizeof(php_libxml_node_object)); - - if (intern->hasKeys == 1) { - doc = xmlCopyDoc(doc, 1); - } else { - object = (php_libxml_node_object *)zend_object_store_get_object(docp TSRMLS_CC); - intern->doc->document = object->document; - } - - php_libxml_increment_doc_ref(intern->doc, doc TSRMLS_CC); - - ctxt = xsltNewTransformContext(style, doc); - ctxt->_private = (void *) intern; - - newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, NULL, NULL, ctxt); - - xsltFreeTransformContext(ctxt); - - if (intern->node_list != NULL) { - zend_hash_destroy(intern->node_list); - FREE_HASHTABLE(intern->node_list); - intern->node_list = NULL; - } - - php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC); - efree(intern->doc); - intern->doc = NULL; - - - if (params) { - clone = 0; - while(params[clone]) { - efree(params[clone++]); - } - efree(params); - } - - return newdocp; - -} - -/* {{{ proto domdocument xsl_xsltprocessor_transform_to_doc(domnode doc); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -Since: -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc) -{ - zval *id, *rv = NULL, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC); - - if (newdocp) { - DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL); - } else { - RETURN_FALSE; - } - -} -/* }}} end xsl_xsltprocessor_transform_to_doc */ - - -/* {{{ proto int xsl_xsltprocessor_transform_to_uri(domdocument doc, string uri); -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri) -{ - zval *id, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret, uri_len; - char *uri; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os", &docp, &uri, &uri_len) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC); - - ret = -1; - if (newdocp) { - ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0); - xmlFreeDoc(newdocp); - } - - RETVAL_LONG(ret); -} -/* }}} end xsl_xsltprocessor_transform_to_uri */ - - -/* {{{ proto string xsl_xsltprocessor_transform_to_xml(domdocument doc); -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml) -{ - zval *id, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret; - xmlChar *doc_txt_ptr; - int doc_txt_len; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC); - - ret = -1; - if (newdocp) { - ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, newdocp, sheetp); - if (doc_txt_ptr) { - RETVAL_STRINGL(doc_txt_ptr, doc_txt_len, 1); - xmlFree(doc_txt_ptr); - } - xmlFreeDoc(newdocp); - } - - if (ret < 0) { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_transform_to_xml */ - - -/* {{{ proto bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value]); -*/ -PHP_FUNCTION(xsl_xsltprocessor_set_parameter) -{ - - zval *id; - zval *array_value, **entry, *new_string; - xsl_object *intern; - char *string_key, *name, *value, *namespace; - ulong idx; - int string_key_len, namespace_len, name_len, value_len; - DOM_GET_THIS(id); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sa", &namespace, &namespace_len, &array_value) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value)); - - while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) { - SEPARATE_ZVAL(entry); - convert_to_string_ex(entry); - - if (zend_hash_get_current_key_ex(Z_ARRVAL_P(array_value), &string_key, &string_key_len, &idx, 0, NULL) != HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter array"); - RETURN_FALSE; - } - - ALLOC_ZVAL(new_string); - ZVAL_ADDREF(*entry); - COPY_PZVAL_TO_ZVAL(*new_string, *entry); - - zend_hash_update(intern->parameter, string_key, string_key_len, &new_string, sizeof(zval*), NULL); - zend_hash_move_forward(Z_ARRVAL_P(array_value)); - } - RETURN_TRUE; - - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sss", &namespace, &namespace_len, &name, &name_len, &value, &value_len) == SUCCESS) { - - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - MAKE_STD_ZVAL(new_string); - ZVAL_STRING(new_string, value, 1); - - zend_hash_update(intern->parameter, name, name_len + 1, &new_string, sizeof(zval*), NULL); - RETURN_TRUE; - } else { - WRONG_PARAM_COUNT; - } - -} -/* }}} end xsl_xsltprocessor_set_parameter */ - -/* {{{ proto string xsl_xsltprocessor_get_parameter(string namespace, string name); -*/ -PHP_FUNCTION(xsl_xsltprocessor_get_parameter) -{ - zval *id; - int name_len = 0, namespace_len = 0; - char *name, *namespace; - zval **value; - xsl_object *intern; - - DOM_GET_THIS(id); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - if ( zend_hash_find(intern->parameter, name, name_len + 1, (void**) &value) == SUCCESS) { - convert_to_string_ex(value); - RETVAL_STRING(Z_STRVAL_PP(value),1); - } else { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_get_parameter */ - -/* {{{ proto bool xsl_xsltprocessor_remove_parameter(string namespace, string name); -*/ -PHP_FUNCTION(xsl_xsltprocessor_remove_parameter) -{ - zval *id; - int name_len = 0, namespace_len = 0; - char *name, *namespace; - xsl_object *intern; - - DOM_GET_THIS(id); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - if ( zend_hash_del(intern->parameter, name, name_len + 1) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_remove_parameter */ - -/* {{{ proto void xsl_xsltprocessor_register_php_functions(); -*/ -PHP_FUNCTION(xsl_xsltprocessor_register_php_functions) -{ - zval *id; - xsl_object *intern; - zval *array_value, **entry, *new_string; - int name_len = 0; - char *name; - - DOM_GET_THIS(id); - - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value)); - - while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) { - SEPARATE_ZVAL(entry); - convert_to_string_ex(entry); - - MAKE_STD_ZVAL(new_string); - ZVAL_LONG(new_string,1); - - zend_hash_update(intern->registered_phpfunctions, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &new_string, sizeof(zval*), NULL); - zend_hash_move_forward(Z_ARRVAL_P(array_value)); - } - intern->registerPhpFunctions = 2; - RETURN_TRUE; - - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - MAKE_STD_ZVAL(new_string); - ZVAL_LONG(new_string,1); - zend_hash_update(intern->registered_phpfunctions, name, name_len + 1, &new_string, sizeof(zval*), NULL); - intern->registerPhpFunctions = 2; - - } else { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - intern->registerPhpFunctions = 1; - } - -} -/* }}} end xsl_xsltprocessor_register_php_functions(); */ - -/* {{{ proto bool xsl_xsltprocessor_has_exslt_support(); -*/ -PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support) -{ -#if HAVE_XSL_EXSLT - RETURN_TRUE; -#else - RETURN_FALSE; -#endif -} -/* }}} end xsl_xsltprocessor_has_exslt_support(); */ - diff --git a/ext/zlib/CREDITS b/ext/zlib/CREDITS deleted file mode 100644 index c0a47dd2932d1..0000000000000 --- a/ext/zlib/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Zlib -Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 deleted file mode 100644 index 3639276c8c1f2..0000000000000 --- a/ext/zlib/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("zlib", "ZLIB support", "yes"); - -if (PHP_ZLIB == "yes") { - EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS"); - AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support"); - CHECK_LIB("zlib.lib", "zlib", PHP_ZLIB); - CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects); - if (!PHP_ZLIB_SHARED) { - ADD_DEF_FILE("ext\\zlib\\php_zlib.def"); - } - -} - - diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 deleted file mode 100644 index e083a2285c77c..0000000000000 --- a/ext/zlib/config0.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(zlib,for ZLIB support, -[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) - -PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, -[ --with-zlib-dir= Define the location of zlib install directory], no, no) - -if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then - PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared) - PHP_SUBST(ZLIB_SHARED_LIBADD) - - if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then - if test -f $PHP_ZLIB/include/zlib/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include/zlib - elif test -f $PHP_ZLIB/include/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include - fi - else - for i in /usr/local /usr $PHP_ZLIB_DIR; do - if test -f $i/include/zlib/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include/zlib - elif test -f $i/include/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include - fi - done - fi - - if test -z "$ZLIB_DIR"; then - AC_MSG_ERROR(Cannot find libz) - fi - - case $ZLIB_DIR in - /usr) ac_extra= ;; - *) ac_extra=-L$ZLIB_DIR/$PHP_LIBDIR ;; - esac - - PHP_CHECK_LIBRARY(z, gzgets, [ - AC_DEFINE(HAVE_ZLIB,1,[ ]) - ],[ - AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9) - ],[ - $ac_extra - ]) - - PHP_ADD_LIBPATH($ZLIB_DIR/$PHP_LIBDIR, ZLIB_SHARED_LIBADD) - - PHP_ZLIB_DIR=$ZLIB_DIR - PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD) - PHP_ADD_INCLUDE($ZLIB_INCDIR) - -fi diff --git a/ext/zlib/package.xml b/ext/zlib/package.xml deleted file mode 100644 index 197357b89fc7d..0000000000000 --- a/ext/zlib/package.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - zlib - zlib compression management - - - sr - Stefan Roehrich - sr@linux.de - lead - - - rasmus - Rasmus Lerdorf - rasmus@php.net - developer - - - zeev - Zeev Suraski - zeev@php.net - developer - - - ??? - Jade Nicoletti - ???@php.net - developer - - - -This module enables you to transparently read and write -gzip (.gz) compressed files, through versions of most of -the filesystem functions which work with gzip-compressed -files (and uncompressed files, too, but not with sockets). - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support intallation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/zlib/php_zlib.def b/ext/zlib/php_zlib.def deleted file mode 100644 index b166331fa9a64..0000000000000 --- a/ext/zlib/php_zlib.def +++ /dev/null @@ -1,15 +0,0 @@ -EXPORTS - compress - compress2 - deflate - deflateEnd - deflateInit_ - deflateInit2_ - uncompress - inflateInit_ - inflateInit2_ - inflate - inflateEnd - crc32 - inflateReset - deflateReset diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h deleted file mode 100644 index dabf4f83b1cf7..0000000000000 --- a/ext/zlib/php_zlib.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stefan Röhrich | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ZLIB_H -#define PHP_ZLIB_H - -#include - -ZEND_BEGIN_MODULE_GLOBALS(zlib) - /* variables for transparent gzip encoding */ - int compression_coding; - z_stream stream; - uLong crc; - int ob_gzhandler_status; - long output_compression; - long output_compression_level; - char *output_handler; -ZEND_END_MODULE_GLOBALS(zlib) - -extern php_stream_filter_factory php_zlib_filter_factory; -extern zend_module_entry php_zlib_module_entry; -#define zlib_module_ptr &php_zlib_module_entry - -PHP_MINIT_FUNCTION(zlib); -PHP_MSHUTDOWN_FUNCTION(zlib); -PHP_RINIT_FUNCTION(zlib); -PHP_MINFO_FUNCTION(zlib); -PHP_FUNCTION(gzopen); -PHP_FUNCTION(readgzfile); -PHP_FUNCTION(gzfile); -PHP_FUNCTION(gzcompress); -PHP_FUNCTION(gzuncompress); -PHP_FUNCTION(gzdeflate); -PHP_FUNCTION(gzinflate); -PHP_FUNCTION(gzencode); -PHP_FUNCTION(ob_gzhandler); -PHP_FUNCTION(zlib_get_coding_type); - -int php_enable_output_compression(int buffer_size TSRMLS_DC); -int php_ob_gzhandler_check(TSRMLS_D); - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -extern php_stream_ops php_stream_gzio_ops; -extern php_stream_wrapper php_stream_gzip_wrapper; - -#ifdef ZTS -#define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) -#else -#define ZLIBG(v) (zlib_globals.v) -#endif - -#define phpext_zlib_ptr zlib_module_ptr - -#define CODING_GZIP 1 -#define CODING_DEFLATE 2 - -#endif /* PHP_ZLIB_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/zlib/tests/001.phpt b/ext/zlib/tests/001.phpt deleted file mode 100644 index 4850a65a5a03b..0000000000000 --- a/ext/zlib/tests/001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -gzdeflate()/gzinflate() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -100 36864 -Strings are equal -100 36864 -Strings are equal -5 15 -Strings are equal \ No newline at end of file diff --git a/ext/zlib/tests/002.phpt b/ext/zlib/tests/002.phpt deleted file mode 100644 index 9844a1b93d82b..0000000000000 --- a/ext/zlib/tests/002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -gzcompress()/gzuncompress() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -106 36864 -Strings are equal -106 36864 -Strings are equal diff --git a/ext/zlib/tests/003.phpt b/ext/zlib/tests/003.phpt deleted file mode 100644 index 2732d4cea651d..0000000000000 --- a/ext/zlib/tests/003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -gzencode()/base64_encode() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -118 36864 -Strings are equal diff --git a/ext/zlib/tests/bug_34821.phpt b/ext/zlib/tests/bug_34821.phpt deleted file mode 100644 index ff845c6df7605..0000000000000 --- a/ext/zlib/tests/bug_34821.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -bug 34821 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/zlib/tests/compress_zlib_wrapper.phpt b/ext/zlib/tests/compress_zlib_wrapper.phpt deleted file mode 100644 index de6b3d80b91bc..0000000000000 --- a/ext/zlib/tests/compress_zlib_wrapper.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -compress.zlib:// wrapper ---FILE-- - ---EXPECT-- -ok diff --git a/ext/zlib/tests/gzfilegzreadfile.phpt b/ext/zlib/tests/gzfilegzreadfile.phpt deleted file mode 100644 index 2d6843ddd4eda..0000000000000 --- a/ext/zlib/tests/gzfilegzreadfile.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -gzfile(), gzreadfile() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(560) -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah - -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah diff --git a/ext/zlib/tests/gzreadgzwrite.phpt b/ext/zlib/tests/gzreadgzwrite.phpt deleted file mode 100644 index 6d6729a72f682..0000000000000 --- a/ext/zlib/tests/gzreadgzwrite.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(36864) -int(36864) -Strings are equal diff --git a/ext/zlib/tests/gzreadgzwriteplain.phpt b/ext/zlib/tests/gzreadgzwriteplain.phpt deleted file mode 100644 index 7bb567d889ee3..0000000000000 --- a/ext/zlib/tests/gzreadgzwriteplain.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() for non-compressed data ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(36864) -int(36864) -Strings are equal -int(18432) -Strings are equal diff --git a/ext/zlib/tests/zlib_filter_deflate.phpt b/ext/zlib/tests/zlib_filter_deflate.phpt deleted file mode 100644 index 70c1bdfab772b..0000000000000 --- a/ext/zlib/tests/zlib_filter_deflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.deflate (with convert.base64-encode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -eJwdy0EOgCAMRNGrzM6N8R4co4YBMbRNGkLi7VV2f/FfgijGRUzGA/XMDi+QlWFQuT1QaQzpO9I2iWbFQ2U0t49VDjk7d4g1/R+xDG0LHC8+diGh diff --git a/ext/zlib/tests/zlib_filter_inflate.phpt b/ext/zlib/tests/zlib_filter_inflate.phpt deleted file mode 100644 index b91745f39f0d7..0000000000000 --- a/ext/zlib/tests/zlib_filter_inflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.inflate (with convert.base64-decode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -I am the very model of a modern major general, I've information vegetable, animal, and mineral. diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c deleted file mode 100644 index 19e49ac8401aa..0000000000000 --- a/ext/zlib/zlib.c +++ /dev/null @@ -1,1006 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stefan Röhrich | - | Zeev Suraski | - | Jade Nicoletti | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "SAPI.h" -#include "php_ini.h" - -#include -#include -#include -#include -#include -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#else -#include -/* #include */ -#endif -#include "ext/standard/head.h" -#include "safe_mode.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif -#if defined(HAVE_UNISTD_H) && defined(PHP_WIN32) -#undef HAVE_UNISTD_H -#endif - -#ifdef COMPILE_DL_ZLIB -#ifndef PUTS -#define PUTS(a) php_printf("%s",a) -#endif -#ifndef PUTC -#define PUTC(a) PUTS(a) -#endif -#ifndef PHPWRITE -#define PHPWRITE(a,n) php_write((a),(n) TSRMLS_CC) -#endif -#endif - -/* Win32 needs some more memory */ -#ifdef PHP_WIN32 -#define PHP_ZLIB_MODIFIER 100 -#else -#define PHP_ZLIB_MODIFIER 1000 -#endif - -#define OS_CODE 0x03 /* FIXME */ -#define GZIP_HEADER_LENGTH 10 -#define GZIP_FOOTER_LENGTH 8 - -/* True globals, no need for thread safety */ -static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* {{{ php_zlib_functions[] - */ -function_entry php_zlib_functions[] = { - PHP_FE(readgzfile, NULL) - PHP_FALIAS(gzrewind, rewind, NULL) - PHP_FALIAS(gzclose, fclose, NULL) - PHP_FALIAS(gzeof, feof, NULL) - PHP_FALIAS(gzgetc, fgetc, NULL) - PHP_FALIAS(gzgets, fgets, NULL) - PHP_FALIAS(gzgetss, fgetss, NULL) - PHP_FALIAS(gzread, fread, NULL) - PHP_FE(gzopen, NULL) - PHP_FALIAS(gzpassthru, fpassthru, NULL) - PHP_FALIAS(gzseek, fseek, NULL) - PHP_FALIAS(gztell, ftell, NULL) - PHP_FALIAS(gzwrite, fwrite, NULL) - PHP_FALIAS(gzputs, fwrite, NULL) - PHP_FE(gzfile, NULL) - PHP_FE(gzcompress, NULL) - PHP_FE(gzuncompress, NULL) - PHP_FE(gzdeflate, NULL) - PHP_FE(gzinflate, NULL) - PHP_FE(gzencode, NULL) - PHP_FE(ob_gzhandler, NULL) - PHP_FE(zlib_get_coding_type, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ php_zlib_module_entry - */ -zend_module_entry php_zlib_module_entry = { - STANDARD_MODULE_HEADER, - "zlib", - php_zlib_functions, - PHP_MINIT(zlib), - PHP_MSHUTDOWN(zlib), - PHP_RINIT(zlib), - NULL, - PHP_MINFO(zlib), - "1.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(zlib) - -#ifdef COMPILE_DL_ZLIB -ZEND_GET_MODULE(php_zlib) -#endif - -/* {{{ OnUpdate_zlib_output_compression */ -static PHP_INI_MH(OnUpdate_zlib_output_compression) -{ - char *ini_value; - - if (new_value == NULL) { - return FAILURE; - } - - if (!strncasecmp(new_value, "off", sizeof("off"))) { - new_value = "0"; - new_value_length = sizeof("0"); - } else if (!strncasecmp(new_value, "on", sizeof("on"))) { - new_value = "1"; - new_value_length = sizeof("1"); - } - - ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0); - if (ini_value != NULL && strlen(ini_value) != 0 && zend_atoi(new_value, new_value_length) != 0) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!"); - return FAILURE; - } - - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent"); - return FAILURE; - } - - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_compression_level */ -static PHP_INI_MH(OnUpdate_zlib_output_compression_level) -{ - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_handler */ -static PHP_INI_MH(OnUpdate_zlib_output_handler) -{ - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent"); - return FAILURE; - } - - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdate_zlib_output_compression_level, output_compression_level, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) -PHP_INI_END() - -#ifdef ZTS -/* {{{ php_zlib_init_globals - */ -static void php_zlib_init_globals(zend_zlib_globals *zlib_globals_p TSRMLS_DC) -{ -} -/* }}} */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(zlib) -{ -#ifdef ZTS - ts_allocate_id(&zlib_globals_id, sizeof(zend_zlib_globals), (ts_allocate_ctor) php_zlib_init_globals, NULL); -#endif - php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC); - php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC); - - REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT); - - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(zlib) -{ - uint chunk_size = ZLIBG(output_compression); - - ZLIBG(ob_gzhandler_status) = 0; - ZLIBG(compression_coding) = 0; - if (chunk_size) { - if (chunk_size == 1) { - chunk_size = 4096; /* use the default size */ - ZLIBG(output_compression) = chunk_size; - } - php_enable_output_compression(chunk_size TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(zlib) -{ - php_unregister_url_stream_wrapper("zlib" TSRMLS_CC); - php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC); - - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(zlib) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ZLib Support", "enabled"); - php_info_print_table_row(2, "Stream Wrapper support", "compress.zlib://"); - php_info_print_table_row(2, "Stream Filter support", "zlib.inflate, zlib.deflate"); - php_info_print_table_row(2, "Compiled Version", ZLIB_VERSION); - php_info_print_table_row(2, "Linked Version", (char *) zlibVersion()); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto array gzfile(string filename [, int use_include_path]) - Read und uncompress entire .gz-file into an array */ -PHP_FUNCTION(gzfile) -{ - char *filename; - int filename_len; - long flags = 0; - char *slashed, buf[8192]; - register int i = 0; - int use_include_path = 0; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */ - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - if (stream == NULL) { - /* Error reporting is already done by stream code */ - RETURN_FALSE; - } - - /* Initialize return array */ - array_init(return_value); - - /* Now loop through the file and do the magic quotes thing if needed */ - memset(buf,0,sizeof(buf)); - - while (php_stream_gets(stream, buf, sizeof(buf) - 1) != NULL) { - if (PG(magic_quotes_runtime)) { - int len; - - slashed = php_addslashes(buf, 0, &len, 0 TSRMLS_CC); /* 0 = don't free source string */ - add_index_stringl(return_value, i++, slashed, len, 0); - } else { - add_index_string(return_value, i++, buf, 1); - } - } - php_stream_close(stream); -} -/* }}} */ - -/* {{{ proto resource gzopen(string filename, string mode [, int use_include_path]) - Open a .gz-file and return a .gz-file pointer */ -PHP_FUNCTION(gzopen) -{ - char *filename, *mode; - int filename_len, mode_len; - long flags = 0; - php_stream *stream; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, mode, use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - - if (!stream) { - RETURN_FALSE; - } - php_stream_to_zval(stream, return_value); -} -/* }}} */ - -/* - * Read a file and write the ouput to stdout - */ -/* {{{ proto int readgzfile(string filename [, int use_include_path]) - Output a .gz-file */ -PHP_FUNCTION(readgzfile) -{ - char *filename; - int filename_len; - long flags = 0; - php_stream *stream; - int size; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE, NULL, NULL STREAMS_CC TSRMLS_CC); - if (!stream) { - RETURN_FALSE; - } - size = php_stream_passthru(stream); - php_stream_close(stream); - RETURN_LONG(size); -} -/* }}} */ - -/* {{{ proto string gzcompress(string data [, int level]) - Gzip-compress a string */ -PHP_FUNCTION(gzcompress) -{ - int data_len, status; - long level = Z_DEFAULT_COMPRESSION; - unsigned long l2; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - l2 = data_len + (data_len / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(l2); - if (!s2) { - RETURN_FALSE; - } - - if (level >= 0) { - status = compress2(s2, &l2, data, data_len, level); - } else { - status = compress(s2, &l2, data, data_len); - } - - if (status == Z_OK) { - s2 = erealloc(s2, l2 + 1); - s2[l2] = '\0'; - RETURN_STRINGL(s2, l2, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzuncompress(string data [, int length]) - Unzip a gzip-compressed string */ -PHP_FUNCTION(gzuncompress) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - zlib::uncompress() wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be eneugh for all real life cases - */ - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - status = uncompress(s2, &length, data, data_len); - s1 = s2; - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, length + 1); /* space for \0 */ - s2[ length ] = '\0'; - RETURN_STRINGL(s2, length, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzdeflate(string data [, int level]) - Gzip-compress a string */ -PHP_FUNCTION(gzdeflate) -{ - int data_len,status; - long level = Z_DEFAULT_COMPRESSION; - z_stream stream; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - stream.data_type = Z_ASCII; - stream.zalloc = (alloc_func) Z_NULL; - stream.zfree = (free_func) Z_NULL; - stream.opaque = (voidpf) Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - - s2 = (char *) emalloc(stream.avail_out); - if (!s2) { - RETURN_FALSE; - } - - stream.next_out = s2; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, 0); - if (status == Z_OK) { - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - } - - if (status == Z_OK) { - s2 = erealloc(s2,stream.total_out + 1); /* resize to buffer to the "right" size */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzinflate(string data [, int length]) - Unzip a gzip-compressed string */ -PHP_FUNCTION(gzinflate) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - stream.avail_out wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be enaugh for all real life cases - */ - - stream.zalloc = (alloc_func) Z_NULL; - stream.zfree = (free_func) Z_NULL; - - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - - if (!s2 && s1) { - efree(s1); - RETURN_FALSE; - } - - stream.next_in = (Bytef *) data; - stream.avail_in = (uInt) data_len + 1; /* there is room for \0 */ - - stream.next_out = s2; - stream.avail_out = (uInt) length; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = inflateInit2(&stream, -MAX_WBITS); - if (status == Z_OK) { - status = inflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - inflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = inflateEnd(&stream); - } - } - s1 = s2; - - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, stream.total_out + 1); /* room for \0 */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string zlib_get_coding_type(void) - Returns the coding type used for output compression */ -PHP_FUNCTION(zlib_get_coding_type) -{ - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - RETURN_STRINGL("gzip", sizeof("gzip") - 1, 1); - - case CODING_DEFLATE: - RETURN_STRINGL("deflate", sizeof("deflate") - 1, 1); - } - - RETURN_FALSE; -} - -/* {{{ php_do_deflate - */ -static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - Bytef *buffer; - uInt prev_outlen, outlen; - int err; - int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 10 : 0); - int end_offset = (do_end ? 8 : 0); - - outlen = (uint) (str_length + (str_length / PHP_ZLIB_MODIFIER) + 12 + 1); /* leave some room for a trailing \0 */ - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = (Bytef *) emalloc(outlen + start_offset + end_offset); - } else { - buffer = *p_buffer; - } - - ZLIBG(stream).next_out = buffer + start_offset; - ZLIBG(stream).avail_out = outlen; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - while (err == Z_OK && !ZLIBG(stream).avail_out) { - prev_outlen = outlen; - outlen *= 3; - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = erealloc(buffer, outlen + start_offset + end_offset); - } - - ZLIBG(stream).next_out = buffer + start_offset + prev_outlen; - ZLIBG(stream).avail_out = prev_outlen * 2; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - } - - if (do_end) { - err = deflate(&ZLIBG(stream), Z_FINISH); - buffer[outlen + start_offset - ZLIBG(stream).avail_out] = '\0'; - } - - *p_buffer = buffer; - *p_buffer_len = outlen - ZLIBG(stream).avail_out; - - return err; -} -/* }}} */ - -/* {{{ php_deflate_string - */ -static int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - int err; - - if (do_start) { - ZLIBG(stream).zalloc = Z_NULL; - ZLIBG(stream).zfree = Z_NULL; - ZLIBG(stream).opaque = Z_NULL; - - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if (deflateInit2(&ZLIBG(stream), ZLIBG(output_compression_level), Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - - ZLIBG(crc) = crc32(0L, Z_NULL, 0); - break; - - case CODING_DEFLATE: - if (deflateInit(&ZLIBG(stream), ZLIBG(output_compression_level)) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - break; - } - } - - ZLIBG(stream).next_in = (Bytef *) str; - ZLIBG(stream).avail_in = (uInt) str_length; - - if (ZLIBG(compression_coding) == CODING_GZIP) { - ZLIBG(crc) = crc32(ZLIBG(crc), (const Bytef *) str, str_length); - } - - err = php_do_deflate(str_length, (Bytef **) newstr, new_length, do_start, do_end TSRMLS_CC); - /* TODO: error handling (err may be Z_STREAM_ERROR, Z_BUF_ERROR, ?) */ - - if (do_start && ZLIBG(compression_coding) == CODING_GZIP) { - /* Write a very simple .gz header: */ - (*newstr)[0] = gz_magic[0]; - (*newstr)[1] = gz_magic[1]; - (*newstr)[2] = Z_DEFLATED; - (*newstr)[3] = (*newstr)[4] = (*newstr)[5] = (*newstr)[6] = (*newstr)[7] = (*newstr)[8] = 0; - (*newstr)[9] = OS_CODE; - *new_length += 10; - } - if (do_end) { - if (ZLIBG(compression_coding) == CODING_GZIP) { - char *trailer = (*newstr) + (*new_length); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) ZLIBG(crc) & 0xFF; - trailer[1] = (char) (ZLIBG(crc) >> 8) & 0xFF; - trailer[2] = (char) (ZLIBG(crc) >> 16) & 0xFF; - trailer[3] = (char) (ZLIBG(crc) >> 24) & 0xFF; - trailer[4] = (char) ZLIBG(stream).total_in & 0xFF; - trailer[5] = (char) (ZLIBG(stream).total_in >> 8) & 0xFF; - trailer[6] = (char) (ZLIBG(stream).total_in >> 16) & 0xFF; - trailer[7] = (char) (ZLIBG(stream).total_in >> 24) & 0xFF; - trailer[8] = '\0'; - *new_length += 8; - } - deflateEnd(&ZLIBG(stream)); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ proto string gzencode(string data [, int level [, int encoding_mode]]) - GZ encode a string */ -PHP_FUNCTION(gzencode) -{ - char *data, *s2; - int data_len; - long level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP; - int status; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &level, &coding) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level(%ld) must be within -1..9", level); - RETURN_FALSE; - } - - if ((coding != CODING_GZIP) && (coding != CODING_DEFLATE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be FORCE_GZIP or FORCE_DEFLATE"); - RETURN_FALSE; - } - - stream.zalloc = Z_NULL; - stream.zfree = Z_NULL; - stream.opaque = Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(stream.avail_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)); - - /* add gzip file header */ - s2[0] = gz_magic[0]; - s2[1] = gz_magic[1]; - s2[2] = Z_DEFLATED; - s2[3] = s2[4] = s2[5] = s2[6] = s2[7] = s2[8] = 0; /* time set to 0 */ - s2[9] = OS_CODE; - - stream.next_out = &(s2[GZIP_HEADER_LENGTH]); - - switch (coding) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if ((status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - - break; - case CODING_DEFLATE: - if ((status = deflateInit(&stream, level)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - break; - } - - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - - if (status == Z_OK) { - /* resize to buffer to the "right" size */ - s2 = erealloc(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0) + 1); - - if (coding == CODING_GZIP) { - char *trailer = s2 + (stream.total_out + GZIP_HEADER_LENGTH); - uLong crc = crc32(0L, Z_NULL, 0); - - crc = crc32(crc, (const Bytef *) data, data_len); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) crc & 0xFF; - trailer[1] = (char) (crc >> 8) & 0xFF; - trailer[2] = (char) (crc >> 16) & 0xFF; - trailer[3] = (char) (crc >> 24) & 0xFF; - trailer[4] = (char) stream.total_in & 0xFF; - trailer[5] = (char) (stream.total_in >> 8) & 0xFF; - trailer[6] = (char) (stream.total_in >> 16) & 0xFF; - trailer[7] = (char) (stream.total_in >> 24) & 0xFF; - trailer[8] = '\0'; - } - RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_ob_gzhandler_check - */ -int php_ob_gzhandler_check(TSRMLS_D) -{ - /* check for wrong usages */ - if (OG(ob_nesting_level > 0)) { - if (php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used twice"); - return FAILURE; - } - if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'mb_output_handler'"); - return FAILURE; - } - if (php_ob_handler_used("URL-Rewriter" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter'"); - return FAILURE; - } - if (php_ob_init_conflict("ob_gzhandler", "zlib output compression" TSRMLS_CC)) { - return FAILURE; - } - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto string ob_gzhandler(string str, int mode) - Encode str based on accept-encoding setting - designed to be called from ob_start() */ -PHP_FUNCTION(ob_gzhandler) -{ - char *string; - int string_len; - long mode; - zval **a_encoding; - zend_bool return_original = 0; - zend_bool do_start, do_end; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &string, &string_len, &mode) == FAILURE) { - return; - } - - if(ZLIBG(ob_gzhandler_status) == -1) - RETURN_FALSE; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - convert_to_string_ex(a_encoding); - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - do_start = ((mode & PHP_OUTPUT_HANDLER_START) ? 1 : 0); - do_end = ((mode & PHP_OUTPUT_HANDLER_END) ? 1 : 0); - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - - if (php_deflate_string(string, string_len, &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), do_start, do_end TSRMLS_CC) == SUCCESS) { - Z_TYPE_P(return_value) = IS_STRING; - if (do_start) { - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - case CODING_DEFLATE: - if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - default: - return_original = 1; - break; - } - } - - if (return_original) { - zval_dtor(return_value); - } - - } else { - return_original = 1; - } - - if (return_original) { - /* return the original string */ - RETURN_STRINGL(string, string_len, 1); - } -} -/* }}} */ - -/* {{{ php_gzip_output_handler - */ -static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - zend_bool do_start, do_end; - - if (!ZLIBG(output_compression)) { - *handled_output = NULL; - } else { - do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); - do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); - if (php_deflate_string(output, output_len, handled_output, handled_output_len, do_start, do_end TSRMLS_CC) != SUCCESS) { - zend_error(E_ERROR, "Compression failed"); - } - } -} -/* }}} */ - -/* {{{ php_enable_output_compression - */ -int php_enable_output_compression(int buffer_size TSRMLS_DC) -{ - zval **a_encoding; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - return FAILURE; - } - - convert_to_string_ex(a_encoding); - - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - return FAILURE; - } - - php_ob_set_internal_handler(php_gzip_output_handler, (uint)buffer_size, "zlib output compression", 0 TSRMLS_CC); - - if (ZLIBG(output_handler) && strlen(ZLIBG(output_handler))) { - php_start_ob_buffer_named(ZLIBG(output_handler), 0, 1 TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp deleted file mode 100644 index 8986bc6f05949..0000000000000 --- a/ext/zlib/zlib.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=zlib - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "zlib - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 Release_TS" -# Name "zlib - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zlib.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_zlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c deleted file mode 100644 index 9bdf74e66d328..0000000000000 --- a/ext/zlib/zlib_filter.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_zlib.h" - -/* {{{ data structure */ - -/* Passed as opaque in malloc callbacks */ -typedef struct _php_zlib_filter_data { - int persistent; - z_stream strm; - char *inbuf; - size_t inbuf_len; - char *outbuf; - size_t outbuf_len; -} php_zlib_filter_data; - -/* }}} */ - -/* {{{ Memory management wrappers */ - -static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size) -{ - return (voidpf)safe_pemalloc(items, size, 0, ((php_zlib_filter_data*)opaque)->persistent); -} - -static void php_zlib_free(voidpf opaque, voidpf address) -{ - pefree((void*)address, ((php_zlib_filter_data*)opaque)->persistent); -} -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_inflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = buckets_in->head; - - if (bucket->is_unicode) { - /* inflation not allowed for unicode data */ - return PSFS_ERR_FATAL; - } - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); - data->strm.avail_in = desired; - - status = inflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FINISH : Z_SYNC_FLUSH); - if (status != Z_OK && status != Z_STREAM_END) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - consumed += bucket->buf.str.len; - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = inflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - inflateEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_inflate_ops = { - php_zlib_inflate_filter, - php_zlib_inflate_dtor, - "zlib.inflate", - PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_OUTPUTS_STRING -}; -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_deflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = buckets_in->head; - - if (bucket->is_unicode) { - /* inflation not allowed for unicode data */ - return PSFS_ERR_FATAL; - } - - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); - data->strm.avail_in = desired; - - status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH)); - if (status != Z_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - consumed += bucket->buf.str.len; - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = deflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - deflateEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_deflate_ops = { - php_zlib_deflate_filter, - php_zlib_deflate_dtor, - "zlib.deflate", - PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_OUTPUTS_STRING -}; - -/* }}} */ - -/* {{{ zlib.* common factory */ - -static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_stream_filter_ops *fops = NULL; - php_zlib_filter_data *data; - int status; - - /* Create this filter */ - data = pecalloc(1, sizeof(php_zlib_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_zlib_filter_data)); - return NULL; - } - - /* Circular reference */ - data->strm.opaque = (voidpf) data; - - data->strm.zalloc = (alloc_func) php_zlib_alloc; - data->strm.zfree = (free_func) php_zlib_free; - data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->inbuf_len); - pefree(data, persistent); - return NULL; - } - data->strm.avail_in = 0; - data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } - - data->strm.data_type = Z_ASCII; - - if (strcasecmp(filtername, "zlib.inflate") == 0) { - int windowBits = MAX_WBITS; - - if (filterparams) { - zval **tmpzval; - - if ((Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) && - zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void **) &tmpzval) == SUCCESS) { - /* log-2 base of history window (9 - 15) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 9 || Z_LVAL_PP(tmpzval) > MAX_WBITS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - windowBits = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - } - - /* RFC 1951 Inflate */ - status = inflateInit2(&(data->strm), windowBits); - fops = &php_zlib_inflate_ops; - } else if (strcasecmp(filtername, "zlib.deflate") == 0) { - /* RFC 1951 Deflate */ - int level = Z_DEFAULT_COMPRESSION; - int windowBits = MAX_WBITS; - int memLevel = MAX_MEM_LEVEL; - - - if (filterparams) { - zval **tmpzval; - - /* filterparams can either be a scalar value to indicate compression level (shortcut method) - Or can be a hash containing one or more of 'window', 'memory', and/or 'level' members. */ - - switch (Z_TYPE_P(filterparams)) { - case IS_ARRAY: - case IS_OBJECT: - if (zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) &tmpzval) == SUCCESS) { - /* Memory Level (1 - 9) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - memLevel = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) &tmpzval) == SUCCESS) { - /* log-2 base of history window (9 - 15) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 9 || Z_LVAL_PP(tmpzval) > MAX_WBITS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - windowBits = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "level", sizeof("level"), (void**) &tmpzval) == SUCCESS) { - /* Psuedo pass through to catch level validating code */ - goto factory_setlevel; - } - break; - case IS_STRING: - case IS_DOUBLE: - case IS_LONG: - tmpzval = &filterparams; -factory_setlevel: - /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < -1 || Z_LVAL_PP(tmpzval) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - level = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored."); - } - } - status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0); - fops = &php_zlib_deflate_ops; - } else { - status = Z_DATA_ERROR; - } - - if (status != Z_OK) { - /* Unspecified (probably strm) error, let stream-filter error do its own whining */ - pefree(data->strm.next_in, persistent); - pefree(data->strm.next_out, persistent); - pefree(data, persistent); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_zlib_filter_factory = { - php_zlib_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c deleted file mode 100644 index c29aae703267a..0000000000000 --- a/ext/zlib/zlib_fopen_wrapper.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong , based on work by: | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE - -#include "php.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" - -struct php_gz_stream_data_t { - gzFile gz_file; - php_stream *stream; -}; - -static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int read; - - read = gzread(self->gz_file, buf, count); - - if (gzeof(self->gz_file)) { - stream->eof = 1; - } - - return (read < 0) ? 0 : read; -} - -static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int wrote; - - wrote = gzwrite(self->gz_file, (char *) buf, count); - - return (wrote < 0) ? 0 : wrote; -} - -static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - assert(self != NULL); - - *newoffs = gzseek(self->gz_file, offset, whence); - - return (*newoffs < 0) ? -1 : 0; -} - -static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int ret = EOF; - - if (close_handle) { - if (self->gz_file) { - ret = gzclose(self->gz_file); - self->gz_file = NULL; - } - if (self->stream) { - php_stream_close(self->stream); - self->stream = NULL; - } - } - efree(self); - - return ret; -} - -static int php_gziop_flush(php_stream *stream TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - return gzflush(self->gz_file, Z_SYNC_FLUSH); -} - -php_stream_ops php_stream_gzio_ops = { - php_gziop_write, php_gziop_read, - php_gziop_close, php_gziop_flush, - "ZLIB", - php_gziop_seek, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = {0}; - php_stream *stream = NULL, *innerstream = NULL; - - /* sanity check the stream: it can be either read-only or write-only */ - if (strchr(mode, '+')) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!"); - } - return NULL; - } - - self = emalloc(sizeof(*self)); - - if (strncasecmp("compress.zlib://", path, 16) == 0) { - path += 16; - } else if (strncasecmp("zlib:", path, 5) == 0) { - path += 5; - } - - innerstream = php_stream_open_wrapper(path, mode, STREAM_MUST_SEEK | options | STREAM_WILL_CAST, opened_path); - - if (innerstream) { - int fd; - - if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - self->gz_file = gzdopen(fd, mode); - self->stream = innerstream; - if (self->gz_file) { - stream = php_stream_alloc_rel(&php_stream_gzio_ops, self, 0, mode); - if (stream) { - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return stream; - } - gzclose(self->gz_file); - } - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzopen failed"); - } - } else if (innerstream) { - php_stream_close(innerstream); - } - } - - if (stream) { - php_stream_close(stream); - } - - if (self) { - efree(self); - } - - return NULL; -} - -static php_stream_wrapper_ops gzip_stream_wops = { - php_stream_gzopen, - NULL, /* close */ - NULL, /* stat */ - NULL, /* stat_url */ - NULL, /* opendir */ - "ZLIB", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_gzip_wrapper = { - &gzip_stream_wops, - NULL, - 0, /* is_url */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt deleted file mode 100644 index a4e01a4845e42..0000000000000 --- a/ext/zlib/zlib_win32_howto.txt +++ /dev/null @@ -1,16 +0,0 @@ -Rules for building ZLIB ------------------------ - -The zlib project requires the folowing files: - -php_build\zlib\include\zlib.h -php_build\zlib\include\zconf.h -php_build\zlib\lib\zlibstat.lib - -php_build is a directory at the same level as php5. - -Start Visual Studio, load php_modules.dsw, select the ZLIB projects, and build -it. - - - \ No newline at end of file diff --git a/footer b/footer deleted file mode 100644 index 64d3768113fd7..0000000000000 --- a/footer +++ /dev/null @@ -1,9 +0,0 @@ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/gen_php_cov b/gen_php_cov deleted file mode 100755 index 7dcef6f76d1c3..0000000000000 --- a/gen_php_cov +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -cov_gen_clean() -{ - echo "Cleaning up stale gcov data" - find . -name \*.gcda -o -name \*.gcno | xargs rm -f - make cov-clean > /dev/null -} - -cov_gen_check_cli() -{ - if test -x $php_version; then - check_gcov=`nm $php_version | grep '__gcov_open' | wc -l` - if test "$check_gcov" != "1"; then - echo "PHP CLI Found ($php_version) does not appear to have GCOV enabled" - echo "Please recompile with --enable-gcov or set PHP_EXEC" - exit 1 - fi - echo "GCOV support in PHP confirmed" - else - echo "Could not find PHP binary (using $php_version)" - echo "Please compile the CLI version of PHP using the --enable-gcov flag" - exit 1 - fi -} - -cov_gen_usage() -{ - echo "$0 --[help] "; -} - -cov_gen_generate() -{ - echo "Confirming GCOV is available in PHP" - cov_gen_check_cli - cov_gen_clean - export NO_INTERACTION=1 - export TEST_PHP_EXECUTABLE="$php_version" - - echo "Running Test Suite (this is going to take awhile)" - - $php_version -c ./php.ini-test run-tests.php > /dev/null - echo "Performing Code Coverage Analysis" - make cov > /dev/null - echo "Generating HTML report of Analysis" - make cov-html > /dev/null -} - -while test $# != 0; do - case "$1" in - --help) - cov_gen_usage - exit 0 - ;; - *) - if test -x $1; then - echo "Using PHP executable $1" - php_version="$1" - cov_gen_generate - exit 0 - fi - ;; - esac - shift -done - -echo "Using Default Location for PHP executable" -php_version="sapi/cli/php" -cov_gen_generate -exit 0 diff --git a/genfiles b/genfiles deleted file mode 100755 index 502b0b11d1e10..0000000000000 --- a/genfiles +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh - -STD='make -f Makefile.frag LEX="flex -L" YACC="bison -y -l" srcdir=Zend builddir=Zend' - -(eval "$STD Zend/zend_language_parser.c Zend/zend_language_scanner.c Zend/zend_ini_parser.c Zend/zend_ini_scanner.c") - -set -x - -for f in ext/standard/url_scanner_ex.c ext/standard/var_unserializer.c; do - cp $f $f.orig - grep -v '#line ' $f.orig > $f -done - diff --git a/header b/header deleted file mode 100644 index 96ca384f251ca..0000000000000 --- a/header +++ /dev/null @@ -1,19 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ diff --git a/ltmain.sh b/ltmain.sh deleted file mode 100644 index eecedf23e43e6..0000000000000 --- a/ltmain.sh +++ /dev/null @@ -1,6500 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.18 -TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)" - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -quote_scanset='[[~#^*{};<>?'"'"' ]' - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$my_xdir"; then - exit $status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) prevopt="--tag" prev=tag ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case "$arg_mode" in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - qlibobj="\"$qlibobj\"" ;; - esac - if test "X$libobj" != "X$qlibobj"; then - $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - exit $EXIT_FAILURE - fi - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=darwin_framework - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit $EXIT_FAILURE - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` - deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${outputname}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -char * basename (const char *name); -char * fnqualify(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup ((char *) basename (argv[0])); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -char * -basename (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return (char *) base; -} - -char * -fnqualify(const char *path) -{ - size_t size; - char *p; - char tmp[LT_PATHMAX + 1]; - - assert(path != NULL); - - /* Is it qualified already? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); -#endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); - - /* prepend the current directory */ - /* doesn't handle '~' */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - save_umask=`umask` - umask 0077 - if $mkdir "$tmpdir"; then - umask $save_umask - else - umask $save_umask - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "----------------------------------------------------------------------" - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "----------------------------------------------------------------------" - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/main/SAPI.c b/main/SAPI.c deleted file mode 100644 index 4b0335e71608f..0000000000000 --- a/main/SAPI.c +++ /dev/null @@ -1,983 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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. | - +----------------------------------------------------------------------+ - | Original design: Shane Caraveo | - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include - -#include "php.h" -#include "SAPI.h" -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/pageinfo.h" -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) -#include "ext/pcre/php_pcre.h" -#endif -#if HAVE_ZLIB -#include "ext/zlib/php_zlib.h" -#endif -#ifdef ZTS -#include "TSRM.h" -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#include "rfc1867.h" - -#ifdef PHP_WIN32 -#define STRCASECMP stricmp -#else -#define STRCASECMP strcasecmp -#endif - -#include "php_content_types.h" - -#ifdef ZTS -SAPI_API int sapi_globals_id; -#else -sapi_globals_struct sapi_globals; -#endif - -static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC) -{ - memset(sapi_globals, 0, sizeof(*sapi_globals)); - zend_hash_init_ex(&sapi_globals->known_post_content_types, 5, NULL, NULL, 1, 0); - php_setup_sapi_content_types(TSRMLS_C); -} - -static void sapi_globals_dtor(sapi_globals_struct *sapi_globals TSRMLS_DC) -{ - zend_hash_destroy(&sapi_globals->known_post_content_types); -} - -/* True globals (no need for thread safety) */ -SAPI_API sapi_module_struct sapi_module; - - -SAPI_API void sapi_startup(sapi_module_struct *sf) -{ - sapi_module = *sf; - -#ifdef ZTS - ts_allocate_id(&sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor); -#else - sapi_globals_ctor(&sapi_globals); -#endif - - virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */ - -#ifdef PHP_WIN32 - tsrm_win32_startup(); -#endif - - reentrancy_startup(); -} - -SAPI_API void sapi_shutdown(void) -{ -#ifdef ZTS - ts_free_id(sapi_globals_id); -#else - sapi_globals_dtor(&sapi_globals); -#endif - - reentrancy_shutdown(); - - virtual_cwd_shutdown(); - -#ifdef PHP_WIN32 - tsrm_win32_shutdown(); -#endif -} - - -SAPI_API void sapi_free_header(sapi_header_struct *sapi_header) -{ - efree(sapi_header->header); -} - - -SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) -{ - if (SG(request_info).post_entry && SG(request_info).content_type_dup) { - SG(request_info).post_entry->post_handler(SG(request_info).content_type_dup, arg TSRMLS_CC); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - SG(request_info).post_data = NULL; - } - efree(SG(request_info).content_type_dup); - SG(request_info).content_type_dup = NULL; - } -} - -static void sapi_read_post_data(TSRMLS_D) -{ - sapi_post_entry *post_entry; - uint content_type_length = strlen(SG(request_info).content_type); - char *content_type = estrndup(SG(request_info).content_type, content_type_length); - char *p; - char oldchar=0; - void (*post_reader_func)(TSRMLS_D) = NULL; - - - /* dedicated implementation for increased performance: - * - Make the content type lowercase - * - Trim descriptive data, stay with the content-type only - */ - for (p=content_type; ppost_reader; - } else { - /* fallback */ - SG(request_info).post_entry = NULL; - if (!sapi_module.default_post_reader) { - /* no default reader ? */ - SG(request_info).content_type_dup = NULL; - sapi_module.sapi_error(E_WARNING, "Unsupported content type: '%s'", content_type); - return; - } - } - if (oldchar) { - *(p-1) = oldchar; - } - - SG(request_info).content_type_dup = content_type; - - if(post_reader_func) { - post_reader_func(TSRMLS_C); - } - - if(sapi_module.default_post_reader) { - sapi_module.default_post_reader(TSRMLS_C); - } -} - - -SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) -{ - int read_bytes; - int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; - - if (SG(request_info).content_length > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", - SG(request_info).content_length, SG(post_max_size)); - return; - } - SG(request_info).post_data = emalloc(allocated_bytes); - - for (;;) { - read_bytes = sapi_module.read_post(SG(request_info).post_data+SG(read_post_bytes), SAPI_POST_BLOCK_SIZE TSRMLS_CC); - if (read_bytes<=0) { - break; - } - SG(read_post_bytes) += read_bytes; - if (SG(read_post_bytes) > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size)); - break; - } - if (read_bytes < SAPI_POST_BLOCK_SIZE) { - break; - } - if (SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE >= allocated_bytes) { - allocated_bytes = SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE+1; - SG(request_info).post_data = erealloc(SG(request_info).post_data, allocated_bytes); - } - } - SG(request_info).post_data[SG(read_post_bytes)] = 0; /* terminating NULL */ - SG(request_info).post_data_length = SG(read_post_bytes); -} - - -/* {{{ sapi_update_default_charset */ -SAPI_API void sapi_update_default_charset(TSRMLS_D) -{ - if (UG(unicode)) { - const char *canonical_name = NULL; - UErrorCode status = U_ZERO_ERROR; - - canonical_name = ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status); - SG(default_charset) = (char *)ucnv_getStandardName(canonical_name, "MIME", &status); - } else { - SG(default_charset) = zend_ini_string("default_charset", sizeof("default_charset"), 0); - } -} -/* }}} */ - - -SAPI_API char *sapi_get_default_content_type(TSRMLS_D) -{ - char *mimetype, *charset, *content_type; - - mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE; - /* - * Apache SAPI may invoke this function directly, before php_request_startup() is - * called, so we need to update the default charset explicitly. - */ - sapi_update_default_charset(TSRMLS_C); - charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET; - - if (strncasecmp(mimetype, "text/", 5) == 0 && *charset) { - int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset); /* sizeof() includes \0 */ - content_type = emalloc(len); - snprintf(content_type, len, "%s; charset=%s", mimetype, charset); - } else { - content_type = estrdup(mimetype); - } - return content_type; -} - - -SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC) -{ - char *default_content_type = sapi_get_default_content_type(TSRMLS_C); - int default_content_type_len = strlen(default_content_type); - - default_header->header_len = (sizeof("Content-type: ")-1) + default_content_type_len; - default_header->header = emalloc(default_header->header_len+1); - memcpy(default_header->header, "Content-type: ", sizeof("Content-type: ")); - memcpy(default_header->header+sizeof("Content-type: ")-1, default_content_type, default_content_type_len); - default_header->header[default_header->header_len] = 0; - efree(default_content_type); -} - -/* - * Add charset on content-type header if the MIME type starts with - * "text/", the default_charset directive is not empty and - * there is not already a charset option in there. - * - * If "mimetype" is non-NULL, it should point to a pointer allocated - * with emalloc(). If a charset is added, the string will be - * re-allocated and the new length is returned. If mimetype is - * unchanged, 0 is returned. - * - */ -SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC) -{ - char *charset, *newtype; - size_t newlen; - - charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET; - - if (*mimetype != NULL) { - if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) { - newlen = len + (sizeof(";charset=")-1) + strlen(charset); - newtype = emalloc(newlen + 1); - PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); - strlcat(newtype, ";charset=", newlen + 1); - strlcat(newtype, charset, newlen + 1); - efree(*mimetype); - *mimetype = newtype; - return newlen; - } - } - return 0; -} - -SAPI_API void sapi_activate_headers_only(TSRMLS_D) -{ - if (SG(request_info).headers_read == 1) - return; - SG(request_info).headers_read = 1; - zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), - (void (*)(void *)) sapi_free_header, 0); - SG(sapi_headers).send_default_content_type = 1; - - /* SG(sapi_headers).http_response_code = 200; */ - SG(sapi_headers).http_status_line = NULL; - SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; - SG(request_info).current_user = NULL; - SG(request_info).current_user_length = 0; - SG(request_info).no_headers = 0; - SG(request_info).post_entry = NULL; - SG(global_request_time) = 0; - - /* - * It's possible to override this general case in the activate() callback, - * if necessary. - */ - if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - if (SG(server_context)) { - SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C); - if (sapi_module.activate) { - sapi_module.activate(TSRMLS_C); - } - } -} - -/* - * Called from php_request_startup() for every request. - */ - -SAPI_API void sapi_activate(TSRMLS_D) -{ - zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0); - SG(sapi_headers).send_default_content_type = 1; - - /* - SG(sapi_headers).http_response_code = 200; - */ - SG(sapi_headers).http_status_line = NULL; - SG(headers_sent) = 0; - SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; - SG(request_info).current_user = NULL; - SG(request_info).current_user_length = 0; - SG(request_info).no_headers = 0; - SG(request_info).post_entry = NULL; - SG(request_info).proto_num = 1000; /* Default to HTTP 1.0 */ - SG(global_request_time) = 0; - - /* It's possible to override this general case in the activate() callback, if - * necessary. - */ - if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - SG(rfc1867_uploaded_files) = NULL; - - /* handle request mehtod */ - if (SG(server_context)) { - if ( SG(request_info).request_method) { - if(!strcmp(SG(request_info).request_method, "POST") - && (SG(request_info).content_type)) { - /* HTTP POST -> may contain form data to be read into variables - depending on content type given - */ - sapi_read_post_data(TSRMLS_C); - } else { - /* any other method with content payload will fill - $HTTP_RAW_POST_DATA if enabled by always_populate_raw_post_data - it is up to the webserver to decide whether to allow a method or not - */ - SG(request_info).content_type_dup = NULL; - if(sapi_module.default_post_reader) { - sapi_module.default_post_reader(TSRMLS_C); - } - } - } else { - SG(request_info).content_type_dup = NULL; - } - - /* Cookies */ - SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C); - if (sapi_module.activate) { - sapi_module.activate(TSRMLS_C); - } - } -} - - -static void sapi_send_headers_free(TSRMLS_D) -{ - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = NULL; - } -} - -SAPI_API void sapi_deactivate(TSRMLS_D) -{ - zend_llist_destroy(&SG(sapi_headers).headers); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - } else if (SG(server_context)) { - if(sapi_module.read_post) { - /* make sure we've consumed all request input data */ - char dummy[SAPI_POST_BLOCK_SIZE]; - int read_bytes; - - while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { - SG(read_post_bytes) += read_bytes; - } - } - } - if (SG(request_info).raw_post_data) { - efree(SG(request_info).raw_post_data); - } - if (SG(request_info).auth_user) { - efree(SG(request_info).auth_user); - } - if (SG(request_info).auth_password) { - efree(SG(request_info).auth_password); - } - if (SG(request_info).auth_digest) { - efree(SG(request_info).auth_digest); - } - if (SG(request_info).content_type_dup) { - efree(SG(request_info).content_type_dup); - } - if (SG(request_info).current_user) { - efree(SG(request_info).current_user); - } - if (sapi_module.deactivate) { - sapi_module.deactivate(TSRMLS_C); - } - if (SG(rfc1867_uploaded_files)) { - destroy_uploaded_files_hash(TSRMLS_C); - } - if (SG(sapi_headers).mimetype) { - efree(SG(sapi_headers).mimetype); - SG(sapi_headers).mimetype = NULL; - } - sapi_send_headers_free(TSRMLS_C); - SG(sapi_started) = 0; - SG(headers_sent) = 0; - SG(request_info).headers_read = 0; - SG(global_request_time) = 0; -} - - -SAPI_API void sapi_initialize_empty_request(TSRMLS_D) -{ - SG(server_context) = NULL; - SG(request_info).request_method = NULL; - SG(request_info).auth_digest = SG(request_info).auth_user = SG(request_info).auth_password = NULL; - SG(request_info).content_type_dup = NULL; -} - - -static int sapi_extract_response_code(const char *header_line) -{ - int code = 200; - const char *ptr; - - for (ptr = header_line; *ptr; ptr++) { - if (*ptr == ' ' && *(ptr + 1) != ' ') { - code = atoi(ptr + 1); - break; - } - } - - return code; -} - - -static void sapi_update_response_code(int ncode TSRMLS_DC) -{ - /* if the status code did not change, we do not want - to change the status line, and no need to change the code */ - if (SG(sapi_headers).http_response_code == ncode) { - return; - } - - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = NULL; - } - SG(sapi_headers).http_response_code = ncode; -} - -static int sapi_find_matching_header(void *element1, void *element2) -{ - return strncasecmp(((sapi_header_struct*)element1)->header, (char*)element2, strlen((char*)element2)) == 0; -} - -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC) -{ - sapi_header_line ctr = {0}; - int r; - - ctr.line = header_line; - ctr.line_len = header_line_len; - - r = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD, - &ctr TSRMLS_CC); - - if (!duplicate) - efree(header_line); - - return r; -} - -SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) -{ - int retval; - sapi_header_struct sapi_header; - char *colon_offset; - long myuid = 0L; - char *header_line; - uint header_line_len; - zend_bool replace; - int http_response_code; - - if (SG(headers_sent) && !SG(request_info).no_headers) { - char *output_start_filename = php_get_output_start_filename(TSRMLS_C); - int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); - - if (output_start_filename) { - sapi_module.sapi_error(E_WARNING, "Cannot modify header information - headers already sent by (output started at %s:%d)", - output_start_filename, output_start_lineno); - } else { - sapi_module.sapi_error(E_WARNING, "Cannot modify header information - headers already sent"); - } - return FAILURE; - } - - switch (op) { - case SAPI_HEADER_SET_STATUS: - sapi_update_response_code((long) arg TSRMLS_CC); - return SUCCESS; - - case SAPI_HEADER_REPLACE: - case SAPI_HEADER_ADD: { - sapi_header_line *p = arg; - header_line = p->line; - header_line_len = p->line_len; - http_response_code = p->response_code; - replace = (op == SAPI_HEADER_REPLACE); - break; - } - - default: - return FAILURE; - } - - header_line = estrndup(header_line, header_line_len); - - /* cut of trailing spaces, linefeeds and carriage-returns */ - while(isspace(header_line[header_line_len-1])) - header_line[--header_line_len]='\0'; - - - sapi_header.header = header_line; - sapi_header.header_len = header_line_len; - sapi_header.replace = replace; - - /* Check the header for a few cases that we have special support for in SAPI */ - if (header_line_len>=5 - && !strncasecmp(header_line, "HTTP/", 5)) { - /* filter out the response code */ - sapi_update_response_code(sapi_extract_response_code(header_line) TSRMLS_CC); - SG(sapi_headers).http_status_line = header_line; - return SUCCESS; - } else { - colon_offset = strchr(header_line, ':'); - if (colon_offset) { - *colon_offset = 0; - if (!STRCASECMP(header_line, "Content-Type")) { - char *ptr = colon_offset+1, *mimetype = NULL, *newheader; - size_t len = header_line_len - (ptr - header_line), newlen; - while (*ptr == ' ') { - ptr++; - len--; - } -#if HAVE_ZLIB - if(!strncmp(ptr, "image/", sizeof("image/")-1)) { - zend_alter_ini_entry("zlib.output_compression", sizeof("zlib.output_compression"), "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } -#endif - mimetype = estrdup(ptr); - newlen = sapi_apply_default_charset(&mimetype, len TSRMLS_CC); - if (!SG(sapi_headers).mimetype){ - SG(sapi_headers).mimetype = estrdup(mimetype); - } - - if (newlen != 0) { - newlen += sizeof("Content-type: "); - newheader = emalloc(newlen); - PHP_STRLCPY(newheader, "Content-type: ", newlen, sizeof("Content-type: ")-1); - strlcat(newheader, mimetype, newlen); - sapi_header.header = newheader; - sapi_header.header_len = newlen - 1; - efree(header_line); - } - efree(mimetype); - SG(sapi_headers).send_default_content_type = 0; - } else if (!STRCASECMP(header_line, "Location")) { - if ((SG(sapi_headers).http_response_code < 300 || - SG(sapi_headers).http_response_code > 307) && - SG(sapi_headers).http_response_code != 201) { - /* Return a Found Redirect if one is not already specified */ - if(SG(request_info).proto_num > 1000 && - SG(request_info).request_method && - strcmp(SG(request_info).request_method, "HEAD") && - strcmp(SG(request_info).request_method, "GET")) { - sapi_update_response_code(303 TSRMLS_CC); - } else { - sapi_update_response_code(302 TSRMLS_CC); - } - } - } else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */ - - sapi_update_response_code(401 TSRMLS_CC); /* authentication-required */ - - if(PG(safe_mode)) -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) - { - zval *repl_temp; - char *ptr = colon_offset+1, *result, *newheader; - int ptr_len=0, result_len = 0, newlen = 0; - - /* skip white space */ - while (isspace(*ptr)) { - ptr++; - } - - myuid = php_getuid(); - - ptr_len = strlen(ptr); - MAKE_STD_ZVAL(repl_temp); - Z_TYPE_P(repl_temp) = IS_STRING; - Z_STRVAL_P(repl_temp) = emalloc(32); - Z_STRLEN_P(repl_temp) = sprintf(Z_STRVAL_P(repl_temp), "realm=\"\\1-%ld\"", myuid); - /* Modify quoted realm value */ - result = php_pcre_replace("/realm=\"(.*?)\"/i", 16, - ptr, ptr_len, - repl_temp, - 0, &result_len, -1, NULL TSRMLS_CC); - if(result_len==ptr_len) { - efree(result); - sprintf(Z_STRVAL_P(repl_temp), "realm=\\1-%ld\\2", myuid); - /* modify unquoted realm value */ - result = php_pcre_replace("/realm=([^\\s]+)(.*)/i", 21, - ptr, ptr_len, - repl_temp, - 0, &result_len, -1, NULL TSRMLS_CC); - if(result_len==ptr_len) { - char *lower_temp = estrdup(ptr); - char conv_temp[32]; - int conv_len; - - php_strtolower(lower_temp,strlen(lower_temp)); - /* If there is no realm string at all, append one */ - if(!strstr(lower_temp,"realm")) { - efree(result); - conv_len = sprintf(conv_temp, " realm=\"%ld\"",myuid); - result = emalloc(ptr_len+conv_len+1); - result_len = ptr_len+conv_len; - memcpy(result, ptr, ptr_len); - memcpy(result+ptr_len, conv_temp, conv_len); - *(result+ptr_len+conv_len) = '\0'; - } - efree(lower_temp); - } - } - newlen = sizeof("WWW-Authenticate: ") - 1 + result_len; - newheader = emalloc(newlen+1); - sprintf(newheader,"WWW-Authenticate: %s", result); - efree(header_line); - sapi_header.header = newheader; - sapi_header.header_len = newlen; - efree(result); - efree(Z_STRVAL_P(repl_temp)); - efree(repl_temp); - } -#else - { - myuid = php_getuid(); - efree(header_line); - sapi_header.header_len = spprintf(&sapi_header.header, 0, "WWW-Authenticate: Basic realm=\"%ld\"", myuid); - } -#endif - } - if (sapi_header.header==header_line) { - *colon_offset = ':'; - } - } - } - if (http_response_code) { - sapi_update_response_code(http_response_code TSRMLS_CC); - } - if (sapi_module.header_handler) { - retval = sapi_module.header_handler(&sapi_header, &SG(sapi_headers) TSRMLS_CC); - } else { - retval = SAPI_HEADER_ADD; - } - if (retval & SAPI_HEADER_DELETE_ALL) { - zend_llist_clean(&SG(sapi_headers).headers); - } - if (retval & SAPI_HEADER_ADD) { - /* in replace mode first remove the header if it already exists in the headers llist */ - if (replace) { - colon_offset = strchr(sapi_header.header, ':'); - if (colon_offset) { - char sav; - colon_offset++; - sav = *colon_offset; - *colon_offset = 0; - zend_llist_del_element(&SG(sapi_headers).headers, sapi_header.header, (int(*)(void*, void*))sapi_find_matching_header); - *colon_offset = sav; - } - } - - zend_llist_add_element(&SG(sapi_headers).headers, (void *) &sapi_header); - } - return SUCCESS; -} - - -SAPI_API int sapi_send_headers(TSRMLS_D) -{ - int retval; - int ret = FAILURE; - - if (SG(headers_sent) || SG(request_info).no_headers) { - return SUCCESS; - } - -#if HAVE_ZLIB - /* Add output compression headers at this late stage in order to make - it possible to switch it off inside the script. */ - - if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { - zval nm_zlib_get_coding_type; - zval *uf_result = NULL; - - ZVAL_STRINGL(&nm_zlib_get_coding_type, "zlib_get_coding_type", sizeof("zlib_get_coding_type") - 1, 0); - - if (call_user_function_ex(CG(function_table), NULL, &nm_zlib_get_coding_type, &uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE && uf_result != NULL && Z_TYPE_P(uf_result) == IS_STRING) { - char buf[128]; - int len; - - assert(Z_STRVAL_P(uf_result) != NULL); - - len = snprintf(buf, sizeof(buf), "Content-Encoding: %s", Z_STRVAL_P(uf_result)); - if (len <= 0 || sapi_add_header(buf, len, 1) == FAILURE) { - return FAILURE; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - } - if (uf_result != NULL) { - zval_ptr_dtor(&uf_result); - } - } -#endif - - /* Success-oriented. We set headers_sent to 1 here to avoid an infinite loop - * in case of an error situation. - */ - if (SG(sapi_headers).send_default_content_type && sapi_module.send_headers) { - sapi_header_struct default_header; - sapi_get_default_content_type_header(&default_header TSRMLS_CC); - sapi_add_header_ex(default_header.header, default_header.header_len, 0, 0 TSRMLS_CC); - } - - SG(headers_sent) = 1; - - if (sapi_module.send_headers) { - retval = sapi_module.send_headers(&SG(sapi_headers) TSRMLS_CC); - } else { - retval = SAPI_HEADER_DO_SEND; - } - - switch (retval) { - case SAPI_HEADER_SENT_SUCCESSFULLY: - ret = SUCCESS; - break; - case SAPI_HEADER_DO_SEND: { - sapi_header_struct http_status_line; - char buf[255]; - - if (SG(sapi_headers).http_status_line) { - http_status_line.header = SG(sapi_headers).http_status_line; - http_status_line.header_len = strlen(SG(sapi_headers).http_status_line); - } else { - http_status_line.header = buf; - http_status_line.header_len = sprintf(buf, "HTTP/1.0 %d X", SG(sapi_headers).http_response_code); - } - sapi_module.send_header(&http_status_line, SG(server_context) TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) sapi_module.send_header, SG(server_context) TSRMLS_CC); - if(SG(sapi_headers).send_default_content_type) { - sapi_header_struct default_header; - - sapi_get_default_content_type_header(&default_header TSRMLS_CC); - sapi_module.send_header(&default_header, SG(server_context) TSRMLS_CC); - sapi_free_header(&default_header); - } - sapi_module.send_header(NULL, SG(server_context) TSRMLS_CC); - ret = SUCCESS; - break; - case SAPI_HEADER_SEND_FAILED: - SG(headers_sent) = 0; - ret = FAILURE; - break; - } - - sapi_send_headers_free(TSRMLS_C); - - return ret; -} - - -SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC) -{ - sapi_post_entry *p=post_entries; - - while (p->content_type) { - if (sapi_register_post_entry(p TSRMLS_CC) == FAILURE) { - return FAILURE; - } - p++; - } - return SUCCESS; -} - - -SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC) -{ - return zend_hash_add(&SG(known_post_content_types), - post_entry->content_type, post_entry->content_type_len+1, - (void *) post_entry, sizeof(sapi_post_entry), NULL); -} - -SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC) -{ - zend_hash_del(&SG(known_post_content_types), post_entry->content_type, - post_entry->content_type_len+1); -} - - -SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)) -{ - sapi_module.default_post_reader = default_post_reader; - return SUCCESS; -} - - -SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC)) -{ - sapi_module.treat_data = treat_data; - return SUCCESS; -} - -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)) -{ - sapi_module.input_filter = input_filter; - return SUCCESS; -} - -SAPI_API int sapi_flush(TSRMLS_D) -{ - if (sapi_module.flush) { - sapi_module.flush(SG(server_context)); - return SUCCESS; - } else { - return FAILURE; - } -} - -SAPI_API struct stat *sapi_get_stat(TSRMLS_D) -{ - if (sapi_module.get_stat) { - return sapi_module.get_stat(TSRMLS_C); - } else { - if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat)) == -1)) { - return NULL; - } - return &SG(global_stat); - } -} - -SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - if (sapi_module.getenv) { - return sapi_module.getenv(name, name_len TSRMLS_CC); - } else { - return NULL; - } -} - -SAPI_API int sapi_get_fd(int *fd TSRMLS_DC) -{ - if (sapi_module.get_fd) { - return sapi_module.get_fd(fd TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API int sapi_force_http_10(TSRMLS_D) -{ - if (sapi_module.force_http_10) { - return sapi_module.force_http_10(TSRMLS_C); - } else { - return FAILURE; - } -} - - -SAPI_API int sapi_get_target_uid(uid_t *obj TSRMLS_DC) -{ - if (sapi_module.get_target_uid) { - return sapi_module.get_target_uid(obj TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API int sapi_get_target_gid(gid_t *obj TSRMLS_DC) -{ - if (sapi_module.get_target_gid) { - return sapi_module.get_target_gid(obj TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API time_t sapi_get_request_time(TSRMLS_D) -{ - if (sapi_module.get_request_time) { - return sapi_module.get_request_time(TSRMLS_C); - } else { - if(!SG(global_request_time)) SG(global_request_time) = time(0); - return SG(global_request_time); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/SAPI.h b/main/SAPI.h deleted file mode 100644 index 4f069116c807a..0000000000000 --- a/main/SAPI.h +++ /dev/null @@ -1,307 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SAPI_H -#define SAPI_H - -#include "zend.h" -#include "zend_llist.h" -#include "zend_operators.h" -#ifdef PHP_WIN32 -#include "win95nt.h" -#endif -#include - -#define SAPI_OPTION_NO_CHDIR 1 - -#define SAPI_POST_BLOCK_SIZE 4000 - -#ifdef PHP_WIN32 -# ifdef SAPI_EXPORTS -# define SAPI_API __declspec(dllexport) -# else -# define SAPI_API __declspec(dllimport) -# endif -#else -#define SAPI_API -#endif - -#undef shutdown - -typedef struct { - char *header; - uint header_len; - zend_bool replace; -} sapi_header_struct; - - -typedef struct { - zend_llist headers; - int http_response_code; - unsigned char send_default_content_type; - char *mimetype; - char *http_status_line; -} sapi_headers_struct; - - -typedef struct _sapi_post_entry sapi_post_entry; -typedef struct _sapi_module_struct sapi_module_struct; - -BEGIN_EXTERN_C() -extern SAPI_API sapi_module_struct sapi_module; /* true global */ -END_EXTERN_C() - -/* Some values in this structure needs to be filled in before - * calling sapi_activate(). We WILL change the `char *' entries, - * so make sure that you allocate a separate buffer for them - * and that you free them after sapi_deactivate(). - */ - -typedef struct { - const char *request_method; - char *query_string; - char *post_data, *raw_post_data; - char *cookie_data; - long content_length; - uint post_data_length, raw_post_data_length; - - char *path_translated; - char *request_uri; - - const char *content_type; - - zend_bool headers_only; - zend_bool no_headers; - zend_bool headers_read; - - sapi_post_entry *post_entry; - - char *content_type_dup; - - /* for HTTP authentication */ - char *auth_user; - char *auth_password; - char *auth_digest; - - /* this is necessary for the CGI SAPI module */ - char *argv0; - - /* this is necessary for Safe Mode */ - char *current_user; - int current_user_length; - - /* this is necessary for CLI module */ - int argc; - char **argv; - int proto_num; -} sapi_request_info; - - -typedef struct _sapi_globals_struct { - void *server_context; - sapi_request_info request_info; - sapi_headers_struct sapi_headers; - int read_post_bytes; - unsigned char headers_sent; - struct stat global_stat; - char *default_mimetype; - char *default_charset; - HashTable *rfc1867_uploaded_files; - long post_max_size; - int options; - zend_bool sapi_started; - time_t global_request_time; - HashTable known_post_content_types; -} sapi_globals_struct; - - -BEGIN_EXTERN_C() -#ifdef ZTS -# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v) -SAPI_API extern int sapi_globals_id; -#else -# define SG(v) (sapi_globals.v) -extern SAPI_API sapi_globals_struct sapi_globals; -#endif - -SAPI_API void sapi_startup(sapi_module_struct *sf); -SAPI_API void sapi_shutdown(void); -SAPI_API void sapi_activate(TSRMLS_D); -SAPI_API void sapi_deactivate(TSRMLS_D); -SAPI_API void sapi_initialize_empty_request(TSRMLS_D); -END_EXTERN_C() - -/* - * This is the preferred and maintained API for - * operating on HTTP headers. - */ - -/* - * Always specify a sapi_header_line this way: - * - * sapi_header_line ctr = {0}; - */ - -typedef struct { - char *line; /* If you allocated this, you need to free it yourself */ - uint line_len; - long response_code; /* long due to zend_parse_parameters compatibility */ -} sapi_header_line; - -typedef enum { /* Parameter: */ - SAPI_HEADER_REPLACE, /* sapi_header_line* */ - SAPI_HEADER_ADD, /* sapi_header_line* */ - SAPI_HEADER_SET_STATUS /* int */ -} sapi_header_op_enum; - -BEGIN_EXTERN_C() -SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC); - -/* Deprecated functions. Use sapi_header_op instead. */ -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC); -#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1 TSRMLS_CC) - - -SAPI_API int sapi_send_headers(TSRMLS_D); -SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); -SAPI_API void sapi_handle_post(void *arg TSRMLS_DC); - -SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)); -SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC)); -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)); - -SAPI_API int sapi_flush(TSRMLS_D); -SAPI_API struct stat *sapi_get_stat(TSRMLS_D); -SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC); - -SAPI_API char *sapi_get_default_content_type(TSRMLS_D); -SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC); -SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC); -SAPI_API void sapi_update_default_charset(TSRMLS_D); -SAPI_API void sapi_activate_headers_only(TSRMLS_D); - -SAPI_API int sapi_get_fd(int *fd TSRMLS_DC); -SAPI_API int sapi_force_http_10(TSRMLS_D); - -SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC); -SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC); -SAPI_API time_t sapi_get_request_time(TSRMLS_D); -END_EXTERN_C() - -struct _sapi_module_struct { - char *name; - char *pretty_name; - - int (*startup)(struct _sapi_module_struct *sapi_module); - int (*shutdown)(struct _sapi_module_struct *sapi_module); - - int (*activate)(TSRMLS_D); - int (*deactivate)(TSRMLS_D); - - int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); - void (*flush)(void *server_context); - struct stat *(*get_stat)(TSRMLS_D); - char *(*getenv)(char *name, size_t name_len TSRMLS_DC); - - void (*sapi_error)(int type, const char *error_msg, ...); - - int (*header_handler)(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); - int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC); - void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC); - - int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC); - char *(*read_cookies)(TSRMLS_D); - - void (*register_server_variables)(zval *track_vars_array TSRMLS_DC); - void (*log_message)(char *message); - time_t (*get_request_time)(TSRMLS_D); - - char *php_ini_path_override; - - void (*block_interruptions)(void); - void (*unblock_interruptions)(void); - - void (*default_post_reader)(TSRMLS_D); - void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC); - char *executable_location; - - int php_ini_ignore; - - int (*get_fd)(int *fd TSRMLS_DC); - - int (*force_http_10)(TSRMLS_D); - - int (*get_target_uid)(uid_t * TSRMLS_DC); - int (*get_target_gid)(gid_t * TSRMLS_DC); - - unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC); - - void (*ini_defaults)(HashTable *configuration_hash); - int phpinfo_as_text; -}; - - -struct _sapi_post_entry { - char *content_type; - uint content_type_len; - void (*post_reader)(TSRMLS_D); - void (*post_handler)(char *content_type_dup, void *arg TSRMLS_DC); -}; - -/* header_handler() constants */ -#define SAPI_HEADER_ADD (1<<0) -#define SAPI_HEADER_DELETE_ALL (1<<1) -#define SAPI_HEADER_SEND_NOW (1<<2) - - -#define SAPI_HEADER_SENT_SUCCESSFULLY 1 -#define SAPI_HEADER_DO_SEND 2 -#define SAPI_HEADER_SEND_FAILED 3 - -#define SAPI_DEFAULT_MIMETYPE "text/html" -#define SAPI_DEFAULT_CHARSET "" -#define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION - -#define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D) -#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg TSRMLS_DC) - -#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC) -#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC) - -BEGIN_EXTERN_C() -SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data); -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); -SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data); -SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter); -END_EXTERN_C() - -#define STANDARD_SAPI_MODULE_PROPERTIES - -#endif /* SAPI_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/alloca.c b/main/alloca.c deleted file mode 100644 index 401649cee091c..0000000000000 --- a/main/alloca.c +++ /dev/null @@ -1,501 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -/* $Id$ */ - -#include - -#if !HAVE_ALLOCA - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef emacs -#include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -#ifndef alloca - -#ifdef emacs -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -#else -#define ADDRESS_FUNCTION(arg) &(arg) -#endif - -#if __STDC__ -typedef void *pointer; -#else -typedef char *pointer; -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* Direction unknown. */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -#else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -#define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -#endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - size_t size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -#ifdef emacs - BLOCK_INPUT; -#endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -#ifdef emacs - UNBLOCK_INPUT; -#endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = malloc (sizeof (header) + size); - /* Address of header. */ - - if (new == 0) - abort(); - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) - -#ifdef DEBUG_I00AFUNC -#include -#endif - -#ifndef CRAY_STACK -#define CRAY_STACK -#ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -#else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -#endif /* CRAY2 */ -#endif /* not CRAY_STACK */ - -#ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -#else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -#endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -#endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -#endif /* not CRAY2 */ -#endif /* CRAY */ - -#endif /* no alloca */ -#endif /* not GCC version 2 */ -#endif /* HAVE_ALLOCA */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/build-defs.h.in b/main/build-defs.h.in deleted file mode 100644 index 99c11c68ed3f7..0000000000000 --- a/main/build-defs.h.in +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- C -*- - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@" -#define PHP_ADA_INCLUDE "" -#define PHP_ADA_LFLAGS "" -#define PHP_ADA_LIBS "" -#define PHP_APACHE_INCLUDE "" -#define PHP_APACHE_TARGET "" -#define PHP_FHTTPD_INCLUDE "" -#define PHP_FHTTPD_LIB "" -#define PHP_FHTTPD_TARGET "" -#define PHP_CFLAGS "@CFLAGS@" -#define PHP_DBASE_LIB "" -#define PHP_BUILD_DEBUG "@DEBUG_CFLAGS@" -#define PHP_GDBM_INCLUDE "" -#define PHP_HSREGEX "" -#define PHP_IBASE_INCLUDE "" -#define PHP_IBASE_LFLAGS "" -#define PHP_IBASE_LIBS "" -#define PHP_IFX_INCLUDE "" -#define PHP_IFX_LFLAGS "" -#define PHP_IFX_LIBS "" -#define PHP_INSTALL_IT "@INSTALL_IT@" -#define PHP_IODBC_INCLUDE "" -#define PHP_IODBC_LFLAGS "" -#define PHP_IODBC_LIBS "" -#define PHP_MSQL_INCLUDE "" -#define PHP_MSQL_LFLAGS "" -#define PHP_MSQL_LIBS "" -#define PHP_MYSQL_INCLUDE "@MYSQL_INCLUDE@" -#define PHP_MYSQL_LIBS "@MYSQL_LIBS@" -#define PHP_MYSQL_TYPE "@MYSQL_MODULE_TYPE@" -#define PHP_ODBC_INCLUDE "@ODBC_INCLUDE@" -#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@" -#define PHP_ODBC_LIBS "@ODBC_LIBS@" -#define PHP_ODBC_TYPE "@ODBC_TYPE@" -#define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@" -#define PHP_OCI8_DIR "@OCI8_DIR@" -#define PHP_OCI8_VERSION "@OCI8_VERSION@" -#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@" -#define PHP_ORACLE_DIR "@ORACLE_DIR@" -#define PHP_ORACLE_VERSION "@ORACLE_VERSION@" -#define PHP_PGSQL_INCLUDE "" -#define PHP_PGSQL_LFLAGS "" -#define PHP_PGSQL_LIBS "" -#define PHP_PROG_SENDMAIL "@PROG_SENDMAIL@" -#define PHP_REGEX_LIB "" -#define PHP_SOLID_INCLUDE "" -#define PHP_SOLID_LIBS "" -#define PHP_EMPRESS_INCLUDE "" -#define PHP_EMPRESS_LIBS "" -#define PHP_SYBASE_INCLUDE "" -#define PHP_SYBASE_LFLAGS "" -#define PHP_SYBASE_LIBS "" -#define PHP_DBM_TYPE "" -#define PHP_DBM_LIB "" -#define PHP_LDAP_LFLAGS "" -#define PHP_LDAP_INCLUDE "" -#define PHP_LDAP_LIBS "" -#define PHP_BIRDSTEP_INCLUDE "" -#define PHP_BIRDSTEP_LIBS "" -#define PHP_INCLUDE_PATH "@INCLUDE_PATH@" -#define PHP_EXTENSION_DIR "@EXPANDED_EXTENSION_DIR@" -#define PHP_PREFIX "@prefix@" -#define PHP_BINDIR "@EXPANDED_BINDIR@" -#define PHP_LIBDIR "@EXPANDED_LIBDIR@" -#define PHP_DATADIR "@EXPANDED_DATADIR@" -#define PHP_SYSCONFDIR "@EXPANDED_SYSCONFDIR@" -#define PHP_LOCALSTATEDIR "@EXPANDED_LOCALSTATEDIR@" -#define PHP_CONFIG_FILE_PATH "@EXPANDED_PHP_CONFIG_FILE_PATH@" -#define PHP_CONFIG_FILE_SCAN_DIR "@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@" -#define PHP_SHLIB_SUFFIX "@SHLIB_SUFFIX_NAME@" diff --git a/main/config.w32.h b/main/config.w32.h deleted file mode 100644 index 724a8a1569ae2..0000000000000 --- a/main/config.w32.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - Build Configuration for Win32. - This has only been tested with MS VisualC++ 6 (and later). - - $Id$ -*/ - -/* Default PHP / PEAR directories */ -#define CONFIGURATION_FILE_PATH "php.ini" -#define PEAR_INSTALLDIR "c:\\php5\\pear" -#define PHP_BINDIR "c:\\php5" -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" -#define PHP_CONFIG_FILE_SCAN_DIR "" -#define PHP_DATADIR "c:\\php5" -#define PHP_EXTENSION_DIR "c:\\php5" -#define PHP_INCLUDE_PATH ".;c:\\php5\\pear" -#define PHP_LIBDIR "c:\\php5" -#define PHP_LOCALSTATEDIR "c:\\php5" -#define PHP_PREFIX "c:\\php5" -#define PHP_SYSCONFDIR "c:\\php5" - -/* Enable / Disable BCMATH extension (default: enabled) */ -#define HAVE_BCMATH 1 - -/* Enable / Disable crypt() function (default: enabled) */ -#define HAVE_CRYPT 1 -#define PHP_STD_DES_CRYPT 1 -#define PHP_EXT_DES_CRYPT 0 -#define PHP_MD5_CRYPT 1 -#define PHP_BLOWFISH_CRYPT 0 - -/* Enable / Disable CALENDAR extension (default: enabled) */ -#define HAVE_CALENDAR 1 - -/* Enable / Disable CTYPE extension (default: enabled) */ -#define HAVE_CTYPE 1 - -/* Enable / Disable FTP extension (default: enabled) */ -#define HAVE_FTP 1 - -/* Enable / Disable MBSTRING extension (default: disabled) */ -/* #define HAVE_MBSTRING 0 */ -/* #define HAVE_MBREGEX 0 */ -/* #define HAVE_MBSTR_CN 0 */ -/* #define HAVE_MBSTR_JA 0 */ -/* #define HAVE_MBSTR_KR 0 */ -/* #define HAVE_MBSTR_RU 0 */ -/* #define HAVE_MBSTR_TW 0 */ - -/* If you have the .Net SDK in your include path, define this - * to compile .Net support into your COM extension. */ -#define HAVE_MSCOREE_H 0 - -/* Enable / Disable ODBC extension (default: enabled) */ -#define HAVE_UODBC 1 - -/* Enable / Disable PCRE extension (default: enabled) */ -#define HAVE_BUNDLED_PCRE 1 -#define HAVE_PCRE 1 - -/* Enable / Disable SESSION extension (default: enabled) */ -#define HAVE_PHP_SESSION 1 - -/* Enable / Disable TOKENIZER extension (default: enabled) */ -#define HAVE_TOKENIZER 1 - -/* Enable / Disable WDDX extension (default: enabled) */ -#define HAVE_WDDX 1 - -/* Enable / Disable XML extensions (default: enabled) */ -#define HAVE_LIBXML 1 -#define HAVE_DOM 1 -#define HAVE_SIMPLEXML 1 -#define HAVE_XML 1 - -/* Enable / Disable ZLIB extension (default: enabled) */ -#define HAVE_ZLIB 1 - -/* Enable / Disable SQLite extension (default: enabled) */ -#define HAVE_SQLITE 1 - -/* PHP Runtime Configuration */ -#define FORCE_CGI_REDIRECT 1 -#define PHP_URL_FOPEN 1 -#define PHP_SAFE_MODE 0 -#define MAGIC_QUOTES 0 -#define USE_CONFIG_FILE 1 -#define DEFAULT_SHORT_OPEN_TAG "1" -#define ENABLE_PATHINFO_CHECK 1 - -/* Platform-Specific Configuration. Should not be changed. */ -#define PHP_SIGCHILD 0 -#define HAVE_LIBBIND 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETSERVBYPORT 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETPROTOBYNUMBER 1 -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#define HAVE_ERRMSG_H 0 -#undef HAVE_ADABAS -#undef HAVE_SOLID -#undef HAVE_LINK -#undef HAVE_SYMLINK - -/* its in win32/time.c */ -#define HAVE_USLEEP 1 - -#define HAVE_GETCWD 1 -#define HAVE_POSIX_READDIR_R 1 -#define NEED_ISBLANK 1 -#define DISCARD_PATH 0 -#undef HAVE_SETITIMER -#undef HAVE_IODBC -#define HAVE_LIBDL 1 -#define HAVE_SENDMAIL 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_PUTENV 1 -#define HAVE_LIMITS_H 1 -#define HAVE_TZSET 1 -#define HAVE_TZNAME 1 -#undef HAVE_FLOCK -#define HAVE_ALLOCA 1 -#undef HAVE_SYS_TIME_H -#define HAVE_SIGNAL_H 1 -#undef HAVE_ST_BLKSIZE -#undef HAVE_ST_BLOCKS -#define HAVE_ST_RDEV 1 -#define HAVE_UTIME_NULL 1 -#define HAVE_VPRINTF 1 -#define STDC_HEADERS 1 -#define REGEX 1 -#define HSREGEX 1 -#define HAVE_GCVT 1 -#define HAVE_GETLOGIN 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_PUTENV 1 -#define HAVE_REGCOMP 1 -#define HAVE_SETLOCALE 1 -#define HAVE_LOCALECONV 1 -#define HAVE_LOCALE_H 1 -#ifndef HAVE_LIBBIND -#define HAVE_SETVBUF 1 -#endif -#define HAVE_SHUTDOWN 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRSTR 1 -#define HAVE_TEMPNAM 1 -#define HAVE_UTIME 1 -#undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_GRP_H 0 -#define HAVE_PWD_H 1 -#define HAVE_STRING_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_SYS_SOCKET_H -#undef HAVE_SYS_WAIT_H -#define HAVE_SYSLOG_H 1 -#undef HAVE_UNISTD_H -#define HAVE_LIBDL 1 -#define HAVE_LIBM 1 -#define HAVE_CUSERID 0 -#undef HAVE_RINT -#define HAVE_STRFTIME 1 -/* int and long are stll 32bit in 64bit compiles */ -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 -#define SIZEOF_LONG_LONG 8 /* defined as __int64 */ -#define SIZEOF_INTMAX_T 0 -#define ssize_t SSIZE_T -#ifdef _WIN64 -# define SIZEOF_SIZE_T 8 -# define SIZEOF_PTRDIFF_T 8 -#else -# define SIZEOF_SIZE_T 4 -# define SIZEOF_PTRDIFF_T 4 -#endif -#define HAVE_GLOB -#define PHP_SHLIB_SUFFIX "dll" -#define HAVE_SQLDATASOURCES -#define POSIX_MALLOC_THRESHOLD 10 - - -/* - * defining HAVE_SOCKLEN_T prevents PHP from building with the latest platform SDK... - * #define HAVE_SOCKLEN_T - */ - -/* Win32 supports strcoll */ -#define HAVE_STRCOLL 1 - -/* Win32 support proc_open */ -#define PHP_CAN_SUPPORT_PROC_OPEN 1 - -#define HAVE_MBLEN diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c deleted file mode 100644 index ad9eecf790a6b..0000000000000 --- a/main/fopen_wrappers.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_globals.h" -#include "SAPI.h" - -#include -#include -#include -#include -#include -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#else -#include -#endif - -#include "safe_mode.h" -#include "ext/standard/head.h" -#include "ext/standard/php_standard.h" -#include "zend_compile.h" -#include "php_network.h" - -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif - -#include -#if HAVE_SYS_SOCKET_H -#include -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - -#ifdef PHP_WIN32 -#include -#elif defined(NETWARE) && defined(USE_WINSOCK) -#include -#else -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -#undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif -/* }}} */ - -/* {{{ php_check_specific_open_basedir - When open_basedir is not NULL, check if the given filename is located in - open_basedir. Returns -1 if error or not in the open_basedir, else 0 - - When open_basedir is NULL, always return 0 -*/ -PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC) -{ - char resolved_name[MAXPATHLEN]; - char resolved_basedir[MAXPATHLEN]; - char local_open_basedir[MAXPATHLEN]; - int resolved_basedir_len; - int resolved_name_len; - - /* Special case basedir==".": Use script-directory */ - if (strcmp(basedir, ".") || !VCWD_GETCWD(local_open_basedir, MAXPATHLEN)) { - /* Else use the unmodified path */ - strlcpy(local_open_basedir, basedir, sizeof(local_open_basedir)); - } - - /* Resolve the real path into resolved_name */ - if ((expand_filepath(path, resolved_name TSRMLS_CC) != NULL) && (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL)) { - /* Handler for basedirs that end with a / */ - resolved_basedir_len = strlen(resolved_basedir); - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { - if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { - resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; - resolved_basedir[++resolved_basedir_len] = '\0'; - } - } - - if (path[strlen(path)-1] == PHP_DIR_SEPARATOR) { - resolved_name_len = strlen(resolved_name); - if (resolved_name[resolved_name_len - 1] != PHP_DIR_SEPARATOR) { - resolved_name[resolved_name_len] = PHP_DIR_SEPARATOR; - resolved_name[++resolved_name_len] = '\0'; - } - } - - /* Check the path */ -#if defined(PHP_WIN32) || defined(NETWARE) - if (strncasecmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) { -#else - if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) { -#endif - /* File is in the right directory */ - return 0; - } else { - return -1; - } - } else { - /* Unable to resolve the real path, return -1 */ - return -1; - } -} -/* }}} */ - -PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC) -{ - return php_check_open_basedir_ex(path, 1 TSRMLS_CC); -} - -/* {{{ php_check_open_basedir - */ -PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC) -{ - /* Only check when open_basedir is available */ - if (PG(open_basedir) && *PG(open_basedir)) { - char *pathbuf; - char *ptr; - char *end; - - pathbuf = estrdup(PG(open_basedir)); - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - - if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) { - efree(pathbuf); - return 0; - } - - ptr = end; - } - if (warn) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s)", path, PG(open_basedir)); - } - efree(pathbuf); - errno = EPERM; /* we deny permission to open it */ - return -1; - } - - /* Nothing to check... */ - return 0; -} -/* }}} */ - -/* {{{ php_check_safe_mode_include_dir - */ -PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC) -{ - if (PG(safe_mode)) { - if (PG(safe_mode_include_dir) && *PG(safe_mode_include_dir)) { - char *pathbuf; - char *ptr; - char *end; - char resolved_name[MAXPATHLEN]; - - /* Resolve the real path into resolved_name */ - if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) - return -1; - - pathbuf = estrdup(PG(safe_mode_include_dir)); - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - - /* Check the path */ -#ifdef PHP_WIN32 - if (strncasecmp(ptr, resolved_name, strlen(ptr)) == 0) -#else - if (strncmp(ptr, resolved_name, strlen(ptr)) == 0) -#endif - { - /* File is in the right directory */ - efree(pathbuf); - return 0; - } - - ptr = end; - } - efree(pathbuf); - } - return -1; - } - - /* Nothing to check... */ - return 0; -} -/* }}} */ - -/* {{{ php_fopen_and_set_opened_path - */ -static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC) -{ - FILE *fp; - - if (php_check_open_basedir((char *)path TSRMLS_CC)) { - return NULL; - } - fp = VCWD_FOPEN(path, mode); - if (fp && opened_path) { - *opened_path = expand_filepath(path, NULL TSRMLS_CC); - } - return fp; -} -/* }}} */ - -/* {{{ php_fopen_primary_script - */ -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) -{ - FILE *fp; - struct stat st; - char *path_info, *filename; - int length; - - filename = SG(request_info).path_translated; - path_info = SG(request_info).request_uri; -#if HAVE_PWD_H - if (PG(user_dir) && *PG(user_dir) - && path_info && '/' == path_info[0] && '~' == path_info[1]) { - - char user[32]; - struct passwd *pw; - char *s = strchr(path_info + 2, '/'); - - filename = NULL; /* discard the original filename, it must not be used */ - if (s) { /* if there is no path name after the file, do not bother */ - /* to try open the directory */ - length = s - (path_info + 2); - if (length > (int)sizeof(user) - 1) - length = sizeof(user) - 1; - memcpy(user, path_info + 2, length); - user[length] = '\0'; - - pw = getpwnam(user); - if (pw && pw->pw_dir) { - filename = emalloc(strlen(PG(user_dir)) + strlen(path_info) + strlen(pw->pw_dir) + 4); - if (filename) { - sprintf(filename, "%s%c%s%c%s", pw->pw_dir, PHP_DIR_SEPARATOR, - PG(user_dir), PHP_DIR_SEPARATOR, s+1); /* Safe */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = filename; - } - } - } - } else -#endif - if (PG(doc_root) && path_info) { - length = strlen(PG(doc_root)); - if (IS_ABSOLUTE_PATH(PG(doc_root), length)) { - filename = emalloc(length + strlen(path_info) + 2); - if (filename) { - memcpy(filename, PG(doc_root), length); - if (!IS_SLASH(filename[length - 1])) { /* length is never 0 */ - filename[length++] = PHP_DIR_SEPARATOR; - } - if (IS_SLASH(path_info[0])) { - length--; - } - strcpy(filename + length, path_info); - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = filename; - } - } - } /* if doc_root && path_info */ - - if (!filename) { - /* we have to free SG(request_info).path_translated here because - php_destroy_request_info assumes that it will get - freed when the include_names hash is emptied, but - we're not adding it in this case */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - return FAILURE; - } - fp = VCWD_FOPEN(filename, "rb"); - - /* refuse to open anything that is not a regular file */ - if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) { - fclose(fp); - fp = NULL; - } - if (!fp) { - STR_FREE(SG(request_info).path_translated); /* for same reason as above */ - SG(request_info).path_translated = NULL; - return FAILURE; - } - - file_handle->opened_path = expand_filepath(filename, NULL TSRMLS_CC); - - if (!(SG(options) & SAPI_OPTION_NO_CHDIR)) { - VCWD_CHDIR_FILE(filename); - } - SG(request_info).path_translated = filename; - - file_handle->filename = SG(request_info).path_translated; - file_handle->free_filename = 0; - file_handle->handle.fp = fp; - file_handle->type = ZEND_HANDLE_FP; - - return SUCCESS; -} -/* }}} */ - -/* {{{ php_fopen_with_path - * Tries to open a file with a PATH-style list of directories. - * If the filename starts with "." or "/", the path is ignored. - */ -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC) -{ - char *pathbuf, *ptr, *end; - char *exec_fname; - char trypath[MAXPATHLEN]; - struct stat sb; - FILE *fp; - int path_length; - int filename_length; - int exec_fname_length; - - if (opened_path) { - *opened_path = NULL; - } - - if(!filename) { - return NULL; - } - - filename_length = strlen(filename); - - /* Relative path open */ - if (*filename == '.') { - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - /* - * files in safe_mode_include_dir (or subdir) are excluded from - * safe mode GID/UID checks - */ - - /* Absolute path open */ - if (IS_ABSOLUTE_PATH(filename, filename_length)) { - if ((php_check_safe_mode_include_dir(filename TSRMLS_CC)) == 0) - /* filename is in safe_mode_include_dir (or subdir) */ - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) - return NULL; - - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - if (!path || (path && !*path)) { - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - /* check in provided path */ - /* append the calling scripts' current working directory - * as a fall back case - */ - if (zend_is_executing(TSRMLS_C)) { - exec_fname = zend_get_executed_filename(TSRMLS_C); - exec_fname_length = strlen(exec_fname); - path_length = strlen(path); - - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); - if ((exec_fname && exec_fname[0] == '[') - || exec_fname_length<=0) { - /* [no active file] or no path */ - pathbuf = estrdup(path); - } else { - pathbuf = (char *) emalloc(exec_fname_length + path_length +1 +1); - memcpy(pathbuf, path, path_length); - pathbuf[path_length] = DEFAULT_DIR_SEPARATOR; - memcpy(pathbuf+path_length+1, exec_fname, exec_fname_length); - pathbuf[path_length + exec_fname_length +1] = '\0'; - } - } else { - pathbuf = estrdup(path); - } - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename); - if (PG(safe_mode)) { - if (VCWD_STAT(trypath, &sb) == 0) { - /* file exists ... check permission */ - if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || - php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM)) - /* UID ok, or trypath is in safe_mode_include_dir */ - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); - else - fp = NULL; - - efree(pathbuf); - return fp; - } - } - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); - if (fp) { - efree(pathbuf); - return fp; - } - ptr = end; - } /* end provided path */ - - efree(pathbuf); - return NULL; -} -/* }}} */ - -/* {{{ php_strip_url_passwd - */ -PHPAPI char *php_strip_url_passwd(char *url) -{ - register char *p, *url_start; - - if (url == NULL) { - return ""; - } - - p = url; - - while (*p) { - if (*p==':' && *(p+1)=='/' && *(p+2)=='/') { - /* found protocol */ - url_start = p = p+3; - - while (*p) { - if (*p=='@') { - int i; - - for (i=0; i<3 && url_startMAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; - memcpy(real_path, new_state.cwd, copy_len); - real_path[copy_len]='\0'; - } else { - real_path = estrndup(new_state.cwd, new_state.cwd_length); - } - free(new_state.cwd); - - return real_path; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h deleted file mode 100644 index d4348e9dc6209..0000000000000 --- a/main/fopen_wrappers.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef FOPEN_WRAPPERS_H -#define FOPEN_WRAPPERS_H - -BEGIN_EXTERN_C() -#include "php_globals.h" - -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC); -PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC); - -PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC); -PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC); -PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC); - -PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC); - -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC); - -PHPAPI int php_is_url(char *path); -PHPAPI char *php_strip_url_passwd(char *path); -END_EXTERN_C() - -#endif -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in deleted file mode 100644 index f67ed190c9a22..0000000000000 --- a/main/internal_functions.c.in +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- C -*- - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -@EXT_INCLUDE_CODE@ - -zend_module_entry *php_builtin_extensions[] = { -@EXT_MODULE_PTRS@ -}; - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c deleted file mode 100644 index 6ae4ca62205e6..0000000000000 --- a/main/internal_functions_nw.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - | Modified for NetWare: Novell, Inc. | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -#include "ext/bcmath/php_bcmath.h" -#include "ext/gd/php_gd.h" -#include "ext/standard/dl.h" -#include "ext/standard/file.h" -#include "ext/standard/fsock.h" -#include "ext/standard/head.h" -#include "ext/standard/pack.h" -#include "ext/standard/php_browscap.h" -/*#include "ext/standard/php_crypt.h"*/ -#include "ext/standard/php_dir.h" -#include "ext/standard/php_filestat.h" -#include "ext/standard/php_mail.h" -/*#include "ext/standard/php_ext_syslog.h"*/ -#include "ext/standard/php_standard.h" -#include "ext/standard/php_lcg.h" -#include "ext/standard/php_array.h" -#include "ext/standard/php_assert.h" -#include "ext/calendar/php_calendar.h" -/*#include "ext/com/php_COM.h" -#include "ext/com/php_VARIANT.h"*/ -#include "ext/ftp/php_ftp.h" -#include "ext/standard/reg.h" -#include "ext/pcre/php_pcre.h" -/*#include "ext/odbc/php_odbc.h"*/ /* Commented out for now */ -#include "ext/session/php_session.h" -/*#include "ext/xml/php_xml.h" -#include "ext/wddx/php_wddx.h" -#include "ext/mysql/php_mysql.h"*/ /* Commented out for now */ -/* }}} */ - -/* {{{ php_builtin_extensions[] - */ -zend_module_entry *php_builtin_extensions[] = { - phpext_standard_ptr, -#if HAVE_BCMATH - phpext_bcmath_ptr, -#endif - phpext_calendar_ptr, -/* COM_module_ptr,*/ - phpext_ftp_ptr, -#if defined(MBSTR_ENC_TRANS) - phpext_mbstring_ptr, -#endif -/* phpext_mysql_ptr,*/ /* Commented out for now */ -/* phpext_odbc_ptr, */ /* Commented out for now */ - phpext_pcre_ptr, - phpext_session_ptr, -/* phpext_xml_ptr, - phpext_wddx_ptr */ /* Commented out for now */ -}; -/* }}} */ - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c deleted file mode 100644 index 3f58733d6ab88..0000000000000 --- a/main/internal_functions_win32.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -#ifndef ZEND_ENGINE_2 -#error HEAD does not work with ZendEngine1 anymore -#endif - -#include "ext/standard/dl.h" -#include "ext/standard/file.h" -#include "ext/standard/fsock.h" -#include "ext/standard/head.h" -#include "ext/standard/pack.h" -#include "ext/standard/php_browscap.h" -#include "ext/standard/php_crypt.h" -#include "ext/standard/php_dir.h" -#include "ext/standard/php_filestat.h" -#include "ext/standard/php_mail.h" -#include "ext/standard/php_ext_syslog.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/php_lcg.h" -#include "ext/standard/php_array.h" -#include "ext/standard/php_assert.h" -#if HAVE_BCMATH -#include "ext/bcmath/php_bcmath.h" -#endif -#if HAVE_CALENDAR -#include "ext/calendar/php_calendar.h" -#endif -#if HAVE_CTYPE -#include "ext/ctype/php_ctype.h" -#endif -#if HAVE_FTP -#include "ext/ftp/php_ftp.h" -#endif -#include "ext/standard/reg.h" -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" -#endif -#if HAVE_UODBC -#include "ext/odbc/php_odbc.h" -#endif -#if HAVE_PHP_SESSION -#include "ext/session/php_session.h" -#endif -#if HAVE_MBSTRING -#include "ext/mbstring/mbstring.h" -#endif -#if HAVE_TOKENIZER -#include "ext/tokenizer/php_tokenizer.h" -#endif -#if HAVE_ZLIB -#include "ext/zlib/php_zlib.h" -#endif -#if HAVE_LIBXML -#include "ext/libxml/php_libxml.h" -#if HAVE_DOM -#include "ext/dom/php_dom.h" -#endif -#if HAVE_SIMPLEXML -#include "ext/simplexml/php_simplexml.h" -#endif -#endif -#if HAVE_XML -#include "ext/xml/php_xml.h" -#endif -#if HAVE_XML && HAVE_WDDX -#include "ext/wddx/php_wddx.h" -#endif -#ifdef HAVE_SQLITE -#include "ext/sqlite/php_sqlite.h" -#endif -#include "ext/com_dotnet/php_com_dotnet.h" -/* }}} */ - -/* {{{ php_builtin_extensions[] - */ -zend_module_entry *php_builtin_extensions[] = { - phpext_standard_ptr -#if HAVE_BCMATH - ,phpext_bcmath_ptr -#endif -#if HAVE_CALENDAR - ,phpext_calendar_ptr -#endif - ,phpext_com_dotnet_ptr -#if HAVE_CTYPE - ,phpext_ctype_ptr -#endif -#if HAVE_FTP - ,phpext_ftp_ptr -#endif -#if HAVE_MBSTRING - ,phpext_mbstring_ptr -#endif -#if HAVE_UODBC - ,phpext_odbc_ptr -#endif -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - ,phpext_pcre_ptr -#endif -#if HAVE_PHP_SESSION - ,phpext_session_ptr -#endif -#if HAVE_TOKENIZER - ,phpext_tokenizer_ptr -#endif -#if HAVE_ZLIB - ,phpext_zlib_ptr -#endif -#if HAVE_LIBXML - ,phpext_libxml_ptr -#if HAVE_DOM - ,phpext_dom_ptr -#endif -#if HAVE_SIMPLEXML - ,phpext_simplexml_ptr -#endif -#endif -#if HAVE_XML - ,phpext_xml_ptr -#endif -#if HAVE_XML && HAVE_WDDX - ,phpext_wddx_ptr -#endif -#if HAVE_SQLITE - ,phpext_sqlite_ptr -#endif -}; -/* }}} */ - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/logos.h b/main/logos.h deleted file mode 100644 index ff04f20b97588..0000000000000 --- a/main/logos.h +++ /dev/null @@ -1,1352 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define CONTEXT_TYPE_IMAGE_GIF "Content-Type: image/gif" - -unsigned char zend_logo[] = { - 71, 73, 70, 56, 57, 97, 113, 0, 72, 0, - 213, 0, 0, 13, 13, 14, 1, 3, 6, 2, - 5, 9, 46, 68, 94, 21, 29, 39, 5, 15, - 26, 4, 10, 17, 29, 43, 58, 0, 1, 2, - 9, 25, 42, 38, 105, 171, 24, 67, 109, 13, - 36, 59, 10, 27, 45, 9, 25, 41, 35, 96, - 157, 32, 87, 142, 29, 79, 130, 26, 70, 114, - 20, 54, 87, 29, 77, 124, 10, 26, 42, 34, - 88, 141, 10, 24, 38, 11, 26, 41, 1, 2, - 3, 55, 80, 105, 45, 63, 81, 49, 53, 57, - 5, 15, 24, 9, 26, 42, 30, 85, 138, 33, - 92, 149, 26, 73, 117, 10, 28, 45, 32, 89, - 142, 30, 84, 134, 26, 72, 115, 15, 42, 67, - 23, 62, 99, 12, 32, 51, 7, 21, 33, 9, - 26, 41, 8, 23, 35, 7, 25, 37, 51, 58, - 63, 2, 4, 5, 25, 26, 26, 49, 50, 50, - 255, 102, 0, 255, 255, 255, 204, 204, 204, 199, - 199, 199, 191, 191, 191, 171, 171, 171, 146, 146, - 146, 115, 115, 115, 85, 85, 85, 60, 60, 60, - 55, 55, 55, 38, 38, 38, 7, 7, 7, 3, - 3, 3, 0, 0, 0, 44, 0, 0, 0, 0, - 113, 0, 72, 0, 0, 6, 255, 192, 153, 112, - 72, 44, 26, 143, 200, 164, 114, 121, 252, 49, - 159, 208, 168, 148, 248, 171, 58, 167, 210, 171, - 208, 170, 197, 122, 191, 70, 109, 23, 140, 236, - 138, 201, 232, 239, 121, 102, 221, 186, 217, 219, - 171, 83, 46, 110, 15, 207, 235, 180, 190, 124, - 135, 187, 229, 127, 127, 128, 112, 121, 108, 118, - 132, 123, 137, 77, 118, 120, 136, 115, 109, 117, - 85, 126, 147, 147, 128, 99, 138, 137, 99, 107, - 146, 146, 148, 133, 159, 125, 136, 152, 163, 151, - 135, 121, 144, 84, 157, 92, 169, 157, 111, 163, - 175, 176, 83, 151, 177, 180, 181, 161, 182, 184, - 185, 186, 187, 188, 189, 67, 54, 56, 58, 56, - 53, 190, 197, 88, 55, 57, 60, 63, 2, 43, - 2, 56, 198, 208, 74, 192, 58, 0, 63, 5, - 12, 11, 35, 35, 12, 47, 209, 222, 67, 53, - 201, 203, 34, 19, 20, 218, 231, 37, 63, 54, - 223, 222, 60, 2, 216, 231, 241, 231, 206, 76, - 193, 55, 236, 176, 63, 39, 242, 252, 35, 40, - 58, 75, 114, 8, 40, 240, 227, 25, 62, 76, - 60, 24, 244, 147, 55, 161, 202, 11, 24, 57, - 134, 17, 201, 241, 99, 130, 191, 130, 7, 21, - 225, 48, 176, 48, 30, 137, 5, 11, 38, 48, - 88, 81, 5, 198, 51, 138, 22, 181, 53, 52, - 152, 49, 141, 141, 31, 230, 58, 46, 60, 129, - 194, 74, 202, 115, 43, 91, 234, 1, 112, 83, - 102, 63, 255, 18, 38, 122, 226, 252, 145, 67, - 39, 153, 26, 47, 68, 248, 92, 186, 176, 97, - 81, 163, 88, 108, 188, 48, 80, 130, 169, 85, - 134, 68, 161, 74, 177, 1, 160, 0, 137, 171, - 96, 135, 62, 213, 186, 132, 171, 215, 176, 104, - 71, 52, 188, 71, 54, 9, 210, 179, 105, 195, - 166, 99, 219, 214, 198, 58, 34, 48, 12, 124, - 213, 38, 163, 175, 223, 191, 50, 22, 132, 216, - 139, 182, 132, 0, 30, 196, 250, 218, 37, 70, - 198, 198, 141, 199, 144, 31, 223, 253, 114, 163, - 10, 0, 97, 192, 126, 100, 59, 7, 24, 176, - 10, 20, 229, 210, 146, 48, 128, 88, 72, 223, - 28, 57, 38, 111, 197, 17, 163, 181, 235, 215, - 58, 116, 68, 100, 60, 5, 134, 136, 18, 19, - 80, 24, 168, 162, 48, 94, 95, 21, 6, 82, - 168, 80, 209, 215, 128, 1, 20, 39, 8, 95, - 37, 81, 160, 180, 105, 25, 177, 233, 62, 1, - 246, 186, 186, 245, 24, 209, 177, 84, 140, 71, - 97, 130, 114, 109, 33, 76, 48, 152, 176, 192, - 111, 135, 20, 222, 211, 54, 167, 61, 163, 111, - 246, 39, 55, 174, 203, 175, 254, 30, 74, 229, - 152, 62, 73, 132, 24, 60, 162, 47, 131, 14, - 12, 132, 224, 155, 95, 130, 145, 208, 89, 129, - 40, 116, 211, 25, 12, 58, 72, 135, 68, 124, - 214, 197, 38, 161, 14, 243, 73, 200, 222, 18, - 27, 161, 213, 215, 4, 159, 37, 199, 255, 25, - 96, 12, 116, 230, 223, 9, 11, 252, 32, 226, - 11, 13, 74, 35, 223, 132, 19, 174, 24, 27, - 75, 76, 192, 128, 66, 88, 126, 161, 160, 66, - 122, 124, 201, 112, 2, 3, 195, 125, 54, 65, - 95, 29, 4, 87, 227, 9, 126, 233, 192, 3, - 12, 125, 161, 232, 160, 93, 207, 184, 200, 98, - 139, 17, 74, 24, 197, 118, 96, 249, 7, 160, - 128, 31, 242, 72, 30, 72, 33, 244, 149, 2, - 122, 229, 201, 0, 224, 105, 60, 52, 216, 23, - 131, 14, 226, 96, 194, 1, 78, 74, 152, 195, - 13, 196, 208, 192, 90, 148, 177, 217, 7, 83, - 149, 50, 112, 136, 220, 94, 34, 22, 216, 159, - 12, 195, 101, 227, 37, 113, 50, 192, 0, 3, - 156, 238, 165, 72, 196, 11, 21, 178, 184, 228, - 117, 19, 66, 145, 225, 85, 53, 222, 72, 152, - 136, 42, 152, 32, 224, 111, 42, 8, 10, 40, - 161, 101, 222, 96, 67, 95, 61, 40, 58, 3, - 13, 55, 24, 112, 221, 101, 19, 226, 64, 131, - 17, 54, 64, 42, 229, 19, 50, 226, 249, 95, - 128, 127, 238, 23, 166, 113, 194, 105, 250, 103, - 160, 191, 18, 90, 232, 13, 59, 0, 249, 130, - 168, 56, 160, 198, 195, 10, 214, 161, 144, 1, - 131, 245, 21, 1, 33, 125, 177, 141, 181, 4, - 149, 76, 137, 232, 23, 3, 38, 132, 9, 216, - 9, 93, 126, 234, 105, 160, 34, 94, 208, 129, - 14, 7, 152, 112, 255, 2, 4, 40, 84, 80, - 157, 8, 30, 176, 154, 195, 133, 68, 200, 250, - 34, 124, 119, 102, 171, 109, 113, 157, 142, 16, - 238, 111, 160, 113, 58, 110, 167, 38, 252, 213, - 192, 193, 12, 72, 32, 193, 3, 15, 128, 192, - 128, 7, 175, 121, 32, 66, 7, 101, 230, 240, - 42, 18, 53, 216, 171, 131, 106, 73, 224, 32, - 0, 88, 221, 217, 216, 227, 200, 190, 234, 39, - 210, 112, 12, 36, 23, 158, 175, 254, 154, 160, - 105, 9, 5, 236, 88, 129, 7, 41, 83, 240, - 65, 195, 32, 56, 236, 128, 107, 14, 36, 208, - 64, 10, 24, 41, 161, 177, 181, 74, 84, 182, - 194, 4, 85, 45, 181, 239, 134, 11, 236, 165, - 31, 151, 95, 233, 199, 223, 8, 82, 27, 40, - 3, 9, 39, 144, 56, 24, 4, 92, 119, 61, - 129, 3, 96, 135, 221, 128, 8, 12, 0, 64, - 239, 47, 26, 59, 88, 52, 53, 227, 132, 182, - 208, 210, 128, 178, 76, 163, 12, 46, 135, 208, - 245, 221, 92, 3, 21, 54, 216, 9, 152, 208, - 48, 64, 72, 12, 237, 197, 52, 0, 152, 208, - 209, 111, 193, 141, 204, 239, 102, 104, 45, 96, - 128, 9, 20, 224, 45, 249, 215, 97, 51, 240, - 1, 8, 10, 152, 80, 20, 14, 56, 208, 213, - 38, 199, 181, 245, 214, 207, 111, 96, 130, 4, - 146, 72, 114, 135, 69, 194, 10, 38, 64, 0, - 130, 228, 120, 71, 240, 181, 8, 145, 67, 240, - 255, 128, 2, 44, 164, 0, 26, 2, 66, 180, - 9, 163, 23, 56, 20, 112, 184, 184, 242, 232, - 119, 224, 212, 127, 18, 56, 152, 95, 14, 252, - 8, 88, 129, 120, 255, 37, 216, 205, 17, 68, - 160, 192, 3, 24, 212, 64, 131, 198, 58, 92, - 12, 70, 101, 223, 125, 8, 172, 60, 218, 166, - 252, 149, 136, 41, 251, 21, 64, 249, 201, 117, - 221, 89, 202, 151, 131, 112, 251, 9, 211, 194, - 54, 161, 218, 88, 212, 128, 237, 128, 207, 35, - 15, 164, 144, 125, 65, 78, 141, 206, 3, 164, - 0, 245, 69, 0, 34, 248, 95, 10, 134, 68, - 2, 8, 244, 101, 71, 97, 3, 77, 237, 70, - 240, 0, 18, 248, 110, 15, 58, 80, 10, 63, - 48, 37, 55, 47, 129, 169, 128, 86, 10, 152, - 12, 132, 19, 166, 2, 36, 112, 132, 31, 20, - 83, 128, 28, 40, 3, 6, 52, 207, 116, 91, - 227, 218, 3, 218, 68, 52, 50, 224, 32, 95, - 228, 147, 1, 175, 134, 211, 65, 226, 13, 138, - 116, 222, 249, 77, 1, 10, 38, 3, 7, 52, - 160, 47, 96, 91, 0, 11, 83, 224, 128, 62, - 197, 176, 107, 32, 224, 222, 217, 192, 240, 130, - 25, 109, 16, 133, 91, 242, 159, 15, 63, 37, - 176, 63, 25, 64, 0, 68, 108, 128, 7, 144, - 232, 0, 37, 146, 81, 68, 14, 208, 20, 20, - 163, 72, 167, 216, 128, 14, 85, 201, 66, 205, - 155, 110, 224, 61, 37, 220, 255, 16, 63, 226, - 235, 215, 135, 194, 5, 44, 78, 249, 5, 61, - 86, 251, 65, 5, 36, 208, 23, 15, 52, 177, - 136, 101, 100, 97, 18, 195, 197, 171, 52, 218, - 205, 117, 51, 108, 163, 169, 132, 16, 171, 54, - 118, 174, 142, 69, 48, 75, 248, 224, 22, 162, - 45, 146, 171, 51, 8, 160, 221, 25, 17, 105, - 70, 82, 90, 237, 91, 131, 137, 164, 37, 137, - 80, 73, 238, 221, 11, 86, 93, 9, 95, 242, - 180, 101, 128, 46, 10, 236, 148, 126, 177, 6, - 5, 70, 153, 68, 69, 38, 18, 2, 255, 42, - 34, 104, 34, 160, 74, 106, 9, 99, 8, 245, - 51, 230, 147, 126, 55, 131, 26, 196, 178, 35, - 225, 25, 153, 52, 131, 82, 55, 240, 84, 19, - 107, 60, 234, 11, 0, 12, 16, 1, 16, 148, - 160, 110, 43, 123, 100, 56, 243, 22, 2, 145, - 128, 45, 101, 16, 152, 15, 118, 44, 54, 131, - 100, 218, 239, 73, 111, 58, 66, 13, 120, 0, - 151, 133, 60, 205, 116, 248, 20, 12, 5, 246, - 227, 52, 126, 106, 195, 120, 50, 56, 146, 1, - 46, 247, 1, 126, 86, 141, 156, 79, 132, 192, - 61, 67, 240, 1, 117, 182, 6, 85, 141, 90, - 38, 232, 134, 176, 17, 89, 198, 165, 35, 134, - 17, 70, 14, 92, 32, 63, 134, 141, 224, 117, - 176, 11, 105, 215, 44, 232, 208, 136, 178, 72, - 34, 118, 212, 203, 69, 173, 226, 148, 26, 216, - 133, 7, 255, 39, 80, 192, 4, 102, 42, 191, - 17, 136, 52, 164, 37, 109, 211, 253, 48, 137, - 49, 122, 90, 116, 165, 255, 100, 64, 86, 40, - 74, 128, 22, 0, 224, 6, 48, 152, 128, 2, - 64, 122, 211, 187, 229, 84, 153, 142, 226, 169, - 18, 230, 41, 128, 164, 1, 149, 31, 37, 98, - 166, 93, 134, 192, 129, 133, 49, 181, 169, 36, - 125, 234, 147, 36, 68, 71, 47, 80, 213, 170, - 252, 32, 79, 92, 232, 177, 4, 14, 80, 32, - 103, 77, 229, 218, 83, 177, 51, 214, 6, 73, - 53, 10, 103, 237, 71, 67, 126, 96, 0, 164, - 133, 69, 4, 128, 147, 134, 15, 72, 240, 85, - 174, 229, 236, 176, 175, 203, 105, 93, 223, 116, - 215, 41, 228, 53, 30, 43, 177, 65, 14, 94, - 80, 133, 21, 160, 64, 93, 75, 153, 0, 0, - 158, 224, 130, 19, 60, 224, 110, 57, 99, 216, - 237, 74, 0, 130, 8, 120, 192, 3, 99, 243, - 192, 97, 234, 58, 161, 120, 42, 226, 177, 106, - 9, 26, 37, 57, 167, 131, 23, 8, 207, 39, - 20, 248, 1, 254, 136, 80, 3, 20, 44, 21, - 180, 32, 32, 79, 4, 80, 16, 128, 11, 64, - 64, 4, 34, 80, 65, 7, 94, 80, 38, 214, - 202, 102, 183, 105, 168, 1, 12, 170, 26, 219, - 26, 34, 19, 135, 29, 41, 128, 117, 137, 128, - 3, 9, 252, 214, 176, 15, 24, 64, 15, 56, - 247, 12, 24, 168, 75, 4, 6, 0, 135, 192, - 14, 156, 139, 82, 90, 8, 164, 38, 219, 29, - 2, 79, 150, 194, 0, 24, 44, 97, 7, 22, - 184, 29, 195, 58, 106, 223, 58, 230, 160, 156, - 68, 89, 108, 89, 115, 145, 3, 147, 48, 33, - 131, 50, 89, 0, 3, 4, 16, 95, 33, 220, - 224, 5, 26, 64, 193, 91, 111, 167, 57, 35, - 132, 35, 53, 148, 116, 12, 100, 166, 248, 13, - 143, 241, 163, 59, 34, 16, 192, 15, 120, 208, - 222, 36, 208, 192, 49, 63, 216, 192, 9, 36, - 192, 128, 137, 114, 152, 44, 47, 217, 140, 130, - 9, 114, 25, 28, 76, 148, 9, 162, 2, 128, - 141, 219, 50, 5, 122, 134, 120, 196, 174, 141, - 46, 143, 167, 96, 131, 23, 221, 120, 200, 72, - 214, 74, 16, 0, 0, 59 }; - -unsigned char php_logo[] = { - 71, 73, 70, 56, 57, 97, 120, 0, 67, 0, - 247, 255, 0, 0, 0, 0, 73, 72, 73, 233, - 231, 234, 228, 224, 232, 65, 64, 67, 228, 227, - 230, 80, 78, 86, 61, 60, 64, 215, 213, 223, - 201, 199, 213, 99, 97, 116, 84, 83, 92, 192, - 190, 208, 105, 103, 127, 102, 100, 123, 183, 181, - 203, 216, 215, 225, 143, 141, 174, 89, 88, 104, - 160, 158, 186, 95, 94, 109, 106, 105, 133, 98, - 97, 121, 165, 164, 189, 175, 174, 199, 151, 150, - 196, 145, 144, 178, 161, 160, 194, 152, 151, 183, - 7, 7, 10, 28, 28, 38, 14, 14, 19, 138, - 138, 185, 129, 129, 173, 102, 102, 137, 151, 151, - 202, 146, 146, 195, 145, 145, 194, 130, 130, 174, - 116, 116, 155, 97, 97, 130, 152, 152, 202, 151, - 151, 201, 149, 149, 198, 148, 148, 197, 147, 147, - 196, 145, 145, 193, 142, 142, 189, 140, 140, 186, - 137, 137, 182, 136, 136, 181, 133, 133, 177, 128, - 128, 170, 113, 113, 150, 106, 106, 141, 101, 101, - 134, 90, 90, 120, 3, 3, 4, 127, 127, 168, - 99, 99, 131, 40, 40, 53, 146, 146, 192, 133, - 133, 174, 120, 120, 157, 96, 96, 126, 48, 48, - 63, 131, 131, 171, 101, 101, 130, 100, 100, 127, - 135, 135, 170, 155, 155, 194, 138, 138, 172, 101, - 101, 126, 113, 113, 140, 100, 100, 124, 170, 170, - 199, 222, 222, 239, 217, 217, 234, 206, 206, 220, - 58, 58, 61, 211, 211, 220, 231, 231, 238, 220, - 220, 227, 215, 215, 220, 196, 196, 199, 209, 209, - 211, 183, 183, 185, 253, 253, 254, 102, 103, 143, - 138, 139, 188, 98, 99, 134, 124, 125, 168, 108, - 109, 147, 133, 134, 180, 103, 104, 139, 99, 100, - 134, 122, 123, 163, 144, 145, 188, 149, 150, 193, - 127, 128, 165, 131, 132, 169, 157, 158, 199, 111, - 115, 176, 113, 117, 178, 93, 96, 144, 116, 119, - 178, 127, 131, 192, 118, 121, 178, 107, 110, 162, - 120, 123, 180, 118, 121, 176, 115, 118, 171, 126, - 129, 186, 120, 123, 177, 117, 120, 173, 106, 109, - 155, 75, 77, 109, 113, 115, 163, 127, 130, 182, - 110, 112, 157, 99, 101, 140, 98, 100, 137, 148, - 151, 203, 119, 121, 163, 145, 148, 198, 139, 142, - 189, 148, 151, 199, 55, 56, 74, 152, 155, 203, - 153, 156, 203, 150, 153, 200, 154, 157, 204, 102, - 104, 135, 76, 77, 100, 71, 72, 90, 194, 196, - 227, 211, 212, 236, 207, 208, 231, 217, 218, 239, - 223, 224, 242, 215, 216, 234, 212, 213, 229, 89, - 93, 142, 112, 116, 176, 114, 118, 178, 113, 117, - 177, 114, 118, 177, 116, 120, 179, 115, 120, 178, - 115, 119, 178, 109, 113, 169, 117, 121, 180, 119, - 123, 182, 118, 122, 180, 117, 122, 179, 124, 128, - 188, 123, 127, 187, 122, 126, 185, 120, 124, 182, - 119, 124, 181, 118, 122, 179, 102, 106, 155, 126, - 130, 190, 124, 128, 187, 123, 127, 186, 121, 125, - 183, 120, 124, 181, 119, 123, 180, 81, 84, 122, - 118, 122, 177, 117, 121, 176, 125, 129, 185, 124, - 128, 184, 123, 127, 183, 120, 124, 178, 123, 127, - 181, 127, 131, 186, 96, 99, 141, 127, 131, 185, - 102, 105, 149, 33, 34, 48, 132, 136, 190, 130, - 134, 188, 63, 65, 91, 96, 99, 137, 136, 140, - 192, 141, 145, 196, 146, 150, 200, 149, 153, 202, - 146, 149, 193, 160, 163, 207, 167, 170, 212, 174, - 177, 216, 186, 189, 224, 181, 184, 218, 200, 202, - 231, 192, 194, 222, 203, 205, 233, 199, 201, 227, - 203, 205, 228, 220, 221, 236, 231, 232, 247, 219, - 220, 234, 220, 221, 234, 223, 224, 235, 97, 102, - 150, 222, 223, 233, 226, 227, 237, 20, 21, 28, - 216, 217, 224, 235, 236, 239, 217, 218, 219, 192, - 192, 192, 4, 4, 2, 2, 2, 1, 3, 3, - 2, 7, 7, 6, 21, 21, 19, 13, 13, 12, - 28, 28, 26, 34, 34, 32, 16, 16, 15, 58, - 58, 55, 93, 93, 89, 66, 66, 63, 23, 23, - 22, 85, 85, 82, 88, 88, 85, 60, 60, 58, - 58, 58, 56, 109, 109, 106, 104, 104, 101, 99, - 99, 96, 80, 80, 78, 49, 49, 48, 46, 46, - 45, 52, 52, 51, 152, 152, 150, 144, 144, 142, - 169, 169, 168, 160, 160, 159, 122, 121, 119, 115, - 114, 112, 137, 136, 134, 129, 128, 126, 55, 54, - 53, 31, 30, 30, 62, 61, 61, 176, 176, 176, - 39, 39, 39, 10, 10, 10, 8, 8, 8, 5, - 5, 5, 1, 1, 1, 255, 255, 255, 0, 0, - 0, 33, 249, 4, 1, 0, 0, 212, 0, 44, - 0, 0, 0, 0, 120, 0, 67, 0, 64, 8, - 255, 0, 169, 9, 28, 72, 176, 160, 193, 131, - 8, 19, 42, 92, 200, 176, 161, 195, 135, 16, - 9, 142, 88, 209, 194, 8, 134, 4, 80, 162, - 33, 72, 240, 192, 8, 43, 72, 145, 42, 93, - 202, 116, 170, 164, 201, 147, 39, 51, 93, 90, - 201, 114, 36, 202, 151, 48, 79, 98, 50, 229, - 201, 211, 169, 58, 92, 42, 40, 160, 192, 211, - 193, 15, 24, 44, 84, 164, 136, 152, 48, 5, - 11, 24, 71, 52, 112, 128, 97, 234, 82, 204, - 83, 160, 162, 74, 157, 74, 245, 41, 168, 82, - 78, 212, 1, 216, 186, 181, 27, 20, 88, 105, - 166, 146, 124, 10, 149, 170, 89, 169, 100, 79, - 117, 242, 132, 67, 29, 183, 117, 92, 90, 140, - 64, 168, 226, 197, 157, 59, 117, 210, 158, 188, - 100, 43, 10, 55, 174, 91, 243, 77, 153, 2, - 165, 112, 2, 43, 237, 196, 237, 3, 220, 181, - 10, 162, 119, 140, 1, 152, 171, 66, 165, 50, - 21, 43, 240, 208, 233, 139, 156, 46, 81, 173, - 4, 155, 1, 171, 155, 70, 216, 176, 21, 119, - 1, 172, 69, 222, 54, 37, 215, 164, 152, 152, - 68, 253, 1, 240, 97, 207, 10, 106, 38, 208, - 56, 98, 83, 74, 175, 201, 71, 136, 230, 69, - 182, 242, 43, 210, 75, 51, 193, 220, 69, 86, - 39, 45, 31, 227, 122, 199, 60, 129, 58, 25, - 9, 88, 187, 200, 237, 134, 17, 251, 198, 248, - 154, 149, 93, 105, 142, 27, 255, 19, 206, 56, - 0, 179, 82, 211, 201, 114, 66, 147, 163, 131, - 137, 21, 49, 106, 228, 137, 197, 198, 38, 217, - 74, 130, 160, 132, 142, 204, 31, 64, 191, 124, - 243, 84, 81, 76, 45, 102, 152, 145, 136, 114, - 140, 225, 3, 72, 37, 123, 193, 2, 69, 54, - 140, 173, 195, 204, 47, 248, 244, 103, 225, 53, - 234, 184, 35, 197, 48, 176, 24, 231, 219, 41, - 106, 160, 178, 21, 29, 51, 176, 80, 144, 10, - 46, 152, 80, 131, 22, 121, 224, 130, 197, 27, - 165, 152, 2, 74, 38, 140, 140, 195, 152, 54, - 211, 240, 193, 224, 135, 60, 146, 5, 74, 43, - 77, 120, 195, 88, 54, 209, 212, 226, 84, 143, - 40, 121, 162, 6, 27, 180, 108, 197, 131, 23, - 52, 188, 112, 27, 81, 212, 164, 176, 130, 11, - 49, 208, 112, 130, 13, 59, 160, 240, 133, 22, - 90, 224, 49, 203, 29, 114, 96, 82, 147, 41, - 72, 166, 201, 163, 39, 157, 108, 210, 73, 29, - 56, 24, 194, 14, 55, 219, 108, 195, 195, 45, - 64, 212, 176, 133, 12, 82, 206, 69, 229, 159, - 12, 165, 160, 130, 10, 43, 176, 64, 130, 11, - 47, 192, 0, 66, 12, 50, 204, 224, 168, 9, - 144, 70, 42, 233, 164, 144, 58, 42, 131, 12, - 32, 192, 240, 130, 11, 36, 176, 176, 194, 10, - 42, 248, 9, 232, 168, 163, 166, 48, 2, 161, - 44, 148, 177, 196, 3, 12, 64, 1, 1, 2, - 176, 66, 255, 145, 64, 2, 12, 60, 128, 193, - 18, 27, 24, 193, 65, 24, 97, 192, 192, 104, - 23, 93, 204, 96, 66, 8, 91, 20, 187, 71, - 29, 117, 204, 17, 74, 51, 186, 57, 226, 72, - 44, 177, 228, 33, 2, 23, 39, 108, 49, 195, - 11, 65, 141, 48, 20, 169, 68, 9, 74, 66, - 24, 19, 96, 240, 192, 18, 98, 180, 2, 201, - 145, 106, 162, 148, 70, 46, 2, 108, 195, 88, - 58, 140, 200, 152, 174, 111, 152, 116, 114, 10, - 23, 18, 4, 160, 111, 5, 82, 110, 219, 144, - 81, 50, 128, 49, 6, 13, 109, 140, 245, 84, - 26, 124, 88, 81, 141, 133, 253, 113, 227, 206, - 51, 197, 101, 98, 198, 33, 241, 48, 220, 223, - 58, 239, 32, 147, 75, 37, 146, 248, 98, 133, - 197, 252, 229, 3, 207, 51, 190, 68, 98, 240, - 73, 157, 128, 242, 71, 53, 252, 0, 33, 215, - 64, 46, 212, 129, 70, 40, 233, 249, 150, 73, - 38, 199, 128, 195, 216, 62, 9, 232, 18, 30, - 74, 102, 12, 115, 29, 99, 227, 84, 177, 24, - 96, 241, 32, 226, 161, 73, 102, 32, 130, 32, - 96, 237, 252, 146, 72, 61, 140, 217, 35, 77, - 45, 175, 1, 109, 140, 57, 145, 153, 51, 140, - 25, 100, 153, 82, 74, 147, 127, 188, 32, 3, - 22, 104, 52, 195, 227, 35, 192, 60, 205, 85, - 58, 86, 224, 35, 55, 62, 240, 208, 35, 14, - 132, 145, 137, 131, 12, 35, 1, 84, 255, 125, - 245, 207, 37, 85, 226, 199, 20, 218, 188, 75, - 140, 48, 228, 1, 38, 15, 21, 114, 199, 221, - 78, 60, 233, 20, 222, 117, 50, 112, 100, 29, - 118, 39, 65, 0, 192, 195, 12, 2, 173, 0, - 3, 24, 55, 180, 88, 31, 76, 151, 56, 136, - 55, 87, 219, 64, 49, 202, 36, 55, 183, 174, - 87, 235, 176, 147, 5, 251, 205, 147, 216, 146, - 64, 55, 140, 129, 243, 76, 43, 172, 199, 158, - 174, 41, 33, 246, 163, 249, 15, 49, 176, 224, - 239, 65, 35, 176, 240, 130, 9, 39, 220, 128, - 66, 139, 120, 204, 161, 10, 38, 152, 160, 53, - 239, 245, 37, 157, 149, 102, 41, 155, 168, 66, - 135, 7, 91, 65, 99, 72, 13, 58, 128, 240, - 50, 183, 7, 9, 186, 2, 9, 102, 135, 0, - 198, 150, 206, 3, 129, 194, 16, 244, 15, 65, - 4, 253, 132, 120, 97, 3, 23, 92, 220, 133, - 236, 27, 114, 144, 131, 27, 82, 65, 64, 2, - 186, 193, 13, 114, 120, 3, 178, 238, 192, 5, - 27, 16, 130, 8, 22, 160, 128, 4, 22, 96, - 128, 116, 232, 235, 130, 134, 144, 0, 14, 108, - 80, 131, 61, 208, 160, 11, 48, 40, 1, 168, - 142, 135, 190, 18, 166, 239, 84, 159, 42, 148, - 24, 140, 192, 194, 13, 108, 96, 2, 48, 156, - 0, 7, 102, 168, 129, 8, 28, 161, 8, 100, - 208, 193, 22, 192, 176, 135, 30, 110, 33, 4, - 93, 200, 130, 11, 255, 90, 224, 169, 65, 145, - 208, 132, 72, 28, 136, 169, 40, 98, 145, 4, - 72, 97, 0, 2, 16, 192, 0, 164, 64, 140, - 37, 244, 66, 22, 166, 200, 68, 26, 206, 0, - 137, 73, 204, 232, 102, 243, 50, 133, 216, 74, - 17, 163, 76, 172, 65, 129, 92, 240, 194, 13, - 144, 160, 4, 37, 56, 160, 1, 53, 240, 129, - 8, 133, 146, 196, 133, 36, 175, 7, 27, 96, - 21, 173, 48, 208, 135, 83, 72, 34, 13, 39, - 67, 146, 36, 132, 33, 141, 66, 26, 82, 26, - 141, 144, 23, 246, 76, 98, 166, 82, 120, 226, - 13, 54, 160, 192, 2, 40, 168, 0, 33, 4, - 165, 132, 42, 32, 129, 82, 38, 112, 1, 14, - 188, 130, 117, 139, 60, 78, 48, 134, 6, 152, - 119, 4, 3, 108, 161, 212, 139, 41, 236, 133, - 2, 2, 212, 131, 29, 18, 120, 1, 29, 27, - 50, 130, 22, 116, 129, 12, 71, 56, 194, 43, - 2, 153, 146, 52, 8, 227, 25, 203, 8, 166, - 48, 135, 25, 76, 100, 52, 33, 17, 198, 248, - 133, 45, 206, 64, 9, 147, 84, 98, 16, 86, - 16, 30, 96, 204, 113, 5, 101, 12, 115, 111, - 137, 56, 132, 47, 86, 241, 136, 35, 101, 2, - 20, 196, 96, 6, 49, 199, 185, 12, 99, 34, - 243, 23, 29, 106, 38, 76, 56, 33, 135, 63, - 100, 35, 27, 116, 32, 129, 10, 14, 130, 162, - 61, 156, 96, 15, 113, 192, 132, 111, 30, 49, - 255, 12, 174, 129, 172, 63, 249, 200, 81, 39, - 30, 244, 207, 254, 224, 195, 23, 102, 32, 134, - 141, 10, 26, 153, 117, 20, 192, 15, 146, 136, - 9, 41, 222, 0, 13, 0, 120, 64, 6, 243, - 164, 134, 10, 96, 16, 138, 89, 176, 65, 159, - 31, 98, 27, 60, 176, 83, 12, 51, 180, 36, - 13, 102, 192, 196, 34, 184, 195, 152, 115, 248, - 99, 161, 92, 9, 7, 4, 224, 240, 199, 52, - 216, 212, 12, 20, 138, 204, 55, 140, 113, 8, - 82, 114, 5, 30, 192, 48, 41, 75, 80, 10, - 139, 40, 220, 35, 50, 241, 248, 26, 89, 68, - 113, 11, 218, 188, 71, 6, 186, 25, 221, 135, - 42, 1, 8, 42, 240, 131, 49, 226, 48, 6, - 36, 94, 2, 10, 76, 52, 65, 28, 145, 169, - 27, 99, 172, 97, 5, 95, 68, 212, 36, 151, - 88, 133, 50, 254, 2, 152, 117, 52, 194, 23, - 35, 101, 140, 57, 142, 241, 136, 151, 164, 245, - 25, 84, 99, 12, 80, 151, 22, 19, 81, 208, - 129, 54, 93, 48, 65, 44, 118, 211, 27, 223, - 92, 2, 14, 82, 176, 71, 132, 158, 193, 138, - 154, 74, 194, 12, 144, 216, 69, 50, 228, 17, - 153, 110, 20, 224, 99, 140, 105, 135, 48, 234, - 106, 146, 174, 50, 34, 29, 59, 163, 130, 47, - 10, 112, 186, 173, 4, 128, 17, 151, 168, 132, - 77, 35, 97, 6, 170, 74, 3, 29, 171, 145, - 130, 46, 118, 68, 150, 77, 255, 136, 72, 27, - 38, 120, 1, 24, 160, 37, 85, 31, 97, 226, - 179, 12, 141, 76, 0, 164, 225, 139, 92, 36, - 224, 104, 92, 57, 71, 34, 182, 122, 146, 137, - 209, 35, 50, 248, 0, 6, 49, 156, 19, 92, - 192, 140, 131, 184, 168, 212, 139, 40, 68, 132, - 13, 47, 192, 128, 26, 240, 57, 1, 46, 112, - 49, 139, 83, 128, 20, 38, 19, 171, 24, 99, - 222, 145, 140, 99, 36, 226, 189, 239, 61, 198, - 33, 132, 193, 139, 85, 68, 130, 185, 167, 168, - 68, 25, 224, 11, 223, 70, 0, 195, 37, 157, - 53, 133, 48, 248, 11, 95, 93, 20, 131, 178, - 128, 225, 7, 21, 22, 225, 94, 254, 202, 87, - 24, 187, 96, 69, 72, 122, 228, 9, 81, 100, - 142, 31, 56, 152, 65, 11, 252, 53, 2, 18, - 204, 224, 4, 44, 194, 5, 27, 196, 120, 146, - 71, 8, 163, 66, 140, 137, 199, 33, 178, 155, - 74, 189, 152, 248, 185, 140, 153, 199, 138, 67, - 89, 138, 237, 94, 21, 26, 55, 48, 129, 11, - 50, 74, 151, 18, 116, 225, 7, 34, 8, 241, - 44, 222, 128, 137, 112, 18, 243, 25, 194, 0, - 100, 139, 125, 115, 21, 99, 136, 115, 152, 81, - 0, 6, 109, 145, 84, 99, 75, 100, 14, 0, - 250, 48, 196, 9, 174, 197, 99, 136, 36, 239, - 5, 51, 248, 129, 13, 80, 192, 162, 60, 68, - 175, 76, 158, 64, 211, 146, 215, 140, 18, 76, - 112, 175, 255, 20, 108, 40, 68, 62, 186, 161, - 13, 125, 240, 0, 8, 39, 8, 1, 12, 90, - 208, 101, 19, 78, 132, 4, 48, 152, 193, 22, - 182, 212, 165, 29, 124, 97, 7, 134, 158, 214, - 29, 222, 144, 138, 83, 212, 164, 38, 212, 59, - 239, 245, 168, 247, 9, 154, 116, 162, 19, 189, - 113, 195, 29, 242, 144, 175, 3, 212, 67, 29, - 160, 126, 66, 33, 110, 80, 3, 48, 152, 0, - 6, 46, 0, 85, 29, 187, 133, 42, 68, 129, - 96, 6, 52, 120, 95, 13, 210, 248, 5, 20, - 0, 225, 214, 22, 200, 181, 174, 21, 192, 235, - 94, 243, 228, 215, 18, 148, 128, 176, 135, 45, - 108, 28, 0, 65, 4, 28, 188, 167, 14, 102, - 16, 131, 77, 181, 96, 132, 171, 142, 182, 180, - 167, 77, 237, 36, 166, 192, 84, 131, 74, 33, - 11, 182, 189, 237, 22, 120, 155, 136, 220, 246, - 212, 167, 6, 165, 173, 35, 86, 251, 220, 216, - 46, 84, 6, 54, 176, 4, 113, 177, 138, 1, - 240, 174, 149, 173, 110, 117, 129, 11, 200, 144, - 3, 53, 188, 225, 24, 120, 120, 130, 59, 204, - 97, 22, 205, 96, 86, 51, 102, 49, 135, 59, - 236, 33, 183, 69, 212, 214, 185, 185, 181, 196, - 21, 168, 170, 85, 79, 44, 64, 1, 164, 176, - 17, 6, 96, 96, 3, 98, 200, 130, 29, 94, - 97, 138, 130, 177, 100, 18, 147, 104, 73, 235, - 34, 125, 94, 80, 172, 65, 18, 150, 255, 96, - 67, 40, 58, 138, 135, 60, 104, 97, 7, 55, - 24, 66, 5, 74, 61, 131, 84, 207, 114, 225, - 69, 81, 1, 11, 50, 128, 1, 136, 15, 96, - 0, 16, 16, 134, 47, 92, 96, 7, 77, 132, - 68, 19, 51, 98, 115, 155, 103, 226, 72, 80, - 200, 161, 14, 53, 168, 128, 3, 122, 237, 128, - 36, 8, 225, 217, 162, 58, 119, 242, 196, 144, - 199, 4, 56, 193, 9, 12, 88, 66, 31, 76, - 1, 9, 73, 160, 139, 71, 55, 179, 69, 45, - 214, 206, 246, 82, 240, 82, 77, 141, 196, 132, - 28, 184, 48, 132, 96, 75, 160, 2, 150, 188, - 57, 18, 173, 212, 3, 139, 176, 170, 35, 178, - 152, 132, 146, 175, 167, 137, 86, 48, 35, 29, - 217, 168, 211, 54, 194, 81, 15, 41, 192, 226, - 236, 169, 108, 228, 220, 41, 80, 65, 3, 40, - 160, 68, 89, 7, 84, 242, 194, 192, 129, 11, - 44, 225, 2, 97, 48, 69, 200, 151, 220, 49, - 42, 228, 128, 49, 244, 64, 4, 103, 149, 110, - 146, 85, 154, 130, 11, 11, 32, 192, 61, 2, - 80, 131, 243, 69, 196, 74, 47, 136, 0, 7, - 100, 216, 5, 0, 179, 249, 17, 135, 128, 45, - 96, 170, 65, 133, 65, 76, 153, 245, 39, 241, - 4, 41, 234, 80, 136, 117, 172, 227, 0, 96, - 48, 158, 67, 146, 23, 131, 35, 68, 64, 3, - 118, 240, 61, 74, 84, 194, 138, 238, 123, 255, - 251, 223, 47, 197, 255, 37, 204, 96, 118, 148, - 92, 162, 22, 85, 144, 28, 87, 200, 145, 136, - 81, 180, 194, 251, 173, 240, 68, 37, 200, 95, - 179, 146, 104, 17, 252, 248, 247, 126, 41, 38, - 65, 126, 200, 155, 196, 19, 155, 16, 10, 127, - 176, 13, 246, 128, 3, 242, 164, 16, 70, 49, - 3, 99, 64, 6, 62, 144, 69, 100, 113, 88, - 82, 16, 0, 245, 80, 14, 20, 88, 129, 22, - 88, 14, 228, 0, 14, 227, 32, 15, 240, 32, - 5, 136, 144, 11, 156, 85, 29, 62, 181, 21, - 219, 64, 14, 23, 8, 14, 1, 240, 13, 241, - 128, 15, 204, 80, 12, 112, 96, 28, 235, 82, - 0, 224, 48, 129, 23, 104, 129, 222, 48, 123, - 227, 16, 15, 239, 240, 12, 137, 144, 11, 44, - 134, 50, 167, 240, 7, 117, 22, 79, 153, 215, - 57, 48, 176, 7, 96, 176, 5, 174, 32, 105, - 49, 97, 98, 110, 19, 92, 235, 80, 5, 193, - 208, 77, 57, 83, 93, 92, 17, 15, 76, 128, - 9, 200, 145, 56, 213, 117, 15, 5, 0, 12, - 171, 135, 18, 157, 160, 10, 60, 64, 27, 39, - 32, 125, 2, 145, 2, 45, 64, 3, 119, 112, - 2, 101, 194, 100, 165, 160, 12, 125, 3, 24, - 253, 160, 15, 218, 112, 135, 117, 118, 13, 22, - 242, 13, 77, 192, 11, 86, 53, 86, 252, 16, - 136, 129, 168, 135, 253, 97, 14, 198, 112, 9, - 78, 192, 86, 128, 129, 135, 119, 168, 15, 132, - 255, 200, 31, 244, 160, 8, 131, 247, 18, 155, - 224, 8, 167, 87, 8, 37, 48, 23, 41, 64, - 2, 123, 64, 112, 111, 232, 27, 149, 16, 8, - 70, 211, 82, 76, 160, 118, 108, 199, 7, 194, - 176, 8, 240, 112, 122, 140, 225, 14, 254, 192, - 133, 0, 64, 86, 191, 160, 11, 124, 80, 139, - 187, 240, 11, 201, 0, 139, 0, 208, 25, 57, - 197, 24, 242, 48, 12, 112, 192, 118, 181, 224, - 7, 193, 176, 8, 79, 184, 21, 64, 21, 134, - 40, 65, 10, 108, 80, 56, 127, 224, 2, 201, - 19, 2, 1, 247, 6, 106, 230, 27, 19, 131, - 96, 128, 17, 93, 202, 120, 10, 102, 80, 12, - 199, 152, 14, 87, 160, 136, 166, 213, 4, 232, - 209, 92, 194, 0, 25, 41, 22, 12, 199, 112, - 14, 59, 83, 5, 129, 112, 86, 37, 54, 12, - 236, 40, 87, 195, 176, 141, 40, 195, 6, 29, - 0, 0, 6, 8, 3, 204, 18, 10, 61, 194, - 23, 80, 128, 59, 128, 97, 15, 141, 192, 10, - 245, 87, 18, 192, 1, 99, 72, 19, 87, 128, - 1, 15, 196, 192, 98, 51, 210, 4, 48, 181, - 21, 250, 64, 5, 122, 144, 0, 234, 103, 90, - 202, 80, 142, 41, 49, 9, 137, 48, 145, 91, - 65, 15, 51, 182, 84, 179, 225, 1, 175, 22, - 85, 133, 101, 141, 193, 128, 142, 128, 49, 15, - 15, 105, 87, 181, 0, 5, 225, 192, 24, 216, - 80, 5, 96, 181, 136, 80, 255, 96, 36, 39, - 145, 6, 186, 64, 5, 216, 192, 24, 232, 144, - 8, 194, 160, 94, 128, 225, 14, 155, 245, 18, - 146, 224, 7, 211, 32, 144, 92, 161, 15, 85, - 224, 51, 105, 49, 10, 142, 0, 0, 29, 32, - 44, 40, 249, 33, 93, 245, 85, 140, 209, 13, - 82, 64, 2, 199, 247, 8, 186, 16, 5, 121, - 165, 56, 2, 176, 31, 91, 113, 14, 135, 160, - 140, 215, 8, 93, 194, 208, 8, 99, 185, 21, - 50, 245, 120, 64, 3, 8, 83, 224, 46, 122, - 85, 12, 246, 136, 18, 82, 217, 15, 238, 49, - 3, 177, 48, 51, 213, 152, 22, 60, 249, 135, - 128, 33, 14, 139, 176, 11, 136, 201, 11, 191, - 64, 12, 136, 0, 5, 194, 215, 138, 254, 64, - 148, 91, 161, 96, 102, 213, 32, 81, 64, 93, - 168, 227, 4, 191, 96, 5, 170, 1, 24, 244, - 176, 8, 186, 128, 152, 128, 240, 11, 135, 192, - 8, 85, 0, 90, 145, 241, 14, 105, 233, 27, - 106, 208, 84, 208, 48, 3, 32, 80, 3, 127, - 41, 7, 129, 249, 20, 143, 96, 12, 216, 200, - 21, 253, 176, 155, 188, 201, 48, 247, 32, 0, - 190, 224, 4, 118, 201, 21, 224, 192, 12, 173, - 80, 127, 213, 193, 146, 92, 65, 15, 193, 32, - 12, 44, 69, 135, 254, 209, 155, 22, 34, 14, - 81, 64, 2, 124, 245, 20, 165, 32, 7, 21, - 117, 11, 50, 64, 2, 38, 128, 5, 208, 162, - 10, 181, 255, 105, 87, 125, 129, 153, 193, 213, - 13, 243, 192, 12, 190, 96, 9, 192, 128, 98, - 45, 121, 74, 40, 49, 9, 198, 48, 135, 92, - 129, 35, 190, 128, 145, 86, 8, 0, 217, 208, - 14, 201, 32, 8, 63, 248, 20, 210, 1, 62, - 30, 160, 3, 208, 232, 2, 58, 32, 2, 208, - 242, 6, 246, 17, 19, 201, 185, 28, 223, 48, - 14, 16, 26, 161, 231, 32, 15, 243, 96, 5, - 206, 128, 8, 131, 240, 8, 225, 81, 9, 136, - 0, 15, 233, 16, 161, 226, 128, 14, 209, 32, - 151, 38, 177, 46, 82, 240, 13, 226, 16, 161, - 233, 48, 15, 199, 48, 74, 145, 81, 15, 15, - 26, 161, 16, 122, 14, 241, 224, 14, 84, 192, - 12, 136, 224, 7, 143, 96, 57, 122, 209, 9, - 150, 80, 81, 180, 0, 6, 178, 68, 13, 35, - 144, 34, 54, 48, 94, 115, 96, 10, 76, 104, - 127, 151, 48, 159, 52, 73, 5, 124, 176, 163, - 32, 7, 114, 103, 96, 6, 143, 32, 18, 47, - 81, 9, 149, 48, 165, 83, 10, 143, 41, 33, - 9, 92, 10, 114, 146, 144, 9, 141, 64, 14, - 140, 177, 13, 210, 144, 11, 145, 16, 166, 85, - 170, 161, 7, 169, 23, 152, 176, 9, 127, 5, - 0, 183, 176, 5, 67, 154, 134, 44, 32, 3, - 63, 240, 5, 162, 179, 160, 206, 180, 11, 62, - 89, 30, 198, 0, 74, 200, 247, 18, 148, 192, - 11, 202, 121, 150, 136, 80, 9, 111, 255, 151, - 38, 166, 176, 93, 249, 232, 1, 92, 48, 3, - 36, 80, 132, 40, 162, 34, 33, 54, 7, 160, - 176, 160, 6, 114, 140, 239, 0, 12, 215, 89, - 168, 37, 17, 9, 198, 240, 152, 92, 113, 80, - 94, 154, 46, 164, 80, 10, 183, 32, 60, 56, - 22, 37, 125, 118, 34, 46, 240, 97, 124, 106, - 102, 121, 145, 9, 172, 224, 12, 223, 192, 14, - 21, 200, 14, 227, 16, 5, 36, 42, 170, 38, - 49, 9, 181, 32, 13, 233, 64, 131, 229, 192, - 14, 231, 176, 145, 111, 202, 35, 164, 208, 9, - 168, 240, 1, 0, 144, 3, 65, 192, 5, 185, - 181, 2, 230, 102, 16, 29, 22, 3, 96, 192, - 5, 207, 131, 11, 209, 163, 10, 112, 0, 126, - 173, 160, 125, 194, 154, 61, 151, 128, 127, 229, - 170, 38, 220, 163, 10, 183, 32, 173, 0, 64, - 11, 64, 240, 3, 50, 80, 2, 177, 26, 40, - 40, 18, 48, 92, 176, 3, 101, 134, 5, 119, - 160, 10, 53, 113, 174, 172, 87, 47, 155, 96, - 9, 168, 64, 11, 216, 80, 135, 65, 112, 3, - 123, 112, 45, 216, 74, 42, 222, 2, 3, 33, - 112, 2, 94, 64, 102, 46, 39, 38, 117, 48, - 61, 1, 43, 176, 105, 226, 102, 156, 80, 10, - 111, 128, 3, 127, 144, 15, 225, 144, 13, 225, - 16, 4, 56, 64, 62, 49, 144, 106, 217, 58, - 42, 19, 225, 2, 32, 96, 2, 63, 192, 5, - 181, 102, 104, 96, 255, 146, 7, 99, 242, 6, - 170, 240, 9, 142, 180, 164, 133, 74, 61, 98, - 243, 177, 111, 48, 7, 40, 80, 8, 79, 176, - 14, 249, 144, 180, 65, 80, 8, 54, 240, 3, - 52, 208, 108, 151, 132, 110, 42, 208, 2, 47, - 16, 3, 38, 0, 6, 53, 224, 5, 93, 130, - 2, 48, 135, 104, 55, 160, 63, 253, 83, 7, - 140, 86, 18, 102, 242, 104, 143, 246, 9, 36, - 151, 182, 143, 86, 10, 151, 182, 22, 213, 163, - 10, 56, 113, 3, 22, 32, 1, 6, 16, 0, - 4, 112, 0, 7, 240, 4, 7, 96, 8, 133, - 0, 4, 92, 224, 180, 124, 66, 2, 43, 80, - 132, 56, 151, 134, 132, 194, 62, 175, 166, 3, - 246, 196, 5, 34, 96, 107, 183, 70, 4, 68, - 128, 4, 146, 219, 70, 148, 91, 185, 14, 224, - 0, 72, 112, 185, 83, 199, 107, 191, 54, 108, - 147, 52, 73, 6, 16, 186, 161, 91, 8, 18, - 0, 4, 28, 244, 3, 91, 96, 2, 205, 86, - 2, 65, 209, 178, 133, 171, 16, 40, 196, 2, - 37, 144, 40, 141, 98, 2, 58, 0, 6, 63, - 112, 2, 179, 214, 64, 94, 224, 5, 34, 240, - 187, 192, 27, 188, 193, 219, 187, 54, 176, 63, - 53, 80, 3, 63, 176, 7, 58, 96, 2, 51, - 128, 41, 155, 146, 112, 174, 251, 186, 16, 43, - 40, 132, 242, 41, 225, 246, 109, 216, 155, 189, - 222, 22, 110, 41, 68, 110, 209, 187, 106, 1, - 1, 1, 0, 59 }; - -unsigned char php_egg_logo[] = { - 71, 73, 70, 56, 57, 97, 120, 0, 67, 0, - 247, 0, 0, 0, 0, 0, 255, 255, 255, 153, - 153, 205, 135, 111, 114, 110, 103, 104, 185, 161, - 165, 182, 176, 177, 178, 169, 171, 22, 18, 19, - 43, 39, 40, 217, 151, 172, 233, 184, 199, 196, - 168, 177, 253, 219, 230, 207, 179, 188, 252, 202, - 219, 216, 178, 191, 254, 231, 239, 123, 120, 121, - 240, 190, 209, 144, 141, 143, 99, 92, 97, 91, - 87, 90, 6, 5, 6, 189, 187, 189, 93, 92, - 93, 170, 162, 172, 5, 3, 6, 103, 101, 104, - 33, 29, 36, 3, 2, 4, 203, 199, 209, 215, - 211, 222, 9, 8, 11, 107, 106, 109, 116, 115, - 118, 221, 219, 228, 206, 203, 218, 174, 171, 194, - 191, 188, 210, 195, 193, 215, 191, 190, 202, 159, - 158, 168, 168, 167, 182, 185, 184, 211, 172, 171, - 207, 1, 1, 2, 11, 11, 16, 14, 14, 20, - 7, 7, 10, 34, 34, 48, 28, 28, 39, 22, - 22, 30, 153, 153, 203, 156, 156, 205, 160, 160, - 205, 133, 133, 163, 148, 148, 178, 178, 178, 208, - 182, 182, 194, 79, 79, 82, 66, 66, 68, 33, - 33, 34, 111, 111, 114, 46, 46, 47, 76, 76, - 77, 84, 85, 121, 142, 144, 194, 149, 150, 202, - 153, 154, 205, 154, 155, 205, 150, 151, 199, 157, - 158, 202, 161, 162, 200, 165, 166, 203, 75, 77, - 111, 115, 118, 170, 97, 99, 143, 91, 93, 134, - 105, 107, 154, 41, 42, 60, 51, 52, 74, 129, - 132, 182, 136, 139, 191, 146, 148, 196, 153, 155, - 199, 155, 157, 200, 65, 67, 96, 174, 175, 184, - 16, 17, 24, 147, 149, 161, 68, 69, 73, 53, - 54, 57, 132, 133, 136, 139, 143, 153, 93, 96, - 102, 97, 100, 106, 71, 73, 77, 98, 99, 101, - 82, 85, 90, 86, 89, 94, 90, 93, 98, 131, - 137, 146, 104, 109, 116, 109, 114, 121, 119, 124, - 131, 101, 105, 110, 123, 129, 136, 74, 78, 82, - 61, 64, 67, 115, 120, 125, 80, 83, 86, 56, - 58, 60, 35, 36, 37, 48, 49, 50, 50, 51, - 52, 60, 61, 62, 41, 42, 42, 39, 40, 40, - 37, 38, 38, 136, 164, 159, 4, 5, 3, 176, - 173, 166, 192, 189, 183, 180, 174, 163, 194, 187, - 177, 181, 175, 166, 178, 172, 163, 176, 170, 161, - 182, 166, 144, 179, 164, 143, 179, 168, 153, 121, - 116, 109, 186, 180, 172, 184, 178, 170, 191, 185, - 177, 201, 195, 187, 198, 193, 186, 138, 117, 91, - 154, 135, 111, 181, 163, 140, 160, 144, 124, 187, - 170, 149, 184, 168, 148, 189, 178, 164, 186, 175, - 162, 203, 198, 192, 203, 199, 194, 202, 198, 193, - 200, 196, 191, 133, 108, 79, 144, 126, 105, 195, - 180, 163, 176, 163, 148, 201, 187, 171, 202, 190, - 177, 179, 169, 158, 205, 194, 182, 197, 188, 178, - 200, 192, 183, 180, 173, 165, 178, 171, 163, 177, - 170, 162, 175, 168, 160, 189, 182, 174, 197, 190, - 182, 206, 199, 191, 203, 197, 190, 3, 2, 1, - 111, 96, 81, 173, 157, 140, 164, 151, 138, 181, - 171, 161, 178, 170, 162, 173, 166, 159, 195, 188, - 181, 214, 207, 200, 211, 204, 197, 200, 194, 188, - 197, 191, 185, 192, 186, 180, 207, 201, 195, 205, - 199, 193, 202, 197, 192, 196, 192, 188, 197, 194, - 191, 64, 63, 62, 84, 83, 82, 122, 83, 48, - 193, 175, 158, 188, 171, 155, 198, 182, 167, 194, - 183, 173, 88, 55, 28, 210, 198, 188, 201, 193, - 186, 204, 196, 189, 204, 197, 191, 115, 103, 94, - 204, 194, 186, 204, 195, 188, 205, 200, 196, 100, - 89, 81, 105, 98, 93, 175, 168, 163, 202, 195, - 190, 196, 193, 191, 95, 82, 74, 123, 109, 100, - 165, 157, 152, 177, 170, 166, 199, 192, 188, 202, - 197, 194, 201, 196, 193, 199, 194, 191, 13, 11, - 10, 61, 55, 52, 130, 126, 124, 69, 67, 66, - 81, 79, 78, 200, 196, 194, 193, 189, 187, 82, - 67, 60, 149, 136, 130, 79, 74, 72, 198, 193, - 191, 40, 29, 25, 62, 48, 43, 74, 58, 52, - 87, 73, 68, 138, 130, 127, 10, 7, 6, 201, - 195, 193, 195, 192, 191, 199, 189, 186, 19, 15, - 14, 88, 84, 83, 196, 188, 186, 201, 197, 196, - 185, 181, 180, 31, 22, 20, 198, 193, 192, 51, - 39, 37, 47, 34, 33, 183, 156, 154, 168, 162, - 162, 157, 151, 151, 196, 190, 190, 189, 184, 184, - 57, 56, 56, 193, 190, 190, 72, 71, 71, 53, - 53, 53, 44, 44, 44, 29, 29, 29, 255, 255, - 255, 33, 249, 4, 1, 0, 0, 255, 0, 44, - 0, 0, 0, 0, 120, 0, 67, 0, 0, 8, - 255, 0, 255, 9, 28, 72, 176, 160, 193, 131, - 8, 19, 42, 92, 200, 176, 161, 195, 135, 16, - 35, 50, 20, 64, 177, 162, 197, 139, 24, 51, - 82, 148, 200, 177, 163, 71, 131, 24, 167, 48, - 97, 242, 164, 137, 19, 33, 66, 150, 92, 89, - 201, 242, 202, 146, 37, 40, 133, 56, 105, 242, - 100, 36, 19, 41, 83, 168, 96, 252, 200, 179, - 39, 65, 139, 53, 164, 48, 57, 121, 37, 10, - 20, 40, 81, 146, 70, 105, 233, 82, 229, 203, - 167, 49, 99, 58, 153, 58, 245, 73, 77, 41, - 82, 134, 92, 244, 201, 181, 161, 197, 41, 79, - 132, 20, 149, 65, 246, 40, 82, 165, 75, 139, - 22, 21, 242, 229, 41, 212, 168, 84, 103, 54, - 153, 75, 215, 234, 72, 156, 68, 44, 118, 221, - 43, 176, 34, 21, 38, 98, 101, 208, 152, 49, - 131, 172, 12, 179, 103, 147, 170, 101, 218, 20, - 102, 84, 153, 84, 233, 206, 181, 74, 153, 178, - 205, 41, 67, 242, 110, 228, 235, 177, 226, 148, - 38, 87, 160, 100, 201, 66, 99, 112, 225, 178, - 102, 149, 126, 35, 180, 139, 14, 144, 126, 236, - 216, 205, 153, 211, 134, 13, 155, 47, 101, 198, - 168, 1, 83, 65, 12, 135, 223, 40, 229, 86, - 182, 59, 178, 166, 205, 155, 83, 52, 11, 224, - 12, 145, 34, 149, 39, 87, 100, 188, 128, 49, - 186, 52, 97, 195, 71, 201, 105, 127, 246, 108, - 117, 107, 57, 64, 98, 207, 255, 145, 211, 38, - 204, 237, 47, 186, 213, 140, 9, 3, 6, 76, - 25, 17, 35, 8, 88, 200, 80, 161, 130, 132, - 17, 147, 139, 235, 191, 123, 119, 72, 141, 205, - 204, 37, 68, 17, 96, 80, 196, 16, 194, 116, - 212, 89, 87, 216, 60, 227, 52, 24, 140, 55, - 170, 168, 146, 137, 119, 116, 128, 39, 30, 121, - 182, 125, 129, 158, 26, 90, 156, 209, 198, 22, - 106, 156, 129, 134, 27, 101, 180, 55, 70, 27, - 186, 100, 19, 141, 57, 44, 154, 99, 15, 77, - 54, 9, 117, 19, 86, 200, 233, 4, 96, 128, - 125, 9, 0, 29, 13, 23, 24, 248, 194, 116, - 164, 209, 48, 15, 131, 229, 4, 99, 164, 145, - 150, 68, 168, 202, 55, 95, 108, 177, 5, 25, - 235, 181, 1, 7, 16, 92, 144, 241, 5, 24, - 95, 168, 129, 134, 25, 104, 108, 193, 198, 110, - 96, 208, 209, 70, 25, 101, 192, 177, 204, 62, - 111, 184, 193, 204, 48, 179, 36, 82, 136, 31, - 209, 216, 131, 3, 127, 119, 9, 133, 85, 78, - 21, 225, 72, 209, 19, 81, 132, 224, 130, 7, - 61, 30, 8, 3, 13, 226, 48, 72, 206, 34, - 150, 88, 194, 203, 145, 193, 240, 34, 161, 42, - 25, 124, 24, 198, 24, 99, 176, 241, 6, 148, - 147, 150, 33, 226, 150, 107, 168, 23, 70, 27, - 149, 126, 9, 6, 15, 109, 136, 73, 199, 54, - 230, 28, 51, 12, 50, 136, 52, 51, 205, 30, - 134, 184, 255, 34, 231, 156, 118, 98, 101, 43, - 158, 203, 241, 53, 224, 21, 33, 0, 224, 129, - 7, 27, 24, 136, 0, 60, 227, 120, 83, 142, - 42, 171, 52, 114, 137, 37, 138, 44, 106, 36, - 47, 188, 52, 162, 10, 33, 83, 250, 16, 135, - 28, 112, 212, 70, 134, 26, 106, 144, 177, 173, - 23, 94, 152, 97, 198, 25, 99, 244, 192, 197, - 22, 116, 176, 49, 6, 25, 111, 176, 177, 69, - 16, 97, 108, 67, 72, 41, 195, 16, 211, 106, - 51, 178, 200, 162, 78, 59, 6, 212, 163, 133, - 25, 56, 224, 96, 235, 192, 184, 114, 69, 145, - 20, 87, 100, 1, 0, 0, 127, 110, 16, 2, - 2, 243, 144, 83, 142, 50, 153, 60, 178, 138, - 34, 137, 42, 234, 236, 179, 141, 52, 2, 206, - 28, 253, 204, 177, 30, 27, 97, 96, 59, 198, - 166, 106, 164, 225, 133, 22, 94, 172, 81, 198, - 22, 61, 192, 60, 198, 23, 103, 188, 241, 198, - 23, 111, 240, 16, 68, 6, 246, 116, 66, 204, - 207, 196, 156, 114, 203, 41, 167, 52, 163, 206, - 43, 253, 134, 27, 240, 192, 88, 101, 118, 35, - 71, 20, 57, 33, 195, 194, 11, 187, 240, 112, - 177, 207, 168, 50, 72, 47, 190, 168, 114, 9, - 180, 96, 55, 122, 164, 37, 171, 64, 211, 67, - 27, 92, 176, 65, 134, 166, 109, 248, 0, 68, - 109, 103, 184, 33, 174, 25, 43, 123, 193, 174, - 26, 91, 132, 113, 70, 167, 106, 88, 255, 138, - 222, 22, 207, 92, 146, 136, 41, 63, 23, 125, - 138, 36, 69, 87, 98, 205, 52, 179, 28, 114, - 128, 61, 94, 44, 61, 5, 78, 56, 105, 149, - 43, 212, 8, 95, 64, 53, 0, 27, 32, 0, - 68, 57, 169, 100, 2, 9, 38, 144, 244, 226, - 72, 35, 205, 130, 29, 118, 163, 151, 52, 146, - 1, 29, 159, 182, 177, 173, 148, 113, 68, 65, - 105, 26, 107, 164, 161, 197, 191, 102, 116, 161, - 134, 25, 120, 168, 193, 195, 109, 96, 168, 81, - 6, 15, 233, 110, 147, 202, 34, 145, 152, 226, - 124, 49, 167, 152, 98, 75, 49, 136, 227, 91, - 73, 46, 221, 224, 211, 175, 22, 146, 79, 225, - 189, 211, 151, 59, 180, 39, 20, 155, 187, 176, - 142, 56, 222, 164, 178, 10, 36, 165, 251, 226, - 203, 35, 140, 52, 178, 8, 198, 204, 50, 171, - 8, 198, 173, 55, 18, 4, 28, 108, 144, 138, - 30, 28, 117, 32, 3, 151, 246, 230, 5, 52, - 212, 205, 13, 106, 248, 129, 27, 220, 112, 6, - 247, 80, 170, 12, 95, 8, 3, 29, 246, 17, - 134, 103, 40, 98, 17, 144, 112, 158, 243, 108, - 193, 65, 91, 220, 2, 29, 205, 104, 70, 53, - 20, 135, 11, 237, 249, 75, 96, 222, 75, 161, - 141, 28, 130, 143, 168, 205, 96, 115, 231, 32, - 150, 50, 26, 49, 8, 247, 57, 194, 17, 129, - 16, 4, 35, 118, 200, 195, 27, 114, 173, 23, - 64, 52, 221, 8, 255, 96, 134, 37, 32, 128, - 97, 12, 65, 168, 67, 25, 208, 128, 134, 53, - 152, 97, 13, 77, 252, 215, 8, 212, 32, 130, - 31, 212, 204, 102, 37, 226, 86, 25, 216, 144, - 174, 32, 88, 98, 17, 140, 16, 70, 45, 198, - 72, 198, 49, 74, 130, 24, 183, 184, 5, 37, - 170, 49, 194, 87, 109, 15, 133, 42, 124, 26, - 66, 40, 34, 4, 24, 80, 205, 5, 16, 75, - 223, 42, 4, 241, 136, 62, 62, 226, 134, 238, - 115, 95, 16, 7, 57, 72, 115, 144, 33, 8, - 109, 56, 3, 27, 228, 144, 155, 125, 140, 1, - 75, 96, 24, 209, 2, 113, 103, 134, 31, 136, - 33, 68, 25, 88, 215, 25, 202, 144, 38, 55, - 160, 161, 12, 251, 232, 193, 62, 150, 183, 136, - 94, 192, 34, 22, 168, 76, 165, 25, 37, 97, - 139, 73, 76, 130, 26, 149, 184, 94, 9, 15, - 176, 59, 156, 196, 49, 124, 7, 161, 99, 12, - 168, 118, 1, 98, 61, 99, 0, 170, 8, 68, - 32, 252, 24, 200, 98, 6, 242, 134, 200, 116, - 196, 35, 84, 177, 12, 54, 100, 203, 13, 176, - 171, 84, 27, 218, 67, 179, 6, 58, 49, 13, - 104, 56, 131, 111, 212, 192, 1, 68, 206, 33, - 31, 61, 160, 131, 39, 63, 121, 196, 125, 40, - 195, 18, 151, 232, 133, 48, 80, 9, 139, 118, - 158, 50, 22, 101, 108, 229, 244, 110, 97, 13, - 117, 224, 227, 113, 56, 200, 1, 102, 188, 183, - 255, 194, 57, 10, 64, 8, 187, 92, 216, 57, - 196, 65, 14, 101, 44, 66, 21, 124, 244, 99, - 31, 135, 41, 204, 133, 10, 243, 161, 60, 100, - 132, 42, 36, 224, 36, 77, 177, 225, 120, 164, - 138, 100, 184, 184, 37, 183, 113, 37, 48, 13, - 105, 56, 67, 24, 182, 240, 154, 48, 4, 193, - 55, 71, 156, 212, 27, 44, 216, 136, 94, 252, - 226, 23, 154, 208, 196, 38, 58, 209, 9, 97, - 208, 180, 22, 206, 195, 169, 45, 78, 81, 9, - 124, 169, 195, 113, 42, 200, 39, 102, 134, 48, - 132, 126, 22, 36, 106, 118, 92, 216, 53, 208, - 7, 141, 70, 100, 66, 16, 57, 124, 104, 14, - 117, 40, 8, 29, 70, 244, 170, 59, 84, 133, - 57, 44, 21, 6, 44, 178, 161, 7, 108, 56, - 3, 238, 200, 244, 5, 38, 186, 225, 7, 85, - 212, 210, 168, 182, 193, 3, 53, 160, 135, 82, - 60, 0, 3, 27, 62, 4, 14, 75, 52, 2, - 24, 49, 141, 233, 75, 49, 129, 137, 94, 240, - 245, 165, 50, 221, 132, 96, 61, 81, 138, 82, - 120, 130, 20, 173, 240, 151, 62, 137, 10, 62, - 144, 48, 225, 133, 74, 157, 71, 57, 46, 177, - 199, 170, 78, 181, 170, 85, 101, 132, 85, 119, - 40, 204, 171, 6, 34, 171, 223, 120, 3, 23, - 122, 240, 6, 80, 189, 11, 12, 32, 93, 15, - 25, 80, 139, 6, 14, 72, 64, 4, 22, 216, - 214, 110, 200, 144, 129, 53, 255, 144, 136, 102, - 111, 200, 77, 169, 118, 97, 140, 69, 24, 2, - 25, 166, 16, 6, 49, 108, 218, 9, 193, 106, - 226, 23, 124, 37, 221, 95, 127, 1, 140, 230, - 2, 163, 16, 204, 80, 129, 22, 114, 192, 216, - 198, 14, 68, 0, 84, 136, 2, 213, 6, 90, - 14, 115, 84, 22, 179, 152, 213, 44, 84, 165, - 10, 81, 172, 74, 244, 27, 187, 128, 3, 88, - 185, 128, 188, 39, 173, 237, 74, 213, 156, 228, - 8, 68, 32, 55, 52, 100, 64, 12, 95, 24, - 193, 26, 206, 64, 6, 49, 240, 23, 93, 186, - 80, 94, 83, 61, 97, 138, 90, 116, 240, 20, - 197, 0, 154, 170, 62, 177, 9, 77, 56, 215, - 185, 164, 32, 133, 33, 162, 59, 221, 162, 82, - 193, 168, 116, 164, 154, 7, 224, 209, 93, 173, - 101, 226, 169, 224, 37, 175, 84, 253, 56, 204, - 62, 226, 240, 161, 230, 104, 82, 222, 232, 96, - 129, 225, 245, 224, 12, 102, 192, 102, 3, 197, - 218, 187, 46, 184, 161, 120, 98, 200, 89, 2, - 71, 128, 192, 117, 125, 193, 93, 219, 120, 70, - 42, 190, 24, 9, 98, 216, 34, 25, 173, 164, - 158, 208, 208, 193, 228, 91, 224, 107, 24, 137, - 152, 69, 97, 95, 241, 138, 67, 144, 194, 0, - 209, 205, 65, 14, 46, 108, 93, 1, 72, 97, - 106, 11, 67, 128, 55, 160, 17, 141, 65, 152, - 249, 204, 103, 102, 133, 47, 34, 193, 230, 210, - 141, 14, 255, 19, 47, 141, 243, 94, 251, 58, - 136, 111, 228, 56, 102, 104, 250, 129, 134, 246, - 91, 60, 8, 186, 33, 13, 189, 203, 198, 89, - 221, 106, 179, 148, 217, 118, 4, 95, 232, 47, - 24, 50, 64, 0, 99, 48, 107, 17, 131, 248, - 196, 145, 57, 56, 9, 73, 72, 34, 141, 78, - 70, 135, 53, 172, 17, 142, 105, 224, 194, 211, - 184, 232, 70, 55, 246, 64, 139, 119, 28, 64, - 5, 91, 190, 48, 21, 254, 243, 143, 12, 11, - 84, 30, 202, 88, 197, 40, 56, 65, 235, 90, - 115, 130, 21, 184, 230, 131, 31, 12, 97, 136, - 8, 247, 225, 21, 165, 248, 132, 176, 59, 113, - 140, 78, 48, 216, 19, 192, 136, 4, 5, 56, - 96, 129, 30, 140, 129, 7, 91, 16, 3, 160, - 113, 22, 210, 109, 121, 50, 13, 223, 144, 192, - 56, 23, 216, 5, 52, 224, 238, 172, 173, 253, - 194, 125, 151, 225, 232, 11, 102, 226, 21, 182, - 24, 35, 7, 45, 125, 233, 52, 50, 89, 22, - 211, 136, 55, 46, 230, 61, 111, 125, 140, 250, - 29, 89, 62, 194, 133, 143, 80, 145, 35, 128, - 25, 0, 28, 254, 134, 43, 254, 208, 138, 130, - 135, 34, 20, 173, 8, 197, 31, 254, 0, 10, - 80, 236, 186, 16, 133, 32, 197, 33, 104, 65, - 139, 82, 168, 67, 29, 195, 56, 6, 49, 144, - 81, 92, 79, 176, 194, 28, 34, 24, 195, 22, - 74, 155, 129, 50, 136, 193, 137, 33, 255, 2, - 147, 136, 70, 144, 13, 180, 146, 43, 146, 182, - 245, 141, 8, 50, 16, 132, 55, 176, 99, 27, - 224, 88, 6, 179, 46, 177, 136, 76, 0, 163, - 24, 181, 72, 6, 146, 43, 109, 105, 76, 107, - 90, 22, 156, 166, 55, 46, 238, 145, 14, 123, - 155, 112, 203, 71, 136, 122, 69, 158, 192, 75, - 121, 24, 35, 26, 204, 144, 6, 40, 14, 126, - 112, 81, 36, 92, 225, 14, 55, 4, 196, 37, - 78, 11, 96, 207, 98, 26, 33, 68, 134, 218, - 135, 81, 10, 87, 100, 163, 111, 147, 154, 230, - 241, 190, 208, 133, 150, 161, 65, 75, 55, 230, - 64, 54, 152, 205, 95, 53, 184, 161, 11, 93, - 144, 128, 4, 44, 185, 139, 32, 20, 158, 29, - 67, 86, 68, 235, 124, 126, 138, 160, 7, 125, - 18, 182, 104, 247, 45, 70, 168, 56, 78, 59, - 35, 23, 244, 102, 122, 58, 178, 119, 234, 28, - 84, 33, 234, 255, 17, 192, 18, 168, 182, 142, - 114, 124, 35, 235, 210, 232, 186, 40, 86, 15, - 8, 174, 135, 125, 236, 135, 48, 251, 217, 67, - 120, 138, 159, 33, 227, 21, 209, 24, 129, 24, - 186, 186, 158, 16, 173, 171, 12, 245, 253, 115, - 26, 52, 244, 131, 76, 122, 178, 12, 63, 208, - 130, 61, 150, 111, 14, 193, 103, 96, 23, 187, - 8, 242, 163, 27, 33, 8, 96, 32, 98, 140, - 66, 95, 183, 36, 170, 145, 198, 17, 110, 58, - 28, 224, 119, 134, 255, 248, 197, 223, 116, 12, - 188, 67, 3, 42, 168, 194, 231, 67, 175, 221, - 133, 193, 227, 234, 122, 72, 189, 52, 68, 17, - 138, 213, 219, 255, 224, 127, 216, 181, 216, 201, - 94, 138, 89, 204, 66, 22, 205, 128, 96, 197, - 64, 56, 133, 96, 15, 63, 80, 46, 149, 66, - 90, 8, 20, 55, 221, 52, 60, 75, 148, 1, - 28, 240, 3, 189, 177, 64, 35, 192, 1, 35, - 64, 1, 20, 96, 14, 217, 64, 0, 203, 192, - 14, 1, 54, 100, 211, 55, 8, 192, 128, 12, - 100, 116, 100, 149, 70, 9, 148, 208, 125, 149, - 199, 105, 185, 208, 130, 226, 167, 121, 250, 112, - 79, 42, 96, 5, 234, 87, 5, 20, 1, 89, - 0, 32, 15, 208, 80, 15, 241, 215, 117, 204, - 0, 8, 64, 120, 127, 12, 247, 112, 100, 247, - 10, 109, 2, 128, 205, 80, 12, 182, 96, 10, - 211, 0, 10, 223, 32, 2, 35, 181, 30, 97, - 240, 5, 43, 163, 5, 35, 192, 14, 86, 82, - 46, 219, 176, 11, 247, 101, 1, 236, 80, 1, - 14, 48, 1, 5, 0, 120, 18, 64, 8, 26, - 104, 12, 236, 96, 1, 28, 96, 12, 208, 240, - 104, 170, 192, 10, 125, 208, 12, 216, 151, 125, - 236, 182, 70, 105, 100, 13, 185, 176, 105, 226, - 23, 15, 241, 240, 130, 250, 160, 15, 24, 96, - 0, 42, 128, 4, 86, 64, 131, 20, 241, 2, - 84, 35, 15, 230, 224, 10, 210, 208, 136, 162, - 255, 240, 131, 65, 184, 122, 173, 32, 10, 127, - 160, 107, 251, 55, 113, 192, 150, 8, 0, 136, - 96, 75, 88, 10, 163, 64, 1, 145, 50, 41, - 100, 128, 6, 42, 176, 2, 90, 112, 31, 85, - 232, 6, 186, 192, 14, 102, 96, 138, 4, 240, - 12, 244, 208, 0, 15, 208, 0, 12, 144, 13, - 128, 135, 129, 18, 0, 13, 131, 103, 12, 247, - 195, 115, 170, 16, 9, 165, 208, 120, 115, 120, - 130, 147, 151, 130, 43, 24, 14, 185, 112, 121, - 201, 248, 130, 24, 96, 126, 42, 144, 4, 72, - 64, 136, 2, 48, 4, 46, 192, 48, 215, 224, - 13, 246, 192, 136, 243, 7, 132, 220, 200, 141, - 244, 23, 10, 175, 87, 132, 254, 55, 12, 33, - 68, 61, 166, 240, 10, 204, 32, 1, 224, 0, - 7, 91, 80, 86, 110, 112, 104, 93, 80, 138, - 43, 96, 6, 106, 176, 15, 96, 176, 2, 41, - 128, 2, 102, 96, 15, 17, 240, 0, 179, 216, - 0, 244, 144, 13, 18, 96, 139, 230, 192, 134, - 26, 72, 8, 138, 39, 45, 145, 32, 105, 216, - 23, 116, 145, 103, 105, 41, 88, 13, 32, 100, - 13, 124, 136, 140, 125, 72, 126, 127, 232, 140, - 73, 0, 141, 72, 48, 141, 189, 2, 0, 165, - 151, 141, 210, 192, 12, 144, 216, 141, 222, 8, - 142, 68, 136, 137, 254, 151, 8, 205, 64, 12, - 212, 99, 11, 123, 16, 13, 98, 0, 7, 92, - 16, 6, 119, 119, 37, 63, 255, 64, 1, 42, - 32, 93, 120, 144, 6, 100, 160, 13, 216, 2, - 86, 22, 0, 2, 253, 232, 143, 17, 0, 1, - 223, 64, 1, 246, 160, 2, 107, 32, 6, 25, - 48, 2, 130, 71, 8, 173, 163, 10, 144, 48, - 13, 233, 22, 116, 66, 231, 74, 69, 199, 70, - 232, 176, 130, 185, 16, 15, 203, 152, 14, 98, - 233, 116, 207, 184, 145, 73, 48, 141, 52, 0, - 0, 168, 176, 14, 216, 72, 146, 36, 9, 8, - 111, 217, 141, 171, 87, 137, 41, 89, 118, 254, - 39, 11, 136, 32, 128, 167, 96, 8, 230, 176, - 13, 252, 64, 7, 200, 151, 1, 106, 48, 144, - 20, 192, 50, 42, 16, 82, 104, 192, 5, 64, - 0, 78, 216, 64, 0, 13, 16, 1, 13, 208, - 0, 19, 208, 0, 11, 112, 129, 209, 176, 2, - 88, 64, 1, 63, 128, 86, 203, 112, 9, 139, - 7, 12, 199, 80, 70, 201, 160, 149, 146, 128, - 130, 108, 52, 66, 95, 9, 150, 96, 233, 12, - 98, 217, 116, 128, 248, 14, 245, 160, 4, 74, - 0, 141, 211, 72, 62, 107, 233, 13, 217, 224, - 10, 110, 9, 8, 163, 208, 155, 114, 169, 112, - 150, 8, 113, 152, 216, 127, 154, 88, 123, 197, - 32, 11, 210, 64, 8, 251, 144, 15, 209, 86, - 69, 93, 96, 15, 24, 88, 119, 94, 192, 6, - 110, 160, 2, 110, 64, 82, 116, 0, 14, 236, - 48, 1, 17, 0, 153, 11, 240, 0, 16, 32, - 1, 93, 255, 160, 148, 24, 128, 5, 35, 192, - 3, 187, 144, 10, 208, 176, 120, 125, 0, 116, - 100, 148, 149, 39, 104, 154, 222, 247, 149, 200, - 152, 140, 99, 105, 111, 129, 168, 1, 178, 169, - 4, 29, 73, 5, 87, 192, 48, 235, 32, 7, - 100, 182, 155, 188, 233, 155, 220, 8, 156, 250, - 23, 113, 177, 183, 146, 155, 40, 9, 137, 224, - 10, 34, 160, 13, 116, 192, 3, 98, 144, 147, - 20, 48, 158, 20, 32, 1, 91, 196, 5, 123, - 163, 5, 62, 57, 6, 101, 80, 1, 32, 16, - 153, 15, 160, 0, 223, 80, 1, 63, 208, 5, - 34, 96, 14, 94, 128, 5, 6, 88, 31, 235, - 233, 84, 158, 64, 12, 115, 248, 120, 174, 180, - 70, 167, 121, 61, 120, 232, 130, 172, 57, 150, - 205, 104, 0, 43, 176, 159, 253, 233, 4, 12, - 51, 80, 202, 176, 136, 36, 57, 10, 5, 106, - 146, 8, 202, 107, 10, 106, 132, 184, 144, 8, - 61, 117, 56, 165, 16, 13, 28, 160, 13, 61, - 192, 3, 28, 176, 6, 94, 208, 5, 217, 96, - 15, 18, 144, 1, 100, 128, 54, 108, 144, 6, - 101, 224, 3, 65, 176, 3, 37, 192, 0, 178, - 248, 0, 19, 48, 0, 240, 192, 15, 99, 192, - 1, 236, 64, 0, 24, 170 , - 162, 25, 144, 10, 139, 231, 9, 238, 41, 116, - 240, 57, 9, 56, 74, 13, 222, 7, 150, 95, - 105, 159, 62, 138, 15, 26, 96, 2, 45, 208, - 2, 74, 255, 96, 3, 2, 112, 4, 82, 240, - 66, 121, 128, 0, 216, 0, 13, 217, 152, 164, - 189, 169, 164, 65, 8, 118, 9, 42, 113, 70, - 152, 8, 44, 25, 128, 167, 240, 10, 246, 176, - 12, 65, 176, 5, 109, 213, 5, 226, 130, 129, - 22, 16, 4, 65, 0, 50, 239, 50, 90, 100, - 224, 0, 1, 16, 0, 17, 176, 0, 11, 240, - 13, 243, 224, 15, 218, 0, 125, 219, 144, 1, - 18, 144, 6, 227, 153, 1, 219, 160, 12, 230, - 214, 158, 239, 57, 154, 55, 74, 13, 130, 202, - 70, 215, 211, 130, 203, 216, 163, 127, 168, 61, - 43, 176, 168, 140, 90, 17, 67, 112, 5, 46, - 128, 10, 3, 197, 14, 3, 16, 13, 174, 144, - 169, 6, 90, 127, 156, 234, 164, 164, 80, 118, - 165, 0, 170, 178, 112, 56, 163, 106, 15, 4, - 176, 13, 251, 160, 165, 194, 58, 158, 3, 0, - 14, 218, 192, 15, 117, 112, 7, 116, 48, 7, - 91, 128, 6, 99, 96, 1, 26, 224, 0, 223, - 48, 0, 21, 144, 0, 29, 0, 7, 59, 83, - 1, 224, 176, 15, 217, 144, 6, 226, 153, 1, - 227, 48, 100, 148, 69, 10, 146, 224, 167, 240, - 137, 130, 204, 138, 163, 207, 250, 149, 228, 119, - 159, 6, 144, 168, 214, 122, 3, 253, 198, 4, - 29, 224, 2, 121, 112, 13, 242, 176, 12, 171, - 16, 174, 153, 202, 155, 173, 167, 112, 67, 88, - 151, 159, 186, 174, 67, 179, 7, 246, 255, 192, - 26, 241, 154, 95, 105, 48, 2, 230, 64, 0, - 186, 48, 7, 252, 144, 15, 117, 192, 5, 114, - 224, 108, 194, 138, 6, 21, 208, 142, 95, 64, - 7, 116, 0, 7, 60, 176, 13, 98, 176, 11, - 218, 112, 31, 131, 183, 5, 17, 203, 44, 141, - 80, 8, 149, 128, 149, 89, 137, 130, 242, 201, - 149, 60, 218, 177, 25, 89, 15, 43, 96, 2, - 58, 192, 168, 142, 106, 17, 66, 80, 141, 39, - 75, 14, 100, 214, 178, 7, 10, 179, 97, 119, - 137, 118, 169, 137, 162, 186, 7, 174, 32, 1, - 236, 32, 74, 178, 5, 6, 35, 176, 12, 252, - 32, 7, 116, 0, 78, 251, 48, 27, 101, 154, - 153, 90, 178, 6, 96, 0, 7, 180, 65, 115, - 63, 96, 1, 251, 48, 120, 217, 80, 1, 62, - 32, 14, 188, 128, 78, 141, 96, 8, 149, 224, - 167, 174, 244, 74, 24, 43, 168, 76, 70, 145, - 227, 215, 154, 127, 24, 131, 137, 170, 3, 168, - 43, 178, 27, 225, 28, 81, 176, 173, 121, 176, - 14, 110, 11, 174, 65, 8, 8, 223, 184, 112, - 150, 184, 127, 180, 176, 160, 118, 123, 105, 137, - 160, 7, 217, 208, 26, 89, 218, 95, 100, 176, - 12, 202, 144, 15, 115, 16, 4, 251, 32, 161, - 112, 144, 15, 187, 32, 2, 176, 101, 1, 190, - 193, 14, 21, 242, 46, 187, 32, 1, 21, 192, - 14, 34, 32, 158, 186, 128, 0, 98, 102, 12, - 148, 101, 8, 214, 255, 48, 154, 202, 250, 74, - 205, 202, 149, 207, 218, 177, 247, 105, 126, 88, - 128, 186, 44, 208, 2, 122, 81, 17, 143, 181, - 48, 30, 32, 102, 111, 203, 141, 173, 64, 187, - 149, 248, 122, 10, 74, 11, 123, 112, 132, 205, - 112, 11, 146, 144, 11, 134, 144, 13, 224, 192, - 15, 234, 21, 6, 153, 100, 1, 219, 240, 33, - 52, 71, 7, 61, 160, 11, 249, 176, 15, 18, - 188, 133, 203, 192, 133, 251, 128, 45, 20, 42, - 2, 191, 145, 189, 98, 128, 0, 235, 224, 15, - 228, 160, 167, 171, 96, 8, 179, 80, 13, 238, - 48, 154, 146, 240, 74, 92, 137, 14, 213, 192, - 13, 220, 16, 182, 98, 137, 11, 128, 136, 1, - 59, 176, 3, 58, 208, 190, 170, 123, 57, 21, - 225, 4, 73, 181, 1, 240, 48, 102, 43, 27, - 174, 38, 153, 127, 98, 23, 113, 252, 59, 179, - 105, 36, 9, 149, 96, 8, 18, 160, 13, 64, - 32, 7, 92, 160, 11, 72, 196, 3, 218, 160, - 11, 101, 64, 6, 61, 64, 37, 249, 160, 11, - 92, 188, 133, 65, 112, 115, 82, 59, 27, 99, - 48, 95, 28, 64, 0, 4, 176, 11, 254, 112, - 13, 48, 224, 15, 216, 32, 194, 210, 176, 7, - 185, 64, 13, 238, 0, 168, 107, 212, 149, 76, - 198, 13, 59, 58, 186, 165, 11, 136, 53, 204, - 2, 44, 160, 3, 74, 160, 23, 57, 66, 71, - 189, 226, 2, 62, 172, 13, 198, 240, 13, 224, - 255, 170, 169, 64, 72, 151, 151, 104, 118, 154, - 88, 9, 0, 92, 9, 122, 32, 2, 66, 91, - 7, 79, 252, 46, 76, 203, 5, 110, 181, 5, - 179, 193, 5, 116, 192, 197, 251, 32, 181, 219, - 16, 27, 247, 218, 15, 111, 144, 6, 101, 108, - 1, 218, 128, 0, 215, 128, 0, 254, 208, 15, - 216, 240, 12, 132, 240, 13, 163, 240, 14, 179, - 192, 13, 238, 64, 13, 107, 84, 9, 161, 11, - 173, 201, 40, 195, 174, 217, 13, 205, 184, 3, - 39, 112, 2, 126, 28, 200, 121, 242, 19, 21, - 33, 4, 126, 2, 44, 240, 32, 15, 207, 144, - 200, 209, 192, 200, 161, 160, 7, 157, 170, 146, - 145, 140, 14, 178, 160, 7, 25, 208, 15, 113, - 112, 7, 117, 96, 7, 113, 192, 5, 179, 113, - 7, 99, 178, 5, 92, 0, 7, 116, 192, 15, - 218, 240, 206, 91, 176, 13, 242, 220, 26, 115, - 0, 4, 25, 32, 2, 21, 160, 13, 249, 224, - 15, 89, 224, 15, 117, 0, 180, 186, 240, 12, - 208, 160, 200, 134, 64, 11, 225, 224, 14, 220, - 64, 13, 31, 180, 105, 208, 10, 150, 245, 38, - 106, 196, 140, 1, 41, 112, 2, 40, 128, 204, - 238, 187, 204, 71, 213, 204, 48, 176, 1, 23, - 16, 2, 89, 16, 49, 71, 90, 205, 65, 168, - 107, 50, 155, 174, 249, 130, 47, 209, 160, 13, - 113, 224, 3, 44, 125, 7, 62, 224, 15, 52, - 224, 15, 118, 32, 7, 114, 255, 224, 76, 179, - 81, 180, 251, 96, 175, 251, 176, 133, 219, 160, - 11, 225, 12, 6, 63, 208, 3, 129, 91, 207, - 92, 80, 212, 85, 92, 14, 203, 64, 8, 171, - 0, 8, 239, 208, 14, 232, 224, 194, 215, 19, - 15, 245, 233, 130, 246, 38, 106, 123, 128, 15, - 18, 141, 2, 90, 141, 2, 23, 45, 71, 215, - 181, 195, 51, 112, 14, 49, 48, 29, 29, 48, - 14, 229, 0, 13, 43, 203, 9, 128, 0, 10, - 193, 73, 118, 125, 16, 108, 120, 137, 8, 179, - 32, 1, 64, 224, 210, 254, 112, 7, 114, 112, - 7, 118, 125, 215, 119, 0, 7, 97, 48, 30, - 64, 48, 82, 116, 160, 13, 134, 151, 134, 115, - 224, 15, 114, 160, 6, 35, 16, 4, 251, 42, - 38, 112, 208, 15, 67, 171, 11, 224, 160, 12, - 181, 28, 13, 6, 176, 7, 211, 192, 13, 108, - 84, 168, 47, 56, 111, 163, 70, 113, 248, 144, - 2, 31, 80, 2, 37, 160, 213, 93, 141, 75, - 32, 49, 117, 81, 240, 35, 212, 225, 15, 242, - 16, 194, 223, 48, 8, 173, 112, 187, 10, 250, - 107, 193, 150, 8, 136, 128, 8, 135, 176, 13, - 253, 144, 0, 118, 224, 54, 117, 224, 15, 62, - 224, 210, 119, 16, 7, 194, 205, 15, 115, 64, - 147, 92, 176, 63, 89, 58, 31, 235, 1, 59, - 143, 11, 4, 236, 200, 15, 53, 7, 4, 117, - 240, 151, 189, 106, 12, 95, 58, 10, 123, 16, - 14, 220, 255, 16, 75, 22, 233, 12, 184, 224, - 12, 247, 48, 106, 123, 176, 7, 24, 48, 218, - 164, 93, 2, 44, 160, 204, 24, 45, 32, 21, - 129, 48, 89, 144, 32, 52, 80, 214, 2, 189, - 10, 173, 16, 9, 69, 124, 8, 135, 96, 219, - 159, 144, 8, 108, 103, 14, 186, 112, 221, 43, - 13, 30, 113, 96, 7, 118, 48, 180, 98, 178, - 210, 253, 32, 206, 236, 117, 54, 60, 160, 134, - 33, 199, 3, 20, 78, 7, 254, 176, 5, 112, - 32, 7, 204, 235, 196, 236, 172, 13, 57, 87, - 203, 174, 112, 8, 184, 80, 121, 60, 42, 195, - 184, 112, 222, 7, 240, 1, 32, 176, 226, 164, - 205, 2, 57, 140, 218, 240, 93, 17, 77, 16, - 5, 213, 49, 3, 29, 0, 4, 176, 157, 9, - 172, 176, 127, 125, 208, 7, 132, 21, 108, 85, - 186, 11, 186, 208, 15, 224, 65, 147, 175, 81, - 7, 227, 252, 207, 83, 2, 4, 32, 243, 207, - 253, 229, 170, 206, 43, 60, 18, 52, 7, 62, - 80, 7, 174, 17, 180, 131, 157, 15, 40, 34, - 217, 202, 48, 208, 245, 240, 14, 137, 240, 212, - 132, 202, 154, 161, 214, 13, 6, 80, 2, 36, - 64, 2, 43, 14, 2, 92, 189, 21, 205, 97, - 17, 82, 32, 4, 130, 225, 15, 167, 49, 7, - 233, 67, 89, 131, 80, 8, 61, 254, 227, 137, - 80, 10, 202, 57, 184, 176, 83, 42, 68, 123, - 7, 64, 144, 224, 175, 65, 206, 118, 255, 208, - 224, 114, 16, 109, 98, 224, 170, 95, 88, 6, - 252, 208, 15, 253, 144, 15, 249, 48, 184, 219, - 160, 207, 92, 220, 3, 15, 188, 15, 236, 96, - 12, 139, 88, 8, 184, 240, 212, 20, 137, 121, - 206, 240, 14, 103, 158, 230, 168, 14, 2, 46, - 238, 230, 17, 129, 17, 76, 16, 29, 215, 113, - 20, 163, 53, 205, 151, 192, 9, 164, 224, 227, - 192, 86, 8, 132, 64, 7, 65, 48, 6, 111, - 192, 184, 52, 253, 26, 64, 80, 232, 76, 254, - 196, 80, 140, 45, 14, 252, 58, 76, 206, 216, - 114, 96, 7, 9, 80, 42, 140, 189, 13, 61, - 144, 15, 200, 27, 4, 85, 172, 13, 211, 172, - 34, 160, 46, 145, 241, 224, 194, 6, 160, 14, - 168, 158, 234, 109, 206, 234, 80, 115, 17, 175, - 142, 29, 80, 192, 5, 73, 1, 14, 137, 236, - 10, 164, 224, 7, 230, 96, 1, 116, 0, 202, - 174, 1, 4, 61, 32, 65, 116, 144, 175, 253, - 224, 54, 197, 125, 236, 115, 160, 11, 235, 28, - 6, 92, 224, 236, 138, 9, 148, 225, 140, 176, - 217, 210, 15, 109, 112, 115, 100, 176, 156, 216, - 238, 233, 209, 32, 226, 186, 124, 15, 248, 176, - 226, 225, 158, 230, 227, 46, 200, 60, 145, 17, - 128, 97, 20, 137, 145, 22, 79, 75, 8, 98, - 128, 46, 104, 19, 202, 111, 112, 170, 53, 217, - 15, 9, 126, 224, 9, 222, 15, 195, 78, 233, - 66, 139, 45, 224, 255, 28, 7, 9, 80, 33, - 197, 125, 46, 167, 154, 15, 45, 166, 11, 91, - 224, 240, 236, 224, 229, 248, 112, 15, 241, 160, - 222, 32, 16, 238, 108, 126, 218, 239, 221, 19, - 25, 33, 5, 160, 129, 22, 87, 176, 5, 45, - 145, 189, 246, 224, 6, 218, 144, 55, 22, 176, - 5, 68, 46, 7, 117, 32, 233, 146, 158, 232, - 65, 59, 7, 43, 77, 3, 117, 192, 184, 117, - 224, 54, 243, 62, 236, 254, 160, 11, 28, 176, - 11, 111, 48, 2, 25, 128, 13, 252, 208, 3, - 216, 174, 12, 217, 80, 15, 59, 32, 218, 31, - 160, 226, 22, 79, 2, 236, 237, 222, 26, 175, - 43, 24, 113, 4, 67, 193, 24, 111, 161, 5, - 187, 0, 6, 18, 112, 34, 215, 157, 15, 118, - 192, 206, 114, 80, 207, 253, 192, 197, 90, 255, - 219, 137, 94, 7, 90, 111, 30, 98, 18, 6, - 64, 16, 7, 97, 64, 15, 171, 176, 10, 246, - 16, 39, 246, 144, 168, 88, 80, 195, 39, 80, - 2, 68, 15, 2, 165, 221, 2, 105, 75, 238, - 1, 162, 17, 67, 48, 20, 42, 177, 18, 47, - 17, 19, 102, 176, 147, 108, 240, 239, 234, 220, - 15, 234, 149, 15, 252, 128, 220, 132, 205, 15, - 9, 176, 10, 170, 64, 15, 244, 224, 11, 198, - 95, 0, 5, 112, 0, 7, 160, 1, 26, 176, - 2, 208, 175, 4, 45, 128, 186, 55, 236, 199, - 199, 124, 204, 235, 141, 2, 56, 172, 17, 56, - 251, 146, 75, 176, 47, 5, 79, 112, 18, 142, - 33, 4, 77, 144, 3, 249, 212, 148, 25, 16, - 78, 131, 45, 207, 21, 40, 2, 236, 128, 13, - 41, 68, 84, 170, 118, 4, 85, 96, 5, 72, - 176, 145, 178, 105, 173, 236, 91, 253, 44, 0, - 16, 40, 4, 178, 208, 209, 194, 134, 0, 132, - 9, 19, 254, 99, 216, 208, 225, 67, 136, 17, - 37, 74, 84, 88, 17, 225, 16, 41, 76, 158, - 52, 113, 210, 177, 9, 14, 51, 88, 204, 124, - 25, 243, 35, 199, 59, 21, 43, 188, 4, 81, - 49, 197, 229, 16, 152, 84, 142, 28, 169, 98, - 5, 73, 146, 36, 74, 148, 180, 224, 217, 66, - 135, 14, 22, 65, 11, 42, 57, 104, 81, 225, - 68, 164, 73, 149, 70, 52, 106, 17, 35, 19, - 168, 94, 64, 164, 88, 99, 70, 138, 148, 41, - 34, 119, 96, 208, 225, 242, 229, 16, 42, 50, - 107, 90, 193, 153, 115, 103, 79, 37, 55, 138, - 54, 93, 184, 212, 237, 91, 165, 108, 43, 86, - 81, 130, 132, 10, 154, 21, 87, 175, 106, 65, - 241, 211, 235, 148, 152, 51, 171, 212, 68, 82, - 24, 137, 141, 181, 114, 219, 194, 101, 220, 120, - 162, 226, 34, 70, 146, 236, 184, 33, 128, 200, - 229, 200, 69, 20, 111, 102, 235, 216, 243, 231, - 199, 156, 69, 143, 94, 12, 218, 244, 105, 166, - 164, 85, 35, 68, 221, 218, 245, 107, 216, 174, - 3, 2, 0, 59 }; - diff --git a/main/main.c b/main/main.c deleted file mode 100644 index 3e1dc0750ac16..0000000000000 --- a/main/main.c +++ /dev/null @@ -1,1955 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* {{{ includes - */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include -#elif defined(NETWARE) -#include -#ifdef USE_WINSOCK -#include -#endif -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#include "php_variables.h" -#include "ext/standard/credits.h" -#ifdef PHP_WIN32 -#include -#include -#include "win32/php_registry.h" -#endif -#include "php_syslog.h" -#include "Zend/zend_exceptions.h" - -#if PHP_SIGCHILD -#include -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" -#include "zend_extensions.h" -#include "zend_ini.h" - -#include "php_content_types.h" -#include "php_ticks.h" -#include "php_logos.h" -#include "php_streams.h" - -#include "SAPI.h" -#include "rfc1867.h" -/* }}} */ - -#ifndef ZTS -php_core_globals core_globals; -#else -PHPAPI int core_globals_id; -#endif - -#define SAFE_FILENAME(f) ((f)?(f):"-") - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnSetPrecision) -{ - EG(precision) = atoi(new_value); - return SUCCESS; -} -/* }}} */ - -#if MEMORY_LIMIT -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnChangeMemoryLimit) -{ - if (new_value) { - PG(memory_limit) = zend_atoi(new_value, new_value_length); - } else { - PG(memory_limit) = 1<<30; /* effectively, no limit */ - } - return zend_set_memory_limit(PG(memory_limit)); -} -/* }}} */ -#endif - - -/* {{{ php_disable_functions - */ -static void php_disable_functions(TSRMLS_D) -{ - char *s = NULL, *e; - - if (!*(INI_STR("disable_functions"))) { - return; - } - - e = PG(disable_functions) = strdup(INI_STR("disable_functions")); - - while (*e) { - switch (*e) { - case ' ': - case ',': - if (s) { - *e = '\0'; - zend_disable_function(s, e-s TSRMLS_CC); - s = NULL; - } - break; - default: - if (!s) { - s = e; - } - break; - } - e++; - } - if (s) { - zend_disable_function(s, e-s TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_disable_classes - */ -static void php_disable_classes(TSRMLS_D) -{ - char *s = NULL, *e; - - if (!*(INI_STR("disable_classes"))) { - return; - } - - e = PG(disable_classes) = strdup(INI_STR("disable_classes")); - - while (*e) { - switch (*e) { - case ' ': - case ',': - if (s) { - *e = '\0'; - zend_disable_class(s, e-s TSRMLS_CC); - s = NULL; - } - break; - default: - if (!s) { - s = e; - } - break; - } - e++; - } - if (s) { - zend_disable_class(s, e-s TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateTimeout) -{ - EG(timeout_seconds) = atoi(new_value); - if (stage==PHP_INI_STAGE_STARTUP) { - /* Don't set a timeout on startup, only per-request */ - return SUCCESS; - } - zend_unset_timeout(TSRMLS_C); - zend_set_timeout(EG(timeout_seconds)); - return SUCCESS; -} - -static ZEND_INI_MH(OnUpdateOutputEncoding) -{ - if (new_value) { - if (zend_set_converter_encoding(&UG(output_encoding_conv), new_value) == FAILURE) { - zend_error(E_CORE_ERROR, "Unrecognized encoding '%s' used for %s", new_value ? new_value : "null", entry->name); - return FAILURE; - } - } else { - if (UG(output_encoding_conv)) { - ucnv_close(UG(output_encoding_conv)); - } - UG(output_encoding_conv) = NULL; - } - if (UG(output_encoding_conv)) { - zend_set_converter_error_mode(UG(output_encoding_conv), UG(from_u_error_mode)); - zend_set_converter_subst_char(UG(output_encoding_conv), UG(subst_char), UG(subst_char_len)); - if (stage == ZEND_INI_STAGE_RUNTIME) { - sapi_update_default_charset(TSRMLS_C); - } - } - - return SUCCESS; -} -/* }}} */ - -#define PHP_INI_OPTION_HEADERS_SENT(option_name) \ - if (SG(headers_sent)) { \ - char *output_start_filename = php_get_output_start_filename(TSRMLS_C); \ - int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); \ - if (output_start_filename) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option " #option_name " cannot be changed after headers have been sent (output started at %s:%d)", \ - output_start_filename, output_start_lineno); \ - } else { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option " #option_name " cannot be changed after headers have been sent"); \ - } \ - return FAILURE; \ - } - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateDefaultCharset) -{ - if (stage == PHP_INI_STAGE_RUNTIME && !SG(request_info).no_headers) { - sapi_header_line ctr = {0}; - int mimetype_len; - - PHP_INI_OPTION_HEADERS_SENT(default_charset) - - mimetype_len = SG(default_mimetype) ? strlen(SG(default_mimetype)) : 0; - - if (new_value_length) { - ctr.line = emalloc( sizeof("Content-type: ")-1 + mimetype_len + sizeof("; charset=")-1 + new_value_length + 1); - - memcpy(ctr.line, "Content-type: ", sizeof("Content-type: ")); - memcpy(ctr.line + sizeof("Content-type: ")-1, SG(default_mimetype), mimetype_len); - memcpy(ctr.line + sizeof("Content-type: ")-1 + mimetype_len, "; charset=", sizeof("; charset=")); - memcpy(ctr.line + sizeof("Content-type: ")-1 + mimetype_len + sizeof("; charset=")-1, new_value, new_value_length); - - ctr.line_len = sizeof("Content-type: ")-1 + mimetype_len + sizeof("; charset=")-1 + new_value_length; - } else { - ctr.line = emalloc( sizeof("Content-type: ")-1 + mimetype_len + 1); - - memcpy(ctr.line, "Content-type: ", sizeof("Content-type: ")); - memcpy(ctr.line + sizeof("Content-type: ")-1, SG(default_mimetype), mimetype_len); - - ctr.line_len = sizeof("Content-type: ")-1 + mimetype_len; - } - ctr.line[ctr.line_len] = 0; - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - efree(ctr.line); - } - - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateDefaultMimetype) -{ - if (stage == PHP_INI_STAGE_RUNTIME && !SG(request_info).no_headers) { - sapi_header_line ctr = {0}; - int charset_len; - - PHP_INI_OPTION_HEADERS_SENT(default_mimetype) - - charset_len = SG(default_charset) ? strlen(SG(default_charset)) : 0; - - if (charset_len) { - ctr.line = emalloc( sizeof("Content-type: ")-1 + new_value_length + sizeof("; charset=")-1 + charset_len + 1); - - memcpy(ctr.line, "Content-type: ", sizeof("Content-type: ")); - memcpy(ctr.line + sizeof("Content-type: ")-1, new_value, new_value_length); - memcpy(ctr.line + sizeof("Content-type: ")-1 + new_value_length, "; charset=", sizeof("; charset=")); - memcpy(ctr.line + sizeof("Content-type: ")-1 + new_value_length + sizeof("; charset=")-1, SG(default_charset), charset_len); - - ctr.line_len = sizeof("Content-type: ")-1 + new_value_length + sizeof("; charset=")-1 + new_value_length; - } else { - ctr.line = emalloc( sizeof("Content-type: ")-1 + new_value_length + 1); - - memcpy(ctr.line, "Content-type: ", sizeof("Content-type: ")); - memcpy(ctr.line + sizeof("Content-type: ")-1, new_value, new_value_length); - - ctr.line_len = sizeof("Content-type: ")-1 + new_value_length; - } - ctr.line[ctr.line_len] = 0; - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - efree(ctr.line); - } - - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - -/* Need to convert to strings and make use of: - * PHP_SAFE_MODE - * - * Need to be read from the environment (?): - * PHP_AUTO_PREPEND_FILE - * PHP_AUTO_APPEND_FILE - * PHP_DOCUMENT_ROOT - * PHP_USER_DIR - * PHP_INCLUDE_PATH - */ - -#ifndef PHP_SAFE_MODE_EXEC_DIR -# define PHP_SAFE_MODE_EXEC_DIR "" -#endif - -#if defined(PHP_PROG_SENDMAIL) && !defined(NETWARE) -# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t -i " -#else -# define DEFAULT_SENDMAIL_PATH NULL -#endif -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - PHP_INI_ENTRY_EX("define_syslog_variables", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb) - PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.html", HL_HTML_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - - STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, allow_call_time_pass_reference, zend_compiler_globals, compiler_globals) - STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, zend_compiler_globals, compiler_globals) - STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateBool, display_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("docref_root", "", PHP_INI_ALL, OnUpdateString, docref_root, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("docref_ext", "", PHP_INI_ALL, OnUpdateString, docref_ext, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_ALL, OnUpdateBool, html_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("xmlrpc_errors", "0", PHP_INI_SYSTEM, OnUpdateBool, xmlrpc_errors, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("xmlrpc_error_number", "0", PHP_INI_ALL, OnUpdateLong, xmlrpc_error_number, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("max_input_time", "-1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, max_input_time, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_ALL, OnUpdateBool, implicit_flush, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("log_errors_max_len", "1024", PHP_INI_ALL, OnUpdateLong, log_errors_max_len, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("report_zend_debug", "1", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, magic_quotes_gpc, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_runtime, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_sybase, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_globals", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_globals, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_long_arrays", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_long_arrays, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("auto_globals_jit", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) -#if PHP_SAFE_MODE - STD_PHP_INI_BOOLEAN("safe_mode", "1", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals) -#else - STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals) -#endif - STD_PHP_INI_ENTRY("safe_mode_include_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, safe_mode_include_dir, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("safe_mode_gid", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode_gid, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("short_open_tag", DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) - STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateBool, track_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("y2k_compliance", "1", PHP_INI_ALL, OnUpdateBool, y2k_compliance, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("unserialize_callback_func", NULL, PHP_INI_ALL, OnUpdateString, unserialize_callback_func, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("serialize_precision", "100", PHP_INI_ALL, OnUpdateLong, serialize_precision, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("arg_separator.output", "&", PHP_INI_ALL, OnUpdateStringUnempty, arg_separator.output, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("arg_separator.input", "&", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, arg_separator.input, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_append_file, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_prepend_file, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("default_charset", SAPI_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateDefaultCharset, default_charset, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateDefaultMimetype, default_mimetype, sapi_globals_struct,sapi_globals) - ZEND_INI_ENTRY("unicode.output_encoding", NULL, ZEND_INI_ALL, OnUpdateOutputEncoding) - STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateString, error_log, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("include_path", PHP_INCLUDE_PATH, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) - PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnUpdateTimeout) - STD_PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_SYSTEM, OnUpdateString, open_basedir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("safe_mode_exec_dir", PHP_SAFE_MODE_EXEC_DIR, PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir, php_core_globals, core_globals) - - STD_PHP_INI_BOOLEAN("file_uploads", "1", PHP_INI_SYSTEM, OnUpdateBool, file_uploads, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("upload_max_filesize", "2M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, upload_max_filesize, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("post_max_size", "8M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, post_max_size, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("upload_tmp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, upload_tmp_dir, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, user_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("variables_order", "EGPCS", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, variables_order, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("error_append_string", NULL, PHP_INI_ALL, OnUpdateString, error_append_string, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("error_prepend_string", NULL, PHP_INI_ALL, OnUpdateString, error_prepend_string, php_core_globals, core_globals) - - PHP_INI_ENTRY("SMTP", "localhost",PHP_INI_ALL, NULL) - PHP_INI_ENTRY("smtp_port", "25", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL) -#if MEMORY_LIMIT - PHP_INI_ENTRY("memory_limit", "8M", PHP_INI_ALL, OnChangeMemoryLimit) -#endif - PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision) - PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("sendmail_path", DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("mail.force_extra_parameters",NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, NULL) - PHP_INI_ENTRY("disable_functions", "", PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("disable_classes", "", PHP_INI_SYSTEM, NULL) - - STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) -#ifdef REALPATH_CACHE - STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals) - STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals) -#endif -PHP_INI_END() -/* }}} */ - -/* True globals (no need for thread safety */ -/* But don't make them a single int bitfield */ -static int module_initialized = 0; -static int module_startup = 1; -static int module_shutdown = 0; - -/* {{{ php_log_err - */ -PHPAPI void php_log_err(char *log_message TSRMLS_DC) -{ - FILE *log_file; - char error_time_str[128]; - struct tm tmbuf; - time_t error_time; - - /* Try to use the specified logging location. */ - if (PG(error_log) != NULL) { -#ifdef HAVE_SYSLOG_H - if (!strcmp(PG(error_log), "syslog")) { - php_syslog(LOG_NOTICE, "%.500s", log_message); - return; - } -#endif - log_file = VCWD_FOPEN(PG(error_log), "ab"); - if (log_file != NULL) { - time(&error_time); - strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf)); - fprintf(log_file, "[%s] ", error_time_str); - fprintf(log_file, "%s", log_message); - fprintf(log_file, "%s", PHP_EOL); - fclose(log_file); - return; - } - } - - /* Otherwise fall back to the default logging location, if we have one */ - - if (sapi_module.log_message) { - sapi_module.log_message(log_message); - } -} -/* }}} */ - -/* {{{ php_write - wrapper for modules to use PHPWRITE */ -PHPAPI int php_write(void *buf, uint size TSRMLS_DC) -{ - return PHPWRITE(buf, size); -} -/* }}} */ - -/* {{{ php_printf - */ -PHPAPI int php_printf(const char *format, ...) -{ - va_list args; - int ret; - char *buffer; - int size; - TSRMLS_FETCH(); - - va_start(args, format); - size = vspprintf(&buffer, 0, format, args); - ret = PHPWRITE(buffer, size); - efree(buffer); - va_end(args); - - return ret; -} -/* }}} */ - -/* {{{ php_verror helpers */ - -/* {{{ php_during_module_startup */ -static int php_during_module_startup() -{ - return module_startup; -} -/* }}} */ - -/* {{{ php_during_module_shutdown */ -static int php_during_module_shutdown() -{ - return module_shutdown; -} -/* }}} */ - -/* }}} */ - -/* {{{ php_verror */ -/* php_verror is called from php_error_docref functions. - * Its purpose is to unify error messages and automatically generate clickable - * html error messages if correcponding ini setting (html_errors) is activated. - * See: CODING_STANDARDS for details. - */ -PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) -{ - char *buffer = NULL, *docref_buf = NULL, *target = NULL; - char *docref_target = "", *docref_root = ""; - char *p; - int buffer_len = 0; - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - char *function = NULL; - char *origin; - char *message; - char *stage; - - /* get error text into buffer and escape for html if necessary */ - buffer_len = vspprintf(&buffer, 0, format, args); - if (PG(html_errors)) { - int len; - char *replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); - efree(buffer); - buffer = replace; - buffer_len = len; - } - - /* which function caused the problem if any at all */ - if (php_during_module_startup()) { - stage = "PHP Startup"; - } else if (php_during_module_shutdown()) { - stage = "PHP Shutdown"; - } else { - function = get_active_function_name(TSRMLS_C); - if (!function || !USTR_LEN(function)) { - stage = "Unknown"; - function = NULL; - } - } - - /* if we still have memory then format the origin */ - if (function) { - spprintf(&origin, 0, "%v%s%v(%s)", class_name, space, function, params); - } else { - spprintf(&origin, 0, "%s", stage); - } - - /* origin and buffer available, so lets come up with the error message */ - if (docref && docref[0] == '#') { - docref_target = strchr(docref, '#'); - docref = NULL; - } - - /* no docref given but function is known (the default) */ - if (!docref && function) { - spprintf(&docref_buf, 0, "function.%v", function); - while((p = strchr(docref_buf, '_')) != NULL) { - *p = '-'; - } - docref = docref_buf; - } - - /* we have a docref for a function AND - * - we show erroes in html mode OR - * - the user wants to see the links anyway - */ - if (docref && function && (PG(html_errors) || strlen(PG(docref_root)))) { - if (strncmp(docref, "http://", 7)) { - /* We don't have 'http://' so we use docref_root */ - - char *ref; /* temp copy for duplicated docref */ - - docref_root = PG(docref_root); - - ref = estrdup(docref); - if (docref_buf) { - efree(docref_buf); - } - docref_buf = ref; - /* strip of the target if any */ - p = strrchr(ref, '#'); - if (p) { - target = estrdup(p); - if (target) { - docref_target = target; - *p = '\0'; - } - } - /* add the extension if it is set in ini */ - if (PG(docref_ext) && strlen(PG(docref_ext))) { - spprintf(&docref_buf, 0, "%s%s", ref, PG(docref_ext)); - efree(ref); - } - docref = docref_buf; - } - /* display html formatted or only show the additional links */ - if (PG(html_errors)) { - spprintf(&message, 0, "%s [%s]: %s", origin, docref_root, docref, docref_target, docref, buffer); - } else { - spprintf(&message, 0, "%s [%s%s%s]: %s", origin, docref_root, docref, docref_target, buffer); - } - if (target) { - efree(target); - } - } else { - spprintf(&message, 0, "%s: %s", origin, buffer); - } - efree(origin); - if (docref_buf) { - efree(docref_buf); - } - php_error(type, "%s", message); - efree(message); - - if (PG(track_errors) && module_initialized && EG(active_symbol_table)) { - zval *tmp; - ALLOC_INIT_ZVAL(tmp); - ZVAL_STRINGL(tmp, buffer, buffer_len, 1); - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(pval *), NULL); - } - efree(buffer); -} -/* }}} */ - -/* {{{ php_error_docref0 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); - php_verror(docref, "", type, format, args TSRMLS_CC); - va_end(args); -} -/* }}} */ - -/* {{{ php_error_docref1 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); - php_verror(docref, param1, type, format, args TSRMLS_CC); - va_end(args); -} -/* }}} */ - -/* {{{ php_error_docref2 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...) -{ - char *params; - va_list args; - - spprintf(¶ms, 0, "%s,%s", param1, param2); - va_start(args, format); - php_verror(docref, params ? params : "...", type, format, args TSRMLS_CC); - va_end(args); - if (params) { - efree(params); - } -} -/* }}} */ - -/* {{{ php_html_puts */ -PHPAPI void php_html_puts(const char *str, uint size TSRMLS_DC) -{ - zend_html_puts(str, size TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_suppress_errors */ -PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC) -{ - PG(error_handling) = error_handling; - PG(exception_class) = exception_class; - if (PG(last_error_message)) { - free(PG(last_error_message)); - PG(last_error_message) = NULL; - } - if (PG(last_error_file)) { - free(PG(last_error_file)); - PG(last_error_file) = NULL; - } - PG(last_error_lineno) = 0; -} -/* }}} */ - -/* {{{ php_error_cb - extended error handling function */ -static void php_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) -{ - char *buffer; - int buffer_len, display; - TSRMLS_FETCH(); - - buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args); - - /* check for repeated errors to be ignored */ - if (PG(ignore_repeated_errors) && PG(last_error_message)) { - /* no check for PG(last_error_file) is needed since it cannot - * be NULL if PG(last_error_message) is not NULL */ - if (strcmp(PG(last_error_message), buffer) - || (!PG(ignore_repeated_source) - && ((PG(last_error_lineno) != error_lineno) - || strcmp(PG(last_error_file), error_filename)))) { - display = 1; - } else { - display = 0; - } - } else { - display = 1; - } - - /* store the error if it has changed */ - if (display) { - if (PG(last_error_message)) { - free(PG(last_error_message)); - } - if (PG(last_error_file)) { - free(PG(last_error_file)); - } - PG(last_error_message) = strdup(buffer); - PG(last_error_file) = strdup(error_filename); - PG(last_error_lineno) = error_lineno; - } - - /* according to error handling mode, suppress error, throw exception or show it */ - if (PG(error_handling) != EH_NORMAL) { - switch (type) { - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_PARSE: - /* fatal errors are real errors and cannot be made exceptions */ - break; - case E_STRICT: - /* for the sake of BC to old damaged code */ - break; - case E_NOTICE: - case E_USER_NOTICE: - /* notices are no errors and are not treated as such like E_WARNINGS */ - break; - default: - /* throw an exception if we are in EH_THROW mode - * but DO NOT overwrite a pending exception - */ - if (PG(error_handling) == EH_THROW && !EG(exception)) { - zend_throw_error_exception(PG(exception_class), buffer, 0, type TSRMLS_CC); - } - efree(buffer); - return; - } - } - - /* display/log the error if necessary */ - if (display && (EG(error_reporting) & type || (type & E_CORE)) - && (PG(log_errors) || PG(display_errors) || (!module_initialized))) { - char *error_type_str; - - switch (type) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - error_type_str = "Fatal error"; - break; - case E_RECOVERABLE_ERROR: - error_type_str = "Catchable fatal error"; - break; - case E_WARNING: - case E_CORE_WARNING: - case E_COMPILE_WARNING: - case E_USER_WARNING: - error_type_str = "Warning"; - break; - case E_PARSE: - error_type_str = "Parse error"; - break; - case E_NOTICE: - case E_USER_NOTICE: - error_type_str = "Notice"; - break; - case E_STRICT: - error_type_str = "Strict Standards"; - break; - default: - error_type_str = "Unknown error"; - break; - } - - if (!module_initialized || PG(log_errors)) { - char *log_buffer; - -#ifdef PHP_WIN32 - if (type==E_CORE_ERROR || type==E_CORE_WARNING) { - MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE); - } -#endif - spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno); - php_log_err(log_buffer TSRMLS_CC); - efree(log_buffer); - } - if (PG(display_errors) - && ((module_initialized && !PG(during_request_startup)) - || (PG(display_startup_errors) - && (OG(php_body_write)==php_default_output_func || OG(php_body_write)==php_ub_body_write_no_header || OG(php_body_write)==php_ub_body_write) - ) - ) - ) { - - if (PG(xmlrpc_errors)) { - php_printf("faultCode%ldfaultString%s:%s in %s on line %d", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno); - } else { - char *prepend_string = INI_STR("error_prepend_string"); - char *append_string = INI_STR("error_append_string"); - char *error_format = PG(html_errors) ? - "%s
              \n%s: %s in %s on line %d
              \n%s" - : "%s\n%s: %s in %s on line %d\n%s"; - php_printf(error_format, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); - } - } -#if ZEND_DEBUG - if (PG(report_zend_debug)) { - zend_bool trigger_break; - - switch (type) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - trigger_break=1; - break; - default: - trigger_break=0; - break; - } - zend_output_debug_string(trigger_break, "%s(%d) : %s - %s", error_filename, error_lineno, error_type_str, buffer); - } -#endif - } - - /* Bail out if we can't recover */ - switch (type) { - case E_CORE_ERROR: - if(!module_initialized) { - /* bad error in module startup - no way we can live with this */ - exit(-2); - } - /* no break - intentionally */ - case E_ERROR: - case E_RECOVERABLE_ERROR: - /* case E_PARSE: the parser would return 1 (failure), we can bail out nicely */ - case E_COMPILE_ERROR: - case E_USER_ERROR: - EG(exit_status) = 255; - if (module_initialized) { -#if MEMORY_LIMIT - /* restore memory limit */ - AG(memory_limit) = PG(memory_limit); -#endif - efree(buffer); - zend_bailout(); - return; - } - break; - } - - /* Log if necessary */ - if (!display) { - efree(buffer); - return; - } - if (PG(track_errors) && module_initialized && EG(active_symbol_table)) { - pval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL(tmp); - Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len); - Z_STRLEN_P(tmp) = buffer_len; - Z_TYPE_P(tmp) = IS_STRING; - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL); - } - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool set_time_limit(int seconds) - Sets the maximum time a script can run */ -PHP_FUNCTION(set_time_limit) -{ - zval **new_timeout; - - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set time limit in safe mode"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_timeout) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(new_timeout); - if (zend_alter_ini_entry("max_execution_time", sizeof("max_execution_time"), Z_STRVAL_PP(new_timeout), Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_fopen_wrapper_for_zend - */ -static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path) -{ - TSRMLS_FETCH(); - - return php_stream_open_wrapper_as_file((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path); -} -/* }}} */ - -static void stream_closer_for_zend(void *handle TSRMLS_DC) -{ - php_stream_close((php_stream*)handle); -} - -static long stream_fteller_for_zend(void *handle TSRMLS_DC) -{ - return (long)php_stream_tell((php_stream*)handle); -} - -static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) -{ - php_stream *stream; - - stream = php_stream_open_wrapper((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, &handle->opened_path); - - if (stream) { - handle->type = ZEND_HANDLE_STREAM; - handle->filename = (char*)filename; - handle->free_filename = 0; - handle->handle.stream.handle = stream; - handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read; - handle->handle.stream.closer = stream_closer_for_zend; - handle->handle.stream.fteller = stream_fteller_for_zend; - handle->handle.stream.interactive = 0; - /* suppress warning if this stream is not explicitly closed */ - php_stream_auto_cleanup(stream); - - return SUCCESS; - } - return FAILURE; -} - - -/* {{{ php_get_configuration_directive_for_zend - */ -static int php_get_configuration_directive_for_zend(char *name, uint name_length, zval *contents) -{ - zval *retval = cfg_get_entry(name, name_length); - - if (retval) { - *contents = *retval; - return SUCCESS; - } else { - return FAILURE; - } -} -/* }}} */ - -/* {{{ php_message_handler_for_zend - */ -static void php_message_handler_for_zend(long message, void *data) -{ - TSRMLS_FETCH(); - - switch (message) { - case ZMSG_FAILED_INCLUDE_FOPEN: - php_error_docref("function.include" TSRMLS_CC, E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - break; - case ZMSG_FAILED_REQUIRE_FOPEN: - php_error_docref("function.require" TSRMLS_CC, E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - break; - case ZMSG_FAILED_HIGHLIGHT_FOPEN: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data)); - break; - case ZMSG_MEMORY_LEAK_DETECTED: - case ZMSG_MEMORY_LEAK_REPEATED: -#if ZEND_DEBUG - if (EG(error_reporting) & E_WARNING) { - char memory_leak_buf[512]; - - if (message==ZMSG_MEMORY_LEAK_DETECTED) { - zend_mem_header *t = (zend_mem_header *) data; - void *ptr = (void *)((char *)t+sizeof(zend_mem_header)+MEM_HEADER_PADDING); - - snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%d bytes), script=%s\n", t->filename, t->lineno, (unsigned long)ptr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); - if (t->orig_filename) { - char relay_buf[512]; - - snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno); - strcat(memory_leak_buf, relay_buf); - } - } else { - unsigned long leak_count = (unsigned long) data; - - snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":"")); - } -# if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); -# else - fprintf(stderr, "%s", memory_leak_buf); -# endif - } -#endif - break; - case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: -#if ZEND_DEBUG - if (EG(error_reporting) & E_WARNING) { - char memory_leak_buf[512]; - - snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data)); -# if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); -# else - fprintf(stderr, "%s", memory_leak_buf); -# endif - } -#endif - break; - case ZMSG_LOG_SCRIPT_NAME: { - struct tm *ta, tmbuf; - time_t curtime; - char *datetime_str, asctimebuf[52]; - - time(&curtime); - ta = php_localtime_r(&curtime, &tmbuf); - datetime_str = php_asctime_r(ta, asctimebuf); - datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */ - fprintf(stderr, "[%s] Script: '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated)); - } - break; - } -} -/* }}} */ - - -void php_on_timeout(int seconds TSRMLS_DC) -{ - PG(connection_status) |= PHP_CONNECTION_TIMEOUT; - zend_set_timeout(EG(timeout_seconds)); -} - -#if PHP_SIGCHILD -/* {{{ sigchld_handler - */ -static void sigchld_handler(int apar) -{ - while (waitpid(-1, NULL, WNOHANG) > 0); - signal(SIGCHLD, sigchld_handler); -} -/* }}} */ -#endif - -/* {{{ php_start_sapi() - */ -static int php_start_sapi(TSRMLS_D) -{ - int retval = SUCCESS; - - if(!SG(sapi_started)) { - zend_try { - PG(during_request_startup) = 1; - - /* initialize global variables */ - PG(modules_activated) = 0; - PG(header_is_being_sent) = 0; - PG(connection_status) = PHP_CONNECTION_NORMAL; - - zend_activate(TSRMLS_C); - zend_set_timeout(EG(timeout_seconds)); - zend_activate_modules(TSRMLS_C); - PG(modules_activated)=1; - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - SG(sapi_started) = 1; - } - return retval; -} - -/* }}} */ - -/* {{{ php_request_startup - */ -#ifndef APACHE_HOOKS -int php_request_startup(TSRMLS_D) -{ - int retval = SUCCESS; - -#ifdef PHP_WIN32 - CoInitialize(NULL); -#endif - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - - zend_try { - PG(during_request_startup) = 1; - - php_output_activate(TSRMLS_C); - - /* initialize global variables */ - PG(modules_activated) = 0; - PG(header_is_being_sent) = 0; - PG(connection_status) = PHP_CONNECTION_NORMAL; - - zend_activate(TSRMLS_C); - sapi_activate(TSRMLS_C); - - if (PG(max_input_time) == -1) { - zend_set_timeout(EG(timeout_seconds)); - } else { - zend_set_timeout(PG(max_input_time)); - } - - if (PG(expose_php)) { - sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); - } - - if (PG(output_handler) && PG(output_handler)[0]) { - php_start_ob_buffer_named(PG(output_handler), 0, 1 TSRMLS_CC); - } else if (PG(output_buffering)) { - if (PG(output_buffering)>1) { - php_start_ob_buffer(NULL, PG(output_buffering), 1 TSRMLS_CC); - } else { - php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC); - } - } else if (PG(implicit_flush)) { - php_start_implicit_flush(TSRMLS_C); - } - - /* We turn this off in php_execute_script() */ - /* PG(during_request_startup) = 0; */ - - sapi_update_default_charset(TSRMLS_C); - - php_hash_environment(TSRMLS_C); - zend_activate_modules(TSRMLS_C); - PG(modules_activated)=1; - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - return retval; -} -# else -int php_request_startup(TSRMLS_D) -{ - int retval = SUCCESS; - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - - if (php_start_sapi() == FAILURE) { - return FAILURE; - } - - php_output_activate(TSRMLS_C); - sapi_activate(TSRMLS_C); - php_hash_environment(TSRMLS_C); - - zend_try { - PG(during_request_startup) = 1; - php_output_activate(TSRMLS_C); - if (PG(expose_php)) { - sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); - } - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - return retval; -} -# endif -/* }}} */ - -/* {{{ php_request_startup_for_hook - */ -int php_request_startup_for_hook(TSRMLS_D) -{ - int retval = SUCCESS; - -#if PHP_SIGCHLD - signal(SIGCHLD, sigchld_handler); -#endif - - if (php_start_sapi(TSRMLS_C) == FAILURE) { - return FAILURE; - } - - php_output_activate(TSRMLS_C); - sapi_activate_headers_only(TSRMLS_C); - php_hash_environment(TSRMLS_C); - - return retval; -} -/* }}} */ - -/* {{{ php_request_shutdown_for_exec - */ -void php_request_shutdown_for_exec(void *dummy) -{ - TSRMLS_FETCH(); - - /* used to close fd's in the 3..255 range here, but it's problematic - */ - shutdown_memory_manager(1, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_request_shutdown_for_hook - */ -void php_request_shutdown_for_hook(void *dummy) -{ - TSRMLS_FETCH(); - - if (PG(modules_activated)) zend_try { - php_call_shutdown_functions(TSRMLS_C); - } zend_end_try(); - - if (PG(modules_activated)) { - zend_deactivate_modules(TSRMLS_C); - php_free_shutdown_functions(TSRMLS_C); - } - - zend_try { - int i; - - for (i = 0; i < NUM_TRACK_VARS; i++) { - if (PG(http_globals)[i]) { - zval_ptr_dtor(&PG(http_globals)[i]); - } - } - } zend_end_try(); - - zend_deactivate(TSRMLS_C); - - zend_try { - sapi_deactivate(TSRMLS_C); - } zend_end_try(); - - zend_try { - php_shutdown_stream_hashes(TSRMLS_C); - } zend_end_try(); - - zend_try { - shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC); - } zend_end_try(); - - zend_try { - zend_unset_timeout(TSRMLS_C); - } zend_end_try(); -} - -/* }}} */ - -/* {{{ php_request_shutdown - */ -void php_request_shutdown(void *dummy) -{ - zend_bool report_memleaks; - TSRMLS_FETCH(); - - report_memleaks = PG(report_memleaks); - - /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed - * inside zend_executor callback functions. - */ - EG(opline_ptr) = NULL; - EG(active_op_array) = NULL; - - /* 1. Call all possible __destruct() functions */ - zend_try { - zend_call_destructors(TSRMLS_C); - } zend_end_try(); - - /* 2. Call all possible shutdown functions registered with register_shutdown_function() */ - if (PG(modules_activated)) zend_try { - php_call_shutdown_functions(TSRMLS_C); - } zend_end_try(); - - /* 3. Flush all output buffers */ - zend_try { - php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); - } zend_end_try(); - - /* 4. Send the set HTTP headers (note: This must be done AFTER php_end_ob_buffers() !!) */ - zend_try { - sapi_send_headers(TSRMLS_C); - } zend_end_try(); - - /* 5. Call all extensions RSHUTDOWN functions */ - if (PG(modules_activated)) { - zend_deactivate_modules(TSRMLS_C); - php_free_shutdown_functions(TSRMLS_C); - } - - /* 6. Destroy super-globals */ - zend_try { - int i; - - for (i=0; ifilename TSRMLS_CC); -#endif - - PG(during_request_startup) = 0; - - if (primary_file->type == ZEND_HANDLE_FILENAME - && primary_file->filename) { -#if HAVE_BROKEN_GETCWD - /* this looks nasty to me */ - old_cwd_fd = open(".", 0); -#else - VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); -#endif - VCWD_CHDIR_FILE(primary_file->filename); - } - - if (primary_file->filename) { - char realfile[MAXPATHLEN]; - int realfile_len; - int dummy = 1; - if (VCWD_REALPATH(primary_file->filename, realfile)) { - realfile_len = strlen(realfile); - zend_hash_add(&EG(included_files), realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL); - if (strncmp(realfile, primary_file->filename, realfile_len)) { - old_primary_file_path = primary_file->filename; - primary_file->filename = realfile; - } - } - } - - if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { - prepend_file.filename = PG(auto_prepend_file); - prepend_file.opened_path = NULL; - prepend_file.free_filename = 0; - prepend_file.type = ZEND_HANDLE_FILENAME; - prepend_file_p = &prepend_file; - } else { - prepend_file_p = NULL; - } - - if (PG(auto_append_file) && PG(auto_append_file)[0]) { - append_file.filename = PG(auto_append_file); - append_file.opened_path = NULL; - append_file.free_filename = 0; - append_file.type = ZEND_HANDLE_FILENAME; - append_file_p = &append_file; - } else { - append_file_p = NULL; - } -#ifdef PHP_WIN32 - zend_unset_timeout(TSRMLS_C); -#endif - zend_set_timeout(INI_INT("max_execution_time")); - retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); - - if (old_primary_file_path) { - primary_file->filename = old_primary_file_path; - } - - } zend_end_try(); - -#if HAVE_BROKEN_GETCWD - if (old_cwd_fd != -1) { - fchdir(old_cwd_fd); - close(old_cwd_fd); - } -#else - if (old_cwd[0] != '\0') { - VCWD_CHDIR(old_cwd); - } - free_alloca(old_cwd); -#endif - return retval; -} -/* }}} */ - -/* {{{ php_execute_simple_script - */ -PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC) -{ - char *old_cwd; - - EG(exit_status) = 0; -#define OLD_CWD_SIZE 4096 - old_cwd = do_alloca(OLD_CWD_SIZE); - old_cwd[0] = '\0'; - - zend_try { -#ifdef PHP_WIN32 - UpdateIniFromRegistry(primary_file->filename TSRMLS_CC); -#endif - - PG(during_request_startup) = 0; - - if (primary_file->type == ZEND_HANDLE_FILENAME && primary_file->filename) { - VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); - VCWD_CHDIR_FILE(primary_file->filename); - } - zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file); - } zend_end_try(); - - if (old_cwd[0] != '\0') { - VCWD_CHDIR(old_cwd); - } - - free_alloca(old_cwd); - return EG(exit_status); -} -/* }}} */ - -/* {{{ php_handle_aborted_connection - */ -PHPAPI void php_handle_aborted_connection(void) -{ - TSRMLS_FETCH(); - - PG(connection_status) = PHP_CONNECTION_ABORTED; - php_output_set_status(0 TSRMLS_CC); - - if (!PG(ignore_user_abort)) { - zend_bailout(); - } -} -/* }}} */ - -/* {{{ php_handle_auth_data - */ -PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC) -{ - int ret = -1; - - if (auth && auth[0] != '\0' && strncmp(auth, "Basic ", 6) == 0) { - char *pass; - char *user; - - user = php_base64_decode(auth + 6, strlen(auth) - 6, NULL); - if (user) { - pass = strchr(user, ':'); - if (pass) { - *pass++ = '\0'; - SG(request_info).auth_user = user; - SG(request_info).auth_password = estrdup(pass); - ret = 0; - } else { - efree(user); - } - } - } - - if (ret == -1) { - SG(request_info).auth_user = SG(request_info).auth_password = NULL; - } else { - SG(request_info).auth_digest = NULL; - } - - if (ret == -1 && auth && auth[0] != '\0' && strncmp(auth, "Digest ", 7) == 0) { - SG(request_info).auth_digest = estrdup(auth); - ret = 0; - } - - if (ret == -1) { - SG(request_info).auth_digest = NULL; - } - - return ret; -} -/* }}} */ - -/* {{{ php_lint_script - */ -PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC) -{ - zend_op_array *op_array; - zend_bool retval = FAILURE; - - zend_try { - op_array = zend_compile_file(file, ZEND_INCLUDE TSRMLS_CC); - zend_destroy_file_handle(file TSRMLS_CC); - - if (op_array) { - destroy_op_array(op_array TSRMLS_CC); - efree(op_array); - retval = SUCCESS; - } - } zend_end_try(); - - return retval; -} -/* }}} */ - -#ifdef PHP_WIN32 -/* {{{ dummy_indent - just so that this symbol gets exported... */ -PHPAPI void dummy_indent() -{ - zend_indent(); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/mergesort.c b/main/mergesort.c deleted file mode 100644 index 8ddd8644df627..0000000000000 --- a/main/mergesort.c +++ /dev/null @@ -1,358 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Peter McIlroy. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -/* $Id$ */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Hybrid exponential search/linear search merge sort with hybrid - * natural/pairwise first pass. Requires about .3% more comparisons - * for random data than LSMS with pairwise first pass alone. - * It works for objects as small as two bytes. - */ - -#define NATURAL -#define THRESHOLD 16 /* Best choice for natural merge cut-off. */ - -/* #define NATURAL to get hybrid natural merge. - * (The default is pairwise merging.) - */ - -#include - -#include -#include -#include - -#include "php.h" - -#ifdef PHP_WIN32 -#include /* Includes definition for u_char */ -#endif - -static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); -static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); - -#define ISIZE sizeof(int) -#define PSIZE sizeof(u_char *) -#define ICOPY_LIST(src, dst, last) \ - do \ - *(int*)dst = *(int*)src, src += ISIZE, dst += ISIZE; \ - while(src < last) -#define ICOPY_ELT(src, dst, i) \ - do \ - *(int*) dst = *(int*) src, src += ISIZE, dst += ISIZE; \ - while (i -= ISIZE) - -#define CCOPY_LIST(src, dst, last) \ - do \ - *dst++ = *src++; \ - while (src < last) -#define CCOPY_ELT(src, dst, i) \ - do \ - *dst++ = *src++; \ - while (i -= 1) - -/* - * Find the next possible pointer head. (Trickery for forcing an array - * to do double duty as a linked list when objects do not align with word - * boundaries. - */ -/* Assumption: PSIZE is a power of 2. */ -#define EVAL(p) (u_char **) \ - ((u_char *)0 + \ - (((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1))) - -/* {{{ php_mergesort - * Arguments are as for qsort. - */ -int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - register unsigned int i; - register int sense; - int big, iflag; - register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2; - u_char *list2, *list1, *p2, *p, *last, **p1; - - if (size < PSIZE / 2) { /* Pointers must fit into 2 * size. */ - errno = EINVAL; - return (-1); - } - - if (nmemb == 0) - return (0); - - /* - * XXX - * Stupid subtraction for the Cray. - */ - iflag = 0; - if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE)) - iflag = 1; - - if ((list2 = malloc(nmemb * size + PSIZE)) == NULL) - return (-1); - - list1 = base; - setup(list1, list2, nmemb, size, cmp TSRMLS_CC); - last = list2 + nmemb * size; - i = big = 0; - while (*EVAL(list2) != last) { - l2 = list1; - p1 = EVAL(list1); - for (tp2 = p2 = list2; p2 != last; p1 = EVAL(l2)) { - p2 = *EVAL(p2); - f1 = l2; - f2 = l1 = list1 + (p2 - list2); - if (p2 != last) - p2 = *EVAL(p2); - l2 = list1 + (p2 - list2); - while (f1 < l1 && f2 < l2) { - if ((*cmp)(f1, f2 TSRMLS_CC) <= 0) { - q = f2; - b = f1, t = l1; - sense = -1; - } else { - q = f1; - b = f2, t = l2; - sense = 0; - } - if (!big) { /* here i = 0 */ - while ((b += size) < t && cmp(q, b TSRMLS_CC) >sense) - if (++i == 6) { - big = 1; - goto EXPONENTIAL; - } - } else { -EXPONENTIAL: for (i = size; ; i <<= 1) - if ((p = (b + i)) >= t) { - if ((p = t - size) > b && - (*cmp)(q, p TSRMLS_CC) <= sense) - t = p; - else - b = p; - break; - } else if ((*cmp)(q, p TSRMLS_CC) <= sense) { - t = p; - if (i == size) - big = 0; - goto FASTCASE; - } else - b = p; - while (t > b+size) { - i = (((t - b) / size) >> 1) * size; - if ((*cmp)(q, p = b + i TSRMLS_CC) <= sense) - t = p; - else - b = p; - } - goto COPY; -FASTCASE: while (i > size) - if ((*cmp)(q, - p = b + (i >>= 1) TSRMLS_CC) <= sense) - t = p; - else - b = p; -COPY: b = t; - } - i = size; - if (q == f1) { - if (iflag) { - ICOPY_LIST(f2, tp2, b); - ICOPY_ELT(f1, tp2, i); - } else { - CCOPY_LIST(f2, tp2, b); - CCOPY_ELT(f1, tp2, i); - } - } else { - if (iflag) { - ICOPY_LIST(f1, tp2, b); - ICOPY_ELT(f2, tp2, i); - } else { - CCOPY_LIST(f1, tp2, b); - CCOPY_ELT(f2, tp2, i); - } - } - } - if (f2 < l2) { - if (iflag) - ICOPY_LIST(f2, tp2, l2); - else - CCOPY_LIST(f2, tp2, l2); - } else if (f1 < l1) { - if (iflag) - ICOPY_LIST(f1, tp2, l1); - else - CCOPY_LIST(f1, tp2, l1); - } - *p1 = l2; - } - tp2 = list1; /* swap list1, list2 */ - list1 = list2; - list2 = tp2; - last = list2 + nmemb*size; - } - if (base == list2) { - memmove(list2, list1, nmemb*size); - list2 = list1; - } - free(list2); - return (0); -} -/* }}} */ - -#define swap(a, b) { \ - s = b; \ - i = size; \ - do { \ - tmp = *a; *a++ = *s; *s++ = tmp; \ - } while (--i); \ - a -= size; \ - } -#define reverse(bot, top) { \ - s = top; \ - do { \ - i = size; \ - do { \ - tmp = *bot; *bot++ = *s; *s++ = tmp; \ - } while (--i); \ - s -= size2; \ - } while(bot < s); \ -} - -/* {{{ setup - * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of - * increasing order, list2 in a corresponding linked list. Checks for runs - * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL - * is defined. Otherwise simple pairwise merging is used.) - */ -static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - int i, length, size2, tmp, sense; - u_char *f1, *f2, *s, *l2, *last, *p2; - - size2 = size*2; - if (n <= 5) { - insertionsort(list1, n, size, cmp TSRMLS_CC); - *EVAL(list2) = (u_char*) list2 + n*size; - return; - } - /* - * Avoid running pointers out of bounds; limit n to evens - * for simplicity. - */ - i = 4 + (n & 1); - insertionsort(list1 + (n - i) * size, i, size, cmp TSRMLS_CC); - last = list1 + size * (n - i); - *EVAL(list2 + (last - list1)) = list2 + n * size; - -#ifdef NATURAL - p2 = list2; - f1 = list1; - sense = (cmp(f1, f1 + size TSRMLS_CC) > 0); - for (; f1 < last; sense = !sense) { - length = 2; - /* Find pairs with same sense. */ - for (f2 = f1 + size2; f2 < last; f2 += size2) { - if ((cmp(f2, f2+ size TSRMLS_CC) > 0) != sense) - break; - length += 2; - } - if (length < THRESHOLD) { /* Pairwise merge */ - do { - p2 = *EVAL(p2) = f1 + size2 - list1 + list2; - if (sense > 0) - swap (f1, f1 + size); - } while ((f1 += size2) < f2); - } else { /* Natural merge */ - l2 = f2; - for (f2 = f1 + size2; f2 < l2; f2 += size2) { - if ((cmp(f2-size, f2 TSRMLS_CC) > 0) != sense) { - p2 = *EVAL(p2) = f2 - list1 + list2; - if (sense > 0) - reverse(f1, f2-size); - f1 = f2; - } - } - if (sense > 0) - reverse (f1, f2-size); - f1 = f2; - if (f2 < last || cmp(f2 - size, f2 TSRMLS_CC) > 0) - p2 = *EVAL(p2) = f2 - list1 + list2; - else - p2 = *EVAL(p2) = list2 + n*size; - } - } -#else /* pairwise merge only. */ - for (f1 = list1, p2 = list2; f1 < last; f1 += size2) { - p2 = *EVAL(p2) = p2 + size2; - if (cmp (f1, f1 + size TSRMLS_CC) > 0) - swap(f1, f1 + size); - } -#endif /* NATURAL */ -} -/* }}} */ - -/* {{{ insertionsort - * This is to avoid out-of-bounds addresses in sorting the - * last 4 elements. - */ -static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - u_char *ai, *s, *t, *u, tmp; - int i; - - for (ai = a+size; --n >= 1; ai += size) - for (t = ai; t > a; t -= size) { - u = t - size; - if (cmp(u, t TSRMLS_CC) <= 0) - break; - swap(u, t); - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/main/network.c b/main/network.c deleted file mode 100644 index 1417e2ae0412f..0000000000000 --- a/main/network.c +++ /dev/null @@ -1,1141 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Venaas | - | Streams work by Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/*#define DEBUG_MAIN_NETWORK 1*/ - -#include "php.h" - -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#elif defined(NETWARE) -#include -#include -#else -#include -#endif - -#include -#if HAVE_SYS_SOCKET_H -#include -#endif - -#ifndef _FCNTL_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#if HAVE_SYS_POLL_H -#include -#endif - -#if defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#include -#include -#include -#include -#endif -#elif !defined(PHP_WIN32) -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif - -#ifndef HAVE_INET_ATON -int inet_aton(const char *, struct in_addr *); -#endif - -#include "php_network.h" - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -#undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif - -#include "ext/standard/file.h" - -#ifdef PHP_WIN32 -# include "win32/time.h" -# define SOCK_ERR INVALID_SOCKET -# define SOCK_CONN_ERR SOCKET_ERROR -# define PHP_TIMEOUT_ERROR_VALUE WSAETIMEDOUT -#else -# define SOCK_ERR -1 -# define SOCK_CONN_ERR -1 -# define PHP_TIMEOUT_ERROR_VALUE ETIMEDOUT -#endif - -#if HAVE_GETADDRINFO -#ifdef HAVE_GAI_STRERROR -# define PHP_GAI_STRERROR(x) (gai_strerror(x)) -#else -# define PHP_GAI_STRERROR(x) (php_gai_strerror(x)) -/* {{{ php_gai_strerror - */ -static char *php_gai_strerror(int code) -{ - static struct { - int code; - const char *msg; - } values[] = { -# ifdef EAI_ADDRFAMILY - {EAI_ADDRFAMILY, "Address family for hostname not supported"}, -# endif - {EAI_AGAIN, "Temporary failure in name resolution"}, - {EAI_BADFLAGS, "Bad value for ai_flags"}, - {EAI_FAIL, "Non-recoverable failure in name resolution"}, - {EAI_FAMILY, "ai_family not supported"}, - {EAI_MEMORY, "Memory allocation failure"}, -# ifdef EAI_NODATA - {EAI_NODATA, "No address associated with hostname"}, -# endif - {EAI_NONAME, "Name or service not known"}, - {EAI_SERVICE, "Servname not supported for ai_socktype"}, - {EAI_SOCKTYPE, "ai_socktype not supported"}, - {EAI_SYSTEM, "System error"}, - {0, NULL} - }; - int i; - - for (i = 0; values[i].msg != NULL; i++) { - if (values[i].code == code) { - return (char *)values[i].msg; - } - } - - return "Unknown error"; -} -/* }}} */ -#endif -#endif - -/* {{{ php_network_freeaddresses - */ -static void php_network_freeaddresses(struct sockaddr **sal) -{ - struct sockaddr **sap; - - if (sal == NULL) - return; - for (sap = sal; *sap != NULL; sap++) - efree(*sap); - efree(sal); -} -/* }}} */ - -/* {{{ php_network_getaddresses - * Returns number of addresses, 0 for none/error - */ -static int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, char **error_string TSRMLS_DC) -{ - struct sockaddr **sap; - int n; -#if HAVE_GETADDRINFO - static int ipv6_borked = -1; /* the way this is used *is* thread safe */ - struct addrinfo hints, *res, *sai; -#else - struct hostent *host_info; - struct in_addr in; -#endif - - if (host == NULL) { - return 0; - } -#if HAVE_GETADDRINFO - memset(&hints, '\0', sizeof(hints)); - - hints.ai_family = AF_INET; /* default to regular inet (see below) */ - hints.ai_socktype = socktype; - -# if HAVE_IPV6 - /* probe for a working IPv6 stack; even if detected as having v6 at compile - * time, at runtime some stacks are slow to resolve or have other issues - * if they are not correctly configured. - * static variable use is safe here since simple store or fetch operations - * are atomic and because the actual probe process is not in danger of - * collisions or race conditions. */ - if (ipv6_borked == -1) { - int s; - - s = socket(PF_INET6, SOCK_DGRAM, 0); - if (s == SOCK_ERR) { - ipv6_borked = 1; - } else { - ipv6_borked = 0; - closesocket(s); - } - } - hints.ai_family = ipv6_borked ? AF_INET : AF_UNSPEC; -# endif - - if ((n = getaddrinfo(host, NULL, &hints, &res))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); - return 0; - } else if (res == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)"); - return 0; - } - - sai = res; - for (n = 1; (sai = sai->ai_next) != NULL; n++) - ; - - *sal = safe_emalloc((n + 1), sizeof(*sal), 0); - sai = res; - sap = *sal; - - do { - *sap = emalloc(sai->ai_addrlen); - memcpy(*sap, sai->ai_addr, sai->ai_addrlen); - sap++; - } while ((sai = sai->ai_next) != NULL); - - freeaddrinfo(res); -#else - if (!inet_aton(host, &in)) { - /* XXX NOT THREAD SAFE (is safe under win32) */ - host_info = gethostbyname(host); - if (host_info == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: gethostbyname failed"); - return 0; - } - in = *((struct in_addr *) host_info->h_addr); - } - - *sal = safe_emalloc(2, sizeof(*sal), 0); - sap = *sal; - *sap = emalloc(sizeof(struct sockaddr_in)); - (*sap)->sa_family = AF_INET; - ((struct sockaddr_in *)*sap)->sin_addr = in; - sap++; - n = 1; -#endif - - *sap = NULL; - return n; -} -/* }}} */ - -#ifndef O_NONBLOCK -#define O_NONBLOCK O_NDELAY -#endif - -#if !defined(__BEOS__) -# define HAVE_NON_BLOCKING_CONNECT 1 -# ifdef PHP_WIN32 -typedef u_long php_non_blocking_flags_t; -# define SET_SOCKET_BLOCKING_MODE(sock, save) \ - save = TRUE; ioctlsocket(sock, FIONBIO, &save) -# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \ - ioctlsocket(sock, FIONBIO, &save) -# else -typedef int php_non_blocking_flags_t; -# define SET_SOCKET_BLOCKING_MODE(sock, save) \ - save = fcntl(sock, F_GETFL, 0); \ - fcntl(sock, F_SETFL, save | O_NONBLOCK) -# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \ - fcntl(sock, F_SETFL, save) -# endif -#endif - -/* Connect to a socket using an interruptible connect with optional timeout. - * Optionally, the connect can be made asynchronously, which will implicitly - * enable non-blocking mode on the socket. - * */ -/* {{{ php_network_connect_socket */ -PHPAPI int php_network_connect_socket(php_socket_t sockfd, - const struct sockaddr *addr, - socklen_t addrlen, - int asynchronous, - struct timeval *timeout, - char **error_string, - int *error_code) -{ -#if HAVE_NON_BLOCKING_CONNECT - php_non_blocking_flags_t orig_flags; - int n; - int error = 0; - socklen_t len; - int ret = 0; - - SET_SOCKET_BLOCKING_MODE(sockfd, orig_flags); - - if ((n = connect(sockfd, addr, addrlen)) < 0) { - error = php_socket_errno(); - - if (error_code) { - *error_code = error; - } - - if (error != EINPROGRESS) { - if (error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - } - - return -1; - } - if (asynchronous && error == EINPROGRESS) { - /* this is fine by us */ - return 0; - } - } - - if (n == 0) { - goto ok; - } - - if ((n = php_pollfd_for(sockfd, PHP_POLLREADABLE|POLLOUT, timeout)) == 0) { - error = PHP_TIMEOUT_ERROR_VALUE; - } - - if (n > 0) { - len = sizeof(error); - /* - BSD-derived systems set errno correctly - Solaris returns -1 from getsockopt in case of error - */ - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)&error, &len) < 0) { - ret = -1; - } - } else { - /* whoops: sockfd has disappeared */ - ret = -1; - } - -ok: - if (!asynchronous) { - /* back to blocking mode */ - RESTORE_SOCKET_BLOCKING_MODE(sockfd, orig_flags); - } - - if (error_code) { - *error_code = error; - } - - if (error && error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - ret = -1; - } - return ret; -#else - if (asynchronous) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Asynchronous connect() not supported on this platform"); - } - return connect(sockfd, addr, addrlen); -#endif -} -/* }}} */ - -/* {{{ sub_times */ -static inline void sub_times(struct timeval a, struct timeval b, struct timeval *result) -{ - result->tv_usec = a.tv_usec - b.tv_usec; - if (result->tv_usec < 0L) { - a.tv_sec--; - result->tv_usec += 1000000L; - } - result->tv_sec = a.tv_sec - b.tv_sec; - if (result->tv_sec < 0L) { - result->tv_sec++; - result->tv_usec -= 1000000L; - } -} -/* }}} */ - -/* Bind to a local IP address. - * Returns the bound socket, or -1 on failure. - * */ -/* {{{ php_network_bind_socket_to_local_addr */ -php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port, - int socktype, char **error_string, int *error_code - TSRMLS_DC) -{ - int num_addrs, n, err = 0; - php_socket_t sock; - struct sockaddr **sal, **psal, *sa; - socklen_t socklen; - - num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC); - - if (num_addrs == 0) { - /* could not resolve address(es) */ - return -1; - } - - for (sal = psal; *sal != NULL; sal++) { - sa = *sal; - - /* create a socket for this address */ - sock = socket(sa->sa_family, socktype, 0); - - if (sock == SOCK_ERR) { - continue; - } - - switch (sa->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family; - ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); - socklen = sizeof(struct sockaddr_in6); - break; -#endif - case AF_INET: - ((struct sockaddr_in *)sa)->sin_family = sa->sa_family; - ((struct sockaddr_in *)sa)->sin_port = htons(port); - socklen = sizeof(struct sockaddr_in); - break; - default: - /* Unknown family */ - socklen = 0; - sa = NULL; - } - - if (sa) { - /* attempt to bind */ - -#ifdef SO_REUSEADDR - { - int val = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&val, sizeof(val)); - } -#endif - - n = bind(sock, sa, socklen); - - if (n != SOCK_CONN_ERR) { - goto bound; - } - - err = php_socket_errno(); - } - - close(sock); - } - sock = -1; - - if (error_code) { - *error_code = err; - } - if (error_string) { - *error_string = php_socket_strerror(err, NULL, 0); - } - -bound: - - php_network_freeaddresses(psal); - - return sock; - -} -/* }}} */ - -PHPAPI int php_network_parse_network_address_with_port(const char *addr, long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC) -{ - char *colon; - char *tmp; - int ret = FAILURE; - short port; - struct sockaddr_in *in4 = (struct sockaddr_in*)sa; - struct sockaddr **psal; - int n; - char *errstr = NULL; -#if HAVE_IPV6 - struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa; -#endif - - if (*addr == '[') { - colon = memchr(addr + 1, ']', addrlen-1); - if (!colon || colon[1] != ':') { - return FAILURE; - } - port = atoi(colon + 2); - addr++; - } else { - colon = memchr(addr, ':', addrlen); - if (!colon) { - return FAILURE; - } - port = atoi(colon + 1); - } - - tmp = estrndup(addr, colon - addr); - - /* first, try interpreting the address as a numeric address */ - -#if HAVE_IPV6 && HAVE_INET_PTON - if (inet_pton(AF_INET6, tmp, &in6->sin6_addr) > 0) { - in6->sin6_port = htons(port); - in6->sin6_family = AF_INET6; - *sl = sizeof(struct sockaddr_in6); - ret = SUCCESS; - goto out; - } -#endif - if (inet_aton(tmp, &in4->sin_addr) > 0) { - in4->sin_port = htons(port); - in4->sin_family = AF_INET; - *sl = sizeof(struct sockaddr_in); - ret = SUCCESS; - goto out; - } - - /* looks like we'll need to resolve it */ - n = php_network_getaddresses(tmp, SOCK_DGRAM, &psal, &errstr TSRMLS_CC); - - if (n == 0) { - if (errstr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to resolve `%s': %s", tmp, errstr); - STR_FREE(errstr); - } - goto out; - } - - /* copy the details from the first item */ - switch ((*psal)->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - *in6 = **(struct sockaddr_in6**)psal; - in6->sin6_port = htons(port); - *sl = sizeof(struct sockaddr_in6); - ret = SUCCESS; - break; -#endif - case AF_INET: - *in4 = **(struct sockaddr_in**)psal; - in4->sin_port = htons(port); - *sl = sizeof(struct sockaddr_in); - ret = SUCCESS; - break; - } - - php_network_freeaddresses(psal); - -out: - STR_FREE(tmp); - return ret; -} - - -PHPAPI void php_network_populate_name_from_sockaddr( - /* input address */ - struct sockaddr *sa, socklen_t sl, - /* output readable address */ - char **textaddr, long *textaddrlen, - /* output address */ - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - if (addr) { - *addr = emalloc(sl); - memcpy(*addr, sa, sl); - *addrlen = sl; - } - - if (textaddr) { -#if HAVE_IPV6 && HAVE_INET_NTOP - char abuf[256]; -#endif - char *buf = NULL; - - switch (sa->sa_family) { - case AF_INET: - /* generally not thread safe, but it *is* thread safe under win32 */ - buf = inet_ntoa(((struct sockaddr_in*)sa)->sin_addr); - if (buf) { - *textaddrlen = spprintf(textaddr, 0, "%s:%d", - buf, ntohs(((struct sockaddr_in*)sa)->sin_port)); - } - - break; - -#if HAVE_IPV6 && HAVE_INET_NTOP - case AF_INET6: - buf = (char*)inet_ntop(sa->sa_family, &((struct sockaddr_in6*)sa)->sin6_addr, (char *)&abuf, sizeof(abuf)); - if (buf) { - *textaddrlen = spprintf(textaddr, 0, "%s:%d", - buf, ntohs(((struct sockaddr_in6*)sa)->sin6_port)); - } - - break; -#endif -#ifdef AF_UNIX - case AF_UNIX: - { - struct sockaddr_un *ua = (struct sockaddr_un*)sa; - - if (ua->sun_path[0] == '\0') { - /* abstract name */ - int len = strlen(ua->sun_path + 1) + 1; - *textaddrlen = len; - *textaddr = emalloc(len + 1); - memcpy(*textaddr, ua->sun_path, len); - (*textaddr)[len] = '\0'; - } else { - *textaddrlen = strlen(ua->sun_path); - *textaddr = estrndup(ua->sun_path, *textaddrlen); - } - } - break; -#endif - - } - - } -} - -PHPAPI int php_network_get_peer_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - - if (getpeername(sock, (struct sockaddr*)&sa, &sl) == 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - return 0; - } - return -1; -} - -PHPAPI int php_network_get_sock_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - - if (getsockname(sock, (struct sockaddr*)&sa, &sl) == 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - return 0; - } - return -1; - -} - - -/* Accept a client connection from a server socket, - * using an optional timeout. - * Returns the peer address in addr/addrlen (it will emalloc - * these, so be sure to efree the result). - * If you specify textaddr/textaddrlen, a text-printable - * version of the address will be emalloc'd and returned. - * */ - -/* {{{ php_network_accept_incoming */ -PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen, - struct timeval *timeout, - char **error_string, - int *error_code - TSRMLS_DC) -{ - php_socket_t clisock = -1; - int error = 0, n; - php_sockaddr_storage sa; - socklen_t sl; - - n = php_pollfd_for(srvsock, PHP_POLLREADABLE, timeout); - - if (n == 0) { - error = PHP_TIMEOUT_ERROR_VALUE; - } else if (n == -1) { - error = php_socket_errno(); - } else { - sl = sizeof(sa); - - clisock = accept(srvsock, (struct sockaddr*)&sa, &sl); - - if (clisock >= 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - } else { - error = php_socket_errno(); - } - } - - if (error_code) { - *error_code = error; - } - if (error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - } - - return clisock; -} -/* }}} */ - - - -/* Connect to a remote host using an interruptible connect with optional timeout. - * Optionally, the connect can be made asynchronously, which will implicitly - * enable non-blocking mode on the socket. - * Returns the connected (or connecting) socket, or -1 on failure. - * */ - -/* {{{ php_network_connect_socket_to_host */ -php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, - int socktype, int asynchronous, struct timeval *timeout, char **error_string, - int *error_code, char *bindto, unsigned short bindport - TSRMLS_DC) -{ - int num_addrs, n, fatal = 0; - php_socket_t sock; - struct sockaddr **sal, **psal, *sa; - struct timeval working_timeout; - socklen_t socklen; -#if HAVE_GETTIMEOFDAY - struct timeval limit_time, time_now; -#endif - - num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC); - - if (num_addrs == 0) { - /* could not resolve address(es) */ - return -1; - } - - if (timeout) { - memcpy(&working_timeout, timeout, sizeof(working_timeout)); -#if HAVE_GETTIMEOFDAY - gettimeofday(&limit_time, NULL); - limit_time.tv_sec += working_timeout.tv_sec; - limit_time.tv_usec += working_timeout.tv_usec; - if (limit_time.tv_usec >= 1000000) { - limit_time.tv_usec -= 1000000; - limit_time.tv_sec++; - } -#endif - } - - for (sal = psal; !fatal && *sal != NULL; sal++) { - sa = *sal; - - /* create a socket for this address */ - sock = socket(sa->sa_family, socktype, 0); - - if (sock == SOCK_ERR) { - continue; - } - - switch (sa->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family; - ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); - socklen = sizeof(struct sockaddr_in6); - break; -#endif - case AF_INET: - ((struct sockaddr_in *)sa)->sin_family = sa->sa_family; - ((struct sockaddr_in *)sa)->sin_port = htons(port); - socklen = sizeof(struct sockaddr_in); - break; - default: - /* Unknown family */ - socklen = 0; - sa = NULL; - } - - if (sa) { - /* make a connection attempt */ - - if (bindto) { - struct sockaddr local_address; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *in4 = (struct sockaddr_in*)&local_address; - - in4->sin_family = sa->sa_family; - in4->sin_port = htons(bindport); - if (!inet_aton(bindto, &in4->sin_addr)) { - goto bad_ip; - } - memset(&(in4->sin_zero), 0, sizeof(in4->sin_zero)); - } -#if HAVE_IPV6 && HAVE_INET_PTON - else { /* IPV6 */ - struct sockaddr_in6 *in6 = (struct sockaddr_in6*)&local_address; - - in6->sin6_family = sa->sa_family; - in6->sin6_port = htons(bindport); - if (inet_pton(AF_INET6, bindto, &in6->sin6_addr) < 1) { - goto bad_ip; - } - } -#endif - if (bind(sock, &local_address, sizeof(struct sockaddr))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno)); - } - goto bind_done; -bad_ip: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto); - } -bind_done: - /* free error string recieved during previous iteration (if any) */ - if (error_string && *error_string) { - efree(*error_string); - *error_string = NULL; - } - - n = php_network_connect_socket(sock, sa, socklen, asynchronous, - timeout ? &working_timeout : NULL, - error_string, error_code); - - if (n != SOCK_CONN_ERR) { - goto connected; - } - - /* adjust timeout for next attempt */ -#if HAVE_GETTIMEOFDAY - if (timeout) { - gettimeofday(&time_now, NULL); - - if (timercmp(&time_now, &limit_time, >=)) { - /* time limit expired; don't attempt any further connections */ - fatal = 1; - } else { - /* work out remaining time */ - sub_times(limit_time, time_now, &working_timeout); - } - } -#else - if (error_code && *error_code == PHP_TIMEOUT_ERROR_VALUE) { - /* Don't even bother trying to connect to the next alternative; - * we have no way to determine how long we have already taken - * and it is quite likely that the next attempt will fail too. */ - fatal = 1; - } else { - /* re-use the same initial timeout. - * Not the best thing, but in practice it should be good-enough */ - if (timeout) { - memcpy(&working_timeout, timeout, sizeof(working_timeout)); - } - } -#endif - } - - close(sock); - } - sock = -1; - -connected: - - php_network_freeaddresses(psal); - - return sock; -} -/* }}} */ - -/* {{{ php_any_addr - * Fills the any (wildcard) address into php_sockaddr_storage - */ -PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port) -{ - memset(addr, 0, sizeof(php_sockaddr_storage)); - switch (family) { -#if HAVE_IPV6 - case AF_INET6: { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; - sin6->sin6_family = AF_INET6; - sin6->sin6_port = htons(port); - sin6->sin6_addr = in6addr_any; - break; - } -#endif - case AF_INET: { - struct sockaddr_in *sin = (struct sockaddr_in *) addr; - sin->sin_family = AF_INET; - sin->sin_port = htons(port); - sin->sin_addr.s_addr = htonl(INADDR_ANY); - break; - } - } -} -/* }}} */ - -/* {{{ php_sockaddr_size - * Returns the size of struct sockaddr_xx for the family - */ -PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr) -{ - switch (((struct sockaddr *)addr)->sa_family) { - case AF_INET: - return sizeof(struct sockaddr_in); -#if HAVE_IPV6 - case AF_INET6: - return sizeof(struct sockaddr_in6); -#endif -#ifdef AF_UNIX - case AF_UNIX: - return sizeof(struct sockaddr_un); -#endif - default: - return 0; - } -} -/* }}} */ - -/* Given a socket error code, if buf == NULL: - * emallocs storage for the error message and returns - * else - * sprintf message into provided buffer and returns buf - */ -/* {{{ php_socket_strerror */ -PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize) -{ -#ifndef PHP_WIN32 - char *errstr; - - errstr = strerror(err); - if (buf == NULL) { - buf = estrdup(errstr); - } else { - strncpy(buf, errstr, bufsize); - } - return buf; -#else - char *sysbuf; - int free_it = 1; - - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&sysbuf, - 0, - NULL)) { - free_it = 0; - sysbuf = "Unknown Error"; - } - - if (buf == NULL) { - buf = estrdup(sysbuf); - } else { - strncpy(buf, sysbuf, bufsize); - } - - if (free_it) { - LocalFree(sysbuf); - } - - return buf; -#endif -} -/* }}} */ - -/* deprecated */ -PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_netstream_data_t *sock; - - sock = pemalloc(sizeof(php_netstream_data_t), persistent_id ? 1 : 0); - memset(sock, 0, sizeof(php_netstream_data_t)); - - sock->is_blocked = 1; - sock->timeout.tv_sec = FG(default_socket_timeout); - sock->timeout.tv_usec = 0; - sock->socket = socket; - - stream = php_stream_alloc_rel(&php_stream_generic_socket_ops, sock, persistent_id, "r+"); - stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING; - - if (stream == NULL) - pefree(sock, persistent_id ? 1 : 0); - - return stream; -} - -PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, - int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - char *res; - long reslen; - php_stream *stream; - - reslen = spprintf(&res, 0, "tcp://%s:%d", host, port); - - stream = php_stream_xport_create(res, reslen, ENFORCE_SAFE_MODE | REPORT_ERRORS, - STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, persistent_id, timeout, NULL, NULL, NULL); - - efree(res); - - return stream; -} - -PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC) -{ - int ret = SUCCESS; - int flags; - int myflag = 0; - -#ifdef PHP_WIN32 - /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */ - flags = !block; - if (ioctlsocket(socketd, FIONBIO, &flags)==SOCKET_ERROR){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", WSAGetLastError()); - ret = FALSE; - } -#else - flags = fcntl(socketd, F_GETFL); -#ifdef O_NONBLOCK - myflag = O_NONBLOCK; /* POSIX version */ -#elif defined(O_NDELAY) - myflag = O_NDELAY; /* old non-POSIX version */ -#endif - if (!block) { - flags |= myflag; - } else { - flags &= ~myflag; - } - fcntl(socketd, F_SETFL, flags); -#endif - return ret; -} - -PHPAPI void _php_emit_fd_setsize_warning(int max_fd) -{ - TSRMLS_FETCH(); - -#ifdef PHP_WIN32 - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "PHP needs to be recompiled with a larger value of FD_SETSIZE.\n" - "If this binary is from an official www.php.net package, file a bug report\n" - "at http://bugs.php.net, including the following information:\n" - "FD_SETSIZE=%d, but you are using %d.\n" - " --enable-fd-setsize=%d is recommended, but you may want to set it\n" - "to match to maximum number of sockets each script will work with at\n" - "one time, in order to avoid seeing this error again at a later date.", - FD_SETSIZE, max_fd, (max_fd + 128) & ~127); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "You MUST recompile PHP with a larger value of FD_SETSIZE.\n" - "It is set to %d, but you have descriptors numbered at least as high as %d.\n" - " --enable-fd-setsize=%d is recommended, but you may want to set it\n" - "to equal the maximum number of open files supported by your system,\n" - "in order to avoid seeing this error again at a later date.", - FD_SETSIZE, max_fd, (max_fd + 1024) & ~1023); -#endif -} - -#if defined(PHP_USE_POLL_2_EMULATION) - -/* emulate poll(2) using select(2), safely. */ - -PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout) -{ - fd_set rset, wset, eset; - php_socket_t max_fd = SOCK_ERR; - unsigned int i, n; - struct timeval tv; - - /* check the highest numbered descriptor */ - for (i = 0; i < nfds; i++) { - if (ufds[i].fd > max_fd) - max_fd = ufds[i].fd; - } - - PHP_SAFE_MAX_FD(max_fd, nfds + 1); - - FD_ZERO(&rset); - FD_ZERO(&wset); - FD_ZERO(&eset); - - for (i = 0; i < nfds; i++) { - if (ufds[i].events & PHP_POLLREADABLE) { - PHP_SAFE_FD_SET(ufds[i].fd, &rset); - } - if (ufds[i].events & POLLOUT) { - PHP_SAFE_FD_SET(ufds[i].fd, &wset); - } - if (ufds[i].events & POLLPRI) { - PHP_SAFE_FD_SET(ufds[i].fd, &eset); - } - } - - if (timeout >= 0) { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000; - } - n = select(max_fd + 1, &rset, &wset, &eset, timeout >= 0 ? &tv : NULL); - - if (n >= 0) { - for (i = 0; i < nfds; i++) { - ufds[i].revents = 0; - - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &rset)) { - /* could be POLLERR or POLLHUP but can't tell without probing */ - ufds[i].revents |= POLLIN; - } - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &wset)) { - ufds[i].revents |= POLLOUT; - } - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &eset)) { - ufds[i].revents |= POLLPRI; - } - } - } - return n; -} - -#endif - - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 8 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/output.c b/main/output.c deleted file mode 100644 index ed986233a2b95..0000000000000 --- a/main/output.c +++ /dev/null @@ -1,1142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - | Thies C. Arntzen | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/head.h" -#include "ext/standard/basic_functions.h" -#include "ext/standard/url_scanner_ex.h" -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) -#include "ext/zlib/php_zlib.h" -#endif -#include "SAPI.h" - -#define OB_DEFAULT_HANDLER_NAME "default output handler" - -/* output functions */ -static int php_b_body_write(const char *str, uint str_length TSRMLS_DC); - -static int php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC); -static void php_ob_append(const char *text, uint text_length TSRMLS_DC); -#if 0 -static void php_ob_prepend(const char *text, uint text_length); -#endif - -#ifdef ZTS -int output_globals_id; -#else -php_output_globals output_globals; -#endif - -/* {{{ php_default_output_func */ -PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC) -{ - fwrite(str, 1, str_len, stderr); - return str_len; -} -/* }}} */ - -/* {{{ php_output_init_globals */ -static void php_output_init_globals(php_output_globals *output_globals_p TSRMLS_DC) -{ - OG(php_body_write) = php_default_output_func; - OG(php_header_write) = php_default_output_func; - OG(implicit_flush) = 0; - OG(output_start_filename) = NULL; - OG(output_start_lineno) = 0; -} -/* }}} */ - - -/* {{{ php_output_startup - Start output layer */ -PHPAPI void php_output_startup(void) -{ -#ifdef ZTS - ts_allocate_id(&output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL); -#else - php_output_init_globals(&output_globals TSRMLS_CC); -#endif -} -/* }}} */ - - -/* {{{ php_output_activate - Initilize output global for activation */ -PHPAPI void php_output_activate(TSRMLS_D) -{ - OG(php_body_write) = php_ub_body_write; - OG(php_header_write) = sapi_module.ub_write; - OG(ob_nesting_level) = 0; - OG(ob_lock) = 0; - OG(disable_output) = 0; - OG(output_start_filename) = NULL; - OG(output_start_lineno) = 0; -} -/* }}} */ - - -/* {{{ php_output_set_status - Toggle output status. Do NOT use in application code, only in SAPIs where appropriate. */ -PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC) -{ - OG(disable_output) = !status; -} -/* }}} */ - -/* {{{ php_output_register_constants */ -void php_output_register_constants(TSRMLS_D) -{ - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); -} -/* }}} */ - - -/* {{{ php_body_wirte - * Write body part */ -PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC) -{ - return OG(php_body_write)(str, str_length TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_header_wirte - * Write HTTP header */ -PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC) -{ - if (OG(disable_output)) { - return 0; - } else { - return OG(php_header_write)(str, str_length TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_start_ob_buffer - * Start output buffering */ -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - uint initial_size, block_size; - - if (OG(ob_lock)) { - if (SG(headers_sent) && !SG(request_info).headers_only) { - OG(php_body_write) = php_ub_body_write_no_header; - } else { - OG(php_body_write) = php_ub_body_write; - } - OG(ob_nesting_level) = 0; - php_error_docref("ref.outcontrol" TSRMLS_CC, E_ERROR, "Cannot use output buffering in output buffering display handlers"); - return FAILURE; - } - if (chunk_size > 0) { - if (chunk_size==1) { - chunk_size = 4096; - } - initial_size = (chunk_size*3/2); - block_size = chunk_size/2; - } else { - initial_size = 40*1024; - block_size = 10*1024; - } - return php_ob_init(initial_size, block_size, output_handler, chunk_size, erase TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_start_ob_buffer_named - * Start output buffering */ -PHPAPI int php_start_ob_buffer_named(const char *output_handler_name, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - zval *output_handler; - int result; - - ALLOC_INIT_ZVAL(output_handler); - Z_STRLEN_P(output_handler) = strlen(output_handler_name); /* this can be optimized */ - Z_STRVAL_P(output_handler) = estrndup(output_handler_name, Z_STRLEN_P(output_handler)); - Z_TYPE_P(output_handler) = IS_STRING; - result = php_start_ob_buffer(output_handler, chunk_size, erase TSRMLS_CC); - zval_dtor(output_handler); - FREE_ZVAL(output_handler); - return result; -} -/* }}} */ - -/* {{{ php_end_ob_buffer - * End output buffering (one level) */ -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC) -{ - char *final_buffer=NULL; - unsigned int final_buffer_length=0; - zval *alternate_buffer=NULL; - char *to_be_destroyed_buffer, *to_be_destroyed_handler_name; - char *to_be_destroyed_handled_output[2] = { 0, 0 }; - int status; - php_ob_buffer *prev_ob_buffer_p=NULL; - php_ob_buffer orig_ob_buffer; - - if (OG(ob_nesting_level)==0) { - return; - } - status = 0; - if (!OG(active_ob_buffer).status & PHP_OUTPUT_HANDLER_START) { - /* our first call */ - status |= PHP_OUTPUT_HANDLER_START; - } - if (just_flush) { - status |= PHP_OUTPUT_HANDLER_CONT; - } else { - status |= PHP_OUTPUT_HANDLER_END; - } - -#if 0 - { - FILE *fp; - fp = fopen("/tmp/ob_log", "a"); - fprintf(fp, "NestLevel: %d ObStatus: %d HandlerName: %s\n", OG(ob_nesting_level), status, OG(active_ob_buffer).handler_name); - fclose(fp); - } -#endif - - if (OG(active_ob_buffer).internal_output_handler) { - final_buffer = OG(active_ob_buffer).internal_output_handler_buffer; - final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size; - OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status TSRMLS_CC); - } else if (OG(active_ob_buffer).output_handler) { - zval **params[2]; - zval *orig_buffer; - zval *z_status; - - ALLOC_INIT_ZVAL(orig_buffer); - ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1); - orig_buffer->refcount=2; /* don't let call_user_function() destroy our buffer */ - orig_buffer->is_ref=1; - - ALLOC_INIT_ZVAL(z_status); - ZVAL_LONG(z_status, status); - - params[0] = &orig_buffer; - params[1] = &z_status; - OG(ob_lock) = 1; - - if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) { - if (alternate_buffer && !(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) { - convert_to_string_ex(&alternate_buffer); - final_buffer = Z_STRVAL_P(alternate_buffer); - final_buffer_length = Z_STRLEN_P(alternate_buffer); - } - } - OG(ob_lock) = 0; - if (!just_flush) { - zval_ptr_dtor(&OG(active_ob_buffer).output_handler); - } - orig_buffer->refcount -=2; - if (orig_buffer->refcount <= 0) { /* free the zval */ - zval_dtor(orig_buffer); - FREE_ZVAL(orig_buffer); - } - zval_ptr_dtor(&z_status); - } - - if (!final_buffer) { - final_buffer = OG(active_ob_buffer).buffer; - final_buffer_length = OG(active_ob_buffer).text_length; - } - - if (OG(ob_nesting_level)==1) { /* end buffering */ - if (SG(headers_sent) && !SG(request_info).headers_only) { - OG(php_body_write) = php_ub_body_write_no_header; - } else { - OG(php_body_write) = php_ub_body_write; - } - } - - to_be_destroyed_buffer = OG(active_ob_buffer).buffer; - to_be_destroyed_handler_name = OG(active_ob_buffer).handler_name; - if (OG(active_ob_buffer).internal_output_handler - && (final_buffer != OG(active_ob_buffer).internal_output_handler_buffer) - && (final_buffer != OG(active_ob_buffer).buffer)) { - to_be_destroyed_handled_output[0] = final_buffer; - } - - if (!just_flush) { - if (OG(active_ob_buffer).internal_output_handler) { - to_be_destroyed_handled_output[1] = OG(active_ob_buffer).internal_output_handler_buffer; - } - } - if (OG(ob_nesting_level)>1) { /* restore previous buffer */ - zend_stack_top(&OG(ob_buffers), (void **) &prev_ob_buffer_p); - orig_ob_buffer = OG(active_ob_buffer); - OG(active_ob_buffer) = *prev_ob_buffer_p; - zend_stack_del_top(&OG(ob_buffers)); - if (!just_flush && OG(ob_nesting_level)==2) { /* destroy the stack */ - zend_stack_destroy(&OG(ob_buffers)); - } - } - OG(ob_nesting_level)--; - - if (send_buffer) { - if (just_flush) { /* if flush is called prior to proper end, ensure presence of NUL */ - final_buffer[final_buffer_length] = '\0'; - } - OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC); - } - - if (just_flush) { /* we restored the previous ob, return to the current */ - if (prev_ob_buffer_p) { - zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer)); - OG(active_ob_buffer) = orig_ob_buffer; - } - OG(ob_nesting_level)++; - } - - if (alternate_buffer) { - zval_ptr_dtor(&alternate_buffer); - } - - if (status & PHP_OUTPUT_HANDLER_END) { - efree(to_be_destroyed_handler_name); - } - if (!just_flush) { - efree(to_be_destroyed_buffer); - } else { - OG(active_ob_buffer).text_length = 0; - OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START; - OG(php_body_write) = php_b_body_write; - } - if (to_be_destroyed_handled_output[0]) { - efree(to_be_destroyed_handled_output[0]); - } - if (to_be_destroyed_handled_output[1]) { - efree(to_be_destroyed_handled_output[1]); - } -} -/* }}} */ - -/* {{{ php_end_ob_buffers - * End output buffering (all buffers) */ -PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC) -{ - while (OG(ob_nesting_level)!=0) { - php_end_ob_buffer(send_buffer, 0 TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_start_implicit_flush - */ -PHPAPI void php_start_implicit_flush(TSRMLS_D) -{ - OG(implicit_flush)=1; -} -/* }}} */ - -/* {{{ php_end_implicit_flush - */ -PHPAPI void php_end_implicit_flush(TSRMLS_D) -{ - OG(implicit_flush)=0; -} -/* }}} */ - -/* {{{ php_ob_set_internal_handler - */ -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size, char *handler_name, zend_bool erase TSRMLS_DC) -{ - if (OG(ob_nesting_level)==0 || OG(active_ob_buffer).internal_output_handler || strcmp(OG(active_ob_buffer).handler_name, OB_DEFAULT_HANDLER_NAME)) { - php_start_ob_buffer(NULL, buffer_size, erase TSRMLS_CC); - } - - OG(active_ob_buffer).internal_output_handler = internal_output_handler; - OG(active_ob_buffer).internal_output_handler_buffer = (char *) emalloc(buffer_size); - OG(active_ob_buffer).internal_output_handler_buffer_size = buffer_size; - if (OG(active_ob_buffer).handler_name) { - efree(OG(active_ob_buffer).handler_name); - } - OG(active_ob_buffer).handler_name = estrdup(handler_name); - OG(active_ob_buffer).erase = erase; -} -/* }}} */ - -/* - * Output buffering - implementation - */ - -/* {{{ php_ob_allocate - */ -static inline void php_ob_allocate(uint text_length TSRMLS_DC) -{ - uint new_len = OG(active_ob_buffer).text_length + text_length; - - if (OG(active_ob_buffer).size < new_len) { - uint buf_size = OG(active_ob_buffer).size; - while (buf_size <= new_len) { - buf_size += OG(active_ob_buffer).block_size; - } - - OG(active_ob_buffer).buffer = (char *) erealloc(OG(active_ob_buffer).buffer, buf_size+1); - OG(active_ob_buffer).size = buf_size; - } - OG(active_ob_buffer).text_length = new_len; -} -/* }}} */ - -/* {{{ php_ob_init_conflict - * Returns 1 if handler_set is already used and generates error message - */ -PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC) -{ - if (php_ob_handler_used(handler_set TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler '%s' conflicts with '%s'", handler_new, handler_set); - return 1; - } - return 0; -} -/* }}} */ - -/* {{{ php_ob_init_named - */ -static int php_ob_init_named(uint initial_size, uint block_size, zend_uchar type, char *handler_name, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - int handler_len; - - if (output_handler && !zend_is_callable(output_handler, 0, NULL)) { - return FAILURE; - } - if (type == IS_UNICODE) { - handler_len = u_strlen(handler_name); - } else { - handler_len = strlen(handler_name); - } - if (OG(ob_nesting_level)>0) { -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) - if ((handler_len == sizeof("ob_gzhandler")-1) && - (ZEND_U_EQUAL(type, handler_name, handler_len, "ob_gzhandler", sizeof("ob_gzhandler"))) && - php_ob_gzhandler_check(TSRMLS_C)) { - return FAILURE; - } -#endif - if (OG(ob_nesting_level)==1) { /* initialize stack */ - zend_stack_init(&OG(ob_buffers)); - } - zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer)); - } - OG(ob_nesting_level)++; - OG(active_ob_buffer).block_size = block_size; - OG(active_ob_buffer).size = initial_size; - OG(active_ob_buffer).buffer = (char *) emalloc(initial_size+1); - OG(active_ob_buffer).text_length = 0; - OG(active_ob_buffer).output_handler = output_handler; - OG(active_ob_buffer).chunk_size = chunk_size; - OG(active_ob_buffer).status = 0; - OG(active_ob_buffer).internal_output_handler = NULL; - if (type == IS_UNICODE) { - OG(active_ob_buffer).handler_name = eustrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME); - } else { - OG(active_ob_buffer).handler_name = estrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME); - } - OG(active_ob_buffer).erase = erase; - OG(php_body_write) = php_b_body_write; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ob_handler_from_string - * Create zval output handler from string - */ -static zval* php_ob_handler_from_string(const char *handler_name, int len TSRMLS_DC) -{ - zval *output_handler; - - ALLOC_INIT_ZVAL(output_handler); - Z_STRLEN_P(output_handler) = len; - Z_STRVAL_P(output_handler) = estrndup(handler_name, len); - Z_TYPE_P(output_handler) = IS_STRING; - return output_handler; -} -/* }}} */ - -/* {{{ php_ob_handler_from_unicode - * Create zval output handler from unicode - */ -static zval* php_ob_handler_from_unicode(const UChar *handler_name, int len TSRMLS_DC) -{ - zval *output_handler; - - ALLOC_INIT_ZVAL(output_handler); - Z_USTRLEN_P(output_handler) = len; - Z_USTRVAL_P(output_handler) = eustrndup(handler_name, len); - Z_TYPE_P(output_handler) = IS_UNICODE; - return output_handler; -} -/* }}} */ - -/* {{{ php_ob_init - */ -static int php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - int result = FAILURE, handler_len, len; - HashPosition pos; - zval **tmp; - zval *handler_zval; - - if (output_handler && output_handler->type == IS_STRING) { - char* next_handler_name; - char* handler_name = Z_STRVAL_P(output_handler); - handler_len = Z_STRLEN_P(output_handler); - - result = SUCCESS; - if (handler_len && handler_name[0] != '\0') { - while ((next_handler_name=strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = estrndup(handler_name, len); - handler_zval = php_ob_handler_from_string(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - handler_name += len+1; - handler_len -= len+1; - efree(next_handler_name); - } - } - if (result == SUCCESS) { - handler_zval = php_ob_handler_from_string(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_STRING, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - } - } else if (output_handler && output_handler->type == IS_UNICODE) { - UChar* next_handler_name; - UChar* handler_name = Z_USTRVAL_P(output_handler); - handler_len = Z_USTRLEN_P(output_handler); - - result = SUCCESS; - if (handler_len && handler_name[0] != 0) { - while ((next_handler_name=u_strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = eustrndup(handler_name, len); - handler_zval = php_ob_handler_from_unicode(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - handler_name += len+1; - handler_len -= len+1; - efree(next_handler_name); - } - } - if (result == SUCCESS) { - handler_zval = php_ob_handler_from_unicode(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, IS_UNICODE, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - } - } else if (output_handler && output_handler->type == IS_ARRAY) { - zval handler_name; - - /* do we have array(object,method) */ - if (zend_is_callable(output_handler, 0, &handler_name)) { - SEPARATE_ZVAL(&output_handler); - output_handler->refcount++; - result = php_ob_init_named(initial_size, block_size, Z_TYPE(handler_name), Z_UNIVAL(handler_name), output_handler, chunk_size, erase TSRMLS_CC); - zval_dtor(&handler_name); - } else { - zval_dtor(&handler_name); - /* init all array elements recursively */ - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(output_handler), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(output_handler), (void **)&tmp, &pos) == SUCCESS) { - result = php_ob_init(initial_size, block_size, *tmp, chunk_size, erase TSRMLS_CC); - if (result == FAILURE) { - break; - } - zend_hash_move_forward_ex(Z_ARRVAL_P(output_handler), &pos); - } - } - } else if (output_handler && output_handler->type == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class %v to use as output handler", Z_OBJCE_P(output_handler)->name); - result = FAILURE; - } else { - result = php_ob_init_named(initial_size, block_size, IS_STRING, OB_DEFAULT_HANDLER_NAME, NULL, chunk_size, erase TSRMLS_CC); - } - return result; -} -/* }}} */ - -/* {{{ php_ob_list_each - */ -static int php_ob_list_each(php_ob_buffer *ob_buffer, zval *ob_handler_array) -{ - add_next_index_string(ob_handler_array, ob_buffer->handler_name, 1); - return 0; -} -/* }}} */ - -/* {{{ proto false|array ob_list_handlers() - * List all output_buffers in an array - */ -PHP_FUNCTION(ob_list_handlers) -{ - if (ZEND_NUM_ARGS()!=0) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - if (OG(ob_nesting_level)) { - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_ob_list_each, return_value); - } - php_ob_list_each(&OG(active_ob_buffer), return_value); - } -} -/* }}} */ - -/* {{{ php_ob_used_each - * Sets handler_name to NULL is found - */ -static int php_ob_handler_used_each(php_ob_buffer *ob_buffer, char **handler_name) -{ - if (!strcmp(ob_buffer->handler_name, *handler_name)) { - *handler_name = NULL; - return 1; - } - return 0; -} -/* }}} */ - -/* {{{ php_ob_used - * returns 1 if given handler_name is used as output_handler - */ -PHPAPI int php_ob_handler_used(char *handler_name TSRMLS_DC) -{ - char *tmp = handler_name; - - if (OG(ob_nesting_level)) { - if (!strcmp(OG(active_ob_buffer).handler_name, handler_name)) { - return 1; - } - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_ob_handler_used_each, &tmp); - } - } - return tmp ? 0 : 1; -} -/* }}} */ - -/* {{{ php_ob_append - */ -static inline void php_ob_append(const char *text, uint text_length TSRMLS_DC) -{ - char *target; - int original_ob_text_length; - - original_ob_text_length=OG(active_ob_buffer).text_length; - - php_ob_allocate(text_length TSRMLS_CC); - target = OG(active_ob_buffer).buffer+original_ob_text_length; - memcpy(target, text, text_length); - target[text_length]=0; - - /* If implicit_flush is On or chunked buffering, send contents to next buffer and return. */ - if (OG(active_ob_buffer).chunk_size - && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) { - zval *output_handler = OG(active_ob_buffer).output_handler; - - if (output_handler) { - output_handler->refcount++; - } - php_end_ob_buffer(1, 1 TSRMLS_CC); - return; - } -} -/* }}} */ - -#if 0 -static inline void php_ob_prepend(const char *text, uint text_length) -{ - char *p, *start; - TSRMLS_FETCH(); - - php_ob_allocate(text_length TSRMLS_CC); - - /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */ - p = OG(ob_buffer)+OG(ob_text_length); - start = OG(ob_buffer); - - while (--p>=start) { - p[text_length] = *p; - } - memcpy(OG(ob_buffer), text, text_length); - OG(ob_buffer)[OG(active_ob_buffer).text_length]=0; -} -#endif - - -/* {{{ php_ob_get_buffer - * Return the current output buffer */ -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC) -{ - if (OG(ob_nesting_level)==0) { - return FAILURE; - } - ZVAL_STRINGL(p, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ob_get_length - * Return the size of the current output buffer */ -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC) -{ - if (OG(ob_nesting_level) == 0) { - return FAILURE; - } - ZVAL_LONG(p, OG(active_ob_buffer).text_length); - return SUCCESS; -} -/* }}} */ - -/* - * Wrapper functions - implementation - */ - - -/* buffered output function */ -static int php_b_body_write(const char *str, uint str_length TSRMLS_DC) -{ - php_ob_append(str, str_length TSRMLS_CC); - return str_length; -} - -/* {{{ php_ub_body_write_no_header - */ -PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC) -{ - int result; - - if (OG(disable_output)) { - return 0; - } - - result = OG(php_header_write)(str, str_length TSRMLS_CC); - - if (OG(implicit_flush)) { - sapi_flush(TSRMLS_C); - } - - return result; -} -/* }}} */ - -/* {{{ php_ub_body_write - */ -PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC) -{ - int result = 0; - - if (SG(request_info).headers_only) { - if(SG(headers_sent)) { - return 0; - } - php_header(TSRMLS_C); - zend_bailout(); - } - if (php_header(TSRMLS_C)) { - if (zend_is_compiling(TSRMLS_C)) { - OG(output_start_filename) = zend_get_compiled_filename(TSRMLS_C); - OG(output_start_lineno) = zend_get_compiled_lineno(TSRMLS_C); - } else if (zend_is_executing(TSRMLS_C)) { - OG(output_start_filename) = zend_get_executed_filename(TSRMLS_C); - OG(output_start_lineno) = zend_get_executed_lineno(TSRMLS_C); - } - - OG(php_body_write) = php_ub_body_write_no_header; - result = php_ub_body_write_no_header(str, str_length TSRMLS_CC); - } - - return result; -} -/* }}} */ - -/* - * HEAD support - */ - -/* {{{ proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) - Turn on Output Buffering (specifying an optional output handler). */ -PHP_FUNCTION(ob_start) -{ - zval *output_handler=NULL; - long chunk_size=0; - zend_bool erase=1; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "|zlb", &output_handler, &chunk_size, &erase) == FAILURE) { - RETURN_FALSE; - } - - if (chunk_size < 0) - chunk_size = 0; - - if (php_start_ob_buffer(output_handler, chunk_size, erase TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_flush(void) - Flush (send) contents of the output buffer. The last buffer content is sent to next buffer */ -PHP_FUNCTION(ob_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer. No buffer to flush."); - RETURN_FALSE; - } - - php_end_ob_buffer(1, 1 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool ob_clean(void) - Clean (delete) the current output buffer */ -PHP_FUNCTION(ob_clean) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - - if (!OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(0, 1 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_end_flush(void) - Flush (send) the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_end_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(1, 0 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_end_clean(void) - Clean the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_end_clean) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(0, 0 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_get_flush(void) - Get current buffer contents, flush (send) the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_get_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - /* get contents */ - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - /* error checks */ - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - /* flush */ - php_end_ob_buffer(1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto bool ob_get_clean(void) - Get current buffer contents and delete current output buffer */ -PHP_FUNCTION(ob_get_clean) -{ - if (ZEND_NUM_ARGS() != 0) - ZEND_WRONG_PARAM_COUNT(); - - /* get contents */ - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - /* error checks */ - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - /* delete buffer */ - php_end_ob_buffer(0, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string ob_get_contents(void) - Return the contents of the output buffer */ -PHP_FUNCTION(ob_get_contents) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int ob_get_level(void) - Return the nesting level of the output buffer */ -PHP_FUNCTION(ob_get_level) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - RETURN_LONG (OG(ob_nesting_level)); -} -/* }}} */ - -/* {{{ proto int ob_get_length(void) - Return the length of the output buffer */ -PHP_FUNCTION(ob_get_length) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (php_ob_get_length(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) */ -static int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) -{ - zval *elem; - - MAKE_STD_ZVAL(elem); - array_init(elem); - - add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size); - if (!ob_buffer->chunk_size) { - add_assoc_long(elem, "size", ob_buffer->size); - add_assoc_long(elem, "block_size", ob_buffer->block_size); - } - if (ob_buffer->internal_output_handler) { - add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_INTERNAL); - add_assoc_long(elem, "buffer_size", ob_buffer->internal_output_handler_buffer_size); - } - else { - add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_USER); - } - add_assoc_long(elem, "status", ob_buffer->status); - add_assoc_string(elem, "name", ob_buffer->handler_name, 1); - add_assoc_bool(elem, "del", ob_buffer->erase); - add_next_index_zval(result, elem); - - return SUCCESS; -} -/* }}} */ - - -/* {{{ proto false|array ob_get_status([bool full_status]) - Return the status of the active or all output buffers */ -PHP_FUNCTION(ob_get_status) -{ - int argc = ZEND_NUM_ARGS(); - zend_bool full_status = 0; - - if (zend_parse_parameters(argc TSRMLS_CC, "|b", &full_status) == FAILURE ) - RETURN_FALSE; - - array_init(return_value); - - if (full_status) { - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *elem, void *))php_ob_buffer_status, return_value); - } - if (OG(ob_nesting_level)>0 && php_ob_buffer_status(&OG(active_ob_buffer), return_value)==FAILURE) { - RETURN_FALSE; - } - } else if (OG(ob_nesting_level)>0) { - add_assoc_long(return_value, "level", OG(ob_nesting_level)); - if (OG(active_ob_buffer).internal_output_handler) { - add_assoc_long(return_value, "type", PHP_OUTPUT_HANDLER_INTERNAL); - } else { - add_assoc_long(return_value, "type", PHP_OUTPUT_HANDLER_USER); - } - add_assoc_long(return_value, "status", OG(active_ob_buffer).status); - add_assoc_string(return_value, "name", OG(active_ob_buffer).handler_name, 1); - add_assoc_bool(return_value, "del", OG(active_ob_buffer).erase); - } -} -/* }}} */ - - -/* {{{ proto void ob_implicit_flush([int flag]) - Turn implicit flush on/off and is equivalent to calling flush() after every output call */ -PHP_FUNCTION(ob_implicit_flush) -{ - zval **zv_flag; - int flag; - - switch(ZEND_NUM_ARGS()) { - case 0: - flag = 1; - break; - case 1: - if (zend_get_parameters_ex(1, &zv_flag)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zv_flag); - flag = Z_LVAL_PP(zv_flag); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - if (flag) { - php_start_implicit_flush(TSRMLS_C); - } else { - php_end_implicit_flush(TSRMLS_C); - } -} -/* }}} */ - - -/* {{{ char *php_get_output_start_filename(TSRMLS_D) - Return filename start output something */ -PHPAPI char *php_get_output_start_filename(TSRMLS_D) -{ - return OG(output_start_filename); -} -/* }}} */ - - -/* {{{ char *php_get_output_start_lineno(TSRMLS_D) - Return line number start output something */ -PHPAPI int php_get_output_start_lineno(TSRMLS_D) -{ - return OG(output_start_lineno); -} -/* }}} */ - - -/* {{{ proto bool output_reset_rewrite_vars(void) - Reset(clear) URL rewriter values */ -PHP_FUNCTION(output_reset_rewrite_vars) -{ - if (php_url_scanner_reset_vars(TSRMLS_C) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool output_add_rewrite_var(string name, string value) - Add URL rewriter values */ -PHP_FUNCTION(output_add_rewrite_var) -{ - char *name, *value; - int name_len, value_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) { - RETURN_FALSE; - } - - if (php_url_scanner_add_var(name, name_len, value, value_len, 1 TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php.h b/main/php.h deleted file mode 100644 index 1ad05e46ce8f1..0000000000000 --- a/main/php.h +++ /dev/null @@ -1,451 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_H -#define PHP_H - -#ifdef HAVE_DMALLOC -#include -#endif - -#define PHP_API_VERSION 20050809 -#define PHP_HAVE_STREAMS -#define YYDEBUG 0 - -#include "php_version.h" -#include "zend.h" -#include "zend_qsort.h" -#include "php_compat.h" - -#include "zend_API.h" - -#undef sprintf -#define sprintf php_sprintf - -/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */ -#undef PHP_DEBUG -#define PHP_DEBUG ZEND_DEBUG - -#ifdef PHP_WIN32 -#include "tsrm_win32.h" -#include "win95nt.h" -# ifdef PHP_EXPORTS -# define PHPAPI __declspec(dllexport) -# else -# define PHPAPI __declspec(dllimport) -# endif -#define PHP_DIR_SEPARATOR '\\' -#define PHP_EOL "\r\n" -#else -#define PHPAPI -#define THREAD_LS -#define PHP_DIR_SEPARATOR '/' -#if defined(__MacOSX__) -#define PHP_EOL "\r" -#else -#define PHP_EOL "\n" -#endif -#endif - -#ifdef NETWARE -/* For php_get_uname() function */ -#define PHP_UNAME "NetWare" -#define PHP_OS PHP_UNAME -#endif - -#include "php_regex.h" - -#if HAVE_ASSERT_H -#if PHP_DEBUG -#undef NDEBUG -#else -#ifndef NDEBUG -#define NDEBUG -#endif -#endif -#include -#else /* HAVE_ASSERT_H */ -#define assert(expr) ((void) (0)) -#endif /* HAVE_ASSERT_H */ - -#define APACHE 0 - -#if HAVE_UNIX_H -#include -#endif - -#if HAVE_ALLOCA_H -#include -#endif - -#if HAVE_BUILD_DEFS_H -#include -#endif - -/* - * This is a fast version of strlcpy which should be used, if you - * know the size of the destination buffer and if you know - * the length of the source string. - * - * size is the allocated number of bytes of dst - * src_size is the number of bytes excluding the NUL of src - */ - -#define PHP_STRLCPY(dst, src, size, src_size) \ - { \ - size_t php_str_len; \ - \ - if (src_size >= size) \ - php_str_len = size - 1; \ - else \ - php_str_len = src_size; \ - memcpy(dst, src, php_str_len); \ - dst[php_str_len] = '\0'; \ - } - -#ifndef HAVE_STRLCPY -BEGIN_EXTERN_C() -PHPAPI size_t php_strlcpy(char *dst, const char *src, size_t siz); -END_EXTERN_C() -#undef strlcpy -#define strlcpy php_strlcpy -#endif - -#ifndef HAVE_STRLCAT -BEGIN_EXTERN_C() -PHPAPI size_t php_strlcat(char *dst, const char *src, size_t siz); -END_EXTERN_C() -#undef strlcat -#define strlcat php_strlcat -#endif - -#ifndef HAVE_STRTOK_R -BEGIN_EXTERN_C() -char *strtok_r(char *s, const char *delim, char **last); -END_EXTERN_C() -#endif - -#ifndef HAVE_SOCKLEN_T -typedef unsigned int socklen_t; -#endif - -#define CREATE_MUTEX(a, b) -#define SET_MUTEX(a) -#define FREE_MUTEX(a) - -/* - * Then the ODBC support can use both iodbc and Solid, - * uncomment this. - * #define HAVE_ODBC (HAVE_IODBC|HAVE_SOLID) - */ - -#include -#include -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_STDARG_H -#include -#else -# if HAVE_SYS_VARARGS_H -# include -# endif -#endif - - -#include "zend_hash.h" -#include "php3_compat.h" -#include "zend_alloc.h" -#include "zend_stack.h" - -#if STDC_HEADERS -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy((s), (d), (n)) -# endif -# ifndef HAVE_MEMMOVE -# define memmove(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#include "safe_mode.h" - -#ifndef HAVE_STRERROR -char *strerror(int); -#endif - -#if (REGEX == 1 || REGEX == 0) && !defined(NO_REGEX_EXTRA_H) -#include "regex/regex_extra.h" -#endif - -#if HAVE_PWD_H -# ifdef PHP_WIN32 -#include "win32/pwd.h" -#include "win32/param.h" -# else -#include -#include -# endif -#endif - -#if HAVE_LIMITS_H -#include -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) -#endif - -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif - -#ifndef INT_MIN -#define INT_MIN (- INT_MAX - 1) -#endif - -#define PHP_GCC_VERSION ZEND_GCC_VERSION -#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC -#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT - -BEGIN_EXTERN_C() -#include "snprintf.h" -END_EXTERN_C() -#include "spprintf.h" - -#define EXEC_INPUT_BUF 4096 - -#define PHP_MIME_TYPE "application/x-httpd-php" - -/* macros */ -#define STR_PRINT(str) ((str)?(str):"") - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */ -# endif -#endif - - -/* global variables */ -#if !defined(PHP_WIN32) -#define PHP_SLEEP_NON_VOID -#define php_sleep sleep -extern char **environ; -#endif /* !defined(PHP_WIN32) */ - -#ifdef PHP_PWRITE_64 -ssize_t pwrite(int, void *, size_t, off64_t); -#endif - -#ifdef PHP_PREAD_64 -ssize_t pread(int, void *, size_t, off64_t); -#endif - -BEGIN_EXTERN_C() -void phperror(char *error); -PHPAPI int php_write(void *buf, uint size TSRMLS_DC); -PHPAPI int php_printf(const char *format, ...); -PHPAPI void php_log_err(char *log_message TSRMLS_DC); -int Debug(char *format, ...); -int cfgparse(void); -END_EXTERN_C() - -#define php_error zend_error - -typedef enum { - EH_NORMAL = 0, - EH_SUPPRESS, - EH_THROW -} error_handling_t; - -BEGIN_EXTERN_C() -PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC); -#define php_std_error_handling() php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) - -PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC); - -#ifdef ZTS -#define PHP_ATTR_FMT_OFFSET 1 -#else -#define PHP_ATTR_FMT_OFFSET 0 -#endif - -/* PHPAPI void php_error(int type, const char *format, ...); */ -PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...); -PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...); -PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...); -END_EXTERN_C() - -#define php_error_docref php_error_docref0 - -#define zenderror phperror -#define zendlex phplex - -#define phpparse zendparse -#define phprestart zendrestart -#define phpin zendin - -#define php_memnstr zend_memnstr - -/* functions */ -BEGIN_EXTERN_C() -int php_register_internal_extensions(TSRMLS_D); - -int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); - -PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata); - -PHPAPI int cfg_get_long(char *varname, long *result); -PHPAPI int cfg_get_double(char *varname, double *result); -PHPAPI int cfg_get_string(char *varname, char **result); -END_EXTERN_C() - -/* PHP-named Zend macro wrappers */ -#define PHP_FN ZEND_FN -#define PHP_NAMED_FUNCTION ZEND_NAMED_FUNCTION -#define PHP_FUNCTION ZEND_FUNCTION -#define PHP_METHOD ZEND_METHOD - -#define PHP_NAMED_FE ZEND_NAMED_FE -#define PHP_FE ZEND_FE -#define PHP_FALIAS ZEND_FALIAS -#define PHP_ME ZEND_ME -#define PHP_MALIAS ZEND_MALIAS -#define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME -#define PHP_ME_MAPPING ZEND_ME_MAPPING - -#define PHP_MODULE_STARTUP_N ZEND_MODULE_STARTUP_N -#define PHP_MODULE_SHUTDOWN_N ZEND_MODULE_SHUTDOWN_N -#define PHP_MODULE_ACTIVATE_N ZEND_MODULE_ACTIVATE_N -#define PHP_MODULE_DEACTIVATE_N ZEND_MODULE_DEACTIVATE_N -#define PHP_MODULE_INFO_N ZEND_MODULE_INFO_N - -#define PHP_MODULE_STARTUP_D ZEND_MODULE_STARTUP_D -#define PHP_MODULE_SHUTDOWN_D ZEND_MODULE_SHUTDOWN_D -#define PHP_MODULE_ACTIVATE_D ZEND_MODULE_ACTIVATE_D -#define PHP_MODULE_DEACTIVATE_D ZEND_MODULE_DEACTIVATE_D -#define PHP_MODULE_INFO_D ZEND_MODULE_INFO_D - -/* Compatibility macros */ -#define PHP_MINIT ZEND_MODULE_STARTUP_N -#define PHP_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N -#define PHP_RINIT ZEND_MODULE_ACTIVATE_N -#define PHP_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N -#define PHP_MINFO ZEND_MODULE_INFO_N - -#define PHP_MINIT_FUNCTION ZEND_MODULE_STARTUP_D -#define PHP_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D -#define PHP_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D -#define PHP_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D -#define PHP_MINFO_FUNCTION ZEND_MODULE_INFO_D - - -/* Output support */ -#include "main/php_output.h" -#define PHPWRITE(str, str_len) php_body_write((str), (str_len) TSRMLS_CC) -#define PUTS(str) do { \ - const char *__str = (str); \ - php_body_write(__str, strlen(__str) TSRMLS_CC); \ -} while (0) - -#define PUTC(c) (php_body_write(&(c), 1 TSRMLS_CC), (c)) -#define PHPWRITE_H(str, str_len) php_header_write((str), (str_len) TSRMLS_CC) -#define PUTS_H(str) do { \ - const char *__str = (str); \ - php_header_write(__str, strlen(__str) TSRMLS_CC); \ -} while (0) - -#define PUTC_H(c) (php_header_write(&(c), 1 TSRMLS_CC), (c)) - -#ifdef ZTS -#define VIRTUAL_DIR -#endif - -#include "php_streams.h" -#include "php_memory_streams.h" -#include "fopen_wrappers.h" - - -/* Virtual current working directory support */ -#include "tsrm_virtual_cwd.h" - -#include "zend_constants.h" - -/* connection status states */ -#define PHP_CONNECTION_NORMAL 0 -#define PHP_CONNECTION_ABORTED 1 -#define PHP_CONNECTION_TIMEOUT 2 - -#include "php_reentrancy.h" - -/* Finding offsets of elements within structures. - * Taken from the Apache code, which in turn, was taken from X code... - */ - -#ifndef XtOffset -#if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -#ifdef __STDC__ -#define XtOffset(p_type, field) _Offsetof(p_type, field) -#else -#ifdef CRAY2 -#define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -#else /* !CRAY2 */ - -#define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ - -#define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -#endif /* !CRAY */ -#endif /* ! XtOffset */ - -#ifndef XtOffsetOf -#ifdef offsetof -#define XtOffsetOf(s_type, field) offsetof(s_type, field) -#else -#define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -#endif -#endif /* !XtOffsetOf */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php3_compat.h b/main/php3_compat.h deleted file mode 100644 index 43f03672fbb66..0000000000000 --- a/main/php3_compat.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP3_COMPAT_H -#define PHP3_COMPAT_H - -typedef zval pval; - -#define pval_copy_constructor zval_copy_ctor -#define pval_destructor zval_dtor - -#define _php3_hash_init zend_hash_init -#define _php3_hash_destroy zend_hash_destroy - -#define _php3_hash_clean zend_hash_clean - -#define _php3_hash_add_or_update zend_hash_add_or_update -#define _php3_hash_add zend_hash_add -#define _php3_hash_update zend_hash_update - -#define _php3_hash_quick_add_or_update zend_hash_quick_add_or_update -#define _php3_hash_quick_add zend_hash_quick_add -#define _php3_hash_quick_update zend_hash_quick_update - -#define _php3_hash_index_update_or_next_insert zend_hash_index_update_or_next_insert -#define _php3_hash_index_update zend_hash_index_update -#define _php3_hash_next_index_insert zend_hash_next_index_insert - -#define _php3_hash_pointer_update zend_hash_pointer_update - -#define _php3_hash_pointer_index_update_or_next_insert zend_hash_pointer_index_update_or_next_insert -#define _php3_hash_pointer_index_update zend_hash_pointer_index_update -#define _php3_hash_next_index_pointer_update zend_hash_next_index_pointer_update -#define _php3_hash_next_index_pointer_insert zend_hash_next_index_pointer_insert - -#define _php3_hash_del_key_or_index zend_hash_del_key_or_index -#define _php3_hash_del zend_hash_del -#define _php3_hash_index_del zend_hash_index_del - -#define _php3_hash_find zend_hash_find -#define _php3_hash_quick_find zend_hash_quick_find -#define _php3_hash_index_find zend_hash_index_find - -#define _php3_hash_exists zend_hash_exists -#define _php3_hash_index_exists zend_hash_index_exists -#define _php3_hash_is_pointer zend_hash_is_pointer -#define _php3_hash_index_is_pointer zend_hash_index_is_pointer -#define _php3_hash_next_free_element zend_hash_next_free_element - -#define _php3_hash_move_forward zend_hash_move_forward -#define _php3_hash_move_backwards zend_hash_move_backwards -#define _php3_hash_get_current_key zend_hash_get_current_key -#define _php3_hash_get_current_data zend_hash_get_current_data -#define _php3_hash_internal_pointer_reset zend_hash_internal_pointer_reset -#define _php3_hash_internal_pointer_end zend_hash_internal_pointer_end - -#define _php3_hash_copy zend_hash_copy -#define _php3_hash_merge zend_hash_merge -#define _php3_hash_sort zend_hash_sort -#define _php3_hash_minmax zend_hash_minmax - -#define _php3_hash_num_elements zend_hash_num_elements - -#define _php3_hash_apply zend_hash_apply -#define _php3_hash_apply_with_argument zend_hash_apply_with_argument - - -#define php3_error php_error - -#define php3_printf php_printf -#define _php3_sprintf php_sprintf - - - -#define php3_module_entry zend_module_entry - -#define php3_strndup zend_strndup -#define php3_str_tolower zend_str_tolower -#define php3_binary_strcmp zend_binary_strcmp - - -#define php3_list_insert zend_list_insert -#define php3_list_find zend_list_find -#define php3_list_delete zend_list_delete - -#define php3_plist_insert zend_plist_insert -#define php3_plist_find zend_plist_find -#define php3_plist_delete zend_plist_delete - -#define zend_print_pval zend_print_zval -#define zend_print_pval_r zend_print_zval_r - - -#define function_entry zend_function_entry - -#define _php3_addslashes php_addslashes -#define _php3_stripslashes php_stripslashes -#define php3_dl php_dl - -#define getParameters zend_get_parameters -#define getParametersArray zend_get_parameters_array - -#define list_entry zend_rsrc_list_entry - -#endif /* PHP3_COMPAT_H */ diff --git a/main/php_compat.h b/main/php_compat.h deleted file mode 100644 index e116f617ae2d3..0000000000000 --- a/main/php_compat.h +++ /dev/null @@ -1,339 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_COMPAT_H -#define PHP_COMPAT_H - -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -#if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) -#define pcre_compile php_pcre_compile -#define pcre_copy_substring php_pcre_copy_substring -#define pcre_exec php_pcre_exec -#define pcre_get_substring php_pcre_substring -#define pcre_get_substring_list php_pcre_get_substring_list -#define pcre_info php_pcre_info -#define pcre_maketables php_pcre_maketables -#define pcre_study php_pcre_study -#define pcre_version php_pcre_version -#define pcre_fullinfo php_pcre_fullinfo -#endif - -#define lookup php_lookup -#define hashTableInit php_hashTableInit -#define hashTableDestroy php_hashTableDestroy -#define hashTableIterInit php_hashTableIterInit -#define hashTableIterNext php_hashTableIterNext - -#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) -#define XML_DefaultCurrent php_XML_DefaultCurrent -#define XML_ErrorString php_XML_ErrorString -#define XML_ExpatVersion php_XML_ExpatVersion -#define XML_ExpatVersionInfo php_XML_ExpatVersionInfo -#define XML_ExternalEntityParserCreate php_XML_ExternalEntityParserCreate -#define XML_GetBase php_XML_GetBase -#define XML_GetBuffer php_XML_GetBuffer -#define XML_GetCurrentByteCount php_XML_GetCurrentByteCount -#define XML_GetCurrentByteIndex php_XML_GetCurrentByteIndex -#define XML_GetCurrentColumnNumber php_XML_GetCurrentColumnNumber -#define XML_GetCurrentLineNumber php_XML_GetCurrentLineNumber -#define XML_GetErrorCode php_XML_GetErrorCode -#define XML_GetIdAttributeIndex php_XML_GetIdAttributeIndex -#define XML_GetInputContext php_XML_GetInputContext -#define XML_GetSpecifiedAttributeCount php_XML_GetSpecifiedAttributeCount -#define XmlGetUtf16InternalEncodingNS php_XmlGetUtf16InternalEncodingNS -#define XmlGetUtf16InternalEncoding php_XmlGetUtf16InternalEncoding -#define XmlGetUtf8InternalEncodingNS php_XmlGetUtf8InternalEncodingNS -#define XmlGetUtf8InternalEncoding php_XmlGetUtf8InternalEncoding -#define XmlInitEncoding php_XmlInitEncoding -#define XmlInitEncodingNS php_XmlInitEncodingNS -#define XmlInitUnknownEncoding php_XmlInitUnknownEncoding -#define XmlInitUnknownEncodingNS php_XmlInitUnknownEncodingNS -#define XML_ParseBuffer php_XML_ParseBuffer -#define XML_Parse php_XML_Parse -#define XML_ParserCreate_MM php_XML_ParserCreate_MM -#define XML_ParserCreateNS php_XML_ParserCreateNS -#define XML_ParserCreate php_XML_ParserCreate -#define XML_ParserFree php_XML_ParserFree -#define XmlParseXmlDecl php_XmlParseXmlDecl -#define XmlParseXmlDeclNS php_XmlParseXmlDeclNS -#define XmlPrologStateInitExternalEntity php_XmlPrologStateInitExternalEntity -#define XmlPrologStateInit php_XmlPrologStateInit -#define XML_SetAttlistDeclHandler php_XML_SetAttlistDeclHandler -#define XML_SetBase php_XML_SetBase -#define XML_SetCdataSectionHandler php_XML_SetCdataSectionHandler -#define XML_SetCharacterDataHandler php_XML_SetCharacterDataHandler -#define XML_SetCommentHandler php_XML_SetCommentHandler -#define XML_SetDefaultHandlerExpand php_XML_SetDefaultHandlerExpand -#define XML_SetDefaultHandler php_XML_SetDefaultHandler -#define XML_SetDoctypeDeclHandler php_XML_SetDoctypeDeclHandler -#define XML_SetElementDeclHandler php_XML_SetElementDeclHandler -#define XML_SetElementHandler php_XML_SetElementHandler -#define XML_SetEncoding php_XML_SetEncoding -#define XML_SetEndCdataSectionHandler php_XML_SetEndCdataSectionHandler -#define XML_SetEndDoctypeDeclHandler php_XML_SetEndDoctypeDeclHandler -#define XML_SetEndElementHandler php_XML_SetEndElementHandler -#define XML_SetEndNamespaceDeclHandler php_XML_SetEndNamespaceDeclHandler -#define XML_SetEntityDeclHandler php_XML_SetEntityDeclHandler -#define XML_SetExternalEntityRefHandlerArg php_XML_SetExternalEntityRefHandlerArg -#define XML_SetExternalEntityRefHandler php_XML_SetExternalEntityRefHandler -#define XML_SetNamespaceDeclHandler php_XML_SetNamespaceDeclHandler -#define XML_SetNotationDeclHandler php_XML_SetNotationDeclHandler -#define XML_SetNotStandaloneHandler php_XML_SetNotStandaloneHandler -#define XML_SetParamEntityParsing php_XML_SetParamEntityParsing -#define XML_SetProcessingInstructionHandler php_XML_SetProcessingInstructionHandler -#define XML_SetReturnNSTriplet php_XML_SetReturnNSTriplet -#define XML_SetStartCdataSectionHandler php_XML_SetStartCdataSectionHandler -#define XML_SetStartDoctypeDeclHandler php_XML_SetStartDoctypeDeclHandler -#define XML_SetStartElementHandler php_XML_SetStartElementHandler -#define XML_SetStartNamespaceDeclHandler php_XML_SetStartNamespaceDeclHandler -#define XML_SetUnknownEncodingHandler php_XML_SetUnknownEncodingHandler -#define XML_SetUnparsedEntityDeclHandler php_XML_SetUnparsedEntityDeclHandler -#define XML_SetUserData php_XML_SetUserData -#define XML_SetXmlDeclHandler php_XML_SetXmlDeclHandler -#define XmlSizeOfUnknownEncoding php_XmlSizeOfUnknownEncoding -#define XML_UseParserAsHandlerArg php_XML_UseParserAsHandlerArg -#define XmlUtf16Encode php_XmlUtf16Encode -#define XmlUtf8Encode php_XmlUtf8Encode -#define XML_FreeContentModel php_XML_FreeContentModel -#define XML_MemMalloc php_XML_MemMalloc -#define XML_MemRealloc php_XML_MemRealloc -#define XML_MemFree php_XML_MemFree -#define XML_UseForeignDTD php_XML_UseForeignDTD -#define XML_GetFeatureList php_XML_GetFeatureList -#define XML_ParserReset php_XML_ParserReset - -#ifdef HAVE_GD_BUNDLED -#define any2eucjp php_gd_any2eucjp -#define createwbmp php_gd_createwbmp -#define empty_output_buffer php_gd_empty_output_buffer -#define fill_input_buffer php_gd_fill_input_buffer -#define freewbmp php_gd_freewbmp -#define gdAlphaBlend php_gd_gdAlphaBlend -#define gdCompareInt php_gd_gdCompareInt -#define gdCosT php_gd_gdCosT -#define gdCtxPrintf php_gd_gdCtxPrintf -#define gdDPExtractData php_gd_gdDPExtractData -#define gdFontGetGiant php_gd_gdFontGetGiant -#define gdFontGetLarge php_gd_gdFontGetLarge -#define gdFontGetMediumBold php_gd_gdFontGetMediumBold -#define gdFontGetSmall php_gd_gdFontGetSmall -#define gdFontGetTiny php_gd_gdFontGetTiny -#define gdFontGiant php_gd_gdFontGiant -#define gdFontGiantData php_gd_gdFontGiantData -#define gdFontGiantRep php_gd_gdFontGiantRep -#define gdFontLarge php_gd_gdFontLarge -#define gdFontLargeData php_gd_gdFontLargeData -#define gdFontLargeRep php_gd_gdFontLargeRep -#define gdFontMediumBold php_gd_gdFontMediumBold -#define gdFontMediumBoldData php_gd_gdFontMediumBoldData -#define gdFontMediumBoldRep php_gd_gdFontMediumBoldRep -#define gdFontSmall php_gd_gdFontSmall -#define gdFontSmallData php_gd_gdFontSmallData -#define gdFontSmallRep php_gd_gdFontSmallRep -#define gdFontTiny php_gd_gdFontTiny -#define gdFontTinyData php_gd_gdFontTinyData -#define gdFontTinyRep php_gd_gdFontTinyRep -#define gdGetBuf php_gd_gdGetBuf -#define gdGetByte php_gd_gdGetByte -#define gdGetC php_gd_gdGetC -#define _gdGetColors php_gd__gdGetColors -#define gd_getin php_gd_gd_getin -#define gdGetInt php_gd_gdGetInt -#define gdGetWord php_gd_gdGetWord -#define gdImageAABlend php_gd_gdImageAABlend -#define gdImageAALine php_gd_gdImageAALine -#define gdImageAlphaBlending php_gd_gdImageAlphaBlending -#define gdImageAntialias php_gd_gdImageAntialias -#define gdImageArc php_gd_gdImageArc -#define gdImageBrightness php_gd_gdImageBrightness -#define gdImageChar php_gd_gdImageChar -#define gdImageCharUp php_gd_gdImageCharUp -#define gdImageColor php_gd_gdImageColor -#define gdImageColorAllocate php_gd_gdImageColorAllocate -#define gdImageColorAllocateAlpha php_gd_gdImageColorAllocateAlpha -#define gdImageColorClosest php_gd_gdImageColorClosest -#define gdImageColorClosestAlpha php_gd_gdImageColorClosestAlpha -#define gdImageColorClosestHWB php_gd_gdImageColorClosestHWB -#define gdImageColorDeallocate php_gd_gdImageColorDeallocate -#define gdImageColorExact php_gd_gdImageColorExact -#define gdImageColorExactAlpha php_gd_gdImageColorExactAlpha -#define gdImageColorMatch php_gd_gdImageColorMatch -#define gdImageColorResolve php_gd_gdImageColorResolve -#define gdImageColorResolveAlpha php_gd_gdImageColorResolveAlpha -#define gdImageColorTransparent php_gd_gdImageColorTransparent -#define gdImageCompare php_gd_gdImageCompare -#define gdImageContrast php_gd_gdImageContrast -#define gdImageConvolution php_gd_gdImageConvolution -#define gdImageCopy php_gd_gdImageCopy -#define gdImageCopyMerge php_gd_gdImageCopyMerge -#define gdImageCopyMergeGray php_gd_gdImageCopyMergeGray -#define gdImageCopyResampled php_gd_gdImageCopyResampled -#define gdImageCopyResized php_gd_gdImageCopyResized -#define gdImageCreate php_gd_gdImageCreate -#define gdImageCreateFromGd php_gd_gdImageCreateFromGd -#define gdImageCreateFromGd2 php_gd_gdImageCreateFromGd2 -#define gdImageCreateFromGd2Ctx php_gd_gdImageCreateFromGd2Ctx -#define gdImageCreateFromGd2Part php_gd_gdImageCreateFromGd2Part -#define gdImageCreateFromGd2PartCtx php_gd_gdImageCreateFromGd2PartCtx -#define gdImageCreateFromGd2PartPtr php_gd_gdImageCreateFromGd2PartPtr -#define gdImageCreateFromGd2Ptr php_gd_gdImageCreateFromGd2Ptr -#define gdImageCreateFromGdCtx php_gd_gdImageCreateFromGdCtx -#define gdImageCreateFromGdPtr php_gd_gdImageCreateFromGdPtr -#define gdImageCreateFromGif php_gd_gdImageCreateFromGif -#define gdImageCreateFromGifCtx php_gd_gdImageCreateFromGifCtx -#define gdImageCreateFromGifSource php_gd_gdImageCreateFromGifSource -#define gdImageCreateFromJpeg php_gd_gdImageCreateFromJpeg -#define gdImageCreateFromJpegCtx php_gd_gdImageCreateFromJpegCtx -#define gdImageCreateFromJpegPtr php_gd_gdImageCreateFromJpegPtr -#define gdImageCreateFromPng php_gd_gdImageCreateFromPng -#define gdImageCreateFromPngCtx php_gd_gdImageCreateFromPngCtx -#define gdImageCreateFromPngPtr php_gd_gdImageCreateFromPngPtr -#define gdImageCreateFromPngSource php_gd_gdImageCreateFromPngSource -#define gdImageCreateFromWBMP php_gd_gdImageCreateFromWBMP -#define gdImageCreateFromWBMPCtx php_gd_gdImageCreateFromWBMPCtx -#define gdImageCreateFromWBMPPtr php_gd_gdImageCreateFromWBMPPtr -#define gdImageCreateFromXbm php_gd_gdImageCreateFromXbm -#define gdImageCreatePaletteFromTrueColor php_gd_gdImageCreatePaletteFromTrueColor -#define gdImageCreateTrueColor php_gd_gdImageCreateTrueColor -#define gdImageDashedLine php_gd_gdImageDashedLine -#define gdImageDestroy php_gd_gdImageDestroy -#define gdImageEdgeDetectQuick php_gd_gdImageEdgeDetectQuick -#define gdImageEllipse php_gd_gdImageEllipse -#define gdImageEmboss php_gd_gdImageEmboss -#define gdImageFill php_gd_gdImageFill -#define gdImageFilledArc php_gd_gdImageFilledArc -#define gdImageFilledEllipse php_gd_gdImageFilledEllipse -#define gdImageFilledPolygon php_gd_gdImageFilledPolygon -#define gdImageFilledRectangle php_gd_gdImageFilledRectangle -#define _gdImageFillTiled php_gd__gdImageFillTiled -#define gdImageFillToBorder php_gd_gdImageFillToBorder -#define gdImageGaussianBlur php_gd_gdImageGaussianBlur -#define gdImageGd php_gd_gdImageGd -#define gdImageGd2 php_gd_gdImageGd2 -#define gdImageGd2Ptr php_gd_gdImageGd2Ptr -#define gdImageGdPtr php_gd_gdImageGdPtr -#define gdImageGetClip php_gd_gdImageGetClip -#define gdImageGetPixel php_gd_gdImageGetPixel -#define gdImageGetTrueColorPixel php_gd_gdImageGetTrueColorPixel -#define gdImageGif php_gd_gdImageGif -#define gdImageGifCtx php_gd_gdImageGifCtx -#define gdImageGifPtr php_gd_gdImageGifPtr -#define gdImageGrayScale php_gd_gdImageGrayScale -#define gdImageInterlace php_gd_gdImageInterlace -#define gdImageJpeg php_gd_gdImageJpeg -#define gdImageJpegCtx php_gd_gdImageJpegCtx -#define gdImageJpegPtr php_gd_gdImageJpegPtr -#define gdImageLine php_gd_gdImageLine -#define gdImageMeanRemoval php_gd_gdImageMeanRemoval -#define gdImageNegate php_gd_gdImageNegate -#define gdImagePaletteCopy php_gd_gdImagePaletteCopy -#define gdImagePng php_gd_gdImagePng -#define gdImagePngCtx php_gd_gdImagePngCtx -#define gdImagePngCtxEx php_gd_gdImagePngCtxEx -#define gdImagePngEx php_gd_gdImagePngEx -#define gdImagePngPtr php_gd_gdImagePngPtr -#define gdImagePngPtrEx php_gd_gdImagePngPtrEx -#define gdImagePngToSink php_gd_gdImagePngToSink -#define gdImagePolygon php_gd_gdImagePolygon -#define gdImageRectangle php_gd_gdImageRectangle -#define gdImageRotate php_gd_gdImageRotate -#define gdImageRotate180 php_gd_gdImageRotate180 -#define gdImageRotate270 php_gd_gdImageRotate270 -#define gdImageRotate45 php_gd_gdImageRotate45 -#define gdImageRotate90 php_gd_gdImageRotate90 -#define gdImageSaveAlpha php_gd_gdImageSaveAlpha -#define gdImageSelectiveBlur php_gd_gdImageSelectiveBlur -#define gdImageSetAntiAliased php_gd_gdImageSetAntiAliased -#define gdImageSetAntiAliasedDontBlend php_gd_gdImageSetAntiAliasedDontBlend -#define gdImageSetBrush php_gd_gdImageSetBrush -#define gdImageSetClip php_gd_gdImageSetClip -#define gdImageSetPixel php_gd_gdImageSetPixel -#define gdImageSetStyle php_gd_gdImageSetStyle -#define gdImageSetThickness php_gd_gdImageSetThickness -#define gdImageSetTile php_gd_gdImageSetTile -#define gdImageSkewX php_gd_gdImageSkewX -#define gdImageSkewY php_gd_gdImageSkewY -#define gdImageSmooth php_gd_gdImageSmooth -#define gdImageString php_gd_gdImageString -#define gdImageString16 php_gd_gdImageString16 -#define gdImageStringFT php_gd_gdImageStringFT -#define gdImageStringFTEx php_gd_gdImageStringFTEx -#define gdImageStringTTF php_gd_gdImageStringTTF -#define gdImageStringUp php_gd_gdImageStringUp -#define gdImageStringUp16 php_gd_gdImageStringUp16 -#define gdImageTrueColorToPalette php_gd_gdImageTrueColorToPalette -#define gdImageWBMP php_gd_gdImageWBMP -#define gdImageWBMPCtx php_gd_gdImageWBMPCtx -#define gdImageWBMPPtr php_gd_gdImageWBMPPtr -#define gdImageXbmCtx php_gd_gdImageXbmCtx -#define gdNewDynamicCtx php_gd_gdNewDynamicCtx -#define gdNewDynamicCtxEx php_gd_gdNewDynamicCtxEx -#define gdNewFileCtx php_gd_gdNewFileCtx -#define gdNewSSCtx php_gd_gdNewSSCtx -#define gdPutBuf php_gd_gdPutBuf -#define gdPutC php_gd_gdPutC -#define _gdPutColors php_gd__gdPutColors -#define gdPutInt php_gd_gdPutInt -#define gd_putout php_gd_gd_putout -#define gdPutWord php_gd_gdPutWord -#define gdSeek php_gd_gdSeek -#define gdSinT php_gd_gdSinT -#define gd_strtok_r php_gd_gd_strtok_r -#define gdTell php_gd_gdTell -#define getmbi php_gd_getmbi -#define init_destination php_gd_init_destination -#define init_source php_gd_init_source -#define jpeg_gdIOCtx_dest php_gd_jpeg_gdIOCtx_dest -#define jpeg_gdIOCtx_src php_gd_jpeg_gdIOCtx_src -#define lsqrt php_gd_lsqrt -#define printwbmp php_gd_printwbmp -#define Putchar php_gd_Putchar -#define putmbi php_gd_putmbi -#define Putword php_gd_Putword -#define readwbmp php_gd_readwbmp -#define skipheader php_gd_skipheader -#define skip_input_data php_gd_skip_input_data -#define term_destination php_gd_term_destination -#define term_source php_gd_term_source -#define writewbmp php_gd_writewbmp -#define ZeroDataBlock php_gd_ZeroDataBlock -#endif /* HAVE_GD_BUNDLED */ - -/* Define to specify how much context to retain around the current parse - point. */ -#define XML_CONTEXT_BYTES 1024 - -/* Define to make parameter entity parsing functionality available. */ -#define XML_DTD 1 - -/* Define to make XML Namespaces functionality available. */ -#define XML_NS 1 -#endif - -#ifdef PHP_EXPORTS -#define PCRE_STATIC -#endif - -#endif diff --git a/main/php_content_types.c b/main/php_content_types.c deleted file mode 100644 index cea6418892c85..0000000000000 --- a/main/php_content_types.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "SAPI.h" -#include "rfc1867.h" - -#include "php_content_types.h" - -/* {{{ php_post_entries[] - */ -static sapi_post_entry php_post_entries[] = { - { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler }, - { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler }, - { NULL, 0, NULL, NULL } -}; -/* }}} */ - -/* {{{ SAPI_POST_READER_FUNC - */ -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) -{ - char *data = NULL; - int length = 0; - - /* $HTTP_RAW_POST_DATA registration */ - if(!strcmp(SG(request_info).request_method, "POST")) { - if(NULL == SG(request_info).post_entry) { - /* no post handler registered, so we just swallow the data */ - sapi_read_standard_form_data(TSRMLS_C); - length = SG(request_info).post_data_length; - data = estrndup(SG(request_info).post_data, length); - } else if(PG(always_populate_raw_post_data) && SG(request_info).post_data) { - length = SG(request_info).post_data_length; - data = estrndup(SG(request_info).post_data, length); - } - if(data) { - SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length); - } - } - - /* for php://input stream: - some post handlers modify the content of request_info.post_data - so for now we need a copy for the php://input stream - in the long run post handlers should be changed to not touch - request_info.post_data for memory preservation reasons - */ - if(SG(request_info).post_data) { - SG(request_info).raw_post_data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SG(request_info).raw_post_data_length = SG(request_info).post_data_length; - } - -} -/* }}} */ - -/* {{{ php_startup_sapi_content_types - */ -int php_startup_sapi_content_types(TSRMLS_D) -{ - sapi_register_default_post_reader(php_default_post_reader); - sapi_register_treat_data(php_default_treat_data); - sapi_register_input_filter(php_default_input_filter); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_setup_sapi_content_types - */ -int php_setup_sapi_content_types(TSRMLS_D) -{ - sapi_register_post_entries(php_post_entries TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_content_types.h b/main/php_content_types.h deleted file mode 100644 index 268001474ebfa..0000000000000 --- a/main/php_content_types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_CONTENT_TYPES_H -#define PHP_CONTENT_TYPES_H - -#define DEFAULT_POST_CONTENT_TYPE "application/x-www-form-urlencoded" - -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); -SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler); -int php_startup_sapi_content_types(TSRMLS_D); -int php_setup_sapi_content_types(TSRMLS_D); - -#endif /* PHP_CONTENT_TYPES_H */ diff --git a/main/php_globals.h b/main/php_globals.h deleted file mode 100644 index 65c6a2f987f2c..0000000000000 --- a/main/php_globals.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GLOBALS_H -#define PHP_GLOBALS_H - -#include "zend_globals.h" - -typedef struct _php_core_globals php_core_globals; - -#ifdef ZTS -# define PG(v) TSRMG(core_globals_id, php_core_globals *, v) -extern PHPAPI int core_globals_id; -#else -# define PG(v) (core_globals.v) -extern ZEND_API struct _php_core_globals core_globals; -#endif - - -#define TRACK_VARS_POST 0 -#define TRACK_VARS_GET 1 -#define TRACK_VARS_COOKIE 2 -#define TRACK_VARS_SERVER 3 -#define TRACK_VARS_ENV 4 -#define TRACK_VARS_FILES 5 -#define TRACK_VARS_REQUEST 6 - -struct _php_tick_function_entry; - -typedef struct _arg_separators { - char *output; - char *input; -} arg_separators; - -struct _php_core_globals { - zend_bool magic_quotes_gpc; - zend_bool magic_quotes_runtime; - zend_bool magic_quotes_sybase; - - zend_bool safe_mode; - - zend_bool allow_call_time_pass_reference; - zend_bool implicit_flush; - - long output_buffering; - - char *safe_mode_include_dir; - zend_bool safe_mode_gid; - zend_bool sql_safe_mode; - zend_bool enable_dl; - - char *output_handler; - - char *unserialize_callback_func; - long serialize_precision; - - char *safe_mode_exec_dir; - - long memory_limit; - long max_input_time; - - zend_bool track_errors; - zend_bool display_errors; - zend_bool display_startup_errors; - zend_bool log_errors; - long log_errors_max_len; - zend_bool ignore_repeated_errors; - zend_bool ignore_repeated_source; - zend_bool report_memleaks; - char *error_log; - - char *doc_root; - char *user_dir; - char *include_path; - char *open_basedir; - char *extension_dir; - - char *upload_tmp_dir; - long upload_max_filesize; - - char *error_append_string; - char *error_prepend_string; - - char *auto_prepend_file; - char *auto_append_file; - - arg_separators arg_separator; - - char *variables_order; - - HashTable rfc1867_protected_variables; - - short connection_status; - short ignore_user_abort; - - unsigned char header_is_being_sent; - - zend_llist tick_functions; - - zval *http_globals[6]; - - zend_bool expose_php; - - zend_bool register_globals; - zend_bool register_long_arrays; - zend_bool register_argc_argv; - zend_bool auto_globals_jit; - - zend_bool y2k_compliance; - - char *docref_root; - char *docref_ext; - - zend_bool html_errors; - zend_bool xmlrpc_errors; - - long xmlrpc_error_number; - - zend_bool activated_auto_globals[8]; - - zend_bool modules_activated; - zend_bool file_uploads; - zend_bool during_request_startup; - zend_bool allow_url_fopen; - zend_bool always_populate_raw_post_data; - zend_bool report_zend_debug; - - char *last_error_message; - char *last_error_file; - int last_error_lineno; - error_handling_t error_handling; - zend_class_entry *exception_class; - - char *disable_functions; - char *disable_classes; -}; - - -#endif /* PHP_GLOBALS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/php_ini.c b/main/php_ini.c deleted file mode 100644 index a720127aa2655..0000000000000 --- a/main/php_ini.c +++ /dev/null @@ -1,633 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/info.h" -#include "zend_ini.h" -#include "php_ini.h" -#include "ext/standard/dl.h" -#include "zend_extensions.h" -#include "zend_highlight.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_scandir.h" -#ifdef PHP_WIN32 -#include "win32/php_registry.h" -#endif - -#if HAVE_SCANDIR && HAVE_ALPHASORT && HAVE_DIRENT_H -#include -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - -typedef struct _php_extension_lists { - zend_llist engine; - zend_llist functions; -} php_extension_lists; - - -/* True globals */ -static HashTable configuration_hash; -PHPAPI char *php_ini_opened_path=NULL; -static php_extension_lists extension_lists; -PHPAPI char *php_ini_scanned_files=NULL; - -/* {{{ php_ini_displayer_cb - */ -static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length, esc_html=0; - TSRMLS_FETCH(); - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value && ini_entry->orig_value[0]) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - esc_html = !sapi_module.phpinfo_as_text; - } else { - if (!sapi_module.phpinfo_as_text) { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } else { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - esc_html = !sapi_module.phpinfo_as_text; - } else { - if (!sapi_module.phpinfo_as_text) { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } else { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } - } - - if (esc_html) { - php_html_puts(display_string, display_string_length TSRMLS_CC); - } else { - PHPWRITE(display_string, display_string_length); - } - } -} -/* }}} */ - -/* {{{ php_ini_displayer - */ -static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) -{ - if (ini_entry->module_number != module_number) { - return 0; - } - if (!sapi_module.phpinfo_as_text) { - PUTS(""); - PUTS(""); - PHPWRITE(ini_entry->name, ini_entry->name_length - 1); - PUTS(""); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); - PUTS(""); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); - PUTS("\n"); - } else { - PHPWRITE(ini_entry->name, ini_entry->name_length - 1); - PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); - PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); - PUTS("\n"); - } - return 0; -} -/* }}} */ - -/* {{{ display_ini_entries - */ -PHPAPI void display_ini_entries(zend_module_entry *module) -{ - int module_number; - TSRMLS_FETCH(); - - if (module) { - module_number = module->module_number; - } else { - module_number = 0; - } - php_info_print_table_start(); - php_info_print_table_header(3, "Directive", "Local Value", "Master Value"); - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (long) module_number TSRMLS_CC); - php_info_print_table_end(); -} -/* }}} */ - -/* php.ini support */ - -#ifdef ZTS -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension_ts" -# endif -#else -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension" -# endif -#endif - -/* {{{ php_config_ini_parser_cb - */ -static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg) -{ - switch (callback_type) { - case ZEND_INI_PARSER_ENTRY: { - zval *entry; - - if (!arg2) { - break; - } - if (!strcasecmp(Z_STRVAL_P(arg1), "extension")) { /* load function module */ - zval copy; - - copy = *arg2; - zval_copy_ctor(©); - copy.refcount = 0; - zend_llist_add_element(&extension_lists.functions, ©); - } else if (!strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */ - char *extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); - - zend_llist_add_element(&extension_lists.engine, &extension_name); - } else { - zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, arg2, sizeof(zval), (void **) &entry); - Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)); - } - } - break; - - case ZEND_INI_PARSER_POP_ENTRY: { - zval *hash; - zval **find_hash; - zval *element; - - if (!arg2) { - /* bare string - nothing to do */ - break; - } - - if (zend_hash_find(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, (void **) &find_hash) == FAILURE) { - ALLOC_ZVAL(hash); - array_init(hash); - - zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &hash, sizeof(zval *), NULL); - } else { - hash = *find_hash; - } - - ALLOC_ZVAL(element); - *element = *arg2; - zval_copy_ctor(element); - INIT_PZVAL(element); - add_next_index_zval(hash, element); - } - break; - - case ZEND_INI_PARSER_SECTION: - break; - } -} -/* }}} */ - -/* {{{ php_load_function_extension_cb - */ -static void php_load_function_extension_cb(void *arg TSRMLS_DC) -{ - zval *extension = (zval *) arg; - zval zval; - - php_dl(extension, MODULE_PERSISTENT, &zval, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_load_zend_extension_cb - */ -static void php_load_zend_extension_cb(void *arg TSRMLS_DC) -{ - zend_load_extension(*((char **) arg)); -} -/* }}} */ - -/* {{{ pvalue_config_destructor - */ -static void pvalue_config_destructor(zval *pvalue) -{ - if (Z_TYPE_P(pvalue) == IS_STRING) { - free(Z_STRVAL_P(pvalue)); - } -} -/* }}} */ - -/* {{{ php_init_config - */ -int php_init_config(TSRMLS_D) -{ - char *php_ini_search_path = NULL; - int safe_mode_state; - char *open_basedir; - int free_ini_search_path = 0; - zend_file_handle fh; - struct stat sb; - char ini_file[MAXPATHLEN]; - char *p; - zend_llist scanned_ini_list; - int l, total_l=0; - zend_llist_element *element; - - if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) { - return FAILURE; - } - - if (sapi_module.ini_defaults) { - sapi_module.ini_defaults(&configuration_hash); - } - - zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1); - zend_llist_init(&extension_lists.functions, sizeof(zval), (llist_dtor_func_t) ZVAL_DESTRUCTOR, 1); - zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1); - - safe_mode_state = PG(safe_mode); - open_basedir = PG(open_basedir); - - if (sapi_module.php_ini_path_override) { - php_ini_search_path = sapi_module.php_ini_path_override; - free_ini_search_path = 0; - } else if (!sapi_module.php_ini_ignore) { - char *default_location; - char *env_location; - char *binary_location; - static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 }; -#ifdef PHP_WIN32 - char *reg_location; -#endif - - env_location = getenv("PHPRC"); - if (!env_location) { - env_location = ""; - } - - /* - * Prepare search path - */ - - php_ini_search_path = (char *) emalloc(MAXPATHLEN * 4 + strlen(env_location) + 3 + 1); - free_ini_search_path = 1; - php_ini_search_path[0] = 0; - -#ifdef PHP_WIN32 - /* Add registry location */ - reg_location = GetIniPathFromRegistry(); - if (reg_location != NULL) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, reg_location); - efree(reg_location); - } -#endif - - /* Add environment location */ - if (env_location[0]) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, env_location); - } - - /* Add cwd (only with CLI) */ - if (strcmp(sapi_module.name, "cli") == 0) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, "."); - } - - /* Add binary directory */ -#ifdef PHP_WIN32 - binary_location = (char *) emalloc(MAXPATHLEN); - if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) { - efree(binary_location); - binary_location = NULL; - } -#else - if (sapi_module.executable_location) { - binary_location = (char *)emalloc(PATH_MAX); - if (!realpath(sapi_module.executable_location, binary_location)) { - efree(binary_location); - binary_location = NULL; - } - } else { - binary_location = NULL; - } -#endif - if (binary_location) { - char *separator_location = strrchr(binary_location, DEFAULT_SLASH); - - if (separator_location && separator_location != binary_location) { - *(separator_location) = 0; - } - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, binary_location); - efree(binary_location); - } - - /* Add default location */ -#ifdef PHP_WIN32 - default_location = (char *) emalloc(MAXPATHLEN + 1); - - if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); - } - efree(default_location); - - { - /* For people running under terminal services, GetWindowsDirectory will - * return their personal Windows directory, so lets add the system - * windows directory too */ - typedef UINT (WINAPI *get_system_windows_directory_func)(char *buffer, UINT size); - static get_system_windows_directory_func get_system_windows_directory = NULL; - HMODULE kern; - - if (get_system_windows_directory == NULL) { - kern = LoadLibrary("kernel32.dll"); - if (kern) { - get_system_windows_directory = (get_system_windows_directory_func)GetProcAddress(kern, "GetSystemWindowsDirectoryA"); - } - } - if (get_system_windows_directory != NULL) { - default_location = (char *) emalloc(MAXPATHLEN + 1); - if (0 < get_system_windows_directory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); - } - efree(default_location); - } - } -#else - default_location = PHP_CONFIG_FILE_PATH; - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); -#endif - } - - PG(safe_mode) = 0; - PG(open_basedir) = NULL; - - memset(&fh, 0, sizeof(fh)); - /* Check if php_ini_path_override is a file */ - if (!sapi_module.php_ini_ignore) { - if (sapi_module.php_ini_path_override && sapi_module.php_ini_path_override[0]) { - struct stat statbuf; - - if (!VCWD_STAT(sapi_module.php_ini_path_override, &statbuf)) { - if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { - fh.handle.fp = VCWD_FOPEN(sapi_module.php_ini_path_override, "r"); - fh.filename = sapi_module.php_ini_path_override; - } - } - } - /* Search php-%sapi-module-name%.ini file in search path */ - if (!fh.handle.fp) { - const char *fmt = "php-%s.ini"; - char *ini_fname = emalloc(strlen(fmt) + strlen(sapi_module.name)); - sprintf(ini_fname, fmt, sapi_module.name); - fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); - efree(ini_fname); - if (fh.handle.fp) { - fh.filename = php_ini_opened_path; - } - } - /* Search php.ini file in search path */ - if (!fh.handle.fp) { - fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); - if (fh.handle.fp) { - fh.filename = php_ini_opened_path; - } - } - } - - if (free_ini_search_path) { - efree(php_ini_search_path); - } - - PG(safe_mode) = safe_mode_state; - PG(open_basedir) = open_basedir; - - if (fh.handle.fp) { - fh.type = ZEND_HANDLE_FP; - - zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists); - - { - zval tmp; - - Z_STRLEN(tmp) = strlen(fh.filename); - Z_STRVAL(tmp) = zend_strndup(fh.filename, Z_STRLEN(tmp)); - Z_TYPE(tmp) = IS_STRING; - zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL); - if (php_ini_opened_path) { - efree(php_ini_opened_path); - } - php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); - } - } - - /* If the config_file_scan_dir is set at compile-time, go and scan this directory and - * parse any .ini files found in this directory. */ - if (!sapi_module.php_ini_ignore && strlen(PHP_CONFIG_FILE_SCAN_DIR)) { - struct dirent **namelist; - int ndir, i; - - if ((ndir = php_scandir(PHP_CONFIG_FILE_SCAN_DIR, &namelist, 0, php_alphasort)) > 0) { - for (i = 0; i < ndir; i++) { - /* check for a .ini extension */ - if (!(p = strrchr(namelist[i]->d_name, '.')) || (p && strcmp(p, ".ini"))) { - free(namelist[i]); - continue; - } - snprintf(ini_file, MAXPATHLEN, "%s%c%s", PHP_CONFIG_FILE_SCAN_DIR, DEFAULT_SLASH, namelist[i]->d_name); - if (VCWD_STAT(ini_file, &sb) == 0) { - if (S_ISREG(sb.st_mode)) { - if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) { - fh.filename = ini_file; - fh.type = ZEND_HANDLE_FP; - zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists); - /* Here, add it to the list of ini files read */ - l = strlen(ini_file); - total_l += l + 2; - p = estrndup(ini_file, l); - zend_llist_add_element(&scanned_ini_list, &p); - } - } - } - free(namelist[i]); - } - free(namelist); - - /* - * Don't need an extra byte for the \0 in this malloc as the last - * element will not get a trailing , which gives us the byte for the \0 - */ - if (total_l) { - php_ini_scanned_files = (char *) malloc(total_l); - *php_ini_scanned_files = '\0'; - for (element = scanned_ini_list.head; element; element = element->next) { - strcat(php_ini_scanned_files, *(char **)element->data); - strcat(php_ini_scanned_files, element->next ? ",\n" : "\n"); - } - } - zend_llist_destroy(&scanned_ini_list); - } - } - return SUCCESS; -} -/* }}} */ - -/* {{{ php_shutdown_config - */ -int php_shutdown_config(void) -{ - zend_hash_destroy(&configuration_hash); - if (php_ini_opened_path) { - free(php_ini_opened_path); - php_ini_opened_path = NULL; - } - if (php_ini_scanned_files) { - free(php_ini_scanned_files); - php_ini_scanned_files = NULL; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ini_register_extensions - */ -void php_ini_register_extensions(TSRMLS_D) -{ - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC); - zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC); - - zend_llist_destroy(&extension_lists.engine); - zend_llist_destroy(&extension_lists.functions); -} -/* }}} */ - -/* {{{ cfg_get_entry - */ -zval *cfg_get_entry(char *name, uint name_length) -{ - zval *tmp; - - if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp) == SUCCESS) { - return tmp; - } else { - return NULL; - } -} -/* }}} */ - -/* {{{ cfg_get_long - */ -PHPAPI int cfg_get_long(char *varname, long *result) -{ - zval *tmp, var; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) { - *result = (long) NULL; - return FAILURE; - } - var = *tmp; - zval_copy_ctor(&var); - convert_to_long(&var); - *result = Z_LVAL(var); - return SUCCESS; -} -/* }}} */ - -/* {{{ cfg_get_double - */ -PHPAPI int cfg_get_double(char *varname, double *result) -{ - zval *tmp, var; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) { - *result = (double) 0; - return FAILURE; - } - var = *tmp; - zval_copy_ctor(&var); - convert_to_double(&var); - *result = Z_DVAL(var); - return SUCCESS; -} -/* }}} */ - -/* {{{ cfg_get_string - */ -PHPAPI int cfg_get_string(char *varname, char **result) -{ - zval *tmp; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp) == FAILURE) { - *result = NULL; - return FAILURE; - } - *result = Z_STRVAL_P(tmp); - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_ini.h b/main/php_ini.h deleted file mode 100644 index ed630d96d1568..0000000000000 --- a/main/php_ini.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_INI_H -#define PHP_INI_H - -#include "zend_ini.h" - -BEGIN_EXTERN_C() -int php_init_config(TSRMLS_D); -int php_shutdown_config(void); -void php_ini_register_extensions(TSRMLS_D); -zval *cfg_get_entry(char *name, uint name_length); -END_EXTERN_C() - -#define PHP_INI_USER ZEND_INI_USER -#define PHP_INI_PERDIR ZEND_INI_PERDIR -#define PHP_INI_SYSTEM ZEND_INI_SYSTEM - -#define PHP_INI_ALL ZEND_INI_ALL - -#define php_ini_entry zend_ini_entry - -#define PHP_INI_MH ZEND_INI_MH -#define PHP_INI_DISP ZEND_INI_DISP - -#define PHP_INI_BEGIN ZEND_INI_BEGIN -#define PHP_INI_END ZEND_INI_END - -#define PHP_INI_ENTRY3_EX ZEND_INI_ENTRY3_EX -#define PHP_INI_ENTRY3 ZEND_INI_ENTRY3 -#define PHP_INI_ENTRY2_EX ZEND_INI_ENTRY2_EX -#define PHP_INI_ENTRY2 ZEND_INI_ENTRY2 -#define PHP_INI_ENTRY1_EX ZEND_INI_ENTRY1_EX -#define PHP_INI_ENTRY1 ZEND_INI_ENTRY1 -#define PHP_INI_ENTRY_EX ZEND_INI_ENTRY_EX -#define PHP_INI_ENTRY ZEND_INI_ENTRY - -#define STD_PHP_INI_ENTRY STD_ZEND_INI_ENTRY -#define STD_PHP_INI_ENTRY_EX STD_ZEND_INI_ENTRY_EX -#define STD_PHP_INI_BOOLEAN STD_ZEND_INI_BOOLEAN - -#define PHP_INI_DISPLAY_ORIG ZEND_INI_DISPLAY_ORIG -#define PHP_INI_DISPLAY_ACTIVE ZEND_INI_DISPLAY_ACTIVE - -#define PHP_INI_STAGE_STARTUP ZEND_INI_STAGE_STARTUP -#define PHP_INI_STAGE_SHUTDOWN ZEND_INI_STAGE_SHUTDOWN -#define PHP_INI_STAGE_ACTIVATE ZEND_INI_STAGE_ACTIVATE -#define PHP_INI_STAGE_DEACTIVATE ZEND_INI_STAGE_DEACTIVATE -#define PHP_INI_STAGE_RUNTIME ZEND_INI_STAGE_RUNTIME - -#define php_ini_boolean_displayer_cb zend_ini_boolean_displayer_cb -#define php_ini_color_displayer_cb zend_ini_color_displayer_cb - -#define php_alter_ini_entry zend_alter_ini_entry - -#define php_ini_long zend_ini_long -#define php_ini_double zend_ini_double -#define php_ini_string zend_ini_string - -#endif /* PHP_INI_H */ diff --git a/main/php_logos.c b/main/php_logos.c deleted file mode 100644 index f470a71fdb90c..0000000000000 --- a/main/php_logos.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "logos.h" -#include "php_logos.h" -#include "ext/standard/info.h" -#include "SAPI.h" - -typedef struct _php_info_logo { - char *mimetype; - int mimelen; - unsigned char *data; - int size; -} php_info_logo; - -HashTable phpinfo_logo_hash; - -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size) -{ - php_info_logo info_logo; - - info_logo.mimetype = mimetype; - info_logo.mimelen = strlen(mimetype); - info_logo.data = data; - info_logo.size = size; - - return zend_hash_add(&phpinfo_logo_hash, logo_string, strlen(logo_string), &info_logo, sizeof(php_info_logo), NULL); -} - -PHPAPI int php_unregister_info_logo(char *logo_string) -{ - return zend_hash_del(&phpinfo_logo_hash, logo_string, strlen(logo_string)); -} - -int php_init_info_logos(void) -{ - if(zend_hash_init(&phpinfo_logo_hash, 0, NULL, NULL, 1)==FAILURE) - return FAILURE; - - php_register_info_logo(PHP_LOGO_GUID , "image/gif", php_logo , sizeof(php_logo)); - php_register_info_logo(PHP_EGG_LOGO_GUID, "image/gif", php_egg_logo, sizeof(php_egg_logo)); - php_register_info_logo(ZEND_LOGO_GUID , "image/gif", zend_logo , sizeof(zend_logo)); - - return SUCCESS; -} - -int php_shutdown_info_logos(void) -{ - zend_hash_destroy(&phpinfo_logo_hash); - return SUCCESS; -} - -#define CONTENT_TYPE_HEADER "Content-Type: " -int php_info_logos(const char *logo_string TSRMLS_DC) -{ - php_info_logo *logo_image; - char *content_header; - int len; - - if(FAILURE==zend_hash_find(&phpinfo_logo_hash, (char *) logo_string, strlen(logo_string), (void **)&logo_image)) - return 0; - - len=strlen(CONTENT_TYPE_HEADER)+logo_image->mimelen; - content_header=malloc(len+1); - if(!content_header) return 0; - strcpy(content_header, CONTENT_TYPE_HEADER); - strcat(content_header, logo_image->mimetype); - sapi_add_header(content_header, len, 1); - free(content_header); - - PHPWRITE(logo_image->data, logo_image->size); - return 1; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_logos.h b/main/php_logos.h deleted file mode 100644 index 3ef671ce26be9..0000000000000 --- a/main/php_logos.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#ifndef _PHP_LOGOS_H -#define _PHP_LOGOS_H - -BEGIN_EXTERN_C() -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size); -PHPAPI int php_unregister_info_logo(char *logo_string); -END_EXTERN_C() - -int php_init_info_logos(void); -int php_shutdown_info_logos(void); -int php_info_logos(const char *logo_string TSRMLS_DC); - -#endif /* _PHP_LOGOS_H */ diff --git a/main/php_main.h b/main/php_main.h deleted file mode 100644 index dbb2207ab1a6f..0000000000000 --- a/main/php_main.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_MAIN_H -#define PHP_MAIN_H - -#include "zend_globals.h" -#include "php_globals.h" -#include "SAPI.h" - -BEGIN_EXTERN_C() -PHPAPI int php_request_startup(TSRMLS_D); -PHPAPI void php_request_shutdown(void *dummy); -PHPAPI void php_request_shutdown_for_exec(void *dummy); -PHPAPI int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules); -PHPAPI void php_module_shutdown(TSRMLS_D); -PHPAPI void php_module_shutdown_for_exec(void); -PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals); -PHPAPI int php_request_startup_for_hook(TSRMLS_D); - -PHPAPI int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC); - -PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC); -PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC); -PHPAPI int php_handle_special_queries(TSRMLS_D); -PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC); - -PHPAPI void php_handle_aborted_connection(void); -PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC); - -PHPAPI void php_html_puts(const char *str, uint siz TSRMLS_DC); - -extern void php_call_shutdown_functions(TSRMLS_D); -extern void php_free_shutdown_functions(TSRMLS_D); - -/* environment module */ -extern int php_init_environ(void); -extern int php_shutdown_environ(void); -END_EXTERN_C() - -#endif diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h deleted file mode 100644 index 250a4d92fcf38..0000000000000 --- a/main/php_memory_streams.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_MEMORY_STREAM_H -#define PHP_MEMORY_STREAM_H - -#include "php_streams.h" - -#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024 - -#define TEMP_STREAM_DEFAULT 0 -#define TEMP_STREAM_READONLY 1 -#define TEMP_STREAM_TAKE_BUFFER 2 - -#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC TSRMLS_CC) -#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC TSRMLS_CC) -#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC TSRMLS_CC) - -#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM) -#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC TSRMLS_CC) -#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC) - -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC); -PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC); -PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC); - -PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC); -PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC); -END_EXTERN_C() - -extern php_stream_ops php_stream_memory_ops; -extern php_stream_ops php_stream_temp_ops; - -#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops -#define PHP_STREAM_IS_TEMP &php_stream_temp_ops - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_network.h b/main/php_network.h deleted file mode 100644 index 9b79c88c4a769..0000000000000 --- a/main/php_network.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Venaas | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _PHP_NETWORK_H -#define _PHP_NETWORK_H - -#ifdef PHP_WIN32 -# ifndef WINNT -# define WINNT 1 -# endif -# undef FD_SETSIZE -# include "arpa/inet.h" - /* Apache folks decided that strtoul was evil and redefined - * it to something that breaks the windows headers */ -# undef strtoul -/* defines socklen_t and some IPV6 stuff */ -# include -# if HAVE_WSPIAPI_H - /* getaddrinfo */ -# include -# endif -#else -# undef closesocket -# define closesocket close -#endif - -#ifndef HAVE_SHUTDOWN -#undef shutdown -#define shutdown(s,n) /* nothing */ -#endif - -#ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEWOULDBLOCK -# define fsync _commit -# define ftruncate(a, b) chsize(a, b) -#endif /* defined(PHP_WIN32) */ - -#ifdef PHP_WIN32 -#define php_socket_errno() WSAGetLastError() -#else -#define php_socket_errno() errno -#endif - -/* like strerror, but caller must efree the returned string, - * unless buf is not NULL. - * Also works sensibly for win32 */ -BEGIN_EXTERN_C() -PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize); -END_EXTERN_C() - -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -/* These are here, rather than with the win32 counterparts above, - * since defines them. */ -#ifndef SHUT_RD -# define SHUT_RD 0 -# define SHUT_WR 1 -# define SHUT_RDWR 2 -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef PHP_WIN32 -typedef SOCKET php_socket_t; -#else -typedef int php_socket_t; -#endif - -#ifdef PHP_WIN32 -# define SOCK_ERR INVALID_SOCKET -# define SOCK_CONN_ERR SOCKET_ERROR -# define SOCK_RECV_ERR SOCKET_ERROR -#else -# define SOCK_ERR -1 -# define SOCK_CONN_ERR -1 -# define SOCK_RECV_ERR -1 -#endif - -/* uncomment this to debug poll(2) emulation on systems that have poll(2) */ -/* #define PHP_USE_POLL_2_EMULATION 1 */ - -#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) -# include -typedef struct pollfd php_pollfd; -#else -typedef struct _php_pollfd { - php_socket_t fd; - short events; - short revents; -} php_pollfd; - -PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout); - -# define POLLIN 0x0001 /* There is data to read */ -# define POLLPRI 0x0002 /* There is urgent data to read */ -# define POLLOUT 0x0004 /* Writing now will not block */ -# define POLLERR 0x0008 /* Error condition */ -# define POLLHUP 0x0010 /* Hung up */ -# define POLLNVAL 0x0020 /* Invalid request: fd not open */ - -# ifndef PHP_USE_POLL_2_EMULATION -# define PHP_USE_POLL_2_EMULATION 1 -# endif -#endif - -#define PHP_POLLREADABLE (POLLIN|POLLERR|POLLHUP) - -#ifndef PHP_USE_POLL_2_EMULATION -# define php_poll2(ufds, nfds, timeout) poll(ufds, nfds, timeout) -#endif - -/* timeval-to-timeout (for poll(2)) */ -static inline int php_tvtoto(struct timeval *timeouttv) -{ - if (timeouttv) { - return (timeouttv->tv_sec * 1000) + (timeouttv->tv_usec / 1000); - } - return -1; -} - -/* hybrid select(2)/poll(2) for a single descriptor. - * timeouttv follows same rules as select(2), but is reduced to millisecond accuracy. - * Returns 0 on timeout, -1 on error, or the event mask (ala poll(2)). - */ -static inline int php_pollfd_for(php_socket_t fd, int events, struct timeval *timeouttv) -{ - php_pollfd p; - int n; - - p.fd = fd; - p.events = events; - p.revents = 0; - - n = php_poll2(&p, 1, php_tvtoto(timeouttv)); - - if (n > 0) { - return p.revents; - } - - return n; -} - -static inline int php_pollfd_for_ms(php_socket_t fd, int events, int timeout) -{ - php_pollfd p; - int n; - - p.fd = fd; - p.events = events; - p.revents = 0; - - n = php_poll2(&p, 1, timeout); - - if (n > 0) { - return p.revents; - } - - return n; -} - -/* emit warning and suggestion for unsafe select(2) usage */ -PHPAPI void _php_emit_fd_setsize_warning(int max_fd); - -#ifdef PHP_WIN32 -/* it is safe to FD_SET too many fd's under win32; the macro will simply ignore - * descriptors that go beyond the default FD_SETSIZE */ -# define PHP_SAFE_FD_SET(fd, set) FD_SET(fd, set) -# define PHP_SAFE_FD_ISSET(fd, set) FD_ISSET(fd, set) -# define PHP_SAFE_MAX_FD(m, n) do { if (n + 1 >= FD_SETSIZE) { _php_emit_fd_setsize_warning(n); }} while(0) -#else -# define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SETSIZE) FD_SET(fd, set); } while(0) -# define PHP_SAFE_FD_ISSET(fd, set) ((fd < FD_SETSIZE) && FD_ISSET(fd, set)) -# define PHP_SAFE_MAX_FD(m, n) do { if (m >= FD_SETSIZE) { _php_emit_fd_setsize_warning(m); m = FD_SETSIZE - 1; }} while(0) -#endif - - -#define PHP_SOCK_CHUNK_SIZE 8192 - -#ifdef HAVE_SOCKADDR_STORAGE -typedef struct sockaddr_storage php_sockaddr_storage; -#else -typedef struct { -#ifdef HAVE_SOCKADDR_SA_LEN - unsigned char ss_len; - unsigned char ss_family; -#else - unsigned short ss_family; -#endif - char info[126]; -} php_sockaddr_storage; -#endif - -BEGIN_EXTERN_C() -PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, - int socktype, int asynchronous, struct timeval *timeout, char **error_string, - int *error_code, char *bindto, unsigned short bindport - TSRMLS_DC); - -PHPAPI int php_network_connect_socket(php_socket_t sockfd, - const struct sockaddr *addr, - socklen_t addrlen, - int asynchronous, - struct timeval *timeout, - char **error_string, - int *error_code); - -#define php_connect_nonb(sock, addr, addrlen, timeout) \ - php_network_connect_socket((sock), (addr), (addrlen), 0, (timeout), NULL, NULL) - -PHPAPI php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port, - int socktype, char **error_string, int *error_code - TSRMLS_DC); - -PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen, - struct timeval *timeout, - char **error_string, - int *error_code - TSRMLS_DC); - -PHPAPI int php_network_get_sock_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI int php_network_get_peer_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port); -PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr); -END_EXTERN_C() - -struct _php_netstream_data_t { - php_socket_t socket; - char is_blocked; - struct timeval timeout; - char timeout_event; - size_t ownsize; -}; -typedef struct _php_netstream_data_t php_netstream_data_t; -PHPAPI extern php_stream_ops php_stream_socket_ops; -extern php_stream_ops php_stream_generic_socket_ops; -#define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops) - -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC ); -/* open a connection to a host using php_hostconnect and return a stream */ -PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, - int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC); -PHPAPI void php_network_populate_name_from_sockaddr( - /* input address */ - struct sockaddr *sa, socklen_t sl, - /* output readable address */ - char **textaddr, long *textaddrlen, - /* output address */ - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI int php_network_parse_network_address_with_port(const char *addr, - long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC); -END_EXTERN_C() - -#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC TSRMLS_CC) -#define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC TSRMLS_CC) - -/* {{{ memory debug */ -#define php_stream_sock_open_from_socket_rel(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_sock_open_host_rel(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_sock_open_unix_rel(path, pathlen, persistent, timeval) _php_stream_sock_open_unix((path), (pathlen), (persistent), (timeval) STREAMS_REL_CC TSRMLS_CC) - -/* }}} */ - -#endif /* _PHP_NETWORK_H */ - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 8 - * End: - */ diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c deleted file mode 100644 index e08a7e54859d7..0000000000000 --- a/main/php_open_temporary_file.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#include -#include -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#include "win32/winutil.h" -#elif defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#endif -#include -#else -#include -#include -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#if !defined(P_tmpdir) -#define P_tmpdir "" -#endif - -/* {{{ php_do_open_temporary_file */ - -/* Loosely based on a tempnam() implementation by UCLA */ - -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - char *trailing_slash; - char *opened_path; - int path_len = 0; - int fd = -1; -#ifndef HAVE_MKSTEMP - int open_flags = O_CREAT | O_TRUNC | O_RDWR -#ifdef PHP_WIN32 - | _O_BINARY -#endif - ; -#endif - - if (!path) { - return -1; - } - - path_len = strlen(path); - - if (!(opened_path = emalloc(MAXPATHLEN))) { - return -1; - } - - if (!path_len || IS_SLASH(path[path_len - 1])) { - trailing_slash = ""; - } else { - trailing_slash = "/"; - } - - (void)snprintf(opened_path, MAXPATHLEN, "%s%s%sXXXXXX", path, trailing_slash, pfx); - -#ifdef PHP_WIN32 - if (GetTempFileName(path, pfx, 0, opened_path)) { - /* Some versions of windows set the temp file to be read-only, - * which means that opening it will fail... */ - VCWD_CHMOD(opened_path, 0600); - fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600); - } -#elif defined(HAVE_MKSTEMP) - fd = mkstemp(opened_path); -#else - if (mktemp(opened_path)) { - fd = VCWD_OPEN(opened_path, open_flags); - } -#endif - if (fd == -1 || !opened_path_p) { - efree(opened_path); - } else { - *opened_path_p = opened_path; - } - return fd; -} -/* }}} */ - -/* - * Determine where to place temporary files. - */ -PHPAPI const char* php_get_temporary_directory(void) -{ - /* Cache the chosen temporary directory. */ - static char* temporary_directory; - - /* Did we determine the temporary directory already? */ - if (temporary_directory) { - return temporary_directory; - } - -#ifdef PHP_WIN32 - /* We can't count on the environment variables TEMP or TMP, - * and so must make the Win32 API call to get the default - * directory for temporary files. Note this call checks - * the environment values TMP and TEMP (in order) first. - */ - { - char sTemp[MAX_PATH]; - DWORD n = GetTempPath(sizeof(sTemp),sTemp); - assert(0 < n); /* should *never* fail! */ - temporary_directory = strdup(sTemp); - return temporary_directory; - } -#else - /* On Unix use the (usual) TMPDIR environment variable. */ - { - char* s = getenv("TMPDIR"); - if (s) { - temporary_directory = strdup(s); - return temporary_directory; - } - } -#ifdef P_tmpdir - /* Use the standard default temporary directory. */ - if (P_tmpdir) { - temporary_directory = P_tmpdir; - return temporary_directory; - } -#endif - /* Shouldn't ever(!) end up here ... last ditch default. */ - temporary_directory = "/tmp"; - return temporary_directory; -#endif -} - -/* {{{ php_open_temporary_file - * - * Unlike tempnam(), the supplied dir argument takes precedence - * over the TMPDIR environment variable - * This function should do its best to return a file pointer to a newly created - * unique file, on every platform. - */ -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - int fd; - - if (!pfx) { - pfx = "tmp."; - } - if (opened_path_p) { - *opened_path_p = NULL; - } - - /* Try the directory given as parameter. */ - fd = php_do_open_temporary_file(dir, pfx, opened_path_p TSRMLS_CC); - if (fd == -1) { - /* Use default temporary directory. */ - fd = php_do_open_temporary_file(php_get_temporary_directory(), pfx, opened_path_p TSRMLS_CC); - } - return fd; -} - -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - FILE *fp; - int fd = php_open_temporary_fd(dir, pfx, opened_path_p TSRMLS_CC); - - if (fd == -1) { - return NULL; - } - - fp = fdopen(fd, "r+b"); - if (fp == NULL) { - close(fd); - } - - return fp; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h deleted file mode 100644 index d96c40615e237..0000000000000 --- a/main/php_open_temporary_file.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_OPEN_TEMPORARY_FILE_H -#define PHP_OPEN_TEMPORARY_FILE_H - -BEGIN_EXTERN_C() -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); -PHPAPI const char *php_get_temporary_directory(void); -END_EXTERN_C() - -#endif /* PHP_OPEN_TEMPORARY_FILE_H */ diff --git a/main/php_output.h b/main/php_output.h deleted file mode 100644 index cdfbe81ddbd2b..0000000000000 --- a/main/php_output.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_OUTPUT_H -#define PHP_OUTPUT_H - -typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); - -BEGIN_EXTERN_C() -PHPAPI void php_output_startup(void); -PHPAPI void php_output_activate(TSRMLS_D); -PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC); -PHPAPI void php_output_register_constants(TSRMLS_D); -PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC); -PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC); -PHPAPI int php_start_ob_buffer_named(const char *output_handler_name, uint chunk_size, zend_bool erase TSRMLS_DC); -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC); -PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC); -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); -PHPAPI void php_start_implicit_flush(TSRMLS_D); -PHPAPI void php_end_implicit_flush(TSRMLS_D); -PHPAPI char *php_get_output_start_filename(TSRMLS_D); -PHPAPI int php_get_output_start_lineno(TSRMLS_D); -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size, char *handler_name, zend_bool erase TSRMLS_DC); -PHPAPI int php_ob_handler_used(char *handler_name TSRMLS_DC); -PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC); -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); -END_EXTERN_C() - -PHP_FUNCTION(ob_start); -PHP_FUNCTION(ob_flush); -PHP_FUNCTION(ob_clean); -PHP_FUNCTION(ob_end_flush); -PHP_FUNCTION(ob_end_clean); -PHP_FUNCTION(ob_get_flush); -PHP_FUNCTION(ob_get_clean); -PHP_FUNCTION(ob_get_contents); -PHP_FUNCTION(ob_get_length); -PHP_FUNCTION(ob_get_level); -PHP_FUNCTION(ob_get_status); -PHP_FUNCTION(ob_implicit_flush); -PHP_FUNCTION(ob_list_handlers); - -typedef struct _php_ob_buffer { - char *buffer; - uint size; - uint text_length; - int block_size; - uint chunk_size; - int status; - zval *output_handler; - php_output_handler_func_t internal_output_handler; - char *internal_output_handler_buffer; - uint internal_output_handler_buffer_size; - char *handler_name; - zend_bool erase; -} php_ob_buffer; - -typedef struct _php_output_globals { - int (*php_body_write)(const char *str, uint str_length TSRMLS_DC); /* string output */ - int (*php_header_write)(const char *str, uint str_length TSRMLS_DC); /* unbuffer string output */ - php_ob_buffer active_ob_buffer; - unsigned char implicit_flush; - char *output_start_filename; - int output_start_lineno; - zend_stack ob_buffers; - int ob_nesting_level; - zend_bool ob_lock; - zend_bool disable_output; -} php_output_globals; - -#ifdef ZTS -#define OG(v) TSRMG(output_globals_id, php_output_globals *, v) -ZEND_API extern int output_globals_id; -#else -#define OG(v) (output_globals.v) -ZEND_API extern php_output_globals output_globals; -#endif - -#define PHP_OUTPUT_HANDLER_START (1<<0) -#define PHP_OUTPUT_HANDLER_CONT (1<<1) -#define PHP_OUTPUT_HANDLER_END (1<<2) - -#define PHP_OUTPUT_HANDLER_INTERNAL 0 -#define PHP_OUTPUT_HANDLER_USER 1 - -PHP_FUNCTION(output_add_rewrite_var); -PHP_FUNCTION(output_reset_rewrite_vars); - - -#endif /* PHP_OUTPUT_H */ diff --git a/main/php_realpath.c b/main/php_realpath.c deleted file mode 100644 index 0607e91cc481b..0000000000000 --- a/main/php_realpath.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | 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. | - +----------------------------------------------------------------------+ - | Author: Sander Steffann (sander@steffann.nl) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#if HAVE_UNISTD_H -#include -#endif -#include - -#ifndef MAXSYMLINKS -#define MAXSYMLINKS 32 -#endif - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -char *php_realpath(char *path, char resolved_path[]); - -#ifdef PHP_WIN32 -#define IS_SLASH(p) ((p) == '/' || (p) == '\\') -#else -#define IS_SLASH(p) ((p) == '/') -#endif - -char *php_realpath(char *path, char resolved_path []) { - char path_construction[MAXPATHLEN]; /* We build the result in here */ - char *writepos; /* Position to write next char */ - - char path_copy[MAXPATHLEN]; /* A work-copy of the path */ - char *workpos; /* working position in *path */ - -#if !defined(PHP_WIN32) - char buf[MAXPATHLEN]; /* Buffer for readlink */ - int linklength; /* The result from readlink */ -#endif - int linkcount = 0; /* Count symlinks to avoid loops */ - - struct stat filestat; /* result from stat */ - -#ifdef PHP_WIN32 - char *temppos; /* position while counting '.' */ - int dotcount; /* number of '.' */ - int t; /* counter */ -#endif - - /* Set the work-position to the beginning of the given path */ - strcpy(path_copy, path); - workpos = path_copy; - -#ifdef PHP_WIN32 - /* Find out where we start - Windows version */ - if (IS_SLASH(*workpos)) { - /* We start at the root of the current drive */ - /* Get the current directory */ - if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) { - /* Unable to get cwd */ - resolved_path[0] = 0; - return NULL; - } - /* We only need the first three chars (for example "C:\") */ - path_construction[3] = 0; - workpos++; - } else if (workpos[1] == ':') { - /* A drive-letter is specified, copy it */ - strncpy(path_construction, path, 2); - strcat(path_construction, "\\"); - workpos++; - workpos++; - } else { - /* Use the current directory */ - if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) { - /* Unable to get cwd */ - resolved_path[0] = 0; - return NULL; - } - strcat(path_construction, "\\"); - } -#else - /* Find out where we start - Unix version */ - if (*workpos == '/') { - /* We start at the root */ - strcpy(path_construction, "/"); - workpos++; - } else { - /* Use the current directory */ - if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) { - /* Unable to get cwd */ - resolved_path[0] = 0; - return NULL; - } - strcat(path_construction, "/"); - } -#endif - - /* Set the next-char-position */ - writepos = &path_construction[strlen(path_construction)]; - - /* Go to the end, then stop */ - while(*workpos != 0) { - /* Strip (back)slashes */ - while(IS_SLASH(*workpos)) workpos++; - -#ifdef PHP_WIN32 - /* reset dotcount */ - dotcount = 0; - - /* Look for .. */ - if ((workpos[0] == '.') && (workpos[1] != 0)) { - /* Windows accepts \...\ as \..\..\, \....\ as \..\..\..\, etc */ - /* At least Win98 does */ - - temppos = workpos; - while(*temppos++ == '.') { - dotcount++; - if (!IS_SLASH(*temppos) && (*temppos != 0) && (*temppos != '.')) { - /* This is not a /../ component, but a filename that starts with '.' */ - dotcount = 0; - } - } - - /* Go back dotcount-1 times */ - for (t=0 ; t<(dotcount-1) ; t++) { - workpos++; /* move to next '.' */ - - /* Can we still go back? */ - if ((writepos-3) <= path_construction) return NULL; - - /* Go back */ - writepos--; /* move to '\' */ - writepos--; - while(!IS_SLASH(*writepos)) writepos--; /* skip until previous '\\' */ - } - workpos++; - } - - /* No special case */ - if (dotcount == 0) { - /* Append */ - while(!IS_SLASH(*workpos) && (*workpos != 0)) { - *writepos++ = *workpos++; - } - } - - /* Just one '.', go to next element */ - if (dotcount == 1) { - while(!IS_SLASH(*workpos) && (*workpos != 0)) { - *workpos++; - } - - /* Avoid double \ in the result */ - writepos--; - } - - /* If it was a directory, append a slash */ - if (IS_SLASH(*workpos)) { - *writepos++ = *workpos++; - } - *writepos = 0; -#else /* defined(PHP_WIN32) */ - /* Look for .. */ - if ((workpos[0] == '.') && (workpos[1] != 0)) { - if ((workpos[1] == '.') && ((workpos[2] == '/') || (workpos[2] == 0))) { - /* One directory back */ - /* Set pointers to right position */ - workpos++; /* move to second '.' */ - workpos++; /* move to '/' */ - - /* Only apply .. if not in root */ - if ((writepos-1) > path_construction) { - writepos--; /* move to '/' */ - while(*--writepos != '/') ; /* skip until previous '/' */ - } - } else { - if (workpos[1] == '/') { - /* Found a /./ skip it */ - workpos++; /* move to '/' */ - - /* Avoid double / in the result */ - writepos--; - } else { - /* No special case, the name just started with a . */ - /* Append */ - while((*workpos != '/') && (*workpos != 0)) { - *writepos++ = *workpos++; - } - } - } - } else { - /* No special case */ - /* Append */ - while((*workpos != '/') && (*workpos != 0)) { - *writepos++ = *workpos++; - } - } - -#if HAVE_SYMLINK - /* We are going to use path_construction, so close it */ - *writepos = 0; - - /* Check the current location to see if it is a symlink */ - if((linklength = readlink(path_construction, buf, MAXPATHLEN)) != -1) { - /* Check linkcount */ - if (linkcount > MAXSYMLINKS) return NULL; - - /* Count this symlink */ - linkcount++; - - /* Set end of buf */ - buf[linklength] = 0; - - /* Check for overflow */ - if ((strlen(workpos) + strlen(buf) + 1) >= MAXPATHLEN) return NULL; - - /* Remove the symlink-component wrom path_construction */ - writepos--; /* move to '/' */ - while(*--writepos != '/') ; /* skip until previous '/' */ - *++writepos = 0; /* end of string after '/' */ - - /* If the symlink starts with a '/', empty path_construction */ - if (*buf == '/') { - *path_construction = 0; - writepos = path_construction; - } - - /* Insert symlink into path_copy */ - strcat(buf, workpos); - strcpy(path_copy, buf); - workpos = path_copy; - } -#endif /* HAVE_SYMLINK */ - - /* If it was a directory, append a slash */ - if (*workpos == '/') { - *writepos++ = *workpos++; - } - *writepos = 0; -#endif /* defined(PHP_WIN32) */ - } - - /* Check if the resolved path is a directory */ - if (V_STAT(path_construction, &filestat) != 0) { - if (errno != ENOENT) return NULL; - } else { - if (S_ISDIR(filestat.st_mode)) { - /* It's a directory, append a / if needed */ - if (*(writepos-1) != '/') { - /* Check for overflow */ - if ((strlen(workpos) + 2) >= MAXPATHLEN) { - return NULL; - } - *writepos++ = '/'; - *writepos = 0; - } - } - } - - strcpy(resolved_path, path_construction); - return resolved_path; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h deleted file mode 100644 index 4140f7038f8ba..0000000000000 --- a/main/php_reentrancy.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_REENTRANCY_H -#define PHP_REENTRANCY_H - -#include "php.h" - -#include -#ifdef HAVE_DIRENT_H -#include -#endif -#include - -/* currently, PHP does not check for these functions, but assumes - that they are available on all systems. */ - -#define HAVE_LOCALTIME 1 -#define HAVE_GMTIME 1 -#define HAVE_ASCTIME 1 -#define HAVE_CTIME 1 - -#if defined(PHP_IRIX_TIME_R) -#undef HAVE_ASCTIME_R -#undef HAVE_CTIME_R -#endif - -#if defined(PHP_HPUX_TIME_R) -#undef HAVE_LOCALTIME_R -#undef HAVE_ASCTIME_R -#undef HAVE_CTIME_R -#undef HAVE_GMTIME_R -#endif - -BEGIN_EXTERN_C() - -#if defined(HAVE_POSIX_READDIR_R) -#define php_readdir_r readdir_r -#else -PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, - struct dirent **result); -#endif - -#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm); -#else -#define php_localtime_r localtime_r -#ifdef MISSING_LOCALTIME_R_DECL -struct tm *localtime_r(const time_t *const timep, struct tm *p_tm); -#endif -#endif - - -#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI char *php_ctime_r(const time_t *clock, char *buf); -#else -#define php_ctime_r ctime_r -#ifdef MISSING_CTIME_R_DECL -char *ctime_r(const time_t *clock, char *buf); -#endif -#endif - - -#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf); -#else -#define php_asctime_r asctime_r -#ifdef MISSING_ASCTIME_R_DECL -char *asctime_r(const struct tm *tm, char *buf); -#endif -#endif - - -#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) || defined(__BEOS__) -#define PHP_NEED_REENTRANCY 1 -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); -#else -#define php_gmtime_r gmtime_r -#ifdef MISSING_GMTIME_R_DECL -struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); -#endif -#endif - -#if !defined(HAVE_STRTOK_R) -PHPAPI char *php_strtok_r(char *s, const char *delim, char **last); -#else -#define php_strtok_r strtok_r -#ifdef MISSING_STRTOK_R_DECL -char *strtok_r(char *s, const char *delim, char **last); -#endif -#endif - -#if !defined(HAVE_RAND_R) -PHPAPI int php_rand_r(unsigned int *seed); -#else -#define php_rand_r rand_r -#endif - -END_EXTERN_C() - -#if !defined(ZTS) -#undef PHP_NEED_REENTRANCY -#endif - -#if defined(PHP_NEED_REENTRANCY) -void reentrancy_startup(void); -void reentrancy_shutdown(void); -#else -#define reentrancy_startup() -#define reentrancy_shutdown() -#endif - -#endif diff --git a/main/php_regex.h b/main/php_regex.h deleted file mode 100644 index 3713f4ec91d9e..0000000000000 --- a/main/php_regex.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_REGEX_H -#define PHP_REGEX_H - -/* - * REGEX means: - * 0.. system regex - * 1.. bundled regex - */ - -#if REGEX -/* get aliases */ -#include "regex/regex_extra.h" -#include "regex/regex.h" - -/* get rid of aliases */ -#define PHP_NO_ALIASES -#include "regex/regex_extra.h" -#undef PHP_NO_ALIASES - -#undef _PCREPOSIX_H -#define _PCREPOSIX_H 1 - -#ifndef _REGEX_H -#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ -#endif -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#ifndef _RX_H -#define _RX_H 1 /* Try defining these for Linux to */ -#endif -#ifndef __REGEXP_LIBRARY_H__ -#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */ -#endif -#ifndef _H_REGEX -#define _H_REGEX 1 /* This one is for AIX */ -#endif -#elif REGEX == 0 -#include -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#endif - -#endif /* PHP_REGEX_H */ diff --git a/main/php_scandir.c b/main/php_scandir.c deleted file mode 100644 index 56949703eec17..0000000000000 --- a/main/php_scandir.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php_scandir.h" - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_DIRENT_H -#include -#endif - -#ifndef HAVE_SCANDIR - -#ifdef PHP_WIN32 -#include "win32/readdir.h" -#endif - -#include -#ifndef NETWARE -#include -#endif - -#endif /* HAVE_SCANDIR */ - -#ifndef HAVE_ALPHASORT - -#ifdef HAVE_STRING_H -#include -#endif - -int php_alphasort(const struct dirent **a, const struct dirent **b) -{ - return strcoll((*a)->d_name,(*b)->d_name); -} -#endif /* HAVE_ALPHASORT */ - -#ifndef HAVE_SCANDIR -int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b)) -{ - DIR *dirp = NULL; - struct dirent **vector = NULL; - struct dirent *dp = NULL; - int vector_size = 0; - int nfiles = 0; - - if (namelist == NULL) { - return -1; - } - - if (!(dirp = opendir(dirname))) { - return -1; - } - - while ((dp = readdir(dirp)) != NULL) { - int dsize = 0; - struct dirent *newdp = NULL; - - if (selector && (*selector)(dp) == 0) { - continue; - } - - if (nfiles == vector_size) { - struct dirent **newv; - if (vector_size == 0) { - vector_size = 10; - } else { - vector_size *= 2; - } - - newv = (struct dirent **) realloc (vector, vector_size * sizeof (struct dirent *)); - if (!newv) { - return -1; - } - vector = newv; - } - - dsize = sizeof (struct dirent) + ((strlen(dp->d_name) + 1) * sizeof(char)); - newdp = (struct dirent *) malloc(dsize); - - if (newdp == NULL) { - goto fail; - } - - vector[nfiles++] = (struct dirent *) memcpy(newdp, dp, dsize); - } - - closedir(dirp); - - *namelist = vector; - - if (compare) { - qsort (*namelist, nfiles, sizeof(struct dirent *), compare); - } - - return nfiles; - -fail: - while (nfiles-- > 0) { - free(vector[nfiles]); - } - free(vector); - return -1; -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_scandir.h b/main/php_scandir.h deleted file mode 100644 index d65b6c80db97e..0000000000000 --- a/main/php_scandir.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Shane Caraveo | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SCANDIR_H -#define PHP_SCANDIR_H - -#include - -#ifdef HAVE_SYS_DIR_H -#include -#endif - -#ifdef PHP_WIN32 -#include "config.w32.h" -#include "win32/readdir.h" -#else -#include -#endif - -#ifdef HAVE_DIRENT_H -#include -#endif - -#ifdef HAVE_SCANDIR -#define php_scandir scandir -#else -int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b)); -#endif - -#ifdef HAVE_ALPHASORT -#define php_alphasort alphasort -#else -int php_alphasort(const struct dirent **a, const struct dirent **b); -#endif - -#endif /* PHP_SCANDIR_H */ diff --git a/main/php_sprintf.c b/main/php_sprintf.c deleted file mode 100644 index f5ecc6e3cec28..0000000000000 --- a/main/php_sprintf.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jaakko Hyvätti | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -PHPAPI int -php_sprintf (char*s, const char* format, ...) -{ - va_list args; - int ret; - - va_start (args, format); - s[0] = '\0'; - ret = vsprintf (s, format, args); - va_end (args); - if (!ret) - return -1; - return strlen (s); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_streams.h b/main/php_streams.h deleted file mode 100755 index 1b1df1d1d0138..0000000000000 --- a/main/php_streams.h +++ /dev/null @@ -1,578 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong (wez@thebrainroom.com) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_STREAMS_H -#define PHP_STREAMS_H - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -#include - -BEGIN_EXTERN_C() -PHPAPI int php_file_le_stream(void); -PHPAPI int php_file_le_pstream(void); -PHPAPI int php_file_le_stream_filter(void); -END_EXTERN_C() - -/* {{{ Streams memory debugging stuff */ - -#if ZEND_DEBUG -/* these have more of a dependency on the definitions of the zend macros than - * I would prefer, but doing it this way saves loads of idefs :-/ */ -# define STREAMS_D int __php_stream_call_depth ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC -# define STREAMS_C 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC -# define STREAMS_REL_C __php_stream_call_depth + 1 ZEND_FILE_LINE_CC, \ - __php_stream_call_depth ? __zend_orig_filename : __zend_filename, \ - __php_stream_call_depth ? __zend_orig_lineno : __zend_lineno - -# define STREAMS_DC , STREAMS_D -# define STREAMS_CC , STREAMS_C -# define STREAMS_REL_CC , STREAMS_REL_C - -#else -# define STREAMS_D -# define STREAMS_C -# define STREAMS_REL_C -# define STREAMS_DC -# define STREAMS_CC -# define STREAMS_REL_CC -#endif - -/* these functions relay the file/line number information. They are depth aware, so they will pass - * the ultimate ancestor, which is useful, because there can be several layers of calls */ -#define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_copy_to_mem_rel(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_tmpfile_rel() _php_stream_fopen_tmpfile(0 STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_temporary_file_rel(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_open_wrapper_rel(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_REL_CC TSRMLS_CC) -#define php_stream_open_wrapper_ex_rel(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_make_seekable_rel(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_REL_CC TSRMLS_CC) - -/* }}} */ - -/* The contents of the php_stream_ops and php_stream should only be accessed - * using the functions/macros in this header. - * If you need to get at something that doesn't have an API, - * drop me a line and we can sort out a way to do - * it properly. - * - * The only exceptions to this rule are that stream implementations can use - * the php_stream->abstract pointer to hold their context, and streams - * opened via stream_open_wrappers can use the zval ptr in - * php_stream->wrapperdata to hold meta data for php scripts to - * retrieve using file_get_wrapper_data(). */ - -typedef struct _php_stream php_stream; -typedef struct _php_stream_wrapper php_stream_wrapper; -typedef struct _php_stream_context php_stream_context; -typedef struct _php_stream_filter php_stream_filter; - -#include "streams/php_stream_context.h" -#include "streams/php_stream_filter_api.h" - -typedef struct _php_stream_statbuf { - struct stat sb; /* regular info */ - /* extended info to go here some day: content-type etc. etc. */ -} php_stream_statbuf; - -typedef struct _php_stream_dirent { - char d_name[MAXPATHLEN]; -} php_stream_dirent; - -/* operations on streams that are file-handles */ -typedef struct _php_stream_ops { - /* stdio like functions - these are mandatory! */ - size_t (*write)(php_stream *stream, const char *buf, size_t count TSRMLS_DC); - size_t (*read)(php_stream *stream, char *buf, size_t count TSRMLS_DC); - int (*close)(php_stream *stream, int close_handle TSRMLS_DC); - int (*flush)(php_stream *stream TSRMLS_DC); - - const char *label; /* label for this ops structure */ - - /* these are optional */ - int (*seek)(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC); - int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); - int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); - int (*set_option)(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); -} php_stream_ops; - -typedef struct _php_stream_wrapper_ops { - /* open/create a wrapped stream */ - php_stream *(*stream_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - /* close/destroy a wrapped stream */ - int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC); - /* stat a wrapped stream */ - int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); - /* stat a URL */ - int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); - /* open a "directory" stream */ - php_stream *(*dir_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - - const char *label; - - /* delete a file */ - int (*unlink)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); - - /* rename a file */ - int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); - - /* Create/Remove directory */ - int (*stream_mkdir)(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); - int (*stream_rmdir)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -} php_stream_wrapper_ops; - -struct _php_stream_wrapper { - php_stream_wrapper_ops *wops; /* operations the wrapper can perform */ - void *abstract; /* context for the wrapper */ - int is_url; /* so that PG(allow_url_fopen) can be respected */ - - /* support for wrappers to return (multiple) error messages to the stream opener */ - int err_count; - char **err_stack; -}; - -#define PHP_STREAM_FLAG_NO_SEEK 1 -#define PHP_STREAM_FLAG_NO_BUFFER 2 - -#define PHP_STREAM_FLAG_EOL_UNIX 0 /* also includes DOS */ -#define PHP_STREAM_FLAG_DETECT_EOL 4 -#define PHP_STREAM_FLAG_EOL_MAC 8 - -/* set this when the stream might represent "interactive" data. - * When set, the read buffer will avoid certain operations that - * might otherwise cause the read to block for much longer than - * is strictly required. */ -#define PHP_STREAM_FLAG_AVOID_BLOCKING 16 - -struct _php_stream { - php_stream_ops *ops; - void *abstract; /* convenience pointer for abstraction */ - - php_stream_filter_chain readfilters, writefilters; - - php_stream_wrapper *wrapper; /* which wrapper was used to open the stream */ - void *wrapperthis; /* convenience pointer for a instance of a wrapper */ - zval *wrapperdata; /* fgetwrapperdata retrieves this */ - - int fgetss_state; /* for fgetss to handle multiline tags */ - int is_persistent; - char mode[16]; /* "rwb" etc. ala stdio */ - int rsrc_id; /* used for auto-cleanup */ - int in_free; /* to prevent recursion during free */ - /* so we know how to clean it up correctly. This should be set to - * PHP_STREAM_FCLOSE_XXX as appropriate */ - int fclose_stdiocast; - FILE *stdiocast; /* cache this, otherwise we might leak! */ -#if ZEND_DEBUG - int __exposed; /* non-zero if exposed as a zval somewhere */ -#endif - char *orig_path; - - php_stream_context *context; - int flags; /* PHP_STREAM_FLAG_XXX */ - - /* buffer */ - off_t position; /* of underlying stream */ - - php_stream_bucket_brigade readbuf; - off_t readbuf_ofs, readbuf_avail; - - /* how much data to read when filling buffer */ - size_t chunk_size; - - int eof; - -}; /* php_stream */ -/* state definitions when closing down; these are private to streams.c */ -#define PHP_STREAM_FCLOSE_NONE 0 -#define PHP_STREAM_FCLOSE_FDOPEN 1 -#define PHP_STREAM_FCLOSE_FOPENCOOKIE 2 - -/* allocate a new stream for a particular ops */ -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, - const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC); -END_EXTERN_C() -#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) - - -#define php_stream_get_resource_id(stream) (stream)->rsrc_id -#if ZEND_DEBUG -/* use this to tell the stream that it is OK if we don't explicitly close it */ -# define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } -/* use this to assign the stream to a zval and tell the stream that is - * has been exported to the engine; it will expect to be closed automatically - * when the resources are auto-destructed */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); (stream)->__exposed++; } -#else -# define php_stream_auto_cleanup(stream) /* nothing */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); } -#endif - -#define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) -#define php_stream_from_zval_no_verify(xstr, ppzval) (xstr) = (php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) - -BEGIN_EXTERN_C() -PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC); -#define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */ -#define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */ -#define PHP_STREAM_PERSISTENT_NOT_EXIST 2 /* id does not exist */ - -#define PHP_STREAM_FREE_CALL_DTOR 1 /* call ops->close */ -#define PHP_STREAM_FREE_RELEASE_STREAM 2 /* pefree(stream) */ -#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close it's underlying handle */ -#define PHP_STREAM_FREE_RSRC_DTOR 8 /* called from the resource list dtor */ -#define PHP_STREAM_FREE_PERSISTENT 16 /* manually freeing a persistent connection */ -#define PHP_STREAM_FREE_CLOSE (PHP_STREAM_FREE_CALL_DTOR | PHP_STREAM_FREE_RELEASE_STREAM) -#define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE) -#define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT) - -PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC); -#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options) TSRMLS_CC) -#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC) -#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT TSRMLS_CC) - -PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC); -#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET TSRMLS_CC) -#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence) TSRMLS_CC) - -PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC); -#define php_stream_tell(stream) _php_stream_tell((stream) TSRMLS_CC) - -/* Convert using runtime_encoding if necessary -- return string */ -PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC); -#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count) TSRMLS_CC) - -/* Convert using runtime_encoding if necessary -- return unicode */ -PHPAPI size_t _php_stream_read_unicode(php_stream *stream, UChar *buf, int32_t size TSRMLS_DC); -#define php_stream_read_unicode(stream, buf, size) _php_stream_read_unicode((stream), (buf), (size) TSRMLS_CC) - -/* Read count data points (char or UChar) until buffered type changes -- return single type without conversion */ -PHPAPI void *_php_stream_u_read(php_stream *stream, void *buf, int32_t *pnum_bytes, int32_t *pnum_chars, int *pis_unicode TSRMLS_DC); -#define php_stream_u_read(stream, buf, pnum_bytes, pnum_chars, pis_unicode) \ - _php_stream_u_read((stream), (buf), (pnum_bytes), (pnum_chars), (pis_unicode) TSRMLS_CC) - -PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC); -#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC) -#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC) - -PHPAPI size_t _php_stream_u_write(php_stream *stream, const UChar *buf, int32_t count TSRMLS_DC); -#define php_stream_u_write(stream, buf, count) _php_stream_u_write((stream), (buf), (count) TSRMLS_CC) - -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); -/* php_stream_printf macro & function require TSRMLS_CC */ -#define php_stream_printf _php_stream_printf - -PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC); -#define php_stream_eof(stream) _php_stream_eof((stream) TSRMLS_CC) - -PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC); -#define php_stream_getc(stream) _php_stream_getc((stream) TSRMLS_CC) - -PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC); -#define php_stream_putc(stream, c) _php_stream_putc((stream), (c) TSRMLS_CC) - -PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC); -#define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC) - -PHPAPI void _php_stream_flush_readbuf(php_stream *stream TSRMLS_DC); -#define php_stream_flush_readbuf(stream) _php_stream_flush_readbuf((stream) TSRMLS_CC) - -PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len TSRMLS_DC); -#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC) -#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC) -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC); - -PHPAPI UChar *_php_stream_u_get_line(php_stream *stream, UChar *buf, int32_t *pmax_u16, int32_t *pmax_chars, int *pis_unicode TSRMLS_DC); -#define php_stream_u_get_line(stream, buf, max_u16, max_chars, is_unicode) _php_stream_u_get_line((stream), (buf), (max_u16), (max_chars), (is_unicode) TSRMLS_CC) - -/* CAREFUL! this is equivalent to puts NOT fputs! */ -PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC); -#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf) TSRMLS_CC) - -PHPAPI int _php_stream_will_read_unicode(php_stream *stream TSRMLS_DC); -#define php_stream_will_read_unicode(stream) _php_stream_will_read_unicode((stream) TSRMLS_CC); - -PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); -#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb) TSRMLS_CC) - -PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL TSRMLS_CC) -#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC) - -PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC); -#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context TSRMLS_CC) - -PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC); -#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context TSRMLS_CC) - -PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC); -#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC) -PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC); -#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent) TSRMLS_CC) -#define php_stream_closedir(dirstream) php_stream_close((dirstream)) -#define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream)) - -PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b); -PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b); - -PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, - int (*compare) (const char **a, const char **b) TSRMLS_DC); -#define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare) TSRMLS_CC) - -PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); -#define php_stream_set_option(stream, option, value, ptrvalue) _php_stream_set_option((stream), (option), (value), (ptrvalue) TSRMLS_CC) - -#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC) - -END_EXTERN_C() - - -/* Flags for mkdir method in wrapper ops */ -#define PHP_STREAM_MKDIR_RECURSIVE 1 -/* define REPORT ERRORS 8 (below) */ - -/* Flags for rmdir method in wrapper ops */ -/* define REPORT_ERRORS 8 (below) */ - -/* Flags for url_stat method in wrapper ops */ -#define PHP_STREAM_URL_STAT_LINK 1 -#define PHP_STREAM_URL_STAT_QUIET 2 - -/* change the blocking mode of stream: value == 1 => blocking, value == 0 => non-blocking. */ -#define PHP_STREAM_OPTION_BLOCKING 1 - -/* change the buffering mode of stream. value is a PHP_STREAM_BUFFER_XXXX value, ptrparam is a ptr to a size_t holding - * the required buffer size */ -#define PHP_STREAM_OPTION_READ_BUFFER 2 -#define PHP_STREAM_OPTION_WRITE_BUFFER 3 - -#define PHP_STREAM_BUFFER_NONE 0 /* unbuffered */ -#define PHP_STREAM_BUFFER_LINE 1 /* line buffered */ -#define PHP_STREAM_BUFFER_FULL 2 /* fully buffered */ - -/* set the timeout duration for reads on the stream. ptrparam is a pointer to a struct timeval * */ -#define PHP_STREAM_OPTION_READ_TIMEOUT 4 -#define PHP_STREAM_OPTION_SET_CHUNK_SIZE 5 - -/* set or release lock on a stream */ -#define PHP_STREAM_OPTION_LOCKING 6 - -/* whether or not locking is supported */ -#define PHP_STREAM_LOCK_SUPPORTED 1 - -#define php_stream_supports_lock(stream) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, 0, (void *) PHP_STREAM_LOCK_SUPPORTED TSRMLS_CC) == 0 ? 1 : 0 -#define php_stream_lock(stream, mode) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, (mode), (void *) NULL TSRMLS_CC) - -/* option code used by the php_stream_xport_XXX api */ -#define PHP_STREAM_OPTION_XPORT_API 7 /* see php_stream_transport.h */ -#define PHP_STREAM_OPTION_CRYPTO_API 8 /* see php_stream_transport.h */ -#define PHP_STREAM_OPTION_MMAP_API 9 /* see php_stream_mmap.h */ -#define PHP_STREAM_OPTION_TRUNCATE_API 10 - -#define PHP_STREAM_TRUNCATE_SUPPORTED 0 -#define PHP_STREAM_TRUNCATE_SET_SIZE 1 /* ptrparam is a pointer to a size_t */ - -#define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) - -BEGIN_EXTERN_C() -PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC); -#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size) TSRMLS_CC) -END_EXTERN_C() - -#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add meta data information */ -#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) - -/* Check if the stream is still "live"; for sockets/pipes this means the socket - * is still connected; for files, this does not really have meaning */ -#define PHP_STREAM_OPTION_CHECK_LIVENESS 12 /* no parameters */ - -#define PHP_STREAM_OPTION_RETURN_OK 0 /* option set OK */ -#define PHP_STREAM_OPTION_RETURN_ERR -1 /* problem setting option */ -#define PHP_STREAM_OPTION_RETURN_NOTIMPL -2 /* underlying stream does not implement; streams can handle it instead */ - -/* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, copy until eof(src). - * Uses mmap if the src is a plain file and at offset 0 */ -#define PHP_STREAM_COPY_ALL ((size_t)-1) - -BEGIN_EXTERN_C() -PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC); -#define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC TSRMLS_CC) - - -/* read all data from stream and put into a buffer. Caller must free buffer when done. - * The copy will use mmap if available. */ -PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen, - int persistent STREAMS_DC TSRMLS_DC); -#define php_stream_copy_to_mem(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_CC TSRMLS_CC) - -/* output all data from a stream */ -PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC TSRMLS_DC); -#define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC TSRMLS_CC) -END_EXTERN_C() - -#include "streams/php_stream_transport.h" -#include "streams/php_stream_plain_wrapper.h" -#include "streams/php_stream_userspace.h" -#include "streams/php_stream_mmap.h" - -/* coerce the stream into some other form */ -/* cast as a stdio FILE * */ -#define PHP_STREAM_AS_STDIO 0 -/* cast as a POSIX fd or socketd */ -#define PHP_STREAM_AS_FD 1 -/* cast as a socketd */ -#define PHP_STREAM_AS_SOCKETD 2 -/* cast as fd/socket for select purposes */ -#define PHP_STREAM_AS_FD_FOR_SELECT 3 - -/* try really, really hard to make sure the cast happens (avoid using this flag if possible) */ -#define PHP_STREAM_CAST_TRY_HARD 0x80000000 -#define PHP_STREAM_CAST_RELEASE 0x40000000 /* stream becomes invalid on success */ -#define PHP_STREAM_CAST_INTERNAL 0x20000000 /* stream cast for internal use */ -#define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL) -BEGIN_EXTERN_C() -PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC); -END_EXTERN_C() -/* use this to check if a stream can be cast into another form */ -#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0 TSRMLS_CC) -#define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err) TSRMLS_CC) - -/* use this to check if a stream is of a particular type: - * PHPAPI int php_stream_is(php_stream *stream, php_stream_ops *ops); */ -#define php_stream_is(stream, anops) ((stream)->ops == anops) -#define PHP_STREAM_IS_STDIO &php_stream_stdio_ops - -#define php_stream_is_persistent(stream) (stream)->is_persistent - -/* Wrappers support */ - -#define IGNORE_PATH 0 -#define USE_PATH 1 -#define IGNORE_URL 2 -#define ENFORCE_SAFE_MODE 4 -#define REPORT_ERRORS 8 -/* If you don't need to write to the stream, but really need to - * be able to seek, use this flag in your options. */ -#define STREAM_MUST_SEEK 16 -/* If you are going to end up casting the stream into a FILE* or - * a socket, pass this flag and the streams/wrappers will not use - * buffering mechanisms while reading the headers, so that HTTP - * wrapped streams will work consistently. - * If you omit this flag, streams will use buffering and should end - * up working more optimally. - * */ -#define STREAM_WILL_CAST 32 - -/* this flag applies to php_stream_locate_url_wrapper */ -#define STREAM_LOCATE_WRAPPERS_ONLY 64 - -/* this flag is only used by include/require functions */ -#define STREAM_OPEN_FOR_INCLUDE 128 - -/* this flag tells streams to ONLY open urls */ -#define STREAM_USE_URL 256 - -/* this flag is used when only the headers from HTTP request are to be fetched */ -#define STREAM_ONLY_GET_HEADERS 512 - -/* don't apply open_basedir checks */ -#define STREAM_DISABLE_OPEN_BASEDIR 1024 - -/* get (or create) a persistent version of the stream */ -#define STREAM_OPEN_PERSISTENT 2048 - -/* Antique - no longer has meaning */ -#define IGNORE_URL_WIN 0 - -int php_init_stream_wrappers(int module_number TSRMLS_DC); -int php_shutdown_stream_wrappers(int module_number TSRMLS_DC); -void php_shutdown_stream_hashes(TSRMLS_D); -PHP_RSHUTDOWN_FUNCTION(streams); - -BEGIN_EXTERN_C() -PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC); -PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC); -PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC); -PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC); - -#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC) -#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC TSRMLS_CC) - -#define php_stream_get_from_zval(stream, zstream, mode, options, opened, context) \ - if (Z_TYPE_PP((zstream)) == IS_RESOURCE) { \ - php_stream_from_zval((stream), (zstream)); \ - } else (stream) = Z_TYPE_PP((zstream)) == IS_STRING ? \ - php_stream_open_wrapper_ex(Z_STRVAL_PP((zstream)), (mode), (options), (opened), (context)) : NULL - -/* pushes an error message onto the stack for a wrapper instance */ -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); - - -#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ -#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */ -#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */ -#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */ -#define PHP_STREAM_NO_PREFERENCE 0 -#define PHP_STREAM_PREFER_STDIO 1 -#define PHP_STREAM_FORCE_CONVERSION 2 -/* DO NOT call this on streams that are referenced by resources! */ -PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC); -#define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC TSRMLS_CC) - -/* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */ -PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D); -#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash(TSRMLS_C) -PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void); -PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D); -#define php_get_stream_filters_hash() _php_get_stream_filters_hash(TSRMLS_C) -PHPAPI HashTable *php_get_stream_filters_hash_global(); -END_EXTERN_C() -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_syslog.h b/main/php_syslog.h deleted file mode 100644 index 250c4791b5744..0000000000000 --- a/main/php_syslog.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSLOG_H -#define PHP_SYSLOG_H - -#ifdef PHP_WIN32 -#include "win32/syslog.h" -#else -#include -#ifdef HAVE_SYSLOG_H -#include -#endif -#endif - -/* - * The SCO OpenServer 5 Development System (not the UDK) - * defines syslog to std_syslog. - */ - -#ifdef syslog - -#ifdef HAVE_STD_SYSLOG -#define php_syslog std_syslog -#endif - -#undef syslog - -#endif - -#ifndef php_syslog -#define php_syslog syslog -#endif - -#endif diff --git a/main/php_ticks.c b/main/php_ticks.c deleted file mode 100644 index 1be5495260e12..0000000000000 --- a/main/php_ticks.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_ticks.h" - -int php_startup_ticks(TSRMLS_D) -{ - zend_llist_init(&PG(tick_functions), sizeof(void(*)(int)), NULL, 1); - return SUCCESS; -} - -void php_shutdown_ticks(TSRMLS_D) -{ - zend_llist_destroy(&PG(tick_functions)); -} - -static int php_compare_tick_functions(void *elem1, void *elem2) -{ - void(*func1)(int); - void(*func2)(int); - memcpy(&func1, elem1, sizeof(void(*)(int))); - memcpy(&func2, elem2, sizeof(void(*)(int))); - return (func1 == func2); -} - -PHPAPI void php_add_tick_function(void (*func)(int)) -{ - TSRMLS_FETCH(); - - zend_llist_add_element(&PG(tick_functions), (void *)&func); -} - -PHPAPI void php_remove_tick_function(void (*func)(int)) -{ - TSRMLS_FETCH(); - - zend_llist_del_element(&PG(tick_functions), (void *)func, - (int(*)(void*, void*))php_compare_tick_functions); -} - -static void php_tick_iterator(void *data, void *arg TSRMLS_DC) -{ - void (*func)(int); - - memcpy(&func, data, sizeof(void(*)(int))); - func(*((int *)arg)); -} - -void php_run_ticks(int count) -{ - TSRMLS_FETCH(); - - zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_ticks.h b/main/php_ticks.h deleted file mode 100644 index 4c3fd1d2e4074..0000000000000 --- a/main/php_ticks.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_TICKS_H -#define PHP_TICKS_H - -int php_startup_ticks(TSRMLS_D); -void php_shutdown_ticks(TSRMLS_D); -void php_run_ticks(int count); - -BEGIN_EXTERN_C() -PHPAPI void php_add_tick_function(void (*func)(int)); -PHPAPI void php_remove_tick_function(void (*func)(int)); -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/php_variables.c b/main/php_variables.c deleted file mode 100644 index e7124700f97e3..0000000000000 --- a/main/php_variables.c +++ /dev/null @@ -1,1087 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include "php.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/credits.h" -#include "php_variables.h" -#include "php_globals.h" -#include "php_content_types.h" -#include "SAPI.h" -#include "php_logos.h" -#include "zend_globals.h" - -/* for systems that need to override reading of environment variables */ -void _php_import_environment_variables(zval *array_ptr TSRMLS_DC); -PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC) = _php_import_environment_variables; - -PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array TSRMLS_DC) -{ - php_register_variable_safe(var, strval, strlen(strval), track_vars_array TSRMLS_CC); -} - -/* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zval *track_vars_array TSRMLS_DC) -{ - zval new_entry; - assert(strval != NULL); - - /* Prepare value */ - Z_STRLEN(new_entry) = str_len; - if (PG(magic_quotes_gpc)) { - Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry), &Z_STRLEN(new_entry), 0 TSRMLS_CC); - } else { - Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry)); - } - Z_TYPE(new_entry) = IS_STRING; - - php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC); -} - -PHPAPI void php_u_register_variable_safe(UChar *var, UChar *strval, int32_t str_len, zval *track_vars_array TSRMLS_DC) -{ - zval new_entry; - assert(strval != NULL); - - /* Prepare value */ - Z_USTRLEN(new_entry) = str_len; - if (PG(magic_quotes_gpc)) { - /* UTODO implement php_u_addslashes() */ - //Z_USTRVAL(new_entry) = php_addslashes(strval, Z_USTRLEN(new_entry), &Z_USTRLEN(new_entry), 0 TSRMLS_CC); - Z_USTRVAL(new_entry) = eustrndup(strval, Z_USTRLEN(new_entry)); - } else { - Z_USTRVAL(new_entry) = eustrndup(strval, Z_USTRLEN(new_entry)); - } - Z_TYPE(new_entry) = IS_UNICODE; - - php_u_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC); -} - -PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_array TSRMLS_DC) -{ - char *p = NULL; - char *ip; /* index pointer */ - char *index, *escaped_index = NULL; - int var_len, index_len; - zval *gpc_element, **gpc_element_p; - zend_bool is_array; - HashTable *symtable1 = NULL; - - assert(var != NULL); - - if (track_vars_array) { - symtable1 = Z_ARRVAL_P(track_vars_array); - } else if (PG(register_globals)) { - symtable1 = EG(active_symbol_table); - } - if (!symtable1) { - /* Nothing to do */ - zval_dtor(val); - return; - } - - /* - * Prepare variable name - */ - ip = strchr(var, '['); - if (ip) { - is_array = 1; - *ip = 0; - } else { - is_array = 0; - } - /* ignore leading spaces in the variable name */ - while (*var && *var==' ') { - var++; - } - var_len = strlen(var); - if (var_len==0) { /* empty variable name, or variable name with a space in it */ - zval_dtor(val); - return; - } - - /* GLOBALS hijack attempt, reject parameter */ - if (symtable1 == EG(active_symbol_table) && !strcmp("GLOBALS", var)) { - zval_dtor(val); - return; - } - - /* ensure that we don't have spaces or dots in the variable name (not binary safe) */ - for (p=var; *p; p++) { - switch (*p) { - case ' ': - case '.': - *p='_'; - break; - } - } - - index = var; - index_len = var_len; - - while (1) { - if (is_array) { - char *index_s; - int new_idx_len = 0; - - ip++; - index_s = ip; - if (isspace(*ip)) { - ip++; - } - if (*ip==']') { - index_s = NULL; - } else { - ip = strchr(ip, ']'); - if (!ip) { - /* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */ - *(index_s - 1) = '_'; - - index_len = var_len = 0; - if (index) { - index_len = var_len = strlen(index); - } - goto plain_var; - return; - } - *ip = 0; - new_idx_len = strlen(index_s); - } - - if (!index) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - if (PG(magic_quotes_gpc) && (index != var)) { - /* no need to addslashes() the index if it's the main variable name */ - escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - } else { - escaped_index = index; - } - if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE - || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } - if (index != escaped_index) { - efree(escaped_index); - } - } - symtable1 = Z_ARRVAL_PP(gpc_element_p); - /* ip pointed to the '[' character, now obtain the key */ - index = index_s; - index_len = new_idx_len; - - ip++; - if (*ip == '[') { - is_array = 1; - *ip = 0; - } else { - is_array = 0; - } - } else { -plain_var: - MAKE_STD_ZVAL(gpc_element); - gpc_element->value = val->value; - Z_TYPE_P(gpc_element) = Z_TYPE_P(val); - if (!index) { - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - zval **tmp; - - if (PG(magic_quotes_gpc)) { - escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - } else { - escaped_index = index; - } - /* - * According to rfc2965, more specific paths are listed above the less specific ones. - * If we encounter a duplicate cookie name, we should skip it, since it is not possible - * to have the same (plain text) cookie name for the same path and we should not overwrite - * more specific cookies with the less specific ones. - */ - if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && - zend_symtable_find(symtable1, escaped_index, index_len+1, (void **) &tmp) != FAILURE) { - if (index != escaped_index) { - efree(escaped_index); - } - break; - } - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - if (index != escaped_index) { - efree(escaped_index); - } - } - break; - } - } -} - -PHPAPI void php_u_register_variable_ex(UChar *var, zval *val, pval *track_vars_array TSRMLS_DC) -{ - UChar *p = NULL; - UChar *ip; /* index pointer */ - UChar *index; - int32_t var_len, index_len; - zval *gpc_element, **gpc_element_p; - zend_bool is_array; - HashTable *symtable1=NULL; - - assert(var != NULL); - - if (track_vars_array) { - symtable1 = Z_ARRVAL_P(track_vars_array); - } else if (PG(register_globals)) { - symtable1 = EG(active_symbol_table); - } - if (!symtable1) { - /* Nothing to do */ - zval_dtor(val); - return; - } - - /* - * Prepare variable name - */ - ip = u_strchr(var, 0x5b /*'['*/); - if (ip) { - is_array = 1; - *ip = 0; - } else { - is_array = 0; - } - /* ignore leading spaces in the variable name */ - while (*var && *var==0x20 /*' '*/) { - var++; - } - var_len = u_strlen(var); - if (var_len==0) { /* empty variable name, or variable name with a space in it */ - zval_dtor(val); - return; - } - /* ensure that we don't have spaces or dots in the variable name (not binary safe) */ - for (p=var; *p; p++) { - switch(*p) { - case 0x20: /*' '*/ - case 0x2e: /*'.'*/ - *p=0x5f; /*'_'*/ - break; - } - } - - index = var; - index_len = var_len; - - while (1) { - if (is_array) { - UChar *escaped_index = NULL, *index_s; - int32_t new_idx_len = 0; - - ip++; - index_s = ip; - if (u_isspace(*ip)) { - ip++; - } - if (*ip==0x5d /*']'*/) { - index_s = NULL; - } else { - ip = u_strchr(ip, 0x5d /*']'*/); - if (!ip) { - /* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */ - *(index_s - 1) = 0x5f; /*'_'*/ - - index_len = var_len = 0; - if (index) { - index_len = var_len = u_strlen(index); - } - goto plain_var; - return; - } - *ip = 0; - new_idx_len = u_strlen(index_s); - } - - if (!index) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - if (PG(magic_quotes_gpc) && (index!=var)) { - /* UTODO fix for magic_quotes_gpc case */ - /* no need to addslashes() the index if it's the main variable name */ - //escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - escaped_index = index; - } else { - escaped_index = index; - } - if (zend_u_symtable_find(symtable1, IS_UNICODE, escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE - || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } - if (index!=escaped_index) { - efree(escaped_index); - } - } - symtable1 = Z_ARRVAL_PP(gpc_element_p); - /* ip pointed to the '[' character, now obtain the key */ - index = index_s; - index_len = new_idx_len; - - ip++; - if (*ip==0x5b /*'['*/) { - is_array = 1; - *ip = 0; - } else { - is_array = 0; - } - } else { -plain_var: - MAKE_STD_ZVAL(gpc_element); - gpc_element->value = val->value; - Z_TYPE_P(gpc_element) = Z_TYPE_P(val); - if (!index) { - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - /* UTODO fix for php_addslashes case */ - //char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - UChar *escaped_index = index; - zend_u_symtable_update(symtable1, IS_UNICODE, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - //efree(escaped_index); - } - break; - } - } -} - -SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler) -{ - char *var, *val; - char *strtok_buf = NULL; - zval *array_ptr = (zval *) arg; - UConverter *input_conv = UG(http_input_encoding_conv); - - if (SG(request_info).post_data == NULL) { - return; - } - - if (!input_conv) { - input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - } - - var = php_strtok_r(SG(request_info).post_data, "&", &strtok_buf); - - while (var) { - val = strchr(var, '='); - if (val) { /* have a value */ - if (UG(unicode)) { - UChar *u_var, *u_val; - int32_t u_var_len, u_val_len; - int32_t var_len; - int32_t val_len; - UErrorCode status1 = U_ZERO_ERROR, status2 = U_ZERO_ERROR; - - *val++ = '\0'; - var_len = strlen(var); - php_url_decode(var, var_len); - val_len = php_url_decode(val, strlen(val)); - zend_convert_to_unicode(input_conv, &u_var, &u_var_len, var, var_len, &status1); - zend_convert_to_unicode(input_conv, &u_val, &u_val_len, val, val_len, &status2); - if (U_SUCCESS(status1) && U_SUCCESS(status2)) { - /* UTODO add input filtering */ - php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC); - } else { - /* UTODO set a user-accessible flag to indicate that conversion failed? */ - } - efree(u_var); - efree(u_val); - } else { - unsigned int val_len, new_val_len; - - *val++ = '\0'; - php_url_decode(var, strlen(var)); - val_len = php_url_decode(val, strlen(val)); - val = estrndup(val, val_len); - if (sapi_module.input_filter(PARSE_POST, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } - } - var = php_strtok_r(NULL, "&", &strtok_buf); - } -} - -SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter) -{ - /* TODO: check .ini setting here and apply user-defined input filter */ - if(new_val_len) *new_val_len = val_len; - return 1; -} - -SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) -{ - char *res = NULL, *var, *val, *separator = NULL; - const char *c_var; - zval *array_ptr; - int free_buffer = 0; - char *strtok_buf = NULL; - UConverter *input_conv = UG(http_input_encoding_conv); - - switch (arg) { - case PARSE_POST: - case PARSE_GET: - case PARSE_COOKIE: - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - switch (arg) { - case PARSE_POST: - if (PG(http_globals)[TRACK_VARS_POST]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]); - } - PG(http_globals)[TRACK_VARS_POST] = array_ptr; - break; - case PARSE_GET: - if (PG(http_globals)[TRACK_VARS_GET]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]); - } - PG(http_globals)[TRACK_VARS_GET] = array_ptr; - break; - case PARSE_COOKIE: - if (PG(http_globals)[TRACK_VARS_COOKIE]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]); - } - PG(http_globals)[TRACK_VARS_COOKIE] = array_ptr; - break; - } - break; - default: - array_ptr = destArray; - break; - } - - if (arg == PARSE_POST) { - sapi_handle_post(array_ptr TSRMLS_CC); - return; - } - - if (arg == PARSE_GET) { /* GET data */ - c_var = SG(request_info).query_string; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_COOKIE) { /* Cookie data */ - c_var = SG(request_info).cookie_data; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_STRING) { /* String data */ - res = str; - free_buffer = 1; - } - - if (!res) { - return; - } - - switch (arg) { - case PARSE_GET: - case PARSE_STRING: - separator = (char *) estrdup(PG(arg_separator).input); - break; - case PARSE_COOKIE: - separator = ";\0"; - break; - } - - if (!input_conv) { - input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - } - - var = php_strtok_r(res, separator, &strtok_buf); - - while (var) { - int32_t var_len; - - val = strchr(var, '='); - if (val) { - *val++ = '\0'; - } - var_len = strlen(var); - php_url_decode(var, var_len); - - if (UG(unicode)) { - UChar *u_var, *u_val; - int32_t u_var_len, u_val_len; - UErrorCode status = U_ZERO_ERROR; - - zend_convert_to_unicode(input_conv, &u_var, &u_var_len, var, var_len, &status); - if (U_FAILURE(status)) { - /* UTODO set a user-accessible flag to indicate that conversion failed? */ - efree(u_var); - goto next_var; - } - - if (val) { /* have a value */ - int val_len; - unsigned int new_val_len; - - val_len = php_url_decode(val, strlen(val)); - zend_convert_to_unicode(input_conv, &u_val, &u_val_len, val, val_len, &status); - if (U_FAILURE(status)) { - /* UTODO set a user-accessible flag to indicate that conversion failed? */ - efree(u_var); - efree(u_val); - goto next_var; - } - php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC); - /* UTODO need to make input_filter Unicode aware */ - /* - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - */ - efree(u_var); - efree(u_val); - } else { - u_val_len = 0; - u_val = USTR_MAKE(""); - php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC); - /* - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - */ - efree(u_val); - } - } else { - if (val) { /* have a value */ - int val_len; - unsigned int new_val_len; - - val_len = php_url_decode(val, strlen(val)); - val = estrndup(val, val_len); - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } else { - int val_len; - unsigned int new_val_len; - - val_len = 0; - val = estrndup("", val_len); - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } - } -next_var: - var = php_strtok_r(NULL, separator, &strtok_buf); - } - - if (arg != PARSE_COOKIE) { - efree(separator); - } - - if (free_buffer) { - efree(res); - } -} - -void _php_import_environment_variables(zval *array_ptr TSRMLS_DC) -{ - char buf[128]; - char **env, *p, *t = buf; - size_t alloc_size = sizeof(buf); - unsigned long nlen; /* ptrdiff_t is not portable */ - - /* turn off magic_quotes while importing environment variables */ - int magic_quotes_gpc = PG(magic_quotes_gpc); - PG(magic_quotes_gpc) = 0; - - for (env = environ; env != NULL && *env != NULL; env++) { - p = strchr(*env, '='); - if (!p) { /* malformed entry? */ - continue; - } - nlen = p - *env; - if (nlen >= alloc_size) { - alloc_size = nlen + 64; - t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size)); - } - memcpy(t, *env, nlen); - t[nlen] = '\0'; - php_register_variable(t, p + 1, array_ptr TSRMLS_CC); - } - if (t != buf && t != NULL) { - efree(t); - } - PG(magic_quotes_gpc) = magic_quotes_gpc; -} - -zend_bool php_std_auto_global_callback(char *name, uint name_len TSRMLS_DC) -{ - zend_printf("%s\n", name); - return 0; /* don't rearm */ -} - -/* {{{ php_build_argv - */ -static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) -{ - zval *arr, *argc, *tmp; - int count = 0; - char *ss, *space; - - if (! (PG(register_globals) || SG(request_info).argc || - PG(http_globals)[TRACK_VARS_SERVER]) ) { - return; - } - - ALLOC_ZVAL(arr); - array_init(arr); - arr->is_ref = 0; - arr->refcount = 0; - - /* Prepare argv */ - if (SG(request_info).argc) { /* are we in cli sapi? */ - int i; - for (i = 0; i < SG(request_info).argc; i++) { - ALLOC_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = strlen(SG(request_info).argv[i]); - Z_STRVAL_P(tmp) = estrndup(SG(request_info).argv[i], Z_STRLEN_P(tmp)); - INIT_PZVAL(tmp); - if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) { - if (Z_TYPE_P(tmp) == IS_STRING) { - efree(Z_STRVAL_P(tmp)); - } - } - } - } else if (s && *s) { - ss = s; - while (ss) { - space = strchr(ss, '+'); - if (space) { - *space = '\0'; - } - /* auto-type */ - ALLOC_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = strlen(ss); - Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp)); - INIT_PZVAL(tmp); - count++; - if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) { - if (Z_TYPE_P(tmp) == IS_STRING) { - efree(Z_STRVAL_P(tmp)); - } - } - if (space) { - *space = '+'; - ss = space + 1; - } else { - ss = space; - } - } - } - - /* prepare argc */ - ALLOC_ZVAL(argc); - if (SG(request_info).argc) { - Z_LVAL_P(argc) = SG(request_info).argc; - } else { - Z_LVAL_P(argc) = count; - } - Z_TYPE_P(argc) = IS_LONG; - argc->is_ref = 0; - argc->refcount = 0; - - if (PG(register_globals) || SG(request_info).argc) { - arr->refcount++; - argc->refcount++; - zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); - } - if (track_vars_array) { - arr->refcount++; - argc->refcount++; - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); - } -} -/* }}} */ - -/* {{{ php_handle_special_queries - */ -PHPAPI int php_handle_special_queries(TSRMLS_D) -{ - if (PG(expose_php) && SG(request_info).query_string && SG(request_info).query_string[0] == '=') { - if (php_info_logos(SG(request_info).query_string + 1 TSRMLS_CC)) { - return 1; - } else if (!strcmp(SG(request_info).query_string + 1, PHP_CREDITS_GUID)) { - php_print_credits(PHP_CREDITS_ALL TSRMLS_CC); - return 1; - } - } - return 0; -} -/* }}} */ - -/* {{{ php_register_server_variables - */ -static inline void php_register_server_variables(TSRMLS_D) -{ - zval *array_ptr = NULL; - /* turn off magic_quotes while importing server variables */ - int magic_quotes_gpc = PG(magic_quotes_gpc); - - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - if (PG(http_globals)[TRACK_VARS_SERVER]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); - } - PG(http_globals)[TRACK_VARS_SERVER] = array_ptr; - PG(magic_quotes_gpc) = 0; - - /* Server variables */ - if (sapi_module.register_server_variables) { - sapi_module.register_server_variables(array_ptr TSRMLS_CC); - } - - /* PHP Authentication support */ - if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC); - } - if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC); - } - if (SG(request_info).auth_digest) { - php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, array_ptr TSRMLS_CC); - } - /* store request init time */ - { - zval new_entry; - Z_TYPE(new_entry) = IS_LONG; - Z_LVAL(new_entry) = sapi_get_request_time(TSRMLS_C); - php_register_variable_ex("REQUEST_TIME", &new_entry, array_ptr TSRMLS_CC); - } - - PG(magic_quotes_gpc) = magic_quotes_gpc; -} -/* }}} */ - -/* {{{ php_autoglobal_merge - */ -static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC) -{ - zval **src_entry, **dest_entry; - char *string_key; - uint string_key_len; - ulong num_key; - HashPosition pos; - int key_type; - int globals_check = (PG(register_globals) && (dest == (&EG(symbol_table)))); - - zend_hash_internal_pointer_reset_ex(src, &pos); - while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) { - key_type = zend_hash_get_current_key_ex(src, &string_key, &string_key_len, &num_key, 0, &pos); - if (Z_TYPE_PP(src_entry) != IS_ARRAY - || (key_type == HASH_KEY_IS_STRING && zend_hash_find(dest, string_key, string_key_len, (void **) &dest_entry) != SUCCESS) - || (key_type == HASH_KEY_IS_LONG && zend_hash_index_find(dest, num_key, (void **)&dest_entry) != SUCCESS) - || Z_TYPE_PP(dest_entry) != IS_ARRAY - ) { - (*src_entry)->refcount++; - if (key_type == HASH_KEY_IS_STRING) { - /* if register_globals is on and working with main symbol table, prevent overwriting of GLOBALS */ - if (!globals_check || string_key_len != sizeof("GLOBALS") || memcmp(string_key, "GLOBALS", sizeof("GLOBALS") - 1)) { - zend_hash_update(dest, string_key, string_key_len, src_entry, sizeof(zval *), NULL); - } else { - (*src_entry)->refcount--; - } - } else { - zend_hash_index_update(dest, num_key, src_entry, sizeof(zval *), NULL); - } - } else { - SEPARATE_ZVAL(dest_entry); - php_autoglobal_merge(Z_ARRVAL_PP(dest_entry), Z_ARRVAL_PP(src_entry) TSRMLS_CC); - } - zend_hash_move_forward_ex(src, &pos); - } -} -/* }}} */ - -static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC); -static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC); -static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC); - -/* {{{ php_hash_environment - */ -int php_hash_environment(TSRMLS_D) -{ - char *p; - unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; - zval *dummy_track_vars_array = NULL; - zend_bool initialized_dummy_track_vars_array=0; - zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays) && !PG(register_argc_argv)); - struct auto_global_record { - char *name; - uint name_len; - char *long_name; - uint long_name_len; - zend_bool jit_initialization; - } auto_global_records[] = { - { "_POST", sizeof("_POST"), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), 0 }, - { "_GET", sizeof("_GET"), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), 0 }, - { "_COOKIE", sizeof("_COOKIE"), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), 0 }, - { "_SERVER", sizeof("_SERVER"), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), 1 }, - { "_ENV", sizeof("_ENV"), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), 1 }, - { "_FILES", sizeof("_FILES"), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), 0 }, - }; - size_t num_track_vars = sizeof(auto_global_records)/sizeof(struct auto_global_record); - size_t i; - - /* jit_initialization = 0; */ - for (i=0; irefcount++; - } - PG(http_globals)[i] = dummy_track_vars_array; - } - - PG(http_globals)[i]->refcount++; - zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), auto_global_records[i].long_name, auto_global_records[i].long_name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - PG(http_globals)[i]->refcount++; - } - } - - /* Create _REQUEST */ - if (!jit_initialization) { - zend_auto_global_disable_jit("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); - php_auto_globals_create_request("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); - } - - return SUCCESS; -} -/* }}} */ - -static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC) -{ - if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) { - php_register_server_variables(TSRMLS_C); - } else { - zval *server_vars=NULL; - ALLOC_ZVAL(server_vars); - array_init(server_vars); - INIT_PZVAL(server_vars); - if (PG(http_globals)[TRACK_VARS_SERVER]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); - } - PG(http_globals)[TRACK_VARS_SERVER] = server_vars; - } - - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_SERVER]->refcount++; - - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_SERVER]->refcount++; - } - - return 0; /* don't rearm */ -} - -static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC) -{ - zval *env_vars = NULL; - ALLOC_ZVAL(env_vars); - array_init(env_vars); - INIT_PZVAL(env_vars); - if (PG(http_globals)[TRACK_VARS_ENV]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]); - } - PG(http_globals)[TRACK_VARS_ENV] = env_vars; - - if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) { - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); - } - - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_ENV]->refcount++; - - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_ENV]->refcount++; - } - - return 0; /* don't rearm */ -} - -static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC) -{ - zval *form_variables; - unsigned char _gpc_flags[3] = {0, 0, 0}; - char *p; - - ALLOC_ZVAL(form_variables); - array_init(form_variables); - INIT_PZVAL(form_variables); - - for (p = PG(variables_order); p && *p; p++) { - switch (*p) { - case 'g': - case 'G': - if (!_gpc_flags[0]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC); - _gpc_flags[0] = 1; - } - break; - case 'p': - case 'P': - if (!_gpc_flags[1]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC); - _gpc_flags[1] = 1; - } - break; - case 'c': - case 'C': - if (!_gpc_flags[2]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC); - _gpc_flags[2] = 1; - } - break; - } - } - - zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL); - return 0; -} - -void php_startup_auto_globals(TSRMLS_D) -{ - zend_register_auto_global("_GET", sizeof("_GET")-1, NULL TSRMLS_CC); - zend_register_auto_global("_POST", sizeof("_POST")-1, NULL TSRMLS_CC); - zend_register_auto_global("_COOKIE", sizeof("_COOKIE")-1, NULL TSRMLS_CC); - zend_register_auto_global("_SERVER", sizeof("_SERVER")-1, php_auto_globals_create_server TSRMLS_CC); - zend_register_auto_global("_ENV", sizeof("_ENV")-1, php_auto_globals_create_env TSRMLS_CC); - zend_register_auto_global("_REQUEST", sizeof("_REQUEST")-1, php_auto_globals_create_request TSRMLS_CC); - zend_register_auto_global("_FILES", sizeof("_FILES")-1, NULL TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_variables.h b/main/php_variables.h deleted file mode 100644 index 232b00c5ba2dc..0000000000000 --- a/main/php_variables.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_VARIABLES_H -#define PHP_VARIABLES_H - -#include "php.h" -#include "SAPI.h" - -#define PARSE_POST 0 -#define PARSE_GET 1 -#define PARSE_COOKIE 2 -#define PARSE_STRING 3 - -BEGIN_EXTERN_C() -void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC); -void php_startup_auto_globals(TSRMLS_D); -extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC); -PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array TSRMLS_DC); -/* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, pval *track_vars_array TSRMLS_DC); -PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array TSRMLS_DC); -PHPAPI void php_u_register_variable_safe(UChar *var, UChar *strval, int32_t str_len, zval *track_vars_array TSRMLS_DC); -PHPAPI void php_u_register_variable_ex(UChar *var, zval *val, pval *track_vars_array TSRMLS_DC); - -int php_hash_environment(TSRMLS_D); -END_EXTERN_C() - -#define NUM_TRACK_VARS 6 - -#endif /* PHP_VARIABLES_H */ diff --git a/main/php_version.h b/main/php_version.h deleted file mode 100644 index f801a280e8df8..0000000000000 --- a/main/php_version.h +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by configure */ -/* edit configure.in to change version number */ -#define PHP_MAJOR_VERSION 6 -#define PHP_MINOR_VERSION 0 -#define PHP_RELEASE_VERSION 0 -#define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "6.0.0-dev" diff --git a/main/reentrancy.c b/main/reentrancy.c deleted file mode 100644 index 6531eb0d0f363..0000000000000 --- a/main/reentrancy.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#ifdef HAVE_DIRENT_H -#include -#endif - -#ifdef PHP_WIN32 -#include "win32/readdir.h" -#endif - -#include "php_reentrancy.h" -#include "ext/standard/php_rand.h" /* for PHP_RAND_MAX */ - -enum { - LOCALTIME_R, - CTIME_R, - ASCTIME_R, - GMTIME_R, - READDIR_R, - NUMBER_OF_LOCKS -}; - -#if defined(PHP_NEED_REENTRANCY) - -#include - -static MUTEX_T reentrant_locks[NUMBER_OF_LOCKS]; - -#define local_lock(x) tsrm_mutex_lock(reentrant_locks[x]) -#define local_unlock(x) tsrm_mutex_unlock(reentrant_locks[x]) - -#else - -#define local_lock(x) -#define local_unlock(x) - -#endif - -#if defined(PHP_IRIX_TIME_R) - -#define HAVE_CTIME_R 1 -#define HAVE_ASCTIME_R 1 - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - if (ctime_r(clock, buf, 26) == buf) - return (buf); - return (NULL); -} - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - if (asctime_r(tm, buf, 26) == buf) - return (buf); - return (NULL); -} - -#endif - -#if defined(PHP_HPUX_TIME_R) - -#define HAVE_LOCALTIME_R 1 -#define HAVE_CTIME_R 1 -#define HAVE_ASCTIME_R 1 -#define HAVE_GMTIME_R 1 - -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm) -{ - if (localtime_r(timep, p_tm) == 0) - return (p_tm); - return (NULL); -} - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - if (ctime_r(clock, buf, 26) != -1) - return (buf); - return (NULL); -} - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - if (asctime_r(tm, buf, 26) != -1) - return (buf); - return (NULL); -} - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - if (gmtime_r(timep, p_tm) == 0) - return (p_tm); - return (NULL); -} - -#endif - -#if defined(__BEOS__) - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - /* Modified according to LibC definition */ - if (((struct tm*)gmtime_r(timep, p_tm)) == p_tm) - return (p_tm); - return (NULL); -} - -#endif /* BEOS */ - -#if !defined(HAVE_POSIX_READDIR_R) - -PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, - struct dirent **result) -{ -#if defined(HAVE_OLD_READDIR_R) - int ret = 0; - - /* We cannot rely on the return value of readdir_r - as it differs between various platforms - (HPUX returns 0 on success whereas Solaris returns non-zero) - */ - entry->d_name[0] = '\0'; - readdir_r(dirp, entry); - - if (entry->d_name[0] == '\0') { - *result = NULL; - ret = errno; - } else { - *result = entry; - } - return ret; -#else - struct dirent *ptr; - int ret = 0; - - local_lock(READDIR_R); - - errno = 0; - - ptr = readdir(dirp); - - if (!ptr && errno != 0) - ret = errno; - - if (ptr) - memcpy(entry, ptr, sizeof(*ptr)); - - *result = ptr; - - local_unlock(READDIR_R); - - return ret; -#endif -} - -#endif - -#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME) - -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm) -{ - struct tm *tmp; - - local_lock(LOCALTIME_R); - - tmp = localtime(timep); - if (tmp) { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - - local_unlock(LOCALTIME_R); - - return tmp; -} - -#endif - -#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME) - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - char *tmp; - - local_lock(CTIME_R); - - tmp = ctime(clock); - strcpy(buf, tmp); - - local_unlock(CTIME_R); - - return buf; -} - -#endif - -#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME) - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - char *tmp; - - local_lock(ASCTIME_R); - - tmp = asctime(tm); - strcpy(buf, tmp); - - local_unlock(ASCTIME_R); - - return buf; -} - -#endif - -#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - struct tm *tmp; - - local_lock(GMTIME_R); - - tmp = gmtime(timep); - if (tmp) { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - - local_unlock(GMTIME_R); - - return tmp; -} - -#endif - -#if defined(PHP_NEED_REENTRANCY) - -void reentrancy_startup(void) -{ - int i; - - for (i = 0; i < NUMBER_OF_LOCKS; i++) { - reentrant_locks[i] = tsrm_mutex_alloc(); - } -} - -void reentrancy_shutdown(void) -{ - int i; - - for (i = 0; i < NUMBER_OF_LOCKS; i++) { - tsrm_mutex_free(reentrant_locks[i]); - } -} - -#endif - -#ifndef HAVE_RAND_R - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * Posix rand_r function added May 1999 by Wes Peters . - */ - -#include -#include - -static int -do_rand(unsigned long *ctx) -{ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)PHP_RAND_MAX + 1)); -} - - -PHPAPI int -php_rand_r(unsigned int *ctx) -{ - u_long val = (u_long) *ctx; - *ctx = do_rand(&val); - return (int) *ctx; -} - -#endif - - -#ifndef HAVE_STRTOK_R - -/* - * Copyright (c) 1998 Softweyr LLC. All rights reserved. - * - * strtok_r, from Berkeley strtok - * Oct 13, 1998 by Wes Peters - * - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notices, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notices, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by Softweyr LLC, the - * University of California, Berkeley, and its contributors. - * - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS 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 SOFTWEYR LLC, THE - * REGENTS, 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. - */ - -#include - -PHPAPI char * -php_strtok_r(char *s, const char *delim, char **last) -{ - char *spanp; - int c, sc; - char *tok; - - if (s == NULL && (s = *last) == NULL) - { - return NULL; - } - - /* - * Skip (span) leading delimiters (s += strspn(s, delim), sort of). - */ -cont: - c = *s++; - for (spanp = (char *)delim; (sc = *spanp++) != 0; ) - { - if (c == sc) - { - goto cont; - } - } - - if (c == 0) /* no non-delimiter characters */ - { - *last = NULL; - return NULL; - } - tok = s - 1; - - /* - * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). - * Note that delim must have one NUL; we stop if we see that, too. - */ - for (;;) - { - c = *s++; - spanp = (char *)delim; - do - { - if ((sc = *spanp++) == c) - { - if (c == 0) - { - s = NULL; - } - else - { - char *w = s - 1; - *w = '\0'; - } - *last = s; - return tok; - } - } - while (sc != 0); - } - /* NOTREACHED */ -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/rfc1867.c b/main/rfc1867.c deleted file mode 100644 index 54edfec2665ae..0000000000000 --- a/main/rfc1867.c +++ /dev/null @@ -1,2009 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Jani Taskinen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/). - * - */ - -#include -#include "php.h" -#include "php_open_temporary_file.h" -#include "zend_globals.h" -#include "php_globals.h" -#include "php_variables.h" -#include "rfc1867.h" - -#define DEBUG_FILE_UPLOAD ZEND_DEBUG - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) -#include "ext/mbstring/mbstring.h" - -static void safe_php_register_variable(char *var, char *strval, zval *track_vars_array, zend_bool override_protection TSRMLS_DC); - -#define SAFE_RETURN { \ - php_mb_flush_gpc_variables(num_vars, val_list, len_list, array_ptr TSRMLS_CC); \ - if (lbuf) efree(lbuf); \ - if (abuf) efree(abuf); \ - if (array_index) efree(array_index); \ - zend_hash_destroy(&PG(rfc1867_protected_variables)); \ - zend_llist_destroy(&header); \ - if (mbuff->boundary_next) efree(mbuff->boundary_next); \ - if (mbuff->boundary) efree(mbuff->boundary); \ - if (mbuff->buffer) efree(mbuff->buffer); \ - if (mbuff) efree(mbuff); \ - return; } - -void php_mb_flush_gpc_variables(int num_vars, char **val_list, int *len_list, zval *array_ptr TSRMLS_DC) -{ - int i; - if (php_mb_encoding_translation(TSRMLS_C)) { - if (num_vars > 0 && - php_mb_gpc_encoding_detector(val_list, len_list, num_vars, NULL TSRMLS_CC) == SUCCESS) { - php_mb_gpc_encoding_converter(val_list, len_list, num_vars, NULL, NULL TSRMLS_CC); - } - for (i=0; i=*num_vars_max){ - php_mb_gpc_realloc_buffer(pval_list, plen_list, num_vars_max, - 16 TSRMLS_CC); - /* in case realloc relocated the buffer */ - val_list = *pval_list; - len_list = *plen_list; - } - - val_list[*num_vars] = (char *)estrdup(param); - len_list[*num_vars] = strlen(param); - (*num_vars)++; - val_list[*num_vars] = (char *)estrdup(value); - len_list[*num_vars] = strlen(value); - (*num_vars)++; -} - -#else - -#define SAFE_RETURN { \ - if (lbuf) efree(lbuf); \ - if (abuf) efree(abuf); \ - if (array_index) efree(array_index); \ - zend_hash_destroy(&PG(rfc1867_protected_variables)); \ - zend_llist_destroy(&header); \ - if (mbuff->boundary_next) efree(mbuff->boundary_next); \ - if (mbuff->boundary) efree(mbuff->boundary); \ - if (mbuff->buffer) efree(mbuff->buffer); \ - if (mbuff) efree(mbuff); \ - return; } -#endif - -/* The longest property name we use in an uploaded file array */ -#define MAX_SIZE_OF_INDEX sizeof("[tmp_name]") - -/* The longest anonymous name */ -#define MAX_SIZE_ANONNAME 33 - -/* Errors */ -#define UPLOAD_ERROR_OK 0 /* File upload succesful */ -#define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ -#define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ -#define UPLOAD_ERROR_C 3 /* Partially uploaded */ -#define UPLOAD_ERROR_D 4 /* No file uploaded */ -#define UPLOAD_ERROR_E 6 /* Missing /tmp or similar directory */ -#define UPLOAD_ERROR_F 7 /* Failed to write file to disk */ - -void php_rfc1867_register_constants(TSRMLS_D) -{ - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_OK", UPLOAD_ERROR_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_INI_SIZE", UPLOAD_ERROR_A, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_FORM_SIZE", UPLOAD_ERROR_B, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_PARTIAL", UPLOAD_ERROR_C, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_NO_FILE", UPLOAD_ERROR_D, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_NO_TMP_DIR", UPLOAD_ERROR_E, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_CANT_WRITE", UPLOAD_ERROR_F, CONST_CS | CONST_PERSISTENT); -} - -static void normalize_protected_variable(char *varname TSRMLS_DC) -{ - char *s=varname, *index=NULL, *indexend=NULL, *p; - - /* overjump leading space */ - while (*s == ' ') { - s++; - } - - /* and remove it */ - if (s != varname) { - memmove(varname, s, strlen(s)+1); - } - - for (p=varname; *p && *p != '['; p++) { - switch(*p) { - case ' ': - case '.': - *p='_'; - break; - } - } - - /* find index */ - index = strchr(varname, '['); - if (index) { - index++; - s=index; - } else { - return; - } - - /* done? */ - while (index) { - - while (*index == ' ' || *index == '\r' || *index == '\n' || *index=='\t') { - index++; - } - indexend = strchr(index, ']'); - indexend = indexend ? indexend + 1 : index + strlen(index); - - if (s != index) { - memmove(s, index, strlen(index)+1); - s += indexend-index; - } else { - s = indexend; - } - - if (*s == '[') { - s++; - index = s; - } else { - index = NULL; - } - } - *s++='\0'; -} - - -static void normalize_u_protected_variable(UChar *varname TSRMLS_DC) -{ - UChar *s=varname, *index=NULL, *indexend=NULL, *p; - - /* overjump leading space */ - while (*s == 0x20 /*' '*/) { - s++; - } - - /* and remove it */ - if (s != varname) { - u_memmove(varname, s, u_strlen(s)+1); - } - - for (p=varname; *p && *p != 0x5b /*'['*/; p++) { - switch(*p) { - case 0x20: /*' '*/ - case 0x2e: /*'.'*/ - *p=0x5f; /*'_'*/ - break; - } - } - - /* find index */ - index = u_strchr(varname, 0x5b /*'['*/); - if (index) { - index++; - s=index; - } else { - return; - } - - /* done? */ - while (index) { - - while (*index == 0x20 /*' '*/ || - *index == 0x0d /*'\r'*/ || - *index == 0x0a /*'\n'*/ || - *index == 0x09 /*'\t'*/) { - index++; - } - indexend = u_strchr(index, 0x5d /*']'*/); - indexend = indexend ? indexend + 1 : index + u_strlen(index); - - if (s != index) { - u_memmove(s, index, u_strlen(index)+1); - s += indexend-index; - } else { - s = indexend; - } - - if (*s == 0x5b /*'['*/) { - s++; - index = s; - } else { - index = NULL; - } - } - *s++ = 0; -} - -static void add_protected_variable(char *varname TSRMLS_DC) -{ - int dummy=1; - - normalize_protected_variable(varname TSRMLS_CC); - zend_hash_add(&PG(rfc1867_protected_variables), varname, strlen(varname)+1, &dummy, sizeof(int), NULL); -} - - -static void add_u_protected_variable(UChar *varname TSRMLS_DC) -{ - int dummy=1; - - normalize_u_protected_variable(varname TSRMLS_CC); - zend_u_hash_add(&PG(rfc1867_protected_variables), IS_UNICODE, varname, u_strlen(varname)+1, &dummy, sizeof(int), NULL); -} - - -static zend_bool is_protected_variable(char *varname TSRMLS_DC) -{ - normalize_protected_variable(varname TSRMLS_CC); - return zend_hash_exists(&PG(rfc1867_protected_variables), varname, strlen(varname)+1); -} - - -static zend_bool is_u_protected_variable(UChar *varname TSRMLS_DC) -{ - normalize_u_protected_variable(varname TSRMLS_CC); - return zend_u_hash_exists(&PG(rfc1867_protected_variables), IS_UNICODE, varname, u_strlen(varname)+1); -} - - -static void safe_php_register_variable(char *var, char *strval, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_protected_variable(var TSRMLS_CC)) { - php_register_variable(var, strval, track_vars_array TSRMLS_CC); - } -} - - -static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_protected_variable(var TSRMLS_CC)) { - php_register_variable_ex(var, val, track_vars_array TSRMLS_CC); - } -} - - -static void safe_u_php_register_variable(UChar *var, UChar *str_val, int32_t str_len, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_u_protected_variable(var TSRMLS_CC)) { - php_u_register_variable_safe(var, str_val, str_len, track_vars_array TSRMLS_CC); - } -} - - -static void safe_u_php_register_variable_ex(UChar *var, zval *val, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_u_protected_variable(var TSRMLS_CC)) { - php_u_register_variable_ex(var, val, track_vars_array TSRMLS_CC); - } -} - - -static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_php_register_variable(strvar, val, http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static void register_u_http_post_files_variable(UChar *strvar, UChar *val, int32_t val_len, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_u_php_register_variable(strvar, val, val_len, http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static void register_u_http_post_files_variable_ex(UChar *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_u_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static int unlink_filename(char **filename TSRMLS_DC) -{ - VCWD_UNLINK(*filename); - return 0; -} - - -void destroy_uploaded_files_hash(TSRMLS_D) -{ - zend_hash_apply(SG(rfc1867_uploaded_files), (apply_func_t) unlink_filename TSRMLS_CC); - zend_hash_destroy(SG(rfc1867_uploaded_files)); - FREE_HASHTABLE(SG(rfc1867_uploaded_files)); -} - - -static inline UChar *php_ap_to_unicode(char *in, int32_t in_len, int32_t *out_len TSRMLS_DC) -{ - UErrorCode status = U_ZERO_ERROR; - UChar *buf; - int32_t buf_len = 0; - UConverter *input_conv = UG(http_input_encoding_conv); - - if (!input_conv) { - input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - } - - input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - zend_convert_to_unicode(input_conv, &buf, &buf_len, in, in_len, &status); - if (U_SUCCESS(status)) { - if (out_len) - *out_len = buf_len; - return buf; - } else { - efree(buf); - if (out_len) - *out_len = 0; - return NULL; - } -} - - -/* - * Following code is based on apache_multipart_buffer.c from libapreq-0.33 package. - * - */ - -#define FILLUNIT (1024 * 5) - -typedef struct { - - /* read buffer */ - char *buffer; - char *buf_begin; - int bufsize; - int bytes_in_buffer; - - /* boundary info */ - char *boundary; - char *boundary_next; - int boundary_next_len; - -} multipart_buffer; - - -typedef struct { - char *key; - char *value; -} mime_header_entry; - - -/* - fill up the buffer with client data. - returns number of bytes added to buffer. -*/ -static int fill_buffer(multipart_buffer *self TSRMLS_DC) -{ - int bytes_to_read, total_read = 0, actual_read = 0; - static zend_bool done = 0; - - /* shift the existing data if necessary */ - if (self->bytes_in_buffer > 0 && self->buf_begin != self->buffer) { - memmove(self->buffer, self->buf_begin, self->bytes_in_buffer); - } - - self->buf_begin = self->buffer; - - /* calculate the free space in the buffer */ - bytes_to_read = self->bufsize - self->bytes_in_buffer; - - /* read the required number of bytes */ - while (bytes_to_read > 0) { - - char *buf = self->buffer + self->bytes_in_buffer; - - actual_read = sapi_module.read_post(buf, bytes_to_read TSRMLS_CC); - - /* update the buffer length */ - if (actual_read > 0) { - self->bytes_in_buffer += actual_read; - SG(read_post_bytes) += actual_read; - total_read += actual_read; - bytes_to_read -= actual_read; - } else { - if (!done) { - fprintf(stderr, "\n###################\n%s\n#################\n", self->buffer); - done = 1; - } - break; - } - } - - return total_read; -} - - -/* eof if we are out of bytes, or if we hit the final boundary */ -static int multipart_buffer_eof(multipart_buffer *self TSRMLS_DC) -{ - if ( (self->bytes_in_buffer == 0 && fill_buffer(self TSRMLS_CC) < 1) ) { - return 1; - } else { - return 0; - } -} - - -/* create new multipart_buffer structure */ -static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len) -{ - multipart_buffer *self = (multipart_buffer *) ecalloc(1, sizeof(multipart_buffer)); - - int minsize = boundary_len + 6; - if (minsize < FILLUNIT) minsize = FILLUNIT; - - self->buffer = (char *) ecalloc(1, minsize + 1); - self->bufsize = minsize; - - self->boundary = (char *) ecalloc(1, boundary_len + 3); - sprintf(self->boundary, "--%s", boundary); - - self->boundary_next = (char *) ecalloc(1, boundary_len + 4); - sprintf(self->boundary_next, "\n--%s", boundary); - self->boundary_next_len = boundary_len + 3; - - self->buf_begin = self->buffer; - self->bytes_in_buffer = 0; - - return self; -} - - -/* - gets the next CRLF terminated line from the input buffer. - if it doesn't find a CRLF, and the buffer isn't completely full, returns - NULL; otherwise, returns the beginning of the null-terminated line, - minus the CRLF. - - note that we really just look for LF terminated lines. this works - around a bug in internet explorer for the macintosh which sends mime - boundaries that are only LF terminated when you use an image submit - button in a multipart/form-data form. - */ -static char *next_line(multipart_buffer *self) -{ - /* look for LF in the data */ - char* line = self->buf_begin; - char* ptr = memchr(self->buf_begin, '\n', self->bytes_in_buffer); - - if (ptr) { /* LF found */ - - /* terminate the string, remove CRLF */ - if ((ptr - line) > 0 && *(ptr-1) == '\r') { - *(ptr-1) = 0; - } else { - *ptr = 0; - } - - /* bump the pointer */ - self->buf_begin = ptr + 1; - self->bytes_in_buffer -= (self->buf_begin - line); - - } else { /* no LF found */ - - /* buffer isn't completely full, fail */ - if (self->bytes_in_buffer < self->bufsize) { - return NULL; - } - /* return entire buffer as a partial line */ - line[self->bufsize] = 0; - self->buf_begin = ptr; - self->bytes_in_buffer = 0; - } - - return line; -} - - -/* returns the next CRLF terminated line from the client */ -static char *get_line(multipart_buffer *self TSRMLS_DC) -{ - char* ptr = next_line(self); - - if (!ptr) { - fill_buffer(self TSRMLS_CC); - ptr = next_line(self); - } - - return ptr; -} - - -/* Free header entry */ -static void php_free_hdr_entry(mime_header_entry *h) -{ - if (h->key) { - efree(h->key); - } - if (h->value) { - efree(h->value); - } -} - - -/* finds a boundary */ -static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC) -{ - char *line; - - /* loop thru lines */ - while( (line = get_line(self TSRMLS_CC)) ) - { - /* finished if we found the boundary */ - if (!strcmp(line, boundary)) { - return 1; - } - } - - /* didn't find the boundary */ - return 0; -} - - -/* parse headers */ -static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) -{ - char *line; - mime_header_entry prev_entry, entry; - int prev_len, cur_len; - - /* didn't find boundary, abort */ - if (!find_boundary(self, self->boundary TSRMLS_CC)) { - return 0; - } - - /* get lines of text, or CRLF_CRLF */ - - while( (line = get_line(self TSRMLS_CC)) && strlen(line) > 0 ) - { - /* add header to table */ - - char *key = line; - char *value = NULL; - - /* space in the beginning means same header */ - if (!isspace(line[0])) { - value = strchr(line, ':'); - } - - if (value) { - *value = 0; - do { value++; } while(isspace(*value)); - - entry.value = estrdup(value); - entry.key = estrdup(key); - - } else if (zend_llist_count(header)) { /* If no ':' on the line, add to previous line */ - - prev_len = strlen(prev_entry.value); - cur_len = strlen(line); - - entry.value = emalloc(prev_len + cur_len + 1); - memcpy(entry.value, prev_entry.value, prev_len); - memcpy(entry.value + prev_len, line, cur_len); - entry.value[cur_len + prev_len] = '\0'; - - entry.key = estrdup(prev_entry.key); - - zend_llist_remove_tail(header); - } else { - continue; - } - - zend_llist_add_element(header, &entry); - prev_entry = entry; - } - - return 1; -} - - -static char *php_mime_get_hdr_value(zend_llist header, char *key) -{ - mime_header_entry *entry; - - if (key == NULL) { - return NULL; - } - - entry = zend_llist_get_first(&header); - while (entry) { - if (!strcasecmp(entry->key, key)) { - return entry->value; - } - entry = zend_llist_get_next(&header); - } - - return NULL; -} - - -static UChar *php_u_ap_getword(UChar **line, UChar stop TSRMLS_DC) -{ - UChar *pos = *line, quote; - UChar *res; - - while (*pos && *pos != stop) { - - if ((quote = *pos) == '"' || quote == '\'') { - ++pos; - while (*pos && *pos != quote) { - if (*pos == '\\' && pos[1] && pos[1] == quote) { - pos += 2; - } else { - ++pos; - } - } - if (*pos) { - ++pos; - } - } else ++pos; - - } - if (*pos == '\0') { - res = eustrdup(*line); - *line += u_strlen(*line); - return res; - } - - res = eustrndup(*line, pos - *line); - - while (*pos == stop) { - ++pos; - } - - *line = pos; - return res; -} - - -static char *php_ap_getword(char **line, char stop) -{ - char *pos = *line, quote; - char *res; - - while (*pos && *pos != stop) { - - if ((quote = *pos) == '"' || quote == '\'') { - ++pos; - while (*pos && *pos != quote) { - if (*pos == '\\' && pos[1] && pos[1] == quote) { - pos += 2; - } else { - ++pos; - } - } - if (*pos) { - ++pos; - } - } else ++pos; - - } - if (*pos == '\0') { - res = estrdup(*line); - *line += strlen(*line); - return res; - } - - res = estrndup(*line, pos - *line); - - while (*pos == stop) { - ++pos; - } - - *line = pos; - return res; -} - - -static UChar *substring_u_conf(UChar *start, int32_t len, UChar quote TSRMLS_DC) -{ - UChar *result = eumalloc(len + 2); - UChar *resp = result; - int32_t i; - - for (i = 0; i < len; ++i) { - if (start[i] == '\\' && (start[i + 1] == '\\' || (quote && start[i + 1] == quote))) { - *resp++ = start[++i]; - } else { - *resp++ = start[i]; - } - } - - *resp++ = 0; - return result; -} - - -static char *substring_conf(char *start, int len, char quote TSRMLS_DC) -{ - char *result = emalloc(len + 2); - char *resp = result; - int i; - - for (i = 0; i < len; ++i) { - if (start[i] == '\\' && (start[i + 1] == '\\' || (quote && start[i + 1] == quote))) { - *resp++ = start[++i]; - } else { -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - size_t j = php_mb_gpc_mbchar_bytes(start+i TSRMLS_CC); - while (j-- > 0 && i < len) { - *resp++ = start[i++]; - } - --i; - } else { - *resp++ = start[i]; - } -#else - *resp++ = start[i]; -#endif - } - } - - *resp++ = '\0'; - return result; -} - - -static UChar *php_u_ap_getword_conf(UChar **line TSRMLS_DC) -{ - UChar *str = *line, *strend, *res, quote; - - while (*str && u_isspace(*str)) { - ++str; - } - - if (!*str) { - *line = str; - return USTR_MAKE(""); - } - - if ((quote = *str) == '"' || quote == '\'') { - strend = str + 1; -look_for_quote: - while (*strend && *strend != quote) { - if (*strend == '\\' && strend[1] && strend[1] == quote) { - strend += 2; - } else { - ++strend; - } - } - if (*strend && *strend == quote) { - UChar p = *(strend + 1); - if (p != '\r' && p != '\n' && p != '\0') { - strend++; - goto look_for_quote; - } - } - - res = substring_u_conf(str + 1, strend - str - 1, quote TSRMLS_CC); - - if (*strend == quote) { - ++strend; - } - - } else { - - strend = str; - while (*strend && !u_isspace(*strend)) { - ++strend; - } - res = substring_u_conf(str, strend - str, 0 TSRMLS_CC); - } - - while (*strend && u_isspace(*strend)) { - ++strend; - } - - *line = strend; - return res; -} - - -static char *php_ap_getword_conf(char **line TSRMLS_DC) -{ - char *str = *line, *strend, *res, quote; - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - int len=strlen(str); - php_mb_gpc_encoding_detector(&str, &len, 1, NULL TSRMLS_CC); - } -#endif - - while (*str && isspace(*str)) { - ++str; - } - - if (!*str) { - *line = str; - return estrdup(""); - } - - if ((quote = *str) == '"' || quote == '\'') { - strend = str + 1; -look_for_quote: - while (*strend && *strend != quote) { - if (*strend == '\\' && strend[1] && strend[1] == quote) { - strend += 2; - } else { - ++strend; - } - } - if (*strend && *strend == quote) { - char p = *(strend + 1); - if (p != '\r' && p != '\n' && p != '\0') { - strend++; - goto look_for_quote; - } - } - - res = substring_conf(str + 1, strend - str - 1, quote TSRMLS_CC); - - if (*strend == quote) { - ++strend; - } - - } else { - - strend = str; - while (*strend && !isspace(*strend)) { - ++strend; - } - res = substring_conf(str, strend - str, 0 TSRMLS_CC); - } - - while (*strend && isspace(*strend)) { - ++strend; - } - - *line = strend; - return res; -} - - -/* - search for a string in a fixed-length byte string. - if partial is true, partial matches are allowed at the end of the buffer. - returns NULL if not found, or a pointer to the start of the first match. -*/ -static void *php_ap_memstr(char *haystack, int haystacklen, char *needle, int needlen, int partial) -{ - int len = haystacklen; - char *ptr = haystack; - - /* iterate through first character matches */ - while( (ptr = memchr(ptr, needle[0], len)) ) { - - /* calculate length after match */ - len = haystacklen - (ptr - (char *)haystack); - - /* done if matches up to capacity of buffer */ - if (memcmp(needle, ptr, needlen < len ? needlen : len) == 0 && (partial || len >= needlen)) { - break; - } - - /* next character */ - ptr++; len--; - } - - return ptr; -} - - -/* read until a boundary condition */ -static int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes, int *end TSRMLS_DC) -{ - int len, max; - char *bound; - - /* fill buffer if needed */ - if (bytes > self->bytes_in_buffer) { - fill_buffer(self TSRMLS_CC); - } - - /* look for a potential boundary match, only read data up to that point */ - if ((bound = php_ap_memstr(self->buf_begin, self->bytes_in_buffer, self->boundary_next, self->boundary_next_len, 1))) { - max = bound - self->buf_begin; - if (end && php_ap_memstr(self->buf_begin, self->bytes_in_buffer, self->boundary_next, self->boundary_next_len, 0)) { - *end = 1; - } - } else { - max = self->bytes_in_buffer; - } - - /* maximum number of bytes we are reading */ - len = max < bytes-1 ? max : bytes-1; - - /* if we read any data... */ - if (len > 0) { - - /* copy the data */ - memcpy(buf, self->buf_begin, len); - buf[len] = 0; - - if (bound && len > 0 && buf[len-1] == '\r') { - buf[--len] = 0; - } - - /* update the buffer */ - self->bytes_in_buffer -= len; - self->buf_begin += len; - } - - return len; -} - - -/* - XXX: this is horrible memory-usage-wise, but we only expect - to do this on small pieces of form data. -*/ -static char *multipart_buffer_read_body(multipart_buffer *self TSRMLS_DC) -{ - char buf[FILLUNIT], *out=NULL; - int total_bytes=0, read_bytes=0; - - while((read_bytes = multipart_buffer_read(self, buf, sizeof(buf), NULL TSRMLS_CC))) { - out = erealloc(out, total_bytes + read_bytes + 1); - memcpy(out + total_bytes, buf, read_bytes); - total_bytes += read_bytes; - } - - if (out) out[total_bytes] = '\0'; - - return out; -} - -static SAPI_POST_HANDLER_FUNC(rfc1867_post_handler_unicode) -{ - char *boundary, *boundary_end = NULL; - UChar *temp_filename=NULL, *array_index = NULL, *lbuf = NULL, *abuf = NULL; - UChar *start_arr = NULL, *s = NULL; - char *ascii_temp_filename = NULL; - int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0; - int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous; - zval *http_post_files=NULL; HashTable *uploaded_files=NULL; - zend_bool magic_quotes_gpc; - multipart_buffer *mbuff; - zval *array_ptr = (zval *) arg; - FILE *fp; - zend_llist header; - UConverter *input_conv = UG(http_input_encoding_conv); - U_STRING_DECL(name_key, "name", 4); - U_STRING_DECL(filename_key, "filename", 8); - U_STRING_DECL(maxfilesize_key, "MAX_FILE_SIZE", 13); - static zend_bool did_string_init = FALSE; - - if (SG(request_info).content_length > SG(post_max_size)) { - sapi_module.sapi_error(E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); - return; - } - - /* Get the boundary */ - boundary = strstr(content_type_dup, "boundary"); - if (!boundary || !(boundary=strchr(boundary, '='))) { - sapi_module.sapi_error(E_WARNING, "Missing boundary in multipart/form-data POST data"); - return; - } - - boundary++; - boundary_len = strlen(boundary); - - if (boundary[0] == '"') { - boundary++; - boundary_end = strchr(boundary, '"'); - if (!boundary_end) { - sapi_module.sapi_error(E_WARNING, "Invalid boundary in multipart/form-data POST data"); - return; - } - } else { - /* search for the end of the boundary */ - boundary_end = strchr(boundary, ','); - } - if (boundary_end) { - boundary_end[0] = '\0'; - boundary_len = boundary_end-boundary; - } - - /* Initialize the buffer */ - if (!(mbuff = multipart_buffer_new(boundary, boundary_len))) { - sapi_module.sapi_error(E_WARNING, "Unable to initialize the input buffer"); - return; - } - - /* Initialize $_FILES[] */ - zend_u_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0, 1); - - ALLOC_HASHTABLE(uploaded_files); - zend_u_hash_init(uploaded_files, 5, NULL, (dtor_func_t) free_estring, 0, 1); - SG(rfc1867_uploaded_files) = uploaded_files; - - ALLOC_ZVAL(http_post_files); - array_init(http_post_files); - INIT_PZVAL(http_post_files); - PG(http_globals)[TRACK_VARS_FILES] = http_post_files; - - zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t) php_free_hdr_entry, 0); - - if (!did_string_init) { - U_STRING_INIT(name_key, "name", 4); - U_STRING_INIT(filename_key, "filename", 8); - U_STRING_INIT(maxfilesize_key, "MAX_FILE_SIZE", 13); - did_string_init = TRUE; - } - - if (!input_conv) { - input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - } - - while (!multipart_buffer_eof(mbuff TSRMLS_CC)) - { - char buff[FILLUNIT]; - char *cd=NULL; - int blen=0, wlen=0; - UChar *param = NULL, *filename = NULL, *tmp = NULL; - int32_t param_len; - - zend_llist_clean(&header); - - if (!multipart_buffer_headers(mbuff, &header TSRMLS_CC)) { - SAFE_RETURN; - } - - if ((cd = php_mime_get_hdr_value(header, "Content-Disposition"))) { - UChar *pair = NULL; - UChar *ucd = NULL, *ucd_start = NULL; - int32_t ucd_len; - int end=0; - - while (isspace(*cd)) { - ++cd; - } - - ucd_start = php_ap_to_unicode(cd, strlen(cd), &ucd_len TSRMLS_CC); - if (!ucd) { - /* UTODO error condition */ - } - ucd = ucd_start; - - while (*ucd && (pair = php_u_ap_getword(&ucd, 0x3b /*';'*/ TSRMLS_CC))) - { - UChar *key=NULL, *word = pair; - - while (u_isspace(*ucd)) { - ++ucd; - } - - if (u_strchr(pair, '=')) { - key = php_u_ap_getword(&pair, 0x3d /*'='*/ TSRMLS_CC); - - if (!u_strcasecmp(key, name_key, 0)) { - if (param) { - efree(param); - } - param = php_u_ap_getword_conf(&pair TSRMLS_CC); - } else if (!u_strcasecmp(key, filename_key, 0)) { - if (filename) { - efree(filename); - } - filename = php_u_ap_getword_conf(&pair TSRMLS_CC); - } - } - if (key) { - efree(key); - } - efree(word); - } - - efree(ucd_start); - - /* Normal form variable, safe to read all data into memory */ - if (!filename && param) { - UChar *u_val; - int32_t u_val_len; - UErrorCode status = U_ZERO_ERROR; - - char *value = multipart_buffer_read_body(mbuff TSRMLS_CC); - unsigned int new_val_len; /* Dummy variable */ - - if (value) { - /* UTODO use 'charset' parameter for conversion */ - zend_convert_to_unicode(input_conv, &u_val, &u_val_len, value, strlen(value), &status); - if (U_FAILURE(status)) { - /* UTODO set a user-accessible flag to indicate that conversion failed? */ - goto var_done; - } - } else { - u_val = USTR_MAKE(""); - } - - /* UTODO use input filtering */ - //if (sapi_module.input_filter(PARSE_POST, param, &value, strlen(value), &new_val_len TSRMLS_CC)) { - safe_u_php_register_variable(param, u_val, u_val_len, array_ptr, 0 TSRMLS_CC); - //} - if (!u_strcasecmp(param, maxfilesize_key, 0)) { - max_file_size = zend_u_strtol(u_val, NULL, 10); - } - -var_done: - efree(param); - efree(value); - efree(u_val); - continue; - } - - /* If file_uploads=off, skip the file part */ - if (!PG(file_uploads)) { - skip_upload = 1; - } - - /* Return with an error if the posted data is garbled */ - if (!param && !filename) { - sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled"); - SAFE_RETURN; - } - - if (!param) { - is_anonymous = 1; - param = eumalloc(MAX_SIZE_ANONNAME); - u_snprintf(param, MAX_SIZE_ANONNAME, "%u", anonindex++); - } else { - is_anonymous = 0; - } - param_len = u_strlen(param); - - /* New Rule: never repair potential malicious user input */ - if (!skip_upload) { - UChar32 c = 0; - int32_t ic, l_ic; - long l = 0; - - for (ic = 0; ic < param_len; ) { - l_ic = ic; - U16_NEXT(param, ic, param_len, c); - if (c == 0x5b /*'['*/) { - l++; - } else if (c == 0x5d /*']'*/) { - l--; - l_ic = ic; - U16_NEXT(param, ic, param_len, c); - if (ic < param_len && c != 0x5b /*'['*/) { - skip_upload = 1; - break; - } else { - /* go back so that the same character is retrieved again */ - ic = l_ic; - } - } - if (l < 0) { - skip_upload = 1; - break; - } - } - } - - total_bytes = cancel_upload = 0; - - if (!skip_upload) { - /* Handle file */ - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &ascii_temp_filename TSRMLS_CC); - if (!fp) { - sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file"); - cancel_upload = UPLOAD_ERROR_E; - } - temp_filename = zend_ascii_to_unicode(ascii_temp_filename, strlen(ascii_temp_filename)+1 ZEND_FILE_LINE_CC); - } - if (skip_upload) { - efree(param); - efree(filename); - continue; - } - - if(u_strlen(filename) == 0) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "No file uploaded"); -#endif - cancel_upload = UPLOAD_ERROR_D; - } - - end = 0; - while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC))) - { - if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%r=%r] not saved", PG(upload_max_filesize), param, filename); -#endif - cancel_upload = UPLOAD_ERROR_A; - } else if (max_file_size && (total_bytes > max_file_size)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%r=%r] not saved", max_file_size, param, filename); -#endif - cancel_upload = UPLOAD_ERROR_B; - } else if (blen > 0) { - wlen = fwrite(buff, 1, blen, fp); - - if (wlen < blen) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %d", wlen, blen); -#endif - cancel_upload = UPLOAD_ERROR_C; - } else { - total_bytes += wlen; - } - } - } - if (fp) { /* may not be initialized if file could not be created */ - fclose(fp); - } - if (!cancel_upload && !end) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Missing mime boundary at the end of the data for file %v", u_strlen(filename) > 0 ? filename : EMPTY_STR); -#endif - cancel_upload = UPLOAD_ERROR_C; - } -#if DEBUG_FILE_UPLOAD - if(u_strlen(filename) > 0 && total_bytes == 0 && !cancel_upload) { - sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%r=%r] not saved", param, filename); - cancel_upload = 5; - } -#endif - - if (cancel_upload) { - if (temp_filename) { - if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */ - unlink(ascii_temp_filename); - } - efree(ascii_temp_filename); - efree(temp_filename); - } - temp_filename = EMPTY_STR; - } else { - zend_u_hash_add(SG(rfc1867_uploaded_files), IS_UNICODE, temp_filename, u_strlen(temp_filename) + 1, &temp_filename, sizeof(UChar *), NULL); - } - - /* is_arr_upload is true when name of file upload field - * ends in [.*] - * start_arr is set to point to 1st [ - */ - is_arr_upload = (start_arr = u_strchr(param, 0x5b /*'['*/)) && (param[u_strlen(param)-1] == 0x5d /*']'*/); - - if (is_arr_upload) { - array_len = u_strlen(start_arr); - if (array_index) { - efree(array_index); - } - array_index = eustrndup(start_arr+1, array_len-2); - } - - /* Add $foo_name */ - if (lbuf) { - efree(lbuf); - } - lbuf = eumalloc(u_strlen(param) + MAX_SIZE_OF_INDEX + 1); - - if (is_arr_upload) { - if (abuf) efree(abuf); - abuf = eustrndup(param, u_strlen(param)-array_len); - u_sprintf(lbuf, "%S_name[%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S_name", param); - } - - /* The \ check should technically be needed for win32 systems only where - * it is a valid path separator. However, IE in all it's wisdom always sends - * the full path of the file on the user's filesystem, which means that unless - * the user does basename() they get a bogus file name. Until IE's user base drops - * to nill or problem is fixed this code must remain enabled for all systems. - */ - s = u_strrchr(filename, '\\'); - if ((tmp = u_strrchr(filename, 0x2f /*'/'*/)) > s) { - s = tmp; - } -#ifdef PHP_WIN32 - if (PG(magic_quotes_gpc)) { - s = s ? s : filename; - tmp = u_strrchr(s, 0x27 /*'\''*/); - s = tmp > s ? tmp : s; - tmp = u_strrchr(s, 0x22 /*'"'*/); - s = tmp > s ? tmp : s; - } -#endif - - if (!is_anonymous) { - if (s && s > filename) { - safe_u_php_register_variable(lbuf, s+1, u_strlen(s+1), NULL, 0 TSRMLS_CC); - } else { - safe_u_php_register_variable(lbuf, filename, u_strlen(filename), NULL, 0 TSRMLS_CC); - } - } - - /* Add $foo[name] */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S[name][%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S[name]", param); - } - if (s && s > filename) { - register_u_http_post_files_variable(lbuf, s+1, u_strlen(s+1), http_post_files, 0 TSRMLS_CC); - } else { - register_u_http_post_files_variable(lbuf, filename, u_strlen(filename), http_post_files, 0 TSRMLS_CC); - } - efree(filename); - s = NULL; - - /* Possible Content-Type: */ - if (cancel_upload || !(cd = php_mime_get_hdr_value(header, "Content-Type"))) { - ucd = EMPTY_STR; - ucd_len = 0; - } else { - ucd = php_ap_to_unicode(cd, strlen(cd), &ucd_len TSRMLS_CC); - if (!ucd) { - /* UTODO error condition */ - } - /* fix for Opera 6.01 */ - s = u_strchr(ucd, 0x3b /*';'*/); - if (s != NULL) { - *s = 0; - } - } - - /* Add $foo_type */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S_type[%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S_type", param); - } - if (!is_anonymous) { - safe_u_php_register_variable(lbuf, ucd, ucd_len, NULL, 0 TSRMLS_CC); - } - - /* Add $foo[type] */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S[type][%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S[type]", param); - } - register_u_http_post_files_variable(lbuf, ucd, ucd_len, http_post_files, 0 TSRMLS_CC); - - efree(ucd); - - /* Restore Content-Type Header */ - if (s != NULL) { - *s = 0x3b /*';'*/; - } - s = EMPTY_STR; - - /* Initialize variables */ - add_u_protected_variable(param TSRMLS_CC); - - magic_quotes_gpc = PG(magic_quotes_gpc); - PG(magic_quotes_gpc) = 0; - /* if param is of form xxx[.*] this will cut it to xxx */ - if (!is_anonymous) { - safe_u_php_register_variable(param, temp_filename, u_strlen(temp_filename), NULL, 1 TSRMLS_CC); - } - - /* Add $foo[tmp_name] */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S[tmp_name][%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S[tmp_name]", param); - } - add_u_protected_variable(lbuf TSRMLS_CC); - register_u_http_post_files_variable(lbuf, temp_filename, u_strlen(temp_filename), http_post_files, 1 TSRMLS_CC); - - PG(magic_quotes_gpc) = magic_quotes_gpc; - - { - zval file_size, error_type; - - error_type.value.lval = cancel_upload; - error_type.type = IS_LONG; - - /* Add $foo[error] */ - if (cancel_upload) { - file_size.value.lval = 0; - file_size.type = IS_LONG; - } else { - file_size.value.lval = total_bytes; - file_size.type = IS_LONG; - } - - if (is_arr_upload) { - u_sprintf(lbuf, "%S[error][%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S[error]", param); - } - register_u_http_post_files_variable_ex(lbuf, &error_type, http_post_files, 0 TSRMLS_CC); - - /* Add $foo_size */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S_size[%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S_size", param); - } - if (!is_anonymous) { - safe_u_php_register_variable_ex(lbuf, &file_size, NULL, 0 TSRMLS_CC); - } - - /* Add $foo[size] */ - if (is_arr_upload) { - u_sprintf(lbuf, "%S[size][%S]", abuf, array_index); - } else { - u_sprintf(lbuf, "%S[size]", param); - } - register_u_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 TSRMLS_CC); - } - efree(param); - efree(filename); - } - } - - SAFE_RETURN; -} - -static SAPI_POST_HANDLER_FUNC(rfc1867_post_handler_legacy) -{ - char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL; - char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL; - int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0; - int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous; - zval *http_post_files=NULL; HashTable *uploaded_files=NULL; -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - int str_len = 0, num_vars = 0, num_vars_max = 2*10, *len_list = NULL; - char **val_list = NULL; -#endif - zend_bool magic_quotes_gpc; - multipart_buffer *mbuff; - zval *array_ptr = (zval *) arg; - int fd=-1; - zend_llist header; - - if (SG(request_info).content_length > SG(post_max_size)) { - sapi_module.sapi_error(E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); - return; - } - - /* Get the boundary */ - boundary = strstr(content_type_dup, "boundary"); - if (!boundary || !(boundary=strchr(boundary, '='))) { - sapi_module.sapi_error(E_WARNING, "Missing boundary in multipart/form-data POST data"); - return; - } - - boundary++; - boundary_len = strlen(boundary); - - if (boundary[0] == '"') { - boundary++; - boundary_end = strchr(boundary, '"'); - if (!boundary_end) { - sapi_module.sapi_error(E_WARNING, "Invalid boundary in multipart/form-data POST data"); - return; - } - } else { - /* search for the end of the boundary */ - boundary_end = strchr(boundary, ','); - } - if (boundary_end) { - boundary_end[0] = '\0'; - boundary_len = boundary_end-boundary; - } - - /* Initialize the buffer */ - if (!(mbuff = multipart_buffer_new(boundary, boundary_len))) { - sapi_module.sapi_error(E_WARNING, "Unable to initialize the input buffer"); - return; - } - - /* Initialize $_FILES[] */ - zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0); - - ALLOC_HASHTABLE(uploaded_files); - zend_hash_init(uploaded_files, 5, NULL, (dtor_func_t) free_estring, 0); - SG(rfc1867_uploaded_files) = uploaded_files; - - ALLOC_ZVAL(http_post_files); - array_init(http_post_files); - INIT_PZVAL(http_post_files); - PG(http_globals)[TRACK_VARS_FILES] = http_post_files; - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - val_list = (char **)ecalloc(num_vars_max+2, sizeof(char *)); - len_list = (int *)ecalloc(num_vars_max+2, sizeof(int)); - } -#endif - zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t) php_free_hdr_entry, 0); - - while (!multipart_buffer_eof(mbuff TSRMLS_CC)) - { - char buff[FILLUNIT]; - char *cd=NULL,*param=NULL,*filename=NULL, *tmp=NULL; - int blen=0, wlen=0; - - zend_llist_clean(&header); - - if (!multipart_buffer_headers(mbuff, &header TSRMLS_CC)) { - SAFE_RETURN; - } - - if ((cd = php_mime_get_hdr_value(header, "Content-Disposition"))) { - char *pair=NULL; - int end=0; - - while (isspace(*cd)) { - ++cd; - } - - while (*cd && (pair = php_ap_getword(&cd, ';'))) - { - char *key=NULL, *word = pair; - - while (isspace(*cd)) { - ++cd; - } - - if (strchr(pair, '=')) { - key = php_ap_getword(&pair, '='); - - if (!strcasecmp(key, "name")) { - if (param) { - efree(param); - } - param = php_ap_getword_conf(&pair TSRMLS_CC); - } else if (!strcasecmp(key, "filename")) { - if (filename) { - efree(filename); - } - filename = php_ap_getword_conf(&pair TSRMLS_CC); - } - } - if (key) { - efree(key); - } - efree(word); - } - - /* Normal form variable, safe to read all data into memory */ - if (!filename && param) { - - char *value = multipart_buffer_read_body(mbuff TSRMLS_CC); - unsigned int new_val_len; /* Dummy variable */ - - if (!value) { - value = estrdup(""); - } - - if (sapi_module.input_filter(PARSE_POST, param, &value, strlen(value), &new_val_len TSRMLS_CC)) { -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - php_mb_gpc_stack_variable(param, value, &val_list, &len_list, - &num_vars, &num_vars_max TSRMLS_CC); - } else { - safe_php_register_variable(param, value, array_ptr, 0 TSRMLS_CC); - } -#else - safe_php_register_variable(param, value, array_ptr, 0 TSRMLS_CC); -#endif - } - if (!strcasecmp(param, "MAX_FILE_SIZE")) { - max_file_size = atol(value); - } - - efree(param); - efree(value); - continue; - } - - /* If file_uploads=off, skip the file part */ - if (!PG(file_uploads)) { - skip_upload = 1; - } - - /* Return with an error if the posted data is garbled */ - if (!param && !filename) { - sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled"); - SAFE_RETURN; - } - - if (!param) { - is_anonymous = 1; - param = emalloc(MAX_SIZE_ANONNAME); - snprintf(param, MAX_SIZE_ANONNAME, "%u", anonindex++); - } else { - is_anonymous = 0; - } - - /* New Rule: never repair potential malicious user input */ - if (!skip_upload) { - char *tmp = param; - long c = 0; - - while (*tmp) { - if (*tmp == '[') { - c++; - } else if (*tmp == ']') { - c--; - if (tmp[1] && tmp[1] != '[') { - skip_upload = 1; - break; - } - } - if (c < 0) { - skip_upload = 1; - break; - } - tmp++; - } - } - - total_bytes = cancel_upload = 0; - - if (!skip_upload) { - /* Handle file */ - fd = php_open_temporary_fd(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if (fd==-1) { - sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file"); - cancel_upload = UPLOAD_ERROR_E; - } - } - if (skip_upload) { - efree(param); - efree(filename); - continue; - } - - if(strlen(filename) == 0) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "No file uploaded"); -#endif - cancel_upload = UPLOAD_ERROR_D; - } - - end = 0; - while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC))) - { - if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename); -#endif - cancel_upload = UPLOAD_ERROR_A; - } else if (max_file_size && (total_bytes > max_file_size)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename); -#endif - cancel_upload = UPLOAD_ERROR_B; - } else if (blen > 0) { - wlen = write(fd, buff, blen); - - if (wlen < blen) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %d", wlen, blen); -#endif - cancel_upload = UPLOAD_ERROR_F; - } else { - total_bytes += wlen; - } - } - } - if (fd!=-1) { /* may not be initialized if file could not be created */ - close(fd); - } - if (!cancel_upload && !end) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Missing mime boundary at the end of the data for file %s", strlen(filename) > 0 ? filename : ""); -#endif - cancel_upload = UPLOAD_ERROR_C; - } -#if DEBUG_FILE_UPLOAD - if(strlen(filename) > 0 && total_bytes == 0 && !cancel_upload) { - sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved", param, filename); - cancel_upload = 5; - } -#endif - - if (cancel_upload) { - if (temp_filename) { - if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */ - unlink(temp_filename); - } - efree(temp_filename); - } - temp_filename=""; - } else { - zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename) + 1, &temp_filename, sizeof(char *), NULL); - } - - /* is_arr_upload is true when name of file upload field - * ends in [.*] - * start_arr is set to point to 1st [ - */ - is_arr_upload = (start_arr = strchr(param,'[')) && (param[strlen(param)-1] == ']'); - - if (is_arr_upload) { - array_len = strlen(start_arr); - if (array_index) { - efree(array_index); - } - array_index = estrndup(start_arr+1, array_len-2); - } - - /* Add $foo_name */ - if (lbuf) { - efree(lbuf); - } - lbuf = (char *) emalloc(strlen(param) + MAX_SIZE_OF_INDEX + 1); - - if (is_arr_upload) { - if (abuf) efree(abuf); - abuf = estrndup(param, strlen(param)-array_len); - sprintf(lbuf, "%s_name[%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s_name", param); - } - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - if (num_vars>=num_vars_max){ - php_mb_gpc_realloc_buffer(&val_list, &len_list, &num_vars_max, - 1 TSRMLS_CC); - } - val_list[num_vars] = filename; - len_list[num_vars] = strlen(filename); - num_vars++; - if(php_mb_gpc_encoding_detector(val_list, len_list, num_vars, NULL TSRMLS_CC) == SUCCESS) { - str_len = strlen(filename); - php_mb_gpc_encoding_converter(&filename, &str_len, 1, NULL, NULL TSRMLS_CC); - } - s = php_mb_strrchr(filename, '\\' TSRMLS_CC); - if ((tmp = php_mb_strrchr(filename, '/' TSRMLS_CC)) > s) { - s = tmp; - } - num_vars--; - goto filedone; - } -#endif - /* The \ check should technically be needed for win32 systems only where - * it is a valid path separator. However, IE in all it's wisdom always sends - * the full path of the file on the user's filesystem, which means that unless - * the user does basename() they get a bogus file name. Until IE's user base drops - * to nill or problem is fixed this code must remain enabled for all systems. - */ - s = strrchr(filename, '\\'); - if ((tmp = strrchr(filename, '/')) > s) { - s = tmp; - } -#ifdef PHP_WIN32 - if (PG(magic_quotes_gpc)) { - s = s ? s : filename; - tmp = strrchr(s, '\''); - s = tmp > s ? tmp : s; - tmp = strrchr(s, '"'); - s = tmp > s ? tmp : s; - } -#endif - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) -filedone: -#endif - - if (!is_anonymous) { - if (s && s > filename) { - safe_php_register_variable(lbuf, s+1, NULL, 0 TSRMLS_CC); - } else { - safe_php_register_variable(lbuf, filename, NULL, 0 TSRMLS_CC); - } - } - - /* Add $foo[name] */ - if (is_arr_upload) { - sprintf(lbuf, "%s[name][%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s[name]", param); - } - if (s && s > filename) { - register_http_post_files_variable(lbuf, s+1, http_post_files, 0 TSRMLS_CC); - } else { - register_http_post_files_variable(lbuf, filename, http_post_files, 0 TSRMLS_CC); - } - efree(filename); - s = NULL; - - /* Possible Content-Type: */ - if (cancel_upload || !(cd = php_mime_get_hdr_value(header, "Content-Type"))) { - cd = ""; - } else { - /* fix for Opera 6.01 */ - s = strchr(cd, ';'); - if (s != NULL) { - *s = '\0'; - } - } - - /* Add $foo_type */ - if (is_arr_upload) { - sprintf(lbuf, "%s_type[%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s_type", param); - } - if (!is_anonymous) { - safe_php_register_variable(lbuf, cd, NULL, 0 TSRMLS_CC); - } - - /* Add $foo[type] */ - if (is_arr_upload) { - sprintf(lbuf, "%s[type][%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s[type]", param); - } - register_http_post_files_variable(lbuf, cd, http_post_files, 0 TSRMLS_CC); - - /* Restore Content-Type Header */ - if (s != NULL) { - *s = ';'; - } - s = ""; - - /* Initialize variables */ - add_protected_variable(param TSRMLS_CC); - - magic_quotes_gpc = PG(magic_quotes_gpc); - PG(magic_quotes_gpc) = 0; - /* if param is of form xxx[.*] this will cut it to xxx */ - if (!is_anonymous) { - safe_php_register_variable(param, temp_filename, NULL, 1 TSRMLS_CC); - } - - /* Add $foo[tmp_name] */ - if (is_arr_upload) { - sprintf(lbuf, "%s[tmp_name][%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s[tmp_name]", param); - } - add_protected_variable(lbuf TSRMLS_CC); - register_http_post_files_variable(lbuf, temp_filename, http_post_files, 1 TSRMLS_CC); - - PG(magic_quotes_gpc) = magic_quotes_gpc; - - { - zval file_size, error_type; - - error_type.value.lval = cancel_upload; - error_type.type = IS_LONG; - - /* Add $foo[error] */ - if (cancel_upload) { - file_size.value.lval = 0; - file_size.type = IS_LONG; - } else { - file_size.value.lval = total_bytes; - file_size.type = IS_LONG; - } - - if (is_arr_upload) { - sprintf(lbuf, "%s[error][%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s[error]", param); - } - register_http_post_files_variable_ex(lbuf, &error_type, http_post_files, 0 TSRMLS_CC); - - /* Add $foo_size */ - if (is_arr_upload) { - sprintf(lbuf, "%s_size[%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s_size", param); - } - if (!is_anonymous) { - safe_php_register_variable_ex(lbuf, &file_size, NULL, 0 TSRMLS_CC); - } - - /* Add $foo[size] */ - if (is_arr_upload) { - sprintf(lbuf, "%s[size][%s]", abuf, array_index); - } else { - sprintf(lbuf, "%s[size]", param); - } - register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 TSRMLS_CC); - } - efree(param); - } - } - - SAFE_RETURN; -} - -/* - * The combined READER/HANDLER - * - */ - -SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) -{ - if (UG(unicode)) { - rfc1867_post_handler_unicode(content_type_dup, arg TSRMLS_CC); - } else { - rfc1867_post_handler_legacy(content_type_dup, arg TSRMLS_CC); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/rfc1867.h b/main/rfc1867.h deleted file mode 100644 index e4959f0a400a1..0000000000000 --- a/main/rfc1867.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef RFC1867_H -#define RFC1867_H - -#include "SAPI.h" - -#define MULTIPART_CONTENT_TYPE "multipart/form-data" - -SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler); - -void destroy_uploaded_files_hash(TSRMLS_D); -void php_rfc1867_register_constants(TSRMLS_D); - -#endif /* RFC1867_H */ diff --git a/main/safe_mode.c b/main/safe_mode.c deleted file mode 100644 index bd859f9612321..0000000000000 --- a/main/safe_mode.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif -#include -#include "ext/standard/pageinfo.h" -#include "safe_mode.h" -#include "SAPI.h" -#include "php_globals.h" - -/* - * php_checkuid - * - * This function has six modes: - * - * 0 - return invalid (0) if file does not exist - * 1 - return valid (1) if file does not exist - * 2 - if file does not exist, check directory - * 3 - only check directory (needed for mkdir) - * 4 - check mode and param - * 5 - only check file - */ - -PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags) -{ - struct stat sb; - int ret, nofile=0; - long uid=0L, gid=0L, duid=0L, dgid=0L; - char path[MAXPATHLEN]; - char *s, filenamecopy[MAXPATHLEN]; - php_stream_wrapper *wrapper = NULL; - TSRMLS_FETCH(); - - if (!filename) { - return 0; /* path must be provided */ - } - - if (strlcpy(filenamecopy, filename, MAXPATHLEN)>=MAXPATHLEN) { - return 0; - } - filename=(char *)&filenamecopy; - - if (fopen_mode) { - if (fopen_mode[0] == 'r') { - mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS; - } else { - mode = CHECKUID_CHECK_FILE_AND_DIR; - } - } - - /* - * If given filepath is a URL, allow - safe mode stuff - * related to URL's is checked in individual functions - */ - wrapper = php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC); - if (wrapper != NULL) - return 1; - - /* First we see if the file is owned by the same user... - * If that fails, passthrough and check directory... - */ - if (mode != CHECKUID_ALLOW_ONLY_DIR) { - VCWD_REALPATH(filename, path); - ret = VCWD_STAT(path, &sb); - if (ret < 0) { - if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 0; - } else if (mode == CHECKUID_ALLOW_FILE_NOT_EXISTS) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 1; - } - nofile = 1; - } else { - uid = sb.st_uid; - gid = sb.st_gid; - if (uid == php_getuid()) { - return 1; - } else if (PG(safe_mode_gid) && gid == php_getgid()) { - return 1; - } - } - - /* Trim off filename */ - if ((s = strrchr(path, DEFAULT_SLASH))) { - if (s == path) - path[1] = '\0'; - else - *s = '\0'; - } - } else { /* CHECKUID_ALLOW_ONLY_DIR */ - s = strrchr(filename, DEFAULT_SLASH); - - if (s == filename) { - /* root dir */ - path[0] = DEFAULT_SLASH; - path[1] = '\0'; - } else if (s) { - *s = '\0'; - VCWD_REALPATH(filename, path); - *s = DEFAULT_SLASH; - } else { - /* Under Solaris, getcwd() can fail if there are no - * read permissions on a component of the path, even - * though it has the required x permissions */ - path[0] = '.'; - path[1] = '\0'; - VCWD_GETCWD(path, sizeof(path)); - } - } /* end CHECKUID_ALLOW_ONLY_DIR */ - - if (mode != CHECKUID_ALLOW_ONLY_FILE) { - /* check directory */ - ret = VCWD_STAT(path, &sb); - if (ret < 0) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 0; - } - duid = sb.st_uid; - dgid = sb.st_gid; - if (duid == php_getuid()) { - return 1; - } else if (PG(safe_mode_gid) && dgid == php_getgid()) { - return 1; - } else { - TSRMLS_FETCH(); - - if (SG(rfc1867_uploaded_files)) { - if (zend_hash_exists(SG(rfc1867_uploaded_files), (char *) filename, strlen(filename)+1)) { - return 1; - } - } - } - } - - if (mode == CHECKUID_ALLOW_ONLY_DIR) { - uid = duid; - gid = dgid; - if (s) { - *s = 0; - } - } - - if (nofile) { - uid = duid; - gid = dgid; - filename = path; - } - - if ((flags & CHECKUID_NO_ERRORS) == 0) { - if (PG(safe_mode_gid)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid/gid is %ld/%ld is not allowed to access %s owned by uid/gid %ld/%ld", php_getuid(), php_getgid(), filename, uid, gid); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid is %ld is not allowed to access %s owned by uid %ld", php_getuid(), filename, uid); - } - } - - return 0; -} - -PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) { -#ifdef NETWARE -/* NetWare don't have uid*/ - return 1; -#else - return php_checkuid_ex(filename, fopen_mode, mode, 0); -#endif -} - -PHPAPI char *php_get_current_user() -{ - struct passwd *pwd; - struct stat *pstat; - TSRMLS_FETCH(); - - if (SG(request_info).current_user) { - return SG(request_info).current_user; - } - - /* FIXME: I need to have this somehow handled if - USE_SAPI is defined, because cgi will also be - interfaced in USE_SAPI */ - - pstat = sapi_get_stat(TSRMLS_C); - - if (!pstat) { - return ""; - } - - if ((pwd=getpwuid(pstat->st_uid))==NULL) { - return ""; - } - SG(request_info).current_user_length = strlen(pwd->pw_name); - SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length); - - return SG(request_info).current_user; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/safe_mode.h b/main/safe_mode.h deleted file mode 100644 index 457683d2a6422..0000000000000 --- a/main/safe_mode.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SAFE_MODE_H -#define SAFE_MODE_H - -/* mode's for php_checkuid() */ -#define CHECKUID_DISALLOW_FILE_NOT_EXISTS 0 -#define CHECKUID_ALLOW_FILE_NOT_EXISTS 1 -#define CHECKUID_CHECK_FILE_AND_DIR 2 -#define CHECKUID_ALLOW_ONLY_DIR 3 -#define CHECKUID_CHECK_MODE_PARAM 4 -#define CHECKUID_ALLOW_ONLY_FILE 5 - -/* flags for php_checkuid_ex() */ -#define CHECKUID_NO_ERRORS 0x01 - -BEGIN_EXTERN_C() -PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode); -PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags); -PHPAPI char *php_get_current_user(void); -END_EXTERN_C() - -#endif diff --git a/main/snprintf.c b/main/snprintf.c deleted file mode 100644 index 2d702a80a0ed8..0000000000000 --- a/main/snprintf.c +++ /dev/null @@ -1,1165 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* ==================================================================== - * Copyright (c) 1995-1998 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 5. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED 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 APACHE GROUP OR - * ITS 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. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * for xinetd. - */ - -#include "php.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#define FALSE 0 -#define TRUE 1 -#define NUL '\0' -#define INT_NULL ((int *)0) - -#define S_NULL "(null)" -#define S_NULL_LEN 6 - -#define FLOAT_DIGITS 6 -#define EXPONENT_LENGTH 10 - - -/* - * Convert num to its decimal format. - * Return value: - * - a pointer to a string containing the number (no sign) - * - len contains the length of the string - * - is_negative is set to TRUE or FALSE depending on the sign - * of the number (always set to FALSE if is_unsigned is TRUE) - * - * The caller provides a buffer for the string: that is the buf_end argument - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ -char * -ap_php_conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int * is_negative, char *buf_end, register int *len) -{ - register char *p = buf_end; - register u_wide_int magnitude; - - if (is_unsigned) { - magnitude = (u_wide_int) num; - *is_negative = FALSE; - } else { - *is_negative = (num < 0); - - /* - * On a 2's complement machine, negating the most negative integer - * results in a number that cannot be represented as a signed integer. - * Here is what we do to obtain the number's magnitude: - * a. add 1 to the number - * b. negate it (becomes positive) - * c. convert it to unsigned - * d. add 1 - */ - if (*is_negative) { - wide_int t = num + 1; - - magnitude = ((u_wide_int) - t) + 1; - } else - magnitude = (u_wide_int) num; - } - - /* - * We use a do-while loop so that we write at least 1 digit - */ - do { - register u_wide_int new_magnitude = magnitude / 10; - - *--p = (char)(magnitude - new_magnitude * 10 + '0'); - magnitude = new_magnitude; - } - while (magnitude); - - *len = buf_end - p; - return (p); -} - -/* If you change this value then also change bug24640.phpt. - */ -#define NDIG 80 - - -/* - * Convert a floating point number to a string formats 'f', 'e' or 'E'. - * The result is placed in buf, and len denotes the length of the string - * The sign is returned in the is_negative argument (and is not placed - * in buf). - */ -char * - ap_php_conv_fp(register char format, register double num, - boolean_e add_dp, int precision, bool_int * is_negative, char *buf, int *len) -{ - register char *s = buf; - register char *p; - int decimal_point; - char buf1[NDIG]; - - if (format == 'f') - p = ap_php_fcvt(num, precision, &decimal_point, is_negative, buf1); - else /* either e or E format */ - p = ap_php_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); - - /* - * Check for Infinity and NaN - */ - if (isalpha((int)*p)) { - *len = strlen(p); - memcpy(buf, p, *len + 1); - *is_negative = FALSE; - return (buf); - } - if (format == 'f') { - if (decimal_point <= 0) { - *s++ = '0'; - if (precision > 0) { - *s++ = '.'; - while (decimal_point++ < 0) - *s++ = '0'; - } else if (add_dp) { - *s++ = '.'; - } - } else { - while (decimal_point-- > 0) { - *s++ = *p++; - } - if (precision > 0 || add_dp) { - *s++ = '.'; - } - } - } else { - *s++ = *p++; - if (precision > 0 || add_dp) - *s++ = '.'; - } - - /* - * copy the rest of p, the NUL is NOT copied - */ - while (*p) - *s++ = *p++; - - if (format != 'f') { - char temp[EXPONENT_LENGTH]; /* for exponent conversion */ - int t_len; - bool_int exponent_is_negative; - - *s++ = format; /* either e or E */ - decimal_point--; - if (decimal_point != 0) { - p = ap_php_conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, - &temp[EXPONENT_LENGTH], &t_len); - *s++ = exponent_is_negative ? '-' : '+'; - - /* - * Make sure the exponent has at least 2 digits - */ - if (t_len == 1) - *s++ = '0'; - while (t_len--) - *s++ = *p++; - } else { - *s++ = '+'; - *s++ = '0'; - *s++ = '0'; - } - } - *len = s - buf; - return (buf); -} - - -/* - * Convert num to a base X number where X is a power of 2. nbits determines X. - * For example, if nbits is 3, we do base 8 conversion - * Return value: - * a pointer to a string containing the number - * - * The caller provides a buffer for the string: that is the buf_end argument - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ -char * - ap_php_conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register int *len) -{ - register int mask = (1 << nbits) - 1; - register char *p = buf_end; - static char low_digits[] = "0123456789abcdef"; - static char upper_digits[] = "0123456789ABCDEF"; - register char *digits = (format == 'X') ? upper_digits : low_digits; - - do { - *--p = digits[num & mask]; - num >>= nbits; - } - while (num); - - *len = buf_end - p; - return (p); -} - -/* - * cvt.c - IEEE floating point formatting routines for FreeBSD - * from GNU libc-4.6.27 - */ - -/* - * ap_php_ecvt converts to decimal - * the number of digits is specified by ndigit - * decpt is set to the position of the decimal point - * sign is set to 0 for positive, 1 for negative - */ - - -char * -ap_php_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) -{ - register int r2; - int mvl; - double fi, fj; - register char *p, *p1; - - if (ndigits >= NDIG - 1) - ndigits = NDIG - 2; - r2 = 0; - *sign = 0; - p = &buf[0]; - if (arg < 0) { - *sign = 1; - arg = -arg; - } - arg = modf(arg, &fi); - p1 = &buf[NDIG]; - /* - * Do integer part - */ - if (fi != 0) { - p1 = &buf[NDIG]; - while (fi != 0) { - fj = modf(fi / 10, &fi); - if (p1 <= &buf[0]) { - mvl = NDIG - ndigits; - memmove(&buf[mvl], &buf[0], NDIG-mvl-1); - p1 += mvl; - } - *--p1 = (int) ((fj + .03) * 10) + '0'; - r2++; - } - while (p1 < &buf[NDIG]) - *p++ = *p1++; - } else if (arg > 0) { - while ((fj = arg * 10) < 1) { - if (!eflag && (r2 * -1) < ndigits) { - break; - } - arg = fj; - r2--; - } - } - p1 = &buf[ndigits]; - if (eflag == 0) - p1 += r2; - *decpt = r2; - if (p1 < &buf[0]) { - buf[0] = '\0'; - return (buf); - } - if (p <= p1 && p < &buf[NDIG]) { - arg = modf(arg * 10, &fj); - if ((int)fj==10) { - *p++ = '1'; - fj = 0; - *decpt = ++r2; - } - while (p <= p1 && p < &buf[NDIG]) { - *p++ = (int) fj + '0'; - arg = modf(arg * 10, &fj); - } - } - if (p1 >= &buf[NDIG]) { - buf[NDIG - 1] = '\0'; - return (buf); - } - p = p1; - *p1 += 5; - while (*p1 > '9') { - *p1 = '0'; - if (p1 > buf) - ++ * --p1; - else { - *p1 = '1'; - (*decpt)++; - if (eflag == 0) { - if (p > buf) - *p = '0'; - p++; - } - } - } - *p = '\0'; - return (buf); -} - -char * -ap_php_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) -{ - return (ap_php_cvt(arg, ndigits, decpt, sign, 1, buf)); -} - -char * -ap_php_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) -{ - return (ap_php_cvt(arg, ndigits, decpt, sign, 0, buf)); -} - -/* - * ap_php_gcvt - Floating output conversion to - * minimal length string - */ - -char * -ap_php_gcvt(double number, int ndigit, char *buf, boolean_e altform) -{ - int sign, decpt; - register char *p1, *p2; - register int i; - char buf1[NDIG]; - - if (ndigit >= NDIG - 1) { - ndigit = NDIG - 2; - } - - p1 = ap_php_ecvt(number, ndigit, &decpt, &sign, buf1); - p2 = buf; - if (sign) - *p2++ = '-'; - for (i = ndigit - 1; i > 0 && p1[i] == '0'; i--) - ndigit--; - if ((decpt >= 0 && decpt - ndigit > 4) - || (decpt < 0 && decpt < -3)) { /* use E-style */ - decpt--; - *p2++ = *p1++; - *p2++ = '.'; - for (i = 1; i < ndigit; i++) - *p2++ = *p1++; - if (*(p2 - 1) == '.') { - *p2++ = '0'; - } - *p2++ = 'e'; - if (decpt < 0) { - decpt = -decpt; - *p2++ = '-'; - } else - *p2++ = '+'; - if (decpt / 100 > 0) - *p2++ = decpt / 100 + '0'; - if (decpt / 10 > 0) - *p2++ = (decpt % 100) / 10 + '0'; - *p2++ = decpt % 10 + '0'; - } else { - if (decpt <= 0) { - if (*p1 != '0') { - *p2++ = '0'; - *p2++ = '.'; - } - while (decpt < 0) { - decpt++; - *p2++ = '0'; - } - } - for (i = 1; i <= ndigit; i++) { - *p2++ = *p1++; - if (i == decpt) - *p2++ = '.'; - } - if (ndigit < decpt) { - while (ndigit++ < decpt) - *p2++ = '0'; - *p2++ = '.'; - } - } - if (p2[-1] == '.' && !altform) - p2--; - *p2 = '\0'; - return (buf); -} - -/* - * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions - * - * XXX: this is a magic number; do not decrease it - */ -#define NUM_BUF_SIZE 512 - - -/* - * Descriptor for buffer area - */ -struct buf_area { - char *buf_end; - char *nextb; /* pointer to next byte to read/write */ -}; - -typedef struct buf_area buffy; - -/* - * The INS_CHAR macro inserts a character in the buffer and writes - * the buffer back to disk if necessary - * It uses the char pointers sp and bep: - * sp points to the next available character in the buffer - * bep points to the end-of-buffer+1 - * While using this macro, note that the nextb pointer is NOT updated. - * - * NOTE: Evaluation of the c argument should not have any side-effects - */ -#define INS_CHAR(c, sp, bep, cc) \ - { \ - if (sp < bep) \ - { \ - *sp++ = c; \ - } \ - cc++; \ - } - -#define NUM( c ) ( c - '0' ) - -#define STR_TO_DEC( str, num ) \ - num = NUM( *str++ ) ; \ - while ( isdigit((int)*str ) ) \ - { \ - num *= 10 ; \ - num += NUM( *str++ ) ; \ - } - -/* - * This macro does zero padding so that the precision - * requirement is satisfied. The padding is done by - * adding '0's to the left of the string that is going - * to be printed. - */ -#define FIX_PRECISION( adjust, precision, s, s_len ) \ - if ( adjust ) \ - while ( s_len < precision ) \ - { \ - *--s = '0' ; \ - s_len++ ; \ - } - -/* - * Macro that does padding. The padding is done by printing - * the character ch. - */ -#define PAD( width, len, ch ) do \ - { \ - INS_CHAR( ch, sp, bep, cc ) ; \ - width-- ; \ - } \ - while ( width > len ) - -/* - * Prefix the character ch to the string str - * Increase length - * Set the has_prefix flag - */ -#define PREFIX( str, length, ch ) *--str = ch ; length++ ; has_prefix = YES - - -/* - * Do format conversion placing the output in buffer - */ -static int format_converter(register buffy * odp, const char *fmt, - va_list ap) -{ - register char *sp; - register char *bep; - register int cc = 0; - register int i; - - register char *s = NULL; - char *q; - int s_len; - - register int min_width = 0; - int precision = 0; - enum { - LEFT, RIGHT - } adjust; - char pad_char; - char prefix_char; - - double fp_num; - wide_int i_num = (wide_int) 0; - u_wide_int ui_num; - - char num_buf[NUM_BUF_SIZE]; - char char_buf[2]; /* for printing %% and % */ - - /* - * Flag variables - */ - length_modifier_e modifier; - boolean_e alternate_form; - boolean_e print_sign; - boolean_e print_blank; - boolean_e adjust_precision; - boolean_e adjust_width; - bool_int is_negative; - - sp = odp->nextb; - bep = odp->buf_end; - - while (*fmt) { - if (*fmt != '%') { - INS_CHAR(*fmt, sp, bep, cc); - } else { - /* - * Default variable settings - */ - adjust = RIGHT; - alternate_form = print_sign = print_blank = NO; - pad_char = ' '; - prefix_char = NUL; - - fmt++; - - /* - * Try to avoid checking for flags, width or precision - */ - if (isascii((int)*fmt) && !islower((int)*fmt)) { - /* - * Recognize flags: -, #, BLANK, + - */ - for (;; fmt++) { - if (*fmt == '-') - adjust = LEFT; - else if (*fmt == '+') - print_sign = YES; - else if (*fmt == '#') - alternate_form = YES; - else if (*fmt == ' ') - print_blank = YES; - else if (*fmt == '0') - pad_char = '0'; - else - break; - } - - /* - * Check if a width was specified - */ - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, min_width); - adjust_width = YES; - } else if (*fmt == '*') { - min_width = va_arg(ap, int); - fmt++; - adjust_width = YES; - if (min_width < 0) { - adjust = LEFT; - min_width = -min_width; - } - } else - adjust_width = NO; - - /* - * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. - */ - if (*fmt == '.') { - adjust_precision = YES; - fmt++; - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, precision); - } else if (*fmt == '*') { - precision = va_arg(ap, int); - fmt++; - if (precision < 0) - precision = 0; - } else - precision = 0; - } else - adjust_precision = NO; - } else - adjust_precision = adjust_width = NO; - - /* - * Modifier check - */ - switch (*fmt) { - case 'L': - fmt++; - modifier = LM_LONG_DOUBLE; - break; - case 'l': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == 'l') { - fmt++; - modifier = LM_LONG_LONG; - } else -#endif - modifier = LM_LONG; - break; - case 'z': - fmt++; - modifier = LM_SIZE_T; - break; - case 'j': - fmt++; -#if SIZEOF_INTMAX_T - modifier = LM_INTMAX_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 't': - fmt++; -#if SIZEOF_PTRDIFF_T - modifier = LM_PTRDIFF_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 'h': - fmt++; - if (*fmt == 'h') { - fmt++; - } - /* these are promoted to int, so no break */ - default: - modifier = LM_STD; - break; - } - - /* - * Argument extraction and printing. - * First we determine the argument type. - * Then, we convert the argument to a string. - * On exit from the switch, s points to the string that - * must be printed, s_len has the length of the string - * The precision requirements, if any, are reflected in s_len. - * - * NOTE: pad_char may be set to '0' because of the 0 flag. - * It is reset to ' ' by non-numeric formats - */ - switch (*fmt) { - case 'u': - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - i_num = (wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - /* - * The rest also applies to other integer formats, so fall - * into that case. - */ - case 'd': - case 'i': - /* - * Get the arg if we haven't already. - */ - if ((*fmt) != 'u') { - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, long int); - break; - case LM_SIZE_T: -#if SIZEOF_SSIZE_T - i_num = (wide_int) va_arg(ap, ssize_t); -#else - i_num = (wide_int) va_arg(ap, size_t); -#endif - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, intmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - } - s = ap_php_conv_10(i_num, (*fmt) == 'u', &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - - if (*fmt != 'u') { - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'o': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 3, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && *s != '0') { - *--s = '0'; - s_len++; - } - break; - - - case 'x': - case 'X': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 4, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { - *--s = *fmt; /* 'x' or 'X' */ - *--s = '0'; - s_len += 2; - } - break; - - - case 's': - s = va_arg(ap, char *); - if (s != NULL) { - s_len = strlen(s); - if (adjust_precision && precision < s_len) - s_len = precision; - } else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - break; - - - case 'f': - case 'e': - case 'E': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "nan"; - s_len = 3; - } else if (zend_isinf(fp_num)) { - s = "inf"; - s_len = 3; - } else { - s = ap_php_conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'g': - case 'G': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "NAN"; - s_len = 3; - break; - } else if (zend_isinf(fp_num)) { - if (fp_num > 0) { - s = "INF"; - s_len = 3; - } else { - s = "-INF"; - s_len = 4; - } - break; - } - - if (adjust_precision == NO) - precision = FLOAT_DIGITS; - else if (precision == 0) - precision = 1; - /* - * * We use &num_buf[ 1 ], so that we have room for the sign - */ - s = ap_php_gcvt(fp_num, precision, &num_buf[1], - alternate_form); - if (*s == '-') - prefix_char = *s++; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - - s_len = strlen(s); - - if (alternate_form && (q = strchr(s, '.')) == NULL) - s[s_len++] = '.'; - if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL) - *q = 'E'; - break; - - - case 'c': - char_buf[0] = (char) (va_arg(ap, int)); - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case '%': - char_buf[0] = '%'; - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case 'n': - *(va_arg(ap, int *)) = cc; - break; - - /* - * Always extract the argument as a "char *" pointer. We - * should be using "void *" but there are still machines - * that don't understand it. - * If the pointer size is equal to the size of an unsigned - * integer we convert the pointer to a hex number, otherwise - * we print "%p" to indicate that we don't handle "%p". - */ - case 'p': - if (sizeof(char *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int)((size_t) va_arg(ap, char *)); - s = ap_php_conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - if (ui_num != 0) { - *--s = 'x'; - *--s = '0'; - s_len += 2; - } - } else { - s = "%p"; - s_len = 2; - } - pad_char = ' '; - break; - - - case NUL: - /* - * The last character of the format string was %. - * We ignore it. - */ - continue; - - -fmt_error: - php_error(E_ERROR, "Illegal length modifier specified '%c' in s[np]printf call", *fmt); - /* - * The default case is for unrecognized %'s. - * We print % to help the user identify what - * option is not understood. - * This is also useful in case the user wants to pass - * the output of format_converter to another function - * that understands some other % (like syslog). - * Note that we can't point s inside fmt because the - * unknown could be preceded by width etc. - */ - default: - char_buf[0] = '%'; - char_buf[1] = *fmt; - s = char_buf; - s_len = 2; - pad_char = ' '; - break; - } - - if (prefix_char != NUL) { - *--s = prefix_char; - s_len++; - } - if (adjust_width && adjust == RIGHT && min_width > s_len) { - if (pad_char == '0' && prefix_char != NUL) { - INS_CHAR(*s, sp, bep, cc) - s++; - s_len--; - min_width--; - } - PAD(min_width, s_len, pad_char); - } - /* - * Print the string s. - */ - for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); - s++; - } - - if (adjust_width && adjust == LEFT && min_width > s_len) - PAD(min_width, s_len, pad_char); - } - fmt++; - } - odp->nextb = sp; - return (cc); -} - - -/* - * This is the general purpose conversion function. - */ -static void strx_printv(int *ccp, char *buf, size_t len, const char *format, - va_list ap) -{ - buffy od; - int cc; - - /* - * First initialize the descriptor - * Notice that if no length is given, we initialize buf_end to the - * highest possible address. - */ - if (len == 0) { - od.buf_end = (char *) ~0; - od.nextb = (char *) ~0; - } else { - od.buf_end = &buf[len-1]; - od.nextb = buf; - } - - /* - * Do the conversion - */ - cc = format_converter(&od, format, ap); - if (len != 0 && od.nextb <= od.buf_end) - *(od.nextb) = '\0'; - if (ccp) - *ccp = cc; -} - - -PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...) -{ - int cc; - va_list ap; - - va_start(ap, format); - strx_printv(&cc, buf, len, format, ap); - va_end(ap); - return (cc); -} - - -PHPAPI int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap) -{ - int cc; - - strx_printv(&cc, buf, len, format, ap); - return (cc); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/snprintf.h b/main/snprintf.h deleted file mode 100644 index 371f41ad76658..0000000000000 --- a/main/snprintf.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Stig Sĉther Bakken | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - -Comparing: sprintf, snprintf, spprintf - -sprintf offers the ability to make a lot of failures since it does not know - the size of the buffer it uses. Therefore usage of sprintf often - results in possible entries for buffer overrun attacks. So please - use this version only if you are sure the call is safe. sprintf - allways terminstes the buffer it writes to. - -snprintf knows the buffers size and will not write behind it. But you will - have to use either a static buffer or allocate a dynamic buffer - before beeing able to call the function. In other words you must - be sure that you really know the maximum size of the buffer required. - A bad thing is having a big maximum while in most cases you would - only need a small buffer. If the size of the resulting string is - longer or equal to the buffer size than the buffer is not terminated. - -spprintf is the dynamical version of snprintf. It allocates the buffer in size - as needed and allows a maximum setting as snprintf (turn this feature - off by setting max_len to 0). spprintf is a little bit slower than - snprintf and offers possible memory leakes if you miss freeing the - buffer allocated by the function. Therfore this function should be - used where either no maximum is known or the maximum is much bigger - than normal size required. spprintf allways terminates the buffer. - -Example: - - #define MAX 1024 | #define MAX 1024 | #define MAX 1024 - char buffer[MAX] | char buffer[MAX] | char *buffer; - | | - | | // No need to initialize buffer: - | | // spprintf ignores value of buffer - sprintf(buffer, "test"); | snprintf(buffer, MAX, "test"); | spprintf(&buffer, MAX, "text"); - | | if (!buffer) - | | return OUT_OF_MEMORY - // sprintf allways terminates | // manual termination of | // spprintf allays terminates buffer - // buffer | // buffer *IS* required | - | buffer[MAX-1] = 0; | - action_with_buffer(buffer); | action_with_buffer(buffer); | action_with_buffer(buffer); - | | efree(buffer); -*/ - -#ifndef SNPRINTF_H -#define SNPRINTF_H - -BEGIN_EXTERN_C() -PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0); -PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); -END_EXTERN_C() - -#ifdef snprintf -#undef snprintf -#endif -#define snprintf ap_php_snprintf - -#ifdef vsnprintf -#undef vsnprintf -#endif -#define vsnprintf ap_php_vsnprintf - -#ifdef sprintf -#undef sprintf -#endif -#define sprintf php_sprintf - -typedef enum { - NO = 0, YES = 1 -} boolean_e; - -typedef enum { - LM_STD = 0, -#if SIZEOF_INTMAX_T - LM_INTMAX_T, -#endif -#if SIZEOF_PTRDIFF_T - LM_PTRDIFF_T, -#endif -#if SIZEOF_LONG_LONG - LM_LONG_LONG, -#endif - LM_SIZE_T, - LM_LONG, - LM_LONG_DOUBLE -} length_modifier_e; - -extern char * ap_php_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf); -extern char * ap_php_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf); -extern char * ap_php_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf); -extern char * ap_php_gcvt(double number, int ndigit, char *buf, boolean_e altform); - -#if PHP_WIN32 -# define WIDE_INT __int64 -#elif SIZEOF_LONG_LONG_INT -# define WIDE_INT long long int -#elif SIZEOF_LONG_LONG -# define WIDE_INT long long -#else -# define WIDE_INT long -#endif -typedef WIDE_INT wide_int; -typedef unsigned WIDE_INT u_wide_int; - -typedef int bool_int; - -extern char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int * is_negative, char *buf_end, register int *len); - -extern char * ap_php_conv_fp(register char format, register double num, - boolean_e add_dp, int precision, bool_int * is_negative, char *buf, int *len); - -extern char * ap_php_conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register int *len); - - -#endif /* SNPRINTF_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/spprintf.c b/main/spprintf.c deleted file mode 100644 index 09f33f10650a3..0000000000000 --- a/main/spprintf.c +++ /dev/null @@ -1,877 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This is the spprintf implementation. - * It has emerged from apache snprintf. See original header: - */ - -/* ==================================================================== - * Copyright (c) 1995-1998 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 5. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED 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 APACHE GROUP OR - * ITS 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. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * for xinetd. - */ - -#include "php.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#include "snprintf.h" - -#define FALSE 0 -#define TRUE 1 -#define NUL '\0' -#define INT_NULL ((int *)0) - -#define S_NULL "(null)" -#define S_NULL_LEN 6 - -#define FLOAT_DIGITS 6 -#define EXPONENT_LENGTH 10 - -#include "ext/standard/php_smart_str.h" - -/* - * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions - * - * XXX: this is a magic number; do not decrease it - */ -#define NUM_BUF_SIZE 512 - -/* - * The INS_CHAR macro inserts a character in the buffer. - * - * NOTE: Evaluation of the ch argument should not have any side-effects - */ -#define INS_CHAR_NR(unicode, xbuf, ch) do { \ - if (unicode) { \ - smart_str_append2c(xbuf, ch); \ - } else { \ - smart_str_appendc(xbuf, ch); \ - } \ -} while (0) - -#define INS_STRING(unicode, s_unicode, xbuf, s, s_len) \ -do { \ - if (unicode) { \ - size_t newlen, p, sz = 2*(s_len); \ - smart_str_alloc(xbuf, (sz), 0); \ - if (s_unicode) { \ - memcpy(xbuf->c + xbuf->len, s, (sz)); \ - xbuf->len += sz; \ - } else { \ - p = (s_len); \ - while(p--) { \ - smart_str_append2c(xbuf, *s); \ - *s++; \ - } \ - } \ - } else { \ - smart_str_appendl(xbuf, s, s_len); \ - } \ -} while (0) - -#define INS_CHAR(unicode, xbuf, ch) \ - INS_CHAR_NR(unicode, xbuf, ch) - -/* - * Macro that does padding. The padding is done by printing - * the character ch. - */ -#define PAD(unicode, xbuf, count, ch) do { \ - if ((count) > 0) { \ - size_t newlen, p, sz = (count); \ - if (unicode) { \ - p = sz; \ - sz <<= 1; \ - smart_str_alloc(xbuf, sz, 0); \ - while(p--) smart_str_append2c(xbuf, ch);\ - } else { \ - smart_str_alloc(xbuf, sz, 0); \ - memset(xbuf->c + xbuf->len, ch, sz); \ - xbuf->len += sz; \ - } \ - } \ -} while (0) - -#define NUM(c) (c - '0') - -#define STR_TO_DEC(str, num) do { \ - num = NUM(*str++); \ - while (isdigit((int)*str)) { \ - num *= 10; \ - num += NUM(*str++); \ - if (num >= INT_MAX / 10) { \ - while (isdigit((int)*str++)); \ - break; \ - } \ - } \ -} while (0) - -/* - * This macro does zero padding so that the precision - * requirement is satisfied. The padding is done by - * adding '0's to the left of the string that is going - * to be printed. - */ -#define FIX_PRECISION(adjust, precision, s, s_len) \ - do { \ - if (adjust) \ - while (s_len < precision) { \ - *--s = '0'; \ - s_len++; \ - } \ -} while (0) - - - -/* - * Do format conversion placing the output in buffer - */ -static void xbuf_format_converter(int unicode, smart_str *xbuf, const char *fmt, va_list ap) -{ - register char *s = NULL; - register UChar *u = NULL; - char *q; - int s_len, s_unicode; - int32_t u_len; - - register int min_width = 0; - int precision = 0; - enum { - LEFT, RIGHT - } adjust; - char pad_char; - char prefix_char; - - double fp_num; - wide_int i_num = (wide_int) 0; - u_wide_int ui_num; - - char num_buf[NUM_BUF_SIZE]; - char char_buf[2]; /* for printing %% and % */ - zend_bool free_s; /* free string if allocated here */ - - /* - * Flag variables - */ - length_modifier_e modifier; - boolean_e alternate_form; - boolean_e print_sign; - boolean_e print_blank; - boolean_e adjust_precision; - boolean_e adjust_width; - bool_int is_negative; - - TSRMLS_FETCH(); - - while (*fmt) { - if (*fmt != '%') { - INS_CHAR(unicode, xbuf, *fmt); - } else { - /* - * Default variable settings - */ - adjust = RIGHT; - alternate_form = print_sign = print_blank = NO; - pad_char = ' '; - prefix_char = NUL; - free_s = 0; - s_unicode = 0; - - fmt++; - - /* - * Try to avoid checking for flags, width or precision - */ - if (isascii((int)*fmt) && !islower((int)*fmt)) { - /* - * Recognize flags: -, #, BLANK, + - */ - for (;; fmt++) { - if (*fmt == '-') - adjust = LEFT; - else if (*fmt == '+') - print_sign = YES; - else if (*fmt == '#') - alternate_form = YES; - else if (*fmt == ' ') - print_blank = YES; - else if (*fmt == '0') - pad_char = '0'; - else - break; - } - - /* - * Check if a width was specified - */ - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, min_width); - adjust_width = YES; - } else if (*fmt == '*') { - min_width = va_arg(ap, int); - fmt++; - adjust_width = YES; - if (min_width < 0) { - adjust = LEFT; - min_width = -min_width; - } - } else - adjust_width = NO; - - /* - * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. - */ - if (*fmt == '.') { - adjust_precision = YES; - fmt++; - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, precision); - } else if (*fmt == '*') { - precision = va_arg(ap, int); - fmt++; - if (precision < 0) - precision = 0; - } else - precision = 0; - } else - adjust_precision = NO; - } else - adjust_precision = adjust_width = NO; - - /* - * Modifier check - */ - switch (*fmt) { - case 'L': - fmt++; - modifier = LM_LONG_DOUBLE; - break; - case 'l': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == 'l') { - fmt++; - modifier = LM_LONG_LONG; - } else -#endif - modifier = LM_LONG; - break; - case 'z': - fmt++; - modifier = LM_SIZE_T; - break; - case 'j': - fmt++; -#if SIZEOF_INTMAX_T - modifier = LM_INTMAX_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 't': - fmt++; -#if SIZEOF_PTRDIFF_T - modifier = LM_PTRDIFF_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 'h': - fmt++; - if (*fmt == 'h') { - fmt++; - } - /* these are promoted to int, so no break */ - default: - modifier = LM_STD; - break; - } - - /* - * Argument extraction and printing. - * First we determine the argument type. - * Then, we convert the argument to a string. - * On exit from the switch, s points to the string that - * must be printed, s_len has the length of the string - * The precision requirements, if any, are reflected in s_len. - * - * NOTE: pad_char may be set to '0' because of the 0 flag. - * It is reset to ' ' by non-numeric formats - */ - switch (*fmt) { - case 'u': - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - i_num = (wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - /* - * The rest also applies to other integer formats, so fall - * into that case. - */ - case 'd': - case 'i': - /* - * Get the arg if we haven't already. - */ - if ((*fmt) != 'u') { - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, long int); - break; - case LM_SIZE_T: -#if SIZEOF_SSIZE_T - i_num = (wide_int) va_arg(ap, ssize_t); -#else - i_num = (wide_int) va_arg(ap, size_t); -#endif - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, intmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - } - s = ap_php_conv_10(i_num, (*fmt) == 'u', &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - - if (*fmt != 'u') { - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'o': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 3, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && *s != '0') { - *--s = '0'; - s_len++; - } - break; - - - case 'x': - case 'X': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 4, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { - *--s = *fmt; /* 'x' or 'X' */ - *--s = '0'; - s_len += 2; - } - break; - - case 'v': - if (UG(unicode)) { - goto fmt_unicode; - } else { - goto fmt_string; - } - break; - - case 'R': - { - int type = va_arg(ap, int); - if (type != IS_UNICODE) { - if (alternate_form) { - va_arg(ap, UConverter *); - } - goto fmt_string; - } - } - /* break omitted */ - - case 'r': -fmt_unicode: - { - UConverter *conv = ZEND_U_CONVERTER(UG(output_encoding_conv)); - UErrorCode status = U_ZERO_ERROR; - char *res = NULL; - - if (alternate_form) { - conv = va_arg(ap, UConverter *); - } - - u = va_arg(ap, UChar *); - if (u == NULL) { - s = S_NULL; - s_len = S_NULL_LEN; - break; - } - - u_len = u_strlen(u); - if (unicode) { - s_len = u_len; /* UTODO actually we think of 2bytes each atm */ - s = (char*)u; - s_unicode = 1; - } else { - zend_convert_from_unicode(conv, &res, &s_len, u, u_len, &status); - if (U_FAILURE(status)) { - php_error(E_WARNING, "Could not convert Unicode to printable form in s[np]printf call"); - return; - } - s = res; - free_s = 1; - } - - pad_char = ' '; - break; - } - - case 's': -fmt_string: - s = va_arg(ap, char *); - if (s != NULL) { - s_len = strlen(s); - if (adjust_precision && precision < s_len) - s_len = precision; - } else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - break; - - case 'f': - case 'e': - case 'E': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "nan"; - s_len = 3; - } else if (zend_isinf(fp_num)) { - s = "inf"; - s_len = 3; - } else { - s = ap_php_conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'g': - case 'G': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "NAN"; - s_len = 3; - break; - } else if (zend_isinf(fp_num)) { - if (fp_num > 0) { - s = "INF"; - s_len = 3; - } else { - s = "-INF"; - s_len = 4; - } - break; - } - - if (adjust_precision == NO) - precision = FLOAT_DIGITS; - else if (precision == 0) - precision = 1; - /* - * * We use &num_buf[ 1 ], so that we have room for the sign - */ - s = ap_php_gcvt(fp_num, precision, &num_buf[1], - alternate_form); - if (*s == '-') - prefix_char = *s++; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - - s_len = strlen(s); - - if (alternate_form && (q = strchr(s, '.')) == NULL) - s[s_len++] = '.'; - if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL) - *q = 'E'; - break; - - - case 'c': - char_buf[0] = (char) (va_arg(ap, int)); - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case '%': - char_buf[0] = '%'; - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case 'n': - *(va_arg(ap, int *)) = xbuf->len; - break; - - /* - * Always extract the argument as a "char *" pointer. We - * should be using "void *" but there are still machines - * that don't understand it. - * If the pointer size is equal to the size of an unsigned - * integer we convert the pointer to a hex number, otherwise - * we print "%p" to indicate that we don't handle "%p". - */ - case 'p': - if (sizeof(char *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int)((size_t) va_arg(ap, char *)); - s = ap_php_conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - if (ui_num != 0) { - *--s = 'x'; - *--s = '0'; - s_len += 2; - } - } else { - s = "%p"; - s_len = 2; - } - pad_char = ' '; - break; - - - case NUL: - /* - * The last character of the format string was %. - * We ignore it. - */ - continue; - - -fmt_error: - php_error(E_ERROR, "Illegal length modifier specified '%c' in s[np]printf call", *fmt); - /* - * The default case is for unrecognized %'s. - * We print % to help the user identify what - * option is not understood. - * This is also useful in case the user wants to pass - * the output of format_converter to another function - * that understands some other % (like syslog). - * Note that we can't point s inside fmt because the - * unknown could be preceded by width etc. - */ - default: - char_buf[0] = '%'; - char_buf[1] = *fmt; - s = char_buf; - s_len = 2; - pad_char = ' '; - break; - } - - if (prefix_char != NUL) { - *--s = prefix_char; - s_len++; - } - if (adjust_width && adjust == RIGHT && min_width > s_len) { - if (pad_char == '0' && prefix_char != NUL) { - INS_CHAR(unicode, xbuf, *s); - s++; - s_len--; - min_width--; - } - PAD(unicode, xbuf, min_width - s_len, pad_char); - } - /* - * Print the string s. - */ - INS_STRING(unicode, s_unicode, xbuf, s, s_len); - if (free_s) efree(s); - - if (adjust_width && adjust == LEFT && min_width > s_len) { - PAD(unicode, xbuf, min_width - s_len, pad_char); - } - } - fmt++; - } - return; -} - - -/* - * This is the general purpose conversion function. - */ -PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) -{ - smart_str xbuf = {0}; - - xbuf_format_converter(0, &xbuf, format, ap); - - if (max_len && xbuf.len > max_len) { - xbuf.len = max_len; - } - smart_str_0(&xbuf); - - *pbuf = xbuf.c; - - return xbuf.len; -} - - -PHPAPI int spprintf(char **pbuf, size_t max_len, const char *format, ...) -{ - int cc; - va_list ap; - - va_start(ap, format); - cc = vspprintf(pbuf, max_len, format, ap); - va_end(ap); - return (cc); -} - -PHPAPI int vuspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) -{ - smart_str xbuf = {0}; - - xbuf_format_converter(1, &xbuf, format, ap); - - if (max_len && xbuf.len > max_len) { - xbuf.len = max_len; - } - smart_str_0(&xbuf); - - *pbuf = xbuf.c; - - return xbuf.len; -} - - -PHPAPI int uspprintf(char **pbuf, size_t max_len, const char *format, ...) -{ - int cc; - va_list ap; - - va_start(ap, format); - cc = vuspprintf(pbuf, max_len, format, ap); - va_end(ap); - return (cc); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/spprintf.h b/main/spprintf.h deleted file mode 100644 index e48681ca1d2a9..0000000000000 --- a/main/spprintf.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - -The pbuf parameter of all spprintf version receives a pointer to the allocated -buffer. This buffer must be freed manually after usage using efree() function. -The buffer will allways be terminated by a zero character. When pbuf is NULL -the function can be used to calculate the required size of the buffer but for -that purpose snprintf is faster. When both pbuf and the return value are 0 -than you are out of memory. - -There is also snprintf: See difference explained in snprintf.h - -*/ - -#ifndef SPPRINTF_H -#define SPPRINTF_H - -#include "snprintf.h" - -BEGIN_EXTERN_C() -PHPAPI int spprintf( char **pbuf, size_t max_len, const char *format, ...); -PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap); -PHPAPI int uspprintf( char **pbuf, size_t max_len, const char *format, ...); -PHPAPI int vuspprintf(char **pbuf, size_t max_len, const char *format, va_list ap); -END_EXTERN_C() - -#endif /* SNPRINTF_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/streams/cast.c b/main/streams/cast.c deleted file mode 100644 index 6297b6269ed31..0000000000000 --- a/main/streams/cast.c +++ /dev/null @@ -1,351 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include -#include - -#include "php_streams_int.h" - -/* Under BSD, emulate fopencookie using funopen */ -#if HAVE_FUNOPEN -typedef struct { - int (*reader)(void *, char *, int); - int (*writer)(void *, const char *, int); - fpos_t (*seeker)(void *, fpos_t, int); - int (*closer)(void *); -} COOKIE_IO_FUNCTIONS_T; - -FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs) -{ - return funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer); -} -# define HAVE_FOPENCOOKIE 1 -# define PHP_STREAM_COOKIE_FUNCTIONS &stream_cookie_functions -#elif HAVE_FOPENCOOKIE -# define PHP_STREAM_COOKIE_FUNCTIONS stream_cookie_functions -#endif - -/* {{{ STDIO with fopencookie */ -#if HAVE_FUNOPEN -/* use our fopencookie emulation */ -static int stream_cookie_reader(void *cookie, char *buffer, int size) -{ - int ret; - TSRMLS_FETCH(); - ret = php_stream_read((php_stream*)cookie, buffer, size); - return ret; -} - -static int stream_cookie_writer(void *cookie, const char *buffer, int size) -{ - TSRMLS_FETCH(); - return php_stream_write((php_stream *)cookie, (char *)buffer, size); -} - -static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence) -{ - TSRMLS_FETCH(); - return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence); -} - -static int stream_cookie_closer(void *cookie) -{ - php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); - - /* prevent recursion */ - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - return php_stream_close(stream); -} - -#elif HAVE_FOPENCOOKIE -static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size) -{ - ssize_t ret; - TSRMLS_FETCH(); - ret = php_stream_read(((php_stream *)cookie), buffer, size); - return ret; -} - -static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t size) -{ - TSRMLS_FETCH(); - return php_stream_write(((php_stream *)cookie), (char *)buffer, size); -} - -#ifdef COOKIE_SEEKER_USES_OFF64_T -static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) -{ - TSRMLS_FETCH(); - - *position = php_stream_seek((php_stream *)cookie, (off_t)*position, whence); - - if (*position == -1) - return -1; - return 0; -} -#else -static int stream_cookie_seeker(void *cookie, off_t position, int whence) -{ - TSRMLS_FETCH(); - return php_stream_seek((php_stream *)cookie, position, whence); -} -#endif - -static int stream_cookie_closer(void *cookie) -{ - php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); - - /* prevent recursion */ - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - return php_stream_close(stream); -} -#endif /* elif HAVE_FOPENCOOKIE */ - -#if HAVE_FOPENCOOKIE -static COOKIE_IO_FUNCTIONS_T stream_cookie_functions = -{ - stream_cookie_reader, stream_cookie_writer, - stream_cookie_seeker, stream_cookie_closer -}; -#else -/* TODO: use socketpair() to emulate fopencookie, as suggested by Hartmut ? */ -#endif -/* }}} */ - -/* {{{ php_stream_cast */ -PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC) -{ - int flags = castas & PHP_STREAM_CAST_MASK; - castas &= ~PHP_STREAM_CAST_MASK; - - /* synchronize our buffer (if possible) */ - if (ret && castas != PHP_STREAM_AS_FD_FOR_SELECT) { - php_stream_flush(stream); - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - off_t dummy; - - stream->ops->seek(stream, stream->position, SEEK_SET, &dummy TSRMLS_CC); - - php_stream_flush_readbuf(stream); - } - } - - /* filtered streams can only be cast as stdio, and only when fopencookie is present */ - - if (castas == PHP_STREAM_AS_STDIO) { - if (stream->stdiocast) { - if (ret) { - *(FILE**)ret = stream->stdiocast; - } - goto exit_success; - } - - /* if the stream is a stdio stream let's give it a chance to respond - * first, to avoid doubling up the layers of stdio with an fopencookie */ - if (php_stream_is(stream, PHP_STREAM_IS_STDIO) && - stream->ops->cast && - !php_stream_is_filtered(stream) && - stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) - { - goto exit_success; - } - -#if HAVE_FOPENCOOKIE - /* if just checking, say yes we can be a FILE*, but don't actually create it yet */ - if (ret == NULL) - goto exit_success; - - *(FILE**)ret = fopencookie(stream, stream->mode, PHP_STREAM_COOKIE_FUNCTIONS); - - if (*ret != NULL) { - off_t pos; - - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_FOPENCOOKIE; - - /* If the stream position is not at the start, we need to force - * the stdio layer to believe it's real location. */ - pos = php_stream_tell(stream); - if (pos > 0) - fseek(*ret, pos, SEEK_SET); - - goto exit_success; - } - - /* must be either: - a) programmer error - b) no memory - -> lets bail - */ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "fopencookie failed"); - return FAILURE; -#endif - - if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL TSRMLS_CC) == SUCCESS) { - if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) { - return FAILURE; - } - goto exit_success; - } else if (flags & PHP_STREAM_CAST_TRY_HARD) { - php_stream *newstream; - - newstream = php_stream_fopen_tmpfile(); - if (newstream) { - size_t copied = php_stream_copy_to_stream(stream, newstream, PHP_STREAM_COPY_ALL); - - if (copied == 0) { - php_stream_close(newstream); - } else { - int retcode = php_stream_cast(newstream, castas | flags, ret, show_err); - - if (retcode == SUCCESS) - rewind(*(FILE**)ret); - - /* do some specialized cleanup */ - if ((flags & PHP_STREAM_CAST_RELEASE)) { - php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); - } - - return retcode; - } - } - } - } - - if (php_stream_is_filtered(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot cast a filtered stream on this system"); - return FAILURE; - } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) { - goto exit_success; - } - - if (show_err) { - /* these names depend on the values of the PHP_STREAM_AS_XXX defines in php_streams.h */ - static const char *cast_names[4] = { - "STDIO FILE*", "File Descriptor", "Socket Descriptor", "select()able descriptor" - }; - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s", - stream->ops->label, - cast_names[castas] - ); - } - - return FAILURE; - -exit_success: - - if ((stream->readbuf_avail) > 0 && - stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE && - (flags & PHP_STREAM_CAST_INTERNAL) == 0) { - /* the data we have buffered will be lost to the third party library that - * will be accessing the stream. Emit a warning so that the end-user will - * know that they should try something else */ - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%ld bytes of buffered data lost during stream conversion!", - stream->readbuf_avail); - } - - if (castas == PHP_STREAM_AS_STDIO && ret) - stream->stdiocast = *(FILE**)ret; - - if (flags & PHP_STREAM_CAST_RELEASE) { - php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); - } - - return SUCCESS; - -} -/* }}} */ - -/* {{{ php_stream_open_wrapper_as_file */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC) -{ - FILE *fp = NULL; - php_stream *stream = NULL; - - stream = php_stream_open_wrapper_rel(path, mode, options|STREAM_WILL_CAST, opened_path); - - if (stream == NULL) - return NULL; - - if (php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_TRY_HARD|PHP_STREAM_CAST_RELEASE, - (void**)&fp, REPORT_ERRORS) == FAILURE) - { - php_stream_close(stream); - if (opened_path && *opened_path) - efree(*opened_path); - return NULL; - } - return fp; -} -/* }}} */ - -/* {{{ php_stream_make_seekable */ -PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC) -{ - assert(newstream != NULL); - - *newstream = NULL; - - if (((flags & PHP_STREAM_FORCE_CONVERSION) == 0) && origstream->ops->seek != NULL) { - *newstream = origstream; - return PHP_STREAM_UNCHANGED; - } - - /* Use a tmpfile and copy the old streams contents into it */ - - if (flags & PHP_STREAM_PREFER_STDIO) - *newstream = php_stream_fopen_tmpfile(); - else - *newstream = php_stream_temp_new(); - - if (*newstream == NULL) - return PHP_STREAM_FAILED; - - if (php_stream_copy_to_stream(origstream, *newstream, PHP_STREAM_COPY_ALL) == 0) { - php_stream_close(*newstream); - *newstream = NULL; - return PHP_STREAM_CRITICAL; - } - - php_stream_close(origstream); - php_stream_seek(*newstream, 0, SEEK_SET); - - return PHP_STREAM_RELEASED; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/filter.c b/main/streams/filter.c deleted file mode 100644 index c45a1ac0fe055..0000000000000 --- a/main/streams/filter.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include -#include - -#include "php_streams_int.h" - -/* Global filter hash, copied to FG(stream_filters) on registration of volatile filter */ -static HashTable stream_filters_hash; - -/* Should only be used during core initialization */ -PHPAPI HashTable *php_get_stream_filters_hash_global() -{ - return &stream_filters_hash; -} - -/* Normal hash selection/retrieval call */ -PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D) -{ - return (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); -} - -/* API for registering GLOBAL filters */ -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) -{ - return zend_hash_add(&stream_filters_hash, (char*)filterpattern, strlen(filterpattern), factory, sizeof(*factory), NULL); -} - -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC) -{ - return zend_hash_del(&stream_filters_hash, (char*)filterpattern, strlen(filterpattern)); -} - -/* API for registering VOLATILE wrappers */ -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) -{ - if (!FG(stream_filters)) { - php_stream_filter_factory tmpfactory; - - ALLOC_HASHTABLE(FG(stream_filters)); - zend_hash_init(FG(stream_filters), 0, NULL, NULL, 1); - zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL, &tmpfactory, sizeof(php_stream_filter_factory)); - } - - return zend_hash_add(FG(stream_filters), (char*)filterpattern, strlen(filterpattern), factory, sizeof(*factory), NULL); -} - -/* Buckets */ - -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC) -{ - int is_persistent = php_stream_is_persistent(stream); - php_stream_bucket *bucket; - - bucket = (php_stream_bucket*)pemalloc(sizeof(php_stream_bucket), is_persistent); - - if (bucket == NULL) { - return NULL; - } - - bucket->next = bucket->prev = NULL; - - if (is_persistent && !buf_persistent) { - /* all data in a persistent bucket must also be persistent */ - bucket->buf.str.val = pemalloc(buflen, 1); - - if (bucket->buf.str.val == NULL) { - pefree(bucket, 1); - return NULL; - } - - memcpy(bucket->buf.str.val, buf, buflen); - bucket->buf.str.len = buflen; - bucket->own_buf = 1; - } else { - bucket->buf.str.val = buf; - bucket->buf.str.len = buflen; - bucket->own_buf = own_buf; - } - bucket->is_unicode = 0; - bucket->is_persistent = is_persistent; - bucket->refcount = 1; - - return bucket; -} - -PHPAPI php_stream_bucket *php_stream_bucket_new_unicode(php_stream *stream, UChar *buf, int32_t buflen, int own_buf, int buf_persistent TSRMLS_DC) -{ - int is_persistent = php_stream_is_persistent(stream); - php_stream_bucket *bucket; - - bucket = (php_stream_bucket*)pemalloc(sizeof(php_stream_bucket), is_persistent); - - if (bucket == NULL) { - return NULL; - } - - bucket->next = bucket->prev = NULL; - - if (is_persistent && !buf_persistent) { - /* all data in a persistent bucket must also be persistent */ - bucket->buf.ustr.val = safe_pemalloc(sizeof(UChar), buflen, 0, 1); - - if (bucket->buf.ustr.val == NULL) { - pefree(bucket, 1); - return NULL; - } - - memcpy(bucket->buf.ustr.val, buf, buflen); - bucket->buf.ustr.len = buflen; - bucket->own_buf = 1; - } else { - bucket->buf.ustr.val = buf; - bucket->buf.ustr.len = buflen; - bucket->own_buf = own_buf; - } - bucket->is_unicode = 1; - bucket->is_persistent = is_persistent; - bucket->refcount = 1; - - return bucket; -} - -/* Given a bucket, returns a version of that bucket with a writeable buffer. - * If the original bucket has a refcount of 1 and owns its buffer, then it - * is returned unchanged. - * Otherwise, a copy of the buffer is made. - * In both cases, the original bucket is unlinked from its brigade. - * If a copy is made, the original bucket is delref'd. - * */ -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC) -{ - php_stream_bucket *retval; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - - if (bucket->refcount == 1 && bucket->own_buf) { - return bucket; - } - - retval = (php_stream_bucket*)pemalloc(sizeof(php_stream_bucket), bucket->is_persistent); - memcpy(retval, bucket, sizeof(*retval)); - - if (bucket->is_unicode) { - retval->buf.ustr.val = safe_pemalloc(sizeof(UChar), retval->buf.ustr.len, 0, retval->is_persistent); - memcpy(retval->buf.ustr.val, bucket->buf.ustr.val, retval->buf.ustr.len * sizeof(UChar)); - } else { - retval->buf.str.val = pemalloc(retval->buf.str.len, retval->is_persistent); - memcpy(retval->buf.str.val, bucket->buf.str.val, retval->buf.str.len); - } - - retval->refcount = 1; - retval->own_buf = 1; - - php_stream_bucket_delref(bucket TSRMLS_CC); - - return retval; -} - -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC) -{ - *left = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); - *right = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); - - if (*left == NULL || *right == NULL) { - goto exit_fail; - } - - if (in->is_unicode) { - (*left)->buf.ustr.val = safe_pemalloc(sizeof(UChar), length, 0, in->is_persistent); - (*left)->buf.ustr.len = length; - memcpy((*left)->buf.str.val, in->buf.str.val, length * sizeof(UChar)); - - (*right)->buf.ustr.len = in->buf.ustr.len - length; - (*right)->buf.ustr.val = pemalloc((*right)->buf.ustr.len, in->is_persistent); - memcpy((*right)->buf.ustr.val, in->buf.ustr.val + (length * sizeof(UChar)), (*right)->buf.str.len * sizeof(UChar)); - } else { - (*left)->buf.str.val = pemalloc(length, in->is_persistent); - (*left)->buf.str.len = length; - memcpy((*left)->buf.str.val, in->buf.str.val, length); - - (*right)->buf.str.len = in->buf.str.len - length; - (*right)->buf.str.val = pemalloc((*right)->buf.str.len, in->is_persistent); - memcpy((*right)->buf.str.val, in->buf.str.val + length, (*right)->buf.str.len); - } - - (*left)->refcount = 1; - (*left)->own_buf = 1; - (*left)->is_persistent = in->is_persistent; - (*left)->is_unicode = in->is_unicode; - - (*right)->refcount = 1; - (*right)->own_buf = 1; - (*right)->is_persistent = in->is_persistent; - (*right)->is_unicode = in->is_unicode; - - return SUCCESS; - -exit_fail: - if (*right) { - if ((*right)->is_unicode) { - if ((*right)->buf.ustr.val) { - pefree((*right)->buf.ustr.val, in->is_persistent); - } - } else { - if ((*right)->buf.str.val) { - pefree((*right)->buf.str.val, in->is_persistent); - } - } - pefree(*right, in->is_persistent); - } - if (*left) { - if ((*left)->is_unicode) { - if ((*left)->buf.ustr.val) { - pefree((*left)->buf.ustr.val, in->is_persistent); - } - } else { - if ((*left)->buf.str.val) { - pefree((*left)->buf.str.val, in->is_persistent); - } - } - pefree(*left, in->is_persistent); - } - return FAILURE; -} - -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC) -{ - if (--bucket->refcount == 0) { - if (bucket->own_buf) { - pefree(bucket->is_unicode ? bucket->buf.ustr.val : bucket->buf.str.val, bucket->is_persistent); - } - pefree(bucket, bucket->is_persistent); - } -} - -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) -{ - bucket->next = brigade->head; - bucket->prev = NULL; - - if (brigade->head) { - brigade->head->prev = bucket; - } else { - brigade->tail = bucket; - } - brigade->head = bucket; - bucket->brigade = brigade; -} - -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) -{ - bucket->prev = brigade->tail; - bucket->next = NULL; - - if (brigade->tail) { - brigade->tail->next = bucket; - } else { - brigade->head = bucket; - } - brigade->tail = bucket; - bucket->brigade = brigade; -} - -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC) -{ - if (bucket->prev) { - bucket->prev->next = bucket->next; - } else { - bucket->brigade->head = bucket->next; - } - if (bucket->next) { - bucket->next->prev = bucket->prev; - } else { - bucket->brigade->tail = bucket->prev; - } - bucket->brigade = NULL; - bucket->next = bucket->prev = NULL; -} - - - - - - - - -/* We allow very simple pattern matching for filter factories: - * if "convert.charset.utf-8/sjis" is requested, we search first for an exact - * match. If that fails, we try "convert.charset.*", then "convert.*" - * This means that we don't need to clog up the hashtable with a zillion - * charsets (for example) but still be able to provide them all as filters */ -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - HashTable *filter_hash = (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); - php_stream_filter_factory *factory; - php_stream_filter *filter = NULL; - int n; - char *period; - - n = strlen(filtername); - - if (SUCCESS == zend_hash_find(filter_hash, (char*)filtername, n, (void**)&factory)) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); - } else if ((period = strrchr(filtername, '.'))) { - /* try a wildcard */ - char *wildname; - - wildname = estrdup(filtername); - period = wildname + (period - filtername); - while (period && !filter) { - *period = '\0'; - strcat(wildname, ".*"); - if (SUCCESS == zend_hash_find(filter_hash, wildname, strlen(wildname), (void**)&factory)) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); - } - - *period = '\0'; - period = strrchr(wildname, '.'); - } - efree(wildname); - } - - if (filter == NULL) { - /* TODO: these need correct docrefs */ - if (factory == NULL) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to locate filter \"%s\"", filtername); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create or locate filter \"%s\"", filtername); - } - - return filter; -} - -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC) -{ - php_stream_filter *filter; - - filter = (php_stream_filter*) pemalloc_rel_orig(sizeof(php_stream_filter), persistent); - memset(filter, 0, sizeof(php_stream_filter)); - - filter->fops = fops; - filter->abstract = abstract; - filter->is_persistent = persistent; - - return filter; -} - -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC) -{ - if (filter->fops->dtor) - filter->fops->dtor(filter TSRMLS_CC); - pefree(filter, filter->is_persistent); -} - -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) -{ - filter->next = chain->head; - filter->prev = NULL; - - if (chain->head) { - chain->head->prev = filter; - } else { - chain->tail = filter; - } - chain->head = filter; - filter->chain = chain; -} - -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) -{ - php_stream *stream = chain->stream; - - filter->prev = chain->tail; - filter->next = NULL; - if (chain->tail) { - chain->tail->next = filter; - } else { - chain->head = filter; - } - chain->tail = filter; - filter->chain = chain; - - if (&(stream->readfilters) == chain && (stream->readbuf_avail) > 0) { - /* Let's going ahead and wind anything in the buffer through this filter */ - php_stream_bucket_brigade brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_outp = &brig_out; - php_stream_filter_status_t status; - php_stream_bucket *bucket; - - if (stream->readbuf_ofs) { - /* Mask readbuf_ofs from filter */ - bucket = stream->readbuf.head; - if (bucket->is_unicode) { - bucket->buf.ustr.len -= stream->readbuf_ofs; - memmove(bucket->buf.ustr.val, bucket->buf.ustr.val + (stream->readbuf_ofs * sizeof(UChar)), bucket->buf.ustr.len * sizeof(UChar)); - } else { - bucket->buf.str.len -= stream->readbuf_ofs; - memmove(bucket->buf.str.val, bucket->buf.str.val + stream->readbuf_ofs, bucket->buf.str.len); - } - } - - status = filter->fops->filter(stream, filter, &stream->readbuf, brig_outp, NULL, PSFS_FLAG_NORMAL TSRMLS_CC); - - switch (status) { - case PSFS_ERR_FATAL: - /* filter is fundamentally broken, invalidate readbuf and strip the filter */ - if (chain->head == filter) { - chain->head = NULL; - chain->tail = NULL; - } else { - filter->prev->next = NULL; - chain->tail = filter->prev; - } - php_stream_flush_readbuf(stream); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter failed to process pre-buffered data"); - /* Passthru -- Anything successfully filtered can go back on the readbuf */ - case PSFS_PASS_ON: - stream->readbuf_ofs = stream->readbuf_avail = 0; - - /* Merge brig_out */ - while((bucket = brig_out.head)) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_append(&stream->readbuf, bucket TSRMLS_CC); - } - - /* Count available bytes */ - for(bucket = stream->readbuf.head; bucket; bucket = bucket->next) { - stream->readbuf_avail += bucket->is_unicode ? bucket->buf.ustr.len : bucket->buf.str.len; - } - break; - case PSFS_FEED_ME: - /* We don't actually need data yet, - leave this filter in a feed me state until data is needed. - Reset stream's internal read buffer since the filter is "holding" it. */ - stream->readbuf.head = stream->readbuf.tail = NULL; - stream->readbuf_avail = stream->readbuf_ofs = 0; - break; - } - } -} - -PHPAPI int _php_stream_filter_check_chain(php_stream_filter_chain *chain TSRMLS_DC) -{ - php_stream_filter *filter; - long last_output = PSFO_FLAG_OUTPUTS_ANY; - - for(filter = chain->head; filter; filter = filter->next) { - if ((((filter->fops->flags & PSFO_FLAG_ACCEPT_MASK) << PSFO_FLAG_ACCEPT_SHIFT) & last_output) == 0) { - /* Nothing which the last filter outputs is accepted by this filter */ - return FAILURE; - } - if (filter->fops->flags & PSFO_FLAG_OUTPUTS_SAME) { - continue; - } - if (filter->fops->flags & PSFO_FLAG_OUTPUTS_OPPOSITE) { - last_output = ((last_output & PSFO_FLAG_OUTPUTS_STRING) ? PSFO_FLAG_OUTPUTS_UNICODE : 0) | - ((last_output & PSFO_FLAG_OUTPUTS_UNICODE) ? PSFO_FLAG_OUTPUTS_STRING : 0); - continue; - } - last_output = filter->fops->flags & PSFO_FLAG_OUTPUTS_ANY; - } - - return SUCCESS; -} - -PHPAPI int _php_stream_filter_output_prefer_unicode(php_stream_filter *filter TSRMLS_DC) -{ - php_stream_filter_chain *chain = filter->chain; - php_stream_filter *f; - int inverted = 0; - int preferred = (chain = &chain->stream->readfilters ? 1 : 0); - - for (f = filter->next; f ; f = f->next) { - if ((f->fops->flags & PSFO_FLAG_ACCEPTS_STRING) == 0) { - return inverted ^= 1; - } - if ((f->fops->flags & PSFO_FLAG_ACCEPTS_UNICODE) == 0) { - return inverted; - } - if (((f->fops->flags & PSFO_FLAG_OUTPUTS_SAME) == 0) && - ((f->fops->flags & PSFO_FLAG_OUTPUTS_OPPOSITE) == 0)) { - /* Input type for next filter won't effect output -- Might as well go for unicode */ - return inverted ^ 1; - } - if (f->fops->flags & PSFO_FLAG_OUTPUTS_SAME) { - continue; - } - if (f->fops->flags & PSFO_FLAG_OUTPUTS_OPPOSITE) { - inverted ^= 1; - continue; - } - } - - return preferred ^ inverted; -} - -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC) -{ - php_stream_bucket_brigade brig_a = { NULL, NULL }, brig_b = { NULL, NULL }, *inp = &brig_a, *outp = &brig_b, *brig_temp; - php_stream_bucket *bucket; - php_stream_filter_chain *chain; - php_stream_filter *current; - php_stream *stream; - size_t flushed_size = 0; - long flags = (finish ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC); - - if (!filter->chain || !filter->chain->stream) { - /* Filter is not attached to a chain, or chain is somehow not part of a stream */ - return FAILURE; - } - - chain = filter->chain; - stream = chain->stream; - - for(current = filter; current; current = current->next) { - php_stream_filter_status_t status; - - status = filter->fops->filter(stream, filter, inp, outp, NULL, flags TSRMLS_CC); - if (status == PSFS_FEED_ME) { - /* We've flushed the data far enough */ - return SUCCESS; - } - if (status == PSFS_ERR_FATAL) { - return FAILURE; - } - /* Otherwise we have data available to PASS_ON - Swap the brigades and continue */ - brig_temp = inp; - inp = outp; - outp = brig_temp; - outp->head = NULL; - outp->tail = NULL; - - flags = PSFS_FLAG_NORMAL; - } - - /* Last filter returned data via PSFS_PASS_ON - Do something with it */ - - for(bucket = inp->head; bucket; bucket = bucket->next) { - flushed_size += bucket->is_unicode ? bucket->buf.ustr.len : bucket->buf.str.len; - } - - if (flushed_size == 0) { - /* Unlikely, but possible */ - return SUCCESS; - } - - if (chain == &(stream->readfilters)) { - if (stream->readbuf.head) { - /* Merge inp with readbuf */ - for(bucket = inp->head; bucket; bucket = bucket->next) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_append(&stream->readbuf, bucket TSRMLS_CC); - stream->readbuf_avail += bucket->is_unicode ? bucket->buf.ustr.len : bucket->buf.str.len; - } - } else { - /* Just plop it in */ - stream->readbuf = *inp; - stream->readbuf_avail = flushed_size; - stream->readbuf_ofs = 0; - } - } else if (chain == &(stream->writefilters)) { - /* Send flushed data to the stream */ - while ((bucket = inp->head)) { - char *data; - int datalen; - - if (bucket->is_unicode) { - data = bucket->buf.ustr.val; - datalen = bucket->buf.ustr.len * sizeof(UChar); - } else { - data = bucket->buf.str.val; - datalen = bucket->buf.str.len; - } - stream->ops->write(stream, data, datalen TSRMLS_CC); - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } - - return SUCCESS; -} - -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC) -{ - if (filter->prev) { - filter->prev->next = filter->next; - } else { - filter->chain->head = filter->next; - } - if (filter->next) { - filter->next->prev = filter->prev; - } else { - filter->chain->tail = filter->prev; - } - - if (filter->rsrc_id > 0) { - zend_list_delete(filter->rsrc_id); - } - - if (call_dtor) { - php_stream_filter_free(filter TSRMLS_CC); - return NULL; - } - return filter; -} - -PHPAPI int php_stream_bucket_tounicode(php_stream *stream, php_stream_bucket **pbucket, off_t *offset TSRMLS_DC) -{ - int is_persistent = php_stream_is_persistent(stream); - php_stream_bucket *bucket = *pbucket, *prior = bucket->prev, *next = bucket->next; - php_stream_bucket_brigade *brigade = bucket->brigade; - UErrorCode status = U_ZERO_ERROR; - UChar *val; - int32_t len; - - if (bucket->is_unicode) { - return SUCCESS; - } - - zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &val, &len, bucket->buf.str.val, bucket->buf.str.len, &status); - - if (U_FAILURE(status)) { - efree(val); - return FAILURE; - } - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - - /* convert from unicode defaults to non-persistent */ - bucket = php_stream_bucket_new_unicode(stream, val, len, 1, is_persistent TSRMLS_CC); - if (is_persistent) { - efree(val); - } - - bucket->brigade = brigade; - bucket->prev = prior; - bucket->next = next; - - if (prior) { - prior->next = bucket; - } else if (brigade) { - brigade->head = bucket; - } - - if (next) { - next->prev = bucket; - } else if (brigade) { - brigade->tail = bucket; - } - - *pbucket = bucket; - - return SUCCESS; -} - -PHPAPI int php_stream_bucket_tostring(php_stream *stream, php_stream_bucket **pbucket, off_t *offset TSRMLS_DC) -{ - int is_persistent = php_stream_is_persistent(stream); - php_stream_bucket *bucket = *pbucket, *prior = bucket->prev, *next = bucket->next; - php_stream_bucket_brigade *brigade = bucket->brigade; - UErrorCode status = U_ZERO_ERROR; - char *val; - int len; - - if (!bucket->is_unicode) { - return SUCCESS; - } - - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &val, &len, bucket->buf.ustr.val, bucket->buf.ustr.len, &status); - - if (U_FAILURE(status)) { - efree(val); - return FAILURE; - } - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - - /* convert from unicode defaults to non-persistent */ - bucket = php_stream_bucket_new(stream, val, len, 1, is_persistent TSRMLS_CC); - if (is_persistent) { - efree(val); - } - - bucket->brigade = brigade; - bucket->prev = prior; - bucket->next = next; - - if (prior) { - prior->next = bucket; - } else if (brigade) { - brigade->head = bucket; - } - - if (next) { - next->prev = bucket; - } else if (brigade) { - brigade->tail = bucket; - } - - *pbucket = bucket; - - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/memory.c b/main/streams/memory.c deleted file mode 100644 index af050665b15bd..0000000000000 --- a/main/streams/memory.c +++ /dev/null @@ -1,480 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" - -/* Memory streams use a dynamic memory buffer to emulate a stream. - * You can use php_stream_memory_open to create a readonly stream - * from an existing memory buffer. - */ - -/* Temp streams are streams that uses memory streams as long their - * size is less than a given memory amount. When a write operation - * exceeds that limit the content is written to a temporary file. - */ - -/* {{{ ------- MEMORY stream implementation -------*/ - -typedef struct { - char *data; - size_t fpos; - size_t fsize; - size_t smax; - int mode; -} php_stream_memory_data; - - -/* {{{ */ -static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stream_memory_data *ms; - - assert(stream != NULL); - ms = stream->abstract; - assert(ms != NULL); - - if (ms->mode & TEMP_STREAM_READONLY) { - return 0; - } - if (ms->fpos + count > ms->fsize) { - char *tmp; - - if (!ms->data) { - tmp = emalloc(ms->fpos + count); - } else { - tmp = erealloc(ms->data, ms->fpos + count); - } - if (!tmp) { - count = ms->fsize - ms->fpos + 1; - } else { - ms->data = tmp; - ms->fsize = ms->fpos + count; - } - } - if (!ms->data) - count = 0; - if (count) { - assert(buf!= NULL); - memcpy(ms->data+ms->fpos, (char*)buf, count); - ms->fpos += count; - } - return count; -} -/* }}} */ - - -/* {{{ */ -static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stream_memory_data *ms; - - assert(stream != NULL); - ms = stream->abstract; - assert(ms != NULL); - - if (ms->fpos + count > ms->fsize) { - count = ms->fsize - ms->fpos; - } - if (count) { - assert(ms->data!= NULL); - assert(buf!= NULL); - memcpy(buf, ms->data+ms->fpos, count); - ms->fpos += count; - } else { - stream->eof = 1; - } - return count; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_stream_memory_data *ms; - - assert(stream != NULL); - ms = stream->abstract; - assert(ms != NULL); - - if (ms->data && close_handle && ms->mode != TEMP_STREAM_READONLY) { - efree(ms->data); - } - efree(ms); - return 0; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_flush(php_stream *stream TSRMLS_DC) -{ - /* nothing to do here */ - return 0; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - php_stream_memory_data *ms; - - assert(stream != NULL); - ms = stream->abstract; - assert(ms != NULL); - - switch(whence) { - case SEEK_CUR: - if (offset < 0) { - if (ms->fpos < (size_t)(-offset)) { - ms->fpos = 0; - /*return EINVAL;*/ - } else { - ms->fpos = ms->fpos + offset; - } - } else { - if (ms->fpos < (size_t)(offset)) { - ms->fpos = ms->fsize; - /*return EINVAL;*/ - } else { - ms->fpos = ms->fpos + offset; - } - } - *newoffs = ms->fpos; - return 0; - case SEEK_SET: - if (ms->fsize < (size_t)(offset)) { - ms->fpos = ms->fsize; - /*return EINVAL;*/ - } else { - ms->fpos = offset; - } - *newoffs = ms->fpos; - return 0; - case SEEK_END: - if (offset > 0) { - ms->fpos = ms->fsize; - /*return EINVAL;*/ - } else if (ms->fpos < (size_t)(-offset)) { - ms->fpos = 0; - /*return EINVAL;*/ - } else { - ms->fpos = ms->fsize + offset; - } - *newoffs = ms->fpos; - return 0; - default: - return 0; - /*return EINVAL;*/ - } -} -/* }}} */ - -/* {{{ */ -static int php_stream_memory_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - return FAILURE; -} -/* }}} */ - - -php_stream_ops php_stream_memory_ops = { - php_stream_memory_write, php_stream_memory_read, - php_stream_memory_close, php_stream_memory_flush, - "MEMORY", - php_stream_memory_seek, - php_stream_memory_cast, - NULL, /* stat */ - NULL /* set_option */ -}; - - -/* {{{ */ -PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC) -{ - php_stream_memory_data *self; - php_stream *stream; - - self = emalloc(sizeof(*self)); - self->data = NULL; - self->fpos = 0; - self->fsize = 0; - self->smax = -1; - self->mode = mode; - - stream = php_stream_alloc(&php_stream_memory_ops, self, 0, "r+b"); - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return stream; -} -/* }}} */ - - -/* {{{ */ -PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_stream_memory_data *ms; - - if ((stream = php_stream_memory_create_rel(mode)) != NULL) { - ms = stream->abstract; - - if (mode == TEMP_STREAM_READONLY || mode == TEMP_STREAM_TAKE_BUFFER) { - /* use the buffer directly */ - ms->data = buf; - ms->fsize = length; - } else { - if (length) { - assert(buf != NULL); - php_stream_write(stream, buf, length); - } - } - } - return stream; -} -/* }}} */ - - -/* {{{ */ -PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC) -{ - php_stream_memory_data *ms; - - assert(stream != NULL); - ms = stream->abstract; - assert(ms != NULL); - assert(length != 0); - - *length = ms->fsize; - return ms->data; -} -/* }}} */ - -/* }}} */ - -/* {{{ ------- TEMP stream implementation -------*/ - -typedef struct { - php_stream *innerstream; - size_t smax; - int mode; -} php_stream_temp_data; - - -/* {{{ */ -static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stream_temp_data *ts; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) { - size_t memsize; - char *membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); - - if (memsize + count >= ts->smax) { - php_stream *file = php_stream_fopen_tmpfile(); - php_stream_write(file, membuf, memsize); - php_stream_close(ts->innerstream); - ts->innerstream = file; - } - } - return php_stream_write(ts->innerstream, buf, count); -} -/* }}} */ - - -/* {{{ */ -static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stream_temp_data *ts; - size_t got; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - got = php_stream_read(ts->innerstream, buf, count); - - if (!got) { - stream->eof |= ts->innerstream->eof; - } - - return got; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_stream_temp_data *ts; - int ret; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - ret = php_stream_free(ts->innerstream, PHP_STREAM_FREE_CLOSE | (close_handle ? 0 : PHP_STREAM_FREE_PRESERVE_HANDLE)); - - efree(ts); - - return ret; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_flush(php_stream *stream TSRMLS_DC) -{ - php_stream_temp_data *ts; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - return php_stream_flush(ts->innerstream); -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - php_stream_temp_data *ts; - int ret; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - ret = php_stream_seek(ts->innerstream, offset, whence); - *newoffs = php_stream_tell(ts->innerstream); - - return ret; -} -/* }}} */ - -/* {{{ */ -static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_stream_temp_data *ts; - php_stream *file; - size_t memsize; - char *membuf; - off_t pos; - - assert(stream != NULL); - ts = stream->abstract; - assert(ts != NULL); - - if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) { - return php_stream_cast(ts->innerstream, castas, ret, 0); - } - - /* we are still using a memory based backing. If they are if we can be - * a FILE*, say yes because we can perform the conversion. - * If they actually want to perform the conversion, we need to switch - * the memory stream to a tmpfile stream */ - - if (ret == NULL && castas == PHP_STREAM_AS_STDIO) { - return SUCCESS; - } - - /* say "no" to other stream forms */ - if (ret == NULL) { - return FAILURE; - } - - /* perform the conversion and then pass the request on to the innerstream */ - membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); - file = php_stream_fopen_tmpfile(); - php_stream_write(file, membuf, memsize); - pos = php_stream_tell(ts->innerstream); - - php_stream_close(ts->innerstream); - ts->innerstream = file; - php_stream_seek(ts->innerstream, pos, SEEK_SET); - - return php_stream_cast(ts->innerstream, castas, ret, 1); -} -/* }}} */ - -php_stream_ops php_stream_temp_ops = { - php_stream_temp_write, php_stream_temp_read, - php_stream_temp_close, php_stream_temp_flush, - "TEMP", - php_stream_temp_seek, - php_stream_temp_cast, - NULL, /* stat */ - NULL /* set_option */ -}; - -/* }}} */ - -/* {{{ _php_stream_temp_create */ -PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC) -{ - php_stream_temp_data *self; - php_stream *stream; - - self = ecalloc(1, sizeof(*self)); - self->smax = max_memory_usage; - self->mode = mode; - stream = php_stream_alloc(&php_stream_temp_ops, self, 0, "r+b"); - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - self->innerstream = php_stream_memory_create(mode); - - return stream; -} -/* }}} */ - - -/* {{{ _php_stream_temp_open */ -PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_stream_temp_data *ms; - - if ((stream = php_stream_temp_create_rel(mode & ~TEMP_STREAM_READONLY, max_memory_usage)) != NULL) { - if (length) { - assert(buf != NULL); - php_stream_temp_write(stream, buf, length TSRMLS_CC); - } - ms = stream->abstract; - assert(ms != NULL); - ms->mode = mode; - } - return stream; -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/mmap.c b/main/streams/mmap.c deleted file mode 100644 index 32bf84a8b7c71..0000000000000 --- a/main/streams/mmap.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Memory Mapping interface for streams */ -#include "php.h" -#include "php_streams_int.h" - -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC) -{ - php_stream_mmap_range range; - - range.offset = offset; - range.length = length; - range.mode = mode; - range.mapped = NULL; - - /* For now, we impose an arbitrary 2MB limit to avoid - * runaway swapping when large files are passed thru. */ - if (length > 2 * 1024 * 1024) { - return NULL; - } - - if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_MAP_RANGE, &range)) { - if (mapped_len) { - *mapped_len = range.length; - } - return range.mapped; - } - return NULL; -} - -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC) -{ - return php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_UNMAP, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h deleted file mode 100644 index bfd6d0df1afcc..0000000000000 --- a/main/streams/php_stream_context.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Stream context and status notification related definitions */ - -/* callback for status notifications */ -typedef void (*php_stream_notification_func)(php_stream_context *context, - int notifycode, int severity, - char *xmsg, int xcode, - size_t bytes_sofar, size_t bytes_max, - void * ptr TSRMLS_DC); - -#define PHP_STREAM_NOTIFIER_PROGRESS 1 - -/* Attempt to fetch context from the zval passed, - If no context was passed, use the default context - The the default context has not yet been created, do it now. */ -#define php_stream_context_from_zval(zcontext, nocontext) ( \ - (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \ - (nocontext) ? NULL : \ - FG(default_context) ? FG(default_context) : \ - (FG(default_context) = php_stream_context_alloc()) ) - -#define php_stream_context_to_zval(context, zval) { ZVAL_RESOURCE(zval, (context)->rsrc_id); zend_list_addref((context)->rsrc_id); } - -typedef struct _php_stream_notifier php_stream_notifier; - -struct _php_stream_notifier { - php_stream_notification_func func; - void (*dtor)(php_stream_notifier *notifier); - void *ptr; - int mask; - size_t progress, progress_max; /* position for progress notification */ -}; - -struct _php_stream_context { - php_stream_notifier *notifier; - char *output_encoding; /* unicode->string character set */ - char *input_encoding; /* string->unicode character set */ - int default_mode; /* default fopen mode -- PHP_FILE_BINARY vs. PHP_FILE_TEXT -- potentially support other fpc() flags later */ - zval *options; /* hash keyed by wrapper family or specific wrapper */ - zval *links; /* hash keyed by hostent for connection pooling */ - int rsrc_id; /* used for auto-cleanup */ -}; - -BEGIN_EXTERN_C() -PHPAPI void php_stream_context_free(php_stream_context *context); -PHPAPI php_stream_context *php_stream_context_alloc(void); -PHPAPI int php_stream_context_get_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval ***optionvalue); -PHPAPI int php_stream_context_set_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval *optionvalue); - -PHPAPI int php_stream_context_get_link(php_stream_context *context, - const char *hostent, php_stream **stream); -PHPAPI int php_stream_context_set_link(php_stream_context *context, - const char *hostent, php_stream *stream); -PHPAPI int php_stream_context_del_link(php_stream_context *context, - php_stream *stream); - -PHPAPI php_stream_notifier *php_stream_notification_alloc(void); -PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); -END_EXTERN_C() - -/* not all notification codes are implemented */ -#define PHP_STREAM_NOTIFY_RESOLVE 1 -#define PHP_STREAM_NOTIFY_CONNECT 2 -#define PHP_STREAM_NOTIFY_AUTH_REQUIRED 3 -#define PHP_STREAM_NOTIFY_MIME_TYPE_IS 4 -#define PHP_STREAM_NOTIFY_FILE_SIZE_IS 5 -#define PHP_STREAM_NOTIFY_REDIRECTED 6 -#define PHP_STREAM_NOTIFY_PROGRESS 7 -#define PHP_STREAM_NOTIFY_COMPLETED 8 -#define PHP_STREAM_NOTIFY_FAILURE 9 -#define PHP_STREAM_NOTIFY_AUTH_RESULT 10 - -#define PHP_STREAM_NOTIFY_SEVERITY_INFO 0 -#define PHP_STREAM_NOTIFY_SEVERITY_WARN 1 -#define PHP_STREAM_NOTIFY_SEVERITY_ERR 2 - -BEGIN_EXTERN_C() -PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC); -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); -END_EXTERN_C() - -#define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while (0) - -#define php_stream_notify_progress(context, bsofar, bmax) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), PHP_STREAM_NOTIFY_PROGRESS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - NULL, 0, (bsofar), (bmax), NULL TSRMLS_CC); } } while(0) - -#define php_stream_notify_progress_init(context, sofar, bmax) do { if ((context) && (context)->notifier) { \ - (context)->notifier->progress = (sofar); \ - (context)->notifier->progress_max = (bmax); \ - (context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \ - php_stream_notify_progress((context), (sofar), (bmax)); } } while (0) - -#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && (context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS) { \ - (context)->notifier->progress += (dsofar); \ - (context)->notifier->progress_max += (dmax); \ - php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0) - -#define php_stream_notify_file_size(context, file_size, xmsg, xcode) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), PHP_STREAM_NOTIFY_FILE_SIZE_IS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, (file_size), NULL TSRMLS_CC); } } while(0) - -#define php_stream_notify_error(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) {\ - php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while(0) - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h deleted file mode 100644 index 52bdc9165320a..0000000000000 --- a/main/streams/php_stream_filter_api.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | With suggestions from: | - | Moriyoshi Koizumi | - | Sara Golemon | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* The filter API works on the principle of "Bucket-Brigades". This is - * partially inspired by the Apache 2 method of doing things, although - * it is intentially a light-weight implementation. - * - * Each stream can have a chain of filters for reading and another for writing. - * - * When data is written to the stream, is is placed into a bucket and placed at - * the start of the input brigade. - * - * The first filter in the chain is invoked on the brigade and (depending on - * it's return value), the next filter is invoked and so on. - * */ - -#define PHP_STREAM_FILTER_READ 0x0001 -#define PHP_STREAM_FILTER_WRITE 0x0002 -#define PHP_STREAM_FILTER_ALL (PHP_STREAM_FILTER_READ | PHP_STREAM_FILTER_WRITE) - -typedef struct _php_stream_bucket php_stream_bucket; -typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; - -struct _php_stream_bucket { - php_stream_bucket *next, *prev; - php_stream_bucket_brigade *brigade; - - union { - struct { - char *val; - size_t len; - } str; - struct { - UChar *val; - int32_t len; - } ustr; - } buf; - - /* if non-zero, buf should be pefreed when the bucket is destroyed */ - char own_buf; - char is_persistent; - char is_unicode; - - /* destroy this struct when refcount falls to zero */ - int refcount; -}; - -struct _php_stream_bucket_brigade { - php_stream_bucket *head, *tail; -}; - -typedef enum { - PSFS_ERR_FATAL, /* error in data stream */ - PSFS_FEED_ME, /* filter needs more data; stop processing chain until more is available */ - PSFS_PASS_ON, /* filter generated output buckets; pass them on to next in chain */ -} php_stream_filter_status_t; - -/* Buckets API. */ -BEGIN_EXTERN_C() -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC); -PHPAPI php_stream_bucket *php_stream_bucket_new_unicode(php_stream *stream, UChar *buf, int32_t buflen, int own_buf, int buf_persistent TSRMLS_DC); -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC); -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC); -#define php_stream_bucket_addref(bucket) (bucket)->refcount++ -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC); -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC); -PHPAPI int php_stream_bucket_tounicode(php_stream *stream, php_stream_bucket **pbucket, off_t *offset TSRMLS_DC); -PHPAPI int php_stream_bucket_tostring(php_stream *stream, php_stream_bucket **pbucket, off_t *offset TSRMLS_DC); -END_EXTERN_C() - -#define PSFS_FLAG_NORMAL 0 /* regular read/write */ -#define PSFS_FLAG_FLUSH_INC 1 /* an incremental flush */ -#define PSFS_FLAG_FLUSH_CLOSE 2 /* final flush prior to closing */ - -#define PSFO_FLAG_ACCEPTS_STRING (1<<0) /* can process non-unicode buckets */ -#define PSFO_FLAG_ACCEPTS_UNICODE (1<<1) /* can process unicode buckets */ -#define PSFO_FLAG_ACCEPTS_ANY (PSFO_FLAG_ACCEPTS_STRING | PSFO_FLAG_ACCEPTS_UNICODE) - -#define PSFO_FLAG_OUTPUTS_STRING (1<<2) /* can produce non-unicode buckets */ -#define PSFO_FLAG_OUTPUTS_UNICODE (1<<3) /* can produce unicode buckets */ -#define PSFO_FLAG_OUTPUTS_ANY (PSFO_FLAG_OUTPUTS_STRING | PSFO_FLAG_OUTPUTS_UNICODE) - -/* produces buckets of the same type as provided */ -#define PSFO_FLAG_OUTPUTS_SAME ((1<<4) | PSFO_FLAG_ACCEPTS_ANY | PSFO_FLAG_OUTPUTS_ANY) - -/* produces buckets of the opposite type as provided */ -#define PSFO_FLAG_OUTPUTS_OPPOSITE ((1<<5) | PSFO_FLAG_ACCEPTS_ANY | PSFO_FLAG_OUTPUTS_ANY) - -#define PSFO_FLAG_ACCEPT_MASK PSFO_FLAG_ACCEPTS_ANY -#define PSFO_FLAG_ACCEPT_SHIFT 2 /* For comparing filter to filter bucket passing compatability */ - -typedef struct _php_stream_filter_ops { - - php_stream_filter_status_t (*filter)( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC); - - void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); - - const char *label; - - int flags; -} php_stream_filter_ops; - -typedef struct _php_stream_filter_chain { - php_stream_filter *head, *tail; - - /* Owning stream */ - php_stream *stream; -} php_stream_filter_chain; - -struct _php_stream_filter { - php_stream_filter_ops *fops; - void *abstract; /* for use by filter implementation */ - php_stream_filter *next; - php_stream_filter *prev; - int is_persistent; - - /* link into stream and chain */ - php_stream_filter_chain *chain; - - /* buffered buckets */ - php_stream_bucket_brigade buffer; - - /* filters are auto_registered when they're applied */ - int rsrc_id; - int flags; -}; - -/* stack filter onto a stream */ -BEGIN_EXTERN_C() -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI int _php_stream_filter_check_chain(php_stream_filter_chain *chain TSRMLS_DC); -PHPAPI int _php_stream_filter_output_prefer_unicode(php_stream_filter *filter TSRMLS_DC); -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC); -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC); -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC); -END_EXTERN_C() -#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC TSRMLS_CC) -#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter) TSRMLS_CC) -#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter) TSRMLS_CC) -#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish) TSRMLS_CC) -#define php_stream_filter_check_chain(chain) _php_stream_filter_check_chain((chain) TSRMLS_CC) -#define php_stream_filter_output_prefer_unicode(filter) _php_stream_filter_output_prefer_unicode((filter) TSRMLS_CC) - -#define php_stream_is_filtered(stream) ((stream)->readfilters.head || (stream)->writefilters.head) - -typedef struct _php_stream_filter_factory { - php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); -} php_stream_filter_factory; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC); -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h deleted file mode 100644 index ac644dee68503..0000000000000 --- a/main/streams/php_stream_mmap.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Memory Mapping interface for streams. - * The intention is to provide a uniform interface over the most common - * operations that are used within PHP itself, rather than a complete - * API for all memory mapping needs. - * - * ATM, we support only mmap(), but win32 memory mapping support will - * follow soon. - * */ - -typedef enum { - /* Does the stream support mmap ? */ - PHP_STREAM_MMAP_SUPPORTED, - /* Request a range and offset to be mapped; - * while mapped, you MUST NOT use any read/write functions - * on the stream (win9x compatibility) */ - PHP_STREAM_MMAP_MAP_RANGE, - /* Unmap the last range that was mapped for the stream */ - PHP_STREAM_MMAP_UNMAP -} php_stream_mmap_operation_t; - -typedef enum { - PHP_STREAM_MAP_MODE_READONLY, - PHP_STREAM_MAP_MODE_READWRITE, - PHP_STREAM_MAP_MODE_SHARED_READONLY, - PHP_STREAM_MAP_MODE_SHARED_READWRITE -} php_stream_mmap_access_t; - -typedef struct { - /* requested offset and length. - * If length is 0, the whole file is mapped */ - size_t offset; - size_t length; - - php_stream_mmap_access_t mode; - - /* returned mapped address */ - char *mapped; - -} php_stream_mmap_range; - -#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL TSRMLS_CC) == 0 ? 1 : 0) - -/* Returns 1 if the stream in its current state can be memory mapped, - * 0 otherwise */ -#define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream))) - -BEGIN_EXTERN_C() -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC); -#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len) TSRMLS_CC) - -/* un-maps the last mapped range */ -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC); -#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream) TSRMLS_CC) -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h deleted file mode 100644 index 1d3374f98ae70..0000000000000 --- a/main/streams/php_stream_plain_wrapper.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* definitions for the plain files wrapper */ - -/* operations for a plain file; use the php_stream_fopen_XXX funcs below */ -PHPAPI extern php_stream_ops php_stream_stdio_ops; -PHPAPI extern php_stream_wrapper php_plain_files_wrapper; - -BEGIN_EXTERN_C() - -/* like fopen, but returns a stream */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC) - -/* This is a utility API for extensions that are opening a stream, converting it - * to a FILE* and then closing it again. Be warned that fileno() on the result - * will most likely fail on systems with fopencookie. */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC) - -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h deleted file mode 100644 index 8b5989f5b0f4f..0000000000000 --- a/main/streams/php_stream_transport.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if HAVE_SYS_SOCKET_H -# include -#endif - -typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long protolen, - char *resourcename, long resourcenamelen, - const char *persistent_id, int options, int flags, - struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC); -typedef php_stream_transport_factory_func *php_stream_transport_factory; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC); -PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC); - -#define STREAM_XPORT_CLIENT 0 -#define STREAM_XPORT_SERVER 1 - -#define STREAM_XPORT_CONNECT 2 -#define STREAM_XPORT_BIND 4 -#define STREAM_XPORT_LISTEN 8 -#define STREAM_XPORT_CONNECT_ASYNC 16 - -/* Open a client or server socket connection */ -PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, - int flags, const char *persistent_id, - struct timeval *timeout, - php_stream_context *context, - char **error_string, - int *error_code - STREAMS_DC TSRMLS_DC); - -#define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode) \ - _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC TSRMLS_CC) - -/* Bind the stream to a local address */ -PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, long namelen, - char **error_text - TSRMLS_DC); - -/* Connect to a remote address */ -PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, long namelen, - int asynchronous, - struct timeval *timeout, - char **error_text, - int *error_code - TSRMLS_DC); - -/* Prepare to listen */ -PHPAPI int php_stream_xport_listen(php_stream *stream, - int backlog, - char **error_text - TSRMLS_DC); - -/* Get the next client and their address as a string, or the underlying address - * structure. You must efree either of these if you request them */ -PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen, - struct timeval *timeout, - char **error_text - TSRMLS_DC); - -/* Get the name of either the socket or it's peer */ -PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen - TSRMLS_DC); - -enum php_stream_xport_send_recv_flags { - STREAM_OOB = 1, - STREAM_PEEK = 2 -}; - -/* Similar to recv() system call; read data from the stream, optionally - * peeking, optionally retrieving OOB data */ -PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, - long flags, void **addr, socklen_t *addrlen, - char **textaddr, int *textaddrlen TSRMLS_DC); - -/* Similar to send() system call; send data to the stream, optionally - * sending it as OOB data */ -PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - long flags, void *addr, socklen_t addrlen TSRMLS_DC); -END_EXTERN_C() - -/* Structure definition for the set_option interface that the above functions wrap */ - -typedef struct _php_stream_xport_param { - enum { - STREAM_XPORT_OP_BIND, STREAM_XPORT_OP_CONNECT, - STREAM_XPORT_OP_LISTEN, STREAM_XPORT_OP_ACCEPT, - STREAM_XPORT_OP_CONNECT_ASYNC, - STREAM_XPORT_OP_GET_NAME, - STREAM_XPORT_OP_GET_PEER_NAME, - STREAM_XPORT_OP_RECV, - STREAM_XPORT_OP_SEND - } op; - unsigned int want_addr:1; - unsigned int want_textaddr:1; - unsigned int want_errortext:1; - - struct { - char *name; - long namelen; - int backlog; - struct timeval *timeout; - struct sockaddr *addr; - socklen_t addrlen; - char *buf; - size_t buflen; - long flags; - } inputs; - struct { - php_stream *client; - int returncode; - struct sockaddr *addr; - socklen_t addrlen; - char *textaddr; - long textaddrlen; - - char *error_text; - int error_code; - } outputs; -} php_stream_xport_param; - - -/* These functions provide crypto support on the underlying transport */ -typedef enum { - STREAM_CRYPTO_METHOD_SSLv2_CLIENT, - STREAM_CRYPTO_METHOD_SSLv3_CLIENT, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, - STREAM_CRYPTO_METHOD_TLS_CLIENT, - STREAM_CRYPTO_METHOD_SSLv2_SERVER, - STREAM_CRYPTO_METHOD_SSLv3_SERVER, - STREAM_CRYPTO_METHOD_SSLv23_SERVER, - STREAM_CRYPTO_METHOD_TLS_SERVER -} php_stream_xport_crypt_method_t; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC); -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC); -END_EXTERN_C() - -typedef struct _php_stream_xport_crypto_param { - enum { - STREAM_XPORT_CRYPTO_OP_SETUP, - STREAM_XPORT_CRYPTO_OP_ENABLE - } op; - struct { - int activate; - php_stream_xport_crypt_method_t method; - php_stream *session; - } inputs; - struct { - int returncode; - } outputs; -} php_stream_xport_crypto_param; - -BEGIN_EXTERN_C() -PHPAPI HashTable *php_stream_xport_get_hash(void); -PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory; -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h deleted file mode 100644 index 0b1ac88468dac..0000000000000 --- a/main/streams/php_stream_userspace.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -/* for user-space streams */ -PHPAPI extern php_stream_ops php_stream_userspace_ops; -PHPAPI extern php_stream_ops php_stream_userspace_dir_ops; -#define PHP_STREAM_IS_USERSPACE &php_stream_userspace_ops -#define PHP_STREAM_IS_USERSPACE_DIR &php_stream_userspace_dir_ops - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h deleted file mode 100644 index ed75e54b9b2fc..0000000000000 --- a/main/streams/php_streams_int.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#if ZEND_DEBUG - -#if USE_ZEND_ALLOC -# define emalloc_rel_orig(size) \ - ( __php_stream_call_depth == 0 \ - ? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ - : _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) - -# define erealloc_rel_orig(ptr, size) \ - ( __php_stream_call_depth == 0 \ - ? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ - : _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) -#else -# define emalloc_rel_orig(size) emalloc(size) -# define erealloc_rel_orig(ptr, size) erealloc(ptr, size) -#endif - -#define pemalloc_rel_orig(size, persistent) ((persistent) ? malloc((size)) : emalloc_rel_orig((size))) -#define perealloc_rel_orig(ptr, size, persistent) ((persistent) ? realloc((ptr), (size)) : erealloc_rel_orig((ptr), (size))) -#else -# define pemalloc_rel_orig(size, persistent) pemalloc((size), (persistent)) -# define perealloc_rel_orig(ptr, size, persistent) perealloc((ptr), (size), (persistent)) -# define emalloc_rel_orig(size) emalloc((size)) -#endif - -#define STREAM_DEBUG 0 -#define STREAM_WRAPPER_PLAIN_FILES ((php_stream_wrapper*)-1) -extern php_stream_wrapper php_plain_files_wrapper; - -#ifndef MAP_FAILED -#define MAP_FAILED ((void *) -1) -#endif - -#define CHUNK_SIZE 8192 - -#ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC); -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC); - diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c deleted file mode 100644 index 6acb5edc86bce..0000000000000 --- a/main/streams/plain_wrapper.c +++ /dev/null @@ -1,1357 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include "ext/standard/flock_compat.h" -#include -#include -#if HAVE_SYS_WAIT_H -#include -#endif -#if HAVE_SYS_FILE_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif -#include "SAPI.h" - -#include "php_streams_int.h" - -/* parse standard "fopen" modes into open() flags */ -PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) -{ - int flags; - - switch (mode[0]) { - case 'r': - flags = 0; - break; - case 'w': - flags = O_TRUNC|O_CREAT; - break; - case 'a': - flags = O_CREAT|O_APPEND; - break; - case 'x': - flags = O_CREAT|O_EXCL; - break; - default: - /* unknown mode */ - return FAILURE; - } - - if (strchr(mode, '+')) { - flags |= O_RDWR; - } else if (flags) { - flags |= O_WRONLY; - } else { - flags |= O_RDONLY; - } - -#if defined(_O_TEXT) && defined(O_BINARY) - if (strchr(mode, 't')) { - flags |= _O_TEXT; - } else { - flags |= O_BINARY; - } -#endif - - *open_flags = flags; - return SUCCESS; -} - - -/* {{{ ------- STDIO stream implementation -------*/ - -typedef struct { - FILE *file; - int fd; /* underlying file descriptor */ - unsigned is_process_pipe:1; /* use pclose instead of fclose */ - unsigned is_pipe:1; /* don't try and seek */ - unsigned cached_fstat:1; /* sb is valid */ - unsigned _reserved:29; - - int lock_flag; /* stores the lock state */ - char *temp_file_name; /* if non-null, this is the path to a temporary file that - * is to be deleted when the stream is closed */ -#if HAVE_FLUSHIO - char last_op; -#endif - -#if HAVE_MMAP - char *last_mapped_addr; - size_t last_mapped_len; -#endif -#ifdef PHP_WIN32 - char *last_mapped_addr; - HANDLE file_mapping; -#endif - - struct stat sb; -} php_stdio_stream_data; -#define PHP_STDIOP_GET_FD(anfd, data) anfd = (data)->file ? fileno((data)->file) : (data)->fd - -static int do_fstat(php_stdio_stream_data *d, int force) -{ - if (!d->cached_fstat || force) { - int fd; - int r; - - PHP_STDIOP_GET_FD(fd, d); - r = fstat(fd, &d->sb); - d->cached_fstat = r == 0; - - return r; - } - return 0; -} - -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC) -{ - int fd = php_open_temporary_fd(dir, pfx, opened_path TSRMLS_CC); - - if (fd != -1) { - php_stream *stream = php_stream_fopen_from_fd_rel(fd, "r+b", NULL); - if (stream) { - return stream; - } - close(fd); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream"); - - return NULL; - } - return NULL; -} - -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC) -{ - char *opened_path = NULL; - int fd = php_open_temporary_fd(NULL, "php", &opened_path TSRMLS_CC); - - if (fd != -1) { - php_stream *stream = php_stream_fopen_from_fd_rel(fd, "r+b", NULL); - if (stream) { - php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract; - stream->wrapper = &php_plain_files_wrapper; - stream->orig_path = estrdup(opened_path); - - self->temp_file_name = opened_path; - self->lock_flag = LOCK_UN; - - return stream; - } - close(fd); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream"); - - return NULL; - } - return NULL; -} - -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - php_stream *stream; - - self = pemalloc_rel_orig(sizeof(*self), persistent_id); - memset(self, 0, sizeof(*self)); - self->file = NULL; - self->is_pipe = 0; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 0; - self->temp_file_name = NULL; - self->fd = fd; - -#ifdef S_ISFIFO - /* detect if this is a pipe */ - if (self->fd >= 0) { - self->is_pipe = (do_fstat(self, 0) == 0 && S_ISFIFO(self->sb.st_mode)) ? 1 : 0; - } -#elif defined(PHP_WIN32) - { - long handle = _get_osfhandle(self->fd); - DWORD in_buf_size, out_buf_size; - - if (handle != 0xFFFFFFFF) { - self->is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, &out_buf_size, &in_buf_size, NULL); - } - } -#endif - - stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, persistent_id, mode); - - if (stream) { - if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - } else { - stream->position = lseek(self->fd, 0, SEEK_CUR); -#ifdef ESPIPE - if (stream->position == (off_t)-1 && errno == ESPIPE) { - stream->position = 0; - self->is_pipe = 1; - } -#endif - } - } - - return stream; -} - -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - php_stream *stream; - - self = emalloc_rel_orig(sizeof(*self)); - memset(self, 0, sizeof(*self)); - self->file = file; - self->is_pipe = 0; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 0; - self->temp_file_name = NULL; - self->fd = fileno(file); - -#ifdef S_ISFIFO - /* detect if this is a pipe */ - if (self->fd >= 0) { - self->is_pipe = (do_fstat(self, 0) == 0 && S_ISFIFO(self->sb.st_mode)) ? 1 : 0; - } -#elif defined(PHP_WIN32) - { - long handle = _get_osfhandle(self->fd); - DWORD in_buf_size, out_buf_size; - - if (handle != 0xFFFFFFFF) { - self->is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, &out_buf_size, &in_buf_size, NULL); - } - } -#endif - - stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); - - if (stream) { - if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - } else { - stream->position = ftell(file); - } - } - - return stream; -} - -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - php_stream *stream; - - self = emalloc_rel_orig(sizeof(*self)); - memset(self, 0, sizeof(*self)); - self->file = file; - self->is_pipe = 1; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 1; - self->fd = fileno(file); - self->temp_file_name = NULL; - - stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - return stream; -} - -static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - - if (data->fd >= 0) { - int bytes_written = write(data->fd, buf, count); - if (bytes_written < 0) return 0; - return (size_t) bytes_written; - } else { - -#if HAVE_FLUSHIO - if (!data->is_pipe && data->last_op == 'r') { - fseek(data->file, 0, SEEK_CUR); - } - data->last_op = 'w'; -#endif - - return fwrite(buf, 1, count, data->file); - } -} - -static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - size_t ret; - - assert(data != NULL); - - if (data->fd >= 0) { - ret = read(data->fd, buf, count); - - stream->eof = (ret == 0 || (ret == -1 && errno != EWOULDBLOCK)); - - } else { -#if HAVE_FLUSHIO - if (!data->is_pipe && data->last_op == 'w') - fseek(data->file, 0, SEEK_CUR); - data->last_op = 'r'; -#endif - - ret = fread(buf, 1, count, data->file); - - stream->eof = feof(data->file); - } - return ret; -} - -static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - int ret; - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - -#if HAVE_MMAP - if (data->last_mapped_addr) { - munmap(data->last_mapped_addr, data->last_mapped_len); - data->last_mapped_addr = NULL; - } -#elif defined(PHP_WIN32) - if (data->last_mapped_addr) { - UnmapViewOfFile(data->last_mapped_addr); - data->last_mapped_addr = NULL; - } - if (data->file_mapping) { - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - } -#endif - - if (close_handle) { - if (data->lock_flag != LOCK_UN) { - php_stream_lock(stream, LOCK_UN); - } - if (data->file) { - if (data->is_process_pipe) { - errno = 0; - ret = pclose(data->file); - -#if HAVE_SYS_WAIT_H - if (WIFEXITED(ret)) { - ret = WEXITSTATUS(ret); - } -#endif - } else { - ret = fclose(data->file); - data->file = NULL; - } - } else if (data->fd != -1) { -#ifdef PHP_DEBUG - if ((data->fd == 1 || data->fd == 2) && 0 == strcmp(sapi_module.name, "cli")) { - /* don't close stdout or stderr in CLI in DEBUG mode, as we want to see any leaks */ - ret = 0; - } else { - ret = close(data->fd); - } -#else - ret = close(data->fd); -#endif - data->fd = -1; - } else { - return 0; /* everything should be closed already -> success */ - } - if (data->temp_file_name) { - unlink(data->temp_file_name); - /* temporary streams are never persistent */ - efree(data->temp_file_name); - data->temp_file_name = NULL; - } - } else { - ret = 0; - data->file = NULL; - data->fd = -1; - } - - pefree(data, stream->is_persistent); - - return ret; -} - -static int php_stdiop_flush(php_stream *stream TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - - /* - * stdio buffers data in user land. By calling fflush(3), this - * data is send to the kernel using write(2). fsync'ing is - * something completely different. - */ - if (data->file) { - return fflush(data->file); - } - return 0; -} - -static int php_stdiop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - int ret; - - assert(data != NULL); - - if (data->is_pipe) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot seek on a pipe"); - return -1; - } - - if (data->fd >= 0) { - off_t result; - - result = lseek(data->fd, offset, whence); - if (result == (off_t)-1) - return -1; - - *newoffset = result; - return 0; - - } else { - ret = fseek(data->file, offset, whence); - *newoffset = ftell(data->file); - return ret; - } -} - -static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - int fd; - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - - assert(data != NULL); - - /* as soon as someone touches the stdio layer, buffering may ensue, - * so we need to stop using the fd directly in that case */ - - switch (castas) { - case PHP_STREAM_AS_STDIO: - if (ret) { - - if (data->file == NULL) { - /* we were opened as a plain file descriptor, so we - * need fdopen now */ - data->file = fdopen(data->fd, stream->mode); - if (data->file == NULL) { - return FAILURE; - } - } - - *(FILE**)ret = data->file; - data->fd = -1; - } - return SUCCESS; - - case PHP_STREAM_AS_FD_FOR_SELECT: - PHP_STDIOP_GET_FD(fd, data); - if (fd < 0) { - return FAILURE; - } - if (ret) { - *(int*)ret = fd; - } - return SUCCESS; - - case PHP_STREAM_AS_FD: - PHP_STDIOP_GET_FD(fd, data); - - if (fd < 0) { - return FAILURE; - } - if (data->file) { - fflush(data->file); - } - if (ret) { - *(int*)ret = fd; - } - return SUCCESS; - default: - return FAILURE; - } -} - -static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - int ret; - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - - assert(data != NULL); - - ret = do_fstat(data, 1); - memcpy(&ssb->sb, &data->sb, sizeof(ssb->sb)); - return ret; -} - -static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - size_t size; - int fd; -#ifdef O_NONBLOCK - /* FIXME: make this work for win32 */ - int flags; - int oldval; -#endif - - PHP_STDIOP_GET_FD(fd, data); - - switch(option) { - case PHP_STREAM_OPTION_BLOCKING: - if (fd == -1) - return -1; -#ifdef O_NONBLOCK - flags = fcntl(fd, F_GETFL, 0); - oldval = (flags & O_NONBLOCK) ? 0 : 1; - if (value) - flags ^= O_NONBLOCK; - else - flags |= O_NONBLOCK; - - if (-1 == fcntl(fd, F_SETFL, flags)) - return -1; - return oldval; -#else - return -1; /* not yet implemented */ -#endif - - case PHP_STREAM_OPTION_WRITE_BUFFER: - - if (data->file == NULL) { - return -1; - } - - if (ptrparam) - size = *(size_t *)ptrparam; - else - size = BUFSIZ; - - switch(value) { - case PHP_STREAM_BUFFER_NONE: - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IONBF, 0); - - case PHP_STREAM_BUFFER_LINE: - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IOLBF, size); - - case PHP_STREAM_BUFFER_FULL: - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IOFBF, size); - - default: - return -1; - } - break; - - case PHP_STREAM_OPTION_LOCKING: - if (fd == -1) { - return -1; - } - - if ((long) ptrparam == PHP_STREAM_LOCK_SUPPORTED) { - return 0; - } - - if (!flock(fd, value)) { - data->lock_flag = value; - return 0; - } else { - return -1; - } - break; - - case PHP_STREAM_OPTION_MMAP_API: -#if HAVE_MMAP - { - php_stream_mmap_range *range = (php_stream_mmap_range*)ptrparam; - int prot, flags; - - switch (value) { - case PHP_STREAM_MMAP_SUPPORTED: - return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_MAP_RANGE: - do_fstat(data, 1); - if (range->length == 0 || range->length > data->sb.st_size) { - range->length = data->sb.st_size; - } - switch (range->mode) { - case PHP_STREAM_MAP_MODE_READONLY: - prot = PROT_READ; - flags = MAP_PRIVATE; - break; - case PHP_STREAM_MAP_MODE_READWRITE: - prot = PROT_READ | PROT_WRITE; - flags = MAP_PRIVATE; - break; - case PHP_STREAM_MAP_MODE_SHARED_READONLY: - prot = PROT_READ; - flags = MAP_SHARED; - break; - case PHP_STREAM_MAP_MODE_SHARED_READWRITE: - prot = PROT_READ | PROT_WRITE; - flags = MAP_SHARED; - break; - default: - return PHP_STREAM_OPTION_RETURN_ERR; - } - range->mapped = (char*)mmap(NULL, range->length, prot, flags, fd, range->offset); - if (range->mapped == (char*)MAP_FAILED) { - range->mapped = NULL; - return PHP_STREAM_OPTION_RETURN_ERR; - } - /* remember the mapping */ - data->last_mapped_addr = range->mapped; - data->last_mapped_len = range->length; - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_UNMAP: - if (data->last_mapped_addr) { - munmap(data->last_mapped_addr, data->last_mapped_len); - data->last_mapped_addr = NULL; - - return PHP_STREAM_OPTION_RETURN_OK; - } - return PHP_STREAM_OPTION_RETURN_ERR; - } - } -#elif defined(PHP_WIN32) - { - php_stream_mmap_range *range = (php_stream_mmap_range*)ptrparam; - HANDLE hfile = (HANDLE)_get_osfhandle(fd); - DWORD prot, acc, loffs = 0, delta = 0; - - switch (value) { - case PHP_STREAM_MMAP_SUPPORTED: - return hfile == INVALID_HANDLE_VALUE ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_MAP_RANGE: - switch (range->mode) { - case PHP_STREAM_MAP_MODE_READONLY: - prot = PAGE_READONLY; - acc = FILE_MAP_READ; - break; - case PHP_STREAM_MAP_MODE_READWRITE: - prot = PAGE_READWRITE; - acc = FILE_MAP_READ | FILE_MAP_WRITE; - break; - case PHP_STREAM_MAP_MODE_SHARED_READONLY: - prot = PAGE_READONLY; - acc = FILE_MAP_READ; - /* TODO: we should assign a name for the mapping */ - break; - case PHP_STREAM_MAP_MODE_SHARED_READWRITE: - prot = PAGE_READWRITE; - acc = FILE_MAP_READ | FILE_MAP_WRITE; - /* TODO: we should assign a name for the mapping */ - break; - } - - /* create a mapping capable of viewing the whole file (this costs no real resources) */ - data->file_mapping = CreateFileMapping(hfile, NULL, prot, 0, 0, NULL); - - if (data->file_mapping == NULL) { - return PHP_STREAM_OPTION_RETURN_ERR; - } - - if (range->length == 0) { - range->length = GetFileSize(hfile, NULL) - range->offset; - } - - /* figure out how big a chunk to map to be able to view the part that we need */ - if (range->offset != 0) { - SYSTEM_INFO info; - DWORD gran; - - GetSystemInfo(&info); - gran = info.dwAllocationGranularity; - loffs = (range->offset / gran) * gran; - delta = range->offset - loffs; - } - - data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length); - - if (data->last_mapped_addr) { - /* give them back the address of the start offset they requested */ - range->mapped = data->last_mapped_addr + delta; - return PHP_STREAM_OPTION_RETURN_OK; - } - - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - - return PHP_STREAM_OPTION_RETURN_ERR; - - case PHP_STREAM_MMAP_UNMAP: - if (data->last_mapped_addr) { - UnmapViewOfFile(data->last_mapped_addr); - data->last_mapped_addr = NULL; - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - return PHP_STREAM_OPTION_RETURN_OK; - } - return PHP_STREAM_OPTION_RETURN_ERR; - - default: - return PHP_STREAM_OPTION_RETURN_ERR; - } - } - -#endif - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - - case PHP_STREAM_OPTION_TRUNCATE_API: - switch (value) { - case PHP_STREAM_TRUNCATE_SUPPORTED: - return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_TRUNCATE_SET_SIZE: - return ftruncate(fd, *(size_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; - } - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} - -PHPAPI php_stream_ops php_stream_stdio_ops = { - php_stdiop_write, php_stdiop_read, - php_stdiop_close, php_stdiop_flush, - "STDIO", - php_stdiop_seek, - php_stdiop_cast, - php_stdiop_stat, - php_stdiop_set_option -}; -/* }}} */ - -/* {{{ plain files opendir/readdir implementation */ -static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - DIR *dir = (DIR*)stream->abstract; - /* avoid libc5 readdir problems */ - char entry[sizeof(struct dirent)+MAXPATHLEN]; - struct dirent *result = (struct dirent *)&entry; - php_stream_dirent *ent = (php_stream_dirent*)buf; - - /* avoid problems if someone mis-uses the stream */ - if (count != sizeof(php_stream_dirent)) - return 0; - - if (php_readdir_r(dir, (struct dirent *)entry, &result) == 0 && result) { - PHP_STRLCPY(ent->d_name, result->d_name, sizeof(ent->d_name), strlen(result->d_name)); - return sizeof(php_stream_dirent); - } - return 0; -} - -static int php_plain_files_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - return closedir((DIR *)stream->abstract); -} - -static int php_plain_files_dirstream_rewind(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - rewinddir((DIR *)stream->abstract); - return 0; -} - -static php_stream_ops php_plain_files_dirstream_ops = { - NULL, php_plain_files_dirstream_read, - php_plain_files_dirstream_close, NULL, - "dir", - php_plain_files_dirstream_rewind, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, char *path, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - DIR *dir = NULL; - php_stream *stream = NULL; - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { - return NULL; - } - - if (PG(safe_mode) &&(!php_checkuid(path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return NULL; - } - - dir = VCWD_OPENDIR(path); - -#ifdef PHP_WIN32 - if (dir && dir->finished) { - closedir(dir); - dir = NULL; - } -#endif - if (dir) { - stream = php_stream_alloc(&php_plain_files_dirstream_ops, dir, 0, mode); - if (stream == NULL) - closedir(dir); - } - - return stream; -} -/* }}} */ - -/* {{{ php_stream_fopen */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC) -{ - char *realpath = NULL; - int open_flags; - int fd; - php_stream *ret; - int persistent = options & STREAM_OPEN_PERSISTENT; - char *persistent_id = NULL; - - if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "`%s' is not a valid mode for fopen", mode); - } - return NULL; - } - - if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) { - return NULL; - } - - if (persistent) { - spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath); - switch (php_stream_from_persistent_id(persistent_id, &ret TSRMLS_CC)) { - case PHP_STREAM_PERSISTENT_SUCCESS: - if (opened_path) { - *opened_path = realpath; - realpath = NULL; - } - if (realpath) { - efree(realpath); - } - /* fall through */ - - case PHP_STREAM_PERSISTENT_FAILURE: - efree(persistent_id);; - return ret; - } - } - - fd = open(realpath, open_flags, 0666); - - if (fd != -1) { - - ret = php_stream_fopen_from_fd_rel(fd, mode, persistent_id); - - if (ret) { - if (opened_path) { - *opened_path = realpath; - realpath = NULL; - } - if (realpath) { - efree(realpath); - } - if (persistent_id) { - efree(persistent_id); - } - - /* sanity checks for include/require. - * We check these after opening the stream, so that we save - * on fstat() syscalls */ - if (options & STREAM_OPEN_FOR_INCLUDE) { - php_stdio_stream_data *self = (php_stdio_stream_data*)ret->abstract; - int r; - - r = do_fstat(self, 0); - if ( -#ifndef PHP_WIN32 - (r != 0) || /* it is OK for fstat to fail under win32 */ -#endif - (r == 0 && !S_ISREG(self->sb.st_mode))) { - php_stream_close(ret); - return NULL; - } - } - - return ret; - } - close(fd); - } - efree(realpath); - if (persistent_id) { - efree(persistent_id); - } - return NULL; -} -/* }}} */ - - -static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - if ((options & USE_PATH) && PG(include_path) != NULL) { - return php_stream_fopen_with_path_rel(path, mode, PG(include_path), opened_path, options); - } - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { - return NULL; - } - - if ((options & ENFORCE_SAFE_MODE) && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) - return NULL; - - return php_stream_fopen_rel(path, mode, opened_path, options); -} - -static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - - if (strncmp(url, "file://", sizeof("file://") - 1) == 0) { - url += sizeof("file://") - 1; - } - - if (PG(safe_mode) &&(!php_checkuid_ex(url, NULL, CHECKUID_CHECK_FILE_AND_DIR, (flags & PHP_STREAM_URL_STAT_QUIET) ? CHECKUID_NO_ERRORS : 0))) { - return -1; - } - - if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1 TSRMLS_CC)) { - return -1; - } - -#ifdef HAVE_SYMLINK - if (flags & PHP_STREAM_URL_STAT_LINK) { - return VCWD_LSTAT(url, &ssb->sb); - } else -#endif - return VCWD_STAT(url, &ssb->sb); -} - -static int php_plain_files_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - char *p; - int ret; - zval funcname; - zval *retval = NULL; - - if ((p = strstr(url, "://")) != NULL) { - url = p + 3; - } - - if (options & ENFORCE_SAFE_MODE) { - if (PG(safe_mode) && !php_checkuid(url, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - return 0; - } - - if (php_check_open_basedir(url TSRMLS_CC)) { - return 0; - } - } - - ret = VCWD_UNLINK(url); - if (ret == -1) { - if (options & REPORT_ERRORS) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); - } - return 0; - } - /* Clear stat cache */ - ZVAL_STRINGL(&funcname, "clearstatcache", sizeof("clearstatcache")-1, 0); - call_user_function_ex(CG(function_table), NULL, &funcname, &retval, 0, NULL, 0, NULL TSRMLS_CC); - if (retval) { - zval_ptr_dtor(&retval); - } - return 1; -} - -static int php_plain_files_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) -{ - char *p; - int ret; - - if (!url_from || !url_to) { - return 0; - } - - if ((p = strstr(url_from, "://")) != NULL) { - url_from = p + 3; - } - - if ((p = strstr(url_to, "://")) != NULL) { - url_to = p + 3; - } - - if (PG(safe_mode) && (!php_checkuid(url_from, NULL, CHECKUID_CHECK_FILE_AND_DIR) || - !php_checkuid(url_to, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return 0; - } - - if (php_check_open_basedir(url_from TSRMLS_CC) || php_check_open_basedir(url_to TSRMLS_CC)) { - return 0; - } - - ret = VCWD_RENAME(url_from, url_to); - - if (ret == -1) { -#ifdef EXDEV - if (errno == EXDEV) { - struct stat sb; - if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) { - if (VCWD_STAT(url_from, &sb) == 0) { -#if !defined(TSRM_WIN32) && !defined(NETWARE) - if (VCWD_CHMOD(url_to, sb.st_mode)) { - if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - VCWD_UNLINK(url_from); - return 1; - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } - if (VCWD_CHOWN(url_to, sb.st_uid, sb.st_gid)) { - if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - VCWD_UNLINK(url_from); - return 1; - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } -#endif - VCWD_UNLINK(url_from); - return 1; - } - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } -#endif - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } - - return 1; -} - -static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - int ret, recursive = options & PHP_STREAM_MKDIR_RECURSIVE; - char *p; - - if ((p = strstr(dir, "://")) != NULL) { - dir = p + 3; - } - - if (!recursive) { - ret = php_mkdir(dir, mode TSRMLS_CC); - } else { - /* we look for directory separator from the end of string, thus hopefuly reducing our work load */ - char *e, *buf; - struct stat sb; - int dir_len = strlen(dir); - int offset = 0; - - buf = estrndup(dir, dir_len); - e = buf + dir_len; - - if ((p = memchr(buf, DEFAULT_SLASH, dir_len))) { - offset = p - buf + 1; - } - - /* find a top level directory we need to create */ - while ((p = strrchr(buf + offset, DEFAULT_SLASH))) { - *p = '\0'; - if (VCWD_STAT(buf, &sb) == 0) { - *p = DEFAULT_SLASH; - break; - } - } - - if (p == buf) { - ret = php_mkdir(dir, mode TSRMLS_CC); - } else if (!(ret = php_mkdir(buf, mode TSRMLS_CC))) { - if (!p) { - p = buf; - } - /* create any needed directories if the creation of the 1st directory worked */ - while (++p != e) { - if (*p == '\0' && *(p + 1) != '\0') { - *p = DEFAULT_SLASH; - if ((ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - break; - } - } - } - } - efree(buf); - } - if (ret < 0) { - /* Failure */ - return 0; - } else { - /* Success */ - return 1; - } -} - -static int php_plain_files_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - if (PG(safe_mode) &&(!php_checkuid(url, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return 0; - } - - if (php_check_open_basedir(url TSRMLS_CC)) { - return 0; - } - - if (VCWD_RMDIR(url) < 0) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); - return 0; - } - - return 1; -} - -static php_stream_wrapper_ops php_plain_files_wrapper_ops = { - php_plain_files_stream_opener, - NULL, - NULL, - php_plain_files_url_stater, - php_plain_files_dir_opener, - "plainfile", - php_plain_files_unlink, - php_plain_files_rename, - php_plain_files_mkdir, - php_plain_files_rmdir -}; - -php_stream_wrapper php_plain_files_wrapper = { - &php_plain_files_wrapper_ops, - NULL, - 0 -}; - -/* {{{ php_stream_fopen_with_path */ -PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC) -{ - /* code ripped off from fopen_wrappers.c */ - char *pathbuf, *ptr, *end; - char *exec_fname; - char trypath[MAXPATHLEN]; - struct stat sb; - php_stream *stream; - int path_length; - int filename_length; - int exec_fname_length; - - if (opened_path) { - *opened_path = NULL; - } - - if(!filename) { - return NULL; - } - - filename_length = strlen(filename); - - /* Relative path open */ - if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) { - /* further checks, we could have ....... filenames */ - ptr = filename + 1; - if (*ptr == '.') { - while (*(++ptr) == '.'); - if (!IS_SLASH(*ptr)) { /* not a relative path after all */ - goto not_relative_path; - } - } - - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { - return NULL; - } - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - - /* - * files in safe_mode_include_dir (or subdir) are excluded from - * safe mode GID/UID checks - */ - -not_relative_path: - - /* Absolute path open */ - if (IS_ABSOLUTE_PATH(filename, filename_length)) { - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { - return NULL; - } - - if ((php_check_safe_mode_include_dir(filename TSRMLS_CC)) == 0) - /* filename is in safe_mode_include_dir (or subdir) */ - return php_stream_fopen_rel(filename, mode, opened_path, options); - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) - return NULL; - - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - -#ifdef PHP_WIN32 - if (IS_SLASH(filename[0])) { - int cwd_len; - char *cwd; - cwd = virtual_getcwd_ex(&cwd_len TSRMLS_CC); - /* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */ - *(cwd+3) = '\0'; - - snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename); - - free(cwd); - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath TSRMLS_CC)) { - return NULL; - } - if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC)) == 0) { - return php_stream_fopen_rel(trypath, mode, opened_path, options); - } - if (PG(safe_mode) && (!php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - - return php_stream_fopen_rel(trypath, mode, opened_path, options); - } -#endif - - if (!path || (path && !*path)) { - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { - return NULL; - } - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - - /* check in provided path */ - /* append the calling scripts' current working directory - * as a fall back case - */ - if (zend_is_executing(TSRMLS_C)) { - exec_fname = zend_get_executed_filename(TSRMLS_C); - exec_fname_length = strlen(exec_fname); - path_length = strlen(path); - - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); - if ((exec_fname && exec_fname[0] == '[') - || exec_fname_length<=0) { - /* [no active file] or no path */ - pathbuf = estrdup(path); - } else { - pathbuf = (char *) emalloc(exec_fname_length + path_length +1 +1); - memcpy(pathbuf, path, path_length); - pathbuf[path_length] = DEFAULT_DIR_SEPARATOR; - memcpy(pathbuf+path_length+1, exec_fname, exec_fname_length); - pathbuf[path_length + exec_fname_length +1] = '\0'; - } - } else { - pathbuf = estrdup(path); - } - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename); - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) { - ptr = end; - continue; - } - - if (PG(safe_mode)) { - if (VCWD_STAT(trypath, &sb) == 0) { - /* file exists ... check permission */ - if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || - php_checkuid_ex(trypath, mode, CHECKUID_CHECK_MODE_PARAM, CHECKUID_NO_ERRORS)) { - /* UID ok, or trypath is in safe_mode_include_dir */ - stream = php_stream_fopen_rel(trypath, mode, opened_path, options); - goto stream_done; - } - } - ptr = end; - continue; - } - stream = php_stream_fopen_rel(trypath, mode, opened_path, options); - if (stream) { -stream_done: - efree(pathbuf); - return stream; - } - ptr = end; - } /* end provided path */ - - efree(pathbuf); - return NULL; - -} -/* }}} */ - - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/streams.c b/main/streams/streams.c deleted file mode 100755 index f00f9627f52a0..0000000000000 --- a/main/streams/streams.c +++ /dev/null @@ -1,2728 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | Borrowed code from: | - | Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include "ext/standard/basic_functions.h" /* for BG(mmap_file) (not strictly required) */ -#include "ext/standard/php_string.h" /* for php_memnstr, used by php_stream_get_record() */ -#include -#include -#include "php_streams_int.h" - -/* {{{ resource and registration code */ -/* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */ -static HashTable url_stream_wrappers_hash; -static int le_stream = FAILURE; /* true global */ -static int le_pstream = FAILURE; /* true global */ -static int le_stream_filter = FAILURE; /* true global */ - -PHPAPI int php_file_le_stream(void) -{ - return le_stream; -} - -PHPAPI int php_file_le_pstream(void) -{ - return le_pstream; -} - -PHPAPI int php_file_le_stream_filter(void) -{ - return le_stream_filter; -} - -PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D) -{ - return (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); -} - -PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void) -{ - return &url_stream_wrappers_hash; -} - -static int _php_stream_release_context(list_entry *le, void *pContext TSRMLS_DC) -{ - if (le->ptr == pContext) { - return --le->refcount == 0; - } - return 0; -} - -static int forget_persistent_resource_id_numbers(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream; - - if (Z_TYPE_P(rsrc) != le_pstream) { - return 0; - } - - stream = (php_stream*)rsrc->ptr; - -#if STREAM_DEBUG -fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream); -#endif - - stream->rsrc_id = FAILURE; - - if (stream->context) { - zend_hash_apply_with_argument(&EG(regular_list), - (apply_func_arg_t) _php_stream_release_context, - stream->context TSRMLS_CC); - stream->context = NULL; - } - - return 0; -} - -PHP_RSHUTDOWN_FUNCTION(streams) -{ - zend_hash_apply(&EG(persistent_list), (apply_func_t)forget_persistent_resource_id_numbers TSRMLS_CC); - return SUCCESS; -} - -PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_find(&EG(persistent_list), (char*)persistent_id, strlen(persistent_id)+1, (void*) &le) == SUCCESS) { - if (Z_TYPE_P(le) == le_pstream) { - if (stream) { - *stream = (php_stream*)le->ptr; - le->refcount++; - (*stream)->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, *stream, le_pstream); - } - return PHP_STREAM_PERSISTENT_SUCCESS; - } - return PHP_STREAM_PERSISTENT_FAILURE; - } - return PHP_STREAM_PERSISTENT_NOT_EXIST; -} - -/* }}} */ - -/* {{{ wrapper error reporting */ -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC) -{ - char *tmp = estrdup(path); - char *msg; - int free_msg = 0; - - if (wrapper) { - if (wrapper->err_count > 0) { - int i; - size_t l; - int brlen; - char *br; - - if (PG(html_errors)) { - brlen = 7; - br = "
              \n"; - } else { - brlen = 1; - br = "\n"; - } - - for (i = 0, l = 0; i < wrapper->err_count; i++) { - l += strlen(wrapper->err_stack[i]); - if (i < wrapper->err_count - 1) { - l += brlen; - } - } - msg = emalloc(l + 1); - msg[0] = '\0'; - for (i = 0; i < wrapper->err_count; i++) { - strcat(msg, wrapper->err_stack[i]); - if (i < wrapper->err_count - 1) { - strcat(msg, br); - } - } - - free_msg = 1; - } else { - msg = strerror(errno); - } - } else { - msg = "no suitable wrapper could be found"; - } - - php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg); - efree(tmp); - if (free_msg) { - efree(msg); - } -} - -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC) -{ - if (wrapper) { - /* tidy up the error stack */ - int i; - - for (i = 0; i < wrapper->err_count; i++) { - efree(wrapper->err_stack[i]); - } - if (wrapper->err_stack) { - efree(wrapper->err_stack); - } - wrapper->err_stack = NULL; - wrapper->err_count = 0; - } -} - -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) -{ - va_list args; - char *buffer = NULL; - - va_start(args, fmt); - vspprintf(&buffer, 0, fmt, args); - va_end(args); - - if (options & REPORT_ERRORS || wrapper == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buffer); - efree(buffer); - } else { - /* append to stack */ - wrapper->err_stack = erealloc(wrapper->err_stack, (wrapper->err_count + 1) * sizeof(char *)); - if (wrapper->err_stack) { - wrapper->err_stack[wrapper->err_count++] = buffer; - } - } -} - - -/* }}} */ - -/* allocate a new stream for a particular ops */ -PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC) /* {{{ */ -{ - php_stream *ret; - - ret = (php_stream*) pemalloc_rel_orig(sizeof(php_stream), persistent_id ? 1 : 0); - - memset(ret, 0, sizeof(php_stream)); - - ret->readfilters.stream = ret; - ret->writefilters.stream = ret; - -#if STREAM_DEBUG -fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persistent_id); -#endif - - ret->ops = ops; - ret->abstract = abstract; - ret->is_persistent = persistent_id ? 1 : 0; - ret->chunk_size = FG(def_chunk_size); - - if (FG(auto_detect_line_endings)) { - ret->flags |= PHP_STREAM_FLAG_DETECT_EOL; - } - - if (persistent_id) { - zend_rsrc_list_entry le; - - Z_TYPE(le) = le_pstream; - le.ptr = ret; - le.refcount = 0; - - if (FAILURE == zend_hash_update(&EG(persistent_list), (char *)persistent_id, - strlen(persistent_id) + 1, - (void *)&le, sizeof(le), NULL)) { - - pefree(ret, 1); - return NULL; - } - } - - ret->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, ret, persistent_id ? le_pstream : le_stream); - strlcpy(ret->mode, mode, sizeof(ret->mode)); - - return ret; -} -/* }}} */ - -static int _php_stream_free_persistent(list_entry *le, void *pStream TSRMLS_DC) -{ - return le->ptr == pStream; -} - -PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */ -{ - int ret = 1; - int remove_rsrc = 1; - int preserve_handle = close_options & PHP_STREAM_FREE_PRESERVE_HANDLE ? 1 : 0; - int release_cast = 1; - -#if STREAM_DEBUG -fprintf(stderr, "stream_free: %s:%p[%s] in_free=%d opts=%08x\n", stream->ops->label, stream, stream->orig_path, stream->in_free, close_options); -#endif - - /* recursion protection */ - if (stream->in_free) { - return 1; - } - - stream->in_free++; - - /* if we are releasing the stream only (and preserving the underlying handle), - * we need to do things a little differently. - * We are only ever called like this when the stream is cast to a FILE* - * for include (or other similar) purposes. - * */ - if (preserve_handle) { - if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { - /* If the stream was fopencookied, we must NOT touch anything - * here, as the cookied stream relies on it all. - * Instead, mark the stream as OK to auto-clean */ - php_stream_auto_cleanup(stream); - stream->in_free--; - return 0; - } - /* otherwise, make sure that we don't close the FILE* from a cast */ - release_cast = 0; - } - -#if STREAM_DEBUG -fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remove_rsrc=%d\n", - stream->ops->label, stream, stream->orig_path, preserve_handle, release_cast, remove_rsrc); -#endif - - /* make sure everything is saved */ - _php_stream_flush(stream, 1 TSRMLS_CC); - - /* If not called from the resource dtor, remove the stream from the resource list. */ - if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && remove_rsrc) { - zend_list_delete(stream->rsrc_id); - } - - /* Remove stream from any context link list */ - if (stream->context && stream->context->links) { - php_stream_context_del_link(stream->context, stream); - } - - if (close_options & PHP_STREAM_FREE_CALL_DTOR) { - if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { - /* calling fclose on an fopencookied stream will ultimately - call this very same function. If we were called via fclose, - the cookie_closer unsets the fclose_stdiocast flags, so - we can be sure that we only reach here when PHP code calls - php_stream_free. - Lets let the cookie code clean it all up. - */ - stream->in_free = 0; - return fclose(stream->stdiocast); - } - - ret = stream->ops->close(stream, preserve_handle ? 0 : 1 TSRMLS_CC); - stream->abstract = NULL; - - /* tidy up any FILE* that might have been fdopened */ - if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FDOPEN && stream->stdiocast) { - fclose(stream->stdiocast); - stream->stdiocast = NULL; - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - } - } - - if (close_options & PHP_STREAM_FREE_RELEASE_STREAM) { - while (stream->readfilters.head) { - php_stream_filter_remove(stream->readfilters.head, 1 TSRMLS_CC); - } - while (stream->writefilters.head) { - php_stream_filter_remove(stream->writefilters.head, 1 TSRMLS_CC); - } - - if (stream->wrapper && stream->wrapper->wops && stream->wrapper->wops->stream_closer) { - stream->wrapper->wops->stream_closer(stream->wrapper, stream TSRMLS_CC); - stream->wrapper = NULL; - } - - if (stream->wrapperdata) { - zval_ptr_dtor(&stream->wrapperdata); - stream->wrapperdata = NULL; - } - - while (stream->readbuf.head) { - php_stream_bucket *bucket = stream->readbuf.head; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) { - /* we don't work with *stream but need its value for comparison */ - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _php_stream_free_persistent, stream TSRMLS_CC); - } -#if ZEND_DEBUG - if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting) & E_WARNING)) { - /* it leaked: Lets deliberately NOT pefree it so that the memory manager shows it - * as leaked; it will log a warning, but lets help it out and display what kind - * of stream it was. */ - char *leakinfo; - spprintf(&leakinfo, 0, __FILE__ "(%d) : Stream of type '%s' %p (path:%s) was not closed\n", __LINE__, stream->ops->label, stream, stream->orig_path); - - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - -# if defined(PHP_WIN32) - OutputDebugString(leakinfo); -# else - fprintf(stderr, "%s", leakinfo); -# endif - efree(leakinfo); - } else { - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - - pefree(stream, stream->is_persistent); - } -#else - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - - pefree(stream, stream->is_persistent); -#endif - } - - return ret; -} -/* }}} */ - -/* {{{ generic stream operations */ - -static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC) -{ - if (stream->readfilters.head) { - char *chunk_buf; - int err_flag = 0; - php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap; - - /* allocate a buffer for reading chunks */ - chunk_buf = emalloc(stream->chunk_size); - - while (!err_flag && (stream->readbuf_avail < (off_t)size)) { - size_t justread = 0; - int flags; - php_stream_bucket *bucket; - php_stream_filter_status_t status = PSFS_ERR_FATAL; - php_stream_filter *filter; - - /* read a chunk into a bucket */ - justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC); - if (justread > 0) { - bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC); - - /* after this call, bucket is owned by the brigade */ - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); - - flags = PSFS_FLAG_NORMAL; - } else { - flags = stream->eof ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC; - } - - /* wind the handle... */ - for (filter = stream->readfilters.head; filter; filter = filter->next) { - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags TSRMLS_CC); - - if (status != PSFS_PASS_ON) { - break; - } - - /* brig_out becomes brig_in. - * brig_in will always be empty here, as the filter MUST attach any un-consumed buckets - * to its own brigade */ - brig_swap = brig_inp; - brig_inp = brig_outp; - brig_outp = brig_swap; - memset(brig_outp, 0, sizeof(*brig_outp)); - } - - switch (status) { - case PSFS_PASS_ON: - /* we get here when the last filter in the chain has data to pass on. - * in this situation, we are passing the brig_in brigade into the - * stream read buffer */ - while ((bucket = brig_inp->head)) { - php_stream_bucket *tail = stream->readbuf.tail; - php_stream_bucket_unlink(bucket TSRMLS_CC); - if (bucket->is_unicode && - U16_IS_SURROGATE(*bucket->buf.ustr.val) && - !U16_IS_SURROGATE_LEAD(*bucket->buf.ustr.val) && - tail && tail->is_unicode && - U16_IS_SURROGATE(tail->buf.ustr.val[tail->buf.ustr.len - 1]) && - U16_IS_SURROGATE_LEAD(tail->buf.ustr.val[tail->buf.ustr.len - 1])) { - /* Surrogate pair got split between buckets -- Unlikely */ - UChar *tmp; - - tmp = peumalloc(bucket->buf.ustr.len + 1, bucket->is_persistent); - *tmp = stream->readbuf.tail->buf.ustr.val[--tail->buf.ustr.len]; - memmove(tmp + UBYTES(1), bucket->buf.ustr.val, UBYTES(bucket->buf.ustr.len)); - pefree(bucket->buf.ustr.val, bucket->is_persistent); - bucket->buf.ustr.val = tmp; - - if (tail->buf.ustr.len <= 0) { - /* Tail was only a one UChar bucket */ - php_stream_bucket_unlink(tail TSRMLS_CC); - php_stream_bucket_delref(tail TSRMLS_CC); - } else if (tail == stream->readbuf.head && (tail->buf.ustr.len <= stream->readbuf_ofs)) { - /* Tail was head and last char was only unused portion */ - php_stream_bucket_unlink(tail TSRMLS_CC); - php_stream_bucket_delref(tail TSRMLS_CC); - stream->readbuf_ofs = 0; - } - } - php_stream_bucket_append(&stream->readbuf, bucket TSRMLS_CC); - stream->readbuf_avail += bucket->is_unicode ? bucket->buf.ustr.len : bucket->buf.str.len; - } - break; - - case PSFS_FEED_ME: - /* when a filter needs feeding, there is no brig_out to deal with. - * we simply continue the loop; if the caller needs more data, - * we will read again, otherwise out job is done here */ - if (justread == 0) { - /* there is no data */ - err_flag = 1; - break; - } - continue; - - case PSFS_ERR_FATAL: - /* some fatal error. Theoretically, the stream is borked, so all - * further reads should fail. */ - err_flag = 1; - break; - } - - if (justread == 0) { - break; - } - } - - efree(chunk_buf); - - } else { - /* is there enough data in the buffer ? */ - if (stream->readbuf_avail < (off_t)size) { - char *chunk_buf; - size_t justread = 0; - int is_persistent = php_stream_is_persistent(stream); - - chunk_buf = pemalloc(stream->chunk_size, is_persistent); - justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC); - - if (justread == (size_t)-1 || justread == 0) { - pefree(chunk_buf, is_persistent); - } else { - php_stream_bucket *bucket; - - bucket = php_stream_bucket_new(stream, chunk_buf, justread, 1, is_persistent TSRMLS_CC); - php_stream_bucket_append(&stream->readbuf, bucket TSRMLS_CC); - stream->readbuf_avail += justread; - } - } - } -} - -PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC) -{ - php_stream_bucket *bucket; - size_t toread = 0, didread = 0; - - while (size > 0) { - /* take from the read buffer first. - * It is possible that a buffered stream was switched to non-buffered, so we - * drain the remainder of the buffer before using the "raw" read mode for - * the excess */ - - while (size > 0 && (bucket = stream->readbuf.head)) { - if (bucket->is_unicode) { - /* This is an string read func, convert to string first */ - php_stream_bucket_tostring(stream, &bucket, &stream->readbuf_ofs TSRMLS_CC); - } - toread = bucket->buf.str.len - stream->readbuf_ofs; - if (toread > size) { - toread = size; - } - memcpy(buf, bucket->buf.str.val + stream->readbuf_ofs, toread); - stream->readbuf_ofs += toread; - stream->readbuf_avail -= toread; - if (stream->readbuf_ofs >= bucket->buf.str.len) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - stream->readbuf_ofs = 0; - } - size -= toread; - buf += toread; - didread += toread; - } - - /* ignore eof here; the underlying state might have changed */ - if (size == 0) { - break; - } - - /* just break anyway, to avoid greedy read */ - if (didread > 0 && (stream->wrapper != &php_plain_files_wrapper)) { - break; - } - - if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { - toread = stream->ops->read(stream, buf, size TSRMLS_CC); - if (toread <= 0) { - break; - } - buf += toread; - size -= toread; - didread += toread; - continue; - } - - php_stream_fill_read_buffer(stream, size TSRMLS_CC); - if (stream->readbuf_avail <= 0) { - /* EOF, or temporary end of data (for non-blocking mode). */ - break; - } - } - - if (didread > 0) { - stream->position += didread; - } - return didread; -} - -PHPAPI size_t _php_stream_read_unicode(php_stream *stream, UChar *buf, int32_t size TSRMLS_DC) -{ - php_stream_bucket *bucket; - size_t toread = 0, didread = 0; - - while (size > 0) { - /* take from the read buffer first. - * It is possible that a buffered stream was switched to non-buffered, so we - * drain the remainder of the buffer before using the "raw" read mode for - * the excess */ - - while (size > 0 && (bucket = stream->readbuf.head)) { - UChar lastchar = 0; - - if (!bucket->is_unicode) { - /* This is a unicode read func, convert to unicode first */ - php_stream_bucket_tounicode(stream, &bucket, &stream->readbuf_ofs TSRMLS_CC); - } - toread = bucket->buf.ustr.len - stream->readbuf_ofs; - if (toread > size) { - toread = size; - } - lastchar = *(bucket->buf.ustr.val + stream->readbuf_ofs + toread - 1); - if (U16_IS_SURROGATE(lastchar) && U16_IS_SURROGATE_LEAD(lastchar)) { - toread--; - /* The only time we should encounter a split surrogate is when the buffer size is truncating the data - In this case, reduce size along with toread to avoid getting stuck */ - size--; - } - memcpy(buf, bucket->buf.ustr.val + stream->readbuf_ofs, toread * sizeof(UChar)); - stream->readbuf_ofs += toread; - stream->readbuf_avail -= toread; - if (stream->readbuf_ofs >= bucket->buf.ustr.len) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - stream->readbuf_ofs = 0; - } - size -= toread; - buf += toread; - didread += toread; - } - - /* ignore eof here; the underlying state might have changed */ - if (size == 0) { - break; - } - - /* just break anyway, to avoid greedy read */ - if (didread > 0 && (stream->wrapper != &php_plain_files_wrapper)) { - break; - } - - php_stream_fill_read_buffer(stream, size * sizeof(UChar) TSRMLS_CC); - if (stream->readbuf_avail <= 0) { - /* EOF, or temporary end of data (for non-blocking mode). */ - break; - } - } - - if (didread > 0) { - stream->position += didread; - } - - return didread; -} - -/* buf mabe NULL (in which case it will be allocated) - num_bytes and num_chars must be initialized upon entry to maximum for each (-1 for no maximum) - num_bytes/num_chars will be set on exit to actual contents of buf - Will return unicode/string type dependent on the first character unit in the read buf - Will return as many characters as possible (and permitted by max lengths) without changing unicode/string type - Will not split surrogate pairs */ -PHPAPI void *_php_stream_u_read(php_stream *stream, void *buf, int32_t *pnum_bytes, int32_t *pnum_chars, int *pis_unicode TSRMLS_DC) -{ - int grow_mode = 0; - int32_t num_bytes = 0, num_chars = 0; - int32_t max_bytes = *pnum_bytes, max_chars = *pnum_chars; - int32_t buflen = buf ? max_bytes : 2048; - int32_t bufpos = 0; - int is_unicode; - php_stream_bucket *bucket; - - /* It's possible that we have a readbuf, but that it's only half of a surrogate pair */ - if (!stream->readbuf.head || - (stream->readbuf.head == stream->readbuf.tail && stream->readbuf.head->is_unicode && - (stream->readbuf.head->buf.ustr.len - stream->readbuf_ofs) == 1 && - U16_IS_SURROGATE(stream->readbuf.head->buf.ustr.val[stream->readbuf.head->buf.ustr.len-1]))) { - php_stream_fill_read_buffer(stream, max_bytes ? max_bytes : (max_chars ? max_chars : stream->chunk_size) TSRMLS_CC); - } - - - if (!stream->readbuf.head || - (stream->readbuf.head == stream->readbuf.tail && stream->readbuf.head->is_unicode && - (stream->readbuf.head->buf.ustr.len - stream->readbuf_ofs) == 1 && - U16_IS_SURROGATE(stream->readbuf.head->buf.ustr.val[stream->readbuf.head->buf.ustr.len-1]))) { - /* Nothing to return */ - *pnum_bytes = 0; - *pnum_chars = 0; - *pis_unicode = 0; - return NULL; - } - - - if (!buf) { - grow_mode = 1; - buf = emalloc(buflen); - } - - is_unicode = stream->readbuf.head->is_unicode; - if (is_unicode) { - /* normalize byte boundary */ - if (max_bytes >= 0 && (max_bytes % sizeof(UChar))) { - max_bytes -= (max_bytes % sizeof(UChar)); - } - if (max_bytes >= 0 && max_bytes < UBYTES(max_chars)) { - /* max_bytes needs to be at least twice max_chars when both are provided */ - max_chars = (max_bytes / sizeof(UChar)); - } - } else { - if (max_chars < 0 && max_bytes >= 0) { - max_chars = max_bytes; - } else if (max_chars >= 0 && grow_mode) { - max_bytes = max_chars; - } - } - - for (;;) { - if (buflen - bufpos < 1024 && max_bytes >= 0 && max_bytes > buflen) { - buflen += 1024; - if (buflen > max_bytes) { - buflen = max_bytes; - } - buf = erealloc(buf, buflen); - } - - if ((bucket = stream->readbuf.head)) { - if ((bucket->is_unicode && !is_unicode) || - (!bucket->is_unicode && is_unicode)) { - /* data type swap, exit now */ - break; - } - if (bucket->is_unicode) { - UChar *s = bucket->buf.ustr.val + stream->readbuf_ofs, *p; - int bytes_in_buf, chars_in_buf; - int32_t ofs = 0; - - chars_in_buf = u_countChar32(s, bucket->buf.ustr.len - stream->readbuf_ofs); - - if (chars_in_buf > max_chars && max_chars >= 0) { - chars_in_buf = max_chars; - } - /* u_countChar32 tells us that we won't overrun anyway */ - U16_FWD_N_UNSAFE(s, ofs, chars_in_buf); - p = s + ofs; - bytes_in_buf = UBYTES(ofs); - if (bytes_in_buf > (max_bytes - num_bytes)) { - bytes_in_buf = max_bytes - num_bytes; - bytes_in_buf -= bytes_in_buf & 1; /* normalize */ - p = s + (bytes_in_buf >> 1); - if (p > s && U16_IS_SURROGATE(p[-1]) && U16_IS_SURROGATE_LEAD(p[-1])) { - /* Don't split surrogate pairs */ - p--; - bytes_in_buf -= UBYTES(1); - } - if (bytes_in_buf <= 0) { - /* No room to copy data (surrogate pair) */ - break; - } - chars_in_buf = u_countChar32(s, p - s); - } - memcpy((char *)buf + num_bytes, s, bytes_in_buf); - num_bytes += bytes_in_buf; - num_chars += chars_in_buf; - stream->readbuf_ofs += p - s; - stream->readbuf_avail -= p - s; - if (stream->readbuf_ofs >= bucket->buf.ustr.len) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - stream->readbuf_ofs = 0; - } else if (stream->readbuf_ofs == (bucket->buf.ustr.len - 1) && - U16_IS_SURROGATE(bucket->buf.ustr.val[bucket->buf.ustr.len - 1]) && - bucket->next && bucket->next->is_unicode) { - /* Only one char left in the bucket, avoid already split surrogates getting "stuck" -- Should never happen thanks to fill_read_buffer */ - php_stream_bucket *next_bucket = bucket->next; - - bucket->buf.ustr.val = peurealloc(bucket->buf.ustr.val, next_bucket->buf.ustr.len + 1, bucket->is_persistent); - bucket->buf.ustr.val[0] = bucket->buf.ustr.val[bucket->buf.ustr.len - 1]; - memcpy(bucket->buf.ustr.val + 1, next_bucket->buf.ustr.val, UBYTES(next_bucket->buf.ustr.len)); - php_stream_bucket_unlink(next_bucket TSRMLS_CC); - php_stream_bucket_delref(next_bucket TSRMLS_CC); - stream->readbuf_ofs = 0; - } else { - /* Reached max limits */ - break; - } - } else { - int want = (max_chars < 0 || max_chars >= buflen) ? (buflen - num_bytes) : (max_chars - num_chars); - int avail = bucket->buf.str.len - stream->readbuf_ofs; - - if (max_bytes >= 0 && want > max_bytes) { - want = max_bytes; - } - - if (want > avail) { - want = avail; - } - - memcpy((char *)buf + num_bytes, bucket->buf.str.val + stream->readbuf_ofs, want); - stream->readbuf_ofs += want; - stream->readbuf_avail -= want; - num_bytes += want; - num_chars += want; - if (stream->readbuf_ofs >= bucket->buf.str.len) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - stream->readbuf_ofs = 0; - } else { - /* Reached max limit */ - break; - } - } - } else { - /* No more data */ - break; - } - } - /* Successful exit */ - *pnum_bytes = num_bytes; - *pnum_chars = num_chars; - *pis_unicode = is_unicode; - - stream->position += num_bytes; - - if (num_chars == 0 && grow_mode) { - efree(buf); - buf = NULL; - } - return buf; -} - -PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) -{ - /* if there is data in the buffer, it's not EOF */ - if (stream->readbuf_avail > 0) { - return 0; - } - - /* use the configured timeout when checking eof */ - if (!stream->eof && PHP_STREAM_OPTION_RETURN_ERR == - php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, - 0, NULL)) { - stream->eof = 1; - } - - return stream->eof; -} - -PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC) -{ - unsigned char buf = c; - - if (php_stream_write(stream, &buf, 1) > 0) { - return 1; - } - return EOF; -} - -PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC) -{ - char buf; - - if (php_stream_read(stream, &buf, 1) > 0) { - return buf & 0xff; - } - return EOF; -} - -PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC) -{ - int len; - char newline[2] = "\n"; /* is this OK for Win? */ - len = strlen(buf); - - if (len > 0 && php_stream_write(stream, buf, len) && php_stream_write(stream, newline, 1)) { - return 1; - } - return 0; -} - -PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - memset(ssb, 0, sizeof(*ssb)); - - /* if the stream was wrapped, allow the wrapper to stat it */ - if (stream->wrapper && stream->wrapper->wops->stream_stat != NULL) { - return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb TSRMLS_CC); - } - - /* if the stream doesn't directly support stat-ing, return with failure. - * We could try and emulate this by casting to a FD and fstat-ing it, - * but since the fd might not represent the actual underlying content - * this would give bogus results. */ - if (stream->ops->stat == NULL) { - return -1; - } - - return (stream->ops->stat)(stream, ssb TSRMLS_CC); -} - -/* buf != NULL Still used by file() in ext/standard/file.c - buf == NULL semantics no longer supported */ -PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC) -{ - size_t avail; - char *cr, *lf, *eol = NULL; - char *readptr; - - if (!buf) { - return NULL; - } else { - readptr = buf; - avail = buf_len; - } - - /* Look for EOL */ - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { - cr = memchr(readptr, '\r', avail); - lf = memchr(readptr, '\n', avail); - - if (cr && lf != cr + 1 && !(lf && lf < cr)) { - /* mac */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - eol = cr; - } else if ((cr && lf && cr == lf - 1) || (lf)) { - /* dos or unix endings */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - eol = lf; - } - } else if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) { - eol = memchr(readptr, '\r', avail); - } else { - /* unix (and dos) line endings */ - eol = memchr(readptr, '\n', avail); - } - - return eol; -} - -/* If buf == NULL, the buffer will be allocated automatically and will be of an - * appropriate length to hold the line, regardless of the line length, memory - * permitting -- returned string will be up to (maxlen-1), last byte holding terminating NULL */ -PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, - size_t *returned_len TSRMLS_DC) -{ - php_stream_bucket *bucket; - size_t total_copied = 0; - int growmode = 0; - - if (!buf) { - maxlen = stream->chunk_size + 1; - buf = emalloc(maxlen); - growmode = 1; - } - - /* Leave room for NULL */ - maxlen--; - - for(;;) { - /* Fill buf with buffered data - until no space is left in the buffer - or EOL is found */ - char lastchar = 0; - - /* consumed readbuf if possible */ - while ((bucket = stream->readbuf.head)) { - char *eol; - size_t tocopy; - size_t wanted = maxlen - total_copied; - int bucket_consumed = 0; - - if (bucket->is_unicode) { - /* This is a string read func, convert to string first */ - php_stream_bucket_tostring(stream, &bucket, &stream->readbuf_ofs TSRMLS_CC); - } - - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL && lastchar == '\r') { - /* Line ending was actually found in the last char of the last bucket - Since it was \r it could have been MAC or DOS */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - if (bucket->buf.str.val[stream->readbuf_ofs] == '\n') { - /* First byte here is a \n, put them together and you get DOS line endings */ - stream->readbuf_ofs++; - stream->readbuf_avail--; - buf[total_copied++] = '\n'; - /* unlikely -- It'd mean a one byte bucket -- possible though */ - if (stream->readbuf_ofs >= bucket->buf.str.len) { - stream->readbuf_ofs = 0; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } else { - /* Seeing no \n in the first char of this bucket, we know it was MAC */ - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - } - goto exit_getline; - } else if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { - char *cr, *lf; - lf = memchr(bucket->buf.str.val + stream->readbuf_ofs, '\n', bucket->buf.str.len - stream->readbuf_ofs); - cr = memchr(bucket->buf.str.val + stream->readbuf_ofs, '\r', bucket->buf.str.len - stream->readbuf_ofs); - eol = (cr && (!lf || cr < (lf - 1))) ? cr : lf; - } else if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) { - eol = memchr(bucket->buf.str.val + stream->readbuf_ofs, '\r', bucket->buf.str.len - stream->readbuf_ofs); - } else { - eol = memchr(bucket->buf.str.val + stream->readbuf_ofs, '\n', bucket->buf.str.len - stream->readbuf_ofs); - } - - /* No \r or \n found in bucket -- grab it all */ - if (!eol) { - eol = bucket->buf.str.val + bucket->buf.str.len - 1; - } - tocopy = eol - (bucket->buf.str.val + stream->readbuf_ofs) + 1; - - /* maxlen exceeded */ - if (tocopy > wanted && growmode) { - if (tocopy - wanted > stream->chunk_size) { - maxlen += tocopy - wanted; - } else { - maxlen += stream->chunk_size; - } - buf = erealloc(buf, maxlen + 1); - wanted = maxlen - total_copied; - } - - if (tocopy > wanted) { - tocopy = wanted; - } - - memcpy(buf + total_copied, bucket->buf.str.val + stream->readbuf_ofs, tocopy); - total_copied += tocopy; - stream->readbuf_ofs += tocopy; - stream->readbuf_avail -= tocopy; - lastchar = buf[total_copied-1]; - - if (stream->readbuf_ofs >= bucket->buf.str.len) { - stream->readbuf_ofs = 0; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - bucket_consumed = 1; - } - - if (total_copied >= maxlen) { - goto exit_getline; - } - - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL && - bucket_consumed && lastchar == '\r') { - /* Could be MAC, could be DOS... - Need to check the first char of the next bucket to be sure */ - continue; - } - - if (lastchar == '\r' || lastchar == '\n') { - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - if (lastchar == '\r') { - /* if there were a \n in this bucket after the \r, we would be looking at it */ - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - } - goto exit_getline; - } - } - - if (stream->eof) { - if (total_copied == 0) { - if (growmode) { - efree(buf); - } - return NULL; - } - goto exit_getline; - } - - if (maxlen - total_copied) { - size_t bufneeded = maxlen - total_copied; - - if (growmode) { - bufneeded = stream->chunk_size; - } - php_stream_fill_read_buffer(stream, bufneeded TSRMLS_CC); - } - - } - - exit_getline: - - if (returned_len) { - *returned_len = total_copied; - } - buf[total_copied] = 0; - stream->position += total_copied; - - return buf; -} - -/* If buf == NULL, the buffer will be allocated automatically and will be of an - * appropriate length to hold the line, regardless of the line length, memory - * permitting -- returned string will be up to (maxlen-1), last byte holding terminating NULL */ -PHPAPI UChar *_php_stream_u_get_line(php_stream *stream, UChar *buf, int32_t *pmax_bytes, int32_t *pmax_chars, int *pis_unicode TSRMLS_DC) -{ - php_stream_bucket *bucket; - int32_t num_bytes = 0, num_chars = 0; - int32_t max_bytes = *pmax_bytes, max_chars = *pmax_chars; - int growmode = 0, is_unicode; - - while (!stream->readbuf.head) { - /* Nothing buffered, get an idea of the data type by polling */ - int32_t fillsize = (max_chars > 0) ? max_chars : ((max_bytes > 0) ? max_bytes : stream->chunk_size); - - php_stream_fill_read_buffer(stream, fillsize TSRMLS_CC); - if (!stream->readbuf.head) { - *pmax_bytes = 0; - *pmax_chars = 0; - *pis_unicode = 0; - return NULL; - } - } - - *pis_unicode = is_unicode = stream->readbuf.head->is_unicode; - - if (!is_unicode) { - /* Wrap normal get_line() */ - int returned_len; - char *retbuf = php_stream_get_line(stream, (char*)buf, max_chars, &returned_len); - - *pmax_chars = returned_len; - *pmax_bytes = returned_len; - return (UChar*)retbuf; - } - - /* Now act like php_stream_u_read(), but stopping at 000A, 000D, or 000D 000A */ - - if (!buf) { - max_bytes = UBYTES(257); - buf = emalloc(max_bytes); - growmode = 1; - } - - /* Leave room for NULL */ - max_bytes -= UBYTES(1); - - for(;;) { - /* Fill buf with buffered data - until no space is left in the buffer - or EOL is found */ - UChar lastchar = 0; - - /* consumed readbuf if possible */ - while ((bucket = stream->readbuf.head)) { - UChar *eol, *s; - int32_t want_chars = max_chars - num_chars; - int32_t want_bytes = max_bytes - num_bytes; - int32_t count_chars; - int32_t count_bytes; - int bucket_consumed = 0; - - if (!bucket->is_unicode) { - /* Done with unicode data, bail as though EOL was reached (even though it wasn't) */ - goto exit_ugetline; - } - - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL && lastchar == '\r') { - /* Line ending was actually found in the last char of the last bucket - Since it was \r it could have been MAC or DOS */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - if (bucket->buf.ustr.val[stream->readbuf_ofs] == '\n') { - /* First byte here is a \n, put them together and you get DOS line endings */ - stream->readbuf_ofs++; - stream->readbuf_avail--; - buf[num_bytes >> 1] = '\n'; /* Can't use num_chars here, surrogate pairs will foul it up */ - num_bytes += UBYTES(1); - num_chars++; - /* unlikely -- It'd mean a one UChar bucket -- possible though */ - if (stream->readbuf_ofs >= bucket->buf.ustr.len) { - stream->readbuf_ofs = 0; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } else { - /* Seeing no \n in the first char of this bucket, we know it was MAC */ - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - } - goto exit_ugetline; - } else if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { - UChar *cr, *lf; - lf = u_memchr(bucket->buf.ustr.val + stream->readbuf_ofs, '\n', bucket->buf.ustr.len - stream->readbuf_ofs); - cr = u_memchr(bucket->buf.ustr.val + stream->readbuf_ofs, '\r', bucket->buf.ustr.len - stream->readbuf_ofs); - eol = (cr && (!lf || cr < (lf - 1))) ? cr : lf; - } else if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) { - eol = u_memchr(bucket->buf.ustr.val + stream->readbuf_ofs, '\r', bucket->buf.ustr.len - stream->readbuf_ofs); - } else { - eol = u_memchr(bucket->buf.ustr.val + stream->readbuf_ofs, '\n', bucket->buf.ustr.len - stream->readbuf_ofs); - } - - /* No \r or \n found in bucket -- grab it all */ - if (!eol) { - eol = bucket->buf.ustr.val + bucket->buf.ustr.len - 1; - } - s = bucket->buf.ustr.val + stream->readbuf_ofs; - - count_bytes = UBYTES(eol - s + 1); - if (count_bytes > want_bytes && growmode) { - max_bytes = num_bytes + count_bytes + UBYTES(256); - want_bytes = max_bytes - num_bytes; - buf = erealloc(buf, max_bytes + UBYTES(1)); - } else if (count_bytes > want_bytes) { - count_bytes = want_bytes; - } - if (U16_IS_SURROGATE(s[(count_bytes >> 1) - 1]) && - U16_IS_SURROGATE_LEAD(s[(count_bytes >> 1) - 1])) { - count_bytes -= UBYTES(1); - } - if (count_bytes <= 0) { - /* Not enough space in buffer, just break out */ - goto exit_ugetline; - } - count_chars = u_countChar32(s, count_bytes >> 1); - - if (max_chars >= 0 && count_chars > want_chars) { - count_chars = want_chars; - count_bytes = 0; - U16_FWD_N_UNSAFE(s, count_bytes, count_chars); - count_bytes <<= 1; /* translate U16 to bytes */ - } - - memcpy(buf + (num_bytes >> 1), s, count_bytes); - num_bytes += count_bytes; - num_chars += count_chars; - stream->readbuf_ofs += count_bytes >> 1; - stream->readbuf_avail -= count_bytes >> 1; - - lastchar = buf[(num_bytes >> 1) - 1]; - - if (stream->readbuf_ofs >= bucket->buf.ustr.len) { - stream->readbuf_ofs = 0; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - bucket_consumed = 1; - } - - if ((max_bytes >= 0 && num_bytes >= max_bytes) || - (max_chars >= 0 && num_chars >= max_chars)) { - goto exit_ugetline; - } - - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL && - bucket_consumed && lastchar == '\r') { - /* Could be MAC, could be DOS... - Need to check the first char of the next bucket to be sure */ - continue; - } - - if (lastchar == '\r' || lastchar == '\n') { - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - if (lastchar == '\r') { - /* if there were a \n in this bucket after the \r, we would be looking at it */ - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - } - goto exit_ugetline; - } - } - - if (stream->eof) { - if (num_bytes == 0) { - if (growmode) { - efree(buf); - } - buf = NULL; - } - goto exit_ugetline; - } - - if (max_bytes - num_bytes) { - int32_t want_bytes = max_bytes - num_bytes; - - if (growmode) { - want_bytes = stream->chunk_size; - } - php_stream_fill_read_buffer(stream, want_bytes TSRMLS_CC); - } - - } - - exit_ugetline: - - *pmax_chars = num_chars; - *pmax_bytes = num_bytes; - *pis_unicode = is_unicode; - if (buf) { - buf[num_bytes >> 1] = 0; - } - stream->position += num_bytes; - - return buf; -} - -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC) -{ - /* UTODO: Needs desperate rewriting for unicode conversion */ - return NULL; - -#ifdef SMG_0 - char *e, *buf; - size_t toread; - int skip = 0; - - php_stream_fill_read_buffer(stream, maxlen TSRMLS_CC); - - if (delim_len == 0 || !delim) { - toread = maxlen; - } else { - if (delim_len == 1) { - e = memchr(stream->readbuf, *delim, stream->readbuf_len); - } else { - e = php_memnstr(stream->readbuf, delim, delim_len, (stream->readbuf + stream->readbuflen)); - } - - if (!e) { - toread = maxlen; - } else { - toread = e - (char *) stream->readbuf; - skip = 1; - } - } - - if (toread > maxlen && maxlen > 0) { - toread = maxlen; - } - - buf = emalloc(toread + 1); - *returned_len = php_stream_read(stream, buf, toread); - - if (*returned_len >= 0) { - if (skip) { - stream->readpos += delim_len; - stream->position += delim_len; - } - buf[*returned_len] = '\0'; - return buf; - } else { - efree(buf); - return NULL; - } -#endif -} - -PHPAPI void _php_stream_flush_readbuf(php_stream *stream TSRMLS_DC) -{ - php_stream_bucket *bucket; - - while ((bucket = stream->readbuf.head)) { - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - stream->readbuf_ofs = stream->readbuf_avail = 0; -} - -/* Writes a buffer directly to a stream, using multiple of the chunk size */ -static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - size_t didwrite = 0, towrite, justwrote; - - /* if we have a seekable stream we need to ensure that data is written at the - * current stream->position. This means invalidating the read buffer and then - * performing a low-level seek */ -/* UTODO: FIX this - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stream->writepos) { -*/ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - php_stream_flush_readbuf(stream); - - stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC); - } - - - while (count > 0) { - towrite = count; - if (towrite > stream->chunk_size) - towrite = stream->chunk_size; - - justwrote = stream->ops->write(stream, buf, towrite TSRMLS_CC); - - /* convert justwrote to an integer, since normally it is unsigned */ - if ((int)justwrote > 0) { - buf += justwrote; - count -= justwrote; - didwrite += justwrote; - - /* Only screw with the buffer if we can seek, otherwise we lose data - * buffered from fifos and sockets */ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - stream->position += justwrote; - } - } else { - break; - } - } - return didwrite; - -} - -/* push some data through the write filter chain. - * buf may be NULL, if flags are set to indicate a flush. - * This may trigger a real write to the stream. - * Returns the number of bytes consumed from buf by the first filter in the chain. - * */ -static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags, int is_unicode TSRMLS_DC) -{ - size_t consumed = 0; - php_stream_bucket *bucket; - php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap; - php_stream_filter_status_t status = PSFS_ERR_FATAL; - php_stream_filter *filter; - - if (buf) { - if (is_unicode) { - bucket = php_stream_bucket_new_unicode(stream, (UChar *)buf, count, 0, 0 TSRMLS_CC); - } else { - bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0 TSRMLS_CC); - } - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); - } - - for (filter = stream->writefilters.head; filter; filter = filter->next) { - /* for our return value, we are interested in the number of bytes consumed from - * the first filter in the chain */ - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, (filter == stream->writefilters.head) ? &consumed : NULL, flags TSRMLS_CC); - if (status != PSFS_PASS_ON) { - break; - } - /* brig_out becomes brig_in. - * brig_in will always be empty here, as the filter MUST attach any un-consumed buckets - * to its own brigade */ - brig_swap = brig_inp; - brig_inp = brig_outp; - brig_outp = brig_swap; - memset(brig_outp, 0, sizeof(*brig_outp)); - } - - switch (status) { - case PSFS_PASS_ON: - /* filter chain generated some output; push it through to the - * underlying stream */ - while (brig_inp->head) { - bucket = brig_inp->head; - if (bucket->is_unicode) { - _php_stream_write_buffer(stream, (char *)bucket->buf.ustr.val, UBYTES(bucket->buf.ustr.len) TSRMLS_CC); - } else { - _php_stream_write_buffer(stream, bucket->buf.str.val, bucket->buf.str.len TSRMLS_CC); - } - /* Potential error situation - eg: no space on device. Perhaps we should keep this brigade - * hanging around and try to write it later. - * At the moment, we just drop it on the floor - * */ - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - break; - case PSFS_FEED_ME: - /* need more data before we can push data through to the stream */ - break; - - case PSFS_ERR_FATAL: - /* some fatal error. Theoretically, the stream is borked, so all - * further writes should fail. */ - break; - } - - return consumed; -} - -PHPAPI int _php_stream_will_read_unicode(php_stream *stream TSRMLS_DC) -{ - php_stream_filter *filter; - int inverted = 0; - - if (stream->readbuf.head) { - /* If there are buckets available, what do they hold */ - return stream->readbuf.head->is_unicode; - } - - if (!stream->readfilters.head) { - /* Not filtered == reads as string */ - return 0; - } - - for(filter = stream->readfilters.tail; filter; filter = filter->prev) { - if (filter->flags & PSFO_FLAG_OUTPUTS_SAME) { - continue; - } - if (filter->flags & PSFO_FLAG_OUTPUTS_OPPOSITE) { - inverted ^= 1; - continue; - } - if (filter->flags & PSFO_FLAG_OUTPUTS_ANY) { - /* Indeterminate */ - return -1; - } - if (filter->flags & PSFO_FLAG_OUTPUTS_STRING) { - /* If an inversion happens, it'll be unicode, otherwise string */ - return inverted; - } - if (filter->flags & PSFO_FLAG_OUTPUTS_UNICODE) { - /* If an inversion happens, it'll be string, otherwise unicode */ - return inverted ^ 1; - } - } - - /* string comes from stream so apply same logic as filter outputting string */ - return inverted; -} - -PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC) -{ - int ret = 0; - - if (stream->writefilters.head) { - _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC, 0 TSRMLS_CC); - } - - if (stream->ops->flush) { - ret = stream->ops->flush(stream TSRMLS_CC); - } - - return ret; -} - -PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - if (buf == NULL || count == 0 || stream->ops->write == NULL) { - return 0; - } - - if (stream->writefilters.head) { - return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL, 0 TSRMLS_CC); - } else { - return _php_stream_write_buffer(stream, buf, count TSRMLS_CC); - } -} - -PHPAPI size_t _php_stream_u_write(php_stream *stream, const UChar *buf, int32_t count TSRMLS_DC) -{ - int32_t ret; - - if (buf == NULL || count == 0 || stream->ops->write == NULL) { - return 0; - } - - if (stream->writefilters.head) { - ret = _php_stream_write_filtered(stream, (const char*)buf, count, PSFS_FLAG_NORMAL, 1 TSRMLS_CC); - } else { - ret = _php_stream_write_buffer(stream, (const char*)buf, UBYTES(count) TSRMLS_CC); - } - - /* Return data points, not bytes */ - if (ret > 0) { - ret >>= 1; - } - return ret; -} - -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) -{ - size_t count; - char *buf; - va_list ap; - - va_start(ap, fmt); - count = vspprintf(&buf, 0, fmt, ap); - va_end(ap); - - if (!buf) { - return 0; /* error condition */ - } - - count = php_stream_write(stream, buf, count); - efree(buf); - - return count; -} - -PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC) -{ - return stream->position; -} - -PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC) -{ - /* handle the case where we are in the buffer */ - if ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) == 0) { - switch(whence) { - case SEEK_SET: - if (offset < stream->position || - offset > stream->position + stream->readbuf_avail) { - break; - } - /* act like SEEK_CUR */ - whence = SEEK_CUR; - offset -= stream->position; - /* fall through */ - case SEEK_CUR: - if (offset == 0) { - /* nothing to do */ - return 0; - } - - if (offset > 0 && offset <= stream->readbuf_avail) { - php_stream_bucket *bucket; - - while (offset && (bucket = stream->readbuf.head)) { - int consume = bucket->buf.str.len - stream->readbuf_ofs; - - if (consume > offset) { - /* seeking within this bucket */ - stream->readbuf_ofs += offset; - stream->readbuf_avail -= offset; - stream->position += offset; - break; - } - - /* consume the remaining bucket */ - stream->position += consume; - stream->readbuf_ofs = 0; - stream->readbuf_avail -= consume; - offset -= consume; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - stream->eof = 0; - return 0; - } - break; - } - } - - - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - int ret; - - if (stream->writefilters.head) { - _php_stream_flush(stream, 0 TSRMLS_CC); - } - - switch(whence) { - case SEEK_CUR: - offset = stream->position + offset; - whence = SEEK_SET; - break; - } - ret = stream->ops->seek(stream, offset, whence, &stream->position TSRMLS_CC); - - if (((stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) || ret == 0) { - if (ret == 0) { - stream->eof = 0; - } - - /* invalidate the buffer contents */ - php_stream_flush_readbuf(stream); - - return ret; - } - /* else the stream has decided that it can't support seeking after all; - * fall through to attempt emulation */ - } - - /* emulate forward moving seeks with reads */ - if (whence == SEEK_CUR && offset > 0) { - char tmp[1024]; - while(offset >= sizeof(tmp)) { - if (php_stream_read(stream, tmp, sizeof(tmp)) == 0) { - return -1; - } - offset -= sizeof(tmp); - } - if (offset && (php_stream_read(stream, tmp, offset) == 0)) { - return -1; - } - stream->eof = 0; - return 0; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream does not support seeking"); - - return -1; -} - -PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - int ret = PHP_STREAM_OPTION_RETURN_NOTIMPL; - - if (stream->ops->set_option) { - ret = stream->ops->set_option(stream, option, value, ptrparam TSRMLS_CC); - } - - if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) { - switch(option) { - case PHP_STREAM_OPTION_SET_CHUNK_SIZE: - ret = stream->chunk_size; - stream->chunk_size = value; - return ret; - - case PHP_STREAM_OPTION_READ_BUFFER: - /* try to match the buffer mode as best we can */ - if (value == PHP_STREAM_BUFFER_NONE) { - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - } else { - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - } - ret = PHP_STREAM_OPTION_RETURN_OK; - break; - - default: - ; - } - } - - return ret; -} - -PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC) -{ - return php_stream_set_option(stream, PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SET_SIZE, &newsize); -} - -PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC) -{ - size_t bcount = 0; - char buf[8192]; - int b; - - if (php_stream_mmap_possible(stream)) { - char *p; - size_t mapped; - - p = php_stream_mmap_range(stream, php_stream_tell(stream), PHP_STREAM_COPY_ALL, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - PHPWRITE(p, mapped); - - php_stream_mmap_unmap(stream); - - return mapped; - } - } - - while ((b = php_stream_read(stream, buf, sizeof(buf))) > 0) { - PHPWRITE(buf, b); - bcount += b; - } - - return bcount; -} - - -PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC) -{ - size_t ret = 0; - char *ptr; - size_t len = 0, max_len; - int step = CHUNK_SIZE; - int min_room = CHUNK_SIZE / 4; - php_stream_statbuf ssbuf; - - if (buf) { - *buf = NULL; - } - - if (maxlen == 0) { - return 0; - } - - if (maxlen == PHP_STREAM_COPY_ALL) { - maxlen = 0; - } - - if (php_stream_mmap_possible(src)) { - char *p; - size_t mapped; - - p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - *buf = pemalloc_rel_orig(mapped + 1, persistent); - - if (*buf) { - memcpy(*buf, p, mapped); - (*buf)[mapped] = '\0'; - } - - php_stream_mmap_unmap(src); - - return mapped; - } - } - - if (maxlen > 0) { - ptr = *buf = pemalloc_rel_orig(maxlen + 1, persistent); - while ((len < maxlen) & !php_stream_eof(src)) { - ret = php_stream_read(src, ptr, maxlen - len); - len += ret; - ptr += ret; - } - *ptr = '\0'; - return len; - } - - /* avoid many reallocs by allocating a good sized chunk to begin with, if - * we can. Note that the stream may be filtered, in which case the stat - * result may be inaccurate, as the filter may inflate or deflate the - * number of bytes that we can read. In order to avoid an upsize followed - * by a downsize of the buffer, overestimate by the step size (which is - * 2K). */ - if (php_stream_stat(src, &ssbuf) == 0 && ssbuf.sb.st_size > 0) { - max_len = ssbuf.sb.st_size + step; - } else { - max_len = step; - } - - ptr = *buf = pemalloc_rel_orig(max_len, persistent); - - while((ret = php_stream_read(src, ptr, max_len - len))) { - len += ret; - if (len + min_room >= max_len) { - *buf = perealloc_rel_orig(*buf, max_len + step, persistent); - max_len += step; - ptr = *buf + len; - } else { - ptr += ret; - } - } - if (len) { - *buf = perealloc_rel_orig(*buf, len + 1, persistent); - (*buf)[len] = '\0'; - } else { - pefree(*buf, persistent); - *buf = NULL; - } - return len; -} - -PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC) -{ - char buf[CHUNK_SIZE]; - size_t readchunk; - size_t haveread = 0; - size_t didread; - php_stream_statbuf ssbuf; - - if (maxlen == 0) { - return 0; - } - - if (maxlen == PHP_STREAM_COPY_ALL) { - maxlen = 0; - } - - if (php_stream_stat(src, &ssbuf) == 0) { - /* in the event that the source file is 0 bytes, return 1 to indicate success - * because opening the file to write had already created a copy */ - if (ssbuf.sb.st_size == 0 -#ifdef S_ISFIFO - && !S_ISFIFO(ssbuf.sb.st_mode) -#endif -#ifdef S_ISCHR - && !S_ISCHR(ssbuf.sb.st_mode) -#endif - ) { - return 1; - } - } - - if (php_stream_mmap_possible(src)) { - char *p; - size_t mapped; - - p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - haveread = php_stream_write(dest, p, mapped); - - php_stream_mmap_unmap(src); - - return mapped; - } - } - - while(1) { - readchunk = sizeof(buf); - - if (maxlen && (maxlen - haveread) < readchunk) - readchunk = maxlen - haveread; - - didread = php_stream_read(src, buf, readchunk); - - if (didread) { - /* extra paranoid */ - size_t didwrite, towrite; - char *writeptr; - - towrite = didread; - writeptr = buf; - haveread += didread; - - while(towrite) { - didwrite = php_stream_write(dest, writeptr, towrite); - if (didwrite == 0) { - return 0; /* error */ - } - - towrite -= didwrite; - writeptr += didwrite; - } - } else { - if (maxlen == 0) { - return haveread; - } else { - return 0; /* error */ - } - } - - if (maxlen - haveread == 0) { - break; - } - } - return haveread; - -} -/* }}} */ - -/* {{{ wrapper init and registration */ - -static void stream_resource_regular_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream = (php_stream*)rsrc->ptr; - /* set the return value for pclose */ - FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); -} - -static void stream_resource_persistent_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream = (php_stream*)rsrc->ptr; - FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); -} - -void php_shutdown_stream_hashes(TSRMLS_D) -{ - if (FG(stream_wrappers)) { - zend_hash_destroy(FG(stream_wrappers)); - efree(FG(stream_wrappers)); - FG(stream_wrappers) = NULL; - } - - if (FG(stream_filters)) { - zend_hash_destroy(FG(stream_filters)); - efree(FG(stream_filters)); - FG(stream_filters) = NULL; - } -} - -int php_init_stream_wrappers(int module_number TSRMLS_DC) -{ - le_stream = zend_register_list_destructors_ex(stream_resource_regular_dtor, NULL, "stream", module_number); - le_pstream = zend_register_list_destructors_ex(NULL, stream_resource_persistent_dtor, "persistent stream", module_number); - - /* Filters are cleaned up by the streams they're attached to */ - le_stream_filter = zend_register_list_destructors_ex(NULL, NULL, "stream filter", module_number); - - return ( - zend_hash_init(&url_stream_wrappers_hash, 0, NULL, NULL, 1) == SUCCESS - && - zend_hash_init(php_get_stream_filters_hash_global(), 0, NULL, NULL, 1) == SUCCESS - && - zend_hash_init(php_stream_xport_get_hash(), 0, NULL, NULL, 1) == SUCCESS - && - php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS - && - php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS -#if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE)) - && - php_stream_xport_register("unix", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS - && - php_stream_xport_register("udg", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS -#endif - ) ? SUCCESS : FAILURE; -} - -int php_shutdown_stream_wrappers(int module_number TSRMLS_DC) -{ - zend_hash_destroy(&url_stream_wrappers_hash); - zend_hash_destroy(php_get_stream_filters_hash_global()); - zend_hash_destroy(php_stream_xport_get_hash()); - return SUCCESS; -} - -/* Validate protocol scheme names during registration - * Must conform to /^[a-zA-Z0-9+.-]+$/ - */ -static inline int php_stream_wrapper_scheme_validate(char *protocol, int protocol_len) -{ - int i; - - for(i = 0; i < protocol_len; i++) { - if (!isalnum((int)protocol[i]) && - protocol[i] != '+' && - protocol[i] != '-' && - protocol[i] != '.') { - return FAILURE; - } - } - - return SUCCESS; -} - -/* API for registering GLOBAL wrappers */ -PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) -{ - int protocol_len = strlen(protocol); - - if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { - return FAILURE; - } - - return zend_hash_add(&url_stream_wrappers_hash, protocol, protocol_len, wrapper, sizeof(*wrapper), NULL); -} - -PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC) -{ - return zend_hash_del(&url_stream_wrappers_hash, protocol, strlen(protocol)); -} - -/* API for registering VOLATILE wrappers */ -PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) -{ - int protocol_len = strlen(protocol); - - if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { - return FAILURE; - } - - if (!FG(stream_wrappers)) { - php_stream_wrapper tmpwrapper; - - ALLOC_HASHTABLE(FG(stream_wrappers)); - zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1); - zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmpwrapper, sizeof(php_stream_wrapper)); - } - - return zend_hash_add(FG(stream_wrappers), protocol, protocol_len, wrapper, sizeof(*wrapper), NULL); -} - -PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC) -{ - if (!FG(stream_wrappers)) { - php_stream_wrapper tmpwrapper; - - ALLOC_HASHTABLE(FG(stream_wrappers)); - zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1); - zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmpwrapper, sizeof(php_stream_wrapper)); - } - - return zend_hash_del(FG(stream_wrappers), protocol, strlen(protocol)); -} -/* }}} */ - -/* {{{ php_stream_locate_url_wrapper */ -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC) -{ - HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); - php_stream_wrapper *wrapper = NULL; - const char *p, *protocol = NULL; - int n = 0; - - if (path_for_open) { - *path_for_open = (char*)path; - } - - if (options & IGNORE_URL) { - return (options & STREAM_LOCATE_WRAPPERS_ONLY) ? NULL : &php_plain_files_wrapper; - } - - for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } - - if ((*p == ':') && (n > 1) && !strncmp("://", p, 3)) { - protocol = path; - } else if (strncasecmp(path, "zlib:", 5) == 0) { - /* BC with older php scripts and zlib wrapper */ - protocol = "compress.zlib"; - n = 13; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead."); - } - - if (protocol) { - if (FAILURE == zend_hash_find(wrapper_hash, (char*)protocol, n, (void**)&wrapper)) { - char wrapper_name[32]; - - if (n >= sizeof(wrapper_name)) - n = sizeof(wrapper_name) - 1; - PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", - wrapper_name); - - wrapper = NULL; - protocol = NULL; - } - } - /* TODO: curl based streams probably support file:// properly */ - if (!protocol || !strncasecmp(protocol, "file", n)) { - if (protocol) { - int localhost = 0; - - if (!strncasecmp(path, "file://localhost/", 17)) { - localhost = 1; - } - -#ifdef PHP_WIN32 - if (localhost == 0 && path[n+3] != '\0' && path[n+3] != '/' && path[n+4] != ':') { -#else - if (localhost == 0 && path[n+3] != '/') { -#endif - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path); - } - return NULL; - } - - if (path_for_open) { - /* skip past protocol and :/, but handle windows correctly */ - *path_for_open = (char*)path + n + 1; - if (localhost == 1) { - (*path_for_open) += 11; - } - while (*(++*path_for_open)=='/'); -#ifdef PHP_WIN32 - if (*(*path_for_open + 1) != ':') -#endif - (*path_for_open)--; - } - } - - if (options & STREAM_LOCATE_WRAPPERS_ONLY) { - return NULL; - } - - if (FG(stream_wrappers)) { - /* The file:// wrapper may have been disabled/overridden */ - - if (wrapper) { - /* It was found so go ahead and provide it */ - return wrapper; - } - - /* Check again, the original check might have not known the protocol name */ - if (zend_hash_find(wrapper_hash, "file", sizeof("file")-1, (void**)&wrapper) == SUCCESS) { - return wrapper; - } - - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Plainfiles wrapper disabled"); - } - return NULL; - } - - /* fall back on regular file access */ - return &php_plain_files_wrapper; - } - - if (wrapper && wrapper->is_url && !PG(allow_url_fopen)) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); - } - return NULL; - } - - return wrapper; -} -/* }}} */ - -/* {{{ _php_stream_mkdir - */ -PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - - wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC); - if (!wrapper || !wrapper->wops || !wrapper->wops->stream_mkdir) { - return 0; - } - - return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context TSRMLS_CC); -} -/* }}} */ - -/* {{{ _php_stream_rmdir - */ -PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - - wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC); - if (!wrapper || !wrapper->wops || !wrapper->wops->stream_rmdir) { - return 0; - } - - return wrapper->wops->stream_rmdir(wrapper, path, options, context TSRMLS_CC); -} -/* }}} */ - -/* {{{ _php_stream_stat_path */ -PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - char *path_to_open = path; - int ret; - - /* Try to hit the cache first */ - if (flags & PHP_STREAM_URL_STAT_LINK) { - if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) { - memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf)); - return 0; - } - } else { - if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) { - memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf)); - return 0; - } - } - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC); - if (wrapper && wrapper->wops->url_stat) { - ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC); - if (ret == 0) { - /* Drop into cache */ - if (flags & PHP_STREAM_URL_STAT_LINK) { - if (BG(CurrentLStatFile)) { - efree(BG(CurrentLStatFile)); - } - BG(CurrentLStatFile) = estrdup(path); - memcpy(&BG(lssb), ssb, sizeof(php_stream_statbuf)); - } else { - if (BG(CurrentStatFile)) { - efree(BG(CurrentStatFile)); - } - BG(CurrentStatFile) = estrdup(path); - memcpy(&BG(ssb), ssb, sizeof(php_stream_statbuf)); - } - } - return ret; - } - return -1; -} -/* }}} */ - -/* {{{ php_stream_opendir */ -PHPAPI php_stream *_php_stream_opendir(char *path, int options, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_wrapper *wrapper = NULL; - char *path_to_open; - - if (!path || !*path) { - return NULL; - } - - path_to_open = path; - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); - - if (wrapper && wrapper->wops->dir_opener) { - stream = wrapper->wops->dir_opener(wrapper, - path_to_open, "r", options ^ REPORT_ERRORS, NULL, - context STREAMS_REL_CC TSRMLS_CC); - - if (stream) { - stream->wrapper = wrapper; - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - } - } else if (wrapper) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, "not implemented"); - } - if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open dir" TSRMLS_CC); - } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); - - return stream; -} -/* }}} */ - -/* {{{ _php_stream_readdir */ -PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC) -{ - - if (sizeof(php_stream_dirent) == php_stream_read(dirstream, (char*)ent, sizeof(php_stream_dirent))) { - return ent; - } - - return NULL; -} -/* }}} */ - -/* {{{ php_stream_open_wrapper_ex */ -PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_wrapper *wrapper = NULL; - char *path_to_open; - int persistent = options & STREAM_OPEN_PERSISTENT; - char *copy_of_path = NULL; - char implicit_mode[16]; - int modelen = strlen(mode); - - if (opened_path) { - *opened_path = NULL; - } - - if (!path || !*path) { - return NULL; - } - - path_to_open = path; - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); - if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function may only be used against URLs."); - return NULL; - } - - strlcpy(implicit_mode, mode, sizeof(implicit_mode)); - if (context && context->default_mode && modelen < 15 && !strchr(mode, 't') && !strchr(mode, 'b')) { - if (context->default_mode & PHP_FILE_BINARY) { - implicit_mode[modelen++] = 'b'; - } else if (context->default_mode & PHP_FILE_TEXT) { - implicit_mode[modelen++] = 't'; - } - implicit_mode[modelen] = '\0'; - } - - if (wrapper) { - - stream = wrapper->wops->stream_opener(wrapper, - path_to_open, implicit_mode, options ^ REPORT_ERRORS, - opened_path, context STREAMS_REL_CC TSRMLS_CC); - - /* if the caller asked for a persistent stream but the wrapper did not - * return one, force an error here */ - if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, - "wrapper does not support persistent streams"); - php_stream_close(stream); - stream = NULL; - } - - if (stream) { - stream->wrapper = wrapper; - strlcpy(stream->mode, implicit_mode, sizeof(stream->mode)); - } - } - - if (stream) { - if (stream->orig_path) { - pefree(stream->orig_path, persistent); - } - copy_of_path = pestrdup(path, persistent); - stream->orig_path = copy_of_path; - } - - if (stream != NULL && (options & STREAM_MUST_SEEK)) { - php_stream *newstream; - - switch(php_stream_make_seekable_rel(stream, &newstream, - (options & STREAM_WILL_CAST) - ? PHP_STREAM_PREFER_STDIO : PHP_STREAM_NO_PREFERENCE)) { - case PHP_STREAM_UNCHANGED: - return stream; - case PHP_STREAM_RELEASED: - newstream->orig_path = pestrdup(path, persistent); - return newstream; - default: - php_stream_close(stream); - stream = NULL; - if (options & REPORT_ERRORS) { - char *tmp = estrdup(path); - php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "could not make seekable - %s", - tmp); - efree(tmp); - - options ^= REPORT_ERRORS; - } - } - } - - if (stream && stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && strchr(mode, 'a') && stream->position == 0) { - off_t newpos = 0; - - /* if opened for append, we need to revise our idea of the initial file position */ - if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos TSRMLS_CC)) { - stream->position = newpos; - } - } - - /* Output encoding on text mode streams defaults to utf8 unless specified in context parameter */ - if (stream && strchr(implicit_mode, 't') && UG(unicode)) { - if (strchr(implicit_mode, 'w') || strchr(implicit_mode, 'a') || strchr(implicit_mode, '+')) { - php_stream_filter *filter; - char *encoding = (context && context->output_encoding) ? context->output_encoding : "utf8"; - char *filtername; - int encoding_len = strlen(encoding); - - filtername = emalloc(encoding_len + sizeof("unicode.to.")); - memcpy(filtername, "unicode.to.", sizeof("unicode.to.") - 1); - memcpy(filtername + sizeof("unicode.to.") - 1, encoding, encoding_len + 1); - - filter = php_stream_filter_create(filtername, NULL, persistent TSRMLS_CC); - if (!filter) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed applying output encoding"); - } else { - php_stream_filter_append(&stream->writefilters, filter); - } - efree(filtername); - } - - if (strchr(implicit_mode, 'r') || strchr(implicit_mode, '+')) { - php_stream_filter *filter; - char *filtername; - char *encoding = (context && context->input_encoding) ? context->input_encoding : "utf8"; - int input_encoding_len = strlen(encoding); - - filtername = emalloc(input_encoding_len + sizeof("unicode.from.")); - memcpy(filtername, "unicode.from.", sizeof("unicode.from.") - 1); - memcpy(filtername + sizeof("unicode.from.") - 1, encoding, input_encoding_len + 1); - - filter = php_stream_filter_create(filtername, NULL, persistent TSRMLS_CC); - if (!filter) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed applying input encoding"); - } else { - php_stream_filter_append(&stream->readfilters, filter); - } - efree(filtername); - } - } - - if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open stream" TSRMLS_CC); - } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); -#if ZEND_DEBUG - if (stream == NULL && copy_of_path != NULL) { - pefree(copy_of_path, persistent); - } -#endif - - - return stream; -} -/* }}} */ - -/* {{{ context API */ -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) -{ - php_stream_context *oldcontext = stream->context; - stream->context = context; - return oldcontext; -} - -PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC) -{ - if (context && context->notifier) - context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr TSRMLS_CC); -} - -PHPAPI void php_stream_context_free(php_stream_context *context) -{ - if (context->options) { - zval_ptr_dtor(&context->options); - context->options = NULL; - } - if (context->notifier) { - php_stream_notification_free(context->notifier); - context->notifier = NULL; - } - if (context->input_encoding) { - efree(context->input_encoding); - } - if (context->output_encoding) { - efree(context->output_encoding); - } - if (context->links) { - zval_ptr_dtor(&context->links); - context->links = NULL; - } - efree(context); -} - -PHPAPI php_stream_context *php_stream_context_alloc(void) -{ - php_stream_context *context; - - context = ecalloc(1, sizeof(php_stream_context)); - context->notifier = NULL; - MAKE_STD_ZVAL(context->options); - array_init(context->options); - - context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context()); - return context; -} - -PHPAPI php_stream_notifier *php_stream_notification_alloc(void) -{ - return ecalloc(1, sizeof(php_stream_notifier)); -} - -PHPAPI void php_stream_notification_free(php_stream_notifier *notifier) -{ - if (notifier->dtor) { - notifier->dtor(notifier); - } - efree(notifier); -} - -PHPAPI int php_stream_context_get_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval ***optionvalue) -{ - zval **wrapperhash; - - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { - return FAILURE; - } - return zend_hash_find(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)optionvalue); -} - -PHPAPI int php_stream_context_set_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval *optionvalue) -{ - zval **wrapperhash; - zval *category, *copied_val; - - ALLOC_INIT_ZVAL(copied_val); - *copied_val = *optionvalue; - zval_copy_ctor(copied_val); - INIT_PZVAL(copied_val); - - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { - MAKE_STD_ZVAL(category); - array_init(category); - if (FAILURE == zend_hash_update(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&category, sizeof(zval *), NULL)) { - return FAILURE; - } - - wrapperhash = &category; - } - return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)&copied_val, sizeof(zval *), NULL); -} - -PHPAPI int php_stream_context_get_link(php_stream_context *context, - const char *hostent, php_stream **stream) -{ - php_stream **pstream; - - if (!stream || !hostent || !context || !(context->links)) { - return FAILURE; - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&pstream)) { - *stream = *pstream; - return SUCCESS; - } - return FAILURE; -} - -PHPAPI int php_stream_context_set_link(php_stream_context *context, - const char *hostent, php_stream *stream) -{ - if (!context) { - return FAILURE; - } - if (!context->links) { - ALLOC_INIT_ZVAL(context->links); - array_init(context->links); - } - if (!stream) { - /* Delete any entry for */ - return zend_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1); - } - return zend_hash_update(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&stream, sizeof(php_stream *), NULL); -} - -PHPAPI int php_stream_context_del_link(php_stream_context *context, - php_stream *stream) -{ - php_stream **pstream; - char *hostent; - int ret = SUCCESS; - - if (!context || !context->links || !stream) { - return FAILURE; - } - - for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context->links)); - SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(context->links), (void**)&pstream); - zend_hash_move_forward(Z_ARRVAL_P(context->links))) { - if (*pstream == stream) { - if (SUCCESS == zend_hash_get_current_key(Z_ARRVAL_P(context->links), &hostent, NULL, 0)) { - if (FAILURE == zend_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1)) { - ret = FAILURE; - } - } else { - ret = FAILURE; - } - } - } - - return ret; -} -/* }}} */ - -/* {{{ php_stream_dirent_alphasort - */ -PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b) -{ - return strcoll(*a, *b); -} -/* }}} */ - -/* {{{ php_stream_dirent_alphasortr - */ -PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b) -{ - return strcoll(*b, *a); -} -/* }}} */ - -/* {{{ php_stream_scandir - */ -PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, - int (*compare) (const char **a, const char **b) TSRMLS_DC) -{ - php_stream *stream; - php_stream_dirent sdp; - char **vector = NULL; - int vector_size = 0; - int nfiles = 0; - - if (!namelist) { - return FAILURE; - } - - stream = php_stream_opendir(dirname, ENFORCE_SAFE_MODE | REPORT_ERRORS, context); - if (!stream) { - return FAILURE; - } - - while (php_stream_readdir(stream, &sdp)) { - if (nfiles == vector_size) { - if (vector_size == 0) { - vector_size = 10; - } else { - vector_size *= 2; - } - vector = (char **) erealloc(vector, vector_size * sizeof(char *)); - } - - vector[nfiles] = estrdup(sdp.d_name); - - nfiles++; - } - php_stream_closedir(stream); - - *namelist = vector; - - if (compare) { - qsort(*namelist, nfiles, sizeof(char *), (int(*)(const void *, const void *))compare); - } - return nfiles; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/transports.c b/main/streams/transports.c deleted file mode 100644 index 4cbd15079a828..0000000000000 --- a/main/streams/transports.c +++ /dev/null @@ -1,497 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_streams_int.h" -#include "ext/standard/file.h" - -static HashTable xport_hash; - -PHPAPI HashTable *php_stream_xport_get_hash(void) -{ - return &xport_hash; -} - -PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC) -{ - return zend_hash_update(&xport_hash, protocol, strlen(protocol), &factory, sizeof(factory), NULL); -} - -PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC) -{ - return zend_hash_del(&xport_hash, protocol, strlen(protocol)); -} - -#define ERR_REPORT(out_err, fmt, arg) \ - if (out_err) { spprintf(out_err, 0, fmt, arg); } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, arg); } - -#define ERR_RETURN(out_err, local_err, fmt) \ - if (out_err) { *out_err = local_err; } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, local_err ? local_err : "Unspecified error"); \ - if (local_err) { efree(local_err); local_err = NULL; } \ - } - -PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, - int flags, const char *persistent_id, - struct timeval *timeout, - php_stream_context *context, - char **error_string, - int *error_code - STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_transport_factory *factory = NULL; - const char *p, *protocol = NULL; - int n = 0, failed = 0; - char *error_text = NULL; - struct timeval default_timeout = { 0, 0 }; - - default_timeout.tv_sec = FG(default_socket_timeout); - - if (timeout == NULL) { - timeout = &default_timeout; - } - - /* check for a cached persistent socket */ - if (persistent_id) { - switch(php_stream_from_persistent_id(persistent_id, &stream TSRMLS_CC)) { - case PHP_STREAM_PERSISTENT_SUCCESS: - /* use a 0 second timeout when checking if the socket - * has already died */ - if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL)) { - return stream; - } - /* dead - kill it */ - php_stream_pclose(stream); - stream = NULL; - - /* fall through */ - - case PHP_STREAM_PERSISTENT_FAILURE: - default: - /* failed; get a new one */ - ; - } - } - - for (p = name; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } - - if ((*p == ':') && (n > 1) && !strncmp("://", p, 3)) { - protocol = name; - name = p + 3; - namelen -= n + 3; - } else { - protocol = "tcp"; - n = 3; - } - - if (protocol) { - if (FAILURE == zend_hash_find(&xport_hash, (char*)protocol, n, (void**)&factory)) { - char wrapper_name[32]; - - if (n >= sizeof(wrapper_name)) - n = sizeof(wrapper_name) - 1; - PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - - ERR_REPORT(error_string, "Unable to find the socket transport \"%s\" - did you forget to enable it when you configured PHP?", - wrapper_name); - - return NULL; - } - } - - if (factory == NULL) { - /* should never happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find a factory !?"); - return NULL; - } - - stream = (*factory)(protocol, n, - (char*)name, namelen, persistent_id, options, flags, timeout, - context STREAMS_REL_CC TSRMLS_CC); - - if (stream) { - stream->context = context; - - if ((flags & STREAM_XPORT_SERVER) == 0) { - /* client */ - - if (flags & STREAM_XPORT_CONNECT) { - if (-1 == php_stream_xport_connect(stream, name, namelen, - flags & STREAM_XPORT_CONNECT_ASYNC ? 1 : 0, - timeout, &error_text, error_code TSRMLS_CC)) { - - ERR_RETURN(error_string, error_text, "connect() failed: %s"); - - failed = 1; - } - } - - } else { - /* server */ - if (flags & STREAM_XPORT_BIND) { - if (0 != php_stream_xport_bind(stream, name, namelen, &error_text TSRMLS_CC)) { - ERR_RETURN(error_string, error_text, "bind() failed: %s"); - failed = 1; - } else if (flags & STREAM_XPORT_LISTEN) { - if (0 != php_stream_xport_listen(stream, 5, &error_text TSRMLS_CC)) { - ERR_RETURN(error_string, error_text, "listen() failed: %s"); - failed = 1; - } - } - } - } - } - - if (failed) { - /* failure means that they don't get a stream to play with */ - if (persistent_id) { - php_stream_pclose(stream); - } else { - php_stream_close(stream); - } - stream = NULL; - } - - return stream; -} - -/* Bind the stream to a local address */ -PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, long namelen, - char **error_text - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_OP_BIND; - param.inputs.name = (char*)name; - param.inputs.namelen = namelen; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - - return ret; -} - -/* Connect to a remote address */ -PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, long namelen, - int asynchronous, - struct timeval *timeout, - char **error_text, - int *error_code - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = asynchronous ? STREAM_XPORT_OP_CONNECT_ASYNC: STREAM_XPORT_OP_CONNECT; - param.inputs.name = (char*)name; - param.inputs.namelen = namelen; - param.inputs.timeout = timeout; - - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - if (error_code) { - *error_code = param.outputs.error_code; - } - return param.outputs.returncode; - } - - return ret; - -} - -/* Prepare to listen */ -PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, char **error_text TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_OP_LISTEN; - param.inputs.backlog = backlog; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - - return ret; -} - -/* Get the next client and their address (as a string) */ -PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen, - struct timeval *timeout, - char **error_text - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_ACCEPT; - param.inputs.timeout = timeout; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - *client = param.outputs.client; - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - return ret; -} - -PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - - param.op = want_peer ? STREAM_XPORT_OP_GET_PEER_NAME : STREAM_XPORT_OP_GET_NAME; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - - return param.outputs.returncode; - } - return ret; -} - -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC) -{ - php_stream_xport_crypto_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_CRYPTO_OP_SETUP; - param.inputs.method = crypto_method; - param.inputs.session = session_stream; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_CRYPTO_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); - - return ret; -} - -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC) -{ - php_stream_xport_crypto_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_CRYPTO_OP_ENABLE; - param.inputs.activate = activate; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_CRYPTO_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); - - return ret; -} - -/* Similar to recv() system call; read data from the stream, optionally - * peeking, optionally retrieving OOB data */ -PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, - long flags, void **addr, socklen_t *addrlen, char **textaddr, int *textaddrlen - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret = 0; - int recvd_len = 0; -#if 0 - int oob; - - if (flags == 0 && addr == NULL) { - return php_stream_read(stream, buf, buflen); - } - - if (stream->readfilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot peek or fetch OOB data from a filtered stream"); - return -1; - } - - oob = (flags & STREAM_OOB) == STREAM_OOB; - - if (!oob && addr == NULL) { - /* must be peeking at regular data; copy content from the buffer - * first, then adjust the pointer/len before handing off to the - * stream */ - recvd_len = stream->writepos - stream->readpos; - if (recvd_len > buflen) { - recvd_len = buflen; - } - if (recvd_len) { - memcpy(buf, stream->readbuf, recvd_len); - buf += recvd_len; - buflen -= recvd_len; - } - /* if we filled their buffer, return */ - if (buflen == 0) { - return recvd_len; - } - } -#endif - - /* otherwise, we are going to bypass the buffer */ - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_RECV; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - param.inputs.buf = buf; - param.inputs.buflen = buflen; - param.inputs.flags = flags; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - return recvd_len + param.outputs.returncode; - } - return recvd_len ? recvd_len : -1; -} - -/* Similar to send() system call; send data to the stream, optionally - * sending it as OOB data */ -PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - long flags, void *addr, socklen_t addrlen TSRMLS_DC) -{ - php_stream_xport_param param; - int ret = 0; - int oob; - -#if 0 - if (flags == 0 && addr == NULL) { - return php_stream_write(stream, buf, buflen); - } -#endif - - oob = (flags & STREAM_OOB) == STREAM_OOB; - - if ((oob || addr) && stream->writefilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream"); - return -1; - } - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_SEND; - param.want_addr = addr ? 1 : 0; - param.inputs.buf = (char*)buf; - param.inputs.buflen = buflen; - param.inputs.flags = flags; - param.inputs.addr = addr; - param.inputs.addrlen = addrlen; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - return -1; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/userspace.c b/main/streams/userspace.c deleted file mode 100644 index 9493027220bf0..0000000000000 --- a/main/streams/userspace.c +++ /dev/null @@ -1,1322 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - | Sara Golemon | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/file.h" - -static int le_protocols; - -struct php_user_stream_wrapper { - char * protoname; - char * classname; - zend_class_entry *ce; - php_stream_wrapper wrapper; -}; - -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - -static php_stream_wrapper_ops user_stream_wops = { - user_wrapper_opener, - NULL, /* close - the streams themselves know how */ - NULL, /* stat - the streams themselves know how */ - user_wrapper_stat_url, - user_wrapper_opendir, - "user-space", - user_wrapper_unlink, - user_wrapper_rename, - user_wrapper_mkdir, - user_wrapper_rmdir -}; - - -static void stream_wrapper_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - struct php_user_stream_wrapper * uwrap = (struct php_user_stream_wrapper*)rsrc->ptr; - - efree(uwrap->protoname); - efree(uwrap->classname); - efree(uwrap); -} - - -PHP_MINIT_FUNCTION(user_streams) -{ - le_protocols = zend_register_list_destructors_ex(stream_wrapper_dtor, NULL, "stream factory", 0); - if (le_protocols == FAILURE) - return FAILURE; - - REGISTER_LONG_CONSTANT("STREAM_USE_PATH", USE_PATH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_IGNORE_URL", IGNORE_URL, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_ENFORCE_SAFE_MODE", ENFORCE_SAFE_MODE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_REPORT_ERRORS", REPORT_ERRORS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_MUST_SEEK", STREAM_MUST_SEEK, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("STREAM_URL_STAT_LINK", PHP_STREAM_URL_STAT_LINK, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_URL_STAT_QUIET", PHP_STREAM_URL_STAT_QUIET, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_MKDIR_RECURSIVE", PHP_STREAM_MKDIR_RECURSIVE, CONST_CS|CONST_PERSISTENT); - - return SUCCESS; -} - -struct _php_userstream_data { - struct php_user_stream_wrapper * wrapper; - zval * object; -}; -typedef struct _php_userstream_data php_userstream_data_t; - -/* names of methods */ -#define USERSTREAM_OPEN "stream_open" -#define USERSTREAM_CLOSE "stream_close" -#define USERSTREAM_READ "stream_read" -#define USERSTREAM_WRITE "stream_write" -#define USERSTREAM_FLUSH "stream_flush" -#define USERSTREAM_SEEK "stream_seek" -#define USERSTREAM_TELL "stream_tell" -#define USERSTREAM_EOF "stream_eof" -#define USERSTREAM_STAT "stream_stat" -#define USERSTREAM_STATURL "url_stat" -#define USERSTREAM_UNLINK "unlink" -#define USERSTREAM_RENAME "rename" -#define USERSTREAM_MKDIR "mkdir" -#define USERSTREAM_RMDIR "rmdir" -#define USERSTREAM_DIR_OPEN "dir_opendir" -#define USERSTREAM_DIR_READ "dir_readdir" -#define USERSTREAM_DIR_REWIND "dir_rewinddir" -#define USERSTREAM_DIR_CLOSE "dir_closedir" -#define USERSTREAM_LOCK "stream_lock" - -/* {{{ class should have methods like these: - - function stream_open($path, $mode, $options, &$opened_path) - { - return true/false; - } - - function stream_read($count) - { - return false on error; - else return string; - } - - function stream_write($data) - { - return false on error; - else return count written; - } - - function stream_close() - { - } - - function stream_flush() - { - return true/false; - } - - function stream_seek($offset, $whence) - { - return true/false; - } - - function stream_tell() - { - return (int)$position; - } - - function stream_eof() - { - return true/false; - } - - function stream_stat() - { - return array( just like that returned by fstat() ); - } - - function url_stat(string $url, int $flags) - { - return array( just like that returned by stat() ); - } - - function unlink(string $url) - { - return true / false; - } - - function rename(string $from, string $to) - { - return true / false; - } - - function mkdir($dir, $mode, $options) - { - return true / false; - } - - function rmdir($dir, $options) - { - return true / false; - } - - function dir_opendir(string $url, int $options) - { - return true / false; - } - - function dir_readdir() - { - return string next filename in dir ; - } - - function dir_closedir() - { - release dir related resources; - } - - function dir_rewinddir() - { - reset to start of dir list; - } - - }}} **/ - -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; - zval **args[4]; - int call_result; - php_stream *stream = NULL; - zval *zcontext = NULL; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; - - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - ZVAL_REFCOUNT(us->object) = 1; - PZVAL_IS_REF(us->object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(us->object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(us->object, "context"); - } - - /* call it's stream_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, filename, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zmode); - ZVAL_STRING(zmode, mode, 1); - args[1] = &zmode; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[2] = &zoptions; - - MAKE_STD_ZVAL(zopened); - ZVAL_REFCOUNT(zopened) = 1; - PZVAL_IS_REF(zopened) = 1; - ZVAL_NULL(zopened); - args[3] = &zopened; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_OPEN, 1); - - call_result = call_user_function_ex(NULL, - &us->object, - zfuncname, - &zretval, - 4, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && zval_is_true(zretval)) { - /* the stream is now open! */ - stream = php_stream_alloc_rel(&php_stream_userspace_ops, us, 0, mode); - - /* if the opened path is set, copy it out */ - if (Z_TYPE_P(zopened) == IS_STRING && opened_path) { - *opened_path = estrndup(Z_STRVAL_P(zopened), Z_STRLEN_P(zopened)); - } - - /* set wrapper data to be a reference to our object */ - stream->wrapperdata = us->object; - zval_add_ref(&stream->wrapperdata); - } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_OPEN "\" call failed", - us->wrapper->classname); - } - - /* destroy everything else */ - if (stream == NULL) { - zval_ptr_dtor(&us->object); - efree(us); - } - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zopened); - zval_ptr_dtor(&zoptions); - zval_ptr_dtor(&zmode); - zval_ptr_dtor(&zfilename); - - FG(user_stream_current_filename) = NULL; - - return stream; -} - -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zoptions, *zretval = NULL, *zfuncname, *zcontext; - zval **args[2]; - int call_result; - php_stream *stream = NULL; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; - - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - ZVAL_REFCOUNT(us->object) = 1; - PZVAL_IS_REF(us->object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(us->object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(us->object, "context"); - } - - /* call it's dir_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, filename, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[1] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_DIR_OPEN, 1); - - call_result = call_user_function_ex(NULL, - &us->object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && zval_is_true(zretval)) { - /* the stream is now open! */ - stream = php_stream_alloc_rel(&php_stream_userspace_dir_ops, us, 0, mode); - - /* set wrapper data to be a reference to our object */ - stream->wrapperdata = us->object; - zval_add_ref(&stream->wrapperdata); - } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed", - us->wrapper->classname); - } - - /* destroy everything else */ - if (stream == NULL) { - zval_ptr_dtor(&us->object); - efree(us); - } - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zoptions); - zval_ptr_dtor(&zfilename); - - FG(user_stream_current_filename) = NULL; - - return stream; -} - - -/* {{{ proto bool stream_wrapper_register(string protocol, string classname) - Registers a custom URL protocol handler class */ -PHP_FUNCTION(stream_wrapper_register) -{ - char *protocol, *classname; - int protocol_len, classname_len; - struct php_user_stream_wrapper * uwrap; - int rsrc_id; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &protocol, &protocol_len, &classname, &classname_len) == FAILURE) { - RETURN_FALSE; - } - - uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap)); - uwrap->protoname = estrndup(protocol, protocol_len); - uwrap->classname = estrndup(classname, classname_len); - uwrap->wrapper.wops = &user_stream_wops; - uwrap->wrapper.abstract = uwrap; - - rsrc_id = ZEND_REGISTER_RESOURCE(NULL, uwrap, le_protocols); - - if (zend_lookup_class(uwrap->classname, classname_len, (zend_class_entry***)&uwrap->ce TSRMLS_CC) == SUCCESS) { - uwrap->ce = *(zend_class_entry**)uwrap->ce; - if (php_register_url_stream_wrapper_volatile(protocol, &uwrap->wrapper TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } else { - /* We failed. But why? */ - if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol, protocol_len)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol %s:// is already defined.", protocol); - } else { - /* Should never happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to register wrapper class %s to %s://", classname, protocol); - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "class '%s' is undefined", classname); - } - - zend_list_delete(rsrc_id); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ bool stream_wrapper_unregister(string protocol) - Unregister a wrapper for the life of the current request. */ -PHP_FUNCTION(stream_wrapper_unregister) -{ - char *protocol; - int protocol_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) { - RETURN_FALSE; - } - - if (php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC) == FAILURE) { - /* We failed */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to unregister protocol %s://", protocol); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ bool stream_wrapper_restore(string protocol) - Restore the original protocol handler, overriding if necessary */ -PHP_FUNCTION(stream_wrapper_restore) -{ - char *protocol; - int protocol_len; - php_stream_wrapper *wrapper = NULL; - HashTable *global_wrapper_hash; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) { - RETURN_FALSE; - } - - global_wrapper_hash = php_stream_get_url_stream_wrappers_hash_global(); - if (php_stream_get_url_stream_wrappers_hash() == global_wrapper_hash) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s:// was never changed, nothing to restore", protocol); - RETURN_TRUE; - } - - if ((zend_hash_find(global_wrapper_hash, protocol, protocol_len, (void**)&wrapper) == FAILURE) || !wrapper) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// never existed, nothing to restore", protocol); - RETURN_FALSE; - } - - /* A failure here could be okay given that the protocol might have been merely unregistered */ - php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC); - - if (php_register_url_stream_wrapper_volatile(protocol, wrapper TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to restore original %s:// wrapper", protocol); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval **args[1]; - zval *zbufptr; - size_t didwrite = 0; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_WRITE, sizeof(USERSTREAM_WRITE)-1, 0); - - MAKE_STD_ZVAL(zbufptr); - ZVAL_STRINGL(zbufptr, (char*)buf, count, 1);; - args[0] = &zbufptr; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, - 0, NULL TSRMLS_CC); - zval_ptr_dtor(&zbufptr); - - didwrite = 0; - if (call_result == SUCCESS && retval != NULL) { - convert_to_long(retval); - didwrite = Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!", - us->wrapper->classname); - } - - /* don't allow strange buffer overruns due to bogus return */ - if (didwrite > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %ld bytes more data than requested (%ld written, %ld max)", - us->wrapper->classname, - (long)(didwrite - count), (long)didwrite, (long)count); - didwrite = count; - } - - if (retval) - zval_ptr_dtor(&retval); - - return didwrite; -} - -static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - zval **args[1]; - int call_result; - size_t didread = 0; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval *zcount; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_READ, sizeof(USERSTREAM_READ)-1, 0); - - MAKE_STD_ZVAL(zcount); - ZVAL_LONG(zcount, count); - args[0] = &zcount; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL) { - convert_to_string(retval); - didread = Z_STRLEN_P(retval); - if (didread > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %ld bytes more data than requested (%ld read, %ld max) - excess data will be lost", - us->wrapper->classname, (long)(didread - count), (long)didread, (long)count); - didread = count; - } - if (didread > 0) - memcpy(buf, Z_STRVAL_P(retval), didread); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!", - us->wrapper->classname); - } - zval_ptr_dtor(&zcount); - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - /* since the user stream has no way of setting the eof flag directly, we need to ask it if we hit eof */ - - ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) { - stream->eof = 1; - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", - us->wrapper->classname); - - stream->eof = 1; - } - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - return didread; -} - -static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_CLOSE, sizeof(USERSTREAM_CLOSE)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - zval_ptr_dtor(&us->object); - - efree(us); - - return 0; -} - -static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_FLUSH, sizeof(USERSTREAM_FLUSH)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) - call_result = 0; - else - call_result = -1; - - if (retval) - zval_ptr_dtor(&retval); - - return call_result; -} - -static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result, ret; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval **args[2]; - zval *zoffs, *zwhence; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_SEEK, sizeof(USERSTREAM_SEEK)-1, 0); - - MAKE_STD_ZVAL(zoffs); - ZVAL_LONG(zoffs, offset); - args[0] = &zoffs; - - MAKE_STD_ZVAL(zwhence); - ZVAL_LONG(zwhence, whence); - args[1] = &zwhence; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 2, args, - 0, NULL TSRMLS_CC); - - zval_ptr_dtor(&zoffs); - zval_ptr_dtor(&zwhence); - - if (call_result == FAILURE) { - /* stream_seek is not implemented, so disable seeks for this stream */ - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - /* there should be no retval to clean up */ - - if (retval) - zval_ptr_dtor(&retval); - - return -1; - } else if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) { - ret = 0; - } else { - ret = -1; - } - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - /* now determine where we are */ - ZVAL_STRINGL(&func_name, USERSTREAM_TELL, sizeof(USERSTREAM_TELL)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_LONG) - *newoffs = Z_LVAL_P(retval); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", - us->wrapper->classname); - - if (retval) - zval_ptr_dtor(&retval); - - return 0; -} - -/* parse the return value from one of the stat functions and store the - * relevant fields into the statbuf provided */ -static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC) -{ - zval **elem; - -#define STAT_PROP_ENTRY_EX(name, name2) \ - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(array), #name, sizeof(#name), (void**)&elem)) { \ - convert_to_long(*elem); \ - ssb->sb.st_##name2 = Z_LVAL_PP(elem); \ - } - -#define STAT_PROP_ENTRY(name) STAT_PROP_ENTRY_EX(name,name) - - STAT_PROP_ENTRY(dev); - STAT_PROP_ENTRY(ino); - STAT_PROP_ENTRY(mode); - STAT_PROP_ENTRY(nlink); - STAT_PROP_ENTRY(uid); - STAT_PROP_ENTRY(gid); -#if HAVE_ST_RDEV - STAT_PROP_ENTRY(rdev); -#endif - STAT_PROP_ENTRY(size); -#ifdef NETWARE - STAT_PROP_ENTRY_EX(atime, atime.tv_sec); - STAT_PROP_ENTRY_EX(mtime, mtime.tv_sec); - STAT_PROP_ENTRY_EX(ctime, ctime.tv_sec); -#else - STAT_PROP_ENTRY(atime); - STAT_PROP_ENTRY(mtime); - STAT_PROP_ENTRY(ctime); -#endif -#ifdef HAVE_ST_BLKSIZE - STAT_PROP_ENTRY(blksize); -#endif -#ifdef HAVE_ST_BLOCKS - STAT_PROP_ENTRY(blocks); -#endif - -#undef STAT_PROP_ENTRY -#undef STAT_PROP_ENTRY_EX - return SUCCESS; -} - -static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - int ret = -1; - - ZVAL_STRINGL(&func_name, USERSTREAM_STAT, sizeof(USERSTREAM_STAT)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_ARRAY) { - if (SUCCESS == statbuf_from_array(retval, ssb TSRMLS_CC)) - ret = 0; - } else { - if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!", - us->wrapper->classname); - } - } - - if (retval) - zval_ptr_dtor(&retval); - - return ret; -} - - -static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) { - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - int ret = -1; - zval *zvalue = NULL; - zval **args[1]; - - switch (option) { - case PHP_STREAM_OPTION_CHECK_LIVENESS: - ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1, 0); - call_result = call_user_function_ex(NULL, &us->object, &func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC); - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_BOOL) { - ret = zval_is_true(retval) ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - } else { - ret = PHP_STREAM_OPTION_RETURN_ERR; - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", - us->wrapper->classname); - } - break; - - case PHP_STREAM_OPTION_LOCKING: - MAKE_STD_ZVAL(zvalue); - ZVAL_LONG(zvalue, value); - args[0] = &zvalue; - - /* TODO wouldblock */ - ZVAL_STRINGL(&func_name, USERSTREAM_LOCK, sizeof(USERSTREAM_LOCK)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_BOOL) { - ret = !Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - if (value == 0) { - /* lock support test (TODO: more check) */ - ret = 0; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!", - us->wrapper->classname); - } - } - - break; - } - - /* clean up */ - if (retval) { - zval_ptr_dtor(&retval); - } - - - if (zvalue) { - zval_ptr_dtor(&zvalue); - } - - return ret; -} - - -static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zfuncname, *zretval, *zcontext; - zval **args[1]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_UNLINK, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 1, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - - return ret; -} - -static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zold_name, *znew_name, *zfuncname, *zretval, *zcontext; - zval **args[2]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the rename method */ - MAKE_STD_ZVAL(zold_name); - ZVAL_STRING(zold_name, url_from, 1); - args[0] = &zold_name; - - MAKE_STD_ZVAL(znew_name); - ZVAL_STRING(znew_name, url_to, 1); - args[1] = &znew_name; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_RENAME, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zold_name); - zval_ptr_dtor(&znew_name); - - return ret; -} - -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zmode, *zoptions, *zfuncname, *zretval, *zcontext; - zval **args[3]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zmode); - ZVAL_LONG(zmode, mode); - args[1] = &zmode; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[2] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_MKDIR, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 3, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) { - zval_ptr_dtor(&zretval); - } - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zmode); - zval_ptr_dtor(&zoptions); - - return ret; -} - -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zoptions, *zfuncname, *zretval, *zcontext; - zval **args[3]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[1] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_RMDIR, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) { - zval_ptr_dtor(&zretval); - } - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zoptions); - - return ret; -} - -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zfuncname, *zretval, *zflags, *zcontext; - zval **args[2]; - int call_result; - zval *object; - int ret = -1; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the stat_url method */ - - /* call it's stream_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zflags); - ZVAL_LONG(zflags, flags); - args[1] = &zflags; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_STATURL, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && Z_TYPE_P(zretval) == IS_ARRAY) { - /* We got the info we needed */ - if (SUCCESS == statbuf_from_array(zretval, ssb TSRMLS_CC)) - ret = 0; - } else { - if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!", - uwrap->classname); - } - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zflags); - - return ret; - -} - -static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - size_t didread = 0; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - php_stream_dirent *ent = (php_stream_dirent*)buf; - - /* avoid problems if someone mis-uses the stream */ - if (count != sizeof(php_stream_dirent)) - return 0; - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_READ, sizeof(USERSTREAM_DIR_READ)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) != IS_BOOL) { - convert_to_string(retval); - PHP_STRLCPY(ent->d_name, Z_STRVAL_P(retval), sizeof(ent->d_name), Z_STRLEN_P(retval)); - - didread = sizeof(php_stream_dirent); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!", - us->wrapper->classname); - } - - if (retval) - zval_ptr_dtor(&retval); - - return didread; -} - -static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_CLOSE, sizeof(USERSTREAM_DIR_CLOSE)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - zval_ptr_dtor(&us->object); - - efree(us); - - return 0; -} - -static int php_userstreamop_rewinddir(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_REWIND, sizeof(USERSTREAM_DIR_REWIND)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - return 0; - -} - -php_stream_ops php_stream_userspace_ops = { - php_userstreamop_write, php_userstreamop_read, - php_userstreamop_close, php_userstreamop_flush, - "user-space", - php_userstreamop_seek, - NULL, /* cast */ - php_userstreamop_stat, - php_userstreamop_set_option, -}; - -php_stream_ops php_stream_userspace_dir_ops = { - NULL, /* write */ - php_userstreamop_readdir, - php_userstreamop_closedir, - NULL, /* flush */ - "user-space-dir", - php_userstreamop_rewinddir, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - - diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c deleted file mode 100644 index 394010bde175c..0000000000000 --- a/main/streams/xp_socket.c +++ /dev/null @@ -1,801 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/file.h" -#include "streams/php_streams_int.h" -#include "php_network.h" - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -# undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif - -php_stream_ops php_stream_generic_socket_ops; -PHPAPI php_stream_ops php_stream_socket_ops; -php_stream_ops php_stream_udp_socket_ops; -#ifdef AF_UNIX -php_stream_ops php_stream_unix_socket_ops; -php_stream_ops php_stream_unixdg_socket_ops; -#endif - - -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); - -/* {{{ Generic socket stream operations */ -static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - int didwrite; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return 0; - } - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - -retry: - didwrite = send(sock->socket, buf, count, 0); - - if (didwrite <= 0) { - long err = php_socket_errno(); - char *estr; - - if (sock->is_blocked && err == EWOULDBLOCK) { - int retval; - - sock->timeout_event = 0; - - do { - retval = php_pollfd_for(sock->socket, POLLOUT, ptimeout); - - if (retval == 0) { - sock->timeout_event = 1; - break; - } - - if (retval > 0) { - /* writable now; retry */ - goto retry; - } - - err = php_socket_errno(); - } while (err == EINTR); - } - estr = php_socket_strerror(err, NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%ld %s", - (long)count, err, estr); - efree(estr); - } - - if (didwrite > 0) { - php_stream_notify_progress_increment(stream->context, didwrite, 0); - } - - if (didwrite < 0) { - didwrite = 0; - } - - return didwrite; -} - -static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC) -{ - int retval; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return; - } - - sock->timeout_event = 0; - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - - while(1) { - retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout); - - if (retval == 0) - sock->timeout_event = 1; - - if (retval >= 0) - break; - - if (php_socket_errno() != EINTR) - break; - } -} - -static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - int nr_bytes = 0; - - if (sock->socket == -1) { - return 0; - } - - if (sock->is_blocked) { - php_sock_stream_wait_for_data(stream, sock TSRMLS_CC); - if (sock->timeout_event) - return 0; - } - - nr_bytes = recv(sock->socket, buf, count, 0); - - stream->eof = (nr_bytes == 0 || (nr_bytes == -1 && php_socket_errno() != EWOULDBLOCK)); - - if (nr_bytes > 0) { - php_stream_notify_progress_increment(stream->context, nr_bytes, 0); - } - - if (nr_bytes < 0) { - nr_bytes = 0; - } - - return nr_bytes; -} - - -static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; -#ifdef PHP_WIN32 - int n; -#endif - - if (close_handle) { - - if (sock->socket != SOCK_ERR) { -#ifdef PHP_WIN32 - /* prevent more data from coming in */ - shutdown(sock->socket, SHUT_RD); - - /* try to make sure that the OS sends all data before we close the connection. - * Essentially, we are waiting for the socket to become writeable, which means - * that all pending data has been sent. - * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefintely. - * */ - do { - n = php_pollfd_for_ms(sock->socket, POLLOUT, 500); - } while (n == -1 && php_socket_errno() == EINTR); -#endif - closesocket(sock->socket); - sock->socket = SOCK_ERR; - } - - } - - pefree(sock, php_stream_is_persistent(stream)); - - return 0; -} - -static int php_sockop_flush(php_stream *stream TSRMLS_DC) -{ -#if 0 - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - return fsync(sock->socket); -#endif - return 0; -} - -static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - return fstat(sock->socket, &ssb->sb); -} - -static inline int sock_sendto(php_netstream_data_t *sock, char *buf, size_t buflen, int flags, - struct sockaddr *addr, socklen_t addrlen - TSRMLS_DC) -{ - if (addr) { - return sendto(sock->socket, buf, buflen, flags, addr, addrlen); - } - return send(sock->socket, buf, buflen, flags); -} - -static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t buflen, int flags, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - int ret; - int want_addr = textaddr || addr; - - if (want_addr) { - ret = recvfrom(sock->socket, buf, buflen, flags, (struct sockaddr*)&sa, &sl); - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, addr, addrlen TSRMLS_CC); - } else { - ret = recv(sock->socket, buf, buflen, flags); - } - - return ret; -} - -static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - int oldmode, flags; - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - php_stream_xport_param *xparam; - - switch(option) { - case PHP_STREAM_OPTION_CHECK_LIVENESS: - { - struct timeval tv; - char buf; - int alive = 1; - - if (value == -1) { - if (sock->timeout.tv_sec == -1) { - tv.tv_sec = FG(default_socket_timeout); - tv.tv_usec = 0; - } else { - tv = sock->timeout; - } - } else { - tv.tv_sec = value; - tv.tv_usec = 0; - } - - if (sock->socket == -1) { - alive = 0; - } else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { - if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) { - alive = 0; - } - } - return alive ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; - } - - case PHP_STREAM_OPTION_BLOCKING: - - oldmode = sock->is_blocked; - - /* no need to change anything */ - if (value == oldmode) - return oldmode; - - if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) { - sock->is_blocked = value; - return oldmode; - } - - return PHP_STREAM_OPTION_RETURN_ERR; - - case PHP_STREAM_OPTION_READ_TIMEOUT: - sock->timeout = *(struct timeval*)ptrparam; - sock->timeout_event = 0; - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_OPTION_META_DATA_API: - add_assoc_bool((zval *)ptrparam, "timed_out", sock->timeout_event); - add_assoc_bool((zval *)ptrparam, "blocked", sock->is_blocked); - add_assoc_bool((zval *)ptrparam, "eof", stream->eof); - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_OPTION_XPORT_API: - xparam = (php_stream_xport_param *)ptrparam; - - switch (xparam->op) { - case STREAM_XPORT_OP_LISTEN: - xparam->outputs.returncode = listen(sock->socket, 5); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_GET_NAME: - xparam->outputs.returncode = php_network_get_sock_name(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_GET_PEER_NAME: - xparam->outputs.returncode = php_network_get_peer_name(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_SEND: - flags = 0; - if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { - flags |= MSG_OOB; - } - xparam->outputs.returncode = sock_sendto(sock, - xparam->inputs.buf, xparam->inputs.buflen, - flags, - xparam->inputs.addr, - xparam->inputs.addrlen TSRMLS_CC); - if (xparam->outputs.returncode == -1) { - char *err = php_socket_strerror(php_socket_errno(), NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s\n", err); - efree(err); - } - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_RECV: - flags = 0; - if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { - flags |= MSG_OOB; - } - if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) { - flags |= MSG_PEEK; - } - xparam->outputs.returncode = sock_recvfrom(sock, - xparam->inputs.buf, xparam->inputs.buflen, - flags, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} - -static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - - switch(castas) { - case PHP_STREAM_AS_STDIO: - if (ret) { - *(FILE**)ret = fdopen(sock->socket, stream->mode); - if (*ret) - return SUCCESS; - return FAILURE; - } - return SUCCESS; - case PHP_STREAM_AS_FD_FOR_SELECT: - case PHP_STREAM_AS_FD: - case PHP_STREAM_AS_SOCKETD: - if (ret) - *(int*)ret = sock->socket; - return SUCCESS; - default: - return FAILURE; - } -} -/* }}} */ - -/* These may look identical, but we need them this way so that - * we can determine which type of socket we are dealing with - * by inspecting stream->ops. - * A "useful" side-effect is that the user's scripts can then - * make similar decisions using stream_get_meta_data. - * */ -php_stream_ops php_stream_generic_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "generic_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_sockop_set_option, -}; - - -php_stream_ops php_stream_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "tcp_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; - -php_stream_ops php_stream_udp_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "udp_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; - -#ifdef AF_UNIX -php_stream_ops php_stream_unix_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "unix_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; -php_stream_ops php_stream_unixdg_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "udg_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; -#endif - - -/* network socket operations */ - -#ifdef AF_UNIX -static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr TSRMLS_DC) -{ - memset(unix_addr, 0, sizeof(*unix_addr)); - unix_addr->sun_family = AF_UNIX; - - /* we need to be binary safe on systems that support an abstract - * namespace */ - if (xparam->inputs.namelen >= sizeof(unix_addr->sun_path)) { - /* On linux, when the path begins with a NUL byte we are - * referring to an abstract namespace. In theory we should - * allow an extra byte below, since we don't need the NULL. - * BUT, to get into this branch of code, the name is too long, - * so we don't care. */ - xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; - } - - memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen); - - return 1; -} -#endif - -static inline char *parse_ip_address_ex(const char *str, int str_len, int *portno, int get_err, char **err TSRMLS_DC) -{ - char *colon; - char *host = NULL; - -#ifdef HAVE_IPV6 - char *p; - - if (*(str) == '[') { - /* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */ - p = memchr(str + 1, ']', str_len - 2); - if (!p || *(p + 1) != ':') { - if (get_err) { - spprintf(err, 0, "Failed to parse IPv6 address \"%s\"", str); - } - return NULL; - } - *portno = atoi(p + 2); - return estrndup(str + 1, p - str - 1); - } -#endif - - colon = memchr(str, ':', str_len - 1); - if (colon) { - *portno = atoi(colon + 1); - host = estrndup(str, colon - str); - } else { - if (get_err) { - spprintf(err, 0, "Failed to parse address \"%s\"", str); - } - return NULL; - } - - return host; -} - -static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC) -{ - return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); -} - -static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) -{ - char *host = NULL; - int portno, err; - -#ifdef AF_UNIX - if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { - struct sockaddr_un unix_addr; - - sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGRAM, 0); - - if (sock->socket == SOCK_ERR) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "Failed to create unix%s socket %s", - stream->ops == &php_stream_unix_socket_ops ? "" : "datagram", - strerror(errno)); - } - return -1; - } - - parse_unix_address(xparam, &unix_addr TSRMLS_CC); - - return bind(sock->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)); - } -#endif - - host = parse_ip_address(xparam, &portno TSRMLS_CC); - - if (host == NULL) { - return -1; - } - - sock->socket = php_network_bind_socket_to_local_addr(host, portno, - stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err - TSRMLS_CC); - - if (host) { - efree(host); - } - - return sock->socket == -1 ? -1 : 0; -} - -static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) -{ - char *host = NULL, *bindto = NULL; - int portno, bindport; - int err; - int ret; - zval **tmpzval = NULL; - -#ifdef AF_UNIX - if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { - struct sockaddr_un unix_addr; - - sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGRAM, 0); - - if (sock->socket == SOCK_ERR) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "Failed to create unix socket"); - } - return -1; - } - - parse_unix_address(xparam, &unix_addr TSRMLS_CC); - - ret = php_network_connect_socket(sock->socket, - (const struct sockaddr *)&unix_addr, (socklen_t)sizeof(unix_addr), - xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err); - - xparam->outputs.error_code = err; - - goto out; - } -#endif - - host = parse_ip_address(xparam, &portno TSRMLS_CC); - - if (host == NULL) { - return -1; - } - - if (stream->context && php_stream_context_get_option(stream->context, "socket", "bindto", &tmpzval) == SUCCESS) { - if (Z_TYPE_PP(tmpzval) != IS_STRING) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "local_addr context option is not a string."); - } - return -1; - } - bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); - } - - /* Note: the test here for php_stream_udp_socket_ops is important, because we - * want the default to be TCP sockets so that the openssl extension can - * re-use this code. */ - - sock->socket = php_network_connect_socket_to_host(host, portno, - stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, - xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, - xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err, - bindto, - bindport - TSRMLS_CC); - - ret = sock->socket == -1 ? -1 : 0; - xparam->outputs.error_code = err; - - if (host) { - efree(host); - } - if (bindto) { - efree(bindto); - } - -#ifdef AF_UNIX -out: -#endif - - if (ret >= 0 && xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC && err == EINPROGRESS) { - /* indicates pending connection */ - return 1; - } - - return ret; -} - -static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC) -{ - int clisock; - - xparam->outputs.client = NULL; - - clisock = php_network_accept_incoming(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL, - xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &xparam->outputs.error_code - TSRMLS_CC); - - if (clisock >= 0) { - php_netstream_data_t *clisockdata; - - clisockdata = emalloc(sizeof(*clisockdata)); - - if (clisockdata == NULL) { - close(clisock); - /* technically a fatal error */ - } else { - memcpy(clisockdata, sock, sizeof(*clisockdata)); - clisockdata->socket = clisock; - - xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); - if (xparam->outputs.client) { - /* TODO: addref ? */ - xparam->outputs.client->context = stream->context; - } - } - } - - return xparam->outputs.client == NULL ? -1 : 0; -} - -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - php_stream_xport_param *xparam; - - switch(option) { - case PHP_STREAM_OPTION_XPORT_API: - xparam = (php_stream_xport_param *)ptrparam; - - switch(xparam->op) { - case STREAM_XPORT_OP_CONNECT: - case STREAM_XPORT_OP_CONNECT_ASYNC: - xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_BIND: - xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - - case STREAM_XPORT_OP_ACCEPT: - xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - default: - /* fall through */ - ; - } - - /* fall through */ - default: - return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC); - } -} - - -PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, long protolen, - char *resourcename, long resourcenamelen, - const char *persistent_id, int options, int flags, - struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_netstream_data_t *sock; - php_stream_ops *ops; - - /* which type of socket ? */ - if (strncmp(proto, "tcp", protolen) == 0) { - ops = &php_stream_socket_ops; - } else if (strncmp(proto, "udp", protolen) == 0) { - ops = &php_stream_udp_socket_ops; - } -#ifdef AF_UNIX - else if (strncmp(proto, "unix", protolen) == 0) { - ops = &php_stream_unix_socket_ops; - } else if (strncmp(proto, "udg", protolen) == 0) { - ops = &php_stream_unixdg_socket_ops; - } -#endif - else { - /* should never happen */ - return NULL; - } - - sock = pemalloc(sizeof(php_netstream_data_t), persistent_id ? 1 : 0); - memset(sock, 0, sizeof(php_netstream_data_t)); - - sock->is_blocked = 1; - sock->timeout.tv_sec = FG(default_socket_timeout); - sock->timeout.tv_usec = 0; - - /* we don't know the socket until we have determined if we are binding or - * connecting */ - sock->socket = -1; - - stream = php_stream_alloc_rel(ops, sock, persistent_id, "r+"); - - if (stream == NULL) { - pefree(sock, persistent_id ? 1 : 0); - return NULL; - } - - if (flags == 0) { - return stream; - } - - return stream; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/strlcat.c b/main/strlcat.c deleted file mode 100644 index 447c3aaac69d0..0000000000000 --- a/main/strlcat.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifndef HAVE_STRLCAT - -/* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */ - -/* - * Copyright (c) 1998 Todd C. Miller - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -PHPAPI size_t php_strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} - -#endif /* !HAVE_STRLCAT */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/strlcpy.c b/main/strlcpy.c deleted file mode 100644 index 003931945e530..0000000000000 --- a/main/strlcpy.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifndef HAVE_STRLCPY - -/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ - -/* - * Copyright (c) 1998 Todd C. Miller - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include - -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -PHPAPI size_t php_strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) - break; - } while (--n != 0); - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -#endif /* !HAVE_STRLCPY */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/win95nt.h b/main/win95nt.h deleted file mode 100644 index ff24f8e5f06ab..0000000000000 --- a/main/win95nt.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Defines and types for Windows 95/NT */ -#define HAVE_DECLARED_TIMEZONE -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include -#include -typedef int uid_t; -typedef int gid_t; -typedef char * caddr_t; -#define lstat(x, y) stat(x, y) -#define _IFIFO 0010000 /* fifo */ -#define _IFBLK 0060000 /* block special */ -#define _IFLNK 0120000 /* symbolic link */ -#define S_IFIFO _IFIFO -#define S_IFBLK _IFBLK -#define S_IFLNK _IFLNK -#ifndef S_ISREG -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#define chdir(path) SetCurrentDirectory(path) -#define mkdir(a, b) _mkdir(a) -#define rmdir(a) _rmdir(a) -#define getpid _getpid -#define php_sleep(t) Sleep(t*1000) -#define getcwd(a, b) _getcwd(a, b) -#define off_t _off_t -typedef unsigned int uint; -typedef unsigned long ulong; -#if !NSAPI -typedef long pid_t; -#endif - -/* missing in vc5 math.h */ -#define M_PI 3.14159265358979323846 -#define M_TWOPI (M_PI * 2.0) -#define M_PI_2 1.57079632679489661923 -#ifndef M_PI_4 -#define M_PI_4 0.78539816339744830962 -#endif - -#if !defined(PHP_DEBUG) -#ifdef inline -#undef inline -#endif -#define inline __inline -#endif - -/* General Windows stuff */ -#define WINDOWS 1 - -/* Prevent use of VC5 OpenFile function */ -#define NOOPENFILE - -/* sendmail is built-in */ -#ifdef PHP_PROG_SENDMAIL -#undef PHP_PROG_SENDMAIL -#define PHP_PROG_SENDMAIL "Built in mailer" -#endif diff --git a/makedist b/makedist deleted file mode 100755 index 77634b2527ffb..0000000000000 --- a/makedist +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/sh -# -# Distribution generator for CVS based packages. -# To work, this script needs a consistent tagging of all releases. -# Each release of a package should have a tag of the form -# -# _ -# -# where is the package name and the CVS module -# and s the version number with underscores instead of dots. -# -# For example: cvs tag php_5_0_1 -# -# The distribution ends up in a .tar.gz file that contains the distribution -# in a directory called -. The distribution contains all -# directories from the CVS module except the one called "nodist", but only -# the files INSTALL, README and config* are included. -# -# Since you can no longer set the CVS password via an env variable, you -# need to have previously done a cvs login for the server and user id -# this script uses so it will have an entry in your ~/.cvspasswd file. -# -# Usage: makedist -# -# Written by Stig Bakken 1997-05-28. -# -# $Id$ -# - -if test "$#" != "2"; then - echo "Usage: makedist " >&2 - exit 1 -fi - -PKG=$1 ; shift -VER=$1 ; shift - -old_IFS="$IFS" -IFS=. -eval set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'` -if test "${1}" = "1" -a "${2}" -lt "28"; then - echo "You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)" - exit 10 -fi -IFS="$old_IFS" - -PHPROOT=:pserver:cvsread@cvs.php.net:/repository -PHPMOD=php-src -LT_TARGETS='ltconfig ltmain.sh config.guess config.sub' - -if echo '\c' | grep -s c >/dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -MY_OLDPWD=`pwd` - -# the destination .tar.gz file -ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar - -# temporary directory used to check out files from CVS -DIR=$PKG-$VER -DIRPATH=$MY_OLDPWD/$DIR - -if test -d "$DIRPATH"; then - echo "The directory $DIR" - echo "already exists, rename or remove it and run makedist again." - exit 1 -fi - -# version part of the CVS release tag -CVSVER=`echo $VER | sed -e 's/[\.\-]/_/g'` - -# CVS release tag -if test "$VER" != "HEAD"; then - CVSTAG=${PKG}_$CVSVER -else - CVSTAG=HEAD -fi - -if test ! -d $DIRPATH; then - mkdir -p $DIRPATH || exit 2 -fi - -# Export PHP -$ECHO_N "makedist: exporting tag '$CVSTAG' from '$PHPMOD'...$ECHO_C" -cvs -z 9 -d $PHPROOT export -d $DIR -r $CVSTAG $PHPMOD || exit 4 -echo "" - -# remove CVS stuff... -cd $DIR || exit 5 -find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \; - -# The full ChangeLog is available separately from lxr.php.net -rm -f ChangeLog* - -# hide away our own versions of libtool-generated files -for i in $LT_TARGETS; do - if test -f "$i"; then - mv $i $i.bak - cp $i.bak $i - fi -done - -# generate some files so people don't need bison, flex and autoconf -# to install -set -x -./buildconf --copy --force - -# remove buildmk.stamp. Otherwise, buildcheck.sh might not be run, -# when a user runs buildconf in the distribution. -rm -f buildmk.stamp - -./genfiles - -# now restore our versions of libtool-generated files -for i in $LT_TARGETS; do - test -f "$i" && mv $i.bak $i -done - -cd $MY_OLDPWD -$ECHO_N "makedist: making gzipped tar archive...$ECHO_C" -rm -f $ARCHIVE.gz -tar cf $ARCHIVE $PKG-$VER || exit 8 -gzip -9 $ARCHIVE || exit 9 -echo "" - -$ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C" -rm -f $ARCHIVE.bz2 -tar cf $ARCHIVE $PKG-$VER || exit 10 -bzip2 -9 $ARCHIVE || exit 11 -echo "" - -$ECHO_N "makedist: cleaning up...$ECHO_C" -rm -rf $DIRPATH || exit 12 -echo "" - -exit 0 diff --git a/makerpm b/makerpm deleted file mode 100644 index 2b934fcae37ca..0000000000000 --- a/makerpm +++ /dev/null @@ -1,202 +0,0 @@ -#! /bin/sh - -# Based slightly on an original by John H Terpstra but not much left of his. -# S Liddicott 1999 sam@campbellsci.co.uk - -PREFIX="php" -TARDIR="`basename \`pwd\``" -RELEASE=${1:-1} -VERSION=${2:-`echo $TARDIR | sed "s/$PREFIX-//g"`} - -if [ "$VERSION" = "" ] -then cat <<"EOH" -$PREFIX source needs to be installed in a folder that contains the version -number, e.g. ${PREFIX}5 or ${PREFIX}5b2 -EOH -fi - -echo "Usage:" -echo "$0 " -echo -echo "e.g.:" -echo "$0 2" -echo -n "Building RPM version $VERSION, release: $RELEASE " -sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n . -echo - -TAR=php-$VERSION.tar.gz -SPEC=php-$VERSION.spec -PREQUIRES=`rpm -q --provides apache|grep "\(webserver\|httpd\)"` -if [ "$PREQUIRES" = "" ] -then PREQUIRES="webserver" -fi - -# write out the .spec file -sed -e "s/PVERSION/$VERSION/g" \ - -e "s/PRELEASE/$RELEASE/g" \ - -e "s/TARDIR/$TARDIR/g" \ - -e "s/PREQUIRES/$PREQUIRES/g" \ - > $SPEC <<'EOF' -Summary: PHP 5 - A powerful scripting language -Name: php5 -Version: PVERSION -Release: PRELEASE -Group: Networking/Daemons -Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz -Copyright: PHP License -BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot -Requires: PREQUIRES - -%description -PHP 5 is a powerful apache module that adds scripting and database connection -capabilities to the apache server. This version includes the "php_cgi" binary -for suExec and stand alone php scripts too. - -%prep -%setup -q -n TARDIR -#mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz -./buildconf - -%build -# first the standalone (why can't you build both at once?) -# need to run this under sh or it breaks - -sh ./configure --prefix=/usr \ - --with-config-file-path=%{_sysconfdir} \ - --disable-cli \ - --enable-force-cgi-redirect \ - --enable-safe-mode \ - --with-exec-dir=/usr/bin \ - --with-mysql \ - --with-zlib \ - --enable-xml \ - --enable-wddx \ - --with-gd \ - --enable-shared \ - -make -mv sapi/cgi/php php.keepme - -# then the apache module -test -f config.cache && rm -f config.cache -sh ./configure --prefix=/usr \ - --with-apxs=/usr/sbin/apxs \ - --enable-cli \ - --with-config-file-path=%{_sysconfdir} \ - --enable-safe-mode \ - --with-exec-dir=/usr/bin \ - --with-mysql \ - --with-zlib \ - --enable-xml \ - --enable-wddx \ - --with-gd \ - --enable-shared \ - -# --with-pgsql=shared \ - -make clean -make -# restore cgi version -mv php.keepme sapi/cgi/php - -%install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache -install -m 0755 .libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache -mkdir -p $RPM_BUILD_ROOT%{_bindir} -install -m 0755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir} -install -m 0755 sapi/cgi/php $RPM_BUILD_ROOT%{_bindir}/php_cgi -mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 -install -m 0755 sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1 -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} -install -m 0755 php.ini-recommended $RPM_BUILD_ROOT%{_sysconfdir}/php.ini -mkdir -p $RPM_BUILD_ROOT%{_libdir}/php/extensions -install -m 0755 modules/*.so $RPM_BUILD_ROOT%{_libdir}/php/extensions - -%clean -rm -rf $RPM_BUILD_ROOT - -%changelog -* Thu Nov 27 2003 Marcus Boerger -- Fix requirements for older systems. -- Fix rpm build directory for the major distributions. -- Fix config dir. -- Rename package to php. -- Add gd extension. -- Support building of shared extensions. -- Build CLI only once. - -* Thu Oct 31 2003 Marcus Boerger -- Update version to 5. -- Remove unsure external requirements. -- Remove non existing directories -- Fix targets. -- Install both CLI and CGI. -- Install manpage. -- Install ini. - -* Mon Mar 04 2002 Arjen Lentz -- Fix path and remove --with-imap due to conflicts with kerberos. - -* Fri Jun 29 2001 Jani Taskinen -- Removed some useless configure options. Made the tar names correct. - -* Sun Apr 30 2000 Joey Smith -- Small fix: Description still referred to package as PHP3. - -* Wed Jul 21 1999 Sam Liddicott -- added php4b1 and modified cgi building rules so it doesn't break module - -* Wed Mar 17 1999 Sam Liddicott -- Stuffed in 3.0.7 source tar and added "php" as a build destination - -* Mon Oct 12 1998 Cristian Gafton -- rebuild for apache 1.3.3 - -* Thu Oct 08 1998 Preston Brown -- updated to 3.0.5, fixes nasty bugs in 3.0.4. - -* Sun Sep 27 1998 Cristian Gafton -- updated to 3.0.4 and recompiled for apache 1.3.2 - -* Thu Sep 03 1998 Preston Brown -- improvements; builds with apache-devel package installed. - -* Tue Sep 01 1998 Preston Brown -- Made initial cut for PHP3. - -%files -%defattr(-,root,root) -%{_libdir}/apache/libphp5.so -%{_bindir}/php -%{_bindir}/php_cgi -%{_mandir}/man1/php.1* -%{_sysconfdir}/php.ini -%{_libdir}/php/extensions/*.so - -%doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE NEWS -EOF - -RPMBASE=/usr/src/redhat -for i in /usr/src/redhat /usr/src/packages /usr/src/RPM; do - if test -d $i; then - RPMBASE=$i - break - fi -done - -RPMDIR=${RPMBASE}/RPMS -SPECDIR=${RPMBASE}/SPECS -SRCDIR=${RPMBASE}/SOURCES - -( -make clean -find . -name config.cache -exec rm -f '{}' \; -cd .. -tar czvf ${SRCDIR}/${TAR} $TARDIR ) - -cp -a $SPEC $SPECDIR/${SPEC} -#cp -a *.patch $SRCDIR -cd $SRCDIR -cd $SPECDIR -rpm -ba -v ${SPEC} diff --git a/netware/sendmail_nw.h b/netware/sendmail_nw.h deleted file mode 100644 index b88f8e12a1377..0000000000000 --- a/netware/sendmail_nw.h +++ /dev/null @@ -1,19 +0,0 @@ - -#define closesocket close -#define LPCSTR char * -#define LPSTR char* -#define FAR -#ifdef USE_WINSOCK -#include -#else -#include /* For struct sockaddr, 'PF_INET' and 'AF_INET' */ -#include /* For struct sockaddr_in */ -#include /* For struct hostent */ -#endif /* USE_WINSOCK */ - -typedef int SOCKET; /* Borrowed from winsock\novsock2.h */ -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr * LPSOCKADDR; -typedef struct hostent * LPHOSTENT; - -#define INVALID_SOCKET (SOCKET)(~0) /* Borrowed from winsock\novsock2.h */ diff --git a/netware/start.c b/netware/start.c deleted file mode 100644 index 971a6027a3d31..0000000000000 --- a/netware/start.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Novell, Inc. | - +----------------------------------------------------------------------+ - */ - - -#include -#include -#include - -void *gLibHandle = (void *) NULL; -rtag_t gAllocTag = (rtag_t) NULL; -NXMutex_t *gLibLock = (NXMutex_t *) NULL; -int gLibId = 0; - - -int DisposeLibraryData( void *data) -{ - return 0; -} - - -int _NonAppStart -( - void *NLMHandle, - void *errorScreen, - const char *cmdLine, - const char *loadDirPath, - size_t uninitializedDataLength, - void *NLMFileHandle, - int (*readRoutineP)( int conn, void *fileHandle, size_t offset, - size_t nbytes, size_t *bytesRead, void *buffer ), - size_t customDataOffset, - size_t customDataSize, - int messageCount, - const char **messages -) -{ - NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); - -#pragma unused(cmdLine) -#pragma unused(loadDirPath) -#pragma unused(uninitializedDataLength) -#pragma unused(NLMFileHandle) -#pragma unused(readRoutineP) -#pragma unused(customDataOffset) -#pragma unused(customDataSize) -#pragma unused(messageCount) -#pragma unused(messages) - -/* Here we process our command line, post errors (to the error screen), - * perform initializations and anything else we need to do before being able - * to accept calls into us. If we succeed, we return non-zero and the NetWare - * Loader will leave us up, otherwise we fail to load and get dumped. - */ -/** - gAllocTag = AllocateResourceTag(NLMHandle, - " memory allocations", AllocSignature); - if (!gAllocTag) { - OutputToScreen(errorScreen, "Unable to allocate resource tag for " - "library memory allocations.\n"); - return -1; - } -**/ - gLibId = register_library(DisposeLibraryData); - if (gLibId == -1) { - OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); - return -1; - } - - gLibHandle = NLMHandle; - - gLibLock = NXMutexAlloc(0, 0, &liblock); - if (!gLibLock) { - OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); - return -1; - } - - return 0; -} - - -void _NonAppStop( void ) -{ -/* Here we clean up any resources we allocated. Resource tags is a big part - * of what we created, but NetWare doesn't ask us to free those. - */ - (void) unregister_library(gLibId); - NXMutexFree(gLibLock); -} - - -int _NonAppCheckUnload( void ) -{ -/* This function cannot be the first in the file for if the file is linked - * first, then the check-unload function's offset will be nlmname.nlm+0 - * which is how to tell that there isn't one. When the check function is - * first in the linked objects, it is ambiguous. For this reason, we will - * put it inside this file after the stop function. - * - * Here we check to see if it's alright to ourselves to be unloaded. If not, - * we return a non-zero value. Right now, there isn't any reason not to allow - * it. - */ - return 0; -} diff --git a/php.gif b/php.gif deleted file mode 100644 index 7beda43fd4174..0000000000000 Binary files a/php.gif and /dev/null differ diff --git a/php.ini-dist b/php.ini-dist deleted file mode 100644 index c9429bf23dbfa..0000000000000 --- a/php.ini-dist +++ /dev/null @@ -1,1185 +0,0 @@ -[PHP] - -;;;;;;;;;;; -; WARNING ; -;;;;;;;;;;; -; This is the default settings file for new PHP installations. -; By default, PHP installs itself with a configuration suitable for -; development purposes, and *NOT* for production purposes. -; For several security-oriented considerations that should be taken -; before going online with your site, please consult php.ini-recommended -; and http://php.net/manual/en/security.php. - - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; This file controls many aspects of PHP's behavior. In order for PHP to -; read it, it must be named 'php.ini'. PHP looks for it in the current -; working directory, in the path designated by the environment variable -; PHPRC, and in the path that was defined in compile time (in that order). -; Under Windows, the compile-time path is the Windows directory. The -; path in which the php.ini file is looked for can be overridden using -; the -c argument in command line mode. -; -; The syntax of the file is extremely simple. Whitespace and Lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. -; -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo"). -; -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT -; -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. -; -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: -; -; foo = ; sets foo to an empty string -; foo = none ; sets foo to an empty string -; foo = "none" ; sets foo to the string 'none' -; -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. -; -; -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; All the values in the php.ini-dist file correspond to the builtin -; defaults (that is, if no php.ini is used, or if you delete these lines, -; the builtin defaults will be identical). - - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -engine = On - -; Enable compatibility mode with Zend Engine 1 (PHP 4.x) -zend.ze1_compatibility_mode = Off - -; Allow the tags are recognized. -; NOTE: Using short tags should be avoided when developing applications or -; libraries that are meant for redistribution, or deployment on PHP -; servers which are not under your control, because short tags may not -; be supported on the target server. For portable, redistributable code, -; be sure not to use short tags. -short_open_tag = On - -; Allow ASP-style <% %> tags. -asp_tags = Off - -; The number of significant digits displayed in floating point numbers. -precision = 12 - -; Enforce year 2000 compliance (will cause problems with non-compliant browsers) -y2k_compliance = On - -; Output buffering allows you to send header lines (including cookies) even -; after you send body content, at the price of slowing PHP's output layer a -; bit. You can enable output buffering during runtime by calling the output -; buffering functions. You can also enable output buffering for all files by -; setting this directive to On. If you wish to limit the size of the buffer -; to a certain size - you can use a maximum number of bytes instead of 'On', as -; a value for this directive (e.g., output_buffering=4096). -output_buffering = Off - -; You can redirect all of the output of your scripts to a function. For -; example, if you set output_handler to "mb_output_handler", character -; encoding will be transparently converted to the specified encoding. -; Setting any output handler automatically turns on output buffering. -; Note: People who wrote portable scripts should not depend on this ini -; directive. Instead, explicitly set the output handler using ob_start(). -; Using this ini directive may cause problems unless you know what script -; is doing. -; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" -; and you cannot use both "ob_gzhandler" and "zlib.output_compression". -; Note: output_handler must be empty if this is set 'On' !!!! -; Instead you must use zlib.output_handler. -;output_handler = - -; Transparent output compression using the zlib library -; Valid values for this option are 'off', 'on', or a specific buffer size -; to be used for compression (default is 4KB) -; Note: Resulting chunk size may vary due to nature of compression. PHP -; outputs chunks that are few hundreds bytes each as a result of -; compression. If you prefer a larger chunk size for better -; performance, enable output_buffering in addition. -; Note: You need to use zlib.output_handler instead of the standard -; output_handler, or otherwise the output will be corrupted. -zlib.output_compression = Off - -; You cannot specify additional output handlers if zlib.output_compression -; is activated here. This setting does the same as output_handler but in -; a different order. -;zlib.output_handler = - -; Implicit flush tells PHP to tell the output layer to flush itself -; automatically after every output block. This is equivalent to calling the -; PHP function flush() after each and every call to print() or echo() and each -; and every HTML block. Turning this option on has serious performance -; implications and is generally recommended for debugging purposes only. -implicit_flush = Off - -; The unserialize callback function will be called (with the undefined class' -; name as parameter), if the unserializer finds an undefined class -; which should be instantiated. -; A warning appears if the specified function is not defined, or if the -; function doesn't include/implement the missing class. -; So only set this entry, if you really want to implement such a -; callback-function. -unserialize_callback_func= - -; When floats & doubles are serialized store serialize_precision significant -; digits after the floating point. The default value ensures that when floats -; are decoded with unserialize, the data will remain the same. -serialize_precision = 100 - -; Whether to enable the ability to force arguments to be passed by reference -; at function call time. This method is deprecated and is likely to be -; unsupported in future versions of PHP/Zend. The encouraged method of -; specifying which arguments should be passed by reference is in the function -; declaration. You're encouraged to try and turn this option Off and make -; sure your scripts work properly with it in order to ensure they will work -; with future versions of the language (you will receive a warning each time -; you use this feature, and the argument will be passed by value instead of by -; reference). -allow_call_time_pass_reference = On - -; -; Safe Mode -; -safe_mode = Off - -; By default, Safe Mode does a UID compare check when -; opening files. If you want to relax this to a GID compare, -; then turn on safe_mode_gid. -safe_mode_gid = Off - -; When safe_mode is on, UID/GID checks are bypassed when -; including files from this directory and its subdirectories. -; (directory must also be in include_path or full path must -; be used when including) -safe_mode_include_dir = - -; When safe_mode is on, only executables located in the safe_mode_exec_dir -; will be allowed to be executed via the exec family of functions. -safe_mode_exec_dir = - -; Setting certain environment variables may be a potential security breach. -; This directive contains a comma-delimited list of prefixes. In Safe Mode, -; the user may only alter environment variables whose names begin with the -; prefixes supplied here. By default, users will only be able to set -; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). -; -; Note: If this directive is empty, PHP will let the user modify ANY -; environment variable! -safe_mode_allowed_env_vars = PHP_ - -; This directive contains a comma-delimited list of environment variables that -; the end user won't be able to change using putenv(). These variables will be -; protected even if safe_mode_allowed_env_vars is set to allow to change them. -safe_mode_protected_env_vars = LD_LIBRARY_PATH - -; open_basedir, if set, limits all file operations to the defined directory -; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -;open_basedir = - -; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -disable_functions = - -; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -disable_classes = - -; Colors for Syntax Highlighting mode. Anything that's acceptable in -; would work. -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.bg = #FFFFFF -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long request, which may end up -; being interrupted by the user or a browser timing out. -; ignore_user_abort = On - -; -; Misc -; -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -expose_php = On - - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -max_execution_time = 30 ; Maximum execution time of each script, in seconds -max_input_time = 60 ; Maximum amount of time each script may spend parsing request data -memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; error_reporting is a bit-field. Or each number up to get desired error -; reporting level -; E_ALL - All errors and warnings (doesn't include E_STRICT) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it's automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; -; Examples: -; -; - Show all errors, except for notices and coding standards warnings -; -;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT -; -; - Show all errors, except for notices -; -;error_reporting = E_ALL & ~E_NOTICE -; -; - Show only errors -; -;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR -; -; - Show all errors except for notices and coding standards warnings -; -error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT - -; Print out errors (as a part of the output). For production web sites, -; you're strongly encouraged to turn this feature off, and use error logging -; instead (see below). Keeping display_errors enabled on a production web site -; may reveal security information to end users, such as file paths on your Web -; server, your database schema or other information. -display_errors = On - -; Even when display_errors is on, errors that occur during PHP's startup -; sequence are not displayed. It's strongly recommended to keep -; display_startup_errors off, except for when debugging. -display_startup_errors = Off - -; Log errors into a log file (server-specific log, stderr, or error_log (below)) -; As stated above, you're strongly advised to use error logging in place of -; error displaying on production web sites. -log_errors = Off - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line until ignore_repeated_source is set true. -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; sourcelines. -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -report_memleaks = On - -; Store the last error/warning message in $php_errormsg (boolean). -track_errors = Off - -; Disable the inclusion of HTML tags in error messages. -; Note: Never use this feature for production boxes. -;html_errors = Off - -; If html_errors is set On PHP produces clickable error messages that direct -; to a page describing the error or function causing the error in detail. -; You can download a copy of the PHP manual from http://www.php.net/docs.php -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. -; Note: Never use this feature for production boxes. -;docref_root = "/phpmanual/" -;docref_ext = .html - -; String to output before an error message. -;error_prepend_string = "" - -; String to output after an error message. -;error_append_string = "" - -; Log errors to specified file. -;error_log = filename - -; Log errors to syslog (Event Log on NT, not valid in Windows 95). -;error_log = syslog - - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; -; -; Note - track_vars is ALWAYS enabled as of PHP 4.0.3 - -; The separator used in PHP generated URLs to separate arguments. -; Default is "&". -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; Default is "&". -; NOTE: Every character in this directive is considered as separator! -;arg_separator.input = ";&" - -; This directive describes the order in which PHP registers GET, POST, Cookie, -; Environment and Built-in variables (G, P, C, E & S respectively, often -; referred to as EGPCS or GPC). Registration is done from left to right, newer -; values override older values. -variables_order = "EGPCS" - -; Whether or not to register the EGPCS variables as global variables. You may -; want to turn this off if you don't want to clutter your scripts' global scope -; with user data. This makes most sense when coupled with track_vars - in which -; case you can access all of the GPC variables through the $HTTP_*_VARS[], -; variables. -; -; You should do your best to write your scripts so that they do not require -; register_globals to be on; Using form variables as globals can easily lead -; to possible security problems, if the code is not very well thought of. -register_globals = Off - -; Whether or not to register the old-style input arrays, HTTP_GET_VARS -; and friends. If you're not using them, it's recommended to turn them off, -; for performance reasons. -register_long_arrays = On - -; This directive tells PHP whether to declare the argv&argc variables (that -; would contain the GET information). If you don't use these variables, you -; should turn it off for increased performance. -register_argc_argv = On - -; When enabled, the SERVER and ENV variables are created when they're first -; used (Just In Time) instead of when the script starts. If these variables -; are not used within a script, having this directive on will result in a -; performance gain. The PHP directives register_globals, register_long_arrays, -; and register_argc_argv must be disabled for this directive to have any affect. -auto_globals_jit = On - -; Maximum size of POST data that PHP will accept. -post_max_size = 8M - -; Magic quotes -; - -; Magic quotes for incoming GET/POST/Cookie data. -magic_quotes_gpc = On - -; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. -magic_quotes_runtime = Off - -; Use Sybase-style magic quotes (escape ' with '' instead of \'). -magic_quotes_sybase = Off - -; Automatically add files before or after any PHP document. -auto_prepend_file = -auto_append_file = - -; As of 4.0b4, PHP always outputs a character encoding by default in -; the Content-type: header. To disable sending of the charset, simply -; set it to be empty. -; -; PHP's built-in default is text/html -default_mimetype = "text/html" -;default_charset = "iso-8859-1" - -; Always populate the $HTTP_RAW_POST_DATA variable. -;always_populate_raw_post_data = On - -; Unicode settings -unicode_semantics = off -unicode.runtime_encoding = iso-8859-1 -unicode.script_encoding = utf-8 -unicode.output_encoding = utf-8 -unicode.from_error_mode = U_INVALID_SUBSTITUTE -unicode.from_error_subst_char = 3f - - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -user_dir = - -; Directory in which the loadable extensions (modules) reside. -extension_dir = "./" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -enable_dl = On - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. -; cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; cgi.redirect_status_env = ; - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; fastcgi.impersonate = 1; - -; Disable logging through FastCGI connection -; fastcgi.log = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If it's set 0 PHP sends Status: header that -; is supported by Apache. When this option is set to 1 PHP will send -; RFC2616 compliant header. -; Default is zero. -;cgi.rfc2616_headers = 0 - - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -upload_max_filesize = 2M - - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -allow_url_fopen = On - -; Define the anonymous ftp password (your email address) -;from="john@doe.com" - -; Define the User-Agent string -; user_agent="PHP" - -; Default timeout for socket based streams (seconds) -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; auto_detect_line_endings = Off - - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; -; -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; Note that it should be the name of the module only; no directory information -; needs to go here. Specify the location of the extension with the -; extension_dir directive above. - - -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) -; extension folders as well as the separate PECL DLL download (PHP 5). -; Be sure to appropriately set the extension_dir directive. - -;extension=php_mbstring.dll -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_dba.dll -;extension=php_dbase.dll -;extension=php_exif.dll -;extension=php_fdf.dll -;extension=php_filepro.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_ifx.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mcrypt.dll -;extension=php_mhash.dll -;extension=php_mime_magic.dll -;extension=php_ming.dll -;extension=php_mssql.dll -;extension=php_msql.dll -;extension=php_mysql.dll -;extension=php_oci8.dll -;extension=php_openssl.dll -;extension=php_oracle.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll -;extension=php_snmp.dll -;extension=php_sockets.dll -;extension=php_sqlite.dll -;extension=php_sybase_ct.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[Date] -; Defines the default timezone used by the date functions -;date.timezone = - -[Syslog] -; Whether or not to define the various syslog variables (e.g. $LOG_PID, -; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In -; runtime, you can define these variables by calling define_syslog_variables(). -define_syslog_variables = Off - -[mail function] -; For Win32 only. -SMTP = localhost -smtp_port = 25 - -; For Win32 only. -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. -;mail.force_extra_parameters = - -[SQL] -sql.safe_mode = Off - -[ODBC] -;odbc.default_db = Not yet implemented -;odbc.default_user = Not yet implemented -;odbc.default_pw = Not yet implemented - -; Allow or prevent persistent links. -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of uodbc.defaultlrl and uodbc.defaultbinmode -odbc.defaultbinmode = 1 - -[MySQL] -; Allow or prevent persistent links. -mysql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -mysql.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -mysql.max_links = -1 - -; Default port number for mysql_connect(). If unset, mysql_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -mysql.default_port = - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -mysql.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -mysql.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -mysql.default_user = - -; Default password for mysql_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -mysql.default_password = - -; Maximum time (in secondes) for connect timeout. -1 means no limit -mysql.connect_timeout = 60 - -; Trace mode. When trace_mode is active (=On), warnings for table/index scans and -; SQL-Errors will be displayed. -mysql.trace_mode = Off - -[MySQLi] - -; Maximum number of links. -1 means no limit. -mysqli.max_links = -1 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mSQL] -; Allow or prevent persistent links. -msql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -msql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -msql.max_links = -1 - -[PostgresSQL] -; Allow or prevent persistent links. -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Noitce message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -pgsql.log_notice = 0 - -[Sybase] -; Allow or prevent persistent links. -sybase.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -sybase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -sybase.max_links = -1 - -;sybase.interface_file = "/usr/sybase/interfaces" - -; Minimum error severity to display. -sybase.min_error_severity = 10 - -; Minimum message severity to display. -sybase.min_message_severity = 10 - -; Compatability mode with old versions of PHP 3.0. -; If on, this will cause PHP to automatically assign types to results according -; to their Sybase type, instead of treating them all as strings. This -; compatibility mode will probably not stay around forever, so try applying -; whatever necessary changes to your code, and turn it off. -sybase.compatability_mode = Off - -[Sybase-CT] -; Allow or prevent persistent links. -sybct.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -sybct.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -sybct.max_links = -1 - -; Minimum server message severity to display. -sybct.min_server_severity = 10 - -; Minimum client message severity to display. -sybct.min_client_severity = 10 - -[bcmath] -; Number of decimal digits for all bcmath functions. -bcmath.scale = 0 - -[browscap] -;browscap = extra/browscap.ini - -[Informix] -; Default host for ifx_connect() (doesn't apply in safe mode). -ifx.default_host = - -; Default user for ifx_connect() (doesn't apply in safe mode). -ifx.default_user = - -; Default password for ifx_connect() (doesn't apply in safe mode). -ifx.default_password = - -; Allow or prevent persistent links. -ifx.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -ifx.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ifx.max_links = -1 - -; If on, select statements return the contents of a text blob instead of its id. -ifx.textasvarchar = 0 - -; If on, select statements return the contents of a byte blob instead of its id. -ifx.byteasvarchar = 0 - -; Trailing blanks are stripped from fixed-length char columns. May help the -; life of Informix SE users. -ifx.charasvarchar = 0 - -; If on, the contents of text and byte blobs are dumped to a file instead of -; keeping them in memory. -ifx.blobinfile = 0 - -; NULL's are returned as empty strings, unless this is set to 1. In that case, -; NULL's are returned as string 'NULL'. -ifx.nullformat = 0 - -[Session] -; Handler used to store/retrieve data. -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; As of PHP 4.0.1, you can define the path as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if you -; or your OS have problems with lots of files in one directory, and is -; a more efficient layout for servers that handle lots of sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -;session.save_path = "/tmp" - -; Whether to use cookies. -session.use_cookies = 1 - -; This option enables administrators to make their users invulnerable to -; attacks which involve passing session ids in URLs; defaults to 0. -; session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -session.name = PHPSESSID - -; Initialize session on request startup. -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -session.cookie_path = / - -; The domain for which the cookie is valid. -session.cookie_domain = - -; Handler used to serialize data. php is the standard serializer of PHP. -session.serialize_handler = php - -; Define the probability that the 'garbage collection' process is started -; on every session initialization. -; The probability is calculated by using gc_probability/gc_divisor, -; e.g. 1/100 means there is a 1% chance that the GC process starts -; on each request. - -session.gc_probability = 1 -session.gc_divisor = 100 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; cd /path/to/sessions; find -cmin +24 | xargs rm - -; PHP 4.2 and less have an undocumented feature/bug that allows you to -; to initialize a session variable in the global scope, albeit register_globals -; is disabled. PHP 4.3 and later will warn you, if this feature is used. -; You can disable the feature and the warning separately. At this time, -; the warning is only displayed, if bug_compat_42 is enabled. - -session.bug_compat_42 = 1 -session.bug_compat_warn = 1 - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -session.referer_check = - -; How many bytes to read from the file. -session.entropy_length = 0 - -; Specified here to create the session id. -session.entropy_file = - -;session.entropy_length = 16 - -;session.entropy_file = /dev/urandom - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -session.cache_limiter = nocache - -; Document expires after n minutes. -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publically accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -session.use_trans_sid = 0 - -; Select a hash function -; 0: MD5 (128 bits) -; 1: SHA-1 (160 bits) -session.hash_function = 0 - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; -; 4 bits: 0-9, a-f -; 5 bits: 0-9, a-v -; 6 bits: 0-9, a-z, A-Z, "-", "," -session.hash_bits_per_character = 4 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -; form/fieldset are special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. If you want XHTML conformity, remove the form entry. -; Note that all valid entries require a "=", even if no value follows. -url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" - -[MSSQL] -; Allow or prevent persistent links. -mssql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -mssql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -mssql.max_links = -1 - -; Minimum error severity to display. -mssql.min_error_severity = 10 - -; Minimum message severity to display. -mssql.min_message_severity = 10 - -; Compatability mode with old versions of PHP 3.0. -mssql.compatability_mode = Off - -; Connect timeout -;mssql.connect_timeout = 5 - -; Query timeout -;mssql.timeout = 60 - -; Valid range 0 - 2147483647. Default = 4096. -;mssql.textlimit = 4096 - -; Valid range 0 - 2147483647. Default = 4096. -;mssql.textsize = 4096 - -; Limits the number of records in each batch. 0 = all records in one batch. -;mssql.batchsize = 0 - -; Specify how datetime and datetim4 columns are returned -; On => Returns data converted to SQL server settings -; Off => Returns values as YYYY-MM-DD hh:mm:ss -;mssql.datetimeconvert = On - -; Use NT authentication when connecting to the server -mssql.secure_connection = Off - -; Specify max number of processes. Default = 25 -;mssql.max_procs = 25 - -[Assertion] -; Assert(expr); active by default. -;assert.active = On - -; Issue a PHP warning for each failed assertion. -;assert.warning = On - -; Don't bail out by default. -;assert.bail = Off - -; User-function to be called if an assertion fails. -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -;assert.quiet_eval = 0 - -[Verisign Payflow Pro] -; Default Payflow Pro server. -pfpro.defaulthost = "test-payflow.verisign.com" - -; Default port to connect to. -pfpro.defaultport = 443 - -; Default timeout in seconds. -pfpro.defaulttimeout = 30 - -; Default proxy IP address (if required). -;pfpro.proxyaddress = - -; Default proxy port. -;pfpro.proxyport = - -; Default proxy logon. -;pfpro.proxylogon = - -; Default proxy password. -;pfpro.proxypassword = - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -;com.typelib_file = -; allow Distributed-COM calls -;com.allow_dcom = true -; autoregister constants of a components typlib on com_load() -;com.autoregister_typelib = true -; register constants casesensitive -;com.autoregister_casesensitive = false -; show warnings on duplicate constat registrations -;com.autoregister_verbose = true - -[mbstring] -; language for internal character representation. -;mbstring.language = Japanese - -; internal/script encoding. -; Some encoding cannot work as internal encoding. -; (e.g. SJIS, BIG5, ISO-2022-*) -;mbstring.internal_encoding = EUC-JP - -; http input encoding. -;mbstring.http_input = auto - -; http output encoding. mb_output_handler must be -; registered as output buffer to function -;mbstring.http_output = SJIS - -; enable automatic encoding translation according to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; auto means -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -;mbstring.substitute_character = none; - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -;mbstring.func_overload = 0 - -[FrontBase] -;fbsql.allow_persistent = On -;fbsql.autocommit = On -;fbsql.default_database = -;fbsql.default_database_password = -;fbsql.default_host = -;fbsql.default_password = -;fbsql.default_user = "_SYSTEM" -;fbsql.generate_warnings = Off -;fbsql.max_connections = 128 -;fbsql.max_links = 128 -;fbsql.max_persistent = -1 -;fbsql.max_results = 128 -;fbsql.batchSize = 1000 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -;exif.encode_unicode = ISO-8859-15 -;exif.decode_unicode_motorola = UCS-2BE -;exif.decode_unicode_intel = UCS-2LE -;exif.encode_jis = -;exif.decode_jis_motorola = JIS -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -soap.wsdl_cache_enabled=1 -; Sets the directory name where SOAP extension will put cache files. -soap.wsdl_cache_dir="/tmp" -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -soap.wsdl_cache_ttl=86400 - -; Local Variables: -; tab-width: 4 -; End: diff --git a/php.ini-recommended b/php.ini-recommended deleted file mode 100644 index fcadb23c2c38d..0000000000000 --- a/php.ini-recommended +++ /dev/null @@ -1,1242 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; This file controls many aspects of PHP's behavior. In order for PHP to -; read it, it must be named 'php.ini'. PHP looks for it in the current -; working directory, in the path designated by the environment variable -; PHPRC, and in the path that was defined in compile time (in that order). -; Under Windows, the compile-time path is the Windows directory. The -; path in which the php.ini file is looked for can be overridden using -; the -c argument in command line mode. -; -; The syntax of the file is extremely simple. Whitespace and Lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. -; -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo"). -; -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT -; -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. -; -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: -; -; foo = ; sets foo to an empty string -; foo = none ; sets foo to an empty string -; foo = "none" ; sets foo to the string 'none' -; -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. -; -; -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; This is the recommended, PHP 5-style version of the php.ini-dist file. It -; sets some non standard settings, that make PHP more efficient, more secure, -; and encourage cleaner coding. -; -; The price is that with these settings, PHP may be incompatible with some -; applications, and sometimes, more difficult to develop with. Using this -; file is warmly recommended for production sites. As all of the changes from -; the standard settings are thoroughly documented, you can go over each one, -; and decide whether you want to use it or not. -; -; For general information about the php.ini file, please consult the php.ini-dist -; file, included in your PHP distribution. -; -; This file is different from the php.ini-dist file in the fact that it features -; different values for several directives, in order to improve performance, while -; possibly breaking compatibility with the standard out-of-the-box behavior of -; PHP. Please make sure you read what's different, and modify your scripts -; accordingly, if you decide to use this file instead. -; -; - register_globals = Off [Security, Performance] -; Global variables are no longer registered for input data (POST, GET, cookies, -; environment and other server variables). Instead of using $foo, you must use -; you can use $_REQUEST["foo"] (includes any variable that arrives through the -; request, namely, POST, GET and cookie variables), or use one of the specific -; $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending -; on where the input originates. Also, you can look at the -; import_request_variables() function. -; Note that register_globals is going to be depracated (i.e., turned off by -; default) in the next version of PHP, because it often leads to security bugs. -; Read http://php.net/manual/en/security.registerglobals.php for further -; information. -; - register_long_arrays = Off [Performance] -; Disables registration of the older (and deprecated) long predefined array -; variables ($HTTP_*_VARS). Instead, use the superglobals that were -; introduced in PHP 4.1.0 -; - display_errors = Off [Security] -; With this directive set to off, errors that occur during the execution of -; scripts will no longer be displayed as a part of the script output, and thus, -; will no longer be exposed to remote users. With some errors, the error message -; content may expose information about your script, web server, or database -; server that may be exploitable for hacking. Production sites should have this -; directive set to off. -; - log_errors = On [Security] -; This directive complements the above one. Any errors that occur during the -; execution of your script will be logged (typically, to your server's error log, -; but can be configured in several ways). Along with setting display_errors to off, -; this setup gives you the ability to fully understand what may have gone wrong, -; without exposing any sensitive information to remote users. -; - output_buffering = 4096 [Performance] -; Set a 4KB output buffer. Enabling output buffering typically results in less -; writes, and sometimes less packets sent on the wire, which can often lead to -; better performance. The gain this directive actually yields greatly depends -; on which Web server you're working with, and what kind of scripts you're using. -; - register_argc_argv = Off [Performance] -; Disables registration of the somewhat redundant $argv and $argc global -; variables. -; - magic_quotes_gpc = Off [Performance] -; Input data is no longer escaped with slashes so that it can be sent into -; SQL databases without further manipulation. Instead, you should use the -; function addslashes() on each input element you wish to send to a database. -; - variables_order = "GPCS" [Performance] -; The environment variables are not hashed into the $_ENV. To access -; environment variables, you can use getenv() instead. -; - error_reporting = E_ALL [Code Cleanliness, Security(?)] -; By default, PHP surpresses errors of type E_NOTICE. These error messages -; are emitted for non-critical errors, but that could be a symptom of a bigger -; problem. Most notably, this will cause error messages about the use -; of uninitialized variables to be displayed. -; - allow_call_time_pass_reference = Off [Code cleanliness] -; It's not possible to decide to force a variable to be passed by reference -; when calling a function. The PHP 4 style to do this is by making the -; function require the relevant argument by reference. - - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -engine = On - -; Enable compatibility mode with Zend Engine 1 (PHP 4.x) -zend.ze1_compatibility_mode = Off - -; Allow the tags are recognized. -; NOTE: Using short tags should be avoided when developing applications or -; libraries that are meant for redistribution, or deployment on PHP -; servers which are not under your control, because short tags may not -; be supported on the target server. For portable, redistributable code, -; be sure not to use short tags. -short_open_tag = Off - -; Allow ASP-style <% %> tags. -asp_tags = Off - -; The number of significant digits displayed in floating point numbers. -precision = 14 - -; Enforce year 2000 compliance (will cause problems with non-compliant browsers) -y2k_compliance = On - -; Output buffering allows you to send header lines (including cookies) even -; after you send body content, at the price of slowing PHP's output layer a -; bit. You can enable output buffering during runtime by calling the output -; buffering functions. You can also enable output buffering for all files by -; setting this directive to On. If you wish to limit the size of the buffer -; to a certain size - you can use a maximum number of bytes instead of 'On', as -; a value for this directive (e.g., output_buffering=4096). -output_buffering = 4096 - -; You can redirect all of the output of your scripts to a function. For -; example, if you set output_handler to "mb_output_handler", character -; encoding will be transparently converted to the specified encoding. -; Setting any output handler automatically turns on output buffering. -; Note: People who wrote portable scripts should not depend on this ini -; directive. Instead, explicitly set the output handler using ob_start(). -; Using this ini directive may cause problems unless you know what script -; is doing. -; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" -; and you cannot use both "ob_gzhandler" and "zlib.output_compression". -; Note: output_handler must be empty if this is set 'On' !!!! -; Instead you must use zlib.output_handler. -;output_handler = - -; Transparent output compression using the zlib library -; Valid values for this option are 'off', 'on', or a specific buffer size -; to be used for compression (default is 4KB) -; Note: Resulting chunk size may vary due to nature of compression. PHP -; outputs chunks that are few hundreds bytes each as a result of -; compression. If you prefer a larger chunk size for better -; performance, enable output_buffering in addition. -; Note: You need to use zlib.output_handler instead of the standard -; output_handler, or otherwise the output will be corrupted. -zlib.output_compression = Off - -; You cannot specify additional output handlers if zlib.output_compression -; is activated here. This setting does the same as output_handler but in -; a different order. -;zlib.output_handler = - -; Implicit flush tells PHP to tell the output layer to flush itself -; automatically after every output block. This is equivalent to calling the -; PHP function flush() after each and every call to print() or echo() and each -; and every HTML block. Turning this option on has serious performance -; implications and is generally recommended for debugging purposes only. -implicit_flush = Off - -; The unserialize callback function will be called (with the undefined class' -; name as parameter), if the unserializer finds an undefined class -; which should be instanciated. -; A warning appears if the specified function is not defined, or if the -; function doesn't include/implement the missing class. -; So only set this entry, if you really want to implement such a -; callback-function. -unserialize_callback_func= - -; When floats & doubles are serialized store serialize_precision significant -; digits after the floating point. The default value ensures that when floats -; are decoded with unserialize, the data will remain the same. -serialize_precision = 100 - -; Whether to enable the ability to force arguments to be passed by reference -; at function call time. This method is deprecated and is likely to be -; unsupported in future versions of PHP/Zend. The encouraged method of -; specifying which arguments should be passed by reference is in the function -; declaration. You're encouraged to try and turn this option Off and make -; sure your scripts work properly with it in order to ensure they will work -; with future versions of the language (you will receive a warning each time -; you use this feature, and the argument will be passed by value instead of by -; reference). -allow_call_time_pass_reference = Off - -; -; Safe Mode -; -safe_mode = Off - -; By default, Safe Mode does a UID compare check when -; opening files. If you want to relax this to a GID compare, -; then turn on safe_mode_gid. -safe_mode_gid = Off - -; When safe_mode is on, UID/GID checks are bypassed when -; including files from this directory and its subdirectories. -; (directory must also be in include_path or full path must -; be used when including) -safe_mode_include_dir = - -; When safe_mode is on, only executables located in the safe_mode_exec_dir -; will be allowed to be executed via the exec family of functions. -safe_mode_exec_dir = - -; Setting certain environment variables may be a potential security breach. -; This directive contains a comma-delimited list of prefixes. In Safe Mode, -; the user may only alter environment variables whose names begin with the -; prefixes supplied here. By default, users will only be able to set -; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). -; -; Note: If this directive is empty, PHP will let the user modify ANY -; environment variable! -safe_mode_allowed_env_vars = PHP_ - -; This directive contains a comma-delimited list of environment variables that -; the end user won't be able to change using putenv(). These variables will be -; protected even if safe_mode_allowed_env_vars is set to allow to change them. -safe_mode_protected_env_vars = LD_LIBRARY_PATH - -; open_basedir, if set, limits all file operations to the defined directory -; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -;open_basedir = - -; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -disable_functions = - -; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. -disable_classes = - -; Colors for Syntax Highlighting mode. Anything that's acceptable in -; would work. -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.bg = #FFFFFF -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long request, which may end up -; being interrupted by the user or a browser timing out. -; ignore_user_abort = On - -; -; Misc -; -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -expose_php = On - - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -max_execution_time = 30 ; Maximum execution time of each script, in seconds -max_input_time = 60 ; Maximum amount of time each script may spend parsing request data -memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; error_reporting is a bit-field. Or each number up to get desired error -; reporting level -; E_ALL - All errors and warnings (doesn't include E_STRICT) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it's automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; -; Examples: -; -; - Show all errors, except for notices and coding standards warnings -; -;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT -; -; - Show all errors, except for notices -; -;error_reporting = E_ALL & ~E_NOTICE -; -; - Show only errors -; -;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR -; -; - Show all errors, except coding standards warnings -; -error_reporting = E_ALL - -; Print out errors (as a part of the output). For production web sites, -; you're strongly encouraged to turn this feature off, and use error logging -; instead (see below). Keeping display_errors enabled on a production web site -; may reveal security information to end users, such as file paths on your Web -; server, your database schema or other information. -display_errors = Off - -; Even when display_errors is on, errors that occur during PHP's startup -; sequence are not displayed. It's strongly recommended to keep -; display_startup_errors off, except for when debugging. -display_startup_errors = Off - -; Log errors into a log file (server-specific log, stderr, or error_log (below)) -; As stated above, you're strongly advised to use error logging in place of -; error displaying on production web sites. -log_errors = On - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line until ignore_repeated_source is set true. -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; sourcelines. -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -report_memleaks = On - -; Store the last error/warning message in $php_errormsg (boolean). -track_errors = Off - -; Disable the inclusion of HTML tags in error messages. -; Note: Never use this feature for production boxes. -;html_errors = Off - -; If html_errors is set On PHP produces clickable error messages that direct -; to a page describing the error or function causing the error in detail. -; You can download a copy of the PHP manual from http://www.php.net/docs.php -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. -; Note: Never use this feature for production boxes. -;docref_root = "/phpmanual/" -;docref_ext = .html - -; String to output before an error message. -;error_prepend_string = "" - -; String to output after an error message. -;error_append_string = "" - -; Log errors to specified file. -;error_log = filename - -; Log errors to syslog (Event Log on NT, not valid in Windows 95). -;error_log = syslog - - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; -; -; Note - track_vars is ALWAYS enabled as of PHP 4.0.3 - -; The separator used in PHP generated URLs to separate arguments. -; Default is "&". -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; Default is "&". -; NOTE: Every character in this directive is considered as separator! -;arg_separator.input = ";&" - -; This directive describes the order in which PHP registers GET, POST, Cookie, -; Environment and Built-in variables (G, P, C, E & S respectively, often -; referred to as EGPCS or GPC). Registration is done from left to right, newer -; values override older values. -variables_order = "GPCS" - -; Whether or not to register the EGPCS variables as global variables. You may -; want to turn this off if you don't want to clutter your scripts' global scope -; with user data. This makes most sense when coupled with track_vars - in which -; case you can access all of the GPC variables through the $HTTP_*_VARS[], -; variables. -; -; You should do your best to write your scripts so that they do not require -; register_globals to be on; Using form variables as globals can easily lead -; to possible security problems, if the code is not very well thought of. -register_globals = Off - -; Whether or not to register the old-style input arrays, HTTP_GET_VARS -; and friends. If you're not using them, it's recommended to turn them off, -; for performance reasons. -register_long_arrays = Off - -; This directive tells PHP whether to declare the argv&argc variables (that -; would contain the GET information). If you don't use these variables, you -; should turn it off for increased performance. -register_argc_argv = Off - -; When enabled, the SERVER and ENV variables are created when they're first -; used (Just In Time) instead of when the script starts. If these variables -; are not used within a script, having this directive on will result in a -; performance gain. The PHP directives register_globals, register_long_arrays, -; and register_argc_argv must be disabled for this directive to have any affect. -auto_globals_jit = On - -; Maximum size of POST data that PHP will accept. -post_max_size = 8M - -; Magic quotes -; - -; Magic quotes for incoming GET/POST/Cookie data. -magic_quotes_gpc = Off - -; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. -magic_quotes_runtime = Off - -; Use Sybase-style magic quotes (escape ' with '' instead of \'). -magic_quotes_sybase = Off - -; Automatically add files before or after any PHP document. -auto_prepend_file = -auto_append_file = - -; As of 4.0b4, PHP always outputs a character encoding by default in -; the Content-type: header. To disable sending of the charset, simply -; set it to be empty. -; -; PHP's built-in default is text/html -default_mimetype = "text/html" -;default_charset = "iso-8859-1" - -; Always populate the $HTTP_RAW_POST_DATA variable. -;always_populate_raw_post_data = On - -; Unicode settings -unicode_semantics = off -unicode.runtime_encoding = iso-8859-1 -unicode.script_encoding = utf-8 -unicode.output_encoding = utf-8 -unicode.from_error_mode = U_INVALID_SUBSTITUTE -unicode.from_error_subst_char = 3f - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -user_dir = - -; Directory in which the loadable extensions (modules) reside. -extension_dir = "./" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -enable_dl = On - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. -; cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; cgi.redirect_status_env = ; - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; fastcgi.impersonate = 1; - -; Disable logging through FastCGI connection -; fastcgi.log = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If it's set 0 PHP sends Status: header that -; is supported by Apache. When this option is set to 1 PHP will send -; RFC2616 compliant header. -; Default is zero. -;cgi.rfc2616_headers = 0 - - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -upload_max_filesize = 2M - - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -allow_url_fopen = On - -; Define the anonymous ftp password (your email address) -;from="john@doe.com" - -; Define the User-Agent string -; user_agent="PHP" - -; Default timeout for socket based streams (seconds) -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; auto_detect_line_endings = Off - - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; -; -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; Note that it should be the name of the module only; no directory information -; needs to go here. Specify the location of the extension with the -; extension_dir directive above. - - -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) -; extension folders as well as the separate PECL DLL download (PHP 5). -; Be sure to appropriately set the extension_dir directive. - -;extension=php_mbstring.dll -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_dba.dll -;extension=php_dbase.dll -;extension=php_exif.dll -;extension=php_fdf.dll -;extension=php_filepro.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_ifx.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mcrypt.dll -;extension=php_mhash.dll -;extension=php_mime_magic.dll -;extension=php_ming.dll -;extension=php_mssql.dll -;extension=php_msql.dll -;extension=php_mysql.dll -;extension=php_oci8.dll -;extension=php_openssl.dll -;extension=php_oracle.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll -;extension=php_snmp.dll -;extension=php_sockets.dll -;extension=php_sqlite.dll -;extension=php_sybase_ct.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[Date] -; Defines the default timezone used by the date functions -;date.timezone = - -[Syslog] -; Whether or not to define the various syslog variables (e.g. $LOG_PID, -; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In -; runtime, you can define these variables by calling define_syslog_variables(). -define_syslog_variables = Off - -[mail function] -; For Win32 only. -SMTP = localhost -smtp_port = 25 - -; For Win32 only. -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. -;mail.force_extra_parameters = - -[SQL] -sql.safe_mode = Off - -[ODBC] -;odbc.default_db = Not yet implemented -;odbc.default_user = Not yet implemented -;odbc.default_pw = Not yet implemented - -; Allow or prevent persistent links. -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of uodbc.defaultlrl and uodbc.defaultbinmode -odbc.defaultbinmode = 1 - -[MySQL] -; Allow or prevent persistent links. -mysql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -mysql.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -mysql.max_links = -1 - -; Default port number for mysql_connect(). If unset, mysql_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -mysql.default_port = - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -mysql.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -mysql.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -mysql.default_user = - -; Default password for mysql_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -mysql.default_password = - -; Maximum time (in secondes) for connect timeout. -1 means no limit -mysql.connect_timeout = 60 - -; Trace mode. When trace_mode is active (=On), warnings for table/index scans and -; SQL-Errors will be displayed. -mysql.trace_mode = Off - -[MySQLi] - -; Maximum number of links. -1 means no limit. -mysqli.max_links = -1 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mSQL] -; Allow or prevent persistent links. -msql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -msql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -msql.max_links = -1 - -[PostgresSQL] -; Allow or prevent persistent links. -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Noitce message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -pgsql.log_notice = 0 - -[Sybase] -; Allow or prevent persistent links. -sybase.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -sybase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -sybase.max_links = -1 - -;sybase.interface_file = "/usr/sybase/interfaces" - -; Minimum error severity to display. -sybase.min_error_severity = 10 - -; Minimum message severity to display. -sybase.min_message_severity = 10 - -; Compatability mode with old versions of PHP 3.0. -; If on, this will cause PHP to automatically assign types to results according -; to their Sybase type, instead of treating them all as strings. This -; compatability mode will probably not stay around forever, so try applying -; whatever necessary changes to your code, and turn it off. -sybase.compatability_mode = Off - -[Sybase-CT] -; Allow or prevent persistent links. -sybct.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -sybct.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -sybct.max_links = -1 - -; Minimum server message severity to display. -sybct.min_server_severity = 10 - -; Minimum client message severity to display. -sybct.min_client_severity = 10 - -[bcmath] -; Number of decimal digits for all bcmath functions. -bcmath.scale = 0 - -[browscap] -;browscap = extra/browscap.ini - -[Informix] -; Default host for ifx_connect() (doesn't apply in safe mode). -ifx.default_host = - -; Default user for ifx_connect() (doesn't apply in safe mode). -ifx.default_user = - -; Default password for ifx_connect() (doesn't apply in safe mode). -ifx.default_password = - -; Allow or prevent persistent links. -ifx.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -ifx.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ifx.max_links = -1 - -; If on, select statements return the contents of a text blob instead of its id. -ifx.textasvarchar = 0 - -; If on, select statements return the contents of a byte blob instead of its id. -ifx.byteasvarchar = 0 - -; Trailing blanks are stripped from fixed-length char columns. May help the -; life of Informix SE users. -ifx.charasvarchar = 0 - -; If on, the contents of text and byte blobs are dumped to a file instead of -; keeping them in memory. -ifx.blobinfile = 0 - -; NULL's are returned as empty strings, unless this is set to 1. In that case, -; NULL's are returned as string 'NULL'. -ifx.nullformat = 0 - -[Session] -; Handler used to store/retrieve data. -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; As of PHP 4.0.1, you can define the path as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if you -; or your OS have problems with lots of files in one directory, and is -; a more efficient layout for servers that handle lots of sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -;session.save_path = "/tmp" - -; Whether to use cookies. -session.use_cookies = 1 - -; This option enables administrators to make their users invulnerable to -; attacks which involve passing session ids in URLs; defaults to 0. -; session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -session.name = PHPSESSID - -; Initialize session on request startup. -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -session.cookie_path = / - -; The domain for which the cookie is valid. -session.cookie_domain = - -; Handler used to serialize data. php is the standard serializer of PHP. -session.serialize_handler = php - -; Define the probability that the 'garbage collection' process is started -; on every session initialization. -; The probability is calculated by using gc_probability/gc_divisor, -; e.g. 1/100 means there is a 1% chance that the GC process starts -; on each request. - -session.gc_probability = 1 -session.gc_divisor = 1000 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; cd /path/to/sessions; find -cmin +24 | xargs rm - -; PHP 4.2 and less have an undocumented feature/bug that allows you to -; to initialize a session variable in the global scope, albeit register_globals -; is disabled. PHP 4.3 and later will warn you, if this feature is used. -; You can disable the feature and the warning separately. At this time, -; the warning is only displayed, if bug_compat_42 is enabled. - -session.bug_compat_42 = 0 -session.bug_compat_warn = 1 - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -session.referer_check = - -; How many bytes to read from the file. -session.entropy_length = 0 - -; Specified here to create the session id. -session.entropy_file = - -;session.entropy_length = 16 - -;session.entropy_file = /dev/urandom - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -session.cache_limiter = nocache - -; Document expires after n minutes. -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publically accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -session.use_trans_sid = 0 - -; Select a hash function -; 0: MD5 (128 bits) -; 1: SHA-1 (160 bits) -session.hash_function = 0 - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; -; 4 bits: 0-9, a-f -; 5 bits: 0-9, a-v -; 6 bits: 0-9, a-z, A-Z, "-", "," -session.hash_bits_per_character = 5 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -; form/fieldset are special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. If you want XHTML conformity, remove the form entry. -; Note that all valid entries require a "=", even if no value follows. -url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" - -[MSSQL] -; Allow or prevent persistent links. -mssql.allow_persistent = On - -; Maximum number of persistent links. -1 means no limit. -mssql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -mssql.max_links = -1 - -; Minimum error severity to display. -mssql.min_error_severity = 10 - -; Minimum message severity to display. -mssql.min_message_severity = 10 - -; Compatability mode with old versions of PHP 3.0. -mssql.compatability_mode = Off - -; Connect timeout -;mssql.connect_timeout = 5 - -; Query timeout -;mssql.timeout = 60 - -; Valid range 0 - 2147483647. Default = 4096. -;mssql.textlimit = 4096 - -; Valid range 0 - 2147483647. Default = 4096. -;mssql.textsize = 4096 - -; Limits the number of records in each batch. 0 = all records in one batch. -;mssql.batchsize = 0 - -; Specify how datetime and datetim4 columns are returned -; On => Returns data converted to SQL server settings -; Off => Returns values as YYYY-MM-DD hh:mm:ss -;mssql.datetimeconvert = On - -; Use NT authentication when connecting to the server -mssql.secure_connection = Off - -; Specify max number of processes. Default = 25 -;mssql.max_procs = 25 - -[Assertion] -; Assert(expr); active by default. -;assert.active = On - -; Issue a PHP warning for each failed assertion. -;assert.warning = On - -; Don't bail out by default. -;assert.bail = Off - -; User-function to be called if an assertion fails. -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -;assert.quiet_eval = 0 - -[Verisign Payflow Pro] -; Default Payflow Pro server. -Apfpro.defaulthost = "test-payflow.verisign.com" - -; Default port to connect to. -pfpro.defaultport = 443 - -; Default timeout in seconds. -pfpro.defaulttimeout = 30 - -; Default proxy IP address (if required). -;pfpro.proxyaddress = - -; Default proxy port. -;pfpro.proxyport = - -; Default proxy logon. -;pfpro.proxylogon = - -; Default proxy password. -;pfpro.proxypassword = - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -;com.typelib_file = -; allow Distributed-COM calls -;com.allow_dcom = true -; autoregister constants of a components typlib on com_load() -;com.autoregister_typelib = true -; register constants casesensitive -;com.autoregister_casesensitive = false -; show warnings on duplicate constat registrations -;com.autoregister_verbose = true - -[mbstring] -; language for internal character representation. -;mbstring.language = Japanese - -; internal/script encoding. -; Some encoding cannot work as internal encoding. -; (e.g. SJIS, BIG5, ISO-2022-*) -;mbstring.internal_encoding = EUC-JP - -; http input encoding. -;mbstring.http_input = auto - -; http output encoding. mb_output_handler must be -; registered as output buffer to function -;mbstring.http_output = SJIS - -; enable automatic encoding translation accoding to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; auto means -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -;mbstring.substitute_character = none; - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -;mbstring.func_overload = 0 - -[FrontBase] -;fbsql.allow_persistent = On -;fbsql.autocommit = On -;fbsql.default_database = -;fbsql.default_database_password = -;fbsql.default_host = -;fbsql.default_password = -;fbsql.default_user = "_SYSTEM" -;fbsql.generate_warnings = Off -;fbsql.max_connections = 128 -;fbsql.max_links = 128 -;fbsql.max_persistent = -1 -;fbsql.max_results = 128 -;fbsql.batchSize = 1000 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -;exif.encode_unicode = ISO-8859-15 -;exif.decode_unicode_motorola = UCS-2BE -;exif.decode_unicode_intel = UCS-2LE -;exif.encode_jis = -;exif.decode_jis_motorola = JIS -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -soap.wsdl_cache_enabled=1 -; Sets the directory name where SOAP extension will put cache files. -soap.wsdl_cache_dir="/tmp" -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -soap.wsdl_cache_ttl=86400 - -; Local Variables: -; tab-width: 4 -; End: diff --git a/php5.spec.in b/php5.spec.in deleted file mode 100644 index 97a84b5fb2268..0000000000000 --- a/php5.spec.in +++ /dev/null @@ -1,48 +0,0 @@ -%define version @VERSION@ -%define so_version 5 -%define release 0 - -Name: php -Summary: PHP: Hypertext Preprocessor -Group: Development/Languages -Version: %{version} -Release: %{release} -Copyright: The PHP license (see "LICENSE" file included in distribution) -Source: http://www.php.net/get/php-%{version}.tar.gz/from/a/mirror -Icon: php.gif -URL: http://www.php.net/ -Packager: PHP Group - -BuildRoot: /var/tmp/php-%{version} - -%description -PHP is an HTML-embedded scripting language. Much of its syntax is -borrowed from C, Java and Perl with a couple of unique PHP-specific -features thrown in. The goal of the language is to allow web -developers to write dynamically generated pages quickly. - -%prep - -%setup - -%build -set -x -./buildconf -./configure --prefix=/usr --with-apxs \ - --disable-debug \ - --with-xml=shared \ - -# figure out configure options options based on what packages are installed -# to override, use the OVERRIDE_OPTIONS environment variable. To add -# extra options, use the OPTIONS environment variable. - -#test rpm -q MySQL-devel >&/dev/null && OPTIONS="$OPTIONS --with-mysql=shared" -#test rpm -q solid-devel >&/dev/null && OPTIONS="$OPTIONS --with-solid=shared,/home/solid" -#test rpm -q postgresql-devel >&/dev/null && OPTIONS="$OPTIONS --with-pgsql=shared" -test rpm -q expat >&/dev/null && OPTIONS="$OPTIONS --with-xml=shared" - -if test "x$OVERRIDE_OPTIONS" = "x"; then - ./configure --prefix=/usr --with-apxs=$APXS $OPTIONS -else - ./configure $OVERRIDE_OPTIONS -fi diff --git a/regex/COPYRIGHT b/regex/COPYRIGHT deleted file mode 100644 index d43362fbfc9a7..0000000000000 --- a/regex/COPYRIGHT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. diff --git a/regex/README b/regex/README deleted file mode 100644 index cea9b67b6665d..0000000000000 --- a/regex/README +++ /dev/null @@ -1,32 +0,0 @@ -alpha3.4 release. -Thu Mar 17 23:17:18 EST 1994 -henry@zoo.toronto.edu - -See WHATSNEW for change listing. - -installation notes: --------- -Read the comments at the beginning of Makefile before running. - -Utils.h contains some things that just might have to be modified on -some systems, as well as a nested include (ugh) of . - -The "fake" directory contains quick-and-dirty fakes for some header -files and routines that old systems may not have. Note also that --DUSEBCOPY will make utils.h substitute bcopy() for memmove(). - -After that, "make r" will build regcomp.o, regexec.o, regfree.o, -and regerror.o (the actual routines), bundle them together into a test -program, and run regression tests on them. No output is good output. - -"make lib" builds just the .o files for the actual routines (when -you're happy with testing and have adjusted CFLAGS for production), -and puts them together into libregex.a. You can pick up either the -library or *.o ("make lib" makes sure there are no other .o files left -around to confuse things). - -Main.c, debug.c, split.c are used for regression testing but are not part -of the RE routines themselves. - -Regex.h goes in /usr/include. All other .h files are internal only. --------- diff --git a/regex/WHATSNEW b/regex/WHATSNEW deleted file mode 100644 index 6e82e1dae0cd2..0000000000000 --- a/regex/WHATSNEW +++ /dev/null @@ -1,92 +0,0 @@ -New in alpha3.4: The complex bug alluded to below has been fixed (in a -slightly kludgey temporary way that may hurt efficiency a bit; this is -another "get it out the door for 4.4" release). The tests at the end of -the tests file have accordingly been uncommented. The primary sign of -the bug was that something like a?b matching ab matched b rather than ab. -(The bug was essentially specific to this exact situation, else it would -have shown up earlier.) - -New in alpha3.3: The definition of word boundaries has been altered -slightly, to more closely match the usual programming notion that "_" -is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir, -and the makefile no longer alludes to it in mysterious ways. The -makefile has generally been cleaned up some. Fixes have been made -(again!) so that the regression test will run without -DREDEBUG, at -the cost of weaker checking. A workaround for a bug in some folks' - has been added. And some more things have been added to -tests, including a couple right at the end which are commented out -because the code currently flunks them (complex bug; fix coming). -Plus the usual minor cleanup. - -New in alpha3.2: Assorted bits of cleanup and portability improvement -(the development base is now a BSDI system using GCC instead of an ancient -Sun system, and the newer compiler exposed some glitches). Fix for a -serious bug that affected REs using many [] (including REG_ICASE REs -because of the way they are implemented), *sometimes*, depending on -memory-allocation patterns. The header-file prototypes no longer name -the parameters, avoiding possible name conflicts. The possibility that -some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is -now handled gracefully. "uchar" is no longer used as an internal type -name (too many people have the same idea). Still the same old lousy -performance, alas. - -New in alpha3.1: Basically nothing, this release is just a bookkeeping -convenience. Stay tuned. - -New in alpha3.0: Performance is no better, alas, but some fixes have been -made and some functionality has been added. (This is basically the "get -it out the door in time for 4.4" release.) One bug fix: regfree() didn't -free the main internal structure (how embarrassing). It is now possible -to put NULs in either the RE or the target string, using (resp.) a new -REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to -regcomp() makes all characters ordinary, so you can match a literal -string easily (this will become more useful when performance improves!). -There are now primitives to match beginnings and ends of words, although -the syntax is disgusting and so is the implementation. The REG_ATOI -debugging interface has changed a bit. And there has been considerable -internal cleanup of various kinds. - -New in alpha2.3: Split change list out of README, and moved flags notes -into Makefile. Macro-ized the name of regex(7) in regex(3), since it has -to change for 4.4BSD. Cleanup work in engine.c, and some new regression -tests to catch tricky cases thereof. - -New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two -small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges -in my own test program and might be useful to others for similar purposes. -The regression test will now compile (and run) without REDEBUG. The -BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now. -Char/uchar parameters are now written int/unsigned, to avoid possible -portability problems with unpromoted parameters. Some unsigned casts have -been introduced to minimize portability problems with shifting into sign -bits. - -New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big -thing is that regex.h is now generated, using mkh, rather than being -supplied in the distribution; due to circularities in dependencies, -you have to build regex.h explicitly by "make h". The two known bugs -have been fixed (and the regression test now checks for them), as has a -problem with assertions not being suppressed in the absence of REDEBUG. -No performance work yet. - -New in alpha2: Backslash-anything is an ordinary character, not an -error (except, of course, for the handful of backslashed metacharacters -in BREs), which should reduce script breakage. The regression test -checks *where* null strings are supposed to match, and has generally -been tightened up somewhat. Small bug fixes in parameter passing (not -harmful, but technically errors) and some other areas. Debugging -invoked by defining REDEBUG rather than not defining NDEBUG. - -New in alpha+3: full prototyping for internal routines, using a little -helper program, mkh, which extracts prototypes given in stylized comments. -More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple -pre-screening of input when a literal string is known to be part of the -RE; this does wonders for performance. - -New in alpha+2: minor bits of cleanup. Notably, the number "32" for the -word width isn't hardwired into regexec.c any more, the public header -file prototypes the functions if __STDC__ is defined, and some small typos -in the manpages have been fixed. - -New in alpha+1: improvements to the manual pages, and an important -extension, the REG_STARTEND option to regexec(). diff --git a/regex/cclass.h b/regex/cclass.h deleted file mode 100644 index df41694b0403b..0000000000000 --- a/regex/cclass.h +++ /dev/null @@ -1,30 +0,0 @@ -/* character-class table */ -static struct cclass { - unsigned char *name; - unsigned char *chars; - unsigned char *multis; -} cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""}, - {"blank", " \t", ""}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""}, - {"digit", "0123456789", ""}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - ""}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"space", "\t\n\v\f\r ", ""}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""}, - {"xdigit", "0123456789ABCDEFabcdef", - ""}, - {NULL, 0, ""} -}; diff --git a/regex/cname.h b/regex/cname.h deleted file mode 100644 index 670b273882817..0000000000000 --- a/regex/cname.h +++ /dev/null @@ -1,102 +0,0 @@ -/* character-name table */ -static struct cname { - char *name; - char code; -} cnames[] = { - {"NUL", '\0'}, - {"SOH", '\001'}, - {"STX", '\002'}, - {"ETX", '\003'}, - {"EOT", '\004'}, - {"ENQ", '\005'}, - {"ACK", '\006'}, - {"BEL", '\007'}, - {"alert", '\007'}, - {"BS", '\010'}, - {"backspace", '\b'}, - {"HT", '\011'}, - {"tab", '\t'}, - {"LF", '\012'}, - {"newline", '\n'}, - {"VT", '\013'}, - {"vertical-tab", '\v'}, - {"FF", '\014'}, - {"form-feed", '\f'}, - {"CR", '\015'}, - {"carriage-return", '\r'}, - {"SO", '\016'}, - {"SI", '\017'}, - {"DLE", '\020'}, - {"DC1", '\021'}, - {"DC2", '\022'}, - {"DC3", '\023'}, - {"DC4", '\024'}, - {"NAK", '\025'}, - {"SYN", '\026'}, - {"ETB", '\027'}, - {"CAN", '\030'}, - {"EM", '\031'}, - {"SUB", '\032'}, - {"ESC", '\033'}, - {"IS4", '\034'}, - {"FS", '\034'}, - {"IS3", '\035'}, - {"GS", '\035'}, - {"IS2", '\036'}, - {"RS", '\036'}, - {"IS1", '\037'}, - {"US", '\037'}, - {"space", ' '}, - {"exclamation-mark", '!'}, - {"quotation-mark", '"'}, - {"number-sign", '#'}, - {"dollar-sign", '$'}, - {"percent-sign", '%'}, - {"ampersand", '&'}, - {"apostrophe", '\''}, - {"left-parenthesis", '('}, - {"right-parenthesis", ')'}, - {"asterisk", '*'}, - {"plus-sign", '+'}, - {"comma", ','}, - {"hyphen", '-'}, - {"hyphen-minus", '-'}, - {"period", '.'}, - {"full-stop", '.'}, - {"slash", '/'}, - {"solidus", '/'}, - {"zero", '0'}, - {"one", '1'}, - {"two", '2'}, - {"three", '3'}, - {"four", '4'}, - {"five", '5'}, - {"six", '6'}, - {"seven", '7'}, - {"eight", '8'}, - {"nine", '9'}, - {"colon", ':'}, - {"semicolon", ';'}, - {"less-than-sign", '<'}, - {"equals-sign", '='}, - {"greater-than-sign", '>'}, - {"question-mark", '?'}, - {"commercial-at", '@'}, - {"left-square-bracket", '['}, - {"backslash", '\\'}, - {"reverse-solidus", '\\'}, - {"right-square-bracket", ']'}, - {"circumflex", '^'}, - {"circumflex-accent", '^'}, - {"underscore", '_'}, - {"low-line", '_'}, - {"grave-accent", '`'}, - {"left-brace", '{'}, - {"left-curly-bracket", '{'}, - {"vertical-line", '|'}, - {"right-brace", '}'}, - {"right-curly-bracket", '}'}, - {"tilde", '~'}, - {"DEL", '\177'}, - {NULL, 0}, -}; diff --git a/regex/debug.c b/regex/debug.c deleted file mode 100644 index 3db93ef293ae0..0000000000000 --- a/regex/debug.c +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" -#include "debug.ih" - -/* - - regprint - print a regexp for debugging - == void regprint(regex_t *r, FILE *d); - */ -void -regprint(r, d) -regex_t *r; -FILE *d; -{ - register struct re_guts *g = r->re_g; - register int i; - register int c; - register int last; - int nincat[NC]; - - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); - fprintf(d, ", first %ld last %ld", (long)g->firststate, - (long)g->laststate); - if (g->iflags&USEBOL) - fprintf(d, ", USEBOL"); - if (g->iflags&USEEOL) - fprintf(d, ", USEEOL"); - if (g->iflags&BAD) - fprintf(d, ", BAD"); - if (g->nsub > 0) - fprintf(d, ", nsub=%ld", (long)g->nsub); - if (g->must != NULL) - fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, - g->must); - if (g->backrefs) - fprintf(d, ", backrefs"); - if (g->nplus > 0) - fprintf(d, ", nplus %ld", (long)g->nplus); - fprintf(d, "\n"); - s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } -} - -/* - - s_print - print the strip for debugging - == static void s_print(register struct re_guts *g, FILE *d); - */ -static void -s_print(g, d) -register struct re_guts *g; -FILE *d; -{ - register sop *s; - register cset *cs; - register int i; - register int done = 0; - register sop opnd; - register int col = 0; - register int last; - register sopno offset = 2; -# define GAP() { if (offset % 5 == 0) { \ - if (col > 40) { \ - fprintf(d, "\n\t"); \ - col = 0; \ - } else { \ - fprintf(d, " "); \ - col++; \ - } \ - } else \ - col++; \ - offset++; \ - } - - if (OP(g->strip[0]) != OEND) - fprintf(d, "missing initial OEND!\n"); - for (s = &g->strip[1]; !done; s++) { - opnd = OPND(*s); - switch (OP(*s)) { - case OEND: - fprintf(d, "\n"); - done = 1; - break; - case OCHAR: - if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) - fprintf(d, "\\%c", (unsigned char)opnd); - else - fprintf(d, "%s", regchar((unsigned char)opnd)); - break; - case OBOL: - fprintf(d, "^"); - break; - case OEOL: - fprintf(d, "$"); - break; - case OBOW: - fprintf(d, "\\{"); - break; - case OEOW: - fprintf(d, "\\}"); - break; - case OANY: - fprintf(d, "."); - break; - case OANYOF: - fprintf(d, "[(%ld)", (long)opnd); - cs = &g->sets[opnd]; - last = -1; - for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ - if (CHIN(cs, i) && i < g->csetsize) { - if (last < 0) { - fprintf(d, "%s", regchar(i)); - last = i; - } - } else { - if (last >= 0) { - if (last != i-1) - fprintf(d, "-%s", - regchar(i-1)); - last = -1; - } - } - fprintf(d, "]"); - break; - case OBACK_: - fprintf(d, "(\\<%ld>", (long)opnd); - break; - case O_BACK: - fprintf(d, "<%ld>\\)", (long)opnd); - break; - case OPLUS_: - fprintf(d, "(+"); - if (OP(*(s+opnd)) != O_PLUS) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_PLUS: - if (OP(*(s-opnd)) != OPLUS_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "+)"); - break; - case OQUEST_: - fprintf(d, "(?"); - if (OP(*(s+opnd)) != O_QUEST) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_QUEST: - if (OP(*(s-opnd)) != OQUEST_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "?)"); - break; - case OLPAREN: - fprintf(d, "((<%ld>", (long)opnd); - break; - case ORPAREN: - fprintf(d, "<%ld>))", (long)opnd); - break; - case OCH_: - fprintf(d, "<"); - if (OP(*(s+opnd)) != OOR2) - fprintf(d, "<%ld>", (long)opnd); - break; - case OOR1: - if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "|"); - break; - case OOR2: - fprintf(d, "|"); - if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_CH: - if (OP(*(s-opnd)) != OOR1) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, ">"); - break; - default: - fprintf(d, "!%ld(%ld)!", OP(*s), opnd); - break; - } - if (!done) - GAP(); - } -} - -/* - - regchar - make a character printable - == static char *regchar(int ch); - */ -static unsigned char * /* -> representation */ -regchar(ch) -int ch; -{ - static unsigned char buf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(buf, "%c", ch); - else - sprintf(buf, "\\%o", ch); - return(buf); -} diff --git a/regex/debug.ih b/regex/debug.ih deleted file mode 100644 index 5f40ff7917876..0000000000000 --- a/regex/debug.ih +++ /dev/null @@ -1,14 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === debug.c === */ -void regprint(regex_t *r, FILE *d); -static void s_print(register struct re_guts *g, FILE *d); -static char *regchar(int ch); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/engine.c b/regex/engine.c deleted file mode 100644 index 0682267f61801..0000000000000 --- a/regex/engine.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* - * The matching engine and friends. This file is #included by regexec.c - * after suitable #defines of a variety of macros used herein, so that - * different state representations can be used without duplicating masses - * of code. - */ - -#ifdef SNAMES -#define matcher smatcher -#define fast sfast -#define slow sslow -#define dissect sdissect -#define backref sbackref -#define step sstep -#define print sprint -#define at sat -#define match smat -#endif -#ifdef LNAMES -#define matcher lmatcher -#define fast lfast -#define slow lslow -#define dissect ldissect -#define backref lbackref -#define step lstep -#define print lprint -#define at lat -#define match lmat -#endif - -/* another structure passed up and down to avoid zillions of parameters */ -struct match { - struct re_guts *g; - int eflags; - regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ - unsigned char *offp; /* offsets work from here */ - unsigned char *beginp; /* start of string -- virtual NUL precedes */ - unsigned char *endp; /* end of string -- virtual NUL here */ - unsigned char *coldp; /* can be no match starting before here */ - unsigned char **lastpos; /* [nplus+1] */ - STATEVARS; - states st; /* current states */ - states fresh; /* states for a fresh start */ - states tmp; /* temporary */ - states empty; /* empty set of states */ -}; - -#include "engine.ih" - -#ifdef REDEBUG -#define SP(t, s, c) print(m, t, s, c, stdout) -#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) -#define NOTE(str) { if (m->eflags®_TRACE) printf("=%s\n", (str)); } -#else -#define SP(t, s, c) /* nothing */ -#define AT(t, p1, p2, s1, s2) /* nothing */ -#define NOTE(s) /* nothing */ -#endif - -/* - - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, char *string, \ - == size_t nmatch, regmatch_t pmatch[], int eflags); - */ -static int /* 0 success, REG_NOMATCH failure */ -matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; -unsigned char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register unsigned char *endp; - register size_t i; - struct match mv; - register struct match *m = &mv; - register unsigned char *dp; - const register sopno gf = g->firststate+1; /* +1 for OEND */ - const register sopno gl = g->laststate; - unsigned char *start; - unsigned char *stop; - - /* simplify the situation where possible */ - if (g->cflags®_NOSUB) - nmatch = 0; - if (eflags®_STARTEND) { - start = string + pmatch[0].rm_so; - stop = string + pmatch[0].rm_eo; - } else { - start = string; - stop = start + strlen(start); - } - if (stop < start) - return(REG_INVARG); - - /* prescreening; this does wonders for this rather slow code */ - if (g->must != NULL) { - for (dp = start; dp < stop; dp++) - if (*dp == g->must[0] && stop - dp >= g->mlen && - memcmp(dp, g->must, (size_t)g->mlen) == 0) - break; - if (dp == stop) /* we didn't find g->must */ - return(REG_NOMATCH); - } - - /* match struct setup */ - m->g = g; - m->eflags = eflags; - m->pmatch = NULL; - m->lastpos = NULL; - m->offp = string; - m->beginp = start; - m->endp = stop; - STATESETUP(m, 4); - SETUP(m->st); - SETUP(m->fresh); - SETUP(m->tmp); - SETUP(m->empty); - CLEAR(m->empty); - - /* this loop does only one repetition except for backrefs */ - for (;;) { - endp = fast(m, start, stop, gf, gl); - if (endp == NULL) { /* a miss */ - STATETEARDOWN(m); - return(REG_NOMATCH); - } - if (nmatch == 0 && !g->backrefs) - break; /* no further info needed */ - - /* where? */ - assert(m->coldp != NULL); - for (;;) { - NOTE("finding start"); - endp = slow(m, m->coldp, stop, gf, gl); - if (endp != NULL) - break; - assert(m->coldp < m->endp); - m->coldp++; - } - if (nmatch == 1 && !g->backrefs) - break; /* no further info needed */ - - /* oh my, he wants the subexpressions... */ - if (m->pmatch == NULL) - m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * - sizeof(regmatch_t)); - if (m->pmatch == NULL) { - STATETEARDOWN(m); - return(REG_ESPACE); - } - for (i = 1; i <= m->g->nsub; i++) - m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; - if (!g->backrefs && !(m->eflags®_BACKR)) { - NOTE("dissecting"); - dp = dissect(m, m->coldp, endp, gf, gl); - } else { - if (g->nplus > 0 && m->lastpos == NULL) - m->lastpos = (unsigned char **)malloc((g->nplus+1) * - sizeof(unsigned char *)); - if (g->nplus > 0 && m->lastpos == NULL) { - free((char *)m->pmatch); - STATETEARDOWN(m); - return(REG_ESPACE); - } - NOTE("backref dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - if (dp != NULL) - break; - - /* uh-oh... we couldn't find a subexpression-level match */ - assert(g->backrefs); /* must be back references doing it */ - assert(g->nplus == 0 || m->lastpos != NULL); - for (;;) { - if (dp != NULL || endp <= m->coldp) - break; /* defeat */ - NOTE("backoff"); - endp = slow(m, m->coldp, endp-1, gf, gl); - if (endp == NULL) - break; /* defeat */ - /* try it on a shorter possibility */ -#ifndef NDEBUG - for (i = 1; i <= m->g->nsub; i++) { - assert(m->pmatch[i].rm_so == -1); - assert(m->pmatch[i].rm_eo == -1); - } -#endif - NOTE("backoff dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - assert(dp == NULL || dp == endp); - if (dp != NULL) /* found a shorter one */ - break; - - /* despite initial appearances, there is no match here */ - NOTE("false alarm"); - start = m->coldp + 1; /* recycle starting later */ - assert(start <= stop); - } - - /* fill in the details if requested */ - if (nmatch > 0) { - pmatch[0].rm_so = m->coldp - m->offp; - pmatch[0].rm_eo = endp - m->offp; - } - if (nmatch > 1) { - assert(m->pmatch != NULL); - for (i = 1; i < nmatch; i++) - if (i <= m->g->nsub) - pmatch[i] = m->pmatch[i]; - else { - pmatch[i].rm_so = -1; - pmatch[i].rm_eo = -1; - } - } - - if (m->pmatch != NULL) - free((char *)m->pmatch); - if (m->lastpos != NULL) - free((char *)m->lastpos); - STATETEARDOWN(m); - return(0); -} - -/* - - dissect - figure out what matched what, no back references - == static unsigned char *dissect(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* == stop (success) always */ -dissect(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register unsigned char *stp; /* string matched by it cannot pass here */ - register unsigned char *rest; /* start of rest of string */ - register unsigned char *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *sep; /* end of string matched by subsubRE */ - register unsigned char *oldssp; /* previous ssp */ - register unsigned char *dp; - - AT("diss", start, stop, startst, stopst); - sp = start; - for (ss = startst; ss < stopst; ss = es) { - /* identify end of subRE */ - es = ss; - switch (OP(m->g->strip[es])) { - case OPLUS_: - case OQUEST_: - es += OPND(m->g->strip[es]); - break; - case OCH_: - while (OP(m->g->strip[es]) != O_CH) - es += OPND(m->g->strip[es]); - break; - } - es++; - - /* figure out what it matched */ - switch (OP(m->g->strip[ss])) { - case OEND: - assert(PHP_REGEX_NOPE); - break; - case OCHAR: - sp++; - break; - case OBOL: - case OEOL: - case OBOW: - case OEOW: - break; - case OANY: - case OANYOF: - sp++; - break; - case OBACK_: - case O_BACK: - assert(PHP_REGEX_NOPE); - break; - /* cases where length of match is hard to find */ - case OQUEST_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - /* did innards match? */ - if (slow(m, sp, rest, ssub, esub) != NULL) { - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - } else /* no */ - assert(sp == rest); - sp = rest; - break; - case OPLUS_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - ssp = sp; - oldssp = ssp; - for (;;) { /* find last match of innards */ - sep = slow(m, ssp, rest, ssub, esub); - if (sep == NULL || sep == ssp) - break; /* failed or matched null */ - oldssp = ssp; /* on to next try */ - ssp = sep; - } - if (sep == NULL) { - /* last successful match */ - sep = ssp; - ssp = oldssp; - } - assert(sep == rest); /* must exhaust substring */ - assert(slow(m, ssp, sep, ssub, esub) == rest); - dp = dissect(m, ssp, sep, ssub, esub); - assert(dp == sep); - sp = rest; - break; - case OCH_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = ss + OPND(m->g->strip[ss]) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - if (slow(m, sp, rest, ssub, esub) == rest) - break; /* it matched all of it */ - /* that one missed, try next one */ - assert(OP(m->g->strip[esub]) == OOR1); - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - sp = rest; - break; - case O_PLUS: - case O_QUEST: - case OOR1: - case OOR2: - case O_CH: - assert(PHP_REGEX_NOPE); - break; - case OLPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_so = sp - m->offp; - break; - case ORPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_eo = sp - m->offp; - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - } - - assert(sp == stop); - return(sp); -} - -/* - - backref - figure out what matched what, figuring in back references - == static unsigned char *backref(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst, sopno lev); - */ -static unsigned char * /* == stop (success) or NULL (failure) */ -backref(m, start, stop, startst, stopst, lev) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -sopno lev; /* PLUS nesting level */ -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *dp; - register size_t len; - register int hard; - register sop s; - register regoff_t offsave; - register cset *cs; - - AT("back", start, stop, startst, stopst); - sp = start; - - /* get as far as we can with easy stuff */ - hard = 0; - for (ss = startst; !hard && ss < stopst; ss++) - switch (OP(s = m->g->strip[ss])) { - case OCHAR: - if (sp == stop || *sp++ != (unsigned char)OPND(s)) - return(NULL); - break; - case OANY: - if (sp == stop) - return(NULL); - sp++; - break; - case OANYOF: - cs = &m->g->sets[OPND(s)]; - if (sp == stop || !CHIN(cs, *sp++)) - return(NULL); - break; - case OBOL: - if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOL: - if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OBOW: - if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && - !ISWORD(*(sp-1))) ) && - (sp < m->endp && ISWORD(*sp)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOW: - if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp < m->endp && !ISWORD(*sp)) ) && - (sp > m->beginp && ISWORD(*(sp-1))) ) - { /* yes */ } - else - return(NULL); - break; - case O_QUEST: - break; - case OOR1: /* matches null but needs to skip */ - ss++; - s = m->g->strip[ss]; - do { - assert(OP(s) == OOR2); - ss += OPND(s); - } while (OP(s = m->g->strip[ss]) != O_CH); - /* note that the ss++ gets us past the O_CH */ - break; - default: /* have to make a choice */ - hard = 1; - break; - } - if (!hard) { /* that was it! */ - if (sp != stop) - return(NULL); - return(sp); - } - ss--; /* adjust for the for's final increment */ - - /* the hard stuff */ - AT("hard", sp, stop, ss, stopst); - s = m->g->strip[ss]; - switch (OP(s)) { - case OBACK_: /* the vilest depths */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - if (m->pmatch[i].rm_eo == -1) - return(NULL); - assert(m->pmatch[i].rm_so != -1); - len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; - assert(stop - m->beginp >= len); - if (sp > stop - len) - return(NULL); /* not enough left to match */ - ssp = m->offp + m->pmatch[i].rm_so; - if (memcmp(sp, ssp, len) != 0) - return(NULL); - while (m->g->strip[ss] != SOP(O_BACK, i)) - ss++; - return(backref(m, sp+len, stop, ss+1, stopst, lev)); - break; - case OQUEST_: /* to null or not */ - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); /* not */ - return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev)); - break; - case OPLUS_: - assert(m->lastpos != NULL); - assert(lev+1 <= m->g->nplus); - m->lastpos[lev+1] = sp; - return(backref(m, sp, stop, ss+1, stopst, lev+1)); - break; - case O_PLUS: - if (sp == m->lastpos[lev]) /* last pass matched null */ - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - /* try another pass */ - m->lastpos[lev] = sp; - dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev); - if (dp == NULL) - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - else - return(dp); - break; - case OCH_: /* find the right one, if any */ - ssub = ss + 1; - esub = ss + OPND(s) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - dp = backref(m, sp, stop, ssub, esub, lev); - if (dp != NULL) - return(dp); - /* that one missed, try next one */ - if (OP(m->g->strip[esub]) == O_CH) - return(NULL); /* there is none */ - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - break; - case OLPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_so; - m->pmatch[i].rm_so = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_so = offsave; - return(NULL); - break; - case ORPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_eo; - m->pmatch[i].rm_eo = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_eo = offsave; - return(NULL); - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - - /* "can't happen" */ - assert(PHP_REGEX_NOPE); - /* NOTREACHED */ - return((unsigned char *)NULL); /* dummy */ -} - -/* - - fast - step through the string at top speed - == static unsigned char *fast(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where tentative match ended, or NULL */ -fast(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states fresh = m->fresh; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *coldp; /* last p after which no match was underway */ - - CLEAR(st); - SET1(st, startst); - st = step(m->g, startst, stopst, st, NOTHING, st); - ASSIGN(fresh, st); - SP("start", st, *p); - coldp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - if (EQ(st, fresh)) - coldp = p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("boleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("boweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, fresh); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("aft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - assert(coldp != NULL); - m->coldp = coldp; - if (ISSET(st, stopst)) - return(p+1); - else - return(NULL); -} - -/* - - slow - step through the string more deliberately - == static unsigned char *slow(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where it ended */ -slow(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states empty = m->empty; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *matchp; /* last p at which a match ended */ - - AT("slow", start, stop, startst, stopst); - CLEAR(st); - SET1(st, startst); - SP("sstart", st, *p); - st = step(m->g, startst, stopst, st, NOTHING, st); - matchp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst)) - matchp = p; - if (EQ(st, empty) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, empty); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("saft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - return(matchp); -} - - -/* - - step - map set of states reachable before char to set reachable after - == static states step(register struct re_guts *g, sopno start, sopno stop, \ - == register states bef, int ch, register states aft); - == #define BOL (OUT+1) - == #define EOL (BOL+1) - == #define BOLEOL (BOL+2) - == #define NOTHING (BOL+3) - == #define BOW (BOL+4) - == #define EOW (BOL+5) - == #define CODEMAX (BOL+5) // highest code used - == #define NONCHAR(c) ((c) > UCHAR_MAX) - == #define NNONCHAR (CODEMAX-UCHAR_MAX) - */ -static states -step(g, start, stop, bef, ch, aft) -register struct re_guts *g; -sopno start; /* start state within strip */ -sopno stop; /* state after stop state within strip */ -register states bef; /* states reachable before */ -int ch; /* character or NONCHAR code */ -register states aft; /* states already known reachable after */ -{ - register cset *cs; - register sop s; - register sopno pc; - register onestate here; /* note, macros know this name */ - register sopno look; - register long i; - - for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { - s = g->strip[pc]; - switch (OP(s)) { - case OEND: - assert(pc == stop-1); - break; - case OCHAR: - /* only characters can match */ - assert(!NONCHAR(ch) || ch != (unsigned char)OPND(s)); - if (ch == (unsigned char)OPND(s)) - FWD(aft, bef, 1); - break; - case OBOL: - if (ch == BOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OEOL: - if (ch == EOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OBOW: - if (ch == BOW) - FWD(aft, bef, 1); - break; - case OEOW: - if (ch == EOW) - FWD(aft, bef, 1); - break; - case OANY: - if (!NONCHAR(ch)) - FWD(aft, bef, 1); - break; - case OANYOF: - cs = &g->sets[OPND(s)]; - if (!NONCHAR(ch) && CHIN(cs, ch)) - FWD(aft, bef, 1); - break; - case OBACK_: /* ignored here */ - case O_BACK: - FWD(aft, aft, 1); - break; - case OPLUS_: /* forward, this is just an empty */ - FWD(aft, aft, 1); - break; - case O_PLUS: /* both forward and back */ - FWD(aft, aft, 1); - i = ISSETBACK(aft, OPND(s)); - BACK(aft, aft, OPND(s)); - if (!i && ISSETBACK(aft, OPND(s))) { - /* oho, must reconsider loop body */ - pc -= OPND(s) + 1; - INIT(here, pc); - } - break; - case OQUEST_: /* two branches, both forward */ - FWD(aft, aft, 1); - FWD(aft, aft, OPND(s)); - break; - case O_QUEST: /* just an empty */ - FWD(aft, aft, 1); - break; - case OLPAREN: /* not significant here */ - case ORPAREN: - FWD(aft, aft, 1); - break; - case OCH_: /* mark the first two branches */ - FWD(aft, aft, 1); - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - break; - case OOR1: /* done a branch, find the O_CH */ - if (ISSTATEIN(aft, here)) { - for (look = 1; - OP(s = g->strip[pc+look]) != O_CH; - look += OPND(s)) - assert(OP(s) == OOR2); - FWD(aft, aft, look); - } - break; - case OOR2: /* propagate OCH_'s marking */ - FWD(aft, aft, 1); - if (OP(g->strip[pc+OPND(s)]) != O_CH) { - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - } - break; - case O_CH: /* just empty */ - FWD(aft, aft, 1); - break; - default: /* ooooops... */ - assert(PHP_REGEX_NOPE); - break; - } - } - - return(aft); -} - -#ifdef REDEBUG -/* - - print - print a set of states - == #ifdef REDEBUG - == static void print(struct match *m, unsigned char *caption, states st, \ - == int ch, FILE *d); - == #endif - */ -static void -print(m, caption, st, ch, d) -struct match *m; -unsigned char *caption; -states st; -int ch; -FILE *d; -{ - register struct re_guts *g = m->g; - register int i; - register int first = 1; - - if (!(m->eflags®_TRACE)) - return; - - fprintf(d, "%s", caption); - if (ch != '\0') - fprintf(d, " %s", pchar(ch)); - for (i = 0; i < g->nstates; i++) - if (ISSET(st, i)) { - fprintf(d, "%s%d", (first) ? "\t" : ", ", i); - first = 0; - } - fprintf(d, "\n"); -} - -/* - - at - print current situation - == #ifdef REDEBUG - == static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, \ - == sopno startst, sopno stopst); - == #endif - */ -static void -at(m, title, start, stop, startst, stopst) -struct match *m; -unsigned char *title; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - if (!(m->eflags®_TRACE)) - return; - - printf("%s %s-", title, pchar(*start)); - printf("%s ", pchar(*stop)); - printf("%ld-%ld\n", (long)startst, (long)stopst); -} - -#ifndef PCHARDONE -#define PCHARDONE /* never again */ -/* - - pchar - make a character printable - == #ifdef REDEBUG - == static unsigned char *pchar(int ch); - == #endif - * - * Is this identical to regchar() over in debug.c? Well, yes. But a - * duplicate here avoids having a debugging-capable regexec.o tied to - * a matching debug.o, and this is convenient. It all disappears in - * the non-debug compilation anyway, so it doesn't matter much. - */ -static unsigned char * /* -> representation */ -pchar(ch) -int ch; -{ - static unsigned char pbuf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(pbuf, "%c", ch); - else - sprintf(pbuf, "\\%o", ch); - return(pbuf); -} -#endif -#endif - -#undef matcher -#undef fast -#undef slow -#undef dissect -#undef backref -#undef step -#undef print -#undef at -#undef match diff --git a/regex/engine.ih b/regex/engine.ih deleted file mode 100644 index 9a301838bcd90..0000000000000 --- a/regex/engine.ih +++ /dev/null @@ -1,35 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === engine.c === */ -static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags); -static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev); -static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft); -#define BOL (OUT+1) -#define EOL (BOL+1) -#define BOLEOL (BOL+2) -#define NOTHING (BOL+3) -#define BOW (BOL+4) -#define EOW (BOL+5) -#define CODEMAX (BOL+5) /* highest code used */ -#define NONCHAR(c) ((c) > UCHAR_MAX) -#define NNONCHAR (CODEMAX-UCHAR_MAX) -#ifdef REDEBUG -static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d); -#endif -#ifdef REDEBUG -static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -#endif -#ifdef REDEBUG -static unsigned char *pchar(int ch); -#endif - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/main.c b/regex/main.c deleted file mode 100644 index 657338a2c1998..0000000000000 --- a/regex/main.c +++ /dev/null @@ -1,510 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "main.ih" - -char *progname; -int debug = 0; -int line = 0; -int status = 0; - -int copts = REG_EXTENDED; -int eopts = 0; -regoff_t startoff = 0; -regoff_t endoff = 0; - - -extern int split(); -extern void regprint(); - -/* - - main - do the simple case, hand off to regress() for regression - */ -int main(argc, argv) -int argc; -char *argv[]; -{ - regex_t re; -# define NS 10 - regmatch_t subs[NS]; - char erbuf[100]; - int err; - size_t len; - int c; - int errflg = 0; - register int i; - extern int optind; - extern char *optarg; - - progname = argv[0]; - - while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF) - switch (c) { - case 'c': /* compile options */ - copts = options('c', optarg); - break; - case 'e': /* execute options */ - eopts = options('e', optarg); - break; - case 'S': /* start offset */ - startoff = (regoff_t)atoi(optarg); - break; - case 'E': /* end offset */ - endoff = (regoff_t)atoi(optarg); - break; - case 'x': /* Debugging. */ - debug++; - break; - case '?': - default: - errflg++; - break; - } - if (errflg) { - fprintf(stderr, "usage: %s ", progname); - fprintf(stderr, "[-c copt][-C][-d] [re]\n"); - exit(2); - } - - if (optind >= argc) { - regress(stdin); - exit(status); - } - - err = regcomp(&re, argv[optind++], copts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - regprint(&re, stdout); - - if (optind >= argc) { - regfree(&re); - exit(status); - } - - if (eopts®_STARTEND) { - subs[0].rm_so = startoff; - subs[0].rm_eo = strlen(argv[optind]) - endoff; - } - err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - if (!(copts®_NOSUB)) { - len = (int)(subs[0].rm_eo - subs[0].rm_so); - if (subs[0].rm_so != -1) { - if (len != 0) - printf("match `%.*s'\n", (int)len, - argv[optind] + subs[0].rm_so); - else - printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); - } - for (i = 1; i < NS; i++) - if (subs[i].rm_so != -1) - printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); - } - exit(status); -} - -/* - - regress - main loop of regression test - == void regress(FILE *in); - */ -void -regress(in) -FILE *in; -{ - char inbuf[1000]; -# define MAXF 10 - char *f[MAXF]; - int nf; - int i; - char erbuf[100]; - size_t ne; - char *badpat = "invalid regular expression"; -# define SHORT 10 - char *bpname = "REG_BADPAT"; - regex_t re; - - while (fgets(inbuf, sizeof(inbuf), in) != NULL) { - line++; - if (inbuf[0] == '#' || inbuf[0] == '\n') - continue; /* NOTE CONTINUE */ - inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ - if (debug) - fprintf(stdout, "%d:\n", line); - nf = split(inbuf, f, MAXF, "\t\t"); - if (nf < 3) { - fprintf(stderr, "bad input, line %d\n", line); - exit(1); - } - for (i = 0; i < nf; i++) - if (strcmp(f[i], "\"\"") == 0) - f[i] = ""; - if (nf <= 3) - f[3] = NULL; - if (nf <= 4) - f[4] = NULL; - try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); - if (opt('&', f[1])) /* try with either type of RE */ - try(f[0], f[1], f[2], f[3], f[4], - options('c', f[1]) &~ REG_EXTENDED); - } - - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", - erbuf, badpat); - status = 1; - } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); - if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", - erbuf, SHORT-1, badpat); - status = 1; - } - ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { - fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", - erbuf, bpname); - status = 1; - } - re.re_endp = bpname; - ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); - if (atoi(erbuf) != (int)REG_BADPAT) { - fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", - erbuf, (long)REG_BADPAT); - status = 1; - } else if (ne != strlen(erbuf)+1) { - fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", - erbuf, (long)REG_BADPAT); - status = 1; - } -} - -/* - - try - try it, and report on problems - == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); - */ -void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ -{ - regex_t re; -# define NSUBS 10 - regmatch_t subs[NSUBS]; -# define NSHOULD 15 - char *should[NSHOULD]; - int nshould; - char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - register int i; - char *grump; - char f0copy[1000]; - char f2copy[1000]; - - strcpy(f0copy, f0); - re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; - fixstr(f0copy); - err = regcomp(&re, f0copy, opts); - if (err != 0 && (!opt('C', f1) || err != efind(f2))) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err == 0 && opt('C', f1)) { - /* unexpected success */ - fprintf(stderr, "%d: %s should have given REG_%s\n", - line, type, f2); - status = 1; - err = 1; /* so we won't try regexec */ - } - - if (err != 0) { - regfree(&re); - return; - } - - strcpy(f2copy, f2); - fixstr(f2copy); - - if (options('e', f1)®_STARTEND) { - if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) - fprintf(stderr, "%d: bad STARTEND syntax\n", line); - subs[0].rm_so = strchr(f2, '(') - f2 + 1; - subs[0].rm_eo = strchr(f2, ')') - f2; - } - err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); - - if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err != 0) { - /* nothing more to check */ - } else if (f3 == NULL) { - /* unexpected success */ - fprintf(stderr, "%d: %s exec should have failed\n", - line, type); - status = 1; - err = 1; /* just on principle */ - } else if (opts®_NOSUB) { - /* nothing more to check */ - } else if ((grump = check(f2, subs[0], f3)) != NULL) { - fprintf(stderr, "%d: %s %s\n", line, type, grump); - status = 1; - err = 1; - } - - if (err != 0 || f4 == NULL) { - regfree(&re); - return; - } - - for (i = 1; i < NSHOULD; i++) - should[i] = NULL; - nshould = split(f4, should+1, NSHOULD-1, ","); - if (nshould == 0) { - nshould = 1; - should[1] = ""; - } - for (i = 1; i < NSUBS; i++) { - grump = check(f2, subs[i], should[i]); - if (grump != NULL) { - fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); - status = 1; - err = 1; - } - } - - regfree(&re); -} - -/* - - options - pick options out of a regression-test string - == int options(int type, char *s); - */ -int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; -{ - register char *p; - register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; - - for (p = s; *p != '\0'; p++) - if (strchr(legal, *p) != NULL) - switch (*p) { - case 'b': - o &= ~REG_EXTENDED; - break; - case 'i': - o |= REG_ICASE; - break; - case 's': - o |= REG_NOSUB; - break; - case 'n': - o |= REG_NEWLINE; - break; - case 'm': - o &= ~REG_EXTENDED; - o |= REG_NOSPEC; - break; - case 'p': - o |= REG_PEND; - break; - case '^': - o |= REG_NOTBOL; - break; - case '$': - o |= REG_NOTEOL; - break; - case '#': - o |= REG_STARTEND; - break; - case 't': /* trace */ - o |= REG_TRACE; - break; - case 'l': /* force long representation */ - o |= REG_LARGE; - break; - case 'r': /* force backref use */ - o |= REG_BACKR; - break; - } - return(o); -} - -/* - - opt - is a particular option in a regression string? - == int opt(int c, char *s); - */ -int /* predicate */ -opt(c, s) -int c; -char *s; -{ - return(strchr(s, c) != NULL); -} - -/* - - fixstr - transform magic characters in strings - == void fixstr(register char *p); - */ -void -fixstr(p) -register char *p; -{ - if (p == NULL) - return; - - for (; *p != '\0'; p++) - if (*p == 'N') - *p = '\n'; - else if (*p == 'T') - *p = '\t'; - else if (*p == 'S') - *p = ' '; - else if (*p == 'Z') - *p = '\0'; -} - -/* - - check - check a substring match - == char *check(char *str, regmatch_t sub, char *should); - */ -char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; -{ - register int len; - register int shlen; - register char *p; - static char grump[500]; - register char *at = NULL; - - if (should != NULL && strcmp(should, "-") == 0) - should = NULL; - if (should != NULL && should[0] == '@') { - at = should + 1; - should = ""; - } - - /* check rm_so and rm_eo for consistency */ - if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || - (sub.rm_so != -1 && sub.rm_eo == -1) || - (sub.rm_so != -1 && sub.rm_so < 0) || - (sub.rm_eo != -1 && sub.rm_eo < 0) ) { - sprintf(grump, "start %ld end %ld", (long)sub.rm_so, - (long)sub.rm_eo); - return(grump); - } - - /* check for no match */ - if (sub.rm_so == -1 && should == NULL) - return(NULL); - if (sub.rm_so == -1) - return("did not match"); - - /* check for in range */ - if (sub.rm_eo > strlen(str)) { - sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); - return(grump); - } - - len = (int)(sub.rm_eo - sub.rm_so); - shlen = (int)strlen(should); - p = str + sub.rm_so; - - /* check for not supposed to match */ - if (should == NULL) { - sprintf(grump, "matched `%.*s'", len, p); - return(grump); - } - - /* check for wrong match */ - if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { - sprintf(grump, "matched `%.*s' instead", len, p); - return(grump); - } - if (shlen > 0) - return(NULL); - - /* check null match in right place */ - if (at == NULL) - return(NULL); - shlen = strlen(at); - if (shlen == 0) - shlen = 1; /* force check for end-of-string */ - if (strncmp(p, at, shlen) != 0) { - sprintf(grump, "matched null at `%.20s'", p); - return(grump); - } - return(NULL); -} - -/* - - eprint - convert error number to name - == static char *eprint(int err); - */ -static char * -eprint(err) -int err; -{ - static char epbuf[100]; - size_t len; - - len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); - assert(len <= sizeof(epbuf)); - return(epbuf); -} - -/* - - efind - convert error name to number - == static int efind(char *name); - */ -static int -efind(name) -char *name; -{ - static char efbuf[100]; - regex_t re; - - sprintf(efbuf, "REG_%s", name); - assert(strlen(efbuf) < sizeof(efbuf)); - re.re_endp = efbuf; - (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); - return(atoi(efbuf)); -} diff --git a/regex/main.ih b/regex/main.ih deleted file mode 100644 index 5a0118ac44167..0000000000000 --- a/regex/main.ih +++ /dev/null @@ -1,19 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === main.c === */ -void regress(FILE *in); -void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); -int options(int type, char *s); -int opt(int c, char *s); -void fixstr(register char *p); -char *check(char *str, regmatch_t sub, char *should); -static char *eprint(int err); -static int efind(char *name); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/mkh b/regex/mkh deleted file mode 100644 index 252b246c7bd25..0000000000000 --- a/regex/mkh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# mkh - pull headers out of C source -PATH=/bin:/usr/bin ; export PATH - -# egrep pattern to pick out marked lines -egrep='^ =([ ]|$)' - -# Sed program to process marked lines into lines for the header file. -# The markers have already been removed. Two things are done here: removal -# of backslashed newlines, and some fudging of comments. The first is done -# because -o needs to have prototypes on one line to strip them down. -# Getting comments into the output is tricky; we turn C++-style // comments -# into /* */ comments, after altering any existing */'s to avoid trouble. -peel=' /\\$/N - /\\\n[ ]*/s///g - /\/\//s;\*/;* /;g - /\/\//s;//\(.*\);/*\1 */;' - -for a -do - case "$a" in - -o) # old (pre-function-prototype) compiler - # add code to comment out argument lists - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);' - shift - ;; - -b) # funny Berkeley __P macro - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));' - shift - ;; - -s) # compiler doesn't like `static foo();' - # add code to get rid of the `static' - peel="$peel - "'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;' - shift - ;; - -p) # private declarations - egrep='^ ==([ ]|$)' - shift - ;; - -i) # wrap in #ifndef, argument is name - ifndef="$2" - shift ; shift - ;; - *) break - ;; - esac -done - -if test " $ifndef" != " " -then - echo "#ifndef $ifndef" - echo "#define $ifndef /* never again */" -fi -echo "/* ========= begin header generated by $0 ========= */" -echo '#ifdef __cplusplus' -echo 'extern "C" {' -echo '#endif' -for f -do - echo - echo "/* === $f === */" - egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel" - echo -done -echo '#ifdef __cplusplus' -echo '}' -echo '#endif' -echo "/* ========= end header generated by $0 ========= */" -if test " $ifndef" != " " -then - echo "#endif" -fi -exit 0 diff --git a/regex/regcomp.c b/regex/regcomp.c deleted file mode 100644 index ec034d4c4ce25..0000000000000 --- a/regex/regcomp.c +++ /dev/null @@ -1,1608 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define POSIX_MISTAKE - -#include "utils.h" -#include "regex.h" -#include "regex2.h" - -#include "cclass.h" -#include "cname.h" - -/* - * parse structure, passed up and down to avoid global variables and - * other clumsinesses - */ -struct parse { - unsigned char *next; /* next character in RE */ - unsigned char *end; /* end of string (-> NUL normally) */ - int error; /* has an error been seen? */ - sop *strip; /* malloced strip */ - sopno ssize; /* malloced strip size (allocated) */ - sopno slen; /* malloced strip length (used) */ - int ncsalloc; /* number of csets allocated */ - struct re_guts *g; -# define NPAREN 10 /* we need to remember () 1-9 for back refs */ - sopno pbegin[NPAREN]; /* -> ( ([0] unused) */ - sopno pend[NPAREN]; /* -> ) ([0] unused) */ -}; - -#include "regcomp.ih" - -static unsigned char nuls[10]; /* place to point scanner in event of error */ - -/* - * macros for use with parse structure - * BEWARE: these know that the parse structure is named `p' !!! - */ -#define PEEK() (*p->next) -#define PEEK2() (*(p->next+1)) -#define MORE() (p->next < p->end) -#define MORE2() (p->next+1 < p->end) -#define SEE(c) (MORE() && PEEK() == (c)) -#define SEETWO(a, b) (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b)) -#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) -#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) -#define NEXT() (p->next++) -#define NEXT2() (p->next += 2) -#define NEXTn(n) (p->next += (n)) -#define GETNEXT() (*p->next++) -#define SETERROR(e) seterr(p, (e)) -#define REQUIRE(co, e) (void) ((co) || SETERROR(e)) -#define MUSTSEE(c, e) (REQUIRE(MORE() && PEEK() == (c), e)) -#define MUSTEAT(c, e) (REQUIRE(MORE() && GETNEXT() == (c), e)) -#define MUSTNOTSEE(c, e) (REQUIRE(!MORE() || PEEK() != (c), e)) -#define EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd)) -#define INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(pos)+1, pos) -#define AHEAD(pos) dofwd(p, pos, HERE()-(pos)) -#define ASTERN(sop, pos) EMIT(sop, HERE()-pos) -#define HERE() (p->slen) -#define THERE() (p->slen - 1) -#define THERETHERE() (p->slen - 2) -#define DROP(n) (p->slen -= (n)) - -#ifndef NDEBUG -static int never = 0; /* for use in asserts; shuts lint up */ -#else -#define never 0 /* some s have bugs too */ -#endif - -/* - - regcomp - interface for parser and compilation - = API_EXPORT(int) regcomp(regex_t *, const char *, int); - = #define REG_BASIC 0000 - = #define REG_EXTENDED 0001 - = #define REG_ICASE 0002 - = #define REG_NOSUB 0004 - = #define REG_NEWLINE 0010 - = #define REG_NOSPEC 0020 - = #define REG_PEND 0040 - = #define REG_DUMP 0200 - */ -API_EXPORT(int) /* 0 success, otherwise REG_something */ -regcomp(preg, pattern, cflags) -regex_t *preg; -const char *pattern; -int cflags; -{ - struct parse pa; - register struct re_guts *g; - register struct parse *p = &pa; - register int i; - register size_t len; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&~REG_DUMP) -#endif - - cflags = GOODFLAGS(cflags); - if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) - return(REG_INVARG); - - if (cflags®_PEND) { - if (preg->re_endp < pattern) - return(REG_INVARG); - len = preg->re_endp - pattern; - } else - len = strlen((char *)pattern); - - /* do the mallocs early so failure handling is easy */ - g = (struct re_guts *)malloc(sizeof(struct re_guts) + - (NC-1)*sizeof(cat_t)); - if (g == NULL) - return(REG_ESPACE); - p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); - p->slen = 0; - if (p->strip == NULL) { - free((char *)g); - return(REG_ESPACE); - } - - /* set things up */ - p->g = g; - p->next = (unsigned char *)pattern; /* convenience; we do not modify it */ - p->end = p->next + len; - p->error = 0; - p->ncsalloc = 0; - for (i = 0; i < NPAREN; i++) { - p->pbegin[i] = 0; - p->pend[i] = 0; - } - g->csetsize = NC; - g->sets = NULL; - g->setbits = NULL; - g->ncsets = 0; - g->cflags = cflags; - g->iflags = 0; - g->nbol = 0; - g->neol = 0; - g->must = NULL; - g->mlen = 0; - g->nsub = 0; - g->ncategories = 1; /* category 0 is "everything else" */ - g->categories = &g->catspace[0]; - (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t)); - g->backrefs = 0; - - /* do it */ - EMIT(OEND, 0); - g->firststate = THERE(); - if (cflags®_EXTENDED) - p_ere(p, OUT); - else if (cflags®_NOSPEC) - p_str(p); - else - p_bre(p, OUT, OUT); - EMIT(OEND, 0); - g->laststate = THERE(); - - /* tidy up loose ends and fill things in */ - categorize(p, g); - stripsnug(p, g); - findmust(p, g); - g->nplus = pluscount(p, g); - g->magic = MAGIC2; - preg->re_nsub = g->nsub; - preg->re_g = g; - preg->re_magic = MAGIC1; -#ifndef REDEBUG - /* not debugging, so can't rely on the assert() in regexec() */ - if (g->iflags&BAD) - SETERROR(REG_ASSERT); -#endif - - /* win or lose, we're done */ - if (p->error != 0) /* lose */ - regfree(preg); - return(p->error); -} - -/* - - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); - */ -static void -p_ere(p, stop) -register struct parse *p; -int stop; /* character this ERE should end at */ -{ - register unsigned char c; - register sopno prevback = 0; - register sopno prevfwd = 0; - register sopno conc; - register int first = 1; /* is this the first alternative? */ - - for (;;) { - /* do a bunch of concatenated expressions */ - conc = HERE(); - while (MORE() && (c = PEEK()) != '|' && c != stop) - p_ere_exp(p); - (void) REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ - - if (!EAT('|')) - break; /* NOTE BREAK OUT */ - - if (first) { - INSERT(OCH_, conc); /* offset is wrong */ - prevfwd = conc; - prevback = conc; - first = 0; - } - ASTERN(OOR1, prevback); - prevback = THERE(); - AHEAD(prevfwd); /* fix previous offset */ - prevfwd = HERE(); - EMIT(OOR2, 0); /* offset is very wrong */ - } - - if (!first) { /* tail-end fixups */ - AHEAD(prevfwd); - ASTERN(O_CH, prevback); - } - - assert(!MORE() || SEE(stop)); -} - -/* - - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op - == static void p_ere_exp(register struct parse *p); - */ -static void -p_ere_exp(p) -register struct parse *p; -{ - register unsigned char c; - register sopno pos; - register int count; - register int count2; - register sopno subno; - int wascaret = 0; - - assert(MORE()); /* caller should have ensured this */ - c = GETNEXT(); - - pos = HERE(); - switch (c) { - case '(': - REQUIRE(MORE(), REG_EPAREN); - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - if (!SEE(')')) - p_ere(p, ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - MUSTEAT(')', REG_EPAREN); - break; -#ifndef POSIX_MISTAKE - case ')': /* happens only if no current unmatched ( */ - /* - * You may ask, why the ifndef? Because I didn't notice - * this until slightly too late for 1003.2, and none of the - * other 1003.2 regular-expression reviewers noticed it at - * all. So an unmatched ) is legal POSIX, at least until - * we can get it fixed. - */ - SETERROR(REG_EPAREN); - break; -#endif - case '^': - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - wascaret = 1; - break; - case '$': - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - break; - case '|': - SETERROR(REG_EMPTY); - break; - case '*': - case '+': - case '?': - SETERROR(REG_BADRPT); - break; - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case '\\': - REQUIRE(MORE(), REG_EESCAPE); - c = GETNEXT(); - ordinary(p, c); - break; - case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, c); - break; - } - - if (!MORE()) - return; - c = PEEK(); - /* we call { a repetition if followed by a digit */ - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) )) - return; /* no repetition, we're done */ - NEXT(); - - REQUIRE(!wascaret, REG_BADRPT); - switch (c) { - case '*': /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - break; - case '+': - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - break; - case '?': - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, pos); /* offset slightly wrong */ - ASTERN(OOR1, pos); /* this one's right */ - AHEAD(pos); /* fix the OCH_ */ - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - break; - case '{': - count = p_count(p); - if (EAT(',')) { - if (isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EAT('}')) { /* error heuristics */ - while (MORE() && PEEK() != '}') - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - break; - } - - if (!MORE()) - return; - c = PEEK(); - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) ) ) - return; - SETERROR(REG_BADRPT); -} - -/* - - p_str - string (no metacharacters) "parser" - == static void p_str(register struct parse *p); - */ -static void -p_str(p) -register struct parse *p; -{ - REQUIRE(MORE(), REG_EMPTY); - while (MORE()) - ordinary(p, GETNEXT()); -} - -/* - - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(register struct parse *p, register int end1, \ - == register int end2); - * Giving end1 as OUT essentially eliminates the end1/end2 check. - * - * This implementation is a bit of a kludge, in that a trailing $ is first - * taken as an ordinary character and then revised to be an anchor. The - * only undesirable side effect is that '$' gets included as a character - * category in such cases. This is fairly harmless; not worth fixing. - * The amount of lookahead needed to avoid this kludge is excessive. - */ -static void -p_bre(p, end1, end2) -register struct parse *p; -register int end1; /* first terminating character */ -register int end2; /* second terminating character */ -{ - register sopno start = HERE(); - register int first = 1; /* first subexpression? */ - register int wasdollar = 0; - - if (EAT('^')) { - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - } - while (MORE() && !SEETWO(end1, end2)) { - wasdollar = p_simp_re(p, first); - first = 0; - } - if (wasdollar) { /* oops, that was a trailing anchor */ - DROP(1); - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - } - - REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ -} - -/* - - p_simp_re - parse a simple RE, an atom possibly followed by a repetition - == static int p_simp_re(register struct parse *p, int starordinary); - */ -static int /* was the simple RE an unbackslashed $? */ -p_simp_re(p, starordinary) -register struct parse *p; -int starordinary; /* is a leading * an ordinary character? */ -{ - register int c; - register int count; - register int count2; - register sopno pos; - register int i; - register sopno subno; -# define BACKSL (1<g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_bre(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - case BACKSL|'}': - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - REQUIRE(starordinary, REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, (unsigned char)c); /* takes off BACKSL, if any */ - break; - } - - if (EAT('*')) { /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - } else if (EATTWO('\\', '{')) { - count = p_count(p); - if (EAT(',')) { - if (MORE() && isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EATTWO('\\', '}')) { /* error heuristics */ - while (MORE() && !SEETWO('\\', '}')) - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ - return(1); - - return(0); -} - -/* - - p_count - parse a repetition count - == static int p_count(register struct parse *p); - */ -static int /* the value */ -p_count(p) -register struct parse *p; -{ - register int count = 0; - register int ndigits = 0; - - while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { - count = count*10 + (GETNEXT() - '0'); - ndigits++; - } - - REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); - return(count); -} - -/* - - p_bracket - parse a bracketed character list - == static void p_bracket(register struct parse *p); - * - * Note a significant property of this code: if the allocset() did SETERROR, - * no set operations are done. - */ -static void -p_bracket(p) -register struct parse *p; -{ - register cset *cs = allocset(p); - register int invert = 0; - - /* Dept of Truly Sickening Special-Case Kludges */ - if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { - EMIT(OBOW, 0); - NEXTn(6); - return; - } - if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) { - EMIT(OEOW, 0); - NEXTn(6); - return; - } - - if (EAT('^')) - invert++; /* make note to invert set at end */ - if (EAT(']')) - CHadd(cs, ']'); - else if (EAT('-')) - CHadd(cs, '-'); - while (MORE() && PEEK() != ']' && !SEETWO('-', ']')) - p_b_term(p, cs); - if (EAT('-')) - CHadd(cs, '-'); - MUSTEAT(']', REG_EBRACK); - - if (p->error != 0) /* don't mess things up further */ - return; - - if (p->g->cflags®_ICASE) { - register int i; - register int ci; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i) && isalpha(i)) { - ci = othercase(i); - if (ci != i) - CHadd(cs, ci); - } - if (cs->multis != NULL) - mccase(p, cs); - } - if (invert) { - register int i; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i)) - CHsub(cs, i); - else - CHadd(cs, i); - if (p->g->cflags®_NEWLINE) - CHsub(cs, '\n'); - if (cs->multis != NULL) - mcinvert(p, cs); - } - - assert(cs->multis == NULL); /* xxx */ - - if (nch(p, cs) == 1) { /* optimize singleton sets */ - ordinary(p, firstch(p, cs)); - freeset(p, cs); - } else - EMIT(OANYOF, freezeset(p, cs)); -} - -/* - - p_b_term - parse one term of a bracketed character list - == static void p_b_term(register struct parse *p, register cset *cs); - */ -static void -p_b_term(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - register unsigned char start, finish; - register int i; - - /* classify what we've got */ - switch ((MORE()) ? PEEK() : '\0') { - case '[': - c = (MORE2()) ? PEEK2() : '\0'; - break; - case '-': - SETERROR(REG_ERANGE); - return; /* NOTE RETURN */ - break; - default: - c = '\0'; - break; - } - - switch (c) { - case ':': /* character class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECTYPE); - p_b_cclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO(':', ']'), REG_ECTYPE); - break; - case '=': /* equivalence class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECOLLATE); - p_b_eclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); - break; - default: /* symbol, ordinary character, or range */ -/* xxx revision needed for multichar stuff */ - start = p_b_symbol(p); - if (SEE('-') && MORE2() && PEEK2() != ']') { - /* range */ - NEXT(); - if (EAT('-')) - finish = '-'; - else - finish = p_b_symbol(p); - } else - finish = start; -/* xxx what about signed chars here... */ - REQUIRE(start <= finish, REG_ERANGE); - for (i = start; i <= finish; i++) - CHadd(cs, i); - break; - } -} - -/* - - p_b_cclass - parse a character-class name and deal with it - == static void p_b_cclass(register struct parse *p, register cset *cs); - */ -static void -p_b_cclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char *sp = p->next; - register struct cclass *cp; - register size_t len; - register unsigned char *u; - register unsigned char c; - - while (MORE() && isalpha(PEEK())) - NEXT(); - len = p->next - sp; - for (cp = cclasses; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - break; - if (cp->name == NULL) { - /* oops, didn't find it */ - SETERROR(REG_ECTYPE); - return; - } - - u = cp->chars; - while ((c = *u++) != '\0') - CHadd(cs, c); - for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) - MCadd(p, cs, u); -} - -/* - - p_b_eclass - parse an equivalence-class name and deal with it - == static void p_b_eclass(register struct parse *p, register cset *cs); - * - * This implementation is incomplete. xxx - */ -static void -p_b_eclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - - c = p_b_coll_elem(p, '='); - CHadd(cs, c); -} - -/* - - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(register struct parse *p); - */ -static unsigned char /* value of symbol */ -p_b_symbol(p) -register struct parse *p; -{ - register unsigned char value; - - REQUIRE(MORE(), REG_EBRACK); - if (!EATTWO('[', '.')) - return(GETNEXT()); - - /* collating symbol */ - value = p_b_coll_elem(p, '.'); - REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); - return(value); -} - -/* - - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(register struct parse *p, int endc); - */ -static unsigned char /* value of collating element */ -p_b_coll_elem(p, endc) -register struct parse *p; -int endc; /* name ended by endc,']' */ -{ - register unsigned char *sp = p->next; - register struct cname *cp; - register int len; - - while (MORE() && !SEETWO(endc, ']')) - NEXT(); - if (!MORE()) { - SETERROR(REG_EBRACK); - return(0); - } - len = p->next - sp; - for (cp = cnames; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - return(cp->code); /* known name */ - if (len == 1) - return(*sp); /* single character */ - SETERROR(REG_ECOLLATE); /* neither */ - return(0); -} - -/* - - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); - */ -static unsigned char /* if no counterpart, return ch */ -othercase(ch) -int ch; -{ - assert(isalpha(ch)); - if (isupper(ch)) - return(tolower(ch)); - else if (islower(ch)) - return(toupper(ch)); - else /* peculiar, but could happen */ - return(ch); -} - -/* - - bothcases - emit a dualcase version of a two-case character - == static void bothcases(register struct parse *p, int ch); - * - * Boy, is this implementation ever a kludge... - */ -static void -bothcases(p, ch) -register struct parse *p; -int ch; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[3]; - - assert(othercase(ch) != ch); /* p_bracket() would recurse */ - p->next = bracket; - p->end = bracket+2; - bracket[0] = ch; - bracket[1] = ']'; - bracket[2] = '\0'; - p_bracket(p); - assert(p->next == bracket+2); - p->next = oldnext; - p->end = oldend; -} - -/* - - ordinary - emit an ordinary character - == static void ordinary(register struct parse *p, register int ch); - */ -static void -ordinary(p, ch) -register struct parse *p; -register int ch; -{ - register cat_t *cap = p->g->categories; - - if ((p->g->cflags®_ICASE) && isalpha(ch) && othercase(ch) != ch) - bothcases(p, ch); - else { - EMIT(OCHAR, (unsigned char)ch); - if (cap[ch] == 0) - cap[ch] = p->g->ncategories++; - } -} - -/* - - nonnewline - emit REG_NEWLINE version of OANY - == static void nonnewline(register struct parse *p); - * - * Boy, is this implementation ever a kludge... - */ -static void -nonnewline(p) -register struct parse *p; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[4]; - - p->next = bracket; - p->end = bracket+3; - bracket[0] = '^'; - bracket[1] = '\n'; - bracket[2] = ']'; - bracket[3] = '\0'; - p_bracket(p); - assert(p->next == bracket+3); - p->next = oldnext; - p->end = oldend; -} - -/* - - repeat - generate code for a bounded repetition, recursively if needed - == static void repeat(register struct parse *p, sopno start, int from, int to); - */ -static void -repeat(p, start, from, to) -register struct parse *p; -sopno start; /* operand from here to end of strip */ -int from; /* repeated from this number */ -int to; /* to this number of times (maybe INFINITY) */ -{ - register sopno finish = HERE(); -# define N 2 -# define INF 3 -# define REP(f, t) ((f)*8 + (t)) -# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - register sopno copy; - - if (p->error != 0) /* head off possible runaway recursion */ - return; - - assert(from <= to); - - switch (REP(MAP(from), MAP(to))) { - case REP(0, 0): /* must be user doing this */ - DROP(finish-start); /* drop the operand */ - break; - case REP(0, 1): /* as x{1,1}? */ - case REP(0, N): /* as x{1,n}? */ - case REP(0, INF): /* as x{1,}? */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); /* offset is wrong... */ - repeat(p, start+1, 1, to); - ASTERN(OOR1, start); - AHEAD(start); /* ... fix it */ - EMIT(OOR2, 0); - AHEAD(THERE()); - ASTERN(O_CH, THERETHERE()); - break; - case REP(1, 1): /* trivial case */ - /* done */ - break; - case REP(1, N): /* as x?x{1,n-1} */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); - ASTERN(OOR1, start); - AHEAD(start); - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - copy = dupl(p, start+1, finish+1); - assert(copy == finish+4); - repeat(p, copy, 1, to-1); - break; - case REP(1, INF): /* as x+ */ - INSERT(OPLUS_, start); - ASTERN(O_PLUS, start); - break; - case REP(N, N): /* as xx{m-1,n-1} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to-1); - break; - case REP(N, INF): /* as xx{n-1,INF} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to); - break; - default: /* "can't happen" */ - SETERROR(REG_ASSERT); /* just in case */ - break; - } -} - -/* - - seterr - set an error condition - == static int seterr(register struct parse *p, int e); - */ -static int /* useless but makes type checking happy */ -seterr(p, e) -register struct parse *p; -int e; -{ - if (p->error == 0) /* keep earliest error condition */ - p->error = e; - p->next = nuls; /* try to bring things to a halt */ - p->end = nuls; - return(0); /* make the return value well-defined */ -} - -/* - - allocset - allocate a set of characters for [] - == static cset *allocset(register struct parse *p); - */ -static cset * -allocset(p) -register struct parse *p; -{ - register int no = p->g->ncsets++; - register size_t nc; - register size_t nbytes; - register cset *cs; - register size_t css = (size_t)p->g->csetsize; - register int i; - - if (no >= p->ncsalloc) { /* need another column of space */ - p->ncsalloc += CHAR_BIT; - nc = p->ncsalloc; - assert(nc % CHAR_BIT == 0); - nbytes = nc / CHAR_BIT * css; - if (p->g->sets == NULL) - p->g->sets = (cset *)malloc(nc * sizeof(cset)); - else - p->g->sets = (cset *)realloc((unsigned char *)p->g->sets, - nc * sizeof(cset)); - if (p->g->setbits == NULL) - p->g->setbits = (uch *)malloc(nbytes); - else { - p->g->setbits = (uch *)realloc((unsigned char *)p->g->setbits, - nbytes); - /* xxx this isn't right if setbits is now NULL */ - for (i = 0; i < no; i++) - p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT); - } - if (p->g->sets != NULL && p->g->setbits != NULL) - (void) memset((unsigned char *)p->g->setbits + (nbytes - css), - 0, css); - else { - no = 0; - SETERROR(REG_ESPACE); - /* caller's responsibility not to do set ops */ - } - } - - assert(p->g->sets != NULL); /* xxx */ - cs = &p->g->sets[no]; - cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); - cs->mask = 1 << ((no) % CHAR_BIT); - cs->hash = 0; - cs->smultis = 0; - cs->multis = NULL; - - return(cs); -} - -/* - - freeset - free a now-unused set - == static void freeset(register struct parse *p, register cset *cs); - */ -static void -freeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - CHsub(cs, i); - if (cs == top-1) /* recover only the easy case */ - p->g->ncsets--; -} - -/* - - freezeset - final processing on a set of characters - == static int freezeset(register struct parse *p, register cset *cs); - * - * The main task here is merging identical sets. This is usually a waste - * of time (although the hash code minimizes the overhead), but can win - * big if REG_ICASE is being used. REG_ICASE, by the way, is why the hash - * is done using addition rather than xor -- all ASCII [aA] sets xor to - * the same value! - */ -static int /* set number */ -freezeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register uch h = cs->hash; - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register cset *cs2; - register size_t css = (size_t)p->g->csetsize; - - /* look for an earlier one which is the same */ - for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) - if (cs2->hash == h && cs2 != cs) { - /* maybe */ - for (i = 0; i < css; i++) - if (!!CHIN(cs2, i) != !!CHIN(cs, i)) - break; /* no */ - if (i == css) - break; /* yes */ - } - - if (cs2 < top) { /* found one */ - freeset(p, cs); - cs = cs2; - } - - return((int)(cs - p->g->sets)); -} - -/* - - firstch - return first character in a set (which must have at least one) - == static int firstch(register struct parse *p, register cset *cs); - */ -static int /* character; there is no "none" value */ -firstch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - return((unsigned char)i); - assert(never); - return(0); /* arbitrary */ -} - -/* - - nch - number of characters in a set - == static int nch(register struct parse *p, register cset *cs); - */ -static int -nch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - register int n = 0; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - n++; - return(n); -} - -/* - - mcadd - add a collating element to a cset - == static void mcadd(register struct parse *p, register cset *cs, \ - == register char *cp); - */ -static void -mcadd(p, cs, cp) -register struct parse *p; -register cset *cs; -register unsigned char *cp; -{ - register size_t oldend = cs->smultis; - - cs->smultis += strlen(cp) + 1; - if (cs->multis == NULL) - cs->multis = malloc(cs->smultis); - else - cs->multis = realloc(cs->multis, cs->smultis); - if (cs->multis == NULL) { - SETERROR(REG_ESPACE); - return; - } - - (void) strcpy(cs->multis + oldend - 1, cp); - cs->multis[cs->smultis - 1] = '\0'; -} - -#if 0 -/* - - mcsub - subtract a collating element from a cset - == static void mcsub(register cset *cs, register unsigned char *cp); - */ -static void -mcsub(cs, cp) -register unsigned cset *cs; -register unsigned char *cp; -{ - register unsigned char *fp = mcfind(cs, cp); - register size_t len = strlen(fp); - - assert(fp != NULL); - (void) memmove(fp, fp + len + 1, - cs->smultis - (fp + len + 1 - cs->multis)); - cs->smultis -= len; - - if (cs->smultis == 0) { - free(cs->multis); - cs->multis = NULL; - return; - } - - cs->multis = realloc(cs->multis, cs->smultis); - assert(cs->multis != NULL); -} - -/* - - mcin - is a collating element in a cset? - == static int mcin(register cset *cs, register unsigned char *cp); - */ -static int -mcin(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - return(mcfind(cs, cp) != NULL); -} - - -/* - - mcfind - find a collating element in a cset - == static unsigned char *mcfind(register cset *cs, register unsigned char *cp); - */ -static unsigned char * -mcfind(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - register unsigned char *p; - - if (cs->multis == NULL) - return(NULL); - for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) - if (strcmp(cp, p) == 0) - return(p); - return(NULL); -} -#endif - -/* - - mcinvert - invert the list of collating elements in a cset - == static void mcinvert(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mcinvert(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - mccase - add case counterparts of the list of collating elements in a cset - == static void mccase(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mccase(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - isinsets - is this character in any sets? - == static int isinsets(register struct re_guts *g, int c); - */ -static int /* predicate */ -isinsets(g, c) -register struct re_guts *g; -int c; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc = (unsigned char)c; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc] != 0) - return(1); - return(0); -} - -/* - - samesets - are these two characters in exactly the same sets? - == static int samesets(register struct re_guts *g, int c1, int c2); - */ -static int /* predicate */ -samesets(g, c1, c2) -register struct re_guts *g; -int c1; -int c2; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc1 = (unsigned char)c1; - register unsigned uc2 = (unsigned char)c2; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc1] != col[uc2]) - return(0); - return(1); -} - -/* - - categorize - sort out character categories - == static void categorize(struct parse *p, register struct re_guts *g); - */ -static void -categorize(p, g) -struct parse *p; -register struct re_guts *g; -{ - register cat_t *cats = g->categories; - register int c; - register int c2; - register cat_t cat; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - for (c = 0; c <= UCHAR_MAX; c++) - if (cats[c] == 0 && isinsets(g, c)) { - cat = g->ncategories++; - cats[c] = cat; - for (c2 = c+1; c2 <= UCHAR_MAX; c2++) - if (cats[c2] == 0 && samesets(g, c, c2)) - cats[c2] = cat; - } -} - -/* - - dupl - emit a duplicate of a bunch of sops - == static sopno dupl(register struct parse *p, sopno start, sopno finish); - */ -static sopno /* start of duplicate */ -dupl(p, start, finish) -register struct parse *p; -sopno start; /* from here */ -sopno finish; /* to this less one */ -{ - register sopno ret = HERE(); - register sopno len = finish - start; - - assert(finish >= start); - if (len == 0) - return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); - (void) memcpy((char *)(p->strip + p->slen), - (char *)(p->strip + start), (size_t)len*sizeof(sop)); - p->slen += len; - return(ret); -} - -/* - - doemit - emit a strip operator - == static void doemit(register struct parse *p, sop op, size_t opnd); - * - * It might seem better to implement this as a macro with a function as - * hard-case backup, but it's just too big and messy unless there are - * some changes to the data structures. Maybe later. - */ -static void -doemit(p, op, opnd) -register struct parse *p; -sop op; -size_t opnd; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* deal with oversize operands ("can't happen", more or less) */ - assert(opnd < 1<slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); - - /* finally, it's all reduced to the easy case */ - p->strip[p->slen++] = SOP(op, opnd); -} - -/* - - doinsert - insert a sop into the strip - == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); - */ -static void -doinsert(p, op, opnd, pos) -register struct parse *p; -sop op; -size_t opnd; -sopno pos; -{ - register sopno sn; - register sop s; - register int i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - sn = HERE(); - EMIT(op, opnd); /* do checks, ensure space */ - assert(HERE() == sn+1); - s = p->strip[sn]; - - /* adjust paren pointers */ - assert(pos > 0); - for (i = 1; i < NPAREN; i++) { - if (p->pbegin[i] >= pos) { - p->pbegin[i]++; - } - if (p->pend[i] >= pos) { - p->pend[i]++; - } - } - - memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos], - (HERE()-pos-1)*sizeof(sop)); - p->strip[pos] = s; -} - -/* - - dofwd - complete a forward reference - == static void dofwd(register struct parse *p, sopno pos, sop value); - */ -static void -dofwd(p, pos, value) -register struct parse *p; -register sopno pos; -sop value; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - assert(value < 1<strip[pos] = OP(p->strip[pos]) | value; -} - -/* - - enlarge - enlarge the strip - == static void enlarge(register struct parse *p, sopno size); - */ -static void -enlarge(p, size) -register struct parse *p; -register sopno size; -{ - register sop *sp; - - if (p->ssize >= size) - return; - - sp = (sop *)realloc(p->strip, size*sizeof(sop)); - if (sp == NULL) { - SETERROR(REG_ESPACE); - return; - } - p->strip = sp; - p->ssize = size; -} - -/* - - stripsnug - compact the strip - == static void stripsnug(register struct parse *p, register struct re_guts *g); - */ -static void -stripsnug(p, g) -register struct parse *p; -register struct re_guts *g; -{ - g->nstates = p->slen; - g->strip = (sop *)realloc((unsigned char *)p->strip, p->slen * sizeof(sop)); - if (g->strip == NULL) { - SETERROR(REG_ESPACE); - g->strip = p->strip; - } -} - -/* - - findmust - fill in must and mlen with longest mandatory literal string - == static void findmust(register struct parse *p, register struct re_guts *g); - * - * This algorithm could do fancy things like analyzing the operands of | - * for common subsequences. Someday. This code is simple and finds most - * of the interesting cases. - * - * Note that must and mlen got initialized during setup. - */ -static void -findmust(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - sop *start = NULL; - register sop *newstart = NULL; - register sopno newlen; - register sop s; - register unsigned char *cp; - register sopno i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* find the longest OCHAR sequence in strip */ - newlen = 0; - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OCHAR: /* sequence member */ - if (newlen == 0) /* new sequence */ - newstart = scan - 1; - newlen++; - break; - case OPLUS_: /* things that don't break one */ - case OLPAREN: - case ORPAREN: - break; - case OQUEST_: /* things that must be skipped */ - case OCH_: - scan--; - do { - scan += OPND(s); - s = *scan; - /* assert() interferes w debug printouts */ - if (OP(s) != O_QUEST && OP(s) != O_CH && - OP(s) != OOR2) { - g->iflags |= BAD; - return; - } - } while (OP(s) != O_QUEST && OP(s) != O_CH); - /* fallthrough */ - default: /* things that break a sequence */ - if (newlen > g->mlen) { /* ends one */ - start = newstart; - g->mlen = newlen; - } - newlen = 0; - break; - } - } while (OP(s) != OEND); - - if (g->mlen == 0) /* there isn't one */ - return; - - /* turn it into a character string */ - g->must = malloc((size_t)g->mlen + 1); - if (g->must == NULL) { /* argh; just forget it */ - g->mlen = 0; - return; - } - cp = g->must; - scan = start; - for (i = g->mlen; i > 0; i--) { - while (OP(s = *scan++) != OCHAR) - continue; - assert(cp < g->must + g->mlen); - *cp++ = (unsigned char)OPND(s); - } - assert(cp == g->must + g->mlen); - *cp++ = '\0'; /* just on general principles */ -} - -/* - - pluscount - count + nesting - == static sopno pluscount(register struct parse *p, register struct re_guts *g); - */ -static sopno /* nesting depth */ -pluscount(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - register sop s; - register sopno plusnest = 0; - register sopno maxnest = 0; - - if (p->error != 0) - return(0); /* there may not be an OEND */ - - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OPLUS_: - plusnest++; - break; - case O_PLUS: - if (plusnest > maxnest) - maxnest = plusnest; - plusnest--; - break; - } - } while (OP(s) != OEND); - if (plusnest != 0) - g->iflags |= BAD; - return(maxnest); -} diff --git a/regex/regcomp.ih b/regex/regcomp.ih deleted file mode 100644 index c93d32e51d32e..0000000000000 --- a/regex/regcomp.ih +++ /dev/null @@ -1,53 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regcomp.c === */ -static void p_ere(register struct parse *p, int stop); -static void p_ere_exp(register struct parse *p); -static void p_str(register struct parse *p); -static void p_bre(register struct parse *p, register int end1, register int end2); -static int p_simp_re(register struct parse *p, int starordinary); -static int p_count(register struct parse *p); -static void p_bracket(register struct parse *p); -static void p_b_term(register struct parse *p, register cset *cs); -static void p_b_cclass(register struct parse *p, register cset *cs); -static void p_b_eclass(register struct parse *p, register cset *cs); -static unsigned char p_b_symbol(register struct parse *p); -static unsigned char p_b_coll_elem(register struct parse *p, int endc); -static unsigned char othercase(int ch); -static void bothcases(register struct parse *p, int ch); -static void ordinary(register struct parse *p, register int ch); -static void nonnewline(register struct parse *p); -static void repeat(register struct parse *p, sopno start, int from, int to); -static int seterr(register struct parse *p, int e); -static cset *allocset(register struct parse *p); -static void freeset(register struct parse *p, register cset *cs); -static int freezeset(register struct parse *p, register cset *cs); -static int firstch(register struct parse *p, register cset *cs); -static int nch(register struct parse *p, register cset *cs); -static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp); -#if 0 -static void mcsub(register cset *cs, register unsigned char *cp); -static int mcin(register cset *cs, register unsigned char *cp); -static unsigned char *mcfind(register cset *cs, register unsigned char *cp); -#endif -static void mcinvert(register struct parse *p, register cset *cs); -static void mccase(register struct parse *p, register cset *cs); -static int isinsets(register struct re_guts *g, int c); -static int samesets(register struct re_guts *g, int c1, int c2); -static void categorize(struct parse *p, register struct re_guts *g); -static sopno dupl(register struct parse *p, sopno start, sopno finish); -static void doemit(register struct parse *p, sop op, size_t opnd); -static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); -static void dofwd(register struct parse *p, sopno pos, sop value); -static void enlarge(register struct parse *p, sopno size); -static void stripsnug(register struct parse *p, register struct re_guts *g); -static void findmust(register struct parse *p, register struct re_guts *g); -static sopno pluscount(register struct parse *p, register struct re_guts *g); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/regerror.c b/regex/regerror.c deleted file mode 100644 index 6c8e064c4a57a..0000000000000 --- a/regex/regerror.c +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regerror.ih" - -/* - = #define REG_OKAY 0 - = #define REG_NOMATCH 1 - = #define REG_BADPAT 2 - = #define REG_ECOLLATE 3 - = #define REG_ECTYPE 4 - = #define REG_EESCAPE 5 - = #define REG_ESUBREG 6 - = #define REG_EBRACK 7 - = #define REG_EPAREN 8 - = #define REG_EBRACE 9 - = #define REG_BADBR 10 - = #define REG_ERANGE 11 - = #define REG_ESPACE 12 - = #define REG_BADRPT 13 - = #define REG_EMPTY 14 - = #define REG_ASSERT 15 - = #define REG_INVARG 16 - = #define REG_ATOI 255 // convert name to number (!) - = #define REG_ITOA 0400 // convert number to name (!) - */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - {REG_OKAY, "REG_OKAY", "no errors detected"}, - {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, - {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, - {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, - {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, - {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, - {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, - {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, - {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, - {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, - {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, - {REG_ERANGE, "REG_ERANGE", "invalid character range"}, - {REG_ESPACE, "REG_ESPACE", "out of memory"}, - {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, - {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, - {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, - {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, - {-1, "", "*** unknown regexp error code ***"}, -}; - -/* - - regerror - the interface to error numbers - = API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - */ -/* ARGSUSED */ -API_EXPORT(size_t) -regerror( -int errcode, -const regex_t *preg, -char *errbuf, -size_t errbuf_size) -{ - register struct rerr *r; - register size_t len; - register int target = errcode &~ REG_ITOA; - register char *s; - char convbuf[50]; - - if (errcode == REG_ATOI) - s = regatoi(preg, convbuf); - else { - for (r = rerrs; r->code >= 0; r++) - if (r->code == target) - break; - - if (errcode®_ITOA) { - if (r->code >= 0) - (void) strcpy(convbuf, r->name); - else - sprintf(convbuf, "REG_0x%x", target); - assert(strlen(convbuf) < sizeof(convbuf)); - s = convbuf; - } else - s = r->explain; - } - - len = strlen(s) + 1; - if (errbuf_size > 0) { - if (errbuf_size > len) - (void) strcpy(errbuf, s); - else { - (void) strncpy(errbuf, s, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return(len); -} - -/* - - regatoi - internal routine to implement REG_ATOI - == static char *regatoi(const regex_t *preg, char *localbuf); - */ -static char * -regatoi(preg, localbuf) -const regex_t *preg; -char *localbuf; -{ - register struct rerr *r; - - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, preg->re_endp) == 0) - break; - if (r->code < 0) - return("0"); - - sprintf(localbuf, "%d", r->code); - return(localbuf); -} diff --git a/regex/regerror.ih b/regex/regerror.ih deleted file mode 100644 index 2cb668c24f07e..0000000000000 --- a/regex/regerror.ih +++ /dev/null @@ -1,12 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regerror.c === */ -static char *regatoi(const regex_t *preg, char *localbuf); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/regex.3 b/regex/regex.3 deleted file mode 100644 index 100c8a7f71c72..0000000000000 --- a/regex/regex.3 +++ /dev/null @@ -1,502 +0,0 @@ -.TH REGEX 3 "17 May 1993" -.BY "Henry Spencer" -.de ZR -.\" one other place knows this name: the SEE ALSO section -.IR regex (7) \\$1 -.. -.SH NAME -regcomp, regexec, regerror, regfree \- regular-expression library -.SH SYNOPSIS -.ft B -.\".na -#include -.br -#include -.HP 10 -int regcomp(regex_t\ *preg, const\ char\ *pattern, int\ cflags); -.HP -int\ regexec(const\ regex_t\ *preg, const\ char\ *string, -size_t\ nmatch, regmatch_t\ pmatch[], int\ eflags); -.HP -size_t\ regerror(int\ errcode, const\ regex_t\ *preg, -char\ *errbuf, size_t\ errbuf_size); -.HP -void\ regfree(regex_t\ *preg); -.\".ad -.ft -.SH DESCRIPTION -These routines implement POSIX 1003.2 regular expressions (``RE''s); -see -.ZR . -.I Regcomp -compiles an RE written as a string into an internal form, -.I regexec -matches that internal form against a string and reports results, -.I regerror -transforms error codes from either into human-readable messages, -and -.I regfree -frees any dynamically-allocated storage used by the internal form -of an RE. -.PP -The header -.I -declares two structure types, -.I regex_t -and -.IR regmatch_t , -the former for compiled internal forms and the latter for match reporting. -It also declares the four functions, -a type -.IR regoff_t , -and a number of constants with names starting with ``REG_''. -.PP -.I Regcomp -compiles the regular expression contained in the -.I pattern -string, -subject to the flags in -.IR cflags , -and places the results in the -.I regex_t -structure pointed to by -.IR preg . -.I Cflags -is the bitwise OR of zero or more of the following flags: -.IP REG_EXTENDED \w'REG_EXTENDED'u+2n -Compile modern (``extended'') REs, -rather than the obsolete (``basic'') REs that -are the default. -.IP REG_BASIC -This is a synonym for 0, -provided as a counterpart to REG_EXTENDED to improve readability. -.IP REG_NOSPEC -Compile with recognition of all special characters turned off. -All characters are thus considered ordinary, -so the ``RE'' is a literal string. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -REG_EXTENDED and REG_NOSPEC may not be used -in the same call to -.IR regcomp . -.IP REG_ICASE -Compile for matching that ignores upper/lower case distinctions. -See -.ZR . -.IP REG_NOSUB -Compile for matching that need only report success or failure, -not what was matched. -.IP REG_NEWLINE -Compile for newline-sensitive matching. -By default, newline is a completely ordinary character with no special -meaning in either REs or strings. -With this flag, -`[^' bracket expressions and `.' never match newline, -a `^' anchor matches the null string after any newline in the string -in addition to its normal function, -and the `$' anchor matches the null string before any newline in the -string in addition to its normal function. -.IP REG_PEND -The regular expression ends, -not at the first NUL, -but just before the character pointed to by the -.I re_endp -member of the structure pointed to by -.IR preg . -The -.I re_endp -member is of type -.IR const\ char\ * . -This flag permits inclusion of NULs in the RE; -they are considered ordinary characters. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -When successful, -.I regcomp -returns 0 and fills in the structure pointed to by -.IR preg . -One member of that structure -(other than -.IR re_endp ) -is publicized: -.IR re_nsub , -of type -.IR size_t , -contains the number of parenthesized subexpressions within the RE -(except that the value of this member is undefined if the -REG_NOSUB flag was used). -If -.I regcomp -fails, it returns a non-zero error code; -see DIAGNOSTICS. -.PP -.I Regexec -matches the compiled RE pointed to by -.I preg -against the -.IR string , -subject to the flags in -.IR eflags , -and reports results using -.IR nmatch , -.IR pmatch , -and the returned value. -The RE must have been compiled by a previous invocation of -.IR regcomp . -The compiled form is not altered during execution of -.IR regexec , -so a single compiled RE can be used simultaneously by multiple threads. -.PP -By default, -the NUL-terminated string pointed to by -.I string -is considered to be the text of an entire line, minus any terminating -newline. -The -.I eflags -argument is the bitwise OR of zero or more of the following flags: -.IP REG_NOTBOL \w'REG_STARTEND'u+2n -The first character of -the string -is not the beginning of a line, so the `^' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_NOTEOL -The NUL terminating -the string -does not end a line, so the `$' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_STARTEND -The string is considered to start at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_so\fR -and to have a terminating NUL located at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_eo\fR -(there need not actually be a NUL at that location), -regardless of the value of -.IR nmatch . -See below for the definition of -.IR pmatch -and -.IR nmatch . -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Note that a non-zero \fIrm_so\fR does not imply REG_NOTBOL; -REG_STARTEND affects only the location of the string, -not how it is matched. -.PP -See -.ZR -for a discussion of what is matched in situations where an RE or a -portion thereof could match any of several substrings of -.IR string . -.PP -Normally, -.I regexec -returns 0 for success and the non-zero code REG_NOMATCH for failure. -Other non-zero error codes may be returned in exceptional situations; -see DIAGNOSTICS. -.PP -If REG_NOSUB was specified in the compilation of the RE, -or if -.I nmatch -is 0, -.I regexec -ignores the -.I pmatch -argument (but see below for the case where REG_STARTEND is specified). -Otherwise, -.I pmatch -points to an array of -.I nmatch -structures of type -.IR regmatch_t . -Such a structure has at least the members -.I rm_so -and -.IR rm_eo , -both of type -.I regoff_t -(a signed arithmetic type at least as large as an -.I off_t -and a -.IR ssize_t ), -containing respectively the offset of the first character of a substring -and the offset of the first character after the end of the substring. -Offsets are measured from the beginning of the -.I string -argument given to -.IR regexec . -An empty substring is denoted by equal offsets, -both indicating the character following the empty substring. -.PP -The 0th member of the -.I pmatch -array is filled in to indicate what substring of -.I string -was matched by the entire RE. -Remaining members report what substring was matched by parenthesized -subexpressions within the RE; -member -.I i -reports subexpression -.IR i , -with subexpressions counted (starting at 1) by the order of their opening -parentheses in the RE, left to right. -Unused entries in the array\(emcorresponding either to subexpressions that -did not participate in the match at all, or to subexpressions that do not -exist in the RE (that is, \fIi\fR\ > \fIpreg\fR\->\fIre_nsub\fR)\(emhave both -.I rm_so -and -.I rm_eo -set to \-1. -If a subexpression participated in the match several times, -the reported substring is the last one it matched. -(Note, as an example in particular, that when the RE `(b*)+' matches `bbb', -the parenthesized subexpression matches each of the three `b's and then -an infinite number of empty strings following the last `b', -so the reported substring is one of the empties.) -.PP -If REG_STARTEND is specified, -.I pmatch -must point to at least one -.I regmatch_t -(even if -.I nmatch -is 0 or REG_NOSUB was specified), -to hold the input offsets for REG_STARTEND. -Use for output is still entirely controlled by -.IR nmatch ; -if -.I nmatch -is 0 or REG_NOSUB was specified, -the value of -.IR pmatch [0] -will not be changed by a successful -.IR regexec . -.PP -.I Regerror -maps a non-zero -.I errcode -from either -.I regcomp -or -.I regexec -to a human-readable, printable message. -If -.I preg -is non-NULL, -the error code should have arisen from use of -the -.I regex_t -pointed to by -.IR preg , -and if the error code came from -.IR regcomp , -it should have been the result from the most recent -.I regcomp -using that -.IR regex_t . -.RI ( Regerror -may be able to supply a more detailed message using information -from the -.IR regex_t .) -.I Regerror -places the NUL-terminated message into the buffer pointed to by -.IR errbuf , -limiting the length (including the NUL) to at most -.I errbuf_size -bytes. -If the whole message won't fit, -as much of it as will fit before the terminating NUL is supplied. -In any case, -the returned value is the size of buffer needed to hold the whole -message (including terminating NUL). -If -.I errbuf_size -is 0, -.I errbuf -is ignored but the return value is still correct. -.PP -If the -.I errcode -given to -.I regerror -is first ORed with REG_ITOA, -the ``message'' that results is the printable name of the error code, -e.g. ``REG_NOMATCH'', -rather than an explanation thereof. -If -.I errcode -is REG_ATOI, -then -.I preg -shall be non-NULL and the -.I re_endp -member of the structure it points to -must point to the printable name of an error code; -in this case, the result in -.I errbuf -is the decimal digits of -the numeric value of the error code -(0 if the name is not recognized). -REG_ITOA and REG_ATOI are intended primarily as debugging facilities; -they are extensions, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Be warned also that they are considered experimental and changes are possible. -.PP -.I Regfree -frees any dynamically-allocated storage associated with the compiled RE -pointed to by -.IR preg . -The remaining -.I regex_t -is no longer a valid compiled RE -and the effect of supplying it to -.I regexec -or -.I regerror -is undefined. -.PP -None of these functions references global variables except for tables -of constants; -all are safe for use from multiple threads if the arguments are safe. -.SH IMPLEMENTATION CHOICES -There are a number of decisions that 1003.2 leaves up to the implementor, -either by explicitly saying ``undefined'' or by virtue of them being -forbidden by the RE grammar. -This implementation treats them as follows. -.PP -See -.ZR -for a discussion of the definition of case-independent matching. -.PP -There is no particular limit on the length of REs, -except insofar as memory is limited. -Memory usage is approximately linear in RE size, and largely insensitive -to RE complexity, except for bounded repetitions. -See BUGS for one short RE using them -that will run almost any system out of memory. -.PP -A backslashed character other than one specifically given a magic meaning -by 1003.2 (such magic meanings occur only in obsolete [``basic''] REs) -is taken as an ordinary character. -.PP -Any unmatched [ is a REG_EBRACK error. -.PP -Equivalence classes cannot begin or end bracket-expression ranges. -The endpoint of one range cannot begin another. -.PP -RE_DUP_MAX, the limit on repetition counts in bounded repetitions, is 255. -.PP -A repetition operator (?, *, +, or bounds) cannot follow another -repetition operator. -A repetition operator cannot begin an expression or subexpression -or follow `^' or `|'. -.PP -`|' cannot appear first or last in a (sub)expression or after another `|', -i.e. an operand of `|' cannot be an empty subexpression. -An empty parenthesized subexpression, `()', is legal and matches an -empty (sub)string. -An empty string is not a legal RE. -.PP -A `{' followed by a digit is considered the beginning of bounds for a -bounded repetition, which must then follow the syntax for bounds. -A `{' \fInot\fR followed by a digit is considered an ordinary character. -.PP -`^' and `$' beginning and ending subexpressions in obsolete (``basic'') -REs are anchors, not ordinary characters. -.SH SEE ALSO -grep(1), regex(7) -.PP -POSIX 1003.2, sections 2.8 (Regular Expression Notation) -and -B.5 (C Binding for Regular Expression Matching). -.SH DIAGNOSTICS -Non-zero error codes from -.I regcomp -and -.I regexec -include the following: -.PP -.nf -.ta \w'REG_ECOLLATE'u+3n -REG_NOMATCH regexec() failed to match -REG_BADPAT invalid regular expression -REG_ECOLLATE invalid collating element -REG_ECTYPE invalid character class -REG_EESCAPE \e applied to unescapable character -REG_ESUBREG invalid backreference number -REG_EBRACK brackets [ ] not balanced -REG_EPAREN parentheses ( ) not balanced -REG_EBRACE braces { } not balanced -REG_BADBR invalid repetition count(s) in { } -REG_ERANGE invalid character range in [ ] -REG_ESPACE ran out of memory -REG_BADRPT ?, *, or + operand invalid -REG_EMPTY empty (sub)expression -REG_ASSERT ``can't happen''\(emyou found a bug -REG_INVARG invalid argument, e.g. negative-length string -.fi -.SH HISTORY -Written by Henry Spencer at University of Toronto, -henry@zoo.toronto.edu. -.SH BUGS -This is an alpha release with known defects. -Please report problems. -.PP -There is one known functionality bug. -The implementation of internationalization is incomplete: -the locale is always assumed to be the default one of 1003.2, -and only the collating elements etc. of that locale are available. -.PP -The back-reference code is subtle and doubts linger about its correctness -in complex cases. -.PP -.I Regexec -performance is poor. -This will improve with later releases. -.I Nmatch -exceeding 0 is expensive; -.I nmatch -exceeding 1 is worse. -.I Regexec -is largely insensitive to RE complexity \fIexcept\fR that back -references are massively expensive. -RE length does matter; in particular, there is a strong speed bonus -for keeping RE length under about 30 characters, -with most special characters counting roughly double. -.PP -.I Regcomp -implements bounded repetitions by macro expansion, -which is costly in time and space if counts are large -or bounded repetitions are nested. -An RE like, say, -`((((a{1,100}){1,100}){1,100}){1,100}){1,100}' -will (eventually) run almost any existing machine out of swap space. -.PP -There are suspected problems with response to obscure error conditions. -Notably, -certain kinds of internal overflow, -produced only by truly enormous REs or by multiply nested bounded repetitions, -are probably not handled well. -.PP -Due to a mistake in 1003.2, things like `a)b' are legal REs because `)' is -a special character only in the presence of a previous unmatched `('. -This can't be fixed until the spec is fixed. -.PP -The standard's definition of back references is vague. -For example, does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'? -Until the standard is clarified, -behavior in such cases should not be relied on. -.PP -The implementation of word-boundary matching is a bit of a kludge, -and bugs may lurk in combinations of word-boundary matching and anchoring. diff --git a/regex/regex.7 b/regex/regex.7 deleted file mode 100644 index d89012bda1dcd..0000000000000 --- a/regex/regex.7 +++ /dev/null @@ -1,233 +0,0 @@ -.TH REGEX 7 "7 Feb 1994" -.BY "Henry Spencer" -.SH NAME -regex \- POSIX 1003.2 regular expressions -.SH DESCRIPTION -Regular expressions (``RE''s), -as defined in POSIX 1003.2, come in two forms: -modern REs (roughly those of -.IR egrep ; -1003.2 calls these ``extended'' REs) -and obsolete REs (roughly those of -.IR ed ; -1003.2 ``basic'' REs). -Obsolete REs mostly exist for backward compatibility in some old programs; -they will be discussed at the end. -1003.2 leaves some aspects of RE syntax and semantics open; -`\(dg' marks decisions on these aspects that -may not be fully portable to other 1003.2 implementations. -.PP -A (modern) RE is one\(dg or more non-empty\(dg \fIbranches\fR, -separated by `|'. -It matches anything that matches one of the branches. -.PP -A branch is one\(dg or more \fIpieces\fR, concatenated. -It matches a match for the first, followed by a match for the second, etc. -.PP -A piece is an \fIatom\fR possibly followed -by a single\(dg `*', `+', `?', or \fIbound\fR. -An atom followed by `*' matches a sequence of 0 or more matches of the atom. -An atom followed by `+' matches a sequence of 1 or more matches of the atom. -An atom followed by `?' matches a sequence of 0 or 1 matches of the atom. -.PP -A \fIbound\fR is `{' followed by an unsigned decimal integer, -possibly followed by `,' -possibly followed by another unsigned decimal integer, -always followed by `}'. -The integers must lie between 0 and RE_DUP_MAX (255\(dg) inclusive, -and if there are two of them, the first may not exceed the second. -An atom followed by a bound containing one integer \fIi\fR -and no comma matches -a sequence of exactly \fIi\fR matches of the atom. -An atom followed by a bound -containing one integer \fIi\fR and a comma matches -a sequence of \fIi\fR or more matches of the atom. -An atom followed by a bound -containing two integers \fIi\fR and \fIj\fR matches -a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. -.PP -An atom is a regular expression enclosed in `()' (matching a match for the -regular expression), -an empty set of `()' (matching the null string)\(dg, -a \fIbracket expression\fR (see below), `.' -(matching any single character), `^' (matching the null string at the -beginning of a line), `$' (matching the null string at the -end of a line), a `\e' followed by one of the characters -`^.[$()|*+?{\e' -(matching that character taken as an ordinary character), -a `\e' followed by any other character\(dg -(matching that character taken as an ordinary character, -as if the `\e' had not been present\(dg), -or a single character with no other significance (matching that character). -A `{' followed by a character other than a digit is an ordinary -character, not the beginning of a bound\(dg. -It is illegal to end an RE with `\e'. -.PP -A \fIbracket expression\fR is a list of characters enclosed in `[]'. -It normally matches any single character from the list (but see below). -If the list begins with `^', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -If two characters in the list are separated by `\-', this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. `[0-9]' in ASCII matches any decimal digit. -It is illegal\(dg for two ranges to share an -endpoint, e.g. `a-c-e'. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal `]' in the list, make it the first character -(following a possible `^'). -To include a literal `\-', make it the first or last character, -or the second endpoint of a range. -To use a literal `\-' as the first endpoint of a range, -enclose it in `[.' and `.]' to make it a collating element (see below). -With the exception of these and some combinations using `[' (see next -paragraphs), all other special characters, including `\e', lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in `[.' and `.]' stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression containing a multi-character collating element -can thus match more than one character, -e.g. if the collating sequence includes a `ch' collating element, -then the RE `[[.ch.]]*c' matches the first five characters -of `chchcc'. -.PP -Within a bracket expression, a collating element enclosed in `[=' and -`=]' is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `[.' and `.]'.) -For example, if o and \o'o^' are the members of an equivalence class, -then `[[=o=]]', `[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous. -An equivalence class may not\(dg be an endpoint -of a range. -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in `[:' and `:]' stands for the list of all characters belonging to that -class. -Standard character class names are: -.PP -.RS -.nf -.ta 3c 6c 9c -alnum digit punct -alpha graph space -blank lower upper -cntrl print xdigit -.fi -.RE -.PP -These stand for the character classes defined in -.IR ctype (3). -A locale may provide others. -A character class may not be used as an endpoint of a range. -.PP -There are two special cases\(dg of bracket expressions: -the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at -the beginning and end of a word respectively. -A word is defined as a sequence of -word characters -which is neither preceded nor followed by -word characters. -A word character is an -.I alnum -character (as defined by -.IR ctype (3)) -or an underscore. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -it matches the longest. -Subexpressions also match the longest possible substrings, subject to -the constraint that the whole match be as long as possible, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that higher-level subexpressions thus take priority over -their lower-level component subexpressions. -.PP -Match lengths are measured in characters, not collating elements. -A null string is considered longer than no match at all. -For example, -`bb*' matches the three middle characters of `abbbc', -`(wee|week)(knights|nights)' matches all ten characters of `weeknights', -when `(.*).*' is matched against `abc' the parenthesized subexpression -matches all three characters, and -when `(a*)*' is matched against `bc' both the whole RE and the parenthesized -subexpression match the null string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -e.g. `x' becomes `[xX]'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that (e.g.) `[x]' -becomes `[xX]' and `[^x]' becomes `[^xX]'. -.PP -No particular limit is imposed on the length of REs\(dg. -Programs intended to be portable should not employ REs longer -than 256 bytes, -as an implementation can refuse to accept such REs and remain -POSIX-compliant. -.PP -Obsolete (``basic'') regular expressions differ in several respects. -`|', `+', and `?' are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are `\e{' and `\e}', -with `{' and `}' by themselves ordinary characters. -The parentheses for nested subexpressions are `\e(' and `\e)', -with `(' and `)' by themselves ordinary characters. -`^' is an ordinary character except at the beginning of the -RE or\(dg the beginning of a parenthesized subexpression, -`$' is an ordinary character except at the end of the -RE or\(dg the end of a parenthesized subexpression, -and `*' is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `^'). -Finally, there is one new type of atom, a \fIback reference\fR: -`\e' followed by a non-zero decimal digit \fId\fR -matches the same sequence of characters -matched by the \fId\fRth parenthesized subexpression -(numbering subexpressions by the positions of their opening parentheses, -left to right), -so that (e.g.) `\e([bc]\e)\e1' matches `bb' or `cc' but not `bc'. -.SH SEE ALSO -regex(3) -.PP -POSIX 1003.2, section 2.8 (Regular Expression Notation). -.SH BUGS -Having two kinds of REs is a botch. -.PP -The current 1003.2 spec says that `)' is an ordinary character in -the absence of an unmatched `('; -this was an unintentional result of a wording error, -and change is likely. -Avoid relying on it. -.PP -Back references are a dreadful botch, -posing major problems for efficient implementations. -They are also somewhat vaguely defined -(does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?). -Avoid using them. -.PP -1003.2's specification of case-independent matching is vague. -The ``one case implies all cases'' definition given above -is current consensus among implementors as to the right interpretation. -.PP -The syntax for word boundaries is incredibly ugly. diff --git a/regex/regex.dsp b/regex/regex.dsp deleted file mode 100644 index e8f1ad42995e4..0000000000000 --- a/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/regex/regex.dsw b/regex/regex.dsw deleted file mode 100644 index 7b7df8126c4b5..0000000000000 --- a/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/regex/regex.h b/regex/regex.h deleted file mode 100644 index b39c5e178c6b7..0000000000000 --- a/regex/regex.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _HSREGEX_H_ -#define _HSREGEX_H_ -#ifndef _HSREGEX_H -#define _HSREGEX_H /* never again */ -/* ========= begin header generated by ././mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regex2.h === */ -#ifdef WIN32 -#define API_EXPORT(type) __declspec(dllexport) type __stdcall -#else -#define API_EXPORT(type) type -#endif - -typedef off_t regoff_t; -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - - -/* === regcomp.c === */ -API_EXPORT(int) regcomp(regex_t *, const char *, int); -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - - -/* === regerror.c === */ -#define REG_OKAY 0 -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ -API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - - -/* === regexec.c === */ -API_EXPORT(int) regexec(const regex_t *, const char *, size_t, regmatch_t [], int); -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - - -/* === regfree.c === */ -API_EXPORT(void) regfree(regex_t *); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ././mkh ========= */ -#endif -#endif diff --git a/regex/regex.mak b/regex/regex.mak deleted file mode 100644 index b87ded340b396..0000000000000 --- a/regex/regex.mak +++ /dev/null @@ -1,304 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on regex.dsp -!IF "$(CFG)" == "" -CFG=regex - Win32 Release -!MESSAGE No configuration specified. Defaulting to regex - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "regex - Win32 Release" && "$(CFG)" != "regex - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Release/ -CPP_SBRS=. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regcomp.sbr" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regerror.sbr" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regexec.sbr" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\regfree.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.bsc" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "." /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\Debug/ -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - "$(INTDIR)\regcomp.sbr" \ - "$(INTDIR)\regerror.sbr" \ - "$(INTDIR)\regexec.sbr" \ - "$(INTDIR)\regfree.sbr" - -"$(OUTDIR)\regex.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(CFG)" == "regex - Win32 Release" || "$(CFG)" == "regex - Win32 Debug" -SOURCE=.\regcomp.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regcomp.obj" : $(SOURCE) $(DEP_CPP_REGCO) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regcomp.obj" "$(INTDIR)\regcomp.sbr" : $(SOURCE) $(DEP_CPP_REGCO)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regerror.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regerror.obj" : $(SOURCE) $(DEP_CPP_REGER) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regerror.obj" "$(INTDIR)\regerror.sbr" : $(SOURCE) $(DEP_CPP_REGER)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regexec.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regexec.obj" : $(SOURCE) $(DEP_CPP_REGEX) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regexec.obj" "$(INTDIR)\regexec.sbr" : $(SOURCE) $(DEP_CPP_REGEX)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regfree.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regfree.obj" : $(SOURCE) $(DEP_CPP_REGFR) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regfree.obj" "$(INTDIR)\regfree.sbr" : $(SOURCE) $(DEP_CPP_REGFR)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\engine.c - -!ENDIF - diff --git a/regex/regex2.h b/regex/regex2.h deleted file mode 100644 index 4996f96ecd354..0000000000000 --- a/regex/regex2.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * First, the stuff that ends up in the outside-world include file - = #ifdef WIN32 - = #define API_EXPORT(type) __declspec(dllexport) type __stdcall - = #else - = #define API_EXPORT(type) type - = #endif - = - = typedef off_t regoff_t; - = typedef struct { - = int re_magic; - = size_t re_nsub; // number of parenthesized subexpressions - = const unsigned char *re_endp; // end pointer for REG_PEND - = struct re_guts *re_g; // none of your business :-) - = } regex_t; - = typedef struct { - = regoff_t rm_so; // start of match - = regoff_t rm_eo; // end of match - = } regmatch_t; - */ -/* - * internals of regex_t - */ -#define MAGIC1 ((('r'^0200)<<8) | 'e') - -/* - * The internal representation is a *strip*, a sequence of - * operators ending with an endmarker. (Some terminology etc. is a - * historical relic of earlier versions which used multiple strips.) - * Certain oddities in the representation are there to permit running - * the machinery backwards; in particular, any deviation from sequential - * flow must be marked at both its source and its destination. Some - * fine points: - * - * - OPLUS_ and O_PLUS are *inside* the loop they create. - * - OQUEST_ and O_QUEST are *outside* the bypass they create. - * - OCH_ and O_CH are *outside* the multi-way branch they create, while - * OOR1 and OOR2 are respectively the end and the beginning of one of - * the branches. Note that there is an implicit OOR2 following OCH_ - * and an implicit OOR1 preceding O_CH. - * - * In state representations, an operator's bit is on to signify a state - * immediately *preceding* "execution" of that operator. - */ -typedef long sop; /* strip operator */ -typedef long sopno; -#define OPRMASK 0x7c000000 -#define OPDMASK 0x03ffffff -#define OPSHIFT (26) -#define OP(n) ((n)&OPRMASK) -#define OPND(n) ((n)&OPDMASK) -#define SOP(op, opnd) ((op)|(opnd)) -/* operators meaning operand */ -/* (back, fwd are offsets) */ -#define OEND (1< uch [csetsize] */ - uch mask; /* bit within array */ - uch hash; /* hash code */ - size_t smultis; - unsigned char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ -} cset; -/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ -#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c)) -#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c)) -#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) -#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ -#define MCsub(p, cs, cp) mcsub(p, cs, cp) -#define MCin(p, cs, cp) mcin(p, cs, cp) - -/* stuff for character categories */ -typedef unsigned char cat_t; - -/* - * main compiled-expression structure - */ -struct re_guts { - int magic; -# define MAGIC2 ((('R'^0200)<<8)|'E') - sop *strip; /* malloced area for strip */ - int csetsize; /* number of bits in a cset vector */ - int ncsets; /* number of csets in use */ - cset *sets; /* -> cset [ncsets] */ - uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ - int cflags; /* copy of regcomp() cflags argument */ - sopno nstates; /* = number of sops */ - sopno firststate; /* the initial OEND (normally 0) */ - sopno laststate; /* the final OEND */ - int iflags; /* internal flags */ -# define USEBOL 01 /* used ^ */ -# define USEEOL 02 /* used $ */ -# define BAD 04 /* something wrong */ - int nbol; /* number of ^ used */ - int neol; /* number of $ used */ - int ncategories; /* how many character categories */ - cat_t *categories; /* ->catspace[-UCHAR_MIN] */ - unsigned char *must; /* match must contain this string */ - int mlen; /* length of must */ - size_t nsub; /* copy of re_nsub */ - int backrefs; /* does it use back references? */ - sopno nplus; /* how deep does it nest +s? */ - /* catspace must be last */ - cat_t catspace[1]; /* actually [NC] */ -}; - -/* misc utilities */ -#define OUT (UCHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum(c) || (c) == '_') diff --git a/regex/regex_extra.h b/regex/regex_extra.h deleted file mode 100644 index d668f7613f8d4..0000000000000 --- a/regex/regex_extra.h +++ /dev/null @@ -1,23 +0,0 @@ -/* do not frame this - we must be able to include this file multiple times */ - -#undef regexec -#undef regerror -#undef regfree -#undef regcomp - -#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX)) - -#ifndef PHP_WIN32 - -#ifndef PHP_NO_ALIASES - -#define regexec php_regexec -#define regerror php_regerror -#define regfree php_regfree -#define regcomp php_regcomp - -#endif - -#endif - -#endif diff --git a/regex/regexec.c b/regex/regexec.c deleted file mode 100644 index bbfe094c96ca2..0000000000000 --- a/regex/regexec.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * the outer shell of regexec() - * - * This file includes engine.c *twice*, after muchos fiddling with the - * macros that code uses. This lets the same code operate on two different - * representations for state sets. - */ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -#define PHP_REGEX_NOPE 0; /* for use in asserts; shuts lint up */ - -/* macros for manipulating states, small version */ -#define states unsigned -#define states1 unsigned /* for later use in regexec() decision */ -#define CLEAR(v) ((v) = 0) -#define SET0(v, n) ((v) &= ~((unsigned)1 << (n))) -#define SET1(v, n) ((v) |= (unsigned)1 << (n)) -#define ISSET(v, n) ((v) & ((unsigned)1 << (n))) -#define ASSIGN(d, s) ((d) = (s)) -#define EQ(a, b) ((a) == (b)) -#define STATEVARS int dummy /* dummy version */ -#define STATESETUP(m, n) /* nothing */ -#define STATETEARDOWN(m) /* nothing */ -#define SETUP(v) ((v) = 0) -#define onestate unsigned -#define INIT(o, n) ((o) = (unsigned)1 << (n)) -#define INC(o) ((o) <<= 1) -#define ISSTATEIN(v, o) ((v) & (o)) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) << (n)) -#define BACK(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) >> (n)) -#define ISSETBACK(v, n) ((v) & ((unsigned)here >> (n))) -/* function names */ -#define SNAMES /* engine.c looks after details */ - -#include "engine.c" - -/* now undo things */ -#undef states -#undef CLEAR -#undef SET0 -#undef SET1 -#undef ISSET -#undef ASSIGN -#undef EQ -#undef STATEVARS -#undef STATESETUP -#undef STATETEARDOWN -#undef SETUP -#undef onestate -#undef INIT -#undef INC -#undef ISSTATEIN -#undef FWD -#undef BACK -#undef ISSETBACK -#undef SNAMES - -/* macros for manipulating states, large version */ -#define states unsigned char * -#define CLEAR(v) memset(v, 0, m->g->nstates) -#define SET0(v, n) ((v)[n] = 0) -#define SET1(v, n) ((v)[n] = 1) -#define ISSET(v, n) ((v)[n]) -#define ASSIGN(d, s) memcpy(d, s, m->g->nstates) -#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) -#define STATEVARS int vn; unsigned char *space -#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \ - if ((m)->space == NULL) return(REG_ESPACE); \ - (m)->vn = 0; } -#define STATETEARDOWN(m) { free((m)->space); } -#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) -#define onestate int -#define INIT(o, n) ((o) = (n)) -#define INC(o) ((o)++) -#define ISSTATEIN(v, o) ((v)[o]) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst)[here+(n)] |= (src)[here]) -#define BACK(dst, src, n) ((dst)[here-(n)] |= (src)[here]) -#define ISSETBACK(v, n) ((v)[here - (n)]) -/* function names */ -#define LNAMES /* flag */ - -#include "engine.c" - -/* - - regexec - interface for matching - = API_EXPORT(int) regexec(const regex_t *, const char *, size_t, \ - = regmatch_t [], int); - = #define REG_NOTBOL 00001 - = #define REG_NOTEOL 00002 - = #define REG_STARTEND 00004 - = #define REG_TRACE 00400 // tracing of execution - = #define REG_LARGE 01000 // force large representation - = #define REG_BACKR 02000 // force use of backref code - * - * We put this here so we can exploit knowledge of the state representation - * when choosing which matcher to call. Also, by this point the matchers - * have been prototyped. - */ -API_EXPORT(int) /* 0 success, REG_NOMATCH failure */ -regexec(preg, string, nmatch, pmatch, eflags) -const regex_t *preg; -const char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register struct re_guts *g = preg->re_g; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND)) -#endif - - if (preg->re_magic != MAGIC1 || g->magic != MAGIC2) - return(REG_BADPAT); - assert(!(g->iflags&BAD)); - if (g->iflags&BAD) /* backstop for no-debug case */ - return(REG_BADPAT); - eflags = GOODFLAGS(eflags); - - if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); - else - return(lmatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); -} diff --git a/regex/regfree.c b/regex/regfree.c deleted file mode 100644 index 9fd618a13b83a..0000000000000 --- a/regex/regfree.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -/* - - regfree - free everything - = API_EXPORT(void) regfree(regex_t *); - */ -API_EXPORT(void) -regfree(preg) -regex_t *preg; -{ - register struct re_guts *g; - - if (preg->re_magic != MAGIC1) /* oops */ - return; /* nice to complain, but hard */ - - g = preg->re_g; - if (g == NULL || g->magic != MAGIC2) /* oops again */ - return; - preg->re_magic = 0; /* mark it invalid */ - g->magic = 0; /* mark it invalid */ - - if (g->strip != NULL) - free((char *)g->strip); - if (g->sets != NULL) - free((char *)g->sets); - if (g->setbits != NULL) - free((char *)g->setbits); - if (g->must != NULL) - free(g->must); - free((char *)g); -} diff --git a/regex/split.c b/regex/split.c deleted file mode 100644 index 188bdb775b9ff..0000000000000 --- a/regex/split.c +++ /dev/null @@ -1,316 +0,0 @@ -#include -#include - -/* - - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); - */ -int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ -{ - register char *p = string; - register char c; /* latest character */ - register char sepc = sep[0]; - register char sepc2; - register int fn; - register char **fp = fields; - register char *sepp; - register int trimtrail; - - /* white space */ - if (sepc == '\0') { - while ((c = *p++) == ' ' || c == '\t') - continue; - p--; - trimtrail = 1; - sep = " \t"; /* note, code below knows this is 2 long */ - sepc = ' '; - } else - trimtrail = 0; - sepc2 = sep[1]; /* now we can safely pick this up */ - - /* catch empties */ - if (*p == '\0') - return(0); - - /* single separator */ - if (sepc2 == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - if (fn == 0) - break; - while ((c = *p++) != sepc) - if (c == '\0') - return(nfields - fn); - *(p-1) = '\0'; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - for (;;) { - while ((c = *p++) != sepc) - if (c == '\0') - return(fn); - fn++; - } - /* not reached */ - } - - /* two separators */ - if (sep[2] == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - while ((c = *p++) != sepc && c != sepc2) - if (c == '\0') { - if (trimtrail && **(fp-1) == '\0') - fn++; - return(nfields - fn); - } - if (fn == 0) - break; - *(p-1) = '\0'; - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - while (c != '\0') { - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - fn++; - while ((c = *p++) != '\0' && c != sepc && c != sepc2) - continue; - } - /* might have to trim trailing white space */ - if (trimtrail) { - p--; - while ((c = *--p) == sepc || c == sepc2) - continue; - p++; - if (*p != '\0') { - if (fn == nfields+1) - *p = '\0'; - fn--; - } - } - return(fn); - } - - /* n separators */ - fn = 0; - for (;;) { - if (fn < nfields) - *fp++ = p; - fn++; - for (;;) { - c = *p++; - if (c == '\0') - return(fn); - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc != '\0') /* it was a separator */ - break; - } - if (fn < nfields) - *(p-1) = '\0'; - for (;;) { - c = *p++; - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc == '\0') /* it wasn't a separator */ - break; - } - p--; - } - - /* not reached */ -} - -#ifdef TEST_SPLIT - - -/* - * test program - * pgm runs regression - * pgm sep splits stdin lines by sep - * pgm str sep splits str by sep - * pgm str sep n splits str by sep n times - */ -int -main(argc, argv) -int argc; -char *argv[]; -{ - char buf[512]; - register int n; -# define MNF 10 - char *fields[MNF]; - - if (argc > 4) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - } - else if (argc > 3) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - (void) split(buf, fields, MNF, argv[2]); - } - else if (argc > 2) - dosplit(argv[1], argv[2]); - else if (argc > 1) - while (fgets(buf, sizeof(buf), stdin) != NULL) { - buf[strlen(buf)-1] = '\0'; /* stomp newline */ - dosplit(buf, argv[1]); - } - else - regress(); - - exit(0); -} - -dosplit(string, seps) -char *string; -char *seps; -{ -# define NF 5 - char *fields[NF]; - register int nf; - - nf = split(string, fields, NF, seps); - print(nf, NF, fields); -} - -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; -{ - register int fn; - register int bound; - - bound = (nf > nfp) ? nfp : nf; - printf("%d:\t", nf); - for (fn = 0; fn < bound; fn++) - printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n"); -} - -#define RNF 5 /* some table entries know this */ -struct { - char *str; - char *seps; - int nf; - char *fi[RNF]; -} tests[] = { - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 5, { "abc", "def", "", "g", "" }, - " a bcd", " ", 4, { "", "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", " _", 0, { "" }, - " ", " _", 2, { "", "" }, - "x", " _", 1, { "x" }, - "x y", " _", 2, { "x", "y" }, - "ab _ cd", " _", 2, { "ab", "cd" }, - " a_b c ", " _", 5, { "", "a", "b", "c", "" }, - "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " _", 6, { "", "a", "b", "c", "d " }, - - "", " _~", 0, { "" }, - " ", " _~", 2, { "", "" }, - "x", " _~", 1, { "x" }, - "x y", " _~", 2, { "x", "y" }, - "ab _~ cd", " _~", 2, { "ab", "cd" }, - " a_b c~", " _~", 5, { "", "a", "b", "c", "" }, - "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" }, - "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " }, - - "", " _~-", 0, { "" }, - " ", " _~-", 2, { "", "" }, - "x", " _~-", 1, { "x" }, - "x y", " _~-", 2, { "x", "y" }, - "ab _~- cd", " _~-", 2, { "ab", "cd" }, - " a_b c~", " _~-", 5, { "", "a", "b", "c", "" }, - "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" }, - "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " }, - - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 4, { "abc", "def", "g", "" }, - " a bcd", " ", 3, { "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", "", 0, { "" }, - " ", "", 0, { "" }, - "x", "", 1, { "x" }, - "xy", "", 1, { "xy" }, - "x y", "", 2, { "x", "y" }, - "abc def g ", "", 3, { "abc", "def", "g" }, - "\t a bcd", "", 2, { "a", "bcd" }, - " a \tb\t c ", "", 3, { "a", "b", "c" }, - "a b c d e ", "", 5, { "a", "b", "c", "d", "e" }, - "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" }, - " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " }, - - NULL, NULL, 0, { NULL }, -}; - -regress() -{ - char buf[512]; - register int n; - char *fields[RNF+1]; - register int nf; - register int i; - register int printit; - register char *f; - - for (n = 0; tests[n].str != NULL; n++) { - (void) strcpy(buf, tests[n].str); - fields[RNF] = NULL; - nf = split(buf, fields, RNF, tests[n].seps); - printit = 0; - if (nf != tests[n].nf) { - printf("split `%s' by `%s' gave %d fields, not %d\n", - tests[n].str, tests[n].seps, nf, tests[n].nf); - printit = 1; - } else if (fields[RNF] != NULL) { - printf("split() went beyond array end\n"); - printit = 1; - } else { - for (i = 0; i < nf && i < RNF; i++) { - f = fields[i]; - if (f == NULL) - f = "(NULL)"; - if (strcmp(f, tests[n].fi[i]) != 0) { - printf("split `%s' by `%s', field %d is `%s', not `%s'\n", - tests[n].str, tests[n].seps, - i, fields[i], tests[n].fi[i]); - printit = 1; - } - } - } - if (printit) - print(nf, RNF, fields); - } -} -#endif diff --git a/regex/tests b/regex/tests deleted file mode 100644 index c05846177f594..0000000000000 --- a/regex/tests +++ /dev/null @@ -1,475 +0,0 @@ -# regular expression test set -# Lines are at least three fields, separated by one or more tabs. "" stands -# for an empty field. First field is an RE. Second field is flags. If -# C flag given, regcomp() is expected to fail, and the third field is the -# error name (minus the leading REG_). -# -# Otherwise it is expected to succeed, and the third field is the string to -# try matching it against. If there is no fourth field, the match is -# expected to fail. If there is a fourth field, it is the substring that -# the RE is expected to match. If there is a fifth field, it is a comma- -# separated list of what the subexpressions should match, with - indicating -# no match for that one. In both the fourth and fifth fields, a (sub)field -# starting with @ indicates that the (sub)expression is expected to match -# a null string followed by the stuff after the @; this provides a way to -# test where null strings match. The character `N' in REs and strings -# is newline, `S' is space, `T' is tab, `Z' is NUL. -# -# The full list of flags: -# - placeholder, does nothing -# b RE is a BRE, not an ERE -# & try it as both an ERE and a BRE -# C regcomp() error expected, third field is error name -# i REG_ICASE -# m ("mundane") REG_NOSPEC -# s REG_NOSUB (not really testable) -# n REG_NEWLINE -# ^ REG_NOTBOL -# $ REG_NOTEOL -# # REG_STARTEND (see below) -# p REG_PEND -# -# For REG_STARTEND, the start/end offsets are those of the substring -# enclosed in (). - -# basics -a & a a -abc & abc abc -abc|de - abc abc -a|b|c - abc a - -# parentheses and perversions thereof -a(b)c - abc abc -a\(b\)c b abc abc -a( C EPAREN -a( b a( a( -a\( - a( a( -a\( bC EPAREN -a\(b bC EPAREN -a(b C EPAREN -a(b b a(b a(b -# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly) -a) - a) a) -) - ) ) -# end gagging (in a just world, those *should* give EPAREN) -a) b a) a) -a\) bC EPAREN -\) bC EPAREN -a()b - ab ab -a\(\)b b ab ab - -# anchoring and REG_NEWLINE -^abc$ & abc abc -a^b - a^b -a^b b a^b a^b -a$b - a$b -a$b b a$b a$b -^ & abc @abc -$ & abc @ -^$ & "" @ -$^ - "" @ -\($\)\(^\) b "" @ -# stop retching, those are legitimate (although disgusting) -^^ - "" @ -$$ - "" @ -b$ & abNc -b$ &n abNc b -^b$ & aNbNc -^b$ &n aNbNc b -^$ &n aNNb @Nb -^$ n abc -^$ n abcN @ -$^ n aNNb @Nb -\($\)\(^\) bn aNNb @Nb -^^ n^ aNNb @Nb -$$ n aNNb @NN -^a ^ a -a$ $ a -^a ^n aNb -^b ^n aNb b -a$ $n bNa -b$ $n bNa b -a*(^b$)c* - b b -a*\(^b$\)c* b b b - -# certain syntax errors and non-errors -| C EMPTY -| b | | -* C BADRPT -* b * * -+ C BADRPT -? C BADRPT -"" &C EMPTY -() - abc @abc -\(\) b abc @abc -a||b C EMPTY -|ab C EMPTY -ab| C EMPTY -(|a)b C EMPTY -(a|)b C EMPTY -(*a) C BADRPT -(+a) C BADRPT -(?a) C BADRPT -({1}a) C BADRPT -\(\{1\}a\) bC BADRPT -(a|*b) C BADRPT -(a|+b) C BADRPT -(a|?b) C BADRPT -(a|{1}b) C BADRPT -^* C BADRPT -^* b * * -^+ C BADRPT -^? C BADRPT -^{1} C BADRPT -^\{1\} bC BADRPT - -# metacharacters, backslashes -a.c & abc abc -a[bc]d & abd abd -a\*c & a*c a*c -a\\b & a\b a\b -a\\\*b & a\*b a\*b -a\bc & abc abc -a\ &C EESCAPE -a\\bc & a\bc a\bc -\{ bC BADRPT -a\[b & a[b a[b -a[b &C EBRACK -# trailing $ is a peculiar special case for the BRE code -a$ & a a -a$ & a$ -a\$ & a -a\$ & a$ a$ -a\\$ & a -a\\$ & a$ -a\\$ & a\$ -a\\$ & a\ a\ - -# back references, ugh -a\(b\)\2c bC ESUBREG -a\(b\1\)c bC ESUBREG -a\(b*\)c\1d b abbcbbd abbcbbd bb -a\(b*\)c\1d b abbcbd -a\(b*\)c\1d b abbcbbbd -^\(.\)\1 b abc -a\([bc]\)\1d b abcdabbd abbd b -a\(\([bc]\)\2\)*d b abbccd abbccd -a\(\([bc]\)\2\)*d b abbcbd -# actually, this next one probably ought to fail, but the spec is unclear -a\(\(b\)*\2\)*d b abbbd abbbd -# here is a case that no NFA implementation does right -\(ab*\)[ab]*\1 b ababaaa ababaaa a -# check out normal matching in the presence of back refs -\(a\)\1bcd b aabcd aabcd -\(a\)\1bc*d b aabcd aabcd -\(a\)\1bc*d b aabd aabd -\(a\)\1bc*d b aabcccd aabcccd -\(a\)\1bc*[ce]d b aabcccd aabcccd -^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd - -# ordinary repetitions -ab*c & abc abc -ab+c - abc abc -ab?c - abc abc -a\(*\)b b a*b a*b -a\(**\)b b ab ab -a\(***\)b bC BADRPT -*a b *a *a -**a b a a -***a bC BADRPT - -# the dreaded bounded repetitions -{ & { { -{abc & {abc {abc -{1 C BADRPT -{1} C BADRPT -a{b & a{b a{b -a{1}b - ab ab -a\{1\}b b ab ab -a{1,}b - ab ab -a\{1,\}b b ab ab -a{1,2}b - aab aab -a\{1,2\}b b aab aab -a{1 C EBRACE -a\{1 bC EBRACE -a{1a C EBRACE -a\{1a bC EBRACE -a{1a} C BADBR -a\{1a\} bC BADBR -a{,2} - a{,2} a{,2} -a\{,2\} bC BADBR -a{,} - a{,} a{,} -a\{,\} bC BADBR -a{1,x} C BADBR -a\{1,x\} bC BADBR -a{1,x C EBRACE -a\{1,x bC EBRACE -a{300} C BADBR -a\{300\} bC BADBR -a{1,0} C BADBR -a\{1,0\} bC BADBR -ab{0,0}c - abcac ac -ab\{0,0\}c b abcac ac -ab{0,1}c - abcac abc -ab\{0,1\}c b abcac abc -ab{0,3}c - abbcac abbc -ab\{0,3\}c b abbcac abbc -ab{1,1}c - acabc abc -ab\{1,1\}c b acabc abc -ab{1,3}c - acabc abc -ab\{1,3\}c b acabc abc -ab{2,2}c - abcabbc abbc -ab\{2,2\}c b abcabbc abbc -ab{2,4}c - abcabbc abbc -ab\{2,4\}c b abcabbc abbc -((a{1,10}){1,10}){1,10} - a a a,a - -# multiple repetitions -a** &C BADRPT -a++ C BADRPT -a?? C BADRPT -a*+ C BADRPT -a*? C BADRPT -a+* C BADRPT -a+? C BADRPT -a?* C BADRPT -a?+ C BADRPT -a{1}{1} C BADRPT -a*{1} C BADRPT -a+{1} C BADRPT -a?{1} C BADRPT -a{1}* C BADRPT -a{1}+ C BADRPT -a{1}? C BADRPT -a*{b} - a{b} a{b} -a\{1\}\{1\} bC BADRPT -a*\{1\} bC BADRPT -a\{1\}* bC BADRPT - -# brackets, and numerous perversions thereof -a[b]c & abc abc -a[ab]c & abc abc -a[^ab]c & adc adc -a[]b]c & a]c a]c -a[[b]c & a[c a[c -a[-b]c & a-c a-c -a[^]b]c & adc adc -a[^-b]c & adc adc -a[b-]c & a-c a-c -a[b &C EBRACK -a[] &C EBRACK -a[1-3]c & a2c a2c -a[3-1]c &C ERANGE -a[1-3-5]c &C ERANGE -a[[.-.]--]c & a-c a-c -a[1- &C ERANGE -a[[. &C EBRACK -a[[.x &C EBRACK -a[[.x. &C EBRACK -a[[.x.] &C EBRACK -a[[.x.]] & ax ax -a[[.x,.]] &C ECOLLATE -a[[.one.]]b & a1b a1b -a[[.notdef.]]b &C ECOLLATE -a[[.].]]b & a]b a]b -a[[:alpha:]]c & abc abc -a[[:notdef:]]c &C ECTYPE -a[[: &C EBRACK -a[[:alpha &C EBRACK -a[[:alpha:] &C EBRACK -a[[:alpha,:] &C ECTYPE -a[[:]:]]b &C ECTYPE -a[[:-:]]b &C ECTYPE -a[[:alph:]] &C ECTYPE -a[[:alphabet:]] &C ECTYPE -[[:alnum:]]+ - -%@a0X- a0X -[[:alpha:]]+ - -%@aX0- aX -[[:blank:]]+ - aSSTb SST -[[:cntrl:]]+ - aNTb NT -[[:digit:]]+ - a019b 019 -[[:graph:]]+ - Sa%bS a%b -[[:lower:]]+ - AabC ab -[[:print:]]+ - NaSbN aSb -[[:punct:]]+ - S%-&T %-& -[[:space:]]+ - aSNTb SNT -[[:upper:]]+ - aBCd BC -[[:xdigit:]]+ - p0f3Cq 0f3C -a[[=b=]]c & abc abc -a[[= &C EBRACK -a[[=b &C EBRACK -a[[=b= &C EBRACK -a[[=b=] &C EBRACK -a[[=b,=]] &C ECOLLATE -a[[=one=]]b & a1b a1b - -# complexities -a(((b)))c - abc abc -a(b|(c))d - abd abd -a(b*|c)d - abbd abbd -# just gotta have one DFA-buster, of course -a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and an inline expansion in case somebody gets tricky -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and in case somebody just slips in an NFA... -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights -# fish for anomalies as the number of states passes 32 -12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789 -123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890 -1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901 -12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012 -123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123 -# and one really big one, beyond any plausible word width -1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890 -# fish for problems as brackets go past 8 -[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm -[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo -[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq -[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq - -# subtleties of matching -abc & xabcy abc -a\(b\)?c\1d b acd -aBc i Abc Abc -a[Bc]*d i abBCcd abBCcd -0[[:upper:]]1 &i 0a1 0a1 -0[[:lower:]]1 &i 0A1 0A1 -a[^b]c &i abc -a[^b]c &i aBc -a[^b]c &i adc adc -[a]b[c] - abc abc -[a]b[a] - aba aba -[abc]b[abc] - abc abc -[abc]b[abd] - abd abd -a(b?c)+d - accd accd -(wee|week)(knights|night) - weeknights weeknights -(we|wee|week|frob)(knights|night|day) - weeknights weeknights -a[bc]d - xyzaaabcaababdacd abd -a[ab]c - aaabc abc -abc s abc abc -a* & b @b - -# Let's have some fun -- try to match a C comment. -# first the obvious, which looks okay at first glance... -/\*.*\*/ - /*x*/ /*x*/ -# but... -/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ -# okay, we must not match */ inside; try to do that... -/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ -/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ -# but... -/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ -# and a still fancier version, which does it right (I think)... -/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ -/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ - -# subexpressions -a(b)(c)d - abcd abcd b,c -a(((b)))c - abc abc b,b,b -a(b|(c))d - abd abd b,- -a(b*|c|e)d - abbd abbd bb -a(b*|c|e)d - acd acd c -a(b*|c|e)d - ad ad @d -a(b?)c - abc abc b -a(b?)c - ac ac @c -a(b+)c - abc abc b -a(b+)c - abbbc abbbc bbb -a(b*)c - ac ac @c -(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de -# the regression tester only asks for 9 subexpressions -a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j -a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k -a([bc]?)c - abc abc b -a([bc]?)c - ac ac @c -a([bc]+)c - abc abc b -a([bc]+)c - abcc abcc bc -a([bc]+)bc - abcbc abcbc bc -a(bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abbb abbb bb -a(bbb+|bb+|b)bb - abbb abbb b -(.*).* - abcdef abcdef abcdef -(a*)* - bc @b @b - -# do we get the right subexpression when it is used more than once? -a(b|c)*d - ad ad - -a(b|c)*d - abcd abcd c -a(b|c)+d - abd abd b -a(b|c)+d - abcd abcd c -a(b|c?)+d - ad ad @d -a(b|c?)+d - abcd abcd @d -a(b|c){0,0}d - ad ad - -a(b|c){0,1}d - ad ad - -a(b|c){0,1}d - abd abd b -a(b|c){0,2}d - ad ad - -a(b|c){0,2}d - abcd abcd c -a(b|c){0,}d - ad ad - -a(b|c){0,}d - abcd abcd c -a(b|c){1,1}d - abd abd b -a(b|c){1,1}d - acd acd c -a(b|c){1,2}d - abd abd b -a(b|c){1,2}d - abcd abcd c -a(b|c){1,}d - abd abd b -a(b|c){1,}d - abcd abcd c -a(b|c){2,2}d - acbd acbd b -a(b|c){2,2}d - abcd abcd c -a(b|c){2,4}d - abcd abcd c -a(b|c){2,4}d - abcbd abcbd b -a(b|c){2,4}d - abcbcd abcbcd c -a(b|c){2,}d - abcd abcd c -a(b|c){2,}d - abcbd abcbd b -a(b+|((c)*))+d - abd abd @d,@d,- -a(b+|((c)*))+d - abcd abcd @d,@d,- - -# check out the STARTEND option -[abc] &# a(b)c b -[abc] &# a(d)c -[abc] &# a(bc)d b -[abc] &# a(dc)d c -. &# a()c -b.*c &# b(bc)c bc -b.* &# b(bc)c bc -.*c &# b(bc)c bc - -# plain strings, with the NOSPEC flag -abc m abc abc -abc m xabcy abc -abc m xyz -a*b m aba*b a*b -a*b m ab -"" mC EMPTY - -# cases involving NULs -aZb & a a -aZb &p a -aZb &p# (aZb) aZb -aZ*b &p# (ab) ab -a.b &# (aZb) aZb -a.* &# (aZb)c aZb - -# word boundaries (ick) -[[:<:]]a & a a -[[:<:]]a & ba -[[:<:]]a & -a a -a[[:>:]] & a a -a[[:>:]] & ab -a[[:>:]] & a- a -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc -[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc -[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc -[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_ -[[:<:]]a_b[[:>:]] & x_a_b - -# past problems, and suspected problems -(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1 -abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop -abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv -(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 -CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 -Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz -a?b - ab ab --\{0,1\}[0-9]*$ b -5 -5 diff --git a/regex/utils.h b/regex/utils.h deleted file mode 100644 index cd4a96025f24a..0000000000000 --- a/regex/utils.h +++ /dev/null @@ -1,25 +0,0 @@ -/* utility definitions */ - -#include "regex_extra.h" - -#ifdef _POSIX2_RE_DUP_MAX -#define DUPMAX _POSIX2_RE_DUP_MAX -#else -#define DUPMAX 255 -#endif -#define INFINITY (DUPMAX + 1) -#define NC (CHAR_MAX - CHAR_MIN + 1) -typedef unsigned char uch; - -/* switch off assertions (if not already off) if no REDEBUG */ -#ifndef REDEBUG -#ifndef NDEBUG -#define NDEBUG /* no assertions please */ -#endif -#endif -#include - -/* for old systems with bcopy() but no memmove() */ -#ifdef USEBCOPY -#define memmove(d, s, c) bcopy(s, d, c) -#endif diff --git a/run-tests.php b/run-tests.php deleted file mode 100755 index ced4296c03ccc..0000000000000 --- a/run-tests.php +++ /dev/null @@ -1,1423 +0,0 @@ - | - | Preston L. Bannister | - | Marcus Boerger | - | Derick Rethans | - | Sander Roobol | - | (based on version by: Stig Bakken ) | - | (based on the PHP 3 test framework by Rasmus Lerdorf) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Sanity check to ensure that pcre extension needed by this script is available. - * In the event it is not, print a nice error message indicating that this script will - * not run without it. - */ -if (!extension_loaded("pcre")) { - echo <<'; - save_text($info_file, $php_info); - $info_params = array(); - settings2array($ini_overwrites,$info_params); - settings2params($info_params); - $php_info = `$php $pass_options $info_params $info_file`; - @unlink($info_file); - define('TESTED_PHP_VERSION', `$php -r 'echo PHP_VERSION;'`); - - $unicode = `$php $pass_options $info_params -r 'echo ini_get("unicode_semantics");'`; - define('TESTED_UNICODE', strcasecmp($unicode,"on") == 0 || $unicode == 1); - - // check for extensions that need special handling and regenerate - $php_extensions = ''; - save_text($info_file, $php_extensions); - $php_extensions = explode(',',`$php $pass_options $info_params $info_file`); - $info_params_ex = array( - 'session' => array('session.auto_start=0'), - 'zlib' => array('zlib.output_compression=Off'), - 'xdebug' => array('xdebug.default_enable=0'), - ); - foreach($info_params_ex as $ext => $ini_overwrites_ex) { - if (in_array($ext, $php_extensions)) { - $ini_overwrites = array_merge($ini_overwrites, $ini_overwrites_ex); - } - } - @unlink($info_file); - - // Write test context information. - echo " -===================================================================== -CWD : $cwd -PHP : $php $php_info -Extra dirs : "; - foreach ($user_tests as $test_dir) { - echo "{$test_dir}\n "; - } - echo " -===================================================================== -"; -} - -// Determine the tests to be run. - -$test_files = array(); -$redir_tests = array(); -$test_results = array(); -$PHP_FAILED_TESTS = array('BORKED' => array(), 'FAILED' => array()); - -// If parameters given assume they represent selected tests to run. -$failed_tests_file= false; -$pass_option_n = false; -$pass_options = ''; -if (isset($argc) && $argc > 1) { - for ($i=1; $i<$argc; $i++) { - if (substr($argv[$i],0,1) == '-') { - $switch = strtolower(substr($argv[$i],1,1)); - switch($switch) { - case 'r': - case 'l': - $test_list = @file($argv[++$i]); - if ($test_list) { - foreach($test_list as $test) { - $matches = array(); - if (preg_match('/^#.*\[(.*)\]\:\s+(.*)$/', $test, $matches)) { - $redir_tests[] = array($matches[1], $matches[2]); - } else if (strlen($test)) { - $test_files[] = trim($test); - } - } - } - if ($switch != 'l') { - break; - } - $i--; - // break left intentionally - case 'w': - $failed_tests_file = fopen($argv[++$i], 'w+t'); - break; - case 'a': - $failed_tests_file = fopen($argv[++$i], 'a+t'); - break; - case 'v': - $DETAILED = true; - break; - case 'n': - if (!$pass_option_n) { - $pass_options .= ' -n'; - } - $pass_option_n = true; - break; - case 'd': - $ini_overwrites[] = $argv[++$i]; - break; - case 'u': - $ini_overwrites[] = 'unicode_semantics=1'; - $ini_overwrites[] = 'unicode.runtime_encoding=iso-8859-1'; - $ini_overwrites[] = 'unicode.script_encoding=utf-8'; - $ini_overwrites[] = 'unicode.output_encoding=utf-8'; - $ini_overwrites[] = 'unicode.from_error_mode=U_INVALID_SUBSTITUTE'; - break; - default: - echo "Illegal switch specified!\n"; - case "h": - case "help": - case "-help": - echo << Read the testfiles to be executed from . After the test - has finished all failed tests are written to the same . - If the list is empty and no further test is specified then - all tests are executed (same as: -r -w ). - - -r Read the testfiles to be executed from . - - -w Write a list of all failed tests to . - - -a Same as -w but append rather then truncating . - - -n Pass -n option to the php binary (Do not use a php.ini). - - -d foo=bar Pass -d option to the php binary (Define INI entry foo - with value 'bar'). - - -u Test with unicode_semantics set on. - - -v Verbose mode. - - -h This Help. - -HELP; - exit(1); - } - } else { - $testfile = realpath($argv[$i]); - if (is_dir($testfile)) { - find_files($testfile); - } else if (preg_match("/\.phpt$/", $testfile)) { - $test_files[] = $testfile; - } else { - die("bogus test name " . $argv[$i] . "\n"); - } - } - } - $test_files = array_unique($test_files); - $test_files = array_merge($test_files, $redir_tests); - - // Run selected tests. - $test_cnt = count($test_files); - if ($test_cnt) { - write_information(); - usort($test_files, "test_sort"); - echo "Running selected tests.\n"; - $start_time = time(); - $test_idx = 0; - run_all_tests($test_files); - $end_time = time(); - if ($failed_tests_file) { - fclose($failed_tests_file); - } - if (count($test_files) || count($test_results)) { - echo " -====================================================================="; - compute_summary(); - echo get_summary(false); - } - if (getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)', implode(' ', $test_results))) { - exit(1); - } - exit(0); - } -} - -write_information(); - -// Compile a list of all test files (*.phpt). -$test_files = array(); -$exts_to_test = get_loaded_extensions(); -$exts_tested = count($exts_to_test); -$exts_skipped = 0; -$ignored_by_ext = 0; -sort($exts_to_test); -$test_dirs = array('tests', 'ext'); -$optionals = array('Zend', 'ZendEngine2'); -foreach($optionals as $dir) { - if (@filetype($dir) == 'dir') { - $test_dirs[] = $dir; - } -} - -// Convert extension names to lowercase -foreach ($exts_to_test as $key => $val) { - $exts_to_test[$key] = strtolower($val); -} - -foreach ($test_dirs as $dir) { - find_files("{$cwd}/{$dir}", ($dir == 'ext')); -} - -foreach ($user_tests as $dir) { - find_files($dir, ($dir == 'ext')); -} - -function find_files($dir,$is_ext_dir=FALSE,$ignore=FALSE) -{ - global $test_files, $exts_to_test, $ignored_by_ext, $exts_skipped, $exts_tested; - - $o = opendir($dir) or error("cannot open directory: $dir"); - while (($name = readdir($o)) !== FALSE) { - if (is_dir("{$dir}/{$name}") && !in_array($name, array('.', '..', 'CVS'))) { - $skip_ext = ($is_ext_dir && !in_array(strtolower($name), $exts_to_test)); - if ($skip_ext) { - $exts_skipped++; - } - find_files("{$dir}/{$name}", FALSE, $ignore || $skip_ext); - } - - // Cleanup any left-over tmp files from last run. - if (substr($name, -4) == '.tmp') { - @unlink("$dir/$name"); - continue; - } - - // Otherwise we're only interested in *.phpt files. - if (substr($name, -5) == '.phpt') { - if ($ignore) { - $ignored_by_ext++; - } else { - $testfile = realpath("{$dir}/{$name}"); - $test_files[] = $testfile; - } - } - } - closedir($o); -} - -function test_name($name) -{ - if (is_array($name)) { - return $name[0] . ':' . $name[1]; - } else { - return $name; - } -} - -function test_sort($a, $b) -{ - global $cwd; - - $a = test_name($a); - $b = test_name($b); - - $ta = strpos($a, "{$cwd}/tests")===0 ? 1 + (strpos($a, "{$cwd}/tests/run-test")===0 ? 1 : 0) : 0; - $tb = strpos($b, "{$cwd}/tests")===0 ? 1 + (strpos($b, "{$cwd}/tests/run-test")===0 ? 1 : 0) : 0; - if ($ta == $tb) { - return strcmp($a, $b); - } else { - return $tb - $ta; - } -} - -$test_files = array_unique($test_files); -usort($test_files, "test_sort"); - -$start_time = time(); - -echo "TIME START " . date('Y-m-d H:i:s', $start_time) . " -===================================================================== -"; - -$test_cnt = count($test_files); -$test_idx = 0; -run_all_tests($test_files); -$end_time = time(); -if ($failed_tests_file) { - fclose($failed_tests_file); -} - -// Summarize results - -if (0 == count($test_results)) { - echo "No tests were run.\n"; - return; -} - -compute_summary(); - -echo " -===================================================================== -TIME END " . date('Y-m-d H:i:s', $end_time); - -$summary = get_summary(true); -echo $summary; - -define('PHP_QA_EMAIL', 'qa-reports@lists.php.net'); -define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php'); - -/* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */ -if (!getenv('NO_INTERACTION')) { - $fp = fopen("php://stdin", "r+"); - echo "\nYou may have found a problem in PHP.\nWe would like to send this report automatically to the\n"; - echo "PHP QA team, to give us a better understanding of how\nthe test cases are doing. If you don't want to send it\n"; - echo "immediately, you can choose \"s\" to save the report to\na file that you can send us later.\n"; - echo "Do you want to send this report now? [Yns]: "; - flush(); - $user_input = fgets($fp, 10); - $just_save_results = (strtolower($user_input[0]) == 's'); - - if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { - /* - * Collect information about the host system for our report - * Fetch phpinfo() output so that we can see the PHP enviroment - * Make an archive of all the failed tests - * Send an email - */ - - /* Ask the user to provide an email address, so that QA team can contact the user */ - if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) { - echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): "; - flush(); - $user_email = trim(fgets($fp, 1024)); - $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email)); - } - - $failed_tests_data = ''; - $sep = "\n" . str_repeat('=', 80) . "\n"; - - $failed_tests_data .= $failed_test_summary . "\n"; - $failed_tests_data .= $summary . "\n"; - - if ($sum_results['FAILED']) { - foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) { - $failed_tests_data .= $sep . $test_info['name'] . $test_info['info']; - $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output'])); - $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff'])); - $failed_tests_data .= $sep . "\n\n"; - } - $status = "failed"; - } else { - $status = "success"; - } - - $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep; - $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n"; - $ldd = $autoconf = $sys_libtool = $libtool = $compiler = 'N/A'; - - if (substr(PHP_OS, 0, 3) != "WIN") { - /* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */ - if (!empty($_ENV['PHP_AUTOCONF'])) { - $autoconf = shell_exec($_ENV['PHP_AUTOCONF'] . ' --version'); - } else { - $autoconf = shell_exec('autoconf --version'); - } - - /* Always use the generated libtool - Mac OSX uses 'glibtool' */ - $libtool = shell_exec($CUR_DIR . '/libtool --version'); - - /* Use shtool to find out if there is glibtool present (MacOSX) */ - $sys_libtool_path = shell_exec(dirname(__FILE__) . '/build/shtool path glibtool libtool'); - $sys_libtool = shell_exec(str_replace("\n", "", $sys_libtool_path) . ' --version'); - - /* Try the most common flags for 'version' */ - $flags = array('-v', '-V', '--version'); - $cc_status=0; - foreach($flags AS $flag) { - system(getenv('CC')." $flag >/dev/null 2>&1", $cc_status); - if ($cc_status == 0) { - $compiler = shell_exec(getenv('CC')." $flag 2>&1"); - break; - } - } - $ldd = shell_exec("ldd $php 2>/dev/null"); - } - $failed_tests_data .= "Autoconf:\n$autoconf\n"; - $failed_tests_data .= "Bundled Libtool:\n$libtool\n"; - $failed_tests_data .= "System Libtool:\n$sys_libtool\n"; - $failed_tests_data .= "Compiler:\n$compiler\n"; - $failed_tests_data .= "Bison:\n". @shell_exec('bison --version'). "\n"; - $failed_tests_data .= "Libraries:\n$ldd\n"; - $failed_tests_data .= "\n"; - - if (isset($user_email)) { - $failed_tests_data .= "User's E-mail: ".$user_email."\n\n"; - } - - $failed_tests_data .= $sep . "PHPINFO" . $sep; - $failed_tests_data .= shell_exec($php.' -dhtml_errors=0 -i'); - - $compression = 0; - - if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) { - $output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . ( $compression ? '.txt.gz' : '.txt' ); - file_put_contents($output_file, $failed_tests_data); - - if (!$just_save_results) { - echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; - } - - echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n"; - } else { - fwrite($fp, "\nThank you for helping to make PHP better.\n"); - fclose($fp); - } - } -} - -if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) { - exit(1); -} - -// -// Send Email to QA Team -// - -function mail_qa_team($data, $compression, $status = FALSE) -{ - $url_bits = parse_url(QA_SUBMISSION_PAGE); - if (empty($url_bits['port'])) $url_bits['port'] = 80; - - $data = "php_test_data=" . urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data))); - $data_length = strlen($data); - - $fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10); - if (!$fs) { - return FALSE; - } - - $php_version = urlencode(TESTED_PHP_VERSION); - - echo "\nPosting to {$url_bits['host']} {$url_bits['path']}\n"; - fwrite($fs, "POST ".$url_bits['path']."?status=$status&version=$php_version HTTP/1.1\r\n"); - fwrite($fs, "Host: ".$url_bits['host']."\r\n"); - fwrite($fs, "User-Agent: QA Browser 0.1\r\n"); - fwrite($fs, "Content-Type: application/x-www-form-urlencoded\r\n"); - fwrite($fs, "Content-Length: ".$data_length."\r\n\r\n"); - fwrite($fs, $data); - fwrite($fs, "\r\n\r\n"); - fclose($fs); - - return 1; -} - - -// -// Write the given text to a temporary file, and return the filename. -// - -function save_text($filename,$text) -{ - global $DETAILED; - - @file_put_contents($filename, $text) or error("Cannot open file '" . $filename . "' (save_text)"); - if (1 < $DETAILED) echo " -FILE $filename {{{ -$text -}}} -"; -} - -// -// Write an error in a format recognizable to Emacs or MSVC. -// - -function error_report($testname,$logname,$tested) -{ - $testname = realpath($testname); - $logname = realpath($logname); - switch (strtoupper(getenv('TEST_PHP_ERROR_STYLE'))) { - case 'MSVC': - echo $testname . "(1) : $tested\n"; - echo $logname . "(1) : $tested\n"; - break; - case 'EMACS': - echo $testname . ":1: $tested\n"; - echo $logname . ":1: $tested\n"; - break; - } -} - -function system_with_timeout($commandline) -{ - $data = ""; - - $proc = proc_open($commandline, array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ), $pipes, null, null, array("suppress_errors" => true)); - - if (!$proc) - return false; - - fclose($pipes[0]); - - while (true) { - /* hide errors from interrupted syscalls */ - $r = $pipes; - $w = null; - $e = null; - $n = @stream_select($r, $w, $e, 60); - - if ($n === 0) { - /* timed out */ - $data .= "\n ** ERROR: process timed out **\n"; - proc_terminate($proc); - return $data; - } else if ($n > 0) { - $line = fread($pipes[1], 8192); - if (strlen($line) == 0) { - /* EOF */ - break; - } - $data .= $line; - } - } - $stat = proc_get_status($proc); - if ($stat['signaled']) { - $data .= "\nTermsig=".$stat['stopsig']; - } - $code = proc_close($proc); - return $data; -} - -function run_all_tests($test_files, $redir_tested = NULL) -{ - global $test_results, $failed_tests_file, $php, $test_cnt, $test_idx; - - foreach($test_files AS $name) { - $index = is_array($name) ? $name[0] : $name; - $test_idx++; - $result = run_test($php,$name); - if (!is_array($name) && $result != 'REDIR') { - $test_results[$index] = $result; - if ($failed_tests_file && ($result == 'FAILED' || $result == 'WARNED')) { - if ($redir_tested) { - fwrite($failed_tests_file, "# $redir_tested: $name\n"); - } else { - fwrite($failed_tests_file, "$name\n"); - } - } - } - } -} - -// -// Run an individual test case. -// - -function run_test($php, $file) -{ - global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS, $pass_options, $DETAILED, $IN_REDIRECT, $test_cnt, $test_idx; - - $org_file = $file; - - if (is_array($file)) $file = $file[0]; - - if ($DETAILED) echo " -================= -TEST $file -"; - - // Load the sections of the test file. - $section_text = array( - 'TEST' => '', - 'SKIPIF' => '', - 'GET' => '', - 'ARGS' => '', - ); - - $fp = @fopen($file, "rt") or error("Cannot open test file: $file"); - - $borked = false; - $bork_info = ''; - if (!feof($fp)) { - $line = fgets($fp); - } else { - $bork_info = "empty test [$file]"; - $borked = true; - } - if (!ereg('^--TEST--',$line,$r)) { - $bork_info = "tests must start with --TEST-- [$file]"; - $borked = true; - } - $section = 'TEST'; - while (!feof($fp)) { - $line = fgets($fp); - - // Match the beginning of a section. - // UTODO changed to use preg, because ereg was crapping out - if (preg_match('/^--([A-Z]+)--/',$line,$r)) { - $section = $r[1]; - $section_text[$section] = ''; - continue; - } - - // Add to the section text. - $section_text[$section] .= $line; - } - - // the redirect section allows a set of tests to be reused outside of - // a given test dir - if (@count($section_text['REDIRECTTEST']) == 1) { - if ($IN_REDIRECT) { - $borked = true; - $bork_info = "Can't redirect a test from within a redirected test"; - } else { - $borked = false; - } - } else { - if (@count($section_text['FILE']) != 1) { - $bork_info = "missing section --FILE-- [$file]"; - $borked = true; - } - if ((@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX'])) != 1) { - $bork_info = "missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX-- [$file]"; - $borked = true; - print_r($section_text); - } - if ((@count($section_text['UEXPECT']) + @count($section_text['UEXPECTF']) + @count($section_text['UEXPECTREGEX'])) > 1) { - $bork_info = "missing section --UEXPECT--, --UEXPECTF-- or --UEXPECTREGEX-- [$file]"; - $borked = true; - print_r($section_text); - } - } - fclose($fp); - - if ($borked) { - echo "BORK $bork_info [$file]\n"; - $PHP_FAILED_TESTS['BORKED'][] = array ( - 'name' => $file, - 'test_name' => '', - 'output' => '', - 'diff' => '', - 'info' => $bork_info, - ); - return 'BORKED'; - } - - /* For GET/POST tests, check if cgi sapi is available and if it is, use it. */ - if ((!empty($section_text['GET']) || !empty($section_text['POST']))) { - if (file_exists("./sapi/cgi/php")) { - $old_php = $php; - $php = realpath("./sapi/cgi/php") . ' -C '; - } - } - - $shortname = str_replace($cwd.'/', '', $file); - $tested = trim($section_text['TEST'])." [$shortname]"; - - echo "TEST $test_idx/$test_cnt [$shortname]\r"; - flush(); - - if (is_array($IN_REDIRECT)) { - $tmp = $IN_REDIRECT['dir']; - } else { - $tmp = realpath(dirname($file)); - } - - $diff_filename = $tmp . DIRECTORY_SEPARATOR . preg_replace('/\.phpt$/','.diff', basename($file)); - $log_filename = $tmp . DIRECTORY_SEPARATOR . preg_replace('/\.phpt$/','.log', basename($file)); - $exp_filename = $tmp . DIRECTORY_SEPARATOR . preg_replace('/\.phpt$/','.exp', basename($file)); - $output_filename = $tmp . DIRECTORY_SEPARATOR . preg_replace('/\.phpt$/','.out', basename($file)); - - $tmp_skipif = $tmp . DIRECTORY_SEPARATOR . uniqid('/phpt.'); - $tmp_file = $tmp . DIRECTORY_SEPARATOR . preg_replace('/\.phpt$/','.php',basename($file)); - $tmp_post = $tmp . DIRECTORY_SEPARATOR . uniqid('/phpt.'); - - if (is_array($IN_REDIRECT)) { - $tested = $IN_REDIRECT['prefix'] . ' ' . trim($section_text['TEST']) . " [$tmp_file]"; - $section_text['FILE'] = "# original source file: $shortname\n" . $section_text['FILE']; - } - - @unlink($tmp_skipif); - @unlink($tmp_file); - @unlink($tmp_post); - - // unlink old test results - @unlink($diff_filename); - @unlink($log_filename); - @unlink($exp_filename); - @unlink($output_filename); - - // Reset environment from any previous test. - putenv("REDIRECT_STATUS="); - putenv("QUERY_STRING="); - putenv("PATH_TRANSLATED="); - putenv("SCRIPT_FILENAME="); - putenv("REQUEST_METHOD="); - putenv("CONTENT_TYPE="); - putenv("CONTENT_LENGTH="); - - // Check if test should be skipped. - $info = ''; - $warn = false; - if (array_key_exists('SKIPIF', $section_text)) { - if (trim($section_text['SKIPIF'])) { - $skipif_params = array(); - settings2array($ini_overwrites,$skipif_params); - settings2params($skipif_params); - - save_text($tmp_skipif, $section_text['SKIPIF']); - $extra = substr(PHP_OS, 0, 3) !== "WIN" ? - "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;": ""; - $output = system_with_timeout("$extra $php -q $skipif_params $tmp_skipif"); - @unlink($tmp_skipif); - if (eregi("^skip", trim($output))) { - echo "SKIP $tested"; - $reason = (eregi("^skip[[:space:]]*(.+)\$", trim($output))) ? eregi_replace("^skip[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; - if ($reason) { - echo " (reason: $reason)\n"; - } else { - echo "\n"; - } - if (isset($old_php)) { - $php = $old_php; - } - return 'SKIPPED'; - } - if (eregi("^info", trim($output))) { - $reason = (ereg("^info[[:space:]]*(.+)\$", trim($output))) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; - if ($reason) { - $info = " (info: $reason)"; - } - } - if (eregi("^warn", trim($output))) { - $reason = (ereg("^warn[[:space:]]*(.+)\$", trim($output))) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; - if ($reason) { - $warn = true; /* only if there is a reason */ - $info = " (warn: $reason)"; - } - } - } - } - - if (@count($section_text['REDIRECTTEST']) == 1) { - $test_files = array(); - - $IN_REDIRECT = eval($section_text['REDIRECTTEST']); - $IN_REDIRECT['via'] = "via [$shortname]\n\t"; - $IN_REDIRECT['dir'] = realpath(dirname($file)); - $IN_REDIRECT['prefix'] = trim($section_text['TEST']); - - if (is_array($org_file)) { - $test_files[] = $org_file[1]; - } else { - $GLOBALS['test_files'] = $test_files; - find_files($IN_REDIRECT['TESTS']); - $test_files = $GLOBALS['test_files']; - } - $test_cnt += count($test_files) - 1; - $test_idx--; - - echo "---> $IN_REDIRECT[TESTS] ($tested)\n"; - - // set up environment - foreach ($IN_REDIRECT['ENV'] as $k => $v) { - putenv("$k=$v"); - } - putenv("REDIR_TEST_DIR=" . realpath($IN_REDIRECT['TESTS']) . DIRECTORY_SEPARATOR); - - usort($test_files, "test_sort"); - run_all_tests($test_files, $tested); - - echo "---> $IN_REDIRECT[TESTS] ($tested) done\n"; - - // clean up environment - foreach ($IN_REDIRECT['ENV'] as $k => $v) { - putenv("$k="); - } - putenv("REDIR_TEST_DIR="); - - // a redirected test never fails - $IN_REDIRECT = false; - return 'REDIR'; - } else if (is_array($org_file)) { - echo "--> Redirected test did not contain redirection info: $org_file[0]\n"; - $test_cnt -= 1; - $test_idx--; - return 'REDIR'; - } - - - // Default ini settings - $ini_settings = array(); - // additional ini overwrites - //$ini_overwrites[] = 'setting=value'; - settings2array($ini_overwrites, $ini_settings); - - // Any special ini settings - // these may overwrite the test defaults... - if (array_key_exists('INI', $section_text)) { - settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); - if (isset($ini_settings["unicode_semantics"])) { - $unicode_test = strcasecmp($ini_settings["unicode_semantics"],"on") == 0 || $ini_settings["unicode_semantics"] == 1; - } else { - $unicode_test = TESTED_UNICODE; - } - } else { - $unicode_test = TESTED_UNICODE; - } - - if ($unicode_test) { - if (isset($section_text['UEXPECT'])) { - unset($section_text['EXPECT']); - unset($section_text['EXPECTF']); - unset($section_text['EXPECTREGEX']); - $section_text['EXPECT'] = $section_text['UEXPECT']; - unset($section_text['UEXPECT']); - } else if (isset($section_text['UEXPECTF'])) { - unset($section_text['EXPECT']); - unset($section_text['EXPECTF']); - unset($section_text['EXPECTREGEX']); - $section_text['EXPECTF'] = $section_text['UEXPECTF']; - unset($section_text['UEXPECTF']); - } else if (isset($section_text['UEXPECTREGEX'])) { - unset($section_text['EXPECT']); - unset($section_text['EXPECTF']); - unset($section_text['EXPECTREGEX']); - $section_text['EXPECTREGEX'] = $section_text['UEXPECTREGEX']; - unset($section_text['UEXPECTREGEX']); - } - } - - settings2params($ini_settings); - - // We've satisfied the preconditions - run the test! - save_text($tmp_file,$section_text['FILE']); - if (array_key_exists('GET', $section_text)) { - $query_string = trim($section_text['GET']); - } else { - $query_string = ''; - } - - if (!empty($section_text['ENV'])) { - foreach (explode("\n", $section_text['ENV']) as $env) { - ($env = trim($env)) and putenv($env); - } - } - - putenv("REDIRECT_STATUS=1"); - putenv("QUERY_STRING=$query_string"); - putenv("PATH_TRANSLATED=$tmp_file"); - putenv("SCRIPT_FILENAME=$tmp_file"); - - $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : ''; - - if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { - - $post = trim($section_text['POST']); - save_text($tmp_post,$post); - $content_length = strlen($post); - - putenv("REQUEST_METHOD=POST"); - putenv("CONTENT_TYPE=application/x-www-form-urlencoded"); - putenv("CONTENT_LENGTH=$content_length"); - - $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" 2>&1 < $tmp_post"; - - } else { - - putenv("REQUEST_METHOD=GET"); - putenv("CONTENT_TYPE="); - putenv("CONTENT_LENGTH="); - - if (empty($section_text['ENV'])) { - $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args 2>&1"; - } else { - $cmd = "$php$pass_options$ini_settings < \"$tmp_file\" $args 2>&1"; - } - } - - if ($DETAILED) echo " -CONTENT_LENGTH = " . getenv("CONTENT_LENGTH") . " -CONTENT_TYPE = " . getenv("CONTENT_TYPE") . " -PATH_TRANSLATED = " . getenv("PATH_TRANSLATED") . " -QUERY_STRING = " . getenv("QUERY_STRING") . " -REDIRECT_STATUS = " . getenv("REDIRECT_STATUS") . " -REQUEST_METHOD = " . getenv("REQUEST_METHOD") . " -SCRIPT_FILENAME = " . getenv("SCRIPT_FILENAME") . " -COMMAND $cmd -"; - -// $out = `$cmd`; - $out = system_with_timeout($cmd); - - if (!empty($section_text['ENV'])) { - foreach (explode("\n", $section_text['ENV']) as $env) { - $env = explode('=', $env); - putenv($env[0] .'='); - } - } - - @unlink($tmp_post); - - // Does the output match what is expected? - $output = trim($out); - $output = preg_replace('/\r\n/',"\n",$output); - - /* when using CGI, strip the headers from the output */ - if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) { - $output = substr($output, ($pos + 2)); - } - - if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) { - if (isset($section_text['EXPECTF'])) { - $wanted = trim($section_text['EXPECTF']); - } else { - $wanted = trim($section_text['EXPECTREGEX']); - } - $wanted_re = preg_replace('/\r\n/',"\n",$wanted); - if (isset($section_text['EXPECTF'])) { - $wanted_re = preg_quote($wanted_re, '/'); - // Stick to basics - $wanted_re = str_replace("%e", '\\' . DIRECTORY_SEPARATOR, $wanted_re); - $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy - $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re); - $wanted_re = str_replace("%d", "[0-9]+", $wanted_re); - $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re); - $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*(E-?[0-9]+)?", $wanted_re); - $wanted_re = str_replace("%c", ".", $wanted_re); - // %f allows two points "-.0.0" but that is the best *simple* expression - } -/* DEBUG YOUR REGEX HERE - var_dump($wanted_re); - print(str_repeat('=', 80) . "\n"); - var_dump($output); -*/ - if (preg_match("/^$wanted_re\$/s", $output)) { - @unlink($tmp_file); - echo "PASS $tested\n"; - if (isset($old_php)) { - $php = $old_php; - } - return 'PASSED'; - } - - } else { - $wanted = trim($section_text['EXPECT']); - $wanted = preg_replace('/\r\n/',"\n",$wanted); - // compare and leave on success - $ok = (0 == strcmp($output,$wanted)); - if ($ok) { - @unlink($tmp_file); - echo "PASS $tested\n"; - if (isset($old_php)) { - $php = $old_php; - } - return 'PASSED'; - } - $wanted_re = NULL; - } - - // Test failed so we need to report details. - if ($warn) { - echo "WARN $tested$info\n"; - } else { - echo "FAIL $tested$info\n"; - } - - $PHP_FAILED_TESTS['FAILED'][] = array ( - 'name' => $file, - 'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested, - 'output' => $output_filename, - 'diff' => $diff_filename, - 'info' => $info - ); - - // write .exp - if (strpos($log_format,'E') !== FALSE) { - $log = fopen($exp_filename,'wt') or error("Cannot create test log - $exp_filename"); - fwrite($log,$wanted); - fclose($log); - } - - // write .out - if (strpos($log_format,'O') !== FALSE) { - $log = fopen($output_filename,'wt') or error("Cannot create test log - $output_filename"); - fwrite($log,$output); - fclose($log); - } - - // write .diff - if (strpos($log_format,'D') !== FALSE) { - $log = fopen($diff_filename,'wt') or error("Cannot create test log - $diff_filename"); - fwrite($log,generate_diff($wanted,$wanted_re,$output)); - fclose($log); - } - - // write .log - if (strpos($log_format,'L') !== FALSE) { - $log = fopen($log_filename,'wt') or error("Cannot create test log - $log_filename"); - fwrite($log," ----- EXPECTED OUTPUT -$wanted ----- ACTUAL OUTPUT -$output ----- FAILED -"); - fclose($log); - error_report($file,$log_filename,$tested); - } - - if (isset($old_php)) { - $php = $old_php; - } - - return $warn ? 'WARNED' : 'FAILED'; -} - -function comp_line($l1,$l2,$is_reg) -{ - if ($is_reg) { - return preg_match('/^'.$l1.'$/s', $l2); - } else { - return !strcmp($l1, $l2); - } -} - -function count_array_diff($ar1,$ar2,$is_reg,$w,$idx1,$idx2,$cnt1,$cnt2,$steps) -{ - $equal = 0; - while ($idx1 < $cnt1 && $idx2 < $cnt2 && comp_line($ar1[$idx1], $ar2[$idx2], $is_reg)) { - $idx1++; - $idx2++; - $equal++; - $steps--; - } - if (--$steps > 0) { - $eq1 = 0; - $st = $steps / 2; - for ($ofs1 = $idx1+1; $ofs1 < $cnt1 && $st-- > 0; $ofs1++) { - $eq = count_array_diff($ar1,$ar2,$is_reg,$w,$ofs1,$idx2,$cnt1,$cnt2,$st); - if ($eq > $eq1) { - $eq1 = $eq; - } - } - $eq2 = 0; - $st = $steps; - for ($ofs2 = $idx2+1; $ofs2 < $cnt2 && $st-- > 0; $ofs2++) { - $eq = count_array_diff($ar1,$ar2,$is_reg,$w,$idx1,$ofs2,$cnt1,$cnt2,$st); - if ($eq > $eq2) { - $eq2 = $eq; - } - } - if ($eq1 > $eq2) { - $equal += $eq1; - } else if ($eq2 > 0) { - $equal += $eq2; - } - } - return $equal; -} - -function generate_array_diff($ar1,$ar2,$is_reg,$w) -{ - $idx1 = 0; $ofs1 = 0; $cnt1 = count($ar1); - $idx2 = 0; $ofs2 = 0; $cnt2 = count($ar2); - $diff = array(); - $old1 = array(); - $old2 = array(); - - while ($idx1 < $cnt1 && $idx2 < $cnt2) { - if (comp_line($ar1[$idx1], $ar2[$idx2], $is_reg)) { - $idx1++; - $idx2++; - continue; - } else { - $c1 = count_array_diff($ar1,$ar2,$is_reg,$w,$idx1+1,$idx2,$cnt1,$cnt2,10); - $c2 = count_array_diff($ar1,$ar2,$is_reg,$w,$idx1,$idx2+1,$cnt1,$cnt2,10); - if ($c1 > $c2) { - $old1[$idx1] = sprintf("%03d- ", $idx1+1).$w[$idx1++]; - $last = 1; - } else if ($c2 > 0) { - $old2[$idx2] = sprintf("%03d+ ", $idx2+1).$ar2[$idx2++]; - $last = 2; - } else { - $old1[$idx1] = sprintf("%03d- ", $idx1+1).$w[$idx1++]; - $old2[$idx2] = sprintf("%03d+ ", $idx2+1).$ar2[$idx2++]; - } - } - } - - reset($old1); $k1 = key($old1); $l1 = -2; - reset($old2); $k2 = key($old2); $l2 = -2; - while ($k1 !== NULL || $k2 !== NULL) { - if ($k1 == $l1+1 || $k2 === NULL) { - $l1 = $k1; - $diff[] = current($old1); - $k1 = next($old1) ? key($old1) : NULL; - } else if ($k2 == $l2+1 || $k1 === NULL) { - $l2 = $k2; - $diff[] = current($old2); - $k2 = next($old2) ? key($old2) : NULL; - } else if ($k1 < $k2) { - $l1 = $k1; - $diff[] = current($old1); - $k1 = next($old1) ? key($old1) : NULL; - } else { - $l2 = $k2; - $diff[] = current($old2); - $k2 = next($old2) ? key($old2) : NULL; - } - } - while ($idx1 < $cnt1) { - $diff[] = sprintf("%03d- ", $idx1+1).$w[$idx1++]; - } - while ($idx2 < $cnt2) { - $diff[] = sprintf("%03d+ ", $idx2+1).$ar2[$idx2++]; - } - return $diff; -} - -function generate_diff($wanted,$wanted_re,$output) -{ - $w = explode("\n", $wanted); - $o = explode("\n", $output); - $r = is_null($wanted_re) ? $w : explode("\n", $wanted_re); - $diff = generate_array_diff($r,$o,!is_null($wanted_re),$w); - return implode("\r\n", $diff); -} - -function error($message) -{ - echo "ERROR: {$message}\n"; - exit(1); -} - -function settings2array($settings, &$ini_settings) -{ - foreach($settings as $setting) { - if (strpos($setting, '=')!==false) { - $setting = explode("=", $setting, 2); - $name = trim(strtolower($setting[0])); - $value = trim($setting[1]); - $ini_settings[$name] = $value; - } - } -} - -function settings2params(&$ini_settings) -{ - $settings = ''; - foreach($ini_settings as $name => $value) { - $value = addslashes($value); - $settings .= " -d \"$name=$value\""; - } - $ini_settings = $settings; -} - -function compute_summary() -{ - global $n_total, $test_results, $ignored_by_ext, $sum_results, $percent_results; - - $n_total = count($test_results); - $n_total += $ignored_by_ext; - $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0, 'BORKED'=>0); - foreach ($test_results as $v) { - $sum_results[$v]++; - } - $sum_results['SKIPPED'] += $ignored_by_ext; - $percent_results = array(); - while (list($v,$n) = each($sum_results)) { - $percent_results[$v] = (100.0 * $n) / $n_total; - } -} - -function get_summary($show_ext_summary) -{ - global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS; - - $x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED']; - if ($x_total) { - $x_warned = (100.0 * $sum_results['WARNED']) / $x_total; - $x_failed = (100.0 * $sum_results['FAILED']) / $x_total; - $x_passed = (100.0 * $sum_results['PASSED']) / $x_total; - } else { - $x_warned = $x_failed = $x_passed = 0; - } - - $summary = ""; - if ($show_ext_summary) { - $summary .= " -===================================================================== -TEST RESULT SUMMARY ---------------------------------------------------------------------- -Exts skipped : " . sprintf("%4d",$exts_skipped) . " -Exts tested : " . sprintf("%4d",$exts_tested) . " ---------------------------------------------------------------------- -"; - } - $summary .= " -Number of tests : " . sprintf("%4d",$n_total). " " . sprintf("%8d",$x_total); - if ($sum_results['BORKED']) { - $summary .= " -Tests borked : " . sprintf("%4d (%5.1f%%)",$sum_results['BORKED'],$percent_results['BORKED']) . " --------"; - } - $summary .= " -Tests skipped : " . sprintf("%4d (%5.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . " -------- -Tests warned : " . sprintf("%4d (%5.1f%%)",$sum_results['WARNED'],$percent_results['WARNED']) . " " . sprintf("(%5.1f%%)",$x_warned) . " -Tests failed : " . sprintf("%4d (%5.1f%%)",$sum_results['FAILED'],$percent_results['FAILED']) . " " . sprintf("(%5.1f%%)",$x_failed) . " -Tests passed : " . sprintf("%4d (%5.1f%%)",$sum_results['PASSED'],$percent_results['PASSED']) . " " . sprintf("(%5.1f%%)",$x_passed) . " ---------------------------------------------------------------------- -Time taken : " . sprintf("%4d seconds", $end_time - $start_time) . " -===================================================================== -"; - $failed_test_summary = ''; - if (count($PHP_FAILED_TESTS['BORKED'])) { - $failed_test_summary .= " -===================================================================== -BORKED TEST SUMMARY ---------------------------------------------------------------------- -"; - foreach ($PHP_FAILED_TESTS['BORKED'] as $failed_test_data) { - $failed_test_summary .= $failed_test_data['info'] . "\n"; - } - $failed_test_summary .= "=====================================================================\n"; - } - - if (count($PHP_FAILED_TESTS['FAILED'])) { - $failed_test_summary .= " -===================================================================== -FAILED TEST SUMMARY ---------------------------------------------------------------------- -"; - foreach ($PHP_FAILED_TESTS['FAILED'] as $failed_test_data) { - $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; - } - $failed_test_summary .= "=====================================================================\n"; - } - - if ($failed_test_summary && !getenv('NO_PHPTEST_SUMMARY')) { - $summary .= $failed_test_summary; - } - - return $summary; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim: noet sw=4 ts=4 - */ -?> diff --git a/sapi/aolserver/CREDITS b/sapi/aolserver/CREDITS deleted file mode 100644 index 8f9a4af950350..0000000000000 --- a/sapi/aolserver/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -AOLserver -Sascha Schumann diff --git a/sapi/aolserver/README b/sapi/aolserver/README deleted file mode 100644 index 80c186ea5dfda..0000000000000 --- a/sapi/aolserver/README +++ /dev/null @@ -1,69 +0,0 @@ -AOLserver README ($Id$) - -To compile PHP 4.0 as a module for AOLserver, you need: - -- installed AOLserver 3.1 or later - (see the note below for AOLserver 3.0) - -NOTE: You should not use this module in production. PHP is not 100% stable - yet in threaded mode. To increase reliability enable the Global Lock - by removing #define NO_GLOBAL_LOCK in main/main.c. Also don't use - php_value as it will lead to races in a sub-system (use an ini file - instead). - - -1.) Configuring AOLserver - -Read doc/install.txt in the source distribution - -It usually boils down to changing the INST/PREFIX variable in -include/Makefile.global and running make all install. - -2.) Configuring PHP - -$ ./configure \ - --with-aolserver=/path/to/installed/aolserver \ - - -NOTE: If you are still using AOLserver 3.0, you need to retain the - AOLserver source code and pass another option to PHP: - - --with-aolserver-src=/path/to/source/distribution - -3.) Compiling and Installing PHP - -$ make install - -4.) Changing nsd.tcl - -a) New section - -Add a new section to pass options to PHP (required): - -ns_section "ns/server/${servername}/module/php" - -You can use the following commands in this section: - -The 'map' command will cause AOLserver to pass all requests to *.php to -the PHP module (can be specified multiple times). Example: - -ns_param map *.php - -The 'php_value "name val"' command assigns the configuration option name -the value val (can be used multiple times). Example: - -ns_param php_value "session.auto_start 1" - -b) Enabling PHP - -Then enable the PHP module: - -ns_section "ns/server/${servername}/modules" -... -ns_param php ${bindir}/libphp5.so - - -============================================================================= -This has been tested with AOLserver release 3.0. - -AOLserver support has been written by Sascha Schumann . diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c deleted file mode 100644 index c04418aeb6018..0000000000000 --- a/sapi/aolserver/aolserver.c +++ /dev/null @@ -1,619 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* - * TODO: - * - write documentation - * - CGI/1.1 conformance - */ - -/* $Id$ */ - -/* conflict between PHP and AOLserver headers */ -#define Debug php_Debug -#include "php.h" -#undef Debug - -#ifdef HAVE_AOLSERVER - -#ifndef ZTS -#error AOLserver module is only useable in thread-safe mode -#endif - -#include "ext/standard/info.h" -#define SECTION(name) PUTS("

              " name "

              \n") - -#define NS_BUF_SIZE 511 - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#include "ns.h" - -#include "php_version.h" - -/* This symbol is used by AOLserver to tell the API version we expect */ - -int Ns_ModuleVersion = 1; - -#define NSG(v) TSRMG(ns_globals_id, ns_globals_struct *, v) - -/* php_ns_context is per-server (thus only once at all) */ - -typedef struct { - sapi_module_struct *sapi_module; - char *ns_server; - char *ns_module; -} php_ns_context; - -/* ns_globals_struct is per-thread */ - -typedef struct { - Ns_Conn *conn; - size_t data_avail; -} ns_globals_struct; - -/* TSRM id */ - -static int ns_globals_id; - -/* global context */ - -static php_ns_context *global_context; - -static void php_ns_config(php_ns_context *ctx, char global); - -/* - * php_ns_sapi_ub_write() writes data to the client connection. - */ - -static int -php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - uint sent = 0; - - while (str_length > 0) { - n = Ns_ConnWrite(NSG(conn), (void *) str, str_length); - - if (n == -1) - php_handle_aborted_connection(); - - str += n; - sent += n; - str_length -= n; - } - - return sent; -} - -/* - * php_ns_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ - -static int -php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content; - char *p; - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if (p) { - *p = '\0'; - do { - header_content++; - } while (*header_content == ' '); - - if (!strcasecmp(header_name, "Content-type")) { - Ns_ConnSetTypeHeader(NSG(conn), header_content); - } else { - Ns_ConnSetHeaders(NSG(conn), header_name, header_content); - } - - *p = ':'; - } - - sapi_free_header(sapi_header); - - return 0; -} - -/* - * php_ns_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -static int -php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - if(SG(sapi_headers).send_default_content_type) { - Ns_ConnSetRequiredHeaders(NSG(conn), "text/html", 0); - } - - Ns_ConnFlushHeaders(NSG(conn), SG(sapi_headers).http_response_code); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -/* - * php_ns_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -static int -php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint max_read; - uint total_read = 0; - - max_read = MIN(NSG(data_avail), count_bytes); - - total_read = Ns_ConnRead(NSG(conn), buf, max_read); - - if(total_read == NS_ERROR) { - total_read = -1; - } else { - NSG(data_avail) -= total_read; - } - - return total_read; -} - -/* - * php_ns_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char *php_ns_sapi_read_cookies(TSRMLS_D) -{ - int i; - char *http_cookie = NULL; - - i = Ns_SetIFind(NSG(conn->headers), "cookie"); - if(i != -1) { - http_cookie = Ns_SetValue(NSG(conn->headers), i); - } - - return http_cookie; -} - -static void php_info_aolserver(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char buf[512]; - int uptime = Ns_InfoUptime(); - int i; - - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - php_info_print_table_end(); - - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", NSG(conn)->request->line); - for (i = 0; i < Ns_SetSize(NSG(conn)->headers); i++) { - php_info_print_table_row(2, Ns_SetKey(NSG(conn)->headers, i), Ns_SetValue(NSG(conn)->headers, i)); - } - - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - for (i = 0; i < Ns_SetSize(NSG(conn)->outputheaders); i++) { - php_info_print_table_row(2, Ns_SetKey(NSG(conn)->outputheaders, i), Ns_SetValue(NSG(conn)->outputheaders, i)); - } - php_info_print_table_end(); -} - -PHP_FUNCTION(getallheaders); - -static function_entry aolserver_functions[] = { - PHP_FE(getallheaders, NULL) - {NULL, NULL, NULL} -}; - -static zend_module_entry php_aolserver_module = { - STANDARD_MODULE_HEADER, - "AOLserver", - aolserver_functions, - NULL, - NULL, - NULL, - NULL, - php_info_aolserver, - NULL, - STANDARD_MODULE_PROPERTIES -}; - -PHP_FUNCTION(getallheaders) -{ - int i; - - array_init(return_value); - - for (i = 0; i < Ns_SetSize(NSG(conn->headers)); i++) { - char *key = Ns_SetKey(NSG(conn->headers), i); - char *value = Ns_SetValue(NSG(conn->headers), i); - - add_assoc_string(return_value, key, value, 1); - } -} - -static int -php_ns_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_aolserver_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - - -/* - * php_ns_sapi_register_variables() populates the php script environment - * with a number of variables. HTTP_* variables are created for - * the HTTP header data, so that a script can access these. - */ - -#define ADD_STRINGX(name, buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) - -#define ADD_STRING(name) \ - ADD_STRINGX(name, buf) - -static void -php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - int i; - char buf[NS_BUF_SIZE + 1]; - char *tmp; - - for(i = 0; i < Ns_SetSize(NSG(conn->headers)); i++) { - char *key = Ns_SetKey(NSG(conn->headers), i); - char *value = Ns_SetValue(NSG(conn->headers), i); - char *p; - char c; - - snprintf(buf, NS_BUF_SIZE, "HTTP_%s", key); - - for(p = buf + 5; (c = *p); p++) { - c = toupper(c); - if(c < 'A' || c > 'Z') { - c = '_'; - } - *p = c; - } - - ADD_STRINGX(buf, value); - } - - snprintf(buf, NS_BUF_SIZE, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - ADD_STRING("SERVER_SOFTWARE"); - snprintf(buf, NS_BUF_SIZE, "HTTP/%1.1f", NSG(conn)->request->version); - ADD_STRING("SERVER_PROTOCOL"); - - ADD_STRINGX("REQUEST_METHOD", NSG(conn)->request->method); - - if(NSG(conn)->request->query) - ADD_STRINGX("QUERY_STRING", NSG(conn)->request->query); - - ADD_STRINGX("SERVER_BUILDDATE", Ns_InfoBuildDate()); - - ADD_STRINGX("REMOTE_ADDR", Ns_ConnPeer(NSG(conn))); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_ConnPeerPort(NSG(conn))); - ADD_STRING("REMOTE_PORT"); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_ConnPort(NSG(conn))); - ADD_STRING("SERVER_PORT"); - - tmp = Ns_ConnHost(NSG(conn)); - if (tmp) - ADD_STRINGX("SERVER_NAME", tmp); - - ADD_STRINGX("PATH_TRANSLATED", SG(request_info).path_translated); - ADD_STRINGX("REQUEST_URI", SG(request_info).request_uri); - ADD_STRINGX("PHP_SELF", SG(request_info).request_uri); - - ADD_STRINGX("GATEWAY_INTERFACE", "CGI/1.1"); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_InfoBootTime()); - ADD_STRING("SERVER_BOOTTIME"); -} - - - -/* this structure is static (as in "it does not change") */ - -static sapi_module_struct aolserver_sapi_module = { - "aolserver", - "AOLserver", - - php_ns_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_ns_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - php_ns_sapi_header_handler, /* header handler */ - php_ns_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_ns_sapi_read_post, /* read POST data */ - php_ns_sapi_read_cookies, /* read Cookies */ - - php_ns_sapi_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_ns_module_main() is called by the per-request handler and - * "executes" the script - */ - -static int -php_ns_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_ns_config(global_context, 0); - if (php_request_startup(TSRMLS_C) == FAILURE) { - return NS_ERROR; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return NS_OK; -} - -/* - * php_ns_request_ctor() initializes the per-request data structure - * and fills it with data provided by the web server - */ - -static void -php_ns_request_ctor(TSRMLS_D) -{ - char *server; - Ns_DString ds; - char *root; - int index; - char *tmp; - - server = Ns_ConnServer(NSG(conn)); - -#define safe_strdup(x) ((x)?strdup((x)):NULL) - SG(request_info).query_string = safe_strdup(NSG(conn->request->query)); - - Ns_DStringInit(&ds); - Ns_UrlToFile(&ds, server, NSG(conn->request->url)); - - /* path_translated is the absolute path to the file */ - SG(request_info).path_translated = safe_strdup(Ns_DStringValue(&ds)); - Ns_DStringFree(&ds); - root = Ns_PageRoot(server); - SG(request_info).request_uri = strdup(SG(request_info).path_translated + strlen(root)); - SG(request_info).request_method = NSG(conn)->request->method; - if(NSG(conn)->request->version > 1.0) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(request_info).content_length = Ns_ConnContentLength(NSG(conn)); - index = Ns_SetIFind(NSG(conn)->headers, "content-type"); - SG(request_info).content_type = index == -1 ? NULL : - Ns_SetValue(NSG(conn)->headers, index); - SG(sapi_headers).http_response_code = 200; - - tmp = Ns_ConnAuthUser(NSG(conn)); - if (tmp) - tmp = estrdup(tmp); - SG(request_info).auth_user = tmp; - - tmp = Ns_ConnAuthPasswd(NSG(conn)); - if (tmp) - tmp = estrdup(tmp); - SG(request_info).auth_password = tmp; - - NSG(data_avail) = SG(request_info).content_length; -} - -/* - * php_ns_request_dtor() destroys all data associated with - * the per-request structure - */ - -static void -php_ns_request_dtor(TSRMLS_D) -{ - free(SG(request_info).path_translated); - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); -} - -/* - * The php_ns_request_handler() is called per request and handles - * everything for one request. - */ - -static int -php_ns_request_handler(void *context, Ns_Conn *conn) -{ - int status = NS_OK; - TSRMLS_FETCH(); - - NSG(conn) = conn; - - SG(server_context) = global_context; - - php_ns_request_ctor(TSRMLS_C); - - status = php_ns_module_main(TSRMLS_C); - - php_ns_request_dtor(TSRMLS_C); - - return status; -} - -/* - * php_ns_config() fetches the configuration data. - * - * It understands the "map" and "php_value" command. - */ - -static void -php_ns_config(php_ns_context *ctx, char global) -{ - int i; - char *path; - Ns_Set *set; - - path = Ns_ConfigGetPath(ctx->ns_server, ctx->ns_module, NULL); - set = Ns_ConfigGetSection(path); - - for (i = 0; set && i < Ns_SetSize(set); i++) { - char *key = Ns_SetKey(set, i); - char *value = Ns_SetValue(set, i); - - if (global && !strcasecmp(key, "map")) { - Ns_Log(Notice, "Registering PHP for \"%s\"", value); - Ns_RegisterRequest(ctx->ns_server, "GET", value, php_ns_request_handler, NULL, ctx, 0); - Ns_RegisterRequest(ctx->ns_server, "POST", value, php_ns_request_handler, NULL, ctx, 0); - Ns_RegisterRequest(ctx->ns_server, "HEAD", value, php_ns_request_handler, NULL, ctx, 0); - - /* - * Deactivated for now. The ini system will cause random crashes when - * accessed from here (since there are no locks to protect the global - * known_directives) - */ - - } else if (!global && !strcasecmp(key, "php_value")) { - Ns_Log(Notice, "php_value has been deactivated temporarily. Please use a php.ini file to pass directives to PHP. Thanks."); -#if 0 - char *val; - - val = strchr(value, ' '); - if (val) { - char *new_key; - - new_key = estrndup(value, val - value); - - do { - val++; - } while(*val == ' '); - - Ns_Log(Debug, "PHP configuration option '%s=%s'", new_key, val); - zend_alter_ini_entry(new_key, strlen(new_key) + 1, val, - strlen(val) + 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - - efree(new_key); - } -#endif - } - - } -} - -/* - * php_ns_server_shutdown() performs the last steps before the - * server exits. Shutdowns basic services and frees memory - */ - -static void -php_ns_server_shutdown(void *context) -{ - php_ns_context *ctx = (php_ns_context *) context; - - ctx->sapi_module->shutdown(ctx->sapi_module); - sapi_shutdown(); - tsrm_shutdown(); - - free(ctx->ns_module); - free(ctx->ns_server); - free(ctx); -} - -/* - * Ns_ModuleInit() is called by AOLserver once at startup - * - * This functions allocates basic structures and initializes - * basic services. - */ - -int Ns_ModuleInit(char *server, char *module) -{ - php_ns_context *ctx; - - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&aolserver_sapi_module); - sapi_module.startup(&aolserver_sapi_module); - - /* TSRM is used to allocate a per-thread structure */ - ts_allocate_id(&ns_globals_id, sizeof(ns_globals_struct), NULL, NULL); - - /* the context contains data valid for all threads */ - ctx = malloc(sizeof *ctx); - ctx->sapi_module = &aolserver_sapi_module; - ctx->ns_server = strdup(server); - ctx->ns_module = strdup(module); - - /* read the configuration */ - php_ns_config(ctx, 1); - - global_context = ctx; - - /* register shutdown handler */ - Ns_RegisterServerShutdown(server, php_ns_server_shutdown, ctx); - - return NS_OK; -} - -#endif diff --git a/sapi/aolserver/config.m4 b/sapi/aolserver/config.m4 deleted file mode 100644 index 2c905af2cc2fd..0000000000000 --- a/sapi/aolserver/config.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for AOLserver support) -AC_ARG_WITH(aolserver, -[ --with-aolserver=DIR Specify path to the installed AOLserver],[ - PHP_AOLSERVER=$withval -],[ - PHP_AOLSERVER=no -]) -AC_MSG_RESULT($PHP_AOLSERVER) - -if test "$PHP_AOLSERVER" != "no"; then - if test -d "$PHP_AOLSERVER/include"; then - PHP_AOLSERVER_SRC=$PHP_AOLSERVER - fi - if test -z "$PHP_AOLSERVER_SRC" || test ! -d $PHP_AOLSERVER_SRC/include; then - AC_MSG_ERROR(Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR) - fi - if test ! -d $PHP_AOLSERVER/bin ; then - AC_MSG_ERROR(Please specify the path to the root of AOLserver using --with-aolserver=DIR) - fi - PHP_BUILD_THREAD_SAFE - PHP_ADD_INCLUDE($PHP_AOLSERVER_SRC/include) - AC_DEFINE(HAVE_AOLSERVER,1,[Whether you have AOLserver]) - PHP_SELECT_SAPI(aolserver, shared, aolserver.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_AOLSERVER/bin/" -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/aolserver/config.w32 b/sapi/aolserver/config.w32 deleted file mode 100644 index 75b4361efc551..0000000000000 --- a/sapi/aolserver/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('aolserver', 'Build AOLserver support', 'no'); - -if (PHP_AOLSERVER != "no") { - if (PHP_ZTS == "no") { - WARNING("AOLSERVER module requires an --enable-zts build of PHP"); - } else { - if (CHECK_HEADER_ADD_INCLUDE("ns.h", "CFLAGS_AOLSERVER", PHP_AOLSERVER) && CHECK_LIB("nsd.lib", "aolserver", PHP_AOLSERVER)) { - SAPI('aolserver', 'aolserver.c', 'php' + PHP_VERSION + 'aolserver.so', '/D XP_WIN32 '); - } else { - WARNING("sapi/aolserver not enabled: Could not find libraries/headers"); - } - } -} diff --git a/sapi/aolserver/php.sym b/sapi/aolserver/php.sym deleted file mode 100644 index b401ffd2b3ff5..0000000000000 --- a/sapi/aolserver/php.sym +++ /dev/null @@ -1,2 +0,0 @@ -Ns_ModuleVersion -Ns_ModuleInit diff --git a/sapi/aolserver/php5aolserver.dsp b/sapi/aolserver/php5aolserver.dsp deleted file mode 100644 index dd6ad71c533a7..0000000000000 --- a/sapi/aolserver/php5aolserver.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5aolserver" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5aolserver - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5aolserver.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5aolserver.mak" CFG="php5aolserver - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5aolserver - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5aolserver - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5aolserver - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5aolserver - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5aolserver - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "PHPAOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS_inline/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5aolserver - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 nsd.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /out:"..\..\Debug_TS/php5aolserver.so" /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5aolserver - Win32 Release_TS" -# Name "php5aolserver - Win32 Release_TS_inline" -# Name "php5aolserver - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aolserver.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache/CREDITS b/sapi/apache/CREDITS deleted file mode 100644 index 991deb56335c7..0000000000000 --- a/sapi/apache/CREDITS +++ /dev/null @@ -1,3 +0,0 @@ -Apache 1.3 -Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar - diff --git a/sapi/apache/apMakefile.libdir b/sapi/apache/apMakefile.libdir deleted file mode 100644 index 7b5254013a3b6..0000000000000 --- a/sapi/apache/apMakefile.libdir +++ /dev/null @@ -1,4 +0,0 @@ -This is a place-holder which indicates to Configure that it shouldn't -provide the default targets when building the Makefile in this directory. -Instead it'll just prepend all the important variable definitions, and -copy the Makefile.tmpl onto the end. diff --git a/sapi/apache/apMakefile.tmpl b/sapi/apache/apMakefile.tmpl deleted file mode 100644 index 5f77d9c9c9d47..0000000000000 --- a/sapi/apache/apMakefile.tmpl +++ /dev/null @@ -1,77 +0,0 @@ -## -## Apache 1.3 Makefile template for PHP 5.0 Module -## [src/modules/php5/Makefile.tmpl] -## - -# the parametrized target -LIB=libphp5.$(LIBEXT) - -# objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a - -# objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a - -# the general targets -all: lib -lib: $(LIB) - -# build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - -# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - cp libphp5. libphp5.a - -# build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) - rm -f $@ - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) - -# 1. extension .o for shared objects cannot be used here because -# first these files aren't still shared objects and second we -# have to use a different name to trigger the different -# implicit Make rule -# 2. extension -so.o (as used elsewhere) cannot be used because -# the suffix feature of Make really wants just .x, so we use -# extension .so-o -.SUFFIXES: .o .so-o -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< -.c.so-o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o - -# cleanup -clean: - -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB) - -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after -# using it. -depend: - cp Makefile.tmpl Makefile.tmpl.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.tmpl \ - && rm Makefile.new - -#Dependencies - -$(OBJS): Makefile - -# DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ - $(INCDIR)/buff.h \ - $(INCDIR)/http_config.h \ - $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 deleted file mode 100644 index 46286c36866dc..0000000000000 --- a/sapi/apache/config.m4 +++ /dev/null @@ -1,276 +0,0 @@ -dnl -dnl $Id$ -dnl -AC_DEFUN([PHP_APACHE_FD_CHECK], [ -AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ - save=$CPPFLAGS - if test -n "$APXS_INCLUDEDIR"; then - CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR" - else - CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" - fi - AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ - ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) - CPPFLAGS=$save -]) -if test "$ac_cv_php_fd_in_buff" = "yes"; then - AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) -fi -]) - -AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) -AC_ARG_WITH(apxs, -[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional - pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($withval, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I was not able to successfully run APXS. Possible reasons:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed;]) - AC_MSG_RESULT([2. Apache was not compiled with DSO support (--enable-module=so);]) - AC_MSG_RESULT([3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs]) - AC_MSG_RESULT([The output of $APXS follows]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@" - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APACHE_INCLUDE=-I$APXS_INCLUDEDIR - - # Test that we're trying to configure with apache 1.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) - fi - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - case $host_alias in - *aix*) - APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_AIX_LDFLAGS="-Wl,-brtl" - build_type=shared - ;; - *darwin*) - MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" - PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so - build_type=bundle - ;; - *) - build_type=shared - ;; - esac - - PHP_SELECT_SAPI(apache, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) - - # Test whether apxs support -S option - $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 - - if test "$?" != "0"; then - APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option - else - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" - fi - fi - - if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then - PHP_APXS_BROKEN=yes - fi - STRONGHOLD= - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - AC_DEFINE(HAVE_APACHE,1,[ ]) - AC_MSG_RESULT(yes) -],[ - AC_MSG_RESULT(no) -]) - -if test "$PHP_SAPI" != "apache"; then -AC_MSG_CHECKING(for Apache 1.x module support) -AC_ARG_WITH(apache, -[ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache - build directory [/usr/local/apache]],[ - - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php5.* sapi/apache/libphp5.module" - - if test "$withval" = "yes"; then - # Apache's default directory - withval=/usr/local/apache - fi - if test "$withval" != "no"; then - AC_DEFINE(HAVE_APACHE,1,[ ]) - APACHE_MODULE=yes - PHP_EXPAND_PATH($withval, withval) - # For Apache 1.2.x - if test -f $withval/src/httpd.h; then - APACHE_INCLUDE=-I$withval/src - APACHE_TARGET=$withval/src - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET" - PHP_LIBS="-L. -lphp3" - AC_MSG_RESULT(yes - Apache 1.2.x) - STRONGHOLD= - if test -f $withval/src/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - # For Apache 2.0.x - elif test -f $withval/include/httpd.h && - test -f $withval/srclib/apr/include/apr_general.h ; then - AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) - # For Apache 1.3.x - elif test -f $withval/src/main/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap" - APACHE_TARGET=$withval/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - AC_MSG_RESULT(yes - Apache 1.3.x) - STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - # Also for Apache 1.3.x - elif test -f $withval/src/include/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix" - APACHE_TARGET=$withval/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - AC_MSG_RESULT(yes - Apache 1.3.x) - STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - # For StrongHold 2.2 - elif test -f $withval/apache/httpd.h; then - APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include" - APACHE_TARGET=$withval/apache - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" - STRONGHOLD=-DSTRONGHOLD=1 - AC_MSG_RESULT(yes - StrongHold) - if test -f $withval/apache/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval) - fi - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) - -fi - -AC_MSG_CHECKING(for mod_charset compatibility option) -AC_ARG_WITH(mod_charset, -[ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache)], -[ - AC_MSG_RESULT(yes) - AC_DEFINE(USE_TRANSFER_TABLES,1,[ ]) -],[ - AC_MSG_RESULT(no) -]) - -dnl Build as static module -if test -n "$APACHE_MODULE"; then - PHP_TARGET_RDYNAMIC - $php_shtool mkdir -p sapi/apache - PHP_OUTPUT(sapi/apache/libphp5.module) -fi - -dnl General -if test -n "$APACHE_INSTALL"; then - if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache/mod_php5.exp - fi - - PHP_APACHE_FD_CHECK - INSTALL_IT=$APACHE_INSTALL - - PHP_SUBST(APXS_EXP) - PHP_SUBST(APACHE_INCLUDE) - PHP_SUBST(APACHE_TARGET) - PHP_SUBST(APXS) - PHP_SUBST(APXS_LDFLAGS) - PHP_SUBST(APACHE_INSTALL) - PHP_SUBST(STRONGHOLD) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache/config.w32 b/sapi/apache/config.w32 deleted file mode 100644 index 83ceb1a4dbfd9..0000000000000 --- a/sapi/apache/config.w32 +++ /dev/null @@ -1,24 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no'); - -ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null); -ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null); - -if (PHP_APACHE != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE", php_usual_include_suspects + - ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" + - ";..\\php_build\\apache\\src\\include") && - CHECK_LIB("ApacheCore.lib", "apache", php_usual_lib_suspects + - ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' + - ';..\\php_build\\apache\\src\\corer')) { - // We need to play tricks to get our readdir.h used by apache - // headers - SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c', - 'php' + PHP_VERSION + 'apache.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); - } else { - WARNING("Could not find apache libraries/headers"); - } -} diff --git a/sapi/apache/libphp5.module.in b/sapi/apache/libphp5.module.in deleted file mode 100644 index 00d9c49f401bc..0000000000000 --- a/sapi/apache/libphp5.module.in +++ /dev/null @@ -1,11 +0,0 @@ -Name: php5_module -ConfigStart - RULE_WANTHSREGEX=no - RULE_HIDE=yes - PHP_LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LDFLAGS@ @EXTRA_LIBS@ $LIBS" - PHP_CFLAGS="$CFLAGS @OPENSSL_INCDIR_OPT@ -I@php_abs_top_builddir@/main -I@php_abs_top_builddir@/Zend -I@php_abs_top_builddir@/TSRM -I@php_abs_top_srcdir@ -I@php_abs_top_srcdir@/sapi/apache -I@php_abs_top_srcdir@/main -I@php_abs_top_srcdir@/Zend -I@php_abs_top_srcdir@/TSRM" - my_outfile="Makefile.config" - echo "PHP_CFLAGS=$PHP_CFLAGS" >>$my_outfile - echo "PHP_LIBS=$PHP_LIBS" >>$my_outfile - LIBS=$PHP_LIBS -ConfigEnd diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c deleted file mode 100644 index fe0ff878df40d..0000000000000 --- a/sapi/apache/libpre.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef NETWARE - -/* ------------------------------------------------------------------ - * These functions are to be called when the shared NLM starts and - * stops. By using these functions instead of defining a main() - * and calling ExitThread(TSR_THREAD, 0), the load time of the - * shared NLM is faster and memory size reduced. - * - * You may also want to override these in your own Apache module - * to do any cleanup other than the mechanism Apache modules provide. - * ------------------------------------------------------------------ - */ - - -#ifdef __GNUC__ -#include /* memset */ -extern char _edata, _end ; /* end of DATA (start of BSS), end of BSS */ -#endif - -int _lib_start() -{ -/* printf("Inside _lib_start\n");*/ -#ifdef __GNUC__ - memset (&_edata, 0, &_end - &_edata); -#endif - return 0; -} - -int _lib_stop() -{ -/* printf("Inside _lib_stop\n");*/ - return 0; -} - -#endif /* NETWARE */ diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c deleted file mode 100644 index 4ac60b2742dfe..0000000000000 --- a/sapi/apache/mod_php5.c +++ /dev/null @@ -1,983 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by Zeev Suraski | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" -#include "http_conf_globals.h" - -#ifdef NETWARE -#define SIGPIPE SIGINT -#endif - -#undef shutdown - -/* {{{ Prototypes - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); -static void php_save_umask(void); -static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); -static int send_php(request_rec *r, int display_source_mode, char *filename); -static int send_parsed_php(request_rec * r); -static int send_parsed_php_source(request_rec * r); -static int php_xbithack_handler(request_rec * r); -static void php_init_handler(server_rec *s, pool *p); -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -static void php_child_exit_handler(server_rec *s, pool *p); -#endif - -#if MODULE_MAGIC_NUMBER > 19961007 -#define CONST_PREFIX const -#else -#define CONST_PREFIX -#endif -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); - -/* ### these should be defined in mod_php5.h or somewhere else */ -#define USE_PATH 1 -#define IGNORE_URL 2 - -module MODULE_VAR_EXPORT php5_module; - -int saved_umask; -static unsigned char apache_php_initialized; - -typedef struct _php_per_dir_entry { - char *key; - char *value; - uint key_length; - uint value_length; - int type; -} php_per_dir_entry; - -/* some systems are missing these from their header files */ - -/* {{{ php_save_umask - */ -static void php_save_umask(void) -{ - saved_umask = umask(077); - umask(saved_umask); -} -/* }}} */ - -/* {{{ sapi_apache_ub_write - */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int ret=0; - - if (SG(server_context)) { - ret = rwrite(str, str_length, (request_rec *) SG(server_context)); - } - if (ret != str_length) { - php_handle_aborted_connection(); - } - return ret; -} -/* }}} */ - -/* {{{ sapi_apache_flush - */ -static void sapi_apache_flush(void *server_context) -{ - if (server_context) { -#if MODULE_MAGIC_NUMBER > 19970110 - rflush((request_rec *) server_context); -#else - bflush((request_rec *) server_context->connection->client); -#endif - } -} -/* }}} */ - -/* {{{ sapi_apache_read_post - */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - uint total_read_bytes=0, read_bytes; - request_rec *r = (request_rec *) SG(server_context); - void (*handler)(int); - - /* - * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to recieve confirmation from the server on whether or not it can send - * the rest of the request. RFC 2616 - * - */ - if (!SG(read_post_bytes) && !ap_should_client_block(r)) { - return total_read_bytes; - } - - handler = signal(SIGPIPE, SIG_IGN); - while (total_read_bytessubprocess_env, "HTTP_COOKIE"); -} -/* }}} */ - -/* {{{ sapi_apache_header_handler - */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - request_rec *r = (request_rec *) SG(server_context); - if(!r) { - efree(sapi_header->header); - return 0; - } - - header_name = sapi_header->header; - - header_content = p = strchr(header_name, ':'); - if (!p) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content==' '); - - if (!strcasecmp(header_name, "Content-Type")) { - r->content_type = pstrdup(r->pool, header_content); - } else if (!strcasecmp(header_name, "Set-Cookie")) { - table_add(r->headers_out, header_name, header_content); - } else if (sapi_header->replace) { - table_set(r->headers_out, header_name, header_content); - } else { - table_add(r->headers_out, header_name, header_content); - } - - *p = ':'; /* a well behaved header handler shouldn't change its original arguments */ - - return SAPI_HEADER_ADD; -} -/* }}} */ - -/* {{{ sapi_apache_send_headers - */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - request_rec *r = SG(server_context); - - if(r == NULL) { /* server_context is not here anymore */ - return SAPI_HEADER_SEND_FAILED; - } - - r->status = SG(sapi_headers).http_response_code; - if(r->status==304) { - send_error_response(r,0); - } else { - send_http_header(r); - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} -/* }}} */ - -/* {{{ sapi_apache_register_server_variables - */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - register int i; - array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); - table_entry *elts = (table_entry *) arr->elts; - zval **path_translated; - HashTable *symbol_table; - - for (i = 0; i < arr->nelts; i++) { - char *val; - - if (elts[i].val) { - val = elts[i].val; - } else { - val = ""; - } - php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC); - } - - /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ - if (track_vars_array) { - symbol_table = track_vars_array->value.ht; - } else if (PG(register_globals)) { - /* should never happen nowadays */ - symbol_table = EG(active_symbol_table); - } else { - symbol_table = NULL; - } - if (symbol_table - && !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) - && zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC); - } - - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_apache_startup - */ -static int php_apache_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &apache_module_entry, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ php_apache_log_message - */ -static void php_apache_log_message(char *message) -{ - TSRMLS_FETCH(); - - if (SG(server_context)) { -#if MODULE_MAGIC_NUMBER >= 19970831 - aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message); -#else - log_error(message, ((request_rec *) SG(server_context))->server); -#endif - } else { - fprintf(stderr, "%s", message); - fprintf(stderr, "\n"); - } -} -/* }}} */ - -/* {{{ php_apache_request_shutdown - */ -static void php_apache_request_shutdown(void *dummy) -{ - TSRMLS_FETCH(); - - php_output_set_status(0 TSRMLS_CC); - if (AP(in_request)) { - AP(in_request) = 0; - php_request_shutdown(dummy); - } - SG(server_context) = NULL; - /* - * The server context (request) is NOT invalid by the time - * run_cleanups() is called - */ -} -/* }}} */ - -/* {{{ php_apache_sapi_activate - */ -static int php_apache_sapi_activate(TSRMLS_D) -{ - request_rec *r = (request_rec *) SG(server_context); - - /* - * For the Apache module version, this bit of code registers a cleanup - * function that gets triggered when our request pool is destroyed. - * We need this because at any point in our code we can be interrupted - * and that may happen before we have had time to free our memory. - * The php_request_shutdown function needs to free all outstanding allocated - * memory. - */ - block_alarms(); - register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); - AP(in_request)=1; - unblock_alarms(); - - /* Override the default headers_only value - sometimes "GET" requests should actually only - * send headers. - */ - SG(request_info).headers_only = r->header_only; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_stat - */ -static struct stat *php_apache_get_stat(TSRMLS_D) -{ - return &((request_rec *) SG(server_context))->finfo; -} -/* }}} */ - -/* {{{ php_apache_getenv - */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) -{ - if (SG(server_context) == NULL) { - return NULL; - } - - return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); -} -/* }}} */ - -/* {{{ sapi_apache_get_fd - */ -static int sapi_apache_get_fd(int *nfd TSRMLS_DC) -{ -#if PHP_APACHE_HAVE_CLIENT_FD - request_rec *r = SG(server_context); - int fd; - - fd = r->connection->client->fd; - - if (fd >= 0) { - if (nfd) *nfd = fd; - return SUCCESS; - } -#endif - return FAILURE; -} -/* }}} */ - -/* {{{ sapi_apache_force_http_10 - */ -static int sapi_apache_force_http_10(TSRMLS_D) -{ - request_rec *r = SG(server_context); - - r->proto_num = HTTP_VERSION(1,0); - - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_apache_get_target_uid - */ -static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) -{ - *obj = ap_user_id; - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_apache_get_target_gid - */ -static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) -{ - *obj = ap_group_id; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_request_time - */ -static time_t php_apache_get_request_time(TSRMLS_D) -{ - return ((request_rec *)SG(server_context))->request_time; -} -/* }}} */ - -/* {{{ sapi_module_struct apache_sapi_module - */ -static sapi_module_struct apache_sapi_module = { - "apache", /* name */ - "Apache", /* pretty name */ - - php_apache_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - php_apache_sapi_activate, /* activate */ - NULL, /* deactivate */ - - sapi_apache_ub_write, /* unbuffered write */ - sapi_apache_flush, /* flush */ - php_apache_get_stat, /* get uid */ - php_apache_getenv, /* getenv */ - - php_error, /* error handler */ - - sapi_apache_header_handler, /* header handler */ - sapi_apache_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_apache_read_post, /* read POST data */ - sapi_apache_read_cookies, /* read Cookies */ - - sapi_apache_register_server_variables, /* register server variables */ - php_apache_log_message, /* Log message */ - php_apache_get_request_time, /* Get request time */ - - NULL, /* php.ini path override */ - -#ifdef PHP_WIN32 - NULL, - NULL, -#else - block_alarms, /* Block interruptions */ - unblock_alarms, /* Unblock interruptions */ -#endif - - NULL, /* default post reader */ - NULL, /* treat data */ - NULL, /* exe location */ - 0, /* ini ignore */ - sapi_apache_get_fd, - sapi_apache_force_http_10, - sapi_apache_get_target_uid, - sapi_apache_get_target_gid -}; -/* }}} */ - -/* {{{ php_restore_umask - */ -static void php_restore_umask(void) -{ - umask(saved_umask); -} -/* }}} */ - -/* {{{ init_request_info - */ -static void init_request_info(TSRMLS_D) -{ - request_rec *r = ((request_rec *) SG(server_context)); - char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); - const char *authorization=NULL; - char *tmp, *tmp_user; - - SG(request_info).query_string = r->args; - SG(request_info).path_translated = r->filename; - SG(request_info).request_uri = r->uri; - SG(request_info).request_method = (char *)r->method; - SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - SG(sapi_headers).http_response_code = r->status; - SG(request_info).proto_num = r->proto_num; - - if (r->headers_in) { - authorization = table_get(r->headers_in, "Authorization"); - } - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - SG(request_info).auth_digest = NULL; - - if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) { - char *p = getword(r->pool, &authorization, ' '); - if (!strcasecmp(p, "Basic")) { - tmp = uudecode(r->pool, authorization); - tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); - if (tmp_user) { - r->connection->user = pstrdup(r->connection->pool, tmp_user); - r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(tmp_user); - } - if (tmp) { - SG(request_info).auth_password = estrdup(tmp); - } - } else if (!strcasecmp(p, "Digest")) { - r->connection->ap_auth_type = "Digest"; - SG(request_info).auth_digest = estrdup(authorization); - } - } -} -/* }}} */ - -/* {{{ php_apache_alter_ini_entries - */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) -{ - zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE); - return 0; -} -/* }}} */ - -/* {{{ php_apache_get_default_mimetype - */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) -{ - - char *mimetype; - /* Assume output will be of the default MIME type. Individual - scripts may change this later. */ - char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); - mimetype = pstrdup(r->pool, tmpmimetype); - efree(tmpmimetype); - return mimetype; -} -/* }}} */ - -/* {{{ send_php - */ -static int send_php(request_rec *r, int display_source_mode, char *filename) -{ - int retval; - HashTable *per_dir_conf; - TSRMLS_FETCH(); - - if (AP(in_request)) { - zend_file_handle fh; - - fh.filename = r->filename; - fh.opened_path = NULL; - fh.free_filename = 0; - fh.type = ZEND_HANDLE_FILENAME; - - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); - return OK; - } - - zend_first_try { - - /* Make sure file exists */ - if (filename == NULL && r->finfo.st_mode == 0) { - return DECLINED; - } - - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - - /* If PHP parser engine has been turned off with an "engine off" - * directive, then decline to handle this request - */ - if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - if (filename == NULL) { - filename = r->filename; - } - - /* Apache 1.2 has a more complex mechanism for reading POST data */ -#if MODULE_MAGIC_NUMBER > 19961007 - if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#endif - - if (AP(last_modified)) { -#if MODULE_MAGIC_NUMBER < 19970912 - if ((retval = set_last_modified(r, r->finfo.st_mtime))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#else - update_mtime (r, r->finfo.st_mtime); - set_last_modified(r); - set_etag(r); -#endif - } - /* Assume output will be of the default MIME type. Individual - scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - - /* Init timeout */ - hard_timeout("send", r); - - SG(server_context) = r; - - php_save_umask(); - add_common_vars(r); - add_cgi_vars(r); - - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); - - /* Done, restore umask, turn off timeout, close file and return */ - php_restore_umask(); - kill_timeout(r); - } zend_end_try(); - - return OK; -} -/* }}} */ - -/* {{{ send_parsed_php - */ -static int send_parsed_php(request_rec * r) -{ - int result = send_php(r, 0, NULL); - -#if MEMORY_LIMIT - { - char *mem_usage; - TSRMLS_FETCH(); - - mem_usage = ap_psprintf(r->pool, "%u", AG(allocated_memory_peak)); - AG(allocated_memory_peak) = 0; - ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage); - } -#endif - - return result; -} -/* }}} */ - -/* {{{ send_parsed_php_source - */ -static int send_parsed_php_source(request_rec * r) -{ - return send_php(r, 1, NULL); -} -/* }}} */ - -/* {{{ destroy_per_dir_entry - */ -static void destroy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - free(per_dir_entry->key); - free(per_dir_entry->value); -} -/* }}} */ - -/* {{{ copy_per_dir_entry - */ -static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - php_per_dir_entry tmp = *per_dir_entry; - - per_dir_entry->key = (char *) malloc(tmp.key_length+1); - memcpy(per_dir_entry->key, tmp.key, tmp.key_length); - per_dir_entry->key[per_dir_entry->key_length] = 0; - - per_dir_entry->value = (char *) malloc(tmp.value_length+1); - memcpy(per_dir_entry->value, tmp.value, tmp.value_length); - per_dir_entry->value[per_dir_entry->value_length] = 0; -} -/* }}} */ - -/* {{{ should_overwrite_per_dir_entry - */ -static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *new_per_dir_entry, zend_hash_key *hash_key, void *pData) -{ - php_per_dir_entry *orig_per_dir_entry; - - if (zend_u_hash_find(target_ht, hash_key->type, hash_key->u.string, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) { - return 1; /* does not exist in dest, copy from source */ - } - - if (new_per_dir_entry->type==PHP_INI_SYSTEM - && orig_per_dir_entry->type!=PHP_INI_SYSTEM) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ php_destroy_per_dir_info - */ -static void php_destroy_per_dir_info(HashTable *per_dir_info) -{ - zend_hash_destroy(per_dir_info); - free(per_dir_info); -} -/* }}} */ - -/* {{{ php_create_dir - */ -static void *php_create_dir(pool *p, char *dummy) -{ - HashTable *per_dir_info; - - per_dir_info = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(per_dir_info, 5, NULL, (void (*)(void *)) destroy_per_dir_entry, 1, 0); - register_cleanup(p, (void *) per_dir_info, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) zend_hash_destroy); - - return per_dir_info; -} -/* }}} */ - -/* {{{ php_merge_dir - */ -static void *php_merge_dir(pool *p, void *basev, void *addv) -{ - /* This function *must* return addv, and not modify basev */ - zend_hash_merge_ex((HashTable *) addv, (HashTable *) basev, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); - return addv; -} -/* }}} */ - -/* {{{ php_apache_value_handler_ex - */ -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - php_per_dir_entry per_dir_entry; - - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } - per_dir_entry.type = mode; - - if (strcasecmp(arg2, "none") == 0) { - arg2 = ""; - } - - per_dir_entry.key_length = strlen(arg1); - per_dir_entry.value_length = strlen(arg2); - - per_dir_entry.key = (char *) malloc(per_dir_entry.key_length+1); - memcpy(per_dir_entry.key, arg1, per_dir_entry.key_length); - per_dir_entry.key[per_dir_entry.key_length] = 0; - - per_dir_entry.value = (char *) malloc(per_dir_entry.value_length+1); - memcpy(per_dir_entry.value, arg2, per_dir_entry.value_length); - per_dir_entry.value[per_dir_entry.value_length] = 0; - - zend_hash_update(conf, per_dir_entry.key, per_dir_entry.key_length, &per_dir_entry, sizeof(php_per_dir_entry), NULL); - return NULL; -} -/* }}} */ - -/* {{{ php_apache_value_handler - */ -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_value_handler - */ -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_flag_handler_ex - */ -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode); -} -/* }}} */ - -/* {{{ php_apache_flag_handler - */ -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_flag_handler - */ -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ int php_xbithack_handler(request_rec * r) - */ -static int php_xbithack_handler(request_rec * r) -{ - HashTable *per_dir_conf; - TSRMLS_FETCH(); - - if (!(r->finfo.st_mode & S_IXUSR)) { - r->allowed |= (1 << METHODS) - 1; - return DECLINED; - } - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - if(!AP(xbithack)) { - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - return send_parsed_php(r); -} -/* }}} */ - -/* {{{ apache_php_module_shutdown_wrapper - */ -static void apache_php_module_shutdown_wrapper(void) -{ - apache_php_initialized = 0; - apache_sapi_module.shutdown(&apache_sapi_module); - -#if MODULE_MAGIC_NUMBER >= 19970728 - /* This function is only called on server exit if the apache API - * child_exit handler exists, so shutdown globally - */ - sapi_shutdown(); -#endif - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -/* {{{ php_child_exit_handler - */ -static void php_child_exit_handler(server_rec *s, pool *p) -{ -/* apache_php_initialized = 0; */ - apache_sapi_module.shutdown(&apache_sapi_module); - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ -#endif - -/* {{{ void php_init_handler(server_rec *s, pool *p) - */ -static void php_init_handler(server_rec *s, pool *p) -{ - register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } -#if MODULE_MAGIC_NUMBER >= 19980527 - { - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component("PHP/" PHP_VERSION); - } - } -#endif -} -/* }}} */ - -/* {{{ handler_rec php_handlers[] - */ -handler_rec php_handlers[] = -{ - {"application/x-httpd-php", send_parsed_php}, - {"application/x-httpd-php-source", send_parsed_php_source}, - {"text/html", php_xbithack_handler}, - {NULL} -}; -/* }}} */ - -/* {{{ command_rec php_commands[] - */ -command_rec php_commands[] = -{ - {"php_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"}, - {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, - {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, - {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, - {NULL} -}; -/* }}} */ - -/* {{{ odule MODULE_VAR_EXPORT php5_module - */ -module MODULE_VAR_EXPORT php5_module = -{ - STANDARD_MODULE_STUFF, - php_init_handler, /* initializer */ - php_create_dir, /* per-directory config creator */ - php_merge_dir, /* dir merger */ - NULL, /* per-server config creator */ - NULL, /* merge server config */ - php_commands, /* command table */ - php_handlers, /* handlers */ - NULL, /* filename translation */ - NULL, /* check_user_id */ - NULL, /* check auth */ - NULL, /* check access */ - NULL, /* type_checker */ - NULL, /* fixups */ - NULL /* logger */ -#if MODULE_MAGIC_NUMBER >= 19970103 - , NULL /* header parser */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970719 - , NULL /* child_init */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970728 - , php_child_exit_handler /* child_exit */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970902 - , NULL /* post read-request */ -#endif -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache/mod_php5.exp b/sapi/apache/mod_php5.exp deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php5.h deleted file mode 100644 index 1b28b0ffb98f5..0000000000000 --- a/sapi/apache/mod_php5.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef MOD_PHP5_H -#define MOD_PHP5_H - -#if !defined(WIN32) && !defined(WINNT) -#ifndef MODULE_VAR_EXPORT -#define MODULE_VAR_EXPORT -#endif -#endif - -typedef struct { - long engine; - long last_modified; - long xbithack; - long terminate_child; - zend_bool in_request; -} php_apache_info_struct; - -extern zend_module_entry apache_module_entry; - -#ifdef ZTS -extern int php_apache_info_id; -#define AP(v) TSRMG(php_apache_info_id, php_apache_info_struct *, v) -#else -extern php_apache_info_struct php_apache_info; -#define AP(v) (php_apache_info.v) -#endif - -#endif /* MOD_PHP5_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/apache/php.sym b/sapi/apache/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache/php5apache.dsp b/sapi/apache/php5apache.dsp deleted file mode 100644 index fbdb7612b8691..0000000000000 --- a/sapi/apache/php5apache.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache.mak" CFG="php5apache - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ELSEIF "$(CFG)" == "php5apache - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\release" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ELSEIF "$(CFG)" == "php5apache - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ENDIF - -# Begin Target - -# Name "php5apache - Win32 Release_TS" -# Name "php5apache - Win32 Debug_TS" -# Name "php5apache - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_apache.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mod_php5.h -# End Source File -# Begin Source File - -SOURCE=.\php_apache_http.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c deleted file mode 100644 index adb3e77552d64..0000000000000 --- a/sapi/apache/php_apache.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Sĉther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#if defined(PHP_WIN32) || defined(NETWARE) -#include "zend.h" -#include "ap_compat.h" -#endif - -#ifdef ZTS -int php_apache_info_id; -#else -php_apache_info_struct php_apache_info; -#endif - -#define SECTION(name) PUTS("

              " name "

              \n") - -extern module *top_module; -extern module **ap_loaded_modules; - -PHP_FUNCTION(virtual); -PHP_FUNCTION(apache_request_headers); -PHP_FUNCTION(apache_response_headers); -PHP_FUNCTION(apachelog); -PHP_FUNCTION(apache_note); -PHP_FUNCTION(apache_lookup_uri); -PHP_FUNCTION(apache_child_terminate); -PHP_FUNCTION(apache_setenv); -PHP_FUNCTION(apache_get_version); -PHP_FUNCTION(apache_get_modules); -PHP_FUNCTION(apache_reset_timeout); - -PHP_MINFO_FUNCTION(apache); - -function_entry apache_functions[] = { - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(apache_child_terminate, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("child_terminate", "0", PHP_INI_ALL, OnUpdateLong, terminate_child, php_apache_info_struct, php_apache_info) -PHP_INI_END() - - - -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) -{ - apache_globals->in_request = 0; -} - - -static PHP_MINIT_FUNCTION(apache) -{ -#ifdef ZTS - ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); -#else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); -#endif - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry apache_module_entry = { - STANDARD_MODULE_HEADER, - "apache", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* {{{ proto bool apache_child_terminate(void) - Terminate apache process after this request */ -PHP_FUNCTION(apache_child_terminate) -{ -#ifndef MULTITHREAD - if (AP(terminate_child)) { - ap_child_terminate( ((request_rec *)SG(server_context)) ); - RETURN_TRUE; - } else { /* tell them to get lost! */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled"); - RETURN_FALSE; - } -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - pval **arg_name, **arg_val; - char *note_val; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg_name); - note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val); - - if (arg_count == 2) { - convert_to_string_ex(arg_val); - table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val); - } - - if (note_val) { - RETURN_STRING(note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(apache) -{ - char *apv = (char *) ap_get_server_version(); - module *modp = NULL; - char output_buf[128]; -#if !defined(WIN32) && !defined(WINNT) - char name[64]; - char modulenames[1024]; - char *p; -#endif - server_rec *serv; - extern char server_root[MAX_STRING_LEN]; - extern uid_t user_id; - extern char *user_name; - extern gid_t group_id; - extern int max_requests_per_child; - - serv = ((request_rec *) SG(server_context))->server; - - - php_info_print_table_start(); - -#ifdef PHP_WIN32 - php_info_print_table_row(1, "Apache for Windows 95/NT"); - php_info_print_table_end(); - php_info_print_table_start(); -#elif defined(NETWARE) - php_info_print_table_row(1, "Apache for NetWare"); - php_info_print_table_end(); - php_info_print_table_start(); -#else - php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE); - php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET); -#endif - - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - -#ifdef APACHE_RELEASE - sprintf(output_buf, "%d", APACHE_RELEASE); - php_info_print_table_row(2, "Apache Release", output_buf); -#endif - sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", output_buf); - sprintf(output_buf, "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", output_buf); -#if !defined(WIN32) && !defined(WINNT) - sprintf(output_buf, "%s(%d)/%d", user_name, (int)user_id, (int)group_id); - php_info_print_table_row(2, "User/Group", output_buf); - sprintf(output_buf, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", output_buf); -#endif - sprintf(output_buf, "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout); - php_info_print_table_row(2, "Timeouts", output_buf); -#if !defined(WIN32) && !defined(WINNT) -/* - This block seems to be working on NetWare; But it seems to be showing - all modules instead of just the loaded ones -*/ - php_info_print_table_row(2, "Server Root", server_root); - - strcpy(modulenames, ""); - for(modp = top_module; modp; modp = modp->next) { - strlcpy(name, modp->name, sizeof(name)); - if ((p = strrchr(name, '.'))) { - *p='\0'; /* Cut off ugly .c extensions on module names */ - } - strcat(modulenames, name); - if (modp->next) { - strcat(modulenames, ", "); - } - } - php_info_print_table_row(2, "Loaded Modules", modulenames); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - register int i; - array_header *arr; - table_entry *elts; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - arr = table_elts(r->subprocess_env); - elts = (table_entry *)arr->elts; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - for (i=0; i < arr->nelts; i++) { - php_info_print_table_row(2, elts[i].key, elts[i].val); - } - php_info_print_table_end(); - } - - { - array_header *env_arr; - table_entry *env; - int i; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", r->the_request); - env_arr = table_elts(r->headers_in); - env = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - env_arr = table_elts(r->headers_out); - env = (table_entry *)env_arr->elts; - for(i = 0; i < env_arr->nelts; ++i) { - if (env[i].key) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_end(); - } -} -/* }}} */ - -/* {{{ proto bool virtual(string filename) - Perform an Apache sub-request */ -/* This function is equivalent to - * in mod_include. It does an Apache sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through Apache (for .phtml files, you'd probably - * want to use . This only works when PHP is compiled - * as an Apache module, since it uses the Apache API for doing - * sub requests. - */ -PHP_FUNCTION(virtual) -{ - pval **filename; - request_rec *rr = NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - if (rr->status != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - if (run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } else { - if (rr) destroy_sub_req (rr); - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array getallheaders(void) - Alias for apache_request_headers() */ -/* }}} */ -/* {{{ proto array apache_request_headers(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(((request_rec *) SG(server_context))->headers_in); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key || - (PG(safe_mode) && - !strncasecmp(tenv[i].key, "authorization", 13))) { - continue; - } - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(((request_rec *) SG(server_context))->headers_out); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key) continue; - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } -} -/* }}} */ - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - int var_len, val_len, top=0; - char *var = NULL, *val = NULL; - request_rec *r = (request_rec *) SG(server_context); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { - RETURN_FALSE; - } - - while(top) { - if(r->prev) r = r->prev; - else break; - } - - ap_table_setn(r->subprocess_env, ap_pstrndup(r->pool, var, var_len), ap_pstrndup(r->pool, val, val_len)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object apache_lookup_uri(string URI) - Perform a partial request of the given URI to obtain information about it */ -PHP_FUNCTION(apache_lookup_uri) -{ - pval **filename; - request_rec *rr=NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", (*filename)->value.str.val); - RETURN_FALSE; - } - object_init(return_value); - add_property_long(return_value,"status", rr->status); - if (rr->the_request) { - add_property_string(return_value,"the_request", rr->the_request, 1); - } - if (rr->status_line) { - add_property_string(return_value,"status_line", (char *)rr->status_line, 1); - } - if (rr->method) { - add_property_string(return_value,"method", (char *)rr->method, 1); - } - if (rr->content_type) { - add_property_string(return_value,"content_type", (char *)rr->content_type, 1); - } - if (rr->handler) { - add_property_string(return_value,"handler", (char *)rr->handler, 1); - } - if (rr->uri) { - add_property_string(return_value,"uri", rr->uri, 1); - } - if (rr->filename) { - add_property_string(return_value,"filename", rr->filename, 1); - } - if (rr->path_info) { - add_property_string(return_value,"path_info", rr->path_info, 1); - } - if (rr->args) { - add_property_string(return_value,"args", rr->args, 1); - } - if (rr->boundary) { - add_property_string(return_value,"boundary", rr->boundary, 1); - } - add_property_long(return_value,"no_cache", rr->no_cache); - add_property_long(return_value,"no_local_copy", rr->no_local_copy); - add_property_long(return_value,"allowed", rr->allowed); - add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); - add_property_long(return_value,"bytes_sent", rr->bytes_sent); - add_property_long(return_value,"byterange", rr->byterange); - add_property_long(return_value,"clength", rr->clength); - -#if MODULE_MAGIC_NUMBER >= 19980324 - if (rr->unparsed_uri) { - add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); - } - if(rr->mtime) { - add_property_long(return_value,"mtime", rr->mtime); - } -#endif - if(rr->request_time) { - add_property_long(return_value,"request_time", rr->request_time); - } - - destroy_sub_req(rr); -} -/* }}} */ - - -#if 0 -This function is most likely a bad idea. Just playing with it for now. - -PHP_FUNCTION(apache_exec_uri) -{ - pval **filename; - request_rec *rr=NULL; - TSRMLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - RETVAL_LONG(ap_run_sub_req(rr)); - ap_destroy_sub_req(rr); -} -#endif - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = (char *) ap_get_server_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -/* {{{ proto bool apache_reset_timeout(void) - Reset the Apache write timer */ -PHP_FUNCTION(apache_reset_timeout) -{ - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode"); - RETURN_FALSE; - } - - ap_reset_timeout((request_rec *)SG(server_context)); - RETURN_TRUE; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h deleted file mode 100644 index cf4a9a4abbd9d..0000000000000 --- a/sapi/apache/php_apache_http.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Sĉther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define NO_REGEX_EXTRA_H - -#ifdef WIN32 -#include -#endif - -#ifdef NETWARE -#include -#endif - -#include "zend.h" -#include "php_regex.h" -#include "php_compat.h" - -#ifdef HAVE_OPENSSL_EXT -/* zlib typedefs free_func which causes problems if the SSL includes happen - * after zlib.h is included */ -# include -#endif - -#ifdef regex_t -#undef regex_t -#endif - -#include "httpd.h" -#include "http_config.h" - -#if MODULE_MAGIC_NUMBER > 19980712 -# include "ap_compat.h" -#else -# if MODULE_MAGIC_NUMBER > 19980324 -# include "compat.h" -# endif -#endif - -#include "http_core.h" -#include "http_main.h" -#include "http_protocol.h" -#include "http_request.h" -#include "http_log.h" -#include "util_script.h" - -#include "php_variables.h" -#include "php_main.h" -#include "php_ini.h" -#include "ext/standard/php_standard.h" - -#include "mod_php5.h" diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c deleted file mode 100644 index 76ecc27d39f6c..0000000000000 --- a/sapi/apache/sapi_apache.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by: | - | Zeev Suraski | - | Stig Bakken | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -/* {{{ apache_php_module_main - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) -{ - int retval = OK; - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - /* sending a file handle to another dll is not working - so let zend open it. */ - - if (display_source_mode) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC) != SUCCESS) { - retval = NOT_FOUND; - } - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.handle.fd = 0; - file_handle.filename = SG(request_info).path_translated; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - (void) php_execute_script(&file_handle TSRMLS_CC); - } - - AP(in_request) = 0; - - zend_try { - php_request_shutdown(NULL); - } zend_end_try(); - - return retval; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/CREDITS b/sapi/apache2filter/CREDITS deleted file mode 100644 index c298a9bf6a8a2..0000000000000 --- a/sapi/apache2filter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 2.0 Filter -Sascha Schumann, Aaron Bannert diff --git a/sapi/apache2filter/EXPERIMENTAL b/sapi/apache2filter/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/apache2filter/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/apache2filter/README b/sapi/apache2filter/README deleted file mode 100644 index 3054e208d3466..0000000000000 --- a/sapi/apache2filter/README +++ /dev/null @@ -1,71 +0,0 @@ -WHAT IS THIS? - - This module exploits the layered I/O support in Apache 2.0. - -HOW DOES IT WORK? - - In Apache 2.0, you have handlers which generate content (like - reading a script from disk). The content goes then through - a chain of filters. PHP can be such a filter, so that it processes - your script and hands the output to the next filter (which will - usually cause a write to the network). - -DOES IT WORK? - - It is experimental as interfaces in Apache 2.0 might change in the - future. - -HOW TO INSTALL - - This SAPI module is known to work with Apache 2.0.40. - - $ cd apache-2.x - $ cd src - $ ./configure --enable-so - $ make install - - For testing purposes, you might want to use --with-mpm=prefork. - (Albeit PHP also works with threaded MPMs.) - - Configure PHP 4: - - $ cd php-4.x - $ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs - $ make install - - At the end of conf/httpd.conf, add: - - AddType application/x-httpd-php .php - - If you would like to enable source code highlighting functionality add: - - AddType application/x-httpd-php-source .phps - - That's it. Now start bin/httpd. - -HOW TO CONFIGURE - - The Apache 2.0 PHP module supports a new configuration directive that - allows an admin to override the php.ini search path. For example, - place your php.ini file in Apache's ServerRoot/conf directory and - add this to your httpd.conf file: - - PHPINIDir "conf" - -DEBUGGING APACHE AND PHP - - To debug Apache, we recommened: - - 1. Use the Prefork MPM (Apache 1.3-like process model) by - configuring Apache with '--with-mpm=prefork'. - 2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS). - - If you want to debug a part of the PHP startup procedure, set a - breakpoint on 'load_module'. Step through it until apr_dso_load() is - done. Then you can set a breakpoint on any PHP-related symbol. - -TODO - - PHP functions like apache_sub_req (see php_functions.c) - Protocol handlers - Passing script data to engine without temporary file diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c deleted file mode 100644 index 92c7f9b4b1388..0000000000000 --- a/sapi/apache2filter/apache_config.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_ini.h" -#include "php_apache.h" - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#ifdef PHP_AP_DEBUG -#define phpapdebug(a) fprintf a -#else -#define phpapdebug(a) -#endif - -typedef struct { - HashTable config; -} php_conf_rec; - -typedef struct { - char *value; - size_t value_len; - char status; -} php_dir_entry; - -static const char *real_value_hnd(cmd_parms *cmd, void *dummy, - const char *name, const char *value, int status) -{ - php_conf_rec *d = dummy; - php_dir_entry e; - - phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, - zend_hash_num_elements(&d->config))); - - if (!strncasecmp(value, "none", sizeof("none"))) { - value = ""; - } - - e.value = apr_pstrdup(cmd->pool, value); - e.value_len = strlen(value); - e.status = status; - - zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, - sizeof(e), NULL); - return NULL; -} - -static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, - const char *arg2, int status) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return real_value_hnd(cmd, dummy, arg1, bool_val, status); -} - -static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, - const char *arg) -{ - if (apache2_php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree " - "- subsequent ones ignored"; - } - apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} - - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) -{ - php_conf_rec *d = base_conf, *e = new_conf; - php_dir_entry *pe; - php_dir_entry *data; - char *str; - uint str_len; - ulong num_index; - - phpapdebug((stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf)); - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, - &num_index, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - pe = NULL; - zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) { - if (pe->status >= data->status) continue; - } - zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL); - phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, - data->status, pe?pe->status:-1)); - } - return new_conf; -} - -char *get_php_config(void *conf, char *name, size_t name_len) -{ - php_conf_rec *d = conf; - php_dir_entry *pe; - - if (zend_hash_find(&d->config, name, name_len, (void **) &pe) == SUCCESS) { - return pe->value; - } - - return ""; -} - -void apply_config(void *dummy) -{ - php_conf_rec *d = dummy; - char *str; - uint str_len; - php_dir_entry *data; - - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, - NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - zend_hash_get_current_data(&d->config, (void **) &data); - phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); - if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, - data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) { - phpapdebug((stderr, "..FAILED\n")); - } - } -} - -const command_rec php_dir_cmds[] = -{ - AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, - "PHP Value Modifier"), - AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, - "PHP Flag Modifier"), - AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, - ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), - AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, - ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), - AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, - "Directory containing the php.ini file"), - {NULL} -}; - -static apr_status_t destroy_php_config(void *data) -{ - php_conf_rec *d = data; - - phpapdebug((stderr, "Destroying config %p\n", data)); - zend_hash_destroy(&d->config); - - return APR_SUCCESS; -} - -void *create_php_config(apr_pool_t *p, char *dummy) -{ - php_conf_rec *newx = - (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); - - phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); - zend_hash_init(&newx->config, 0, NULL, NULL, 1); - apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); - return (void *) newx; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 deleted file mode 100644 index 47b397cf6d7b2..0000000000000 --- a/sapi/apache2filter/config.m4 +++ /dev/null @@ -1,130 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for Apache 2.0 filter-module support via DSO through APXS) -AC_ARG_WITH(apxs2filter, -[ --with-apxs2filter[=FILE] - EXPERIMENTAL: Build shared Apache 2.0 Filter module. FILE is the optional - pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($withval, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed]) - AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2filter=/path/to/apxs]) - AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)]) - AC_MSG_RESULT() - AC_MSG_RESULT([The output of $APXS follows:]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_BINDIR=`$APXS -q BINDIR` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_MPM=`$APXS -q MPM_NAME` - APU_BINDIR=`$APXS -q APU_BINDIR` - APR_BINDIR=`$APXS -q APR_BINDIR` - - # Pick up ap[ru]-N-config if using httpd >=2.1 - APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null || - echo $APR_BINDIR/apr-config` - APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null || - echo $APU_BINDIR/apu-config` - - APR_CFLAGS="`$APR_CONFIG --cppflags --includes`" - APU_CFLAGS="`$APU_CONFIG --includes`" - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS" - - # Test that we're trying to configure with apache 2.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) - elif test "$APACHE_VERSION" -lt 2000040; then - AC_MSG_ERROR([Please note that Apache version >= 2.0.40 is required]) - fi - - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" - fi - - case $host_alias in - *aix*) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *darwin*) - dnl When using bundles on Darwin, we must resolve all symbols. However, - dnl the linker does not recursively look at the bundle loader and - dnl pull in its dependencies. Therefore, we must pull in the APR - dnl and APR-util libraries. - if test -x "$APR_CONFIG"; then - MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`" - fi - if test -x "$APU_CONFIG"; then - MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS" - fi - MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" - PHP_SUBST(MH_BUNDLE_FLAGS) - PHP_SELECT_SAPI(apache2filter, bundle, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - SAPI_SHARED=libs/libphp5.so - INSTALL_IT="$INSTALL_IT $SAPI_SHARED" - ;; - *beos*) - if test -f _APP_; then `rm _APP_`; fi - `ln -s $APXS_BINDIR/httpd _APP_` - EXTRA_LIBS="$EXTRA_LIBS _APP_" - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *) - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - esac - - if test "$APXS_MPM" != "prefork"; then - PHP_BUILD_THREAD_SAFE - fi - AC_MSG_RESULT(yes) - - PHP_SUBST(APXS) -],[ - AC_MSG_RESULT(no) -]) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache2filter/php.sym b/sapi/apache2filter/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache2filter/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h deleted file mode 100644 index 9041ea0f60157..0000000000000 --- a/sapi/apache2filter/php_apache.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_APACHE_H -#define PHP_APACHE_H - -#include "httpd.h" -#include "http_config.h" -#include "http_core.h" - -/* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; - -/* A way to specify the location of the php.ini dir in an apache directive */ -extern char *apache2_php_ini_path_override; - -/* The server_context used by PHP */ -typedef struct php_struct { - int state; - request_rec *r; - ap_filter_t *f; /* downstream output filters after the PHP filter. */ - /* Length of post_data buffer */ - int post_len; - /* Index for reading from buffer */ - int post_idx; - /* stat structure of the current file */ - struct stat finfo; - /* Buffer for request body filter */ - char *post_data; - /* Whether or not we've processed PHP in the output filters yet. */ - int request_processed; -} php_struct; - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf); -void *create_php_config(apr_pool_t *p, char *dummy); -char *get_php_config(void *conf, char *name, size_t name_len); -void apply_config(void *); -extern const command_rec php_dir_cmds[]; - -#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ -{ \ - apr_table_entry_t *elts; \ - int i; \ - elts = (apr_table_entry_t *) arr->elts; \ - for (i = 0; i < arr->nelts; i++) { \ - key = elts[i].key; \ - val = elts[i].val; - -#define APR_ARRAY_FOREACH_CLOSE() }} - -#endif /* PHP_APACHE_H */ diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c deleted file mode 100644 index a8191d0fbdd1d..0000000000000 --- a/sapi/apache2filter/php_functions.c +++ /dev/null @@ -1,392 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "SAPI.h" - -#define CORE_PRIVATE -#include "apr_strings.h" -#include "apr_time.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#include "php_apache.h" - -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) -{ - php_struct *ctx; - - if (!filename) { - return NULL; - } - - ctx = SG(server_context); - return ap_sub_req_lookup_uri(filename, ctx->f->r, ctx->f->next); -} - -/* {{{ proto bool virtual(string uri) - Perform an apache sub-request */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - ap_destroy_sub_req(rr); - RETURN_TRUE; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} -/* }}} */ - -#define ADD_LONG(name) \ - add_property_long(return_value, #name, rr->name) -#define ADD_TIME(name) \ - add_property_long(return_value, #name, apr_time_sec(rr->name)); -#define ADD_STRING(name) \ - if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) - -PHP_FUNCTION(apache_lookup_uri) -{ - request_rec *rr; - zval **filename; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - object_init(return_value); - - ADD_LONG(status); - ADD_STRING(the_request); - ADD_STRING(status_line); - ADD_STRING(method); - ADD_TIME(mtime); - ADD_LONG(clength); -#if MODULE_MAGIC_NUMBER < 20020506 - ADD_STRING(boundary); -#endif - ADD_STRING(range); - ADD_LONG(chunked); - ADD_STRING(content_type); - ADD_STRING(handler); - ADD_LONG(no_cache); - ADD_LONG(no_local_copy); - ADD_STRING(unparsed_uri); - ADD_STRING(uri); - ADD_STRING(filename); - ADD_STRING(path_info); - ADD_STRING(args); - ADD_LONG(allowed); - ADD_LONG(sent_bodyct); - ADD_LONG(bytes_sent); - ADD_LONG(mtime); - ADD_TIME(request_time); - - ap_destroy_sub_req(rr); - return; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} - -/* {{{ proto array getallheaders(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->f->r->headers_in); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->f->r->headers_out); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - php_struct *ctx; - zval **note_name, **note_val; - char *old_note_val=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, ¬e_name, ¬e_val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - convert_to_string_ex(note_name); - - old_note_val = (char *) apr_table_get(ctx->r->notes, Z_STRVAL_PP(note_name)); - - if (arg_count == 2) { - convert_to_string_ex(note_val); - apr_table_set(ctx->r->notes, Z_STRVAL_PP(note_name), Z_STRVAL_PP(note_val)); - } - - if (old_note_val) { - RETURN_STRING(old_note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - php_struct *ctx; - zval **variable=NULL, **string_val=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>3 || - zend_get_parameters_ex(arg_count, &variable, &string_val, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) { - while(ctx->f->r->prev) { - ctx->f->r = ctx->f->r->prev; - } - } - - convert_to_string_ex(variable); - convert_to_string_ex(string_val); - - apr_table_set(ctx->r->subprocess_env, Z_STRVAL_PP(variable), Z_STRVAL_PP(string_val)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool apache_getenv(string variable [, bool walk_to_top]) - Get an Apache subprocess_env variable */ -PHP_FUNCTION(apache_getenv) -{ - php_struct *ctx; - zval **variable=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - char *env_val=NULL; - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &variable, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) { - while(ctx->f->r->prev) { - ctx->f->r = ctx->f->r->prev; - } - } - - convert_to_string_ex(variable); - - env_val = (char*) apr_table_get(ctx->r->subprocess_env, Z_STRVAL_PP(variable)); - if (env_val != NULL) { - RETURN_STRING(env_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static char *php_apache_get_version() -{ - return (char *) ap_get_server_version(); -} - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = php_apache_get_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -PHP_MINFO_FUNCTION(apache) -{ - char *apv = php_apache_get_version(); - smart_str tmp1 = {0}; - int n; - char *p; - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - smart_str_appendl(&tmp1, s, (p - s)); - } else { - smart_str_appends(&tmp1, s); - } - smart_str_appendc(&tmp1, ' '); - } - if ((tmp1.len - 1) >= 0) { - tmp1.c[tmp1.len - 1] = '\0'; - } - - php_info_print_table_start(); - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - php_info_print_table_row(2, "Loaded Modules", tmp1.c); - smart_str_free(&tmp1); - php_info_print_table_end(); -} - -static function_entry apache_functions[] = { - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_getenv, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry php_apache_module = { - STANDARD_MODULE_HEADER, - "apache2filter", - apache_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(apache), - NULL, - STANDARD_MODULE_PROPERTIES -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c deleted file mode 100644 index 39bd71cc603a6..0000000000000 --- a/sapi/apache2filter/sapi_apache2.c +++ /dev/null @@ -1,722 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_ini.h" -#include "php_variables.h" -#include "SAPI.h" - -#include "ext/standard/php_smart_str.h" -#ifndef NETWARE -#include "ext/standard/php_standard.h" -#else -#include "ext/standard/basic_functions.h" -#endif - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" - -#include "php_apache.h" - -/* UnixWare and Netware define shutdown to _shutdown, which causes problems later - * on when using a structure member named shutdown. Since this source - * file does not use the system call shutdown, it is safe to #undef it. - */ -#undef shutdown - -/* A way to specify the location of the php.ini dir in an apache directive */ -char *apache2_php_ini_path_override = NULL; - -static int -php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - apr_bucket *b; - apr_bucket_brigade *bb; - apr_bucket_alloc_t *ba; - ap_filter_t *f; /* remaining output filters */ - php_struct *ctx; - - ctx = SG(server_context); - f = ctx->f; - - if (str_length == 0) return 0; - - ba = f->c->bucket_alloc; - bb = apr_brigade_create(ctx->r->pool, ba); - - b = apr_bucket_transient_create(str, str_length, ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - -#if 0 - /* Add a Flush bucket to the end of this brigade, so that - * the transient buckets above are more likely to make it out - * the end of the filter instead of having to be copied into - * someone's setaside. */ - b = apr_bucket_flush_create(ba); - APR_BRIGADE_INSERT_TAIL(bb, b); -#endif - - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { - php_handle_aborted_connection(); - } - - return str_length; /* we always consume all the data passed to us. */ -} - -static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx; - ap_filter_t *f; - char *val; - - ctx = SG(server_context); - f = ctx->r->output_filters; - - val = strchr(sapi_header->header, ':'); - - if (!val) { - sapi_free_header(sapi_header); - return 0; - } - - *val = '\0'; - - do { - val++; - } while (*val == ' '); - - if (!strcasecmp(sapi_header->header, "content-type")) - ctx->r->content_type = apr_pstrdup(ctx->r->pool, val); - else if (sapi_header->replace) - apr_table_set(ctx->r->headers_out, sapi_header->header, val); - else - apr_table_add(ctx->r->headers_out, sapi_header->header, val); - - return SAPI_HEADER_ADD; -} - -static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - - ctx->r->status = SG(sapi_headers).http_response_code; - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - int n; - int to_read; - php_struct *ctx = SG(server_context); - - to_read = ctx->post_len - ctx->post_idx; - n = MIN(to_read, count_bytes); - - if (n > 0) { - memcpy(buf, ctx->post_data + ctx->post_idx, n); - ctx->post_idx += n; - } else { - if (ctx->post_data) free(ctx->post_data); - ctx->post_data = NULL; - } - - return n; -} - -static struct stat* -php_apache_sapi_get_stat(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - - ctx->finfo.st_uid = ctx->r->finfo.user; - ctx->finfo.st_gid = ctx->r->finfo.group; - ctx->finfo.st_dev = ctx->r->finfo.device; - ctx->finfo.st_ino = ctx->r->finfo.inode; -#ifdef NETWARE - ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); -#else - ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); -#endif - - ctx->finfo.st_size = ctx->r->finfo.size; - ctx->finfo.st_nlink = ctx->r->finfo.nlink; - - return &ctx->finfo; -} - -static char * -php_apache_sapi_read_cookies(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - const char *http_cookie; - - http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); - - /* The SAPI interface should use 'const char *' */ - return (char *) http_cookie; -} - -static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *env_var; - - env_var = apr_table_get(ctx->r->subprocess_env, name); - - return (char *) env_var; -} - -static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); - char *key, *val; - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - php_register_variable(key, val, track_vars_array TSRMLS_CC); - APR_ARRAY_FOREACH_CLOSE() - - php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); -} - -static void -php_apache_sapi_flush(void *server_context) -{ - php_struct *ctx; - apr_bucket_brigade *bb; - apr_bucket_alloc_t *ba; - apr_bucket *b; - ap_filter_t *f; /* output filters */ - TSRMLS_FETCH(); - - ctx = server_context; - - /* If we haven't registered a server_context yet, - * then don't bother flushing. */ - if (!server_context) - return; - - sapi_send_headers(TSRMLS_C); - - ctx->r->status = SG(sapi_headers).http_response_code; - SG(headers_sent) = 1; - - f = ctx->f; - - /* Send a flush bucket down the filter chain. The current default - * handler seems to act on the first flush bucket, but ignores - * all further flush buckets. - */ - - ba = ctx->r->connection->bucket_alloc; - bb = apr_brigade_create(ctx->r->pool, ba); - b = apr_bucket_flush_create(ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { - php_handle_aborted_connection(); - } -} - -static void php_apache_sapi_log_message(char *msg) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - ctx = SG(server_context); - - if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ - ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg); - } - else { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctx->r->server, "%s", msg); - } -} - -static int -php_apache_disable_caching(ap_filter_t *f) -{ - /* Identify PHP scripts as non-cacheable, thus preventing - * Apache from sending a 304 status when the browser sends - * If-Modified-Since header. - */ - f->r->no_local_copy = 1; - - return OK; -} - -static time_t php_apache_sapi_get_request_time(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - return apr_time_sec(ctx->r->request_time); -} - -extern zend_module_entry php_apache_module; - -static int php_apache2_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_apache_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -static sapi_module_struct apache2_sapi_module = { - "apache2filter", - "Apache 2.0 Filter", - - php_apache2_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_apache_sapi_ub_write, /* unbuffered write */ - php_apache_sapi_flush, /* flush */ - php_apache_sapi_get_stat, /* get uid */ - php_apache_sapi_getenv, /* getenv */ - - php_error, /* error handler */ - - php_apache_sapi_header_handler, /* header handler */ - php_apache_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_apache_sapi_read_post, /* read POST data */ - php_apache_sapi_read_cookies, /* read Cookies */ - - php_apache_sapi_register_variables, - php_apache_sapi_log_message, /* Log message */ - php_apache_sapi_get_request_time, /* Get Request Time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, - ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) -{ - php_struct *ctx; - long old_index; - apr_bucket *b; - const char *str; - apr_size_t n; - apr_status_t rv; - TSRMLS_FETCH(); - - if (f->r->proxyreq) { - return ap_get_brigade(f->next, bb, mode, block, readbytes); - } - - ctx = SG(server_context); - if (ctx == NULL) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, - "php failed to get server context"); - return HTTP_INTERNAL_SERVER_ERROR; - } - - if ((rv = ap_get_brigade(f->next, bb, mode, block, readbytes)) != APR_SUCCESS) { - return rv; - } - - for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { - apr_bucket_read(b, &str, &n, 1); - if (n > 0) { - old_index = ctx->post_len; - ctx->post_len += n; - ctx->post_data = realloc(ctx->post_data, ctx->post_len + 1); - memcpy(ctx->post_data + old_index, str, n); - } - } - return APR_SUCCESS; -} - -static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) -{ - char *content_type; - char *content_length; - const char *auth; - - PG(during_request_startup) = 0; - SG(sapi_headers).http_response_code = !f->r->status ? HTTP_OK : f->r->status; - SG(request_info).content_type = apr_table_get(f->r->headers_in, "Content-Type"); -#undef safe_strdup -#define safe_strdup(x) ((x)?strdup((x)):NULL) - SG(request_info).query_string = safe_strdup(f->r->args); - SG(request_info).request_method = f->r->method; - SG(request_info).proto_num = f->r->proto_num; - SG(request_info).request_uri = safe_strdup(f->r->uri); - SG(request_info).path_translated = safe_strdup(f->r->filename); - f->r->no_local_copy = 1; - content_type = sapi_get_default_content_type(TSRMLS_C); - f->r->content_type = apr_pstrdup(f->r->pool, content_type); - SG(request_info).post_data = ctx->post_data; - SG(request_info).post_data_length = ctx->post_len; - - efree(content_type); - - content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - apr_table_unset(f->r->headers_out, "Content-Length"); - apr_table_unset(f->r->headers_out, "Last-Modified"); - apr_table_unset(f->r->headers_out, "Expires"); - apr_table_unset(f->r->headers_out, "ETag"); - if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) { - auth = apr_table_get(f->r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); - } else { - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - } - php_request_startup(TSRMLS_C); -} - -static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC) -{ - php_request_shutdown(NULL); - - if (SG(request_info).query_string) { - free(SG(request_info).query_string); - } - if (SG(request_info).request_uri) { - free(SG(request_info).request_uri); - } - if (SG(request_info).path_translated) { - free(SG(request_info).path_translated); - } -} - -static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) -{ - php_struct *ctx; - apr_bucket *b; - void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module); - char *p = get_php_config(conf, "engine", sizeof("engine")); - TSRMLS_FETCH(); - - if (f->r->proxyreq) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - /* handle situations where user turns the engine off */ - if (*p == '0') { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - /* Setup the CGI variables if this is the main request.. */ - if (f->r->main == NULL || - /* .. or if the sub-request envinronment differs from the main-request. */ - f->r->subprocess_env != f->r->main->subprocess_env - ) { - /* setup standard CGI variables */ - ap_add_common_vars(f->r); - ap_add_cgi_vars(f->r); - } - - ctx = SG(server_context); - if (ctx == NULL) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, - "php failed to get server context"); - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return HTTP_INTERNAL_SERVER_ERROR; - } - ctx->f = f; /* save whatever filters are after us in the chain. */ - - if (ctx->request_processed) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { - zend_file_handle zfd; - - if (!ctx->request_processed && APR_BUCKET_IS_FILE(b)) { - const char *path; - apr_bucket_brigade *prebb = bb; - - /* Split the brigade into two brigades before and after - * the file bucket. Leave the "after the FILE" brigade - * in the original bb, so it gets passed outside of this - * loop. */ - bb = apr_brigade_split(prebb, b); - - /* Pass the "before the FILE" brigade here - * (if it's non-empty). */ - if (!APR_BRIGADE_EMPTY(prebb)) { - apr_status_t rv; - rv = ap_pass_brigade(f->next, prebb); - /* XXX: destroy the prebb, since we know we're - * done with it? */ - if (rv != APR_SUCCESS || ctx->r->connection->aborted) { - php_handle_aborted_connection(); - } - } - - apply_config(conf); - php_apache_request_ctor(f, ctx TSRMLS_CC); - - apr_file_name_get(&path, ((apr_bucket_file *) b->data)->fd); - - /* Determine if we need to parse the file or show the source */ - if (strncmp(ctx->r->handler, "application/x-httpd-php-source", sizeof("application/x-httpd-php-source"))) { - zfd.type = ZEND_HANDLE_FILENAME; - zfd.filename = (char *) path; - zfd.free_filename = 0; - zfd.opened_path = NULL; - - php_execute_script(&zfd TSRMLS_CC); -#if MEMORY_LIMIT - { - char *mem_usage; - - mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak)); - AG(allocated_memory_peak) = 0; - apr_table_set(ctx->r->notes, "mod_php_memory_usage", mem_usage); - } -#endif - } else { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - - highlight_file((char *)path, &syntax_highlighter_ini TSRMLS_CC); - } - - php_apache_request_dtor(f TSRMLS_CC); - - if (!f->r->main) { - ctx->request_processed = 1; - } - - /* Delete the FILE bucket from the brigade. */ - apr_bucket_delete(b); - - /* We won't handle any more buckets in this brigade, so - * it's ok to break out now. */ - break; - } - } - - /* Pass whatever is left on the brigade. */ - return ap_pass_brigade(f->next, bb); -} - -static apr_status_t -php_apache_server_shutdown(void *tmp) -{ - apache2_sapi_module.shutdown(&apache2_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - return APR_SUCCESS; -} - -static void php_apache_add_version(apr_pool_t *p) -{ - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component(p, "PHP/" PHP_VERSION); - } -} - -static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) -{ -#ifndef ZTS - int threaded_mpm; - - ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm); - if(threaded_mpm) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."); - return DONE; - } -#endif - /* When this is NULL, apache won't override the hard-coded default - * php.ini path setting. */ - apache2_php_ini_path_override = NULL; - return OK; -} - -static int -php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, - apr_pool_t *ptemp, server_rec *s) -{ - void *data = NULL; - const char *userdata_key = "apache2filter_post_config"; - - /* Apache will load, unload and then reload a DSO module. This - * prevents us from starting PHP until the second load. */ - apr_pool_userdata_get(&data, userdata_key, s->process->pool); - if (data == NULL) { - /* We must use set() here and *not* setn(), otherwise the - * static string pointed to by userdata_key will be mapped - * to a different location when the DSO is reloaded and the - * pointers won't match, causing get() to return NULL when - * we expected it to return non-NULL. */ - apr_pool_userdata_set((const void *)1, userdata_key, - apr_pool_cleanup_null, s->process->pool); - return OK; - } - - /* Set up our overridden path. */ - if (apache2_php_ini_path_override) { - apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override; - } -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache2_sapi_module); - apache2_sapi_module.startup(&apache2_sapi_module); - apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); - php_apache_add_version(pconf); - - return OK; -} - -static void php_add_filter(request_rec *r, ap_filter_t *f) -{ - int output = (f == r->output_filters); - - /* for those who still have Set*Filter PHP configured */ - while (f) { - if (strcmp(f->frec->name, "PHP") == 0) { - ap_log_error(APLOG_MARK, APLOG_WARNING, - 0, r->server, - "\"Set%sFilter PHP\" already configured for %s", - output ? "Output" : "Input", r->uri); - return; - } - f = f->next; - } - - if (output) { - ap_add_output_filter("PHP", NULL, r, r->connection); - } else { - ap_add_input_filter("PHP", NULL, r, r->connection); - } -} - -static void php_insert_filter(request_rec *r) -{ - int content_type_len = strlen("application/x-httpd-php"); - - if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php", content_type_len-1)) { - if (r->content_type[content_type_len] == '\0' || !strncmp(r->content_type+content_type_len, "-source", sizeof("-source"))) { - php_add_filter(r, r->output_filters); - php_add_filter(r, r->input_filters); - } - } -} - -static apr_status_t php_server_context_cleanup(void *data_) -{ - void **data = data_; - *data = NULL; - return APR_SUCCESS; -} - -static int php_post_read_request(request_rec *r) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - /* Initialize filter context */ - SG(server_context) = ctx = apr_pcalloc(r->pool, sizeof(*ctx)); - - /* register a cleanup so we clear out the SG(server_context) - * after each request. Note: We pass in the pointer to the - * server_context in case this is handled by a different thread. */ - apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), - php_server_context_cleanup, - apr_pool_cleanup_null); - - /* Save the entire request, so we can get the input or output - * filters if we need them. */ - ctx->r = r; - - return OK; -} - -static void php_register_hook(apr_pool_t *p) -{ - ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_read_request(php_post_read_request, NULL, NULL, APR_HOOK_MIDDLE); - ap_register_output_filter("PHP", php_output_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); - ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); -} - -AP_MODULE_DECLARE_DATA module php5_module = { - STANDARD20_MODULE_STUFF, - create_php_config, /* create per-directory config structure */ - merge_php_config, /* merge per-directory config structures */ - NULL, /* create per-server config structure */ - NULL, /* merge per-server config structures */ - php_dir_cmds, /* command apr_table_t */ - php_register_hook /* register hooks */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/CREDITS b/sapi/apache2handler/CREDITS deleted file mode 100644 index 4a7848053c4a7..0000000000000 --- a/sapi/apache2handler/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 2.0 Handler -Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code) diff --git a/sapi/apache2handler/EXPERIMENTAL b/sapi/apache2handler/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/apache2handler/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/apache2handler/README b/sapi/apache2handler/README deleted file mode 100644 index 5cbd1b95ddcd0..0000000000000 --- a/sapi/apache2handler/README +++ /dev/null @@ -1,76 +0,0 @@ -WHAT IS THIS? - - This module exploits the layered I/O support in Apache 2.0. - -HOW DOES IT WORK? - - In Apache 2.0, you have handlers which generate content (like - reading a script from disk). The content goes then through - a chain of filters. PHP can be such a filter, so that it processes - your script and hands the output to the next filter (which will - usually cause a write to the network). - -DOES IT WORK? - - Currently the issues with the module are: - * Thread safety of external PHP modules - * The lack of re-entrancy of PHP. due to this I have disabled the 'virtual' - function, and tried to stop any method where a php script can run another php - script while it is being run. - - -HOW TO INSTALL - - This SAPI module is known to work with Apache 2.0.44. - - $ cd apache-2.x - $ cd src - $ ./configure --enable-so - $ make install - - For testing purposes, you might want to use --with-mpm=prefork. - (Albeit PHP also works with threaded MPMs. See Thread Safety note above) - - Configure PHP 4: - - $ cd php-4.x - $ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs - $ make install - - At the end of conf/httpd.conf, add: - - AddType application/x-httpd-php .php - - If you would like to enable source code highlighting functionality add: - - AddType application/x-httpd-php-source .phps - - That's it. Now start bin/httpd. - -HOW TO CONFIGURE - - The Apache 2.0 PHP module supports a new configuration directive that - allows an admin to override the php.ini search path. For example, - place your php.ini file in Apache's ServerRoot/conf directory and - add this to your httpd.conf file: - - PHPINIDir "conf" - -DEBUGGING APACHE AND PHP - - To debug Apache, we recommened: - - 1. Use the Prefork MPM (Apache 1.3-like process model) by - configuring Apache with '--with-mpm=prefork'. - 2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS). - - If you want to debug a part of the PHP startup procedure, set a - breakpoint on 'load_module'. Step through it until apr_dso_load() is - done. Then you can set a breakpoint on any PHP-related symbol. - -TODO - - PHP functions like apache_sub_req (see php_functions.c) - Source Code Highlighting - Protocol handlers - diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c deleted file mode 100644 index fcca1d2d2a56a..0000000000000 --- a/sapi/apache2handler/apache_config.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_ini.h" -#include "php_apache.h" - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#ifdef PHP_AP_DEBUG -#define phpapdebug(a) fprintf a -#else -#define phpapdebug(a) -#endif - -typedef struct { - HashTable config; -} php_conf_rec; - -typedef struct { - char *value; - size_t value_len; - char status; -} php_dir_entry; - -static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) -{ - php_conf_rec *d = dummy; - php_dir_entry e; - - phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config))); - - if (!strncasecmp(value, "none", sizeof("none"))) { - value = ""; - } - - e.value = apr_pstrdup(cmd->pool, value); - e.value_len = strlen(value); - e.status = status; - - zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); - return NULL; -} - -static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return real_value_hnd(cmd, dummy, arg1, bool_val, status); -} - -static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) -{ - if (apache2_php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; - } - apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} - - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) -{ - php_conf_rec *d = base_conf, *e = new_conf; - php_dir_entry *pe; - php_dir_entry *data; - char *str; - uint str_len; - ulong num_index; - - phpapdebug((stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf)); - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, - &num_index, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - pe = NULL; - zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) { - if (pe->status >= data->status) continue; - } - zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL); - phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); - } - return new_conf; -} - -char *get_php_config(void *conf, char *name, size_t name_len) -{ - php_conf_rec *d = conf; - php_dir_entry *pe; - - if (zend_hash_find(&d->config, name, name_len, (void **) &pe) == SUCCESS) { - return pe->value; - } - - return ""; -} - -void apply_config(void *dummy) -{ - php_conf_rec *d = dummy; - char *str; - uint str_len; - php_dir_entry *data; - - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, - NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - zend_hash_get_current_data(&d->config, (void **) &data); - phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); - if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) { - phpapdebug((stderr, "..FAILED\n")); - } - } -} - -const command_rec php_dir_cmds[] = -{ - AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"), - AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"), - AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), - AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), - AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"), - {NULL} -}; - -static apr_status_t destroy_php_config(void *data) -{ - php_conf_rec *d = data; - - phpapdebug((stderr, "Destroying config %p\n", data)); - zend_hash_destroy(&d->config); - - return APR_SUCCESS; -} - -void *create_php_config(apr_pool_t *p, char *dummy) -{ - php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); - - phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); - zend_hash_init(&newx->config, 0, NULL, NULL, 1); - apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); - return (void *) newx; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 deleted file mode 100644 index 05659e5c1e4de..0000000000000 --- a/sapi/apache2handler/config.m4 +++ /dev/null @@ -1,129 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for Apache 2.0 handler-module support via DSO through APXS) -AC_ARG_WITH(apxs2, -[ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional - pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($withval, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed]) - AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs]) - AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)]) - AC_MSG_RESULT() - AC_MSG_RESULT([The output of $APXS follows:]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_BINDIR=`$APXS -q BINDIR` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_MPM=`$APXS -q MPM_NAME` - APU_BINDIR=`$APXS -q APU_BINDIR` - APR_BINDIR=`$APXS -q APR_BINDIR` - - # Pick up ap[ru]-N-config if using httpd >=2.1 - APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null || - echo $APR_BINDIR/apr-config` - APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null || - echo $APU_BINDIR/apu-config` - - APR_CFLAGS="`$APR_CONFIG --cppflags --includes`" - APU_CFLAGS="`$APU_CONFIG --includes`" - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS" - - # Test that we're trying to configure with apache 2.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) - elif test "$APACHE_VERSION" -lt 2000044; then - AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required]) - fi - - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" - fi - - case $host_alias in - *aix*) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *darwin*) - dnl When using bundles on Darwin, we must resolve all symbols. However, - dnl the linker does not recursively look at the bundle loader and - dnl pull in its dependencies. Therefore, we must pull in the APR - dnl and APR-util libraries. - if test -x "$APR_CONFIG"; then - MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`" - fi - if test -x "$APU_CONFIG"; then - MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS" - fi - MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" - PHP_SUBST(MH_BUNDLE_FLAGS) - PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - SAPI_SHARED=libs/libphp5.so - INSTALL_IT="$INSTALL_IT $SAPI_SHARED" - ;; - *beos*) - if test -f _APP_; then `rm _APP_`; fi - `ln -s $APXS_BINDIR/httpd _APP_` - EXTRA_LIBS="$EXTRA_LIBS _APP_" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *) - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - esac - - if test "$APXS_MPM" != "prefork"; then - PHP_BUILD_THREAD_SAFE - fi - AC_MSG_RESULT(yes) - - PHP_SUBST(APXS) -],[ - AC_MSG_RESULT(no) -]) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32 deleted file mode 100644 index a409841070006..0000000000000 --- a/sapi/apache2handler/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no'); - -if (PHP_APACHE2HANDLER != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2HANDLER", PHP_PHP_BUILD + "\\apache2\\include") && - CHECK_LIB("libhttpd.lib", "apache2handler", PHP_PHP_BUILD + "\\apache2\\lib") && - CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\apache2\\lib") && - CHECK_LIB("libaprutil.lib", "apache2handler", PHP_PHP_BUILD + "\\apache2\\lib") - ) { - SAPI('apache2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', - 'php' + PHP_VERSION + 'apache2.dll', - '/D PHP_APACHE2_EXPORTS /I win32'); - } else { - WARNING("Could not find apache2 libraries/headers"); - } -} diff --git a/sapi/apache2handler/mod_php5.c b/sapi/apache2handler/mod_php5.c deleted file mode 100644 index 6ac6f6c61c1ba..0000000000000 --- a/sapi/apache2handler/mod_php5.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_apache.h" - -AP_MODULE_DECLARE_DATA module php5_module = { - STANDARD20_MODULE_STUFF, - create_php_config, /* create per-directory config structure */ - merge_php_config, /* merge per-directory config structures */ - NULL, /* create per-server config structure */ - NULL, /* merge per-server config structures */ - php_dir_cmds, /* command apr_table_t */ - php_ap2_register_hook /* register hooks */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/php.sym b/sapi/apache2handler/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache2handler/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache2handler/php5apache2.dsp b/sapi/apache2handler/php5apache2.dsp deleted file mode 100644 index 40cd58cb928d7..0000000000000 --- a/sapi/apache2handler/php5apache2.dsp +++ /dev/null @@ -1,146 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache2 - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache2.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache2.mak" CFG="php5apache2 - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache2 - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache2 - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5apache2 - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS_inline/php5apache2.dll" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5apache2 - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5apache2 - Win32 Release_TS" -# Name "php5apache2 - Win32 Release_TS_inline" -# Name "php5apache2 - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\apache_config.c -# End Source File -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_functions.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache2.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_apache.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h deleted file mode 100644 index 922313d865645..0000000000000 --- a/sapi/apache2handler/php_apache.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_APACHE_H -#define PHP_APACHE_H - -#include "httpd.h" -#include "http_config.h" -#include "http_core.h" - -/* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; - -/* A way to specify the location of the php.ini dir in an apache directive */ -extern char *apache2_php_ini_path_override; - -/* The server_context used by PHP */ -typedef struct php_struct { - int state; - request_rec *r; - apr_bucket_brigade *brigade; - /* stat structure of the current file */ -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc finfo; -#else - struct stat finfo; -#endif - /* Whether or not we've processed PHP in the output filters yet. */ - int request_processed; -} php_struct; - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf); -void *create_php_config(apr_pool_t *p, char *dummy); -char *get_php_config(void *conf, char *name, size_t name_len); -void apply_config(void *); -extern const command_rec php_dir_cmds[]; -void php_ap2_register_hook(apr_pool_t *p); - -#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ -{ \ - apr_table_entry_t *elts; \ - int i; \ - elts = (apr_table_entry_t *) arr->elts; \ - for (i = 0; i < arr->nelts; i++) { \ - key = elts[i].key; \ - val = elts[i].val; - -#define APR_ARRAY_FOREACH_CLOSE() }} - -typedef struct { - long engine; - long xbithack; - long last_modified; -} php_apache2_info_struct; - -extern zend_module_entry apache2_module_entry; - -#ifdef ZTS -extern int php_apache2_info_id; -#define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v) -#else -extern php_apache2_info_struct php_apache2_info; -#define AP2(v) (php_apache2_info.v) -#endif - - -#endif /* PHP_APACHE_H */ diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c deleted file mode 100644 index 302c7b7e77ee2..0000000000000 --- a/sapi/apache2handler/php_functions.c +++ /dev/null @@ -1,520 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/head.h" -#include "php_ini.h" -#include "SAPI.h" - -#define CORE_PRIVATE -#include "apr_strings.h" -#include "apr_time.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" -#if !defined(WIN32) && !defined(WINNT) -#include "unixd.h" -#endif - -#include "php_apache.h" - -#ifdef ZTS -int php_apache2_info_id; -#else -php_apache2_info_struct php_apache2_info; -#endif - -#define SECTION(name) PUTS("

              " name "

              \n") - -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) -{ - php_struct *ctx; - - if (!filename) { - return NULL; - } - - ctx = SG(server_context); - - return ap_sub_req_lookup_uri(filename, ctx->r, ctx->r->output_filters); -} - -/* {{{ proto bool virtual(string uri) - Perform an apache sub-request */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status != HTTP_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - - /* Flush everything. */ - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - /* Ensure that the ap_r* layer for the main request is flushed, to - * work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ - ap_rflush(rr->main); - - if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - ap_destroy_sub_req(rr); - RETURN_TRUE; -} -/* }}} */ - -#define ADD_LONG(name) \ - add_property_long(return_value, #name, rr->name) -#define ADD_TIME(name) \ - add_property_long(return_value, #name, apr_time_sec(rr->name)); -#define ADD_STRING(name) \ - if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) - -PHP_FUNCTION(apache_lookup_uri) -{ - request_rec *rr; - zval **filename; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - object_init(return_value); - - ADD_LONG(status); - ADD_STRING(the_request); - ADD_STRING(status_line); - ADD_STRING(method); - ADD_TIME(mtime); - ADD_LONG(clength); -#if MODULE_MAGIC_NUMBER < 20020506 - ADD_STRING(boundary); -#endif - ADD_STRING(range); - ADD_LONG(chunked); - ADD_STRING(content_type); - ADD_STRING(handler); - ADD_LONG(no_cache); - ADD_LONG(no_local_copy); - ADD_STRING(unparsed_uri); - ADD_STRING(uri); - ADD_STRING(filename); - ADD_STRING(path_info); - ADD_STRING(args); - ADD_LONG(allowed); - ADD_LONG(sent_bodyct); - ADD_LONG(bytes_sent); - ADD_LONG(mtime); - ADD_TIME(request_time); - - ap_destroy_sub_req(rr); - return; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} - -/* {{{ proto array getallheaders(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->r->headers_in); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->r->headers_out); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - php_struct *ctx; - zval **note_name, **note_val; - char *old_note_val=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, ¬e_name, ¬e_val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - convert_to_string_ex(note_name); - - old_note_val = (char *) apr_table_get(ctx->r->notes, Z_STRVAL_PP(note_name)); - - if (arg_count == 2) { - convert_to_string_ex(note_val); - apr_table_set(ctx->r->notes, Z_STRVAL_PP(note_name), Z_STRVAL_PP(note_val)); - } - - if (old_note_val) { - RETURN_STRING(old_note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -/* - * XXX this doesn't look right. shouldn't it be the parent ?*/ -PHP_FUNCTION(apache_setenv) -{ - php_struct *ctx; - zval **variable=NULL, **string_val=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - request_rec *r; - - if (arg_count<1 || arg_count>3 || - zend_get_parameters_ex(arg_count, &variable, &string_val, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - r = ctx->r; - if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) { - while(r->prev) { - r = r->prev; - } - } - - convert_to_string_ex(variable); - convert_to_string_ex(string_val); - - apr_table_set(r->subprocess_env, Z_STRVAL_PP(variable), Z_STRVAL_PP(string_val)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool apache_getenv(string variable [, bool walk_to_top]) - Get an Apache subprocess_env variable */ -/* - * XXX: shouldn't this be the parent not the 'prev' - */ -PHP_FUNCTION(apache_getenv) -{ - php_struct *ctx; - zval **variable=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - char *env_val=NULL; - request_rec *r; - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &variable, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - r = ctx->r; - if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) { - while(r->prev) { - r = r->prev; - } - } - - convert_to_string_ex(variable); - - env_val = (char*) apr_table_get(r->subprocess_env, Z_STRVAL_PP(variable)); - if (env_val != NULL) { - RETURN_STRING(env_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static char *php_apache_get_version() -{ - return (char *) ap_get_server_version(); -} - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = php_apache_get_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -PHP_MINFO_FUNCTION(apache) -{ - char *apv = php_apache_get_version(); - smart_str tmp1 = {0}; - char tmp[1024]; - int n, max_requests; - char *p; - server_rec *serv = ((php_struct *) SG(server_context))->r->server; -#if !defined(WIN32) && !defined(WINNT) - AP_DECLARE_DATA extern unixd_config_rec unixd_config; -#endif - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - smart_str_appendl(&tmp1, s, (p - s)); - } else { - smart_str_appends(&tmp1, s); - } - smart_str_appendc(&tmp1, ' '); - } - if ((tmp1.len - 1) >= 0) { - tmp1.c[tmp1.len - 1] = '\0'; - } - - php_info_print_table_start(); - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - sprintf(tmp, "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", tmp); - - if (serv->server_admin && *(serv->server_admin)) { - php_info_print_table_row(2, "Server Administrator", serv->server_admin); - } - - sprintf(tmp, "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", tmp); - -#if !defined(WIN32) && !defined(WINNT) - sprintf(tmp, "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id); - php_info_print_table_row(2, "User/Group", tmp); -#endif - - ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, &max_requests); - sprintf(tmp, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", tmp); - - apr_snprintf(tmp, sizeof tmp, - "Connection: %" APR_TIME_T_FMT " - Keep-Alive: %" APR_TIME_T_FMT, - apr_time_sec(serv->timeout), apr_time_sec(serv->keep_alive_timeout)); - php_info_print_table_row(2, "Timeouts", tmp); - - php_info_print_table_row(2, "Virtual Server", (serv->is_virtual ? "Yes" : "No")); - php_info_print_table_row(2, "Server Root", ap_server_root); - php_info_print_table_row(2, "Loaded Modules", tmp1.c); - - smart_str_free(&tmp1); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - const apr_array_header_t *arr = apr_table_elts(((php_struct *) SG(server_context))->r->subprocess_env); - char *key, *val; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_end(); - - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", ((php_struct *) SG(server_context))->r->the_request); - - arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_in); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_out); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_end(); - } -} - -static function_entry apache_functions[] = { - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_getenv, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache2_info_struct, php_apache2_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache2_info_struct, php_apache2_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache2_info_struct, php_apache2_info) -PHP_INI_END() - -static PHP_MINIT_FUNCTION(apache) -{ -#ifdef ZTS - ts_allocate_id(&php_apache2_info_id, sizeof(php_apache2_info_struct), (ts_allocate_ctor) NULL, NULL); -#endif - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry php_apache_module = { - STANDARD_MODULE_HEADER, - "apache2handler", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NULL, - STANDARD_MODULE_PROPERTIES -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c deleted file mode 100644 index 06b7bd912cd48..0000000000000 --- a/sapi/apache2handler/sapi_apache2.c +++ /dev/null @@ -1,622 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_ini.h" -#include "php_variables.h" -#include "SAPI.h" - -#include - -#include "ext/standard/php_smart_str.h" -#ifndef NETWARE -#include "ext/standard/php_standard.h" -#else -#include "ext/standard/basic_functions.h" -#endif - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" - -#include "php_apache.h" - -/* UnixWare and Netware define shutdown to _shutdown, which causes problems later - * on when using a structure member named shutdown. Since this source - * file does not use the system call shutdown, it is safe to #undef it.K - */ -#undef shutdown - -#define PHP_MAGIC_TYPE "application/x-httpd-php" -#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source" -#define PHP_SCRIPT "php5-script" - -/* A way to specify the location of the php.ini dir in an apache directive */ -char *apache2_php_ini_path_override = NULL; - -static int -php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - request_rec *r; - php_struct *ctx; - - ctx = SG(server_context); - r = ctx->r; - - if (ap_rwrite(str, str_length, r) < 0) { - php_handle_aborted_connection(); - } - - return str_length; /* we always consume all the data passed to us. */ -} - -static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header,sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx; - char *val; - - ctx = SG(server_context); - - val = strchr(sapi_header->header, ':'); - - if (!val) { - sapi_free_header(sapi_header); - return 0; - } - - *val = '\0'; - - do { - val++; - } while (*val == ' '); - - if (!strcasecmp(sapi_header->header, "content-type")) { - val = apr_pstrdup(ctx->r->pool, val); - ap_set_content_type(ctx->r, val); - } else if (sapi_header->replace) { - apr_table_set(ctx->r->headers_out, sapi_header->header, val); - } else { - apr_table_add(ctx->r->headers_out, sapi_header->header, val); - } - - return SAPI_HEADER_ADD; -} - -static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *sline = SG(sapi_headers).http_status_line; - - ctx->r->status = SG(sapi_headers).http_response_code; - - /* httpd requires that r->status_line is set to the first digit of - * the status-code: */ - if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 - && sline[8] == ' ') { - ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); - } - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - apr_size_t len, tlen=0; - php_struct *ctx = SG(server_context); - request_rec *r; - apr_bucket_brigade *brigade; - - r = ctx->r; - brigade = ctx->brigade; - len = count_bytes; - - /* - * This loop is needed because ap_get_brigade() can return us partial data - * which would cause premature termination of request read. Therefor we - * need to make sure that if data is available we fill the buffer completely. - */ - - while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) { - apr_brigade_flatten(brigade, buf, &len); - apr_brigade_cleanup(brigade); - tlen += len; - if (tlen == count_bytes || !len) { - break; - } - buf += len; - len = count_bytes - tlen; - } - - return tlen; -} - -static struct stat* -php_apache_sapi_get_stat(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - - ctx->finfo.st_uid = ctx->r->finfo.user; - ctx->finfo.st_gid = ctx->r->finfo.group; - ctx->finfo.st_dev = ctx->r->finfo.device; - ctx->finfo.st_ino = ctx->r->finfo.inode; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); -#else - ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); -#endif - - ctx->finfo.st_size = ctx->r->finfo.size; - ctx->finfo.st_nlink = ctx->r->finfo.nlink; - - return &ctx->finfo; -} - -static char * -php_apache_sapi_read_cookies(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - const char *http_cookie; - - http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); - - /* The SAPI interface should use 'const char *' */ - return (char *) http_cookie; -} - -static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *env_var; - - env_var = apr_table_get(ctx->r->subprocess_env, name); - - return (char *) env_var; -} - -static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); - char *key, *val; - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - php_register_variable(key, val, track_vars_array TSRMLS_CC); - APR_ARRAY_FOREACH_CLOSE() - - php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); -} - -static void -php_apache_sapi_flush(void *server_context) -{ - php_struct *ctx; - request_rec *r; - TSRMLS_FETCH(); - - ctx = server_context; - - /* If we haven't registered a server_context yet, - * then don't bother flushing. */ - if (!server_context) { - return; - } - - r = ctx->r; - - sapi_send_headers(TSRMLS_C); - - r->status = SG(sapi_headers).http_response_code; - SG(headers_sent) = 1; - - if (ap_rflush(r) < 0 || r->connection->aborted) { - php_handle_aborted_connection(); - } -} - -static void php_apache_sapi_log_message(char *msg) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - ctx = SG(server_context); - - if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ - ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg); - } else { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "%s", msg); - } -} - -static void php_apache_sapi_log_message_ex(char *msg, request_rec *r) -{ - if (r) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename); - } else { - php_apache_sapi_log_message(msg); - } -} - -static time_t php_apache_sapi_get_request_time(TSRMLS_D) { - php_struct *ctx = SG(server_context); - return apr_time_sec(ctx->r->request_time); -} - -extern zend_module_entry php_apache_module; - -static int php_apache2_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_apache_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -static sapi_module_struct apache2_sapi_module = { - "apache2handler", - "Apache 2.0 Handler", - - php_apache2_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_apache_sapi_ub_write, /* unbuffered write */ - php_apache_sapi_flush, /* flush */ - php_apache_sapi_get_stat, /* get uid */ - php_apache_sapi_getenv, /* getenv */ - - php_error, /* error handler */ - - php_apache_sapi_header_handler, /* header handler */ - php_apache_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_apache_sapi_read_post, /* read POST data */ - php_apache_sapi_read_cookies, /* read Cookies */ - - php_apache_sapi_register_variables, - php_apache_sapi_log_message, /* Log message */ - php_apache_sapi_get_request_time, /* Request Time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static apr_status_t -php_apache_server_shutdown(void *tmp) -{ - apache2_sapi_module.shutdown(&apache2_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - return APR_SUCCESS; -} - -static void php_apache_add_version(apr_pool_t *p) -{ - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component(p, "PHP/" PHP_VERSION); - } -} - -static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) -{ -#ifndef ZTS - int threaded_mpm; - - ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm); - if(threaded_mpm) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."); - return DONE; - } -#endif - /* When this is NULL, apache won't override the hard-coded default - * php.ini path setting. */ - apache2_php_ini_path_override = NULL; - return OK; -} - -static int -php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) -{ - void *data = NULL; - const char *userdata_key = "apache2hook_post_config"; - - /* Apache will load, unload and then reload a DSO module. This - * prevents us from starting PHP until the second load. */ - apr_pool_userdata_get(&data, userdata_key, s->process->pool); - if (data == NULL) { - /* We must use set() here and *not* setn(), otherwise the - * static string pointed to by userdata_key will be mapped - * to a different location when the DSO is reloaded and the - * pointers won't match, causing get() to return NULL when - * we expected it to return non-NULL. */ - apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool); - return OK; - } - - /* Set up our overridden path. */ - if (apache2_php_ini_path_override) { - apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override; - } -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache2_sapi_module); - apache2_sapi_module.startup(&apache2_sapi_module); - apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); - php_apache_add_version(pconf); - - return OK; -} - -static apr_status_t php_server_context_cleanup(void *data_) -{ - void **data = data_; - *data = NULL; - return APR_SUCCESS; -} - -static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) -{ - char *content_type; - char *content_length; - const char *auth; - - SG(sapi_headers).http_response_code = !r->status ? HTTP_OK : r->status; - SG(request_info).content_type = apr_table_get(r->headers_in, "Content-Type"); - SG(request_info).query_string = apr_pstrdup(r->pool, r->args); - SG(request_info).request_method = r->method; - SG(request_info).proto_num = r->proto_num; - SG(request_info).request_uri = apr_pstrdup(r->pool, r->uri); - SG(request_info).path_translated = apr_pstrdup(r->pool, r->filename); - r->no_local_copy = 1; - - content_type = sapi_get_default_content_type(TSRMLS_C); - ap_set_content_type(r, apr_pstrdup(r->pool, content_type)); - efree(content_type); - - content_length = (char *) apr_table_get(r->headers_in, "Content-Length"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - apr_table_unset(r->headers_out, "Content-Length"); - apr_table_unset(r->headers_out, "Last-Modified"); - apr_table_unset(r->headers_out, "Expires"); - apr_table_unset(r->headers_out, "ETag"); - if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) { - auth = apr_table_get(r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); - ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); - } else { - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - } - return php_request_startup(TSRMLS_C); -} - -static void php_apache_request_dtor(request_rec *r TSRMLS_DC) -{ - php_request_shutdown(NULL); -} - -static int php_handler(request_rec *r) -{ - php_struct *ctx; - void *conf; - apr_bucket_brigade *brigade; - apr_bucket *bucket; - apr_status_t rv; - request_rec *parent_req = NULL; - TSRMLS_FETCH(); - -#define PHPAP_INI_OFF \ - if (strcmp(r->protocol, "INCLUDED")) { \ - zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); \ - } \ - - conf = ap_get_module_config(r->per_dir_config, &php5_module); - - /* apply_config() needs r in some cases, so allocate server_context early */ - ctx = SG(server_context); - if (ctx == NULL) { -normal: - ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); - /* register a cleanup so we clear out the SG(server_context) - * after each request. Note: We pass in the pointer to the - * server_context in case this is handled by a different thread. - */ - apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), php_server_context_cleanup, apr_pool_cleanup_null); - ctx->r = r; - ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try later on */ - } else { - parent_req = ctx->r; - ctx->r = r; - } - apply_config(conf); - - if (strcmp(r->handler, PHP_MAGIC_TYPE) && strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(r->handler, PHP_SCRIPT)) { - /* Check for xbithack in this case. */ - if (!AP2(xbithack) || strcmp(r->handler, "text/html") || !(r->finfo.protection & APR_UEXECUTE)) { - PHPAP_INI_OFF; - return DECLINED; - } - } - - /* Give a 404 if PATH_INFO is used but is explicitly disabled in - * the configuration; default behaviour is to accept. */ - if (r->used_path_info == AP_REQ_REJECT_PATH_INFO - && r->path_info && r->path_info[0]) { - PHPAP_INI_OFF; - return HTTP_NOT_FOUND; - } - - /* handle situations where user turns the engine off */ - if (!AP2(engine)) { - PHPAP_INI_OFF; - return DECLINED; - } - - if (r->finfo.filetype == 0) { - php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r); - PHPAP_INI_OFF; - return HTTP_NOT_FOUND; - } - if (r->finfo.filetype == APR_DIR) { - php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r); - PHPAP_INI_OFF; - return HTTP_FORBIDDEN; - } - - /* Setup the CGI variables if this is the main request */ - if (r->main == NULL || - /* .. or if the sub-request envinronment differs from the main-request. */ - r->subprocess_env != r->main->subprocess_env - ) { - /* setup standard CGI variables */ - ap_add_common_vars(r); - ap_add_cgi_vars(r); - } - -zend_first_try { - - if (ctx == NULL) { - brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); - ctx = SG(server_context); - ctx->brigade = brigade; - - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { - zend_bailout(); - } - } else { - if (!parent_req) { - parent_req = ctx->r; - } - if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) { - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { - zend_bailout(); - } - } - - /* check if comming due to ErrorDocument */ - if (parent_req && parent_req->status != HTTP_OK) { - parent_req = NULL; - goto normal; - } - ctx->r = r; - brigade = ctx->brigade; - } - - if (AP2(last_modified)) { - ap_update_mtime(r, r->finfo.mtime); - ap_set_last_modified(r); - } - - /* Determine if we need to parse the file or show the source */ - if (strncmp(r->handler, PHP_SOURCE_MAGIC_TYPE, sizeof(PHP_SOURCE_MAGIC_TYPE) - 1) == 0) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC); - } else { - zend_file_handle zfd; - - zfd.type = ZEND_HANDLE_FILENAME; - zfd.filename = (char *) r->filename; - zfd.free_filename = 0; - zfd.opened_path = NULL; - - if (!parent_req) { - php_execute_script(&zfd TSRMLS_CC); - } else { - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd); - } -#if MEMORY_LIMIT - { - char *mem_usage; - - mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak)); - apr_table_set(r->notes, "mod_php_memory_usage", mem_usage); - } -#endif - } - -} zend_end_try(); - - if (!parent_req) { - php_apache_request_dtor(r TSRMLS_CC); - ctx->request_processed = 1; - bucket = apr_bucket_eos_create(r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(brigade, bucket); - - rv = ap_pass_brigade(r->output_filters, brigade); - if (rv != APR_SUCCESS || r->connection->aborted) { -zend_first_try { - php_handle_aborted_connection(); -} zend_end_try(); - } - apr_brigade_cleanup(brigade); - } else { - ctx->r = parent_req; - } - - return OK; -} - -void php_ap2_register_hook(apr_pool_t *p) -{ - ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_handler(php_handler, NULL, NULL, APR_HOOK_MIDDLE); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/CREDITS b/sapi/apache_hooks/CREDITS deleted file mode 100644 index 86ac27d0b7332..0000000000000 --- a/sapi/apache_hooks/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 1.3 (apache_hooks) -Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar, George Schlossnagle, Lukas Schroeder diff --git a/sapi/apache_hooks/README b/sapi/apache_hooks/README deleted file mode 100644 index 9a5a3e2b64423..0000000000000 --- a/sapi/apache_hooks/README +++ /dev/null @@ -1,206 +0,0 @@ -This is very beta documentation. Clearly better stuff can and will follow. - -INTRO: - -apache_hooks is a full super-set enhancement of the apache 1.3 sapi that allows for -php code to be run on the apache request object at every stage of the apache -request. It supports all of the apache 1.3 sapi commands and configurations, and -additionally supports the following httpd.conf directives: - - -HTTPD.CONF DIRECTIEVS: - -phpRequire /path/to/file = requires a file at the beginning of an -initial apache request - -phpUriHandler /path/to/file = registers a hook that will run the -specified file at the uri translation stage of the apache request -phpUriHandler Class::Method = registers a hook to run Class::Method at -the uri translation stage of the apache request - -phpPostReadHandler /path/to/file = hook for post-read phase -phpPostReadHandlerMethod Class::Method - -phpHeaderHandler = hook for header parsing phase -phpHeaderHandlerMethod - -phpAuthHandler = hook for authentication phase -phpAuthHandlerMethod - -phpAccessHandler = hook for access control phase -phpAccessHandlerMethod - -phpTypeHandler = hook for Type Checking phase -phpTypeHandlerMethod - -phpFixupHandler = hook for 'fixup' phase -phpFixupHandlerMethod - -phpLoggerHandler = hook for logging phase -phpLoggerHandlerMethod - -AddHandler php-script = set's up a special type handler -phpResponseHandler /path/to/file = sets file to be called to handle -response phase -phpResponseHandlerMethod Class::Method - - -All handlers may be stacked, i.e. you can list multiple handler directives -in a single scope and they will be run in order. - - -EXAMPLES: - -So, to set up a 'hello world' location handler (so that any request to -/hello/* returns hello world) you can: - -phpRequire /tmp/setup.php - -AddHandler php-script -phpResponseHandlerMethod Hello::World - - -with -#/tmp/setup.php -send_http_header(); - echo "Hello World"; - } -} -?> - -$request is the apache request. It is instantiated at all stages -automatically. The methods of that class are: - -getallheaders -args -boundary -content_encoding -content_type -filename -handler -hostname -method -path_info -protocol -status_line -the_request -unparsed_uri -uri -allowed -bytes_sent -chunked -content_length -header_only -method_number -mtime -no_cache -no_local_copy -proto_num -proxyreq -read_body -remaining -request_time -status -headers_in -headers_out -err_headers_out -auth_name -auth_type -basic_auth_pw -discard_request_body -is_initial_req -meets_conditions -remote_host -satisfies -server_port -set_etag -set_last_modified -some_auth_required -update_mtime -send_http_header -basic_http_header -send_header_field -send_http_trace -send_http_options -send_error_response -set_content_length -set_keepalive -rputs -log_error -lookup_uri -lookup_file -method_uri -run -internal_redirect - - -These all wrap the ap_* apache EXPORT_API functions using the same -semantics (and are also the same as the Apache::Request methods in -mod_perl if you are familiar with that) - -So, a uri handler to redirect all non-local traffic to /404.php (an -error page) would be - -phpUriHandler /tmp/uri.php - -#/tmp/uri.php -uri('/404.php'); - } - return OK; -?> - -It's important to note that since this is called from the uri -translations phase, this validation is performed for every request to -the server, not just for php pages. - -Also, scope is shared between all the hooks. So in the above, we could -merge the two and do something like: - -#/tmp/uri.php - - -and then: - -#/tmp/setup.php -send_http_header(); - echo "Hello $whoami"; - } -} -?> - -These variables are also in the same scope as a script if your script is -being handled by the standard application/x-httpd-php handler. - -This allows you to make decisions and pass data between your handlers -and scripts at all stages. - -The above are clearly trite examples, but hopefully give you a starting -point. - -One note: all handlers can be validly re-entered 'in sub-requests'. -For this reason you should not define functions/classes here without -anti-redefinition guards (I would just recommend putting them in an -include and using include_one). This is not true for phpRequire, which -is only entered once, at the main request, and so it is safe to make -function/class declarations there (in fact that's what it's for). - -Hope that helps! diff --git a/sapi/apache_hooks/apMakefile.libdir b/sapi/apache_hooks/apMakefile.libdir deleted file mode 100644 index 7b5254013a3b6..0000000000000 --- a/sapi/apache_hooks/apMakefile.libdir +++ /dev/null @@ -1,4 +0,0 @@ -This is a place-holder which indicates to Configure that it shouldn't -provide the default targets when building the Makefile in this directory. -Instead it'll just prepend all the important variable definitions, and -copy the Makefile.tmpl onto the end. diff --git a/sapi/apache_hooks/apMakefile.tmpl b/sapi/apache_hooks/apMakefile.tmpl deleted file mode 100644 index 4054e8e119533..0000000000000 --- a/sapi/apache_hooks/apMakefile.tmpl +++ /dev/null @@ -1,77 +0,0 @@ -## -## Apache 1.3 Makefile template for PHP 4.0 Module -## [src/modules/php5/Makefile.tmpl] -## - -# the parametrized target -LIB=libphp5.$(LIBEXT) - -# objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a - -# objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a - -# the general targets -all: lib -lib: $(LIB) - -# build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - -# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - cp libphp5. libphp5.a - -# build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) - rm -f $@ - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) - -# 1. extension .o for shared objects cannot be used here because -# first these files aren't still shared objects and second we -# have to use a different name to trigger the different -# implicit Make rule -# 2. extension -so.o (as used elsewhere) cannot be used because -# the suffix feature of Make really wants just .x, so we use -# extension .so-o -.SUFFIXES: .o .so-o -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< -.c.so-o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o - -# cleanup -clean: - -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB) - -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after -# using it. -depend: - cp Makefile.tmpl Makefile.tmpl.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.tmpl \ - && rm Makefile.new - -#Dependencies - -$(OBJS): Makefile - -# DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ - $(INCDIR)/buff.h \ - $(INCDIR)/http_config.h \ - $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h diff --git a/sapi/apache_hooks/config.m4 b/sapi/apache_hooks/config.m4 deleted file mode 100644 index c0ea405b0305e..0000000000000 --- a/sapi/apache_hooks/config.m4 +++ /dev/null @@ -1,278 +0,0 @@ -dnl -dnl $Id$ -dnl -AC_DEFUN([PHP_APACHE_FD_CHECK], [ -AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ - save=$CPPFLAGS - if test -n "$APXS_INCLUDEDIR"; then - CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR" - else - CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" - fi - AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ - ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) - CPPFLAGS=$save -]) -if test "$ac_cv_php_fd_in_buff" = "yes"; then - AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) -fi -]) - -AC_MSG_CHECKING(for Apache 1.x (hooks) module support via DSO through APXS) -AC_ARG_WITH(apache-hooks, -[ --with-apache-hooks[=FILE] - EXPERIMENTAL: Build shared Apache 1.x module. FILE is the optional - pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($withval, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I was not able to successfully run APXS. Possible reasons:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed;]) - AC_MSG_RESULT([2. Apache was not compiled with DSO support (--enable-module=so);]) - AC_MSG_RESULT([3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs]) - AC_MSG_RESULT([The output of $APXS follows]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@" - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APACHE_INCLUDE=-I$APXS_INCLUDEDIR - - # Test that we're trying to configure with apache 1.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) - fi - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - case $host_alias in - *aix*) - APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_AIX_LDFLAGS="-Wl,-brtl" - build_type=shared - ;; - *darwin*) - MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" - PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so - build_type=bundle - ;; - *) - build_type=shared - ;; - esac - - PHP_SELECT_SAPI(apache_hooks, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) - - # Test whether apxs support -S option - $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 - - if test "$?" != "0"; then - APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option - else - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" - fi - fi - - if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then - PHP_APXS_BROKEN=yes - fi - STRONGHOLD= - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - AC_DEFINE(HAVE_APACHE_HOOKS,1,[ ]) - AC_MSG_RESULT(yes) -],[ - AC_MSG_RESULT(no) -]) - -if test "$PHP_SAPI" != "apache_hooks"; then -AC_MSG_CHECKING(for Apache 1.x (hooks) module support) -AC_ARG_WITH(apache-hooks-static, -[ --with-apache-hooks-static[=DIR] - EXPERIMENTAL: Build Apache 1.x module. DIR is the top-level Apache - build directory [/usr/local/apache]],[ - - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache_hooks/mod_php5.* sapi/apache_hooks/libphp5.module" - - if test "$withval" = "yes"; then - # Apache's default directory - withval=/usr/local/apache - fi - if test "$withval" != "no"; then - AC_DEFINE(HAVE_APACHE_HOOKS,1,[ ]) - APACHE_HOOKS_MODULE=yes - PHP_EXPAND_PATH($withval, withval) - # For Apache 1.2.x - if test -f $withval/src/httpd.h; then - APACHE_INCLUDE=-I$withval/src - APACHE_TARGET=$withval/src - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET" - PHP_LIBS="-L. -lphp3" - AC_MSG_RESULT(yes - Apache 1.2.x) - STRONGHOLD= - if test -f $withval/src/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - # For Apache 2.0.x - elif test -f $withval/include/httpd.h && - test -f $withval/srclib/apr/include/apr_general.h ; then - AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) - # For Apache 1.3.x - elif test -f $withval/src/main/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap" - APACHE_TARGET=$withval/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - AC_MSG_RESULT(yes - Apache 1.3.x) - STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - # Also for Apache 1.3.x - elif test -f $withval/src/include/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix" - APACHE_TARGET=$withval/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - AC_MSG_RESULT(yes - Apache 1.3.x) - STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - # For StrongHold 2.2 - elif test -f $withval/apache/httpd.h; then - APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include" - APACHE_TARGET=$withval/apache - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" - STRONGHOLD=-DSTRONGHOLD=1 - AC_MSG_RESULT(yes - StrongHold) - if test -f $withval/apache/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - if test -f $withval/src/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then - AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) - fi - else - if test -f $withval/src/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) - fi - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval) - fi - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) - -fi - -AC_MSG_CHECKING(for mod_charset compatibility option) -AC_ARG_WITH(mod_charset, -[ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache)], -[ - AC_MSG_RESULT(yes) - AC_DEFINE(USE_TRANSFER_TABLES,1,[ ]) -],[ - AC_MSG_RESULT(no) -]) - -dnl Build as static module -if test -n "$APACHE_HOOKS_MODULE"; then - PHP_TARGET_RDYNAMIC - $php_shtool mkdir -p sapi/apache_hooks - PHP_OUTPUT(sapi/apache_hooks/libphp5.module) -fi - -dnl General -if test -n "$APACHE_HOOKS_INSTALL"; then - if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache_hooks/mod_php5.exp - fi - - PHP_APACHE_FD_CHECK - INSTALL_IT=$APACHE_INSTALL - - PHP_SUBST(APXS_EXP) - PHP_SUBST(APACHE_INCLUDE) - PHP_SUBST(APACHE_TARGET) - PHP_SUBST(APXS) - PHP_SUBST(APXS_LDFLAGS) - PHP_SUBST(APACHE_HOOKS_INSTALL) - PHP_SUBST(STRONGHOLD) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache_hooks/config.w32 b/sapi/apache_hooks/config.w32 deleted file mode 100644 index 9a4d12508c0b7..0000000000000 --- a/sapi/apache_hooks/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('apache-hooks', 'Build Apache 1.3.x (hooks) version of PHP', 'no'); - -if (PHP_APACHE_HOOKS != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE_HOOKS", php_usual_include_suspects + - ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" + - ";..\\php_build\\apache\\src\\include") && - CHECK_LIB("ApacheCore.lib", "apache_hooks", php_usual_lib_suspects + - ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' + - ';..\\php_build\\apache\\src\\corer')) { - // We need to play tricks to get our readdir.h used by apache - // headers - SAPI('apache_hooks', 'mod_php5.c sapi_apache.c php_apache.c', - 'php' + PHP_VERSION + 'apache_hooks.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); - } else { - WARNING("Could not find apache libraries/headers"); - } -} diff --git a/sapi/apache_hooks/libphp5.module.in b/sapi/apache_hooks/libphp5.module.in deleted file mode 100644 index 848818189701e..0000000000000 --- a/sapi/apache_hooks/libphp5.module.in +++ /dev/null @@ -1,11 +0,0 @@ -Name: php5_module -ConfigStart - RULE_WANTHSREGEX=no - RULE_HIDE=yes - PHP_LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LIBS@ $LIBS" - PHP_CFLAGS="$CFLAGS @OPENSSL_INCDIR_OPT@ -I@php_abs_top_builddir@/main -I@php_abs_top_builddir@/Zend -I@php_abs_top_builddir@/TSRM -I@php_abs_top_srcdir@ -I@php_abs_top_srcdir@/sapi/apache -I@php_abs_top_srcdir@/main -I@php_abs_top_srcdir@/Zend -I@php_abs_top_srcdir@/TSRM" - my_outfile="Makefile.config" - echo "PHP_CFLAGS=$PHP_CFLAGS" >>$my_outfile - echo "PHP_LIBS=$PHP_LIBS" >>$my_outfile - LIBS=$PHP_LIBS -ConfigEnd diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c deleted file mode 100644 index 76a2a5f072f74..0000000000000 --- a/sapi/apache_hooks/mod_php5.c +++ /dev/null @@ -1,1468 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by Zeev Suraski | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#ifdef NETWARE -#define SIGPIPE SIGINT -#endif - -#undef shutdown - -/* {{{ Prototypes - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); -static void php_save_umask(void); -static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); -static int send_php(request_rec *r, int display_source_mode, char *filename); -static int send_parsed_php(request_rec * r); -static int send_parsed_php_source(request_rec * r); -static int php_xbithack_handler(request_rec * r); -static void php_init_handler(server_rec *s, pool *p); -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -static void php_child_exit_handler(server_rec *s, pool *p); -#endif - -#if MODULE_MAGIC_NUMBER > 19961007 -#define CONST_PREFIX const -#else -#define CONST_PREFIX -#endif - - -typedef struct _sapi_stack { - int top, max, persistent; - void **elements; -} sapi_stack; - -typedef struct _php_per_dir_config { - HashTable *ini_settings; - sapi_stack headers_handlers; - sapi_stack auth_handlers; - sapi_stack access_handlers; - sapi_stack type_handlers; - sapi_stack fixup_handlers; - sapi_stack logger_handlers; - sapi_stack post_read_handlers; - sapi_stack response_handlers; -} php_per_dir_config; - -typedef struct _php_per_server_config { - sapi_stack uri_handlers; - sapi_stack requires; -} php_per_server_config; - - -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); - -/* ### these should be defined in mod_php5.h or somewhere else */ -#define USE_PATH 1 -#define IGNORE_URL 2 - -module MODULE_VAR_EXPORT php5_module; - -int saved_umask; -/* static int setup_env = 0; */ -static unsigned char apache_php_initialized; - -typedef struct _php_per_dir_entry { - char *key; - char *value; - uint key_length; - uint value_length; - int type; -} php_per_dir_entry; - -/* some systems are missing these from their header files */ - -/* {{{ zend stack utility functions - */ - -/* This code is ripped part and parcel from zend_stack.[ch]. Assuming that the - patch supporting zend_stack_init_ex is applied, all but the bottom two - module-specific iterators will be removed - */ - -int sapi_stack_init_ex(sapi_stack *stack, int persistent) -{ - stack->top = 0; - stack->persistent = persistent; - stack->elements = (void **) pemalloc(sizeof(void **) * STACK_BLOCK_SIZE, persistent); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} -int sapi_stack_push(sapi_stack *stack, void *element) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) perealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)), stack->persistent); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) element; - return stack->top++; -} -void* sapi_stack_pop(sapi_stack *stack) { - if(stack->top == 0) { - return NULL; - } - else { - return stack->elements[--stack->top]; - } -} - -int sapi_stack_destroy(sapi_stack *stack) -{ - return SUCCESS; -} - -int sapi_stack_apply_with_argument_all(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i, retval; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - retval = apply_function(stack->elements[i], arg); - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - retval = apply_function(stack->elements[i], arg); - } - break; - } - return retval; -} - - -int sapi_stack_apply_with_argument_stop_if_equals(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg, int stopval) -{ - int i; - int ret = DECLINED; - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if ((ret = apply_function(stack->elements[i], arg)) == stopval) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if ((ret = apply_function(stack->elements[i], arg)) == stopval) { - break; - } - } - break; - } - return ret; -} - -int sapi_stack_apply_with_argument_stop_if_http_error(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - int ret = DECLINED; - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if ((ret = apply_function(stack->elements[i], arg)) > 0) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if ((ret = apply_function(stack->elements[i], arg)) > 0) { - break; - } - } - break; - } - return ret; -} - -void php_handler_stack_destroy(sapi_stack *stack) -{ - php_handler *ph; - while((ph = (php_handler *)sapi_stack_pop(stack)) != NULL) { - free(ph->name); - free(ph); - } -} -/* }}} */ - -/* {{{ php_save_umask - */ -static void php_save_umask(void) -{ - saved_umask = umask(077); - umask(saved_umask); -} -/* }}} */ - -/* {{{ sapi_apache_ub_write - */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int ret=0; - - if (SG(server_context)) { - ret = rwrite(str, str_length, (request_rec *) SG(server_context)); - } - if (ret != str_length) { - php_handle_aborted_connection(); - } - return ret; -} -/* }}} */ - -/* {{{ sapi_apache_flush - */ -static void sapi_apache_flush(void *server_context) -{ - if (server_context) { -#if MODULE_MAGIC_NUMBER > 19970110 - rflush((request_rec *) server_context); -#else - bflush((request_rec *) server_context->connection->client); -#endif - } -} -/* }}} */ - -/* {{{ sapi_apache_read_post - */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - uint total_read_bytes=0, read_bytes; - request_rec *r = (request_rec *) SG(server_context); - void (*handler)(int); - - /* - * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to recieve confirmation from the server on whether or not it can send - * the rest of the request. RFC 2616 - * - */ - if (!SG(read_post_bytes) && !ap_should_client_block(r)) { - return total_read_bytes; - } - - handler = signal(SIGPIPE, SIG_IGN); - while (total_read_bytessubprocess_env, "HTTP_COOKIE"); -} -/* }}} */ - -/* {{{ sapi_apache_header_handler - */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - request_rec *r = (request_rec *) SG(server_context); - - header_name = sapi_header->header; - - header_content = p = strchr(header_name, ':'); - if (!p) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content==' '); - - if (!strcasecmp(header_name, "Content-Type")) { - r->content_type = pstrdup(r->pool, header_content); - } else if (!strcasecmp(header_name, "Set-Cookie")) { - table_add(r->headers_out, header_name, header_content); - } else { - table_set(r->headers_out, header_name, header_content); - } - - *p = ':'; /* a well behaved header handler shouldn't change its original arguments */ - - return SAPI_HEADER_ADD; -} -/* }}} */ - -/* {{{ sapi_apache_send_headers - */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - if(SG(server_context) == NULL) { /* server_context is not here anymore */ - return SAPI_HEADER_SEND_FAILED; - } - - ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code; - /* check that we haven't sent headers already, we use our own - * headers_sent since we may send headers at anytime - */ - if(!AP(headers_sent)) { - send_http_header((request_rec *) SG(server_context)); - AP(headers_sent) = 1; - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} -/* }}} */ - -/* {{{ sapi_apache_register_server_variables - */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - register int i; - array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); - table_entry *elts = (table_entry *) arr->elts; - zval **path_translated; - HashTable *symbol_table; - - for (i = 0; i < arr->nelts; i++) { - char *val; - - if (elts[i].val) { - val = elts[i].val; - } else { - val = ""; - } - php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC); - } - - /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ - if (track_vars_array) { - symbol_table = track_vars_array->value.ht; - } else if (PG(register_globals)) { - /* should never happen nowadays */ - symbol_table = EG(active_symbol_table); - } else { - symbol_table = NULL; - } - if (symbol_table - && !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) - && zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC); - } - - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_apache_startup - */ -static int php_apache_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &apache_module_entry, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ php_apache_log_message - */ -static void php_apache_log_message(char *message) -{ - TSRMLS_FETCH(); - - if (SG(server_context)) { -#if MODULE_MAGIC_NUMBER >= 19970831 - aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message); -#else - log_error(message, ((request_rec *) SG(server_context))->server); -#endif - } else { - fprintf(stderr, "%s", message); - fprintf(stderr, "\n"); - } -} -/* }}} */ - -/* {{{ php_apache_request_shutdown - */ -static void php_apache_request_shutdown(void *dummy) -{ - TSRMLS_FETCH(); - AP(current_hook) = AP_CLEANUP; - php_output_set_status(0 TSRMLS_CC); - SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ - if(SG(sapi_started)) { - php_request_shutdown(dummy); - SG(sapi_started) = 0; - } - AP(in_request) = 0; - if(AP(setup_env)) { - AP(setup_env) = 0; - } - AP(current_hook) = AP_WAITING_FOR_REQUEST; - AP(headers_sent) = 0; -} -/* }}} */ - -/* {{{ php_apache_sapi_activate - */ -static int php_apache_sapi_activate(TSRMLS_D) -{ - request_rec *r = (request_rec *) SG(server_context); - - /* - * For the Apache module version, this bit of code registers a cleanup - * function that gets triggered when our request pool is destroyed. - * We need this because at any point in our code we can be interrupted - * and that may happen before we have had time to free our memory. - * The php_request_shutdown function needs to free all outstanding allocated - * memory. - */ - block_alarms(); - register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); - AP(in_request)=1; - unblock_alarms(); - - /* Override the default headers_only value - sometimes "GET" requests should actually only - * send headers. - */ - SG(request_info).headers_only = r->header_only; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_stat - */ -static struct stat *php_apache_get_stat(TSRMLS_D) -{ - return &((request_rec *) SG(server_context))->finfo; -} -/* }}} */ - -/* {{{ php_apache_getenv - */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) -{ - return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); -} -/* }}} */ - -/* {{{ sapi_module_struct apache_sapi_module - */ -static sapi_module_struct apache_sapi_module = { - "apache", /* name */ - "Apache", /* pretty name */ - - php_apache_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - php_apache_sapi_activate, /* activate */ - NULL, /* deactivate */ - - sapi_apache_ub_write, /* unbuffered write */ - sapi_apache_flush, /* flush */ - php_apache_get_stat, /* get uid */ - php_apache_getenv, /* getenv */ - - php_error, /* error handler */ - - sapi_apache_header_handler, /* header handler */ - sapi_apache_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_apache_read_post, /* read POST data */ - sapi_apache_read_cookies, /* read Cookies */ - - sapi_apache_register_server_variables, /* register server variables */ - php_apache_log_message, /* Log message */ - NULL, /* Get request time */ - - NULL, /* php.ini path override */ - -#ifdef PHP_WIN32 - NULL, - NULL, -#else - block_alarms, /* Block interruptions */ - unblock_alarms, /* Unblock interruptions */ -#endif - - NULL, /* default post reader */ - NULL, /* treat data */ - NULL, /* exe location */ - 0, /* ini ignore */ - NULL - -}; -/* }}} */ - -/* {{{ php_restore_umask - */ -static void php_restore_umask(void) -{ - umask(saved_umask); -} -/* }}} */ - -/* {{{ init_request_info - */ -static void init_request_info(TSRMLS_D) -{ - request_rec *r = ((request_rec *) SG(server_context)); - char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); - const char *authorization=NULL; - char *tmp, *tmp_user; - - SG(request_info).query_string = r->args; - SG(request_info).path_translated = r->filename; - SG(request_info).request_uri = r->uri; - SG(request_info).request_method = (char *)r->method; - SG(request_info).proto_num = r->proto_num; - SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - SG(sapi_headers).http_response_code = r->status; - - if (r->headers_in) { - authorization = table_get(r->headers_in, "Authorization"); - } - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - - if (authorization && !auth_type(r)) { - if (!strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) { - tmp = uudecode(r->pool, authorization); - tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); - if (tmp_user) { - r->connection->user = pstrdup(r->connection->pool, tmp_user); - r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(tmp_user); - } - if (tmp) { - SG(request_info).auth_password = estrdup(tmp); - } - } else if (!strcasecmp(getword(r->pool, &authorization, ' '), "Digest")) { - r->connection->ap_auth_type = "Digest"; - SG(request_info).auth_digest = estrdup(authorization); - } - } -} -/* }}} */ - -/* {{{ php_apache_alter_ini_entries - */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) -{ - zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE); - return 0; -} -/* }}} */ - -/* {{{ php_apache_get_default_mimetype - */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) -{ - - char *mimetype; - /* Assume output will be of the default MIME type. Individual - scripts may change this later. */ - char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); - mimetype = pstrdup(r->pool, tmpmimetype); - efree(tmpmimetype); - return mimetype; -} -/* }}} */ - -/* {{{ send_php - */ -static int send_php(request_rec *r, int display_source_mode, char *filename) -{ - int retval; - php_per_dir_config *per_dir_conf; - TSRMLS_FETCH(); - if (AP(in_request)) { - zend_file_handle fh; - - fh.filename = r->filename; - fh.opened_path = NULL; - fh.free_filename = 0; - fh.type = ZEND_HANDLE_FILENAME; - - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); - return OK; - } - - zend_first_try { - - /* Make sure file exists */ - if (filename == NULL && r->finfo.st_mode == 0) { - return DECLINED; - } - - per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - - /* If PHP parser engine has been turned off with an "engine off" - * directive, then decline to handle this request - */ - if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - if (filename == NULL) { - filename = r->filename; - } - - /* Apache 1.2 has a more complex mechanism for reading POST data */ -#if MODULE_MAGIC_NUMBER > 19961007 - if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#endif - - if (AP(last_modified)) { -#if MODULE_MAGIC_NUMBER < 19970912 - if ((retval = set_last_modified(r, r->finfo.st_mtime))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#else - update_mtime (r, r->finfo.st_mtime); - set_last_modified(r); - set_etag(r); -#endif - } - /* Assume output will be of the default MIME type. Individual - scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - - /* Init timeout */ - hard_timeout("send", r); - - SG(server_context) = r; - - php_save_umask(); - if(!AP(setup_env)) { - AP(setup_env) = 1; - add_common_vars(r); - add_cgi_vars(r); - } - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); - - /* Done, restore umask, turn off timeout, close file and return */ - php_restore_umask(); - kill_timeout(r); - } zend_end_try(); - - return OK; -} -/* }}} */ - -/* {{{ send_parsed_php - */ -static int send_parsed_php(request_rec * r) -{ - int result = send_php(r, 0, NULL); - -#if MEMORY_LIMIT - { - char *mem_usage; - TSRMLS_FETCH(); - - mem_usage = ap_psprintf(r->pool, "%u", AG(allocated_memory_peak)); - AG(allocated_memory_peak) = 0; - ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage); - } -#endif - - return result; -} -/* }}} */ - -/* {{{ send_parsed_php_source - */ -static int send_parsed_php_source(request_rec * r) -{ - return send_php(r, 1, NULL); -} -/* }}} */ - - -/* {{{ destroy_per_dir_entry - */ -static void destroy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - free(per_dir_entry->key); - free(per_dir_entry->value); -} -/* }}} */ - -/* {{{ copy_per_dir_entry - */ -static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - php_per_dir_entry tmp = *per_dir_entry; - - per_dir_entry->key = (char *) malloc(tmp.key_length+1); - memcpy(per_dir_entry->key, tmp.key, tmp.key_length); - per_dir_entry->key[per_dir_entry->key_length] = 0; - - per_dir_entry->value = (char *) malloc(tmp.value_length+1); - memcpy(per_dir_entry->value, tmp.value, tmp.value_length); - per_dir_entry->value[per_dir_entry->value_length] = 0; -} -/* }}} */ - -/* {{{ should_overwrite_per_dir_entry; - - */ -static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *orig_per_dir_entry, zend_hash_key *hash_key, void *pData) -{ - php_per_dir_entry *new_per_dir_entry; - - if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) { - return 1; /* does not exist in dest, copy from source */ - } - - if (new_per_dir_entry->type==PHP_INI_SYSTEM - && orig_per_dir_entry->type!=PHP_INI_SYSTEM) { - return 1; - } else { - return 0; - } -} -/* }}} */ -/* {{{ php_destroy_per_server_info - */ -static void php_destroy_per_server_info(php_per_server_config *conf) -{ - php_handler_stack_destroy(&conf->requires); - php_handler_stack_destroy(&conf->uri_handlers); -} -/* }}} */ - -/* {{{ php_destroy_per_dir_info - */ -static void php_destroy_per_dir_info(php_per_dir_config *conf) -{ - zend_hash_destroy(conf->ini_settings); - php_handler_stack_destroy(&conf->response_handlers); - php_handler_stack_destroy(&conf->auth_handlers); - php_handler_stack_destroy(&conf->access_handlers); - php_handler_stack_destroy(&conf->type_handlers); - php_handler_stack_destroy(&conf->fixup_handlers); - php_handler_stack_destroy(&conf->logger_handlers); - php_handler_stack_destroy(&conf->post_read_handlers); - php_handler_stack_destroy(&conf->headers_handlers); - free(conf->ini_settings); -} -/* }}} */ - -/* {{{ php_create_server - */ -static void *php_create_server(pool *p, char *dummy) -{ - php_per_server_config *conf; - conf = (php_per_server_config *) malloc(sizeof(php_per_server_config)); - register_cleanup(p, (void *) conf, (void (*)(void *)) php_destroy_per_server_info, (void (*)(void *)) php_destroy_per_server_info); - - sapi_stack_init_ex(&conf->requires, 1); - sapi_stack_init_ex(&conf->uri_handlers, 1); - return conf; -} - -/* }}} */ - - -/* {{{ php_create_dir - */ -static void *php_create_dir(pool *p, char *dummy) -{ - php_per_dir_config *conf; - conf = (php_per_dir_config *) malloc(sizeof(php_per_dir_config)); - conf->ini_settings = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(conf->ini_settings, 5, NULL, (void (*)(void *)) destroy_per_dir_entry, 1, 0); - sapi_stack_init_ex(&conf->response_handlers, 1); - sapi_stack_init_ex(&conf->headers_handlers, 1); - sapi_stack_init_ex(&conf->auth_handlers, 1); - sapi_stack_init_ex(&conf->access_handlers, 1); - sapi_stack_init_ex(&conf->type_handlers, 1); - sapi_stack_init_ex(&conf->fixup_handlers, 1); - sapi_stack_init_ex(&conf->logger_handlers, 1); - sapi_stack_init_ex(&conf->post_read_handlers, 1); - register_cleanup(p, (void *) conf, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) php_destroy_per_dir_info); - - return conf; -} - -/* }}} */ - -/* {{{ php_merge_dir - */ -static void *php_merge_dir(pool *p, void *basev, void *addv) -{ - php_per_dir_config *a = (php_per_dir_config *) addv; - php_per_dir_config *b = (php_per_dir_config *) basev; - /* This function *must* return addv, and not modify basev */ - zend_hash_merge_ex((HashTable *) a->ini_settings, (HashTable *) b->ini_settings, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); - a->headers_handlers = (a->headers_handlers.top)?a->headers_handlers:b->headers_handlers; - a->auth_handlers = (a->auth_handlers.top)?a->auth_handlers:b->auth_handlers; - a->access_handlers = (a->access_handlers.top)?a->access_handlers:b->access_handlers; - a->type_handlers = (a->type_handlers.top)?a->type_handlers:b->type_handlers; - a->fixup_handlers = (a->fixup_handlers.top)?a->fixup_handlers:b->fixup_handlers; - a->logger_handlers = (a->logger_handlers.top)?a->logger_handlers:b->logger_handlers; - a->post_read_handlers = (a->post_read_handlers.top)?a->post_read_handlers:b->post_read_handlers; - a->response_handlers = (a->response_handlers.top)?a->response_handlers:b->response_handlers; - return a; -} -/* }}} */ - -/* {{{ php_apache_value_handler_ex - */ -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - php_per_dir_entry per_dir_entry; - - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } - per_dir_entry.type = mode; - - if (strcasecmp(arg2, "none") == 0) { - arg2 = ""; - } - - per_dir_entry.key_length = strlen(arg1); - per_dir_entry.value_length = strlen(arg2); - - per_dir_entry.key = (char *) malloc(per_dir_entry.key_length+1); - memcpy(per_dir_entry.key, arg1, per_dir_entry.key_length); - per_dir_entry.key[per_dir_entry.key_length] = 0; - - per_dir_entry.value = (char *) malloc(per_dir_entry.value_length+1); - memcpy(per_dir_entry.value, arg2, per_dir_entry.value_length); - per_dir_entry.value[per_dir_entry.value_length] = 0; - - zend_hash_update(conf, per_dir_entry.key, per_dir_entry.key_length, &per_dir_entry, sizeof(php_per_dir_entry), NULL); - return NULL; -} -/* }}} */ - -static CONST_PREFIX char *php_set_server_handler(server_rec *s, char *arg1, long handler_stage, long handler_type) -{ - php_per_server_config *conf; - php_handler *handler; - handler = (php_handler *) malloc(sizeof(php_handler)); - handler->type = handler_type; - handler->stage = handler_stage; - handler->name = strdup(arg1); - conf = get_module_config(s->module_config, &php5_module); - switch(handler_stage) { - case AP_URI_TRANS: - sapi_stack_push(&conf->uri_handlers, handler); - break; - default: - sapi_stack_push(&conf->requires, handler); - break; - } - return NULL; -} - -static CONST_PREFIX char *php_set_dir_handler(php_per_dir_config *conf, char *arg1, long handler_stage, long handler_type) -{ - php_handler *handler; - handler = (php_handler *) malloc(sizeof(php_handler)); - handler->type = handler_type; - handler->stage = handler_stage; - handler->name = strdup(arg1); - switch(handler_stage) { - case AP_POST_READ: - sapi_stack_push(&conf->post_read_handlers, handler); - break; - case AP_HEADER_PARSE: - sapi_stack_push(&conf->headers_handlers, handler); - break; - case AP_ACCESS_CONTROL: - sapi_stack_push(&conf->access_handlers, handler); - break; - case AP_AUTHENTICATION: - sapi_stack_push(&conf->auth_handlers, handler); - break; - case AP_AUTHORIZATION: - break; - case AP_TYPE_CHECKING: - sapi_stack_push(&conf->type_handlers, handler); - break; - case AP_FIXUP: - sapi_stack_push(&conf->fixup_handlers, handler); - break; - case AP_RESPONSE: - sapi_stack_push(&conf->response_handlers, handler); - break; - case AP_LOGGING: - sapi_stack_push(&conf->logger_handlers, handler); - break; - default: - break; - } - return NULL; -} - -/* {{{ php_set_uri_handler - */ -static CONST_PREFIX char *php_set_uri_handler(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, AP_URI_TRANS, AP_HANDLER_TYPE_FILE); -} -/* }}} */ - -/* {{{ php_set_uri_handler_code */ -static CONST_PREFIX char *php_set_uri_handler_code(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, AP_URI_TRANS, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_header_handler - */ -static CONST_PREFIX char *php_set_header_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_HEADER_PARSE, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_header_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_HEADER_PARSE, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_auth_handler - */ -static CONST_PREFIX char *php_set_auth_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_AUTHENTICATION, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_auth_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_AUTHENTICATION, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_access_handler - */ -static CONST_PREFIX char *php_set_access_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_ACCESS_CONTROL, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_access_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_ACCESS_CONTROL, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_type_handler - */ -static CONST_PREFIX char *php_set_type_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_TYPE_CHECKING, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_type_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_TYPE_CHECKING, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_fixup_handler - */ -static CONST_PREFIX char *php_set_fixup_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_FIXUP, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_fixup_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_FIXUP, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_logger_handler - */ -static CONST_PREFIX char *php_set_logger_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_LOGGING, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_logger_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_LOGGING, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_post_read_handler - */ -static CONST_PREFIX char *php_set_post_read_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_POST_READ, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_post_read_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_POST_READ, AP_HANDLER_TYPE_METHOD); -} - - -/* }}} */ - -/* {{{ php_set_require - */ - -static CONST_PREFIX char *php_set_require(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, 0, AP_HANDLER_TYPE_FILE); -} -/* }}} */ - -/* {{{ php_set_response_handler - */ -static CONST_PREFIX char *php_set_response_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_RESPONSE, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_response_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_RESPONSE, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_apache_value_handler - */ -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_value_handler - */ -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_flag_handler_ex - */ -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On")) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode); -} -/* }}} */ - -/* {{{ php_apache_flag_handler - */ -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_flag_handler - */ -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ int php_xbithack_handler(request_rec * r) - */ -static int php_xbithack_handler(request_rec * r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - - if (!(r->finfo.st_mode & S_IXUSR)) { - r->allowed |= (1 << METHODS) - 1; - return DECLINED; - } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (conf) { - zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - if(!AP(xbithack)) { - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - return send_parsed_php(r); -} -/* }}} */ - -/* {{{ apache_php_module_shutdown_wrapper - */ -static void apache_php_module_shutdown_wrapper(void) -{ - apache_php_initialized = 0; - apache_sapi_module.shutdown(&apache_sapi_module); - -#if MODULE_MAGIC_NUMBER >= 19970728 - /* This function is only called on server exit if the apache API - * child_exit handler exists, so shutdown globally - */ - sapi_shutdown(); -#endif - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -/* {{{ php_child_exit_handler - */ -static void php_child_exit_handler(server_rec *s, pool *p) -{ -/* apache_php_initialized = 0; */ - apache_sapi_module.shutdown(&apache_sapi_module); - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ -#endif - -/* {{{ void php_init_handler(server_rec *s, pool *p) - */ -static void php_init_handler(server_rec *s, pool *p) -{ - register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } -#if MODULE_MAGIC_NUMBER >= 19980527 - { - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component("PHP/" PHP_VERSION); - } - } -#endif -} -/* }}} */ - -static int php_run_hook(php_handler *handler, request_rec *r) -{ - zval *ret = NULL; - php_per_dir_config *conf; - - TSRMLS_FETCH(); - - if(!AP(apache_config_loaded)) { - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (conf) - zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - AP(apache_config_loaded) = 1; - } - if (!handler->name) { - return DECLINED; - } - php_save_umask(); - if (!AP(setup_env)) { - AP(setup_env) = 1; - add_common_vars(r); - add_cgi_vars(r); - } - SG(server_context) = r; - init_request_info(TSRMLS_C); - apache_php_module_hook(r, handler, &ret TSRMLS_CC); - php_restore_umask(); - kill_timeout(r); - if (ret) { - convert_to_long(ret); - return Z_LVAL_P(ret); - } - return HTTP_INTERNAL_SERVER_ERROR; -} - - -static int php_uri_translation(request_rec *r) -{ - php_per_server_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_URI_TRANS; - conf = (php_per_server_config *) get_module_config(r->server->module_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r, OK); -} - -static int php_header_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_HEADER_PARSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); -} - -static int php_auth_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_AUTHENTICATION; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r, OK); -} - -static int php_access_hook(request_rec *r) -{ - php_per_dir_config *conf; - int status = DECLINED; - TSRMLS_FETCH(); - AP(current_hook) = AP_ACCESS_CONTROL; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); - return status; - -} - -static int php_type_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_TYPE_CHECKING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r, OK); -} - -static int php_fixup_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_FIXUP; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r); -} - -static int php_logger_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_LOGGING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r); -} - -static int php_post_read_hook(request_rec *r) -{ - php_per_dir_config *conf; - php_per_server_config *svr; - TSRMLS_FETCH(); - AP(current_hook) = AP_POST_READ; - svr = get_module_config(r->server->module_config, &php5_module); - if(ap_is_initial_req(r)) { - sapi_stack_apply_with_argument_all(&svr->requires, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); - } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->post_read_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); -} - -static int php_response_handler(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_RESPONSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); -} - -/* {{{ handler_rec php_handlers[] - */ -handler_rec php_handlers[] = -{ - {"application/x-httpd-php", send_parsed_php}, - {"application/x-httpd-php-source", send_parsed_php_source}, - {"text/html", php_xbithack_handler}, - {"php-script", php_response_handler}, - {NULL} -}; -/* }}} */ - -/* {{{ command_rec php_commands[] - */ -command_rec php_commands[] = -{ - {"php_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"}, - {"phpUriHandler", php_set_uri_handler, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"}, - {"phpUriHandlerMethod", php_set_uri_handler_code, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"}, -#if MODULE_MAGIC_NUMBER >= 19970103 - {"phpHeaderHandler", php_set_header_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpHeaderHandlerMethod", php_set_header_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#endif - {"phpAuthHandler", php_set_auth_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAuthHandlerMethod", php_set_auth_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAccessHandler", php_set_access_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAccessHandlerMethod", php_set_access_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpTypeHandler", php_set_type_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpTypeHandlerMethod", php_set_type_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpFixupHandler", php_set_fixup_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpFixupHandlerMethod", php_set_fixup_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpLoggerHandler", php_set_logger_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpLoggerHandlerMethod", php_set_logger_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#if MODULE_MAGIC_NUMBER >= 19970902 - {"phpPostReadHandler", php_set_post_read_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpPostReadHandlerMethod", php_set_post_read_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpRequire", php_set_require, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpResponseHandler", php_set_response_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpResponseHandlerMethod", php_set_response_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#endif - {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, - {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, - {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, - {NULL} -}; -/* }}} */ - -/* {{{ module MODULE_VAR_EXPORT php5_module - */ -module MODULE_VAR_EXPORT php5_module = -{ - STANDARD_MODULE_STUFF, - php_init_handler, /* initializer */ - php_create_dir, /* per-directory config creator */ - php_merge_dir, /* dir merger */ - php_create_server, /* per-server config creator */ - NULL, /* merge server config */ - php_commands, /* command table */ - php_handlers, /* handlers */ - php_uri_translation, /* filename translation */ - NULL, /* check_user_id */ - php_auth_hook, /* check auth */ - php_access_hook, /* check access */ - php_type_hook, /* type_checker */ - php_fixup_hook, /* fixups */ - php_logger_hook /* logger */ -#if MODULE_MAGIC_NUMBER >= 19970103 - , php_header_hook /* header parser */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970719 - , NULL /* child_init */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970728 - , php_child_exit_handler /* child_exit */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970902 - , php_post_read_hook /* post read-request */ -#endif -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/mod_php5.exp b/sapi/apache_hooks/mod_php5.exp deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache_hooks/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache_hooks/mod_php5.h b/sapi/apache_hooks/mod_php5.h deleted file mode 100644 index f89f98282eb70..0000000000000 --- a/sapi/apache_hooks/mod_php5.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef MOD_PHP5_H -#define MOD_PHP5_H - -#if !defined(WIN32) && !defined(WINNT) -#ifndef MODULE_VAR_EXPORT -#define MODULE_VAR_EXPORT -#endif -#endif - -typedef struct { - long engine; - long last_modified; - long xbithack; - long terminate_child; - long setup_env; - long current_hook; - zend_bool in_request; - zend_bool apache_config_loaded; - zend_bool headers_sent; -} php_apache_info_struct; - -typedef struct _php_handler { - long type; - long stage; - char *name; -} php_handler; - -#define AP_HANDLER_TYPE_FILE 0 -#define AP_HANDLER_TYPE_METHOD 1 - -extern zend_module_entry apache_module_entry; - -#ifdef ZTS -extern int php_apache_info_id; -#define AP(v) TSRMG(php_apache_info_id, php_apache_info_struct *, v) -#else -extern php_apache_info_struct php_apache_info; -#define AP(v) (php_apache_info.v) -#endif - -/* defines for the various stages of the apache request */ -#define AP_WAITING_FOR_REQUEST 0 -#define AP_POST_READ 1 -#define AP_URI_TRANS 2 -#define AP_HEADER_PARSE 3 -#define AP_ACCESS_CONTROL 4 -#define AP_AUTHENTICATION 5 -#define AP_AUTHORIZATION 6 -#define AP_TYPE_CHECKING 7 -#define AP_FIXUP 8 -#define AP_RESPONSE 9 -#define AP_LOGGING 10 -#define AP_CLEANUP 11 - -#endif /* MOD_PHP5_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/apache_hooks/php.sym b/sapi/apache_hooks/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache_hooks/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache_hooks/php5apache_hooks.dsp b/sapi/apache_hooks/php5apache_hooks.dsp deleted file mode 100755 index cc60f4b3b1bf9..0000000000000 --- a/sapi/apache_hooks/php5apache_hooks.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache_hooks" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache_hooks - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache_hooks.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache_hooks.mak" CFG="php5apache_hooks - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache_hooks - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache_hooks - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache_hooks - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache_hooks - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\apache\src\corer" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php5apache_hooks.dll" /pdbtype:sept /libpath:"..\..\..\php_build\apache\src\cored" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"\apache\src\corer" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ENDIF - -# Begin Target - -# Name "php5apache_hooks - Win32 Release_TS" -# Name "php5apache_hooks - Win32 Debug_TS" -# Name "php5apache_hooks - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_apache.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mod_php5.h -# End Source File -# Begin Source File - -SOURCE=.\php_apache_http.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c deleted file mode 100644 index f65e31c41f280..0000000000000 --- a/sapi/apache_hooks/php_apache.c +++ /dev/null @@ -1,1954 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Sĉther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#if defined(PHP_WIN32) || defined(NETWARE) -#include "zend.h" -#include "ap_compat.h" -#else -#include -#endif - -#ifdef ZTS -int php_apache_info_id; -#else -php_apache_info_struct php_apache_info; -#endif - -#define SECTION(name) PUTS("

              " name "

              \n") - -#undef offsetof -#define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field)) - -extern module *top_module; -extern module **ap_loaded_modules; -static int le_apachereq; -static zend_class_entry *apacherequest_class_entry; - -static void apache_table_to_zval(table *, int safe_mode, zval *return_value); - -PHP_FUNCTION(virtual); -PHP_FUNCTION(apache_request_headers); -PHP_FUNCTION(apache_response_headers); -PHP_FUNCTION(apachelog); -PHP_FUNCTION(apache_note); -PHP_FUNCTION(apache_lookup_uri); -PHP_FUNCTION(apache_child_terminate); -PHP_FUNCTION(apache_setenv); -PHP_FUNCTION(apache_get_version); -PHP_FUNCTION(apache_get_modules); - -PHP_MINFO_FUNCTION(apache); - - -function_entry apache_functions[] = { - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(apache_child_terminate, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ php_apache ini entries - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("child_terminate", "0", PHP_INI_ALL, OnUpdateLong, terminate_child, php_apache_info_struct, php_apache_info) -PHP_INI_END() -/* }}} */ - -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) -{ - apache_globals->in_request = 0; -} - - -#define APREQ_GET_THIS(ZVAL) if (NULL == (ZVAL = getThis())) { \ - php_error(E_WARNING, "%s(): underlying ApacheRequest object missing", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } -#define APREQ_GET_REQUEST(ZVAL, R) APREQ_GET_THIS(ZVAL); \ - R = get_apache_request(ZVAL TSRMLS_CC) - -static void php_apache_request_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - zval *z = (zval *)rsrc->ptr; -/* fprintf(stderr, "%s() %p\n", __FUNCTION__, z); */ - zval_ptr_dtor(&z); -} - -static request_rec *get_apache_request(pval *z TSRMLS_DC) -{ - request_rec *r; - zval **addr; - - if (NULL == z) { - php_error(E_WARNING, "get_apache_request() invalid wrapper passed"); - return NULL; - } - - if (Z_TYPE_P(z) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(z), 0, (void **)&addr) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - r = (request_rec *)Z_LVAL_PP(addr); - if (!r) { - php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return r; -} - -/* {{{ php_apache_request_new(request_rec *r) - * create a new zval-instance for ApacheRequest that wraps request_rec - */ -zval *php_apache_request_new(request_rec *r) -{ - zval *req; - zval *addr; - - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) r; - - MAKE_STD_ZVAL(req); - object_init_ex(req, apacherequest_class_entry); - zend_hash_index_update(Z_OBJPROP_P(req), 0, &addr, sizeof(zval *), NULL); - - return req; -} -/* }}} */ - -/* {{{ apache_request_read_string_slot() - */ -static void apache_request_read_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id; - request_rec *r; - char *s; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - s = *(char **)((char*)r + offset); - - if (s) - RETURN_STRING(s, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - - -/* {{{ apache_request_string_slot() - */ -static void apache_request_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id, **new_value; - request_rec *r; - char *old_value; - char **target; - - APREQ_GET_REQUEST(id, r); - - target = (char **)((char*)r + offset); - old_value = *target; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &new_value) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(new_value); - *target = ap_pstrdup(r->pool, Z_STRVAL_PP(new_value)); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (old_value) - RETURN_STRING(old_value, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ apache_request_read_int_slot() - */ -static void apache_request_read_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id; - request_rec *r; - long l; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - l = *(long *)((char*)r + offset); - - RETURN_LONG(l); -} -/* }}} */ - -/* {{{ apache_request_int_slot() - */ -static void apache_request_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id, **new_value; - request_rec *r; - long old_value; - long *target; - - APREQ_GET_REQUEST(id, r); - - target = (long *)((char*)r + offset); - old_value = *target; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &new_value) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(new_value); - *target = Z_LVAL_PP(new_value); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - RETURN_LONG(old_value); -} -/* }}} */ - - -/* {{{ access string slots of request rec - */ - -/* {{{ proto string ApacheRequest::filename([string new_filename]) - */ -PHP_FUNCTION(apache_request_filename) -{ - apache_request_string_slot(offsetof(request_rec, filename), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::uri([string new_uri]) - */ -PHP_FUNCTION(apache_request_uri) -{ - apache_request_string_slot(offsetof(request_rec, uri), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::unparsed_uri([string new_unparsed_uri]) - */ -PHP_FUNCTION(apache_request_unparsed_uri) -{ - apache_request_string_slot(offsetof(request_rec, unparsed_uri), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::path_info([string new_path_info]) - */ -PHP_FUNCTION(apache_request_path_info) -{ - apache_request_string_slot(offsetof(request_rec, path_info), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::args([string new_args]) - */ -PHP_FUNCTION(apache_request_args) -{ - apache_request_string_slot(offsetof(request_rec, args), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::boundary() - */ -PHP_FUNCTION(apache_request_boundary) -{ - apache_request_read_string_slot(offsetof(request_rec, boundary), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto string ApacheRequest::content_type([string new_type]) - */ -PHP_FUNCTION(apache_request_content_type) -{ - apache_request_string_slot(offsetof(request_rec, content_type), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::content_encoding([string new_encoding]) - */ -PHP_FUNCTION(apache_request_content_encoding) -{ - apache_request_string_slot(offsetof(request_rec, content_encoding), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::handler([string new_handler]) - */ -PHP_FUNCTION(apache_request_handler) -{ - apache_request_string_slot(offsetof(request_rec, handler), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::the_request() - */ -PHP_FUNCTION(apache_request_the_request) -{ - apache_request_read_string_slot(offsetof(request_rec, the_request), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::protocol() - */ -PHP_FUNCTION(apache_request_protocol) -{ - apache_request_read_string_slot(offsetof(request_rec, protocol), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::hostname() - */ -PHP_FUNCTION(apache_request_hostname) -{ - apache_request_read_string_slot(offsetof(request_rec, hostname), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::status_line([string new_status_line]) - */ -PHP_FUNCTION(apache_request_status_line) -{ - apache_request_string_slot(offsetof(request_rec, status_line), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::method() - */ -PHP_FUNCTION(apache_request_method) -{ - apache_request_read_string_slot(offsetof(request_rec, method), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* }}} access string slots of request rec */ - -/* {{{ access int slots of request_rec - */ - -/* {{{ proto int ApacheRequest::proto_num() - */ -PHP_FUNCTION(apache_request_proto_num) -{ - apache_request_read_int_slot(offsetof(request_rec, proto_num), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::assbackwards() - */ -PHP_FUNCTION(apache_request_assbackwards) -{ - apache_request_read_int_slot(offsetof(request_rec, assbackwards), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto int ApacheRequest::proxyreq([int new_proxyreq]) - */ -PHP_FUNCTION(apache_request_proxyreq) -{ - apache_request_int_slot(offsetof(request_rec, proxyreq), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::chunked() - */ -PHP_FUNCTION(apache_request_chunked) -{ - apache_request_read_int_slot(offsetof(request_rec, chunked), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto int ApacheRequest::header_only() - */ -PHP_FUNCTION(apache_request_header_only) -{ - apache_request_read_int_slot(offsetof(request_rec, header_only), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::request_time() - */ -PHP_FUNCTION(apache_request_request_time) -{ - apache_request_read_int_slot(offsetof(request_rec, request_time), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::status([int new_status]) - */ -PHP_FUNCTION(apache_request_status) -{ - apache_request_int_slot(offsetof(request_rec, status), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::method_number([int method_number]) - */ -PHP_FUNCTION(apache_request_method_number) -{ - apache_request_read_int_slot(offsetof(request_rec, method_number), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::allowed([int allowed]) - */ -PHP_FUNCTION(apache_request_allowed) -{ - apache_request_int_slot(offsetof(request_rec, allowed), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::bytes_sent() - */ -PHP_FUNCTION(apache_request_bytes_sent) -{ - apache_request_read_int_slot(offsetof(request_rec, bytes_sent), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::mtime() - */ -PHP_FUNCTION(apache_request_mtime) -{ - apache_request_read_int_slot(offsetof(request_rec, mtime), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::content_length([int new_content_length]) - */ -PHP_FUNCTION(apache_request_content_length) -{ - zval *id, **zlen; - request_rec *r; - - if (ZEND_NUM_ARGS() == 0) { - apache_request_read_int_slot(offsetof(request_rec, clength), INTERNAL_FUNCTION_PARAM_PASSTHRU); - } - else if (ZEND_NUM_ARGS() > 1) { - WRONG_PARAM_COUNT; - } - else { - if (zend_get_parameters_ex(1, &zlen) == FAILURE) { - RETURN_FALSE; - } - - APREQ_GET_REQUEST(id, r); - - convert_to_long_ex(zlen); - (void)ap_set_content_length(r, Z_LVAL_PP(zlen)); - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto int ApacheRequest::remaining() - */ -PHP_FUNCTION(apache_request_remaining) -{ - apache_request_read_int_slot(offsetof(request_rec, remaining), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::no_cache() - */ -PHP_FUNCTION(apache_request_no_cache) -{ - apache_request_int_slot(offsetof(request_rec, no_cache), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::no_local_copy() - */ -PHP_FUNCTION(apache_request_no_local_copy) -{ - apache_request_int_slot(offsetof(request_rec, no_local_copy), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::read_body() - */ -PHP_FUNCTION(apache_request_read_body) -{ - apache_request_int_slot(offsetof(request_rec, read_body), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* }}} access int slots of request_rec */ - - -/* {{{ proto array apache_request_headers_in() - * fetch all incoming request headers - */ -PHP_FUNCTION(apache_request_headers_in) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - apache_table_to_zval(r->headers_in, 0, return_value); -} -/* }}} */ - - -/* {{{ add_header_to_table -*/ -static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *first = NULL; - zval *second = NULL; - zval **entry, **value; - char *string_key; - uint string_key_len; - ulong num_key; - - zend_bool replace = 0; - HashPosition pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zb", &first, &second, &replace) == FAILURE) - RETURN_FALSE; - - if (Z_TYPE_P(first) == IS_ARRAY) { - switch(ZEND_NUM_ARGS()) { - case 1: - case 3: - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(first), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) { - switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) { - case HASH_KEY_IS_STRING: - if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) { - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - continue; - } - if (!value) { - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - continue; - } - - convert_to_string_ex(value); - if (replace) - ap_table_set(t, string_key, Z_STRVAL_PP(value)); - else - ap_table_merge(t, string_key, Z_STRVAL_PP(value)); - - break; - case HASH_KEY_IS_LONG: - default: - php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name(TSRMLS_C)); - break; - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - } - else if (Z_TYPE_P(first) == IS_STRING) { - switch(ZEND_NUM_ARGS()) { - case 2: - case 3: - convert_to_string_ex(&second); - if (replace) - ap_table_set(t, Z_STRVAL_P(first), Z_STRVAL_P(second)); - else - ap_table_merge(t, Z_STRVAL_P(first), Z_STRVAL_P(second)); - break; - default: - WRONG_PARAM_COUNT; - break; - } - } - else { - RETURN_FALSE; - } -} - -/* }}} */ - - -/* {{{ proto array apache_request_headers_out([{string name|array list} [, string value [, bool replace = false]]]) - * fetch all outgoing request headers - */ -PHP_FUNCTION(apache_request_headers_out) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - if (ZEND_NUM_ARGS() > 0) - add_header_to_table(r->headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU); - - apache_table_to_zval(r->headers_out, 0, return_value); -} -/* }}} */ - - -/* {{{ proto array apache_request_err_headers_out([{string name|array list} [, string value [, bool replace = false]]]) - * fetch all headers that go out in case of an error or a subrequest - */ -PHP_FUNCTION(apache_request_err_headers_out) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - if (ZEND_NUM_ARGS() > 0) - add_header_to_table(r->err_headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU); - - apache_table_to_zval(r->err_headers_out, 0, return_value); -} -/* }}} */ - - -/* {{{ proxy functions for the ap_* functions family - */ - -/* {{{ proto int apache_request_server_port() - */ -PHP_FUNCTION(apache_request_server_port) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_get_server_port(r)); -} -/* }}} */ - -/* {{{ proto int apache_request_remote_host([int type]) - */ -PHP_FUNCTION(apache_request_remote_host) -{ - zval *id, **ztype; - request_rec *r; - char *res; - int type = REMOTE_NAME; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &ztype) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(ztype); - type = Z_LVAL_PP(ztype); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - APREQ_GET_REQUEST(id, r); - - res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type); - if (res) - RETURN_STRING(res, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ proto long apache_request_update_mtime([int dependency_mtime]) - */ -PHP_FUNCTION(apache_request_update_mtime) -{ - zval *id, **zmtime; - request_rec *r; - int mtime = 0; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &zmtime) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zmtime); - mtime = Z_LVAL_PP(zmtime); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_update_mtime(r, mtime)); -} -/* }}} */ - - -/* {{{ proto void apache_request_set_etag() - */ -PHP_FUNCTION(apache_request_set_etag) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - ap_set_etag(r); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void apache_request_set_last_modified() - */ -PHP_FUNCTION(apache_request_set_last_modified) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - ap_set_last_modified(r); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto long apache_request_meets_conditions() - */ -PHP_FUNCTION(apache_request_meets_conditions) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_meets_conditions(r)); -} -/* }}} */ - -/* {{{ proto long apache_request_discard_request_body() - */ -PHP_FUNCTION(apache_request_discard_request_body) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_discard_request_body(r)); -} -/* }}} */ - -/* {{{ proto long apache_request_satisfies() - */ -PHP_FUNCTION(apache_request_satisfies) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_satisfies(r)); -} -/* }}} */ - - -/* {{{ proto bool apache_request_is_initial_req() - */ -PHP_FUNCTION(apache_request_is_initial_req) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_BOOL(ap_is_initial_req(r)); -} -/* }}} */ - -/* {{{ proto bool apache_request_some_auth_required() - */ -PHP_FUNCTION(apache_request_some_auth_required) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_BOOL(ap_some_auth_required(r)); -} -/* }}} */ - -/* {{{ proto string apache_request_auth_type() - */ -PHP_FUNCTION(apache_request_auth_type) -{ - zval *id; - request_rec *r; - char *t; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - t = (char *)ap_auth_type(r); - if (!t) - RETURN_NULL(); - - RETURN_STRING(t, 1); -} -/* }}} */ - -/* {{{ proto string apache_request_auth_name() - */ -PHP_FUNCTION(apache_request_auth_name) -{ - zval *id; - request_rec *r; - char *t; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - t = (char *)ap_auth_name(r); - if (!t) - RETURN_NULL(); - - RETURN_STRING(t, 1); -} -/* }}} */ - -/* {{{ proto apache_request_basic_auth_pw() - */ -PHP_FUNCTION(apache_request_basic_auth_pw) -{ - zval *id, *zpw; - request_rec *r; - const char *pw; - long status; - - if (ZEND_NUM_ARGS() != 1) { - WRONG_PARAM_COUNT; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zpw) == FAILURE) { - RETURN_NULL(); - } - - if (!PZVAL_IS_REF(zpw)) { - zend_error(E_WARNING, "Parameter wasn't passed by reference"); - RETURN_NULL(); - } - - - APREQ_GET_REQUEST(id, r); - - pw = NULL; - status = ap_get_basic_auth_pw(r, &pw); - if (status == OK && pw) { - ZVAL_STRING(zpw, (char *)pw, 1); - } - else - ZVAL_NULL(zpw); - RETURN_LONG(status); -} -/* }}} */ - - -/* http_protocol.h */ - -PHP_FUNCTION(apache_request_send_http_header) -{ - zval *id; - request_rec *r; - char *type = NULL; - int typelen; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) - return; - APREQ_GET_REQUEST(id, r); - if(type) { - r->content_type = pstrdup(r->pool, type); - } - ap_send_http_header(r); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_basic_http_header) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_basic_http_header((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_http_trace) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_send_http_trace((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_http_options) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_send_http_options((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_error_response) -{ - zval **recursive; - zval *id; - request_rec *r; - int rec; - - switch(ZEND_NUM_ARGS()) { - case 0: - rec = 0; - break; - case 1: - if(zend_get_parameters_ex(1, &recursive) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(recursive); - rec = Z_LVAL_PP(recursive); - break; - default: - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - ap_send_error_response(r, rec); - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_set_content_length) -{ - zval **length; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &length) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - - convert_to_long_ex(length); - ap_set_content_length(r, Z_LVAL_PP(length)); - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_set_keepalive) -{ - zval *id; - request_rec *r; - APREQ_GET_REQUEST(id, r); - ap_set_keepalive(r); - RETURN_TRUE; -} - -/* This stuff should use streams or however this is implemented now - -PHP_FUNCTION(apache_request_send_fd) -{ -} - -PHP_FUNCTION(apache_request_send_fd_length) -{ -} -*/ - -/* These are for overriding default output behaviour */ -PHP_FUNCTION(apache_request_rputs) -{ - zval **buffer; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &buffer) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(buffer); - ap_rwrite(Z_STRVAL_PP(buffer), Z_STRLEN_PP(buffer), (request_rec*)SG(server_context)); -} - -/* This stuff would be useful for custom POST handlers, - which should be supported. Probably by not using - sapi_activate at all inside a phpResponseHandler - and instead using a builtin composed of the below - calls as a apache_read_request_body() and allow - people to custom craft their own. - -PHP_FUNCTION(apache_request_setup_client_block) -{ -} - -PHP_FUNCTION(apache_request_should_client_block) -{ -} - -PHP_FUNCTION(apache_request_get_client_block) -{ -} - -PHP_FUNCTION(apache_request_discard_request_body) -{ -} -*/ - -/* http_log.h */ - -/* {{{ proto boolean apache_request_log_error(string message, [long facility]) - */ -PHP_FUNCTION(apache_request_log_error) -{ - zval *id; - zval **z_errstr, **z_facility; - request_rec *r; - int facility = APLOG_ERR; - - switch(ZEND_NUM_ARGS()) { - case 1: - if(zend_get_parameters_ex(1, &z_errstr) == FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if(zend_get_parameters_ex(1, &z_errstr, &z_facility) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(z_facility); - facility = Z_LVAL_PP(z_facility); - break; - default: - WRONG_PARAM_COUNT; - break; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(z_errstr); - ap_log_error(APLOG_MARK, facility, r->server, "%s", Z_STRVAL_PP(z_errstr)); - RETURN_TRUE; -} -/* }}} */ -/* http_main.h */ - -/* {{{ proto object apache_request_sub_req_lookup_uri(string uri) - Returns sub-request for the specified uri. You would - need to run it yourself with run() -*/ -PHP_FUNCTION(apache_request_sub_req_lookup_uri) -{ - zval *id; - zval **file; - request_rec *r, *sub_r; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(file); - sub_r = ap_sub_req_lookup_uri(Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto object apache_request_sub_req_lookup_file(string file) - Returns sub-request for the specified file. You would - need to run it yourself with run(). -*/ -PHP_FUNCTION(apache_request_sub_req_lookup_file) -{ - zval *id; - zval **file; - request_rec *r, *sub_r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(file); - sub_r = ap_sub_req_lookup_file(Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto object apache_request_sub_req_method_uri(string method, string uri) - Returns sub-request for the specified file. You would - need to run it yourself with run(). -*/ -PHP_FUNCTION(apache_request_sub_req_method_uri) -{ - zval *id; - zval **file, **method; - request_rec *r, *sub_r; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &method, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(method); - convert_to_string_ex(file); - sub_r = ap_sub_req_method_uri(Z_STRVAL_PP(method),Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto long apache_request_run() - This is a wrapper for ap_sub_run_req and ap_destory_sub_req. It takes - sub_request, runs it, destroys it, and returns it's status. -*/ -PHP_FUNCTION(apache_request_run) -{ - zval *id; - request_rec *r; - int status; - - APREQ_GET_REQUEST(id, r); - if(!r || ap_is_initial_req(r)) - RETURN_FALSE; - status = ap_run_sub_req(r); - ap_destroy_sub_req(r); - RETURN_LONG(status); -} -/* }}} */ - -PHP_FUNCTION(apache_request_internal_redirect) -{ - zval *id; - zval **new_uri; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_uri) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(new_uri); - ap_internal_redirect(Z_STRVAL_PP(new_uri), r); -} - -PHP_FUNCTION(apache_request_send_header_field) -{ - zval **fieldname; - zval **fieldval; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fieldname, &fieldval) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(fieldname); - convert_to_string_ex(fieldval); - APREQ_GET_REQUEST(id, r); - - ap_send_header_field(r, Z_STRVAL_PP(fieldname), Z_STRVAL_PP(fieldval)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; -} - - - -/* }}} */ - -/* {{{ php_apache_request_class_functions - */ -static function_entry php_apache_request_class_functions[] = { - /* string slots */ - PHP_FALIAS(args, apache_request_args, NULL) - PHP_FALIAS(boundary, apache_request_boundary, NULL) - PHP_FALIAS(content_encoding, apache_request_content_encoding, NULL) - PHP_FALIAS(content_type, apache_request_content_type, NULL) - PHP_FALIAS(filename, apache_request_filename, NULL) - PHP_FALIAS(handler, apache_request_handler, NULL) - PHP_FALIAS(hostname, apache_request_hostname, NULL) - PHP_FALIAS(method, apache_request_method, NULL) - PHP_FALIAS(path_info, apache_request_path_info, NULL) - PHP_FALIAS(protocol, apache_request_protocol, NULL) - PHP_FALIAS(status_line, apache_request_status_line, NULL) - PHP_FALIAS(the_request, apache_request_the_request, NULL) - PHP_FALIAS(unparsed_uri, apache_request_unparsed_uri, NULL) - PHP_FALIAS(uri, apache_request_uri, NULL) - - /* int slots */ - PHP_FALIAS(allowed, apache_request_allowed, NULL) - PHP_FALIAS(bytes_sent, apache_request_bytes_sent, NULL) - PHP_FALIAS(chunked, apache_request_chunked, NULL) - PHP_FALIAS(content_length, apache_request_content_length, NULL) - PHP_FALIAS(header_only, apache_request_header_only, NULL) - PHP_FALIAS(method_number, apache_request_method_number, NULL) - PHP_FALIAS(mtime, apache_request_mtime, NULL) - PHP_FALIAS(no_cache, apache_request_no_cache, NULL) - PHP_FALIAS(no_local_copy, apache_request_no_local_copy, NULL) - PHP_FALIAS(proto_num, apache_request_proto_num, NULL) - PHP_FALIAS(proxyreq, apache_request_proxyreq, NULL) - PHP_FALIAS(read_body, apache_request_read_body, NULL) - PHP_FALIAS(remaining, apache_request_remaining, NULL) - PHP_FALIAS(request_time, apache_request_request_time, NULL) - PHP_FALIAS(status, apache_request_status, NULL) - - /* tables & arrays */ - PHP_FALIAS(headers_in, apache_request_headers_in, NULL) - PHP_FALIAS(headers_out, apache_request_headers_out, NULL) - PHP_FALIAS(err_headers_out, apache_request_err_headers_out, NULL) - - - /* proxy functions for the ap_* functions family */ -#undef auth_name -#undef auth_type -#undef discard_request_body -#undef is_initial_req -#undef meets_conditions -#undef satisfies -#undef set_etag -#undef set_last_modified -#undef some_auth_required -#undef update_mtime -#undef send_http_header -#undef send_header_field -#undef basic_http_header -#undef send_http_trace -#undef send_http_options -#undef send_error_response -#undef set_content_length -#undef set_keepalive -#undef rputs -#undef log_error -#undef lookup_uri -#undef lookup_file -#undef method_uri -#undef run -#undef internal_redirect - PHP_FALIAS(auth_name, apache_request_auth_name, NULL) - PHP_FALIAS(auth_type, apache_request_auth_type, NULL) - PHP_FALIAS(basic_auth_pw, apache_request_basic_auth_pw, NULL) - PHP_FALIAS(discard_request_body, apache_request_discard_request_body, NULL) - PHP_FALIAS(is_initial_req, apache_request_is_initial_req, NULL) - PHP_FALIAS(meets_conditions, apache_request_meets_conditions, NULL) - PHP_FALIAS(remote_host, apache_request_remote_host, NULL) - PHP_FALIAS(satisfies, apache_request_satisfies, NULL) - PHP_FALIAS(server_port, apache_request_server_port, NULL) - PHP_FALIAS(set_etag, apache_request_set_etag, NULL) - PHP_FALIAS(set_last_modified, apache_request_set_last_modified, NULL) - PHP_FALIAS(some_auth_required, apache_request_some_auth_required, NULL) - PHP_FALIAS(update_mtime, apache_request_update_mtime, NULL) - PHP_FALIAS(send_http_header, apache_request_send_http_header, NULL) - PHP_FALIAS(basic_http_header, apache_request_basic_http_header, NULL) - PHP_FALIAS(send_header_field, apache_request_send_header_field, NULL) - PHP_FALIAS(send_http_trace, apache_request_send_http_trace, NULL) - PHP_FALIAS(send_http_options, apache_request_send_http_trace, NULL) - PHP_FALIAS(send_error_response, apache_request_send_error_response, NULL) - PHP_FALIAS(set_content_length, apache_request_set_content_length, NULL) - PHP_FALIAS(set_keepalive, apache_request_set_keepalive, NULL) - PHP_FALIAS(rputs, apache_request_rputs, NULL) - PHP_FALIAS(log_error, apache_request_log_error, NULL) - PHP_FALIAS(lookup_uri, apache_request_sub_req_lookup_uri, NULL) - PHP_FALIAS(lookup_file, apache_request_sub_req_lookup_file, NULL) - PHP_FALIAS(method_uri, apache_request_sub_req_method_uri, NULL) - PHP_FALIAS(run, apache_request_run, NULL) - PHP_FALIAS(internal_redirect, apache_request_internal_redirect, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - - -static PHP_MINIT_FUNCTION(apache) -{ - zend_class_entry ce; - -#ifdef ZTS - ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); -#else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); -#endif - REGISTER_INI_ENTRIES(); - - - le_apachereq = zend_register_list_destructors_ex(php_apache_request_free, NULL, "ApacheRequest", module_number); - INIT_OVERLOADED_CLASS_ENTRY(ce, "ApacheRequest", php_apache_request_class_functions, NULL, NULL, NULL); - apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - REGISTER_LONG_CONSTANT("OK", OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DECLINED", DECLINED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FORBIDDEN", FORBIDDEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("AUTH_REQUIRED", AUTH_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DONE", DONE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SERVER_ERROR", SERVER_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REDIRECT", REDIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("BAD_REQUEST", BAD_REQUEST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("NOT_FOUND", NOT_FOUND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CONTINUE", HTTP_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SWITCHING_PROTOCOLS", HTTP_SWITCHING_PROTOCOLS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PROCESSING", HTTP_PROCESSING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_OK", HTTP_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CREATED", HTTP_CREATED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_ACCEPTED", HTTP_ACCEPTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NON_AUTHORITATIVE", HTTP_NON_AUTHORITATIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NO_CONTENT", HTTP_NO_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_RESET_CONTENT", HTTP_RESET_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PARTIAL_CONTENT", HTTP_PARTIAL_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MULTI_STATUS", HTTP_MULTI_STATUS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MULTIPLE_CHOICES", HTTP_MULTIPLE_CHOICES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MOVED_PERMANENTLY", HTTP_MOVED_PERMANENTLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MOVED_TEMPORARILY", HTTP_MOVED_TEMPORARILY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SEE_OTHER", HTTP_SEE_OTHER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_MODIFIED", HTTP_NOT_MODIFIED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_USE_PROXY", HTTP_USE_PROXY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_TEMPORARY_REDIRECT", HTTP_TEMPORARY_REDIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_BAD_REQUEST", HTTP_BAD_REQUEST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNAUTHORIZED", HTTP_UNAUTHORIZED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PAYMENT_REQUIRED", HTTP_PAYMENT_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_FORBIDDEN", HTTP_FORBIDDEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_FOUND", HTTP_NOT_FOUND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_METHOD_NOT_ALLOWED", HTTP_METHOD_NOT_ALLOWED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_ACCEPTABLE", HTTP_NOT_ACCEPTABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PROXY_AUTHENTICATION_REQUIRED", HTTP_PROXY_AUTHENTICATION_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_TIME_OUT", HTTP_REQUEST_TIME_OUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CONFLICT", HTTP_CONFLICT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_GONE", HTTP_GONE, CONST_CS | CONST_PERSISTENT);REGISTER_LONG_CONSTANT("HTTP_LENGTH_REQUIRED", HTTP_LENGTH_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PRECONDITION_FAILED", HTTP_PRECONDITION_FAILED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_ENTITY_TOO_LARGE", HTTP_REQUEST_ENTITY_TOO_LARGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_URI_TOO_LARGE", HTTP_REQUEST_URI_TOO_LARGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNSUPPORTED_MEDIA_TYPE", HTTP_UNSUPPORTED_MEDIA_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_RANGE_NOT_SATISFIABLE", HTTP_RANGE_NOT_SATISFIABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_EXPECTATION_FAILED", HTTP_EXPECTATION_FAILED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNPROCESSABLE_ENTITY", HTTP_UNPROCESSABLE_ENTITY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_LOCKED", HTTP_LOCKED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_FAILED_DEPENDENCY", HTTP_FAILED_DEPENDENCY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_INTERNAL_SERVER_ERROR", HTTP_INTERNAL_SERVER_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_IMPLEMENTED", HTTP_NOT_IMPLEMENTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_BAD_GATEWAY", HTTP_BAD_GATEWAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SERVICE_UNAVAILABLE", HTTP_SERVICE_UNAVAILABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_GATEWAY_TIME_OUT", HTTP_GATEWAY_TIME_OUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_VERSION_NOT_SUPPORTED", HTTP_VERSION_NOT_SUPPORTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_VARIANT_ALSO_VARIES", HTTP_VARIANT_ALSO_VARIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_INSUFFICIENT_STORAGE", HTTP_INSUFFICIENT_STORAGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_EXTENDED", HTTP_NOT_EXTENDED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_EMERG", APLOG_EMERG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_ALERT", APLOG_ALERT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_CRIT", APLOG_CRIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_ERR", APLOG_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_WARNING", APLOG_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_NOTICE", APLOG_NOTICE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_INFO", APLOG_INFO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_DEBUG", APLOG_DEBUG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_GET", M_GET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PUT", M_PUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_POST", M_POST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_DELETE", M_DELETE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_CONNECT", M_CONNECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_OPTIONS", M_OPTIONS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_TRACE", M_TRACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PATCH", M_PATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PROPFIND", M_PROPFIND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PROPPATCH", M_PROPPATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_MKCOL", M_MKCOL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_COPY", M_COPY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_MOVE", M_MOVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_LOCK", M_LOCK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_UNLOCK", M_UNLOCK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_INVALID", M_INVALID, CONST_CS | CONST_PERSISTENT); - - /* Possible values for request_rec.read_body (set by handling module): - * REQUEST_NO_BODY Send 413 error if message has any body - * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length - * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me. - * REQUEST_CHUNKED_PASS Pass the chunks to me without removal. - */ - REGISTER_LONG_CONSTANT("REQUEST_NO_BODY", REQUEST_NO_BODY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_ERROR", REQUEST_CHUNKED_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_DECHUNK", REQUEST_CHUNKED_DECHUNK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_PASS", REQUEST_CHUNKED_PASS, CONST_CS | CONST_PERSISTENT); - - /* resolve types for remote_host() */ - REGISTER_LONG_CONSTANT("REMOTE_HOST", REMOTE_HOST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_NAME", REMOTE_NAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_NOLOOKUP", REMOTE_NOLOOKUP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_DOUBLE_REV", REMOTE_DOUBLE_REV, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry apache_module_entry = { - STANDARD_MODULE_HEADER, - "apache", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* {{{ proto bool apache_child_terminate(void) - Terminate apache process after this request */ -PHP_FUNCTION(apache_child_terminate) -{ -#ifndef MULTITHREAD - if (AP(terminate_child)) { - ap_child_terminate( ((request_rec *)SG(server_context)) ); - RETURN_TRUE; - } else { /* tell them to get lost! */ - php_error(E_WARNING, "apache.child_terminate is disabled"); - RETURN_FALSE; - } -#else - php_error(E_WARNING, "apache_child_terminate() is not supported in this build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - zval **arg_name, **arg_val; - char *note_val; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg_name); - note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val); - - if (arg_count == 2) { - convert_to_string_ex(arg_val); - table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val); - } - - if (note_val) { - RETURN_STRING(note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(apache) -{ - module *modp = NULL; - char output_buf[128]; -#if !defined(WIN32) && !defined(WINNT) - char name[64]; - char modulenames[1024]; - char *p; -#endif - server_rec *serv; - extern char server_root[MAX_STRING_LEN]; - extern uid_t user_id; - extern char *user_name; - extern gid_t group_id; - extern int max_requests_per_child; - - serv = ((request_rec *) SG(server_context))->server; - - - php_info_print_table_start(); - -#ifdef PHP_WIN32 - php_info_print_table_row(1, "Apache for Windows 95/NT"); - php_info_print_table_end(); - php_info_print_table_start(); -#elif defined(NETWARE) - php_info_print_table_row(1, "Apache for NetWare"); - php_info_print_table_end(); - php_info_print_table_start(); -#else - php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE); - php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET); -#endif - - php_info_print_table_row(2, "Apache Version", SERVER_VERSION); - -#ifdef APACHE_RELEASE - sprintf(output_buf, "%d", APACHE_RELEASE); - php_info_print_table_row(2, "Apache Release", output_buf); -#endif - sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", output_buf); - sprintf(output_buf, "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", output_buf); -#if !defined(WIN32) && !defined(WINNT) - sprintf(output_buf, "%s(%d)/%d", user_name, (int)user_id, (int)group_id); - php_info_print_table_row(2, "User/Group", output_buf); - sprintf(output_buf, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", output_buf); -#endif - sprintf(output_buf, "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout); - php_info_print_table_row(2, "Timeouts", output_buf); -#if !defined(WIN32) && !defined(WINNT) -/* - This block seems to be working on NetWare; But it seems to be showing - all modules instead of just the loaded ones -*/ - php_info_print_table_row(2, "Server Root", server_root); - - strcpy(modulenames, ""); - for(modp = top_module; modp; modp = modp->next) { - strlcpy(name, modp->name, sizeof(name)); - if ((p = strrchr(name, '.'))) { - *p='\0'; /* Cut off ugly .c extensions on module names */ - } - strcat(modulenames, name); - if (modp->next) { - strcat(modulenames, ", "); - } - } - php_info_print_table_row(2, "Loaded Modules", modulenames); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - register int i; - array_header *arr; - table_entry *elts; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - arr = table_elts(r->subprocess_env); - elts = (table_entry *)arr->elts; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - for (i=0; i < arr->nelts; i++) { - php_info_print_table_row(2, elts[i].key, elts[i].val); - } - php_info_print_table_end(); - } - - { - array_header *env_arr; - table_entry *env; - int i; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", r->the_request); - env_arr = table_elts(r->headers_in); - env = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - env_arr = table_elts(r->headers_out); - env = (table_entry *)env_arr->elts; - for(i = 0; i < env_arr->nelts; ++i) { - if (env[i].key) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_end(); - } -} -/* }}} */ - -/* {{{ proto bool virtual(string filename) - Perform an Apache sub-request */ -/* This function is equivalent to - * in mod_include. It does an Apache sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through Apache (for .phtml files, you'd probably - * want to use . This only works when PHP is compiled - * as an Apache module, since it uses the Apache API for doing - * sub requests. - */ -PHP_FUNCTION(virtual) -{ - pval **filename; - request_rec *rr = NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - if (rr->status != 200) { - php_error(E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - if (run_sub_req(rr)) { - php_error(E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } else { - if (rr) destroy_sub_req (rr); - RETURN_TRUE; - } -} -/* }}} */ - - -/* {{{ apache_table_to_zval(table *, int safe_mode, zval *return_value) - Fetch all HTTP request headers */ -static void apache_table_to_zval(table *t, int safe_mode, zval *return_value) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(t); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key || - (safe_mode && !strncasecmp(tenv[i].key, "authorization", 13))) { - continue; - } - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } - -} -/* }}} */ - - -/* {{{ proto array getallheaders(void) -*/ -/* Alias for apache_request_headers() */ -/* }}} */ - -/* {{{ proto array apache_request_headers(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, PG(safe_mode), return_value); -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - apache_table_to_zval(((request_rec *) SG(server_context))->headers_out, 0, return_value); -} -/* }}} */ - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - int var_len, val_len, top=0; - char *var = NULL, *val = NULL; - request_rec *r = (request_rec *) SG(server_context); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { - RETURN_FALSE; - } - - while(top) { - if(r->prev) r = r->prev; - else break; - } - - ap_table_setn(r->subprocess_env, ap_pstrndup(r->pool, var, var_len), ap_pstrndup(r->pool, val, val_len)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object apache_lookup_uri(string URI) - Perform a partial request of the given URI to obtain information about it */ -PHP_FUNCTION(apache_lookup_uri) -{ - pval **filename; - request_rec *rr=NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - object_init(return_value); - add_property_long(return_value,"status", rr->status); - if (rr->the_request) { - add_property_string(return_value,"the_request", rr->the_request, 1); - } - if (rr->status_line) { - add_property_string(return_value,"status_line", (char *)rr->status_line, 1); - } - if (rr->method) { - add_property_string(return_value,"method", (char *)rr->method, 1); - } - if (rr->content_type) { - add_property_string(return_value,"content_type", (char *)rr->content_type, 1); - } - if (rr->handler) { - add_property_string(return_value,"handler", (char *)rr->handler, 1); - } - if (rr->uri) { - add_property_string(return_value,"uri", rr->uri, 1); - } - if (rr->filename) { - add_property_string(return_value,"filename", rr->filename, 1); - } - if (rr->path_info) { - add_property_string(return_value,"path_info", rr->path_info, 1); - } - if (rr->args) { - add_property_string(return_value,"args", rr->args, 1); - } - if (rr->boundary) { - add_property_string(return_value,"boundary", rr->boundary, 1); - } - add_property_long(return_value,"no_cache", rr->no_cache); - add_property_long(return_value,"no_local_copy", rr->no_local_copy); - add_property_long(return_value,"allowed", rr->allowed); - add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); - add_property_long(return_value,"bytes_sent", rr->bytes_sent); - add_property_long(return_value,"byterange", rr->byterange); - add_property_long(return_value,"clength", rr->clength); - -#if MODULE_MAGIC_NUMBER >= 19980324 - if (rr->unparsed_uri) { - add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); - } - if(rr->mtime) { - add_property_long(return_value,"mtime", rr->mtime); - } -#endif - if(rr->request_time) { - add_property_long(return_value,"request_time", rr->request_time); - } - - destroy_sub_req(rr); -} -/* }}} */ - - -#if 0 -This function is most likely a bad idea. Just playing with it for now. - -PHP_FUNCTION(apache_exec_uri) -{ - pval **filename; - request_rec *rr=NULL; - TSRMLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - RETVAL_LONG(ap_run_sub_req(rr)); - ap_destroy_sub_req(rr); -} -#endif - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = (char *) ap_get_server_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h deleted file mode 100644 index 2a030482f67ba..0000000000000 --- a/sapi/apache_hooks/php_apache_http.h +++ /dev/null @@ -1,44 +0,0 @@ -#define NO_REGEX_EXTRA_H - -#ifdef WIN32 -#include -#include -#endif - -#ifdef NETWARE -#include -#endif - -#include "zend.h" -#include "zend_stack.h" -#include "php_regex.h" - -#include "httpd.h" -#include "http_config.h" - -#if MODULE_MAGIC_NUMBER > 19980712 -# include "ap_compat.h" -#else -# if MODULE_MAGIC_NUMBER > 19980324 -# include "compat.h" -# endif -#endif - -#include "http_core.h" -#include "http_main.h" -#include "http_protocol.h" -#include "http_request.h" -#include "http_log.h" -#include "util_script.h" - -#include "php_variables.h" -#include "php_main.h" -#include "php_ini.h" -#include "ext/standard/php_standard.h" - -#include "mod_php5.h" - - -zval *php_apache_request_new(request_rec *r); - -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC); diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c deleted file mode 100644 index ad2f3b697bf1c..0000000000000 --- a/sapi/apache_hooks/sapi_apache.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by: | - | Zeev Suraski | - | Stig Bakken | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -/* {{{ apache_php_module_main - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - /* sending a file handle to another dll is not working - so let zend open it. */ - - if (display_source_mode) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){ - return OK; - } else { - return NOT_FOUND; - } - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.handle.fd = 0; - file_handle.filename = SG(request_info).path_translated; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - (void) php_execute_script(&file_handle TSRMLS_CC); - } - AP(in_request) = 0; - - return (OK); -} -/* }}} */ - -/* {{{ apache_php_module_hook - */ -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC) -{ - zend_file_handle file_handle; - zval *req; - char *tmp; - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - if(AP(current_hook) == AP_RESPONSE) { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) - return FAILURE; - } - else { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) - return FAILURE; - } - - req = php_apache_request_new(r); - if(PG(register_globals)) { - php_register_variable_ex("request", req, NULL TSRMLS_CC); - } - else { - php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); - } - switch(handler->type) { - case AP_HANDLER_TYPE_FILE: - php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); - memset(&file_handle, 0, sizeof(file_handle)); - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = handler->name; - (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC); - break; - case AP_HANDLER_TYPE_METHOD: - if( (tmp = strstr(handler->name, "::")) != NULL && *(tmp+2) != '\0' ) { - zval *class; - zval *method; - *tmp = '\0'; - ALLOC_ZVAL(class); - ZVAL_STRING(class, handler->name, 1); - ALLOC_ZVAL(method); - ZVAL_STRING(method, tmp +2, 1); - *tmp = ':'; - call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL TSRMLS_CC); - zval_dtor(class); - zval_dtor(method); - } - else { - php_error(E_ERROR, "Unable to call %s - not a Class::Method\n", handler->name); - /* not a class::method */ - } - break; - default: - /* not a valid type */ - assert(0); - break; - } - zval_dtor(req); - AP(in_request) = 0; - - return OK; -} - -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/caudium/CREDITS b/sapi/caudium/CREDITS deleted file mode 100644 index 45789dbdfed33..0000000000000 --- a/sapi/caudium/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Caudium / Roxen -David Hedbor diff --git a/sapi/caudium/README b/sapi/caudium/README deleted file mode 100644 index 86ef65655d42e..0000000000000 --- a/sapi/caudium/README +++ /dev/null @@ -1,16 +0,0 @@ -Embedded Caudium PHP support. It seems to work but isn't tested -much. Due to a design choice it requires _Pike_ threads and a -thread-safe PHP. It doesn't however require _Caudium_ to run in -threaded mode. Due to the design, utilization of multiple processors -should be pretty good. - -It requires a new Pike 7.0 and Caudium. It will not work with -Roxen. Also, with the help of the VIRTUAL_DIR code in PHP, PHP -execution should be very similar to that of mod_php or the cgi -script. - -If you have any questions, please contact me, David Hedbor -(neotron@php.net or neotron@caudium.net). For more information on -Caudium, see http://caudium.net/ and http://caudium.org/. - - diff --git a/sapi/caudium/TODO b/sapi/caudium/TODO deleted file mode 100644 index b8217c5934927..0000000000000 --- a/sapi/caudium/TODO +++ /dev/null @@ -1,30 +0,0 @@ -TODO: - -- per-virtual-server configuration -- configurable limit of number of concurrent PHP executions -- fix setting of auth info. - -FIXED: -+ => fixed -- => not fixed and no fix planned -? => Maybe fixed, maybe not. - -+ Allow multiple headers - This is now fixed. -+ fix backtraces - Uses th_farm, thus problem is fixed -+ exit in PHP exits Caudium - Name conflict with do_exit in Pike and PHP. Reported to both teams. -+ POST newline added? - Was a Caudium bug. -+ use th_farm - Yeppers. Works great. -- change cwd in single threaded mode - There will be no single threaded mode support. The Caudium module - will requite PHP ZTS and Pike threads to run. Single threaded PHP - is rather uninteresting anyway. -? Recursive mutex lock problem: - Dunno if this is fixed. Major rewrite so it would have to be - retested. - - diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c deleted file mode 100644 index b341cde46e069..0000000000000 --- a/sapi/caudium/caudium.c +++ /dev/null @@ -1,792 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: David Hedbor | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#ifdef HAVE_CAUDIUM - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "ext/standard/info.h" - -#include "php_version.h" - -/* Pike Include Files - * - * conflicts with pike avoided by only using long names. Requires a new - * Pike 0.7 since it was implemented for this interface only. - * - */ -#define NO_PIKE_SHORTHAND - -/* Ok, we are now using Pike level threads to handle PHP5 since - * the nice th_farm threads aren't working on Linux with glibc 2.2 - * (why this is I don't know). - */ -#define USE_PIKE_LEVEL_THREADS - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION == 1 && PIKE_BUILD_VERSION >= 12) || PIKE_MAJOR_VERSION > 7 || (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION > 1) -# include "pike_error.h" -#else -# include "error.h" -# ifndef Pike_error -# define Pike_error error -# endif -#endif - -/* Pike 7.x and newer */ -#define MY_MAPPING_LOOP(md, COUNT, KEY) \ - for(COUNT=0;COUNT < md->data->hashsize; COUNT++ ) \ - for(KEY=md->data->hash[COUNT];KEY;KEY=KEY->next) - -#ifndef ZTS -/* Need thread safety */ -#error You need to compile PHP with threads. -#endif - -#ifndef PIKE_THREADS -#error The PHP5 module requires that your Pike has thread support. -#endif - -#undef HIDE_GLOBAL_VARIABLES -#undef REVEAL_GLOBAL_VARIABLES -#define HIDE_GLOBAL_VARIABLES() -#define REVEAL_GLOBAL_VARIABLES() - -/* php_caudium_request is per-request object storage */ - -typedef struct -{ - struct mapping *request_data; - struct object *my_fd_obj; - struct svalue done_cb; - struct pike_string *filename; - int my_fd; - int written; - TSRMLS_D; -} php_caudium_request; - - -void pike_module_init(void); -void pike_module_exit(void); -static void free_struct(TSRMLS_D); -void f_php_caudium_request_handler(INT32 args); - -/* Defines to get to the data supplied when the script is started. */ - -/* Per thread storage area id... */ -static int caudium_globals_id; - -#define GET_THIS() php_caudium_request *_request = ts_resource(caudium_globals_id) -#define THIS _request -#define PTHIS ((php_caudium_request *)(Pike_fp->current_storage)) -/* File descriptor integer. Used to write directly to the FD without - * passing Pike - */ -#define MY_FD (THIS->my_fd) - -/* FD object. Really a PHPScript object from Pike which implements a couple - * of functions to handle headers, writing and buffering. - */ -#define MY_FD_OBJ ((struct object *)(THIS->my_fd_obj)) - -/* Mapping with data supplied from the calling Caudium module. Contains - * a mapping with headers, an FD object etc. - */ -#define REQUEST_DATA ((struct mapping *)(THIS->request_data)) - -extern int fd_from_object(struct object *o); -static unsigned char caudium_php_initialized; - -#ifndef mt_lock_interpreter -#define mt_lock_interpreter() mt_lock(&interpreter_lock); -#define mt_unlock_interpreter() mt_unlock(&interpreter_lock); -#endif - - -/* This allows calling of pike functions from the PHP callbacks, - * which requires the Pike interpreter to be locked. - */ -#define THREAD_SAFE_RUN(COMMAND, what) do {\ - struct thread_state *state;\ - if((state = thread_state_for_id(th_self()))!=NULL) {\ - if(!state->swapped) {\ - COMMAND;\ - } else {\ - mt_lock_interpreter();\ - SWAP_IN_THREAD(state);\ - COMMAND;\ - SWAP_OUT_THREAD(state);\ - mt_unlock_interpreter();\ - }\ - }\ -} while(0) - - - -/* Low level header lookup. Basically looks for the named header in the mapping - * headers in the supplied options mapping. - */ - -INLINE static struct svalue *lookup_header(char *headername) -{ - struct svalue *headers, *value; - struct pike_string *sind; - GET_THIS(); - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(!headers || headers->type != PIKE_T_MAPPING) return NULL; - sind = make_shared_string(headername); - value = low_mapping_string_lookup(headers->u.mapping, sind); - free_string(sind); - if(!value) return NULL; - return value; -} - -/* Lookup a header in the mapping and return the value as a string, or - * return the default if it's missing - */ -INLINE static char *lookup_string_header(char *headername, char *default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_STRING) - return default_value; - return head->u.string->str; -} - -/* Lookup a header in the mapping and return the value as if it's an integer - * and otherwise return the default. - */ -INLINE static int lookup_integer_header(char *headername, int default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_INT) - return default_value; - return head->u.integer; -} - -/* - * php_caudium_low_ub_write() writes data to the client connection. Might be - * rewritten to do more direct IO to save CPU and the need to lock the - * interpreter for better threading. - */ - -INLINE static int -php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { - int sent_bytes = 0; - struct pike_string *to_write = NULL; - GET_THIS(); - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - to_write = make_shared_binary_string(str, str_length); - push_string(to_write); - safe_apply(MY_FD_OBJ, "write", 1); - if(Pike_sp[-1].type == PIKE_T_INT) - sent_bytes = Pike_sp[-1].u.integer; - pop_stack(); - if(sent_bytes != str_length) { - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - } - return sent_bytes; -} - -/* - * php_caudium_sapi_ub_write() calls php_caudium_low_ub_write in a Pike thread - * safe manner or writes directly to the output FD if RXML post-parsing is - * disabled. - */ - -static int -php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - GET_THIS(); - int sent_bytes = 0, fd = MY_FD; - if(fd) - { - for(sent_bytes=0;sent_bytes < str_length;) - { - int written; - written = fd_write(fd, str + sent_bytes, str_length - sent_bytes); - if(written < 0) - { - switch(errno) - { - default: - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - THIS->written += sent_bytes; - return sent_bytes; - case EINTR: - case EWOULDBLOCK: - continue; - } - } else { - sent_bytes += written; - } - } - THIS->written += sent_bytes; - } else { - THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC), - "write"); - } - return sent_bytes; -} - -/* php_caudium_set_header() sets a header in the header mapping. Called in a - * thread safe manner from php_caudium_sapi_header_handler. - */ -INLINE static void -php_caudium_set_header(char *header_name, char *value, char *p) -{ - struct svalue hsval; - struct pike_string *hval, *ind, *hind; - struct mapping *headermap; - struct svalue *s_headermap, *soldval; - int vallen; - GET_THIS(); - /* hval = make_shared_string(value); */ - ind = make_shared_string(" _headers"); - hind = make_shared_binary_string(header_name, - (int)(p - header_name)); - - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - if(!s_headermap || s_headermap->type != PIKE_T_MAPPING) - { - struct svalue mappie; - mappie.type = PIKE_T_MAPPING; - headermap = allocate_mapping(1); - mappie.u.mapping = headermap; - mapping_string_insert(REQUEST_DATA, ind, &mappie); - free_mapping(headermap); - hval = make_shared_string(value); - } else { - headermap = s_headermap->u.mapping; - soldval = low_mapping_string_lookup(headermap, hind); - vallen = strlen(value); - if(soldval != NULL && - soldval->type == PIKE_T_STRING && - soldval->u.string->size_shift == 0) { - /* Existing, valid header. Prepend.*/ - hval = begin_shared_string(soldval->u.string->len + 1 + vallen); - MEMCPY(hval->str, soldval->u.string->str, soldval->u.string->len); - STR0(hval)[soldval->u.string->len] = '\0'; - MEMCPY(hval->str+soldval->u.string->len+1, value, vallen); - hval = end_shared_string(hval); - } else { - hval = make_shared_string(value); - } - } - hsval.type = PIKE_T_STRING; - hsval.u.string = hval; - - mapping_string_insert(headermap, hind, &hsval); - - free_string(hval); - free_string(ind); - free_string(hind); -} - -/* - * php_caudium_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ -static int -php_caudium_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if(p) { - do { - header_content++; - } while(*header_content == ' '); - THREAD_SAFE_RUN(php_caudium_set_header(header_name, header_content, p), "header handler"); - } - sapi_free_header(sapi_header); - return 0; -} - -/* - * php_caudium_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -INLINE static int -php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - struct pike_string *ind; - struct svalue *s_headermap; - GET_THIS(); - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return SAPI_HEADER_SEND_FAILED; - } - ind = make_shared_string(" _headers"); - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - free_string(ind); - - push_int(SG(sapi_headers).http_response_code); - if(s_headermap && s_headermap->type == PIKE_T_MAPPING) - ref_push_mapping(s_headermap->u.mapping); - else - push_int(0); - safe_apply(MY_FD_OBJ, "send_headers", 2); - pop_stack(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int res = 0; - THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); - return res; -} - -/* - * php_caudium_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes) -{ - uint total_read = 0; - GET_THIS(); - TSRMLS_FETCH(); - - if(!MY_FD_OBJ->prog) - { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - push_int(count_bytes); - safe_apply(MY_FD_OBJ, "read_post", 1); - if(Pike_sp[-1].type == PIKE_T_STRING) { - MEMCPY(buf, Pike_sp[-1].u.string->str, - (total_read = Pike_sp[-1].u.string->len)); - buf[total_read] = '\0'; - } else - total_read = 0; - pop_stack(); - return total_read; -} - -static int -php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post"); - return total_read; -} - -/* - * php_caudium_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char * -php_caudium_sapi_read_cookies(TSRMLS_D) -{ - char *cookies; - cookies = lookup_string_header("HTTP_COOKIE", NULL); - return cookies; -} - -static void php_info_caudium(ZEND_MODULE_INFO_FUNC_ARGS) -{ - /* char buf[512]; */ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - */ - php_info_print_table_end(); -} - -static zend_module_entry php_caudium_module = { - STANDARD_MODULE_HEADER, - "Caudium", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_caudium, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) -{ - int i; - struct keypair *k; - struct svalue *headers; - struct pike_string *sind; - struct svalue *ind; - struct svalue *val; - GET_THIS(); - php_register_variable("PHP_SELF", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", - track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", - (char *) SG(request_info).request_method, - track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, - track_vars_array TSRMLS_CC); - - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(headers && headers->type == PIKE_T_MAPPING) { - MY_MAPPING_LOOP(headers->u.mapping, i, k) { - ind = &k->ind; - val = &k->val; - if(ind && ind->type == PIKE_T_STRING && - val && val->type == PIKE_T_STRING) { - php_register_variable(ind->u.string->str, val->u.string->str, - track_vars_array TSRMLS_CC ); - } - } - } -} - -static void sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) -{ - THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array TSRMLS_CC), "register_variables"); -} - - -static int php_caudium_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_caudium_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -/* this structure is static (as in "it does not change") */ -static sapi_module_struct caudium_sapi_module = { - "caudium", - "Caudium", - php_caudium_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - php_caudium_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - php_caudium_sapi_header_handler, /* header handler */ - php_caudium_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - php_caudium_sapi_read_post, /* read POST data */ - php_caudium_sapi_read_cookies, /* read cookies */ - sapi_caudium_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_caudium_module_main() is called by the per-request handler and - * "executes" the script - */ - -static void php_caudium_module_main(php_caudium_request *ureq) -{ - int res; - zend_file_handle file_handle; -#ifndef USE_PIKE_LEVEL_THREADS - struct thread_state *state; - extern struct program *thread_id_prog; -#endif - TSRMLS_FETCH(); - GET_THIS(); - THIS->filename = ureq->filename; - THIS->done_cb = ureq->done_cb; - THIS->my_fd_obj = ureq->my_fd_obj; - THIS->my_fd = ureq->my_fd; - THIS->request_data = ureq->request_data; - free(ureq); - -#ifndef USE_PIKE_LEVEL_THREADS - mt_lock_interpreter(); - init_interpreter(); -#if PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION < 1 - thread_id = low_clone(thread_id_prog); - state = OBJ2THREAD(thread_id); - Pike_stack_top=((char *)&state)+ (thread_stack_size-16384) * STACK_DIRECTION; - recoveries = NULL; - call_c_initializers(thread_id); - OBJ2THREAD(thread_id)->id=th_self(); - num_threads++; - thread_table_insert(thread_id); - state->status=THREAD_RUNNING; -#else - Pike_interpreter.thread_id = low_clone(thread_id_prog); - state = OBJ2THREAD(Pike_interpreter.thread_id); - Pike_interpreter.stack_top=((char *)&state)+ (thread_stack_size-16384) * STACK_DIRECTION; - Pike_interpreter.recoveries = NULL; - call_c_initializers(Pike_interpreter.thread_id); - state->id=th_self(); - /* SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id)); */ - num_threads++; - thread_table_insert(Pike_interpreter.thread_id); - state->status=THREAD_RUNNING; -#endif - state->swapped = 0; -#endif - SG(request_info).query_string = lookup_string_header("QUERY_STRING", 0); - SG(server_context) = (void *)1; /* avoid server_context == NULL */ - - /* path_translated is apparently the absolute path to the file, not - the translated PATH_INFO - */ - SG(request_info).path_translated = - lookup_string_header("SCRIPT_FILENAME", NULL); - SG(request_info).request_uri = lookup_string_header("DOCUMENT_URI", NULL); - if(!SG(request_info).request_uri) - SG(request_info).request_uri = lookup_string_header("SCRIPT_NAME", NULL); - SG(request_info).request_method = lookup_string_header("REQUEST_METHOD", "GET"); - SG(request_info).content_length = lookup_integer_header("HTTP_CONTENT_LENGTH", 0); - SG(request_info).content_type = lookup_string_header("HTTP_CONTENT_TYPE", NULL); - SG(sapi_headers).http_response_code = 200; - if (!strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - - /* Let PHP5 handle the deconding of the AUTH */ - php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), TSRMLS_C); - /* Swap out this thread and release the interpreter lock to allow - * Pike threads to run. We wait since the above would otherwise require - * a lot of unlock/lock. - */ -#ifndef USE_PIKE_LEVEL_THREADS - SWAP_OUT_THREAD(state); - mt_unlock_interpreter(); -#else - THREADS_ALLOW(); -#endif - -#ifdef VIRTUAL_DIR - /* Change virtual directory, if the feature is enabled, which is - * (almost) a requirement for PHP in Caudium. Might want to fail if it - * isn't. Not a problem though, since it's on by default when using ZTS - * which we require. - */ - VCWD_CHDIR_FILE(THIS->filename->str); -#endif - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = THIS->filename->str; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - THIS->written = 0; - res = php_request_startup(TSRMLS_C); - - if(res == FAILURE) { - THREAD_SAFE_RUN({ - apply_svalue(&THIS->done_cb, 0); - pop_stack(); - free_struct(TSRMLS_C); - }, "Negative run response"); - } else { - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - THREAD_SAFE_RUN({ - push_int(THIS->written); - apply_svalue(&THIS->done_cb, 1); - pop_stack(); - free_struct(TSRMLS_C); - }, "positive run response"); - } - -#ifndef USE_PIKE_LEVEL_THREADS - mt_lock_interpreter(); - SWAP_IN_THREAD(state); -#if PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION < 1 - state->status=THREAD_EXITED; - co_signal(& state->status_change); - thread_table_delete(thread_id); - free_object(thread_id); - thread_id=NULL; -#else - state->status=THREAD_EXITED; - co_signal(& state->status_change); - thread_table_delete(Pike_interpreter.thread_id); - free_object(Pike_interpreter.thread_id); - Pike_interpreter.thread_id=NULL; -#endif - cleanup_interpret(); - num_threads--; - mt_unlock_interpreter(); -#else - THREADS_DISALLOW(); -#endif -} - -/* - * The php_caudium_request_handler() is called per request and handles - * everything for one request. - */ - -void f_php_caudium_request_handler(INT32 args) -{ - struct object *my_fd_obj; - struct mapping *request_data; - struct svalue *done_callback; - struct pike_string *script; - struct svalue *raw_fd; - struct pike_string *ind; - php_caudium_request *_request; - THIS = malloc(sizeof(php_caudium_request)); - if(THIS == NULL) - Pike_error("Out of memory."); - - get_all_args("PHP5.Interpreter->run", args, "%S%m%O%*", &script, - &request_data, &my_fd_obj, &done_callback); - if(done_callback->type != PIKE_T_FUNCTION) - Pike_error("PHP5.Interpreter->run: Bad argument 4, expected function.\n"); - add_ref(request_data); - add_ref(my_fd_obj); - add_ref(script); - - THIS->request_data = request_data; - THIS->my_fd_obj = my_fd_obj; - THIS->filename = script; - assign_svalue_no_free(&THIS->done_cb, done_callback); - - ind = make_shared_binary_string("my_fd", 5); - raw_fd = low_mapping_string_lookup(THIS->request_data, ind); - if(raw_fd && raw_fd->type == PIKE_T_OBJECT) - { - int fd = fd_from_object(raw_fd->u.object); - if(fd == -1) - THIS->my_fd = 0; /* Don't send directly to this FD... */ - else - THIS->my_fd = fd; - } else - THIS->my_fd = 0; -#ifdef USE_PIKE_LEVEL_THREADS - php_caudium_module_main(THIS); -#else - th_farm((void (*)(void *))php_caudium_module_main, THIS); -#endif - pop_n_elems(args); -} - -static void free_struct(TSRMLS_D) -{ - GET_THIS(); - if(THIS->request_data) free_mapping(THIS->request_data); - if(THIS->my_fd_obj) free_object(THIS->my_fd_obj); - free_svalue(&THIS->done_cb); - if(THIS->filename) free_string(THIS->filename); - MEMSET(THIS, 0, sizeof(php_caudium_request)); -} - - -/* - * pike_module_init() is called by Pike once at startup - * - * This functions allocates basic structures - */ - -void pike_module_init( void ) -{ - if (!caudium_php_initialized) { - caudium_php_initialized = 1; - tsrm_startup(1, 1, 0, NULL); - ts_allocate_id(&caudium_globals_id, sizeof(php_caudium_request), NULL, NULL); - sapi_startup(&caudium_sapi_module); - sapi_module.startup(&caudium_sapi_module); - } - start_new_program(); /* Text */ - pike_add_function("run", f_php_caudium_request_handler, - "function(string, mapping, object, function:void)", 0); - end_class("Interpreter", 0); -} - -/* - * pike_module_exit() performs the last steps before the - * server exists. Shutdowns basic services and frees memory - */ - -void pike_module_exit(void) -{ - caudium_php_initialized = 0; - sapi_module.shutdown(&caudium_sapi_module); - tsrm_shutdown(); -} -#endif diff --git a/sapi/caudium/config.m4 b/sapi/caudium/config.m4 deleted file mode 100644 index 60d607cff15d0..0000000000000 --- a/sapi/caudium/config.m4 +++ /dev/null @@ -1,98 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -AC_MSG_CHECKING(for Caudium support) -AC_ARG_WITH(caudium, -[ --with-caudium[=DIR] Build PHP as a Pike module for use with Caudium. - DIR is the Caudium server dir [/usr/local/caudium/server]], -[ - if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi - if test ! -d $withval ; then - if test "$prefix" = "NONE"; then - withval=/usr/local/caudium/server/ - else - withval=$prefix/caudium/server/ - fi - fi - if test -f $withval/bin/caudium; then - PIKE=$withval/bin/caudium - elif test -f $withval/bin/pike; then - PIKE=$withval/bin/pike - else - AC_MSG_ERROR(Couldn't find a pike in $withval/bin/) - fi - if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0268) exit(1); exit(0);'; then - PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` - PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,' ` - if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then - AC_MSG_ERROR(Failed to figure out Pike module and include directories) - fi - AC_MSG_RESULT(yes) - PIKE=`echo $PIKE | pike -e 'int tries=100; - string orig,pike=Stdio.File("stdin")->read()-"\n"; - orig=pike; - if(search(orig, "/")) - orig = combine_path(getcwd(), orig); - while(!catch(pike=readlink(pike)) && tries--) - ; - write(combine_path(dirname(orig), pike)); '` - PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) - if test "$prefix" != "NONE"; then - PIKE_C_INCLUDE=$prefix/include/`basename $PIKE` - else - PIKE_C_INCLUDE=/usr/local/include/`basename $PIKE` - fi - AC_MSG_CHECKING(for C includes in $PIKE_C_INCLUDE) - if test -f $PIKE_C_INCLUDE/version.h; then - PIKE_TEST_VER=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` - ###### VERSION MATCH CHECK ####### - PMAJOR="^#define PIKE_MAJOR_VERSION" - PMINOR="^#define PIKE_MINOR_VERSION" - PBUILD="^#define PIKE_BUILD_VERSION" - - PIKE_CMAJOR_VERSION=0 - PIKE_CMINOR_VERSION=0 - PIKE_CBUILD_VERSION=0 - - PIKE_CMAJOR_VERSION=`grep "$PMAJOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - if test -z "$PIKE_CMAJOR_VERSION"; then - if test -n "`grep f_version $PIKE_C_INCLUDE/version.h`"; then - PIKE_CMAJOR_VERSION=6 - fi - else - PIKE_CMINOR_VERSION=`grep "$PMINOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - PIKE_CBUILD_VERSION=`grep "$PBUILD" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - fi - - if test "$PIKE_TEST_VER" = "${PIKE_CMAJOR_VERSION}.${PIKE_CMINOR_VERSION}.${PIKE_CBUILD_VERSION}"; then - PHP_ADD_INCLUDE($PIKE_C_INCLUDE) - PIKE_INCLUDE_DIR="$PIKE_INCLUDE_DIR, $PIKE_C_INCLUDE" - AC_MSG_RESULT(found) - else - AC_MSG_RESULT(version mismatch) - fi - else - AC_MSG_RESULT(not found) - fi - else - AC_MSG_ERROR(Caudium PHP5 requires Pike 7.0 or newer) - fi - PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` - AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support]) - PHP_SELECT_SAPI(caudium, shared, caudium.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP5.so" - RESULT=" *** Pike binary used: $PIKE - *** Pike include dir(s) used: $PIKE_INCLUDE_DIR - *** Pike version: $PIKE_VERSION" - dnl Always use threads since thread-free support really blows. - PHP_BUILD_THREAD_SAFE - -]) -AC_MSG_RESULT($RESULT) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: - diff --git a/sapi/cgi/CREDITS b/sapi/cgi/CREDITS deleted file mode 100644 index a1c6a0be59bcf..0000000000000 --- a/sapi/cgi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CGI / FastCGI -Rasmus Lerdorf, Stig Bakken, Shane Caraveo diff --git a/sapi/cgi/Makefile.frag b/sapi/cgi/Makefile.frag deleted file mode 100644 index 57a3b2937c091..0000000000000 --- a/sapi/cgi/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(BUILD_CGI) diff --git a/sapi/cgi/README.FastCGI b/sapi/cgi/README.FastCGI deleted file mode 100644 index f51ae5686ba0e..0000000000000 --- a/sapi/cgi/README.FastCGI +++ /dev/null @@ -1,146 +0,0 @@ -Credits: -Ben Mansell, Stephen Landamore, Daniel Silverstone, Shane Caraveo - -Building PHP ------------- - -You must add '--enable-fastcgi' to the configure command on Linux or -OSX based systems to get fastcgi support in the php-cgi binary. You -also must not use '--enable-discard-path'. - -Running the FastCGI PHP module ------------------------------- - -There are two ways to run the resulting 'php' binary after the fastcgi -version has been built: - -1) Configure your web server to run the PHP binary itself. - -This is the simplest method, obviously you will have to configure your -web server appropriately. Some web servers may also not support this method, -or may not be as efficient. - -2) Run PHP separately from the web server. - -In this setup, PHP is started as a separate process entirely from the web -server. It will listen on a socket for new FastCGI requests, and deliver -PHP pages as appropriate. This is the recommended way of running PHP-FastCGI. -To run this way, you must start the PHP binary running by giving it an IP -and a port number to listen to on the command line, e.g.: - - ./php -b 127.0.0.1:8002 - -The above line is the recommended way of running FastCGI. You usually -want the FastCGI server to provide services to the localhost, not -everyone on the Internet. - -If your web server sits on a remote host, you can make FastCGI listen -on all interfaces: - - ./php -b :8002 - ./php -b "*:8002" - -Note that hostnames are not supported. - -You must also configure your web server to connect to the appropriate port -in order to talk to the PHP FastCGI process. - -The advantage of running PHP in this way is that it entirely separates the -web server and PHP process, so that one cannot disrupt the other. It also -allows PHP to be on an entirely separate machine from the web server if need -be, you could even have several web servers utilising the same running PHP -process if required! - - -Using FastCGI PHP with Apache -============================= - -First of all, you may well ask 'Why?'. After all, Apache already has mod_php. -However, there are advantages to running PHP with FastCGI. Separating the -PHP code from the web server removes 'bloat' from the main server, and should -improve the performance of non-PHP requests. Secondly, having one permanent -PHP process as opposed to one per apache process means that shared resources -like persistent database connections are used more efficiently. - -First of all, make sure that the FastCGI module is enabled. You should have -a line in your config like: - - LoadModule fastcgi_module /usr/lib/apache/2.0/mod_fastcgi.so - -Don't load mod_php, by the way. Make sure it is commented out! - - #LoadModule php5_module /usr/lib/apache/2.0/libphp5.so - -Now, we'll create a fcgi-bin directory, just like you would do with normal -CGI scripts. You'll need to create a directory somewhere to store your -FastCGI binaries. We'll use /space/fcgi-bin/ for this example. Remember to -copy the FastCGI-PHP binary in there. (named 'php-cgi') This sets up -php to run under mod_fastcgi as a dynamic server. - - ScriptAlias /fcgi-bin/ /space/fcgi-bin/ - - Options ExecCGI - SetHandler fastcgi-script - - -To setup a specific static configuration for php, you have to use -the FastCgiServer configuration for mod_fastcgi. For this, do not -use the above configuration, but rather the following. -(see mod_fastcgi docs for more configuration information): - - Alias /fcgi-bin/ /space/fcgi-bin/ - FastCgiServer /path/to/php-cgi -processes 5 - -For either of the above configurations, we need to tell Apache to -use the FastCGI binary /fcgi-bin/php to deliver PHP pages. -All that is needed is: - - AddType application/x-httpd-fastphp .php - Action application/x-httpd-fastphp /fcgi-bin/php-cgi - -Now, if you restart Apache, php pages should now be delivered! - -Using FastCGI PHP with IIS or iPlanet -===================================== - -FastCGI server plugins are available at www.caraveo.com/fastcgi/ -Documentation on these are sparse. iPlanet is not very tested, -and no makefile exists yet for unix based iPlanet servers. - - -Security --------- - -Be sure to run the php binary as an appropriate userid. Also, firewall out -the port that PHP is listening on. In addition, you can set the environment -variable FCGI_WEB_SERVER_ADDRS to control who can connect to the FastCGI. -Set it to a comma separated list of IP addresses, e.g.: - -export FCGI_WEB_SERVER_ADDRS=199.170.183.28,199.170.183.71 - - -Tuning ------- - -There are a few tuning parameters that can be tweaked to control the -performance of FastCGI PHP. The following are environment variables that can -be set before running the PHP binary: - -PHP_FCGI_CHILDREN (default value: 8) - -This controls how many child processes the PHP process spawns. When the -fastcgi starts, it creates a number of child processes which handle one -page request at a time. So by default, you will be able to handle 8 -concurrent PHP page requests. Further requests will be queued. -Increasing this number will allow for better concurrency, especially if you -have pages that take a significant time to create, or supply a lot of data -(e.g. downloading huge files via PHP). On the other hand, having more -processes running will use more RAM, and letting too many PHP pages be -generated concurrently will mean that each request will be slow. - -PHP_FCGI_MAX_REQUESTS (default value: 500) - -This controls how many requests each child process will handle before -exitting. When one process exits, another will be created. This tuning is -necessary because several PHP functions are known to have memory leaks. If the -PHP processes were left around forever, they would be become very inefficient. diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c deleted file mode 100644 index 7597bff7a6d26..0000000000000 --- a/sapi/cgi/cgi_main.c +++ /dev/null @@ -1,1689 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Rasmus Lerdorf | - | Stig Bakken | - | Zeev Suraski | - | FastCGI: Ben Mansell | - | Shane Caraveo | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_modules.h" - -#include "SAPI.h" - -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_SYS_WAIT_H -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#ifdef PHP_WIN32 -#include -#include -#include "win32/php_registry.h" -#endif - -#ifdef __riscos__ -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -#include "php_getopt.h" - -#if PHP_FASTCGI -#include "fcgi_config.h" -#include "fcgiapp.h" -/* don't want to include fcgios.h, causes conflicts */ -#ifdef PHP_WIN32 -extern int OS_SetImpersonate(void); -#else -/* XXX this will need to change later when threaded fastcgi is - implemented. shane */ -struct sigaction act, old_term, old_quit, old_int; -#endif - -static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC); - -#ifndef PHP_WIN32 -/* these globals used for forking children on unix systems */ -/** - * Number of child processes that will get created to service requests - */ -static int children = 0; - -/** - * Set to non-zero if we are the parent process - */ -static int parent = 1; - -/** - * Process group - */ -static pid_t pgroup; -#endif - -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 - -static char *php_optarg = NULL; -static int php_optind = 1; - -static const opt_struct OPTIONS[] = { - {'a', 0, "interactive"}, -#ifndef PHP_WIN32 - {'b', 1, "bindpath"}, -#endif - {'C', 0, "no-chdir"}, - {'c', 1, "php-ini"}, - {'d', 1, "define"}, - {'e', 0, "profile-info"}, - {'f', 1, "file"}, - {'g', 1, "global"}, - {'h', 0, "help"}, - {'i', 0, "info"}, - {'l', 0, "syntax-check"}, - {'m', 0, "modules"}, - {'n', 0, "no-php-ini"}, - {'q', 0, "no-header"}, - {'s', 0, "syntax-highlight"}, - {'s', 0, "syntax-highlighting"}, - {'w', 0, "strip"}, - {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ - {'v', 0, "version"}, - {'z', 1, "zend-extension"}, - {'-', 0, NULL} /* end of args */ -}; - -#if ENABLE_PATHINFO_CHECK -/* true global. this is retreived once only, even for fastcgi */ -long fix_pathinfo = 1; -#endif - -#ifdef PHP_WIN32 -#define TRANSLATE_SLASHES(path) \ - { \ - char *tmp = path; \ - while (*tmp) { \ - if (*tmp == '\\') *tmp = '/'; \ - tmp++; \ - } \ - } -#else -#define TRANSLATE_SLASHES(path) -#endif - -static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) -{ - php_printf("%s\n", module->name); - return 0; -} - -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f = *((Bucket **) a); - Bucket *s = *((Bucket **) b); - - return strcasecmp(((zend_module_entry *)f->pData)->name, - ((zend_module_entry *)s->pData)->name); -} - -static void print_modules(TSRMLS_D) -{ - HashTable sorted_registry; - zend_module_entry tmp; - - zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); - zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); - zend_hash_destroy(&sorted_registry); -} - -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) -{ - php_printf("%s\n", ext->name); - return 0; -} - -static int extension_name_cmp(const zend_llist_element **f, - const zend_llist_element **s TSRMLS_DC) -{ - return strcmp(((zend_extension *)(*f)->data)->name, - ((zend_extension *)(*s)->data)->name); -} - -static void print_extensions(TSRMLS_D) -{ - zend_llist sorted_exts; - - zend_llist_copy(&sorted_exts, &zend_extensions); - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); - zend_llist_destroy(&sorted_exts); -} - -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif - -static inline size_t sapi_cgibin_single_write(const char *str, uint str_length TSRMLS_DC) -{ -#ifdef PHP_WRITE_STDOUT - long ret; -#else - size_t ret; -#endif - -#if PHP_FASTCGI - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - long ret = FCGX_PutStr(str, str_length, request->out); - if (ret <= 0) { - return 0; - } - return ret; - } -#endif -#ifdef PHP_WRITE_STDOUT - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) return 0; - return ret; -#else - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} - -static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - - while (remaining > 0) { - ret = sapi_cgibin_single_write(ptr, remaining TSRMLS_CC); - if (!ret) { - php_handle_aborted_connection(); - return str_length - remaining; - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} - - -static void sapi_cgibin_flush(void *server_context) -{ -#if PHP_FASTCGI - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) server_context; - if ( -#ifndef PHP_WIN32 - !parent && -#endif - (!request || FCGX_FFlush(request->out) == -1)) { - php_handle_aborted_connection(); - } - return; - } -#endif - if (fflush(stdout) == EOF) { - php_handle_aborted_connection(); - } -} - -#define SAPI_CGI_MAX_HEADER_LENGTH 1024 - -static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char buf[SAPI_CGI_MAX_HEADER_LENGTH]; - sapi_header_struct *h; - zend_llist_position pos; - long rfc2616_headers = 0, nph = 0; - - if (SG(request_info).no_headers == 1) { - return SAPI_HEADER_SENT_SUCCESSFULLY; - } - /* Check wheater to send RFC2616 style headers compatible with - * PHP versions 4.2.3 and earlier compatible with web servers - * such as IIS. Default is informal CGI RFC header compatible - * with Apache. - */ - if (cfg_get_long("cgi.rfc2616_headers", &rfc2616_headers) == FAILURE) { - rfc2616_headers = 0; - } - - if (cfg_get_long("cgi.nph", &nph) == FAILURE) { - nph = 0; - } - - if (nph || SG(sapi_headers).http_response_code != 200) - { - int len; - - if (rfc2616_headers && SG(sapi_headers).http_status_line) { - len = snprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, - "%s\r\n", SG(sapi_headers).http_status_line); - - if (len > SAPI_CGI_MAX_HEADER_LENGTH) { - len = SAPI_CGI_MAX_HEADER_LENGTH; - } - - } else { - len = sprintf(buf, "Status: %d\r\n", SG(sapi_headers).http_response_code); - } - - PHPWRITE_H(buf, len); - } - - if (SG(sapi_headers).send_default_content_type) - { - char *hd; - - hd = sapi_get_default_content_type(TSRMLS_C); - PHPWRITE_H("Content-type: ", sizeof("Content-type: ") - 1); - PHPWRITE_H(hd, strlen(hd)); - PHPWRITE_H("\r\n", 2); - efree(hd); - } - - h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - PHPWRITE_H(h->header, h->header_len); - PHPWRITE_H("\r\n", 2); - h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - PHPWRITE_H("\r\n", 2); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - uint read_bytes=0, tmp_read_bytes; -#if PHP_FASTCGI - char *pos = buffer; -#endif - - count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes)); - while (read_bytes < count_bytes) { -#if PHP_FASTCGI - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - tmp_read_bytes = FCGX_GetStr(pos, count_bytes - read_bytes, request->in); - pos += tmp_read_bytes; - } else { - tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); - } -#else - tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); -#endif - - if (tmp_read_bytes <= 0) { - break; - } - read_bytes += tmp_read_bytes; - } - return read_bytes; -} - -static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC) -{ -#if PHP_FASTCGI - /* when php is started by mod_fastcgi, no regular environment - is provided to PHP. It is always sent to PHP at the start - of a request. So we have to do our own lookup to get env - vars. This could probably be faster somehow. */ - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - return FCGX_GetParam(name,request->envp); - } -#endif - /* if cgi, or fastcgi and not found in fcgi env - check the regular environment */ - return getenv(name); -} - -static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC) -{ - int len = 0; - char *buf = NULL; - if (!name) { - return NULL; - } - len = strlen(name) + (value ? strlen(value) : 0) + sizeof("=") + 2; - buf = (char *) malloc(len); - if (buf == NULL) { - return getenv(name); - } - if (value) { - snprintf(buf, len - 1, "%s=%s", name, value); - } else { - snprintf(buf, len - 1, "%s=", name); - } -#if PHP_FASTCGI - /* when php is started by mod_fastcgi, no regular environment - is provided to PHP. It is always sent to PHP at the start - of a request. So we have to do our own lookup to get env - vars. This could probably be faster somehow. */ - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - FCGX_PutEnv(request, buf); - free(buf); - return sapi_cgibin_getenv(name,0 TSRMLS_CC); - } -#endif - /* if cgi, or fastcgi and not found in fcgi env - check the regular environment - this leaks, but it's only cgi anyway, we'll fix - it for 5.0 - */ - putenv(buf); - return getenv(name); -} - -static char *sapi_cgi_read_cookies(TSRMLS_D) -{ - return sapi_cgibin_getenv((char *) "HTTP_COOKIE", 0 TSRMLS_CC); -} - -#if PHP_FASTCGI -void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) -{ - if (!FCGX_IsCGI()) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - char **env, *p, *t; - int magic_quotes_gpc = PG(magic_quotes_gpc); - - /* turn off magic_quotes while importing environment variables */ - PG(magic_quotes_gpc) = 0; - for (env = request->envp; env != NULL && *env != NULL; env++) { - p = strchr(*env, '='); - if (!p) { /* malformed entry? */ - continue; - } - t = estrndup(*env, p - *env); - php_register_variable(t, p + 1, array_ptr TSRMLS_CC); - efree(t); - } - PG(magic_quotes_gpc) = magic_quotes_gpc; - } - /* call php's original import as a catch-all */ - php_php_import_environment_variables(array_ptr TSRMLS_CC); -} -#endif - -static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - /* In CGI mode, we consider the environment to be a part of the server - * variables - */ - php_import_environment_variables(track_vars_array TSRMLS_CC); - /* Build the special-case PHP_SELF variable for the CGI version */ - php_register_variable("PHP_SELF", (SG(request_info).request_uri ? SG(request_info).request_uri : ""), track_vars_array TSRMLS_CC); -} - -static void sapi_cgi_log_message(char *message) -{ -#if PHP_FASTCGI - long logging = 1; - TSRMLS_FETCH(); - - if (cfg_get_long("fastcgi.logging", &logging) == FAILURE) { - logging = 1; - } - - if (!FCGX_IsCGI() && logging) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); - if (request) { - FCGX_FPrintF(request->err, "%s\n", message); - } - /* ignore return code */ - } else -#endif /* PHP_FASTCGI */ - fprintf(stderr, "%s\n", message); -} - -static int sapi_cgi_deactivate(TSRMLS_D) -{ - /* flush only when SAPI was started. The reasons are: - 1. SAPI Deactivate is called from two places: module init and request shutdown - 2. When the first call occurs and the request is not set up, flush fails on - FastCGI. - */ - if (SG(sapi_started)) { - sapi_cgibin_flush(SG(server_context)); - } - return SUCCESS; -} - -static int php_cgi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0) == FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -/* {{{ sapi_module_struct cgi_sapi_module - */ -static sapi_module_struct cgi_sapi_module = { -#if PHP_FASTCGI - "cgi-fcgi", /* name */ - "CGI/FastCGI", /* pretty name */ -#else - "cgi", /* name */ - "CGI", /* pretty name */ -#endif - - php_cgi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - sapi_cgi_deactivate, /* deactivate */ - - sapi_cgibin_ub_write, /* unbuffered write */ - sapi_cgibin_flush, /* flush */ - NULL, /* get uid */ - sapi_cgibin_getenv, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - sapi_cgi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_cgi_read_post, /* read POST data */ - sapi_cgi_read_cookies, /* read Cookies */ - - sapi_cgi_register_variables, /* register server variables */ - sapi_cgi_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ php_cgi_usage - */ -static void php_cgi_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php"; - } - - php_printf("Usage: %s [-q] [-h] [-s] [-v] [-i] [-f ]\n" - " %s [args...]\n" - " -a Run interactively\n" -#if PHP_FASTCGI && !defined(PHP_WIN32) - " -b | Bind Path for external FASTCGI Server mode\n" -#endif - " -C Do not chdir to the script's directory\n" - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse . Implies `-q'\n" - " -h This help\n" - " -i PHP information\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -q Quiet-mode. Suppress HTTP Header output.\n" - " -s Display colour syntax highlighted source.\n" - " -v Version number\n" - " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n", - prog, prog); -} -/* }}} */ - -/* {{{ init_request_info - - initializes request_info structure - - specificly in this section we handle proper translations - for: - - PATH_INFO - derived from the portion of the URI path following - the script name but preceding any query data - may be empty - - PATH_TRANSLATED - derived by taking any path-info component of the - request URI and performing any virtual-to-physical - translation appropriate to map it onto the server's - document repository structure - - empty if PATH_INFO is empty - - The env var PATH_TRANSLATED **IS DIFFERENT** than the - request_info.path_translated variable, the latter should - match SCRIPT_FILENAME instead. - - SCRIPT_NAME - set to a URL path that could identify the CGI script - rather than the interpreter. PHP_SELF is set to this. - - REQUEST_URI - uri section following the domain:port part of a URI - - SCRIPT_FILENAME - The virtual-to-physical translation of SCRIPT_NAME (as per - PATH_TRANSLATED) - - These settings are documented at - http://cgi-spec.golux.com/ - - - Based on the following URL request: - - http://localhost/info.php/test?a=b - - should produce, which btw is the same as if - we were running under mod_cgi on apache (ie. not - using ScriptAlias directives): - - PATH_INFO=/test - PATH_TRANSLATED=/docroot/test - SCRIPT_NAME=/info.php - REQUEST_URI=/info.php/test?a=b - SCRIPT_FILENAME=/docroot/info.php - QUERY_STRING=a=b - - but what we get is (cgi/mod_fastcgi under apache): - - PATH_INFO=/info.php/test - PATH_TRANSLATED=/docroot/info.php/test - SCRIPT_NAME=/php/php-cgi (from the Action setting I suppose) - REQUEST_URI=/info.php/test?a=b - SCRIPT_FILENAME=/path/to/php/bin/php-cgi (Action setting translated) - QUERY_STRING=a=b - - Comments in the code below refer to using the above URL in a request - - */ -static void init_request_info(TSRMLS_D) -{ - char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", 0 TSRMLS_CC); - char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", 0 TSRMLS_CC); - char *script_path_translated = env_script_filename; - -#if !DISCARD_PATH - /* some broken servers do not have script_filename or argv0 - an example, IIS configured in some ways. then they do more - broken stuff and set path_translated to the cgi script location */ - if (!script_path_translated && env_path_translated) { - script_path_translated = env_path_translated; - } -#endif - - /* initialize the defaults */ - SG(request_info).path_translated = NULL; - SG(request_info).request_method = NULL; - SG(request_info).proto_num = 1000; - SG(request_info).query_string = NULL; - SG(request_info).request_uri = NULL; - SG(request_info).content_type = NULL; - SG(request_info).content_length = 0; - SG(sapi_headers).http_response_code = 200; - - /* script_path_translated being set is a good indication that - we are running in a cgi environment, since it is always - null otherwise. otherwise, the filename - of the script will be retreived later via argc/argv */ - if (script_path_translated) { - const char *auth; - char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", 0 TSRMLS_CC); - char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", 0 TSRMLS_CC); - char *env_path_info = sapi_cgibin_getenv("PATH_INFO", 0 TSRMLS_CC); - char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", 0 TSRMLS_CC); -#if ENABLE_PATHINFO_CHECK - struct stat st; - char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", 0 TSRMLS_CC); - char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", 0 TSRMLS_CC); - - if (fix_pathinfo) { - - /* save the originals first for anything we change later */ - if (env_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", env_path_translated TSRMLS_CC); - } - if (env_path_info) { - _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info TSRMLS_CC); - } - if (env_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", env_script_name TSRMLS_CC); - } - if (env_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", env_script_filename TSRMLS_CC); - } - if (!env_document_root) { - /* ini version of document root */ - if (!env_document_root) { - env_document_root = PG(doc_root); - } - /* set the document root, this makes a more - consistent env for php scripts */ - if (env_document_root) { - env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", env_document_root TSRMLS_CC); - /* fix docroot */ - TRANSLATE_SLASHES(env_document_root); - } - } - - if (env_path_translated != NULL && env_redirect_url != NULL) { - /* - pretty much apache specific. If we have a redirect_url - then our script_filename and script_name point to the - php executable - */ - script_path_translated = env_path_translated; - /* we correct SCRIPT_NAME now in case we don't have PATH_INFO */ - env_script_name = _sapi_cgibin_putenv("SCRIPT_NAME", env_redirect_url TSRMLS_CC); - } - -#ifdef __riscos__ - /* Convert path to unix format*/ - __riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR; - script_path_translated = __unixify(script_path_translated, 0, NULL, 1, 0); -#endif - - /* - * if the file doesn't exist, try to extract PATH_INFO out - * of it by stat'ing back through the '/' - * this fixes url's like /info.php/test - */ - if (script_path_translated && stat(script_path_translated, &st) == -1 ) { - char *pt = estrdup(script_path_translated); - int len = strlen(pt); - char *ptr; - - while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { - *ptr = 0; - if (stat(pt, &st) == 0 && S_ISREG(st.st_mode)) { - /* - * okay, we found the base script! - * work out how many chars we had to strip off; - * then we can modify PATH_INFO - * accordingly - * - * we now have the makings of - * PATH_INFO=/test - * SCRIPT_FILENAME=/docroot/info.php - * - * we now need to figure out what docroot is. - * if DOCUMENT_ROOT is set, this is easy, otherwise, - * we have to play the game of hide and seek to figure - * out what SCRIPT_NAME should be - */ - int slen = len - strlen(pt); - int pilen = strlen(env_path_info); - char *path_info = env_path_info + pilen - slen; - - env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt TSRMLS_CC); - TRANSLATE_SLASHES(pt); - - /* figure out docroot - SCRIPT_FILENAME minus SCRIPT_NAME - */ - - if (env_document_root) - { - int l = strlen(env_document_root); - int path_translated_len = 0; - char *path_translated = NULL; - - if (env_document_root[l - 1] == '/') { - --l; - } - - /* we have docroot, so we should have: - * DOCUMENT_ROOT=/docroot - * SCRIPT_FILENAME=/docroot/info.php - * - * SCRIPT_NAME is the portion of the path beyond docroot - */ - env_script_name = _sapi_cgibin_putenv("SCRIPT_NAME", pt + l TSRMLS_CC); - - /* PATH_TRANSATED = DOCUMENT_ROOT + PATH_INFO */ - path_translated_len = l + strlen(env_path_info) + 2; - path_translated = (char *) emalloc(path_translated_len); - *path_translated = 0; - strncat(path_translated, env_document_root, l); - strcat(path_translated, env_path_info); - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); - efree(path_translated); - } else if (env_script_name && - strstr(pt, env_script_name) - ) { - /* PATH_TRANSATED = PATH_TRANSATED - SCRIPT_NAME + PATH_INFO */ - int ptlen = strlen(pt) - strlen(env_script_name); - int path_translated_len = ptlen + strlen(env_path_info) + 2; - char *path_translated = NULL; - - path_translated = (char *) emalloc(path_translated_len); - *path_translated = 0; - strncat(path_translated, pt, ptlen); - strcat(path_translated, env_path_info); - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); - efree(path_translated); - } - break; - } - } - if (!ptr) { - /* - * if we stripped out all the '/' and still didn't find - * a valid path... we will fail, badly. of course we would - * have failed anyway... we output 'no input file' now. - */ - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL TSRMLS_CC); - SG(sapi_headers).http_response_code = 404; - } - if (pt) { - efree(pt); - } - } else { - /* make sure path_info/translated are empty */ - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC); - _sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC); - _sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC); - } - SG(request_info).request_uri = sapi_cgibin_getenv("SCRIPT_NAME",0 TSRMLS_CC); - } else { -#endif - /* pre 4.3 behaviour, shouldn't be used but provides BC */ - if (env_path_info) { - SG(request_info).request_uri = env_path_info; - } else { - SG(request_info).request_uri = env_script_name; - } -#if !DISCARD_PATH - if (env_path_translated) - script_path_translated = env_path_translated; -#endif -#if ENABLE_PATHINFO_CHECK - } -#endif - SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", 0 TSRMLS_CC); - /* FIXME - Work out proto_num here */ - SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", 0 TSRMLS_CC); - /* some server configurations allow '..' to slip through in the - translated path. We'll just refuse to handle such a path. */ - if (script_path_translated && !strstr(script_path_translated, "..")) { - SG(request_info).path_translated = estrdup(script_path_translated); - } - SG(request_info).content_type = (content_type ? content_type : "" ); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - /* The CGI RFC allows servers to pass on unvalidated Authorization data */ - auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION",0 TSRMLS_CC); - php_handle_auth_data(auth TSRMLS_CC); - } -} -/* }}} */ - -static void define_command_line_ini_entry(char *arg) -{ - char *name, *value; - - name = arg; - value = strchr(arg, '='); - if (value) { - *value = 0; - value++; - } else { - value = "1"; - } - zend_alter_ini_entry(name, strlen(name) + 1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -} - - -static void php_register_command_line_global_vars(char **arg TSRMLS_DC) -{ - char *var, *val; - - var = *arg; - val = strchr(var, '='); - if (!val) { - printf("No value specified for variable '%s'\n", var); - } else { - *val++ = '\0'; - php_register_variable(var, val, NULL TSRMLS_CC); - } - efree(*arg); -} - -#if PHP_FASTCGI -/** - * Clean up child processes upon exit - */ -void fastcgi_cleanup(int signal) -{ -#ifdef DEBUG_FASTCGI - fprintf(stderr, "FastCGI shutdown, pid %d\n", getpid()); -#endif - -#ifndef PHP_WIN32 - sigaction(SIGTERM, &old_term, 0); - - /* Kill all the processes in our process group */ - kill(-pgroup, SIGTERM); -#endif - - /* We should exit at this point, but MacOSX doesn't seem to */ - exit(0); -} -#endif - -/* {{{ main - */ -int main(int argc, char *argv[]) -{ - int exit_status = SUCCESS; - int cgi = 0, c, i, len; - zend_file_handle file_handle; - int retval = FAILURE; - char *s; -/* temporary locals */ - int behavior = PHP_MODE_STANDARD; - int no_headers = 0; - int orig_optind = php_optind; - char *orig_optarg = php_optarg; - char *script_file = NULL; - zend_llist global_vars; -#if FORCE_CGI_REDIRECT - long force_redirect = 1; - char *redirect_status_env = NULL; -#endif - -/* end of temporary locals */ -#ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - php_core_globals *core_globals; - sapi_globals_struct *sapi_globals; - void ***tsrm_ls; -#endif - -#if PHP_FASTCGI - int max_requests = 500; - int requests = 0; - int fastcgi = !FCGX_IsCGI(); -#ifndef PHP_WIN32 - char *bindpath = NULL; -#endif - int fcgi_fd = 0; - FCGX_Request request; -#ifdef PHP_WIN32 - long impersonate = 0; -#else - int status = 0; -#endif -#endif /* PHP_FASTCGI */ - -#if 0 && defined(PHP_DEBUG) - /* IIS is always making things more difficult. This allows - us to stop PHP and attach a debugger before much gets started */ - { - char szMessage [256]; - wsprintf (szMessage, "Please attach a debugger to the process 0x%X [%d] (%s) and click OK", - GetCurrentProcessId(), GetCurrentProcessId(), argv[0]); - MessageBox(NULL, szMessage, "CGI Debug Time!", MB_OK|MB_SERVICE_NOTIFICATION); - } -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - - sapi_startup(&cgi_sapi_module); - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /* sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - -#if PHP_FASTCGI - if (!fastcgi) { -#endif - /* Make sure we detect we are a cgi - a bit redundancy here, - but the default case is that we have to check only the first one. */ - if (getenv("SERVER_SOFTWARE") || - getenv("SERVER_NAME") || - getenv("GATEWAY_INTERFACE") || - getenv("REQUEST_METHOD") - ) { - cgi = 1; - } -#if PHP_FASTCGI - } -#endif - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - case 'c': - cgi_sapi_module.php_ini_path_override = strdup(php_optarg); - break; - case 'n': - cgi_sapi_module.php_ini_ignore = 1; - break; -#if PHP_FASTCGI -#ifndef PHP_WIN32 - /* if we're started on command line, check to see if - we are being started as an 'external' fastcgi - server by accepting a bindpath parameter. */ - case 'b': - if (!fastcgi) { - bindpath = strdup(php_optarg); - } - break; -#endif -#endif - } - - } - php_optind = orig_optind; - php_optarg = orig_optarg; - -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); - sapi_globals = ts_resource(sapi_globals_id); - tsrm_ls = ts_resource(0); - SG(request_info).path_translated = NULL; -#endif - - cgi_sapi_module.executable_location = argv[0]; - - /* startup after we get the above ini override se we get things right */ - if (php_module_startup(&cgi_sapi_module, NULL, 0) == FAILURE) { -#ifdef ZTS - tsrm_shutdown(); -#endif - return FAILURE; - } - -#if FORCE_CGI_REDIRECT - /* check force_cgi after startup, so we have proper output */ - if (cfg_get_long("cgi.force_redirect", &force_redirect) == FAILURE) { - force_redirect = 1; - } - if (cgi && force_redirect) { - if (cfg_get_string("cgi.redirect_status_env", &redirect_status_env) == FAILURE) { - redirect_status_env = NULL; - } - /* Apache will generate REDIRECT_STATUS, - * Netscape and redirect.so will generate HTTP_REDIRECT_STATUS. - * redirect.so and installation instructions available from - * http://www.koehntopp.de/php. - * -- kk@netuse.de - */ - if (!getenv("REDIRECT_STATUS") - && !getenv ("HTTP_REDIRECT_STATUS") - /* this is to allow a different env var to be configured - in case some server does something different than above */ - && (!redirect_status_env || !getenv(redirect_status_env)) - ) { - SG(sapi_headers).http_response_code = 400; - PUTS("Security Alert! The PHP CGI cannot be accessed directly.\n\n\ -

              This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\ -means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\ -set, e.g. via an Apache Action directive.

              \n\ -

              For more information as to why this behaviour exists, see the \ -manual page for CGI security.

              \n\ -

              For more information about changing this behaviour or re-enabling this webserver,\n\ -consult the installation file that came with this distribution, or visit \n\ -the manual page.

              \n"); - -#if defined(ZTS) && !defined(PHP_DEBUG) - /* XXX we're crashing here in msvc6 debug builds at - php_message_handler_for_zend:839 because - SG(request_info).path_translated is an invalid pointer. - It still happens even though I set it to null, so something - weird is going on. - */ - tsrm_shutdown(); -#endif - return FAILURE; - } - } -#endif /* FORCE_CGI_REDIRECT */ - -#if ENABLE_PATHINFO_CHECK - if (cfg_get_long("cgi.fix_pathinfo", &fix_pathinfo) == FAILURE) { - fix_pathinfo = 1; - } -#endif - -#if PHP_FASTCGI -#ifndef PHP_WIN32 - /* for windows, socket listening is broken in the fastcgi library itself - so dissabling this feature on windows till time is available to fix it */ - if (bindpath) { - /* this must be done to make FCGX_OpenSocket work correctly - bug 23664 */ - close(0); - /* Pass on the arg to the FastCGI library, with one exception. - * If just a port is specified, then we prepend a ':' onto the - * path (it's what the fastcgi library expects) - */ - - if (strchr(bindpath, ':') == NULL) { - char *tmp; - - tmp = malloc(strlen(bindpath) + 2); - tmp[0] = ':'; - memcpy(tmp + 1, bindpath, strlen(bindpath) + 1); - - fcgi_fd = FCGX_OpenSocket(tmp, 128); - free(tmp); - } else { - fcgi_fd = FCGX_OpenSocket(bindpath, 128); - } - if (fcgi_fd < 0) { - fprintf(stderr, "Couldn't create FastCGI listen socket on port %s\n", bindpath); -#ifdef ZTS - tsrm_shutdown(); -#endif - return FAILURE; - } - fastcgi = !FCGX_IsCGI(); - } -#endif - if (fastcgi) { - /* How many times to run PHP scripts before dying */ - if (getenv("PHP_FCGI_MAX_REQUESTS")) { - max_requests = atoi(getenv("PHP_FCGI_MAX_REQUESTS")); - if (!max_requests) { - fprintf(stderr, "PHP_FCGI_MAX_REQUESTS is not valid\n"); - return FAILURE; - } - } - - /* make php call us to get _ENV vars */ - php_php_import_environment_variables = php_import_environment_variables; - php_import_environment_variables = cgi_php_import_environment_variables; - - /* library is already initialized, now init our request */ - FCGX_Init(); - FCGX_InitRequest(&request, fcgi_fd, 0); - -#ifndef PHP_WIN32 - /* Pre-fork, if required */ - if (getenv("PHP_FCGI_CHILDREN")) { - children = atoi(getenv("PHP_FCGI_CHILDREN")); - if (!children) { - fprintf(stderr, "PHP_FCGI_CHILDREN is not valid\n"); - return FAILURE; - } - } - - if (children) { - int running = 0; - pid_t pid; - - /* Create a process group for ourself & children */ - setsid(); - pgroup = getpgrp(); -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Process group %d\n", pgroup); -#endif - - /* Set up handler to kill children upon exit */ - act.sa_flags = 0; - act.sa_handler = fastcgi_cleanup; - if (sigaction(SIGTERM, &act, &old_term) || - sigaction(SIGINT, &act, &old_int) || - sigaction(SIGQUIT, &act, &old_quit)) { - perror("Can't set signals"); - exit(1); - } - - while (parent) { - do { -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Forking, %d running\n", running); -#endif - pid = fork(); - switch (pid) { - case 0: - /* One of the children. - * Make sure we don't go round the - * fork loop any more - */ - parent = 0; - - /* don't catch our signals */ - sigaction(SIGTERM, &old_term, 0); - sigaction(SIGQUIT, &old_quit, 0); - sigaction(SIGINT, &old_int, 0); - break; - case -1: - perror("php (pre-forking)"); - exit(1); - break; - default: - /* Fine */ - running++; - break; - } - } while (parent && (running < children)); - - if (parent) { -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Wait for kids, pid %d\n", getpid()); -#endif - wait(&status); - running--; - } - } - } - -#endif /* WIN32 */ - } -#endif /* FASTCGI */ - - zend_first_try { - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1)) != -1) { - switch (c) { - case 'h': - case '?': - no_headers = 1; - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_cgi_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - } - } - php_optind = orig_optind; - php_optarg = orig_optarg; - -#if PHP_FASTCGI - /* start of FAST CGI loop */ - /* Initialise FastCGI request structure */ -#ifdef PHP_WIN32 - /* attempt to set security impersonation for fastcgi - will only happen on NT based OS, others will ignore it. */ - if (fastcgi) { - if (cfg_get_long("fastcgi.impersonate", &impersonate) == FAILURE) { - impersonate = 0; - } - if (impersonate) OS_SetImpersonate(); - } -#endif - while (!fastcgi || FCGX_Accept_r(&request) >= 0) { -#endif - -#if PHP_FASTCGI - SG(server_context) = (void *) &request; -#else - SG(server_context) = (void *) 1; /* avoid server_context==NULL checks */ -#endif - init_request_info(TSRMLS_C); - zend_llist_init(&global_vars, sizeof(char *), NULL, 0); - CG(interactive) = 0; - - if (!cgi -#if PHP_FASTCGI - && !fastcgi -#endif - ) { - if (cgi_sapi_module.php_ini_path_override && cgi_sapi_module.php_ini_ignore) { - no_headers = 1; - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_printf("You cannot use both -n and -c switch. Use -h for help.\n"); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - } - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - printf("Interactive mode enabled\n\n"); - CG(interactive) = 1; - break; - - case 'C': /* don't chdir to the script directory */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - break; - case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(php_optarg); - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'f': /* parse file */ - script_file = estrdup(php_optarg); - no_headers = 1; - /* arguments after the file are considered script args */ - SG(request_info).argc = argc - (php_optind - 1); - SG(request_info).argv = &argv[php_optind - 1]; - break; - - case 'g': /* define global variables on command line */ - { - char *arg = estrdup(php_optarg); - - zend_llist_add_element(&global_vars, &arg); - } - break; - - case 'i': /* php info & quit */ - if (php_request_startup(TSRMLS_C) == FAILURE) { - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; - - case 'l': /* syntax check mode */ - no_headers = 1; - behavior = PHP_MODE_LINT; - break; - - case 'm': /* list compiled in modules */ - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); - php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); - php_printf("\n"); - php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; - -#if 0 /* not yet operational, see also below ... */ - case '': /* generate indented source mode*/ - behavior=PHP_MODE_INDENT; - break; -#endif - - case 'q': /* do not generate HTTP headers */ - no_headers = 1; - break; - - case 's': /* generate highlighted HTML from source */ - behavior = PHP_MODE_HIGHLIGHT; - break; - - case 'v': /* show php version & quit */ - no_headers = 1; - if (php_request_startup(TSRMLS_C) == FAILURE) { - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } -#if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#endif - php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; - - case 'w': - behavior = PHP_MODE_STRIP; - break; - - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; - - default: - break; - } - } - - if (script_file) { - /* override path_translated if -f on command line */ - SG(request_info).path_translated = script_file; - } - - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - - if (!SG(request_info).path_translated && argc > php_optind) { - /* arguments after the file are considered script args */ - SG(request_info).argc = argc - php_optind; - SG(request_info).argv = &argv[php_optind]; - /* file is on command line, but not in -f opt */ - SG(request_info).path_translated = estrdup(argv[php_optind++]); - } - - /* all remaining arguments are part of the query string - this section of code concatenates all remaining arguments - into a single string, seperating args with a & - this allows command lines like: - - test.php v1=test v2=hello+world! - test.php "v1=test&v2=hello world!" - test.php v1=test "v2=hello world!" - */ - if (!SG(request_info).query_string && argc > php_optind) { - len = 0; - for (i = php_optind; i < argc; i++) { - len += strlen(argv[i]) + 1; - } - - s = malloc(len + 1); /* leak - but only for command line version, so ok */ - *s = '\0'; /* we are pretending it came from the environment */ - for (i = php_optind, len = 0; i < argc; i++) { - strcat(s, argv[i]); - if (i < (argc - 1)) { - strcat(s, PG(arg_separator).input); - } - } - SG(request_info).query_string = s; - } - } /* end !cgi && !fastcgi */ - - /* - we never take stdin if we're (f)cgi, always - rely on the web server giving us the info - we need in the environment. - */ - if (SG(request_info).path_translated || cgi -#if PHP_FASTCGI - || fastcgi -#endif - ) - { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.handle.fp = NULL; - } else { - file_handle.filename = "-"; - file_handle.type = ZEND_HANDLE_FP; - file_handle.handle.fp = stdin; - } - - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - /* request startup only after we've done all we can to - get path_translated */ - if (php_request_startup(TSRMLS_C) == FAILURE) { -#if PHP_FASTCGI - if (fastcgi) { - FCGX_Finish_r(&request); - } -#endif - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - - /* This actually destructs the elements of the list - ugly hack */ - zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars TSRMLS_CC); - zend_llist_destroy(&global_vars); - - /* - at this point path_translated will be set if: - 1. we are running from shell and got filename was there - 2. we are running as cgi or fastcgi - */ - if (cgi || SG(request_info).path_translated) { - retval = php_fopen_primary_script(&file_handle TSRMLS_CC); - } - /* - if we are unable to open path_translated and we are not - running from shell (so fp == NULL), then fail. - */ - if (retval == FAILURE && file_handle.handle.fp == NULL) { - SG(sapi_headers).http_response_code = 404; - PUTS("No input file specified.\n"); -#if PHP_FASTCGI - /* we want to serve more requests if this is fastcgi - so cleanup and continue, request shutdown is - handled later */ - if (fastcgi) { - goto fastcgi_request_done; - } -#endif - php_request_shutdown((void *) 0); - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - - if (file_handle.handle.fp && (file_handle.handle.fp != stdin)) { - /* #!php support */ - c = fgetc(file_handle.handle.fp); - if (c == '#') { - while (c != 10 && c != 13) { - c = fgetc(file_handle.handle.fp); /* skip to end of line */ - } - /* handle situations where line is terminated by \r\n */ - if (c == 13) { - if (fgetc(file_handle.handle.fp) != 10) { - long pos = ftell(file_handle.handle.fp); - fseek(file_handle.handle.fp, pos - 1, SEEK_SET); - } - } - CG(start_lineno) = 2; - } else { - rewind(file_handle.handle.fp); - } - } - - switch (behavior) { - case PHP_MODE_STANDARD: - php_execute_script(&file_handle TSRMLS_CC); - break; - case PHP_MODE_LINT: - PG(during_request_startup) = 0; - exit_status = php_lint_script(&file_handle TSRMLS_CC); - if (exit_status == SUCCESS) { - zend_printf("No syntax errors detected in %s\n", file_handle.filename); - } else { - zend_printf("Errors parsing %s\n", file_handle.filename); - } - break; - case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { - zend_strip(TSRMLS_C); - fclose(file_handle.handle.fp); - php_end_ob_buffers(1 TSRMLS_CC); - } - return SUCCESS; - break; - case PHP_MODE_HIGHLIGHT: - { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { - php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); - fclose(file_handle.handle.fp); - php_end_ob_buffers(1 TSRMLS_CC); - } - return SUCCESS; - } - break; -#if 0 - /* Zeev might want to do something with this one day */ - case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(); - fclose(file_handle.handle.fp); - return SUCCESS; - break; -#endif - } - -#if PHP_FASTCGI -fastcgi_request_done: -#endif - { - char *path_translated; - - /* Go through this trouble so that the memory manager doesn't warn - * about SG(request_info).path_translated leaking - */ - if (SG(request_info).path_translated) { - path_translated = strdup(SG(request_info).path_translated); - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = path_translated; - } - - php_request_shutdown((void *) 0); - if (exit_status == 0) { - exit_status = EG(exit_status); - } - - if (SG(request_info).path_translated) { - free(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - } - } - -#if PHP_FASTCGI - if (!fastcgi) break; - /* only fastcgi will get here */ - requests++; - if (max_requests && (requests == max_requests)) { - FCGX_Finish_r(&request); -#ifndef PHP_WIN32 - if (bindpath) { - free(bindpath); - } -#endif - break; - } - /* end of fastcgi loop */ - } -#endif - - if (cgi_sapi_module.php_ini_path_override) { - free(cgi_sapi_module.php_ini_path_override); - } - } zend_catch { - exit_status = 255; - } zend_end_try(); - - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - -#ifdef ZTS - /*tsrm_shutdown();*/ -#endif - -#if PHP_WIN32 && ZEND_DEBUG && 0 - _CrtDumpMemoryLeaks(); -#endif - - return exit_status; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cgi/config.w32 b/sapi/cgi/config.w32 deleted file mode 100644 index 5ef51ccd29a76..0000000000000 --- a/sapi/cgi/config.w32 +++ /dev/null @@ -1,25 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes'); -ARG_ENABLE('fastcgi', 'Build FastCGI support into CGI binary', 'yes'); -ARG_ENABLE('path-info-check', - 'If this is disabled, paths such as /info.php/test?a=b will fail to work', 'yes'); - -ARG_ENABLE("force-cgi-redirect", "Enable the security check for internal \ -server redirects. You should use this if you are running the CGI \ -version with Apache.", "yes"); - -AC_DEFINE("FORCE_CGI_REDIRECT", PHP_FORCE_CGI_REDIRECT == "yes" ? 1 : 0, "CGI redirect mode"); -AC_DEFINE("ENABLE_PATHINFO_CHECK", PHP_PATH_INFO_CHECK == "yes" ? 1 : 0, "Pathinfo check"); - -if (PHP_CGI == "yes") { - AC_DEFINE('PHP_FASTCGI', PHP_FASTCGI == "yes" ? 1 : 0); - if (PHP_FASTCGI == "yes") { - SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe', '/I sapi/cgi/libfcgi/include /D FCGI_STATIC'); - ADD_SOURCES('sapi/cgi/libfcgi', 'fcgi_stdio.c fcgiapp.c os_win32.c', 'cgi'); - ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib'); - } else { - SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe'); - } -} diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4 deleted file mode 100644 index abc6d31cea17a..0000000000000 --- a/sapi/cgi/config9.m4 +++ /dev/null @@ -1,175 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_ARG_ENABLE(cgi, -[ --disable-cgi Disable building CGI version of PHP], -[ - PHP_SAPI_CGI=$enableval -],[ - PHP_SAPI_CGI=yes -]) - -AC_ARG_ENABLE(force-cgi-redirect, -[ --enable-force-cgi-redirect - CGI: Enable the security check for internal server - redirects. You should use this if you are - running the CGI version with Apache], -[ - PHP_FORCE_CGI_REDIRECT=$enableval -],[ - PHP_FORCE_CGI_REDIRECT=no -]) - -AC_ARG_ENABLE(discard-path, -[ --enable-discard-path CGI: If this is enabled, the PHP CGI binary - can safely be placed outside of the - web tree and people will not be able - to circumvent .htaccess security], -[ - PHP_DISCARD_PATH=$enableval -],[ - PHP_DISCARD_PATH=no -]) - -AC_ARG_ENABLE(fastcgi, -[ --enable-fastcgi CGI: If this is enabled, the cgi module will - be built with support for fastcgi also], -[ - PHP_ENABLE_FASTCGI=$enableval -],[ - PHP_ENABLE_FASTCGI=no -]) - -AC_ARG_ENABLE(path-info-check, -[ --disable-path-info-check CGI: If this is disabled, paths such as - /info.php/test?a=b will fail to work], -[ - PHP_ENABLE_PATHINFO_CHECK=$enableval -],[ - PHP_ENABLE_PATHINFO_CHECK=yes -]) - -AC_DEFUN([PHP_TEST_WRITE_STDOUT],[ - AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[ - AC_TRY_RUN([ -#ifdef HAVE_UNISTD_H -#include -#endif - -#define TEXT "This is the test message -- " - -main() -{ - int n; - - n = write(1, TEXT, sizeof(TEXT)-1); - return (!(n == sizeof(TEXT)-1)); -} - ],[ - ac_cv_write_stdout=yes - ],[ - ac_cv_write_stdout=no - ],[ - ac_cv_write_stdout=no - ]) - ]) - if test "$ac_cv_write_stdout" = "yes"; then - AC_DEFINE(PHP_WRITE_STDOUT, 1, [whether write(2) works]) - fi -]) - - -if test "$PHP_SAPI" = "default"; then - AC_MSG_CHECKING(for CGI build) - if test "$PHP_SAPI_CGI" != "no"; then - AC_MSG_RESULT(yes) - - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag) - case $host_alias in - *cygwin* ) - SAPI_CGI_PATH=sapi/cgi/php.exe - ;; - * ) - SAPI_CGI_PATH=sapi/cgi/php - ;; - esac - PHP_SUBST(SAPI_CGI_PATH) - - PHP_TEST_WRITE_STDOUT - - AC_MSG_CHECKING(whether to force Apache CGI redirect) - if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then - REDIRECT=1 - else - REDIRECT=0 - fi - AC_DEFINE_UNQUOTED(FORCE_CGI_REDIRECT,$REDIRECT,[ ]) - AC_MSG_RESULT($PHP_FORCE_CGI_REDIRECT) - - - AC_MSG_CHECKING(whether to discard path_info + path_translated) - if test "$PHP_DISCARD_PATH" = "yes"; then - DISCARD_PATH=1 - else - DISCARD_PATH=0 - fi - AC_DEFINE_UNQUOTED(DISCARD_PATH, $DISCARD_PATH, [ ]) - AC_MSG_RESULT($PHP_DISCARD_PATH) - - AC_MSG_CHECKING(whether to enable path info checking) - if test "$PHP_ENABLE_PATHINFO_CHECK" = "yes"; then - ENABLE_PATHINFO_CHECK=1 - else - ENABLE_PATHINFO_CHECK=0 - fi - AC_DEFINE_UNQUOTED(ENABLE_PATHINFO_CHECK, $ENABLE_PATHINFO_CHECK, [ ]) - AC_MSG_RESULT($PHP_ENABLE_PATHINFO_CHECK) - - AC_MSG_CHECKING(whether to enable fastcgi support) - PHP_LIBFCGI_DIR="$abs_srcdir/sapi/cgi/libfcgi" - if test -z $PHP_LIBFCGI_DIR; then - echo "$PHP_LIBFCGI_DIR does not exist" - exit 1 - fi - if test "$PHP_ENABLE_FASTCGI" = "yes"; then - PHP_ADD_BUILD_DIR($abs_builddir/sapi/cgi/libfcgi) - PHP_FASTCGI=1 - PHP_FCGI_FILES="libfcgi/fcgi_stdio.c libfcgi/fcgiapp.c libfcgi/os_unix.c" - PHP_FCGI_INCLUDE="-I$PHP_LIBFCGI_DIR/include" - PHP_FCGI_STATIC=1 - else - PHP_FASTCGI=0 - PHP_FCGI_FILES="" - PHP_FCGI_INCLUDE="" - PHP_FCGI_STATIC=0 - fi - AC_DEFINE_UNQUOTED(PHP_FASTCGI, $PHP_FASTCGI, [ ]) - AC_DEFINE_UNQUOTED(PHP_FCGI_STATIC, $PHP_FCGI_STATIC, [ ]) - AC_MSG_RESULT($PHP_ENABLE_FASTCGI) - - INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)" - PHP_SELECT_SAPI(cgi, program, $PHP_FCGI_FILES cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, '$(SAPI_CGI_PATH)') - - case $host_alias in - *aix*) - BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - *darwin*) - BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - *) - BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - esac - - PHP_SUBST(BUILD_CGI) - - elif test "$PHP_SAPI_CLI" != "no"; then - AC_MSG_RESULT(no) - OVERALL_TARGET= - PHP_SAPI=cli - else - AC_MSG_ERROR([No SAPIs selected.]) - fi -fi diff --git a/sapi/cgi/getopt.c b/sapi/cgi/getopt.c deleted file mode 100644 index 3551e9f27a63c..0000000000000 --- a/sapi/cgi/getopt.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -static int php_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err) -{ - if (show_err) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - int arg_start = 2; - - int opts_idx = -1; - - if (*optind >= argc) { - return(EOF); - } - if (!dash) { - if ((argv[*optind][0] != '-')) { - return(EOF); - } else { - if (!argv[*optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - } - } - if ((argv[*optind][0] == '-') && (argv[*optind][1] == '-')) { - /* '--' indicates end of args if not followed by a known long option name */ - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - (*optind)++; - return(EOF); - } else if (opts[opts_idx].opt_name && !strcmp(&argv[*optind][2], opts[opts_idx].opt_name)) { - break; - } - } - optchr = 0; - dash = 1; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } - if (!dash) { - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { - dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); - } - if (opts_idx < 0) { - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - int errind = *optind; - int errchr = optchr; - - if (!argv[*optind][optchr+1]) { - dash = 0; - (*optind)++; - } else { - optchr++; - } - return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); - } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { - break; - } - } - } - if (opts[opts_idx].need_param) { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[*optind][arg_start]) { - (*optind)++; - if (*optind == argc) { - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } - *optarg = argv[(*optind)++]; - } else { - *optarg = &argv[*optind][arg_start]; - (*optind)++; - } - return opts[opts_idx].opt_char; - } else { - if (arg_start == 2) { - if (!argv[*optind][optchr+1]) - { - dash = 0; - (*optind)++; - } else { - optchr++; - } - } else { - (*optind)++; - } - return opts[opts_idx].opt_char; - } - assert(0); - return(0); /* never reached */ -} diff --git a/sapi/cgi/libfcgi/LICENSE.TERMS b/sapi/cgi/libfcgi/LICENSE.TERMS deleted file mode 100644 index 7e6bdfded70dd..0000000000000 --- a/sapi/cgi/libfcgi/LICENSE.TERMS +++ /dev/null @@ -1,28 +0,0 @@ -This FastCGI application library source and object code (the -"Software") and its documentation (the "Documentation") are -copyrighted by Open Market, Inc ("Open Market"). The following terms -apply to all files associated with the Software and Documentation -unless explicitly disclaimed in individual files. - -Open Market permits you to use, copy, modify, distribute, and license -this Software and the Documentation for any purpose, provided that -existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written -agreement, license, or royalty fee is required for any of the -authorized uses. Modifications to this Software and Documentation may -be copyrighted by their authors and need not follow the licensing -terms described here. If modifications to this Software and -Documentation have new licensing terms, the new terms must be clearly -indicated on the first page of each file where they apply. - -OPEN MARKET MAKES NO EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE -SOFTWARE OR THE DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN -NO EVENT SHALL OPEN MARKET BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY -DAMAGES ARISING FROM OR RELATING TO THIS SOFTWARE OR THE -DOCUMENTATION, INCLUDING, WITHOUT LIMITATION, ANY INDIRECT, SPECIAL OR -CONSEQUENTIAL DAMAGES OR SIMILAR DAMAGES, INCLUDING LOST PROFITS OR -LOST DATA, EVEN IF OPEN MARKET HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS". -OPEN MARKET HAS NO LIABILITY IN CONTRACT, TORT, NEGLIGENCE OR -OTHERWISE ARISING OUT OF THIS SOFTWARE OR THE DOCUMENTATION. diff --git a/sapi/cgi/libfcgi/acinclude.m4 b/sapi/cgi/libfcgi/acinclude.m4 deleted file mode 100644 index cd610142e9096..0000000000000 --- a/sapi/cgi/libfcgi/acinclude.m4 +++ /dev/null @@ -1,389 +0,0 @@ -dnl $Id$ - -AC_DEFUN([FCGI_COMMON_CHECKS], [ - AC_MSG_CHECKING([for sun_len in sys/un.h]) - AC_EGREP_HEADER([sun_len], [sys/un.h], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1], - [Define if sockaddr_un in sys/un.h contains a sun_len component])], - AC_MSG_RESULT([no])) - - AC_MSG_CHECKING([for fpos_t in stdio.h]) - AC_EGREP_HEADER([fpos_t], [stdio.h], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_FPOS], [1], - [Define if the fpos_t typedef is in stdio.h])], - AC_MSG_RESULT([no])) - - AC_CHECK_HEADERS([sys/socket.h netdb.h netinet/in.h arpa/inet.h]) - AC_CHECK_HEADERS([sys/time.h limits.h sys/param.h unistd.h]) - - AC_MSG_CHECKING([for a fileno() prototype in stdio.h]) - AC_EGREP_HEADER([fileno], [stdio.h], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_FILENO_PROTO], [1], - [Define if there's a fileno() prototype in stdio.h])], - AC_MSG_RESULT([no])) - - if test "$HAVE_SYS_SOCKET_H"; then - AC_MSG_CHECKING([for socklen_t in sys/socket.h]) - AC_EGREP_HEADER([socklen_t], [sys/socket.h], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SOCKLEN], [1], - [Define if the socklen_t typedef is in sys/socket.h])], - AC_MSG_RESULT([no])) - fi - - #-------------------------------------------------------------------- - # Do we need cross-process locking on this platform? - #-------------------------------------------------------------------- - AC_MSG_CHECKING([whether cross-process locking is required by accept()]) - case "`uname -sr`" in - IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0) - AC_MSG_RESULT([yes]) - AC_DEFINE([USE_LOCKING], [1], - [Define if cross-process locking is required by accept()]) - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac - - #-------------------------------------------------------------------- - # Does va_arg(arg, long double) crash the compiler? - # hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler) - #-------------------------------------------------------------------- - AC_MSG_CHECKING([whether va_arg(arg, long double) crashes the compiler]) - AC_TRY_COMPILE([#include ], - [long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);], - AC_MSG_RESULT([no]), - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_VA_ARG_LONG_DOUBLE_BUG], [1], - [Define if va_arg(arg, long double) crashes the compiler])]) - - AC_C_CONST -]) - - -dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro figures out how to build C programs using POSIX -dnl threads. It sets the PTHREAD_LIBS output variable to the threads -dnl library and linker flags, and the PTHREAD_CFLAGS output variable -dnl to any special C compiler flags that are needed. (The user can also -dnl force certain compiler flags/libs to be tested by setting these -dnl environment variables.) -dnl -dnl Also sets PTHREAD_CC to any special C compiler that is needed for -dnl multi-threaded programs (defaults to the value of CC otherwise). -dnl (This is necessary on AIX to use the special cc_r compiler alias.) -dnl -dnl If you are only building threads programs, you may wish to -dnl use these variables in your default LIBS, CFLAGS, and CC: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -dnl CC="$PTHREAD_CC" -dnl -dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute -dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE -dnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a threads -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands -dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, -dnl the default action will define HAVE_PTHREAD. -dnl -dnl Please let the authors know if this macro fails on any platform, -dnl or if you have any other suggestions or comments. This macro was -dnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org) -dnl (with help from M. Frigo), as well as ac_pthread and hb_pthread -dnl macros posted by AFC to the autoconf macro repository. We are also -dnl grateful for the helpful feedback of numerous users. -dnl -dnl @version $Id$ -dnl @author Steven G. Johnson and Alejandro Forero Cuervo - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -acx_pthread_ok=no - -# First, check if the POSIX threads header, pthread.h, is available. -# If it isn't, don't bother looking for the threads libraries. -AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader) - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# pthread: Linux, etcetera -# --thread-safe: KAI C++ - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_TRY_LINK([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: threads are created detached by default - # and the JOINABLE attribute has a nonstandard name (UNDETACHED). - AC_MSG_CHECKING([for joinable pthread attribute]) - AC_TRY_LINK([#include ], - [int attr=PTHREAD_CREATE_JOINABLE;], - ok=PTHREAD_CREATE_JOINABLE, ok=unknown) - if test x"$ok" = xunknown; then - AC_TRY_LINK([#include ], - [int attr=PTHREAD_CREATE_UNDETACHED;], - ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) - fi - if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then - AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, - [Define to the necessary symbol if this constant - uses a non-standard name on your system.]) - fi - AC_MSG_RESULT(${ok}) - if test x"$ok" = xunknown; then - AC_MSG_WARN([we do not know how to create joinable pthreads]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; - *solaris* | alpha*-osf*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: must compile with cc_r - AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi - -])dnl ACX_PTHREAD - - - -dnl @synopsis AC_PROG_CC_WARNINGS([ANSI]) -dnl -dnl Enables a reasonable set of warnings for the C compiler. Optionally, -dnl if the first argument is nonempty, turns on flags which enforce and/or -dnl enable proper ANSI C if such flags are known to the compiler used. -dnl -dnl Currently this macro knows about GCC, Solaris C compiler, -dnl Digital Unix C compiler, C for AIX Compiler, HP-UX C compiler, -dnl and IRIX C compiler. -dnl -dnl @version $Id$ -dnl @author Ville Laurikari -dnl -AC_DEFUN([AC_PROG_CC_WARNINGS], [ - ansi=$1 - if test -z "$ansi"; then - msg="for C compiler warning flags" - else - msg="for C compiler warning and ANSI conformance flags" - fi - AC_CACHE_CHECK($msg, ac_cv_prog_cc_warnings, [ - if test -n "$CC"; then - cat > conftest.c <&1 | grep "Xc.*strict ANSI C" > /dev/null 2>&1 && - $CC -c -v -Xc conftest.c > /dev/null 2>&1 && - test -f conftest.o; then - if test -z "$ansi"; then - ac_cv_prog_cc_warnings="-v" - else - ac_cv_prog_cc_warnings="-v -Xc" - fi - - dnl HP-UX C compiler - elif $CC > /dev/null 2>&1 && - $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 && - test -f conftest.o; then - if test -z "$ansi"; then - ac_cv_prog_cc_warnings="+w1" - else - ac_cv_prog_cc_warnings="+w1 -Aa" - fi - - dnl Digital Unix C compiler - elif ! $CC > /dev/null 2>&1 && - $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 && - test -f conftest.o; then - if test -z "$ansi"; then - ac_cv_prog_cc_warnings="-verbose -w0 -warnprotos" - else - ac_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1" - fi - - dnl C for AIX Compiler - elif $CC > /dev/null 2>&1 | grep AIX > /dev/null 2>&1 && - $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 && - test -f conftest.o; then - if test -z "$ansi"; then - ac_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" - else - ac_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi" - fi - - dnl IRIX C compiler - elif $CC -fullwarn -ansi -ansiE > /dev/null 2>&1 && - test -f conftest.o; then - if test -z "$ansi"; then - ac_cv_prog_cc_warnings="-fullwarn" - else - ac_cv_prog_cc_warnings="-fullwarn -ansi -ansiE" - fi - - fi - rm -f conftest.* - fi - if test -n "$ac_cv_prog_cc_warnings"; then - CFLAGS="$CFLAGS $ac_cv_prog_cc_warnings" - else - ac_cv_prog_cc_warnings="unknown" - fi - ]) -]) - - diff --git a/sapi/cgi/libfcgi/fcgi_stdio.c b/sapi/cgi/libfcgi/fcgi_stdio.c deleted file mode 100644 index 39a56315fd73a..0000000000000 --- a/sapi/cgi/libfcgi/fcgi_stdio.c +++ /dev/null @@ -1,801 +0,0 @@ -/* - * fcgi_stdio.c -- - * - * FastCGI-stdio compatibility package - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - */ - -#ifndef lint -static const char rcsid[] = "$Id$"; -#endif /* not lint */ - -#include /* for errno */ -#include /* for va_arg */ -#include /* for malloc */ -#include /* for strerror */ - -#include "fcgi_config.h" - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef _WIN32 -#define DLLAPI __declspec(dllexport) -#endif - -#include "fcgiapp.h" -#include "fcgios.h" -#include "fcgimisc.h" - -#define NO_FCGI_DEFINES -#include "fcgi_stdio.h" -#undef NO_FCGI_DEFINES - -#ifndef _WIN32 - -extern char **environ; - -#ifdef HAVE_FILENO_PROTO -#include -#else -extern int fileno(FILE *stream); -#endif - -extern FILE *fdopen(int fildes, const char *type); -extern FILE *popen(const char *command, const char *type); -extern int pclose(FILE *stream); - -#else /* _WIN32 */ - -#define popen _popen -#define pclose _pclose - -#endif /* _WIN32 */ - -FCGI_FILE _fcgi_sF[3]; - - -/* - *---------------------------------------------------------------------- - * - * FCGI_Accept -- - * - * Accepts a new request from the HTTP server and creates - * a conventional execution environment for the request. - * - * If the application was invoked as a FastCGI server, - * the first call to FCGI_Accept indicates that the application - * has completed its initialization and is ready to accept - * a request. Subsequent calls to FCGI_Accept indicate that - * the application has completed its processing of the - * current request and is ready to accept a new request. - * - * If the application was invoked as a CGI program, the first - * call to FCGI_Accept is essentially a no-op and the second - * call returns EOF (-1). - * - * Results: - * 0 for successful call, -1 for error (application should exit). - * - * Side effects: - * If the application was invoked as a FastCGI server, - * and this is not the first call to this procedure, - * FCGI_Accept first performs the equivalent of FCGI_Finish. - * - * On every call, FCGI_Accept accepts the new request and - * reads the FCGI_PARAMS stream into an environment array, - * i.e. a NULL-terminated array of strings of the form - * ``name=value''. It assigns a pointer to this array - * to the global variable environ, used by the standard - * library function getenv. It creates new FCGI_FILE *s - * representing input from the HTTP server, output to the HTTP - * server, and error output to the HTTP server, and assigns these - * new files to stdin, stdout, and stderr respectively. - * - * DO NOT mutate or retain pointers to environ or any values - * contained in it (e.g. to the result of calling getenv(3)), - * since these are freed by the next call to FCGI_Finish or - * FCGI_Accept. In particular do not use setenv(3) or putenv(3) - * in conjunction with FCGI_Accept. - * - *---------------------------------------------------------------------- - */ -static int acceptCalled = FALSE; -static int isCGI = FALSE; - -int FCGI_Accept(void) -{ - if(!acceptCalled) { - /* - * First call to FCGI_Accept. Is application running - * as FastCGI or as CGI? - */ - isCGI = FCGX_IsCGI(); - acceptCalled = TRUE; - atexit(&FCGI_Finish); - } else if(isCGI) { - /* - * Not first call to FCGI_Accept and running as CGI means - * application is done. - */ - return(EOF); - } - if(isCGI) { - FCGI_stdin->stdio_stream = stdin; - FCGI_stdin->fcgx_stream = NULL; - FCGI_stdout->stdio_stream = stdout; - FCGI_stdout->fcgx_stream = NULL; - FCGI_stderr->stdio_stream = stderr; - FCGI_stderr->fcgx_stream = NULL; - } else { - FCGX_Stream *in, *out, *error; - FCGX_ParamArray envp; - int acceptResult = FCGX_Accept(&in, &out, &error, &envp); - if(acceptResult < 0) { - return acceptResult; - } - FCGI_stdin->stdio_stream = NULL; - FCGI_stdin->fcgx_stream = in; - FCGI_stdout->stdio_stream = NULL; - FCGI_stdout->fcgx_stream = out; - FCGI_stderr->stdio_stream = NULL; - FCGI_stderr->fcgx_stream = error; - environ = envp; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_Finish -- - * - * Finishes the current request from the HTTP server. - * - * Side effects: - * - * Flushes any buffered output to the HTTP server. Then frees - * all storage allocated by the previous call, including all - * storage reachable from the value of environ set by the previous - * call to FCGI_Accept. - * - * DO NOT use stdin, stdout, stderr, or environ between calling - * FCGI_Finish and calling FCGI_Accept. - * - * DO NOT mutate or retain pointers to environ or any values - * contained in it (e.g. to the result of calling getenv(3)), - * since these are freed by the next call to FCGI_Finish or - * FCGI_Accept. In particular do not use setenv(3) or putenv(3) - * in conjunction with FCGI_Accept. - * - *---------------------------------------------------------------------- - */ -void FCGI_Finish(void) -{ - if(!acceptCalled || isCGI) { - return; - } - FCGX_Finish(); - FCGI_stdin->fcgx_stream = NULL; - FCGI_stdout->fcgx_stream = NULL; - FCGI_stderr->fcgx_stream = NULL; - environ = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_StartFilterData -- - * - * - * The current request is for the filter role, and stdin is - * positioned at EOF of FCGI_STDIN. The call repositions - * stdin to the start of FCGI_DATA. - * If the preconditions are not met (e.g. FCGI_STDIN has not - * been read to EOF), the call sets the stream error code to - * FCGX_CALL_SEQ_ERROR. - * - * Results: - * 0 for a normal return, < 0 for error - * - *---------------------------------------------------------------------- - */ -int FCGI_StartFilterData(void) -{ - if(FCGI_stdin->stdio_stream) { - return -1; - } else { - return FCGX_StartFilterData(FCGI_stdin->fcgx_stream); - } -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_SetExitStatus -- - * - * Sets the exit status for the current request. The exit status - * is the status code the request would have exited with, had - * the request been run as a CGI program. You can call - * FCGI_SetExitStatus several times during a request; the last call - * before the request ends (by calling FCGI_Accept) determines the - * value. - * - *---------------------------------------------------------------------- - */ -void FCGI_SetExitStatus(int status) -{ - if(FCGI_stdin->fcgx_stream) { - FCGX_SetExitStatus(status, FCGI_stdin->fcgx_stream); - } -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_perror -- - * - * Wrapper for function defined in H&S Section 11.2 - * - *---------------------------------------------------------------------- - */ -void FCGI_perror(const char *str) -{ - FCGI_fputs(str, FCGI_stderr); - FCGI_fputs(": ", FCGI_stderr); - FCGI_fputs(strerror(OS_Errno), FCGI_stderr); - return; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_OpenFromFILE -- - * - * Constructs a new FCGI_FILE * from the FILE *stream. - * - * Results: - * NULL if stream == NULL or storage could not be allocated, - * otherwise the new FCGI_FILE *. - * - *---------------------------------------------------------------------- - */ -static FCGI_FILE *FCGI_OpenFromFILE(FILE *stream) -{ - FCGI_FILE *fp; - - if (stream == NULL) - return NULL; - - fp = (FCGI_FILE *) malloc(sizeof(FCGI_FILE)); - if (fp != NULL) - { - fp->stdio_stream = stream; - fp->fcgx_stream = NULL; - } - - return fp; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fopen, FCGI_fclose, FCGI_fflush, FCGI_freopen -- - * - * Wrappers for functions defined in H&S Section 15.2 - * - *---------------------------------------------------------------------- - */ -FCGI_FILE *FCGI_fopen(const char *path, const char *mode) -{ - FILE * file = fopen(path, mode); - FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file); - - if (file && !fcgi_file) - fclose(file); - - return fcgi_file; -} - -int FCGI_fclose(FCGI_FILE *fp) -{ - int n = EOF; - if(fp->stdio_stream) { - n = fclose(fp->stdio_stream); - fp->stdio_stream = NULL; - } else if(fp->fcgx_stream) { - n = FCGX_FClose(fp->fcgx_stream); - fp->fcgx_stream = NULL; - } - if((fp != FCGI_stdin) && (fp != FCGI_stdout) && (fp != FCGI_stderr)) { - free(fp); - } - return n; -} - -int FCGI_fflush(FCGI_FILE *fp) -{ - if(fp == NULL) - return fflush(NULL); - if(fp->stdio_stream) - return fflush(fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_FFlush(fp->fcgx_stream); - return EOF; -} - -FCGI_FILE *FCGI_freopen(const char *path, const char *mode, - FCGI_FILE *fp) -{ - if(fp->stdio_stream) { - if(freopen(path, mode, fp->stdio_stream) == NULL) - return NULL; - else - return fp; - } else if(fp->fcgx_stream) { - (void) FCGX_FClose(fp->fcgx_stream); - fp->stdio_stream = fopen(path, mode); - if(fp->stdio_stream == NULL) - return NULL; - else { - fp->fcgx_stream = NULL; - return fp; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_setvbuf, FCGI_setbuf -- - * - * Wrappers for functions defined in H&S Section 15.3 - * - *---------------------------------------------------------------------- - */ -int FCGI_setvbuf(FCGI_FILE *fp, char *buf, int bufmode, size_t size) -{ - if(fp->stdio_stream) - return setvbuf(fp->stdio_stream, buf, bufmode, size); - else { - return -1; - } -} - -void FCGI_setbuf(FCGI_FILE *fp, char *buf) -{ - if(fp->stdio_stream) - setbuf(fp->stdio_stream, buf); -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fseek, FCGI_ftell, FCGI_rewind, FCGI_fgetpos, FCGI_fsetpos -- - * - * Wrappers for functions defined in H&S Section 15.5 - * - *---------------------------------------------------------------------- - */ -int FCGI_fseek(FCGI_FILE *fp, long offset, int whence) -{ - if(fp->stdio_stream) - return fseek(fp->stdio_stream, offset, whence); - else { - OS_SetErrno(ESPIPE); - return -1; - } -} - -int FCGI_ftell(FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return ftell(fp->stdio_stream); - else { - OS_SetErrno(ESPIPE); - return -1; - } -} - -void FCGI_rewind(FCGI_FILE *fp) -{ - if(fp->stdio_stream) - rewind(fp->stdio_stream); - else - OS_SetErrno(ESPIPE); -} - -#ifdef HAVE_FPOS -int FCGI_fgetpos(FCGI_FILE *fp, fpos_t *pos) -{ - if(fp->stdio_stream) - return fgetpos(fp->stdio_stream, pos); - else { - OS_SetErrno(ESPIPE); - return -1; - } -} - -int FCGI_fsetpos(FCGI_FILE *fp, const fpos_t *pos) -{ - if(fp->stdio_stream) - return fsetpos(fp->stdio_stream, pos); - else { - OS_SetErrno(ESPIPE); - return -1; - } -} -#endif - -/* - *---------------------------------------------------------------------- - * - * FCGI_fgetc, FCGI_getchar, FCGI_ungetc -- - * - * Wrappers for functions defined in H&S Section 15.6 - * - * XXX: getc and getchar are generally defined as macros - * for performance reasons - * - *---------------------------------------------------------------------- - */ -int FCGI_fgetc(FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return fgetc(fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_GetChar(fp->fcgx_stream); - return EOF; -} - -int FCGI_getchar(void) -{ - return FCGI_fgetc(FCGI_stdin); -} - -int FCGI_ungetc(int c, FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return ungetc(c, fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_UnGetChar(c, fp->fcgx_stream); - return EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fgets, FCGI_gets -- - * - * Wrappers for functions defined in H&S Section 15.7 - * - *---------------------------------------------------------------------- - */ -char *FCGI_fgets(char *str, int size, FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return fgets(str, size, fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_GetLine(str, size, fp->fcgx_stream); - return NULL; -} - -/* - * The gets() function reads characters from the standard input stream - * into the array pointed to by str until a newline character is read - * or an end-of-file condition is encountered. The newline character - * is discarded and the string is terminated with a null character. - */ -char *FCGI_gets(char *str) -{ - char *s; - int c; - - for (s = str; ((c = FCGI_getchar()) != '\n');) { - if(c == EOF) { - if(s == str) - return NULL; - else - break; - } else - *s++ = (char) c; - } - *s = 0; - return str; -} - -/* - *---------------------------------------------------------------------- - * - * Wrappers for functions defined in H&S Section 15.8 - * - * XXX: missing: fscanf, scanf - * - *---------------------------------------------------------------------- - */ - -/* - *---------------------------------------------------------------------- - * - * FCGI_fputc, FCGI_putchar -- - * - * Wrappers for functions defined in H&S Section 15.9 - * - * XXX: putc and putchar are generally defined as macros - * for performance reasons - * - *---------------------------------------------------------------------- - */ -int FCGI_fputc(int c, FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return fputc(c, fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_PutChar(c, fp->fcgx_stream); - else return EOF; -} - -int FCGI_putchar(int c) -{ - return FCGI_fputc(c, FCGI_stdout); -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fputs, FCGI_puts - * - * Wrappers for functions defined in H&S Section 15.10 - * - *---------------------------------------------------------------------- - */ -int FCGI_fputs(const char *str, FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return fputs(str, fp->stdio_stream); - else if(fp->fcgx_stream) - return FCGX_PutS(str, fp->fcgx_stream); - return EOF; -} - -int FCGI_puts(const char *str) -{ - int n; - if(FCGI_stdout->stdio_stream) { - n = fputs(str, FCGI_stdout->stdio_stream); - if(n < 0) - return n; - else - return fputc('\n', FCGI_stdout->stdio_stream); - } else if(FCGI_stdout->fcgx_stream) { - n = FCGX_PutS(str, FCGI_stdout->fcgx_stream); - if(n < 0) - return n; - else - return FCGX_PutChar('\n', FCGI_stdout->fcgx_stream); - } - return EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fprintf, FCGI_printf -- - * - * Wrappers for functions defined in H&S Section 15.11 - * - *---------------------------------------------------------------------- - */ -int FCGI_fprintf(FCGI_FILE *fp, const char *format, ...) -{ - va_list ap; - int n = 0; - va_start(ap, format); - if(fp->stdio_stream) - n = vfprintf(fp->stdio_stream, format, ap); - else if(fp->fcgx_stream) - n = FCGX_VFPrintF(fp->fcgx_stream, format, ap); - va_end(ap); - return n; -} - -int FCGI_printf(const char *format, ...) -{ - va_list ap; - int n; - va_start(ap, format); - n = FCGI_vfprintf(FCGI_stdout, format, ap); - va_end(ap); - return n; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_vfprintf, FCGI_vprintf -- - * - * Wrappers for functions defined in H&S Section 15.12 - * - *---------------------------------------------------------------------- - */ -int FCGI_vfprintf(FCGI_FILE *fp, const char *format, va_list ap) -{ - if(fp->stdio_stream) - return vfprintf(fp->stdio_stream, format, ap); - else if(fp->fcgx_stream) - return FCGX_VFPrintF(fp->fcgx_stream, format, ap); - return EOF; -} - -int FCGI_vprintf(const char *format, va_list ap) -{ - if(FCGI_stdout->stdio_stream) - return vfprintf(FCGI_stdout->stdio_stream, format, ap); - else if(FCGI_stdout->fcgx_stream) - return FCGX_VFPrintF(FCGI_stdout->fcgx_stream, format, ap); - return EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fread, FCGI_fwrite -- - * - * Wrappers for functions defined in H&S Section 15.13 - * - *---------------------------------------------------------------------- - */ -size_t FCGI_fread(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp) -{ - int n; - if(fp->stdio_stream) - return fread(ptr, size, nmemb, fp->stdio_stream); - else if(fp->fcgx_stream) { - if((size * nmemb) == 0) { - return 0; - } - n = FCGX_GetStr((char *) ptr, size * nmemb, fp->fcgx_stream); - return (n/size); - } - return (size_t)EOF; -} - -size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp) -{ - int n; - if(fp->stdio_stream) - return fwrite(ptr, size, nmemb, fp->stdio_stream); - else if(fp->fcgx_stream) { - if((size * nmemb) == 0) { - return 0; - } - n = FCGX_PutStr((char *) ptr, size * nmemb, fp->fcgx_stream); - return (n/size); - } - return (size_t)EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_feof, FCGI_ferror, FCGI_clearerr -- - * - * Wrappers for functions defined in H&S Section 15.14 - * - *---------------------------------------------------------------------- - */ -int FCGI_feof(FCGI_FILE *fp) -{ - if(fp->stdio_stream) { - return feof(fp->stdio_stream); - } else if (fp->fcgx_stream){ - return FCGX_HasSeenEOF(fp->fcgx_stream); - } - return -1; - -} - -int FCGI_ferror(FCGI_FILE *fp) -{ - if(fp->stdio_stream) { - return ferror(fp->stdio_stream); - } else if(fp->fcgx_stream) { - return FCGX_GetError(fp->fcgx_stream); - } - return -1; -} - -void FCGI_clearerr(FCGI_FILE *fp) -{ - if(fp->stdio_stream) { - clearerr(fp->stdio_stream); - } else if(fp->fcgx_stream) { - FCGX_ClearError(fp->fcgx_stream); - } - return; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_tmpfile -- - * - * Wrappers for function defined in H&S Section 15.16 - * - *---------------------------------------------------------------------- - */ -FCGI_FILE *FCGI_tmpfile(void) -{ - FILE * file = tmpfile(); - FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file); - - if (file && !fcgi_file) - fclose(file); - - return fcgi_file; -} - -/* - *---------------------------------------------------------------------- - * - * FCGI_fileno, FCGI_fdopen, FCGI_popen, FCGI_pclose -- - * - * Wrappers for POSIX, X/OPEN functions not in ISO C - * - *---------------------------------------------------------------------- - */ -int FCGI_fileno(FCGI_FILE *fp) -{ - if(fp->stdio_stream) - return fileno(fp->stdio_stream); - else - return -1; -} - -FCGI_FILE *FCGI_fdopen(int fd, const char *mode) -{ - FILE * file = fdopen(fd, mode); - FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file); - - if (file && !fcgi_file) - fclose(file); - - return fcgi_file; -} - -FCGI_FILE *FCGI_popen(const char *cmd, const char *type) -{ - FILE * file = popen(cmd, type); - FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file); - - if (file && !fcgi_file) - pclose(file); - - return fcgi_file; -} - -int FCGI_pclose(FCGI_FILE *fp) -{ - int n = EOF; - if (fp->stdio_stream) { - n = pclose(fp->stdio_stream); - fp->stdio_stream = NULL; - } else if(fp->fcgx_stream) { - /* - * The caller is deeply confused; don't free the storage. - */ - return EOF; - } - if((fp != FCGI_stdin) && (fp != FCGI_stdout) && (fp != FCGI_stderr)) { - free(fp); - } - return n; -} diff --git a/sapi/cgi/libfcgi/fcgiapp.c b/sapi/cgi/libfcgi/fcgiapp.c deleted file mode 100644 index cc57c93c7ed11..0000000000000 --- a/sapi/cgi/libfcgi/fcgiapp.c +++ /dev/null @@ -1,2323 +0,0 @@ -/* - * fcgiapp.c -- - * - * FastCGI application library: request-at-a-time - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - */ -#ifndef lint -static const char rcsid[] = "$Id$"; -#endif /* not lint */ - -#include -#include -#include /* for fcntl */ -#include -#include /* for memchr() */ -#include -#include -#include -#include -#include - -#include "fcgi_config.h" - -#ifdef HAVE_SYS_SOCKET_H -#include /* for getpeername */ -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif - -#ifdef _WIN32 -#define DLLAPI __declspec(dllexport) -#endif - -#include "fcgimisc.h" -#include "fastcgi.h" -#include "fcgios.h" -#include "fcgiapp.h" - -/* - * This is a workaround for one version of the HP C compiler - * (c89 on HP-UX 9.04, also Stratus FTX), which will dump core - * if given 'long double' for varargs. - */ -#ifdef HAVE_VA_ARG_LONG_DOUBLE_BUG -#define LONG_DOUBLE double -#else -#define LONG_DOUBLE long double -#endif - -/* - * Globals - */ -static int libInitialized = 0; -static int isFastCGI = -1; -static char *webServerAddressList = NULL; -static FCGX_Request the_request; -void _FCGX_FreeStream(FCGX_Stream **streamPtr, int freeData); - -void FCGX_ShutdownPending(void) -{ - OS_ShutdownPending(); -} - -static void *Malloc(size_t size) -{ - void *result = malloc(size); - ASSERT(size == 0 || result != NULL); - return result; -} - -static char *StringCopy(char *str) -{ - int strLen = strlen(str); - char *newString = (char *)Malloc(strLen + 1); - memcpy(newString, str, strLen); - newString[strLen] = '\000'; - return newString; -} - - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetChar -- - * - * Reads a byte from the input stream and returns it. - * - * Results: - * The byte, or EOF (-1) if the end of input has been reached. - * - *---------------------------------------------------------------------- - */ -int FCGX_GetChar(FCGX_Stream *stream) -{ - if(stream->rdNext != stream->stop) - return *stream->rdNext++; - if(stream->isClosed || !stream->isReader) - return EOF; - stream->fillBuffProc(stream); - stream->stopUnget = stream->rdNext; - if(stream->rdNext != stream->stop) - return *stream->rdNext++; - ASSERT(stream->isClosed); /* bug in fillBufProc if not */ - return EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetStr -- - * - * Reads up to n consecutive bytes from the input stream - * into the character array str. Performs no interpretation - * of the input bytes. - * - * Results: - * Number of bytes read. If result is smaller than n, - * the end of input has been reached. - * - *---------------------------------------------------------------------- - */ -int FCGX_GetStr(char *str, int n, FCGX_Stream *stream) -{ - int m, bytesMoved; - - if(n <= 0) { - return 0; - } - /* - * Fast path: n bytes are already available - */ - if(n <= (stream->stop - stream->rdNext)) { - memcpy(str, stream->rdNext, n); - stream->rdNext += n; - return n; - } - /* - * General case: stream is closed or buffer fill procedure - * needs to be called - */ - bytesMoved = 0; - for (;;) { - if(stream->rdNext != stream->stop) { - m = min(n - bytesMoved, stream->stop - stream->rdNext); - memcpy(str, stream->rdNext, m); - bytesMoved += m; - stream->rdNext += m; - if(bytesMoved == n) - return bytesMoved; - str += m; - } - if(stream->isClosed || !stream->isReader) - return bytesMoved; - stream->fillBuffProc(stream); - stream->stopUnget = stream->rdNext; - } -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetLine -- - * - * Reads up to n-1 consecutive bytes from the input stream - * into the character array str. Stops before n-1 bytes - * have been read if '\n' or EOF is read. The terminating '\n' - * is copied to str. After copying the last byte into str, - * stores a '\0' terminator. - * - * Results: - * NULL if EOF is the first thing read from the input stream, - * str otherwise. - * - *---------------------------------------------------------------------- - */ -char *FCGX_GetLine(char *str, int n, FCGX_Stream *stream) -{ - int c; - char *p = str; - - n--; - while (n > 0) { - c = FCGX_GetChar(stream); - if(c == EOF) { - if(p == str) - return NULL; - else - break; - } - *p++ = (char) c; - n--; - if(c == '\n') - break; - } - *p = '\0'; - return str; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_UnGetChar -- - * - * Pushes back the character c onto the input stream. One - * character of pushback is guaranteed once a character - * has been read. No pushback is possible for EOF. - * - * Results: - * Returns c if the pushback succeeded, EOF if not. - * - *---------------------------------------------------------------------- - */ -int FCGX_UnGetChar(int c, FCGX_Stream *stream) { - if(c == EOF - || stream->isClosed - || !stream->isReader - || stream->rdNext == stream->stopUnget) - return EOF; - --(stream->rdNext); - *stream->rdNext = (unsigned char) c; - return c; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_HasSeenEOF -- - * - * Returns EOF if end-of-file has been detected while reading - * from stream; otherwise returns 0. - * - * Note that FCGX_HasSeenEOF(s) may return 0, yet an immediately - * following FCGX_GetChar(s) may return EOF. This function, like - * the standard C stdio function feof, does not provide the - * ability to peek ahead. - * - * Results: - * EOF if end-of-file has been detected, 0 if not. - * - *---------------------------------------------------------------------- - */ -int FCGX_HasSeenEOF(FCGX_Stream *stream) { - return (stream->isClosed) ? EOF : 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutChar -- - * - * Writes a byte to the output stream. - * - * Results: - * The byte, or EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_PutChar(int c, FCGX_Stream *stream) -{ - if(stream->wrNext != stream->stop) - return (*stream->wrNext++ = (unsigned char) c); - if(stream->isClosed || stream->isReader) - return EOF; - stream->emptyBuffProc(stream, FALSE); - if(stream->wrNext != stream->stop) - return (*stream->wrNext++ = (unsigned char) c); - ASSERT(stream->isClosed); /* bug in emptyBuffProc if not */ - return EOF; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutStr -- - * - * Writes n consecutive bytes from the character array str - * into the output stream. Performs no interpretation - * of the output bytes. - * - * Results: - * Number of bytes written (n) for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_PutStr(const char *str, int n, FCGX_Stream *stream) -{ - int m, bytesMoved; - - /* - * Fast path: room for n bytes in the buffer - */ - if(n <= (stream->stop - stream->wrNext)) { - memcpy(stream->wrNext, str, n); - stream->wrNext += n; - return n; - } - /* - * General case: stream is closed or buffer empty procedure - * needs to be called - */ - bytesMoved = 0; - for (;;) { - if(stream->wrNext != stream->stop) { - m = min(n - bytesMoved, stream->stop - stream->wrNext); - memcpy(stream->wrNext, str, m); - bytesMoved += m; - stream->wrNext += m; - if(bytesMoved == n) - return bytesMoved; - str += m; - } - if(stream->isClosed || stream->isReader) - return -1; - stream->emptyBuffProc(stream, FALSE); - } -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutS -- - * - * Writes a character string to the output stream. - * - * Results: - * number of bytes written for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_PutS(const char *str, FCGX_Stream *stream) -{ - return FCGX_PutStr(str, strlen(str), stream); -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_FPrintF -- - * - * Performs output formatting and writes the results - * to the output stream. - * - * Results: - * number of bytes written for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_FPrintF(FCGX_Stream *stream, const char *format, ...) -{ - int result; - va_list ap; - va_start(ap, format); - result = FCGX_VFPrintF(stream, format, ap); - va_end(ap); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_VFPrintF -- - * - * Performs output formatting and writes the results - * to the output stream. - * - * Results: - * number of bytes written for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ - -#define PRINTF_BUFFLEN 100 - /* - * More than sufficient space for all unmodified conversions - * except %s and %f. - */ -#define FMT_BUFFLEN 25 - /* - * Max size of a format specifier is 1 + 5 + 7 + 7 + 2 + 1 + slop - */ -static void CopyAndAdvance(char **destPtr, char **srcPtr, int n); - -int FCGX_VFPrintF(FCGX_Stream *stream, const char *format, va_list arg) -{ - char *f, *fStop, *percentPtr, *p, *fmtBuffPtr, *buffPtr; - int op, performedOp, sizeModifier, buffCount = 0, buffLen, specifierLength; - int fastPath, n, auxBuffLen = 0, buffReqd, minWidth, precision, exp; - char *auxBuffPtr = NULL; - int streamCount = 0; - char fmtBuff[FMT_BUFFLEN]; - char buff[PRINTF_BUFFLEN]; - - int intArg; - short shortArg; - long longArg; - unsigned unsignedArg; - unsigned long uLongArg; - unsigned short uShortArg; - char *charPtrArg = NULL; - void *voidPtrArg; - int *intPtrArg; - long *longPtrArg; - short *shortPtrArg; - double doubleArg = 0.0; - LONG_DOUBLE lDoubleArg = 0.0L; - - fmtBuff[0] = '%'; - f = (char *) format; - fStop = f + strlen(f); - while (f != fStop) { - percentPtr = (char *)memchr(f, '%', fStop - f); - if(percentPtr == NULL) percentPtr = fStop; - if(percentPtr != f) { - if(FCGX_PutStr(f, percentPtr - f, stream) < 0) - goto ErrorReturn; - streamCount += percentPtr - f; - f = percentPtr; - if(f == fStop) break; - } - fastPath = TRUE; - /* - * The following loop always executes either once or twice. - */ - for (;;) { - if(fastPath) { - /* - * Fast path: Scan optimistically, hoping that no flags, - * minimum field width, or precision are specified. - * Use the preallocated buffer, which is large enough - * for all fast path cases. If the conversion specifier - * is really more complex, run the loop a second time - * using the slow path. - * Note that fast path execution of %s bypasses the buffer - * and %f is not attempted on the fast path due to - * its large buffering requirements. - */ - op = *(percentPtr + 1); - switch(op) { - case 'l': - case 'L': - case 'h': - sizeModifier = op; - op = *(percentPtr + 2); - fmtBuff[1] = (char) sizeModifier; - fmtBuff[2] = (char) op; - fmtBuff[3] = '\0'; - specifierLength = 3; - break; - default: - sizeModifier = ' '; - fmtBuff[1] = (char) op; - fmtBuff[2] = '\0'; - specifierLength = 2; - break; - } - buffPtr = buff; - buffLen = PRINTF_BUFFLEN; - } else { - /* - * Slow path: Scan the conversion specifier and construct - * a new format string, compute an upper bound on the - * amount of buffering that sprintf will require, - * and allocate a larger buffer if necessary. - */ - p = percentPtr + 1; - fmtBuffPtr = &fmtBuff[1]; - /* - * Scan flags - */ - n = strspn(p, "-0+ #"); - if(n > 5) - goto ErrorReturn; - CopyAndAdvance(&fmtBuffPtr, &p, n); - /* - * Scan minimum field width - */ - n = strspn(p, "0123456789"); - if(n == 0) { - if(*p == '*') { - minWidth = va_arg(arg, int); - if(abs(minWidth) > 999999) - goto ErrorReturn; - /* - * The following use of strlen rather than the - * value returned from sprintf is because SUNOS4 - * returns a char * instead of an int count. - */ - sprintf(fmtBuffPtr, "%d", minWidth); - fmtBuffPtr += strlen(fmtBuffPtr); - p++; - } else { - minWidth = 0; - } - } else if(n <= 6) { - minWidth = strtol(p, NULL, 10); - CopyAndAdvance(&fmtBuffPtr, &p, n); - } else { - goto ErrorReturn; - } - /* - * Scan precision - */ - if(*p == '.') { - CopyAndAdvance(&fmtBuffPtr, &p, 1); - n = strspn(p, "0123456789"); - if(n == 0) { - if(*p == '*') { - precision = va_arg(arg, int); - if(precision < 0) precision = 0; - if(precision > 999999) - goto ErrorReturn; - /* - * The following use of strlen rather than the - * value returned from sprintf is because SUNOS4 - * returns a char * instead of an int count. - */ - sprintf(fmtBuffPtr, "%d", precision); - fmtBuffPtr += strlen(fmtBuffPtr); - p++; - } else { - precision = 0; - } - } else if(n <= 6) { - precision = strtol(p, NULL, 10); - CopyAndAdvance(&fmtBuffPtr, &p, n); - } else { - goto ErrorReturn; - } - } else { - precision = -1; - } - /* - * Scan size modifier and conversion operation - */ - switch(*p) { - case 'l': - case 'L': - case 'h': - sizeModifier = *p; - CopyAndAdvance(&fmtBuffPtr, &p, 1); - break; - default: - sizeModifier = ' '; - break; - } - op = *p; - CopyAndAdvance(&fmtBuffPtr, &p, 1); - ASSERT(fmtBuffPtr - fmtBuff < FMT_BUFFLEN); - *fmtBuffPtr = '\0'; - specifierLength = p - percentPtr; - /* - * Bound the required buffer size. For s and f - * conversions this requires examining the argument. - */ - switch(op) { - case 'd': - case 'i': - case 'u': - case 'o': - case 'x': - case 'X': - case 'c': - case 'p': - buffReqd = max(precision, 46); - break; - case 's': - charPtrArg = va_arg(arg, char *); - if (!charPtrArg) charPtrArg = "(null)"; - if(precision == -1) { - buffReqd = strlen(charPtrArg); - } else { - p = (char *)memchr(charPtrArg, '\0', precision); - buffReqd = - (p == NULL) ? precision : p - charPtrArg; - } - break; - case 'f': - switch(sizeModifier) { - case ' ': - doubleArg = va_arg(arg, double); - frexp(doubleArg, &exp); - break; - case 'L': - lDoubleArg = va_arg(arg, LONG_DOUBLE); - /* XXX Need to check for the presence of - * frexpl() and use it if available */ - frexp((double) lDoubleArg, &exp); - break; - default: - goto ErrorReturn; - } - if(precision == -1) precision = 6; - buffReqd = precision + 3 + ((exp > 0) ? exp/3 : 0); - break; - case 'e': - case 'E': - case 'g': - case 'G': - if(precision == -1) precision = 6; - buffReqd = precision + 8; - break; - case 'n': - case '%': - default: - goto ErrorReturn; - break; - } - buffReqd = max(buffReqd + 10, minWidth); - /* - * Allocate the buffer - */ - if(buffReqd <= PRINTF_BUFFLEN) { - buffPtr = buff; - buffLen = PRINTF_BUFFLEN; - } else { - if(auxBuffPtr == NULL || buffReqd > auxBuffLen) { - if(auxBuffPtr != NULL) free(auxBuffPtr); - auxBuffPtr = (char *)Malloc(buffReqd); - auxBuffLen = buffReqd; - if(auxBuffPtr == NULL) - goto ErrorReturn; - } - buffPtr = auxBuffPtr; - buffLen = auxBuffLen; - } - } - /* - * This giant switch statement requires the following variables - * to be set up: op, sizeModifier, arg, buffPtr, fmtBuff. - * When fastPath == FALSE and op == 's' or 'f', the argument - * has been read into charPtrArg, doubleArg, or lDoubleArg. - * The statement produces the boolean performedOp, TRUE iff - * the op/sizeModifier were executed and argument consumed; - * if performedOp, the characters written into buffPtr[] - * and the character count buffCount (== EOF meaning error). - * - * The switch cases are arranged in the same order as in the - * description of fprintf in section 15.11 of Harbison and Steele. - */ - performedOp = TRUE; - switch(op) { - case 'd': - case 'i': - switch(sizeModifier) { - case ' ': - intArg = va_arg(arg, int); - sprintf(buffPtr, fmtBuff, intArg); - buffCount = strlen(buffPtr); - break; - case 'l': - longArg = va_arg(arg, long); - sprintf(buffPtr, fmtBuff, longArg); - buffCount = strlen(buffPtr); - break; - case 'h': - shortArg = (short) va_arg(arg, int); - sprintf(buffPtr, fmtBuff, shortArg); - buffCount = strlen(buffPtr); - break; - default: - goto ErrorReturn; - } - break; - case 'u': - case 'o': - case 'x': - case 'X': - switch(sizeModifier) { - case ' ': - unsignedArg = va_arg(arg, unsigned); - sprintf(buffPtr, fmtBuff, unsignedArg); - buffCount = strlen(buffPtr); - break; - case 'l': - uLongArg = va_arg(arg, unsigned long); - sprintf(buffPtr, fmtBuff, uLongArg); - buffCount = strlen(buffPtr); - break; - case 'h': - uShortArg = (unsigned short) va_arg(arg, int); - sprintf(buffPtr, fmtBuff, uShortArg); - buffCount = strlen(buffPtr); - break; - default: - goto ErrorReturn; - } - break; - case 'c': - switch(sizeModifier) { - case ' ': - intArg = va_arg(arg, int); - sprintf(buffPtr, fmtBuff, intArg); - buffCount = strlen(buffPtr); - break; - case 'l': - /* - * XXX: Allowed by ISO C Amendment 1, but - * many platforms don't yet support wint_t - */ - goto ErrorReturn; - default: - goto ErrorReturn; - } - break; - case 's': - switch(sizeModifier) { - case ' ': - if(fastPath) { - buffPtr = va_arg(arg, char *); - buffCount = strlen(buffPtr); - buffLen = buffCount + 1; - } else { - sprintf(buffPtr, fmtBuff, charPtrArg); - buffCount = strlen(buffPtr); - } - break; - case 'l': - /* - * XXX: Don't know how to convert a sequence - * of wide characters into a byte stream, or - * even how to predict the buffering required. - */ - goto ErrorReturn; - default: - goto ErrorReturn; - } - break; - case 'p': - if(sizeModifier != ' ') - goto ErrorReturn; - voidPtrArg = va_arg(arg, void *); - sprintf(buffPtr, fmtBuff, voidPtrArg); - buffCount = strlen(buffPtr); - break; - case 'n': - switch(sizeModifier) { - case ' ': - intPtrArg = va_arg(arg, int *); - *intPtrArg = streamCount; - break; - case 'l': - longPtrArg = va_arg(arg, long *); - *longPtrArg = streamCount; - break; - case 'h': - shortPtrArg = (short *) va_arg(arg, short *); - *shortPtrArg = (short) streamCount; - break; - default: - goto ErrorReturn; - } - buffCount = 0; - break; - case 'f': - if(fastPath) { - performedOp = FALSE; - break; - } - switch(sizeModifier) { - case ' ': - sprintf(buffPtr, fmtBuff, doubleArg); - buffCount = strlen(buffPtr); - break; - case 'L': - sprintf(buffPtr, fmtBuff, lDoubleArg); - buffCount = strlen(buffPtr); - break; - default: - goto ErrorReturn; - } - break; - case 'e': - case 'E': - case 'g': - case 'G': - switch(sizeModifier) { - case ' ': - doubleArg = va_arg(arg, double); - sprintf(buffPtr, fmtBuff, doubleArg); - buffCount = strlen(buffPtr); - break; - case 'L': - lDoubleArg = va_arg(arg, LONG_DOUBLE); - sprintf(buffPtr, fmtBuff, lDoubleArg); - buffCount = strlen(buffPtr); - break; - default: - goto ErrorReturn; - } - break; - case '%': - if(sizeModifier != ' ') - goto ErrorReturn; - buff[0] = '%'; - buffCount = 1; - break; - case '\0': - goto ErrorReturn; - default: - performedOp = FALSE; - break; - } /* switch(op) */ - if(performedOp) break; - if(!fastPath) - goto ErrorReturn; - fastPath = FALSE; - } /* for (;;) */ - ASSERT(buffCount < buffLen); - if(buffCount > 0) { - if(FCGX_PutStr(buffPtr, buffCount, stream) < 0) - goto ErrorReturn; - streamCount += buffCount; - } else if(buffCount < 0) { - goto ErrorReturn; - } - f += specifierLength; - } /* while(f != fStop) */ - goto NormalReturn; - ErrorReturn: - streamCount = -1; - NormalReturn: - if(auxBuffPtr != NULL) free(auxBuffPtr); - return streamCount; -} - -/* - * Copy n characters from *srcPtr to *destPtr, then increment - * both *srcPtr and *destPtr by n. - */ -static void CopyAndAdvance(char **destPtr, char **srcPtr, int n) -{ - char *dest = *destPtr; - char *src = *srcPtr; - int i; - for (i = 0; i < n; i++) - *dest++ = *src++; - *destPtr = dest; - *srcPtr = src; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_FFlush -- - * - * Flushes any buffered output. - * - * Server-push is a legitimate application of FCGX_FFlush. - * Otherwise, FCGX_FFlush is not very useful, since FCGX_Accept - * does it implicitly. FCGX_FFlush may reduce performance - * by increasing the total number of operating system calls - * the application makes. - * - * Results: - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_FFlush(FCGX_Stream *stream) -{ - if(!stream || stream->isClosed || stream->isReader) - return 0; - stream->emptyBuffProc(stream, FALSE); - return (stream->isClosed) ? -1 : 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_FClose -- - * - * Performs FCGX_FFlush and closes the stream. - * - * This is not a very useful operation, since FCGX_Accept - * does it implicitly. Closing the out stream before the - * err stream results in an extra write if there's nothing - * in the err stream, and therefore reduces performance. - * - * Results: - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -int FCGX_FClose(FCGX_Stream *stream) -{ - if (stream == NULL) return 0; - - if(!stream->wasFCloseCalled) { - if(!stream->isReader) { - stream->emptyBuffProc(stream, TRUE); - } - stream->wasFCloseCalled = TRUE; - stream->isClosed = TRUE; - if(stream->isReader) { - stream->wrNext = stream->stop = stream->rdNext; - } else { - stream->rdNext = stream->stop = stream->wrNext; - } - } - return (stream->FCGI_errno == 0) ? 0 : EOF; -} - -/* - *---------------------------------------------------------------------- - * - * SetError -- - * - * An error has occurred; save the error code in the stream - * for diagnostic purposes and set the stream state so that - * reads return EOF and writes have no effect. - * - *---------------------------------------------------------------------- - */ -static void SetError(FCGX_Stream *stream, int FCGI_errno) -{ - /* - * Preserve only the first error. - */ - if(stream->FCGI_errno == 0) { - stream->FCGI_errno = FCGI_errno; - stream->isClosed = TRUE; - } -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetError -- - * - * Return the stream error code. 0 means no error, > 0 - * is an errno(2) error, < 0 is an FCGX_errno error. - * - *---------------------------------------------------------------------- - */ -int FCGX_GetError(FCGX_Stream *stream) { - return stream->FCGI_errno; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_ClearError -- - * - * Clear the stream error code and end-of-file indication. - * - *---------------------------------------------------------------------- - */ -void FCGX_ClearError(FCGX_Stream *stream) { - stream->FCGI_errno = 0; - /* - * stream->isClosed = FALSE; - * XXX: should clear isClosed but work is needed to make it safe - * to do so. For example, if an application calls FClose, gets - * an I/O error on the write, calls ClearError and retries - * the FClose, FClose (really EmptyBuffProc) will write a second - * EOF record. If an application calls PutChar instead of FClose - * after the ClearError, the application will write more data. - * The stream's state must discriminate between various states - * of the stream that are now all lumped under isClosed. - */ -} - - - -/* - *---------------------------------------------------------------------- - * - * NewParams -- - * - * Creates a new Params structure. - * - * Results: - * Pointer to the new structure. - * - *---------------------------------------------------------------------- - */ -static ParamsPtr NewParams(int length) -{ - ParamsPtr result; - result = (Params *)Malloc(sizeof(Params)); - result->vec = (char **)Malloc(length * sizeof(char *)); - result->length = length; - result->cur = result->vec; - *result->cur = NULL; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * FreeParams -- - * - * Frees a Params structure and all the parameters it contains. - * - * Side effects: - * env becomes invalid. - * - *---------------------------------------------------------------------- - */ -static void FreeParams(ParamsPtr *paramsPtrPtr) -{ - ParamsPtr paramsPtr = *paramsPtrPtr; - char **p; - if(paramsPtr == NULL) { - return; - } - for (p = paramsPtr->vec; p < paramsPtr->cur; p++) { - free(*p); - } - free(paramsPtr->vec); - free(paramsPtr); - *paramsPtrPtr = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * PutParam -- - * - * Add a name/value pair to a Params structure. - * - * Results: - * None. - * - * Side effects: - * Parameters structure updated. - * - *---------------------------------------------------------------------- - */ -static void PutParam(ParamsPtr paramsPtr, char *nameValue) -{ - int size; - - *paramsPtr->cur++ = nameValue; - size = paramsPtr->cur - paramsPtr->vec; - if(size >= paramsPtr->length) { - paramsPtr->length *= 2; - paramsPtr->vec = (FCGX_ParamArray)realloc(paramsPtr->vec, paramsPtr->length * sizeof(char *)); - paramsPtr->cur = paramsPtr->vec + size; - } - *paramsPtr->cur = NULL; -} - - -void FCGX_PutEnv(FCGX_Request *request, char *var) -{ - char *nameValue; - char *e, **p; - int len; - - if (!strchr(var,'=')) { - return; - } - nameValue = StringCopy(var); - e = strchr(nameValue,'='); - *e = 0; - - /* find the name and replace it */ - len = strlen(nameValue); - - for (p = request->envp; p && *p; ++p) { - if((strncmp(nameValue, *p, len) == 0) && ((*p)[len] == '=')) { - free(*p); - *e = '='; - *p = nameValue; - return; - } - } - *e = '='; - /* this is a new var, add it to the environment */ - PutParam(request->paramsPtr,nameValue); - request->envp = request->paramsPtr->vec; -} - - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetParam -- obtain value of FCGI parameter in environment - * - * - * Results: - * Value bound to name, NULL if name not present in the - * environment envp. Caller must not mutate the result - * or retain it past the end of this request. - * - *---------------------------------------------------------------------- - */ -char *FCGX_GetParam(const char *name, FCGX_ParamArray envp) -{ - int len; - char **p; - - if (name == NULL || envp == NULL) return NULL; - - len = strlen(name); - - for (p = envp; p && *p; ++p) { - if((strncmp(name, *p, len) == 0) && ((*p)[len] == '=')) { - return *p+len+1; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Start of FastCGI-specific code - * - *---------------------------------------------------------------------- - */ - -/* - *---------------------------------------------------------------------- - * - * ReadParams -- - * - * Reads FastCGI name-value pairs from stream until EOF. Converts - * each pair to name=value format and adds it to Params structure. - * - *---------------------------------------------------------------------- - */ -static int ReadParams(Params *paramsPtr, FCGX_Stream *stream) -{ - int nameLen, valueLen; - unsigned char lenBuff[3]; - char *nameValue; - - while((nameLen = FCGX_GetChar(stream)) != EOF) { - /* - * Read name length (one or four bytes) and value length - * (one or four bytes) from stream. - */ - if((nameLen & 0x80) != 0) { - if(FCGX_GetStr((char *) &lenBuff[0], 3, stream) != 3) { - SetError(stream, FCGX_PARAMS_ERROR); - return -1; - } - nameLen = ((nameLen & 0x7f) << 24) + (lenBuff[0] << 16) - + (lenBuff[1] << 8) + lenBuff[2]; - } - if((valueLen = FCGX_GetChar(stream)) == EOF) { - SetError(stream, FCGX_PARAMS_ERROR); - return -1; - } - if((valueLen & 0x80) != 0) { - if(FCGX_GetStr((char *) &lenBuff[0], 3, stream) != 3) { - SetError(stream, FCGX_PARAMS_ERROR); - return -1; - } - valueLen = ((valueLen & 0x7f) << 24) + (lenBuff[0] << 16) - + (lenBuff[1] << 8) + lenBuff[2]; - } - /* - * nameLen and valueLen are now valid; read the name and value - * from stream and construct a standard environment entry. - */ - nameValue = (char *)Malloc(nameLen + valueLen + 2); - if(FCGX_GetStr(nameValue, nameLen, stream) != nameLen) { - SetError(stream, FCGX_PARAMS_ERROR); - free(nameValue); - return -1; - } - *(nameValue + nameLen) = '='; - if(FCGX_GetStr(nameValue + nameLen + 1, valueLen, stream) - != valueLen) { - SetError(stream, FCGX_PARAMS_ERROR); - free(nameValue); - return -1; - } - *(nameValue + nameLen + valueLen + 1) = '\0'; - PutParam(paramsPtr, nameValue); - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * MakeHeader -- - * - * Constructs an FCGI_Header struct. - * - *---------------------------------------------------------------------- - */ -static FCGI_Header MakeHeader( - int type, - int requestId, - int contentLength, - int paddingLength) -{ - FCGI_Header header; - ASSERT(contentLength >= 0 && contentLength <= FCGI_MAX_LENGTH); - ASSERT(paddingLength >= 0 && paddingLength <= 0xff); - header.version = FCGI_VERSION_1; - header.type = (unsigned char) type; - header.requestIdB1 = (unsigned char) ((requestId >> 8) & 0xff); - header.requestIdB0 = (unsigned char) ((requestId ) & 0xff); - header.contentLengthB1 = (unsigned char) ((contentLength >> 8) & 0xff); - header.contentLengthB0 = (unsigned char) ((contentLength ) & 0xff); - header.paddingLength = (unsigned char) paddingLength; - header.reserved = 0; - return header; -} - -/* - *---------------------------------------------------------------------- - * - * MakeEndRequestBody -- - * - * Constructs an FCGI_EndRequestBody struct. - * - *---------------------------------------------------------------------- - */ -static FCGI_EndRequestBody MakeEndRequestBody( - int appStatus, - int protocolStatus) -{ - FCGI_EndRequestBody body; - body.appStatusB3 = (unsigned char) ((appStatus >> 24) & 0xff); - body.appStatusB2 = (unsigned char) ((appStatus >> 16) & 0xff); - body.appStatusB1 = (unsigned char) ((appStatus >> 8) & 0xff); - body.appStatusB0 = (unsigned char) ((appStatus ) & 0xff); - body.protocolStatus = (unsigned char) protocolStatus; - memset(body.reserved, 0, sizeof(body.reserved)); - return body; -} - -/* - *---------------------------------------------------------------------- - * - * MakeUnknownTypeBody -- - * - * Constructs an FCGI_MakeUnknownTypeBody struct. - * - *---------------------------------------------------------------------- - */ -static FCGI_UnknownTypeBody MakeUnknownTypeBody( - int type) -{ - FCGI_UnknownTypeBody body; - body.type = (unsigned char) type; - memset(body.reserved, 0, sizeof(body.reserved)); - return body; -} - -/* - *---------------------------------------------------------------------- - * - * AlignInt8 -- - * - * Returns the smallest integer greater than or equal to n - * that's a multiple of 8. - * - *---------------------------------------------------------------------- - */ -static int AlignInt8(unsigned n) { - return (n + 7) & (UINT_MAX - 7); -} - -/* - *---------------------------------------------------------------------- - * - * AlignPtr8 -- - * - * Returns the smallest pointer greater than or equal to p - * that's a multiple of 8. - * - *---------------------------------------------------------------------- - */ -static unsigned char *AlignPtr8(unsigned char *p) { - unsigned long u = (unsigned long) p; - u = ((u + 7) & (ULONG_MAX - 7)) - u; - return p + u; -} - - -/* - * State associated with a stream - */ -typedef struct FCGX_Stream_Data { - unsigned char *buff; /* buffer after alignment */ - int bufflen; /* number of bytes buff can store */ - unsigned char *mBuff; /* buffer as returned by Malloc */ - unsigned char *buffStop; /* reader: last valid byte + 1 of entire buffer. - * stop generally differs from buffStop for - * readers because of record structure. - * writer: buff + bufflen */ - int type; /* reader: FCGI_PARAMS or FCGI_STDIN - * writer: FCGI_STDOUT or FCGI_STDERR */ - int eorStop; /* reader: stop stream at end-of-record */ - int skip; /* reader: don't deliver content bytes */ - int contentLen; /* reader: bytes of unread content */ - int paddingLen; /* reader: bytes of unread padding */ - int isAnythingWritten; /* writer: data has been written to ipcFd */ - int rawWrite; /* writer: write data without stream headers */ - FCGX_Request *reqDataPtr; /* request data not specific to one stream */ -} FCGX_Stream_Data; - -/* - *---------------------------------------------------------------------- - * - * WriteCloseRecords -- - * - * Writes an EOF record for the stream content if necessary. - * If this is the last writer to close, writes an FCGI_END_REQUEST - * record. - * - *---------------------------------------------------------------------- - */ -static void WriteCloseRecords(struct FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - /* - * Enter rawWrite mode so final records won't be encapsulated as - * stream data. - */ - data->rawWrite = TRUE; - /* - * Generate EOF for stream content if needed. - */ - if(!(data->type == FCGI_STDERR - && stream->wrNext == data->buff - && !data->isAnythingWritten)) { - FCGI_Header header; - header = MakeHeader(data->type, data->reqDataPtr->requestId, 0, 0); - FCGX_PutStr((char *) &header, sizeof(header), stream); - }; - /* - * Generate FCGI_END_REQUEST record if needed. - */ - if(data->reqDataPtr->nWriters == 1) { - FCGI_EndRequestRecord endRequestRecord; - endRequestRecord.header = MakeHeader(FCGI_END_REQUEST, - data->reqDataPtr->requestId, - sizeof(endRequestRecord.body), 0); - endRequestRecord.body = MakeEndRequestBody( - data->reqDataPtr->appStatus, FCGI_REQUEST_COMPLETE); - FCGX_PutStr((char *) &endRequestRecord, - sizeof(endRequestRecord), stream); - } - data->reqDataPtr->nWriters--; -} - - - -static int write_it_all(int fd, char *buf, int len) -{ - int wrote; - - while (len) { - wrote = OS_Write(fd, buf, len); - if (wrote < 0) - return wrote; - len -= wrote; - buf += wrote; - } - return len; -} - -/* - *---------------------------------------------------------------------- - * - * EmptyBuffProc -- - * - * Encapsulates any buffered stream content in a FastCGI - * record. Writes the data, making the buffer empty. - * - *---------------------------------------------------------------------- - */ -static void EmptyBuffProc(struct FCGX_Stream *stream, int doClose) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - int cLen, eLen; - /* - * If the buffer contains stream data, fill in the header. - * Pad the record to a multiple of 8 bytes in length. Padding - * can't overflow the buffer because the buffer is a multiple - * of 8 bytes in length. If the buffer contains no stream - * data, reclaim the space reserved for the header. - */ - if(!data->rawWrite) { - cLen = stream->wrNext - data->buff - sizeof(FCGI_Header); - if(cLen > 0) { - eLen = AlignInt8(cLen); - /* - * Giving the padding a well-defined value keeps Purify happy. - */ - memset(stream->wrNext, 0, eLen - cLen); - stream->wrNext += eLen - cLen; - *((FCGI_Header *) data->buff) - = MakeHeader(data->type, - data->reqDataPtr->requestId, cLen, eLen - cLen); - } else { - stream->wrNext = data->buff; - } - } - if(doClose) { - WriteCloseRecords(stream); - }; - if (stream->wrNext != data->buff) { - data->isAnythingWritten = TRUE; - if (write_it_all(data->reqDataPtr->ipcFd, (char *)data->buff, stream->wrNext - data->buff) < 0) { - SetError(stream, OS_Errno); - return; - } - stream->wrNext = data->buff; - } - /* - * The buffer is empty. - */ - if(!data->rawWrite) { - stream->wrNext += sizeof(FCGI_Header); - } -} - -/* - * Return codes for Process* functions - */ -#define STREAM_RECORD 0 -#define SKIP 1 -#define BEGIN_RECORD 2 -#define MGMT_RECORD 3 - -/* - *---------------------------------------------------------------------- - * - * ProcessManagementRecord -- - * - * Reads and responds to a management record. The only type of - * management record this library understands is FCGI_GET_VALUES. - * The only variables that this library's FCGI_GET_VALUES - * understands are FCGI_MAX_CONNS, FCGI_MAX_REQS, and FCGI_MPXS_CONNS. - * Ignore other FCGI_GET_VALUES variables; respond to other - * management records with a FCGI_UNKNOWN_TYPE record. - * - *---------------------------------------------------------------------- - */ -static int ProcessManagementRecord(int type, FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - ParamsPtr paramsPtr = NewParams(3); - char **pPtr; - char response[64]; /* 64 = 8 + 3*(1+1+14+1)* + padding */ - char *responseP = &response[FCGI_HEADER_LEN]; - char *name, value = '\0'; - int len, paddedLen; - if(type == FCGI_GET_VALUES) { - ReadParams(paramsPtr, stream); - if((FCGX_GetError(stream) != 0) || (data->contentLen != 0)) { - FreeParams(¶msPtr); - return FCGX_PROTOCOL_ERROR; - } - for (pPtr = paramsPtr->vec; pPtr < paramsPtr->cur; pPtr++) { - name = *pPtr; - *(strchr(name, '=')) = '\0'; - if(strcmp(name, FCGI_MAX_CONNS) == 0) { - value = '1'; - } else if(strcmp(name, FCGI_MAX_REQS) == 0) { - value = '1'; - } else if(strcmp(name, FCGI_MPXS_CONNS) == 0) { - value = '0'; - } else { - name = NULL; - } - if(name != NULL) { - len = strlen(name); - sprintf(responseP, "%c%c%s%c", len, 1, name, value); - responseP += len + 3; - } - } - len = responseP - &response[FCGI_HEADER_LEN]; - paddedLen = AlignInt8(len); - *((FCGI_Header *) response) - = MakeHeader(FCGI_GET_VALUES_RESULT, FCGI_NULL_REQUEST_ID, - len, paddedLen - len); - FreeParams(¶msPtr); - } else { - paddedLen = len = sizeof(FCGI_UnknownTypeBody); - ((FCGI_UnknownTypeRecord *) response)->header - = MakeHeader(FCGI_UNKNOWN_TYPE, FCGI_NULL_REQUEST_ID, - len, 0); - ((FCGI_UnknownTypeRecord *) response)->body - = MakeUnknownTypeBody(type); - } - if (write_it_all(data->reqDataPtr->ipcFd, response, FCGI_HEADER_LEN + paddedLen) < 0) { - SetError(stream, OS_Errno); - return -1; - } - - return MGMT_RECORD; -} - -/* - *---------------------------------------------------------------------- - * - * ProcessBeginRecord -- - * - * Reads an FCGI_BEGIN_REQUEST record. - * - * Results: - * BEGIN_RECORD for normal return. FCGX_PROTOCOL_ERROR for - * protocol error. SKIP for attempt to multiplex - * connection. -1 for error from write (errno in stream). - * - * Side effects: - * In case of BEGIN_RECORD return, stores requestId, role, - * keepConnection values, and sets isBeginProcessed = TRUE. - * - *---------------------------------------------------------------------- - */ -static int ProcessBeginRecord(int requestId, FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - FCGI_BeginRequestBody body; - if(requestId == 0 || data->contentLen != sizeof(body)) { - return FCGX_PROTOCOL_ERROR; - } - if(data->reqDataPtr->isBeginProcessed) { - /* - * The Web server is multiplexing the connection. This library - * doesn't know how to handle multiplexing, so respond with - * FCGI_END_REQUEST{protocolStatus = FCGI_CANT_MPX_CONN} - */ - FCGI_EndRequestRecord endRequestRecord; - endRequestRecord.header = MakeHeader(FCGI_END_REQUEST, - requestId, sizeof(endRequestRecord.body), 0); - endRequestRecord.body - = MakeEndRequestBody(0, FCGI_CANT_MPX_CONN); - if (write_it_all(data->reqDataPtr->ipcFd, (char *)&endRequestRecord, sizeof(endRequestRecord)) < 0) { - SetError(stream, OS_Errno); - return -1; - } - - return SKIP; - } - /* - * Accept this new request. Read the record body. - */ - data->reqDataPtr->requestId = requestId; - if(FCGX_GetStr((char *) &body, sizeof(body), stream) - != sizeof(body)) { - return FCGX_PROTOCOL_ERROR; - } - data->reqDataPtr->keepConnection = (body.flags & FCGI_KEEP_CONN); - data->reqDataPtr->role = (body.roleB1 << 8) + body.roleB0; - data->reqDataPtr->isBeginProcessed = TRUE; - return BEGIN_RECORD; -} - -/* - *---------------------------------------------------------------------- - * - * ProcessHeader -- - * - * Interprets FCGI_Header. Processes FCGI_BEGIN_REQUEST and - * management records here; extracts information from stream - * records (FCGI_PARAMS, FCGI_STDIN) into stream. - * - * Results: - * >= 0 for a normal return, < 0 for error - * - * Side effects: - * XXX: Many (more than there used to be). - * If !stream->isRequestIdSet, ProcessHeader initializes - * stream->requestId from header and sets stream->isRequestIdSet - * to TRUE. ProcessHeader also sets stream->contentLen to header's - * contentLength, and sets stream->paddingLen to the header's - * paddingLength. - * - *---------------------------------------------------------------------- - */ -static int ProcessHeader(FCGI_Header header, FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - int requestId; - if(header.version != FCGI_VERSION_1) { - return FCGX_UNSUPPORTED_VERSION; - } - requestId = (header.requestIdB1 << 8) - + header.requestIdB0; - data->contentLen = (header.contentLengthB1 << 8) - + header.contentLengthB0; - data->paddingLen = header.paddingLength; - if(header.type == FCGI_BEGIN_REQUEST) { - return ProcessBeginRecord(requestId, stream); - } - if(requestId == FCGI_NULL_REQUEST_ID) { - return ProcessManagementRecord(header.type, stream); - } - if(requestId != data->reqDataPtr->requestId) { - return SKIP; - } - if(header.type != data->type) { - return FCGX_PROTOCOL_ERROR; - } - return STREAM_RECORD; -} - -/* - *---------------------------------------------------------------------- - * - * FillBuffProc -- - * - * Reads bytes from the ipcFd, supplies bytes to a stream client. - * - *---------------------------------------------------------------------- - */ -static void FillBuffProc(FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - FCGI_Header header; - int headerLen = 0; - int status, count; - - for (;;) { - /* - * If data->buff is empty, do a read. - */ - if(stream->rdNext == data->buffStop) { - count = OS_Read(data->reqDataPtr->ipcFd, (char *)data->buff, - data->bufflen); - if(count <= 0) { - SetError(stream, (count == 0 ? FCGX_PROTOCOL_ERROR : OS_Errno)); - return; - } - stream->rdNext = data->buff; - data->buffStop = data->buff + count; - } - /* - * Now data->buff is not empty. If the current record contains - * more content bytes, deliver all that are present in data->buff. - */ - if(data->contentLen > 0) { - count = min(data->contentLen, data->buffStop - stream->rdNext); - data->contentLen -= count; - if(!data->skip) { - stream->wrNext = stream->stop = stream->rdNext + count; - return; - } else { - stream->rdNext += count; - if(data->contentLen > 0) { - continue; - } else { - data->skip = FALSE; - } - } - } - /* - * If the current record (whose content has been fully consumed by - * the client) was padded, skip over the padding bytes. - */ - if(data->paddingLen > 0) { - count = min(data->paddingLen, data->buffStop - stream->rdNext); - data->paddingLen -= count; - stream->rdNext += count; - if(data->paddingLen > 0) { - continue; - } - } - /* - * All done with the current record, including the padding. - * If we're in a recursive call from ProcessHeader, deliver EOF. - */ - if(data->eorStop) { - stream->stop = stream->rdNext; - stream->isClosed = TRUE; - return; - } - /* - * Fill header with bytes from the input buffer. - */ - count = min((int)sizeof(header) - headerLen, - data->buffStop - stream->rdNext); - memcpy(((char *)(&header)) + headerLen, stream->rdNext, count); - headerLen += count; - stream->rdNext += count; - if(headerLen < sizeof(header)) { - continue; - }; - headerLen = 0; - /* - * Interpret header. eorStop prevents ProcessHeader from reading - * past the end-of-record when using stream to read content. - */ - data->eorStop = TRUE; - stream->stop = stream->rdNext; - status = ProcessHeader(header, stream); - data->eorStop = FALSE; - stream->isClosed = FALSE; - switch(status) { - case STREAM_RECORD: - /* - * If this stream record header marked the end of stream - * data deliver EOF to the stream client, otherwise loop - * and deliver data. - * - * XXX: If this is final stream and - * stream->rdNext != data->buffStop, buffered - * data is next request (server pipelining)? - */ - if(data->contentLen == 0) { - stream->wrNext = stream->stop = stream->rdNext; - stream->isClosed = TRUE; - return; - } - break; - case SKIP: - data->skip = TRUE; - break; - case BEGIN_RECORD: - /* - * If this header marked the beginning of a new - * request, return role information to caller. - */ - return; - break; - case MGMT_RECORD: - break; - default: - ASSERT(status < 0); - SetError(stream, status); - return; - break; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * NewStream -- - * - * Creates a stream to read or write from an open ipcFd. - * The stream performs reads/writes of up to bufflen bytes. - * - *---------------------------------------------------------------------- - */ -static FCGX_Stream *NewStream( - FCGX_Request *reqDataPtr, int bufflen, int isReader, int streamType) -{ - /* - * XXX: It would be a lot cleaner to have a NewStream that only - * knows about the type FCGX_Stream, with all other - * necessary data passed in. It appears that not just - * data and the two procs are needed for initializing stream, - * but also data->buff and data->buffStop. This has implications - * for procs that want to swap buffers, too. - */ - FCGX_Stream *stream = (FCGX_Stream *)Malloc(sizeof(FCGX_Stream)); - FCGX_Stream_Data *data = (FCGX_Stream_Data *)Malloc(sizeof(FCGX_Stream_Data)); - data->reqDataPtr = reqDataPtr; - bufflen = AlignInt8(min(max(bufflen, 32), FCGI_MAX_LENGTH + 1)); - data->bufflen = bufflen; - data->mBuff = (unsigned char *)Malloc(bufflen); - data->buff = AlignPtr8(data->mBuff); - if(data->buff != data->mBuff) { - data->bufflen -= 8; - } - if(isReader) { - data->buffStop = data->buff; - } else { - data->buffStop = data->buff + data->bufflen; - } - data->type = streamType; - data->eorStop = FALSE; - data->skip = FALSE; - data->contentLen = 0; - data->paddingLen = 0; - data->isAnythingWritten = FALSE; - data->rawWrite = FALSE; - - stream->data = data; - stream->isReader = isReader; - stream->isClosed = FALSE; - stream->wasFCloseCalled = FALSE; - stream->FCGI_errno = 0; - if(isReader) { - stream->fillBuffProc = FillBuffProc; - stream->emptyBuffProc = NULL; - stream->rdNext = data->buff; - stream->stop = stream->rdNext; - stream->stopUnget = data->buff; - stream->wrNext = stream->stop; - } else { - stream->fillBuffProc = NULL; - stream->emptyBuffProc = EmptyBuffProc; - stream->wrNext = data->buff + sizeof(FCGI_Header); - stream->stop = data->buffStop; - stream->stopUnget = NULL; - stream->rdNext = stream->stop; - } - return stream; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_FreeStream -- - * - * Frees all storage allocated when *streamPtr was created, - * and nulls out *streamPtr. - * - *---------------------------------------------------------------------- - */ -void FCGX_FreeStream(FCGX_Stream **streamPtr) -{ - _FCGX_FreeStream(streamPtr, TRUE); -} - -void _FCGX_FreeStream(FCGX_Stream **streamPtr, int freeData) -{ - FCGX_Stream *stream = *streamPtr; - FCGX_Stream_Data *data; - if(stream == NULL) { - return; - } - data = (FCGX_Stream_Data *)stream->data; - if (freeData && data->reqDataPtr) free(data->reqDataPtr); - data->reqDataPtr = NULL; - free(data->mBuff); - free(data); - free(stream); - *streamPtr = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * SetReaderType -- - * - * Re-initializes the stream to read data of the specified type. - * - *---------------------------------------------------------------------- - */ -static FCGX_Stream *SetReaderType(FCGX_Stream *stream, int streamType) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - ASSERT(stream->isReader); - data->type = streamType; - data->eorStop = FALSE; - data->skip = FALSE; - data->contentLen = 0; - data->paddingLen = 0; - stream->wrNext = stream->stop = stream->rdNext; - stream->isClosed = FALSE; - return stream; -} - -/* - *---------------------------------------------------------------------- - * - * NewReader -- - * - * Creates a stream to read streamType records for the given - * request. The stream performs OS reads of up to bufflen bytes. - * - *---------------------------------------------------------------------- - */ -static FCGX_Stream *NewReader(FCGX_Request *reqDataPtr, int bufflen, int streamType) -{ - return NewStream(reqDataPtr, bufflen, TRUE, streamType); -} - -/* - *---------------------------------------------------------------------- - * - * NewWriter -- - * - * Creates a stream to write streamType FastCGI records, using - * the ipcFd and RequestId contained in *reqDataPtr. - * The stream performs OS writes of up to bufflen bytes. - * - *---------------------------------------------------------------------- - */ -static FCGX_Stream *NewWriter(FCGX_Request *reqDataPtr, int bufflen, int streamType) -{ - return NewStream(reqDataPtr, bufflen, FALSE, streamType); -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_CreateWriter -- - * - * Creates a stream to write streamType FastCGI records, using - * the given ipcFd and request Id. This function is provided - * for use by cgi-fcgi. In order to be defensive against misuse, - * this function leaks a little storage; cgi-fcgi doesn't care. - * - *---------------------------------------------------------------------- - */ -FCGX_Stream *FCGX_CreateWriter( - int ipcFd, - int requestId, - int bufflen, - int streamType) -{ - FCGX_Request *reqDataPtr = (FCGX_Request *)Malloc(sizeof(FCGX_Request)); - reqDataPtr->ipcFd = ipcFd; - reqDataPtr->requestId = requestId; - /* - * Suppress writing an FCGI_END_REQUEST record. - */ - reqDataPtr->nWriters = 2; - return NewWriter(reqDataPtr, bufflen, streamType); -} - -/* - *====================================================================== - * Control - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_IsCGI -- - * - * This routine determines if the process is running as a CGI or - * FastCGI process. The distinction is made by determining whether - * FCGI_LISTENSOCK_FILENO is a listener ipcFd or the end of a - * pipe (ie. standard in). - * - * Results: - * TRUE if the process is a CGI process, FALSE if FastCGI. - * - *---------------------------------------------------------------------- - */ -int FCGX_IsCGI(void) -{ - if (isFastCGI != -1) { - return !isFastCGI; - } - - if (!libInitialized) { - int rc = FCGX_Init(); - if (rc) { - /* exit() isn't great, but hey */ - /* exit((rc < 0) ? rc : -rc); */ - return 0; - } - } - - isFastCGI = OS_IsFcgi(FCGI_LISTENSOCK_FILENO); - - return !isFastCGI; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_Finish -- - * - * Finishes the current request from the HTTP server. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ - -void FCGX_Finish(void) -{ - FCGX_Finish_r(&the_request); -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_Finish_r -- - * - * Finishes the current request from the HTTP server. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ -void FCGX_Finish_r(FCGX_Request *reqDataPtr) -{ - int close; - - if (reqDataPtr == NULL) { - return; - } - - close = !reqDataPtr->keepConnection; - - /* This should probably use a 'status' member instead of 'in' */ - if (reqDataPtr->in) { - close |= FCGX_FClose(reqDataPtr->err); - close |= FCGX_FClose(reqDataPtr->out); - - close |= FCGX_GetError(reqDataPtr->in); - } - - FCGX_Free(reqDataPtr, close); -} - -void FCGX_Free(FCGX_Request * request, int close) -{ - if (request == NULL) - return; - - _FCGX_FreeStream(&request->in, FALSE); - _FCGX_FreeStream(&request->out, FALSE); - _FCGX_FreeStream(&request->err, FALSE); - FreeParams(&request->paramsPtr); - request->envp = NULL; - - if (close) { - OS_IpcClose(request->ipcFd); - request->ipcFd = -1; - } -} - -int FCGX_OpenSocket(const char *path, int backlog) -{ - int rc = OS_CreateLocalIpcFd(path, backlog, 1); - if (rc == FCGI_LISTENSOCK_FILENO && isFastCGI == 0) { - /* XXX probably need to call OS_LibInit() again for Win */ - isFastCGI = 1; - } - return rc; -} - -int FCGX_InitRequest(FCGX_Request *request, int sock, int flags) -{ - memset(request, 0, sizeof(FCGX_Request)); - - /* @@@ Should check that sock is open and listening */ - request->listen_sock = sock; - - /* @@@ Should validate against "known" flags */ - request->flags = flags; - - request->ipcFd = -1; - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_Init -- - * - * Initilize the FCGX library. This is called by FCGX_Accept() - * but must be called by the user when using FCGX_Accept_r(). - * - * Results: - * 0 for successful call. - * - *---------------------------------------------------------------------- - */ -int FCGX_Init(void) -{ - char *p; - - if (libInitialized) { - return 0; - } - - FCGX_InitRequest(&the_request, FCGI_LISTENSOCK_FILENO, 0); - - if (OS_LibInit(NULL) == -1) { - return OS_Errno ? OS_Errno : -9997; - } - - p = getenv("FCGI_WEB_SERVER_ADDRS"); - webServerAddressList = p ? StringCopy(p) : NULL; - - libInitialized = 1; - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_Accept -- - * - * Accepts a new request from the HTTP server. - * - * Results: - * 0 for successful call, -1 for error. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * Creates input, output, and error streams and - * assigns them to *in, *out, and *err respectively. - * Creates a parameters data structure to be accessed - * via getenv(3) (if assigned to environ) or by FCGX_GetParam - * and assigns it to *envp. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ - -int FCGX_Accept( - FCGX_Stream **in, - FCGX_Stream **out, - FCGX_Stream **err, - FCGX_ParamArray *envp) -{ - int rc; - - if (! libInitialized) { - rc = FCGX_Init(); - if (rc) { - return rc; - } - } - - rc = FCGX_Accept_r(&the_request); - - *in = the_request.in; - *out = the_request.out; - *err = the_request.err; - *envp = the_request.envp; - - return rc; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_Accept_r -- - * - * Accepts a new request from the HTTP server. - * - * Results: - * 0 for successful call, -1 for error. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * Creates input, output, and error streams and - * assigns them to *in, *out, and *err respectively. - * Creates a parameters data structure to be accessed - * via getenv(3) (if assigned to environ) or by FCGX_GetParam - * and assigns it to *envp. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ -int FCGX_Accept_r(FCGX_Request *reqDataPtr) -{ - if (!libInitialized) { - return -9998; - } - - /* Finish the current request, if any. */ - FCGX_Finish_r(reqDataPtr); - - for (;;) { - /* - * If a connection isn't open, accept a new connection (blocking). - * If an OS error occurs in accepting the connection, - * return -1 to the caller, who should exit. - */ - if (reqDataPtr->ipcFd < 0) { - int fail_on_intr = reqDataPtr->flags & FCGI_FAIL_ACCEPT_ON_INTR; - - reqDataPtr->ipcFd = OS_Accept(reqDataPtr->listen_sock, fail_on_intr, webServerAddressList); - if (reqDataPtr->ipcFd < 0) { - return (errno > 0) ? (0 - errno) : -9999; - } - } - /* - * A connection is open. Read from the connection in order to - * get the request's role and environment. If protocol or other - * errors occur, close the connection and try again. - */ - reqDataPtr->isBeginProcessed = FALSE; - reqDataPtr->in = NewReader(reqDataPtr, 8192, 0); - FillBuffProc(reqDataPtr->in); - if(!reqDataPtr->isBeginProcessed) { - goto TryAgain; - } - { - char *roleStr; - switch(reqDataPtr->role) { - case FCGI_RESPONDER: - roleStr = "FCGI_ROLE=RESPONDER"; - break; - case FCGI_AUTHORIZER: - roleStr = "FCGI_ROLE=AUTHORIZER"; - break; - case FCGI_FILTER: - roleStr = "FCGI_ROLE=FILTER"; - break; - default: - goto TryAgain; - } - reqDataPtr->paramsPtr = NewParams(30); - PutParam(reqDataPtr->paramsPtr, StringCopy(roleStr)); - } - SetReaderType(reqDataPtr->in, FCGI_PARAMS); - if(ReadParams(reqDataPtr->paramsPtr, reqDataPtr->in) >= 0) { - /* - * Finished reading the environment. No errors occurred, so - * leave the connection-retry loop. - */ - break; - } - - /* - * Close the connection and try again. - */ -TryAgain: - FCGX_Free(reqDataPtr, 1); - - } /* for (;;) */ - /* - * Build the remaining data structures representing the new - * request and return successfully to the caller. - */ - SetReaderType(reqDataPtr->in, FCGI_STDIN); - reqDataPtr->out = NewWriter(reqDataPtr, 8192, FCGI_STDOUT); - reqDataPtr->err = NewWriter(reqDataPtr, 512, FCGI_STDERR); - reqDataPtr->nWriters = 2; - reqDataPtr->envp = reqDataPtr->paramsPtr->vec; - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_StartFilterData -- - * - * stream is an input stream for a FCGI_FILTER request. - * stream is positioned at EOF on FCGI_STDIN. - * Repositions stream to the start of FCGI_DATA. - * If the preconditions are not met (e.g. FCGI_STDIN has not - * been read to EOF) sets the stream error code to - * FCGX_CALL_SEQ_ERROR. - * - * Results: - * 0 for a normal return, < 0 for error - * - *---------------------------------------------------------------------- - */ - -int FCGX_StartFilterData(FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - if(data->reqDataPtr->role != FCGI_FILTER - || !stream->isReader - || !stream->isClosed - || data->type != FCGI_STDIN) { - SetError(stream, FCGX_CALL_SEQ_ERROR); - return -1; - } - SetReaderType(stream, FCGI_DATA); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FCGX_SetExitStatus -- - * - * Sets the exit status for stream's request. The exit status - * is the status code the request would have exited with, had - * the request been run as a CGI program. You can call - * SetExitStatus several times during a request; the last call - * before the request ends determines the value. - * - *---------------------------------------------------------------------- - */ - -void FCGX_SetExitStatus(int status, FCGX_Stream *stream) -{ - FCGX_Stream_Data *data = (FCGX_Stream_Data *)stream->data; - data->reqDataPtr->appStatus = status; -} - diff --git a/sapi/cgi/libfcgi/include/fastcgi.h b/sapi/cgi/libfcgi/include/fastcgi.h deleted file mode 100644 index 36b4725ba1e68..0000000000000 --- a/sapi/cgi/libfcgi/include/fastcgi.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * fastcgi.h -- - * - * Defines for the FastCGI protocol. - * - * - * Copyright (c) 1995-1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id$ - */ - -#ifndef _FASTCGI_H -#define _FASTCGI_H - -/* - * Listening socket file number - */ -#define FCGI_LISTENSOCK_FILENO 0 - -typedef struct { - unsigned char version; - unsigned char type; - unsigned char requestIdB1; - unsigned char requestIdB0; - unsigned char contentLengthB1; - unsigned char contentLengthB0; - unsigned char paddingLength; - unsigned char reserved; -} FCGI_Header; - -#define FCGI_MAX_LENGTH 0xffff - -/* - * Number of bytes in a FCGI_Header. Future versions of the protocol - * will not reduce this number. - */ -#define FCGI_HEADER_LEN 8 - -/* - * Value for version component of FCGI_Header - */ -#define FCGI_VERSION_1 1 - -/* - * Values for type component of FCGI_Header - */ -#define FCGI_BEGIN_REQUEST 1 -#define FCGI_ABORT_REQUEST 2 -#define FCGI_END_REQUEST 3 -#define FCGI_PARAMS 4 -#define FCGI_STDIN 5 -#define FCGI_STDOUT 6 -#define FCGI_STDERR 7 -#define FCGI_DATA 8 -#define FCGI_GET_VALUES 9 -#define FCGI_GET_VALUES_RESULT 10 -#define FCGI_UNKNOWN_TYPE 11 -#define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE) - -/* - * Value for requestId component of FCGI_Header - */ -#define FCGI_NULL_REQUEST_ID 0 - - -typedef struct { - unsigned char roleB1; - unsigned char roleB0; - unsigned char flags; - unsigned char reserved[5]; -} FCGI_BeginRequestBody; - -typedef struct { - FCGI_Header header; - FCGI_BeginRequestBody body; -} FCGI_BeginRequestRecord; - -/* - * Mask for flags component of FCGI_BeginRequestBody - */ -#define FCGI_KEEP_CONN 1 - -/* - * Values for role component of FCGI_BeginRequestBody - */ -#define FCGI_RESPONDER 1 -#define FCGI_AUTHORIZER 2 -#define FCGI_FILTER 3 - - -typedef struct { - unsigned char appStatusB3; - unsigned char appStatusB2; - unsigned char appStatusB1; - unsigned char appStatusB0; - unsigned char protocolStatus; - unsigned char reserved[3]; -} FCGI_EndRequestBody; - -typedef struct { - FCGI_Header header; - FCGI_EndRequestBody body; -} FCGI_EndRequestRecord; - -/* - * Values for protocolStatus component of FCGI_EndRequestBody - */ -#define FCGI_REQUEST_COMPLETE 0 -#define FCGI_CANT_MPX_CONN 1 -#define FCGI_OVERLOADED 2 -#define FCGI_UNKNOWN_ROLE 3 - - -/* - * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records - */ -#define FCGI_MAX_CONNS "FCGI_MAX_CONNS" -#define FCGI_MAX_REQS "FCGI_MAX_REQS" -#define FCGI_MPXS_CONNS "FCGI_MPXS_CONNS" - - -typedef struct { - unsigned char type; - unsigned char reserved[7]; -} FCGI_UnknownTypeBody; - -typedef struct { - FCGI_Header header; - FCGI_UnknownTypeBody body; -} FCGI_UnknownTypeRecord; - -#endif /* _FASTCGI_H */ - diff --git a/sapi/cgi/libfcgi/include/fcgi_config.h b/sapi/cgi/libfcgi/include/fcgi_config.h deleted file mode 100644 index 07236793b2bb7..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgi_config.h +++ /dev/null @@ -1,7 +0,0 @@ -/* hack workaround for libfcgi configure */ -#ifdef _WIN32 -#include "fcgi_config_win32.h" -#else -#include -#endif - diff --git a/sapi/cgi/libfcgi/include/fcgi_config_win32.h b/sapi/cgi/libfcgi/include/fcgi_config_win32.h deleted file mode 100644 index a9ec224deb60c..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgi_config_win32.h +++ /dev/null @@ -1,108 +0,0 @@ -/* fcgi_config.h. Generated automatically by configure. */ -/* fcgi_config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define if there's a fileno() prototype in stdio.h */ -#define HAVE_FILENO_PROTO 1 - -/* Define if the fpos_t typedef is in stdio.h */ -#define HAVE_FPOS 1 - -/* Define if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define if you have the `dnet_stub' library (-ldnet_stub). */ -/* #undef HAVE_LIBDNET_STUB */ - -/* Define if you have the `ieee' library (-lieee). */ -/* #undef HAVE_LIBIEEE */ - -/* Define if you have the `nsl' library (-lnsl). */ -#define HAVE_LIBNSL 1 - -/* Define if you have the pthread library */ -#define HAVE_LIBPTHREAD 1 - -/* Define if you have the `resolv' library (-lresolv). */ -#define HAVE_LIBRESOLV 1 - -/* Define if you have the `socket' library (-lsocket). */ -#define HAVE_LIBSOCKET 1 - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_NETDB_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define if sockaddr_un in sys/un.h contains a sun_len component */ -/* #undef HAVE_SOCKADDR_UN_SUN_LEN */ - -/* Define if the socklen_t typedef is in sys/socket.h */ -/* #undef HAVE_SOCKLEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_SYS_PARAM_H 1 */ - -/* Define if you have the header file. */ -/*#define HAVE_SYS_SOCKET_H 1*/ - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file. */ -/*#define HAVE_SYS_TIME_H 1*/ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -/*#define HAVE_UNISTD_H 1*/ - -/* Define if va_arg(arg, long double) crashes the compiler */ -/* #undef HAVE_VA_ARG_LONG_DOUBLE_BUG */ - -/* Name of package */ -#define PACKAGE "fcgi" - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if cross-process locking is required by accept() */ -#define USE_LOCKING 1 - -/* Version number of package */ -#define VERSION "2.2.2" - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -/* #undef inline */ diff --git a/sapi/cgi/libfcgi/include/fcgi_config_x86.h b/sapi/cgi/libfcgi/include/fcgi_config_x86.h deleted file mode 100644 index f56b3af75d63b..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgi_config_x86.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Default fcgi_config.h when building on WinNT (configure is not run). - */ - -/* Define if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define if there's a fileno() prototype in stdio.h */ -#undef HAVE_FILENO_PROTO - -/* Define if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if we have f{set,get}pos functions */ -#define HAVE_FPOS 1 - -/* Define if you have the `dnet_stub' library (-ldnet_stub). */ -#undef HAVE_LIBDNET_STUB - -/* Define if you have the `ieee' library (-lieee). */ -#undef HAVE_LIBIEEE - -/* Define if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the pthread library */ -#undef HAVE_LIBPTHREAD - -/* Define if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - -/* Define if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if we need cross-process locking */ -#undef USE_LOCKING - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define if sockaddr_un in sys/un.h contains a sun_len component */ -#undef HAVE_SOCKADDR_UN_SUN_LEN - -/* Define if the socklen_t typedef is in sys/socket.h */ -#undef HAVE_SOCKLEN - -/* Define if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if va_arg(arg, long double) crashes the compiler */ -#undef HAVE_VA_ARG_LONG_DOUBLE_BUG - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#undef inline - -/* Define to `int' if does not define. */ -#undef ssize_t diff --git a/sapi/cgi/libfcgi/include/fcgi_stdio.h b/sapi/cgi/libfcgi/include/fcgi_stdio.h deleted file mode 100644 index 518462b5916a9..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgi_stdio.h +++ /dev/null @@ -1,249 +0,0 @@ -/* - * fcgi_stdio.h -- - * - * FastCGI-stdio compatibility package - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id$ - */ - -#ifndef _FCGI_STDIO -#define _FCGI_STDIO 1 - -#include -#include -#include "fcgiapp.h" - -#if defined (c_plusplus) || defined (__cplusplus) -extern "C" { -#endif - -#ifndef DLLAPI -#ifdef _WIN32 -#if defined(_LIB) || defined(FCGI_STATIC) -#define DLLAPI -#else -#define DLLAPI __declspec(dllimport) -#endif -#else -#define DLLAPI -#endif -#endif - -/* - * Wrapper type for FILE - */ - -typedef struct { - FILE *stdio_stream; - FCGX_Stream *fcgx_stream; -} FCGI_FILE; - -/* - * The four new functions and two new macros - */ - -DLLAPI int FCGI_Accept(void); -DLLAPI void FCGI_Finish(void); -DLLAPI int FCGI_StartFilterData(void); -DLLAPI void FCGI_SetExitStatus(int status); - -#define FCGI_ToFILE(fcgi_file) (fcgi_file->stdio_stream) -#define FCGI_ToFcgiStream(fcgi_file) (fcgi_file->fcgx_stream) - -/* - * Wrapper stdin, stdout, and stderr variables, set up by FCGI_Accept() - */ - -DLLAPI extern FCGI_FILE _fcgi_sF[]; -#define FCGI_stdin (&_fcgi_sF[0]) -#define FCGI_stdout (&_fcgi_sF[1]) -#define FCGI_stderr (&_fcgi_sF[2]) - -/* - * Wrapper function prototypes, grouped according to sections - * of Harbison & Steele, "C: A Reference Manual," fourth edition, - * Prentice-Hall, 1995. - */ - -DLLAPI void FCGI_perror(const char *str); - -DLLAPI FCGI_FILE *FCGI_fopen(const char *path, const char *mode); -DLLAPI int FCGI_fclose(FCGI_FILE *fp); -DLLAPI int FCGI_fflush(FCGI_FILE *fp); -DLLAPI FCGI_FILE *FCGI_freopen(const char *path, const char *mode, FCGI_FILE *fp); - -DLLAPI int FCGI_setvbuf(FCGI_FILE *fp, char *buf, int bufmode, size_t size); -DLLAPI void FCGI_setbuf(FCGI_FILE *fp, char *buf); - -DLLAPI int FCGI_fseek(FCGI_FILE *fp, long offset, int whence); -DLLAPI int FCGI_ftell(FCGI_FILE *fp); -DLLAPI void FCGI_rewind(FCGI_FILE *fp); -#ifdef HAVE_FPOS -DLLAPI int FCGI_fgetpos(FCGI_FILE *fp, fpos_t *pos); -DLLAPI int FCGI_fsetpos(FCGI_FILE *fp, const fpos_t *pos); -#endif -DLLAPI int FCGI_fgetc(FCGI_FILE *fp); -DLLAPI int FCGI_getchar(void); -DLLAPI int FCGI_ungetc(int c, FCGI_FILE *fp); - -DLLAPI char *FCGI_fgets(char *str, int size, FCGI_FILE *fp); -DLLAPI char *FCGI_gets(char *str); - -/* - * Not yet implemented - * - * int FCGI_fscanf(FCGI_FILE *fp, const char *format, ...); - * int FCGI_scanf(const char *format, ...); - * - */ - -DLLAPI int FCGI_fputc(int c, FCGI_FILE *fp); -DLLAPI int FCGI_putchar(int c); - -DLLAPI int FCGI_fputs(const char *str, FCGI_FILE *fp); -DLLAPI int FCGI_puts(const char *str); - -DLLAPI int FCGI_fprintf(FCGI_FILE *fp, const char *format, ...); -DLLAPI int FCGI_printf(const char *format, ...); - -DLLAPI int FCGI_vfprintf(FCGI_FILE *fp, const char *format, va_list ap); -DLLAPI int FCGI_vprintf(const char *format, va_list ap); - -DLLAPI size_t FCGI_fread(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp); -DLLAPI size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp); - -DLLAPI int FCGI_feof(FCGI_FILE *fp); -DLLAPI int FCGI_ferror(FCGI_FILE *fp); -DLLAPI void FCGI_clearerr(FCGI_FILE *fp); - -DLLAPI FCGI_FILE *FCGI_tmpfile(void); - -DLLAPI int FCGI_fileno(FCGI_FILE *fp); -DLLAPI FCGI_FILE *FCGI_fdopen(int fd, const char *mode); -DLLAPI FCGI_FILE *FCGI_popen(const char *cmd, const char *type); -DLLAPI int FCGI_pclose(FCGI_FILE *); - -/* - * The remaining definitions are for application programs, - * not for fcgi_stdio.c - */ - -#ifndef NO_FCGI_DEFINES - -/* - * Replace standard types, variables, and functions with FastCGI wrappers. - * Use undef in case a macro is already defined. - */ - -#undef FILE -#define FILE FCGI_FILE - -#undef stdin -#define stdin FCGI_stdin -#undef stdout -#define stdout FCGI_stdout -#undef stderr -#define stderr FCGI_stderr - -#undef perror -#define perror FCGI_perror - -#undef fopen -#define fopen FCGI_fopen -#undef fclose -#define fclose FCGI_fclose -#undef fflush -#define fflush FCGI_fflush -#undef freopen -#define freopen FCGI_freopen - -#undef setvbuf -#define setvbuf FCGI_setvbuf -#undef setbuf -#define setbuf FCGI_setbuf - -#undef fseek -#define fseek FCGI_fseek -#undef ftell -#define ftell FCGI_ftell -#undef rewind -#define rewind FCGI_rewind -#undef fgetpos -#define fgetpos FCGI_fgetpos -#undef fsetpos -#define fsetpos FCGI_fsetpos - -#undef fgetc -#define fgetc FCGI_fgetc -#undef getc -#define getc FCGI_fgetc -#undef getchar -#define getchar FCGI_getchar -#undef ungetc -#define ungetc FCGI_ungetc - -#undef fgets -#define fgets FCGI_fgets -#undef gets -#define gets FCGI_gets - -#undef fputc -#define fputc FCGI_fputc -#undef putc -#define putc FCGI_fputc -#undef putchar -#define putchar FCGI_putchar - -#undef fputs -#define fputs FCGI_fputs -#undef puts -#define puts FCGI_puts - -#undef fprintf -#define fprintf FCGI_fprintf -#undef printf -#define printf FCGI_printf - -#undef vfprintf -#define vfprintf FCGI_vfprintf -#undef vprintf -#define vprintf FCGI_vprintf - -#undef fread -#define fread FCGI_fread -#undef fwrite -#define fwrite FCGI_fwrite - -#undef feof -#define feof FCGI_feof -#undef ferror -#define ferror FCGI_ferror -#undef clearerr -#define clearerr FCGI_clearerr - -#undef tmpfile -#define tmpfile FCGI_tmpfile - -#undef fileno -#define fileno FCGI_fileno -#undef fdopen -#define fdopen FCGI_fdopen -#undef popen -#define popen FCGI_popen -#undef pclose -#define pclose FCGI_pclose - -#endif /* NO_FCGI_DEFINES */ - -#if defined (__cplusplus) || defined (c_plusplus) -} /* terminate extern "C" { */ -#endif - -#endif /* _FCGI_STDIO */ - diff --git a/sapi/cgi/libfcgi/include/fcgiapp.h b/sapi/cgi/libfcgi/include/fcgiapp.h deleted file mode 100644 index 8e35e0776ca1d..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgiapp.h +++ /dev/null @@ -1,640 +0,0 @@ -/* - * fcgiapp.h -- - * - * Definitions for FastCGI application server programs - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id$ - */ - -#ifndef _FCGIAPP_H -#define _FCGIAPP_H - -/* Hack to see if we are building TCL - TCL needs varargs not stdarg */ -#ifndef TCL_LIBRARY -#include -#else -#include -#endif - -#ifndef DLLAPI -#ifdef _WIN32 -#if defined(_LIB) || defined(FCGI_STATIC) -#define DLLAPI -#else -#define DLLAPI __declspec(dllimport) -#endif -#else -#define DLLAPI -#endif -#endif - -#if defined (c_plusplus) || defined (__cplusplus) -extern "C" { -#endif - -/* - * Error codes. Assigned to avoid conflict with EOF and errno(2). - */ -#define FCGX_UNSUPPORTED_VERSION -2 -#define FCGX_PROTOCOL_ERROR -3 -#define FCGX_PARAMS_ERROR -4 -#define FCGX_CALL_SEQ_ERROR -5 - -/* - * This structure defines the state of a FastCGI stream. - * Streams are modeled after the FILE type defined in stdio.h. - * (We wouldn't need our own if platform vendors provided a - * standard way to subclass theirs.) - * The state of a stream is private and should only be accessed - * by the procedures defined below. - */ -typedef struct FCGX_Stream { - unsigned char *rdNext; /* reader: first valid byte - * writer: equals stop */ - unsigned char *wrNext; /* writer: first free byte - * reader: equals stop */ - unsigned char *stop; /* reader: last valid byte + 1 - * writer: last free byte + 1 */ - unsigned char *stopUnget; /* reader: first byte of current buffer - * fragment, for ungetc - * writer: undefined */ - int isReader; - int isClosed; - int wasFCloseCalled; - int FCGI_errno; /* error status */ - void (*fillBuffProc) (struct FCGX_Stream *stream); - void (*emptyBuffProc) (struct FCGX_Stream *stream, int doClose); - void *data; -} FCGX_Stream; - -/* - * An environment (as defined by environ(7)): A NULL-terminated array - * of strings, each string having the form name=value. - */ -typedef char **FCGX_ParamArray; - -/* - * A vector of pointers representing the parameters received - * by a FastCGI application server, with the vector's length - * and last valid element so adding new parameters is efficient. - */ - -typedef struct Params { - FCGX_ParamArray vec; /* vector of strings */ - int length; /* number of string vec can hold */ - char **cur; /* current item in vec; *cur == NULL */ -} Params; -typedef Params *ParamsPtr; - -/* - * FCGX_Request Flags - * - * Setting FCGI_FAIL_ACCEPT_ON_INTR prevents FCGX_Accept() from - * restarting upon being interrupted. - */ -#define FCGI_FAIL_ACCEPT_ON_INTR 1 - -/* - * FCGX_Request -- State associated with a request. - * - * Its exposed for API simplicity, I expect parts of it to change! - */ -typedef struct FCGX_Request { - int requestId; /* valid if isBeginProcessed */ - int role; - FCGX_Stream *in; - FCGX_Stream *out; - FCGX_Stream *err; - FCGX_ParamArray envp; - - /* Don't use anything below here */ - - ParamsPtr paramsPtr; - int ipcFd; /* < 0 means no connection */ - int isBeginProcessed; /* FCGI_BEGIN_REQUEST seen */ - int keepConnection; /* don't close ipcFd at end of request */ - int appStatus; - int nWriters; /* number of open writers (0..2) */ - int flags; - int listen_sock; -} FCGX_Request; - - -/* - *====================================================================== - * Control - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_IsCGI -- - * - * Returns TRUE iff this process appears to be a CGI process - * rather than a FastCGI process. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_IsCGI(void); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Init -- - * - * Initialize the FCGX library. Call in multi-threaded apps - * before calling FCGX_Accept_r(). - * - * Returns 0 upon success. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_Init(void); - -/* - *---------------------------------------------------------------------- - * - * FCGX_OpenSocket -- - * - * Create a FastCGI listen socket. - * - * path is the Unix domain socket (named pipe for WinNT), or a colon - * followed by a port number. e.g. "/tmp/fastcgi/mysocket", ":5000" - * - * backlog is the listen queue depth used in the listen() call. - * - * Returns the socket's file descriptor or -1 on error. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_OpenSocket(const char *path, int backlog); - -/* - *---------------------------------------------------------------------- - * - * FCGX_InitRequest -- - * - * Initialize a FCGX_Request for use with FCGX_Accept_r(). - * - * sock is a file descriptor returned by FCGX_OpenSocket() or 0 (default). - * The only supported flag at this time is FCGI_FAIL_ON_INTR. - * - * Returns 0 upon success. - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_InitRequest(FCGX_Request *request, int sock, int flags); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Accept_r -- - * - * Accept a new request (multi-thread safe). Be sure to call - * FCGX_Init() first. - * - * Results: - * 0 for successful call, -1 for error. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * Creates input, output, and error streams and - * assigns them to *in, *out, and *err respectively. - * Creates a parameters data structure to be accessed - * via getenv(3) (if assigned to environ) or by FCGX_GetParam - * and assigns it to *envp. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - * DON'T use the FCGX_Request, its structure WILL change. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_Accept_r(FCGX_Request *request); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Finish_r -- - * - * Finish the request (multi-thread safe). - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_Finish_r(FCGX_Request *request); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Free -- - * - * Free the memory and, if close is true, - * IPC FD associated with the request (multi-thread safe). - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_Free(FCGX_Request * request, int close); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Accept -- - * - * Accept a new request (NOT multi-thread safe). - * - * Results: - * 0 for successful call, -1 for error. - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * Creates input, output, and error streams and - * assigns them to *in, *out, and *err respectively. - * Creates a parameters data structure to be accessed - * via getenv(3) (if assigned to environ) or by FCGX_GetParam - * and assigns it to *envp. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_Accept( - FCGX_Stream **in, - FCGX_Stream **out, - FCGX_Stream **err, - FCGX_ParamArray *envp); - -/* - *---------------------------------------------------------------------- - * - * FCGX_Finish -- - * - * Finish the current request (NOT multi-thread safe). - * - * Side effects: - * - * Finishes the request accepted by (and frees any - * storage allocated by) the previous call to FCGX_Accept. - * - * DO NOT retain pointers to the envp array or any strings - * contained in it (e.g. to the result of calling FCGX_GetParam), - * since these will be freed by the next call to FCGX_Finish - * or FCGX_Accept. - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_Finish(void); - -/* - *---------------------------------------------------------------------- - * - * FCGX_StartFilterData -- - * - * stream is an input stream for a FCGI_FILTER request. - * stream is positioned at EOF on FCGI_STDIN. - * Repositions stream to the start of FCGI_DATA. - * If the preconditions are not met (e.g. FCGI_STDIN has not - * been read to EOF) sets the stream error code to - * FCGX_CALL_SEQ_ERROR. - * - * Results: - * 0 for a normal return, < 0 for error - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_StartFilterData(FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_SetExitStatus -- - * - * Sets the exit status for stream's request. The exit status - * is the status code the request would have exited with, had - * the request been run as a CGI program. You can call - * SetExitStatus several times during a request; the last call - * before the request ends determines the value. - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_SetExitStatus(int status, FCGX_Stream *stream); - -/* - *====================================================================== - * Parameters - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetParam -- obtain value of FCGI parameter in environment - * - * - * Results: - * Value bound to name, NULL if name not present in the - * environment envp. Caller must not mutate the result - * or retain it past the end of this request. - * - *---------------------------------------------------------------------- - */ -DLLAPI char *FCGX_GetParam(const char *name, FCGX_ParamArray envp); -DLLAPI void FCGX_PutEnv(FCGX_Request *request, char *nameValue); - -/* - *====================================================================== - * Readers - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetChar -- - * - * Reads a byte from the input stream and returns it. - * - * Results: - * The byte, or EOF (-1) if the end of input has been reached. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_GetChar(FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_UnGetChar -- - * - * Pushes back the character c onto the input stream. One - * character of pushback is guaranteed once a character - * has been read. No pushback is possible for EOF. - * - * Results: - * Returns c if the pushback succeeded, EOF if not. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_UnGetChar(int c, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetStr -- - * - * Reads up to n consecutive bytes from the input stream - * into the character array str. Performs no interpretation - * of the input bytes. - * - * Results: - * Number of bytes read. If result is smaller than n, - * the end of input has been reached. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_GetStr(char *str, int n, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetLine -- - * - * Reads up to n-1 consecutive bytes from the input stream - * into the character array str. Stops before n-1 bytes - * have been read if '\n' or EOF is read. The terminating '\n' - * is copied to str. After copying the last byte into str, - * stores a '\0' terminator. - * - * Results: - * NULL if EOF is the first thing read from the input stream, - * str otherwise. - * - *---------------------------------------------------------------------- - */ -DLLAPI char *FCGX_GetLine(char *str, int n, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_HasSeenEOF -- - * - * Returns EOF if end-of-file has been detected while reading - * from stream; otherwise returns 0. - * - * Note that FCGX_HasSeenEOF(s) may return 0, yet an immediately - * following FCGX_GetChar(s) may return EOF. This function, like - * the standard C stdio function feof, does not provide the - * ability to peek ahead. - * - * Results: - * EOF if end-of-file has been detected, 0 if not. - * - *---------------------------------------------------------------------- - */ - -DLLAPI int FCGX_HasSeenEOF(FCGX_Stream *stream); - -/* - *====================================================================== - * Writers - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutChar -- - * - * Writes a byte to the output stream. - * - * Results: - * The byte, or EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_PutChar(int c, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutStr -- - * - * Writes n consecutive bytes from the character array str - * into the output stream. Performs no interpretation - * of the output bytes. - * - * Results: - * Number of bytes written (n) for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_PutStr(const char *str, int n, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_PutS -- - * - * Writes a null-terminated character string to the output stream. - * - * Results: - * number of bytes written for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_PutS(const char *str, FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_FPrintF, FCGX_VFPrintF -- - * - * Performs printf-style output formatting and writes the results - * to the output stream. - * - * Results: - * number of bytes written for normal return, - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_FPrintF(FCGX_Stream *stream, const char *format, ...); - -DLLAPI int FCGX_VFPrintF(FCGX_Stream *stream, const char *format, va_list arg); - -/* - *---------------------------------------------------------------------- - * - * FCGX_FFlush -- - * - * Flushes any buffered output. - * - * Server-push is a legitimate application of FCGX_FFlush. - * Otherwise, FCGX_FFlush is not very useful, since FCGX_Accept - * does it implicitly. Calling FCGX_FFlush in non-push applications - * results in extra writes and therefore reduces performance. - * - * Results: - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_FFlush(FCGX_Stream *stream); - -/* - *====================================================================== - * Both Readers and Writers - *====================================================================== - */ - -/* - *---------------------------------------------------------------------- - * - * FCGX_FClose -- - * - * Closes the stream. For writers, flushes any buffered - * output. - * - * Close is not a very useful operation since FCGX_Accept - * does it implicitly. Closing the out stream before the - * err stream results in an extra write if there's nothing - * in the err stream, and therefore reduces performance. - * - * Results: - * EOF (-1) if an error occurred. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_FClose(FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_GetError -- - * - * Return the stream error code. 0 means no error, > 0 - * is an errno(2) error, < 0 is an FastCGI error. - * - *---------------------------------------------------------------------- - */ -DLLAPI int FCGX_GetError(FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_ClearError -- - * - * Clear the stream error code and end-of-file indication. - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_ClearError(FCGX_Stream *stream); - -/* - *---------------------------------------------------------------------- - * - * FCGX_CreateWriter -- - * - * Create a FCGX_Stream (used by cgi-fcgi). This shouldn't - * be needed by a FastCGI applictaion. - * - *---------------------------------------------------------------------- - */ -DLLAPI FCGX_Stream *FCGX_CreateWriter( - int socket, - int requestId, - int bufflen, - int streamType); - -/* - *---------------------------------------------------------------------- - * - * FCGX_FreeStream -- - * - * Free a FCGX_Stream (used by cgi-fcgi). This shouldn't - * be needed by a FastCGI applictaion. - * - *---------------------------------------------------------------------- - */ -DLLAPI void FCGX_FreeStream(FCGX_Stream **stream); - -/* ---------------------------------------------------------------------- - * - * Prevent the lib from accepting any new requests. Signal handler safe. - * - * ---------------------------------------------------------------------- - */ -DLLAPI void FCGX_ShutdownPending(void); - -#if defined (__cplusplus) || defined (c_plusplus) -} /* terminate extern "C" { */ -#endif - -#endif /* _FCGIAPP_H */ diff --git a/sapi/cgi/libfcgi/include/fcgiappmisc.h b/sapi/cgi/libfcgi/include/fcgiappmisc.h deleted file mode 100644 index db8651a44bf88..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgiappmisc.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * fcgiappmisc.h -- - * - * Functions implemented by fcgiapp.h that aren't needed - * by normal applications, but may be useful to special - * applications. - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id$ - */ - -#ifndef _FCGIAPPMISC_H -#define _FCGIAPPMISC_H - -#include "fcgiapp.h" /* for FCGX_Stream */ - -#if defined (c_plusplus) || defined (__cplusplus) -extern "C" { -#endif - -#ifdef _WIN32 -#ifndef DLLAPI -#ifdef FCGI_STATIC -#define DLLAPI -#else -#define DLLAPI __declspec(dllimport) -#endif -#endif -#else -#define DLLAPI -#endif - -DLLAPI FCGX_Stream *CreateWriter( - int socket, - int requestId, - int bufflen, - int streamType); - -DLLAPI void FreeStream(FCGX_Stream **stream); - -#if defined (__cplusplus) || defined (c_plusplus) -} /* terminate extern "C" { */ -#endif - -#endif /* _FCGIAPPMISC_H */ diff --git a/sapi/cgi/libfcgi/include/fcgimisc.h b/sapi/cgi/libfcgi/include/fcgimisc.h deleted file mode 100644 index 20ee4a0cf0385..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgimisc.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * fcgimisc.h -- - * - * Miscellaneous definitions - * - * - * Copyright (c) 1996 Open Market, Inc. - * - * See the file "LICENSE.TERMS" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id$ - */ - -#ifndef _FCGIMISC_H -#define _FCGIMISC_H - -#ifndef FALSE -#define FALSE (0) -#endif - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef ASSERT -#define ASSERT(assertion) assert(assertion) -#endif - -#endif /* _FCGIMISC_H */ diff --git a/sapi/cgi/libfcgi/include/fcgio.h b/sapi/cgi/libfcgi/include/fcgio.h deleted file mode 100644 index 865bff385bd3d..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgio.h +++ /dev/null @@ -1,147 +0,0 @@ -// -// Provides support for FastCGI via C++ iostreams. -// -// $Id$ -// -// This work is based on routines written by George Feinberg. They -// have been mostly re-written and extensively changed by -// Michael Richards. -// -// Rewritten again with bug fixes and numerous enhancements by -// Michael Shell. -// -// And rewritten again by Rob Saccoccio. -// -// Special Thanks to Dietmar Kuehl for his help and the numerous custom -// streambuf examples on his web site. -// -// Copyright (c) 2000 Tux the Linux Penguin -// Copyright (c) 2001 Rob Saccoccio and Chelsea Networks -// -// You are free to use this software without charge or royalty -// as long as this notice is not removed or altered, and recognition -// is given to the author(s) -// -// This code is offered as-is without any warranty either expressed or -// implied; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. If it breaks, you get to keep -// both halves. - -#ifndef FCGIO_H -#define FCGIO_H - -#include - -#include "fcgiapp.h" - -#ifndef DLLAPI -#ifdef _WIN32 -#define DLLAPI __declspec(dllimport) -#else -#define DLLAPI -#endif -#endif - -/* - * fcgi_streambuf - */ -class fcgi_streambuf : public streambuf -{ -public: - - // Note that if no buf is assigned (the default), iostream methods - // such as peek(), unget() and putback() will fail. If a buf is - // assigned, I/O is a bit less effecient and output streams will - // have to be flushed (or the streambuf destroyed) before the next - // call to "accept". - DLLAPI fcgi_streambuf(FCGX_Stream * fcgx, char * buf, int len); - - DLLAPI fcgi_streambuf(char * buf, int len); - - DLLAPI fcgi_streambuf(FCGX_Stream * fcgx = NULL); - - DLLAPI ~fcgi_streambuf(void); - - DLLAPI int attach(FCGX_Stream * fcgx); - -protected: - - // Consume the put area (if buffered) and c (if c is not EOF). - DLLAPI virtual int overflow(int); - - // Flush the put area (if buffered) and the FCGX buffer to the client. - DLLAPI virtual int sync(); - - // Remove and return the current character. - DLLAPI virtual int uflow(); - - // Fill the get area (if buffered) and return the current character. - DLLAPI virtual int underflow(); - - // Use a buffer. The only reasons that a buffer would be useful is - // to support the use of the unget()/putback() or seek() methods. Using - // a buffer will result in less efficient I/O. Note: the underlying - // FastCGI library (FCGX) maintains its own input and output buffers. - DLLAPI virtual streambuf * setbuf(char * buf, int len); - - DLLAPI virtual int xsgetn(char * s, int n); - DLLAPI virtual int xsputn(const char * s, int n); - -private: - - FCGX_Stream * fcgx; - - // buf is just handy to have around - char * buf; - - // this isn't kept by the base class - int bufsize; - - void init(FCGX_Stream * fcgx, char * buf, int bufsize); - - void reset(void); -}; - -/* - * fcgi_istream - deprecated - */ -class fcgi_istream : public istream -{ -public: - - // deprecated - DLLAPI fcgi_istream(FCGX_Stream * fcgx = NULL); - - // deprecated - DLLAPI ~fcgi_istream(void) {} - - // deprecated - DLLAPI virtual void attach(FCGX_Stream * fcgx); - -private: - - fcgi_streambuf fcgi_strmbuf; -}; - -/* - * fcgi_ostream - deprecated - */ -class fcgi_ostream : public ostream -{ -public: - - // deprecated - DLLAPI fcgi_ostream(FCGX_Stream * fcgx = NULL); - - // deprecated - DLLAPI ~fcgi_ostream(void) {} - - // deprecated - DLLAPI virtual void attach(FCGX_Stream *fcgx); - -private: - - fcgi_streambuf fcgi_strmbuf; -}; - -#endif /* FCGIO_H */ diff --git a/sapi/cgi/libfcgi/include/fcgios.h b/sapi/cgi/libfcgi/include/fcgios.h deleted file mode 100644 index e0f8373fb75bc..0000000000000 --- a/sapi/cgi/libfcgi/include/fcgios.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * fcgios.h -- - * - * Description of file. - * - * - * Copyright (c) 1996 Open Market, Inc. - * All rights reserved. - * - * This file contains proprietary and confidential information and - * remains the unpublished property of Open Market, Inc. Use, - * disclosure, or reproduction is prohibited except as permitted by - * express written license agreement with Open Market, Inc. - * - * Bill Snapper - * snapper@openmarket.com - */ -#ifndef _FCGIOS_H -#define _FCGIOS_H - -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -#endif - -#include "fcgi_config.h" - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#if defined (c_plusplus) || defined (__cplusplus) -extern "C" { -#endif - -#ifdef _WIN32 -#define OS_Errno GetLastError() -#define OS_SetErrno(err) SetLastError(err) -#ifndef O_NONBLOCK -#define O_NONBLOCK 0x0004 /* no delay */ -#endif -#else /* !_WIN32 */ -#define OS_Errno errno -#define OS_SetErrno(err) errno = (err) -#endif /* !_WIN32 */ - -#ifndef DLLAPI -#ifdef _WIN32 -#if defined(_LIB) || defined(FCGI_STATIC) -#define DLLAPI -#else -#define DLLAPI __declspec(dllimport) -#endif -#else -#define DLLAPI -#endif -#endif - - -/* This is the initializer for a "struct timeval" used in a select() call - * right after a new request is accept()ed to determine readablity. Its - * a drop-dead timer. Its only used for AF_UNIX sockets (not TCP sockets). - * Its a workaround for a kernel bug in Linux 2.0.x and SCO Unixware. - * Making this as small as possible, yet remain reliable would be best. - * 2 seconds is very conservative. 0,0 is not reliable. The shorter the - * timeout, the faster request processing will recover. The longer the - * timeout, the more likely this application being "busy" will cause other - * requests to abort and cause more dead sockets that need this timeout. */ -#define READABLE_UNIX_FD_DROP_DEAD_TIMEVAL 2,0 - -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif - -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif - -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif - -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - -#ifndef X_OK -#define X_OK 0x01 -#endif - -#ifndef _CLIENTDATA -# if defined(__STDC__) || defined(__cplusplus) - typedef void *ClientData; -# else - typedef int *ClientData; -# endif /* __STDC__ */ -#define _CLIENTDATA -#endif -#define MUTEX_VARNAME "_FCGI_MUTEX_" -#define SHUTDOWN_EVENT_NAME "_FCGI_SHUTDOWN_EVENT_" - -typedef void (*OS_AsyncProc) (ClientData clientData, int len); - -DLLAPI int OS_LibInit(int stdioFds[3]); -DLLAPI void OS_LibShutdown(void); -DLLAPI int OS_CreateLocalIpcFd(const char *bindPath, int backlog, int bCreateMutex); -DLLAPI int OS_FcgiConnect(char *bindPath); -DLLAPI int OS_Read(int fd, char * buf, size_t len); -DLLAPI int OS_Write(int fd, char * buf, size_t len); -#ifdef _WIN32 -DLLAPI int OS_SpawnChild(char *execPath, int listenFd, PROCESS_INFORMATION *pInfo, char *env); -#else -DLLAPI int OS_SpawnChild(char *execPath, int listenfd); -#endif -DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr, - ClientData clientData); -DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData); -DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData); -DLLAPI int OS_Close(int fd); -DLLAPI int OS_CloseRead(int fd); -DLLAPI int OS_DoIo(struct timeval *tmo); -DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs); -DLLAPI int OS_IpcClose(int ipcFd); -DLLAPI int OS_IsFcgi(int sock); -DLLAPI void OS_SetFlags(int fd, int flags); - -DLLAPI void OS_ShutdownPending(void); - -#ifdef _WIN32 -DLLAPI int OS_SetImpersonate(void); -#endif - -#if defined (__cplusplus) || defined (c_plusplus) -} /* terminate extern "C" { */ -#endif - -#endif /* _FCGIOS_H */ diff --git a/sapi/cgi/libfcgi/libfcgi.m4 b/sapi/cgi/libfcgi/libfcgi.m4 deleted file mode 100644 index 28e73d46a061b..0000000000000 --- a/sapi/cgi/libfcgi/libfcgi.m4 +++ /dev/null @@ -1,77 +0,0 @@ -dnl $Id$ -dnl -dnl This file is an input file used by the GNU "autoconf" program to -dnl generate the file "configure", which is run during the build -dnl to configure the system for the local environment. - -#AC_INIT -#AM_INIT_AUTOMAKE(fcgi, 2.2.3-SNAP-0203171857) - -#AM_CONFIG_HEADER(include/fcgi_config.h) - -#AC_PROG_CC -#AC_PROG_CPP -#AC_PROG_INSTALL -#AC_PROG_LIBTOOL - -#AC_PROG_CXX - -#AC_LANG([C++]) - -#dnl autoconf defaults CXX to 'g++', so its unclear whether it exists/works -#AC_MSG_CHECKING([whether $CXX works]) -#AC_TRY_COMPILE([#include ], -# [std::cout << "ok";], -# [AC_MSG_RESULT(yes) -# LIBFCGIXX=libfcgi++.la -# ECHO_CPP=echo-cpp${EXEEXT} -# AC_MSG_CHECKING([whether cin has a streambuf assignment operator]) -# AC_TRY_COMPILE([#include ], -# [cin = static_cast(0);], -# [AC_MSG_RESULT(yes) -# AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF], [1], -# [Define if cin/cout/cerr has a streambuf assignment operator])], -# [AC_MSG_RESULT(no)]) -# AC_MSG_CHECKING([whether char_type is defined in the context of streambuf]) -# AC_TRY_COMPILE([#include ], -# [class fcgi_streambuf : public std::streambuf { char_type ct; }], -# [AC_MSG_RESULT(yes) -# AC_DEFINE([HAVE_STREAMBUF_CHAR_TYPE], [1], -# [Define if char_type is defined in the context of streambuf])], -# [AC_MSG_RESULT(no)])], -# [AC_MSG_RESULT(no)]) -#AC_SUBST(LIBFCGIXX) -#AC_SUBST(ECHO_CPP) - -#AC_LANG([C]) - -AC_CHECK_LIB([nsl], [gethostbyname]) -AC_CHECK_LIB([socket], [socket]) - -ACX_PTHREAD([THREADED=threaded${EXEEXT}]) -AC_SUBST([THREADED]) - -FCGI_COMMON_CHECKS - -AC_REPLACE_FUNCS([strerror]) - -#AC_C_INLINE - -#-------------------------------------------------------------------- -# This is a little hokie in that it avoids including config.guess -# and config.sub in the distribution, but its been working so far. -# Windows builds don't run configure so we should be safe fixing -# this to 'unix' (at least for now). -#-------------------------------------------------------------------- -#SYSTEM=unix -#AC_SUBST([SYSTEM]) - -#AC_PROG_CC_WARNINGS - -#AC_CONFIG_FILES([Makefile -# cgi-fcgi/Makefile -# include/Makefile -# libfcgi/Makefile -# examples/Makefile]) - -#AC_OUTPUT diff --git a/sapi/cgi/libfcgi/os_unix.c b/sapi/cgi/libfcgi/os_unix.c deleted file mode 100644 index bbaf112621997..0000000000000 --- a/sapi/cgi/libfcgi/os_unix.c +++ /dev/null @@ -1,1273 +0,0 @@ -/* - * os_unix.c -- - * - * Description of file. - * - * - * Copyright (c) 1995 Open Market, Inc. - * All rights reserved. - * - * This file contains proprietary and confidential information and - * remains the unpublished property of Open Market, Inc. Use, - * disclosure, or reproduction is prohibited except as permitted by - * express written license agreement with Open Market, Inc. - * - * Bill Snapper - * snapper@openmarket.com - */ - -#ifndef lint -static const char rcsid[] = "$Id$"; -#endif /* not lint */ - -#include "fcgi_config.h" - -#include - -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#include -#include -#include -#include /* for fcntl */ -#include -#include /* for memchr() */ -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_NETDB_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include /* for getpeername */ -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "fastcgi.h" -#include "fcgimisc.h" -#include "fcgios.h" - -#ifndef INADDR_NONE -#define INADDR_NONE ((unsigned long) -1) -#endif - -/* - * This structure holds an entry for each oustanding async I/O operation. - */ -typedef struct { - OS_AsyncProc procPtr; /* callout completion procedure */ - ClientData clientData; /* caller private data */ - int fd; - int len; - int offset; - void *buf; - int inUse; -} AioInfo; - -/* - * Entries in the async I/O table are allocated 2 per file descriptor. - * - * Read Entry Index = fd * 2 - * Write Entry Index = (fd * 2) + 1 - */ -#define AIO_RD_IX(fd) (fd * 2) -#define AIO_WR_IX(fd) ((fd * 2) + 1) - -static int asyncIoInUse = FALSE; -static int asyncIoTableSize = 16; -static AioInfo *asyncIoTable = NULL; - -static int libInitialized = FALSE; - -static fd_set readFdSet; -static fd_set writeFdSet; - -static fd_set readFdSetPost; -static int numRdPosted = 0; -static fd_set writeFdSetPost; -static int numWrPosted = 0; -static int volatile maxFd = -1; - -static int shutdownPending = FALSE; -static int shutdownNow = FALSE; - -#ifndef HAVE_STRLCPY -#define strlcpy php_strlcpy -#endif -size_t strlcpy(char *dst, const char *src, size_t siz); - -void OS_ShutdownPending() -{ - shutdownPending = TRUE; -} - -static void OS_Sigusr1Handler(int signo) -{ - OS_ShutdownPending(); -} - -static void OS_SigpipeHandler(int signo) -{ - ; -} - -static void installSignalHandler(int signo, const struct sigaction * act, int force) -{ - struct sigaction sa; - - sigaction(signo, NULL, &sa); - - if (force || sa.sa_handler == SIG_DFL) - { - sigaction(signo, act, NULL); - } -} - -static void OS_InstallSignalHandlers(int force) -{ - struct sigaction sa; - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - - sa.sa_handler = OS_SigpipeHandler; - installSignalHandler(SIGPIPE, &sa, force); - - sa.sa_handler = OS_Sigusr1Handler; - installSignalHandler(SIGUSR1, &sa, force); -} - -/* - *-------------------------------------------------------------- - * - * OS_LibInit -- - * - * Set up the OS library for use. - * - * NOTE: This function is really only needed for application - * asynchronous I/O. It will most likely change in the - * future to setup the multi-threaded environment. - * - * Results: - * Returns 0 if success, -1 if not. - * - * Side effects: - * Async I/O table allocated and initialized. - * - *-------------------------------------------------------------- - */ -int OS_LibInit(int stdioFds[3]) -{ - if(libInitialized) - return 0; - - asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo)); - if(asyncIoTable == NULL) { - errno = ENOMEM; - return -1; - } - memset((char *) asyncIoTable, 0, - asyncIoTableSize * sizeof(AioInfo)); - - FD_ZERO(&readFdSet); - FD_ZERO(&writeFdSet); - FD_ZERO(&readFdSetPost); - FD_ZERO(&writeFdSetPost); - - OS_InstallSignalHandlers(FALSE); - - libInitialized = TRUE; - - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_LibShutdown -- - * - * Shutdown the OS library. - * - * Results: - * None. - * - * Side effects: - * Memory freed, fds closed. - * - *-------------------------------------------------------------- - */ -void OS_LibShutdown() -{ - if(!libInitialized) - return; - - free(asyncIoTable); - asyncIoTable = NULL; - libInitialized = FALSE; - return; -} - -/* - *---------------------------------------------------------------------- - * - * OS_BuildSockAddrUn -- - * - * Using the pathname bindPath, fill in the sockaddr_un structure - * *servAddrPtr and the length of this structure *servAddrLen. - * - * The format of the sockaddr_un structure changed incompatibly in - * 4.3BSD Reno. Digital UNIX supports both formats, other systems - * support one or the other. - * - * Results: - * 0 for normal return, -1 for failure (bindPath too long). - * - *---------------------------------------------------------------------- - */ - -static int OS_BuildSockAddrUn(const char *bindPath, - struct sockaddr_un *servAddrPtr, - int *servAddrLen) -{ - int bindPathLen = strlen(bindPath); - -#ifdef HAVE_SOCKADDR_UN_SUN_LEN /* 4.3BSD Reno and later: BSDI, DEC */ - if(bindPathLen >= sizeof(servAddrPtr->sun_path)) { - return -1; - } -#else /* 4.3 BSD Tahoe: Solaris, HPUX, DEC, ... */ - if(bindPathLen > sizeof(servAddrPtr->sun_path)) { - return -1; - } -#endif - memset((char *) servAddrPtr, 0, sizeof(*servAddrPtr)); - servAddrPtr->sun_family = AF_UNIX; - memcpy(servAddrPtr->sun_path, bindPath, bindPathLen); -#ifdef HAVE_SOCKADDR_UN_SUN_LEN /* 4.3BSD Reno and later: BSDI, DEC */ - *servAddrLen = sizeof(servAddrPtr->sun_len) - + sizeof(servAddrPtr->sun_family) - + bindPathLen + 1; - servAddrPtr->sun_len = *servAddrLen; -#else /* 4.3 BSD Tahoe: Solaris, HPUX, DEC, ... */ - *servAddrLen = sizeof(servAddrPtr->sun_family) + bindPathLen; -#endif - return 0; -} -union SockAddrUnion { - struct sockaddr_un unixVariant; - struct sockaddr_in inetVariant; -}; - -/* - * OS_CreateLocalIpcFd -- - * - * This procedure is responsible for creating the listener socket - * on Unix for local process communication. It will create a - * domain socket or a TCP/IP socket bound to "localhost" and return - * a file descriptor to it to the caller. - * bCreateMutex is ignored for unix - * - * Results: - * Listener socket created. This call returns either a valid - * file descriptor or -1 on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -int OS_CreateLocalIpcFd(const char *bindPath, int backlog, int bCreateMutex) -{ - int listenSock, servLen; - union SockAddrUnion sa; - int tcp = FALSE; - unsigned long tcp_ia = 0; - char *tp; - short port = 0; - char host[MAXPATHLEN]; - - strlcpy(host, bindPath, MAXPATHLEN-1); - if((tp = strchr(host, ':')) != 0) { - *tp++ = 0; - if((port = atoi(tp)) == 0) { - *--tp = ':'; - } else { - tcp = TRUE; - } - } - if(tcp) { - if (!*host || !strcmp(host,"*")) { - tcp_ia = htonl(INADDR_ANY); - } else { - tcp_ia = inet_addr(host); - if (tcp_ia == INADDR_NONE) { - struct hostent * hep; - hep = gethostbyname(host); - if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) { - fprintf(stderr, "Cannot resolve host name %s -- exiting!\n", host); - return -1; - } - if (hep->h_addr_list[1]) { - fprintf(stderr, "Host %s has multiple addresses ---\n", host); - fprintf(stderr, "you must choose one explicitly!!!\n"); - return -1; - } - tcp_ia = ((struct in_addr *) (hep->h_addr))->s_addr; - } - } - } - - if(tcp) { - listenSock = socket(AF_INET, SOCK_STREAM, 0); - if(listenSock >= 0) { - int flag = 1; - if(setsockopt(listenSock, SOL_SOCKET, SO_REUSEADDR, - (char *) &flag, sizeof(flag)) < 0) { - fprintf(stderr, "Can't set SO_REUSEADDR.\n"); - return -1; - } - } - } else { - listenSock = socket(AF_UNIX, SOCK_STREAM, 0); - } - if(listenSock < 0) { - return -1; - } - - /* - * Bind the listening socket. - */ - if(tcp) { - memset((char *) &sa.inetVariant, 0, sizeof(sa.inetVariant)); - sa.inetVariant.sin_family = AF_INET; - sa.inetVariant.sin_addr.s_addr = tcp_ia; - sa.inetVariant.sin_port = htons(port); - servLen = sizeof(sa.inetVariant); - } else { - unlink(bindPath); - if(OS_BuildSockAddrUn(bindPath, &sa.unixVariant, &servLen)) { - fprintf(stderr, "Listening socket's path name is too long.\n"); - return -1; - } - } - if(bind(listenSock, (struct sockaddr *) &sa.unixVariant, servLen) < 0 - || listen(listenSock, backlog) < 0) { - perror("bind/listen"); - return -1; - } - - return listenSock; -} - -/* - *---------------------------------------------------------------------- - * - * OS_FcgiConnect -- - * - * Create the socket and connect to the remote application if - * possible. - * - * This was lifted from the cgi-fcgi application and was abstracted - * out because Windows NT does not have a domain socket and must - * use a named pipe which has a different API altogether. - * - * Results: - * -1 if fail or a valid file descriptor if connection succeeds. - * - * Side effects: - * Remote connection established. - * - *---------------------------------------------------------------------- - */ -int OS_FcgiConnect(char *bindPath) -{ - union SockAddrUnion sa; - int servLen, resultSock; - int connectStatus; - char *tp; - char host[MAXPATHLEN]; - short port = 0; - int tcp = FALSE; - - strlcpy(host, bindPath, MAXPATHLEN-1); - if((tp = strchr(host, ':')) != 0) { - *tp++ = 0; - if((port = atoi(tp)) == 0) { - *--tp = ':'; - } else { - tcp = TRUE; - } - } - if(tcp == TRUE) { - struct hostent *hp; - if((hp = gethostbyname((*host ? host : "localhost"))) == NULL) { - fprintf(stderr, "Unknown host: %s\n", bindPath); - return -1; - } - sa.inetVariant.sin_family = AF_INET; - memcpy(&sa.inetVariant.sin_addr, hp->h_addr, hp->h_length); - sa.inetVariant.sin_port = htons(port); - servLen = sizeof(sa.inetVariant); - resultSock = socket(AF_INET, SOCK_STREAM, 0); - } else { - if(OS_BuildSockAddrUn(bindPath, &sa.unixVariant, &servLen)) { - fprintf(stderr, "Listening socket's path name is too long.\n"); - return -1; - } - resultSock = socket(AF_UNIX, SOCK_STREAM, 0); - } - - ASSERT(resultSock >= 0); - connectStatus = connect(resultSock, (struct sockaddr *) &sa.unixVariant, - servLen); - if(connectStatus >= 0) { - return resultSock; - } else { - /* - * Most likely (errno == ENOENT || errno == ECONNREFUSED) - * and no FCGI application server is running. - */ - close(resultSock); - return -1; - } -} - -/* - *-------------------------------------------------------------- - * - * OS_Read -- - * - * Pass through to the unix read function. - * - * Results: - * Returns number of byes read, 0, or -1 failure: errno - * contains actual error. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ -int OS_Read(int fd, char * buf, size_t len) -{ - if (shutdownNow) return -1; - return(read(fd, buf, len)); -} - -/* - *-------------------------------------------------------------- - * - * OS_Write -- - * - * Pass through to unix write function. - * - * Results: - * Returns number of byes read, 0, or -1 failure: errno - * contains actual error. - * - * Side effects: - * none. - * - *-------------------------------------------------------------- - */ -int OS_Write(int fd, char * buf, size_t len) -{ - if (shutdownNow) return -1; - return(write(fd, buf, len)); -} - -/* - *---------------------------------------------------------------------- - * - * OS_SpawnChild -- - * - * Spawns a new FastCGI listener process. - * - * Results: - * 0 if success, -1 if error. - * - * Side effects: - * Child process spawned. - * - *---------------------------------------------------------------------- - */ -int OS_SpawnChild(char *appPath, int listenFd) -{ - int forkResult; - - forkResult = fork(); - if(forkResult < 0) { - return -1; - } - - if(forkResult == 0) { - /* - * Close STDIN unconditionally. It's used by the parent - * process for CGI communication. The FastCGI applciation - * will be replacing this with the FastCGI listenFd IF - * STDIN_FILENO is the same as FCGI_LISTENSOCK_FILENO - * (which it is on Unix). Regardless, STDIN, STDOUT, and - * STDERR will be closed as the FastCGI process uses a - * multiplexed socket in their place. - */ - close(STDIN_FILENO); - - /* - * If the listenFd is already the value of FCGI_LISTENSOCK_FILENO - * we're set. If not, change it so the child knows where to - * get the listen socket from. - */ - if(listenFd != FCGI_LISTENSOCK_FILENO) { - dup2(listenFd, FCGI_LISTENSOCK_FILENO); - close(listenFd); - } - - close(STDOUT_FILENO); - close(STDERR_FILENO); - - /* - * We're a child. Exec the application. - * - * XXX: entire environment passes through - */ - execl(appPath, appPath, NULL); - /* - * XXX: Can't do this as we've already closed STDERR!!! - * - * perror("exec"); - */ - return -1; - } - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncReadStdin -- - * - * This initiates an asynchronous read on the standard - * input handle. - * - * The abstraction is necessary because Windows NT does not - * have a clean way of "select"ing a file descriptor for - * I/O. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous bit is set in the readfd variable and - * request is enqueued. - * - *-------------------------------------------------------------- - */ -int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr, - ClientData clientData) -{ - int index = AIO_RD_IX(STDIN_FILENO); - - asyncIoInUse = TRUE; - ASSERT(asyncIoTable[index].inUse == 0); - asyncIoTable[index].procPtr = procPtr; - asyncIoTable[index].clientData = clientData; - asyncIoTable[index].fd = STDIN_FILENO; - asyncIoTable[index].len = len; - asyncIoTable[index].offset = 0; - asyncIoTable[index].buf = buf; - asyncIoTable[index].inUse = 1; - FD_SET(STDIN_FILENO, &readFdSet); - if(STDIN_FILENO > maxFd) - maxFd = STDIN_FILENO; - return 0; -} - -static void GrowAsyncTable(void) -{ - int oldTableSize = asyncIoTableSize; - - asyncIoTableSize = asyncIoTableSize * 2; - asyncIoTable = (AioInfo *)realloc(asyncIoTable, asyncIoTableSize * sizeof(AioInfo)); - if(asyncIoTable == NULL) { - errno = ENOMEM; - exit(errno); - } - memset((char *) &asyncIoTable[oldTableSize], 0, - oldTableSize * sizeof(AioInfo)); - -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncRead -- - * - * This initiates an asynchronous read on the file - * handle which may be a socket or named pipe. - * - * We also must save the ProcPtr and ClientData, so later - * when the io completes, we know who to call. - * - * We don't look at any results here (the ReadFile may - * return data if it is cached) but do all completion - * processing in OS_Select when we get the io completion - * port done notifications. Then we call the callback. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous I/O operation is queued for completion. - * - *-------------------------------------------------------------- - */ -int OS_AsyncRead(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData) -{ - int index = AIO_RD_IX(fd); - - ASSERT(asyncIoTable != NULL); - asyncIoInUse = TRUE; - - if(fd > maxFd) - maxFd = fd; - - if(index >= asyncIoTableSize) { - GrowAsyncTable(); - } - - ASSERT(asyncIoTable[index].inUse == 0); - asyncIoTable[index].procPtr = procPtr; - asyncIoTable[index].clientData = clientData; - asyncIoTable[index].fd = fd; - asyncIoTable[index].len = len; - asyncIoTable[index].offset = offset; - asyncIoTable[index].buf = buf; - asyncIoTable[index].inUse = 1; - FD_SET(fd, &readFdSet); - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncWrite -- - * - * This initiates an asynchronous write on the "fake" file - * descriptor (which may be a file, socket, or named pipe). - * We also must save the ProcPtr and ClientData, so later - * when the io completes, we know who to call. - * - * We don't look at any results here (the WriteFile generally - * completes immediately) but do all completion processing - * in OS_DoIo when we get the io completion port done - * notifications. Then we call the callback. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous I/O operation is queued for completion. - * - *-------------------------------------------------------------- - */ -int OS_AsyncWrite(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData) -{ - int index = AIO_WR_IX(fd); - - asyncIoInUse = TRUE; - - if(fd > maxFd) - maxFd = fd; - - if(index >= asyncIoTableSize) { - GrowAsyncTable(); - } - - ASSERT(asyncIoTable[index].inUse == 0); - asyncIoTable[index].procPtr = procPtr; - asyncIoTable[index].clientData = clientData; - asyncIoTable[index].fd = fd; - asyncIoTable[index].len = len; - asyncIoTable[index].offset = offset; - asyncIoTable[index].buf = buf; - asyncIoTable[index].inUse = 1; - FD_SET(fd, &writeFdSet); - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_Close -- - * - * Closes the descriptor. This is a pass through to the - * Unix close. - * - * Results: - * 0 for success, -1 on failure - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ -int OS_Close(int fd) -{ - if (fd == -1) - return 0; - - if (asyncIoInUse) { - int index = AIO_RD_IX(fd); - - FD_CLR(fd, &readFdSet); - FD_CLR(fd, &readFdSetPost); - if (asyncIoTable[index].inUse != 0) { - asyncIoTable[index].inUse = 0; - } - - FD_CLR(fd, &writeFdSet); - FD_CLR(fd, &writeFdSetPost); - index = AIO_WR_IX(fd); - if (asyncIoTable[index].inUse != 0) { - asyncIoTable[index].inUse = 0; - } - - if (maxFd == fd) { - maxFd--; - } - } - return close(fd); -} - -/* - *-------------------------------------------------------------- - * - * OS_CloseRead -- - * - * Cancel outstanding asynchronous reads and prevent subsequent - * reads from completing. - * - * Results: - * Socket or file is shutdown. Return values mimic Unix shutdown: - * 0 success, -1 failure - * - *-------------------------------------------------------------- - */ -int OS_CloseRead(int fd) -{ - if(asyncIoTable[AIO_RD_IX(fd)].inUse != 0) { - asyncIoTable[AIO_RD_IX(fd)].inUse = 0; - FD_CLR(fd, &readFdSet); - } - - return shutdown(fd, 0); -} - -/* - *-------------------------------------------------------------- - * - * OS_DoIo -- - * - * This function was formerly OS_Select. It's purpose is - * to pull I/O completion events off the queue and dispatch - * them to the appropriate place. - * - * Results: - * Returns 0. - * - * Side effects: - * Handlers are called. - * - *-------------------------------------------------------------- - */ -int OS_DoIo(struct timeval *tmo) -{ - int fd, len, selectStatus; - OS_AsyncProc procPtr; - ClientData clientData; - AioInfo *aioPtr; - fd_set readFdSetCpy; - fd_set writeFdSetCpy; - - asyncIoInUse = TRUE; - FD_ZERO(&readFdSetCpy); - FD_ZERO(&writeFdSetCpy); - - for(fd = 0; fd <= maxFd; fd++) { - if(FD_ISSET(fd, &readFdSet)) { - FD_SET(fd, &readFdSetCpy); - } - if(FD_ISSET(fd, &writeFdSet)) { - FD_SET(fd, &writeFdSetCpy); - } - } - - /* - * If there were no completed events from a prior call, see if there's - * any work to do. - */ - if(numRdPosted == 0 && numWrPosted == 0) { - selectStatus = select((maxFd+1), &readFdSetCpy, &writeFdSetCpy, - NULL, tmo); - if(selectStatus < 0) { - /*exit(errno);*/ - /* not sure what's best to do here */ - return -1; - } - - for(fd = 0; fd <= maxFd; fd++) { - /* - * Build up a list of completed events. We'll work off of - * this list as opposed to looping through the read and write - * fd sets since they can be affected by a callbacl routine. - */ - if(FD_ISSET(fd, &readFdSetCpy)) { - numRdPosted++; - FD_SET(fd, &readFdSetPost); - FD_CLR(fd, &readFdSet); - } - - if(FD_ISSET(fd, &writeFdSetCpy)) { - numWrPosted++; - FD_SET(fd, &writeFdSetPost); - FD_CLR(fd, &writeFdSet); - } - } - } - - if(numRdPosted == 0 && numWrPosted == 0) - return 0; - - for(fd = 0; fd <= maxFd; fd++) { - /* - * Do reads and dispatch callback. - */ - if(FD_ISSET(fd, &readFdSetPost) - && asyncIoTable[AIO_RD_IX(fd)].inUse) { - - numRdPosted--; - FD_CLR(fd, &readFdSetPost); - aioPtr = &asyncIoTable[AIO_RD_IX(fd)]; - - len = read(aioPtr->fd, aioPtr->buf, aioPtr->len); - - procPtr = aioPtr->procPtr; - aioPtr->procPtr = NULL; - clientData = aioPtr->clientData; - aioPtr->inUse = 0; - - (*procPtr)(clientData, len); - } - - /* - * Do writes and dispatch callback. - */ - if(FD_ISSET(fd, &writeFdSetPost) && - asyncIoTable[AIO_WR_IX(fd)].inUse) { - - numWrPosted--; - FD_CLR(fd, &writeFdSetPost); - aioPtr = &asyncIoTable[AIO_WR_IX(fd)]; - - len = write(aioPtr->fd, aioPtr->buf, aioPtr->len); - - procPtr = aioPtr->procPtr; - aioPtr->procPtr = NULL; - clientData = aioPtr->clientData; - aioPtr->inUse = 0; - (*procPtr)(clientData, len); - } - } - return 0; -} - -/* - * Not all systems have strdup(). - * @@@ autoconf should determine whether or not this is needed, but for now.. - */ -static char * str_dup(const char * str) -{ - char * sdup = (char *) malloc(strlen(str) + 1); - - if (sdup) - strcpy(sdup, str); - - return sdup; -} - -/* - *---------------------------------------------------------------------- - * - * ClientAddrOK -- - * - * Checks if a client address is in a list of allowed addresses - * - * Results: - * TRUE if address list is empty or client address is present - * in the list, FALSE otherwise. - * - *---------------------------------------------------------------------- - */ -static int ClientAddrOK(struct sockaddr_in *saPtr, const char *clientList) -{ - int result = FALSE; - char *clientListCopy, *cur, *next; - - if (clientList == NULL || *clientList == '\0') { - return TRUE; - } - - clientListCopy = str_dup(clientList); - - for (cur = clientListCopy; cur != NULL; cur = next) { - next = strchr(cur, ','); - if (next != NULL) { - *next++ = '\0'; - } - if (inet_addr(cur) == saPtr->sin_addr.s_addr) { - result = TRUE; - break; - } - } - - free(clientListCopy); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * AcquireLock -- - * - * On platforms that implement concurrent calls to accept - * on a shared listening ipcFd, returns 0. On other platforms, - * acquires an exclusive lock across all processes sharing a - * listening ipcFd, blocking until the lock has been acquired. - * - * Results: - * 0 for successful call, -1 in case of system error (fatal). - * - * Side effects: - * This process now has the exclusive lock. - * - *---------------------------------------------------------------------- - */ -static int AcquireLock(int sock, int fail_on_intr) -{ -#ifdef USE_LOCKING - do { - struct flock lock; - lock.l_type = F_WRLCK; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 0; - - if (fcntl(sock, F_SETLKW, &lock) != -1) - return 0; - } while (errno == EINTR - && ! fail_on_intr - && ! shutdownPending); - - return -1; - -#else - return 0; -#endif -} - -/* - *---------------------------------------------------------------------- - * - * ReleaseLock -- - * - * On platforms that implement concurrent calls to accept - * on a shared listening ipcFd, does nothing. On other platforms, - * releases an exclusive lock acquired by AcquireLock. - * - * Results: - * 0 for successful call, -1 in case of system error (fatal). - * - * Side effects: - * This process no longer holds the lock. - * - *---------------------------------------------------------------------- - */ -static int ReleaseLock(int sock) -{ -#ifdef USE_LOCKING - do { - struct flock lock; - lock.l_type = F_UNLCK; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 0; - - if (fcntl(sock, F_SETLK, &lock) != -1) - return 0; - } while (errno == EINTR); - - return -1; - -#else - return 0; -#endif -} - -/********************************************************************** - * Determine if the errno resulting from a failed accept() warrants a - * retry or exit(). Based on Apache's http_main.c accept() handling - * and Stevens' Unix Network Programming Vol 1, 2nd Ed, para. 15.6. - */ -static int is_reasonable_accept_errno (const int error) -{ - switch (error) { -#ifdef EPROTO - /* EPROTO on certain older kernels really means ECONNABORTED, so - * we need to ignore it for them. See discussion in new-httpd - * archives nh.9701 search for EPROTO. Also see nh.9603, search - * for EPROTO: There is potentially a bug in Solaris 2.x x<6, and - * other boxes that implement tcp sockets in userland (i.e. on top of - * STREAMS). On these systems, EPROTO can actually result in a fatal - * loop. See PR#981 for example. It's hard to handle both uses of - * EPROTO. */ - case EPROTO: -#endif -#ifdef ECONNABORTED - case ECONNABORTED: -#endif - /* Linux generates the rest of these, other tcp stacks (i.e. - * bsd) tend to hide them behind getsockopt() interfaces. They - * occur when the net goes sour or the client disconnects after the - * three-way handshake has been done in the kernel but before - * userland has picked up the socket. */ -#ifdef ECONNRESET - case ECONNRESET: -#endif -#ifdef ETIMEDOUT - case ETIMEDOUT: -#endif -#ifdef EHOSTUNREACH - case EHOSTUNREACH: -#endif -#ifdef ENETUNREACH - case ENETUNREACH: -#endif - return 1; - - default: - return 0; - } -} - -/********************************************************************** - * This works around a problem on Linux 2.0.x and SCO Unixware (maybe - * others?). When a connect() is made to a Unix Domain socket, but its - * not accept()ed before the web server gets impatient and close()s, an - * accept() results in a valid file descriptor, but no data to read. - * This causes a block on the first read() - which never returns! - * - * Another approach to this is to write() to the socket to provoke a - * SIGPIPE, but this is a pain because of the FastCGI protocol, the fact - * that whatever is written has to be universally ignored by all FastCGI - * web servers, and a SIGPIPE handler has to be installed which returns - * (or SIGPIPE is ignored). - * - * READABLE_UNIX_FD_DROP_DEAD_TIMEVAL = 2,0 by default. - * - * Making it shorter is probably safe, but I'll leave that to you. Making - * it 0,0 doesn't work reliably. The shorter you can reliably make it, - * the faster your application will be able to recover (waiting 2 seconds - * may _cause_ the problem when there is a very high demand). At any rate, - * this is better than perma-blocking. - */ -static int is_af_unix_keeper(const int fd) -{ - struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL }; - fd_set read_fds; - - FD_ZERO(&read_fds); - FD_SET(fd, &read_fds); - - return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds); -} - -/* - *---------------------------------------------------------------------- - * - * OS_Accept -- - * - * Accepts a new FastCGI connection. This routine knows whether - * we're dealing with TCP based sockets or NT Named Pipes for IPC. - * - * Results: - * -1 if the operation fails, otherwise this is a valid IPC fd. - * - * Side effects: - * New IPC connection is accepted. - * - *---------------------------------------------------------------------- - */ -int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs) -{ - int socket = -1; - union { - struct sockaddr_un un; - struct sockaddr_in in; - } sa; - - for (;;) { - if (AcquireLock(listen_sock, fail_on_intr)) - return -1; - - for (;;) { - do { -#ifdef HAVE_SOCKLEN - socklen_t len = sizeof(sa); -#else - int len = sizeof(sa); -#endif - if (shutdownPending) break; - /* There's a window here */ - - socket = accept(listen_sock, (struct sockaddr *)&sa, &len); - } while (socket < 0 - && errno == EINTR - && ! fail_on_intr - && ! shutdownPending); - - if (socket < 0) { - if (shutdownPending || ! is_reasonable_accept_errno(errno)) { - int errnoSave = errno; - - ReleaseLock(listen_sock); - - if (! shutdownPending) { - errno = errnoSave; - } - - return (-1); - } - errno = 0; - } - else { /* socket >= 0 */ - int set = 1; - - if (sa.in.sin_family != AF_INET) - break; - -#ifdef TCP_NODELAY - /* No replies to outgoing data, so disable Nagle */ - setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, (char *)&set, sizeof(set)); -#endif - - /* Check that the client IP address is approved */ - if (ClientAddrOK(&sa.in, webServerAddrs)) - break; - - close(socket); - } /* socket >= 0 */ - } /* for(;;) */ - - if (ReleaseLock(listen_sock)) - return (-1); - - if (sa.in.sin_family != AF_UNIX || is_af_unix_keeper(socket)) - break; - - close(socket); - } /* while(1) - lock */ - - return (socket); -} - -/* - *---------------------------------------------------------------------- - * - * OS_IpcClose - * - * OS IPC routine to close an IPC connection. - * - * Results: - * - * - * Side effects: - * IPC connection is closed. - * - *---------------------------------------------------------------------- - */ -int OS_IpcClose(int ipcFd) -{ - return OS_Close(ipcFd); -} - -/* - *---------------------------------------------------------------------- - * - * OS_IsFcgi -- - * - * Determines whether this process is a FastCGI process or not. - * - * Results: - * Returns 1 if FastCGI, 0 if not. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -int OS_IsFcgi(int sock) -{ - union { - struct sockaddr_in in; - struct sockaddr_un un; - } sa; -#ifdef HAVE_SOCKLEN - socklen_t len = sizeof(sa); -#else - int len = sizeof(sa); -#endif - - errno = 0; - - if (getpeername(sock, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) { - return TRUE; - } - else { - return FALSE; - } -} - -/* - *---------------------------------------------------------------------- - * - * OS_SetFlags -- - * - * Sets selected flag bits in an open file descriptor. - * - *---------------------------------------------------------------------- - */ -void OS_SetFlags(int fd, int flags) -{ - int val; - if((val = fcntl(fd, F_GETFL, 0)) < 0) { - return; - } - val |= flags; - if(fcntl(fd, F_SETFL, val) < 0) { - return; - } -} diff --git a/sapi/cgi/libfcgi/os_win32.c b/sapi/cgi/libfcgi/os_win32.c deleted file mode 100644 index 723ef81060369..0000000000000 --- a/sapi/cgi/libfcgi/os_win32.c +++ /dev/null @@ -1,2067 +0,0 @@ -/* - * os_win32.c -- - * - * - * Copyright (c) 1995 Open Market, Inc. - * All rights reserved. - * - * This file contains proprietary and confidential information and - * remains the unpublished property of Open Market, Inc. Use, - * disclosure, or reproduction is prohibited except as permitted by - * express written license agreement with Open Market, Inc. - * - * Bill Snapper - * snapper@openmarket.com - * - * (Special thanks to Karen and Bill. They made my job much easier and - * significantly more enjoyable.) - */ -#ifndef lint -static const char rcsid[] = "$Id$"; -#endif /* not lint */ - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include - -#define DLLAPI __declspec(dllexport) - -#include "fcgimisc.h" -#include "fcgios.h" - -#define WIN32_OPEN_MAX 128 /* XXX: Small hack */ - -/* - * millisecs to wait for a client connection before checking the - * shutdown flag (then go back to waiting for a connection, etc). - */ -#define ACCEPT_TIMEOUT 1000 - -#define LOCALHOST "localhost" - -static HANDLE hIoCompPort = INVALID_HANDLE_VALUE; -static HANDLE hStdinCompPort = INVALID_HANDLE_VALUE; -static HANDLE hStdinThread = INVALID_HANDLE_VALUE; - -static HANDLE stdioHandles[3] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, - INVALID_HANDLE_VALUE}; - -static HANDLE acceptMutex = INVALID_HANDLE_VALUE; - -static BOOLEAN shutdownPending = FALSE; -static BOOLEAN shutdownNow = FALSE; - -static BOOLEAN bImpersonate = FALSE; -/* - * An enumeration of the file types - * supported by the FD_TABLE structure. - * - * XXX: Not all currently supported. This allows for future - * functionality. - */ -typedef enum { - FD_UNUSED, - FD_FILE_SYNC, - FD_FILE_ASYNC, - FD_SOCKET_SYNC, - FD_SOCKET_ASYNC, - FD_PIPE_SYNC, - FD_PIPE_ASYNC -} FILE_TYPE; - -typedef union { - HANDLE fileHandle; - SOCKET sock; - unsigned int value; -} DESCRIPTOR; - -/* - * Structure used to map file handle and socket handle - * values into values that can be used to create unix-like - * select bitmaps, read/write for both sockets/files. - */ -struct FD_TABLE { - DESCRIPTOR fid; - FILE_TYPE type; - char *path; - DWORD Errno; - unsigned long instance; - int status; - int offset; /* only valid for async file writes */ - LPDWORD offsetHighPtr; /* pointers to offset high and low words */ - LPDWORD offsetLowPtr; /* only valid for async file writes (logs) */ - HANDLE hMapMutex; /* mutex handle for multi-proc offset update */ - LPVOID ovList; /* List of associated OVERLAPPED_REQUESTs */ -}; - -/* - * XXX Note there is no dyanmic sizing of this table, so if the - * number of open file descriptors exceeds WIN32_OPEN_MAX the - * app will blow up. - */ -static struct FD_TABLE fdTable[WIN32_OPEN_MAX]; - -static CRITICAL_SECTION fdTableCritical; - -struct OVERLAPPED_REQUEST { - OVERLAPPED overlapped; - unsigned long instance; /* file instance (won't match after a close) */ - OS_AsyncProc procPtr; /* callback routine */ - ClientData clientData; /* callback argument */ - ClientData clientData1; /* additional clientData */ -}; -typedef struct OVERLAPPED_REQUEST *POVERLAPPED_REQUEST; - -static const char *bindPathPrefix = "\\\\.\\pipe\\FastCGI\\"; - -static FILE_TYPE listenType = FD_UNUSED; - -// XXX This should be a DESCRIPTOR -static HANDLE hListen = INVALID_HANDLE_VALUE; - -static OVERLAPPED listenOverlapped; -static BOOLEAN libInitialized = FALSE; - -/* - *-------------------------------------------------------------- - * - * Win32NewDescriptor -- - * - * Set up for I/O descriptor masquerading. - * - * Results: - * Returns "fake id" which masquerades as a UNIX-style "small - * non-negative integer" file/socket descriptor. - * Win32_* routine below will "do the right thing" based on the - * descriptor's actual type. -1 indicates failure. - * - * Side effects: - * Entry in fdTable is reserved to represent the socket/file. - * - *-------------------------------------------------------------- - */ -static int Win32NewDescriptor(FILE_TYPE type, int fd, int desiredFd) -{ - int index = -1; - - EnterCriticalSection(&fdTableCritical); - - /* - * If desiredFd is set, try to get this entry (this is used for - * mapping stdio handles). Otherwise try to get the fd entry. - * If this is not available, find a the first empty slot. . - */ - if (desiredFd >= 0 && desiredFd < WIN32_OPEN_MAX) - { - if (fdTable[desiredFd].type == FD_UNUSED) - { - index = desiredFd; - } - } - else if (fd > 0) - { - if (fd < WIN32_OPEN_MAX && fdTable[fd].type == FD_UNUSED) - { - index = fd; - } - else - { - int i; - - for (i = 1; i < WIN32_OPEN_MAX; ++i) - { - if (fdTable[i].type == FD_UNUSED) - { - index = i; - break; - } - } - } - } - - if (index != -1) - { - fdTable[index].fid.value = fd; - fdTable[index].type = type; - fdTable[index].path = NULL; - fdTable[index].Errno = NO_ERROR; - fdTable[index].status = 0; - fdTable[index].offset = -1; - fdTable[index].offsetHighPtr = fdTable[index].offsetLowPtr = NULL; - fdTable[index].hMapMutex = NULL; - fdTable[index].ovList = NULL; - } - - LeaveCriticalSection(&fdTableCritical); - return index; -} - -/* - *-------------------------------------------------------------- - * - * StdinThread-- - * - * This thread performs I/O on stadard input. It is needed - * because you can't guarantee that all applications will - * create standard input with sufficient access to perform - * asynchronous I/O. Since we don't want to block the app - * reading from stdin we make it look like it's using I/O - * completion ports to perform async I/O. - * - * Results: - * Data is read from stdin and posted to the io completion - * port. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ -static void StdinThread(LPDWORD startup){ - - int doIo = TRUE; - unsigned long fd; - unsigned long bytesRead; - POVERLAPPED_REQUEST pOv; - - // Touch the arg to prevent warning - startup = NULL; - - while(doIo) { - /* - * Block until a request to read from stdin comes in or a - * request to terminate the thread arrives (fd = -1). - */ - if (!GetQueuedCompletionStatus(hStdinCompPort, &bytesRead, &fd, - (LPOVERLAPPED *)&pOv, (DWORD)-1) && !pOv) { - doIo = 0; - break; - } - - ASSERT((fd == STDIN_FILENO) || (fd == -1)); - if(fd == -1) { - doIo = 0; - break; - } - ASSERT(pOv->clientData1 != NULL); - - if(ReadFile(stdioHandles[STDIN_FILENO], pOv->clientData1, bytesRead, - &bytesRead, NULL)) { - PostQueuedCompletionStatus(hIoCompPort, bytesRead, - STDIN_FILENO, (LPOVERLAPPED)pOv); - } else { - doIo = 0; - break; - } - } - - ExitThread(0); -} - -void OS_ShutdownPending(void) -{ - shutdownPending = TRUE; -} - -/* XXX Need a shutdown now event */ -static DWORD WINAPI ShutdownRequestThread(LPVOID arg) -{ - HANDLE shutdownEvent = (HANDLE) arg; - WaitForSingleObject(shutdownEvent, INFINITE); - shutdownPending = TRUE; - // Before an accept() is entered the shutdownPending flag is checked. - // If set, OS_Accept() will return -1. If not, it waits - // on a connection request for one second, checks the flag, & repeats. - // Only one process/thread is allowed to do this at time by - // wrapping the accept() with mutex. - return 0; -} - -int OS_SetImpersonate(void) -{ - char *os_name = NULL; - os_name = getenv("OS"); - if (os_name && stricmp(os_name, "Windows_NT") == 0) { - bImpersonate = TRUE; - return 1; - } - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_LibInit -- - * - * Set up the OS library for use. - * - * Results: - * Returns 0 if success, -1 if not. - * - * Side effects: - * Sockets initialized, pseudo file descriptors setup, etc. - * - *-------------------------------------------------------------- - */ -int OS_LibInit(int stdioFds[3]) -{ - WORD wVersion; - WSADATA wsaData; - int err; - int fakeFd; - DWORD threadId; - char *cLenPtr = NULL; - char *val = NULL; - - if(libInitialized) - return 0; - - InitializeCriticalSection(&fdTableCritical); - - /* - * Initialize windows sockets library. - */ - wVersion = MAKEWORD(2,0); - err = WSAStartup( wVersion, &wsaData ); - if (err) { - fprintf(stderr, "Error starting Windows Sockets. Error: %d", - WSAGetLastError()); - //exit(111); - return -1; - } - - /* - * Create the I/O completion port to be used for our I/O queue. - */ - if (hIoCompPort == INVALID_HANDLE_VALUE) { - hIoCompPort = CreateIoCompletionPort (INVALID_HANDLE_VALUE, NULL, - 0, 1); - if(hIoCompPort == INVALID_HANDLE_VALUE) { - printf("

              OS_LibInit Failed CreateIoCompletionPort! ERROR: %d

              \r\n\r\n", - GetLastError()); - return -1; - } - } - - /* - * If a shutdown event is in the env, save it (I don't see any to - * remove it from the environment out from under the application). - * Spawn a thread to wait on the shutdown request. - */ - val = getenv(SHUTDOWN_EVENT_NAME); - if (val != NULL) - { - HANDLE shutdownEvent = (HANDLE) atoi(val); - - if (! CreateThread(NULL, 0, ShutdownRequestThread, - shutdownEvent, 0, NULL)) - { - return -1; - } - } - - /* - * If an accept mutex is in the env, save it and remove it. - */ - val = getenv(MUTEX_VARNAME); - if (val != NULL) - { - acceptMutex = (HANDLE) atoi(val); - } - - - /* - * Determine if this library is being used to listen for FastCGI - * connections. This is communicated by STDIN containing a - * valid handle to a listener object. In this case, both the - * "stdout" and "stderr" handles will be INVALID (ie. closed) by - * the starting process. - * - * The trick is determining if this is a pipe or a socket... - * - * XXX: Add the async accept test to determine socket or handle to a - * pipe!!! - */ - if((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) && - (GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE) && - (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE) ) - { - DWORD pipeMode = PIPE_READMODE_BYTE | PIPE_WAIT; - HANDLE oldStdIn = GetStdHandle(STD_INPUT_HANDLE); - - // Move the handle to a "low" number - if (! DuplicateHandle(GetCurrentProcess(), oldStdIn, - GetCurrentProcess(), &hListen, - 0, TRUE, DUPLICATE_SAME_ACCESS)) - { - return -1; - } - - if (! SetStdHandle(STD_INPUT_HANDLE, hListen)) - { - return -1; - } - - CloseHandle(oldStdIn); - - /* - * Set the pipe handle state so that it operates in wait mode. - * - * NOTE: The listenFd is not mapped to a pseudo file descriptor - * as all work done on it is contained to the OS library. - * - * XXX: Initial assumption is that SetNamedPipeHandleState will - * fail if this is an IP socket... - */ - if (SetNamedPipeHandleState(hListen, &pipeMode, NULL, NULL)) - { - listenType = FD_PIPE_SYNC; - listenOverlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - } - else - { - listenType = FD_SOCKET_SYNC; - } - } - - /* - * If there are no stdioFds passed in, we're done. - */ - if(stdioFds == NULL) { - libInitialized = 1; - return 0; - } - - /* - * Setup standard input asynchronous I/O. There is actually a separate - * thread spawned for this purpose. The reason for this is that some - * web servers use anonymous pipes for the connection between itself - * and a CGI application. Anonymous pipes can't perform asynchronous - * I/O or use I/O completion ports. Therefore in order to present a - * consistent I/O dispatch model to an application we emulate I/O - * completion port behavior by having the standard input thread posting - * messages to the hIoCompPort which look like a complete overlapped - * I/O structure. This keeps the event dispatching simple from the - * application perspective. - */ - stdioHandles[STDIN_FILENO] = GetStdHandle(STD_INPUT_HANDLE); - - if(!SetHandleInformation(stdioHandles[STDIN_FILENO], - HANDLE_FLAG_INHERIT, 0)) { -/* - * XXX: Causes error when run from command line. Check KB - err = GetLastError(); - DebugBreak(); - exit(99); - */ - return -1; - } - - if ((fakeFd = Win32NewDescriptor(FD_PIPE_SYNC, - (int)stdioHandles[STDIN_FILENO], - STDIN_FILENO)) == -1) { - return -1; - } else { - /* - * Set stdin equal to our pseudo FD and create the I/O completion - * port to be used for async I/O. - */ - stdioFds[STDIN_FILENO] = fakeFd; - } - - /* - * Create the I/O completion port to be used for communicating with - * the thread doing I/O on standard in. This port will carry read - * and possibly thread termination requests to the StdinThread. - */ - if (hStdinCompPort == INVALID_HANDLE_VALUE) { - hStdinCompPort = CreateIoCompletionPort (INVALID_HANDLE_VALUE, NULL, - 0, 1); - if(hStdinCompPort == INVALID_HANDLE_VALUE) { - printf("

              OS_LibInit Failed CreateIoCompletionPort: STDIN! ERROR: %d

              \r\n\r\n", - GetLastError()); - return -1; - } - } - - /* - * Create the thread that will read stdin if the CONTENT_LENGTH - * is non-zero. - */ - if((cLenPtr = getenv("CONTENT_LENGTH")) != NULL && - atoi(cLenPtr) > 0) { - hStdinThread = CreateThread(NULL, 8192, - (LPTHREAD_START_ROUTINE)&StdinThread, - NULL, 0, &threadId); - if (hStdinThread == NULL) { - printf("

              OS_LibInit Failed to create STDIN thread! ERROR: %d

              \r\n\r\n", - GetLastError()); - return -1; - } - } - - /* - * STDOUT will be used synchronously. - * - * XXX: May want to convert this so that it could be used for OVERLAPPED - * I/O later. If so, model it after the Stdin I/O as stdout is - * also incapable of async I/O on some servers. - */ - stdioHandles[STDOUT_FILENO] = GetStdHandle(STD_OUTPUT_HANDLE); - if(!SetHandleInformation(stdioHandles[STDOUT_FILENO], - HANDLE_FLAG_INHERIT, FALSE)) { - //exit(99); - return -1; - } - - if ((fakeFd = Win32NewDescriptor(FD_PIPE_SYNC, - (int)stdioHandles[STDOUT_FILENO], - STDOUT_FILENO)) == -1) { - return -1; - } else { - /* - * Set stdout equal to our pseudo FD - */ - stdioFds[STDOUT_FILENO] = fakeFd; - } - - stdioHandles[STDERR_FILENO] = GetStdHandle(STD_ERROR_HANDLE); - if(!SetHandleInformation(stdioHandles[STDERR_FILENO], - HANDLE_FLAG_INHERIT, FALSE)) { - //exit(99); - return -1; - } - if ((fakeFd = Win32NewDescriptor(FD_PIPE_SYNC, - (int)stdioHandles[STDERR_FILENO], - STDERR_FILENO)) == -1) { - return -1; - } else { - /* - * Set stderr equal to our pseudo FD - */ - stdioFds[STDERR_FILENO] = fakeFd; - } - - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_LibShutdown -- - * - * Shutdown the OS library. - * - * Results: - * None. - * - * Side effects: - * Memory freed, handles closed. - * - *-------------------------------------------------------------- - */ -void OS_LibShutdown() -{ - - if (hIoCompPort != INVALID_HANDLE_VALUE) - { - CloseHandle(hIoCompPort); - hIoCompPort = INVALID_HANDLE_VALUE; - } - - if (hStdinCompPort != INVALID_HANDLE_VALUE) - { - CloseHandle(hStdinCompPort); - hStdinCompPort = INVALID_HANDLE_VALUE; - } - - if (acceptMutex != INVALID_HANDLE_VALUE) - { - ReleaseMutex(acceptMutex); - CloseHandle(acceptMutex); - } - - /* we only want to do this if we're not a web server */ - if (stdioHandles[0] != INVALID_HANDLE_VALUE) { - DisconnectNamedPipe(hListen); - CancelIo(hListen); - if (bImpersonate) RevertToSelf(); - } - - DeleteCriticalSection(&fdTableCritical); - WSACleanup(); -} - -/* - *-------------------------------------------------------------- - * - * Win32FreeDescriptor -- - * - * Free I/O descriptor entry in fdTable. - * - * Results: - * Frees I/O descriptor entry in fdTable. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ -static void Win32FreeDescriptor(int fd) -{ - /* Catch it if fd is a bogus value */ - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - - EnterCriticalSection(&fdTableCritical); - - if (fdTable[fd].type != FD_UNUSED) - { - switch (fdTable[fd].type) - { - case FD_FILE_SYNC: - case FD_FILE_ASYNC: - - /* Free file path string */ - ASSERT(fdTable[fd].path != NULL); - - free(fdTable[fd].path); - fdTable[fd].path = NULL; - break; - case FD_PIPE_ASYNC: - break; - default: - break; - } - - ASSERT(fdTable[fd].path == NULL); - - fdTable[fd].type = FD_UNUSED; - fdTable[fd].path = NULL; - fdTable[fd].Errno = NO_ERROR; - fdTable[fd].offsetHighPtr = fdTable[fd].offsetLowPtr = NULL; - - if (fdTable[fd].hMapMutex != NULL) - { - CloseHandle(fdTable[fd].hMapMutex); - fdTable[fd].hMapMutex = NULL; - } - } - - LeaveCriticalSection(&fdTableCritical); - - return; -} - -static short getPort(const char * bindPath) -{ - short port = 0; - char * p = strchr(bindPath, ':'); - - if (p && *++p) - { - char buf[6]; - - strncpy(buf, p, 6); - buf[5] = '\0'; - - port = (short) atoi(buf); - } - - return port; -} - -/** -This function builds a Dacl which grants the creator of the objects -FILE_ALL_ACCESS and Everyone FILE_GENERIC_READ and FILE_GENERIC_WRITE -access to the object. - -This Dacl allows for higher security than a NULL Dacl, which is common for -named-pipes, as this only grants the creator/owner write access to the -security descriptor, and grants Everyone the ability to "use" the named-pipe. -This scenario prevents a malevolent user from disrupting service by preventing -arbitrary access manipulation. -**/ -BOOL -BuildNamedPipeAcl( - PACL pAcl, - PDWORD cbAclSize - ) -{ - DWORD dwAclSize; - - SID_IDENTIFIER_AUTHORITY siaWorld = SECURITY_WORLD_SID_AUTHORITY; - SID_IDENTIFIER_AUTHORITY siaCreator = SECURITY_CREATOR_SID_AUTHORITY; - - BYTE BufEveryoneSid[32]; - BYTE BufOwnerSid[32]; - - PSID pEveryoneSid = (PSID)BufEveryoneSid; - PSID pOwnerSid = (PSID)BufOwnerSid; - - // - // compute size of acl - // - dwAclSize = sizeof(ACL) + - 2 * ( sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) ) + - GetSidLengthRequired( 1 ) + // well-known Everyone Sid - GetSidLengthRequired( 1 ) ; // well-known Creator Owner Sid - - if(*cbAclSize < dwAclSize) { - *cbAclSize = dwAclSize; - return FALSE; - } - - *cbAclSize = dwAclSize; - - // - // intialize well known sids - // - - if(!InitializeSid(pEveryoneSid, &siaWorld, 1)) return FALSE; - *GetSidSubAuthority(pEveryoneSid, 0) = SECURITY_WORLD_RID; - - if(!InitializeSid(pOwnerSid, &siaCreator, 1)) return FALSE; - *GetSidSubAuthority(pOwnerSid, 0) = SECURITY_CREATOR_OWNER_RID; - - if(!InitializeAcl(pAcl, dwAclSize, ACL_REVISION)) - return FALSE; - - // - // - if(!AddAccessAllowedAce( - pAcl, - ACL_REVISION, - FILE_GENERIC_READ | FILE_GENERIC_WRITE, - pEveryoneSid - )) - return FALSE; - - // - // - return AddAccessAllowedAce( - pAcl, - ACL_REVISION, - FILE_ALL_ACCESS, - pOwnerSid - ); -} - - -/* - * OS_CreateLocalIpcFd -- - * - * This procedure is responsible for creating the listener pipe - * on Windows NT for local process communication. It will create a - * named pipe and return a file descriptor to it to the caller. - * - * Results: - * Listener pipe created. This call returns either a valid - * pseudo file descriptor or -1 on error. - * - * Side effects: - * Listener pipe and IPC address are stored in the FCGI info - * structure. - * 'errno' will set on errors (-1 is returned). - * - *---------------------------------------------------------------------- - */ -int OS_CreateLocalIpcFd(const char *bindPath, int backlog, int bCreateMutex) -{ - int pseudoFd = -1; - short port = getPort(bindPath); - HANDLE mutex = INVALID_HANDLE_VALUE; - char mutexEnvString[100]; - - if (bCreateMutex) { - mutex = CreateMutex(NULL, FALSE, NULL); - if (! SetHandleInformation(mutex, HANDLE_FLAG_INHERIT, TRUE)) - { - CloseHandle(mutex); - return -3; - } - // This is a nail for listening to more than one port.. - // This should really be handled by the caller. - _snprintf(mutexEnvString, sizeof(mutexEnvString)-1, MUTEX_VARNAME "=%d", (int) mutex); - putenv(mutexEnvString); - } - - // There's nothing to be gained (at the moment) by a shutdown Event - - if (port && *bindPath != ':' && strncmp(bindPath, LOCALHOST, strlen(LOCALHOST))) - { - fprintf(stderr, "To start a service on a TCP port can not " - "specify a host name.\n" - "You should either use \"localhost:\" or " - " just use \":.\"\n"); - //exit(1); - if (bCreateMutex) CloseHandle(mutexEnvString); - return -1; - } - - listenType = (port) ? FD_SOCKET_SYNC : FD_PIPE_ASYNC; - - if (port) - { - SOCKET listenSock; - struct sockaddr_in sockAddr; - int sockLen = sizeof(sockAddr); - - memset(&sockAddr, 0, sizeof(sockAddr)); - sockAddr.sin_family = AF_INET; - sockAddr.sin_addr.s_addr = htonl(INADDR_ANY); - sockAddr.sin_port = htons(port); - - listenSock = socket(AF_INET, SOCK_STREAM, 0); - if (listenSock == INVALID_SOCKET) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -4; - } - - if (bind(listenSock, (struct sockaddr *) &sockAddr, sockLen) ) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -12; - } - - if (listen(listenSock, backlog)) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -5; - } - - pseudoFd = Win32NewDescriptor(listenType, listenSock, -1); - - if (pseudoFd == -1) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - closesocket(listenSock); - return -6; - } - - hListen = (HANDLE) listenSock; - } - else - { - SECURITY_ATTRIBUTES sa; - SECURITY_DESCRIPTOR sd; - BYTE AclBuf[ 64 ]; - DWORD cbAclSize = 64; - PACL pAcl = (PACL)AclBuf; - - HANDLE hListenPipe = INVALID_HANDLE_VALUE; - char *pipePath = malloc(strlen(bindPathPrefix) + strlen(bindPath) + 1); - - if (! pipePath) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -7; - } - - strcpy(pipePath, bindPathPrefix); - strcat(pipePath, bindPath); - - if (bImpersonate) { - // get the security attributes for Everybody to connect - // we do this so that multithreaded servers that run - // threads under secured users can access pipes created - // by a system level thread (for instance, IIS) - // - // suppress errors regarding startup directory, etc - // - SetErrorMode(SEM_FAILCRITICALERRORS); - - if(!BuildNamedPipeAcl(pAcl, &cbAclSize)) { - fprintf(stderr, "BuildNamedPipeAcl"); - return -100; - } - - if(!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) { - fprintf(stderr, "InitializeSecurityDescriptor"); - return -100; - } - - if(!SetSecurityDescriptorDacl(&sd, TRUE, pAcl, FALSE)) { - fprintf(stderr, "SetSecurityDescriptorDacl"); - return -100; - } - - sa.nLength = sizeof(SECURITY_ATTRIBUTES); - sa.lpSecurityDescriptor = &sd; // default Dacl of caller - sa.bInheritHandle = TRUE; - - } - - hListenPipe = CreateNamedPipe(pipePath, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_READMODE_BYTE, - PIPE_UNLIMITED_INSTANCES, - 4096, 4096, 0, bImpersonate?&sa:NULL); - - free(pipePath); - - if (hListenPipe == INVALID_HANDLE_VALUE) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -8; - } - - if (! SetHandleInformation(hListenPipe, HANDLE_FLAG_INHERIT, TRUE)) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - return -9; - } - - pseudoFd = Win32NewDescriptor(listenType, (int) hListenPipe, -1); - - if (pseudoFd == -1) - { - if (bCreateMutex)CloseHandle(mutexEnvString); - CloseHandle(hListenPipe); - return -10; - } - - hListen = (HANDLE) hListenPipe; - } - - return pseudoFd; -} - -/* - *---------------------------------------------------------------------- - * - * OS_FcgiConnect -- - * - * Create the pipe pathname connect to the remote application if - * possible. - * - * Results: - * -1 if fail or a valid handle if connection succeeds. - * - * Side effects: - * Remote connection established. - * - *---------------------------------------------------------------------- - */ -int OS_FcgiConnect(char *bindPath) -{ - short port = getPort(bindPath); - int pseudoFd = -1; - unsigned int flags = FILE_FLAG_OVERLAPPED; - if (port) - { - struct hostent *hp; - char *host = NULL; - struct sockaddr_in sockAddr; - int sockLen = sizeof(sockAddr); - SOCKET sock; - - if (*bindPath != ':') - { - char * p = strchr(bindPath, ':'); - if (p) { - int len = p - bindPath + 1; - - host = (char *)malloc(len); - if (!host) { - fprintf(stderr, "Unable to allocate memory\n"); - return -1; - } - strncpy(host, bindPath, len); - host[len-1] = '\0'; - } - } - - hp = gethostbyname(host ? host : LOCALHOST); - - if (host) - { - free(host); - } - - if (hp == NULL) - { - fprintf(stderr, "Unknown host: %s\n", bindPath); - return -1; - } - - memset(&sockAddr, 0, sizeof(sockAddr)); - sockAddr.sin_family = AF_INET; - memcpy(&sockAddr.sin_addr, hp->h_addr, hp->h_length); - sockAddr.sin_port = htons(port); - - sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock == INVALID_SOCKET) - { - return -1; - } - - if (connect(sock, (struct sockaddr *) &sockAddr, sockLen) == SOCKET_ERROR) - { - closesocket(sock); - return -1; - } - - pseudoFd = Win32NewDescriptor(FD_SOCKET_SYNC, sock, -1); - if (pseudoFd == -1) - { - closesocket(sock); - return -1; - } - } - else - { - char *pipePath = malloc(strlen(bindPathPrefix) + strlen(bindPath) + 1); - HANDLE hPipe; - - if (! pipePath) - { - return -1; - } - - strcpy(pipePath, bindPathPrefix); - strcat(pipePath, bindPath); - - if (bImpersonate) { - flags |= SECURITY_SQOS_PRESENT | SECURITY_IMPERSONATION; - } - - hPipe = CreateFile(pipePath, - GENERIC_WRITE | GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - flags, - NULL); - - free(pipePath); - - if( hPipe == INVALID_HANDLE_VALUE || hPipe == 0) - { - return -1; - } - - pseudoFd = Win32NewDescriptor(FD_PIPE_ASYNC, (int) hPipe, -1); - - if (pseudoFd == -1) - { - CloseHandle(hPipe); - return -1; - } - - /* - * Set stdin equal to our pseudo FD and create the I/O completion - * port to be used for async I/O. - */ - if (! CreateIoCompletionPort(hPipe, hIoCompPort, pseudoFd, 1)) - { - Win32FreeDescriptor(pseudoFd); - CloseHandle(hPipe); - return -1; - } - } - - return pseudoFd; -} - -/* - *-------------------------------------------------------------- - * - * OS_Read -- - * - * Pass through to the appropriate NT read function. - * - * Results: - * Returns number of byes read. Mimics unix read:. - * n bytes read, 0 or -1 failure: errno contains actual error - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ -int OS_Read(int fd, char * buf, size_t len) -{ - DWORD bytesRead; - int ret = -1; - - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - - if (shutdownNow) return -1; - - switch (fdTable[fd].type) - { - case FD_FILE_SYNC: - case FD_FILE_ASYNC: - case FD_PIPE_SYNC: - case FD_PIPE_ASYNC: - - if (ReadFile(fdTable[fd].fid.fileHandle, buf, len, &bytesRead, NULL)) - { - ret = bytesRead; - } - else - { - fdTable[fd].Errno = GetLastError(); - ret = -1; - } - - break; - - case FD_SOCKET_SYNC: - case FD_SOCKET_ASYNC: - - ret = recv(fdTable[fd].fid.sock, buf, len, 0); - if (ret == SOCKET_ERROR) - { - fdTable[fd].Errno = WSAGetLastError(); - ret = -1; - } - - break; - - default: - - ASSERT(0); - } - - return ret; -} - -/* - *-------------------------------------------------------------- - * - * OS_Write -- - * - * Perform a synchronous OS write. - * - * Results: - * Returns number of bytes written. Mimics unix write: - * n bytes written, 0 or -1 failure (??? couldn't find man page). - * - * Side effects: - * none. - * - *-------------------------------------------------------------- - */ -int OS_Write(int fd, char * buf, size_t len) -{ - DWORD bytesWritten; - int ret = -1; - - ASSERT(fd >= 0 && fd < WIN32_OPEN_MAX); - - if (shutdownNow) return -1; - - switch (fdTable[fd].type) - { - case FD_FILE_SYNC: - case FD_FILE_ASYNC: - case FD_PIPE_SYNC: - case FD_PIPE_ASYNC: - - if (WriteFile(fdTable[fd].fid.fileHandle, buf, len, &bytesWritten, NULL)) - { - ret = bytesWritten; - } - else - { - fdTable[fd].Errno = GetLastError(); - } - - break; - - case FD_SOCKET_SYNC: - case FD_SOCKET_ASYNC: - - ret = send(fdTable[fd].fid.sock, buf, len, 0); - if (ret == SOCKET_ERROR) - { - fdTable[fd].Errno = WSAGetLastError(); - ret = -1; - } - - break; - - default: - - ASSERT(0); - } - - return ret; -} - -/* - *---------------------------------------------------------------------- - * - * OS_SpawnChild -- - * - * Spawns a new server listener process, and stores the information - * relating to the child in the supplied record. A wait handler is - * registered on the child's completion. This involves creating - * a process on NT and preparing a command line with the required - * state (currently a -childproc flag and the server socket to use - * for accepting connections). - * - * Results: - * 0 if success, -1 if error. - * - * Side effects: - * Child process spawned. - * - *---------------------------------------------------------------------- - */ -int OS_SpawnChild(char *execPath, int listenFd, PROCESS_INFORMATION *pInfo, char *env) -{ - STARTUPINFO StartupInfo; - BOOL success; - - memset((void *)&StartupInfo, 0, sizeof(STARTUPINFO)); - StartupInfo.cb = sizeof (STARTUPINFO); - StartupInfo.lpReserved = NULL; - StartupInfo.lpReserved2 = NULL; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpDesktop = NULL; - StartupInfo.wShowWindow = SW_HIDE; - /* - * FastCGI on NT will set the listener pipe HANDLE in the stdin of - * the new process. The fact that there is a stdin and NULL handles - * for stdout and stderr tells the FastCGI process that this is a - * FastCGI process and not a CGI process. - */ - StartupInfo.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; - /* - * XXX: Do I have to dup the handle before spawning the process or is - * it sufficient to use the handle as it's reference counted - * by NT anyway? - */ - StartupInfo.hStdInput = fdTable[listenFd].fid.fileHandle; - StartupInfo.hStdOutput = INVALID_HANDLE_VALUE; - StartupInfo.hStdError = INVALID_HANDLE_VALUE; - - /* - * Make the listener socket inheritable. - */ - success = SetHandleInformation(StartupInfo.hStdInput, HANDLE_FLAG_INHERIT, - TRUE); - if(!success) { - //exit(99); - return -1; - } - - /* - * XXX: Might want to apply some specific security attributes to the - * processes. - */ - success = CreateProcess(execPath, /* LPCSTR address of module name */ - NULL, /* LPCSTR address of command line */ - NULL, /* Process security attributes */ - NULL, /* Thread security attributes */ - TRUE, /* Inheritable Handes inherited. */ - 0, /* DWORD creation flags */ - env, /* Use parent environment block */ - NULL, /* Address of current directory name */ - &StartupInfo, /* Address of STARTUPINFO */ - pInfo); /* Address of PROCESS_INFORMATION */ - if(success) { - return 0; - } else { - return -1; - } -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncReadStdin -- - * - * This initiates an asynchronous read on the standard - * input handle. This handle is not guaranteed to be - * capable of performing asynchronous I/O so we send a - * message to the StdinThread to do the synchronous read. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous message is queued to the StdinThread and an - * overlapped structure is allocated/initialized. - * - *-------------------------------------------------------------- - */ -int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr, - ClientData clientData) -{ - POVERLAPPED_REQUEST pOv; - - ASSERT(fdTable[STDIN_FILENO].type != FD_UNUSED); - - pOv = (POVERLAPPED_REQUEST)malloc(sizeof(struct OVERLAPPED_REQUEST)); - ASSERT(pOv); - memset((void *)pOv, 0, sizeof(struct OVERLAPPED_REQUEST)); - pOv->clientData1 = (ClientData)buf; - pOv->instance = fdTable[STDIN_FILENO].instance; - pOv->procPtr = procPtr; - pOv->clientData = clientData; - - PostQueuedCompletionStatus(hStdinCompPort, len, STDIN_FILENO, - (LPOVERLAPPED)pOv); - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncRead -- - * - * This initiates an asynchronous read on the file - * handle which may be a socket or named pipe. - * - * We also must save the ProcPtr and ClientData, so later - * when the io completes, we know who to call. - * - * We don't look at any results here (the ReadFile may - * return data if it is cached) but do all completion - * processing in OS_Select when we get the io completion - * port done notifications. Then we call the callback. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous I/O operation is queued for completion. - * - *-------------------------------------------------------------- - */ -int OS_AsyncRead(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData) -{ - DWORD bytesRead; - POVERLAPPED_REQUEST pOv; - - /* - * Catch any bogus fd values - */ - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - /* - * Confirm that this is an async fd - */ - ASSERT(fdTable[fd].type != FD_UNUSED); - ASSERT(fdTable[fd].type != FD_FILE_SYNC); - ASSERT(fdTable[fd].type != FD_PIPE_SYNC); - ASSERT(fdTable[fd].type != FD_SOCKET_SYNC); - - pOv = (POVERLAPPED_REQUEST)malloc(sizeof(struct OVERLAPPED_REQUEST)); - ASSERT(pOv); - memset((void *)pOv, 0, sizeof(struct OVERLAPPED_REQUEST)); - /* - * Only file offsets should be non-zero, but make sure. - */ - if (fdTable[fd].type == FD_FILE_ASYNC) - if (fdTable[fd].offset >= 0) - pOv->overlapped.Offset = fdTable[fd].offset; - else - pOv->overlapped.Offset = offset; - pOv->instance = fdTable[fd].instance; - pOv->procPtr = procPtr; - pOv->clientData = clientData; - bytesRead = fd; - /* - * ReadFile returns: TRUE success, FALSE failure - */ - if (!ReadFile(fdTable[fd].fid.fileHandle, buf, len, &bytesRead, - (LPOVERLAPPED)pOv)) { - fdTable[fd].Errno = GetLastError(); - if(fdTable[fd].Errno == ERROR_NO_DATA || - fdTable[fd].Errno == ERROR_PIPE_NOT_CONNECTED) { - PostQueuedCompletionStatus(hIoCompPort, 0, fd, (LPOVERLAPPED)pOv); - return 0; - } - if(fdTable[fd].Errno != ERROR_IO_PENDING) { - PostQueuedCompletionStatus(hIoCompPort, 0, fd, (LPOVERLAPPED)pOv); - return -1; - } - fdTable[fd].Errno = 0; - } - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_AsyncWrite -- - * - * This initiates an asynchronous write on the "fake" file - * descriptor (which may be a file, socket, or named pipe). - * We also must save the ProcPtr and ClientData, so later - * when the io completes, we know who to call. - * - * We don't look at any results here (the WriteFile generally - * completes immediately) but do all completion processing - * in OS_DoIo when we get the io completion port done - * notifications. Then we call the callback. - * - * Results: - * -1 if error, 0 otherwise. - * - * Side effects: - * Asynchronous I/O operation is queued for completion. - * - *-------------------------------------------------------------- - */ -int OS_AsyncWrite(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData) -{ - DWORD bytesWritten; - POVERLAPPED_REQUEST pOv; - - /* - * Catch any bogus fd values - */ - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - /* - * Confirm that this is an async fd - */ - ASSERT(fdTable[fd].type != FD_UNUSED); - ASSERT(fdTable[fd].type != FD_FILE_SYNC); - ASSERT(fdTable[fd].type != FD_PIPE_SYNC); - ASSERT(fdTable[fd].type != FD_SOCKET_SYNC); - - pOv = (POVERLAPPED_REQUEST)malloc(sizeof(struct OVERLAPPED_REQUEST)); - ASSERT(pOv); - memset((void *)pOv, 0, sizeof(struct OVERLAPPED_REQUEST)); - /* - * Only file offsets should be non-zero, but make sure. - */ - if (fdTable[fd].type == FD_FILE_ASYNC) - /* - * Only file opened via OS_AsyncWrite with - * O_APPEND will have an offset != -1. - */ - if (fdTable[fd].offset >= 0) - /* - * If the descriptor has a memory mapped file - * handle, take the offsets from there. - */ - if (fdTable[fd].hMapMutex != NULL) { - /* - * Wait infinitely; this *should* not cause problems. - */ - WaitForSingleObject(fdTable[fd].hMapMutex, INFINITE); - - /* - * Retrieve the shared offset values. - */ - pOv->overlapped.OffsetHigh = *(fdTable[fd].offsetHighPtr); - pOv->overlapped.Offset = *(fdTable[fd].offsetLowPtr); - - /* - * Update the shared offset values for the next write - */ - *(fdTable[fd].offsetHighPtr) += 0; /* XXX How do I handle overflow */ - *(fdTable[fd].offsetLowPtr) += len; - - ReleaseMutex(fdTable[fd].hMapMutex); - } else - pOv->overlapped.Offset = fdTable[fd].offset; - else - pOv->overlapped.Offset = offset; - pOv->instance = fdTable[fd].instance; - pOv->procPtr = procPtr; - pOv->clientData = clientData; - bytesWritten = fd; - /* - * WriteFile returns: TRUE success, FALSE failure - */ - if (!WriteFile(fdTable[fd].fid.fileHandle, buf, len, &bytesWritten, - (LPOVERLAPPED)pOv)) { - fdTable[fd].Errno = GetLastError(); - if(fdTable[fd].Errno != ERROR_IO_PENDING) { - PostQueuedCompletionStatus(hIoCompPort, 0, fd, (LPOVERLAPPED)pOv); - return -1; - } - fdTable[fd].Errno = 0; - } - if (fdTable[fd].offset >= 0) - fdTable[fd].offset += len; - return 0; -} - -/* - *-------------------------------------------------------------- - * - * OS_Close -- - * - * Closes the descriptor with routine appropriate for - * descriptor's type. - * - * Results: - * Socket or file is closed. Return values mimic Unix close: - * 0 success, -1 failure - * - * Side effects: - * Entry in fdTable is marked as free. - * - *-------------------------------------------------------------- - */ -int OS_Close(int fd) -{ - int ret = 0; - - /* - * Catch it if fd is a bogus value - */ - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - ASSERT(fdTable[fd].type != FD_UNUSED); - - switch (fdTable[fd].type) { - case FD_PIPE_SYNC: - case FD_PIPE_ASYNC: - case FD_FILE_SYNC: - case FD_FILE_ASYNC: - /* - * CloseHandle returns: TRUE success, 0 failure - */ - /* - XXX don't close here, fcgi apps fail if we do so - need to examine resource leaks if any might exist - if (CloseHandle(fdTable[fd].fid.fileHandle) == FALSE) - ret = -1; - */ - break; - case FD_SOCKET_SYNC: - case FD_SOCKET_ASYNC: - /* - * Closing a socket that has an async read outstanding causes a - * tcp reset and possible data loss. The shutdown call seems to - * prevent this. - */ - - /* shutdown(fdTable[fd].fid.sock, SD_BOTH); */ - - { - char buf[16]; - int r; - - shutdown(fdTable[fd].fid.sock,SD_SEND); - - do - { - r = recv(fdTable[fd].fid.sock,buf,16,0); - } while (r > 0); - } - /* - * closesocket returns: 0 success, SOCKET_ERROR failure - */ - if (closesocket(fdTable[fd].fid.sock) == SOCKET_ERROR) - ret = -1; - break; - default: - return -1; /* fake failure */ - } - - Win32FreeDescriptor(fd); - return ret; -} - -/* - *-------------------------------------------------------------- - * - * OS_CloseRead -- - * - * Cancel outstanding asynchronous reads and prevent subsequent - * reads from completing. - * - * Results: - * Socket or file is shutdown. Return values mimic Unix shutdown: - * 0 success, -1 failure - * - *-------------------------------------------------------------- - */ -int OS_CloseRead(int fd) -{ - int ret = 0; - - /* - * Catch it if fd is a bogus value - */ - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - ASSERT(fdTable[fd].type == FD_SOCKET_ASYNC - || fdTable[fd].type == FD_SOCKET_SYNC); - - if (shutdown(fdTable[fd].fid.sock,SD_RECEIVE) == SOCKET_ERROR) - ret = -1; - return ret; -} - -/* - *-------------------------------------------------------------- - * - * OS_DoIo -- - * - * This function was formerly OS_Select. It's purpose is - * to pull I/O completion events off the queue and dispatch - * them to the appropriate place. - * - * Results: - * Returns 0. - * - * Side effects: - * Handlers are called. - * - *-------------------------------------------------------------- - */ -int OS_DoIo(struct timeval *tmo) -{ - unsigned long fd; - unsigned long bytes; - POVERLAPPED_REQUEST pOv; - struct timeb tb; - int ms; - int ms_last; - int err; - - /* XXX - * We can loop in here, but not too long, as wait handlers - * must run. - * For cgi stdin, apparently select returns when io completion - * ports don't, so don't wait the full timeout. - */ - if(tmo) - ms = (tmo->tv_sec*1000 + tmo->tv_usec/1000) / 2; - else - ms = 1000; - ftime(&tb); - ms_last = tb.time*1000 + tb.millitm; - while (ms >= 0) { - if(tmo && (ms = tmo->tv_sec*1000 + tmo->tv_usec/1000)> 100) - ms = 100; - if (!GetQueuedCompletionStatus(hIoCompPort, &bytes, &fd, - (LPOVERLAPPED *)&pOv, ms) && !pOv) { - err = WSAGetLastError(); - return 0; /* timeout */ - } - - ASSERT((fd >= 0) && (fd < WIN32_OPEN_MAX)); - /* call callback if descriptor still valid */ - ASSERT(pOv); - if(pOv->instance == fdTable[fd].instance) - (*pOv->procPtr)(pOv->clientData, bytes); - free(pOv); - - ftime(&tb); - ms -= (tb.time*1000 + tb.millitm - ms_last); - ms_last = tb.time*1000 + tb.millitm; - } - return 0; -} - -static int isAddrOK(struct sockaddr_in * inet_sockaddr, const char * okAddrs) -{ - static const char *token = " ,;:\t"; - char *ipaddr; - char *p; - - if (okAddrs == NULL) return TRUE; - - ipaddr = inet_ntoa(inet_sockaddr->sin_addr); - p = strstr(okAddrs, ipaddr); - - if (p == NULL) return FALSE; - - if (p == okAddrs) - { - p += strlen(ipaddr); - return (strchr(token, *p) != NULL); - } - - if (strchr(token, *--p) != NULL) - { - p += strlen(ipaddr) + 1; - return (strchr(token, *p) != NULL); - } - - return FALSE; -} - -#ifndef NO_WSAACEPT -static int CALLBACK isAddrOKCallback(LPWSABUF lpCallerId, - LPWSABUF dc0, - LPQOS dc1, - LPQOS dc2, - LPWSABUF dc3, - LPWSABUF dc4, - GROUP *dc5, - DWORD data) -{ - struct sockaddr_in *sockaddr = (struct sockaddr_in *) lpCallerId->buf; - - // Touch the args to avoid warnings - dc0 = NULL; dc1 = NULL; dc2 = NULL; dc3 = NULL; dc4 = NULL; dc5 = NULL; - - if ((void *) data == NULL) return CF_ACCEPT; - - if (sockaddr->sin_family != AF_INET) return CF_ACCEPT; - - return isAddrOK(sockaddr, (const char *) data) ? CF_ACCEPT : CF_REJECT; -} -#endif - -static printLastError(const char * text) -{ - LPVOID buf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - 0, - (LPTSTR) &buf, - 0, - NULL - ); - - fprintf(stderr, "%s: %s\n", text, (LPCTSTR) buf); - LocalFree(buf); -} - -static int acceptNamedPipe() -{ - int ipcFd = -1; - - if (! ConnectNamedPipe(hListen, &listenOverlapped)) - { - switch (GetLastError()) - { - case ERROR_PIPE_CONNECTED: - - // A client connected after CreateNamedPipe but - // before ConnectNamedPipe. Its a good connection. - - break; - - case ERROR_IO_PENDING: - - // Wait for a connection to complete. - - while (WaitForSingleObject(listenOverlapped.hEvent, - ACCEPT_TIMEOUT) == WAIT_TIMEOUT) - { - if (shutdownPending) - { - OS_LibShutdown(); - return -1; - } - } - - break; - - case ERROR_PIPE_LISTENING: - - // The pipe handle is in nonblocking mode. - - case ERROR_NO_DATA: - - // The previous client closed its handle (and we failed - // to call DisconnectNamedPipe) - - default: - - printLastError("unexpected ConnectNamedPipe() error"); - } - } - - // - // impersonate the client - // - if(bImpersonate && !ImpersonateNamedPipeClient(hListen)) { - DisconnectNamedPipe(hListen); - } else { - ipcFd = Win32NewDescriptor(FD_PIPE_SYNC, (int) hListen, -1); - if (ipcFd == -1) - { - DisconnectNamedPipe(hListen); - if (bImpersonate) RevertToSelf(); - } - } - - return ipcFd; -} - -static int acceptSocket(const char *webServerAddrs) -{ - SOCKET hSock; - int ipcFd = -1; - - for (;;) - { - struct sockaddr sockaddr; - int sockaddrLen = sizeof(sockaddr); - - for (;;) - { - const struct timeval timeout = {1, 0}; - fd_set readfds; - - FD_ZERO(&readfds); - FD_SET((unsigned int) hListen, &readfds); - - if (select(0, &readfds, NULL, NULL, &timeout) == 0) - { - if (shutdownPending) - { - OS_LibShutdown(); - return -1; - } - } - else - { - break; - } - } - -#if NO_WSAACEPT - hSock = accept((SOCKET) hListen, &sockaddr, &sockaddrLen); - - if (hSock == INVALID_SOCKET) - { - break; - } - - if (isAddrOK((struct sockaddr_in *) &sockaddr, webServerAddrs)) - { - break; - } - - closesocket(hSock); -#else - hSock = WSAAccept((unsigned int) hListen, - &sockaddr, - &sockaddrLen, - isAddrOKCallback, - (DWORD) webServerAddrs); - - if (hSock != INVALID_SOCKET) - { - break; - } - - if (WSAGetLastError() != WSAECONNREFUSED) - { - break; - } -#endif - } - - if (hSock == INVALID_SOCKET) - { - /* Use FormatMessage() */ - fprintf(stderr, "accept()/WSAAccept() failed: %d", WSAGetLastError()); - return -1; - } - - ipcFd = Win32NewDescriptor(FD_SOCKET_SYNC, hSock, -1); - if (ipcFd == -1) - { - closesocket(hSock); - } - - return ipcFd; -} - -/* - *---------------------------------------------------------------------- - * - * OS_Accept -- - * - * Accepts a new FastCGI connection. This routine knows whether - * we're dealing with TCP based sockets or NT Named Pipes for IPC. - * - * fail_on_intr is ignored in the Win lib. - * - * Results: - * -1 if the operation fails, otherwise this is a valid IPC fd. - * - *---------------------------------------------------------------------- - */ -int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs) -{ - int ipcFd = -1; - - // Touch args to prevent warnings - listen_sock = 0; fail_on_intr = 0; - - // @todo Muliple listen sockets and sockets other than 0 are not - // supported due to the use of globals. - - if (shutdownPending) - { - OS_LibShutdown(); - return -1; - } - - // The mutex is to keep other processes (and threads, when supported) - // from going into the accept cycle. The accept cycle needs to - // periodically break out to check the state of the shutdown flag - // and there's no point to having more than one thread do that. - - if (acceptMutex != INVALID_HANDLE_VALUE) - { - DWORD ret; - while ((ret = WaitForSingleObject(acceptMutex, ACCEPT_TIMEOUT)) == WAIT_TIMEOUT) - { - if (shutdownPending) break; - } - if (ret == WAIT_FAILED) { - printLastError("WaitForSingleObject() failed"); - return -1; - } - } - - if (shutdownPending) - { - OS_LibShutdown(); - } - else if (listenType == FD_PIPE_SYNC) - { - ipcFd = acceptNamedPipe(); - } - else if (listenType == FD_SOCKET_SYNC) - { - ipcFd = acceptSocket(webServerAddrs); - } - else - { - fprintf(stderr, "unknown listenType (%d)\n", listenType); - } - - if (acceptMutex != INVALID_HANDLE_VALUE) - { - ReleaseMutex(acceptMutex); - } - - return ipcFd; -} - -/* - *---------------------------------------------------------------------- - * - * OS_IpcClose - * - * OS IPC routine to close an IPC connection. - * - * Results: - * - * - * Side effects: - * IPC connection is closed. - * - *---------------------------------------------------------------------- - */ -int OS_IpcClose(int ipcFd) -{ - if (ipcFd == -1) - return 0; - - /* - * Catch it if fd is a bogus value - */ - ASSERT((ipcFd >= 0) && (ipcFd < WIN32_OPEN_MAX)); - ASSERT(fdTable[ipcFd].type != FD_UNUSED); - - switch(listenType) { - - case FD_PIPE_SYNC: - /* - * Make sure that the client (ie. a Web Server in this case) has - * read all data from the pipe before we disconnect. - */ - if(!FlushFileBuffers(fdTable[ipcFd].fid.fileHandle)) - return -1; - if(DisconnectNamedPipe(fdTable[ipcFd].fid.fileHandle)) { - OS_Close(ipcFd); - if (bImpersonate) RevertToSelf(); - return 0; - } else { - return -1; - } - break; - - case FD_SOCKET_SYNC: - OS_Close(ipcFd); - return 0; - break; - - case FD_UNUSED: - default: - //exit(106); - return -1; - break; - } - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * OS_IsFcgi -- - * - * Determines whether this process is a FastCGI process or not. - * - * Results: - * Returns 1 if FastCGI, 0 if not. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -int OS_IsFcgi(int sock) -{ - // Touch args to prevent warnings - sock = 0; - - /* XXX This is broken for sock */ - - return (listenType != FD_UNUSED); -} - -/* - *---------------------------------------------------------------------- - * - * OS_SetFlags -- - * - * Sets selected flag bits in an open file descriptor. Currently - * this is only to put a SOCKET into non-blocking mode. - * - *---------------------------------------------------------------------- - */ -void OS_SetFlags(int fd, int flags) -{ - unsigned long pLong = 1L; - - if (fdTable[fd].type == FD_SOCKET_SYNC && flags == O_NONBLOCK) { - if (ioctlsocket(fdTable[fd].fid.sock, FIONBIO, &pLong) == - SOCKET_ERROR) { - //exit(WSAGetLastError()); - SetLastError(WSAGetLastError()); - return; - } - if (!CreateIoCompletionPort((HANDLE)fdTable[fd].fid.sock, - hIoCompPort, fd, 1)) { - //err = GetLastError(); - //exit(err); - return; - } - - fdTable[fd].type = FD_SOCKET_ASYNC; - } - return; -} - diff --git a/sapi/cgi/libfcgi/strerror.c b/sapi/cgi/libfcgi/strerror.c deleted file mode 100644 index fac7c8eda2dcf..0000000000000 --- a/sapi/cgi/libfcgi/strerror.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The terms in the file "LICENSE.TERMS" do not apply to this file. - * See terms below. - * - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -/*static char *sccsid = "from: @(#)strerror.c 5.6 (Berkeley) 5/4/91";*/ -static char *rcsid = "$Id$"; -#endif /* LIBC_SCCS and not lint */ - -#include "fcgi_config.h" - -#if ! defined (HAVE_STRERROR) -#include - -/* - * Since perror() is not allowed to change the contents of strerror()'s - * static buffer, both functions supply their own buffers to the - * internal function __strerror(). - */ - -char * -__strerror(int num, char *buf) -{ -#define UPREFIX "Unknown error: " - extern char *sys_errlist[]; - extern int sys_nerr; - register unsigned int errnum; - register char *p, *t; - char tmp[40]; - - errnum = num; /* convert to unsigned */ - if (errnum < sys_nerr) - return(sys_errlist[errnum]); - - /* Do this by hand, so we don't include stdio(3). */ - t = tmp; - do { - *t++ = "0123456789"[errnum % 10]; - } while (errnum /= 10); - - strcpy (buf, UPREFIX); - for (p = buf + sizeof(UPREFIX) -1;;) { - *p++ = *--t; - if (t <= tmp) - break; - } - - return buf; -} - - -char * -strerror(int num) -{ - static char buf[40]; /* 64-bit number + slop */ - return __strerror(num, buf); -} - -#endif diff --git a/sapi/cgi/php.sym b/sapi/cgi/php.sym deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/cgi/php_getopt.h b/sapi/cgi/php_getopt.h deleted file mode 100644 index 34ec40573ce41..0000000000000 --- a/sapi/cgi/php_getopt.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" - -/* Define structure for one recognized option (both single char and long name). - * If short_open is '-' this is the last option. - */ -typedef struct _opt_struct { - const char opt_char; - const int need_param; - const char * opt_name; -} opt_struct; - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err); diff --git a/sapi/cli/CREDITS b/sapi/cli/CREDITS deleted file mode 100644 index 5f3b0fbe39631..0000000000000 --- a/sapi/cli/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CLI -Edin Kadribasic, Marcus Boerger, Johannes Schlueter diff --git a/sapi/cli/Makefile.frag b/sapi/cli/Makefile.frag deleted file mode 100644 index 6903ca1fc0c7d..0000000000000 --- a/sapi/cli/Makefile.frag +++ /dev/null @@ -1,11 +0,0 @@ -cli: $(SAPI_CLI_PATH) - -$(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) - $(BUILD_CLI) - -install-cli: $(SAPI_CLI_PATH) - @echo "Installing PHP CLI binary: $(INSTALL_ROOT)$(bindir)/" - @$(INSTALL_CLI) - @echo "Installing PHP CLI man page: $(INSTALL_ROOT)$(mandir)/man1/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @$(INSTALL_DATA) $(builddir)/php.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php$(program_suffix).1 diff --git a/sapi/cli/README b/sapi/cli/README deleted file mode 100644 index 9e519e9bd011e..0000000000000 --- a/sapi/cli/README +++ /dev/null @@ -1,20 +0,0 @@ -The CLI (command line interface) SAPI has been introduced -with a goal of making PHP better at supporting the creation of -stand alone applications. - -It is based on CGI SAPI with all CGI specific things removed. - -The main differences between the two: - -* CLI is started up in quiet mode by default. - (-q switch kept for compatibility) -* It does not change the working directory to that of the script. - (-C switch kept for compatibility) -* Plain text error message -* $argc and $argv registered irrespective of register_globals - and register_argc_argv php.ini settings. -* implicit_flush always on -* -r option which allows execution of PHP code directly from - the command line (e.g. php -r 'echo md5("test");' ) -* Other more sophisticated command line switches (see: man php) -* max_execution_time is set to unlimited, overriding php.ini setting. diff --git a/sapi/cli/TODO b/sapi/cli/TODO deleted file mode 100644 index 22e6689001f09..0000000000000 --- a/sapi/cli/TODO +++ /dev/null @@ -1,2 +0,0 @@ -TODO: - diff --git a/sapi/cli/cli_win32.c b/sapi/cli/cli_win32.c deleted file mode 100644 index 4407fd088f688..0000000000000 --- a/sapi/cli/cli_win32.c +++ /dev/null @@ -1,2 +0,0 @@ -#define PHP_CLI_WIN32_NO_CONSOLE 1 -#include "php_cli.c" diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 deleted file mode 100644 index ccb1fef153d03..0000000000000 --- a/sapi/cli/config.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for CLI build) - -AC_ARG_ENABLE(cli, -[ --disable-cli Disable building CLI version of PHP - (this forces --without-pear)], -[ - PHP_SAPI_CLI=$enableval -],[ - PHP_SAPI_CLI=yes -]) - -if test "$PHP_SAPI_CLI" != "no"; then - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cli/Makefile.frag,$abs_srcdir/sapi/cli,sapi/cli) - SAPI_CLI_PATH=sapi/cli/php - PHP_SUBST(SAPI_CLI_PATH) - - case $host_alias in - *aix*) - BUILD_CLI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - ;; - *darwin*) - BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - ;; - *netware*) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)" - ;; - *) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - ;; - esac - INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)" - - PHP_SUBST(BUILD_CLI) - PHP_SUBST(INSTALL_CLI) - PHP_OUTPUT(sapi/cli/php.1) -fi - -AC_MSG_RESULT($PHP_SAPI_CLI) diff --git a/sapi/cli/config.w32 b/sapi/cli/config.w32 deleted file mode 100644 index 83692489f5c92..0000000000000 --- a/sapi/cli/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes'); -ARG_ENABLE('crt-debug', 'Extra CRT debugging', 'no'); -ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no'); - -if (PHP_CLI == "yes") { - SAPI('cli', 'getopt.c php_cli.c php_cli_readline.c', 'php.exe'); - if (PHP_CRT_DEBUG == "yes") { - ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP"); - } -} - -if (PHP_CLI_WIN32 == "yes") { - SAPI('cli_win32', 'getopt.c cli_win32.c php_cli_readline.c', 'php-win.exe'); -} - diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c deleted file mode 100644 index 27d832581521d..0000000000000 --- a/sapi/cli/getopt.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -static int php_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err) -{ - if (show_err) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - int arg_start = 2; - - int opts_idx = -1; - - if (*optind >= argc) { - return(EOF); - } - if (!dash) { - if ((argv[*optind][0] != '-')) { - return(EOF); - } else { - if (!argv[*optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - } - } - if ((argv[*optind][0] == '-') && (argv[*optind][1] == '-')) { - /* '--' indicates end of args if not followed by a known long option name */ - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - (*optind)++; - return(EOF); - } else if (opts[opts_idx].opt_name && !strcmp(&argv[*optind][2], opts[opts_idx].opt_name)) { - break; - } - } - optchr = 0; - dash = 1; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } - if (!dash) { - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { - dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); - } - if (opts_idx < 0) { - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - int errind = *optind; - int errchr = optchr; - - if (!argv[*optind][optchr+1]) { - dash = 0; - (*optind)++; - } else { - optchr++; - } - return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); - } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { - break; - } - } - } - if (opts[opts_idx].need_param) { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[*optind][arg_start]) { - (*optind)++; - if (*optind == argc) { - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } - *optarg = argv[(*optind)++]; - } else { - *optarg = &argv[*optind][arg_start]; - (*optind)++; - } - return opts[opts_idx].opt_char; - } else { - if (arg_start == 2) { - if (!argv[*optind][optchr+1]) - { - dash = 0; - (*optind)++; - } else { - optchr++; - } - } else { - (*optind)++; - } - return opts[opts_idx].opt_char; - } - assert(0); - return(0); /* never reached */ -} diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in deleted file mode 100644 index fb77577353ddd..0000000000000 --- a/sapi/cli/php.1.in +++ /dev/null @@ -1,395 +0,0 @@ -./" +----------------------------------------------------------------------+ -./" | PHP Version 5 | -./" +----------------------------------------------------------------------+ -./" | Copyright (c) 1997-2005 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: Marcus Boerger | -./" +----------------------------------------------------------------------+ -./" -./" $Id$ -./" -.TH PHP 1 "Feb 2003" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -.B php -PHP Command Line Interface 'CLI' -.SH SYNOPSIS -.B php -[options] [ -.B \-f\fP ] -.IR file -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] -.B \-r -.IR code -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] [\-B -.IR code ] -.B \-R -.IR code -[\-E -.IR code ] -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] [\-B -.IR code ] -.B \-F -.IR file -[\-E -.IR code ] -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] \-\- [ -.IR args.\|.\|. ] -.LP -\fBphp \fP[options] \fB\-a\fP -.LP -.SH DESCRIPTION -\fBPHP\fP is a widely\-used general\-purpose scripting language that is especially suited for -Web development and can be embedded into HTML. This is the command line interface -that enables you to the following: -.P -You can parse and execute files by using parameter \-f followed by the name of the -.IR file -to be executed. -.LP -Using parameter \-r you can directly execute PHP -.IR code -simply as you would do inside a -.B \.php -file when using the -.B eval() -function. -.LP -It is also possible to process the standard input line by line using either -the parameter \-R or \-F. In this mode each separate input line causes the -.IR code -specified by \-R or the -.IR file -specified by \-F to be executed. -You can access the input line by \fB$argn\fP. While processing the input lines -.B $argi -contains the number of the actual line being processed. Further more -the paramters \-B and \-E can be used to execute -.IR code -(see \-r) before and -after all input lines have been processed respectively. Notice that the -input is read from -.B STDIN -and therefore reading from -.B STDIN -explicitly changes the next input line or skips input lines. -.LP -If none of \-r \-f \-B \-R \-F or \-E is present but a single parameter is given -then this parameter is taken as the filename to parse and execute (same as -with \-f). If no parameter is present then the standard input is read and -executed. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-interactive -.TP -.PD 1 -.B \-a -Run PHP interactively. This lets you enter snippets of PHP code that directly -get executed. When readline support is enabled you can edit the lines and also -have history support. -.TP -.PD 0 -.B \-\-php\-ini \fIpath\fP|\fIfile\fP -.TP -.PD 1 -.B \-c \fIpath\fP|\fIfile\fP -Look for -.B php.ini -file in the directory -.IR path -or use the specified -.IR file -.TP -.PD 0 -.B \-\-no\-php\-ini -.TP -.PD 1 -.B \-n -No -.B php.ini -file will be used -.TP -.PD 0 -.B \-\-define \fIfoo\fP[=\fIbar\fP] -.TP -.PD 1 -.B \-d \fIfoo\fP[=\fIbar\fP] -Define INI entry -.IR foo -with value -.IR bar -.TP -.B \-e -Generate extended information for debugger/profiler -.TP -.PD 0 -.B \-\-file \fIfile\fP -.TP -.PD 1 -.B \-f \fIfile\fP -Parse and execute -.IR file -.TP -.PD 0 -.B \-\-global \fIname\fP -.TP -.PD 1 -.B \-g \fIname\fP -Make variable -.IR name -global in script. -.TP -.PD 0 -.B \-\-help -.TP -.PD 1 -.B \-h -This help -.TP -.PD 0 -.B \-\-hide\-args -.TP -.PD 1 -.B \-H -Hide script name (\fIfile\fP) and parameters (\fIargs\.\.\.\fP) from external -tools. For example you may want to use this when a php script is started as -a daemon and the command line contains sensitive data such as passwords. -.TP -.PD 0 -.B \-\-info -.TP -.PD 1 -.B \-i -PHP information and configuration -.TP -.PD 0 -.B \-\-syntax\-check -.TP -.PD 1 -.B \-l -Syntax check only (lint) -.TP -.PD 0 -.B \-\-modules -.TP -.PD 1 -.B \-m -Show compiled in modules -.TP -.PD 0 -.B \-\-run \fIcode\fP -.TP -.PD 1 -.B \-r \fIcode\fP -Run PHP -.IR code -without using script tags -.B '' -.TP -.PD 0 -.B \-\-process\-begin \fIcode\fP -.TP -.PD 1 -.B \-B \fIcode\fP -Run PHP -.IR code -before processing input lines -.TP -.PD 0 -.B \-\-process\-code \fIcode\fP -.TP -.PD 1 -.B \-R \fIcode\fP -Run PHP -.IR code -for every input line -.TP -.PD 0 -.B \-\-process\-file \fIfile\fP -.TP -.PD 1 -.B \-F \fIfile\fP -Parse and execute -.IR file -for every input line -.TP -.PD 0 -.B \-\-process\-end \fIcode\fP -.TP -.PD 1 -.B \-E \fIcode\fP -Run PHP -.IR code -after processing all input lines -.TP -.PD 0 -.B \-\-syntax\-highlight -.TP -.PD 1 -.B \-s -Display colour syntax highlighted source -.TP -.PD 0 -.B \-\-version -.TP -.PD 1 -.B \-v -Version number -.TP -.PD 0 -.B \-\-stripped -.TP -.PD 1 -.B \-w -Display source with stripped comments and whitespace -.TP -.PD 0 -.B \-\-zend\-extension \fIfile\fP -.TP -.PD 1 -.B \-z \fIfile\fP -Load Zend extension -.IR file -.TP -.IR args.\|.\|. -Arguments passed to script. Use -.B '\-\-' -.IR args -when first argument starts with -.B '\-' -or script is read from stdin -.SH FILES -.TP 15 -.B php\-cli.ini -The configuration file for the CLI version of PHP. -.TP -.B php.ini -The standard configuration file will only be used when -.B php\-cli.ini -cannot be found. -.SH EXAMPLES -.TP 5 -\fIphp -r 'echo "Hello World\\n";'\fP -This command simply writes the text "Hello World" to standard out. -.TP -\fIphp \-r 'print_r(gd_info());'\fP -This shows the configuration of your gd extension. You can use this -to easily check which image formats you can use. If you have any -dynamic modules you may want to use the same ini file that php uses -when executed from your webserver. There are more extensions which -have such a function. For dba use: -.RS -\fIphp \-r 'print_r(dba_handlers(1));'\fP -.RE -.TP -\fIphp \-R 'echo strip_tags($argn)."\\n";'\fP -This PHP command strips off the HTML tags line by line and outputs the -result. To see how it works you can first look at the following PHP command -\'\fIphp \-d html_errors=1 \-i\fP\' which uses PHP to output HTML formatted -configuration information. If you then combine those two -\'\fIphp \.\.\.|php \.\.\.\fP\' you'll see what happens. -.TP -\fIphp \-E 'echo "Lines: $argi\\n";'\fP -Using this PHP command you can count the lines being input. -.TP -\fIphp \-R '@$l+=count(file($argn));' \-E 'echo "Lines:$l\\n";'\fP -In this example PHP expects each input line beeing a file. It counts all lines -of the files specified by each input line and shows the summarized result. -You may combine this with tools like find and change the php scriptlet. -.TP -\fIphp \-R 'echo "$argn\\n"; fgets(STDIN);'\fP -Since you have access to STDIN from within \-B \-R \-F and \-E you can skip -certain input lines with your code. But note that in such cases $argi only -counts the lines being processed by php itself. Having read this you will -guess what the above program does: skipping every second input line. -.SH TIPS -You can use a shebang line to automatically invoke php -from scripts. Only the CLI version of PHP will ignore -such a first line as shown below: -.P -.PD 0 -.RS -#!/bin/php -.P - -.RE -.PD 1 -.P -.SH SEE ALSO -For a more or less complete description of PHP look here: -.PD 0 -.P -.B http://www.php.net/manual/ -.PD 1 -.P -A nice introduction to PHP by Stig Bakken can be found here: -.PD 0 -.P -.B http://www.zend.com/zend/art/intro.php -.PD 1 -.SH BUGS -You can view the list of known bugs or add any new bug you -found here: -.PD 0 -.P -.B http://bugs.php.net -.PD 1 -.SH AUTHORS -The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. -.P -Additional work for the CLI sapi was done by Edin Kadribasic and Marcus Boerger. -.P -A List of active developers can be found here: -.PD 0 -.P -.B http://www.php.net/credits.php -.PD 1 -.P -And last but not least PHP was developed with the help of a huge amount of -contributors all around the world. -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2005 The PHP Group -.LP -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 -.PD 0 -.P -.B http://www.php.net/license/3_0.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c deleted file mode 100644 index f37b12f335f73..0000000000000 --- a/sapi/cli/php_cli.c +++ /dev/null @@ -1,1240 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic | - | Marcus Boerger | - | Johannes Schlueter | - | Parts based on CGI SAPI Module by | - | Rasmus Lerdorf, Stig Bakken and Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_hash.h" -#include "zend_modules.h" -#include "zend_interfaces.h" -#include "zend_reflection_api.h" - -#include "SAPI.h" - -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#ifdef PHP_WIN32 -#include -#include -#include "win32/php_registry.h" -#endif - -#if HAVE_SIGNAL_H -#include -#endif - -#ifdef __riscos__ -#include -#endif - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT -#include -#if !HAVE_LIBEDIT -#include -#endif -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - - -#include "php_getopt.h" -#include "php_cli_readline.h" - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 -#define PHP_MODE_CLI_DIRECT 6 -#define PHP_MODE_PROCESS_STDIN 7 -#define PHP_MODE_REFLECTION_CLASS 8 -#define PHP_MODE_REFLECTION_EXTENSION 9 - -static char *php_optarg = NULL; -static int php_optind = 1; -#if HAVE_LIBREADLINE || HAVE_LIBEDIT -static char php_last_char = '\0'; -#endif - -static const opt_struct OPTIONS[] = { - {'a', 0, "interactive"}, - {'B', 1, "process-begin"}, - {'C', 0, "no-chdir"}, /* for compatibility with CGI (do not chdir to script directory) */ - {'c', 1, "php-ini"}, - {'d', 1, "define"}, - {'E', 1, "process-end"}, - {'e', 0, "profile-info"}, - {'F', 1, "process-file"}, - {'f', 1, "file"}, - {'g', 1, "global"}, - {'h', 0, "help"}, - {'i', 0, "info"}, - {'l', 0, "syntax-check"}, - {'m', 0, "modules"}, - {'n', 0, "no-php-ini"}, - {'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */ - {'R', 1, "process-code"}, - {'H', 0, "hide-args"}, - {'r', 1, "run"}, - {'s', 0, "syntax-highlight"}, - {'s', 0, "syntax-highlighting"}, - {'w', 0, "strip"}, - {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ - {'v', 0, "version"}, - {'z', 1, "zend-extension"}, - {10, 1, "rclass"}, - {11, 1, "rextension"}, - {'-', 0, NULL} /* end of args */ -}; - -static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) -{ - php_printf("%s\n", module->name); - return 0; -} - -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f = *((Bucket **) a); - Bucket *s = *((Bucket **) b); - - return strcasecmp(((zend_module_entry *)f->pData)->name, - ((zend_module_entry *)s->pData)->name); -} - -static void print_modules(TSRMLS_D) -{ - HashTable sorted_registry; - zend_module_entry tmp; - - zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); - zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); - zend_hash_destroy(&sorted_registry); -} - -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) -{ - php_printf("%s\n", ext->name); - return 0; -} - -static int extension_name_cmp(const zend_llist_element **f, - const zend_llist_element **s TSRMLS_DC) -{ - return strcmp(((zend_extension *)(*f)->data)->name, - ((zend_extension *)(*s)->data)->name); -} - -static void print_extensions(TSRMLS_D) -{ - zend_llist sorted_exts; - - zend_llist_copy(&sorted_exts, &zend_extensions); - sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); - zend_llist_destroy(&sorted_exts); -} - -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif - -static inline size_t sapi_cli_single_write(const char *str, uint str_length) -{ -#ifdef PHP_WRITE_STDOUT - long ret; - - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) { - return 0; - } - return ret; -#else - size_t ret; - - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} - -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT - if (!str_length) { - return 0; - } - php_last_char = str[str_length-1]; -#endif - - while (remaining > 0) - { - ret = sapi_cli_single_write(ptr, remaining); - if (!ret) { -#ifdef PHP_CLI_WIN32_NO_CONSOLE - break; -#else - php_handle_aborted_connection(); -#endif - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} - - -static void sapi_cli_flush(void *server_context) -{ - /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams - * are/could be closed before fflush() is called. - */ - if (fflush(stdout)==EOF && errno!=EBADF) { -#ifndef PHP_CLI_WIN32_NO_CONSOLE - php_handle_aborted_connection(); -#endif - } -} - -static char *php_self = ""; -static char *script_filename = ""; - -static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) -{ - /* In CGI mode, we consider the environment to be a part of the server - * variables - */ - php_import_environment_variables(track_vars_array TSRMLS_CC); - - /* Build the special-case PHP_SELF variable for the CLI version */ - php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); - php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); - /* filenames are empty for stdin */ - php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); - /* just make it available */ - php_register_variable("DOCUMENT_ROOT", "", track_vars_array TSRMLS_CC); -} - - -static void sapi_cli_log_message(char *message) -{ - fprintf(stderr, "%s\n", message); -} - -static int sapi_cli_deactivate(TSRMLS_D) -{ - fflush(stdout); - if(SG(request_info).argv0) { - free(SG(request_info).argv0); - SG(request_info).argv0 = NULL; - } - return SUCCESS; -} - -static char* sapi_cli_read_cookies(TSRMLS_D) -{ - return NULL; -} - -static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - /* We do nothing here, this function is needed to prevent that the fallback - * header handling is called. */ - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) -{ -} - - -static int php_cli_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -/* {{{ sapi_cli_ini_defaults */ - -/* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */ -#define INI_DEFAULT(name,value)\ - ZVAL_STRING(tmp, value, 0);\ - zend_hash_update(configuration_hash, name, sizeof(name), tmp, sizeof(zval), (void**)&entry);\ - Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)) - -/* hard coded ini settings must be set in main() */ -#define INI_HARDCODED(name,value)\ - zend_alter_ini_entry(name, sizeof(name), value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - -static void sapi_cli_ini_defaults(HashTable *configuration_hash) -{ - zval *tmp, *entry; - - MAKE_STD_ZVAL(tmp); - - INI_DEFAULT("report_zend_debug", "0"); - INI_DEFAULT("display_errors", "1"); - - FREE_ZVAL(tmp); -} -/* }}} */ - -/* {{{ sapi_module_struct cli_sapi_module - */ -static sapi_module_struct cli_sapi_module = { - "cli", /* name */ - "Command Line Interface", /* pretty name */ - - php_cli_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - sapi_cli_deactivate, /* deactivate */ - - sapi_cli_ub_write, /* unbuffered write */ - sapi_cli_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - sapi_cli_send_headers, /* send headers handler */ - sapi_cli_send_header, /* send header handler */ - - NULL, /* read POST data */ - sapi_cli_read_cookies, /* read Cookies */ - - sapi_cli_register_variables, /* register server variables */ - sapi_cli_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ php_cli_usage - */ -static void php_cli_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php"; - } - - php_printf( "Usage: %s [options] [-f] [--] [args...]\n" - " %s [options] -r [--] [args...]\n" - " %s [options] [-B ] -R [-E ] [--] [args...]\n" - " %s [options] [-B ] -F [-E ] [--] [args...]\n" - " %s [options] -- [args...]\n" - " %s [options] -a\n" - "\n" -#if HAVE_LIBREADLINE || HAVE_LIBEDIT - " -a Run as interactive shell\n" -#else - " -a Run interactively\n" -#endif - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse .\n" - " -h This help\n" - " -i PHP information\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -r Run PHP without using script tags \n" - " -B Run PHP before processing input lines\n" - " -R Run PHP for every input line\n" - " -F Parse and execute for every input line\n" - " -E Run PHP after processing all input lines\n" - " -H Hide any passed arguments from external tools.\n" - " -s Display colour syntax highlighted source.\n" - " -v Version number\n" - " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n" - "\n" - " args... Arguments passed to script. Use -- args when first argument\n" - " starts with - or script is read from stdin\n" - "\n" - , prog, prog, prog, prog, prog, prog); -} -/* }}} */ - -static void define_command_line_ini_entry(char *arg TSRMLS_DC) -{ - char *name, *value; - - name = arg; - value = strchr(arg, '='); - if (value) { - *value = 0; - value++; - } else { - value = "1"; - } - - if (!strcasecmp(name, "extension")) { /* load function module */ - zval extension, zval; - ZVAL_STRING(&extension, value, 0); - php_dl(&extension, MODULE_PERSISTENT, &zval, 1 TSRMLS_CC); - } else { - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - } -} - - -static void php_register_command_line_global_vars(char **arg TSRMLS_DC) -{ - char *var, *val; - - var = *arg; - val = strchr(var, '='); - if (!val) { - printf("No value specified for variable '%s'\n", var); - } else { - *val++ = '\0'; - php_register_variable(var, val, NULL TSRMLS_CC); - } - efree(*arg); -} - -static php_stream *s_in_process = NULL; - -static void cli_register_file_handles(TSRMLS_D) -{ - zval *zin, *zout, *zerr; - php_stream *s_in, *s_out, *s_err; - php_stream_context *sc_in=NULL, *sc_out=NULL, *sc_err=NULL; - zend_constant ic, oc, ec; - - MAKE_STD_ZVAL(zin); - MAKE_STD_ZVAL(zout); - MAKE_STD_ZVAL(zerr); - - s_in = php_stream_open_wrapper_ex("php://stdin", "rb", 0, NULL, sc_in); - s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out); - s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); - - if (s_in==NULL || s_out==NULL || s_err==NULL) { - return; - } - - s_in_process = s_in; - - php_stream_to_zval(s_in, zin); - php_stream_to_zval(s_out, zout); - php_stream_to_zval(s_err, zerr); - - ic.value = *zin; - ic.flags = CONST_CS; - ic.name = zend_strndup(ZEND_STRL("STDIN")); - ic.name_len = sizeof("STDIN"); - ic.module_number = 0; - zend_register_constant(&ic TSRMLS_CC); - - oc.value = *zout; - oc.flags = CONST_CS; - oc.name = zend_strndup(ZEND_STRL("STDOUT")); - oc.name_len = sizeof("STDOUT"); - oc.module_number = 0; - zend_register_constant(&oc TSRMLS_CC); - - ec.value = *zerr; - ec.flags = CONST_CS; - ec.name = zend_strndup(ZEND_STRL("STDERR")); - ec.name_len = sizeof("STDERR"); - ec.module_number = 0; - zend_register_constant(&ec TSRMLS_CC); - - FREE_ZVAL(zin); - FREE_ZVAL(zout); - FREE_ZVAL(zerr); -} - -static const char *param_mode_conflict = "Either execute direct code, process stdin or use a file.\n"; - -/* {{{ cli_seek_file_begin - */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) -{ - int c; - - *lineno = 1; - - if (!(file_handle->handle.fp = VCWD_FOPEN(script_file, "rb"))) { - php_printf("Could not open input file: %s\n", script_file); - return FAILURE; - } - file_handle->filename = script_file; - /* #!php support */ - c = fgetc(file_handle->handle.fp); - if (c == '#') { - while (c != 10 && c != 13) { - c = fgetc(file_handle->handle.fp); /* skip to end of line */ - } - /* handle situations where line is terminated by \r\n */ - if (c == 13) { - if (fgetc(file_handle->handle.fp) != 10) { - long pos = ftell(file_handle->handle.fp); - fseek(file_handle->handle.fp, pos - 1, SEEK_SET); - } - } - *lineno = 2; - } else { - rewind(file_handle->handle.fp); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ main - */ -#ifdef PHP_CLI_WIN32_NO_CONSOLE -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -#else -int main(int argc, char *argv[]) -#endif -{ - int exit_status = SUCCESS; - int c; - zend_file_handle file_handle; -/* temporary locals */ - int behavior=PHP_MODE_STANDARD; - char *reflection_what; - int orig_optind=php_optind; - char *orig_optarg=php_optarg; - char *arg_free=NULL, **arg_excp=&arg_free; - char *script_file=NULL; - zend_llist global_vars; - int interactive=0; - int module_started = 0; - int lineno = 0; - char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; - const char *param_error=NULL; - int hide_argv = 0; -/* end of temporary locals */ -#ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - php_core_globals *core_globals; - sapi_globals_struct *sapi_globals; - void ***tsrm_ls; -#endif -#ifdef PHP_CLI_WIN32_NO_CONSOLE - int argc = __argc; - char **argv = __argv; -#endif - -#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) - { - int tmp_flag; - - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); - - tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; - tmp_flag |= _CRTDBG_LEAK_CHECK_DF; - - _CrtSetDbgFlag(tmp_flag); - } -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - - cli_sapi_module.ini_defaults = sapi_cli_ini_defaults; - cli_sapi_module.phpinfo_as_text = 1; - sapi_startup(&cli_sapi_module); - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { - switch (c) { - case 'c': - cli_sapi_module.php_ini_path_override = strdup(php_optarg); - break; - case 'n': - cli_sapi_module.php_ini_ignore = 1; - break; - } - } - php_optind = orig_optind; - php_optarg = orig_optarg; - - cli_sapi_module.executable_location = argv[0]; - -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); - sapi_globals = ts_resource(sapi_globals_id); - tsrm_ls = ts_resource(0); -#endif - - /* startup after we get the above ini override se we get things right */ - if (php_module_startup(&cli_sapi_module, NULL, 0)==FAILURE) { - /* there is no way to see if we must call zend_ini_deactivate() - * since we cannot check if EG(ini_directives) has been initialised - * because the executor's constructor does not set initialize it. - * Apart from that there seems no need for zend_ini_deactivate() yet. - * So we goto out_err.*/ - exit_status = 1; - goto out_err; - } - module_started = 1; - - zend_first_try { - zend_llist_init(&global_vars, sizeof(char *), NULL, 0); - - zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ - CG(in_compilation) = 0; /* not initialized but needed for several options */ - EG(uninitialized_zval_ptr) = NULL; - - if (cli_sapi_module.php_ini_path_override && cli_sapi_module.php_ini_ignore) { - PUTS("You cannot use both -n and -c switch. Use -h for help.\n"); - exit_status=1; - goto out_err; - } - - /* here is the place for hard coded defaults which cannot be overwritten in the ini file */ - INI_HARDCODED("register_argc_argv", "1"); - INI_HARDCODED("html_errors", "0"); - INI_HARDCODED("implicit_flush", "1"); - INI_HARDCODED("output_buffering", "0"); - INI_HARDCODED("max_execution_time", "0"); - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(php_optarg TSRMLS_CC); - break; - - case 'h': /* help & quit */ - case '?': - php_output_startup(); - php_output_activate(TSRMLS_C); - php_cli_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - zend_ini_deactivate(TSRMLS_C); - goto out_err; - - - case 'i': /* php info & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - goto err; - } - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - case 'm': /* list compiled in modules */ - php_output_startup(); - php_output_activate(TSRMLS_C); - php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); - php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); - php_printf("\n"); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - sapi_deactivate(TSRMLS_C); - zend_ini_deactivate(TSRMLS_C); - goto out_err; - - case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - goto err; - } -#if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#endif - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - default: - break; - } - } - - /* Set some CLI defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - - php_optind = orig_optind; - php_optarg = orig_optarg; - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - if (!interactive) { - printf("Interactive mode enabled\n\n"); - fflush(stdout); - interactive=1; - } - break; - - case 'C': /* don't chdir to the script directory */ - /* This is default so NOP */ - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'F': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_run || script_file) { - param_error = "You can use -R or -F only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - script_file = php_optarg; - break; - - case 'f': /* parse file */ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = param_mode_conflict; - break; - } else if (script_file) { - param_error = "You can use -f only once.\n"; - break; - } - script_file = php_optarg; - break; - - case 'g': /* define global variables on command line */ - { - char *arg = estrdup(php_optarg); - - zend_llist_add_element(&global_vars, &arg); - } - break; - - case 'l': /* syntax check mode */ - if (behavior != PHP_MODE_STANDARD) { - break; - } - behavior=PHP_MODE_LINT; - break; - -#if 0 /* not yet operational, see also below ... */ - case '': /* generate indented source mode*/ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source indenting only works for files.\n"; - break; - } - behavior=PHP_MODE_INDENT; - break; -#endif - - case 'q': /* do not generate HTTP headers */ - /* This is default so NOP */ - break; - - case 'r': /* run code from command line */ - if (behavior == PHP_MODE_CLI_DIRECT) { - if (exec_direct || script_file) { - param_error = "You can use -r only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_CLI_DIRECT; - exec_direct=php_optarg; - break; - - case 'R': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_run || script_file) { - param_error = "You can use -R or -F only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_run=php_optarg; - break; - - case 'B': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_begin) { - param_error = "You can use -B only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_begin=php_optarg; - break; - - case 'E': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_end) { - param_error = "You can use -E only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_end=php_optarg; - break; - - case 's': /* generate highlighted HTML from source */ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source highlighting only works for files.\n"; - break; - } - behavior=PHP_MODE_HIGHLIGHT; - break; - - case 'w': - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source stripping only works for files.\n"; - break; - } - behavior=PHP_MODE_STRIP; - break; - - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; - case 'H': - hide_argv = 1; - break; - - case 10: - behavior=PHP_MODE_REFLECTION_CLASS; - reflection_what = php_optarg; - break; - case 11: - behavior=PHP_MODE_REFLECTION_EXTENSION; - reflection_what = php_optarg; - break; - - default: - break; - } - } - - if (param_error) { - PUTS(param_error); - exit_status=1; - goto err; - } - - CG(interactive) = interactive; - - /* only set script_file if not set already and not in direct mode and not at end of parameter list */ - if (argc > php_optind - && !script_file - && behavior!=PHP_MODE_CLI_DIRECT - && behavior!=PHP_MODE_PROCESS_STDIN - && strcmp(argv[php_optind-1],"--")) - { - script_file=argv[php_optind]; - php_optind++; - } - if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { - goto err; - } - script_filename = script_file; - } else { - /* We could handle PHP_MODE_PROCESS_STDIN in a different manner */ - /* here but this would make things only more complicated. And it */ - /* is consitent with the way -R works where the stdin file handle*/ - /* is also accessible. */ - file_handle.filename = "-"; - file_handle.handle.fp = stdin; - } - file_handle.type = ZEND_HANDLE_FP; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - php_self = file_handle.filename; - - /* before registering argv to module exchange the *new* argv[0] */ - /* we can achieve this without allocating more memory */ - SG(request_info).argc=argc-php_optind+1; - arg_excp = argv+php_optind-1; - arg_free = argv[php_optind-1]; - SG(request_info).path_translated = file_handle.filename; - argv[php_optind-1] = file_handle.filename; - SG(request_info).argv=argv+php_optind-1; - - if (php_request_startup(TSRMLS_C)==FAILURE) { - *arg_excp = arg_free; - fclose(file_handle.handle.fp); - php_request_shutdown((void *) 0); - PUTS("Could not startup.\n"); - goto err; - } - CG(start_lineno) = lineno; - *arg_excp = arg_free; /* reconstuct argv */ - - if (hide_argv) { - int i; - for (i = 1; i < argc; i++) { - memset(argv[i], 0, strlen(argv[i])); - } - } - - /* This actually destructs the elements of the list - ugly hack */ - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars TSRMLS_CC); - zend_llist_destroy(&global_vars); - - PG(during_request_startup) = 0; - switch (behavior) { - case PHP_MODE_STANDARD: - if (strcmp(file_handle.filename, "-")) { - cli_register_file_handles(TSRMLS_C); - } - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT - if (interactive) { - char *line; - size_t size = 4096, pos = 0, len; - char *code = emalloc(size); - char *prompt = "php > "; - char *history_file; - - history_file = tilde_expand("~/.php_history"); - rl_attempted_completion_function = cli_code_completion; - rl_special_prefixes = "$"; - read_history(history_file); - - EG(exit_status) = 0; - while ((line = readline(prompt)) != NULL) { - if (strcmp(line, "exit") == 0 || strcmp(line, "quit") == 0) { - free(line); - break; - } - - if (!pos && !*line) { - free(line); - continue; - } - - len = strlen(line); - if (pos + len + 2 > size) { - size = pos + len + 2; - code = erealloc(code, size); - } - memcpy(&code[pos], line, len); - pos += len; - code[pos] = '\n'; - code[++pos] = '\0'; - - if (*line) { - add_history(line); - } - - free(line); - - if (!cli_is_valid_code(code, pos, &prompt TSRMLS_CC)) { - continue; - } - - zend_eval_string(code, NULL, "php shell code" TSRMLS_CC); - pos = 0; - - if (php_last_char != '\0' && php_last_char != '\n') { - sapi_cli_single_write("\n", 1); - } - php_last_char = '\0'; - } - write_history(history_file); - free(history_file); - efree(code); - exit_status = EG(exit_status); - break; - } -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - php_execute_script(&file_handle TSRMLS_CC); - exit_status = EG(exit_status); - break; - case PHP_MODE_LINT: - exit_status = php_lint_script(&file_handle TSRMLS_CC); - if (exit_status==SUCCESS) { - zend_printf("No syntax errors detected in %s\n", file_handle.filename); - } else { - zend_printf("Errors parsing %s\n", file_handle.filename); - } - break; - case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { - zend_strip(TSRMLS_C); - } - goto out; - break; - case PHP_MODE_HIGHLIGHT: - { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { - php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); - } - goto out; - } - break; -#if 0 - /* Zeev might want to do something with this one day */ - case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(); - fclose(file_handle.handle.fp); - goto out; - break; -#endif - case PHP_MODE_CLI_DIRECT: - cli_register_file_handles(TSRMLS_C); - if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - break; - - case PHP_MODE_PROCESS_STDIN: - { - char *input; - size_t len, index = 0; - pval *argn, *argi; - - cli_register_file_handles(TSRMLS_C); - - if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - ALLOC_ZVAL(argi); - Z_TYPE_P(argi) = IS_LONG; - Z_LVAL_P(argi) = index; - INIT_PZVAL(argi); - zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(pval *), NULL); - while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { - len = strlen(input); - while (len-- && (input[len]=='\n' || input[len]=='\r')) { - input[len] = '\0'; - } - ALLOC_ZVAL(argn); - Z_TYPE_P(argn) = IS_STRING; - Z_STRLEN_P(argn) = ++len; - Z_STRVAL_P(argn) = estrndup(input, len); - INIT_PZVAL(argn); - zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(pval *), NULL); - Z_LVAL_P(argi) = ++index; - if (exec_run) { - if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - } else { - if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { - exit_status = 1; - } else { - CG(start_lineno) = lineno; - php_execute_script(&file_handle TSRMLS_CC); - exit_status = EG(exit_status); - } - } - } - efree(input); - } - if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - - break; - case PHP_MODE_REFLECTION_CLASS: - case PHP_MODE_REFLECTION_EXTENSION: - { - zend_class_entry *reflection_ce; - zval *arg; - - if (behavior == PHP_MODE_REFLECTION_CLASS) { - zend_class_entry **ppce; - - if (zend_lookup_class(reflection_what, strlen(reflection_what), &ppce TSRMLS_CC) == FAILURE) { - zend_printf("Class %s not found\n", reflection_what); - exit_status=254; - - break; - } - - reflection_ce = reflection_class_ptr; - } else if (behavior == PHP_MODE_REFLECTION_EXTENSION) { - char *lcname = do_alloca(strlen(reflection_what) + 1); - struct _zend_module_entry *module; - - zend_str_tolower_copy(lcname, reflection_what, strlen(reflection_what)); - if (zend_hash_find(&module_registry, lcname, strlen(reflection_what) + 1, (void **)&module) == FAILURE) { - zend_printf("Extension %s not found\n", reflection_what); - - free_alloca(lcname); - - exit_status=254; - break; - } - free_alloca(lcname); - - reflection_ce = reflection_extension_ptr; - } else { - // Can't happen - assert(0); - break; - } - - arg = emalloc(sizeof(zval)); - INIT_PZVAL(arg); - ZVAL_STRING(arg, reflection_what, 1); - - zend_call_method_with_1_params(NULL, reflection_ce, NULL, "export", NULL, arg); - - zval_dtor(arg); - FREE_ZVAL(arg); - - break; - } - } - } - - if (cli_sapi_module.php_ini_path_override) { - free(cli_sapi_module.php_ini_path_override); - } - } zend_end_try(); - -out: - php_request_shutdown((void *) 0); - if (exit_status == 0) { - exit_status = EG(exit_status); - } -out_err: - if (module_started) { - php_module_shutdown(TSRMLS_C); - } - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - - exit(exit_status); - -err: - zend_ini_deactivate(TSRMLS_C); - exit_status = 1; - goto out_err; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c deleted file mode 100644 index 53d062be2d6d7..0000000000000 --- a/sapi/cli/php_cli_readline.c +++ /dev/null @@ -1,502 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - | Johannes Schlueter | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_hash.h" -#include "zend_modules.h" - -#include "SAPI.h" - -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" - -#ifdef __riscos__ -#include -#endif - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT -#include -#if !HAVE_LIBEDIT -#include -#endif -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -#if HAVE_LIBREADLINE || HAVE_LIBEDIT - -/* {{{ cli_is_valid_code - */ -typedef enum { - body, - sstring, - dstring, - sstring_esc, - dstring_esc, - comment_line, - comment_block, - heredoc_start, - heredoc, - outside, -} php_code_type; - -int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC) -{ - int valid_end = 1, last_valid_end; - int brackets_count = 0; - int brace_count = 0; - int i; - php_code_type code_type = body; - char *heredoc_tag; - int heredoc_len; - - for (i = 0; i < len; ++i) { - switch(code_type) { - default: - switch(code[i]) { - case '{': - brackets_count++; - valid_end = 0; - break; - case '}': - if (brackets_count > 0) { - brackets_count--; - } - valid_end = brackets_count ? 0 : 1; - break; - case '(': - brace_count++; - valid_end = 0; - break; - case ')': - if (brace_count > 0) { - brace_count--; - } - valid_end = 0; - break; - case ';': - valid_end = brace_count == 0 && brackets_count == 0; - break; - case ' ': - case '\r': - case '\n': - case '\t': - break; - case '\'': - code_type = sstring; - break; - case '"': - code_type = dstring; - break; - case '#': - code_type = comment_line; - break; - case '/': - if (code[i+1] == '/') { - i++; - code_type = comment_line; - break; - } - if (code[i+1] == '*') { - last_valid_end = valid_end; - valid_end = 0; - code_type = comment_block; - i++; - break; - } - valid_end = 0; - break; - case '%': - if (!CG(asp_tags)) { - valid_end = 0; - break; - } - /* no break */ - case '?': - if (code[i+1] == '>') { - i++; - code_type = outside; - break; - } - valid_end = 0; - break; - case '<': - valid_end = 0; - if (i + 2 < len && code[i+1] == '<' && code[i+2] == '<') { - i += 2; - code_type = heredoc_start; - heredoc_len = 0; - } - break; - default: - valid_end = 0; - break; - } - break; - case sstring: - if (code[i] == '\\') { - code_type = sstring_esc; - } else { - if (code[i] == '\'') { - code_type = body; - } - } - break; - case sstring_esc: - code_type = sstring; - break; - case dstring: - if (code[i] == '\\') { - code_type = dstring_esc; - } else { - if (code[i] == '"') { - code_type = body; - } - } - break; - case dstring_esc: - code_type = dstring; - break; - case comment_line: - if (code[i] == '\n') { - code_type = body; - } - break; - case comment_block: - if (code[i-1] == '*' && code[i] == '/') { - code_type = body; - valid_end = last_valid_end; - } - break; - case heredoc_start: - switch(code[i]) { - case ' ': - case '\t': - break; - case '\r': - case '\n': - code_type = heredoc; - break; - default: - if (!heredoc_len) { - heredoc_tag = code+i; - } - heredoc_len++; - break; - } - break; - case heredoc: - if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_len)) { - code_type = body; - } - break; - case outside: - if ((CG(short_tags) && !strncmp(code+i-1, " 3 && !strncmp(code+i-4, " "; - } - break; - case sstring: - case sstring_esc: - *prompt = "php ' "; - break; - case dstring: - case dstring_esc: - *prompt = "php \" "; - break; - case comment_block: - *prompt = "/* > "; - break; - case heredoc: - *prompt = "<<< > "; - break; - case outside: - *prompt = " > "; - break; - } - - if (!valid_end || brackets_count) { - return 0; - } else { - return 1; - } -} -/* }}} */ - -static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */ -{ - char *name; - ulong number; - - if (!(*state % 2)) { - zend_hash_internal_pointer_reset(ht); - (*state)++; - } - while(zend_hash_has_more_elements(ht) == SUCCESS) { - zend_hash_get_current_key(ht, &name, &number, 0); - if (!textlen || (UG(unicode) ? !zend_cmp_unicode_and_string((UChar *)name, (char *)text, textlen) : !strncmp(name, text, textlen))) { - if (pData) { - zend_hash_get_current_data(ht, pData); - } - zend_hash_move_forward(ht); - return name; - } - if (zend_hash_move_forward(ht) == FAILURE) { - break; - } - } - (*state)++; - return NULL; -} /* }}} */ - -static char *cli_completion_generator_var(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */ -{ - char *retval, *tmp; - - tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(active_symbol_table), NULL TSRMLS_CC); - if (retval) { - if (UG(unicode)) { - int32_t tmp_len, len; - UErrorCode status = U_ZERO_ERROR; - - len = u_strlen((UChar *)retval); - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, - (UChar *)retval, len, &status); - - retval = malloc(tmp_len + 2); - retval[0] = '$'; - strcpy(&retval[1], tmp); - rl_completion_append_character = '\0'; - efree(tmp); - } else { - retval = malloc(strlen(tmp) + 2); - retval[0] = '$'; - strcpy(&retval[1], tmp); - rl_completion_append_character = '\0'; - } - } - return retval; -} /* }}} */ - -static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */ -{ - zend_function *func; - char *retval; - - retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func TSRMLS_CC); - if (retval) { - rl_completion_append_character = '('; - - if (UG(unicode)) { - char *tmp; - int32_t tmp_len, len; - UErrorCode status = U_ZERO_ERROR; - - len = u_strlen((UChar *)func->common.function_name); - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, - (UChar *)func->common.function_name, len, &status); - - retval = strdup(tmp); - efree(tmp); - } else { - retval = strdup(func->common.function_name); - } - } - - return retval; -} /* }}} */ - -static char *cli_completion_generator_class(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */ -{ - zend_class_entry **pce; - char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&pce TSRMLS_CC); - if (retval) { - rl_completion_append_character = '\0'; - - if (UG(unicode)) { - char *tmp; - int32_t tmp_len, len; - UErrorCode status = U_ZERO_ERROR; - - len = u_strlen((UChar *)(*pce)->name); - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, - (UChar *)(*pce)->name, len, &status); - - retval = strdup(tmp); - efree(tmp); - } else { - retval = strdup((*pce)->name); - } - } - - return retval; -} /* }}} */ - -static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */ -{ - zend_class_entry **pce; - char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce TSRMLS_CC); - if (retval) { - rl_completion_append_character = '\0'; - - if (UG(unicode)) { - char *tmp; - int32_t tmp_len, len; - UErrorCode status = U_ZERO_ERROR; - - len = u_strlen((UChar *)retval); - zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, - (UChar *)retval, len, &status); - - retval = strdup(tmp); - efree(tmp); - } else { - retval = strdup(retval); - } - } - - return retval; -} /* }}} */ - -static int cli_completion_state; - -static char *cli_completion_generator(const char *text, int index) /* {{{ */ -{ -/* -TODO: -- constants -- maybe array keys -- language constructs and other things outside a hashtable (echo, try, function, class, ...) -- object/class members - -- future: respect scope ("php > function foo() { $[tab]" should only expand to local variables...) -*/ - char *retval; - int textlen = strlen(text); - TSRMLS_FETCH(); - - if (!index) { - cli_completion_state = 0; - } - if (text[0] == '$') { - retval = cli_completion_generator_var(text, textlen, &cli_completion_state TSRMLS_CC); - } else { - char *lc_text, *class_name, *class_name_end; - int class_name_len; - zend_class_entry **pce = NULL; - - class_name_end = strstr(text, "::"); - if (class_name_end) { - class_name_len = class_name_end - text; - class_name = zend_str_tolower_dup(text, class_name_len); - class_name[class_name_len] = '\0'; /* not done automatically */ - if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC)==FAILURE) { - efree(class_name); - return NULL; - } - lc_text = zend_str_tolower_dup(class_name_end + 2, textlen - 2 - class_name_len); - textlen -= (class_name_len + 2); - } else { - lc_text = zend_str_tolower_dup(text, textlen); - } - - switch (cli_completion_state) { - case 0: - case 1: - retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, pce ? &(*pce)->function_table : EG(function_table) TSRMLS_CC); - if (retval) { - break; - } - case 2: - case 3: - retval = cli_completion_generator_define(text, textlen, &cli_completion_state, pce ? &(*pce)->constants_table : EG(zend_constants) TSRMLS_CC); - if (retval || pce) { - break; - } - case 4: - case 5: - retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state TSRMLS_CC); - break; - default: - break; - } - efree(lc_text); - if (class_name_end) { - efree(class_name); - } - if (pce && retval) { - char *tmp = malloc(class_name_len + 2 + strlen(retval) + 1); - - sprintf(tmp, "%s::%s", (*pce)->name, retval); - free(retval); - retval = tmp; - } - } - - return retval; -} /* }}} */ - -/* {{{ cli_code_completion - */ -char **cli_code_completion(const char *text, int start, int end) -{ - return rl_completion_matches(text, cli_completion_generator); -} -/* }}} */ - -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cli/php_cli_readline.h b/sapi/cli/php_cli_readline.h deleted file mode 100644 index c2ac3b2701d81..0000000000000 --- a/sapi/cli/php_cli_readline.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC); - -char **cli_code_completion(const char *text, int start, int end); diff --git a/sapi/cli/php_getopt.h b/sapi/cli/php_getopt.h deleted file mode 100644 index 6817edcee21ee..0000000000000 --- a/sapi/cli/php_getopt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef NETWARE -/* -As NetWare LibC has optind and optarg macros defined in unistd.h our local variables were getting mistakenly preprocessed so undeffing optind and optarg -*/ -#undef optarg -#undef optind -#endif -/* Define structure for one recognized option (both single char and long name). - * If short_open is '-' this is the last option. - */ -typedef struct _opt_struct { - const char opt_char; - const int need_param; - const char * opt_name; -} opt_struct; - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err); diff --git a/sapi/continuity/CREDITS b/sapi/continuity/CREDITS deleted file mode 100644 index 35335e926682f..0000000000000 --- a/sapi/continuity/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Continuity -Alex Leigh (based on nsapi code) diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c deleted file mode 100644 index fb52acf3e6120..0000000000000 --- a/sapi/continuity/capi.c +++ /dev/null @@ -1,508 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Alex Leigh | - +----------------------------------------------------------------------+ -*/ - -/* For more information on Continuity: http://www.ashpool.com/ */ - -/* - * This code is based on the PHP5 SAPI module for NSAPI by Jayakumar - * Muthukumarasamy - */ - -/* PHP includes */ -#define CONTINUITY 1 -#define CAPI_DEBUG - -/* Define for CDP specific extensions */ -#undef CONTINUITY_CDPEXT - -#include "php.h" -#include "php_variables.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_version.h" -#include "TSRM.h" -#include "ext/standard/php_standard.h" - -/* - * CAPI includes - */ -#include -#include - -#define NSLS_D struct capi_request_context *request_context -#define NSLS_DC , NSLS_D -#define NSLS_C request_context -#define NSLS_CC , NSLS_C -#define NSG(v) (request_context->v) - -/* - * ZTS needs to be defined for CAPI to work - */ -#if !defined(ZTS) -#error "CAPI module needs ZTS to be defined" -#endif - -/* - * Structure to encapsulate the CAPI request in SAPI - */ -typedef struct capi_request_context { - httpTtrans *t; - int read_post_bytes; -} capi_request_context; - -/**************/ - -PHP_MINIT_FUNCTION(continuity); -PHP_MSHUTDOWN_FUNCTION(continuity); -PHP_RINIT_FUNCTION(continuity); -PHP_RSHUTDOWN_FUNCTION(continuity); -PHP_MINFO_FUNCTION(continuity); - -PHP_FUNCTION(continuity_virtual); -PHP_FUNCTION(continuity_request_headers); -PHP_FUNCTION(continuity_response_headers); - -function_entry continuity_functions[] = { - {NULL, NULL, NULL} -}; - -zend_module_entry continuity_module_entry = { - STANDARD_MODULE_HEADER, - "continuity", - continuity_functions, - PHP_MINIT(continuity), - PHP_MSHUTDOWN(continuity), - NULL, - NULL, - PHP_MINFO(continuity), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -PHP_MINIT_FUNCTION(continuity) -{ - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(continuity) -{ - return SUCCESS; -} - -PHP_MINFO_FUNCTION(continuity) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Continuity Module Revision", "$Revision$"); - php_info_print_table_row(2, "Server Version", conFget_build()); -#ifdef CONTINUITY_CDPEXT - php_info_print_table_row(2,"CDP Extensions", "enabled"); -#else - php_info_print_table_row(2,"CDP Extensions", "disabled"); -#endif - php_info_print_table_end(); - -/* DISPLAY_INI_ENTRIES(); */ -} - -/**************/ - -/* - * sapi_capi_ub_write: Write len bytes to the connection output. - */ -static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) -{ - int retval; - capi_request_context *rc; - - rc = (capi_request_context *) SG(server_context); - retval = httpFwrite(rc->t, (char *) str, str_length); - if (retval == -1 || retval == 0) - php_handle_aborted_connection(); - return retval; -} - -/* - * sapi_capi_header_handler: Add/update response headers with those provided - * by the PHP engine. - */ -static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - lstFset_delete_key(rc->t->res_hdrs, "Content-Type"); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - if (p == NULL) { - return 0; - } - *p = 0; - do { - header_content++; - } while (*header_content == ' '); - - lstFset_add(rc->t->res_hdrs, header_name, header_content); - - *p = ':'; /* restore '*p' */ - - efree(sapi_header->header); - - return 0; /* don't use the default SAPI mechanism, CAPI - * duplicates this functionality */ -} - -/* - * sapi_capi_send_headers: Transmit the headers to the client. This has the - * effect of starting the response under Continuity. - */ -static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC) -{ - int retval; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - /* - * We could probably just do this in the header_handler. But, I don't know - * what the implication of doing it there is. - */ - - if (SG(sapi_headers).send_default_content_type) { - /* lstFset_delete_key(rc->t->res_hdrs, "Content-Type"); */ - lstFset_update(rc->t->res_hdrs, "Content-Type", "text/html"); - } - httpFset_status(rc->t, SG(sapi_headers).http_response_code, NULL); - httpFstart_response(rc->t); - - return SAPI_HEADER_SENT_SUCCESSFULLY; - -} - -static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - unsigned int max_read, total_read = 0; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - if (rc->read_post_bytes == -1) { - max_read = MIN(count_bytes, SG(request_info).content_length); - } else { - if (rc->read_post_bytes == 0) - return 0; - max_read = MIN(count_bytes, (SG(request_info).content_length - rc->read_post_bytes)); - } - - total_read = httpFread(rc->t, buffer, max_read); - - if (total_read < 0) - total_read = -1; - else - rc->read_post_bytes = total_read; - - return total_read; -} - -/* - * sapi_capi_read_cookies: Return cookie information into PHP. - */ -static char *sapi_capi_read_cookies(TSRMLS_D) -{ - char *cookie_string; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - cookie_string = lstFset_get(rc->t->req_hdrs, "cookie"); - return cookie_string; -} - -static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_DC) -{ - capi_request_context *rc = (capi_request_context *) SG(server_context); - size_t i; - char *value; - char buf[128]; - - /* PHP_SELF and REQUEST_URI */ - value = lstFset_get(rc->t->vars, "uri"); - if (value != NULL) { - php_register_variable("PHP_SELF", value, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC); - } - - /* COUNTRY CODE */ - value = lstFset_get(rc->t->vars, "ccode"); - if(value!=NULL) - php_register_variable("COUNTRY_CODE", value, track_vars_array TSRMLS_CC); - - /* argv */ - value = lstFset_get(rc->t->vars, "query"); - if (value != NULL) - php_register_variable("argv", value, track_vars_array TSRMLS_CC); - - /* GATEWAY_INTERFACE */ - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - - /* SERVER_NAME and HTTP_HOST */ - value = lstFset_get(rc->t->req_hdrs, "host"); - if (value != NULL) { - php_register_variable("HTTP_HOST", value, track_vars_array TSRMLS_CC); - /* TODO: This should probably scrub the port value if one is present. */ - php_register_variable("SERVER_NAME", value, track_vars_array TSRMLS_CC); - } - /* SERVER_SOFTWARE */ - value = lstFset_get(rc->t->res_hdrs, "Server"); - if (value != NULL) - php_register_variable("SERVER_SOFTWARE", value, track_vars_array TSRMLS_CC); - - /* SERVER_PROTOCOL */ - value = lstFset_get(rc->t->vars, "protocol"); - if (value != NULL) - php_register_variable("SERVER_PROTOCOL", value, track_vars_array TSRMLS_CC); - - /* REQUEST_METHOD */ - value = lstFset_get(rc->t->vars, "method"); - if (value != NULL) - php_register_variable("REQUEST_METHOD", value, track_vars_array TSRMLS_CC); - - /* QUERY_STRING */ - value = lstFset_get(rc->t->vars, "query"); - if (value != NULL) - php_register_variable("QUERY_STRING", value, track_vars_array TSRMLS_CC); - - /* DOCUMENT_ROOT */ - value = lstFset_get(rc->t->vars, "docroot"); - if (value != NULL) - php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT */ - value = lstFset_get(rc->t->req_hdrs, "accept"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_CHARSET */ - value = lstFset_get(rc->t->req_hdrs, "accept-charset"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_ENCODING */ - value = lstFset_get(rc->t->req_hdrs, "accept-encoding"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_LANGUAGE */ - value = lstFset_get(rc->t->req_hdrs, "accept-language"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array TSRMLS_CC); - - /* HTTP_CONNECTION */ - value = lstFset_get(rc->t->req_hdrs, "connection"); - if (value != NULL) - php_register_variable("HTTP_CONNECTION", value, track_vars_array TSRMLS_CC); - - /* HTTP_REFERER */ - value = lstFset_get(rc->t->req_hdrs, "referer"); - if (value != NULL) - php_register_variable("HTTP_REFERER", value, track_vars_array TSRMLS_CC); - - /* HTTP_USER_AGENT */ - value = lstFset_get(rc->t->req_hdrs, "user-agent"); - if (value != NULL) - php_register_variable("HTTP_USER_AGENT", value, track_vars_array TSRMLS_CC); - - /* REMOTE_ADDR */ - utlFip_to_str(rc->t->cli_ipv4_addr, buf, sizeof(buf)); - php_register_variable("REMOTE_ADDR", buf, track_vars_array TSRMLS_CC); - - /* REMOTE_PORT */ - - /* SCRIPT_FILENAME and PATH_TRANSLATED */ - value = lstFset_get(rc->t->vars, "path"); - if (value != NULL) { - php_register_variable("SCRIPT_FILENAME", value, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); - } - /* SERVER_ADMIN */ - /* Not applicable */ - - /* SERVER_PORT */ - -} - -static void capi_log_message(char *message) -{ - TSRMLS_FETCH(); - capi_request_context *rc = (capi_request_context *) SG(server_context); - logFmsg(0, "mod/php: %s", message); -} - -static int php_capi_startup(sapi_module_struct *sapi_module); - -sapi_module_struct capi_sapi_module = { - "Continuity", /* name */ - "Continuity Server Enterprise Edition", /* pretty name */ - - php_capi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_capi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_capi_header_handler, /* header handler */ - sapi_capi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_capi_read_post, /* read POST data */ - sapi_capi_read_cookies, /* read Cookies */ - - sapi_capi_register_server_variables, /* register server variables */ - capi_log_message, /* Log message */ - NULL, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static int php_capi_startup(sapi_module_struct *sapi_module) { - if(php_module_startup(sapi_module,&continuity_module_entry,1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -static char * - capi_strdup(char *str) -{ - if (str != NULL) - return strFcopy(str); - return NULL; -} - -static void capi_free(void *addr) -{ - if (addr != NULL) - free(addr); -} - -static void capi_request_ctor(NSLS_D TSRMLS_DC) -{ - char *query_string = lstFset_get(NSG(t->vars), "query"); - char *uri = lstFset_get(NSG(t->vars), "uri"); - char *path_info = lstFset_get(NSG(t->vars), "path-info"); - char *path_translated = lstFset_get(NSG(t->vars), "path"); - char *request_method = lstFset_get(NSG(t->vars), "method"); - char *content_type = lstFset_get(NSG(t->req_hdrs), "content-type"); - char *content_length = lstFset_get(NSG(t->req_hdrs), "content-length"); - - SG(request_info).query_string = capi_strdup(query_string); - SG(request_info).request_uri = capi_strdup(uri); - SG(request_info).request_method = capi_strdup(request_method); - SG(request_info).path_translated = capi_strdup(path_translated); - SG(request_info).content_type = capi_strdup(content_type); - SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0); - SG(sapi_headers).http_response_code = 200; -} - -static void capi_request_dtor(NSLS_D TSRMLS_DC) -{ - capi_free(SG(request_info).query_string); - capi_free(SG(request_info).request_uri); - capi_free(SG(request_info).request_method); - capi_free(SG(request_info).path_translated); - capi_free(SG(request_info).content_type); -} - -int capi_module_main(NSLS_D TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return SUCCESS; -} - -int phpFinit(lstTset * opt) -{ - php_core_globals *core_globals; - - tsrm_startup(128, 1, 0, NULL); - core_globals = ts_resource(core_globals_id); - - logFmsg(0, "mod/php: PHP Interface v3 (module)"); - logFmsg(0, "mod/php: Copyright (c) 1999-2005 The PHP Group. All rights reserved."); - - sapi_startup(&capi_sapi_module); - capi_sapi_module.startup(&capi_sapi_module); - - return STATUS_PROCEED; -} - -int phpFservice(httpTtrans * t, lstTset * opts) -{ - int retval; - capi_request_context *request_context; - - TSRMLS_FETCH(); - - request_context = (capi_request_context *) malloc(sizeof(capi_request_context)); - request_context->t = t; - request_context->read_post_bytes = -1; - - SG(server_context) = request_context; - - capi_request_ctor(NSLS_C TSRMLS_CC); - retval = capi_module_main(NSLS_C TSRMLS_CC); - capi_request_dtor(NSLS_C TSRMLS_CC); - - free(request_context); - - /* - * This call is ostensibly provided to free the memory from PHP/TSRM when - * the thread terminated, but, it leaks a structure in some hash list - * according to the developers. Not calling this will leak the entire - * interpreter, around 100k, but calling it and then terminating the - * thread will leak the struct (around a k). The only answer with the - * current TSRM implementation is to reuse the threads that allocate TSRM - * resources. - */ - /* ts_free_thread(); */ - - if (retval == SUCCESS) { - return STATUS_EXIT; - } else { - return STATUS_ERROR; - } -} diff --git a/sapi/continuity/config.m4 b/sapi/continuity/config.m4 deleted file mode 100644 index 1be2dfa3a1bc3..0000000000000 --- a/sapi/continuity/config.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl ## $Id$ -*- sh -*- - -AC_MSG_CHECKING(for Continuity support) -AC_ARG_WITH(continuity, -[ --with-continuity=DIR Build PHP as Continuity Server module. - DIR is path to the installed Continuity Server root],[ - PHP_CONTINUITY=$withval -],[ - PHP_CONTINUITY=no -]) -AC_MSG_RESULT($PHP_CONTINUITY) - -if test "$PHP_CONTINUITY" != "no"; then - - if test ! -d $PHP_CONTINUITY; then - AC_MSG_ERROR(Please specify the path to the root of your Continuity server using --with-continuity=DIR) - fi - AC_MSG_CHECKING(for Continuity include files) - if test -d $PHP_CONTINUITY/include ; then - CAPI_INCLUDE=$PHP_CONTINUITY/include - AC_MSG_RESULT(Continuity Binary Distribution) - else - AC_MSG_ERROR(Cannot find your CAPI include files in either DIR/src or DIR/include) - fi - - PHP_SELECT_SAPI(continuity,shared,capi.c) - PHP_ADD_INCLUDE($CAPI_INCLUDE) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(HAVE_CONTINUITY,1,[Whether you have a Continuity Server]) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_CONTINUITY/lib/" -fi - - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/embed/CREDITS b/sapi/embed/CREDITS deleted file mode 100644 index a5227b4ea9ce3..0000000000000 --- a/sapi/embed/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Embed -Edin Kadribasic diff --git a/sapi/embed/EXPERIMENTAL b/sapi/embed/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/embed/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4 deleted file mode 100644 index 4461bc338389a..0000000000000 --- a/sapi/embed/config.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for embedded SAPI library support) - -AC_ARG_ENABLE(embed, -[ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library - TYPE is either 'shared' or 'static'. [TYPE=shared]], -[ - case $enableval in - yes|shared) - PHP_EMBED_TYPE=shared - INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib" - ;; - static) - PHP_EMBED_TYPE=static - INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib" - ;; - *) - PHP_EMBED_TYPE=no - ;; - esac -],[ - PHP_EMBED_TYPE=no -]) - -AC_MSG_RESULT($PHP_EMBED_TYPE) - -if test "$PHP_EMBED_TYPE" != "no"; then - PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c) - PHP_INSTALL_HEADERS([sapi/embed/php_embed.h]) -fi diff --git a/sapi/embed/config.w32 b/sapi/embed/config.w32 deleted file mode 100644 index 8ea0781ed3c72..0000000000000 --- a/sapi/embed/config.w32 +++ /dev/null @@ -1,8 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('embed', 'Embedded SAPI library', 'no'); - -if (PHP_EMBED != "no") { - SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib'); -} diff --git a/sapi/embed/php5embed.dsp b/sapi/embed/php5embed.dsp deleted file mode 100644 index 8564b11797783..0000000000000 --- a/sapi/embed/php5embed.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5embed" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=php5embed - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5embed.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5embed.mak" CFG="php5embed - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5embed - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "php5embed - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5embed - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x406 /d "_DEBUG" -# ADD RSC /l 0x406 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\Debug_TS\php5embed.lib" - -!ELSEIF "$(CFG)" == "php5embed - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\Release_TS\php5embed.lib" - -!ENDIF - -# Begin Target - -# Name "php5embed - Win32 Debug_TS" -# Name "php5embed - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=php_embed.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=php_embed.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c deleted file mode 100644 index c80b9f9fc64b3..0000000000000 --- a/sapi/embed/php_embed.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_embed.h" - -#ifdef PHP_WIN32 -#include -#include -#endif - -static char* php_embed_read_cookies(TSRMLS_D) -{ - return NULL; -} - -static int php_embed_deactivate(TSRMLS_D) -{ - fflush(stdout); - return SUCCESS; -} - -static inline size_t php_embed_single_write(const char *str, uint str_length) -{ -#ifdef PHP_WRITE_STDOUT - long ret; - - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) return 0; - return ret; -#else - size_t ret; - - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} - - -static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - - while (remaining > 0) { - ret = php_embed_single_write(ptr, remaining); - if (!ret) { - php_handle_aborted_connection(); - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} - -static void php_embed_flush(void *server_context) -{ - if (fflush(stdout)==EOF) { - php_handle_aborted_connection(); - } -} - -static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) -{ -} - -static void php_embed_log_message(char *message) -{ - fprintf (stderr, "%s\n", message); -} - -static void php_embed_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_import_environment_variables(track_vars_array TSRMLS_CC); -} - -static int php_embed_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -sapi_module_struct php_embed_module = { - "embed", /* name */ - "PHP Embedded Library", /* pretty name */ - - php_embed_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - php_embed_deactivate, /* deactivate */ - - php_embed_ub_write, /* unbuffered write */ - php_embed_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - NULL, /* send headers handler */ - php_embed_send_header, /* send header handler */ - - NULL, /* read POST data */ - php_embed_read_cookies, /* read Cookies */ - - php_embed_register_variables, /* register server variables */ - php_embed_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -int php_embed_init(int argc, char **argv PTSRMLS_DC) -{ - zend_llist global_vars; -#ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - php_core_globals *core_globals; - sapi_globals_struct *sapi_globals; - void ***tsrm_ls; -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); - sapi_globals = ts_resource(sapi_globals_id); - tsrm_ls = ts_resource(0); - *ptsrm_ls = tsrm_ls; -#endif - - sapi_startup(&php_embed_module); - - if (php_embed_module.startup(&php_embed_module)==FAILURE) { - return FAILURE; - } - - if (argv) { - php_embed_module.executable_location = argv[0]; - } - - zend_llist_init(&global_vars, sizeof(char *), NULL, 0); - - /* Set some Embedded PHP defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - zend_alter_ini_entry("register_argc_argv", 19, "1", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - zend_alter_ini_entry("html_errors", 12, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - zend_alter_ini_entry("implicit_flush", 15, "1", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - zend_alter_ini_entry("max_execution_time", 19, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - - SG(request_info).argc=argc; - SG(request_info).argv=argv; - - if (php_request_startup(TSRMLS_C)==FAILURE) { - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_register_variable("PHP_SELF", "-", NULL TSRMLS_CC); - - return SUCCESS; -} - -void php_embed_shutdown(TSRMLS_D) -{ - php_request_shutdown((void *) 0); - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h deleted file mode 100644 index c3ee95d7e14b8..0000000000000 --- a/sapi/embed/php_embed.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef _PHP_EMBED_H_ -#define _PHP_EMBED_H_ - -#include
              -#include
              -#include
              -#include
              -#include
              -#include - -#ifdef ZTS -#define PTSRMLS_D void ****ptsrm_ls -#define PTSRMLS_DC , PTSRMLS_D -#define PTSRMLS_C &tsrm_ls -#define PTSRMLS_CC , PTSRMLS_C -#else -#define PTSRMLS_D -#define PTSRMLS_DC -#define PTSRMLS_C -#define PTSRMLS_CC -#endif - -#define PHP_EMBED_START_BLOCK(x,y) { \ - void ***tsrm_ls; \ - php_embed_init(x, y PTSRMLS_CC); \ - zend_first_try { - -#define PHP_EMBED_END_BLOCK() \ - } zend_catch { \ - /* int exit_status = EG(exit_status); */ \ - } zend_end_try(); \ - php_embed_shutdown(TSRMLS_C); \ -} - -BEGIN_EXTERN_C() -int php_embed_init(int argc, char **argv PTSRMLS_DC); -void php_embed_shutdown(TSRMLS_D); -extern sapi_module_struct php_embed_module; -END_EXTERN_C() - - -#endif /* _PHP_EMBED_H_ */ diff --git a/sapi/isapi/CREDITS b/sapi/isapi/CREDITS deleted file mode 100644 index 11c6fdc73c599..0000000000000 --- a/sapi/isapi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ISAPI -Andi Gutmans, Zeev Suraski diff --git a/sapi/isapi/config.m4 b/sapi/isapi/config.m4 deleted file mode 100644 index b5410ace000e2..0000000000000 --- a/sapi/isapi/config.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -AC_MSG_CHECKING(for Zeus ISAPI support) -AC_ARG_WITH(isapi, -[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], -[ - if test "$withval" = "yes"; then - ZEUSPATH=/usr/local/zeus # the default - else - ZEUSPATH=$withval - fi - test -f "$ZEUSPATH/web/include/httpext.h" || AC_MSG_ERROR(Unable to find httpext.h in $ZEUSPATH/web/include) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(WITH_ZEUS,1,[ ]) - PHP_ADD_INCLUDE($ZEUSPATH/web/include) - PHP_SELECT_SAPI(isapi, shared, php5isapi.c) - INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/" - RESULT=yes -]) -AC_MSG_RESULT($RESULT) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/isapi/config.w32 b/sapi/isapi/config.w32 deleted file mode 100644 index 13d0e016eb76c..0000000000000 --- a/sapi/isapi/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'no'); - -if (PHP_ISAPI == "yes") { - if (PHP_ZTS == "no") { - ERROR("ISAPI module requires an --enable-zts build of PHP"); - } - - SAPI('isapi', 'php5isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP5ISAPI_EXPORTS'); - ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php5isapi.def'); -} diff --git a/sapi/isapi/php.sym b/sapi/isapi/php.sym deleted file mode 100644 index 34b50b851cad0..0000000000000 --- a/sapi/isapi/php.sym +++ /dev/null @@ -1,5 +0,0 @@ -GetFilterVersion -HttpFilterProc -GetExtensionVersion -HttpExtensionProc -ZSLMain diff --git a/sapi/isapi/php5isapi.c b/sapi/isapi/php5isapi.c deleted file mode 100644 index e79116ec85c98..0000000000000 --- a/sapi/isapi/php5isapi.c +++ /dev/null @@ -1,967 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Zeev Suraski | - | Ben Mansell (Zeus Support) | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" -#include -#include -#include -#include "php_main.h" -#include "SAPI.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "php_variables.h" -#include "php_ini.h" - -#ifdef PHP_WIN32 -# include -#else -# define __try -# define __except(val) -# define __declspec(foo) -#endif - - -#ifdef WITH_ZEUS -# include "httpext.h" -# include -# define GetLastError() errno -#endif - -#ifdef PHP_WIN32 -#define PHP_ENABLE_SEH -#endif - -/* -uncomment the following lines to turn off -exception trapping when running under a debugger - -#ifdef _DEBUG -#undef PHP_ENABLE_SEH -#endif -*/ - -#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION") -#define ISAPI_SERVER_VAR_BUF_SIZE 1024 -#define ISAPI_POST_DATA_BUF 1024 - -static zend_bool bFilterLoaded=0; -static zend_bool bTerminateThreadsOnError=0; - -static char *isapi_special_server_variable_names[] = { - "ALL_HTTP", - "HTTPS", -#ifndef WITH_ZEUS - "SCRIPT_NAME", -#endif - NULL -}; - -#define NUM_SPECIAL_VARS (sizeof(isapi_special_server_variable_names)/sizeof(char *)) -#define SPECIAL_VAR_ALL_HTTP 0 -#define SPECIAL_VAR_HTTPS 1 -#define SPECIAL_VAR_PHP_SELF 2 - -static char *isapi_server_variable_names[] = { - "AUTH_PASSWORD", - "AUTH_TYPE", - "AUTH_USER", - "CONTENT_LENGTH", - "CONTENT_TYPE", - "PATH_TRANSLATED", - "QUERY_STRING", - "REMOTE_ADDR", - "REMOTE_HOST", - "REMOTE_USER", - "REQUEST_METHOD", - "SERVER_NAME", - "SERVER_PORT", - "SERVER_PROTOCOL", - "SERVER_SOFTWARE", -#ifndef WITH_ZEUS - "APPL_MD_PATH", - "APPL_PHYSICAL_PATH", - "INSTANCE_ID", - "INSTANCE_META_PATH", - "LOGON_USER", - "REQUEST_URI", - "URL", -#else - "DOCUMENT_ROOT", -#endif - NULL -}; - - -static char *isapi_secure_server_variable_names[] = { - "CERT_COOKIE", - "CERT_FLAGS", - "CERT_ISSUER", - "CERT_KEYSIZE", - "CERT_SECRETKEYSIZE", - "CERT_SERIALNUMBER", - "CERT_SERVER_ISSUER", - "CERT_SERVER_SUBJECT", - "CERT_SUBJECT", - "HTTPS_KEYSIZE", - "HTTPS_SECRETKEYSIZE", - "HTTPS_SERVER_ISSUER", - "HTTPS_SERVER_SUBJECT", - "SERVER_PORT_SECURE", -#ifdef WITH_ZEUS - "SSL_CLIENT_CN", - "SSL_CLIENT_EMAIL", - "SSL_CLIENT_OU", - "SSL_CLIENT_O", - "SSL_CLIENT_L", - "SSL_CLIENT_ST", - "SSL_CLIENT_C", - "SSL_CLIENT_I_CN", - "SSL_CLIENT_I_EMAIL", - "SSL_CLIENT_I_OU", - "SSL_CLIENT_I_O", - "SSL_CLIENT_I_L", - "SSL_CLIENT_I_ST", - "SSL_CLIENT_I_C", -#endif - NULL -}; - - -static void php_info_isapi(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char **p; - char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len; - char **all_variables[] = { - isapi_server_variable_names, - isapi_special_server_variable_names, - isapi_secure_server_variable_names, - NULL - }; - char ***server_variable_names; - LPEXTENSION_CONTROL_BLOCK lpECB; - - lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - php_info_print_table_start(); - php_info_print_table_header(2, "Server Variable", "Value"); - server_variable_names = all_variables; - while (*server_variable_names) { - p = *server_variable_names; - while (*p) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, *p, variable_buf); - } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - char *tmp_variable_buf; - - tmp_variable_buf = (char *) emalloc(variable_len); - if (lpECB->GetServerVariable(lpECB->ConnID, *p, tmp_variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, *p, tmp_variable_buf); - } - efree(tmp_variable_buf); - } - p++; - } - server_variable_names++; - } - php_info_print_table_end(); -} - - -static zend_module_entry php_isapi_module = { - STANDARD_MODULE_HEADER, - "ISAPI", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_isapi, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - DWORD num_bytes = str_length; - LPEXTENSION_CONTROL_BLOCK ecb; - - ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC) == FALSE) { - php_handle_aborted_connection(); - } - return num_bytes; -} - - -static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_ADD; -} - - - -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) -{ - *total_length += sapi_header->header_len+2; -} - - -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) -{ - memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); - *combined_headers_ptr += sapi_header->header_len; - **combined_headers_ptr = '\r'; - (*combined_headers_ptr)++; - **combined_headers_ptr = '\n'; - (*combined_headers_ptr)++; -} - - -static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - uint total_length = 2; /* account for the trailing \r\n */ - char *combined_headers, *combined_headers_ptr; - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - HSE_SEND_HEADER_EX_INFO header_info; - sapi_header_struct default_content_type; - char *status_buf = NULL; - - /* Obtain headers length */ - if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); - - /* Generate headers */ - combined_headers = (char *) emalloc(total_length+1); - combined_headers_ptr = combined_headers; - if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); - sapi_free_header(&default_content_type); /* we no longer need it */ - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); - *combined_headers_ptr++ = '\r'; - *combined_headers_ptr++ = '\n'; - *combined_headers_ptr = 0; - - switch (SG(sapi_headers).http_response_code) { - case 200: - header_info.pszStatus = "200 OK"; - break; - case 302: - header_info.pszStatus = "302 Moved Temporarily"; - break; - case 401: - header_info.pszStatus = "401 Authorization Required"; - break; - default: { - const char *sline = SG(sapi_headers).http_status_line; - - status_buf = emalloc(MAX_STATUS_LENGTH + 1); - - /* httpd requires that r->status_line is set to the first digit of - * the status-code: */ - if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') { - status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH); - } else { - snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SG(sapi_headers).http_response_code); - } - header_info.pszStatus = status_buf; - break; - } - } - header_info.cchStatus = strlen(header_info.pszStatus); - header_info.pszHeader = combined_headers; - header_info.cchHeader = total_length; - header_info.fKeepConn = FALSE; - lpECB->dwHttpStatusCode = SG(sapi_headers).http_response_code; - - lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); - - efree(combined_headers); - if (status_buf) { - efree(status_buf); - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int php_isapi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_isapi_module, 1)==FAILURE) { - return FAILURE; - } else { - bTerminateThreadsOnError = (zend_bool) INI_INT("isapi.terminate_threads_on_error"); - return SUCCESS; - } -} - - -static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - DWORD read_from_buf=0; - DWORD read_from_input=0; - DWORD total_read=0; - - if ((DWORD) SG(read_post_bytes) < lpECB->cbAvailable) { - read_from_buf = MIN(lpECB->cbAvailable-SG(read_post_bytes), count_bytes); - memcpy(buffer, lpECB->lpbData+SG(read_post_bytes), read_from_buf); - total_read += read_from_buf; - } - if (read_from_bufcbTotalBytes) { - DWORD cbRead=0, cbSize; - - read_from_input = MIN(count_bytes-read_from_buf, lpECB->cbTotalBytes-SG(read_post_bytes)-read_from_buf); - while (cbRead < read_from_input) { - cbSize = read_from_input - cbRead; - if (!lpECB->ReadClient(lpECB->ConnID, buffer+read_from_buf+cbRead, &cbSize) || cbSize==0) { - break; - } - cbRead += cbSize; - } - total_read += cbRead; - } - return total_read; -} - - -static char *sapi_isapi_read_cookies(TSRMLS_D) -{ - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_COOKIE", variable_buf, &variable_len)) { - return estrndup(variable_buf, variable_len); - } else if (GetLastError()==ERROR_INSUFFICIENT_BUFFER) { - char *tmp_variable_buf = (char *) emalloc(variable_len+1); - - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_COOKIE", tmp_variable_buf, &variable_len)) { - tmp_variable_buf[variable_len] = 0; - return tmp_variable_buf; - } else { - efree(tmp_variable_buf); - } - } - return STR_EMPTY_ALLOC(); -} - - -#ifdef WITH_ZEUS - -static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char static_cons_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - /* - * We need to construct the /C=.../ST=... - * DN's for SSL_CLIENT_DN and SSL_CLIENT_I_DN - */ - strcpy( static_cons_buf, "/C=" ); - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strcat( static_cons_buf, static_variable_buf ); - } - strcat( static_cons_buf, "/ST=" ); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strcat( static_cons_buf, static_variable_buf ); - } - php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC ); - - strcpy( static_cons_buf, "/C=" ); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strcat( static_cons_buf, static_variable_buf ); - } - strcat( static_cons_buf, "/ST=" ); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strcat( static_cons_buf, static_variable_buf ); - } - php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC ); -} - -static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD scriptname_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD pathinfo_len = 0; - char *strtok_buf = NULL; - - /* Get SCRIPT_NAME, we use this to work out which bit of the URL - * belongs in PHP's version of PATH_INFO - */ - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len); - - /* Adjust Zeus' version of PATH_INFO, set PHP_SELF, - * and generate REQUEST_URI - */ - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - - /* PHP_SELF is just PATH_INFO */ - php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC ); - - /* Chop off filename to get just the 'real' PATH_INFO' */ - pathinfo_len = variable_len - scriptname_len; - php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array TSRMLS_CC ); - /* append query string to give url... extra byte for '?' */ - if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { - /* append query string only if it is present... */ - if ( strlen(lpECB->lpszQueryString) ) { - static_variable_buf[ variable_len - 1 ] = '?'; - strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); - } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); - } - } - - /* Get and adjust PATH_TRANSLATED to what PHP wants */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - static_variable_buf[ variable_len - pathinfo_len - 1 ] = '\0'; - php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); - } - - /* Bring in the AUTHENTICATION stuff as needed */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_USER", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_PASSWORD", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_TYPE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array TSRMLS_CC ); - } - - /* And now, for the SSL variables (if applicable) */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "CERT_COOKIE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array TSRMLS_CC ); - } - /* Copy some of the variables we need to meet Apache specs */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "SERVER_SOFTWARE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array TSRMLS_CC ); - } -} -#else - -static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - char path_info_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD scriptname_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD pathinfo_len = 0; - HSE_URL_MAPEX_INFO humi; - - /* Get SCRIPT_NAME, we use this to work out which bit of the URL - * belongs in PHP's version of PATH_INFO. SCRIPT_NAME also becomes PHP_SELF. - */ - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len); - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - /* Adjust IIS' version of PATH_INFO, set PHP_SELF, - * and generate REQUEST_URI - * Get and adjust PATH_TRANSLATED to what PHP wants - */ - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - - /* Chop off filename to get just the 'real' PATH_INFO' */ - php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array TSRMLS_CC ); - pathinfo_len = variable_len - scriptname_len; - strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf)-1); - php_register_variable( "PATH_INFO", path_info_buf, track_vars_array TSRMLS_CC ); - /* append query string to give url... extra byte for '?' */ - if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { - /* append query string only if it is present... */ - if ( strlen(lpECB->lpszQueryString) ) { - static_variable_buf[ variable_len - 1 ] = '?'; - strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); - } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); - } - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, path_info_buf, &pathinfo_len, (LPDWORD) &humi)) { - /* Remove trailing \ */ - if (humi.lpszPath[variable_len-2] == '\\') { - humi.lpszPath[variable_len-2] = 0; - } - php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array TSRMLS_CC); - } - } - - static_variable_buf[0] = '/'; - static_variable_buf[1] = 0; - variable_len = 2; - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, static_variable_buf, &variable_len, (LPDWORD) &humi)) { - /* Remove trailing \ */ - if (humi.lpszPath[variable_len-2] == '\\') { - humi.lpszPath[variable_len-2] = 0; - } - php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC); - } - - if (!SG(request_info).auth_user || !SG(request_info).auth_password || - !SG(request_info).auth_user[0] || !SG(request_info).auth_password[0]) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_AUTHORIZATION", static_variable_buf, &variable_len) - && static_variable_buf[0]) { - php_handle_auth_data(static_variable_buf TSRMLS_CC); - } - } - - if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array TSRMLS_CC ); - } - if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array TSRMLS_CC ); - } -} -#endif - -static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values TSRMLS_DC) -{ - char **p=server_variables; - DWORD variable_len; - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - char *variable_buf; - - while (*p) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, *p, static_variable_buf, &variable_len) - && static_variable_buf[0]) { - php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC); - if (recorded_values) { - recorded_values[p-server_variables] = estrndup(static_variable_buf, variable_len); - } - } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - variable_buf = (char *) emalloc(variable_len+1); - if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len) - && variable_buf[0]) { - php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC); - } - if (recorded_values) { - recorded_values[p-server_variables] = variable_buf; - } else { - efree(variable_buf); - } - } else { /* for compatibility with Apache SAPIs */ - php_register_variable(*p, "", track_vars_array TSRMLS_CC); - } - p++; - } -} - - -static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char *variable; - char *strtok_buf = NULL; - char *isapi_special_server_variables[NUM_SPECIAL_VARS]; - LPEXTENSION_CONTROL_BLOCK lpECB; - - lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - /* Register the special ISAPI variables */ - memset(isapi_special_server_variables, 0, sizeof(isapi_special_server_variables)); - sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables TSRMLS_CC); - if (SG(request_info).cookie_data) { - php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array TSRMLS_CC); - } - - /* Register the standard ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); - - if (isapi_special_server_variables[SPECIAL_VAR_HTTPS] - && (atoi(isapi_special_server_variables[SPECIAL_VAR_HTTPS]) - || !strcasecmp(isapi_special_server_variables[SPECIAL_VAR_HTTPS], "on")) - ) { - /* Register SSL ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); - } - - if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]) { - efree(isapi_special_server_variables[SPECIAL_VAR_HTTPS]); - } - - -#ifdef WITH_ZEUS - sapi_isapi_register_zeus_variables(lpECB, track_vars_array TSRMLS_CC); -#else - sapi_isapi_register_iis_variables(lpECB, track_vars_array TSRMLS_CC); -#endif - - /* PHP_SELF support */ - if (isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]) { - php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array TSRMLS_CC); - efree(isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]); - } - - if (isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP]) { - /* Register the internal bits of ALL_HTTP */ - variable = php_strtok_r(isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP], "\r\n", &strtok_buf); - while (variable) { - char *colon = strchr(variable, ':'); - - if (colon) { - char *value = colon+1; - - while (*value==' ') { - value++; - } - *colon = 0; - php_register_variable(variable, value, track_vars_array TSRMLS_CC); - *colon = ':'; - } - variable = php_strtok_r(NULL, "\r\n", &strtok_buf); - } - efree(isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP]); - } -} - - -static sapi_module_struct isapi_sapi_module = { - "isapi", /* name */ - "ISAPI", /* pretty name */ - - php_isapi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_isapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_isapi_header_handler, /* header handler */ - sapi_isapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_isapi_read_post, /* read POST data */ - sapi_isapi_read_cookies, /* read Cookies */ - - sapi_isapi_register_server_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - - -BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pFilterVersion) -{ - bFilterLoaded = 1; - pFilterVersion->dwFilterVersion = HTTP_FILTER_REVISION; - strcpy(pFilterVersion->lpszFilterDesc, isapi_sapi_module.pretty_name); - pFilterVersion->dwFlags= (SF_NOTIFY_AUTHENTICATION | SF_NOTIFY_PREPROC_HEADERS); - return TRUE; -} - - -DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification) -{ - TSRMLS_FETCH(); - - switch (notificationType) { - case SF_NOTIFY_PREPROC_HEADERS: - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - break; - case SF_NOTIFY_AUTHENTICATION: { - char *auth_user = ((HTTP_FILTER_AUTHENT *) pvNotification)->pszUser; - char *auth_password = ((HTTP_FILTER_AUTHENT *) pvNotification)->pszPassword; - - if (auth_user && auth_user[0]) { - SG(request_info).auth_user = estrdup(auth_user); - } - if (auth_password && auth_password[0]) { - SG(request_info).auth_password = estrdup(auth_password); - } - return SF_STATUS_REQ_HANDLED_NOTIFICATION; - } - break; - } - return SF_STATUS_REQ_NEXT_NOTIFICATION; -} - - -static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC) -{ - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; -#ifndef WITH_ZEUS - HSE_URL_MAPEX_INFO humi; -#endif - - SG(request_info).request_method = lpECB->lpszMethod; - SG(request_info).query_string = lpECB->lpszQueryString; - SG(request_info).request_uri = lpECB->lpszPathInfo; - SG(request_info).content_type = lpECB->lpszContentType; - SG(request_info).content_length = lpECB->cbTotalBytes; - SG(sapi_headers).http_response_code = 200; /* I think dwHttpStatusCode is invalid at this stage -RL */ - if (!bFilterLoaded) { /* we don't have valid ISAPI Filter information */ - SG(request_info).auth_user = SG(request_info).auth_password = NULL; - } - -#ifdef WITH_ZEUS - /* PATH_TRANSLATED can contain extra PATH_INFO stuff after the - * file being loaded, so we must use SCRIPT_FILENAME instead - */ - if(lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_FILENAME", static_variable_buf, &variable_len)) { - SG(request_info).path_translated = estrdup(static_variable_buf); - } else -#else - /* happily, IIS gives us SCRIPT_NAME which is correct (without PATH_INFO stuff) - so we can just map that to the physical path and we have our filename */ - - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len); - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, static_variable_buf, &variable_len, (LPDWORD) &humi)) { - SG(request_info).path_translated = estrdup(humi.lpszPath); - } else -#endif - /* if mapping fails, default to what the server tells us */ - SG(request_info).path_translated = estrdup(lpECB->lpszPathTranslated); - - /* some server configurations allow '..' to slip through in the - translated path. We'll just refuse to handle such a path. */ - if (strstr(SG(request_info).path_translated,"..")) { - SG(sapi_headers).http_response_code = 404; - efree(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - } -} - - -static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC) -{ - if (!SG(headers_sent)) { - HSE_SEND_HEADER_EX_INFO header_info; - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - header_info.pszStatus = "500 Internal Server Error"; - header_info.cchStatus = strlen(header_info.pszStatus); - header_info.pszHeader = "Content-Type: text/html\r\n\r\n"; - header_info.cchHeader = strlen(header_info.pszHeader); - - lpECB->dwHttpStatusCode = 500; - lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); - SG(headers_sent)=1; - } - sapi_isapi_ub_write(message, message_len TSRMLS_CC); -} - - -BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) -{ - pVer->dwExtensionVersion = HSE_VERSION; -#ifdef WITH_ZEUS - strncpy( pVer->lpszExtensionDesc, isapi_sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); -#else - lstrcpyn(pVer->lpszExtensionDesc, isapi_sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); -#endif - return TRUE; -} - - -static void my_endthread() -{ -#ifdef PHP_WIN32 - if (bTerminateThreadsOnError) { - _endthread(); - } -#endif -} - -#ifdef PHP_WIN32 -/* ep is accessible only in the context of the __except expression, - * so we have to call this function to obtain it. - */ -BOOL exceptionhandler(LPEXCEPTION_POINTERS *e, LPEXCEPTION_POINTERS ep) -{ - *e=ep; - return TRUE; -} -#endif - -DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) -{ - zend_file_handle file_handle; - zend_bool stack_overflown=0; - int retval = FAILURE; -#ifdef PHP_ENABLE_SEH - LPEXCEPTION_POINTERS e; -#endif - TSRMLS_FETCH(); - - zend_first_try { -#ifdef PHP_ENABLE_SEH - __try { -#endif - init_request_info(lpECB TSRMLS_CC); - SG(server_context) = lpECB; - - php_request_startup(TSRMLS_C); - - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - - /* open the script here so we can 404 if it fails */ - if (file_handle.filename) - retval = php_fopen_primary_script(&file_handle TSRMLS_CC); - - if (!file_handle.filename || retval == FAILURE) { - SG(sapi_headers).http_response_code = 404; - PUTS("No input file specified.\n"); - } else { - php_execute_script(&file_handle TSRMLS_CC); - } - - if (SG(request_info).cookie_data) { - efree(SG(request_info).cookie_data); - } - if (SG(request_info).path_translated) - efree(SG(request_info).path_translated); -#ifdef PHP_ENABLE_SEH - } __except(exceptionhandler(&e, GetExceptionInformation())) { - char buf[1024]; - if (_exception_code()==EXCEPTION_STACK_OVERFLOW) { - LPBYTE lpPage; - static SYSTEM_INFO si; - static MEMORY_BASIC_INFORMATION mi; - static DWORD dwOldProtect; - - GetSystemInfo(&si); - - /* Get page ESP is pointing to */ - _asm mov lpPage, esp; - - /* Get stack allocation base */ - VirtualQuery(lpPage, &mi, sizeof(mi)); - - /* Go to the page below the current page */ - lpPage = (LPBYTE) (mi.BaseAddress) - si.dwPageSize; - - /* Free pages below current page */ - if (!VirtualFree(mi.AllocationBase, (LPBYTE)lpPage - (LPBYTE) mi.AllocationBase, MEM_DECOMMIT)) { - _endthread(); - } - - /* Restore the guard page */ - if (!VirtualProtect(lpPage, si.dwPageSize, PAGE_GUARD | PAGE_READWRITE, &dwOldProtect)) { - _endthread(); - } - - CG(unclean_shutdown)=1; - _snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow"); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { - _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - my_endthread(); - } else { - _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - my_endthread(); - } - } -#endif -#ifdef PHP_ENABLE_SEH - __try { - php_request_shutdown(NULL); - } __except(EXCEPTION_EXECUTE_HANDLER) { - my_endthread(); - } -#else - php_request_shutdown(NULL); -#endif - } zend_catch { - zend_try { - php_request_shutdown(NULL); - } zend_end_try(); - return HSE_STATUS_ERROR; - } zend_end_try(); - - return HSE_STATUS_SUCCESS; -} - - - -__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: -#ifdef WITH_ZEUS - tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "TSRM.log"); -#else - tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log"); -#endif - sapi_startup(&isapi_sapi_module); - if (isapi_sapi_module.startup) { - isapi_sapi_module.startup(&sapi_module); - } - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - ts_free_thread(); - break; - case DLL_PROCESS_DETACH: - if (isapi_sapi_module.shutdown) { - isapi_sapi_module.shutdown(&sapi_module); - } - sapi_shutdown(); - tsrm_shutdown(); - break; - } - return TRUE; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/isapi/php5isapi.def b/sapi/isapi/php5isapi.def deleted file mode 100644 index 596023ef55489..0000000000000 --- a/sapi/isapi/php5isapi.def +++ /dev/null @@ -1,5 +0,0 @@ -EXPORTS -HttpFilterProc -GetFilterVersion -HttpExtensionProc -GetExtensionVersion diff --git a/sapi/isapi/php5isapi.dsp b/sapi/isapi/php5isapi.dsp deleted file mode 100644 index 3dbab11effe33..0000000000000 --- a/sapi/isapi/php5isapi.dsp +++ /dev/null @@ -1,165 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5isapi" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5isapi - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5isapi.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5isapi.mak" CFG="php5isapi - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5isapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5isapi - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D "COMPILE_LIBZEND" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5isapi___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5isapi___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /debug /machine:I386 /libpath:"..\..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5isapi - Win32 Debug_TS" -# Name "php5isapi - Win32 Release_TS" -# Name "php5isapi - Win32 Release_TS_inline" -# Name "php5isapi - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php5isapi.c -# End Source File -# Begin Source File - -SOURCE=.\php5isapi.def -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/sapi/isapi/stresstest/getopt.c b/sapi/isapi/stresstest/getopt.c deleted file mode 100644 index 57faa0f890c17..0000000000000 --- a/sapi/isapi/stresstest/getopt.c +++ /dev/null @@ -1,175 +0,0 @@ -/* Borrowed from Apache NT Port */ - -#include -#include -#include -#include -#include "getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -char *ap_optarg; -int ap_optind = 1; -static int ap_opterr = 1; -static int ap_optopt; - -static int -ap_optiserr(int argc, char * const *argv, int oint, const char *optstr, - int optchr, int err) -{ - if (ap_opterr) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - ap_optopt = argv[oint][optchr]; - return('?'); -} - -int ap_getopt(int argc, char* const *argv, const char *optstr) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - - char *cp; - - if (ap_optind >= argc) - return(EOF); - if (!dash && (argv[ap_optind][0] != '-')) - return(EOF); - if (!dash && (argv[ap_optind][0] == '-') && !argv[ap_optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - if ((argv[ap_optind][0] == '-') && (argv[ap_optind][1] == '-')) - { - /* -- indicates end of args */ - ap_optind++; - return(EOF); - } - if (!dash) - { - assert((argv[ap_optind][0] == '-') && argv[ap_optind][1]); - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - assert(dash); - if (argv[ap_optind][optchr] == ':') - { - dash = 0; - ap_optind++; - return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRCOLON)); - } - if (!(cp = strchr(optstr, argv[ap_optind][optchr]))) - { - int errind = ap_optind; - int errchr = optchr; - - if (!argv[ap_optind][optchr+1]) - { - dash = 0; - ap_optind++; - } - else - optchr++; - return(ap_optiserr(argc, argv, errind, optstr, errchr, OPTERRNF)); - } - if (cp[1] == ':') - { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[ap_optind][2]) { - ap_optind++; - if (ap_optind == argc) - return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRARG)); - ap_optarg = argv[ap_optind++]; - } - else - { - ap_optarg = &argv[ap_optind][2]; - ap_optind++; - } - return(*cp); - } - else - { - if (!argv[ap_optind][optchr+1]) - { - dash = 0; - ap_optind++; - } - else - optchr++; - return(*cp); - } - assert(0); - return(0); -} - -#ifdef TESTGETOPT -int - main (int argc, char **argv) - { - int c; - extern char *ap_optarg; - extern int ap_optind; - int aflg = 0; - int bflg = 0; - int errflg = 0; - char *ofile = NULL; - - while ((c = ap_getopt(argc, argv, "abo:")) != EOF) - switch (c) { - case 'a': - if (bflg) - errflg++; - else - aflg++; - break; - case 'b': - if (aflg) - errflg++; - else - bflg++; - break; - case 'o': - ofile = ap_optarg; - (void)printf("ofile = %s\n", ofile); - break; - case '?': - errflg++; - } - if (errflg) { - (void)fprintf(stderr, - "usage: cmd [-a|-b] [-o ] files...\n"); - exit (2); - } - for ( ; ap_optind < argc; ap_optind++) - (void)printf("%s\n", argv[ap_optind]); - return 0; - } - -#endif /* TESTGETOPT */ diff --git a/sapi/isapi/stresstest/getopt.h b/sapi/isapi/stresstest/getopt.h deleted file mode 100644 index a3e278e3a60d8..0000000000000 --- a/sapi/isapi/stresstest/getopt.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Borrowed from Apache NT Port */ -#ifdef __cplusplus -extern "C" { -#endif -extern char *ap_optarg; -extern int ap_optind; - -int ap_getopt(int argc, char* const *argv, const char *optstr); - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sapi/isapi/stresstest/notes.txt b/sapi/isapi/stresstest/notes.txt deleted file mode 100644 index f58ab3c0e9ba7..0000000000000 --- a/sapi/isapi/stresstest/notes.txt +++ /dev/null @@ -1,56 +0,0 @@ -This stress test program is for debugging threading issues with the ISAPI -module. - -2 ways to use it: - -1: test any php script file on multiple threads -2: run the php test scripts bundled with the source code - - - -GLOBAL SETTINGS -=============== - -If you need to set special environement variables, in addition to your -regular environment, create a file that contains them, one setting per line: - -MY_ENV_VAR=XXXXXXXX - -This can be used to simulate ISAPI environment variables if need be. - -By default, stress test uses 10 threads. To change this, change the define -NUM_THREADS in stresstest.cpp. - - - -1: Test any php script file on multiple threads -=============================================== - -Create a file that contains a list of php script files, one per line. If -you need to provide input, place the GET data, or Query String, after the -filename. File contents would look like: - -e:\inetpub\pages\index.php -e:\inetpub\pages\info.php -e:\inetpub\pages\test.php a=1&b=2 - -Run: stresstest L files.txt - - - -2: Run the php test scripts bundled with the source code -======================================================== - -supply the path to the parent of the "tests" directory (expect a couple -long pauses for a couple of the larger tests) - -Run: stresstest T c:\php5-source - - - -TODO: - -* Make more options configurable: number of threads, iterations, etc. -* Improve stdout output to make it more useful -* Implement support for SKIPIF -* Improve speed of CompareFile function (too slow on big files). diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp deleted file mode 100644 index c7e634c152727..0000000000000 --- a/sapi/isapi/stresstest/stresstest.cpp +++ /dev/null @@ -1,936 +0,0 @@ -/* - * ======================================================================= * - * File: stress .c * - * stress tester for isapi dll's * - * based on cgiwrap * - * ======================================================================= * - * -*/ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include -#include -#include "getopt.h" - -// These are things that go out in the Response Header -// -#define HTTP_VER "HTTP/1.0" -#define SERVER_VERSION "Http-Srv-Beta2/1.0" - -// -// Simple wrappers for the heap APIS -// -#define xmalloc(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s)) -#define xfree(s) HeapFree(GetProcessHeap(), 0, (s)) - -// -// The mandatory exports from the ISAPI DLL -// -DWORD numThreads = 1; -DWORD iterations = 1; - -HANDLE StartNow; -// quick and dirty environment -typedef CMapStringToString TEnvironment; -TEnvironment IsapiEnvironment; - -typedef struct _TResults { - LONG ok; - LONG bad; -} TResults; - -CStringArray IsapiFileList; // list of filenames -CStringArray TestNames; // --TEST-- -CStringArray IsapiGetData; // --GET-- -CStringArray IsapiPostData; // --POST-- -CStringArray IsapiMatchData; // --EXPECT-- -CArray Results; - -typedef struct _TIsapiContext { - HANDLE in; - HANDLE out; - DWORD tid; - TEnvironment env; - HANDLE waitEvent; -} TIsapiContext; - -// -// Prototypes of the functions this sample implements -// -extern "C" { -HINSTANCE hDll; -typedef BOOL (WINAPI *VersionProc)(HSE_VERSION_INFO *) ; -typedef DWORD (WINAPI *HttpExtProc)(EXTENSION_CONTROL_BLOCK *); -typedef BOOL (WINAPI *TerminateProc) (DWORD); -BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *, TIsapiContext *) ; -BOOL WINAPI GetServerVariable(HCONN, LPSTR, LPVOID, LPDWORD ); -BOOL WINAPI ReadClient(HCONN, LPVOID, LPDWORD); -BOOL WINAPI WriteClient(HCONN, LPVOID, LPDWORD, DWORD); -BOOL WINAPI ServerSupportFunction(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD); -VersionProc IsapiGetExtensionVersion; -HttpExtProc IsapiHttpExtensionProc; -TerminateProc TerminateExtensionProc; -HSE_VERSION_INFO version_info; -} - -char * MakeDateStr(VOID); -char * GetEnv(char *); - - - - -DWORD CALLBACK IsapiThread(void *); -int stress_main(const char *filename, - const char *arg, - const char *postfile, - const char *matchdata); - - - -BOOL bUseTestFiles = FALSE; -char temppath[MAX_PATH]; - -void stripcrlf(char *line) -{ - DWORD l = strlen(line)-1; - if (line[l]==10 || line[l]==13) line[l]=0; - l = strlen(line)-1; - if (line[l]==10 || line[l]==13) line[l]=0; -} - -#define COMPARE_BUF_SIZE 1024 - -BOOL CompareFiles(const char*f1, const char*f2) -{ - FILE *fp1, *fp2; - bool retval; - char buf1[COMPARE_BUF_SIZE], buf2[COMPARE_BUF_SIZE]; - int length1, length2; - - if ((fp1=fopen(f1, "r"))==NULL) { - return FALSE; - } - - if ((fp2=fopen(f2, "r"))==NULL) { - fclose(fp1); - return FALSE; - } - - retval = TRUE; // success oriented - while (true) { - length1 = fread(buf1, 1, sizeof(buf1), fp1); - length2 = fread(buf2, 1, sizeof(buf2), fp2); - - // check for end of file - if (feof(fp1)) { - if (!feof(fp2)) { - retval = FALSE; - } - break; - } else if (feof(fp2)) { - if (!feof(fp1)) { - retval = FALSE; - } - break; - } - - // compare data - if (length1!=length2 - || memcmp(buf1, buf2, length1)!=0) { - retval = FALSE; - break; - } - } - fclose(fp1); - fclose(fp2); - - return retval; -} - - -BOOL CompareStringWithFile(const char *filename, const char *str, unsigned int str_length) -{ - FILE *fp; - bool retval; - char buf[COMPARE_BUF_SIZE]; - unsigned int offset=0, readbytes; - fprintf(stderr, "test %s\n",filename); - if ((fp=fopen(filename, "rb"))==NULL) { - fprintf(stderr, "Error opening %s\n",filename); - return FALSE; - } - - retval = TRUE; // success oriented - while (true) { - readbytes = fread(buf, 1, sizeof(buf), fp); - - // check for end of file - - if (offset+readbytes > str_length - || memcmp(buf, str+offset, readbytes)!=NULL) { - fprintf(stderr, "File missmatch %s\n",filename); - retval = FALSE; - break; - } - if (feof(fp)) { - if (!retval) fprintf(stderr, "File zero length %s\n",filename); - break; - } - } - fclose(fp); - - return retval; -} - - -BOOL ReadGlobalEnvironment(const char *environment) -{ - if (environment) { - FILE *fp = fopen(environment, "r"); - DWORD i=0; - if (fp) { - char line[2048]; - while (fgets(line, sizeof(line)-1, fp)) { - // file.php arg1 arg2 etc. - char *p = strchr(line, '='); - if (p) { - *p=0; - IsapiEnvironment[line]=p+1; - } - } - fclose(fp); - return IsapiEnvironment.GetCount() > 0; - } - } - return FALSE; -} - -BOOL ReadFileList(const char *filelist) -{ - FILE *fp = fopen(filelist, "r"); - if (!fp) { - printf("Unable to open %s\r\n", filelist); - } - char line[2048]; - int i=0; - while (fgets(line, sizeof(line)-1, fp)) { - // file.php arg1 arg2 etc. - stripcrlf(line); - if (strlen(line)>3) { - char *p = strchr(line, ' '); - if (p) { - *p = 0; - // get file - - IsapiFileList.Add(line); - IsapiGetData.Add(p+1); - } else { - // just a filename is all - IsapiFileList.Add(line); - IsapiGetData.Add(""); - } - } - - // future use - IsapiPostData.Add(""); - IsapiMatchData.Add(""); - TestNames.Add(""); - - i++; - } - Results.SetSize(TestNames.GetSize()); - - fclose(fp); - return IsapiFileList.GetSize() > 0; -} - -void DoThreads() { - - if (IsapiFileList.GetSize() == 0) { - printf("No Files to test\n"); - return; - } - - printf("Starting Threads...\n"); - // loop creating threads - DWORD tid; - HANDLE *threads = new HANDLE[numThreads]; - DWORD i; - for (i=0; i< numThreads; i++) { - threads[i]=CreateThread(NULL, 0, IsapiThread, NULL, CREATE_SUSPENDED, &tid); - } - for (i=0; i< numThreads; i++) { - if (threads[i]) ResumeThread(threads[i]); - } - // wait for threads to finish - WaitForMultipleObjects(numThreads, threads, TRUE, INFINITE); - for (i=0; i< numThreads; i++) { - CloseHandle(threads[i]); - } - delete threads; -} - -void DoFileList(const char *filelist, const char *environment) -{ - // read config files - - if (!ReadFileList(filelist)) { - printf("No Files to test!\r\n"); - return; - } - - ReadGlobalEnvironment(environment); - - DoThreads(); -} - - -/** - * ParseTestFile - * parse a single phpt file and add it to the arrays - */ -BOOL ParseTestFile(const char *path, const char *fn) -{ - // parse the test file - char filename[MAX_PATH]; - _snprintf(filename, sizeof(filename)-1, "%s\\%s", path, fn); - char line[1024]; - memset(line, 0, sizeof(line)); - CString cTest, cSkipIf, cPost, cGet, cFile, cExpect; - printf("Reading %s\r\n", filename); - - enum state {none, test, skipif, post, get, file, expect} parsestate = none; - - FILE *fp = fopen(filename, "rb"); - char *tn = _tempnam(temppath,"pht."); - char *en = _tempnam(temppath,"exp."); - FILE *ft = fopen(tn, "wb+"); - FILE *fe = fopen(en, "wb+"); - if (fp && ft && fe) { - while (fgets(line, sizeof(line)-1, fp)) { - if (line[0]=='-') { - if (_strnicmp(line, "--TEST--", 8)==0) { - parsestate = test; - continue; - } else if (_strnicmp(line, "--SKIPIF--", 10)==0) { - parsestate = skipif; - continue; - } else if (_strnicmp(line, "--POST--", 8)==0) { - parsestate = post; - continue; - } else if (_strnicmp(line, "--GET--", 7)==0) { - parsestate = get; - continue; - } else if (_strnicmp(line, "--FILE--", 8)==0) { - parsestate = file; - continue; - } else if (_strnicmp(line, "--EXPECT--", 10)==0) { - parsestate = expect; - continue; - } - } - switch (parsestate) { - case test: - stripcrlf(line); - cTest = line; - break; - case skipif: - cSkipIf += line; - break; - case post: - cPost += line; - break; - case get: - cGet += line; - break; - case file: - fputs(line, ft); - break; - case expect: - fputs(line, fe); - break; - } - } - - fclose(fp); - fclose(ft); - fclose(fe); - - if (!cTest.IsEmpty()) { - IsapiFileList.Add(tn); - TestNames.Add(cTest); - IsapiGetData.Add(cGet); - IsapiPostData.Add(cPost); - IsapiMatchData.Add(en); - free(tn); - free(en); - return TRUE; - } - } - free(tn); - free(en); - return FALSE; -} - - -/** - * GetTestFiles - * Recurse through the path and subdirectories, parse each phpt file - */ -BOOL GetTestFiles(const char *path) -{ - // find all files .phpt under testpath\tests - char FindPath[MAX_PATH]; - WIN32_FIND_DATA fd; - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*", path); - HANDLE fh = FindFirstFile(FindPath, &fd); - if (fh != INVALID_HANDLE_VALUE) { - do { - if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - !strchr(fd.cFileName, '.')) { - // subdirectory, recurse into it - char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", path, fd.cFileName); - GetTestFiles(NewFindPath); - } else if (strstr(fd.cFileName, ".phpt")) { - // got test file, parse it now - if (ParseTestFile(path, fd.cFileName)) { - printf("Test File Added: %s\\%s\r\n", path, fd.cFileName); - } - } - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - } while (FindNextFile(fh, &fd) != 0); - FindClose(fh); - } - return IsapiFileList.GetSize() > 0; -} - -void DeleteTempFiles(const char *mask) -{ - char FindPath[MAX_PATH]; - WIN32_FIND_DATA fd; - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s", temppath, mask); - HANDLE fh = FindFirstFile(FindPath, &fd); - if (fh != INVALID_HANDLE_VALUE) { - do { - char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", temppath, fd.cFileName); - DeleteFile(NewFindPath); - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - } while (FindNextFile(fh, &fd) != 0); - FindClose(fh); - } -} - -void DoTestFiles(const char *filelist, const char *environment) -{ - if (!GetTestFiles(filelist)) { - printf("No Files to test!\r\n"); - return; - } - - Results.SetSize(IsapiFileList.GetSize()); - - ReadGlobalEnvironment(environment); - - DoThreads(); - - printf("\r\nRESULTS:\r\n"); - // show results: - DWORD r = Results.GetSize(); - for (DWORD i=0; i< r; i++) { - TResults result = Results.GetAt(i); - printf("%s\r\nOK: %d FAILED: %d\r\n", TestNames.GetAt(i), result.ok, result.bad); - } - - // delete temp files - printf("Deleting Temp Files\r\n"); - DeleteTempFiles("exp.*"); - DeleteTempFiles("pht.*"); - printf("Done\r\n"); -} - -#define OPTSTRING "m:f:d:h:t:i:" -static void _usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "stresstest"; - } - - printf("Usage: %s -m -d|-l [-t ] [-i ]\n" - " -m path to isapi dll\n" - " -d php directory (to run php test files).\n" - " -f file containing list of files to run\n" - " -t number of threads to use (default=1)\n" - " -i number of iterations per thread (default=1)\n" - " -h This help\n", prog); -} -int main(int argc, char* argv[]) -{ - LPVOID lpMsgBuf; - char *filelist=NULL, *environment=NULL, *module=NULL; - int c = NULL; - while ((c=ap_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case 'd': - bUseTestFiles = TRUE; - filelist = strdup(ap_optarg); - break; - case 'f': - bUseTestFiles = FALSE; - filelist = strdup(ap_optarg); - break; - case 'e': - environment = strdup(ap_optarg); - break; - case 't': - numThreads = atoi(ap_optarg); - break; - case 'i': - iterations = atoi(ap_optarg); - break; - case 'm': - module = strdup(ap_optarg); - break; - case 'h': - _usage(argv[0]); - exit(0); - break; - } - } - if (!module || !filelist) { - _usage(argv[0]); - exit(0); - } - - GetTempPath(sizeof(temppath), temppath); - hDll = LoadLibrary(module); // Load our DLL - - if (!hDll) { - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - fprintf(stderr,"Error: Dll 'php5isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf); - free (module); - free(filelist); - LocalFree( lpMsgBuf ); - return -1; - } - - // - // Find the exported functions - - IsapiGetExtensionVersion = (VersionProc)GetProcAddress(hDll,"GetExtensionVersion"); - if (!IsapiGetExtensionVersion) { - fprintf(stderr,"Can't Get Extension Version %d\n", GetLastError()); - free (module); - free(filelist); - return -1; - } - IsapiHttpExtensionProc = (HttpExtProc)GetProcAddress(hDll,"HttpExtensionProc"); - if (!IsapiHttpExtensionProc) { - fprintf(stderr,"Can't Get Extension proc %d\n", GetLastError()); - free (module); - free(filelist); - return -1; - } - TerminateExtensionProc = (TerminateProc) GetProcAddress(hDll, - "TerminateExtension"); - - // This should really check if the version information matches what we - // expect. - // - if (!IsapiGetExtensionVersion(&version_info) ) { - fprintf(stderr,"Fatal: GetExtensionVersion failed\n"); - free (module); - free(filelist); - return -1; - } - - if (bUseTestFiles) { - char TestPath[MAX_PATH]; - if (filelist != NULL) - _snprintf(TestPath, sizeof(TestPath)-1, "%s\\tests", filelist); - else strcpy(TestPath, "tests"); - DoTestFiles(TestPath, environment); - } else { - DoFileList(filelist, environment); - } - - // cleanup - if (TerminateExtensionProc) TerminateExtensionProc(0); - - // We should really free memory (e.g., from GetEnv), but we'll be dead - // soon enough - - FreeLibrary(hDll); - free (module); - free(filelist); - return 0; -} - - -DWORD CALLBACK IsapiThread(void *p) -{ - DWORD filecount = IsapiFileList.GetSize(); - - for (DWORD j=0; jenv.Lookup(lpszVariableName, value)) { - rc = value.GetLength(); - strncpy((char *)lpBuffer, value, *lpdwSize-1); - } else - rc = GetEnvironmentVariable(lpszVariableName, (char *)lpBuffer, *lpdwSize) ; - - if (!rc) { // return of 0 indicates the variable was not found - SetLastError(ERROR_NO_DATA); - return FALSE; - } - - if (rc > *lpdwSize) { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - *lpdwSize =rc + 1 ; // GetEnvironmentVariable does not count the NULL - - return TRUE; - -} -// -// Again, we don't have an HCONN, so we simply wrap ReadClient() to -// ReadFile on stdin. The semantics of the two functions are the same -// -BOOL WINAPI ReadClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize) { - TIsapiContext *c = (TIsapiContext *)hConn; - if (!c) return FALSE; - - if (c->in != INVALID_HANDLE_VALUE) - return ReadFile(c->in, lpBuffer, (*lpdwSize), lpdwSize, NULL); - - return FALSE; -} -// -// ditto for WriteClient() -// -BOOL WINAPI WriteClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize, - DWORD dwReserved) { - TIsapiContext *c = (TIsapiContext *)hConn; - if (!c) return FALSE; - - if (c->out != INVALID_HANDLE_VALUE) - return WriteFile(c->out, lpBuffer, *lpdwSize, lpdwSize, NULL); - return FALSE; -} -// -// This is a special callback function used by the DLL for certain extra -// functionality. Look at the API help for details. -// -BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, - LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType){ - - TIsapiContext *c = (TIsapiContext *)hConn; - char *lpszRespBuf; - char * temp = NULL; - DWORD dwBytes; - BOOL bRet = TRUE; - - switch(dwHSERequest) { - case (HSE_REQ_SEND_RESPONSE_HEADER) : - lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accomodate our header - if (!lpszRespBuf) - return FALSE; - wsprintf(lpszRespBuf,"%s", - //HTTP_VER, - - /* Default response is 200 Ok */ - - //lpvBuffer?lpvBuffer:"200 Ok", - - /* Create a string for the time. */ - //temp=MakeDateStr(), - - //SERVER_VERSION, - - /* If this exists, it is a pointer to a data buffer to - be sent. */ - lpdwDataType?(char *)lpdwDataType:NULL); - - if (temp) xfree(temp); - - dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); - xfree(lpszRespBuf); - - break; - // - // A real server would do cleanup here - case (HSE_REQ_DONE_WITH_SESSION): - SetEvent(c->waitEvent); - //ExitThread(0); - break; - - // - // This sends a redirect (temporary) to the client. - // The header construction is similar to RESPONSE_HEADER above. - // - case (HSE_REQ_SEND_URL_REDIRECT_RESP): - lpszRespBuf = (char *)xmalloc(*lpdwSize +80) ; - if (!lpszRespBuf) - return FALSE; - wsprintf(lpszRespBuf,"%s %s %s\r\n", - HTTP_VER, - "302 Moved Temporarily", - (lpdwSize > 0)?lpvBuffer:0); - xfree(temp); - dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); - xfree(lpszRespBuf); - break; - default: - return FALSE; - break; - } - return bRet; - -} -// -// Makes a string of the date and time from GetSystemTime(). -// This is in UTC, as required by the HTTP spec.` -// -char * MakeDateStr(void){ - SYSTEMTIME systime; - char *szDate= (char *)xmalloc(64); - - char * DaysofWeek[] = {"Sun","Mon","Tue","Wed","Thurs","Fri","Sat"}; - char * Months[] = {"NULL","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug", - "Sep","Oct","Nov","Dec"}; - - GetSystemTime(&systime); - - wsprintf(szDate,"%s, %d %s %d %d:%d.%d", DaysofWeek[systime.wDayOfWeek], - systime.wDay, - Months[systime.wMonth], - systime.wYear, - systime.wHour, systime.wMinute, - systime.wSecond ); - - return szDate; -} -// -// Fill the ECB up -// -BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *ECB, TIsapiContext *context) { - - char * temp; - ECB->cbSize = sizeof(EXTENSION_CONTROL_BLOCK); - ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR); - ECB->ConnID = (void *)context; - // - // Pointers to the functions the DLL will call. - // - ECB->GetServerVariable = GetServerVariable; - ECB->ReadClient = ReadClient; - ECB->WriteClient = WriteClient; - ECB->ServerSupportFunction = ServerSupportFunction; - - // - // Fill in the standard CGI environment variables - // - ECB->lpszMethod = GetEnv("REQUEST_METHOD"); - if (!ECB->lpszMethod) ECB->lpszMethod = "GET"; - - ECB->lpszQueryString = GetEnv("QUERY_STRING"); - ECB->lpszPathInfo = GetEnv("PATH_INFO"); - ECB->lpszPathTranslated = GetEnv("PATH_TRANSLATED"); - ECB->cbTotalBytes=( (temp=GetEnv("CONTENT_LENGTH")) ? (atoi(temp)): 0); - ECB->cbAvailable = 0; - ECB->lpbData = (unsigned char *)""; - ECB->lpszContentType = GetEnv("CONTENT_TYPE"); - return TRUE; - -} - -// -// Works like _getenv(), but uses win32 functions instead. -// -char *GetEnv(LPSTR lpszEnvVar) -{ - - char *var, dummy; - DWORD dwLen; - - if (!lpszEnvVar) - return ""; - - dwLen =GetEnvironmentVariable(lpszEnvVar, &dummy, 1); - - if (dwLen == 0) - return ""; - - var = (char *)xmalloc(dwLen); - if (!var) - return ""; - (void)GetEnvironmentVariable(lpszEnvVar, var, dwLen); - - return var; -} diff --git a/sapi/isapi/stresstest/stresstest.dsp b/sapi/isapi/stresstest/stresstest.dsp deleted file mode 100644 index fb82303e3d92b..0000000000000 --- a/sapi/isapi/stresstest/stresstest.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stresstest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=stresstest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "stresstest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "stresstest.mak" CFG="stresstest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "stresstest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "stresstest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "stresstest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "stresstest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "stresstest - Win32 Release" -# Name "stresstest - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\getopt.h -# End Source File -# Begin Source File - -SOURCE=.\stresstest.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=.\notes.txt -# End Source File -# End Target -# End Project diff --git a/sapi/milter/CREDITS b/sapi/milter/CREDITS deleted file mode 100644 index cd00d6774b2f5..0000000000000 --- a/sapi/milter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sendmail Milter -Harald Radi diff --git a/sapi/milter/EXPERIMENTAL b/sapi/milter/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/milter/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/milter/Makefile.frag b/sapi/milter/Makefile.frag deleted file mode 100644 index 8dbdf7a8fd089..0000000000000 --- a/sapi/milter/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(SAPI_MILTER_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(BUILD_MILTER) diff --git a/sapi/milter/TODO b/sapi/milter/TODO deleted file mode 100644 index 4a427ea131a71..0000000000000 --- a/sapi/milter/TODO +++ /dev/null @@ -1,5 +0,0 @@ -threaded version still leaks mem, don't know why -extensions aren't loaded -stdout to syslog -testing -documentation \ No newline at end of file diff --git a/sapi/milter/config.m4 b/sapi/milter/config.m4 deleted file mode 100644 index 37269d0b58fac..0000000000000 --- a/sapi/milter/config.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for Milter support) -AC_ARG_WITH(milter, -[ --with-milter[=DIR] Build PHP as Milter application],[ - if test "$withval" = "yes"; then - if test -f /usr/lib/libmilter.a ; then - MILTERPATH=/usr/lib - else - if test -f /usr/lib/libmilter/libmilter.a ; then - MILTERPATH=/usr/lib/libmilter - else - AC_MSG_ERROR(Unable to find libmilter.a) - fi - fi - else - MILTERPATH=$withval - fi - - SAPI_MILTER_PATH=sapi/milter/php-milter - PHP_SUBST(SAPI_MILTER_PATH) - PHP_BUILD_THREAD_SAFE - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) - - PHP_SELECT_SAPI(milter, program, php_milter.c getopt.c,,'$(SAPI_MILTER_PATH)') - PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH,) - - BUILD_MILTER="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH)" - - INSTALL_IT="\$(INSTALL) -m 0755 \$(SAPI_MILTER_PATH) \$(bindir)/php-milter" - RESULT=yes - - PHP_SUBST(BUILD_MILTER) -],[ - RESULT=no -]) -AC_MSG_RESULT($RESULT) diff --git a/sapi/milter/getopt.c b/sapi/milter/getopt.c deleted file mode 100644 index f5874d577e7fe..0000000000000 --- a/sapi/milter/getopt.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Borrowed from Apache NT Port */ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -char *ap_php_optarg; -int ap_php_optind = 1; -static int ap_php_opterr = 1; - -static int -ap_php_optiserr(int argc, char * const *argv, int oint, const char *optstr, - int optchr, int err) -{ - if (ap_php_opterr) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} - -int ap_php_getopt(int argc, char* const *argv, const char *optstr) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - - char *cp; - - if (ap_php_optind >= argc) - return(EOF); - if (!dash && (argv[ap_php_optind][0] != '-')) - return(EOF); - if (!dash && (argv[ap_php_optind][0] == '-') && !argv[ap_php_optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - if ((argv[ap_php_optind][0] == '-') && (argv[ap_php_optind][1] == '-')) - { - /* -- indicates end of args */ - ap_php_optind++; - return(EOF); - } - if (!dash) - { - assert((argv[ap_php_optind][0] == '-') && argv[ap_php_optind][1]); - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - assert(dash); - if (argv[ap_php_optind][optchr] == ':') - { - dash = 0; - ap_php_optind++; - return(ap_php_optiserr(argc, argv, ap_php_optind-1, optstr, optchr, OPTERRCOLON)); - } - if (!(cp = strchr(optstr, argv[ap_php_optind][optchr]))) - { - int errind = ap_php_optind; - int errchr = optchr; - - if (!argv[ap_php_optind][optchr+1]) - { - dash = 0; - ap_php_optind++; - } - else - optchr++; - return(ap_php_optiserr(argc, argv, errind, optstr, errchr, OPTERRNF)); - } - if (cp[1] == ':') - { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[ap_php_optind][2]) { - ap_php_optind++; - if (ap_php_optind == argc) - return(ap_php_optiserr(argc, argv, ap_php_optind-1, optstr, optchr, OPTERRARG)); - ap_php_optarg = argv[ap_php_optind++]; - } - else - { - ap_php_optarg = &argv[ap_php_optind][2]; - ap_php_optind++; - } - return(*cp); - } - else - { - if (!argv[ap_php_optind][optchr+1]) - { - dash = 0; - ap_php_optind++; - } - else - optchr++; - return(*cp); - } - assert(0); - return(0); /* never reached */ -} - -#ifdef TESTGETOPT -int - main (int argc, char **argv) - { - int c; - extern char *ap_php_optarg; - extern int ap_php_optind; - int aflg = 0; - int bflg = 0; - int errflg = 0; - char *ofile = NULL; - - while ((c = ap_php_getopt(argc, argv, "abo:")) != EOF) - switch (c) { - case 'a': - if (bflg) - errflg++; - else - aflg++; - break; - case 'b': - if (aflg) - errflg++; - else - bflg++; - break; - case 'o': - ofile = ap_php_optarg; - (void)printf("ofile = %s\n", ofile); - break; - case '?': - errflg++; - } - if (errflg) { - (void)fprintf(stderr, - "usage: cmd [-a|-b] [-o ] files...\n"); - exit (2); - } - for ( ; ap_php_optind < argc; ap_php_optind++) - (void)printf("%s\n", argv[ap_php_optind]); - return 0; - } - -#endif /* TESTGETOPT */ diff --git a/sapi/milter/milter.php b/sapi/milter/milter.php deleted file mode 100644 index 0878f2a4d9558..0000000000000 --- a/sapi/milter/milter.php +++ /dev/null @@ -1,132 +0,0 @@ - $arg) { - milter_log("\targs[$ix] = $arg"); - } -} - -/** - * is called once per recipient, hence one or more times per message, - * immediately after milter_envfrom - */ -function milter_envrcpt($args) -{ - milter_log("milter_envrcpt(args[])"); - foreach ($args as $ix => $arg) { - milter_log("\targs[$ix] = $arg"); - } -} - -/** - * is called zero or more times between milter_envrcpt and milter_eoh, - * once per message header - */ -function milter_header($header, $value) -{ - milter_log("milter_header('$header', '$value')"); -} - -/** - * is called once after all headers have been sent and processed. - */ -function milter_eoh() -{ - milter_log("milter_eoh()"); -} - -/** - * is called zero or more times between milter_eoh and milter_eom. - */ -function milter_body($bodypart) -{ - milter_log("milter_body('$bodypart')"); -} - -/** - * is called once after all calls to milter_body for a given message. - * most of the api functions, that alter the message can only be called - * within this callback. - */ -function milter_eom() -{ - milter_log("milter_eom()"); - /* add PHP header to the message */ - smfi_addheader("X-PHP", phpversion()); -} - -/** - * may be called at any time during message processing - * (i.e. between some message-oriented routine and milter_eom). - */ -function milter_abort() -{ - milter_log("milter_abort()"); -} - -/** - * is always called once at the end of each connection. - */ -function milter_close() -{ - milter_log("milter_close()"); -} -?> diff --git a/sapi/milter/php_getopt.h b/sapi/milter/php_getopt.h deleted file mode 100644 index 40da432b596da..0000000000000 --- a/sapi/milter/php_getopt.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Borrowed from Apache NT Port */ -#include "php.h" - -extern char *ap_php_optarg; -extern int ap_php_optind; - -int ap_php_getopt(int argc, char* const *argv, const char *optstr); diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c deleted file mode 100644 index a0fad53d8f640..0000000000000 --- a/sapi/milter/php_milter.c +++ /dev/null @@ -1,1140 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Harald Radi | - | Parts based on CGI SAPI Module by | - | Rasmus Lerdorf, Stig Bakken and Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_modules.h" - -#ifndef ZTS -#error SRM sapi module is only useable in thread-safe mode -#endif - -#include "SAPI.h" - -#include -#include "php.h" -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" - -#ifdef __riscos__ -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -#include "libmilter/mfapi.h" - -#define OPTSTRING "ac:d:Def:hnp:vVz:?" -#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) - -#define IS_NONE "%s(): This function must not be called outside of a milter callback function's scope" -#define NOT_EOM "%s(): This function can only be used inside the milter_eom callback's scope" -#define NOT_INIT "%s(): This function can only be used inside the milter_init callback's scope" - -#define MLFI_NONE 0 -#define MLFI_CONNECT 1 -#define MLFI_HELO 2 -#define MLFI_ENVFROM 3 -#define MLFI_ENVRCPT 4 -#define MLFI_HEADER 5 -#define MLFI_EOH 6 -#define MLFI_BODY 7 -#define MLFI_EOM 8 -#define MLFI_ABORT 9 -#define MLFI_CLOSE 10 -#define MLFI_INIT 11 - -/* {{{ globals - */ -extern char *ap_php_optarg; -extern int ap_php_optind; - -static int flag_debug=0; -static char *filename; - -/* per thread */ -ZEND_BEGIN_MODULE_GLOBALS(milter) - SMFICTX *ctx; - int state; - int initialized; -ZEND_END_MODULE_GLOBALS(milter) - -ZEND_DECLARE_MODULE_GLOBALS(milter) -/* }}} */ - -/* this method is called only once when the milter starts */ -/* {{{ Init Milter -*/ -static int mlfi_init() -{ - int ret = 0; - zend_file_handle file_handle; - zval function_name, retval; - TSRMLS_FETCH(); - - /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_request_shutdown((void *) 0); - - return -1; - } - - /* disable headers */ - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - - /* call userland */ - INIT_ZVAL(function_name); - - ZVAL_STRING(&function_name, "milter_init", 0); - - /* set the milter context for possible use in API functions */ - MG(state) = MLFI_INIT; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - MG(initialized) = 1; - - if (Z_TYPE(retval) == IS_LONG) { - ret = Z_LVAL(retval); - } - - php_request_shutdown((void *) 0); - - return ret; -} -/* }}} */ - -/* {{{ Milter callback functions - */ - -/* connection info filter, is called whenever sendmail connects to the milter */ -/* {{{ mlfi_connect() -*/ -static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) -{ - zend_file_handle file_handle; - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); - - /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_request_shutdown((void *) 0); - - return SMFIS_TEMPFAIL; - } - - /* disable headers */ - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_connect", 0); - ZVAL_STRING(param[0], hostname, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_CONNECT; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* SMTP HELO command filter */ -/* {{{ mlfi_helo() -*/ -static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) -{ - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_helo", 0); - ZVAL_STRING(param[0], helohost, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_HELO; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - FREE_ZVAL(param[0]); - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* envelope sender filter */ -/* {{{ mlfi_envform() -*/ -static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) -{ - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_envfrom", 0); - array_init(param[0]); - - while (*argv) { - add_next_index_string(param[0], *argv, 1); - argv++; - } - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ENVFROM; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - FREE_ZVAL(param[0]); - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* envelope recipient filter */ -/* {{{ mlfi_envrcpt() -*/ -static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) -{ - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_envrcpt", 0); - array_init(param[0]); - - while (*argv) { - add_next_index_string(param[0], *argv, 1); - argv++; - } - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ENVRCPT; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - FREE_ZVAL(param[0]); - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* header filter */ -/* {{{ mlfi_header() -*/ -static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv) -{ - zval function_name, retval, *param[2]; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - ALLOC_ZVAL(param[1]); - INIT_PZVAL(param[0]); - INIT_PZVAL(param[1]); - - ZVAL_STRING(&function_name, "milter_header", 0); - ZVAL_STRING(param[0], headerf, 1); - ZVAL_STRING(param[1], headerv, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_HEADER; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - FREE_ZVAL(param[0]); - FREE_ZVAL(param[1]); - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* end of header */ -/* {{{ mlfi_eoh() -*/ -static sfsistat mlfi_eoh(SMFICTX *ctx) -{ - zval function_name, retval; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_eoh", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_EOH; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* body block */ -/* {{{ mlfi_body() -*/ -static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) -{ - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_body", 0); - ZVAL_STRINGL(param[0], bodyp, len, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_BODY; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - FREE_ZVAL(param[0]); - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* end of message */ -/* {{{ mlfi_eom() -*/ -static sfsistat mlfi_eom(SMFICTX *ctx) -{ - zval function_name, retval; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_eom", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_EOM; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* message aborted */ -/* {{{ mlfi_abort() -*/ -static sfsistat mlfi_abort(SMFICTX *ctx) -{ - zval function_name, retval; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_abort", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ABORT; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* connection cleanup */ -/* {{{ mlfi_close() -*/ -static sfsistat mlfi_close(SMFICTX *ctx) -{ - int ret = SMFIS_CONTINUE; - zval function_name, retval; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_close", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_CLOSE; - - call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (Z_TYPE(retval) == IS_LONG) { - ret = Z_LVAL(retval); - } - - php_request_shutdown((void *) 0); - - return ret; -} -/* }}} */ -/* }}} */ - -/* {{{ Milter entry struct - */ -struct smfiDesc smfilter = { - "php-milter", /* filter name */ - SMFI_VERSION, /* version code -- leave untouched */ - 0, /* flags */ - mlfi_connect, /* info filter callback */ - mlfi_helo, /* HELO filter callback */ - mlfi_envfrom, /* envelope filter callback */ - mlfi_envrcpt, /* envelope recipient filter callback */ - mlfi_header, /* header filter callback */ - mlfi_eoh, /* end of header callback */ - mlfi_body, /* body filter callback */ - mlfi_eom, /* end of message callback */ - mlfi_abort, /* message aborted callback */ - mlfi_close, /* connection cleanup callback */ -}; -/* }}} */ - -/* {{{ PHP Milter API - */ - -/* {{{ proto string smfi_setflags(long flags) - Sets the flags describing the actions the filter may take. */ -PHP_FUNCTION(smfi_setflags) -{ - long flags; - - /* valid only in the init callback */ - if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &flags) == SUCCESS) { - flags = flags & SMFIF_ADDHDRS|SMFIF_CHGHDRS|SMFIF_CHGBODY|SMFIF_ADDRCPT|SMFIF_DELRCPT; - smfilter.xxfi_flags = flags; - } -} -/* }}} */ - -/* {{{ proto string smfi_settimeout(long timeout) - Sets the number of seconds libmilter will wait for an MTA connection before timing out a socket. */ -PHP_FUNCTION(smfi_settimeout) -{ - long timeout; - - /* valid only in the init callback */ - if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &timeout) == SUCCESS) { - smfi_settimeout(timeout); - } -} -/* }}} */ - -/* {{{ proto string smfi_getsymval(string macro) - Returns the value of the given macro or NULL if the macro is not defined. */ -PHP_FUNCTION(smfi_getsymval) -{ - char *symname, *ret; - int len; - - /* valid in any callback */ - if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &symname, &len) == SUCCESS) { - if ((ret = smfi_getsymval(MG(ctx), symname)) != NULL) { - RETVAL_STRING(ret, 1); - } - } - - RETVAL_NULL(); -} -/* }}} */ - -/* {{{ proto string smfi_setreply(string rcode, string xcode, string message) - Directly set the SMTP error reply code for this connection. - This code will be used on subsequent error replies resulting from actions taken by this filter. */ -PHP_FUNCTION(smfi_setreply) -{ - char *rcode, *xcode, *message; - int len; - - /* valid in any callback */ - if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) { - if (smfi_setreply(MG(ctx), rcode, xcode, message) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ proto string smfi_addheader(string headerf, string headerv) - Adds a header to the current message. */ -PHP_FUNCTION(smfi_addheader) -{ - char *f, *v; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(2 TSRMLS_CC, "ss", &f, &len, &v, &len) == SUCCESS) { - if (smfi_addheader(MG(ctx), f, v) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ proto string smfi_chgheader(string headerf, string headerv) - Changes a header's value for the current message. */ -PHP_FUNCTION(smfi_chgheader) -{ - char *f, *v; - long idx; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sls", &f, &len, &idx, &v, &len) == SUCCESS) { - if (smfi_chgheader(MG(ctx), f, idx, v) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ proto string smfi_addrcpt(string rcpt) - Add a recipient to the message envelope. */ -PHP_FUNCTION(smfi_addrcpt) -{ - char *rcpt; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { - if (smfi_addrcpt(MG(ctx), rcpt) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ proto string smfi_delrcpt(string rcpt) - Removes the named recipient from the current message's envelope. */ -PHP_FUNCTION(smfi_delrcpt) -{ - char *rcpt; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { - if (smfi_delrcpt(MG(ctx), rcpt) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ proto string smfi_replacebody(string body) - Replaces the body of the current message. If called more than once, - subsequent calls result in data being appended to the new body. */ -PHP_FUNCTION(smfi_replacebody) -{ - char *body; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &body, &len) == SUCCESS) { - if (smfi_replacebody(MG(ctx), body, len) == MI_SUCCESS) { - RETVAL_TRUE; - } - } - - RETVAL_FALSE; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(milter) -{ - REGISTER_LONG_CONSTANT("SMFIS_CONTINUE", SMFIS_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_REJECT", SMFIS_REJECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_DISCARD", SMFIS_DISCARD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_ACCEPT", SMFIS_ACCEPT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_TEMPFAIL", SMFIS_TEMPFAIL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SMFIF_ADDHDRS", SMFIF_ADDHDRS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_CHGHDRS", SMFIF_CHGHDRS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_CHGBODY", SMFIF_CHGBODY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_ADDRCPT", SMFIF_ADDRCPT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_DELRCPT", SMFIF_DELRCPT, CONST_CS | CONST_PERSISTENT); - - ZEND_INIT_MODULE_GLOBALS(milter, NULL, NULL); - - MG(state) = MLFI_NONE; - MG(initialized) = 0; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(milter) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Milter support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ -/* }}} */ - -/* {{{ milter_functions[] -*/ -static function_entry milter_functions[] = { - PHP_FE(smfi_setflags, NULL) - PHP_FE(smfi_settimeout, NULL) - PHP_FE(smfi_getsymval, NULL) - PHP_FE(smfi_setreply, NULL) - PHP_FE(smfi_addheader, NULL) - PHP_FE(smfi_chgheader, NULL) - PHP_FE(smfi_addrcpt, NULL) - PHP_FE(smfi_delrcpt, NULL) - PHP_FE(smfi_replacebody, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ Zend module entry -*/ -static zend_module_entry php_milter_module = { - STANDARD_MODULE_HEADER, - "Milter", - milter_functions, - PHP_MINIT(milter), - NULL, - NULL, - NULL, - PHP_MINFO(milter), - "0.1.0", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ Milter SAPI -*/ -static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - return str_length; -} - -static void sapi_milter_flush(void *server_context) -{ -} - -static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC); -} - -static int sapi_milter_post_read(char *buf, uint count_bytes TSRMLS_DC) -{ - return 0; -} - -static char* sapi_milter_read_cookies(TSRMLS_D) -{ - return NULL; -} - -static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int php_milter_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_milter_module, 1) == FAILURE) { - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_module_struct milter_sapi_module -*/ -static sapi_module_struct milter_sapi_module = { - "milter", /* name */ - "Sendmail Milter SAPI", /* pretty name */ - - php_milter_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_milter_ub_write, /* unbuffered write */ - sapi_milter_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - sapi_milter_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_milter_post_read, /* read POST data */ - sapi_milter_read_cookies, /* read Cookies */ - - sapi_milter_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/**** -* ripped from cli, has to be cleaned up ! -*/ - -/* {{{ php_milter_usage -*/ -static void php_milter_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php-milter"; - } - - printf( "Usage: %s [options] [-f] [args...]\n" - " %s [options] -r [args...]\n" - " %s [options] [-- args...]\n" - " -a Run interactively\n" - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -D run as daemon\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse .\n" - " -h This help\n" - " -p path to create socket\n" - " -v Version number\n" - " -V set debug level to n (1 or 2).\n" - " -z Load Zend extension .\n" - " args... Arguments passed to script. Use -- args when first argument \n" - " starts with - or script is read from stdin\n" - , prog, prog, prog); -} -/* }}} */ - -static void define_command_line_ini_entry(char *arg) -{ - char *name, *value; - - name = arg; - value = strchr(arg, '='); - if (value) { - *value = 0; - value++; - } else { - value = "1"; - } - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -} - -/* {{{ main -*/ -int main(int argc, char *argv[]) -{ - char *sock = NULL; - int dofork = 0; - - int exit_status = SUCCESS; - int c; -/* temporary locals */ - int orig_optind=ap_php_optind; - char *orig_optarg=ap_php_optarg; - char *arg_free=NULL, **arg_excp=&arg_free; - int interactive=0; - char *exec_direct=NULL; - char *param_error=NULL; -/* end of temporary locals */ - - void ***tsrm_ls; - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - - - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&milter_sapi_module); - - while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case 'c': - milter_sapi_module.php_ini_path_override = strdup(ap_php_optarg); - break; - case 'n': - milter_sapi_module.php_ini_ignore = 1; - break; - } - } - ap_php_optind = orig_optind; - ap_php_optarg = orig_optarg; - - milter_sapi_module.executable_location = argv[0]; - - tsrm_ls = ts_resource(0); - - sapi_module.startup(&milter_sapi_module); - - zend_first_try { - while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case '?': - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_milter_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - } - } - ap_php_optind = orig_optind; - ap_php_optarg = orig_optarg; - - /* Set some CLI defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - zend_alter_ini_entry("html_errors", 12, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - zend_alter_ini_entry("max_execution_time", 19, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - - zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ - - if (milter_sapi_module.php_ini_path_override && milter_sapi_module.php_ini_ignore) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - PUTS("You cannot use both -n and -c switch. Use -h for help.\n"); - exit(1); - } - - while ((c = ap_php_getopt(argc, argv, OPTSTRING)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - printf("Interactive mode enabled\n\n"); - interactive=1; - break; - - case 'C': /* don't chdir to the script directory */ - /* This is default so NOP */ - break; - case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(ap_php_optarg); - break; - - case 'D': /* daemon */ - dofork = 1; - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'f': /* parse file */ - filename = ap_php_optarg; - break; - - case 'h': /* help & quit */ - case '?': - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_milter_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - - case 'p': /* socket */ - sock = strdup(ap_php_optarg); - break; - - case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - zend_ini_deactivate(TSRMLS_C); - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - tsrm_shutdown(); - - exit(1); - } - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - - case 'V': /* verbose */ - flag_debug = atoi(ap_php_optarg); - break; - - case 'z': /* load extension file */ - zend_load_extension(ap_php_optarg); - break; - - default: - break; - } - } - - if (param_error) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - PUTS(param_error); - exit(1); - } - - CG(interactive) = interactive; - - /* only set script_file if not set already and not in direct mode and not at end of parameter list */ - if (argc > ap_php_optind && !filename) { - filename=argv[ap_php_optind]; - ap_php_optind++; - } - - /* check if file exists, exit else */ - - if (dofork) { - switch(fork()) { - case -1: /* Uh-oh, we have a problem forking. */ - fprintf(stderr, "Uh-oh, couldn't fork!\n"); - exit(errno); - break; - case 0: /* Child */ - break; - default: /* Parent */ - exit(0); - } - } - - { - struct stat junk; - if (stat(sock,&junk) == 0) unlink(sock); - } - - openlog("php-milter", LOG_PID, LOG_MAIL); - - if (exit_status = mlfi_init()) { - syslog(1, "mlfi_init failed."); - exit(exit_status); - } - - smfi_setconn(sock); - if (smfi_register(smfilter) == MI_FAILURE) { - syslog(1, "smfi_register failed."); - fprintf(stderr, "smfi_register failed\n"); - } else { - exit_status = smfi_main(); - } - - closelog(); - - if (milter_sapi_module.php_ini_path_override) { - free(milter_sapi_module.php_ini_path_override); - } - - } zend_catch { - exit_status = EG(exit_status); - } zend_end_try(); - - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - tsrm_shutdown(); - - exit(exit_status); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/milter/php_milter.h b/sapi/milter/php_milter.h deleted file mode 100644 index 72d7ac51eeb50..0000000000000 --- a/sapi/milter/php_milter.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef PHP_MILTER_H -#define PHP_MILTER_H - -#include "libmilter/mfapi.h" - -#define MLFI_NONE 0 -#define MLFI_CONNECT 1 -#define MLFI_HELO 2 -#define MLFI_ENVFROM 3 -#define MLFI_ENVRCPT 4 -#define MLFI_HEADER 5 -#define MLFI_EOH 6 -#define MLFI_BODY 7 -#define MLFI_EOM 8 -#define MLFI_ABORT 9 -#define MLFI_CLOSE 10 -#define MLFI_INIT 11 - -#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) - -typedef struct { - pthread_t thread; - MUTEX_T receiver; - MUTEX_T sender; - SMFICTX *ctx; - sfsistat retval; - int message; - void **args; -} worker_thread; - -#endif diff --git a/sapi/nsapi/CREDITS b/sapi/nsapi/CREDITS deleted file mode 100644 index 2a0591986201f..0000000000000 --- a/sapi/nsapi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -NSAPI -Jayakumar Muthukumarasamy, Uwe Schindler diff --git a/sapi/nsapi/config.m4 b/sapi/nsapi/config.m4 deleted file mode 100644 index d23060b029129..0000000000000 --- a/sapi/nsapi/config.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for NSAPI support) -AC_ARG_WITH(nsapi, -[ --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/SunONE],[ - PHP_NSAPI=$withval -],[ - PHP_NSAPI=no -]) -AC_MSG_RESULT($PHP_NSAPI) - -if test "$PHP_NSAPI" != "no"; then - if test ! -d $PHP_NSAPI/bin ; then - AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR) - fi - AC_MSG_CHECKING(for NSAPI include files) - if test -d $PHP_NSAPI/include ; then - NSAPI_INCLUDE=$PHP_NSAPI/include - AC_MSG_RESULT(Netscape-Enterprise 3.x style) - AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h]) - fi - if test -d $PHP_NSAPI/plugins/include ; then - test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE" - NSAPI_INCLUDE="$PHP_NSAPI/plugins/include" - AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style) - AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h]) - NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE" - fi - if test "$NSAPI_INCLUDE" = ""; then - AC_MSG_ERROR(Please check you have nsapi.h in either $PHP_NSAPI/include or $PHP_NSAPI/plugins/include) - fi - - PHP_EVAL_INCLINE($NSAPI_INCLUDE) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(HAVE_NSAPI,1,[Whether you have a Netscape/iPlanet/SunONE Server]) - PHP_SELECT_SAPI(nsapi, shared, nsapi.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_NSAPI/bin/" -fi - - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/nsapi/config.w32 b/sapi/nsapi/config.w32 deleted file mode 100644 index 3522eb7d5684a..0000000000000 --- a/sapi/nsapi/config.w32 +++ /dev/null @@ -1,19 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('nsapi', 'Build NSAPI for Netscape/iPlanet/SunONE webservers', 'no'); - -ARG_WITH('nsapi-includes', 'Where to find NSAPI headers', null); -ARG_WITH('nsapi-libs', 'Where to find NSAPI libraries', null); - -if (PHP_NSAPI != "no") { - if (PHP_ZTS == "no") { - WARNING("NSAPI module requires an --enable-zts build of PHP"); - } else if (CHECK_HEADER_ADD_INCLUDE("nsapi.h", "CFLAGS_NSAPI", - PHP_NSAPI + ';' + PHP_NSAPI_INCLUDES) && - CHECK_LIB("ns-httpd*.lib", "nsapi", PHP_NSAPI + ";" + PHP_NSAPI_LIBS)) { - SAPI('nsapi', 'nsapi.c', 'php' + PHP_VERSION + 'nsapi.dll', '/D XP_WIN32 '); - } else { - WARNING("Could not find NSAPI headers/libraries"); - } -} diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt deleted file mode 100644 index 0b7ecde2195fa..0000000000000 --- a/sapi/nsapi/nsapi-readme.txt +++ /dev/null @@ -1,154 +0,0 @@ -Configuration of your Netscape/SunONE/iPlanet Web Server for PHP5 ------------------------------------------------------------------ - -These instructions are targetted at Netscape Enterprise Web Server and -SUN/Netscape Alliance iPlanet Web Server/SunONE Webserver. -On other web servers your milage may vary. - -Firstly you may need to add some paths to the LD_LIBRARY_PATH -environment for Netscape to find all the shared libs. This is best done -in the start script for your Netscape server. Windows users can -probably skip this step. The start script is located in: - - /https-servername/start - - -Netscape/iPlanet/SunONE config files are located in: - - /https-servername/config - - -Add the following line to mime.types (you can do that by the administration server): - - type=magnus-internal/x-httpd-php exts=php - - -Place the following two lines after mime.types init in -/https-servername/config/obj.conf (for servers < 6) or -for iPlanet/SunONE Web Server 6.0 and above however at the end of the -/https-servername/config/magnus.conf file: - - Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/path/to/phplibrary" - Init fn=php5_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] - -The "shlib" will vary depending on your OS: - - Unix: "/bin/libphp5.so". - Windows: "c:/path/to/php5/php5nsapi.dll" - - -In obj.conf (for virtual server classes [SunONE 6.0+] in their vserver.obj.conf): - - - . - . - . - # NOTE this next line should happen after all 'ObjectType' and before - # all 'AddLog' lines - # You can modify some entries in php.ini request specific by adding it to the Service - # directive, e.g. doc_root="/path" - # For boolean ini-keys please use 0/1 as value, NOT "On","Off",... (this will not work - # correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression="On" - - Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value ...] - . - . - . - - -This is only needed if you want to configure a directory that only consists of -PHP scripts (same like a cgi-bin directory): - - - ObjectType fn="force-type" type="magnus-internal/x-httpd-php" - Service fn="php5_execute" [inikey=value ...] - - -After that you can configure a directory in the Administration server and assign it -the style "x-httpd-php". All files in it will get executed as PHP. This is nice to -hide PHP usage by renaming files to .html - -Note: The stacksize that PHP uses depends on the configuration of the webserver. If you get -crashes with very large PHP scripts, it is recommended to raise it with the Admin Server -(in the section "MAGNUS EDITOR"). - - -Authentication configuration ----------------------------- - -PHP authentication cannot be used with any other authentication. ALL -AUTHENTICATION IS PASSED TO YOUR PHP SCRIPT. To configure PHP -Authentication for the entire server, add the following line: - - - AuthTrans fn=php5_auth_trans - . - . - . - . - - - -To use PHP Authentication on a single directory, add the following: - - - AuthTrans fn=php5_auth_trans - - - -Special use for error pages or self-made directory listings ------------------------------------------------------------ - -You can use PHP to generate the error pages for "404 Not Found" -or similar. Add the following line to the object in obj.conf for -every error page you want to overwrite: - - Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...] - -where XXX ist the HTTP error code. Please delete any other Error -directives which could interfere with yours. -If you want to place a page for all errors that could exist, leave -the "code" parameter out. Your script can get the HTTP status code -with $_SERVER['ERROR_TYPE']. - -Another posibility is to generate self-made directory listings. -Just generate a PHP script which displays a directory listing and -replace the corresponding default Service line for -type="magnus-internal/directory" in obj.conf with the following: - - Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...] - -For both error and directory listing pages the original URI and -translated URI are in the variables $_SERVER['PATH_INFO'] and -$_SERVER['PATH_TRANSLATED']. - - -Note about nsapi_virtual() and subrequests ------------------------------------------- - -The NSAPI module now supports the nsapi_virtual() function (alias: virtual()) -to make subrequests on the webserver and insert the result in the webpage. -The problem is, that this function uses some undocumented features from -the NSAPI library. - -Under Unix this is not a problem, because the module automatically looks -for the needed functions and uses them if available. If not, nsapi_virtual() -is disabled. - -Under Windows limitations in the DLL handling need the use of a automatic -detection of the most recent ns-httpdXX.dll file. This is tested for servers -till version 6.1. If a newer version of the SunONE server is used, the detection -fails and nsapi_virtual() is disabled. - -If this is the case, try the following: -Add the following parameter to php5_init in magnus.conf: - - Init fn=php5_init ... server_lib="ns-httpdXX.dll" - -where XX is the correct DLL version number. To get it, look in the server-root -for the correct DLL name. The DLL with the biggest filesize is the right one. - -But be warned: SUPPORT FOR nsapi_virtual() IS EXPERIMENTAL !!! - - -$Id$ diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c deleted file mode 100644 index 3e852b0a6a268..0000000000000 --- a/sapi/nsapi/nsapi.c +++ /dev/null @@ -1,1021 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Jayakumar Muthukumarasamy | - | Uwe Schindler | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * PHP includes - */ -#define NSAPI 1 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_variables.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_version.h" -#include "TSRM.h" -#include "ext/standard/php_standard.h" -#include -#include - -#ifndef RTLD_DEFAULT -#define RTLD_DEFAULT NULL -#endif - -/* - * If neither XP_UNIX not XP_WIN32 is defined use PHP_WIN32 - */ -#if !defined(XP_UNIX) && !defined(XP_WIN32) -#ifdef PHP_WIN32 -#define XP_WIN32 -#else -#define XP_UNIX -#endif -#endif - -/* - * NSAPI includes - */ -#include "nsapi.h" -#include "base/pblock.h" -#include "base/session.h" -#include "frame/req.h" -#include "frame/protocol.h" /* protocol_start_response */ -#include "base/util.h" /* is_mozilla, getline */ -#include "frame/log.h" /* log_error */ - -#define NSLS_D struct nsapi_request_context *request_context -#define NSLS_DC , NSLS_D -#define NSLS_C request_context -#define NSLS_CC , NSLS_C -#define NSG(v) (request_context->v) - -#define NS_BUF_SIZE 2048 - -/* - * ZTS needs to be defined for NSAPI to work - */ -#if !defined(ZTS) -#error "NSAPI module needs ZTS to be defined" -#endif - -/* - * Structure to encapsulate the NSAPI request in SAPI - */ -typedef struct nsapi_request_context { - pblock *pb; - Session *sn; - Request *rq; - int read_post_bytes; - char *path_info; - int fixed_script; /* 0 if script is from URI, 1 if script is from "script" parameter */ - short http_error; /* 0 in normal mode; for errors the HTTP error code */ -} nsapi_request_context; - -/* - * Mappings between NSAPI names and environment variables. This - * mapping was obtained from the sample programs at the iplanet - * website. - */ -typedef struct nsapi_equiv { - const char *env_var; - const char *nsapi_eq; -} nsapi_equiv; - -static nsapi_equiv nsapi_reqpb[] = { - { "QUERY_STRING", "query" }, - { "REQUEST_LINE", "clf-request" }, - { "REQUEST_METHOD", "method" }, - { "PHP_SELF", "uri" }, - { "SERVER_PROTOCOL", "protocol" } -}; -static size_t nsapi_reqpb_size = sizeof(nsapi_reqpb)/sizeof(nsapi_reqpb[0]); - -static nsapi_equiv nsapi_vars[] = { - { "AUTH_TYPE", "auth-type" }, - { "CLIENT_CERT", "auth-cert" }, - { "REMOTE_USER", "auth-user" } -}; -static size_t nsapi_vars_size = sizeof(nsapi_vars)/sizeof(nsapi_vars[0]); - -static nsapi_equiv nsapi_client[] = { - { "HTTPS_KEYSIZE", "keysize" }, - { "HTTPS_SECRETSIZE", "secret-keysize" }, - { "REMOTE_ADDR", "ip" }, - { "REMOTE_HOST", "ip" } -}; -static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]); - -/* this parameters to "Service"/"Error" are NSAPI ones which should not be php.ini keys and are excluded */ -static char *nsapi_exclude_from_ini_entries[] = { "fn", "type", "method", "directive", "code", "reason", "script", "bucket", NULL }; - -static char *nsapi_strdup(char *str) -{ - if (str != NULL) { - return STRDUP(str); - } - return NULL; -} - -static void nsapi_free(void *addr) -{ - if (addr != NULL) { - FREE(addr); - } -} - - -/*******************/ -/* PHP module part */ -/*******************/ - -PHP_MINIT_FUNCTION(nsapi); -PHP_MSHUTDOWN_FUNCTION(nsapi); -PHP_RINIT_FUNCTION(nsapi); -PHP_RSHUTDOWN_FUNCTION(nsapi); -PHP_MINFO_FUNCTION(nsapi); - -PHP_FUNCTION(nsapi_virtual); -PHP_FUNCTION(nsapi_request_headers); -PHP_FUNCTION(nsapi_response_headers); - -ZEND_BEGIN_MODULE_GLOBALS(nsapi) - long read_timeout; -ZEND_END_MODULE_GLOBALS(nsapi) - -ZEND_DECLARE_MODULE_GLOBALS(nsapi) - -#define NSAPI_G(v) TSRMG(nsapi_globals_id, zend_nsapi_globals *, v) - -/* {{{ nsapi_functions[] - * - * Every user visible function must have an entry in nsapi_functions[]. - */ -function_entry nsapi_functions[] = { - PHP_FE(nsapi_virtual, NULL) /* Make subrequest */ - PHP_FALIAS(virtual, nsapi_virtual, NULL) /* compatibility */ - PHP_FE(nsapi_request_headers, NULL) /* get request headers */ - PHP_FALIAS(getallheaders, nsapi_request_headers, NULL) /* compatibility */ - PHP_FALIAS(apache_request_headers, nsapi_request_headers, NULL) /* compatibility */ - PHP_FE(nsapi_response_headers, NULL) /* get response headers */ - PHP_FALIAS(apache_response_headers, nsapi_response_headers, NULL) /* compatibility */ - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ nsapi_module_entry - */ -zend_module_entry nsapi_module_entry = { - STANDARD_MODULE_HEADER, - "nsapi", - nsapi_functions, - PHP_MINIT(nsapi), - PHP_MSHUTDOWN(nsapi), - NULL, - NULL, - PHP_MINFO(nsapi), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("nsapi.read_timeout", "60", PHP_INI_ALL, OnUpdateLong, read_timeout, zend_nsapi_globals, nsapi_globals) -PHP_INI_END() -/* }}} */ - -/* newer servers hide this functions from the programmer so redefine the functions dynamically - thanks to Chris Elving from Sun for the function declarations */ -typedef int (*nsapi_servact_prototype)(Session *sn, Request *rq); -nsapi_servact_prototype nsapi_servact_uri2path = NULL; -nsapi_servact_prototype nsapi_servact_pathchecks = NULL; -nsapi_servact_prototype nsapi_servact_fileinfo = NULL; -nsapi_servact_prototype nsapi_servact_service = NULL; - -#ifdef PHP_WIN32 -/* The following dll-names for nsapi are in use at this time. The undocumented - * servact_* functions are always in the newest one, older ones are supported by - * the server only by wrapping the function table nothing else. So choose - * the newest one found in process space for dynamic linking */ -static char *nsapi_dlls[] = { "ns-httpd40.dll", "ns-httpd36.dll", "ns-httpd35.dll", "ns-httpd30.dll", NULL }; -/* if user specifies an other dll name by server_lib parameter - * it is placed in the following variable and only this DLL is - * checked for the servact_* functions */ -char *nsapi_dll = NULL; -#endif - -/* {{{ php_nsapi_init_dynamic_symbols - */ -static void php_nsapi_init_dynamic_symbols(void) -{ -#if defined(servact_uri2path) && defined(servact_pathchecks) && defined(servact_fileinfo) && defined(servact_service) - /* use functions from nsapi.h if available */ - nsapi_servact_uri2path = &servact_uri2path; - nsapi_servact_pathchecks = &servact_pathchecks; - nsapi_servact_fileinfo = &servact_fileinfo; - nsapi_servact_service = &servact_service; -#else - /* find address of internal NSAPI functions */ -#ifdef PHP_WIN32 - register int i; - DL_HANDLE module = NULL; - if (nsapi_dll) { - /* try user specified server_lib */ - module = GetModuleHandle(nsapi_dll); - if (!module) { - log_error(LOG_WARN, "php5_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); - } - } else { - /* find a LOADED dll module from nsapi_dlls */ - for (i=0; nsapi_dlls[i]; i++) { - if (module = GetModuleHandle(nsapi_dlls[i])) { - break; - } - } - } - if (!module) return; -#else - DL_HANDLE module = RTLD_DEFAULT; -#endif - nsapi_servact_uri2path = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_uri2path"); - nsapi_servact_pathchecks = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_pathchecks"); - nsapi_servact_fileinfo = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_fileinfo"); - nsapi_servact_service = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_service"); - if (!(nsapi_servact_uri2path && nsapi_servact_pathchecks && nsapi_servact_fileinfo && nsapi_servact_service)) { - /* not found - could be cause they are undocumented */ - nsapi_servact_uri2path = NULL; - nsapi_servact_pathchecks = NULL; - nsapi_servact_fileinfo = NULL; - nsapi_servact_service = NULL; - } -#endif -} -/* }}} */ - -/* {{{ php_nsapi_init_globals - */ -static void php_nsapi_init_globals(zend_nsapi_globals *nsapi_globals) -{ - nsapi_globals->read_timeout = 60; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(nsapi) -{ - php_nsapi_init_dynamic_symbols(); - ZEND_INIT_MODULE_GLOBALS(nsapi, php_nsapi_init_globals, NULL); - REGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(nsapi) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(nsapi) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "NSAPI Module Revision", "$Revision$"); - php_info_print_table_row(2, "Server Software", system_version()); - php_info_print_table_row(2, "Sub-requests with nsapi_virtual()", - (nsapi_servact_service)?((zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0))?"not supported with zlib.output_compression":"enabled"):"not supported on this platform" ); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto bool nsapi_virtual(string uri) - Perform an NSAPI sub-request */ -/* This function is equivalent to - * in SSI. It does an NSAPI sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through webserver. - */ -PHP_FUNCTION(nsapi_virtual) -{ - pval **uri; - int rv; - char *value; - Request *rq; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &uri) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(uri); - - if (!nsapi_servact_service) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", (*uri)->value.str.val); - RETURN_FALSE; - } else if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", (*uri)->value.str.val); - RETURN_FALSE; - } else { - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - /* do the sub-request */ - /* thanks to Chris Elving from Sun for this code sniplet */ - if ((rq = request_restart_internal((*uri)->value.str.val, NULL)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", (*uri)->value.str.val); - RETURN_FALSE; - } - - /* insert host of current request to get page from same vhost */ - param_free(pblock_remove("host", rq->headers)); - if (value = pblock_findval("host", rc->rq->headers)) { - pblock_nvinsert("host", value, rq->headers); - } - - /* go through the normal request stages as given in obj.conf, - but leave out the logging/error section */ - do { - rv = (*nsapi_servact_uri2path)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_pathchecks)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_fileinfo)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_service)(rc->sn, rq); - } while (rv == REQ_RESTART); - - if (rq->status_num != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", (*uri)->value.str.val, rq->status_num); - request_free(rq); - RETURN_FALSE; - } - - request_free(rq); - - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array nsapi_request_headers(void) - Get all headers from the request */ -PHP_FUNCTION(nsapi_request_headers) -{ - register int i; - struct pb_entry *entry; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - array_init(return_value); - - for (i=0; i < rc->rq->headers->hsize; i++) { - entry=rc->rq->headers->ht[i]; - while (entry) { - if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); - } - entry=entry->next; - } - } -} -/* }}} */ - -/* {{{ proto array nsapi_response_headers(void) - Get all headers from the response */ -PHP_FUNCTION(nsapi_response_headers) -{ - register int i; - struct pb_entry *entry; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - array_init(return_value); - - php_header(TSRMLS_C); - - for (i=0; i < rc->rq->srvhdrs->hsize; i++) { - entry=rc->rq->srvhdrs->ht[i]; - while (entry) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); - entry=entry->next; - } - } -} -/* }}} */ - - -/*************/ -/* SAPI part */ -/*************/ - -static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) -{ - int retval; - nsapi_request_context *rc; - - rc = (nsapi_request_context *)SG(server_context); - retval = net_write(rc->sn->csd, (char *)str, str_length); - if (retval == IO_ERROR /* -1 */ || retval == IO_EOF /* 0 */) { - php_handle_aborted_connection(); - } - return retval; -} - -static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - if (p == NULL) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content == ' '); - - if (!strcasecmp(header_name, "Content-Type")) { - param_free(pblock_remove("content-type", rc->rq->srvhdrs)); - pblock_nvinsert("content-type", header_content, rc->rq->srvhdrs); - } else { - /* to lower case because NSAPI reformats the headers and wants lowercase */ - for (p=header_name; *p; p++) { - *p=tolower(*p); - } - if (sapi_header->replace) param_free(pblock_remove(header_name, rc->rq->srvhdrs)); - pblock_nvinsert(header_name, header_content, rc->rq->srvhdrs); - } - - sapi_free_header(sapi_header); - - return 0; /* don't use the default SAPI mechanism, NSAPI duplicates this functionality */ -} - -static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int retval; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (SG(sapi_headers).send_default_content_type) { - char *hd; - param_free(pblock_remove("content-type", rc->rq->srvhdrs)); - hd = sapi_get_default_content_type(TSRMLS_C); - pblock_nvinsert("content-type", hd, rc->rq->srvhdrs); - efree(hd); - } - - protocol_status(rc->sn, rc->rq, SG(sapi_headers).http_response_code, NULL); - retval = protocol_start_response(rc->sn, rc->rq); - - if (retval == REQ_PROCEED || retval == REQ_NOACTION) { - return SAPI_HEADER_SENT_SUCCESSFULLY; - } else { - return SAPI_HEADER_SEND_FAILED; - } -} - -static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - char *read_ptr = buffer, *content_length_str = NULL; - uint bytes_read = 0; - int length, content_length = 0; - netbuf *nbuf = rc->sn->inbuf; - - /* - * Yesss! - */ - count_bytes = MIN(count_bytes, SG(request_info).content_length-rc->read_post_bytes); - content_length = SG(request_info).content_length; - - if (content_length <= 0) { - return 0; - } - - /* - * Gobble any pending data in the netbuf. - */ - length = nbuf->cursize - nbuf->pos; - length = MIN(count_bytes, length); - if (length > 0) { - memcpy(read_ptr, nbuf->inbuf + nbuf->pos, length); - bytes_read += length; - read_ptr += length; - content_length -= length; - nbuf->pos += length; - } - - /* - * Read the remaining from the socket. - */ - while (content_length > 0 && bytes_read < count_bytes) { - int bytes_to_read = count_bytes - bytes_read; - - if (content_length < bytes_to_read) { - bytes_to_read = content_length; - } - - length = net_read(rc->sn->csd, read_ptr, bytes_to_read, NSAPI_G(read_timeout)); - - if (length == IO_ERROR || length == IO_EOF) { - break; - } - - bytes_read += length; - read_ptr += length; - content_length -= length; - } - - if ( bytes_read > 0 ) { - rc->read_post_bytes += bytes_read; - } - return bytes_read; -} - -static char *sapi_nsapi_read_cookies(TSRMLS_D) -{ - char *cookie_string; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - cookie_string = pblock_findval("cookie", rc->rq->headers); - return cookie_string; -} - -static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - register size_t i; - int pos; - char *value,*p; - char buf[NS_BUF_SIZE + 1]; - struct pb_entry *entry; - - for (i = 0; i < nsapi_reqpb_size; i++) { - value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb); - if (value) { - php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - for (i=0; i < rc->rq->headers->hsize; i++) { - entry=rc->rq->headers->ht[i]; - while (entry) { - if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) { - if (strcasecmp(entry->param->name, "content-length")==0 || strcasecmp(entry->param->name, "content-type")==0) { - strlcpy(buf, entry->param->name, NS_BUF_SIZE); - pos = 0; - } else { - snprintf(buf, NS_BUF_SIZE, "HTTP_%s", entry->param->name); - pos = 5; - } - buf[NS_BUF_SIZE]='\0'; - for(p = buf + pos; *p; p++) { - *p = toupper(*p); - if (*p < 'A' || *p > 'Z') { - *p = '_'; - } - } - php_register_variable(buf, entry->param->value, track_vars_array TSRMLS_CC); - } - entry=entry->next; - } - } - - for (i = 0; i < nsapi_vars_size; i++) { - value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars); - if (value) { - php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - for (i = 0; i < nsapi_client_size; i++) { - value = pblock_findval(nsapi_client[i].nsapi_eq, rc->sn->client); - if (value) { - php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - if (value = session_dns(rc->sn)) { - php_register_variable("REMOTE_HOST", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - - sprintf(buf, "%d", conf_getglobals()->Vport); - php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array TSRMLS_CC); - - value = http_uri2url_dynamic("", "", rc->sn, rc->rq); - php_register_variable("SERVER_URL", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - - php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array TSRMLS_CC); - php_register_variable("HTTPS", (security_active ? "ON" : "OFF"), track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - - /* DOCUMENT_ROOT */ - if (value = request_translate_uri("/", rc->sn)) { - value[strlen(value) - 1] = '\0'; - php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - - /* PATH_INFO / PATH_TRANSLATED */ - if (rc->path_info) { - if (value = request_translate_uri(rc->path_info, rc->sn)) { - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - php_register_variable("PATH_INFO", rc->path_info, track_vars_array TSRMLS_CC); - } - - /* Create full Request-URI & Script-Name */ - if (SG(request_info).request_uri) { - strlcpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); - if (SG(request_info).query_string) { - p = strchr(buf, 0); - snprintf(p, NS_BUF_SIZE-(p-buf), "?%s", SG(request_info).query_string); - buf[NS_BUF_SIZE]='\0'; - } - php_register_variable("REQUEST_URI", buf, track_vars_array TSRMLS_CC); - - strlcpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); - if (rc->path_info) { - pos = strlen(SG(request_info).request_uri) - strlen(rc->path_info); - if (pos>=0 && pos<=NS_BUF_SIZE && rc->path_info) { - buf[pos] = '\0'; - } else { - buf[0]='\0'; - } - } - php_register_variable("SCRIPT_NAME", buf, track_vars_array TSRMLS_CC); - } - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - /* special variables in error mode */ - if (rc->http_error) { - sprintf(buf, "%d", rc->http_error); - php_register_variable("ERROR_TYPE", buf, track_vars_array TSRMLS_CC); - } -} - -static void nsapi_log_message(char *message) -{ - TSRMLS_FETCH(); - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); -} - -static time_t sapi_nsapi_get_request_time(TSRMLS_D) -{ - return REQ_TIME( ((nsapi_request_context *)SG(server_context))->rq ); -} - -static int php_nsapi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &nsapi_module_entry, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -static sapi_module_struct nsapi_sapi_module = { - "nsapi", /* name */ - "NSAPI", /* pretty name */ - - php_nsapi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_nsapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_nsapi_header_handler, /* header handler */ - sapi_nsapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_nsapi_read_post, /* read POST data */ - sapi_nsapi_read_cookies, /* read Cookies */ - - sapi_nsapi_register_server_variables, /* register server variables */ - nsapi_log_message, /* Log message */ - sapi_nsapi_get_request_time, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) -{ - struct pb_entry *entry; - register int i,j,ok; - - for (i=0; i < NSG(pb)->hsize; i++) { - entry=NSG(pb)->ht[i]; - while (entry) { - /* exclude standard entries given to "Service" which should not go into ini entries */ - ok=1; - for (j=0; nsapi_exclude_from_ini_entries[j]; j++) { - ok&=(strcasecmp(entry->param->name, nsapi_exclude_from_ini_entries[j])!=0); - } - - if (ok) { - /* change the ini entry */ - if (zend_alter_ini_entry(entry->param->name, strlen(entry->param->name)+1, - entry->param->value, strlen(entry->param->value), - PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE)==FAILURE) { - log_error(LOG_WARN, pblock_findval("fn", NSG(pb)), NSG(sn), NSG(rq), "Cannot change php.ini key \"%s\" to \"%s\"", entry->param->name, entry->param->value); - } - } - entry=entry->next; - } - } -} - -void NSAPI_PUBLIC php5_close(void *vparam) -{ - if (nsapi_sapi_module.shutdown) { - nsapi_sapi_module.shutdown(&nsapi_sapi_module); - } - - if (nsapi_sapi_module.php_ini_path_override) { - free(nsapi_sapi_module.php_ini_path_override); - } - -#ifdef PHP_WIN32 - if (nsapi_dll) { - free(nsapi_dll); - nsapi_dll = NULL; - } -#endif - - tsrm_shutdown(); - - log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module"); -} - -/********************************************************* -/ init SAF -/ -/ Init fn="php5_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] -/ Initialize the NSAPI module in magnus.conf -/ -/ php_ini: gives path to php.ini file -/ server_lib: (only Win32) gives name of DLL (without path) to look for -/ servact_* functions -/ -/*********************************************************/ -int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) -{ - php_core_globals *core_globals; - char *strval; - int threads=128; /* default for server */ - - /* fetch max threads from NSAPI and initialize TSRM with it */ -#if defined(pool_maxthreads) - threads=pool_maxthreads; - if (threads<1) { - threads=128; /* default for server */ - } -#endif - tsrm_startup(threads, 1, 0, NULL); - - core_globals = ts_resource(core_globals_id); - - /* look if php_ini parameter is given to php5_init */ - if (strval = pblock_findval("php_ini", pb)) { - nsapi_sapi_module.php_ini_path_override = strdup(strval); - } - -#ifdef PHP_WIN32 - /* look if server_lib parameter is given to php5_init - * (this disables the automatic search for the newest ns-httpdXX.dll) */ - if (strval = pblock_findval("server_lib", pb)) { - nsapi_dll = strdup(strval); - } -#endif - - /* start SAPI */ - sapi_startup(&nsapi_sapi_module); - nsapi_sapi_module.startup(&nsapi_sapi_module); - - daemon_atrestart(&php5_close, NULL); - - log_error(LOG_INFORM, pblock_findval("fn", pb), sn, rq, "Initialized PHP Module (%d threads exspected)", threads); - return REQ_PROCEED; -} - -/********************************************************* -/ normal use in Service directive: -/ -/ Service fn="php5_execute" type=... method=... [inikey=inivalue inikey=inivalue...] -/ -/ use in Service for a directory to supply a php-made directory listing instead of server default: -/ -/ Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ -/ use in Error SAF to display php script as error page: -/ -/ Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ Error fn="php5_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ -/*********************************************************/ -int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) -{ - int retval; - nsapi_request_context *request_context; - zend_file_handle file_handle = {0}; - struct stat fst; - - char *path_info; - char *query_string = pblock_findval("query", rq->reqpb); - char *uri = pblock_findval("uri", rq->reqpb); - char *request_method = pblock_findval("method", rq->reqpb); - char *content_type = pblock_findval("content-type", rq->headers); - char *content_length = pblock_findval("content-length", rq->headers); - char *directive = pblock_findval("Directive", pb); - int error_directive = (directive && !strcasecmp(directive, "error")); - int fixed_script = 1; - - /* try to use script parameter -> Error or Service for directory listing */ - char *path_translated = pblock_findval("script", pb); - - TSRMLS_FETCH(); - - /* if script parameter is missing: normal use as Service SAF */ - if (!path_translated) { - path_translated = pblock_findval("path", rq->vars); - path_info = pblock_findval("path-info", rq->vars); - fixed_script = 0; - if (error_directive) { - /* go to next error directive if script parameter is missing */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Missing 'script' parameter"); - return REQ_NOACTION; - } - } else { - /* in error the path_info is the uri to the requested page */ - path_info = pblock_findval("uri", rq->reqpb); - } - - /* check if this uri was included in an other PHP script with nsapi_virtual() - by looking for a request context in the current thread */ - if (SG(server_context)) { - /* send 500 internal server error */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot make nesting PHP requests with nsapi_virtual()"); - if (error_directive) { - return REQ_NOACTION; - } else { - protocol_status(sn, rq, 500, NULL); - return REQ_ABORTED; - } - } - - request_context = (nsapi_request_context *)MALLOC(sizeof(nsapi_request_context)); - request_context->pb = pb; - request_context->sn = sn; - request_context->rq = rq; - request_context->read_post_bytes = 0; - request_context->fixed_script = fixed_script; - request_context->http_error = (error_directive) ? rq->status_num : 0; - request_context->path_info = nsapi_strdup(path_info); - - SG(server_context) = request_context; - SG(request_info).query_string = nsapi_strdup(query_string); - SG(request_info).request_uri = nsapi_strdup(uri); - SG(request_info).request_method = nsapi_strdup(request_method); - SG(request_info).path_translated = nsapi_strdup(path_translated); - SG(request_info).content_type = nsapi_strdup(content_type); - SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0); - SG(sapi_headers).http_response_code = (error_directive) ? rq->status_num : 200; - - nsapi_php_ini_entries(NSLS_C TSRMLS_CC); - - if (!PG(safe_mode)) php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC); - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - if (stat(SG(request_info).path_translated, &fst)==0 && S_ISREG(fst.st_mode)) { - if (php_request_startup(TSRMLS_C) == SUCCESS) { - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - retval=REQ_PROCEED; - } else { - /* send 500 internal server error */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot prepare PHP engine!"); - if (error_directive) { - retval=REQ_NOACTION; - } else { - protocol_status(sn, rq, 500, NULL); - retval=REQ_ABORTED; - } - } - } else { - /* send 404 because file not found */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot execute PHP script: %s (File not found)", SG(request_info).path_translated); - if (error_directive) { - retval=REQ_NOACTION; - } else { - protocol_status(sn, rq, 404, NULL); - retval=REQ_ABORTED; - } - } - - nsapi_free(request_context->path_info); - nsapi_free(SG(request_info).query_string); - nsapi_free(SG(request_info).request_uri); - nsapi_free((void*)(SG(request_info).request_method)); - nsapi_free(SG(request_info).path_translated); - nsapi_free((void*)(SG(request_info).content_type)); - - FREE(request_context); - SG(server_context) = NULL; - - return retval; -} - -/********************************************************* -/ authentication -/ -/ we have to make a 'fake' authenticator for netscape so it -/ will pass authentication through to php, and allow us to -/ check authentication with our scripts. -/ -/ php5_auth_trans -/ main function called from netscape server to authenticate -/ a line in obj.conf: -/ funcs=php5_auth_trans shlib="path/to/this/phpnsapi.dll" -/ and: -/ -/ AuthTrans fn="php5_auth_trans" -/*********************************************************/ -int NSAPI_PUBLIC php5_auth_trans(pblock * pb, Session * sn, Request * rq) -{ - /* This is a DO NOTHING function that allows authentication - * information - * to be passed through to PHP scripts. - */ - return REQ_PROCEED; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/nsapi/php5nsapi.dsp b/sapi/nsapi/php5nsapi.dsp deleted file mode 100644 index 6cd0079b43a10..0000000000000 --- a/sapi/nsapi/php5nsapi.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5nsapi" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5nsapi - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5nsapi.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5nsapi.mak" CFG="php5nsapi - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5nsapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5nsapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5nsapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5nsapi - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5nsapi - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5nsapi - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "php5nsapi___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_DEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ns-httpd30.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5nsapi - Win32 Release_TS" -# Name "php5nsapi - Win32 Release_TS_inline" -# Name "php5nsapi - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\nsapi.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/phttpd/CREDITS b/sapi/phttpd/CREDITS deleted file mode 100644 index 134cc54825cdb..0000000000000 --- a/sapi/phttpd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -phttpd -Thies C. Arntzen diff --git a/sapi/phttpd/README b/sapi/phttpd/README deleted file mode 100644 index cdb6f7c381da7..0000000000000 --- a/sapi/phttpd/README +++ /dev/null @@ -1,5 +0,0 @@ -phttpd sapi module. - -THIS IS BY NO MEANS COMPLETE NOR USABLE RIGHT NOW! - -thies@thieso.net 03.01.2000 diff --git a/sapi/phttpd/config.m4 b/sapi/phttpd/config.m4 deleted file mode 100644 index 75c6d66891471..0000000000000 --- a/sapi/phttpd/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -AC_MSG_CHECKING(for PHTTPD support) -AC_ARG_WITH(phttpd, -[ --with-phttpd=DIR Build PHP as phttpd module], -[ - if test ! -d $withval ; then - AC_MSG_ERROR(You did not specify a directory) - fi - PHP_BUILD_THREAD_SAFE - PHTTPD_DIR=$withval - PHP_ADD_INCLUDE($PHTTPD_DIR/include) - AC_DEFINE(HAVE_PHTTPD,1,[Whether you have phttpd]) - PHP_SELECT_SAPI(phttpd, shared, phttpd.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHTTPD_DIR/modules/" - RESULT=yes -]) -AC_MSG_RESULT($RESULT) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/phttpd/php.sym b/sapi/phttpd/php.sym deleted file mode 100644 index f10b883a9930c..0000000000000 --- a/sapi/phttpd/php.sym +++ /dev/null @@ -1,4 +0,0 @@ -pm_init -pm_exit -pm_request - diff --git a/sapi/phttpd/php_phttpd.h b/sapi/phttpd/php_phttpd.h deleted file mode 100644 index 8ef92cebd6884..0000000000000 --- a/sapi/phttpd/php_phttpd.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_PHTTPD_H -#define PHP_PHTTPD_H - -#include - -#endif diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c deleted file mode 100644 index f0381c5526865..0000000000000 --- a/sapi/phttpd/phttpd.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Thies C. Arntzen | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" - -#ifdef HAVE_PHTTPD - -#include "ext/standard/info.h" - -#ifndef ZTS -#error PHTTPD module is only useable in thread-safe mode -#endif - -#include "php_phttpd.h" - -typedef struct { - struct connectioninfo *cip; - struct stat sb; -} phttpd_globals_struct; - -static int ph_globals_id; - -#define PHG(v) TSRMG(ph_globals_id, phttpd_globals_struct *, v) - -static int -php_phttpd_startup(sapi_module_struct *sapi_module) -{ - fprintf(stderr,"***php_phttpd_startup\n"); - - if (php_module_startup(sapi_module, NULL, 0)) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static int -php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int sent_bytes; - - sent_bytes = fd_write(PHG(cip)->fd, str, str_length); - - if (sent_bytes == -1) { - php_handle_aborted_connection(); - } - - return sent_bytes; -} - -static int -php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content; - char *p; - TSRMLS_FETCH(); - - http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if (p) { - *p = '\0'; - do { - header_content++; - } while (*header_content == ' '); - - fd_printf(PHG(cip)->fd,"%s: %s\n", header_name, header_content); - - *p = ':'; - } - - sapi_free_header(sapi_header); - - return 0; -} - -static int -php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - TSRMLS_FETCH(); - - if (SG(sapi_headers).send_default_content_type) { - fd_printf(PHG(cip)->fd,"Content-Type: text/html\n"); - } - - fd_putc('\n', PHG(cip)->fd); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static char * -php_phttpd_sapi_read_cookies(TSRMLS_D) -{ - -/* - int i; - char *http_cookie = NULL; - NTSRMLS_FETCH(); - - i = Ns_SetIFind(NSG(conn->headers), "cookie"); - if(i != -1) { - http_cookie = Ns_SetValue(NSG(conn->headers), i); - } - - return http_cookie; -*/ - fprintf(stderr,"***php_phttpd_sapi_read_cookies\n"); - - return 0; -} - -static int -php_phttpd_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ -/* - uint max_read; - uint total_read = 0; - NTSRMLS_FETCH(); - - max_read = MIN(NSG(data_avail), count_bytes); - - total_read = Ns_ConnRead(NSG(conn), buf, max_read); - - if(total_read == NS_ERROR) { - total_read = -1; - } else { - NSG(data_avail) -= total_read; - } - - return total_read; -*/ - fprintf(stderr,"***php_phttpd_sapi_read_post\n"); - return 0; -} - -static sapi_module_struct phttpd_sapi_module = { - "phttpd", - "PHTTPD", - - php_phttpd_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_phttpd_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - php_phttpd_sapi_header_handler, /* header handler */ - php_phttpd_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_phttpd_sapi_read_post, /* read POST data */ - php_phttpd_sapi_read_cookies, /* read Cookies */ - - NULL, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void -php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC) -{ - memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */ - - SG(request_info).query_string = PHG(cip)->hip->request; - SG(request_info).request_method = PHG(cip)->hip->method; - SG(request_info).path_translated = malloc(MAXPATHLEN); - SG(sapi_headers).http_response_code = 200; - if (url_expand(PHG(cip)->hip->url, SG(request_info).path_translated, MAXPATHLEN, &PHG(sb), NULL, NULL) == NULL) { - /* handle error */ - } - -#if 0 - char *server; - Ns_DString ds; - char *root; - int index; - char *tmp; - - server = Ns_ConnServer(NSG(conn)); - - Ns_DStringInit(&ds); - Ns_UrlToFile(&ds, server, NSG(conn->request->url)); - - /* path_translated is the absolute path to the file */ - SG(request_info).path_translated = strdup(Ns_DStringValue(&ds)); - Ns_DStringFree(&ds); - root = Ns_PageRoot(server); - SG(request_info).request_uri = SG(request_info).path_translated + strlen(root); - SG(request_info).content_length = Ns_ConnContentLength(NSG(conn)); - index = Ns_SetIFind(NSG(conn)->headers, "content-type"); - SG(request_info).content_type = index == -1 ? NULL : - Ns_SetValue(NSG(conn)->headers, index); - - tmp = Ns_ConnAuthUser(NSG(conn)); - if(tmp) { - tmp = estrdup(tmp); - } - SG(request_info).auth_user = tmp; - - tmp = Ns_ConnAuthPasswd(NSG(conn)); - if(tmp) { - tmp = estrdup(tmp); - } - SG(request_info).auth_password = tmp; - - NSG(data_avail) = SG(request_info).content_length; -#endif -} - -static void -php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC) -{ - free(SG(request_info).path_translated); -} - - -int php_doit(TSRMLS_D TSRMLS_DC) -{ - struct stat sb; - zend_file_handle file_handle; - struct httpinfo *hip = PHG(cip)->hip; - TSRMLS_FETCH(); - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return -1; - } - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - -/* - php_phttpd_hash_environment(TSRMLS_C); -*/ - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return SG(sapi_headers).http_response_code; -} - -int pm_init(const char **argv) -{ - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&phttpd_sapi_module); - phttpd_sapi_module.startup(&phttpd_sapi_module); - - ts_allocate_id(&ph_globals_id, sizeof(phttpd_globals_struct), NULL, NULL); - - return 0; -} - -void pm_exit(void) -{ - fprintf(stderr,"***pm_exit\n"); -} - -int pm_request(struct connectioninfo *cip) -{ - struct httpinfo *hip = cip->hip; - int status; - TSRMLS_FETCH(); - - if (strcasecmp(hip->method, "GET") == 0 || - strcasecmp(hip->method, "HEAD") == 0 || - strcasecmp(hip->method, "POST") == 0) { - PHG(cip) = cip; - - php_phttpd_request_ctor(TSRMLS_C); - status = php_doit(TSRMLS_C); - php_phttpd_request_dtor(TSRMLS_C); - - return status; - } else { - return -2; - } -} - -#endif diff --git a/sapi/pi3web/CREDITS b/sapi/pi3web/CREDITS deleted file mode 100644 index c4541f89da76b..0000000000000 --- a/sapi/pi3web/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -pi3web -Holger Zimmermann diff --git a/sapi/pi3web/README b/sapi/pi3web/README deleted file mode 100644 index e3e523e94047d..0000000000000 --- a/sapi/pi3web/README +++ /dev/null @@ -1,50 +0,0 @@ -PHP5 Module -========== -This module requires PHP5 as thread safe shared library. Have a look -into the INSTALL file which accompanies that distribution. - -If you distribute this software bundled with the PHP software in source -or binary form, then you must adhere to the PHP copyright conditions - -the terms are reasonable. - -You should have checked out and built the PHP5 source package from the -PHP CVS tree into the Pi3Web source directory called 'PHP5' first. Then -build PHP5 as Pi3Web module and after that build the Pi3Web PHP5 wrapper: - -1. Checkout PHP5 -================ -cvs -d :pserver:cvsread@cvs.php.net:/repository login -The required password is phpfi - -cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php5 - -You must also checkout the TSRM and the ZEND module from the ZEND cvs tree -into the PHP5 root directory - -cvs -d :pserver:cvsread@cvs.zend.com:/repository login -The required password is zend - -cvs -z3 -d :pserver:cvsread@cvs.zend.com:/repository co Zend TSRM - -2. Build PHP5 -============= -2.1 POSIX ---------- -cd ./php5 -./buildconf -./configure --with-pi3web -make - -2.2 Win32 ---------- -other required downloads from the php website - - bison 1.25 - - bindlib32 - - number4.tar.gz -nmake php5dllts.mak - -3. Build Pi3Web PHP5 wrapper -============================ -Run make in the Pi3Web /Source/PHP5 directory. - -For further information refer to http://www.php.net/version4/ diff --git a/sapi/pi3web/config.m4 b/sapi/pi3web/config.m4 deleted file mode 100644 index ba6a166c16924..0000000000000 --- a/sapi/pi3web/config.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -AC_MSG_CHECKING(for Pi3Web support) - -AC_ARG_WITH(pi3web, -[ --with-pi3web[=DIR] Build PHP as Pi3Web module], -[ -if test "$withval" != "no"; then - if test "$withval" = "yes"; then - PI3PATH=../.. # the default - else - PI3PATH=$withval - fi - test -f "$PI3PATH/PiAPI/PiAPI.h" || AC_MSG_ERROR(Unable to find PiAPI.h in $PI3PATH/PiAPI) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(WITH_PI3WEB,1,[whether you want Pi3Web support]) - PHP_ADD_INCLUDE($PI3PATH/PiAPI) - PHP_ADD_INCLUDE($PI3PATH/Pi2API) - PHP_ADD_INCLUDE($PI3PATH/Pi3API) - PHP_ADD_INCLUDE($PI3PATH/PHP5) - PHP_SELECT_SAPI(pi3web, shared, pi3web_sapi.c) - INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/" - RESULT=yes -else - RESULT=no -fi -]) -AC_MSG_RESULT($RESULT) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/pi3web/config.w32 b/sapi/pi3web/config.w32 deleted file mode 100644 index a5393e621ba22..0000000000000 --- a/sapi/pi3web/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('pi3web', 'Pi3Web', 'no'); - -if (PHP_PI3WEB != "no") { - if (CHECK_HEADER_ADD_INCLUDE('PiAPI.h', 'CFLAGS_PI3WEB', PHP_PHP_BUILD + "\\Pi3Web\\include;" + PHP_PI3WEB) && - CHECK_LIB('piapi.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && - CHECK_LIB('pi2api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && - CHECK_LIB('pi3api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB)) { - SAPI('pi3web', 'pi3web_sapi.c', 'php' + PHP_VERSION + 'pi3web.dll', '/D PHP5PI3WEB_EXPORTS'); - AC_DEFINE('WITH_PI3WEB', 1); - } else { - WARNING('Pi3Web not enabled; headers/libraries not found'); - } -} diff --git a/sapi/pi3web/php.sym b/sapi/pi3web/php.sym deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/pi3web/php5pi3web.dsp b/sapi/pi3web/php5pi3web.dsp deleted file mode 100644 index bb5a2488022a5..0000000000000 --- a/sapi/pi3web/php5pi3web.dsp +++ /dev/null @@ -1,136 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5pi3web" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5pi3web - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5pi3web.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5pi3web.mak" CFG="php5pi3web - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5pi3web - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5pi3web - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5pi3web - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5pi3web - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5pi3web___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5pi3web___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\ext\mysql\libmysql" /I "..\..\..\PiAPI" /I "..\..\..\Pi2API" /I "..\..\..\Pi3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" /libpath:"..\..\..\PiAPI" /libpath:"..\..\..\Pi2API" /libpath:"..\..\..\Pi3API" -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ENDIF - -# Begin Target - -# Name "php5pi3web - Win32 Debug_TS" -# Name "php5pi3web - Win32 Release_TS" -# Name "php5pi3web - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\pi3web_sapi.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\pi3web_sapi.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c deleted file mode 100644 index fe14d3bb49fc6..0000000000000 --- a/sapi/pi3web/pi3web_sapi.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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. | - +----------------------------------------------------------------------+ - | Pi3Web version 2.0 | - +----------------------------------------------------------------------+ - | This file is committed by the Pi3 development group. | - | (pi3web.sourceforge.net) | - | | - | Author: Holger Zimmermann (zimpel@users.sourceforge.net) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_variables.h" -#include "SAPI.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "zend_highlight.h" -#include "zend_indent.h" -#include "zend_alloc.h" -#include "ext/standard/basic_functions.h" -#include "TSRM/TSRM.h" -#include "PiAPI.h" -#include "Pi3API.h" - -#include "pi3web_sapi.h" - -#define PI3WEB_SERVER_VAR_BUF_SIZE 1024 - -int IWasLoaded=0; - - -static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - DWORD variable_len; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID); - PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 ); - - PUTS("\n"); - PUTS("\n"); - php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id$"); - php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); - snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); - php_info_print_table_row(2, "Debug Enabled", variable_buf); - PIPlatform_getCurrentDirectory( variable_buf, PI3WEB_SERVER_VAR_BUF_SIZE); - php_info_print_table_row(2, "Current Path", variable_buf); - if (lpCB->GetServerVariable(lpCB->ConnID, "SERVER_NAME", variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, "Main Virtual Hostname", variable_buf); - }; - snprintf(variable_buf, 511, "%d", PIPlatform_getProcessId()); - php_info_print_table_row(2, "Server PID", variable_buf); - php_info_print_table_row(2, "Server Platform", PIPlatform_getDescription()); - - PUTS("
              Pi3Web Server Information

              "); - - PUTS("\n"); - PUTS("\n"); - php_info_print_table_row(2, "HTTP Request Line", lpCB->lpszReq); - PUTS("\n"); - php_info_print_table_header(2, "Server Variable", "Value"); - - /* --- loop over all registered server variables --- */ - for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) ) - { - PCHAR pKey; - PIDBIterator_current( pIter, &pKey ); - if ( !pKey ) { /* sanity */ continue; }; - - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, pKey, variable_buf); - } else if (PIPlatform_getLastError() == PIAPI_EINVAL) { - char *tmp_variable_buf; - - tmp_variable_buf = (char *) emalloc(variable_len); - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, tmp_variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, pKey, tmp_variable_buf); - } - efree(tmp_variable_buf); - } - } - - PUTS("
              HTTP Request Information
              HTTP Headers
              "); -} - - -static zend_module_entry php_pi3web_module = { - STANDARD_MODULE_HEADER, - "PI3WEB", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_pi3web, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - DWORD num_bytes = str_length; - LPCONTROL_BLOCK cb; - - cb = (LPCONTROL_BLOCK) SG(server_context); - - if ( !IWasLoaded ) return 0; - cb->WriteClient(cb->ConnID, (char *) str, &num_bytes, 0 ); - - if (num_bytes != str_length) - php_handle_aborted_connection(); - return num_bytes; -} - - -static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_ADD; -} - - -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) -{ - *total_length += sapi_header->header_len+2; -} - - -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) -{ - memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); - *combined_headers_ptr += sapi_header->header_len; - **combined_headers_ptr = '\r'; - (*combined_headers_ptr)++; - **combined_headers_ptr = '\n'; - (*combined_headers_ptr)++; -} - - -static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - uint total_length = 2; /* account for the trailing \r\n */ - char *combined_headers, *combined_headers_ptr; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - sapi_header_struct default_content_type; - - if ( !IWasLoaded ) return SAPI_HEADER_SENT_SUCCESSFULLY; - - - if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); - - /* Generate headers */ - combined_headers = (char *) emalloc(total_length+1); - combined_headers_ptr = combined_headers; - if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); - sapi_free_header(&default_content_type); /* we no longer need it */ - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); - *combined_headers_ptr++ = '\r'; - *combined_headers_ptr++ = '\n'; - *combined_headers_ptr = 0; - - lpCB->dwHttpStatusCode = SG(sapi_headers).http_response_code; - lpCB->SendHeaderFunction(lpCB->ConnID, &total_length, (LPDWORD) combined_headers); - - efree(combined_headers); - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = 0; - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int php_pi3web_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_pi3web_module, 1)==FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - - -static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - DWORD read_from_buf=0; - DWORD read_from_input=0; - DWORD total_read=0; - - if ((DWORD)SG(read_post_bytes) < lpCB->cbAvailable) { - read_from_buf = MIN(lpCB->cbAvailable-SG(read_post_bytes), count_bytes); - memcpy(buffer, lpCB->lpbData+SG(read_post_bytes), read_from_buf); - total_read += read_from_buf; - } - if (read_from_bufcbTotalBytes) { - DWORD cbRead=0, cbSize; - - read_from_input = MIN(count_bytes-read_from_buf, lpCB->cbTotalBytes-SG(read_post_bytes)-read_from_buf); - while (cbRead < read_from_input) { - cbSize = read_from_input - cbRead; - if (!lpCB->ReadClient(lpCB->ConnID, buffer+read_from_buf+cbRead, &cbSize) || cbSize==0) { - break; - } - cbRead += cbSize; - } - total_read += cbRead; - } - - /* removed after re-testing POST with Pi3Web 2.0.2 */ - /* SG(read_post_bytes) += total_read; */ - return total_read; -} - - -static char *sapi_pi3web_read_cookies(TSRMLS_D) -{ - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - - if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", variable_buf, &variable_len)) { - return estrndup(variable_buf, variable_len); - } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { - char *tmp_variable_buf = (char *) emalloc(variable_len+1); - - if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", tmp_variable_buf, &variable_len)) { - tmp_variable_buf[variable_len] = 0; - return tmp_variable_buf; - } else { - efree(tmp_variable_buf); - } - } - return NULL; -} - -static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC) -{ - SG(server_context) = lpCB; - SG(request_info).request_method = lpCB->lpszMethod; - SG(request_info).query_string = lpCB->lpszQueryString; - SG(request_info).path_translated = lpCB->lpszPathTranslated; - SG(request_info).request_uri = lpCB->lpszUri; - SG(request_info).content_type = lpCB->lpszContentType; - SG(request_info).content_length = lpCB->cbTotalBytes; - SG(request_info).auth_user = (lpCB->lpszUser) ? (char *)estrdup((const char *)(lpCB->lpszUser)) : 0; - SG(request_info).auth_password = (lpCB->lpszPassword) ? (char *)estrdup((const char *)(lpCB->lpszPassword)) : 0; - SG(sapi_headers).http_response_code = 200; -} - -static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - char *variable_buf; - DWORD variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID); - PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 ); - - /* --- loop over all registered server variables --- */ - for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) ) - { - PCHAR pKey; - PIDBIterator_current( pIter, &pKey ); - if ( !pKey ) { /* sanity */ continue; }; - - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, static_variable_buf, &variable_len) - && (variable_len > 1)) { - php_register_variable(pKey, static_variable_buf, track_vars_array TSRMLS_CC); - } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { - variable_buf = (char *) emalloc(variable_len); - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)) { - php_register_variable(pKey, variable_buf, track_vars_array TSRMLS_CC); - } - efree(variable_buf); - } - - } - - - /* PHP_SELF support */ - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len) - && (variable_len > 1)) { - php_register_variable("PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC); - } -} - -static sapi_module_struct pi3web_sapi_module = { - "pi3web", /* name */ - "PI3WEB", /* pretty name */ - - php_pi3web_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - zend_pi3web_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - sapi_pi3web_header_handler, /* header handler */ - sapi_pi3web_send_headers, /* send headers handler */ - NULL, /* send header handler */ - sapi_pi3web_read_post, /* read POST data */ - sapi_pi3web_read_cookies, /* read Cookies */ - sapi_pi3web_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB) -{ - zend_file_handle file_handle = {0}; - int iRet = PIAPI_COMPLETED; - TSRMLS_FETCH(); - - zend_first_try { - file_handle.filename = lpCB->lpszFileName; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - - init_request_info(lpCB TSRMLS_CC); - php_request_startup(TSRMLS_C); - - switch ( lpCB->dwBehavior ) { - case PHP_MODE_STANDARD: - iRet = ( php_execute_script( &file_handle TSRMLS_CC ) ) ? - PIAPI_COMPLETED : PIAPI_ERROR; - break; - case PHP_MODE_HIGHLIGHT: { - zend_syntax_highlighter_ini syntax_highlighter_ini; - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) - { - php_get_highlight_struct( &syntax_highlighter_ini ); - zend_highlight( &syntax_highlighter_ini TSRMLS_CC ); - } - else - { - iRet = PIAPI_ERROR; - }; - }; - break; - case PHP_MODE_INDENT: { - sapi_header_line ctr = {0}; - - ctr.line = "Content-Type: text/plain"; - ctr.line_len = strlen(ctr.line); - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - } - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) - { - zend_indent(); - } - else - { - iRet = PIAPI_ERROR; - }; - break; - case PHP_MODE_LINT: - iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ? - PIAPI_COMPLETED : PIAPI_ERROR; - break; - default: - iRet = PIAPI_ERROR;; - } - - if (SG(request_info).cookie_data) { - efree(SG(request_info).cookie_data); - }; - - php_request_shutdown(NULL); - } zend_catch { - iRet = PIAPI_ERROR; - } zend_end_try(); - return iRet; -} - -MODULE_API BOOL PHP5_startup() { - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&pi3web_sapi_module); - if (pi3web_sapi_module.startup) { - pi3web_sapi_module.startup(&pi3web_sapi_module); - }; - IWasLoaded = 1; - return IWasLoaded; -}; - -MODULE_API BOOL PHP5_shutdown() { - if (pi3web_sapi_module.shutdown) { - pi3web_sapi_module.shutdown(&pi3web_sapi_module); - }; - sapi_shutdown(); - tsrm_shutdown(); - IWasLoaded = 0; - return !IWasLoaded; -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/pi3web/pi3web_sapi.h b/sapi/pi3web/pi3web_sapi.h deleted file mode 100644 index 9300241d44920..0000000000000 --- a/sapi/pi3web/pi3web_sapi.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef _PI3WEB_SAPI_H_ -#define _PI3WEB_SAPI_H_ - -#ifdef PHP_WIN32 -# include -# ifdef PHP5PI3WEB_EXPORTS -# define MODULE_API __declspec(dllexport) -# else -# define MODULE_API __declspec(dllimport) -# endif -#else -# define far -# define MODULE_API - - typedef int BOOL; - typedef void far *LPVOID; - typedef unsigned long DWORD; - typedef DWORD far *LPDWORD; - typedef char CHAR; - typedef CHAR *LPSTR; - typedef unsigned char BYTE; - typedef BYTE far *LPBYTE; -#endif - - typedef LPVOID HCONN; - -#ifdef __cplusplus -extern "C" { -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 - -// -// passed to the procedure on a new request -// -typedef struct _CONTROL_BLOCK { - DWORD cbSize; // size of this struct. - HCONN ConnID; // Context number not to be modified! - DWORD dwHttpStatusCode; // HTTP Status code - CHAR lpszLogData[80]; // null terminated log info - - LPSTR lpszMethod; // REQUEST_METHOD - LPSTR lpszQueryString; // QUERY_STRING - LPSTR lpszPathInfo; // PATH_INFO - LPSTR lpszPathTranslated; // PATH_TRANSLATED - LPSTR lpszFileName; // FileName to PHP3 physical file - LPSTR lpszUri; // The request URI - LPSTR lpszReq; // The whole HTTP request line - LPSTR lpszUser; // The authenticated user - LPSTR lpszPassword; // The authenticated password - - DWORD cbTotalBytes; // Total bytes indicated from client - DWORD cbAvailable; // Available number of bytes - LPBYTE lpbData; // pointer to cbAvailable bytes - - LPSTR lpszContentType; // Content type of client data - DWORD dwBehavior; // PHP behavior (standard, highlight, intend - - - LPVOID (* GetVariableNames) (HCONN hConn); - - BOOL (* GetServerVariable) ( HCONN hConn, - LPSTR lpszVariableName, - LPVOID lpvBuffer, - LPDWORD lpdwSize ); - - BOOL (* WriteClient) ( HCONN hConn, - LPVOID lpvBuffer, - LPDWORD lpdwBytes, - DWORD dwReserved ); - - BOOL (* ReadClient) ( HCONN hConn, - LPVOID lpvBuffer, - LPDWORD lpdwSize ); - - BOOL (* SendHeaderFunction)( HCONN hConn, - LPDWORD lpdwSize, - LPDWORD lpdwDataType ); - -} CONTROL_BLOCK, *LPCONTROL_BLOCK; - -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB); -MODULE_API BOOL PHP5_startup(); -MODULE_API BOOL PHP5_shutdown(); - -// the following type declaration is for the server side -typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB ); - - - -#ifdef __cplusplus -} -#endif - -#endif // end definition _PI3WEB_SAPI_H_ diff --git a/sapi/roxen/README b/sapi/roxen/README deleted file mode 100644 index d834a0000e75d..0000000000000 --- a/sapi/roxen/README +++ /dev/null @@ -1,18 +0,0 @@ -Roxen PHP support. Early version. Don't expect to be able to get it to -work. Requires Pike 0.7.79 and Roxen 1.4. Anything less won't work. - -The module is now thread safe, in a couple of different modes. First -mode, the default, uses a process global PHP lock in the Roxen -module. This means that all PHP-requests are serialized (ie only one -script is executed at any one time). The second option is using ZTS -(Zend Thread Safe mode). Unless --enable-roxen-zts is specified, this -won't be used. - -This solution now works fine and is recommended. Multiple PHP5 -requests will be run in parallell. The maximum number of parallell -PHP5-execution is limited to the number of handle threads Roxen is -started with. - -Support for this module is lacking. Please contact Roxen Internet -Software for support and help. See http://www.roxen.com/company/contact/ -for contact information. diff --git a/sapi/roxen/TODO b/sapi/roxen/TODO deleted file mode 100644 index 248f36f52e708..0000000000000 --- a/sapi/roxen/TODO +++ /dev/null @@ -1,33 +0,0 @@ -BUGS: - -- fix backtraces -- exit in PHP exits Roxen -- POST newline added? -- Rewriting header handling so that more than one header with the same - name can be set (most importantly, cookies). -- Recursive mutex lock problem: - - And another error (when trying to include a class) - - Recursive mutex locks! - /Usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/www.tx.pl/news/test.php",mapping[3],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() - base_server/roxen.pike:569: handler_thread(3). - - And after this every access to any php script (on other virtual sites - also) ends (of course there is no proper output) with this error: - - Php4.Interpreter->run: Tried to run a PHP-script from a PHP - callback!/usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/biall.com.pl/index.php3",mapping[2],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() - base_server/roxen.pike:569: handler_thread(3). - - -ADDITIONS: - -- use th_farm -- change cwd in single threaded mode -- per-virtual-server configuration - diff --git a/sapi/roxen/config.m4 b/sapi/roxen/config.m4 deleted file mode 100644 index daf4f59a24f81..0000000000000 --- a/sapi/roxen/config.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -AC_MSG_CHECKING(for Roxen/Pike support) -AC_ARG_WITH(roxen, -[ --with-roxen=DIR Build PHP as a Pike module. DIR is the base Roxen - directory, normally /usr/local/roxen/server], -[ - if test ! -d $withval ; then - AC_MSG_ERROR(You did not specify a directory) - fi - if test -f $withval/bin/roxen; then - PIKE=$withval/bin/roxen - elif test -f $withval/bin/pike; then - PIKE=$withval/bin/pike - else - AC_MSG_ERROR(Couldn't find a pike in $withval/bin/) - fi - if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then - PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` - PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'` - if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then - AC_MSG_ERROR(Failed to figure out Pike module and include directories) - fi - else - AC_MSG_ERROR(Roxen/PHP requires Pike 0.7.79 or newer) - fi - - PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) - AC_DEFINE(HAVE_ROXEN,1,[Whether you use Roxen]) - PHP_SELECT_SAPI(roxen, shared, roxen.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so" - RESULT="yes - Pike binary used: $PIKE - Pike include dir: $PIKE_INCLUDE_DIR - Pike module directory: $PIKE_MODULE_DIR" - PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR " -]) -AC_MSG_RESULT($RESULT) - -if test "$RESULT" != "no" ; then - RESULT=no - AC_MSG_CHECKING(if Roxen should use ZTS) - AC_ARG_ENABLE(roxen-zts, - [ --enable-roxen-zts Build the Roxen module using Zend Thread Safety], - [ - PHP_BUILD_THREAD_SAFE - AC_DEFINE(ROXEN_USE_ZTS,1,[Whether to use Roxen in ZTS mode]) - RESULT=yes - - ]) - AC_MSG_RESULT($RESULT) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: - diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c deleted file mode 100644 index 28612208fbe61..0000000000000 --- a/sapi/roxen/roxen.c +++ /dev/null @@ -1,726 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: David Hedbor | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#ifdef HAVE_ROXEN - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "ext/standard/info.h" - -#include "php_version.h" - -#ifndef ZTS -/* Only valid if thread safety is enabled. */ -#undef ROXEN_USE_ZTS -#endif - - -/* Pike Include Files - * - * conflicts with pike avoided by only using long names. Requires a new - * Pike 0.7 since it was implemented for this interface only. - * - */ -#define NO_PIKE_SHORTHAND - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef HIDE_GLOBAL_VARIABLES -#undef REVEAL_GLOBAL_VARIABLES -#define HIDE_GLOBAL_VARIABLES() -#define REVEAL_GLOBAL_VARIABLES() - -/* php_roxen_request is per-request object storage */ - -typedef struct -{ - struct mapping *request_data; - struct object *my_fd_obj; - int my_fd; - char *filename; -} php_roxen_request; - - -/* Defines to get to the data supplied when the script is started. */ - -#ifdef ROXEN_USE_ZTS - -/* ZTS does work now, but it seems like it's faster using the "serialization" - * method I previously used. Thus it's not used unless ROXEN_USE_ZTS is defined. - */ - -/* Per thread storage area id... */ -static int roxen_globals_id; - -# define GET_THIS() php_roxen_request *_request = ts_resource(roxen_globals_id) -# define THIS _request -#else -static php_roxen_request *current_request = NULL; - -# define GET_THIS() current_request = ((php_roxen_request *)Pike_fp->current_storage) -# define THIS current_request -#endif - -/* File descriptor integer. Used to write directly to the FD without - * passing Pike - */ -#define MY_FD (THIS->my_fd) - -/* FD object. Really a PHPScript object from Pike which implements a couple - * of functions to handle headers, writing and buffering. - */ -#define MY_FD_OBJ ((struct object *)(THIS->my_fd_obj)) - -/* Mapping with data supplied from the calling Roxen module. Contains - * a mapping with headers, an FD object etc. - */ -#define REQUEST_DATA ((struct mapping *)(THIS->request_data)) - - -#if defined(_REENTRANT) && !defined(ROXEN_USE_ZTS) -/* Lock used to serialize the PHP execution. If ROXEN_USE_ZTS is defined, we - * are using the PHP thread safe mechanism instead. - */ -static PIKE_MUTEX_T roxen_php_execution_lock; -# define PHP_INIT_LOCK() mt_init(&roxen_php_execution_lock) -# define PHP_LOCK(X) THREADS_ALLOW();mt_lock(&roxen_php_execution_lock);THREADS_DISALLOW() -# define PHP_UNLOCK(X) mt_unlock(&roxen_php_execution_lock); -# define PHP_DESTROY() mt_destroy(&roxen_php_execution_lock) -#else /* !_REENTRANT */ -# define PHP_INIT_LOCK() -# define PHP_LOCK(X) -# define PHP_UNLOCK(X) -# define PHP_DESTROY() -#endif /* _REENTRANT */ - -extern int fd_from_object(struct object *o); -static unsigned char roxen_php_initialized; - -/* This allows calling of pike functions from the PHP callbacks, - * which requires the Pike interpreter to be locked. - */ -#define THREAD_SAFE_RUN(COMMAND, what) do {\ - struct thread_state *state;\ - if((state = thread_state_for_id(th_self()))!=NULL) {\ - if(!state->swapped) {\ - COMMAND;\ - } else {\ - mt_lock(&interpreter_lock);\ - SWAP_IN_THREAD(state);\ - COMMAND;\ - SWAP_OUT_THREAD(state);\ - mt_unlock(&interpreter_lock);\ - }\ - }\ -} while(0) - -struct program *php_program; - - -/* To avoid executing a PHP script from a PHP callback, which would - * create a deadlock, a global thread id is used. If the thread calling the - * php-script is the same as the current thread, it fails. - */ -static int current_thread = -1; - - -/* Low level header lookup. Basically looks for the named header in the mapping - * headers in the supplied options mapping. - */ - -static INLINE struct svalue *lookup_header(char *headername) -{ - struct svalue *headers, *value; - struct pike_string *sind; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(!headers || headers->type != PIKE_T_MAPPING) return NULL; - sind = make_shared_string(headername); - value = low_mapping_string_lookup(headers->u.mapping, sind); - free_string(sind); - if(!value) return NULL; - return value; -} - -/* Lookup a header in the mapping and return the value as a string, or - * return the default if it's missing - */ -INLINE static char *lookup_string_header(char *headername, char *default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_STRING) - return default_value; - return head->u.string->str; -} - -/* Lookup a header in the mapping and return the value as if it's an integer - * and otherwise return the default. - */ -INLINE static int lookup_integer_header(char *headername, int default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_INT) - return default_value; - return head->u.integer; -} - -/* - * php_roxen_low_ub_write() writes data to the client connection. Might be - * rewritten to do more direct IO to save CPU and the need to lock the * - * interpreter for better threading. - */ - -static int -php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { - int sent_bytes = 0; - struct pike_string *to_write = NULL; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - to_write = make_shared_binary_string(str, str_length); - push_string(to_write); - safe_apply(MY_FD_OBJ, "write", 1); - if(Pike_sp[-1].type == PIKE_T_INT) - sent_bytes = Pike_sp[-1].u.integer; - pop_stack(); - if(sent_bytes != str_length) { - /* This means the connection is closed. Dead. Gone. *sniff* */ - php_handle_aborted_connection(); - } - return sent_bytes; -} - -/* - * php_roxen_sapi_ub_write() calls php_roxen_low_ub_write in a Pike thread - * safe manner. - */ - -static int -php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - int sent_bytes = 0, fd = MY_FD; - if(fd) - { - for(sent_bytes=0;sent_bytes < str_length;) - { - int written; - written = fd_write(fd, str + sent_bytes, str_length - sent_bytes); - if(written < 0) - { - switch(errno) - { - default: - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return sent_bytes; - case EINTR: - case EWOULDBLOCK: - continue; - } - - } else { - sent_bytes += written; - } - } - } else { - THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC), - "write"); - } - return sent_bytes; -} - -/* php_roxen_set_header() sets a header in the header mapping. Called in a - * thread safe manner from php_roxen_sapi_header_handler. - */ -static void php_roxen_set_header(char *header_name, char *value, char *p) -{ - struct svalue hsval; - struct pike_string *hval, *ind, *hind; - struct mapping *headermap; - struct svalue *s_headermap; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - hval = make_shared_string(value); - ind = make_shared_string(" _headers"); - hind = make_shared_binary_string(header_name, - (int)(p - header_name)); - - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - if(!s_headermap) - { - struct svalue mappie; - mappie.type = PIKE_T_MAPPING; - headermap = allocate_mapping(1); - mappie.u.mapping = headermap; - mapping_string_insert(REQUEST_DATA, ind, &mappie); - free_mapping(headermap); - } else - headermap = s_headermap->u.mapping; - - hsval.type = PIKE_T_STRING; - hsval.u.string = hval; - mapping_string_insert(headermap, hind, &hsval); - - free_string(hval); - free_string(ind); - free_string(hind); -} - -/* - * php_roxen_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ -static int -php_roxen_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if(p) { - do { - header_content++; - } while(*header_content == ' '); - THREAD_SAFE_RUN(php_roxen_set_header(header_name, header_content, p), "header handler"); - } - sapi_free_header(sapi_header); - return 0; -} - -/* - * php_roxen_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -static int -php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - struct pike_string *ind; - struct svalue *s_headermap; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return SAPI_HEADER_SEND_FAILED; - } - ind = make_shared_string(" _headers"); - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - free_string(ind); - - push_int(SG(sapi_headers).http_response_code); - if(s_headermap && s_headermap->type == PIKE_T_MAPPING) - ref_push_mapping(s_headermap->u.mapping); - else - push_int(0); - safe_apply(MY_FD_OBJ, "send_headers", 2); - pop_stack(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int res = 0; - THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); - return res; -} - -/* - * php_roxen_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes) -{ - uint total_read = 0; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - TSRMLS_FETCH(); - - if(!MY_FD_OBJ->prog) - { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - push_int(count_bytes); - safe_apply(MY_FD_OBJ, "read_post", 1); - if(Pike_sp[-1].type == PIKE_T_STRING) { - MEMCPY(buf, Pike_sp[-1].u.string->str, - (total_read = Pike_sp[-1].u.string->len)); - buf[total_read] = '\0'; - } else - total_read = 0; - pop_stack(); - return total_read; -} - -static int -php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post"); - return total_read; -} - -/* - * php_roxen_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char * -php_roxen_sapi_read_cookies(TSRMLS_D) -{ - char *cookies; - cookies = lookup_string_header("HTTP_COOKIE", NULL); - return cookies; -} - -static void php_info_roxen(ZEND_MODULE_INFO_FUNC_ARGS) -{ - /* char buf[512]; */ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - */ - php_info_print_table_end(); -} - -static zend_module_entry php_roxen_module = { - STANDARD_MODULE_HEADER, - "Roxen", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_roxen, - NULL, - STANDARD_MODULE_PROPERTIES -}; - -static int php_roxen_startup(sapi_module_struct *sapi_module) -{ - if(php_module_startup(sapi_module, &php_roxen_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -/* this structure is static (as in "it does not change") */ - -static sapi_module_struct roxen_sapi_module = { - "roxen", - "Roxen", - php_roxen_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - php_roxen_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - php_roxen_sapi_header_handler, /* header handler */ - php_roxen_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - php_roxen_sapi_read_post, /* read POST data */ - php_roxen_sapi_read_cookies, /* read Cookies */ - NULL, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_roxen_hash_environment() populates the php script environment - * with a number of variables. HTTP_* variables are created for - * the HTTP header data, so that a script can access these. - */ -#define ADD_STRING(name) \ - MAKE_STD_ZVAL(pval); \ - pval->type = IS_STRING; \ - pval->value.str.len = strlen(buf); \ - pval->value.str.val = estrndup(buf, pval->value.str.len); \ - zend_hash_update(&EG(symbol_table), name, sizeof(name), \ - &pval, sizeof(zval *), NULL) - -static void -php_roxen_hash_environment(TSRMLS_D) -{ - int i; - char buf[512]; - zval *pval; - struct svalue *headers; - struct pike_string *sind; - struct array *indices; - struct svalue *ind, *val; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(headers && headers->type == PIKE_T_MAPPING) { - indices = mapping_indices(headers->u.mapping); - for(i = 0; i < indices->size; i++) { - ind = &indices->item[i]; - val = low_mapping_lookup(headers->u.mapping, ind); - if(ind && ind->type == PIKE_T_STRING && - val && val->type == PIKE_T_STRING) { - int buf_len; - buf_len = MIN(511, ind->u.string->len); - strncpy(buf, ind->u.string->str, buf_len); - buf[buf_len] = '\0'; /* Terminate correctly */ - MAKE_STD_ZVAL(pval); - pval->type = IS_STRING; - pval->value.str.len = val->u.string->len; - pval->value.str.val = estrndup(val->u.string->str, pval->value.str.len); - - zend_hash_update(&EG(symbol_table), buf, buf_len + 1, &pval, sizeof(zval *), NULL); - } - } - free_array(indices); - } - - /* - MAKE_STD_ZVAL(pval); - pval->type = IS_LONG; - pval->value.lval = Ns_InfoBootTime(); - zend_hash_update(&EG(symbol_table), "SERVER_BOOTTIME", sizeof("SERVER_BOOTTIME"), &pval, sizeof(zval *), NULL); - */ -} - -/* - * php_roxen_module_main() is called by the per-request handler and - * "executes" the script - */ - -static int php_roxen_module_main(TSRMLS_D) -{ - int res, len; - char *dir; - zend_file_handle file_handle; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = THIS->filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - THREADS_ALLOW(); - res = php_request_startup(TSRMLS_C); - THREADS_DISALLOW(); - if(res == FAILURE) { - return 0; - } - php_roxen_hash_environment(TSRMLS_C); - THREADS_ALLOW(); - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - THREADS_DISALLOW(); - return 1; -} - -/* - * The php_roxen_request_handler() is called per request and handles - * everything for one request. - */ - -void f_php_roxen_request_handler(INT32 args) -{ - struct object *my_fd_obj; - struct mapping *request_data; - struct svalue *done_callback, *raw_fd; - struct pike_string *script, *ind; - int status = 1; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - TSRMLS_FETCH(); - - if(current_thread == th_self()) - php_error(E_WARNING, "PHP5.Interpreter->run: Tried to run a PHP-script from a PHP " - "callback!"); - get_all_args("PHP5.Interpreter->run", args, "%S%m%O%*", &script, - &request_data, &my_fd_obj, &done_callback); - if(done_callback->type != PIKE_T_FUNCTION) - php_error(E_WARNING, "PHP5.Interpreter->run: Bad argument 4, expected function.\n"); - PHP_LOCK(THIS); /* Need to lock here or reusing the same object might cause - * problems in changing stuff in that object */ -#ifndef ROXEN_USE_ZTS - GET_THIS(); -#endif - THIS->request_data = request_data; - THIS->my_fd_obj = my_fd_obj; - THIS->filename = script->str; - current_thread = th_self(); - SG(request_info).query_string = lookup_string_header("QUERY_STRING", 0); - SG(server_context) = (void *)1; /* avoid server_context == NULL */ - - /* path_translated is apparently the absolute path to the file, not - the translated PATH_INFO - */ - SG(request_info).path_translated = - lookup_string_header("SCRIPT_FILENAME", NULL); - SG(request_info).request_uri = lookup_string_header("DOCUMENT_URI", NULL); - if(!SG(request_info).request_uri) - SG(request_info).request_uri = lookup_string_header("SCRIPT_NAME", NULL); - SG(request_info).request_method = lookup_string_header("REQUEST_METHOD", "GET"); - SG(request_info).content_length = lookup_integer_header("HTTP_CONTENT_LENGTH", 0); - SG(request_info).content_type = lookup_string_header("HTTP_CONTENT_TYPE", NULL); - SG(sapi_headers).http_response_code = 200; - - /* FIXME: Check for auth stuff needs to be fixed... */ - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - - ind = make_shared_binary_string("my_fd", 5); - raw_fd = low_mapping_string_lookup(THIS->request_data, ind); - if(raw_fd && raw_fd->type == PIKE_T_OBJECT) - { - int fd = fd_from_object(raw_fd->u.object); - if(fd == -1) - php_error(E_WARNING, "PHP5.Interpreter->run: my_fd object not open or not an FD.\n"); - THIS->my_fd = fd; - } else - THIS->my_fd = 0; - - status = php_roxen_module_main(TSRMLS_C); - current_thread = -1; - - apply_svalue(done_callback, 0); - pop_stack(); - pop_n_elems(args); - push_int(status); - PHP_UNLOCK(THIS); -} - - -/* Clear the object global struct */ -static void clear_struct(struct object *o) -{ - MEMSET(Pike_fp->current_storage, 0, sizeof(php_roxen_request)); -} - - -/* - * pike_module_init() is called by Pike once at startup - * - * This functions allocates basic structures - */ - -void pike_module_init( void ) -{ - if (!roxen_php_initialized) { -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#ifdef ROXEN_USE_ZTS - ts_allocate_id(&roxen_globals_id, sizeof(php_roxen_request), NULL, NULL); -#endif -#endif - sapi_startup(&roxen_sapi_module); - /*php_roxen_startup(&roxen_sapi_module); removed - should be called from SAPI activation*/ - roxen_php_initialized = 1; - PHP_INIT_LOCK(); - } - start_new_program(); /* Text */ - ADD_STORAGE(php_roxen_request); - set_init_callback(clear_struct); - pike_add_function("run", f_php_roxen_request_handler, - "function(string, mapping, object, function:int)", 0); - add_program_constant("Interpreter", (php_program = end_program()), 0); -} - -/* - * pike_module_exit() performs the last steps before the - * server exists. Shutdowns basic services and frees memory - */ - -void pike_module_exit(void) -{ - roxen_php_initialized = 0; - roxen_sapi_module.shutdown(&roxen_sapi_module); - if(php_program) free_program(php_program); -#ifdef ZTS - tsrm_shutdown(); -#endif - PHP_DESTROY(); -} -#endif diff --git a/sapi/tests/test001.phpt b/sapi/tests/test001.phpt deleted file mode 100644 index a964393fd9178..0000000000000 --- a/sapi/tests/test001.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -IIS style CGI missing SCRIPT_FILENAME ---DESCRIPTION-- -This would be similar to what IIS produces for a simple query. ---ENV-- -return << ---EXPECT-- -HELLO \ No newline at end of file diff --git a/sapi/tests/test002.phpt b/sapi/tests/test002.phpt deleted file mode 100644 index 42ade3d96b5fc..0000000000000 --- a/sapi/tests/test002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Apache style CGI ---DESCRIPTION-- -Apache likes to set SCRIPT_FILENAME to the php executable -if you use ScriptAlias configurations, and the proper -path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked, -but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias -of the executable. ---ENV-- -return <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -HELLO \ No newline at end of file diff --git a/sapi/tests/test003.phpt b/sapi/tests/test003.phpt deleted file mode 100644 index 522d78db4173c..0000000000000 --- a/sapi/tests/test003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -IIS style CGI missing SCRIPT_FILENAME, has PATH_INFO ---DESCRIPTION-- -This would be similar to what IIS produces for a simple query -that also has PATH_INFO. ---REQUEST-- -return << ---EXPECT-- -/path/info \ No newline at end of file diff --git a/sapi/tests/test004.phpt b/sapi/tests/test004.phpt deleted file mode 100644 index dad0dd0eec0c7..0000000000000 --- a/sapi/tests/test004.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Apache style CGI with PATH_INFO ---DESCRIPTION-- -Apache likes to set SCRIPT_FILENAME to the php executable -if you use ScriptAlias configurations, and the proper -path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked, -but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias -of the executable. ---REQUEST-- -return <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -/path/info \ No newline at end of file diff --git a/sapi/tests/test005.phpt b/sapi/tests/test005.phpt deleted file mode 100644 index 7415b66a0a78f..0000000000000 --- a/sapi/tests/test005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -QUERY_STRING Security Bug ---DESCRIPTION-- -This bug was present in PHP 4.3.0 only. -A failure should print HELLO. ---REQUEST-- -return << ---EXPECTHEADERS-- -Status: 404 ---EXPECT-- -No input file specified. \ No newline at end of file diff --git a/sapi/tests/test006.phpt b/sapi/tests/test006.phpt deleted file mode 100644 index 45e37811ef71e..0000000000000 --- a/sapi/tests/test006.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Multipart Form POST Data ---HEADERS-- -return << ------------------------------240723202011929-- - ---FILE-- - ---EXPECTF-- -Array -( - [entry] => entry box - [password] => password box - [radio1] => test 1 - [checkbox1] => test 1 - [choices] => Choice 2 -) -Array -( - [file] => Array - ( - [name] => info.php - [type] => application/octet-stream - [tmp_name] => %s - [error] => 0 - [size] => 21 - ) - -) diff --git a/sapi/tests/test007.phpt b/sapi/tests/test007.phpt deleted file mode 100644 index 8c50e4b80fe1a..0000000000000 --- a/sapi/tests/test007.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Multipart Form POST Data, incorrect content length ---HEADERS-- -return << ------------------------------240723202011929-- - ---FILE-- - ---EXPECT-- diff --git a/sapi/thttpd/CREDITS b/sapi/thttpd/CREDITS deleted file mode 100644 index 8f02f36f4fb5a..0000000000000 --- a/sapi/thttpd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -thttpd -Sascha Schumann diff --git a/sapi/thttpd/README b/sapi/thttpd/README deleted file mode 100644 index 1e80a01956eeb..0000000000000 --- a/sapi/thttpd/README +++ /dev/null @@ -1,85 +0,0 @@ -README FOR THTTPD MODULE (by Sascha Schumann) -($Date$) - - This is a SAPI module for PHP 4.x supporting thttpd, the tiny, - turbo, throttling HTTP server by Jef Poskanzer. - - NOTE: All HTTP requests will be serialized. That means, one long running - script will block all other requests. Choose another web server, - if you want to execute arbitrarily long running scripts. - - The module contains a patch against version 2.21b of thttpd. The patch - fixes a number of bugs and adds some functionality: - - - HTTP/1.1 Persistent Connection/Pipeline Support - - PHP Scripting (**.php by default) - - Highlighting PHP Scripts (**.phps by default) - - Fast Accept Loop (unique to PHP) - - Periodic Connection Expiring (unique to PHP) - - Log to stdout (logfile=-) - - Fixes the Host: header vulnerability (affects vhosts only) - - Asynchronous request body handling (e.g. for POSTs) - - Accept filter for Linux - - Fix for non-blocking sending of thttpd-generated responses - - You can configure the filename extensions by creating a config file for - thttpd and setting these entries: - - phppat=PATTERN - phpspat=PATTERN - - The PATTERN has the same format as defined here: - - http://acme.com/software/thttpd/options.html#CGI_PATTERN - - "**.php" means: match any file ending in .php in any directory. - Setting the pattern from the command line is not supported. - - NOTE: This version supports *only* thttpd 2.21b, no prior or later - version. - - This is a functional and stable module (it runs a large application - like IMP 2.2.0 without any problems). Its original intention was to - demonstrate the ability of PHP to work in every web server environment. - -REQUIRED DOWNLOADS - - 1. thttpd 2.21b (2.20 or +2.22beta will _not_ work) - - Full Distribution: - http://www.acme.com/software/thttpd/thttpd-2.21b.tar.gz - - 2. PHP 4.x - - Download: - http://www.php.net/ - - Snapshots from CVS: - http://snaps.php.net/ - - -BUILD INSTRUCTIONS - - 1. Extract software packages - - $ gunzip -c thttpd-2.xx.tar.gz | tar xf - - $ gunzip -c php-*.tar.gz | tar xf - - - 2. Prepare PHP - - $ cd php-* - $ ./configure \ - --with-thttpd=../thttpd-2.xx \ - - $ make install - $ cd .. - - You can see the list of valid PHP options by executing - - $ ./configure --help - - 3. Configure, compile, install thttpd - - Now follow the thttpd instructions. The Makefile template of - thttpd was changed to automatically use the components - required by PHP. diff --git a/sapi/thttpd/config.m4 b/sapi/thttpd/config.m4 deleted file mode 100644 index ac5a2bfca28b1..0000000000000 --- a/sapi/thttpd/config.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_ARG_WITH(thttpd, -[ --with-thttpd=SRCDIR Build PHP as thttpd module],[ - if test ! -d $withval; then - AC_MSG_RESULT(thttpd directory does not exist ($withval)) - fi - - PHP_EXPAND_PATH($withval, THTTPD) - - if grep thttpd.2.21b $withval/version.h >/dev/null; then - patch="test -f $THTTPD/php_patched || \ - (cd $THTTPD && patch -p1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)" - - elif grep Premium $withval/version.h >/dev/null; then - patch= - else - AC_MSG_ERROR([This version only supports thttpd-2.21b and Premium thttpd]) - fi - PHP_TARGET_RDYNAMIC - INSTALL_IT="\ - echo 'PHP_LIBS = -L. -lphp5 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \ - echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $THTTPD/php_makefile; \ - echo 'PHP_CFLAGS = \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \ - rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp5.a; \ - \$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \ - \$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\ - $patch" - PHP_THTTPD="yes, using $THTTPD" - PHP_ADD_INCLUDE($THTTPD) - PHP_SELECT_SAPI(thttpd, static) -],[ - PHP_THTTPD=no -]) - -AC_MSG_CHECKING(for thttpd) -AC_MSG_RESULT($PHP_THTTPD) diff --git a/sapi/thttpd/php.sym b/sapi/thttpd/php.sym deleted file mode 100644 index 2214d3964dc12..0000000000000 --- a/sapi/thttpd/php.sym +++ /dev/null @@ -1,3 +0,0 @@ -thttpd_php_request -thttpd_php_init -thttpd_php_shutdown diff --git a/sapi/thttpd/php_thttpd.h b/sapi/thttpd/php_thttpd.h deleted file mode 100644 index 63b8a3591857e..0000000000000 --- a/sapi/thttpd/php_thttpd.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_THTTPD_H -#define PHP_THTTPD_H - -#include -#include -#include - -void thttpd_php_shutdown(void); -void thttpd_php_init(void); -off_t thttpd_php_request(httpd_conn *hc, int show_source); - -void thttpd_register_on_close(void (*)(int)); -void thttpd_closed_conn(int fd); -int thttpd_get_fd(void); -void thttpd_set_dont_close(void); - -#endif diff --git a/sapi/thttpd/stub.c b/sapi/thttpd/stub.c deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c deleted file mode 100644 index fe83c0d57b156..0000000000000 --- a/sapi/thttpd/thttpd.c +++ /dev/null @@ -1,771 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_thttpd.h" -#include "php_variables.h" -#include "version.h" -#include "php_ini.h" -#include "zend_highlight.h" - -#include "ext/standard/php_smart_str.h" - -#include -#include -#include -#include -#include - -#ifdef HAVE_GETNAMEINFO -#include -#include -#endif - -typedef struct { - httpd_conn *hc; - void (*on_close)(int); - - size_t unconsumed_length; - smart_str sbuf; - int seen_cl; - int seen_cn; -} php_thttpd_globals; - -#define PHP_SYS_CALL(x) do { x } while (n == -1 && errno == EINTR) - -#ifdef PREMIUM_THTTPD -# define do_keep_alive persistent -#endif - -#ifdef ZTS -static int thttpd_globals_id; -#define TG(v) TSRMG(thttpd_globals_id, php_thttpd_globals *, v) -#else -static php_thttpd_globals thttpd_globals; -#define TG(v) (thttpd_globals.v) -#endif - -static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - uint sent = 0; - - if (TG(sbuf).c != 0) { - smart_str_appendl_ex(&TG(sbuf), str, str_length, 1); - return str_length; - } - - while (str_length > 0) { - PHP_SYS_CALL(n = send(TG(hc)->conn_fd, str, str_length, 0);); - - if (n == -1) { - if (errno == EAGAIN) { - smart_str_appendl_ex(&TG(sbuf), str, str_length, 1); - - return sent + str_length; - } else - php_handle_aborted_connection(); - } - - TG(hc)->bytes_sent += n; - str += n; - sent += n; - str_length -= n; - } - - return sent; -} - -#define COMBINE_HEADERS 64 - -#if defined(IOV_MAX) -# if IOV_MAX - 64 <= 0 -# define SERIALIZE_HEADERS -# endif -#endif - -static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC) -{ - int n; - - assert(nvec <= IOV_MAX); - - if (TG(sbuf).c == 0) { - PHP_SYS_CALL(n = writev(TG(hc)->conn_fd, vec, nvec);); - - if (n == -1) { - if (errno == EAGAIN) { - n = 0; - } else { - php_handle_aborted_connection(); - } - } - - - TG(hc)->bytes_sent += n; - } else { - n = 0; - } - - if (n < len) { - int i; - - /* merge all unwritten data into sbuf */ - for (i = 0; i < nvec; vec++, i++) { - /* has this vector been written completely? */ - if (n >= vec->iov_len) { - /* yes, proceed */ - n -= vec->iov_len; - continue; - } - - if (n > 0) { - /* adjust vector */ - vec->iov_base = (char *) vec->iov_base + n; - vec->iov_len -= n; - n = 0; - } - - smart_str_appendl_ex(&TG(sbuf), vec->iov_base, vec->iov_len, 1); - } - } - - return 0; -} - -#ifdef SERIALIZE_HEADERS -# define ADD_VEC(str,l) smart_str_appendl(&vec_str, (str), (l)) -# define VEC_BASE() smart_str vec_str = {0} -# define VEC_FREE() smart_str_free(&vec_str) -#else -# define ADD_VEC(str,l) vec[n].iov_base=str;len += (vec[n].iov_len=l); n++ -# define VEC_BASE() struct iovec vec[COMBINE_HEADERS] -# define VEC_FREE() do {} while (0) -#endif - -#define ADD_VEC_S(str) ADD_VEC((str), sizeof(str)-1) - -#define CL_TOKEN "Content-length: " -#define CN_TOKEN "Connection: " -#define KA_DO "Connection: keep-alive\r\n" -#define KA_NO "Connection: close\r\n" -#define DEF_CT "Content-Type: text/html\r\n" - -static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char buf[1024], *p; - VEC_BASE(); - int n = 0; - zend_llist_position pos; - sapi_header_struct *h; - size_t len = 0; - - if (!SG(sapi_headers).http_status_line) { - ADD_VEC_S("HTTP/1.1 "); - p = smart_str_print_long(buf+sizeof(buf)-1, - SG(sapi_headers).http_response_code); - ADD_VEC(p, strlen(p)); - ADD_VEC_S(" HTTP\r\n"); - } else { - ADD_VEC(SG(sapi_headers).http_status_line, - strlen(SG(sapi_headers).http_status_line)); - ADD_VEC("\r\n", 2); - } - TG(hc)->status = SG(sapi_headers).http_response_code; - - if (SG(sapi_headers).send_default_content_type) { - ADD_VEC(DEF_CT, strlen(DEF_CT)); - } - - h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - - switch (h->header[0]) { - case 'c': case 'C': - if (!TG(seen_cl) && strncasecmp(h->header, CL_TOKEN, sizeof(CL_TOKEN)-1) == 0) { - TG(seen_cl) = 1; - } else if (!TG(seen_cn) && strncasecmp(h->header, CN_TOKEN, sizeof(CN_TOKEN)-1) == 0) { - TG(seen_cn) = 1; - } - } - - ADD_VEC(h->header, h->header_len); -#ifndef SERIALIZE_HEADERS - if (n >= COMBINE_HEADERS - 1) { - len = do_writev(vec, n, len TSRMLS_CC); - n = 0; - } -#endif - ADD_VEC("\r\n", 2); - - h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - - if (TG(seen_cl) && !TG(seen_cn) && TG(hc)->do_keep_alive) { - ADD_VEC(KA_DO, sizeof(KA_DO)-1); - } else { - TG(hc)->do_keep_alive = 0; - ADD_VEC(KA_NO, sizeof(KA_NO)-1); - } - - ADD_VEC("\r\n", 2); - -#ifdef SERIALIZE_HEADERS - sapi_thttpd_ub_write(vec_str.c, vec_str.len TSRMLS_CC); -#else - do_writev(vec, n, len TSRMLS_CC); -#endif - - VEC_FREE(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -/* to understand this, read cgi_interpose_input() in libhttpd.c */ -#define SIZEOF_UNCONSUMED_BYTES() (TG(hc)->read_idx - TG(hc)->checked_idx) -#define CONSUME_BYTES(n) do { TG(hc)->checked_idx += (n); } while (0) - - -static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - size_t read_bytes = 0; - - if (TG(unconsumed_length) > 0) { - read_bytes = MIN(TG(unconsumed_length), count_bytes); - memcpy(buffer, TG(hc)->read_buf + TG(hc)->checked_idx, read_bytes); - TG(unconsumed_length) -= read_bytes; - CONSUME_BYTES(read_bytes); - } - - return read_bytes; -} - -static char *sapi_thttpd_read_cookies(TSRMLS_D) -{ - return TG(hc)->cookie; -} - -#define BUF_SIZE 512 -#define ADD_STRING_EX(name,buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) -#define ADD_STRING(name) ADD_STRING_EX((name), buf) - -static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - char *p; - - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - if (TG(hc)->one_one) { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array TSRMLS_CC); - } else { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array TSRMLS_CC); - } - - p = httpd_ntoa(&TG(hc)->client_addr); - - ADD_STRING_EX("REMOTE_ADDR", p); - ADD_STRING_EX("REMOTE_HOST", p); - - ADD_STRING_EX("SERVER_PORT", - smart_str_print_long(buf + sizeof(buf) - 1, - TG(hc)->hs->port)); - - buf[0] = '/'; - memcpy(buf + 1, TG(hc)->pathinfo, strlen(TG(hc)->pathinfo) + 1); - ADD_STRING("PATH_INFO"); - - buf[0] = '/'; - memcpy(buf + 1, TG(hc)->origfilename, strlen(TG(hc)->origfilename) + 1); - ADD_STRING("SCRIPT_NAME"); - -#define CONDADD(name, field) \ - if (TG(hc)->field[0]) { \ - php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \ - } - - CONDADD(QUERY_STRING, query); - CONDADD(HTTP_HOST, hdrhost); - CONDADD(HTTP_REFERER, referer); - CONDADD(HTTP_USER_AGENT, useragent); - CONDADD(HTTP_ACCEPT, accept); - CONDADD(HTTP_ACCEPT_LANGUAGE, acceptl); - CONDADD(HTTP_ACCEPT_ENCODING, accepte); - CONDADD(HTTP_COOKIE, cookie); - CONDADD(CONTENT_TYPE, contenttype); - CONDADD(REMOTE_USER, remoteuser); - CONDADD(SERVER_PROTOCOL, protocol); - - if (TG(hc)->contentlength != -1) { - ADD_STRING_EX("CONTENT_LENGTH", - smart_str_print_long(buf + sizeof(buf) - 1, - TG(hc)->contentlength)); - } - - if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); -} - -static PHP_MINIT_FUNCTION(thttpd) -{ - return SUCCESS; -} - -static zend_module_entry php_thttpd_module = { - STANDARD_MODULE_HEADER, - "thttpd", - NULL, - PHP_MINIT(thttpd), - NULL, - NULL, - NULL, - NULL, /* info */ - NULL, - STANDARD_MODULE_PROPERTIES -}; - -static int php_thttpd_startup(sapi_module_struct *sapi_module) -{ -#if PHP_API_VERSION >= 20020918 - if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) { -#else - if (php_module_startup(sapi_module) == FAILURE - || zend_startup_module(&php_thttpd_module) == FAILURE) { -#endif - return FAILURE; - } - return SUCCESS; -} - -static int sapi_thttpd_get_fd(int *nfd TSRMLS_DC) -{ - if (nfd) *nfd = TG(hc)->conn_fd; - return SUCCESS; -} - -static sapi_module_struct thttpd_sapi_module = { - "thttpd", - "thttpd", - - php_thttpd_startup, - php_module_shutdown_wrapper, - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_thttpd_ub_write, - NULL, - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, - - NULL, - sapi_thttpd_send_headers, - NULL, - sapi_thttpd_read_post, - sapi_thttpd_read_cookies, - - sapi_thttpd_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - NULL, /* php.ini path override */ - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - NULL, - NULL, - NULL, - 0, - sapi_thttpd_get_fd -}; - -static void thttpd_module_main(int show_source TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - if (show_source) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - } - - php_request_shutdown(NULL); -} - -static void thttpd_request_ctor(TSRMLS_D) -{ - smart_str s = {0}; - - TG(seen_cl) = 0; - TG(seen_cn) = 0; - TG(sbuf).c = 0; - SG(request_info).query_string = TG(hc)->query?strdup(TG(hc)->query):NULL; - - smart_str_appends_ex(&s, TG(hc)->hs->cwd, 1); - smart_str_appends_ex(&s, TG(hc)->expnfilename, 1); - smart_str_0(&s); - SG(request_info).path_translated = s.c; - - s.c = NULL; - smart_str_appendc_ex(&s, '/', 1); - smart_str_appends_ex(&s, TG(hc)->origfilename, 1); - smart_str_0(&s); - SG(request_info).request_uri = s.c; - SG(request_info).request_method = httpd_method_str(TG(hc)->method); - if (TG(hc)->one_one) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(sapi_headers).http_response_code = 200; - if (TG(hc)->contenttype) - SG(request_info).content_type = strdup(TG(hc)->contenttype); - SG(request_info).content_length = TG(hc)->contentlength == -1 ? 0 - : TG(hc)->contentlength; - - TG(unconsumed_length) = SG(request_info).content_length; - - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); -} - -static void thttpd_request_dtor(TSRMLS_D) -{ - smart_str_free_ex(&TG(sbuf), 1); - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); - free(SG(request_info).path_translated); - if (SG(request_info).content_type) - free(SG(request_info).content_type); -} - -#ifdef ZTS - -#ifdef TSRM_ST -#define thread_create_simple_detached(n) st_thread_create(n, NULL, 0, 0) -#define thread_usleep(n) st_usleep(n) -#define thread_exit() st_thread_exit(NULL) -/* No preemption, simple operations are safe */ -#define thread_atomic_inc(n) (++n) -#define thread_atomic_dec(n) (--n) -#else -#error No thread primitives available -#endif - -/* We might want to replace this with a STAILQ */ -typedef struct qreq { - httpd_conn *hc; - struct qreq *next; -} qreq_t; - -static MUTEX_T qr_lock; -static qreq_t *queued_requests; -static qreq_t *last_qr; -static int nr_free_threads; -static int nr_threads; -static int max_threads = 50; - -#define HANDLE_STRINGS() { \ - HANDLE_STR(encodedurl); \ - HANDLE_STR(decodedurl); \ - HANDLE_STR(origfilename); \ - HANDLE_STR(expnfilename); \ - HANDLE_STR(pathinfo); \ - HANDLE_STR(query); \ - HANDLE_STR(referer); \ - HANDLE_STR(useragent); \ - HANDLE_STR(accept); \ - HANDLE_STR(accepte); \ - HANDLE_STR(acceptl); \ - HANDLE_STR(cookie); \ - HANDLE_STR(contenttype); \ - HANDLE_STR(authorization); \ - HANDLE_STR(remoteuser); \ - } - -static httpd_conn *duplicate_conn(httpd_conn *hc, httpd_conn *nhc) -{ - memcpy(nhc, hc, sizeof(*nhc)); - -#define HANDLE_STR(m) nhc->m = nhc->m ? strdup(nhc->m) : NULL - HANDLE_STRINGS(); -#undef HANDLE_STR - - return nhc; -} - -static void destroy_conn(httpd_conn *hc) -{ -#define HANDLE_STR(m) if (hc->m) free(hc->m) - HANDLE_STRINGS(); -#undef HANDLE_STR -} - -static httpd_conn *dequeue_request(void) -{ - httpd_conn *ret = NULL; - qreq_t *m; - - tsrm_mutex_lock(qr_lock); - if (queued_requests) { - m = queued_requests; - ret = m->hc; - if (!(queued_requests = m->next)) - last_qr = NULL; - free(m); - } - tsrm_mutex_unlock(qr_lock); - - return ret; -} - -static void *worker_thread(void *); - -static void queue_request(httpd_conn *hc) -{ - qreq_t *m; - httpd_conn *nhc; - - /* Mark as long-running request */ - hc->file_address = (char *) 1; - - /* - * We cannot synchronously revoke accesses to hc in the worker - * thread, so we need to pass a copy of hc to the worker thread. - */ - nhc = malloc(sizeof *nhc); - duplicate_conn(hc, nhc); - - /* Allocate request queue container */ - m = malloc(sizeof *m); - m->hc = nhc; - m->next = NULL; - - tsrm_mutex_lock(qr_lock); - /* Create new threads when reaching a certain threshhold */ - if (nr_threads < max_threads && nr_free_threads < 2) { - nr_threads++; /* protected by qr_lock */ - - thread_atomic_inc(nr_free_threads); - thread_create_simple_detached(worker_thread); - } - /* Insert container into request queue */ - if (queued_requests) - last_qr->next = m; - else - queued_requests = m; - last_qr = m; - tsrm_mutex_unlock(qr_lock); -} - -static off_t thttpd_real_php_request(httpd_conn *hc, int TSRMLS_DC); - -static void *worker_thread(void *dummy) -{ - int do_work = 50; - httpd_conn *hc; - - while (do_work) { - hc = dequeue_request(); - - if (!hc) { -/* do_work--; */ - thread_usleep(500000); - continue; - } -/* do_work = 50; */ - - thread_atomic_dec(nr_free_threads); - - thttpd_real_php_request(hc, 0 TSRMLS_CC); - shutdown(hc->conn_fd, 0); - destroy_conn(hc); - free(hc); - - thread_atomic_inc(nr_free_threads); - } - thread_atomic_dec(nr_free_threads); - thread_atomic_dec(nr_threads); - thread_exit(); -} - -static void remove_dead_conn(int fd) -{ - qreq_t *m, *prev = NULL; - - tsrm_mutex_lock(qr_lock); - m = queued_requests; - while (m) { - if (m->hc->conn_fd == fd) { - if (prev) - if (!(prev->next = m->next)) - last_qr = prev; - else - if (!(queued_requests = m->next)) - last_qr = NULL; - destroy_conn(m->hc); - free(m->hc); - free(m); - break; - } - prev = m; - m = m->next; - } - tsrm_mutex_unlock(qr_lock); -} - -#endif - -static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) -{ - TG(hc) = hc; - hc->bytes_sent = 0; - - if (hc->contentlength != -1) { - hc->should_linger = 1; - hc->do_keep_alive = 0; - } - - if (hc->contentlength != -1 - && SIZEOF_UNCONSUMED_BYTES() < hc->contentlength) { - hc->read_body_into_mem = 1; - return 0; - } - - thttpd_request_ctor(TSRMLS_C); - - thttpd_module_main(show_source TSRMLS_CC); - - /* disable kl, if no content-length was seen or Connection: was set */ - if (TG(seen_cl) == 0 || TG(seen_cn) == 1) { - TG(hc)->do_keep_alive = 0; - } - - if (TG(sbuf).c != 0) { - if (TG(hc)->response) - free(TG(hc)->response); - - TG(hc)->response = TG(sbuf).c; - TG(hc)->responselen = TG(sbuf).len; - TG(hc)->maxresponse = TG(sbuf).a; - - TG(sbuf).c = 0; - TG(sbuf).len = 0; - TG(sbuf).a = 0; - } - - thttpd_request_dtor(TSRMLS_C); - - return 0; -} - -off_t thttpd_php_request(httpd_conn *hc, int show_source) -{ -#ifdef ZTS - queue_request(hc); -#else - TSRMLS_FETCH(); - return thttpd_real_php_request(hc, show_source TSRMLS_CC); -#endif -} - -void thttpd_register_on_close(void (*arg)(int)) -{ - TSRMLS_FETCH(); - TG(on_close) = arg; -} - -void thttpd_closed_conn(int fd) -{ - TSRMLS_FETCH(); - if (TG(on_close)) TG(on_close)(fd); -} - -int thttpd_get_fd(void) -{ - TSRMLS_FETCH(); - return TG(hc)->conn_fd; -} - -void thttpd_set_dont_close(void) -{ - TSRMLS_FETCH(); -#ifndef PREMIUM_THTTPD - TG(hc)->file_address = (char *) 1; -#endif -} - - -void thttpd_php_init(void) -{ - char *ini; - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); - ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL); - qr_lock = tsrm_mutex_alloc(); - thttpd_register_on_close(remove_dead_conn); -#endif - - if ((ini = getenv("PHP_INI_PATH"))) { - thttpd_sapi_module.php_ini_path_override = ini; - } - - sapi_startup(&thttpd_sapi_module); - thttpd_sapi_module.startup(&thttpd_sapi_module); - - { - TSRMLS_FETCH(); - - SG(server_context) = (void *) 1; - } -} - -void thttpd_php_shutdown(void) -{ - TSRMLS_FETCH(); - - if (SG(server_context) != NULL) { - thttpd_sapi_module.shutdown(&thttpd_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - } -} diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch deleted file mode 100644 index 33de9214891a8..0000000000000 --- a/sapi/thttpd/thttpd_patch +++ /dev/null @@ -1,2377 +0,0 @@ -diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in ---- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Sat Sep 20 14:43:20 2003 -@@ -46,13 +46,15 @@ - - # You shouldn't need to edit anything below here. - -+include php_makefile -+ - CC = @CC@ - CCOPT = @V_CCOPT@ - DEFS = @DEFS@ --INCLS = -I. -+INCLS = -I. $(PHP_CFLAGS) - CFLAGS = $(CCOPT) $(DEFS) $(INCLS) --LDFLAGS = @LDFLAGS@ --LIBS = @LIBS@ -+LDFLAGS = @LDFLAGS@ $(PHP_LDFLAGS) -+LIBS = @LIBS@ $(PHP_LIBS) - NETLIBS = @V_NETLIBS@ - INSTALL = @INSTALL@ - -@@ -62,7 +64,7 @@ - @rm -f $@ - $(CC) $(CFLAGS) -c $*.c - --SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c -+SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c php_thttpd.c - - OBJ = $(SRC:.c=.o) @LIBOBJS@ - -@@ -77,7 +79,7 @@ - all: this subdirs - this: $(ALL) - --thttpd: $(OBJ) -+thttpd: $(OBJ) libphp5.a - @rm -f $@ - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(NETLIBS) - -diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h ---- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Sat Sep 20 14:43:20 2003 -@@ -82,6 +82,11 @@ - */ - #define IDLE_READ_TIMELIMIT 60 - -+/* CONFIGURE: How many seconds to allow for reading the subsequent requests -+** on a keep-alive connection. Should be simiar to LINGER_TIME -+*/ -+#define IDLE_KEEPALIVE_TIMELIMIT 2 -+ - /* CONFIGURE: How many seconds before an idle connection gets closed. - */ - #define IDLE_SEND_TIMELIMIT 300 -@@ -316,7 +321,7 @@ - /* CONFIGURE: A list of index filenames to check. The files are searched - ** for in this order. - */ --#define INDEX_NAMES "index.html", "index.htm", "Default.htm", "index.cgi" -+#define INDEX_NAMES "index.php", "index.html", "index.htm", "Default.htm", "index.cgi" - - /* CONFIGURE: If this is defined then thttpd will automatically generate - ** index pages for directories that don't have an explicit index file. -diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure ---- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001 -+++ thttpd-2.21b-cool/configure Sat Sep 20 14:43:20 2003 -@@ -1021,7 +1021,7 @@ - fi - echo "$ac_t""$CPP" 1>&6 - --for ac_hdr in fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h -+for ac_hdr in fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h netinet/tcp.h - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in ---- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001 -+++ thttpd-2.21b-cool/configure.in Sat Sep 20 14:43:20 2003 -@@ -64,7 +64,7 @@ - AC_MSG_RESULT(no) - fi - --AC_CHECK_HEADERS(fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h) -+AC_CHECK_HEADERS(fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h netinet/tcp.h) - AC_HEADER_TIME - AC_HEADER_DIRENT - -diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c ---- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.c Sat Sep 20 14:43:20 2003 -@@ -419,6 +419,7 @@ - if ( pollfds == (struct pollfd*) 0 || poll_fdidx == (int*) 0 || - poll_rfdidx == (int*) 0 ) - return -1; -+ memset(pollfds, 0, sizeof(struct pollfd) * nfiles); - return 0; - } - -@@ -460,7 +461,7 @@ - - ridx = 0; - for ( i = 0; i < npollfds; ++i ) -- if ( pollfds[i].revents & ( POLLIN | POLLOUT ) ) -+ if ( pollfds[i].revents & ( POLLIN | POLLOUT | POLLERR | POLLHUP | POLLNVAL ) ) - poll_rfdidx[ridx++] = pollfds[i].fd; - - return r; -@@ -472,8 +473,8 @@ - { - switch ( fd_rw[fd] ) - { -- case FDW_READ: return pollfds[poll_fdidx[fd]].revents & POLLIN; -- case FDW_WRITE: return pollfds[poll_fdidx[fd]].revents & POLLOUT; -+ case FDW_READ: return pollfds[poll_fdidx[fd]].revents & ( POLLIN | POLLERR | POLLHUP | POLLNVAL ); -+ case FDW_WRITE: return pollfds[poll_fdidx[fd]].revents & ( POLLOUT | POLLERR | POLLHUP | POLLNVAL ); - default: return 0; - } - } -diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c ---- thttpd-2.21b/libhttpd.c Tue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Sat Sep 20 14:43:29 2003 -@@ -56,6 +56,10 @@ - #include - #include - -+#ifdef HAVE_NETINET_TCP_H -+#include -+#endif -+ - #ifdef HAVE_OSRELDATE_H - #include - #endif /* HAVE_OSRELDATE_H */ -@@ -85,6 +89,12 @@ - #include "match.h" - #include "tdate_parse.h" - -+#include "php_thttpd.h" -+ -+#ifdef __CYGWIN__ -+# define timezone _timezone -+#endif -+ - #ifndef STDIN_FILENO - #define STDIN_FILENO 0 - #endif -@@ -111,7 +121,7 @@ - static int initialize_listen_socket( httpd_sockaddr* saP ); - static void unlisten( httpd_server* hs ); - static void add_response( httpd_conn* hc, char* str ); --static void send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod ); -+static void send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod, const char *, size_t ); - static void send_response( httpd_conn* hc, int status, char* title, char* extraheads, char* form, char* arg ); - static void send_response_tail( httpd_conn* hc ); - static void defang( char* str, char* dfstr, int dfsize ); -@@ -242,6 +252,10 @@ - free( (void*) hs->cwd ); - if ( hs->cgi_pattern != (char*) 0 ) - free( (void*) hs->cgi_pattern ); -+ if ( hs->php_pattern != (char*) 0 ) -+ free( (void*) hs->php_pattern ); -+ if ( hs->phps_pattern != (char*) 0 ) -+ free( (void*) hs->phps_pattern ); - if ( hs->charset != (char*) 0 ) - free( (void*) hs->charset ); - if ( hs->url_pattern != (char*) 0 ) -@@ -249,6 +263,7 @@ - if ( hs->local_pattern != (char*) 0 ) - free( (void*) hs->local_pattern ); - free( (void*) hs ); -+ thttpd_php_shutdown(); - } - - -@@ -257,7 +272,8 @@ - char* hostname, httpd_sockaddr* sa4P, httpd_sockaddr* sa6P, int port, - char* cgi_pattern, char* charset, char* cwd, int no_log, FILE* logfp, - int no_symlink, int vhost, int global_passwd, char* url_pattern, -- char* local_pattern, int no_empty_referers ) -+ char* local_pattern, int no_empty_referers, char* php_pattern, -+ char* phps_pattern ) - { - httpd_server* hs; - static char ghnbuf[256]; -@@ -312,6 +328,8 @@ - } - - hs->port = port; -+ hs->php_pattern = strdup(php_pattern); -+ hs->phps_pattern = strdup(phps_pattern); - if ( cgi_pattern == (char*) 0 ) - hs->cgi_pattern = (char*) 0; - else -@@ -329,7 +347,7 @@ - while ( ( cp = strstr( hs->cgi_pattern, "|/" ) ) != (char*) 0 ) - (void) strcpy( cp + 1, cp + 2 ); - } -- hs->charset = strdup( charset ); -+ hs->charset = strdup( charset ); - hs->cwd = strdup( cwd ); - if ( hs->cwd == (char*) 0 ) - { -@@ -385,6 +403,8 @@ - return (httpd_server*) 0; - } - -+ thttpd_php_init(); -+ - /* Done initializing. */ - if ( hs->binding_hostname == (char*) 0 ) - syslog( LOG_INFO, "%.80s starting on port %d", SERVER_SOFTWARE, hs->port ); -@@ -418,6 +438,11 @@ - } - (void) fcntl( listen_fd, F_SETFD, 1 ); - -+#if defined(TCP_DEFER_ACCEPT) && defined(SOL_TCP) -+ on = 30; /* give clients 30s to send first data packet */ -+ setsockopt(listen_fd, SOL_TCP, TCP_DEFER_ACCEPT, &on, sizeof(on)); -+#endif -+ - /* Allow reuse of local addresses. */ - on = 1; - if ( setsockopt( -@@ -582,6 +607,9 @@ - /* And send it, if necessary. */ - if ( hc->responselen > 0 ) - { -+/* -+printf("**RESPONSE [%d]** len = %d\n%*.*s\n", hc->conn_fd, hc->responselen, hc->responselen, hc->responselen, hc->response); -+*/ - (void) write( hc->conn_fd, hc->response, hc->responselen ); - hc->responselen = 0; - } -@@ -619,18 +647,22 @@ - } - } - -+extern time_t httpd_time_now; -+extern char httpd_now_buf[]; -+ -+#define SMART_STR_USE_REALLOC -+ -+#include "ext/standard/php_smart_str.h" - - static void --send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod ) -+send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod, const char *last_modified, size_t last_modified_len) - { -- time_t now; - const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; -- char nowbuf[100]; - char modbuf[100]; -- char fixed_type[500]; -- char buf[1000]; - int partial_content; -- -+ smart_str s = {0}; -+ int type_len; -+ - hc->status = status; - hc->bytes_to_send = length; - if ( hc->mime_flag ) -@@ -649,41 +681,89 @@ - else - partial_content = 0; - -- now = time( (time_t*) 0 ); - if ( mod == (time_t) 0 ) -- mod = now; -- (void) strftime( nowbuf, sizeof(nowbuf), rfc1123fmt, gmtime( &now ) ); -- (void) strftime( modbuf, sizeof(modbuf), rfc1123fmt, gmtime( &mod ) ); -- (void) my_snprintf( -- fixed_type, sizeof(fixed_type), type, hc->hs->charset ); -- (void) my_snprintf( buf, sizeof(buf), -- "%.20s %d %s\r\nServer: %s\r\nContent-Type: %s\r\nDate: %s\r\nLast-Modified: %s\r\nAccept-Ranges: bytes\r\nConnection: close\r\n", -- hc->protocol, status, title, EXPOSED_SERVER_SOFTWARE, fixed_type, -- nowbuf, modbuf ); -- add_response( hc, buf ); -+ mod = httpd_time_now; -+ -+ if (last_modified == 0) { -+ (void) strftime( modbuf, sizeof(modbuf), rfc1123fmt, gmtime( &mod ) ); -+ last_modified = modbuf; -+ last_modified_len = strlen(modbuf); -+ } -+ -+ type_len = strlen(type); -+ -+ if (hc->response) { -+ s.c = hc->response; -+ s.len = 0; -+ s.a = hc->maxresponse; -+ hc->response = 0; -+ hc->maxresponse = 0; -+ } -+ -+ smart_str_appends(&s, "HTTP/1.1 "); -+ smart_str_append_long(&s, status); -+ smart_str_appends(&s, " HTTP\r\nServer: " EXPOSED_SERVER_SOFTWARE "\r\n" -+ "Content-Type: "); -+ -+ if (type[type_len-2] == '%' && type[type_len-1] == 's') { -+ smart_str_appendl(&s, type, type_len - 2); -+ smart_str_appends(&s, hc->hs->charset); -+ } else { -+ smart_str_appendl(&s, type, type_len); -+ } -+ -+ -+ smart_str_appends(&s, "\r\nDate: "); -+ smart_str_appends(&s, httpd_now_buf); -+ smart_str_appends(&s, "\r\nLast-Modified: "); -+ smart_str_appendl(&s, last_modified, last_modified_len); -+ smart_str_appends(&s, "\r\nAccept-Ranges: bytes\r\n"); -+ - if ( encodings[0] != '\0' ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Encoding: %s\r\n", encodings ); -- add_response( hc, buf ); -+ smart_str_appends(&s, "Content-Encoding: "); -+ smart_str_appends(&s, encodings); -+ smart_str_appends(&s, "\r\n"); - } - if ( partial_content ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Range: bytes %ld-%ld/%d\r\nContent-Length: %ld\r\n", -- (long) hc->init_byte_loc, (long) hc->end_byte_loc, length, -- (long) ( hc->end_byte_loc - hc->init_byte_loc + 1 ) ); -- add_response( hc, buf ); -+ -+ smart_str_appends(&s, "Content-Range: bytes "); -+ smart_str_append_long(&s, hc->init_byte_loc); -+ smart_str_appendc(&s, '-'); -+ smart_str_append_long(&s, hc->end_byte_loc); -+ smart_str_appendc(&s, '/'); -+ smart_str_append_long(&s, length); -+ smart_str_appends(&s, "\r\nContent-Length: "); -+ smart_str_append_long(&s, hc->end_byte_loc - hc->init_byte_loc + 1); -+ smart_str_appends(&s, "\r\n"); -+ - } - else if ( length >= 0 ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Length: %d\r\n", length ); -- add_response( hc, buf ); -+ smart_str_appends(&s, "Content-Length: "); -+ smart_str_append_long(&s, length); -+ smart_str_appends(&s, "\r\n"); - } -+ else { -+ hc->do_keep_alive = 0; -+ } - if ( extraheads[0] != '\0' ) -- add_response( hc, extraheads ); -- add_response( hc, "\r\n" ); -+ smart_str_appends(&s, extraheads); -+ if (hc->do_keep_alive) { -+ smart_str_appends(&s, "Connection: keep-alive\r\n\r\n" ); -+ } else { -+ smart_str_appends(&s, "Connection: close\r\n\r\n" ); -+ } -+ smart_str_0(&s); -+ -+ if (hc->response) { -+ free(hc->response); -+ } -+ hc->response = s.c; -+ hc->maxresponse = s.a; -+ hc->responselen = s.len; -+ - } - } - -@@ -725,7 +805,7 @@ - { - char defanged_arg[1000], buf[2000]; - -- send_mime( hc, status, title, "", extraheads, "text/html", -1, 0 ); -+ send_mime( hc, status, title, "", extraheads, "text/html", -1, 0, 0, 0 ); - (void) my_snprintf( buf, sizeof(buf), - "%d %s\n

              %d %s

              \n", - status, title, status, title ); -@@ -764,7 +844,7 @@ - char* cp2; - - for ( cp1 = str, cp2 = dfstr; -- *cp1 != '\0' && cp2 - dfstr < dfsize - 1; -+ *cp1 != '\0' && cp2 - dfstr < dfsize - 5; - ++cp1, ++cp2 ) - { - switch ( *cp1 ) -@@ -834,7 +914,7 @@ - fp = fopen( filename, "r" ); - if ( fp == (FILE*) 0 ) - return 0; -- send_mime( hc, status, title, "", extraheads, "text/html", -1, 0 ); -+ send_mime( hc, status, title, "", extraheads, "text/html", -1, 0, 0, 0 ); - for (;;) - { - r = fread( buf, 1, sizeof(buf) - 1, fp ); -@@ -1336,6 +1416,9 @@ - if ( hc->tildemapped ) - return 1; - -+ if ( hc->hostname[0] == '.' || strchr( hc->hostname, '/' ) != (char*) 0 ) -+ return 0; -+ - /* Figure out the host directory. */ - #ifdef VHOST_DIRLEVELS - httpd_realloc_str( -@@ -1436,7 +1519,7 @@ - restlen = strlen( path ); - httpd_realloc_str( &rest, &maxrest, restlen ); - (void) strcpy( rest, path ); -- if ( rest[restlen - 1] == '/' ) -+ if ( restlen > 0 && rest[restlen - 1] == '/' ) - rest[--restlen] = '\0'; /* trim trailing slash */ - if ( ! tildemapped ) - /* Remove any leading slashes. */ -@@ -1603,6 +1686,70 @@ - - - int -+httpd_request_reset(httpd_conn* hc, int preserve_read_buf ) -+{ -+ if (!preserve_read_buf) { -+ hc->read_idx = 0; -+ hc->checked_idx = 0; -+ } -+ -+ if (hc->read_buf_is_mmap) { -+ hc->read_buf_is_mmap = 0; -+ munmap(hc->read_buf, hc->read_size); -+ hc->read_buf = NULL; -+ hc->read_size = 0; -+ httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ } -+ hc->checked_state = CHST_FIRSTWORD; -+ hc->method = METHOD_UNKNOWN; -+ hc->status = 0; -+ hc->bytes_to_send = 0; -+ hc->bytes_sent = 0; -+ hc->encodedurl = ""; -+ hc->decodedurl[0] = '\0'; -+ hc->protocol = "UNKNOWN"; -+ hc->origfilename[0] = '\0'; -+ hc->expnfilename[0] = '\0'; -+ hc->encodings[0] = '\0'; -+ hc->pathinfo[0] = '\0'; -+ hc->query[0] = '\0'; -+ hc->referer = ""; -+ hc->useragent = ""; -+ hc->accept[0] = '\0'; -+ hc->accepte[0] = '\0'; -+ hc->acceptl = ""; -+ hc->cookie = ""; -+ hc->contenttype = ""; -+ hc->reqhost[0] = '\0'; -+ hc->hdrhost = ""; -+ hc->hostdir[0] = '\0'; -+ hc->authorization = ""; -+ hc->remoteuser[0] = '\0'; -+ hc->response[0] = '\0'; -+#ifdef TILDE_MAP_2 -+ hc->altdir[0] = '\0'; -+#endif /* TILDE_MAP_2 */ -+ hc->responselen = 0; -+ hc->if_modified_since = (time_t) -1; -+ hc->range_if = (time_t) -1; -+ hc->contentlength = -1; -+ hc->type = ""; -+ hc->hostname = (char*) 0; -+ hc->mime_flag = 1; -+ hc->one_one = 0; -+ hc->got_range = 0; -+ hc->tildemapped = 0; -+ hc->init_byte_loc = 0; -+ hc->end_byte_loc = -1; -+ hc->keep_alive = 0; -+ hc->do_keep_alive = 0; -+ hc->should_linger = 0; -+ hc->file_address = (char*) 0; -+ hc->read_body_into_mem = 0; -+ return GC_OK; -+} -+ -+int - httpd_get_conn( httpd_server* hs, int listen_fd, httpd_conn* hc ) - { - httpd_sockaddr sa; -@@ -1612,6 +1759,7 @@ - { - hc->read_size = 0; - httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ hc->read_buf_is_mmap = 0; - hc->maxdecodedurl = - hc->maxorigfilename = hc->maxexpnfilename = hc->maxencodings = - hc->maxpathinfo = hc->maxquery = hc->maxaccept = -@@ -1631,12 +1779,19 @@ - httpd_realloc_str( &hc->reqhost, &hc->maxreqhost, 0 ); - httpd_realloc_str( &hc->hostdir, &hc->maxhostdir, 0 ); - httpd_realloc_str( &hc->remoteuser, &hc->maxremoteuser, 0 ); -- httpd_realloc_str( &hc->response, &hc->maxresponse, 0 ); -+ httpd_realloc_str( &hc->response, &hc->maxresponse, 350 ); - #ifdef TILDE_MAP_2 - httpd_realloc_str( &hc->altdir, &hc->maxaltdir, 0 ); - #endif /* TILDE_MAP_2 */ - hc->initialized = 1; - } -+ if (hc->read_buf_is_mmap) { -+ hc->read_buf_is_mmap = 0; -+ munmap(hc->read_buf, hc->read_size); -+ hc->read_buf = NULL; -+ hc->read_size = 0; -+ httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ } - - /* Accept the new connection. */ - sz = sizeof(sa); -@@ -1657,53 +1812,12 @@ - hc->hs = hs; - memset( &hc->client_addr, 0, sizeof(hc->client_addr) ); - memcpy( &hc->client_addr, &sa, sockaddr_len( &sa ) ); -- hc->read_idx = 0; -- hc->checked_idx = 0; -- hc->checked_state = CHST_FIRSTWORD; -- hc->method = METHOD_UNKNOWN; -- hc->status = 0; -- hc->bytes_to_send = 0; -- hc->bytes_sent = 0; -- hc->encodedurl = ""; -- hc->decodedurl[0] = '\0'; -- hc->protocol = "UNKNOWN"; -- hc->origfilename[0] = '\0'; -- hc->expnfilename[0] = '\0'; -- hc->encodings[0] = '\0'; -- hc->pathinfo[0] = '\0'; -- hc->query[0] = '\0'; -- hc->referer = ""; -- hc->useragent = ""; -- hc->accept[0] = '\0'; -- hc->accepte[0] = '\0'; -- hc->acceptl = ""; -- hc->cookie = ""; -- hc->contenttype = ""; -- hc->reqhost[0] = '\0'; -- hc->hdrhost = ""; -- hc->hostdir[0] = '\0'; -- hc->authorization = ""; -- hc->remoteuser[0] = '\0'; -- hc->response[0] = '\0'; --#ifdef TILDE_MAP_2 -- hc->altdir[0] = '\0'; --#endif /* TILDE_MAP_2 */ -- hc->responselen = 0; -- hc->if_modified_since = (time_t) -1; -- hc->range_if = (time_t) -1; -- hc->contentlength = -1; -- hc->type = ""; -- hc->hostname = (char*) 0; -- hc->mime_flag = 1; -- hc->one_one = 0; -- hc->got_range = 0; -- hc->tildemapped = 0; -- hc->init_byte_loc = 0; -- hc->end_byte_loc = -1; -- hc->keep_alive = 0; -- hc->should_linger = 0; -- hc->file_address = (char*) 0; -- return GC_OK; -+ -+/* -+printf("doing httpd_get_con(%d)\n", hc->conn_fd); -+*/ -+ -+ return httpd_request_reset(hc, 0); - } - - -@@ -1720,6 +1834,9 @@ - { - char c; - -+/* -+printf("**REQUEST [%d]**\n%*.*s\n", hc->conn_fd, hc->read_idx, hc->read_idx, hc->read_buf); -+*/ - for ( ; hc->checked_idx < hc->read_idx; ++hc->checked_idx ) - { - c = hc->read_buf[hc->checked_idx]; -@@ -1912,8 +2029,11 @@ - eol = strpbrk( protocol, " \t\n\r" ); - if ( eol != (char*) 0 ) - *eol = '\0'; -- if ( strcasecmp( protocol, "HTTP/1.0" ) != 0 ) -+ if ( strcasecmp( protocol, "HTTP/1.0" ) != 0 ) { - hc->one_one = 1; -+ hc->keep_alive = 1; -+ hc->do_keep_alive = 1; -+ } - } - } - /* Check for HTTP/1.1 absolute URL. */ -@@ -2129,6 +2249,7 @@ - cp = &buf[11]; - cp += strspn( cp, " \t" ); - if ( strcasecmp( cp, "keep-alive" ) == 0 ) -+ hc->do_keep_alive = 1; - hc->keep_alive = 1; - } - #ifdef LOG_UNKNOWN_HEADERS -@@ -2168,6 +2289,9 @@ - } - } - -+/* -+printf("one_one = %d keep_alive = %d\n", hc->one_one, hc->keep_alive); -+*/ - if ( hc->one_one ) - { - /* Check that HTTP/1.1 requests specify a host, as required. */ -@@ -2177,14 +2301,14 @@ - return -1; - } - -- /* If the client wants to do keep-alives, it might also be doing -- ** pipelining. There's no way for us to tell. Since we don't -- ** implement keep-alives yet, if we close such a connection there -- ** might be unread pipelined requests waiting. So, we have to -- ** do a lingering close. -+ /* -+ ** Disable keep alive support for bad browsers, -+ ** list taken from Apache 1.3.19 - */ -- if ( hc->keep_alive ) -- hc->should_linger = 1; -+ if ( hc->do_keep_alive && -+ ( strstr(hc->useragent, "Mozilla/2") != NULL || -+ strstr(hc->useragent, "MSIE 4.0b2;") != NULL)) -+ hc->do_keep_alive = 0; - } - - /* Ok, the request has been parsed. Now we resolve stuff that -@@ -2349,15 +2473,24 @@ - - - void --httpd_close_conn( httpd_conn* hc, struct timeval* nowP ) -- { -- make_log_entry( hc, nowP ); -+httpd_complete_request( httpd_conn* hc, struct timeval* nowP) -+{ -+ if (hc->method != METHOD_UNKNOWN) -+ make_log_entry( hc, nowP ); - -- if ( hc->file_address != (char*) 0 ) -+ if ( hc->file_address == (char*) 1 ) -+ { -+ thttpd_closed_conn(hc->conn_fd); -+ } else if ( hc->file_address != (char*) 0 ) - { - mmc_unmap( hc->file_address, &(hc->sb), nowP ); - hc->file_address = (char*) 0; - } -+ } -+ -+void -+httpd_close_conn( httpd_conn* hc, struct timeval* nowP ) -+{ - if ( hc->conn_fd >= 0 ) - { - (void) close( hc->conn_fd ); -@@ -2370,7 +2503,12 @@ - { - if ( hc->initialized ) - { -- free( (void*) hc->read_buf ); -+ -+ if ( hc->read_buf_is_mmap ) { -+ munmap( hc->read_buf, hc->read_size ); -+ } else { -+ free( (void*) hc->read_buf ); -+ } - free( (void*) hc->decodedurl ); - free( (void*) hc->origfilename ); - free( (void*) hc->expnfilename ); -@@ -2556,7 +2694,7 @@ - return -1; - } - -- send_mime( hc, 200, ok200title, "", "", "text/html", -1, hc->sb.st_mtime ); -+ send_mime( hc, 200, ok200title, "", "", "text/html", -1, hc->sb.st_mtime, 0, 0 ); - if ( hc->method == METHOD_HEAD ) - closedir( dirp ); - else if ( hc->method == METHOD_GET ) -@@ -3026,11 +3164,9 @@ - post_post_garbage_hack( httpd_conn* hc ) - { - char buf[2]; -- int r; - -- r = recv( hc->conn_fd, buf, sizeof(buf), MSG_PEEK ); -- if ( r > 0 ) -- (void) read( hc->conn_fd, buf, r ); -+ fcntl(hc->conn_fd, F_SETFL, O_NONBLOCK); -+ (void) read( hc->conn_fd, buf, 2 ); - } - - -@@ -3313,6 +3449,11 @@ - int r; - ClientData client_data; - -+ /* -+ ** We are not going to leave the socket open after a CGI... too hard -+ */ -+ hc->do_keep_alive = 0; -+ - if ( hc->method == METHOD_GET || hc->method == METHOD_POST ) - { - httpd_clear_ndelay( hc->conn_fd ); -@@ -3369,6 +3510,7 @@ - int expnlen, indxlen; - char* cp; - char* pi; -+ int nocache = 0; - - expnlen = strlen( hc->expnfilename ); - -@@ -3561,6 +3703,16 @@ - match( hc->hs->cgi_pattern, hc->expnfilename ) ) - return cgi( hc ); - -+ if ( hc->hs->php_pattern != (char*) 0 && -+ match( hc->hs->php_pattern, hc->expnfilename)) { -+ return thttpd_php_request( hc, 0 ); -+ } -+ -+ if ( hc->hs->phps_pattern != (char*) 0 && -+ match( hc->hs->phps_pattern, hc->expnfilename)) { -+ return thttpd_php_request( hc, 1 ); -+ } -+ - /* It's not CGI. If it's executable or there's pathinfo, someone's - ** trying to either serve or run a non-CGI file as CGI. Either case - ** is prohibited. -@@ -3594,32 +3746,46 @@ - hc->end_byte_loc = hc->sb.st_size - 1; - - figure_mime( hc ); -+ if ( strncmp(hc->decodedurl, "/nocache/", sizeof("/nocache/") - 1 ) == 0 ) -+ nocache = 1; - - if ( hc->method == METHOD_HEAD ) - { - send_mime( - hc, 200, ok200title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc->sb.st_mtime, 0, 0 ); - } -- else if ( hc->if_modified_since != (time_t) -1 && -+ else if ( !nocache && hc->if_modified_since != (time_t) -1 && - hc->if_modified_since >= hc->sb.st_mtime ) - { -- hc->method = METHOD_HEAD; - send_mime( -- hc, 304, err304title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc, 304, err304title, hc->encodings, "", hc->type, -1, -+ hc->sb.st_mtime, 0, 0 ); - } - else - { -- hc->file_address = mmc_map( hc->expnfilename, &(hc->sb), nowP ); -+ char *extraheads = ""; -+ char *lm; -+ size_t lml; -+ -+ if ( nocache ) -+ { -+ extraheads = "Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n" -+ "Cache-Control: no-store, no-cache, must-revalidate, " -+ "post-check=0, pre-check=0\r\n" -+ "Pragma: no-cache\r\n"; -+ } -+ -+ hc->file_address = mmc_map( hc->expnfilename, &(hc->sb), nowP, nocache, &lm, &lml ); - if ( hc->file_address == (char*) 0 ) - { - httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl ); - return -1; - } -+ - send_mime( -- hc, 200, ok200title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc, 200, ok200title, hc->encodings, extraheads, hc->type, hc->sb.st_size, -+ hc->sb.st_mtime, lm, lml ); - } - - return 0; -@@ -3638,6 +3804,9 @@ - return r; - } - -+#define smart_str_append_const(a,b) smart_str_appendl(a,b,sizeof(b)-1) -+ -+static smart_str bentries; - - static void - make_log_entry( httpd_conn* hc, struct timeval* nowP ) -@@ -3648,88 +3817,62 @@ - - if ( hc->hs->no_log ) - return; -- -- /* This is straight CERN Combined Log Format - the only tweak -- ** being that if we're using syslog() we leave out the date, because -- ** syslogd puts it in. The included syslogtocern script turns the -- ** results into true CERN format. -- */ -- - /* Format remote user. */ - if ( hc->remoteuser[0] != '\0' ) -- ru = hc->remoteuser; -+ ru = hc->remoteuser; - else -- ru = "-"; -+ ru = "-"; - /* If we're vhosting, prepend the hostname to the url. This is - ** a little weird, perhaps writing separate log files for - ** each vhost would make more sense. - */ -- if ( hc->hs->vhost && ! hc->tildemapped ) -- (void) my_snprintf( url, sizeof(url), -- "/%.100s%.200s", -- hc->hostname == (char*) 0 ? hc->hs->server_hostname : hc->hostname, -- hc->encodedurl ); -- else -- (void) my_snprintf( url, sizeof(url), -- "%.200s", hc->encodedurl ); -- /* Format the bytes. */ -- if ( (long) hc->bytes_sent >= 0 ) -- (void) my_snprintf( bytes, sizeof(bytes), -- "%ld", (long) hc->bytes_sent ); -- else -- (void) strcpy( bytes, "-" ); - - /* Logfile or syslog? */ - if ( hc->hs->logfp != (FILE*) 0 ) -- { -- time_t now; -- struct tm* t; -- const char* cernfmt_nozone = "%d/%b/%Y:%H:%M:%S"; -- char date_nozone[100]; -- int zone; -- char sign; -- char date[100]; -- -- /* Get the current time, if necessary. */ -- if ( nowP != (struct timeval*) 0 ) -- now = nowP->tv_sec; -- else -- now = time( (time_t*) 0 ); -- /* Format the time, forcing a numeric timezone (some log analyzers -- ** are stoooopid about this). -- */ -- t = localtime( &now ); -- (void) strftime( date_nozone, sizeof(date_nozone), cernfmt_nozone, t ); --#ifdef HAVE_TM_GMTOFF -- zone = t->tm_gmtoff / 60L; --#else -- zone = -timezone / 60L; -- /* Probably have to add something about daylight time here. */ --#endif -- if ( zone >= 0 ) -- sign = '+'; -- else -- { -- sign = '-'; -- zone = -zone; -- } -- zone = ( zone / 60 ) * 100 + zone % 60; -- (void) my_snprintf( date, sizeof(date), -- "%s %c%04d", date_nozone, sign, zone ); -- /* And write the log entry. */ -- (void) fprintf( hc->hs->logfp, -- "%.80s - %.80s [%s] \"%.80s %.300s %.80s\" %d %s \"%.200s\" \"%.80s\"\n", -- httpd_ntoa( &hc->client_addr ), ru, date, -- httpd_method_str( hc->method ), url, hc->protocol, -- hc->status, bytes, hc->referer, hc->useragent ); -- (void) fflush( hc->hs->logfp ); /* don't need to flush every time */ -- } -- else -- syslog( LOG_INFO, -- "%.80s - %.80s \"%.80s %.200s %.80s\" %d %s \"%.200s\" \"%.80s\"", -- httpd_ntoa( &hc->client_addr ), ru, -- httpd_method_str( hc->method ), url, hc->protocol, -- hc->status, bytes, hc->referer, hc->useragent ); -+ { -+ /* XXXXXXX */ -+ -+ smart_str_appends(&bentries, httpd_ntoa(&hc->client_addr)); -+ smart_str_append_const(&bentries, " - "); -+ smart_str_appends(&bentries, ru); -+ smart_str_append_const(&bentries, " ["); -+ smart_str_appendl(&bentries, hc->hs->log_date, hc->hs->log_date_len); -+ smart_str_append_const(&bentries, "] \""); -+ smart_str_appends(&bentries, httpd_method_str(hc->method)); -+ smart_str_appendc(&bentries, ' '); -+ -+ if (hc->hs->vhost && ! hc->tildemapped) { -+ smart_str_appendc(&bentries, '/'); -+ if (hc->hostname) -+ smart_str_appends(&bentries, hc->hostname); -+ else -+ smart_str_appends(&bentries, hc->hs->server_hostname); -+ } -+ smart_str_appends(&bentries, hc->encodedurl); -+ -+ smart_str_appendc(&bentries, ' '); -+ smart_str_appends(&bentries, hc->protocol); -+ smart_str_append_const(&bentries, "\" "); -+ smart_str_append_long(&bentries, hc->status); -+ if (hc->bytes_sent >= 0) { -+ smart_str_appendc(&bentries, ' '); -+ smart_str_append_long(&bentries, hc->bytes_sent); -+ smart_str_append_const(&bentries, " \""); -+ } else { -+ smart_str_append_const(&bentries, " - \""); -+ } -+ smart_str_appends(&bentries, hc->referer); -+ smart_str_append_const(&bentries, "\" \""); -+ smart_str_appends(&bentries, hc->useragent); -+ smart_str_append_const(&bentries, "\"\n"); -+ -+ if (bentries.len > 16384) { -+ int fd = fileno(hc->hs->logfp); -+ write(fd, bentries.c, bentries.len); -+ bentries.len = 0; -+ } -+ } -+ - } - - -@@ -3840,7 +3983,24 @@ - { - #ifdef HAVE_GETNAMEINFO - static char str[200]; -+ static smart_str httpd_ntoa_buf; -+ -+ if (saP->sa_in.sin_family == AF_INET) { -+ unsigned long n = ntohl(saP->sa_in.sin_addr.s_addr); - -+ httpd_ntoa_buf.len = 0; -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 24)); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 16) & 255); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 8) & 255); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 0) & 255); -+ smart_str_0(&httpd_ntoa_buf); -+ -+ return httpd_ntoa_buf.c; -+ } -+ - if ( getnameinfo( &saP->sa, sockaddr_len( saP ), str, sizeof(str), 0, 0, NI_NUMERICHOST ) != 0 ) - { - str[0] = '?'; -diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h ---- thttpd-2.21b/libhttpd.h Tue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Sat Sep 20 14:43:20 2003 -@@ -69,6 +69,8 @@ - char* server_hostname; - int port; - char* cgi_pattern; -+ char* php_pattern; -+ char* phps_pattern; - char* charset; - char* cwd; - int listen4_fd, listen6_fd; -@@ -80,6 +82,8 @@ - char* url_pattern; - char* local_pattern; - int no_empty_referers; -+ size_t log_date_len; -+ char log_date[100]; - } httpd_server; - - /* A connection. */ -@@ -88,6 +92,7 @@ - httpd_server* hs; - httpd_sockaddr client_addr; - char* read_buf; -+ char read_buf_is_mmap; - int read_size, read_idx, checked_idx; - int checked_state; - int method; -@@ -132,11 +137,12 @@ - int got_range; - int tildemapped; /* this connection got tilde-mapped */ - off_t init_byte_loc, end_byte_loc; -- int keep_alive; -+ int keep_alive, do_keep_alive; - int should_linger; - struct stat sb; - int conn_fd; - char* file_address; -+ char read_body_into_mem; - } httpd_conn; - - /* Methods. */ -@@ -168,7 +174,8 @@ - char* hostname, httpd_sockaddr* sa4P, httpd_sockaddr* sa6P, int port, - char* cgi_pattern, char* charset, char* cwd, int no_log, FILE* logfp, - int no_symlink, int vhost, int global_passwd, char* url_pattern, -- char* local_pattern, int no_empty_referers ); -+ char* local_pattern, int no_empty_referers, char* php_pattern, -+ char* phps_pattern ); - - /* Change the log file. */ - extern void httpd_set_logfp( httpd_server* hs, FILE* logfp ); -@@ -229,6 +236,8 @@ - ** If you don't have a current timeval handy just pass in 0. - */ - extern void httpd_close_conn( httpd_conn* hc, struct timeval* nowP ); -+void httpd_complete_request( httpd_conn* hc, struct timeval* nowP); -+int httpd_request_reset(httpd_conn* hc,int ); - - /* Call this to de-initialize a connection struct and *really* free the - ** mallocced strings. -diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt ---- thttpd-2.21b/mime_encodings.txt Wed May 10 03:22:28 2000 -+++ thttpd-2.21b-cool/mime_encodings.txt Sat Sep 20 14:43:20 2003 -@@ -3,6 +3,6 @@ - # A list of file extensions followed by the corresponding MIME encoding. - # Extensions not found in the table proceed to the mime_types table. - --Z x-compress --gz x-gzip -+Z compress -+gz gzip - uu x-uuencode -diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt ---- thttpd-2.21b/mime_types.txt Sat Apr 14 04:53:30 2001 -+++ thttpd-2.21b-cool/mime_types.txt Sat Sep 20 14:43:20 2003 -@@ -1,135 +1,138 @@ --# mime_types.txt --# --# A list of file extensions followed by the corresponding MIME type. --# Extensions not found in the table are returned as text/plain. -- --html text/html; charset=%s --htm text/html; charset=%s --txt text/plain; charset=%s --rtx text/richtext --etx text/x-setext --tsv text/tab-separated-values --css text/css --xml text/xml --dtd text/xml -- --gif image/gif --jpg image/jpeg --jpeg image/jpeg --jpe image/jpeg --jfif image/jpeg --tif image/tiff --tiff image/tiff --pbm image/x-portable-bitmap --pgm image/x-portable-graymap --ppm image/x-portable-pixmap --pnm image/x-portable-anymap --xbm image/x-xbitmap --xpm image/x-xpixmap --xwd image/x-xwindowdump --ief image/ief --png image/png -- --au audio/basic --snd audio/basic --aif audio/x-aiff --aiff audio/x-aiff --aifc audio/x-aiff --ra audio/x-pn-realaudio --ram audio/x-pn-realaudio --rm audio/x-pn-realaudio --rpm audio/x-pn-realaudio-plugin --wav audio/wav --mid audio/midi --midi audio/midi --kar audio/midi --mpga audio/mpeg --mp2 audio/mpeg --mp3 audio/mpeg -- --mpeg video/mpeg --mpg video/mpeg --mpe video/mpeg --qt video/quicktime --mov video/quicktime --avi video/x-msvideo --movie video/x-sgi-movie --mv video/x-sgi-movie --vx video/x-rad-screenplay -- --a application/octet-stream -+ez application/andrew-inset -+hqx application/mac-binhex40 -+cpt application/mac-compactpro -+doc application/msword - bin application/octet-stream -+dms application/octet-stream -+lha application/octet-stream -+lzh application/octet-stream - exe application/octet-stream --dump application/octet-stream --o application/octet-stream --class application/java --js application/x-javascript -+class application/octet-stream -+so application/octet-stream -+dll application/octet-stream -+oda application/oda -+pdf application/pdf - ai application/postscript - eps application/postscript - ps application/postscript --dir application/x-director -+smi application/smil -+smil application/smil -+mif application/vnd.mif -+xls application/vnd.ms-excel -+ppt application/vnd.ms-powerpoint -+wbxml application/vnd.wap.wbxml -+wmlc application/vnd.wap.wmlc -+wmlsc application/vnd.wap.wmlscriptc -+bcpio application/x-bcpio -+vcd application/x-cdlink -+pgn application/x-chess-pgn -+cpio application/x-cpio -+csh application/x-csh - dcr application/x-director -+dir application/x-director - dxr application/x-director --fgd application/x-director --aam application/x-authorware-map --aas application/x-authorware-seg --aab application/x-authorware-bin --fh4 image/x-freehand --fh7 image/x-freehand --fh5 image/x-freehand --fhc image/x-freehand --fh image/x-freehand --spl application/futuresplash --swf application/x-shockwave-flash - dvi application/x-dvi -+spl application/x-futuresplash - gtar application/x-gtar - hdf application/x-hdf --hqx application/mac-binhex40 --iv application/x-inventor -+js application/x-javascript -+skp application/x-koan -+skd application/x-koan -+skt application/x-koan -+skm application/x-koan - latex application/x-latex --man application/x-troff-man --me application/x-troff-me --mif application/x-mif --ms application/x-troff-ms --oda application/oda --pdf application/pdf --rtf application/rtf --bcpio application/x-bcpio --cpio application/x-cpio --sv4cpio application/x-sv4cpio --sv4crc application/x-sv4crc --sh application/x-shar -+nc application/x-netcdf -+cdf application/x-netcdf -+sh application/x-sh - shar application/x-shar -+swf application/x-shockwave-flash - sit application/x-stuffit -+sv4cpio application/x-sv4cpio -+sv4crc application/x-sv4crc - tar application/x-tar -+tcl application/x-tcl - tex application/x-tex --texi application/x-texinfo - texinfo application/x-texinfo -+texi application/x-texinfo -+t application/x-troff - tr application/x-troff - roff application/x-troff - man application/x-troff-man - me application/x-troff-me - ms application/x-troff-ms --zip application/x-zip-compressed --tsp application/dsptype --wsrc application/x-wais-source - ustar application/x-ustar --cdf application/x-netcdf --nc application/x-netcdf --doc application/msword --ppt application/powerpoint -- --crt application/x-x509-ca-cert --crl application/x-pkcs7-crl -- -+src application/x-wais-source -+xhtml application/xhtml+xml -+xht application/xhtml+xml -+zip application/zip -+au audio/basic -+snd audio/basic -+mid audio/midi -+midi audio/midi -+kar audio/midi -+mpga audio/mpeg -+mp2 audio/mpeg -+mp3 audio/mpeg -+aif audio/x-aiff -+aiff audio/x-aiff -+aifc audio/x-aiff -+m3u audio/x-mpegurl -+ram audio/x-pn-realaudio -+rm audio/x-pn-realaudio -+rpm audio/x-pn-realaudio-plugin -+ra audio/x-realaudio -+wav audio/x-wav -+pdb chemical/x-pdb -+xyz chemical/x-xyz -+bmp image/bmp -+gif image/gif -+ief image/ief -+jpeg image/jpeg -+jpg image/jpeg -+jpe image/jpeg -+png image/png -+tiff image/tiff -+tif image/tiff -+djvu image/vnd.djvu -+djv image/vnd.djvu -+wbmp image/vnd.wap.wbmp -+ras image/x-cmu-raster -+pnm image/x-portable-anymap -+pbm image/x-portable-bitmap -+pgm image/x-portable-graymap -+ppm image/x-portable-pixmap -+rgb image/x-rgb -+xbm image/x-xbitmap -+xpm image/x-xpixmap -+xwd image/x-xwindowdump -+igs model/iges -+iges model/iges -+msh model/mesh -+mesh model/mesh -+silo model/mesh - wrl model/vrml - vrml model/vrml --mime message/rfc822 -- --pac application/x-ns-proxy-autoconfig -- -+css text/css -+html text/html; charset=%s -+htm text/html; charset=%s -+asc text/plain; charset=%s -+txt text/plain; charset=%s -+rtx text/richtext -+rtf text/rtf -+sgml text/sgml -+sgm text/sgml -+tsv text/tab-separated-values - wml text/vnd.wap.wml --wmlc application/vnd.wap.wmlc - wmls text/vnd.wap.wmlscript --wmlsc application/vnd.wap.wmlscriptc --wbmp image/vnd.wap.wbmp -+etx text/x-setext -+xml text/xml -+xsl text/xml -+mpeg video/mpeg -+mpg video/mpeg -+mpe video/mpeg -+qt video/quicktime -+mov video/quicktime -+mxu video/vnd.mpegurl -+avi video/x-msvideo -+movie video/x-sgi-movie -+ice x-conference/x-cooltalk -diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c ---- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001 -+++ thttpd-2.21b-cool/mmc.c Sat Sep 20 14:43:20 2003 -@@ -70,6 +70,9 @@ - unsigned int hash; - int hash_idx; - struct MapStruct* next; -+ char nocache; -+ size_t last_modified_len; -+ char last_modified[100]; - } Map; - - -@@ -93,12 +96,13 @@ - - - void* --mmc_map( char* filename, struct stat* sbP, struct timeval* nowP ) -+mmc_map( char* filename, struct stat* sbP, struct timeval* nowP, int nocache, char **last_modified, size_t *last_modified_len ) - { - time_t now; - struct stat sb; - Map* m; - int fd; -+ const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; - - /* Stat the file, if necessary. */ - if ( sbP != (struct stat*) 0 ) -@@ -130,7 +134,7 @@ - /* Yep. Just return the existing map */ - ++m->refcount; - m->reftime = now; -- return m->addr; -+ goto done; - } - - /* Open the file. */ -@@ -167,12 +171,13 @@ - m->ctime = sb.st_ctime; - m->refcount = 1; - m->reftime = now; -+ m->nocache = (char) nocache; - - /* Avoid doing anything for zero-length files; some systems don't like - ** to mmap them, other systems dislike mallocing zero bytes. - */ - if ( m->size == 0 ) -- m->addr = (void*) 1; /* arbitrary non-NULL address */ -+ m->addr = (void*) 5; /* arbitrary non-NULL address */ - else - { - #ifdef HAVE_MMAP -@@ -223,6 +228,13 @@ - maps = m; - ++map_count; - -+ strftime( m->last_modified, sizeof(m->last_modified), rfc1123fmt, gmtime( &sb.st_mtime ) ); -+ m->last_modified_len = strlen(m->last_modified); -+ -+done: -+ *last_modified = m->last_modified; -+ *last_modified_len = m->last_modified_len; -+ - /* And return the address. */ - return m->addr; - } -@@ -231,27 +243,32 @@ - void - mmc_unmap( void* addr, struct stat* sbP, struct timeval* nowP ) - { -- Map* m = (Map*) 0; -+ Map* m = (Map*) 0, **mm = &maps; - - /* Find the Map entry for this address. First try a hash. */ - if ( sbP != (struct stat*) 0 ) - { - m = find_hash( sbP->st_ino, sbP->st_dev, sbP->st_size, sbP->st_ctime ); -- if ( m != (Map*) 0 && m->addr != addr ) -+ if ( m != (Map*) 0 && ( m->addr != addr || m->nocache == 1 ) ) - m = (Map*) 0; - } - /* If that didn't work, try a full search. */ - if ( m == (Map*) 0 ) -- for ( m = maps; m != (Map*) 0; m = m->next ) -+ for ( m = maps; m != (Map*) 0; m = m->next ) { - if ( m->addr == addr ) - break; -+ mm = &m->next; -+ } - if ( m == (Map*) 0 ) - syslog( LOG_ERR, "mmc_unmap failed to find entry!" ); - else if ( m->refcount <= 0 ) - syslog( LOG_ERR, "mmc_unmap found zero or negative refcount!" ); - else - { -- --m->refcount; -+ if ( --m->refcount == 0 && m->nocache == 1 ) { -+ really_unmap( mm ); -+ return; -+ } - if ( nowP != (struct timeval*) 0 ) - m->reftime = nowP->tv_sec; - else -diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h ---- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001 -+++ thttpd-2.21b-cool/mmc.h Sat Sep 20 14:43:20 2003 -@@ -31,8 +31,9 @@ - /* Returns an mmap()ed area for the given file, or (void*) 0 on errors. - ** If you have a stat buffer on the file, pass it in, otherwise pass 0. - ** Same for the current time. -+** Set nocache to 1, if this entry is supposed to be removed quickly. - */ --extern void* mmc_map( char* filename, struct stat* sbP, struct timeval* nowP ); -+extern void* mmc_map( char* filename, struct stat* sbP, struct timeval* nowP, int nocache, char **last_modified, size_t *last_modified_len ); - - /* Done with an mmap()ed area that was returned by mmc_map(). - ** If you have a stat buffer on the file, pass it in, otherwise pass 0. -diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c ---- thttpd-2.21b/thttpd.c Tue Apr 24 00:41:57 2001 -+++ thttpd-2.21b-cool/thttpd.c Sat Sep 20 14:43:20 2003 -@@ -53,6 +53,10 @@ - #endif - #include - -+#include -+ -+#include -+ - #include "fdwatch.h" - #include "libhttpd.h" - #include "mmc.h" -@@ -66,6 +70,8 @@ - static char* dir; - static int do_chroot, no_log, no_symlink, do_vhost, do_global_passwd; - static char* cgi_pattern; -+static char* php_pattern; -+static char* phps_pattern; - static char* url_pattern; - static int no_empty_referers; - static char* local_pattern; -@@ -95,10 +101,10 @@ - httpd_conn* hc; - int tnums[MAXTHROTTLENUMS]; /* throttle indexes */ - int numtnums; -+ int keep_alive; - long limit; - time_t started_at; -- Timer* idle_read_timer; -- Timer* idle_send_timer; -+ time_t last_io; - Timer* wakeup_timer; - Timer* linger_timer; - long wouldblock_delay; -@@ -106,17 +112,22 @@ - off_t bytes_sent; - off_t bytes_to_send; - } connecttab; --static connecttab* connects; -+static connecttab* connects, **free_connects; -+static int next_free_connect; - static int numconnects, maxconnects; - static int httpd_conn_count; - - /* The connection states. */ --#define CNST_FREE 0 --#define CNST_READING 1 --#define CNST_SENDING 2 --#define CNST_PAUSING 3 --#define CNST_LINGERING 4 -- -+enum { -+ CNST_FREE = 0, -+ CNST_READING, -+ CNST_SENDING, -+ CNST_PAUSING, -+ CNST_LINGERING, -+ CNST_SENDING_RESP, -+ CNST_READING_BODY, -+ CNST_TOTAL_NR -+}; - - static httpd_server* hs = (httpd_server*) 0; - int terminate = 0; -@@ -140,23 +151,32 @@ - static int handle_newconnect( struct timeval* tvP, int listen_fd ); - static void handle_read( connecttab* c, struct timeval* tvP ); - static void handle_send( connecttab* c, struct timeval* tvP ); -+static void handle_send_resp( connecttab* c, struct timeval* tvP ); -+static void handle_read_body( connecttab* c, struct timeval* tvP ); - static void handle_linger( connecttab* c, struct timeval* tvP ); - static int check_throttles( connecttab* c ); -+static void timeout_conns( ClientData client_data, struct timeval* nowP ); - static void clear_throttles( connecttab* c, struct timeval* tvP ); - static void update_throttles( ClientData client_data, struct timeval* nowP ); --static void clear_connection( connecttab* c, struct timeval* tvP ); -+static void clear_connection( connecttab* c, struct timeval* tvP, int ); - static void really_clear_connection( connecttab* c, struct timeval* tvP ); --static void idle_read_connection( ClientData client_data, struct timeval* nowP ); --static void idle_send_connection( ClientData client_data, struct timeval* nowP ); - static void wakeup_connection( ClientData client_data, struct timeval* nowP ); - static void linger_clear_connection( ClientData client_data, struct timeval* nowP ); - static void occasional( ClientData client_data, struct timeval* nowP ); -+static void periodic_jobs( ClientData client_data, struct timeval* nowP ); - #ifdef STATS_TIME - static void show_stats( ClientData client_data, struct timeval* nowP ); - #endif /* STATS_TIME */ - static void logstats( struct timeval* nowP ); - static void thttpd_logstats( long secs ); -+static void boot_request(connecttab *c, struct timeval *tvP); -+ -+typedef void (*handler_func)(connecttab*, struct timeval *); -+ -+handler_func handler_array[CNST_TOTAL_NR] = -+{NULL, handle_read, handle_send, NULL, handle_linger, handle_send_resp, handle_read_body}; - -+#define RUN_HANDLER(type, c) if (handler_array[type]) handler_array[type](c, &tv) - - static void - handle_term( int sig ) -@@ -177,7 +197,7 @@ - return; - - /* Re-open the log file. */ -- if ( logfile != (char*) 0 ) -+ if ( logfile != (char*) 0 && strcmp(logfile, "-") != 0) - { - logfp = fopen( logfile, "a" ); - if ( logfp == (FILE*) 0 ) -@@ -198,6 +218,8 @@ - } - - -+time_t httpd_time_now; -+ - static void - handle_usr2( int sig ) - { -@@ -217,7 +239,6 @@ - int num_ready; - int cnum, ridx; - connecttab* c; -- httpd_conn* hc; - httpd_sockaddr sa4; - httpd_sockaddr sa6; - int gotv4, gotv6; -@@ -270,7 +291,9 @@ - no_log = 1; - logfp = (FILE*) 0; - } -- else -+ else if (strcmp(logfile, "-") == 0) { -+ logfp = stdout; -+ } else - { - logfp = fopen( logfile, "a" ); - if ( logfp == (FILE*) 0 ) -@@ -420,7 +443,8 @@ - hostname, - gotv4 ? &sa4 : (httpd_sockaddr*) 0, gotv6 ? &sa6 : (httpd_sockaddr*) 0, - port, cgi_pattern, charset, cwd, no_log, logfp, no_symlink, do_vhost, -- do_global_passwd, url_pattern, local_pattern, no_empty_referers ); -+ do_global_passwd, url_pattern, local_pattern, no_empty_referers, -+ php_pattern, phps_pattern); - if ( hs == (httpd_server*) 0 ) - exit( 1 ); - -@@ -430,6 +454,12 @@ - syslog( LOG_CRIT, "tmr_create(occasional) failed" ); - exit( 1 ); - } -+ -+ if (tmr_create(0, timeout_conns, JunkClientData, 30 * 1000, 1) == 0) { -+ syslog(LOG_CRIT, "tmr_create(timeout_conns) failed"); -+ exit(1); -+ } -+ - if ( numthrottles > 0 ) - { - /* Set up the throttles timer. */ -@@ -439,6 +469,12 @@ - exit( 1 ); - } - } -+ -+ if (tmr_create(0, periodic_jobs, JunkClientData, 2000, 1) == 0) { -+ syslog(LOG_CRIT, "tmr_create failed"); -+ exit(1); -+ } -+ - #ifdef STATS_TIME - /* Set up the stats timer. */ - if ( tmr_create( (struct timeval*) 0, show_stats, JunkClientData, STATS_TIME * 1000L, 1 ) == (Timer*) 0 ) -@@ -454,12 +490,14 @@ - /* If we're root, try to become someone else. */ - if ( getuid() == 0 ) - { -+#ifndef __CYGWIN__ - /* Set aux groups to null. */ - if ( setgroups( 0, (const gid_t*) 0 ) < 0 ) - { - syslog( LOG_CRIT, "setgroups - %m" ); - exit( 1 ); - } -+#endif - /* Set primary group. */ - if ( setgid( gid ) < 0 ) - { -@@ -495,13 +533,17 @@ - } - maxconnects -= SPARE_FDS; - connects = NEW( connecttab, maxconnects ); -+ free_connects = malloc(sizeof(connecttab *) * maxconnects); -+ next_free_connect = maxconnects; - if ( connects == (connecttab*) 0 ) - { - syslog( LOG_CRIT, "out of memory allocating a connecttab" ); - exit( 1 ); - } -+ - for ( cnum = 0; cnum < maxconnects; ++cnum ) - { -+ free_connects[cnum] = &connects[maxconnects - cnum - 1]; - connects[cnum].conn_state = CNST_FREE; - connects[cnum].hc = (httpd_conn*) 0; - } -@@ -518,6 +560,9 @@ - - /* Main loop. */ - (void) gettimeofday( &tv, (struct timezone*) 0 ); -+ httpd_time_now = tv.tv_sec; -+ periodic_jobs(JunkClientData, &tv); -+ - while ( ( ! terminate ) || numconnects > 0 ) - { - /* Do the fd watch. */ -@@ -530,6 +575,7 @@ - exit( 1 ); - } - (void) gettimeofday( &tv, (struct timezone*) 0 ); -+ httpd_time_now = tv.tv_sec; - if ( num_ready == 0 ) - { - /* No fd's are ready - run the timers. */ -@@ -565,16 +611,10 @@ - c = (connecttab*) fdwatch_get_client_data( ridx ); - if ( c == (connecttab*) 0 ) - continue; -- hc = c->hc; -- if ( c->conn_state == CNST_READING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_read( c, &tv ); -- else if ( c->conn_state == CNST_SENDING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_send( c, &tv ); -- else if ( c->conn_state == CNST_LINGERING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_linger( c, &tv ); -+#if DO_UNNECESSARY_CHECK_FD -+ fdwatch_check_fd(c->hc->conn_fd); -+#endif -+ RUN_HANDLER(c->conn_state, c); - } - tmr_run( &tv ); - -@@ -627,6 +667,8 @@ - #else /* CGI_PATTERN */ - cgi_pattern = (char*) 0; - #endif /* CGI_PATTERN */ -+ php_pattern = "**.php"; -+ phps_pattern = "**.phps"; - url_pattern = (char*) 0; - no_empty_referers = 0; - local_pattern = (char*) 0; -@@ -833,6 +875,16 @@ - value_required( name, value ); - cgi_pattern = e_strdup( value ); - } -+ else if ( strcasecmp( name, "phppat" ) == 0 ) -+ { -+ value_required( name, value ); -+ php_pattern = e_strdup( value ); -+ } -+ else if ( strcasecmp( name, "phpspat" ) == 0 ) -+ { -+ value_required( name, value ); -+ phps_pattern = e_strdup( value ); -+ } - else if ( strcasecmp( name, "urlpat" ) == 0 ) - { - value_required( name, value ); -@@ -1196,8 +1248,10 @@ - logstats( &tv ); - for ( cnum = 0; cnum < maxconnects; ++cnum ) - { -- if ( connects[cnum].conn_state != CNST_FREE ) -+ if ( connects[cnum].conn_state != CNST_FREE ) { -+ httpd_complete_request( connects[cnum].hc, &tv ); - httpd_close_conn( connects[cnum].hc, &tv ); -+ } - if ( connects[cnum].hc != (httpd_conn*) 0 ) - { - httpd_destroy_conn( connects[cnum].hc ); -@@ -1214,6 +1268,7 @@ - } - mmc_destroy(); - tmr_destroy(); -+ free( (void*) free_connects ); - free( (void*) connects ); - if ( throttles != (throttletab*) 0 ) - free( (void*) throttles ); -@@ -1234,7 +1289,7 @@ - for (;;) - { - /* Is there room in the connection table? */ -- if ( numconnects >= maxconnects ) -+ if ( numconnects >= maxconnects || next_free_connect == 0 ) - { - /* Out of connection slots. Run the timers, then the - ** existing connections, and maybe we'll free up a slot -@@ -1245,10 +1300,10 @@ - return 0; - } - /* Find a free connection entry. */ -- for ( cnum = 0; cnum < maxconnects; ++cnum ) -- if ( connects[cnum].conn_state == CNST_FREE ) -- break; -- c = &connects[cnum]; -+ -+ c = free_connects[--next_free_connect]; -+ free_connects[next_free_connect] = NULL; -+ - /* Make the httpd_conn if necessary. */ - if ( c->hc == (httpd_conn*) 0 ) - { -@@ -1267,24 +1322,18 @@ - { - case GC_FAIL: - case GC_NO_MORE: -+ free_connects[next_free_connect++] = c; - return 1; - } - c->conn_state = CNST_READING; - ++numconnects; - client_data.p = c; -- c->idle_read_timer = tmr_create( -- tvP, idle_read_connection, client_data, IDLE_READ_TIMELIMIT * 1000L, -- 0 ); -- if ( c->idle_read_timer == (Timer*) 0 ) -- { -- syslog( LOG_CRIT, "tmr_create(idle_read_connection) failed" ); -- exit( 1 ); -- } -- c->idle_send_timer = (Timer*) 0; - c->wakeup_timer = (Timer*) 0; - c->linger_timer = (Timer*) 0; - c->bytes_sent = 0; - c->numtnums = 0; -+ c->keep_alive = 0; -+ c->last_io = httpd_time_now; - - /* Set the connection file descriptor to no-delay mode. */ - httpd_set_ndelay( c->hc->conn_fd ); -@@ -1298,11 +1347,100 @@ - } - - -+#define FIXUP(x) if (hc->x >= oldptr && hc->x < pe) hc->x += d -+ -+static void -+realign_hc(httpd_conn *hc, char *oldptr) -+{ -+ int d = hc->read_buf - oldptr; -+ char *pe = oldptr + hc->checked_idx; -+ -+ FIXUP(encodedurl); -+ FIXUP(protocol); -+ FIXUP(referer); -+ FIXUP(useragent); -+ FIXUP(acceptl); -+ FIXUP(cookie); -+ FIXUP(contenttype); -+ FIXUP(hdrhost); -+ FIXUP(authorization); -+} -+ -+#undef FIXUP -+ -+static void -+setup_read_body(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ int already, missing; -+ char *oldptr = hc->read_buf; -+ -+ c->conn_state = CNST_READING_BODY; -+ -+ hc->read_body_into_mem = 0; -+ -+ already = hc->read_idx - hc->checked_idx; -+ missing = hc->contentlength - already; -+ -+ if (missing > 16384) { -+ char filename[] = "/tmp/thttpd.upload.XXXXXX"; -+ int tmp = mkstemp(filename); -+ -+ if (tmp >= 0) { -+ void *p; -+ size_t sz = hc->contentlength + hc->checked_idx + 10; -+ -+ unlink(filename); -+ -+ ftruncate(tmp, sz); -+ p = mmap(NULL, sz, -+ PROT_READ|PROT_WRITE, MAP_PRIVATE, tmp, 0); -+ -+ if (p != MAP_FAILED) { -+ memcpy(p, hc->read_buf, hc->read_idx); -+ free(hc->read_buf); -+ hc->read_size = sz; -+ hc->read_buf = p; -+ hc->read_buf_is_mmap = 1; -+ } -+ close(tmp); -+ } -+ -+ if (!hc->read_buf_is_mmap) { -+ clear_connection( c, tvP, 0 ); -+ return; -+ } -+ } else if (missing > 0) { -+ httpd_realloc_str(&hc->read_buf, &hc->read_size, hc->checked_idx + hc->contentlength + 10); -+ } -+ if (oldptr != hc->read_buf) realign_hc(hc, oldptr); -+ -+ fdwatch_del_fd( hc->conn_fd ); -+ fdwatch_add_fd( hc->conn_fd, c, FDW_READ ); -+} -+ -+static void -+setup_sending(connecttab *c, int state, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ ClientData client_data; -+ -+ c->conn_state = state; -+ c->started_at = tvP->tv_sec; -+ c->wouldblock_delay = 0; -+ client_data.p = c; -+ -+ fdwatch_del_fd( hc->conn_fd ); -+ fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE ); -+} -+ -+static void handle_request( connecttab *c, struct timeval *tvP); -+ -+ - static void - handle_read( connecttab* c, struct timeval* tvP ) - { - int sz; -- ClientData client_data; - httpd_conn* hc = c->hc; - - /* Is there room in our buffer to read more bytes? */ -@@ -1311,7 +1449,7 @@ - if ( hc->read_size > 5000 ) - { - httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - httpd_realloc_str( -@@ -1327,14 +1465,53 @@ - ** EWOULDBLOCK; however, this apparently can happen if a packet gets - ** garbled. - */ -- if ( sz == 0 || ( sz < 0 && ( errno != EWOULDBLOCK ) ) ) -- { -- httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ if ( sz == 0 ) { -+ if (! c->keep_alive) { -+ httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -+ } -+ clear_connection( c, tvP, 0 ); -+ return; -+ } else if ( sz < 0 ) { -+ if (errno != EWOULDBLOCK) { -+ clear_connection( c, tvP, 0 ); -+ } - return; -+ } -+ -+ /* If this is a persistent PHP connection, we must not receive -+ ** any further requests on this connection. Some broken HTTP/1.1 -+ ** implementations (e.g. Mozilla 1.0.1) are known to do -+ ** pipelining on a connection, although a prior response included -+ ** Connection: close -+ */ -+ if (c->hc->file_address == (char *) 1) { -+ return; -+ } -+ -+ c->last_io = httpd_time_now; -+ if (sz > 0) hc->read_idx += sz; -+ -+ /* -+ ** if we start getting new data on this socket, "promote" it -+ ** to read timeout -+ */ -+ if ( hc->keep_alive ) { -+ ClientData client_data; -+ -+ -+ client_data.p = c; -+ -+ hc->keep_alive = 0; -+ } -+ handle_request(c, tvP); - } -- hc->read_idx += sz; - -+ -+static void -+handle_request( connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn* hc = c->hc; -+ - /* Do we have a complete request yet? */ - switch ( httpd_got_request( hc ) ) - { -@@ -1342,14 +1519,14 @@ - return; - case GR_BAD_REQUEST: - httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - - /* Yes. Try parsing and resolving it. */ - if ( httpd_parse_request( hc ) < 0 ) - { -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - -@@ -1358,18 +1535,28 @@ - { - httpd_send_err( - hc, 503, httpd_err503title, "", httpd_err503form, hc->encodedurl ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } -+ boot_request(c, tvP); -+} - -+static void boot_request(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; - /* Start the connection going. */ - if ( httpd_start_request( hc, tvP ) < 0 ) - { - /* Something went wrong. Close down the connection. */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - -+ if ( hc->read_body_into_mem ) { -+ setup_read_body( c, tvP ); -+ return; -+ } -+ - /* Fill in bytes_to_send. */ - if ( hc->got_range ) - { -@@ -1384,37 +1571,25 @@ - { - /* No file address means someone else is handling it. */ - c->bytes_sent = hc->bytes_sent; -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } -+ if (hc->file_address == (char *) 1) { -+ c->last_io = (time_t) LONG_MAX; -+ c->wouldblock_delay = 0; -+ return; -+ } - if ( c->bytes_sent >= c->bytes_to_send ) - { - /* There's nothing to send. */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } - - /* Cool, we have a valid connection and a file to send to it. */ -- c->conn_state = CNST_SENDING; -- c->started_at = tvP->tv_sec; -- c->wouldblock_delay = 0; -- client_data.p = c; -- tmr_cancel( c->idle_read_timer ); -- c->idle_read_timer = (Timer*) 0; -- c->idle_send_timer = tmr_create( -- tvP, idle_send_connection, client_data, IDLE_SEND_TIMELIMIT * 1000L, -- 0 ); -- if ( c->idle_send_timer == (Timer*) 0 ) -- { -- syslog( LOG_CRIT, "tmr_create(idle_send_connection) failed" ); -- exit( 1 ); -- } -- -- fdwatch_del_fd( hc->conn_fd ); -- fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE ); -+ setup_sending(c, CNST_SENDING, tvP); - } - -- - static void - handle_send( connecttab* c, struct timeval* tvP ) - { -@@ -1443,6 +1618,9 @@ - iv[1].iov_base = &(hc->file_address[c->bytes_sent]); - iv[1].iov_len = MIN( c->bytes_to_send - c->bytes_sent, c->limit ); - sz = writev( hc->conn_fd, iv, 2 ); -+/* -+printf("**RESPONSE2 [%d]** len = %d\n%*.*s\n", hc->conn_fd, hc->responselen, hc->responselen, hc->responselen, hc->response); -+*/ - } - - if ( sz == 0 || -@@ -1486,12 +1664,12 @@ - */ - if ( errno != EPIPE && errno != EINVAL && errno != ECONNRESET ) - syslog( LOG_ERR, "write - %m sending %.80s", hc->encodedurl ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - - /* Ok, we wrote something. */ -- tmr_reset( tvP, c->idle_send_timer ); -+ c->last_io = httpd_time_now; - /* Was this a headers + file writev()? */ - if ( hc->responselen > 0 ) - { -@@ -1500,7 +1678,7 @@ - { - /* Yes; move the unwritten part to the front of the buffer. */ - int newlen = hc->responselen - sz; -- (void) memcpy( hc->response, &(hc->response[sz]), newlen ); -+ (void) memmove( hc->response, &(hc->response[sz]), newlen ); - hc->responselen = newlen; - sz = 0; - } -@@ -1519,7 +1697,7 @@ - if ( c->bytes_sent >= c->bytes_to_send ) - { - /* This conection is finished! */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } - -@@ -1560,6 +1738,9 @@ - char buf[1024]; - int r; - -+/* -+printf("*LINGER read\n"); -+*/ - /* In lingering-close mode we just read and ignore bytes. An error - ** or EOF ends things, otherwise we go until a timeout. - */ -@@ -1569,6 +1750,63 @@ - } - - -+static void -+handle_read_body(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ int n; -+ -+ n = read(hc->conn_fd, hc->read_buf + hc->read_idx, -+ hc->contentlength - (hc->read_idx - hc->checked_idx)); -+ -+ if (n <= 0) { -+ if (errno == EAGAIN) -+ return; -+ clear_connection(c, tvP, 0); -+ return; -+ } -+ -+ c->last_io = httpd_time_now; -+ -+ hc->read_idx += n; -+ -+ if (hc->contentlength == hc->read_idx - hc->checked_idx) { -+ boot_request(c, tvP); -+ return; -+ } -+} -+ -+static void -+handle_send_resp(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn* hc = c->hc; -+ int n = send(hc->conn_fd, hc->response, hc->responselen, 0); -+ int dokeep = 1; -+ -+ if (n < 0) { -+ if (errno == EAGAIN) -+ return; -+ -+ dokeep = 0; -+ goto clear; -+ } -+ -+ c->last_io = httpd_time_now; -+ -+ if (n == hc->responselen) { -+clear: -+ hc->response = realloc(hc->response, hc->maxresponse + 1); -+ hc->responselen = 0; -+ -+ clear_connection(c, tvP, dokeep); -+ return; -+ } -+ -+ hc->responselen -= n; -+ -+ memmove(hc->response, hc->response + n, hc->responselen); -+} -+ - static int - check_throttles( connecttab* c ) - { -@@ -1635,23 +1873,18 @@ - - - static void --clear_connection( connecttab* c, struct timeval* tvP ) -+clear_connection( connecttab* c, struct timeval* tvP, int doKeep ) - { - ClientData client_data; -+ int linger; - - /* If we haven't actually sent the buffered response yet, do so now. */ -- httpd_write_response( c->hc ); -+ if (c->hc->responselen && c->conn_state != CNST_SENDING_RESP) { -+ setup_sending(c, CNST_SENDING_RESP, tvP); - -- if ( c->idle_read_timer != (Timer*) 0 ) -- { -- tmr_cancel( c->idle_read_timer ); -- c->idle_read_timer = 0; -- } -- if ( c->idle_send_timer != (Timer*) 0 ) -- { -- tmr_cancel( c->idle_send_timer ); -- c->idle_send_timer = 0; -+ return; - } -+ - if ( c->wakeup_timer != (Timer*) 0 ) - { - tmr_cancel( c->wakeup_timer ); -@@ -1669,13 +1902,36 @@ - ** circumstances that make a lingering close necessary. If the flag - ** isn't set we do the real close now. - */ -- if ( c->hc->should_linger ) -+ -+ if ( c->hc->do_keep_alive && doKeep) - { -- c->conn_state = CNST_LINGERING; -+ httpd_conn *hc = c->hc; -+ c->conn_state = CNST_READING; -+ -+ client_data.p = c; -+ c->bytes_sent = 0; -+ c->numtnums = 0; -+ c->keep_alive = 1; -+ -+ httpd_complete_request( c->hc, tvP ); -+ - fdwatch_del_fd( c->hc->conn_fd ); - fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ ); -+ -+ httpd_request_reset( c->hc, 1 ); -+ -+ hc->read_idx -= hc->checked_idx; -+ memmove(hc->read_buf, hc->read_buf + hc->checked_idx, hc->read_idx); -+ hc->checked_idx = 0; -+ - /* Make sure we are still in no-delay mode. */ - httpd_set_ndelay( c->hc->conn_fd ); -+ handle_request(c, tvP); -+ } -+ else if ( c->hc->should_linger ) -+ { -+ c->conn_state = CNST_LINGERING; -+ - client_data.p = c; - c->linger_timer = tmr_create( - tvP, linger_clear_connection, client_data, LINGER_TIME * 1000L, 0 ); -@@ -1684,9 +1940,19 @@ - syslog( LOG_CRIT, "tmr_create(linger_clear_connection) failed" ); - exit( 1 ); - } -+ -+ httpd_complete_request( c->hc, tvP ); -+ -+ fdwatch_del_fd( c->hc->conn_fd ); -+ fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ ); -+ /* Make sure we are still in no-delay mode. */ -+ httpd_set_ndelay( c->hc->conn_fd ); - } -- else -+ else -+ { -+ httpd_complete_request( c->hc, tvP ); - really_clear_connection( c, tvP ); -+ } - } - - -@@ -1702,45 +1968,12 @@ - tmr_cancel( c->linger_timer ); - c->linger_timer = 0; - } -+ free_connects[next_free_connect++] = c; - c->conn_state = CNST_FREE; - --numconnects; - } - - --static void --idle_read_connection( ClientData client_data, struct timeval* nowP ) -- { -- connecttab* c; -- -- c = (connecttab*) client_data.p; -- c->idle_read_timer = (Timer*) 0; -- if ( c->conn_state != CNST_FREE ) -- { -- syslog( LOG_INFO, -- "%.80s connection timed out reading", -- httpd_ntoa( &c->hc->client_addr ) ); -- httpd_send_err( c->hc, 408, httpd_err408title, "", httpd_err408form, "" ); -- clear_connection( c, nowP ); -- } -- } -- -- --static void --idle_send_connection( ClientData client_data, struct timeval* nowP ) -- { -- connecttab* c; -- -- c = (connecttab*) client_data.p; -- c->idle_send_timer = (Timer*) 0; -- if ( c->conn_state != CNST_FREE ) -- { -- syslog( LOG_INFO, -- "%.80s connection timed out sending", -- httpd_ntoa( &c->hc->client_addr ) ); -- clear_connection( c, nowP ); -- } -- } -- - - static void - wakeup_connection( ClientData client_data, struct timeval* nowP ) -@@ -1783,6 +2016,43 @@ - } - #endif /* STATS_TIME */ - -+char httpd_now_buf[100]; -+ -+ -+ -+static void -+periodic_jobs( ClientData client_data, struct timeval* nowP ) -+{ -+ const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; -+ struct tm *t; -+ char date_nozone[100]; -+ const char* cernfmt_nozone = "%d/%b/%Y:%H:%M:%S"; -+ char data[100]; -+ int zone; -+ char sign; -+ -+ strftime( httpd_now_buf, sizeof(httpd_now_buf), rfc1123fmt, gmtime( &nowP->tv_sec ) ); -+ -+ t = localtime(&nowP->tv_sec); -+ strftime( date_nozone, sizeof(date_nozone), cernfmt_nozone, t ); -+#ifdef HAVE_TM_GMTOFF -+ zone = t->tm_gmtoff / 60L; -+#else -+ zone = -timezone / 60L; -+ /* Probably have to add something about daylight time here. */ -+#endif -+ if ( zone >= 0 ) -+ sign = '+'; -+ else -+ { -+ sign = '-'; -+ zone = -zone; -+ } -+ zone = ( zone / 60 ) * 100 + zone % 60; -+ hs->log_date_len = sprintf( hs->log_date, "%s %c%04d", date_nozone, sign, -+ zone ); -+} -+ - - /* Generate debugging statistics syslog messages for all packages. */ - static void -@@ -1826,3 +2096,42 @@ - stats_connections = stats_bytes = 0L; - stats_simultaneous = 0; - } -+ -+static void -+timeout_conns(ClientData client_data, struct timeval *nowP) -+{ -+ connecttab *c = connects, *ce = c + maxconnects; -+ time_t now = nowP->tv_sec; -+ int r = 0, w = 0; -+ int checked = 0; -+ -+ while (c < ce) { -+ switch (c->conn_state) { -+ case CNST_SENDING: -+ case CNST_SENDING_RESP: -+ checked++; -+ if ((now - c->last_io) > IDLE_SEND_TIMELIMIT) { -+ clear_connection( c, nowP, 0 ); -+ w++; -+ } -+ break; -+ case CNST_READING: -+ case CNST_READING_BODY: -+ checked++; -+ if ((now - c->last_io) > IDLE_READ_TIMELIMIT) { -+ clear_connection( c, nowP, 0 ); -+ r++; -+ } -+ break; -+ case CNST_FREE: break; -+ default: checked++; break; -+ } -+ c++; -+ if (checked >= numconnects) break; -+ } -+ -+ if (r > 0 || w > 0) { -+ syslog(LOG_INFO, "Expired %d/%d connections in read/write state", r, w); -+ } -+} -+ -diff -ur thttpd-2.21b/version.h thttpd-2.21b-cool/version.h ---- thttpd-2.21b/version.h Tue Apr 24 04:05:23 2001 -+++ thttpd-2.21b-cool/version.h Sat Sep 20 14:43:20 2003 -@@ -3,7 +3,7 @@ - #ifndef _VERSION_H_ - #define _VERSION_H_ - --#define SERVER_SOFTWARE "thttpd/2.21b 23apr2001" -+#define SERVER_SOFTWARE "thttpd/2.21b PHP/20030920" - #define SERVER_ADDRESS "http://www.acme.com/software/thttpd/" - - #endif /* _VERSION_H_ */ diff --git a/sapi/tux/CREDITS b/sapi/tux/CREDITS deleted file mode 100644 index 3b7aa70c01bbe..0000000000000 --- a/sapi/tux/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tux -Sascha Schumann diff --git a/sapi/tux/README b/sapi/tux/README deleted file mode 100644 index 92c021123ff02..0000000000000 --- a/sapi/tux/README +++ /dev/null @@ -1,86 +0,0 @@ -README FOR THE TUX MODULE (by Sascha Schumann) -($Date$) - - This is a SAPI module for the TUX web-server by Ingo Molnar. - - The special thing about TUX is that it is integrated into the Linux - kernel and thus provides high-speed serving of static files. - - The web-server provides a user-space API which allows arbitrary - plug-ins to be made available. - - All requests to the PHP userspace module are currently serialized. - - This module is of alpha quality. Due to incomplete APIs, HTTP - authentication and handling of POST requests has not been - implemented yet. - - SECURITY NOTE: PHP will happily run everything under the - web-root through the parser; so be careful what you put - there. - - Note that requests are served in a chroot'ed environment. - The initialization of PHP does not take place in the chroot'ed - environment, so that e.g. /usr/local/lib/php.ini is treated - as usual. - -REQUIRED DOWNLOADS - - 1. TUX - - http://people.redhat.com/~mingo/TUX-patches/QuickStart-TUX.txt - - 2. PHP 4.0.x - - Download: - http://www.php.net/ - - Snapshots from CVS: - http://snaps.php.net/ - - -BUILD INSTRUCTIONS - - 1. Install TUX as outlined in the QuickStart text. - Create /tux-modules where modules will reside. - - 2. Prepare PHP - - $ cd php-* - $ ./configure \ - --with-tux=/tux-modules \ - - # make install - - You can see the list of valid PHP options by executing - - $ ./configure --help - - 3. Touch a file in your web-root 'php5.tux'. This will - cause requests to '/php5.tux' to be redirected to the - userspace module php5.tux. - - 4. Start TUX with something like - - # tux -d -t 8 -r /www -m /tux-modules php5.tux - - (daemon mode, eight threads, web-root /www, modules in - /tux-modules, load php5.tux) - - BEFORE running this command, the kernel side of TUX has to - be properly setup. - - 5. Try to access - - http://yourserver/php5.tux?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 - - It should display the PHP credits page. - - To access a script /foo/bar.php, use - - http://yourserver/php5.tux?/foo/bar.php - - Parameters can be appended: - - http://yourserver/php5.tux?/foo/bar.php&var=value - diff --git a/sapi/tux/config.m4 b/sapi/tux/config.m4 deleted file mode 100644 index cc79bea1b9029..0000000000000 --- a/sapi/tux/config.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_TUX=no - -AC_ARG_WITH(tux, -[ --with-tux=MODULEDIR Build PHP as a TUX module (Linux only)],[ - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/php5.tux.so" - AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])]) - PHP_SELECT_SAPI(tux, shared, php_tux.c) - PHP_TUX=yes -]) - -AC_MSG_CHECKING(for TUX) -AC_MSG_RESULT($PHP_TUX) - -unset PHP_TUX diff --git a/sapi/tux/php.sym b/sapi/tux/php.sym deleted file mode 100644 index b968c5f5a2bc8..0000000000000 --- a/sapi/tux/php.sym +++ /dev/null @@ -1,2 +0,0 @@ -TUXAPI_handle_events -TUXAPI_init diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c deleted file mode 100644 index 64deff46ad640..0000000000000 --- a/sapi/tux/php_tux.c +++ /dev/null @@ -1,456 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#include "ext/standard/php_smart_str.h" - -#include "tuxmodule.h" - -#include - -#if 0 -#include -#endif - -void tux_closed_conn(int fd); - -enum { - PHP_TUX_BACKGROUND_CONN = 1 -}; - -typedef struct { - user_req_t *req; - void (*on_close)(int); - int tux_action; - struct iovec *header_vec; - int number_vec; -} php_tux_globals; - -static php_tux_globals tux_globals; - -#define TG(v) (tux_globals.v) - -static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - int m; - const char *estr; - - /* combine headers and body */ - if (TG(number_vec)) { - struct iovec *vec = TG(header_vec); - - n = TG(number_vec); - vec[n].iov_base = (void *) str; - vec[n++].iov_len = str_length; - - /* XXX: this might need more complete error handling */ - if ((m = writev(TG(req)->sock, vec, n)) == -1 && errno == EPIPE) - php_handle_aborted_connection(); - - if (m > 0) - TG(req)->bytes_sent += str_length; - - TG(number_vec) = 0; - return str_length; - } - - estr = str + str_length; - - while (str < estr) { - n = send(TG(req)->sock, str, estr - str, 0); - - if (n == -1 && errno == EPIPE) - php_handle_aborted_connection(); - if (n == -1 && errno == EAGAIN) - continue; - if (n <= 0) - return n; - - str += n; - } - - n = str_length - (estr - str); - - TG(req)->bytes_sent += n; - - return n; -} - -static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers) -{ - char buf[1024]; - struct iovec *vec; - int n; - int max_headers; - zend_llist_position pos; - sapi_header_struct *h; - size_t len; - char *status_line; - int locate_cl; - TSRMLS_FETCH(); - - max_headers = 30; - n = 1; - - vec = malloc(sizeof(struct iovec) * max_headers); - status_line = malloc(30); - - /* safe sprintf use */ - len = sprintf(status_line, "HTTP/1.1 %d NA\r\n", SG(sapi_headers).http_response_code); - - vec[0].iov_base = status_line; - vec[0].iov_len = len; - - TG(req)->http_status = SG(sapi_headers).http_response_code; - - if (TG(tux_action) == TUX_ACTION_FINISH_CLOSE_REQ && TG(req)->http_version == HTTP_1_1) - locate_cl = 1; - else - locate_cl = 0; - - h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - if (locate_cl - && strncasecmp(h->header, "Content-length:", sizeof("Content-length:")-1) == 0) { - TG(tux_action) = TUX_ACTION_FINISH_REQ; - locate_cl = 0; - } - - vec[n].iov_base = h->header; - vec[n++].iov_len = h->header_len; - if (n >= max_headers - 3) { - max_headers *= 2; - vec = realloc(vec, sizeof(struct iovec) * max_headers); - } - vec[n].iov_base = "\r\n"; - vec[n++].iov_len = 2; - - h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - - vec[n].iov_base = "\r\n"; - vec[n++].iov_len = 2; - - TG(number_vec) = n; - TG(header_vec) = vec; - - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int sapi_tux_read_post(char *buffer, uint count_bytes) -{ -#if 0 - int amount = 0; - TSRMLS_FETCH(); - - TG(req)->objectlen = count_bytes; - TG(req)->object_addr = buffer; - if (tux(TUX_ACTION_READ_POST_DATA, TG(req))) - return 0; - - TG(read_post_data) = 1; - - return TG(req)->objectlen; -#else - return 0; -#endif -} - -static char *sapi_tux_read_cookies(void) -{ - TSRMLS_FETCH(); - - return TG(req)->cookies; -} - -#define BUF_SIZE 512 -#define ADD_STRING(name) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) - -static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - char *p; - sapi_header_line ctr = {0}; - - ctr.line = buf; - ctr.line_len = sprintf(buf, "Server: %s", TUXAPI_version); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - p = inet_ntoa(TG(req)->client_host); - /* string representation of IPs are never larger than 512 bytes */ - if (p) { - memcpy(buf, p, strlen(p) + 1); - ADD_STRING("REMOTE_ADDR"); - ADD_STRING("REMOTE_HOST"); - } - - sprintf(buf, "%d", CGI_SERVER_PORT(TG(req))); - ADD_STRING("SERVER_PORT"); - -#if 0 - snprintf(buf, BUF_SIZE, "/%s", TG(hc)->pathinfo); - ADD_STRING("PATH_INFO"); - - snprintf(buf, BUF_SIZE, "/%s", TG(hc)->origfilename); - ADD_STRING("SCRIPT_NAME"); -#endif - -#define CONDADD(name, field) \ - if (TG(req)->field[0]) { \ - php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC); \ - } - - CONDADD(HTTP_REFERER, referer); - CONDADD(HTTP_USER_AGENT, user_agent); - CONDADD(HTTP_ACCEPT, accept); - CONDADD(HTTP_ACCEPT_ENCODING, accept_encoding); - CONDADD(HTTP_ACCEPT_LANGUAGE, accept_language); - CONDADD(HTTP_COOKIE, cookies); - CONDADD(CONTENT_TYPE, content_type); - -#if 0 - if (TG(hc)->contentlength != -1) { - sprintf(buf, "%ld", (long) TG(hc)->contentlength); - ADD_STRING("CONTENT_LENGTH"); - } -#endif - -#if 0 - if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); -#endif -} - - -static int php_tux_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static sapi_module_struct tux_sapi_module = { - "tux", - "tux", - - php_tux_startup, - php_module_shutdown_wrapper, - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_tux_ub_write, - NULL, - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, - - NULL, - sapi_tux_send_headers, - NULL, - sapi_tux_read_post, - sapi_tux_read_cookies, - - sapi_tux_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void tux_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); -} - -static void tux_request_ctor(TSRMLS_D) -{ - char buf[1024]; - int offset; - size_t filename_len; - size_t cwd_len; - smart_str s = {0}; - char *p; - - TG(number_vec) = 0; - TG(header_vec) = NULL; - SG(request_info).query_string = strdup(TG(req)->query); - - smart_str_appends_ex(&s, "/", 1); - smart_str_appends_ex(&s, TG(req)->query, 1); - smart_str_0(&s); - p = strchr(s.c, '&'); - if (p) - *p = '\0'; - SG(request_info).path_translated = s.c; - - s.c = NULL; - smart_str_appendc_ex(&s, '/', 1); - smart_str_appends_ex(&s, TG(req)->objectname, 1); - smart_str_0(&s); - SG(request_info).request_uri = s.c; - SG(request_info).request_method = CGI_REQUEST_METHOD(TG(req)); - if(TG(req)->http_version == HTTP_1_1) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(sapi_headers).http_response_code = 200; - SG(request_info).content_type = TG(req)->content_type; - SG(request_info).content_length = 0; /* TG(req)->contentlength; */ - -#if 0 - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); -#endif -} - -static void tux_request_dtor(TSRMLS_D) -{ - if (TG(header_vec)) { - /* free status_line */ - free(TG(header_vec)[0].iov_base); - free(TG(header_vec)); - } - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); - free(SG(request_info).path_translated); -} - -#if 0 -static void *separate_thread(void *bla) -{ - int fd; - int i = 0; - - fd = (int) bla; - - while (i++ < 5) { - send(fd, "test
              \n", 9, 0); - sleep(1); - } - - tux(TUX_ACTION_CONTINUE_REQ, (user_req_t *) fd); - /* We HAVE to trigger some event on the fd. Otherwise - fast_thread won't wake up, so that the eventloop - won't be entered -> TUX hangs */ - shutdown(fd, 2); - pthread_exit(NULL); -} -#endif - -int TUXAPI_handle_events(user_req_t *req) -{ - TSRMLS_FETCH(); - - if (req->event == PHP_TUX_BACKGROUND_CONN) { - tux_closed_conn(req->sock); - return tux(TUX_ACTION_FINISH_CLOSE_REQ, req); - } - - TG(req) = req; - TG(tux_action) = TUX_ACTION_FINISH_CLOSE_REQ; - - tux_request_ctor(TSRMLS_C); - - tux_module_main(TSRMLS_C); - - tux_request_dtor(TSRMLS_C); - - return tux(TG(tux_action), req); -} - -void tux_register_on_close(void (*arg)(int)) -{ - TG(on_close) = arg; -} - -void tux_closed_conn(int fd) -{ - TSRMLS_FETCH(); - - if (TG(on_close)) TG(on_close)(fd); -} - -int tux_get_fd(void) -{ - TSRMLS_FETCH(); - - return TG(req)->sock; -} - -void tux_set_dont_close(void) -{ - TSRMLS_FETCH(); - - TG(req)->event = PHP_TUX_BACKGROUND_CONN; - tux(TUX_ACTION_POSTPONE_REQ, TG(req)); - TG(tux_action) = TUX_ACTION_EVENTLOOP; -} - -void TUXAPI_init(void) -{ - sapi_startup(&tux_sapi_module); - tux_sapi_module.startup(&tux_sapi_module); - SG(server_context) = (void *) 1; -} - -void doesnotmatter_fini(void) -{ - if (SG(server_context) != NULL) { - tux_sapi_module.shutdown(&tux_sapi_module); - sapi_shutdown(); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/webjames/CREDITS b/sapi/webjames/CREDITS deleted file mode 100644 index 73a7983e9250a..0000000000000 --- a/sapi/webjames/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -WebJames -Alex Waugh diff --git a/sapi/webjames/README b/sapi/webjames/README deleted file mode 100644 index 746a7762fb258..0000000000000 --- a/sapi/webjames/README +++ /dev/null @@ -1,28 +0,0 @@ -README for WebJames SAPI module -by Alex Waugh - -This is a SAPI module for the WebJames HTTP server, which runs on the -RISC OS operating system. - - -DOWNLOADS - -A recent (February 2002 or later) version of the GCCSDK cross compiler -http://www.hard-mofo.dsvr.net/ - -WebJames 0.35 or later -http://www.webjames.alexwaugh.com/ - - -BUILDING - -$ cd php5 -$ ./configure \ - --host=arm-riscos-aof \ - --with-webjames=../webjames/src \ - --with-config-file-path=/Choices: \ - other PHP options -$ make install -$ cd ../webjames -$ ./configure --enable-php -$ make diff --git a/sapi/webjames/config.m4 b/sapi/webjames/config.m4 deleted file mode 100644 index 10e0001680b9a..0000000000000 --- a/sapi/webjames/config.m4 +++ /dev/null @@ -1,20 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_ARG_WITH(webjames, -[ --with-webjames=SRCDIR Build PHP as a WebJames module (RISC OS only)],[ - PHP_EXPAND_PATH($withval, WEBJAMES) - INSTALL_IT="\ - echo 'PHP_LIBS = -l$abs_srcdir/$SAPI_STATIC \$(PHP_LIBS) \$(EXTRA_LIBS)' > $WEBJAMES/build/php; \ - echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $WEBJAMES/build/php; \ - echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $WEBJAMES/build/php;" - PHP_WEBJAMES="yes, using $WEBJAMES" - PHP_ADD_INCLUDE($WEBJAMES) - PHP_SELECT_SAPI(webjames, static, webjames.c) -],[ - PHP_WEBJAMES="no" -]) - -AC_MSG_CHECKING(for webjames) -AC_MSG_RESULT($PHP_WEBJAMES) diff --git a/sapi/webjames/php_webjames.h b/sapi/webjames/php_webjames.h deleted file mode 100644 index 6469ef548b657..0000000000000 --- a/sapi/webjames/php_webjames.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Alex Waugh | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_WEBJAMES_H -#define PHP_WEBJAMES_H - -#include "webjames.h" - -void webjames_php_shutdown(void); -int webjames_php_init(void); -void webjames_php_request(struct connection *conn); - -#endif diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c deleted file mode 100644 index 3b3a4335800cf..0000000000000 --- a/sapi/webjames/webjames.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Alex Waugh | - +----------------------------------------------------------------------+ -*/ - - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#define WEBJAMES_PHP_ONLY -#include "php_webjames.h" - -#include - -#define WEBJAMES_SAPI_VERSION "1.0.0" - -typedef struct { - struct connection *conn; /*structure holding all the details of the current request*/ - int bodyread; /*amount of POST body read*/ - closefn oldclose; /*function to call to close the connection*/ -} php_webjames_globals; - -static php_webjames_globals webjames_globals; - -#define WG(v) (webjames_globals.v) - -static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC) -/*unbuffered write - send data straight out to socket*/ -{ - int bytes; - - bytes = webjames_writebuffer(WG(conn),str,str_length); - if (bytes<0) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - if (!PG(ignore_user_abort)) { - zend_bailout(); - } - } - return bytes; -} - -static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) -/*send an HTTP header*/ -{ - if (WG(conn)->flags.outputheaders) { - if (sapi_header) - webjames_writebuffer(WG(conn), sapi_header->header, sapi_header->header_len); - webjames_writestring(WG(conn), "\r\n"); - } -} - -static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC) -/*read some of the post data*/ -{ - if (WG(conn)->body==NULL) return 0; - if (count_bytes+WG(bodyread)>WG(conn)->bodysize) count_bytes=WG(conn)->bodysize-WG(bodyread); - memcpy(buffer, WG(conn)->body+WG(bodyread), count_bytes); - WG(bodyread)+=count_bytes; - return count_bytes; -} - -static char *sapi_webjames_read_cookies(TSRMLS_D) -{ - return WG(conn)->cookie; -} - -#define BUF_SIZE 512 -#define ADD_STRING(name,string)\ - php_register_variable(name, string, track_vars_array TSRMLS_CC) - -#define ADD_NUM(name,field) {\ - snprintf(buf, BUF_SIZE, "%d", WG(conn)->field);\ - php_register_variable(name, buf, track_vars_array TSRMLS_CC);\ -} - -#define ADD_FIELD(name, field) \ - if (WG(conn)->field) { \ - php_register_variable(name, WG(conn)->field, track_vars_array TSRMLS_CC); \ - } - -static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - - buf[BUF_SIZE] = '\0'; - - ADD_STRING("SERVER_SOFTWARE", configuration.server); - ADD_STRING("SERVER_NAME", configuration.serverip); - ADD_FIELD("SERVER_PROTOCOL", protocol); - ADD_NUM("SERVER_PORT", port); - ADD_STRING("SERVER_ADMIN",configuration.webmaster); - ADD_STRING("GATEWAY_INTERFACE", "CGI/1.1"); - ADD_STRING("DOCUMENT_ROOT", configuration.site); - - ADD_FIELD("REQUEST_METHOD", methodstr); - ADD_FIELD("REQUEST_URI", requesturi); - ADD_STRING("PATH_TRANSLATED", SG(request_info).path_translated); - ADD_FIELD("SCRIPT_NAME", uri); - ADD_FIELD("PHP_SELF", uri); - ADD_FIELD("QUERY_STRING", args); - - - snprintf(buf, BUF_SIZE, "%d.%d.%d.%d", WG(conn)->ipaddr[0], WG(conn)->ipaddr[1], WG(conn)->ipaddr[2], WG(conn)->ipaddr[3]); - ADD_STRING("REMOTE_ADDR", buf); - if (WG(conn)->dnsstatus == DNS_OK) ADD_FIELD("REMOTE_HOST", host); - - if ((WG(conn)->method == METHOD_POST) || (WG(conn)->method == METHOD_PUT)) { - ADD_NUM("CONTENT_LENGTH", bodysize); - ADD_FIELD("CONTENT_TYPE", type); - } - - if ((WG(conn)->method == METHOD_PUT) || (WG(conn)->method == METHOD_DELETE)) ADD_FIELD("ENTITY_PATH", requesturi); - - if (WG(conn)->pwd) { - ADD_STRING("AUTH_TYPE", "basic"); - ADD_FIELD("REMOTE_USER", authorization); - } - - ADD_FIELD("HTTP_COOKIE", cookie); - ADD_FIELD("HTTP_USER_AGENT", useragent); - ADD_FIELD("HTTP_REFERER", referer); - ADD_FIELD("HTTP_ACCEPT", accept); - ADD_FIELD("HTTP_ACCEPT_LANGUAGE", acceptlanguage); - ADD_FIELD("HTTP_ACCEPT_CHARSET", acceptcharset); - ADD_FIELD("HTTP_ACCEPT_ENCODING", acceptencoding); -} - -static void webjames_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - FILE *fp=NULL; - char *path; - - /* Convert filename to Unix format*/ - __riscosify_control|=__RISCOSIFY_DONT_CHECK_DIR; - path = __unixify(WG(conn)->filename,0,NULL,1024,0); - if (path) SG(request_info).path_translated = estrdup(path); - - SG(request_info).query_string = WG(conn)->args; - SG(request_info).request_uri = WG(conn)->requesturi; - SG(request_info).request_method = WG(conn)->methodstr; - if (WG(conn)->method==METHOD_HEAD) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - SG(sapi_headers).http_response_code = 200; - SG(request_info).content_type = WG(conn)->type; - SG(request_info).content_length = WG(conn)->bodysize; - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - if (WG(conn)->authorization) { - char *colon=strchr(WG(conn)->authorization,':'); - if (colon) { - SG(request_info).auth_user = emalloc(colon-WG(conn)->authorization+1); - if (SG(request_info).auth_user) { - memcpy(SG(request_info).auth_user,WG(conn)->authorization,colon-WG(conn)->authorization); - SG(request_info).auth_user[colon-WG(conn)->authorization]='\0'; - SG(request_info).auth_password = estrdup(colon+1); - } - } - } - - /*ensure that syslog calls get logged separately from WebJames' main log */ - openlog("PHP",0,0); - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); -} - -static void webjames_php_close(struct connection *conn, int force) -/*called by webjames if it wants to close the connection*/ -{ - TSRMLS_FETCH(); - - php_request_shutdown(NULL); - WG(oldclose)(conn,force); -} - -void webjames_php_request(struct connection *conn) -/*called by WebJames to start handler*/ -{ - TSRMLS_FETCH(); - - WG(conn) = conn; - WG(bodyread) = 0; - WG(oldclose) = conn->close; - conn->close=webjames_php_close; - - webjames_module_main(TSRMLS_C); - - WG(oldclose)(WG(conn), 0); -} - -static void php_info_webjames(ZEND_MODULE_INFO_FUNC_ARGS) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", WEBJAMES_SAPI_VERSION); - php_info_print_table_row(2, "WebJames version", WEBJAMES_VERSION " (" WEBJAMES_DATE ")"); - php_info_print_table_end(); -} - -static zend_module_entry php_webjames_module = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "WebJames", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_webjames, -#if ZEND_MODULE_API_NO >= 20010901 - WEBJAMES_SAPI_VERSION, -#endif - STANDARD_MODULE_PROPERTIES -}; - - -static int php_webjames_startup(sapi_module_struct *sapi_module) -{ - if(php_module_startup(sapi_module, &php_webjames_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static sapi_module_struct sapi_module = { - "webjames", /* name */ - "WebJames", /* pretty name */ - - php_webjames_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_webjames_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - NULL, /* send headers handler */ - sapi_webjames_send_header, /* send header handler */ - sapi_webjames_read_post, /* read POST data */ - sapi_webjames_read_cookies, /* read Cookies */ - - sapi_webjames_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -int webjames_php_init(void) -/*called when WebJames initialises*/ -{ - TSRMLS_FETCH(); - if (strcmp(configuration.webjames_h_revision,WEBJAMES_H_REVISION)!=0) { - /*This file was compiled against a different revision of - webjames.h than webjames was, which could be bad news*/ - webjames_writelog(0,"PHP module is compiled for WebJames (%s) and was linked with a different version (%s)",WEBJAMES_H_REVISION,configuration.webjames_h_revision); - return 0; /*failed to initialise*/ - } - sapi_startup(&sapi_module); - sapi_module.startup(&sapi_module); - SG(server_context) = (void *) 1; - return 1; /*initialised correctly*/ -} - -void webjames_php_shutdown(void) -/*called when WebJames is about to quit*/ -{ - sapi_module.shutdown(&sapi_module); - sapi_shutdown(); -} diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag deleted file mode 100644 index 61783d777d99e..0000000000000 --- a/scripts/Makefile.frag +++ /dev/null @@ -1,70 +0,0 @@ - -# -# Build environment install -# - -phpincludedir = $(includedir)/php -phpbuilddir = $(libdir)/build - -BUILD_FILES = \ - scripts/phpize.m4 \ - build/mkdep.awk \ - build/scan_makefile_in.awk \ - build/libtool.m4 \ - Makefile.global \ - acinclude.m4 \ - ltmain.sh \ - run-tests.php - -BUILD_FILES_EXEC = \ - build/shtool \ - config.guess \ - config.sub - -bin_SCRIPTS = phpize php-config -man_PAGES = phpize php-config - -install-build: - @echo "Installing build environment: $(INSTALL_ROOT)$(phpbuilddir)/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(phpbuilddir) $(INSTALL_ROOT)$(bindir) && \ - (cd $(top_srcdir) && \ - $(INSTALL) $(BUILD_FILES_EXEC) $(INSTALL_ROOT)$(phpbuilddir) && \ - $(INSTALL_DATA) $(BUILD_FILES) $(INSTALL_ROOT)$(phpbuilddir)) - -install-headers: - -@for i in $(INSTALL_HEADERS); do \ - i=`$(top_srcdir)/build/shtool path -d $$i`; \ - paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ - done; \ - $(mkinstalldirs) $$paths && \ - echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ - for i in $(INSTALL_HEADERS); do \ - if test -f "$(top_srcdir)/$$i"; then \ - $(INSTALL_DATA) $(top_srcdir)/$$i $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - elif test -f "$(top_builddir)/$$i"; then \ - $(INSTALL_DATA) $(top_builddir)/$$i $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - else \ - (cd $(top_srcdir)/$$i && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - cd $(top_builddir)/$$i && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ - fi \ - done; \ - cd $(top_srcdir)/sapi/embed && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/main - -install-programs: $(builddir)/phpize $(builddir)/php-config - @echo "Installing helper programs: $(INSTALL_ROOT)$(bindir)/" - @for prog in $(bin_SCRIPTS); do \ - echo " program: $(program_prefix)$${prog}$(program_suffix)"; \ - $(INSTALL) -m 755 $(builddir)/$${prog} $(INSTALL_ROOT)$(bindir)/$(program_prefix)$${prog}$(program_suffix); \ - done - @echo "Installing man pages: $(INSTALL_ROOT)$(mandir)/man1/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @for page in $(man_PAGES); do \ - echo " page: $(program_prefix)$${page}$(program_suffix).1"; \ - $(INSTALL_DATA) $(builddir)/man1/$${page}.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)$${page}$(program_suffix).1; \ - done - -$(builddir)/phpize: $(srcdir)/phpize.in $(top_builddir)/config.status - (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status) - -$(builddir)/php-config: $(srcdir)/php-config.in $(top_builddir)/config.status - (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status) diff --git a/scripts/apache/apconf-conv.sh b/scripts/apache/apconf-conv.sh deleted file mode 100755 index 6126bdc27d9d6..0000000000000 --- a/scripts/apache/apconf-conv.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "Usage: $0 /somewhere/httpd.conf" - exit 1 -fi - -if [ ! -w $1 ]; then - echo "You cannot write to $1" - exit 1 -fi - -TMPFILE=tmpfile.$$ - -awk -f conffix.awk <$1 >$TMPFILE - -if [ "$?" != 0 ]; then - exit 1 -fi - -mv -f $1 $1.orig -mv -f $TMPFILE $1 -exit 0 - diff --git a/scripts/apache/aphtaccess-conv.sh b/scripts/apache/aphtaccess-conv.sh deleted file mode 100755 index 1af59d28436d8..0000000000000 --- a/scripts/apache/aphtaccess-conv.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "Usage: $0 /somewhere/.htaccess" - exit 1 -fi - -if [ ! -w $1 ]; then - echo "You cannot write to $1" - exit 1 -fi - -TMPFILE=tmpfile.$$ - -awk -f htaccessfix.awk <$1 >$TMPFILE - -if [ "$?" != 0 ]; then - exit 1 -fi - -mv -f $1 $1.orig -mv -f $TMPFILE $1 -exit 0 - diff --git a/scripts/apache/conffix.awk b/scripts/apache/conffix.awk deleted file mode 100644 index 88be6fade70d4..0000000000000 --- a/scripts/apache/conffix.awk +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -/^[ \t]*php3_*/ { - phpcommand=substr($1,6) - phpvalue=tolower($2) - print "" - print $0 - print "" - print "" - if (phpvalue=="on") { - print "php_admin_flag " phpcommand " on" - } else if (phpvalue=="off") { - print "php_admin_flag " phpcommand " off" - } else { - print "php_admin_value " phpcommand " " substr($0,index($0,$1)+length($1)+1) - } - print "" -} - -! /^[ \t]*php3_*/ { - print $0 -} - diff --git a/scripts/apache/htaccessfix.awk b/scripts/apache/htaccessfix.awk deleted file mode 100644 index 3c784cd335903..0000000000000 --- a/scripts/apache/htaccessfix.awk +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -/^[ \t]*php3_*/ { - phpcommand=substr($1,6) - phpvalue=tolower($2) - print "" - print $0 - print "" - print "" - if (phpvalue=="on") { - print "php_flag " phpcommand " on" - } else if (phpvalue=="off") { - print "php_flag " phpcommand " off" - } else { - print "php_value " phpcommand " " substr($0,index($0,$1)+length($1)+1) - } - print "" -} - -! /^[ \t]*php3_*/ { - print $0 -} - diff --git a/scripts/dev/conv_proto b/scripts/dev/conv_proto deleted file mode 100755 index fad9cfaa83845..0000000000000 --- a/scripts/dev/conv_proto +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/sh -# -# do some automatic conversion of prototypes -# - -if test "$1" = "" ; then - echo "usage: $0 list-of-files" - exit 1 -fi - -tmpfile=`mktemp -q /tmp/asd.XXXXXX` - -if test "$?" != "0" ; then - echo "$0: cannot create temporary file" - exit 1 -fi - -for file in ${1+"$@"} ; do - echo "working on $file" - cat $file | \ - sed -e \ - 's/void php3_\(.*\)(INTERNAL_FUNCTION_PARAMETERS)/PHP_FUNCTION(\1)/' \ - -e 's/^extern void /void /' \ - -e 's/^extern PHP_FUNCTION/PHP_FUNCTION/' > $tmpfile - cp $tmpfile $file -done - -rm -f $tmpfile - -exit 0 diff --git a/scripts/dev/conv_z_macros b/scripts/dev/conv_z_macros deleted file mode 100755 index 13d58698c1183..0000000000000 --- a/scripts/dev/conv_z_macros +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -# -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2005 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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ - -for i in $@; do - echo -n "Processing $i... " - sed \ - -e 's/(\*\([^()]\+\))->type/Z_TYPE_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->type/Z_TYPE_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.type/Z_TYPE(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.dval/Z_DVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.dval/Z_DVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.dval/Z_DVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.lval/Z_LVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.lval/Z_LVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.lval/Z_LVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.ht/Z_ARRVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.ht/Z_ARRVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.ht/Z_ARRVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.str\.val/Z_STRVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.val/Z_STRVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.val/Z_STRVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.str\.len/Z_STRLEN_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.len/Z_STRLEN_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.len/Z_STRLEN(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj\.properties/Z_OBJPROP_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.properties/Z_OBJPROP_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.properties/Z_OBJPROP(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj\.ce/Z_OBJCE_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.ce/Z_OBJCE_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.ce/Z_OBJCE(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj/Z_OBJ_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj/Z_OBJ_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj/Z_OBJ(\1)/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - < $i > tmp && cp tmp $i - echo "DONE" -done - -rm -f tmp diff --git a/scripts/dev/credits b/scripts/dev/credits deleted file mode 100755 index 0ea312d509fa4..0000000000000 --- a/scripts/dev/credits +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -awkprog=' -BEGIN { FS = "\n"; RS = "" } -{ print "CREDIT_LINE(\""$1"\", \""$2"\");" }' - -for what in ext sapi -do - file=ext/standard/credits_$what.h - cat >$file <> $file -done diff --git a/scripts/dev/extern_c.php b/scripts/dev/extern_c.php deleted file mode 100644 index 72c7edcd3288c..0000000000000 --- a/scripts/dev/extern_c.php +++ /dev/null @@ -1,45 +0,0 @@ - $line) { - if (ereg("^[[:space:]]*BEGIN_EXTERN_C", $line)) { -# echo "$file:".($nr+1)." $line"; - $flag = true; - } else if (ereg("^[[:space:]]*END_EXTERN_C", $line)) { -# echo "$file:".($nr+1)." $line"; - $flag = false; - } else if ( (ereg("^[[:space:]]*PHPAPI[[:space:]]*", $line)) - ||(ereg("^[[:space:]]*ZEND_API[[:space:]]*", $line))) { - if (strstr($line,"(")) { - if (!$flag) echo "$file:".($nr+1)." $line"; - } - } - } -} - -array_shift($_SERVER["argv"]); - -if (count($_SERVER["argv"])) { - foreach ($_SERVER["argv"] as $dir) { - scan_dir($dir); - } -} else { - scan_dir("."); -} -?> \ No newline at end of file diff --git a/scripts/dev/phpextdist b/scripts/dev/phpextdist deleted file mode 100755 index 97df70020dfc1..0000000000000 --- a/scripts/dev/phpextdist +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh -if test $# -lt 2; then - echo "usage: phpextdist "; - exit 1 -fi - -phpize=`php-config --prefix`/bin/phpize -distname="$1-$2" - -if test ! -f Makefile.in || test ! -f config.m4; then - echo "Did not find required files in current directory" - exit 1 -fi - -rm -rf modules *.lo *.o *.la config.status config.cache \ -config.log libtool php_config.h config_vars.mk Makefile - -myname=`basename \`pwd\`` -cd .. -cp -rp $myname $distname -cd $distname -$phpize -cd .. -tar cf $distname.tar $distname -rm -rf $distname $distname.tar.* -gzip --best $distname.tar -mv $distname.tar.gz $myname diff --git a/scripts/dev/search_underscores.php b/scripts/dev/search_underscores.php deleted file mode 100755 index 526d5b97203da..0000000000000 --- a/scripts/dev/search_underscores.php +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/local/bin/php -n - | - +----------------------------------------------------------------------+ - */ - -/* This script lists extension-, class- and method names that contain any - underscores. It omits magic names (e.g. anything that starts with two - underscores but no more). - */ - -$cnt_modules = 0; -$cnt_classes = 0; -$cnt_methods = 0; -$err = 0; - -$classes = array_merge(get_declared_classes(), get_declared_interfaces()); - -$extensions = array(); - -foreach(get_loaded_extensions() as $ext) { - $cnt_modules++; - if (strpos($ext, "_") !== false) { - $err++; - $extensions[$ext] = array(); - } -} - -$cnt_classes = count($classes); - -foreach($classes as $c) { - if (strpos($c, "_") !== false) { - $err++; - $ref = new ReflectionClass($c); - if (!($ext = $ref->getExtensionName())) {; - $ext = $ref->isInternal() ? "" : ""; - } - if (!array_key_exists($ext, $extensions)) { - $extensions[$ext] = array(); - } - $extensions[$ext][$c] = array(); - foreach(get_class_methods($c) as $method) { - $cnt_methods++; - if (strpos(substr($method, substr($method, 0, 2) != "__" ? 0 : 2), "_") !== false) { - $err++; - $extensions[$ext][$c][] = $method; - } - } - } - else - { - $cnt_methods += count(get_class_methods($c)); - } -} - -$cnt = $cnt_modules + $cnt_classes + $cnt_methods; - -printf("\n"); -printf("Modules: %5d\n", $cnt_modules); -printf("Classes: %5d\n", $cnt_classes); -printf("Methods: %5d\n", $cnt_methods); -printf("\n"); -printf("Names: %5d\n", $cnt); -printf("Errors: %5d (%.1f%%)\n", $err, round($err * 100 / $cnt, 1)); -printf("\n"); - -ksort($extensions); -foreach($extensions as $ext => &$classes) { - echo "Extension: $ext\n"; - ksort($classes); - foreach($classes as $classname => &$methods) { - echo " Class: $classname\n"; - ksort($methods); - foreach($methods as $method) { - echo " Method: $method\n"; - } - } -} - -printf("\n"); - -?> \ No newline at end of file diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in deleted file mode 100644 index bdc565478548f..0000000000000 --- a/scripts/man1/php-config.1.in +++ /dev/null @@ -1,81 +0,0 @@ -./" +----------------------------------------------------------------------+ -./" | PHP Version 5 | -./" +----------------------------------------------------------------------+ -./" | Copyright (c) 1997-2005 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: Jakub Vrana | -./" +----------------------------------------------------------------------+ -./" -./" $Id$ -./" -.TH php\-config 1 "Apr 2005" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -.B php\-config -Get information about PHP configuration -.SH SYNOPSIS -.B php\-config -[options] -.LP -.SH DESCRIPTION -.B php\-config -is a simple shell script for obtaining information about installed PHP configuration. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-prefix -Directory prefix where PHP is installed, e.g. /usr/local -.TP -.PD 0 -.B \-\-includes -List of \-I options with all include files -.TP -.PD 0 -.B \-\-ldflags -LD Flags which PHP was compiled with -.TP -.PD 0 -.B \-\-libs -Extra libraries which PHP was compiled with -.TP -.PD 0 -.B \-\-extension-dir -Directory where extensions are searched by default -.TP -.PD 0 -.B \-\-php-binary -Full path to php CLI/CGI binary -.TP -.PD 0 -.B \-\-version -PHP version -.TP -.PD 1 -.P -.SH SEE ALSO -.BR php (1) -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2005 The PHP Group -.LP -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 -.PD 0 -.P -.B http://www.php.net/license/3_0.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/scripts/man1/phpize.1.in b/scripts/man1/phpize.1.in deleted file mode 100644 index ebafce288db66..0000000000000 --- a/scripts/man1/phpize.1.in +++ /dev/null @@ -1,68 +0,0 @@ -./" +----------------------------------------------------------------------+ -./" | PHP Version 5 | -./" +----------------------------------------------------------------------+ -./" | Copyright (c) 1997-2005 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: Jakub Vrana | -./" +----------------------------------------------------------------------+ -./" -./" $Id$ -./" -.TH phpize 1 "Apr 2005" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -.B phpize -Prepare PHP extension for compiling -.SH SYNOPSIS -.B phpize -[options] -.LP -.SH DESCRIPTION -.B phpize -is a shell script to prepare PHP extension for compiling. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-clean -Remove all created files -.TP -.PD 0 -.B \-\-help -Prints usage information -.TP -.PD 0 -.B \-\-version -.TP -.PD 1 -.B \-v -Prints API version information -.TP -.PD 1 -.P -.SH SEE ALSO -.BR php (1) -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2005 The PHP Group -.LP -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 -.PD 0 -.P -.B http://www.php.net/license/3_0.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/scripts/php-config.in b/scripts/php-config.in deleted file mode 100644 index 8c5a0a55dfea5..0000000000000 --- a/scripts/php-config.in +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -version="@PHP_VERSION@" -includedir="@includedir@/php" -includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext" -ldflags="@PHP_LDFLAGS@" -libs="@EXTRA_LIBS@" -extension_dir='@EXTENSION_DIR@' -program_prefix="@program_prefix@" -program_suffix="@program_suffix@" -exe_extension="@EXEEXT@" -php_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}" - -case "$1" in ---prefix) - echo $prefix;; ---includes) - echo $includes;; ---ldflags) - echo $ldflags;; ---libs) - echo $libs;; ---extension-dir) - echo $extension_dir;; ---php-binary) - echo $php_binary;; ---version) - echo $version;; -*) - echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--php-binary|--version]" - exit 1;; -esac - -exit 0 diff --git a/scripts/phpize.in b/scripts/phpize.in deleted file mode 100644 index eed03fc74e63a..0000000000000 --- a/scripts/phpize.in +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/sh - -# Variable declaration -prefix='@prefix@' -exec_prefix="`eval echo @exec_prefix@`" -phpdir="`eval echo @libdir@`/build" -includedir="`eval echo @includedir@`/php" -builddir="`pwd`" - -FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4" -FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php" -CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \ - mkinstalldirs missing config.nice config.sub config.guess configure configure.in \ - aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \ - config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \ - run-tests*.php" - -# function declaration -phpize_usage() -{ - echo "Usage: $0 [--clean|--help|--version|-v]" -} - -phpize_no_configm4() -{ - if test $@ -eq 1; then - clean=" --clean" - fi - - echo "Cannot find config.m4. " - echo "Make sure that you run '$0$clean' in the top level source directory of the module" - echo -} - -phpize_clean() -{ - echo "Cleaning.." - for i in $CLEAN_FILES; do - if test -f "$i"; then - rm -f $i - elif test -d "$i"; then - rm -rf $i - fi - done -} - -phpize_check_configm4() -{ - if test ! -r config.m4; then - phpize_no_configm4 $@ - exit 1 - fi - -} - -phpize_get_api_numbers() -{ - # extracting API NOs: - PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'` - ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'` - ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'` -} - -phpize_print_api_numbers() -{ - phpize_get_api_numbers - echo "Configuring for:" - echo "PHP Api Version: "$PHP_API_VERSION - echo "Zend Module Api No: "$ZEND_MODULE_API_NO - echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO -} - -phpize_check_build_files() -{ - if test ! -d "$phpdir"; then - cat < aclocal.m4) -} - -phpize_replace_prefix() -{ - sed \ - -e "s#@prefix@#$prefix#" \ - < "$phpdir/phpize.m4" > configure.in -} - -phpize_autotools() -{ - $PHP_AUTOCONF || exit 1 - $PHP_AUTOHEADER || exit 1 -} - -# Main script - -case "$1" in - # Cleanup - --clean) - phpize_check_configm4 1 - phpize_clean - exit 0 - ;; - - # Usage - --help) - phpize_usage - exit 0 - ;; - - # Version - --version|-v) - phpize_print_api_numbers - exit 0 - ;; - - # Default - *) - phpize_check_configm4 0 - - phpize_check_build_files - - phpize_print_api_numbers - - phpize_copy_files - - phpize_replace_prefix - - touch install-sh mkinstalldirs missing - - phpize_check_shtool - - phpize_check_autotools - - phpize_autotools - ;; -esac - -exit 0 diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 deleted file mode 100644 index 87531ca675ceb..0000000000000 --- a/scripts/phpize.m4 +++ /dev/null @@ -1,121 +0,0 @@ -dnl This file becomes configure.in for self-contained extensions. - -divert(1) - -AC_PREREQ(2.13) -AC_INIT(config.m4) - -PHP_CONFIG_NICE(config.nice) - -AC_DEFUN([PHP_WITH_PHP_CONFIG],[ - AC_ARG_WITH(php-config, -[ --with-php-config=PATH],[ - PHP_CONFIG=$withval -],[ - PHP_CONFIG=php-config -]) - - prefix=`$PHP_CONFIG --prefix 2>/dev/null` - INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` - EXTENSION_DIR=`$PHP_CONFIG --extension-dir` - PHP_EXECUTABLE=`$PHP_CONFIG --php-binary` - - if test -z "$prefix"; then - AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH) - fi - - php_shtool=$srcdir/build/shtool - PHP_INIT_BUILD_SYSTEM - - AC_MSG_CHECKING(for PHP prefix) - AC_MSG_RESULT($prefix) - AC_MSG_CHECKING(for PHP includes) - AC_MSG_RESULT($INCLUDES) - AC_MSG_CHECKING(for PHP extension directory) - AC_MSG_RESULT($EXTENSION_DIR) -]) -dnl -AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl -AC_DEFUN([PHP_EXT_DIR],[""])dnl -AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl -AC_DEFUN([PHP_ALWAYS_SHARED],[ - ext_output="yes, shared" - ext_shared=yes - test "[$]$1" = "no" && $1=yes -])dnl -dnl -abs_srcdir=`(cd $srcdir && pwd)` -abs_builddir=`pwd` - -AC_PROG_CC -AC_PROG_CC_C_O - -dnl Support systems with system libraries in e.g. /usr/lib64 -AC_ARG_WITH(libdir, -[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], -[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib]) - -PHP_RUNPATH_SWITCH -PHP_SHLIB_SUFFIX_NAME -PHP_WITH_PHP_CONFIG - -PHP_BUILD_SHARED - -AC_PREFIX_DEFAULT() - -PHP_PROG_RE2C -PHP_PROG_AWK - -sinclude(config.m4) - -enable_static=no -enable_shared=yes - -AC_PROG_LIBTOOL - -all_targets='$(PHP_MODULES)' -install_targets=install-modules -phplibdir="`pwd`/modules" -CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" -CFLAGS_CLEAN='$(CFLAGS)' - -test "$prefix" = "NONE" && prefix="/usr/local" -test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' - -PHP_SUBST(PHP_MODULES) -PHP_SUBST(all_targets) -PHP_SUBST(install_targets) - -PHP_SUBST(prefix) -PHP_SUBST(exec_prefix) -PHP_SUBST(libdir) -PHP_SUBST(prefix) -PHP_SUBST(phplibdir) - -PHP_SUBST(CC) -PHP_SUBST(CFLAGS) -PHP_SUBST(CFLAGS_CLEAN) -PHP_SUBST(CPP) -PHP_SUBST(CPPFLAGS) -PHP_SUBST(CXX) -PHP_SUBST(CXXFLAGS) -PHP_SUBST(EXTENSION_DIR) -PHP_SUBST(PHP_EXECUTABLE) -PHP_SUBST(EXTRA_LDFLAGS) -PHP_SUBST(EXTRA_LIBS) -PHP_SUBST(INCLUDES) -PHP_SUBST(LFLAGS) -PHP_SUBST(LDFLAGS) -PHP_SUBST(SHARED_LIBTOOL) -PHP_SUBST(LIBTOOL) -PHP_SUBST(SHELL) - -PHP_GEN_BUILD_DIRS -PHP_GEN_GLOBAL_MAKEFILE - -test -d modules || $php_shtool mkdir modules -touch .deps - -AC_CONFIG_HEADER(config.h) - -AC_OUTPUT() diff --git a/server-tests-config.php b/server-tests-config.php deleted file mode 100755 index 47df90f5e6569..0000000000000 --- a/server-tests-config.php +++ /dev/null @@ -1,74 +0,0 @@ - NULL, - -/* executable that will be tested. Not used for - web based tests */ -'TEST_PHP_EXECUTABLE' => NULL, - -/* php.ini to use when executing php */ -'PHPRC' => NULL, - -/* log format */ -'TEST_PHP_LOG_FORMAT' => 'LEODC', - -/* debugging detail in output. */ -'TEST_PHP_DETAILED' => 0, - -/* error style for editors or IDE's */ -'TEST_PHP_ERROR_STYLE' => 'EMACS', - -'REPORT_EXIT_STATUS' => 0, -'NO_PHPTEST_SUMMARY' => 0, - -/* don't ask, and don't send results to QA if true */ -'NO_INTERACTION' => true, - -/* base url prefixed to any requests */ -'TEST_WEB_BASE_URL' => NULL, - -/* if set, copy phpt files into this directory, - which should be accessable via an http server. The - TEST_WEB_BASE_URL setting should be the base url - to access this path. If this is not used, - TEST_WEB_BASE_URL should be the base url pointing - to TEST_PHP_SRCDIR, which should then be accessable via - an http server. - - An example would be: - TEST_WEB_BASE_URL=http://localhost/test - TEST_BASE_PATH=/path/to/htdocs/test -*/ -'TEST_BASE_PATH' => NULL, - -/* file extension of pages requested via http - this allows for php to be configured to parse - extensions other than php, usefull for multiple - configurations under a single webserver */ -'TEST_WEB_EXT' => 'php', - -/* if true doesn't run tests, just outputs executable info */ -'TEST_CONTEXT_INFO' => false, - -/* : or ; seperated list of paths */ -'TEST_PATHS' => NULL -/* additional configuration items that may be set - to provide proxy support for testes: - timeout - proxy_host - proxy_port - proxy_user - proxy_pass -*/ -); - -?> \ No newline at end of file diff --git a/server-tests.php b/server-tests.php deleted file mode 100755 index dd135e0c87108..0000000000000 --- a/server-tests.php +++ /dev/null @@ -1,1576 +0,0 @@ - | - | Preston L. Bannister | - | Marcus Boerger | - | Shane Caraveo | - | Derick Rethans | - | Sander Roobol | - | (based on version by: Stig Bakken ) | - | (based on the PHP 3 test framework by Rasmus Lerdorf) | - +----------------------------------------------------------------------+ - */ - -set_time_limit(0); -while(@ob_end_clean()); -if (ob_get_level()) echo "Not all buffers were deleted.\n"; -error_reporting(E_ALL); - -/********************************************************************** - * QA configuration - */ - -define('PHP_QA_EMAIL', 'qa-reports@lists.php.net'); -define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php'); - -/********************************************************************** - * error messages - */ - -define('PCRE_MISSING_ERROR', -'+-----------------------------------------------------------+ -| ! ERROR ! | -| The test-suite requires that you have pcre extension | -| enabled. To enable this extension either compile your PHP | -| with --with-pcre-regex or if you have compiled pcre as a | -| shared module load it via php.ini. | -+-----------------------------------------------------------+'); -define('SAFE_MODE_WARNING', -'+-----------------------------------------------------------+ -| ! WARNING ! | -| You are running the test-suite with "safe_mode" ENABLED ! | -| | -| Chances are high that no test will work at all, | -| depending on how you configured "safe_mode" ! | -+-----------------------------------------------------------+'); -define('TMP_MISSING', -'+-----------------------------------------------------------+ -| ! ERROR ! | -| You must create /tmp for session tests to work! | -| | -+-----------------------------------------------------------+'); -define('PROC_OPEN_MISSING', -'+-----------------------------------------------------------+ -| ! ERROR ! | -| The test-suite requires that proc_open() is available. | -| Please check if you disabled it in php.ini. | -+-----------------------------------------------------------+'); -define('REQ_PHP_VERSION', -'+-----------------------------------------------------------+ -| ! ERROR ! | -| The test-suite must be run with PHP 5 or later. | -| You can still test older extecutables by setting | -| TEST_PHP_EXECUTABLE and running this script with PHP 5. | -+-----------------------------------------------------------+'); -/********************************************************************** - * information scripts - */ -define('PHP_INFO_SCRIPT',''); - -define('PHP_EXTENSIONS_SCRIPT',''); -define('PHP_INI_SETTINGS_SCRIPT',''); - -/********************************************************************** - * various utility functions - */ - -function save_to_file($filename,$text) -{ - $fp = @fopen($filename,'w') - or die("Cannot open file '" . $filename . "' (save_to_file)"); - fwrite($fp,$text); - fclose($fp); -} - -function settings2array($settings, &$ini_settings) -{ - foreach($settings as $setting) { - if (strpos($setting, '=')!==false) { - $setting = explode("=", $setting, 2); - $name = trim($setting[0]); - $value = trim($setting[1]); - $ini_settings[$name] = $value; - } - } -} - -function settings2params(&$ini_settings) -{ - $settings = ''; - if (count($ini_settings)) { - foreach($ini_settings as $name => $value) { - $value = addslashes($value); - $settings .= " -d \"".strtolower($name)."=$value\""; - } - } - return $settings; -} - -function generate_diff($wanted,$output) -{ - $w = explode("\n", $wanted); - $o = explode("\n", $output); - $w1 = array_diff_assoc($w,$o); - $o1 = array_diff_assoc($o,$w); - $w2 = array(); - $o2 = array(); - foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] = sprintf("%03d- ", $idx+1).$val; - foreach($o1 as $idx => $val) $o2[sprintf("%03d>",$idx)] = sprintf("%03d+ ", $idx+1).$val; - $diff = array_merge($w2, $o2); - ksort($diff); - return implode("\r\n", $diff); -} - -function mkpath($path,$mode = 0777) { - $dirs = split('[\\/]',$path); - $path = $dirs[0]; - for($i = 1;$i < count($dirs);$i++) { - $path .= '/'.$dirs[$i]; - @mkdir($path,$mode); - } -} - -function copyfiles($src,$new) { - $d = dir($src); - while (($entry = $d->read())) { - if (is_file("$src/$entry")) { - copy("$src/$entry", "$new/$entry"); - } - } - $d->close(); -} - -function post_result_data($query,$data) -{ - $url = QA_SUBMISSION_PAGE.'?'.$query; - $post = "php_test_data=" . urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data))); - $r = new HTTPRequest($url,NULL,NULL,$post); - return $this->response_headers['Status']=='200'; -} - - -function execute($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL) -{ - $data = ""; - - if (gettype($args)=='array') { - $args = join($args,' '); - } - $commandline = "$command $args"; - $proc = proc_open($commandline, array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w')), - $pipes, $cwd, $env); - - if (!$proc) - return false; - - if ($input) { - $out = fwrite($pipes[0],$input); - if ($out != strlen($input)) { - return NULL; - } - } - - fclose($pipes[0]); - - while (true) { - /* hide errors from interrupted syscalls */ - $r = $pipes; - $w = null; - $e = null; - $n = @stream_select($r, $w, $e, 60); - - if ($n === 0) { - /* timed out */ - $data .= "\n ** ERROR: process timed out **\n"; - proc_terminate($proc); - return $data; - } else if ($n) { - $line = fread($pipes[1], 8192); - if (strlen($line) == 0) { - /* EOF */ - break; - } - $data .= $line; - } - } - $code = proc_close($proc); - return $data; -} - -function executeCode($php, $ini_overwrites, $code, $remove_headers=true, $cwd=NULL, $env=NULL) -{ - $params = NULL; - if ($ini_overwrites) { - $info_params = array(); - settings2array($ini_overwrites,$info_params); - $params = settings2params($info_params); - } - $out = execute($php, $params, $code, $cwd, $env); - // kill the headers - if ($remove_headers && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) { - $out = $match[2]; - } - return $out; -} - - -/********************************************************************** - * a simple request class that lets us handle http based tests - */ - -class HTTPRequest -{ - public $headers = array(); - public $timeout = 4; - public $urlparts = NULL; - public $url = ''; - public $userAgent = 'PHP-Test-Harness'; - public $options = array(); - public $postdata = NULL; - public $errmsg = ''; - public $errno = 0; - public $response; - public $response_headers; - public $outgoing_payload; - public $incoming_payload = ''; - - /* - URL is the full url - headers is assoc array of outgoing http headers - - options may include - timeout - proxy_host - proxy_port - proxy_user - proxy_pass - method (GET|POST) - - post data is, well, post data. It is not processed so - multipart stuff must be prepared before calling this - (or add it to class) - */ - function HTTPRequest($URL, $headers=array(), $options=array(), $postdata=NULL) - { - $this->urlparts = @parse_url($URL); - $this->url = $URL; - $this->options = $options; - $this->headers = $headers; - $this->postdata = &$postdata; - $this->doRequest(); - } - - function doRequest() - { - if (!$this->_validateUrl()) return; - - if (isset($this->options['timeout'])) - $this->timeout = (int)$this->options['timeout']; - - $this->_sendHTTP(); - } - - function _validateUrl() - { - if ( ! is_array($this->urlparts) ) { - return FALSE; - } - if (!isset($this->urlparts['host'])) { - $this->urlparts['host']='127.0.0.1'; - } - if (!isset($this->urlparts['port'])) { - $this->urlparts['port'] = 80; - } - if (!isset($this->urlparts['path']) || !$this->urlparts['path']) - $this->urlparts['path'] = '/'; - return TRUE; - } - - function _parseResponse() - { - if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $this->incoming_payload, $match)) { - $this->response = $match[2]; - if (preg_match("/^HTTP\/1\.. (\d+).*/s",$match[1],$status) && !$status[1]) { - $this->errmsg = "HTTP Response $status[1] Not Found"; - return FALSE; - } - $rh = preg_split("/[\n\r]+/",$match[1]); - $this->response_headers = array(); - foreach ($rh as $line) { - if (strpos($line, ':')!==false) { - $line = explode(":", $line, 2); - $this->response_headers[trim($line[0])] = trim($line[1]); - } - } - $this->response_headers['Status']=$status[1]; - // if no content, return false - if(strlen($this->response) > 0) return TRUE; - } - $this->errmsg = 'Invalid HTTP Response'; - return FALSE; - } - - function &_getRequest() - { - $fullpath = $this->urlparts['path']. - (isset($this->urlparts['query'])?'?'.$this->urlparts['query']:''). - (isset($this->urlparts['fragment'])?'#'.$this->urlparts['fragment']:''); - if (isset($this->options['proxy_host'])) { - $fullpath = 'http://'.$this->urlparts['host'].':'.$this->urlparts['port'].$fullpath; - } - if (isset($this->options['proxy_user'])) { - $headers['Proxy-Authorization'] = 'Basic ' . base64_encode($this->options['proxy_user'].":".$this->options['proxy_pass']); - } - $headers['User-Agent'] = $this->userAgent; - $headers['Host'] = $this->urlparts['host']; - $headers['Content-Length'] = strlen($this->postdata); - $headers['Content-Type'] = 'application/x-www-form-urlencoded'; - if (isset($this->headers)) { - $headers = array_merge($headers, $this->headers); - } - $headertext = ''; - foreach ($headers as $k => $v) { - $headertext .= "$k: $v\r\n"; - } - $method = trim($this->options['method'])?strtoupper(trim($this->options['method'])):'GET'; - $this->outgoing_payload = - "$method $fullpath HTTP/1.0\r\n". - $headertext."\r\n". - $this->postdata; - return $this->outgoing_payload; - } - - function &_sendHTTP() - { - $this->_getRequest(); - $host = $this->urlparts['host']; - $port = $this->urlparts['port']; - if (isset($this->options['proxy_host'])) { - $host = $this->options['proxy_host']; - $port = isset($this->options['proxy_port'])?$this->options['proxy_port']:8080; - } - // send - if ($this->timeout > 0) { - $fp = fsockopen($host, $port, $this->errno, $this->errmsg, $this->timeout); - } else { - $fp = fsockopen($host, $port, $this->errno, $this->errmsg); - } - if (!$fp) { - $this->errmsg = "Connect Error to $host:$port"; - return NULL; - } - if ($this->timeout > 0) { - // some builds of php do not support this, silence - // the warning - @socket_set_timeout($fp, $this->timeout); - } - if (!fputs($fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { - $this->errmsg = "Error Sending Request Data to $host"; - return NULL; - } - - while ($data = fread($fp, 32768)) { - $this->incoming_payload .= $data; - } - - fclose($fp); - - $this->_parseResponse(); - } - -# a simple test case -#$r = new HTTPRequest('http://localhost:81/info.php/path/info'); -#print_r($r->response_headers); -#print $r->response; - -} // end HTTPRequest - - -/********************************************************************** - * main test harness - */ - -class testHarness { - public $cwd; - public $xargs = array( - #arg env var value default description - 'c' => array('' ,'file' ,NULL ,'configuration file, see server-tests-config.php for example'), - 'd' => array('TEST_PATHS' ,'paths' ,NULL ,'colon seperate path list'), - 'e' => array('TEST_PHP_ERROR_STYLE','EMACS|MSVC' ,'EMACS' ,'editor error style'), - 'h' => array('' ,'' ,NULL ,'this help'), - 'i' => array('PHPRC' ,'path|file' ,NULL ,'ini file to use for tests (sets PHPRC)'), - 'l' => array('TEST_PHP_LOG_FORMAT' ,'string' ,'LEODC' ,'any combination of CDELO'), - 'm' => array('TEST_BASE_PATH' ,'path' ,NULL ,'copy tests to this path before testing'), - 'n' => array('NO_PHPTEST_SUMMARY' ,'' ,0 ,'do not print test summary'), - 'p' => array('TEST_PHP_EXECUTABLE' ,'path' ,NULL ,'php executable to be tested'), - 'q' => array('NO_INTERACTION' ,'' ,0 ,'no console interaction (ie dont contact QA)'), - 'r' => array('REPORT_EXIT_STATUS' ,'' ,0 ,'exit with status at end of execution'), - 's' => array('TEST_PHP_SRCDIR' ,'path' ,NULL ,'path to php source code'), - 't' => array('TEST_PHP_DETAILED' ,'number' ,0 ,'level of detail output to dump'), - 'u' => array('TEST_WEB_BASE_URL' ,'url' ,'' ,'base url for http testing'), - 'v' => array('TEST_CONTEXT_INFO' ,'' ,0 ,'view text executable context info'), - 'w' => array('TEST_WEB' ,'' ,0 ,'run tests via http'), - 'x' => array('TEST_WEB_EXT' ,'file ext' ,'php' ,'http file extension to use') - ); - - public $conf = array(); - public $test_to_run = array(); - public $test_files = array(); - public $test_results = array(); - public $failed_tests = array(); - public $exts_to_test; - public $exts_tested = 0; - public $exts_skipped = 0; - public $ignored_by_ext = 0; - public $test_dirs = array('tests', 'ext', 'sapi'); - public $start_time; - public $end_time; - public $exec_info; - public $test_executable_iscgi = false; - public $inisettings; // the test executables settings, used for web tests - public $iswin32 = false; - - public $ddash = "====================================================================="; - public $sdash = "---------------------------------------------------------------------"; - - // Default ini settings - public $ini_overwrites = array( - 'output_handler'=>'', - 'zlib.output_compression'=>'Off', - 'open_basedir'=>'', - 'safe_mode'=>'0', - 'disable_functions'=>'', - 'output_buffering'=>'Off', - 'error_reporting'=>'4095', - 'display_errors'=>'1', - 'log_errors'=>'0', - 'html_errors'=>'0', - 'track_errors'=>'1', - 'report_memleaks'=>'1', - 'report_zend_debug'=>'0', - 'docref_root'=>'/phpmanual/', - 'docref_ext'=>'.html', - 'error_prepend_string'=>'', - 'error_append_string'=>'', - 'auto_prepend_file'=>'', - 'auto_append_file'=>'', - 'magic_quotes_runtime'=>'0', - ); - public $env = array(); - public $info_params = array(); - - function testHarness() { - $this->iswin32 = substr(PHP_OS, 0, 3) == "WIN"; - $this->checkRequirements(); - $this->env = $_ENV; - $this->removeSensitiveEnvVars(); - - $this->initializeConfiguration(); - $this->parseArgs(); - $this->setTestPaths(); - # change to working directory - if ($this->conf['TEST_PHP_SRCDIR']) { - @chdir($this->conf['TEST_PHP_SRCDIR']); - } - $this->cwd = getcwd(); - - if (!$this->conf['TEST_PHP_SRCDIR']) - $this->conf['TEST_PHP_SRCDIR'] = $this->cwd; - if (!$this->conf['TEST_BASE_PATH'] && $this->conf['TEST_PHP_SRCDIR']) - $this->conf['TEST_BASE_PATH'] = $this->conf['TEST_PHP_SRCDIR']; - if ($this->iswin32) { - $this->conf['TEST_PHP_SRCDIR'] = str_replace('/','\\',$this->conf['TEST_PHP_SRCDIR']); - $this->conf['TEST_BASE_PATH'] = str_replace('/','\\',$this->conf['TEST_BASE_PATH']); - } - - if (!$this->conf['TEST_WEB'] && !is_executable($this->conf['TEST_PHP_EXECUTABLE'])) { - $this->error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " . - $this->conf['TEST_PHP_EXECUTABLE']); - return false; - } - - $this->getInstalledExtensions(); - $this->getExecutableInfo(); - $this->getExecutableIniSettings(); - $this->test_executable_iscgi = strncmp($this->exec_info['PHP_SAPI'],'cgi',3)==0; - $this->calculateDocumentRoot(); - - // add TEST_PHP_SRCDIR to the include path, this facilitates - // tests including files from src/tests - //$this->ini_overwrites['include_path'] = $this->cwd.($this->iswin32?';.;':':.:').$this->exec_info['INCLUDE_PATH']; - - $params = array(); - settings2array($this->ini_overwrites,$params); - $this->info_params = settings2params($params); - - $this->contextHeader(); - if ($this->conf['TEST_CONTEXT_INFO']) return; - $this->loadFileList(); - $this->moveTestFiles(); - $this->run(); - $this->summarizeResults(); - } - - function getExecutableIniSettings() - { - $out = $this->runscript(PHP_INI_SETTINGS_SCRIPT,true); - $this->inisettings = unserialize($out); - } - - function getExecutableInfo() - { - $out = $this->runscript(PHP_INFO_SCRIPT,true); - $out = preg_split("/[\n\r]+/",$out); - $info = array(); - foreach ($out as $line) { - if (strpos($line, '=')!==false) { - $line = explode("=", $line, 2); - $name = trim($line[0]); - $value = trim($line[1]); - $info[$name] = $value; - } - } - $this->exec_info = $info; - } - - function getInstalledExtensions() - { - // get the list of installed extensions - $out = $this->runscript(PHP_EXTENSIONS_SCRIPT,true); - $this->exts_to_test = split(":",$out); - sort($this->exts_to_test); - $this->exts_tested = count($this->exts_to_test); - } - - // if running local, calls executeCode, - // otherwise does an http request - function runscript($script,$removeheaders=false,$cwd=NULL) - { - if ($this->conf['TEST_WEB']) { - $pi = '/testscript.' . $this->conf['TEST_WEB_EXT']; - if (!$cwd) $cwd = $this->conf['TEST_BASE_PATH']; - $tmp_file = "$cwd$pi"; - $pi = substr($cwd,strlen($this->conf['TEST_BASE_PATH'])) . $pi; - $url = $this->conf['TEST_WEB_BASE_URL'] . $pi; - save_to_file($tmp_file,$script); - $fd = fopen($url, "rb"); - $out = ''; - if ($fd) { - while (!feof($fd)) - $out .= fread($fd, 8192); - fclose($fd); - } - unlink($tmp_file); - if (0 && $removeheaders && - preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) { - return $match[2]; - } - return $out; - } else { - return executeCode($this->conf['TEST_PHP_EXECUTABLE'],$this->ini_overwrites, $script,$removeheaders,$cwd,$this->env); - } - } - - - // Use this function to do any displaying of text, so that - // things can be over-written as necessary. - - function writemsg($msg) { - - echo $msg; - - } - - // Another wrapper function, this one should be used any time - // a particular test passes or fails - - function showstatus($item, $status, $reason = '') { - - switch($status) { - case 'PASSED': - $this->writemsg("PASSED: $item ($reason)\n"); - break; - case 'FAILED': - $this->writemsg("FAILED: $item ($reason)\n"); - break; - case 'SKIPPED': - $this->writemsg("SKIPPED: $item ($reason)\n"); - break; - } - } - - - function help() - { - $usage = "usage: php run-tests.php [options]\n"; - foreach ($this->xargs as $arg=>$arg_info) { - $usage .= sprintf(" -%s %-12s %s\n",$arg,$arg_info[1],$arg_info[3]); - } - return $usage; - } - - function parseArgs() { - global $argc; - global $argv; - global $_SERVER; - - if (!isset($argv)) { - $argv = $_SERVER['argv']; - $argc = $_SERVER['argc']; - } - - $conf = NULL; - for ($i=1; $i<$argc;) { - if ($argv[$i][0] != '-') continue; - $opt = $argv[$i++][1]; - if (isset($value)) unset($value); - if (@$argv[$i][0] != '-') { - @$value = $argv[$i++]; - } - switch($opt) { - case 'c': - /* TODO: Implement configuraiton file */ - include($value); - if (!isset($conf)) { - $this->writemsg("Invalid configuration file\n"); - exit(1); - } - $this->conf = array_merge($this->conf,$conf); - break; - case 'e': - $this->conf['TEST_PHP_ERROR_STYLE'] = strtoupper($value); - break; - case 'h': - print $this->help(); - exit(0); - default: - if ($this->xargs[$opt][1] && isset($value)) - $this->conf[$this->xargs[$opt][0]] = $value; - else if (!$this->xargs[$opt][1]) - $this->conf[$this->xargs[$opt][0]] = isset($value)?$value:1; - else - $this->error("Invalid argument setting for argument $opt, should be [{$this->xargs[$opt][1]}]\n"); - break; - } - } - - // set config into environment, this allows - // executed tests to find out about the test - // configurations. config file or args overwrite - // env var config settings - $this->env = array_merge($this->env,$this->conf); - if (!$this->conf['TEST_WEB'] && !$this->conf['TEST_PHP_EXECUTABLE']) { - $this->writemsg($this->help()); - exit(0); - } - } - - function removeSensitiveEnvVars() - { - # delete sensitive env vars - $this->env['SSH_CLIENT']='deleted'; - $this->env['SSH_AUTH_SOCK']='deleted'; - $this->env['SSH_TTY']='deleted'; - } - - function setEnvConfigVar($name) - { - if (isset($this->env[$name])) { - $this->conf[$name] = $this->env[$name]; - } - } - - function initializeConfiguration() - { - foreach ($this->xargs as $arg=>$arg_info) { - if ($arg_info[0]) { - # initialize the default setting - $this->conf[$arg_info[0]]=$arg_info[2]; - # get config from environment - $this->setEnvConfigVar($arg_info[0]); - } - } - } - - function setTestPaths() - { - // configure test paths from config file or command line - if (@$this->conf['TEST_PATHS']) { - $this->test_dirs = array(); - if ($this->iswin32) { - $paths = split(';',$this->conf['TEST_PATHS']); - } else { - $paths = split(':|;',$this->conf['TEST_PATHS']); - } - foreach($paths as $path) { - $this->test_dirs[] = realpath($path); - } - } - } - - function test_sort($a, $b) { - $ta = strpos($a, "{$this->cwd}/tests")===0 ? 1 + (strpos($a, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0; - $tb = strpos($b, "{$this->cwd}/tests")===0 ? 1 + (strpos($b, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0; - if ($ta == $tb) { - return strcmp($a, $b); - } else { - return $tb - $ta; - } - } - - function checkRequirements() { - if (version_compare(phpversion(), "5.0") < 0) { - $this->writemsg(REQ_PHP_VERSION); - exit; - } -// We might want to check another server so we won't see that server's /tmp -// if (!file_exists("/tmp")) { -// $this->writemsg(TMP_MISSING); -// exit; -// } - if (!function_exists("proc_open")) { - $this->writemsg(PROC_OPEN_MISSING); - exit; - } - if (!extension_loaded("pcre")) { - $this->writemsg(PCRE_MISSING_ERROR); - exit; - } - if (ini_get('safe_mode')) { - $this->writemsg(SAFE_MODE_WARNING); - } - } - - // - // Write test context information. - // - function contextHeader() - { - $info = ''; - foreach ($this->exec_info as $k=>$v) { - $info .= sprintf("%-20.s: %s\n",$k,$v); - } - $exts = ''; - foreach ($this->exts_to_test as $ext) { - $exts .="$ext\n "; - } - $dirs = ''; - foreach ($this->test_dirs as $test_dir) { - $dirs .= "$test_dir\n "; - } - $conf = ''; - foreach ($this->conf as $k=>$v) { - $conf .= sprintf("%-20.s: %s\n",$k,$v); - } - - $exeinfo = ''; - if (!$this->conf['TEST_WEB']) - $exeinfo = "CWD : {$this->cwd}\n". - "PHP : {$this->conf['TEST_PHP_EXECUTABLE']}\n"; - - $this->writemsg("\n$this->ddash\n". - "$exeinfo$info\n". - "Test Harness Configuration:\n$conf\n". - "Extensions : $exts\n". - "Test Dirs : $dirs\n". - "$this->ddash\n"); - } - - function loadFileList() - { - foreach ($this->test_dirs as $dir) { - if (is_dir($dir)) { - $this->findFilesInDir($dir, ($dir == 'ext')); - } else { - $this->test_files[] = $dir; - } - } - usort($this->test_files,array($this,"test_sort")); - $this->writemsg("found ".count($this->test_files)." files\n"); - } - - function moveTestFiles() - { - if (!$this->conf['TEST_BASE_PATH'] || - $this->conf['TEST_BASE_PATH'] == $this->conf['TEST_PHP_SRCDIR']) return; - $this->writemsg("moving files from {$this->conf['TEST_PHP_SRCDIR']} to {$this->conf['TEST_BASE_PATH']}\n"); - $l = strlen($this->conf['TEST_PHP_SRCDIR']); - $files = array(); - $dirs = array(); - foreach ($this->test_files as $file) { - if (strpos($file,$this->conf['TEST_PHP_SRCDIR'])==0) { - $newlocation = $this->conf['TEST_BASE_PATH'].substr($file,$l); - $files[] = $newlocation; - $dirs[dirname($file)] = dirname($newlocation); - } else { - // XXX what to do with test files outside the - // php source directory? Need to map them into - // the new directory somehow. - } - } - foreach ($dirs as $src=>$new) { - mkpath($new); - copyfiles($src,$new); - } - $this->test_files = $files; - } - - function findFilesInDir($dir,$is_ext_dir=FALSE,$ignore=FALSE) - { - $skip = array('.', '..', 'CVS'); - $o = opendir($dir) or $this->error("cannot open directory: $dir"); - while (($name = readdir($o)) !== FALSE) { - if (in_array($name, $skip)) continue; - if (is_dir("$dir/$name")) { - $skip_ext = ($is_ext_dir && !in_array($name, $this->exts_to_test)); - if ($skip_ext) { - $this->exts_skipped++; - } - $this->findFilesInDir("$dir/$name", FALSE, $ignore || $skip_ext); - } - - // Cleanup any left-over tmp files from last run. - if (substr($name, -4) == '.tmp') { - @unlink("$dir/$name"); - continue; - } - - // Otherwise we're only interested in *.phpt files. - if (substr($name, -5) == '.phpt') { - if ($ignore) { - $this->ignored_by_ext++; - } else { - $testfile = realpath("$dir/$name"); - $this->test_files[] = $testfile; - } - } - } - closedir($o); - } - - function runHeader() - { - $this->writemsg("TIME START " . date('Y-m-d H:i:s', $this->start_time) . "\n".$this->ddash."\n"); - if (count($this->test_to_run)) { - $this->writemsg("Running selected tests.\n"); - } else { - $this->writemsg("Running all test files.\n"); - } - } - - function run() - { - $this->start_time = time(); - $this->runHeader(); - // Run selected tests. - if (count($this->test_to_run)) { - - foreach($this->test_to_run as $name=>$runnable) { - if(!preg_match("/\.phpt$/", $name)) - continue; - if ($runnable) { - $this->test_results[$name] = $this->run_test($name); - } - } - } else { - foreach ($this->test_files as $name) { - $this->test_results[$name] = $this->run_test($name); - } - } - $this->end_time = time(); - } - - function summarizeResults() - { - if (count($this->test_results) == 0) { - $this->writemsg("No tests were run.\n"); - return; - } - - $n_total = count($this->test_results); - $n_total += $this->ignored_by_ext; - - $sum_results = array('PASSED'=>0, 'SKIPPED'=>0, 'FAILED'=>0); - foreach ($this->test_results as $v) { - $sum_results[$v]++; - } - $sum_results['SKIPPED'] += $this->ignored_by_ext; - $percent_results = array(); - while (list($v,$n) = each($sum_results)) { - $percent_results[$v] = (100.0 * $n) / $n_total; - } - - $this->writemsg("\n".$this->ddash."\n". - "TIME END " . date('Y-m-d H:i:s', $this->end_time) . "\n". - $this->ddash."\n". - "TEST RESULT SUMMARY\n". - $this->sdash."\n". - "Exts skipped : " . sprintf("%4d",$this->exts_skipped) . "\n". - "Exts tested : " . sprintf("%4d",$this->exts_tested) . "\n". - $this->sdash."\n". - "Number of tests : " . sprintf("%4d",$n_total) . "\n". - "Tests skipped : " . sprintf("%4d (%2.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . "\n". - "Tests failed : " . sprintf("%4d (%2.1f%%)",$sum_results['FAILED'],$percent_results['FAILED']) . "\n". - "Tests passed : " . sprintf("%4d (%2.1f%%)",$sum_results['PASSED'],$percent_results['PASSED']) . "\n". - $this->sdash."\n". - "Time taken : " . sprintf("%4d seconds", $this->end_time - $this->start_time) . "\n". - $this->ddash."\n"); - - $failed_test_summary = ''; - if ($this->failed_tests) { - $failed_test_summary .= "\n".$this->ddash."\n". - "FAILED TEST SUMMARY\n".$this->sdash."\n"; - foreach ($this->failed_tests as $failed_test_data) { - $failed_test_summary .= $failed_test_data['test_name'] . "\n"; - } - $failed_test_summary .= $this->ddash."\n"; - } - - if ($failed_test_summary && !$this->conf['NO_PHPTEST_SUMMARY']) { - $this->writemsg($failed_test_summary); - } - - /* We got failed Tests, offer the user to send and e-mail to QA team, unless NO_INTERACTION is set */ - if ($sum_results['FAILED'] && !$this->conf['NO_INTERACTION']) { - $fp = fopen("php://stdin", "r+"); - $this->writemsg("\nPlease allow this report to be send to the PHP QA\nteam. This will give us a better understanding in how\n"); - $this->writemsg("PHP's test cases are doing.\n"); - $this->writemsg("(choose \"s\" to just save the results to a file)? [Yns]: "); - flush(); - $user_input = fgets($fp, 10); - $just_save_results = (strtolower($user_input[0]) == 's'); - - if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { - /* - * Collect information about the host system for our report - * Fetch phpinfo() output so that we can see the PHP enviroment - * Make an archive of all the failed tests - * Send an email - */ - - /* Ask the user to provide an email address, so that QA team can contact the user */ - if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) { - echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): "; - flush(); - $fp = fopen("php://stdin", "r+"); - $user_email = trim(fgets($fp, 1024)); - $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email)); - } - - $failed_tests_data = ''; - $sep = "\n" . str_repeat('=', 80) . "\n"; - - $failed_tests_data .= $failed_test_summary . "\n"; - - if (array_sum($this->failed_tests)) { - foreach ($this->failed_tests as $test_info) { - $failed_tests_data .= $sep . $test_info['name']; - $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output'])); - $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff'])); - $failed_tests_data .= $sep . "\n\n"; - } - $status = "failed"; - } else { - $status = "success"; - } - - $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep; - $failed_tests_data .= "OS:\n". PHP_OS. "\n\n"; - $automake = $autoconf = $libtool = $compiler = 'N/A'; - - if (!$this->iswin32) { - $automake = shell_exec('automake --version'); - $autoconf = shell_exec('autoconf --version'); - /* Always use the generated libtool - Mac OSX uses 'glibtool' */ - $libtool = shell_exec('./libtool --version'); - /* Try the most common flags for 'version' */ - $flags = array('-v', '-V', '--version'); - $cc_status=0; - foreach($flags AS $flag) { - system($this->env['CC']." $flag >/dev/null 2>&1", $cc_status); - if($cc_status == 0) { - $compiler = shell_exec($this->env['CC']." $flag 2>&1"); - break; - } - } - } - - $failed_tests_data .= "Automake:\n$automake\n"; - $failed_tests_data .= "Autoconf:\n$autoconf\n"; - $failed_tests_data .= "Libtool:\n$libtool\n"; - $failed_tests_data .= "Compiler:\n$compiler\n"; - $failed_tests_data .= "Bison:\n". @shell_exec('bison --version'). "\n"; - $failed_tests_data .= "\n\n"; - - if (isset($user_email)) { - $failed_tests_data .= "User's E-mail: ".$user_email."\n\n"; - } - - $failed_tests_data .= $sep . "PHPINFO" . $sep; - $failed_tests_data .= shell_exec($this->conf['TEST_PHP_EXECUTABLE'].' -dhtml_errors=0 -i'); - - $compression = 0; - - if ($just_save_results || - !post_result_data("status=$status&version=".urlencode(TESTED_PHP_VERSION),$failed_tests_data)) { - $output_file = 'php_test_results_' . date('Ymd_Hi') . ( $compression ? '.txt.gz' : '.txt' ); - $fp = fopen($output_file, "w"); - fwrite($fp, $failed_tests_data); - fclose($fp); - - if (!$just_save_results) - echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; - echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n"; - } else { - fwrite($fp, "\nThank you for helping to make PHP better.\n"); - fclose($fp); - } - } - } - - if($this->conf['REPORT_EXIT_STATUS'] and $sum_results['FAILED']) { - exit(1); - } - } - - function getINISettings(&$section_text) - { - $ini_settings = $this->ini_overwrites; - // Any special ini settings - // these may overwrite the test defaults... - if (array_key_exists('INI', $section_text)) { - settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); - } - return $ini_settings; - } - - function getINIParams(&$section_text) - { - if (!$section_text) return ''; - // XXX php5 current has a problem doing this in one line - // it fails with Only variables can be passed by reference - // on test ext\calendar\tests\jdtojewish.phpt - // return settings2params($this->getINISettings($section_text)); - $ini = $this->getINISettings($section_text); - return settings2params($ini); - } - - function calculateDocumentRoot() - { - if ($this->conf['TEST_WEB'] || $this->test_executable_iscgi) { - // configure DOCUMENT_ROOT for web tests - // this assumes that directories from the base url - // matches directory depth from the base path - $parts = parse_url($this->conf['TEST_WEB_BASE_URL']); - $depth = substr_count($parts['path'],'/'); - $docroot = $this->conf['TEST_BASE_PATH']; - for ($i=0 ; $i < $depth; $i++) $docroot = dirname($docroot); - $this->conf['TEST_DOCUMENT_ROOT']=$docroot; - $this->conf['TEST_BASE_SCRIPT_NAME']=$parts['path']; - $this->conf['TEST_SERVER_URL']=substr($this->conf['TEST_WEB_BASE_URL'],0,strlen($this->conf['TEST_WEB_BASE_URL'])-strlen($parts['path'])); - } else { - $this->conf['TEST_DOCUMENT_ROOT']=''; - $this->conf['TEST_BASE_SCRIPT_NAME']=''; - $this->conf['TEST_SERVER_URL']=''; - } - } - - function evalSettings($filename,$data) { - // we eval the section so we can allow dynamic env vars - // for cgi testing - $filename = str_replace('\\','/',$filename); - $cwd = str_replace('\\','/',$this->cwd); - $filepath = dirname($filename); - $scriptname = substr($filename,strlen($this->conf['TEST_DOCUMENT_ROOT'])); - // eval fails if no newline - return eval("$data\n"); - } - - function getENVSettings(&$section_text,$testfile) - { - $env = $this->env; - // Any special environment settings - // these may overwrite the test defaults... - if (array_key_exists('ENV', $section_text)) { - $sect = $this->evalSettings($testfile,$section_text['ENV']); - //print "data evaled:\n$sect\n"; - settings2array(preg_split( "/[\n\r]+/", $sect), $env); - } - return $env; - } - - function getEvalTestSettings($section_text,$testfile) - { - $rq = array(); - // Any special environment settings - // these may overwrite the test defaults... - if ($section_text) { - $sect = $this->evalSettings($testfile,$section_text); - //print "data evaled:\n$sect\n"; - settings2array(preg_split( "/[\n\r]+/", $sect), $rq); - } - return $rq; - } - - // - // Load the sections of the test file. - // - function getSectionText($file) - { - // Load the sections of the test file. - $section_text = array( - 'TEST' => '(unnamed test)', - 'SKIPIF' => '', - 'GET' => '', - 'ARGS' => '', - '_FILE' => $file, - '_DIR' => realpath(dirname($file)), - ); - - $fp = @fopen($file, "r") - or $this->error("Cannot open test file: $file"); - - $section = ''; - while (!feof($fp)) { - $line = fgets($fp); - // Match the beginning of a section. - if (ereg('^--([A-Z]+)--',$line,$r)) { - $section = $r[1]; - $section_text[$section] = ''; - continue; - } - - // Add to the section text. - $section_text[$section] .= $line; - } - fclose($fp); - foreach ($section_text as $k=>$v) { - // for POST data ,we only want to trim the last new line! - if ($k == 'POST' && preg_match('/^(.*?)\r?\n$/Ds',$v,$matches)) { - $section_text[$k]=$matches[1]; - } else { - $section_text[$k]=trim($v); - } - } - return $section_text; - } - - // - // Check if test should be skipped. - // - function getSkipReason($file,&$section_text,$docgi=false) - { - // if the test uses POST or GET, and it's not the cgi - // executable, skip - if ($docgi && !$this->conf['TEST_WEB'] && !$this->test_executable_iscgi) { - $this->showstatus($section_text['TEST'], 'SKIPPED', 'CGI Test needs CGI Binary'); - return "SKIPPED"; - } - // if we're doing web testing, then we wont be able to set - // ini setting on the command line. be sure the executables - // ini settings are compatible with the test, or skip - if (($docgi || $this->conf['TEST_WEB']) && - isset($section_text['INI']) && $section_text['INI']) { - $settings = $this->getINISettings($section_text); - foreach ($settings as $k=>$v) { - if (strcasecmp($v,'off')==0 || !$v) $v=''; - $haveval = isset($this->inisettings[$k]['local_value']); - if ($k == 'include_path') { - // we only want to know that src directory - // is in the include path - if (strpos($this->inisettings[$k]['local_value'],$this->cwd)) - continue; - } - if (($haveval && $this->inisettings[$k]['local_value'] != $v) || (!$haveval && $v)) { - $this->showstatus($section_text['TEST'], 'SKIPPED', "Test requires ini setting $k=[$v], not [".($haveval?$this->inisettings[$k]['local_value']:'')."]"); - return "SKIPPED"; - } - } - } - // now handle a SKIPIF section - if ($section_text['SKIPIF']) { - $output = trim($this->runscript($section_text['SKIPIF'],$this->test_executable_iscgi,realpath(dirname($file))),true); - if (!$output) return NULL; - if ($this->conf['TEST_PHP_DETAILED'] > 2) - print "SKIPIF: [$output]\n"; - if (eregi("^skip", $output)){ - - $reason = (ereg("^skip[[:space:]]*(.+)\$", $output)) ? ereg_replace("^skip[[:space:]]*(.+)\$", "\\1", $output) : FALSE; - $this->showstatus($section_text['TEST'], 'SKIPPED', $reason); - return 'SKIPPED'; - } - if (eregi("^info", $output)) { - $reason = (ereg("^info[[:space:]]*(.+)\$", $output)) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", $output) : FALSE; - if ($reason) { - $tested .= " (info: $reason)"; - } - } - } - return NULL; - } - - // - // Run an individual test case. - // - function run_test($file) - { - if ($this->conf['TEST_PHP_DETAILED']) - $this->writemsg("\n=================\nTEST $file\n"); - - $section_text = $this->getSectionText($file); - - if ($this->iswin32) - $shortname = str_replace($this->conf['TEST_BASE_PATH'].'\\', '', $file); - else - $shortname = str_replace($this->conf['TEST_BASE_PATH'].'/', '', $file); - $tested = $section_text['TEST']." [$shortname]"; - - if ($this->conf['TEST_WEB']) { - $tmp_file = ereg_replace('\.phpt$','.'.$this->conf['TEST_WEB_EXT'],$file); - $uri = $this->conf['TEST_BASE_SCRIPT_NAME'].str_replace($this->conf['TEST_BASE_PATH'], '', $tmp_file); - $uri = str_replace('\\', '/', $uri); - } else { - $tmp_file = ereg_replace('\.phpt$','.php',$file); - } - @unlink($tmp_file); - - // unlink old test results - @unlink(ereg_replace('\.phpt$','.diff',$file)); - @unlink(ereg_replace('\.phpt$','.log',$file)); - @unlink(ereg_replace('\.phpt$','.exp',$file)); - @unlink(ereg_replace('\.phpt$','.out',$file)); - - if (!$this->conf['TEST_WEB']) { - // Reset environment from any previous test. - $env = $this->getENVSettings($section_text,$tmp_file); - $ini_overwrites = $this->getINIParams($section_text); - } - - // if this is a cgi test, prepare for it - $query_string = ''; - $havepost = array_key_exists('POST', $section_text) && !empty($section_text['POST']); - // allow empty query_string requests - $haveget = array_key_exists('GET', $section_text) && !empty($section_text['GET']); - $do_cgi = array_key_exists('CGI', $section_text) || $haveget || $havepost; - - $skipreason = $this->getSkipReason($file,$section_text,$do_cgi); - if ($skipreason == 'SKIPPED') { - return $skipreason; - } - - // We've satisfied the preconditions - run the test! - save_to_file($tmp_file,$section_text['FILE']); - - $post = NULL; - $args = ""; - - $headers = array(); - if ($this->conf['TEST_WEB']) { - $request = $this->getEvalTestSettings(@$section_text['REQUEST'],$tmp_file); - $headers = $this->getEvalTestSettings(@$section_text['HEADERS'],$tmp_file); - - $method = isset($request['method'])?$request['method']:$havepost?'POST':'GET'; - $query_string = $haveget?$section_text['GET']:''; - - $options = array(); - $options['method']=$method; - if (isset($this->conf['timeout'])) $options['timeout'] = $this->conf['timeout']; - if (isset($this->conf['proxy_host'])) $options['proxy_host'] = $this->conf['proxy_host']; - if (isset($this->conf['proxy_port'])) $options['proxy_port'] = $this->conf['proxy_port']; - if (isset($this->conf['proxy_user'])) $options['proxy_user'] = $this->conf['proxy_user']; - if (isset($this->conf['proxy_pass'])) $options['proxy_pass'] = $this->conf['proxy_pass']; - - $post = $havepost?$section_text['POST']:NULL; - $url = $this->conf['TEST_SERVER_URL']; - if (isset($request['SCRIPT_NAME'])) - $url .= $request['SCRIPT_NAME']; - else - $url .= $uri; - if (isset($request['PATH_INFO'])) - $url .= $request['PATH_INFO']; - if (isset($request['FRAGMENT'])) - $url .= '#'.$request['FRAGMENT']; - if (isset($request['QUERY_STRING'])) - $query_string = $request['QUERY_STRING']; - if ($query_string) - $url .= '?'.$query_string; - if ($this->conf['TEST_PHP_DETAILED']) - $this->writemsg("\nURL = $url\n"); - } else if ($do_cgi) { - $query_string = $haveget?$section_text['GET']:''; - - if (!array_key_exists('GATEWAY_INTERFACE', $env)) - $env['GATEWAY_INTERFACE']='CGI/1.1'; - if (!array_key_exists('SERVER_SOFTWARE', $env)) - $env['SERVER_SOFTWARE']='PHP Test Harness'; - if (!array_key_exists('SERVER_SOFTWARE', $env)) - $env['SERVER_NAME']='127.0.0.1'; - if (!array_key_exists('REDIRECT_STATUS', $env)) - $env['REDIRECT_STATUS']='200'; - if (!array_key_exists('SERVER_NAME', $env)) - $env['QUERY_STRING']=$query_string; - if (!array_key_exists('PATH_TRANSLATED', $env) && - !array_key_exists('SCRIPT_FILENAME', $env)) { - $env['PATH_TRANSLATED']=$tmp_file; - $env['SCRIPT_FILENAME']=$tmp_file; - } - if (!array_key_exists('PATH_TRANSLATED', $env)) - $env['PATH_TRANSLATED']=''; - if (!array_key_exists('PATH_INFO', $env)) - $env['PATH_INFO']=''; - if (!array_key_exists('SCRIPT_NAME', $env)) - $env['SCRIPT_NAME']=''; - if (!array_key_exists('SCRIPT_FILENAME', $env)) - $env['SCRIPT_FILENAME']=''; - - if (array_key_exists('POST', $section_text) && (!$haveget || !empty($section_text['POST']))) { - $post = $section_text['POST']; - $content_length = strlen($post); - if (!array_key_exists('REQUEST_METHOD', $env)) - $env['REQUEST_METHOD']='POST'; - if (!array_key_exists('CONTENT_TYPE', $env)) - $env['CONTENT_TYPE']='application/x-www-form-urlencoded'; - if (!array_key_exists('CONTENT_LENGTH', $env)) - $env['CONTENT_LENGTH']=$content_length; - } else { - if (!array_key_exists('REQUEST_METHOD', $env)) - $env['REQUEST_METHOD']='GET'; - if (!array_key_exists('CONTENT_TYPE', $env)) - $env['CONTENT_TYPE']=''; - if (!array_key_exists('CONTENT_LENGTH', $env)) - $env['CONTENT_LENGTH']=''; - } - if ($this->conf['TEST_PHP_DETAILED'] > 1) - $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] . - "\nCONTENT_TYPE = " . $env['CONTENT_TYPE'] . - "\nPATH_TRANSLATED = " . $env['PATH_TRANSLATED'] . - "\nPATH_INFO = " . $env['PATH_INFO'] . - "\nQUERY_STRING = " . $env['QUERY_STRING'] . - "\nREDIRECT_STATUS = " . $env['REDIRECT_STATUS'] . - "\nREQUEST_METHOD = " . $env['REQUEST_METHOD'] . - "\nSCRIPT_NAME = " . $env['SCRIPT_NAME'] . - "\nSCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . "\n"); - /* not cgi spec to put query string on command line, - but used by a couple tests to catch a security hole - in older php versions. At least IIS can be configured - to do this. */ - $args = $env['QUERY_STRING']; - $args = "$ini_overwrites $tmp_file \"$args\" 2>&1"; - } else { - $args = $section_text['ARGS'] ? $section_text['ARGS'] : ''; - $args = "$ini_overwrites $tmp_file $args 2>&1"; - } - - if ($this->conf['TEST_WEB']) { - // we want headers also, so fopen - $r = new HTTPRequest($url,$headers,$options,$post); - //$out = preg_replace("/\r\n/","\n",$r->response); - $out = $r->response; - $headers = $r->response_headers; - //print $r->outgoing_payload."\n"; - //print $r->incoming_payload."\n"; - } else { - $out = execute($this->conf['TEST_PHP_EXECUTABLE'],$args,$post,$this->cwd,$env); - // if this is a cgi, remove the headers first - if ($this->test_executable_iscgi - && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) { - $out = $match[2]; - $rh = preg_split("/[\n\r]+/",$match[1]); - $headers = array(); - foreach ($rh as $line) { - if (strpos($line, ':')!==false) { - $line = explode(":", $line, 2); - $headers[trim($line[0])] = trim($line[1]); - } - } - } - } - - if ($this->conf['TEST_PHP_DETAILED'] > 2) { - echo "HEADERS: "; - print_r($headers); - echo "OUTPUT: \n$out\n"; - - } - - // Does the output match what is expected? - $output = trim($out); - $output = preg_replace('/\r\n/',"\n",$output); - - $failed = FALSE; - - if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) { - if (isset($section_text['EXPECTF'])) { - $wanted = $section_text['EXPECTF']; - } else { - $wanted = $section_text['EXPECTREGEX']; - } - $wanted_re = preg_replace('/\r\n/',"\n",$wanted); - if (isset($section_text['EXPECTF'])) { - $wanted_re = preg_quote($wanted_re, '/'); - // Stick to basics - $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy - $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re); - $wanted_re = str_replace("%d", "[0-9]+", $wanted_re); - $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re); - $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*(E-?[0-9]+)?", $wanted_re); - $wanted_re = str_replace("%c", ".", $wanted_re); - // %f allows two points "-.0.0" but that is the best *simple* expression - } - /* DEBUG YOUR REGEX HERE - var_dump($wanted_re); - print(str_repeat('=', 80) . "\n"); - var_dump($output); - */ - $failed = !preg_match("/^$wanted_re\$/s", $output); - } - - $skipexpect = false; - if (!$failed && $this->conf['TEST_WEB'] && isset($section_text['EXPECTHEADERS'])) { - $want = array(); - $lines = preg_split("/[\n\r]+/",$section_text['EXPECTHEADERS']); - $wanted=''; - foreach ($lines as $line) { - if (strpos($line, ':')!==false) { - $line = explode(":", $line, 2); - $want[trim($line[0])] = trim($line[1]); - $wanted .= trim($line[0]).': '.trim($line[1])."\n"; - } - } - $output=''; - foreach ($want as $k=>$v) { - $output .= "$k: {$headers[$k]}\n"; - if (!isset($headers[$k]) || $headers[$k] != $v) { - $failed = TRUE; - } - } - - // different servers may do different things on non-200 results - // for instance, IIS will deliver it's own error pages, so we - // cannot expect to match up the EXPECT section. We may however, - // want to match EXPECT on more than 200 results, so this may - // need to change later. - $skipexpect = isset($headers['Status']) && $headers['Status'] != 200; - } - - if (!$failed && !$skipexpect && isset($section_text['EXPECT'])) { - $wanted = $section_text['EXPECT']; - $wanted = preg_replace('/\r\n/',"\n",$wanted); - $failed = (0 != strcmp($output,$wanted)); - } - - if (!$failed) { - @unlink($tmp_file); - $this->showstatus($tested, 'PASSED'); - return 'PASSED'; - } - - // Test failed so we need to report details. - $this->showstatus($tested, 'FAILED'); - - $this->failed_tests[] = array( - 'name' => $file, - 'test_name' => $tested, - 'output' => ereg_replace('\.phpt$','.log', $file), - 'diff' => ereg_replace('\.phpt$','.diff', $file) - ); - - if ($this->conf['TEST_PHP_DETAILED']) - $this->writemsg(generate_diff($wanted,$output)."\n"); - - // write .exp - if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'E') !== FALSE) { - $logname = ereg_replace('\.phpt$','.exp',$file); - save_to_file($logname,$wanted); - } - - // write .out - if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'O') !== FALSE) { - $logname = ereg_replace('\.phpt$','.out',$file); - save_to_file($logname,$output); - } - - // write .diff - if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'D') !== FALSE) { - $logname = ereg_replace('\.phpt$','.diff',$file); - save_to_file($logname,generate_diff($wanted,$output)); - } - - // write .log - if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'L') !== FALSE) { - $logname = ereg_replace('\.phpt$','.log',$file); - save_to_file($logname, - "\n---- EXPECTED OUTPUT\n$wanted\n". - "---- ACTUAL OUTPUT\n$output\n". - "---- FAILED\n"); - // display emacs/msvc error output - if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'C') !== FALSE) { - $this->error_report($file,$logname,$tested); - } - } - return 'FAILED'; - } - - // - // Write an error in a format recognizable to Emacs or MSVC. - // - function error_report($testname,$logname,$tested) - { - $testname = realpath($testname); - $logname = realpath($logname); - switch ($this->conf['TEST_PHP_ERROR_STYLE']) { - default: - case 'MSVC': - $this->writemsg($testname . "(1) : $tested\n"); - $this->writemsg($logname . "(1) : $tested\n"); - break; - case 'EMACS': - $this->writemsg($testname . ":1: $tested\n"); - $this->writemsg($logname . ":1: $tested\n"); - break; - } - } - - function error($message) - { - $this->writemsg("ERROR: {$message}\n"); - exit(1); - } -} - -$test = new testHarness(); -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ -?> diff --git a/snapshot b/snapshot deleted file mode 100755 index f8e13ef9d9f89..0000000000000 --- a/snapshot +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -if test -n "$1"; then - flags="DISTNAME=$1" -fi - -${MAKE:-make} $flags -f build/build.mk snapshot diff --git a/stamp-h.in b/stamp-h.in deleted file mode 100644 index 9788f70238c91..0000000000000 --- a/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/stub.c b/stub.c deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/stub.c +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/basic/001.phpt b/tests/basic/001.phpt deleted file mode 100644 index d0cc1ca082a8a..0000000000000 --- a/tests/basic/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Trivial "Hello World" test ---FILE-- - ---EXPECT-- -Hello World diff --git a/tests/basic/002.phpt b/tests/basic/002.phpt deleted file mode 100644 index e9330c8bf946f..0000000000000 --- a/tests/basic/002.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Simple POST Method test ---SKIPIF-- - ---POST-- -a=Hello+World ---FILE-- - ---EXPECT-- -Hello World diff --git a/tests/basic/003.phpt b/tests/basic/003.phpt deleted file mode 100644 index ae6603f448a61..0000000000000 --- a/tests/basic/003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -GET and POST Method combined ---SKIPIF-- - ---POST-- -a=Hello+World ---GET-- -b=Hello+Again+World&c=Hi+Mom ---FILE-- - ---EXPECT-- -post-a=(Hello World) get-b=(Hello Again World) get-c=(Hi Mom) diff --git a/tests/basic/004.phpt b/tests/basic/004.phpt deleted file mode 100644 index 86bf431860e3e..0000000000000 --- a/tests/basic/004.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Two variables in POST data ---SKIPIF-- - ---POST-- -a=Hello+World&b=Hello+Again+World ---FILE-- - ---EXPECT-- -Hello World Hello Again World diff --git a/tests/basic/005.phpt b/tests/basic/005.phpt deleted file mode 100644 index aa1d199825588..0000000000000 --- a/tests/basic/005.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Three variables in POST data ---SKIPIF-- - ---POST-- -a=Hello+World&b=Hello+Again+World&c=1 ---FILE-- - ---EXPECT-- -Hello World Hello Again World 1 diff --git a/tests/basic/006.phpt b/tests/basic/006.phpt deleted file mode 100644 index c614cd9619793..0000000000000 --- a/tests/basic/006.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Add 3 variables together and print result ---FILE-- - ---EXPECT-- -6 diff --git a/tests/basic/007.phpt b/tests/basic/007.phpt deleted file mode 100644 index dc808b73b67ff..0000000000000 --- a/tests/basic/007.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Multiply 3 variables and print result ---FILE-- - ---EXPECT-- -64 diff --git a/tests/basic/008.phpt b/tests/basic/008.phpt deleted file mode 100644 index 511aef0df4307..0000000000000 --- a/tests/basic/008.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Divide 3 variables and print result ---FILE-- - ---EXPECT-- -3 diff --git a/tests/basic/009.phpt b/tests/basic/009.phpt deleted file mode 100644 index fefe529af1e85..0000000000000 --- a/tests/basic/009.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Subtract 3 variables and print result ---FILE-- - ---EXPECT-- -10 diff --git a/tests/basic/010.phpt b/tests/basic/010.phpt deleted file mode 100644 index 9cdfece9e1c8e..0000000000000 --- a/tests/basic/010.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Testing | and & operators ---FILE-- - ---EXPECT-- -8 diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt deleted file mode 100644 index 34eed7915a0b0..0000000000000 --- a/tests/basic/011.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Testing $argc and $argv handling (GET) ---SKIPIF-- - ---INI-- -register_argc_argv=1 ---GET-- -ab+cd+ef+123+test ---FILE-- - ---EXPECT-- -0: ab -1: cd -2: ef -3: 123 -4: test diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt deleted file mode 100644 index 32978532862e9..0000000000000 --- a/tests/basic/012.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Testing $argc and $argv handling (cli) ---SKIPIF-- - ---INI-- -register_argc_argv=1 -variables_order=GPS ---ARGS-- -ab cd ef 123 test ---FILE-- - ---EXPECT-- -0: ab -1: cd -2: ef -3: 123 -4: test diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt deleted file mode 100644 index 372285bfae3ef..0000000000000 --- a/tests/basic/bug20539.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #20539 (PHP CLI Segmentation Fault) ---INI-- -session.auto_start=1 -session.save_handler=files ---FILE-- - ---EXPECT-- -good :) diff --git a/tests/basic/bug29971.phpt b/tests/basic/bug29971.phpt deleted file mode 100755 index d4b654bdb1c48..0000000000000 --- a/tests/basic/bug29971.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #29971 (variables_order behaviour) ---INI-- -variables_order=GPC ---FILE-- - ---EXPECT-- -array(0) { -} -array(0) { -} -string(3) "GPC" diff --git a/tests/bin-info.inc b/tests/bin-info.inc deleted file mode 100644 index ad42ea897a8ab..0000000000000 --- a/tests/bin-info.inc +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/__call_001.phpt b/tests/classes/__call_001.phpt deleted file mode 100644 index ecc98744bfcb0..0000000000000 --- a/tests/classes/__call_001.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -ZE2 __call() ---SKIPIF-- - ---FILE-- -x; - } -} - -$foo = new Caller(); -$a = $foo->test(1, '2', 3.4, true); -var_dump($a); - -?> ---EXPECT-- -Method test called: -array(4) { - [0]=> - int(1) - [1]=> - string(1) "2" - [2]=> - float(3.4) - [3]=> - bool(true) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} ---UEXPECT-- -Method test called: -array(4) { - [0]=> - int(1) - [1]=> - unicode(1) "2" - [2]=> - float(3.4) - [3]=> - bool(true) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} diff --git a/tests/classes/__call_002.phpt b/tests/classes/__call_002.phpt deleted file mode 100755 index 53a179f787787..0000000000000 --- a/tests/classes/__call_002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 __call() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__call() must take exactly 2 arguments in %s__call_002.php on line %d diff --git a/tests/classes/__set__get_001.phpt b/tests/classes/__set__get_001.phpt deleted file mode 100644 index 105419e33e43d..0000000000000 --- a/tests/classes/__set__get_001.phpt +++ /dev/null @@ -1,96 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- - 1, 'b' => 2, 'c' => 3); - - function __get($nm) { - echo "Getting [$nm]\n"; - - if (isset($this->x[$nm])) { - $r = $this->x[$nm]; - echo "Returning: $r\n"; - return $r; - } - else { - echo "Nothing!\n"; - } - } - - function __set($nm, $val) { - echo "Setting [$nm] to $val\n"; - - if (isset($this->x[$nm])) { - $this->x[$nm] = $val; - echo "OK!\n"; - } - else { - echo "Not OK!\n"; - } - } -} - -$foo = new Setter(); - -// this doesn't go through __set()... should it? -$foo->n = 1; - -// the rest are fine... -$foo->a = 100; -$foo->a++; -$foo->z++; -var_dump($foo); - -?> ---EXPECTF-- -Setting [a] to 100 -OK! -Getting [a] -Returning: 100 -Setting [a] to 101 -OK! -Getting [z] -Nothing! -Setting [z] to 1 -Not OK! -object(setter)#%d (2) { - ["n"]=> - int(1) - ["x"]=> - array(3) { - ["a"]=> - int(101) - ["b"]=> - int(2) - ["c"]=> - int(3) - } -} ---UEXPECTF-- -Setting [a] to 100 -OK! -Getting [a] -Returning: 100 -Setting [a] to 101 -OK! -Getting [z] -Nothing! -Setting [z] to 1 -Not OK! -object(setter)#%d (2) { - [u"n"]=> - int(1) - [u"x"]=> - array(3) { - [u"a"]=> - int(101) - [u"b"]=> - int(2) - [u"c"]=> - int(3) - } -} diff --git a/tests/classes/__set__get_002.phpt b/tests/classes/__set__get_002.phpt deleted file mode 100755 index 71111ccdf810a..0000000000000 --- a/tests/classes/__set__get_002.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 __get() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__get() must take exactly 1 argument in %s__set__get_002.php on line %d diff --git a/tests/classes/__set__get_003.phpt b/tests/classes/__set__get_003.phpt deleted file mode 100755 index 390d3033627cf..0000000000000 --- a/tests/classes/__set__get_003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 __set() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__set() must take exactly 2 arguments in %s__set__get_003.php on line %d diff --git a/tests/classes/__set__get_004.phpt b/tests/classes/__set__get_004.phpt deleted file mode 100755 index b739428f33b3a..0000000000000 --- a/tests/classes/__set__get_004.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- -x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } - - function __set($name, $val) { - $this->x[$name] = $val; - } -} - -$foo = new Test(); -$bar = new Test(); -$bar->baz = "Check"; - -$foo->bar = $bar; - -var_dump($bar->baz); -var_dump($foo->bar->baz); - -?> -===DONE=== ---EXPECT-- -string(5) "Check" -string(5) "Check" -===DONE=== ---UEXPECT-- -unicode(5) "Check" -unicode(5) "Check" -===DONE=== diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt deleted file mode 100755 index 34fd567bfd7db..0000000000000 --- a/tests/classes/__set__get_005.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- -x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } - - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } -} - -class AutoGen -{ - protected $x; - - function __get($name) { - echo __METHOD__ . "\n"; - if (!isset($this->x[$name])) { - $this->x[$name] = new Test(); - } - return $this->x[$name]; - } - - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } -} - -$foo = new AutoGen(); -$foo->bar->baz = "Check"; - -var_dump($foo->bar); -var_dump($foo->bar->baz); - -?> -===DONE=== ---EXPECTF-- -AutoGen::__get -Test::__set -AutoGen::__get -object(Test)#%d (1) { - ["x":protected]=> - array(1) { - ["baz"]=> - string(5) "Check" - } -} -AutoGen::__get -Test::__get -string(5) "Check" -===DONE=== ---UEXPECTF-- -AutoGen::__get -Test::__set -AutoGen::__get -object(Test)#%d (1) { - [u"x":protected]=> - array(1) { - [u"baz"]=> - unicode(5) "Check" - } -} -AutoGen::__get -Test::__get -unicode(5) "Check" -===DONE=== diff --git a/tests/classes/__set_data_corrupt.phpt b/tests/classes/__set_data_corrupt.phpt deleted file mode 100644 index 86c39243d5623..0000000000000 --- a/tests/classes/__set_data_corrupt.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Data corruption in __set ---SKIPIF-- - ---FILE-- -null); - - function bar() { - echo $this->t ='f'; - } - function __get($prop) - { - return $this->pp[$prop]; - } - function __set($prop, $val) - { - echo "__set"; - $this->pp[$prop] = ''; - } -} -$f = new foo; -$f->bar(); -?> ---EXPECT-- -__setf diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt deleted file mode 100644 index fbebf4da73898..0000000000000 --- a/tests/classes/abstract.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 An abstract method may not be called ---SKIPIF-- - ---FILE-- -show(); -$t->error(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot call abstract method fail::show() in %s on line %d diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt deleted file mode 100644 index 571a9b95814fc..0000000000000 --- a/tests/classes/abstract_class.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 An abstract class cannot be instantiated ---SKIPIF-- - ---FILE-- -show(); - -$t = new fail(); -$t->show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_derived.phpt b/tests/classes/abstract_derived.phpt deleted file mode 100644 index 0feceac6bb283..0000000000000 --- a/tests/classes/abstract_derived.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 A derived class with an abstract method must be abstract ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- - -Fatal error: Class derived contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (derived::show) in %sabstract_derived.php on line %d diff --git a/tests/classes/abstract_final.phpt b/tests/classes/abstract_final.phpt deleted file mode 100644 index 20c7ae375f6a8..0000000000000 --- a/tests/classes/abstract_final.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 A final method cannot be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/abstract_inherit.phpt b/tests/classes/abstract_inherit.phpt deleted file mode 100644 index 362ccb0b766d9..0000000000000 --- a/tests/classes/abstract_inherit.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A class that inherits an abstract method is abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_not_declared.phpt b/tests/classes/abstract_not_declared.phpt deleted file mode 100644 index 3b81cd4980a3b..0000000000000 --- a/tests/classes/abstract_not_declared.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An abstract class must be declared abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %s on line %d diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt deleted file mode 100644 index 9a0a1edc3c23a..0000000000000 --- a/tests/classes/abstract_redeclare.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A method cannot be redeclared abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %sabstract_redeclare.php on line %d diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt deleted file mode 100644 index 2e46e9dc06dce..0000000000000 --- a/tests/classes/abstract_static.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A static abstrcat method may not be called ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call to function show() - -Fatal error: Cannot call abstract method fail::show() in %s on line %d diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt deleted file mode 100644 index 76eb9a676f842..0000000000000 --- a/tests/classes/array_access_001.phpt +++ /dev/null @@ -1,311 +0,0 @@ ---TEST-- -ZE2 ArrayAccess ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj->a); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->a); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->a); - -?> -===DONE=== ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -string(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -string(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_001.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_001.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -string(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -string(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -string(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -string(7) "Added 6" -object::offsetGet(0) -string(3) "1st" -object::offsetGet(2) -string(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== ---UEXPECTF-- -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - int(1) - [2]=> - unicode(3) "3rd" - [u"4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -unicode(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -unicode(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_001.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_001.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -unicode(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -unicode(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -unicode(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -unicode(7) "Added 6" -object::offsetGet(0) -unicode(3) "1st" -object::offsetGet(2) -unicode(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -unicode(9) "changed 6" -unicode(9) "changed 6" -===unset=== -array(6) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [2]=> - unicode(3) "3rd" - [u"4th"]=> - unicode(11) "Changed 4th" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} -===DONE=== diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt deleted file mode 100644 index c404806831384..0000000000000 --- a/tests/classes/array_access_002.phpt +++ /dev/null @@ -1,311 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetSet without return ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - /*return*/ $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj->a); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->a); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->a); - -?> -===DONE=== ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -string(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -string(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_002.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_002.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -string(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -string(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -string(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -string(7) "Added 6" -object::offsetGet(0) -string(3) "1st" -object::offsetGet(2) -string(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== ---UEXPECTF-- -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - int(1) - [2]=> - unicode(3) "3rd" - [u"4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -unicode(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -unicode(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_002.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_002.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -unicode(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -unicode(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -unicode(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -unicode(7) "Added 6" -object::offsetGet(0) -unicode(3) "1st" -object::offsetGet(2) -unicode(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -unicode(9) "changed 6" -unicode(9) "changed 6" -===unset=== -array(6) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [2]=> - unicode(3) "3rd" - [u"4th"]=> - unicode(11) "Changed 4th" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - unicode(3) "1st" - [1]=> - unicode(9) "Changed 1" - [u"5th"]=> - unicode(9) "Added 5th" - [6]=> - unicode(9) "changed 6" -} -===DONE=== diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt deleted file mode 100644 index df0fde9f79e48..0000000000000 --- a/tests/classes/array_access_003.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetGet ambiguties ---INI-- -error_reporting=8191 ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj[1]); -var_dump($obj[2]); -$obj[2]++; -var_dump($obj[2]); - -?> -===DONE=== ---EXPECTF-- -object::offsetGet(1) -string(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_003.php on line %d ---UEXPECTF-- -object::offsetGet(1) -unicode(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_003.php on line %d diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt deleted file mode 100644 index 30f179966a0a5..0000000000000 --- a/tests/classes/array_access_004.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetGet ambiguties ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj[1]); -var_dump($obj[2]); -$obj[2]++; -var_dump($obj[2]); - -?> -===DONE=== ---EXPECTF-- -object::offsetGet(1) -string(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_004.php on line %d ---UEXPECTF-- -object::offsetGet(1) -unicode(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_004.php on line %d diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt deleted file mode 100755 index bd12d94c88f8a..0000000000000 --- a/tests/classes/array_access_005.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and sub Arrays ---FILE-- -person = array(array('name'=>'Joe')); - } - - function offsetExists($index) { - return array_key_exists($this->person, $index); - } - - function offsetGet($index) { - return $this->person[$index]; - } - - function offsetSet($index, $value) { - $this->person[$index] = $value; - } - - function offsetUnset($index) { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Foo'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Bar'; -var_dump($people->person[0]['name']); - -echo "---ArrayOverloading---\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -var_dump($people->person[0]['name'] . 'Foo'); // impossible to assign this since we don't return references here -$x = $people[0]; // creates a copy -$x['name'] .= 'Foo'; -$people[0] = $x; -var_dump($people[0]); -$people[0]['name'] = 'JoeFoo'; -var_dump($people[0]['name']); -$people[0]['name'] = 'JoeFooBar'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Joe" -string(6) "JoeFoo" -string(9) "JoeFooBar" ----ArrayOverloading--- -array(1) { - ["name"]=> - string(3) "Joe" -} -string(3) "Joe" -string(6) "JoeFoo" -array(1) { - ["name"]=> - string(6) "JoeFoo" -} - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_005.php on line %d ---UEXPECTF-- -unicode(3) "Joe" -unicode(6) "JoeFoo" -unicode(9) "JoeFooBar" ----ArrayOverloading--- -array(1) { - [u"name"]=> - unicode(3) "Joe" -} -unicode(3) "Joe" -unicode(6) "JoeFoo" -array(1) { - [u"name"]=> - unicode(6) "JoeFoo" -} - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_005.php on line %d diff --git a/tests/classes/array_access_006.phpt b/tests/classes/array_access_006.phpt deleted file mode 100644 index 342a7e5107062..0000000000000 --- a/tests/classes/array_access_006.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ASSIGN_OP operators (+=) ---FILE-- -realArray = array(1,2,3); - } - - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } - - function offsetGet($index) { - return $this->realArray[$index]; - } - - function offsetSet($index, $value) { - $this->realArray[$index] = $value; - } - - function offsetUnset($index) { - unset($this->realArray[$index]); - } -} - -$a = new OverloadedArray; -$a[1] += 10; -var_dump($a[1]); -echo "---Done---\n"; -?> ---EXPECT-- -int(12) ----Done--- diff --git a/tests/classes/array_access_007.phpt b/tests/classes/array_access_007.phpt deleted file mode 100755 index 42187fe5d5f8e..0000000000000 --- a/tests/classes/array_access_007.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and [] assignment ---FILE-- -realArray = array(); - } - - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } - - function offsetGet($index) { - return $this->realArray[$index]; - } - - function offsetSet($index, $value) { - if (is_null($index)) { - $this->realArray[] = $value; - } else { - $this->realArray[$index] = $value; - } - } - - function offsetUnset($index) { - unset($this->realArray[$index]); - } - - function dump() { - var_dump($this->realArray); - } -} - -$a = new OverloadedArray; -$a[] = 1; -$a[1] = 2; -$a[2] = 3; -$a[] = 4; -$a->dump(); -?> -===DONE=== ---EXPECT-- -array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) -} -===DONE=== diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt deleted file mode 100755 index 61479f705d650..0000000000000 --- a/tests/classes/array_access_008.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ASSIGN_OP operators (.=) ---FILE-- -person = array(array('name'=>'Foo')); - } - - function offsetExists($index) { - return array_key_exists($this->person, $index); - } - - function offsetGet($index) { - return $this->person[$index]; - } - - function offsetSet($index, $value) { - $this->person[$index] = $value; - } - - function offsetUnset($index) { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -string(3) "Foo" - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_008.php on line %d ---UEXPECTF-- -unicode(3) "Foo" -unicode(6) "FooBar" -unicode(9) "FooBarBaz" -===ArrayOverloading=== -unicode(3) "Foo" - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_008.php on line %d diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt deleted file mode 100755 index 681fc7a8cd00c..0000000000000 --- a/tests/classes/array_access_009.phpt +++ /dev/null @@ -1,255 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayProxyAccess, ArrayProxy ---FILE-- -offsetExists($element)) - { - $object[$element] = array(); - } - $this->object = $object; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->object->proxyGet($this->element)); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $tmp = $this->object->proxyGet($this->element); - return isset($tmp[$index]) ? $tmp[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->object->proxySet($this->element, $index, $value); - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $this->object->proxyUnset($this->element, $index); - } -} - -class Peoples implements ArrayProxyAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayProxy($this, $index); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } - - function proxyGet($element) - { - return $this->person[$element]; - } - - function proxySet($element, $index, $value) - { - $this->person[$element][$index] = $value; - } - - function proxyUnset($element, $index) - { - unset($this->person[$element][$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { - ["object":"ArrayProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["element":"ArrayProxy":private]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(3) "Foo" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(6) "FooBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBarBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(9) "FooBarBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -ArrayProxy::offsetSet(0, name, FooBarBarBaz) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(12) "FooBarBarBaz" -ArrayProxy::__construct(0) -ArrayProxy::offsetUnset(0, name) -ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { - ["object":"ArrayProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - array(1) { - [0]=> - array(0) { - } - } - } - ["element":"ArrayProxy":private]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -NULL -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, BlaBla) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(6) "BlaBla" -===DONE=== ---UEXPECTF-- -unicode(3) "Foo" -unicode(6) "FooBar" -unicode(9) "FooBarBaz" -===ArrayOverloading=== -ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { - [u"object":u"ArrayProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - array(1) { - [0]=> - array(1) { - [u"name"]=> - unicode(3) "Foo" - } - } - } - [u"element":u"ArrayProxy":private]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -unicode(3) "Foo" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -unicode(6) "FooBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBarBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -unicode(9) "FooBarBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -ArrayProxy::offsetSet(0, name, FooBarBarBaz) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -unicode(12) "FooBarBarBaz" -ArrayProxy::__construct(0) -ArrayProxy::offsetUnset(0, name) -ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { - [u"object":u"ArrayProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - array(1) { - [0]=> - array(0) { - } - } - } - [u"element":u"ArrayProxy":private]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -NULL -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, BlaBla) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -unicode(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt deleted file mode 100755 index 71865b5fe78b1..0000000000000 --- a/tests/classes/array_access_010.phpt +++ /dev/null @@ -1,237 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayReferenceProxy with references ---FILE-- -object = $object; - $this->element = &$element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->element); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return isset($this->element[$index]) ? $this->element[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->element[$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - unset($this->element[$index]); - } -} - -class Peoples implements ArrayAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayReferenceProxy($this, $this->person[$index]); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== - ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { - ["object":"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - array(1) { - [0]=> - &array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["element":"ArrayReferenceProxy":private]=> - &array(1) { - ["name"]=> - string(3) "Foo" - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(3) "Foo" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(6) "FooBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(9) "FooBarBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBarBaz) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(12) "FooBarBarBaz" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetUnset(Array, name) -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { - ["object":"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - array(1) { - [0]=> - &array(0) { - } - } - } - ["element":"ArrayReferenceProxy":private]=> - &array(0) { - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -NULL -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, BlaBla) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(6) "BlaBla" -===DONE=== ---UEXPECTF-- -unicode(3) "Foo" -unicode(6) "FooBar" -unicode(9) "FooBarBaz" -===ArrayOverloading=== -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { - [u"object":u"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - array(1) { - [0]=> - &array(1) { - [u"name"]=> - unicode(3) "Foo" - } - } - } - [u"element":u"ArrayReferenceProxy":private]=> - &array(1) { - [u"name"]=> - unicode(3) "Foo" - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -unicode(3) "Foo" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -unicode(6) "FooBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -unicode(9) "FooBarBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBarBaz) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -unicode(12) "FooBarBarBaz" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetUnset(Array, name) -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { - [u"object":u"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - array(1) { - [0]=> - &array(0) { - } - } - } - [u"element":u"ArrayReferenceProxy":private]=> - &array(0) { - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -NULL -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, BlaBla) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -unicode(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt deleted file mode 100755 index 393814cd2e9b3..0000000000000 --- a/tests/classes/array_access_011.phpt +++ /dev/null @@ -1,266 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main array ---FILE-- -object = $object; - $this->oarray = &$array; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->oarray[$this->element]); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->oarray[$this->element][$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - unset($this->oarray[$this->element][$index]); - } -} - -class Peoples implements ArrayAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - if (is_array($this->person[$index])) - { - return new ArrayAccessReferenceProxy($this, $this->person, $index); - } - else - { - return $this->person[$index]; - } - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== - ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { - ["object":"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - &array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["oarray":"ArrayAccessReferenceProxy":private]=> - &array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - ["element":"ArrayAccessReferenceProxy":private]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(3) "Foo" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(6) "FooBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(9) "FooBarBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBarBaz) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(12) "FooBarBarBaz" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetUnset(0, name) -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { - ["object":"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { - ["person"]=> - &array(1) { - [0]=> - array(0) { - } - } - } - ["oarray":"ArrayAccessReferenceProxy":private]=> - &array(1) { - [0]=> - array(0) { - } - } - ["element":"ArrayAccessReferenceProxy":private]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -NULL -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(6) "BlaBla" -===DONE=== ---UEXPECTF-- -unicode(3) "Foo" -unicode(6) "FooBar" -unicode(9) "FooBarBaz" -===ArrayOverloading=== -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { - [u"object":u"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - &array(1) { - [0]=> - array(1) { - [u"name"]=> - unicode(3) "Foo" - } - } - } - [u"oarray":u"ArrayAccessReferenceProxy":private]=> - &array(1) { - [0]=> - array(1) { - [u"name"]=> - unicode(3) "Foo" - } - } - [u"element":u"ArrayAccessReferenceProxy":private]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -unicode(3) "Foo" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -unicode(6) "FooBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -unicode(9) "FooBarBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBarBaz) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -unicode(12) "FooBarBarBaz" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetUnset(0, name) -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { - [u"object":u"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { - [u"person"]=> - &array(1) { - [0]=> - array(0) { - } - } - } - [u"oarray":u"ArrayAccessReferenceProxy":private]=> - &array(1) { - [0]=> - array(0) { - } - } - [u"element":u"ArrayAccessReferenceProxy":private]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -NULL -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -unicode(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt deleted file mode 100755 index d7503ec05ca42..0000000000000 --- a/tests/classes/array_access_012.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -ZE2 ArrayAccess cannot assign by reference ---FILE-- -data[$index] = $value; - } - - public function offsetGet($index) { - return $this->data[$index]; - } - - public function offsetExists($index) { - return isset($this->data[$index]); - } -} - -$data = new ArrayAccessImpl(); -$test = 'some data'; -$data['element'] = NULL; // prevent notice -$data['element'] = &$test; - -?> -===DONE=== - ---EXPECTF-- - -Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %sarray_access_012.php on line %d diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt deleted file mode 100755 index c3dee3f5cb979..0000000000000 --- a/tests/classes/array_access_013.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -ZE2 arrayAcces & exceptions ---FILE-- -getMessage() . "()\n"; -} - -try -{ - echo $t[0]; -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} - -try -{ - $t[0] = 1; -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} - -try -{ - unset($t[0]); -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} -?> -===DONE=== ---EXPECT-- -Caught in Test::offsetExists() -Caught in Test::offsetGet() -Caught in Test::offsetSet() -Caught in Test::offsetUnset() -===DONE=== diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt deleted file mode 100644 index 54e519e8f62c2..0000000000000 --- a/tests/classes/assign_op_property_001.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 assign_op property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property = "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$obj->a += 2; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(4) ----Done--- diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt deleted file mode 100755 index 6f325f49bb5f3..0000000000000 --- a/tests/classes/autoload_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Autoload and class_exists ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt deleted file mode 100755 index dd2a3324a2c68..0000000000000 --- a/tests/classes/autoload_002.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -ZE2 Autoload and get_class_methods ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -array(1) { - [0]=> - string(12) "testFunction" -} -===DONE=== ---UEXPECT-- -__autoload(autoload_root) -array(1) { - [0]=> - unicode(12) "testFunction" -} -===DONE=== diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt deleted file mode 100755 index 7bdb5da36af36..0000000000000 --- a/tests/classes/autoload_003.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -ZE2 Autoload and derived classes ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -__autoload(autoload_derived) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt deleted file mode 100755 index 23aea5d086697..0000000000000 --- a/tests/classes/autoload_004.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 Autoload and recursion ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -bool(false) -bool(false) -__autoload(autoload_root) -__autoload(autoload_derived) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt deleted file mode 100755 index 36a4e18f0ba95..0000000000000 --- a/tests/classes/autoload_005.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ZE2 Autoload from destructor ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(false) -Test::__destruct -bool(false) -bool(false) -__autoload(autoload_root) -__autoload(autoload_derived) -object(autoload_derived)#%d (0) { -} -===DONE=== diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt deleted file mode 100755 index 9af6fc98299dc..0000000000000 --- a/tests/classes/autoload_006.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -ZE2 Autoload from destructor ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(false) -__autoload(autoload_interface) -__autoload(Autoload_Implements) -object(autoload_implements)#%d (0) { -} -bool(true) -bool(true) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_derived.p5c b/tests/classes/autoload_derived.p5c deleted file mode 100755 index 93a4b3579ac81..0000000000000 --- a/tests/classes/autoload_derived.p5c +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c deleted file mode 100755 index 2c3479c860787..0000000000000 --- a/tests/classes/autoload_implements.p5c +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c deleted file mode 100755 index 6908155e610e8..0000000000000 --- a/tests/classes/autoload_interface.p5c +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_root.p5c b/tests/classes/autoload_root.p5c deleted file mode 100755 index 9559d36d32e8a..0000000000000 --- a/tests/classes/autoload_root.p5c +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/bug23951.phpt b/tests/classes/bug23951.phpt deleted file mode 100644 index 2e272b87fe9ad..0000000000000 --- a/tests/classes/bug23951.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #23951 (Defines not working in inherited classes) ---FILE-- -'foo1_value', FOO2=>'foo2_value'); - -} - -class B extends A { - - public $b_var = 'foo'; - -} - -$a = new A; -$b = new B; - -print_r($a); -print_r($b->a_var); -print_r($b->b_var); - -?> ---EXPECT-- -A Object -( - [a_var] => Array - ( - [1] => foo1_value - [2] => foo2_value - ) - -) -Array -( - [1] => foo1_value - [2] => foo2_value -) -foo diff --git a/tests/classes/bug24399.phpt b/tests/classes/bug24399.phpt deleted file mode 100644 index fedf8e5d245ab..0000000000000 --- a/tests/classes/bug24399.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #24399 (is_subclass_of() crashes when parent class doesn't exist) ---FILE-- - ---EXPECT-- -bool(false) diff --git a/tests/classes/bug24445.phpt b/tests/classes/bug24445.phpt deleted file mode 100644 index af08307ac464c..0000000000000 --- a/tests/classes/bug24445.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #24445 (get_parent_class() returns the current class when passed an object) ---FILE-- - ---EXPECT-- -bool(false) -bool(false) diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt deleted file mode 100644 index e190318ffd819..0000000000000 --- a/tests/classes/bug26737.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #26737 (Protected and private variables are not saved on serialization when a user defined __sleep is used) ---FILE-- - ---EXPECTF-- -Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d -string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}" diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt deleted file mode 100644 index 971273224dd27..0000000000000 --- a/tests/classes/bug27468.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #27468 (foreach in __destruct() causes segfault) ---FILE-- -x as $x); - } -} -new foo(); -echo 'OK'; -?> ---EXPECTF-- -Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4 -OK diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt deleted file mode 100644 index 64d68ba8aeb84..0000000000000 --- a/tests/classes/bug27504.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #27504 (call_user_func_array allows calling of private/protected methods) ---FILE-- -bar('1'); - } - private function bar ( $param ) { - echo 'Called function foo:bar('.$param.')'."\n"; - } - } - - $foo = new foo(); - - call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); - - $foo->bar('3'); -?> ---EXPECTF-- -Called function foo:bar(%d) - -Fatal error: Call to private method foo::bar() from context '' in %s on line 13 - diff --git a/tests/classes/bug29446.phpt b/tests/classes/bug29446.phpt deleted file mode 100644 index 5e30e8e74b2fd..0000000000000 --- a/tests/classes/bug29446.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #29446 (ZE allows multiple declarations of the same class constant) ---FILE-- - ---EXPECTF-- -Fatal error: Cannot redefine class constant testClass::TEST_CONST in %s on line 5 \ No newline at end of file diff --git a/tests/classes/class_abstract.phpt b/tests/classes/class_abstract.phpt deleted file mode 100755 index 880f84930fd46..0000000000000 --- a/tests/classes/class_abstract.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 An abstract class cannot be instanciated ---SKIPIF-- - ---FILE-- -show(); - -$t = new base(); -$t->show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -base - -Fatal error: Cannot instantiate abstract class base in %s on line %d diff --git a/tests/classes/class_example.phpt b/tests/classes/class_example.phpt deleted file mode 100644 index 621958b1bd23f..0000000000000 --- a/tests/classes/class_example.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Classes general test ---FILE-- - -first_name."\n"; - echo "Family name:\t ".$this->family_name."\n"; - echo "Address:\t ".$this->address."\n"; - echo "Phone:\t\t ".$this->phone_num."\n"; - echo "\n\n"; - } - function initialize($first_name,$family_name,$address,$phone_num) - { - $this->first_name = $first_name; - $this->family_name = $family_name; - $this->address = $address; - $this->phone_num = $phone_num; - } -}; - - -function test($u) -{ /* one can pass classes as arguments */ - $u->display(); - $t = $u; - $t->address = "New address..."; - return $t; /* and also return them as return values */ -} - -$user1 = new user; -$user2 = new user; - -$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik, Israel","+972-4-8713139"); -$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621"); -$user1->display(); -$user2->display(); - -$tmp = test($user2); -$tmp->display(); - -?> ---EXPECT-- -User information ----------------- - -First name: Zeev -Family name: Suraski -Address: Ben Gourion 3, Kiryat Bialik, Israel -Phone: +972-4-8713139 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: New address... -Phone: +972-4-8231621 diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt deleted file mode 100755 index 5c73cb25563eb..0000000000000 --- a/tests/classes/class_final.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A final class cannot be inherited ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class derived may not inherit from final class (base) in %s on line %d diff --git a/tests/classes/class_stdclass.phpt b/tests/classes/class_stdclass.phpt deleted file mode 100755 index 5e3422aeae91f..0000000000000 --- a/tests/classes/class_stdclass.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Instantiate stdClass ---FILE-- - ---EXPECTF-- -stdClass -Done diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt deleted file mode 100755 index b4554dc30de5b..0000000000000 --- a/tests/classes/clone_001.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -ZE2 object cloning, 1 ---SKIPIF-- - ---FILE-- -p2 = 'A'; -$obj->p3 = 'B'; -$copy = clone $obj; -$copy->p3 = 'C'; -echo "Object\n"; -var_dump($obj); -echo "Clown\n"; -var_dump($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -object(test)#1 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "B" -} -Clown -object(test)#2 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "C" -} -Done ---UEXPECT-- -Object -object(test)#1 (3) { - [u"p1"]=> - int(1) - [u"p2"]=> - unicode(1) "A" - [u"p3"]=> - unicode(1) "B" -} -Clown -object(test)#2 (3) { - [u"p1"]=> - int(1) - [u"p2"]=> - unicode(1) "A" - [u"p3"]=> - unicode(1) "C" -} -Done diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt deleted file mode 100755 index 2c319ed3d27df..0000000000000 --- a/tests/classes/clone_002.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -ZE2 object cloning, 2 ---SKIPIF-- - ---FILE-- -p2 = 'A'; -$obj->p3 = 'B'; -$copy = clone $obj; -$copy->p3 = 'C'; -echo "Object\n"; -var_dump($obj); -echo "Clown\n"; -var_dump($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -object(test)#1 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "B" -} -Clown -object(test)#2 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "C" -} -Done ---UEXPECT-- -Object -object(test)#1 (3) { - [u"p1"]=> - int(1) - [u"p2"]=> - unicode(1) "A" - [u"p3"]=> - unicode(1) "B" -} -Clown -object(test)#2 (3) { - [u"p1"]=> - int(1) - [u"p2"]=> - unicode(1) "A" - [u"p3"]=> - unicode(1) "C" -} -Done diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt deleted file mode 100755 index 9a251c506f4ee..0000000000000 --- a/tests/classes/clone_003.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -ZE2 object cloning, 3 ---SKIPIF-- - ---FILE-- -p5 = 'clone:5'; - } -} - -$obj = new test; -$obj->p4 = 'A'; -$copy = clone $obj; -echo "Object\n"; -print_r($obj); -echo "Clown\n"; -print_r($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -test Object -( - [p1] => test:1 - [p3] => test:3 - [p4] => A - [p5] => test:5 - [p2] => base:2 - [p6:base:private] => base:6 -) -Clown -test Object -( - [p1] => test:1 - [p3] => test:3 - [p4] => A - [p5] => clone:5 - [p2] => base:2 - [p6:base:private] => base:6 -) -Done diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt deleted file mode 100755 index 1116aa62d3319..0000000000000 --- a/tests/classes/clone_004.phpt +++ /dev/null @@ -1,125 +0,0 @@ ---TEST-- -ZE2 object cloning, 4 ---FILE-- -a = array(1,2); -$o1->b = array(3,4); -$o1->show(); - -echo "Clone\n"; -$o2 = clone $o1; -$o2->show(); - -echo "Modify\n"; -$o2->a = 5; -$o2->b = 6; -$o2->show(); - -echo "Done\n"; -?> ---EXPECT-- -Original -object(test)#1 (2) { - ["b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - ["a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Clone -object(test)#2 (2) { - ["b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - ["a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Modify -object(test)#2 (2) { - ["b"]=> - int(6) - ["a"]=> - int(5) -} -Done ---UEXPECT-- -Original -object(test)#1 (2) { - [u"b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [u"a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Clone -object(test)#2 (2) { - [u"b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - [u"a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Modify -object(test)#2 (2) { - [u"b"]=> - int(6) - [u"a"]=> - int(5) -} -Done diff --git a/tests/classes/clone_005.phpt b/tests/classes/clone_005.phpt deleted file mode 100755 index bfe4d66d6fa5f..0000000000000 --- a/tests/classes/clone_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 object cloning, 5 ---FILE-- - ---EXPECTF-- -Fatal error: Cannot override final method base::__clone() in %sclone_005.php on line %d diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt deleted file mode 100755 index de22fec151938..0000000000000 --- a/tests/classes/clone_006.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 object cloning, 6 ---SKIPIF-- - ---INI-- -error_reporting=2047 ---FILE-- -id = self::$id++; - } - - function __clone() { - $this->address = "New York"; - $this->id = self::$id++; - } -} - -$original = new MyCloneable(); - -$original->name = "Hello"; -$original->address = "Tel-Aviv"; - -echo $original->id . "\n"; - -$clone = clone $original; - -echo $clone->id . "\n"; -echo $clone->name . "\n"; -echo $clone->address . "\n"; - -?> ---EXPECT-- -0 -1 -Hello -New York diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt deleted file mode 100644 index 50066282eaa2d..0000000000000 --- a/tests/classes/constants_scope_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 class constants and scope ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d -FATAL = FATAL -self::FATAL = Fatal error -self::FATAL = Worst error -parent::FATAL = Fatal error diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt deleted file mode 100644 index ea6813cc96d6e..0000000000000 --- a/tests/classes/ctor_dtor.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -ZE2 The new constructor/destructor is called ---SKIPIF-- - ---FILE-- -early(); -unset($t); -$t = new late(); -//unset($t); delay to end of script - -echo "Done\n"; -?> ---EXPECTF-- -early::early -early::early -early::__destruct -late::__construct -Done -late::__destruct diff --git a/tests/classes/ctor_dtor_inheritance.phpt b/tests/classes/ctor_dtor_inheritance.phpt deleted file mode 100644 index 8ae2a5dec485e..0000000000000 --- a/tests/classes/ctor_dtor_inheritance.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -ZE2 A derived class can use the inherited constructor/destructor ---SKIPIF-- - ---FILE-- -name = 'base'; - print_r($this); - } - - function __destruct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } -} - -class derived extends base { - public $other; - - function __construct() { - $this->name = 'init'; - $this->other = 'other'; - print_r($this); - parent::__construct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - $this->name = 'derived'; - print_r($this); - } - - function __destruct() { - parent::__destruct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } -} - -echo "Testing class base\n"; -$t = new base(); -unset($t); -echo "Testing class derived\n"; -$t = new derived(); -unset($t); - -echo "Done\n"; -?> ---EXPECTF-- -Testing class base -base::__construct -base Object -( - [name] => base -) -base::__destruct -base Object -( - [name] => base -) -Testing class derived -derived Object -( - [other] => other - [name] => init -) -base::__construct -derived Object -( - [other] => other - [name] => base -) -derived::__construct -derived Object -( - [other] => other - [name] => derived -) -base::__destruct -derived Object -( - [other] => other - [name] => derived -) -derived::__destruct -derived Object -( - [other] => other - [name] => derived -) -Done diff --git a/tests/classes/ctor_failure.phpt b/tests/classes/ctor_failure.phpt deleted file mode 100755 index b7d3b64dda6b9..0000000000000 --- a/tests/classes/ctor_failure.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 Do not call destructors if constructor fails ---FILE-- -getMessage() . ")\n"; -} - -?> -===DONE=== ---EXPECT-- -Test::__construct(Hello) -Caught Exception(Hello) -===DONE=== diff --git a/tests/classes/ctor_name_clash.phpt b/tests/classes/ctor_name_clash.phpt deleted file mode 100644 index 1a1d6fa511d0d..0000000000000 --- a/tests/classes/ctor_name_clash.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 The child class can re-use the parent class name for a function member ---FILE-- -base(); -?> ---EXPECTF-- -base::base -derived::base diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt deleted file mode 100644 index dd2aba78e5788..0000000000000 --- a/tests/classes/dereferencing_001.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 dereferencing of objects from methods ---SKIPIF-- - ---FILE-- -name = $_name; - } - - function display() { - echo $this->name . "\n"; - } -} - -class Person { - private $name; - - function person($_name, $_address) { - $this->name = new Name($_name); - } - - function getName() { - return $this->name; - } -} - -$person = new Person("John", "New York"); -$person->getName()->display(); - -?> ---EXPECT-- -John diff --git a/tests/classes/destructor_and_echo.phpt b/tests/classes/destructor_and_echo.phpt deleted file mode 100755 index c6c6f23a7185c..0000000000000 --- a/tests/classes/destructor_and_echo.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Destructors and echo ---FILE-- - -===DONE=== ---EXPECT-- -Test::__construct -===DONE=== -Test::__destruct diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt deleted file mode 100755 index 8100c924656e3..0000000000000 --- a/tests/classes/destructor_and_exceptions.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -ZE2 catch exception thrown in destructor ---FILE-- -getMessage() . "\n"; -} - -class FatalException extends Exception -{ - function __construct($what) - { - echo __METHOD__ . "\n"; - $o = new FailClass; - unset($o); - echo "Done: " . __METHOD__ . "\n"; - } -} - -try -{ - throw new FatalException("Damn"); -} -catch(Exception $e) -{ - echo "Caught Exception: " . $e->getMessage() . "\n"; -} -catch(FatalException $e) -{ - echo "Caught FatalException: " . $e->getMessage() . "\n"; -} - -?> -===DONE=== ---EXPECTF-- -FailClass::__destruct -Caught: FailClass -FatalException::__construct -FailClass::__destruct -Caught Exception: FailClass -===DONE=== diff --git a/tests/classes/destructor_and_globals.phpt b/tests/classes/destructor_and_globals.phpt deleted file mode 100755 index 9caf0f1026783..0000000000000 --- a/tests/classes/destructor_and_globals.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -ZE2 accessing globals from destructor in shutdown ---FILE-- -id = $test_num++; - } - - public function Show() { - echo 'Id: '.$this->id."\n"; - } - - // try protected here - public function __destruct() { - global $test_cnt; - $test_cnt--; - } - - static public function destroy(&$obj) { - $obj = NULL; - } -} -Show(); -$obj1 = new counter; -$obj1->Show(); -Show(); -$obj2 = new counter; -$obj2->Show(); -Show(); -counter::destroy($obj1); -Show(); -// or uncomment this line and it works -//counter::destroy($obj2); -echo "Done\n"; -?> ---EXPECT-- -Count: 0 -Id: 0 -Count: 1 -Id: 1 -Count: 2 -Count: 1 -Done diff --git a/tests/classes/destructor_and_references.phpt b/tests/classes/destructor_and_references.phpt deleted file mode 100755 index 66e8b41f7d2f4..0000000000000 --- a/tests/classes/destructor_and_references.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Destructing and references ---FILE-- -x = &$o4; - -$r1 = &$o1; - -class once {} - -$o = new once; -echo "Done\n"; -?> ---EXPECT-- -Done \ No newline at end of file diff --git a/tests/classes/destructor_inheritance.phpt b/tests/classes/destructor_inheritance.phpt deleted file mode 100755 index b9a46659b052f..0000000000000 --- a/tests/classes/destructor_inheritance.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 The inherited destructor is called ---SKIPIF-- - ---FILE-- - ---EXPECT-- -base::__construct -base::__destruct -Done \ No newline at end of file diff --git a/tests/classes/destructor_visibility_001.phpt b/tests/classes/destructor_visibility_001.phpt deleted file mode 100755 index 7674c512f62a7..0000000000000 --- a/tests/classes/destructor_visibility_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -Fatal error: Call to private Derived::__destruct() from context '' in %sdestructor_visibility_001.php on line %d diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt deleted file mode 100755 index 2cc83334a9870..0000000000000 --- a/tests/classes/destructor_visibility_002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to private Derived::__destruct() from context '' during shutdown ignored in Unknown on line %d diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt deleted file mode 100755 index 83e3efe22e449..0000000000000 --- a/tests/classes/destructor_visibility_003.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -Derived::__destruct -===DONE=== diff --git a/tests/classes/factory_001.phpt b/tests/classes/factory_001.phpt deleted file mode 100644 index 97b69c1b4778e..0000000000000 --- a/tests/classes/factory_001.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 factory objects ---SKIPIF-- - ---FILE-- -draw(); -ShapeFactoryMethod("Square")->draw(); - -?> ---EXPECT-- -Circle -Square diff --git a/tests/classes/factory_and_singleton_001.phpt b/tests/classes/factory_and_singleton_001.phpt deleted file mode 100755 index 70fa020a49a97..0000000000000 --- a/tests/classes/factory_and_singleton_001.phpt +++ /dev/null @@ -1,101 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 1 ---SKIPIF-- - ---FILE-- -x = $x; - } - - static function destroy() { - test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { - return $this->x; - } - - static public function getX() { - if (test::$test) { - return test::$test->x; - } else { - return NULL; - } - } - - static public function count() { - return test::$cnt; - } -} - -echo "Access static members\n"; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Create x and y\n"; -$x = test::factory(1); -$y = test::factory(2); -var_dump(test::getX()); -var_dump(test::count()); -var_dump($x->get()); -var_dump($y->get()); - -echo "Destruct x\n"; -$x = NULL; -var_dump(test::getX()); -var_dump(test::count()); -var_dump($y->get()); - -echo "Destruct y\n"; -$y = NULL; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Destruct static\n"; -test::destroy(); -var_dump(test::getX()); -var_dump(test::count()); - -echo "Done\n"; -?> ---EXPECT-- -Access static members -NULL -int(0) -Create x and y -int(1) -int(1) -int(1) -int(1) -Destruct x -int(1) -int(1) -int(1) -Destruct y -int(1) -int(1) -Destruct static -NULL -int(0) -Done diff --git a/tests/classes/factory_and_singleton_002.phpt b/tests/classes/factory_and_singleton_002.phpt deleted file mode 100755 index 3308a561a506e..0000000000000 --- a/tests/classes/factory_and_singleton_002.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 2 ---SKIPIF-- - ---FILE-- -x = $x; - } - - static function destroy() { - test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { - return $this->x; - } - - static public function getX() { - if (test::$test) { - return test::$test->x; - } else { - return NULL; - } - } - - static public function count() { - return test::$cnt; - } -} - -echo "Access static members\n"; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Create x and y\n"; -$x = test::factory(1); -$y = test::factory(2); -var_dump(test::getX()); -var_dump(test::count()); -var_dump($x->get()); -var_dump($y->get()); - -echo "Destruct x\n"; -$x = NULL; -var_dump(test::getX()); -var_dump(test::count()); -var_dump($y->get()); - -echo "Destruct y\n"; -$y = NULL; -var_dump(test::getX()); -var_dump(test::count()); - -//echo "Destruct static\n"; -//test::destroy(); -//var_dump(test::getX()); -//var_dump(test::count()); - -echo "Done\n"; -?> ---EXPECT-- -Access static members -NULL -int(0) -Create x and y -int(1) -int(1) -int(1) -int(1) -Destruct x -int(1) -int(1) -int(1) -Destruct y -int(1) -int(1) -Done - -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt deleted file mode 100755 index d81cc4642c5f8..0000000000000 --- a/tests/classes/factory_and_singleton_003.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 3 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__construct() from context '' %sfactory_and_singleton_003.php on line %d diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt deleted file mode 100755 index 01c53d85a3ce4..0000000000000 --- a/tests/classes/factory_and_singleton_004.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 4 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__construct() from context '' %sfactory_and_singleton_004.php on line %d diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt deleted file mode 100755 index 2cd7e5cc997b7..0000000000000 --- a/tests/classes/factory_and_singleton_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 5 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php on line %d diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt deleted file mode 100755 index 81cf714888b87..0000000000000 --- a/tests/classes/factory_and_singleton_006.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 6 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php on line %d - diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt deleted file mode 100755 index 4788dbf08795d..0000000000000 --- a/tests/classes/factory_and_singleton_007.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 7 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__clone() from context '' %sfactory_and_singleton_007.php on line %d diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt deleted file mode 100755 index 750b9db340d1e..0000000000000 --- a/tests/classes/factory_and_singleton_008.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__clone() from context '' %sfactory_and_singleton_008.php on line %d diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt deleted file mode 100755 index acf792c31639e..0000000000000 --- a/tests/classes/factory_and_singleton_009.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 9 ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt deleted file mode 100755 index 0f5fb2dc74b13..0000000000000 --- a/tests/classes/factory_and_singleton_010.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 10 ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to private test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/final.phpt b/tests/classes/final.phpt deleted file mode 100644 index b4e37a36f6464..0000000000000 --- a/tests/classes/final.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 A method may be redeclared final ---SKIPIF-- - ---FILE-- -show(); - -class second extends first { - final function show() { - echo "Call to function second::show()\n"; - } -} - -$t2 = new second(); -$t2->show(); - -echo "Done\n"; -?> ---EXPECTF-- -Call to function first::show() -Call to function second::show() -Done \ No newline at end of file diff --git a/tests/classes/final_abstract.phpt b/tests/classes/final_abstract.phpt deleted file mode 100644 index 426c852cfc5b2..0000000000000 --- a/tests/classes/final_abstract.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 A final method cannot be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s diff --git a/tests/classes/final_redeclare.phpt b/tests/classes/final_redeclare.phpt deleted file mode 100644 index e8f2e6ff09ecb..0000000000000 --- a/tests/classes/final_redeclare.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -ZE2 A final method may not be overwritten ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot override final method pass::show() in %s on line %d diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt deleted file mode 100644 index 39bf06f65fba2..0000000000000 --- a/tests/classes/incdec_property_001.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 post increment/decrement property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property = "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$obj->a++; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt deleted file mode 100644 index fe08625ea8006..0000000000000 --- a/tests/classes/incdec_property_002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 post increment/decrement property of overloaded object with assignment ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property = "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$t1 = $obj->a++; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt deleted file mode 100644 index d26277ab8d1c0..0000000000000 --- a/tests/classes/incdec_property_003.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 pre increment/decrement property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property = "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -++$obj->a; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt deleted file mode 100644 index 5ccad190b8a08..0000000000000 --- a/tests/classes/incdec_property_004.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 pre increment/decrement property of overloaded object with assignment ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property = "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$t1 = ++$obj->a; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt deleted file mode 100644 index 070ad9147d7c7..0000000000000 --- a/tests/classes/inheritance.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Classes inheritance test ---FILE-- -a."\n"; - echo "b = ".$this->b."\n"; - } - function mul() { - return $this->a*$this->b; - } -}; - -class bar extends foo { - public $c; - function display() { /* alternative display function for class bar */ - echo "This is class bar\n"; - echo "a = ".$this->a."\n"; - echo "b = ".$this->b."\n"; - echo "c = ".$this->c."\n"; - } -}; - - -$foo1 = new foo; -$foo1->a = 2; -$foo1->b = 5; -$foo1->display(); -echo $foo1->mul()."\n"; - -echo "-----\n"; - -$bar1 = new bar; -$bar1->a = 4; -$bar1->b = 3; -$bar1->c = 12; -$bar1->display(); -echo $bar1->mul()."\n"; ---EXPECT-- -This is class foo -a = 2 -b = 5 -10 ------ -This is class bar -a = 4 -b = 3 -c = 12 -12 diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt deleted file mode 100755 index 185a913280163..0000000000000 --- a/tests/classes/inheritance_002.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -ZE2 Constructor precedence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -### PHP 4 style -string(17) "Child constructor" -string(16) "Base constructor" -### PHP 5 style -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 1 -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 2 -string(17) "Child constructor" -string(16) "Base constructor" ---UEXPECT-- -### PHP 4 style -unicode(17) "Child constructor" -unicode(16) "Base constructor" -### PHP 5 style -unicode(17) "Child constructor" -unicode(16) "Base constructor" -### Mixed style 1 -unicode(17) "Child constructor" -unicode(16) "Base constructor" -### Mixed style 2 -unicode(17) "Child constructor" -unicode(16) "Base constructor" diff --git a/tests/classes/interface_and_extends.phpt b/tests/classes/interface_and_extends.phpt deleted file mode 100755 index f9040ae4a9c04..0000000000000 --- a/tests/classes/interface_and_extends.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 a class cannot extend an interface ---SKIPIF-- - ---FILE-- -show(); - -?> -===DONE=== ---EXPECTF-- -Fatal error: Class Tester cannot extend from interface Test in %sinterface_and_extends.php on line %d diff --git a/tests/classes/interface_class.phpt b/tests/classes/interface_class.phpt deleted file mode 100644 index 22520de1f9c81..0000000000000 --- a/tests/classes/interface_class.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 A class can only implement interfaces ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: derived cannot implement base - it is not an interface in %s on line %d diff --git a/tests/classes/interface_construct.phpt b/tests/classes/interface_construct.phpt deleted file mode 100755 index 406462e17ad4a..0000000000000 --- a/tests/classes/interface_construct.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 An interface constructor signature must not be inherited ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo - diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt deleted file mode 100644 index e1dd31fd4d8de..0000000000000 --- a/tests/classes/interface_doubled.phpt +++ /dev/null @@ -1,201 +0,0 @@ ---TEST-- -ZE2 An interface extends base interfaces ---SKIPIF-- - ---FILE-- -test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_b\n"; - -class class_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_b(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_c\n"; - -class class_c extends base implements if_c { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_c(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_d\n"; - -class class_d extends base implements if_d{ - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_d(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_e\n"; - -class class_e extends base implements if_a, if_b, if_c, if_d { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_e(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_f\n"; - -class class_f extends base implements if_e { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_f(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_g\n"; - -class class_g extends base implements if_f { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_g(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -?> -===DONE=== ---EXPECTF-- -class_a -is_a(class_a, if_a) yes -is_a(class_a, if_b) no -is_a(class_a, if_c) no -is_a(class_a, if_d) no -is_a(class_a, if_e) no -class_b -is_a(class_b, if_a) yes -is_a(class_b, if_b) yes -is_a(class_b, if_c) no -is_a(class_b, if_d) no -is_a(class_b, if_e) no -class_c -is_a(class_c, if_a) yes -is_a(class_c, if_b) yes -is_a(class_c, if_c) yes -is_a(class_c, if_d) no -is_a(class_c, if_e) no -class_d -is_a(class_d, if_a) yes -is_a(class_d, if_b) yes -is_a(class_d, if_c) no -is_a(class_d, if_d) yes -is_a(class_d, if_e) no -class_e -is_a(class_e, if_a) yes -is_a(class_e, if_b) yes -is_a(class_e, if_c) yes -is_a(class_e, if_d) yes -is_a(class_e, if_e) no -class_f -is_a(class_f, if_a) no -is_a(class_f, if_b) no -is_a(class_f, if_c) no -is_a(class_f, if_d) no -is_a(class_f, if_e) yes -class_g -is_a(class_g, if_a) yes -is_a(class_g, if_b) yes -is_a(class_g, if_c) yes -is_a(class_g, if_d) yes -is_a(class_g, if_e) no -===DONE=== diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt deleted file mode 100644 index e33a4da002d01..0000000000000 --- a/tests/classes/interface_implemented.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ZE2 An interface is inherited ---SKIPIF-- - ---FILE-- -_is_a('base'); - echo $this->_is_a('derived_a'); - echo $this->_is_a('derived_b'); - echo $this->_is_a('derived_c'); - echo $this->_is_a('derived_d'); - echo $this->_is_a('if_a'); - echo $this->_is_a('if_b'); - echo "\n"; - } -} - -class derived_a extends base implements if_a { - function f_a() {} -} - -class derived_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} -} - -class derived_c extends derived_a implements if_b { - function f_b() {} -} - -class derived_d extends derived_c { -} - -$t = new base(); -$t->test(); - -$t = new derived_a(); -$t->test(); - -$t = new derived_b(); -$t->test(); - -$t = new derived_c(); -$t->test(); - -$t = new derived_d(); -$t->test(); - -?> ---EXPECTF-- -is_a(base, base) = yes -is_a(base, derived_a) = no -is_a(base, derived_b) = no -is_a(base, derived_c) = no -is_a(base, derived_d) = no -is_a(base, if_a) = no -is_a(base, if_b) = no - -is_a(derived_a, base) = yes -is_a(derived_a, derived_a) = yes -is_a(derived_a, derived_b) = no -is_a(derived_a, derived_c) = no -is_a(derived_a, derived_d) = no -is_a(derived_a, if_a) = yes -is_a(derived_a, if_b) = no - -is_a(derived_b, base) = yes -is_a(derived_b, derived_a) = no -is_a(derived_b, derived_b) = yes -is_a(derived_b, derived_c) = no -is_a(derived_b, derived_d) = no -is_a(derived_b, if_a) = yes -is_a(derived_b, if_b) = yes - -is_a(derived_c, base) = yes -is_a(derived_c, derived_a) = yes -is_a(derived_c, derived_b) = no -is_a(derived_c, derived_c) = yes -is_a(derived_c, derived_d) = no -is_a(derived_c, if_a) = yes -is_a(derived_c, if_b) = yes - -is_a(derived_d, base) = yes -is_a(derived_d, derived_a) = yes -is_a(derived_d, derived_b) = no -is_a(derived_d, derived_c) = yes -is_a(derived_d, derived_d) = yes -is_a(derived_d, if_a) = yes -is_a(derived_d, if_b) = yes diff --git a/tests/classes/interface_instantiate.phpt b/tests/classes/interface_instantiate.phpt deleted file mode 100644 index 61c4e6b95ba0a..0000000000000 --- a/tests/classes/interface_instantiate.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 An interface cannot be instantiated ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot instantiate interface if_a in %s on line %d diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt deleted file mode 100644 index 329c0728b5415..0000000000000 --- a/tests/classes/interface_member.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -ZE2 An interface cannot have properties ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Interfaces may not include member variables in %s on line %d diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt deleted file mode 100644 index 3570b359289bd..0000000000000 --- a/tests/classes/interface_method.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method must be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Interface function if_a::err() cannot contain body %s on line %d diff --git a/tests/classes/interface_method_final.phpt b/tests/classes/interface_method_final.phpt deleted file mode 100644 index 01e599c5b9e8f..0000000000000 --- a/tests/classes/interface_method_final.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method cannot be final ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt deleted file mode 100644 index aa46a033a6f7b..0000000000000 --- a/tests/classes/interface_method_private.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method cannot be private ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Access type for interface method if_a::err() must be omitted in %s on line %d diff --git a/tests/classes/interface_must_be_implemented.phpt b/tests/classes/interface_must_be_implemented.phpt deleted file mode 100644 index a4d79704e1ef3..0000000000000 --- a/tests/classes/interface_must_be_implemented.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -ZE2 An interface must be implemented ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class derived_a contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (if_a::f_a) in %s on line %d diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt deleted file mode 100755 index 05f2fc41dfa82..0000000000000 --- a/tests/classes/interface_optional_arg.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 An interface method allows additional default arguments ---SKIPIF-- - ---FILE-- -bar(); - -?> ---EXPECT-- -foo - diff --git a/tests/classes/interfaces_001.phpt b/tests/classes/interfaces_001.phpt deleted file mode 100644 index 41e1f6776d895..0000000000000 --- a/tests/classes/interfaces_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 interfaces ---SKIPIF-- - ---FILE-- -foo; - } -} - -$foo = new Exception_foo; -echo $foo->getMessage() . "\n"; - -?> ---EXPECT-- -foo - diff --git a/tests/classes/interfaces_002.phpt b/tests/classes/interfaces_002.phpt deleted file mode 100644 index d26b5349bf511..0000000000000 --- a/tests/classes/interfaces_002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 interface with an unimplemented method ---SKIPIF-- - ---FILE-- -foo; - } -} - -// this should die -- Exception class must be abstract... -$foo = new Exception_foo; -echo "Message: " . $foo->getMessage() . "\n"; - -?> -===DONE=== ---EXPECTF-- - -Fatal error: Class Exception_foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Throwable::getErrno) in %s on line %d diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt deleted file mode 100755 index fa2cb7317f5bb..0000000000000 --- a/tests/classes/interfaces_003.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 interface and __construct ---FILE-- - -===DONE=== ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an object of class Object, called in %sinterfaces_003.php on line %d diff --git a/tests/classes/iterators_001.phpt b/tests/classes/iterators_001.phpt deleted file mode 100755 index 02e36107822b2..0000000000000 --- a/tests/classes/iterators_001.phpt +++ /dev/null @@ -1,200 +0,0 @@ ---TEST-- -ZE2 iterators and foreach ---SKIPIF-- - ---FILE-- -num = 0; - $this->obj = $obj; - } - function rewind() { - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } -} - -class c implements IteratorAggregate { - - public $max = 3; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } -} - -echo "===Array===\n"; - -$a = array(0,1,2); -foreach($a as $v) { - echo "array:$v\n"; -} - -echo "===Manual===\n"; -$t = new c(); -for ($iter = $t->getIterator(); $iter->valid(); $iter->next()) { - echo $iter->current() . "\n"; -} - -echo "===foreach/std===\n"; -foreach($t as $v) { - echo "object:$v\n"; -} - -echo "===foreach/rec===\n"; -foreach($t as $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - } -} - -echo "===foreach/key===\n"; -foreach($t as $i => $v) { - echo "object:$i=>$v\n"; -} - -print "Done\n"; -exit(0); -?> ---EXPECT-- -===Array=== -array:0 -array:1 -array:2 -===Manual=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -0 -c_iter::next -c_iter::valid = true -c_iter::current -1 -c_iter::next -c_iter::valid = true -c_iter::current -2 -c_iter::next -c_iter::valid = false -===foreach/std=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -object:0 -c_iter::next -c_iter::valid = true -c_iter::current -object:1 -c_iter::next -c_iter::valid = true -c_iter::current -object:2 -c_iter::next -c_iter::valid = false -===foreach/rec=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:0:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:0:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:0:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:1:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:1:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:2:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:2:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = false -===foreach/key=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -c_iter::key -object:1st=>0 -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -object:2nd=>1 -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -object:3rd=>2 -c_iter::next -c_iter::valid = false -Done diff --git a/tests/classes/iterators_002.phpt b/tests/classes/iterators_002.phpt deleted file mode 100755 index 4a58be0324842..0000000000000 --- a/tests/classes/iterators_002.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -ZE2 iterators and break ---SKIPIF-- - ---FILE-- -obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - $this->num = 0; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } - function __destruct() { - echo __METHOD__ . "\n"; - } -} - -class c implements IteratorAggregate { - - public $max = 3; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } - function __destruct() { - echo __METHOD__ . "\n"; - } -} - -$t = new c(); - -foreach($t as $k => $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - break; - } -} - -unset($t); - -print "Done\n"; -?> ---EXPECT-- -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:0:0 -c_iter::__destruct -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::__destruct -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::__destruct -c_iter::next -c_iter::valid = false -c_iter::__destruct -c::__destruct -Done diff --git a/tests/classes/iterators_003.phpt b/tests/classes/iterators_003.phpt deleted file mode 100755 index 42695db6ba23d..0000000000000 --- a/tests/classes/iterators_003.phpt +++ /dev/null @@ -1,115 +0,0 @@ ---TEST-- -ZE2 iterators and break ---SKIPIF-- - ---FILE-- -obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - return $this->num; - } -} - -class c implements IteratorAggregate { - - public $max = 4; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } -} - -$t = new c(); - -foreach($t as $v) { - if ($v == 0) { - echo "continue outer\n"; - continue; - } - foreach($t as $w) { - if ($w == 1) { - echo "continue inner\n"; - continue; - } - if ($w == 2) { - echo "break inner\n"; - break; - } - echo "double:$v:$w\n"; - } - if ($v == 2) { - echo "break outer\n"; - break; - } -} - -print "Done\n"; -?> ---EXPECT-- -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -continue outer -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::next -c_iter::valid = true -c_iter::current -continue inner -c_iter::next -c_iter::valid = true -c_iter::current -break inner -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::next -c_iter::valid = true -c_iter::current -continue inner -c_iter::next -c_iter::valid = true -c_iter::current -break inner -break outer -Done diff --git a/tests/classes/iterators_004.phpt b/tests/classes/iterators_004.phpt deleted file mode 100755 index 3fe05276c3bf9..0000000000000 --- a/tests/classes/iterators_004.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ZE2 iterators must be implemented ---SKIPIF-- - ---FILE-- -num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function valid() { - echo __METHOD__ . "\n"; - return $this->num < $this->max; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } -} - -$obj = new c2(); - -foreach($obj as $v => $w) { - echo "object:$v=>$w\n"; -} - -print "Done\n"; -?> ---EXPECTF-- -1st try -2nd try -object:max=>3 -object:num=>0 -Done diff --git a/tests/classes/iterators_005.phpt b/tests/classes/iterators_005.phpt deleted file mode 100755 index 005deb92a27b3..0000000000000 --- a/tests/classes/iterators_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 iterators cannot implement Traversable alone ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class test must implement interface Traversable as part of either Iterator or IteratorAggregate in %s on line %d diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt deleted file mode 100644 index 47fa69087a2cd..0000000000000 --- a/tests/classes/iterators_006.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -ZE2 iterators and array wrapping ---SKIPIF-- - ---FILE-- -array = array('foo', 'bar', 'baz'); - } - - function rewind() { - reset($this->array); - $this->next(); - } - - function valid() { - return $this->key !== NULL; - } - - function key() { - return $this->key; - } - - function current() { - return $this->current; - } - - function next() { - list($this->key, $this->current) = each($this->array); -// list($key, $current) = each($this->array); -// $this->key = $key; -// $this->current = $current; - } -} - -class a implements IteratorAggregate { - - public function getIterator() { - return new ai(); - } -} - -$array = new a(); - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -#$array = $array->getIterator(); -#$array->rewind(); -#$array->valid(); -#var_dump($array->key()); -#var_dump($array->current()); -echo "===2nd===\n"; - -$array = new ai(); - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -echo "===3rd===\n"; - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -?> -===DONE=== ---EXPECT-- -0: foo -1: bar -2: baz -===2nd=== -0: foo -1: bar -2: baz -===3rd=== -0: foo -1: bar -2: baz -===DONE=== \ No newline at end of file diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt deleted file mode 100755 index f2638b31dcc92..0000000000000 --- a/tests/classes/iterators_007.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -ZE2 iterators and exceptions ---FILE-- -x == 0) throw new Exception(__METHOD__); reset($this->arr); } - public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); } - public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); } - public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); } - public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); } -} - -$t = new Test(); - -while($t->x < 5) -{ - try - { - foreach($t as $k => $v) - { - echo "Current\n"; - } - } - catch(Exception $e) - { - echo "Caught in " . $e->getMessage() . "()\n"; - } - $t->x++; -} -?> -===DONE=== ---EXPECT-- -Caught in Test::rewind() -Caught in Test::current() -Caught in Test::key() -Current -Caught in Test::next() -Caught in Test::valid() -===DONE=== diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt deleted file mode 100644 index 74acb5de1360d..0000000000000 --- a/tests/classes/object_reference_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 object references ---SKIPIF-- - ---FILE-- -name = "I'm Foo!\n"; - } -} - -$foo = new Foo; -echo $foo->name; -$bar = $foo; -$bar->name = "I'm Bar!\n"; - -// In ZE1, we would expect "I'm Foo!" -echo $foo->name; - -?> ---EXPECT-- -I'm Foo! -I'm Bar! diff --git a/tests/classes/private_001.phpt b/tests/classes/private_001.phpt deleted file mode 100644 index 310b9c64343ba..0000000000000 --- a/tests/classes/private_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A private method can only be called inside the class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context '' in %s on line %d diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt deleted file mode 100644 index 258fd3a17d8fc..0000000000000 --- a/tests/classes/private_002.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in another class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call pass::show() -Call fail::show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt deleted file mode 100644 index d7fc45fcdc12b..0000000000000 --- a/tests/classes/private_003.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt deleted file mode 100644 index 780b2e6b4cb87..0000000000000 --- a/tests/classes/private_003b.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - public function ok() { - $this->good(); - } - - public function not_ok() { - $this->show(); - } -} - -$t = new fail(); -$t->ok(); -$t->not_ok(); // calling a private function - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt deleted file mode 100644 index 027434ab87f57..0000000000000 --- a/tests/classes/private_004.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt deleted file mode 100644 index ea3fe610d37e7..0000000000000 --- a/tests/classes/private_004b.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - function do_show() { - $this->show(); - } -} - -$t = new pass(); -$t->do_show(); - -$t2 = new fail(); -$t2->do_show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt deleted file mode 100644 index 49b2bee3badba..0000000000000 --- a/tests/classes/private_005.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_005b.phpt b/tests/classes/private_005b.phpt deleted file mode 100644 index ea3fe610d37e7..0000000000000 --- a/tests/classes/private_005b.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - function do_show() { - $this->show(); - } -} - -$t = new pass(); -$t->do_show(); - -$t2 = new fail(); -$t2->do_show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_006.phpt b/tests/classes/private_006.phpt deleted file mode 100644 index 0bb2b3fe4b1ed..0000000000000 --- a/tests/classes/private_006.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 A private method can be overwritten in a second derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() -Call show() -Call show() -Done diff --git a/tests/classes/private_006b.phpt b/tests/classes/private_006b.phpt deleted file mode 100644 index 950f16a3c4d94..0000000000000 --- a/tests/classes/private_006b.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 A private method can be overwritten in a second derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -$t1 = new first(); -$t1->do_show(); - -class second extends first { -} - -//$t2 = new second(); -//$t2->do_show(); - -class third extends second { - private function show() { - echo "Call show()\n"; - } -} - -$t3 = new third(); -$t3->do_show(); - -echo "Done\n"; -?> ---EXPECTF-- -Call show() -Call show() -Done \ No newline at end of file diff --git a/tests/classes/private_007.phpt b/tests/classes/private_007.phpt deleted file mode 100644 index 73a38c45627fb..0000000000000 --- a/tests/classes/private_007.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 A derived class does not know about privates of ancestors ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Bar::priv() -Foo::priv() -Done diff --git a/tests/classes/private_007b.phpt b/tests/classes/private_007b.phpt deleted file mode 100644 index 02ddc25dece99..0000000000000 --- a/tests/classes/private_007b.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 A derived class does not know about privates of ancestors ---SKIPIF-- - ---FILE-- -priv(); - } - private function priv() { - echo "Bar::priv()\n"; - } -} -class Foo extends Bar { - public function priv() { - echo "Foo::priv()\n"; - } -} - -$obj = new Foo(); -$obj->pub(); -$obj->priv(); - -echo "Done\n"; -?> ---EXPECTF-- -Bar::priv() -Foo::priv() -Done diff --git a/tests/classes/private_members.phpt b/tests/classes/private_members.phpt deleted file mode 100755 index a8ef9ab9202f3..0000000000000 --- a/tests/classes/private_members.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ZE2 A private member is ---SKIPIF-- - ---FILE-- -member = 'base::member'; - $this->test(); - echo __METHOD__ . "(end)\n"; - } - - function test() - { - echo __METHOD__ . "\n"; - print_r($this); - } -} - -class derived extends base -{ - public $member = 'derived::member (default)'; - - function __construct() - { - echo __METHOD__ . "(begin)\n"; - parent::__construct(); - parent::test(); - $this->test(); - $this->member = 'derived::member'; - echo __METHOD__ . "(end)\n"; - } - - function test() - { - parent::test(); - echo __METHOD__ . "\n"; - print_r($this); - } -} - -$t = new derived; -$t->test(); -unset($t); - -echo "Done\n"; - -?> ---EXPECTF-- -derived::__construct(begin) -base::__construct(begin) -base::test -derived Object -( - [member] => derived::member (default) - [member:base:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member (default) - [member:base:private] => base::member -) -base::__construct(end) -base::test -derived Object -( - [member] => derived::member (default) - [member:base:private] => base::member -) -base::test -derived Object -( - [member] => derived::member (default) - [member:base:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member (default) - [member:base:private] => base::member -) -derived::__construct(end) -base::test -derived Object -( - [member] => derived::member - [member:base:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member - [member:base:private] => base::member -) -Done diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt deleted file mode 100755 index e3061f1136fac..0000000000000 --- a/tests/classes/private_redeclare.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 A derived class does not know anything about inherited private methods ---FILE-- -show(); - } -} - -$t = new base(); -$t->test(); - -class derived extends base { - function show() { - echo "derived\n"; - } - function test() { - echo "test\n"; - $this->show(); - parent::test(); - parent::show(); - } -} - -$t = new derived(); -$t->test(); -?> ---EXPECTF-- -base -test -derived -base - -Fatal error: Call to private method base::show() from context 'derived' in %s on line %d diff --git a/tests/classes/protected_001.phpt b/tests/classes/protected_001.phpt deleted file mode 100644 index 19872c6f16ca1..0000000000000 --- a/tests/classes/protected_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A protected method can only be called inside the class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call fail() - -Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt deleted file mode 100644 index 4d24a926ea6b3..0000000000000 --- a/tests/classes/protected_001b.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 A protected method can only be called inside the class ---SKIPIF-- - ---FILE-- -fail(); - } -} - -$t = new pass(); -$t->good(); -$t->fail();// must fail because we are calling from outside of class pass - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call fail() - -Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt deleted file mode 100644 index f26ef9c495f89..0000000000000 --- a/tests/classes/protected_002.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A protected method cannot be called in another class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call pass::show() -Call fail::show() - -Fatal error: Call to protected method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt deleted file mode 100755 index 16c79d415e403..0000000000000 --- a/tests/classes/serialize_001.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -ZE2 Serializable ---FILE-- -data = $data; - } - - function serialize() - { - echo __METHOD__ . "({$this->data})\n"; - return $this->data; - } - - function unserialize($serialized) - { - echo __METHOD__ . "($serialized)\n"; - $this->data = $serialized; - var_dump($this); - } -} - -$tests = array('String', NULL, 42, false); - -foreach($tests as $data) -{ - try - { - echo "==========\n"; - var_dump($data); - $ser = serialize(new Test($data)); - var_dump(unserialize($ser)); - } - catch(Exception $e) - { - echo 'Exception: ' . $e->getMessage() . "\n"; - } -} - -?> -===DONE=== - ---EXPECT-- -========== -string(6) "String" -Test::__construct(String) -Test::serialize(String) -Test::unserialize(String) -object(Test)#1 (1) { - ["data"]=> - string(6) "String" -} -object(Test)#1 (1) { - ["data"]=> - string(6) "String" -} -========== -NULL -Test::__construct() -Test::serialize() -NULL -========== -int(42) -Test::__construct(42) -Test::serialize(42) -Exception: Test::serialize() must return a string or NULL -========== -bool(false) -Test::__construct() -Test::serialize() -Exception: Test::serialize() must return a string or NULL -===DONE=== diff --git a/tests/classes/singleton_001.phpt b/tests/classes/singleton_001.phpt deleted file mode 100644 index ee729b980cc7c..0000000000000 --- a/tests/classes/singleton_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 singleton ---SKIPIF-- - ---FILE-- -counter; - echo "\n"; - } -} - - -class SingletonCounter { - private static $m_instance = NULL; - - static function Instance() { - if (self::$m_instance == NULL) { - self::$m_instance = new Counter(); - } - return self::$m_instance; - } -} - -SingletonCounter::Instance()->increment_and_print(); -SingletonCounter::Instance()->increment_and_print(); -SingletonCounter::Instance()->increment_and_print(); - -?> ---EXPECT-- -1 -2 -3 diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt deleted file mode 100644 index ecc9c01a2820d..0000000000000 --- a/tests/classes/static_mix_1.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 You cannot overload a static method with a non static method ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt deleted file mode 100644 index bbdaedf50ae1d..0000000000000 --- a/tests/classes/static_mix_2.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 You cannot overload a non static method with a static method ---SKIPIF-- - ---FILE-- -show(); -fail::show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_properties_001.phpt b/tests/classes/static_properties_001.phpt deleted file mode 100755 index 1c34f68fc5530..0000000000000 --- a/tests/classes/static_properties_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 Initializing static properties to arrays ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(0) { -} -array(1) { - [0]=> - int(1) -} -Done diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt deleted file mode 100755 index 12f4b6389b3d1..0000000000000 --- a/tests/classes/static_this.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -$this can be an argument to a static function ---FILE-- -Test1(); - } - - static function Test1() - { - var_dump($this); - } - - static function Test2($this) - { - var_dump($this); - } -} - -$obj = new TestClass; -TestClass::Test2(new stdClass); - -?> -===DONE=== ---EXPECTF-- - -Notice: Undefined variable: this in %sstatic_this.php on line %d -NULL - -Notice: Undefined variable: this in %sstatic_this.php on line %d -NULL -object(stdClass)#%d (0) { -} -===DONE=== diff --git a/tests/classes/this.phpt b/tests/classes/this.phpt deleted file mode 100755 index 1d9c6236e41d8..0000000000000 --- a/tests/classes/this.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -ZE2 $this cannot be exchanged ---SKIPIF-- - ---FILE-- -prop; - print $other->prop; - } - - function indirect($other) - { - echo __METHOD__ . "\n"; - $this = $other; - $result = $this = $other; - print $result->prop; - print $this->prop; - } - - function retrieve(&$other) - { - echo __METHOD__ . "\n"; - $other = $this; - } -} - -$object = new Foo; -$object->prop = "Hello\n"; - -$other = new Foo; -$other->prop = "World\n"; - -$object->replace($other); -$object->indirect($other); - -print $object->prop; // still shows 'Hello' - -$object->retrieve($other); -print $other->prop; // shows 'Hello' - -?> -===DONE=== ---EXPECTF-- -Fatal error: Cannot re-assign $this in %sthis.php on line %d diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt deleted file mode 100755 index ecc64b0860d4a..0000000000000 --- a/tests/classes/tostring_001.phpt +++ /dev/null @@ -1,132 +0,0 @@ ---TEST-- -ZE2 __toString() ---SKIPIF-- - ---FILE-- -__toString()] = "ERROR"; -echo $ar[$o]; - -echo "====test8====\n"; -var_dump(trim($o)); -var_dump(trim((string)$o)); - -echo "====test9====\n"; -echo sprintf("%s", $o); - -echo "====test10====\n"; -$o = new test3; -var_dump($o); -echo $o; - -?> -====DONE==== ---EXPECTF-- -====test1==== -test1 Object -( -) -string(54) "Object of class test1 could not be converted to string" -string(0) "" -object(test1)#%d (0) { -} -====test2==== -test2 Object -( -) -test2::__toString() -Converted -object(test2)#%d (0) { -} -====test3==== -test2::__toString() -Converted -====test4==== -test2::__toString() -string:Converted -====test5==== -test2::__toString() -1Converted -1test2::__toString() -Converted -====test6==== -test2::__toString() -test2::__toString() -Converted -Converted -test2::__toString() -Converted -test2::__toString() -Converted -====test7==== -test2::__toString() -string(19) "Illegal offset type" -====test8==== -test2::__toString() -string(9) "Converted" -test2::__toString() -string(9) "Converted" -====test9==== -test2::__toString() -Converted -====test10==== -object(test3)#%d (0) { -} -test3::__toString() -string(53) "Method test3::__toString() must return a string value" -====DONE==== diff --git a/tests/classes/tostring_002.phpt b/tests/classes/tostring_002.phpt deleted file mode 100755 index 8a4a7af339908..0000000000000 --- a/tests/classes/tostring_002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 __toString() in __destruct ---SKIPIF-- - ---FILE-- - -====DONE==== ---EXPECTF-- -Hello -====DONE==== -Hello diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt deleted file mode 100755 index 23a4fe524c402..0000000000000 --- a/tests/classes/tostring_003.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 __toString() in __destruct/exception ---SKIPIF-- - ---FILE-- -getMessage()); -} - -?> -====DONE==== ---EXPECTF-- -Fatal error: Object of class Test could not be converted to string in %stostring_003.php on line %d diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt deleted file mode 100644 index 17cf57e3441b5..0000000000000 --- a/tests/classes/type_hinting_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 class type hinting ---SKIPIF-- - ---FILE-- -a($b); -$a->b($b); - -?> ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, called in %s on line 27 and defined in %s on line 12 diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt deleted file mode 100755 index 4cb75b1b8f84a..0000000000000 --- a/tests/classes/type_hinting_002.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -ZE2 class type hinting non existing class ---SKIPIF-- - ---FILE-- -a($o); -?> ---EXPECTF-- - -Fatal error: Class 'NonExisting' not found in %stype_hinting_002.php on line %d diff --git a/tests/classes/visibility_000a.phpt b/tests/classes/visibility_000a.phpt deleted file mode 100644 index 2524494ff8e05..0000000000000 --- a/tests/classes/visibility_000a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000b.phpt b/tests/classes/visibility_000b.phpt deleted file mode 100644 index 9305467323fd3..0000000000000 --- a/tests/classes/visibility_000b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000c.phpt b/tests/classes/visibility_000c.phpt deleted file mode 100644 index 064106e979645..0000000000000 --- a/tests/classes/visibility_000c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_001a.phpt b/tests/classes/visibility_001a.phpt deleted file mode 100644 index ebd1cc34de2c2..0000000000000 --- a/tests/classes/visibility_001a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001b.phpt b/tests/classes/visibility_001b.phpt deleted file mode 100644 index e61078ede5bae..0000000000000 --- a/tests/classes/visibility_001b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001c.phpt b/tests/classes/visibility_001c.phpt deleted file mode 100644 index bb1075aaed12c..0000000000000 --- a/tests/classes/visibility_001c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt deleted file mode 100644 index 6c88d204d241f..0000000000000 --- a/tests/classes/visibility_002a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002b.phpt b/tests/classes/visibility_002b.phpt deleted file mode 100644 index 71f47c395499f..0000000000000 --- a/tests/classes/visibility_002b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002c.phpt b/tests/classes/visibility_002c.phpt deleted file mode 100644 index 5edae1d068dbf..0000000000000 --- a/tests/classes/visibility_002c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_003a.phpt b/tests/classes/visibility_003a.phpt deleted file mode 100644 index 1693386f814ad..0000000000000 --- a/tests/classes/visibility_003a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt deleted file mode 100644 index fcfdbe3c5543d..0000000000000 --- a/tests/classes/visibility_003b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line %d diff --git a/tests/classes/visibility_003c.phpt b/tests/classes/visibility_003c.phpt deleted file mode 100644 index d94a9c116b085..0000000000000 --- a/tests/classes/visibility_003c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004a.phpt b/tests/classes/visibility_004a.phpt deleted file mode 100644 index 6f16a09eddb5b..0000000000000 --- a/tests/classes/visibility_004a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004b.phpt b/tests/classes/visibility_004b.phpt deleted file mode 100644 index 74a83185ee211..0000000000000 --- a/tests/classes/visibility_004b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004c.phpt b/tests/classes/visibility_004c.phpt deleted file mode 100644 index 92a770374e10b..0000000000000 --- a/tests/classes/visibility_004c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_005.phpt b/tests/classes/visibility_005.phpt deleted file mode 100755 index 1b15fb5e5b3fa..0000000000000 --- a/tests/classes/visibility_005.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -ZE2 foreach and property visibility ---FILE-- -$v) { - echo "$k=>$v\n"; - } - } -} - -class derived extends base -{ -} - -$o = new base; -$o->d = 4; -echo "===base::function===\n"; -$o->f(); -echo "===base,foreach===\n"; -foreach($o as $k=>$v) { - echo "$k=>$v\n"; -} - -$o = new derived; -$o->d = 4; -echo "===derived::function===\n"; -$o->f(); -echo "===derived,foreach===\n"; -foreach($o as $k=>$v) { - echo "$k=>$v\n"; -} - -?> ---EXPECT-- -===base::function=== -a=>1 -b=>2 -c=>3 -d=>4 -===base,foreach=== -a=>1 -d=>4 -===derived::function=== -a=>1 -b=>2 -d=>4 -===derived,foreach=== -a=>1 -d=>4 diff --git a/tests/foo b/tests/foo deleted file mode 100644 index 125c655b0fe11..0000000000000 --- a/tests/foo +++ /dev/null @@ -1,5 +0,0 @@ -a -b -@c@ -d -e diff --git a/tests/foo2 b/tests/foo2 deleted file mode 100644 index 4cdd41e3dcffa..0000000000000 --- a/tests/foo2 +++ /dev/null @@ -1,3 +0,0 @@ -b(12,13)."\n"; diff --git a/tests/foo3 b/tests/foo3 deleted file mode 100644 index 08681b98c2d7a..0000000000000 --- a/tests/foo3 +++ /dev/null @@ -1,43 +0,0 @@ -print_string($a->hello_world())."\n"; -print $b->print_string($b->hello_world())."\n"; -$a->foo = 5; -print $a->foo; -print $a->foo(); diff --git a/tests/foo4 b/tests/foo4 deleted file mode 100644 index 29df84d0e2323..0000000000000 --- a/tests/foo4 +++ /dev/null @@ -1,41 +0,0 @@ -asd = 5; -print $b->asd; diff --git a/tests/func/001.phpt b/tests/func/001.phpt deleted file mode 100644 index d08040679b9de..0000000000000 --- a/tests/func/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Strlen() function test ---FILE-- - ---EXPECT-- -6 diff --git a/tests/func/002.phpt b/tests/func/002.phpt deleted file mode 100644 index cb35f920436ed..0000000000000 --- a/tests/func/002.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Static variables in functions ---FILE-- -5) continue; - echo "$k\n"; - } -} - -andi (3,10); ---EXPECT-- -hey -blah -hey -blah -Counting from 7 to 14 -7 -8 -9 -10 -11 -12 -13 -14 -hey -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -and now, from a function... -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 ------- -720 -840 -3 -4 -5 - diff --git a/tests/func/004.phpt b/tests/func/004.phpt deleted file mode 100644 index 1434297b0de55..0000000000000 --- a/tests/func/004.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -General function test ---FILE-- - ---EXPECT-- - -Before function declaration... -After function declaration... -Calling function for the first time... ----- -In function, printing the string "This works!" 10 times -0) This works! -1) This works! -2) This works! -3) This works! -4) This works! -5) This works! -6) This works! -7) This works! -8) This works! -9) This works! -Done with function... ------ -Returned from function call... -Calling the function for the second time... ----- -In function, printing the string "This like, really works and stuff..." 3 times -0) This like, really works and stuff... -1) This like, really works and stuff... -2) This like, really works and stuff... -Done with function... ------ -Returned from function call... -This is some other function, to ensure more than just one function works fine... diff --git a/tests/func/005.phpt b/tests/func/005.phpt deleted file mode 100644 index c4215feb4988e..0000000000000 --- a/tests/func/005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Testing register_shutdown_function() ---FILE-- - ---EXPECT-- -foo() will be called on shutdown... -foo - diff --git a/tests/func/005a.phpt b/tests/func/005a.phpt deleted file mode 100644 index f7843e10a329b..0000000000000 --- a/tests/func/005a.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Testing register_shutdown_function() with timeout. (Bug: #21513) ---FILE-- - ---EXPECT-- -Start -Shutdown diff --git a/tests/func/006.phpt b/tests/func/006.phpt deleted file mode 100644 index 077b6f873cb13..0000000000000 --- a/tests/func/006.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Output buffering tests ---INI-- -output_buffering=0 -output_handler= -zlib.output_compression=0 -zlib.output_handler= ---FILE-- - ---EXPECT-- -string(2) "2B" -string(2) "1A" diff --git a/tests/func/007.phpt b/tests/func/007.phpt deleted file mode 100644 index 73aae2e649283..0000000000000 --- a/tests/func/007.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -INI functions test ---FILE-- - ---EXPECT-- -ini_set_works -ini_restore_works diff --git a/tests/func/008.phpt b/tests/func/008.phpt deleted file mode 100644 index 48098e13302e7..0000000000000 --- a/tests/func/008.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test for buffering in core functions with implicit flush off ---INI-- -implicit_flush=0 ---FILE-- - ---EXPECT-- -'foo1' - -'foo2' diff --git a/tests/func/009.phpt b/tests/func/009.phpt deleted file mode 100644 index 05b40e8e67eb7..0000000000000 --- a/tests/func/009.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test for buffering in core functions with implicit flush on ---INI-- -implicit_flush=1 ---FILE-- - ---EXPECT-- -'foo1' - -'foo2' diff --git a/tests/lang/001.phpt b/tests/lang/001.phpt deleted file mode 100644 index 71df3184781dd..0000000000000 --- a/tests/lang/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Simple If condition test ---FILE-- -0) { echo "Yes"; } ?> ---EXPECT-- -Yes diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt deleted file mode 100644 index ec14d01c3f74a..0000000000000 --- a/tests/lang/002.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Simple While Loop Test ---FILE-- - ---EXPECT-- -123456789 diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt deleted file mode 100644 index 7049db90470fa..0000000000000 --- a/tests/lang/003.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Simple Switch Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt deleted file mode 100644 index be8ebf4155233..0000000000000 --- a/tests/lang/004.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Simple If/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt deleted file mode 100644 index 404a7cbbf6d05..0000000000000 --- a/tests/lang/005.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Simple If/ElseIf/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt deleted file mode 100644 index 2a2db013aba8d..0000000000000 --- a/tests/lang/006.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Nested If/ElseIf/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt deleted file mode 100644 index 4576d4efa5323..0000000000000 --- a/tests/lang/007.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Function call with global and static variables ---FILE-- - ---EXPECT-- -1 5 2 2 10 5 2 5 3 2 10 5 3 5 4 2 diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt deleted file mode 100644 index d335e6f13521e..0000000000000 --- a/tests/lang/008.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing recursive function ---FILE-- - ---EXPECT-- -1 2 3 4 5 6 7 8 9 diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt deleted file mode 100644 index ea2aa9294dd22..0000000000000 --- a/tests/lang/009.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Testing function parameter passing ---FILE-- - ---EXPECT-- -3 diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt deleted file mode 100644 index 603abe34d5613..0000000000000 --- a/tests/lang/010.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Testing function parameter passing with a return value ---FILE-- - ---EXPECT-- -2 diff --git a/tests/lang/011.phpt b/tests/lang/011.phpt deleted file mode 100644 index 771ef7c129a7a..0000000000000 --- a/tests/lang/011.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Testing nested functions ---FILE-- - ---EXPECT-- -4 Hello 4 diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt deleted file mode 100644 index 117137a29b57b..0000000000000 --- a/tests/lang/012.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing stack after early function return ---FILE-- - ---EXPECT-- -HelloHello diff --git a/tests/lang/013.phpt b/tests/lang/013.phpt deleted file mode 100644 index be84cdcb8fa77..0000000000000 --- a/tests/lang/013.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Testing eval function ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt deleted file mode 100644 index f0033b2f77aff..0000000000000 --- a/tests/lang/014.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Testing eval function inside user-defined function ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/015.inc b/tests/lang/015.inc deleted file mode 100755 index d436a7bb140d2..0000000000000 --- a/tests/lang/015.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/lang/015.phpt b/tests/lang/015.phpt deleted file mode 100644 index 952e7f19d74f1..0000000000000 --- a/tests/lang/015.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Testing include ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/016.inc b/tests/lang/016.inc deleted file mode 100755 index b73333f7b0200..0000000000000 --- a/tests/lang/016.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/lang/016.phpt b/tests/lang/016.phpt deleted file mode 100644 index dbaa908b81adc..0000000000000 --- a/tests/lang/016.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Testing user-defined function in included file ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt deleted file mode 100644 index fb909648209dc..0000000000000 --- a/tests/lang/017.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing user-defined function falling out of an If into another ---FILE-- - ---EXPECT-- -1 diff --git a/tests/lang/018.phpt b/tests/lang/018.phpt deleted file mode 100644 index 638b131c2d8ea..0000000000000 --- a/tests/lang/018.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -eval() test ---FILE-- - ---EXPECT-- -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 diff --git a/tests/lang/021.phpt b/tests/lang/021.phpt deleted file mode 100644 index aff45b6be39a3..0000000000000 --- a/tests/lang/021.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Switch test 2 ---FILE-- - ---EXPECT-- -i=0 -In branch 0 -i=1 -In branch 1 -i=2 -In branch 2 -i=3 -In branch 3 -hi diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt deleted file mode 100644 index dddc6c2955354..0000000000000 --- a/tests/lang/022.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Switch test 3 ---FILE-- - ---EXPECT-- -zero -one -2 -3 -4 -5 -6 -7 -8 -9 -zero -one -2 -3 -4 -5 -6 -7 -8 -9 -zero -one -2 -3 -4 -5 -6 -7 -8 -9 diff --git a/tests/lang/023-1.inc b/tests/lang/023-1.inc deleted file mode 100755 index 8d52e844c96cd..0000000000000 --- a/tests/lang/023-1.inc +++ /dev/null @@ -1,356 +0,0 @@ - - - - -*** Testing assignments and variable aliasing: ***
              - -This should read "blah": \n"; ?> -This should read "this is nifty": \n"; ?> -*************************************************
              - -*** Testing integer operators ***
              - -Correct result - 8:
              -Correct result - 8:
              -Correct result - 2:
              -Correct result - -2:
              -Correct result - 15:
              -Correct result - 15:
              -Correct result - 2:
              -Correct result - 3:
              -*********************************
              - -*** Testing real operators ***
              - -Correct result - 8:
              -Correct result - 8:
              -Correct result - 2:
              -Correct result - -2:
              -Correct result - 15:
              -Correct result - 15:
              -Correct result - 2:
              -Correct result - 3:
              -*********************************
              - -*** Testing if/elseif/else control ***
              - -\n"; -} elseif ($a == "5") { - echo "This "." works
              \n"; - $a = 6; - if ("andi" == ($test = "andi")) { - echo "this_still_works
              \n"; - } elseif (1) { - echo "should_not_print
              \n"; - } else { - echo "should_not_print
              \n"; - } - if (44 == 43) { - echo "should_not_print
              \n"; - } else { - echo "should_print
              \n"; - } -} elseif ($a == 6) { - echo "this "."broken
              \n"; - if (0) { - echo "this_should_not_print
              \n"; - } else { - echo "TestingDanglingElse_This_Should_not_print
              \n"; - } -} else { - echo "This "."does "." not"." work
              \n"; -} -?> - - -*** Seriously nested if's test ***
              -** spelling correction by kluzz ** -\n"; -if (0) { /* this code is not supposed to be executed */ - echo "hmm, this shouldn't be displayed #1
              \n"; - $j++; - if (1) { - $i -+= - $j; - if (0) { - $j = ++$i; - if (1) { - $j *= $i; - echo "damn, this shouldn't be displayed
              \n"; - } else { - $j /= $i; - ++$j; - echo "this shouldn't be displayed either
              \n"; - } - } elseif (1) { - $i++; $j++; - echo "this isn't supposed to be displayed
              \n"; - } - } elseif (0) { - $i++; - echo "this definitely shouldn't be displayed
              \n"; - } else { - --$j; - echo "and this too shouldn't be displayed
              \n"; - while ($j>0) { - $j--; - } - } -} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ - $i = ++$j; - echo "hmm, this shouldn't be displayed #2
              \n"; - if (1) { - $j = ++$i; - if (0) { - $j = $i*2+$j*($i++); - if (1) { - $i++; - echo "damn, this shouldn't be displayed
              \n"; - } else { - $j++; - echo "this shouldn't be displayed either
              \n"; - } - } else if (1) { - ++$j; - echo "this isn't supposed to be displayed
              \n"; - } - } elseif (0) { - $j++; - echo "this definitely shouldn't be displayed
              \n"; - } else { - $i++; - echo "and this too shouldn't be displayed
              \n"; - } -} else { - $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ - echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j
              \n"; - if (1) { - $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ - if (0) { - $j += 40; - if (1) { - $i += 50; - echo "damn, this shouldn't be displayed
              \n"; - } else { - $j += 20; - echo "this shouldn't be displayed either
              \n"; - } - } else if (1) { - $j *= $i; /* $j *= 2 --> $j == 4 */ - echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j
              \n"; - echo "3 loop iterations should follow:
              \n"; - while ($i<=$j) { - echo $i++." $j
              \n"; - } - } - } elseif (0) { - echo "this definitely shouldn't be displayed
              \n"; - } else { - echo "and this too shouldn't be displayed
              \n"; - } - echo "**********************************
              \n"; -} -?> - -*** C-style else-if's ***
              -\n"; - } else if ($a++) { - echo "This shouldn't be displayed either
              \n"; - } else if (--$a) { - echo "No, this neither
              \n"; - } else if (++$a) { - echo "This should be displayed
              \n"; - } else { - echo "This shouldn't be displayed at all
              \n"; - } -?> -*************************
              - -*** WHILE tests ***
              -$j) { - echo "$i is greater than $j
              \n"; - } else if ($i==$j) { - echo "$i equals $j
              \n"; - } else { - echo "$i is smaller than $j
              \n"; - } - $i++; -} -?> -*******************
              - - -*** Nested WHILEs ***
              -\n"; - -$i=0; -while ($i<$arr_len) { - $j=0; - while ($j<$arr_len) { - $k=0; - while ($k<$arr_len) { - echo "\${test$i$j}[$k] = ".${"test$i$j"}[$k]."
              \n"; - $k++; - } - $j++; - } - $i++; -} -?> -*********************
              - -*** hash test... ***
              -\n"; -} -*/ -echo "commented out..."; -?> - -**************************
              - -*** Hash resizing test ***
              - 0) { - $a = $a . 'a'; - echo "$a
              \n"; - $resize[$a] = $i; - $i--; -} -$i = 10; -$a = 'b'; -while ($i > 0) { - $a = $a . 'a'; - echo "$a
              \n"; - echo $resize[$a]."
              \n"; - $i--; -} -?> -**************************
              - - -*** break/continue test ***
              -\n"; -while ($i<5) { - if ($i>2) { - break; - } - $j=0; - echo "\$j should go from 3 to 4, and \$q should go from 3 to 4
              \n"; - while ($j<5) { - if ($j<=2) { - $j++; - continue; - } - echo " \$j=$j
              \n"; - for ($q=0; $q<=10; $q++) { - if ($q<3) { - continue; - } - if ($q>4) { - break; - } - echo " \$q=$q
              \n"; - } - $j++; - } - $j=0; - echo "\$j should go from 0 to 2
              \n"; - while ($j<5) { - if ($j>2) { - $k=0; - echo "\$k should go from 0 to 2
              \n"; - while ($k<5) { - if ($k>2) { - break 2; - } - echo " \$k=$k
              \n"; - $k++; - } - } - echo " \$j=$j
              \n"; - $j++; - } - echo "\$i=$i
              \n"; - $i++; -} -?> -***********************
              - -*** Nested file include test ***
              - -********************************
              - -\n"; # testing some PHP style comment... -} -?> diff --git a/tests/lang/023-2.inc b/tests/lang/023-2.inc deleted file mode 100755 index 6dd1e730f1674..0000000000000 --- a/tests/lang/023-2.inc +++ /dev/null @@ -1,6 +0,0 @@ - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. - - - diff --git a/tests/lang/023.phpt b/tests/lang/023.phpt deleted file mode 100644 index 331308d01dc42..0000000000000 --- a/tests/lang/023.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Regression test ---INI-- -date.timezone=UTC ---FILE-- -PHP Regression Test - -0) { - $days = $time_left/(24*3600); - $time_left -= $days*24*3600; - $hours = $time_left/3600; - $time_left -= $hours*3600; - $minutes = $time_left/60; - echo "Limor Ullmann is getting married on ".($wedding_date=date("l, F dS, Y",$wedding_timestamp)).",\nwhich is $days days, $hours hours and $minutes minutes from now.\n"; - echo "Her hashed wedding date is $wedding_date.\n"; -} else { - echo "Limor Ullmann is now Limor Baruch :I\n"; -} -?> ---EXPECT-- -PHP Regression Test - - - - -*** Testing assignments and variable aliasing: ***
              -This should read "blah": blah
              -This should read "this is nifty": this is nifty
              -*************************************************
              - -*** Testing integer operators ***
              -Correct result - 8: 8
              -Correct result - 8: 8
              -Correct result - 2: 2
              -Correct result - -2: -2
              -Correct result - 15: 15
              -Correct result - 15: 15
              -Correct result - 2: 2
              -Correct result - 3: 3
              -*********************************
              - -*** Testing real operators ***
              -Correct result - 8: 8
              -Correct result - 8: 8
              -Correct result - 2: 2
              -Correct result - -2: -2
              -Correct result - 15: 15
              -Correct result - 15: 15
              -Correct result - 2: 2
              -Correct result - 3: 3
              -*********************************
              - -*** Testing if/elseif/else control ***
              - -This works
              -this_still_works
              -should_print
              - - -*** Seriously nested if's test ***
              -** spelling correction by kluzz ** -Only two lines of text should follow:
              -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
              -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
              -3 loop iterations should follow:
              -2 4
              -3 4
              -4 4
              -**********************************
              - -*** C-style else-if's ***
              -This should be displayed
              -*************************
              - -*** WHILE tests ***
              -0 is smaller than 20
              -1 is smaller than 20
              -2 is smaller than 20
              -3 is smaller than 20
              -4 is smaller than 20
              -5 is smaller than 20
              -6 is smaller than 20
              -7 is smaller than 20
              -8 is smaller than 20
              -9 is smaller than 20
              -10 is smaller than 20
              -11 is smaller than 20
              -12 is smaller than 20
              -13 is smaller than 20
              -14 is smaller than 20
              -15 is smaller than 20
              -16 is smaller than 20
              -17 is smaller than 20
              -18 is smaller than 20
              -19 is smaller than 20
              -20 equals 20
              -21 is greater than 20
              -22 is greater than 20
              -23 is greater than 20
              -24 is greater than 20
              -25 is greater than 20
              -26 is greater than 20
              -27 is greater than 20
              -28 is greater than 20
              -29 is greater than 20
              -30 is greater than 20
              -31 is greater than 20
              -32 is greater than 20
              -33 is greater than 20
              -34 is greater than 20
              -35 is greater than 20
              -36 is greater than 20
              -37 is greater than 20
              -38 is greater than 20
              -39 is greater than 20
              -*******************
              - - -*** Nested WHILEs ***
              -Each array variable should be equal to the sum of its indices:
              -${test00}[0] = 0
              -${test00}[1] = 1
              -${test00}[2] = 2
              -${test01}[0] = 1
              -${test01}[1] = 2
              -${test01}[2] = 3
              -${test02}[0] = 2
              -${test02}[1] = 3
              -${test02}[2] = 4
              -${test10}[0] = 1
              -${test10}[1] = 2
              -${test10}[2] = 3
              -${test11}[0] = 2
              -${test11}[1] = 3
              -${test11}[2] = 4
              -${test12}[0] = 3
              -${test12}[1] = 4
              -${test12}[2] = 5
              -${test20}[0] = 2
              -${test20}[1] = 3
              -${test20}[2] = 4
              -${test21}[0] = 3
              -${test21}[1] = 4
              -${test21}[2] = 5
              -${test22}[0] = 4
              -${test22}[1] = 5
              -${test22}[2] = 6
              -*********************
              - -*** hash test... ***
              -commented out... -**************************
              - -*** Hash resizing test ***
              -ba
              -baa
              -baaa
              -baaaa
              -baaaaa
              -baaaaaa
              -baaaaaaa
              -baaaaaaaa
              -baaaaaaaaa
              -baaaaaaaaaa
              -ba
              -10
              -baa
              -9
              -baaa
              -8
              -baaaa
              -7
              -baaaaa
              -6
              -baaaaaa
              -5
              -baaaaaaa
              -4
              -baaaaaaaa
              -3
              -baaaaaaaaa
              -2
              -baaaaaaaaaa
              -1
              -**************************
              - - -*** break/continue test ***
              -$i should go from 0 to 2
              -$j should go from 3 to 4, and $q should go from 3 to 4
              - $j=3
              - $q=3
              - $q=4
              - $j=4
              - $q=3
              - $q=4
              -$j should go from 0 to 2
              - $j=0
              - $j=1
              - $j=2
              -$k should go from 0 to 2
              - $k=0
              - $k=1
              - $k=2
              -$i=0
              -$j should go from 3 to 4, and $q should go from 3 to 4
              - $j=3
              - $q=3
              - $q=4
              - $j=4
              - $q=3
              - $q=4
              -$j should go from 0 to 2
              - $j=0
              - $j=1
              - $j=2
              -$k should go from 0 to 2
              - $k=0
              - $k=1
              - $k=2
              -$i=1
              -$j should go from 3 to 4, and $q should go from 3 to 4
              - $j=3
              - $q=3
              - $q=4
              - $j=4
              - $q=3
              - $q=4
              -$j should go from 0 to 2
              - $j=0
              - $j=1
              - $j=2
              -$k should go from 0 to 2
              - $k=0
              - $k=1
              - $k=2
              -$i=2
              -***********************
              - -*** Nested file include test ***
              - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -********************************
              - -Tests completed.
              -Limor Ullmann is now Limor Baruch :I diff --git a/tests/lang/024.phpt b/tests/lang/024.phpt deleted file mode 100644 index 954b58fa052a0..0000000000000 --- a/tests/lang/024.phpt +++ /dev/null @@ -1,11623 +0,0 @@ ---TEST-- -Looped regression test (may take a while) ---FILE-- - - - -*** Testing assignments and variable aliasing: *** - -This should read "blah": -This should read "this is nifty": -************************************************* - -*** Testing integer operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing real operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing if/elseif/else control *** - - - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -0) { - $j--; - } - } -} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ - $i = ++$j; - echo "hmm, this shouldn't be displayed #2\n"; - if (1) { - $j = ++$i; - if (0) { - $j = $i*2+$j*($i++); - if (1) { - $i++; - echo "damn, this shouldn't be displayed\n"; - } else { - $j++; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - ++$j; - echo "this isn't supposed to be displayed\n"; - } - } elseif (0) { - $j++; - echo "this definitely shouldn't be displayed\n"; - } else { - $i++; - echo "and this too shouldn't be displayed\n"; - } -} else { - $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ - echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n"; - if (1) { - $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ - if (0) { - $j += 40; - if (1) { - $i += 50; - echo "damn, this shouldn't be displayed\n"; - } else { - $j += 20; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - $j *= $i; /* $j *= 2 --> $j == 4 */ - echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n"; - echo "3 loop iterations should follow:\n"; - while ($i<=$j) { - echo $i++." $j\n"; - } - } - } elseif (0) { - echo "this definitely shouldn't be displayed\n"; - } else { - echo "and this too shouldn't be displayed\n"; - } - echo "**********************************\n"; -} -?> - -*** C-style else-if's *** - -************************* - -*** WHILE tests *** -$j) { - echo "$i is greater than $j\n"; - } else if ($i==$j) { - echo "$i equals $j\n"; - } else { - echo "$i is smaller than $j\n"; - } - $i++; -} -?> -******************* - - -*** Nested WHILEs *** - -********************* - -*** hash test... *** - - -************************** - -*** Hash resizing test *** - 0) { - $a = $a . "a"; - echo "$a\n"; - $resize[$a] = $i; - $i--; -} -$i = 10; -$a = "b"; -while ($i > 0) { - $a = $a . "a"; - echo "$a\n"; - echo $resize[$a]."\n"; - $i--; -} -?> -************************** - - -*** break/continue test *** -2) { - break; - } - $j=0; - echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n"; - while ($j<5) { - if ($j<=2) { - $j++; - continue; - } - echo " \$j=$j\n"; - for ($q=0; $q<=10; $q++) { - if ($q<3) { - continue; - } - if ($q>4) { - break; - } - echo " \$q=$q\n"; - } - $j++; - } - $j=0; - echo "\$j should go from 0 to 2\n"; - while ($j<5) { - if ($j>2) { - $k=0; - echo "\$k should go from 0 to 2\n"; - while ($k<5) { - if ($k>2) { - break 2; - } - echo " \$k=$k\n"; - $k++; - } - } - echo " \$j=$j\n"; - $j++; - } - echo "\$i=$i\n"; - $i++; -} -?> -*********************** - -*** Nested file include test *** - -******************************** - - ---EXPECT-- - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt deleted file mode 100644 index 382960f62812b..0000000000000 --- a/tests/lang/025.phpt +++ /dev/null @@ -1,531 +0,0 @@ ---TEST-- -Mean recursion test ---FILE-- - ---EXPECT-- - 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 2 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 diff --git a/tests/lang/026.phpt b/tests/lang/026.phpt deleted file mode 100644 index eb2d6214de670..0000000000000 --- a/tests/lang/026.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Testing string scanner confirmance ---FILE-- - ---EXPECT-- -" \'\n\'a\\b\ diff --git a/tests/lang/027.phpt b/tests/lang/027.phpt deleted file mode 100644 index d3eb74b22ffbc..0000000000000 --- a/tests/lang/027.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Testing do-while loop ---FILE-- -0); -?> ---EXPECT-- -321 diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt deleted file mode 100644 index bd4525ee60e5c..0000000000000 --- a/tests/lang/028.phpt +++ /dev/null @@ -1,1058 +0,0 @@ ---TEST-- -Testing calling user-level functions from C ---FILE-- -myname = "Dafna"; - } - function GetMyName() { - return $this->myname; - } - function SetMyName($name) { - $this->myname = $name; - } -}; - -for ($i=0; $i<200; $i++): - print "$i\n"; - call_user_func("dafna"); - call_user_func("print_stuff","Hey there!!\n"); - print "$i\n"; -endfor; - - -$dafna = new dafna_class(); - -print $name=call_user_func(array(&$dafna,"GetMyName")); -print "\n"; - -?> ---EXPECT-- -0 -Dafna! -I'm still alive -Hey there!! -0 -1 -Dafna! -I'm still alive -Hey there!! -1 -2 -Dafna! -I'm still alive -Hey there!! -2 -3 -Dafna! -I'm still alive -Hey there!! -3 -4 -Dafna! -I'm still alive -Hey there!! -4 -5 -Dafna! -I'm still alive -Hey there!! -5 -6 -Dafna! -I'm still alive -Hey there!! -6 -7 -Dafna! -I'm still alive -Hey there!! -7 -8 -Dafna! -I'm still alive -Hey there!! -8 -9 -Dafna! -I'm still alive -Hey there!! -9 -10 -Dafna! -I'm still alive -Hey there!! -10 -11 -Dafna! -I'm still alive -Hey there!! -11 -12 -Dafna! -I'm still alive -Hey there!! -12 -13 -Dafna! -I'm still alive -Hey there!! -13 -14 -Dafna! -I'm still alive -Hey there!! -14 -15 -Dafna! -I'm still alive -Hey there!! -15 -16 -Dafna! -I'm still alive -Hey there!! -16 -17 -Dafna! -I'm still alive -Hey there!! -17 -18 -Dafna! -I'm still alive -Hey there!! -18 -19 -Dafna! -I'm still alive -Hey there!! -19 -20 -Dafna! -I'm still alive -Hey there!! -20 -21 -Dafna! -I'm still alive -Hey there!! -21 -22 -Dafna! -I'm still alive -Hey there!! -22 -23 -Dafna! -I'm still alive -Hey there!! -23 -24 -Dafna! -I'm still alive -Hey there!! -24 -25 -Dafna! -I'm still alive -Hey there!! -25 -26 -Dafna! -I'm still alive -Hey there!! -26 -27 -Dafna! -I'm still alive -Hey there!! -27 -28 -Dafna! -I'm still alive -Hey there!! -28 -29 -Dafna! -I'm still alive -Hey there!! -29 -30 -Dafna! -I'm still alive -Hey there!! -30 -31 -Dafna! -I'm still alive -Hey there!! -31 -32 -Dafna! -I'm still alive -Hey there!! -32 -33 -Dafna! -I'm still alive -Hey there!! -33 -34 -Dafna! -I'm still alive -Hey there!! -34 -35 -Dafna! -I'm still alive -Hey there!! -35 -36 -Dafna! -I'm still alive -Hey there!! -36 -37 -Dafna! -I'm still alive -Hey there!! -37 -38 -Dafna! -I'm still alive -Hey there!! -38 -39 -Dafna! -I'm still alive -Hey there!! -39 -40 -Dafna! -I'm still alive -Hey there!! -40 -41 -Dafna! -I'm still alive -Hey there!! -41 -42 -Dafna! -I'm still alive -Hey there!! -42 -43 -Dafna! -I'm still alive -Hey there!! -43 -44 -Dafna! -I'm still alive -Hey there!! -44 -45 -Dafna! -I'm still alive -Hey there!! -45 -46 -Dafna! -I'm still alive -Hey there!! -46 -47 -Dafna! -I'm still alive -Hey there!! -47 -48 -Dafna! -I'm still alive -Hey there!! -48 -49 -Dafna! -I'm still alive -Hey there!! -49 -50 -Dafna! -I'm still alive -Hey there!! -50 -51 -Dafna! -I'm still alive -Hey there!! -51 -52 -Dafna! -I'm still alive -Hey there!! -52 -53 -Dafna! -I'm still alive -Hey there!! -53 -54 -Dafna! -I'm still alive -Hey there!! -54 -55 -Dafna! -I'm still alive -Hey there!! -55 -56 -Dafna! -I'm still alive -Hey there!! -56 -57 -Dafna! -I'm still alive -Hey there!! -57 -58 -Dafna! -I'm still alive -Hey there!! -58 -59 -Dafna! -I'm still alive -Hey there!! -59 -60 -Dafna! -I'm still alive -Hey there!! -60 -61 -Dafna! -I'm still alive -Hey there!! -61 -62 -Dafna! -I'm still alive -Hey there!! -62 -63 -Dafna! -I'm still alive -Hey there!! -63 -64 -Dafna! -I'm still alive -Hey there!! -64 -65 -Dafna! -I'm still alive -Hey there!! -65 -66 -Dafna! -I'm still alive -Hey there!! -66 -67 -Dafna! -I'm still alive -Hey there!! -67 -68 -Dafna! -I'm still alive -Hey there!! -68 -69 -Dafna! -I'm still alive -Hey there!! -69 -70 -Dafna! -I'm still alive -Hey there!! -70 -71 -Dafna! -I'm still alive -Hey there!! -71 -72 -Dafna! -I'm still alive -Hey there!! -72 -73 -Dafna! -I'm still alive -Hey there!! -73 -74 -Dafna! -I'm still alive -Hey there!! -74 -75 -Dafna! -I'm still alive -Hey there!! -75 -76 -Dafna! -I'm still alive -Hey there!! -76 -77 -Dafna! -I'm still alive -Hey there!! -77 -78 -Dafna! -I'm still alive -Hey there!! -78 -79 -Dafna! -I'm still alive -Hey there!! -79 -80 -Dafna! -I'm still alive -Hey there!! -80 -81 -Dafna! -I'm still alive -Hey there!! -81 -82 -Dafna! -I'm still alive -Hey there!! -82 -83 -Dafna! -I'm still alive -Hey there!! -83 -84 -Dafna! -I'm still alive -Hey there!! -84 -85 -Dafna! -I'm still alive -Hey there!! -85 -86 -Dafna! -I'm still alive -Hey there!! -86 -87 -Dafna! -I'm still alive -Hey there!! -87 -88 -Dafna! -I'm still alive -Hey there!! -88 -89 -Dafna! -I'm still alive -Hey there!! -89 -90 -Dafna! -I'm still alive -Hey there!! -90 -91 -Dafna! -I'm still alive -Hey there!! -91 -92 -Dafna! -I'm still alive -Hey there!! -92 -93 -Dafna! -I'm still alive -Hey there!! -93 -94 -Dafna! -I'm still alive -Hey there!! -94 -95 -Dafna! -I'm still alive -Hey there!! -95 -96 -Dafna! -I'm still alive -Hey there!! -96 -97 -Dafna! -I'm still alive -Hey there!! -97 -98 -Dafna! -I'm still alive -Hey there!! -98 -99 -Dafna! -I'm still alive -Hey there!! -99 -100 -Dafna! -I'm still alive -Hey there!! -100 -101 -Dafna! -I'm still alive -Hey there!! -101 -102 -Dafna! -I'm still alive -Hey there!! -102 -103 -Dafna! -I'm still alive -Hey there!! -103 -104 -Dafna! -I'm still alive -Hey there!! -104 -105 -Dafna! -I'm still alive -Hey there!! -105 -106 -Dafna! -I'm still alive -Hey there!! -106 -107 -Dafna! -I'm still alive -Hey there!! -107 -108 -Dafna! -I'm still alive -Hey there!! -108 -109 -Dafna! -I'm still alive -Hey there!! -109 -110 -Dafna! -I'm still alive -Hey there!! -110 -111 -Dafna! -I'm still alive -Hey there!! -111 -112 -Dafna! -I'm still alive -Hey there!! -112 -113 -Dafna! -I'm still alive -Hey there!! -113 -114 -Dafna! -I'm still alive -Hey there!! -114 -115 -Dafna! -I'm still alive -Hey there!! -115 -116 -Dafna! -I'm still alive -Hey there!! -116 -117 -Dafna! -I'm still alive -Hey there!! -117 -118 -Dafna! -I'm still alive -Hey there!! -118 -119 -Dafna! -I'm still alive -Hey there!! -119 -120 -Dafna! -I'm still alive -Hey there!! -120 -121 -Dafna! -I'm still alive -Hey there!! -121 -122 -Dafna! -I'm still alive -Hey there!! -122 -123 -Dafna! -I'm still alive -Hey there!! -123 -124 -Dafna! -I'm still alive -Hey there!! -124 -125 -Dafna! -I'm still alive -Hey there!! -125 -126 -Dafna! -I'm still alive -Hey there!! -126 -127 -Dafna! -I'm still alive -Hey there!! -127 -128 -Dafna! -I'm still alive -Hey there!! -128 -129 -Dafna! -I'm still alive -Hey there!! -129 -130 -Dafna! -I'm still alive -Hey there!! -130 -131 -Dafna! -I'm still alive -Hey there!! -131 -132 -Dafna! -I'm still alive -Hey there!! -132 -133 -Dafna! -I'm still alive -Hey there!! -133 -134 -Dafna! -I'm still alive -Hey there!! -134 -135 -Dafna! -I'm still alive -Hey there!! -135 -136 -Dafna! -I'm still alive -Hey there!! -136 -137 -Dafna! -I'm still alive -Hey there!! -137 -138 -Dafna! -I'm still alive -Hey there!! -138 -139 -Dafna! -I'm still alive -Hey there!! -139 -140 -Dafna! -I'm still alive -Hey there!! -140 -141 -Dafna! -I'm still alive -Hey there!! -141 -142 -Dafna! -I'm still alive -Hey there!! -142 -143 -Dafna! -I'm still alive -Hey there!! -143 -144 -Dafna! -I'm still alive -Hey there!! -144 -145 -Dafna! -I'm still alive -Hey there!! -145 -146 -Dafna! -I'm still alive -Hey there!! -146 -147 -Dafna! -I'm still alive -Hey there!! -147 -148 -Dafna! -I'm still alive -Hey there!! -148 -149 -Dafna! -I'm still alive -Hey there!! -149 -150 -Dafna! -I'm still alive -Hey there!! -150 -151 -Dafna! -I'm still alive -Hey there!! -151 -152 -Dafna! -I'm still alive -Hey there!! -152 -153 -Dafna! -I'm still alive -Hey there!! -153 -154 -Dafna! -I'm still alive -Hey there!! -154 -155 -Dafna! -I'm still alive -Hey there!! -155 -156 -Dafna! -I'm still alive -Hey there!! -156 -157 -Dafna! -I'm still alive -Hey there!! -157 -158 -Dafna! -I'm still alive -Hey there!! -158 -159 -Dafna! -I'm still alive -Hey there!! -159 -160 -Dafna! -I'm still alive -Hey there!! -160 -161 -Dafna! -I'm still alive -Hey there!! -161 -162 -Dafna! -I'm still alive -Hey there!! -162 -163 -Dafna! -I'm still alive -Hey there!! -163 -164 -Dafna! -I'm still alive -Hey there!! -164 -165 -Dafna! -I'm still alive -Hey there!! -165 -166 -Dafna! -I'm still alive -Hey there!! -166 -167 -Dafna! -I'm still alive -Hey there!! -167 -168 -Dafna! -I'm still alive -Hey there!! -168 -169 -Dafna! -I'm still alive -Hey there!! -169 -170 -Dafna! -I'm still alive -Hey there!! -170 -171 -Dafna! -I'm still alive -Hey there!! -171 -172 -Dafna! -I'm still alive -Hey there!! -172 -173 -Dafna! -I'm still alive -Hey there!! -173 -174 -Dafna! -I'm still alive -Hey there!! -174 -175 -Dafna! -I'm still alive -Hey there!! -175 -176 -Dafna! -I'm still alive -Hey there!! -176 -177 -Dafna! -I'm still alive -Hey there!! -177 -178 -Dafna! -I'm still alive -Hey there!! -178 -179 -Dafna! -I'm still alive -Hey there!! -179 -180 -Dafna! -I'm still alive -Hey there!! -180 -181 -Dafna! -I'm still alive -Hey there!! -181 -182 -Dafna! -I'm still alive -Hey there!! -182 -183 -Dafna! -I'm still alive -Hey there!! -183 -184 -Dafna! -I'm still alive -Hey there!! -184 -185 -Dafna! -I'm still alive -Hey there!! -185 -186 -Dafna! -I'm still alive -Hey there!! -186 -187 -Dafna! -I'm still alive -Hey there!! -187 -188 -Dafna! -I'm still alive -Hey there!! -188 -189 -Dafna! -I'm still alive -Hey there!! -189 -190 -Dafna! -I'm still alive -Hey there!! -190 -191 -Dafna! -I'm still alive -Hey there!! -191 -192 -Dafna! -I'm still alive -Hey there!! -192 -193 -Dafna! -I'm still alive -Hey there!! -193 -194 -Dafna! -I'm still alive -Hey there!! -194 -195 -Dafna! -I'm still alive -Hey there!! -195 -196 -Dafna! -I'm still alive -Hey there!! -196 -197 -Dafna! -I'm still alive -Hey there!! -197 -198 -Dafna! -I'm still alive -Hey there!! -198 -199 -Dafna! -I'm still alive -Hey there!! -199 -Dafna - diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt deleted file mode 100644 index 758369bf0848e..0000000000000 --- a/tests/lang/030.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -$this in constructor test ---FILE-- -Name = $name; - $GLOBALS['List']->echoName(); - } - - function echoName() { - $GLOBALS['names'][]=$this->Name; - } -} - -function &foo2(&$foo) { - return $foo; -} - - -$bar1 =new foo('constructor'); -$bar1->Name = 'outside'; -$bar1->echoName(); -$List->echoName(); - -$bar1 =& foo2(new foo('constructor')); -$bar1->Name = 'outside'; -$bar1->echoName(); - -$List->echoName(); - -print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure'; -?> ---EXPECT-- -success diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt deleted file mode 100644 index 695098abbd013..0000000000000 --- a/tests/lang/031.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -Internal hash position bug on assignment (Bug #16227) ---FILE-- - ---EXPECT-- -Correct - with inner loop reset. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens without inner loop reset. -inloop 0 for key1 -inloop 1 for key1 -What happens without inner loop reset but copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens with inner loop reset over copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 diff --git a/tests/lang/032.phpt b/tests/lang/032.phpt deleted file mode 100644 index caa4c7e4302b0..0000000000000 --- a/tests/lang/032.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Class method registration ---FILE-- - ---EXPECT-- -OK - diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt deleted file mode 100644 index 724c67b225af4..0000000000000 --- a/tests/lang/033.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Alternative syntaxes test ---SKIPIF-- -=')) echo "skip removed in Zend Engine 2\n"; ?> ---FILE-- - ---EXPECT-- -If: 11 -While: 12346789 -For: 0123401234 -Switch: 1 -old_function: foo(1, 2); diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt deleted file mode 100644 index 9c640415d5386..0000000000000 --- a/tests/lang/034.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #12647 (Locale settings affecting float parsing) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -3,14 diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt deleted file mode 100644 index 9472999f47167..0000000000000 --- a/tests/lang/035.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2: set_exception_handler() ---SKIPIF-- - ---FILE-- -error = $_error; - } - - function getException() - { - return $this->error; - } -} - -function ThrowException() -{ - throw new MyException("'This is an exception!'"); -} - - -try { -} catch (MyException $exception) { - print "There shouldn't be an exception: " . $exception->getException(); - print "\n"; -} - -try { - ThrowException(); -} catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; -} -?> ---EXPECT-- -There was an exception: 'This is an exception!' diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt deleted file mode 100755 index 474316e363a79..0000000000000 --- a/tests/lang/036.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Child public element should not override parent private element in parent methods ---FILE-- -id; - } -}; - -class chld extends par { - public $id = "bar"; - function displayHim() - { - parent::displayMe(); - } -}; - - -$obj = new chld(); -$obj->displayHim(); -?> ---EXPECT-- -foo diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt deleted file mode 100755 index c2a1ee312f6b6..0000000000000 --- a/tests/lang/037.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -'Static' binding for private variables ---FILE-- -displayChild(); - } -}; - -class chld extends par { - private $id = "bar"; - - function displayChild() - { - print $this->id; - } -}; - - -$obj = new chld(); -$obj->displayMe(); - -?> ---EXPECT-- -bar diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt deleted file mode 100755 index ef510d22374fa..0000000000000 --- a/tests/lang/038.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Convert warnings to exceptions ---FILE-- -file = $errfile; - $this->line = $errline; - } -} - -function Error2Exception($errno, $errstr, $errfile, $errline) -{ - throw new MyException($errstr, $errno);//, $errfile, $errline); -} - -$err_msg = 'no exception'; -set_error_handler('Error2Exception'); - -try -{ - $con = fopen("/tmp/a_file_that_does_not_exist",'r'); -} -catch (Exception $e) -{ - $trace = $e->getTrace(); - var_dump($trace[0]['function']); - var_dump($trace[1]['function']); -} - -?> -===DONE=== - ---EXPECTF-- -string(15) "Error2Exception" -string(5) "fopen" -===DONE=== ---UEXPECTF-- -unicode(15) "Error2Exception" -unicode(5) "fopen" -===DONE=== diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt deleted file mode 100755 index aa4b5916497d6..0000000000000 --- a/tests/lang/039.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Catch Interfaces ---FILE-- -file = $errfile; - $this->line = $errline; - } -} - -function Error2Exception($errno, $errstr, $errfile, $errline) -{ - throw new MyException($errstr, $errno, $errfile, $errline); -} - -$err_msg = 'no exception'; -set_error_handler('Error2Exception'); - -try -{ - $con = fopen('/tmp/a_file_that_does_not_exist','r'); -} -catch (Catchable $e) -{ - echo "Catchable\n"; -} -catch (Exception $e) -{ - echo "Exception\n"; -} - -?> -===DONE=== ---EXPECTF-- -Catchable -===DONE=== diff --git a/tests/lang/040.phpt b/tests/lang/040.phpt deleted file mode 100755 index 6d8ece96799e8..0000000000000 --- a/tests/lang/040.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -foreach into array ---FILE-- - -===DONE=== ---EXPECT-- -0 -1 -===DONE=== diff --git a/tests/lang/bison1.phpt b/tests/lang/bison1.phpt deleted file mode 100644 index 3571576fb8347..0000000000000 --- a/tests/lang/bison1.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bison weirdness ---FILE-- - ---EXPECT-- -blah- diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt deleted file mode 100644 index 0cb3bf44d2e6b..0000000000000 --- a/tests/lang/bug17115.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #17115 (lambda functions produce segfault with static vars) ---FILE-- - ---EXPECT-- -int(0) -int(1) -int(2) diff --git a/tests/lang/bug18872.phpt b/tests/lang/bug18872.phpt deleted file mode 100644 index 2e3dc22c5824a..0000000000000 --- a/tests/lang/bug18872.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #18872 (class constant used as default parameter) ---FILE-- - ---EXPECT-- -3 -3 diff --git a/tests/lang/bug19566.phpt b/tests/lang/bug19566.phpt deleted file mode 100644 index 45c3bc588e2d3..0000000000000 --- a/tests/lang/bug19566.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #19566 (get_declared_classes() segfaults) ---FILE-- - ---EXPECTF-- -int(%d) diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt deleted file mode 100644 index dae06c9c72977..0000000000000 --- a/tests/lang/bug19943.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #19943 (memleaks) ---FILE-- - ---EXPECT-- -0 -- 0 -1 -- 1 -2 -- 2 -3 -- 3 -4 -- 4 -5 -- 5 -6 -- 6 -7 -- 7 -8 -- 8 -9 -- 9 -string(10) "0123456780" ---UEXPECT-- -0 -- 0 -1 -- 1 -2 -- 2 -3 -- 3 -4 -- 4 -5 -- 5 -6 -- 6 -7 -- 7 -8 -- 8 -9 -- 9 -unicode(10) "0123456780" diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt deleted file mode 100644 index d2248e6f0eb8f..0000000000000 --- a/tests/lang/bug20175.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Bug #20175 (Static vars can't store ref to new instance) ---SKIPIF-- - ---INI-- -error_reporting=4095 ---FILE-- -oop_name = 'oop:' . ++$oop_global; - } -} - -class oop_test { - static $oop_value; - - function oop_test() { - echo "oop_test()\n"; - } - - function oop_static() { - echo "oop_static()\n"; - if (!isset(self::$oop_value)) { - self::$oop_value = & new oop_class; - } - echo self::$oop_value->oop_name; - } -} - -print foo_static()."\n"; -print foo_static()."\n"; -print bar_static()."\n"; -print bar_static()."\n"; -//print wow_static()."\n"; -//print wow_static()."\n"; -echo "wow_static() -wow_global() -wow:1 -wow_static() -wow:1 -"; -$oop_tester = new oop_test; -print $oop_tester->oop_static()."\n"; -print $oop_tester->oop_static()."\n"; -$oop_tester = new oop_test; // repeated. -print $oop_tester->oop_static()."\n"; -?> ---EXPECTF-- -%s -foo_static() -foo_global() -foo:1 -foo_static() -foo:1 -bar_static() -bar_global() - -Strict Standards: Only variables should be assigned by reference in %sbug20175.php on line 47 -bar:1 -bar_static() -bar:1 -wow_static() -wow_global() -wow:1 -wow_static() -wow:1 -oop_test() -oop_static() -oop_class() -oop:1 -oop_static() -oop:1 -oop_test() -oop_static() -oop:1 diff --git a/tests/lang/bug21094.phpt b/tests/lang/bug21094.phpt deleted file mode 100644 index 266a1d6c8fab3..0000000000000 --- a/tests/lang/bug21094.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #21094 (set_error_handler not accepting methods) ---FILE-- - ---EXPECTF-- -[1024] errstr: test, errfile: %s, errline: %d - diff --git a/tests/lang/bug21600.phpt b/tests/lang/bug21600.phpt deleted file mode 100644 index 835daaf97a423..0000000000000 --- a/tests/lang/bug21600.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Bug #21600 (assign by reference function call changes variable contents) ---INI-- -error_reporting=4095 ---FILE-- - ---EXPECTF-- -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4 -array(1) { - ["foo"]=> - string(4) "test" -} - -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11 -array(1) { - ["foo"]=> - string(4) "test" -} ---UEXPECTF-- -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4 -array(1) { - [u"foo"]=> - unicode(4) "test" -} - -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11 -array(1) { - [u"foo"]=> - unicode(4) "test" -} diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt deleted file mode 100644 index 643b0695ee755..0000000000000 --- a/tests/lang/bug21669.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #21669 ("$obj = new $this->var;" doesn't work) ---FILE-- -name; /* Parse error */ - return $obj; - } -} -$factory = new Factory; -$test = $factory->create(); -$test->say_hello(); -?> ---EXPECT-- -Hello world diff --git a/tests/lang/bug21820.phpt b/tests/lang/bug21820.phpt deleted file mode 100644 index 0ca233ea84113..0000000000000 --- a/tests/lang/bug21820.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #21820 ("$arr['foo']" generates bogus E_NOTICE, should be E_PARSE) ---FILE-- - 'bar'); -echo "$arr['foo']"; - -?> ---EXPECTREGEX-- -Parse error: (parse|syntax) error, .*expecting `?T_STRING'? or `?T_VARIABLE'? or `?T_NUM_STRING'? in .*bug21820.php on line .* diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt deleted file mode 100644 index 30b311320bebf..0000000000000 --- a/tests/lang/bug21849.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #21849 (self::constant doesn't work as method's default parameter) ---FILE-- - ---EXPECT-- -fubar diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt deleted file mode 100644 index 75677c7473c73..0000000000000 --- a/tests/lang/bug21961.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Bug #21961 (get_parent_class() segfault) ---SKIPIF-- - ---FILE-- -name = 'Mr. X'; - $this->bars = array(); - } - - function getdrunk($where) - { - $this->bars[] = new bar($where); - } - - function getName() - { - return $this->name; - } -} - -class bar extends man -{ - public $name; - - function bar($w) - { - $this->name = $w; - } - - function getName() - { - return $this->name; - } - - function whosdrunk() - { - $who = get_parent_class($this); - if($who == NULL) - { - return 'nobody'; - } - return eval("return ".$who.'::getName();'); - } -} - -$x = new man; -$x->getdrunk('The old Tavern'); -var_dump($x->bars[0]->whosdrunk()); -?> ---EXPECT-- -string(14) "The old Tavern" ---UEXPECT-- -unicode(14) "The old Tavern" diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt deleted file mode 100644 index 4e225afc9e43f..0000000000000 --- a/tests/lang/bug22231.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #22231 (segfault when returning a global variable by reference) ---INI-- -error_reporting=4095 ---FILE-- -fubar); -unset($bar); -$bar = &foo(); -var_dump($bar->fubar); - -$foo = &foo(); -var_dump($foo); -var_dump($foo->fubar); -unset($foo); -$foo = &foo(); -var_dump($foo->fubar); -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d -object(foo)#%d (1) { - ["fubar"]=> - string(5) "fubar" -} -string(5) "fubar" -string(5) "fubar" -object(foo)#%d (1) { - ["fubar"]=> - string(5) "fubar" -} -string(5) "fubar" -string(5) "fubar" ---UEXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d -object(foo)#%d (1) { - [u"fubar"]=> - unicode(5) "fubar" -} -unicode(5) "fubar" -unicode(5) "fubar" -object(foo)#%d (1) { - [u"fubar"]=> - unicode(5) "fubar" -} -unicode(5) "fubar" -unicode(5) "fubar" diff --git a/tests/lang/bug22367.phpt b/tests/lang/bug22367.phpt deleted file mode 100644 index 364472b46414f..0000000000000 --- a/tests/lang/bug22367.phpt +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -Bug #22367 (weird zval allocation problem) ---INI-- -error_reporting=4095 -zend.ze1_compatibility_mode=1 ---FILE-- -test)); - return $this->test[$arg]; - } - - function b() { - @$this->c(); - - $zero = $this->test[0]; - $one = $this->test[1]; - $two = $this->test[2]; - $three = $this->test[3]; - $four = $this->test[4]; - return array($zero, $one, $two, $three, $four); - } - - function c() { - return $this->a($this->d()); - } - - function d() {} -} - -class bar extends foo -{ - public $i = 0; - public $idx; - - function bar($idx) { - $this->idx = $idx; - } - - function &a($arg){ - return parent::a($arg); - } - function d(){ - return $this->idx; - } -} - -$a = new bar(5); -var_dump($a->idx); -$a->c(); -$b = $a->b(); -var_dump($b); -var_dump($a->test); - -$a = new bar(2); -var_dump($a->idx); -@$a->c(); -$b = $a->b(); -var_dump($b); -var_dump($a->test); - -?> ---EXPECTF-- -Strict Standards: Declaration of bar::a() should be compatible with that of foo::a() in %sbug22367.php on line %d - -Strict Standards: Implicit cloning object of class 'bar' because of 'zend.ze1_compatibility_mode' in %sbug22367.php on line %d -int(5) -bool(false) - -Notice: Undefined offset: 5 in %sbug22367.php on line %d - -Notice: Only variable references should be returned by reference in %sbug22367.php on line %d -bool(false) -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} - -Strict Standards: Implicit cloning object of class 'bar' because of 'zend.ze1_compatibility_mode' in %sbug22367.php on line %d -int(2) -bool(true) -bool(true) -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} -array(5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) -} diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt deleted file mode 100644 index 450bbb577d938..0000000000000 --- a/tests/lang/bug22510.phpt +++ /dev/null @@ -1,126 +0,0 @@ ---TEST-- -Bug #22510 (segfault among complex references) ---INI-- -error_reporting=4095 ---FILE-- -list; - } - - function &method1() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } - - function &method2() { - print __CLASS__."::".__FUNCTION__."\n"; - return $this->foo; - } - - function method3() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } -} - -class bar -{ - function run1() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method1($this); - $this->instance->method1($this); - } - - function run2() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method2($this); - $this->instance->method2($this); - } - - function run3() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method3($this); - $this->instance->method3($this); - } -} - -function ouch(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run1(); -} - -function ok1(&$bar) { - print __FUNCTION__."\n"; - $bar->run1(); -} - -function ok2(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run2(); -} - -function ok3(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run3(); -} - -$bar = &new bar(); -ok1($bar); -$bar->instance->finalize(); -print "done!\n"; -ok2($bar); -$bar->instance->finalize(); -print "done!\n"; -ok3($bar); -$bar->instance->finalize(); -print "done!\n"; -ouch($bar); -$bar->instance->finalize(); -print "I'm alive!\n"; -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d -ok1 -bar::run1 -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::finalize -done! -ok2 -bar::run2 -foo::method2 -foo::method2 -foo::finalize -done! -ok3 -bar::run3 -foo::method3 -foo::method3 -foo::finalize -done! -ouch -bar::run1 -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::finalize -I'm alive! diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt deleted file mode 100644 index 90043f4d024bd..0000000000000 --- a/tests/lang/bug22592.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -Bug #22592 (cascading assignments to strings with curly braces broken) ---FILE-- - ---EXPECT-- -string(5) "* *-*" -string(7) "* *-* *" -string(7) "*4*-* *" -string(7) "*4*s* *" -string(8) "*4*s* *0" -string(8) "*-*-* *0" -string(8) "*-*s*s*0" -string(8) "4-4s4s*0" -string(9) "4-4s4s505" -string(9) "454s4s505" -string(1) "-" -string(6) "string" -int(4) -int(5) -string(1) "5" -[Illegal string offset: -1] ---UEXPECT-- -unicode(5) "* *-*" -unicode(7) "* *-* *" -unicode(7) "*4*-* *" -unicode(7) "*4*s* *" -unicode(8) "*4*s* *0" -unicode(8) "*-*-* *0" -unicode(8) "*-*s*s*0" -unicode(8) "4-4s4s*0" -unicode(9) "4-4s4s505" -unicode(9) "454s4s505" -unicode(1) "-" -unicode(6) "string" -int(4) -int(5) -unicode(1) "5" -[Illegal string offset: -1] diff --git a/tests/lang/bug22690.phpt b/tests/lang/bug22690.phpt deleted file mode 100644 index 6aed5be6e91d6..0000000000000 --- a/tests/lang/bug22690.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #22690 (ob_start() is broken with create_function() callbacks) ---FILE-- - -bar ---EXPECT-- -BAR -BAR diff --git a/tests/lang/bug23279.phpt b/tests/lang/bug23279.phpt deleted file mode 100644 index 78d7850ff4cc7..0000000000000 --- a/tests/lang/bug23279.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #23279 (exception handler stops after first function call) ---FILE-- - ---EXPECT-- -Goodbye Cruel World diff --git a/tests/lang/bug23384.phpt b/tests/lang/bug23384.phpt deleted file mode 100644 index 382bdfe90f3b0..0000000000000 --- a/tests/lang/bug23384.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #23384 (use of class constants in statics) ---INI-- -error_reporting=4095 ---FILE-- - 'ten'); - static $arr = array(Foo::HUN => 'ten'); - - print_r($arr); - print_r($arr2); - print_r($x); - } -} - -Foo::test(); -echo Foo::HUN."\n"; -?> ---EXPECTF-- -Strict Standards: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d -Array -( - [100] => ten -) -Array -( - [10] => ten -) -100100 diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt deleted file mode 100644 index 645bb1b7df368..0000000000000 --- a/tests/lang/bug23489.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #23489 (ob_start() is broken with method callbacks) ---FILE-- - -failure ---EXPECT-- -success diff --git a/tests/lang/bug23524.phpt b/tests/lang/bug23524.phpt deleted file mode 100755 index 18ffc33a48ead..0000000000000 --- a/tests/lang/bug23524.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #23524 Improper handling of constants in array indeces ---FILE-- -THE_CONST)) { - print_r($a); - } - f(); - f(); - f(); - echo "Done"; -?> ---EXPECT-- -Begin -Array -( - [123] => 123 -) -Array -( - [123] => 123 -) -Array -( - [123] => 123 -) -Done diff --git a/tests/lang/bug23584.phpt b/tests/lang/bug23584.phpt deleted file mode 100644 index 417cfb085651a..0000000000000 --- a/tests/lang/bug23584.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #23584 (error line numbers off by one when using #!php) ---FILE-- -#!php - ---EXPECTREGEX-- -Notice: Undefined variable:.*foo in .* on line 6 diff --git a/tests/lang/bug23624.phpt b/tests/lang/bug23624.phpt deleted file mode 100644 index ae9abbd2a4707..0000000000000 --- a/tests/lang/bug23624.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #23624 (foreach leaves current array key as null) ---FILE-- - $value); - var_dump(current($arr)); -?> ---EXPECT-- -string(3) "one" -bool(false) ---UEXPECT-- -unicode(3) "one" -bool(false) diff --git a/tests/lang/bug23922.phpt b/tests/lang/bug23922.phpt deleted file mode 100644 index 1fc6e548ff0b4..0000000000000 --- a/tests/lang/bug23922.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #23922 (scope doesn't properly propagate into internal functions) ---FILE-- -foo == 1'); } - - function as_expr() - { assert($this->foo == 1); } - } - - $foo = new foo(); - $foo->as_expr(); - $foo->as_string(); -?> ---EXPECT-- diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt deleted file mode 100644 index fc51c83d77bda..0000000000000 --- a/tests/lang/bug24054.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24054 (Assignment operator *= broken) ---FILE-- - 1, 'b' => 2, 'c' => 3); - -foreach($arr as $k=>$v) { - global $$k; // comment this out and it works in PHP 5 too.. - - echo "($k => $v)\n"; - - $$k = $v; -} -?> ---EXPECT-- -(a => 1) -(b => 2) -(c => 3) diff --git a/tests/lang/bug24403.phpt b/tests/lang/bug24403.phpt deleted file mode 100644 index fe99257d3d3ae..0000000000000 --- a/tests/lang/bug24403.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #24403 (scope doesn't properly propagate into internal functions) ---FILE-- -a) ? '\'.\$p[\'\\1\'].\'' : -'\'.\$r[\'\\1\'].\'')", - "{a} b {c}"); - } -} -new a(); -?> ---EXPECT-- diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt deleted file mode 100644 index b0cfbe093120a..0000000000000 --- a/tests/lang/bug24436.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #24436 (isset() and empty() produce errors with non-existent variables in objects) ---FILE-- -test[0][0])) { print "test1";} - if (!isset($this->test[0][0])) { print "test2";} - } -} - -$test1 = new test(); -?> ---EXPECT-- -test1test2 diff --git a/tests/lang/bug24499.phpt b/tests/lang/bug24499.phpt deleted file mode 100755 index 6ce56dbad7328..0000000000000 --- a/tests/lang/bug24499.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24499 (bogus handling of a public property as a private one) ---FILE-- -id = "bar"; - } -} - -$id = new Id(); -@$obj->foo = "bar"; -$id->tester($obj); -print_r($obj); -?> ---EXPECT-- -stdClass Object -( - [foo] => bar - [id] => bar -) diff --git a/tests/lang/bug24573.phpt b/tests/lang/bug24573.phpt deleted file mode 100644 index e087d1fb2cba3..0000000000000 --- a/tests/lang/bug24573.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24573 (debug_backtrace() crashes if $this is set to null) ---FILE-- -Bar(); - -echo "OK\n"; - -?> ---EXPECTF-- - -Fatal error: Cannot re-assign $this in %s on line %d \ No newline at end of file diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt deleted file mode 100755 index 3cd3c4a595a0a..0000000000000 --- a/tests/lang/bug24640.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #24640 (var_export and var_dump can't output large float) ---FILE-- - ---EXPECT-- -1.7E+300 -float(1.7E+300) -1.7E+300 -1.7E+300 ------- -1.7E-300 -float(1.7E-300) -1.7E-300 -1.7E-300 ------- -1.7E+79 -float(1.7E+79) -1.7E+79 -1.7E+79 ------- -1.7E-79 -float(1.7E-79) -1.7E-79 -1.7E-79 ------- -1.7E+80 -float(1.7E+80) -1.7E+80 -1.7E+80 ------- -1.7E-80 -float(1.7E-80) -1.7E-80 -1.7E-80 ------- -1.7E+81 -float(1.7E+81) -1.7E+81 -1.7E+81 ------- -1.7E-81 -float(1.7E-81) -1.7E-81 -1.7E-81 ------- diff --git a/tests/lang/bug24652.phpt b/tests/lang/bug24652.phpt deleted file mode 100755 index 3bcea0e1d295d..0000000000000 --- a/tests/lang/bug24652.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #24652 (broken array_flip()) ---FILE-- - 0); - var_dump($f); - var_dump(array_key_exists(7, $f)); - var_dump(array_key_exists('7', $f)); - - print "----------\n"; - /* This doesn't */ - $f = array_flip(array('7')); - var_dump($f); - var_dump(array_key_exists(7, $f)); - var_dump(array_key_exists('7', $f)); -?> ---EXPECT-- -array(1) { - [7]=> - int(0) -} -bool(true) -bool(true) ----------- -array(1) { - [7]=> - int(0) -} -bool(true) -bool(true) diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt deleted file mode 100644 index 5f3b324b61ee9..0000000000000 --- a/tests/lang/bug24658.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #24658 (combo of typehint / reference causes crash) ---FILE-- - ---EXPECTF-- -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -===no_typehint=== -object(foo)#%d (0) { -} -int(1) -int(2) -===no_typehint_ref=== -object(foo)#%d (0) { -} -int(1) -int(2) -===typehint=== -object(foo)#%d (0) { -} - -Catchable fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt deleted file mode 100644 index 8c8cd6ee01077..0000000000000 --- a/tests/lang/bug24783.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)") ---FILE-- - "foo\0bar"); - foreach ($arr as $key => $val) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; - } -?> ---EXPECT-- -7: foo%00bar => foo%00bar diff --git a/tests/lang/bug24908.phpt b/tests/lang/bug24908.phpt deleted file mode 100755 index 30056abf3cb27..0000000000000 --- a/tests/lang/bug24908.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #24908 (super-globals can not be used in __destruct()) ---INI-- -variables_order=GPS ---FILE-- - ---EXPECT-- -OK diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt deleted file mode 100644 index 3d2cc7008baf2..0000000000000 --- a/tests/lang/bug24926.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #24926 (lambda function (create_function()) cannot be stored in a class property) ---FILE-- -functions['test'] = $function; - print($this->functions['test']()); // werkt al niet meer - - } -} - -$a = new foo (); - -?> ---EXPECT-- -FOO -FOO diff --git a/tests/lang/bug24951.phpt b/tests/lang/bug24951.phpt deleted file mode 100644 index aa48ab29368e0..0000000000000 --- a/tests/lang/bug24951.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Bug #24951 (ob_flush() destroys output handler) ---FILE-- - ---EXPECT-- -[Hello from t1 1 Hello from t1 2 ] - -[Hello from t2 1 Hello from t2 2 ] - -Hello from t3 2 ] diff --git a/tests/lang/bug25145.phpt b/tests/lang/bug25145.phpt deleted file mode 100755 index e33580ab0def9..0000000000000 --- a/tests/lang/bug25145.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #25145 (SEGV on recpt of form input with name like "123[]") ---SKIPIF-- - ---GET-- -123[]=SEGV ---FILE-- - ---EXPECT-- -array(1) { - [123]=> - array(1) { - [0]=> - string(4) "SEGV" - } -} -Done diff --git a/tests/lang/bug25547.phpt b/tests/lang/bug25547.phpt deleted file mode 100755 index cce556ceb9ae9..0000000000000 --- a/tests/lang/bug25547.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #25547 (error_handler and array index with function call) ---FILE-- - ---EXPECT-- -handler(Undefined index: foo) -Array -( - [foo] => 1 -) -Done diff --git a/tests/lang/bug25652.phpt b/tests/lang/bug25652.phpt deleted file mode 100755 index 09cfc181977b0..0000000000000 --- a/tests/lang/bug25652.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #25652 (Calling Global functions dynamically fails from Class scope) ---FILE-- -arr[0]('testvalue'); - } - } - - $a = new foo (); - $a->bar (); - -?> ---EXPECT-- -testfunc testvalue diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt deleted file mode 100755 index bb030c9df834c..0000000000000 --- a/tests/lang/bug25922.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #25922 (SEGV in error_handler when context is destroyed) ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -Undefined variable: data -Undefined index here: '' diff --git a/tests/lang/bug26182.phpt b/tests/lang/bug26182.phpt deleted file mode 100644 index 7417293928a14..0000000000000 --- a/tests/lang/bug26182.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26182 (Object properties created redundantly) ---INI-- -error_reporting=4095 ---FILE-- -x)) { - //just for demo - } - } -} - -$t = new A (); - -print_r($t); - -?> ---EXPECT-- -A Object -( -) diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt deleted file mode 100644 index e51978b3d2fa0..0000000000000 --- a/tests/lang/bug26696.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #26696 (string index in a switch() crashes with multiple matches) ---FILE-- - ---EXPECT-- -OK -OK diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt deleted file mode 100644 index abb99c34fd1e0..0000000000000 --- a/tests/lang/bug26866.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26866 (segfault when exception raised in __get) ---FILE-- -bar->get_name(); -} -catch (Exception $E) { - echo "Exception raised!\n"; -} -?> ---EXPECT-- -Exception raised! diff --git a/tests/lang/bug26869.phpt b/tests/lang/bug26869.phpt deleted file mode 100644 index 77dd2592edf95..0000000000000 --- a/tests/lang/bug26869.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #26869 (constant as the key of static array) ---FILE-- - 1); - var_dump($a); - var_dump(isset($a[A])); -?> ---EXPECT-- -array(1) { - [1]=> - int(1) -} -bool(true) diff --git a/tests/lang/bug27354.phpt b/tests/lang/bug27354.phpt deleted file mode 100644 index e10ad9c924024..0000000000000 --- a/tests/lang/bug27354.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #27354 (Modulus operator crashes PHP) ---FILE-- - ---EXPECTF-- -int(%i) -int(%i) -int(%i) -int(%i) diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt deleted file mode 100755 index 81ff9340699f0..0000000000000 --- a/tests/lang/bug27439.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #27439 (foreach() with $this segfaults) ---FILE-- -object = new test_props; - } - - public function getArray() { - return $this->array; - } - - public function getString() { - return $this->string; - } - - public function case1() { - foreach ($this->array as $foo) { - echo $foo; - } - } - - public function case2() { - foreach ($this->foobar as $foo); - } - - public function case3() { - foreach ($this->string as $foo); - } - - public function case4() { - foreach ($this->getArray() as $foo); - } - - public function case5() { - foreach ($this->getString() as $foo); - } - - public function case6() { - foreach ($this->object as $foo) { - echo $foo; - } - } -} -$test = new test(); -$test->case1(); -$test->case2(); -$test->case3(); -$test->case4(); -$test->case5(); -$test->case6(); -echo "\n"; -echo "===DONE==="; -?> ---EXPECTF-- -123 -Warning: Invalid argument supplied for foreach() in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d -123 -===DONE=== diff --git a/tests/lang/bug27443.phpt b/tests/lang/bug27443.phpt deleted file mode 100644 index 409794331b381..0000000000000 --- a/tests/lang/bug27443.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #27443 (defined() returns wrong type) ---FILE-- - ---EXPECT-- -boolean diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt deleted file mode 100644 index a6ceae7463c4a..0000000000000 --- a/tests/lang/bug27535.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #27535 (Objects pointing to each other cause Apache to crash) ---FILE-- -storage = new Class1(); - - $this->storage->_Class2_obj = $this; - } -} - -$foo = new Class2(); - -?> -Alive! ---EXPECT-- -Alive! diff --git a/tests/lang/bug28213.phpt b/tests/lang/bug28213.phpt deleted file mode 100644 index 3677d4c6f3557..0000000000000 --- a/tests/lang/bug28213.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #28213 (crash in debug_print_backtrace in static methods) ---FILE-- - ---EXPECTREGEX-- -.*#1\s*include.* diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt deleted file mode 100644 index f81ad7fec982a..0000000000000 --- a/tests/lang/bug28800.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #28800 (Incorrect string to number conversion for strings starting with 'inf') ---FILE-- - ---EXPECT-- -0 -0 -0 -0 -0 -0 - diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt deleted file mode 100755 index 5f292bd759340..0000000000000 --- a/tests/lang/bug29566.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #29566 (foreach/string handling strangeness) ---FILE-- - -===DONE=== ---EXPECTF-- -Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d -===DONE=== diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt deleted file mode 100755 index d320de0ee72d7..0000000000000 --- a/tests/lang/bug29893.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #29893 (segfault when using array as index) ---FILE-- - -===DONE=== ---EXPECTF-- -Warning: Cannot use a scalar value as an array in %sbug29893.php on line %d -===DONE=== diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt deleted file mode 100755 index 7882936f08b8d..0000000000000 --- a/tests/lang/bug29944.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #29944 (function defined in switch crashes PHP) ---FILE-- - - -===DONE=== ---EXPECT-- -1 -===DONE=== diff --git a/tests/lang/bug30578.phpt b/tests/lang/bug30578.phpt deleted file mode 100644 index d8a8d2e54f8d3..0000000000000 --- a/tests/lang/bug30578.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #30578 (Output buffers flushed before calling __desctruct functions) ---FILE-- - ---EXPECT-- -This should be displayed first. -Buffered data: This should be displayed last. diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt deleted file mode 100644 index 2574d132d3d11..0000000000000 --- a/tests/lang/bug30638.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #30638 (localeconv returns wrong LC_NUMERIC settings) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -decimal_point: , -thousands_sep: . diff --git a/tests/lang/bug30726.phpt b/tests/lang/bug30726.phpt deleted file mode 100644 index 79aeff7d265c6..0000000000000 --- a/tests/lang/bug30726.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #30726 (-.1 like numbers are not being handled correctly) ---FILE-- - ---EXPECT-- -1 diff --git a/tests/lang/bug30862.phpt b/tests/lang/bug30862.phpt deleted file mode 100644 index 12c95d57e87b7..0000000000000 --- a/tests/lang/bug30862.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #30862 (Static array with boolean indexes) ---FILE-- -"false", true=>"true"); -} -print_r(T::$a); -?> ----------- -"false", Y=>"true"); -} -print_r(T2::$a); -?> ---EXPECT-- -Array -( - [0] => false - [1] => true -) ----------- -Array -( - [0] => false - [1] => true -) diff --git a/tests/lang/bug32828.phpt b/tests/lang/bug32828.phpt deleted file mode 100644 index ad59646f5007e..0000000000000 --- a/tests/lang/bug32828.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #32828 (Throwing exception in output_callback function with ob_start and ob_end_clean leads to segfault) ---FILE-- - ---EXPECTF-- -Fatal error: Uncaught exception 'Exception' in %s:%d -Stack trace: -#0 [internal function]: output_handler('', %d) -#1 %s(%d): ob_end_clean() -#2 {main} - thrown in %s on line %d diff --git a/tests/lang/bug32924.phpt b/tests/lang/bug32924.phpt deleted file mode 100644 index ddb8301e31072..0000000000000 --- a/tests/lang/bug32924.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #32924 (prepend does not add file to included files) ---INI-- -include_path=. -auto_prepend_file=tests/lang/inc.inc ---FILE-- - -END ---EXPECT-- -Included! -END diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt deleted file mode 100644 index b33ae24c89e7c..0000000000000 --- a/tests/lang/bug7515.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #7515 (weird & invisible referencing of objects) ---SKIPIF-- - ---INI-- -error_reporting=2039 ---FILE-- -root=new obj(); - -ob_start(); -var_dump($o); -$x=ob_get_contents(); -ob_end_clean(); - -$o->root->method(); - -ob_start(); -var_dump($o); -$y=ob_get_contents(); -ob_end_clean(); -if ($x == $y) { - print "success"; -} else { - print "failure -x=$x -y=$y -"; -} -?> ---EXPECT-- -success diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt deleted file mode 100644 index d0161286d0646..0000000000000 --- a/tests/lang/catchable_error_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Catchable fatal error [1] ---FILE-- - ---EXPECTF-- -Catchable fatal error: Argument 1 passed to blah() must be an instance of Foo, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt deleted file mode 100644 index 53f443696f775..0000000000000 --- a/tests/lang/catchable_error_002.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Catchable fatal error [2] ---FILE-- - ---EXPECTF-- -array(5) { - [0]=> - int(4096) - [1]=> - string(%d) "Argument 1 passed to blah() must be an instance of Foo, called in %scatchable_error_002.php on line 17 and defined" - [2]=> - string(%d) "%scatchable_error_002.php" - [3]=> - int(5) - [4]=> - array(0) { - } -} -ALIVE! diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt deleted file mode 100644 index bb135345464ca..0000000000000 --- a/tests/lang/each_binary_safety.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Binary safety of each() for both keys and values ---FILE-- - "foo\0bar"); -while (list($key, $val) = each($arr)) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; -} -?> ---EXPECT-- -7: foo%00bar => foo%00bar diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt deleted file mode 100644 index 61f45d47d578e..0000000000000 --- a/tests/lang/error_2_exception_001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ZE2 errors caught as exceptions ---SKIPIF-- - ---FILE-- -errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } -} - -function ErrorsToExceptions($errno, $errmsg) { - throw new MyException($errno, $errmsg); -} - -set_error_handler("ErrorsToExceptions"); - -// make sure it isn't catching exceptions that weren't -// thrown... - -try { -} catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; -} - -try { - trigger_error("I will become an exception", E_USER_ERROR); -} catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; -} - -?> ---EXPECT-- -There was an exception: 256, 'I will become an exception' diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt deleted file mode 100755 index 598b844fb732f..0000000000000 --- a/tests/lang/foreach_with_object_001.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -foreach() with foreach($o->mthd()->arr) ---FILE-- -c()->a as $value) { - print "$value\n"; -} - -?> -===DONE=== ---EXPECT-- -1 -2 -3 -4 -5 -===DONE=== diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt deleted file mode 100644 index eb52bb8c10678..0000000000000 --- a/tests/lang/foreach_with_references_001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -foreach() with references ---FILE-- - "one", 2 => "two", 3 => "three"); - -foreach($arr as $key => $val) { - $val = $key; -} - -print_r($arr); - -foreach($arr as $key => &$val) { - $val = $key; -} - -print_r($arr); - ---EXPECT-- -Array -( - [1] => one - [2] => two - [3] => three -) -Array -( - [1] => 1 - [2] => 2 - [3] => 3 -) diff --git a/tests/lang/inc.inc b/tests/lang/inc.inc deleted file mode 100644 index 64b30afe47669..0000000000000 --- a/tests/lang/inc.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt deleted file mode 100644 index dc14706a362b9..0000000000000 --- a/tests/lang/type_hints_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9 diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt deleted file mode 100644 index b21240a7923a7..0000000000000 --- a/tests/lang/type_hints_002.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- -f(new P); -$o->f(); -$o->f(NULL); -?> ---EXPECT-- -object(P)#2 (0) { -} -- -NULL -- -NULL -- - diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt deleted file mode 100644 index 9f1d2ba07db3b..0000000000000 --- a/tests/lang/type_hints_003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Default value for parameters with a class type hint can only be NULL in %stest.php on line 3 diff --git a/tests/odbc-display.php b/tests/odbc-display.php deleted file mode 100644 index f79a854aea8c8..0000000000000 --- a/tests/odbc-display.php +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/tests/odbc-t1.php b/tests/odbc-t1.php deleted file mode 100644 index 90cb97910f5bd..0000000000000 --- a/tests/odbc-t1.php +++ /dev/null @@ -1,38 +0,0 @@ - - -Quick & dirty ODBC test - - -

              ODBC Test 1 - Connection

              -"; - $conn = odbc_connect($dsn,$dbuser,$dbpwd); - if(!$conn){ -?> -

              Error connecting to database! Check DSN, username and password

              - -

              Connection successful

              -">Proceed to next test -| Change login information - -You will need permisson to create tables for the following tests! - - - - - -
              Database (DSN):
              User:
              Password:
              -
              - - - - - - diff --git a/tests/odbc-t2.php b/tests/odbc-t2.php deleted file mode 100644 index a500b09e8b5b0..0000000000000 --- a/tests/odbc-t2.php +++ /dev/null @@ -1,82 +0,0 @@ - - -Quick & dirty ODBC test #2 - - -

              ODBC Test 2 - Create table

              - -

              Error connecting to database! Check DSN, username and password

              - -- OK

              -Dropping table "php3_test" - -- OK

              -Create table "php_test" - - - OK

              -Table Info:
              - - - - - - - - - - - - - -
              NameTypeLength
              -

              -


              -

              -">Proceed to next test -| Change login information - - - -

              - - - - -
              Database (DSN):
              User:
              Password:
              - -
              - - - - diff --git a/tests/odbc-t3.php b/tests/odbc-t3.php deleted file mode 100644 index edfdc658f898d..0000000000000 --- a/tests/odbc-t3.php +++ /dev/null @@ -1,95 +0,0 @@ - - -Database test #3 - - -

              ODBC Test 3 - Insert records

              - -

              Error connecting to database! Check DSN, username and password

              - - - OK

              -Clearing table "php_test" - - - OK

              -Inserting into table "php_test" - - - OK

              -

              The table "php_test" should now contain the following values:

              - - - - - - - - - - - - - - - - - - - -
              ABCD
              test-11001100.01php - values 1
              test-21002200.02php - values 2
              test-31003300.03php - values 3
              test-41004400.04php - values 4
              test-51005500.05php - values 5
              - -

              Actual contents of table "php_test":

              - -

              -


              -

              -">Proceed to next test -| Change login information - -

              - - - - -
              Database:
              User:
              Password:
              - - -
              - - - - diff --git a/tests/odbc-t4.php b/tests/odbc-t4.php deleted file mode 100644 index 10e8f4b2d96be..0000000000000 --- a/tests/odbc-t4.php +++ /dev/null @@ -1,91 +0,0 @@ - - -Database test #4 - - -

              ODBC Test 4 - Cursors

              -The following test requires your ODBC driver to support positioned updates

              - -

              Error connecting to database! Check DSN, username and password

              - - - OK

              -Updating table "php_test" -1002 for update'))){ - $cursor = odbc_cursor($result); - if(($upd = odbc_prepare($conn,"update php_test set a=?, b=? where current of $cursor"))){ - while(odbc_fetch_row($result)) { - $params[0] = odbc_result($result, 1) . "(*)"; - $params[1] = odbc_result($result, 2) + 2000; - odbc_execute($upd, $params); - } - odbc_commit($conn); - } - } - if($result && $upd){ -?> - - OK

              -

              The table "php_test" should now contain the following values:

              - - - - - - - - - - - - - - - - - - - - - - -
              ABCD
              test-11001100.01php3 - values 1
              test-21002200.02php - values 2
              test-3(*)3003300.03php - values 3
              test-4(*)3004400.04php - values 4
              test-5(*)3005500.05php - values 5
              - Note: If you reload this testpage,
              - the three last rows will contain different
              values in columns A and B
              -
              - -

              Actual contents of table "php_test":

              -"; - } -?> -


              -">Proceed to next test - -

              - - - - -
              Database:
              User:
              Password:
              - - -
              - - - diff --git a/tests/odbc-t5.php b/tests/odbc-t5.php deleted file mode 100644 index 13af52d2226d0..0000000000000 --- a/tests/odbc-t5.php +++ /dev/null @@ -1,137 +0,0 @@ - - -Database test #5 - - -

              ODBC Test 5 - Blobs

              - -

              Please select the images (gif) you want to put into the database

              -
              -Image 1:

              -Image 2:

              -Image 3:

              -Blob database type name: -

              - - - - -| -

              - - - -

              Error connecting to database! Check DSN, username and password

              - - - OK

              -Images in database"; - while(odbc_fetch_into($res, &$imgs)){ - echo "$imgs[0] : \n

              "; - } - }else{ - echo "Couldn't execute query"; - } - echo "\n\n"; - exit; - } -?> -Dropping table "php_test" - - - OK

              -Creating table "php_test": - - - OK

              -Table Info:
              - - - - - - - - - - - - - -
              NameTypeLength
              - -Inserting data: - - - OK

              -">Display Images - -

              - - - - -
              Database:
              User:
              Password:
              - - -
              - - - diff --git a/tests/quicktester.inc b/tests/quicktester.inc deleted file mode 100644 index 48ed6b549fa01..0000000000000 --- a/tests/quicktester.inc +++ /dev/null @@ -1,75 +0,0 @@ -$test) -{ - // ignore empty lines - if (!$test) continue; - - // warn for trailing ; - if (substr(trim($test), -1, 1) === ';') { - echo "WARNING: trailing ';' found in test ".($n+1)."\n"; - exit; - } - - // try for operators - $operators = array('===', '~=='); - $operator = NULL; - foreach ($operators as $a_operator) { - if (strpos($test, $a_operator)!== FALSE) { - $operator = $a_operator; - list($left,$right) = explode($operator, $test); - break; - } - } - if (!$operator) { - echo "WARNING: unknown operator in '$test' (1)\n"; - exit; - } - - $left = eval("return ($left );"); - $right = eval("return ($right);"); - switch (@$operator) { - case '===': // exact match - $result = $left === $right; - break; - case '~==': // may differ after 12th significant number - if ( !is_float($left ) && !is_int($left ) - || !is_float($right) && !is_int($right)) { - $result = FALSE; - break; - } - $result = abs(($left-$right) / $left) < 1e-12; - break; - default: - echo "WARNING: unknown operator in '$test' (2)\n"; - exit; - } - - $success = $success && $result; - if (!$result) { - echo "\nAssert failed:\n"; - echo "$test\n"; - echo "Left: ";var_dump($left ); - echo "Right: ";var_dump($right); - } -} -if ($success) echo "OK"; - diff --git a/tests/recurse b/tests/recurse deleted file mode 100644 index 5b8c646f6b733..0000000000000 --- a/tests/recurse +++ /dev/null @@ -1,21 +0,0 @@ - ---EXPECT-- -string(1) "=" \ No newline at end of file diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt deleted file mode 100644 index d16a66ef7a0a8..0000000000000 --- a/tests/run-test/test005.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Error message handling (without ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(1) "1" -string(4) "8191" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test006.phpt b/tests/run-test/test006.phpt deleted file mode 100644 index 4dca66a4f717b..0000000000000 --- a/tests/run-test/test006.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Error messages are shown ---FILE-- - ---EXPECTREGEX-- -.*Division by zero.* diff --git a/tests/run-test/test007.phpt b/tests/run-test/test007.phpt deleted file mode 100644 index f5f934f72ef22..0000000000000 Binary files a/tests/run-test/test007.phpt and /dev/null differ diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt deleted file mode 100644 index 14fff59bd8876..0000000000000 --- a/tests/run-test/test008.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Error message handling (with ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -%s: %sivision by zero in %s on line %d -string(1) "1" -string(4) "4095" -string(1) "0" -string(1) "1" -string(1) "0" -string(%d) "%sivision by zer%s" -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt deleted file mode 100644 index a7d360dc64e7c..0000000000000 --- a/tests/run-test/test008a.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Error message handling (without ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(1) "1" -string(4) "8191" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test009.phpt b/tests/run-test/test009.phpt deleted file mode 100644 index 650686f69017d..0000000000000 --- a/tests/run-test/test009.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -print_r(Object) ---FILE-- - ---EXPECTF-- -Foo Object -( -) diff --git a/tests/run.html b/tests/run.html deleted file mode 100644 index 281e9e57c8b7d..0000000000000 --- a/tests/run.html +++ /dev/null @@ -1,11 +0,0 @@ - - -
              - -
              - -
              - - - diff --git a/tests/run.php b/tests/run.php deleted file mode 100644 index a6792b5af72c7..0000000000000 --- a/tests/run.php +++ /dev/null @@ -1,17 +0,0 @@ - - - -Executing:
              -"); -?> -
              - - - \ No newline at end of file diff --git a/tests/scan_cases b/tests/scan_cases deleted file mode 100644 index d562230fde115..0000000000000 --- a/tests/scan_cases +++ /dev/null @@ -1,28 +0,0 @@ -# Test file used by testscanf.php. Feel free to add additional cases -# sscanf test cases. formatted to be slurped and split by explode -%d|48| valid decimal (positive) -%d|-98| valid signed decimal (negative) -%d|56a| integer scan : decimal digit followed by alpha -%4d|558071|decimal integer with width specification -%i|-5489|valid signed integer (negative) -%s| the rain in spain | plain ole string matched with %s -%10s|jabberwocky| string with width specifier -%f|289.071| valid float (%f) -%f|-0.403| valid negative (%f) -%3f|76.4|Float with width specifier ending at decimal point -%3f"|789.4|Float with width specifier -%o|0321|octal with leading 0 -%o|327| valid octal digits -%o|380| octal scan with octal digit followed by non-octal -%x|fe| valid hex| -%x|0xfe| "c" style hex with leading 0x| -%x|455| hex with all single digits < f -%x|-98| hex (negative signed int) -%c|y| single char -%4c|tulips|Character with width specification (4) -%e|10e-9| signed floating point with negative exponent -%e|10e+9| signed floating point with explicit positive exponent -%e|10e9| signed floating point with positive exponent (no + sign) -# next we test multiple cases - %d %i %o %u %x %s %c %e %f %g | 19 84 0666 2000 0xface your x 31e+9 0.912 2.4 |multiple specifiers - diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt deleted file mode 100644 index d5e2f64774459..0000000000000 --- a/tests/strings/001.phpt +++ /dev/null @@ -1,210 +0,0 @@ ---TEST-- -String functions ---FILE-- -?' - . '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_' - . '`abcdefghijklmnopqrstuvwxyz{|}~' - . "\0"; - -echo "Testing rawurlencode: "; -$encoded = rawurlencode($raw); -$correct = '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F' - . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_' - . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E' - . '%00'; -if ($encoded == $correct) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing rawurldecode: "; -$decoded = rawurldecode($correct); -if ($decoded == $raw) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing urlencode: "; -$encoded = urlencode($raw); -$correct = '+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F' - . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_' - . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E' - . '%00'; -if ($encoded == $correct) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing urldecode: "; -$decoded = urldecode($correct); -if ($decoded == $raw) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing quotemeta: "; -$raw = "a.\\+*?" . chr(91) . "^" . chr(93) . "b\$c"; -$quoted = quotemeta($raw); -if ($quoted == "a\\.\\\\\\+\\*\\?\\[\\^\\]b\\\$c") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing ufirst: "; -$str = "fahrvergnuegen"; -$uc = ucfirst($str); -if ($uc == "Fahrvergnuegen") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing strtr: "; -$str = "test abcdefgh"; -$tr = strtr($str, "def", "456"); -if ($tr == "t5st abc456gh") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing addslashes: "; -$str = "\"\\'"; -$as = addslashes($str); -if ($as == "\\\"\\\\\\'") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing stripslashes: "; -$str = "\$\\'"; -$ss = stripslashes($str); -if ($ss == "\$'") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - - -echo "Testing uniqid: "; -$str = "prefix"; -$ui1 = uniqid($str); -$ui2 = uniqid($str); - -$len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; - -if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -?> ---EXPECT-- -Testing strtok: passed -Testing strstr: passed -Testing strrchr: passed -Testing strtoupper: passed -Testing strtolower: passed -Testing substr: passed -Testing rawurlencode: passed -Testing rawurldecode: passed -Testing urlencode: passed -Testing urldecode: passed -Testing quotemeta: passed -Testing ufirst: passed -Testing strtr: passed -Testing addslashes: passed -Testing stripslashes: passed -Testing uniqid: passed diff --git a/tests/strings/002.phpt b/tests/strings/002.phpt deleted file mode 100644 index b563637fff042..0000000000000 --- a/tests/strings/002.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Formatted print functions ---INI-- -unicode.script_encoding=ISO-8859-1 ---FILE-- -\n", "foo"); -printf("printf test 9:<%-20s>\n", "bar"); -printf("printf test 10: 123456789012345\n"); -printf("printf test 10:<%15s>\n", "hĝyesterettsjustitiarius"); -printf("printf test 11: 123456789012345678901234567890\n"); -printf("printf test 11:<%30s>\n", "hĝyesterettsjustitiarius"); -printf("printf test 12:%5.2f\n", -12.34); -printf("printf test 13:%5d\n", -12); -printf("printf test 14:%c\n", 64); -printf("printf test 15:%b\n", 170); -printf("printf test 16:%x\n", 170); -printf("printf test 17:%X\n", 170); -printf("printf test 18:%16b\n", 170); -printf("printf test 19:%16x\n", 170); -printf("printf test 20:%16X\n", 170); -printf("printf test 21:%016b\n", 170); -printf("printf test 22:%016x\n", 170); -printf("printf test 23:%016X\n", 170); -printf("printf test 24:%.5s\n", "abcdefghij"); -printf("printf test 25:%-2s\n", "gazonk"); -printf("printf test 26:%2\$d %1\$d\n", 1, 2); -printf("printf test 27:%3\$d %d %d\n", 1, 2, 3); -printf("printf test 28:%2\$02d %1\$2d\n", 1, 2); -printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2); -print("printf test 30:"); printf("%0\$s", 1); print("x\n"); -vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2)); - - -?> ---EXPECT-- -fprintf test 1:abcde -int(20) -printf test 1:simple string -printf test 2:42 -printf test 3:3.333333 -printf test 4:3.3333333333 -printf test 5:2.50 -printf test 6:2.50000000 -printf test 7:0000002.50 -printf test 8:< foo> -printf test 9: -printf test 10: 123456789012345 -printf test 10: -printf test 11: 123456789012345678901234567890 -printf test 11:< hĝyesterettsjustitiarius> -printf test 12:-12.34 -printf test 13: -12 -printf test 14:@ -printf test 15:10101010 -printf test 16:aa -printf test 17:AA -printf test 18: 10101010 -printf test 19: aa -printf test 20: AA -printf test 21:0000000010101010 -printf test 22:00000000000000aa -printf test 23:00000000000000AA -printf test 24:abcde -printf test 25:gazonk -printf test 26:2 1 -printf test 27:3 1 2 -printf test 28:02 1 -printf test 29:2 1 -printf test 30:x -vprintf test 1:2 1 diff --git a/tests/strings/004.phpt b/tests/strings/004.phpt deleted file mode 100644 index a283fda6991ec..0000000000000 --- a/tests/strings/004.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -highlight_string() buffering ---INI-- -highlight.string=#DD0000 -highlight.comment=#FF9900 -highlight.keyword=#007700 -highlight.bg=#FFFFFF -highlight.default=#0000BB -highlight.html=#000000 ---FILE-- -
              "); -$var = highlight_string("

              ", TRUE); -echo "\n[$var]\n"; -?> ---EXPECT-- - -<br /><?php echo "foo"?><br /> - -[ -<br /><?php echo "bar"?><br /> -] diff --git a/tests/strings/bug22592.phpt b/tests/strings/bug22592.phpt deleted file mode 100755 index 2af793ab59866..0000000000000 --- a/tests/strings/bug22592.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #22592 (Cascading assignments to strings with curly braces broken) ---FILE-- - ---EXPECT-- -string(6) "abcdef" -string(6) "abcdef" -string(6) "a*c*e*" -string(6) "a*c*e*" ---UEXPECT-- -unicode(6) "abcdef" -unicode(6) "abcdef" -unicode(6) "a*c*e*" -unicode(6) "a*c*e*" diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt deleted file mode 100644 index f21bcb900aee3..0000000000000 --- a/tests/strings/bug26703.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #26703 (Certain characters inside strings incorrectly treated as keywords) ---INI-- -highlight.string=#DD0000 -highlight.comment=#FF9900 -highlight.keyword=#007700 -highlight.bg=#FFFFFF -highlight.default=#0000BB -highlight.html=#000000 ---FILE-- -'); -?> ---EXPECT-- - -<?php echo "foo[] $a \n"?> - - diff --git a/tests/test.pl b/tests/test.pl deleted file mode 100644 index 2502cb1298188..0000000000000 --- a/tests/test.pl +++ /dev/null @@ -1,34 +0,0 @@ -class_name; - } -}; - - -class ChildClass { - var $class_name = "ChildClass"; - - function ChildClass($value, $new_value) { - BaseClass::BaseClass($value); - print "new value is '$new_value'\n"; - } - function MyClassName($a_value) { - return BaseClass::MyClassName()." and the value is '$a_value'"; - } -}; - - -$obj = new ChildClass("Test", "Another test"); -print $obj->MyClassName("not interesting"); \ No newline at end of file diff --git a/tests/testarray b/tests/testarray deleted file mode 100644 index bee5cca546c79..0000000000000 --- a/tests/testarray +++ /dev/null @@ -1,21 +0,0 @@ -This is a small test.... -Version}\n"; -$word->Visible = 1; -$word->Documents->Add(); -$word->Selection->TypeText("This is a test..."); -$word->Quit(); -/* -$word->Documents[1]->SaveAs("Useless test.doc"); -*/ -?> \ No newline at end of file diff --git a/tests/testcpdf b/tests/testcpdf deleted file mode 100644 index a74087d18e00d..0000000000000 --- a/tests/testcpdf +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/tests/testcpdfclock b/tests/testcpdfclock deleted file mode 100644 index c885cc8e09dd7..0000000000000 --- a/tests/testcpdfclock +++ /dev/null @@ -1,87 +0,0 @@ - 0) { - cpdf_page_init($pdf, $pagecount+1, 0, 2 * ($radius + $margin), 2 * ($radius + $margin), 1.0); - - cpdf_set_page_animation($pdf, 4, 0.5, 0, 0, 0); /* wipe */ - - cpdf_translate($pdf, $radius + $margin, $radius + $margin); - cpdf_save($pdf); - cpdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); - - /* minute strokes */ - cpdf_setlinewidth($pdf, 2.0); - for ($alpha = 0; $alpha < 360; $alpha += 6) - { - cpdf_rotate($pdf, 6.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin/3, 0.0); - cpdf_stroke($pdf); - } - - cpdf_restore($pdf); - cpdf_save($pdf); - - /* 5 minute strokes */ - cpdf_setlinewidth($pdf, 3.0); - for ($alpha = 0; $alpha < 360; $alpha += 30) - { - cpdf_rotate($pdf, 30.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin, 0.0); - cpdf_stroke($pdf); - } - - $ltime = getdate(); - - /* draw hour hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['minutes']/60.0) + $ltime['hours'] - 3.0) * 30.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius/2, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw minute hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds']/60.0) + $ltime['minutes'] - 15.0) * 6.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius * 0.8, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw second hand */ - cpdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); - cpdf_setlinewidth($pdf, 2); - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); - cpdf_moveto($pdf, -$radius/5, 0.0); - cpdf_lineto($pdf, $radius, 0.0); - cpdf_stroke($pdf); - cpdf_restore($pdf); - - /* draw little circle at center */ - cpdf_circle($pdf, 0, 0, $radius/30); - cpdf_fill($pdf); - - cpdf_restore($pdf); - - cpdf_finalize_page($pdf, $pagecount+1); -} - -cpdf_finalize($pdf); -cpdf_save_to_file($pdf, $pdffilename); -$pdf = cpdf_close($pdf); -?> diff --git a/tests/testdom b/tests/testdom deleted file mode 100644 index c7012e0e3c1a0..0000000000000 --- a/tests/testdom +++ /dev/null @@ -1,73 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -echo "Test 1: accessing single nodes from php\n"; -$dom = xmldoc($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$children = $dom->childNodes(); -print_r($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement(); -print_r($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes(); -print_r($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild(); -print_r($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parent(); -print_r($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes(); -print_r($children); - -echo "--------- creating a new attribute\n"; -$attr = $dom->createAttribute("src", "picture.gif"); -print_r($attr); - -$rootnode->setAttributeNode($attr); /* Not implemented */ -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); - -echo "--------- attribute of rootnode\n"; -$attrs = $rootnode->attributes(); -print_r($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs[0]->childNodes(); -print_r($children); - -?> diff --git a/tests/testfe b/tests/testfe deleted file mode 100644 index ea627606353f0..0000000000000 --- a/tests/testfe +++ /dev/null @@ -1,18 +0,0 @@ -"ge:Hier der Titel", "Author"=>"Hier der Autor")); - echo $objrec."\n"; - $objrec .= "\nTitle=en:Here the title"; - echo "Add another title and convert it back to an object array\n"; - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_4 == "yes") { - echo "TEST 4 ----------------------------------------------\n"; - echo "Get the object array of document with id 0x".dechex($id)."\n"; - $objrec = hw_getobject($connect, $id); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_5 == "yes") { - echo "TEST 5 ----------------------------------------------\n"; - echo "List the children of collection 0x".dechex($collid)."\n"; - $children = hw_childrenobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_children = count($children) - 1; - for($i=0; $i<$c_children; $i++) { - $objarr = hw_objrec2array($children[$i]); - list_attr($objarr); - } - list_attr($children[$c_children]); - } - - if($test_6 == "yes") { - echo "TEST 6 ----------------------------------------------\n"; - echo "List the parents of object 0x".dechex($id)."\n"; - $parents = hw_getparentsobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_parents = count($parents) - 1; - for($i=0; $i<$c_parents; $i++) { - $objarr = hw_objrec2array($parents[$i]); - list_attr($objarr); - } - list_attr($parents[$c_parents]); - } - - if($test_7 == "yes") { - echo "TEST 7 ----------------------------------------------\n"; - echo "Inserting a new text document into 0x".dechex($collid)."\n"; - $objrec = "Type=Document\nDocumentType=text\nName=HWTest\nTitle=en:Component\nMimeType=text/plain\nAuthor=".$username; - $contents = "Ein bischen Text"; - $doc = hw_new_document($objrec, $contents, strlen($contents)+1); - $objid = hw_insertdocument($connect, $collid, $doc); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_8 == "yes") { - echo "TEST 8 ----------------------------------------------\n"; - echo "Removing text document just inserted\n"; - $kk[0] = (int) $objid; - hw_mv($connect, $kk, $collid, 0); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - echo "If the document was really deleted you should see an error now\n"; - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - } else { - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - } - - if($test_9 == "yes") { - echo "TEST 9 ----------------------------------------------\n"; - echo "Searching for objects with $query\n"; - $objrecs = hw_getobjectbyqueryobj($connect, $query, -1); - $c_objrecs = count($objrecs) - 1; - echo "$c_objrecs found\n"; - for($i=0; $i<$c_objrecs; $i++) { - $objarr = hw_objrec2array($objrecs[$i]); - list_attr($objarr); - } - list_attr($objrecs[$c_objrecs]); - } - - if($test_10 == "yes") { - $anchors = hw_getanchorsobj($connect, $id); - $countanchors = count($anchors) - 1; - echo "$countanchors Anchors of Object $id\n"; - for($i=0; $i<$countanchors; $i++) { - $arr = hw_objrec2array($anchors[$i]); - list_attr($arr); - } - } - - if($test_11 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_output_document($doc); - } - - if($test_12 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_insertanchors($doc, array("Position=0x2 0x7\nObjectID=0x3\nTAnchor=Src\nDest=0x5"), array("ObjectID=0x5\nName=DestDoc")); - hw_output_document($doc); - } - - hw_close($connect); -?> diff --git a/tests/testinclude b/tests/testinclude deleted file mode 100644 index 1e9854370d110..0000000000000 --- a/tests/testinclude +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/testobj b/tests/testobj deleted file mode 100644 index 66b003ce9c651..0000000000000 --- a/tests/testobj +++ /dev/null @@ -1,29 +0,0 @@ -initialized = 1; - } -}; - -class barbara extends foobar { - -}; - -$name = "foobar"; -$foo = new $name; // or die("Unable to construct foobar\n"); -//print $foo->initialized; - -$boo = new barbara; -print get_class($foo).endl; -print get_parent_class($foo).endl; -print get_class($boo).endl; -print get_parent_class($boo).endl; -print method_exists($foo,"foobar").endl; -print method_exists($boo,"foobar").endl; -print method_exists($boo,"barbara").endl; -//$word = new COm("word.application"); -//$word->visible = true; -//sleep(5); -//$word->quit(); diff --git a/tests/testpfpro.php b/tests/testpfpro.php deleted file mode 100644 index ffb1784bdca9e..0000000000000 --- a/tests/testpfpro.php +++ /dev/null @@ -1,39 +0,0 @@ -\n\n"; - -echo "Payflow Pro library is version ".pfpro_version()."\n"; - -pfpro_init(); - -$transaction = array(USER => 'mylogin', - PWD => 'mypassword', - TRXTYPE => 'S', - TENDER => 'C', - AMT => 1.50, - ACCT => '4111111111111111', - EXPDATE => '0900' - ); - -$response = pfpro_process($transaction); - -if (!$response) { - die("Couldn't establish link to signio software.\n"); -} - -echo "Signio response code was ".$response[RESULT]; -echo ", which means: ".$response[RESPMSG]."\n"; - -echo "\nDump of the transaction request "; -print_r($transaction); - -echo "\nDump of the response "; -print_r($response); - -pfpro_cleanup(); - -?> diff --git a/tests/tests.dsp b/tests/tests.dsp deleted file mode 100644 index fc19dcfe43125..0000000000000 --- a/tests/tests.dsp +++ /dev/null @@ -1,61 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tests" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=tests - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tests.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tests.mak" CFG="tests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tests - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Cmd_Line "NMAKE /f tests.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "tests.exe" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Cmd_Line "nmake /nologo /f tests.mak" -# PROP Rebuild_Opt "/a" -# PROP Target_File "__test_run_complete__" -# PROP Bsc_Name "" -# PROP Target_Dir "" -# Begin Target - -# Name "tests - Win32 Debug" - -!IF "$(CFG)" == "tests - Win32 Debug" - -!ENDIF - -# Begin Source File - -SOURCE="..\run-tests.php" -# End Source File -# Begin Source File - -SOURCE=.\tests.mak -# End Source File -# End Target -# End Project diff --git a/tests/tests.mak b/tests/tests.mak deleted file mode 100644 index 8b4714354405b..0000000000000 --- a/tests/tests.mak +++ /dev/null @@ -1,27 +0,0 @@ -# -# Win32 Makefile to run the PHP unit tests. -# -# TEST_PHP_EXECUTABLE -# Required - must point to the PHP executable to test. -# -# TEST_PHP_ERROR_STYLE -# Optional - specifies error format to output so IDE can jump to test source and log. -# Values: MSVC (Microsoft Visual C++), Emacs -# -# TEST_PHP_DETAILED -# Optional - generates a more complete and detailed log if set. -# Values: 0 or unset - no details; 1 - detailed. -# - -all : run-tests - -BIN=Debug_TS - -# Specific test(s) to run (all if not specified). -TESTS= - -run-tests : - set TEST_PHP_EXECUTABLE=$(BIN)\php-cgi.exe - set TEST_PHP_ERROR_STYLE=MSVC - set TEST_PHP_DETAILED=0 - cd .. && $(BIN)\php-cgi.exe -c tests -f run-tests.php $(TESTS) | tee tests.log diff --git a/tests/testscanf.php b/tests/testscanf.php deleted file mode 100644 index ad530978c5298..0000000000000 --- a/tests/testscanf.php +++ /dev/null @@ -1,113 +0,0 @@ -") { - if (is_array($val)) { - for ($i = 0;$i< count($val);$i++) { - echo $val[$i] . $postfix; - } - } else { - echo $val . $postfix; - } -} - -function do_sscanf($string, $format) { - $s = "sscanf(\"" . $string . ",\"" . $format ."\")."; - echo "$s
              "; - $s = str_repeat("-", strlen($s)); - echo "$s
              "; - $output = sscanf($string,$format); - echo "Result : "; - print_value( $output ); - echo "$s

              "; -} - - -function run_sscanf_test_cases($filename="scan_cases") -{ - - echo "


              Running Test Cases from $filename

              "; - $arr = file($filename); - for ($i=0;$i < count($arr);$i++) { - $line_arr = explode("|",$arr[$i]); - - $format = $line_arr[0]; - $string = $line_arr[1]; - if (count($arr) > 2) { - $comment = $line_arr[2]; - } else { - $comment = ""; - } - if ( empty($format) || empty($string) ) { - continue; - } - print("

              ** Case : $comment ******************************

              "); - do_sscanf($string,$format); - } -} - -function simple_tests() { - echo "Testing sscanf with standard ANSI syntax (values returned by -reference)-
              "; - $decimal = -1; - $string = ""; - $hex = 0; - $float = 0.0; - $octal = 0.0; - $int = -1; - - echo "


              Simple Test

              "; - echo "sscanf('10','%d',&\$decimal)
              "; - echo "
              BEFORE :
              decimal = $decimal."; - $foo = sscanf("10","%d",&$decimal); - echo "
              AFTER :
              decimal = $decimal
              "; - - - echo "


              Simple Test 2

              "; - echo "sscanf(\"ghost 0xface\",\"%s %x\",&\$string, &\$int)
              "; - echo "
              BEFORE :
              string = $string, int = $int
              "; - $foo = sscanf("ghost 0xface","%s %x",&$string, &$int); - echo "
              AFTER :
              string = $string, int = $int
              "; - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
              "; - - echo "


              Multiple specifiers

              "; - echo "sscanf(\"jabberwocky 1024 0xFF 1.024 644 10\", - \"%s %d %x %f %o %i\", - &\$string,&\$decimal,&\$hex,&\$float,&\$octal,&\$int);
              "; - echo "
              BEFORE :
              "; - echo "Decimal = $decimal, String = $string, Hex = $hex
              "; - echo "Octal = $octal , Float = $float, Int = $int
              "; - $foo = sscanf( "jabberwocky 1024 0xFF 1.024 644 10", - "%s %d %x %f %o %i", - &$string,&$decimal,&$hex,&$float,&$octal,&$int); - echo "
              AFTER :
              "; - echo "decimal = $decimal, string = $string, hex = $hex
              "; - echo "octal = $octal , float = $float, int = $int
              "; - - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
              "; - echo "----------------------------------------
              "; -} - - - -?> - - - Test of sscanf() - - -

              Testing sscanf() support in PHP


              - I'm sorry but sscanf() does not exist !i
              "; - } else { - simple_tests(); - run_sscanf_test_cases(); - } - ?> - - diff --git a/tests/testswf b/tests/testswf deleted file mode 100644 index e26733237d8b4..0000000000000 --- a/tests/testswf +++ /dev/null @@ -1,120 +0,0 @@ - diff --git a/tests/unicode/autodetect-SCSU.inc b/tests/unicode/autodetect-SCSU.inc deleted file mode 100644 index d905c6c497aab..0000000000000 --- a/tests/unicode/autodetect-SCSU.inc +++ /dev/null @@ -1,7 +0,0 @@ -ŝ˙ diff --git a/tests/unicode/autodetect-SCSU.phpt b/tests/unicode/autodetect-SCSU.phpt deleted file mode 100755 index a3e3f45c0a765..0000000000000 --- a/tests/unicode/autodetect-SCSU.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (SCSU) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF16BE.inc b/tests/unicode/autodetect-UTF16BE.inc deleted file mode 100644 index 5e808dd60b8d8..0000000000000 Binary files a/tests/unicode/autodetect-UTF16BE.inc and /dev/null differ diff --git a/tests/unicode/autodetect-UTF16BE.phpt b/tests/unicode/autodetect-UTF16BE.phpt deleted file mode 100755 index 439276961db14..0000000000000 --- a/tests/unicode/autodetect-UTF16BE.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF-16BE) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF16LE.inc b/tests/unicode/autodetect-UTF16LE.inc deleted file mode 100644 index 666a4856eaf71..0000000000000 Binary files a/tests/unicode/autodetect-UTF16LE.inc and /dev/null differ diff --git a/tests/unicode/autodetect-UTF16LE.phpt b/tests/unicode/autodetect-UTF16LE.phpt deleted file mode 100755 index 4daaf7cad7335..0000000000000 --- a/tests/unicode/autodetect-UTF16LE.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF-16LE) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF32BE.inc b/tests/unicode/autodetect-UTF32BE.inc deleted file mode 100755 index 1f26885771c93..0000000000000 Binary files a/tests/unicode/autodetect-UTF32BE.inc and /dev/null differ diff --git a/tests/unicode/autodetect-UTF32BE.phpt b/tests/unicode/autodetect-UTF32BE.phpt deleted file mode 100755 index 39e62b5445a09..0000000000000 --- a/tests/unicode/autodetect-UTF32BE.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF-32BE) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF32LE.inc b/tests/unicode/autodetect-UTF32LE.inc deleted file mode 100755 index 5bf6a1d286292..0000000000000 Binary files a/tests/unicode/autodetect-UTF32LE.inc and /dev/null differ diff --git a/tests/unicode/autodetect-UTF32LE.phpt b/tests/unicode/autodetect-UTF32LE.phpt deleted file mode 100755 index b966b04b2a1ab..0000000000000 --- a/tests/unicode/autodetect-UTF32LE.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF-32LE) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF7.inc b/tests/unicode/autodetect-UTF7.inc deleted file mode 100644 index dc2bda486c815..0000000000000 --- a/tests/unicode/autodetect-UTF7.inc +++ /dev/null @@ -1,7 +0,0 @@ -+/v8 diff --git a/tests/unicode/autodetect-UTF7.phpt b/tests/unicode/autodetect-UTF7.phpt deleted file mode 100755 index 89f8e6d30535e..0000000000000 --- a/tests/unicode/autodetect-UTF7.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF7) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/autodetect-UTF8.inc b/tests/unicode/autodetect-UTF8.inc deleted file mode 100755 index e6af829d4c8bc..0000000000000 --- a/tests/unicode/autodetect-UTF8.inc +++ /dev/null @@ -1,7 +0,0 @@ -ïğż diff --git a/tests/unicode/autodetect-UTF8.phpt b/tests/unicode/autodetect-UTF8.phpt deleted file mode 100755 index 570f398b2b863..0000000000000 --- a/tests/unicode/autodetect-UTF8.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Script encoding autodetection (UTF8) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/enc-HZ.inc b/tests/unicode/enc-HZ.inc deleted file mode 100644 index ac38662dded99..0000000000000 --- a/tests/unicode/enc-HZ.inc +++ /dev/null @@ -1,7 +0,0 @@ -~} diff --git a/tests/unicode/enc-HZ.phpt b/tests/unicode/enc-HZ.phpt deleted file mode 100755 index 9b327a1ee8a6d..0000000000000 --- a/tests/unicode/enc-HZ.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Script encoding (HZ) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/enc-ISO-2022-KR.inc b/tests/unicode/enc-ISO-2022-KR.inc deleted file mode 100644 index fca3ab842c98f..0000000000000 --- a/tests/unicode/enc-ISO-2022-KR.inc +++ /dev/null @@ -1,7 +0,0 @@ -$)C diff --git a/tests/unicode/enc-ISO-2022-KR.phpt b/tests/unicode/enc-ISO-2022-KR.phpt deleted file mode 100755 index 94033f624ef5a..0000000000000 --- a/tests/unicode/enc-ISO-2022-KR.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Script encoding (ISO-2022-KR) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/enc-JIS.inc b/tests/unicode/enc-JIS.inc deleted file mode 100644 index 00d3ae690bf80..0000000000000 --- a/tests/unicode/enc-JIS.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/tests/unicode/enc-JIS.phpt b/tests/unicode/enc-JIS.phpt deleted file mode 100755 index 4bab19841a309..0000000000000 --- a/tests/unicode/enc-JIS.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Script encoding (JIS) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/enc-SJIS.inc b/tests/unicode/enc-SJIS.inc deleted file mode 100644 index 12e799306a826..0000000000000 --- a/tests/unicode/enc-SJIS.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/tests/unicode/enc-SJIS.phpt b/tests/unicode/enc-SJIS.phpt deleted file mode 100755 index bd190ee86a7c2..0000000000000 --- a/tests/unicode/enc-SJIS.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Script encoding (SJIS) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/encrt-HZ.phpt b/tests/unicode/encrt-HZ.phpt deleted file mode 100755 index c0f3812361e94..0000000000000 --- a/tests/unicode/encrt-HZ.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -declare script encoding (HZ) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/encrt-ISO-2022-KR.phpt b/tests/unicode/encrt-ISO-2022-KR.phpt deleted file mode 100755 index ebca20231ae38..0000000000000 --- a/tests/unicode/encrt-ISO-2022-KR.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -declare script encoding (ISO-2022-KR) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/encrt-JIS.phpt b/tests/unicode/encrt-JIS.phpt deleted file mode 100755 index 082c1caf1858a..0000000000000 --- a/tests/unicode/encrt-JIS.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -declare script encoding (JIS) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/encrt-SJIS.phpt b/tests/unicode/encrt-SJIS.phpt deleted file mode 100755 index 918ddc910ed3b..0000000000000 --- a/tests/unicode/encrt-SJIS.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -declare script encoding (SJIS) ---INI-- -unicode_semantics=on -unicode.output_encoding=CP866 ---FILE-- - ---EXPECT-- -âáâ - ok diff --git a/tests/unicode/func/strpos.phpt b/tests/unicode/func/strpos.phpt deleted file mode 100644 index 785ae73d7695d..0000000000000 --- a/tests/unicode/func/strpos.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Unicode: strpos() function test ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -int(0) -bool(false) -int(4) -int(1) -int(2) -int(3) -int(1) -int(3) -bool(false) -int(1) -int(1) -int(2) -int(4) -int(6) diff --git a/tests/unicode/func/strstr.phpt b/tests/unicode/func/strstr.phpt deleted file mode 100644 index 38d8eb5e91dd8..0000000000000 --- a/tests/unicode/func/strstr.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Unicode: strpos() function test ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -unicode(5) "a™ᄒ €Ħz" -bool(false) -unicode(1) "z" -unicode(4) "™ᄒ €Ħz" -bool(false) -unicode(3) "ᄒ €Ħz" -unicode(2) " €Ħz" -unicode(2) " €Ħz" -unicode(3) "z €Ħz" -unicode(6) "Å-…-â„Ğ" -unicode(5) "̊-…-â„Ğ" -unicode(3) "…-â„Ğ" -unicode(1) "â„Ğ" diff --git a/tests/unicode/normalize_001.phpt b/tests/unicode/normalize_001.phpt deleted file mode 100755 index 46b456fc4e1ca..0000000000000 --- a/tests/unicode/normalize_001.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Unicode identifiers normalization (${}) ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -ok diff --git a/tests/unicode/normalize_002.phpt b/tests/unicode/normalize_002.phpt deleted file mode 100755 index ade41ec5feaec..0000000000000 --- a/tests/unicode/normalize_002.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Unicode identifiers normalization ($$) ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -ok diff --git a/tests/unicode/normalize_003.phpt b/tests/unicode/normalize_003.phpt deleted file mode 100755 index 21085acc24f2a..0000000000000 --- a/tests/unicode/normalize_003.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Unicode identifiers normalization (indirect function call) ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -ok -ok diff --git a/tests/unicode/normalize_004.phpt b/tests/unicode/normalize_004.phpt deleted file mode 100755 index 37f65ee94026b..0000000000000 --- a/tests/unicode/normalize_004.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Unicode identifiers normalization ($GLOBALS[]) ---INI-- -unicode_semantics=on ---FILE-- - ---EXPECT-- -ok diff --git a/unicode-issues.txt b/unicode-issues.txt deleted file mode 100644 index acc660d74d24a..0000000000000 --- a/unicode-issues.txt +++ /dev/null @@ -1,6 +0,0 @@ - -Doing a for loop to iterate over a string character-by-character may be -slow, since accessing a character at offset n requires us to scan the string -from the beginning until the required codepoint is accessed. - -strlen() will return the number of codepoints which have to be calculated. diff --git a/unicode-progress.txt b/unicode-progress.txt deleted file mode 100644 index 26e89bff33aa3..0000000000000 --- a/unicode-progress.txt +++ /dev/null @@ -1,90 +0,0 @@ -Extension Upgrade Tracking -========================== - -ext/standard ------------- - Status: In Progress - - Completed: - addslashes() - bin2hex() - chr() - explode() - implode() - levenshtein() - ord() - range() - similar_text() - str_pad() - str_repeat() - strip_tags() - strcspn() - stripslashes() - strpbrk() - strpos() - strrchr() - strrev() - strrpos() - strspn() - strstr() - strtok() - substr() - substr_count() - substr_replace() - trim() - ucfirst() - ucwords() - - -Zend Engine ------------ - Status: In Progress - - TBD: - debug_backtrace() - Completed: - class_exists() - create_function() - debug_print_backtrace() - define() - defined() - each() - error_reporting() - extension_loaded() - func_get_arg() - func_get_args() - func_num_args() - function_exists() - get_class() - get_class_methods() - get_class_vars() - get_declared_classes() - get_declared_interfaces() - get_defined_constants() - get_defined_functions() - get_defined_vars() - get_extension_funcs() - get_included_files() - get_loaded_extensions() - get_object_vars() - get_parent_class() - get_resource_type() - interface_exists() - is_a() - is_subclass_of() - method_exists() - property_exists() - restore_error_handler() - restore_exception_handler() - set_error_handler() - set_exception_handler() - strcasecmp() - strcmp() - strlen() - strncasecmp() - strncmp() - trigger_error() - zend_thread_id() - zend_version() - -vim: set et ts=4 sts: diff --git a/unicode-todo.txt b/unicode-todo.txt deleted file mode 100644 index cd2d133a2312d..0000000000000 --- a/unicode-todo.txt +++ /dev/null @@ -1,59 +0,0 @@ -* unicode in `..`? - -* EBCDIC support? - -* Discuss putting ZEND_ATTRIBUTE_FORMAT back on zend_error() or create a new - zend_error_ex() function that supports new specifiers - -* Finalize zend_hash_get_current_key_ex() discussion. We probably need to - have zend_u_hash_get_current_key_ex() and have the old function proxy to it. - The question is what happens when an IS_UNICODE key is present and the old - function is called. - -* use zend_literal_to_unicode when comparing "this" and such - -* fix string offset operator to work only on strings, and array offset one - to work only on arrays - -* Should we apply identifier validity checks in functions that deal with - identifiers, such as define(), get_class(), etc? - -* Resolve the differences in %G output format. sprintf() removes trailing - zeroes from the fractional part, and u_sprintf() doesn't. - -* Determine how to deal with filesystem and filenames when Unicode is - involved. This concerns both the extension functions and things like - compile_file(), open_file_for_scanning(), etc. - -* Use U_STRING_DECL/U_STRING/INIT for initializing literals possibly. - -* Measure performance difference when doing quickCheck + normalize versus - simple normalize. - -* Find all instances where unicode strings are compare with memcmp() and - replace either with u_memcmpCodePointOrder() or ucol_strcoll() - -* Opening a collator may return U_USING_DEFAULT_WARNING, - U_USING_FALLBACK_WARNING - -* Need to make http input work as described in the design doc. - -* Solve ZTS issues. Some extensions store pointers to internal - zend_class_entries during extension startup, but these pointers can be changed - from request to request (dependent on "unicode" setting). Right now these - pointers are reinitialized during request startup but they are still stored - in real global variables. Probably the problem should be solved in other way - or pinters to zend_class_entries should be stored in module globals. - -* output.c needs a lot of work as it passes char* around - -* Should strtoupper()/strtolower() use full or simple case mapping? - -* Replace all instances of EMPTY_STR with U_EMPTY_STR which is defined to be - ((UChar*)"\0\0") - -* Change implementation of strtoupper()/strtolower() to use simple case - mapping. - -* Optimize T_INLINE_HTML blocks conversion by either creating a converter - cache or remembering the last used converter in the executor globals. diff --git a/win32/EngineSelect.bat b/win32/EngineSelect.bat deleted file mode 100755 index 0785bd12fcc95..0000000000000 --- a/win32/EngineSelect.bat +++ /dev/null @@ -1,5 +0,0 @@ -@if exist ..\ZendEngine2\OBJECTS2_HOWTO ( -move ..\Zend ..\ZendEngine1 -move ..\ZendEngine2 ..\Zend -echo "PLEASE RESTART VISUAL C++ TO RELOAD THE ZEND PROJECT." -exit 1 ) diff --git a/win32/EngineSelect.dsp b/win32/EngineSelect.dsp deleted file mode 100644 index 4aee213c29278..0000000000000 --- a/win32/EngineSelect.dsp +++ /dev/null @@ -1,85 +0,0 @@ -# Microsoft Developer Studio Project File - Name="EngineSelect" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=EngineSelect - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "EngineSelect.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "EngineSelect.mak" CFG="EngineSelect - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "EngineSelect - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "EngineSelect - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "EngineSelect - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "EngineSelect.exe" -# PROP BASE Bsc_Name "EngineSelect.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "EngineSelect.bat" -# PROP Rebuild_Opt "/a" -# PROP Target_File "EngineSelect.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "EngineSelect.exe" -# PROP BASE Bsc_Name "EngineSelect.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "EngineSelect.bat" -# PROP Rebuild_Opt "/a" -# PROP Target_File "EngineSelect.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "EngineSelect - Win32 Release" -# Name "EngineSelect - Win32 Debug" - -!IF "$(CFG)" == "EngineSelect - Win32 Release" - -!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug" - -!ENDIF - -# End Target -# End Project diff --git a/win32/build/Makefile b/win32/build/Makefile deleted file mode 100644 index 9b8c2d264cc6e..0000000000000 --- a/win32/build/Makefile +++ /dev/null @@ -1,140 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2005 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: Wez Furlong | -# +----------------------------------------------------------------------+ -# -# $Id$ -# This is the makefile template for the win32 build - -CC="$(CL)" -LD="$(LINK)" -MC="$(MC)" - -MCFILE=$(BUILD_DIR)\wsyslog.rc - -all: generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS) - -build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB) - -generated_files: build_dirs Zend\zend_ini_parser.c \ - Zend\zend_language_parser.c Zend\zend_ini_scanner.c \ - Zend\zend_language_scanner.c \ - $(PHPDEF) $(MCFILE) - -$(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES) - type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def - -Zend\zend_ini_parser.c Zend\zend_ini_parser.h: Zend\zend_ini_parser.y - $(BISON) --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y - -Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y - $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y - -Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l - $(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l - -Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l - $(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c Zend/zend_language_scanner.l - -PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res - -$(MCFILE): win32\build\wsyslog.mc - $(MC) -h win32\ -r $(BUILD_DIR)\ -x $(BUILD_DIR)\ win32\build\wsyslog.mc - -# $(RC) /fo $(MCFILE) $(BUILD_DIR)\wsyslog.rc - -$(PHPDLL_RES): win32\build\template.rc - $(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \ - /d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \ - /I$(BUILD_DIR) /d MC_INCLUDE="\"$(MCFILE)\"" \ - win32\build\template.rc - -$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE) - @$(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) - -$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) - -$(BUILD_DIR) $(BUILD_DIRS_SUB): - @echo Recreating build dirs - @if not exist $(BUILD_DIR) mkdir $(BUILD_DIR) - @for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL - -clean-sapi: - @echo Cleaning SAPI - @for %D in (_x $(EXT_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in (_x $(PECL_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in (_x $(SAPI_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - -@del /F /Q $(BUILD_DIR)\$(PHPDLL) - -clean: clean-sapi - @echo Cleaning build dirs - @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL - -@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL - -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) - -clean-pecl: - @echo Cleaning PECL targets only - -rmdir /s /q $(BUILD_DIR)\pecl - -test: - <nul - @copy $(BUILD_DIR)\*.dll $(PHP_PREFIX) /y >nul - @echo Registering event source with syslog (requires admin rights) - @echo It's okay for this step to fail: - -$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL) - - diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js deleted file mode 100644 index 14d9085637c3a..0000000000000 --- a/win32/build/buildconf.js +++ /dev/null @@ -1,263 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id: buildconf.js,v 1.14 2005-09-17 22:07:20 edink Exp $ */ -// This generates a configure script for win32 build - -WScript.StdOut.WriteLine("Rebuilding configure.js"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var C = FSO.CreateTextFile("configure.js", true); - -var modules = ""; -var MODULES = WScript.CreateObject("Scripting.Dictionary"); -var module_dirs = new Array(); - -function file_get_contents(filename) -{ - var F = FSO.OpenTextFile(filename, 1); - var t = F.ReadAll(); - F.Close(); - return t; -} - -function Module_Item(module_name, config_path, dir_line, deps, content) -{ - this.module_name = module_name; - this.config_path = config_path; - this.dir_line = dir_line; - this.deps = deps; - this.content = content; -} - -function find_config_w32(dirname) -{ - if (!FSO.FolderExists(dirname)) { - return; - } - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - var c, i, ok, n; - var item = null; - var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\);", "gm"); - - for (; !fc.atEnd(); fc.moveNext()) - { - ok = true; - /* check if we already picked up a module with the same dirname; - * if we have, don't include it here */ - n = FSO.GetFileName(fc.item()); - - if (n == 'CVS' || n == 'tests') - continue; - - // WScript.StdOut.WriteLine("checking " + dirname + "/" + n); - if (MODULES.Exists(n)) { - WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name"); - continue; - } - - - c = FSO.BuildPath(fc.item(), "config.w32"); - if (FSO.FileExists(c)) { -// WScript.StdOut.WriteLine(c); - - var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('" - + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n"; - var contents = file_get_contents(c); - var deps = new Array(); - - // parse out any deps from the file - var calls = contents.match(re_dep_line); - if (calls != null) { - for (i = 0; i < calls.length; i++) { - // now we need the extension name out of this thing - if (calls[i].match(re_dep_line)) { -// WScript.StdOut.WriteLine("n depends on " + RegExp.$1); - deps[deps.length] = RegExp.$1; - } - } - } - - item = new Module_Item(n, c, dir_line, deps, contents); - MODULES.Add(n, item); - } - } -} - -// Emit core modules array. This is used by a snapshot -// build to override a default "yes" value so that external -// modules don't break the build by becoming statically compiled -function emit_core_module_list() -{ - var module_names = (new VBArray(MODULES.Keys())).toArray(); - var i, mod_name, j; - var item; - var output = ""; - - C.WriteLine("core_module_list = new Array("); - - // first, look for modules with empty deps; emit those first - for (i in module_names) { - mod_name = module_names[i]; - C.WriteLine("\"" + mod_name.replace(/_/g, "-") + "\","); - } - - C.WriteLine("false // dummy"); - - C.WriteLine(");"); -} - - -function emit_module(item) -{ - return item.dir_line + item.content; -} - -function emit_dep_modules(module_names) -{ - var i, mod_name, j; - var output = ""; - var item = null; - - for (i in module_names) { - mod_name = module_names[i]; - - if (MODULES.Exists(mod_name)) { - item = MODULES.Item(mod_name); - MODULES.Remove(mod_name); - if (item.deps.length) { - output += emit_dep_modules(item.deps); - } - output += emit_module(item); - } - } - - return output; -} - -function gen_modules() -{ - var module_names = (new VBArray(MODULES.Keys())).toArray(); - var i, mod_name, j; - var item; - var output = ""; - - // first, look for modules with empty deps; emit those first - for (i in module_names) { - mod_name = module_names[i]; - item = MODULES.Item(mod_name); - if (item.deps.length == 0) { - MODULES.Remove(mod_name); - output += emit_module(item); - } - } - - // now we are left with modules that have dependencies on other modules - module_names = (new VBArray(MODULES.Keys())).toArray(); - output += emit_dep_modules(module_names); - - return output; -} - -if (FSO.FileExists("ZendEngine2\\OBJECTS2_HOWTO")) { - if (FSO.FolderExists("Zend")) { - FSO.MoveFolder("Zend", "ZendEngine1"); - } - FSO.MoveFolder("ZendEngine2", "Zend"); -} - -// Process buildconf arguments -function buildconf_process_args() -{ - args = WScript.Arguments; - - for (i = 0; i < args.length; i++) { - arg = args(i); - // If it is --foo=bar, split on the equals sign - arg = arg.split("=", 2); - argname = arg[0]; - if (arg.length > 1) { - argval = arg[1]; - } else { - argval = null; - } - - if (argname == '--add-modules-dir' && argval != null) { - WScript.StdOut.WriteLine("Adding " + argval + " to the module search path"); - module_dirs[module_dirs.length] = argval; - } - } -} - -buildconf_process_args(); - -// Write the head of the configure script -C.WriteLine("/* This file automatically generated from win32/build/confutils.js */"); -C.Write(file_get_contents("win32/build/confutils.js")); - -// Pull in code from sapi and extensions -modules = file_get_contents("win32/build/config.w32"); - -// Pick up confs from TSRM and Zend if present -find_config_w32("."); -find_config_w32("sapi"); -find_config_w32("ext"); -emit_core_module_list(); - -// If we have not specified any module dirs let's add some defaults -if (module_dirs.length == 0) { - find_config_w32("pecl"); - find_config_w32("..\\pecl"); - find_config_w32("pecl\\rpc"); - find_config_w32("..\\pecl\\rpc"); -} else { - for (i = 0; i < module_dirs.length; i++) { - find_config_w32(module_dirs[i]); - } -} - -// Now generate contents of module based on MODULES, chasing dependencies -// to ensure that dependent modules are emitted first -modules += gen_modules(); - -// Look for ARG_ENABLE or ARG_WITH calls -re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm"); -calls = modules.match(re); -for (i = 0; i < calls.length; i++) { - item = calls[i]; - C.WriteLine("try {"); - C.WriteLine(item); - C.WriteLine("} catch (e) {"); - C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);'); - C.WriteLine("}"); -} - -C.WriteBlankLines(1); -C.WriteLine("conf_process_args();"); -C.WriteBlankLines(1); - -// Comment out the calls from their original positions -modules = modules.replace(re, "/* $1 */"); -C.Write(modules); - -C.WriteBlankLines(1); -C.Write(file_get_contents("win32/build/configure.tail")); - -WScript.StdOut.WriteLine("Now run 'cscript /nologo configure.js --help'"); - diff --git a/win32/build/config.w32 b/win32/build/config.w32 deleted file mode 100644 index 717fec65283ba..0000000000000 --- a/win32/build/config.w32 +++ /dev/null @@ -1,320 +0,0 @@ -// vim:ft=javascript -// $Id$ -// "Master" config file; think of it as a configure.in -// equivalent. - -ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); -CL = PATH_PROG('cl'); -if (!CL) { - ERROR("MS C++ compiler is required"); -} -// Which version of the compiler do we have ? -function probe_msvc_compiler_version(CL) -{ - // tricky escapes to get stderr redirection to work - var banner = execute('cmd /c ""' + CL + '" 2>&1"'); - if (banner.match(/(\d+)\.(\d+)\.(\d+)(\.(\d+))?/)) { - return RegExp.$1; - } - return 0; -} - -VCVERS = probe_msvc_compiler_version(CL); -STDOUT.WriteLine("Detected MS compiler version " + VCVERS); - -// 12 is VC6 -// 13 is vs.net 2003 -// 14 is vs.net 2005 - -// cygwin now ships with link.exe. Avoid searching the cygwin path -// for this, as we want the MS linker, not the fileutil -PATH_PROG('link', WshShell.Environment("Process").Item("PATH")); - -PATH_PROG('nmake'); - -// we don't want to define LIB, as that will override the default library path -// that is set in that env var -PATH_PROG('lib', null, 'MAKE_LIB'); -if (!PATH_PROG('bison')) { - ERROR('bison is required') -} -if (!PATH_PROG('flex')) { - ERROR('flex is required') -} -PATH_PROG('re2c'); -PATH_PROG('zip'); -PATH_PROG('lemon'); - -// avoid picking up midnight commander from cygwin -PATH_PROG('mc', WshShell.Environment("Process").Item("PATH")); - -// stick objects somewhere outside of the source tree -ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); -if (PHP_OBJECT_OUT_DIR.length) { - if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { - ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); - } - PHP_OBJECT_OUT_DIR += '\\'; -} - -ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); -ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); -if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") { - ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); -} -ARG_ENABLE('zts', 'Thread safety', 'yes'); -// Configures the hard-coded installation dir -ARG_ENABLE('prefix', 'where PHP will be installed', ''); -if (PHP_PREFIX == '') { - PHP_PREFIX = "C:\\php" + PHP_VERSION; - if (PHP_DEBUG == "yes") - PHP_PREFIX += "\\debug"; -} -DEFINE('PHP_PREFIX', PHP_PREFIX); - -DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM /I ext "); - -// CFLAGS for building the PHP dll -DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \ -/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x400"); - -DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)'); - -// General CFLAGS for building objects -DEFINE("CFLAGS", "/nologo /FD $(BASE_INCLUDES) /D _WINDOWS \ -/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS"); - -if (VCVERS < 14) { - // Enable automatic precompiled headers - ADD_FLAG('CFLAGS', ' /YX '); -} - -if (VCVERS >= 14) { - // fun stuff: MS deprecated ANSI stdio and similar functions - // disable annoying warnings - ADD_FLAG('CFLAGS', ' /wd4996 '); -} - -// General link flags -DEFINE("LDFLAGS", "/nologo /version:" + - PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION); - -// General DLL link flags -DEFINE("DLL_LDFLAGS", "/dll "); - -// PHP DLL link flags -DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)"); - -// General libs -// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib -DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib"); - - -// Set some debug/release specific options -if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /GZ /D _DEBUG /D ZEND_DEBUG=1"); - ADD_FLAG("LDFLAGS", "/debug"); - // Avoid problems when linking to release libraries that use the release - // version of the libc - ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt"); -} else { - // Generate external debug files when --enable-debug-pack is specified - if (PHP_DEBUG_PACK == "yes") { - ADD_FLAG("CFLAGS", "/Zi"); - ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf"); - } - // Equivalent to Release_TSInline build -> best optimization - ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG \ -/D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0"); - // if you have VS.Net /GS hardens the binary against buffer overruns - // ADD_FLAG("CFLAGS", "/GS"); -} - -if (PHP_ZTS == "yes") { - ADD_FLAG("CFLAGS", "/D ZTS=1"); -} - -// we want msvcrt in the PHP DLL -ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt"); - -// set up the build dir and DLL name -if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS"); - DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll"); - DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib"); -} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug"); - DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll"); - DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS"); - DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll"); - DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release"); - DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll"); - DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib"); -} - -// Find the php_build dir - it contains headers and libraries -// that we need -ARG_WITH('php-build', 'Path to where you extracted http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source dir (..\\php_build) if not specified', 'no'); - -if (PHP_PHP_BUILD == 'no') { - if (FSO.FolderExists("..\\php_build")) { - PHP_PHP_BUILD = "..\\php_build"; - } else if (FSO.FolderExists("..\\win32build")) { - PHP_PHP_BUILD = "..\\win32build"; - } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; - } -} - -ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); -ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); - -var php_usual_include_suspects = "..\\php_build\\include;..\\win32build\\include;..\\bindlib_w32"; -var php_usual_lib_suspects = "..\\php_build\\lib;..\\win32build\\lib;..\\bindlib_w32"; - -// Poke around for some headers -function probe_basic_headers() -{ - var p; - - if (PHP_PHP_BUILD != "no") { - php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include"; - php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib"; - } - - p = CHECK_HEADER_ADD_INCLUDE("arpa\\nameser.h", "CFLAGS", php_usual_include_suspects); - - // hack to catch common location of libs - if (typeof(p) == "string") { - p = p.replace(new RegExp("include$"), "lib"); - ADD_FLAG("LDFLAGS", '/libpath:"' + p + '" '); - php_usual_lib_suspects += ";" + p; - } else if (!p) { - ERROR("We really need that arpa\\nameser.h file - it is part of the win32build package"); - } -} - -function add_extra_dirs() -{ - var path, i, f; - - if (PHP_EXTRA_INCLUDES.length) { - path = PHP_EXTRA_INCLUDES.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - ADD_FLAG("CFLAGS", '/I "' + f + '" '); - } - } - } - if (PHP_EXTRA_LIBS.length) { - path = PHP_EXTRA_LIBS.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" '); - } - } - } - -} - -probe_basic_headers(); -add_extra_dirs(); - -// We can't probe for libs before this line - -CHECK_LIB("resolv.lib"); - -// Do we want static ICU lib -ARG_WITH('static-icu', 'Link against the static version of the ICU library', 'no'); -if (PHP_STATIC_ICU == "yes") { - if (!CHECK_LIB('sicuuc.lib', null, PHP_STATIC_ICU)) { - ERROR('static ICU library not found'); - } - ADD_FLAG("LIBS", "sicuuc.lib sicuin.lib sicuio.lib sicule.lib siculx.lib sicudt.lib"); - ADD_FLAG("CFLAGS", "/D U_STATIC_IMPLEMENTATION=1") -} else { - if (!CHECK_LIB('icuuc.lib', null)) { - ERROR('ICU library not found'); - } - ADD_FLAG("LIBS", "icuuc.lib icuin.lib icuio.lib icule.lib iculx.lib"); -} - -//DEFINE("PHP_BUILD", PHP_PHP_BUILD); - -STDOUT.WriteBlankLines(1); -STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR')); -STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB')); - -ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ - zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \ - zend_constants.c zend_dynamic_array.c zend_exceptions.c \ - zend_execute_API.c zend_highlight.c \ - zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ - zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \ - zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \ - zend_sprintf.c zend_ini.c zend_qsort.c zend_ts_hash.c \ - zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ - zend_object_handlers.c zend_objects_API.c zend_unicode.c zend_strtol.c \ - zend_mm.c zend_default_classes.c zend_reflection_api.c zend_execute.c zend_strtod.c"); - -ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c fopen_wrappers.c \ - php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ - strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \ - php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c"); - -ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \ - userspace.c transports.c xp_socket.c mmap.c"); - -ADD_SOURCES("win32", "crypt_win32.c flock.c glob.c md5crypt.c pwd.c readdir.c \ - registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c"); - -ADD_SOURCES("regex", "regcomp.c regerror.c regexec.c regfree.c"); - -STDOUT.WriteBlankLines(1); - -/* Can we build with IPv6 support? */ -ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes"); - -var main_network_has_ipv6 = 0; -if (PHP_IPV6 == "yes") { - main_network_has_ipv6 = CHECK_HEADER_ADD_INCLUDE("wspiapi.h", "CFLAGS") ? 1 : 0; -} -if (main_network_has_ipv6) { - STDOUT.WriteLine("Enabling IPv6 support"); -} -AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6); -AC_DEFINE('HAVE_GAI_STRERROR', main_network_has_ipv6); -AC_DEFINE('HAVE_IPV6', main_network_has_ipv6); - -/* this allows up to 256 sockets to be select()ed in a single - * call to select(), instead of the usual 64 */ -ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256"); -ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE)); - -ARG_ENABLE("memory-limit", "Enable memory limit checking code", "no"); -AC_DEFINE('MEMORY_LIMIT', PHP_MEMORY_LIMIT == "yes" ? 1 : 0); - -ARG_ENABLE("memory-manager", "Enable Zend memory manager", "yes"); -AC_DEFINE('USE_ZEND_ALLOC', PHP_MEMORY_MANAGER == "yes" ? 1 : 0); - -AC_DEFINE('HAVE_USLEEP', 1); -AC_DEFINE('HAVE_STRCOLL', 1); - -/* For snapshot builders, where can we find the additional - * files that make up the snapshot template? */ -ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no"); - -if (PHP_SNAPSHOT_TEMPLATE == "no") { - /* default is as a sibling of the php_build dir */ - if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { - PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template"); - } -} - -DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in deleted file mode 100644 index b6994c6113c74..0000000000000 --- a/win32/build/config.w32.h.in +++ /dev/null @@ -1,144 +0,0 @@ -/* - Build Configuration Template for Win32. - $Id$ -*/ - -/* Default PHP / PEAR directories */ -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" -#define CONFIGURATION_FILE_PATH "php.ini" -#define PEAR_INSTALLDIR "@PREFIX@\\pear" -#define PHP_BINDIR "@PREFIX@" -#define PHP_DATADIR "@PREFIX@" -#define PHP_EXTENSION_DIR "@PREFIX@" -#define PHP_INCLUDE_PATH ".;@PREFIX@\\pear" -#define PHP_LIBDIR "@PREFIX@" -#define PHP_LOCALSTATEDIR "@PREFIX@" -#define PHP_PREFIX "@PREFIX@" -#define PHP_SYSCONFDIR "@PREFIX@" - -/* Enable / Disable crypt() function (default: enabled) */ -#define HAVE_CRYPT 1 -#define PHP_STD_DES_CRYPT 1 -#define PHP_EXT_DES_CRYPT 0 -#define PHP_MD5_CRYPT 1 -#define PHP_BLOWFISH_CRYPT 0 - -/* PHP Runtime Configuration */ -#define PHP_URL_FOPEN 1 -#define PHP_SAFE_MODE 0 -#define MAGIC_QUOTES 0 -#define USE_CONFIG_FILE 1 -#define DEFAULT_SHORT_OPEN_TAG "1" - -/* Platform-Specific Configuration. Should not be changed. */ -#define PHP_SIGCHILD 0 -#define HAVE_LIBBIND 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETSERVBYPORT 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETPROTOBYNUMBER 1 -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#define HAVE_ERRMSG_H 0 -#undef HAVE_ADABAS -#undef HAVE_SOLID -#undef HAVE_LINK -#undef HAVE_SYMLINK - -/* its in win32/time.c */ -#define HAVE_USLEEP 1 - -#define HAVE_GETCWD 1 -#define HAVE_POSIX_READDIR_R 1 -#define NEED_ISBLANK 1 -#define DISCARD_PATH 0 -#undef HAVE_SETITIMER -#undef HAVE_IODBC -#define HAVE_LIBDL 1 -#define HAVE_SENDMAIL 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_PUTENV 1 -#define HAVE_LIMITS_H 1 -#define HAVE_TZSET 1 -#define HAVE_TZNAME 1 -#undef HAVE_FLOCK -#define HAVE_ALLOCA 1 -#undef HAVE_SYS_TIME_H -#define HAVE_SIGNAL_H 1 -#undef HAVE_ST_BLKSIZE -#undef HAVE_ST_BLOCKS -#define HAVE_ST_RDEV 1 -#define HAVE_UTIME_NULL 1 -#define HAVE_VPRINTF 1 -#define STDC_HEADERS 1 -#define REGEX 1 -#define HSREGEX 1 -#define HAVE_GCVT 1 -#define HAVE_GETLOGIN 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_PUTENV 1 -#define HAVE_REGCOMP 1 -#define HAVE_SETLOCALE 1 -#define HAVE_LOCALECONV 1 -#define HAVE_LOCALE_H 1 -#ifndef HAVE_LIBBIND -# define HAVE_SETVBUF 1 -#endif -#define HAVE_SHUTDOWN 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRSTR 1 -#define HAVE_TEMPNAM 1 -#define HAVE_UTIME 1 -#undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_GRP_H 0 -#define HAVE_PWD_H 1 -#define HAVE_STRING_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_SYS_SOCKET_H -#undef HAVE_SYS_WAIT_H -#define HAVE_SYSLOG_H 1 -#undef HAVE_UNISTD_H -#define HAVE_LIBDL 1 -#define HAVE_LIBM 1 -#define HAVE_CUSERID 0 -#undef HAVE_RINT -#define HAVE_STRFTIME 1 -/* int and long are stll 32bit in 64bit compiles */ -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 -#define SIZEOF_LONG_LONG 8 /* defined as __int64 */ -#define SIZEOF_INTMAX_T 0 -#define ssize_t SSIZE_T -#ifdef _WIN64 -# define SIZEOF_SIZE_T 8 -# define SIZEOF_PTRDIFF_T 8 -#else -# define SIZEOF_SIZE_T 4 -# define SIZEOF_PTRDIFF_T 4 -#endif -#define HAVE_GLOB -#define PHP_SHLIB_SUFFIX "dll" -#define HAVE_SQLDATASOURCES - -/* Win32 supports strcoll */ -#define HAVE_STRCOLL 1 - -/* Win32 support proc_open */ -#define PHP_CAN_SUPPORT_PROC_OPEN 1 - -#define HAVE_MBLEN - -#undef HAVE_ATOF_ACCEPTS_NAN -#undef HAVE_ATOF_ACCEPTS_INF -#define HAVE_HUGE_VAL_NAN 1 diff --git a/win32/build/configure.tail b/win32/build/configure.tail deleted file mode 100644 index e74287d2aaaf6..0000000000000 --- a/win32/build/configure.tail +++ /dev/null @@ -1,6 +0,0 @@ -// vim:ft=javascript -// $Id$ -// tail end of configure - -generate_files(); - diff --git a/win32/build/confutils.js b/win32/build/confutils.js deleted file mode 100644 index ffc3b46500b9b..0000000000000 --- a/win32/build/confutils.js +++ /dev/null @@ -1,1532 +0,0 @@ -// Utils for configure script -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -// $Id: confutils.js,v 1.60 2005-08-03 14:08:58 sniper Exp $ - -var STDOUT = WScript.StdOut; -var STDERR = WScript.StdErr; -var WshShell = WScript.CreateObject("WScript.Shell"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var MFO = null; -var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive"); -var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles"); - -if (PROGRAM_FILES == null) { - PROGRAM_FILES = "C:\\Program Files"; -} - -if (!FSO.FileExists("README.CVS-RULES")) { - STDERR.WriteLine("Must be run from the root of the php source"); - WScript.Quit(10); -} - -var CWD = WshShell.CurrentDirectory; - -if (typeof(CWD) == "undefined") { - CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.CVS-RULES")); -} - -/* defaults; we pick up the precise versions from configure.in */ -var PHP_VERSION = 5; -var PHP_MINOR_VERSION = 0; -var PHP_RELEASE_VERSION = 0; -var PHP_EXTRA_VERSION = ""; -var PHP_VERSION_STRING = "5.0.0"; - -function get_version_numbers() -{ - var cin = file_get_contents("configure.in"); - - if (cin.match(new RegExp("MAJOR_VERSION=(\\d+)"))) { - PHP_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("MINOR_VERSION=(\\d+)"))) { - PHP_MINOR_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("RELEASE_VERSION=(\\d+)"))) { - PHP_RELEASE_VERSION = RegExp.$1; - } - PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION; - - if (cin.match(new RegExp("EXTRA_VERSION=\"([^\"]+)\""))) { - PHP_EXTRA_VERSION = RegExp.$1; - if (PHP_EXTRA_VERSION.length) { - PHP_VERSION_STRING += PHP_EXTRA_VERSION; - } - } - DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING); -} - -configure_args = new Array(); -configure_subst = WScript.CreateObject("Scripting.Dictionary"); - -configure_hdr = WScript.CreateObject("Scripting.Dictionary"); -build_dirs = new Array(); - -extension_include_code = ""; -extension_module_ptrs = ""; - -get_version_numbers(); - -/* execute a command and return the output as a string */ -function execute(command_line) -{ - var e = WshShell.Exec(command_line); - var ret = ""; - - ret = e.StdOut.ReadAll(); - -//STDOUT.WriteLine("command " + command_line); -//STDOUT.WriteLine(ret); - - return ret; -} - -function condense_path(path) -{ - path = FSO.GetAbsolutePathName(path); - - if (path.substr(0, CWD.length).toLowerCase() - == CWD.toLowerCase() && - (path.charCodeAt(CWD.length) == 92 || path.charCodeAt(CWD.length) == 47)) { - return path.substr(CWD.length + 1); - } - - var a = CWD.split("\\"); - var b = path.split("\\"); - var i, j; - - for (i = 0; i < b.length; i++) { - if (a[i].toLowerCase() == b[i].toLowerCase()) - continue; - if (i > 0) { - /* first difference found */ - path = ""; - for (j = 0; j < a.length - i; j++) { - path += "..\\"; - } - for (j = i; j < b.length; j++) { - path += b[j]; - if (j < b.length - 1) - path += "\\"; - } - return path; - } - /* on a different drive */ - break; - } - - return path; -} - -function ConfigureArg(type, optname, helptext, defval) -{ - var opptype = type == "enable" ? "disable" : "without"; - - if (defval == "yes" || defval == "yes,shared") { - this.arg = "--" + opptype + "-" + optname; - this.imparg = "--" + type + "-" + optname; - } else { - this.arg = "--" + type + "-" + optname; - this.imparg = "--" + opptype + "-" + optname; - } - - this.optname = optname; - this.helptext = helptext; - this.defval = defval; - this.symval = optname.toUpperCase().replace(new RegExp("-", "g"), "_"); - this.seen = false; - this.argval = defval; -} - -function ARG_WITH(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("with", optname, helptext, defval); -} - -function ARG_ENABLE(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("enable", optname, helptext, defval); -} - -function analyze_arg(argval) -{ - var ret = new Array(); - var shared = false; - - if (argval == "shared") { - shared = true; - argval = "yes"; - } else if (argval == null) { - /* nothing */ - } else if (arg_match = argval.match(new RegExp("^shared,(.*)"))) { - shared = true; - argval = arg_match[1]; - } else if (arg_match = argval.match(new RegExp("^(.*),shared$"))) { - shared = true; - argval = arg_match[1]; - } - - ret[0] = shared; - ret[1] = argval; - return ret; -} - -function word_wrap_and_indent(indent, text, line_suffix, indent_char) -{ - if (text == null) { - return ""; - } - - var words = text.split(new RegExp("\\s+", "g")); - var i = 0; - var ret_text = ""; - var this_line = ""; - var t; - var space = ""; - var lines = 0; - - if (line_suffix == null) { - line_suffix = ""; - } - - if (indent_char == null) { - indent_char = " "; - } - - for (i = 0; i < indent; i++) { - space += indent_char; - } - - for (i = 0; i < words.length; i++) { - if (this_line.length) { - t = this_line + " " + words[i]; - } else { - t = words[i]; - } - - if (t.length + indent > 78) { - if (lines++) { - ret_text += space; - } - ret_text += this_line + line_suffix + "\r\n"; - this_line = ""; - } - - if (this_line.length) { - this_line += " " + words[i]; - } else { - this_line = words[i]; - } - } - - if (this_line.length) { - if (lines) - ret_text += space; - ret_text += this_line; - } - - return ret_text; -} - -function conf_process_args() -{ - var i, j; - var configure_help_mode = false; - var analyzed = false; - var nice = "cscript /nologo configure.js "; - var disable_all = false; - - args = WScript.Arguments; - for (i = 0; i < args.length; i++) { - arg = args(i); - nice += ' "' + arg + '"'; - if (arg == "--help") { - configure_help_mode = true; - break; - } - if (arg == "--disable-all") { - disable_all = true; - continue; - } - - // If it is --foo=bar, split on the equals sign - arg = arg.split("=", 2); - argname = arg[0]; - if (arg.length > 1) { - argval = arg[1]; - } else { - argval = null; - } - - // Find the arg - found = false; - for (j = 0; j < configure_args.length; j++) { - if (argname == configure_args[j].imparg || argname == configure_args[j].arg) { - found = true; - - arg = configure_args[j]; - arg.seen = true; - - analyzed = analyze_arg(argval); - shared = analyzed[0]; - argval = analyzed[1]; - - if (argname == arg.imparg) { - /* we matched the implicit, or default arg */ - if (argval == null) { - argval = arg.defval; - } - } else { - /* we matched the non-default arg */ - if (argval == null) { - argval = arg.defval == "no" ? "yes" : "no"; - } - } - - arg.argval = argval; - eval("PHP_" + arg.symval + " = argval;"); - eval("PHP_" + arg.symval + "_SHARED = shared;"); - break; - } - } - if (!found) { - STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options"); - WScript.Quit(2); - } - } - - if (configure_help_mode) { - STDOUT.WriteLine(word_wrap_and_indent(0, -"Options that enable extensions and SAPI will accept \ -'yes' or 'no' as a parameter. They also accept 'shared' \ -as a synonym for 'yes' and request a shared build of that \ -module. Not all modules can be built as shared modules; \ -configure will display [shared] after the module name if \ -can be built that way. \ -" - )); - STDOUT.WriteBlankLines(1); - - // Measure width to pretty-print the output - max_width = 0; - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - if (arg.arg.length > max_width) - max_width = arg.arg.length; - } - - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - - n = max_width - arg.arg.length; - pad = " "; - for (j = 0; j < n; j++) { - pad += " "; - } - STDOUT.WriteLine(" " + arg.arg + pad + word_wrap_and_indent(max_width + 5, arg.helptext)); - } - WScript.Quit(1); - } - - var snapshot_build_exclusions = new Array( - 'debug', 'crt-debug', 'lzf-better-compression', - 'php-build', 'snapshot-template', - 'pcre-regex', 'fastcgi', 'force-cgi-redirect', - 'path-info-check', 'zts', 'ipv6', 'memory-limit', - 'zend-multibyte', 'fd-setsize', 'memory-manager', 't1lib' - ); - var force; - - // Now set any defaults we might have missed out earlier - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - if (arg.seen) - continue; - analyzed = analyze_arg(arg.defval); - shared = analyzed[0]; - argval = analyzed[1]; - - // Don't trust a default "yes" answer for a non-core module - // in a snapshot build - if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) { - - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - - if (force) { - /* now check if it is a core module */ - force = false; - for (j = 0; j < core_module_list.length; j++) { - if (core_module_list[j] == arg.optname) { - force = true; - break; - } - } - - if (!force) { - STDOUT.WriteLine("snapshot: forcing " + arg.arg + " shared"); - shared = true; - } - } - } - - if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") { - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - if (force) { - STDOUT.WriteLine("snapshot: forcing " + arg.optname + " on"); - argval = "yes"; - shared = true; - } - } - - if (disable_all) { - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - if (force) { - argval = "no"; - shared = false; - } - } - - eval("PHP_" + arg.symval + " = argval;"); - eval("PHP_" + arg.symval + "_SHARED = shared;"); - } - - MFO = FSO.CreateTextFile("Makefile.objects", true); - - STDOUT.WriteLine("Saving configure options to config.nice.bat"); - var nicefile = FSO.CreateTextFile("config.nice.bat", true); - nicefile.WriteLine(nice); - nicefile.Close(); - - AC_DEFINE('CONFIGURE_COMMAND', nice); -} - -function DEFINE(name, value) -{ - if (configure_subst.Exists(name)) { - configure_subst.Remove(name); - } - configure_subst.Add(name, value); -} - -// Searches a set of paths for a file; -// returns the dir in which the file was found, -// true if it was found in the default env path, -// or false if it was not found at all. -// env_name is the optional name of an env var -// specifying the default path to search -function search_paths(thing_to_find, explicit_path, env_name) -{ - var i, found = false, place = false, file, env; - - STDOUT.Write("Checking for " + thing_to_find + " ... "); - - thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\"); - - if (explicit_path != null) { - if (typeof(explicit_path) == "string") { - explicit_path = explicit_path.split(";"); - } - - for (i = 0; i < explicit_path.length; i++) { - file = glob(explicit_path[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = file[0]; - place = place.substr(0, place.length - thing_to_find.length - 1); - break; - } - } - } - - if (!found && env_name != null) { - env = WshShell.Environment("Process").Item(env_name); - env = env.split(";"); - for (i = 0; i < env.length; i++) { - file = glob(env[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = true; - break; - } - } - } - - if (found && place == true) { - STDOUT.WriteLine(" "); - } else if (found) { - STDOUT.WriteLine(" " + place); - } else { - STDOUT.WriteLine(" "); - } - return place; -} - -function PATH_PROG(progname, additional_paths, symbol) -{ - var exe; - var place; - var cyg_path = PHP_CYGWIN + "\\bin;" + PHP_CYGWIN + "\\usr\\local\\bin"; - - exe = progname + ".exe"; - - if (additional_paths == null) { - additional_paths = cyg_path; - } else { - additional_paths += ";" + cyg_path; - } - - place = search_paths(exe, additional_paths, "PATH"); - - if (place == true) { - place = exe; - } else if (place != false) { - place = place + "\\" + exe; - } - - if (place) { - if (symbol == null) { - symbol = progname.toUpperCase(); - } - DEFINE(symbol, place); - } - return place; -} - -function find_pattern_in_path(pattern, path) -{ - if (path == null) { - return false; - } - - var dirs = path.split(';'); - var i; - var items; - - for (i = 0; i < dirs.length; i++) { - items = glob(dirs[i] + "\\" + pattern); - if (items) { - return condense_path(items[0]); - } - } - return false; -} - -function CHECK_LIB(libnames, target, path_to_check, common_name) -{ - STDOUT.Write("Checking for library " + libnames + " ... "); - - if (common_name == null && target != null) { - common_name = target; - } - - if (path_to_check == null) { - path_to_check = ""; - } - - // if they specified a common name for the package that contains - // the library, tag some useful defaults on to the end of the - // path to be searched - if (common_name != null) { - path_to_check += ";" + PHP_PHP_BUILD + "\\" + common_name + "*"; - path_to_check += ";" + PHP_PHP_BUILD + "\\lib\\" + common_name + "*"; - path_to_check += ";..\\" + common_name + "*"; - } - - // Determine target for build flags - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - // Expand path to include general dirs - path_to_check += ";" + php_usual_lib_suspects; - - // It is common practice to put libs under one of these dir names - var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : "Release", "lib", "libs", "libexec"); - - // libnames can be ; separated list of accepted library names - libnames = libnames.split(';'); - - var i, j, k, libname; - var location = false; - var path = path_to_check.split(';'); - - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - - for (k = 0; k < path.length; k++) { - location = glob(path[k] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - for (j = 0; j < subdirs.length; j++) { - location = glob(path[k] + "\\" + subdirs[j] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - } - if (location) - break; - } - - if (location) { - location = condense_path(location); - var libdir = FSO.GetParentFolderName(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" '); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine(location); - - return location; - } - - // Check in their standard lib path - location = find_pattern_in_path(libname, WshShell.Environment("Process").Item("LIB")); - - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine(" " + libname); - return location; - } - - // Check in their general extra libs path - location = find_pattern_in_path(libname, PHP_EXTRA_LIBS); - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - STDOUT.WriteLine(""); - return location; - } - } - - STDOUT.WriteLine(""); - - return false; -} - -function OLD_CHECK_LIB(libnames, target, path_to_check) -{ - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - if (path_to_check == null) { - path_to_check = php_usual_lib_suspects; - } else { - path_to_check += ";" + php_usual_lib_suspects; - } - var have = 0; - var p; - var i; - var libname; - - var subdir = PHP_DEBUG == "yes" ? "Debug" : "Release"; - - libnames = libnames.split(';'); - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - p = search_paths(libname, path_to_check, "LIB"); - - if (!p) { - p = search_paths(subdir + "\\" + libname, path_to_check, "LIB"); - if (p) { - p += "\\" + subdir; - } - } - - if (typeof(p) == "string") { - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" '); - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else if (p == true) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else { - /* not found in the defaults or the explicit paths, - * so check the general extra libs; if we find - * it here, no need to add another /libpath: for it as we - * already have it covered, but we need to add the lib - * to LIBS_XXX */ - if (false != search_paths(libname, PHP_EXTRA_LIBS, null)) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } - } - - if (have) { - break; - } - } - -// AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", "g"), "_"), have); - - return have; - -} - -function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag) -{ - var c = false; - var sym; - - STDOUT.Write("Checking for " + func_name + " in " + header_name + " ... "); - - c = GREP_HEADER(header_name, func_name, path_to_check); - - sym = func_name.toUpperCase(); - sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_"); - - if (typeof(add_to_flag) == "undefined") { - AC_DEFINE("HAVE_" + sym, c ? 1 : 0); - } else { - ADD_FLAG(add_to_flag, "/DHAVE_" + sym + "=" + (c ? "1" : "0")); - } - - if (c) { - STDOUT.WriteLine("OK"); - return c; - } - STDOUT.WriteLine("No"); - return false; -} - -function GREP_HEADER(header_name, regex, path_to_check) -{ - var c = false; - - if (FSO.FileExists(path_to_check + "\\" + header_name)) { - c = file_get_contents(path_to_check + "\\" + header_name); - } - - if (!c) { - /* look in the include path */ - - var p = search_paths(header_name, path_to_check, "INCLUDE"); - if (typeof(p) == "string") { - c = file_get_contents(p); - } else if (p == false) { - p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); - if (typeof(p) == "string") { - c = file_get_contents(p); - } - } - if (!c) { - return false; - } - } - - if (typeof(regex) == "string") { - regex = new RegExp(regex); - } - - if (c.match(regex)) { - /* caller can now use RegExp.$1 etc. to get at patterns */ - return true; - } - return false; -} - -function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only) -{ - var dir_part_to_add = ""; - - if (use_env == null) { - use_env = true; - } - - // if true, add the dir part of the header_name to the include path - if (add_dir_part == null) { - add_dir_part = false; - } else if (add_dir_part) { - var basename = FSO.GetFileName(header_name); - dir_part_to_add = "\\" + header_name.substr(0, header_name.length - basename.length - 1); - } - - if (path_to_check == null) { - path_to_check = php_usual_include_suspects; - } else { - path_to_check += ";" + php_usual_include_suspects; - } - - var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null); - var have = 0; - var sym; - - if (typeof(p) == "string") { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } else if (p == false) { - /* not found in the defaults or the explicit paths, - * so check the general extra includes; if we find - * it here, no need to add another /I for it as we - * already have it covered, unless we are adding - * the dir part.... */ - p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); - if (typeof(p) == "string" && add_dir_part) { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } - } - have = p ? 1 : 0 - - sym = header_name.toUpperCase(); - sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_"); - - if (typeof(add_to_flag_only) == "undefined" && - flag_name.match(new RegExp("^CFLAGS_(.*)$"))) { - add_to_flag_only = true; - } - - if (typeof(add_to_flag_only) != "undefined") { - ADD_FLAG(flag_name, "/DHAVE_" + sym + "=" + have); - } else { - AC_DEFINE("HAVE_" + sym, have, "have the " + header_name + " header file"); - } - - return p; -} - -/* emits rule to generate version info for a SAPI - * or extension. Returns the name of the .res file - * that will be generated */ -function generate_version_info_resource(makefiletarget, creditspath) -{ - var resname = makefiletarget + ".res"; - var res_desc = "PHP " + makefiletarget; - var res_prod_name = res_desc; - var credits; - var thanks = ""; - var logo = ""; - - if (FSO.FileExists(creditspath + '/CREDITS')) { - credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1); - res_desc = credits.ReadLine(); - try { - thanks = credits.ReadLine(); - } catch (e) { - thanks = null; - } - if (thanks == null) { - thanks = ""; - } else { - thanks = "Thanks to " + thanks; - } - credits.Close(); - } - - if (makefiletarget.match(new RegExp("\\.exe$"))) { - logo = " /D WANT_LOGO "; - } - - MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc"); - MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo + - ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget + - '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' + - thanks + '\\"" win32\\build\\template.rc'); - MFO.WriteBlankLines(1); - - return resname; -} - -function SAPI(sapiname, file_list, makefiletarget, cflags) -{ - var SAPI = sapiname.toUpperCase(); - var ldflags; - var resname; - var ld = "@$(LD)"; - - STDOUT.WriteLine("Enabling SAPI " + configure_module_dirname); - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for SAPI " + sapiname); - MFO.WriteBlankLines(1); - - if (cflags) { - ADD_FLAG('CFLAGS_' + SAPI, cflags); - } - - ADD_SOURCES(configure_module_dirname, file_list, sapiname); - MFO.WriteBlankLines(1); - MFO.WriteLine("# SAPI " + sapiname); - MFO.WriteBlankLines(1); - - /* generate a .res file containing version information */ - resname = generate_version_info_resource(makefiletarget, configure_module_dirname); - - MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget); - MFO.WriteLine("\t@echo SAPI " + configure_module_dirname + " build complete"); - MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - - if (makefiletarget.match(new RegExp("\\.dll$"))) { - ldflags = "/dll $(LDFLAGS)"; - } else if (makefiletarget.match(new RegExp("\\.lib$"))) { - ldflags = "$(LDFLAGS)"; - ld = "$(MAKE_LIB)"; - } else { - ldflags = "$(LDFLAGS)"; - } - - MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname); - - DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')'); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", makefiletarget); - } else { - ADD_FLAG("SAPI_TARGETS", makefiletarget); - } - - MFO.WriteBlankLines(1); -} - -function ADD_DIST_FILE(filename) -{ - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_EXTRA_DIST_FILES", filename); - } else { - ADD_FLAG("PHP_EXTRA_DIST_FILES", filename); - } -} - -function file_get_contents(filename) -{ - var f, c; - try { - f = FSO.OpenTextFile(filename, 1); - c = f.ReadAll(); - f.Close(); - return c; - } catch (e) { - STDOUT.WriteLine("Problem reading " + filename); - return false; - } -} - -// Add a dependency on another extension, so that -// the dependencies are built before extname -function ADD_EXTENSION_DEP(extname, dependson, optional) -{ - var EXT = extname.toUpperCase(); - var DEP = dependson.toUpperCase(); - var dep_present = false; - var dep_shared = false; - - try { - dep_present = eval("PHP_" + DEP); - dep_shared = eval("PHP_" + DEP + "_SHARED"); - } catch (e) { - dep_present = "no"; - dep_shared = false; - } - - if (optional) { - if (dep_present == "no") - return; - } - - var ext_shared = eval("PHP_" + EXT + "_SHARED"); - - if (dep_shared) { - if (!ext_shared) { - if (optional) { - return; - } - ERROR("static " + extname + " cannot depend on shared " + dependson); - } - ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)"); - ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib"); - ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib"); - } -} - -function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) -{ - var objs = null; - var EXT = extname.toUpperCase(); - var extname_for_printing; - - if (shared == null) { - eval("shared = PHP_" + EXT + "_SHARED;"); - } - if (cflags == null) { - cflags = ""; - } - - if (typeof(obj_dir) == "undefined") { - extname_for_printing = configure_module_dirname; - } else { - extname_for_printing = configure_module_dirname + " (via " + obj_dir + ")"; - } - - if (shared) { - STDOUT.WriteLine("Enabling extension " + extname_for_printing + " [shared]"); - cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags; - ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT); - } else { - STDOUT.WriteLine("Enabling extension " + extname_for_printing); - } - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for EXT " + extname); - MFO.WriteBlankLines(1); - - - ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir); - - MFO.WriteBlankLines(1); - - if (shared) { - if (dllname == null) { - dllname = "php_" + extname + ".dll"; - } - var libname = dllname.substring(0, dllname.length-4) + ".lib"; - - var resname = generate_version_info_resource(dllname, configure_module_dirname); - var ld = "@$(LD)"; - - MFO.WriteLine("$(BUILD_DIR)\\" + dllname + " $(BUILD_DIR)\\" + libname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - MFO.WriteLine("\t" + ld + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname); - MFO.WriteBlankLines(1); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", dllname); - } else { - ADD_FLAG("EXT_TARGETS", dllname); - } - MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname); - MFO.WriteLine("\t@echo EXT " + extname + " build complete"); - MFO.WriteBlankLines(1); - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')'); - } else { - ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)"); - ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")"); - - /* find the header that declares the module pointer, - * so we can include it in internal_functions.c */ - var ext_dir = FSO.GetFolder(configure_module_dirname); - var fc = new Enumerator(ext_dir.Files); - var re = /\.h$/; - var s, c; - for (; !fc.atEnd(); fc.moveNext()) { - s = fc.item() + ""; - if (s.match(re)) { - c = file_get_contents(s); - if (c.match("phpext_")) { - extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n'; - } - } - } - - extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n'; - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')'); - } - ADD_FLAG("CFLAGS_" + EXT, cflags); -} - -function ADD_SOURCES(dir, file_list, target, obj_dir) -{ - var i; - var tv; - var src, obj, sym, flags; - - if (target == null) { - target = "php"; - } - - sym = target.toUpperCase() + "_GLOBAL_OBJS"; - flags = "CFLAGS_" + target.toUpperCase() + '_OBJ'; - - if (configure_subst.Exists(sym)) { - tv = configure_subst.Item(sym); - } else { - tv = ""; - } - - file_list = file_list.split(new RegExp("\\s+")); - file_list.sort(); - - var re = new RegExp("\.[a-z0-9A-Z]+$"); - - dir = dir.replace(new RegExp("/", "g"), "\\"); - var objs_line = ""; - var srcs_line = ""; - - var sub_build = "$(BUILD_DIR)\\"; - - /* if module dir is not a child of the main source dir, - * we need to tweak it; we should have detected such a - * case in condense_path and rewritten the path to - * be relative. - * This probably breaks for non-sibling dirs, but that - * is not a problem as buildconf only checks for pecl - * as either a child or a sibling */ - if (obj_dir == null) { - var build_dir = dir.replace(new RegExp("^..\\\\"), ""); - var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_"); - var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); - } - else { - var build_dir = obj_dir.replace(new RegExp("^..\\\\"), ""); - var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_"); - var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); - } - - var dirs = build_dir.split("\\"); - var i, d = ""; - for (i = 0; i < dirs.length; i++) { - d += dirs[i]; - build_dirs[build_dirs.length] = d; - d += "\\"; - } - sub_build += d; - - - DEFINE(bd_flags_name, " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " "); - - for (i in file_list) { - src = file_list[i]; - obj = src.replace(re, ".obj"); - tv += " " + sub_build + obj; - - if (PHP_ONE_SHOT == "yes") { - if (i > 0) { - objs_line += " " + sub_build + obj; - srcs_line += " " + dir + "\\" + src; - } else { - objs_line = sub_build + obj; - srcs_line = dir + "\\" + src; - } - } else { - MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src); - MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + obj); - } - } - - if (PHP_ONE_SHOT == "yes") { - MFO.WriteLine(objs_line + ": " + srcs_line); - MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line); - } - - DEFINE(sym, tv); -} - -function generate_internal_functions() -{ - var infile, outfile; - var indata; - - STDOUT.WriteLine("Generating main/internal_functions.c"); - - infile = FSO.OpenTextFile("main/internal_functions.c.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code); - indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs); - - if (FSO.FileExists("main/internal_functions.c")) { - var origdata = file_get_contents("main/internal_functions.c"); - - if (origdata == indata) { - STDOUT.WriteLine("\t[content unchanged; skipping]"); - return; - } - } - - outfile = FSO.CreateTextFile("main/internal_functions.c", true); - outfile.Write(indata); - outfile.Close(); -} - -function generate_files() -{ - var i, dir, bd, last; - - STDOUT.WriteBlankLines(1); - STDOUT.WriteLine("Creating build dirs..."); - dir = get_define("BUILD_DIR"); - build_dirs.sort(); - last = null; - - if (!FSO.FolderExists(dir)) { - FSO.CreateFolder(dir); - } - - for (i = 0; i < build_dirs.length; i++) { - bd = FSO.BuildPath(dir, build_dirs[i]); - if (bd == last) { - continue; - } - last = bd; - ADD_FLAG("BUILD_DIRS_SUB", bd); - if (!FSO.FolderExists(bd)) { - FSO.CreateFolder(bd); - } - } - - STDOUT.WriteLine("Generating files..."); - generate_makefile(); - generate_internal_functions(); - generate_config_h(); - - - STDOUT.WriteLine("Done."); - STDOUT.WriteBlankLines(1); - if (PHP_SNAPSHOT_BUILD != "no") { - STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot"); - } else { - STDOUT.WriteLine("Type 'nmake' to build PHP"); - } -} - -function generate_config_h() -{ - var infile, outfile; - var indata; - var prefix; - - prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\"); - - STDOUT.WriteLine("Generating main/config.w32.h"); - - infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - outfile = FSO.CreateTextFile("main/config.w32.h", true); - - indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix); - outfile.Write(indata); - - var keys = (new VBArray(configure_hdr.Keys())).toArray(); - var i, j; - var item; - var pieces, stuff_to_crack, chunk; - - outfile.WriteBlankLines(1); - outfile.WriteLine("/* values determined by configure.js */"); - - for (i in keys) { - item = configure_hdr.Item(keys[i]); - outfile.WriteBlankLines(1); - outfile.WriteLine("/* " + item[1] + " */"); - pieces = item[0]; - - if (typeof(pieces) == "string" && pieces.charCodeAt(0) == 34) { - /* quoted string have a maximal length of 2k under vc. - * solution is to crack them and let the compiler concat - * them implicitly */ - stuff_to_crack = pieces; - pieces = ""; - - while (stuff_to_crack.length) { - j = 65; - while (stuff_to_crack.charCodeAt(j) != 32 && j < stuff_to_crack.length) - j++; - - chunk = stuff_to_crack.substr(0, j); - pieces += chunk; - stuff_to_crack = stuff_to_crack.substr(chunk.length); - if (stuff_to_crack.length) - pieces += '" "'; - } - } - - outfile.WriteLine("#define " + keys[i] + " " + pieces); - } - - outfile.Close(); -} - -function generate_makefile() -{ - STDOUT.WriteLine("Generating Makefile"); - var MF = FSO.CreateTextFile("Makefile", true); - - MF.WriteLine("# Generated by configure.js"); - - /* spit out variable definitions */ - var keys = (new VBArray(configure_subst.Keys())).toArray(); - var i; - - for (i in keys) { - // The trailing space is needed to prevent the trailing backslash - // that is part of the build dir flags (CFLAGS_BD_XXX) from being - // seen as a line continuation character - MF.WriteLine(keys[i] + "=" + - //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " " - configure_subst.Item(keys[i]) + " " - ); - MF.WriteBlankLines(1); - } - - MF.WriteBlankLines(1); - - var TF = FSO.OpenTextFile("win32/build/Makefile", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.WriteBlankLines(2); - - MFO.Close(); - TF = FSO.OpenTextFile("Makefile.objects", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.Close(); -} - -function ADD_FLAG(name, flags, target) -{ - if (target != null) { - name = target.toUpperCase() + "_" + name; - } - if (configure_subst.Exists(name)) { - var curr_flags = configure_subst.Item(name); - - if (curr_flags.indexOf(flags) >= 0) { - return; - } - - flags = curr_flags + " " + flags; - configure_subst.Remove(name); - } - configure_subst.Add(name, flags); -} - -function get_define(name) -{ - return configure_subst.Item(name); -} - -// Add a .def to the core to export symbols -function ADD_DEF_FILE(name) -{ - if (!configure_subst.Exists("PHPDEF")) { - DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def"); - ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)"); - } - ADD_FLAG("PHP_DLL_DEF_SOURCES", name); -} - -function AC_DEFINE(name, value, comment, quote) -{ - if (quote == null) { - quote = true; - } - if (quote && typeof(value) == "string") { - value = '"' + value.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"'; - } else if (value.length == 0) { - value = '""'; - } - var item = new Array(value, comment); - if (configure_hdr.Exists(name)) { - var orig_item = configure_hdr.Item(name); - STDOUT.WriteLine("AC_DEFINE[" + name + "]=" + value + ": is already defined to " + item[0]); - } else { - configure_hdr.Add(name, item); - } -} - -function ERROR(msg) -{ - STDERR.WriteLine("ERROR: " + msg); - WScript.Quit(3); -} - -function WARNING(msg) -{ - STDERR.WriteLine("WARNING: " + msg); - STDERR.WriteBlankLines(1); -} - -function copy_and_subst(srcname, destname, subst_array) -{ - if (!FSO.FileExists(srcname)) { - srcname = configure_module_dirname + "\\" + srcname; - destname = configure_module_dirname + "\\" + destname; - } - - var content = file_get_contents(srcname); - var i; - - for (i = 0; i < subst_array.length; i+=2) { - var re = subst_array[i]; - var rep = subst_array[i+1]; - - content = content.replace(re, rep); - } - - var f = FSO.CreateTextFile(destname, true); - f.Write(content); - f.Close(); -} - -// glob using simple filename wildcards -// returns an array of matches that are found -// in the filesystem -function glob(path_pattern) -{ - var path_parts = path_pattern.replace(new RegExp("/", "g"), "\\").split("\\"); - var p; - var base = ""; - var is_pat_re = /\*/; - -//STDOUT.WriteLine("glob: " + path_pattern); - - if (FSO.FileExists(path_pattern)) { - return new Array(path_pattern); - } - - // first, build as much as possible that doesn't have a pattern - for (p = 0; p < path_parts.length; p++) { - if (path_parts[p].match(is_pat_re)) - break; - if (p) - base += "\\"; - base += path_parts[p]; - } - - return _inner_glob(base, p, path_parts); -} - -function _inner_glob(base, p, parts) -{ - var pat = parts[p]; - var full_name = base + "\\" + pat; - var re = null; - var items = null; - - if (p == parts.length) { - return false; - } - -//STDOUT.WriteLine("inner: base=" + base + " p=" + p + " pat=" + pat); - - if (FSO.FileExists(full_name)) { - if (p < parts.length - 1) { - // we didn't reach the full extent of the pattern - return false; - } - return new Array(full_name); - } - - if (FSO.FolderExists(full_name) && p == parts.length - 1) { - // we have reached the end of the pattern; no need to recurse - return new Array(full_name); - } - - // Convert the pattern into a regexp - re = new RegExp("^" + pat.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.') + "$", "i"); - - items = new Array(); - - if (!FSO.FolderExists(base)) { - return false; - } - - var folder = FSO.GetFolder(base); - var fc = null; - var subitems = null; - var item_name = null; - var j; - - fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - - if (item_name.match(re)) { - // got a match; if we are at the end of the pattern, just add these - // things to the items array - if (p == parts.length - 1) { - items[items.length] = fc.item(); - } else { - // we should recurse and do more matches - subitems = _inner_glob(base + "\\" + item_name, p + 1, parts); - if (subitems) { - for (j = 0; j < subitems.length; j++) { - items[items.length] = subitems[j]; - } - } - } - } - } - - // if we are at the end of the pattern, we should match - // files too - if (p == parts.length - 1) { - fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - if (item_name.match(re)) { - items[items.length] = fc.item(); - } - } - } - - if (items.length == 0) - return false; - - return items; -} - - -// for snapshot builders, this option will attempt to enable everything -// and you can then build everything, ignoring fatal errors within a module -// by running "nmake snap" -PHP_SNAPSHOT_BUILD = "no"; -ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no'); - -// one-shot build optimizes build by asking compiler to build -// several objects at once, reducing overhead of starting new -// compiler processes. -ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no'); - - diff --git a/win32/build/cvsclean.js b/win32/build/cvsclean.js deleted file mode 100644 index 3ad9a79b173b6..0000000000000 --- a/win32/build/cvsclean.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id: cvsclean.js,v 1.5 2005-08-03 14:08:58 sniper Exp $ */ -// Cleans up files that do not belong in CVS - -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); - -function find_cvsignore(dirname) -{ - if (!FSO.FolderExists(dirname)) - return; - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - find_cvsignore(fc.item()); - } - - if (FSO.FileExists(dirname + "\\.cvsignore")) { - kill_from_cvsignore(dirname + "\\.cvsignore"); - } -} - -/* recursive remove using cvsignore style wildcard matching; - * note that FSO.DeleteFolder and FSO.DeleteFile methods both - * accept wildcards, but that they are dangerous to use eg: - * "*.php" will match "*.phpt" */ -function rm_r(filename) -{ - if (FSO.FolderExists(filename)) { - var fc = new Enumerator(FSO.GetFolder(filename).SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - rm_r(fc.item()); - } - - fc = new Enumerator(FSO.GetFolder(filename).Files); - - for (; !fc.atEnd(); fc.moveNext()) { - FSO.DeleteFile(fc.item(), true); - } - - FSO.DeleteFolder(filename, true); - } else if (FSO.FileExists(filename)) { - FSO.DeleteFile(filename, true); - } else { - /* we need to handle wildcards here */ - var foldername = FSO.GetParentFolderName(filename); - - if (foldername == "") - foldername = "."; - - var filename = FSO.GetFileName(filename); - - var retext = filename.replace(/\./g, '\\.'); - retext = '^' + retext.replace(/\*/g, '.*') + "$"; - var re = new RegExp(retext); - - var folder = FSO.GetFolder(foldername); - var fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - - var item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - rm_r(fc.item()); - } - } - var fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - FSO.DeleteFile(fc.item(), true); - } - } - } -} - -function kill_from_cvsignore(igfile) -{ - var dir = FSO.GetParentFolderName(igfile) + "\\"; - var t = FSO.OpenTextFile(igfile, 1); - var l; - - if (dir == ".\\") { - dir = ""; - } - - while (!t.atEndOfStream) { - l = t.ReadLine(); - // don't kill their config.nice file(s) - if (l.match("config\.nice.*") || - l.match("") || - l.match("*")) - continue; - rm_r(dir + l); - } - -} - -find_cvsignore("."); - diff --git a/win32/build/deplister.c b/win32/build/deplister.c deleted file mode 100644 index 2e00580c8f767..0000000000000 --- a/win32/build/deplister.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This little application will list the DLL dependencies for a PE - * module to it's stdout for use by distro/installer building tools */ - -#include -#include - -BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason, - PSTR image_name, PSTR dll_name, - ULONG va, ULONG param) -{ - switch (reason) { - case BindImportModuleFailed: - printf("%s,NOTFOUND\n", dll_name); - return TRUE; - - case BindImportModule: - printf("%s,OK\n", dll_name); - return TRUE; - } - return TRUE; -} - -/* usage: - * deplister.exe path\to\module.exe path\to\symbols\root - * */ - -int main(int argc, char *argv[]) -{ - return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, - argv[1], NULL, argv[2], StatusRoutine); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php deleted file mode 100644 index 51c304909d2fa..0000000000000 --- a/win32/build/mkdist.php +++ /dev/null @@ -1,409 +0,0 @@ - array("pipe", "w")), - $pipes); - - $n = 0; - while (($line = fgetcsv($pipes[1]))) { - $n++; - - $dep = strtolower($line[0]); - $depbase = basename($dep); - /* ignore stuff in our build dir, but only if it is - * one of our targets */ - if (((in_array($depbase, $sapi_targets) || - in_array($depbase, $ext_targets) || in_array($depbase, $pecl_targets)) || - $depbase == $phpdll) && file_exists($GLOBALS['build_dir'] . "/$depbase")) { - continue; - } - /* ignore some well-known system dlls */ - if (in_array(basename($dep), $no_dist)) { - continue; - } - - if ($is_pecl) { - if (!in_array($dep, $pecl_dll_deps)) { - $pecl_dll_deps[] = $dep; - } - } else { - if (!in_array($dep, $extra_dll_deps)) { - $extra_dll_deps[] = $dep; - } - } - - $per_module_deps[basename($module)][] = $dep; - } - fclose($pipes[1]); - proc_close($proc); -//echo "Module $module [$n lines]\n"; -} - -function copy_file_list($source_dir, $dest_dir, $list) -{ - global $is_debug, $dist_dir; - - foreach ($list as $item) { - echo "Copying $item from $source_dir to $dest_dir\n"; - copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item); - if ($is_debug) { - $itemdb = preg_replace("/\.(exe|dll|lib)$/i", ".pdb", $item); - if (file_exists("$source_dir/$itemdb")) { - copy("$source_dir/$itemdb", "$dist_dir/dev/$itemdb"); - } - } - if (preg_match("/\.(exe|dll)$/i", $item)) { - get_depends($source_dir . '/' . $item); - } - } -} - -function copy_text_file($source, $dest) -{ - $text = file_get_contents($source); - $text = preg_replace("/(\r\n?)|\n/", "\r\n", $text); - $fp = fopen($dest, "w"); - fwrite($fp, $text); - fclose($fp); -} - -/* very light-weight function to extract a single named file from - * a gzipped tarball. This makes assumptions about the files - * based on the PEAR info set in $packages. */ -function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ -{ - global $packages; - - $name = $pkg . '-' . $packages[$pkg]; - $tarball = $dest_dir . "/" . $name . '.tgz'; - $filename = $name . '/' . $filename; - $destfilename = $dest_dir . "/" . basename($filename); - - $fp = gzopen($tarball, 'rb'); - - $done = false; - do { - /* read the header */ - $hdr_data = gzread($fp, 512); - if (strlen($hdr_data) == 0) - break; - $checksum = 0; - for ($i = 0; $i < 148; $i++) - $checksum += ord($hdr_data{$i}); - for ($i = 148; $i < 156; $i++) - $checksum += 32; - for ($i = 156; $i < 512; $i++) - $checksum += ord($hdr_data{$i}); - - $hdr = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", $hdr_data); - - $hdr['checksum'] = octdec(trim($hdr['checksum'])); - - if ($hdr['checksum'] != $checksum) { - echo "Checksum for $tarball $hdr[filename] is invalid\n"; - print_r($hdr); - return; - } - - $hdr['size'] = octdec(trim($hdr['size'])); - echo "File: $hdr[filename] $hdr[size]\n"; - - if ($filename == $hdr['filename']) { - echo "Found the file we want\n"; - $dest = fopen($destfilename, 'wb'); - $x = stream_copy_to_stream($fp, $dest, $hdr['size']); - fclose($dest); - echo "Wrote $x bytes into $destfilename\n"; - break; - } - - /* skip body of the file */ - $size = 512 * ceil((int)$hdr['size'] / 512); - echo "Skipping $size bytes\n"; - gzseek($fp, gztell($fp) + $size); - - } while (!$done); - -} /* }}} */ - - -/* the core dll */ -copy("$build_dir/php.exe", "$dist_dir/php.exe"); -copy("$build_dir/$phpdll", "$dist_dir/$phpdll"); - -/* and the .lib goes into dev */ -$phplib = str_replace(".dll", ".lib", $phpdll); -copy("$build_dir/$phplib", "$dist_dir/dev/$phplib"); -/* debug builds; copy the symbols too */ -if ($is_debug) { - $phppdb = str_replace(".dll", ".pdb", $phpdll); - copy("$build_dir/$phppdb", "$dist_dir/dev/$phppdb"); -} -/* copy the sapi */ -copy_file_list($build_dir, "$dist_dir", $sapi_targets); - -/* copy the extensions */ -copy_file_list($build_dir, "$dist_dir/ext", $ext_targets); - -/* pecl sapi and extensions */ -copy_file_list($build_dir, $pecl_dir, $pecl_targets); - -/* populate reading material */ -$text_files = array( - "LICENSE" => "license.txt", - "NEWS" => "news.txt", - "php.ini-dist" => "php.ini-dist", - "php.ini-recommended" => "php.ini-recommended", - "win32/install.txt" => "install.txt", - "win32/pws-php5cgi.reg" => "pws-php5cgi.reg", - "win32/pws-php5isapi.reg" => "pws-php5isapi.reg", -); - -foreach ($text_files as $src => $dest) { - copy_text_file($src, $dist_dir . '/' . $dest); -} - -/* general other files */ -$general_files = array( - "php.gif" => "php.gif", -); - -foreach ($general_files as $src => $dest) { - copy($src, $dist_dir . '/' . $dest); -} - -/* include a snapshot identifier */ -$branch = "HEAD"; // TODO - determine this from CVS/Entries -$fp = fopen("$dist_dir/snapshot.txt", "w"); -$now = date("r"); -$version = phpversion(); -fwrite($fp, << $deps) { - if (in_array($modulename, $pecl_targets)) - continue; - - fprintf($fp, "Module: %s\r\n", $modulename); - fwrite($fp, "===========================\r\n"); - foreach ($deps as $dll) { - fprintf($fp, "\t%s\r\n", basename($dll)); - } - fwrite($fp, "\r\n"); -} -fclose($fp); - -/* Now add those dependencies */ -foreach ($extra_dll_deps as $dll) { - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$dist_dir/" . basename($dll)); -} -/* and those for pecl */ -foreach ($pecl_dll_deps as $dll) { - if (in_array($dll, $extra_dll_deps)) { - /* already in main distro */ - continue; - } - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$pecl_dir/" . basename($dll)); -} - -function copy_dir($source, $dest) -{ - if (!is_dir($dest)) { - if (!mkdir($dest)) { - return false; - } - } - - $d = opendir($source); - while (($f = readdir($d)) !== false) { - if ($f == '.' || $f == '..' || $f == 'CVS') { - continue; - } - $fs = $source . '/' . $f; - $fd = $dest . '/' . $f; - if (is_dir($fs)) { - copy_dir($fs, $fd); - } else { - copy($fs, $fd); - } - } - closedir($d); -} - -/* change this next line to true to use good-old - * hand-assembled go-pear-bundle from the snapshot template */ -$use_pear_template = true; - -if (!$use_pear_template) { - /* Let's do a PEAR-less pear setup */ - mkdir("$dist_dir/PEAR"); - mkdir("$dist_dir/PEAR/go-pear-bundle"); - - /* grab the bootstrap script */ - echo "Downloading go-pear\n"; - copy("http://go-pear.org/", "$dist_dir/PEAR/go-pear.php"); - - /* import the package list -- sets $packages variable */ - include "pear/go-pear-list.php"; - - /* download the packages into the destination */ - echo "Fetching packages\n"; - - foreach ($packages as $name => $version) { - $filename = "$name-$version.tgz"; - $destfilename = "$dist_dir/PEAR/go-pear-bundle/$filename"; - if (file_exists($destfilename)) - continue; - $url = "http://pear.php.net/get/$filename"; - echo "Downloading $name from $url\n"; - flush(); - copy($url, $destfilename); - } - - echo "Download complete. Extracting bootstrap files\n"; - - /* Now, we want PEAR.php, Getopt.php (Console_Getopt) and Tar.php (Archive_Tar) - * broken out of the tarballs */ - extract_file_from_tarball('PEAR', 'PEAR.php', "$dist_dir/PEAR/go-pear-bundle"); - extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle"); - extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle"); -} - -/* add extras from the template dir */ -if (file_exists($snapshot_template)) { - $items = glob("$snapshot_template/*"); - print_r($items); - - foreach ($items as $item) { - $bi = basename($item); - if (is_dir($item)) { - if ($bi == 'dlls' || $bi == 'symbols') { - continue; - } else if ($bi == 'PEAR') { - if ($use_pear_template) { - /* copy to top level */ - copy_dir($item, "$dist_dir/$bi"); - } - } else { - /* copy that dir into extras */ - copy_dir($item, "$dist_dir/extras/$bi"); - } - } else { - if ($bi == 'go-pear.bat') { - /* copy to top level */ - copy($item, "$dist_dir/$bi"); - } else { - /* copy to extras */ - copy($item, "$dist_dir/extras/$bi"); - } - } - } -} else { - echo "WARNING: you don't have a snapshot template\n"; - echo " your dist will not be complete\n"; -} - -?> diff --git a/win32/build/php.ico b/win32/build/php.ico deleted file mode 100644 index 43bf0027de8e8..0000000000000 Binary files a/win32/build/php.ico and /dev/null differ diff --git a/win32/build/registersyslog.php b/win32/build/registersyslog.php deleted file mode 100755 index db5f459f735f1..0000000000000 --- a/win32/build/registersyslog.php +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/win32/build/template.rc b/win32/build/template.rc deleted file mode 100644 index e9a234ade11c0..0000000000000 --- a/win32/build/template.rc +++ /dev/null @@ -1,69 +0,0 @@ -/* This is a template RC file. - * $Id$ - * Do not edit with MSVC */ -#ifdef APSTUDIO_INVOKED -# error dont edit with MSVC -#endif - -#include "winres.h" -#include "main/php_version.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifndef THANKS_GUYS -# define THANKS_GUYS "" -#endif - -#ifdef WANT_LOGO -0 ICON win32\build\php.ico -#endif - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", THANKS_GUYS "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", FILE_DESCRIPTION "\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", FILE_NAME "\0" - VALUE "LegalCopyright", "Copyright İ 1997-2005 The PHP Group\0" - VALUE "LegalTrademarks", "PHP\0" - VALUE "OriginalFilename", FILE_NAME "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", PRODUCT_NAME "\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#ifdef MC_INCLUDE -#include MC_INCLUDE -#endif - diff --git a/win32/build/wsyslog.mc b/win32/build/wsyslog.mc deleted file mode 100755 index 01d4d3a86bfde..0000000000000 --- a/win32/build/wsyslog.mc +++ /dev/null @@ -1,28 +0,0 @@ -MessageId=1 -Severity=Success -SymbolicName=PHP_SYSLOG_SUCCESS_TYPE -Language=English -%1 %2 -. - -MessageId=2 -Severity=Informational -SymbolicName=PHP_SYSLOG_INFO_TYPE -Language=English -%1 %2 -. - -MessageId=3 -Severity=Warning -SymbolicName=PHP_SYSLOG_WARNING_TYPE -Language=English -%1 %2 -. - -MessageId=4 -Severity=Error -SymbolicName=PHP_SYSLOG_ERROR_TYPE -Language=English -%1 %2 -. - diff --git a/win32/builddef.bat b/win32/builddef.bat deleted file mode 100644 index f204812ace0e8..0000000000000 --- a/win32/builddef.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -rem Generate phpts.def file, which exports symbols from our dll that -rem are present in some of the libraries which are compiled statically -rem into PHP -rem $Id: builddef.bat,v 1.4 2003-12-08 12:56:47 rrichards Exp $ -type ..\ext\sqlite\php_sqlite.def -type ..\ext\libxml\php_libxml2.def diff --git a/win32/crypt_win32.c b/win32/crypt_win32.c deleted file mode 100644 index b6d19b68d1418..0000000000000 --- a/win32/crypt_win32.c +++ /dev/null @@ -1,355 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This code is distributed under the PHP license with permission from - the author Jochen Obalek */ - -/* encrypt.c - providing 56 bit DES encryption - Copyright (C) 1991 Jochen Obalek - - This program 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, or (at your option) - any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include -#include -#include -#include "md5crypt.h" - -#define BS 64 -#define BS2 32 -#define KS 48 -#define KS2 24 -#define IS 56 -#define IS2 28 - -static char schluessel[16][KS]; - - -static char PC1[] = -{ - 56, 48, 40, 32, 24, 16, 8, 0, - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, - 62, 54, 46, 38, 30, 22, 14, 6, - 61, 53, 45, 37, 29, 21, 13, 5, - 60, 52, 44, 36, 28, 20, 12, 4, - 27, 19, 11, 3 -}; - - -static char PC2[] = -{ - 13, 16, 10, 23, 0, 4, 2, 27, - 14, 5, 20, 9, 22, 18, 11, 3, - 25, 7, 15, 6, 26, 19, 12, 1, - 40, 51, 30, 36, 46, 54, 29, 39, - 50, 44, 32, 47, 43, 48, 38, 55, - 33, 52, 45, 41, 49, 35, 28, 31 -}; - - -static char IP[] = -{ - 57, 49, 41, 33, 25, 17, 9, 1, - 59, 51, 43, 35, 27, 19, 11, 3, - 61, 53, 45, 37, 29, 21, 13, 5, - 63, 55, 47, 39, 31, 23, 15, 7, - 56, 48, 40, 32, 24, 16, 8, 0, - 58, 50, 42, 34, 26, 18, 10, 2, - 60, 52, 44, 36, 28, 20, 12, 4, - 62, 54, 46, 38, 30, 22, 14, 6 -}; - - -static char EP[] = -{ - 7, 39, 15, 47, 23, 55, 31, 63, - 6, 38, 14, 46, 22, 54, 30, 62, - 5, 37, 13, 45, 21, 53, 29, 61, - 4, 36, 12, 44, 20, 52, 28, 60, - 3, 35, 11, 43, 19, 51, 27, 59, - 2, 34, 10, 42, 18, 50, 26, 58, - 1, 33, 9, 41, 17, 49, 25, 57, - 0, 32, 8, 40, 16, 48, 24, 56 -}; - - -static char E0[] = -{ - 31, 0, 1, 2, 3, 4, 3, 4, - 5, 6, 7, 8, 7, 8, 9, 10, - 11, 12, 11, 12, 13, 14, 15, 16, - 15, 16, 17, 18, 19, 20, 19, 20, - 21, 22, 23, 24, 23, 24, 25, 26, - 27, 28, 27, 28, 29, 30, 31, 0 -}; - - -static char E[KS]; - - -static char PERM[] = -{ - 15, 6, 19, 20, 28, 11, 27, 16, - 0, 14, 22, 25, 4, 17, 30, 9, - 1, 7, 23, 13, 31, 26, 2, 8, - 18, 12, 29, 5, 21, 10, 3, 24 -}; - - -static char S_BOX[][64] = -{ - { - 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, - 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, - 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, - 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13 - }, - { - 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, - 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, - 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, - 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9 - }, - { - 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, - 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, - 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, - 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12 - }, - { - 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, - 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, - 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, - 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14 - }, - { - 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, - 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, - 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, - 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3 - }, - { - 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, - 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, - 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, - 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13 - }, - { - 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, - 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, - 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, - 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12 - }, - { - 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, - 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, - 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, - 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 - } -}; - -static void -perm (a, e, pc, n) - register char *a, *e; - register char *pc; - int n; -{ - for (; n--; pc++, a++) - *a = e[*pc]; -} - -static void -crypt_main (nachr_l, nachr_r, schl) - register char *nachr_l, *nachr_r; - register char *schl; -{ - char tmp[KS]; - register int sbval; - register char *tp = tmp; - register char *e = E; - register int i, j; - - for (i = 0; i < 8; i++) - { - for (j = 0, sbval = 0; j < 6; j++) - sbval = (sbval << 1) | (nachr_r[*e++] ^ *schl++); - sbval = S_BOX[i][sbval]; - for (tp += 4, j = 4; j--; sbval >>= 1) - *--tp = sbval & 1; - tp += 4; - } - - e = PERM; - for (i = 0; i < BS2; i++) - *nachr_l++ ^= tmp[*e++]; -} - -void -encrypt (char *nachr, int decr) -{ - char (*schl)[KS] = decr ? schluessel + 15 : schluessel; - char tmp[BS]; - int i; - - perm (tmp, nachr, IP, BS); - - for (i = 8; i--;) - { - crypt_main (tmp, tmp + BS2, *schl); - if (decr) - schl--; - else - schl++; - crypt_main (tmp + BS2, tmp, *schl); - if (decr) - schl--; - else - schl++; - } - - perm (nachr, tmp, EP, BS); -} - -void -setkey (char *schl) -{ - char tmp1[IS]; - register unsigned int ls = 0x7efc; - register int i, j, k; - register int shval = 0; - register char *akt_schl; - - memcpy (E, E0, KS); - perm (tmp1, schl, PC1, IS); - - for (i = 0; i < 16; i++) - { - shval += 1 + (ls & 1); - akt_schl = schluessel[i]; - for (j = 0; j < KS; j++) - { - if ((k = PC2[j]) >= IS2) - { - if ((k += shval) >= IS) - k = (k - IS2) % IS2 + IS2; - } - else if ((k += shval) >= IS2) - k %= IS2; - *akt_schl++ = tmp1[k]; - } - ls >>= 1; - } -} - -char * -des_crypt (const char *wort, const char *salt) -{ - static char retkey[14]; - char key[BS + 2]; - char *k; - int tmp, keybyte; - int i, j; - - memset (key, 0, BS + 2); - - for (k = key, i = 0; i < BS; i++) - { - if (!(keybyte = *wort++)) - break; - k += 7; - for (j = 0; j < 7; j++, i++) - { - *--k = keybyte & 1; - keybyte >>= 1; - } - k += 8; - } - - setkey (key); - memset (key, 0, BS + 2); - - for (k = E, i = 0; i < 2; i++) - { - retkey[i] = keybyte = *salt++; - if (keybyte > 'Z') - keybyte -= 'a' - 'Z' - 1; - if (keybyte > '9') - keybyte -= 'A' - '9' - 1; - keybyte -= '.'; - - for (j = 0; j < 6; j++, keybyte >>= 1, k++) - { - if (!(keybyte & 1)) - continue; - tmp = *k; - *k = k[24]; - k[24] = tmp; - } - } - - for (i = 0; i < 25; i++) - encrypt (key, 0); - - for (k = key, i = 0; i < 11; i++) - { - for (j = keybyte = 0; j < 6; j++) - { - keybyte <<= 1; - keybyte |= *k++; - } - - keybyte += '.'; - if (keybyte > '9') - keybyte += 'A' - '9' - 1; - if (keybyte > 'Z') - keybyte += 'a' - 'Z' - 1; - retkey[i + 2] = keybyte; - } - - retkey[i + 2] = 0; - - if (!retkey[1]) - retkey[1] = *retkey; - - return retkey; -} - -char * -crypt (const char *pw, const char *salt) -{ - if (strlen(salt)>MD5_MAGIC_LEN && strncmp(salt, MD5_MAGIC, MD5_MAGIC_LEN)==0) { - return md5_crypt(pw, salt); - } else { - return des_crypt(pw, salt); - } -} diff --git a/win32/crypt_win32.h b/win32/crypt_win32.h deleted file mode 100644 index 1d11509c43a77..0000000000000 --- a/win32/crypt_win32.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This code is distributed under the PHP license with permission from - the author Jochen Obalek */ - -/* encrypt.h - API to 56 bit DES encryption via calls - encrypt(3), setkey(3) and crypt(3) - Copyright (C) 1991 Jochen Obalek - - This program 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, or (at your option) - any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef _ENCRYPT_H_ -#define _ENCRYPT_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include <_ansi.h> - -void _EXFUN(encrypt, (char *block, int edflag)); -void _EXFUN(setkey, (char *key)); -char * _EXFUN(crypt, (const char *key, const char *salt)); - -#ifdef __cplusplus -} -#endif - -#endif /* _ENCRYPT_H_ */ diff --git a/win32/flock.c b/win32/flock.c deleted file mode 100644 index e659de6597667..0000000000000 --- a/win32/flock.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Program: Unix compatibility routines - * - * Author: Mark Crispin - * Networks and Distributed Computing - * Computing & Communications - * University of Washington - * Administration Building, AG-44 - * Seattle, WA 98195 - * Internet: MRC@CAC.Washington.EDU - * - * Date: 14 September 1996 - * Last Edited: 14 August 1997 - * - * Copyright 1997 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appears in all copies and that both the - * above copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of Washington not be - * used in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. This software is made available - * "as is", and - * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN - * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - - -/* DEDICATION - - * This file is dedicated to my dog, Unix, also known as Yun-chan and - * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix - * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after - * a two-month bout with cirrhosis of the liver. - * - * He was a dear friend, and I miss him terribly. - * - * Lift a leg, Yunie. Luv ya forever!!!! - */ - -#include "php.h" -#include -#include -#include -#include "flock.h" - -PHPAPI int flock(int fd, int op) -{ - HANDLE hdl = (HANDLE) _get_osfhandle(fd); - DWORD low = 1, high = 0; - OVERLAPPED offset = - {0, 0, 0, 0, NULL}; - if (hdl < 0) - return -1; /* error in file descriptor */ - /* bug for bug compatible with Unix */ - UnlockFileEx(hdl, 0, low, high, &offset); - switch (op & ~LOCK_NB) { /* translate to LockFileEx() op */ - case LOCK_EX: /* exclusive */ - if (LockFileEx(hdl, LOCKFILE_EXCLUSIVE_LOCK + - ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0), - 0, low, high, &offset)) - return 0; - break; - case LOCK_SH: /* shared */ - if (LockFileEx(hdl, ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0), - 0, low, high, &offset)) - return 0; - break; - case LOCK_UN: /* unlock */ - return 0; /* always succeeds */ - default: /* default */ - break; - } - errno = EINVAL; /* bad call */ - return -1; -} diff --git a/win32/flock.h b/win32/flock.h deleted file mode 100644 index d228e855dc2a9..0000000000000 --- a/win32/flock.h +++ /dev/null @@ -1,11 +0,0 @@ -#define fsync _commit -#define ftruncate chsize - -/* For flock() emulation */ - -#define LOCK_SH 1 -#define LOCK_EX 2 -#define LOCK_NB 4 -#define LOCK_UN 8 - -PHPAPI int flock(int fd, int op); diff --git a/win32/glob.c b/win32/glob.c deleted file mode 100644 index a8c2cd83e2208..0000000000000 --- a/win32/glob.c +++ /dev/null @@ -1,922 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -/* $Id$ */ - -/* - * glob(3) -- a superset of the one defined in POSIX 1003.2. - * - * The [!...] convention to negate a range is supported (SysV, Posix, ksh). - * - * Optional extra services, controlled by flags not defined by POSIX: - * - * GLOB_QUOTE: - * Escaping convention: \ inhibits any special meaning the following - * character might have (except \ at end of string is retained). - * GLOB_MAGCHAR: - * Set in gl_flags if pattern contained a globbing character. - * GLOB_NOMAGIC: - * Same as GLOB_NOCHECK, but it will only append pattern if it did - * not contain any magic characters. [Used in csh style globbing] - * GLOB_ALTDIRFUNC: - * Use alternately specified directory access functions. - * GLOB_TILDE: - * expand ~user/foo to the /home/dir/of/user/foo - * GLOB_BRACE: - * expand {1,2}{a,b} to 1a 1b 2a 2b - * gl_matchc: - * Number of matches in the current invocation of glob. - */ -#ifdef PHP_WIN32 -#define _POSIX_ -#include -#undef _POSIX_ -#ifndef S_ISDIR -#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) -#endif -#ifndef S_ISLNK -#define S_ISLNK(m) (0) -#endif -#endif - -#include "php.h" -#include - -#include -#ifndef PHP_WIN32 -#include -#include -#include -#include -#else -#include "win32/pwd.h" -#endif -#include -#include "glob.h" -#include -#include -#include - -#define DOLLAR '$' -#define DOT '.' -#define EOS '\0' -#define LBRACKET '[' -#define NOT '!' -#define QUESTION '?' -#define QUOTE '\\' -#define RANGE '-' -#define RBRACKET ']' -#define SEP DEFAULT_SLASH -#define STAR '*' -#define TILDE '~' -#define UNDERSCORE '_' -#define LBRACE '{' -#define RBRACE '}' -#define SLASH '/' -#define COMMA ',' - -#ifndef DEBUG - -#define M_QUOTE 0x8000 -#define M_PROTECT 0x4000 -#define M_MASK 0xffff -#define M_ASCII 0x00ff - -typedef u_short Char; - -#else - -#define M_QUOTE 0x80 -#define M_PROTECT 0x40 -#define M_MASK 0xff -#define M_ASCII 0x7f - -typedef char Char; - -#endif - - -#define CHAR(c) ((Char)((c)&M_ASCII)) -#define META(c) ((Char)((c)|M_QUOTE)) -#define M_ALL META('*') -#define M_END META(']') -#define M_NOT META('!') -#define M_ONE META('?') -#define M_RNG META('-') -#define M_SET META('[') -#define ismeta(c) (((c)&M_QUOTE) != 0) - -static int compare(const void *, const void *); -static int g_Ctoc(const Char *, char *, u_int); -static int g_lstat(Char *, struct stat *, glob_t *); -static DIR *g_opendir(Char *, glob_t *); -static Char *g_strchr(Char *, int); -static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *); -static int glob1(Char *, Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, Char *, Char *, - glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, Char *, - Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * - globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *); -static int match(Char *, Char *, Char *); -#ifdef DEBUG -static void qprintf(const char *, Char *); -#endif - -int -glob(pattern, flags, errfunc, pglob) - const char *pattern; - int flags, (*errfunc)(const char *, int); - glob_t *pglob; -{ - const u_char *patnext; - int c; - Char *bufnext, *bufend, patbuf[MAXPATHLEN]; - -#ifdef PHP_WIN32 - /* Force skipping escape sequences on windows - * due to the ambiguity with path backslashes - */ - flags |= GLOB_NOESCAPE; -#endif - - patnext = (u_char *) pattern; - if (!(flags & GLOB_APPEND)) { - pglob->gl_pathc = 0; - pglob->gl_pathv = NULL; - if (!(flags & GLOB_DOOFFS)) - pglob->gl_offs = 0; - } - pglob->gl_flags = flags & ~GLOB_MAGCHAR; - pglob->gl_errfunc = errfunc; - pglob->gl_matchc = 0; - - bufnext = patbuf; - bufend = bufnext + MAXPATHLEN - 1; - if (flags & GLOB_NOESCAPE) - while (bufnext < bufend && (c = *patnext++) != EOS) - *bufnext++ = c; - else { - /* Protect the quoted characters. */ - while (bufnext < bufend && (c = *patnext++) != EOS) - if (c == QUOTE) { - if ((c = *patnext++) == EOS) { - c = QUOTE; - --patnext; - } - *bufnext++ = c | M_PROTECT; - } else - *bufnext++ = c; - } - *bufnext = EOS; - - if (flags & GLOB_BRACE) - return globexp1(patbuf, pglob); - else - return glob0(patbuf, pglob); -} - -/* - * Expand recursively a glob {} pattern. When there is no more expansion - * invoke the standard globbing routine to glob the rest of the magic - * characters - */ -static int -globexp1(pattern, pglob) - const Char *pattern; - glob_t *pglob; -{ - const Char* ptr = pattern; - int rv; - - /* Protect a single {}, for find(1), like csh */ - if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) - return glob0(pattern, pglob); - - while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL) - if (!globexp2(ptr, pattern, pglob, &rv)) - return rv; - - return glob0(pattern, pglob); -} - - -/* - * Recursive brace globbing helper. Tries to expand a single brace. - * If it succeeds then it invokes globexp1 with the new pattern. - * If it fails then it tries to glob the rest of the pattern and returns. - */ -static int -globexp2(ptr, pattern, pglob, rv) - const Char *ptr, *pattern; - glob_t *pglob; - int *rv; -{ - int i; - Char *lm, *ls; - const Char *pe, *pm, *pl; - Char patbuf[MAXPATHLEN]; - - /* copy part up to the brace */ - for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++) - ; - *lm = EOS; - ls = lm; - - /* Find the balanced brace */ - for (i = 0, pe = ++ptr; *pe; pe++) - if (*pe == LBRACKET) { - /* Ignore everything between [] */ - for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) - ; - if (*pe == EOS) { - /* - * We could not find a matching RBRACKET. - * Ignore and just look for RBRACE - */ - pe = pm; - } - } else if (*pe == LBRACE) - i++; - else if (*pe == RBRACE) { - if (i == 0) - break; - i--; - } - - /* Non matching braces; just glob the pattern */ - if (i != 0 || *pe == EOS) { - *rv = glob0(patbuf, pglob); - return 0; - } - - for (i = 0, pl = pm = ptr; pm <= pe; pm++) { - switch (*pm) { - case LBRACKET: - /* Ignore everything between [] */ - for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++) - ; - if (*pm == EOS) { - /* - * We could not find a matching RBRACKET. - * Ignore and just look for RBRACE - */ - pm = pl; - } - break; - - case LBRACE: - i++; - break; - - case RBRACE: - if (i) { - i--; - break; - } - /* FALLTHROUGH */ - case COMMA: - if (i && *pm == COMMA) - break; - else { - /* Append the current string */ - for (lm = ls; (pl < pm); *lm++ = *pl++) - ; - - /* - * Append the rest of the pattern after the - * closing brace - */ - for (pl = pe + 1; (*lm++ = *pl++) != EOS; ) - ; - - /* Expand the current pattern */ -#ifdef DEBUG - qprintf("globexp2:", patbuf); -#endif - *rv = globexp1(patbuf, pglob); - - /* move after the comma, to the next string */ - pl = pm + 1; - } - break; - - default: - break; - } - } - *rv = 0; - return 0; -} - - - -/* - * expand tilde from the passwd file. - */ -static const Char * -globtilde(pattern, patbuf, patbuf_len, pglob) - const Char *pattern; - Char *patbuf; - size_t patbuf_len; - glob_t *pglob; -{ - struct passwd *pwd; - char *h; - const Char *p; - Char *b, *eb; - - if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) - return pattern; - - /* Copy up to the end of the string or / */ - eb = &patbuf[patbuf_len - 1]; - for (p = pattern + 1, h = (char *) patbuf; - h < (char *)eb && *p && *p != SLASH; *h++ = (char) *p++) - ; - - *h = EOS; - -#if 0 - if (h == (char *)eb) - return what; -#endif - - if (((char *) patbuf)[0] == EOS) { - /* - * handle a plain ~ or ~/ by expanding $HOME - * first and then trying the password file - */ - if ((h = getenv("HOME")) == NULL) { -#ifndef PHP_WIN32 - if ((pwd = getpwuid(getuid())) == NULL) - return pattern; - else - h = pwd->pw_dir; -#else - return pattern; -#endif - } - } else { - /* - * Expand a ~user - */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) - return pattern; - else - h = pwd->pw_dir; - } - - /* Copy the home directory */ - for (b = patbuf; b < eb && *h; *b++ = *h++) - ; - - /* Append the rest of the pattern */ - while (b < eb && (*b++ = *p++) != EOS) - ; - *b = EOS; - - return patbuf; -} - - -/* - * The main glob() routine: compiles the pattern (optionally processing - * quotes), calls glob1() to do the real pattern matching, and finally - * sorts the list (unless unsorted operation is requested). Returns 0 - * if things went well, nonzero if errors occurred. It is not an error - * to find no matches. - */ -static int -glob0(pattern, pglob) - const Char *pattern; - glob_t *pglob; -{ - const Char *qpatnext; - int c, err, oldpathc; - Char *bufnext, patbuf[MAXPATHLEN]; - size_t limit = 0; - - qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); - oldpathc = pglob->gl_pathc; - bufnext = patbuf; - - /* We don't need to check for buffer overflow any more. */ - while ((c = *qpatnext++) != EOS) { - switch (c) { - case LBRACKET: - c = *qpatnext; - if (c == NOT) - ++qpatnext; - if (*qpatnext == EOS || - g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) { - *bufnext++ = LBRACKET; - if (c == NOT) - --qpatnext; - break; - } - *bufnext++ = M_SET; - if (c == NOT) - *bufnext++ = M_NOT; - c = *qpatnext++; - do { - *bufnext++ = CHAR(c); - if (*qpatnext == RANGE && - (c = qpatnext[1]) != RBRACKET) { - *bufnext++ = M_RNG; - *bufnext++ = CHAR(c); - qpatnext += 2; - } - } while ((c = *qpatnext++) != RBRACKET); - pglob->gl_flags |= GLOB_MAGCHAR; - *bufnext++ = M_END; - break; - case QUESTION: - pglob->gl_flags |= GLOB_MAGCHAR; - *bufnext++ = M_ONE; - break; - case STAR: - pglob->gl_flags |= GLOB_MAGCHAR; - /* collapse adjacent stars to one, - * to avoid exponential behavior - */ - if (bufnext == patbuf || bufnext[-1] != M_ALL) - *bufnext++ = M_ALL; - break; - default: - *bufnext++ = CHAR(c); - break; - } - } - *bufnext = EOS; -#ifdef DEBUG - qprintf("glob0:", patbuf); -#endif - - if ((err = glob1(patbuf, patbuf+MAXPATHLEN-1, pglob, &limit)) != 0) - return(err); - - /* - * If there was no match we are going to append the pattern - * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified - * and the pattern did not contain any magic characters - * GLOB_NOMAGIC is there just for compatibility with csh. - */ - if (pglob->gl_pathc == oldpathc) { - if ((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR))) - return(globextend(pattern, pglob, &limit)); - else - return(GLOB_NOMATCH); - } - if (!(pglob->gl_flags & GLOB_NOSORT)) - qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, - pglob->gl_pathc - oldpathc, sizeof(char *), (const void *) compare); - return(0); -} - -static int -compare(p, q) - const void *p, *q; -{ - return(strcmp(*(char **)p, *(char **)q)); -} - -static int -glob1(pattern, pattern_last, pglob, limitp) - Char *pattern, *pattern_last; - glob_t *pglob; - size_t *limitp; -{ - Char pathbuf[MAXPATHLEN]; - - /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */ - if (*pattern == EOS) - return(0); - return(glob2(pathbuf, pathbuf+MAXPATHLEN-1, - pathbuf, pathbuf+MAXPATHLEN-1, - pattern, pattern_last, pglob, limitp)); -} - -/* - * The functions glob2 and glob3 are mutually recursive; there is one level - * of recursion for each segment in the pattern that contains one or more - * meta characters. - */ -static int -glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern, - pattern_last, pglob, limitp) - Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; - Char *pattern, *pattern_last; - glob_t *pglob; - size_t *limitp; -{ - struct stat sb; - Char *p, *q; - int anymeta; - - /* - * Loop over pattern segments until end of pattern or until - * segment with meta character found. - */ - for (anymeta = 0;;) { - if (*pattern == EOS) { /* End of pattern? */ - *pathend = EOS; - if (g_lstat(pathbuf, &sb, pglob)) - return(0); - - if (((pglob->gl_flags & GLOB_MARK) && - !IS_SLASH(pathend[-1])) && (S_ISDIR(sb.st_mode) || - (S_ISLNK(sb.st_mode) && - (g_stat(pathbuf, &sb, pglob) == 0) && - S_ISDIR(sb.st_mode)))) { - if (pathend+1 > pathend_last) - return (1); - *pathend++ = SEP; - *pathend = EOS; - } - ++pglob->gl_matchc; - return(globextend(pathbuf, pglob, limitp)); - } - - /* Find end of next segment, copy tentatively to pathend. */ - q = pathend; - p = pattern; - while (*p != EOS && !IS_SLASH(*p)) { - if (ismeta(*p)) - anymeta = 1; - if (q+1 > pathend_last) - return (1); - *q++ = *p++; - } - - if (!anymeta) { /* No expansion, do next segment. */ - pathend = q; - pattern = p; - while (IS_SLASH(*pattern)) { - if (pathend+1 > pathend_last) - return (1); - *pathend++ = *pattern++; - } - } else - /* Need expansion, recurse. */ - return(glob3(pathbuf, pathbuf_last, pathend, - pathend_last, pattern, pattern_last, - p, pattern_last, pglob, limitp)); - } - /* NOTREACHED */ -} - -static int -glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, - restpattern, restpattern_last, pglob, limitp) - Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; - Char *pattern, *pattern_last, *restpattern, *restpattern_last; - glob_t *pglob; - size_t *limitp; -{ - register struct dirent *dp; - DIR *dirp; - int err; - char buf[MAXPATHLEN]; - - /* - * The readdirfunc declaration can't be prototyped, because it is - * assigned, below, to two functions which are prototyped in glob.h - * and dirent.h as taking pointers to differently typed opaque - * structures. - */ - struct dirent *(*readdirfunc)(); - - if (pathend > pathend_last) - return (1); - *pathend = EOS; - errno = 0; - - if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { - /* TODO: don't call for ENOENT or ENOTDIR? */ - if (pglob->gl_errfunc) { - if (g_Ctoc(pathbuf, buf, sizeof(buf))) - return(GLOB_ABORTED); - if (pglob->gl_errfunc(buf, errno) || - pglob->gl_flags & GLOB_ERR) - return(GLOB_ABORTED); - } - return(0); - } - - err = 0; - - /* Search directory for matching names. */ - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - readdirfunc = pglob->gl_readdir; - else - readdirfunc = readdir; - while ((dp = (*readdirfunc)(dirp))) { - register u_char *sc; - register Char *dc; - - /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == DOT && *pattern != DOT) - continue; - dc = pathend; - sc = (u_char *) dp->d_name; - while (dc < pathend_last && (*dc++ = *sc++) != EOS) - ; - if (dc >= pathend_last) { - *dc = EOS; - err = 1; - break; - } - - if (!match(pathend, pattern, restpattern)) { - *pathend = EOS; - continue; - } - err = glob2(pathbuf, pathbuf_last, --dc, pathend_last, - restpattern, restpattern_last, pglob, limitp); - if (err) - break; - } - - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - (*pglob->gl_closedir)(dirp); - else - closedir(dirp); - return(err); -} - - -/* - * Extend the gl_pathv member of a glob_t structure to accomodate a new item, - * add the new item, and update gl_pathc. - * - * This assumes the BSD realloc, which only copies the block when its size - * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic - * behavior. - * - * Return 0 if new item added, error code if memory couldn't be allocated. - * - * Invariant of the glob_t structure: - * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and - * gl_pathv points to (gl_offs + gl_pathc + 1) items. - */ -static int -globextend(path, pglob, limitp) - const Char *path; - glob_t *pglob; - size_t *limitp; -{ - register char **pathv; - register int i; - u_int newsize, len; - char *copy; - const Char *p; - - newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } - return(GLOB_NOSPACE); - } - - if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { - /* first time around -- clear initial gl_offs items */ - pathv += pglob->gl_offs; - for (i = pglob->gl_offs; --i >= 0; ) - *--pathv = NULL; - } - pglob->gl_pathv = pathv; - - for (p = path; *p++;) - ; - len = (size_t)(p - path); - *limitp += len; - if ((copy = malloc(len)) != NULL) { - if (g_Ctoc(path, copy, len)) { - free(copy); - return(GLOB_NOSPACE); - } - pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; - } - pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; - - if ((pglob->gl_flags & GLOB_LIMIT) && - newsize + *limitp >= ARG_MAX) { - errno = 0; - return(GLOB_NOSPACE); - } - - return(copy == NULL ? GLOB_NOSPACE : 0); -} - - -/* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. - */ -static int -match(name, pat, patend) - register Char *name, *pat, *patend; -{ - int ok, negate_range; - Char c, k; - - while (pat < patend) { - c = *pat++; - switch (c & M_MASK) { - case M_ALL: - if (pat == patend) - return(1); - do - if (match(name, pat, patend)) - return(1); - while (*name++ != EOS) - ; - return(0); - case M_ONE: - if (*name++ == EOS) - return(0); - break; - case M_SET: - ok = 0; - if ((k = *name++) == EOS) - return(0); - if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) - ++pat; - while (((c = *pat++) & M_MASK) != M_END) - if ((*pat & M_MASK) == M_RNG) { - if (c <= k && k <= pat[1]) - ok = 1; - pat += 2; - } else if (c == k) - ok = 1; - if (ok == negate_range) - return(0); - break; - default: - if (*name++ != c) - return(0); - break; - } - } - return(*name == EOS); -} - -/* Free allocated data belonging to a glob_t structure. */ -void -globfree(pglob) - glob_t *pglob; -{ - register int i; - register char **pp; - - if (pglob->gl_pathv != NULL) { - pp = pglob->gl_pathv + pglob->gl_offs; - for (i = pglob->gl_pathc; i--; ++pp) - if (*pp) - free(*pp); - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } -} - -static DIR * -g_opendir(str, pglob) - register Char *str; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (!*str) - strlcpy(buf, ".", sizeof buf); - else { - if (g_Ctoc(str, buf, sizeof(buf))) - return(NULL); - } - - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_opendir)(buf)); - - return(opendir(buf)); -} - -static int -g_lstat(fn, sb, pglob) - register Char *fn; - struct stat *sb; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (g_Ctoc(fn, buf, sizeof(buf))) - return(-1); - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_lstat)(buf, sb)); - return(lstat(buf, sb)); -} - -static int -g_stat(fn, sb, pglob) - register Char *fn; - struct stat *sb; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (g_Ctoc(fn, buf, sizeof(buf))) - return(-1); - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_stat)(buf, sb)); - return(stat(buf, sb)); -} - -static Char * -g_strchr(str, ch) - Char *str; - int ch; -{ - do { - if (*str == ch) - return (str); - } while (*str++); - return (NULL); -} - -static int -g_Ctoc(str, buf, len) - register const Char *str; - char *buf; - u_int len; -{ - - while (len--) { - if ((*buf++ = (char) *str++) == EOS) - return (0); - } - return (1); -} - -#ifdef DEBUG -static void -qprintf(str, s) - const char *str; - register Char *s; -{ - register Char *p; - - (void)printf("%s:\n", str); - for (p = s; *p; p++) - (void)printf("%c", CHAR(*p)); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", *p & M_PROTECT ? '"' : ' '); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", ismeta(*p) ? '_' : ' '); - (void)printf("\n"); -} -#endif diff --git a/win32/glob.h b/win32/glob.h deleted file mode 100644 index 4e842a5cee52d..0000000000000 --- a/win32/glob.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $Id$ */ -/* OpenBSD: glob.h,v 1.7 2002/02/17 19:42:21 millert Exp */ -/* NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp */ - -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * @(#)glob.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _GLOB_H_ -#define _GLOB_H_ - -#include - -struct stat; -typedef struct { - int gl_pathc; /* Count of total paths so far. */ - int gl_matchc; /* Count of paths matching pattern. */ - int gl_offs; /* Reserved at beginning of gl_pathv. */ - int gl_flags; /* Copy of flags parameter to glob. */ - char **gl_pathv; /* List of paths matching pattern. */ - /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); - - /* - * Alternate filesystem access methods for glob; replacement - * versions of closedir(3), readdir(3), opendir(3), stat(2) - * and lstat(2). - */ - void (*gl_closedir)(void *); - struct dirent *(*gl_readdir)(void *); - void *(*gl_opendir)(const char *); - int (*gl_lstat)(const char *, struct stat *); - int (*gl_stat)(const char *, struct stat *); -} glob_t; - -/* Flags */ -#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ -#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ -#define GLOB_ERR 0x0004 /* Return on error. */ -#define GLOB_MARK 0x0008 /* Append / to matching directories. */ -#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ -#define GLOB_NOSORT 0x0020 /* Don't sort. */ - -#ifndef _POSIX_SOURCE -#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ -#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ -#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ -#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ -#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ -#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ -#define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */ -#define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */ -#endif - -/* Error values returned by glob(3) */ -#define GLOB_NOSPACE (-1) /* Malloc call failed. */ -#define GLOB_ABORTED (-2) /* Unignored error. */ -#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK not set. */ -#define GLOB_NOSYS (-4) /* Function not supported. */ -#define GLOB_ABEND GLOB_ABORTED - -__BEGIN_DECLS -int glob(const char *, int, int (*)(const char *, int), glob_t *); -void globfree(glob_t *); -__END_DECLS - -#endif /* !_GLOB_H_ */ diff --git a/win32/globals.c b/win32/globals.c deleted file mode 100755 index 4146f0993f6f1..0000000000000 --- a/win32/globals.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_win32_globals.h" - -#ifdef ZTS -PHPAPI int php_win32_core_globals_id; -#else -php_win32_core_globals the_php_win32_core_globals; -#endif - -void php_win32_core_globals_ctor(void *vg TSRMLS_DC) -{ - php_win32_core_globals *wg = (php_win32_core_globals*)vg; - memset(wg, 0, sizeof(*wg)); -} - -PHP_RSHUTDOWN_FUNCTION(win32_core_globals) -{ - php_win32_core_globals *wg = -#ifdef ZTS - ts_resource(php_win32_core_globals_id) -#else - &the_php_win32_core_globals -#endif - ; - - STR_FREE(wg->login_name); - - memset(wg, 0, sizeof(*wg)); - return SUCCESS; -} - diff --git a/win32/grp.h b/win32/grp.h deleted file mode 100644 index 148438f3bc331..0000000000000 --- a/win32/grp.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -struct group { - char *gr_name; - char *gr_passwd; - int gr_gid; - char **gr_mem; -}; diff --git a/win32/install.txt b/win32/install.txt deleted file mode 100644 index 470d944e2ad19..0000000000000 --- a/win32/install.txt +++ /dev/null @@ -1,1624 +0,0 @@ - -Installing PHP - _________________________________________________________________ - - Table of Contents - Preface - 1. General Installation Considerations - 2. Installation on Windows systems - - Windows Installer - Manual Installation Steps - ActiveScript - Microsoft IIS / PWS - Apache 1.3.x on Microsoft Windows - Apache 2.0.x on Microsoft Windows - Sun, iPlanet and Netscape servers on Microsoft Windows - OmniHTTPd Server - Sambar Server on Microsoft Windows - Xitami on Microsoft Windows - Installation of extensions on Windows - - 3. Installation of PECL extensions - - Introduction to PECL Installations - Downloading PECL extensions - PECL for Windows users - Compiling shared PECL extensions with PEAR - Compiling shared PECL extensions with phpize - Compiling PECL extensions statically into PHP - - 4. Problems? - - Read the FAQ - Other problems - Bug reports - - 5. Runtime Configuration - - The configuration file - How to change configuration settings - _________________________________________________________________ - -Preface - - These installation instructions were generated from the HTML version - of the PHP Manual so formatting and linking have been altered. See the - online and updated version at: http://php.net/install.windows - _________________________________________________________________ - -Chapter 1. General Installation Considerations - - Before starting the installation, first you need to know what do you - want to use PHP for. There are three main fields you can use PHP, as - described in the What can PHP do? section: - - * Server-side scripting - * Command line scripting - * Client-side GUI applications - - For the first and most common form, you need three things: PHP itself, - a web server and a web browser. You probably already have a web - browser, and depending on your operating system setup, you may also - have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows). - You may also rent webspace at a company. This way, you don't need to - set up anything on your own, only write your PHP scripts, upload it to - the server you rent, and see the results in your browser. - - While setting up the server and PHP on your own, you have two choices - for the method of connecting PHP to the server. For many servers PHP - has a direct module interface (also called SAPI). These servers - include Apache, Microsoft Internet Information Server, Netscape and - iPlanet servers. Many other servers have support for ISAPI, the - Microsoft module interface (OmniHTTPd for example). If PHP has no - module support for your web server, you can always use it as a CGI or - FastCGI processor. This means you set up your server to use the CGI - executable of PHP to process all PHP file requests on the server. - - If you are also interested to use PHP for command line scripting (e.g. - write scripts autogenerating some images for you offline, or - processing text files depending on some arguments you pass to them), - you always need the command line executable. For more information, - read the section about writing command line PHP applications. In this - case, you need no server and no browser. - - With PHP you can also write desktop GUI applications using the PHP-GTK - extension. This is a completely different approach than writing web - pages, as you do not output any HTML, but manage windows and objects - within them. For more information about PHP-GTK, please visit the site - dedicated to this extension. PHP-GTK is not included in the official - PHP distribution. - - From now on, this section deals with setting up PHP for web servers on - Unix and Windows with server module interfaces and CGI executables. - You will also find information on the command line executable in the - following sections. - - PHP source code and binary distributions for Windows can be found at - http://www.php.net/downloads.php. We recommend you to choose a mirror - nearest to you for downloading the distributions. - _________________________________________________________________ - -Chapter 2. Installation on Windows systems - - This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP - will not work on 16 bit platforms such as Windows 3.1 and sometimes we - refer to the supported Windows platforms as Win32. Windows 95 is no - longer supported as of PHP 4.3.0. - - There are two main ways to install PHP for Windows: either manually or - by using the installer. - - If you have Microsoft Visual Studio, you can also build PHP from the - original source code. - - Once you have PHP installed on your Windows system, you may also want - to load various extensions for added functionality. - - Warning - - There are several all-in-one installers over the Internet, but none of - those are endorsed by PHP.net, as we believe that the manual - installation is the best choice to have your system secure and - optimised. - _________________________________________________________________ - -Windows Installer - - The Windows PHP installer is available from the downloads page at - http://www.php.net/downloads.php. This installs the CGI version of PHP - and for IIS, PWS, and Xitami, it configures the web server as well. - The installer does not include any extra external PHP extensions - (php_*.dll) as you'll only find those in the Windows Zip Package and - PECL downloads. - - Note: While the Windows installer is an easy way to make PHP work, - it is restricted in many aspects as, for example, the automatic - setup of extensions is not supported. Use of the installer isn't - the preferred method for installing PHP. - - First, install your selected HTTP (web) server on your system, and - make sure that it works. - - Run the executable installer and follow the instructions provided by - the installation wizard. Two types of installation are supported - - standard, which provides sensible defaults for all the settings it - can, and advanced, which asks questions as it goes along. - - The installation wizard gathers enough information to set up the - php.ini file, and configure certain web servers to use PHP. One of the - web servers the PHP installer does not configure for is Apache, so - you'll need to configure it manually. - - Once the installation has completed, the installer will inform you if - you need to restart your system, restart the server, or just start - using PHP. - - Warning - - Be aware, that this setup of PHP is not secure. If you would like to - have a secure PHP setup, you'd better go on the manual way, and set - every option carefully. This automatically working setup gives you an - instantly working PHP installation, but it is not meant to be used on - online servers. - _________________________________________________________________ - -Manual Installation Steps - - This install guide will help you manually install and configure PHP - with a web server on Microsoft Windows. To get started you'll need to - download the zip binary distribution from the downloads page at - http://www.php.net/downloads.php. - - Although there are many all-in-one installation kits, and we also - distribute a PHP installer for Microsoft Windows, we recommend you - take the time to setup PHP yourself as this will provide you with a - better understanding of the system, and enables you to install PHP - extensions easily when needed. - - Upgrading from a previous PHP version: Previous editions of the - manual suggest moving various ini and DLL files into your SYSTEM - (i.e. C:\WINDOWS) folder and while this simplifies the installation - procedure it makes upgrading difficult. We advise you remove all of - these files (like php.ini and PHP related DLLs from the Windows - SYSTEM folder) before moving on with a new PHP installation. Be - sure to backup these files as you might break the entire system. - The old php.ini might be useful in setting up the new PHP as well. - And as you'll soon learn, the preferred method for installing PHP - is to keep all PHP related files in one directory and have this - directory available to your systems PATH. - - MDAC requirements: If you use Microsoft Windows 98/NT4 download the - latest version of the Microsoft Data Access Components (MDAC) for - your platform. MDAC is available at - http://msdn.microsoft.com/data/. This requirement exists because - ODBC is built into the distributed Windows binaries. - - The following steps should be completed on all installations before - any server specific instructions are performed: - - Extract the distribution file into a directory of your choice. If you - are installing PHP 4, extract to C:\, as the zip file expands to a - foldername like php-4.3.7-Win32. If you are installing PHP 5, extract - to C:\php as the zip file doesn't expand as in PHP 4. You may choose a - different location but do not have spaces in the path (like C:\Program - Files\PHP) as some web servers will crash if you do. - - The directory structure extracted from the zip is different for PHP - versions 4 and 5 and look like as follows: - - Example 2-1. PHP 4 package structure -c:\php - | - +--cli - | | - | |-php.exe -- CLI executable - ONLY for commandline scripting - | - +--dlls -- support DLLs required by some extensions - | | - | |-expat.dll - | | - | |-fdftk.dll - | | - | |-... - | - +--extensions -- extension DLLs for PHP - | | - | |-php_bz2.dll - | | - | |-php_cpdf.dll - | | - | |-.. - | - +--mibs -- support files for SNMP - | - +--openssl -- support files for Openssl - | - +--pdf-related -- support files for PDF - | - +--sapi -- SAPI (server module support) DLLs - | | - | |-php4activescript.dll - | | - | |-php4apache.dll - | | - | |-php4apache2.dll - | | - | |-.. - | - +--PEAR -- initial copy of PEAR - | - | - |-go-pear.bat -- PEAR setup script - | - |-.. - | - |-php.exe -- CGI executable - | - |-.. - | - |-php.ini-dist -- default php.ini settings - | - |-php.ini-recommended -- recommended php.ini settings - | - |-php4ts.dll -- core PHP DLL - | - |-... - - Or: - - Example 2-2. PHP 5 package structure -c:\php - | - +--dev - | | - | |-php5ts.lib - | - +--ext -- extension DLLs for PHP - | | - | |-php_bz2.dll - | | - | |-php_cpdf.dll - | | - | |-.. - | - +--extras - | | - | +--mibs -- support files for SNMP - | | - | +--openssl -- support files for Openssl - | | - | +--pdf-related -- support files for PDF - | | - | |-mime.magic - | - +--pear -- initial copy of PEAR - | - | - |-go-pear.bat -- PEAR setup script - | - |-fdftk.dll - | - |-.. - | - |-php-cgi.exe -- CGI executable - | - |-php-win.exe -- executes scripts without an opened command prompt - | - |-php.exe -- CLI executable - ONLY for command line scripting - | - |-.. - | - |-php.ini-dist -- default php.ini settings - | - |-php.ini-recommended -- recommended php.ini settings - | - |-php5activescript.dll - | - |-php5apache.dll - | - |-php5apache2.dll - | - |-.. - | - |-php5ts.dll -- core PHP DLL - | - |-... - - Notice the differences and similarities. Both PHP 4 and PHP 5 have a - CGI executable, a CLI executable, and server modules, but they are - located in different folders and/or have different names. While PHP 4 - packages have the server modules in the sapi folder, PHP 5 - distributions have no such directory and instead they're in the PHP - folder root. The supporting DLLs for the PHP 5 extensions are also not - in a seperate directory. - - Note: In PHP 4, you should move all files located in the dll and - sapi folders to the main folder (e.g. C:\php). - - Here is a list of server modules shipped with PHP 4 and PHP 5: - - * sapi/php4activescript.dll (php5activescript.dll) - ActiveScript - engine, allowing you to embed PHP in your Windows applications. - * sapi/php4apache.dll (php5apache.dll) - Apache 1.3.x module. - * sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x module. - * sapi/php4isapi.dll (php5isapi.dll) - ISAPI Module for ISAPI - compliant web servers like IIS 4.0/PWS 4.0 or newer. - * sapi/php4nsapi.dll (php5nsapi.dll) - Sun/iPlanet/Netscape server - module. - * sapi/php4pi3web.dll (no equivalent in PHP 5) - Pi3Web server - module. - - Server modules provide significantly better performance and additional - functionality compared to the CGI binary. The CLI version is designed - to let you use PHP for command line scripting. More information about - CLI is available in the chapter about using PHP from the command line. - - Warning - - The SAPI modules have been significantly improved as of the 4.1 - release, however, in older systems you may encounter server errors or - other server modules failing, such as ASP. - - The CGI and CLI binaries, and the web server modules all require the - php4ts.dll (php5ts.dll) file to be available to them. You have to make - sure that this file can be found by your PHP installation. The search - order for this DLL is as follows: - - * The same directory from where php.exe is called, or in case you - use a SAPI module, the web server's directory (e.g. C:\Program - Files\Apache Group\Apache2\bin). - * Any directory in your Windows PATH environment variable. - - To make php4ts.dll / php5ts.dll available you have three options: copy - the file to the Windows system directory, copy the file to the web - server's directory, or add your PHP directory, C:\php to the PATH. For - better maintenance, we advise you to follow the last option, add - C:\php to the PATH, because it will be simpler to upgrade PHP in the - future. Read more about how to add your PHP directory to PATH in the - corresponding FAQ entry. - - The next step is to set up a valid configuration file for PHP, - php.ini. There are two ini files distributed in the zip file, - php.ini-dist and php.ini-recommended. We advise you to use - php.ini-recommended, because we optimized the default settings in this - file for performance, and security. Read this well documented file - carefully because it has changes from php.ini-dist that will - drastically affect your setup. Some examples are display_errors being - off and magic_quotes_gpc being off. In addition to reading these, - study the ini settings and set every element manually yourself. If you - would like to achieve the best security, then this is the way for you, - although PHP works fine with these default ini files. Copy your chosen - ini-file to a directory that PHP is able to find and rename it to - php.ini. PHP searches for php.ini in the following locations (in - order): - - * PHPIniDir directive (Apache 2 module only) - * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath - * The PHPRC environment variable - * Directory of PHP (for CLI), or the web server's directory (for - SAPI modules) - * Windows directory (C:\windows or C:\winnt) - - If you are running Apache 2, the simpler option is to use the - PHPIniDir directive (read the installation on Apache 2 page), - otherwise your best option is to set the PHPRC environment variable. - This process is explained in the following FAQ entry. - - Note: If you're using NTFS on Windows NT, 2000, XP or 2003, make - sure that the user running the web server has read permissions to - your php.ini (e.g. make it readable by Everyone). - - The following steps are optional: - - * Edit your new php.ini file. If you plan to use OmniHTTPd, do not - follow the next step. Set the doc_root to point to your web - servers document_root. For example: - -doc_root = c:\inetpub\wwwroot // for IIS/PWS - -doc_root = c:\apache\htdocs // for Apache - - * Choose the extensions you would like to load when PHP starts. See - the section about Windows extensions, about how to set up one, and - what is already built in. Note that on a new installation it is - advisable to first get PHP working and tested without any - extensions before enabling them in php.ini. - * On PWS and IIS, you can set the browscap configuration setting to - point to: c:\windows\system\inetsrv\browscap.ini on Windows 9x/Me, - c:\winnt\system32\inetsrv\browscap.ini on NT/2000, and - c:\windows\system32\inetsrv\browscap.ini on XP. For an up-to-date - browscap.ini, read the following FAQ. - - PHP is now setup on your system. The next step is to choose a web - server, and enable it to run PHP. Choose a webserver from the table of - contents. - _________________________________________________________________ - -ActiveScript - - This section contains notes specific to the ActiveScript installation. - - ActiveScript is a windows only SAPI that enables you to use PHP script - in any ActiveScript compliant host, like Windows Script Host, - ASP/ASP.NET, Windows Script Components or Microsoft Scriptlet control. - - As of PHP 5.0.1, ActiveScript has been moved to the PECL repository. - You may download this PECL extension DLL from the PHP Downloads page - or at http://snaps.php.net/. - - Note: You should read the manual installation steps first! - - After installing PHP, you should download the ActiveScript DLL - (php5activescript.dll) and place it in the main PHP folder (e.g. - C:\php). - - After having all the files needed, you must register the DLL on your - system. To achieve this, open a Command Prompt window (located in the - Start Menu). Then go to your PHP directory by typing something like cd - C:\php. To register the DLL just type regsvr32 php5activescript.dll. - - To test if ActiveScript is working, create a new file, named test.wsf - (the extension is very important) and type: - - - - - - - Save and double-click on the file. If you receive a little window - saying "Hello World!" you're done. - - Note: ActiveScript doesn't use the default php.ini file. Instead, - it will look only in the same directory as the .exe that caused it - to load. You should create php-activescript.ini and place it in - that folder, if you wish to load extensions, etc. - _________________________________________________________________ - -Microsoft IIS / PWS - - This section contains notes and hints specific to IIS (Microsoft - Internet Information Server). - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - _________________________________________________________________ - -General considerations for all installations of PHP with IIS - - * First, read the Manual Installation Instructions. Do not skip this - step as it provides crucial information for installing PHP on - Windows. - * CGI users must set the cgi.force_redirect PHP directive to 0 - inside php.ini. Read the faq on cgi.force_redirect for important - details. Also, CGI users should set the cgi.redirect_status_env - directive to ENV_VAR_NAME. Be sure these directives aren't - commented out inside php.ini. - * The PHP 4 CGI is named php.exe while in PHP 5 it's php-cgi.exe. In - PHP 5, php.exe is the CLI, and not the CGI. - * Modify the Windows PATH environment variable to include the PHP - directory. This way the PHP DLL files, PHP executables, and - php.ini can all remain in the PHP directory without cluttering up - the Windows system directory. For more details, see the FAQ on - Setting the PATH. - * Be sure the extension_dir and doc_root PHP directives are - appropriately set in php.ini. These directives depend on the - system that PHP is being installed on. In PHP 4, the extension_dir - is extensions while with PHP 5 it's ext. So, an example PHP 5 - extensions_dir value is "c:\php\ext" and an example IIS doc_root - value is "c:\Inetpub\wwwroot". - * PHP extension DLL files, such as php_mysql.dll and php_curl.dll, - are found in the zip package of the PHP download (not the PHP - installer). In PHP 5, many extensions are part of PECL and can be - downloaded in the "Collection of PECL modules" package. Files such - as php_zip.dll and php_ssh2.dll. Download PHP files here. - * When defining the executable, the 'check that file exists' box may - also be checked. For a small performance penalty, the IIS (or PWS) - will check that the script file exists and sort out authentication - before firing up PHP. This means that the web server will provide - sensible 404 style error messages instead of CGI errors - complaining that PHP did not output any data. - _________________________________________________________________ - -Windows NT/200x/XP and IIS 4 or newer - - PHP may be installed as a CGI binary, or with the ISAPI module. In - either case, you need to start the Microsoft Management Console (may - appear as 'Internet Services Manager', either in your Windows NT 4.0 - Option Pack branch or the Control Panel=>Administrative Tools under - Windows 2000/XP). Then right click on your Web server node (this will - most probably appear as 'Default Web Server'), and select - 'Properties'. - - If you want to use the CGI binary, do the following: - - * Under 'Home Directory', 'Virtual Directory', or 'Directory', do - the following: - * Change the Execute Permissions to 'Scripts only' - * Click on the 'Configuration' button, and choose the Application - Mappings tab. Click Add and set the Executable path to the - appropriate CGI file. An example PHP 5 value is: - C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method - exclusions' blank, and check the 'Script engine' checkbox. Now, - click OK a few times. - * Set up the appropriate security. (This is done in Internet Service - Manager), and if your NT Server uses NTFS file system, add execute - rights for I_USR_ to the directory that contains php.exe / - php-cgi.exe. - - To use the ISAPI module, do the following: - - * If you don't want to perform HTTP Authentication using PHP, you - can (and should) skip this step. Under ISAPI Filters, add a new - ISAPI filter. Use PHP as the filter name, and supply a path to the - php4isapi.dll / php5isapi.dll. - * Under 'Home Directory', 'Virtual Directory', or 'Directory', do - the following: - * Change the Execute Permissions to 'Scripts only' - * Click on the 'Configuration' button, and choose the Application - Mappings tab. Click Add and set the Executable path to the - appropriate ISAPI DLL. An example PHP 5 value is: - C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method - exclusions' blank, and check the 'Script engine' checkbox. Now, - click OK a few times. - * Stop IIS completely (NET STOP iisadmin) - * Start IIS again (NET START w3svc) - - With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service - Extensions, choose "Add a new Web service extension", enter in a name - such as PHP, choose the Add button and for the value browse to either - the ISAPI file (php4isapi.dll or php5isapi.dll) or CGI (php.exe or - php-cgi.exe) then check "Set extension status to Allowed" and click - OK. - - In order to use index.php as a default content page, do the following: - From within the Documents tab, choose Add. Type in index.php and click - OK. Adjust the order by choosing Move Up or Move Down. This is similar - to setting DirectoryIndex with Apache. - - The steps above must be repeated for each extension that is to be - associated with PHP scripts. .php is the most common although .php3 - may be required for legacy applications. - - If you experience 100% CPU usage after some time, turn off the IIS - setting Cache ISAPI Application. - _________________________________________________________________ - -Windows and PWS 4 - - PWS 4 does not support ISAPI, only PHP CGI should be used. - - * Edit the enclosed pws-php4cgi.reg / pws-php5cgi.reg file (look - into the SAPI folder for PHP 4, or in the main folder for PHP 5) - to reflect the location of your php.exe / php-cgi.exe. Backslashes - should be escaped, for example: - [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parame - ters\Script Map] ".php"="C:\\php\\php.exe" (change to - C:\\php\\php-cgi.exe if you are using PHP 5) Now merge this - registery file into your system; you may do this by - double-clicking it. - * In the PWS Manager, right click on a given directory you want to - add PHP support to, and select Properties. Check the 'Execute' - checkbox, and confirm. - _________________________________________________________________ - -Windows and PWS/IIS 3 - - The recommended method for configuring these servers is to use the REG - file included with the distribution (pws-php4cgi.reg in the SAPI - folder for PHP 4, or pws-php5cgi.reg in the main folder for PHP 5). - You may want to edit this file and make sure the extensions and PHP - install directories match your configuration. Or you can follow the - steps below to do it manually. - - Warning - - These steps involve working directly with the Windows registry. One - error here can leave your system in an unstable state. We highly - recommend that you back up your registry first. The PHP Development - team will not be held responsible if you damage your registry. - - * Run Regedit. - * Navigate to: HKEY_LOCAL_MACHINE /System /CurrentControlSet - /Services /W3Svc /Parameters /ScriptMap. - * On the edit menu select: New->String Value. - * Type in the extension you wish to use for your php scripts. For - example .php - * Double click on the new string value and enter the path to php.exe - in the value data field. ex: C:\php\php.exe for PHP 4, or - C:\php\php-cgi.exe for PHP 5. - * Repeat these steps for each extension you wish to associate with - PHP scripts. - - The following steps do not affect the web server installation and only - apply if you want your PHP scripts to be executed when they are run - from the command line (ex. run C:\myscripts\test.php) or by double - clicking on them in a directory viewer window. You may wish to skip - these steps as you might prefer the PHP files to load into a text - editor when you double click on them. - - * Navigate to: HKEY_CLASSES_ROOT - * On the edit menu select: New->Key. - * Name the key to the extension you setup in the previous section. - ex: .php - * Highlight the new key and in the right side pane, double click the - "default value" and enter phpfile. - * Repeat the last step for each extension you set up in the previous - section. - * Now create another New->Key under HKEY_CLASSES_ROOT and name it - phpfile. - * Highlight the new key phpfile and in the right side pane, double - click the "default value" and enter PHP Script. - * Right click on the phpfile key and select New->Key, name it Shell. - * Right click on the Shell key and select New->Key, name it open. - * Right click on the open key and select New->Key, name it command. - * Highlight the new key command and in the right side pane, double - click the "default value" and enter the path to php.exe. ex: - c:\php\php.exe -q %1. (don't forget the %1). - * Exit Regedit. - * If using PWS on Windows, reboot to reload the registry. - - PWS and IIS 3 users now have a fully operational system. IIS 3 users - can use a nifty tool from Steven Genusa to configure their script - maps. - _________________________________________________________________ - -Apache 1.3.x on Microsoft Windows - - This section contains notes and hints specific to Apache 1.3.x - installs of PHP on Microsoft Windows systems. There are also - instructions and notes for Apache 2 on a separate page. - - Note: Please read the manual installation steps first! - - There are two ways to set up PHP to work with Apache 1.3.x on Windows. - One is to use the CGI binary (php.exe for PHP 4 and php-cgi.exe for - PHP 5), the other is to use the Apache Module DLL. In either case you - need to edit your httpd.conf to configure Apache to work with PHP, and - then restart the server. - - It is worth noting here that now the SAPI module has been made more - stable under Windows, we recommend it's use above the CGI binary, - since it is more transparent and secure. - - Although there can be a few variations of configuring PHP under - Apache, these are simple enough to be used by the newcomer. Please - consult the Apache Documentation for further configuration directives. - - After changing the configuration file, remember to restart the server, - for example, NET STOP APACHE followed by NET START APACHE, if you run - Apache as a Windows Service, or use your regular shortcuts. - - Note: Remember that when adding path values in the Apache - configuration files on Windows, all backslashes such as - c:\directory\file.ext must be converted to forward slashes, as - c:/directory/file.ext. - _________________________________________________________________ - -Installing as an Apache module - - You should add the following lines to your Apache httpd.conf file: - - Example 2-3. PHP as an Apache 1.3.x module - - This assumes PHP is installed to c:\php. Adjust the path if this is - not the case. - - For PHP 4: -# Add to the end of the LoadModule section -LoadModule php4_module "c:/php/php4apache.dll" - -# Add to the end of the AddModule section -AddModule mod_php4.c - - For PHP 5: -# Add to the end of the LoadModule section -LoadModule php5_module "c:/php/php5apache.dll" - -# Add to the end of the AddModule section -AddModule mod_php5.c - - For both: -# Add this line inside the conditional brace -AddType application/x-httpd-php .php - -# For syntax highlighted .phps files, also add -AddType application/x-httpd-php-source .phps - _________________________________________________________________ - -Installing as a CGI binary - - If you unzipped the PHP package to C:\php\ as described in the Manual - Installation Steps section, you need to insert these lines to your - Apache configuration file to set up the CGI binary: - - Example 2-4. PHP and Apache 1.3.x as CGI -ScriptAlias /php/ "c:/php/" -AddType application/x-httpd-php .php - -# For PHP 4 -Action application/x-httpd-php "/php/php.exe" - -# For PHP 5 -Action application/x-httpd-php "/php/php-cgi.exe" - -# specify the directory where php.ini is -SetEnv PHPRC C:/php - - Note that the second line in the list above can be found in the actual - versions of httpd.conf, but it is commented out. Remember also to - substitute the c:/php/ for your actual path to PHP. - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - If you would like to present PHP source files syntax highlighted, - there is no such convenient option as with the module version of PHP. - If you chose to configure Apache to use PHP as a CGI binary, you will - need to use the highlight_file() function. To do this simply create a - PHP script file and add this code: . - _________________________________________________________________ - -Apache 2.0.x on Microsoft Windows - - This section contains notes and hints specific to Apache 2.0.x - installs of PHP on Microsoft Windows systems. We also have - instructions and notes for Apache 1.3.x users on a separate page. - - Note: You should read the manual installation steps first! - - Warning - - We do not recommend using a threaded MPM in production with Apache2. - Use the prefork MPM instead, or use Apache1. For information on why, - read the following FAQ entry - - You are highly encouraged to take a look at the Apache Documentation - to get a basic understanding of the Apache 2.0.x Server. Also consider - to read the Windows specific notes for Apache 2.0.x before reading on - here. - - PHP and Apache 2.0.x compatibility notes: The following versions of - PHP are known to work with the most recent version of Apache 2.0.x: - - * PHP 4.3.0 or later available at http://www.php.net/downloads.php. - * the latest stable development version. Get the source code - http://snaps.php.net/php4-latest.tar.gz or download binaries for - Windows http://snaps.php.net/win32/php4-win32-latest.zip. - * a prerelease version downloadable from http://qa.php.net/. - * you have always the option to obtain PHP through anonymous CVS. - - These versions of PHP are compatible to Apache 2.0.40 and later. - - Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works - with Apache 2.0.39, don't use any other version of Apache with PHP - 4.2.3. However, the recommended setup is to use PHP 4.3.0 or later - with the most recent version of Apache2. - - All mentioned versions of PHP will work still with Apache 1.3.x. - - Warning - - Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or - Windows XP. At this time, support for Windows 9x is incomplete. Apache - 2.0.x is not expected to work on those platforms at this time. - - Download the most recent version of Apache 2.0.x and a fitting PHP - version. Follow the Manual Installation Steps and come back to go on - with the integration of PHP and Apache. - - There are two ways to set up PHP to work with Apache 2.0.x on Windows. - One is to use the CGI binary the other is to use the Apache module - DLL. In either case you need to edit your httpd.conf to configure - Apache to work with PHP and then restart the server. - - Note: Remember that when adding path values in the Apache - configuration files on Windows, all backslashes such as - c:\directory\file.ext must be converted to forward slashes, as - c:/directory/file.ext. - _________________________________________________________________ - -Installing as a CGI binary - - You need to insert these three lines to your Apache httpd.conf - configuration file to set up the CGI binary: - - Example 2-5. PHP and Apache 2.0 as CGI -ScriptAlias /php/ "c:/php/" -AddType application/x-httpd-php .php - -# For PHP 4 -Action application/x-httpd-php "/php/php.exe" - -# For PHP 5 -Action application/x-httpd-php "/php/php-cgi.exe" - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - _________________________________________________________________ - -Installing as an Apache module - - You need to insert these two lines to your Apache httpd.conf - configuration file to set up the PHP module for Apache 2.0: - - Example 2-6. PHP and Apache 2.0 as Module -# For PHP 4 do something like this: -LoadModule php4_module "c:/php/php4apache2.dll" -AddType application/x-httpd-php .php - -# For PHP 5 do something like this: -LoadModule php5_module "c:/php/php5apache2.dll" -AddType application/x-httpd-php .php - -# configure the path to php.ini -PHPIniDir "C:/php" - - Note: Remember to substitute the c:/php/ for your actual path to - PHP in the above examples. Take care to use either php4apache2.dll - or php5apache2.dll in your LoadModule directive and not - php4apache.dll or php5apache.dll as the latter ones are designed to - run with Apache 1.3.x. - - Note: If you want to use content negotiation, read related FAQ. - - Warning - - Don't mix up your installation with DLL files from different PHP - versions. You have the only choice to use the DLL's and extensions - that ship with your downloaded PHP version. - _________________________________________________________________ - -Sun, iPlanet and Netscape servers on Microsoft Windows - - This section contains notes and hints specific to Sun Java System Web - Server, Sun ONE Web Server, iPlanet and Netscape server installs of - PHP on Windows. - - From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to - generate custom directory listings and error pages. Additional - functions for Apache compatibility are also available. For support in - current webservers read the note about subrequests. - _________________________________________________________________ - -CGI setup on Sun, iPlanet and Netscape servers - - To install PHP as a CGI handler, do the following: - - * Copy php4ts.dll to your systemroot (the directory where you - installed Windows) - * Make a file association from the command line. Type the following - two lines: - -assoc .php=PHPScript -ftype PHPScript=c:\php\php.exe %1 %* - - * In the Netscape Enterprise Administration Server create a dummy - shellcgi directory and remove it just after (this step creates 5 - important lines in obj.conf and allow the web server to handle - shellcgi scripts). - * In the Netscape Enterprise Administration Server create a new mime - type (Category: type, Content-Type: magnus-internal/shellcgi, File - Suffix:php). - * Do it for each web server instance you want PHP to run - - More details about setting up PHP as a CGI executable can be found - here: http://benoit.noss.free.fr/php/install-php.html - _________________________________________________________________ - -NSAPI setup on Sun, iPlanet and Netscape servers - - To install PHP with NSAPI, do the following: - - * Copy php4ts.dll to your systemroot (the directory where you - installed Windows) - * Make a file association from the command line. Type the following - two lines: - -assoc .php=PHPScript -ftype PHPScript=c:\php\php.exe %1 %* - - * In the Netscape Enterprise Administration Server create a new mime - type (Category: type, Content-Type: magnus-internal/x-httpd-php, - File Suffix: php). - * Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6) - and add the following: You should place the lines after mime types - init. - -Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="c: -/php/sapi/php4nsapi.dll" -Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" [php -_ini="c:/path/to/php.ini"] - - (PHP >= 4.3.3) The php_ini parameter is optional but with it you - can place your php.ini in your webserver config directory. - * Configure the default object in obj.conf (for virtual server - classes [Sun Web Server 6.0+] in their vserver.obj.conf): In the - section, place this line necessarily after - all 'ObjectType' and before all 'AddLog' lines: - -Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inik -ey=value ...] - - (PHP >= 4.3.3) As additional parameters you can add some special - php.ini-values, for example you can set a - docroot="/path/to/docroot" specific to the context php4_execute is - called. For boolean ini-keys please use 0/1 as value, not - "On","Off",... (this will not work correctly), e.g. - zlib.output_compression=1 instead of zlib.output_compression="On" - * This is only needed if you want to configure a directory that only - consists of PHP scripts (same like a cgi-bin directory): - - -ObjectType fn="force-type" type="magnus-internal/x-httpd-php" -Service fn=php4_execute [inikey=value inikey=value ...] - - - After that you can configure a directory in the Administration - server and assign it the style x-httpd-php. All files in it will - get executed as PHP. This is nice to hide PHP usage by renaming - files to .html. - * Restart your web service and apply changes - * Do it for each web server instance you want PHP to run - - Note: More details about setting up PHP as an NSAPI filter can be - found here: http://benoit.noss.free.fr/php/install-php4.html - - Note: The stacksize that PHP uses depends on the configuration of - the webserver. If you get crashes with very large PHP scripts, it - is recommended to raise it with the Admin Server (in the section - "MAGNUS EDITOR"). - _________________________________________________________________ - -CGI environment and recommended modifications in php.ini - - Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE - WS/iPlanet/Netscape is a multithreaded web server. Because of that all - requests are running in the same process space (the space of the - webserver itself) and this space has only one environment. If you want - to get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the - correct way to try this in the old PHP 3.x way with getenv() or a - similar way (register globals to environment, $_ENV). You would only - get the environment of the running webserver without any valid CGI - variables! - - Note: Why are there (invalid) CGI variables in the environment? - - Answer: This is because you started the webserver process from the - admin server which runs the startup script of the webserver, you - wanted to start, as a CGI script (a CGI script inside of the admin - server!). This is why the environment of the started webserver has - some CGI environment variables in it. You can test this by starting - the webserver not from the administration server. Use the command - line as root user and start it manually - you will see there are no - CGI-like environment variables. - - Simply change your scripts to get CGI variables in the correct way for - PHP 4.x by using the superglobal $_SERVER. If you have older scripts - which use $HTTP_HOST, etc., you should turn on register_globals in - php.ini and change the variable order too (important: remove "E" from - it, because you do not need the environment here): -variables_order = "GPCS" -register_globals = On - _________________________________________________________________ - -Special use for error pages or self-made directory listings (PHP >= 4.3.3) - - You can use PHP to generate the error pages for "404 Not Found" or - similar. Add the following line to the object in obj.conf for every - error page you want to overwrite: -Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value ini -key=value...] - - where XXX is the HTTP error code. Please delete any other Error - directives which could interfere with yours. If you want to place a - page for all errors that could exist, leave the code parameter out. - Your script can get the HTTP status code with $_SERVER['ERROR_TYPE']. - - Another possibility is to generate self-made directory listings. Just - create a PHP script which displays a directory listing and replace the - corresponding default Service line for - type="magnus-internal/directory" in obj.conf with the following: -Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scr -ipt.php" [inikey=value inikey=value...] - - For both error and directory listing pages the original URI and - translated URI are in the variables $_SERVER['PATH_INFO'] and - $_SERVER['PATH_TRANSLATED']. - _________________________________________________________________ - -Note about nsapi_virtual() and subrequests (PHP >= 4.3.3) - - The NSAPI module now supports the nsapi_virtual() function (alias: - virtual()) to make subrequests on the webserver and insert the result - in the webpage. The problem is, that this function uses some - undocumented features from the NSAPI library. - - Under Unix this is not a problem, because the module automatically - looks for the needed functions and uses them if available. If not, - nsapi_virtual() is disabled. - - Under Windows limitations in the DLL handling need the use of a - automatic detection of the most recent ns-httpdXX.dll file. This is - tested for servers till version 6.1. If a newer version of the Sun - server is used, the detection fails and nsapi_virtual() is disabled. - - If this is the case, try the following: Add the following parameter to - php4_init in magnus.conf/obj.conf: - Init fn=php4_init ... server_lib="ns-httpdXX.dll" - - where XX is the correct DLL version number. To get it, look in the - server-root for the correct DLL name. The DLL with the biggest - filesize is the right one. - - You can check the status by using the phpinfo() function. - - Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!! - _________________________________________________________________ - -OmniHTTPd Server - - This section contains notes and hints specific to OmniHTTPd on - Windows. - - Note: You should read the manual installation steps first! - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - You need to complete the following steps to make PHP work with - OmniHTTPd. This is a CGI executable setup. SAPI is supported by - OmniHTTPd, but some tests have shown that it is not so stable to use - PHP as an ISAPI module. - - Important for CGI users: Read the faq on cgi.force_redirect for - important details. This directive needs to be set to 0. - - 1. Install OmniHTTPd server. - 2. Right click on the blue OmniHTTPd icon in the system tray and - select Properties - 3. Click on Web Server Global Settings - 4. On the 'External' tab, enter: virtual = .php | actual = - c:\php\php.exe (use php-cgi.exe if installing PHP 5), and use the - Add button. - 5. On the Mime tab, enter: virtual = wwwserver/stdcgi | actual = - .php, and use the Add button. - 6. Click OK - - Repeat steps 2 - 6 for each extension you want to associate with PHP. - - Note: Some OmniHTTPd packages come with built in PHP support. You - can choose at setup time to do a custom setup, and uncheck the PHP - component. We recommend you to use the latest PHP binaries. Some - OmniHTTPd servers come with PHP 4 beta distributions, so you should - choose not to set up the built in support, but install your own. If - the server is already on your machine, use the Replace button in - Step 4 and 5 to set the new, correct information. - _________________________________________________________________ - -Sambar Server on Microsoft Windows - - This section contains notes and hints specific to the Sambar Server - for Windows. - - Note: You should read the manual installation steps first! - - This list describes how to set up the ISAPI module to work with the - Sambar server on Windows. - - * Find the file called mappings.ini (in the config directory) in the - Sambar install directory. - * Open mappings.ini and add the following line under [ISAPI]: - - Example 2-7. ISAPI configuration of Sambar -#for PHP 4 -*.php = c:\php\php4isapi.dll - -#for PHP 5 -*.php = c:\php\php5isapi.dll - - (This line assumes that PHP was installed in c:\php.) - * Now restart the Sambar server for the changes to take effect. - _________________________________________________________________ - -Xitami on Microsoft Windows - - This section contains notes and hints specific to Xitami on Windows. - - Note: You should read the manual installation steps first! - - This list describes how to set up the PHP CGI binary to work with - Xitami on Windows. - - Important for CGI users: Read the faq on cgi.force_redirect for - important details. This directive needs to be set to 0. If you want - to use $_SERVER['PHP_SELF'] you have to enable the cgi.fix_pathinfo - directive. - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - * Make sure the webserver is running, and point your browser to - xitamis admin console (usually http://127.0.0.1/admin), and click - on Configuration. - * Navigate to the Filters, and put the extension which PHP should - parse (i.e. .php) into the field File extensions (.xxx). - * In Filter command or script put the path and name of your PHP CGI - executable i.e. C:\php\php.exe for PHP 4, or C:\php\php-cgi.exe - for PHP 5. - * Press the 'Save' icon. - * Restart the server to reflect changes. - _________________________________________________________________ - -Installation of extensions on Windows - - After installing PHP and a webserver on Windows, you will probably - want to install some extensions for added functionality. You can - choose which extensions you would like to load when PHP starts by - modifying your php.ini. You can also load a module dynamically in your - script using dl(). - - The DLLs for PHP extensions are prefixed with php_. - - Note: In PHP 4.3.1 BCMath, Calendar, COM, Ctype, FTP, MySQL, ODBC, - Overload, PCRE, Session, Tokenizer, WDDX, XML and Zlib support is - built in. You don't need to load any additional extensions in order - to use these functions. See your distributions README.txt or - install.txt or this table for a list of built in modules. - - The default location PHP searches for extensions is c:\php4\extensions - in PHP 4 and c:\php5 in PHP 5. To change this setting to reflect your - setup of PHP edit your php.ini file: - - * You will need to change the extension_dir setting to point to the - directory where your extensions lives, or where you have placed - your php_*.dll files. Please do not forget the last backslash. For - example: - -extension_dir = c:/php/extensions/ - - * Enable the extension(s) in php.ini you want to use by uncommenting - the extension=php_*.dll lines in php.ini. This is done by deleting - the leading ; from the extension you want to load. - - Example 2-8. Enable Bzip2 extension for PHP-Windows -// change the following line from ... -;extension=php_bz2.dll - -// ... to -extension=php_bz2.dll - - * Some of the extensions need extra DLLs to work. Couple of them can - be found in the distribution package, in the C:\php\dlls\ folder - in PHP 4 or in the main folder in PHP 5, but some, for example - Oracle (php_oci8.dll) require DLLs which are not bundled with the - distribution package. If you are installing PHP 4, copy the - bundled DLLs from C:\php\dlls folder to the main C:\php folder. - Don't forget to include C:\php in the system PATH (this process is - explained in a separate FAQ entry). - * Some of these DLLs are not bundled with the PHP distribution. See - each extensions documentation page for details. Also, read the - manual section titled Installation of PECL extensions for details - on PECL. An increasingly large number of PHP extensions are found - in PECL, and these extensions require a separate download. - - Note: If you are running a server module version of PHP remember to - restart your webserver to reflect your changes to php.ini. - - The following table describes some of the extensions available and - required additional dlls. - - Table 2-1. PHP Extensions - Extension Description Notes - php_bz2.dll bzip2 compression functions None - php_calendar.dll Calendar conversion functions Built in since PHP - 4.0.3 - php_cpdf.dll ClibPDF functions None - php_crack.dll Crack functions None - php_ctype.dll ctype family functions Built in since PHP 4.3.0 - php_curl.dll CURL, Client URL library functions Requires: - libeay32.dll, ssleay32.dll (bundled) - php_cybercash.dll Cybercash payment functions PHP <= 4.2.0 - php_db.dll DBM functions Deprecated. Use DBA instead (php_dba.dll) - php_dba.dll DBA: DataBase (dbm-style) Abstraction layer functions None - php_dbase.dll dBase functions None - php_dbx.dll dbx functions - php_domxml.dll DOM XML functions PHP <= 4.2.0 requires: libxml2.dll - (bundled) PHP >= 4.3.0 requires: iconv.dll (bundled) - php_dotnet.dll .NET functions PHP <= 4.1.1 - php_exif.dll EXIF functions php_mbstring.dll. And, php_exif.dll must - be loaded after php_mbstring.dll in php.ini. - php_fbsql.dll FrontBase functions PHP <= 4.2.0 - php_fdf.dll FDF: Forms Data Format functions. Requires: fdftk.dll - (bundled) - php_filepro.dll filePro functions Read-only access - php_ftp.dll FTP functions Built-in since PHP 4.0.3 - php_gd.dll GD library image functions Removed in PHP 4.3.2. Also note - that truecolor functions are not available in GD1, instead, use - php_gd2.dll. - php_gd2.dll GD library image functions GD2 - php_gettext.dll Gettext functions PHP <= 4.2.0 requires - gnu_gettext.dll (bundled), PHP >= 4.2.3 requires libintl-1.dll, - iconv.dll (bundled). - php_hyperwave.dll HyperWave functions None - php_iconv.dll ICONV characterset conversion Requires: iconv-1.3.dll - (bundled), PHP >=4.2.1 iconv.dll - php_ifx.dll Informix functions Requires: Informix libraries - php_iisfunc.dll IIS management functions None - php_imap.dll IMAP POP3 and NNTP functions None - php_ingres.dll Ingres II functions Requires: Ingres II libraries - php_interbase.dll InterBase functions Requires: gds32.dll (bundled) - php_java.dll Java functions PHP <= 4.0.6 requires: jvm.dll (bundled) - php_ldap.dll LDAP functions PHP <= 4.2.0 requires libsasl.dll - (bundled), PHP >= 4.3.0 requires libeay32.dll, ssleay32.dll (bundled) - php_mbstring.dll Multi-Byte String functions None - php_mcrypt.dll Mcrypt Encryption functions Requires: libmcrypt.dll - php_mhash.dll Mhash functions PHP >= 4.3.0 requires: libmhash.dll - (bundled) - php_mime_magic.dll Mimetype functions Requires: magic.mime (bundled) - php_ming.dll Ming functions for Flash None - php_msql.dll mSQL functions Requires: msql.dll (bundled) - php_mssql.dll MSSQL functions Requires: ntwdblib.dll (bundled) - php_mysql.dll MySQL functions PHP >= 5.0.0, requires libmysql.dll - (bundled) - php_mysqli.dll MySQLi functions PHP >= 5.0.0, requires libmysql.dll - (libmysqli.dll in PHP <= 5.0.2) (bundled) - php_oci8.dll Oracle 8 functions Requires: Oracle 8.1+ client libraries - php_openssl.dll OpenSSL functions Requires: libeay32.dll (bundled) - php_oracle.dll Oracle functions Requires: Oracle 7 client libraries - php_overload.dll Object overloading functions Built in since PHP 4.3.0 - php_pdf.dll PDF functions None - php_pgsql.dll PostgreSQL functions None - php_printer.dll Printer functions None - php_shmop.dll Shared Memory functions None - php_snmp.dll SNMP get and walk functions NT only! - php_soap.dll SOAP functions PHP >= 5.0.0 - php_sockets.dll Socket functions None - php_sybase_ct.dll Sybase functions Requires: Sybase client libraries - php_tidy.dll Tidy functions PHP >= 5.0.0 - php_tokenizer.dll Tokenizer functions Built in since PHP 4.3.0 - php_w32api.dll W32api functions None - php_xmlrpc.dll XML-RPC functions PHP >= 4.2.1 requires: iconv.dll - (bundled) - php_xslt.dll XSLT functions PHP <= 4.2.0 requires sablot.dll, - expat.dll (bundled). PHP >= 4.2.1 requires sablot.dll, expat.dll, - iconv.dll (bundled). - php_yaz.dll YAZ functions Requires: yaz.dll (bundled) - php_zip.dll Zip File functions Read only access - php_zlib.dll ZLib compression functions Built in since PHP 4.3.0 - _________________________________________________________________ - -Chapter 3. Installation of PECL extensions - -Introduction to PECL Installations - - PHP extensions may be installed in a variety of ways. PECL is a - repository of PHP extensions living within the PEAR structure, and the - following demonstrates how to install these extensions. - - These instructions assume /your/phpsrcdir/ is the path to the PHP - source, and extname is the name of the PECL extension. Adjust - accordingly. These instructions also assume a familiarity with the - pear command. - - Shared extensions may be installed by including them inside of php.ini - using the extension PHP directive. See also the extensions_dir - directive, and dl(). The installation methods described below do not - automatically configure PHP to include these extensions, this step - must be done manually. - - When building PHP modules, it's important to have the appropriate - versions of the required tools (autoconf, automake, libtool, etc.) See - the Anonymous CVS Instructions for details on the required tools, and - required versions. - _________________________________________________________________ - -Downloading PECL extensions - - There are several options for downloading PECL extensions, such as: - - * http://pecl.php.net - Listed here is information like the ChangeLog, release - information, requirements, revisions, etc. Although not every PECL - extension has a webpage, most do. - * pear download extname - The pear command may also be used to download source files. - Specific revisions may also be specified. - * CVS - All PECL files reside in CVS. A web-based view may be seen at - http://cvs.php.net/pecl/. To download straight from CVS, consider - the following where phpfi is the password for user cvsread: - -$ cvs -d:pserver:cvsread@cvs.php.net:/repository login -$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname - - * Windows downloads - Windows users may find compiled PECL binaries by downloading the - Collection of PECL modules from the PHP Downloads page, and by - retrieving a PECL Snapshot. To compile PHP under Windows, read the - Win32 Build README. - _________________________________________________________________ - -PECL for Windows users - - Like with any other PHP extension DLL, to install move the PECL - extension DLLs into the extension_dir folder and include them within - php.ini. For example: - - extension=php_extname.dll - - After doing this, restart the web server. - _________________________________________________________________ - -Compiling shared PECL extensions with PEAR - - PEAR makes it easy to create shared PHP extensions. Using the pear - command, do the following: - - $ pear install extname - - That will download the source for extname, and compile it on the - system. This results in an extname.so file that may then be included - in php.ini - - In case the systems preferred_state is set higher than an available - extname version, like it's set to stable and the extension is still in - beta, either alter the preferred_state via pear config-set or specify - a specific version of the PECL extension. For example: - - $ pear install extname-0.1.1 - - Regardless, pear will copy this extname.so into the extensions - directory. Adjust php.ini accordingly. - _________________________________________________________________ - -Compiling shared PECL extensions with phpize - - If using pear is not an option, like for building shared PECL - extensions from CVS, or for unreleased PECL packages, then creating a - shared extension may also be done by manually using the phpize - command. The pear command essentially does this but it may also be - done manually. Assuming the source file is named extname.tgz, and that - it was downloaded into the current directory, consider the following: - -$ pear download extname -$ gzip -d < extname.tgz | tar -xvf - -$ cd extname -$ phpize -$ ./configure && make - - Upon success, this will create extname.so and put it into the modules/ - and/or .libs/ directory within the extname/ source. Move this shared - extension (extname.so) into the PHP extensions directory, and adjust - php.ini accordingly. - _________________________________________________________________ - -Compiling PECL extensions statically into PHP - - To statically include the extension within the PHP build, put the - extensions source into the ext/ directory found in the PHP source. For - example: - -$ cd /your/phpsrcdir/ext -$ pear download extname -$ gzip -d < extname.tgz | tar -xvf - -$ mv extname-x.x.x extname -$ rm package.xml - - This will result in the following directory: - - /your/phpsrcdir/ext/extname - - From here, build PHP as normal: - -$ cd /your/phpsrcdir -$ ./buildconf -$ ./configure --help -$ ./configure --with-extname --enable-someotherext --with-foobar -$ make -$ make install - - Whether --enable-extname or --with-extname is used depends on the - extension. Typically an extension that does not require external - libraries uses --enable. To be sure, run the following after - buildconf: - - $ ./configure --help | grep extname - _________________________________________________________________ - -Chapter 4. Problems? - -Read the FAQ - - Some problems are more common than others. The most common ones are - listed in the PHP FAQ, part of this manual. - _________________________________________________________________ - -Other problems - - If you are still stuck, someone on the PHP installation mailing list - may be able to help you. You should check out the archive first, in - case someone already answered someone else who had the same problem as - you. The archives are available from the support page on - http://www.php.net/support.php. To subscribe to the PHP installation - mailing list, send an empty mail to - php-install-subscribe@lists.php.net. The mailing list address is - php-install@lists.php.net. - - If you want to get help on the mailing list, please try to be precise - and give the necessary details about your environment (which operating - system, what PHP version, what web server, if you are running PHP as - CGI or a server module, safe mode, etc...), and preferably enough code - to make others able to reproduce and test your problem. - _________________________________________________________________ - -Bug reports - - If you think you have found a bug in PHP, please report it. The PHP - developers probably don't know about it, and unless you report it, - chances are it won't be fixed. You can report bugs using the - bug-tracking system at http://bugs.php.net/. Please do not send bug - reports in mailing list or personal letters. The bug system is also - suitable to submit feature requests. - - Read the How to report a bug document before submitting any bug - reports! - _________________________________________________________________ - -Chapter 5. Runtime Configuration - -The configuration file - - The configuration file (called php3.ini in PHP 3, and simply php.ini - as of PHP 4) is read when PHP starts up. For the server module - versions of PHP, this happens only once when the web server is - started. For the CGI and CLI version, it happens on every invocation. - - The default location of php.ini is a compile time option (see the FAQ - entry), but can be changed for the CGI and CLI version with the -c - command line switch, see the chapter about using PHP from the command - line. You can also use the environment variable PHPRC for an - additional path to search for a php.ini file. - - If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is - e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. - - Note: The Apache web server changes the directory to root at - startup causing PHP to attempt to read php.ini from the root - filesystem if it exists. - - The php.ini directives handled by extensions are documented - respectively on the pages of the extensions themselves. The list of - the core directives is available in the appendix. Probably not all the - PHP directives are documented in the manual though. For a completel - list of directives available in your PHP version, please read your - well commented php.ini file. Alternatively, you may find the the - latest php.ini from CVS helpful too. - - Example 5-1. php.ini example -; any text on a line after an unquoted semicolon (;) is ignored -[php] ; section markers (text within square brackets) are also ignored -; Boolean values can be set to either: -; true, on, yes -; or false, off, no, none -register_globals = off -track_errors = yes - -; you can enclose strings in double-quotes -include_path = ".:/usr/local/lib/php" - -; backslashes are treated the same as any other character -include_path = ".;c:\php\lib" - _________________________________________________________________ - -How to change configuration settings - -Running PHP as an Apache module - - When using PHP as an Apache module, you can also change the - configuration settings using directives in Apache configuration files - (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride - Options" or "AllowOverride All" privileges to do so. - - With PHP 4 and PHP 5, there are several Apache directives that allow - you to change the PHP configuration from within the Apache - configuration files. For a listing of which directives are - PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the - List of php.ini directives appendix. - - Note: With PHP 3, there are Apache directives that correspond to - each configuration setting in the php3.ini name, except the name is - prefixed by "php3_". - - php_value name value - Sets the value of the specified directive. Can be used only - with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a - previously set value use none as the value. - - Note: Don't use php_value to set boolean values. php_flag (see - below) should be used instead. - - php_flag name on|off - Used to set a boolean configuration directive. Can be used only - with PHP_INI_ALL and PHP_INI_PERDIR type directives. - - php_admin_value name value - Sets the value of the specified directive. This can not be used - in .htaccess files. Any directive type set with php_admin_value - can not be overridden by .htaccess or virtualhost directives. - To clear a previously set value use none as the value. - - php_admin_flag name on|off - Used to set a boolean configuration directive. This can not be - used in .htaccess files. Any directive type set with - php_admin_flag can not be overridden by .htaccess or - virtualhost directives. - - Example 5-2. Apache configuration example - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php3_include_path ".:/usr/local/lib/php" - php3_safe_mode on - - - Caution - - PHP constants do not exist outside of PHP. For example, in httpd.conf - you can not use PHP constants such as E_ALL or E_NOTICE to set the - error_reporting directive as they will have no meaning and will - evaluate to 0. Use the associated bitmask values instead. These - constants can be used in php.ini - _________________________________________________________________ - -Changing PHP configuration via the Windows registry - - When running PHP on Windows, the configuration values can be modified - on a per-directory basis using the Windows registry. The configuration - values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory - Values, in the sub-keys corresponding to the path names. For example, - configuration values for the directory c:\inetpub\wwwroot would be - stored in the key HKLM\SOFTWARE\PHP\Per Directory - Values\c\inetpub\wwwroot. The settings for the directory would be - active for any script running from this directory or any subdirectory - of it. The values under the key should have the name of the PHP - configuration directive and the string value. PHP constants in the - values are not parsed. However, only configuration values changeable - in PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not. - _________________________________________________________________ - -Other interfaces to PHP - - Regardless of how you run PHP, you can change certain values at - runtime of your scripts through ini_set(). See the documentation on - the ini_set() page for more information. - - If you are interested in a complete list of configuration settings on - your system with their current values, you can execute the phpinfo() - function, and review the resulting page. You can also access the - values of individual configuration directives at runtime using - ini_get() or get_cfg_var(). diff --git a/win32/installer/README b/win32/installer/README deleted file mode 100644 index 0879497db5493..0000000000000 --- a/win32/installer/README +++ /dev/null @@ -1,93 +0,0 @@ -PHP Installer for Win32, by Wez Furlong -============================================================== -$Id$ - -Here are the supporting scripts for building the win32 PHP installer. - -Requirements: - - MSI-2-XML from http://msi2xml.sourceforge.net/#Installation - - -Installer Layout: - -We have the following features: - - o PHP Core - Always installed. - Includes php5ts.dll, php.ini + common dlls - and config files - - o SAPI - Contains a node for each stable SAPI - - o Extensions - Contains a node for each stable extension - - o Experimental - o SAPI Experimental SAPIs - o Extensions Experimental Extensions - - - - - - - - -You need to have the Super-Pimp Installer from Nullsoft (Open Source). -It is available here: - http://nsis.sourceforge.net/ - -To build an installer, you need: - - o A Source Tree - o A win32 snapshot (extracted from the .zip) - - (The source tree and snapshot should have matching versions!) - -A Script/Batch file. -I'm using this (in a .bat file): - ----------------------------------------------------------------- -cd -cli\php \win32\installer\gen-nsis.php > php.nsi -"C:\Program Files\NSIS\makensis" /pause /nocd php.nsi ----------------------------------------------------------------- - - ** It is a good idea to examine the php.nsi file for WARNING - ** comments. These indicate inconsistencies about your source - ** tree structure. - -This will generate InstallPHP.exe, where is the version of -the php in the snapshot. The Installer will be placed in the snapshot root. - -Installer Concept -================= - -Maintaining installers is a real chore, so we use PHP to generate as much as -possible. - -The gen-nsis.php script will examine the extensions dir from the snapshot and -then attempt to extract information about the extensions from the source code. -The sapi dir is subjected to similar treatment. - -Throughout the installation, values for php.ini settings are decided; these are -appended to a temporary file. After everything has been installed, the -iniset.php script is run and merges the values from the temporary file into the -"official" php.ini. - -These scripts take advantage of features found in PHP 4.3.0 and later, so you -can't build a PHP 4.2.x distro with it. - -Hacking -======= - -While hacking, it's a good idea to comment out the SetCompressor line; it will -speed up your installer builds... -Also, switch the logic for the $SYSDIR define at the top to install vital DLLs -to a fake system dir. - - - -vim:et:tw=78 - diff --git a/win32/installer/gen-nsis.php b/win32/installer/gen-nsis.php deleted file mode 100644 index da94264c9edbc..0000000000000 --- a/win32/installer/gen-nsis.php +++ /dev/null @@ -1,446 +0,0 @@ -; PHP Installer for NSIS -; Based on Welcome/Finish Page Example Script (Written by Joost Verburg) -; Author: Wez Furlong -; $Id$ - array( - "label" => "-PHP Core (Required)", - "files" => array( - "$SYSDIR" => array( - "dlls\\*.dll", - "php5ts.dll", - ), - "\$INSTDIR" => array( - "*.txt", - "php.gif", - "php.ini-*", - ), - ), - "extras" => "Call CopyPHPIni\nWriteUninstaller \"\$INSTDIR\\Uninstall.exe\"" - ), - - "cgi" => array( - "group" => "SAPI", - "label" => "CGI", - "description" => "CGI Interface - should work with most web servers", - "files" => array( - "\$INSTDIR" => array( - "php.exe" - ), - "\$INSTDIR\\sapi" => array( - "sapi\\pws-php5cgi.reg" - ), - ), - ), - - /* CLI is required by the installer */ - "cli" => array( - "group" => "SAPI", - "label" => "-CLI", - "description" => "Command Line Interface for running PHP scripts as batch files", - "files" => array( - "\$INSTDIR\\cli" => array( - "cli\\php.exe" - ), - ), - ), - - "embed" => array( - "group" => "SAPI", - "label" => "Embed", - "description" => "Libraries for embedding PHP into your own projects", - "files" => array( - "\$INSTDIR" => array( - "*.lib" - ), - ), - ), - - "mibs" => array( - "group" => "Extras", - "label" => "MIBS for SNMP", - "description" => "MIB information for the SNMP extension", - "files" => array( - "\$INSTDIR\\mibs" => array( - "mibs\\*" - ), - ), - ), - - "pdfstuff" => array( - "group" => "Extras", - "label" => "PDF support files", - "description" => "Fonts and codepage data files for the PDF extensions", - "files" => array( - "\$INSTDIR\\pdf-related" => array( - "pdf-related\\*" - ), - ), - ), - - "mimemagic" => array( - "group" => "Extras", - "label" => "Mime Magic", - "description" => "The magic information file for the mimemagic extension", - "files" => array( - "\$INSTDIR" => array( - "magic.mime" - ), - ), - ), - - "openssl" => array( - "group" => "Extras", - "label" => "OpenSSL", - "description" => "OpenSSL configuration information which you must read if you plan to use PHP as a Certificate Authority", - "files" => array( - "\$INSTDIR\\openssl" => array( - "openssl\\*" - ), - ), - ), - - - -); - -$groups = array( - 'SAPI' => array("SAPI", "Select which Server API's to install."), - 'EXT' => array("Extensions", "Select which extensions to install."), - 'XSAPI' => array("Experimental SAPI", "Experimental Server API's - use at your own risk!"), - 'XEXT' => array("Experimental Extensions", "Experimental Extensions - use at your own risk!"), - 'Extras' => array("Extras", "Supplemental Files"), - ); - -function xglob($pattern) -{ - if (strpos($pattern, '*') === false) { - return array($pattern); - } - $dir = dirname($pattern); - $pattern = basename($pattern); - - $pattern = str_replace(array('*', '.'), array('.*', '\.'), $pattern); - - $files = array(); - - $d = opendir($dir); - while ($f = readdir($d)) { - if ($f == '.' || $f == '..' || preg_match('/^\..*\.swp$/', $f)) - continue; - if (preg_match('@' . $pattern . '@i', $f)) { - $files[] = $dir . '\\' . $f; - } - } - - return $files; -} - -/* Look for extensions and determine their info based on the source tree. - * We can determine the name and author from the CREDITS file. - * We can determine experimental status from the EXPERIMENTAL file. - * It would be nice to have a standard description line in the CREDITS too. - */ -$extension_abbreviations = array( - 'ifx' => 'informix', - 'gd2' => 'gd', - ); - -$sapi_abbreviations = array( - 'apache2' => 'apache2filter', - 'srvlt' => 'servlet', -); - -function add_sections($pattern, $groupname, $abbrev, &$sections, $sourcedirs, $instdir) -{ - $avail = xglob($pattern); - - foreach ($avail as $extname) { - /* mangle name */ - if (preg_match('/(php_|php5|php)([^_].*)\.dll/', basename($extname), $matches)) { - $ext = $matches[2]; - } else { - $ext = basename($extname); - } - - if (isset($abbrev[$ext])) { - $ext = $abbrev[$ext]; - } - - $extdir = null; - - foreach ($sourcedirs as $sourcedir) { - // Allow absolute path for separate PECL checkout - if ($sourcedir{0} == '\\' || $sourcedir{1} == ':') - $extdir = $sourcedir; - else - $extdir = SOURCEDIR . $sourcedir . '/' . $ext . '/'; - - if (is_dir($extdir)) - break; - - $extdir = null; - } - - if ($extdir === null || !is_dir($extdir)) { - echo "; WARNING: could not find source dir for extension $extname -> $extdir ($ext)\n"; - } - - $exp = file_exists($extdir . 'EXPERIMENTAL'); - if (file_exists($extdir . 'CREDITS')) { - list($title, $authors, $description) = file($extdir . 'CREDITS'); - $title = trim($title); - $authors = trim($authors); - $description = trim($description); - - if (strlen($title) == 0) - $title = $ext; - - } else { - $title = $ext; - $authors = "Unknown, or uncredited"; - $description = ""; - } - - /* build list of support files. - * in theory, only needed for the srvlt sapi, but useful to keep this - * generic */ - $filepat = preg_replace('/\.[^\.]+$/', '.*', $extname); - - if ($groupname == 'EXT') { - } - - $sections['ext_' . $ext] = array( - 'group' => ($exp ? 'X' : '') . $groupname, - 'label' => $title, - 'description' => $title . ".\$\\nAuthors: $authors", - 'files' => array( - "\$INSTDIR\\" . $instdir => array( - $filepat - ), - ), -/* 'extras' => $groupname == 'EXT' ? "Push \"extension=" . basename($extname) . "\"\nCall AddIniSetting\n\n" : "" */ - ); - - } - - -} - -add_sections('extensions\\*.dll', 'EXT', $extension_abbreviations, $sections, array('ext'), 'extensions'); -add_sections('sapi\\*.dll', 'SAPI', $sapi_abbreviations, $sections, array('sapi'), 'sapi'); - - - - - -$SECTIONS = ""; -$sections_stage1 = array(); - -/* list of files to uninstall */ -$uninstall = array(); -$rmdirs = array(); -/* description texts */ -$descriptions = array(); - -$dirs_no_delete = array("\$SYSDIR", "\$INSTDIR"); - -foreach ($sections as $sectionid => $sectiondata) { - $descriptions[] = "\t!insertmacro MUI_DESCRIPTION_TEXT \${Sec$sectionid} \"" . $sectiondata['description'] . "\""; - - if (isset($sectiondata['group'])) { - $sub = "Sub"; - $group = $sectiondata['group']; - } else { - $sub = ""; - $group = '_top_'; - } - - $body = "Section \"" . $sectiondata['label'] . "\" Sec$sectionid\n"; - - foreach ($sectiondata['files'] as $outputdir => $filelist) { - $body .= "\tSetOutPath \"$outputdir\"\n"; - foreach ($filelist as $pattern) { - $files = xglob($pattern); - foreach ($files as $filename) { - $uninstall[] = "\tDelete \"$outputdir\\" . basename($filename) . "\""; - - $body .= "\tFile \"$filename\"\n"; - } - } - if (!in_array($outputdir, $dirs_no_delete) && !isset($rmdirs[$outputdir])) { - $rmdirs[$outputdir] = "\tRMDir \"$outputdir\""; - } - } - - $body .= $sectiondata['extras']; - - $body .= "\nSectionEnd\n"; - - $sections_stage1[$group] .= $body . "\n\n"; -} - -foreach ($sections_stage1 as $group => $data) -{ - if ($group == '_top_') { - $SECTIONS .= $data . "\n"; - } else { - $descriptions[] = "\t!insertmacro MUI_DESCRIPTION_TEXT \${SecGroup$group} \"" . $groups[$group][1] . "\""; - $SECTIONS .= "SubSection /e \"" . $groups[$group][0] . "\" SecGroup$group\n$data\nSubSectionEnd\n\n"; - } -} - -/* Now build descriptions */ -$DESCRIPTIONS = implode("\n", $descriptions) . "\n"; - -/* And the uninstallation section */ -$UNINSTALL = implode("\n", $uninstall) . "\n" . implode("\n", $rmdirs) . "\n"; - -?> - -!define MUI_PRODUCT "PHP - Hypertext Preprocessor" -!define MUI_VERSION "" -; The second UI has a wider area for the component names -!define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe" - -!include "${NSISDIR}\Contrib\Modern UI\System.nsh" - -;-------------------------------- -;Configuration - -!define MUI_WELCOMEPAGE -!define MUI_LICENSEPAGE -!define MUI_COMPONENTSPAGE -!define MUI_DIRECTORYPAGE - -!define MUI_FINISHPAGE -;!define MUI_FINISHPAGE_RUN "$INSTDIR\modern.exe" - -!define MUI_ABORTWARNING - -!define MUI_UNINSTALLER -!define MUI_UNCONFIRMPAGE - -;Language -!insertmacro MUI_LANGUAGE "English" - -;General -OutFile "InstallPHP.exe" - -SetCompressor bzip2 -ShowInstDetails show -;License page -LicenseData "license.txt" - -;Folder-selection page -InstallDir "C:\PHP-" -;define NSIS_CONFIG_LOG "install.log" -;LogSet on - -!cd win32\installer - -;Things that need to be extracted on startup (keep these lines before any File command!) -;Only useful for BZIP2 compression -;Use ReserveFile for your own Install Options ini files too! -!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS -!insertmacro MUI_RESERVEFILE_SPECIALINI -!insertmacro MUI_RESERVEFILE_SPECIALBITMAP - -!cd - -!insertmacro MUI_SYSTEM - - -;-------------------------------- -;Installer Sections - -Function AddIniSetting - Pop $R0 - - FileOpen $R2 "$INSTDIR\.ini-add" "a" - FileSeek $R2 0 END - FileWrite $R2 "$R0$\n" - FileClose $R2 - -FunctionEnd - -Function CopyPHPIni - ; Ensure that we have a working php.ini to reflect the - ; installation options. - ; Extensions will call a function to activate their entry - ; in the ini file as they are installed. - - Rename "$WINDIR\php.ini" "$WINDIR\php.ini.old" - CopyFiles "$INSTDIR\php.ini-dist" "$WINDIR\php.ini" - -; These files will be deleted during post-installation - CopyFiles "\php5ts.dll" "$INSTDIR\php5ts.dll" - File "\setini.php" - -; Set the extension_dir setting in the php.ini - Push "extension_dir=$\"$INSTDIR\extensions$\"" - Call AddIniSetting - -FunctionEnd - -; Generated Section Info - -; --------- - -; Perform final actions after everything has been installed -Section -post - ; Merge ini settings - - Sleep 1000 - - ExecWait "$\"$INSTDIR\cli\php.exe$\" $\"-n$\" $\"$INSTDIR\setini.php$\" $\"$WINDIR\php.ini$\" $\"$INSTDIR\.ini-add$\"" - - Delete "$INSTDIR\.ini-add" ; Created by the AddIniSetting function - Delete "$INSTDIR\setini.php" - Delete "$INSTDIR\php5ts.dll" - - ; Add to Add/Remove programs list - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-" "UninstallString" "$INSTDIR\Uninstall.exe" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-" "DisplayName" "PHP- (Uninstall only)" - - -SectionEnd - -;-------------------------------- -;Descriptions - -!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN - -!insertmacro MUI_FUNCTIONS_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - - Delete "$INSTDIR\Uninstall.exe" - Delete "$WINDIR\php.ini" - RMDir "$INSTDIR" - ; Remove from Add/Remove programs list - DeleteRegKey /ifempty HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-" - - !insertmacro MUI_UNFINISHHEADER - -SectionEnd -; vim:sw=4:ts=4: -; vim600:sw=4:ts=4:noet:fdm=marker diff --git a/win32/installer/setini.php b/win32/installer/setini.php deleted file mode 100644 index cdcb65fc07b85..0000000000000 --- a/win32/installer/setini.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * Set options in a php.ini file. - * This is a support script for the installer. - * - * $argv[1] is the path to the ini file - * $argv[2] is the path to the option file - */ - -echo "Running post-installation script to configure php.ini\n"; - -function fatal($msg) -{ - echo $msg; - sleep(5); - exit(1); -} - -$ini_name = $argv[1]; -$option_file = $argv[2]; - -if (!file_exists($option_file)) { - fatal("Option file $option_file does not exist"); -} - -if (!file_exists($ini_name)) { - fatal("inifile $ini_name does not exist"); -} - -$options = explode("\n", file_get_contents($option_file)); -$opts = array(); - -/* Parse the options */ -foreach ($options as $line) { - if (strlen(trim($line)) == 0) - continue; - - list($name, $value) = explode("=", $line); - - if ($name == "extension") { - $pat = "/^;?extension\s*=\s*" . preg_quote($value, '/') . "/i"; - } else { - $pat = "/^;?" . preg_quote($name, '/') . "\s*=\s*/i"; - } - - $opts[] = array('pat' => $pat, 'name' => $name, 'value' => $value); -} - -$new_name = $ini_name . "~"; -$dest = fopen($new_name, "w"); - -if (!$dest) { - echo "Could not create temporary file! $new_name\n"; - flush(); - sleep(10); - die("Cannot create temporary file!"); -} - -$lines = file($ini_name); - -foreach ($lines as $line) { - - foreach ($opts as $k => $optdata) { - extract($optdata); - - if (preg_match($pat, $line)) { - echo "Found $pat ; setting $name to $value\n"; - $line = "$name=$value\r\n"; - // No need to match again - unset($opts[$k]); - break; - } - } - - fwrite($dest, $line); -} - -fclose($dest); - -unlink($ini_name); -rename($new_name, $ini_name); - -echo "All done!\n"; -sleep(1); -?> diff --git a/win32/md5crypt.c b/win32/md5crypt.c deleted file mode 100644 index 8411e0b6c7006..0000000000000 --- a/win32/md5crypt.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - * - * from FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp - * via OpenBSD: md5crypt.c,v 1.9 1997/07/23 20:58:27 kstailey Exp - * via NetBSD: md5crypt.c,v 1.4.2.1 2002/01/22 19:31:59 he Exp - * - */ - -#include "php.h" -#include "ext/standard/md5.h" -#include "md5crypt.h" - -static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - -static void to64(char *, php_uint32, int); - -static void -to64(char *s, php_uint32 v, int n) -{ - - while (--n >= 0) { - *s++ = itoa64[v & 0x3f]; - v >>= 6; - } -} - -/* - * MD5 password encryption. - */ -char * -md5_crypt(const char *pw, const char *salt) -{ - static char passwd[120], *p; - const char *sp, *ep; - unsigned char final[16]; - unsigned int i, sl, pwl; - PHP_MD5_CTX ctx, ctx1; - php_uint32 l; - int pl; - - pwl = strlen(pw); - - /* Refine the salt first */ - sp = salt; - - /* If it starts with the magic string, then skip that */ - if (strncmp(sp, MD5_MAGIC, MD5_MAGIC_LEN) == 0) - sp += MD5_MAGIC_LEN; - - /* It stops at the first '$', max 8 chars */ - for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++) - continue; - - /* get the length of the true salt */ - sl = ep - sp; - - PHP_MD5Init(&ctx); - - /* The password first, since that is what is most unknown */ - PHP_MD5Update(&ctx, (const unsigned char *)pw, pwl); - - /* Then our magic string */ - PHP_MD5Update(&ctx, (const unsigned char *)MD5_MAGIC, MD5_MAGIC_LEN); - - /* Then the raw salt */ - PHP_MD5Update(&ctx, (const unsigned char *)sp, sl); - - /* Then just as many characters of the MD5(pw,salt,pw) */ - PHP_MD5Init(&ctx1); - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl); - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - PHP_MD5Final(final, &ctx1); - - for (pl = pwl; pl > 0; pl -= 16) - PHP_MD5Update(&ctx, final, (unsigned int)(pl > 16 ? 16 : pl)); - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - - /* Then something really weird... */ - for (i = pwl; i != 0; i >>= 1) - if ((i & 1) != 0) - PHP_MD5Update(&ctx, final, 1); - else - PHP_MD5Update(&ctx, (const unsigned char *)pw, 1); - - /* Now make the output string */ - memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); - strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1); - strcat(passwd, "$"); - - PHP_MD5Final(final, &ctx); - - /* - * And now, just to make sure things don't run too fast. On a 60 MHz - * Pentium this takes 34 msec, so you would need 30 seconds to build - * a 1000 entry dictionary... - */ - for (i = 0; i < 1000; i++) { - PHP_MD5Init(&ctx1); - - if ((i & 1) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - else - PHP_MD5Update(&ctx1, final, 16); - - if ((i % 3) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl); - - if ((i % 7) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - - if ((i & 1) != 0) - PHP_MD5Update(&ctx1, final, 16); - else - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - - PHP_MD5Final(final, &ctx1); - } - - p = passwd + sl + MD5_MAGIC_LEN + 1; - - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4; - l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4; - l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4; - l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4; - l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4; - l = final[11] ; to64(p,l,2); p += 2; - *p = '\0'; - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - return (passwd); -} - diff --git a/win32/md5crypt.h b/win32/md5crypt.h deleted file mode 100644 index f177580a2f921..0000000000000 --- a/win32/md5crypt.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Edin Kadribasic | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ -#ifndef _MD5CRYPT_H_ -#define _MD5CRYPT_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define MD5_MAGIC "$1$" -#define MD5_MAGIC_LEN 3 - -char *md5_crypt(const char *pw, const char *salt); - -#ifdef __cplusplus -} -#endif - -#endif /* _MD5CRYPT_H_ */ \ No newline at end of file diff --git a/win32/param.h b/win32/param.h deleted file mode 100644 index 3d0da1e8d3bc8..0000000000000 --- a/win32/param.h +++ /dev/null @@ -1,16 +0,0 @@ - -/***************************************************************************** - * * - * sys/param.c * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * * - *****************************************************************************/ -#ifndef MAXPATHLEN -#define MAXPATHLEN _MAX_PATH -#endif -#define MAXHOSTNAMELEN 64 -#define howmany(x,y) (((x)+((y)-1))/(y)) -#define roundup(x,y) ((((x)+((y)-1))/(y))*(y)) diff --git a/win32/php5.dsp b/win32/php5.dsp deleted file mode 100644 index 0b5b9a6d6b0d1..0000000000000 --- a/win32/php5.dsp +++ /dev/null @@ -1,134 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5 - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5.mak" CFG="php5 - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5 - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "php5 - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "php5 - Win32 Release_inline" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release" -# PROP Intermediate_Dir "..\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release" - -!ELSEIF "$(CFG)" == "php5 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi" -# PROP Intermediate_Dir "..\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"c:\php-fcgi\php.exe" /pdbtype:sept /libpath:"..\Debug" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5 - Win32 Release_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5___Win32_Release_inline" -# PROP BASE Intermediate_Dir "php5___Win32_Release_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_inline" -# PROP Intermediate_Dir "..\Release_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex\\" /I "..\bindlib_w32" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release\php.exe" /libpath:"Release" -# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release_inline" - -!ENDIF - -# Begin Target - -# Name "php5 - Win32 Release" -# Name "php5 - Win32 Debug" -# Name "php5 - Win32 Release_inline" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cgi\cgi_main.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\getopt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# End Group -# End Target -# End Project diff --git a/win32/php5.dsw b/win32/php5.dsw deleted file mode 100644 index d6efc98ee2398..0000000000000 --- a/win32/php5.dsw +++ /dev/null @@ -1,107 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "fastcgi"=..\sapi\fastcgi\fastcgi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency -}}} - -############################################################################### - -Project: "php5"=.\php5.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "php5dll"=.\php5dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmysql - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php5dll.dsp b/win32/php5dll.dsp deleted file mode 100644 index 891a0438f00d7..0000000000000 --- a/win32/php5dll.dsp +++ /dev/null @@ -1,1679 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5dll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5dll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5dll.mak" CFG="php5dll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dll - Win32 Release_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi\" -# PROP Intermediate_Dir "..\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib TSRM.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"c:\php-fcgi\php5nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release" -# PROP Intermediate_Dir "..\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib tsrm.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release" /libpath:"..\TSRM\Release_TS" /libpath:"..\..\bindlib_w32\Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dll___Win32_Release_inline" -# PROP BASE Intermediate_Dir "php5dll___Win32_Release_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_inline" -# PROP Intermediate_Dir "..\Release_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D ZEND_DEBUG=0 /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php5nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib tsrm.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release_inline" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "php5dll - Win32 Debug" -# Name "php5dll - Win32 Release" -# Name "php5dll - Win32 Release_inline" -# Begin Group "Core" - -# PROP Default_Filter "" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\css.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.c -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.c" -# End Source File -# Begin Source File - -SOURCE=..\main\internal_functions_win32.c -# End Source File -# Begin Source File - -SOURCE=..\main\main.c -# End Source File -# Begin Source File - -SOURCE=..\main\mergesort.c -# End Source File -# Begin Source File - -SOURCE=..\main\network.c -# End Source File -# Begin Source File - -SOURCE=..\main\output.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\proc_open.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.c -# End Source File -# Begin Source File - -SOURCE=..\main\reentrancy.c -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.c -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.c -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.c -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\memory_streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\user_streams.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filters.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\user_filters.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcat.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcpy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\config.w32.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\css.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.h -# End Source File -# Begin Source File - -SOURCE=..\main\getopt.h -# End Source File -# Begin Source File - -SOURCE=..\main\logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\main.h -# End Source File -# Begin Source File - -SOURCE=..\main\output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php.h -# End Source File -# Begin Source File - -SOURCE=..\main\php3_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_globals.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_realpath.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.h -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.h -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.h -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.h -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\win95nt.h -# End Source File -# End Group -# End Group -# Begin Group "Function Modules" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\array.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\assert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\base64.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\bcmath.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\browscap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\credits.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dir.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filestat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\formatted_print.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\ftp_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\image.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\incomplete_class.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\iptc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\lcg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\levenshtein.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\link.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mail.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\math.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\metaphone.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\microtime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_files.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pack.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\rand.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\session.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\soundex.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\string.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\strnatcmp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\syslog.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var_unserializer.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\versioning.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\base64.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.h -# End Source File -# Begin Source File - -SOURCE=..\functions\global.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\php_bcmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_dir.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_filestat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrappers.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ldap\php_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_mail.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_metaphone.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_string.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_syslog.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpdir.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.h -# End Source File -# End Group -# Begin Group "Regular Expressions" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\regex\regcomp.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regerror.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regexec.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regfree.c -# End Source File -# End Group -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 3" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\chartables.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\get.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\maketables.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\study.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 3" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\internal.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.h -# End Source File -# End Group -# End Group -# Begin Group "XML" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 4" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ctype\ctype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\overload\overload.c -# End Source File -# Begin Source File - -SOURCE=..\ext\tokenizer\tokenizer.c -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\wddx.c -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\compat.c - -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\xml.c -# End Source File -# End Group -# Begin Group "Header Files No. 4" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\xml\php_xml.h -# End Source File -# End Group -# End Group -# Begin Group "FTP" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 6" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.c -# End Source File -# End Group -# Begin Group "Header Files No. 6" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.h -# End Source File -# End Group -# End Group -# Begin Group "Calendar" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 7" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\calendar\cal_unix.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\calendar.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\dow.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\easter.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\french.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\gregor.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\jewish.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\julian.c -# End Source File -# End Group -# Begin Group "Header Files No. 7" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\calendar\php_calendar.h -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\sdncal.h -# End Source File -# End Group -# End Group -# Begin Group "bcmath" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 8" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\add.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\compare.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\debug.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\div.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\divmod.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\init.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\int2num.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\neg.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2long.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2str.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\output.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raise.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\recmul.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rt.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\str2num.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sub.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\zero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 8" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\config.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\private.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com\COM.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com\conversion.c -# End Source File -# Begin Source File - -SOURCE=..\win32\pwd.c -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.c -# End Source File -# Begin Source File - -SOURCE=..\win32\registry.c -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.c -# End Source File -# Begin Source File - -SOURCE=..\win32\time.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com\VARIANT.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.c -# End Source File -# Begin Source File - -SOURCE=..\ext\snmp\winsnmp.c -# End Source File -# Begin Source File - -SOURCE=..\win32\winutil.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wsyslog.c -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com\com.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\conversion.h -# End Source File -# Begin Source File - -SOURCE=..\win32\grp.h -# End Source File -# Begin Source File - -SOURCE=..\win32\param.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_COM.h -# End Source File -# Begin Source File - -SOURCE=..\win32\php_registry.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_VARIANT.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_versioning.h -# End Source File -# Begin Source File - -SOURCE=..\win32\pwd.h -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.h -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.h -# End Source File -# Begin Source File - -SOURCE=..\win32\syslog.h -# End Source File -# Begin Source File - -SOURCE=..\win32\time.h -# End Source File -# Begin Source File - -SOURCE=..\win32\unistd.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\variant.h -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.h -# End Source File -# End Group -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ChangeLog -# End Source File -# Begin Source File - -SOURCE=..\LICENSE -# End Source File -# End Group -# Begin Group "Support" - -# PROP Default_Filter "" -# End Target -# End Project diff --git a/win32/php5dllts.dsp b/win32/php5dllts.dsp deleted file mode 100644 index 745d800f4fc61..0000000000000 --- a/win32/php5dllts.dsp +++ /dev/null @@ -1,2383 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dllts" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5dllts - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5dllts.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5dllts.mak" CFG="php5dllts - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5dllts - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"msvcrt" /out:"..\Debug_TS\php5ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug" /libpath:"..\..\libxml\lib\Debug" /libpath:"..\ext\sqlite\Debug_TS" /libpath:"..\..\libiconv\lib" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"Release_TS" /libpath:"..\ext\sqlite\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dllts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"Release_TS/php5ts.dll" /libpath:"TSRM\Release_TS" /libpath:"Zend\Release_TS" /libpath:"..\bindlib_w32\Release" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php5ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" /libpath:"..\ext\sqlite\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dllts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php5ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"Release_TSDbg" /libpath:"..\ext\sqlite\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" - -!ENDIF - -# Begin Target - -# Name "php5dllts - Win32 Debug_TS" -# Name "php5dllts - Win32 Release_TS" -# Name "php5dllts - Win32 Release_TS_inline" -# Name "php5dllts - Win32 Release_TSDbg" -# Begin Group "Core" - -# PROP Default_Filter "" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\css.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filters.c -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.c" -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=..\main\internal_functions_win32.c -# End Source File -# Begin Source File - -SOURCE=..\main\main.c -# End Source File -# Begin Source File - -SOURCE=..\main\mergesort.c -# End Source File -# Begin Source File - -SOURCE=..\main\network.c -# End Source File -# Begin Source File - -SOURCE=..\main\output.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_scandir.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\proc_open.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.c -# End Source File -# Begin Source File - -SOURCE=..\main\reentrancy.c -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.c -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.c -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.c -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcat.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcpy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\main\config.w32.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\css.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.h -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.h" -# End Source File -# Begin Source File - -SOURCE=..\main\getopt.h -# End Source File -# Begin Source File - -SOURCE=..\main\logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php.h -# End Source File -# Begin Source File - -SOURCE=..\main\php3_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_globals.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_main.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_regex.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_scandir.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_streams.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.h -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.h -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.h -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.h -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\win95nt.h -# End Source File -# End Group -# End Group -# Begin Group "Function Modules" - -# PROP Default_Filter "" -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 3" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\chartables.c -# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\get.c -# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2 -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\maketables.c -# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2 -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.c -# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2 -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\study.c -# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2 -# End Source File -# End Group -# Begin Group "Header Files No. 3" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\internal.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.h -# End Source File -# End Group -# End Group -# Begin Group "DOM" - -# PROP Default_Filter "" -# Begin Group "DOM Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\dom\attr.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\cdatasection.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\characterdata.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\comment.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\document.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\documentfragment.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\documenttype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_iterators.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domconfiguration.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domerror.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domerrorhandler.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domexception.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementation.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementationlist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementationsource.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domlocator.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domstringlist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\element.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\entity.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\entityreference.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\namednodemap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\namelist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\node.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\nodelist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\notation.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\php_dom.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\processinginstruction.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\string_extend.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\text.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\typeinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\userdatahandler.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\xpath.c -# End Source File -# End Group -# Begin Group "DOM Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\dom\dom_ce.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_fe.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_properties.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\php_dom.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\xml_common.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Group -# Begin Group "SimpleXML" - -# PROP Default_Filter "" -# Begin Group "SimpleXML Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\simplexml\simplexml.c -# End Source File -# End Group -# Begin Group "SimpleXML Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\simplexml\php_simplexml.h -# End Source File -# End Group -# Begin Group "Resource Files No. 1" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Group -# Begin Group "Regular Expressions" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\regex\regcomp.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regerror.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regexec.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regfree.c -# End Source File -# End Group -# Begin Group "XML" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 4" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\xml\compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ctype\ctype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\tokenizer\tokenizer.c -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\wddx.c -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\xml.c -# End Source File -# End Group -# Begin Group "Header Files No. 4" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\wddx\php_wddx.h -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\php_wddx_api.h -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\php_xml.h -# End Source File -# End Group -# End Group -# Begin Group "FTP" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 6" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.c -# End Source File -# End Group -# Begin Group "Header Files No. 6" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.h -# End Source File -# End Group -# End Group -# Begin Group "Calendar" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 7" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\calendar\cal_unix.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\calendar.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\dow.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\easter.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\french.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\gregor.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\jewish.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\julian.c -# End Source File -# End Group -# Begin Group "Header Files No. 7" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\calendar\php_calendar.h -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\sdncal.h -# End Source File -# End Group -# End Group -# Begin Group "bcmath" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 8" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\add.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\compare.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\debug.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\div.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\divmod.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\init.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\int2num.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\neg.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2long.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2str.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\output.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raise.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\recmul.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rt.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\str2num.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sub.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\zero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 8" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\config.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\private.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# End Group -# End Group -# Begin Group "zlib" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 10 Nr. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\zlib\zlib.c -# End Source File -# Begin Source File - -SOURCE=..\ext\zlib\zlib_filter.c -# End Source File -# Begin Source File - -SOURCE=..\ext\zlib\zlib_fopen_wrapper.c -# End Source File -# End Group -# Begin Group "Header Files No. 10 Nr. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\zlib\php_zlib.h -# End Source File -# End Group -# End Group -# Begin Group "Standard" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\array.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\assert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\base64.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\bcmath.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\browscap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\credits.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crypt.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dir.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filestat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\formatted_print.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\ftp_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\image.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\incomplete_class.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\iptc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\lcg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\levenshtein.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\link.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mail.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\math.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\metaphone.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\microtime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_files.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pack.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.c -# ADD CPP /D "STATIC" -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\rand.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\session.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\sha1.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\soundex.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\streamsfuncs.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\string.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\strnatcmp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\sunfuncs.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\syslog.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uuencode.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var_unserializer.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\versioning.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\base64.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.h -# End Source File -# Begin Source File - -SOURCE=..\functions\global.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_array.h -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\php_bcmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_crypt.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_dir.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_filestat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrappers.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_http.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_lcg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ldap\php_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_mail.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc_includes.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_rand.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\php_session.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_string.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_sunfuncs.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_syslog.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpdir.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\sha1.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.h -# End Source File -# End Group -# End Group -# Begin Group "SQLite" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\sqlite\php_sqlite.h -# End Source File -# End Group -# Begin Group "Source Files No. 5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\sqlite\sess_sqlite.c -# End Source File -# Begin Source File - -SOURCE=..\ext\sqlite\sqlite.c -# End Source File -# End Group -# End Group -# Begin Group "LIBXML" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 10" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\libxml\php_libxml.h -# End Source File -# End Group -# Begin Group "Source Files No. 9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\libxml\libxml.c -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypt_win32.c -# End Source File -# Begin Source File - -SOURCE=.\glob.c -# End Source File -# Begin Source File - -SOURCE=.\md5crypt.c -# End Source File -# Begin Source File - -SOURCE=..\win32\pwd.c -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.c -# End Source File -# Begin Source File - -SOURCE=..\win32\registry.c -# End Source File -# Begin Source File - -SOURCE=.\select.c -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.c -# End Source File -# Begin Source File - -SOURCE=..\win32\time.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.c -# End Source File -# Begin Source File - -SOURCE=..\ext\snmp\winsnmp.c -# End Source File -# Begin Source File - -SOURCE=..\win32\winutil.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wsyslog.c -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypt_win32.h -# End Source File -# Begin Source File - -SOURCE=.\glob.h -# End Source File -# Begin Source File - -SOURCE=..\win32\grp.h -# End Source File -# Begin Source File - -SOURCE=..\win32\param.h -# End Source File -# Begin Source File - -SOURCE=..\win32\php_registry.h -# End Source File -# Begin Source File - -SOURCE=..\win32\pwd.h -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\select.h -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.h -# End Source File -# Begin Source File - -SOURCE=..\win32\syslog.h -# End Source File -# Begin Source File - -SOURCE=..\win32\time.h -# End Source File -# Begin Source File - -SOURCE=..\win32\unistd.h -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.h -# End Source File -# Begin Source File - -SOURCE=.\winutil.h -# End Source File -# End Group -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ChangeLog -# End Source File -# Begin Source File - -SOURCE=..\LICENSE -# End Source File -# Begin Source File - -SOURCE=..\NEWS -# End Source File -# Begin Source File - -SOURCE="..\php.ini-dist" -# End Source File -# Begin Source File - -SOURCE="..\php.ini-recommended" -# End Source File -# Begin Source File - -SOURCE="..\README.CVS-RULES" -# End Source File -# Begin Source File - -SOURCE=..\TODO -# End Source File -# End Group -# Begin Group "Support" - -# PROP Default_Filter "" -# End Group -# Begin Group "Streams" - -# PROP Default_Filter "" -# Begin Group "streams headers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\main\streams\php_stream_context.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_filter_api.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_mmap.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_plain_wrapper.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_transport.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_userspace.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_streams_int.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\main\streams\cast.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\filter.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\memory.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\mmap.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\plain_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\transports.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\user_filters.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\userspace.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\xp_socket.c -# End Source File -# End Group -# Begin Group "COM and DotNet" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_saproxy.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\php_com_dotnet.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\php_com_dotnet_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_com.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_dotnet.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_extension.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_handlers.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_iterator.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_misc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_olechar.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_persist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_typeinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_variant.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5dllts.rc -# End Source File -# Begin Source File - -SOURCE=.\php5dllts.rc2 -# End Source File -# Begin Source File - -SOURCE=.\phpts.def - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/win32/php5dllts.rc b/win32/php5dllts.rc deleted file mode 100644 index 2e01037eee342..0000000000000 --- a/win32/php5dllts.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5dllts.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5dllts.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5dllts.rc2 b/win32/php5dllts.rc2 deleted file mode 100644 index 160177117ddaa..0000000000000 --- a/win32/php5dllts.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php\0" - VALUE "LegalCopyright", "Copyright İ 1997-2005 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php5ts.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php5ts.dsp b/win32/php5ts.dsp deleted file mode 100644 index 3922904e6d91b..0000000000000 --- a/win32/php5ts.dsp +++ /dev/null @@ -1,187 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5ts - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5ts.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5ts.mak" CFG="php5ts - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5ts - Win32 Release_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Debug_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5ts - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" - -!ELSEIF "$(CFG)" == "php5ts - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib netapi32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS/php.exe" /pdbtype:sept /libpath:"..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS" -# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\php.exe" /libpath:"..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5ts - Win32 Release_TS" -# Name "php5ts - Win32 Debug_TS" -# Name "php5ts - Win32 Release_TS_inline" -# Name "php5ts - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cgi\cgi_main.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\getopt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\sapi\cgi\php_getopt.h -# End Source File -# End Group -# Begin Group "libfcgi" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\sapi\cgi\libfcgi\fcgiapp.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\libfcgi\os_win32.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5ts.rc -# End Source File -# Begin Source File - -SOURCE=.\php5ts.rc2 -# End Source File -# End Target -# End Project diff --git a/win32/php5ts.dsw b/win32/php5ts.dsw deleted file mode 100644 index 61ccd1c24bccf..0000000000000 --- a/win32/php5ts.dsw +++ /dev/null @@ -1,227 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "EngineSelect"=.\EngineSelect.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ZendTS"=..\Zend\ZendTS.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name EngineSelect - End Project Dependency -}}} - -############################################################################### - -Project: "libsqlite"=..\ext\sqlite\libsqlite\src\libsqlite.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "php5aolserver"=..\sapi\aolserver\php5aolserver.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5apache"=..\sapi\apache\php5apache.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5apache2"=..\SAPI\APACHE2HANDLER\php5apache2.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5dllts"=.\php5dllts.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name ZendTS - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsqlite - End Project Dependency -}}} - -############################################################################### - -Project: "php5isapi"=..\sapi\isapi\php5isapi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5nsapi"=..\sapi\nsapi\php5nsapi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5pi3web"=..\sapi\pi3web\php5pi3web.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5ts"=.\php5ts.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5ts_cli"=.\php5ts_cli.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "testsuite"=.\testsuite.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5ts - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php5ts.rc b/win32/php5ts.rc deleted file mode 100644 index d9a4aa541b1e5..0000000000000 --- a/win32/php5ts.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5ts.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5ts.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5ts.rc2 b/win32/php5ts.rc2 deleted file mode 100644 index 4c9710527fd66..0000000000000 --- a/win32/php5ts.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php-cgi\0" - VALUE "LegalCopyright", "Copyright İ 1997-2005 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe CGI\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php5ts_cli.dsp b/win32/php5ts_cli.dsp deleted file mode 100644 index 37a4113ad4ec5..0000000000000 --- a/win32/php5ts_cli.dsp +++ /dev/null @@ -1,175 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts_cli" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5ts_cli - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5ts_cli.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5ts_cli.mak" CFG="php5ts_cli - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5ts_cli - Win32 Release_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Debug_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5ts_cli - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\cli\php.exe" /libpath:"..\Release_TS" - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib netapi32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS\cli\php.exe" /pdbtype:sept /libpath:"..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\cli\php.exe" /libpath:"..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5ts_cli - Win32 Release_TS" -# Name "php5ts_cli - Win32 Debug_TS" -# Name "php5ts_cli - Win32 Release_TS_inline" -# Name "php5ts_cli - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cli\getopt.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cli\php_cli.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\sapi\cli\php_getopt.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5ts_cli.rc -# End Source File -# Begin Source File - -SOURCE=.\php5ts_cli.rc2 -# End Source File -# End Target -# End Project diff --git a/win32/php5ts_cli.rc b/win32/php5ts_cli.rc deleted file mode 100644 index 0053e0c7f2b21..0000000000000 --- a/win32/php5ts_cli.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5ts_cli.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5ts_cli.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5ts_cli.rc2 b/win32/php5ts_cli.rc2 deleted file mode 100644 index 64d5212ec0aba..0000000000000 --- a/win32/php5ts_cli.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php-cli\0" - VALUE "LegalCopyright", "Copyright İ 1997-2005 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe Command Line Interface\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php_modules.dsw b/win32/php_modules.dsw deleted file mode 100644 index 81f22fa44f2fb..0000000000000 --- a/win32/php_modules.dsw +++ /dev/null @@ -1,473 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "bz2"=..\ext\bz2\bz2.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ctype"=..\ext\ctype\ctype.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "curl"=..\ext\curl\curl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dba"=..\ext\dba\dba.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dbase"=..\ext\dbase\dbase.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dbx"=..\ext\dbx\dbx.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "exif"=..\ext\exif\exif.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "fbsql"=..\ext\fbsql\fbsql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "fdf"=..\ext\fdf\fdf.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "filepro"=..\ext\filepro\filepro.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "gd"=..\ext\gd\gd.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "gettext"=..\ext\gettext\gettext.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "iconv"=..\ext\iconv\iconv.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ifx"=..\ext\informix\ifx.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "imap"=..\ext\imap\imap.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ingres"=..\ext\ingres_ii\ingres.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "interbase"=..\ext\interbase\interbase.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ldap"=..\ext\ldap\ldap.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mbstring"=..\ext\mbstring\mbstring.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mcrypt"=..\ext\mcrypt\mcrypt.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mcve"=..\ext\mcve\mcve.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mhash"=..\ext\mhash\mhash.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mime_magic"=..\ext\mime_magic\mime_magic.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ming"=..\ext\ming\ming.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "msql"=..\ext\msql\msql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mssql"=..\ext\mssql\mssql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mysql"=..\ext\mysql\mysql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "oci8"=..\ext\oci8\oci8.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "openssl"=..\ext\openssl\openssl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "oracle"=..\ext\oracle\oracle.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "pgsql"=..\ext\pgsql\pgsql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "shmop"=..\ext\shmop\shmop.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "snmp"=..\ext\snmp\snmp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "sockets"=..\ext\sockets\sockets.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "sybase_ct"=..\ext\sybase_ct\sybase_ct.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "tokenizer"=..\ext\tokenizer\tokenizer.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "xmlrpc"=..\ext\xmlrpc\xmlrpc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "xsl"=..\ext\xsl\xsl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php_registry.h b/win32/php_registry.h deleted file mode 100644 index 2b111dbb8b25c..0000000000000 --- a/win32/php_registry.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef PHP_REGISTRY_H -#define PHP_REGISTRY_H - - -void UpdateIniFromRegistry(char *path TSRMLS_DC); -char *GetIniPathFromRegistry(); - -#endif /* PHP_REGISTRY_H */ diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h deleted file mode 100755 index f30f9093c2aa9..0000000000000 --- a/win32/php_win32_globals.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_WIN32_GLOBALS_H -#define PHP_WIN32_GLOBALS_H - -/* misc globals for thread-safety under win32 */ - -#include "pwd.h" - -typedef struct _php_win32_core_globals php_win32_core_globals; - -#ifdef ZTS -# define PW32G(v) TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v) -extern PHPAPI int php_win32_core_globals_id; -#else -# define PW32G(v) (the_php_win32_core_globals.v) -extern PHPAPI struct _php_win32_core_globals the_php_win32_core_globals; -#endif - -struct _php_win32_core_globals { - /* syslog */ - char *log_header; - HANDLE log_source; - - /* getpwuid */ - struct passwd pwd; - - /* getlogin */ - char *login_name; - - /* time */ - struct timeval starttime; - __int64 lasttime, freq; -}; - -void php_win32_core_globals_ctor(void *vg TSRMLS_DC); -PHP_RSHUTDOWN_FUNCTION(win32_core_globals); - -#endif - diff --git a/win32/pwd.c b/win32/pwd.c deleted file mode 100644 index 07d5b83d09176..0000000000000 --- a/win32/pwd.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" /*php specific */ -#include -#include -#include -#include -#include -#include "pwd.h" -#include "grp.h" -#include "php_win32_globals.h" - -static char *home_dir = "."; -static char *login_shell = "not command.com!"; - -struct passwd * -getpwnam(char *name) -{ - return (struct passwd *) 0; -} - - -char * -getlogin() -{ - char name[256]; - DWORD max_len = 256; - TSRMLS_FETCH(); - - STR_FREE(PW32G(login_name)); - GetUserName(name, &max_len); - name[max_len] = '\0'; - PW32G(login_name) = estrdup(name); - return PW32G(login_name); -} - -struct passwd * -getpwuid(int user_id) -{ - TSRMLS_FETCH(); - PW32G(pwd).pw_name = getlogin(); - PW32G(pwd).pw_dir = home_dir; - PW32G(pwd).pw_shell = login_shell; - PW32G(pwd).pw_uid = 0; - - return &PW32G(pwd); -} - diff --git a/win32/pwd.h b/win32/pwd.h deleted file mode 100644 index 37f577aca698a..0000000000000 --- a/win32/pwd.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PWD_H -#define PWD_H - -struct passwd { - char *pw_name; - char *pw_passwd; - int pw_uid; - int pw_gid; - char *pw_comment; - char *pw_gecos; - char *pw_dir; - char *pw_shell; -}; - -extern struct passwd *getpwuid(int); -extern struct passwd *getpwnam(char *name); -extern char *getlogin(void); -#endif diff --git a/win32/pws-php5cgi.reg b/win32/pws-php5cgi.reg deleted file mode 100644 index 46edc77386496..0000000000000 --- a/win32/pws-php5cgi.reg +++ /dev/null @@ -1,6 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] -".php"="[PUT PATH HERE]\\php.exe" - - diff --git a/win32/pws-php5isapi.reg b/win32/pws-php5isapi.reg deleted file mode 100644 index 393604d28deed..0000000000000 --- a/win32/pws-php5isapi.reg +++ /dev/null @@ -1,5 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] -".php"="[PUT PATH HERE]\\php5isapi.dll" - diff --git a/win32/readdir.c b/win32/readdir.c deleted file mode 100644 index 6aaafced442b8..0000000000000 --- a/win32/readdir.c +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include -#include - -#include "readdir.h" -#include "php.h" - -/********************************************************************** - * Implement dirent-style opendir/readdir/rewinddir/closedir on Win32 - * - * Functions defined are opendir(), readdir(), rewinddir() and - * closedir() with the same prototypes as the normal dirent.h - * implementation. - * - * Does not implement telldir(), seekdir(), or scandir(). The dirent - * struct is compatible with Unix, except that d_ino is always 1 and - * d_off is made up as we go along. - * - * The DIR typedef is not compatible with Unix. - **********************************************************************/ - -DIR *opendir(const char *dir) -{ - DIR *dp; - char *filespec; - long handle; - int index; - - filespec = malloc(strlen(dir) + 2 + 1); - strcpy(filespec, dir); - index = strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || - (filespec[index] == '\\' && !IsDBCSLeadByte(filespec[index-1])))) - filespec[index] = '\0'; - strcat(filespec, "/*"); - - dp = (DIR *) malloc(sizeof(DIR)); - dp->offset = 0; - dp->finished = 0; - - if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) { - if (errno == ENOENT) { - dp->finished = 1; - } else { - free(dp); - free(filespec); - return NULL; - } - } - dp->dir = strdup(dir); - dp->handle = handle; - free(filespec); - - return dp; -} - -struct dirent *readdir(DIR *dp) -{ - if (!dp || dp->finished) - return NULL; - - if (dp->offset != 0) { - if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { - dp->finished = 1; - return NULL; - } - } - dp->offset++; - - strlcpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME+1); - dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); - dp->dent.d_off = dp->offset; - - return &(dp->dent); -} - -int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result) -{ - if (!dp || dp->finished) { - *result = NULL; - return 0; - } - - if (dp->offset != 0) { - if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { - dp->finished = 1; - *result = NULL; - return 0; - } - } - dp->offset++; - - strlcpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME+1); - dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); - dp->dent.d_off = dp->offset; - - memcpy(entry, &dp->dent, sizeof(*entry)); - - *result = &dp->dent; - - return 0; -} - -int closedir(DIR *dp) -{ - if (!dp) - return 0; - _findclose(dp->handle); - if (dp->dir) - free(dp->dir); - if (dp) - free(dp); - - return 0; -} - -int rewinddir(DIR *dp) -{ - /* Re-set to the beginning */ - char *filespec; - long handle; - int index; - - _findclose(dp->handle); - - dp->offset = 0; - dp->finished = 0; - - filespec = malloc(strlen(dp->dir) + 2 + 1); - strcpy(filespec, dp->dir); - index = strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\')) - filespec[index] = '\0'; - strcat(filespec, "/*"); - - if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) { - if (errno == ENOENT) - dp->finished = 1; - } - dp->handle = handle; - free(filespec); - -return 0; -} diff --git a/win32/readdir.h b/win32/readdir.h deleted file mode 100644 index 419dc95c24b05..0000000000000 --- a/win32/readdir.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef READDIR_H -#define READDIR_H - - -/* - * Structures and types used to implement opendir/readdir/closedir - * on Windows 95/NT. - */ - -#include -#include -#include -#include - - -/* struct dirent - same as Unix */ - -struct dirent { - long d_ino; /* inode (always 1 in WIN32) */ - off_t d_off; /* offset to this dirent */ - unsigned short d_reclen; /* length of d_name */ - char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */ -}; - - -/* typedef DIR - not the same as Unix */ -typedef struct { - long handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ - short finished; /* 1 if there are not more files */ - struct _finddata_t fileinfo; /* from _findfirst/_findnext */ - char *dir; /* the dir we are reading */ - struct dirent dent; /* the dirent to return */ -} DIR; - -/* Function prototypes */ -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -int closedir(DIR *); -int rewinddir(DIR *); - -#endif /* READDIR_H */ diff --git a/win32/registry.c b/win32/registry.c deleted file mode 100644 index 95d142cfa8b5e..0000000000000 --- a/win32/registry.c +++ /dev/null @@ -1,114 +0,0 @@ -#include "php.h" -#include "php_ini.h" - -#define PHP_REGISTRY_KEY "SOFTWARE\\PHP" - -void UpdateIniFromRegistry(char *path TSRMLS_DC) -{ - char *p, *orig_path; - HKEY MainKey; - char *strtok_buf = NULL; - - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY "\\Per Directory Values", 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) { - return; - } - - orig_path = path = estrdup(path); - - /* Get rid of C:, if exists */ - p = strchr(path, ':'); - if (p) { - *p = path[0]; /* replace the colon with the drive letter */ - path = p; /* make path point to the drive letter */ - } else { - if (path[0] != '\\' && path[0] != '/') { - char tmp_buf[MAXPATHLEN], *cwd; - char drive_letter; - - /* get current working directory and prepend it to the path */ - if (!VCWD_GETCWD(tmp_buf, MAXPATHLEN)) { - efree(orig_path); - return; - } - cwd = strchr(tmp_buf, ':'); - if (!cwd) { - drive_letter = 'C'; - cwd = tmp_buf; - } else { - drive_letter = tmp_buf[0]; - cwd++; - } - while (*cwd == '\\' || *cwd == '/') { - cwd++; - } - path = (char *) emalloc(2+strlen(cwd)+1+strlen(orig_path)+1); - sprintf(path, "%c\\%s\\%s", drive_letter, cwd, orig_path); - efree(orig_path); - orig_path = path; - } - } - - - path = p = php_strtok_r(path, "\\/", &strtok_buf); - - while (p) { - HKEY hKey; - DWORD lType; - DWORD values = 0, max_name = 0, max_value = 0, i = 0; - - if (p>path) { - *(p-1) = '\\'; /* restore the slash */ - } - - if (RegOpenKeyEx(MainKey, path, 0, KEY_READ, &hKey)!=ERROR_SUCCESS) { - break; - } - - if(RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &values, &max_name, &max_value, NULL, NULL) == ERROR_SUCCESS) { - LPTSTR namebuf = (LPTSTR)emalloc(max_name + 1); - PBYTE valuebuf = (PBYTE)emalloc(max_value); - - while (i < values) { - DWORD namebuf_len = max_name + 1; - DWORD valuebuf_len = max_value; - - RegEnumValue(hKey, i, namebuf, &namebuf_len, NULL, &lType, valuebuf, &valuebuf_len); - - if ((lType == REG_SZ) || (lType == REG_EXPAND_SZ)) { - /* valuebuf_len includes trailing 0 */ - zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len?valuebuf_len-1:0, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - } - - i++; - } - - efree(namebuf); - efree(valuebuf); - } - - RegCloseKey(hKey); - p = php_strtok_r(NULL, "\\/", &strtok_buf); - } - RegCloseKey(MainKey); - efree(orig_path); -} - -#define PHPRC_REGISTRY_NAME "IniFilePath" - -char *GetIniPathFromRegistry() -{ - char *reg_location = NULL; - HKEY hKey; - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - DWORD buflen = MAXPATHLEN; - reg_location = emalloc(MAXPATHLEN+1); - if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) { - efree(reg_location); - reg_location = NULL; - return reg_location; - } - RegCloseKey(hKey); - } - return reg_location; -} diff --git a/win32/resource.h b/win32/resource.h deleted file mode 100644 index 3e7e4c0ed1eec..0000000000000 --- a/win32/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by php5dllts.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/win32/select.c b/win32/select.c deleted file mode 100644 index 43de2c256666f..0000000000000 --- a/win32/select.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "php_network.h" - -#ifdef PHP_WIN32 - -/* $Id$ */ - -/* Win32 select() will only work with sockets, so we roll our own implementation here. - * - If you supply only sockets, this simply passes through to winsock select(). - * - If you supply file handles, there is no way to distinguish between - * ready for read/write or OOB, so any set in which the handle is found will - * be marked as ready. - * - If you supply a mixture of handles and sockets, the system will interleave - * calls between select() and WaitForMultipleObjects(). The time slicing may - * cause this function call to take up to 100 ms longer than you specified. - * - Calling this with NULL sets as a portable way to sleep with sub-second - * accuracy is not supported. - * */ -PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv) -{ - DWORD ms_total, limit; - HANDLE handles[MAXIMUM_WAIT_OBJECTS]; - int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS]; - int n_handles = 0, i; - fd_set sock_read, sock_write, sock_except; - fd_set aread, awrite, aexcept; - int sock_max_fd = -1; - struct timeval tvslice; - int retcode; - -#define SAFE_FD_ISSET(fd, set) (set != NULL && FD_ISSET(fd, set)) - - /* calculate how long we need to wait in milliseconds */ - if (tv == NULL) { - ms_total = INFINITE; - } else { - ms_total = tv->tv_sec * 1000; - ms_total += tv->tv_usec / 1000; - } - - FD_ZERO(&sock_read); - FD_ZERO(&sock_write); - FD_ZERO(&sock_except); - - /* build an array of handles for non-sockets */ - for (i = 0; i < max_fd; i++) { - if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) { - handles[n_handles] = (HANDLE)_get_osfhandle(i); - if ((DWORD)handles[n_handles] == 0xffffffff) { - /* socket */ - if (SAFE_FD_ISSET(i, rfds)) { - FD_SET(i, &sock_read); - } - if (SAFE_FD_ISSET(i, wfds)) { - FD_SET(i, &sock_write); - } - if (SAFE_FD_ISSET(i, efds)) { - FD_SET(i, &sock_except); - } - if (i > sock_max_fd) { - sock_max_fd = i; - } - } else { - handle_slot_to_fd[n_handles] = i; - n_handles++; - } - } - } - - if (n_handles == 0) { - /* plain sockets only - let winsock handle the whole thing */ - return select(max_fd, rfds, wfds, efds, tv); - } - - /* mixture of handles and sockets; lets multiplex between - * winsock and waiting on the handles */ - - FD_ZERO(&aread); - FD_ZERO(&awrite); - FD_ZERO(&aexcept); - - limit = GetTickCount() + ms_total; - do { - retcode = 0; - - if (sock_max_fd >= 0) { - /* overwrite the zero'd sets here; the select call - * will clear those that are not active */ - aread = sock_read; - awrite = sock_write; - aexcept = sock_except; - - tvslice.tv_sec = 0; - tvslice.tv_usec = 100000; - - retcode = select(sock_max_fd+1, &aread, &awrite, &aexcept, &tvslice); - } - if (n_handles > 0) { - /* check handles */ - DWORD wret; - - wret = MsgWaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100, QS_ALLEVENTS); - - if (wret == WAIT_TIMEOUT) { - /* set retcode to 0; this is the default. - * select() may have set it to something else, - * in which case we leave it alone, so this branch - * does nothing */ - ; - } else if (wret == WAIT_FAILED) { - if (retcode == 0) { - retcode = -1; - } - } else { - if (retcode < 0) { - retcode = 0; - } - for (i = 0; i < n_handles; i++) { - if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) { - if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) { - FD_SET(handle_slot_to_fd[i], &aread); - } - if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) { - FD_SET(handle_slot_to_fd[i], &awrite); - } - if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) { - FD_SET(handle_slot_to_fd[i], &aexcept); - } - retcode++; - } - } - } - } - } while (retcode == 0 && (ms_total == INFINITE || GetTickCount() < limit)); - - if (rfds) { - *rfds = aread; - } - if (wfds) { - *wfds = awrite; - } - if (efds) { - *efds = aexcept; - } - - return retcode; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/win32/select.h b/win32/select.h deleted file mode 100644 index a1f1e4ac789be..0000000000000 --- a/win32/select.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv); - diff --git a/win32/sendmail.c b/win32/sendmail.c deleted file mode 100644 index 5ca4f6adbbf7b..0000000000000 --- a/win32/sendmail.c +++ /dev/null @@ -1,921 +0,0 @@ -/* - * PHP Sendmail for Windows. - * - * This file is rewriten specificly for PHPFI. Some functionality - * has been removed (MIME and file attachments). This code was - * modified from code based on code writen by Jarle Aase. - * - * This class is based on the original code by Jarle Aase, see bellow: - * wSendmail.cpp It has been striped of some functionality to match - * the requirements of phpfi. - * - * Very simple SMTP Send-mail program for sending command-line level - * emails and CGI-BIN form response for the Windows platform. - * - * The complete wSendmail package with source code can be located - * from http://www.jgaa.com - * - */ - -/* $Id$ */ - -#include "php.h" /*php specific */ -#include -#include -#ifndef NETWARE -#include -#include "time.h" -#else /* NETWARE */ -#include -#endif /* NETWARE */ -#include -#include -#ifndef NETWARE -#include -#include -#include -#endif /* NETWARE */ -#include "sendmail.h" -#include "php_ini.h" - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" -#endif - -#include "ext/standard/php_string.h" -#include "ext/date/php_date.h" - -/*enum - { - DO_CONNECT = WM_USER +1 - }; - */ - -/* '*error_message' has to be passed around from php_mail() */ -#define SMTP_ERROR_RESPONSE_SPEC "SMTP server response: %s" -/* Convinient way to handle error messages from the SMTP server. - response is ecalloc()d in Ack() itself and efree()d here - because the content is in *error_message now */ -#define SMTP_ERROR_RESPONSE(response) { \ - if (response && error_message) { \ - if (NULL != (*error_message = ecalloc(1, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response)))) { \ - snprintf(*error_message, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response), SMTP_ERROR_RESPONSE_SPEC, response); \ - } \ - efree(response); \ - } \ - } -#define SMTP_SKIP_SPACE(str) { while (isspace(*str)) { str++; } } - - -#ifndef THREAD_SAFE -char Buffer[MAIL_BUFFER_SIZE]; - -/* socket related data */ -SOCKET sc; -#ifndef NETWARE -WSADATA Data; -struct hostent *adr; -int WinsockStarted; -/* values set by the constructor */ -char *AppName; -#endif /* NETWARE */ -SOCKADDR_IN sock_in; -char MailHost[HOST_NAME_LEN]; -char LocalHost[HOST_NAME_LEN]; -#endif -char seps[] = " ,\t\n"; -#ifndef NETWARE -char *php_mailer = "PHP 4 WIN32"; -#else -char *php_mailer = "PHP 4 NetWare"; -#endif /* NETWARE */ - -/* Error messages */ -static char *ErrorMessages[] = -{ - {"Success"}, /* 0 */ - {"Bad arguments from form"}, /* 1 */ - {"Unable to open temporary mailfile for read"}, - {"Failed to Start Sockets"}, - {"Failed to Resolve Host"}, - {"Failed to obtain socket handle"}, /* 5 */ - {"Failed to connect to mailserver, verify your \"SMTP\" setting in php.ini"}, - {"Failed to Send"}, - {"Failed to Receive"}, - {"Server Error"}, - {"Failed to resolve the host IP name"}, /* 10 */ - {"Out of memory"}, - {"Unknown error"}, - {"Bad Message Contents"}, - {"Bad Message Subject"}, - {"Bad Message destination"}, /* 15 */ - {"Bad Message Return Path"}, - {"Bad Mail Host"}, - {"Bad Message File"}, - {"\"sendmail_from\" not set in php.ini or custom \"From:\" header missing"}, - {"Mailserver rejected our \"sendmail_from\" setting"}, /* 20 */ - {"Error while trimming mail header with PCRE, please file a bug report at http://bugs.php.net/"} /* 21 */ -}; - -/* This pattern converts all single occurences of \n (Unix) - * withour a leading \r to \r\n and all occurences of \r (Mac) - * without a trailing \n to \r\n - * Thx to Nibbler from ircnet/#linuxger - */ -#define PHP_WIN32_MAIL_UNIFY_PATTERN "/(\r\n?)|\n/" -#define PHP_WIN32_MAIL_UNIFY_REPLACE "\r\n" - -/* This pattern removes \r\n from the start of the string, - * \r\n from the end of the string and also makes sure every line - * is only wrapped with a single \r\n (thus reduces multiple - * occurences of \r\n between lines to a single \r\n) */ -#define PHP_WIN32_MAIL_RMVDBL_PATTERN "/^\r\n|(\r\n)+$/m" -#define PHP_WIN32_MAIL_RMVDBL_REPLACE "" - -/* This pattern escapes \n. inside the message body. It prevents - * premature end of message if \n.\n or \r\n.\r\n is encountered - * and ensures that \n. sequences are properly displayed in the - * message body. */ -#define PHP_WIN32_MAIL_DOT_PATTERN "\n." -#define PHP_WIN32_MAIL_DOT_REPLACE "\n.." - -/* This function is meant to unify the headers passed to to mail() - * This means, use PCRE to transform single occurences of \n or \r in \r\n - * As a second step we also eleminate all \r\n occurences which are: - * 1) At the start of the header - * 2) At the end of the header - * 3) Two or more occurences in the header are removed so only one is left - * - * Returns NULL on error, or the new char* buffer on success. - * You have to take care and efree() the buffer on your own. - */ -static char *php_win32_mail_trim_header(char *header TSRMLS_DC) -{ - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - - char *result, *result2; - int result_len; - zval *replace; - - if (!header) { - return NULL; - } - - MAKE_STD_ZVAL(replace); - ZVAL_STRING(replace, PHP_WIN32_MAIL_UNIFY_REPLACE, 0); - - result = php_pcre_replace(PHP_WIN32_MAIL_UNIFY_PATTERN, sizeof(PHP_WIN32_MAIL_UNIFY_PATTERN)-1, - header, strlen(header), - replace, - 0, - &result_len, - -1, - NULL TSRMLS_CC); - if (NULL == result) { - FREE_ZVAL(replace); - return NULL; - } - - ZVAL_STRING(replace, PHP_WIN32_MAIL_RMVDBL_REPLACE, 0); - - result2 = php_pcre_replace(PHP_WIN32_MAIL_RMVDBL_PATTERN, sizeof(PHP_WIN32_MAIL_RMVDBL_PATTERN)-1, - result, result_len, - replace, - 0, - &result_len, - -1, - NULL TSRMLS_CC); - efree(result); - FREE_ZVAL(replace); - return result2; -#else - /* In case we don't have PCRE support (for whatever reason...) simply do nothing and return the unmodified header */ - return estrdup(header); -#endif -} - -/********************************************************************* -// Name: TSendMail -// Input: 1) host: Name of the mail host where the SMTP server resides -// max accepted length of name = 256 -// 2) appname: Name of the application to use in the X-mailer -// field of the message. if NULL is given the application -// name is used as given by the GetCommandLine() function -// max accespted length of name = 100 -// Output: 1) error: Returns the error code if something went wrong or -// SUCCESS otherwise. -// -// See SendText() for additional args! -//********************************************************************/ -PHPAPI int TSendMail(char *host, int *error, char **error_message, - char *headers, char *Subject, char *mailTo, char *data, - char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC) -{ - int ret; - char *RPath = NULL; - char *headers_lc = NULL; /* headers_lc is only created if we've a header at all */ - char *pos1 = NULL, *pos2 = NULL; - -#ifndef NETWARE - WinsockStarted = FALSE; -#endif - - if (host == NULL) { - *error = BAD_MAIL_HOST; - return FAILURE; - } else if (strlen(host) >= HOST_NAME_LEN) { - *error = BAD_MAIL_HOST; - return FAILURE; - } else { - strcpy(MailHost, host); - } - - if (headers) { - char *pos = NULL; - size_t i; - - /* Use PCRE to trim the header into the right format */ - if (NULL == (headers = php_win32_mail_trim_header(headers TSRMLS_CC))) { - *error = W32_SM_PCRE_ERROR; - return FAILURE; - } - - /* Create a lowercased header for all the searches so we're finally case - * insensitive when searching for a pattern. */ - if (NULL == (headers_lc = estrdup(headers))) { - efree(headers); - *error = OUT_OF_MEMORY; - return FAILURE; - } - for (i = 0; i < strlen(headers_lc); i++) { - headers_lc[i] = tolower(headers_lc[i]); - } - } - - /* Fall back to sendmail_from php.ini setting */ - if (mailRPath && *mailRPath) { - RPath = estrdup(mailRPath); - } else if (INI_STR("sendmail_from")) { - RPath = estrdup(INI_STR("sendmail_from")); - } else if ( headers_lc && - (pos1 = strstr(headers_lc, "from:")) && - ((pos1 == headers_lc) || (*(pos1-1) == '\n')) - ) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 5 characters to jump over - * the from: */ - pos1 = headers + (pos1 - headers_lc) + 5; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - RPath = estrndup(pos1, strlen(pos1)); - } else { - RPath = estrndup(pos1, pos2-pos1); - } - } else { - if (headers) { - efree(headers); - efree(headers_lc); - } - *error = W32_SM_SENDMAIL_FROM_NOT_SET; - return FAILURE; - } - - /* attempt to connect with mail host */ - *error = MailConnect(); - if (*error != 0) { - if (RPath) { - efree(RPath); - } - if (headers) { - efree(headers); - efree(headers_lc); - } - /* 128 is safe here, the specifier in snprintf isn't longer than that */ - if (NULL == (*error_message = ecalloc(1, HOST_NAME_LEN + 128))) { - return FAILURE; - } - snprintf(*error_message, HOST_NAME_LEN + 128, - "Failed to connect to mailserver at \"%s\" port %d, verify your \"SMTP\" " - "and \"smtp_port\" setting in php.ini or use ini_set()", - MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port")); - return FAILURE; - } else { - ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message TSRMLS_CC); - TSMClose(); - if (RPath) { - efree(RPath); - } - if (headers) { - efree(headers); - efree(headers_lc); - } - if (ret != SUCCESS) { - *error = ret; - return FAILURE; - } - return SUCCESS; - } -} - -//******************************************************************** -// Name: TSendMail::~TSendMail -// Input: -// Output: -// Description: DESTRUCTOR -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -PHPAPI void TSMClose() -{ - Post("QUIT\r\n"); - Ack(NULL); - /* to guarantee that the cleanup is not made twice and - compomise the rest of the application if sockets are used - elesewhere - */ - - shutdown(sc, 0); - closesocket(sc); -} - - -/********************************************************************* -// Name: char *GetSMErrorText -// Input: Error index returned by the menber functions -// Output: pointer to a string containing the error description -// Description: -// Author/Date: jcar 20/9/96 -// History: -//*******************************************************************/ -PHPAPI char *GetSMErrorText(int index) -{ - if (MIN_ERROR_INDEX <= index && index < MAX_ERROR_INDEX) { - return (ErrorMessages[index]); - - } else { - return (ErrorMessages[UNKNOWN_ERROR]); - - } -} - - -/********************************************************************* -// Name: TSendText -// Input: 1) RPath: return path of the message -// Is used to fill the "Return-Path" and the -// "X-Sender" fields of the message. -// 2) Subject: Subject field of the message. If NULL is given -// the subject is set to "No Subject" -// 3) mailTo: Destination address -// 4) data: Null terminated string containing the data to be send. -// 5,6) headers of the message. Note that the second -// parameter, headers_lc, is actually a lowercased version of -// headers. The should match exactly (in terms of length), -// only differ in case -// Output: Error code or SUCCESS -// Description: -// Author/Date: jcar 20/9/96 -// History: -//*******************************************************************/ -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message TSRMLS_DC) -{ - int res; - char *p; - char *tempMailTo, *token, *pos1, *pos2; - char *server_response = NULL; - char *stripped_header = NULL; - char *data_cln; - int data_cln_len; - - /* check for NULL parameters */ - if (data == NULL) - return (BAD_MSG_CONTENTS); - if (mailTo == NULL) - return (BAD_MSG_DESTINATION); - if (RPath == NULL) - return (BAD_MSG_RPATH); - - /* simple checks for the mailto address */ - /* have ampersand ? */ - /* mfischer, 20020514: I commented this out because it really - seems bogus. Only a username for example may still be a - valid address at the destination system. - if (strchr(mailTo, '@') == NULL) - return (BAD_MSG_DESTINATION); - */ - - sprintf(Buffer, "HELO %s\r\n", LocalHost); - - /* in the beggining of the dialog */ - /* attempt reconnect if the first Post fail */ - if ((res = Post(Buffer)) != SUCCESS) { - MailConnect(); - if ((res = Post(Buffer)) != SUCCESS) - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - - snprintf(Buffer, MAIL_BUFFER_SIZE, "MAIL FROM:<%s>\r\n", RPath); - if ((res = Post(Buffer)) != SUCCESS) - return (res); - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return W32_SM_SENDMAIL_FROM_MALFORMED; - } - - tempMailTo = estrdup(mailTo); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while(token != NULL) - { - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - - if (mailCc && *mailCc) { - tempMailTo = estrdup(mailCc); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while(token != NULL) - { - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - /* Send mail to all Cc rcpt's */ - else if (headers && (pos1 = strstr(headers_lc, "cc:")) && ((pos1 == headers_lc) || (*(pos1-1) == '\n'))) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 3 characters to jump over - * the cc: */ - pos1 = headers + (pos1 - headers_lc) + 3; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - - tempMailTo = estrndup(pos1, strlen(pos1)); - - } else { - tempMailTo = estrndup(pos1, pos2-pos1); - - } - - token = strtok(tempMailTo, ","); - while(token != NULL) - { - SMTP_SKIP_SPACE(token); - sprintf(Buffer, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) - return (res); - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - - /* Send mail to all Bcc rcpt's - This is basically a rip of the Cc code above. - Just don't forget to remove the Bcc: from the header afterwards. */ - if (mailBcc && *mailBcc) { - tempMailTo = estrdup(mailBcc); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while(token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - else if (headers) { - if (pos1 = strstr(headers_lc, "bcc:")) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 4 characters to jump over - * the bcc: */ - pos1 = headers + (pos1 - headers_lc) + 4; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - int foo = strlen(pos1); - tempMailTo = estrndup(pos1, strlen(pos1)); - /* Later, when we remove the Bcc: out of the - header we know it was the last thing. */ - pos2 = pos1; - } else { - tempMailTo = estrndup(pos1, pos2 - pos1); - } - - token = strtok(tempMailTo, ","); - while(token != NULL) - { - SMTP_SKIP_SPACE(token); - sprintf(Buffer, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - - /* Now that we've identified that we've a Bcc list, - remove it from the current header. */ - if (NULL == (stripped_header = ecalloc(1, strlen(headers)))) { - return OUT_OF_MEMORY; - } - /* headers = point to string start of header - pos1 = pointer IN headers where the Bcc starts - '4' = Length of the characters 'bcc:' - Because we've added +4 above for parsing the Emails - we've to substract them here. */ - memcpy(stripped_header, headers, pos1 - headers - 4); - if (pos1 != pos2) { - /* if pos1 != pos2 , pos2 points to the rest of the headers. - Since pos1 != pos2 if "\r\n" was found, we know those characters - are there and so we jump over them (else we would generate a new header - which would look like "\r\n\r\n". */ - memcpy(stripped_header + (pos1 - headers - 4), pos2 + 2, strlen(pos2) - 2); - } - } - } - - /* Simplify the code that we create a copy of stripped_header no matter if - we actually strip something or not. So we've a single efree() later. */ - if (headers && !stripped_header) { - if (NULL == (stripped_header = estrndup(headers, strlen(headers)))) { - return OUT_OF_MEMORY; - } - } - - if ((res = Post("DATA\r\n")) != SUCCESS) { - if (stripped_header) { - efree(stripped_header); - } - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - if (stripped_header) { - efree(stripped_header); - } - return (res); - } - - /* send message header */ - if (Subject == NULL) { - res = PostHeader(RPath, "No Subject", mailTo, stripped_header TSRMLS_CC); - } else { - res = PostHeader(RPath, Subject, mailTo, stripped_header TSRMLS_CC); - } - if (stripped_header) { - efree(stripped_header); - } - if (res != SUCCESS) { - return (res); - } - - /* Escape \n. sequences - * We use php_str_to_str() and not php_str_replace_in_subject(), since the latter - * uses ZVAL as it's parameters */ - data_cln = php_str_to_str(data, strlen(data), PHP_WIN32_MAIL_DOT_PATTERN, sizeof(PHP_WIN32_MAIL_DOT_PATTERN) - 1, - PHP_WIN32_MAIL_DOT_REPLACE, sizeof(PHP_WIN32_MAIL_DOT_REPLACE) - 1, &data_cln_len); - if (!data_cln) { - data_cln = estrdup(""); - data_cln_len = 1; - } - - /* send message contents in 1024 chunks */ - { - char c, *e2, *e = data_cln + data_cln_len; - p = data_cln; - - while (e - p > 1024) { - e2 = p + 1024; - c = *e2; - *e2 = '\0'; - if ((res = Post(p)) != SUCCESS) { - efree(data_cln); - return(res); - } - *e2 = c; - p = e2; - } - if ((res = Post(p)) != SUCCESS) { - efree(data_cln); - return(res); - } - } - - efree(data_cln); - - /*send termination dot */ - if ((res = Post("\r\n.\r\n")) != SUCCESS) - return (res); - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - - return (SUCCESS); -} - -static int addToHeader(char **header_buffer, const char *specifier, char *string) -{ - if (NULL == (*header_buffer = erealloc(*header_buffer, strlen(*header_buffer) + strlen(specifier) + strlen(string) + 1))) { - return 0; - } - sprintf(*header_buffer + strlen(*header_buffer), specifier, string); - return 1; -} - -/********************************************************************* -// Name: PostHeader -// Input: 1) return path -// 2) Subject -// 3) destination address -// 4) headers -// Output: Error code or Success -// Description: -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC) -{ - /* Print message header according to RFC 822 */ - /* Return-path, Received, Date, From, Subject, Sender, To, cc */ - - int res; - char *header_buffer; - char *headers_lc = NULL; - size_t i; - - if (xheaders) { - if (NULL == (headers_lc = estrdup(xheaders))) { - return OUT_OF_MEMORY; - } - for (i = 0; i < strlen(headers_lc); i++) { - headers_lc[i] = tolower(headers_lc[i]); - } - } - - if (NULL == (header_buffer = ecalloc(1, MAIL_BUFFER_SIZE))) { - efree(headers_lc); - return OUT_OF_MEMORY; - } - - if (!xheaders || !strstr(headers_lc, "date:")) { - time_t tNow = time(NULL); - char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC); - - sprintf(header_buffer, "Date: %s\r\n", dt); - efree(dt); - } - - if (!headers_lc || !strstr(headers_lc, "from:")) { - if (!addToHeader(&header_buffer, "From: %s\r\n", RPath)) { - goto PostHeader_outofmem; - } - } - if (!addToHeader(&header_buffer, "Subject: %s\r\n", Subject)) { - goto PostHeader_outofmem; - } - - /* Only add the To: field from the $to parameter if isn't in the custom headers */ - if ((headers_lc && (!strstr(headers_lc, "\r\nto:") && (strncmp(headers_lc, "to:", 3) != 0))) || !headers_lc) { - if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { - goto PostHeader_outofmem; - } - } - if(xheaders){ - if (!addToHeader(&header_buffer, "%s\r\n", xheaders)) { - goto PostHeader_outofmem; - } - } - - if (headers_lc) { - efree(headers_lc); - } - if ((res = Post(header_buffer)) != SUCCESS) { - efree(header_buffer); - return (res); - } - efree(header_buffer); - - if ((res = Post("\r\n")) != SUCCESS) { - return (res); - } - - return (SUCCESS); - -PostHeader_outofmem: - if (headers_lc) { - efree(headers_lc); - } - return OUT_OF_MEMORY; -} - - - -/********************************************************************* -// Name: MailConnect -// Input: None -// Output: None -// Description: Connect to the mail host and receive the welcome message. -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int MailConnect() -{ - - int res; - short portnum; - - /* Create Socket */ - if ((sc = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) - return (FAILED_TO_OBTAIN_SOCKET_HANDLE); - - /* Get our own host name */ - if (gethostname(LocalHost, HOST_NAME_LEN)) - return (FAILED_TO_GET_HOSTNAME); - - /* Resolve the servers IP */ - /* - if (!isdigit(MailHost[0])||!gethostbyname(MailHost)) - { - return (FAILED_TO_RESOLVE_HOST); - } - */ - - portnum = (short) INI_INT("smtp_port"); - if (!portnum) { - portnum = 25; - } - - /* Connect to server */ - sock_in.sin_family = AF_INET; - sock_in.sin_port = htons(portnum); - sock_in.sin_addr.S_un.S_addr = GetAddr(MailHost); - - if (connect(sc, (LPSOCKADDR) & sock_in, sizeof(sock_in))) - return (FAILED_TO_CONNECT); - - /* receive Server welcome message */ - res = Ack(NULL); - return (res); -} - - -/********************************************************************* -// Name: Post -// Input: -// Output: -// Description: -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int Post(LPCSTR msg) -{ - int len = strlen(msg); - int slen; - int index = 0; - - while (len > 0) { - if ((slen = send(sc, msg + index, len, 0)) < 1) - return (FAILED_TO_SEND); - len -= slen; - index += slen; - } - return (SUCCESS); -} - - - -/********************************************************************* -// Name: Ack -// Input: -// Output: -// Description: -// Get the response from the server. We only want to know if the -// last command was successful. -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int Ack(char **server_response) -{ - static char buf[MAIL_BUFFER_SIZE]; - int rlen; - int Index = 0; - int Received = 0; - - again: - - if ((rlen = recv(sc, buf + Index, ((MAIL_BUFFER_SIZE) - 1) - Received, 0)) < 1) - return (FAILED_TO_RECEIVE); - - Received += rlen; - buf[Received] = 0; - /*err_msg fprintf(stderr,"Received: (%d bytes) %s", rlen, buf + Index); */ - - /* Check for newline */ - Index += rlen; - - /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;) - * The response code must contain at least 5 characters ex. 220\r\n */ - if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') { - goto again; - } - - if (buf[0] > '3') { - /* If we've a valid pointer, return the SMTP server response so the error message contains more information */ - if (server_response) { - int dec = 0; - /* See if we have something like \r, \n, \r\n or \n\r at the end of the message and chop it off */ - if (Received > 2) { - if (buf[Received-1] == '\n' || buf[Received-1] == '\r') { - dec++; - if (buf[Received-2] == '\r' || buf[Received-2] == '\n') { - dec++; - } - } - - } - *server_response = estrndup(buf, Received - dec); - } - return (SMTP_SERVER_ERROR); - } - - return (SUCCESS); -} - - -/********************************************************************* -// Name: unsigned long GetAddr (LPSTR szHost) -// Input: -// Output: -// Description: Given a string, it will return an IP address. -// - first it tries to convert the string directly -// - if that fails, it tries o resolve it as a hostname -// -// WARNING: gethostbyname() is a blocking function -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static unsigned long GetAddr(LPSTR szHost) -{ - LPHOSTENT lpstHost; - u_long lAddr = INADDR_ANY; - - /* check that we have a string */ - if (*szHost) { - - /* check for a dotted-IP address string */ - lAddr = inet_addr(szHost); - - /* If not an address, then try to resolve it as a hostname */ - if ((lAddr == INADDR_NONE) && (strcmp(szHost, "255.255.255.255"))) { - - lpstHost = gethostbyname(szHost); - if (lpstHost) { /* success */ - lAddr = *((u_long FAR *) (lpstHost->h_addr)); - } else { - lAddr = INADDR_ANY; /* failure */ - } - } - } - return (lAddr); -} /* end GetAddr() */ diff --git a/win32/sendmail.h b/win32/sendmail.h deleted file mode 100644 index 0ec916d6c8fc7..0000000000000 --- a/win32/sendmail.h +++ /dev/null @@ -1,50 +0,0 @@ -#if !defined(sendmail_h) /* Sentry, use file only if it's not already included. */ -#define sendmail_h -#ifndef NETWARE -#include -#endif - -#define HOST_NAME_LEN 256 -#define MAX_APPNAME_LENGHT 100 -#define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */ -/* Return values */ -#define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */ -#define SUCCESS 0 -#define FAILED_TO_PARSE_ARGUMENTS 1 -#define FAILED_TO_OPEN_MAILFILE 2 -#define FAILED_TO_START_SOCKETS 3 -#define FAILED_TO_RESOLVE_HOST 4 -#define FAILED_TO_OBTAIN_SOCKET_HANDLE 5 -#define FAILED_TO_CONNECT 6 -#define FAILED_TO_SEND 7 -#define FAILED_TO_RECEIVE 8 -#define SMTP_SERVER_ERROR 9 -#define FAILED_TO_GET_HOSTNAME 10 -#define OUT_OF_MEMORY 11 -#define UNKNOWN_ERROR 12 -#define BAD_MSG_CONTENTS 13 -#define BAD_MSG_SUBJECT 14 -#define BAD_MSG_DESTINATION 15 -#define BAD_MSG_RPATH 16 -#define BAD_MAIL_HOST 17 -#define BAD_MSG_FILE 18 -#define W32_SM_SENDMAIL_FROM_NOT_SET 19 -#define W32_SM_SENDMAIL_FROM_MALFORMED 20 -#define W32_SM_PCRE_ERROR 21 -#define MAX_ERROR_INDEX 22 /* Always last error message + 1 */ - - -PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message, - char *RPath, char *Subject, char *mailTo, char *data, - char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC); -PHPAPI void TSMClose(void); -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message TSRMLS_DC); -PHPAPI char *GetSMErrorText(int index); - -static int MailConnect(); -static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC); -static int Post(LPCSTR msg); -static int Ack(char **server_response); -static unsigned long GetAddr(LPSTR szHost); -#endif /* sendmail_h */ diff --git a/win32/signal.h b/win32/signal.h deleted file mode 100644 index de43f98e8075b..0000000000000 --- a/win32/signal.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -** Change here: if you plan to use your own version of -** the original "#include " produces an infinite reinclusion -** of this file, instead of including the standard include-file. -** Under MS Visual Studio, there are occurences in the source where -** gets included throughout the PHP sources, and this should -** include THIS file, not the standard one which does not have the -** additional signals defined below. -** One way to remove the infinite reinclusion of this file (which is located -** in ../win32), is to specify the parent directory in which the standard -** include file is located. -*/ -#include <../include/signal.h> -#define SIGALRM 13 -#define SIGVTALRM 26 /* virtual time alarm */ -#define SIGPROF 27 /* profiling time alarm */ diff --git a/win32/syslog.h b/win32/syslog.h deleted file mode 100644 index a8ded3b0c830c..0000000000000 --- a/win32/syslog.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SYSLOG_H -#define SYSLOG_H -#define WIN32_LEAN_AND_MEAN -#include - -#define LOG_EMERG 1 -#define LOG_ALERT 1 -#define LOG_CRIT 1 -#define LOG_ERR 4 -#define LOG_WARNING 5 -#define LOG_NOTICE 6 -#define LOG_INFO 6 -#define LOG_DEBUG 6 - -#define LOG_PRIMASK 0x07 - -#define LOG_PRI(p) ((p) & LOG_PRIMASK) -#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) - -#define LOG_KERN (0<<3) -#define LOG_USER (1<<3) -#define LOG_MAIL (2<<3) -#define LOG_DAEMON (3<<3) -#define LOG_AUTH (4<<3) -#define LOG_SYSLOG (5<<3) -#define LOG_LPR (6<<3) -#define LOG_NEWS (7<<3) -#define LOG_UUCP (8<<3) -#define LOG_CRON (9<<3) -#define LOG_AUTHPRIV (10<<3) - -#define LOG_NFACILITIES 10 -#define LOG_FACMASK 0x03f8 -#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) - -#define LOG_MASK(pri) (1 << (pri)) -#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) - -/* - * Option flags for openlog. - * - * LOG_ODELAY no longer does anything. - * LOG_NDELAY is the inverse of what it used to be. - */ -#define LOG_PID 0x01 /* log the pid with each message */ -#define LOG_CONS 0x02 /* log on the console if errors in sending */ -#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ -#define LOG_NDELAY 0x08 /* don't delay open */ -#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ -#define LOG_PERROR 0x20 /* log to stderr as well */ - - -extern void closelog(void); -extern void openlog(const char *, int, int); -extern void syslog(int, const char *, ...); - - -#endif /* SYSLOG_H */ diff --git a/win32/syslog.reg b/win32/syslog.reg deleted file mode 100644 index 2baa88e36661f..0000000000000 --- a/win32/syslog.reg +++ /dev/null @@ -1,5 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.1.0-dev] -"TypesSupported"=dword:00000007 -"EventMessageFile"="C:\\php5\\php5ts.dll" diff --git a/win32/testsuite.dsp b/win32/testsuite.dsp deleted file mode 100644 index 5cd65622f5d66..0000000000000 --- a/win32/testsuite.dsp +++ /dev/null @@ -1,150 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testsuite" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Generic Project" 0x010a - -CFG=testsuite - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testsuite.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testsuite.mak" CFG="testsuite - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testsuite - Win32 Release_TS_Inline" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Release_TS" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Release_TSDbg" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Debug_TS" (based on "Win32 (x86) Generic Project") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -MTL=midl.exe - -!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_Inline" -# PROP BASE Intermediate_Dir "Release_TS_Inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_Inline" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TSDbg" -# PROP BASE Intermediate_Dir "Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TSDbg" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "testsuite - Win32 Release_TS_Inline" -# Name "testsuite - Win32 Release_TS" -# Name "testsuite - Win32 Release_TSDbg" -# Name "testsuite - Win32 Debug_TS" -# Begin Source File - -SOURCE=..\results.txt - -!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline" - -# PROP Intermediate_Dir "..\Release_TS_Inline" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TS_Inline -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TS_inline - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS" - -# PROP Intermediate_Dir "..\Release_TS" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TS -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TS - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg" - -# PROP Intermediate_Dir "..\Release_TSDbg" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TSDbg -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TSDbg - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS" - -# PROP Intermediate_Dir "..\Debug_TS" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/win32/time.c b/win32/time.c deleted file mode 100644 index 693f07418536e..0000000000000 --- a/win32/time.c +++ /dev/null @@ -1,228 +0,0 @@ - -/***************************************************************************** - * * - * DH_TIME.C * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * - * Modified by Shane Caraveo for use with PHP - * - *****************************************************************************/ - -/* $Id$ */ - - /** - * - * 04-Feb-2001 - * - Added patch by "Vanhanen, Reijo" - * Improves accuracy of msec - */ - -/* Include stuff ************************************************************ */ - -/* this allows the use of the WaitableTimer functions. - * For win98 and later */ -#define _WIN32_WINNT 0x400 - -#include "time.h" -#include "unistd.h" -#include "signal.h" -#include -#include -#include -#include -#include "php_win32_globals.h" - -int getfilesystemtime(struct timeval *time_Info) -{ -FILETIME ft; -__int64 ff; - - GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */ - /* resolution seems to be 0.01 sec */ - ff = *(__int64*)(&ft); - time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600); - time_Info->tv_usec = (int)(ff % 10000000)/10; - return 0; -} - - - -PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) -{ - __int64 timer; - LARGE_INTEGER li; - BOOL b; - double dt; - TSRMLS_FETCH(); - - /* Get the time, if they want it */ - if (time_Info != NULL) { - if (PW32G(starttime).tv_sec == 0) { - b = QueryPerformanceFrequency(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - PW32G(freq) = li.QuadPart; - b = QueryPerformanceCounter(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - getfilesystemtime(&PW32G(starttime)); - timer = li.QuadPart; - dt = (double)timer/PW32G(freq); - PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000); - if (PW32G(starttime).tv_usec < 0) { - PW32G(starttime).tv_usec += 1000000; - --PW32G(starttime).tv_sec; - } - PW32G(starttime).tv_sec -= (int)dt; - } - } - } - if (PW32G(starttime).tv_sec > 0) { - b = QueryPerformanceCounter(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - timer = li.QuadPart; - if (timer < PW32G(lasttime)) { - getfilesystemtime(time_Info); - dt = (double)timer/PW32G(freq); - PW32G(starttime) = *time_Info; - PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000); - if (PW32G(starttime).tv_usec < 0) { - PW32G(starttime).tv_usec += 1000000; - --PW32G(starttime).tv_sec; - } - PW32G(starttime).tv_sec -= (int)dt; - } - else { - PW32G(lasttime) = timer; - dt = (double)timer/PW32G(freq); - time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt; - time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000); - if (time_Info->tv_usec > 1000000) { - time_Info->tv_usec -= 1000000; - ++time_Info->tv_sec; - } - } - } - } - if (PW32G(starttime).tv_sec < 0) { - getfilesystemtime(time_Info); - } - - } - /* Get the timezone, if they want it */ - if (timezone_Info != NULL) { - _tzset(); - timezone_Info->tz_minuteswest = _timezone; - timezone_Info->tz_dsttime = _daylight; - } - /* And return */ - return 0; -} - -void usleep(unsigned int useconds) -{ - HANDLE timer; - LARGE_INTEGER due; - - due.QuadPart = -(10 * (__int64)useconds); - - timer = CreateWaitableTimer(NULL, TRUE, NULL); - SetWaitableTimer(timer, &due, 0, NULL, NULL, 0); - WaitForSingleObject(timer, INFINITE); - CloseHandle(timer); -} - -#if 0 /* looks pretty ropey in here */ -#ifdef HAVE_SETITIMER - - -#ifndef THREAD_SAFE -unsigned int proftimer, virttimer, realtimer; -extern LPMSG phpmsg; -#endif - -struct timer_msg { - int signal; - unsigned int threadid; -}; - - -LPTIMECALLBACK setitimer_timeout(UINT uTimerID, UINT info, DWORD dwUser, DWORD dw1, DWORD dw2) -{ - struct timer_msg *msg = (struct timer_msg *) info; - - if (msg) { - raise((int) msg->signal); - PostThreadMessage(msg->threadid, - WM_NOTIFY, msg->signal, 0); - free(msg); - } - return 0; -} - -PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) -{ - int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec; - int repeat = TIME_ONESHOT; - - /*make sure the message queue is initialized */ - PeekMessage(phpmsg, NULL, WM_USER, WM_USER, PM_NOREMOVE); - if (timeout > 0) { - struct timer_msg *msg = malloc(sizeof(struct timer_msg)); - msg->threadid = GetCurrentThreadId(); - if (!ovalue) { - repeat = TIME_PERIODIC; - } - switch (which) { - case ITIMER_REAL: - msg->signal = SIGALRM; - realtimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - case ITIMER_VIRT: - msg->signal = SIGVTALRM; - virttimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - case ITIMER_PROF: - msg->signal = SIGPROF; - proftimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - default: - errno = EINVAL; - return -1; - break; - } - } else { - switch (which) { - case ITIMER_REAL: - timeKillEvent(realtimer); - break; - case ITIMER_VIRT: - timeKillEvent(virttimer); - break; - case ITIMER_PROF: - timeKillEvent(proftimer); - break; - default: - errno = EINVAL; - return -1; - break; - } - } - - - return 0; -} - -#endif -#endif - diff --git a/win32/time.h b/win32/time.h deleted file mode 100644 index 5c52e7837e166..0000000000000 --- a/win32/time.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * * - * sys/time.h * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * - * Modified by Shane Caraveo for PHP - * - *****************************************************************************/ -#ifndef TIME_H -#define TIME_H - -/* Include stuff ************************************************************ */ -#include -#include "php.h" - -/* Struct stuff ************************************************************* */ -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - - -struct itimerval { - struct timeval it_interval; /* next value */ - struct timeval it_value; /* current value */ -}; - -#define ITIMER_REAL 0 /*generates sigalrm */ -#define ITIMER_VIRTUAL 1 /*generates sigvtalrm */ -#define ITIMER_VIRT 1 /*generates sigvtalrm */ -#define ITIMER_PROF 2 /*generates sigprof */ - -/* Prototype stuff ********************************************************** */ -PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info); - -/* setitimer operates at 100 millisecond resolution */ -PHPAPI extern int setitimer(int which, const struct itimerval *value, - struct itimerval *ovalue); - -#endif diff --git a/win32/unistd.h b/win32/unistd.h deleted file mode 100644 index 96e0aedc13475..0000000000000 --- a/win32/unistd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _PHP_WIN32_UNISTD_H -#define _PHP_WIN32_UNISTD_H -void usleep(unsigned int useconds); -#endif diff --git a/win32/wfile.c b/win32/wfile.c deleted file mode 100644 index 1407d6a32b26c..0000000000000 --- a/win32/wfile.c +++ /dev/null @@ -1,17 +0,0 @@ - -/* Function borrowed from the Downhill Project */ -#include "wfile.h" -#include "direct.h" - -int readlink(char *file_Name, char *buf_Mem, int buf_Size) -{ - /* See if the file exists */ - if (access(file_Name, X_OK) == -1) { - errno = ENOENT; - } else { - errno = EINVAL; - } - - /* Either way, it's not a link */ - return -1; -} diff --git a/win32/wfile.h b/win32/wfile.h deleted file mode 100644 index 2e79406478c75..0000000000000 --- a/win32/wfile.h +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include - -#define access _access -#define X_OK 0 -#ifndef ENOENT -#define ENOENT 136 -#endif -#ifndef EINVAL -#define EINVAL 131 -#endif - -int readlink(char *, char *, int); -int checkroot(char *path); diff --git a/win32/winutil.c b/win32/winutil.c deleted file mode 100644 index cfadbce724ced..0000000000000 --- a/win32/winutil.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -PHPAPI char *php_win_err(int error) -{ - char *buf = NULL; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0, NULL - ); - - return (buf ? (char *) buf : ""); -} diff --git a/win32/winutil.h b/win32/winutil.h deleted file mode 100644 index 51c9f67f49e28..0000000000000 --- a/win32/winutil.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 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: | - +----------------------------------------------------------------------+ - */ - -PHPAPI char *php_win_err(int error); - -#define php_win_err() php_win_err(GetLastError()) diff --git a/win32/wsyslog.c b/win32/wsyslog.c deleted file mode 100644 index 294b3976c44b5..0000000000000 --- a/win32/wsyslog.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * This file modified from sources for imap4 for use - * in PHP 3 - */ -/* - * Program: Unix compatibility routines - * - * Author: Mark Crispin - * Networks and Distributed Computing - * Computing & Communications - * University of Washington - * Administration Building, AG-44 - * Seattle, WA 98195 - * Internet: MRC@CAC.Washington.EDU - * - * Date: 14 September 1996 - * Last Edited: 22 October 1996 - * - * Copyright 1996 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appears in all copies and that both the - * above copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of Washington not be - * used in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. This software is made available - * "as is", and - * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN - * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - - -/* DEDICATION - - * This file is dedicated to my dog, Unix, also known as Yun-chan and - * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix - * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after - * a two-month bout with cirrhosis of the liver. - * - * He was a dear friend, and I miss him terribly. - * - * Lift a leg, Yunie. Luv ya forever!!!! - */ - -#include "php.h" /*php specific */ -#include "syslog.h" -#include -#include -#include - -#include "php_win32_globals.h" -#include "wsyslog.h" - -void closelog(void) -{ - TSRMLS_FETCH(); - DeregisterEventSource(PW32G(log_source)); - STR_FREE(PW32G(log_header)); - PW32G(log_header) = NULL; -} - -/* Emulator for BSD syslog() routine - * Accepts: priority - * message - * parameters - */ - -void syslog(int priority, const char *message, ...) -{ - va_list args; - LPTSTR strs[2]; - unsigned short etype; - char *tmp = NULL; - DWORD evid; - TSRMLS_FETCH(); - - /* default event source */ - if (!PW32G(log_source)) - openlog("php", LOG_PID, LOG_SYSLOG); - - switch (priority) { /* translate UNIX type into NT type */ - case LOG_ALERT: - etype = EVENTLOG_ERROR_TYPE; - evid = PHP_SYSLOG_ERROR_TYPE; - break; - case LOG_INFO: - etype = EVENTLOG_INFORMATION_TYPE; - evid = PHP_SYSLOG_INFO_TYPE; - break; - default: - etype = EVENTLOG_WARNING_TYPE; - evid = PHP_SYSLOG_WARNING_TYPE; - } - va_start(args, message); /* initialize vararg mechanism */ - vspprintf(&tmp, 0, message, args); /* build message */ - strs[0] = PW32G(log_header); /* write header */ - strs[1] = tmp; /* then the message */ - /* report the event */ - ReportEvent(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strs, NULL); - va_end(args); - efree(tmp); -} - - -/* Emulator for BSD openlog() routine - * Accepts: identity - * options - * facility - */ - -void openlog(const char *ident, int logopt, int facility) -{ - TSRMLS_FETCH(); - - if (PW32G(log_source)) { - closelog(); - } - - STR_FREE(PW32G(log_header)); - - PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION); - spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid()); -}